From: Andrea Bianco Date: Sun, 16 Jan 2022 15:25:45 +0000 (+0100) Subject: Built motion from commit 8a7b3435.|2.5.48 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=343bdb2aa460dd9ee642947d457783ff69ff7c1c;p=motion2.git Built motion from commit 8a7b3435.|2.5.48 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 0c70c9a..3e46f52 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.5.47", + "version": "2.5.48", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-15T17:05:30.472Z", + "time": "2022-01-16T15:10:30.694Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8e84d96..683a76f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.5.47", + "version": "2.5.48", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-15T17:05:30.472Z", + "time": "2022-01-16T15:10:30.694Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/package.json b/package.json index c87aa55..c5310d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.5.47", + "version": "2.5.48", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index b91f521..f10eb21 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 _0x2eec=['contactManager','integration','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x5702fb,_0x3f4105){var _0x2b0178=function(_0x3782c0){while(--_0x3782c0){_0x5702fb['push'](_0x5702fb['shift']());}};_0x2b0178(++_0x3f4105);}(_0x2eec,0xe6));var _0xc2ee=function(_0x53654e,_0x160bcc){_0x53654e=_0x53654e-0x0;var _0x3e5207=_0x2eec[_0x53654e];return _0x3e5207;};'use strict';var Sequelize=require(_0xc2ee('0x0'));module[_0xc2ee('0x1')]={'name':{'type':Sequelize[_0xc2ee('0x2')],'get':function(_0x31c363){return this[_0xc2ee('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc2ee('0x4'),_0xc2ee('0x5'),'motionbar','jscripty',_0xc2ee('0x6'),_0xc2ee('0x7'),_0xc2ee('0x8'),_0xc2ee('0x9')]],'msg':_0xc2ee('0xa')}},'comment':_0xc2ee('0xa')},'data1':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xc')},'data2':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xd')},'data3':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comments':_0xc2ee('0xe')},'data5':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xc2ee('0xb')],'comments':_0xc2ee('0xf')},'data7':{'type':Sequelize[_0xc2ee('0x10')],'comments':_0xc2ee('0x11')}}; \ No newline at end of file +var _0x7bb4=['urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bb4,0x191));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x47bb('0x0')]={'name':{'type':Sequelize[_0x47bb('0x1')],'get':function(_0x527a85){return this['getDataValue'](_0x47bb('0x2'));}},'action':{'type':Sequelize[_0x47bb('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x47bb('0x4'),'integration',_0x47bb('0x5'),_0x47bb('0x6'),'urlForward',_0x47bb('0x7'),_0x47bb('0x8'),'script']],'msg':_0x47bb('0x9')}},'comment':_0x47bb('0x9')},'data1':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xa')},'data2':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xb')},'data3':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x47bb('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x47bb('0xe')},'data6':{'type':Sequelize[_0x47bb('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x47bb('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 837d706..819888d 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 _0x4753=['moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','zip-dir','request-promise'];(function(_0x32f75b,_0x16cde7){var _0x26f5c7=function(_0x2f80b8){while(--_0x2f80b8){_0x32f75b['push'](_0x32f75b['shift']());}};_0x26f5c7(++_0x16cde7);}(_0x4753,0x84));var _0x3475=function(_0x4ad9b3,_0x22fef3){_0x4ad9b3=_0x4ad9b3-0x0;var _0x11c321=_0x4753[_0x4ad9b3];return _0x11c321;};'use strict';var emlformat=require(_0x3475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3475('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require(_0x3475('0x4'));var Mustache=require(_0x3475('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3475('0x6'));var csv=require(_0x3475('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3475('0x8'));var _=require(_0x3475('0x9'));var squel=require(_0x3475('0xa'));var crypto=require('crypto');var jsforce=require(_0x3475('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3475('0xc'));var Redis=require(_0x3475('0xd'));var authService=require(_0x3475('0xe'));var qs=require(_0x3475('0xf'));var as=require(_0x3475('0x10'));var hardwareService=require(_0x3475('0x11'));var logger=require('../../config/logger')(_0x3475('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3475('0x13'));var db=require(_0x3475('0x14'))['db'];function respondWithStatusCode(_0x2801f8,_0x26743a){_0x26743a=_0x26743a||0xcc;return function(_0x29668e){if(_0x29668e){return _0x2801f8[_0x3475('0x15')](_0x26743a);}return _0x2801f8[_0x3475('0x16')](_0x26743a)[_0x3475('0x17')]();};}function respondWithResult(_0x1991a1,_0xd408cb){_0xd408cb=_0xd408cb||0xc8;return function(_0x4d65cc){if(_0x4d65cc){return _0x1991a1['status'](_0xd408cb)['json'](_0x4d65cc);}};}function respondWithFilteredResult(_0x30098c,_0x1b30bf){return function(_0x1e6a4e){if(_0x1e6a4e){var _0x537a1e=typeof _0x1b30bf[_0x3475('0x18')]===_0x3475('0x19')&&typeof _0x1b30bf[_0x3475('0x1a')]===_0x3475('0x19');var _0x1c2043=_0x1e6a4e[_0x3475('0x1b')];var _0x4b6a69=_0x537a1e?0x0:_0x1b30bf[_0x3475('0x18')];var _0x20b00f=_0x537a1e?_0x1e6a4e[_0x3475('0x1b')]:_0x1b30bf[_0x3475('0x18')]+_0x1b30bf[_0x3475('0x1a')];var _0x10096c;if(_0x20b00f>=_0x1c2043){_0x20b00f=_0x1c2043;_0x10096c=0xc8;}else{_0x10096c=0xce;}_0x30098c[_0x3475('0x16')](_0x10096c);return _0x30098c[_0x3475('0x1c')](_0x3475('0x1d'),_0x4b6a69+'-'+_0x20b00f+'/'+_0x1c2043)[_0x3475('0x1e')](_0x1e6a4e);}return null;};}function patchUpdates(_0xe1a150){return function(_0x1ecff8){try{jsonpatch['apply'](_0x1ecff8,_0xe1a150,!![]);}catch(_0x488bc7){return BPromise[_0x3475('0x1f')](_0x488bc7);}return _0x1ecff8[_0x3475('0x20')]();};}function saveUpdates(_0x25fc30,_0x5ded07){return function(_0x220ac7){if(_0x220ac7){return _0x220ac7[_0x3475('0x21')](_0x25fc30)['then'](function(_0x465a76){return _0x465a76;});}return null;};}function removeEntity(_0x1ba636,_0x391435){return function(_0x49b521){if(_0x49b521){return _0x49b521[_0x3475('0x22')]()[_0x3475('0x23')](function(){_0x1ba636[_0x3475('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522b88,_0x2cf552){return function(_0x5e7d40){if(!_0x5e7d40){_0x522b88['sendStatus'](0x194);}return _0x5e7d40;};}function handleError(_0x5e9dd2,_0x2c1fb3){_0x2c1fb3=_0x2c1fb3||0x1f4;return function(_0x5318aa){logger[_0x3475('0x24')](_0x5318aa[_0x3475('0x25')]);if(_0x5318aa[_0x3475('0x26')]){delete _0x5318aa[_0x3475('0x26')];}_0x5e9dd2[_0x3475('0x16')](_0x2c1fb3)[_0x3475('0x27')](_0x5318aa);};}exports[_0x3475('0x21')]=function(_0x14b080,_0x3dcd89){if(_0x14b080[_0x3475('0x28')]['id']){delete _0x14b080[_0x3475('0x28')]['id'];}return db['Action'][_0x3475('0x29')]({'where':{'id':_0x14b080[_0x3475('0x2a')]['id']}})[_0x3475('0x23')](handleEntityNotFound(_0x3dcd89,null))[_0x3475('0x23')](saveUpdates(_0x14b080[_0x3475('0x28')],null))[_0x3475('0x23')](respondWithResult(_0x3dcd89,null))[_0x3475('0x2b')](handleError(_0x3dcd89,null));};exports[_0x3475('0x22')]=function(_0x32ea27,_0x32bc0e){return db[_0x3475('0x2c')]['find']({'where':{'id':_0x32ea27[_0x3475('0x2a')]['id']}})['then'](handleEntityNotFound(_0x32bc0e,null))['then'](removeEntity(_0x32bc0e,null))['catch'](handleError(_0x32bc0e,null));}; \ No newline at end of file +var _0x03c5=['Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','update','body'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x03c5,0x1a2));var _0x503c=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0x03c5[_0x3cb152];return _0x4f54c3;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require(_0x503c('0x1'));var zipdir=require(_0x503c('0x2'));var jsonpatch=require(_0x503c('0x3'));var rp=require('request-promise');var moment=require(_0x503c('0x4'));var BPromise=require(_0x503c('0x5'));var Mustache=require(_0x503c('0x6'));var util=require('util');var path=require(_0x503c('0x7'));var sox=require('sox');var csv=require(_0x503c('0x8'));var ejs=require(_0x503c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x503c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x503c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x503c('0x8'));var querystring=require(_0x503c('0xc'));var Papa=require(_0x503c('0xd'));var Redis=require(_0x503c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x503c('0xf'));var logger=require(_0x503c('0x10'))(_0x503c('0x11'));var utils=require(_0x503c('0x12'));var config=require(_0x503c('0x13'));var licenseUtil=require(_0x503c('0x14'));var db=require(_0x503c('0x15'))['db'];function respondWithStatusCode(_0x80722b,_0x5f5f0b){_0x5f5f0b=_0x5f5f0b||0xcc;return function(_0x2f4c40){if(_0x2f4c40){return _0x80722b[_0x503c('0x16')](_0x5f5f0b);}return _0x80722b[_0x503c('0x17')](_0x5f5f0b)[_0x503c('0x18')]();};}function respondWithResult(_0x493ef5,_0x247a27){_0x247a27=_0x247a27||0xc8;return function(_0xe962fd){if(_0xe962fd){return _0x493ef5[_0x503c('0x17')](_0x247a27)[_0x503c('0x19')](_0xe962fd);}};}function respondWithFilteredResult(_0x25bfe6,_0x477c36){return function(_0x1f2c39){if(_0x1f2c39){var _0x485bd8=typeof _0x477c36[_0x503c('0x1a')]===_0x503c('0x1b')&&typeof _0x477c36[_0x503c('0x1c')]===_0x503c('0x1b');var _0x3f8f1b=_0x1f2c39[_0x503c('0x1d')];var _0x23ecf2=_0x485bd8?0x0:_0x477c36[_0x503c('0x1a')];var _0x201425=_0x485bd8?_0x1f2c39[_0x503c('0x1d')]:_0x477c36[_0x503c('0x1a')]+_0x477c36[_0x503c('0x1c')];var _0x16de92;if(_0x201425>=_0x3f8f1b){_0x201425=_0x3f8f1b;_0x16de92=0xc8;}else{_0x16de92=0xce;}_0x25bfe6[_0x503c('0x17')](_0x16de92);return _0x25bfe6[_0x503c('0x1e')](_0x503c('0x1f'),_0x23ecf2+'-'+_0x201425+'/'+_0x3f8f1b)[_0x503c('0x19')](_0x1f2c39);}return null;};}function patchUpdates(_0x52bf15){return function(_0x22563f){try{jsonpatch['apply'](_0x22563f,_0x52bf15,!![]);}catch(_0x2b3784){return BPromise[_0x503c('0x20')](_0x2b3784);}return _0x22563f[_0x503c('0x21')]();};}function saveUpdates(_0x368b00,_0x374bc3){return function(_0x2e2d2a){if(_0x2e2d2a){return _0x2e2d2a['update'](_0x368b00)['then'](function(_0x6825b1){return _0x6825b1;});}return null;};}function removeEntity(_0x1100e4,_0x466d0c){return function(_0x120b22){if(_0x120b22){return _0x120b22[_0x503c('0x22')]()[_0x503c('0x23')](function(){_0x1100e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be802,_0x58835d){return function(_0x25ad10){if(!_0x25ad10){_0x4be802[_0x503c('0x16')](0x194);}return _0x25ad10;};}function handleError(_0x5714da,_0x1f931a){_0x1f931a=_0x1f931a||0x1f4;return function(_0x544cb8){logger[_0x503c('0x24')](_0x544cb8[_0x503c('0x25')]);if(_0x544cb8[_0x503c('0x26')]){delete _0x544cb8[_0x503c('0x26')];}_0x5714da[_0x503c('0x17')](_0x1f931a)[_0x503c('0x27')](_0x544cb8);};}exports[_0x503c('0x28')]=function(_0x496603,_0x2362ab){if(_0x496603[_0x503c('0x29')]['id']){delete _0x496603[_0x503c('0x29')]['id'];}return db[_0x503c('0x2a')][_0x503c('0x2b')]({'where':{'id':_0x496603['params']['id']}})[_0x503c('0x23')](handleEntityNotFound(_0x2362ab,null))[_0x503c('0x23')](saveUpdates(_0x496603['body'],null))['then'](respondWithResult(_0x2362ab,null))[_0x503c('0x2c')](handleError(_0x2362ab,null));};exports[_0x503c('0x22')]=function(_0x47a329,_0x3a743b){return db[_0x503c('0x2a')][_0x503c('0x2b')]({'where':{'id':_0x47a329[_0x503c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3a743b,null))[_0x503c('0x23')](removeEntity(_0x3a743b,null))[_0x503c('0x2c')](handleError(_0x3a743b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 5e35a6f..c6b018c 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 _0x2c31=['path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','api','moment','request-promise'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x2c31,0x13f));var _0x12c3=function(_0x4a4a82,_0x172322){_0x4a4a82=_0x4a4a82-0x0;var _0x4d069b=_0x2c31[_0x4a4a82];return _0x4d069b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require('../../config/logger')(_0x12c3('0x2'));var moment=require(_0x12c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x12c3('0x4'));var fs=require('fs');var path=require(_0x12c3('0x5'));var rimraf=require(_0x12c3('0x6'));var config=require(_0x12c3('0x7'));var attributes=require(_0x12c3('0x8'));module[_0x12c3('0x9')]=function(_0x273c40,_0x1e63bf){return _0x273c40[_0x12c3('0xa')]('Action',attributes,{'tableName':_0x12c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7a6=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x5a8b3d,_0x540e49){var _0x5b619f=function(_0x55225f){while(--_0x55225f){_0x5a8b3d['push'](_0x5a8b3d['shift']());}};_0x5b619f(++_0x540e49);}(_0xa7a6,0x1d2));var _0x6a7a=function(_0x235983,_0xd22673){_0x235983=_0x235983-0x0;var _0x538b67=_0xa7a6[_0x235983];return _0x538b67;};'use strict';var _=require(_0x6a7a('0x0'));var util=require(_0x6a7a('0x1'));var logger=require(_0x6a7a('0x2'))(_0x6a7a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a7a('0x4'));var fs=require('fs');var path=require(_0x6a7a('0x5'));var rimraf=require(_0x6a7a('0x6'));var config=require(_0x6a7a('0x7'));var attributes=require(_0x6a7a('0x8'));module[_0x6a7a('0x9')]=function(_0x1b8027,_0x45e0b9){return _0x1b8027[_0x6a7a('0xa')](_0x6a7a('0xb'),attributes,{'tableName':_0x6a7a('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 1f56247..05e1cea 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 _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(_0x3a5ab4,_0x56f591){var _0x4838f9=function(_0x4750ac){while(--_0x4750ac){_0x3a5ab4['push'](_0x3a5ab4['shift']());}};_0x4838f9(++_0x56f591);}(_0xabce,0x103));var _0xeabc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xabce[_0x6c993a];return _0x27f547;};'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 +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x421a2d,_0xefe4a4){var _0x461f53=function(_0x42fdc3){while(--_0x42fdc3){_0x421a2d['push'](_0x421a2d['shift']());}};_0x461f53(++_0xefe4a4);}(_0x5fab,0x177));var _0xb5fa=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x5fab[_0x2125f0];return _0x12d6eb;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 90cca20..fd1451d 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 _0x2506=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','delete','exports','util'];(function(_0x49af8b,_0x48d216){var _0x4f9e96=function(_0x3d39f7){while(--_0x3d39f7){_0x49af8b['push'](_0x49af8b['shift']());}};_0x4f9e96(++_0x48d216);}(_0x2506,0x15f));var _0x6250=function(_0x327aa9,_0x52ffa3){_0x327aa9=_0x327aa9-0x0;var _0x166bf2=_0x2506[_0x327aa9];return _0x166bf2;};'use strict';var multer=require('multer');var util=require(_0x6250('0x0'));var path=require(_0x6250('0x1'));var timeout=require(_0x6250('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6250('0x3'));var auth=require(_0x6250('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6250('0x5'));var controller=require('./action.controller');router['put'](_0x6250('0x6'),auth[_0x6250('0x7')](),controller[_0x6250('0x8')]);router[_0x6250('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6250('0xa')]=router; \ No newline at end of file +var _0xfbc5=['express','Router','fs-extra','../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xfbc5,0x1ca));var _0x5fbc=function(_0x4ef839,_0x1f379b){_0x4ef839=_0x4ef839-0x0;var _0x59810f=_0xfbc5[_0x4ef839];return _0x59810f;};'use strict';var multer=require(_0x5fbc('0x0'));var util=require(_0x5fbc('0x1'));var path=require(_0x5fbc('0x2'));var timeout=require(_0x5fbc('0x3'));var express=require(_0x5fbc('0x4'));var router=express[_0x5fbc('0x5')]();var fs_extra=require(_0x5fbc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fbc('0x7'));var controller=require(_0x5fbc('0x8'));router[_0x5fbc('0x9')](_0x5fbc('0xa'),auth['isAuthenticated'](),controller[_0x5fbc('0xb')]);router['delete'](_0x5fbc('0xa'),auth[_0x5fbc('0xc')](),controller[_0x5fbc('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 88dbf4f..92e098b 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x2f8ed4,_0x295402){var _0x543bff=function(_0x3f6dca){while(--_0x3f6dca){_0x2f8ed4['push'](_0x2f8ed4['shift']());}};_0x543bff(++_0x295402);}(_0xeec6,0x1c2));var _0x6eec=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xeec6[_0x126fb9];return _0xc8a3b1;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0x71ab=['TEXT','exports','STRING'];(function(_0x5b0c7d,_0x26ffc7){var _0x510470=function(_0x2d673f){while(--_0x2d673f){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x510470(++_0x26ffc7);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 68b262a..24a9677 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 _0x2820=['startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','ValidationErrorItem','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','operator','getFields','Sequelize','keyBy','from','output','web','fullPath','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x2820,0xb2));var _0x0282=function(_0x553e1f,_0x52741){_0x553e1f=_0x553e1f-0x0;var _0x45728a=_0x2820[_0x553e1f];return _0x45728a;};'use strict';var emlformat=require(_0x0282('0x0'));var rimraf=require(_0x0282('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0282('0x2'));var rp=require(_0x0282('0x3'));var moment=require(_0x0282('0x4'));var BPromise=require(_0x0282('0x5'));var Mustache=require('mustache');var util=require(_0x0282('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(_0x0282('0x7'));var _=require(_0x0282('0x8'));var squel=require(_0x0282('0x9'));var crypto=require(_0x0282('0xa'));var jsforce=require(_0x0282('0xb'));var deskjs=require(_0x0282('0xc'));var toCsv=require(_0x0282('0xd'));var querystring=require('querystring');var Papa=require(_0x0282('0xe'));var Redis=require(_0x0282('0xf'));var authService=require(_0x0282('0x10'));var qs=require(_0x0282('0x11'));var as=require(_0x0282('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0282('0x13'));var utils=require('../../config/utils');var config=require(_0x0282('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0282('0x15'))['db'];var dbH=require('../../mysqldb')[_0x0282('0x16')];function respondWithStatusCode(_0x2b6973,_0xbeea1d){_0xbeea1d=_0xbeea1d||0xcc;return function(_0x3693cb){if(_0x3693cb){return _0x2b6973[_0x0282('0x17')](_0xbeea1d);}return _0x2b6973[_0x0282('0x18')](_0xbeea1d)['end']();};}function respondWithResult(_0x37e6e8,_0x3a8f3b){_0x3a8f3b=_0x3a8f3b||0xc8;return function(_0x2e77ee){if(_0x2e77ee){return _0x37e6e8[_0x0282('0x18')](_0x3a8f3b)[_0x0282('0x19')](_0x2e77ee);}};}function respondWithFilteredResult(_0x3c4908,_0x5c01cd){return function(_0x32a1cb){if(_0x32a1cb){var _0xf7af46=typeof _0x5c01cd[_0x0282('0x1a')]===_0x0282('0x1b')&&typeof _0x5c01cd[_0x0282('0x1c')]===_0x0282('0x1b');var _0x2962c4=_0x32a1cb[_0x0282('0x1d')];var _0x16b273=_0xf7af46?0x0:_0x5c01cd['offset'];var _0x32e75c=_0xf7af46?_0x32a1cb[_0x0282('0x1d')]:_0x5c01cd[_0x0282('0x1a')]+_0x5c01cd[_0x0282('0x1c')];var _0x1cd597;if(_0x32e75c>=_0x2962c4){_0x32e75c=_0x2962c4;_0x1cd597=0xc8;}else{_0x1cd597=0xce;}_0x3c4908[_0x0282('0x18')](_0x1cd597);return _0x3c4908[_0x0282('0x1e')]('Content-Range',_0x16b273+'-'+_0x32e75c+'/'+_0x2962c4)[_0x0282('0x19')](_0x32a1cb);}return null;};}function patchUpdates(_0x2db6e4){return function(_0x55022e){try{jsonpatch[_0x0282('0x1f')](_0x55022e,_0x2db6e4,!![]);}catch(_0x5cd825){return BPromise['reject'](_0x5cd825);}return _0x55022e[_0x0282('0x20')]();};}function saveUpdates(_0x19f811,_0x25d37d){return function(_0x48070c){if(_0x48070c){return _0x48070c[_0x0282('0x21')](_0x19f811)[_0x0282('0x22')](function(_0x35cef9){return _0x35cef9;});}return null;};}function removeEntity(_0x2e033d,_0x41237e){return function(_0x11d4d6){if(_0x11d4d6){return _0x11d4d6[_0x0282('0x23')]()['then'](function(){var _0x28046e=_0x11d4d6[_0x0282('0x24')]({'plain':!![]});var _0x5d8388=_0x0282('0x25');return db[_0x0282('0x26')][_0x0282('0x23')]({'where':{'type':_0x5d8388,'resourceId':_0x28046e['id']}})[_0x0282('0x22')](function(){return _0x11d4d6;});})[_0x0282('0x22')](function(){_0x2e033d[_0x0282('0x18')](0xcc)[_0x0282('0x27')]();});}};}function handleEntityNotFound(_0x19d145,_0x3f28b8){return function(_0x55bbda){if(!_0x55bbda){_0x19d145[_0x0282('0x17')](0x194);}return _0x55bbda;};}function handleError(_0x18143f,_0x4c5416){_0x4c5416=_0x4c5416||0x1f4;return function(_0x1e0601){logger['error'](_0x1e0601[_0x0282('0x28')]);if(_0x1e0601['name']){delete _0x1e0601[_0x0282('0x29')];}_0x18143f[_0x0282('0x18')](_0x4c5416)[_0x0282('0x2a')](_0x1e0601);};}exports[_0x0282('0x2b')]=function(_0x8c953f,_0x435896){var _0x302077={},_0x2b4136={},_0x13076f={'count':0x0,'rows':[]};var _0x43552d=_[_0x0282('0x2c')](db[_0x0282('0x2d')]['rawAttributes'],function(_0x1cd4a6){return{'name':_0x1cd4a6[_0x0282('0x2e')],'type':_0x1cd4a6['type'][_0x0282('0x2f')]};});_0x2b4136[_0x0282('0x30')]=_[_0x0282('0x2c')](_0x43552d,'name');_0x2b4136['query']=_[_0x0282('0x31')](_0x8c953f[_0x0282('0x32')]);_0x2b4136['filters']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],_0x2b4136[_0x0282('0x32')]);_0x302077['attributes']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],qs[_0x0282('0x34')](_0x8c953f[_0x0282('0x32')][_0x0282('0x34')]));_0x302077[_0x0282('0x35')]=_0x302077['attributes']['length']?_0x302077['attributes']:_0x2b4136[_0x0282('0x30')];if(!_0x8c953f[_0x0282('0x32')][_0x0282('0x36')](_0x0282('0x37'))){_0x302077[_0x0282('0x1c')]=qs[_0x0282('0x1c')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1c')]);_0x302077[_0x0282('0x1a')]=qs[_0x0282('0x1a')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1a')]);}_0x302077[_0x0282('0x38')]=qs['sort'](_0x8c953f[_0x0282('0x32')][_0x0282('0x39')]);_0x302077[_0x0282('0x3a')]=qs[_0x0282('0x3b')](_[_0x0282('0x3c')](_0x8c953f['query'],_0x2b4136[_0x0282('0x3b')]),_0x43552d);if(_0x8c953f['query'][_0x0282('0x3d')]){_0x302077[_0x0282('0x3a')]=_[_0x0282('0x3e')](_0x302077['where'],{'$or':_[_0x0282('0x2c')](_0x43552d,function(_0x493f3e){if(_0x493f3e[_0x0282('0x3f')]!==_0x0282('0x40')){var _0x5dca64={};_0x5dca64[_0x493f3e['name']]={'$like':'%'+_0x8c953f[_0x0282('0x32')]['filter']+'%'};return _0x5dca64;}})});}_0x302077=_['merge']({},_0x302077,_0x8c953f['options']);var _0x459a4c={'where':_0x302077['where']};return db['AnalyticCustomReport']['count'](_0x459a4c)[_0x0282('0x22')](function(_0x1eca73){_0x13076f[_0x0282('0x1d')]=_0x1eca73;if(_0x8c953f[_0x0282('0x32')][_0x0282('0x41')]){_0x302077[_0x0282('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x0282('0x43')](_0x302077);})[_0x0282('0x22')](function(_0x4305ff){_0x13076f[_0x0282('0x44')]=_0x4305ff;return _0x13076f;})['then'](respondWithFilteredResult(_0x435896,_0x302077))[_0x0282('0x45')](handleError(_0x435896,null));};exports[_0x0282('0x46')]=function(_0x59f608,_0x27dfd0){var _0x377de3={'raw':![],'where':{'id':_0x59f608[_0x0282('0x47')]['id']}},_0x275a08={};_0x275a08[_0x0282('0x30')]=_[_0x0282('0x31')](db[_0x0282('0x2d')][_0x0282('0x48')]);_0x275a08[_0x0282('0x32')]=_[_0x0282('0x31')](_0x59f608[_0x0282('0x32')]);_0x275a08[_0x0282('0x3b')]=_[_0x0282('0x33')](_0x275a08[_0x0282('0x30')],_0x275a08[_0x0282('0x32')]);_0x377de3[_0x0282('0x35')]=_[_0x0282('0x33')](_0x275a08['model'],qs[_0x0282('0x34')](_0x59f608[_0x0282('0x32')]['fields']));_0x377de3['attributes']=_0x377de3[_0x0282('0x35')]['length']?_0x377de3['attributes']:_0x275a08[_0x0282('0x30')];if(_0x59f608[_0x0282('0x32')][_0x0282('0x41')]){_0x377de3[_0x0282('0x42')]=[{'all':!![]}];}_0x377de3=_[_0x0282('0x3e')]({},_0x377de3,_0x59f608[_0x0282('0x49')]);return db[_0x0282('0x2d')]['find'](_0x377de3)['then'](handleEntityNotFound(_0x27dfd0,null))[_0x0282('0x22')](respondWithResult(_0x27dfd0,null))['catch'](handleError(_0x27dfd0,null));};exports['create']=function(_0x23cac5,_0x56cbda){return db[_0x0282('0x2d')]['create'](_0x23cac5[_0x0282('0x4a')],{})[_0x0282('0x22')](function(_0x57ec2b){var _0x35c794=_0x23cac5[_0x0282('0x4b')][_0x0282('0x24')]({'plain':!![]});if(!_0x35c794)throw new Error(_0x0282('0x4c'));if(_0x35c794[_0x0282('0x4d')]===_0x0282('0x4b')){var _0x3c0282=_0x57ec2b[_0x0282('0x24')]({'plain':!![]});var _0xc7d5b7=_0x0282('0x4e');return db[_0x0282('0x4f')][_0x0282('0x50')]({'where':{'name':_0xc7d5b7,'userProfileId':_0x35c794[_0x0282('0x51')]},'raw':!![]})[_0x0282('0x22')](function(_0x50588a){if(_0x50588a&&_0x50588a[_0x0282('0x52')]===0x0){return db[_0x0282('0x26')][_0x0282('0x53')]({'name':_0x3c0282['name'],'resourceId':_0x3c0282['id'],'type':_0x0282('0x25'),'sectionId':_0x50588a['id']},{})['then'](function(){return _0x57ec2b;});}else{return _0x57ec2b;}})[_0x0282('0x45')](function(_0x135cb6){logger[_0x0282('0x54')](_0x0282('0x55'),_0x135cb6);throw _0x135cb6;});}return _0x57ec2b;})['then'](respondWithResult(_0x56cbda,0xc9))[_0x0282('0x45')](handleError(_0x56cbda,null));};exports[_0x0282('0x21')]=function(_0x56ad03,_0x398475){if(_0x56ad03['body']['id']){delete _0x56ad03[_0x0282('0x4a')]['id'];}return db[_0x0282('0x2d')][_0x0282('0x50')]({'where':{'id':_0x56ad03[_0x0282('0x47')]['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x398475,null))[_0x0282('0x22')](saveUpdates(_0x56ad03[_0x0282('0x4a')],null))[_0x0282('0x22')](respondWithResult(_0x398475,null))[_0x0282('0x45')](handleError(_0x398475,null));};exports[_0x0282('0x23')]=function(_0x40ba8a,_0x47b14f){return db['AnalyticCustomReport'][_0x0282('0x50')]({'where':{'id':_0x40ba8a['params']['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x47b14f,null))[_0x0282('0x22')](removeEntity(_0x47b14f,null))['catch'](handleError(_0x47b14f,null));};exports['preview']=function(_0xe1201c,_0x26855c){var _0x1adcb0=0xa;var _0x5ede56=[_0x0282('0x56'),_0x0282('0x57'),'right_join',_0x0282('0x58')];var _0x2767f4={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0282('0x60')};var _0x19ad87={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':_0x0282('0x65')};var _0x271099=function(_0x231c97){return!_[_0x0282('0x66')]([_0x0282('0x67'),'IS\x20NOT\x20NULL',_0x0282('0x68'),_0x0282('0x69')],_0x231c97);};var _0x3f352b=function(_0x1dd0eb){if(!_0x1dd0eb||!_0x1dd0eb[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x3056f2='(',_0x74dce0=0x0;_0x74dce0<_0x1dd0eb[_0x0282('0x6a')]['length'];_0x74dce0+=0x1){_0x74dce0>0x0&&(_0x3056f2+='\x20'+_0x1dd0eb['operator']+'\x20');_0x3056f2+=_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6c')]?_0x3f352b(_0x1dd0eb[_0x0282('0x6a')][_0x74dce0]['group']):_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6d')]+'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6e')]+(_0x271099(_0x1dd0eb['rules'][_0x74dce0]['condition'])?'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6f')]:'');}return _0x3056f2+')';};var _0x22addb={'where':{'id':_0xe1201c[_0x0282('0x47')]['id']}},_0x34ea76,_0x1e0974,_0x4c0ecc,_0x39ea71,_0x1226e6;_0x22addb=_['merge']({},_0x22addb,_0xe1201c[_0x0282('0x49')]);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x22addb)[_0x0282('0x22')](function(_0x3a4711){if(_0x3a4711){_0x34ea76=_0x3a4711;return _0x3a4711['getFields']();}return null;})['then'](function(_0x4b5d9c){if(_0x4b5d9c){if(!_0x4b5d9c[_0x0282('0x6b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0282('0x70'),0x193);}_0x1e0974=_0x4b5d9c;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x56d46a){if(_0x56d46a){_0x4c0ecc=_['keyBy'](_0x56d46a,'id');var _0x4c481b;var _0x3c6c56=squel[_0x0282('0x72')]();_0x3c6c56['from'](_0x34ea76[_0x0282('0x73')]);for(var _0x413ef2=0x0;_0x413ef2<_0x1e0974[_0x0282('0x6b')];_0x413ef2+=0x1){_0x4c481b=_0x1e0974[_0x413ef2][_0x0282('0x74')]?_0x4c0ecc[_0x1e0974[_0x413ef2][_0x0282('0x74')]][_0x0282('0x75')]:_0x1e0974[_0x413ef2][_0x0282('0x6d')];_0x4c481b=_0x1e0974[_0x413ef2]['function']?_[_0x0282('0x76')](_0x2767f4[_0x1e0974[_0x413ef2][_0x0282('0x77')]],'%s',_0x4c481b):_0x4c481b;_0x4c481b=_0x1e0974[_0x413ef2]['format']?_[_0x0282('0x76')](_0x19ad87[_0x1e0974[_0x413ef2][_0x0282('0x78')]],'%s',_0x4c481b):_0x4c481b;if(_0x1e0974[_0x413ef2][_0x0282('0x79')]){_0x3c6c56[_0x0282('0x6c')](_0x4c481b);}_0x1e0974[_0x413ef2][_0x0282('0x7a')]&&_0x3c6c56[_0x0282('0x38')](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x3c6c56['field'](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7c')]||_0x4c481b);}if(_0x34ea76[_0x0282('0x7d')]){_0x34ea76['joins']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x7d')]);for(var _0x593b54=0x0;_0x593b54<_0x34ea76['joins']['length'];_0x593b54+=0x1){if(_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x5ede56,_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')])&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x80')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignKey']){_0x3c6c56[_0x34ea76[_0x0282('0x7d')][_0x593b54]['type']](_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignTable'],null,util['format'](_0x0282('0x81'),_0x34ea76[_0x0282('0x73')],_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')],_0x34ea76['joins'][_0x593b54][_0x0282('0x80')],_0x34ea76['joins'][_0x593b54][_0x0282('0x82')]));}}}if(_0x34ea76['conditions']){_0x34ea76['conditions']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x83')]);_0x3c6c56['where'](_0x3f352b(_0x34ea76[_0x0282('0x83')][_0x0282('0x6c')]));}_0x1226e6=_0x3c6c56[_0x0282('0x84')]();_0x3c6c56['limit'](_0x1adcb0);_0x3c6c56[_0x0282('0x1a')](0x0);logger['debug'](_0x0282('0x85'),_0x3c6c56[_0x0282('0x86')]());return dbH['sequelize'][_0x0282('0x32')](_0x3c6c56['toString'](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});}})[_0x0282('0x22')](respondWithResult(_0x26855c,null))[_0x0282('0x45')](handleError(_0x26855c,null));};function runReport(_0xa999e7,_0x575bf1,_0x293ff0){var _0x3b8a6b=_0x575bf1['name'];var _0x3260bc=0xa;var _0x4f1a9c=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x36802a={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':_0x0282('0x60')};var _0x209aca={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0282('0x65')};var _0x197b98=function(_0x11ac49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x11ac49);};var _0x1b1311=function(_0x26c9d8){if(!_0x26c9d8||!_0x26c9d8[_0x0282('0x6a')]['length']){return'';}for(var _0x26b9dd='(',_0x2b1511=0x0;_0x2b1511<_0x26c9d8[_0x0282('0x6a')][_0x0282('0x6b')];_0x2b1511+=0x1){_0x2b1511>0x0&&(_0x26b9dd+='\x20'+_0x26c9d8[_0x0282('0x8d')]+'\x20');_0x26b9dd+=_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]?_0x1b1311(_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]):_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6d')]+'\x20'+_0x26c9d8['rules'][_0x2b1511]['condition']+(_0x197b98(_0x26c9d8[_0x0282('0x6a')][_0x2b1511]['condition'])?'\x20'+_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6f')]:'');}return _0x26b9dd+')';};var _0x481df9={'where':{'id':_0xa999e7['id']}},_0x2774f4,_0x4531e2,_0x234ac0,_0x915294,_0xd11573;_0x481df9=_[_0x0282('0x3e')]({},_0x481df9,_0x293ff0);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x481df9)['then'](function(_0x23edd0){if(_0x23edd0){_0x2774f4=_0x23edd0;return _0x23edd0[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x54dc0f){if(_0x54dc0f){if(!_0x54dc0f[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4531e2=_0x54dc0f;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5d06e6){if(_0x5d06e6){_0x234ac0=_[_0x0282('0x90')](_0x5d06e6,'id');var _0x5e7577;var _0x5025de=squel['select']();_0x5025de[_0x0282('0x91')](_0x2774f4[_0x0282('0x73')]);for(var _0x237293=0x0;_0x237293<_0x4531e2[_0x0282('0x6b')];_0x237293+=0x1){_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x74')]?_0x234ac0[_0x4531e2[_0x237293][_0x0282('0x74')]][_0x0282('0x75')]:_0x4531e2[_0x237293][_0x0282('0x6d')];_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x77')]?_['replace'](_0x36802a[_0x4531e2[_0x237293]['function']],'%s',_0x5e7577):_0x5e7577;_0x5e7577=_0x4531e2[_0x237293]['format']?_[_0x0282('0x76')](_0x209aca[_0x4531e2[_0x237293][_0x0282('0x78')]],'%s',_0x5e7577):_0x5e7577;if(_0x4531e2[_0x237293]['groupBy']){_0x5025de[_0x0282('0x6c')](_0x5e7577);}_0x4531e2[_0x237293][_0x0282('0x7a')]&&_0x5025de[_0x0282('0x38')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7a')]==='DESC'?![]:!![]);_0x5025de[_0x0282('0x6d')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7c')]||_0x5e7577);}if(_0x2774f4[_0x0282('0x7d')]){_0x2774f4[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x7d')]);for(var _0x4e8ff8=0x0;_0x4e8ff8<_0x2774f4['joins']['length'];_0x4e8ff8+=0x1){if(_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x4f1a9c,_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')])&&_0x2774f4['joins'][_0x4e8ff8][_0x0282('0x7f')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8]['foreignKey']){_0x5025de[_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]](_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x2774f4['table'],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x7f')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x82')]));}}}if(_0x2774f4['conditions']){_0x2774f4[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x83')]);_0x5025de[_0x0282('0x3a')](_0x1b1311(_0x2774f4[_0x0282('0x83')][_0x0282('0x6c')]));}_0xd11573=_0x5025de[_0x0282('0x84')]();_0x5025de[_0x0282('0x1c')](_0x3260bc);_0x5025de[_0x0282('0x1a')](0x0);return;}})[_0x0282('0x22')](function(){if(_0x575bf1[_0x0282('0x92')]===_0x0282('0x93')){return null;}var _0x893cbe=_['merge'](_0x575bf1,{'name':_0x575bf1[_0x0282('0x94')]||_0x575bf1[_0x0282('0x29')]||_0x2774f4[_0x0282('0x29')],'basename':_0x3b8a6b,'savename':util[_0x0282('0x78')]('%s-%s.%s',_0x575bf1['name']||_0x2774f4['name'],require(_0x0282('0x95'))[_0x0282('0x96')](0x4),_0x575bf1['output']||'csv'),'reportId':_0x2774f4['id'],'reportType':_0x0282('0x97')});return db[_0x0282('0x98')][_0x0282('0x53')](_0x893cbe,{'raw':!![]});})[_0x0282('0x22')](function(_0x1aa218){if(_0x2774f4[_0x0282('0x73')]==='cdr'){_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x99'),_0x575bf1['startDate'],_0x575bf1[_0x0282('0x9a')]);}else{_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x9b'),_0x575bf1[_0x0282('0x9c')],_0x575bf1['endDate']);}if(_0x1aa218){logger[_0x0282('0x9d')](_0x0282('0x9e'),_0xd11573[_0x0282('0x86')]());require(_0x0282('0x9f'))[_0x0282('0xa0')](path[_0x0282('0x56')](__dirname,'../../components/export/',_0x1aa218[_0x0282('0x92')]),[_0x1aa218['id'],_0xd11573[_0x0282('0x86')](),path['join'](__dirname,_0x0282('0xa1'),_0x1aa218[_0x0282('0xa2')]),_0x3b8a6b]);return _0x1aa218;}else{var _0x2fb8cf=squel[_0x0282('0x72')]();_0x2fb8cf[_0x0282('0x91')]('('+_0xd11573['toString']()+')',_0x0282('0xa3'));_0x2fb8cf[_0x0282('0x6d')]('COUNT(*)',_0x0282('0x1d'));_0xd11573[_0x0282('0x1c')](_0x575bf1[_0x0282('0x1c')]||_0x3260bc);_0xd11573[_0x0282('0x1a')](_0x575bf1[_0x0282('0x1a')]||0x0);return dbH['sequelize'][_0x0282('0x32')](_0x2fb8cf[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')]['SELECT']})[_0x0282('0x22')](function(_0x41ffdb){if(!_0x41ffdb['length']){_0x915294=0x0;}else{_0x915294=_0x41ffdb[0x0][_0x0282('0x1d')]||0x0;}return dbH[_0x0282('0x87')][_0x0282('0x32')](_0xd11573[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});})[_0x0282('0x22')](function(_0xef882e){return{'rows':_0xef882e||[],'count':_0x915294};});}});}exports[_0x0282('0xa4')]=function(_0x3c2a61,_0x5bbd85){return runReport(_0x3c2a61['params'],_0x3c2a61[_0x0282('0x32')],_0x3c2a61[_0x0282('0x49')])[_0x0282('0x22')](respondWithResult(_0x5bbd85,null))['catch'](handleError(_0x5bbd85,null));};exports[_0x0282('0xa5')]=runReport;exports[_0x0282('0x32')]=function(_0x34c5b5,_0xfed5e8){var _0x5032c6=0xa;var _0x2ac471=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x8082f2={'SUM':'SUM(%s)','COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':'MAX(%s)','MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x31e03a={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1096a5=function(_0x8a2f49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x8a2f49);};var _0x42a117=function(_0xa4c9a5){if(!_0xa4c9a5||!_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x186569='(',_0x4cf2da=0x0;_0x4cf2da<_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')];_0x4cf2da+=0x1){_0x4cf2da>0x0&&(_0x186569+='\x20'+_0xa4c9a5[_0x0282('0x8d')]+'\x20');_0x186569+=_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]?_0x42a117(_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]):_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['field']+'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['condition']+(_0x1096a5(_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6e')])?'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6f')]:'');}return _0x186569+')';};var _0x5ed494={'where':{'id':_0x34c5b5[_0x0282('0x47')]['id']}},_0x30b026,_0x5638d8,_0x5b21d3,_0x38ca76,_0x2a4a5e;_0x5ed494=_[_0x0282('0x3e')]({},_0x5ed494,_0x34c5b5[_0x0282('0x49')]);return db['AnalyticCustomReport'][_0x0282('0x50')](_0x5ed494)['then'](function(_0x19461c){if(_0x19461c){_0x30b026=_0x19461c;return _0x19461c[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x58dcc3){if(_0x58dcc3){if(!_0x58dcc3[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))][(_0x0282('0xa6'))](_0x0282('0x70'),0x193);}_0x5638d8=_0x58dcc3;return db['AnalyticMetric'][_0x0282('0x43')]({'raw':!![]});}return null;})[_0x0282('0x22')](function(_0x1202c3){if(_0x1202c3){_0x5b21d3=_[_0x0282('0x90')](_0x1202c3,'id');var _0x39b44b;var _0x38cb34=squel[_0x0282('0x72')]();_0x38cb34['from'](_0x30b026[_0x0282('0x73')]);for(var _0x54096c=0x0;_0x54096c<_0x5638d8['length'];_0x54096c+=0x1){_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x74')]?_0x5b21d3[_0x5638d8[_0x54096c][_0x0282('0x74')]][_0x0282('0x75')]:_0x5638d8[_0x54096c][_0x0282('0x6d')];_0x39b44b=_0x5638d8[_0x54096c]['function']?_[_0x0282('0x76')](_0x8082f2[_0x5638d8[_0x54096c][_0x0282('0x77')]],'%s',_0x39b44b):_0x39b44b;_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x78')]?_[_0x0282('0x76')](_0x31e03a[_0x5638d8[_0x54096c][_0x0282('0x78')]],'%s',_0x39b44b):_0x39b44b;if(_0x5638d8[_0x54096c]['groupBy']){_0x38cb34[_0x0282('0x6c')](_0x39b44b);}_0x5638d8[_0x54096c][_0x0282('0x7a')]&&_0x38cb34['order'](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x38cb34[_0x0282('0x6d')](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7c')]||_0x39b44b);}if(_0x30b026[_0x0282('0x7d')]){_0x30b026[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x7d')]);for(var _0x276107=0x0;_0x276107<_0x30b026[_0x0282('0x7d')][_0x0282('0x6b')];_0x276107+=0x1){if(_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]&&_['includes'](_0x2ac471,_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')])&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x7f')]&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')]&&_0x30b026['joins'][_0x276107][_0x0282('0x82')]){_0x38cb34[_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]](_0x30b026['joins'][_0x276107][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x30b026[_0x0282('0x73')],_0x30b026['joins'][_0x276107][_0x0282('0x7f')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x82')]));}}}if(_0x30b026[_0x0282('0x83')]){_0x30b026[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x83')]);_0x38cb34[_0x0282('0x3a')](_0x42a117(_0x30b026[_0x0282('0x83')][_0x0282('0x6c')]));}_0x2a4a5e=_0x38cb34[_0x0282('0x84')]();_0x38cb34[_0x0282('0x1c')](_0x5032c6);_0x38cb34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x38cb34[_0x0282('0x86')]());return dbH[_0x0282('0x87')][_0x0282('0x32')](_0x38cb34[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')]['QueryTypes'][_0x0282('0x89')]});}})[_0x0282('0x22')](function(){return{'sql':_0x2a4a5e['toString']()};})[_0x0282('0x22')](respondWithResult(_0xfed5e8,null))['catch'](handleError(_0xfed5e8,null));}; \ No newline at end of file +var _0x09ba=['web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','clone','Limited\x20Query:','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','format','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','IS\x20NULL','getFields','%s.%s\x20=\x20%s.%s','output'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x09ba,0xbd));var _0xa09b=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x09ba[_0x5e3bb1];return _0x4c1278;};'use strict';var emlformat=require(_0xa09b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa09b('0x1'));var rp=require('request-promise');var moment=require(_0xa09b('0x2'));var BPromise=require(_0xa09b('0x3'));var Mustache=require(_0xa09b('0x4'));var util=require(_0xa09b('0x5'));var path=require('path');var sox=require(_0xa09b('0x6'));var csv=require(_0xa09b('0x7'));var ejs=require(_0xa09b('0x8'));var fs=require('fs');var fs_extra=require(_0xa09b('0x9'));var _=require(_0xa09b('0xa'));var squel=require(_0xa09b('0xb'));var crypto=require(_0xa09b('0xc'));var jsforce=require(_0xa09b('0xd'));var deskjs=require(_0xa09b('0xe'));var toCsv=require(_0xa09b('0x7'));var querystring=require(_0xa09b('0xf'));var Papa=require(_0xa09b('0x10'));var Redis=require(_0xa09b('0x11'));var authService=require(_0xa09b('0x12'));var qs=require(_0xa09b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa09b('0x14'));var logger=require(_0xa09b('0x15'))(_0xa09b('0x16'));var utils=require(_0xa09b('0x17'));var config=require(_0xa09b('0x18'));var licenseUtil=require(_0xa09b('0x19'));var db=require(_0xa09b('0x1a'))['db'];var dbH=require(_0xa09b('0x1a'))[_0xa09b('0x1b')];function respondWithStatusCode(_0x37d24e,_0x73a4e4){_0x73a4e4=_0x73a4e4||0xcc;return function(_0x2c25b6){if(_0x2c25b6){return _0x37d24e['sendStatus'](_0x73a4e4);}return _0x37d24e['status'](_0x73a4e4)['end']();};}function respondWithResult(_0x1396ec,_0xf60ce2){_0xf60ce2=_0xf60ce2||0xc8;return function(_0x56b299){if(_0x56b299){return _0x1396ec[_0xa09b('0x1c')](_0xf60ce2)[_0xa09b('0x1d')](_0x56b299);}};}function respondWithFilteredResult(_0x4e48a7,_0x4910e0){return function(_0x4440ab){if(_0x4440ab){var _0x5b2285=typeof _0x4910e0[_0xa09b('0x1e')]===_0xa09b('0x1f')&&typeof _0x4910e0[_0xa09b('0x20')]==='undefined';var _0x508273=_0x4440ab[_0xa09b('0x21')];var _0x1ea2c2=_0x5b2285?0x0:_0x4910e0[_0xa09b('0x1e')];var _0x3e4d14=_0x5b2285?_0x4440ab[_0xa09b('0x21')]:_0x4910e0['offset']+_0x4910e0[_0xa09b('0x20')];var _0x453aae;if(_0x3e4d14>=_0x508273){_0x3e4d14=_0x508273;_0x453aae=0xc8;}else{_0x453aae=0xce;}_0x4e48a7[_0xa09b('0x1c')](_0x453aae);return _0x4e48a7['set'](_0xa09b('0x22'),_0x1ea2c2+'-'+_0x3e4d14+'/'+_0x508273)[_0xa09b('0x1d')](_0x4440ab);}return null;};}function patchUpdates(_0xa3957d){return function(_0x185596){try{jsonpatch['apply'](_0x185596,_0xa3957d,!![]);}catch(_0x5ecdc1){return BPromise['reject'](_0x5ecdc1);}return _0x185596[_0xa09b('0x23')]();};}function saveUpdates(_0x27a6b4,_0x46cf42){return function(_0x45b04b){if(_0x45b04b){return _0x45b04b['update'](_0x27a6b4)[_0xa09b('0x24')](function(_0x135ab8){return _0x135ab8;});}return null;};}function removeEntity(_0x253494,_0x2641aa){return function(_0x4be099){if(_0x4be099){return _0x4be099[_0xa09b('0x25')]()[_0xa09b('0x24')](function(){var _0x250944=_0x4be099[_0xa09b('0x26')]({'plain':!![]});var _0x57a4cf=_0xa09b('0x27');return db[_0xa09b('0x28')][_0xa09b('0x25')]({'where':{'type':_0x57a4cf,'resourceId':_0x250944['id']}})[_0xa09b('0x24')](function(){return _0x4be099;});})[_0xa09b('0x24')](function(){_0x253494['status'](0xcc)[_0xa09b('0x29')]();});}};}function handleEntityNotFound(_0x1c1803,_0x35678a){return function(_0x4fb15c){if(!_0x4fb15c){_0x1c1803['sendStatus'](0x194);}return _0x4fb15c;};}function handleError(_0x713ab0,_0x558e53){_0x558e53=_0x558e53||0x1f4;return function(_0x219d7f){logger['error'](_0x219d7f[_0xa09b('0x2a')]);if(_0x219d7f[_0xa09b('0x2b')]){delete _0x219d7f['name'];}_0x713ab0[_0xa09b('0x1c')](_0x558e53)['send'](_0x219d7f);};}exports[_0xa09b('0x2c')]=function(_0x1c6c95,_0x1e161d){var _0x11c896={},_0x3845c4={},_0x5a6737={'count':0x0,'rows':[]};var _0x2b53e5=_[_0xa09b('0x2d')](db[_0xa09b('0x2e')][_0xa09b('0x2f')],function(_0xeebcab){return{'name':_0xeebcab[_0xa09b('0x30')],'type':_0xeebcab[_0xa09b('0x31')][_0xa09b('0x32')]};});_0x3845c4['model']=_[_0xa09b('0x2d')](_0x2b53e5,_0xa09b('0x2b'));_0x3845c4[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x1c6c95[_0xa09b('0x33')]);_0x3845c4[_0xa09b('0x35')]=_[_0xa09b('0x36')](_0x3845c4['model'],_0x3845c4[_0xa09b('0x33')]);_0x11c896['attributes']=_[_0xa09b('0x36')](_0x3845c4[_0xa09b('0x37')],qs[_0xa09b('0x38')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x38')]));_0x11c896[_0xa09b('0x39')]=_0x11c896[_0xa09b('0x39')]['length']?_0x11c896[_0xa09b('0x39')]:_0x3845c4[_0xa09b('0x37')];if(!_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x3a')](_0xa09b('0x3b'))){_0x11c896[_0xa09b('0x20')]=qs['limit'](_0x1c6c95[_0xa09b('0x33')]['limit']);_0x11c896['offset']=qs[_0xa09b('0x1e')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x1e')]);}_0x11c896[_0xa09b('0x3c')]=qs[_0xa09b('0x3d')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x3d')]);_0x11c896[_0xa09b('0x3e')]=qs[_0xa09b('0x35')](_[_0xa09b('0x3f')](_0x1c6c95[_0xa09b('0x33')],_0x3845c4['filters']),_0x2b53e5);if(_0x1c6c95['query']['filter']){_0x11c896[_0xa09b('0x3e')]=_[_0xa09b('0x40')](_0x11c896[_0xa09b('0x3e')],{'$or':_['map'](_0x2b53e5,function(_0x41439a){if(_0x41439a[_0xa09b('0x31')]!==_0xa09b('0x41')){var _0x192cc8={};_0x192cc8[_0x41439a[_0xa09b('0x2b')]]={'$like':'%'+_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x42')]+'%'};return _0x192cc8;}})});}_0x11c896=_[_0xa09b('0x40')]({},_0x11c896,_0x1c6c95[_0xa09b('0x43')]);var _0x273d77={'where':_0x11c896[_0xa09b('0x3e')]};return db[_0xa09b('0x2e')][_0xa09b('0x21')](_0x273d77)['then'](function(_0x558569){_0x5a6737[_0xa09b('0x21')]=_0x558569;if(_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x44')]){_0x11c896[_0xa09b('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xa09b('0x46')](_0x11c896);})[_0xa09b('0x24')](function(_0x4601c8){_0x5a6737[_0xa09b('0x47')]=_0x4601c8;return _0x5a6737;})['then'](respondWithFilteredResult(_0x1e161d,_0x11c896))[_0xa09b('0x48')](handleError(_0x1e161d,null));};exports[_0xa09b('0x49')]=function(_0x484907,_0x1f4e6e){var _0x46cc35={'raw':![],'where':{'id':_0x484907[_0xa09b('0x4a')]['id']}},_0x1d7d9e={};_0x1d7d9e[_0xa09b('0x37')]=_[_0xa09b('0x34')](db['AnalyticCustomReport'][_0xa09b('0x2f')]);_0x1d7d9e[_0xa09b('0x33')]=_['keys'](_0x484907[_0xa09b('0x33')]);_0x1d7d9e['filters']=_['intersection'](_0x1d7d9e['model'],_0x1d7d9e['query']);_0x46cc35[_0xa09b('0x39')]=_[_0xa09b('0x36')](_0x1d7d9e[_0xa09b('0x37')],qs[_0xa09b('0x38')](_0x484907[_0xa09b('0x33')][_0xa09b('0x38')]));_0x46cc35[_0xa09b('0x39')]=_0x46cc35[_0xa09b('0x39')]['length']?_0x46cc35[_0xa09b('0x39')]:_0x1d7d9e[_0xa09b('0x37')];if(_0x484907['query'][_0xa09b('0x44')]){_0x46cc35[_0xa09b('0x45')]=[{'all':!![]}];}_0x46cc35=_['merge']({},_0x46cc35,_0x484907[_0xa09b('0x43')]);return db['AnalyticCustomReport'][_0xa09b('0x4b')](_0x46cc35)[_0xa09b('0x24')](handleEntityNotFound(_0x1f4e6e,null))[_0xa09b('0x24')](respondWithResult(_0x1f4e6e,null))['catch'](handleError(_0x1f4e6e,null));};exports[_0xa09b('0x4c')]=function(_0x3cfa89,_0x174026){return db[_0xa09b('0x2e')][_0xa09b('0x4c')](_0x3cfa89[_0xa09b('0x4d')],{})[_0xa09b('0x24')](function(_0x41ae83){var _0x42b1af=_0x3cfa89[_0xa09b('0x4e')][_0xa09b('0x26')]({'plain':!![]});if(!_0x42b1af)throw new Error(_0xa09b('0x4f'));if(_0x42b1af[_0xa09b('0x50')]===_0xa09b('0x4e')){var _0x56a979=_0x41ae83[_0xa09b('0x26')]({'plain':!![]});var _0x16a73d=_0xa09b('0x51');return db[_0xa09b('0x52')][_0xa09b('0x4b')]({'where':{'name':_0x16a73d,'userProfileId':_0x42b1af[_0xa09b('0x53')]},'raw':!![]})[_0xa09b('0x24')](function(_0x1189f7){if(_0x1189f7&&_0x1189f7['autoAssociation']===0x0){return db[_0xa09b('0x28')][_0xa09b('0x4c')]({'name':_0x56a979[_0xa09b('0x2b')],'resourceId':_0x56a979['id'],'type':_0xa09b('0x27'),'sectionId':_0x1189f7['id']},{})[_0xa09b('0x24')](function(){return _0x41ae83;});}else{return _0x41ae83;}})['catch'](function(_0x475157){logger[_0xa09b('0x54')](_0xa09b('0x55'),_0x475157);throw _0x475157;});}return _0x41ae83;})[_0xa09b('0x24')](respondWithResult(_0x174026,0xc9))[_0xa09b('0x48')](handleError(_0x174026,null));};exports[_0xa09b('0x56')]=function(_0x11cc73,_0x43b445){if(_0x11cc73['body']['id']){delete _0x11cc73['body']['id'];}return db[_0xa09b('0x2e')]['find']({'where':{'id':_0x11cc73['params']['id']}})[_0xa09b('0x24')](handleEntityNotFound(_0x43b445,null))[_0xa09b('0x24')](saveUpdates(_0x11cc73[_0xa09b('0x4d')],null))['then'](respondWithResult(_0x43b445,null))[_0xa09b('0x48')](handleError(_0x43b445,null));};exports[_0xa09b('0x25')]=function(_0x100b32,_0x2ea1d6){return db[_0xa09b('0x2e')][_0xa09b('0x4b')]({'where':{'id':_0x100b32[_0xa09b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ea1d6,null))[_0xa09b('0x24')](removeEntity(_0x2ea1d6,null))['catch'](handleError(_0x2ea1d6,null));};exports[_0xa09b('0x57')]=function(_0xd6b261,_0x7ac2da){var _0x174632=0xa;var _0x2f1c32=[_0xa09b('0x58'),_0xa09b('0x59'),_0xa09b('0x5a'),_0xa09b('0x5b')];var _0x3d6a12={'SUM':'SUM(%s)','COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa09b('0x5d'),'MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0x2dc7a3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa09b('0x63'),'HOUR':_0xa09b('0x64'),'ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':_0xa09b('0x66')};var _0x24ffb2=function(_0x50fea5){return!_[_0xa09b('0x67')](['IS\x20NULL',_0xa09b('0x68'),_0xa09b('0x69'),_0xa09b('0x6a')],_0x50fea5);};var _0x272785=function(_0x2f7da1){if(!_0x2f7da1||!_0x2f7da1[_0xa09b('0x6b')]['length']){return'';}for(var _0x1010f9='(',_0x5505e4=0x0;_0x5505e4<_0x2f7da1[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x5505e4+=0x1){_0x5505e4>0x0&&(_0x1010f9+='\x20'+_0x2f7da1[_0xa09b('0x6d')]+'\x20');_0x1010f9+=_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x6e')]?_0x272785(_0x2f7da1[_0xa09b('0x6b')][_0x5505e4]['group']):_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x6f')]+'\x20'+_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x70')]+(_0x24ffb2(_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x70')])?'\x20'+_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x71')]:'');}return _0x1010f9+')';};var _0x1ccdb0={'where':{'id':_0xd6b261['params']['id']}},_0x1aa59f,_0x11d3ed,_0x1fe3f6,_0x4f1b42,_0x193d59;_0x1ccdb0=_[_0xa09b('0x40')]({},_0x1ccdb0,_0xd6b261[_0xa09b('0x43')]);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x1ccdb0)[_0xa09b('0x24')](function(_0x4de164){if(_0x4de164){_0x1aa59f=_0x4de164;return _0x4de164['getFields']();}return null;})[_0xa09b('0x24')](function(_0x3de64e){if(_0x3de64e){if(!_0x3de64e[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))](_0xa09b('0x74'),0x193);}_0x11d3ed=_0x3de64e;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})[_0xa09b('0x24')](function(_0x22f369){if(_0x22f369){_0x1fe3f6=_[_0xa09b('0x76')](_0x22f369,'id');var _0x5ceb8d;var _0x1613c9=squel[_0xa09b('0x77')]();_0x1613c9[_0xa09b('0x78')](_0x1aa59f[_0xa09b('0x79')]);for(var _0x1a4971=0x0;_0x1a4971<_0x11d3ed['length'];_0x1a4971+=0x1){_0x5ceb8d=_0x11d3ed[_0x1a4971]['MetricId']?_0x1fe3f6[_0x11d3ed[_0x1a4971][_0xa09b('0x7a')]][_0xa09b('0x7b')]:_0x11d3ed[_0x1a4971]['field'];_0x5ceb8d=_0x11d3ed[_0x1a4971]['function']?_[_0xa09b('0x7c')](_0x3d6a12[_0x11d3ed[_0x1a4971][_0xa09b('0x7d')]],'%s',_0x5ceb8d):_0x5ceb8d;_0x5ceb8d=_0x11d3ed[_0x1a4971]['format']?_['replace'](_0x2dc7a3[_0x11d3ed[_0x1a4971]['format']],'%s',_0x5ceb8d):_0x5ceb8d;if(_0x11d3ed[_0x1a4971][_0xa09b('0x7e')]){_0x1613c9[_0xa09b('0x6e')](_0x5ceb8d);}_0x11d3ed[_0x1a4971][_0xa09b('0x7f')]&&_0x1613c9[_0xa09b('0x3c')](_0x5ceb8d,_0x11d3ed[_0x1a4971][_0xa09b('0x7f')]===_0xa09b('0x80')?![]:!![]);_0x1613c9[_0xa09b('0x6f')](_0x5ceb8d,_0x11d3ed[_0x1a4971][_0xa09b('0x81')]||_0x5ceb8d);}if(_0x1aa59f['joins']){_0x1aa59f[_0xa09b('0x82')]=JSON[_0xa09b('0x83')](_0x1aa59f[_0xa09b('0x82')]);for(var _0x4c3ee5=0x0;_0x4c3ee5<_0x1aa59f[_0xa09b('0x82')]['length'];_0x4c3ee5+=0x1){if(_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0x2f1c32,_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['type'])&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x84')]&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')]&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['foreignKey']){_0x1613c9[_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['type']](_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')],null,util[_0xa09b('0x86')]('%s.%s\x20=\x20%s.%s',_0x1aa59f['table'],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x84')],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x87')]));}}}if(_0x1aa59f[_0xa09b('0x88')]){_0x1aa59f[_0xa09b('0x88')]=JSON['parse'](_0x1aa59f[_0xa09b('0x88')]);_0x1613c9[_0xa09b('0x3e')](_0x272785(_0x1aa59f[_0xa09b('0x88')][_0xa09b('0x6e')]));}_0x193d59=_0x1613c9['clone']();_0x1613c9['limit'](_0x174632);_0x1613c9[_0xa09b('0x1e')](0x0);logger[_0xa09b('0x89')]('Limited\x20Query:',_0x1613c9[_0xa09b('0x8a')]());return dbH[_0xa09b('0x8b')][_0xa09b('0x33')](_0x1613c9['toString'](),{'type':dbH[_0xa09b('0x8b')][_0xa09b('0x8c')][_0xa09b('0x8d')]});}})[_0xa09b('0x24')](respondWithResult(_0x7ac2da,null))['catch'](handleError(_0x7ac2da,null));};function runReport(_0x1caef1,_0x4abfa6,_0x60de88){var _0x21a15a=_0x4abfa6[_0xa09b('0x2b')];var _0x57a9c6=0xa;var _0xcc354=['join','left_join',_0xa09b('0x5a'),_0xa09b('0x5b')];var _0x499843={'SUM':_0xa09b('0x8e'),'COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':_0xa09b('0x8f'),'MAX':'MAX(%s)','MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0xeb4dad={'SEC_TO_TIME':_0xa09b('0x90'),'DATE':_0xa09b('0x63'),'HOUR':_0xa09b('0x64'),'ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':_0xa09b('0x66')};var _0x563b94=function(_0x4b0699){return!_[_0xa09b('0x67')]([_0xa09b('0x91'),_0xa09b('0x68'),'IS\x20EMPTY',_0xa09b('0x6a')],_0x4b0699);};var _0x3f1516=function(_0x11d199){if(!_0x11d199||!_0x11d199[_0xa09b('0x6b')][_0xa09b('0x6c')]){return'';}for(var _0x47ac70='(',_0x2d8e34=0x0;_0x2d8e34<_0x11d199[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x2d8e34+=0x1){_0x2d8e34>0x0&&(_0x47ac70+='\x20'+_0x11d199['operator']+'\x20');_0x47ac70+=_0x11d199[_0xa09b('0x6b')][_0x2d8e34]['group']?_0x3f1516(_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x6e')]):_0x11d199['rules'][_0x2d8e34][_0xa09b('0x6f')]+'\x20'+_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x70')]+(_0x563b94(_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x70')])?'\x20'+_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x71')]:'');}return _0x47ac70+')';};var _0x16c50f={'where':{'id':_0x1caef1['id']}},_0x11fab5,_0x85ad4d,_0x35ad1d,_0x4251a8,_0x3a0456;_0x16c50f=_[_0xa09b('0x40')]({},_0x16c50f,_0x60de88);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x16c50f)[_0xa09b('0x24')](function(_0x3f0398){if(_0x3f0398){_0x11fab5=_0x3f0398;return _0x3f0398[_0xa09b('0x92')]();}return null;})[_0xa09b('0x24')](function(_0x3d45ef){if(_0x3d45ef){if(!_0x3d45ef[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x85ad4d=_0x3d45ef;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})[_0xa09b('0x24')](function(_0x252f44){if(_0x252f44){_0x35ad1d=_['keyBy'](_0x252f44,'id');var _0x17e453;var _0x36e396=squel[_0xa09b('0x77')]();_0x36e396[_0xa09b('0x78')](_0x11fab5['table']);for(var _0x395917=0x0;_0x395917<_0x85ad4d[_0xa09b('0x6c')];_0x395917+=0x1){_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x7a')]?_0x35ad1d[_0x85ad4d[_0x395917][_0xa09b('0x7a')]][_0xa09b('0x7b')]:_0x85ad4d[_0x395917][_0xa09b('0x6f')];_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x7d')]?_[_0xa09b('0x7c')](_0x499843[_0x85ad4d[_0x395917]['function']],'%s',_0x17e453):_0x17e453;_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x86')]?_[_0xa09b('0x7c')](_0xeb4dad[_0x85ad4d[_0x395917][_0xa09b('0x86')]],'%s',_0x17e453):_0x17e453;if(_0x85ad4d[_0x395917]['groupBy']){_0x36e396[_0xa09b('0x6e')](_0x17e453);}_0x85ad4d[_0x395917]['orderBy']&&_0x36e396[_0xa09b('0x3c')](_0x17e453,_0x85ad4d[_0x395917]['orderBy']===_0xa09b('0x80')?![]:!![]);_0x36e396['field'](_0x17e453,_0x85ad4d[_0x395917][_0xa09b('0x81')]||_0x17e453);}if(_0x11fab5['joins']){_0x11fab5[_0xa09b('0x82')]=JSON[_0xa09b('0x83')](_0x11fab5[_0xa09b('0x82')]);for(var _0x12dad1=0x0;_0x12dad1<_0x11fab5[_0xa09b('0x82')][_0xa09b('0x6c')];_0x12dad1+=0x1){if(_0x11fab5['joins'][_0x12dad1][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0xcc354,_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x31')])&&_0x11fab5[_0xa09b('0x82')][_0x12dad1]['parentKey']&&_0x11fab5['joins'][_0x12dad1][_0xa09b('0x85')]&&_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x87')]){_0x36e396[_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x31')]](_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x85')],null,util['format'](_0xa09b('0x93'),_0x11fab5[_0xa09b('0x79')],_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x84')],_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x85')],_0x11fab5[_0xa09b('0x82')][_0x12dad1]['foreignKey']));}}}if(_0x11fab5[_0xa09b('0x88')]){_0x11fab5['conditions']=JSON[_0xa09b('0x83')](_0x11fab5[_0xa09b('0x88')]);_0x36e396[_0xa09b('0x3e')](_0x3f1516(_0x11fab5['conditions'][_0xa09b('0x6e')]));}_0x3a0456=_0x36e396['clone']();_0x36e396[_0xa09b('0x20')](_0x57a9c6);_0x36e396['offset'](0x0);return;}})[_0xa09b('0x24')](function(){if(_0x4abfa6[_0xa09b('0x94')]===_0xa09b('0x95')){return null;}var _0x527f56=_['merge'](_0x4abfa6,{'name':_0x4abfa6[_0xa09b('0x96')]||_0x4abfa6[_0xa09b('0x2b')]||_0x11fab5[_0xa09b('0x2b')],'basename':_0x21a15a,'savename':util['format'](_0xa09b('0x97'),_0x4abfa6[_0xa09b('0x2b')]||_0x11fab5[_0xa09b('0x2b')],require(_0xa09b('0x98'))['generate'](0x4),_0x4abfa6[_0xa09b('0x94')]||_0xa09b('0x99')),'reportId':_0x11fab5['id'],'reportType':_0xa09b('0x9a')});return db[_0xa09b('0x9b')][_0xa09b('0x4c')](_0x527f56,{'raw':!![]});})['then'](function(_0x1c2ff2){if(_0x11fab5[_0xa09b('0x79')]==='cdr'){_0x3a0456['where'](_0x11fab5[_0xa09b('0x79')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4abfa6[_0xa09b('0x9c')],_0x4abfa6[_0xa09b('0x9d')]);}else{_0x3a0456[_0xa09b('0x3e')](_0x11fab5[_0xa09b('0x79')]+_0xa09b('0x9e'),_0x4abfa6[_0xa09b('0x9c')],_0x4abfa6['endDate']);}if(_0x1c2ff2){logger[_0xa09b('0x9f')](_0xa09b('0xa0'),_0x3a0456[_0xa09b('0x8a')]());require('child_process')['fork'](path[_0xa09b('0x58')](__dirname,_0xa09b('0xa1'),_0x1c2ff2['output']),[_0x1c2ff2['id'],_0x3a0456[_0xa09b('0x8a')](),path['join'](__dirname,_0xa09b('0xa2'),_0x1c2ff2[_0xa09b('0xa3')]),_0x21a15a]);return _0x1c2ff2;}else{var _0x459ce4=squel['select']();_0x459ce4['from']('('+_0x3a0456[_0xa09b('0x8a')]()+')','countTable');_0x459ce4[_0xa09b('0x6f')](_0xa09b('0xa4'),_0xa09b('0x21'));_0x3a0456[_0xa09b('0x20')](_0x4abfa6[_0xa09b('0x20')]||_0x57a9c6);_0x3a0456[_0xa09b('0x1e')](_0x4abfa6[_0xa09b('0x1e')]||0x0);return dbH[_0xa09b('0x8b')]['query'](_0x459ce4[_0xa09b('0x8a')](),{'type':dbH[_0xa09b('0x8b')][_0xa09b('0x8c')][_0xa09b('0x8d')]})['then'](function(_0xc3f27){if(!_0xc3f27['length']){_0x4251a8=0x0;}else{_0x4251a8=_0xc3f27[0x0][_0xa09b('0x21')]||0x0;}return dbH[_0xa09b('0x8b')][_0xa09b('0x33')](_0x3a0456[_0xa09b('0x8a')](),{'type':dbH[_0xa09b('0x8b')]['QueryTypes'][_0xa09b('0x8d')]});})['then'](function(_0x589608){return{'rows':_0x589608||[],'count':_0x4251a8};});}});}exports[_0xa09b('0xa5')]=function(_0x1929f2,_0x2e8b34){return runReport(_0x1929f2[_0xa09b('0x4a')],_0x1929f2[_0xa09b('0x33')],_0x1929f2['options'])[_0xa09b('0x24')](respondWithResult(_0x2e8b34,null))['catch'](handleError(_0x2e8b34,null));};exports[_0xa09b('0xa6')]=runReport;exports[_0xa09b('0x33')]=function(_0x360cb,_0x14d844){var _0x3852fa=0xa;var _0x429aff=[_0xa09b('0x58'),_0xa09b('0x59'),'right_join',_0xa09b('0x5b')];var _0x33c75e={'SUM':_0xa09b('0x8e'),'COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':_0xa09b('0x8f'),'MAX':_0xa09b('0x5d'),'MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0x4773f5={'SEC_TO_TIME':_0xa09b('0x90'),'DATE':_0xa09b('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11b528=function(_0x33d164){return!_[_0xa09b('0x67')]([_0xa09b('0x91'),_0xa09b('0x68'),'IS\x20EMPTY',_0xa09b('0x6a')],_0x33d164);};var _0x59313c=function(_0x311563){if(!_0x311563||!_0x311563[_0xa09b('0x6b')]['length']){return'';}for(var _0x53cfd6='(',_0x4e66b2=0x0;_0x4e66b2<_0x311563[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x4e66b2+=0x1){_0x4e66b2>0x0&&(_0x53cfd6+='\x20'+_0x311563[_0xa09b('0x6d')]+'\x20');_0x53cfd6+=_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x6e')]?_0x59313c(_0x311563['rules'][_0x4e66b2][_0xa09b('0x6e')]):_0x311563['rules'][_0x4e66b2][_0xa09b('0x6f')]+'\x20'+_0x311563['rules'][_0x4e66b2][_0xa09b('0x70')]+(_0x11b528(_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x70')])?'\x20'+_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x71')]:'');}return _0x53cfd6+')';};var _0x304e55={'where':{'id':_0x360cb[_0xa09b('0x4a')]['id']}},_0x11695f,_0x4ed85e,_0x2cdcf0,_0x4d6fea,_0x158bdf;_0x304e55=_[_0xa09b('0x40')]({},_0x304e55,_0x360cb[_0xa09b('0x43')]);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x304e55)[_0xa09b('0x24')](function(_0x225886){if(_0x225886){_0x11695f=_0x225886;return _0x225886[_0xa09b('0x92')]();}return null;})['then'](function(_0x40345b){if(_0x40345b){if(!_0x40345b[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed85e=_0x40345b;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})['then'](function(_0x237fbf){if(_0x237fbf){_0x2cdcf0=_[_0xa09b('0x76')](_0x237fbf,'id');var _0xeea10d;var _0x45632d=squel['select']();_0x45632d[_0xa09b('0x78')](_0x11695f[_0xa09b('0x79')]);for(var _0x14c882=0x0;_0x14c882<_0x4ed85e[_0xa09b('0x6c')];_0x14c882+=0x1){_0xeea10d=_0x4ed85e[_0x14c882][_0xa09b('0x7a')]?_0x2cdcf0[_0x4ed85e[_0x14c882]['MetricId']][_0xa09b('0x7b')]:_0x4ed85e[_0x14c882][_0xa09b('0x6f')];_0xeea10d=_0x4ed85e[_0x14c882]['function']?_['replace'](_0x33c75e[_0x4ed85e[_0x14c882][_0xa09b('0x7d')]],'%s',_0xeea10d):_0xeea10d;_0xeea10d=_0x4ed85e[_0x14c882]['format']?_[_0xa09b('0x7c')](_0x4773f5[_0x4ed85e[_0x14c882][_0xa09b('0x86')]],'%s',_0xeea10d):_0xeea10d;if(_0x4ed85e[_0x14c882][_0xa09b('0x7e')]){_0x45632d[_0xa09b('0x6e')](_0xeea10d);}_0x4ed85e[_0x14c882][_0xa09b('0x7f')]&&_0x45632d[_0xa09b('0x3c')](_0xeea10d,_0x4ed85e[_0x14c882][_0xa09b('0x7f')]===_0xa09b('0x80')?![]:!![]);_0x45632d['field'](_0xeea10d,_0x4ed85e[_0x14c882]['alias']||_0xeea10d);}if(_0x11695f[_0xa09b('0x82')]){_0x11695f[_0xa09b('0x82')]=JSON['parse'](_0x11695f[_0xa09b('0x82')]);for(var _0x26a850=0x0;_0x26a850<_0x11695f[_0xa09b('0x82')]['length'];_0x26a850+=0x1){if(_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0x429aff,_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')])&&_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x84')]&&_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignTable']&&_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignKey']){_0x45632d[_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')]](_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x11695f[_0xa09b('0x79')],_0x11695f[_0xa09b('0x82')][_0x26a850]['parentKey'],_0x11695f['joins'][_0x26a850][_0xa09b('0x85')],_0x11695f['joins'][_0x26a850]['foreignKey']));}}}if(_0x11695f[_0xa09b('0x88')]){_0x11695f[_0xa09b('0x88')]=JSON[_0xa09b('0x83')](_0x11695f[_0xa09b('0x88')]);_0x45632d['where'](_0x59313c(_0x11695f[_0xa09b('0x88')][_0xa09b('0x6e')]));}_0x158bdf=_0x45632d[_0xa09b('0xa7')]();_0x45632d[_0xa09b('0x20')](_0x3852fa);_0x45632d[_0xa09b('0x1e')](0x0);logger[_0xa09b('0x89')](_0xa09b('0xa8'),_0x45632d['toString']());return dbH['sequelize'][_0xa09b('0x33')](_0x45632d['toString'](),{'type':dbH['sequelize'][_0xa09b('0x8c')]['SELECT']});}})[_0xa09b('0x24')](function(){return{'sql':_0x158bdf['toString']()};})[_0xa09b('0x24')](respondWithResult(_0x14d844,null))[_0xa09b('0x48')](handleError(_0x14d844,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4ef6857..f05cf5c 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 _0x35bc=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35bc,0x10e));var _0xc35b=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x35bc[_0xcb0eb2];return _0xbab9b8;};'use strict';var _=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var logger=require(_0xc35b('0x2'))(_0xc35b('0x3'));var moment=require(_0xc35b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc35b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc35b('0x6'));var config=require(_0xc35b('0x7'));var attributes=require(_0xc35b('0x8'));module[_0xc35b('0x9')]=function(_0x5ee40b,_0x90f53a){return _0x5ee40b[_0xc35b('0xa')](_0xc35b('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfc5=['moment','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x30f9ed,_0x292d34){var _0x13dc35=function(_0x239060){while(--_0x239060){_0x30f9ed['push'](_0x30f9ed['shift']());}};_0x13dc35(++_0x292d34);}(_0xcfc5,0x1ac));var _0x5cfc=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xcfc5[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x5cfc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5cfc('0x1'));var moment=require(_0x5cfc('0x2'));var BPromise=require('bluebird');var rp=require(_0x5cfc('0x3'));var fs=require('fs');var path=require(_0x5cfc('0x4'));var rimraf=require('rimraf');var config=require(_0x5cfc('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x5cfc('0x6')]=function(_0x1c114c,_0x39961c){return _0x1c114c[_0x5cfc('0x7')](_0x5cfc('0x8'),attributes,{'tableName':_0x5cfc('0x9'),'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 c95912f..bdfe51f 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 _0xa11c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa11c,0xa4));var _0xca11=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa11c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xca11('0x0'));var util=require(_0xca11('0x1'));var moment=require(_0xca11('0x2'));var BPromise=require('bluebird');var rs=require(_0xca11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca11('0x4'))['db'];var utils=require(_0xca11('0x5'));var logger=require(_0xca11('0x6'))(_0xca11('0x7'));var config=require(_0xca11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca11('0x9')][_0xca11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3760f7,_0x11e38f,_0x93187d){return new BPromise(function(_0x2b94d2,_0x3b4bdf){return client['request'](_0x3760f7,_0x93187d)[_0xca11('0xb')](function(_0x50d763){logger[_0xca11('0xc')](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));logger[_0xca11('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x11e38f,_0xca11('0xe'),JSON[_0xca11('0x10')](_0x50d763));if(_0x50d763['error']){if(_0x50d763['error'][_0xca11('0x11')]===0x1f4){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);return _0x3b4bdf(_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);}logger['error'](_0xca11('0xd'),_0x11e38f,_0x50d763['error'][_0xca11('0x13')]);return _0x2b94d2(_0x50d763[_0xca11('0x12')]['message']);}else{logger['info'](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));_0x2b94d2(_0x50d763['result'][_0xca11('0x13')]);}})[_0xca11('0x14')](function(_0x4b04e9){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x4b04e9);_0x3b4bdf(_0x4b04e9);});});} \ No newline at end of file +var _0x3e2f=['info','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x545d7c,_0x2ed9e6){var _0x364159=function(_0x479da4){while(--_0x479da4){_0x545d7c['push'](_0x545d7c['shift']());}};_0x364159(++_0x2ed9e6);}(_0x3e2f,0x1df));var _0xf3e2=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x3e2f[_0x1ee351];return _0x245aaf;};'use strict';var _=require('lodash');var util=require(_0xf3e2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3e2('0x1'));var db=require(_0xf3e2('0x2'))['db'];var utils=require(_0xf3e2('0x3'));var logger=require(_0xf3e2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xddccad,_0x174128,_0x4819be){return new BPromise(function(_0x90e366,_0x254d80){return client['request'](_0xddccad,_0x4819be)[_0xf3e2('0x5')](function(_0xe31baa){logger['info'](_0xf3e2('0x6'),_0x174128,_0xf3e2('0x7'));logger[_0xf3e2('0x8')](_0xf3e2('0x9'),_0x174128,'request\x20sent',JSON[_0xf3e2('0xa')](_0xe31baa));if(_0xe31baa[_0xf3e2('0xb')]){if(_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xc')]===0x1f4){logger['error'](_0xf3e2('0x6'),_0x174128,_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xd')]);return _0x254d80(_0xe31baa[_0xf3e2('0xb')]['message']);}logger[_0xf3e2('0xb')](_0xf3e2('0x6'),_0x174128,_0xe31baa['error']['message']);return _0x90e366(_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xd')]);}else{logger[_0xf3e2('0xe')](_0xf3e2('0x6'),_0x174128,'request\x20sent');_0x90e366(_0xe31baa[_0xf3e2('0xf')][_0xf3e2('0xd')]);}})[_0xf3e2('0x10')](function(_0x224720){logger[_0xf3e2('0xb')](_0xf3e2('0x6'),_0x174128,_0x224720);_0x254d80(_0x224720);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 5886df0..a65040d 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 _0x2976=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xbbcada,_0x341b04){var _0x4f51de=function(_0x508d6c){while(--_0x508d6c){_0xbbcada['push'](_0xbbcada['shift']());}};_0x4f51de(++_0x341b04);}(_0x2976,0x1d5));var _0x6297=function(_0x1255d8,_0xb523fd){_0x1255d8=_0x1255d8-0x0;var _0x34ad49=_0x2976[_0x1255d8];return _0x34ad49;};'use strict';var multer=require(_0x6297('0x0'));var util=require(_0x6297('0x1'));var path=require(_0x6297('0x2'));var timeout=require(_0x6297('0x3'));var express=require('express');var router=express[_0x6297('0x4')]();var fs_extra=require(_0x6297('0x5'));var auth=require(_0x6297('0x6'));var interaction=require(_0x6297('0x7'));var config=require(_0x6297('0x8'));var controller=require(_0x6297('0x9'));router[_0x6297('0xa')]('/',auth['isAuthenticated'](),controller[_0x6297('0xb')]);router['get'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0xe')]);router[_0x6297('0xa')](_0x6297('0xf'),auth[_0x6297('0xd')](),controller[_0x6297('0x10')]);router[_0x6297('0xa')](_0x6297('0x11'),auth['isAuthenticated'](),controller['run']);router[_0x6297('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0x6297('0x12')]);router[_0x6297('0x13')]('/',auth['isAuthenticated'](),controller[_0x6297('0x14')]);router['put'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0x15')]);router[_0x6297('0x16')]('/:id',auth[_0x6297('0xd')](),controller[_0x6297('0x17')]);module[_0x6297('0x18')]=router; \ No newline at end of file +var _0x56c2=['./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47abbc,_0x5a8c7a){var _0x55a157=function(_0x1e3f32){while(--_0x1e3f32){_0x47abbc['push'](_0x47abbc['shift']());}};_0x55a157(++_0x5a8c7a);}(_0x56c2,0xe1));var _0x256c=function(_0x5eaae7,_0x577c09){_0x5eaae7=_0x5eaae7-0x0;var _0x591743=_0x56c2[_0x5eaae7];return _0x591743;};'use strict';var multer=require(_0x256c('0x0'));var util=require(_0x256c('0x1'));var path=require(_0x256c('0x2'));var timeout=require(_0x256c('0x3'));var express=require(_0x256c('0x4'));var router=express['Router']();var fs_extra=require(_0x256c('0x5'));var auth=require(_0x256c('0x6'));var interaction=require(_0x256c('0x7'));var config=require(_0x256c('0x8'));var controller=require(_0x256c('0x9'));router[_0x256c('0xa')]('/',auth[_0x256c('0xb')](),controller[_0x256c('0xc')]);router[_0x256c('0xa')](_0x256c('0xd'),auth[_0x256c('0xb')](),controller[_0x256c('0xe')]);router[_0x256c('0xa')](_0x256c('0xf'),auth[_0x256c('0xb')](),controller[_0x256c('0x10')]);router[_0x256c('0xa')](_0x256c('0x11'),auth['isAuthenticated'](),controller[_0x256c('0x12')]);router[_0x256c('0xa')](_0x256c('0x13'),auth[_0x256c('0xb')](),controller[_0x256c('0x14')]);router[_0x256c('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x256c('0x16')](_0x256c('0xd'),auth[_0x256c('0xb')](),controller['update']);router[_0x256c('0x17')]('/:id',auth[_0x256c('0xb')](),controller[_0x256c('0x18')]);module[_0x256c('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index fe3d8d9..a014092 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x5c8643,_0x4f7c4d){var _0x546259=function(_0x2e1d6e){while(--_0x2e1d6e){_0x5c8643['push'](_0x5c8643['shift']());}};_0x546259(++_0x4f7c4d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 25666bf..3248dad 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','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','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'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'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +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(_0x366280,_0x4e0c44){var _0x213351=function(_0x1f2ec1){while(--_0x1f2ec1){_0x366280['push'](_0x366280['shift']());}};_0x213351(++_0x4e0c44);}(_0x2542,0x169));var _0x2254=function(_0x3c4e73,_0x1a5a6b){_0x3c4e73=_0x3c4e73-0x0;var _0x1dc209=_0x2542[_0x3c4e73];return _0x1dc209;};'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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a8a3ad0..9d14d3e 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 _0x0eaf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x0eaf,0x143));var _0xf0ea=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0eaf[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf0ea('0x0'));var util=require(_0xf0ea('0x1'));var logger=require(_0xf0ea('0x2'))(_0xf0ea('0x3'));var moment=require(_0xf0ea('0x4'));var BPromise=require(_0xf0ea('0x5'));var rp=require(_0xf0ea('0x6'));var fs=require('fs');var path=require(_0xf0ea('0x7'));var rimraf=require(_0xf0ea('0x8'));var config=require(_0xf0ea('0x9'));var attributes=require(_0xf0ea('0xa'));module['exports']=function(_0x5aea5e,_0x469183){return _0x5aea5e[_0xf0ea('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xf0ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0e7=['bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xc0e7,0xd0));var _0x7c0e=function(_0x1178a5,_0x316ffe){_0x1178a5=_0x1178a5-0x0;var _0x3df8c7=_0xc0e7[_0x1178a5];return _0x3df8c7;};'use strict';var _=require(_0x7c0e('0x0'));var util=require('util');var logger=require(_0x7c0e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7c0e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c0e('0x3'));var config=require(_0x7c0e('0x4'));var attributes=require(_0x7c0e('0x5'));module[_0x7c0e('0x6')]=function(_0x49f0aa,_0x17493e){return _0x49f0aa['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 30628e8..20fcfc5 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 _0x3548=['AnalyticDefaultReport,\x20%s,\x20%s','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','result'];(function(_0x1a205d,_0x4c54f0){var _0xd32727=function(_0x3b3bc4){while(--_0x3b3bc4){_0x1a205d['push'](_0x1a205d['shift']());}};_0xd32727(++_0x4c54f0);}(_0x3548,0x10f));var _0x8354=function(_0x518461,_0x59c0bd){_0x518461=_0x518461-0x0;var _0x457a1c=_0x3548[_0x518461];return _0x457a1c;};'use strict';var _=require(_0x8354('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8354('0x1'));var rs=require(_0x8354('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8354('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8354('0x4'))('rpc');var config=require(_0x8354('0x5'));var jayson=require(_0x8354('0x6'));var client=jayson[_0x8354('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5958b1,_0x978001,_0x2781fb){return new BPromise(function(_0x52a6e7,_0x2fc0ad){return client[_0x8354('0x8')](_0x5958b1,_0x2781fb)[_0x8354('0x9')](function(_0x577012){logger[_0x8354('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x8354('0xb'));logger[_0x8354('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x978001,'request\x20sent',JSON[_0x8354('0xd')](_0x577012));if(_0x577012['error']){if(_0x577012[_0x8354('0xe')]['code']===0x1f4){logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x2fc0ad(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x52a6e7(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,'request\x20sent');_0x52a6e7(_0x577012[_0x8354('0x10')][_0x8354('0xf')]);}})['catch'](function(_0x546822){logger[_0x8354('0xe')](_0x8354('0x11'),_0x978001,_0x546822);_0x2fc0ad(_0x546822);});});} \ No newline at end of file +var _0x886d=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e7df1,_0x4ebe06){var _0x428385=function(_0x1c23e8){while(--_0x1c23e8){_0x3e7df1['push'](_0x3e7df1['shift']());}};_0x428385(++_0x4ebe06);}(_0x886d,0xff));var _0xd886=function(_0x459d7d,_0x55db19){_0x459d7d=_0x459d7d-0x0;var _0x26abf1=_0x886d[_0x459d7d];return _0x26abf1;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var moment=require(_0xd886('0x2'));var BPromise=require(_0xd886('0x3'));var rs=require(_0xd886('0x4'));var fs=require('fs');var Redis=require(_0xd886('0x5'));var db=require(_0xd886('0x6'))['db'];var utils=require(_0xd886('0x7'));var logger=require(_0xd886('0x8'))(_0xd886('0x9'));var config=require(_0xd886('0xa'));var jayson=require(_0xd886('0xb'));var client=jayson[_0xd886('0xc')][_0xd886('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x10da73,_0x5f4c6b,_0x2ae17e){return new BPromise(function(_0x4e1784,_0x5459f1){return client[_0xd886('0xe')](_0x10da73,_0x2ae17e)[_0xd886('0xf')](function(_0x4f456c){logger[_0xd886('0x10')](_0xd886('0x11'),_0x5f4c6b,_0xd886('0x12'));logger[_0xd886('0x13')](_0xd886('0x14'),_0x5f4c6b,'request\x20sent',JSON[_0xd886('0x15')](_0x4f456c));if(_0x4f456c[_0xd886('0x16')]){if(_0x4f456c[_0xd886('0x16')][_0xd886('0x17')]===0x1f4){logger['error'](_0xd886('0x11'),_0x5f4c6b,_0x4f456c[_0xd886('0x16')][_0xd886('0x18')]);return _0x5459f1(_0x4f456c[_0xd886('0x16')]['message']);}logger[_0xd886('0x16')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5f4c6b,_0x4f456c['error'][_0xd886('0x18')]);return _0x4e1784(_0x4f456c['error']['message']);}else{logger[_0xd886('0x10')](_0xd886('0x11'),_0x5f4c6b,'request\x20sent');_0x4e1784(_0x4f456c['result'][_0xd886('0x18')]);}})['catch'](function(_0x45bdd5){logger[_0xd886('0x16')](_0xd886('0x11'),_0x5f4c6b,_0x45bdd5);_0x5459f1(_0x45bdd5);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 82ce0a0..d7caa20 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 _0x9ade=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x30c95b,_0x5beb11){var _0xc5810c=function(_0x3b8809){while(--_0x3b8809){_0x30c95b['push'](_0x30c95b['shift']());}};_0xc5810c(++_0x5beb11);}(_0x9ade,0xde));var _0xe9ad=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x9ade[_0x1f7201];return _0x289fd2;};'use strict';var multer=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var path=require(_0xe9ad('0x2'));var timeout=require(_0xe9ad('0x3'));var express=require('express');var router=express[_0xe9ad('0x4')]();var fs_extra=require(_0xe9ad('0x5'));var auth=require(_0xe9ad('0x6'));var interaction=require(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));var controller=require(_0xe9ad('0x9'));router[_0xe9ad('0xa')]('/',auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9ad('0xd')]);router[_0xe9ad('0xa')](_0xe9ad('0xe'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xf')]);router[_0xe9ad('0xa')](_0xe9ad('0x10'),auth['isAuthenticated'](),controller[_0xe9ad('0x11')]);router[_0xe9ad('0xa')](_0xe9ad('0x12'),auth['isAuthenticated'](),controller[_0xe9ad('0x13')]);router[_0xe9ad('0x14')]('/',auth[_0xe9ad('0xb')](),controller['create']);router[_0xe9ad('0x15')](_0xe9ad('0x16'),auth['isAuthenticated'](),controller[_0xe9ad('0x17')]);router[_0xe9ad('0x18')](_0xe9ad('0x16'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0x19')]);module[_0xe9ad('0x1a')]=router; \ No newline at end of file +var _0x0b29=['Router','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports','multer','util','express'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0b29,0x11b));var _0x90b2=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x0b29[_0x3daa8c];return _0x2b1bd7;};'use strict';var multer=require(_0x90b2('0x0'));var util=require(_0x90b2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90b2('0x2'));var router=express[_0x90b2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x90b2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90b2('0x5'));router[_0x90b2('0x6')]('/',auth[_0x90b2('0x7')](),controller[_0x90b2('0x8')]);router[_0x90b2('0x6')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xa')]);router[_0x90b2('0x6')](_0x90b2('0xb'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xc')]);router[_0x90b2('0x6')](_0x90b2('0xd'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xe')]);router[_0x90b2('0x6')](_0x90b2('0xf'),auth['isAuthenticated'](),controller[_0x90b2('0x10')]);router[_0x90b2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x90b2('0x12')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller[_0x90b2('0x13')]);router[_0x90b2('0x14')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller['destroy']);module[_0x90b2('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index d26b140..35988e6 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 _0xe51c=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','xlsx','DATE'];(function(_0x1f2b2b,_0x20baed){var _0x1da0c8=function(_0x37fa60){while(--_0x37fa60){_0x1f2b2b['push'](_0x1f2b2b['shift']());}};_0x1da0c8(++_0x20baed);}(_0xe51c,0xdd));var _0xce51=function(_0x30a02e,_0x1338e8){_0x30a02e=_0x30a02e-0x0;var _0x36102a=_0xe51c[_0x30a02e];return _0x36102a;};'use strict';var Sequelize=require(_0xce51('0x0'));var moment=require(_0xce51('0x1'));module[_0xce51('0x2')]={'name':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xce51('0x4'),'pdf',_0xce51('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xce51('0x6')]},'endDate':{'type':Sequelize[_0xce51('0x6')]},'status':{'type':Sequelize[_0xce51('0x3')],'defaultValue':_0xce51('0x7')},'type':{'type':Sequelize['ENUM'](_0xce51('0x8'),_0xce51('0x9')),'allowNull':![],'defaultValue':_0xce51('0x8')},'reportId':{'type':Sequelize[_0xce51('0xa')](0xb)[_0xce51('0xb')]},'reportType':{'type':Sequelize[_0xce51('0x3')]}}; \ No newline at end of file +var _0x0290=['moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading','scheduled','manual','sequelize'];(function(_0xabe7e4,_0x288e85){var _0xb1891a=function(_0xe84ff6){while(--_0xe84ff6){_0xabe7e4['push'](_0xabe7e4['shift']());}};_0xb1891a(++_0x288e85);}(_0x0290,0xaf));var _0x0029=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0290[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0x0029('0x0'));var moment=require(_0x0029('0x1'));module[_0x0029('0x2')]={'name':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0029('0x4')](_0x0029('0x5'),'pdf',_0x0029('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0029('0x7')]},'endDate':{'type':Sequelize[_0x0029('0x7')]},'status':{'type':Sequelize[_0x0029('0x3')],'defaultValue':_0x0029('0x8')},'type':{'type':Sequelize[_0x0029('0x4')]('manual',_0x0029('0x9')),'allowNull':![],'defaultValue':_0x0029('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0029('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index c26872c..d740367 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 _0x9a3c=['error','stack','name','send','map','AnalyticExtractedReport','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x9a3c,0x95));var _0xc9a3=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x9a3c[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0xc9a3('0x0'));var rimraf=require(_0xc9a3('0x1'));var zipdir=require(_0xc9a3('0x2'));var jsonpatch=require(_0xc9a3('0x3'));var rp=require(_0xc9a3('0x4'));var moment=require(_0xc9a3('0x5'));var BPromise=require(_0xc9a3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc9a3('0x7'));var sox=require(_0xc9a3('0x8'));var csv=require(_0xc9a3('0x9'));var ejs=require(_0xc9a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9a3('0xb'));var squel=require(_0xc9a3('0xc'));var crypto=require(_0xc9a3('0xd'));var jsforce=require(_0xc9a3('0xe'));var deskjs=require(_0xc9a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9a3('0x10'));var Papa=require(_0xc9a3('0x11'));var Redis=require(_0xc9a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc9a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a3('0x14'));var logger=require(_0xc9a3('0x15'))(_0xc9a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc9a3('0x17'))['db'];function respondWithStatusCode(_0x195ca3,_0x5195ce){_0x5195ce=_0x5195ce||0xcc;return function(_0x59f8bc){if(_0x59f8bc){return _0x195ca3['sendStatus'](_0x5195ce);}return _0x195ca3[_0xc9a3('0x18')](_0x5195ce)[_0xc9a3('0x19')]();};}function respondWithResult(_0x40ce57,_0x2428a3){_0x2428a3=_0x2428a3||0xc8;return function(_0x5bf20e){if(_0x5bf20e){return _0x40ce57[_0xc9a3('0x18')](_0x2428a3)['json'](_0x5bf20e);}};}function respondWithFilteredResult(_0x13bf9a,_0x5cdb88){return function(_0x4dba10){if(_0x4dba10){var _0x16a5fc=typeof _0x5cdb88[_0xc9a3('0x1a')]===_0xc9a3('0x1b')&&typeof _0x5cdb88[_0xc9a3('0x1c')]==='undefined';var _0x42ff8b=_0x4dba10[_0xc9a3('0x1d')];var _0x462399=_0x16a5fc?0x0:_0x5cdb88[_0xc9a3('0x1a')];var _0x5831fd=_0x16a5fc?_0x4dba10[_0xc9a3('0x1d')]:_0x5cdb88['offset']+_0x5cdb88['limit'];var _0x30df79;if(_0x5831fd>=_0x42ff8b){_0x5831fd=_0x42ff8b;_0x30df79=0xc8;}else{_0x30df79=0xce;}_0x13bf9a['status'](_0x30df79);return _0x13bf9a[_0xc9a3('0x1e')](_0xc9a3('0x1f'),_0x462399+'-'+_0x5831fd+'/'+_0x42ff8b)[_0xc9a3('0x20')](_0x4dba10);}return null;};}function patchUpdates(_0x6a3d10){return function(_0x403a8a){try{jsonpatch[_0xc9a3('0x21')](_0x403a8a,_0x6a3d10,!![]);}catch(_0x2eeef2){return BPromise[_0xc9a3('0x22')](_0x2eeef2);}return _0x403a8a[_0xc9a3('0x23')]();};}function saveUpdates(_0x5bf8af,_0x5c4659){return function(_0x318ca7){if(_0x318ca7){return _0x318ca7[_0xc9a3('0x24')](_0x5bf8af)[_0xc9a3('0x25')](function(_0x371b68){return _0x371b68;});}return null;};}function removeEntity(_0x2d86be,_0x29a59f){return function(_0x2c9a94){if(_0x2c9a94){return _0x2c9a94[_0xc9a3('0x26')]()['then'](function(){var _0x200dde=_0x2c9a94[_0xc9a3('0x27')]({'plain':!![]});var _0x372b22='ExtractedReports';return db['UserProfileResource'][_0xc9a3('0x26')]({'where':{'type':_0x372b22,'resourceId':_0x200dde['id']}})[_0xc9a3('0x25')](function(){return _0x2c9a94;});})[_0xc9a3('0x25')](function(){_0x2d86be[_0xc9a3('0x18')](0xcc)[_0xc9a3('0x19')]();});}};}function handleEntityNotFound(_0x16cc54,_0x13ab37){return function(_0x23f03b){if(!_0x23f03b){_0x16cc54[_0xc9a3('0x28')](0x194);}return _0x23f03b;};}function handleError(_0x54b8f8,_0x1f794c){_0x1f794c=_0x1f794c||0x1f4;return function(_0x2bfe87){logger[_0xc9a3('0x29')](_0x2bfe87[_0xc9a3('0x2a')]);if(_0x2bfe87[_0xc9a3('0x2b')]){delete _0x2bfe87[_0xc9a3('0x2b')];}_0x54b8f8[_0xc9a3('0x18')](_0x1f794c)[_0xc9a3('0x2c')](_0x2bfe87);};}exports['index']=function(_0x4302a2,_0x877aa8){var _0x1a0c47={},_0x166b3e={},_0x1bbbf4={'count':0x0,'rows':[]};var _0x17b56c=_[_0xc9a3('0x2d')](db[_0xc9a3('0x2e')]['rawAttributes'],function(_0x33ade8){return{'name':_0x33ade8[_0xc9a3('0x2f')],'type':_0x33ade8['type']['key']};});_0x166b3e[_0xc9a3('0x30')]=_['map'](_0x17b56c,_0xc9a3('0x2b'));_0x166b3e[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0x4302a2[_0xc9a3('0x31')]);_0x166b3e[_0xc9a3('0x33')]=_['intersection'](_0x166b3e['model'],_0x166b3e[_0xc9a3('0x31')]);_0x1a0c47[_0xc9a3('0x34')]=_['intersection'](_0x166b3e[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0x1a0c47[_0xc9a3('0x34')]=_0x1a0c47[_0xc9a3('0x34')][_0xc9a3('0x36')]?_0x1a0c47['attributes']:_0x166b3e[_0xc9a3('0x30')];if(!_0x4302a2[_0xc9a3('0x31')]['hasOwnProperty'](_0xc9a3('0x37'))){_0x1a0c47[_0xc9a3('0x1c')]=qs[_0xc9a3('0x1c')](_0x4302a2['query'][_0xc9a3('0x1c')]);_0x1a0c47[_0xc9a3('0x1a')]=qs['offset'](_0x4302a2[_0xc9a3('0x31')]['offset']);}_0x1a0c47[_0xc9a3('0x38')]=qs[_0xc9a3('0x39')](_0x4302a2['query'][_0xc9a3('0x39')]);_0x1a0c47['where']=qs['filters'](_[_0xc9a3('0x3a')](_0x4302a2[_0xc9a3('0x31')],_0x166b3e[_0xc9a3('0x33')]),_0x17b56c);if(_0x4302a2[_0xc9a3('0x31')]['filter']){_0x1a0c47[_0xc9a3('0x3b')]=_[_0xc9a3('0x3c')](_0x1a0c47[_0xc9a3('0x3b')],{'$or':_[_0xc9a3('0x2d')](_0x17b56c,function(_0x1ca906){if(_0x1ca906[_0xc9a3('0x3d')]!==_0xc9a3('0x3e')){var _0x11cb35={};_0x11cb35[_0x1ca906[_0xc9a3('0x2b')]]={'$like':'%'+_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x3f')]+'%'};return _0x11cb35;}})});}_0x1a0c47=_[_0xc9a3('0x3c')]({},_0x1a0c47,_0x4302a2[_0xc9a3('0x40')]);var _0x371ab9={'where':_0x1a0c47[_0xc9a3('0x3b')]};return db[_0xc9a3('0x2e')][_0xc9a3('0x1d')](_0x371ab9)[_0xc9a3('0x25')](function(_0x5ecb34){_0x1bbbf4['count']=_0x5ecb34;if(_0x4302a2['query']['includeAll']){_0x1a0c47[_0xc9a3('0x41')]=[{'all':!![]}];}return db[_0xc9a3('0x2e')][_0xc9a3('0x42')](_0x1a0c47);})['then'](function(_0x2d62a6){_0x1bbbf4[_0xc9a3('0x43')]=_0x2d62a6;return _0x1bbbf4;})[_0xc9a3('0x25')](respondWithFilteredResult(_0x877aa8,_0x1a0c47))[_0xc9a3('0x44')](handleError(_0x877aa8,null));};exports['show']=function(_0xf8ed3d,_0x125f78){var _0xd2f882={'raw':!![],'where':{'id':_0xf8ed3d[_0xc9a3('0x45')]['id']}},_0x536da5={};_0x536da5[_0xc9a3('0x30')]=_[_0xc9a3('0x32')](db[_0xc9a3('0x2e')][_0xc9a3('0x46')]);_0x536da5[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0xf8ed3d['query']);_0x536da5[_0xc9a3('0x33')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],_0x536da5[_0xc9a3('0x31')]);_0xd2f882[_0xc9a3('0x34')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0xd2f882[_0xc9a3('0x34')]=_0xd2f882['attributes'][_0xc9a3('0x36')]?_0xd2f882[_0xc9a3('0x34')]:_0x536da5['model'];if(_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x47')]){_0xd2f882[_0xc9a3('0x41')]=[{'all':!![]}];}_0xd2f882=_[_0xc9a3('0x3c')]({},_0xd2f882,_0xf8ed3d['options']);return db[_0xc9a3('0x2e')][_0xc9a3('0x48')](_0xd2f882)['then'](handleEntityNotFound(_0x125f78,null))[_0xc9a3('0x25')](respondWithResult(_0x125f78,null))[_0xc9a3('0x44')](handleError(_0x125f78,null));};exports[_0xc9a3('0x49')]=function(_0x4f8e67,_0x3dd609){return db[_0xc9a3('0x2e')][_0xc9a3('0x49')](_0x4f8e67[_0xc9a3('0x4a')],{})[_0xc9a3('0x25')](function(_0x7efff5){var _0x3df796=_0x4f8e67[_0xc9a3('0x4b')]['get']({'plain':!![]});if(!_0x3df796)throw new Error(_0xc9a3('0x4c'));if(_0x3df796['role']===_0xc9a3('0x4b')){var _0x571bae=_0x7efff5[_0xc9a3('0x27')]({'plain':!![]});var _0x57bae9='ExtractedReports';return db['UserProfileSection'][_0xc9a3('0x48')]({'where':{'name':_0x57bae9,'userProfileId':_0x3df796[_0xc9a3('0x4d')]},'raw':!![]})['then'](function(_0x49baa2){if(_0x49baa2&&_0x49baa2[_0xc9a3('0x4e')]===0x0){return db[_0xc9a3('0x4f')][_0xc9a3('0x49')]({'name':_0x571bae[_0xc9a3('0x2b')],'resourceId':_0x571bae['id'],'type':_0x49baa2[_0xc9a3('0x2b')],'sectionId':_0x49baa2['id']},{})['then'](function(){return _0x7efff5;});}else{return _0x7efff5;}})[_0xc9a3('0x44')](function(_0x16de1e){logger[_0xc9a3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16de1e);throw _0x16de1e;});}return _0x7efff5;})['then'](respondWithResult(_0x3dd609,0xc9))['catch'](handleError(_0x3dd609,null));};exports[_0xc9a3('0x24')]=function(_0x24ad95,_0x6e10f9){if(_0x24ad95['body']['id']){delete _0x24ad95[_0xc9a3('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x24ad95['params']['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x6e10f9,null))[_0xc9a3('0x25')](saveUpdates(_0x24ad95[_0xc9a3('0x4a')],null))[_0xc9a3('0x25')](respondWithResult(_0x6e10f9,null))[_0xc9a3('0x44')](handleError(_0x6e10f9,null));};exports[_0xc9a3('0x26')]=function(_0x4c5251,_0x4d14a8){return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x4c5251[_0xc9a3('0x45')]['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x4d14a8,null))['then'](removeEntity(_0x4d14a8,null))['catch'](handleError(_0x4d14a8,null));};exports[_0xc9a3('0x50')]=function(_0x259621,_0xa899b1,_0x1497d1){return db[_0xc9a3('0x2e')][_0xc9a3('0x48')]({'where':{'id':_0x259621['params']['id']},'attributes':['name',_0xc9a3('0x51'),_0xc9a3('0x52'),_0xc9a3('0x53')],'raw':!![]})[_0xc9a3('0x25')](handleEntityNotFound(_0xa899b1,null))[_0xc9a3('0x25')](function(_0x1f5df7){if(_0x1f5df7){if(!fs[_0xc9a3('0x54')](path[_0xc9a3('0x55')](config[_0xc9a3('0x56')],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]))){throw new db[(_0xc9a3('0x58'))][(_0xc9a3('0x59'))](_0xc9a3('0x5a'));}if(_0x259621[_0xc9a3('0x31')][_0xc9a3('0x5b')]){return _0xa899b1[_0xc9a3('0x28')](0xc8);}return _0xa899b1['download'](path[_0xc9a3('0x55')](config['root'],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]),util[_0xc9a3('0x5c')](_0xc9a3('0x5d'),_0x1f5df7[_0xc9a3('0x51')]||_0x1f5df7['name'],_0x1f5df7['output'][_0xc9a3('0x5e')]()));}})['catch'](handleError(_0xa899b1,null));}; \ No newline at end of file +var _0x0d49=['create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','model','query','intersection','fields','attributes','length','limit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','rows','catch','find'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x0d49,0x19c));var _0x90d4=function(_0x5b532e,_0x5369c4){_0x5b532e=_0x5b532e-0x0;var _0x15f83e=_0x0d49[_0x5b532e];return _0x15f83e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90d4('0x1'));var rp=require(_0x90d4('0x2'));var moment=require(_0x90d4('0x3'));var BPromise=require(_0x90d4('0x4'));var Mustache=require('mustache');var util=require(_0x90d4('0x5'));var path=require(_0x90d4('0x6'));var sox=require(_0x90d4('0x7'));var csv=require(_0x90d4('0x8'));var ejs=require(_0x90d4('0x9'));var fs=require('fs');var fs_extra=require(_0x90d4('0xa'));var _=require(_0x90d4('0xb'));var squel=require(_0x90d4('0xc'));var crypto=require(_0x90d4('0xd'));var jsforce=require(_0x90d4('0xe'));var deskjs=require(_0x90d4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x90d4('0x10'));var Papa=require(_0x90d4('0x11'));var Redis=require('ioredis');var authService=require(_0x90d4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90d4('0x13'));var hardwareService=require(_0x90d4('0x14'));var logger=require(_0x90d4('0x15'))(_0x90d4('0x16'));var utils=require(_0x90d4('0x17'));var config=require(_0x90d4('0x18'));var licenseUtil=require(_0x90d4('0x19'));var db=require(_0x90d4('0x1a'))['db'];function respondWithStatusCode(_0x301bbb,_0x13ce7e){_0x13ce7e=_0x13ce7e||0xcc;return function(_0x18caa1){if(_0x18caa1){return _0x301bbb[_0x90d4('0x1b')](_0x13ce7e);}return _0x301bbb[_0x90d4('0x1c')](_0x13ce7e)[_0x90d4('0x1d')]();};}function respondWithResult(_0xef29af,_0xa06d78){_0xa06d78=_0xa06d78||0xc8;return function(_0xb5ee7c){if(_0xb5ee7c){return _0xef29af[_0x90d4('0x1c')](_0xa06d78)[_0x90d4('0x1e')](_0xb5ee7c);}};}function respondWithFilteredResult(_0x2dc8f3,_0xb44d66){return function(_0xab7598){if(_0xab7598){var _0x47f53e=typeof _0xb44d66[_0x90d4('0x1f')]==='undefined'&&typeof _0xb44d66['limit']===_0x90d4('0x20');var _0x1ad8cc=_0xab7598[_0x90d4('0x21')];var _0x39ddcc=_0x47f53e?0x0:_0xb44d66[_0x90d4('0x1f')];var _0x2d88a1=_0x47f53e?_0xab7598[_0x90d4('0x21')]:_0xb44d66[_0x90d4('0x1f')]+_0xb44d66['limit'];var _0x663f27;if(_0x2d88a1>=_0x1ad8cc){_0x2d88a1=_0x1ad8cc;_0x663f27=0xc8;}else{_0x663f27=0xce;}_0x2dc8f3[_0x90d4('0x1c')](_0x663f27);return _0x2dc8f3[_0x90d4('0x22')](_0x90d4('0x23'),_0x39ddcc+'-'+_0x2d88a1+'/'+_0x1ad8cc)[_0x90d4('0x1e')](_0xab7598);}return null;};}function patchUpdates(_0x59c83e){return function(_0x119cc6){try{jsonpatch[_0x90d4('0x24')](_0x119cc6,_0x59c83e,!![]);}catch(_0x3c3e58){return BPromise[_0x90d4('0x25')](_0x3c3e58);}return _0x119cc6[_0x90d4('0x26')]();};}function saveUpdates(_0x12a57e,_0x4b8eef){return function(_0x20a2a3){if(_0x20a2a3){return _0x20a2a3[_0x90d4('0x27')](_0x12a57e)[_0x90d4('0x28')](function(_0x37954d){return _0x37954d;});}return null;};}function removeEntity(_0x4a6593,_0x42d39c){return function(_0x1a6c6f){if(_0x1a6c6f){return _0x1a6c6f[_0x90d4('0x29')]()[_0x90d4('0x28')](function(){var _0x17164b=_0x1a6c6f['get']({'plain':!![]});var _0xa7e465='ExtractedReports';return db[_0x90d4('0x2a')]['destroy']({'where':{'type':_0xa7e465,'resourceId':_0x17164b['id']}})[_0x90d4('0x28')](function(){return _0x1a6c6f;});})[_0x90d4('0x28')](function(){_0x4a6593[_0x90d4('0x1c')](0xcc)[_0x90d4('0x1d')]();});}};}function handleEntityNotFound(_0x124ba4,_0x51323c){return function(_0x48b4c7){if(!_0x48b4c7){_0x124ba4['sendStatus'](0x194);}return _0x48b4c7;};}function handleError(_0x3ae887,_0x385c9a){_0x385c9a=_0x385c9a||0x1f4;return function(_0x3c3644){logger[_0x90d4('0x2b')](_0x3c3644['stack']);if(_0x3c3644[_0x90d4('0x2c')]){delete _0x3c3644['name'];}_0x3ae887[_0x90d4('0x1c')](_0x385c9a)[_0x90d4('0x2d')](_0x3c3644);};}exports[_0x90d4('0x2e')]=function(_0x5667f4,_0x452db8){var _0x354f55={},_0x460186={},_0x3f2c99={'count':0x0,'rows':[]};var _0x1b75f2=_[_0x90d4('0x2f')](db['AnalyticExtractedReport'][_0x90d4('0x30')],function(_0x72acc0){return{'name':_0x72acc0[_0x90d4('0x31')],'type':_0x72acc0[_0x90d4('0x32')][_0x90d4('0x33')]};});_0x460186['model']=_['map'](_0x1b75f2,_0x90d4('0x2c'));_0x460186['query']=_[_0x90d4('0x34')](_0x5667f4['query']);_0x460186[_0x90d4('0x35')]=_['intersection'](_0x460186[_0x90d4('0x36')],_0x460186[_0x90d4('0x37')]);_0x354f55['attributes']=_[_0x90d4('0x38')](_0x460186['model'],qs[_0x90d4('0x39')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x39')]));_0x354f55[_0x90d4('0x3a')]=_0x354f55[_0x90d4('0x3a')][_0x90d4('0x3b')]?_0x354f55[_0x90d4('0x3a')]:_0x460186[_0x90d4('0x36')];if(!_0x5667f4['query']['hasOwnProperty']('nolimit')){_0x354f55[_0x90d4('0x3c')]=qs[_0x90d4('0x3c')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x3c')]);_0x354f55[_0x90d4('0x1f')]=qs[_0x90d4('0x1f')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x1f')]);}_0x354f55['order']=qs['sort'](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x3d')]);_0x354f55[_0x90d4('0x3e')]=qs[_0x90d4('0x35')](_[_0x90d4('0x3f')](_0x5667f4[_0x90d4('0x37')],_0x460186['filters']),_0x1b75f2);if(_0x5667f4['query']['filter']){_0x354f55[_0x90d4('0x3e')]=_[_0x90d4('0x40')](_0x354f55[_0x90d4('0x3e')],{'$or':_[_0x90d4('0x2f')](_0x1b75f2,function(_0x1a3250){if(_0x1a3250['type']!==_0x90d4('0x41')){var _0xc76f2f={};_0xc76f2f[_0x1a3250[_0x90d4('0x2c')]]={'$like':'%'+_0x5667f4[_0x90d4('0x37')][_0x90d4('0x42')]+'%'};return _0xc76f2f;}})});}_0x354f55=_[_0x90d4('0x40')]({},_0x354f55,_0x5667f4[_0x90d4('0x43')]);var _0x57d3e0={'where':_0x354f55[_0x90d4('0x3e')]};return db[_0x90d4('0x44')][_0x90d4('0x21')](_0x57d3e0)[_0x90d4('0x28')](function(_0x15c68f){_0x3f2c99['count']=_0x15c68f;if(_0x5667f4[_0x90d4('0x37')][_0x90d4('0x45')]){_0x354f55['include']=[{'all':!![]}];}return db[_0x90d4('0x44')]['findAll'](_0x354f55);})[_0x90d4('0x28')](function(_0x3a50ac){_0x3f2c99[_0x90d4('0x46')]=_0x3a50ac;return _0x3f2c99;})[_0x90d4('0x28')](respondWithFilteredResult(_0x452db8,_0x354f55))[_0x90d4('0x47')](handleError(_0x452db8,null));};exports['show']=function(_0x8f5180,_0x37b43d){var _0x90c4a1={'raw':!![],'where':{'id':_0x8f5180['params']['id']}},_0x24983a={};_0x24983a[_0x90d4('0x36')]=_[_0x90d4('0x34')](db[_0x90d4('0x44')][_0x90d4('0x30')]);_0x24983a[_0x90d4('0x37')]=_[_0x90d4('0x34')](_0x8f5180[_0x90d4('0x37')]);_0x24983a[_0x90d4('0x35')]=_[_0x90d4('0x38')](_0x24983a[_0x90d4('0x36')],_0x24983a[_0x90d4('0x37')]);_0x90c4a1[_0x90d4('0x3a')]=_['intersection'](_0x24983a['model'],qs['fields'](_0x8f5180[_0x90d4('0x37')][_0x90d4('0x39')]));_0x90c4a1[_0x90d4('0x3a')]=_0x90c4a1[_0x90d4('0x3a')]['length']?_0x90c4a1[_0x90d4('0x3a')]:_0x24983a[_0x90d4('0x36')];if(_0x8f5180['query'][_0x90d4('0x45')]){_0x90c4a1['include']=[{'all':!![]}];}_0x90c4a1=_[_0x90d4('0x40')]({},_0x90c4a1,_0x8f5180[_0x90d4('0x43')]);return db[_0x90d4('0x44')][_0x90d4('0x48')](_0x90c4a1)[_0x90d4('0x28')](handleEntityNotFound(_0x37b43d,null))[_0x90d4('0x28')](respondWithResult(_0x37b43d,null))[_0x90d4('0x47')](handleError(_0x37b43d,null));};exports[_0x90d4('0x49')]=function(_0x26cb77,_0x1f93a4){return db[_0x90d4('0x44')][_0x90d4('0x49')](_0x26cb77['body'],{})[_0x90d4('0x28')](function(_0x366661){var _0x3b1a22=_0x26cb77['user'][_0x90d4('0x4a')]({'plain':!![]});if(!_0x3b1a22)throw new Error(_0x90d4('0x4b'));if(_0x3b1a22[_0x90d4('0x4c')]==='user'){var _0x234e27=_0x366661[_0x90d4('0x4a')]({'plain':!![]});var _0x4ff479='ExtractedReports';return db[_0x90d4('0x4d')][_0x90d4('0x48')]({'where':{'name':_0x4ff479,'userProfileId':_0x3b1a22[_0x90d4('0x4e')]},'raw':!![]})[_0x90d4('0x28')](function(_0x47e5a7){if(_0x47e5a7&&_0x47e5a7[_0x90d4('0x4f')]===0x0){return db['UserProfileResource'][_0x90d4('0x49')]({'name':_0x234e27['name'],'resourceId':_0x234e27['id'],'type':_0x47e5a7['name'],'sectionId':_0x47e5a7['id']},{})[_0x90d4('0x28')](function(){return _0x366661;});}else{return _0x366661;}})[_0x90d4('0x47')](function(_0x7eec25){logger['error'](_0x90d4('0x50'),_0x7eec25);throw _0x7eec25;});}return _0x366661;})[_0x90d4('0x28')](respondWithResult(_0x1f93a4,0xc9))[_0x90d4('0x47')](handleError(_0x1f93a4,null));};exports['update']=function(_0x65f786,_0x566d7f){if(_0x65f786[_0x90d4('0x51')]['id']){delete _0x65f786['body']['id'];}return db[_0x90d4('0x44')][_0x90d4('0x48')]({'where':{'id':_0x65f786[_0x90d4('0x52')]['id']}})[_0x90d4('0x28')](handleEntityNotFound(_0x566d7f,null))[_0x90d4('0x28')](saveUpdates(_0x65f786['body'],null))[_0x90d4('0x28')](respondWithResult(_0x566d7f,null))[_0x90d4('0x47')](handleError(_0x566d7f,null));};exports['destroy']=function(_0x46ca31,_0x4bffb3){return db['AnalyticExtractedReport'][_0x90d4('0x48')]({'where':{'id':_0x46ca31['params']['id']}})['then'](handleEntityNotFound(_0x4bffb3,null))[_0x90d4('0x28')](removeEntity(_0x4bffb3,null))[_0x90d4('0x47')](handleError(_0x4bffb3,null));};exports[_0x90d4('0x53')]=function(_0x3e3ef0,_0x2fd2d4,_0x5cb7ad){return db[_0x90d4('0x44')]['find']({'where':{'id':_0x3e3ef0['params']['id']},'attributes':[_0x90d4('0x2c'),_0x90d4('0x54'),_0x90d4('0x55'),_0x90d4('0x56')],'raw':!![]})[_0x90d4('0x28')](handleEntityNotFound(_0x2fd2d4,null))['then'](function(_0x560bff){if(_0x560bff){if(!fs[_0x90d4('0x57')](path['join'](config['root'],_0x90d4('0x58'),_0x560bff[_0x90d4('0x55')]))){throw new db[(_0x90d4('0x59'))][(_0x90d4('0x5a'))](_0x90d4('0x5b'));}if(_0x3e3ef0[_0x90d4('0x37')][_0x90d4('0x5c')]){return _0x2fd2d4[_0x90d4('0x1b')](0xc8);}return _0x2fd2d4['download'](path[_0x90d4('0x5d')](config[_0x90d4('0x5e')],'server/files/reports',_0x560bff[_0x90d4('0x55')]),util[_0x90d4('0x5f')]('%s.%s',_0x560bff[_0x90d4('0x54')]||_0x560bff['name'],_0x560bff[_0x90d4('0x56')][_0x90d4('0x60')]()));}})[_0x90d4('0x47')](handleError(_0x2fd2d4,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index c16d603..7736bbf 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 _0x0ea1=['analytics_extracted_reports','util','api','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x45c55e,_0x18002b){var _0x5a9dd8=function(_0x389e52){while(--_0x389e52){_0x45c55e['push'](_0x45c55e['shift']());}};_0x5a9dd8(++_0x18002b);}(_0x0ea1,0xb5));var _0x10ea=function(_0x54b9e2,_0x47b06c){_0x54b9e2=_0x54b9e2-0x0;var _0x4859cc=_0x0ea1[_0x54b9e2];return _0x4859cc;};'use strict';var _=require('lodash');var util=require(_0x10ea('0x0'));var logger=require('../../config/logger')(_0x10ea('0x1'));var moment=require('moment');var BPromise=require(_0x10ea('0x2'));var rp=require(_0x10ea('0x3'));var fs=require('fs');var path=require(_0x10ea('0x4'));var rimraf=require('rimraf');var config=require(_0x10ea('0x5'));var attributes=require(_0x10ea('0x6'));module[_0x10ea('0x7')]=function(_0x4dfafc,_0x405754){return _0x4dfafc[_0x10ea('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x10ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4c1=['rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise','path'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xe4c1,0x126));var _0x1e4c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe4c1[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x1e4c('0x0'));var util=require(_0x1e4c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e4c('0x2'));var BPromise=require(_0x1e4c('0x3'));var rp=require(_0x1e4c('0x4'));var fs=require('fs');var path=require(_0x1e4c('0x5'));var rimraf=require(_0x1e4c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x1e4c('0x7')]=function(_0x2b00bd,_0x2ce50a){return _0x2b00bd['define'](_0x1e4c('0x8'),attributes,{'tableName':_0x1e4c('0x9'),'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 971deca..0250042 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 _0x1137=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x46aa9c,_0x518160){var _0xf19a0b=function(_0x353d73){while(--_0x353d73){_0x46aa9c['push'](_0x46aa9c['shift']());}};_0xf19a0b(++_0x518160);}(_0x1137,0x183));var _0x7113=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x1137[_0x9307ea];return _0x295554;};'use strict';var _=require(_0x7113('0x0'));var util=require(_0x7113('0x1'));var moment=require(_0x7113('0x2'));var BPromise=require(_0x7113('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7113('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7113('0x5'));var logger=require('../../config/logger')(_0x7113('0x6'));var config=require(_0x7113('0x7'));var jayson=require(_0x7113('0x8'));var client=jayson[_0x7113('0x9')][_0x7113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518610,_0x4ae605,_0x532fa1){return new BPromise(function(_0x4ac528,_0x2fc982){return client['request'](_0x518610,_0x532fa1)['then'](function(_0xfe7490){logger[_0x7113('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ae605,_0x7113('0xc'));logger[_0x7113('0xd')](_0x7113('0xe'),_0x4ae605,_0x7113('0xc'),JSON[_0x7113('0xf')](_0xfe7490));if(_0xfe7490[_0x7113('0x10')]){if(_0xfe7490[_0x7113('0x10')][_0x7113('0x11')]===0x1f4){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x2fc982(_0xfe7490[_0x7113('0x10')]['message']);}logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x4ac528(_0xfe7490[_0x7113('0x10')][_0x7113('0x13')]);}else{logger[_0x7113('0xb')](_0x7113('0x12'),_0x4ae605,'request\x20sent');_0x4ac528(_0xfe7490[_0x7113('0x14')]['message']);}})['catch'](function(_0x215e01){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0x215e01);_0x2fc982(_0x215e01);});});} \ No newline at end of file +var _0x7ef2=['http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x2ef789,_0x26a493){var _0xf29e80=function(_0x392fbe){while(--_0x392fbe){_0x2ef789['push'](_0x2ef789['shift']());}};_0xf29e80(++_0x26a493);}(_0x7ef2,0x15d));var _0x27ef=function(_0x22a993,_0x221191){_0x22a993=_0x22a993-0x0;var _0x4f9ca0=_0x7ef2[_0x22a993];return _0x4f9ca0;};'use strict';var _=require(_0x27ef('0x0'));var util=require('util');var moment=require(_0x27ef('0x1'));var BPromise=require(_0x27ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27ef('0x3'));var db=require(_0x27ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27ef('0x5'));var config=require(_0x27ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x27ef('0x7')][_0x27ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x285292,_0x563446,_0x133d91){return new BPromise(function(_0x3bbb83,_0x38dcbc){return client[_0x27ef('0x9')](_0x285292,_0x133d91)[_0x27ef('0xa')](function(_0x4ec4e5){logger[_0x27ef('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x27ef('0xc'));logger['debug'](_0x27ef('0xd'),_0x563446,'request\x20sent',JSON[_0x27ef('0xe')](_0x4ec4e5));if(_0x4ec4e5[_0x27ef('0xf')]){if(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x10')]===0x1f4){logger[_0x27ef('0xf')](_0x27ef('0x11'),_0x563446,_0x4ec4e5[_0x27ef('0xf')]['message']);return _0x38dcbc(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x12')]);}logger[_0x27ef('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x4ec4e5[_0x27ef('0xf')]['message']);return _0x3bbb83(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x12')]);}else{logger[_0x27ef('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x27ef('0xc'));_0x3bbb83(_0x4ec4e5[_0x27ef('0x13')][_0x27ef('0x12')]);}})[_0x27ef('0x14')](function(_0x1d2803){logger[_0x27ef('0xf')](_0x27ef('0x11'),_0x563446,_0x1d2803);_0x38dcbc(_0x1d2803);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 37b5306..709b8ba 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 _0x3588=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','delete','multer','util','path','connect-timeout'];(function(_0x2a2a4a,_0x30e750){var _0xbd4c98=function(_0x2b6339){while(--_0x2b6339){_0x2a2a4a['push'](_0x2a2a4a['shift']());}};_0xbd4c98(++_0x30e750);}(_0x3588,0xf8));var _0x8358=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x3588[_0x4310e8];return _0x301445;};'use strict';var multer=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var path=require(_0x8358('0x2'));var timeout=require(_0x8358('0x3'));var express=require(_0x8358('0x4'));var router=express[_0x8358('0x5')]();var fs_extra=require(_0x8358('0x6'));var auth=require(_0x8358('0x7'));var interaction=require(_0x8358('0x8'));var config=require('../../config/environment');var controller=require(_0x8358('0x9'));router['get']('/',auth[_0x8358('0xa')](),controller[_0x8358('0xb')]);router[_0x8358('0xc')](_0x8358('0xd'),auth[_0x8358('0xa')](),controller[_0x8358('0xe')]);router[_0x8358('0xc')](_0x8358('0xf'),auth[_0x8358('0xa')](),controller[_0x8358('0x10')]);router[_0x8358('0x11')]('/',auth['isAuthenticated'](),controller[_0x8358('0x12')]);router[_0x8358('0x13')]('/:id',auth[_0x8358('0xa')](),controller['update']);router[_0x8358('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x88c5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x88c5,0x1e3));var _0x588c=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x88c5[_0x7ad123];return _0x37d073;};'use strict';var multer=require(_0x588c('0x0'));var util=require(_0x588c('0x1'));var path=require(_0x588c('0x2'));var timeout=require(_0x588c('0x3'));var express=require(_0x588c('0x4'));var router=express[_0x588c('0x5')]();var fs_extra=require(_0x588c('0x6'));var auth=require(_0x588c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x588c('0x8'));var controller=require(_0x588c('0x9'));router[_0x588c('0xa')]('/',auth['isAuthenticated'](),controller[_0x588c('0xb')]);router[_0x588c('0xa')](_0x588c('0xc'),auth[_0x588c('0xd')](),controller[_0x588c('0xe')]);router['get'](_0x588c('0xf'),auth[_0x588c('0xd')](),controller[_0x588c('0x10')]);router[_0x588c('0x11')]('/',auth[_0x588c('0xd')](),controller[_0x588c('0x12')]);router[_0x588c('0x13')](_0x588c('0xc'),auth[_0x588c('0xd')](),controller[_0x588c('0x14')]);router[_0x588c('0x15')]('/:id',auth[_0x588c('0xd')](),controller[_0x588c('0x16')]);module[_0x588c('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index cd27679..e0df11e 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 _0xcba5=['STRING','BOOLEAN','exports','TEXT'];(function(_0x5e0aed,_0x46575e){var _0x23cb81=function(_0x1afb92){while(--_0x1afb92){_0x5e0aed['push'](_0x5e0aed['shift']());}};_0x23cb81(++_0x46575e);}(_0xcba5,0xee));var _0x5cba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xcba5[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require('sequelize');module[_0x5cba('0x0')]={'field':{'type':Sequelize[_0x5cba('0x1')]},'alias':{'type':Sequelize[_0x5cba('0x2')]},'function':{'type':Sequelize[_0x5cba('0x2')]},'format':{'type':Sequelize[_0x5cba('0x2')]},'groupBy':{'type':Sequelize[_0x5cba('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5cba('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd677=['TEXT','STRING','BOOLEAN','exports'];(function(_0x57fda8,_0x5e80a0){var _0x11c895=function(_0xd08d0e){while(--_0xd08d0e){_0x57fda8['push'](_0x57fda8['shift']());}};_0x11c895(++_0x5e80a0);}(_0xd677,0x9b));var _0x7d67=function(_0x29beb2,_0x37dc64){_0x29beb2=_0x29beb2-0x0;var _0x1d66d7=_0xd677[_0x29beb2];return _0x1d66d7;};'use strict';var Sequelize=require('sequelize');module[_0x7d67('0x0')]={'field':{'type':Sequelize[_0x7d67('0x1')]},'alias':{'type':Sequelize[_0x7d67('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7d67('0x2')]},'groupBy':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7d67('0x2')]},'custom':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index da3e6b0..8b9a0f3 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 _0xad1b=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes'];(function(_0x5a0119,_0x5659d8){var _0x2f835a=function(_0xaf917c){while(--_0xaf917c){_0x5a0119['push'](_0x5a0119['shift']());}};_0x2f835a(++_0x5659d8);}(_0xad1b,0x164));var _0xbad1=function(_0x3520f7,_0x541650){_0x3520f7=_0x3520f7-0x0;var _0x14b6db=_0xad1b[_0x3520f7];return _0x14b6db;};'use strict';var emlformat=require(_0xbad1('0x0'));var rimraf=require(_0xbad1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbad1('0x2'));var rp=require('request-promise');var moment=require(_0xbad1('0x3'));var BPromise=require(_0xbad1('0x4'));var Mustache=require(_0xbad1('0x5'));var util=require('util');var path=require(_0xbad1('0x6'));var sox=require(_0xbad1('0x7'));var csv=require(_0xbad1('0x8'));var ejs=require(_0xbad1('0x9'));var fs=require('fs');var fs_extra=require(_0xbad1('0xa'));var _=require(_0xbad1('0xb'));var squel=require(_0xbad1('0xc'));var crypto=require(_0xbad1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbad1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbad1('0xf'));var Papa=require(_0xbad1('0x10'));var Redis=require(_0xbad1('0x11'));var authService=require(_0xbad1('0x12'));var qs=require(_0xbad1('0x13'));var as=require(_0xbad1('0x14'));var hardwareService=require(_0xbad1('0x15'));var logger=require(_0xbad1('0x16'))(_0xbad1('0x17'));var utils=require(_0xbad1('0x18'));var config=require(_0xbad1('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7be4bf,_0x43ac7a){_0x43ac7a=_0x43ac7a||0xcc;return function(_0x6dabee){if(_0x6dabee){return _0x7be4bf[_0xbad1('0x1a')](_0x43ac7a);}return _0x7be4bf[_0xbad1('0x1b')](_0x43ac7a)[_0xbad1('0x1c')]();};}function respondWithResult(_0x52d00a,_0x388335){_0x388335=_0x388335||0xc8;return function(_0x55e839){if(_0x55e839){return _0x52d00a[_0xbad1('0x1b')](_0x388335)[_0xbad1('0x1d')](_0x55e839);}};}function respondWithFilteredResult(_0x2747e0,_0x3d6aaa){return function(_0x2df816){if(_0x2df816){var _0x1d0d81=typeof _0x3d6aaa[_0xbad1('0x1e')]===_0xbad1('0x1f')&&typeof _0x3d6aaa[_0xbad1('0x20')]===_0xbad1('0x1f');var _0x24361a=_0x2df816[_0xbad1('0x21')];var _0x1d4364=_0x1d0d81?0x0:_0x3d6aaa[_0xbad1('0x1e')];var _0x495de6=_0x1d0d81?_0x2df816[_0xbad1('0x21')]:_0x3d6aaa['offset']+_0x3d6aaa[_0xbad1('0x20')];var _0xc2de25;if(_0x495de6>=_0x24361a){_0x495de6=_0x24361a;_0xc2de25=0xc8;}else{_0xc2de25=0xce;}_0x2747e0[_0xbad1('0x1b')](_0xc2de25);return _0x2747e0[_0xbad1('0x22')]('Content-Range',_0x1d4364+'-'+_0x495de6+'/'+_0x24361a)[_0xbad1('0x1d')](_0x2df816);}return null;};}function patchUpdates(_0x453e15){return function(_0x2caf92){try{jsonpatch['apply'](_0x2caf92,_0x453e15,!![]);}catch(_0x3840ab){return BPromise['reject'](_0x3840ab);}return _0x2caf92['save']();};}function saveUpdates(_0x206456,_0x4b6abd){return function(_0x1c98bd){if(_0x1c98bd){return _0x1c98bd[_0xbad1('0x23')](_0x206456)[_0xbad1('0x24')](function(_0x1c8e7b){return _0x1c8e7b;});}return null;};}function removeEntity(_0x1a0925,_0x2b3eee){return function(_0x5c4a4e){if(_0x5c4a4e){return _0x5c4a4e[_0xbad1('0x25')]()[_0xbad1('0x24')](function(){_0x1a0925['status'](0xcc)[_0xbad1('0x1c')]();});}};}function handleEntityNotFound(_0x10fd11,_0x18d313){return function(_0x42bfdf){if(!_0x42bfdf){_0x10fd11[_0xbad1('0x1a')](0x194);}return _0x42bfdf;};}function handleError(_0x105dbd,_0x3f6b04){_0x3f6b04=_0x3f6b04||0x1f4;return function(_0x133ee2){logger['error'](_0x133ee2[_0xbad1('0x26')]);if(_0x133ee2[_0xbad1('0x27')]){delete _0x133ee2[_0xbad1('0x27')];}_0x105dbd[_0xbad1('0x1b')](_0x3f6b04)[_0xbad1('0x28')](_0x133ee2);};}exports[_0xbad1('0x29')]=function(_0x498f23,_0x3e386b){var _0x4d71f1={},_0x41907a={},_0x16d034={'count':0x0,'rows':[]};var _0x208f45=_['map'](db[_0xbad1('0x2a')][_0xbad1('0x2b')],function(_0x28f65a){return{'name':_0x28f65a[_0xbad1('0x2c')],'type':_0x28f65a[_0xbad1('0x2d')][_0xbad1('0x2e')]};});_0x41907a[_0xbad1('0x2f')]=_[_0xbad1('0x30')](_0x208f45,_0xbad1('0x27'));_0x41907a[_0xbad1('0x31')]=_[_0xbad1('0x32')](_0x498f23['query']);_0x41907a[_0xbad1('0x33')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],_0x41907a[_0xbad1('0x31')]);_0x4d71f1[_0xbad1('0x35')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x36')]));_0x4d71f1[_0xbad1('0x35')]=_0x4d71f1[_0xbad1('0x35')]['length']?_0x4d71f1[_0xbad1('0x35')]:_0x41907a[_0xbad1('0x2f')];if(!_0x498f23[_0xbad1('0x31')][_0xbad1('0x37')](_0xbad1('0x38'))){_0x4d71f1[_0xbad1('0x20')]=qs[_0xbad1('0x20')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x20')]);_0x4d71f1[_0xbad1('0x1e')]=qs['offset'](_0x498f23[_0xbad1('0x31')][_0xbad1('0x1e')]);}_0x4d71f1['order']=qs[_0xbad1('0x39')](_0x498f23[_0xbad1('0x31')]['sort']);_0x4d71f1[_0xbad1('0x3a')]=qs[_0xbad1('0x33')](_[_0xbad1('0x3b')](_0x498f23['query'],_0x41907a[_0xbad1('0x33')]),_0x208f45);if(_0x498f23['query'][_0xbad1('0x3c')]){_0x4d71f1[_0xbad1('0x3a')]=_[_0xbad1('0x3d')](_0x4d71f1[_0xbad1('0x3a')],{'$or':_[_0xbad1('0x30')](_0x208f45,function(_0x3b4dde){if(_0x3b4dde['type']!==_0xbad1('0x3e')){var _0x48f7b7={};_0x48f7b7[_0x3b4dde[_0xbad1('0x27')]]={'$like':'%'+_0x498f23[_0xbad1('0x31')][_0xbad1('0x3c')]+'%'};return _0x48f7b7;}})});}_0x4d71f1=_['merge']({},_0x4d71f1,_0x498f23[_0xbad1('0x3f')]);var _0x386f5f={'where':_0x4d71f1[_0xbad1('0x3a')]};return db[_0xbad1('0x2a')][_0xbad1('0x21')](_0x386f5f)['then'](function(_0x5af18e){_0x16d034['count']=_0x5af18e;if(_0x498f23[_0xbad1('0x31')][_0xbad1('0x40')]){_0x4d71f1[_0xbad1('0x41')]=[{'all':!![]}];}return db[_0xbad1('0x2a')][_0xbad1('0x42')](_0x4d71f1);})[_0xbad1('0x24')](function(_0x267321){_0x16d034[_0xbad1('0x43')]=_0x267321;return _0x16d034;})[_0xbad1('0x24')](respondWithFilteredResult(_0x3e386b,_0x4d71f1))[_0xbad1('0x44')](handleError(_0x3e386b,null));};exports[_0xbad1('0x45')]=function(_0x2659a1,_0x582c0f){var _0x595350={'raw':![],'where':{'id':_0x2659a1[_0xbad1('0x46')]['id']}},_0x2add3d={};_0x2add3d[_0xbad1('0x2f')]=_['keys'](db['AnalyticFieldReport'][_0xbad1('0x2b')]);_0x2add3d['query']=_[_0xbad1('0x32')](_0x2659a1[_0xbad1('0x31')]);_0x2add3d[_0xbad1('0x33')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],_0x2add3d['query']);_0x595350[_0xbad1('0x35')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x2659a1[_0xbad1('0x31')]['fields']));_0x595350[_0xbad1('0x35')]=_0x595350[_0xbad1('0x35')][_0xbad1('0x47')]?_0x595350[_0xbad1('0x35')]:_0x2add3d[_0xbad1('0x2f')];if(_0x2659a1[_0xbad1('0x31')][_0xbad1('0x40')]){_0x595350['include']=[{'all':!![]}];}_0x595350=_['merge']({},_0x595350,_0x2659a1[_0xbad1('0x3f')]);return db[_0xbad1('0x2a')][_0xbad1('0x48')](_0x595350)[_0xbad1('0x24')](handleEntityNotFound(_0x582c0f,null))[_0xbad1('0x24')](respondWithResult(_0x582c0f,null))[_0xbad1('0x44')](handleError(_0x582c0f,null));};exports[_0xbad1('0x49')]=function(_0x26d9bc,_0x5b3a17){return db[_0xbad1('0x2a')][_0xbad1('0x49')](_0x26d9bc[_0xbad1('0x4a')],{})['then'](respondWithResult(_0x5b3a17,0xc9))['catch'](handleError(_0x5b3a17,null));};exports[_0xbad1('0x4b')]=function(_0x10c0a8,_0x3e61dc){return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x10c0a8[_0xbad1('0x4a')],{'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0x3e61dc,0xc9))[_0xbad1('0x44')](handleError(_0x3e61dc,null));};exports[_0xbad1('0x23')]=function(_0x53a00b,_0x5a46b4){if(_0x53a00b['body']['id']){delete _0x53a00b['body']['id'];}return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x53a00b['params']['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x5a46b4,null))[_0xbad1('0x24')](saveUpdates(_0x53a00b[_0xbad1('0x4a')],null))[_0xbad1('0x24')](respondWithResult(_0x5a46b4,null))[_0xbad1('0x44')](handleError(_0x5a46b4,null));};exports[_0xbad1('0x25')]=function(_0x40a309,_0x184435){return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x40a309[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x184435,null))[_0xbad1('0x24')](removeEntity(_0x184435,null))[_0xbad1('0x44')](handleError(_0x184435,null));};exports['bulkDestroy']=function(_0x2210ea,_0xe32c1a){return db[_0xbad1('0x2a')]['destroy']({'where':{'id':_0x2210ea[_0xbad1('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0xe32c1a,0xcc))[_0xbad1('0x44')](handleError(_0xe32c1a,null));};exports[_0xbad1('0x4c')]=function(_0x538eef,_0x20bd4f,_0x5d33dc){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x538eef[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x20bd4f,null))[_0xbad1('0x24')](function(_0x216f1b){if(_0x216f1b){return db[_0xbad1('0x4d')][_0xbad1('0x4e')](function(_0xaeda4e){return db[_0xbad1('0x2a')][_0xbad1('0x25')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']},'transaction':_0xaeda4e})[_0xbad1('0x24')](function(_0x5f6be3){var _0x1449c2=_[_0xbad1('0x30')](_0x538eef[_0xbad1('0x4a')],function(_0x31f9ef){delete _0x31f9ef['id'];_0x31f9ef[_0xbad1('0x4f')]=_0x538eef[_0xbad1('0x46')]['id'];return _0x31f9ef;});return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x1449c2,{'transaction':_0xaeda4e});});})[_0xbad1('0x24')](function(){return db['AnalyticFieldReport'][_0xbad1('0x42')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']}});});}})[_0xbad1('0x24')](respondWithResult(_0x20bd4f,null))[_0xbad1('0x44')](handleError(_0x20bd4f,null));}; \ No newline at end of file +var _0xd4bd=['catch','create','body','bulkCreate','update','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','AnalyticFieldReport','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','show','params','keys','rawAttributes','options','find'];(function(_0x172f2e,_0x270e87){var _0x34390a=function(_0x6dc1b9){while(--_0x6dc1b9){_0x172f2e['push'](_0x172f2e['shift']());}};_0x34390a(++_0x270e87);}(_0xd4bd,0x1a3));var _0xdd4b=function(_0x2ddd5a,_0x132cea){_0x2ddd5a=_0x2ddd5a-0x0;var _0x35a682=_0xd4bd[_0x2ddd5a];return _0x35a682;};'use strict';var emlformat=require(_0xdd4b('0x0'));var rimraf=require(_0xdd4b('0x1'));var zipdir=require(_0xdd4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd4b('0x3'));var moment=require(_0xdd4b('0x4'));var BPromise=require(_0xdd4b('0x5'));var Mustache=require(_0xdd4b('0x6'));var util=require(_0xdd4b('0x7'));var path=require('path');var sox=require(_0xdd4b('0x8'));var csv=require(_0xdd4b('0x9'));var ejs=require(_0xdd4b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd4b('0xb'));var squel=require(_0xdd4b('0xc'));var crypto=require(_0xdd4b('0xd'));var jsforce=require(_0xdd4b('0xe'));var deskjs=require(_0xdd4b('0xf'));var toCsv=require(_0xdd4b('0x9'));var querystring=require(_0xdd4b('0x10'));var Papa=require(_0xdd4b('0x11'));var Redis=require(_0xdd4b('0x12'));var authService=require(_0xdd4b('0x13'));var qs=require(_0xdd4b('0x14'));var as=require(_0xdd4b('0x15'));var hardwareService=require(_0xdd4b('0x16'));var logger=require(_0xdd4b('0x17'))('api');var utils=require(_0xdd4b('0x18'));var config=require(_0xdd4b('0x19'));var licenseUtil=require(_0xdd4b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219bc1,_0x2a5b91){_0x2a5b91=_0x2a5b91||0xcc;return function(_0x137b08){if(_0x137b08){return _0x219bc1['sendStatus'](_0x2a5b91);}return _0x219bc1[_0xdd4b('0x1b')](_0x2a5b91)[_0xdd4b('0x1c')]();};}function respondWithResult(_0xd4cbb2,_0x5aa922){_0x5aa922=_0x5aa922||0xc8;return function(_0x41463c){if(_0x41463c){return _0xd4cbb2[_0xdd4b('0x1b')](_0x5aa922)[_0xdd4b('0x1d')](_0x41463c);}};}function respondWithFilteredResult(_0x278b85,_0x971ce7){return function(_0x503cc0){if(_0x503cc0){var _0x35b067=typeof _0x971ce7[_0xdd4b('0x1e')]===_0xdd4b('0x1f')&&typeof _0x971ce7[_0xdd4b('0x20')]==='undefined';var _0x1dd579=_0x503cc0[_0xdd4b('0x21')];var _0x13c075=_0x35b067?0x0:_0x971ce7[_0xdd4b('0x1e')];var _0xdd9229=_0x35b067?_0x503cc0[_0xdd4b('0x21')]:_0x971ce7[_0xdd4b('0x1e')]+_0x971ce7[_0xdd4b('0x20')];var _0x1d7045;if(_0xdd9229>=_0x1dd579){_0xdd9229=_0x1dd579;_0x1d7045=0xc8;}else{_0x1d7045=0xce;}_0x278b85[_0xdd4b('0x1b')](_0x1d7045);return _0x278b85[_0xdd4b('0x22')](_0xdd4b('0x23'),_0x13c075+'-'+_0xdd9229+'/'+_0x1dd579)['json'](_0x503cc0);}return null;};}function patchUpdates(_0x5d7eec){return function(_0x8a21b0){try{jsonpatch[_0xdd4b('0x24')](_0x8a21b0,_0x5d7eec,!![]);}catch(_0x252b5a){return BPromise[_0xdd4b('0x25')](_0x252b5a);}return _0x8a21b0[_0xdd4b('0x26')]();};}function saveUpdates(_0x35f334,_0x39d542){return function(_0x3526ea){if(_0x3526ea){return _0x3526ea['update'](_0x35f334)[_0xdd4b('0x27')](function(_0x1c76c5){return _0x1c76c5;});}return null;};}function removeEntity(_0x50afdf,_0x316aed){return function(_0x1cd417){if(_0x1cd417){return _0x1cd417[_0xdd4b('0x28')]()[_0xdd4b('0x27')](function(){_0x50afdf['status'](0xcc)[_0xdd4b('0x1c')]();});}};}function handleEntityNotFound(_0x24a5df,_0x4314a7){return function(_0x57e3e3){if(!_0x57e3e3){_0x24a5df[_0xdd4b('0x29')](0x194);}return _0x57e3e3;};}function handleError(_0x3daba9,_0x35fdfc){_0x35fdfc=_0x35fdfc||0x1f4;return function(_0xd7c3cc){logger[_0xdd4b('0x2a')](_0xd7c3cc[_0xdd4b('0x2b')]);if(_0xd7c3cc[_0xdd4b('0x2c')]){delete _0xd7c3cc[_0xdd4b('0x2c')];}_0x3daba9[_0xdd4b('0x1b')](_0x35fdfc)[_0xdd4b('0x2d')](_0xd7c3cc);};}exports['index']=function(_0x38bab5,_0x4017a2){var _0x41bee3={},_0x3fc4f1={},_0x42f306={'count':0x0,'rows':[]};var _0x154567=_[_0xdd4b('0x2e')](db[_0xdd4b('0x2f')]['rawAttributes'],function(_0x463485){return{'name':_0x463485['fieldName'],'type':_0x463485['type'][_0xdd4b('0x30')]};});_0x3fc4f1['model']=_[_0xdd4b('0x2e')](_0x154567,_0xdd4b('0x2c'));_0x3fc4f1['query']=_['keys'](_0x38bab5[_0xdd4b('0x31')]);_0x3fc4f1['filters']=_[_0xdd4b('0x32')](_0x3fc4f1[_0xdd4b('0x33')],_0x3fc4f1['query']);_0x41bee3[_0xdd4b('0x34')]=_['intersection'](_0x3fc4f1['model'],qs[_0xdd4b('0x35')](_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x35')]));_0x41bee3[_0xdd4b('0x34')]=_0x41bee3[_0xdd4b('0x34')][_0xdd4b('0x36')]?_0x41bee3[_0xdd4b('0x34')]:_0x3fc4f1[_0xdd4b('0x33')];if(!_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x37')]('nolimit')){_0x41bee3['limit']=qs[_0xdd4b('0x20')](_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x20')]);_0x41bee3[_0xdd4b('0x1e')]=qs['offset'](_0x38bab5['query'][_0xdd4b('0x1e')]);}_0x41bee3[_0xdd4b('0x38')]=qs['sort'](_0x38bab5['query']['sort']);_0x41bee3[_0xdd4b('0x39')]=qs[_0xdd4b('0x3a')](_[_0xdd4b('0x3b')](_0x38bab5[_0xdd4b('0x31')],_0x3fc4f1['filters']),_0x154567);if(_0x38bab5['query']['filter']){_0x41bee3['where']=_['merge'](_0x41bee3['where'],{'$or':_[_0xdd4b('0x2e')](_0x154567,function(_0x237e4c){if(_0x237e4c[_0xdd4b('0x3c')]!==_0xdd4b('0x3d')){var _0x4821dd={};_0x4821dd[_0x237e4c[_0xdd4b('0x2c')]]={'$like':'%'+_0x38bab5['query'][_0xdd4b('0x3e')]+'%'};return _0x4821dd;}})});}_0x41bee3=_[_0xdd4b('0x3f')]({},_0x41bee3,_0x38bab5['options']);var _0x157eca={'where':_0x41bee3[_0xdd4b('0x39')]};return db[_0xdd4b('0x2f')][_0xdd4b('0x21')](_0x157eca)[_0xdd4b('0x27')](function(_0x4d5fdb){_0x42f306[_0xdd4b('0x21')]=_0x4d5fdb;if(_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x40')]){_0x41bee3[_0xdd4b('0x41')]=[{'all':!![]}];}return db[_0xdd4b('0x2f')][_0xdd4b('0x42')](_0x41bee3);})[_0xdd4b('0x27')](function(_0x292d95){_0x42f306['rows']=_0x292d95;return _0x42f306;})[_0xdd4b('0x27')](respondWithFilteredResult(_0x4017a2,_0x41bee3))['catch'](handleError(_0x4017a2,null));};exports[_0xdd4b('0x43')]=function(_0x4cac98,_0x2e7efc){var _0x2874f7={'raw':![],'where':{'id':_0x4cac98[_0xdd4b('0x44')]['id']}},_0x1de4a3={};_0x1de4a3[_0xdd4b('0x33')]=_[_0xdd4b('0x45')](db[_0xdd4b('0x2f')][_0xdd4b('0x46')]);_0x1de4a3[_0xdd4b('0x31')]=_[_0xdd4b('0x45')](_0x4cac98['query']);_0x1de4a3[_0xdd4b('0x3a')]=_[_0xdd4b('0x32')](_0x1de4a3['model'],_0x1de4a3[_0xdd4b('0x31')]);_0x2874f7[_0xdd4b('0x34')]=_[_0xdd4b('0x32')](_0x1de4a3['model'],qs[_0xdd4b('0x35')](_0x4cac98[_0xdd4b('0x31')][_0xdd4b('0x35')]));_0x2874f7[_0xdd4b('0x34')]=_0x2874f7[_0xdd4b('0x34')]['length']?_0x2874f7[_0xdd4b('0x34')]:_0x1de4a3[_0xdd4b('0x33')];if(_0x4cac98[_0xdd4b('0x31')][_0xdd4b('0x40')]){_0x2874f7['include']=[{'all':!![]}];}_0x2874f7=_[_0xdd4b('0x3f')]({},_0x2874f7,_0x4cac98[_0xdd4b('0x47')]);return db[_0xdd4b('0x2f')][_0xdd4b('0x48')](_0x2874f7)['then'](handleEntityNotFound(_0x2e7efc,null))[_0xdd4b('0x27')](respondWithResult(_0x2e7efc,null))[_0xdd4b('0x49')](handleError(_0x2e7efc,null));};exports['create']=function(_0x9bd654,_0x370383){return db[_0xdd4b('0x2f')][_0xdd4b('0x4a')](_0x9bd654[_0xdd4b('0x4b')],{})[_0xdd4b('0x27')](respondWithResult(_0x370383,0xc9))[_0xdd4b('0x49')](handleError(_0x370383,null));};exports['bulkCreate']=function(_0x1aa94b,_0x200b26){return db[_0xdd4b('0x2f')][_0xdd4b('0x4c')](_0x1aa94b[_0xdd4b('0x4b')],{'raw':![],'individualHooks':!![]})[_0xdd4b('0x27')](respondWithResult(_0x200b26,0xc9))[_0xdd4b('0x49')](handleError(_0x200b26,null));};exports[_0xdd4b('0x4d')]=function(_0x120241,_0x3c5420){if(_0x120241[_0xdd4b('0x4b')]['id']){delete _0x120241[_0xdd4b('0x4b')]['id'];}return db[_0xdd4b('0x2f')][_0xdd4b('0x48')]({'where':{'id':_0x120241[_0xdd4b('0x44')]['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x3c5420,null))[_0xdd4b('0x27')](saveUpdates(_0x120241[_0xdd4b('0x4b')],null))['then'](respondWithResult(_0x3c5420,null))[_0xdd4b('0x49')](handleError(_0x3c5420,null));};exports[_0xdd4b('0x28')]=function(_0x5cfc8a,_0x2f7768){return db[_0xdd4b('0x2f')][_0xdd4b('0x48')]({'where':{'id':_0x5cfc8a[_0xdd4b('0x44')]['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x2f7768,null))[_0xdd4b('0x27')](removeEntity(_0x2f7768,null))[_0xdd4b('0x49')](handleError(_0x2f7768,null));};exports['bulkDestroy']=function(_0x454c3e,_0x1cf2fc){return db[_0xdd4b('0x2f')]['destroy']({'where':{'id':_0x454c3e[_0xdd4b('0x31')][_0xdd4b('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xdd4b('0x27')](respondWithResult(_0x1cf2fc,0xcc))['catch'](handleError(_0x1cf2fc,null));};exports[_0xdd4b('0x4f')]=function(_0x41b9a6,_0x38a7db,_0x6764eb){return db[_0xdd4b('0x50')][_0xdd4b('0x51')]({'where':{'id':_0x41b9a6['params']['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x38a7db,null))[_0xdd4b('0x27')](function(_0x10ad1b){if(_0x10ad1b){return db['sequelize']['transaction'](function(_0xf6ae24){return db[_0xdd4b('0x2f')][_0xdd4b('0x28')]({'where':{'CustomReportId':_0x41b9a6['params']['id']},'transaction':_0xf6ae24})[_0xdd4b('0x27')](function(_0x297878){var _0x1cc00c=_[_0xdd4b('0x2e')](_0x41b9a6['body'],function(_0x9e65ce){delete _0x9e65ce['id'];_0x9e65ce['CustomReportId']=_0x41b9a6['params']['id'];return _0x9e65ce;});return db['AnalyticFieldReport'][_0xdd4b('0x4c')](_0x1cc00c,{'transaction':_0xf6ae24});});})[_0xdd4b('0x27')](function(){return db[_0xdd4b('0x2f')]['findAll']({'where':{'CustomReportId':_0x41b9a6[_0xdd4b('0x44')]['id']}});});}})['then'](respondWithResult(_0x38a7db,null))['catch'](handleError(_0x38a7db,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 20260cf..0ac8485 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 _0xf663=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xf663,0xff));var _0x3f66=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xf663[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x3f66('0x0'));var util=require(_0x3f66('0x1'));var logger=require(_0x3f66('0x2'))('api');var moment=require(_0x3f66('0x3'));var BPromise=require(_0x3f66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f66('0x5'));var rimraf=require(_0x3f66('0x6'));var config=require(_0x3f66('0x7'));var attributes=require(_0x3f66('0x8'));module[_0x3f66('0x9')]=function(_0x28e10f,_0x48e49a){return _0x28e10f[_0x3f66('0xa')](_0x3f66('0xb'),attributes,{'tableName':_0x3f66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d30=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x6d30,0xa2));var _0x06d3=function(_0x354fc7,_0x10bd45){_0x354fc7=_0x354fc7-0x0;var _0x462135=_0x6d30[_0x354fc7];return _0x462135;};'use strict';var _=require(_0x06d3('0x0'));var util=require(_0x06d3('0x1'));var logger=require('../../config/logger')(_0x06d3('0x2'));var moment=require('moment');var BPromise=require(_0x06d3('0x3'));var rp=require(_0x06d3('0x4'));var fs=require('fs');var path=require(_0x06d3('0x5'));var rimraf=require(_0x06d3('0x6'));var config=require(_0x06d3('0x7'));var attributes=require(_0x06d3('0x8'));module[_0x06d3('0x9')]=function(_0x3b512a,_0x299388){return _0x3b512a[_0x06d3('0xa')](_0x06d3('0xb'),attributes,{'tableName':_0x06d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 98741c8..17b3909 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 _0x360a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f9f46,_0x49f6d2){var _0x2c9e54=function(_0x2f41a5){while(--_0x2f41a5){_0x3f9f46['push'](_0x3f9f46['shift']());}};_0x2c9e54(++_0x49f6d2);}(_0x360a,0x169));var _0xa360=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x360a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa360('0x0'));var util=require(_0xa360('0x1'));var moment=require(_0xa360('0x2'));var BPromise=require(_0xa360('0x3'));var rs=require(_0xa360('0x4'));var fs=require('fs');var Redis=require(_0xa360('0x5'));var db=require(_0xa360('0x6'))['db'];var utils=require(_0xa360('0x7'));var logger=require(_0xa360('0x8'))(_0xa360('0x9'));var config=require(_0xa360('0xa'));var jayson=require(_0xa360('0xb'));var client=jayson[_0xa360('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11855c,_0x408cf2,_0xe64fbf){return new BPromise(function(_0x5926b7,_0x5583e){return client['request'](_0x11855c,_0xe64fbf)[_0xa360('0xd')](function(_0xa4b13e){logger[_0xa360('0xe')](_0xa360('0xf'),_0x408cf2,_0xa360('0x10'));logger[_0xa360('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x408cf2,_0xa360('0x10'),JSON[_0xa360('0x12')](_0xa4b13e));if(_0xa4b13e[_0xa360('0x13')]){if(_0xa4b13e[_0xa360('0x13')][_0xa360('0x14')]===0x1f4){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e['error']['message']);return _0x5583e(_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);}logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);return _0x5926b7(_0xa4b13e['error']['message']);}else{logger['info'](_0xa360('0xf'),_0x408cf2,'request\x20sent');_0x5926b7(_0xa4b13e[_0xa360('0x16')]['message']);}})['catch'](function(_0x3254c5){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0x3254c5);_0x5583e(_0x3254c5);});});} \ No newline at end of file +var _0x3a7b=['rpc','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x561134,_0x287a49){var _0x5587f3=function(_0x4c8214){while(--_0x4c8214){_0x561134['push'](_0x561134['shift']());}};_0x5587f3(++_0x287a49);}(_0x3a7b,0xcb));var _0xb3a7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3a7b[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xb3a7('0x0'));var moment=require(_0xb3a7('0x1'));var BPromise=require(_0xb3a7('0x2'));var rs=require(_0xb3a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3a7('0x4'))['db'];var utils=require(_0xb3a7('0x5'));var logger=require(_0xb3a7('0x6'))(_0xb3a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3a7('0x8')][_0xb3a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41546a,_0x21eb63,_0x57e4cf){return new BPromise(function(_0x10e3e4,_0x5ec03d){return client[_0xb3a7('0xa')](_0x41546a,_0x57e4cf)['then'](function(_0x4ac4f3){logger[_0xb3a7('0xb')](_0xb3a7('0xc'),_0x21eb63,'request\x20sent');logger[_0xb3a7('0xd')](_0xb3a7('0xe'),_0x21eb63,_0xb3a7('0xf'),JSON[_0xb3a7('0x10')](_0x4ac4f3));if(_0x4ac4f3['error']){if(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x12')]===0x1f4){logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);return _0x5ec03d(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);}logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x4ac4f3[_0xb3a7('0x11')]['message']);return _0x10e3e4(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);}else{logger[_0xb3a7('0xb')](_0xb3a7('0xc'),_0x21eb63,_0xb3a7('0xf'));_0x10e3e4(_0x4ac4f3[_0xb3a7('0x14')][_0xb3a7('0x13')]);}})['catch'](function(_0x5264b8){logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x5264b8);_0x5ec03d(_0x5264b8);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b4a9ec7..781763b 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(_0x12e09c,_0x41e3f2){var _0x559e70=function(_0x3fb2da){while(--_0x3fb2da){_0x12e09c['push'](_0x12e09c['shift']());}};_0x559e70(++_0x41e3f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x3aa041,_0x56b55c){var _0x3b6837=function(_0x24b142){while(--_0x24b142){_0x3aa041['push'](_0x3aa041['shift']());}};_0x3b6837(++_0x56b55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 75f3655..ba85f07 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 _0xbdb7=['name','TEXT','sequelize','exports','STRING'];(function(_0x5c8736,_0x2a2a03){var _0x142bdb=function(_0x406951){while(--_0x406951){_0x5c8736['push'](_0x5c8736['shift']());}};_0x142bdb(++_0x2a2a03);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0xbdb7[_0x1d29f6];return _0x491093;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'allowNull':![],'unique':_0x7bdb('0x3')},'table':{'type':Sequelize[_0x7bdb('0x2')]},'metric':{'type':Sequelize[_0x7bdb('0x4')]},'description':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file +var _0x50c1=['TEXT','sequelize','name','STRING'];(function(_0x396245,_0x22c863){var _0x353760=function(_0x80d10c){while(--_0x80d10c){_0x396245['push'](_0x396245['shift']());}};_0x353760(++_0x22c863);}(_0x50c1,0x1a5));var _0x150c=function(_0x171595,_0x5cf384){_0x171595=_0x171595-0x0;var _0x209861=_0x50c1[_0x171595];return _0x209861;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x150c('0x1')},'table':{'type':Sequelize[_0x150c('0x2')]},'metric':{'type':Sequelize[_0x150c('0x3')]},'description':{'type':Sequelize[_0x150c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ff4f405..653cf9f 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 _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x504d47,_0x5e604b){var _0x55cba4=function(_0xb7e707){while(--_0xb7e707){_0x504d47['push'](_0x504d47['shift']());}};_0x55cba4(++_0x5e604b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xf2ca[_0x143a91];return _0x1906f5;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));}; \ No newline at end of file +var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3d2aaf,_0x208755){var _0x7bc601=function(_0xa0e936){while(--_0xa0e936){_0x3d2aaf['push'](_0x3d2aaf['shift']());}};_0x7bc601(++_0x208755);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 1f98fc4..5fd9115 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 _0xb2ad=['path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','api','moment','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x15afeb,_0x3eb360){_0x15afeb=_0x15afeb-0x0;var _0x3ce58d=_0xb2ad[_0x15afeb];return _0x3ce58d;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('AnalyticMetric',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0650=['bluebird','path','rimraf','../../config/environment','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x0650,0xed));var _0x0065=function(_0x33a140,_0x477198){_0x33a140=_0x33a140-0x0;var _0x47157e=_0x0650[_0x33a140];return _0x47157e;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var logger=require(_0x0065('0x1'))(_0x0065('0x2'));var moment=require('moment');var BPromise=require(_0x0065('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0065('0x4'));var rimraf=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x0065('0x7')]=function(_0x507ed3,_0x5cf16e){return _0x507ed3['define'](_0x0065('0x8'),attributes,{'tableName':_0x0065('0x9'),'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 e2d7584..d803c31 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 _0x7f9c=['error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','code'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x7f9c,0x9e));var _0xc7f9=function(_0x33e5e2,_0x10d7a8){_0x33e5e2=_0x33e5e2-0x0;var _0x21e5af=_0x7f9c[_0x33e5e2];return _0x21e5af;};'use strict';var _=require('lodash');var util=require(_0xc7f9('0x0'));var moment=require(_0xc7f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7f9('0x2'));var fs=require('fs');var Redis=require(_0xc7f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7f9('0x4'));var logger=require(_0xc7f9('0x5'))(_0xc7f9('0x6'));var config=require(_0xc7f9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc7f9('0x8')][_0xc7f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7d17,_0x3e7d2a,_0x494665){return new BPromise(function(_0x32e53a,_0x5b3e36){return client[_0xc7f9('0xa')](_0x3e7d17,_0x494665)[_0xc7f9('0xb')](function(_0x4004fb){logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,_0xc7f9('0xe'));logger[_0xc7f9('0xf')](_0xc7f9('0x10'),_0x3e7d2a,_0xc7f9('0xe'),JSON['stringify'](_0x4004fb));if(_0x4004fb['error']){if(_0x4004fb['error'][_0xc7f9('0x11')]===0x1f4){logger['error'](_0xc7f9('0xd'),_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')]['message']);return _0x5b3e36(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}logger[_0xc7f9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);return _0x32e53a(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}else{logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,'request\x20sent');_0x32e53a(_0x4004fb[_0xc7f9('0x14')][_0xc7f9('0x13')]);}})[_0xc7f9('0x15')](function(_0x53efd2){logger[_0xc7f9('0x12')](_0xc7f9('0xd'),_0x3e7d2a,_0x53efd2);_0x5b3e36(_0x53efd2);});});} \ No newline at end of file +var _0xcb5c=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x3c42c6,_0x4e0d2e){var _0x1ddfc6=function(_0x38291f){while(--_0x38291f){_0x3c42c6['push'](_0x3c42c6['shift']());}};_0x1ddfc6(++_0x4e0d2e);}(_0xcb5c,0x179));var _0xccb5=function(_0x57f601,_0x35d28a){_0x57f601=_0x57f601-0x0;var _0x208e78=_0xcb5c[_0x57f601];return _0x208e78;};'use strict';var _=require('lodash');var util=require(_0xccb5('0x0'));var moment=require(_0xccb5('0x1'));var BPromise=require('bluebird');var rs=require(_0xccb5('0x2'));var fs=require('fs');var Redis=require(_0xccb5('0x3'));var db=require(_0xccb5('0x4'))['db'];var utils=require(_0xccb5('0x5'));var logger=require('../../config/logger')(_0xccb5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xccb5('0x7')][_0xccb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69e238,_0x47979,_0x3a190e){return new BPromise(function(_0x5b70c2,_0x1430a7){return client[_0xccb5('0x9')](_0x69e238,_0x3a190e)[_0xccb5('0xa')](function(_0x364266){logger[_0xccb5('0xb')](_0xccb5('0xc'),_0x47979,_0xccb5('0xd'));logger[_0xccb5('0xe')](_0xccb5('0xf'),_0x47979,_0xccb5('0xd'),JSON[_0xccb5('0x10')](_0x364266));if(_0x364266[_0xccb5('0x11')]){if(_0x364266['error'][_0xccb5('0x12')]===0x1f4){logger[_0xccb5('0x11')](_0xccb5('0xc'),_0x47979,_0x364266['error']['message']);return _0x1430a7(_0x364266['error'][_0xccb5('0x13')]);}logger[_0xccb5('0x11')](_0xccb5('0xc'),_0x47979,_0x364266[_0xccb5('0x11')][_0xccb5('0x13')]);return _0x5b70c2(_0x364266['error'][_0xccb5('0x13')]);}else{logger[_0xccb5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x47979,'request\x20sent');_0x5b70c2(_0x364266['result'][_0xccb5('0x13')]);}})[_0xccb5('0x14')](function(_0x3bb50e){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x47979,_0x3bb50e);_0x1430a7(_0x3bb50e);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a62a576..16644f2 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 _0x624c=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x542641,_0x7615ab){var _0x26a17a=function(_0x340089){while(--_0x340089){_0x542641['push'](_0x542641['shift']());}};_0x26a17a(++_0x7615ab);}(_0x624c,0x1ee));var _0xc624=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x624c[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./analyticMetric.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['post']('/',auth[_0xc624('0x8')](),controller[_0xc624('0xc')]);router[_0xc624('0xd')]('/:id',auth[_0xc624('0x8')](),controller[_0xc624('0xe')]);router['delete'](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xf')]);module[_0xc624('0x10')]=router; \ No newline at end of file +var _0x1134=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b5cc4,_0x3de7f8){var _0x3c7a90=function(_0x5477e7){while(--_0x5477e7){_0x2b5cc4['push'](_0x2b5cc4['shift']());}};_0x3c7a90(++_0x3de7f8);}(_0x1134,0x19c));var _0x4113=function(_0x536c97,_0x5d0742){_0x536c97=_0x536c97-0x0;var _0x12081c=_0x1134[_0x536c97];return _0x12081c;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./analyticMetric.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0xe')](_0x4113('0x9'),auth['isAuthenticated'](),controller[_0x4113('0xf')]);router[_0x4113('0x10')](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0x11')]);module[_0x4113('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 852cf4b..39ee626 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 _0x7717=['exports','TEXT','sequelize'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x7717,0x11f));var _0x7771=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7717[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7771('0x0'));module[_0x7771('0x1')]={'tree':{'type':Sequelize[_0x7771('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7846=['exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7846,0xf4));var _0x6784=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x7846[_0x5f12fd];return _0x58bd80;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'tree':{'type':Sequelize[_0x6784('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index a9a7a48..f3004e8 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 _0x6584=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6584,0xc9));var _0x4658=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6584[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x4658('0x0'));var rimraf=require(_0x4658('0x1'));var zipdir=require(_0x4658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4658('0x3'));var moment=require(_0x4658('0x4'));var BPromise=require(_0x4658('0x5'));var Mustache=require(_0x4658('0x6'));var util=require(_0x4658('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4658('0x8'));var ejs=require(_0x4658('0x9'));var fs=require('fs');var fs_extra=require(_0x4658('0xa'));var _=require(_0x4658('0xb'));var squel=require(_0x4658('0xc'));var crypto=require(_0x4658('0xd'));var jsforce=require(_0x4658('0xe'));var deskjs=require(_0x4658('0xf'));var toCsv=require(_0x4658('0x8'));var querystring=require(_0x4658('0x10'));var Papa=require(_0x4658('0x11'));var Redis=require(_0x4658('0x12'));var authService=require(_0x4658('0x13'));var qs=require(_0x4658('0x14'));var as=require(_0x4658('0x15'));var hardwareService=require(_0x4658('0x16'));var logger=require(_0x4658('0x17'))('api');var utils=require(_0x4658('0x18'));var config=require(_0x4658('0x19'));var licenseUtil=require(_0x4658('0x1a'));var db=require(_0x4658('0x1b'))['db'];function respondWithStatusCode(_0x172dd0,_0x1d634b){_0x1d634b=_0x1d634b||0xcc;return function(_0x3e720e){if(_0x3e720e){return _0x172dd0['sendStatus'](_0x1d634b);}return _0x172dd0[_0x4658('0x1c')](_0x1d634b)[_0x4658('0x1d')]();};}function respondWithResult(_0x277607,_0x2e1e01){_0x2e1e01=_0x2e1e01||0xc8;return function(_0x5d3daf){if(_0x5d3daf){return _0x277607[_0x4658('0x1c')](_0x2e1e01)[_0x4658('0x1e')](_0x5d3daf);}};}function respondWithFilteredResult(_0x289e30,_0x48c219){return function(_0x996259){if(_0x996259){var _0x4dc572=typeof _0x48c219[_0x4658('0x1f')]==='undefined'&&typeof _0x48c219['limit']===_0x4658('0x20');var _0x1b13ec=_0x996259[_0x4658('0x21')];var _0x388331=_0x4dc572?0x0:_0x48c219[_0x4658('0x1f')];var _0x264729=_0x4dc572?_0x996259[_0x4658('0x21')]:_0x48c219[_0x4658('0x1f')]+_0x48c219[_0x4658('0x22')];var _0x256584;if(_0x264729>=_0x1b13ec){_0x264729=_0x1b13ec;_0x256584=0xc8;}else{_0x256584=0xce;}_0x289e30[_0x4658('0x1c')](_0x256584);return _0x289e30[_0x4658('0x23')](_0x4658('0x24'),_0x388331+'-'+_0x264729+'/'+_0x1b13ec)['json'](_0x996259);}return null;};}function patchUpdates(_0x54c1ce){return function(_0x39878a){try{jsonpatch[_0x4658('0x25')](_0x39878a,_0x54c1ce,!![]);}catch(_0x5bb225){return BPromise[_0x4658('0x26')](_0x5bb225);}return _0x39878a[_0x4658('0x27')]();};}function saveUpdates(_0x5943f1,_0x2eeb44){return function(_0xc1852b){if(_0xc1852b){return _0xc1852b[_0x4658('0x28')](_0x5943f1)[_0x4658('0x29')](function(_0x281773){return _0x281773;});}return null;};}function removeEntity(_0x109270,_0x420c0a){return function(_0x513a7a){if(_0x513a7a){return _0x513a7a[_0x4658('0x2a')]()[_0x4658('0x29')](function(){_0x109270[_0x4658('0x1c')](0xcc)[_0x4658('0x1d')]();});}};}function handleEntityNotFound(_0x1f971c,_0x5b6a2d){return function(_0x52935f){if(!_0x52935f){_0x1f971c['sendStatus'](0x194);}return _0x52935f;};}function handleError(_0x59a953,_0x4dff03){_0x4dff03=_0x4dff03||0x1f4;return function(_0x562967){logger[_0x4658('0x2b')](_0x562967['stack']);if(_0x562967[_0x4658('0x2c')]){delete _0x562967[_0x4658('0x2c')];}_0x59a953[_0x4658('0x1c')](_0x4dff03)[_0x4658('0x2d')](_0x562967);};}exports[_0x4658('0x2e')]=function(_0x457090,_0x260d4e){var _0x6e361a={},_0x1d5274={},_0x37f5cd={'count':0x0,'rows':[]};var _0x5e1ed8=_[_0x4658('0x2f')](db[_0x4658('0x30')][_0x4658('0x31')],function(_0x57949e){return{'name':_0x57949e[_0x4658('0x32')],'type':_0x57949e[_0x4658('0x33')]['key']};});_0x1d5274[_0x4658('0x34')]=_[_0x4658('0x2f')](_0x5e1ed8,_0x4658('0x2c'));_0x1d5274[_0x4658('0x35')]=_[_0x4658('0x36')](_0x457090['query']);_0x1d5274[_0x4658('0x37')]=_[_0x4658('0x38')](_0x1d5274[_0x4658('0x34')],_0x1d5274[_0x4658('0x35')]);_0x6e361a[_0x4658('0x39')]=_['intersection'](_0x1d5274['model'],qs[_0x4658('0x3a')](_0x457090[_0x4658('0x35')][_0x4658('0x3a')]));_0x6e361a[_0x4658('0x39')]=_0x6e361a[_0x4658('0x39')][_0x4658('0x3b')]?_0x6e361a[_0x4658('0x39')]:_0x1d5274[_0x4658('0x34')];if(!_0x457090[_0x4658('0x35')][_0x4658('0x3c')](_0x4658('0x3d'))){_0x6e361a[_0x4658('0x22')]=qs[_0x4658('0x22')](_0x457090[_0x4658('0x35')]['limit']);_0x6e361a[_0x4658('0x1f')]=qs[_0x4658('0x1f')](_0x457090[_0x4658('0x35')]['offset']);}_0x6e361a[_0x4658('0x3e')]=qs['sort'](_0x457090[_0x4658('0x35')][_0x4658('0x3f')]);_0x6e361a[_0x4658('0x40')]=qs[_0x4658('0x37')](_[_0x4658('0x41')](_0x457090[_0x4658('0x35')],_0x1d5274[_0x4658('0x37')]),_0x5e1ed8);if(_0x457090[_0x4658('0x35')]['filter']){_0x6e361a[_0x4658('0x40')]=_['merge'](_0x6e361a[_0x4658('0x40')],{'$or':_[_0x4658('0x2f')](_0x5e1ed8,function(_0x2bec7c){if(_0x2bec7c[_0x4658('0x33')]!==_0x4658('0x42')){var _0x235965={};_0x235965[_0x2bec7c[_0x4658('0x2c')]]={'$like':'%'+_0x457090['query'][_0x4658('0x43')]+'%'};return _0x235965;}})});}_0x6e361a=_[_0x4658('0x44')]({},_0x6e361a,_0x457090[_0x4658('0x45')]);var _0x232e37={'where':_0x6e361a['where']};return db[_0x4658('0x30')][_0x4658('0x21')](_0x232e37)[_0x4658('0x29')](function(_0xb27599){_0x37f5cd[_0x4658('0x21')]=_0xb27599;if(_0x457090[_0x4658('0x35')][_0x4658('0x46')]){_0x6e361a[_0x4658('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x6e361a);})[_0x4658('0x29')](function(_0x1a52fd){_0x37f5cd[_0x4658('0x48')]=_0x1a52fd;return _0x37f5cd;})[_0x4658('0x29')](respondWithFilteredResult(_0x260d4e,_0x6e361a))[_0x4658('0x49')](handleError(_0x260d4e,null));};exports[_0x4658('0x4a')]=function(_0x7ee94e,_0x348536){var _0x57e3bc={'raw':!![],'where':{'id':_0x7ee94e[_0x4658('0x4b')]['id']}},_0xa9c056={};_0xa9c056['model']=_[_0x4658('0x36')](db[_0x4658('0x30')][_0x4658('0x31')]);_0xa9c056[_0x4658('0x35')]=_[_0x4658('0x36')](_0x7ee94e[_0x4658('0x35')]);_0xa9c056['filters']=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],_0xa9c056[_0x4658('0x35')]);_0x57e3bc[_0x4658('0x39')]=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],qs[_0x4658('0x3a')](_0x7ee94e[_0x4658('0x35')][_0x4658('0x3a')]));_0x57e3bc[_0x4658('0x39')]=_0x57e3bc[_0x4658('0x39')][_0x4658('0x3b')]?_0x57e3bc[_0x4658('0x39')]:_0xa9c056[_0x4658('0x34')];if(_0x7ee94e[_0x4658('0x35')][_0x4658('0x46')]){_0x57e3bc[_0x4658('0x47')]=[{'all':!![]}];}_0x57e3bc=_[_0x4658('0x44')]({},_0x57e3bc,_0x7ee94e[_0x4658('0x45')]);return db[_0x4658('0x30')][_0x4658('0x4c')](_0x57e3bc)['then'](handleEntityNotFound(_0x348536,null))['then'](respondWithResult(_0x348536,null))[_0x4658('0x49')](handleError(_0x348536,null));};exports['create']=function(_0x434e97,_0x3b4713){return db[_0x4658('0x30')][_0x4658('0x4d')](_0x434e97[_0x4658('0x4e')],{})[_0x4658('0x29')](respondWithResult(_0x3b4713,0xc9))[_0x4658('0x49')](handleError(_0x3b4713,null));};exports[_0x4658('0x28')]=function(_0x3854ab,_0x9ea70c){if(_0x3854ab['body']['id']){delete _0x3854ab[_0x4658('0x4e')]['id'];}return db[_0x4658('0x30')][_0x4658('0x4c')]({'where':{'id':_0x3854ab[_0x4658('0x4b')]['id']}})[_0x4658('0x29')](handleEntityNotFound(_0x9ea70c,null))[_0x4658('0x29')](saveUpdates(_0x3854ab[_0x4658('0x4e')],null))[_0x4658('0x29')](respondWithResult(_0x9ea70c,null))[_0x4658('0x49')](handleError(_0x9ea70c,null));};exports[_0x4658('0x2a')]=function(_0x546a38,_0x506a98){return db[_0x4658('0x30')]['find']({'where':{'id':_0x546a38[_0x4658('0x4b')]['id']}})['then'](handleEntityNotFound(_0x506a98,null))[_0x4658('0x29')](removeEntity(_0x506a98,null))[_0x4658('0x49')](handleError(_0x506a98,null));}; \ No newline at end of file +var _0xfd1a=['fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x4cec95,_0x276dfa){var _0x5a6c41=function(_0x3b818a){while(--_0x3b818a){_0x4cec95['push'](_0x4cec95['shift']());}};_0x5a6c41(++_0x276dfa);}(_0xfd1a,0x129));var _0xafd1=function(_0x279dfe,_0x39674f){_0x279dfe=_0x279dfe-0x0;var _0x569667=_0xfd1a[_0x279dfe];return _0x569667;};'use strict';var emlformat=require(_0xafd1('0x0'));var rimraf=require(_0xafd1('0x1'));var zipdir=require(_0xafd1('0x2'));var jsonpatch=require(_0xafd1('0x3'));var rp=require(_0xafd1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xafd1('0x5'));var util=require(_0xafd1('0x6'));var path=require('path');var sox=require(_0xafd1('0x7'));var csv=require(_0xafd1('0x8'));var ejs=require(_0xafd1('0x9'));var fs=require('fs');var fs_extra=require(_0xafd1('0xa'));var _=require(_0xafd1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xafd1('0xc'));var deskjs=require(_0xafd1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xafd1('0xe'));var Papa=require(_0xafd1('0xf'));var Redis=require(_0xafd1('0x10'));var authService=require(_0xafd1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xafd1('0x12'));var hardwareService=require(_0xafd1('0x13'));var logger=require(_0xafd1('0x14'))(_0xafd1('0x15'));var utils=require(_0xafd1('0x16'));var config=require(_0xafd1('0x17'));var licenseUtil=require(_0xafd1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425ef8,_0xa6cf17){_0xa6cf17=_0xa6cf17||0xcc;return function(_0x14fe51){if(_0x14fe51){return _0x425ef8[_0xafd1('0x19')](_0xa6cf17);}return _0x425ef8[_0xafd1('0x1a')](_0xa6cf17)[_0xafd1('0x1b')]();};}function respondWithResult(_0x4a80e0,_0x212c23){_0x212c23=_0x212c23||0xc8;return function(_0x4d8134){if(_0x4d8134){return _0x4a80e0[_0xafd1('0x1a')](_0x212c23)['json'](_0x4d8134);}};}function respondWithFilteredResult(_0x205217,_0x3b8aea){return function(_0xcf5b13){if(_0xcf5b13){var _0x80df7f=typeof _0x3b8aea[_0xafd1('0x1c')]===_0xafd1('0x1d')&&typeof _0x3b8aea[_0xafd1('0x1e')]===_0xafd1('0x1d');var _0x3ca89f=_0xcf5b13[_0xafd1('0x1f')];var _0x42ab24=_0x80df7f?0x0:_0x3b8aea[_0xafd1('0x1c')];var _0x49e217=_0x80df7f?_0xcf5b13[_0xafd1('0x1f')]:_0x3b8aea[_0xafd1('0x1c')]+_0x3b8aea[_0xafd1('0x1e')];var _0x5c055f;if(_0x49e217>=_0x3ca89f){_0x49e217=_0x3ca89f;_0x5c055f=0xc8;}else{_0x5c055f=0xce;}_0x205217[_0xafd1('0x1a')](_0x5c055f);return _0x205217[_0xafd1('0x20')]('Content-Range',_0x42ab24+'-'+_0x49e217+'/'+_0x3ca89f)[_0xafd1('0x21')](_0xcf5b13);}return null;};}function patchUpdates(_0x23dbc4){return function(_0x2821d5){try{jsonpatch[_0xafd1('0x22')](_0x2821d5,_0x23dbc4,!![]);}catch(_0x4875d0){return BPromise[_0xafd1('0x23')](_0x4875d0);}return _0x2821d5['save']();};}function saveUpdates(_0x285a3c,_0x1640cf){return function(_0x3236c3){if(_0x3236c3){return _0x3236c3[_0xafd1('0x24')](_0x285a3c)['then'](function(_0x62b566){return _0x62b566;});}return null;};}function removeEntity(_0x3e0d2f,_0x49c5b7){return function(_0x161e4e){if(_0x161e4e){return _0x161e4e[_0xafd1('0x25')]()[_0xafd1('0x26')](function(){_0x3e0d2f[_0xafd1('0x1a')](0xcc)[_0xafd1('0x1b')]();});}};}function handleEntityNotFound(_0x5c0b21,_0x3c7ad6){return function(_0x3f1044){if(!_0x3f1044){_0x5c0b21['sendStatus'](0x194);}return _0x3f1044;};}function handleError(_0x7eaab4,_0x1d9550){_0x1d9550=_0x1d9550||0x1f4;return function(_0x32ed82){logger[_0xafd1('0x27')](_0x32ed82['stack']);if(_0x32ed82[_0xafd1('0x28')]){delete _0x32ed82['name'];}_0x7eaab4[_0xafd1('0x1a')](_0x1d9550)[_0xafd1('0x29')](_0x32ed82);};}exports[_0xafd1('0x2a')]=function(_0x42b689,_0x38ab36){var _0x3cbcc5={},_0x4a3338={},_0x53554e={'count':0x0,'rows':[]};var _0x3be47a=_[_0xafd1('0x2b')](db[_0xafd1('0x2c')][_0xafd1('0x2d')],function(_0x3f6bb6){return{'name':_0x3f6bb6[_0xafd1('0x2e')],'type':_0x3f6bb6[_0xafd1('0x2f')][_0xafd1('0x30')]};});_0x4a3338['model']=_['map'](_0x3be47a,_0xafd1('0x28'));_0x4a3338[_0xafd1('0x31')]=_[_0xafd1('0x32')](_0x42b689[_0xafd1('0x31')]);_0x4a3338['filters']=_[_0xafd1('0x33')](_0x4a3338[_0xafd1('0x34')],_0x4a3338['query']);_0x3cbcc5[_0xafd1('0x35')]=_[_0xafd1('0x33')](_0x4a3338['model'],qs[_0xafd1('0x36')](_0x42b689[_0xafd1('0x31')][_0xafd1('0x36')]));_0x3cbcc5[_0xafd1('0x35')]=_0x3cbcc5[_0xafd1('0x35')][_0xafd1('0x37')]?_0x3cbcc5[_0xafd1('0x35')]:_0x4a3338[_0xafd1('0x34')];if(!_0x42b689[_0xafd1('0x31')]['hasOwnProperty']('nolimit')){_0x3cbcc5['limit']=qs[_0xafd1('0x1e')](_0x42b689[_0xafd1('0x31')]['limit']);_0x3cbcc5[_0xafd1('0x1c')]=qs[_0xafd1('0x1c')](_0x42b689[_0xafd1('0x31')][_0xafd1('0x1c')]);}_0x3cbcc5[_0xafd1('0x38')]=qs[_0xafd1('0x39')](_0x42b689['query']['sort']);_0x3cbcc5[_0xafd1('0x3a')]=qs[_0xafd1('0x3b')](_[_0xafd1('0x3c')](_0x42b689[_0xafd1('0x31')],_0x4a3338['filters']),_0x3be47a);if(_0x42b689[_0xafd1('0x31')][_0xafd1('0x3d')]){_0x3cbcc5['where']=_[_0xafd1('0x3e')](_0x3cbcc5[_0xafd1('0x3a')],{'$or':_[_0xafd1('0x2b')](_0x3be47a,function(_0x1d89c3){if(_0x1d89c3[_0xafd1('0x2f')]!==_0xafd1('0x3f')){var _0x4fa6de={};_0x4fa6de[_0x1d89c3[_0xafd1('0x28')]]={'$like':'%'+_0x42b689['query']['filter']+'%'};return _0x4fa6de;}})});}_0x3cbcc5=_[_0xafd1('0x3e')]({},_0x3cbcc5,_0x42b689[_0xafd1('0x40')]);var _0x320b5b={'where':_0x3cbcc5['where']};return db[_0xafd1('0x2c')][_0xafd1('0x1f')](_0x320b5b)[_0xafd1('0x26')](function(_0x2c88f2){_0x53554e[_0xafd1('0x1f')]=_0x2c88f2;if(_0x42b689[_0xafd1('0x31')]['includeAll']){_0x3cbcc5[_0xafd1('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xafd1('0x42')](_0x3cbcc5);})[_0xafd1('0x26')](function(_0x27b1fa){_0x53554e[_0xafd1('0x43')]=_0x27b1fa;return _0x53554e;})[_0xafd1('0x26')](respondWithFilteredResult(_0x38ab36,_0x3cbcc5))[_0xafd1('0x44')](handleError(_0x38ab36,null));};exports[_0xafd1('0x45')]=function(_0x3c03b4,_0x9efb46){var _0x485b83={'raw':!![],'where':{'id':_0x3c03b4[_0xafd1('0x46')]['id']}},_0x47b5d3={};_0x47b5d3[_0xafd1('0x34')]=_[_0xafd1('0x32')](db[_0xafd1('0x2c')][_0xafd1('0x2d')]);_0x47b5d3[_0xafd1('0x31')]=_[_0xafd1('0x32')](_0x3c03b4[_0xafd1('0x31')]);_0x47b5d3['filters']=_[_0xafd1('0x33')](_0x47b5d3['model'],_0x47b5d3[_0xafd1('0x31')]);_0x485b83['attributes']=_[_0xafd1('0x33')](_0x47b5d3[_0xafd1('0x34')],qs['fields'](_0x3c03b4[_0xafd1('0x31')][_0xafd1('0x36')]));_0x485b83[_0xafd1('0x35')]=_0x485b83['attributes'][_0xafd1('0x37')]?_0x485b83[_0xafd1('0x35')]:_0x47b5d3['model'];if(_0x3c03b4[_0xafd1('0x31')][_0xafd1('0x47')]){_0x485b83['include']=[{'all':!![]}];}_0x485b83=_['merge']({},_0x485b83,_0x3c03b4[_0xafd1('0x40')]);return db['AnalyticTreeReport'][_0xafd1('0x48')](_0x485b83)[_0xafd1('0x26')](handleEntityNotFound(_0x9efb46,null))[_0xafd1('0x26')](respondWithResult(_0x9efb46,null))[_0xafd1('0x44')](handleError(_0x9efb46,null));};exports[_0xafd1('0x49')]=function(_0x4ccb45,_0x828524){return db[_0xafd1('0x2c')][_0xafd1('0x49')](_0x4ccb45['body'],{})[_0xafd1('0x26')](respondWithResult(_0x828524,0xc9))[_0xafd1('0x44')](handleError(_0x828524,null));};exports['update']=function(_0x2a05a0,_0x28d2e9){if(_0x2a05a0[_0xafd1('0x4a')]['id']){delete _0x2a05a0['body']['id'];}return db[_0xafd1('0x2c')][_0xafd1('0x48')]({'where':{'id':_0x2a05a0[_0xafd1('0x46')]['id']}})[_0xafd1('0x26')](handleEntityNotFound(_0x28d2e9,null))['then'](saveUpdates(_0x2a05a0['body'],null))['then'](respondWithResult(_0x28d2e9,null))[_0xafd1('0x44')](handleError(_0x28d2e9,null));};exports[_0xafd1('0x25')]=function(_0x14fd36,_0x27f3bf){return db[_0xafd1('0x2c')]['find']({'where':{'id':_0x14fd36[_0xafd1('0x46')]['id']}})['then'](handleEntityNotFound(_0x27f3bf,null))[_0xafd1('0x26')](removeEntity(_0x27f3bf,null))[_0xafd1('0x44')](handleError(_0x27f3bf,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 1ccb4d7..a35ecda 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 _0xd17d=['rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird'];(function(_0x29f3e0,_0x486ad1){var _0x32fa40=function(_0x452c1c){while(--_0x452c1c){_0x29f3e0['push'](_0x29f3e0['shift']());}};_0x32fa40(++_0x486ad1);}(_0xd17d,0x1c8));var _0xdd17=function(_0x6dd9,_0x58c745){_0x6dd9=_0x6dd9-0x0;var _0x29423f=_0xd17d[_0x6dd9];return _0x29423f;};'use strict';var _=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var logger=require(_0xdd17('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd17('0x4'));var config=require('../../config/environment');var attributes=require(_0xdd17('0x5'));module[_0xdd17('0x6')]=function(_0x530891,_0x44f6c2){return _0x530891[_0xdd17('0x7')](_0xdd17('0x8'),attributes,{'tableName':_0xdd17('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6299=['../../config/environment','./analyticTreeReport.attributes','exports','define','util','moment','bluebird','request-promise'];(function(_0x1069f5,_0x51cc78){var _0x5c211d=function(_0x1d527f){while(--_0x1d527f){_0x1069f5['push'](_0x1069f5['shift']());}};_0x5c211d(++_0x51cc78);}(_0x6299,0x64));var _0x9629=function(_0x30946f,_0x13e356){_0x30946f=_0x30946f-0x0;var _0x2d3b5f=_0x6299[_0x30946f];return _0x2d3b5f;};'use strict';var _=require('lodash');var util=require(_0x9629('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9629('0x1'));var BPromise=require(_0x9629('0x2'));var rp=require(_0x9629('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9629('0x4'));var attributes=require(_0x9629('0x5'));module[_0x9629('0x6')]=function(_0x4daf4c,_0x46da4a){return _0x4daf4c[_0x9629('0x7')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index b1c2fd3..4a063cd 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3df935,_0x2f6877){var _0x152412=function(_0x213b98){while(--_0x213b98){_0x3df935['push'](_0x3df935['shift']());}};_0x152412(++_0x2f6877);}(_0xadb5,0xad));var _0x5adb=function(_0x110f97,_0x643432){_0x110f97=_0x110f97-0x0;var _0x19cf55=_0xadb5[_0x110f97];return _0x19cf55;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _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(_0x58bf7c,_0x1ab137){var _0x292f7f=function(_0x20a4d5){while(--_0x20a4d5){_0x58bf7c['push'](_0x58bf7c['shift']());}};_0x292f7f(++_0x1ab137);}(_0x2ef3,0xba));var _0x32ef=function(_0x55d63a,_0x4cc997){_0x55d63a=_0x55d63a-0x0;var _0xd2f439=_0x2ef3[_0x55d63a];return _0xd2f439;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0731082..ded256e 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 _0xb4c7=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x146312,_0x5bd7af){var _0x1b0b27=function(_0x46d1ec){while(--_0x46d1ec){_0x146312['push'](_0x146312['shift']());}};_0x1b0b27(++_0x5bd7af);}(_0xb4c7,0x1eb));var _0x7b4c=function(_0x41ebe4,_0x2c44b5){_0x41ebe4=_0x41ebe4-0x0;var _0x164bef=_0xb4c7[_0x41ebe4];return _0x164bef;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express[_0x7b4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x7b4c('0x9')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router['get'](_0x7b4c('0xc'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router[_0x7b4c('0xe')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7b4c('0x10')]);router[_0x7b4c('0x11')]('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x12')]);module[_0x7b4c('0x13')]=router; \ No newline at end of file +var _0xa0bb=['../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','create','put','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3d0fa4,_0x18be0f){var _0x34178c=function(_0x55209c){while(--_0x55209c){_0x3d0fa4['push'](_0x3d0fa4['shift']());}};_0x34178c(++_0x18be0f);}(_0xa0bb,0x190));var _0xba0b=function(_0x3d5103,_0x524622){_0x3d5103=_0x3d5103-0x0;var _0x5b98d5=_0xa0bb[_0x3d5103];return _0x5b98d5;};'use strict';var multer=require(_0xba0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba0b('0x1'));var express=require(_0xba0b('0x2'));var router=express['Router']();var fs_extra=require(_0xba0b('0x3'));var auth=require(_0xba0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba0b('0x5'));var controller=require(_0xba0b('0x6'));router[_0xba0b('0x7')]('/',auth['isAuthenticated'](),controller[_0xba0b('0x8')]);router[_0xba0b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xba0b('0x9')](),controller[_0xba0b('0xa')]);router[_0xba0b('0xb')]('/:id',auth[_0xba0b('0x9')](),controller[_0xba0b('0xc')]);router[_0xba0b('0xd')]('/:id',auth[_0xba0b('0x9')](),controller[_0xba0b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 65eb767..4d8e813 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 _0x8f7d=['exports','STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x52eca4,_0x2afd62){_0x52eca4=_0x52eca4-0x0;var _0x1366b9=_0x8f7d[_0x52eca4];return _0x1366b9;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd8f7('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ce3=['sequelize','exports','STRING'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x8ce3,0xc3));var _0x38ce=function(_0x56a020,_0x3065c6){_0x56a020=_0x56a020-0x0;var _0xc4220c=_0x8ce3[_0x56a020];return _0xc4220c;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x38ce('0x2')]},'type':{'type':Sequelize[_0x38ce('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6d69efe..44a7485 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 _0xf2a3=['apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','filter','includeAll','findAll','catch','show','include','options','find','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','ChatOfflineMessageId','join','server/files/attachments/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range'];(function(_0x27a929,_0x19068d){var _0x43ac7c=function(_0x86455b){while(--_0x86455b){_0x27a929['push'](_0x27a929['shift']());}};_0x43ac7c(++_0x19068d);}(_0xf2a3,0x1a8));var _0x3f2a=function(_0xb3275c,_0x2623c3){_0xb3275c=_0xb3275c-0x0;var _0x58e50b=_0xf2a3[_0xb3275c];return _0x58e50b;};'use strict';var emlformat=require(_0x3f2a('0x0'));var rimraf=require(_0x3f2a('0x1'));var zipdir=require(_0x3f2a('0x2'));var jsonpatch=require(_0x3f2a('0x3'));var rp=require(_0x3f2a('0x4'));var moment=require('moment');var BPromise=require(_0x3f2a('0x5'));var Mustache=require(_0x3f2a('0x6'));var util=require(_0x3f2a('0x7'));var path=require(_0x3f2a('0x8'));var sox=require(_0x3f2a('0x9'));var csv=require(_0x3f2a('0xa'));var ejs=require(_0x3f2a('0xb'));var fs=require('fs');var fs_extra=require(_0x3f2a('0xc'));var _=require(_0x3f2a('0xd'));var squel=require(_0x3f2a('0xe'));var crypto=require('crypto');var jsforce=require(_0x3f2a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3f2a('0xa'));var querystring=require(_0x3f2a('0x10'));var Papa=require(_0x3f2a('0x11'));var Redis=require(_0x3f2a('0x12'));var authService=require(_0x3f2a('0x13'));var qs=require(_0x3f2a('0x14'));var as=require(_0x3f2a('0x15'));var hardwareService=require(_0x3f2a('0x16'));var logger=require(_0x3f2a('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3f2a('0x18'));var licenseUtil=require(_0x3f2a('0x19'));var db=require(_0x3f2a('0x1a'))['db'];function respondWithStatusCode(_0x4db237,_0x5a6033){_0x5a6033=_0x5a6033||0xcc;return function(_0x423b63){if(_0x423b63){return _0x4db237[_0x3f2a('0x1b')](_0x5a6033);}return _0x4db237[_0x3f2a('0x1c')](_0x5a6033)[_0x3f2a('0x1d')]();};}function respondWithResult(_0x502a8f,_0x4d3bd1){_0x4d3bd1=_0x4d3bd1||0xc8;return function(_0x4c491c){if(_0x4c491c){return _0x502a8f[_0x3f2a('0x1c')](_0x4d3bd1)[_0x3f2a('0x1e')](_0x4c491c);}};}function respondWithFilteredResult(_0x18cf00,_0x28b4a5){return function(_0x5839fc){if(_0x5839fc){var _0x23ea38=typeof _0x28b4a5[_0x3f2a('0x1f')]===_0x3f2a('0x20')&&typeof _0x28b4a5['limit']===_0x3f2a('0x20');var _0x65aed9=_0x5839fc['count'];var _0xc445ba=_0x23ea38?0x0:_0x28b4a5[_0x3f2a('0x1f')];var _0x5af7d4=_0x23ea38?_0x5839fc[_0x3f2a('0x21')]:_0x28b4a5[_0x3f2a('0x1f')]+_0x28b4a5['limit'];var _0x2b72c7;if(_0x5af7d4>=_0x65aed9){_0x5af7d4=_0x65aed9;_0x2b72c7=0xc8;}else{_0x2b72c7=0xce;}_0x18cf00[_0x3f2a('0x1c')](_0x2b72c7);return _0x18cf00[_0x3f2a('0x22')](_0x3f2a('0x23'),_0xc445ba+'-'+_0x5af7d4+'/'+_0x65aed9)[_0x3f2a('0x1e')](_0x5839fc);}return null;};}function patchUpdates(_0x246d08){return function(_0x23b0a4){try{jsonpatch[_0x3f2a('0x24')](_0x23b0a4,_0x246d08,!![]);}catch(_0x255d82){return BPromise['reject'](_0x255d82);}return _0x23b0a4[_0x3f2a('0x25')]();};}function saveUpdates(_0x4ec9b8,_0x416cff){return function(_0x3c4168){if(_0x3c4168){return _0x3c4168[_0x3f2a('0x26')](_0x4ec9b8)[_0x3f2a('0x27')](function(_0x15341b){return _0x15341b;});}return null;};}function removeEntity(_0x5c685b,_0x8ecc6e){return function(_0x25642d){if(_0x25642d){return _0x25642d[_0x3f2a('0x28')]()[_0x3f2a('0x27')](function(){_0x5c685b[_0x3f2a('0x1c')](0xcc)[_0x3f2a('0x1d')]();});}};}function handleEntityNotFound(_0x23145d,_0x1c3773){return function(_0x47b038){if(!_0x47b038){_0x23145d['sendStatus'](0x194);}return _0x47b038;};}function handleError(_0x442b1e,_0xde22d2){_0xde22d2=_0xde22d2||0x1f4;return function(_0x46e857){logger[_0x3f2a('0x29')](_0x46e857[_0x3f2a('0x2a')]);if(_0x46e857[_0x3f2a('0x2b')]){delete _0x46e857[_0x3f2a('0x2b')];}_0x442b1e[_0x3f2a('0x1c')](_0xde22d2)[_0x3f2a('0x2c')](_0x46e857);};}exports[_0x3f2a('0x2d')]=function(_0x281bbe,_0x5f3ee0){var _0xbc311b={},_0x5bfb2f={},_0x4a80e3={'count':0x0,'rows':[]};var _0x32d3af=_[_0x3f2a('0x2e')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')],function(_0x698e21){return{'name':_0x698e21[_0x3f2a('0x31')],'type':_0x698e21['type'][_0x3f2a('0x32')]};});_0x5bfb2f[_0x3f2a('0x33')]=_[_0x3f2a('0x2e')](_0x32d3af,_0x3f2a('0x2b'));_0x5bfb2f[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x281bbe['query']);_0x5bfb2f[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x5bfb2f['model'],_0x5bfb2f['query']);_0xbc311b['attributes']=_[_0x3f2a('0x37')](_0x5bfb2f[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0xbc311b[_0x3f2a('0x39')]=_0xbc311b[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0xbc311b[_0x3f2a('0x39')]:_0x5bfb2f[_0x3f2a('0x33')];if(!_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3b')](_0x3f2a('0x3c'))){_0xbc311b[_0x3f2a('0x3d')]=qs[_0x3f2a('0x3d')](_0x281bbe['query']['limit']);_0xbc311b[_0x3f2a('0x1f')]=qs[_0x3f2a('0x1f')](_0x281bbe[_0x3f2a('0x34')]['offset']);}_0xbc311b[_0x3f2a('0x3e')]=qs[_0x3f2a('0x3f')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3f')]);_0xbc311b[_0x3f2a('0x40')]=qs[_0x3f2a('0x36')](_['pick'](_0x281bbe[_0x3f2a('0x34')],_0x5bfb2f[_0x3f2a('0x36')]),_0x32d3af);if(_0x281bbe[_0x3f2a('0x34')]['filter']){_0xbc311b[_0x3f2a('0x40')]=_[_0x3f2a('0x41')](_0xbc311b['where'],{'$or':_[_0x3f2a('0x2e')](_0x32d3af,function(_0x13ab33){if(_0x13ab33[_0x3f2a('0x42')]!=='VIRTUAL'){var _0x458640={};_0x458640[_0x13ab33[_0x3f2a('0x2b')]]={'$like':'%'+_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x43')]+'%'};return _0x458640;}})});}_0xbc311b=_[_0x3f2a('0x41')]({},_0xbc311b,_0x281bbe['options']);var _0xb994c5={'where':_0xbc311b[_0x3f2a('0x40')]};return db[_0x3f2a('0x2f')]['count'](_0xb994c5)['then'](function(_0x50e9c0){_0x4a80e3[_0x3f2a('0x21')]=_0x50e9c0;if(_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x44')]){_0xbc311b['include']=[{'all':!![]}];}return db[_0x3f2a('0x2f')][_0x3f2a('0x45')](_0xbc311b);})[_0x3f2a('0x27')](function(_0x455c79){_0x4a80e3['rows']=_0x455c79;return _0x4a80e3;})[_0x3f2a('0x27')](respondWithFilteredResult(_0x5f3ee0,_0xbc311b))[_0x3f2a('0x46')](handleError(_0x5f3ee0,null));};exports[_0x3f2a('0x47')]=function(_0x502231,_0x143ff7){var _0x26fde0={'raw':!![],'where':{'id':_0x502231['params']['id']}},_0x489a4b={};_0x489a4b[_0x3f2a('0x33')]=_[_0x3f2a('0x35')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')]);_0x489a4b[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x502231[_0x3f2a('0x34')]);_0x489a4b[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],_0x489a4b[_0x3f2a('0x34')]);_0x26fde0[_0x3f2a('0x39')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x502231['query'][_0x3f2a('0x38')]));_0x26fde0['attributes']=_0x26fde0[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x26fde0[_0x3f2a('0x39')]:_0x489a4b[_0x3f2a('0x33')];if(_0x502231['query'][_0x3f2a('0x44')]){_0x26fde0[_0x3f2a('0x48')]=[{'all':!![]}];}_0x26fde0=_[_0x3f2a('0x41')]({},_0x26fde0,_0x502231[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x26fde0)[_0x3f2a('0x27')](handleEntityNotFound(_0x143ff7,null))[_0x3f2a('0x27')](respondWithResult(_0x143ff7,null))[_0x3f2a('0x46')](handleError(_0x143ff7,null));};exports[_0x3f2a('0x4b')]=function(_0x139310,_0x330403){var _0x207369={'where':{'id':_0x139310[_0x3f2a('0x4c')]['id']}},_0x456eec={};_0x456eec['model']=_['keys'](db['Attachment'][_0x3f2a('0x30')]);_0x207369['attributes']=_[_0x3f2a('0x37')](_0x456eec[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x139310[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0x207369[_0x3f2a('0x39')]=_0x207369[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x207369[_0x3f2a('0x39')]:_0x456eec[_0x3f2a('0x33')];if(_0x139310[_0x3f2a('0x34')]['includeAll']){_0x207369[_0x3f2a('0x48')]=[{'all':!![]}];}_0x207369=_[_0x3f2a('0x41')]({},_0x207369,_0x139310[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x207369)[_0x3f2a('0x27')](handleEntityNotFound(_0x330403,null))[_0x3f2a('0x27')](function(_0x5e3470){if(_0x5e3470){var _0x5f51d9=_0x5e3470[_0x3f2a('0x4d')]({'plain':!![]});_0x5f51d9=qs[_0x3f2a('0x4e')](_0x5f51d9,['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);_0x139310[_0x3f2a('0x51')]=_['omit'](_0x139310[_0x3f2a('0x51')],['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);return db['Attachment'][_0x3f2a('0x52')](_[_0x3f2a('0x41')](_0x5f51d9,_0x139310[_0x3f2a('0x51')]),{'include':_0x139310['query'][_0x3f2a('0x44')]?[{'all':!![]}]:undefined});}})[_0x3f2a('0x27')](respondWithResult(_0x330403,0xc9))[_0x3f2a('0x46')](handleError(_0x330403,null));};exports[_0x3f2a('0x26')]=function(_0x3a6fa6,_0x419d95){if(_0x3a6fa6[_0x3f2a('0x51')]['id']){delete _0x3a6fa6[_0x3f2a('0x51')]['id'];}return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0x3a6fa6[_0x3f2a('0x4c')]['id']}})[_0x3f2a('0x27')](handleEntityNotFound(_0x419d95,null))[_0x3f2a('0x27')](saveUpdates(_0x3a6fa6['body'],null))['then'](respondWithResult(_0x419d95,null))[_0x3f2a('0x46')](handleError(_0x419d95,null));};exports[_0x3f2a('0x28')]=function(_0xdb27a3,_0xa20df9){return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0xdb27a3[_0x3f2a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa20df9,null))[_0x3f2a('0x27')](removeEntity(_0xa20df9,null))[_0x3f2a('0x46')](handleError(_0xa20df9,null));};exports[_0x3f2a('0x52')]=function(_0x5e0933,_0x5b9da2,_0x11426c){_0x5e0933[_0x3f2a('0x51')][_0x3f2a('0x2b')]=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x54')];_0x5e0933['body']['basename']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x55')];_0x5e0933[_0x3f2a('0x51')]['type']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x56')];return db[_0x3f2a('0x2f')][_0x3f2a('0x52')](_0x5e0933['body'])[_0x3f2a('0x27')](respondWithResult(_0x5b9da2,0xc9))['catch'](handleError(_0x5b9da2,null));};exports['download']=function(_0x8009ec,_0x4fe88d,_0x482762){return db[_0x3f2a('0x2f')]['findOne']({'where':{'id':_0x8009ec['params']['id']},'raw':!![]})[_0x3f2a('0x27')](handleEntityNotFound(_0x4fe88d,null))[_0x3f2a('0x27')](function(_0x1b5ce1){if(_0x1b5ce1){var _0x250467=_0x1b5ce1[_0x3f2a('0x57')]!==null;var _0x4b1cd8=path[_0x3f2a('0x58')](config['root'],_0x3f2a('0x59'));if(_0x250467){_0x4b1cd8=path['join'](_0x4b1cd8,'offline-chat/');}var _0x29929f=path[_0x3f2a('0x58')](_0x4b1cd8,_0x1b5ce1[_0x3f2a('0x5a')]);return _0x4fe88d[_0x3f2a('0x5b')](_0x29929f);}})['catch'](handleError(_0x4fe88d,null));}; \ No newline at end of file +var _0xca45=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Attachment','rawAttributes','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','join','root','server/files/attachments/','download','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x4ee57e,_0x11bba0){var _0x1daf30=function(_0x52b45d){while(--_0x52b45d){_0x4ee57e['push'](_0x4ee57e['shift']());}};_0x1daf30(++_0x11bba0);}(_0xca45,0x92));var _0x5ca4=function(_0x5c1de9,_0x16b37a){_0x5c1de9=_0x5c1de9-0x0;var _0x452529=_0xca45[_0x5c1de9];return _0x452529;};'use strict';var emlformat=require(_0x5ca4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ca4('0x1'));var moment=require(_0x5ca4('0x2'));var BPromise=require(_0x5ca4('0x3'));var Mustache=require('mustache');var util=require(_0x5ca4('0x4'));var path=require(_0x5ca4('0x5'));var sox=require(_0x5ca4('0x6'));var csv=require(_0x5ca4('0x7'));var ejs=require(_0x5ca4('0x8'));var fs=require('fs');var fs_extra=require(_0x5ca4('0x9'));var _=require('lodash');var squel=require(_0x5ca4('0xa'));var crypto=require(_0x5ca4('0xb'));var jsforce=require(_0x5ca4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5ca4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ca4('0xd'));var authService=require(_0x5ca4('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ca4('0xf'));var logger=require(_0x5ca4('0x10'))(_0x5ca4('0x11'));var utils=require(_0x5ca4('0x12'));var config=require(_0x5ca4('0x13'));var licenseUtil=require(_0x5ca4('0x14'));var db=require(_0x5ca4('0x15'))['db'];function respondWithStatusCode(_0x320338,_0x29c5f9){_0x29c5f9=_0x29c5f9||0xcc;return function(_0x591970){if(_0x591970){return _0x320338[_0x5ca4('0x16')](_0x29c5f9);}return _0x320338['status'](_0x29c5f9)[_0x5ca4('0x17')]();};}function respondWithResult(_0x515fb1,_0x2ca85e){_0x2ca85e=_0x2ca85e||0xc8;return function(_0x55357c){if(_0x55357c){return _0x515fb1[_0x5ca4('0x18')](_0x2ca85e)[_0x5ca4('0x19')](_0x55357c);}};}function respondWithFilteredResult(_0xcdf7b1,_0x52cb5d){return function(_0x56a6c0){if(_0x56a6c0){var _0x5ad14c=typeof _0x52cb5d[_0x5ca4('0x1a')]===_0x5ca4('0x1b')&&typeof _0x52cb5d[_0x5ca4('0x1c')]===_0x5ca4('0x1b');var _0x484e3c=_0x56a6c0[_0x5ca4('0x1d')];var _0x54ee18=_0x5ad14c?0x0:_0x52cb5d[_0x5ca4('0x1a')];var _0xa2f539=_0x5ad14c?_0x56a6c0[_0x5ca4('0x1d')]:_0x52cb5d[_0x5ca4('0x1a')]+_0x52cb5d[_0x5ca4('0x1c')];var _0x4fa7ec;if(_0xa2f539>=_0x484e3c){_0xa2f539=_0x484e3c;_0x4fa7ec=0xc8;}else{_0x4fa7ec=0xce;}_0xcdf7b1[_0x5ca4('0x18')](_0x4fa7ec);return _0xcdf7b1[_0x5ca4('0x1e')](_0x5ca4('0x1f'),_0x54ee18+'-'+_0xa2f539+'/'+_0x484e3c)[_0x5ca4('0x19')](_0x56a6c0);}return null;};}function patchUpdates(_0x4d697e){return function(_0x133b50){try{jsonpatch[_0x5ca4('0x20')](_0x133b50,_0x4d697e,!![]);}catch(_0x3504e3){return BPromise[_0x5ca4('0x21')](_0x3504e3);}return _0x133b50[_0x5ca4('0x22')]();};}function saveUpdates(_0x4c01c9,_0x8c7a96){return function(_0x59a25a){if(_0x59a25a){return _0x59a25a[_0x5ca4('0x23')](_0x4c01c9)[_0x5ca4('0x24')](function(_0x377ae0){return _0x377ae0;});}return null;};}function removeEntity(_0x355fa3,_0x26e05f){return function(_0x35aa12){if(_0x35aa12){return _0x35aa12[_0x5ca4('0x25')]()['then'](function(){_0x355fa3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x338fc3,_0x1e2edf){return function(_0x37e846){if(!_0x37e846){_0x338fc3['sendStatus'](0x194);}return _0x37e846;};}function handleError(_0xe8d0d1,_0x35d405){_0x35d405=_0x35d405||0x1f4;return function(_0x4f4b76){logger[_0x5ca4('0x26')](_0x4f4b76[_0x5ca4('0x27')]);if(_0x4f4b76['name']){delete _0x4f4b76[_0x5ca4('0x28')];}_0xe8d0d1['status'](_0x35d405)['send'](_0x4f4b76);};}exports[_0x5ca4('0x29')]=function(_0x240151,_0xd0b574){var _0x39d1dc={},_0x541fe3={},_0x1eeb39={'count':0x0,'rows':[]};var _0x5feff5=_['map'](db[_0x5ca4('0x2a')][_0x5ca4('0x2b')],function(_0x595213){return{'name':_0x595213['fieldName'],'type':_0x595213['type'][_0x5ca4('0x2c')]};});_0x541fe3['model']=_[_0x5ca4('0x2d')](_0x5feff5,_0x5ca4('0x28'));_0x541fe3[_0x5ca4('0x2e')]=_[_0x5ca4('0x2f')](_0x240151[_0x5ca4('0x2e')]);_0x541fe3[_0x5ca4('0x30')]=_[_0x5ca4('0x31')](_0x541fe3['model'],_0x541fe3[_0x5ca4('0x2e')]);_0x39d1dc[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x541fe3[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0x240151[_0x5ca4('0x2e')]['fields']));_0x39d1dc[_0x5ca4('0x32')]=_0x39d1dc['attributes'][_0x5ca4('0x35')]?_0x39d1dc[_0x5ca4('0x32')]:_0x541fe3[_0x5ca4('0x33')];if(!_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x36')](_0x5ca4('0x37'))){_0x39d1dc['limit']=qs[_0x5ca4('0x1c')](_0x240151['query'][_0x5ca4('0x1c')]);_0x39d1dc[_0x5ca4('0x1a')]=qs[_0x5ca4('0x1a')](_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x1a')]);}_0x39d1dc[_0x5ca4('0x38')]=qs['sort'](_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x39')]);_0x39d1dc['where']=qs[_0x5ca4('0x30')](_[_0x5ca4('0x3a')](_0x240151['query'],_0x541fe3[_0x5ca4('0x30')]),_0x5feff5);if(_0x240151[_0x5ca4('0x2e')]['filter']){_0x39d1dc['where']=_['merge'](_0x39d1dc[_0x5ca4('0x3b')],{'$or':_[_0x5ca4('0x2d')](_0x5feff5,function(_0x5ed023){if(_0x5ed023[_0x5ca4('0x3c')]!==_0x5ca4('0x3d')){var _0x1f5440={};_0x1f5440[_0x5ed023[_0x5ca4('0x28')]]={'$like':'%'+_0x240151['query']['filter']+'%'};return _0x1f5440;}})});}_0x39d1dc=_[_0x5ca4('0x3e')]({},_0x39d1dc,_0x240151[_0x5ca4('0x3f')]);var _0x4c5bdf={'where':_0x39d1dc[_0x5ca4('0x3b')]};return db[_0x5ca4('0x2a')]['count'](_0x4c5bdf)[_0x5ca4('0x24')](function(_0x2ad100){_0x1eeb39[_0x5ca4('0x1d')]=_0x2ad100;if(_0x240151['query'][_0x5ca4('0x40')]){_0x39d1dc[_0x5ca4('0x41')]=[{'all':!![]}];}return db[_0x5ca4('0x2a')][_0x5ca4('0x42')](_0x39d1dc);})['then'](function(_0x58213b){_0x1eeb39[_0x5ca4('0x43')]=_0x58213b;return _0x1eeb39;})[_0x5ca4('0x24')](respondWithFilteredResult(_0xd0b574,_0x39d1dc))[_0x5ca4('0x44')](handleError(_0xd0b574,null));};exports[_0x5ca4('0x45')]=function(_0x4ac9c1,_0x301769){var _0x5cb3fa={'raw':!![],'where':{'id':_0x4ac9c1['params']['id']}},_0x497a5d={};_0x497a5d['model']=_['keys'](db[_0x5ca4('0x2a')][_0x5ca4('0x2b')]);_0x497a5d[_0x5ca4('0x2e')]=_[_0x5ca4('0x2f')](_0x4ac9c1[_0x5ca4('0x2e')]);_0x497a5d['filters']=_['intersection'](_0x497a5d[_0x5ca4('0x33')],_0x497a5d[_0x5ca4('0x2e')]);_0x5cb3fa[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x497a5d[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0x4ac9c1[_0x5ca4('0x2e')][_0x5ca4('0x34')]));_0x5cb3fa['attributes']=_0x5cb3fa[_0x5ca4('0x32')]['length']?_0x5cb3fa[_0x5ca4('0x32')]:_0x497a5d['model'];if(_0x4ac9c1[_0x5ca4('0x2e')]['includeAll']){_0x5cb3fa[_0x5ca4('0x41')]=[{'all':!![]}];}_0x5cb3fa=_['merge']({},_0x5cb3fa,_0x4ac9c1['options']);return db[_0x5ca4('0x2a')][_0x5ca4('0x46')](_0x5cb3fa)['then'](handleEntityNotFound(_0x301769,null))[_0x5ca4('0x24')](respondWithResult(_0x301769,null))[_0x5ca4('0x44')](handleError(_0x301769,null));};exports[_0x5ca4('0x47')]=function(_0xcc1697,_0x256946){var _0x28aea2={'where':{'id':_0xcc1697[_0x5ca4('0x48')]['id']}},_0x5733={};_0x5733[_0x5ca4('0x33')]=_['keys'](db['Attachment'][_0x5ca4('0x2b')]);_0x28aea2[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x5733[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0xcc1697[_0x5ca4('0x2e')]['fields']));_0x28aea2[_0x5ca4('0x32')]=_0x28aea2[_0x5ca4('0x32')][_0x5ca4('0x35')]?_0x28aea2[_0x5ca4('0x32')]:_0x5733['model'];if(_0xcc1697[_0x5ca4('0x2e')][_0x5ca4('0x40')]){_0x28aea2[_0x5ca4('0x41')]=[{'all':!![]}];}_0x28aea2=_['merge']({},_0x28aea2,_0xcc1697[_0x5ca4('0x3f')]);return db[_0x5ca4('0x2a')][_0x5ca4('0x46')](_0x28aea2)[_0x5ca4('0x24')](handleEntityNotFound(_0x256946,null))[_0x5ca4('0x24')](function(_0x42ba25){if(_0x42ba25){var _0x228b35=_0x42ba25[_0x5ca4('0x49')]({'plain':!![]});_0x228b35=qs[_0x5ca4('0x4a')](_0x228b35,['id',_0x5ca4('0x4b'),_0x5ca4('0x4c')]);_0xcc1697[_0x5ca4('0x4d')]=_[_0x5ca4('0x4a')](_0xcc1697[_0x5ca4('0x4d')],['id','createdAt','updatedAt']);return db[_0x5ca4('0x2a')][_0x5ca4('0x4e')](_[_0x5ca4('0x3e')](_0x228b35,_0xcc1697[_0x5ca4('0x4d')]),{'include':_0xcc1697[_0x5ca4('0x2e')][_0x5ca4('0x40')]?[{'all':!![]}]:undefined});}})[_0x5ca4('0x24')](respondWithResult(_0x256946,0xc9))[_0x5ca4('0x44')](handleError(_0x256946,null));};exports['update']=function(_0x495fc8,_0x58980d){if(_0x495fc8[_0x5ca4('0x4d')]['id']){delete _0x495fc8[_0x5ca4('0x4d')]['id'];}return db[_0x5ca4('0x2a')]['find']({'where':{'id':_0x495fc8[_0x5ca4('0x48')]['id']}})['then'](handleEntityNotFound(_0x58980d,null))['then'](saveUpdates(_0x495fc8[_0x5ca4('0x4d')],null))['then'](respondWithResult(_0x58980d,null))[_0x5ca4('0x44')](handleError(_0x58980d,null));};exports['destroy']=function(_0x4b0f4e,_0x1dbbf9){return db[_0x5ca4('0x2a')][_0x5ca4('0x46')]({'where':{'id':_0x4b0f4e[_0x5ca4('0x48')]['id']}})[_0x5ca4('0x24')](handleEntityNotFound(_0x1dbbf9,null))['then'](removeEntity(_0x1dbbf9,null))[_0x5ca4('0x44')](handleError(_0x1dbbf9,null));};exports[_0x5ca4('0x4e')]=function(_0xa054ac,_0x19d84f,_0xace4bf){_0xa054ac[_0x5ca4('0x4d')][_0x5ca4('0x28')]=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x50')];_0xa054ac[_0x5ca4('0x4d')]['basename']=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x51')];_0xa054ac[_0x5ca4('0x4d')][_0x5ca4('0x3c')]=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x52')];return db['Attachment'][_0x5ca4('0x4e')](_0xa054ac[_0x5ca4('0x4d')])[_0x5ca4('0x24')](respondWithResult(_0x19d84f,0xc9))[_0x5ca4('0x44')](handleError(_0x19d84f,null));};exports['download']=function(_0x2ffab2,_0x5f49a0,_0x3681e3){return db[_0x5ca4('0x2a')]['findOne']({'where':{'id':_0x2ffab2['params']['id']},'raw':!![]})[_0x5ca4('0x24')](handleEntityNotFound(_0x5f49a0,null))['then'](function(_0x2ca35a){if(_0x2ca35a){var _0x302ed1=_0x2ca35a['ChatOfflineMessageId']!==null;var _0x2e8f14=path[_0x5ca4('0x53')](config[_0x5ca4('0x54')],_0x5ca4('0x55'));if(_0x302ed1){_0x2e8f14=path[_0x5ca4('0x53')](_0x2e8f14,'offline-chat/');}var _0x4d460d=path['join'](_0x2e8f14,_0x2ca35a['basename']);return _0x5f49a0[_0x5ca4('0x56')](_0x4d460d);}})['catch'](handleError(_0x5f49a0,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index be22592..00cdb68 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 _0x3583=['../../config/environment','./attachment.attributes','define','Attachment','attachments','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3583,0xc0));var _0x3358=function(_0x7a56c,_0x4c8ece){_0x7a56c=_0x7a56c-0x0;var _0x14f77a=_0x3583[_0x7a56c];return _0x14f77a;};'use strict';var _=require('lodash');var util=require(_0x3358('0x0'));var logger=require(_0x3358('0x1'))('api');var moment=require(_0x3358('0x2'));var BPromise=require('bluebird');var rp=require(_0x3358('0x3'));var fs=require('fs');var path=require(_0x3358('0x4'));var rimraf=require(_0x3358('0x5'));var config=require(_0x3358('0x6'));var attributes=require(_0x3358('0x7'));module['exports']=function(_0xae929e,_0x5e6250){return _0xae929e[_0x3358('0x8')](_0x3358('0x9'),attributes,{'tableName':_0x3358('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60bb=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment'];(function(_0x29dfc1,_0x367174){var _0x4cafe6=function(_0x33db32){while(--_0x33db32){_0x29dfc1['push'](_0x29dfc1['shift']());}};_0x4cafe6(++_0x367174);}(_0x60bb,0x13f));var _0xb60b=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x60bb[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0xb60b('0x0'));var util=require(_0xb60b('0x1'));var logger=require(_0xb60b('0x2'))(_0xb60b('0x3'));var moment=require('moment');var BPromise=require(_0xb60b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb60b('0x5'));var rimraf=require(_0xb60b('0x6'));var config=require(_0xb60b('0x7'));var attributes=require(_0xb60b('0x8'));module['exports']=function(_0x222945,_0xcc826a){return _0x222945[_0xb60b('0x9')](_0xb60b('0xa'),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 c154125..0fe1eb6 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 _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4ba9d2,_0x2ecfdd){var _0x29188d=function(_0x5c3a3d){while(--_0x5c3a3d){_0x4ba9d2['push'](_0x4ba9d2['shift']());}};_0x29188d(++_0x2ecfdd);}(_0x07c3,0x1bf));var _0x307c=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x07c3[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});}; \ No newline at end of file +var _0x7b6b=['body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','Attachment'];(function(_0x157ec6,_0x39e0ff){var _0x3d4aef=function(_0x4a2f4a){while(--_0x4a2f4a){_0x157ec6['push'](_0x157ec6['shift']());}};_0x3d4aef(++_0x39e0ff);}(_0x7b6b,0xac));var _0xb7b6=function(_0x1f2f3d,_0x3e34f4){_0x1f2f3d=_0x1f2f3d-0x0;var _0x567817=_0x7b6b[_0x1f2f3d];return _0x567817;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var moment=require(_0xb7b6('0x1'));var BPromise=require(_0xb7b6('0x2'));var rs=require(_0xb7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));var config=require(_0xb7b6('0x7'));var jayson=require(_0xb7b6('0x8'));var client=jayson[_0xb7b6('0x9')][_0xb7b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e81f,_0x318dfb,_0x36cd51){return new BPromise(function(_0x31809b,_0xb5b26f){return client[_0xb7b6('0xb')](_0x19e81f,_0x36cd51)[_0xb7b6('0xc')](function(_0x313aa8){logger[_0xb7b6('0xd')](_0xb7b6('0xe'),_0x318dfb,_0xb7b6('0xf'));logger[_0xb7b6('0x10')](_0xb7b6('0x11'),_0x318dfb,_0xb7b6('0xf'),JSON['stringify'](_0x313aa8));if(_0x313aa8[_0xb7b6('0x12')]){if(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x13')]===0x1f4){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);return _0xb5b26f(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);}logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')]['message']);return _0x31809b(_0x313aa8['error'][_0xb7b6('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x318dfb,_0xb7b6('0xf'));_0x31809b(_0x313aa8['result'][_0xb7b6('0x14')]);}})[_0xb7b6('0x15')](function(_0xa99f35){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0xa99f35);_0xb5b26f(_0xa99f35);});});}exports[_0xb7b6('0x16')]=function(_0x3dc0f8){var _0x7bb633=this;return new Promise(function(_0x5667d9,_0x314049){return db[_0xb7b6('0x17')]['create'](_0x3dc0f8[_0xb7b6('0x18')],{'raw':_0x3dc0f8[_0xb7b6('0x19')]?_0x3dc0f8['options'][_0xb7b6('0x1a')]===undefined?!![]:![]:!![]})[_0xb7b6('0xc')](function(_0x5deaac){logger['info'](_0xb7b6('0x16'),_0x3dc0f8);logger['debug'](_0xb7b6('0x16'),_0x3dc0f8,JSON[_0xb7b6('0x1b')](_0x5deaac));_0x5667d9(_0x5deaac);})[_0xb7b6('0x15')](function(_0x230aa6){logger[_0xb7b6('0x12')](_0xb7b6('0x16'),_0x230aa6[_0xb7b6('0x14')],_0x3dc0f8);_0x314049(_0x7bb633[_0xb7b6('0x12')](0x1f4,_0x230aa6[_0xb7b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1617ac4..9303525 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 _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x106b3c,_0xb1b5d7){var _0x37eeb1=function(_0x406d3c){while(--_0x406d3c){_0x106b3c['push'](_0x106b3c['shift']());}};_0x37eeb1(++_0xb1b5d7);}(_0xadb5,0xad));var _0x5adb=function(_0x5a5f75,_0x29ee82){_0x5a5f75=_0x5a5f75-0x0;var _0x41ce5f=_0xadb5[_0x5a5f75];return _0x41ce5f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +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(_0x3c9699,_0x544d86){var _0x3e5a87=function(_0x4c1986){while(--_0x4c1986){_0x3c9699['push'](_0x3c9699['shift']());}};_0x3e5a87(++_0x544d86);}(_0xb10b,0x12a));var _0xbb10=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb10b[_0x46698a];return _0x356db0;};'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/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3613b26..37b4bbb 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7246=['json','online','use','ad-login','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','admin','agent','then','add','clearBlockUser','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x263fe3,_0x216b34){var _0x578222=function(_0x1e48ab){while(--_0x1e48ab){_0x263fe3['push'](_0x263fe3['shift']());}};_0x578222(++_0x216b34);}(_0x7246,0x10a));var _0x6724=function(_0x5b0ae9,_0x5ad060){_0x5b0ae9=_0x5b0ae9-0x0;var _0x336c7f=_0x7246[_0x5b0ae9];return _0x336c7f;};'use strict';var passport=require(_0x6724('0x0'));var LocalStrategy=require(_0x6724('0x1'))[_0x6724('0x2')];var moment=require(_0x6724('0x3'));var ActiveDirectory=require(_0x6724('0x4'));var BPromise=require(_0x6724('0x5'));var util=require(_0x6724('0x6'));var db=require(_0x6724('0x7'))['db'];var authService=require(_0x6724('0x8'));var utils=require(_0x6724('0x9'));var config=require(_0x6724('0xa'));var logger=require(_0x6724('0xb'))(_0x6724('0xc'));function isActiveDirectoryConfigured(_0x50b18f){var _0x1d9319=![];if(typeof _0x50b18f[_0x6724('0xd')]!==_0x6724('0xe')){_0x1d9319=_0x50b18f[_0x6724('0xd')][_0x6724('0xf')]&&_0x50b18f[_0x6724('0xd')]['url']&&_0x50b18f['activedirectory'][_0x6724('0x10')];}return _0x1d9319;}function adAuthenticate(_0x16a229,_0x503ae4,_0x30dbf0){return new BPromise(function(_0x322c81,_0x2fa2ed){try{var _0x219e2c=new ActiveDirectory(_0x16a229);_0x219e2c[_0x6724('0x11')](_0x503ae4,_0x30dbf0,function(_0x417679,_0x586236){if(_0x417679){logger[_0x6724('0x12')](_0x6724('0x13'),_0x503ae4,util[_0x6724('0x14')](_0x417679,{'showHidden':![],'depth':null}));_0x2fa2ed('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x586236){logger['error'](_0x6724('0x15'),_0x503ae4);_0x2fa2ed(_0x6724('0x16'));}else{_0x322c81(_0x586236);}});}catch(_0x10ef06){_0x2fa2ed(_0x10ef06);}});}function ActiveDirectoryAuthenticate(_0x38f8a2,_0x43d283,_0x579503,_0x23179d){var _0x2d88b6,_0x428d28;if(!isActiveDirectoryConfigured(config)){logger[_0x6724('0x12')](_0x6724('0x17'),_0x43d283);return _0x23179d(null,![],{'message':_0x6724('0x16')});}return db[_0x6724('0x18')][_0x6724('0x19')]({'where':{'id':0x1},'attributes':[_0x6724('0x1a'),_0x6724('0x1b')],'raw':!![]})['then'](function(_0x7fc5e1){_0x2d88b6=_0x7fc5e1;if(!_0x2d88b6[_0x6724('0x1a')]){logger[_0x6724('0x12')](_0x6724('0x1c'),_0x43d283);throw new Error(_0x6724('0x16'));}return _0x38f8a2[_0x6724('0x19')]({'logging':!![],'attributes':['id',_0x6724('0x1d'),'password',_0x6724('0x1e'),_0x6724('0x1f'),_0x6724('0x20'),_0x6724('0x21'),_0x6724('0x22'),'online'],'where':{'name':_0x43d283,'role':{'$or':[_0x6724('0x23'),'user',_0x6724('0x24')]},'adSsoEnabled':!![]}});})[_0x6724('0x25')](function(_0x4eacf0){if(!_0x4eacf0||_0x4eacf0&&_0x4eacf0[_0x6724('0x1d')]!==_0x43d283){throw new Error(_0x6724('0x16'));}_0x428d28=_0x4eacf0;var _0x2a4d6c=_0x428d28[_0x6724('0x1d')]+'@'+config['activedirectory'][_0x6724('0x10')];return adAuthenticate(config[_0x6724('0xd')],_0x2a4d6c,_0x579503);})[_0x6724('0x25')](function(_0x554eeb){if(_0x428d28[_0x6724('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2d88b6['blockDuration']>0x0){if(_0x428d28['blocked']){if(moment(_0x428d28[_0x6724('0x22')])[_0x6724('0x26')](_0x2d88b6[_0x6724('0x1b')],'minutes')>moment()){throw new Error(_0x6724('0x16'));}return utils[_0x6724('0x27')](_0x428d28,0x0,![],null)[_0x6724('0x25')](function(){return utils[_0x6724('0x28')](_0x428d28);})[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}else{return utils[_0x6724('0x28')](_0x428d28)['then'](function(){return _0x23179d(null,_0x428d28);});}}else{return utils[_0x6724('0x28')](_0x428d28)[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}})[_0x6724('0x29')](function(_0x44d07f){return _0x23179d(null,![],_0x44d07f);});}function handleError(_0x35a93f,_0x14a102,_0x4e9502){return _0x35a93f['status'](_0x14a102||0x1f4)[_0x6724('0x2a')]({'message':_0x4e9502?_0x4e9502[_0x6724('0x2b')]||_0x4e9502:''});}exports['login']=function(_0x6fd2aa,_0x596295,_0x3fbd8f){passport[_0x6724('0x11')]('ad-login',function(_0x12163a,_0x30357e,_0x572c4a){var _0x51ea72=_0x12163a||_0x572c4a;if(_0x51ea72){return handleError(_0x596295,0x191,_0x51ea72);}if(!_0x30357e){return handleError(_0x596295,0x194,{'message':_0x6724('0x2c')});}else{var _0x32a5b0={'payload':{'id':_0x30357e['id'],'role':_0x30357e[_0x6724('0x1f')]},'options':{'expiresIn':0x15180}};return authService[_0x6724('0x2d')](_0x32a5b0)[_0x6724('0x25')](function(_0x47bbf0){_0x596295[_0x6724('0x2e')]({'id':_0x30357e['id'],'token':_0x47bbf0,'statusCall':'','isAlreadyLogged':_0x30357e[_0x6724('0x2f')]});});}})(_0x6fd2aa,_0x596295,_0x3fbd8f);};passport[_0x6724('0x30')](_0x6724('0x31'),new LocalStrategy({'usernameField':_0x6724('0x1d'),'passwordField':_0x6724('0x32')},function(_0x1ff595,_0x2cd2c5,_0x13f1c4){return ActiveDirectoryAuthenticate(db[_0x6724('0x33')],_0x1ff595,_0x2cd2c5,_0x13f1c4);})); \ No newline at end of file +var _0xaa4d=['Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','blocked','blockedAt','online','agent','name','domain','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','error'];(function(_0x4fb862,_0x58cde2){var _0x3a3d45=function(_0x130023){while(--_0x130023){_0x4fb862['push'](_0x4fb862['shift']());}};_0x3a3d45(++_0x58cde2);}(_0xaa4d,0x83));var _0xdaa4=function(_0x5794dd,_0x37af14){_0x5794dd=_0x5794dd-0x0;var _0x1a32a7=_0xaa4d[_0x5794dd];return _0x1a32a7;};'use strict';var passport=require(_0xdaa4('0x0'));var LocalStrategy=require(_0xdaa4('0x1'))[_0xdaa4('0x2')];var moment=require(_0xdaa4('0x3'));var ActiveDirectory=require(_0xdaa4('0x4'));var BPromise=require(_0xdaa4('0x5'));var util=require(_0xdaa4('0x6'));var db=require(_0xdaa4('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xdaa4('0x8'));var config=require(_0xdaa4('0x9'));var logger=require(_0xdaa4('0xa'))(_0xdaa4('0xb'));function isActiveDirectoryConfigured(_0xbe5d6){var _0x3798aa=![];if(typeof _0xbe5d6[_0xdaa4('0xc')]!=='undefined'){_0x3798aa=_0xbe5d6[_0xdaa4('0xc')][_0xdaa4('0xd')]&&_0xbe5d6[_0xdaa4('0xc')][_0xdaa4('0xe')]&&_0xbe5d6[_0xdaa4('0xc')]['domain'];}return _0x3798aa;}function adAuthenticate(_0x59a1fc,_0x3d884f,_0x497c70){return new BPromise(function(_0x67bac4,_0x5260d3){try{var _0xe668d5=new ActiveDirectory(_0x59a1fc);_0xe668d5['authenticate'](_0x3d884f,_0x497c70,function(_0x413602,_0x46d06c){if(_0x413602){logger[_0xdaa4('0xf')](_0xdaa4('0x10'),_0x3d884f,util['inspect'](_0x413602,{'showHidden':![],'depth':null}));_0x5260d3(_0xdaa4('0x11'));}else if(!_0x46d06c){logger['error'](_0xdaa4('0x12'),_0x3d884f);_0x5260d3(_0xdaa4('0x11'));}else{_0x67bac4(_0x46d06c);}});}catch(_0x2a3853){_0x5260d3(_0x2a3853);}});}function ActiveDirectoryAuthenticate(_0x1c3c92,_0xe82ab7,_0x285a21,_0x354485){var _0x386af5,_0x31c21d;if(!isActiveDirectoryConfigured(config)){logger[_0xdaa4('0xf')](_0xdaa4('0x13'),_0xe82ab7);return _0x354485(null,![],{'message':_0xdaa4('0x11')});}return db[_0xdaa4('0x14')][_0xdaa4('0x15')]({'where':{'id':0x1},'attributes':[_0xdaa4('0x16'),_0xdaa4('0x17')],'raw':!![]})[_0xdaa4('0x18')](function(_0x17fd7a){_0x386af5=_0x17fd7a;if(!_0x386af5['adSsoEnabled']){logger[_0xdaa4('0xf')](_0xdaa4('0x19'),_0xe82ab7);throw new Error(_0xdaa4('0x11'));}return _0x1c3c92[_0xdaa4('0x15')]({'logging':!![],'attributes':['id','name',_0xdaa4('0x1a'),_0xdaa4('0x1b'),_0xdaa4('0x1c'),_0xdaa4('0x1d'),_0xdaa4('0x1e'),_0xdaa4('0x1f'),_0xdaa4('0x20')],'where':{'name':_0xe82ab7,'role':{'$or':['admin','user',_0xdaa4('0x21')]},'adSsoEnabled':!![]}});})[_0xdaa4('0x18')](function(_0x78d17f){if(!_0x78d17f||_0x78d17f&&_0x78d17f[_0xdaa4('0x22')]!==_0xe82ab7){throw new Error(_0xdaa4('0x11'));}_0x31c21d=_0x78d17f;var _0x280b70=_0x31c21d['name']+'@'+config[_0xdaa4('0xc')][_0xdaa4('0x23')];return adAuthenticate(config[_0xdaa4('0xc')],_0x280b70,_0x285a21);})['then'](function(_0x571bc9){if(_0x31c21d[_0xdaa4('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x386af5[_0xdaa4('0x17')]>0x0){if(_0x31c21d[_0xdaa4('0x1e')]){if(moment(_0x31c21d[_0xdaa4('0x1f')])[_0xdaa4('0x24')](_0x386af5[_0xdaa4('0x17')],_0xdaa4('0x25'))>moment()){throw new Error(_0xdaa4('0x11'));}return utils[_0xdaa4('0x26')](_0x31c21d,0x0,![],null)[_0xdaa4('0x18')](function(){return utils[_0xdaa4('0x27')](_0x31c21d);})[_0xdaa4('0x18')](function(){return _0x354485(null,_0x31c21d);});}else{return utils[_0xdaa4('0x27')](_0x31c21d)[_0xdaa4('0x18')](function(){return _0x354485(null,_0x31c21d);});}}else{return utils[_0xdaa4('0x27')](_0x31c21d)['then'](function(){return _0x354485(null,_0x31c21d);});}})[_0xdaa4('0x28')](function(_0x1b42e0){return _0x354485(null,![],_0x1b42e0);});}function handleError(_0x5a0efe,_0x232bb5,_0x1f78b8){return _0x5a0efe[_0xdaa4('0x29')](_0x232bb5||0x1f4)[_0xdaa4('0x2a')]({'message':_0x1f78b8?_0x1f78b8[_0xdaa4('0x2b')]||_0x1f78b8:''});}exports[_0xdaa4('0x2c')]=function(_0x10fbaf,_0x46e312,_0x23747d){passport['authenticate'](_0xdaa4('0x2d'),function(_0x39401f,_0x380d31,_0x571fa4){var _0x1d0bbc=_0x39401f||_0x571fa4;if(_0x1d0bbc){return handleError(_0x46e312,0x191,_0x1d0bbc);}if(!_0x380d31){return handleError(_0x46e312,0x194,{'message':_0xdaa4('0x2e')});}else{var _0x47524c={'payload':{'id':_0x380d31['id'],'role':_0x380d31['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x47524c)[_0xdaa4('0x18')](function(_0x439208){_0x46e312['json']({'id':_0x380d31['id'],'token':_0x439208,'statusCall':'','isAlreadyLogged':_0x380d31[_0xdaa4('0x20')]});});}})(_0x10fbaf,_0x46e312,_0x23747d);};passport[_0xdaa4('0x2f')](_0xdaa4('0x2d'),new LocalStrategy({'usernameField':_0xdaa4('0x22'),'passwordField':_0xdaa4('0x1a')},function(_0x2d3935,_0x16720b,_0x8c63ac){return ActiveDirectoryAuthenticate(db[_0xdaa4('0x30')],_0x2d3935,_0x16720b,_0x8c63ac);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index b08cf7f..a9cc90e 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa179=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa179,0x16d));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x9a17('0x0')]();var controller=require(_0x9a17('0x1'));router[_0x9a17('0x2')]('/',controller[_0x9a17('0x3')]);module[_0x9a17('0x4')]=router; \ No newline at end of file +var _0x4ceb=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x2967da,_0x19ef62){var _0x34e04b=function(_0x477b75){while(--_0x477b75){_0x2967da['push'](_0x2967da['shift']());}};_0x34e04b(++_0x19ef62);}(_0x4ceb,0x1c4));var _0xb4ce=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4ceb[_0x37bd26];return _0xe83dc4;};'use strict';var express=require(_0xb4ce('0x0'));var router=express[_0xb4ce('0x1')]();var controller=require(_0xb4ce('0x2'));router[_0xb4ce('0x3')]('/',controller['login']);module[_0xb4ce('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0e61886..233d7d7 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 _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x18a9bc,_0x2457fc){_0x18a9bc=_0x18a9bc-0x0;var _0x14c6ae=_0x7a54[_0x18a9bc];return _0x14c6ae;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1b9c11,_0x2d3e06){var _0x425019=function(_0x455b8b){while(--_0x455b8b){_0x1b9c11['push'](_0x1b9c11['shift']());}};_0x425019(++_0x2d3e06);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index a0ca8a8..374444e 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 _0x7111=['express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','login','setTokenCookie','exports'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x7111,0x19a));var _0x1711=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x7111[_0x209ec9];return _0x129b1b;};'use strict';var express=require(_0x1711('0x0'));var passport=require(_0x1711('0x1'));var router=express['Router']();var controller=require(_0x1711('0x2'));var userController=require(_0x1711('0x3'));var authService=require(_0x1711('0x4'));router[_0x1711('0x5')]('/',controller['login']);router[_0x1711('0x5')]('/callback',controller[_0x1711('0x6')],authService['isMiddleware'],userController[_0x1711('0x7')],authService[_0x1711('0x8')]);module[_0x1711('0x9')]=router; \ No newline at end of file +var _0x5080=['passport','./authGoogle.controller','../../components/auth/service','get','login','/callback'];(function(_0x54026e,_0x162a33){var _0x4a3bdd=function(_0x1fde62){while(--_0x1fde62){_0x54026e['push'](_0x54026e['shift']());}};_0x4a3bdd(++_0x162a33);}(_0x5080,0x66));var _0x0508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5080[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var passport=require(_0x0508('0x0'));var router=express['Router']();var controller=require(_0x0508('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x0508('0x2'));router[_0x0508('0x3')]('/',controller[_0x0508('0x4')]);router['get'](_0x0508('0x5'),controller['callback'],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);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 5143285..c861b89 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 _0x351c=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','user','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x22cf12,_0x2807f7){var _0x2e47e2=function(_0x41ad94){while(--_0x41ad94){_0x22cf12['push'](_0x22cf12['shift']());}};_0x2e47e2(++_0x2807f7);}(_0x351c,0xff));var _0xc351=function(_0x4625c1,_0x186658){_0x4625c1=_0x4625c1-0x0;var _0x57635c=_0x351c[_0x4625c1];return _0x57635c;};'use strict';var util=require(_0xc351('0x0'));var passport=require(_0xc351('0x1'));var LocalStrategy=require(_0xc351('0x2'))['Strategy'];var jayson=require(_0xc351('0x3'));var _=require(_0xc351('0x4'));var rs=require(_0xc351('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc351('0x6'));var utils=require(_0xc351('0x7'));var client=jayson[_0xc351('0x8')][_0xc351('0x9')]({'port':0x232b});function localAuthenticate(_0x57f226,_0x250f72,_0x5e148e,_0x244cf2){var _0x21a1e4,_0x5c78d0;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})['then'](function(_0x3ca29e){_0x21a1e4=_0x3ca29e;return _0x57f226['findOne']({'attributes':['id','name',_0xc351('0xe'),_0xc351('0xf'),_0xc351('0x10'),_0xc351('0x11'),'blocked',_0xc351('0x12'),'loginAttempts'],'where':{'name':_0x250f72,'role':{'$or':[_0xc351('0x13'),'user',_0xc351('0x14')]}}});})[_0xc351('0x15')](function(_0x36ffeb){if(!_0x36ffeb||_0x36ffeb&&_0x36ffeb[_0xc351('0x16')]!==_0x250f72){throw new Error(_0xc351('0x17'));}else{_0x5c78d0=_0x36ffeb;return _0x5c78d0;}})['then'](function(){_0x5c78d0[_0xc351('0x18')](_0x5e148e,function(_0x4ec80b,_0x40c441){var _0x2a4e9e=_0x5c78d0[_0xc351('0x19')]+0x1;if(_0x4ec80b){return _0x244cf2(_0x4ec80b);}else if(!_0x40c441){if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0['blocked']){if(_0x21a1e4['blockDuration']>0x0){if(moment(_0x5c78d0[_0xc351('0x12')])[_0xc351('0x1a')](_0x21a1e4[_0xc351('0xd')],_0xc351('0x1b'))>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils['clearBlockUser'](_0x5c78d0,_0x2a4e9e,![],null)[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{if(_0x2a4e9e>=_0x21a1e4['allowedLoginAttempts']){return utils[_0xc351('0x1c')](_0x5c78d0,0x0,!![],moment())[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}else{return utils[_0xc351('0x1c')](_0x5c78d0,_0x2a4e9e,![],null)['then'](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}}}else{return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0[_0xc351('0x1d')]){if(_0x21a1e4[_0xc351('0xd')]>0x0){if(moment(_0x5c78d0['blockedAt'])[_0xc351('0x1a')](_0x21a1e4['blockDuration'],'minutes')>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)['then'](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)[_0xc351('0x15')](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})[_0xc351('0x15')](function(){return _0x244cf2(null,_0x5c78d0);})['catch'](function(_0x8e2e2c){return _0x244cf2(null,![],_0x8e2e2c);});}}else{if(_0x5c78d0['blocked']){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x5c78d0)['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}}});})[_0xc351('0x1f')](function(_0xfd9a15){return _0x244cf2(null,![],_0xfd9a15);});}function sendServiceMail(_0x2846d2){return db['MailAccount'][_0xc351('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc351('0x16'),_0xc351('0x21')],'include':[{'model':db[_0xc351('0x22')],'as':_0xc351('0x23'),'include':[{'model':db[_0xc351('0x24')],'as':_0xc351('0x24')}]}]})[_0xc351('0x15')](function(_0x519abb){if(!_0x519abb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5c4dd5=_0x519abb['getSmtpOptions']();var _0x437bb6={'account':_0x5c4dd5,'message':_[_0xc351('0x25')]({'from':util[_0xc351('0x26')](_0xc351('0x27'),_0x519abb[_0xc351('0x16')],_0x519abb[_0xc351('0x21')]||_0x519abb['Smtp'][_0xc351('0x28')])},_0x2846d2)};return client['request']('SendMail',_0x437bb6);})[_0xc351('0x15')](function(_0x3303d7){if(_0x3303d7[_0xc351('0x29')]){throw new Error(util[_0xc351('0x26')](_0xc351('0x2a'),_0x3303d7[_0xc351('0x29')][_0xc351('0x2b')]||JSON[_0xc351('0x2c')](_0x3303d7[_0xc351('0x29')])));}return!![];});}function handleError(_0x12b683,_0xc3596b,_0x5c58a5){return _0x12b683[_0xc351('0x2d')](_0xc3596b||0x1f4)[_0xc351('0x2e')]({'message':_0x5c58a5?_0x5c58a5[_0xc351('0x2b')]||_0x5c58a5:''});}exports[_0xc351('0x2f')]=function(_0x5a3bc9,_0x50a70a,_0x396c32){passport[_0xc351('0x18')]('local-login',function(_0x3b6ab1,_0x6165b6,_0x4eb174){var _0x3e0b4a=_0x3b6ab1||_0x4eb174;if(_0x3e0b4a){return handleError(_0x50a70a,0x191,_0x3e0b4a);}if(!_0x6165b6){return handleError(_0x50a70a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x531b17={'payload':{'id':_0x6165b6['id'],'role':_0x6165b6[_0xc351('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x531b17)[_0xc351('0x15')](function(_0xaea516){_0x50a70a[_0xc351('0x30')]({'id':_0x6165b6['id'],'token':_0xaea516,'statusCall':'','isAlreadyLogged':_0x6165b6[_0xc351('0x31')]});});}})(_0x5a3bc9,_0x50a70a,_0x396c32);};exports[_0xc351('0x32')]=function(_0x802d8,_0x3fbf0c){if(!_0x802d8[_0xc351('0x33')]['email']){return handleError(_0x3fbf0c,0x1f4,{'message':_0xc351('0x34')});}var _0x375718=rs[_0xc351('0x35')]();_0x802d8[_0xc351('0x33')][_0xc351('0x21')]=_0x802d8['body'][_0xc351('0x21')]['trim']()[_0xc351('0x36')]();var _0x417c3d;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})[_0xc351('0x15')](function(_0x2f0f22){_0x417c3d=_0x2f0f22;return db[_0xc351('0x37')]['find']({'where':{'email':_0x802d8['body'][_0xc351('0x21')]}});})[_0xc351('0x15')](function(_0x433946){if(!_0x433946){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x433946['disabled']){throw new Error(_0xc351('0x38'));}if(_0x433946['blocked']){if(moment(_0x433946['blockedAt'])[_0xc351('0x1a')](_0x417c3d[_0xc351('0xd')],_0xc351('0x1b'))>moment()){throw new Error(_0xc351('0x39'));}else{_0x433946['blocked']=![];_0x433946[_0xc351('0x12')]=null;}}_0x433946[_0xc351('0x3a')]=_0x375718;_0x433946[_0xc351('0x3b')]=Date['now']()+0x36ee80;return _0x433946['save']();})[_0xc351('0x15')](function(){return sendServiceMail({'to':_0x802d8[_0xc351('0x33')][_0xc351('0x21')],'subject':_0xc351('0x3c'),'text':_0xc351('0x3d')+_0xc351('0x3e')+'https://'+_0x802d8['headers'][_0xc351('0x3f')]+'/reset/'+_0x375718+'\x0a\x0a'+_0xc351('0x40')});})['then'](function(){_0x3fbf0c[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x41')});})[_0xc351('0x1f')](function(_0x52064d){return handleError(_0x3fbf0c,0x1f4,_0x52064d);});};exports['reset']=function(_0x4465cc,_0x7a77d1){return db['User'][_0xc351('0x20')]({'where':{'resetPasswordToken':_0x4465cc[_0xc351('0x42')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc351('0x43')]()}}})[_0xc351('0x15')](function(_0x276538){if(!_0x276538){throw new Error(_0xc351('0x44'));}return db[_0xc351('0xa')][_0xc351('0xb')]({'attributes':['id',_0xc351('0x45'),_0xc351('0x46'),_0xc351('0x47')]})['then'](function(_0x431235){if(_0x431235['securePassword'])authService[_0xc351('0x48')](_0x4465cc['body'][_0xc351('0xe')]);if(!_0x431235[_0xc351('0x46')]||!_0x276538[_0xc351('0x49')])return _0x276538;authService['validatePasswordHistory'](_0x4465cc[_0xc351('0x33')][_0xc351('0xe')],_0x276538[_0xc351('0x49')],_0x431235[_0xc351('0x47')]);return _0x276538;})[_0xc351('0x15')](function(){_0x276538[_0xc351('0xe')]=_0x4465cc[_0xc351('0x33')]['password'];_0x276538[_0xc351('0x3a')]=null;_0x276538[_0xc351('0x3b')]=null;return _0x276538[_0xc351('0x4a')]();});})['then'](function(){_0x7a77d1[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x4b')});})[_0xc351('0x1f')](function(_0x226252){return handleError(_0x7a77d1,0x1f4,_0x226252);});};passport[_0xc351('0x4c')](_0xc351('0x4d'),new LocalStrategy({'usernameField':_0xc351('0x16'),'passwordField':_0xc351('0xe')},function(_0x4aeaf5,_0x46bbb8,_0x2b6419){return localAuthenticate(db[_0xc351('0x37')],_0x4aeaf5,_0x46bbb8,_0x2b6419);})); \ No newline at end of file +var _0x283a=['generate','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','resetPasswordExpires','status','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','message','send','local-login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x2a6490,_0x1adf0f){var _0x1b31df=function(_0x51eeb7){while(--_0x51eeb7){_0x2a6490['push'](_0x2a6490['shift']());}};_0x1b31df(++_0x1adf0f);}(_0x283a,0x169));var _0xa283=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x283a[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require(_0xa283('0x0'));var passport=require(_0xa283('0x1'));var LocalStrategy=require(_0xa283('0x2'))[_0xa283('0x3')];var jayson=require(_0xa283('0x4'));var _=require('lodash');var rs=require(_0xa283('0x5'));var moment=require(_0xa283('0x6'));var db=require(_0xa283('0x7'))['db'];var authService=require(_0xa283('0x8'));var utils=require('../../config/utils');var client=jayson[_0xa283('0x9')][_0xa283('0xa')]({'port':0x232b});function localAuthenticate(_0x90bbf2,_0xb36cb,_0x723a95,_0x32afdd){var _0x29a0e0,_0x51c968;return db['Setting'][_0xa283('0xb')]({'where':{'id':0x1},'attributes':[_0xa283('0xc'),_0xa283('0xd')],'raw':!![]})[_0xa283('0xe')](function(_0x2d9988){_0x29a0e0=_0x2d9988;return _0x90bbf2[_0xa283('0xb')]({'attributes':['id',_0xa283('0xf'),_0xa283('0x10'),_0xa283('0x11'),_0xa283('0x12'),_0xa283('0x13'),_0xa283('0x14'),_0xa283('0x15'),_0xa283('0x16')],'where':{'name':_0xb36cb,'role':{'$or':[_0xa283('0x17'),_0xa283('0x18'),_0xa283('0x19')]}}});})[_0xa283('0xe')](function(_0x432367){if(!_0x432367||_0x432367&&_0x432367['name']!==_0xb36cb){throw new Error(_0xa283('0x1a'));}else{_0x51c968=_0x432367;return _0x51c968;}})[_0xa283('0xe')](function(){_0x51c968[_0xa283('0x1b')](_0x723a95,function(_0x5b5f98,_0x3f1d70){var _0x2055e0=_0x51c968[_0xa283('0x16')]+0x1;if(_0x5b5f98){return _0x32afdd(_0x5b5f98);}else if(!_0x3f1d70){if(_0x51c968['disabled']){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else if(_0x29a0e0[_0xa283('0xc')]>0x0){if(_0x51c968[_0xa283('0x14')]){if(_0x29a0e0[_0xa283('0xd')]>0x0){if(moment(_0x51c968[_0xa283('0x15')])[_0xa283('0x1c')](_0x29a0e0[_0xa283('0xd')],_0xa283('0x1d'))>moment()){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else{return utils[_0xa283('0x1e')](_0x51c968,_0x2055e0,![],null)[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{if(_0x2055e0>=_0x29a0e0[_0xa283('0xc')]){return utils[_0xa283('0x1e')](_0x51c968,0x0,!![],moment())[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}else{return utils['clearBlockUser'](_0x51c968,_0x2055e0,![],null)[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{if(_0x51c968[_0xa283('0x13')]){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else if(_0x29a0e0[_0xa283('0xc')]>0x0){if(_0x51c968[_0xa283('0x14')]){if(_0x29a0e0[_0xa283('0xd')]>0x0){if(moment(_0x51c968['blockedAt'])[_0xa283('0x1c')](_0x29a0e0[_0xa283('0xd')],_0xa283('0x1d'))>moment()){return _0x32afdd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x51c968,0x0,![],null)[_0xa283('0xe')](function(){return utils[_0xa283('0x1f')](_0x51c968);})[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);});}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{return utils[_0xa283('0x1e')](_0x51c968,0x0,![],null)[_0xa283('0xe')](function(){return utils[_0xa283('0x1f')](_0x51c968);})[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);})[_0xa283('0x20')](function(_0x3eafbc){return _0x32afdd(null,![],_0x3eafbc);});}}else{if(_0x51c968['blocked']){return _0x32afdd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa283('0x1f')](_0x51c968)[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);});}}}});})[_0xa283('0x20')](function(_0x35b6bf){return _0x32afdd(null,![],_0x35b6bf);});}function sendServiceMail(_0x5532e6){return db['MailAccount'][_0xa283('0x21')]({'where':{'service':!![]},'attributes':['id',_0xa283('0xf'),'email'],'include':[{'model':db[_0xa283('0x22')],'as':_0xa283('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xa283('0x24')}]}]})[_0xa283('0xe')](function(_0x160a2b){if(!_0x160a2b){throw new Error(_0xa283('0x25'));}var _0x391324=_0x160a2b[_0xa283('0x26')]();var _0x5f3a85={'account':_0x391324,'message':_[_0xa283('0x27')]({'from':util['format'](_0xa283('0x28'),_0x160a2b[_0xa283('0xf')],_0x160a2b[_0xa283('0x29')]||_0x160a2b['Smtp'][_0xa283('0x18')])},_0x5532e6)};return client[_0xa283('0x2a')](_0xa283('0x2b'),_0x5f3a85);})[_0xa283('0xe')](function(_0x1af0d8){if(_0x1af0d8[_0xa283('0x2c')]){throw new Error(util[_0xa283('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1af0d8[_0xa283('0x2c')][_0xa283('0x2e')]||JSON['stringify'](_0x1af0d8[_0xa283('0x2c')])));}return!![];});}function handleError(_0x3c39e1,_0x44be4c,_0x55cb6b){return _0x3c39e1['status'](_0x44be4c||0x1f4)[_0xa283('0x2f')]({'message':_0x55cb6b?_0x55cb6b[_0xa283('0x2e')]||_0x55cb6b:''});}exports['login']=function(_0x4dcd65,_0x21bab0,_0x14157c){passport[_0xa283('0x1b')](_0xa283('0x30'),function(_0x44202e,_0x124c4c,_0x26ebb5){var _0x330188=_0x44202e||_0x26ebb5;if(_0x330188){return handleError(_0x21bab0,0x191,_0x330188);}if(!_0x124c4c){return handleError(_0x21bab0,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2440b3={'payload':{'id':_0x124c4c['id'],'role':_0x124c4c['role']},'options':{'expiresIn':0x15180}};return authService[_0xa283('0x31')](_0x2440b3)[_0xa283('0xe')](function(_0x4e7e16){_0x21bab0['json']({'id':_0x124c4c['id'],'token':_0x4e7e16,'statusCall':'','isAlreadyLogged':_0x124c4c[_0xa283('0x32')]});});}})(_0x4dcd65,_0x21bab0,_0x14157c);};exports[_0xa283('0x33')]=function(_0x469366,_0x4031e6){if(!_0x469366[_0xa283('0x34')][_0xa283('0x29')]){return handleError(_0x4031e6,0x1f4,{'message':_0xa283('0x35')});}var _0x22ad97=rs[_0xa283('0x36')]();_0x469366['body'][_0xa283('0x29')]=_0x469366['body']['email'][_0xa283('0x37')]()[_0xa283('0x38')]();var _0x27e5e1;return db[_0xa283('0x39')][_0xa283('0xb')]({'where':{'id':0x1},'attributes':[_0xa283('0xc'),_0xa283('0xd')],'raw':!![]})[_0xa283('0xe')](function(_0x746f09){_0x27e5e1=_0x746f09;return db['User'][_0xa283('0x21')]({'where':{'email':_0x469366[_0xa283('0x34')][_0xa283('0x29')]}});})['then'](function(_0x3fee1e){if(!_0x3fee1e){throw new Error(_0xa283('0x3a'));}if(_0x3fee1e[_0xa283('0x13')]){throw new Error(_0xa283('0x3b'));}if(_0x3fee1e[_0xa283('0x14')]){if(moment(_0x3fee1e['blockedAt'])[_0xa283('0x1c')](_0x27e5e1[_0xa283('0xd')],_0xa283('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3fee1e[_0xa283('0x14')]=![];_0x3fee1e[_0xa283('0x15')]=null;}}_0x3fee1e[_0xa283('0x3c')]=_0x22ad97;_0x3fee1e['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3fee1e[_0xa283('0x3d')]();})[_0xa283('0xe')](function(){return sendServiceMail({'to':_0x469366['body'][_0xa283('0x29')],'subject':_0xa283('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xa283('0x3f')+_0x469366[_0xa283('0x40')][_0xa283('0x41')]+_0xa283('0x42')+_0x22ad97+'\x0a\x0a'+_0xa283('0x43')});})[_0xa283('0xe')](function(){_0x4031e6['status'](0xc8)[_0xa283('0x2f')]({'message':_0xa283('0x44')});})[_0xa283('0x20')](function(_0x5af46c){return handleError(_0x4031e6,0x1f4,_0x5af46c);});};exports[_0xa283('0x45')]=function(_0x58d087,_0x4b728a){return db[_0xa283('0x46')]['find']({'where':{'resetPasswordToken':_0x58d087['params'][_0xa283('0x47')],'resetPasswordExpires':{'$gt':Date[_0xa283('0x48')]()}}})['then'](function(_0x1665ca){if(!_0x1665ca){throw new Error(_0xa283('0x49'));}return db[_0xa283('0x39')]['findOne']({'attributes':['id',_0xa283('0x4a'),'enforcePasswordHistory',_0xa283('0x4b')]})['then'](function(_0x52c589){if(_0x52c589[_0xa283('0x4a')])authService[_0xa283('0x4c')](_0x58d087['body']['password']);if(!_0x52c589[_0xa283('0x4d')]||!_0x1665ca[_0xa283('0x4e')])return _0x1665ca;authService['validatePasswordHistory'](_0x58d087[_0xa283('0x34')]['password'],_0x1665ca[_0xa283('0x4e')],_0x52c589[_0xa283('0x4b')]);return _0x1665ca;})['then'](function(){_0x1665ca['password']=_0x58d087['body']['password'];_0x1665ca[_0xa283('0x3c')]=null;_0x1665ca[_0xa283('0x4f')]=null;return _0x1665ca[_0xa283('0x3d')]();});})['then'](function(){_0x4b728a[_0xa283('0x50')](0xc8)[_0xa283('0x2f')]({'message':_0xa283('0x51')});})[_0xa283('0x20')](function(_0x5c4752){return handleError(_0x4b728a,0x1f4,_0x5c4752);});};passport[_0xa283('0x52')](_0xa283('0x30'),new LocalStrategy({'usernameField':_0xa283('0xf'),'passwordField':_0xa283('0x10')},function(_0x199a02,_0x432447,_0x104f55){return localAuthenticate(db[_0xa283('0x46')],_0x199a02,_0x432447,_0x104f55);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 3c3bd48..c266f8b 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 _0xe82b=['login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post'];(function(_0x1737a0,_0x11fb16){var _0x48d830=function(_0x5dc5a0){while(--_0x5dc5a0){_0x1737a0['push'](_0x1737a0['shift']());}};_0x48d830(++_0x11fb16);}(_0xe82b,0x125));var _0xbe82=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe82b[_0x30ae5e];return _0x1f2e93;};'use strict';var express=require(_0xbe82('0x0'));var router=express[_0xbe82('0x1')]();var controller=require(_0xbe82('0x2'));router[_0xbe82('0x3')]('/',controller[_0xbe82('0x4')]);router[_0xbe82('0x3')](_0xbe82('0x5'),controller[_0xbe82('0x6')]);router[_0xbe82('0x3')](_0xbe82('0x7'),controller[_0xbe82('0x8')]);module['exports']=router; \ No newline at end of file +var _0x3f99=['post','login','/forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f99,0x14e));var _0x93f9=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x3f99[_0x20cb20];return _0x2fcf4b;};'use strict';var express=require(_0x93f9('0x0'));var router=express['Router']();var controller=require(_0x93f9('0x1'));router[_0x93f9('0x2')]('/',controller[_0x93f9('0x3')]);router[_0x93f9('0x2')](_0x93f9('0x4'),controller['forgot']);router[_0x93f9('0x2')](_0x93f9('0x5'),controller[_0x93f9('0x6')]);module[_0x93f9('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 01772d8..c16ed79 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 _0xd0df=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3c25d7,_0x50ebd0){var _0xd8d3a6=function(_0xfa4124){while(--_0xfa4124){_0x3c25d7['push'](_0x3c25d7['shift']());}};_0xd8d3a6(++_0x50ebd0);}(_0xd0df,0x1df));var _0xfd0d=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xd0df[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0xfd0d('0x0'));module[_0xfd0d('0x1')]={'name':{'type':Sequelize[_0xfd0d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfd0d('0x2')]},'description':{'type':Sequelize[_0xfd0d('0x2')]},'status':{'type':Sequelize[_0xfd0d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfd0d('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xc4ff=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x1945e3,_0x4efd74){var _0x5bf682=function(_0x43a175){while(--_0x43a175){_0x1945e3['push'](_0x1945e3['shift']());}};_0x5bf682(++_0x4efd74);}(_0xc4ff,0xf7));var _0xfc4f=function(_0x47042c,_0x339d8b){_0x47042c=_0x47042c-0x0;var _0x542e56=_0xc4ff[_0x47042c];return _0x542e56;};'use strict';var Sequelize=require('sequelize');module[_0xfc4f('0x0')]={'name':{'type':Sequelize[_0xfc4f('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xfc4f('0x1')]},'description':{'type':Sequelize[_0xfc4f('0x1')]},'status':{'type':Sequelize[_0xfc4f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfc4f('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 cf031c3..ef189c6 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 _0x5994=['update','then','destroy','error','stack','name','index','Automation','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','length','find','create','body','params','addConditions','omit','ids','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save'];(function(_0x4c9efc,_0x416853){var _0x58197d=function(_0x2ee00d){while(--_0x2ee00d){_0x4c9efc['push'](_0x4c9efc['shift']());}};_0x58197d(++_0x416853);}(_0x5994,0x11d));var _0x4599=function(_0x1c463b,_0x5fd405){_0x1c463b=_0x1c463b-0x0;var _0x39f8a4=_0x5994[_0x1c463b];return _0x39f8a4;};'use strict';var emlformat=require(_0x4599('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4599('0x1'));var moment=require(_0x4599('0x2'));var BPromise=require(_0x4599('0x3'));var Mustache=require(_0x4599('0x4'));var util=require(_0x4599('0x5'));var path=require(_0x4599('0x6'));var sox=require(_0x4599('0x7'));var csv=require(_0x4599('0x8'));var ejs=require(_0x4599('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4599('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4599('0xb'));var toCsv=require(_0x4599('0x8'));var querystring=require(_0x4599('0xc'));var Papa=require(_0x4599('0xd'));var Redis=require(_0x4599('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4599('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4599('0x10'))(_0x4599('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4599('0x12'));var db=require(_0x4599('0x13'))['db'];function respondWithStatusCode(_0x4abbe7,_0x4cd02e){_0x4cd02e=_0x4cd02e||0xcc;return function(_0x5aa1f6){if(_0x5aa1f6){return _0x4abbe7[_0x4599('0x14')](_0x4cd02e);}return _0x4abbe7[_0x4599('0x15')](_0x4cd02e)['end']();};}function respondWithResult(_0x29fa17,_0xd7642b){_0xd7642b=_0xd7642b||0xc8;return function(_0x531780){if(_0x531780){return _0x29fa17[_0x4599('0x15')](_0xd7642b)['json'](_0x531780);}};}function respondWithFilteredResult(_0x196080,_0x4168cf){return function(_0x40abdc){if(_0x40abdc){var _0x521058=typeof _0x4168cf[_0x4599('0x16')]===_0x4599('0x17')&&typeof _0x4168cf['limit']===_0x4599('0x17');var _0x1f968f=_0x40abdc[_0x4599('0x18')];var _0x4ed79a=_0x521058?0x0:_0x4168cf[_0x4599('0x16')];var _0x58f343=_0x521058?_0x40abdc['count']:_0x4168cf[_0x4599('0x16')]+_0x4168cf[_0x4599('0x19')];var _0x8304c1;if(_0x58f343>=_0x1f968f){_0x58f343=_0x1f968f;_0x8304c1=0xc8;}else{_0x8304c1=0xce;}_0x196080[_0x4599('0x15')](_0x8304c1);return _0x196080[_0x4599('0x1a')](_0x4599('0x1b'),_0x4ed79a+'-'+_0x58f343+'/'+_0x1f968f)[_0x4599('0x1c')](_0x40abdc);}return null;};}function patchUpdates(_0x4586a9){return function(_0x2eee2f){try{jsonpatch['apply'](_0x2eee2f,_0x4586a9,!![]);}catch(_0x360ab2){return BPromise[_0x4599('0x1d')](_0x360ab2);}return _0x2eee2f[_0x4599('0x1e')]();};}function saveUpdates(_0x14c89d,_0x5d7b4e){return function(_0x541030){if(_0x541030){return _0x541030[_0x4599('0x1f')](_0x14c89d)[_0x4599('0x20')](function(_0x2cd75a){return _0x2cd75a;});}return null;};}function removeEntity(_0x51ff32,_0x270cf7){return function(_0x1f090d){if(_0x1f090d){return _0x1f090d[_0x4599('0x21')]()[_0x4599('0x20')](function(){_0x51ff32[_0x4599('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e50e9,_0x281b66){return function(_0x3f3fcc){if(!_0x3f3fcc){_0x1e50e9['sendStatus'](0x194);}return _0x3f3fcc;};}function handleError(_0x30c1c3,_0xbed598){_0xbed598=_0xbed598||0x1f4;return function(_0x525369){logger[_0x4599('0x22')](_0x525369[_0x4599('0x23')]);if(_0x525369[_0x4599('0x24')]){delete _0x525369[_0x4599('0x24')];}_0x30c1c3['status'](_0xbed598)['send'](_0x525369);};}exports[_0x4599('0x25')]=function(_0x344ea7,_0x4f25cc){var _0xec3151={},_0x5d5c11={},_0x44eb43={'count':0x0,'rows':[]};var _0x427dca=_['map'](db[_0x4599('0x26')][_0x4599('0x27')],function(_0x45f4d3){return{'name':_0x45f4d3[_0x4599('0x28')],'type':_0x45f4d3[_0x4599('0x29')]['key']};});_0x5d5c11[_0x4599('0x2a')]=_[_0x4599('0x2b')](_0x427dca,'name');_0x5d5c11['query']=_['keys'](_0x344ea7[_0x4599('0x2c')]);_0x5d5c11[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x5d5c11[_0x4599('0x2a')],_0x5d5c11[_0x4599('0x2c')]);_0xec3151[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x5d5c11['model'],qs[_0x4599('0x30')](_0x344ea7['query'][_0x4599('0x30')]));_0xec3151[_0x4599('0x2f')]=_0xec3151['attributes']['length']?_0xec3151[_0x4599('0x2f')]:_0x5d5c11[_0x4599('0x2a')];if(!_0x344ea7['query'][_0x4599('0x31')](_0x4599('0x32'))){_0xec3151[_0x4599('0x19')]=qs[_0x4599('0x19')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x19')]);_0xec3151[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x16')]);}_0xec3151[_0x4599('0x33')]=qs['sort'](_0x344ea7[_0x4599('0x2c')][_0x4599('0x34')]);_0xec3151[_0x4599('0x35')]=qs['filters'](_[_0x4599('0x36')](_0x344ea7[_0x4599('0x2c')],_0x5d5c11[_0x4599('0x2d')]),_0x427dca);if(_0x344ea7[_0x4599('0x2c')]['filter']){_0xec3151[_0x4599('0x35')]=_[_0x4599('0x37')](_0xec3151[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x427dca,function(_0x3cbf6b){if(_0x3cbf6b[_0x4599('0x29')]!==_0x4599('0x38')){var _0x48b78a={};_0x48b78a[_0x3cbf6b['name']]={'$like':'%'+_0x344ea7[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x48b78a;}})});}_0xec3151=_['merge']({},_0xec3151,_0x344ea7[_0x4599('0x3a')]);var _0xeb7a18={'where':_0xec3151[_0x4599('0x35')]};return db[_0x4599('0x26')][_0x4599('0x18')](_0xeb7a18)['then'](function(_0x65b12){_0x44eb43['count']=_0x65b12;if(_0x344ea7['query'][_0x4599('0x3b')]){_0xec3151['include']=[{'all':!![]}];}return db[_0x4599('0x26')][_0x4599('0x3c')](_0xec3151);})[_0x4599('0x20')](function(_0xf92e20){_0x44eb43[_0x4599('0x3d')]=_0xf92e20;return _0x44eb43;})[_0x4599('0x20')](respondWithFilteredResult(_0x4f25cc,_0xec3151))[_0x4599('0x3e')](handleError(_0x4f25cc,null));};exports[_0x4599('0x3f')]=function(_0x5b34fc,_0x13f4f7){var _0x5214c0={'raw':![],'where':{'id':_0x5b34fc['params']['id']}},_0x32a7a5={};_0x32a7a5['model']=_['keys'](db['Automation']['rawAttributes']);_0x32a7a5[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x5b34fc[_0x4599('0x2c')]);_0x32a7a5[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x32a7a5[_0x4599('0x2a')],_0x32a7a5[_0x4599('0x2c')]);_0x5214c0[_0x4599('0x2f')]=_['intersection'](_0x32a7a5['model'],qs[_0x4599('0x30')](_0x5b34fc[_0x4599('0x2c')][_0x4599('0x30')]));_0x5214c0[_0x4599('0x2f')]=_0x5214c0[_0x4599('0x2f')][_0x4599('0x41')]?_0x5214c0[_0x4599('0x2f')]:_0x32a7a5[_0x4599('0x2a')];if(_0x5b34fc[_0x4599('0x2c')][_0x4599('0x3b')]){_0x5214c0['include']=[{'all':!![]}];}_0x5214c0=_[_0x4599('0x37')]({},_0x5214c0,_0x5b34fc[_0x4599('0x3a')]);return db[_0x4599('0x26')][_0x4599('0x42')](_0x5214c0)[_0x4599('0x20')](handleEntityNotFound(_0x13f4f7,null))[_0x4599('0x20')](respondWithResult(_0x13f4f7,null))[_0x4599('0x3e')](handleError(_0x13f4f7,null));};exports[_0x4599('0x43')]=function(_0x2c3ff1,_0x26f544){return db['Automation'][_0x4599('0x43')](_0x2c3ff1['body'],{})[_0x4599('0x20')](respondWithResult(_0x26f544,0xc9))[_0x4599('0x3e')](handleError(_0x26f544,null));};exports['update']=function(_0x3ae371,_0x169df3){if(_0x3ae371[_0x4599('0x44')]['id']){delete _0x3ae371[_0x4599('0x44')]['id'];}return db['Automation'][_0x4599('0x42')]({'where':{'id':_0x3ae371['params']['id']}})['then'](handleEntityNotFound(_0x169df3,null))[_0x4599('0x20')](saveUpdates(_0x3ae371[_0x4599('0x44')],null))[_0x4599('0x20')](respondWithResult(_0x169df3,null))[_0x4599('0x3e')](handleError(_0x169df3,null));};exports[_0x4599('0x21')]=function(_0xbca1b8,_0x10761f){return db['Automation'][_0x4599('0x42')]({'where':{'id':_0xbca1b8[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x10761f,null))[_0x4599('0x20')](removeEntity(_0x10761f,null))[_0x4599('0x3e')](handleError(_0x10761f,null));};exports[_0x4599('0x46')]=function(_0x101854,_0xb57f07,_0x2fc88b){return db['Condition'][_0x4599('0x42')]({'where':{'id':_0x101854['params']['id']}})[_0x4599('0x20')](handleEntityNotFound(_0xb57f07,null))[_0x4599('0x20')](function(_0x265f9b){if(_0x265f9b){return _0x265f9b[_0x4599('0x46')](_0x101854['body']['ids'],_[_0x4599('0x47')](_0x101854[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0xb57f07,null))[_0x4599('0x3e')](handleError(_0xb57f07,null));};exports[_0x4599('0x49')]=function(_0xd4b04b,_0x42522e,_0x5ece82){var _0x3f0c3c={};var _0x32e312={};var _0x5e0c45;var _0x3463e3;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0xd4b04b[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x42522e,null))['then'](function(_0x4c60a4){if(_0x4c60a4){_0x5e0c45=_0x4c60a4;_0x32e312[_0x4599('0x2a')]=_['keys'](db[_0x4599('0x4b')][_0x4599('0x27')]);_0x32e312[_0x4599('0x2c')]=_[_0x4599('0x40')](_0xd4b04b[_0x4599('0x2c')]);_0x32e312[_0x4599('0x2d')]=_['intersection'](_0x32e312[_0x4599('0x2a')],_0x32e312[_0x4599('0x2c')]);_0x3f0c3c['attributes']=_[_0x4599('0x2e')](_0x32e312[_0x4599('0x2a')],qs['fields'](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x30')]));_0x3f0c3c[_0x4599('0x2f')]=_0x3f0c3c['attributes'][_0x4599('0x41')]?_0x3f0c3c[_0x4599('0x2f')]:_0x32e312[_0x4599('0x2a')];_0x3f0c3c[_0x4599('0x33')]=qs[_0x4599('0x34')](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x34')]);_0x3f0c3c['where']=qs[_0x4599('0x2d')](_[_0x4599('0x36')](_0xd4b04b[_0x4599('0x2c')],_0x32e312[_0x4599('0x2d')]));if(_0xd4b04b[_0x4599('0x2c')]['filter']){_0x3f0c3c['where']=_[_0x4599('0x37')](_0x3f0c3c[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x3f0c3c['attributes'],function(_0xa448da){var _0x111d4c={};_0x111d4c[_0xa448da]={'$like':'%'+_0xd4b04b[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x111d4c;})});}_0x3f0c3c=_['merge']({},_0x3f0c3c,_0xd4b04b[_0x4599('0x3a')]);return _0x5e0c45['getConditions'](_0x3f0c3c);}})['then'](function(_0x261999){if(_0x261999){_0x3463e3=_0x261999['length'];if(!_0xd4b04b[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x3f0c3c[_0x4599('0x19')]=qs[_0x4599('0x19')](_0xd4b04b['query'][_0x4599('0x19')]);_0x3f0c3c[_0x4599('0x16')]=qs[_0x4599('0x16')](_0xd4b04b[_0x4599('0x2c')]['offset']);}return _0x5e0c45[_0x4599('0x49')](_0x3f0c3c);}})[_0x4599('0x20')](function(_0x502b5b){if(_0x502b5b){return _0x502b5b?{'count':_0x3463e3,'rows':_0x502b5b}:null;}})[_0x4599('0x20')](respondWithResult(_0x42522e,null))[_0x4599('0x3e')](handleError(_0x42522e,null));};exports[_0x4599('0x4c')]=function(_0x10fcd7,_0x21d4c2,_0x14163f){return db['Action']['find']({'where':{'id':_0x10fcd7[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x21d4c2,null))[_0x4599('0x20')](function(_0x357dfb){if(_0x357dfb){return _0x357dfb['addActions'](_0x10fcd7[_0x4599('0x44')][_0x4599('0x48')],_[_0x4599('0x47')](_0x10fcd7[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0x21d4c2,null))[_0x4599('0x3e')](handleError(_0x21d4c2,null));};exports[_0x4599('0x4d')]=function(_0x137476,_0x1c52b6,_0x2902ef){var _0x4b29b4={};var _0x58e542={};var _0x2e2b6b;var _0x43cdf7;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0x137476[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x1c52b6,null))[_0x4599('0x20')](function(_0x304e5a){if(_0x304e5a){_0x2e2b6b=_0x304e5a;_0x58e542['model']=_[_0x4599('0x40')](db[_0x4599('0x4e')][_0x4599('0x27')]);_0x58e542[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x137476['query']);_0x58e542[_0x4599('0x2d')]=_['intersection'](_0x58e542[_0x4599('0x2a')],_0x58e542[_0x4599('0x2c')]);_0x4b29b4[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x58e542[_0x4599('0x2a')],qs['fields'](_0x137476[_0x4599('0x2c')]['fields']));_0x4b29b4[_0x4599('0x2f')]=_0x4b29b4[_0x4599('0x2f')]['length']?_0x4b29b4[_0x4599('0x2f')]:_0x58e542[_0x4599('0x2a')];_0x4b29b4[_0x4599('0x33')]=qs['sort'](_0x137476[_0x4599('0x2c')][_0x4599('0x34')]);_0x4b29b4['where']=qs['filters'](_[_0x4599('0x36')](_0x137476[_0x4599('0x2c')],_0x58e542[_0x4599('0x2d')]));if(_0x137476['query'][_0x4599('0x39')]){_0x4b29b4[_0x4599('0x35')]=_[_0x4599('0x37')](_0x4b29b4[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x4b29b4['attributes'],function(_0x1ab15d){var _0x1cfef4={};_0x1cfef4[_0x1ab15d]={'$like':'%'+_0x137476['query'][_0x4599('0x39')]+'%'};return _0x1cfef4;})});}_0x4b29b4=_['merge']({},_0x4b29b4,_0x137476[_0x4599('0x3a')]);return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x5c86ec){if(_0x5c86ec){_0x43cdf7=_0x5c86ec['length'];if(!_0x137476[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x4b29b4[_0x4599('0x19')]=qs['limit'](_0x137476[_0x4599('0x2c')][_0x4599('0x19')]);_0x4b29b4[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x137476[_0x4599('0x2c')][_0x4599('0x16')]);}return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x4704d8){if(_0x4704d8){return _0x4704d8?{'count':_0x43cdf7,'rows':_0x4704d8}:null;}})[_0x4599('0x20')](respondWithResult(_0x1c52b6,null))[_0x4599('0x3e')](handleError(_0x1c52b6,null));}; \ No newline at end of file +var _0xe62c=['hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy','name','send','map','Automation','rawAttributes','type','key','model','keys','filters','intersection','query','fields','length','attributes','nolimit','sort','where','pick','filter','merge','options','include','catch','show','includeAll','find','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','order'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xe62c,0xd9));var _0xce62=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe62c[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0xce62('0x0'));var rimraf=require(_0xce62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce62('0x2'));var moment=require(_0xce62('0x3'));var BPromise=require(_0xce62('0x4'));var Mustache=require('mustache');var util=require(_0xce62('0x5'));var path=require(_0xce62('0x6'));var sox=require('sox');var csv=require(_0xce62('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce62('0x8'));var _=require(_0xce62('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce62('0x7'));var querystring=require(_0xce62('0xa'));var Papa=require(_0xce62('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce62('0xc'));var as=require(_0xce62('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xce62('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xce62('0xf'))['db'];function respondWithStatusCode(_0x197a5b,_0x2bea96){_0x2bea96=_0x2bea96||0xcc;return function(_0x516db4){if(_0x516db4){return _0x197a5b[_0xce62('0x10')](_0x2bea96);}return _0x197a5b[_0xce62('0x11')](_0x2bea96)[_0xce62('0x12')]();};}function respondWithResult(_0x2eb809,_0x255a52){_0x255a52=_0x255a52||0xc8;return function(_0x2f9921){if(_0x2f9921){return _0x2eb809['status'](_0x255a52)[_0xce62('0x13')](_0x2f9921);}};}function respondWithFilteredResult(_0x33a094,_0x212bcb){return function(_0x53c27c){if(_0x53c27c){var _0x2249a0=typeof _0x212bcb['offset']===_0xce62('0x14')&&typeof _0x212bcb['limit']===_0xce62('0x14');var _0x1f00e4=_0x53c27c[_0xce62('0x15')];var _0x3fab63=_0x2249a0?0x0:_0x212bcb[_0xce62('0x16')];var _0x154923=_0x2249a0?_0x53c27c[_0xce62('0x15')]:_0x212bcb['offset']+_0x212bcb[_0xce62('0x17')];var _0x543ccd;if(_0x154923>=_0x1f00e4){_0x154923=_0x1f00e4;_0x543ccd=0xc8;}else{_0x543ccd=0xce;}_0x33a094[_0xce62('0x11')](_0x543ccd);return _0x33a094[_0xce62('0x18')]('Content-Range',_0x3fab63+'-'+_0x154923+'/'+_0x1f00e4)[_0xce62('0x13')](_0x53c27c);}return null;};}function patchUpdates(_0x1f3b39){return function(_0x9f50d){try{jsonpatch[_0xce62('0x19')](_0x9f50d,_0x1f3b39,!![]);}catch(_0x5dd43d){return BPromise[_0xce62('0x1a')](_0x5dd43d);}return _0x9f50d['save']();};}function saveUpdates(_0x208871,_0x22f1f1){return function(_0x4d7b8f){if(_0x4d7b8f){return _0x4d7b8f[_0xce62('0x1b')](_0x208871)[_0xce62('0x1c')](function(_0x4a4703){return _0x4a4703;});}return null;};}function removeEntity(_0x391b03,_0x645d5b){return function(_0x4091bf){if(_0x4091bf){return _0x4091bf[_0xce62('0x1d')]()[_0xce62('0x1c')](function(){_0x391b03[_0xce62('0x11')](0xcc)[_0xce62('0x12')]();});}};}function handleEntityNotFound(_0x2b4b1f,_0x4e8075){return function(_0x5f2f02){if(!_0x5f2f02){_0x2b4b1f['sendStatus'](0x194);}return _0x5f2f02;};}function handleError(_0x6709ae,_0x373d58){_0x373d58=_0x373d58||0x1f4;return function(_0x1d445e){logger['error'](_0x1d445e['stack']);if(_0x1d445e['name']){delete _0x1d445e[_0xce62('0x1e')];}_0x6709ae[_0xce62('0x11')](_0x373d58)[_0xce62('0x1f')](_0x1d445e);};}exports['index']=function(_0x20f71a,_0x4114f2){var _0x1504ce={},_0x174c5b={},_0x7598f4={'count':0x0,'rows':[]};var _0x15f172=_[_0xce62('0x20')](db[_0xce62('0x21')][_0xce62('0x22')],function(_0xa47858){return{'name':_0xa47858['fieldName'],'type':_0xa47858[_0xce62('0x23')][_0xce62('0x24')]};});_0x174c5b[_0xce62('0x25')]=_[_0xce62('0x20')](_0x15f172,_0xce62('0x1e'));_0x174c5b['query']=_[_0xce62('0x26')](_0x20f71a['query']);_0x174c5b[_0xce62('0x27')]=_[_0xce62('0x28')](_0x174c5b[_0xce62('0x25')],_0x174c5b[_0xce62('0x29')]);_0x1504ce['attributes']=_['intersection'](_0x174c5b[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x20f71a[_0xce62('0x29')][_0xce62('0x2a')]));_0x1504ce['attributes']=_0x1504ce['attributes'][_0xce62('0x2b')]?_0x1504ce[_0xce62('0x2c')]:_0x174c5b[_0xce62('0x25')];if(!_0x20f71a['query']['hasOwnProperty'](_0xce62('0x2d'))){_0x1504ce[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x20f71a['query']['limit']);_0x1504ce[_0xce62('0x16')]=qs['offset'](_0x20f71a[_0xce62('0x29')]['offset']);}_0x1504ce['order']=qs[_0xce62('0x2e')](_0x20f71a[_0xce62('0x29')][_0xce62('0x2e')]);_0x1504ce[_0xce62('0x2f')]=qs['filters'](_[_0xce62('0x30')](_0x20f71a['query'],_0x174c5b['filters']),_0x15f172);if(_0x20f71a[_0xce62('0x29')][_0xce62('0x31')]){_0x1504ce[_0xce62('0x2f')]=_[_0xce62('0x32')](_0x1504ce[_0xce62('0x2f')],{'$or':_[_0xce62('0x20')](_0x15f172,function(_0x15d2b5){if(_0x15d2b5[_0xce62('0x23')]!=='VIRTUAL'){var _0x402e02={};_0x402e02[_0x15d2b5[_0xce62('0x1e')]]={'$like':'%'+_0x20f71a[_0xce62('0x29')]['filter']+'%'};return _0x402e02;}})});}_0x1504ce=_[_0xce62('0x32')]({},_0x1504ce,_0x20f71a[_0xce62('0x33')]);var _0x52dd3a={'where':_0x1504ce[_0xce62('0x2f')]};return db[_0xce62('0x21')]['count'](_0x52dd3a)[_0xce62('0x1c')](function(_0x2374d0){_0x7598f4['count']=_0x2374d0;if(_0x20f71a[_0xce62('0x29')]['includeAll']){_0x1504ce[_0xce62('0x34')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x1504ce);})[_0xce62('0x1c')](function(_0x544e41){_0x7598f4['rows']=_0x544e41;return _0x7598f4;})['then'](respondWithFilteredResult(_0x4114f2,_0x1504ce))[_0xce62('0x35')](handleError(_0x4114f2,null));};exports[_0xce62('0x36')]=function(_0x15a7e7,_0x2a6916){var _0x1712f7={'raw':![],'where':{'id':_0x15a7e7['params']['id']}},_0xce5a9={};_0xce5a9[_0xce62('0x25')]=_['keys'](db[_0xce62('0x21')][_0xce62('0x22')]);_0xce5a9['query']=_[_0xce62('0x26')](_0x15a7e7[_0xce62('0x29')]);_0xce5a9['filters']=_['intersection'](_0xce5a9['model'],_0xce5a9['query']);_0x1712f7[_0xce62('0x2c')]=_[_0xce62('0x28')](_0xce5a9[_0xce62('0x25')],qs['fields'](_0x15a7e7['query'][_0xce62('0x2a')]));_0x1712f7['attributes']=_0x1712f7['attributes'][_0xce62('0x2b')]?_0x1712f7['attributes']:_0xce5a9['model'];if(_0x15a7e7['query'][_0xce62('0x37')]){_0x1712f7['include']=[{'all':!![]}];}_0x1712f7=_[_0xce62('0x32')]({},_0x1712f7,_0x15a7e7['options']);return db[_0xce62('0x21')][_0xce62('0x38')](_0x1712f7)[_0xce62('0x1c')](handleEntityNotFound(_0x2a6916,null))[_0xce62('0x1c')](respondWithResult(_0x2a6916,null))[_0xce62('0x35')](handleError(_0x2a6916,null));};exports['create']=function(_0x32b7fa,_0x4fb2b4){return db['Automation'][_0xce62('0x39')](_0x32b7fa[_0xce62('0x3a')],{})[_0xce62('0x1c')](respondWithResult(_0x4fb2b4,0xc9))['catch'](handleError(_0x4fb2b4,null));};exports[_0xce62('0x1b')]=function(_0x20f77a,_0xd9d0a9){if(_0x20f77a[_0xce62('0x3a')]['id']){delete _0x20f77a['body']['id'];}return db[_0xce62('0x21')]['find']({'where':{'id':_0x20f77a[_0xce62('0x3b')]['id']}})['then'](handleEntityNotFound(_0xd9d0a9,null))[_0xce62('0x1c')](saveUpdates(_0x20f77a[_0xce62('0x3a')],null))[_0xce62('0x1c')](respondWithResult(_0xd9d0a9,null))['catch'](handleError(_0xd9d0a9,null));};exports[_0xce62('0x1d')]=function(_0x2ad5ca,_0x44239d){return db[_0xce62('0x21')]['find']({'where':{'id':_0x2ad5ca[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x44239d,null))[_0xce62('0x1c')](removeEntity(_0x44239d,null))[_0xce62('0x35')](handleError(_0x44239d,null));};exports['addConditions']=function(_0x4a280f,_0x315ad8,_0x151f45){return db[_0xce62('0x3c')][_0xce62('0x38')]({'where':{'id':_0x4a280f[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x315ad8,null))[_0xce62('0x1c')](function(_0x590f04){if(_0x590f04){return _0x590f04[_0xce62('0x3d')](_0x4a280f[_0xce62('0x3a')][_0xce62('0x3e')],_[_0xce62('0x3f')](_0x4a280f[_0xce62('0x3a')],[_0xce62('0x3e'),'id'])||{});}})[_0xce62('0x1c')](respondWithResult(_0x315ad8,null))[_0xce62('0x35')](handleError(_0x315ad8,null));};exports[_0xce62('0x40')]=function(_0x230e8a,_0x1ae580,_0x5027e5){var _0x1cb832={};var _0x2b593c={};var _0x20e0a4;var _0x3b4aea;return db['Automation'][_0xce62('0x41')]({'where':{'id':_0x230e8a[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x1ae580,null))[_0xce62('0x1c')](function(_0x568a0d){if(_0x568a0d){_0x20e0a4=_0x568a0d;_0x2b593c['model']=_[_0xce62('0x26')](db[_0xce62('0x3c')][_0xce62('0x22')]);_0x2b593c[_0xce62('0x29')]=_[_0xce62('0x26')](_0x230e8a[_0xce62('0x29')]);_0x2b593c[_0xce62('0x27')]=_[_0xce62('0x28')](_0x2b593c['model'],_0x2b593c[_0xce62('0x29')]);_0x1cb832[_0xce62('0x2c')]=_[_0xce62('0x28')](_0x2b593c[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x230e8a[_0xce62('0x29')][_0xce62('0x2a')]));_0x1cb832[_0xce62('0x2c')]=_0x1cb832['attributes'][_0xce62('0x2b')]?_0x1cb832[_0xce62('0x2c')]:_0x2b593c[_0xce62('0x25')];_0x1cb832[_0xce62('0x42')]=qs[_0xce62('0x2e')](_0x230e8a[_0xce62('0x29')][_0xce62('0x2e')]);_0x1cb832[_0xce62('0x2f')]=qs[_0xce62('0x27')](_['pick'](_0x230e8a['query'],_0x2b593c['filters']));if(_0x230e8a[_0xce62('0x29')][_0xce62('0x31')]){_0x1cb832[_0xce62('0x2f')]=_[_0xce62('0x32')](_0x1cb832['where'],{'$or':_['map'](_0x1cb832[_0xce62('0x2c')],function(_0x17b151){var _0x16f11b={};_0x16f11b[_0x17b151]={'$like':'%'+_0x230e8a[_0xce62('0x29')][_0xce62('0x31')]+'%'};return _0x16f11b;})});}_0x1cb832=_[_0xce62('0x32')]({},_0x1cb832,_0x230e8a[_0xce62('0x33')]);return _0x20e0a4[_0xce62('0x40')](_0x1cb832);}})[_0xce62('0x1c')](function(_0x41994b){if(_0x41994b){_0x3b4aea=_0x41994b[_0xce62('0x2b')];if(!_0x230e8a[_0xce62('0x29')][_0xce62('0x43')](_0xce62('0x2d'))){_0x1cb832[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x230e8a[_0xce62('0x29')][_0xce62('0x17')]);_0x1cb832['offset']=qs[_0xce62('0x16')](_0x230e8a[_0xce62('0x29')][_0xce62('0x16')]);}return _0x20e0a4[_0xce62('0x40')](_0x1cb832);}})['then'](function(_0x4909e8){if(_0x4909e8){return _0x4909e8?{'count':_0x3b4aea,'rows':_0x4909e8}:null;}})[_0xce62('0x1c')](respondWithResult(_0x1ae580,null))[_0xce62('0x35')](handleError(_0x1ae580,null));};exports[_0xce62('0x44')]=function(_0x14f8cc,_0x1b6280,_0x339cab){return db[_0xce62('0x45')][_0xce62('0x38')]({'where':{'id':_0x14f8cc['params']['id']}})['then'](handleEntityNotFound(_0x1b6280,null))[_0xce62('0x1c')](function(_0x8e3547){if(_0x8e3547){return _0x8e3547[_0xce62('0x44')](_0x14f8cc[_0xce62('0x3a')][_0xce62('0x3e')],_[_0xce62('0x3f')](_0x14f8cc[_0xce62('0x3a')],['ids','id'])||{});}})[_0xce62('0x1c')](respondWithResult(_0x1b6280,null))[_0xce62('0x35')](handleError(_0x1b6280,null));};exports[_0xce62('0x46')]=function(_0x3fd24d,_0x4d35c0,_0x20d33a){var _0x19757b={};var _0x50420c={};var _0x253124;var _0x16dbcf;return db[_0xce62('0x21')][_0xce62('0x41')]({'where':{'id':_0x3fd24d[_0xce62('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4d35c0,null))[_0xce62('0x1c')](function(_0x478686){if(_0x478686){_0x253124=_0x478686;_0x50420c[_0xce62('0x25')]=_['keys'](db[_0xce62('0x45')][_0xce62('0x22')]);_0x50420c[_0xce62('0x29')]=_[_0xce62('0x26')](_0x3fd24d[_0xce62('0x29')]);_0x50420c[_0xce62('0x27')]=_[_0xce62('0x28')](_0x50420c[_0xce62('0x25')],_0x50420c[_0xce62('0x29')]);_0x19757b[_0xce62('0x2c')]=_[_0xce62('0x28')](_0x50420c[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x3fd24d[_0xce62('0x29')][_0xce62('0x2a')]));_0x19757b[_0xce62('0x2c')]=_0x19757b[_0xce62('0x2c')][_0xce62('0x2b')]?_0x19757b[_0xce62('0x2c')]:_0x50420c[_0xce62('0x25')];_0x19757b[_0xce62('0x42')]=qs['sort'](_0x3fd24d[_0xce62('0x29')][_0xce62('0x2e')]);_0x19757b[_0xce62('0x2f')]=qs['filters'](_[_0xce62('0x30')](_0x3fd24d[_0xce62('0x29')],_0x50420c[_0xce62('0x27')]));if(_0x3fd24d[_0xce62('0x29')][_0xce62('0x31')]){_0x19757b[_0xce62('0x2f')]=_['merge'](_0x19757b[_0xce62('0x2f')],{'$or':_[_0xce62('0x20')](_0x19757b['attributes'],function(_0x547757){var _0x13e7a6={};_0x13e7a6[_0x547757]={'$like':'%'+_0x3fd24d[_0xce62('0x29')][_0xce62('0x31')]+'%'};return _0x13e7a6;})});}_0x19757b=_['merge']({},_0x19757b,_0x3fd24d[_0xce62('0x33')]);return _0x253124[_0xce62('0x46')](_0x19757b);}})[_0xce62('0x1c')](function(_0xc3da6b){if(_0xc3da6b){_0x16dbcf=_0xc3da6b[_0xce62('0x2b')];if(!_0x3fd24d[_0xce62('0x29')][_0xce62('0x43')](_0xce62('0x2d'))){_0x19757b[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x3fd24d['query'][_0xce62('0x17')]);_0x19757b[_0xce62('0x16')]=qs[_0xce62('0x16')](_0x3fd24d[_0xce62('0x29')][_0xce62('0x16')]);}return _0x253124[_0xce62('0x46')](_0x19757b);}})[_0xce62('0x1c')](function(_0x4b1ece){if(_0x4b1ece){return _0x4b1ece?{'count':_0x16dbcf,'rows':_0x4b1ece}:null;}})[_0xce62('0x1c')](respondWithResult(_0x4d35c0,null))[_0xce62('0x35')](handleError(_0x4d35c0,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index df8b804..9548d52 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 _0xdd34=['api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','util'];(function(_0x286634,_0xac4607){var _0x577003=function(_0x23bca7){while(--_0x23bca7){_0x286634['push'](_0x286634['shift']());}};_0x577003(++_0xac4607);}(_0xdd34,0x15f));var _0x4dd3=function(_0x524d5e,_0x269f75){_0x524d5e=_0x524d5e-0x0;var _0x3a1eca=_0xdd34[_0x524d5e];return _0x3a1eca;};'use strict';var _=require('lodash');var util=require(_0x4dd3('0x0'));var logger=require('../../config/logger')(_0x4dd3('0x1'));var moment=require(_0x4dd3('0x2'));var BPromise=require(_0x4dd3('0x3'));var rp=require(_0x4dd3('0x4'));var fs=require('fs');var path=require(_0x4dd3('0x5'));var rimraf=require('rimraf');var config=require(_0x4dd3('0x6'));var attributes=require(_0x4dd3('0x7'));module[_0x4dd3('0x8')]=function(_0x2b4148,_0x74864f){return _0x2b4148[_0x4dd3('0x9')]('Automation',attributes,{'tableName':_0x4dd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9c0=['rimraf','../../config/environment','exports','define','tools_automations','util','../../config/logger','moment','request-promise'];(function(_0x173df4,_0x5016fb){var _0x3ac206=function(_0x532cbb){while(--_0x532cbb){_0x173df4['push'](_0x173df4['shift']());}};_0x3ac206(++_0x5016fb);}(_0xf9c0,0x176));var _0x0f9c=function(_0x5c3e51,_0xfeaf8){_0x5c3e51=_0x5c3e51-0x0;var _0xd53ad5=_0xf9c0[_0x5c3e51];return _0xd53ad5;};'use strict';var _=require('lodash');var util=require(_0x0f9c('0x0'));var logger=require(_0x0f9c('0x1'))('api');var moment=require(_0x0f9c('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f9c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f9c('0x4'));var config=require(_0x0f9c('0x5'));var attributes=require('./automation.attributes');module[_0x0f9c('0x6')]=function(_0xb63435,_0x1835f2){return _0xb63435[_0x0f9c('0x7')]('Automation',attributes,{'tableName':_0x0f9c('0x8'),'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 849201d..ac8fd62 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 _0x6bab=['../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x6bab[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389a0d,_0x3fd283,_0xbce6f){return new BPromise(function(_0xa0b5c7,_0x469e81){return client[_0xb6ba('0xb')](_0x389a0d,_0xbce6f)[_0xb6ba('0xc')](function(_0x36bdc2){logger['info'](_0xb6ba('0xd'),_0x3fd283,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3fd283,_0xb6ba('0xe'),JSON[_0xb6ba('0xf')](_0x36bdc2));if(_0x36bdc2[_0xb6ba('0x10')]){if(_0x36bdc2['error'][_0xb6ba('0x11')]===0x1f4){logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0x469e81(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0xa0b5c7(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}else{logger[_0xb6ba('0x13')](_0xb6ba('0xd'),_0x3fd283,_0xb6ba('0xe'));_0xa0b5c7(_0x36bdc2[_0xb6ba('0x14')][_0xb6ba('0x12')]);}})[_0xb6ba('0x15')](function(_0x5313d4){logger[_0xb6ba('0x10')]('Automation,\x20%s,\x20%s',_0x3fd283,_0x5313d4);_0x469e81(_0x5313d4);});});} \ No newline at end of file +var _0xfff0=['../../config/environment','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4c4ce4,_0x50d3d8){var _0x2bdcc8=function(_0x4801d2){while(--_0x4801d2){_0x4c4ce4['push'](_0x4c4ce4['shift']());}};_0x2bdcc8(++_0x50d3d8);}(_0xfff0,0x139));var _0x0fff=function(_0x11be98,_0x2a9bf1){_0x11be98=_0x11be98-0x0;var _0x3359a5=_0xfff0[_0x11be98];return _0x3359a5;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('Automation,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 9305bde..9f248c9 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 _0x6505=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0x6505,0x8c));var _0x5650=function(_0x5e16cf,_0x23b912){_0x5e16cf=_0x5e16cf-0x0;var _0x5201e5=_0x6505[_0x5e16cf];return _0x5201e5;};'use strict';var multer=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var path=require(_0x5650('0x2'));var timeout=require(_0x5650('0x3'));var express=require(_0x5650('0x4'));var router=express[_0x5650('0x5')]();var fs_extra=require(_0x5650('0x6'));var auth=require(_0x5650('0x7'));var interaction=require(_0x5650('0x8'));var config=require(_0x5650('0x9'));var controller=require(_0x5650('0xa'));router['get']('/',auth[_0x5650('0xb')](),controller[_0x5650('0xc')]);router[_0x5650('0xd')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0xf')]);router[_0x5650('0xd')]('/:id/conditions',auth[_0x5650('0xb')](),controller['getConditions']);router[_0x5650('0xd')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x11')]);router[_0x5650('0x12')]('/',auth[_0x5650('0xb')](),controller[_0x5650('0x13')]);router[_0x5650('0x12')](_0x5650('0x14'),auth[_0x5650('0xb')](),controller[_0x5650('0x15')]);router[_0x5650('0x12')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x16')]);router[_0x5650('0x17')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x18')]);router[_0x5650('0x19')]('/:id',auth[_0x5650('0xb')](),controller[_0x5650('0x1a')]);module[_0x5650('0x1b')]=router; \ No newline at end of file +var _0x323f=['get','/:id','show','/:id/conditions','post','create','/:id/actions','addActions','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index'];(function(_0xfefda5,_0x38d020){var _0x2bac82=function(_0xaa512){while(--_0xaa512){_0xfefda5['push'](_0xfefda5['shift']());}};_0x2bac82(++_0x38d020);}(_0x323f,0xde));var _0xf323=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x323f[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require('express');var router=express[_0xf323('0x2')]();var fs_extra=require(_0xf323('0x3'));var auth=require(_0xf323('0x4'));var interaction=require(_0xf323('0x5'));var config=require('../../config/environment');var controller=require(_0xf323('0x6'));router['get']('/',auth[_0xf323('0x7')](),controller[_0xf323('0x8')]);router[_0xf323('0x9')](_0xf323('0xa'),auth[_0xf323('0x7')](),controller[_0xf323('0xb')]);router[_0xf323('0x9')](_0xf323('0xc'),auth[_0xf323('0x7')](),controller['getConditions']);router[_0xf323('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0xf323('0xd')]('/',auth[_0xf323('0x7')](),controller[_0xf323('0xe')]);router['post'](_0xf323('0xc'),auth[_0xf323('0x7')](),controller['addConditions']);router[_0xf323('0xd')](_0xf323('0xf'),auth[_0xf323('0x7')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xa'),auth['isAuthenticated'](),controller[_0xf323('0x12')]);router[_0xf323('0x13')](_0xf323('0xa'),auth[_0xf323('0x7')](),controller['destroy']);module[_0xf323('0x14')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e40935c..bd4116a 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 _0x770f=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','INTEGER','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always'];(function(_0xdd5244,_0x26242c){var _0x3d086d=function(_0x6a9652){while(--_0x6a9652){_0xdd5244['push'](_0xdd5244['shift']());}};_0x3d086d(++_0x26242c);}(_0x770f,0x7e));var _0xf770=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x770f[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require('sequelize');module[_0xf770('0x0')]={'name':{'type':Sequelize[_0xf770('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf770('0x2')),'allowNull':![],'defaultValue':_0xf770('0x2')},'description':{'type':Sequelize[_0xf770('0x1')]},'active':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf770('0x4')](0x4)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf770('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf770('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf770('0x1')],'defaultValue':_0xf770('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xf770('0xc')](_0xf770('0xd'),_0xf770('0xe'),_0xf770('0xf')),'defaultValue':_0xf770('0xd')},'dialAMDActive':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':_0xf770('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf770('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf770('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf770('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf770('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xf770('0x17')),'defaultValue':_0xf770('0x18')},'dialPrefix':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x19')},'dialCutDigit':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x22')}}; \ No newline at end of file +var _0x20d3=['DESC','ASC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','name','ENUM','ivr','STRING','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x20d3,0xb9));var _0x320d=function(_0x25b738,_0x5c3de6){_0x25b738=_0x25b738-0x0;var _0x2c1051=_0x20d3[_0x25b738];return _0x2c1051;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x320d('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x320d('0x1')](_0x320d('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x320d('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x320d('0x4')](0x4)[_0x320d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x320d('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x320d('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)[_0x320d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'comment':_0x320d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x320d('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x320d('0x1')](_0x320d('0xd'),_0x320d('0xe'),_0x320d('0xf')),'defaultValue':_0x320d('0xd')},'dialAMDActive':{'type':Sequelize[_0x320d('0x10')],'defaultValue':0x0,'comment':_0x320d('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x320d('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x320d('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x320d('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x320d('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x320d('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x320d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x320d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x320d('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x320d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x320d('0x1')](_0x320d('0x19'),_0x320d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x320d('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x320d('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)[_0x320d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 2246e0e..9a8c4bf 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 _0x667f=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Campaign','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','role','params','getHoppers','findOne','keys','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','insert','cm_contacts','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x3a096c,_0x440950){var _0x25173a=function(_0x341a97){while(--_0x341a97){_0x3a096c['push'](_0x3a096c['shift']());}};_0x25173a(++_0x440950);}(_0x667f,0xd7));var _0xf667=function(_0x2936d8,_0x2e415a){_0x2936d8=_0x2936d8-0x0;var _0x194e7b=_0x667f[_0x2936d8];return _0x194e7b;};'use strict';var emlformat=require(_0xf667('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf667('0x1'));var moment=require(_0xf667('0x2'));var BPromise=require(_0xf667('0x3'));var Mustache=require(_0xf667('0x4'));var util=require(_0xf667('0x5'));var path=require(_0xf667('0x6'));var sox=require('sox');var csv=require(_0xf667('0x7'));var ejs=require(_0xf667('0x8'));var fs=require('fs');var fs_extra=require(_0xf667('0x9'));var _=require(_0xf667('0xa'));var squel=require(_0xf667('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf667('0x7'));var querystring=require(_0xf667('0xc'));var Papa=require('papaparse');var Redis=require(_0xf667('0xd'));var authService=require(_0xf667('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf667('0xf'));var hardwareService=require(_0xf667('0x10'));var logger=require(_0xf667('0x11'))(_0xf667('0x12'));var utils=require(_0xf667('0x13'));var config=require(_0xf667('0x14'));var licenseUtil=require(_0xf667('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18191c,_0xd26c39){_0xd26c39=_0xd26c39||0xcc;return function(_0x40d3f4){if(_0x40d3f4){return _0x18191c[_0xf667('0x16')](_0xd26c39);}return _0x18191c[_0xf667('0x17')](_0xd26c39)[_0xf667('0x18')]();};}function respondWithResult(_0x42291d,_0xacafb3){_0xacafb3=_0xacafb3||0xc8;return function(_0x4cf66f){if(_0x4cf66f){return _0x42291d[_0xf667('0x17')](_0xacafb3)[_0xf667('0x19')](_0x4cf66f);}};}function respondWithFilteredResult(_0x32d0c7,_0x53d2c8){return function(_0x5c7b45){if(_0x5c7b45){var _0x11ac7f=typeof _0x53d2c8[_0xf667('0x1a')]===_0xf667('0x1b')&&typeof _0x53d2c8['limit']===_0xf667('0x1b');var _0x2dbacb=_0x5c7b45[_0xf667('0x1c')];var _0x2a3ca1=_0x11ac7f?0x0:_0x53d2c8[_0xf667('0x1a')];var _0x43d1d9=_0x11ac7f?_0x5c7b45['count']:_0x53d2c8[_0xf667('0x1a')]+_0x53d2c8[_0xf667('0x1d')];var _0x1023d3;if(_0x43d1d9>=_0x2dbacb){_0x43d1d9=_0x2dbacb;_0x1023d3=0xc8;}else{_0x1023d3=0xce;}_0x32d0c7[_0xf667('0x17')](_0x1023d3);return _0x32d0c7[_0xf667('0x1e')](_0xf667('0x1f'),_0x2a3ca1+'-'+_0x43d1d9+'/'+_0x2dbacb)[_0xf667('0x19')](_0x5c7b45);}return null;};}function patchUpdates(_0x2df328){return function(_0x47b20b){try{jsonpatch[_0xf667('0x20')](_0x47b20b,_0x2df328,!![]);}catch(_0x2518e5){return BPromise[_0xf667('0x21')](_0x2518e5);}return _0x47b20b[_0xf667('0x22')]();};}function saveUpdates(_0x356fda,_0x3526e5){return function(_0x365599){if(_0x365599){return _0x365599['update'](_0x356fda)[_0xf667('0x23')](function(_0x591fba){return _0x591fba;});}return null;};}function removeEntity(_0x88efc1,_0x27b29a){return function(_0x113dbc){if(_0x113dbc){return _0x113dbc[_0xf667('0x24')]()[_0xf667('0x23')](function(){var _0x5771e3=_0x113dbc[_0xf667('0x25')]({'plain':!![]});var _0x1ecb84=_0xf667('0x26');return db[_0xf667('0x27')]['destroy']({'where':{'type':_0x1ecb84,'resourceId':_0x5771e3['id']}})['then'](function(){return _0x113dbc;});})['then'](function(){_0x88efc1[_0xf667('0x17')](0xcc)[_0xf667('0x18')]();});}};}function handleEntityNotFound(_0x38abea,_0xa306e1){return function(_0x155668){if(!_0x155668){_0x38abea[_0xf667('0x16')](0x194);}return _0x155668;};}function handleError(_0x10476a,_0x48fa0a){_0x48fa0a=_0x48fa0a||0x1f4;return function(_0x3ed845){logger[_0xf667('0x28')](_0x3ed845[_0xf667('0x29')]);if(_0x3ed845[_0xf667('0x2a')]){delete _0x3ed845[_0xf667('0x2a')];}_0x10476a['status'](_0x48fa0a)[_0xf667('0x2b')](_0x3ed845);};}exports['index']=function(_0x32a781,_0x38684f){var _0x2dd6a1={},_0x42de82={},_0x546fd5={'count':0x0,'rows':[]};var _0xc89eea=_[_0xf667('0x2c')](db['Campaign'][_0xf667('0x2d')],function(_0x424cff){return{'name':_0x424cff[_0xf667('0x2e')],'type':_0x424cff[_0xf667('0x2f')][_0xf667('0x30')]};});_0x42de82[_0xf667('0x31')]=_[_0xf667('0x2c')](_0xc89eea,_0xf667('0x2a'));_0x42de82[_0xf667('0x32')]=_['keys'](_0x32a781['query']);_0x42de82[_0xf667('0x33')]=_[_0xf667('0x34')](_0x42de82[_0xf667('0x31')],_0x42de82[_0xf667('0x32')]);_0x2dd6a1[_0xf667('0x35')]=_[_0xf667('0x34')](_0x42de82['model'],qs['fields'](_0x32a781[_0xf667('0x32')][_0xf667('0x36')]));_0x2dd6a1[_0xf667('0x35')]=_0x2dd6a1[_0xf667('0x35')][_0xf667('0x37')]?_0x2dd6a1[_0xf667('0x35')]:_0x42de82[_0xf667('0x31')];if(!_0x32a781['query'][_0xf667('0x38')]('nolimit')){_0x2dd6a1[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x32a781[_0xf667('0x32')][_0xf667('0x1d')]);_0x2dd6a1[_0xf667('0x1a')]=qs['offset'](_0x32a781['query'][_0xf667('0x1a')]);}_0x2dd6a1[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x32a781['query'][_0xf667('0x3a')]);_0x2dd6a1[_0xf667('0x3b')]=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x32a781['query'],_0x42de82[_0xf667('0x33')]),_0xc89eea);if(_0x32a781[_0xf667('0x32')][_0xf667('0x3d')]){_0x2dd6a1[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x2dd6a1['where'],{'$or':_['map'](_0xc89eea,function(_0x16243d){if(_0x16243d[_0xf667('0x2f')]!==_0xf667('0x3f')){var _0x278704={};_0x278704[_0x16243d[_0xf667('0x2a')]]={'$like':'%'+_0x32a781['query']['filter']+'%'};return _0x278704;}})});}_0x2dd6a1=_[_0xf667('0x3e')]({},_0x2dd6a1,_0x32a781[_0xf667('0x40')]);var _0x4a17d1={'where':_0x2dd6a1[_0xf667('0x3b')]};return db['Campaign'][_0xf667('0x1c')](_0x4a17d1)[_0xf667('0x23')](function(_0x2b0ec9){_0x546fd5['count']=_0x2b0ec9;if(_0x32a781[_0xf667('0x32')][_0xf667('0x41')]){_0x2dd6a1[_0xf667('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xf667('0x43')](_0x2dd6a1);})[_0xf667('0x23')](function(_0x524bc9){_0x546fd5[_0xf667('0x44')]=_0x524bc9;return _0x546fd5;})[_0xf667('0x23')](respondWithFilteredResult(_0x38684f,_0x2dd6a1))['catch'](handleError(_0x38684f,null));};exports[_0xf667('0x45')]=function(_0x5cebe8,_0x103097){var _0x1b0ab7={'raw':![],'where':{'id':_0x5cebe8['params']['id']}},_0x53b86b={};_0x53b86b['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x53b86b[_0xf667('0x32')]=_['keys'](_0x5cebe8[_0xf667('0x32')]);_0x53b86b[_0xf667('0x33')]=_['intersection'](_0x53b86b[_0xf667('0x31')],_0x53b86b['query']);_0x1b0ab7[_0xf667('0x35')]=_[_0xf667('0x34')](_0x53b86b['model'],qs['fields'](_0x5cebe8['query']['fields']));_0x1b0ab7[_0xf667('0x35')]=_0x1b0ab7[_0xf667('0x35')]['length']?_0x1b0ab7['attributes']:_0x53b86b['model'];if(_0x5cebe8[_0xf667('0x32')][_0xf667('0x41')]){_0x1b0ab7[_0xf667('0x42')]=[{'all':!![]}];}_0x1b0ab7=_[_0xf667('0x3e')]({},_0x1b0ab7,_0x5cebe8[_0xf667('0x40')]);return db['Campaign']['find'](_0x1b0ab7)[_0xf667('0x23')](handleEntityNotFound(_0x103097,null))[_0xf667('0x23')](respondWithResult(_0x103097,null))['catch'](handleError(_0x103097,null));};exports['create']=function(_0x2bd50b,_0x38b07b){return db['Campaign']['create'](_0x2bd50b[_0xf667('0x47')],{})[_0xf667('0x23')](function(_0x4c0e35){var _0x51800f=_0x2bd50b[_0xf667('0x48')][_0xf667('0x25')]({'plain':!![]});if(!_0x51800f)throw new Error(_0xf667('0x49'));if(_0x51800f['role']===_0xf667('0x48')){var _0x53a69b=_0x4c0e35['get']({'plain':!![]});var _0x1f6e5e=_0xf667('0x26');return db[_0xf667('0x4a')]['find']({'where':{'name':_0x1f6e5e,'userProfileId':_0x51800f[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x3c2109){if(_0x3c2109&&_0x3c2109[_0xf667('0x4c')]===0x0){return db['UserProfileResource'][_0xf667('0x4d')]({'name':_0x53a69b[_0xf667('0x2a')],'resourceId':_0x53a69b['id'],'type':_0x3c2109[_0xf667('0x2a')],'sectionId':_0x3c2109['id']},{})[_0xf667('0x23')](function(){return _0x4c0e35;});}else{return _0x4c0e35;}})[_0xf667('0x4e')](function(_0x1488f4){logger[_0xf667('0x28')](_0xf667('0x4f'),_0x1488f4);throw _0x1488f4;});}return _0x4c0e35;})[_0xf667('0x23')](respondWithResult(_0x38b07b,0xc9))[_0xf667('0x4e')](handleError(_0x38b07b,null));};exports[_0xf667('0x50')]=function(_0x54c42c,_0x5793d1){var _0x47331e={'where':{'id':_0x54c42c['params']['id']}},_0xf17602={};_0xf17602['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x47331e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xf17602[_0xf667('0x31')],qs[_0xf667('0x36')](_0x54c42c[_0xf667('0x32')][_0xf667('0x36')]));_0x47331e[_0xf667('0x35')]=_0x47331e[_0xf667('0x35')][_0xf667('0x37')]?_0x47331e[_0xf667('0x35')]:_0xf17602[_0xf667('0x31')];if(_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]){_0x47331e[_0xf667('0x42')]=[{'all':!![]}];}_0x47331e=_[_0xf667('0x3e')]({},_0x47331e,_0x54c42c[_0xf667('0x40')]);return db['Campaign'][_0xf667('0x51')](_0x47331e)[_0xf667('0x23')](handleEntityNotFound(_0x5793d1,null))[_0xf667('0x23')](function(_0x2c2019){if(_0x2c2019){var _0x2f5f98=_0x2c2019['get']({'plain':!![]});_0x2f5f98=qs[_0xf667('0x52')](_0x2f5f98,['id',_0xf667('0x53'),_0xf667('0x54')]);_0x54c42c[_0xf667('0x47')]=_[_0xf667('0x52')](_0x54c42c[_0xf667('0x47')],['id',_0xf667('0x53'),_0xf667('0x54')]);return db[_0xf667('0x46')][_0xf667('0x4d')](_[_0xf667('0x3e')](_0x2f5f98,_0x54c42c[_0xf667('0x47')]),{'include':_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]?[{'all':!![]}]:undefined})[_0xf667('0x23')](function(_0xd60942){var _0x492910=_0x54c42c[_0xf667('0x48')]['get']({'plain':!![]});if(!_0x492910)throw new Error(_0xf667('0x49'));if(_0x492910[_0xf667('0x55')]===_0xf667('0x48')){var _0x545eed=_0xd60942[_0xf667('0x25')]({'plain':!![]});var _0xbe9ac5='IvrCampaigns';return db[_0xf667('0x4a')][_0xf667('0x51')]({'where':{'name':_0xbe9ac5,'userProfileId':_0x492910[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x27afc5){if(_0x27afc5&&_0x27afc5[_0xf667('0x4c')]===0x0){return db[_0xf667('0x27')][_0xf667('0x4d')]({'name':_0x545eed[_0xf667('0x2a')],'resourceId':_0x545eed['id'],'type':_0x27afc5[_0xf667('0x2a')],'sectionId':_0x27afc5['id']},{})[_0xf667('0x23')](function(){return _0xd60942;});}else{return _0xd60942;}})[_0xf667('0x4e')](function(_0x27f0e4){logger[_0xf667('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f0e4);throw _0x27f0e4;});}return _0xd60942;});}})[_0xf667('0x23')](respondWithResult(_0x5793d1,0xc9))[_0xf667('0x4e')](handleError(_0x5793d1,null));};exports['update']=function(_0x356967,_0xc4a95a){if(_0x356967[_0xf667('0x47')]['id']){delete _0x356967[_0xf667('0x47')]['id'];}return db['Campaign'][_0xf667('0x51')]({'where':{'id':_0x356967[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xc4a95a,null))[_0xf667('0x23')](saveUpdates(_0x356967[_0xf667('0x47')],null))[_0xf667('0x23')](respondWithResult(_0xc4a95a,null))[_0xf667('0x4e')](handleError(_0xc4a95a,null));};exports[_0xf667('0x24')]=function(_0x5ec5bd,_0x4d1c9f){return db[_0xf667('0x46')]['find']({'where':{'id':_0x5ec5bd[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d1c9f,null))[_0xf667('0x23')](removeEntity(_0x4d1c9f,null))[_0xf667('0x4e')](handleError(_0x4d1c9f,null));};exports[_0xf667('0x57')]=function(_0x1292ac,_0x41a531,_0x29e344){var _0x4f696c={'raw':!![],'where':{}};var _0x4ba6ad={};var _0x53d070={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x1292ac[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x41a531,null))[_0xf667('0x23')](function(_0x2a82e0){if(_0x2a82e0){_0x4ba6ad['model']=_[_0xf667('0x59')](db['CmHopper'][_0xf667('0x2d')]);_0x4ba6ad[_0xf667('0x32')]=_[_0xf667('0x59')](_0x1292ac[_0xf667('0x32')]);_0x4ba6ad[_0xf667('0x33')]=_[_0xf667('0x34')](_0x4ba6ad[_0xf667('0x31')],_0x4ba6ad['query']);_0x4f696c['attributes']=_[_0xf667('0x34')](_0x4ba6ad['model'],qs[_0xf667('0x36')](_0x1292ac['query']['fields']));_0x4f696c['attributes']=_0x4f696c['attributes'][_0xf667('0x37')]?_0x4f696c[_0xf667('0x35')]:_0x4ba6ad[_0xf667('0x31')];if(!_0x1292ac['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x4f696c[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1d')]);_0x4f696c[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1a')]);}_0x4f696c[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x3a')]);_0x4f696c[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x1292ac[_0xf667('0x32')],_0x4ba6ad['filters']));_0x4f696c[_0xf667('0x3b')][_0xf667('0x5b')]=_0x2a82e0['id'];if(_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]){_0x4f696c[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x4f696c['where'],{'$or':_[_0xf667('0x2c')](_0x4f696c['attributes'],function(_0x486a2b){var _0x58c798={};_0x58c798[_0x486a2b]={'$like':'%'+_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x58c798;})});}_0x4f696c=_[_0xf667('0x3e')]({},_0x4f696c,_0x1292ac[_0xf667('0x40')]);return db[_0xf667('0x5c')][_0xf667('0x1c')]({'where':_0x4f696c['where']})[_0xf667('0x23')](function(_0xeadd64){_0x53d070[_0xf667('0x1c')]=_0xeadd64;if(_0x1292ac[_0xf667('0x32')][_0xf667('0x41')]){_0x4f696c[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5c')][_0xf667('0x43')](_0x4f696c);})[_0xf667('0x23')](function(_0x3741c9){_0x53d070[_0xf667('0x44')]=_0x3741c9;return _0x53d070;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x41a531,_0x4f696c))[_0xf667('0x4e')](handleError(_0x41a531,null));};exports[_0xf667('0x5d')]=function(_0x269bea,_0x263c78,_0x1ca672){var _0x28f356={'raw':!![],'where':{}};var _0x1e44c1={};var _0x25fe40={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x269bea[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x263c78,null))[_0xf667('0x23')](function(_0x3c70f2){if(_0x3c70f2){_0x1e44c1['model']=_[_0xf667('0x59')](db[_0xf667('0x5e')][_0xf667('0x2d')]);_0x1e44c1['query']=_['keys'](_0x269bea[_0xf667('0x32')]);_0x1e44c1[_0xf667('0x33')]=_[_0xf667('0x34')](_0x1e44c1[_0xf667('0x31')],_0x1e44c1['query']);_0x28f356[_0xf667('0x35')]=_[_0xf667('0x34')](_0x1e44c1['model'],qs[_0xf667('0x36')](_0x269bea['query']['fields']));_0x28f356['attributes']=_0x28f356[_0xf667('0x35')][_0xf667('0x37')]?_0x28f356[_0xf667('0x35')]:_0x1e44c1[_0xf667('0x31')];if(!_0x269bea['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x28f356[_0xf667('0x1d')]=qs['limit'](_0x269bea[_0xf667('0x32')][_0xf667('0x1d')]);_0x28f356[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x269bea['query'][_0xf667('0x1a')]);}_0x28f356[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x269bea['query'][_0xf667('0x3a')]);_0x28f356['where']=qs[_0xf667('0x33')](_['pick'](_0x269bea[_0xf667('0x32')],_0x1e44c1[_0xf667('0x33')]));_0x28f356[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3c70f2['id'];if(_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]){_0x28f356[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x28f356[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x28f356[_0xf667('0x35')],function(_0x47e677){var _0x2ba145={};_0x2ba145[_0x47e677]={'$like':'%'+_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x2ba145;})});}_0x28f356=_[_0xf667('0x3e')]({},_0x28f356,_0x269bea[_0xf667('0x40')]);return db[_0xf667('0x5e')][_0xf667('0x1c')]({'where':_0x28f356['where']})[_0xf667('0x23')](function(_0x5175dd){_0x25fe40[_0xf667('0x1c')]=_0x5175dd;if(_0x269bea['query'][_0xf667('0x41')]){_0x28f356[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5e')][_0xf667('0x43')](_0x28f356);})[_0xf667('0x23')](function(_0x54cb54){_0x25fe40[_0xf667('0x44')]=_0x54cb54;return _0x25fe40;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x263c78,_0x28f356))['catch'](handleError(_0x263c78,null));};exports['getHopperFinals']=function(_0x49f523,_0x461c01,_0x503745){var _0x5c6d8e={'raw':!![],'where':{}};var _0xe16cc={};var _0x327947={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x49f523[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x461c01,null))['then'](function(_0x3ba57c){if(_0x3ba57c){_0xe16cc[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x5f')][_0xf667('0x2d')]);_0xe16cc[_0xf667('0x32')]=_['keys'](_0x49f523[_0xf667('0x32')]);_0xe16cc[_0xf667('0x33')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],_0xe16cc[_0xf667('0x32')]);_0x5c6d8e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],qs[_0xf667('0x36')](_0x49f523[_0xf667('0x32')]['fields']));_0x5c6d8e[_0xf667('0x35')]=_0x5c6d8e['attributes']['length']?_0x5c6d8e[_0xf667('0x35')]:_0xe16cc['model'];if(!_0x49f523[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x5c6d8e[_0xf667('0x1d')]=qs['limit'](_0x49f523[_0xf667('0x32')][_0xf667('0x1d')]);_0x5c6d8e[_0xf667('0x1a')]=qs['offset'](_0x49f523[_0xf667('0x32')]['offset']);}_0x5c6d8e[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x49f523[_0xf667('0x32')][_0xf667('0x3a')]);_0x5c6d8e[_0xf667('0x3b')]=qs[_0xf667('0x33')](_['pick'](_0x49f523['query'],_0xe16cc[_0xf667('0x33')]));_0x5c6d8e[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3ba57c['id'];if(_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]){_0x5c6d8e[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x5c6d8e[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x5c6d8e['attributes'],function(_0x522627){var _0x54b807={};_0x54b807[_0x522627]={'$like':'%'+_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x54b807;})});}_0x5c6d8e=_[_0xf667('0x3e')]({},_0x5c6d8e,_0x49f523[_0xf667('0x40')]);return db[_0xf667('0x5f')][_0xf667('0x1c')]({'where':_0x5c6d8e[_0xf667('0x3b')]})['then'](function(_0x5c8995){_0x327947['count']=_0x5c8995;if(_0x49f523[_0xf667('0x32')][_0xf667('0x41')]){_0x5c6d8e[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5f')][_0xf667('0x43')](_0x5c6d8e);})[_0xf667('0x23')](function(_0xcd18c5){_0x327947[_0xf667('0x44')]=_0xcd18c5;return _0x327947;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x461c01,_0x5c6d8e))[_0xf667('0x4e')](handleError(_0x461c01,null));};exports['getHopperBlacks']=function(_0x2071c8,_0x56a540,_0x5bb40b){var _0x118db7={'raw':!![],'where':{}};var _0x2a57b2={};var _0x100365={'count':0x0,'rows':[]};return db['Campaign'][_0xf667('0x58')]({'where':{'id':_0x2071c8[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x56a540,null))[_0xf667('0x23')](function(_0x5211dc){if(_0x5211dc){_0x2a57b2[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x60')][_0xf667('0x2d')]);_0x2a57b2[_0xf667('0x32')]=_['keys'](_0x2071c8[_0xf667('0x32')]);_0x2a57b2['filters']=_[_0xf667('0x34')](_0x2a57b2[_0xf667('0x31')],_0x2a57b2[_0xf667('0x32')]);_0x118db7[_0xf667('0x35')]=_['intersection'](_0x2a57b2['model'],qs[_0xf667('0x36')](_0x2071c8[_0xf667('0x32')][_0xf667('0x36')]));_0x118db7[_0xf667('0x35')]=_0x118db7[_0xf667('0x35')][_0xf667('0x37')]?_0x118db7[_0xf667('0x35')]:_0x2a57b2[_0xf667('0x31')];if(!_0x2071c8[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118db7['limit']=qs['limit'](_0x2071c8['query'][_0xf667('0x1d')]);_0x118db7[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x1a')]);}_0x118db7[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x3a')]);_0x118db7[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x2071c8['query'],_0x2a57b2[_0xf667('0x33')]));_0x118db7[_0xf667('0x3b')][_0xf667('0x5b')]=_0x5211dc['id'];if(_0x2071c8[_0xf667('0x32')][_0xf667('0x3d')]){_0x118db7['where']=_[_0xf667('0x3e')](_0x118db7['where'],{'$or':_[_0xf667('0x2c')](_0x118db7[_0xf667('0x35')],function(_0x586c58){var _0x542bf2={};_0x542bf2[_0x586c58]={'$like':'%'+_0x2071c8[_0xf667('0x32')]['filter']+'%'};return _0x542bf2;})});}_0x118db7=_[_0xf667('0x3e')]({},_0x118db7,_0x2071c8[_0xf667('0x40')]);return db[_0xf667('0x60')]['count']({'where':_0x118db7[_0xf667('0x3b')]})[_0xf667('0x23')](function(_0x18d7d3){_0x100365[_0xf667('0x1c')]=_0x18d7d3;if(_0x2071c8[_0xf667('0x32')]['includeAll']){_0x118db7['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x118db7);})[_0xf667('0x23')](function(_0x4c7c59){_0x100365[_0xf667('0x44')]=_0x4c7c59;return _0x100365;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x56a540,_0x118db7))[_0xf667('0x4e')](handleError(_0x56a540,null));};exports[_0xf667('0x61')]=function(_0x68faf,_0x17b77d,_0x590071){var _0x101816={};var _0x3c9d22={};var _0x495d98;var _0x1ecc9e;return db['Campaign']['findOne']({'where':{'id':_0x68faf[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x17b77d,null))[_0xf667('0x23')](function(_0x31a4b1){if(_0x31a4b1){_0x495d98=_0x31a4b1;_0x3c9d22[_0xf667('0x31')]=_['keys'](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x3c9d22['query']=_[_0xf667('0x59')](_0x68faf[_0xf667('0x32')]);_0x3c9d22[_0xf667('0x33')]=_[_0xf667('0x34')](_0x3c9d22['model'],_0x3c9d22[_0xf667('0x32')]);_0x101816[_0xf667('0x35')]=_[_0xf667('0x34')](_0x3c9d22['model'],qs[_0xf667('0x36')](_0x68faf[_0xf667('0x32')][_0xf667('0x36')]));_0x101816[_0xf667('0x35')]=_0x101816[_0xf667('0x35')]['length']?_0x101816[_0xf667('0x35')]:_0x3c9d22[_0xf667('0x31')];_0x101816['order']=qs[_0xf667('0x3a')](_0x68faf[_0xf667('0x32')]['sort']);_0x101816[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x68faf['query'],_0x3c9d22['filters']));if(_0x68faf['query'][_0xf667('0x3d')]){_0x101816[_0xf667('0x3b')]=_['merge'](_0x101816[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x101816[_0xf667('0x35')],function(_0x28ec85){var _0x47e073={};_0x47e073[_0x28ec85]={'$like':'%'+_0x68faf[_0xf667('0x32')]['filter']+'%'};return _0x47e073;})});}_0x101816=_[_0xf667('0x3e')]({},_0x101816,_0x68faf['options']);return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x199873){if(_0x199873){_0x1ecc9e=_0x199873[_0xf667('0x37')];if(!_0x68faf[_0xf667('0x32')]['hasOwnProperty']('nolimit')){_0x101816[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x68faf[_0xf667('0x32')][_0xf667('0x1d')]);_0x101816[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x68faf['query']['offset']);}return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x4c1ea4){if(_0x4c1ea4){return _0x4c1ea4?{'count':_0x1ecc9e,'rows':_0x4c1ea4}:null;}})[_0xf667('0x23')](respondWithResult(_0x17b77d,null))['catch'](handleError(_0x17b77d,null));};exports['addLists']=function(_0x442b9c,_0xdce0c1,_0xb64b2f){var _0x3708f1,_0xba81b5;return db[_0xf667('0x46')]['find']({'where':{'id':_0x442b9c['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xdce0c1,null))[_0xf667('0x23')](function(_0x53077e){if(_0x53077e){_0xba81b5=_0x53077e;return _0x53077e[_0xf667('0x63')](_0x442b9c['body'][_0xf667('0x64')],_[_0xf667('0x52')](_0x442b9c['body'],['ids','id'])||{});}return null;})[_0xf667('0x65')](function(_0x11058d){var _0x456a1d;_0x3708f1=_0x11058d||[];var _0x2ad40b=[];if(_0x11058d){for(var _0x44753b=0x0;_0x44753b<_0x11058d['length'];_0x44753b+=0x1){var _0x524b9c=_0x11058d[_0x44753b]['get']({'plain':!![]});_0xba81b5[_0xf667('0x66')]=_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]?_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]:_0xba81b5[_0xf667('0x66')];switch(_0xba81b5['dialCheckDuplicateType']){case _0xf667('0x67'):_0x456a1d=squel['insert']()[_0xf667('0x68')]('cm_hopper')[_0xf667('0x69')]([_0xf667('0x6a'),'scheduledAt',_0xf667('0x6b'),'ListId','CampaignId','createdAt',_0xf667('0x54')],squel[_0xf667('0x6c')]()['field']('phone','phone')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')]('NOW()',_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x54'))[_0xf667('0x73')]('cm_contacts')[_0xf667('0x3b')](_0xf667('0x74'))[_0xf667('0x3b')](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76'))[_0xf667('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xf667('0x73')](_0xf667('0x77'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c['params']['id'][_0xf667('0x71')]()))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0xf667('0x7a'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))[_0xf667('0x71')]();break;case'onlyIfOpen':_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),'CampaignId',_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))['field']('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')]['toString'](),_0xf667('0x72'))['field'](_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')](),'CampaignId')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))['field'](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where']('ListId\x20=\x20?',_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76'))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x7d'))[_0xf667('0x73')](_0xf667('0x7a'))['where'](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))['toString']();break;default:_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')](['phone',_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),'ListId')[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where'](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76')))[_0xf667('0x71')]();}_0x2ad40b[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x456a1d));}return BPromise[_0xf667('0x80')](_0x2ad40b);}})[_0xf667('0x23')](function(){return _0x3708f1;})[_0xf667('0x23')](respondWithResult(_0xdce0c1,null))[_0xf667('0x4e')](handleError(_0xdce0c1,null));};exports[_0xf667('0x81')]=function(_0x5e518c,_0x1a2112,_0x2365ab){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x5e518c[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x1a2112,null))[_0xf667('0x23')](function(_0xfc3906){if(_0xfc3906){return _0xfc3906[_0xf667('0x81')](_0x5e518c[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x95d991){if(_0x95d991){return db[_0xf667('0x5c')][_0xf667('0x24')]({'where':{'ListId':_0x5e518c['query'][_0xf667('0x64')],'CampaignId':_0x5e518c[_0xf667('0x56')]['id']}})['then'](function(){return _0x95d991;});}})[_0xf667('0x23')](respondWithStatusCode(_0x1a2112,null))['catch'](handleError(_0x1a2112,null));};exports[_0xf667('0x82')]=function(_0x436cbd,_0x24a455,_0x5589f4){var _0x118ae9={};var _0x89e182={};var _0x4648df;var _0x1f7ec9;return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x436cbd[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x24a455,null))[_0xf667('0x23')](function(_0x2d4358){if(_0x2d4358){_0x4648df=_0x2d4358;_0x89e182[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x89e182[_0xf667('0x32')]=_[_0xf667('0x59')](_0x436cbd[_0xf667('0x32')]);_0x89e182['filters']=_[_0xf667('0x34')](_0x89e182[_0xf667('0x31')],_0x89e182[_0xf667('0x32')]);_0x118ae9[_0xf667('0x35')]=_['intersection'](_0x89e182[_0xf667('0x31')],qs['fields'](_0x436cbd[_0xf667('0x32')]['fields']));_0x118ae9[_0xf667('0x35')]=_0x118ae9['attributes'][_0xf667('0x37')]?_0x118ae9['attributes']:_0x89e182[_0xf667('0x31')];_0x118ae9[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x436cbd['query'][_0xf667('0x3a')]);_0x118ae9['where']=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x436cbd[_0xf667('0x32')],_0x89e182[_0xf667('0x33')]));if(_0x436cbd[_0xf667('0x32')][_0xf667('0x3d')]){_0x118ae9[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x118ae9[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x118ae9['attributes'],function(_0x55dec4){var _0x1625fc={};_0x1625fc[_0x55dec4]={'$like':'%'+_0x436cbd[_0xf667('0x32')]['filter']+'%'};return _0x1625fc;})});}_0x118ae9=_[_0xf667('0x3e')]({},_0x118ae9,_0x436cbd[_0xf667('0x40')]);return _0x4648df[_0xf667('0x82')](_0x118ae9);}})[_0xf667('0x23')](function(_0x43c99b){if(_0x43c99b){_0x1f7ec9=_0x43c99b[_0xf667('0x37')];if(!_0x436cbd[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118ae9[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x436cbd[_0xf667('0x32')][_0xf667('0x1d')]);_0x118ae9['offset']=qs['offset'](_0x436cbd[_0xf667('0x32')]['offset']);}return _0x4648df['getBlackLists'](_0x118ae9);}})[_0xf667('0x23')](function(_0x434844){if(_0x434844){return _0x434844?{'count':_0x1f7ec9,'rows':_0x434844}:null;}})[_0xf667('0x23')](respondWithResult(_0x24a455,null))[_0xf667('0x4e')](handleError(_0x24a455,null));};exports[_0xf667('0x83')]=function(_0xd209de,_0x10ecec,_0x89a5fd){var _0x4cf10e,_0x31550e;return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0xd209de['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x10ecec,null))[_0xf667('0x23')](function(_0x4b06f0){if(_0x4b06f0){_0x31550e=_0x4b06f0;return _0x4b06f0[_0xf667('0x83')](_0xd209de['body']['ids'],_[_0xf667('0x52')](_0xd209de[_0xf667('0x47')],[_0xf667('0x64'),'id'])||{});}return null;})['spread'](function(_0x15b5c0){var _0x44c602;_0x4cf10e=_0x15b5c0||[];var _0x5bb609=[];if(_0x15b5c0){for(var _0x3c8ec0=0x0;_0x3c8ec0<_0x15b5c0[_0xf667('0x37')];_0x3c8ec0+=0x1){var _0x3cdbb0=_0x15b5c0[_0x3c8ec0][_0xf667('0x25')]({'plain':!![]});_0x44c602=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x84'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel['select']()['field'](_0xf667('0x6a'),'phone')[_0xf667('0x6d')]('id','ContactId')['field'](_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0xd209de[_0xf667('0x56')]['id'][_0xf667('0x71')](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),'createdAt')[_0xf667('0x6d')]('NOW()',_0xf667('0x54'))[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')]('deletedAt\x20IS\x20NULL')[_0xf667('0x3b')](_0xf667('0x75'),_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76')))['toString']();_0x5bb609[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x44c602));}return BPromise[_0xf667('0x80')](_0x5bb609);}})['then'](function(){return _0x4cf10e;})[_0xf667('0x23')](respondWithResult(_0x10ecec,null))['catch'](handleError(_0x10ecec,null));};exports[_0xf667('0x85')]=function(_0x36d850,_0x42b038,_0x12a6ec){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x42b038,null))[_0xf667('0x23')](function(_0x47a4de){if(_0x47a4de){return _0x47a4de[_0xf667('0x85')](_0x36d850[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x5c5434){if(_0x5c5434){return db[_0xf667('0x60')][_0xf667('0x24')]({'where':{'ListId':_0x36d850['query'][_0xf667('0x64')],'CampaignId':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](function(){return _0x5c5434;});}})[_0xf667('0x23')](respondWithStatusCode(_0x42b038,null))['catch'](handleError(_0x42b038,null));}; \ No newline at end of file +var _0x4e62=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','clone','length','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','find','create','body','user'];(function(_0x475a91,_0x299ed2){var _0x3eea6e=function(_0x490b66){while(--_0x490b66){_0x475a91['push'](_0x475a91['shift']());}};_0x3eea6e(++_0x299ed2);}(_0x4e62,0x1d1));var _0x24e6=function(_0xadadf3,_0x24e12d){_0xadadf3=_0xadadf3-0x0;var _0x58b72e=_0x4e62[_0xadadf3];return _0x58b72e;};'use strict';var emlformat=require(_0x24e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24e6('0x1'));var jsonpatch=require(_0x24e6('0x2'));var rp=require(_0x24e6('0x3'));var moment=require(_0x24e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24e6('0x5'));var util=require('util');var path=require(_0x24e6('0x6'));var sox=require(_0x24e6('0x7'));var csv=require(_0x24e6('0x8'));var ejs=require(_0x24e6('0x9'));var fs=require('fs');var fs_extra=require(_0x24e6('0xa'));var _=require(_0x24e6('0xb'));var squel=require(_0x24e6('0xc'));var crypto=require(_0x24e6('0xd'));var jsforce=require(_0x24e6('0xe'));var deskjs=require(_0x24e6('0xf'));var toCsv=require(_0x24e6('0x8'));var querystring=require('querystring');var Papa=require(_0x24e6('0x10'));var Redis=require(_0x24e6('0x11'));var authService=require(_0x24e6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x24e6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24e6('0x14'))(_0x24e6('0x15'));var utils=require('../../config/utils');var config=require(_0x24e6('0x16'));var licenseUtil=require(_0x24e6('0x17'));var db=require(_0x24e6('0x18'))['db'];function respondWithStatusCode(_0x310951,_0x22656a){_0x22656a=_0x22656a||0xcc;return function(_0x2aa8bc){if(_0x2aa8bc){return _0x310951['sendStatus'](_0x22656a);}return _0x310951[_0x24e6('0x19')](_0x22656a)['end']();};}function respondWithResult(_0x86132c,_0x399a1d){_0x399a1d=_0x399a1d||0xc8;return function(_0x5f40e6){if(_0x5f40e6){return _0x86132c[_0x24e6('0x19')](_0x399a1d)[_0x24e6('0x1a')](_0x5f40e6);}};}function respondWithFilteredResult(_0xfb9817,_0x2efa21){return function(_0xad2759){if(_0xad2759){var _0x4d6812=typeof _0x2efa21[_0x24e6('0x1b')]===_0x24e6('0x1c')&&typeof _0x2efa21[_0x24e6('0x1d')]===_0x24e6('0x1c');var _0x3fd860=_0xad2759[_0x24e6('0x1e')];var _0x4d0c16=_0x4d6812?0x0:_0x2efa21[_0x24e6('0x1b')];var _0x417f19=_0x4d6812?_0xad2759['count']:_0x2efa21['offset']+_0x2efa21[_0x24e6('0x1d')];var _0x16696c;if(_0x417f19>=_0x3fd860){_0x417f19=_0x3fd860;_0x16696c=0xc8;}else{_0x16696c=0xce;}_0xfb9817['status'](_0x16696c);return _0xfb9817[_0x24e6('0x1f')](_0x24e6('0x20'),_0x4d0c16+'-'+_0x417f19+'/'+_0x3fd860)[_0x24e6('0x1a')](_0xad2759);}return null;};}function patchUpdates(_0x3db125){return function(_0x357392){try{jsonpatch[_0x24e6('0x21')](_0x357392,_0x3db125,!![]);}catch(_0x3dd7ba){return BPromise[_0x24e6('0x22')](_0x3dd7ba);}return _0x357392[_0x24e6('0x23')]();};}function saveUpdates(_0x1c84f9,_0x148475){return function(_0x318684){if(_0x318684){return _0x318684['update'](_0x1c84f9)[_0x24e6('0x24')](function(_0x277566){return _0x277566;});}return null;};}function removeEntity(_0x4953ed,_0x1ddfc3){return function(_0x2ade79){if(_0x2ade79){return _0x2ade79[_0x24e6('0x25')]()[_0x24e6('0x24')](function(){var _0x31241f=_0x2ade79[_0x24e6('0x26')]({'plain':!![]});var _0x270755=_0x24e6('0x27');return db[_0x24e6('0x28')][_0x24e6('0x25')]({'where':{'type':_0x270755,'resourceId':_0x31241f['id']}})[_0x24e6('0x24')](function(){return _0x2ade79;});})[_0x24e6('0x24')](function(){_0x4953ed[_0x24e6('0x19')](0xcc)[_0x24e6('0x29')]();});}};}function handleEntityNotFound(_0x3c2c05,_0x4a6aef){return function(_0x6bcfd9){if(!_0x6bcfd9){_0x3c2c05[_0x24e6('0x2a')](0x194);}return _0x6bcfd9;};}function handleError(_0x35c2b6,_0xa15ed9){_0xa15ed9=_0xa15ed9||0x1f4;return function(_0x3ffebb){logger[_0x24e6('0x2b')](_0x3ffebb[_0x24e6('0x2c')]);if(_0x3ffebb[_0x24e6('0x2d')]){delete _0x3ffebb[_0x24e6('0x2d')];}_0x35c2b6['status'](_0xa15ed9)['send'](_0x3ffebb);};}exports[_0x24e6('0x2e')]=function(_0x2fd4e0,_0x59c830){var _0x15107e={},_0x1155bb={},_0x523298={'count':0x0,'rows':[]};var _0x469f47=_[_0x24e6('0x2f')](db['Campaign'][_0x24e6('0x30')],function(_0x209682){return{'name':_0x209682['fieldName'],'type':_0x209682['type'][_0x24e6('0x31')]};});_0x1155bb[_0x24e6('0x32')]=_['map'](_0x469f47,_0x24e6('0x2d'));_0x1155bb[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x2fd4e0[_0x24e6('0x33')]);_0x1155bb[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x1155bb['model'],_0x1155bb[_0x24e6('0x33')]);_0x15107e[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x1155bb[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x2fd4e0[_0x24e6('0x33')]['fields']));_0x15107e[_0x24e6('0x37')]=_0x15107e[_0x24e6('0x37')]['length']?_0x15107e[_0x24e6('0x37')]:_0x1155bb[_0x24e6('0x32')];if(!_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x39')](_0x24e6('0x3a'))){_0x15107e['limit']=qs[_0x24e6('0x1d')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x15107e[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x15107e[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x15107e['where']=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x2fd4e0[_0x24e6('0x33')],_0x1155bb[_0x24e6('0x35')]),_0x469f47);if(_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x15107e[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x15107e[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x469f47,function(_0x2c5734){if(_0x2c5734['type']!==_0x24e6('0x41')){var _0x449614={};_0x449614[_0x2c5734['name']]={'$like':'%'+_0x2fd4e0['query'][_0x24e6('0x3e')]+'%'};return _0x449614;}})});}_0x15107e=_[_0x24e6('0x40')]({},_0x15107e,_0x2fd4e0[_0x24e6('0x42')]);var _0x278fe5={'where':_0x15107e[_0x24e6('0x3f')]};return db[_0x24e6('0x43')][_0x24e6('0x1e')](_0x278fe5)[_0x24e6('0x24')](function(_0x4e2ce0){_0x523298['count']=_0x4e2ce0;if(_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x44')]){_0x15107e[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x43')][_0x24e6('0x46')](_0x15107e);})[_0x24e6('0x24')](function(_0x338c7a){_0x523298[_0x24e6('0x47')]=_0x338c7a;return _0x523298;})[_0x24e6('0x24')](respondWithFilteredResult(_0x59c830,_0x15107e))[_0x24e6('0x48')](handleError(_0x59c830,null));};exports[_0x24e6('0x49')]=function(_0xad3cef,_0x22550e){var _0x239c02={'raw':![],'where':{'id':_0xad3cef[_0x24e6('0x4a')]['id']}},_0x175dd9={};_0x175dd9['model']=_[_0x24e6('0x34')](db[_0x24e6('0x43')][_0x24e6('0x30')]);_0x175dd9['query']=_['keys'](_0xad3cef[_0x24e6('0x33')]);_0x175dd9[_0x24e6('0x35')]=_['intersection'](_0x175dd9[_0x24e6('0x32')],_0x175dd9[_0x24e6('0x33')]);_0x239c02[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x175dd9[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0xad3cef[_0x24e6('0x33')]['fields']));_0x239c02[_0x24e6('0x37')]=_0x239c02['attributes']['length']?_0x239c02['attributes']:_0x175dd9[_0x24e6('0x32')];if(_0xad3cef[_0x24e6('0x33')][_0x24e6('0x44')]){_0x239c02[_0x24e6('0x45')]=[{'all':!![]}];}_0x239c02=_[_0x24e6('0x40')]({},_0x239c02,_0xad3cef['options']);return db[_0x24e6('0x43')][_0x24e6('0x4b')](_0x239c02)['then'](handleEntityNotFound(_0x22550e,null))[_0x24e6('0x24')](respondWithResult(_0x22550e,null))[_0x24e6('0x48')](handleError(_0x22550e,null));};exports[_0x24e6('0x4c')]=function(_0x4ef050,_0x57aaf0){return db[_0x24e6('0x43')][_0x24e6('0x4c')](_0x4ef050[_0x24e6('0x4d')],{})[_0x24e6('0x24')](function(_0x4a481d){var _0x1ae248=_0x4ef050[_0x24e6('0x4e')][_0x24e6('0x26')]({'plain':!![]});if(!_0x1ae248)throw new Error(_0x24e6('0x4f'));if(_0x1ae248['role']===_0x24e6('0x4e')){var _0x467076=_0x4a481d[_0x24e6('0x26')]({'plain':!![]});var _0x401f88='IvrCampaigns';return db[_0x24e6('0x50')][_0x24e6('0x4b')]({'where':{'name':_0x401f88,'userProfileId':_0x1ae248['userProfileId']},'raw':!![]})['then'](function(_0x19ed45){if(_0x19ed45&&_0x19ed45['autoAssociation']===0x0){return db[_0x24e6('0x28')][_0x24e6('0x4c')]({'name':_0x467076[_0x24e6('0x2d')],'resourceId':_0x467076['id'],'type':_0x19ed45[_0x24e6('0x2d')],'sectionId':_0x19ed45['id']},{})[_0x24e6('0x24')](function(){return _0x4a481d;});}else{return _0x4a481d;}})['catch'](function(_0x507c29){logger[_0x24e6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x507c29);throw _0x507c29;});}return _0x4a481d;})[_0x24e6('0x24')](respondWithResult(_0x57aaf0,0xc9))[_0x24e6('0x48')](handleError(_0x57aaf0,null));};exports[_0x24e6('0x51')]=function(_0x215640,_0x368bc3){var _0x567abf={'where':{'id':_0x215640[_0x24e6('0x4a')]['id']}},_0x292934={};_0x292934['model']=_[_0x24e6('0x34')](db[_0x24e6('0x43')][_0x24e6('0x30')]);_0x567abf['attributes']=_[_0x24e6('0x36')](_0x292934[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x215640[_0x24e6('0x33')][_0x24e6('0x38')]));_0x567abf[_0x24e6('0x37')]=_0x567abf[_0x24e6('0x37')][_0x24e6('0x52')]?_0x567abf['attributes']:_0x292934[_0x24e6('0x32')];if(_0x215640[_0x24e6('0x33')][_0x24e6('0x44')]){_0x567abf[_0x24e6('0x45')]=[{'all':!![]}];}_0x567abf=_['merge']({},_0x567abf,_0x215640['options']);return db[_0x24e6('0x43')]['find'](_0x567abf)[_0x24e6('0x24')](handleEntityNotFound(_0x368bc3,null))['then'](function(_0x406bcd){if(_0x406bcd){var _0x42701a=_0x406bcd[_0x24e6('0x26')]({'plain':!![]});_0x42701a=qs[_0x24e6('0x53')](_0x42701a,['id','createdAt','updatedAt']);_0x215640[_0x24e6('0x4d')]=_[_0x24e6('0x53')](_0x215640[_0x24e6('0x4d')],['id',_0x24e6('0x54'),_0x24e6('0x55')]);return db[_0x24e6('0x43')]['create'](_[_0x24e6('0x40')](_0x42701a,_0x215640[_0x24e6('0x4d')]),{'include':_0x215640[_0x24e6('0x33')][_0x24e6('0x44')]?[{'all':!![]}]:undefined})[_0x24e6('0x24')](function(_0x51c3b9){var _0x59706b=_0x215640['user']['get']({'plain':!![]});if(!_0x59706b)throw new Error(_0x24e6('0x4f'));if(_0x59706b['role']===_0x24e6('0x4e')){var _0x325f89=_0x51c3b9[_0x24e6('0x26')]({'plain':!![]});var _0x4330dc=_0x24e6('0x27');return db[_0x24e6('0x50')][_0x24e6('0x4b')]({'where':{'name':_0x4330dc,'userProfileId':_0x59706b[_0x24e6('0x56')]},'raw':!![]})[_0x24e6('0x24')](function(_0x1760b6){if(_0x1760b6&&_0x1760b6[_0x24e6('0x57')]===0x0){return db[_0x24e6('0x28')][_0x24e6('0x4c')]({'name':_0x325f89[_0x24e6('0x2d')],'resourceId':_0x325f89['id'],'type':_0x1760b6['name'],'sectionId':_0x1760b6['id']},{})['then'](function(){return _0x51c3b9;});}else{return _0x51c3b9;}})[_0x24e6('0x48')](function(_0x157f42){logger[_0x24e6('0x2b')](_0x24e6('0x58'),_0x157f42);throw _0x157f42;});}return _0x51c3b9;});}})[_0x24e6('0x24')](respondWithResult(_0x368bc3,0xc9))[_0x24e6('0x48')](handleError(_0x368bc3,null));};exports[_0x24e6('0x59')]=function(_0x41debd,_0x4303d4){if(_0x41debd[_0x24e6('0x4d')]['id']){delete _0x41debd[_0x24e6('0x4d')]['id'];}return db[_0x24e6('0x43')]['find']({'where':{'id':_0x41debd[_0x24e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4303d4,null))[_0x24e6('0x24')](saveUpdates(_0x41debd['body'],null))[_0x24e6('0x24')](respondWithResult(_0x4303d4,null))[_0x24e6('0x48')](handleError(_0x4303d4,null));};exports[_0x24e6('0x25')]=function(_0x31d4db,_0x4c489e){return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x31d4db[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x4c489e,null))['then'](removeEntity(_0x4c489e,null))[_0x24e6('0x48')](handleError(_0x4c489e,null));};exports[_0x24e6('0x5a')]=function(_0x17626d,_0x6e59f2,_0x29fbfd){var _0xe12cdc={'raw':!![],'where':{}};var _0x47bf99={};var _0x2ec732={'count':0x0,'rows':[]};return db[_0x24e6('0x43')]['findOne']({'where':{'id':_0x17626d[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x6e59f2,null))[_0x24e6('0x24')](function(_0x3fbf9e){if(_0x3fbf9e){_0x47bf99['model']=_[_0x24e6('0x34')](db[_0x24e6('0x5b')][_0x24e6('0x30')]);_0x47bf99['query']=_['keys'](_0x17626d[_0x24e6('0x33')]);_0x47bf99[_0x24e6('0x35')]=_['intersection'](_0x47bf99[_0x24e6('0x32')],_0x47bf99['query']);_0xe12cdc[_0x24e6('0x37')]=_['intersection'](_0x47bf99[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x17626d[_0x24e6('0x33')]['fields']));_0xe12cdc[_0x24e6('0x37')]=_0xe12cdc[_0x24e6('0x37')][_0x24e6('0x52')]?_0xe12cdc[_0x24e6('0x37')]:_0x47bf99[_0x24e6('0x32')];if(!_0x17626d[_0x24e6('0x33')][_0x24e6('0x39')](_0x24e6('0x3a'))){_0xe12cdc[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x1d')]);_0xe12cdc[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0xe12cdc['order']=qs[_0x24e6('0x3c')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x3c')]);_0xe12cdc[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x17626d['query'],_0x47bf99[_0x24e6('0x35')]));_0xe12cdc['where'][_0x24e6('0x5c')]=_0x3fbf9e['id'];if(_0x17626d[_0x24e6('0x33')][_0x24e6('0x3e')]){_0xe12cdc[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0xe12cdc['where'],{'$or':_[_0x24e6('0x2f')](_0xe12cdc[_0x24e6('0x37')],function(_0x1590cc){var _0x5841f1={};_0x5841f1[_0x1590cc]={'$like':'%'+_0x17626d[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x5841f1;})});}_0xe12cdc=_[_0x24e6('0x40')]({},_0xe12cdc,_0x17626d[_0x24e6('0x42')]);return db[_0x24e6('0x5b')][_0x24e6('0x1e')]({'where':_0xe12cdc[_0x24e6('0x3f')]})[_0x24e6('0x24')](function(_0x2a1b5c){_0x2ec732[_0x24e6('0x1e')]=_0x2a1b5c;if(_0x17626d[_0x24e6('0x33')][_0x24e6('0x44')]){_0xe12cdc[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x5b')]['findAll'](_0xe12cdc);})[_0x24e6('0x24')](function(_0x38eda0){_0x2ec732['rows']=_0x38eda0;return _0x2ec732;});}})[_0x24e6('0x24')](respondWithFilteredResult(_0x6e59f2,_0xe12cdc))['catch'](handleError(_0x6e59f2,null));};exports[_0x24e6('0x5d')]=function(_0x16c5b2,_0x20cd56,_0x13a616){var _0x624440={'raw':!![],'where':{}};var _0x3bb31e={};var _0xc63b61={'count':0x0,'rows':[]};return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x16c5b2[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x20cd56,null))[_0x24e6('0x24')](function(_0x49e6fa){if(_0x49e6fa){_0x3bb31e['model']=_['keys'](db['CmHopperHistory'][_0x24e6('0x30')]);_0x3bb31e[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x16c5b2[_0x24e6('0x33')]);_0x3bb31e[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x3bb31e['model'],_0x3bb31e[_0x24e6('0x33')]);_0x624440[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x3bb31e['model'],qs[_0x24e6('0x38')](_0x16c5b2[_0x24e6('0x33')]['fields']));_0x624440['attributes']=_0x624440[_0x24e6('0x37')]['length']?_0x624440[_0x24e6('0x37')]:_0x3bb31e[_0x24e6('0x32')];if(!_0x16c5b2[_0x24e6('0x33')]['hasOwnProperty'](_0x24e6('0x3a'))){_0x624440[_0x24e6('0x1d')]=qs['limit'](_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x624440[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x16c5b2['query'][_0x24e6('0x1b')]);}_0x624440[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x624440[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_['pick'](_0x16c5b2[_0x24e6('0x33')],_0x3bb31e[_0x24e6('0x35')]));_0x624440[_0x24e6('0x3f')][_0x24e6('0x5c')]=_0x49e6fa['id'];if(_0x16c5b2[_0x24e6('0x33')]['filter']){_0x624440['where']=_[_0x24e6('0x40')](_0x624440[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x624440[_0x24e6('0x37')],function(_0x59e87f){var _0x2f3c0a={};_0x2f3c0a[_0x59e87f]={'$like':'%'+_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x2f3c0a;})});}_0x624440=_[_0x24e6('0x40')]({},_0x624440,_0x16c5b2['options']);return db[_0x24e6('0x5f')][_0x24e6('0x1e')]({'where':_0x624440[_0x24e6('0x3f')]})[_0x24e6('0x24')](function(_0x12c299){_0xc63b61[_0x24e6('0x1e')]=_0x12c299;if(_0x16c5b2['query'][_0x24e6('0x44')]){_0x624440['include']=[{'all':!![]}];}return db[_0x24e6('0x5f')][_0x24e6('0x46')](_0x624440);})[_0x24e6('0x24')](function(_0x4fc862){_0xc63b61[_0x24e6('0x47')]=_0x4fc862;return _0xc63b61;});}})[_0x24e6('0x24')](respondWithFilteredResult(_0x20cd56,_0x624440))['catch'](handleError(_0x20cd56,null));};exports[_0x24e6('0x60')]=function(_0x29d0bf,_0x337187,_0x13e93b){var _0x5a3277={'raw':!![],'where':{}};var _0x5aeaae={};var _0x3da5db={'count':0x0,'rows':[]};return db['Campaign'][_0x24e6('0x5e')]({'where':{'id':_0x29d0bf[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x337187,null))[_0x24e6('0x24')](function(_0x1f9b88){if(_0x1f9b88){_0x5aeaae[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x61')][_0x24e6('0x30')]);_0x5aeaae['query']=_[_0x24e6('0x34')](_0x29d0bf['query']);_0x5aeaae[_0x24e6('0x35')]=_['intersection'](_0x5aeaae[_0x24e6('0x32')],_0x5aeaae[_0x24e6('0x33')]);_0x5a3277[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x5aeaae[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x38')]));_0x5a3277[_0x24e6('0x37')]=_0x5a3277[_0x24e6('0x37')][_0x24e6('0x52')]?_0x5a3277[_0x24e6('0x37')]:_0x5aeaae[_0x24e6('0x32')];if(!_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x39')]('nolimit')){_0x5a3277[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x29d0bf['query'][_0x24e6('0x1d')]);_0x5a3277[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x5a3277[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x5a3277[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x29d0bf[_0x24e6('0x33')],_0x5aeaae[_0x24e6('0x35')]));_0x5a3277[_0x24e6('0x3f')][_0x24e6('0x5c')]=_0x1f9b88['id'];if(_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x5a3277[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x5a3277[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x5a3277[_0x24e6('0x37')],function(_0x507686){var _0x6f6d92={};_0x6f6d92[_0x507686]={'$like':'%'+_0x29d0bf['query'][_0x24e6('0x3e')]+'%'};return _0x6f6d92;})});}_0x5a3277=_['merge']({},_0x5a3277,_0x29d0bf[_0x24e6('0x42')]);return db[_0x24e6('0x61')][_0x24e6('0x1e')]({'where':_0x5a3277[_0x24e6('0x3f')]})['then'](function(_0x3b4bb5){_0x3da5db['count']=_0x3b4bb5;if(_0x29d0bf[_0x24e6('0x33')]['includeAll']){_0x5a3277['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x24e6('0x46')](_0x5a3277);})[_0x24e6('0x24')](function(_0xc90e30){_0x3da5db[_0x24e6('0x47')]=_0xc90e30;return _0x3da5db;});}})['then'](respondWithFilteredResult(_0x337187,_0x5a3277))[_0x24e6('0x48')](handleError(_0x337187,null));};exports[_0x24e6('0x62')]=function(_0x5df3d3,_0x3784da,_0x3bea97){var _0x1c9005={'raw':!![],'where':{}};var _0x5d906b={};var _0x4b70b6={'count':0x0,'rows':[]};return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x5df3d3[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x3784da,null))[_0x24e6('0x24')](function(_0x42908e){if(_0x42908e){_0x5d906b['model']=_[_0x24e6('0x34')](db[_0x24e6('0x63')][_0x24e6('0x30')]);_0x5d906b[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x5df3d3[_0x24e6('0x33')]);_0x5d906b[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x5d906b[_0x24e6('0x32')],_0x5d906b[_0x24e6('0x33')]);_0x1c9005[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x5d906b[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x38')]));_0x1c9005['attributes']=_0x1c9005[_0x24e6('0x37')][_0x24e6('0x52')]?_0x1c9005[_0x24e6('0x37')]:_0x5d906b[_0x24e6('0x32')];if(!_0x5df3d3['query'][_0x24e6('0x39')](_0x24e6('0x3a'))){_0x1c9005[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x1c9005[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x1c9005['order']=qs[_0x24e6('0x3c')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x1c9005[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x5df3d3[_0x24e6('0x33')],_0x5d906b['filters']));_0x1c9005['where'][_0x24e6('0x5c')]=_0x42908e['id'];if(_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x1c9005[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x1c9005[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x1c9005['attributes'],function(_0xd3dc7b){var _0x44f429={};_0x44f429[_0xd3dc7b]={'$like':'%'+_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x44f429;})});}_0x1c9005=_[_0x24e6('0x40')]({},_0x1c9005,_0x5df3d3[_0x24e6('0x42')]);return db['CmHopperBlack']['count']({'where':_0x1c9005['where']})[_0x24e6('0x24')](function(_0x3c996c){_0x4b70b6[_0x24e6('0x1e')]=_0x3c996c;if(_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x44')]){_0x1c9005[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x63')][_0x24e6('0x46')](_0x1c9005);})[_0x24e6('0x24')](function(_0x38cdc7){_0x4b70b6[_0x24e6('0x47')]=_0x38cdc7;return _0x4b70b6;});}})['then'](respondWithFilteredResult(_0x3784da,_0x1c9005))[_0x24e6('0x48')](handleError(_0x3784da,null));};exports[_0x24e6('0x64')]=function(_0x37c07f,_0x4f3008,_0x2b0f99){var _0x39c3d6={};var _0x3d271={};var _0x413aac;var _0x48fa61;return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x37c07f[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x4f3008,null))[_0x24e6('0x24')](function(_0x2bc73d){if(_0x2bc73d){_0x413aac=_0x2bc73d;_0x3d271[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x65')][_0x24e6('0x30')]);_0x3d271[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x37c07f[_0x24e6('0x33')]);_0x3d271['filters']=_[_0x24e6('0x36')](_0x3d271[_0x24e6('0x32')],_0x3d271['query']);_0x39c3d6['attributes']=_['intersection'](_0x3d271['model'],qs[_0x24e6('0x38')](_0x37c07f['query'][_0x24e6('0x38')]));_0x39c3d6['attributes']=_0x39c3d6[_0x24e6('0x37')][_0x24e6('0x52')]?_0x39c3d6[_0x24e6('0x37')]:_0x3d271[_0x24e6('0x32')];_0x39c3d6[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x39c3d6['where']=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x37c07f[_0x24e6('0x33')],_0x3d271['filters']));if(_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x39c3d6['where']=_[_0x24e6('0x40')](_0x39c3d6[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x39c3d6[_0x24e6('0x37')],function(_0x58968e){var _0x2ca9fa={};_0x2ca9fa[_0x58968e]={'$like':'%'+_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x2ca9fa;})});}_0x39c3d6=_[_0x24e6('0x40')]({},_0x39c3d6,_0x37c07f['options']);return _0x413aac['getLists'](_0x39c3d6);}})[_0x24e6('0x24')](function(_0x383683){if(_0x383683){_0x48fa61=_0x383683[_0x24e6('0x52')];if(!_0x37c07f[_0x24e6('0x33')][_0x24e6('0x39')]('nolimit')){_0x39c3d6[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x37c07f['query'][_0x24e6('0x1d')]);_0x39c3d6[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x37c07f[_0x24e6('0x33')][_0x24e6('0x1b')]);}return _0x413aac[_0x24e6('0x64')](_0x39c3d6);}})[_0x24e6('0x24')](function(_0x421811){if(_0x421811){return _0x421811?{'count':_0x48fa61,'rows':_0x421811}:null;}})[_0x24e6('0x24')](respondWithResult(_0x4f3008,null))['catch'](handleError(_0x4f3008,null));};exports[_0x24e6('0x66')]=function(_0x395d7c,_0xbd271,_0x4a99e7){var _0x555d48,_0x21d57e;return db[_0x24e6('0x43')]['find']({'where':{'id':_0x395d7c[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0xbd271,null))['then'](function(_0x210136){if(_0x210136){_0x21d57e=_0x210136;return _0x210136['addLists'](_0x395d7c[_0x24e6('0x4d')][_0x24e6('0x67')],_['omit'](_0x395d7c['body'],[_0x24e6('0x67'),'id'])||{});}return null;})[_0x24e6('0x68')](function(_0x5edc3c){var _0xfaf720;_0x555d48=_0x5edc3c||[];var _0x400056=[];if(_0x5edc3c){for(var _0x2c0768=0x0;_0x2c0768<_0x5edc3c[_0x24e6('0x52')];_0x2c0768+=0x1){var _0x965f9b=_0x5edc3c[_0x2c0768][_0x24e6('0x26')]({'plain':!![]});_0x21d57e[_0x24e6('0x69')]=_0x395d7c[_0x24e6('0x4d')]['dialCheckDuplicateType']?_0x395d7c[_0x24e6('0x4d')]['dialCheckDuplicateType']:_0x21d57e[_0x24e6('0x69')];switch(_0x21d57e[_0x24e6('0x69')]){case _0x24e6('0x6a'):_0xfaf720=squel['insert']()['into'](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),'scheduledAt',_0x24e6('0x6e'),_0x24e6('0x6f'),_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))['field'](_0x24e6('0x72'),_0x24e6('0x73'))[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))[_0x24e6('0x71')](_0x395d7c['params']['id'][_0x24e6('0x75')](),_0x24e6('0x5c'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),'updatedAt')[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')](_0x24e6('0x78'))[_0x24e6('0x3f')]('ListId\x20=\x20?',_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')]())[_0x24e6('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x24e6('0x79'),squel['select']()['field'](_0x24e6('0x7a'))['from']('cm_hopper_final')[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')]()))[_0x24e6('0x3f')](_0x24e6('0x79'),squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x7c'))[_0x24e6('0x76')](_0x24e6('0x6b'))[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c['params']['id']['toString']())))[_0x24e6('0x75')]();break;case'onlyIfOpen':_0xfaf720=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x73'),'ContactId','ListId',_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))['field'](_0x24e6('0x72'),'scheduledAt')[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))['field'](_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')]('NOW()',_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')]('deletedAt\x20IS\x20NULL')[_0x24e6('0x3f')](_0x24e6('0x7f'),_0x965f9b['CmListId'][_0x24e6('0x75')]())[_0x24e6('0x3f')](_0x24e6('0x80'))['where'](_0x24e6('0x79'),squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x7c'))[_0x24e6('0x76')](_0x24e6('0x6b'))[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c[_0x24e6('0x4a')]['id']['toString']())))[_0x24e6('0x75')]();break;default:_0xfaf720=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x73'),'ContactId',_0x24e6('0x6f'),_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))[_0x24e6('0x71')]('NOW()','scheduledAt')[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))['field'](_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))['where'](_0x24e6('0x78'))[_0x24e6('0x3f')]('ListId\x20=\x20?',_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')]())[_0x24e6('0x3f')](_0x24e6('0x80')))['toString']();}_0x400056[_0x24e6('0x81')](db[_0x24e6('0x82')]['query'](_0xfaf720));}return BPromise['all'](_0x400056);}})[_0x24e6('0x24')](function(){return _0x555d48;})[_0x24e6('0x24')](respondWithResult(_0xbd271,null))[_0x24e6('0x48')](handleError(_0xbd271,null));};exports['removeLists']=function(_0x3ed2f3,_0x30b8c6,_0x288b7c){return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x3ed2f3[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x30b8c6,null))[_0x24e6('0x24')](function(_0x46fe82){if(_0x46fe82){return _0x46fe82[_0x24e6('0x83')](_0x3ed2f3[_0x24e6('0x33')]['ids']);}})[_0x24e6('0x24')](function(_0x1697ab){if(_0x1697ab){return db[_0x24e6('0x5b')]['destroy']({'where':{'ListId':_0x3ed2f3[_0x24e6('0x33')][_0x24e6('0x67')],'CampaignId':_0x3ed2f3[_0x24e6('0x4a')]['id']}})['then'](function(){return _0x1697ab;});}})[_0x24e6('0x24')](respondWithStatusCode(_0x30b8c6,null))['catch'](handleError(_0x30b8c6,null));};exports['getBlackLists']=function(_0x5d4361,_0xd0a4e8,_0x39128c){var _0x26726={};var _0x10cb22={};var _0x53adac;var _0x589add;return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x5d4361['params']['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0xd0a4e8,null))[_0x24e6('0x24')](function(_0x4c05fa){if(_0x4c05fa){_0x53adac=_0x4c05fa;_0x10cb22[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x65')][_0x24e6('0x30')]);_0x10cb22['query']=_[_0x24e6('0x34')](_0x5d4361[_0x24e6('0x33')]);_0x10cb22[_0x24e6('0x35')]=_['intersection'](_0x10cb22[_0x24e6('0x32')],_0x10cb22[_0x24e6('0x33')]);_0x26726[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x10cb22[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x5d4361[_0x24e6('0x33')]['fields']));_0x26726[_0x24e6('0x37')]=_0x26726[_0x24e6('0x37')][_0x24e6('0x52')]?_0x26726['attributes']:_0x10cb22[_0x24e6('0x32')];_0x26726[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x5d4361[_0x24e6('0x33')]['sort']);_0x26726[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x5d4361[_0x24e6('0x33')],_0x10cb22[_0x24e6('0x35')]));if(_0x5d4361[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x26726[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x26726[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x26726[_0x24e6('0x37')],function(_0x5e2dbb){var _0x223073={};_0x223073[_0x5e2dbb]={'$like':'%'+_0x5d4361[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x223073;})});}_0x26726=_[_0x24e6('0x40')]({},_0x26726,_0x5d4361[_0x24e6('0x42')]);return _0x53adac[_0x24e6('0x84')](_0x26726);}})[_0x24e6('0x24')](function(_0x2b494c){if(_0x2b494c){_0x589add=_0x2b494c[_0x24e6('0x52')];if(!_0x5d4361['query']['hasOwnProperty'](_0x24e6('0x3a'))){_0x26726[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x5d4361[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x26726[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x5d4361[_0x24e6('0x33')][_0x24e6('0x1b')]);}return _0x53adac[_0x24e6('0x84')](_0x26726);}})[_0x24e6('0x24')](function(_0xb0b334){if(_0xb0b334){return _0xb0b334?{'count':_0x589add,'rows':_0xb0b334}:null;}})[_0x24e6('0x24')](respondWithResult(_0xd0a4e8,null))[_0x24e6('0x48')](handleError(_0xd0a4e8,null));};exports['addBlackLists']=function(_0x590aec,_0x18c51f,_0x218b38){var _0x192993,_0x2316b5;return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x590aec[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x18c51f,null))['then'](function(_0x242da4){if(_0x242da4){_0x2316b5=_0x242da4;return _0x242da4[_0x24e6('0x85')](_0x590aec[_0x24e6('0x4d')][_0x24e6('0x67')],_[_0x24e6('0x53')](_0x590aec['body'],[_0x24e6('0x67'),'id'])||{});}return null;})['spread'](function(_0xc3413e){var _0x1dc9fa;_0x192993=_0xc3413e||[];var _0x57d513=[];if(_0xc3413e){for(var _0x103ddd=0x0;_0x103ddd<_0xc3413e[_0x24e6('0x52')];_0x103ddd+=0x1){var _0x4aac8f=_0xc3413e[_0x103ddd][_0x24e6('0x26')]({'plain':!![]});_0x1dc9fa=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')]('cm_hopper_black')[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x6e'),'ListId','CampaignId','createdAt',_0x24e6('0x55')],squel['select']()[_0x24e6('0x71')]('phone',_0x24e6('0x6d'))[_0x24e6('0x71')]('id','ContactId')[_0x24e6('0x71')](_0x4aac8f[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))[_0x24e6('0x71')](_0x590aec[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')](_0x24e6('0x72'),'createdAt')[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')](_0x24e6('0x78'))['where'](_0x24e6('0x7f'),_0x4aac8f['CmListId'][_0x24e6('0x75')]())[_0x24e6('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x24e6('0x75')]();_0x57d513[_0x24e6('0x81')](db[_0x24e6('0x82')][_0x24e6('0x33')](_0x1dc9fa));}return BPromise[_0x24e6('0x86')](_0x57d513);}})['then'](function(){return _0x192993;})[_0x24e6('0x24')](respondWithResult(_0x18c51f,null))[_0x24e6('0x48')](handleError(_0x18c51f,null));};exports[_0x24e6('0x87')]=function(_0x584c97,_0x5cf782,_0x4b4193){return db[_0x24e6('0x43')]['find']({'where':{'id':_0x584c97[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x5cf782,null))['then'](function(_0x2482ec){if(_0x2482ec){return _0x2482ec[_0x24e6('0x87')](_0x584c97['query'][_0x24e6('0x67')]);}})[_0x24e6('0x24')](function(_0xa92694){if(_0xa92694){return db[_0x24e6('0x63')]['destroy']({'where':{'ListId':_0x584c97[_0x24e6('0x33')][_0x24e6('0x67')],'CampaignId':_0x584c97['params']['id']}})[_0x24e6('0x24')](function(){return _0xa92694;});}})[_0x24e6('0x24')](respondWithStatusCode(_0x5cf782,null))['catch'](handleError(_0x5cf782,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 151f989..ee07702 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1e0bd3,_0x8ba362){var _0x2d3f81=function(_0x2580cc){while(--_0x2580cc){_0x1e0bd3['push'](_0x1e0bd3['shift']());}};_0x2d3f81(++_0x8ba362);}(_0x7a54,0x106));var _0x47a5=function(_0x3bc90f,_0xbcaf71){_0x3bc90f=_0x3bc90f-0x0;var _0x17b522=_0x7a54[_0x3bc90f];return _0x17b522;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4147b1,_0x34bf45){var _0x5b1d00=function(_0x287950){while(--_0x287950){_0x4147b1['push'](_0x4147b1['shift']());}};_0x5b1d00(++_0x34bf45);}(_0x7a54,0x106));var _0x47a5=function(_0x185035,_0x5c0a3c){_0x185035=_0x185035-0x0;var _0xaae8f3=_0x7a54[_0x185035];return _0xaae8f3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 46f747b..df6d538 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 _0xc041=['GetCampaign','options','raw','where','attributes','limit','include','model','map','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4f8a41,_0x2799f1){var _0x2b6e84=function(_0x53d4dc){while(--_0x53d4dc){_0x4f8a41['push'](_0x4f8a41['shift']());}};_0x2b6e84(++_0x2799f1);}(_0xc041,0x1ea));var _0x1c04=function(_0x40bfc2,_0x538e26){_0x40bfc2=_0x40bfc2-0x0;var _0x14d1db=_0xc041[_0x40bfc2];return _0x14d1db;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var moment=require('moment');var BPromise=require(_0x1c04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c04('0x3'));var db=require(_0x1c04('0x4'))['db'];var utils=require(_0x1c04('0x5'));var logger=require(_0x1c04('0x6'))(_0x1c04('0x7'));var config=require(_0x1c04('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524f85,_0x9507a,_0x3613fe){return new BPromise(function(_0x41a0d3,_0x1c2e7e){return client[_0x1c04('0xa')](_0x524f85,_0x3613fe)['then'](function(_0x536a46){logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));logger[_0x1c04('0xe')](_0x1c04('0xf'),_0x9507a,_0x1c04('0xd'),JSON[_0x1c04('0x10')](_0x536a46));if(_0x536a46[_0x1c04('0x11')]){if(_0x536a46['error'][_0x1c04('0x12')]===0x1f4){logger['error'](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')]['message']);return _0x1c2e7e(_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);}logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);return _0x41a0d3(_0x536a46[_0x1c04('0x11')]['message']);}else{logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));_0x41a0d3(_0x536a46['result'][_0x1c04('0x13')]);}})['catch'](function(_0x26cbfa){logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x26cbfa);_0x1c2e7e(_0x26cbfa);});});}exports[_0x1c04('0x14')]=function(_0x2b3a8b){var _0x12e227=this;return new Promise(function(_0x3e2bd9,_0x46e892){return db['Campaign']['findAll']({'raw':_0x2b3a8b['options']?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x16')]===undefined?!![]:![]:!![],'where':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x17')]||null:null,'attributes':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x18')]||null:null,'limit':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x19')]||null:null,'include':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x1a')]?_['map'](_0x2b3a8b[_0x1c04('0x15')]['include'],function(_0x247116){return{'model':db[_0x247116[_0x1c04('0x1b')]],'as':_0x247116['as'],'attributes':_0x247116[_0x1c04('0x18')],'include':_0x247116[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x247116['include'],function(_0x5101e2){return{'model':db[_0x5101e2[_0x1c04('0x1b')]],'as':_0x5101e2['as'],'attributes':_0x5101e2[_0x1c04('0x18')],'include':_0x5101e2[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x5101e2[_0x1c04('0x1a')],function(_0x1e2daa){return{'model':db[_0x1e2daa[_0x1c04('0x1b')]],'as':_0x1e2daa['as'],'attributes':_0x1e2daa[_0x1c04('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bdd27){logger[_0x1c04('0xb')]('GetCampaign',_0x2b3a8b);logger[_0x1c04('0xe')](_0x1c04('0x14'),_0x2b3a8b,JSON[_0x1c04('0x10')](_0x4bdd27));_0x3e2bd9(_0x4bdd27);})[_0x1c04('0x1d')](function(_0x3bf4fd){logger[_0x1c04('0x11')](_0x1c04('0x14'),_0x3bf4fd['message'],_0x2b3a8b);_0x46e892(_0x12e227['error'](0x1f4,_0x3bf4fd['message']));});});}; \ No newline at end of file +var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x49c451,_0x30e41d){var _0x2a470d=function(_0x4c0b41){while(--_0x4c0b41){_0x49c451['push'](_0x49c451['shift']());}};_0x2a470d(++_0x30e41d);}(_0xde64,0x17c));var _0x4de6=function(_0x59a6ef,_0xe0cbdd){_0x59a6ef=_0x59a6ef-0x0;var _0x1809cf=_0xde64[_0x59a6ef];return _0x1809cf;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index dd5df08..7743958 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 _0x849e=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x849e,0x187));var _0xe849=function(_0x52d0d3,_0x552ba6){_0x52d0d3=_0x52d0d3-0x0;var _0x1b4978=_0x849e[_0x52d0d3];return _0x1b4978;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require(_0xe849('0x3'));var express=require(_0xe849('0x4'));var router=express[_0xe849('0x5')]();var fs_extra=require(_0xe849('0x6'));var auth=require(_0xe849('0x7'));var interaction=require(_0xe849('0x8'));var config=require(_0xe849('0x9'));var controller=require(_0xe849('0xa'));router[_0xe849('0xb')]('/',auth[_0xe849('0xc')](),controller['index']);router[_0xe849('0xb')](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0xe')]);router[_0xe849('0xb')](_0xe849('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xe849('0xb')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x11')]);router[_0xe849('0xb')]('/:id/hopper_finals',auth[_0xe849('0xc')](),controller[_0xe849('0x12')]);router[_0xe849('0xb')](_0xe849('0x13'),auth[_0xe849('0xc')](),controller[_0xe849('0x14')]);router['get'](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xe849('0x17')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe849('0x18'),auth[_0xe849('0xc')](),controller['clone']);router[_0xe849('0x17')](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x19')]);router[_0xe849('0x17')](_0xe849('0x1a'),auth['isAuthenticated'](),controller[_0xe849('0x1b')]);router[_0xe849('0x1c')]('/:id',auth[_0xe849('0xc')](),controller['update']);router['delete'](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0x1d')]);router[_0xe849('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller[_0xe849('0x1f')]);router['delete'](_0xe849('0x1a'),auth[_0xe849('0xc')](),controller[_0xe849('0x20')]);module[_0xe849('0x21')]=router; \ No newline at end of file +var _0xf7cb=['../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','addBlackLists','put','update','/:id','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x452c94,_0xeddd6c){var _0x150446=function(_0x5eef33){while(--_0x5eef33){_0x452c94['push'](_0x452c94['shift']());}};_0x150446(++_0xeddd6c);}(_0xf7cb,0x1a9));var _0xbf7c=function(_0x355388,_0x3d00c1){_0x355388=_0x355388-0x0;var _0x324e01=_0xf7cb[_0x355388];return _0x324e01;};'use strict';var multer=require('multer');var util=require(_0xbf7c('0x0'));var path=require(_0xbf7c('0x1'));var timeout=require(_0xbf7c('0x2'));var express=require(_0xbf7c('0x3'));var router=express[_0xbf7c('0x4')]();var fs_extra=require(_0xbf7c('0x5'));var auth=require(_0xbf7c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf7c('0x7'));var controller=require(_0xbf7c('0x8'));router['get']('/',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xa')]);router[_0xbf7c('0xb')]('/:id',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xc')]);router[_0xbf7c('0xb')](_0xbf7c('0xd'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xe')]);router[_0xbf7c('0xb')](_0xbf7c('0xf'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x10')]);router[_0xbf7c('0xb')](_0xbf7c('0x11'),auth['isAuthenticated'](),controller[_0xbf7c('0x12')]);router[_0xbf7c('0xb')]('/:id/hopper_black',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x13')]);router[_0xbf7c('0xb')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbf7c('0x14')]);router['get'](_0xbf7c('0x15'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x16')]);router[_0xbf7c('0x17')]('/',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x18')]);router[_0xbf7c('0x17')](_0xbf7c('0x19'),auth[_0xbf7c('0x9')](),controller['clone']);router[_0xbf7c('0x17')](_0xbf7c('0x1a'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1b')]);router[_0xbf7c('0x17')]('/:id/blacklists',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1c')]);router[_0xbf7c('0x1d')]('/:id',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1e')]);router['delete'](_0xbf7c('0x1f'),auth[_0xbf7c('0x9')](),controller['destroy']);router[_0xbf7c('0x20')](_0xbf7c('0x1a'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x21')]);router['delete'](_0xbf7c('0x15'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x22')]);module[_0xbf7c('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c3e90eb..01833d6 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 _0xfd1e=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0x53f4e3,_0x62f760){var _0x25c1ef=function(_0x4e4e95){while(--_0x4e4e95){_0x53f4e3['push'](_0x53f4e3['shift']());}};_0x25c1ef(++_0x62f760);}(_0xfd1e,0xff));var _0xefd1=function(_0x246d80,_0x3ebb30){_0x246d80=_0x246d80-0x0;var _0x214f35=_0xfd1e[_0x246d80];return _0x214f35;};'use strict';var Sequelize=require('sequelize');module[_0xefd1('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xefd1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xefd1('0x2')]},'name':{'type':Sequelize[_0xefd1('0x3')],'get':function(){return this[_0xefd1('0x4')](_0xefd1('0x5'));}}}; \ No newline at end of file +var _0x9864=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x4f6329,_0x253a75){var _0x2238bd=function(_0x2dfa77){while(--_0x2dfa77){_0x4f6329['push'](_0x4f6329['shift']());}};_0x2238bd(++_0x253a75);}(_0x9864,0x84));var _0x4986=function(_0x163838,_0x58a700){_0x163838=_0x163838-0x0;var _0xe51f37=_0x9864[_0x163838];return _0xe51f37;};'use strict';var Sequelize=require(_0x4986('0x0'));module[_0x4986('0x1')]={'key':{'type':Sequelize[_0x4986('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4986('0x2')]},'name':{'type':Sequelize[_0x4986('0x3')],'get':function(){return this[_0x4986('0x4')](_0x4986('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4c94d11..761b581 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 _0x1299=['body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','end','status','json','offset','undefined','limit','set','reject','update','then','get','CannedAnswers','destroy','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x430185,_0xb3bd00){var _0x412b86=function(_0x5ac609){while(--_0x5ac609){_0x430185['push'](_0x430185['shift']());}};_0x412b86(++_0xb3bd00);}(_0x1299,0x1c9));var _0x9129=function(_0x9fa60,_0x4df300){_0x9fa60=_0x9fa60-0x0;var _0x391006=_0x1299[_0x9fa60];return _0x391006;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9129('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9129('0x1'));var moment=require(_0x9129('0x2'));var BPromise=require(_0x9129('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9129('0x4'));var sox=require('sox');var csv=require(_0x9129('0x5'));var ejs=require(_0x9129('0x6'));var fs=require('fs');var fs_extra=require(_0x9129('0x7'));var _=require(_0x9129('0x8'));var squel=require(_0x9129('0x9'));var crypto=require(_0x9129('0xa'));var jsforce=require(_0x9129('0xb'));var deskjs=require(_0x9129('0xc'));var toCsv=require(_0x9129('0x5'));var querystring=require('querystring');var Papa=require(_0x9129('0xd'));var Redis=require(_0x9129('0xe'));var authService=require(_0x9129('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9129('0x10'));var hardwareService=require(_0x9129('0x11'));var logger=require(_0x9129('0x12'))(_0x9129('0x13'));var utils=require(_0x9129('0x14'));var config=require(_0x9129('0x15'));var licenseUtil=require(_0x9129('0x16'));var db=require(_0x9129('0x17'))['db'];function respondWithStatusCode(_0x354efc,_0x410378){_0x410378=_0x410378||0xcc;return function(_0x1aa3db){if(_0x1aa3db){return _0x354efc[_0x9129('0x18')](_0x410378);}return _0x354efc['status'](_0x410378)[_0x9129('0x19')]();};}function respondWithResult(_0x2a590f,_0x4eea6d){_0x4eea6d=_0x4eea6d||0xc8;return function(_0x267ecf){if(_0x267ecf){return _0x2a590f[_0x9129('0x1a')](_0x4eea6d)[_0x9129('0x1b')](_0x267ecf);}};}function respondWithFilteredResult(_0x1cf47b,_0x60edc2){return function(_0x18ae7d){if(_0x18ae7d){var _0x1addb6=typeof _0x60edc2[_0x9129('0x1c')]===_0x9129('0x1d')&&typeof _0x60edc2[_0x9129('0x1e')]===_0x9129('0x1d');var _0x5bbf46=_0x18ae7d['count'];var _0x50e089=_0x1addb6?0x0:_0x60edc2[_0x9129('0x1c')];var _0x4278ba=_0x1addb6?_0x18ae7d['count']:_0x60edc2[_0x9129('0x1c')]+_0x60edc2[_0x9129('0x1e')];var _0x53c112;if(_0x4278ba>=_0x5bbf46){_0x4278ba=_0x5bbf46;_0x53c112=0xc8;}else{_0x53c112=0xce;}_0x1cf47b[_0x9129('0x1a')](_0x53c112);return _0x1cf47b[_0x9129('0x1f')]('Content-Range',_0x50e089+'-'+_0x4278ba+'/'+_0x5bbf46)[_0x9129('0x1b')](_0x18ae7d);}return null;};}function patchUpdates(_0x1a238c){return function(_0x5bbb08){try{jsonpatch['apply'](_0x5bbb08,_0x1a238c,!![]);}catch(_0x4fcb60){return BPromise[_0x9129('0x20')](_0x4fcb60);}return _0x5bbb08['save']();};}function saveUpdates(_0x54d8f1,_0x249778){return function(_0x2c8ea8){if(_0x2c8ea8){return _0x2c8ea8[_0x9129('0x21')](_0x54d8f1)['then'](function(_0x3d91ee){return _0x3d91ee;});}return null;};}function removeEntity(_0x4a255c,_0x40f4a4){return function(_0x5b56c1){if(_0x5b56c1){return _0x5b56c1['destroy']()[_0x9129('0x22')](function(){var _0x12cb38=_0x5b56c1[_0x9129('0x23')]({'plain':!![]});var _0xe5099e=_0x9129('0x24');return db['UserProfileResource'][_0x9129('0x25')]({'where':{'type':_0xe5099e,'resourceId':_0x12cb38['id']}})[_0x9129('0x22')](function(){return _0x5b56c1;});})['then'](function(){_0x4a255c[_0x9129('0x1a')](0xcc)[_0x9129('0x19')]();});}};}function handleEntityNotFound(_0x3b522a,_0x55b126){return function(_0x50665b){if(!_0x50665b){_0x3b522a['sendStatus'](0x194);}return _0x50665b;};}function handleError(_0x53ff8e,_0x1d6511){_0x1d6511=_0x1d6511||0x1f4;return function(_0x88acf4){logger[_0x9129('0x26')](_0x88acf4[_0x9129('0x27')]);if(_0x88acf4[_0x9129('0x28')]){delete _0x88acf4['name'];}_0x53ff8e['status'](_0x1d6511)['send'](_0x88acf4);};}exports[_0x9129('0x29')]=function(_0x38dd11,_0x3e6a86){var _0x452753={},_0x5ee1fe={},_0x3dcfe1={'count':0x0,'rows':[]};var _0x59ae17=_['map'](db[_0x9129('0x2a')][_0x9129('0x2b')],function(_0xf3b59f){return{'name':_0xf3b59f[_0x9129('0x2c')],'type':_0xf3b59f['type'][_0x9129('0x2d')]};});_0x5ee1fe[_0x9129('0x2e')]=_[_0x9129('0x2f')](_0x59ae17,'name');_0x5ee1fe[_0x9129('0x30')]=_[_0x9129('0x31')](_0x38dd11[_0x9129('0x30')]);_0x5ee1fe[_0x9129('0x32')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],_0x5ee1fe['query']);_0x452753[_0x9129('0x34')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x38dd11['query'][_0x9129('0x35')]));_0x452753[_0x9129('0x34')]=_0x452753[_0x9129('0x34')][_0x9129('0x36')]?_0x452753[_0x9129('0x34')]:_0x5ee1fe[_0x9129('0x2e')];if(!_0x38dd11['query'][_0x9129('0x37')](_0x9129('0x38'))){_0x452753[_0x9129('0x1e')]=qs[_0x9129('0x1e')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1e')]);_0x452753['offset']=qs[_0x9129('0x1c')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1c')]);}_0x452753[_0x9129('0x39')]=qs[_0x9129('0x3a')](_0x38dd11['query'][_0x9129('0x3a')]);_0x452753[_0x9129('0x3b')]=qs['filters'](_[_0x9129('0x3c')](_0x38dd11[_0x9129('0x30')],_0x5ee1fe['filters']),_0x59ae17);if(_0x38dd11[_0x9129('0x30')][_0x9129('0x3d')]){_0x452753[_0x9129('0x3b')]=_[_0x9129('0x3e')](_0x452753[_0x9129('0x3b')],{'$or':[{'key':{'$like':'%'+_0x38dd11['query']['filter']+'%'}},{'value':{'$like':'%'+_0x38dd11[_0x9129('0x30')]['filter']+'%'}}]});}_0x452753=_[_0x9129('0x3e')]({},_0x452753,_0x38dd11[_0x9129('0x3f')]);var _0x565f9c={'where':_0x452753[_0x9129('0x3b')]};return db[_0x9129('0x2a')]['count'](_0x565f9c)[_0x9129('0x22')](function(_0x5adfb7){_0x3dcfe1['count']=_0x5adfb7;if(_0x38dd11[_0x9129('0x30')][_0x9129('0x40')]){_0x452753[_0x9129('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9129('0x42')](_0x452753);})[_0x9129('0x22')](function(_0x2b81c5){_0x3dcfe1[_0x9129('0x43')]=_0x2b81c5;return _0x3dcfe1;})[_0x9129('0x22')](respondWithFilteredResult(_0x3e6a86,_0x452753))[_0x9129('0x44')](handleError(_0x3e6a86,null));};exports[_0x9129('0x45')]=function(_0x554988,_0x4851be){var _0x1accb8={'raw':!![],'where':{'id':_0x554988['params']['id']}},_0x2dd2a1={};_0x2dd2a1['model']=_[_0x9129('0x31')](db[_0x9129('0x2a')][_0x9129('0x2b')]);_0x2dd2a1[_0x9129('0x30')]=_[_0x9129('0x31')](_0x554988[_0x9129('0x30')]);_0x2dd2a1[_0x9129('0x32')]=_['intersection'](_0x2dd2a1[_0x9129('0x2e')],_0x2dd2a1['query']);_0x1accb8[_0x9129('0x34')]=_[_0x9129('0x33')](_0x2dd2a1[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x554988[_0x9129('0x30')][_0x9129('0x35')]));_0x1accb8[_0x9129('0x34')]=_0x1accb8[_0x9129('0x34')][_0x9129('0x36')]?_0x1accb8[_0x9129('0x34')]:_0x2dd2a1[_0x9129('0x2e')];if(_0x554988[_0x9129('0x30')][_0x9129('0x40')]){_0x1accb8[_0x9129('0x41')]=[{'all':!![]}];}_0x1accb8=_[_0x9129('0x3e')]({},_0x1accb8,_0x554988[_0x9129('0x3f')]);return db[_0x9129('0x2a')][_0x9129('0x46')](_0x1accb8)[_0x9129('0x22')](handleEntityNotFound(_0x4851be,null))['then'](respondWithResult(_0x4851be,null))[_0x9129('0x44')](handleError(_0x4851be,null));};exports[_0x9129('0x21')]=function(_0x640fd0,_0x16287c){if(_0x640fd0[_0x9129('0x47')]['id']){delete _0x640fd0[_0x9129('0x47')]['id'];}return db[_0x9129('0x2a')]['find']({'where':{'id':_0x640fd0[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x16287c,null))[_0x9129('0x22')](saveUpdates(_0x640fd0[_0x9129('0x47')],null))[_0x9129('0x22')](respondWithResult(_0x16287c,null))[_0x9129('0x44')](handleError(_0x16287c,null));};exports['destroy']=function(_0x1a6e42,_0x39265b){return db[_0x9129('0x2a')]['find']({'where':{'id':_0x1a6e42[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x39265b,null))[_0x9129('0x22')](removeEntity(_0x39265b,null))[_0x9129('0x44')](handleError(_0x39265b,null));};exports[_0x9129('0x49')]=function(_0x1d1c62,_0x580700){var _0x223afa={'key':_0x1d1c62[_0x9129('0x47')]['key']};if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4a')]){_0x223afa[_0x9129('0x4a')]=_0x1d1c62[_0x9129('0x47')]['MailAccountId'];}else if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4b')]){_0x223afa[_0x9129('0x4b')]=_0x1d1c62[_0x9129('0x47')]['SmsAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4c')]){_0x223afa[_0x9129('0x4c')]=_0x1d1c62['body']['OpenchannelAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4d')]){_0x223afa[_0x9129('0x4d')]=_0x1d1c62[_0x9129('0x47')][_0x9129('0x4d')];}return db[_0x9129('0x2a')][_0x9129('0x46')]({'where':_0x223afa})['then'](function(_0x35de2c){if(_0x35de2c){throw new db[(_0x9129('0x4e'))][(_0x9129('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x9129('0x49')](_0x1d1c62[_0x9129('0x47')]);})[_0x9129('0x22')](function(_0x262762){var _0x44d121=_0x1d1c62[_0x9129('0x50')][_0x9129('0x23')]({'plain':!![]});if(!_0x44d121)throw new Error(_0x9129('0x51'));if(_0x44d121[_0x9129('0x52')]===_0x9129('0x50')){var _0x325614=_0x262762[_0x9129('0x23')]({'plain':!![]});return db[_0x9129('0x53')][_0x9129('0x46')]({'where':{'name':_0x9129('0x24'),'userProfileId':_0x44d121[_0x9129('0x54')]},'raw':!![]})[_0x9129('0x22')](function(_0x23420b){if(_0x23420b&&_0x23420b[_0x9129('0x55')]===0x0){return db[_0x9129('0x56')][_0x9129('0x49')]({'name':_0x325614[_0x9129('0x28')],'resourceId':_0x325614['id'],'type':_0x23420b[_0x9129('0x28')],'sectionId':_0x23420b['id']},{})['then'](function(){return _0x262762;});}else{return _0x262762;}})['catch'](function(_0x338114){logger[_0x9129('0x26')](_0x9129('0x57'),_0x338114);throw _0x338114;});}return _0x262762;})[_0x9129('0x22')](respondWithResult(_0x580700,0xc9))[_0x9129('0x44')](handleError(_0x580700,null));}; \ No newline at end of file +var _0x5e75=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','where','merge','filter','options','CannedAnswer','includeAll','include','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x54f253,_0x13acb1){var _0x207e8d=function(_0x32b855){while(--_0x32b855){_0x54f253['push'](_0x54f253['shift']());}};_0x207e8d(++_0x13acb1);}(_0x5e75,0x108));var _0x55e7=function(_0x398cb4,_0x4971c1){_0x398cb4=_0x398cb4-0x0;var _0x1825d1=_0x5e75[_0x398cb4];return _0x1825d1;};'use strict';var emlformat=require(_0x55e7('0x0'));var rimraf=require(_0x55e7('0x1'));var zipdir=require(_0x55e7('0x2'));var jsonpatch=require(_0x55e7('0x3'));var rp=require(_0x55e7('0x4'));var moment=require(_0x55e7('0x5'));var BPromise=require(_0x55e7('0x6'));var Mustache=require(_0x55e7('0x7'));var util=require(_0x55e7('0x8'));var path=require(_0x55e7('0x9'));var sox=require(_0x55e7('0xa'));var csv=require(_0x55e7('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55e7('0xc'));var _=require(_0x55e7('0xd'));var squel=require(_0x55e7('0xe'));var crypto=require(_0x55e7('0xf'));var jsforce=require(_0x55e7('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x55e7('0xb'));var querystring=require(_0x55e7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x55e7('0x12'));var as=require(_0x55e7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x55e7('0x14'));var utils=require(_0x55e7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x55e7('0x16'));var db=require(_0x55e7('0x17'))['db'];function respondWithStatusCode(_0x4cab61,_0x115623){_0x115623=_0x115623||0xcc;return function(_0x16242b){if(_0x16242b){return _0x4cab61[_0x55e7('0x18')](_0x115623);}return _0x4cab61[_0x55e7('0x19')](_0x115623)[_0x55e7('0x1a')]();};}function respondWithResult(_0x21e392,_0x1ea59d){_0x1ea59d=_0x1ea59d||0xc8;return function(_0x1cc004){if(_0x1cc004){return _0x21e392['status'](_0x1ea59d)[_0x55e7('0x1b')](_0x1cc004);}};}function respondWithFilteredResult(_0x382e7a,_0x491a3a){return function(_0x523f4b){if(_0x523f4b){var _0x531deb=typeof _0x491a3a['offset']===_0x55e7('0x1c')&&typeof _0x491a3a[_0x55e7('0x1d')]==='undefined';var _0x109cd6=_0x523f4b[_0x55e7('0x1e')];var _0x5338a7=_0x531deb?0x0:_0x491a3a[_0x55e7('0x1f')];var _0x23f477=_0x531deb?_0x523f4b['count']:_0x491a3a[_0x55e7('0x1f')]+_0x491a3a[_0x55e7('0x1d')];var _0x3aed30;if(_0x23f477>=_0x109cd6){_0x23f477=_0x109cd6;_0x3aed30=0xc8;}else{_0x3aed30=0xce;}_0x382e7a[_0x55e7('0x19')](_0x3aed30);return _0x382e7a[_0x55e7('0x20')](_0x55e7('0x21'),_0x5338a7+'-'+_0x23f477+'/'+_0x109cd6)[_0x55e7('0x1b')](_0x523f4b);}return null;};}function patchUpdates(_0x34ca96){return function(_0x397412){try{jsonpatch[_0x55e7('0x22')](_0x397412,_0x34ca96,!![]);}catch(_0x35eff8){return BPromise[_0x55e7('0x23')](_0x35eff8);}return _0x397412[_0x55e7('0x24')]();};}function saveUpdates(_0xe8f6f9,_0x2cf4df){return function(_0x8746e2){if(_0x8746e2){return _0x8746e2[_0x55e7('0x25')](_0xe8f6f9)[_0x55e7('0x26')](function(_0x55748c){return _0x55748c;});}return null;};}function removeEntity(_0x18197e,_0x5dea39){return function(_0x27c842){if(_0x27c842){return _0x27c842['destroy']()[_0x55e7('0x26')](function(){var _0x42c737=_0x27c842[_0x55e7('0x27')]({'plain':!![]});var _0x478953=_0x55e7('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x478953,'resourceId':_0x42c737['id']}})['then'](function(){return _0x27c842;});})[_0x55e7('0x26')](function(){_0x18197e[_0x55e7('0x19')](0xcc)[_0x55e7('0x1a')]();});}};}function handleEntityNotFound(_0x289e87,_0x439642){return function(_0x376025){if(!_0x376025){_0x289e87[_0x55e7('0x18')](0x194);}return _0x376025;};}function handleError(_0x10beb3,_0x25fc2a){_0x25fc2a=_0x25fc2a||0x1f4;return function(_0x44245c){logger[_0x55e7('0x29')](_0x44245c[_0x55e7('0x2a')]);if(_0x44245c['name']){delete _0x44245c[_0x55e7('0x2b')];}_0x10beb3['status'](_0x25fc2a)[_0x55e7('0x2c')](_0x44245c);};}exports[_0x55e7('0x2d')]=function(_0x1e3c75,_0x3d0eec){var _0x82951a={},_0x1cd43d={},_0x2daf01={'count':0x0,'rows':[]};var _0xef5a92=_[_0x55e7('0x2e')](db['CannedAnswer'][_0x55e7('0x2f')],function(_0xc108be){return{'name':_0xc108be[_0x55e7('0x30')],'type':_0xc108be[_0x55e7('0x31')][_0x55e7('0x32')]};});_0x1cd43d[_0x55e7('0x33')]=_[_0x55e7('0x2e')](_0xef5a92,_0x55e7('0x2b'));_0x1cd43d[_0x55e7('0x34')]=_['keys'](_0x1e3c75[_0x55e7('0x34')]);_0x1cd43d[_0x55e7('0x35')]=_['intersection'](_0x1cd43d[_0x55e7('0x33')],_0x1cd43d['query']);_0x82951a[_0x55e7('0x36')]=_[_0x55e7('0x37')](_0x1cd43d['model'],qs[_0x55e7('0x38')](_0x1e3c75['query'][_0x55e7('0x38')]));_0x82951a[_0x55e7('0x36')]=_0x82951a[_0x55e7('0x36')][_0x55e7('0x39')]?_0x82951a[_0x55e7('0x36')]:_0x1cd43d[_0x55e7('0x33')];if(!_0x1e3c75['query']['hasOwnProperty'](_0x55e7('0x3a'))){_0x82951a['limit']=qs[_0x55e7('0x1d')](_0x1e3c75['query'][_0x55e7('0x1d')]);_0x82951a['offset']=qs[_0x55e7('0x1f')](_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x1f')]);}_0x82951a['order']=qs['sort'](_0x1e3c75[_0x55e7('0x34')]['sort']);_0x82951a[_0x55e7('0x3b')]=qs[_0x55e7('0x35')](_['pick'](_0x1e3c75[_0x55e7('0x34')],_0x1cd43d[_0x55e7('0x35')]),_0xef5a92);if(_0x1e3c75[_0x55e7('0x34')]['filter']){_0x82951a[_0x55e7('0x3b')]=_[_0x55e7('0x3c')](_0x82951a['where'],{'$or':[{'key':{'$like':'%'+_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x3d')]+'%'}}]});}_0x82951a=_[_0x55e7('0x3c')]({},_0x82951a,_0x1e3c75[_0x55e7('0x3e')]);var _0x4fe243={'where':_0x82951a[_0x55e7('0x3b')]};return db[_0x55e7('0x3f')][_0x55e7('0x1e')](_0x4fe243)['then'](function(_0x3edaf3){_0x2daf01['count']=_0x3edaf3;if(_0x1e3c75['query'][_0x55e7('0x40')]){_0x82951a[_0x55e7('0x41')]=[{'all':!![]}];}return db[_0x55e7('0x3f')]['findAll'](_0x82951a);})[_0x55e7('0x26')](function(_0x37284a){_0x2daf01[_0x55e7('0x42')]=_0x37284a;return _0x2daf01;})['then'](respondWithFilteredResult(_0x3d0eec,_0x82951a))[_0x55e7('0x43')](handleError(_0x3d0eec,null));};exports[_0x55e7('0x44')]=function(_0x4ad656,_0x33794b){var _0x2f1a41={'raw':!![],'where':{'id':_0x4ad656[_0x55e7('0x45')]['id']}},_0x574a9c={};_0x574a9c[_0x55e7('0x33')]=_[_0x55e7('0x46')](db['CannedAnswer']['rawAttributes']);_0x574a9c[_0x55e7('0x34')]=_[_0x55e7('0x46')](_0x4ad656[_0x55e7('0x34')]);_0x574a9c[_0x55e7('0x35')]=_['intersection'](_0x574a9c[_0x55e7('0x33')],_0x574a9c['query']);_0x2f1a41[_0x55e7('0x36')]=_['intersection'](_0x574a9c[_0x55e7('0x33')],qs[_0x55e7('0x38')](_0x4ad656[_0x55e7('0x34')][_0x55e7('0x38')]));_0x2f1a41['attributes']=_0x2f1a41[_0x55e7('0x36')][_0x55e7('0x39')]?_0x2f1a41[_0x55e7('0x36')]:_0x574a9c[_0x55e7('0x33')];if(_0x4ad656[_0x55e7('0x34')]['includeAll']){_0x2f1a41[_0x55e7('0x41')]=[{'all':!![]}];}_0x2f1a41=_['merge']({},_0x2f1a41,_0x4ad656[_0x55e7('0x3e')]);return db['CannedAnswer'][_0x55e7('0x47')](_0x2f1a41)[_0x55e7('0x26')](handleEntityNotFound(_0x33794b,null))['then'](respondWithResult(_0x33794b,null))[_0x55e7('0x43')](handleError(_0x33794b,null));};exports['update']=function(_0x2dc31a,_0x266f90){if(_0x2dc31a['body']['id']){delete _0x2dc31a[_0x55e7('0x48')]['id'];}return db[_0x55e7('0x3f')]['find']({'where':{'id':_0x2dc31a[_0x55e7('0x45')]['id']}})[_0x55e7('0x26')](handleEntityNotFound(_0x266f90,null))[_0x55e7('0x26')](saveUpdates(_0x2dc31a[_0x55e7('0x48')],null))['then'](respondWithResult(_0x266f90,null))['catch'](handleError(_0x266f90,null));};exports['destroy']=function(_0x251dbc,_0x19878e){return db['CannedAnswer']['find']({'where':{'id':_0x251dbc[_0x55e7('0x45')]['id']}})[_0x55e7('0x26')](handleEntityNotFound(_0x19878e,null))[_0x55e7('0x26')](removeEntity(_0x19878e,null))[_0x55e7('0x43')](handleError(_0x19878e,null));};exports[_0x55e7('0x49')]=function(_0x4bfe4d,_0x3c46fc){var _0x4b59d7={'key':_0x4bfe4d[_0x55e7('0x48')]['key']};if(_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4a')]){_0x4b59d7[_0x55e7('0x4a')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4a')];}else if(_0x4bfe4d[_0x55e7('0x48')]['SmsAccountId']){_0x4b59d7[_0x55e7('0x4b')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4b')];}else if(_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4c')]){_0x4b59d7['OpenchannelAccountId']=_0x4bfe4d[_0x55e7('0x48')]['OpenchannelAccountId'];}else if(_0x4bfe4d['body']['ChatWebsiteId']){_0x4b59d7[_0x55e7('0x4d')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4d')];}return db[_0x55e7('0x3f')]['find']({'where':_0x4b59d7})['then'](function(_0x34054d){if(_0x34054d){throw new db['Sequelize'][(_0x55e7('0x4e'))](_0x55e7('0x4f'));}return db['CannedAnswer'][_0x55e7('0x49')](_0x4bfe4d[_0x55e7('0x48')]);})['then'](function(_0x1c28ee){var _0x273c6d=_0x4bfe4d['user'][_0x55e7('0x27')]({'plain':!![]});if(!_0x273c6d)throw new Error(_0x55e7('0x50'));if(_0x273c6d[_0x55e7('0x51')]===_0x55e7('0x52')){var _0x2c2331=_0x1c28ee[_0x55e7('0x27')]({'plain':!![]});return db[_0x55e7('0x53')][_0x55e7('0x47')]({'where':{'name':_0x55e7('0x28'),'userProfileId':_0x273c6d[_0x55e7('0x54')]},'raw':!![]})[_0x55e7('0x26')](function(_0x3fa422){if(_0x3fa422&&_0x3fa422['autoAssociation']===0x0){return db[_0x55e7('0x55')][_0x55e7('0x49')]({'name':_0x2c2331[_0x55e7('0x2b')],'resourceId':_0x2c2331['id'],'type':_0x3fa422[_0x55e7('0x2b')],'sectionId':_0x3fa422['id']},{})['then'](function(){return _0x1c28ee;});}else{return _0x1c28ee;}})[_0x55e7('0x43')](function(_0x2ba902){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ba902);throw _0x2ba902;});}return _0x1c28ee;})[_0x55e7('0x26')](respondWithResult(_0x3c46fc,0xc9))['catch'](handleError(_0x3c46fc,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9720dc8..7b41075 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 _0x6e7a=['lodash','util','api','moment','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x401fdf,_0x1a3185){var _0x2198a6=function(_0x3fe20b){while(--_0x3fe20b){_0x401fdf['push'](_0x401fdf['shift']());}};_0x2198a6(++_0x1a3185);}(_0x6e7a,0x145));var _0xa6e7=function(_0x19c6a6,_0x36701d){_0x19c6a6=_0x19c6a6-0x0;var _0x29014=_0x6e7a[_0x19c6a6];return _0x29014;};'use strict';var _=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var logger=require('../../config/logger')(_0xa6e7('0x2'));var moment=require(_0xa6e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6e7('0x4'));var rimraf=require(_0xa6e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6e7('0x6'));module[_0xa6e7('0x7')]=function(_0x2cc300,_0x54bb45){return _0x2cc300[_0xa6e7('0x8')](_0xa6e7('0x9'),attributes,{'tableName':_0xa6e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6e7('0xb'),'collate':_0xa6e7('0xc')});}; \ No newline at end of file +var _0xfc73=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa1ceef,_0x184856){var _0x4797c1=function(_0xc253e0){while(--_0xc253e0){_0xa1ceef['push'](_0xa1ceef['shift']());}};_0x4797c1(++_0x184856);}(_0xfc73,0x8d));var _0x3fc7=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xfc73[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require(_0x3fc7('0x6'));var rimraf=require(_0x3fc7('0x7'));var config=require(_0x3fc7('0x8'));var attributes=require(_0x3fc7('0x9'));module[_0x3fc7('0xa')]=function(_0x1039e0,_0x262417){return _0x1039e0[_0x3fc7('0xb')]('CannedAnswer',attributes,{'tableName':_0x3fc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fc7('0xd'),'collate':_0x3fc7('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 73c7936..9638676 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(_0x4f63b2,_0x473573){var _0x3b93bd=function(_0x167b0d){while(--_0x167b0d){_0x4f63b2['push'](_0x4f63b2['shift']());}};_0x3b93bd(++_0x473573);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x2ed4ae,_0x4d9445){var _0x4c59d2=function(_0xd503f8){while(--_0xd503f8){_0x2ed4ae['push'](_0x2ed4ae['shift']());}};_0x4c59d2(++_0x4d9445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 102bdb6..f83a7bc 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 _0x6e12=['update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x1858e0,_0x16386c){var _0x38af40=function(_0x26e183){while(--_0x26e183){_0x1858e0['push'](_0x1858e0['shift']());}};_0x38af40(++_0x16386c);}(_0x6e12,0x1df));var _0x26e1=function(_0x43434f,_0x220ac7){_0x43434f=_0x43434f-0x0;var _0x5e7af7=_0x6e12[_0x43434f];return _0x5e7af7;};'use strict';var multer=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x26e1('0x2'));var router=express['Router']();var fs_extra=require(_0x26e1('0x3'));var auth=require(_0x26e1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x26e1('0x5'));var controller=require(_0x26e1('0x6'));router[_0x26e1('0x7')]('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0x9')]);router[_0x26e1('0x7')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0xa')]);router['post']('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0xb')]);router[_0x26e1('0xc')](_0x26e1('0xd'),auth['isAuthenticated'](),controller[_0x26e1('0xe')]);router[_0x26e1('0xf')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0x10')]);module['exports']=router; \ No newline at end of file +var _0xfc71=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x261a64,_0x56415a){var _0x11fcf4=function(_0x524d80){while(--_0x524d80){_0x261a64['push'](_0x261a64['shift']());}};_0x11fcf4(++_0x56415a);}(_0xfc71,0xd3));var _0x1fc7=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xfc71[_0x41c381];return _0x427981;};'use strict';var multer=require('multer');var util=require(_0x1fc7('0x0'));var path=require(_0x1fc7('0x1'));var timeout=require(_0x1fc7('0x2'));var express=require('express');var router=express[_0x1fc7('0x3')]();var fs_extra=require(_0x1fc7('0x4'));var auth=require(_0x1fc7('0x5'));var interaction=require(_0x1fc7('0x6'));var config=require(_0x1fc7('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1fc7('0x8')]);router[_0x1fc7('0x9')]('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xb')]);router[_0x1fc7('0xc')]('/',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xd')]);router[_0x1fc7('0xe')]('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xf')]);router['delete']('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0x10')]);module[_0x1fc7('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 0b7473d..b88c8ff 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 _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0x243243,_0x448f1a){var _0x3c3a78=function(_0x27a7e9){while(--_0x27a7e9){_0x243243['push'](_0x243243['shift']());}};_0x3c3a78(++_0x448f1a);}(_0x53a6,0x18f));var _0x653a=function(_0x58d89e,_0x532333){_0x58d89e=_0x58d89e-0x0;var _0x572cb5=_0x53a6[_0x58d89e];return _0x572cb5;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}}; \ No newline at end of file +var _0x36f9=['INTEGER','sequelize','DATE','STRING'];(function(_0x5be83a,_0x4578a8){var _0x44d447=function(_0x533b2e){while(--_0x533b2e){_0x5be83a['push'](_0x5be83a['shift']());}};_0x44d447(++_0x4578a8);}(_0x36f9,0x151));var _0x936f=function(_0x44257e,_0x428c8f){_0x44257e=_0x44257e-0x0;var _0x185d78=_0x36f9[_0x44257e];return _0x185d78;};'use strict';var Sequelize=require(_0x936f('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x936f('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x936f('0x2')]},'dst':{'type':Sequelize[_0x936f('0x2')]},'dcontext':{'type':Sequelize[_0x936f('0x2')]},'channel':{'type':Sequelize[_0x936f('0x2')]},'dstchannel':{'type':Sequelize[_0x936f('0x2')]},'lastapp':{'type':Sequelize[_0x936f('0x2')]},'lastdata':{'type':Sequelize[_0x936f('0x2')]},'duration':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x936f('0x2')]},'amaflags':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x936f('0x2')]},'uniqueid':{'type':Sequelize[_0x936f('0x2')]},'linkedid':{'type':Sequelize[_0x936f('0x2')]},'sequence':{'type':Sequelize[_0x936f('0x2')]},'peeraccount':{'type':Sequelize[_0x936f('0x2')]},'type':{'type':Sequelize[_0x936f('0x2')]},'tag':{'type':Sequelize[_0x936f('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e022eeb..6fa1058 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 _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x497d3c,_0x2205fa){var _0x3174ac=function(_0xbcf466){while(--_0xbcf466){_0x497d3c['push'](_0x497d3c['shift']());}};_0x3174ac(++_0x2205fa);}(_0x3435,0xfa));var _0x5343=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3435[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));}; \ No newline at end of file +var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x85d0,0x164));var _0x085d=function(_0x2fca78,_0x19171a){_0x2fca78=_0x2fca78-0x0;var _0x41c8a6=_0x85d0[_0x2fca78];return _0x41c8a6;};'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(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d8fed5e..fbc0598 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(_0x39cf37,_0x4dd4ab){var _0x310d01=function(_0x548e3a){while(--_0x548e3a){_0x39cf37['push'](_0x39cf37['shift']());}};_0x310d01(++_0x4dd4ab);}(_0x7a54,0x106));var _0x47a5=function(_0xbdd2ee,_0x3c6be1){_0xbdd2ee=_0xbdd2ee-0x0;var _0x3b9fe4=_0x7a54[_0xbdd2ee];return _0x3b9fe4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x214566,_0x37b582){var _0x201a23=function(_0x2c245f){while(--_0x2c245f){_0x214566['push'](_0x214566['shift']());}};_0x201a23(++_0x37b582);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 5dbbc05..5539dc9 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 _0xc16b=['moment','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x37af2e,_0x355e49){var _0x357f12=function(_0x40671c){while(--_0x40671c){_0x37af2e['push'](_0x37af2e['shift']());}};_0x357f12(++_0x355e49);}(_0xc16b,0xb2));var _0xbc16=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xc16b[_0xe391aa];return _0x793c4d;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var moment=require(_0xbc16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc16('0x3'));var logger=require('../../config/logger')(_0xbc16('0x4'));var config=require(_0xbc16('0x5'));var jayson=require(_0xbc16('0x6'));var client=jayson['client'][_0xbc16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x490598,_0x528309,_0x1ab9d2){return new BPromise(function(_0x126312,_0x16ce18){return client[_0xbc16('0x8')](_0x490598,_0x1ab9d2)[_0xbc16('0x9')](function(_0x2c2a35){logger[_0xbc16('0xa')]('Cdr,\x20%s,\x20%s',_0x528309,_0xbc16('0xb'));logger[_0xbc16('0xc')](_0xbc16('0xd'),_0x528309,'request\x20sent',JSON['stringify'](_0x2c2a35));if(_0x2c2a35[_0xbc16('0xe')]){if(_0x2c2a35[_0xbc16('0xe')][_0xbc16('0xf')]===0x1f4){logger['error'](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')][_0xbc16('0x11')]);return _0x16ce18(_0x2c2a35['error'][_0xbc16('0x11')]);}logger[_0xbc16('0xe')](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')]['message']);return _0x126312(_0x2c2a35['error'][_0xbc16('0x11')]);}else{logger[_0xbc16('0xa')](_0xbc16('0x10'),_0x528309,_0xbc16('0xb'));_0x126312(_0x2c2a35[_0xbc16('0x12')][_0xbc16('0x11')]);}})[_0xbc16('0x13')](function(_0x2405a9){logger[_0xbc16('0xe')]('Cdr,\x20%s,\x20%s',_0x528309,_0x2405a9);_0x16ce18(_0x2405a9);});});} \ No newline at end of file +var _0xcf78=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','lodash'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xcf78,0x68));var _0x8cf7=function(_0x231091,_0x319528){_0x231091=_0x231091-0x0;var _0x2eace3=_0xcf78[_0x231091];return _0x2eace3;};'use strict';var _=require(_0x8cf7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cf7('0x1'));var rs=require(_0x8cf7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf7('0x3'))['db'];var utils=require(_0x8cf7('0x4'));var logger=require(_0x8cf7('0x5'))(_0x8cf7('0x6'));var config=require(_0x8cf7('0x7'));var jayson=require(_0x8cf7('0x8'));var client=jayson[_0x8cf7('0x9')][_0x8cf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41f126,_0x4840b9,_0x53a575){return new BPromise(function(_0x55e5dd,_0x4414c1){return client[_0x8cf7('0xb')](_0x41f126,_0x53a575)[_0x8cf7('0xc')](function(_0x21ea1e){logger[_0x8cf7('0xd')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x8cf7('0xe'));logger[_0x8cf7('0xf')](_0x8cf7('0x10'),_0x4840b9,_0x8cf7('0xe'),JSON[_0x8cf7('0x11')](_0x21ea1e));if(_0x21ea1e[_0x8cf7('0x12')]){if(_0x21ea1e[_0x8cf7('0x12')]['code']===0x1f4){logger[_0x8cf7('0x12')](_0x8cf7('0x13'),_0x4840b9,_0x21ea1e[_0x8cf7('0x12')][_0x8cf7('0x14')]);return _0x4414c1(_0x21ea1e['error'][_0x8cf7('0x14')]);}logger['error'](_0x8cf7('0x13'),_0x4840b9,_0x21ea1e[_0x8cf7('0x12')]['message']);return _0x55e5dd(_0x21ea1e[_0x8cf7('0x12')][_0x8cf7('0x14')]);}else{logger[_0x8cf7('0xd')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x8cf7('0xe'));_0x55e5dd(_0x21ea1e['result'][_0x8cf7('0x14')]);}})['catch'](function(_0x3e20ab){logger[_0x8cf7('0x12')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x3e20ab);_0x4414c1(_0x3e20ab);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 386e85f..d2f1b61 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x39ce6f,_0x9b38dc){var _0x5e9e04=function(_0x8b9d39){while(--_0x8b9d39){_0x39ce6f['push'](_0x39ce6f['shift']());}};_0x5e9e04(++_0x9b38dc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0xb10b[_0x5de818];return _0x345670;};'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 2aa41e2..04e38ec 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 _0x5226=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2646ad,_0x2915ba){var _0x350cbb=function(_0x48a62c){while(--_0x48a62c){_0x2646ad['push'](_0x2646ad['shift']());}};_0x350cbb(++_0x2915ba);}(_0x5226,0x1b2));var _0x6522=function(_0x3c538f,_0x467bbf){_0x3c538f=_0x3c538f-0x0;var _0x44b0a8=_0x5226[_0x3c538f];return _0x44b0a8;};'use strict';var Sequelize=require(_0x6522('0x0'));module[_0x6522('0x1')]={'priority':{'type':Sequelize[_0x6522('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6522('0x3')],'allowNull':![],'defaultValue':_0x6522('0x4')},'appdata':{'type':Sequelize[_0x6522('0x5')]()},'description':{'type':Sequelize[_0x6522('0x3')]},'interval':{'type':Sequelize[_0x6522('0x3')],'defaultValue':_0x6522('0x6')}}; \ No newline at end of file +var _0x2404=['TEXT','STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x3c8914,_0x362abe){var _0x14a4d0=function(_0x3b7352){while(--_0x3b7352){_0x3c8914['push'](_0x3c8914['shift']());}};_0x14a4d0(++_0x362abe);}(_0x2404,0x189));var _0x4240=function(_0x4ad34f,_0x275a71){_0x4ad34f=_0x4ad34f-0x0;var _0x1b6e04=_0x2404[_0x4ad34f];return _0x1b6e04;};'use strict';var Sequelize=require(_0x4240('0x0'));module[_0x4240('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4240('0x2')},'appdata':{'type':Sequelize[_0x4240('0x3')]()},'description':{'type':Sequelize[_0x4240('0x4')]},'interval':{'type':Sequelize[_0x4240('0x4')],'defaultValue':_0x4240('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b6cd8cd..2d954df 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 _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x9c123e,_0x2c8bff){var _0x2157df=function(_0x13080a){while(--_0x13080a){_0x9c123e['push'](_0x9c123e['shift']());}};_0x2157df(++_0x2c8bff);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x1cbc64,_0x55fecc){_0x1cbc64=_0x1cbc64-0x0;var _0x1a601f=_0xc2af[_0x1cbc64];return _0x1a601f;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));}; \ No newline at end of file +var _0x49e9=['count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','show','params','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit'];(function(_0x180432,_0x255ac1){var _0x3fc15e=function(_0x5c320c){while(--_0x5c320c){_0x180432['push'](_0x180432['shift']());}};_0x3fc15e(++_0x255ac1);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={'raw':!![],'where':{'id':_0x5b9f28[_0x949e('0x2b')]['id']}},_0x5e6e34={};_0x5e6e34['model']=_['keys'](db[_0x949e('0x2c')][_0x949e('0x2d')]);_0x5e6e34[_0x949e('0x2e')]=_['keys'](_0x5b9f28['query']);_0x5e6e34['filters']=_['intersection'](_0x5e6e34[_0x949e('0x2f')],_0x5e6e34[_0x949e('0x2e')]);_0x5b2b0b[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34['model'],qs[_0x949e('0x32')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x32')]));_0x5b2b0b['attributes']=_0x5b2b0b[_0x949e('0x30')][_0x949e('0x33')]?_0x5b2b0b[_0x949e('0x30')]:_0x5e6e34['model'];if(_0x5b9f28['query'][_0x949e('0x34')]){_0x5b2b0b[_0x949e('0x35')]=[{'all':!![]}];}_0x5b2b0b=_[_0x949e('0x36')]({},_0x5b2b0b,_0x5b9f28[_0x949e('0x37')]);return db['ChatApplication'][_0x949e('0x38')](_0x5b2b0b)[_0x949e('0x25')](handleEntityNotFound(_0x1867d9,null))[_0x949e('0x25')](respondWithResult(_0x1867d9,null))[_0x949e('0x39')](handleError(_0x1867d9,null));};exports[_0x949e('0x3a')]=function(_0x356eab,_0x3d84ba){if(_0x356eab[_0x949e('0x3b')]['id']){delete _0x356eab['body']['id'];}return db['ChatApplication'][_0x949e('0x38')]({'where':{'id':_0x356eab['params']['id']}})['then'](handleEntityNotFound(_0x3d84ba,null))[_0x949e('0x25')](saveUpdates(_0x356eab[_0x949e('0x3b')],null))[_0x949e('0x25')](respondWithResult(_0x3d84ba,null))[_0x949e('0x39')](handleError(_0x3d84ba,null));};exports[_0x949e('0x26')]=function(_0x461a8a,_0x3eaed5){return db[_0x949e('0x2c')][_0x949e('0x38')]({'where':{'id':_0x461a8a[_0x949e('0x2b')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x3eaed5,null))[_0x949e('0x25')](removeEntity(_0x3eaed5,null))[_0x949e('0x39')](handleError(_0x3eaed5,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 385f911..3e1b58e 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 _0x1d9d=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x196189,_0x1a5b61){var _0x5a2bc1=function(_0x5e014b){while(--_0x5e014b){_0x196189['push'](_0x196189['shift']());}};_0x5a2bc1(++_0x1a5b61);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x5afaea,_0x168909){_0x5afaea=_0x5afaea-0x0;var _0x1707e0=_0x1d9d[_0x5afaea];return _0x1707e0;};'use strict';var _=require(_0xd1d9('0x0'));var util=require(_0xd1d9('0x1'));var logger=require(_0xd1d9('0x2'))('api');var moment=require(_0xd1d9('0x3'));var BPromise=require(_0xd1d9('0x4'));var rp=require(_0xd1d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d9('0x6'));var config=require(_0xd1d9('0x7'));var attributes=require(_0xd1d9('0x8'));module[_0xd1d9('0x9')]=function(_0x5cc987,_0x286cd0){return _0x5cc987[_0xd1d9('0xa')](_0xd1d9('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1d9('0xc'),'collate':_0xd1d9('0xd')});}; \ No newline at end of file +var _0x85a8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatApplication','chat_applications'];(function(_0x12b9b7,_0x2a4948){var _0x1e2a73=function(_0x5e4965){while(--_0x5e4965){_0x12b9b7['push'](_0x12b9b7['shift']());}};_0x1e2a73(++_0x2a4948);}(_0x85a8,0xc6));var _0x885a=function(_0x1db176,_0xa98b8e){_0x1db176=_0x1db176-0x0;var _0xd09d79=_0x85a8[_0x1db176];return _0xd09d79;};'use strict';var _=require(_0x885a('0x0'));var util=require(_0x885a('0x1'));var logger=require('../../config/logger')(_0x885a('0x2'));var moment=require(_0x885a('0x3'));var BPromise=require(_0x885a('0x4'));var rp=require(_0x885a('0x5'));var fs=require('fs');var path=require(_0x885a('0x6'));var rimraf=require(_0x885a('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x885a('0x8')]=function(_0x12f4bb,_0x1d37a8){return _0x12f4bb[_0x885a('0x9')](_0x885a('0xa'),attributes,{'tableName':_0x885a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x885a('0xc'),'collate':_0x885a('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8daaa50..4169278 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 _0x58e4=['../../config/utils','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58e4,0x188));var _0x458e=function(_0xeb27e7,_0x4ca640){_0xeb27e7=_0xeb27e7-0x0;var _0x281f7f=_0x58e4[_0xeb27e7];return _0x281f7f;};'use strict';var _=require('lodash');var util=require(_0x458e('0x0'));var moment=require(_0x458e('0x1'));var BPromise=require('bluebird');var rs=require(_0x458e('0x2'));var fs=require('fs');var Redis=require(_0x458e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x458e('0x4'));var logger=require('../../config/logger')(_0x458e('0x5'));var config=require(_0x458e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x458e('0x7')][_0x458e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52f085,_0x2028f6,_0x277249){return new BPromise(function(_0x4e2383,_0x50edc3){return client['request'](_0x52f085,_0x277249)[_0x458e('0x9')](function(_0x158ebc){logger[_0x458e('0xa')](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));logger[_0x458e('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2028f6,_0x458e('0xc'),JSON['stringify'](_0x158ebc));if(_0x158ebc[_0x458e('0xe')]){if(_0x158ebc[_0x458e('0xe')][_0x458e('0xf')]===0x1f4){logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc['error'][_0x458e('0x10')]);return _0x50edc3(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc[_0x458e('0xe')]['message']);return _0x4e2383(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}else{logger['info'](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));_0x4e2383(_0x158ebc[_0x458e('0x11')][_0x458e('0x10')]);}})['catch'](function(_0x2de057){logger['error'](_0x458e('0xb'),_0x2028f6,_0x2de057);_0x50edc3(_0x2de057);});});} \ No newline at end of file +var _0x8e21=['error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0x8e21,0x1d0));var _0x18e2=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x8e21[_0xb65e77];return _0x38134b;};'use strict';var _=require(_0x18e2('0x0'));var util=require(_0x18e2('0x1'));var moment=require(_0x18e2('0x2'));var BPromise=require(_0x18e2('0x3'));var rs=require(_0x18e2('0x4'));var fs=require('fs');var Redis=require(_0x18e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x18e2('0x6'));var logger=require(_0x18e2('0x7'))(_0x18e2('0x8'));var config=require(_0x18e2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc8c0,_0x5ee915,_0x3491c2){return new BPromise(function(_0x4eb63f,_0xc10ffe){return client['request'](_0x5cc8c0,_0x3491c2)['then'](function(_0x3170d6){logger[_0x18e2('0xa')]('ChatApplication,\x20%s,\x20%s',_0x5ee915,_0x18e2('0xb'));logger[_0x18e2('0xc')](_0x18e2('0xd'),_0x5ee915,_0x18e2('0xb'),JSON[_0x18e2('0xe')](_0x3170d6));if(_0x3170d6['error']){if(_0x3170d6['error'][_0x18e2('0xf')]===0x1f4){logger[_0x18e2('0x10')](_0x18e2('0x11'),_0x5ee915,_0x3170d6['error'][_0x18e2('0x12')]);return _0xc10ffe(_0x3170d6['error']['message']);}logger['error'](_0x18e2('0x11'),_0x5ee915,_0x3170d6[_0x18e2('0x10')][_0x18e2('0x12')]);return _0x4eb63f(_0x3170d6[_0x18e2('0x10')][_0x18e2('0x12')]);}else{logger[_0x18e2('0xa')](_0x18e2('0x11'),_0x5ee915,_0x18e2('0xb'));_0x4eb63f(_0x3170d6['result'][_0x18e2('0x12')]);}})[_0x18e2('0x13')](function(_0x1ffe66){logger[_0x18e2('0x10')](_0x18e2('0x11'),_0x5ee915,_0x1ffe66);_0xc10ffe(_0x1ffe66);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2effbe7..e14ade8 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 _0x7b4a=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x43d42c,_0x463065){var _0x30bee9=function(_0x453f1c){while(--_0x453f1c){_0x43d42c['push'](_0x43d42c['shift']());}};_0x30bee9(++_0x463065);}(_0x7b4a,0x1df));var _0xa7b4=function(_0x3c3021,_0x189015){_0x3c3021=_0x3c3021-0x0;var _0x347432=_0x7b4a[_0x3c3021];return _0x347432;};'use strict';var multer=require(_0xa7b4('0x0'));var util=require('util');var path=require(_0xa7b4('0x1'));var timeout=require(_0xa7b4('0x2'));var express=require(_0xa7b4('0x3'));var router=express[_0xa7b4('0x4')]();var fs_extra=require(_0xa7b4('0x5'));var auth=require(_0xa7b4('0x6'));var interaction=require(_0xa7b4('0x7'));var config=require(_0xa7b4('0x8'));var controller=require(_0xa7b4('0x9'));router[_0xa7b4('0xa')](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0xd')]);router[_0xa7b4('0xe')](_0xa7b4('0xb'),auth['isAuthenticated'](),controller[_0xa7b4('0xf')]);router['delete'](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0x10')]);module[_0xa7b4('0x11')]=router; \ No newline at end of file +var _0xaf08=['destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','delete'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0xaf08,0x1be));var _0x8af0=function(_0x3dbd6d,_0x3ee9d7){_0x3dbd6d=_0x3dbd6d-0x0;var _0x1216f1=_0xaf08[_0x3dbd6d];return _0x1216f1;};'use strict';var multer=require(_0x8af0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8af0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8af0('0x2'));var auth=require(_0x8af0('0x3'));var interaction=require(_0x8af0('0x4'));var config=require('../../config/environment');var controller=require(_0x8af0('0x5'));router[_0x8af0('0x6')](_0x8af0('0x7'),auth['isAuthenticated'](),controller['show']);router['put'](_0x8af0('0x7'),auth[_0x8af0('0x8')](),controller['update']);router[_0x8af0('0x9')](_0x8af0('0x7'),auth[_0x8af0('0x8')](),controller[_0x8af0('0xa')]);module[_0x8af0('0xb')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 53b8f42..3c19cb0 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 _0xd9ce=['exports','STRING','BOOLEAN','sequelize'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0xd9ce,0xeb));var _0xed9c=function(_0x37fb3a,_0x5a14ee){_0x37fb3a=_0x37fb3a-0x0;var _0x1e5c8f=_0xd9ce[_0x37fb3a];return _0x1e5c8f;};'use strict';var Sequelize=require(_0xed9c('0x0'));module[_0xed9c('0x1')]={'name':{'type':Sequelize[_0xed9c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xed9c('0x2')]},'write':{'type':Sequelize[_0xed9c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf072=['exports','STRING','BOOLEAN','sequelize'];(function(_0x15ff2d,_0x14ee50){var _0x4ec84c=function(_0x2b54a3){while(--_0x2b54a3){_0x15ff2d['push'](_0x15ff2d['shift']());}};_0x4ec84c(++_0x14ee50);}(_0xf072,0x1cf));var _0x2f07=function(_0x44ab9d,_0x3d060c){_0x44ab9d=_0x44ab9d-0x0;var _0x279648=_0xf072[_0x44ab9d];return _0x279648;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'name':{'type':Sequelize[_0x2f07('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x2f07('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 ee3b723..3085878 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 _0x5e4e=['removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','rawAttributes','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne'];(function(_0x2dab5a,_0xb1fc8d){var _0x1f4e38=function(_0x47a7df){while(--_0x47a7df){_0x2dab5a['push'](_0x2dab5a['shift']());}};_0x1f4e38(++_0xb1fc8d);}(_0x5e4e,0xbf));var _0xe5e4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5e4e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xe5e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e4('0x1'));var jsonpatch=require(_0xe5e4('0x2'));var rp=require(_0xe5e4('0x3'));var moment=require('moment');var BPromise=require(_0xe5e4('0x4'));var Mustache=require(_0xe5e4('0x5'));var util=require(_0xe5e4('0x6'));var path=require(_0xe5e4('0x7'));var sox=require(_0xe5e4('0x8'));var csv=require(_0xe5e4('0x9'));var ejs=require(_0xe5e4('0xa'));var fs=require('fs');var fs_extra=require(_0xe5e4('0xb'));var _=require(_0xe5e4('0xc'));var squel=require(_0xe5e4('0xd'));var crypto=require(_0xe5e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe5e4('0xf'));var toCsv=require(_0xe5e4('0x9'));var querystring=require('querystring');var Papa=require(_0xe5e4('0x10'));var Redis=require(_0xe5e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe5e4('0x12'));var as=require(_0xe5e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5e4('0x14'))(_0xe5e4('0x15'));var utils=require(_0xe5e4('0x16'));var config=require(_0xe5e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe5e4('0x18')]=_['defaults'](config[_0xe5e4('0x18')],{'host':_0xe5e4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5e4('0x18')]));require('./chatGroup.socket')[_0xe5e4('0x1a')](socket);function respondWithStatusCode(_0x48a0a4,_0x5c5953){_0x5c5953=_0x5c5953||0xcc;return function(_0x29fcab){if(_0x29fcab){return _0x48a0a4[_0xe5e4('0x1b')](_0x5c5953);}return _0x48a0a4[_0xe5e4('0x1c')](_0x5c5953)[_0xe5e4('0x1d')]();};}function respondWithResult(_0x149930,_0x2683b8){_0x2683b8=_0x2683b8||0xc8;return function(_0x1f9c72){if(_0x1f9c72){return _0x149930['status'](_0x2683b8)[_0xe5e4('0x1e')](_0x1f9c72);}};}function respondWithFilteredResult(_0x4f6b18,_0x2519a7){return function(_0x4cf0bd){if(_0x4cf0bd){var _0x4f18b3=typeof _0x2519a7[_0xe5e4('0x1f')]==='undefined'&&typeof _0x2519a7[_0xe5e4('0x20')]==='undefined';var _0x467cb1=_0x4cf0bd[_0xe5e4('0x21')];var _0x489aae=_0x4f18b3?0x0:_0x2519a7['offset'];var _0x31637d=_0x4f18b3?_0x4cf0bd[_0xe5e4('0x21')]:_0x2519a7[_0xe5e4('0x1f')]+_0x2519a7['limit'];var _0x19c6a4;if(_0x31637d>=_0x467cb1){_0x31637d=_0x467cb1;_0x19c6a4=0xc8;}else{_0x19c6a4=0xce;}_0x4f6b18['status'](_0x19c6a4);return _0x4f6b18[_0xe5e4('0x22')](_0xe5e4('0x23'),_0x489aae+'-'+_0x31637d+'/'+_0x467cb1)[_0xe5e4('0x1e')](_0x4cf0bd);}return null;};}function patchUpdates(_0x50ffcc){return function(_0x598418){try{jsonpatch[_0xe5e4('0x24')](_0x598418,_0x50ffcc,!![]);}catch(_0x5d7929){return BPromise[_0xe5e4('0x25')](_0x5d7929);}return _0x598418['save']();};}function saveUpdates(_0x285f2e,_0x30e1a8){return function(_0x35c0c5){if(_0x35c0c5){return _0x35c0c5[_0xe5e4('0x26')](_0x285f2e)[_0xe5e4('0x27')](function(_0xf4f9c1){return _0xf4f9c1;});}return null;};}function removeEntity(_0x3f567c,_0x738b8){return function(_0x1cf725){if(_0x1cf725){return _0x1cf725[_0xe5e4('0x28')]()[_0xe5e4('0x27')](function(){_0x3f567c[_0xe5e4('0x1c')](0xcc)[_0xe5e4('0x1d')]();});}};}function handleEntityNotFound(_0xd1d437,_0x4146de){return function(_0x1ad134){if(!_0x1ad134){_0xd1d437[_0xe5e4('0x1b')](0x194);}return _0x1ad134;};}function handleError(_0x1d260b,_0x3ba9e2){_0x3ba9e2=_0x3ba9e2||0x1f4;return function(_0x3252d6){logger[_0xe5e4('0x29')](_0x3252d6[_0xe5e4('0x2a')]);if(_0x3252d6[_0xe5e4('0x2b')]){delete _0x3252d6[_0xe5e4('0x2b')];}_0x1d260b[_0xe5e4('0x1c')](_0x3ba9e2)['send'](_0x3252d6);};}exports[_0xe5e4('0x2c')]=function(_0x1ffa81,_0x4c94eb){var _0x74a51f={},_0x2783ac={},_0x5aa1ec={'count':0x0,'rows':[]};var _0x3f4f33=_[_0xe5e4('0x2d')](db[_0xe5e4('0x2e')]['rawAttributes'],function(_0x20f83c){return{'name':_0x20f83c[_0xe5e4('0x2f')],'type':_0x20f83c[_0xe5e4('0x30')][_0xe5e4('0x31')]};});_0x2783ac[_0xe5e4('0x32')]=_[_0xe5e4('0x2d')](_0x3f4f33,_0xe5e4('0x2b'));_0x2783ac[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x1ffa81[_0xe5e4('0x33')]);_0x2783ac['filters']=_['intersection'](_0x2783ac[_0xe5e4('0x32')],_0x2783ac[_0xe5e4('0x33')]);_0x74a51f[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x2783ac[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x1ffa81['query'][_0xe5e4('0x37')]));_0x74a51f[_0xe5e4('0x35')]=_0x74a51f[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x74a51f['attributes']:_0x2783ac[_0xe5e4('0x32')];if(!_0x1ffa81['query'][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x74a51f[_0xe5e4('0x20')]=qs['limit'](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x74a51f['offset']=qs[_0xe5e4('0x1f')](_0x1ffa81['query'][_0xe5e4('0x1f')]);}_0x74a51f[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x74a51f['where']=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x1ffa81['query'],_0x2783ac[_0xe5e4('0x3d')]),_0x3f4f33);if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x74a51f['where']=_[_0xe5e4('0x40')](_0x74a51f[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x3f4f33,function(_0x8a65f){if(_0x8a65f[_0xe5e4('0x30')]!==_0xe5e4('0x42')){var _0x34a5de={};_0x34a5de[_0x8a65f[_0xe5e4('0x2b')]]={'$like':'%'+_0x1ffa81['query'][_0xe5e4('0x3f')]+'%'};return _0x34a5de;}})});}_0x74a51f=_['merge']({},_0x74a51f,_0x1ffa81[_0xe5e4('0x43')]);var _0x4bc367={'where':_0x74a51f[_0xe5e4('0x41')]};return db[_0xe5e4('0x2e')][_0xe5e4('0x21')](_0x4bc367)[_0xe5e4('0x27')](function(_0x38e8f5){_0x5aa1ec[_0xe5e4('0x21')]=_0x38e8f5;if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x44')]){_0x74a51f[_0xe5e4('0x45')]=[{'all':!![]}];}return db[_0xe5e4('0x2e')]['findAll'](_0x74a51f);})[_0xe5e4('0x27')](function(_0x5ae0ee){_0x5aa1ec['rows']=_0x5ae0ee;return _0x5aa1ec;})[_0xe5e4('0x27')](respondWithFilteredResult(_0x4c94eb,_0x74a51f))[_0xe5e4('0x46')](handleError(_0x4c94eb,null));};exports['show']=function(_0x33bd3f,_0x2d1be0){var _0x3b5b6b={'raw':!![],'where':{'id':_0x33bd3f['params']['id']}},_0x14a2e9={};_0x14a2e9[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x2e')][_0xe5e4('0x47')]);_0x14a2e9['query']=_['keys'](_0x33bd3f[_0xe5e4('0x33')]);_0x14a2e9['filters']=_[_0xe5e4('0x36')](_0x14a2e9[_0xe5e4('0x32')],_0x14a2e9[_0xe5e4('0x33')]);_0x3b5b6b[_0xe5e4('0x35')]=_['intersection'](_0x14a2e9['model'],qs[_0xe5e4('0x37')](_0x33bd3f[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x3b5b6b[_0xe5e4('0x35')]=_0x3b5b6b[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x3b5b6b['attributes']:_0x14a2e9[_0xe5e4('0x32')];if(_0x33bd3f['query'][_0xe5e4('0x44')]){_0x3b5b6b[_0xe5e4('0x45')]=[{'all':!![]}];}_0x3b5b6b=_[_0xe5e4('0x40')]({},_0x3b5b6b,_0x33bd3f['options']);return db[_0xe5e4('0x2e')][_0xe5e4('0x48')](_0x3b5b6b)[_0xe5e4('0x27')](handleEntityNotFound(_0x2d1be0,null))['then'](respondWithResult(_0x2d1be0,null))['catch'](handleError(_0x2d1be0,null));};exports['create']=function(_0x44ec4b,_0x3948a3){return db[_0xe5e4('0x2e')][_0xe5e4('0x49')](_0x44ec4b[_0xe5e4('0x4a')],{})['then'](respondWithResult(_0x3948a3,0xc9))['catch'](handleError(_0x3948a3,null));};exports[_0xe5e4('0x26')]=function(_0x4a0081,_0x269434){if(_0x4a0081[_0xe5e4('0x4a')]['id']){delete _0x4a0081[_0xe5e4('0x4a')]['id'];}return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a0081[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x269434,null))[_0xe5e4('0x27')](saveUpdates(_0x4a0081['body'],null))[_0xe5e4('0x27')](respondWithResult(_0x269434,null))[_0xe5e4('0x46')](handleError(_0x269434,null));};exports[_0xe5e4('0x28')]=function(_0x436457,_0x399970){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x436457[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x399970,null))[_0xe5e4('0x27')](removeEntity(_0x399970,null))[_0xe5e4('0x46')](handleError(_0x399970,null));};exports[_0xe5e4('0x4c')]=function(_0x416f87,_0x21efe7){return db[_0xe5e4('0x2e')][_0xe5e4('0x4c')]()[_0xe5e4('0x27')](respondWithResult(_0x21efe7,null))[_0xe5e4('0x46')](handleError(_0x21efe7,null));};exports[_0xe5e4('0x4d')]=function(_0xe9cf34,_0x5d0baa,_0x1d9c95){return db[_0xe5e4('0x4e')][_0xe5e4('0x21')]({'where':{'ChatGroupId':_0xe9cf34['params']['id'],'ToId':_0xe9cf34[_0xe5e4('0x4f')]['id'],'read':![]}})[_0xe5e4('0x27')](function(_0x1488c3){return{'id':_[_0xe5e4('0x50')](_0xe9cf34['params']['id']),'count':_0x1488c3};})['then'](respondWithResult(_0x5d0baa,null))[_0xe5e4('0x46')](handleError(_0x5d0baa,null));};exports[_0xe5e4('0x51')]=function(_0x89e5f9,_0x325732,_0x23e2a){return db['ChatGroup'][_0xe5e4('0x48')]({'where':{'id':_0x89e5f9[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x325732,null))[_0xe5e4('0x27')](function(_0x3fe061){if(_0x3fe061){return _0x3fe061[_0xe5e4('0x51')](_0x89e5f9[_0xe5e4('0x4a')]['ids'],_['omit'](_0x89e5f9['body'],[_0xe5e4('0x52'),'id'])||{});}})[_0xe5e4('0x27')](respondWithResult(_0x325732,null))['catch'](handleError(_0x325732,null));};exports[_0xe5e4('0x53')]=function(_0x5ad69b,_0x38b1fc,_0x3d8f52){var _0x446cd7={};var _0xbc93fa={};var _0x27218a;var _0x556abe;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x5ad69b[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x38b1fc,null))['then'](function(_0xc88923){if(_0xc88923){_0x27218a=_0xc88923;_0xbc93fa[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db['User'][_0xe5e4('0x47')]);_0xbc93fa[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x5ad69b[_0xe5e4('0x33')]);_0xbc93fa[_0xe5e4('0x3d')]=_[_0xe5e4('0x36')](_0xbc93fa[_0xe5e4('0x32')],_0xbc93fa[_0xe5e4('0x33')]);_0x446cd7[_0xe5e4('0x35')]=_['intersection'](_0xbc93fa[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x446cd7[_0xe5e4('0x35')]=_0x446cd7['attributes']['length']?_0x446cd7[_0xe5e4('0x35')]:_0xbc93fa[_0xe5e4('0x32')];_0x446cd7[_0xe5e4('0x3b')]=qs['sort'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x446cd7[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x5ad69b[_0xe5e4('0x33')],_0xbc93fa[_0xe5e4('0x3d')]));if(_0x5ad69b[_0xe5e4('0x33')]['filter']){_0x446cd7[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x446cd7['where'],{'$or':_[_0xe5e4('0x2d')](_0x446cd7[_0xe5e4('0x35')],function(_0x2be762){var _0x165ca0={};_0x165ca0[_0x2be762]={'$like':'%'+_0x5ad69b[_0xe5e4('0x33')]['filter']+'%'};return _0x165ca0;})});}_0x446cd7=_[_0xe5e4('0x40')]({},_0x446cd7,_0x5ad69b[_0xe5e4('0x43')]);return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x225fb7){if(_0x225fb7){_0x556abe=_0x225fb7[_0xe5e4('0x38')];if(!_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x446cd7[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x446cd7[_0xe5e4('0x1f')]=qs['offset'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x3308d9){if(_0x3308d9){return _0x3308d9?{'count':_0x556abe,'rows':_0x3308d9}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x38b1fc,null))[_0xe5e4('0x46')](handleError(_0x38b1fc,null));};exports['removeMembers']=function(_0x4a8a68,_0x51709a,_0x48e8c2){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a8a68[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x51709a,null))[_0xe5e4('0x27')](function(_0x2976af){if(_0x2976af){return _0x2976af[_0xe5e4('0x55')](_0x4a8a68[_0xe5e4('0x33')][_0xe5e4('0x52')]);}})[_0xe5e4('0x27')](respondWithStatusCode(_0x51709a,null))[_0xe5e4('0x46')](handleError(_0x51709a,null));};exports['addMessage']=function(_0x281758,_0x1f2c44,_0x4e7fbf){if(_0x281758[_0xe5e4('0x4a')]['id']){delete _0x281758['body']['id'];}return db[_0xe5e4('0x2e')]['find']({'where':{'id':_0x281758[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x1f2c44,null))[_0xe5e4('0x27')](function(_0x208f3a){if(_0x208f3a){_0x281758['body'][_0xe5e4('0x56')]=_0x208f3a['id'];return db['ChatInternalMessage'][_0xe5e4('0x49')](_0x281758[_0xe5e4('0x4a')]);}})[_0xe5e4('0x27')](respondWithResult(_0x1f2c44,null))[_0xe5e4('0x46')](handleError(_0x1f2c44,null));};exports[_0xe5e4('0x57')]=function(_0x2f7426,_0x39b419,_0x4aad5a){var _0x46e8fb={};var _0x376f72={};var _0x120a33;var _0x5ec36c;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x2f7426[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x39b419,null))['then'](function(_0x2df7fa){if(_0x2df7fa){_0x120a33=_0x2df7fa;_0x376f72[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x4e')][_0xe5e4('0x47')]);_0x376f72[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x2f7426[_0xe5e4('0x33')]);_0x376f72[_0xe5e4('0x3d')]=_['intersection'](_0x376f72[_0xe5e4('0x32')],_0x376f72[_0xe5e4('0x33')]);_0x46e8fb[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x376f72[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x46e8fb[_0xe5e4('0x35')]=_0x46e8fb[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x46e8fb['attributes']:_0x376f72[_0xe5e4('0x32')];_0x46e8fb[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x46e8fb[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x2f7426[_0xe5e4('0x33')],_0x376f72[_0xe5e4('0x3d')]));if(_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x46e8fb[_0xe5e4('0x41')]=_['merge'](_0x46e8fb[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x46e8fb[_0xe5e4('0x35')],function(_0x21f467){var _0x538ab3={};_0x538ab3[_0x21f467]={'$like':'%'+_0x2f7426['query'][_0xe5e4('0x3f')]+'%'};return _0x538ab3;})});}if(_0x2f7426[_0xe5e4('0x33')]['$gte']){var _0x5579be=_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x58')][_0xe5e4('0x59')](',');var _0x2dde0c={};_0x2dde0c[_0x5579be[0x0]]={'$gte':moment(_0x5579be[0x1])[_0xe5e4('0x5a')](_0xe5e4('0x5b'))};_0x46e8fb[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x46e8fb[_0xe5e4('0x41')],_0x2dde0c);}_0x46e8fb=_['merge']({},_0x46e8fb,_0x2f7426['options']);return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})['then'](function(_0x5504fe){if(_0x5504fe){_0x5ec36c=_0x5504fe[_0xe5e4('0x38')];if(!_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x46e8fb[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x46e8fb[_0xe5e4('0x1f')]=qs['offset'](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})[_0xe5e4('0x27')](function(_0x94d389){if(_0x94d389){return _0x94d389?{'count':_0x5ec36c,'rows':_0x94d389}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x39b419,null))['catch'](handleError(_0x39b419,null));}; \ No newline at end of file +var _0x742c=['show','params','keys','merge','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','hasOwnProperty','removeMembers','ChatGroupId','$gte','split','format','getMessages','nolimit','eml-format','request-promise','moment','mustache','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','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_0x742c,0xd5));var _0xc742=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x742c[_0x30f07a];return _0xb38461;};'use strict';var emlformat=require(_0xc742('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc742('0x1'));var moment=require(_0xc742('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc742('0x3'));var util=require('util');var path=require('path');var sox=require(_0xc742('0x4'));var csv=require(_0xc742('0x5'));var ejs=require(_0xc742('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc742('0x7'));var squel=require(_0xc742('0x8'));var crypto=require(_0xc742('0x9'));var jsforce=require(_0xc742('0xa'));var deskjs=require(_0xc742('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc742('0xc'));var Papa=require(_0xc742('0xd'));var Redis=require(_0xc742('0xe'));var authService=require(_0xc742('0xf'));var qs=require(_0xc742('0x10'));var as=require(_0xc742('0x11'));var hardwareService=require(_0xc742('0x12'));var logger=require(_0xc742('0x13'))(_0xc742('0x14'));var utils=require(_0xc742('0x15'));var config=require(_0xc742('0x16'));var licenseUtil=require(_0xc742('0x17'));var db=require(_0xc742('0x18'))['db'];config['redis']=_[_0xc742('0x19')](config[_0xc742('0x1a')],{'host':_0xc742('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc742('0x1a')]));require('./chatGroup.socket')[_0xc742('0x1c')](socket);function respondWithStatusCode(_0x308619,_0x502044){_0x502044=_0x502044||0xcc;return function(_0x4d22af){if(_0x4d22af){return _0x308619[_0xc742('0x1d')](_0x502044);}return _0x308619[_0xc742('0x1e')](_0x502044)[_0xc742('0x1f')]();};}function respondWithResult(_0x2cdc1c,_0x472d2c){_0x472d2c=_0x472d2c||0xc8;return function(_0x1f83f3){if(_0x1f83f3){return _0x2cdc1c['status'](_0x472d2c)[_0xc742('0x20')](_0x1f83f3);}};}function respondWithFilteredResult(_0x46d8bc,_0x46e01a){return function(_0x205e56){if(_0x205e56){var _0x21abd0=typeof _0x46e01a[_0xc742('0x21')]===_0xc742('0x22')&&typeof _0x46e01a[_0xc742('0x23')]===_0xc742('0x22');var _0x3e86bb=_0x205e56[_0xc742('0x24')];var _0x356ba0=_0x21abd0?0x0:_0x46e01a[_0xc742('0x21')];var _0x5ec569=_0x21abd0?_0x205e56[_0xc742('0x24')]:_0x46e01a[_0xc742('0x21')]+_0x46e01a[_0xc742('0x23')];var _0x4f0f13;if(_0x5ec569>=_0x3e86bb){_0x5ec569=_0x3e86bb;_0x4f0f13=0xc8;}else{_0x4f0f13=0xce;}_0x46d8bc[_0xc742('0x1e')](_0x4f0f13);return _0x46d8bc[_0xc742('0x25')](_0xc742('0x26'),_0x356ba0+'-'+_0x5ec569+'/'+_0x3e86bb)[_0xc742('0x20')](_0x205e56);}return null;};}function patchUpdates(_0x5c8505){return function(_0x44b0b8){try{jsonpatch[_0xc742('0x27')](_0x44b0b8,_0x5c8505,!![]);}catch(_0x262f7d){return BPromise[_0xc742('0x28')](_0x262f7d);}return _0x44b0b8[_0xc742('0x29')]();};}function saveUpdates(_0x385eb5,_0x38e9c0){return function(_0x179342){if(_0x179342){return _0x179342[_0xc742('0x2a')](_0x385eb5)[_0xc742('0x2b')](function(_0x416278){return _0x416278;});}return null;};}function removeEntity(_0x294a61,_0x5eecc6){return function(_0x313edb){if(_0x313edb){return _0x313edb[_0xc742('0x2c')]()['then'](function(){_0x294a61[_0xc742('0x1e')](0xcc)[_0xc742('0x1f')]();});}};}function handleEntityNotFound(_0x21a32f,_0x3bb38e){return function(_0x303bf6){if(!_0x303bf6){_0x21a32f[_0xc742('0x1d')](0x194);}return _0x303bf6;};}function handleError(_0x49c2bc,_0x3741e4){_0x3741e4=_0x3741e4||0x1f4;return function(_0x575e79){logger[_0xc742('0x2d')](_0x575e79[_0xc742('0x2e')]);if(_0x575e79[_0xc742('0x2f')]){delete _0x575e79[_0xc742('0x2f')];}_0x49c2bc['status'](_0x3741e4)['send'](_0x575e79);};}exports[_0xc742('0x30')]=function(_0x581dfc,_0x3a5db7){var _0x27598b={},_0x3cabcd={},_0x35348b={'count':0x0,'rows':[]};var _0xa442a=_[_0xc742('0x31')](db[_0xc742('0x32')][_0xc742('0x33')],function(_0x43250b){return{'name':_0x43250b['fieldName'],'type':_0x43250b[_0xc742('0x34')][_0xc742('0x35')]};});_0x3cabcd[_0xc742('0x36')]=_[_0xc742('0x31')](_0xa442a,_0xc742('0x2f'));_0x3cabcd[_0xc742('0x37')]=_['keys'](_0x581dfc[_0xc742('0x37')]);_0x3cabcd['filters']=_[_0xc742('0x38')](_0x3cabcd[_0xc742('0x36')],_0x3cabcd[_0xc742('0x37')]);_0x27598b[_0xc742('0x39')]=_['intersection'](_0x3cabcd['model'],qs[_0xc742('0x3a')](_0x581dfc[_0xc742('0x37')][_0xc742('0x3a')]));_0x27598b['attributes']=_0x27598b[_0xc742('0x39')][_0xc742('0x3b')]?_0x27598b[_0xc742('0x39')]:_0x3cabcd[_0xc742('0x36')];if(!_0x581dfc[_0xc742('0x37')]['hasOwnProperty']('nolimit')){_0x27598b['limit']=qs['limit'](_0x581dfc[_0xc742('0x37')][_0xc742('0x23')]);_0x27598b[_0xc742('0x21')]=qs[_0xc742('0x21')](_0x581dfc[_0xc742('0x37')]['offset']);}_0x27598b[_0xc742('0x3c')]=qs[_0xc742('0x3d')](_0x581dfc[_0xc742('0x37')][_0xc742('0x3d')]);_0x27598b[_0xc742('0x3e')]=qs[_0xc742('0x3f')](_[_0xc742('0x40')](_0x581dfc[_0xc742('0x37')],_0x3cabcd[_0xc742('0x3f')]),_0xa442a);if(_0x581dfc[_0xc742('0x37')][_0xc742('0x41')]){_0x27598b[_0xc742('0x3e')]=_['merge'](_0x27598b[_0xc742('0x3e')],{'$or':_['map'](_0xa442a,function(_0x1516b3){if(_0x1516b3[_0xc742('0x34')]!==_0xc742('0x42')){var _0x5c1856={};_0x5c1856[_0x1516b3[_0xc742('0x2f')]]={'$like':'%'+_0x581dfc[_0xc742('0x37')][_0xc742('0x41')]+'%'};return _0x5c1856;}})});}_0x27598b=_['merge']({},_0x27598b,_0x581dfc[_0xc742('0x43')]);var _0x14fc10={'where':_0x27598b[_0xc742('0x3e')]};return db[_0xc742('0x32')][_0xc742('0x24')](_0x14fc10)[_0xc742('0x2b')](function(_0x586fe5){_0x35348b['count']=_0x586fe5;if(_0x581dfc[_0xc742('0x37')][_0xc742('0x44')]){_0x27598b[_0xc742('0x45')]=[{'all':!![]}];}return db[_0xc742('0x32')]['findAll'](_0x27598b);})[_0xc742('0x2b')](function(_0x26c368){_0x35348b[_0xc742('0x46')]=_0x26c368;return _0x35348b;})['then'](respondWithFilteredResult(_0x3a5db7,_0x27598b))[_0xc742('0x47')](handleError(_0x3a5db7,null));};exports[_0xc742('0x48')]=function(_0x191e03,_0x516a5b){var _0x4a3bc8={'raw':!![],'where':{'id':_0x191e03[_0xc742('0x49')]['id']}},_0x112778={};_0x112778[_0xc742('0x36')]=_[_0xc742('0x4a')](db[_0xc742('0x32')]['rawAttributes']);_0x112778[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x191e03[_0xc742('0x37')]);_0x112778[_0xc742('0x3f')]=_[_0xc742('0x38')](_0x112778[_0xc742('0x36')],_0x112778['query']);_0x4a3bc8[_0xc742('0x39')]=_['intersection'](_0x112778['model'],qs[_0xc742('0x3a')](_0x191e03[_0xc742('0x37')][_0xc742('0x3a')]));_0x4a3bc8['attributes']=_0x4a3bc8['attributes']['length']?_0x4a3bc8[_0xc742('0x39')]:_0x112778[_0xc742('0x36')];if(_0x191e03[_0xc742('0x37')]['includeAll']){_0x4a3bc8[_0xc742('0x45')]=[{'all':!![]}];}_0x4a3bc8=_[_0xc742('0x4b')]({},_0x4a3bc8,_0x191e03[_0xc742('0x43')]);return db['ChatGroup'][_0xc742('0x4c')](_0x4a3bc8)[_0xc742('0x2b')](handleEntityNotFound(_0x516a5b,null))[_0xc742('0x2b')](respondWithResult(_0x516a5b,null))['catch'](handleError(_0x516a5b,null));};exports[_0xc742('0x4d')]=function(_0x19df21,_0x5e2db7){return db['ChatGroup'][_0xc742('0x4d')](_0x19df21[_0xc742('0x4e')],{})['then'](respondWithResult(_0x5e2db7,0xc9))[_0xc742('0x47')](handleError(_0x5e2db7,null));};exports[_0xc742('0x2a')]=function(_0x329580,_0x5ccdbd){if(_0x329580[_0xc742('0x4e')]['id']){delete _0x329580[_0xc742('0x4e')]['id'];}return db[_0xc742('0x32')][_0xc742('0x4c')]({'where':{'id':_0x329580[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x5ccdbd,null))[_0xc742('0x2b')](saveUpdates(_0x329580[_0xc742('0x4e')],null))[_0xc742('0x2b')](respondWithResult(_0x5ccdbd,null))['catch'](handleError(_0x5ccdbd,null));};exports['destroy']=function(_0xfcba44,_0x2b45f3){return db[_0xc742('0x32')]['find']({'where':{'id':_0xfcba44[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x2b45f3,null))[_0xc742('0x2b')](removeEntity(_0x2b45f3,null))[_0xc742('0x47')](handleError(_0x2b45f3,null));};exports[_0xc742('0x4f')]=function(_0x368e75,_0x1b8aa7){return db['ChatGroup'][_0xc742('0x4f')]()[_0xc742('0x2b')](respondWithResult(_0x1b8aa7,null))['catch'](handleError(_0x1b8aa7,null));};exports[_0xc742('0x50')]=function(_0x5d1ba9,_0x2f8f32,_0x50a521){return db[_0xc742('0x51')]['count']({'where':{'ChatGroupId':_0x5d1ba9[_0xc742('0x49')]['id'],'ToId':_0x5d1ba9['user']['id'],'read':![]}})['then'](function(_0xf9db3e){return{'id':_[_0xc742('0x52')](_0x5d1ba9[_0xc742('0x49')]['id']),'count':_0xf9db3e};})['then'](respondWithResult(_0x2f8f32,null))[_0xc742('0x47')](handleError(_0x2f8f32,null));};exports[_0xc742('0x53')]=function(_0x131b2a,_0x24e322,_0x3cf7ce){return db[_0xc742('0x32')]['find']({'where':{'id':_0x131b2a['params']['id']}})['then'](handleEntityNotFound(_0x24e322,null))[_0xc742('0x2b')](function(_0x5b4ade){if(_0x5b4ade){return _0x5b4ade[_0xc742('0x53')](_0x131b2a[_0xc742('0x4e')][_0xc742('0x54')],_['omit'](_0x131b2a[_0xc742('0x4e')],[_0xc742('0x54'),'id'])||{});}})[_0xc742('0x2b')](respondWithResult(_0x24e322,null))['catch'](handleError(_0x24e322,null));};exports[_0xc742('0x55')]=function(_0x3627f7,_0x17cc82,_0x31b8be){var _0x9816f4={};var _0x3508ad={};var _0x49bc50;var _0x407d5f;return db[_0xc742('0x32')][_0xc742('0x56')]({'where':{'id':_0x3627f7[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x17cc82,null))[_0xc742('0x2b')](function(_0x3fc085){if(_0x3fc085){_0x49bc50=_0x3fc085;_0x3508ad['model']=_[_0xc742('0x4a')](db['User'][_0xc742('0x33')]);_0x3508ad[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x3627f7[_0xc742('0x37')]);_0x3508ad[_0xc742('0x3f')]=_[_0xc742('0x38')](_0x3508ad[_0xc742('0x36')],_0x3508ad[_0xc742('0x37')]);_0x9816f4[_0xc742('0x39')]=_[_0xc742('0x38')](_0x3508ad[_0xc742('0x36')],qs['fields'](_0x3627f7[_0xc742('0x37')][_0xc742('0x3a')]));_0x9816f4[_0xc742('0x39')]=_0x9816f4[_0xc742('0x39')][_0xc742('0x3b')]?_0x9816f4[_0xc742('0x39')]:_0x3508ad[_0xc742('0x36')];_0x9816f4[_0xc742('0x3c')]=qs['sort'](_0x3627f7[_0xc742('0x37')]['sort']);_0x9816f4['where']=qs[_0xc742('0x3f')](_['pick'](_0x3627f7[_0xc742('0x37')],_0x3508ad[_0xc742('0x3f')]));if(_0x3627f7[_0xc742('0x37')][_0xc742('0x41')]){_0x9816f4['where']=_['merge'](_0x9816f4['where'],{'$or':_[_0xc742('0x31')](_0x9816f4[_0xc742('0x39')],function(_0x36b439){var _0x19e788={};_0x19e788[_0x36b439]={'$like':'%'+_0x3627f7[_0xc742('0x37')]['filter']+'%'};return _0x19e788;})});}_0x9816f4=_[_0xc742('0x4b')]({},_0x9816f4,_0x3627f7[_0xc742('0x43')]);return _0x49bc50['getMembers'](_0x9816f4);}})[_0xc742('0x2b')](function(_0x5ad41b){if(_0x5ad41b){_0x407d5f=_0x5ad41b['length'];if(!_0x3627f7[_0xc742('0x37')][_0xc742('0x57')]('nolimit')){_0x9816f4['limit']=qs[_0xc742('0x23')](_0x3627f7[_0xc742('0x37')][_0xc742('0x23')]);_0x9816f4[_0xc742('0x21')]=qs[_0xc742('0x21')](_0x3627f7[_0xc742('0x37')][_0xc742('0x21')]);}return _0x49bc50[_0xc742('0x55')](_0x9816f4);}})[_0xc742('0x2b')](function(_0x17ebad){if(_0x17ebad){return _0x17ebad?{'count':_0x407d5f,'rows':_0x17ebad}:null;}})[_0xc742('0x2b')](respondWithResult(_0x17cc82,null))[_0xc742('0x47')](handleError(_0x17cc82,null));};exports[_0xc742('0x58')]=function(_0x575755,_0x3702fc,_0x3fb538){return db[_0xc742('0x32')][_0xc742('0x4c')]({'where':{'id':_0x575755['params']['id']}})['then'](handleEntityNotFound(_0x3702fc,null))['then'](function(_0xa10061){if(_0xa10061){return _0xa10061[_0xc742('0x58')](_0x575755[_0xc742('0x37')][_0xc742('0x54')]);}})[_0xc742('0x2b')](respondWithStatusCode(_0x3702fc,null))['catch'](handleError(_0x3702fc,null));};exports['addMessage']=function(_0x3d5611,_0xa91f01,_0x5663b2){if(_0x3d5611['body']['id']){delete _0x3d5611[_0xc742('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3d5611[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0xa91f01,null))[_0xc742('0x2b')](function(_0x184376){if(_0x184376){_0x3d5611[_0xc742('0x4e')][_0xc742('0x59')]=_0x184376['id'];return db[_0xc742('0x51')]['create'](_0x3d5611[_0xc742('0x4e')]);}})[_0xc742('0x2b')](respondWithResult(_0xa91f01,null))[_0xc742('0x47')](handleError(_0xa91f01,null));};exports['getMessages']=function(_0x579163,_0x5c2ad6,_0xe55cff){var _0x372fc0={};var _0x33390e={};var _0x19e53c;var _0x74f476;return db[_0xc742('0x32')]['findOne']({'where':{'id':_0x579163[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x5c2ad6,null))['then'](function(_0x572666){if(_0x572666){_0x19e53c=_0x572666;_0x33390e[_0xc742('0x36')]=_[_0xc742('0x4a')](db[_0xc742('0x51')][_0xc742('0x33')]);_0x33390e[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x579163[_0xc742('0x37')]);_0x33390e[_0xc742('0x3f')]=_['intersection'](_0x33390e[_0xc742('0x36')],_0x33390e[_0xc742('0x37')]);_0x372fc0['attributes']=_[_0xc742('0x38')](_0x33390e[_0xc742('0x36')],qs[_0xc742('0x3a')](_0x579163[_0xc742('0x37')][_0xc742('0x3a')]));_0x372fc0[_0xc742('0x39')]=_0x372fc0[_0xc742('0x39')][_0xc742('0x3b')]?_0x372fc0['attributes']:_0x33390e[_0xc742('0x36')];_0x372fc0[_0xc742('0x3c')]=qs['sort'](_0x579163[_0xc742('0x37')][_0xc742('0x3d')]);_0x372fc0[_0xc742('0x3e')]=qs[_0xc742('0x3f')](_[_0xc742('0x40')](_0x579163[_0xc742('0x37')],_0x33390e[_0xc742('0x3f')]));if(_0x579163[_0xc742('0x37')][_0xc742('0x41')]){_0x372fc0[_0xc742('0x3e')]=_['merge'](_0x372fc0[_0xc742('0x3e')],{'$or':_[_0xc742('0x31')](_0x372fc0[_0xc742('0x39')],function(_0x428ce8){var _0x41e420={};_0x41e420[_0x428ce8]={'$like':'%'+_0x579163[_0xc742('0x37')]['filter']+'%'};return _0x41e420;})});}if(_0x579163[_0xc742('0x37')][_0xc742('0x5a')]){var _0x13bd8f=_0x579163['query'][_0xc742('0x5a')][_0xc742('0x5b')](',');var _0x28b8bc={};_0x28b8bc[_0x13bd8f[0x0]]={'$gte':moment(_0x13bd8f[0x1])[_0xc742('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x372fc0[_0xc742('0x3e')]=_[_0xc742('0x4b')](_0x372fc0[_0xc742('0x3e')],_0x28b8bc);}_0x372fc0=_[_0xc742('0x4b')]({},_0x372fc0,_0x579163[_0xc742('0x43')]);return _0x19e53c[_0xc742('0x5d')](_0x372fc0);}})['then'](function(_0x32889e){if(_0x32889e){_0x74f476=_0x32889e[_0xc742('0x3b')];if(!_0x579163['query'][_0xc742('0x57')](_0xc742('0x5e'))){_0x372fc0[_0xc742('0x23')]=qs['limit'](_0x579163[_0xc742('0x37')]['limit']);_0x372fc0['offset']=qs[_0xc742('0x21')](_0x579163[_0xc742('0x37')]['offset']);}return _0x19e53c[_0xc742('0x5d')](_0x372fc0);}})[_0xc742('0x2b')](function(_0x1ca806){if(_0x1ca806){return _0x1ca806?{'count':_0x74f476,'rows':_0x1ca806}:null;}})[_0xc742('0x2b')](respondWithResult(_0x5c2ad6,null))[_0xc742('0x47')](handleError(_0x5c2ad6,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index ff51591..6c1e081 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 _0x3c8e=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x49bd3e,_0x2e6e2d){var _0x247ba6=function(_0x46a7d1){while(--_0x46a7d1){_0x49bd3e['push'](_0x49bd3e['shift']());}};_0x247ba6(++_0x2e6e2d);}(_0x3c8e,0x89));var _0xe3c8=function(_0x269ab2,_0x5e2aa0){_0x269ab2=_0x269ab2-0x0;var _0x16a0f8=_0x3c8e[_0x269ab2];return _0x16a0f8;};'use strict';var EventEmitter=require(_0xe3c8('0x0'));var ChatGroup=require(_0xe3c8('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3c8('0x2'),'afterUpdate':_0xe3c8('0x3'),'afterDestroy':_0xe3c8('0x4')};function emitEvent(_0x563970){return function(_0x3f8a4b,_0x21efc9,_0xbd43ef){ChatGroupEvents[_0xe3c8('0x5')](_0x563970+':'+_0x3f8a4b['id'],_0x3f8a4b);ChatGroupEvents['emit'](_0x563970,_0x3f8a4b);_0xbd43ef(null);};}for(var e in events){if(events[_0xe3c8('0x6')](e)){var event=events[e];ChatGroup[_0xe3c8('0x7')](e,emitEvent(event));}}module[_0xe3c8('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xd0ce=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x40da26,_0x23369c){var _0x2a49a7=function(_0x3faa99){while(--_0x3faa99){_0x40da26['push'](_0x40da26['shift']());}};_0x2a49a7(++_0x23369c);}(_0xd0ce,0x105));var _0xed0c=function(_0x28286e,_0xd8c672){_0x28286e=_0x28286e-0x0;var _0x3a253e=_0xd0ce[_0x28286e];return _0x3a253e;};'use strict';var EventEmitter=require(_0xed0c('0x0'));var ChatGroup=require(_0xed0c('0x1'))['db'][_0xed0c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xed0c('0x3')](0x0);var events={'afterCreate':_0xed0c('0x4'),'afterUpdate':_0xed0c('0x5'),'afterDestroy':_0xed0c('0x6')};function emitEvent(_0x8b6679){return function(_0x13b003,_0x330d3e,_0x5b7a5f){ChatGroupEvents[_0xed0c('0x7')](_0x8b6679+':'+_0x13b003['id'],_0x13b003);ChatGroupEvents['emit'](_0x8b6679,_0x13b003);_0x5b7a5f(null);};}for(var e in events){if(events[_0xed0c('0x8')](e)){var event=events[e];ChatGroup[_0xed0c('0x9')](e,emitEvent(event));}}module[_0xed0c('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0b1250d..3116cc4 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 _0x3be3=['../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','request-promise','path'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x3be3,0xaf));var _0x33be=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x3be3[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x33be('0x0'));var util=require('util');var logger=require(_0x33be('0x1'))(_0x33be('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33be('0x3'));var fs=require('fs');var path=require(_0x33be('0x4'));var rimraf=require('rimraf');var config=require(_0x33be('0x5'));var attributes=require(_0x33be('0x6'));module['exports']=function(_0x3a12ea,_0x46c10a){return _0x3a12ea[_0x33be('0x7')](_0x33be('0x8'),attributes,{'tableName':_0x33be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54c3=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x26f935,_0x17b8c3){var _0x3b9713=function(_0x2a892c){while(--_0x2a892c){_0x26f935['push'](_0x26f935['shift']());}};_0x3b9713(++_0x17b8c3);}(_0x54c3,0x1b9));var _0x354c=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0x54c3[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require(_0x354c('0x0'));var util=require(_0x354c('0x1'));var logger=require(_0x354c('0x2'))(_0x354c('0x3'));var moment=require(_0x354c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x354c('0x5'));var rimraf=require(_0x354c('0x6'));var config=require(_0x354c('0x7'));var attributes=require(_0x354c('0x8'));module[_0x354c('0x9')]=function(_0x3102a7,_0x7beaa1){return _0x3102a7[_0x354c('0xa')](_0x354c('0xb'),attributes,{'tableName':_0x354c('0xc'),'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 1d33cb9..c3f94bc 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 _0x87cb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message'];(function(_0x55f5b7,_0x2dcdcc){var _0x34762d=function(_0x53fd0b){while(--_0x53fd0b){_0x55f5b7['push'](_0x55f5b7['shift']());}};_0x34762d(++_0x2dcdcc);}(_0x87cb,0xaa));var _0xb87c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x87cb[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var moment=require(_0xb87c('0x2'));var BPromise=require(_0xb87c('0x3'));var rs=require(_0xb87c('0x4'));var fs=require('fs');var Redis=require(_0xb87c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb87c('0x6'))(_0xb87c('0x7'));var config=require(_0xb87c('0x8'));var jayson=require(_0xb87c('0x9'));var client=jayson[_0xb87c('0xa')][_0xb87c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb87c('0xc')],{'host':_0xb87c('0xd'),'port':0x18eb});var socket=require(_0xb87c('0xe'))(new Redis(config[_0xb87c('0xc')]));require(_0xb87c('0xf'))['register'](socket);function respondWithRpcPromise(_0x10517c,_0x484d49,_0x260a20){return new BPromise(function(_0x5229a4,_0x37b8e7){return client[_0xb87c('0x10')](_0x10517c,_0x260a20)[_0xb87c('0x11')](function(_0xa4095f){logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');logger[_0xb87c('0x13')](_0xb87c('0x14'),_0x484d49,_0xb87c('0x15'),JSON['stringify'](_0xa4095f));if(_0xa4095f[_0xb87c('0x16')]){if(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x17')]===0x1f4){logger[_0xb87c('0x16')](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x37b8e7(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);}logger['error'](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x5229a4(_0xa4095f[_0xb87c('0x16')]['message']);}else{logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');_0x5229a4(_0xa4095f[_0xb87c('0x1a')][_0xb87c('0x19')]);}})[_0xb87c('0x1b')](function(_0x581c9e){logger['error']('ChatGroup,\x20%s,\x20%s',_0x484d49,_0x581c9e);_0x37b8e7(_0x581c9e);});});} \ No newline at end of file +var _0x7e63=['http','redis','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e63,0x74));var _0x37e6=function(_0x1ff146,_0x5176bc){_0x1ff146=_0x1ff146-0x0;var _0x11d9b1=_0x7e63[_0x1ff146];return _0x11d9b1;};'use strict';var _=require(_0x37e6('0x0'));var util=require(_0x37e6('0x1'));var moment=require(_0x37e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x37e6('0x3'));var fs=require('fs');var Redis=require(_0x37e6('0x4'));var db=require(_0x37e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37e6('0x6'))(_0x37e6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37e6('0x8')][_0x37e6('0x9')]({'port':0x232a});config[_0x37e6('0xa')]=_['defaults'](config[_0x37e6('0xa')],{'host':_0x37e6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37e6('0xa')]));require(_0x37e6('0xc'))[_0x37e6('0xd')](socket);function respondWithRpcPromise(_0xfdc255,_0x5ea219,_0x676035){return new BPromise(function(_0x1f5d30,_0x10eb16){return client['request'](_0xfdc255,_0x676035)[_0x37e6('0xe')](function(_0x3f3158){logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));logger[_0x37e6('0x12')](_0x37e6('0x13'),_0x5ea219,_0x37e6('0x11'),JSON[_0x37e6('0x14')](_0x3f3158));if(_0x3f3158[_0x37e6('0x15')]){if(_0x3f3158[_0x37e6('0x15')]['code']===0x1f4){logger[_0x37e6('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158['error'][_0x37e6('0x16')]);return _0x10eb16(_0x3f3158['error'][_0x37e6('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158[_0x37e6('0x15')][_0x37e6('0x16')]);return _0x1f5d30(_0x3f3158[_0x37e6('0x15')]['message']);}else{logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));_0x1f5d30(_0x3f3158[_0x37e6('0x17')][_0x37e6('0x16')]);}})[_0x37e6('0x18')](function(_0x3cfebd){logger[_0x37e6('0x15')](_0x37e6('0x10'),_0x5ea219,_0x3cfebd);_0x10eb16(_0x3cfebd);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index dba5924..32808d5 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 _0x4b7e=['remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x4f484c,_0x9bccb4){var _0x276e95=function(_0x32e002){while(--_0x32e002){_0x4f484c['push'](_0x4f484c['shift']());}};_0x276e95(++_0x9bccb4);}(_0x4b7e,0x1e9));var _0xe4b7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4b7e[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require(_0xe4b7('0x0'));var events=['save',_0xe4b7('0x1'),_0xe4b7('0x2')];function createListener(_0xcd485e,_0x548b2e){return function(_0x36aebf){_0x548b2e[_0xe4b7('0x3')](_0xcd485e,_0x36aebf);};}function removeListener(_0x157112,_0x498c82){return function(){ChatGroupEvents[_0xe4b7('0x4')](_0x157112,_0x498c82);};}exports[_0xe4b7('0x5')]=function(_0x5cfec6){for(var _0xccaf26=0x0,_0x426ab3=events[_0xe4b7('0x6')];_0xccaf26<_0x426ab3;_0xccaf26++){var _0x733538=events[_0xccaf26];var _0x32fa2e=createListener('chatGroup:'+_0x733538,_0x5cfec6);ChatGroupEvents['on'](_0x733538,_0x32fa2e);}}; \ No newline at end of file +var _0x09b7=['emit','length','chatGroup:','./chatGroup.events','remove'];(function(_0x1ad418,_0x1a6ef4){var _0x557e31=function(_0xfd9e76){while(--_0xfd9e76){_0x1ad418['push'](_0x1ad418['shift']());}};_0x557e31(++_0x1a6ef4);}(_0x09b7,0x1c0));var _0x709b=function(_0x430ea6,_0x58db3b){_0x430ea6=_0x430ea6-0x0;var _0x8c837=_0x09b7[_0x430ea6];return _0x8c837;};'use strict';var ChatGroupEvents=require(_0x709b('0x0'));var events=['save',_0x709b('0x1'),'update'];function createListener(_0x16a449,_0x5d79a2){return function(_0x171edb){_0x5d79a2[_0x709b('0x2')](_0x16a449,_0x171edb);};}function removeListener(_0x3acde2,_0x3ac998){return function(){ChatGroupEvents['removeListener'](_0x3acde2,_0x3ac998);};}exports['register']=function(_0x13812c){for(var _0x4dc2d2=0x0,_0x245701=events[_0x709b('0x3')];_0x4dc2d2<_0x245701;_0x4dc2d2++){var _0x21f28d=events[_0x4dc2d2];var _0x4dfe48=createListener(_0x709b('0x4')+_0x21f28d,_0x13812c);ChatGroupEvents['on'](_0x21f28d,_0x4dfe48);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 40a41c6..fddcde9 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 _0xbea8=['isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe'];(function(_0x3b460b,_0x4e2058){var _0x3807fa=function(_0x115e88){while(--_0x115e88){_0x3b460b['push'](_0x3b460b['shift']());}};_0x3807fa(++_0x4e2058);}(_0xbea8,0x7c));var _0x8bea=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xbea8[_0x5550b3];return _0x4b8fc4;};'use strict';var multer=require(_0x8bea('0x0'));var util=require(_0x8bea('0x1'));var path=require(_0x8bea('0x2'));var timeout=require(_0x8bea('0x3'));var express=require('express');var router=express[_0x8bea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bea('0x5'));var config=require(_0x8bea('0x6'));var controller=require(_0x8bea('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8bea('0x8')]);router[_0x8bea('0x9')](_0x8bea('0xa'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xc')]);router[_0x8bea('0x9')](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xe')]);router[_0x8bea('0x9')](_0x8bea('0xf'),auth['isAuthenticated'](),controller[_0x8bea('0x10')]);router[_0x8bea('0x9')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x12')]);router[_0x8bea('0x9')](_0x8bea('0x13'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x14')]);router[_0x8bea('0x15')]('/',auth[_0x8bea('0xb')](),controller['create']);router[_0x8bea('0x15')]('/:id/members',auth[_0x8bea('0xb')](),controller[_0x8bea('0x16')]);router['post'](_0x8bea('0x13'),auth['isAuthenticated'](),controller['addMessage']);router['put'](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8bea('0x18')]);router[_0x8bea('0x19')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x3270=['/:id','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x628de9,_0x8d0187){var _0x412d0b=function(_0x2ed322){while(--_0x2ed322){_0x628de9['push'](_0x628de9['shift']());}};_0x412d0b(++_0x8d0187);}(_0x3270,0x1bf));var _0x0327=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x3270[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require('multer');var util=require(_0x0327('0x0'));var path=require(_0x0327('0x1'));var timeout=require(_0x0327('0x2'));var express=require(_0x0327('0x3'));var router=express[_0x0327('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0327('0x5'));var config=require(_0x0327('0x6'));var controller=require('./chatGroup.controller');router[_0x0327('0x7')]('/',auth[_0x0327('0x8')](),controller[_0x0327('0x9')]);router[_0x0327('0x7')](_0x0327('0xa'),auth['isAuthenticated'](),controller[_0x0327('0xb')]);router[_0x0327('0x7')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller['show']);router[_0x0327('0x7')]('/:id/unread',auth[_0x0327('0x8')](),controller[_0x0327('0xd')]);router[_0x0327('0x7')](_0x0327('0xe'),auth['isAuthenticated'](),controller[_0x0327('0xf')]);router[_0x0327('0x7')]('/:id/messages',auth[_0x0327('0x8')](),controller[_0x0327('0x10')]);router['post']('/',auth[_0x0327('0x8')](),controller[_0x0327('0x11')]);router[_0x0327('0x12')](_0x0327('0xe'),auth['isAuthenticated'](),controller[_0x0327('0x13')]);router['post']('/:id/messages',auth[_0x0327('0x8')](),controller[_0x0327('0x14')]);router[_0x0327('0x15')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller[_0x0327('0x16')]);router[_0x0327('0x17')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller[_0x0327('0x18')]);router[_0x0327('0x17')](_0x0327('0xe'),auth[_0x0327('0x8')](),controller[_0x0327('0x19')]);module[_0x0327('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f3d652b..16b1ca5 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 _0xe9e8=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x3a05eb,_0x1715d6){var _0x485e33=function(_0x5a37eb){while(--_0x5a37eb){_0x3a05eb['push'](_0x3a05eb['shift']());}};_0x485e33(++_0x1715d6);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x36686a,_0x38cc45){_0x36686a=_0x36686a-0x0;var _0x7e74ab=_0xe9e8[_0x36686a];return _0x7e74ab;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'closed':{'type':Sequelize[_0x8e9e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8e9e('0x3')]},'ratingType':{'type':Sequelize[_0x8e9e('0x4')](_0x8e9e('0x5'),_0x8e9e('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8e9e('0x7')]},'pathTranscript':{'type':Sequelize[_0x8e9e('0x7')]},'mailTranscript':{'type':Sequelize[_0x8e9e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e9e('0x8')]},'secondDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'note':{'type':Sequelize[_0x8e9e('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8e9e('0x8')]},'osName':{'type':Sequelize[_0x8e9e('0x8')]},'osVersion':{'type':Sequelize[_0x8e9e('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8e9e('0x8')]},'deviceType':{'type':Sequelize[_0x8e9e('0x8')]},'referer':{'type':Sequelize[_0x8e9e('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8e9e('0x7')](_0x8e9e('0x9'))},'read1stAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x8e9e('0x4')]('in',_0x8e9e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8e9e('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x8e9e('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2547=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports'];(function(_0x20a635,_0x2ac662){var _0x4582dd=function(_0xef0daa){while(--_0xef0daa){_0x20a635['push'](_0x20a635['shift']());}};_0x4582dd(++_0x2ac662);}(_0x2547,0x1cd));var _0x7254=function(_0x462df0,_0x4f1f46){_0x462df0=_0x462df0-0x0;var _0x640c67=_0x2547[_0x462df0];return _0x640c67;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'closed':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7254('0x2')]},'ratingType':{'type':Sequelize[_0x7254('0x3')](_0x7254('0x4'),_0x7254('0x5')),'defaultValue':_0x7254('0x4')},'ratingMessage':{'type':Sequelize[_0x7254('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7254('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7254('0x8')]},'disposition':{'type':Sequelize[_0x7254('0x7')]},'secondDisposition':{'type':Sequelize[_0x7254('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7254('0x7')]},'browserName':{'type':Sequelize[_0x7254('0x7')]},'browserVersion':{'type':Sequelize[_0x7254('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7254('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7254('0x6')]},'customerIp':{'type':Sequelize[_0x7254('0x7')]},'formData':{'type':Sequelize[_0x7254('0x6')](_0x7254('0x9'))},'read1stAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7254('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7254('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1872527..f2fb0e9 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 _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','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','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.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','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x1f21bc,_0x4b89b8){var _0x115182=function(_0x366734){while(--_0x366734){_0x1f21bc['push'](_0x1f21bc['shift']());}};_0x115182(++_0x4b89b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));}; \ No newline at end of file +var _0xf109=['nolimit','order','sort','pick','select','field','color','from','u.fullname','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','left_join','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','having','`\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','type','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','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.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','rawAttributes','includeAll','include','options','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','file','basename','filename','mimetype','Attachment','create','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','direction','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','secret','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createWriteStream','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','http','client','then','request\x20sent','debug','error','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','total','UserId','closed','disposition','unmanaged','answered','index','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x21b8f2,_0x485cb8){var _0x1d000c=function(_0x597ec1){while(--_0x597ec1){_0x21b8f2['push'](_0x21b8f2['shift']());}};_0x1d000c(++_0x485cb8);}(_0xf109,0xce));var _0x9f10=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf109[_0x32f7d7];return _0x133d09;};'use strict';var rimraf=require(_0x9f10('0x0'));var zipdir=require(_0x9f10('0x1'));var rp=require(_0x9f10('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f10('0x3'));var path=require(_0x9f10('0x4'));var ejs=require(_0x9f10('0x5'));var fs=require('fs');var _=require(_0x9f10('0x6'));var squel=require(_0x9f10('0x7'));var Redis=require(_0x9f10('0x8'));var qs=require(_0x9f10('0x9'));var as=require(_0x9f10('0xa'));var pdf=require(_0x9f10('0xb'));var logger=require(_0x9f10('0xc'))(_0x9f10('0xd'));var config=require('../../config/environment');var db=require(_0x9f10('0xe'))['db'];config[_0x9f10('0xf')]=_[_0x9f10('0x10')](config[_0x9f10('0xf')],{'host':_0x9f10('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f10('0xf')]));require(_0x9f10('0x12'))[_0x9f10('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9f10('0x14')]({'port':0x232b});var client9004=jayson[_0x9f10('0x15')][_0x9f10('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x56780e,_0x289164,_0x260606,_0x35c529){return new BPromise(function(_0x58067f,_0x9a3ae6){var _0x309f27=_0x35c529||client;return _0x309f27['request'](_0x56780e,_0x260606)[_0x9f10('0x16')](function(_0x236e28){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x289164,_0x9f10('0x17'));logger[_0x9f10('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x289164,_0x9f10('0x17'),JSON['stringify'](_0x236e28));if(_0x236e28[_0x9f10('0x19')]){if(_0x236e28[_0x9f10('0x19')]['code']===0x1f4){logger[_0x9f10('0x19')](_0x9f10('0x1a'),_0x289164,_0x236e28['error'][_0x9f10('0x1b')]);return _0x9a3ae6(_0x236e28['error'][_0x9f10('0x1b')]);}logger['error'](_0x9f10('0x1a'),_0x289164,_0x236e28['error']['message']);return _0x58067f(_0x236e28[_0x9f10('0x19')][_0x9f10('0x1b')]);}else{logger[_0x9f10('0x1c')](_0x9f10('0x1a'),_0x289164,_0x9f10('0x17'));_0x58067f(_0x236e28[_0x9f10('0x1d')][_0x9f10('0x1b')]);}})['catch'](function(_0x366044){logger['error'](_0x9f10('0x1a'),_0x289164,_0x366044);_0x9a3ae6(_0x366044);});});}function respondWithStatusCode(_0x36ace4,_0x3d25cb){_0x3d25cb=_0x3d25cb||0xcc;return function(_0x4adbda){if(_0x4adbda){return _0x36ace4[_0x9f10('0x1e')](_0x3d25cb);}return _0x36ace4[_0x9f10('0x1f')](_0x3d25cb)[_0x9f10('0x20')]();};}function respondWithResult(_0x4d21c5,_0x36821e){_0x36821e=_0x36821e||0xc8;return function(_0x37e9ac){if(_0x37e9ac){return _0x4d21c5[_0x9f10('0x1f')](_0x36821e)['json'](_0x37e9ac);}};}function respondWithFilteredResult(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(_0x11cae7){var _0x1647c0=typeof _0x23c2e7['offset']==='undefined'&&typeof _0x23c2e7['limit']===_0x9f10('0x21');var _0x4a0407=_0x11cae7[_0x9f10('0x22')];var _0x1de75a=_0x1647c0?0x0:_0x23c2e7[_0x9f10('0x23')];var _0x2ed95b=_0x1647c0?_0x11cae7[_0x9f10('0x22')]:_0x23c2e7['offset']+_0x23c2e7[_0x9f10('0x24')];var _0x22814f;if(_0x2ed95b>=_0x4a0407){_0x2ed95b=_0x4a0407;_0x22814f=0xc8;}else{_0x22814f=0xce;}_0x2ec07d[_0x9f10('0x1f')](_0x22814f);return _0x2ec07d[_0x9f10('0x25')](_0x9f10('0x26'),_0x1de75a+'-'+_0x2ed95b+'/'+_0x4a0407)[_0x9f10('0x27')](_0x11cae7);}return null;};}function saveUpdates(_0x581b1d){return function(_0x358d3f){if(_0x358d3f){return _0x358d3f[_0x9f10('0x28')](_0x581b1d)[_0x9f10('0x16')](function(_0x1b03ee){return _0x1b03ee;});}return null;};}function removeEntity(_0x49b3f4){return function(_0x44f0a0){if(_0x44f0a0){return _0x44f0a0[_0x9f10('0x29')]()[_0x9f10('0x16')](function(){_0x49b3f4['status'](0xcc)[_0x9f10('0x20')]();});}};}function handleEntityNotFound(_0x5af399){return function(_0x1069ba){if(!_0x1069ba){_0x5af399[_0x9f10('0x1e')](0x194);}return _0x1069ba;};}function handleError(_0x13532b,_0x5944e5){_0x5944e5=_0x5944e5||0x1f4;return function(_0x3ac139){logger[_0x9f10('0x19')](_0x3ac139[_0x9f10('0x2a')]);if(_0x3ac139[_0x9f10('0x2b')]){delete _0x3ac139[_0x9f10('0x2b')];}_0x13532b['status'](_0x5944e5)[_0x9f10('0x2c')](_0x3ac139);};}function getMustacheRender(_0x4b54b7,_0x24d21d){return Mustache[_0x9f10('0x2d')](_0x4b54b7,_[_0x9f10('0x2e')](_0x24d21d[_0x9f10('0x2f')],{'contact':_0x24d21d[_0x9f10('0x30')],'message':_0x24d21d[_0x9f10('0x1b')],'agent':_0x24d21d['agent'],'interaction':_0x24d21d[_0x9f10('0x31')],'account':_0x24d21d[_0x9f10('0x32')]}))||'';}function getInteractionUsers(_0x1b8018,_0x5e63b1){return new BPromise(function(_0x2310d0,_0x1f01a7){try{if(_0x5e63b1[_0x1b8018['id']]){_0x1b8018['Users']=_[_0x9f10('0x33')](_0x5e63b1[_0x1b8018['id']],function(_0x5671fe){return{'id':_0x5671fe['id'],'fullname':_0x5671fe[_0x9f10('0x34')]};});}}catch(_0x1b7a66){_0x1f01a7(_0x1b7a66);}_0x2310d0(_0x1b8018);});}function getInteractionTags(_0x26df66,_0xc17ea2){return new BPromise(function(_0x20605a,_0x1ba4be){try{if(_0x26df66[_0x9f10('0x35')]){_0x26df66[_0x9f10('0x36')]=[];_0x26df66['TagIds'][_0x9f10('0x37')](',')[_0x9f10('0x38')](function(_0x2fa4bf){_0x26df66['Tags'][_0x9f10('0x39')](_0xc17ea2[_0x2fa4bf]);});}delete _0x26df66[_0x9f10('0x35')];}catch(_0x52914c){_0x1ba4be(_0x52914c);}_0x20605a(_0x26df66);});}function updateChatInteraction(_0x30b04b,_0x26f0ba,_0x433c7a){return new BPromise(function(_0x5a1b2b,_0x5c516c){return getInteractionUsers(_0x30b04b,_0x433c7a)[_0x9f10('0x16')](function(_0x2ff98d){return getInteractionTags(_0x2ff98d,_0x26f0ba);})[_0x9f10('0x16')](function(_0x433e70){return getStateInteraction(_0x433e70);})[_0x9f10('0x16')](function(_0x227425){_0x5a1b2b(_0x227425);})[_0x9f10('0x3a')](function(_0x34869c){_0x5c516c(_0x34869c);});});}function getStateInteraction(_0x7fe320){return new BPromise(function(_0x149f8f){_0x7fe320[_0x9f10('0x3b')]=0x0;_0x7fe320[_0x9f10('0x3c')]=0x0;_0x7fe320['answered']=0x0;_0x7fe320['unmanaged']=0x0;_0x7fe320['abandoned']=0x0;_0x7fe320[_0x9f10('0x3d')]=0x0;if(!_0x7fe320['closed']&&!_0x7fe320[_0x9f10('0x3e')]){_0x7fe320[_0x9f10('0x3b')]+=0x1;}if(!_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320['UserId']){_0x7fe320[_0x9f10('0x3c')]+=0x1;if(_0x7fe320[_0x9f10('0x3b')]){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}if(_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320[_0x9f10('0x40')]==='abandoned'){_0x7fe320['abandoned']+=0x1;if(_0x7fe320['waiting']){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}else if(_0x7fe320['closed']&&!_0x7fe320[_0x9f10('0x3e')]&&_0x7fe320['disposition']){_0x7fe320[_0x9f10('0x41')]+=0x1;if(_0x7fe320[_0x9f10('0x3b')]){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}else if(_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320['UserId']){_0x7fe320[_0x9f10('0x42')]+=0x1;if(_0x7fe320[_0x9f10('0x3c')]){_0x7fe320['talking']-=0x1;}}_0x7fe320[_0x9f10('0x3d')]+=0x1;_0x149f8f(_0x7fe320);});}exports[_0x9f10('0x43')]=function(_0x3c64a9,_0x1bd37c){var _0x1b3529={},_0x3b3002={},_0x4bedbe={'count':0x0,'rows':[]};var _0x281da4=_[_0x9f10('0x33')](db[_0x9f10('0x44')]['rawAttributes'],function(_0x181eab){return{'name':_0x181eab[_0x9f10('0x45')],'type':_0x181eab['type'][_0x9f10('0x46')]};});_0x3b3002[_0x9f10('0x47')]=_[_0x9f10('0x33')](_0x281da4,_0x9f10('0x2b'));_0x3b3002['query']=_[_0x9f10('0x48')](_0x3c64a9[_0x9f10('0x49')]);_0x3b3002[_0x9f10('0x4a')]=_[_0x9f10('0x4b')](_0x3b3002[_0x9f10('0x47')],_0x3b3002[_0x9f10('0x49')]);_0x1b3529['attributes']=_[_0x9f10('0x4b')](_0x3b3002[_0x9f10('0x47')],qs[_0x9f10('0x4c')](_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x4c')]));_0x1b3529[_0x9f10('0x4d')]=_0x1b3529['attributes'][_0x9f10('0x4e')]?_0x1b3529[_0x9f10('0x4d')]:_0x3b3002[_0x9f10('0x47')];if(!_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x4f')](_0x9f10('0x50'))){_0x1b3529[_0x9f10('0x24')]=qs[_0x9f10('0x24')](_0x3c64a9['query'][_0x9f10('0x24')]);_0x1b3529['offset']=qs[_0x9f10('0x23')](_0x3c64a9['query'][_0x9f10('0x23')]);}_0x1b3529[_0x9f10('0x51')]=qs[_0x9f10('0x52')](_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x52')]);_0x1b3529['where']=qs[_0x9f10('0x4a')](_[_0x9f10('0x53')](_0x3c64a9[_0x9f10('0x49')],_0x3b3002[_0x9f10('0x4a')]),_0x281da4);var _0x500e51=[];var _0x53ec45=squel[_0x9f10('0x54')]()[_0x9f10('0x55')]('id')['field']('name')[_0x9f10('0x55')](_0x9f10('0x56'))[_0x9f10('0x57')]('tools_tags');var _0x3d7b33=squel[_0x9f10('0x54')]()[_0x9f10('0x55')]('u.id')[_0x9f10('0x55')](_0x9f10('0x58'))[_0x9f10('0x55')]('ui.ChatInteractionId')[_0x9f10('0x57')](_0x9f10('0x59'),'ui')['left_join'](_0x9f10('0x5a'),'u',_0x9f10('0x5b'));var _0xcd8ae7=squel[_0x9f10('0x54')]()[_0x9f10('0x57')]('chat_interactions','i')[_0x9f10('0x5c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9f10('0x5c')](_0x9f10('0x5a'),'o',_0x9f10('0x5d'))[_0x9f10('0x5c')](_0x9f10('0x5e'),'a',_0x9f10('0x5f'))[_0x9f10('0x5c')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x9f10('0x5c')](_0x9f10('0x60'),'it',_0x9f10('0x61'))[_0x9f10('0x5c')](_0x9f10('0x62'),'t',_0x9f10('0x63'));var _0x35460a=squel['expr']();var _0x29bc1d=[];var _0x3ca18c=squel['expr']();var _0x29589e;if(_0x3c64a9[_0x9f10('0x49')]['search']){_0x29589e=as[_0x9f10('0x64')](_0x3c64a9[_0x9f10('0x49')]['search']);var _0x45ab35=_0x29589e['sqlOperator'];for(var _0xa93328=0x0;_0xa93328<_0x29589e[_0x9f10('0x65')][_0x9f10('0x4e')];_0xa93328++){var _0x208d48=_0x29589e[_0x9f10('0x65')][_0xa93328];var _0x4bf4d6='i';var _0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,[_0x9f10('0x2b'),_0x208d48['field']]);if(!_0x4c5fbf){switch(_0x208d48['field']){case _0x9f10('0x67'):if(_0x208d48[_0x9f10('0x68')]==0x1){_0xcd8ae7[_0x9f10('0x69')]('`'+_0x208d48[_0x9f10('0x55')]+_0x9f10('0x6a'));}else{_0xcd8ae7[_0x9f10('0x69')]('`'+_0x208d48[_0x9f10('0x55')]+'`\x20>\x200');}break;case _0x9f10('0x6b'):if(_0x208d48[_0x9f10('0x6c')]==='$substring'){if(_0x208d48[_0x9f10('0x68')]['split']('\x20')[_0x9f10('0x4e')]>0x1){_0x35460a[_0x45ab35](_0x9f10('0x6d'),qs['getFullTextValue'](_0x208d48[_0x9f10('0x68')]),null);}else{var _0x4cbe80='%'+_0x208d48[_0x9f10('0x68')]+'%';_0x35460a[_0x45ab35](_0x9f10('0x6e'),_0x4cbe80,_0x4cbe80,_0x4cbe80);}}else{_0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,['name',_0x9f10('0x6f')]);_0x208d48['field']=_0x9f10('0x6f');_0x16b217=as[_0x9f10('0x70')](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217['text'],_0x16b217[_0x9f10('0x68')]['start'],_0x16b217['value'][_0x9f10('0x20')]);}break;case _0x9f10('0x72'):var _0x6b3eb6=_0x208d48['value'][_0x9f10('0x37')](',')['map'](function(_0x48ce93){return Number(_0x48ce93);});_0x6b3eb6[_0x9f10('0x38')](function(_0x551a5d){_0x3ca18c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x551a5d+',%');});_0x29bc1d=_[_0x9f10('0x73')](_0x29bc1d,_0x6b3eb6);break;case'User':if(_0x208d48[_0x9f10('0x6c')]===_0x9f10('0x74')){_0x35460a[_0x45ab35](_0x9f10('0x75'),'%'+_0x208d48['value']+'%',null);}else{_0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,[_0x9f10('0x2b'),'UserId']);_0x208d48[_0x9f10('0x55')]='UserId';_0x16b217=as['buildExpression'](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);}break;case _0x9f10('0x2f'):_0x16b217=as['buildExpression']('me',null,_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);break;}}else{var _0x16b217=as[_0x9f10('0x70')](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217['value'][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);}}}else{var _0x1c3b52=_(_0x3c64a9['query'])[_0x9f10('0x48')]()[_0x9f10('0x33')](function(_0x13d232){return _[_0x9f10('0x78')](_0x281da4,['name',_0x13d232])?_0x13d232:undefined;})['compact']()[_0x9f10('0x68')]();if(!_[_0x9f10('0x79')](_0x1c3b52)){_0x1c3b52[_0x9f10('0x38')](function(_0x2a656f){if(_0x2a656f===_0x9f10('0x7a')){_0xcd8ae7[_0x9f10('0x7b')](_0x9f10('0x7c'),[][_0x9f10('0x7d')](_0x3c64a9[_0x9f10('0x49')][_0x2a656f]));}else if(_0x2a656f===_0x9f10('0x7e')){var _0x108e98=JSON[_0x9f10('0x7f')](_0x3c64a9[_0x9f10('0x49')][_0x2a656f])[_0x9f10('0x80')];var _0x3903c5=JSON['parse'](_0x3c64a9[_0x9f10('0x49')][_0x2a656f])[_0x9f10('0x81')];_0xcd8ae7['where'](_0x9f10('0x82'),_0x108e98,_0x3903c5);}else{if(_0x3c64a9[_0x9f10('0x49')][_0x2a656f]===_0x9f10('0x83')){_0xcd8ae7[_0x9f10('0x7b')]('i.'+_0x2a656f+'\x20IS\x20NULL');}else{_0xcd8ae7[_0x9f10('0x7b')]('i.'+_0x2a656f+'\x20=\x20?',_0x3c64a9[_0x9f10('0x49')][_0x2a656f]);}}});}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x84')]){if(_0x3c64a9['query'][_0x9f10('0x84')]==0x1){_0xcd8ae7[_0x9f10('0x69')](_0x9f10('0x85'));}else{_0xcd8ae7['having'](_0x9f10('0x86'));}}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x87')]){_0x29bc1d=_['isArray'](_0x3c64a9['query']['tag'])?_0x3c64a9['query']['tag']:new Array(_0x3c64a9['query']['tag']);_0x29bc1d[_0x9f10('0x38')](function(_0x2571a6){_0x3ca18c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2571a6+',%');});}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x88')]){var _0x454506=_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x88')][_0x9f10('0x89')]('\x5c','\x5c\x5c')[_0x9f10('0x89')](/'/g,'\x27\x27');if(qs[_0x9f10('0x8a')](_0x454506)){_0x35460a['or'](_0x9f10('0x8b'),_0x454506+'%');}else{_0x35460a['or'](_0x9f10('0x8c'),qs['getFullTextValue'](_0x454506))['or'](_0x9f10('0x8d'),_0x454506+'%');}}}_0xcd8ae7[_0x9f10('0x7b')](_0x35460a);_0xcd8ae7['group'](_0x9f10('0x8e'));var _0x5b2f86={'type':db['Sequelize'][_0x9f10('0x8f')][_0x9f10('0x90')],'raw':!![]};var _0x5ae22e=_0xcd8ae7[_0x9f10('0x91')]();_0x5ae22e[_0x9f10('0x55')]('i.id');_0x5ae22e[_0x9f10('0x55')](_0x9f10('0x92'),_0x9f10('0x67'));if(_0x1b3529['order']){_0x1b3529[_0x9f10('0x51')][_0x9f10('0x38')](function(_0x5c9d68){var _0x48c017=_0x5c9d68[0x0]===_0x9f10('0x93')?_0x5c9d68[0x0]:'i.'+_0x5c9d68[0x0];_0xcd8ae7[_0x9f10('0x51')](_0x48c017,_0x5c9d68[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9f10('0x79')](_0x29bc1d)){_0xcd8ae7[_0x9f10('0x69')](_0x3ca18c);_0x5ae22e['where']('t.id\x20IN\x20?',_0x29bc1d);}BPromise[_0x9f10('0x94')]()[_0x9f10('0x16')](function(){if(!_0x29589e){if(_0x3c64a9['query']['ChatWebsiteId'])return;_0x5ae22e[_0x9f10('0x7b')](_0x9f10('0x95'));_0xcd8ae7['where'](_0x9f10('0x95'));return;}if(_0x3c64a9[_0x9f10('0x96')][_0x9f10('0x97')]!==_0x9f10('0x98'))return;return _0x3c64a9[_0x9f10('0x96')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x5a51c7){if(_[_0x9f10('0x79')](_0x5a51c7)){_0x5ae22e[_0x9f10('0x7b')](_0x9f10('0x99'));_0xcd8ae7['where'](_0x9f10('0x99'));}else{_0x5ae22e['where'](_0x9f10('0x7c'),_['map'](_0x5a51c7,'id'));_0xcd8ae7['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x9f10('0x33')](_0x5a51c7,'id'));}});})[_0x9f10('0x16')](function(){if(_0x3c64a9[_0x9f10('0x96')][_0x9f10('0x97')]===_0x9f10('0x98')&&!_0x29589e&&!_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x7a')])return[];return db[_0x9f10('0x9a')]['query'](_0x5ae22e[_0x9f10('0x9b')](),_0x5b2f86);})[_0x9f10('0x16')](function(_0x426fa4){_0x4bedbe['count']=_0x426fa4[_0x9f10('0x4e')];if(_0x4bedbe[_0x9f10('0x22')]===0x0)return[];return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0x53ec45[_0x9f10('0x9b')](),_0x5b2f86)['then'](function(_0x14ea3c){_0x500e51=_['keyBy'](_0x14ea3c,'id');_0x5b2f86=_[_0x9f10('0x2e')](_0x5b2f86,{'model':db[_0x9f10('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c64a9['query'][_0x9f10('0x4c')]){_0x1b3529[_0x9f10('0x4d')][_0x9f10('0x38')](function(_0x3bc386){_0xcd8ae7['field']('i.'+_0x3bc386);});}else{_0xcd8ae7[_0x9f10('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9f10('0x67'));_0xcd8ae7[_0x9f10('0x55')]('a.key','Account.key');_0xcd8ae7[_0x9f10('0x55')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xcd8ae7['field'](_0x9f10('0x9c'),_0x9f10('0x93'));_0xcd8ae7['field'](_0x9f10('0x9d'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0x9e'),_0x9f10('0x9f'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa0'),_0x9f10('0xa1'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa2'),_0x9f10('0xa3'));_0xcd8ae7['field']('c.phone','Contact.phone');_0xcd8ae7['field'](_0x9f10('0xa4'),_0x9f10('0xa5'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa6'),_0x9f10('0xa7'));_0xcd8ae7['field'](_0x9f10('0xa8'),_0x9f10('0xa9'));_0xcd8ae7['field'](_0x9f10('0xaa'),_0x9f10('0xab'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xac'),_0x9f10('0x35'));}if(_0x1b3529[_0x9f10('0x24')])_0xcd8ae7[_0x9f10('0x24')](_0x1b3529[_0x9f10('0x24')]);if(_0x1b3529[_0x9f10('0x23')])_0xcd8ae7['offset'](_0x1b3529['offset']);return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0xcd8ae7[_0x9f10('0x9b')](),_0x5b2f86);})[_0x9f10('0x16')](function(_0x537de0){if(_0x537de0[_0x9f10('0x4e')]>0x0)_0x3d7b33[_0x9f10('0x7b')](_0x9f10('0xad'),_[_0x9f10('0x33')](_0x537de0,'id'));return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0x3d7b33['toString'](),_0x5b2f86)['then'](function(_0x5044bc){var _0x44bbd5=_[_0x9f10('0xae')](_0x5044bc,_0x9f10('0xaf'));var _0x37a44d=[];_0x537de0[_0x9f10('0x38')](function(_0x164264){_0x37a44d[_0x9f10('0x39')](updateChatInteraction(_0x164264,_0x500e51,_0x44bbd5));});return BPromise[_0x9f10('0xb0')](_0x37a44d);});});})[_0x9f10('0x16')](function(_0x527cb4){_0x4bedbe[_0x9f10('0xb1')]=_0x527cb4;return _0x4bedbe;})[_0x9f10('0x16')](respondWithFilteredResult(_0x1bd37c,_0x1b3529))[_0x9f10('0x3a')](handleError(_0x1bd37c,null));};exports['show']=function(_0x12372d,_0x53dfa3){var _0xf95893={'raw':![],'where':{'id':_0x12372d['params']['id']}},_0x257daa={};_0x257daa[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0x44')][_0x9f10('0xb2')]);_0x257daa[_0x9f10('0x49')]=_['keys'](_0x12372d[_0x9f10('0x49')]);_0x257daa['filters']=_[_0x9f10('0x4b')](_0x257daa['model'],_0x257daa['query']);_0xf95893[_0x9f10('0x4d')]=_[_0x9f10('0x4b')](_0x257daa[_0x9f10('0x47')],qs[_0x9f10('0x4c')](_0x12372d[_0x9f10('0x49')][_0x9f10('0x4c')]));_0xf95893['attributes']=_0xf95893[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0xf95893[_0x9f10('0x4d')]:_0x257daa[_0x9f10('0x47')];if(_0x12372d[_0x9f10('0x49')][_0x9f10('0xb3')]){_0xf95893[_0x9f10('0xb4')]=[{'all':!![]}];}_0xf95893=_[_0x9f10('0x2e')]({},_0xf95893,_0x12372d[_0x9f10('0xb5')]);return db[_0x9f10('0x44')][_0x9f10('0x66')](_0xf95893)[_0x9f10('0x16')](handleEntityNotFound(_0x53dfa3,null))['then'](respondWithResult(_0x53dfa3,null))[_0x9f10('0x3a')](handleError(_0x53dfa3,null));};exports['create']=function(_0x38ddb1,_0x14d4cc){return db[_0x9f10('0x44')]['create'](_0x38ddb1[_0x9f10('0x2f')],{})[_0x9f10('0x16')](respondWithResult(_0x14d4cc,0xc9))[_0x9f10('0x3a')](handleError(_0x14d4cc,null));};exports[_0x9f10('0x28')]=function(_0x2f805f,_0x417b25){if(_0x2f805f['body']['id']){delete _0x2f805f[_0x9f10('0x2f')]['id'];}return db[_0x9f10('0x44')]['find']({'where':{'id':_0x2f805f[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x417b25,null))[_0x9f10('0x16')](saveUpdates(_0x2f805f[_0x9f10('0x2f')],null))['then'](respondWithResult(_0x417b25,null))['catch'](handleError(_0x417b25,null));};exports[_0x9f10('0x29')]=function(_0x5a4c18,_0xccb669){return db[_0x9f10('0x44')]['find']({'where':{'id':_0x5a4c18[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0xccb669,null))[_0x9f10('0x16')](removeEntity(_0xccb669,null))[_0x9f10('0x3a')](handleError(_0xccb669,null));};exports['describe']=function(_0x3a894e,_0x2eeb02){return db['ChatInteraction'][_0x9f10('0xb7')]()['then'](respondWithResult(_0x2eeb02,null))['catch'](handleError(_0x2eeb02,null));};exports[_0x9f10('0xb8')]=function(_0x254354,_0x11e26f){var _0x49406f=_0x254354[_0x9f10('0xb6')]['id'];var _0x4e7496;var _0x3a1f83;var _0x5e4144;return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x49406f}})['then'](function(_0x3d5f3f){_0x4e7496=_0x3d5f3f;return db['ChatWebsite'][_0x9f10('0xb9')]({'where':{'id':_0x3d5f3f[_0x9f10('0x7a')]},'attributes':['id',_0x9f10('0xba'),_0x9f10('0xbb'),_0x9f10('0xbc'),_0x9f10('0xbd'),_0x9f10('0xbe')],'raw':!![]});})[_0x9f10('0x16')](function(_0x5ea087){if(_0x5ea087&&_0x5ea087[_0x9f10('0xba')]&&_0x5ea087[_0x9f10('0xbb')]){_0x3a1f83=_0x5ea087;var _0x35e05f={'interaction':{'id':_0x49406f},'agent':{'id':_0x254354[_0x9f10('0x96')]['id'],'name':_0x254354[_0x9f10('0x96')][_0x9f10('0x2b')],'fullname':_0x254354[_0x9f10('0x96')][_0x9f10('0x34')],'email':_0x254354[_0x9f10('0x96')]['email']},'contact':_0x254354['body']['contact'],'account':_0x254354[_0x9f10('0x2f')]['account']};var _0x3c412e={'rejectUnauthorized':![],'method':_0x9f10('0xbf'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5ea087[_0x9f10('0xba')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x254354[_0x9f10('0x96')][_0x9f10('0xc0')]],'buttons':null,'topic':_0x3a1f83[_0x9f10('0xbc')],'note':_[_0x9f10('0xc1')](_0x3a1f83[_0x9f10('0xbd')])?null:getMustacheRender(_0x3a1f83[_0x9f10('0xbd')],_0x35e05f),'metadata':null},'redirect':_0x9f10('0xc2'),'json':!![]};try{if(!_[_0x9f10('0xc1')](_0x3a1f83[_0x9f10('0xbe')])){var _0x1bb7f5=getMustacheRender(_0x3a1f83['vidaooMetadata'],_0x35e05f);var _0x20c974=JSON[_0x9f10('0x7f')](_0x1bb7f5);_0x3c412e[_0x9f10('0x2f')][_0x9f10('0xc3')]=_0x20c974;}}catch(_0x494ca9){throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))](_0x9f10('0xc6'));}return rp(_0x3c412e);}else{throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9f10('0x16')](function(_0x36ec7d){_0x5e4144=_0x36ec7d;if(_0x5e4144['id']){var _0x119e9c={'body':_0x5e4144[_0x9f10('0xc7')],'ChatWebsiteId':_0x3a1f83['id'],'ChatInteractionId':_0x4e7496['id'],'direction':_0x9f10('0xc8'),'UserId':_0x254354[_0x9f10('0x96')]['id']};return db[_0x9f10('0xc9')]['create'](_0x119e9c,{});}else{throw new db[(_0x9f10('0xc4'))]['ValidationError'](_0x9f10('0xca'));}})[_0x9f10('0x16')](function(){return _0x4e7496[_0x9f10('0xcb')]({'vidaooSessionId':_0x5e4144['id']});})[_0x9f10('0x16')](respondWithResult(_0x11e26f,null))['catch'](handleError(_0x11e26f,null));};exports['customUpdate']=function(_0x1b71f3,_0x23d1a3){if(_0x1b71f3['body']['id']){delete _0x1b71f3[_0x9f10('0x2f')]['id'];}return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x1b71f3[_0x9f10('0xb6')]['id']},'include':[{'model':db[_0x9f10('0xcc')],'as':_0x9f10('0x6b')}]})[_0x9f10('0x16')](handleEntityNotFound(_0x23d1a3,null))[_0x9f10('0x16')](saveUpdates(_0x1b71f3[_0x9f10('0x2f')],null))[_0x9f10('0x16')](respondWithResult(_0x23d1a3,null))[_0x9f10('0x3a')](handleError(_0x23d1a3,null));};exports[_0x9f10('0xcd')]=function(_0x53998e,_0x5f531c){if(_0x53998e['body']['id']){delete _0x53998e[_0x9f10('0x2f')]['id'];}return db[_0x9f10('0x44')][_0x9f10('0x66')]({'where':{'id':_0x53998e['params']['id']}})[_0x9f10('0x16')](function(_0x1374b4){if(!_0x1374b4){logger['error'](_0x9f10('0xce'),_0x9f10('0xcd'),0x194,_0x9f10('0xcf'));_0x5f531c[_0x9f10('0x1e')](0x194);}else{if(_0x1374b4[_0x9f10('0x3e')]){throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))](_0x9f10('0xd0'));}}return _0x1374b4;})[_0x9f10('0x16')](function(_0x579d2d){if(_0x579d2d){return _0x579d2d[_0x9f10('0x28')]({'closed':_0x53998e[_0x9f10('0x2f')][_0x9f10('0x3f')],'disposition':_0x53998e['body'][_0x9f10('0x40')]})[_0x9f10('0x16')](function(_0x430782){return _0x430782;});}})[_0x9f10('0x16')](function(){return respondWithRpcPromise(_0x9f10('0xd1'),_0x9f10('0xcd'),_0x53998e['body'],client9004);})[_0x9f10('0x16')](respondWithResult(_0x5f531c,null))[_0x9f10('0x3a')](handleError(_0x5f531c,null));};exports['attachmentUpload']=function(_0xf4fd93,_0x4fd3d4){_0xf4fd93[_0x9f10('0x2f')][_0x9f10('0x2b')]=_0xf4fd93[_0x9f10('0xd2')]['originalname'];_0xf4fd93['body'][_0x9f10('0xd3')]=_0xf4fd93[_0x9f10('0xd2')][_0x9f10('0xd4')];_0xf4fd93[_0x9f10('0x2f')][_0x9f10('0x71')]=_0xf4fd93[_0x9f10('0xd2')][_0x9f10('0xd5')];return db[_0x9f10('0xd6')][_0x9f10('0xd7')](_0xf4fd93['body'])[_0x9f10('0x16')](respondWithResult(_0x4fd3d4,0xc9))[_0x9f10('0x3a')](handleError(_0x4fd3d4,null));};exports[_0x9f10('0xd8')]=function(_0x3195cd,_0x3f06ac){return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x3195cd[_0x9f10('0xb6')]['id']},'raw':!![]})[_0x9f10('0x16')](handleEntityNotFound(_0x3f06ac,null))[_0x9f10('0x16')](function(_0x9a3870){if(_0x9a3870){if(_0x9a3870[_0x9f10('0x3f')]){return _0x3f06ac['status'](0x193)[_0x9f10('0x27')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x9f10('0xb9')]({'where':{'id':_0x3195cd[_0x9f10('0x49')][_0x9f10('0xd9')]},'raw':!![]})[_0x9f10('0x16')](handleEntityNotFound(_0x3f06ac,null));}})[_0x9f10('0x16')](function(_0x53dbab){if(_0x53dbab){var _0x481078=_0x53dbab[_0x9f10('0xda')]!==null;var _0x1a2a20=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],'server/files/attachments/');if(_0x481078){_0x1a2a20=path['join'](_0x1a2a20,_0x9f10('0xdd'));}var _0x293349=path[_0x9f10('0xdb')](_0x1a2a20,_0x53dbab[_0x9f10('0xd3')]);return _0x3f06ac[_0x9f10('0xde')](_0x293349);}})[_0x9f10('0x3a')](handleError(_0x3f06ac,null));};exports['close']=function(_0x364c46,_0x311ef6){var _0x364168=null;var _0x427d85=null;var _0x495833=null;if(_0x364c46[_0x9f10('0x2f')]['id']){delete _0x364c46[_0x9f10('0x2f')]['id'];}if(_0x364c46[_0x9f10('0x2f')][_0x9f10('0xdf')]){_0x495833=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],_0x9f10('0xe0'),util[_0x9f10('0xe1')]('transcript-%s.txt',Date[_0x9f10('0xe2')]()));_0x364c46[_0x9f10('0x2f')][_0x9f10('0xe3')]=_0x495833;}return db[_0x9f10('0x44')]['find']({'where':{'id':_0x364c46[_0x9f10('0xb6')]['id']},'include':[{'model':db[_0x9f10('0xc9')],'as':_0x9f10('0xe4'),'include':[{'model':db['User'],'as':_0x9f10('0xe5')}]}]})[_0x9f10('0x16')](handleEntityNotFound(_0x311ef6,null))[_0x9f10('0x16')](saveUpdates(_0x364c46['body'],null))[_0x9f10('0x16')](function(_0x267abb){if(_0x267abb){_0x364168=_0x267abb;return db['ChatWebsite']['find']({'where':{'id':_0x364168['ChatWebsiteId']}});}})[_0x9f10('0x16')](function(_0x36e6e4){if(_0x36e6e4){_0x427d85=_0x36e6e4;return db[_0x9f10('0xcc')][_0x9f10('0x66')]({'where':{'id':_0x364168[_0x9f10('0x6f')]}});}})['then'](function(_0x154548){if(_0x154548){if(_0x495833){var _0x54e40b=null;for(var _0xb28c2e=0x1;_0xb28c2e<_0x364168[_0x9f10('0xe4')]['length'];++_0xb28c2e){_0x54e40b=_0x364168[_0x9f10('0xe4')][_0xb28c2e];var _0xef1054=_0x54e40b[_0x9f10('0x3e')]?util[_0x9f10('0xe1')](_0x9f10('0xe6'),_0x427d85[_0x9f10('0xe7')],_0x54e40b['UserId']):_0x9f10('0xe8');var _0x427cef=_0x364c46[_0x9f10('0x2f')][_0x9f10('0xe9')]||util[_0x9f10('0xe1')](_0x9f10('0xe6'),_0x9f10('0xea'),_0x54e40b[_0x9f10('0x6f')]);switch(_0x427d85[_0x9f10('0xeb')]){case'website_alias':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?util[_0x9f10('0xe1')]('%s%d',_0x427d85[_0x9f10('0xe7')],_0x54e40b[_0x9f10('0x3e')]):_0x9f10('0xe8');break;case'agent_alias':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?_0x54e40b[_0x9f10('0xe5')][_0x9f10('0xec')]||_0x54e40b[_0x9f10('0xe5')]['fullname']:'System';break;case'agent_fullname':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?_0x54e40b[_0x9f10('0xe5')]['fullname']:'System';break;default:_0xef1054=_0x54e40b[_0x9f10('0x3e')]?util['format']('%s%d',_0x427d85[_0x9f10('0xe7')],_0x54e40b[_0x9f10('0x3e')]):_0x9f10('0xe8');}var _0x1c0c1f=util[_0x9f10('0xe1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x54e40b[_0x9f10('0x7e')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x54e40b[_0x9f10('0xed')]==='in'?_0x427cef:_0xef1054,_0x54e40b[_0x9f10('0x2f')]);if(!_0x54e40b['secret']){fs['appendFileSync'](_0x495833,_0x1c0c1f);}}return db[_0x9f10('0xee')][_0x9f10('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x9f10('0xef')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9f10('0xf0'),'raw':!![]}]}]});}}})[_0x9f10('0x16')](function(_0x3f13d7){if(!_0x3f13d7||!_0x3f13d7[_0x9f10('0xf1')]||!_0x364c46[_0x9f10('0x2f')])return _0x364168;var _0x4636fc=_0x3f13d7[_0x9f10('0xf2')]();return respondWithRpcPromise('SendMail',_0x9f10('0xf3'),{'account':_0x4636fc,'message':{'from':util[_0x9f10('0xe1')]('\x22%s\x22\x20<%s>',_0x3f13d7[_0x9f10('0x2b')],_0x3f13d7[_0x9f10('0xc0')]||_0x3f13d7['Smtp'][_0x9f10('0x96')]),'to':_0x364c46[_0x9f10('0x2f')][_0x9f10('0xdf')],'subject':_0x9f10('0xf4'),'text':util[_0x9f10('0xe1')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x364c46['body'][_0x9f10('0xdf')]),'attachments':[{'path':_0x495833}]}})[_0x9f10('0x16')](function(){return _0x364168;})[_0x9f10('0x3a')](function(_0x598774){logger['error'](_0x598774);});})[_0x9f10('0x16')](respondWithStatusCode(_0x311ef6,0xc8))[_0x9f10('0x3a')](handleError(_0x311ef6,null));};exports['addMessage']=function(_0x50507b,_0x580a4b){return db['ChatMessage'][_0x9f10('0x66')]({'where':{'id':_0x50507b[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x580a4b,null))[_0x9f10('0x16')](function(_0x34962c){if(_0x34962c){return _0x34962c[_0x9f10('0xf5')](_0x50507b['body'][_0x9f10('0xf6')],_[_0x9f10('0xf7')](_0x50507b[_0x9f10('0x2f')],[_0x9f10('0xf6'),'id'])||{});}})[_0x9f10('0x16')](respondWithResult(_0x580a4b,null))[_0x9f10('0x3a')](handleError(_0x580a4b,null));};exports[_0x9f10('0xf8')]=function(_0x49e4b7,_0x162f72){var _0xdae524={'raw':![],'where':{}};var _0x24b022={};var _0x3aab50={'count':0x0,'rows':[]};return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x49e4b7[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x162f72,null))[_0x9f10('0x16')](function(_0x483403){if(_0x483403){_0x24b022[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0xc9')][_0x9f10('0xb2')]);_0x24b022['query']=_[_0x9f10('0x48')](_0x49e4b7[_0x9f10('0x49')]);_0x24b022[_0x9f10('0x4a')]=_['intersection'](_0x24b022[_0x9f10('0x47')],_0x24b022['query']);_0xdae524[_0x9f10('0x4d')]=_['intersection'](_0x24b022['model'],qs[_0x9f10('0x4c')](_0x49e4b7['query'][_0x9f10('0x4c')]));_0xdae524[_0x9f10('0x4d')]=_0xdae524[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0xdae524['attributes']:_0x24b022[_0x9f10('0x47')];if(!_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x4f')]('nolimit')){_0xdae524[_0x9f10('0x24')]=qs[_0x9f10('0x24')](_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x24')]);_0xdae524[_0x9f10('0x23')]=qs[_0x9f10('0x23')](_0x49e4b7[_0x9f10('0x49')]['offset']);}_0xdae524['order']=qs['sort'](_0x49e4b7['query'][_0x9f10('0x52')]);_0xdae524[_0x9f10('0x7b')]=qs[_0x9f10('0x4a')](_[_0x9f10('0x53')](_0x49e4b7[_0x9f10('0x49')],_0x24b022[_0x9f10('0x4a')]));_0xdae524[_0x9f10('0x7b')][_0x9f10('0xaf')]=_0x483403['id'];if(_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x88')]){_0xdae524[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0xdae524[_0x9f10('0x7b')],{'$or':_[_0x9f10('0x33')](_0xdae524['attributes'],function(_0x153357){var _0x5a57e9={};_0x5a57e9[_0x153357]={'$like':'%'+_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x88')]+'%'};return _0x5a57e9;})});}if(_0x49e4b7[_0x9f10('0x49')]['$gte']){var _0x52c3df=_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x80')][_0x9f10('0x37')](',');var _0xd6a04a={};_0xd6a04a[_0x52c3df[0x0]]={'$gte':moment(_0x52c3df[0x1])[_0x9f10('0xe1')](_0x9f10('0xf9'))};_0xdae524[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0xdae524[_0x9f10('0x7b')],_0xd6a04a);}_0xdae524=_[_0x9f10('0x2e')]({},_0xdae524,_0x49e4b7[_0x9f10('0xb5')]);return db[_0x9f10('0xc9')][_0x9f10('0x22')]({'where':_0xdae524[_0x9f10('0x7b')]})[_0x9f10('0x16')](function(_0x121d0d){_0x3aab50[_0x9f10('0x22')]=_0x121d0d;if(_0x49e4b7[_0x9f10('0x49')]['includeAll']){_0xdae524[_0x9f10('0xb4')]=[{'all':!![]}];}return db[_0x9f10('0xc9')][_0x9f10('0xfa')](_0xdae524);})['then'](function(_0x1f7081){_0x3aab50[_0x9f10('0xb1')]=_0x1f7081;return _0x3aab50;});}})[_0x9f10('0x16')](respondWithFilteredResult(_0x162f72,_0xdae524))['catch'](handleError(_0x162f72,null));};exports[_0x9f10('0xfb')]=function(_0xc11c03,_0x249595){var _0x2f54aa={'where':{}},_0x5566c4={},_0x2da6a8={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9f10('0xb9')]({'where':{'id':_0xc11c03[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x249595,null))[_0x9f10('0x16')](function(_0x575861){if(_0x575861){_0x5566c4[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0xc9')][_0x9f10('0xb2')]);_0x5566c4[_0x9f10('0x49')]=_[_0x9f10('0x48')](_0xc11c03[_0x9f10('0x49')]);_0x5566c4[_0x9f10('0x4a')]=_[_0x9f10('0x4b')](_0x5566c4['model'],_0x5566c4['query']);_0x2f54aa[_0x9f10('0x4d')]=_[_0x9f10('0x4b')](_0x5566c4[_0x9f10('0x47')],qs['fields'](_0xc11c03[_0x9f10('0x49')]['fields']));_0x2f54aa[_0x9f10('0x4d')]=_0x2f54aa[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0x2f54aa['attributes']:_0x5566c4['model'];if(!_0xc11c03[_0x9f10('0x49')]['hasOwnProperty'](_0x9f10('0x50'))){_0x2f54aa[_0x9f10('0x24')]=qs['limit'](_0xc11c03[_0x9f10('0x49')]['limit']);_0x2f54aa['offset']=qs[_0x9f10('0x23')](_0xc11c03[_0x9f10('0x49')][_0x9f10('0x23')]);}_0x2f54aa['order']=qs[_0x9f10('0x52')](_0xc11c03['query'][_0x9f10('0x52')]);_0x2f54aa[_0x9f10('0x7b')]=qs[_0x9f10('0x4a')](_['pick'](_0xc11c03[_0x9f10('0x49')],_0x5566c4[_0x9f10('0x4a')]));_0x2f54aa[_0x9f10('0x7b')]['ChatInteractionId']=_0x575861['id'];if(_0xc11c03[_0x9f10('0x49')][_0x9f10('0x88')]){_0x2f54aa[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0x2f54aa[_0x9f10('0x7b')],{'$or':_[_0x9f10('0x33')](_0x2f54aa[_0x9f10('0x4d')],function(_0x91c6c){var _0x52da55={};_0x52da55[_0x91c6c]={'$like':'%'+_0xc11c03[_0x9f10('0x49')][_0x9f10('0x88')]+'%'};return _0x52da55;})});}_0x2f54aa['where']['secret']=![];if(_0xc11c03['query']['id']){_0x2f54aa[_0x9f10('0x7b')]['id']={'$gt':_0xc11c03[_0x9f10('0x49')]['id']};}_0x2f54aa=_['merge']({},_0x2f54aa,_0xc11c03[_0x9f10('0xb5')]);return db[_0x9f10('0xc9')][_0x9f10('0x22')]({'where':_0x2f54aa[_0x9f10('0x7b')]})[_0x9f10('0x16')](function(_0x27386b){_0x2da6a8[_0x9f10('0x22')]=_0x27386b;_0x2f54aa['include']=[];if(_0xc11c03[_0x9f10('0x49')][_0x9f10('0xfc')]){_0x2f54aa[_0x9f10('0xb4')][_0x9f10('0x39')]({'model':db[_0x9f10('0xe5')],'as':'User','attributes':['id','fullname',_0x9f10('0xec')]});}if(_0xc11c03[_0x9f10('0x49')]['includeAll']){_0x2f54aa[_0x9f10('0xb4')]=[{'all':!![]}];}return db[_0x9f10('0xc9')][_0x9f10('0xfa')](_0x2f54aa);})[_0x9f10('0x16')](function(_0x1671e0){_0x2da6a8[_0x9f10('0xb1')]=_0x1671e0;return _0x2da6a8;});}})['then'](respondWithFilteredResult(_0x249595,_0x2f54aa))[_0x9f10('0x3a')](handleError(_0x249595,null));};exports[_0x9f10('0xfd')]=function(_0x3c6f1b,_0x175b74){return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x3c6f1b[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x175b74,null))[_0x9f10('0x16')](function(_0x15c5df){if(_0x15c5df){return _0x15c5df[_0x9f10('0xfe')](_0x3c6f1b[_0x9f10('0x2f')]['ids'],_[_0x9f10('0xf7')](_0x3c6f1b[_0x9f10('0x2f')],[_0x9f10('0xf6'),'id'])||{})[_0x9f10('0xff')](function(){return db['Tag'][_0x9f10('0xfa')]({'attributes':['id','name','color'],'where':{'id':_0x3c6f1b[_0x9f10('0x2f')][_0x9f10('0xf6')]}});})['then'](function(_0x4943c3){socket[_0x9f10('0x100')]('chatInteractionTags:save',{'id':Number(_0x3c6f1b[_0x9f10('0xb6')]['id']),'tags':_0x4943c3||[]});return{'id':Number(_0x3c6f1b[_0x9f10('0xb6')]['id']),'tags':_0x4943c3||[]};});}})['then'](respondWithResult(_0x175b74,null))[_0x9f10('0x3a')](handleError(_0x175b74,null));};exports[_0x9f10('0x101')]=function(_0x4a77d2,_0x1c68d7){return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x4a77d2[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x1c68d7,null))[_0x9f10('0x16')](function(_0x3a58c4){if(_0x3a58c4){return _0x3a58c4['removeTags'](_0x4a77d2[_0x9f10('0x49')][_0x9f10('0xf6')]);}})[_0x9f10('0x16')](respondWithStatusCode(_0x1c68d7,null))[_0x9f10('0x3a')](handleError(_0x1c68d7,null));};exports[_0x9f10('0xde')]=function(_0x2e3239,_0x1135ce){var _0x492aaf=moment()[_0x9f10('0x102')]()['toString']();var _0x56b209=path[_0x9f10('0xdb')](config['root'],_0x9f10('0x103'),'files',_0x9f10('0x104'));var _0x2ce940=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],_0x9f10('0x103'),'files',_0x9f10('0x105'));var _0x274ea7=path[_0x9f10('0xdb')](_0x56b209,_0x492aaf);var _0x2b0199=util['format'](_0x9f10('0x106'),_0x2e3239['params']['id'],_0x492aaf);var _0x1511b7=path[_0x9f10('0xdb')](_0x56b209,_0x2b0199);var _0xa72487=[];_0xa72487[_0x9f10('0x39')]({'model':db['User'],'as':_0x9f10('0xe5'),'attributes':['id',_0x9f10('0x34')],'raw':!![]});_0xa72487[_0x9f10('0x39')]({'model':db['CmContact'],'as':_0x9f10('0x6b'),'attributes':['id',_0x9f10('0x107'),'lastName'],'raw':!![]});if(_0x2e3239[_0x9f10('0x49')][_0x9f10('0x105')]){_0xa72487[_0x9f10('0x39')]({'model':db[_0x9f10('0xd6')],'as':_0x9f10('0xd6'),'raw':!![]});}var _0x4bbfa5=[{'model':db[_0x9f10('0xc9')],'as':'Messages','attributes':['id',_0x9f10('0x2f'),'createdAt','direction',_0x9f10('0x108'),_0x9f10('0x84')],'include':_0xa72487}];_0x4bbfa5['push']({'model':db[_0x9f10('0x109')],'as':_0x9f10('0x10a'),'attributes':['id',_0x9f10('0x2b')]});_0x4bbfa5[_0x9f10('0x39')]({'model':db[_0x9f10('0xe5')],'as':_0x9f10('0x10b'),'attributes':['id',_0x9f10('0x34')]});return db[_0x9f10('0x44')][_0x9f10('0x66')]({'where':{'id':_0x2e3239[_0x9f10('0xb6')]['id']},'include':_0x4bbfa5})[_0x9f10('0x16')](handleEntityNotFound(_0x1135ce,null))[_0x9f10('0x16')](function(_0x502a15){if(_0x502a15){var _0x2faafe=_0x502a15[_0x9f10('0x10c')]({'plain':!![]});fs[_0x9f10('0x10d')](_0x274ea7);var _0x46de3d={'channel':_0x9f10('0x10e'),'account':_0x2faafe[_0x9f10('0x10a')]['name'],'agent':_0x2faafe[_0x9f10('0x10b')]?_0x2faafe[_0x9f10('0x10b')][_0x9f10('0x34')]:_0x9f10('0x10f'),'createdAt':moment(_0x2faafe[_0x9f10('0x7e')])[_0x9f10('0xe1')](_0x9f10('0xf9'))['toString'](),'closedAt':_0x2faafe[_0x9f10('0x3f')]?moment(_0x2faafe[_0x9f10('0x110')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9f10('0x9b')]():'','disposition':_0x2faafe[_0x9f10('0x40')],'chatInfo':{'browser':_0x2faafe[_0x9f10('0x111')],'os':_0x2faafe[_0x9f10('0x112')],'referer':_0x2faafe['referer'],'customerIp':_0x2faafe[_0x9f10('0x113')],'customerPort':_0x2faafe[_0x9f10('0x114')]?_0x2faafe[_0x9f10('0x114')]:_0x9f10('0x10f')},'messages':_(_0x2faafe[_0x9f10('0xe4')])[_0x9f10('0x115')]()[_0x9f10('0x88')]({'secret':![]})[_0x9f10('0x33')](function(_0xddbe2b){if(_0xddbe2b['Attachment']){var _0x32e5fd=path['join'](_0x2ce940,_0xddbe2b[_0x9f10('0xd6')][_0x9f10('0xd3')]);if(fs[_0x9f10('0x116')](_0x32e5fd)){fs['createReadStream'](_0x32e5fd)['pipe'](fs[_0x9f10('0x117')](path[_0x9f10('0xdb')](_0x274ea7,_0xddbe2b[_0x9f10('0xd6')][_0x9f10('0xd3')])));}}return{'date':moment(_0xddbe2b[_0x9f10('0x7e')])[_0x9f10('0xe1')](_0x9f10('0xf9'))[_0x9f10('0x9b')](),'sender':_0xddbe2b['direction']===_0x9f10('0xc8')?_0xddbe2b['User']?_0xddbe2b[_0x9f10('0xe5')][_0x9f10('0x34')]:_0x9f10('0xe8'):_0xddbe2b['Contact']['firstName']+(_0xddbe2b['Contact']['lastName']?'\x20'+_0xddbe2b['Contact'][_0x9f10('0x118')]:''),'body':_0xddbe2b[_0x9f10('0xd6')]?_0xddbe2b['Attachment'][_0x9f10('0xd3')]:_0xddbe2b[_0x9f10('0x2f')],'direction':_0xddbe2b['direction']===_0x9f10('0xc8')?'A':'C','secret':_0xddbe2b[_0x9f10('0x108')],'read':_0xddbe2b[_0x9f10('0x84')],'attachment':_0xddbe2b['Attachment']};})[_0x9f10('0x68')]()};return ejs[_0x9f10('0x119')](path['join'](config[_0x9f10('0xdc')],_0x9f10('0x103'),'views',_0x9f10('0x11a')),{'interaction':_0x46de3d})[_0x9f10('0x16')](function(_0xf35cbd){var _0x59dcf3=path[_0x9f10('0xdb')](_0x274ea7,'transcript-'+_0x2faafe['id']+'-'+_0x492aaf+_0x9f10('0x11b'));var _0x531ae6={'path':_0x59dcf3,'channel':_0x9f10('0x10e'),'interactionId':_0x2faafe['id']};return pdf[_0x9f10('0x11c')](_0xf35cbd,_0x531ae6);})['then'](function(){return new Promise(function(_0x2809b5,_0x44d12b){zipdir(_0x274ea7,{'saveTo':_0x1511b7},function(_0x3518e4,_0x208926){if(_0x3518e4)return _0x44d12b(_0x3518e4);return _0x2809b5(_0x208926);});})[_0x9f10('0x16')](function(){return new BPromise(function(_0x5b9746,_0x208341){rimraf(_0x274ea7,function(_0x41134f){if(_0x41134f)_0x208341(_0x41134f);return _0x5b9746();});});})[_0x9f10('0x16')](function(){return _0x1135ce[_0x9f10('0xde')](_0x1511b7,_0x2b0199,function(_0x6b6e72){if(_0x6b6e72){logger['error']('err',_0x6b6e72);}else{fs[_0x9f10('0x11d')](_0x1511b7);}});});});}else{return _0x1135ce[_0x9f10('0x1e')](0xc8);}})[_0x9f10('0x3a')](handleError(_0x1135ce,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0362169..9eda2b1 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 _0x86b3=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map','findAll','then','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x5a6474,_0x4678e1){var _0x485021=function(_0x24dffd){while(--_0x24dffd){_0x5a6474['push'](_0x5a6474['shift']());}};_0x485021(++_0x4678e1);}(_0x86b3,0xc5));var _0x386b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86b3[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x386b('0x0'));var ChatInteraction=require(_0x386b('0x1'))['db'][_0x386b('0x2')];var ChatMessage=require(_0x386b('0x1'))['db'][_0x386b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x386b('0x4')](0x0);var events={'afterCreate':_0x386b('0x5'),'afterUpdate':_0x386b('0x6'),'afterDestroy':_0x386b('0x7')};function emitEvent(_0x186701){return function(_0x3d2431,_0x476b3b,_0x51972d){_0x3d2431[_0x386b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f653d){_0x3d2431[_0x386b('0x9')]('Users',_0x3f653d[_0x386b('0xa')](function(_0x18922b){return{'id':_0x18922b['id']};}));return ChatMessage[_0x386b('0xb')]({'where':{'ChatInteractionId':_0x3d2431['id'],'direction':'in','read':![]},'raw':!![]});})[_0x386b('0xc')](function(_0x39b255){_0x3d2431[_0x386b('0x9')]('unreadMessages',_0x39b255[_0x386b('0xd')]);ChatInteractionEvents[_0x386b('0xe')](_0x186701+':'+_0x3d2431['id'],_0x3d2431);ChatInteractionEvents[_0x386b('0xe')](_0x186701,_0x3d2431);_0x51972d(null);})[_0x386b('0xf')](_0x51972d(null));};}for(var e in events){if(events[_0x386b('0x10')](e)){var event=events[e];ChatInteraction[_0x386b('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x5ab0=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','emit','catch','hook','events'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5ab0,0x1ef));var _0x05ab=function(_0x131f6d,_0x5765ef){_0x131f6d=_0x131f6d-0x0;var _0x1741a8=_0x5ab0[_0x131f6d];return _0x1741a8;};'use strict';var EventEmitter=require(_0x05ab('0x0'));var ChatInteraction=require(_0x05ab('0x1'))['db'][_0x05ab('0x2')];var ChatMessage=require(_0x05ab('0x1'))['db'][_0x05ab('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x05ab('0x4')](0x0);var events={'afterCreate':_0x05ab('0x5'),'afterUpdate':_0x05ab('0x6'),'afterDestroy':_0x05ab('0x7')};function emitEvent(_0x30b733){return function(_0x315f52,_0x4de3bf,_0x3ebd7a){_0x315f52['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x24d45a){_0x315f52[_0x05ab('0x8')](_0x05ab('0x9'),_0x24d45a[_0x05ab('0xa')](function(_0x6cbc57){return{'id':_0x6cbc57['id']};}));return ChatMessage[_0x05ab('0xb')]({'where':{'ChatInteractionId':_0x315f52['id'],'direction':'in','read':![]},'raw':!![]});})[_0x05ab('0xc')](function(_0x1042de){_0x315f52[_0x05ab('0x8')]('unreadMessages',_0x1042de['length']);ChatInteractionEvents[_0x05ab('0xd')](_0x30b733+':'+_0x315f52['id'],_0x315f52);ChatInteractionEvents[_0x05ab('0xd')](_0x30b733,_0x315f52);_0x3ebd7a(null);})[_0x05ab('0xe')](_0x3ebd7a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x05ab('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index f48168e..ace4c99 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 _0xd8eb=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd8eb,0x11b));var _0xbd8e=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xd8eb[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var logger=require(_0xbd8e('0x2'))(_0xbd8e('0x3'));var moment=require(_0xbd8e('0x4'));var BPromise=require(_0xbd8e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8e('0x6'));var rimraf=require(_0xbd8e('0x7'));var config=require(_0xbd8e('0x8'));var attributes=require(_0xbd8e('0x9'));module[_0xbd8e('0xa')]=function(_0x5be2b7,_0x36f891){return _0x5be2b7[_0xbd8e('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a3bf4,_0x4d08dc,_0x271da6){if(_0x5a3bf4[_0xbd8e('0xc')]('closed')){_0x5a3bf4['closedAt']=moment()[_0xbd8e('0xd')](_0xbd8e('0xe'));}_0x271da6(null,_0x5a3bf4);}},'charset':_0xbd8e('0xf'),'collate':_0xbd8e('0x10')});}; \ No newline at end of file +var _0xee1d=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_interactions'];(function(_0x1308ec,_0x32c99e){var _0x1a43c8=function(_0x18ff62){while(--_0x18ff62){_0x1308ec['push'](_0x1308ec['shift']());}};_0x1a43c8(++_0x32c99e);}(_0xee1d,0x1b6));var _0xdee1=function(_0x54eef5,_0x2da6b4){_0x54eef5=_0x54eef5-0x0;var _0x342329=_0xee1d[_0x54eef5];return _0x342329;};'use strict';var _=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdee1('0x2'));var BPromise=require(_0xdee1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdee1('0x4'));var rimraf=require(_0xdee1('0x5'));var config=require(_0xdee1('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xdee1('0x7')]=function(_0x5ccc94,_0x176c55){return _0x5ccc94[_0xdee1('0x8')]('ChatInteraction',attributes,{'tableName':_0xdee1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e134b,_0x15694c,_0x1c18a5){if(_0x3e134b[_0xdee1('0xa')]('closed')){_0x3e134b[_0xdee1('0xb')]=moment()[_0xdee1('0xc')](_0xdee1('0xd'));}_0x1c18a5(null,_0x3e134b);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 40868f7..2dae279 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 _0x2c9f=['error','code','message','catch','UpdateChatInteraction','update','raw','options','attributes','limit','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x2c9f,0x1c9));var _0xf2c9=function(_0x11d44b,_0x1c8de0){_0x11d44b=_0x11d44b-0x0;var _0x7af8aa=_0x2c9f[_0x11d44b];return _0x7af8aa;};'use strict';var _=require(_0xf2c9('0x0'));var util=require(_0xf2c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2c9('0x2'));var fs=require('fs');var Redis=require(_0xf2c9('0x3'));var db=require(_0xf2c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2c9('0x5'))(_0xf2c9('0x6'));var config=require(_0xf2c9('0x7'));var jayson=require(_0xf2c9('0x8'));var client=jayson[_0xf2c9('0x9')]['http']({'port':0x232a});config[_0xf2c9('0xa')]=_[_0xf2c9('0xb')](config[_0xf2c9('0xa')],{'host':_0xf2c9('0xc'),'port':0x18eb});var socket=require(_0xf2c9('0xd'))(new Redis(config[_0xf2c9('0xa')]));require(_0xf2c9('0xe'))['register'](socket);function respondWithRpcPromise(_0x2861ab,_0x424058,_0xf74184){return new BPromise(function(_0x2b60f6,_0x265174){return client[_0xf2c9('0xf')](_0x2861ab,_0xf74184)[_0xf2c9('0x10')](function(_0x3f0ba4){logger[_0xf2c9('0x11')](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));logger[_0xf2c9('0x14')](_0xf2c9('0x15'),_0x424058,_0xf2c9('0x13'),JSON[_0xf2c9('0x16')](_0x3f0ba4));if(_0x3f0ba4[_0xf2c9('0x17')]){if(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x18')]===0x1f4){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x3f0ba4['error'][_0xf2c9('0x19')]);return _0x265174(_0x3f0ba4[_0xf2c9('0x17')]['message']);}logger[_0xf2c9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x424058,_0x3f0ba4[_0xf2c9('0x17')]['message']);return _0x2b60f6(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x19')]);}else{logger['info'](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));_0x2b60f6(_0x3f0ba4['result'][_0xf2c9('0x19')]);}})[_0xf2c9('0x1a')](function(_0x44d362){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x44d362);_0x265174(_0x44d362);});});}exports[_0xf2c9('0x1b')]=function(_0x1fd3ac){var _0xb839db=this;return new Promise(function(_0x90743a,_0x1e006a){return db['ChatInteraction'][_0xf2c9('0x1c')](_0x1fd3ac['body'],{'raw':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd3ac[_0xf2c9('0x1e')]?_0x1fd3ac['options']['where']||null:null,'attributes':_0x1fd3ac['options']?_0x1fd3ac[_0xf2c9('0x1e')][_0xf2c9('0x1f')]||null:null,'limit':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x20')]||null:null})[_0xf2c9('0x10')](function(_0x4bb35f){logger[_0xf2c9('0x11')](_0xf2c9('0x1b'),_0x1fd3ac);logger[_0xf2c9('0x14')]('UpdateChatInteraction',_0x1fd3ac,JSON[_0xf2c9('0x16')](_0x4bb35f));_0x90743a(_0x4bb35f);})[_0xf2c9('0x1a')](function(_0x31beb2){logger[_0xf2c9('0x17')](_0xf2c9('0x1b'),_0x31beb2[_0xf2c9('0x19')],_0x1fd3ac);_0x1e006a(_0xb839db[_0xf2c9('0x17')](0x1f4,_0x31beb2[_0xf2c9('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x512d10){return new Promise(function(_0x3b1cfe,_0x17c1b8){return db[_0xf2c9('0x21')][_0xf2c9('0x22')]({'where':_0x512d10[_0xf2c9('0x1e')]?_0x512d10[_0xf2c9('0x1e')]['where']||null:null})[_0xf2c9('0x10')](function(_0x1d0d3b){if(_0x1d0d3b){return _0x1d0d3b[_0xf2c9('0x23')](_0x512d10[_0xf2c9('0x24')]['ids'],_[_0xf2c9('0x25')](_0x512d10['body'],['ids','id'])||{});}})[_0xf2c9('0x26')](function(_0x5ccb69){logger[_0xf2c9('0x11')](_0xf2c9('0x27'),_0x512d10);logger[_0xf2c9('0x14')]('AddTags',_0x512d10,JSON[_0xf2c9('0x16')](_0x5ccb69));_0x3b1cfe(_0x5ccb69);})[_0xf2c9('0x1a')](function(_0x4ebaab){logger[_0xf2c9('0x17')]('AddTags',_0x4ebaab[_0xf2c9('0x19')],_0x512d10);_0x17c1b8(_this[_0xf2c9('0x17')](0x1f4,_0x4ebaab[_0xf2c9('0x19')]));});});}; \ No newline at end of file +var _0x7ebd=['ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','register','request','info'];(function(_0x3d8857,_0x5777c8){var _0x26ee98=function(_0x357885){while(--_0x357885){_0x3d8857['push'](_0x3d8857['shift']());}};_0x26ee98(++_0x5777c8);}(_0x7ebd,0x159));var _0xd7eb=function(_0x47b504,_0x2b6163){_0x47b504=_0x47b504-0x0;var _0x16ffa9=_0x7ebd[_0x47b504];return _0x16ffa9;};'use strict';var _=require(_0xd7eb('0x0'));var util=require(_0xd7eb('0x1'));var moment=require(_0xd7eb('0x2'));var BPromise=require(_0xd7eb('0x3'));var rs=require(_0xd7eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7eb('0x5'));var logger=require('../../config/logger')(_0xd7eb('0x6'));var config=require(_0xd7eb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7eb('0x8')]({'port':0x232a});config['redis']=_[_0xd7eb('0x9')](config[_0xd7eb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7eb('0xb'))(new Redis(config[_0xd7eb('0xa')]));require('./chatInteraction.socket')[_0xd7eb('0xc')](socket);function respondWithRpcPromise(_0x1bb373,_0x54f3b7,_0x56e0d1){return new BPromise(function(_0x3efd44,_0x279c7e){return client[_0xd7eb('0xd')](_0x1bb373,_0x56e0d1)['then'](function(_0x4cb6e1){logger[_0xd7eb('0xe')](_0xd7eb('0xf'),_0x54f3b7,'request\x20sent');logger[_0xd7eb('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x54f3b7,_0xd7eb('0x11'),JSON[_0xd7eb('0x12')](_0x4cb6e1));if(_0x4cb6e1['error']){if(_0x4cb6e1[_0xd7eb('0x13')][_0xd7eb('0x14')]===0x1f4){logger[_0xd7eb('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x54f3b7,_0x4cb6e1[_0xd7eb('0x13')]['message']);return _0x279c7e(_0x4cb6e1['error'][_0xd7eb('0x15')]);}logger[_0xd7eb('0x13')](_0xd7eb('0xf'),_0x54f3b7,_0x4cb6e1[_0xd7eb('0x13')][_0xd7eb('0x15')]);return _0x3efd44(_0x4cb6e1['error'][_0xd7eb('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x54f3b7,_0xd7eb('0x11'));_0x3efd44(_0x4cb6e1['result'][_0xd7eb('0x15')]);}})[_0xd7eb('0x16')](function(_0x368b35){logger['error'](_0xd7eb('0xf'),_0x54f3b7,_0x368b35);_0x279c7e(_0x368b35);});});}exports[_0xd7eb('0x17')]=function(_0x131684){var _0x42ca46=this;return new Promise(function(_0x3dabf2,_0x383bce){return db[_0xd7eb('0x18')][_0xd7eb('0x19')](_0x131684[_0xd7eb('0x1a')],{'raw':_0x131684[_0xd7eb('0x1b')]?_0x131684['options'][_0xd7eb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131684[_0xd7eb('0x1b')]?_0x131684['options']['where']||null:null,'attributes':_0x131684[_0xd7eb('0x1b')]?_0x131684['options'][_0xd7eb('0x1d')]||null:null,'limit':_0x131684[_0xd7eb('0x1b')]?_0x131684[_0xd7eb('0x1b')][_0xd7eb('0x1e')]||null:null})['then'](function(_0x58233e){logger[_0xd7eb('0xe')]('UpdateChatInteraction',_0x131684);logger[_0xd7eb('0x10')]('UpdateChatInteraction',_0x131684,JSON[_0xd7eb('0x12')](_0x58233e));_0x3dabf2(_0x58233e);})[_0xd7eb('0x16')](function(_0x526bf0){logger[_0xd7eb('0x13')]('UpdateChatInteraction',_0x526bf0[_0xd7eb('0x15')],_0x131684);_0x383bce(_0x42ca46[_0xd7eb('0x13')](0x1f4,_0x526bf0[_0xd7eb('0x15')]));});});};exports[_0xd7eb('0x1f')]=function(_0x5c9627){return new Promise(function(_0x2f4279,_0x465bd6){return db[_0xd7eb('0x18')][_0xd7eb('0x20')]({'where':_0x5c9627[_0xd7eb('0x1b')]?_0x5c9627[_0xd7eb('0x1b')][_0xd7eb('0x21')]||null:null})['then'](function(_0x59b12b){if(_0x59b12b){return _0x59b12b[_0xd7eb('0x22')](_0x5c9627[_0xd7eb('0x1a')]['ids'],_['omit'](_0x5c9627[_0xd7eb('0x1a')],['ids','id'])||{});}})['spread'](function(_0x1113f5){logger['info'](_0xd7eb('0x23'),_0x5c9627);logger[_0xd7eb('0x10')]('AddTags',_0x5c9627,JSON['stringify'](_0x1113f5));_0x2f4279(_0x1113f5);})['catch'](function(_0x199136){logger[_0xd7eb('0x13')]('AddTags',_0x199136['message'],_0x5c9627);_0x465bd6(_this[_0xd7eb('0x13')](0x1f4,_0x199136[_0xd7eb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index ed9f07e..7faa5e0 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 _0x2ebe=['save','remove','update','emit','removeListener','register'];(function(_0x335826,_0x5053f2){var _0xa07893=function(_0x357bdf){while(--_0x357bdf){_0x335826['push'](_0x335826['shift']());}};_0xa07893(++_0x5053f2);}(_0x2ebe,0x174));var _0xe2eb=function(_0x23b000,_0x204d41){_0x23b000=_0x23b000-0x0;var _0x3ad41a=_0x2ebe[_0x23b000];return _0x3ad41a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe2eb('0x0'),_0xe2eb('0x1'),_0xe2eb('0x2')];function createListener(_0x10d2ee,_0x30b644){return function(_0x3e52ac){_0x30b644[_0xe2eb('0x3')](_0x10d2ee,_0x3e52ac);};}function removeListener(_0x146a00,_0x5ad308){return function(){ChatInteractionEvents[_0xe2eb('0x4')](_0x146a00,_0x5ad308);};}exports[_0xe2eb('0x5')]=function(_0x370d0a){for(var _0x6f5dc0=0x0,_0x3d048e=events['length'];_0x6f5dc0<_0x3d048e;_0x6f5dc0++){var _0x33af3b=events[_0x6f5dc0];var _0x403fbd=createListener('chatInteraction:'+_0x33af3b,_0x370d0a);ChatInteractionEvents['on'](_0x33af3b,_0x403fbd);}}; \ No newline at end of file +var _0xa79a=['register','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x53961f,_0x4533eb){var _0x42067f=function(_0x43422d){while(--_0x43422d){_0x53961f['push'](_0x53961f['shift']());}};_0x42067f(++_0x4533eb);}(_0xa79a,0x12f));var _0xaa79=function(_0x13d481,_0x17bc03){_0x13d481=_0x13d481-0x0;var _0x11de99=_0xa79a[_0x13d481];return _0x11de99;};'use strict';var ChatInteractionEvents=require(_0xaa79('0x0'));var events=['save',_0xaa79('0x1'),_0xaa79('0x2')];function createListener(_0x18ba57,_0x442e30){return function(_0x4e13cf){_0x442e30[_0xaa79('0x3')](_0x18ba57,_0x4e13cf);};}function removeListener(_0x12dd39,_0x29f871){return function(){ChatInteractionEvents[_0xaa79('0x4')](_0x12dd39,_0x29f871);};}exports[_0xaa79('0x5')]=function(_0x844d0c){for(var _0x4d456f=0x0,_0x257971=events['length'];_0x4d456f<_0x257971;_0x4d456f++){var _0x21ee25=events[_0x4d456f];var _0x3833ee=createListener(_0xaa79('0x6')+_0x21ee25,_0x844d0c);ChatInteractionEvents['on'](_0x21ee25,_0x3833ee);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index a61774c..b67fbc5 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 _0xbde3=['/:id/abandon','abandon','/:id/close','close','delete','/:id','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','download','post','create','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate'];(function(_0x3068cb,_0x3441b8){var _0x4f2d79=function(_0xb8ae7e){while(--_0xb8ae7e){_0x3068cb['push'](_0x3068cb['shift']());}};_0x4f2d79(++_0x3441b8);}(_0xbde3,0x130));var _0x3bde=function(_0x442ae6,_0x58743b){_0x442ae6=_0x442ae6-0x0;var _0x581317=_0xbde3[_0x442ae6];return _0x581317;};'use strict';var multer=require('multer');var util=require(_0x3bde('0x0'));var path=require(_0x3bde('0x1'));var timeout=require(_0x3bde('0x2'));var express=require(_0x3bde('0x3'));var router=express[_0x3bde('0x4')]();var fs_extra=require(_0x3bde('0x5'));var auth=require(_0x3bde('0x6'));var interaction=require(_0x3bde('0x7'));var config=require(_0x3bde('0x8'));var controller=require(_0x3bde('0x9'));router[_0x3bde('0xa')]('/',auth[_0x3bde('0xb')](),controller['index']);router['get'](_0x3bde('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x3bde('0xa')]('/:id',auth[_0x3bde('0xd')](),controller[_0x3bde('0xe')]);router[_0x3bde('0xa')](_0x3bde('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3bde('0x10')]);router['get']('/:id/messages',auth[_0x3bde('0xb')](),controller['getMessages']);router[_0x3bde('0xa')]('/:id/my_messages',auth[_0x3bde('0xd')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3bde('0xb')](),controller[_0x3bde('0x11')]);router[_0x3bde('0x12')]('/',auth[_0x3bde('0xb')](),controller[_0x3bde('0x13')]);router['post']('/:id/vidaoo',auth[_0x3bde('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3bde('0x14')]({'destination':function(_0x53a27e,_0x324c0e,_0x53588e){_0x53588e(null,path['join'](config['root'],_0x3bde('0x15')));},'filename':function(_0x5b3e28,_0x2af720,_0x22e9b1){_0x22e9b1(null,util[_0x3bde('0x16')](_0x3bde('0x17'),Date['now'](),_0x2af720[_0x3bde('0x18')][_0x3bde('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3bde('0x12')](_0x3bde('0x1a'),upload[_0x3bde('0x1b')]('file'),controller[_0x3bde('0x1c')]);router[_0x3bde('0x12')](_0x3bde('0x1d'),auth[_0x3bde('0xd')](),controller['addMessage']);router['post'](_0x3bde('0x1e'),auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x20')),controller[_0x3bde('0x21')]);router[_0x3bde('0x22')]('/:id',auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x23')),controller[_0x3bde('0x24')]);router['put'](_0x3bde('0x25'),controller[_0x3bde('0x26')]);router[_0x3bde('0x22')](_0x3bde('0x27'),auth[_0x3bde('0xd')](),controller[_0x3bde('0x28')]);router['put'](_0x3bde('0x29'),controller[_0x3bde('0x2a')]);router[_0x3bde('0x2b')](_0x3bde('0x2c'),auth[_0x3bde('0xb')](),interaction[_0x3bde('0x2d')](_0x3bde('0x1f'),'chatinteraction:destroy'),controller[_0x3bde('0x2e')]);router[_0x3bde('0x2b')](_0x3bde('0x1e'),auth['isAuthenticated'](),controller[_0x3bde('0x2f')]);module[_0x3bde('0x30')]=router; \ No newline at end of file +var _0xe09c=['diskStorage','join','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession'];(function(_0x2f922f,_0x34a14f){var _0x4a63d4=function(_0x251b57){while(--_0x251b57){_0x2f922f['push'](_0x2f922f['shift']());}};_0x4a63d4(++_0x34a14f);}(_0xe09c,0x123));var _0xce09=function(_0x1118d3,_0x15bb5f){_0x1118d3=_0x1118d3-0x0;var _0x190edc=_0xe09c[_0x1118d3];return _0x190edc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce09('0x0'));var timeout=require(_0xce09('0x1'));var express=require(_0xce09('0x2'));var router=express[_0xce09('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce09('0x4'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xce09('0x5')]('/',auth[_0xce09('0x6')](),controller[_0xce09('0x7')]);router[_0xce09('0x5')]('/describe',auth[_0xce09('0x6')](),controller[_0xce09('0x8')]);router[_0xce09('0x5')]('/:id',auth[_0xce09('0x9')](),controller[_0xce09('0xa')]);router['get'](_0xce09('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xce09('0xc')]);router[_0xce09('0x5')](_0xce09('0xd'),auth[_0xce09('0x6')](),controller[_0xce09('0xe')]);router[_0xce09('0x5')](_0xce09('0xf'),auth[_0xce09('0x9')](),controller[_0xce09('0x10')]);router[_0xce09('0x5')](_0xce09('0x11'),auth[_0xce09('0x6')](),controller[_0xce09('0x12')]);router[_0xce09('0x13')]('/',auth[_0xce09('0x6')](),controller['create']);router[_0xce09('0x13')]('/:id/vidaoo',auth[_0xce09('0x6')](),controller[_0xce09('0x14')]);var upload=multer({'storage':multer[_0xce09('0x15')]({'destination':function(_0x1a2de8,_0x4945dc,_0x5813ef){_0x5813ef(null,path[_0xce09('0x16')](config[_0xce09('0x17')],_0xce09('0x18')));},'filename':function(_0x2a1b45,_0x349029,_0x130492){_0x130492(null,util[_0xce09('0x19')]('%s-%s',Date['now'](),_0x349029[_0xce09('0x1a')][_0xce09('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xce09('0x13')](_0xce09('0x1c'),upload[_0xce09('0x1d')](_0xce09('0x1e')),controller[_0xce09('0x1f')]);router[_0xce09('0x13')](_0xce09('0xd'),auth[_0xce09('0x9')](),controller[_0xce09('0x20')]);router[_0xce09('0x13')](_0xce09('0x21'),auth[_0xce09('0x6')](),interaction[_0xce09('0x22')]('chat',_0xce09('0x23')),controller[_0xce09('0x24')]);router[_0xce09('0x25')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xce09('0x26'),_0xce09('0x27')),controller[_0xce09('0x28')]);router[_0xce09('0x25')](_0xce09('0x29'),controller[_0xce09('0x2a')]);router[_0xce09('0x25')](_0xce09('0x2b'),auth[_0xce09('0x9')](),controller[_0xce09('0x2c')]);router['put'](_0xce09('0x2d'),controller[_0xce09('0x2e')]);router[_0xce09('0x2f')](_0xce09('0x30'),auth[_0xce09('0x6')](),interaction[_0xce09('0x22')]('chat',_0xce09('0x31')),controller[_0xce09('0x32')]);router[_0xce09('0x2f')](_0xce09('0x21'),auth[_0xce09('0x6')](),controller[_0xce09('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index e983155..da11504 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 _0xdc2d=['INTEGER','sequelize','BOOLEAN'];(function(_0xdecc07,_0x54ee6d){var _0x2ad019=function(_0x49f7fa){while(--_0x49f7fa){_0xdecc07['push'](_0xdecc07['shift']());}};_0x2ad019(++_0x54ee6d);}(_0xdc2d,0xa9));var _0xddc2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc2d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xddc2('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xddc2('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xddc2('0x2')]}}; \ No newline at end of file +var _0xd787=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xd787,0x1a0));var _0x7d78=function(_0x46d4c1,_0x2d0dca){_0x46d4c1=_0x46d4c1-0x0;var _0xf2a962=_0xd787[_0x46d4c1];return _0xf2a962;};'use strict';var Sequelize=require(_0x7d78('0x0'));module['exports']={'body':{'type':Sequelize[_0x7d78('0x1')](_0x7d78('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7d78('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7d78('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 3f2d660..0a1bdad 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 _0xc16f=['create','body','params','describe','createdAt','lastMessageAt','format','lastMessage','getUsers','agent','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x42ed03,_0x18b558){var _0x1a0126=function(_0xe74416){while(--_0xe74416){_0x42ed03['push'](_0x42ed03['shift']());}};_0x1a0126(++_0x18b558);}(_0xc16f,0x1eb));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc16('0x0'));var rimraf=require(_0xfc16('0x1'));var zipdir=require(_0xfc16('0x2'));var jsonpatch=require(_0xfc16('0x3'));var rp=require(_0xfc16('0x4'));var moment=require(_0xfc16('0x5'));var BPromise=require(_0xfc16('0x6'));var Mustache=require(_0xfc16('0x7'));var util=require('util');var path=require(_0xfc16('0x8'));var sox=require(_0xfc16('0x9'));var csv=require(_0xfc16('0xa'));var ejs=require(_0xfc16('0xb'));var fs=require('fs');var fs_extra=require(_0xfc16('0xc'));var _=require('lodash');var squel=require(_0xfc16('0xd'));var crypto=require(_0xfc16('0xe'));var jsforce=require(_0xfc16('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc16('0xa'));var querystring=require('querystring');var Papa=require(_0xfc16('0x10'));var Redis=require(_0xfc16('0x11'));var authService=require(_0xfc16('0x12'));var qs=require(_0xfc16('0x13'));var as=require(_0xfc16('0x14'));var hardwareService=require(_0xfc16('0x15'));var logger=require(_0xfc16('0x16'))(_0xfc16('0x17'));var utils=require('../../config/utils');var config=require(_0xfc16('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfc16('0x19')]=_[_0xfc16('0x1a')](config[_0xfc16('0x19')],{'host':_0xfc16('0x1b'),'port':0x18eb});var socket=require(_0xfc16('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xfc16('0x1d')](socket);function respondWithStatusCode(_0x17be7d,_0x46fbdc){_0x46fbdc=_0x46fbdc||0xcc;return function(_0x4f8e75){if(_0x4f8e75){return _0x17be7d['sendStatus'](_0x46fbdc);}return _0x17be7d[_0xfc16('0x1e')](_0x46fbdc)[_0xfc16('0x1f')]();};}function respondWithResult(_0x58b894,_0x24eab5){_0x24eab5=_0x24eab5||0xc8;return function(_0x4b84d7){if(_0x4b84d7){return _0x58b894[_0xfc16('0x1e')](_0x24eab5)[_0xfc16('0x20')](_0x4b84d7);}};}function respondWithFilteredResult(_0x433804,_0x2f4ecf){return function(_0x48fa2e){if(_0x48fa2e){var _0x4bb7ff=typeof _0x2f4ecf[_0xfc16('0x21')]==='undefined'&&typeof _0x2f4ecf[_0xfc16('0x22')]===_0xfc16('0x23');var _0x5d5145=_0x48fa2e[_0xfc16('0x24')];var _0x3f78f3=_0x4bb7ff?0x0:_0x2f4ecf[_0xfc16('0x21')];var _0x1138fb=_0x4bb7ff?_0x48fa2e[_0xfc16('0x24')]:_0x2f4ecf[_0xfc16('0x21')]+_0x2f4ecf['limit'];var _0x3beaab;if(_0x1138fb>=_0x5d5145){_0x1138fb=_0x5d5145;_0x3beaab=0xc8;}else{_0x3beaab=0xce;}_0x433804['status'](_0x3beaab);return _0x433804[_0xfc16('0x25')](_0xfc16('0x26'),_0x3f78f3+'-'+_0x1138fb+'/'+_0x5d5145)[_0xfc16('0x20')](_0x48fa2e);}return null;};}function patchUpdates(_0x52e86f){return function(_0x5831cc){try{jsonpatch['apply'](_0x5831cc,_0x52e86f,!![]);}catch(_0x30df21){return BPromise[_0xfc16('0x27')](_0x30df21);}return _0x5831cc[_0xfc16('0x28')]();};}function saveUpdates(_0x53413c,_0x5b6102){return function(_0x5ad189){if(_0x5ad189){return _0x5ad189[_0xfc16('0x29')](_0x53413c)[_0xfc16('0x2a')](function(_0x5cd5af){return _0x5cd5af;});}return null;};}function removeEntity(_0x46f5c4,_0x4a7201){return function(_0x3777f7){if(_0x3777f7){return _0x3777f7[_0xfc16('0x2b')]()['then'](function(){_0x46f5c4[_0xfc16('0x1e')](0xcc)[_0xfc16('0x1f')]();});}};}function handleEntityNotFound(_0x5bc2a5,_0x4d302f){return function(_0x182686){if(!_0x182686){_0x5bc2a5[_0xfc16('0x2c')](0x194);}return _0x182686;};}function handleError(_0x31974c,_0x17d9d5){_0x17d9d5=_0x17d9d5||0x1f4;return function(_0xee267d){logger[_0xfc16('0x2d')](_0xee267d[_0xfc16('0x2e')]);if(_0xee267d['name']){delete _0xee267d[_0xfc16('0x2f')];}_0x31974c[_0xfc16('0x1e')](_0x17d9d5)[_0xfc16('0x30')](_0xee267d);};}exports[_0xfc16('0x31')]=function(_0x54ad95,_0xcd880d){var _0x5dde2d={},_0x468c71={},_0x5d879e={'count':0x0,'rows':[]};var _0xdbecab=_[_0xfc16('0x32')](db[_0xfc16('0x33')]['rawAttributes'],function(_0x51ffd9){return{'name':_0x51ffd9['fieldName'],'type':_0x51ffd9[_0xfc16('0x34')][_0xfc16('0x35')]};});_0x468c71['model']=_[_0xfc16('0x32')](_0xdbecab,_0xfc16('0x2f'));_0x468c71[_0xfc16('0x36')]=_[_0xfc16('0x37')](_0x54ad95[_0xfc16('0x36')]);_0x468c71['filters']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],_0x468c71['query']);_0x5dde2d['attributes']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],qs[_0xfc16('0x3a')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3a')]));_0x5dde2d[_0xfc16('0x3b')]=_0x5dde2d['attributes'][_0xfc16('0x3c')]?_0x5dde2d[_0xfc16('0x3b')]:_0x468c71[_0xfc16('0x39')];if(!_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3d')](_0xfc16('0x3e'))){_0x5dde2d[_0xfc16('0x22')]=qs[_0xfc16('0x22')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x22')]);_0x5dde2d['offset']=qs[_0xfc16('0x21')](_0x54ad95['query']['offset']);}_0x5dde2d[_0xfc16('0x3f')]=qs[_0xfc16('0x40')](_0x54ad95['query'][_0xfc16('0x40')]);_0x5dde2d[_0xfc16('0x41')]=qs['filters'](_[_0xfc16('0x42')](_0x54ad95[_0xfc16('0x36')],_0x468c71[_0xfc16('0x43')]),_0xdbecab);if(_0x54ad95[_0xfc16('0x36')]['filter']){_0x5dde2d[_0xfc16('0x41')]=_[_0xfc16('0x44')](_0x5dde2d[_0xfc16('0x41')],{'$or':_[_0xfc16('0x32')](_0xdbecab,function(_0x2437d9){if(_0x2437d9['type']!==_0xfc16('0x45')){var _0x5af1a5={};_0x5af1a5[_0x2437d9[_0xfc16('0x2f')]]={'$like':'%'+_0x54ad95[_0xfc16('0x36')][_0xfc16('0x46')]+'%'};return _0x5af1a5;}})});}_0x5dde2d=_['merge']({},_0x5dde2d,_0x54ad95[_0xfc16('0x47')]);var _0x245b48={'where':_0x5dde2d['where']};return db[_0xfc16('0x33')][_0xfc16('0x24')](_0x245b48)[_0xfc16('0x2a')](function(_0x55614f){_0x5d879e['count']=_0x55614f;if(_0x54ad95[_0xfc16('0x36')][_0xfc16('0x48')]){_0x5dde2d[_0xfc16('0x49')]=[{'all':!![]}];}return db[_0xfc16('0x33')][_0xfc16('0x4a')](_0x5dde2d);})['then'](function(_0x5e3baf){_0x5d879e[_0xfc16('0x4b')]=_0x5e3baf;return _0x5d879e;})['then'](respondWithFilteredResult(_0xcd880d,_0x5dde2d))[_0xfc16('0x4c')](handleError(_0xcd880d,null));};exports[_0xfc16('0x4d')]=function(_0x34ae54,_0x2efca5){var _0xf1b7e3={'raw':!![],'where':{'id':_0x34ae54['params']['id']}},_0x43e09f={};_0x43e09f[_0xfc16('0x39')]=_[_0xfc16('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x43e09f['query']=_[_0xfc16('0x37')](_0x34ae54[_0xfc16('0x36')]);_0x43e09f[_0xfc16('0x43')]=_[_0xfc16('0x38')](_0x43e09f['model'],_0x43e09f['query']);_0xf1b7e3['attributes']=_[_0xfc16('0x38')](_0x43e09f[_0xfc16('0x39')],qs['fields'](_0x34ae54[_0xfc16('0x36')][_0xfc16('0x3a')]));_0xf1b7e3[_0xfc16('0x3b')]=_0xf1b7e3[_0xfc16('0x3b')][_0xfc16('0x3c')]?_0xf1b7e3[_0xfc16('0x3b')]:_0x43e09f[_0xfc16('0x39')];if(_0x34ae54[_0xfc16('0x36')][_0xfc16('0x48')]){_0xf1b7e3[_0xfc16('0x49')]=[{'all':!![]}];}_0xf1b7e3=_[_0xfc16('0x44')]({},_0xf1b7e3,_0x34ae54['options']);return db[_0xfc16('0x33')][_0xfc16('0x4e')](_0xf1b7e3)[_0xfc16('0x2a')](handleEntityNotFound(_0x2efca5,null))[_0xfc16('0x2a')](respondWithResult(_0x2efca5,null))[_0xfc16('0x4c')](handleError(_0x2efca5,null));};exports[_0xfc16('0x4f')]=function(_0x134b81,_0x3f75df){return db['ChatInternalMessage'][_0xfc16('0x4f')](_0x134b81[_0xfc16('0x50')],{})['then'](respondWithResult(_0x3f75df,0xc9))[_0xfc16('0x4c')](handleError(_0x3f75df,null));};exports['update']=function(_0x3bf86e,_0x2fc137){if(_0x3bf86e[_0xfc16('0x50')]['id']){delete _0x3bf86e[_0xfc16('0x50')]['id'];}return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x3bf86e[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x2fc137,null))[_0xfc16('0x2a')](saveUpdates(_0x3bf86e[_0xfc16('0x50')],null))[_0xfc16('0x2a')](respondWithResult(_0x2fc137,null))[_0xfc16('0x4c')](handleError(_0x2fc137,null));};exports[_0xfc16('0x2b')]=function(_0x417565,_0x4c6624){return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x417565[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x4c6624,null))[_0xfc16('0x2a')](removeEntity(_0x4c6624,null))[_0xfc16('0x4c')](handleError(_0x4c6624,null));};exports[_0xfc16('0x52')]=function(_0x57c963,_0x4939fe){return db['ChatInternalMessage'][_0xfc16('0x52')]()[_0xfc16('0x2a')](respondWithResult(_0x4939fe,null))[_0xfc16('0x4c')](handleError(_0x4939fe,null));};function wrapUser(_0xabeaf2){return function(_0x6542d5){var _0x3f11f3=_0xabeaf2['get']({'plain':!![]});_0x3f11f3['messages']=[];if(_0x6542d5){_0x3f11f3['lastMessageAt']=_0x6542d5[_0xfc16('0x53')];_0x3f11f3['lastMessage']=_0x6542d5;}else{_0x3f11f3[_0xfc16('0x54')]=moment(0x0)[_0xfc16('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f11f3[_0xfc16('0x56')]={};}return _0x3f11f3;};}exports[_0xfc16('0x57')]=function(_0x2c413a,_0xdbc166,_0x2d47b5){var _0x4b33ab=[];return db['User'][_0xfc16('0x4a')]({'where':{'role':[_0xfc16('0x58'),'admin',_0xfc16('0x59')]},'attributes':['id',_0xfc16('0x5a'),'name',_0xfc16('0x5b'),_0xfc16('0x5c'),_0xfc16('0x5d'),_0xfc16('0x5e'),'lastLoginAt',_0xfc16('0x5f'),_0xfc16('0x60')],'order':qs[_0xfc16('0x40')](_0xfc16('0x61')),'include':[{'model':db[_0xfc16('0x62')],'as':_0xfc16('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xfc16('0x2a')](function(_0x4f9385){if(_0x4f9385){var _0x4afa3d=_0x2c413a[_0xfc16('0x59')][_0xfc16('0x64')]({'plain':!![]});if(!_0x4afa3d)throw new Error(_0xfc16('0x65'));if(_0x4afa3d['role']===_0xfc16('0x59')){return db[_0xfc16('0x66')][_0xfc16('0x4e')]({'where':{'name':_0xfc16('0x67'),'userProfileId':_0x4afa3d['userProfileId']},'raw':!![]})[_0xfc16('0x2a')](function(_0x34ed86){if(_0x34ed86){if(_0x34ed86[_0xfc16('0x68')]===0x0){return db[_0xfc16('0x69')][_0xfc16('0x4a')]({'where':{'sectionId':_0x34ed86['id']},'raw':!![]})[_0xfc16('0x2a')](function(_0x2c7b44){var _0x6d8471=[];if(_[_0xfc16('0x6a')](_0x2c7b44)){_0x6d8471=_['filter'](_0x4f9385,function(_0x3e40ea){if(_0x3e40ea[_0xfc16('0x5b')]!==_0xfc16('0x58')){return _0x3e40ea;}});return _0x6d8471;}else{for(var _0x1226b6=0x0;_0x1226b6<_0x4f9385['length'];_0x1226b6++){var _0x6dfe5f=_0x4f9385[_0x1226b6];if(_0x6dfe5f['role']===_0xfc16('0x58')){var _0x2344ca=_['find'](_0x2c7b44,function(_0xf4b20d){return _0xf4b20d[_0xfc16('0x6b')]===_0x6dfe5f['id'];});if(_0x2344ca)_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}else{_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}}return _0x6d8471;}});}else{return _0x4f9385;}}else{var _0x1efdca=_[_0xfc16('0x46')](_0x4f9385,function(_0x31b61b){if(_0x31b61b[_0xfc16('0x5b')]!=='agent'){return _0x31b61b;}});return _0x1efdca;}});}else{return _0x4f9385;}}})[_0xfc16('0x2a')](function(_0x402c50){var _0x383738=[];if(_0x402c50){_0x4b33ab=_0x402c50;for(var _0x312194=0x0;_0x312194<_0x402c50[_0xfc16('0x3c')];_0x312194+=0x1){_0x4b33ab[_0x312194][_0xfc16('0x6d')]=[];_0x383738[_0xfc16('0x6c')](db[_0xfc16('0x33')][_0xfc16('0x4e')]({'where':{'FromId':[_0x2c413a['user']['id'],_0x402c50[_0x312194]['id']],'ToId':[_0x2c413a[_0xfc16('0x59')]['id'],_0x402c50[_0x312194]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xfc16('0x6e'),_0xfc16('0x6f'),_0xfc16('0x50')],'order':qs[_0xfc16('0x40')](_0xfc16('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfc16('0x2a')](wrapUser(_0x402c50[_0x312194])));}return BPromise[_0xfc16('0x71')](_0x383738);}return[];})['then'](function(_0x443371){return{'rows':_0x443371,'count':_0x443371[_0xfc16('0x3c')]};})['then'](respondWithResult(_0xdbc166,null))[_0xfc16('0x4c')](handleError(_0xdbc166,null));}; \ No newline at end of file +var _0x5a4d=['isEmpty','agent','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','options','rows','catch','show','params','includeAll','include','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource'];(function(_0xd27ded,_0x1164e2){var _0x5ef850=function(_0x582e7d){while(--_0x582e7d){_0xd27ded['push'](_0xd27ded['shift']());}};_0x5ef850(++_0x1164e2);}(_0x5a4d,0x15e));var _0xd5a4=function(_0x35b6ab,_0x3992e8){_0x35b6ab=_0x35b6ab-0x0;var _0x3a7697=_0x5a4d[_0x35b6ab];return _0x3a7697;};'use strict';var emlformat=require(_0xd5a4('0x0'));var rimraf=require(_0xd5a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5a4('0x2'));var rp=require('request-promise');var moment=require(_0xd5a4('0x3'));var BPromise=require(_0xd5a4('0x4'));var Mustache=require(_0xd5a4('0x5'));var util=require(_0xd5a4('0x6'));var path=require('path');var sox=require(_0xd5a4('0x7'));var csv=require('to-csv');var ejs=require(_0xd5a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5a4('0x9'));var squel=require(_0xd5a4('0xa'));var crypto=require(_0xd5a4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd5a4('0xc'));var toCsv=require(_0xd5a4('0xd'));var querystring=require(_0xd5a4('0xe'));var Papa=require(_0xd5a4('0xf'));var Redis=require('ioredis');var authService=require(_0xd5a4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd5a4('0x11'));var hardwareService=require(_0xd5a4('0x12'));var logger=require(_0xd5a4('0x13'))('api');var utils=require(_0xd5a4('0x14'));var config=require(_0xd5a4('0x15'));var licenseUtil=require(_0xd5a4('0x16'));var db=require(_0xd5a4('0x17'))['db'];config[_0xd5a4('0x18')]=_['defaults'](config[_0xd5a4('0x18')],{'host':_0xd5a4('0x19'),'port':0x18eb});var socket=require(_0xd5a4('0x1a'))(new Redis(config[_0xd5a4('0x18')]));require('./chatInternalMessage.socket')[_0xd5a4('0x1b')](socket);function respondWithStatusCode(_0x106304,_0x511641){_0x511641=_0x511641||0xcc;return function(_0x13ea20){if(_0x13ea20){return _0x106304[_0xd5a4('0x1c')](_0x511641);}return _0x106304[_0xd5a4('0x1d')](_0x511641)[_0xd5a4('0x1e')]();};}function respondWithResult(_0x57b254,_0xb1eafc){_0xb1eafc=_0xb1eafc||0xc8;return function(_0x500846){if(_0x500846){return _0x57b254['status'](_0xb1eafc)[_0xd5a4('0x1f')](_0x500846);}};}function respondWithFilteredResult(_0x102c59,_0x283d70){return function(_0xf188c9){if(_0xf188c9){var _0xfae717=typeof _0x283d70[_0xd5a4('0x20')]===_0xd5a4('0x21')&&typeof _0x283d70[_0xd5a4('0x22')]==='undefined';var _0x4a8395=_0xf188c9[_0xd5a4('0x23')];var _0x5f4517=_0xfae717?0x0:_0x283d70[_0xd5a4('0x20')];var _0x3e35cd=_0xfae717?_0xf188c9['count']:_0x283d70[_0xd5a4('0x20')]+_0x283d70[_0xd5a4('0x22')];var _0x3ca2fb;if(_0x3e35cd>=_0x4a8395){_0x3e35cd=_0x4a8395;_0x3ca2fb=0xc8;}else{_0x3ca2fb=0xce;}_0x102c59[_0xd5a4('0x1d')](_0x3ca2fb);return _0x102c59[_0xd5a4('0x24')](_0xd5a4('0x25'),_0x5f4517+'-'+_0x3e35cd+'/'+_0x4a8395)['json'](_0xf188c9);}return null;};}function patchUpdates(_0x15c5c2){return function(_0x287fd8){try{jsonpatch[_0xd5a4('0x26')](_0x287fd8,_0x15c5c2,!![]);}catch(_0x132893){return BPromise[_0xd5a4('0x27')](_0x132893);}return _0x287fd8[_0xd5a4('0x28')]();};}function saveUpdates(_0x3d337b,_0x5a042c){return function(_0x4fe350){if(_0x4fe350){return _0x4fe350[_0xd5a4('0x29')](_0x3d337b)[_0xd5a4('0x2a')](function(_0x3861f4){return _0x3861f4;});}return null;};}function removeEntity(_0x57bc22,_0x5ab317){return function(_0x3498ca){if(_0x3498ca){return _0x3498ca['destroy']()[_0xd5a4('0x2a')](function(){_0x57bc22[_0xd5a4('0x1d')](0xcc)[_0xd5a4('0x1e')]();});}};}function handleEntityNotFound(_0x34a756,_0x5fa1b0){return function(_0x46bcd9){if(!_0x46bcd9){_0x34a756[_0xd5a4('0x1c')](0x194);}return _0x46bcd9;};}function handleError(_0x5bee7a,_0x379086){_0x379086=_0x379086||0x1f4;return function(_0x3b4586){logger[_0xd5a4('0x2b')](_0x3b4586[_0xd5a4('0x2c')]);if(_0x3b4586[_0xd5a4('0x2d')]){delete _0x3b4586[_0xd5a4('0x2d')];}_0x5bee7a[_0xd5a4('0x1d')](_0x379086)[_0xd5a4('0x2e')](_0x3b4586);};}exports['index']=function(_0x115c46,_0x573873){var _0x3d46dc={},_0x47c75f={},_0x2a4f59={'count':0x0,'rows':[]};var _0x329bf8=_['map'](db[_0xd5a4('0x2f')][_0xd5a4('0x30')],function(_0x581df2){return{'name':_0x581df2[_0xd5a4('0x31')],'type':_0x581df2['type'][_0xd5a4('0x32')]};});_0x47c75f[_0xd5a4('0x33')]=_['map'](_0x329bf8,_0xd5a4('0x2d'));_0x47c75f[_0xd5a4('0x34')]=_[_0xd5a4('0x35')](_0x115c46[_0xd5a4('0x34')]);_0x47c75f['filters']=_[_0xd5a4('0x36')](_0x47c75f['model'],_0x47c75f[_0xd5a4('0x34')]);_0x3d46dc[_0xd5a4('0x37')]=_[_0xd5a4('0x36')](_0x47c75f[_0xd5a4('0x33')],qs['fields'](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x38')]));_0x3d46dc[_0xd5a4('0x37')]=_0x3d46dc[_0xd5a4('0x37')][_0xd5a4('0x39')]?_0x3d46dc[_0xd5a4('0x37')]:_0x47c75f['model'];if(!_0x115c46[_0xd5a4('0x34')]['hasOwnProperty'](_0xd5a4('0x3a'))){_0x3d46dc['limit']=qs[_0xd5a4('0x22')](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x22')]);_0x3d46dc[_0xd5a4('0x20')]=qs[_0xd5a4('0x20')](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x20')]);}_0x3d46dc[_0xd5a4('0x3b')]=qs[_0xd5a4('0x3c')](_0x115c46[_0xd5a4('0x34')]['sort']);_0x3d46dc[_0xd5a4('0x3d')]=qs[_0xd5a4('0x3e')](_[_0xd5a4('0x3f')](_0x115c46[_0xd5a4('0x34')],_0x47c75f['filters']),_0x329bf8);if(_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x40')]){_0x3d46dc[_0xd5a4('0x3d')]=_[_0xd5a4('0x41')](_0x3d46dc['where'],{'$or':_[_0xd5a4('0x42')](_0x329bf8,function(_0x23000d){if(_0x23000d['type']!=='VIRTUAL'){var _0x23a7b8={};_0x23a7b8[_0x23000d['name']]={'$like':'%'+_0x115c46[_0xd5a4('0x34')]['filter']+'%'};return _0x23a7b8;}})});}_0x3d46dc=_['merge']({},_0x3d46dc,_0x115c46[_0xd5a4('0x43')]);var _0xa435ef={'where':_0x3d46dc[_0xd5a4('0x3d')]};return db[_0xd5a4('0x2f')][_0xd5a4('0x23')](_0xa435ef)['then'](function(_0x1a8333){_0x2a4f59[_0xd5a4('0x23')]=_0x1a8333;if(_0x115c46[_0xd5a4('0x34')]['includeAll']){_0x3d46dc['include']=[{'all':!![]}];}return db[_0xd5a4('0x2f')]['findAll'](_0x3d46dc);})['then'](function(_0x5e24d7){_0x2a4f59[_0xd5a4('0x44')]=_0x5e24d7;return _0x2a4f59;})[_0xd5a4('0x2a')](respondWithFilteredResult(_0x573873,_0x3d46dc))[_0xd5a4('0x45')](handleError(_0x573873,null));};exports[_0xd5a4('0x46')]=function(_0x4b61c0,_0x318777){var _0x55075b={'raw':!![],'where':{'id':_0x4b61c0[_0xd5a4('0x47')]['id']}},_0x3ff601={};_0x3ff601[_0xd5a4('0x33')]=_[_0xd5a4('0x35')](db[_0xd5a4('0x2f')][_0xd5a4('0x30')]);_0x3ff601['query']=_[_0xd5a4('0x35')](_0x4b61c0['query']);_0x3ff601[_0xd5a4('0x3e')]=_[_0xd5a4('0x36')](_0x3ff601['model'],_0x3ff601[_0xd5a4('0x34')]);_0x55075b[_0xd5a4('0x37')]=_['intersection'](_0x3ff601[_0xd5a4('0x33')],qs[_0xd5a4('0x38')](_0x4b61c0['query']['fields']));_0x55075b[_0xd5a4('0x37')]=_0x55075b[_0xd5a4('0x37')][_0xd5a4('0x39')]?_0x55075b[_0xd5a4('0x37')]:_0x3ff601['model'];if(_0x4b61c0[_0xd5a4('0x34')][_0xd5a4('0x48')]){_0x55075b[_0xd5a4('0x49')]=[{'all':!![]}];}_0x55075b=_['merge']({},_0x55075b,_0x4b61c0[_0xd5a4('0x43')]);return db[_0xd5a4('0x2f')][_0xd5a4('0x4a')](_0x55075b)['then'](handleEntityNotFound(_0x318777,null))['then'](respondWithResult(_0x318777,null))['catch'](handleError(_0x318777,null));};exports[_0xd5a4('0x4b')]=function(_0x1c6832,_0x2c2a2f){return db[_0xd5a4('0x2f')][_0xd5a4('0x4b')](_0x1c6832[_0xd5a4('0x4c')],{})[_0xd5a4('0x2a')](respondWithResult(_0x2c2a2f,0xc9))['catch'](handleError(_0x2c2a2f,null));};exports[_0xd5a4('0x29')]=function(_0x1bdc02,_0x282b61){if(_0x1bdc02[_0xd5a4('0x4c')]['id']){delete _0x1bdc02[_0xd5a4('0x4c')]['id'];}return db[_0xd5a4('0x2f')]['find']({'where':{'id':_0x1bdc02['params']['id']}})[_0xd5a4('0x2a')](handleEntityNotFound(_0x282b61,null))['then'](saveUpdates(_0x1bdc02[_0xd5a4('0x4c')],null))[_0xd5a4('0x2a')](respondWithResult(_0x282b61,null))[_0xd5a4('0x45')](handleError(_0x282b61,null));};exports[_0xd5a4('0x4d')]=function(_0x1f762e,_0x2e0b1f){return db['ChatInternalMessage'][_0xd5a4('0x4a')]({'where':{'id':_0x1f762e['params']['id']}})[_0xd5a4('0x2a')](handleEntityNotFound(_0x2e0b1f,null))[_0xd5a4('0x2a')](removeEntity(_0x2e0b1f,null))[_0xd5a4('0x45')](handleError(_0x2e0b1f,null));};exports[_0xd5a4('0x4e')]=function(_0x30bd63,_0x339fe6){return db['ChatInternalMessage'][_0xd5a4('0x4e')]()[_0xd5a4('0x2a')](respondWithResult(_0x339fe6,null))[_0xd5a4('0x45')](handleError(_0x339fe6,null));};function wrapUser(_0x1adf89){return function(_0x418060){var _0x408099=_0x1adf89[_0xd5a4('0x4f')]({'plain':!![]});_0x408099[_0xd5a4('0x50')]=[];if(_0x418060){_0x408099[_0xd5a4('0x51')]=_0x418060[_0xd5a4('0x52')];_0x408099[_0xd5a4('0x53')]=_0x418060;}else{_0x408099['lastMessageAt']=moment(0x0)[_0xd5a4('0x54')](_0xd5a4('0x55'));_0x408099[_0xd5a4('0x53')]={};}return _0x408099;};}exports[_0xd5a4('0x56')]=function(_0x25c931,_0x433a18,_0x53edf2){var _0x14b1fc=[];return db[_0xd5a4('0x57')][_0xd5a4('0x58')]({'where':{'role':['agent',_0xd5a4('0x59'),_0xd5a4('0x5a')]},'attributes':['id',_0xd5a4('0x5b'),'name',_0xd5a4('0x5c'),_0xd5a4('0x5d'),_0xd5a4('0x5e'),'online',_0xd5a4('0x5f'),_0xd5a4('0x60'),_0xd5a4('0x61')],'order':qs[_0xd5a4('0x3c')]('-online'),'include':[{'model':db[_0xd5a4('0x62')],'as':_0xd5a4('0x63'),'attributes':['id',_0xd5a4('0x2d'),_0xd5a4('0x64')],'through':{'attributes':[]}}]})[_0xd5a4('0x2a')](function(_0x40a2b5){if(_0x40a2b5){var _0x15e3a9=_0x25c931['user'][_0xd5a4('0x4f')]({'plain':!![]});if(!_0x15e3a9)throw new Error(_0xd5a4('0x65'));if(_0x15e3a9[_0xd5a4('0x5c')]===_0xd5a4('0x5a')){return db[_0xd5a4('0x66')][_0xd5a4('0x4a')]({'where':{'name':_0xd5a4('0x67'),'userProfileId':_0x15e3a9[_0xd5a4('0x68')]},'raw':!![]})[_0xd5a4('0x2a')](function(_0x4ec04e){if(_0x4ec04e){if(_0x4ec04e['autoAssociation']===0x0){return db[_0xd5a4('0x69')]['findAll']({'where':{'sectionId':_0x4ec04e['id']},'raw':!![]})[_0xd5a4('0x2a')](function(_0xae3ca7){var _0x2e2bbd=[];if(_[_0xd5a4('0x6a')](_0xae3ca7)){_0x2e2bbd=_['filter'](_0x40a2b5,function(_0x2d09b1){if(_0x2d09b1[_0xd5a4('0x5c')]!==_0xd5a4('0x6b')){return _0x2d09b1;}});return _0x2e2bbd;}else{for(var _0x59ae7e=0x0;_0x59ae7e<_0x40a2b5[_0xd5a4('0x39')];_0x59ae7e++){var _0x37f566=_0x40a2b5[_0x59ae7e];if(_0x37f566[_0xd5a4('0x5c')]===_0xd5a4('0x6b')){var _0x30c563=_[_0xd5a4('0x4a')](_0xae3ca7,function(_0x474efa){return _0x474efa[_0xd5a4('0x6c')]===_0x37f566['id'];});if(_0x30c563)_0x2e2bbd[_0xd5a4('0x6d')](_0x37f566);}else{_0x2e2bbd[_0xd5a4('0x6d')](_0x37f566);}}return _0x2e2bbd;}});}else{return _0x40a2b5;}}else{var _0x159439=_['filter'](_0x40a2b5,function(_0x4a7046){if(_0x4a7046[_0xd5a4('0x5c')]!=='agent'){return _0x4a7046;}});return _0x159439;}});}else{return _0x40a2b5;}}})[_0xd5a4('0x2a')](function(_0x58c15a){var _0x2d83df=[];if(_0x58c15a){_0x14b1fc=_0x58c15a;for(var _0x359f17=0x0;_0x359f17<_0x58c15a[_0xd5a4('0x39')];_0x359f17+=0x1){_0x14b1fc[_0x359f17][_0xd5a4('0x50')]=[];_0x2d83df['push'](db[_0xd5a4('0x2f')][_0xd5a4('0x4a')]({'where':{'FromId':[_0x25c931['user']['id'],_0x58c15a[_0x359f17]['id']],'ToId':[_0x25c931['user']['id'],_0x58c15a[_0x359f17]['id']],'ChatGroupId':null},'attributes':['id',_0xd5a4('0x52'),_0xd5a4('0x6e'),'ToId',_0xd5a4('0x6f'),_0xd5a4('0x4c')],'order':qs[_0xd5a4('0x3c')](_0xd5a4('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd5a4('0x2a')](wrapUser(_0x58c15a[_0x359f17])));}return BPromise[_0xd5a4('0x71')](_0x2d83df);}return[];})['then'](function(_0x59f44b){return{'rows':_0x59f44b,'count':_0x59f44b[_0xd5a4('0x39')]};})[_0xd5a4('0x2a')](respondWithResult(_0x433a18,null))[_0xd5a4('0x45')](handleError(_0x433a18,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2c2766b..051cf94 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 _0x3804=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x7bd370,_0x4bb7fa){var _0xdfa30b=function(_0x17d6b4){while(--_0x17d6b4){_0x7bd370['push'](_0x7bd370['shift']());}};_0xdfa30b(++_0x4bb7fa);}(_0x3804,0xe0));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4380('0x0'));var ChatInternalMessage=require(_0x4380('0x1'))['db'][_0x4380('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4380('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4380('0x4'),'afterDestroy':_0x4380('0x5')};function emitEvent(_0x9e8495){return function(_0x321ec5,_0x137af3,_0x160b47){ChatInternalMessageEvents['emit'](_0x9e8495+':'+_0x321ec5['id'],_0x321ec5);ChatInternalMessageEvents[_0x4380('0x6')](_0x9e8495,_0x321ec5);_0x160b47(null);};}for(var e in events){if(events[_0x4380('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4380('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x56cc=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x56cc,0x161));var _0xc56c=function(_0x309d87,_0x5730d9){_0x309d87=_0x309d87-0x0;var _0x7729ab=_0x56cc[_0x309d87];return _0x7729ab;};'use strict';var EventEmitter=require(_0xc56c('0x0'));var ChatInternalMessage=require(_0xc56c('0x1'))['db'][_0xc56c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc56c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc56c('0x4'),'afterDestroy':_0xc56c('0x5')};function emitEvent(_0x193b22){return function(_0x1f2f75,_0x117034,_0x5d8188){ChatInternalMessageEvents['emit'](_0x193b22+':'+_0x1f2f75['id'],_0x1f2f75);ChatInternalMessageEvents[_0xc56c('0x6')](_0x193b22,_0x1f2f75);_0x5d8188(null);};}for(var e in events){if(events[_0xc56c('0x7')](e)){var event=events[e];ChatInternalMessage[_0xc56c('0x8')](e,emitEvent(event));}}module[_0xc56c('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 15d4e45..df763a3 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 _0x5752=['exports','chat_internal_messages','utf8mb4','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5752,0x1cf));var _0x2575=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5752[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x2575('0x0'));var util=require('util');var logger=require(_0x2575('0x1'))('api');var moment=require(_0x2575('0x2'));var BPromise=require(_0x2575('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2575('0x4'));var rimraf=require('rimraf');var config=require(_0x2575('0x5'));var attributes=require(_0x2575('0x6'));module[_0x2575('0x7')]=function(_0x4d5738,_0x5b1f39){return _0x4d5738['define']('ChatInternalMessage',attributes,{'tableName':_0x2575('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2575('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2600=['ChatInternalMessage','chat_internal_messages','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x2600,0x92));var _0x0260=function(_0x30be95,_0x4dcfad){_0x30be95=_0x30be95-0x0;var _0x354116=_0x2600[_0x30be95];return _0x354116;};'use strict';var _=require('lodash');var util=require(_0x0260('0x0'));var logger=require(_0x0260('0x1'))('api');var moment=require(_0x0260('0x2'));var BPromise=require(_0x0260('0x3'));var rp=require(_0x0260('0x4'));var fs=require('fs');var path=require(_0x0260('0x5'));var rimraf=require(_0x0260('0x6'));var config=require(_0x0260('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x0260('0x8')]=function(_0x3eaaf8,_0x36c654){return _0x3eaaf8[_0x0260('0x9')](_0x0260('0xa'),attributes,{'tableName':_0x0260('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0260('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index e8a5248..96fe4fd 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 _0xc61e=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x3584a6,_0x1ee812){var _0x2b6c76=function(_0x4c2c64){while(--_0x4c2c64){_0x3584a6['push'](_0x3584a6['shift']());}};_0x2b6c76(++_0x1ee812);}(_0xc61e,0x152));var _0xec61=function(_0x23ec60,_0x10b243){_0x23ec60=_0x23ec60-0x0;var _0x1ffa00=_0xc61e[_0x23ec60];return _0x1ffa00;};'use strict';var _=require(_0xec61('0x0'));var util=require(_0xec61('0x1'));var moment=require(_0xec61('0x2'));var BPromise=require(_0xec61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec61('0x4'));var db=require(_0xec61('0x5'))['db'];var utils=require(_0xec61('0x6'));var logger=require(_0xec61('0x7'))(_0xec61('0x8'));var config=require(_0xec61('0x9'));var jayson=require(_0xec61('0xa'));var client=jayson[_0xec61('0xb')][_0xec61('0xc')]({'port':0x232a});config[_0xec61('0xd')]=_[_0xec61('0xe')](config[_0xec61('0xd')],{'host':_0xec61('0xf'),'port':0x18eb});var socket=require(_0xec61('0x10'))(new Redis(config[_0xec61('0xd')]));require(_0xec61('0x11'))[_0xec61('0x12')](socket);function respondWithRpcPromise(_0x14ad4f,_0x1b0bd9,_0x4d60a9){return new BPromise(function(_0x3926fb,_0x40013f){return client[_0xec61('0x13')](_0x14ad4f,_0x4d60a9)[_0xec61('0x14')](function(_0x54ac6b){logger[_0xec61('0x15')](_0xec61('0x16'),_0x1b0bd9,_0xec61('0x17'));logger[_0xec61('0x18')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'),JSON[_0xec61('0x19')](_0x54ac6b));if(_0x54ac6b[_0xec61('0x1a')]){if(_0x54ac6b['error'][_0xec61('0x1b')]===0x1f4){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x40013f(_0x54ac6b['error']['message']);}logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x3926fb(_0x54ac6b[_0xec61('0x1a')][_0xec61('0x1c')]);}else{logger[_0xec61('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'));_0x3926fb(_0x54ac6b[_0xec61('0x1d')][_0xec61('0x1c')]);}})['catch'](function(_0x56ab00){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x56ab00);_0x40013f(_0x56ab00);});});} \ No newline at end of file +var _0xebef=['ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x20afc3,_0x2f189a){var _0x4cbb43=function(_0x647042){while(--_0x647042){_0x20afc3['push'](_0x20afc3['shift']());}};_0x4cbb43(++_0x2f189a);}(_0xebef,0xb2));var _0xfebe=function(_0x1115fc,_0x47b2ca){_0x1115fc=_0x1115fc-0x0;var _0x4d7b9f=_0xebef[_0x1115fc];return _0x4d7b9f;};'use strict';var _=require(_0xfebe('0x0'));var util=require(_0xfebe('0x1'));var moment=require(_0xfebe('0x2'));var BPromise=require(_0xfebe('0x3'));var rs=require(_0xfebe('0x4'));var fs=require('fs');var Redis=require(_0xfebe('0x5'));var db=require(_0xfebe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfebe('0x7'))(_0xfebe('0x8'));var config=require(_0xfebe('0x9'));var jayson=require(_0xfebe('0xa'));var client=jayson[_0xfebe('0xb')][_0xfebe('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfebe('0xd')],{'host':_0xfebe('0xe'),'port':0x18eb});var socket=require(_0xfebe('0xf'))(new Redis(config[_0xfebe('0xd')]));require(_0xfebe('0x10'))['register'](socket);function respondWithRpcPromise(_0x160c6a,_0x40e3bc,_0x19c1f8){return new BPromise(function(_0x5a69fb,_0x596c39){return client[_0xfebe('0x11')](_0x160c6a,_0x19c1f8)[_0xfebe('0x12')](function(_0x4773f0){logger[_0xfebe('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x40e3bc,'request\x20sent');logger[_0xfebe('0x14')](_0xfebe('0x15'),_0x40e3bc,_0xfebe('0x16'),JSON['stringify'](_0x4773f0));if(_0x4773f0['error']){if(_0x4773f0[_0xfebe('0x17')][_0xfebe('0x18')]===0x1f4){logger[_0xfebe('0x17')](_0xfebe('0x19'),_0x40e3bc,_0x4773f0['error'][_0xfebe('0x1a')]);return _0x596c39(_0x4773f0[_0xfebe('0x17')][_0xfebe('0x1a')]);}logger['error'](_0xfebe('0x19'),_0x40e3bc,_0x4773f0[_0xfebe('0x17')][_0xfebe('0x1a')]);return _0x5a69fb(_0x4773f0['error'][_0xfebe('0x1a')]);}else{logger[_0xfebe('0x13')](_0xfebe('0x19'),_0x40e3bc,_0xfebe('0x16'));_0x5a69fb(_0x4773f0[_0xfebe('0x1b')][_0xfebe('0x1a')]);}})[_0xfebe('0x1c')](function(_0x5ea3a1){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x40e3bc,_0x5ea3a1);_0x596c39(_0x5ea3a1);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index ef5fe0a..04592e9 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 _0x1607=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x28eb88,_0x659a98){var _0x5e00bd=function(_0x2a0b9f){while(--_0x2a0b9f){_0x28eb88['push'](_0x28eb88['shift']());}};_0x5e00bd(++_0x659a98);}(_0x1607,0x1d5));var _0x7160=function(_0x4d8a45,_0xf33997){_0x4d8a45=_0x4d8a45-0x0;var _0x9e1583=_0x1607[_0x4d8a45];return _0x9e1583;};'use strict';var ChatInternalMessageEvents=require(_0x7160('0x0'));var events=['save',_0x7160('0x1'),_0x7160('0x2')];function createListener(_0x4fbee3,_0xd33417){return function(_0x462417){_0xd33417[_0x7160('0x3')](_0x4fbee3,_0x462417);};}function removeListener(_0x33ef50,_0x566408){return function(){ChatInternalMessageEvents[_0x7160('0x4')](_0x33ef50,_0x566408);};}exports[_0x7160('0x5')]=function(_0x42ee4f){for(var _0x760fe4=0x0,_0x568726=events[_0x7160('0x6')];_0x760fe4<_0x568726;_0x760fe4++){var _0x4dfdfd=events[_0x760fe4];var _0xb57ef8=createListener(_0x7160('0x7')+_0x4dfdfd,_0x42ee4f);ChatInternalMessageEvents['on'](_0x4dfdfd,_0xb57ef8);}}; \ No newline at end of file +var _0x5ff2=['chatInternalMessage:','./chatInternalMessage.events','remove','emit','removeListener','register','length'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x5ff2,0x189));var _0x25ff=function(_0x3a2bc6,_0xb3d543){_0x3a2bc6=_0x3a2bc6-0x0;var _0x2781d8=_0x5ff2[_0x3a2bc6];return _0x2781d8;};'use strict';var ChatInternalMessageEvents=require(_0x25ff('0x0'));var events=['save',_0x25ff('0x1'),'update'];function createListener(_0x238f91,_0x427bcf){return function(_0x3c0055){_0x427bcf[_0x25ff('0x2')](_0x238f91,_0x3c0055);};}function removeListener(_0x3fb5be,_0x282435){return function(){ChatInternalMessageEvents[_0x25ff('0x3')](_0x3fb5be,_0x282435);};}exports[_0x25ff('0x4')]=function(_0x29ec4f){for(var _0x37b20b=0x0,_0x20318d=events[_0x25ff('0x5')];_0x37b20b<_0x20318d;_0x37b20b++){var _0x102ed2=events[_0x37b20b];var _0x1b6c7e=createListener(_0x25ff('0x6')+_0x102ed2,_0x29ec4f);ChatInternalMessageEvents['on'](_0x102ed2,_0x1b6c7e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 370fc7c..d3887a1 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 _0x4d85=['/describe','describe','/users','getUsers','/:id','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x534c0f,_0x60b439){var _0x159559=function(_0x19ee5b){while(--_0x19ee5b){_0x534c0f['push'](_0x534c0f['shift']());}};_0x159559(++_0x60b439);}(_0x4d85,0xb2));var _0x54d8=function(_0x2a5476,_0xd8ec70){_0x2a5476=_0x2a5476-0x0;var _0x279820=_0x4d85[_0x2a5476];return _0x279820;};'use strict';var multer=require(_0x54d8('0x0'));var util=require(_0x54d8('0x1'));var path=require(_0x54d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x54d8('0x3'));var router=express['Router']();var fs_extra=require(_0x54d8('0x4'));var auth=require(_0x54d8('0x5'));var interaction=require(_0x54d8('0x6'));var config=require('../../config/environment');var controller=require(_0x54d8('0x7'));router[_0x54d8('0x8')]('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0xa')]);router[_0x54d8('0x8')](_0x54d8('0xb'),auth[_0x54d8('0x9')](),controller[_0x54d8('0xc')]);router['get'](_0x54d8('0xd'),auth['isAuthenticated'](),controller[_0x54d8('0xe')]);router[_0x54d8('0x8')](_0x54d8('0xf'),auth[_0x54d8('0x9')](),controller['show']);router['post']('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0x10')]);router[_0x54d8('0x11')](_0x54d8('0xf'),controller['update']);router[_0x54d8('0x12')]('/:id',auth[_0x54d8('0x9')](),controller[_0x54d8('0x13')]);module[_0x54d8('0x14')]=router; \ No newline at end of file +var _0x491a=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','create','put','update'];(function(_0xed715a,_0x2eb934){var _0x55ce9b=function(_0x4d3d7a){while(--_0x4d3d7a){_0xed715a['push'](_0xed715a['shift']());}};_0x55ce9b(++_0x2eb934);}(_0x491a,0xdd));var _0xa491=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0x491a[_0x4da382];return _0x10073f;};'use strict';var multer=require(_0xa491('0x0'));var util=require(_0xa491('0x1'));var path=require(_0xa491('0x2'));var timeout=require(_0xa491('0x3'));var express=require(_0xa491('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa491('0x5'));var interaction=require(_0xa491('0x6'));var config=require(_0xa491('0x7'));var controller=require(_0xa491('0x8'));router[_0xa491('0x9')]('/',auth[_0xa491('0xa')](),controller['index']);router[_0xa491('0x9')](_0xa491('0xb'),auth[_0xa491('0xa')](),controller['describe']);router['get'](_0xa491('0xc'),auth[_0xa491('0xa')](),controller['getUsers']);router[_0xa491('0x9')](_0xa491('0xd'),auth[_0xa491('0xa')](),controller['show']);router['post']('/',auth[_0xa491('0xa')](),controller[_0xa491('0xe')]);router[_0xa491('0xf')](_0xa491('0xd'),controller[_0xa491('0x10')]);router['delete'](_0xa491('0xd'),auth[_0xa491('0xa')](),controller['destroy']);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 1108b5c..ab57ed3 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 _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1c2386,_0x22eb79){var _0x322990=function(_0x27eed4){while(--_0x27eed4){_0x1c2386['push'](_0x1c2386['shift']());}};_0x322990(++_0x22eb79);}(_0x97e6,0x159));var _0x697e=function(_0x196e16,_0x168729){_0x196e16=_0x196e16-0x0;var _0x37531f=_0x97e6[_0x196e16];return _0x37531f;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}}; \ No newline at end of file +var _0x0102=['exports','TEXT','medium','BOOLEAN','STRING'];(function(_0x4b8dec,_0x1744f2){var _0x1b11b6=function(_0x4dca89){while(--_0x4dca89){_0x4b8dec['push'](_0x4b8dec['shift']());}};_0x1b11b6(++_0x1744f2);}(_0x0102,0x186));var _0x2010=function(_0x144297,_0x29ca79){_0x144297=_0x144297-0x0;var _0x1e22bf=_0x0102[_0x144297];return _0x1e22bf;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'body':{'type':Sequelize[_0x2010('0x1')](_0x2010('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2010('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2010('0x4')]},'providerResponse':{'type':Sequelize[_0x2010('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 732a4d9..8aa2500 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 _0xf77e=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','debug','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','ChatMessage','include','params','fields','length','includeAll','merge','find','create','body','describe','chat-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','formData','../../config/logger','ChatInteraction','RejectMessage','rejectMessage','QueryTypes','contact','rejectmessage','eml-format','fast-json-patch','moment','bluebird'];(function(_0x2cc57f,_0x31ded7){var _0x3cfb7a=function(_0x11b6f3){while(--_0x11b6f3){_0x2cc57f['push'](_0x2cc57f['shift']());}};_0x3cfb7a(++_0x31ded7);}(_0xf77e,0x7e));var _0xef77=function(_0x1b67c3,_0x58acbc){_0x1b67c3=_0x1b67c3-0x0;var _0x23e14e=_0xf77e[_0x1b67c3];return _0x23e14e;};'use strict';var emlformat=require(_0xef77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef77('0x1'));var rp=require('request-promise');var moment=require(_0xef77('0x2'));var BPromise=require(_0xef77('0x3'));var Mustache=require(_0xef77('0x4'));var util=require(_0xef77('0x5'));var path=require(_0xef77('0x6'));var sox=require(_0xef77('0x7'));var csv=require(_0xef77('0x8'));var ejs=require(_0xef77('0x9'));var fs=require('fs');var fs_extra=require(_0xef77('0xa'));var _=require(_0xef77('0xb'));var squel=require(_0xef77('0xc'));var crypto=require('crypto');var jsforce=require(_0xef77('0xd'));var deskjs=require(_0xef77('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef77('0xf'));var Papa=require(_0xef77('0x10'));var Redis=require(_0xef77('0x11'));var authService=require(_0xef77('0x12'));var qs=require(_0xef77('0x13'));var as=require(_0xef77('0x14'));var hardwareService=require(_0xef77('0x15'));var logger=require('../../config/logger')(_0xef77('0x16'));var utils=require(_0xef77('0x17'));var config=require(_0xef77('0x18'));var licenseUtil=require(_0xef77('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xef77('0x1a')](config['redis'],{'host':_0xef77('0x1b'),'port':0x18eb});var socket=require(_0xef77('0x1c'))(new Redis(config[_0xef77('0x1d')]));require(_0xef77('0x1e'))[_0xef77('0x1f')](socket);var jayson=require(_0xef77('0x20'));var client=jayson['client'][_0xef77('0x21')]({'port':0x232c});var client9002=jayson[_0xef77('0x22')][_0xef77('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x20cb49,_0x51a55c,_0x2e2f8e,_0x43499f){return new BPromise(function(_0x5d9f20,_0x29653d){var _0xb9ae25=_0x43499f||client;return _0xb9ae25[_0xef77('0x23')](_0x20cb49,_0x2e2f8e)[_0xef77('0x24')](function(_0x3b1469){logger[_0xef77('0x25')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,'request\x20sent');logger[_0xef77('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51a55c,'request\x20sent',JSON[_0xef77('0x27')](_0x3b1469));if(_0x3b1469[_0xef77('0x28')]){if(_0x3b1469[_0xef77('0x28')][_0xef77('0x29')]===0x1f4){logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x29653d(_0x3b1469[_0xef77('0x28')][_0xef77('0x2a')]);}logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x5d9f20(_0x3b1469[_0xef77('0x28')]['message']);}else{logger[_0xef77('0x25')](_0xef77('0x2b'),_0x51a55c,'request\x20sent');_0x5d9f20(_0x3b1469['result'][_0xef77('0x2a')]);}})[_0xef77('0x2c')](function(_0x3da969){logger[_0xef77('0x28')](_0xef77('0x2b'),_0x51a55c,_0x3da969);_0x29653d(_0x3da969);});});}function respondWithStatusCode(_0x180491,_0x363b68){_0x363b68=_0x363b68||0xcc;return function(_0x95ef79){if(_0x95ef79){return _0x180491['sendStatus'](_0x363b68);}return _0x180491['status'](_0x363b68)[_0xef77('0x2d')]();};}function respondWithResult(_0x2cf87a,_0x3737ca){_0x3737ca=_0x3737ca||0xc8;return function(_0x2bd6c6){if(_0x2bd6c6){return _0x2cf87a['status'](_0x3737ca)['json'](_0x2bd6c6);}};}function respondWithFilteredResult(_0x30f8bb,_0x103de8){return function(_0x2120a6){if(_0x2120a6){var _0x5de358=typeof _0x103de8['offset']===_0xef77('0x2e')&&typeof _0x103de8[_0xef77('0x2f')]==='undefined';var _0x1bc8d1=_0x2120a6[_0xef77('0x30')];var _0x50daca=_0x5de358?0x0:_0x103de8[_0xef77('0x31')];var _0x5dceed=_0x5de358?_0x2120a6[_0xef77('0x30')]:_0x103de8[_0xef77('0x31')]+_0x103de8[_0xef77('0x2f')];var _0x2cd1ed;if(_0x5dceed>=_0x1bc8d1){_0x5dceed=_0x1bc8d1;_0x2cd1ed=0xc8;}else{_0x2cd1ed=0xce;}_0x30f8bb[_0xef77('0x32')](_0x2cd1ed);return _0x30f8bb[_0xef77('0x33')](_0xef77('0x34'),_0x50daca+'-'+_0x5dceed+'/'+_0x1bc8d1)[_0xef77('0x35')](_0x2120a6);}return null;};}function patchUpdates(_0x4cb289){return function(_0x7b7efe){try{jsonpatch[_0xef77('0x36')](_0x7b7efe,_0x4cb289,!![]);}catch(_0x3030eb){return BPromise['reject'](_0x3030eb);}return _0x7b7efe[_0xef77('0x37')]();};}function saveUpdates(_0x5da4ea,_0x4300ba){return function(_0x429ebf){if(_0x429ebf){return _0x429ebf[_0xef77('0x38')](_0x5da4ea)[_0xef77('0x24')](function(_0x3ed317){return _0x3ed317;});}return null;};}function removeEntity(_0x5a1bc1,_0x5e6346){return function(_0x433da9){if(_0x433da9){return _0x433da9[_0xef77('0x39')]()[_0xef77('0x24')](function(){_0x5a1bc1[_0xef77('0x32')](0xcc)[_0xef77('0x2d')]();});}};}function handleEntityNotFound(_0xde970d,_0x2a43a6){return function(_0x47ecfa){if(!_0x47ecfa){_0xde970d[_0xef77('0x3a')](0x194);}return _0x47ecfa;};}function handleError(_0x46ae5e,_0x330bbd){_0x330bbd=_0x330bbd||0x1f4;return function(_0x24551e){logger['error'](_0x24551e[_0xef77('0x3b')]);if(_0x24551e[_0xef77('0x3c')]){delete _0x24551e[_0xef77('0x3c')];}_0x46ae5e['status'](_0x330bbd)[_0xef77('0x3d')](_0x24551e);};}exports['index']=function(_0x561def,_0x35c4ef){var _0x442963={},_0x3b729c={},_0x3590d2={'count':0x0,'rows':[]};var _0x17fc45=_[_0xef77('0x3e')](db['ChatMessage'][_0xef77('0x3f')],function(_0x41491c){return{'name':_0x41491c[_0xef77('0x40')],'type':_0x41491c[_0xef77('0x41')][_0xef77('0x42')]};});_0x3b729c[_0xef77('0x43')]=_[_0xef77('0x3e')](_0x17fc45,_0xef77('0x3c'));_0x3b729c[_0xef77('0x44')]=_[_0xef77('0x45')](_0x561def[_0xef77('0x44')]);_0x3b729c[_0xef77('0x46')]=_[_0xef77('0x47')](_0x3b729c[_0xef77('0x43')],_0x3b729c[_0xef77('0x44')]);_0x442963[_0xef77('0x48')]=_[_0xef77('0x47')](_0x3b729c['model'],qs['fields'](_0x561def['query']['fields']));_0x442963[_0xef77('0x48')]=_0x442963[_0xef77('0x48')]['length']?_0x442963[_0xef77('0x48')]:_0x3b729c[_0xef77('0x43')];if(!_0x561def[_0xef77('0x44')][_0xef77('0x49')]('nolimit')){_0x442963[_0xef77('0x2f')]=qs['limit'](_0x561def[_0xef77('0x44')][_0xef77('0x2f')]);_0x442963[_0xef77('0x31')]=qs[_0xef77('0x31')](_0x561def['query'][_0xef77('0x31')]);}_0x442963[_0xef77('0x4a')]=qs[_0xef77('0x4b')](_0x561def['query'][_0xef77('0x4b')]);_0x442963['where']=qs[_0xef77('0x46')](_['pick'](_0x561def[_0xef77('0x44')],_0x3b729c[_0xef77('0x46')]),_0x17fc45);if(_0x561def[_0xef77('0x44')][_0xef77('0x4c')]){_0x442963['where']=_['merge'](_0x442963[_0xef77('0x4d')],{'$or':_['map'](_0x17fc45,function(_0x57c80e){if(_0x57c80e[_0xef77('0x41')]!==_0xef77('0x4e')){var _0x46e303={};_0x46e303[_0x57c80e[_0xef77('0x3c')]]={'$like':'%'+_0x561def[_0xef77('0x44')][_0xef77('0x4c')]+'%'};return _0x46e303;}})});}_0x442963=_['merge']({},_0x442963,_0x561def[_0xef77('0x4f')]);var _0x58f750={'where':_0x442963['where']};return db[_0xef77('0x50')][_0xef77('0x30')](_0x58f750)[_0xef77('0x24')](function(_0x56946e){_0x3590d2[_0xef77('0x30')]=_0x56946e;if(_0x561def[_0xef77('0x44')]['includeAll']){_0x442963[_0xef77('0x51')]=[{'all':!![]}];}return db[_0xef77('0x50')]['findAll'](_0x442963);})[_0xef77('0x24')](function(_0x5efdce){_0x3590d2['rows']=_0x5efdce;return _0x3590d2;})[_0xef77('0x24')](respondWithFilteredResult(_0x35c4ef,_0x442963))[_0xef77('0x2c')](handleError(_0x35c4ef,null));};exports['show']=function(_0x27ded0,_0x4d7d7b){var _0x21970c={'raw':!![],'where':{'id':_0x27ded0[_0xef77('0x52')]['id']}},_0x36ddf5={};_0x36ddf5[_0xef77('0x43')]=_['keys'](db['ChatMessage'][_0xef77('0x3f')]);_0x36ddf5[_0xef77('0x44')]=_['keys'](_0x27ded0['query']);_0x36ddf5[_0xef77('0x46')]=_[_0xef77('0x47')](_0x36ddf5['model'],_0x36ddf5[_0xef77('0x44')]);_0x21970c[_0xef77('0x48')]=_['intersection'](_0x36ddf5[_0xef77('0x43')],qs['fields'](_0x27ded0['query'][_0xef77('0x53')]));_0x21970c[_0xef77('0x48')]=_0x21970c[_0xef77('0x48')][_0xef77('0x54')]?_0x21970c[_0xef77('0x48')]:_0x36ddf5[_0xef77('0x43')];if(_0x27ded0[_0xef77('0x44')][_0xef77('0x55')]){_0x21970c[_0xef77('0x51')]=[{'all':!![]}];}_0x21970c=_[_0xef77('0x56')]({},_0x21970c,_0x27ded0[_0xef77('0x4f')]);return db['ChatMessage'][_0xef77('0x57')](_0x21970c)[_0xef77('0x24')](handleEntityNotFound(_0x4d7d7b,null))['then'](respondWithResult(_0x4d7d7b,null))[_0xef77('0x2c')](handleError(_0x4d7d7b,null));};exports[_0xef77('0x58')]=function(_0x1315a0,_0x36f21b){return db['ChatMessage'][_0xef77('0x58')](_0x1315a0[_0xef77('0x59')],{})['then'](respondWithResult(_0x36f21b,0xc9))[_0xef77('0x2c')](handleError(_0x36f21b,null));};exports[_0xef77('0x38')]=function(_0x3d125f,_0xc7ebff){if(_0x3d125f[_0xef77('0x59')]['id']){delete _0x3d125f['body']['id'];}return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x3d125f[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0xc7ebff,null))[_0xef77('0x24')](saveUpdates(_0x3d125f[_0xef77('0x59')],null))[_0xef77('0x24')](respondWithResult(_0xc7ebff,null))[_0xef77('0x2c')](handleError(_0xc7ebff,null));};exports[_0xef77('0x39')]=function(_0xb6ad45,_0x58e350){return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0xb6ad45[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0x58e350,null))['then'](removeEntity(_0x58e350,null))[_0xef77('0x2c')](handleError(_0x58e350,null));};exports[_0xef77('0x5a')]=function(_0xacd52,_0x43b35c){return db[_0xef77('0x50')]['describe']()[_0xef77('0x24')](respondWithResult(_0x43b35c,null))[_0xef77('0x2c')](handleError(_0x43b35c,null));};var interaction_log=require('../../config/logger')(_0xef77('0x5b'));exports['accept']=function(_0x592304,_0x30dd00,_0x41002d){var _0x2618a0={'agent':{},'channel':'chat'};if(_0x592304[_0xef77('0x59')]['id']){delete _0x592304[_0xef77('0x59')]['id'];}_0x592304[_0xef77('0x59')]['read']=!![];_0x592304['body'][_0xef77('0x5c')]=moment()[_0xef77('0x5d')](_0xef77('0x5e'));_0x592304[_0xef77('0x59')][_0xef77('0x5f')]=_0x592304[_0xef77('0x59')][_0xef77('0x5f')]||_0x592304['user']['id'];_0x2618a0[_0xef77('0x60')]['id']=_0x592304['body'][_0xef77('0x5f')];return db['ChatMessage'][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x52')]['id'],'UserId':null}})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](saveUpdates(_0x592304[_0xef77('0x59')],null))[_0xef77('0x24')](function(_0x1c83c5){if(_0x1c83c5){_0x2618a0['message']=_0x1c83c5[_0xef77('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xef77('0x57')]({'where':{'id':_0x1c83c5[_0xef77('0x62')]}});}return null;})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](function(_0x592709){if(_0x592709){return _0x592709[_0xef77('0x38')]({'UserId':_0x592304['body']['UserId'],'read1stAt':_[_0xef77('0x63')](_0x592709['read1stAt'])?moment()[_0xef77('0x5d')](_0xef77('0x5e')):undefined});}return null;})[_0xef77('0x24')](function(_0x46b544){if(_0x46b544){_0x2618a0[_0xef77('0x64')]=_0x46b544[_0xef77('0x61')]({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x592304[_0xef77('0x65')]['id'],_0x592304['user'][_0xef77('0x3c')],_0x592304[_0xef77('0x65')][_0xef77('0x66')],_0x2618a0['interaction']['id'],_0x592304[_0xef77('0x59')]?JSON['stringify'](_0x592304[_0xef77('0x59')]):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x68'),_0xef77('0x69'),_0x2618a0);}return null;})['then'](function(_0x31c22d){var _0x3ba986=_0xef77('0x6a')+_0x31c22d['message'][_0xef77('0x6b')];return db[_0xef77('0x6c')][_0xef77('0x44')](_0x3ba986,{'type':db[_0xef77('0x6d')]['QueryTypes'][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5a9a2d){return _0x5a9a2d;});})[_0xef77('0x24')](function(_0x4b574f){if(_0x4b574f){_0x2618a0[_0xef77('0x2a')]['contact']=_0x4b574f[0x0];if(!_0x592304['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0xef77('0x70'),_0xef77('0x71'),_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0x158c7e){if(!_0x158c7e)return null;_0x2618a0[_0xef77('0x2a')][_0xef77('0x60')]=_0x158c7e;return _0x2618a0;})[_0xef77('0x24')](function(_0x2c1ef7){if(_0x2c1ef7){if(_0x592304['body'][_0xef77('0x73')]){_0x2618a0[_0xef77('0x2a')][_0xef77('0x74')]=util['format']('SIP/%s',_0x592304[_0xef77('0x65')]['name']);_0x2618a0[_0xef77('0x2a')][_0xef77('0x75')]=_0x2618a0['channel'];_0x2618a0[_0xef77('0x2a')][_0xef77('0x76')]=_0x2618a0['channel'];_0x2618a0['message']['event']='accept';return respondWithRpcPromise(_0xef77('0x77'),'EventManager',{'event':_0xef77('0x78'),'message':_[_0xef77('0x56')](_0x2618a0['message'],JSON[_0xef77('0x79')](_0x2618a0[_0xef77('0x64')][_0xef77('0x7a')]))},client9002)[_0xef77('0x24')](function(){return _0x2618a0;});}return _0x2618a0;}return null;})[_0xef77('0x24')](respondWithResult(_0x30dd00,null))[_0xef77('0x2c')](handleError(_0x30dd00,null));};var interaction_log=require(_0xef77('0x7b'))(_0xef77('0x5b'));exports['reject']=function(_0x418595,_0x3389d3,_0x34ff37){var _0x26ce0b={'agent':{},'channel':'chat'};if(_0x418595[_0xef77('0x59')]['id']){delete _0x418595[_0xef77('0x59')]['id'];}_0x418595['body'][_0xef77('0x5f')]=_0x418595[_0xef77('0x59')]['UserId']||_0x418595['user']['id'];_0x26ce0b['agent']['id']=_0x418595[_0xef77('0x59')]['UserId'];return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x418595[_0xef77('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x22fe6e){if(_0x22fe6e){_0x26ce0b[_0xef77('0x2a')]=_0x22fe6e[_0xef77('0x61')]({'plain':!![]});return db[_0xef77('0x7c')][_0xef77('0x57')]({'where':{'id':_0x22fe6e[_0xef77('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x1a4a72){if(_0x1a4a72){_0x26ce0b[_0xef77('0x64')]=_0x1a4a72['get']({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x418595[_0xef77('0x65')]['id'],_0x418595[_0xef77('0x65')]['name'],_0x418595[_0xef77('0x65')]['role'],_0x26ce0b[_0xef77('0x64')]['id'],_0x418595['body']?JSON[_0xef77('0x27')](_0x418595['body']):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x7d'),_0xef77('0x7e'),_0x26ce0b);}return null;})[_0xef77('0x24')](function(_0x551486){var _0xaa7683='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x551486[_0xef77('0x2a')][_0xef77('0x6b')];return db['sequelize']['query'](_0xaa7683,{'type':db['Sequelize'][_0xef77('0x7f')][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5e36e2){return _0x5e36e2;});})[_0xef77('0x24')](function(_0x383c44){if(_0x383c44){_0x26ce0b[_0xef77('0x2a')][_0xef77('0x80')]=_0x383c44[0x0];if(!_0x418595['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x418595['body']['UserId'],'role':_0xef77('0x60')},'attributes':['id',_0xef77('0x3c'),_0xef77('0x70'),'email',_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0xc68613){if(!_0xc68613)return null;_0x26ce0b[_0xef77('0x2a')][_0xef77('0x60')]=_0xc68613;return _0x26ce0b;})['then'](function(_0x2a28c7){if(_0x2a28c7){_0x2a28c7[_0xef77('0x2a')][_0xef77('0x74')]=util[_0xef77('0x5d')]('SIP/%s',_0x418595['user'][_0xef77('0x3c')]);_0x2a28c7[_0xef77('0x2a')][_0xef77('0x75')]=_0x26ce0b['channel'];_0x2a28c7[_0xef77('0x2a')]['motionChannel']=_0x26ce0b[_0xef77('0x75')];_0x2a28c7[_0xef77('0x2a')]['event']='reject';respondWithRpcPromise(_0xef77('0x77'),_0xef77('0x77'),{'event':_0xef77('0x81'),'message':_[_0xef77('0x56')](_0x26ce0b[_0xef77('0x2a')],JSON[_0xef77('0x79')](_0x26ce0b[_0xef77('0x64')][_0xef77('0x7a')]))},client9002);return _0x26ce0b;}return null;})[_0xef77('0x24')](respondWithResult(_0x3389d3,null))[_0xef77('0x2c')](handleError(_0x3389d3,null));}; \ No newline at end of file +var _0xa0c5=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rawAttributes','include','create','body','update','find','params','describe','accept','chat','readAt','format','UserId','agent','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','formData','chat-interactions','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','event','EventManager','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x28b754,_0x5a1158){var _0x2e0534=function(_0x4685f0){while(--_0x4685f0){_0x28b754['push'](_0x28b754['shift']());}};_0x2e0534(++_0x5a1158);}(_0xa0c5,0x174));var _0x5a0c=function(_0x372a57,_0x9aa407){_0x372a57=_0x372a57-0x0;var _0x358f6d=_0xa0c5[_0x372a57];return _0x358f6d;};'use strict';var emlformat=require(_0x5a0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a0c('0x1'));var jsonpatch=require(_0x5a0c('0x2'));var rp=require(_0x5a0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a0c('0x4'));var util=require('util');var path=require(_0x5a0c('0x5'));var sox=require(_0x5a0c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a0c('0x7'));var _=require(_0x5a0c('0x8'));var squel=require(_0x5a0c('0x9'));var crypto=require(_0x5a0c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a0c('0xb'));var querystring=require(_0x5a0c('0xc'));var Papa=require(_0x5a0c('0xd'));var Redis=require(_0x5a0c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a0c('0xf'));var as=require(_0x5a0c('0x10'));var hardwareService=require(_0x5a0c('0x11'));var logger=require(_0x5a0c('0x12'))(_0x5a0c('0x13'));var utils=require(_0x5a0c('0x14'));var config=require(_0x5a0c('0x15'));var licenseUtil=require(_0x5a0c('0x16'));var db=require(_0x5a0c('0x17'))['db'];config[_0x5a0c('0x18')]=_[_0x5a0c('0x19')](config[_0x5a0c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a0c('0x1a'))(new Redis(config[_0x5a0c('0x18')]));require(_0x5a0c('0x1b'))[_0x5a0c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5a0c('0x1d')]({'port':0x232c});var client9002=jayson[_0x5a0c('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc76c65,_0x3a3c68,_0x4fd323,_0x32d4f1){return new BPromise(function(_0x3078fe,_0x1d885b){var _0x413a15=_0x32d4f1||client;return _0x413a15[_0x5a0c('0x1f')](_0xc76c65,_0x4fd323)[_0x5a0c('0x20')](function(_0x42d921){logger['info'](_0x5a0c('0x21'),_0x3a3c68,_0x5a0c('0x22'));logger[_0x5a0c('0x23')](_0x5a0c('0x24'),_0x3a3c68,_0x5a0c('0x22'),JSON['stringify'](_0x42d921));if(_0x42d921['error']){if(_0x42d921[_0x5a0c('0x25')]['code']===0x1f4){logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x42d921[_0x5a0c('0x25')][_0x5a0c('0x26')]);return _0x1d885b(_0x42d921['error'][_0x5a0c('0x26')]);}logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x42d921['error'][_0x5a0c('0x26')]);return _0x3078fe(_0x42d921[_0x5a0c('0x25')][_0x5a0c('0x26')]);}else{logger[_0x5a0c('0x27')](_0x5a0c('0x21'),_0x3a3c68,_0x5a0c('0x22'));_0x3078fe(_0x42d921['result']['message']);}})[_0x5a0c('0x28')](function(_0x50847e){logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x50847e);_0x1d885b(_0x50847e);});});}function respondWithStatusCode(_0x8c8028,_0x7aaa89){_0x7aaa89=_0x7aaa89||0xcc;return function(_0x356e1c){if(_0x356e1c){return _0x8c8028['sendStatus'](_0x7aaa89);}return _0x8c8028[_0x5a0c('0x29')](_0x7aaa89)[_0x5a0c('0x2a')]();};}function respondWithResult(_0x5c2124,_0x27ef11){_0x27ef11=_0x27ef11||0xc8;return function(_0x21e99b){if(_0x21e99b){return _0x5c2124[_0x5a0c('0x29')](_0x27ef11)[_0x5a0c('0x2b')](_0x21e99b);}};}function respondWithFilteredResult(_0x3b6119,_0x1841e7){return function(_0x3c206b){if(_0x3c206b){var _0x2ab511=typeof _0x1841e7[_0x5a0c('0x2c')]===_0x5a0c('0x2d')&&typeof _0x1841e7['limit']===_0x5a0c('0x2d');var _0x3da1f4=_0x3c206b[_0x5a0c('0x2e')];var _0x25271f=_0x2ab511?0x0:_0x1841e7[_0x5a0c('0x2c')];var _0x3a1575=_0x2ab511?_0x3c206b['count']:_0x1841e7['offset']+_0x1841e7[_0x5a0c('0x2f')];var _0x1ae1ec;if(_0x3a1575>=_0x3da1f4){_0x3a1575=_0x3da1f4;_0x1ae1ec=0xc8;}else{_0x1ae1ec=0xce;}_0x3b6119[_0x5a0c('0x29')](_0x1ae1ec);return _0x3b6119[_0x5a0c('0x30')]('Content-Range',_0x25271f+'-'+_0x3a1575+'/'+_0x3da1f4)[_0x5a0c('0x2b')](_0x3c206b);}return null;};}function patchUpdates(_0xc9e28b){return function(_0x332d8e){try{jsonpatch[_0x5a0c('0x31')](_0x332d8e,_0xc9e28b,!![]);}catch(_0xda4914){return BPromise[_0x5a0c('0x32')](_0xda4914);}return _0x332d8e[_0x5a0c('0x33')]();};}function saveUpdates(_0x599d46,_0x44d1b8){return function(_0xf8e124){if(_0xf8e124){return _0xf8e124['update'](_0x599d46)[_0x5a0c('0x20')](function(_0x261032){return _0x261032;});}return null;};}function removeEntity(_0x112d7f,_0x15b5e4){return function(_0x33e61c){if(_0x33e61c){return _0x33e61c[_0x5a0c('0x34')]()[_0x5a0c('0x20')](function(){_0x112d7f[_0x5a0c('0x29')](0xcc)[_0x5a0c('0x2a')]();});}};}function handleEntityNotFound(_0x467a80,_0x269ddd){return function(_0x288a7e){if(!_0x288a7e){_0x467a80['sendStatus'](0x194);}return _0x288a7e;};}function handleError(_0x45451c,_0x3107e2){_0x3107e2=_0x3107e2||0x1f4;return function(_0x31f741){logger[_0x5a0c('0x25')](_0x31f741['stack']);if(_0x31f741[_0x5a0c('0x35')]){delete _0x31f741[_0x5a0c('0x35')];}_0x45451c[_0x5a0c('0x29')](_0x3107e2)[_0x5a0c('0x36')](_0x31f741);};}exports[_0x5a0c('0x37')]=function(_0x9ac285,_0x4c0269){var _0x7d048d={},_0x21982a={},_0x234247={'count':0x0,'rows':[]};var _0x311356=_[_0x5a0c('0x38')](db[_0x5a0c('0x39')]['rawAttributes'],function(_0x3f4441){return{'name':_0x3f4441[_0x5a0c('0x3a')],'type':_0x3f4441[_0x5a0c('0x3b')]['key']};});_0x21982a[_0x5a0c('0x3c')]=_[_0x5a0c('0x38')](_0x311356,_0x5a0c('0x35'));_0x21982a[_0x5a0c('0x3d')]=_[_0x5a0c('0x3e')](_0x9ac285['query']);_0x21982a[_0x5a0c('0x3f')]=_[_0x5a0c('0x40')](_0x21982a[_0x5a0c('0x3c')],_0x21982a[_0x5a0c('0x3d')]);_0x7d048d[_0x5a0c('0x41')]=_['intersection'](_0x21982a['model'],qs[_0x5a0c('0x42')](_0x9ac285['query'][_0x5a0c('0x42')]));_0x7d048d[_0x5a0c('0x41')]=_0x7d048d[_0x5a0c('0x41')][_0x5a0c('0x43')]?_0x7d048d['attributes']:_0x21982a[_0x5a0c('0x3c')];if(!_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x44')](_0x5a0c('0x45'))){_0x7d048d['limit']=qs[_0x5a0c('0x2f')](_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x2f')]);_0x7d048d['offset']=qs[_0x5a0c('0x2c')](_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x2c')]);}_0x7d048d['order']=qs[_0x5a0c('0x46')](_0x9ac285[_0x5a0c('0x3d')]['sort']);_0x7d048d[_0x5a0c('0x47')]=qs[_0x5a0c('0x3f')](_['pick'](_0x9ac285['query'],_0x21982a[_0x5a0c('0x3f')]),_0x311356);if(_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x48')]){_0x7d048d[_0x5a0c('0x47')]=_[_0x5a0c('0x49')](_0x7d048d[_0x5a0c('0x47')],{'$or':_[_0x5a0c('0x38')](_0x311356,function(_0xe3cd14){if(_0xe3cd14[_0x5a0c('0x3b')]!==_0x5a0c('0x4a')){var _0x12700b={};_0x12700b[_0xe3cd14['name']]={'$like':'%'+_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x48')]+'%'};return _0x12700b;}})});}_0x7d048d=_['merge']({},_0x7d048d,_0x9ac285[_0x5a0c('0x4b')]);var _0x54bbba={'where':_0x7d048d[_0x5a0c('0x47')]};return db[_0x5a0c('0x39')][_0x5a0c('0x2e')](_0x54bbba)[_0x5a0c('0x20')](function(_0x38a66e){_0x234247[_0x5a0c('0x2e')]=_0x38a66e;if(_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x4c')]){_0x7d048d['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x7d048d);})['then'](function(_0x8b5f45){_0x234247['rows']=_0x8b5f45;return _0x234247;})['then'](respondWithFilteredResult(_0x4c0269,_0x7d048d))[_0x5a0c('0x28')](handleError(_0x4c0269,null));};exports['show']=function(_0x4dc94d,_0x5d81e2){var _0x109f98={'raw':!![],'where':{'id':_0x4dc94d['params']['id']}},_0x351d60={};_0x351d60['model']=_[_0x5a0c('0x3e')](db[_0x5a0c('0x39')][_0x5a0c('0x4d')]);_0x351d60[_0x5a0c('0x3d')]=_[_0x5a0c('0x3e')](_0x4dc94d[_0x5a0c('0x3d')]);_0x351d60[_0x5a0c('0x3f')]=_[_0x5a0c('0x40')](_0x351d60[_0x5a0c('0x3c')],_0x351d60['query']);_0x109f98[_0x5a0c('0x41')]=_[_0x5a0c('0x40')](_0x351d60[_0x5a0c('0x3c')],qs[_0x5a0c('0x42')](_0x4dc94d[_0x5a0c('0x3d')][_0x5a0c('0x42')]));_0x109f98['attributes']=_0x109f98[_0x5a0c('0x41')]['length']?_0x109f98[_0x5a0c('0x41')]:_0x351d60[_0x5a0c('0x3c')];if(_0x4dc94d[_0x5a0c('0x3d')][_0x5a0c('0x4c')]){_0x109f98[_0x5a0c('0x4e')]=[{'all':!![]}];}_0x109f98=_[_0x5a0c('0x49')]({},_0x109f98,_0x4dc94d[_0x5a0c('0x4b')]);return db[_0x5a0c('0x39')]['find'](_0x109f98)['then'](handleEntityNotFound(_0x5d81e2,null))[_0x5a0c('0x20')](respondWithResult(_0x5d81e2,null))[_0x5a0c('0x28')](handleError(_0x5d81e2,null));};exports['create']=function(_0x5af3cd,_0x3c0798){return db[_0x5a0c('0x39')][_0x5a0c('0x4f')](_0x5af3cd[_0x5a0c('0x50')],{})[_0x5a0c('0x20')](respondWithResult(_0x3c0798,0xc9))[_0x5a0c('0x28')](handleError(_0x3c0798,null));};exports[_0x5a0c('0x51')]=function(_0x3789ac,_0x54335d){if(_0x3789ac[_0x5a0c('0x50')]['id']){delete _0x3789ac['body']['id'];}return db[_0x5a0c('0x39')][_0x5a0c('0x52')]({'where':{'id':_0x3789ac[_0x5a0c('0x53')]['id']}})[_0x5a0c('0x20')](handleEntityNotFound(_0x54335d,null))[_0x5a0c('0x20')](saveUpdates(_0x3789ac[_0x5a0c('0x50')],null))[_0x5a0c('0x20')](respondWithResult(_0x54335d,null))['catch'](handleError(_0x54335d,null));};exports[_0x5a0c('0x34')]=function(_0x542517,_0x259ff){return db[_0x5a0c('0x39')][_0x5a0c('0x52')]({'where':{'id':_0x542517['params']['id']}})['then'](handleEntityNotFound(_0x259ff,null))['then'](removeEntity(_0x259ff,null))[_0x5a0c('0x28')](handleError(_0x259ff,null));};exports[_0x5a0c('0x54')]=function(_0xcc925b,_0x27f115){return db['ChatMessage'][_0x5a0c('0x54')]()['then'](respondWithResult(_0x27f115,null))[_0x5a0c('0x28')](handleError(_0x27f115,null));};var interaction_log=require(_0x5a0c('0x12'))('chat-interactions');exports[_0x5a0c('0x55')]=function(_0x1aef2a,_0x285c09,_0xf33045){var _0xb705c7={'agent':{},'channel':_0x5a0c('0x56')};if(_0x1aef2a['body']['id']){delete _0x1aef2a[_0x5a0c('0x50')]['id'];}_0x1aef2a['body']['read']=!![];_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x57')]=moment()[_0x5a0c('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aef2a['body'][_0x5a0c('0x59')]=_0x1aef2a[_0x5a0c('0x50')]['UserId']||_0x1aef2a['user']['id'];_0xb705c7[_0x5a0c('0x5a')]['id']=_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')];return db[_0x5a0c('0x39')]['find']({'where':{'id':_0x1aef2a[_0x5a0c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x285c09,null))[_0x5a0c('0x20')](saveUpdates(_0x1aef2a[_0x5a0c('0x50')],null))[_0x5a0c('0x20')](function(_0x364cbb){if(_0x364cbb){_0xb705c7['message']=_0x364cbb['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x364cbb['ChatInteractionId']}});}return null;})[_0x5a0c('0x20')](handleEntityNotFound(_0x285c09,null))['then'](function(_0x27a371){if(_0x27a371){return _0x27a371[_0x5a0c('0x51')]({'UserId':_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')],'read1stAt':_[_0x5a0c('0x5b')](_0x27a371[_0x5a0c('0x5c')])?moment()[_0x5a0c('0x58')](_0x5a0c('0x5d')):undefined});}return null;})[_0x5a0c('0x20')](function(_0x433f3e){if(_0x433f3e){_0xb705c7[_0x5a0c('0x5e')]=_0x433f3e['get']({'plain':!![]});interaction_log[_0x5a0c('0x27')](_0x5a0c('0x5f'),_0x1aef2a['user']['id'],_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x35')],_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x61')],_0xb705c7[_0x5a0c('0x5e')]['id'],_0x1aef2a['body']?JSON[_0x5a0c('0x62')](_0x1aef2a[_0x5a0c('0x50')]):_0x5a0c('0x63'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xb705c7);}return null;})[_0x5a0c('0x20')](function(_0x23d412){var _0x1fc6df=_0x5a0c('0x64')+_0x23d412['message'][_0x5a0c('0x65')];return db['sequelize'][_0x5a0c('0x3d')](_0x1fc6df,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5a0c('0x20')](function(_0x2d1b42){return _0x2d1b42;});})[_0x5a0c('0x20')](function(_0x363bf2){if(_0x363bf2){_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x66')]=_0x363bf2[0x0];if(!_0x1aef2a[_0x5a0c('0x50')]['UserId'])return;return db[_0x5a0c('0x67')][_0x5a0c('0x52')]({'where':{'id':_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')],'role':_0x5a0c('0x5a')},'attributes':['id',_0x5a0c('0x35'),_0x5a0c('0x68'),_0x5a0c('0x69'),_0x5a0c('0x6a')],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x33e091){if(!_0x33e091)return null;_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x5a')]=_0x33e091;return _0xb705c7;})[_0x5a0c('0x20')](function(_0xf0d675){if(_0xf0d675){if(_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x6b')]){_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x6c')]=util['format'](_0x5a0c('0x6d'),_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x35')]);_0xb705c7[_0x5a0c('0x26')]['channel']=_0xb705c7[_0x5a0c('0x6e')];_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x6f')]=_0xb705c7[_0x5a0c('0x6e')];_0xb705c7[_0x5a0c('0x26')]['event']=_0x5a0c('0x55');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5a0c('0x70'),'message':_[_0x5a0c('0x49')](_0xb705c7[_0x5a0c('0x26')],JSON['parse'](_0xb705c7[_0x5a0c('0x5e')][_0x5a0c('0x71')]))},client9002)['then'](function(){return _0xb705c7;});}return _0xb705c7;}return null;})[_0x5a0c('0x20')](respondWithResult(_0x285c09,null))[_0x5a0c('0x28')](handleError(_0x285c09,null));};var interaction_log=require(_0x5a0c('0x12'))(_0x5a0c('0x72'));exports[_0x5a0c('0x32')]=function(_0x3d0542,_0x48bc63,_0x3c7331){var _0x4063c7={'agent':{},'channel':'chat'};if(_0x3d0542[_0x5a0c('0x50')]['id']){delete _0x3d0542['body']['id'];}_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')]=_0x3d0542['body'][_0x5a0c('0x59')]||_0x3d0542['user']['id'];_0x4063c7['agent']['id']=_0x3d0542['body'][_0x5a0c('0x59')];return db['ChatMessage'][_0x5a0c('0x52')]({'where':{'id':_0x3d0542['params']['id'],'UserId':null}})[_0x5a0c('0x20')](handleEntityNotFound(_0x48bc63,null))[_0x5a0c('0x20')](function(_0x4ecee2){if(_0x4ecee2){_0x4063c7[_0x5a0c('0x26')]=_0x4ecee2[_0x5a0c('0x73')]({'plain':!![]});return db[_0x5a0c('0x74')][_0x5a0c('0x52')]({'where':{'id':_0x4ecee2[_0x5a0c('0x75')]}});}return null;})[_0x5a0c('0x20')](handleEntityNotFound(_0x48bc63,null))['then'](function(_0x144eb3){if(_0x144eb3){_0x4063c7['interaction']=_0x144eb3[_0x5a0c('0x73')]({'plain':!![]});interaction_log[_0x5a0c('0x27')](_0x5a0c('0x76'),_0x3d0542[_0x5a0c('0x60')]['id'],_0x3d0542[_0x5a0c('0x60')]['name'],_0x3d0542[_0x5a0c('0x60')][_0x5a0c('0x61')],_0x4063c7[_0x5a0c('0x5e')]['id'],_0x3d0542[_0x5a0c('0x50')]?JSON[_0x5a0c('0x62')](_0x3d0542['body']):'null');return respondWithRpcPromise(_0x5a0c('0x77'),_0x5a0c('0x78'),_0x4063c7);}return null;})[_0x5a0c('0x20')](function(_0x3ea36b){var _0x9984bf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ea36b[_0x5a0c('0x26')][_0x5a0c('0x65')];return db[_0x5a0c('0x79')][_0x5a0c('0x3d')](_0x9984bf,{'type':db['Sequelize'][_0x5a0c('0x7a')][_0x5a0c('0x7b')],'raw':!![]})[_0x5a0c('0x20')](function(_0x30cc2c){return _0x30cc2c;});})[_0x5a0c('0x20')](function(_0x5dd298){if(_0x5dd298){_0x4063c7[_0x5a0c('0x26')][_0x5a0c('0x66')]=_0x5dd298[0x0];if(!_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')])return;return db[_0x5a0c('0x67')]['find']({'where':{'id':_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')],'role':_0x5a0c('0x5a')},'attributes':['id','name',_0x5a0c('0x68'),_0x5a0c('0x69'),'internal'],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x44b2db){if(!_0x44b2db)return null;_0x4063c7['message'][_0x5a0c('0x5a')]=_0x44b2db;return _0x4063c7;})['then'](function(_0x35d34b){if(_0x35d34b){_0x35d34b[_0x5a0c('0x26')]['interface']=util[_0x5a0c('0x58')](_0x5a0c('0x6d'),_0x3d0542[_0x5a0c('0x60')][_0x5a0c('0x35')]);_0x35d34b[_0x5a0c('0x26')]['channel']=_0x4063c7[_0x5a0c('0x6e')];_0x35d34b[_0x5a0c('0x26')][_0x5a0c('0x6f')]=_0x4063c7['channel'];_0x35d34b[_0x5a0c('0x26')][_0x5a0c('0x7c')]=_0x5a0c('0x32');respondWithRpcPromise(_0x5a0c('0x7d'),_0x5a0c('0x7d'),{'event':_0x5a0c('0x7e'),'message':_['merge'](_0x4063c7[_0x5a0c('0x26')],JSON[_0x5a0c('0x7f')](_0x4063c7['interaction'][_0x5a0c('0x71')]))},client9002);return _0x4063c7;}return null;})['then'](respondWithResult(_0x48bc63,null))[_0x5a0c('0x28')](handleError(_0x48bc63,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 2e523b2..4cd7bcf 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 _0xcfe1=['events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x4c86d2,_0x591baf){var _0x437a4b=function(_0x462901){while(--_0x462901){_0x4c86d2['push'](_0x4c86d2['shift']());}};_0x437a4b(++_0x591baf);}(_0xcfe1,0x126));var _0x1cfe=function(_0x43dd06,_0x2b2592){_0x43dd06=_0x43dd06-0x0;var _0x416968=_0xcfe1[_0x43dd06];return _0x416968;};'use strict';var EventEmitter=require(_0x1cfe('0x0'));var ChatMessage=require(_0x1cfe('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1cfe('0x2')](0x0);var events={'afterCreate':_0x1cfe('0x3'),'afterUpdate':_0x1cfe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6da306){return function(_0x25523d,_0x1b2365,_0x15cf6d){ChatMessageEvents[_0x1cfe('0x5')](_0x6da306+':'+_0x25523d['id'],_0x25523d);ChatMessageEvents[_0x1cfe('0x5')](_0x6da306,_0x25523d);_0x15cf6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1cfe('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x673e=['save','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x50e440,_0x274af9){var _0x4257f0=function(_0x1dd4dd){while(--_0x1dd4dd){_0x50e440['push'](_0x50e440['shift']());}};_0x4257f0(++_0x274af9);}(_0x673e,0x1d4));var _0xe673=function(_0x21e4e6,_0x24c576){_0x21e4e6=_0x21e4e6-0x0;var _0x204b2d=_0x673e[_0x21e4e6];return _0x204b2d;};'use strict';var EventEmitter=require(_0xe673('0x0'));var ChatMessage=require(_0xe673('0x1'))['db'][_0xe673('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe673('0x3')](0x0);var events={'afterCreate':_0xe673('0x4'),'afterUpdate':'update','afterDestroy':_0xe673('0x5')};function emitEvent(_0x33b435){return function(_0x5449cf,_0x3353af,_0x13a544){ChatMessageEvents[_0xe673('0x6')](_0x33b435+':'+_0x5449cf['id'],_0x5449cf);ChatMessageEvents[_0xe673('0x6')](_0x33b435,_0x5449cf);_0x13a544(null);};}for(var e in events){if(events[_0xe673('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 2c5ec24..b6aaa39 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 _0x826e=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','then','createdAt','catch'];(function(_0x22e69b,_0x1f32b0){var _0x2c2db7=function(_0x5b670c){while(--_0x5b670c){_0x22e69b['push'](_0x22e69b['shift']());}};_0x2c2db7(++_0x1f32b0);}(_0x826e,0x163));var _0xe826=function(_0x189ffc,_0x3bc69d){_0x189ffc=_0x189ffc-0x0;var _0xa0f1ed=_0x826e[_0x189ffc];return _0xa0f1ed;};'use strict';var _=require('lodash');var util=require(_0xe826('0x0'));var logger=require(_0xe826('0x1'))(_0xe826('0x2'));var moment=require(_0xe826('0x3'));var BPromise=require(_0xe826('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe826('0x5'));var attributes=require(_0xe826('0x6'));module[_0xe826('0x7')]=function(_0x21d118,_0x4a2658){return _0x21d118['define'](_0xe826('0x8'),attributes,{'tableName':_0xe826('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xe826('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50b311,_0x11f53d,_0x34da53){var _0x63554f=_0x21d118[_0xe826('0xb')];var _0x1a4915=_0x50b311['get']({'plain':!![]});if(_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()==='in'||_0x1a4915[_0xe826('0xc')]['toLowerCase']()==='out'&&!_0x1a4915[_0xe826('0xe')]&&!_[_0xe826('0xf')](_0x1a4915['UserId'])){_0x63554f['ChatInteraction']['findOne']({'where':{'id':_0x1a4915['ChatInteractionId']}})[_0xe826('0x10')](function(_0x200eb6){if(_0x200eb6){_0x200eb6['update']({'lastMsgAt':_0x1a4915[_0xe826('0x11')],'lastMsgDirection':_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()});}})[_0xe826('0x12')](function(_0x48e03f){console[_0xe826('0x13')](_0x48e03f);});}_0x34da53();}},'charset':_0xe826('0x14'),'collate':_0xe826('0x15')});}; \ No newline at end of file +var _0x1521=['out','secret','UserId','ChatInteraction','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase'];(function(_0x5f0a31,_0x2d3496){var _0x37ef20=function(_0x468b03){while(--_0x468b03){_0x5f0a31['push'](_0x5f0a31['shift']());}};_0x37ef20(++_0x2d3496);}(_0x1521,0x11c));var _0x1152=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x1521[_0x36b037];return _0x409194;};'use strict';var _=require('lodash');var util=require(_0x1152('0x0'));var logger=require(_0x1152('0x1'))(_0x1152('0x2'));var moment=require(_0x1152('0x3'));var BPromise=require(_0x1152('0x4'));var rp=require(_0x1152('0x5'));var fs=require('fs');var path=require(_0x1152('0x6'));var rimraf=require('rimraf');var config=require(_0x1152('0x7'));var attributes=require('./chatMessage.attributes');module[_0x1152('0x8')]=function(_0xf59dec,_0x10a765){return _0xf59dec['define'](_0x1152('0x9'),attributes,{'tableName':_0x1152('0xa'),'paranoid':![],'indexes':[{'name':_0x1152('0xb'),'fields':['body'],'type':_0x1152('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45f68d,_0x999933,_0x13e967){var _0x4730fb=_0xf59dec['models'];var _0xc472c7=_0x45f68d[_0x1152('0xd')]({'plain':!![]});if(_0xc472c7[_0x1152('0xe')][_0x1152('0xf')]()==='in'||_0xc472c7[_0x1152('0xe')][_0x1152('0xf')]()===_0x1152('0x10')&&!_0xc472c7[_0x1152('0x11')]&&!_['isNil'](_0xc472c7[_0x1152('0x12')])){_0x4730fb[_0x1152('0x13')]['findOne']({'where':{'id':_0xc472c7['ChatInteractionId']}})['then'](function(_0x1b88bf){if(_0x1b88bf){_0x1b88bf['update']({'lastMsgAt':_0xc472c7[_0x1152('0x14')],'lastMsgDirection':_0xc472c7['direction'][_0x1152('0xf')]()});}})[_0x1152('0x15')](function(_0x535afe){console[_0x1152('0x16')](_0x535afe);});}_0x13e967();}},'charset':_0x1152('0x17'),'collate':_0x1152('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 90951b2..365aaab 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 _0x7157=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x7157,0x1b0));var _0x7715=function(_0x27c2b1,_0x39a48c){_0x27c2b1=_0x27c2b1-0x0;var _0x423cb6=_0x7157[_0x27c2b1];return _0x423cb6;};'use strict';var _=require(_0x7715('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7715('0x1'));var rs=require(_0x7715('0x2'));var fs=require('fs');var Redis=require(_0x7715('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7715('0x4'));var logger=require(_0x7715('0x5'))(_0x7715('0x6'));var config=require(_0x7715('0x7'));var jayson=require(_0x7715('0x8'));var client=jayson[_0x7715('0x9')][_0x7715('0xa')]({'port':0x232a});config[_0x7715('0xb')]=_['defaults'](config[_0x7715('0xb')],{'host':_0x7715('0xc'),'port':0x18eb});var socket=require(_0x7715('0xd'))(new Redis(config[_0x7715('0xb')]));require(_0x7715('0xe'))['register'](socket);function respondWithRpcPromise(_0x24919f,_0x3028c7,_0x196fcb){return new BPromise(function(_0x3b54a1,_0x5bbc71){return client[_0x7715('0xf')](_0x24919f,_0x196fcb)[_0x7715('0x10')](function(_0x4c939b){logger[_0x7715('0x11')](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));logger[_0x7715('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3028c7,_0x7715('0x13'),JSON[_0x7715('0x15')](_0x4c939b));if(_0x4c939b[_0x7715('0x16')]){if(_0x4c939b[_0x7715('0x16')]['code']===0x1f4){logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')]['message']);return _0x5bbc71(_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);}logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);return _0x3b54a1(_0x4c939b['error'][_0x7715('0x17')]);}else{logger['info'](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));_0x3b54a1(_0x4c939b[_0x7715('0x18')][_0x7715('0x17')]);}})[_0x7715('0x19')](function(_0x3e1072){logger['error'](_0x7715('0x12'),_0x3028c7,_0x3e1072);_0x5bbc71(_0x3e1072);});});}exports[_0x7715('0x1a')]=function(_0x524c7f){var _0x30f71d=this;return new Promise(function(_0x12120b,_0x2530de){return db[_0x7715('0x1b')][_0x7715('0x1c')](_0x524c7f[_0x7715('0x1d')],{'raw':_0x524c7f['options']?_0x524c7f['options']['raw']===undefined?!![]:![]:!![]})[_0x7715('0x10')](function(_0x1c4f9b){logger[_0x7715('0x11')](_0x7715('0x1a'),_0x524c7f);logger[_0x7715('0x14')](_0x7715('0x1a'),_0x524c7f,JSON['stringify'](_0x1c4f9b));_0x12120b(_0x1c4f9b);})[_0x7715('0x19')](function(_0x3191d0){logger[_0x7715('0x16')](_0x7715('0x1a'),_0x3191d0[_0x7715('0x17')],_0x524c7f);_0x2530de(_0x30f71d[_0x7715('0x16')](0x1f4,_0x3191d0[_0x7715('0x17')]));});});}; \ No newline at end of file +var _0x0842=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x375f40,_0x511157){var _0x27a221=function(_0x131feb){while(--_0x131feb){_0x375f40['push'](_0x375f40['shift']());}};_0x27a221(++_0x511157);}(_0x0842,0xeb));var _0x2084=function(_0x160136,_0x2ca160){_0x160136=_0x160136-0x0;var _0x5d5eff=_0x0842[_0x160136];return _0x5d5eff;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2084('0x3'))['db'];var utils=require(_0x2084('0x4'));var logger=require(_0x2084('0x5'))('rpc');var config=require(_0x2084('0x6'));var jayson=require(_0x2084('0x7'));var client=jayson[_0x2084('0x8')][_0x2084('0x9')]({'port':0x232a});config[_0x2084('0xa')]=_[_0x2084('0xb')](config[_0x2084('0xa')],{'host':_0x2084('0xc'),'port':0x18eb});var socket=require(_0x2084('0xd'))(new Redis(config[_0x2084('0xa')]));require(_0x2084('0xe'))[_0x2084('0xf')](socket);function respondWithRpcPromise(_0x3a9bc3,_0xc7431a,_0x19dd5a){return new BPromise(function(_0x5e1066,_0x4cb8ea){return client[_0x2084('0x10')](_0x3a9bc3,_0x19dd5a)['then'](function(_0x5659da){logger[_0x2084('0x11')](_0x2084('0x12'),_0xc7431a,_0x2084('0x13'));logger['debug'](_0x2084('0x14'),_0xc7431a,_0x2084('0x13'),JSON[_0x2084('0x15')](_0x5659da));if(_0x5659da[_0x2084('0x16')]){if(_0x5659da[_0x2084('0x16')][_0x2084('0x17')]===0x1f4){logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x5659da[_0x2084('0x16')][_0x2084('0x18')]);return _0x4cb8ea(_0x5659da[_0x2084('0x16')]['message']);}logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x5659da['error']['message']);return _0x5e1066(_0x5659da[_0x2084('0x16')]['message']);}else{logger[_0x2084('0x11')](_0x2084('0x12'),_0xc7431a,_0x2084('0x13'));_0x5e1066(_0x5659da[_0x2084('0x19')][_0x2084('0x18')]);}})[_0x2084('0x1a')](function(_0x444031){logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x444031);_0x4cb8ea(_0x444031);});});}exports[_0x2084('0x1b')]=function(_0x360079){var _0x5a6777=this;return new Promise(function(_0x9f7abd,_0x3ad78e){return db[_0x2084('0x1c')][_0x2084('0x1d')](_0x360079[_0x2084('0x1e')],{'raw':_0x360079['options']?_0x360079[_0x2084('0x1f')][_0x2084('0x20')]===undefined?!![]:![]:!![]})[_0x2084('0x21')](function(_0x42c845){logger[_0x2084('0x11')](_0x2084('0x1b'),_0x360079);logger[_0x2084('0x22')](_0x2084('0x1b'),_0x360079,JSON[_0x2084('0x15')](_0x42c845));_0x9f7abd(_0x42c845);})[_0x2084('0x1a')](function(_0x308db7){logger[_0x2084('0x16')](_0x2084('0x1b'),_0x308db7[_0x2084('0x18')],_0x360079);_0x3ad78e(_0x5a6777[_0x2084('0x16')](0x1f4,_0x308db7['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index fae1344..56c01b8 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 _0x0207=['emit','removeListener','length','chatMessage:','save'];(function(_0x1d75d0,_0x666556){var _0x3607bf=function(_0x407781){while(--_0x407781){_0x1d75d0['push'](_0x1d75d0['shift']());}};_0x3607bf(++_0x666556);}(_0x0207,0x162));var _0x7020=function(_0x2178fa,_0x284a29){_0x2178fa=_0x2178fa-0x0;var _0x47012f=_0x0207[_0x2178fa];return _0x47012f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7020('0x0'),'remove','update'];function createListener(_0x1a481c,_0x28ab1d){return function(_0x2213ca){_0x28ab1d[_0x7020('0x1')](_0x1a481c,_0x2213ca);};}function removeListener(_0x2e62fd,_0x25174b){return function(){ChatMessageEvents[_0x7020('0x2')](_0x2e62fd,_0x25174b);};}exports['register']=function(_0x5074d7){for(var _0x38c320=0x0,_0x39263c=events[_0x7020('0x3')];_0x38c320<_0x39263c;_0x38c320++){var _0x17deac=events[_0x38c320];var _0x42bc79=createListener(_0x7020('0x4')+_0x17deac,_0x5074d7);ChatMessageEvents['on'](_0x17deac,_0x42bc79);}}; \ No newline at end of file +var _0xa63f=['./chatMessage.events','save','remove','update','emit','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa63f,0x1b6));var _0xfa63=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa63f[_0x4ff09b];return _0x3f5c2e;};'use strict';var ChatMessageEvents=require(_0xfa63('0x0'));var events=[_0xfa63('0x1'),_0xfa63('0x2'),_0xfa63('0x3')];function createListener(_0x3103ba,_0x2bbc5a){return function(_0x401dbf){_0x2bbc5a[_0xfa63('0x4')](_0x3103ba,_0x401dbf);};}function removeListener(_0x37e644,_0x138518){return function(){ChatMessageEvents['removeListener'](_0x37e644,_0x138518);};}exports['register']=function(_0x20d4f6){for(var _0x41efce=0x0,_0xb35bc5=events[_0xfa63('0x5')];_0x41efce<_0xb35bc5;_0x41efce++){var _0x486050=events[_0x41efce];var _0x505e1a=createListener('chatMessage:'+_0x486050,_0x20d4f6);ChatMessageEvents['on'](_0x486050,_0x505e1a);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ed95831..1f00b2e 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 _0x2471=['put','update','/:id/accept','/:id/reject','reject','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create'];(function(_0x4109d7,_0xc7e23b){var _0x468d71=function(_0x14ad80){while(--_0x14ad80){_0x4109d7['push'](_0x4109d7['shift']());}};_0x468d71(++_0xc7e23b);}(_0x2471,0xde));var _0x1247=function(_0x4087cc,_0x2b2f48){_0x4087cc=_0x4087cc-0x0;var _0x52874a=_0x2471[_0x4087cc];return _0x52874a;};'use strict';var multer=require(_0x1247('0x0'));var util=require(_0x1247('0x1'));var path=require('path');var timeout=require(_0x1247('0x2'));var express=require('express');var router=express[_0x1247('0x3')]();var fs_extra=require(_0x1247('0x4'));var auth=require(_0x1247('0x5'));var interaction=require(_0x1247('0x6'));var config=require(_0x1247('0x7'));var controller=require(_0x1247('0x8'));router['get']('/',auth[_0x1247('0x9')](),controller['index']);router[_0x1247('0xa')](_0x1247('0xb'),auth[_0x1247('0x9')](),controller[_0x1247('0xc')]);router['get'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller[_0x1247('0xe')]);router['post']('/',auth[_0x1247('0x9')](),interaction[_0x1247('0xf')](_0x1247('0x10'),_0x1247('0x11')),controller['create']);router[_0x1247('0x12')]('/:id',controller[_0x1247('0x13')]);router[_0x1247('0x12')](_0x1247('0x14'),auth[_0x1247('0x9')](),controller['accept']);router[_0x1247('0x12')](_0x1247('0x15'),auth[_0x1247('0x9')](),controller[_0x1247('0x16')]);router['delete'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller['destroy']);module[_0x1247('0x17')]=router; \ No newline at end of file +var _0xae35=['put','update','/:id/reject','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','show','post','tracked','chat','create'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xae35,0xd7));var _0x5ae3=function(_0x17a67c,_0x8fa232){_0x17a67c=_0x17a67c-0x0;var _0x1c5c11=_0xae35[_0x17a67c];return _0x1c5c11;};'use strict';var multer=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ae3('0x2'));var router=express[_0x5ae3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5ae3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ae3('0x5'));var controller=require(_0x5ae3('0x6'));router[_0x5ae3('0x7')]('/',auth[_0x5ae3('0x8')](),controller[_0x5ae3('0x9')]);router[_0x5ae3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x5ae3('0xa')]);router[_0x5ae3('0x7')]('/:id',auth[_0x5ae3('0x8')](),controller[_0x5ae3('0xb')]);router[_0x5ae3('0xc')]('/',auth[_0x5ae3('0x8')](),interaction[_0x5ae3('0xd')](_0x5ae3('0xe'),'chatmessage:create'),controller[_0x5ae3('0xf')]);router[_0x5ae3('0x10')]('/:id',controller[_0x5ae3('0x11')]);router[_0x5ae3('0x10')]('/:id/accept',auth[_0x5ae3('0x8')](),controller['accept']);router[_0x5ae3('0x10')](_0x5ae3('0x12'),auth[_0x5ae3('0x8')](),controller['reject']);router[_0x5ae3('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5ae3('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 95a18bc..495fb0f 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1e2373,_0x4aec50){var _0x8efd57=function(_0x54f7dc){while(--_0x54f7dc){_0x1e2373['push'](_0x1e2373['shift']());}};_0x8efd57(++_0x4aec50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0x5f2f[_0x57a402];return _0x753a36;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x0b0e[_0x3e182f];return _0x23edc9;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c2a41eb..77a5bbd 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x328fa9,_0x2ad630){var _0x32cf6f=function(_0x4602b3){while(--_0x4602b3){_0x328fa9['push'](_0x328fa9['shift']());}};_0x32cf6f(++_0x2ad630);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x24a9c5,_0x34be29){var _0x59422d=function(_0x244090){while(--_0x244090){_0x24a9c5['push'](_0x24a9c5['shift']());}};_0x59422d(++_0x34be29);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 8059830..0e68a1a 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5153=['remove','emit','exports','events','save','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x5153,0x159));var _0x3515=function(_0x3988c7,_0x1dab2f){_0x3988c7=_0x3988c7-0x0;var _0x19d631=_0x5153[_0x3988c7];return _0x19d631;};'use strict';var EventEmitter=require(_0x3515('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3515('0x1'),'afterUpdate':_0x3515('0x2'),'afterDestroy':_0x3515('0x3')};function emitEvent(_0x4a3292){return function(_0xb829be,_0x113fd9,_0x257f85){ChatOfflineMessageEvents['emit'](_0x4a3292+':'+_0xb829be['id'],_0xb829be);ChatOfflineMessageEvents[_0x3515('0x4')](_0x4a3292,_0xb829be);_0x257f85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x3515('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x711c=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x337a31,_0xb1bb23){var _0x30b8f2=function(_0x2f1d65){while(--_0x2f1d65){_0x337a31['push'](_0x337a31['shift']());}};_0x30b8f2(++_0xb1bb23);}(_0x711c,0x74));var _0xc711=function(_0x336d06,_0x39bd81){_0x336d06=_0x336d06-0x0;var _0x55984b=_0x711c[_0x336d06];return _0x55984b;};'use strict';var EventEmitter=require(_0xc711('0x0'));var ChatOfflineMessage=require(_0xc711('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xc711('0x2')](0x0);var events={'afterCreate':_0xc711('0x3'),'afterUpdate':_0xc711('0x4'),'afterDestroy':'remove'};function emitEvent(_0x588b21){return function(_0x59c6a8,_0x1294ff,_0x272abd){ChatOfflineMessageEvents[_0xc711('0x5')](_0x588b21+':'+_0x59c6a8['id'],_0x59c6a8);ChatOfflineMessageEvents[_0xc711('0x5')](_0x588b21,_0x59c6a8);_0x272abd(null);};}for(var e in events){if(events[_0xc711('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xc711('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 6e9a6cc..8a2a228 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 _0x9e87=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9e87,0x14b));var _0x79e8=function(_0x503e25,_0xb8a860){_0x503e25=_0x503e25-0x0;var _0x47c27a=_0x9e87[_0x503e25];return _0x47c27a;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x79e8('0x0')]=function(_0x1facfe){return _0x1facfe['define'](_0x79e8('0x1'),attributes,{'tableName':_0x79e8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79e8('0x3')});}; \ No newline at end of file +var _0xd3d4=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x540c61,_0x16f596){var _0x181e21=function(_0x158b4b){while(--_0x158b4b){_0x540c61['push'](_0x540c61['shift']());}};_0x181e21(++_0x16f596);}(_0xd3d4,0x188));var _0x4d3d=function(_0x30839a,_0x6cd6f4){_0x30839a=_0x30839a-0x0;var _0x21ab5b=_0xd3d4[_0x30839a];return _0x21ab5b;};'use strict';var attributes=require(_0x4d3d('0x0'));module[_0x4d3d('0x1')]=function(_0x17c5ab){return _0x17c5ab[_0x4d3d('0x2')](_0x4d3d('0x3'),attributes,{'tableName':_0x4d3d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4d3d('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 0f9a535..05b3629 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 _0x6922=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x59ee91,_0x5ca1ef){var _0x51b0b7=function(_0x55517f){while(--_0x55517f){_0x59ee91['push'](_0x59ee91['shift']());}};_0x51b0b7(++_0x5ca1ef);}(_0x6922,0x169));var _0x2692=function(_0x326a25,_0x15c086){_0x326a25=_0x326a25-0x0;var _0xe38041=_0x6922[_0x326a25];return _0xe38041;};'use strict';var _=require(_0x2692('0x0'));var util=require(_0x2692('0x1'));var moment=require(_0x2692('0x2'));var BPromise=require('bluebird');var rs=require(_0x2692('0x3'));var fs=require('fs');var Redis=require(_0x2692('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2692('0x5'));var logger=require('../../config/logger')(_0x2692('0x6'));var config=require(_0x2692('0x7'));var jayson=require(_0x2692('0x8'));var client=jayson[_0x2692('0x9')][_0x2692('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537d30,_0xe04f91,_0x48be8b){return new BPromise(function(_0x2726b7,_0x510bff){return client[_0x2692('0xb')](_0x537d30,_0x48be8b)['then'](function(_0x560248){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,'request\x20sent');logger[_0x2692('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'),JSON[_0x2692('0xe')](_0x560248));if(_0x560248[_0x2692('0xf')]){if(_0x560248[_0x2692('0xf')]['code']===0x1f4){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x510bff(_0x560248[_0x2692('0xf')][_0x2692('0x11')]);}logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x2726b7(_0x560248['error'][_0x2692('0x11')]);}else{logger[_0x2692('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'));_0x2726b7(_0x560248[_0x2692('0x13')][_0x2692('0x11')]);}})[_0x2692('0x14')](function(_0x5b1b0e){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x5b1b0e);_0x510bff(_0x5b1b0e);});});} \ No newline at end of file +var _0xfe43=['../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3205dd,_0x147e2c){var _0x4fb353=function(_0x196998){while(--_0x196998){_0x3205dd['push'](_0x3205dd['shift']());}};_0x4fb353(++_0x147e2c);}(_0xfe43,0x120));var _0x3fe4=function(_0x196bc1,_0x38b037){_0x196bc1=_0x196bc1-0x0;var _0x35a231=_0xfe43[_0x196bc1];return _0x35a231;};'use strict';var _=require(_0x3fe4('0x0'));var util=require('util');var moment=require(_0x3fe4('0x1'));var BPromise=require(_0x3fe4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fe4('0x3'));var db=require(_0x3fe4('0x4'))['db'];var utils=require(_0x3fe4('0x5'));var logger=require(_0x3fe4('0x6'))('rpc');var config=require(_0x3fe4('0x7'));var jayson=require(_0x3fe4('0x8'));var client=jayson['client'][_0x3fe4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15dc3c,_0x53413b,_0x1311ec){return new BPromise(function(_0x36027e,_0x2aa775){return client['request'](_0x15dc3c,_0x1311ec)[_0x3fe4('0xa')](function(_0x5ace2f){logger[_0x3fe4('0xb')](_0x3fe4('0xc'),_0x53413b,_0x3fe4('0xd'));logger[_0x3fe4('0xe')](_0x3fe4('0xf'),_0x53413b,_0x3fe4('0xd'),JSON[_0x3fe4('0x10')](_0x5ace2f));if(_0x5ace2f[_0x3fe4('0x11')]){if(_0x5ace2f['error'][_0x3fe4('0x12')]===0x1f4){logger['error'](_0x3fe4('0xc'),_0x53413b,_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);return _0x2aa775(_0x5ace2f['error'][_0x3fe4('0x13')]);}logger['error'](_0x3fe4('0xc'),_0x53413b,_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);return _0x36027e(_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);}else{logger[_0x3fe4('0xb')](_0x3fe4('0xc'),_0x53413b,_0x3fe4('0xd'));_0x36027e(_0x5ace2f[_0x3fe4('0x14')][_0x3fe4('0x13')]);}})['catch'](function(_0x15017e){logger[_0x3fe4('0x11')](_0x3fe4('0xc'),_0x53413b,_0x15017e);_0x2aa775(_0x15017e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index d5130f3..67090ec 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 _0x0070=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0xf02b64,_0x5e76fc){var _0x334b5f=function(_0x1e9650){while(--_0x1e9650){_0xf02b64['push'](_0xf02b64['shift']());}};_0x334b5f(++_0x5e76fc);}(_0x0070,0xb4));var _0x0007=function(_0x505b1,_0x3f2a5d){_0x505b1=_0x505b1-0x0;var _0x6f5380=_0x0070[_0x505b1];return _0x6f5380;};'use strict';var multer=require(_0x0007('0x0'));var util=require(_0x0007('0x1'));var path=require(_0x0007('0x2'));var timeout=require(_0x0007('0x3'));var express=require(_0x0007('0x4'));var router=express[_0x0007('0x5')]();var fs_extra=require(_0x0007('0x6'));var auth=require(_0x0007('0x7'));var interaction=require(_0x0007('0x8'));var config=require(_0x0007('0x9'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x0007('0xa')](),controller[_0x0007('0xb')]);router[_0x0007('0xc')]('/describe',auth[_0x0007('0xa')](),controller['describe']);router['get'](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0xe')]);router[_0x0007('0xf')]('/',auth[_0x0007('0xa')](),controller[_0x0007('0x10')]);router[_0x0007('0x11')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x12')]);router[_0x0007('0x13')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x14')]);module[_0x0007('0x15')]=router; \ No newline at end of file +var _0xdc77=['delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x30d7bd,_0x521a33){var _0x4bd842=function(_0x3fa21e){while(--_0x3fa21e){_0x30d7bd['push'](_0x30d7bd['shift']());}};_0x4bd842(++_0x521a33);}(_0xdc77,0x1cf));var _0x7dc7=function(_0x1f8591,_0x5396ac){_0x1f8591=_0x1f8591-0x0;var _0x50f0ce=_0xdc77[_0x1f8591];return _0x50f0ce;};'use strict';var multer=require(_0x7dc7('0x0'));var util=require('util');var path=require(_0x7dc7('0x1'));var timeout=require(_0x7dc7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7dc7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7dc7('0x4'));var config=require(_0x7dc7('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x7dc7('0x6')]('/',auth['isAuthenticated'](),controller[_0x7dc7('0x7')]);router['get'](_0x7dc7('0x8'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xa')]);router[_0x7dc7('0x6')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xc')]);router[_0x7dc7('0xd')]('/',auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xe')]);router[_0x7dc7('0xf')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0x10')]);router[_0x7dc7('0x11')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0x12')]);module[_0x7dc7('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 5a8b23b..389925b 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 _0x30a1=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x30a1,0x1bd));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x130a('0x0'));module[_0x130a('0x1')]={'name':{'type':Sequelize[_0x130a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x130a('0x3'),_0x130a('0x4')),'defaultValue':_0x130a('0x3')},'selector':{'type':Sequelize[_0x130a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3526=['mouseOver','sequelize','exports','STRING','ENUM','timeout'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x3526,0x16f));var _0x6352=function(_0x202965,_0xebb2c4){_0x202965=_0x202965-0x0;var _0x1c105d=_0x3526[_0x202965];return _0x1c105d;};'use strict';var Sequelize=require(_0x6352('0x0'));module[_0x6352('0x1')]={'name':{'type':Sequelize[_0x6352('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6352('0x3')]('mouseOver',_0x6352('0x4')),'defaultValue':_0x6352('0x5')},'selector':{'type':Sequelize[_0x6352('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index f391dea..66f6b64 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 _0x3351=['attributes','length','include','options','find','create','body','catch','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields'];(function(_0x5983c7,_0x415ba8){var _0x555815=function(_0x193cc2){while(--_0x193cc2){_0x5983c7['push'](_0x5983c7['shift']());}};_0x555815(++_0x415ba8);}(_0x3351,0x1b4));var _0x1335=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x3351[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1335('0x1'));var rp=require(_0x1335('0x2'));var moment=require(_0x1335('0x3'));var BPromise=require(_0x1335('0x4'));var Mustache=require(_0x1335('0x5'));var util=require(_0x1335('0x6'));var path=require(_0x1335('0x7'));var sox=require('sox');var csv=require(_0x1335('0x8'));var ejs=require(_0x1335('0x9'));var fs=require('fs');var fs_extra=require(_0x1335('0xa'));var _=require(_0x1335('0xb'));var squel=require(_0x1335('0xc'));var crypto=require(_0x1335('0xd'));var jsforce=require(_0x1335('0xe'));var deskjs=require(_0x1335('0xf'));var toCsv=require(_0x1335('0x8'));var querystring=require(_0x1335('0x10'));var Papa=require(_0x1335('0x11'));var Redis=require('ioredis');var authService=require(_0x1335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1335('0x13'));var hardwareService=require(_0x1335('0x14'));var logger=require(_0x1335('0x15'))(_0x1335('0x16'));var utils=require(_0x1335('0x17'));var config=require(_0x1335('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1335('0x19'))['db'];function respondWithStatusCode(_0x55a85e,_0x425cd8){_0x425cd8=_0x425cd8||0xcc;return function(_0x5699f4){if(_0x5699f4){return _0x55a85e[_0x1335('0x1a')](_0x425cd8);}return _0x55a85e['status'](_0x425cd8)[_0x1335('0x1b')]();};}function respondWithResult(_0x4c8964,_0x4f9625){_0x4f9625=_0x4f9625||0xc8;return function(_0xc333ce){if(_0xc333ce){return _0x4c8964[_0x1335('0x1c')](_0x4f9625)['json'](_0xc333ce);}};}function respondWithFilteredResult(_0x5ee59d,_0x3bd6b0){return function(_0x565686){if(_0x565686){var _0x431433=typeof _0x3bd6b0[_0x1335('0x1d')]===_0x1335('0x1e')&&typeof _0x3bd6b0['limit']===_0x1335('0x1e');var _0x4da3b8=_0x565686[_0x1335('0x1f')];var _0x4d5b17=_0x431433?0x0:_0x3bd6b0[_0x1335('0x1d')];var _0x36123c=_0x431433?_0x565686[_0x1335('0x1f')]:_0x3bd6b0['offset']+_0x3bd6b0[_0x1335('0x20')];var _0xbebdea;if(_0x36123c>=_0x4da3b8){_0x36123c=_0x4da3b8;_0xbebdea=0xc8;}else{_0xbebdea=0xce;}_0x5ee59d[_0x1335('0x1c')](_0xbebdea);return _0x5ee59d[_0x1335('0x21')]('Content-Range',_0x4d5b17+'-'+_0x36123c+'/'+_0x4da3b8)[_0x1335('0x22')](_0x565686);}return null;};}function patchUpdates(_0x4ae091){return function(_0x5c10d3){try{jsonpatch['apply'](_0x5c10d3,_0x4ae091,!![]);}catch(_0x12e01b){return BPromise[_0x1335('0x23')](_0x12e01b);}return _0x5c10d3[_0x1335('0x24')]();};}function saveUpdates(_0x5c4c24,_0x4c01c9){return function(_0x25aacb){if(_0x25aacb){return _0x25aacb['update'](_0x5c4c24)[_0x1335('0x25')](function(_0x47eaa7){return _0x47eaa7;});}return null;};}function removeEntity(_0x35432b,_0x1c13a8){return function(_0x383d19){if(_0x383d19){return _0x383d19[_0x1335('0x26')]()[_0x1335('0x25')](function(){_0x35432b[_0x1335('0x1c')](0xcc)[_0x1335('0x1b')]();});}};}function handleEntityNotFound(_0x48a0f9,_0x37efee){return function(_0x26ba20){if(!_0x26ba20){_0x48a0f9[_0x1335('0x1a')](0x194);}return _0x26ba20;};}function handleError(_0x1e0019,_0x4cf375){_0x4cf375=_0x4cf375||0x1f4;return function(_0x1498e6){logger[_0x1335('0x27')](_0x1498e6[_0x1335('0x28')]);if(_0x1498e6[_0x1335('0x29')]){delete _0x1498e6[_0x1335('0x29')];}_0x1e0019[_0x1335('0x1c')](_0x4cf375)[_0x1335('0x2a')](_0x1498e6);};}exports[_0x1335('0x2b')]=function(_0x23b5cc,_0xdc07ab){var _0x233298={'raw':!![],'where':{'id':_0x23b5cc['params']['id']}},_0x19950c={};_0x19950c[_0x1335('0x2c')]=_['keys'](db[_0x1335('0x2d')][_0x1335('0x2e')]);_0x19950c[_0x1335('0x2f')]=_[_0x1335('0x30')](_0x23b5cc['query']);_0x19950c[_0x1335('0x31')]=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],_0x19950c[_0x1335('0x2f')]);_0x233298['attributes']=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],qs[_0x1335('0x33')](_0x23b5cc[_0x1335('0x2f')][_0x1335('0x33')]));_0x233298[_0x1335('0x34')]=_0x233298['attributes'][_0x1335('0x35')]?_0x233298[_0x1335('0x34')]:_0x19950c[_0x1335('0x2c')];if(_0x23b5cc[_0x1335('0x2f')]['includeAll']){_0x233298[_0x1335('0x36')]=[{'all':!![]}];}_0x233298=_['merge']({},_0x233298,_0x23b5cc[_0x1335('0x37')]);return db['ChatProactiveAction'][_0x1335('0x38')](_0x233298)[_0x1335('0x25')](handleEntityNotFound(_0xdc07ab,null))[_0x1335('0x25')](respondWithResult(_0xdc07ab,null))['catch'](handleError(_0xdc07ab,null));};exports[_0x1335('0x39')]=function(_0x5f311e,_0x3b82be){return db[_0x1335('0x2d')][_0x1335('0x39')](_0x5f311e[_0x1335('0x3a')],{})[_0x1335('0x25')](respondWithResult(_0x3b82be,0xc9))[_0x1335('0x3b')](handleError(_0x3b82be,null));};exports['update']=function(_0x31be79,_0x213815){if(_0x31be79[_0x1335('0x3a')]['id']){delete _0x31be79['body']['id'];}return db[_0x1335('0x2d')]['find']({'where':{'id':_0x31be79[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x213815,null))[_0x1335('0x25')](saveUpdates(_0x31be79[_0x1335('0x3a')],null))['then'](respondWithResult(_0x213815,null))[_0x1335('0x3b')](handleError(_0x213815,null));};exports[_0x1335('0x26')]=function(_0x524252,_0x21f5bb){return db[_0x1335('0x2d')][_0x1335('0x38')]({'where':{'id':_0x524252[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21f5bb,null))[_0x1335('0x25')](removeEntity(_0x21f5bb,null))[_0x1335('0x3b')](handleError(_0x21f5bb,null));}; \ No newline at end of file +var _0x2b83=['path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x5d784f,_0x2d352c){var _0x2e0f32=function(_0x1b66f5){while(--_0x1b66f5){_0x5d784f['push'](_0x5d784f['shift']());}};_0x2e0f32(++_0x2d352c);}(_0x2b83,0x1d3));var _0x32b8=function(_0x260391,_0x2eda13){_0x260391=_0x260391-0x0;var _0x30abef=_0x2b83[_0x260391];return _0x30abef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={'raw':!![],'where':{'id':_0x39ce15[_0x32b8('0x29')]['id']}},_0x3e0548={};_0x3e0548[_0x32b8('0x2a')]=_['keys'](db[_0x32b8('0x2b')][_0x32b8('0x2c')]);_0x3e0548[_0x32b8('0x2d')]=_[_0x32b8('0x2e')](_0x39ce15[_0x32b8('0x2d')]);_0x3e0548[_0x32b8('0x2f')]=_[_0x32b8('0x30')](_0x3e0548[_0x32b8('0x2a')],_0x3e0548[_0x32b8('0x2d')]);_0xa225ec[_0x32b8('0x31')]=_['intersection'](_0x3e0548[_0x32b8('0x2a')],qs[_0x32b8('0x32')](_0x39ce15[_0x32b8('0x2d')][_0x32b8('0x32')]));_0xa225ec['attributes']=_0xa225ec['attributes'][_0x32b8('0x33')]?_0xa225ec[_0x32b8('0x31')]:_0x3e0548[_0x32b8('0x2a')];if(_0x39ce15[_0x32b8('0x2d')]['includeAll']){_0xa225ec[_0x32b8('0x34')]=[{'all':!![]}];}_0xa225ec=_[_0x32b8('0x35')]({},_0xa225ec,_0x39ce15[_0x32b8('0x36')]);return db[_0x32b8('0x2b')][_0x32b8('0x37')](_0xa225ec)[_0x32b8('0x23')](handleEntityNotFound(_0x3fa029,null))[_0x32b8('0x23')](respondWithResult(_0x3fa029,null))[_0x32b8('0x38')](handleError(_0x3fa029,null));};exports['create']=function(_0x10f17e,_0x5e8af2){return db[_0x32b8('0x2b')][_0x32b8('0x39')](_0x10f17e[_0x32b8('0x3a')],{})[_0x32b8('0x23')](respondWithResult(_0x5e8af2,0xc9))[_0x32b8('0x38')](handleError(_0x5e8af2,null));};exports[_0x32b8('0x21')]=function(_0x4c9ab0,_0x152209){if(_0x4c9ab0[_0x32b8('0x3a')]['id']){delete _0x4c9ab0[_0x32b8('0x3a')]['id'];}return db['ChatProactiveAction'][_0x32b8('0x37')]({'where':{'id':_0x4c9ab0['params']['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x152209,null))[_0x32b8('0x23')](saveUpdates(_0x4c9ab0[_0x32b8('0x3a')],null))[_0x32b8('0x23')](respondWithResult(_0x152209,null))['catch'](handleError(_0x152209,null));};exports[_0x32b8('0x22')]=function(_0x10ccf5,_0x2d586f){return db['ChatProactiveAction']['find']({'where':{'id':_0x10ccf5[_0x32b8('0x29')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x2d586f,null))[_0x32b8('0x23')](removeEntity(_0x2d586f,null))['catch'](handleError(_0x2d586f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 2ced68b..0f42f60 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 _0x63cd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','lodash','util'];(function(_0x546e3b,_0x1d6b2b){var _0x331189=function(_0x1458ca){while(--_0x1458ca){_0x546e3b['push'](_0x546e3b['shift']());}};_0x331189(++_0x1d6b2b);}(_0x63cd,0x166));var _0xd63c=function(_0x8ebbc2,_0xab414a){_0x8ebbc2=_0x8ebbc2-0x0;var _0x2fc072=_0x63cd[_0x8ebbc2];return _0x2fc072;};'use strict';var _=require(_0xd63c('0x0'));var util=require(_0xd63c('0x1'));var logger=require(_0xd63c('0x2'))(_0xd63c('0x3'));var moment=require(_0xd63c('0x4'));var BPromise=require(_0xd63c('0x5'));var rp=require(_0xd63c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd63c('0x7'));var config=require(_0xd63c('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xd63c('0x9')]=function(_0x976082,_0x4005c0){return _0x976082['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb946=['../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','moment','bluebird','request-promise'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0xb946,0xd7));var _0x6b94=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xb946[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x6b94('0x0'));var util=require(_0x6b94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b94('0x2'));var BPromise=require(_0x6b94('0x3'));var rp=require(_0x6b94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b94('0x5'));var attributes=require(_0x6b94('0x6'));module[_0x6b94('0x7')]=function(_0x57880e,_0x58372b){return _0x57880e[_0x6b94('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x6b94('0x9'),'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 ab5aba6..28d3426 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 _0x4012=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x516738,_0x1e0210){var _0x5f5d4d=function(_0x5a061e){while(--_0x5a061e){_0x516738['push'](_0x516738['shift']());}};_0x5f5d4d(++_0x1e0210);}(_0x4012,0xd6));var _0x2401=function(_0x130c86,_0x18bb4e){_0x130c86=_0x130c86-0x0;var _0x4f673d=_0x4012[_0x130c86];return _0x4f673d;};'use strict';var _=require(_0x2401('0x0'));var util=require('util');var moment=require(_0x2401('0x1'));var BPromise=require(_0x2401('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require(_0x2401('0x6'))(_0x2401('0x7'));var config=require(_0x2401('0x8'));var jayson=require(_0x2401('0x9'));var client=jayson[_0x2401('0xa')][_0x2401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x85f35f,_0x184814,_0x245b35){return new BPromise(function(_0x267711,_0x1fb21f){return client[_0x2401('0xc')](_0x85f35f,_0x245b35)[_0x2401('0xd')](function(_0x4e621c){logger['info'](_0x2401('0xe'),_0x184814,'request\x20sent');logger['debug'](_0x2401('0xf'),_0x184814,_0x2401('0x10'),JSON[_0x2401('0x11')](_0x4e621c));if(_0x4e621c[_0x2401('0x12')]){if(_0x4e621c[_0x2401('0x12')][_0x2401('0x13')]===0x1f4){logger[_0x2401('0x12')](_0x2401('0xe'),_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x1fb21f(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x267711(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}else{logger[_0x2401('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2401('0x10'));_0x267711(_0x4e621c[_0x2401('0x16')][_0x2401('0x14')]);}})[_0x2401('0x17')](function(_0x2fcca1){logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2fcca1);_0x1fb21f(_0x2fcca1);});});} \ No newline at end of file +var _0x7a43=['../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1a9cec,_0x3bf353){var _0x2fa7ef=function(_0x20cc8a){while(--_0x20cc8a){_0x1a9cec['push'](_0x1a9cec['shift']());}};_0x2fa7ef(++_0x3bf353);}(_0x7a43,0x18a));var _0x37a4=function(_0x12fff4,_0x1be32d){_0x12fff4=_0x12fff4-0x0;var _0x5b155a=_0x7a43[_0x12fff4];return _0x5b155a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37a4('0x0'));var BPromise=require(_0x37a4('0x1'));var rs=require(_0x37a4('0x2'));var fs=require('fs');var Redis=require(_0x37a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37a4('0x4'))(_0x37a4('0x5'));var config=require(_0x37a4('0x6'));var jayson=require(_0x37a4('0x7'));var client=jayson['client'][_0x37a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45b055,_0x4481b4,_0xc1e2ee){return new BPromise(function(_0x56aeb5,_0x389b73){return client['request'](_0x45b055,_0xc1e2ee)[_0x37a4('0x9')](function(_0xb36395){logger[_0x37a4('0xa')](_0x37a4('0xb'),_0x4481b4,_0x37a4('0xc'));logger[_0x37a4('0xd')](_0x37a4('0xe'),_0x4481b4,_0x37a4('0xc'),JSON['stringify'](_0xb36395));if(_0xb36395[_0x37a4('0xf')]){if(_0xb36395[_0x37a4('0xf')][_0x37a4('0x10')]===0x1f4){logger['error'](_0x37a4('0xb'),_0x4481b4,_0xb36395[_0x37a4('0xf')][_0x37a4('0x11')]);return _0x389b73(_0xb36395['error'][_0x37a4('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4481b4,_0xb36395[_0x37a4('0xf')][_0x37a4('0x11')]);return _0x56aeb5(_0xb36395[_0x37a4('0xf')]['message']);}else{logger[_0x37a4('0xa')](_0x37a4('0xb'),_0x4481b4,'request\x20sent');_0x56aeb5(_0xb36395[_0x37a4('0x12')][_0x37a4('0x11')]);}})[_0x37a4('0x13')](function(_0x24fa87){logger[_0x37a4('0xf')](_0x37a4('0xb'),_0x4481b4,_0x24fa87);_0x389b73(_0x24fa87);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index a28ad93..1a2b37b 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c4c6a,_0x5802dc){_0x3c4c6a=_0x3c4c6a-0x0;var _0x123872=_0x2bd8[_0x3c4c6a];return _0x123872;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router; \ No newline at end of file +var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4840f9,_0x734785){_0x4840f9=_0x4840f9-0x0;var _0x4856ff=_0xb4c7[_0x4840f9];return _0x4856ff;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('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 0f15505..246348e 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 _0x9dd0=['ENUM','beepall','exports','STRING','INTEGER'];(function(_0x208c57,_0x3182e5){var _0x1dda31=function(_0x49e35c){while(--_0x49e35c){_0x208c57['push'](_0x208c57['shift']());}};_0x1dda31(++_0x3182e5);}(_0x9dd0,0x7f));var _0x09dd=function(_0x23c31d,_0x2e8382){_0x23c31d=_0x23c31d-0x0;var _0x4c8e11=_0x9dd0[_0x23c31d];return _0x4c8e11;};'use strict';var Sequelize=require('sequelize');module[_0x09dd('0x0')]={'name':{'type':Sequelize[_0x09dd('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x09dd('0x1')]},'timeout':{'type':Sequelize[_0x09dd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x09dd('0x3')]('rrmemory',_0x09dd('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x85c9=['rrmemory','roundrobin','sequelize','exports','name','STRING'];(function(_0x1763ac,_0x17cb2f){var _0x1c55a9=function(_0x5ed9e4){while(--_0x5ed9e4){_0x1763ac['push'](_0x1763ac['shift']());}};_0x1c55a9(++_0x17cb2f);}(_0x85c9,0x8c));var _0x985c=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x85c9[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x985c('0x0'));module[_0x985c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x985c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x985c('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x985c('0x4'),'beepall',_0x985c('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b57cae4..3094ea8 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 _0x1fa3=['role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','ChatQueueId','options','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','emit','userChatQueue:save','Team','findAll','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','ids','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','undefined','limit','count','offset','Content-Range','json','reject','update','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xa1cdd9,_0x32bc4b){var _0x82f482=function(_0x5e265c){while(--_0x5e265c){_0xa1cdd9['push'](_0xa1cdd9['shift']());}};_0x82f482(++_0x32bc4b);}(_0x1fa3,0xcf));var _0x31fa=function(_0x5c41cb,_0x330705){_0x5c41cb=_0x5c41cb-0x0;var _0x49db41=_0x1fa3[_0x5c41cb];return _0x49db41;};'use strict';var emlformat=require(_0x31fa('0x0'));var rimraf=require(_0x31fa('0x1'));var zipdir=require(_0x31fa('0x2'));var jsonpatch=require(_0x31fa('0x3'));var rp=require(_0x31fa('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x31fa('0x5'));var csv=require(_0x31fa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31fa('0x7'));var _=require(_0x31fa('0x8'));var squel=require(_0x31fa('0x9'));var crypto=require('crypto');var jsforce=require(_0x31fa('0xa'));var deskjs=require(_0x31fa('0xb'));var toCsv=require(_0x31fa('0x6'));var querystring=require(_0x31fa('0xc'));var Papa=require(_0x31fa('0xd'));var Redis=require(_0x31fa('0xe'));var authService=require(_0x31fa('0xf'));var qs=require(_0x31fa('0x10'));var as=require(_0x31fa('0x11'));var hardwareService=require(_0x31fa('0x12'));var logger=require(_0x31fa('0x13'))('api');var utils=require(_0x31fa('0x14'));var config=require(_0x31fa('0x15'));var licenseUtil=require(_0x31fa('0x16'));var db=require(_0x31fa('0x17'))['db'];config[_0x31fa('0x18')]=_[_0x31fa('0x19')](config[_0x31fa('0x18')],{'host':_0x31fa('0x1a'),'port':0x18eb});var socket=require(_0x31fa('0x1b'))(new Redis(config[_0x31fa('0x18')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x31fa('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x401e98,_0x437c87,_0x446b0f,_0x5d3e2f){return new BPromise(function(_0x185f94,_0x51baf2){var _0x16205d=_0x5d3e2f||client;return _0x16205d['request'](_0x401e98,_0x446b0f)[_0x31fa('0x1d')](function(_0x49d4a0){logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,'request\x20sent');logger[_0x31fa('0x20')](_0x31fa('0x21'),_0x437c87,'request\x20sent',JSON[_0x31fa('0x22')](_0x49d4a0));if(_0x49d4a0['error']){if(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x24')]===0x1f4){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);return _0x51baf2(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);}logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0['error'][_0x31fa('0x25')]);return _0x185f94(_0x49d4a0[_0x31fa('0x23')]['message']);}else{logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,_0x31fa('0x26'));_0x185f94(_0x49d4a0['result'][_0x31fa('0x25')]);}})[_0x31fa('0x27')](function(_0x510825){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x510825);_0x51baf2(_0x510825);});});}function respondWithStatusCode(_0x2d3c06,_0xd4837){_0xd4837=_0xd4837||0xcc;return function(_0x1b4950){if(_0x1b4950){return _0x2d3c06['sendStatus'](_0xd4837);}return _0x2d3c06[_0x31fa('0x28')](_0xd4837)['end']();};}function respondWithResult(_0x366bc0,_0x1f45db){_0x1f45db=_0x1f45db||0xc8;return function(_0x58b166){if(_0x58b166){return _0x366bc0[_0x31fa('0x28')](_0x1f45db)['json'](_0x58b166);}};}function respondWithFilteredResult(_0xac980c,_0x29fea9){return function(_0x4f2c8e){if(_0x4f2c8e){var _0xa35143=typeof _0x29fea9['offset']===_0x31fa('0x29')&&typeof _0x29fea9[_0x31fa('0x2a')]===_0x31fa('0x29');var _0x1dea52=_0x4f2c8e[_0x31fa('0x2b')];var _0x4bac6b=_0xa35143?0x0:_0x29fea9[_0x31fa('0x2c')];var _0x48db78=_0xa35143?_0x4f2c8e['count']:_0x29fea9[_0x31fa('0x2c')]+_0x29fea9[_0x31fa('0x2a')];var _0x54359e;if(_0x48db78>=_0x1dea52){_0x48db78=_0x1dea52;_0x54359e=0xc8;}else{_0x54359e=0xce;}_0xac980c[_0x31fa('0x28')](_0x54359e);return _0xac980c['set'](_0x31fa('0x2d'),_0x4bac6b+'-'+_0x48db78+'/'+_0x1dea52)[_0x31fa('0x2e')](_0x4f2c8e);}return null;};}function patchUpdates(_0x2c1371){return function(_0xd208){try{jsonpatch['apply'](_0xd208,_0x2c1371,!![]);}catch(_0x3bd6f7){return BPromise[_0x31fa('0x2f')](_0x3bd6f7);}return _0xd208['save']();};}function saveUpdates(_0x417a79,_0x3043ab){return function(_0x28bbbd){if(_0x28bbbd){return _0x28bbbd[_0x31fa('0x30')](_0x417a79)[_0x31fa('0x1d')](function(_0x30acc7){return _0x30acc7;});}return null;};}function removeEntity(_0x46590d,_0x3b3875){return function(_0x46cbe1){if(_0x46cbe1){return _0x46cbe1['destroy']()[_0x31fa('0x1d')](function(){var _0x16ea82=_0x46cbe1[_0x31fa('0x31')]({'plain':!![]});var _0x138ac7='ChatQueues';return db[_0x31fa('0x32')]['destroy']({'where':{'type':_0x138ac7,'resourceId':_0x16ea82['id']}})[_0x31fa('0x1d')](function(){return _0x46cbe1;});})[_0x31fa('0x1d')](function(){_0x46590d[_0x31fa('0x28')](0xcc)[_0x31fa('0x33')]();});}};}function handleEntityNotFound(_0x21c514,_0x479034){return function(_0x3eae3a){if(!_0x3eae3a){_0x21c514['sendStatus'](0x194);}return _0x3eae3a;};}function handleError(_0x2d1064,_0x5df9e5){_0x5df9e5=_0x5df9e5||0x1f4;return function(_0x55d4a7){logger[_0x31fa('0x23')](_0x55d4a7[_0x31fa('0x34')]);if(_0x55d4a7[_0x31fa('0x35')]){delete _0x55d4a7[_0x31fa('0x35')];}_0x2d1064[_0x31fa('0x28')](_0x5df9e5)[_0x31fa('0x36')](_0x55d4a7);};}exports[_0x31fa('0x37')]=function(_0x2e4770,_0x462bdd){var _0x5b82e5={},_0x570429={},_0x294af8={'count':0x0,'rows':[]};var _0x59ac71=_[_0x31fa('0x38')](db['ChatQueue'][_0x31fa('0x39')],function(_0x5c5af8){return{'name':_0x5c5af8[_0x31fa('0x3a')],'type':_0x5c5af8[_0x31fa('0x3b')][_0x31fa('0x3c')]};});_0x570429['model']=_['map'](_0x59ac71,_0x31fa('0x35'));_0x570429[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x2e4770[_0x31fa('0x3d')]);_0x570429[_0x31fa('0x3f')]=_['intersection'](_0x570429[_0x31fa('0x40')],_0x570429[_0x31fa('0x3d')]);_0x5b82e5[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x570429[_0x31fa('0x40')],qs['fields'](_0x2e4770['query'][_0x31fa('0x43')]));_0x5b82e5[_0x31fa('0x41')]=_0x5b82e5[_0x31fa('0x41')][_0x31fa('0x44')]?_0x5b82e5[_0x31fa('0x41')]:_0x570429[_0x31fa('0x40')];if(!_0x2e4770['query'][_0x31fa('0x45')](_0x31fa('0x46'))){_0x5b82e5['limit']=qs[_0x31fa('0x2a')](_0x2e4770['query'][_0x31fa('0x2a')]);_0x5b82e5['offset']=qs[_0x31fa('0x2c')](_0x2e4770[_0x31fa('0x3d')]['offset']);}_0x5b82e5[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2e4770[_0x31fa('0x3d')]['sort']);_0x5b82e5[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x2e4770[_0x31fa('0x3d')],_0x570429[_0x31fa('0x3f')]),_0x59ac71);if(_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5b82e5[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5b82e5['where'],{'$or':_[_0x31fa('0x38')](_0x59ac71,function(_0x35ff28){if(_0x35ff28[_0x31fa('0x3b')]!==_0x31fa('0x4d')){var _0x6d648d={};_0x6d648d[_0x35ff28[_0x31fa('0x35')]]={'$like':'%'+_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x6d648d;}})});}_0x5b82e5=_[_0x31fa('0x4c')]({},_0x5b82e5,_0x2e4770['options']);var _0x2456b1={'where':_0x5b82e5['where']};return db[_0x31fa('0x4e')][_0x31fa('0x2b')](_0x2456b1)[_0x31fa('0x1d')](function(_0x25e051){_0x294af8[_0x31fa('0x2b')]=_0x25e051;if(_0x2e4770['query'][_0x31fa('0x4f')]){_0x5b82e5[_0x31fa('0x50')]=[{'all':!![]}];}return db[_0x31fa('0x4e')]['findAll'](_0x5b82e5);})[_0x31fa('0x1d')](function(_0x22746d){_0x294af8[_0x31fa('0x51')]=_0x22746d;return _0x294af8;})[_0x31fa('0x1d')](respondWithFilteredResult(_0x462bdd,_0x5b82e5))[_0x31fa('0x27')](handleError(_0x462bdd,null));};exports[_0x31fa('0x52')]=function(_0x5d72ef,_0x33f48b){var _0x44bba0={'raw':!![],'where':{'id':_0x5d72ef[_0x31fa('0x53')]['id']}},_0x398fe1={};_0x398fe1[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x4e')][_0x31fa('0x39')]);_0x398fe1['query']=_['keys'](_0x5d72ef['query']);_0x398fe1['filters']=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],_0x398fe1['query']);_0x44bba0[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x5d72ef['query'][_0x31fa('0x43')]));_0x44bba0[_0x31fa('0x41')]=_0x44bba0[_0x31fa('0x41')][_0x31fa('0x44')]?_0x44bba0[_0x31fa('0x41')]:_0x398fe1[_0x31fa('0x40')];if(_0x5d72ef['query'][_0x31fa('0x4f')]){_0x44bba0[_0x31fa('0x50')]=[{'all':!![]}];}_0x44bba0=_[_0x31fa('0x4c')]({},_0x44bba0,_0x5d72ef['options']);return db[_0x31fa('0x4e')][_0x31fa('0x54')](_0x44bba0)[_0x31fa('0x1d')](handleEntityNotFound(_0x33f48b,null))[_0x31fa('0x1d')](respondWithResult(_0x33f48b,null))[_0x31fa('0x27')](handleError(_0x33f48b,null));};exports[_0x31fa('0x55')]=function(_0x2189d8,_0x4b4101){return db[_0x31fa('0x4e')][_0x31fa('0x55')](_0x2189d8[_0x31fa('0x56')],{})[_0x31fa('0x1d')](function(_0x36e194){var _0x1986c8=_0x2189d8[_0x31fa('0x57')][_0x31fa('0x31')]({'plain':!![]});if(!_0x1986c8)throw new Error(_0x31fa('0x58'));if(_0x1986c8[_0x31fa('0x59')]==='user'){var _0x2cdcc4=_0x36e194['get']({'plain':!![]});var _0x3928c2='ChatQueues';return db['UserProfileSection'][_0x31fa('0x54')]({'where':{'name':_0x3928c2,'userProfileId':_0x1986c8['userProfileId']},'raw':!![]})[_0x31fa('0x1d')](function(_0x392fd7){if(_0x392fd7&&_0x392fd7[_0x31fa('0x5a')]===0x0){return db[_0x31fa('0x32')][_0x31fa('0x55')]({'name':_0x2cdcc4[_0x31fa('0x35')],'resourceId':_0x2cdcc4['id'],'type':_0x392fd7[_0x31fa('0x35')],'sectionId':_0x392fd7['id']},{})[_0x31fa('0x1d')](function(){return _0x36e194;});}else{return _0x36e194;}})['catch'](function(_0x20547d){logger['error'](_0x31fa('0x5b'),_0x20547d);throw _0x20547d;});}return _0x36e194;})[_0x31fa('0x1d')](respondWithResult(_0x4b4101,0xc9))[_0x31fa('0x27')](handleError(_0x4b4101,null));};exports[_0x31fa('0x30')]=function(_0x109ab9,_0x5ecdea){if(_0x109ab9[_0x31fa('0x56')]['id']){delete _0x109ab9[_0x31fa('0x56')]['id'];}return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x109ab9[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x5ecdea,null))[_0x31fa('0x1d')](saveUpdates(_0x109ab9[_0x31fa('0x56')],null))['then'](respondWithResult(_0x5ecdea,null))['catch'](handleError(_0x5ecdea,null));};exports['destroy']=function(_0x5c26f0,_0x54573e){return db[_0x31fa('0x4e')]['find']({'where':{'id':_0x5c26f0[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x54573e,null))['then'](removeEntity(_0x54573e,null))['catch'](handleError(_0x54573e,null));};exports[_0x31fa('0x5c')]=function(_0x27672a,_0x5f3240){return db[_0x31fa('0x4e')][_0x31fa('0x5c')]()[_0x31fa('0x1d')](respondWithResult(_0x5f3240,null))['catch'](handleError(_0x5f3240,null));};exports['getMembers']=function(_0x2d9fff,_0x1891ff,_0x125452){var _0x5cb8ab={'raw':!![],'where':{}},_0x2885d2={},_0x5bb2e7;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x2d9fff[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x1891ff,null))[_0x31fa('0x1d')](function(_0x1bfff0){if(_0x1bfff0){_0x5bb2e7=_0x1bfff0[_0x31fa('0x31')]({'plain':!![]});_0x2885d2[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['UserChatQueue'][_0x31fa('0x39')]);_0x2885d2['query']=_[_0x31fa('0x3e')](_0x2d9fff[_0x31fa('0x3d')]);_0x2885d2[_0x31fa('0x3f')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],_0x2885d2[_0x31fa('0x3d')]);_0x5cb8ab[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x5cb8ab[_0x31fa('0x41')]=_0x5cb8ab['attributes'][_0x31fa('0x44')]?_0x5cb8ab['attributes']:_0x2885d2[_0x31fa('0x40')];if(!_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x45')]('nolimit')){_0x5cb8ab[_0x31fa('0x2a')]=qs['limit'](_0x2d9fff['query'][_0x31fa('0x2a')]);_0x5cb8ab[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x2c')]);}_0x5cb8ab[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2d9fff[_0x31fa('0x3d')]['sort']);_0x5cb8ab[_0x31fa('0x49')]=qs['filters'](_[_0x31fa('0x4a')](_0x2d9fff['query'],_0x2885d2[_0x31fa('0x3f')]));_0x5cb8ab[_0x31fa('0x49')][_0x31fa('0x5e')]=_0x1bfff0['id'];if(_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5cb8ab[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5cb8ab[_0x31fa('0x49')],{'$or':_['map'](_0x5cb8ab[_0x31fa('0x41')],function(_0x30e66d){var _0x5b0ed5={};_0x5b0ed5[_0x30e66d]={'$like':'%'+_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x5b0ed5;})});}_0x5cb8ab=_[_0x31fa('0x4c')]({},_0x5cb8ab,_0x2d9fff[_0x31fa('0x5f')]);return db['UserChatQueue']['findAll'](_0x5cb8ab);}})['then'](function(_0x4b1070){if(_0x4b1070){return db['User']['findAndCountAll']({'where':{'id':_[_0x31fa('0x38')](_0x4b1070,_0x31fa('0x60')),'role':_0x31fa('0x61')},'attributes':['id',_0x31fa('0x35'),_0x31fa('0x62'),_0x31fa('0x63'),_0x31fa('0x64')]});}})[_0x31fa('0x1d')](function(_0x16358d){if(_0x16358d){return{'count':_0x16358d[_0x31fa('0x2b')],'rows':_[_0x31fa('0x38')](_0x16358d[_0x31fa('0x51')],function(_0x2b25f2){return{'membername':_0x2b25f2[_0x31fa('0x35')],'UserId':_0x2b25f2['id'],'queue_name':_0x5bb2e7[_0x31fa('0x35')],'ChatQueueId':_0x5bb2e7['id'],'interface':util[_0x31fa('0x65')](_0x31fa('0x66'),_0x31fa('0x67'),_0x2b25f2['name']),'penalty':0x0,'paused':_0x2b25f2['chatPause'],'createdAt':_0x2b25f2[_0x31fa('0x64')],'updatedAt':_0x2b25f2[_0x31fa('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31fa('0x1d')](respondWithFilteredResult(_0x1891ff,_0x5cb8ab))[_0x31fa('0x27')](handleError(_0x1891ff,null));};exports['getTeams']=function(_0x1861a2,_0x13a441,_0x30afbf){var _0x587a5c={};var _0xaf25c1={};var _0xf08321;var _0x5ac64b;return db[_0x31fa('0x4e')]['findOne']({'where':{'id':_0x1861a2[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x13a441,null))[_0x31fa('0x1d')](function(_0x166b52){if(_0x166b52){_0xf08321=_0x166b52;_0xaf25c1[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['Team']['rawAttributes']);_0xaf25c1[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x1861a2['query']);_0xaf25c1['filters']=_['intersection'](_0xaf25c1[_0x31fa('0x40')],_0xaf25c1[_0x31fa('0x3d')]);_0x587a5c['attributes']=_[_0x31fa('0x42')](_0xaf25c1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x587a5c[_0x31fa('0x41')]=_0x587a5c['attributes'][_0x31fa('0x44')]?_0x587a5c[_0x31fa('0x41')]:_0xaf25c1[_0x31fa('0x40')];_0x587a5c[_0x31fa('0x47')]=qs['sort'](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x587a5c['where']=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x1861a2['query'],_0xaf25c1[_0x31fa('0x3f')]));if(_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x587a5c[_0x31fa('0x49')]=_['merge'](_0x587a5c[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x587a5c['attributes'],function(_0x355977){var _0x227a1d={};_0x227a1d[_0x355977]={'$like':'%'+_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x227a1d;})});}_0x587a5c=_[_0x31fa('0x4c')]({},_0x587a5c,_0x1861a2[_0x31fa('0x5f')]);return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3005c1){if(_0x3005c1){_0x5ac64b=_0x3005c1[_0x31fa('0x44')];if(!_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x587a5c[_0x31fa('0x2a')]=qs[_0x31fa('0x2a')](_0x1861a2[_0x31fa('0x3d')]['limit']);_0x587a5c[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x1861a2[_0x31fa('0x3d')]['offset']);}return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3c59c4){if(_0x3c59c4){return _0x3c59c4?{'count':_0x5ac64b,'rows':_0x3c59c4}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x13a441,null))[_0x31fa('0x27')](handleError(_0x13a441,null));};exports[_0x31fa('0x69')]=function(_0x3a96c7,_0x1de1c3,_0x4b8bb6){var _0x5eb67b=_0x3a96c7['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x5eb67b},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':_0x31fa('0x6b'),'attributes':['id',_0x31fa('0x35'),_0x31fa('0x6c'),_0x31fa('0x6d'),_0x31fa('0x6e')],'raw':!![]}]})['then'](function(_0x43b31c){if(_0x43b31c){var _0x46d9cf=_[_0x31fa('0x6f')](_0x43b31c,function(_0x1070fc){var _0x1d760e=_0x1070fc[_0x31fa('0x31')]({'plain':!![]});return _0x1d760e[_0x31fa('0x6b')];});return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x3a96c7[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](function(_0xc73174){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x4dddc7){return _0xc73174['addTeams'](_0x5eb67b,{'transaction':_0x4dddc7})[_0x31fa('0x1d')](function(){return BPromise[_0x31fa('0x72')](_0x46d9cf,function(_0x14a4f7){return db[_0x31fa('0x73')][_0x31fa('0x74')]({'where':{'UserId':_0x14a4f7['id'],'ChatQueueId':_0x3a96c7[_0x31fa('0x53')]['id']},'transaction':_0x4dddc7});});})[_0x31fa('0x1d')](function(){_0x46d9cf['forEach'](function(_0x188e57){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':_0x188e57['id'],'ChatQueueId':_0xc73174['id']});});});});});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x1de1c3,null))[_0x31fa('0x27')](handleError(_0x1de1c3,null));};exports['removeTeams']=function(_0x3a8abe,_0x17c106,_0x1e7996){return db[_0x31fa('0x77')][_0x31fa('0x78')]({'where':{'id':_0x3a8abe['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x17c106,null))['then'](function(_0x2b6714){var _0x576036=_[_0x31fa('0x38')](_0x2b6714,'id');var _0x2a2acc=[];var _0x44cf62=[];var _0x3d3395=squel['select']();_0x3d3395[_0x31fa('0x79')](_0x31fa('0x7a'))[_0x31fa('0x7b')](_0x31fa('0x7c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x31fa('0x49')](_0x31fa('0x7d'),_0x3a8abe['params']['id']);for(var _0x85a503=0x0;_0x85a503<_0x2b6714[_0x31fa('0x44')];_0x85a503+=0x1){let _0x2a8318=_0x2b6714[_0x85a503];for(var _0x5de66c=0x0;_0x5de66c<_0x2a8318['Agents']['length'];_0x5de66c+=0x1){let _0x32d0de=_0x2a8318['Agents'][_0x5de66c];var _0x4a7371=_0x3d3395[_0x31fa('0x7e')]();_0x4a7371[_0x31fa('0x49')](_0x31fa('0x7f'),_0x32d0de['id']);_0x44cf62[_0x31fa('0x80')](db[_0x31fa('0x70')][_0x31fa('0x3d')](_0x4a7371[_0x31fa('0x81')](),{'type':db[_0x31fa('0x70')][_0x31fa('0x82')][_0x31fa('0x83')]})['then'](function(_0x58ea0c){if(_0x58ea0c[_0x31fa('0x44')]===0x1){return _0x32d0de['id'];}else{var _0xa51f08=_[_0x31fa('0x84')](_[_0x31fa('0x38')](_0x58ea0c,_0x31fa('0x85')),function(_0x2b97b3){return _[_0x31fa('0x86')](_0x576036,_0x2b97b3);});if(_0xa51f08){return _0x32d0de['id'];}}}));}}return BPromise[_0x31fa('0x87')](_0x44cf62)[_0x31fa('0x1d')](function(_0x3d1ba7){_0x2a2acc=_(_0x2a2acc)[_0x31fa('0x88')](_0x3d1ba7)[_0x31fa('0x89')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x3a8abe[_0x31fa('0x53')]['id']}})['then'](function(_0x2a88b4){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x5905a1){return _0x2a88b4[_0x31fa('0x8a')](_0x3a8abe[_0x31fa('0x3d')][_0x31fa('0x8b')],{'transaction':_0x5905a1})[_0x31fa('0x1d')](function(){if(!_['isEmpty'](_0x2a2acc)){return _0x2a88b4[_0x31fa('0x8c')](_0x2a2acc,{'transaction':_0x5905a1});}})[_0x31fa('0x1d')](function(){_0x2a2acc[_0x31fa('0x8d')](function(_0xe8ff14){socket[_0x31fa('0x75')](_0x31fa('0x8e'),{'UserId':_0xe8ff14,'ChatQueueId':_0x2a88b4['id']});});});});});});})['then'](respondWithStatusCode(_0x17c106,null))[_0x31fa('0x27')](handleError(_0x17c106,null));};exports[_0x31fa('0x8f')]=function(_0x58328c,_0x33f6f7,_0x507b76){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x58328c[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x33f6f7,null))[_0x31fa('0x1d')](function(_0x492765){if(_0x492765){return _0x492765[_0x31fa('0x8f')](_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')],_[_0x31fa('0x90')](_0x58328c[_0x31fa('0x56')],[_0x31fa('0x8b'),'id'])||{})[_0x31fa('0x91')](function(_0x2310fc){for(var _0x2e57da=0x0;_0x2e57da<_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')][_0x31fa('0x44')];_0x2e57da+=0x1){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':Number(_0x58328c['body'][_0x31fa('0x8b')][_0x2e57da]),'ChatQueueId':Number(_0x58328c[_0x31fa('0x53')]['id'])});}return _0x2310fc;});}})[_0x31fa('0x1d')](respondWithResult(_0x33f6f7,null))[_0x31fa('0x27')](handleError(_0x33f6f7,null));};exports[_0x31fa('0x8c')]=function(_0x5bcbab,_0x34647e,_0x3032e6){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x5bcbab[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x34647e,null))[_0x31fa('0x1d')](function(_0x3211fa){if(_0x3211fa){return _0x3211fa[_0x31fa('0x8c')](_0x5bcbab['query'][_0x31fa('0x8b')])[_0x31fa('0x1d')](function(){if(_[_0x31fa('0x92')](_0x5bcbab[_0x31fa('0x3d')]['ids'])){for(var _0x200ec3=0x0;_0x200ec3<_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]['length'];_0x200ec3+=0x1){socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab['query'][_0x31fa('0x8b')][_0x200ec3]),'ChatQueueId':Number(_0x5bcbab['params']['id'])});}}else{socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]),'ChatQueueId':Number(_0x5bcbab[_0x31fa('0x53')]['id'])});}});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x34647e,null))[_0x31fa('0x27')](handleError(_0x34647e,null));};exports[_0x31fa('0x93')]=function(_0x32e5f4,_0x5027ac,_0x2a2daf){var _0x2e85cc={};var _0x40d189={};var _0x4d709a;var _0x1bb3e1;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x32e5f4[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x5027ac,null))[_0x31fa('0x1d')](function(_0x36331b){if(_0x36331b){_0x4d709a=_0x36331b;_0x40d189[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x6a')][_0x31fa('0x39')]);_0x40d189[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x32e5f4[_0x31fa('0x3d')]);_0x40d189['filters']=_[_0x31fa('0x42')](_0x40d189[_0x31fa('0x40')],_0x40d189[_0x31fa('0x3d')]);_0x2e85cc['attributes']=_['intersection'](_0x40d189[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x2e85cc['attributes']=_0x2e85cc[_0x31fa('0x41')][_0x31fa('0x44')]?_0x2e85cc[_0x31fa('0x41')]:_0x40d189[_0x31fa('0x40')];_0x2e85cc[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x2e85cc[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x32e5f4[_0x31fa('0x3d')],_0x40d189[_0x31fa('0x3f')]));if(_0x32e5f4['query'][_0x31fa('0x4b')]){_0x2e85cc[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x2e85cc[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x2e85cc[_0x31fa('0x41')],function(_0x1eb988){var _0xce1aca={};_0xce1aca[_0x1eb988]={'$like':'%'+_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0xce1aca;})});}_0x2e85cc=_['merge']({},_0x2e85cc,_0x32e5f4['options']);return _0x4d709a['getAgents'](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x486ce8){if(_0x486ce8){_0x1bb3e1=_0x486ce8[_0x31fa('0x44')];if(!_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x2e85cc['limit']=qs[_0x31fa('0x2a')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x2a')]);_0x2e85cc[_0x31fa('0x2c')]=qs['offset'](_0x32e5f4[_0x31fa('0x3d')]['offset']);}return _0x4d709a[_0x31fa('0x93')](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x197d05){if(_0x197d05){return _0x197d05?{'count':_0x1bb3e1,'rows':_0x197d05}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x5027ac,null))[_0x31fa('0x27')](handleError(_0x5027ac,null));}; \ No newline at end of file +var _0xb884=['addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','ChatQueues','UserProfileResource','end','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','ChatQueue','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','pick','ChatQueueId','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','transaction','removeAgents','userChatQueue:remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb884,0x9b));var _0x4b88=function(_0x450a0d,_0x21839f){_0x450a0d=_0x450a0d-0x0;var _0x41e651=_0xb884[_0x450a0d];return _0x41e651;};'use strict';var emlformat=require(_0x4b88('0x0'));var rimraf=require(_0x4b88('0x1'));var zipdir=require(_0x4b88('0x2'));var jsonpatch=require(_0x4b88('0x3'));var rp=require(_0x4b88('0x4'));var moment=require(_0x4b88('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b88('0x6'));var sox=require(_0x4b88('0x7'));var csv=require(_0x4b88('0x8'));var ejs=require(_0x4b88('0x9'));var fs=require('fs');var fs_extra=require(_0x4b88('0xa'));var _=require(_0x4b88('0xb'));var squel=require(_0x4b88('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b88('0xd'));var deskjs=require(_0x4b88('0xe'));var toCsv=require(_0x4b88('0x8'));var querystring=require(_0x4b88('0xf'));var Papa=require(_0x4b88('0x10'));var Redis=require('ioredis');var authService=require(_0x4b88('0x11'));var qs=require(_0x4b88('0x12'));var as=require(_0x4b88('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b88('0x14'))(_0x4b88('0x15'));var utils=require('../../config/utils');var config=require(_0x4b88('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4b88('0x17')]=_['defaults'](config['redis'],{'host':_0x4b88('0x18'),'port':0x18eb});var socket=require(_0x4b88('0x19'))(new Redis(config[_0x4b88('0x17')]));require(_0x4b88('0x1a'))['register'](socket);var jayson=require(_0x4b88('0x1b'));var client=jayson[_0x4b88('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19e93c,_0x2d1d5d,_0x50e018,_0xe21a84){return new BPromise(function(_0x368a7e,_0x269e43){var _0x3a060e=_0xe21a84||client;return _0x3a060e[_0x4b88('0x1d')](_0x19e93c,_0x50e018)['then'](function(_0x419724){logger[_0x4b88('0x1e')](_0x4b88('0x1f'),_0x2d1d5d,'request\x20sent');logger['debug'](_0x4b88('0x20'),_0x2d1d5d,_0x4b88('0x21'),JSON[_0x4b88('0x22')](_0x419724));if(_0x419724['error']){if(_0x419724[_0x4b88('0x23')][_0x4b88('0x24')]===0x1f4){logger[_0x4b88('0x23')](_0x4b88('0x1f'),_0x2d1d5d,_0x419724['error']['message']);return _0x269e43(_0x419724[_0x4b88('0x23')][_0x4b88('0x25')]);}logger['error'](_0x4b88('0x1f'),_0x2d1d5d,_0x419724[_0x4b88('0x23')][_0x4b88('0x25')]);return _0x368a7e(_0x419724[_0x4b88('0x23')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2d1d5d,_0x4b88('0x21'));_0x368a7e(_0x419724[_0x4b88('0x26')][_0x4b88('0x25')]);}})['catch'](function(_0x46b052){logger[_0x4b88('0x23')](_0x4b88('0x1f'),_0x2d1d5d,_0x46b052);_0x269e43(_0x46b052);});});}function respondWithStatusCode(_0x56b038,_0xaa27ba){_0xaa27ba=_0xaa27ba||0xcc;return function(_0x5bfbfd){if(_0x5bfbfd){return _0x56b038['sendStatus'](_0xaa27ba);}return _0x56b038['status'](_0xaa27ba)['end']();};}function respondWithResult(_0x22d236,_0x37bdee){_0x37bdee=_0x37bdee||0xc8;return function(_0x3abc50){if(_0x3abc50){return _0x22d236['status'](_0x37bdee)[_0x4b88('0x27')](_0x3abc50);}};}function respondWithFilteredResult(_0xa5643,_0x3c5aa9){return function(_0xb6e8c4){if(_0xb6e8c4){var _0x21012f=typeof _0x3c5aa9[_0x4b88('0x28')]===_0x4b88('0x29')&&typeof _0x3c5aa9[_0x4b88('0x2a')]===_0x4b88('0x29');var _0x1bb386=_0xb6e8c4[_0x4b88('0x2b')];var _0xc7dcc0=_0x21012f?0x0:_0x3c5aa9[_0x4b88('0x28')];var _0x567502=_0x21012f?_0xb6e8c4[_0x4b88('0x2b')]:_0x3c5aa9[_0x4b88('0x28')]+_0x3c5aa9[_0x4b88('0x2a')];var _0x11c6d1;if(_0x567502>=_0x1bb386){_0x567502=_0x1bb386;_0x11c6d1=0xc8;}else{_0x11c6d1=0xce;}_0xa5643['status'](_0x11c6d1);return _0xa5643[_0x4b88('0x2c')](_0x4b88('0x2d'),_0xc7dcc0+'-'+_0x567502+'/'+_0x1bb386)['json'](_0xb6e8c4);}return null;};}function patchUpdates(_0x1422d9){return function(_0x5aade4){try{jsonpatch['apply'](_0x5aade4,_0x1422d9,!![]);}catch(_0x1ebcd5){return BPromise[_0x4b88('0x2e')](_0x1ebcd5);}return _0x5aade4[_0x4b88('0x2f')]();};}function saveUpdates(_0x918a10,_0x947243){return function(_0x40da1b){if(_0x40da1b){return _0x40da1b[_0x4b88('0x30')](_0x918a10)['then'](function(_0x2caf4f){return _0x2caf4f;});}return null;};}function removeEntity(_0x79114a,_0x457548){return function(_0x3e9137){if(_0x3e9137){return _0x3e9137[_0x4b88('0x31')]()[_0x4b88('0x32')](function(){var _0x5930d0=_0x3e9137['get']({'plain':!![]});var _0x3637d2=_0x4b88('0x33');return db[_0x4b88('0x34')][_0x4b88('0x31')]({'where':{'type':_0x3637d2,'resourceId':_0x5930d0['id']}})[_0x4b88('0x32')](function(){return _0x3e9137;});})[_0x4b88('0x32')](function(){_0x79114a['status'](0xcc)[_0x4b88('0x35')]();});}};}function handleEntityNotFound(_0xc938be,_0x3d3393){return function(_0x37276e){if(!_0x37276e){_0xc938be[_0x4b88('0x36')](0x194);}return _0x37276e;};}function handleError(_0xa47ea4,_0x34e95b){_0x34e95b=_0x34e95b||0x1f4;return function(_0x510a5a){logger['error'](_0x510a5a[_0x4b88('0x37')]);if(_0x510a5a['name']){delete _0x510a5a[_0x4b88('0x38')];}_0xa47ea4['status'](_0x34e95b)['send'](_0x510a5a);};}exports[_0x4b88('0x39')]=function(_0x21712f,_0x1aeecc){var _0x28c754={},_0x15882a={},_0x24dac7={'count':0x0,'rows':[]};var _0x328be0=_['map'](db['ChatQueue'][_0x4b88('0x3a')],function(_0x1a270b){return{'name':_0x1a270b[_0x4b88('0x3b')],'type':_0x1a270b[_0x4b88('0x3c')][_0x4b88('0x3d')]};});_0x15882a['model']=_[_0x4b88('0x3e')](_0x328be0,_0x4b88('0x38'));_0x15882a[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x21712f[_0x4b88('0x3f')]);_0x15882a[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x15882a['model'],_0x15882a[_0x4b88('0x3f')]);_0x28c754['attributes']=_['intersection'](_0x15882a['model'],qs['fields'](_0x21712f[_0x4b88('0x3f')][_0x4b88('0x43')]));_0x28c754[_0x4b88('0x44')]=_0x28c754[_0x4b88('0x44')]['length']?_0x28c754['attributes']:_0x15882a[_0x4b88('0x45')];if(!_0x21712f[_0x4b88('0x3f')][_0x4b88('0x46')](_0x4b88('0x47'))){_0x28c754['limit']=qs[_0x4b88('0x2a')](_0x21712f['query'][_0x4b88('0x2a')]);_0x28c754['offset']=qs[_0x4b88('0x28')](_0x21712f[_0x4b88('0x3f')][_0x4b88('0x28')]);}_0x28c754[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x21712f['query'][_0x4b88('0x49')]);_0x28c754['where']=qs[_0x4b88('0x41')](_['pick'](_0x21712f[_0x4b88('0x3f')],_0x15882a[_0x4b88('0x41')]),_0x328be0);if(_0x21712f[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x28c754['where']=_[_0x4b88('0x4b')](_0x28c754[_0x4b88('0x4c')],{'$or':_[_0x4b88('0x3e')](_0x328be0,function(_0x469c89){if(_0x469c89[_0x4b88('0x3c')]!==_0x4b88('0x4d')){var _0x4dee3f={};_0x4dee3f[_0x469c89[_0x4b88('0x38')]]={'$like':'%'+_0x21712f['query']['filter']+'%'};return _0x4dee3f;}})});}_0x28c754=_[_0x4b88('0x4b')]({},_0x28c754,_0x21712f[_0x4b88('0x4e')]);var _0x50a4d0={'where':_0x28c754[_0x4b88('0x4c')]};return db[_0x4b88('0x4f')]['count'](_0x50a4d0)[_0x4b88('0x32')](function(_0x487eaf){_0x24dac7[_0x4b88('0x2b')]=_0x487eaf;if(_0x21712f[_0x4b88('0x3f')][_0x4b88('0x50')]){_0x28c754[_0x4b88('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0x4b88('0x52')](_0x28c754);})[_0x4b88('0x32')](function(_0x12839a){_0x24dac7[_0x4b88('0x53')]=_0x12839a;return _0x24dac7;})[_0x4b88('0x32')](respondWithFilteredResult(_0x1aeecc,_0x28c754))[_0x4b88('0x54')](handleError(_0x1aeecc,null));};exports[_0x4b88('0x55')]=function(_0x374f1a,_0x1faa6e){var _0x4ce3ee={'raw':!![],'where':{'id':_0x374f1a[_0x4b88('0x56')]['id']}},_0x511abf={};_0x511abf['model']=_[_0x4b88('0x40')](db[_0x4b88('0x4f')][_0x4b88('0x3a')]);_0x511abf[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x374f1a[_0x4b88('0x3f')]);_0x511abf[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x511abf[_0x4b88('0x45')],_0x511abf['query']);_0x4ce3ee[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x511abf[_0x4b88('0x45')],qs['fields'](_0x374f1a['query']['fields']));_0x4ce3ee[_0x4b88('0x44')]=_0x4ce3ee[_0x4b88('0x44')][_0x4b88('0x57')]?_0x4ce3ee['attributes']:_0x511abf[_0x4b88('0x45')];if(_0x374f1a[_0x4b88('0x3f')][_0x4b88('0x50')]){_0x4ce3ee[_0x4b88('0x51')]=[{'all':!![]}];}_0x4ce3ee=_[_0x4b88('0x4b')]({},_0x4ce3ee,_0x374f1a['options']);return db[_0x4b88('0x4f')]['find'](_0x4ce3ee)['then'](handleEntityNotFound(_0x1faa6e,null))['then'](respondWithResult(_0x1faa6e,null))['catch'](handleError(_0x1faa6e,null));};exports['create']=function(_0x587370,_0x8ef3cd){return db[_0x4b88('0x4f')][_0x4b88('0x58')](_0x587370[_0x4b88('0x59')],{})[_0x4b88('0x32')](function(_0x5b4e1c){var _0x2e2bc6=_0x587370[_0x4b88('0x5a')][_0x4b88('0x5b')]({'plain':!![]});if(!_0x2e2bc6)throw new Error(_0x4b88('0x5c'));if(_0x2e2bc6[_0x4b88('0x5d')]===_0x4b88('0x5a')){var _0x1dab2f=_0x5b4e1c[_0x4b88('0x5b')]({'plain':!![]});var _0x449457=_0x4b88('0x33');return db[_0x4b88('0x5e')][_0x4b88('0x5f')]({'where':{'name':_0x449457,'userProfileId':_0x2e2bc6[_0x4b88('0x60')]},'raw':!![]})[_0x4b88('0x32')](function(_0x568e25){if(_0x568e25&&_0x568e25[_0x4b88('0x61')]===0x0){return db[_0x4b88('0x34')][_0x4b88('0x58')]({'name':_0x1dab2f['name'],'resourceId':_0x1dab2f['id'],'type':_0x568e25[_0x4b88('0x38')],'sectionId':_0x568e25['id']},{})[_0x4b88('0x32')](function(){return _0x5b4e1c;});}else{return _0x5b4e1c;}})[_0x4b88('0x54')](function(_0x1c828f){logger['error'](_0x4b88('0x62'),_0x1c828f);throw _0x1c828f;});}return _0x5b4e1c;})[_0x4b88('0x32')](respondWithResult(_0x8ef3cd,0xc9))[_0x4b88('0x54')](handleError(_0x8ef3cd,null));};exports['update']=function(_0xc5eeaa,_0x2f05f2){if(_0xc5eeaa['body']['id']){delete _0xc5eeaa[_0x4b88('0x59')]['id'];}return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0xc5eeaa['params']['id']}})['then'](handleEntityNotFound(_0x2f05f2,null))[_0x4b88('0x32')](saveUpdates(_0xc5eeaa[_0x4b88('0x59')],null))[_0x4b88('0x32')](respondWithResult(_0x2f05f2,null))[_0x4b88('0x54')](handleError(_0x2f05f2,null));};exports[_0x4b88('0x31')]=function(_0x1e5729,_0x245016){return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x1e5729[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x245016,null))[_0x4b88('0x32')](removeEntity(_0x245016,null))[_0x4b88('0x54')](handleError(_0x245016,null));};exports[_0x4b88('0x63')]=function(_0x52716f,_0x148930){return db[_0x4b88('0x4f')][_0x4b88('0x63')]()[_0x4b88('0x32')](respondWithResult(_0x148930,null))[_0x4b88('0x54')](handleError(_0x148930,null));};exports[_0x4b88('0x64')]=function(_0x37bcbd,_0x4e139f,_0x17770a){var _0x580673={'raw':!![],'where':{}},_0x33e340={},_0x4fc926;return db[_0x4b88('0x4f')]['findOne']({'where':{'id':_0x37bcbd[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x4e139f,null))[_0x4b88('0x32')](function(_0xa06f08){if(_0xa06f08){_0x4fc926=_0xa06f08['get']({'plain':!![]});_0x33e340[_0x4b88('0x45')]=_['keys'](db['UserChatQueue'][_0x4b88('0x3a')]);_0x33e340['query']=_['keys'](_0x37bcbd['query']);_0x33e340[_0x4b88('0x41')]=_['intersection'](_0x33e340['model'],_0x33e340[_0x4b88('0x3f')]);_0x580673['attributes']=_[_0x4b88('0x42')](_0x33e340[_0x4b88('0x45')],qs[_0x4b88('0x43')](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x43')]));_0x580673[_0x4b88('0x44')]=_0x580673[_0x4b88('0x44')][_0x4b88('0x57')]?_0x580673[_0x4b88('0x44')]:_0x33e340[_0x4b88('0x45')];if(!_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x46')](_0x4b88('0x47'))){_0x580673[_0x4b88('0x2a')]=qs['limit'](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x2a')]);_0x580673[_0x4b88('0x28')]=qs[_0x4b88('0x28')](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x28')]);}_0x580673[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x37bcbd['query']['sort']);_0x580673[_0x4b88('0x4c')]=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x37bcbd['query'],_0x33e340[_0x4b88('0x41')]));_0x580673[_0x4b88('0x4c')][_0x4b88('0x66')]=_0xa06f08['id'];if(_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x580673['where']=_[_0x4b88('0x4b')](_0x580673['where'],{'$or':_[_0x4b88('0x3e')](_0x580673['attributes'],function(_0x713c8a){var _0x23b0b8={};_0x23b0b8[_0x713c8a]={'$like':'%'+_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x4a')]+'%'};return _0x23b0b8;})});}_0x580673=_[_0x4b88('0x4b')]({},_0x580673,_0x37bcbd[_0x4b88('0x4e')]);return db['UserChatQueue'][_0x4b88('0x52')](_0x580673);}})[_0x4b88('0x32')](function(_0x315bd2){if(_0x315bd2){return db['User']['findAndCountAll']({'where':{'id':_[_0x4b88('0x3e')](_0x315bd2,_0x4b88('0x67')),'role':_0x4b88('0x68')},'attributes':['id','name',_0x4b88('0x69'),_0x4b88('0x6a'),_0x4b88('0x6b')]});}})[_0x4b88('0x32')](function(_0x31a484){if(_0x31a484){return{'count':_0x31a484[_0x4b88('0x2b')],'rows':_['map'](_0x31a484[_0x4b88('0x53')],function(_0x4a502b){return{'membername':_0x4a502b['name'],'UserId':_0x4a502b['id'],'queue_name':_0x4fc926[_0x4b88('0x38')],'ChatQueueId':_0x4fc926['id'],'interface':util[_0x4b88('0x6c')](_0x4b88('0x6d'),'SIP',_0x4a502b[_0x4b88('0x38')]),'penalty':0x0,'paused':_0x4a502b[_0x4b88('0x69')],'createdAt':_0x4a502b[_0x4b88('0x6b')],'updatedAt':_0x4a502b[_0x4b88('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4b88('0x32')](respondWithFilteredResult(_0x4e139f,_0x580673))[_0x4b88('0x54')](handleError(_0x4e139f,null));};exports[_0x4b88('0x6e')]=function(_0x327950,_0xd5f138,_0x4e7597){var _0x2c3ecd={};var _0x5481c8={};var _0x1b4861;var _0x5cbb95;return db[_0x4b88('0x4f')][_0x4b88('0x6f')]({'where':{'id':_0x327950[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0xd5f138,null))['then'](function(_0x30fc7f){if(_0x30fc7f){_0x1b4861=_0x30fc7f;_0x5481c8['model']=_[_0x4b88('0x40')](db[_0x4b88('0x70')][_0x4b88('0x3a')]);_0x5481c8[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x327950['query']);_0x5481c8[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x5481c8['model'],_0x5481c8['query']);_0x2c3ecd[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x5481c8[_0x4b88('0x45')],qs['fields'](_0x327950['query']['fields']));_0x2c3ecd['attributes']=_0x2c3ecd[_0x4b88('0x44')][_0x4b88('0x57')]?_0x2c3ecd[_0x4b88('0x44')]:_0x5481c8[_0x4b88('0x45')];_0x2c3ecd[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x327950['query'][_0x4b88('0x49')]);_0x2c3ecd['where']=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x327950[_0x4b88('0x3f')],_0x5481c8[_0x4b88('0x41')]));if(_0x327950[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x2c3ecd[_0x4b88('0x4c')]=_['merge'](_0x2c3ecd[_0x4b88('0x4c')],{'$or':_['map'](_0x2c3ecd[_0x4b88('0x44')],function(_0x358010){var _0x4ae8a0={};_0x4ae8a0[_0x358010]={'$like':'%'+_0x327950['query'][_0x4b88('0x4a')]+'%'};return _0x4ae8a0;})});}_0x2c3ecd=_[_0x4b88('0x4b')]({},_0x2c3ecd,_0x327950['options']);return _0x1b4861['getTeams'](_0x2c3ecd);}})[_0x4b88('0x32')](function(_0x133b8e){if(_0x133b8e){_0x5cbb95=_0x133b8e['length'];if(!_0x327950['query'][_0x4b88('0x46')](_0x4b88('0x47'))){_0x2c3ecd['limit']=qs['limit'](_0x327950['query']['limit']);_0x2c3ecd[_0x4b88('0x28')]=qs[_0x4b88('0x28')](_0x327950[_0x4b88('0x3f')][_0x4b88('0x28')]);}return _0x1b4861['getTeams'](_0x2c3ecd);}})[_0x4b88('0x32')](function(_0x43c0aa){if(_0x43c0aa){return _0x43c0aa?{'count':_0x5cbb95,'rows':_0x43c0aa}:null;}})[_0x4b88('0x32')](respondWithResult(_0xd5f138,null))[_0x4b88('0x54')](handleError(_0xd5f138,null));};exports[_0x4b88('0x71')]=function(_0x5b3518,_0x402a8b,_0x55112d){var _0x1703d7=_0x5b3518['body'][_0x4b88('0x72')];return db['Team'][_0x4b88('0x52')]({'where':{'id':_0x1703d7},'attributes':['id'],'include':[{'model':db[_0x4b88('0x73')],'as':_0x4b88('0x74'),'attributes':['id',_0x4b88('0x38'),_0x4b88('0x75'),_0x4b88('0x76'),_0x4b88('0x77')],'raw':!![]}]})[_0x4b88('0x32')](function(_0x2de889){if(_0x2de889){var _0x44224c=_[_0x4b88('0x78')](_0x2de889,function(_0x40ba5b){var _0x47509=_0x40ba5b[_0x4b88('0x5b')]({'plain':!![]});return _0x47509[_0x4b88('0x74')];});return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x5b3518[_0x4b88('0x56')]['id']}})['then'](function(_0x236fde){return db[_0x4b88('0x79')]['transaction'](function(_0x2cf041){return _0x236fde[_0x4b88('0x71')](_0x1703d7,{'transaction':_0x2cf041})['then'](function(){return BPromise[_0x4b88('0x7a')](_0x44224c,function(_0x3650dc){return db['UserChatQueue'][_0x4b88('0x7b')]({'where':{'UserId':_0x3650dc['id'],'ChatQueueId':_0x5b3518[_0x4b88('0x56')]['id']},'transaction':_0x2cf041});});})[_0x4b88('0x32')](function(){_0x44224c[_0x4b88('0x7c')](function(_0x5b4cf1){socket[_0x4b88('0x7d')]('userChatQueue:save',{'UserId':_0x5b4cf1['id'],'ChatQueueId':_0x236fde['id']});});});});});}})[_0x4b88('0x32')](respondWithStatusCode(_0x402a8b,null))[_0x4b88('0x54')](handleError(_0x402a8b,null));};exports[_0x4b88('0x7e')]=function(_0xc8522,_0x1e5b44,_0x37a4ac){return db[_0x4b88('0x70')][_0x4b88('0x52')]({'where':{'id':_0xc8522[_0x4b88('0x3f')][_0x4b88('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b88('0x74'),'attributes':['id'],'raw':!![]}]})[_0x4b88('0x32')](handleEntityNotFound(_0x1e5b44,null))[_0x4b88('0x32')](function(_0x1881e7){var _0x38e8ee=_['map'](_0x1881e7,'id');var _0x38ee4e=[];var _0x2c87dc=[];var _0x1dff22=squel[_0x4b88('0x7f')]();_0x1dff22['field'](_0x4b88('0x80'))[_0x4b88('0x81')](_0x4b88('0x82'),'tq')[_0x4b88('0x83')]('user_has_teams','ut',_0x4b88('0x84'))[_0x4b88('0x4c')](_0x4b88('0x85'),_0xc8522[_0x4b88('0x56')]['id']);for(var _0xf0f57a=0x0;_0xf0f57a<_0x1881e7[_0x4b88('0x57')];_0xf0f57a+=0x1){let _0x27b298=_0x1881e7[_0xf0f57a];for(var _0x581588=0x0;_0x581588<_0x27b298['Agents'][_0x4b88('0x57')];_0x581588+=0x1){let _0x2716ee=_0x27b298['Agents'][_0x581588];var _0x2c122d=_0x1dff22[_0x4b88('0x86')]();_0x2c122d[_0x4b88('0x4c')](_0x4b88('0x87'),_0x2716ee['id']);_0x2c87dc['push'](db[_0x4b88('0x79')][_0x4b88('0x3f')](_0x2c122d[_0x4b88('0x88')](),{'type':db[_0x4b88('0x79')][_0x4b88('0x89')][_0x4b88('0x8a')]})[_0x4b88('0x32')](function(_0xf2ad3a){if(_0xf2ad3a[_0x4b88('0x57')]===0x1){return _0x2716ee['id'];}else{var _0x4df595=_[_0x4b88('0x8b')](_[_0x4b88('0x3e')](_0xf2ad3a,_0x4b88('0x8c')),function(_0x307b50){return _[_0x4b88('0x8d')](_0x38e8ee,_0x307b50);});if(_0x4df595){return _0x2716ee['id'];}}}));}}return BPromise['all'](_0x2c87dc)[_0x4b88('0x32')](function(_0x2f05fa){_0x38ee4e=_(_0x38ee4e)['union'](_0x2f05fa)[_0x4b88('0x8e')]()[_0x4b88('0x8f')]();return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0xc8522[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](function(_0x1d71d9){return db[_0x4b88('0x79')][_0x4b88('0x90')](function(_0x512c6a){return _0x1d71d9[_0x4b88('0x7e')](_0xc8522['query'][_0x4b88('0x72')],{'transaction':_0x512c6a})['then'](function(){if(!_['isEmpty'](_0x38ee4e)){return _0x1d71d9[_0x4b88('0x91')](_0x38ee4e,{'transaction':_0x512c6a});}})['then'](function(){_0x38ee4e[_0x4b88('0x7c')](function(_0x344ef1){socket['emit'](_0x4b88('0x92'),{'UserId':_0x344ef1,'ChatQueueId':_0x1d71d9['id']});});});});});});})[_0x4b88('0x32')](respondWithStatusCode(_0x1e5b44,null))[_0x4b88('0x54')](handleError(_0x1e5b44,null));};exports[_0x4b88('0x93')]=function(_0x3d4bbb,_0x51df60,_0x581c4a){return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x3d4bbb['params']['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x51df60,null))[_0x4b88('0x32')](function(_0x3a3a5a){if(_0x3a3a5a){return _0x3a3a5a[_0x4b88('0x93')](_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')],_[_0x4b88('0x94')](_0x3d4bbb[_0x4b88('0x59')],[_0x4b88('0x72'),'id'])||{})['spread'](function(_0x946117){for(var _0x18c91b=0x0;_0x18c91b<_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')]['length'];_0x18c91b+=0x1){socket[_0x4b88('0x7d')]('userChatQueue:save',{'UserId':Number(_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')][_0x18c91b]),'ChatQueueId':Number(_0x3d4bbb[_0x4b88('0x56')]['id'])});}return _0x946117;});}})[_0x4b88('0x32')](respondWithResult(_0x51df60,null))['catch'](handleError(_0x51df60,null));};exports[_0x4b88('0x91')]=function(_0x47bba4,_0x1cac27,_0x11408a){return db['ChatQueue'][_0x4b88('0x5f')]({'where':{'id':_0x47bba4[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x1cac27,null))[_0x4b88('0x32')](function(_0x24a2b8){if(_0x24a2b8){return _0x24a2b8[_0x4b88('0x91')](_0x47bba4['query']['ids'])[_0x4b88('0x32')](function(){if(_[_0x4b88('0x95')](_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')])){for(var _0x26489d=0x0;_0x26489d<_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')][_0x4b88('0x57')];_0x26489d+=0x1){socket[_0x4b88('0x7d')](_0x4b88('0x92'),{'UserId':Number(_0x47bba4[_0x4b88('0x3f')]['ids'][_0x26489d]),'ChatQueueId':Number(_0x47bba4[_0x4b88('0x56')]['id'])});}}else{socket[_0x4b88('0x7d')](_0x4b88('0x92'),{'UserId':Number(_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')]),'ChatQueueId':Number(_0x47bba4[_0x4b88('0x56')]['id'])});}});}})[_0x4b88('0x32')](respondWithStatusCode(_0x1cac27,null))[_0x4b88('0x54')](handleError(_0x1cac27,null));};exports[_0x4b88('0x96')]=function(_0x433e9e,_0xeedcee,_0x518f71){var _0x310ae3={};var _0x4df3ad={};var _0x2fa4ac;var _0x26c7f9;return db[_0x4b88('0x4f')][_0x4b88('0x6f')]({'where':{'id':_0x433e9e[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0xeedcee,null))[_0x4b88('0x32')](function(_0x132f91){if(_0x132f91){_0x2fa4ac=_0x132f91;_0x4df3ad[_0x4b88('0x45')]=_[_0x4b88('0x40')](db['User'][_0x4b88('0x3a')]);_0x4df3ad['query']=_[_0x4b88('0x40')](_0x433e9e[_0x4b88('0x3f')]);_0x4df3ad['filters']=_[_0x4b88('0x42')](_0x4df3ad['model'],_0x4df3ad['query']);_0x310ae3[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x4df3ad[_0x4b88('0x45')],qs[_0x4b88('0x43')](_0x433e9e['query'][_0x4b88('0x43')]));_0x310ae3[_0x4b88('0x44')]=_0x310ae3['attributes'][_0x4b88('0x57')]?_0x310ae3[_0x4b88('0x44')]:_0x4df3ad[_0x4b88('0x45')];_0x310ae3[_0x4b88('0x48')]=qs['sort'](_0x433e9e['query']['sort']);_0x310ae3[_0x4b88('0x4c')]=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x433e9e['query'],_0x4df3ad['filters']));if(_0x433e9e[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x310ae3[_0x4b88('0x4c')]=_[_0x4b88('0x4b')](_0x310ae3[_0x4b88('0x4c')],{'$or':_['map'](_0x310ae3[_0x4b88('0x44')],function(_0x39d5a8){var _0x152b38={};_0x152b38[_0x39d5a8]={'$like':'%'+_0x433e9e['query'][_0x4b88('0x4a')]+'%'};return _0x152b38;})});}_0x310ae3=_[_0x4b88('0x4b')]({},_0x310ae3,_0x433e9e[_0x4b88('0x4e')]);return _0x2fa4ac['getAgents'](_0x310ae3);}})[_0x4b88('0x32')](function(_0x3a54ff){if(_0x3a54ff){_0x26c7f9=_0x3a54ff['length'];if(!_0x433e9e[_0x4b88('0x3f')]['hasOwnProperty'](_0x4b88('0x47'))){_0x310ae3['limit']=qs[_0x4b88('0x2a')](_0x433e9e[_0x4b88('0x3f')]['limit']);_0x310ae3['offset']=qs[_0x4b88('0x28')](_0x433e9e[_0x4b88('0x3f')]['offset']);}return _0x2fa4ac[_0x4b88('0x96')](_0x310ae3);}})['then'](function(_0x416f84){if(_0x416f84){return _0x416f84?{'count':_0x26c7f9,'rows':_0x416f84}:null;}})[_0x4b88('0x32')](respondWithResult(_0xeedcee,null))[_0x4b88('0x54')](handleError(_0xeedcee,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 722948d..d47b68a 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 _0x62b3=['save','update','remove','emit','hasOwnProperty','hook','setMaxListeners'];(function(_0x3c7d06,_0x3a8eb6){var _0x14be70=function(_0x14c343){while(--_0x14c343){_0x3c7d06['push'](_0x3c7d06['shift']());}};_0x14be70(++_0x3a8eb6);}(_0x62b3,0x19c));var _0x362b=function(_0x9723e4,_0x52f61c){_0x9723e4=_0x9723e4-0x0;var _0x3393e9=_0x62b3[_0x9723e4];return _0x3393e9;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x362b('0x0')](0x0);var events={'afterCreate':_0x362b('0x1'),'afterUpdate':_0x362b('0x2'),'afterDestroy':_0x362b('0x3')};function emitEvent(_0x18b4e8){return function(_0x5b65b8,_0x1a5ed3,_0x16557d){ChatQueueEvents[_0x362b('0x4')](_0x18b4e8+':'+_0x5b65b8['id'],_0x5b65b8);ChatQueueEvents[_0x362b('0x4')](_0x18b4e8,_0x5b65b8);_0x16557d(null);};}for(var e in events){if(events[_0x362b('0x5')](e)){var event=events[e];ChatQueue[_0x362b('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x8fb7=['events','../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3d84b2,_0x566767){var _0x4e6b72=function(_0x9f6318){while(--_0x9f6318){_0x3d84b2['push'](_0x3d84b2['shift']());}};_0x4e6b72(++_0x566767);}(_0x8fb7,0x1a4));var _0x78fb=function(_0x2d6616,_0x37278c){_0x2d6616=_0x2d6616-0x0;var _0x509c8a=_0x8fb7[_0x2d6616];return _0x509c8a;};'use strict';var EventEmitter=require(_0x78fb('0x0'));var ChatQueue=require(_0x78fb('0x1'))['db'][_0x78fb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x78fb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78fb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2abc9c){return function(_0x4a96e6,_0x2febcf,_0x2a8416){ChatQueueEvents[_0x78fb('0x5')](_0x2abc9c+':'+_0x4a96e6['id'],_0x4a96e6);ChatQueueEvents[_0x78fb('0x5')](_0x2abc9c,_0x4a96e6);_0x2a8416(null);};}for(var e in events){if(events[_0x78fb('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 44ee8d2..6b3b295 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 _0x2f23=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x2f23,0xf9));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x32f2('0x1'));var BPromise=require(_0x32f2('0x2'));var rp=require(_0x32f2('0x3'));var fs=require('fs');var path=require(_0x32f2('0x4'));var rimraf=require(_0x32f2('0x5'));var config=require('../../config/environment');var attributes=require(_0x32f2('0x6'));module['exports']=function(_0x35444f,_0x2b04fb){return _0x35444f[_0x32f2('0x7')](_0x32f2('0x8'),attributes,{'tableName':_0x32f2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa870=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x3b2412,_0x3a2652){var _0x47bc00=function(_0x10b986){while(--_0x10b986){_0x3b2412['push'](_0x3b2412['shift']());}};_0x47bc00(++_0x3a2652);}(_0xa870,0xc3));var _0x0a87=function(_0xef7090,_0x9de7dd){_0xef7090=_0xef7090-0x0;var _0x263453=_0xa870[_0xef7090];return _0x263453;};'use strict';var _=require(_0x0a87('0x0'));var util=require(_0x0a87('0x1'));var logger=require(_0x0a87('0x2'))('api');var moment=require(_0x0a87('0x3'));var BPromise=require(_0x0a87('0x4'));var rp=require(_0x0a87('0x5'));var fs=require('fs');var path=require(_0x0a87('0x6'));var rimraf=require(_0x0a87('0x7'));var config=require(_0x0a87('0x8'));var attributes=require(_0x0a87('0x9'));module[_0x0a87('0xa')]=function(_0x3fc538,_0x1e8bae){return _0x3fc538[_0x0a87('0xb')](_0x0a87('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c2a9f22..3557705 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 _0xbb35=['include','ShowChatQueue','ChatQueue','find','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','map','model'];(function(_0x10bf44,_0x33564a){var _0x542225=function(_0x4d617d){while(--_0x4d617d){_0x10bf44['push'](_0x10bf44['shift']());}};_0x542225(++_0x33564a);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x54d8c5,_0x236001){_0x54d8c5=_0x54d8c5-0x0;var _0x210790=_0xbb35[_0x54d8c5];return _0x210790;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var moment=require(_0x5bb3('0x1'));var BPromise=require(_0x5bb3('0x2'));var rs=require(_0x5bb3('0x3'));var fs=require('fs');var Redis=require(_0x5bb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var jayson=require(_0x5bb3('0x9'));var client=jayson[_0x5bb3('0xa')][_0x5bb3('0xb')]({'port':0x232a});config[_0x5bb3('0xc')]=_[_0x5bb3('0xd')](config['redis'],{'host':_0x5bb3('0xe'),'port':0x18eb});var socket=require(_0x5bb3('0xf'))(new Redis(config[_0x5bb3('0xc')]));require(_0x5bb3('0x10'))['register'](socket);function respondWithRpcPromise(_0x399f28,_0x5621a8,_0x4035d1){return new BPromise(function(_0x5a8b3b,_0x12513f){return client[_0x5bb3('0x11')](_0x399f28,_0x4035d1)[_0x5bb3('0x12')](function(_0x3212c8){logger[_0x5bb3('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5621a8,_0x5bb3('0x14'));logger[_0x5bb3('0x15')](_0x5bb3('0x16'),_0x5621a8,'request\x20sent',JSON[_0x5bb3('0x17')](_0x3212c8));if(_0x3212c8[_0x5bb3('0x18')]){if(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x19')]===0x1f4){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x12513f(_0x3212c8['error']['message']);}logger['error'](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x5a8b3b(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);}else{logger[_0x5bb3('0x13')](_0x5bb3('0x1a'),_0x5621a8,_0x5bb3('0x14'));_0x5a8b3b(_0x3212c8[_0x5bb3('0x1c')][_0x5bb3('0x1b')]);}})['catch'](function(_0x5a541b){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x5a541b);_0x12513f(_0x5a541b);});});}exports[_0x5bb3('0x1d')]=function(_0x442ee2){var _0x197d38=this;return new Promise(function(_0x3fe551,_0x2630b4){return db['ChatQueue'][_0x5bb3('0x1e')]({'raw':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2['options'][_0x5bb3('0x20')]||null:null,'attributes':_0x442ee2['options']?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x21')]||null:null,'limit':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x22')]||null:null,'include':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['include']?_[_0x5bb3('0x23')](_0x442ee2[_0x5bb3('0x1f')]['include'],function(_0x439ee4){return{'model':db[_0x439ee4[_0x5bb3('0x24')]],'as':_0x439ee4['as'],'attributes':_0x439ee4[_0x5bb3('0x21')],'include':_0x439ee4[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x439ee4[_0x5bb3('0x25')],function(_0x405eea){return{'model':db[_0x405eea[_0x5bb3('0x24')]],'as':_0x405eea['as'],'attributes':_0x405eea['attributes'],'include':_0x405eea['include']?_[_0x5bb3('0x23')](_0x405eea['include'],function(_0x182516){return{'model':db[_0x182516['model']],'as':_0x182516['as'],'attributes':_0x182516[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x104efe){logger['info'](_0x5bb3('0x1d'),_0x442ee2);logger[_0x5bb3('0x15')](_0x5bb3('0x1d'),_0x442ee2,JSON[_0x5bb3('0x17')](_0x104efe));_0x3fe551(_0x104efe);})['catch'](function(_0x55276b){logger[_0x5bb3('0x18')]('GetChatQueue',_0x55276b[_0x5bb3('0x1b')],_0x442ee2);_0x2630b4(_0x197d38[_0x5bb3('0x18')](0x1f4,_0x55276b['message']));});});};exports[_0x5bb3('0x26')]=function(_0xd935a7){var _0x3d7115=this;return new Promise(function(_0xe5981a,_0x46ba29){return db[_0x5bb3('0x27')][_0x5bb3('0x28')]({'raw':_0xd935a7['options']?_0xd935a7[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x20')]||null:null,'attributes':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7['options']['attributes']||null:null,'include':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')],function(_0x4a7678){return{'model':db[_0x4a7678[_0x5bb3('0x24')]],'as':_0x4a7678['as'],'attributes':_0x4a7678[_0x5bb3('0x21')],'include':_0x4a7678[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x4a7678[_0x5bb3('0x25')],function(_0x5df4c5){return{'model':db[_0x5df4c5[_0x5bb3('0x24')]],'as':_0x5df4c5['as'],'attributes':_0x5df4c5[_0x5bb3('0x21')],'include':_0x5df4c5[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x5df4c5[_0x5bb3('0x25')],function(_0x24ff2c){return{'model':db[_0x24ff2c[_0x5bb3('0x24')]],'as':_0x24ff2c['as'],'attributes':_0x24ff2c[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x19c820){logger['info'](_0x5bb3('0x26'),_0xd935a7);logger[_0x5bb3('0x15')](_0x5bb3('0x26'),_0xd935a7,JSON[_0x5bb3('0x17')](_0x19c820));_0xe5981a(_0x19c820);})[_0x5bb3('0x29')](function(_0x40cc9d){logger[_0x5bb3('0x18')](_0x5bb3('0x26'),_0x40cc9d[_0x5bb3('0x1b')],_0xd935a7);_0x46ba29(_0x3d7115[_0x5bb3('0x18')](0x1f4,_0x40cc9d[_0x5bb3('0x1b')]));});});}; \ No newline at end of file +var _0x0f42=['then','GetChatQueue','debug','ShowChatQueue','ChatQueue','where','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','include','model','map'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x0f42,0x126));var _0x20f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0f42[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});config[_0x20f4('0xa')]=_['defaults'](config[_0x20f4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20f4('0xb'))['register'](socket);function respondWithRpcPromise(_0x41c1bb,_0x30f2ef,_0x395fda){return new BPromise(function(_0x1ee8c6,_0x51ab58){return client[_0x20f4('0xc')](_0x41c1bb,_0x395fda)['then'](function(_0x2383ce){logger[_0x20f4('0xd')](_0x20f4('0xe'),_0x30f2ef,_0x20f4('0xf'));logger['debug'](_0x20f4('0x10'),_0x30f2ef,_0x20f4('0xf'),JSON[_0x20f4('0x11')](_0x2383ce));if(_0x2383ce[_0x20f4('0x12')]){if(_0x2383ce[_0x20f4('0x12')][_0x20f4('0x13')]===0x1f4){logger[_0x20f4('0x12')](_0x20f4('0xe'),_0x30f2ef,_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);return _0x51ab58(_0x2383ce[_0x20f4('0x12')]['message']);}logger['error'](_0x20f4('0xe'),_0x30f2ef,_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);return _0x1ee8c6(_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);}else{logger['info'](_0x20f4('0xe'),_0x30f2ef,_0x20f4('0xf'));_0x1ee8c6(_0x2383ce[_0x20f4('0x15')]['message']);}})[_0x20f4('0x16')](function(_0xd8de3b){logger[_0x20f4('0x12')]('ChatQueue,\x20%s,\x20%s',_0x30f2ef,_0xd8de3b);_0x51ab58(_0xd8de3b);});});}exports['GetChatQueue']=function(_0x323d19){var _0x56a89f=this;return new Promise(function(_0x5d646a,_0x83ee22){return db['ChatQueue'][_0x20f4('0x17')]({'raw':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')][_0x20f4('0x19')]===undefined?!![]:![]:!![],'where':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')]['where']||null:null,'attributes':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')][_0x20f4('0x1a')]||null:null,'limit':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')]['limit']||null:null,'include':_0x323d19['options']?_0x323d19[_0x20f4('0x18')][_0x20f4('0x1b')]?_['map'](_0x323d19[_0x20f4('0x18')][_0x20f4('0x1b')],function(_0x50a2c1){return{'model':db[_0x50a2c1[_0x20f4('0x1c')]],'as':_0x50a2c1['as'],'attributes':_0x50a2c1[_0x20f4('0x1a')],'include':_0x50a2c1['include']?_[_0x20f4('0x1d')](_0x50a2c1[_0x20f4('0x1b')],function(_0x104229){return{'model':db[_0x104229[_0x20f4('0x1c')]],'as':_0x104229['as'],'attributes':_0x104229[_0x20f4('0x1a')],'include':_0x104229[_0x20f4('0x1b')]?_[_0x20f4('0x1d')](_0x104229[_0x20f4('0x1b')],function(_0x365e5a){return{'model':db[_0x365e5a[_0x20f4('0x1c')]],'as':_0x365e5a['as'],'attributes':_0x365e5a[_0x20f4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x20f4('0x1e')](function(_0xf47be4){logger[_0x20f4('0xd')](_0x20f4('0x1f'),_0x323d19);logger[_0x20f4('0x20')](_0x20f4('0x1f'),_0x323d19,JSON['stringify'](_0xf47be4));_0x5d646a(_0xf47be4);})['catch'](function(_0x4d4edc){logger[_0x20f4('0x12')](_0x20f4('0x1f'),_0x4d4edc[_0x20f4('0x14')],_0x323d19);_0x83ee22(_0x56a89f['error'](0x1f4,_0x4d4edc['message']));});});};exports[_0x20f4('0x21')]=function(_0x1f85c8){var _0x38ac33=this;return new Promise(function(_0x40e3bb,_0x5d56e8){return db[_0x20f4('0x22')]['find']({'raw':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x19')]===undefined?!![]:![]:!![],'where':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x23')]||null:null,'attributes':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x1a')]||null:null,'include':_0x1f85c8['options']?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x1b')]?_[_0x20f4('0x1d')](_0x1f85c8['options']['include'],function(_0x24698a){return{'model':db[_0x24698a['model']],'as':_0x24698a['as'],'attributes':_0x24698a['attributes'],'include':_0x24698a['include']?_[_0x20f4('0x1d')](_0x24698a[_0x20f4('0x1b')],function(_0xbc17cc){return{'model':db[_0xbc17cc[_0x20f4('0x1c')]],'as':_0xbc17cc['as'],'attributes':_0xbc17cc['attributes'],'include':_0xbc17cc['include']?_[_0x20f4('0x1d')](_0xbc17cc[_0x20f4('0x1b')],function(_0xd250e7){return{'model':db[_0xd250e7['model']],'as':_0xd250e7['as'],'attributes':_0xd250e7[_0x20f4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x20f4('0x1e')](function(_0x190120){logger[_0x20f4('0xd')](_0x20f4('0x21'),_0x1f85c8);logger[_0x20f4('0x20')](_0x20f4('0x21'),_0x1f85c8,JSON[_0x20f4('0x11')](_0x190120));_0x40e3bb(_0x190120);})[_0x20f4('0x16')](function(_0x35e426){logger['error'](_0x20f4('0x21'),_0x35e426[_0x20f4('0x14')],_0x1f85c8);_0x5d56e8(_0x38ac33[_0x20f4('0x12')](0x1f4,_0x35e426[_0x20f4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 160499e..9360885 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 _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3f1b36,_0x205b14){_0x3f1b36=_0x3f1b36-0x0;var _0x56a704=_0xf3cd[_0x3f1b36];return _0x56a704;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}}; \ No newline at end of file +var _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x19f92d,_0x55e990){var _0x4c7457=function(_0x102a61){while(--_0x102a61){_0x19f92d['push'](_0x19f92d['shift']());}};_0x4c7457(++_0x55e990);}(_0x80d9,0x15c));var _0x980d=function(_0x1eedfd,_0x133f0f){_0x1eedfd=_0x1eedfd-0x0;var _0x10be6c=_0x80d9[_0x1eedfd];return _0x10be6c;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ea45887..276c292 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(_0x15a7c5,_0x64f633){var _0x5aa80d=function(_0x3c4e90){while(--_0x3c4e90){_0x15a7c5['push'](_0x15a7c5['shift']());}};_0x5aa80d(++_0x64f633);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4b29d4,_0x1a2af7){var _0x4004f5=function(_0x4966a5){while(--_0x4966a5){_0x4b29d4['push'](_0x4b29d4['shift']());}};_0x4004f5(++_0x1a2af7);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 1f85bd4..372ad47 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 _0xfcfc=['DATE','sequelize','exports','STRING'];(function(_0x5c67f9,_0x5f4d01){var _0x3c86b6=function(_0x551c0f){while(--_0x551c0f){_0x5c67f9['push'](_0x5c67f9['shift']());}};_0x3c86b6(++_0x5f4d01);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x35a21d,_0x3c92d9){_0x35a21d=_0x35a21d-0x0;var _0x564e89=_0xfcfc[_0x35a21d];return _0x564e89;};'use strict';var moment=require('moment');var Sequelize=require(_0xcfcf('0x0'));module[_0xcfcf('0x1')]={'uniqueid':{'type':Sequelize[_0xcfcf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcfcf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcfcf('0x3')]},'reason':{'type':Sequelize[_0xcfcf('0x2')]}}; \ No newline at end of file +var _0x1921=['STRING','DATE','moment','sequelize','exports'];(function(_0x10706f,_0x292158){var _0xa40f54=function(_0x2e0468){while(--_0x2e0468){_0x10706f['push'](_0x10706f['shift']());}};_0xa40f54(++_0x292158);}(_0x1921,0xb1));var _0x1192=function(_0x2c2987,_0xa032ab){_0x2c2987=_0x2c2987-0x0;var _0x2ad65d=_0x1921[_0x2c2987];return _0x2ad65d;};'use strict';var moment=require(_0x1192('0x0'));var Sequelize=require(_0x1192('0x1'));module[_0x1192('0x2')]={'uniqueid':{'type':Sequelize[_0x1192('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1192('0x4')]},'leaveAt':{'type':Sequelize[_0x1192('0x4')]},'acceptAt':{'type':Sequelize[_0x1192('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index bbc27af..dbc0dae 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 _0x363e=['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','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5da8b9,_0xd99e62){var _0x2e08d8=function(_0x3844c5){while(--_0x3844c5){_0x5da8b9['push'](_0x5da8b9['shift']());}};_0x2e08d8(++_0xd99e62);}(_0x363e,0x179));var _0xe363=function(_0x27ccfa,_0x4885d1){_0x27ccfa=_0x27ccfa-0x0;var _0x2f4f2=_0x363e[_0x27ccfa];return _0x2f4f2;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['ChatQueueReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));}; \ No newline at end of file +var _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key'];(function(_0x5a5a7a,_0x571535){var _0xbea751=function(_0x2c64e3){while(--_0x2c64e3){_0x5a5a7a['push'](_0x5a5a7a['shift']());}};_0xbea751(++_0x571535);}(_0x3fa4,0xf0));var _0x43fa=function(_0x2af760,_0x3a142b){_0x2af760=_0x2af760-0x0;var _0x1c4408=_0x3fa4[_0x2af760];return _0x1c4408;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['ChatQueueReport']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['ChatQueueReport'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['ChatQueueReport'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 376d82e..c93f5b5 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4da05f,_0x20a393){var _0x30b926=function(_0x2b16d3){while(--_0x2b16d3){_0x4da05f['push'](_0x4da05f['shift']());}};_0x30b926(++_0x20a393);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xcb91[_0x10291b];return _0x1d5fbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x1c09cd,_0x1ebc27){var _0x262877=function(_0xca6e96){while(--_0xca6e96){_0x1c09cd['push'](_0x1c09cd['shift']());}};_0x262877(++_0x1ebc27);}(_0x757a,0xde));var _0xa757=function(_0x1675f7,_0x34a548){_0x1675f7=_0x1675f7-0x0;var _0x5bc972=_0x757a[_0x1675f7];return _0x5bc972;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 152925b..237a19f 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 _0xecd6=['create','body','options','raw','update','where','attributes','UpdateChatQueueReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport'];(function(_0x4bd48b,_0x1a0264){var _0x3ecb8f=function(_0x3a5f2e){while(--_0x3a5f2e){_0x4bd48b['push'](_0x4bd48b['shift']());}};_0x3ecb8f(++_0x1a0264);}(_0xecd6,0xe1));var _0x6ecd=function(_0x2d7213,_0x1e9ce2){_0x2d7213=_0x2d7213-0x0;var _0x4bb328=_0xecd6[_0x2d7213];return _0x4bb328;};'use strict';var _=require(_0x6ecd('0x0'));var util=require('util');var moment=require(_0x6ecd('0x1'));var BPromise=require(_0x6ecd('0x2'));var rs=require(_0x6ecd('0x3'));var fs=require('fs');var Redis=require(_0x6ecd('0x4'));var db=require(_0x6ecd('0x5'))['db'];var utils=require(_0x6ecd('0x6'));var logger=require(_0x6ecd('0x7'))(_0x6ecd('0x8'));var config=require(_0x6ecd('0x9'));var jayson=require(_0x6ecd('0xa'));var client=jayson[_0x6ecd('0xb')][_0x6ecd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4569e9,_0x311902,_0x5f490b){return new BPromise(function(_0x427c4c,_0x5025a8){return client[_0x6ecd('0xd')](_0x4569e9,_0x5f490b)[_0x6ecd('0xe')](function(_0x308871){logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));logger[_0x6ecd('0x12')](_0x6ecd('0x13'),_0x311902,_0x6ecd('0x11'),JSON[_0x6ecd('0x14')](_0x308871));if(_0x308871[_0x6ecd('0x15')]){if(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x16')]===0x1f4){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x5025a8(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x427c4c(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}else{logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));_0x427c4c(_0x308871[_0x6ecd('0x18')][_0x6ecd('0x17')]);}})['catch'](function(_0x44351f){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x44351f);_0x5025a8(_0x44351f);});});}exports[_0x6ecd('0x19')]=function(_0x53cdb9){var _0x17c956=this;return new Promise(function(_0x227fed,_0x29502d){return db[_0x6ecd('0x1a')][_0x6ecd('0x1b')](_0x53cdb9[_0x6ecd('0x1c')],{'raw':_0x53cdb9[_0x6ecd('0x1d')]?_0x53cdb9['options'][_0x6ecd('0x1e')]===undefined?!![]:![]:!![]})[_0x6ecd('0xe')](function(_0x266825){logger[_0x6ecd('0xf')]('CreateChatQueueReport',_0x53cdb9);logger[_0x6ecd('0x12')](_0x6ecd('0x19'),_0x53cdb9,JSON['stringify'](_0x266825));_0x227fed(_0x266825);})['catch'](function(_0xe12cb8){logger[_0x6ecd('0x15')](_0x6ecd('0x19'),_0xe12cb8[_0x6ecd('0x17')],_0x53cdb9);_0x29502d(_0x17c956[_0x6ecd('0x15')](0x1f4,_0xe12cb8[_0x6ecd('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x599cdd){var _0x3c3814=this;return new Promise(function(_0x36c4c2,_0x36efa7){return db[_0x6ecd('0x1a')][_0x6ecd('0x1f')](_0x599cdd[_0x6ecd('0x1c')],{'raw':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')][_0x6ecd('0x20')]||null:null,'attributes':_0x599cdd['options']?_0x599cdd['options'][_0x6ecd('0x21')]||null:null,'limit':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')]['limit']||null:null})['then'](function(_0x5f2431){logger[_0x6ecd('0xf')](_0x6ecd('0x22'),_0x599cdd);logger[_0x6ecd('0x12')](_0x6ecd('0x22'),_0x599cdd,JSON[_0x6ecd('0x14')](_0x5f2431));_0x36c4c2(_0x5f2431);})[_0x6ecd('0x23')](function(_0x3884f4){logger['error'](_0x6ecd('0x22'),_0x3884f4['message'],_0x599cdd);_0x36efa7(_0x3c3814[_0x6ecd('0x15')](0x1f4,_0x3884f4['message']));});});}; \ No newline at end of file +var _0x88ef=['where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport'];(function(_0x4dd373,_0x122f3a){var _0x468744=function(_0x5069eb){while(--_0x5069eb){_0x4dd373['push'](_0x4dd373['shift']());}};_0x468744(++_0x122f3a);}(_0x88ef,0xea));var _0xf88e=function(_0x4ad218,_0x32e57f){_0x4ad218=_0x4ad218-0x0;var _0x1991c5=_0x88ef[_0x4ad218];return _0x1991c5;};'use strict';var _=require('lodash');var util=require(_0xf88e('0x0'));var moment=require(_0xf88e('0x1'));var BPromise=require(_0xf88e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf88e('0x3'));var db=require(_0xf88e('0x4'))['db'];var utils=require(_0xf88e('0x5'));var logger=require(_0xf88e('0x6'))(_0xf88e('0x7'));var config=require(_0xf88e('0x8'));var jayson=require(_0xf88e('0x9'));var client=jayson[_0xf88e('0xa')][_0xf88e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31fd93,_0x21f3fd,_0xfca89d){return new BPromise(function(_0x33d312,_0x4908f){return client[_0xf88e('0xc')](_0x31fd93,_0xfca89d)[_0xf88e('0xd')](function(_0x29fd05){logger['info'](_0xf88e('0xe'),_0x21f3fd,'request\x20sent');logger[_0xf88e('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x21f3fd,_0xf88e('0x10'),JSON[_0xf88e('0x11')](_0x29fd05));if(_0x29fd05['error']){if(_0x29fd05[_0xf88e('0x12')][_0xf88e('0x13')]===0x1f4){logger[_0xf88e('0x12')](_0xf88e('0xe'),_0x21f3fd,_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);return _0x4908f(_0x29fd05['error']['message']);}logger['error'](_0xf88e('0xe'),_0x21f3fd,_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);return _0x33d312(_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);}else{logger[_0xf88e('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x21f3fd,_0xf88e('0x10'));_0x33d312(_0x29fd05[_0xf88e('0x16')][_0xf88e('0x14')]);}})[_0xf88e('0x17')](function(_0x4ecd51){logger['error'](_0xf88e('0xe'),_0x21f3fd,_0x4ecd51);_0x4908f(_0x4ecd51);});});}exports[_0xf88e('0x18')]=function(_0x590cb2){var _0x543796=this;return new Promise(function(_0x1509f1,_0x83da9b){return db[_0xf88e('0x19')][_0xf88e('0x1a')](_0x590cb2[_0xf88e('0x1b')],{'raw':_0x590cb2['options']?_0x590cb2[_0xf88e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5eb1aa){logger['info'](_0xf88e('0x18'),_0x590cb2);logger[_0xf88e('0xf')]('CreateChatQueueReport',_0x590cb2,JSON[_0xf88e('0x11')](_0x5eb1aa));_0x1509f1(_0x5eb1aa);})[_0xf88e('0x17')](function(_0x5149ba){logger[_0xf88e('0x12')](_0xf88e('0x18'),_0x5149ba[_0xf88e('0x14')],_0x590cb2);_0x83da9b(_0x543796['error'](0x1f4,_0x5149ba['message']));});});};exports[_0xf88e('0x1d')]=function(_0x44e2bd){var _0x876aa8=this;return new Promise(function(_0x3aede5,_0x73b647){return db[_0xf88e('0x19')]['update'](_0x44e2bd['body'],{'raw':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x1e')]||null:null,'attributes':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x1f')]||null:null,'limit':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x20')]||null:null})[_0xf88e('0xd')](function(_0x24a495){logger[_0xf88e('0x15')](_0xf88e('0x1d'),_0x44e2bd);logger[_0xf88e('0xf')]('UpdateChatQueueReport',_0x44e2bd,JSON[_0xf88e('0x11')](_0x24a495));_0x3aede5(_0x24a495);})['catch'](function(_0x4ab40b){logger['error']('UpdateChatQueueReport',_0x4ab40b[_0xf88e('0x14')],_0x44e2bd);_0x73b647(_0x876aa8[_0xf88e('0x12')](0x1f4,_0x4ab40b[_0xf88e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index beaf863..5045342 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 _0x6208=['describe','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe'];(function(_0x47d103,_0xd2df8c){var _0x18e659=function(_0x27a38d){while(--_0x27a38d){_0x47d103['push'](_0x47d103['shift']());}};_0x18e659(++_0xd2df8c);}(_0x6208,0x96));var _0x8620=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x6208[_0x4e93a9];return _0x43013c;};'use strict';var multer=require('multer');var util=require(_0x8620('0x0'));var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require(_0x8620('0x3'));var router=express[_0x8620('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x8620('0x6')](),controller[_0x8620('0x7')]);router[_0x8620('0x8')](_0x8620('0x9'),auth[_0x8620('0x6')](),controller[_0x8620('0xa')]);router['get']('/:id',auth[_0x8620('0x6')](),controller[_0x8620('0xb')]);router[_0x8620('0xc')]('/',auth[_0x8620('0x6')](),controller[_0x8620('0xd')]);router[_0x8620('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8620('0xf')]);router[_0x8620('0x10')](_0x8620('0x11'),auth[_0x8620('0x6')](),controller[_0x8620('0x12')]);module[_0x8620('0x13')]=router; \ No newline at end of file +var _0x7cd6=['create','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','index','get','/describe','isAuthenticated','/:id','show'];(function(_0x48b964,_0x491840){var _0x527277=function(_0x27bee6){while(--_0x27bee6){_0x48b964['push'](_0x48b964['shift']());}};_0x527277(++_0x491840);}(_0x7cd6,0x1d4));var _0x67cd=function(_0x1dbc76,_0x550bab){_0x1dbc76=_0x1dbc76-0x0;var _0x1daefd=_0x7cd6[_0x1dbc76];return _0x1daefd;};'use strict';var multer=require('multer');var util=require(_0x67cd('0x0'));var path=require(_0x67cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x67cd('0x2'));var router=express[_0x67cd('0x3')]();var fs_extra=require(_0x67cd('0x4'));var auth=require(_0x67cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x67cd('0x6')]);router[_0x67cd('0x7')](_0x67cd('0x8'),auth[_0x67cd('0x9')](),controller['describe']);router[_0x67cd('0x7')](_0x67cd('0xa'),auth[_0x67cd('0x9')](),controller[_0x67cd('0xb')]);router['post']('/',auth[_0x67cd('0x9')](),controller[_0x67cd('0xc')]);router['put'](_0x67cd('0xa'),auth[_0x67cd('0x9')](),controller[_0x67cd('0xd')]);router[_0x67cd('0xe')]('/:id',auth[_0x67cd('0x9')](),controller['destroy']);module[_0x67cd('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 16ac573..addf029 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f004d,_0x4821eb){var _0x48ac0b=function(_0x32dd1e){while(--_0x32dd1e){_0x1f004d['push'](_0x1f004d['shift']());}};_0x48ac0b(++_0x4821eb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xf3cd[_0x34b821];return _0x5e00a0;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x42d45c,_0x49ac2a){var _0x1dff4f=function(_0x3f391a){while(--_0x3f391a){_0x42d45c['push'](_0x42d45c['shift']());}};_0x1dff4f(++_0x49ac2a);}(_0xedd9,0xfc));var _0x9edd=function(_0x21df16,_0x425313){_0x21df16=_0x21df16-0x0;var _0x3a06fb=_0xedd9[_0x21df16];return _0x3a06fb;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c314957..2f517f5 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 _0x411f=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','ChatTransferReport','findAll','show','params','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map'];(function(_0x47d0d7,_0x5cd8b){var _0x5563ec=function(_0x4f607b){while(--_0x4f607b){_0x47d0d7['push'](_0x47d0d7['shift']());}};_0x5563ec(++_0x5cd8b);}(_0x411f,0x1e1));var _0xf411=function(_0x3deed9,_0x5b450c){_0x3deed9=_0x3deed9-0x0;var _0x22aadf=_0x411f[_0x3deed9];return _0x22aadf;};'use strict';var emlformat=require(_0xf411('0x0'));var rimraf=require(_0xf411('0x1'));var zipdir=require(_0xf411('0x2'));var jsonpatch=require(_0xf411('0x3'));var rp=require(_0xf411('0x4'));var moment=require(_0xf411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf411('0x6'));var util=require(_0xf411('0x7'));var path=require(_0xf411('0x8'));var sox=require(_0xf411('0x9'));var csv=require(_0xf411('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf411('0xb'));var _=require(_0xf411('0xc'));var squel=require(_0xf411('0xd'));var crypto=require(_0xf411('0xe'));var jsforce=require(_0xf411('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf411('0xa'));var querystring=require(_0xf411('0x10'));var Papa=require('papaparse');var Redis=require(_0xf411('0x11'));var authService=require(_0xf411('0x12'));var qs=require(_0xf411('0x13'));var as=require(_0xf411('0x14'));var hardwareService=require(_0xf411('0x15'));var logger=require(_0xf411('0x16'))('api');var utils=require(_0xf411('0x17'));var config=require(_0xf411('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef3ee,_0x11a6ae){_0x11a6ae=_0x11a6ae||0xcc;return function(_0xe5dc27){if(_0xe5dc27){return _0x1ef3ee[_0xf411('0x19')](_0x11a6ae);}return _0x1ef3ee[_0xf411('0x1a')](_0x11a6ae)[_0xf411('0x1b')]();};}function respondWithResult(_0x4b8ade,_0x1f8715){_0x1f8715=_0x1f8715||0xc8;return function(_0x57f255){if(_0x57f255){return _0x4b8ade['status'](_0x1f8715)[_0xf411('0x1c')](_0x57f255);}};}function respondWithFilteredResult(_0x10ea85,_0x41fc46){return function(_0x58ff91){if(_0x58ff91){var _0x4c70c6=typeof _0x41fc46[_0xf411('0x1d')]===_0xf411('0x1e')&&typeof _0x41fc46[_0xf411('0x1f')]===_0xf411('0x1e');var _0x5f97f0=_0x58ff91[_0xf411('0x20')];var _0x25bab2=_0x4c70c6?0x0:_0x41fc46[_0xf411('0x1d')];var _0x55d0dc=_0x4c70c6?_0x58ff91[_0xf411('0x20')]:_0x41fc46[_0xf411('0x1d')]+_0x41fc46['limit'];var _0x3eb959;if(_0x55d0dc>=_0x5f97f0){_0x55d0dc=_0x5f97f0;_0x3eb959=0xc8;}else{_0x3eb959=0xce;}_0x10ea85['status'](_0x3eb959);return _0x10ea85[_0xf411('0x21')](_0xf411('0x22'),_0x25bab2+'-'+_0x55d0dc+'/'+_0x5f97f0)[_0xf411('0x1c')](_0x58ff91);}return null;};}function patchUpdates(_0x543d14){return function(_0x421dfe){try{jsonpatch[_0xf411('0x23')](_0x421dfe,_0x543d14,!![]);}catch(_0x1a720b){return BPromise[_0xf411('0x24')](_0x1a720b);}return _0x421dfe['save']();};}function saveUpdates(_0xfedf53,_0xf4ece9){return function(_0x3398f7){if(_0x3398f7){return _0x3398f7[_0xf411('0x25')](_0xfedf53)[_0xf411('0x26')](function(_0x2057f8){return _0x2057f8;});}return null;};}function removeEntity(_0x48fb6c,_0xd68f18){return function(_0x365a5b){if(_0x365a5b){return _0x365a5b[_0xf411('0x27')]()[_0xf411('0x26')](function(){_0x48fb6c[_0xf411('0x1a')](0xcc)[_0xf411('0x1b')]();});}};}function handleEntityNotFound(_0x498ec6,_0x34faa2){return function(_0x2f15d9){if(!_0x2f15d9){_0x498ec6[_0xf411('0x19')](0x194);}return _0x2f15d9;};}function handleError(_0x18282a,_0x2bb6dc){_0x2bb6dc=_0x2bb6dc||0x1f4;return function(_0x2b2d49){logger[_0xf411('0x28')](_0x2b2d49[_0xf411('0x29')]);if(_0x2b2d49[_0xf411('0x2a')]){delete _0x2b2d49['name'];}_0x18282a[_0xf411('0x1a')](_0x2bb6dc)['send'](_0x2b2d49);};}exports['index']=function(_0x120900,_0x37e992){var _0x58f32e={},_0x164ea5={},_0x473345={'count':0x0,'rows':[]};var _0x42b6c8=_[_0xf411('0x2b')](db['ChatTransferReport'][_0xf411('0x2c')],function(_0xb9fc99){return{'name':_0xb9fc99['fieldName'],'type':_0xb9fc99[_0xf411('0x2d')][_0xf411('0x2e')]};});_0x164ea5[_0xf411('0x2f')]=_[_0xf411('0x2b')](_0x42b6c8,'name');_0x164ea5[_0xf411('0x30')]=_[_0xf411('0x31')](_0x120900[_0xf411('0x30')]);_0x164ea5[_0xf411('0x32')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],_0x164ea5[_0xf411('0x30')]);_0x58f32e[_0xf411('0x34')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x120900[_0xf411('0x30')][_0xf411('0x35')]));_0x58f32e[_0xf411('0x34')]=_0x58f32e[_0xf411('0x34')][_0xf411('0x36')]?_0x58f32e[_0xf411('0x34')]:_0x164ea5['model'];if(!_0x120900[_0xf411('0x30')][_0xf411('0x37')](_0xf411('0x38'))){_0x58f32e[_0xf411('0x1f')]=qs[_0xf411('0x1f')](_0x120900[_0xf411('0x30')]['limit']);_0x58f32e[_0xf411('0x1d')]=qs[_0xf411('0x1d')](_0x120900[_0xf411('0x30')]['offset']);}_0x58f32e[_0xf411('0x39')]=qs[_0xf411('0x3a')](_0x120900[_0xf411('0x30')][_0xf411('0x3a')]);_0x58f32e['where']=qs['filters'](_[_0xf411('0x3b')](_0x120900[_0xf411('0x30')],_0x164ea5['filters']),_0x42b6c8);if(_0x120900[_0xf411('0x30')][_0xf411('0x3c')]){_0x58f32e[_0xf411('0x3d')]=_[_0xf411('0x3e')](_0x58f32e[_0xf411('0x3d')],{'$or':_['map'](_0x42b6c8,function(_0xd851e0){if(_0xd851e0['type']!=='VIRTUAL'){var _0x13dd97={};_0x13dd97[_0xd851e0[_0xf411('0x2a')]]={'$like':'%'+_0x120900['query'][_0xf411('0x3c')]+'%'};return _0x13dd97;}})});}_0x58f32e=_[_0xf411('0x3e')]({},_0x58f32e,_0x120900[_0xf411('0x3f')]);var _0x47d881={'where':_0x58f32e[_0xf411('0x3d')]};return db['ChatTransferReport'][_0xf411('0x20')](_0x47d881)[_0xf411('0x26')](function(_0x11ac30){_0x473345[_0xf411('0x20')]=_0x11ac30;if(_0x120900[_0xf411('0x30')][_0xf411('0x40')]){_0x58f32e[_0xf411('0x41')]=[{'all':!![]}];}return db[_0xf411('0x42')][_0xf411('0x43')](_0x58f32e);})['then'](function(_0x190fa8){_0x473345['rows']=_0x190fa8;return _0x473345;})[_0xf411('0x26')](respondWithFilteredResult(_0x37e992,_0x58f32e))['catch'](handleError(_0x37e992,null));};exports[_0xf411('0x44')]=function(_0x3c6ce1,_0x1a682c){var _0x4a7512={'raw':!![],'where':{'id':_0x3c6ce1[_0xf411('0x45')]['id']}},_0x368b87={};_0x368b87[_0xf411('0x2f')]=_[_0xf411('0x31')](db['ChatTransferReport'][_0xf411('0x2c')]);_0x368b87[_0xf411('0x30')]=_['keys'](_0x3c6ce1[_0xf411('0x30')]);_0x368b87[_0xf411('0x32')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],_0x368b87[_0xf411('0x30')]);_0x4a7512[_0xf411('0x34')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x3c6ce1[_0xf411('0x30')][_0xf411('0x35')]));_0x4a7512['attributes']=_0x4a7512['attributes'][_0xf411('0x36')]?_0x4a7512[_0xf411('0x34')]:_0x368b87[_0xf411('0x2f')];if(_0x3c6ce1[_0xf411('0x30')][_0xf411('0x40')]){_0x4a7512[_0xf411('0x41')]=[{'all':!![]}];}_0x4a7512=_[_0xf411('0x3e')]({},_0x4a7512,_0x3c6ce1[_0xf411('0x3f')]);return db['ChatTransferReport']['find'](_0x4a7512)['then'](handleEntityNotFound(_0x1a682c,null))['then'](respondWithResult(_0x1a682c,null))['catch'](handleError(_0x1a682c,null));};exports[_0xf411('0x46')]=function(_0x533580,_0x1590f5){return db[_0xf411('0x42')][_0xf411('0x46')](_0x533580[_0xf411('0x47')],{})[_0xf411('0x26')](respondWithResult(_0x1590f5,0xc9))['catch'](handleError(_0x1590f5,null));};exports[_0xf411('0x25')]=function(_0x4dcd93,_0x4b698b){if(_0x4dcd93['body']['id']){delete _0x4dcd93[_0xf411('0x47')]['id'];}return db[_0xf411('0x42')]['find']({'where':{'id':_0x4dcd93[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b698b,null))['then'](saveUpdates(_0x4dcd93[_0xf411('0x47')],null))['then'](respondWithResult(_0x4b698b,null))[_0xf411('0x48')](handleError(_0x4b698b,null));};exports[_0xf411('0x27')]=function(_0x234d69,_0x5c09b3){return db[_0xf411('0x42')][_0xf411('0x49')]({'where':{'id':_0x234d69[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c09b3,null))[_0xf411('0x26')](removeEntity(_0x5c09b3,null))[_0xf411('0x48')](handleError(_0x5c09b3,null));};exports[_0xf411('0x4a')]=function(_0x412e30,_0x2d3495){return db[_0xf411('0x42')][_0xf411('0x4a')]()[_0xf411('0x26')](respondWithResult(_0x2d3495,null))[_0xf411('0x48')](handleError(_0x2d3495,null));}; \ No newline at end of file +var _0x9a79=['pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x573348,_0x303090){var _0x32b200=function(_0x497487){while(--_0x497487){_0x573348['push'](_0x573348['shift']());}};_0x32b200(++_0x303090);}(_0x9a79,0x183));var _0x99a7=function(_0x3e27bf,_0x1351fa){_0x3e27bf=_0x3e27bf-0x0;var _0x3ddb4f=_0x9a79[_0x3e27bf];return _0x3ddb4f;};'use strict';var emlformat=require(_0x99a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99a7('0x1'));var jsonpatch=require(_0x99a7('0x2'));var rp=require(_0x99a7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x99a7('0x4'));var util=require('util');var path=require(_0x99a7('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x99a7('0x6'));var fs=require('fs');var fs_extra=require(_0x99a7('0x7'));var _=require('lodash');var squel=require(_0x99a7('0x8'));var crypto=require(_0x99a7('0x9'));var jsforce=require(_0x99a7('0xa'));var deskjs=require(_0x99a7('0xb'));var toCsv=require(_0x99a7('0xc'));var querystring=require(_0x99a7('0xd'));var Papa=require(_0x99a7('0xe'));var Redis=require(_0x99a7('0xf'));var authService=require(_0x99a7('0x10'));var qs=require(_0x99a7('0x11'));var as=require(_0x99a7('0x12'));var hardwareService=require(_0x99a7('0x13'));var logger=require(_0x99a7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x99a7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x99a7('0x16'))['db'];function respondWithStatusCode(_0x10a1c9,_0x527a03){_0x527a03=_0x527a03||0xcc;return function(_0x2f165b){if(_0x2f165b){return _0x10a1c9[_0x99a7('0x17')](_0x527a03);}return _0x10a1c9[_0x99a7('0x18')](_0x527a03)[_0x99a7('0x19')]();};}function respondWithResult(_0x31757e,_0xaa16fd){_0xaa16fd=_0xaa16fd||0xc8;return function(_0x471a66){if(_0x471a66){return _0x31757e[_0x99a7('0x18')](_0xaa16fd)[_0x99a7('0x1a')](_0x471a66);}};}function respondWithFilteredResult(_0x59f49f,_0x504b25){return function(_0x5d5749){if(_0x5d5749){var _0x365c72=typeof _0x504b25['offset']===_0x99a7('0x1b')&&typeof _0x504b25[_0x99a7('0x1c')]===_0x99a7('0x1b');var _0x50a3e7=_0x5d5749['count'];var _0x5aeee2=_0x365c72?0x0:_0x504b25[_0x99a7('0x1d')];var _0x2958a9=_0x365c72?_0x5d5749[_0x99a7('0x1e')]:_0x504b25['offset']+_0x504b25[_0x99a7('0x1c')];var _0x21cfa3;if(_0x2958a9>=_0x50a3e7){_0x2958a9=_0x50a3e7;_0x21cfa3=0xc8;}else{_0x21cfa3=0xce;}_0x59f49f[_0x99a7('0x18')](_0x21cfa3);return _0x59f49f[_0x99a7('0x1f')](_0x99a7('0x20'),_0x5aeee2+'-'+_0x2958a9+'/'+_0x50a3e7)[_0x99a7('0x1a')](_0x5d5749);}return null;};}function patchUpdates(_0x481fc7){return function(_0x23433b){try{jsonpatch[_0x99a7('0x21')](_0x23433b,_0x481fc7,!![]);}catch(_0x2043c0){return BPromise['reject'](_0x2043c0);}return _0x23433b['save']();};}function saveUpdates(_0x2a3a41,_0x210376){return function(_0x127c9f){if(_0x127c9f){return _0x127c9f[_0x99a7('0x22')](_0x2a3a41)[_0x99a7('0x23')](function(_0x10d0a9){return _0x10d0a9;});}return null;};}function removeEntity(_0x5c61cc,_0x4890e6){return function(_0x379f91){if(_0x379f91){return _0x379f91[_0x99a7('0x24')]()[_0x99a7('0x23')](function(){_0x5c61cc[_0x99a7('0x18')](0xcc)[_0x99a7('0x19')]();});}};}function handleEntityNotFound(_0x1b580f,_0x230849){return function(_0x181561){if(!_0x181561){_0x1b580f[_0x99a7('0x17')](0x194);}return _0x181561;};}function handleError(_0xb1e19c,_0x3344fe){_0x3344fe=_0x3344fe||0x1f4;return function(_0x51d2ac){logger[_0x99a7('0x25')](_0x51d2ac[_0x99a7('0x26')]);if(_0x51d2ac[_0x99a7('0x27')]){delete _0x51d2ac[_0x99a7('0x27')];}_0xb1e19c[_0x99a7('0x18')](_0x3344fe)['send'](_0x51d2ac);};}exports[_0x99a7('0x28')]=function(_0x51650f,_0x55d36e){var _0x47d304={},_0x442051={},_0x41ce98={'count':0x0,'rows':[]};var _0x3f58d3=_[_0x99a7('0x29')](db[_0x99a7('0x2a')][_0x99a7('0x2b')],function(_0x3fb59f){return{'name':_0x3fb59f['fieldName'],'type':_0x3fb59f[_0x99a7('0x2c')][_0x99a7('0x2d')]};});_0x442051[_0x99a7('0x2e')]=_['map'](_0x3f58d3,'name');_0x442051[_0x99a7('0x2f')]=_['keys'](_0x51650f['query']);_0x442051['filters']=_[_0x99a7('0x30')](_0x442051[_0x99a7('0x2e')],_0x442051[_0x99a7('0x2f')]);_0x47d304[_0x99a7('0x31')]=_[_0x99a7('0x30')](_0x442051[_0x99a7('0x2e')],qs[_0x99a7('0x32')](_0x51650f[_0x99a7('0x2f')][_0x99a7('0x32')]));_0x47d304[_0x99a7('0x31')]=_0x47d304[_0x99a7('0x31')][_0x99a7('0x33')]?_0x47d304[_0x99a7('0x31')]:_0x442051[_0x99a7('0x2e')];if(!_0x51650f[_0x99a7('0x2f')][_0x99a7('0x34')](_0x99a7('0x35'))){_0x47d304[_0x99a7('0x1c')]=qs[_0x99a7('0x1c')](_0x51650f[_0x99a7('0x2f')]['limit']);_0x47d304[_0x99a7('0x1d')]=qs[_0x99a7('0x1d')](_0x51650f['query'][_0x99a7('0x1d')]);}_0x47d304[_0x99a7('0x36')]=qs['sort'](_0x51650f[_0x99a7('0x2f')][_0x99a7('0x37')]);_0x47d304[_0x99a7('0x38')]=qs['filters'](_[_0x99a7('0x39')](_0x51650f[_0x99a7('0x2f')],_0x442051[_0x99a7('0x3a')]),_0x3f58d3);if(_0x51650f[_0x99a7('0x2f')][_0x99a7('0x3b')]){_0x47d304[_0x99a7('0x38')]=_[_0x99a7('0x3c')](_0x47d304[_0x99a7('0x38')],{'$or':_['map'](_0x3f58d3,function(_0x34e481){if(_0x34e481['type']!==_0x99a7('0x3d')){var _0xc38799={};_0xc38799[_0x34e481[_0x99a7('0x27')]]={'$like':'%'+_0x51650f[_0x99a7('0x2f')]['filter']+'%'};return _0xc38799;}})});}_0x47d304=_[_0x99a7('0x3c')]({},_0x47d304,_0x51650f['options']);var _0x3b64c4={'where':_0x47d304[_0x99a7('0x38')]};return db[_0x99a7('0x2a')]['count'](_0x3b64c4)[_0x99a7('0x23')](function(_0x6928c0){_0x41ce98[_0x99a7('0x1e')]=_0x6928c0;if(_0x51650f[_0x99a7('0x2f')][_0x99a7('0x3e')]){_0x47d304[_0x99a7('0x3f')]=[{'all':!![]}];}return db[_0x99a7('0x2a')][_0x99a7('0x40')](_0x47d304);})[_0x99a7('0x23')](function(_0x4d3e5e){_0x41ce98['rows']=_0x4d3e5e;return _0x41ce98;})[_0x99a7('0x23')](respondWithFilteredResult(_0x55d36e,_0x47d304))[_0x99a7('0x41')](handleError(_0x55d36e,null));};exports[_0x99a7('0x42')]=function(_0x542c97,_0x3f3c5f){var _0x290d6f={'raw':!![],'where':{'id':_0x542c97['params']['id']}},_0x1b364f={};_0x1b364f['model']=_[_0x99a7('0x43')](db[_0x99a7('0x2a')][_0x99a7('0x2b')]);_0x1b364f[_0x99a7('0x2f')]=_[_0x99a7('0x43')](_0x542c97[_0x99a7('0x2f')]);_0x1b364f['filters']=_[_0x99a7('0x30')](_0x1b364f[_0x99a7('0x2e')],_0x1b364f[_0x99a7('0x2f')]);_0x290d6f[_0x99a7('0x31')]=_['intersection'](_0x1b364f['model'],qs[_0x99a7('0x32')](_0x542c97[_0x99a7('0x2f')]['fields']));_0x290d6f[_0x99a7('0x31')]=_0x290d6f['attributes'][_0x99a7('0x33')]?_0x290d6f[_0x99a7('0x31')]:_0x1b364f[_0x99a7('0x2e')];if(_0x542c97[_0x99a7('0x2f')][_0x99a7('0x3e')]){_0x290d6f[_0x99a7('0x3f')]=[{'all':!![]}];}_0x290d6f=_[_0x99a7('0x3c')]({},_0x290d6f,_0x542c97[_0x99a7('0x44')]);return db[_0x99a7('0x2a')][_0x99a7('0x45')](_0x290d6f)['then'](handleEntityNotFound(_0x3f3c5f,null))[_0x99a7('0x23')](respondWithResult(_0x3f3c5f,null))['catch'](handleError(_0x3f3c5f,null));};exports[_0x99a7('0x46')]=function(_0x696e21,_0x15cbf5){return db[_0x99a7('0x2a')][_0x99a7('0x46')](_0x696e21[_0x99a7('0x47')],{})[_0x99a7('0x23')](respondWithResult(_0x15cbf5,0xc9))[_0x99a7('0x41')](handleError(_0x15cbf5,null));};exports[_0x99a7('0x22')]=function(_0x75a662,_0x54bba9){if(_0x75a662[_0x99a7('0x47')]['id']){delete _0x75a662[_0x99a7('0x47')]['id'];}return db[_0x99a7('0x2a')]['find']({'where':{'id':_0x75a662[_0x99a7('0x48')]['id']}})[_0x99a7('0x23')](handleEntityNotFound(_0x54bba9,null))[_0x99a7('0x23')](saveUpdates(_0x75a662[_0x99a7('0x47')],null))[_0x99a7('0x23')](respondWithResult(_0x54bba9,null))[_0x99a7('0x41')](handleError(_0x54bba9,null));};exports['destroy']=function(_0x298fe5,_0xce8932){return db[_0x99a7('0x2a')]['find']({'where':{'id':_0x298fe5[_0x99a7('0x48')]['id']}})[_0x99a7('0x23')](handleEntityNotFound(_0xce8932,null))['then'](removeEntity(_0xce8932,null))[_0x99a7('0x41')](handleError(_0xce8932,null));};exports[_0x99a7('0x49')]=function(_0x3b3282,_0x45982a){return db[_0x99a7('0x2a')][_0x99a7('0x49')]()[_0x99a7('0x23')](respondWithResult(_0x45982a,null))[_0x99a7('0x41')](handleError(_0x45982a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 2f2d7fb..166cc32 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 _0x9c1b=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1d5108,_0x55e387){var _0x3cdd9d=function(_0x2330f5){while(--_0x2330f5){_0x1d5108['push'](_0x1d5108['shift']());}};_0x3cdd9d(++_0x55e387);}(_0x9c1b,0x10d));var _0xb9c1=function(_0x120fdb,_0x586aa3){_0x120fdb=_0x120fdb-0x0;var _0xc2f5ba=_0x9c1b[_0x120fdb];return _0xc2f5ba;};'use strict';var _=require(_0xb9c1('0x0'));var util=require(_0xb9c1('0x1'));var logger=require(_0xb9c1('0x2'))('api');var moment=require(_0xb9c1('0x3'));var BPromise=require(_0xb9c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c1('0x5'));var rimraf=require(_0xb9c1('0x6'));var config=require(_0xb9c1('0x7'));var attributes=require(_0xb9c1('0x8'));module['exports']=function(_0x109fd3,_0x285b29){return _0x109fd3['define'](_0xb9c1('0x9'),attributes,{'tableName':_0xb9c1('0xa'),'paranoid':![],'indexes':[{'name':_0xb9c1('0xb'),'fields':[_0xb9c1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc7b=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x4b136a,_0xa8310c){var _0x51a36b=function(_0x35970e){while(--_0x35970e){_0x4b136a['push'](_0x4b136a['shift']());}};_0x51a36b(++_0xa8310c);}(_0xfc7b,0x140));var _0xbfc7=function(_0x593467,_0x14e615){_0x593467=_0x593467-0x0;var _0x67a71b=_0xfc7b[_0x593467];return _0x67a71b;};'use strict';var _=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var logger=require(_0xbfc7('0x2'))(_0xbfc7('0x3'));var moment=require('moment');var BPromise=require(_0xbfc7('0x4'));var rp=require(_0xbfc7('0x5'));var fs=require('fs');var path=require(_0xbfc7('0x6'));var rimraf=require(_0xbfc7('0x7'));var config=require('../../config/environment');var attributes=require(_0xbfc7('0x8'));module[_0xbfc7('0x9')]=function(_0xe8fe35,_0x2ac233){return _0xe8fe35[_0xbfc7('0xa')]('ChatTransferReport',attributes,{'tableName':_0xbfc7('0xb'),'paranoid':![],'indexes':[{'name':_0xbfc7('0xc'),'fields':[_0xbfc7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 65eb0d0..ed5521d 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 _0x9cd4=['ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x50fe34,_0x14a248){var _0x5eab16=function(_0x2f5b6f){while(--_0x2f5b6f){_0x50fe34['push'](_0x50fe34['shift']());}};_0x5eab16(++_0x14a248);}(_0x9cd4,0x171));var _0x49cd=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x9cd4[_0x4e7af4];return _0x2548f1;};'use strict';var _=require('lodash');var util=require(_0x49cd('0x0'));var moment=require(_0x49cd('0x1'));var BPromise=require(_0x49cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x49cd('0x4'));var logger=require('../../config/logger')(_0x49cd('0x5'));var config=require(_0x49cd('0x6'));var jayson=require(_0x49cd('0x7'));var client=jayson[_0x49cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521d8b,_0x252487,_0x3b50a1){return new BPromise(function(_0x6b551c,_0x48adb7){return client[_0x49cd('0x9')](_0x521d8b,_0x3b50a1)['then'](function(_0x22126b){logger[_0x49cd('0xa')](_0x49cd('0xb'),_0x252487,'request\x20sent');logger[_0x49cd('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x252487,_0x49cd('0xd'),JSON[_0x49cd('0xe')](_0x22126b));if(_0x22126b[_0x49cd('0xf')]){if(_0x22126b[_0x49cd('0xf')][_0x49cd('0x10')]===0x1f4){logger[_0x49cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x48adb7(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}logger['error'](_0x49cd('0xb'),_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x6b551c(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}else{logger['info'](_0x49cd('0xb'),_0x252487,_0x49cd('0xd'));_0x6b551c(_0x22126b[_0x49cd('0x12')][_0x49cd('0x11')]);}})[_0x49cd('0x13')](function(_0x2fb397){logger[_0x49cd('0xf')](_0x49cd('0xb'),_0x252487,_0x2fb397);_0x48adb7(_0x2fb397);});});} \ No newline at end of file +var _0xa930=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0xa930,0x1c0));var _0x0a93=function(_0xcb0c01,_0x43ba1c){_0xcb0c01=_0xcb0c01-0x0;var _0x26756d=_0xa930[_0xcb0c01];return _0x26756d;};'use strict';var _=require(_0x0a93('0x0'));var util=require(_0x0a93('0x1'));var moment=require(_0x0a93('0x2'));var BPromise=require(_0x0a93('0x3'));var rs=require(_0x0a93('0x4'));var fs=require('fs');var Redis=require(_0x0a93('0x5'));var db=require(_0x0a93('0x6'))['db'];var utils=require(_0x0a93('0x7'));var logger=require(_0x0a93('0x8'))(_0x0a93('0x9'));var config=require(_0x0a93('0xa'));var jayson=require(_0x0a93('0xb'));var client=jayson['client'][_0x0a93('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x465359,_0x5e3a09,_0x7bb695){return new BPromise(function(_0x23eb3f,_0xba4017){return client[_0x0a93('0xd')](_0x465359,_0x7bb695)[_0x0a93('0xe')](function(_0x3ff0f3){logger[_0x0a93('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5e3a09,_0x0a93('0x10'));logger[_0x0a93('0x11')](_0x0a93('0x12'),_0x5e3a09,'request\x20sent',JSON['stringify'](_0x3ff0f3));if(_0x3ff0f3[_0x0a93('0x13')]){if(_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x14')]===0x1f4){logger['error'](_0x0a93('0x15'),_0x5e3a09,_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);return _0xba4017(_0x3ff0f3[_0x0a93('0x13')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5e3a09,_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);return _0x23eb3f(_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);}else{logger[_0x0a93('0xf')](_0x0a93('0x15'),_0x5e3a09,_0x0a93('0x10'));_0x23eb3f(_0x3ff0f3[_0x0a93('0x17')][_0x0a93('0x16')]);}})[_0x0a93('0x18')](function(_0x30694d){logger[_0x0a93('0x13')](_0x0a93('0x15'),_0x5e3a09,_0x30694d);_0xba4017(_0x30694d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index b390975..c983080 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 _0x1823=['exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3a175b,_0x505d13){var _0x9b84fa=function(_0x5533e1){while(--_0x5533e1){_0x3a175b['push'](_0x3a175b['shift']());}};_0x9b84fa(++_0x505d13);}(_0x1823,0x11e));var _0x3182=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x1823[_0x39ce5a];return _0x46cd9a;};'use strict';var multer=require('multer');var util=require(_0x3182('0x0'));var path=require(_0x3182('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3182('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3182('0x3'));var config=require(_0x3182('0x4'));var controller=require(_0x3182('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3182('0x6')](_0x3182('0x7'),auth[_0x3182('0x8')](),controller[_0x3182('0x9')]);router[_0x3182('0x6')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0xb')]);router[_0x3182('0xc')]('/',auth[_0x3182('0x8')](),controller[_0x3182('0xd')]);router[_0x3182('0xe')](_0x3182('0xa'),auth['isAuthenticated'](),controller[_0x3182('0xf')]);router[_0x3182('0x10')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0x11')]);module[_0x3182('0x12')]=router; \ No newline at end of file +var _0xe90a=['describe','post','put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated'];(function(_0x5c6c04,_0x4d576a){var _0x403115=function(_0xfdd4ba){while(--_0xfdd4ba){_0x5c6c04['push'](_0x5c6c04['shift']());}};_0x403115(++_0x4d576a);}(_0xe90a,0x6b));var _0xae90=function(_0x549c51,_0x29e6fd){_0x549c51=_0x549c51-0x0;var _0x264861=_0xe90a[_0x549c51];return _0x264861;};'use strict';var multer=require('multer');var util=require(_0xae90('0x0'));var path=require(_0xae90('0x1'));var timeout=require(_0xae90('0x2'));var express=require(_0xae90('0x3'));var router=express[_0xae90('0x4')]();var fs_extra=require(_0xae90('0x5'));var auth=require(_0xae90('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae90('0x7'));var controller=require(_0xae90('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xae90('0x9')]);router[_0xae90('0xa')](_0xae90('0xb'),auth[_0xae90('0xc')](),controller[_0xae90('0xd')]);router[_0xae90('0xa')]('/:id',auth[_0xae90('0xc')](),controller['show']);router[_0xae90('0xe')]('/',auth[_0xae90('0xc')](),controller['create']);router[_0xae90('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xae90('0x10')]);router[_0xae90('0x11')](_0xae90('0x12'),auth[_0xae90('0xc')](),controller[_0xae90('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9ba5114..b8a0049 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 _0x8283=['#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate'];(function(_0x3a4053,_0x5684ee){var _0x42af54=function(_0x97a4b6){while(--_0x97a4b6){_0x3a4053['push'](_0x3a4053['shift']());}};_0x42af54(++_0x5684ee);}(_0x8283,0x173));var _0x3828=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8283[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3828('0x0'));var rs=require('randomstring');module[_0x3828('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3828('0x2')},'description':{'type':Sequelize[_0x3828('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3828('0xa'),'squared'),'defaultValue':_0x3828('0xa')},'header_online':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xb')},'offline_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'header_offline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3828('0xf')]},'closingQuestion':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x12')},'noteTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x13')},'placeholderMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x14')},'closingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x15')},'closingMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'skipMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'conditionAgreement':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x17')},'ratingType':{'type':Sequelize[_0x3828('0x18')](_0x3828('0x19'),_0x3828('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'variable':null,'config':{'placeholder':_0x3828('0x1d'),'type':'text','required':!![]},'props':{'title':_0x3828('0x1d'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3828('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x1f'))?JSON[_0x3828('0x20')](this[_0x3828('0x1e')](_0x3828('0x1f'))):{};},'set':function(_0x176b5f){return this[_0x3828('0x21')]('onlineForm',JSON['stringify'](_0x176b5f));}},'offlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'props':{'title':_0x3828('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x3828('0x22'),'config':{'placeholder':_0x3828('0x23')},'props':{'title':'Comments','helpText':_0x3828('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x25'))?JSON['parse'](this['getDataValue'](_0x3828('0x25'))):{};},'set':function(_0x5b714f){return this['setDataValue']('offlineForm',JSON[_0x3828('0x1b')](_0x5b714f));}},'token':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return rs[_0x3828('0x26')]();}},'autoclose':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3828('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x27')},'waitingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'sendUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3828('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3828('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x2c')},'defaultTitle':{'type':Sequelize[_0x3828('0x3')]},'customerAvatar':{'type':Sequelize[_0x3828('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3828('0x8')],'comment':_0x3828('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'comment':_0x3828('0x30'),'set':function(_0x2874b0){if(!_0x2874b0)this[_0x3828('0x21')](_0x3828('0x31'),null);this[_0x3828('0x21')]('mandatoryDisposition',_0x2874b0);}},'vidaooEscalation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3828('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x32')},'vidaooNote':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return _0x3828('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x3828('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3828('0xf')]}}; \ No newline at end of file +var _0x48f7=['onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Form\x20properly\x20submitted','Note','Skip','Feedback','star','thumb','stringify','input','name','getDataValue'];(function(_0x588e09,_0xdcccdb){var _0x24d9a1=function(_0x22a1ef){while(--_0x22a1ef){_0x588e09['push'](_0x588e09['shift']());}};_0x24d9a1(++_0xdcccdb);}(_0x48f7,0x71));var _0x748f=function(_0x19f4aa,_0x17a0d6){_0x19f4aa=_0x19f4aa-0x0;var _0x2aed12=_0x48f7[_0x19f4aa];return _0x2aed12;};'use strict';var Sequelize=require(_0x748f('0x0'));var rs=require('randomstring');module[_0x748f('0x1')]={'name':{'type':Sequelize[_0x748f('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x748f('0x3')},'description':{'type':Sequelize[_0x748f('0x2')]},'mapKey':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x4')},'mapKeyOffline':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x4')},'key':{'type':Sequelize[_0x748f('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x5')},'customerAlias':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x748f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x748f('0x9')]('rounded',_0x748f('0xa')),'defaultValue':_0x748f('0xb')},'header_online':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xc')},'start_chat_button':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xd')},'offline_chat_button':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xe')},'header_offline':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x748f('0x11')]},'closingQuestion':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x13')},'placeholderMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0xe')},'skipMessageButton':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x748f('0x16'),_0x748f('0x17')),'defaultValue':_0x748f('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x748f('0x18')]({'items':[{'type':_0x748f('0x19'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x748f('0x1a'),'helpText':''}},{'type':_0x748f('0x19'),'props':{'title':_0x748f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x748f('0x4'),'type':_0x748f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x748f('0x1b')](_0x748f('0x1c'))?JSON[_0x748f('0x1d')](this[_0x748f('0x1b')](_0x748f('0x1c'))):{};},'set':function(_0x181fdd){return this[_0x748f('0x1e')](_0x748f('0x1c'),JSON[_0x748f('0x18')](_0x181fdd));}},'offlineForm':{'type':Sequelize[_0x748f('0x11')],'defaultValue':function(){return JSON[_0x748f('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x748f('0x4'),'type':_0x748f('0x4')},'variable':null},{'type':_0x748f('0x1f'),'config':{'placeholder':_0x748f('0x20')},'props':{'title':_0x748f('0x20'),'helpText':_0x748f('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x748f('0x1b')](_0x748f('0x22'))?JSON[_0x748f('0x1d')](this[_0x748f('0x1b')](_0x748f('0x22'))):{};},'set':function(_0x1de9f2){return this[_0x748f('0x1e')](_0x748f('0x22'),JSON[_0x748f('0x18')](_0x1de9f2));}},'token':{'type':Sequelize[_0x748f('0x2')],'defaultValue':function(){return rs[_0x748f('0x23')]();}},'autoclose':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x748f('0x2')]},'waitingTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x24')},'waitingMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0x14')},'sendUnmanaged':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x748f('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x748f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0x748f('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x748f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x27')},'verticalAlignment':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x28')},'messagesAlignment':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x748f('0x2')]},'customerAvatar':{'type':Sequelize[_0x748f('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x748f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0x2a')},'systemAvatar':{'type':Sequelize[_0x748f('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x748f('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a7071){if(!_0x5a7071)this[_0x748f('0x1e')](_0x748f('0x2c'),null);this[_0x748f('0x1e')]('mandatoryDisposition',_0x5a7071);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x748f('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x748f('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x748f('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index fb7162e..2ba933c 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 _0xa9e0=['fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','bluebird','mustache','util','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','asc','from','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','attachments','offline-chat','basename','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','mapValues','subjectOffline','Chat','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','some','x-real-ip','connection','remoteAddress','replace','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x207b7f,_0x1d1323){var _0x2d6d8e=function(_0x40156f){while(--_0x40156f){_0x207b7f['push'](_0x207b7f['shift']());}};_0x2d6d8e(++_0x1d1323);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var BPromise=require(_0x0a9e('0x0'));var Mustache=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x3'));var _=require('lodash');var querystring=require(_0x0a9e('0x4'));var Redis=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var db=require(_0x0a9e('0x9'))['db'];config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0a9e('0xd')](socket);var htmlToText=require(_0x0a9e('0xe'));var jayson=require(_0x0a9e('0xf'));var client=jayson[_0x0a9e('0x10')][_0x0a9e('0x11')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x10')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x0a9e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x12')](_0x36471c,_0x26d672)[_0x0a9e('0x13')](function(_0x281129){logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x17'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x18')]){if(_0x281129[_0x0a9e('0x18')]['code']===0x1f4){logger[_0x0a9e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x5db4b0(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}logger[_0x0a9e('0x18')](_0x0a9e('0x15'),_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x69aeb7(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}else{logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1a')][_0x0a9e('0x19')]);}})['catch'](function(_0x20f109){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1b')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1d')](_0x3b45bc)[_0x0a9e('0x1e')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x1f')]===_0x0a9e('0x20')&&typeof _0x5ea472[_0x0a9e('0x21')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x22')]:_0x5ea472[_0x0a9e('0x1f')]+_0x5ea472[_0x0a9e('0x21')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1d')](_0x140511);return _0x16b1ca[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x25')](_0x3652a7)[_0x0a9e('0x13')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x26')]()[_0x0a9e('0x13')](function(){var _0x58b06f=_0x40e7a3[_0x0a9e('0x27')]({'plain':!![]});var _0x296f41=_0x0a9e('0x28');return db[_0x0a9e('0x29')]['destroy']({'where':{'type':_0x296f41,'resourceId':_0x58b06f['id']}})[_0x0a9e('0x13')](function(){return _0x40e7a3;});})['then'](function(){_0x15b200[_0x0a9e('0x1d')](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x1122db){return function(_0x33bdb7){if(!_0x33bdb7){_0x1122db[_0x0a9e('0x1b')](0x194);}return _0x33bdb7;};}function handleError(_0x5180f1,_0x66c1d2){_0x66c1d2=_0x66c1d2||0x1f4;return function(_0x46f0a5){logger[_0x0a9e('0x18')](_0x46f0a5[_0x0a9e('0x2a')]);if(_0x46f0a5[_0x0a9e('0x2b')]){delete _0x46f0a5[_0x0a9e('0x2b')];}_0x5180f1[_0x0a9e('0x1d')](_0x66c1d2)[_0x0a9e('0x2c')](_0x46f0a5);};}exports['index']=function(_0x44295a,_0x5e7238){var _0x2cc7a0={'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]},_0x14b13f={},_0x2b7e7f={'count':0x0,'rows':[]};var _0x191e91=_[_0x0a9e('0x2e')](db[_0x0a9e('0x2f')][_0x0a9e('0x30')],function(_0x4853b1){return{'name':_0x4853b1['fieldName'],'type':_0x4853b1[_0x0a9e('0x31')]['key']};});_0x14b13f[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](_0x191e91,_0x0a9e('0x2b'));_0x14b13f[_0x0a9e('0x33')]=_['keys'](_0x44295a[_0x0a9e('0x33')]);_0x14b13f[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x14b13f['model'],_0x14b13f[_0x0a9e('0x33')]);_0x2cc7a0[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x14b13f['model'],qs['fields'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x2cc7a0['attributes']=_0x2cc7a0[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x2cc7a0[_0x0a9e('0x36')]:_0x14b13f[_0x0a9e('0x32')];if(!_0x44295a['query']['hasOwnProperty'](_0x0a9e('0x39'))){_0x2cc7a0[_0x0a9e('0x21')]=qs['limit'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x2cc7a0[_0x0a9e('0x1f')]=qs['offset'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x2cc7a0[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x2cc7a0[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x44295a[_0x0a9e('0x33')],_0x14b13f[_0x0a9e('0x34')]),_0x191e91);if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x2cc7a0[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x2cc7a0['where'],{'$or':_['map'](_0x191e91,function(_0x473fdc){if(_0x473fdc[_0x0a9e('0x31')]!==_0x0a9e('0x40')){var _0x315881={};_0x315881[_0x473fdc[_0x0a9e('0x2b')]]={'$like':'%'+_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x315881;}})});}_0x2cc7a0=_[_0x0a9e('0x3f')]({},_0x2cc7a0,_0x44295a[_0x0a9e('0x41')]);var _0x25c6e6={'where':_0x2cc7a0[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2f')]['count'](_0x25c6e6)[_0x0a9e('0x13')](function(_0x138b8b){_0x2b7e7f[_0x0a9e('0x22')]=_0x138b8b;if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x2cc7a0[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x2f')][_0x0a9e('0x44')](_0x2cc7a0);})['then'](function(_0x2e9d90){_0x2b7e7f['rows']=_0x2e9d90;return _0x2b7e7f;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x5e7238,_0x2cc7a0))[_0x0a9e('0x45')](handleError(_0x5e7238,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){var _0x7f6eb1={'raw':![],'where':{'id':_0x562fb4[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':_0x0a9e('0x48')}]},_0x4774f4={};_0x4774f4[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x2f')][_0x0a9e('0x30')]);_0x4774f4[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x33')]);_0x4774f4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],_0x4774f4[_0x0a9e('0x33')]);_0x7f6eb1['attributes']=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],qs['fields'](_0x562fb4['query']['fields']));_0x7f6eb1[_0x0a9e('0x36')]=_0x7f6eb1[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x7f6eb1[_0x0a9e('0x36')]:_0x4774f4[_0x0a9e('0x32')];if(_0x562fb4[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x7f6eb1[_0x0a9e('0x43')]=[{'all':!![]}];}_0x7f6eb1=_['merge']({},_0x7f6eb1,_0x562fb4['options']);return db['ChatWebsite'][_0x0a9e('0x4a')](_0x7f6eb1)[_0x0a9e('0x13')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x13')](respondWithResult(_0x14bec2,null))['catch'](handleError(_0x14bec2,null));};exports[_0x0a9e('0x4b')]=function(_0x161aa7,_0x53d113){return db['ChatWebsite'][_0x0a9e('0x4b')](_0x161aa7['body'],{})[_0x0a9e('0x13')](function(_0x4c3845){var _0x2e5e62=_0x161aa7[_0x0a9e('0x4c')][_0x0a9e('0x27')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x4d')]===_0x0a9e('0x4c')){var _0x508b47=_0x4c3845['get']({'plain':!![]});var _0x128aa6=_0x0a9e('0x28');return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':_0x128aa6,'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x13')](function(_0x523cd2){if(_0x523cd2&&_0x523cd2[_0x0a9e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x523cd2[_0x0a9e('0x2b')],'sectionId':_0x523cd2['id']},{})['then'](function(){return _0x4c3845;});}else{return _0x4c3845;}})[_0x0a9e('0x45')](function(_0x65432){logger[_0x0a9e('0x18')](_0x0a9e('0x4f'),_0x65432);throw _0x65432;});}return _0x4c3845;})[_0x0a9e('0x13')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x45')](handleError(_0x53d113,null));};exports[_0x0a9e('0x25')]=function(_0x28d814,_0x4e67ab){if(_0x28d814[_0x0a9e('0x50')]['id']){delete _0x28d814[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x28d814[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x4e67ab,null))[_0x0a9e('0x13')](saveUpdates(_0x28d814['body'],null))[_0x0a9e('0x13')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x26')]=function(_0x5ba1f9,_0x4b3c1a){return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x5ba1f9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x13')](removeEntity(_0x4b3c1a,null))[_0x0a9e('0x45')](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x51')]=function(_0x1cca9f,_0x26d7db){return db['ChatWebsite'][_0x0a9e('0x51')]()['then'](respondWithResult(_0x26d7db,null))[_0x0a9e('0x45')](handleError(_0x26d7db,null));};exports[_0x0a9e('0x52')]=function(_0x51aaf7,_0x5adf8f){if(_0x51aaf7[_0x0a9e('0x50')]['id']){delete _0x51aaf7[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51aaf7['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x5adf8f,null))[_0x0a9e('0x13')](function(_0x54327c){if(_0x54327c){_0x51aaf7[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x54327c['id'];return db[_0x0a9e('0x54')][_0x0a9e('0x4b')](_0x51aaf7[_0x0a9e('0x50')]);}})['then'](respondWithResult(_0x5adf8f,null))[_0x0a9e('0x45')](handleError(_0x5adf8f,null));};exports[_0x0a9e('0x55')]=function(_0x281c7d,_0x47bb43){var _0x3528b7={'raw':![],'where':{}};var _0x4f1e60={};var _0x5211e3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x281c7d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x13')](function(_0xc8c264){if(_0xc8c264){_0x4f1e60[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x54')][_0x0a9e('0x30')]);_0x4f1e60[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x281c7d[_0x0a9e('0x33')]);_0x4f1e60[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4f1e60[_0x0a9e('0x32')],_0x4f1e60[_0x0a9e('0x33')]);_0x3528b7[_0x0a9e('0x36')]=_['intersection'](_0x4f1e60[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x281c7d[_0x0a9e('0x33')]['fields']));_0x3528b7[_0x0a9e('0x36')]=_0x3528b7[_0x0a9e('0x36')]['length']?_0x3528b7[_0x0a9e('0x36')]:_0x4f1e60[_0x0a9e('0x32')];if(!_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x3528b7['limit']=qs['limit'](_0x281c7d['query'][_0x0a9e('0x21')]);_0x3528b7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x3528b7[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x281c7d[_0x0a9e('0x33')]['sort']);_0x3528b7[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x281c7d['query'],_0x4f1e60[_0x0a9e('0x34')]));_0x3528b7['where'][_0x0a9e('0x53')]=_0xc8c264['id'];if(_0x281c7d[_0x0a9e('0x33')]['filter']){_0x3528b7[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x3528b7[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x3528b7['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2e9552;})});}_0x3528b7=_['merge']({},_0x3528b7,_0x281c7d[_0x0a9e('0x41')]);return db[_0x0a9e('0x54')][_0x0a9e('0x22')]({'where':_0x3528b7[_0x0a9e('0x3c')]})['then'](function(_0x290d43){_0x5211e3[_0x0a9e('0x22')]=_0x290d43;if(_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x3528b7[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x54')][_0x0a9e('0x44')](_0x3528b7);})[_0x0a9e('0x13')](function(_0x1a7b03){_0x5211e3[_0x0a9e('0x58')]=_0x1a7b03;return _0x5211e3;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x47bb43,_0x3528b7))[_0x0a9e('0x45')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x59')]=function(_0xe0749e,_0x5b35db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0xe0749e[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b35db,null))[_0x0a9e('0x13')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0[_0x0a9e('0x59')](_0xe0749e[_0x0a9e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x5b35db,null))[_0x0a9e('0x45')](handleError(_0x5b35db,null));};exports[_0x0a9e('0x5a')]=function(_0x4c54fa,_0x45108c){if(_0x4c54fa['body']['id']){delete _0x4c54fa[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x4c54fa[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x13')](function(_0x42b959){if(_0x42b959){_0x4c54fa[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x42b959['id'];return db[_0x0a9e('0x5b')]['create'](_0x4c54fa[_0x0a9e('0x50')]);}})[_0x0a9e('0x13')](respondWithResult(_0x45108c,null))[_0x0a9e('0x45')](handleError(_0x45108c,null));};exports[_0x0a9e('0x5c')]=function(_0x492543,_0xf51744){var _0xf0db1={'raw':![],'where':{}};var _0x4bf3a5={};var _0x1d6834={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x492543[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x13')](function(_0x5af453){if(_0x5af453){_0x4bf3a5['model']=_[_0x0a9e('0x49')](db[_0x0a9e('0x5b')][_0x0a9e('0x30')]);_0x4bf3a5['query']=_[_0x0a9e('0x49')](_0x492543[_0x0a9e('0x33')]);_0x4bf3a5['filters']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],_0x4bf3a5['query']);_0xf0db1['attributes']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0xf0db1[_0x0a9e('0x36')]=_0xf0db1[_0x0a9e('0x36')]['length']?_0xf0db1[_0x0a9e('0x36')]:_0x4bf3a5['model'];if(!_0x492543[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0xf0db1[_0x0a9e('0x21')]=qs['limit'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0xf0db1[_0x0a9e('0x1f')]=qs['offset'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0xf0db1[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0xf0db1[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x492543[_0x0a9e('0x33')],_0x4bf3a5[_0x0a9e('0x34')]));_0xf0db1['where'][_0x0a9e('0x53')]=_0x5af453['id'];if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0xf0db1['where']=_[_0x0a9e('0x3f')](_0xf0db1['where'],{'$or':_[_0x0a9e('0x2e')](_0xf0db1[_0x0a9e('0x36')],function(_0x558a87){var _0x1f29bd={};_0x1f29bd[_0x558a87]={'$like':'%'+_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x1f29bd;})});}_0xf0db1=_[_0x0a9e('0x3f')]({},_0xf0db1,_0x492543[_0x0a9e('0x41')]);return db['CannedAnswer'][_0x0a9e('0x22')]({'where':_0xf0db1[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x30ef6e){_0x1d6834[_0x0a9e('0x22')]=_0x30ef6e;if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0xf0db1[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x44')](_0xf0db1);})[_0x0a9e('0x13')](function(_0x3754e2){_0x1d6834[_0x0a9e('0x58')]=_0x3754e2;return _0x1d6834;});}})['then'](respondWithFilteredResult(_0xf51744,_0xf0db1))[_0x0a9e('0x45')](handleError(_0xf51744,null));};exports[_0x0a9e('0x5d')]=function(_0x12843d,_0x2ed526){return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x12843d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2ed526,null))['then'](function(_0x23b447){if(_0x23b447){return _0x23b447['removeAnswers'](_0x12843d[_0x0a9e('0x33')][_0x0a9e('0x5e')]);}})[_0x0a9e('0x13')](respondWithStatusCode(_0x2ed526,null))[_0x0a9e('0x45')](handleError(_0x2ed526,null));};exports['addLogo']=function(_0x3ceba6,_0x4cf72d){_0x3ceba6[_0x0a9e('0x50')][_0x0a9e('0x5f')]=_0x3ceba6['file'][_0x0a9e('0x60')];return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x3ceba6['params']['id']}})['then'](handleEntityNotFound(_0x4cf72d,null))[_0x0a9e('0x13')](saveUpdates(_0x3ceba6[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x4cf72d,null))[_0x0a9e('0x45')](handleError(_0x4cf72d,null));};exports[_0x0a9e('0x61')]=function(_0x2450a8,_0x17793e){_0x2450a8[_0x0a9e('0x50')][_0x0a9e('0x62')]=_0x2450a8['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2450a8[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x17793e,null))[_0x0a9e('0x13')](saveUpdates(_0x2450a8[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x17793e,null))[_0x0a9e('0x45')](handleError(_0x17793e,null));};exports[_0x0a9e('0x63')]=function(_0x2791c5,_0x2aa5f2){_0x2791c5[_0x0a9e('0x50')]['customerAvatar']=_0x2791c5['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2791c5[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x13')](saveUpdates(_0x2791c5[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports['addSystemAvatar']=function(_0x1889ed,_0x5dfbe2){_0x1889ed[_0x0a9e('0x50')]['systemAvatar']=_0x1889ed[_0x0a9e('0x64')]['filename'];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x1889ed[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dfbe2,null))[_0x0a9e('0x13')](saveUpdates(_0x1889ed[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x5dfbe2,null))[_0x0a9e('0x45')](handleError(_0x5dfbe2,null));};exports[_0x0a9e('0x65')]=function(_0x5ab0bc,_0x5505f4){var _0x16449b=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x68'));var _0x59303b={'where':{'id':_0x5ab0bc['params']['id']},'attributes':['id',_0x0a9e('0x5f')],'raw':!![]};var _0xadce3d=![];return require('../../config/license/util')[_0x0a9e('0x69')]()[_0x0a9e('0x13')](function(_0xcacabb){if(_0xcacabb){_0xadce3d=_0xcacabb[_0x0a9e('0x6a')];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x59303b);})[_0x0a9e('0x13')](handleEntityNotFound(_0x5505f4,null))[_0x0a9e('0x13')](function(_0x16afb3){if(_0x16afb3){if(!_['isNil'](_0x16afb3[_0x0a9e('0x5f')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3['sitepic']))&&_0xadce3d){_0x16449b=path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3[_0x0a9e('0x5f')]);}}return _0x5505f4[_0x0a9e('0x6d')](_0x16449b);}})[_0x0a9e('0x45')](handleError(_0x5505f4,null));};exports['getAvatar']=function(_0x1339d0,_0x3c775a){var _0x3450ae=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/default_avatar.png');var _0x2144ca={'where':{'id':_0x1339d0['params']['id']},'attributes':['id',_0x0a9e('0x62')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x2144ca)['then'](handleEntityNotFound(_0x3c775a,null))[_0x0a9e('0x13')](function(_0x5ed560){if(_0x5ed560){if(!_[_0x0a9e('0x6e')](_0x5ed560[_0x0a9e('0x62')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]))){_0x3450ae=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]);}}return _0x3c775a[_0x0a9e('0x6d')](_0x3450ae);}})[_0x0a9e('0x45')](handleError(_0x3c775a,null));};exports[_0x0a9e('0x70')]=function(_0x98c62c,_0x248368){var _0x5b93dd=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x1d999b={'where':{'id':_0x98c62c[_0x0a9e('0x47')]['id']},'attributes':['id','customerAvatar',_0x0a9e('0x71')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x1d999b)[_0x0a9e('0x13')](handleEntityNotFound(_0x248368,null))['then'](function(_0x148fd9){if(_0x148fd9){if(!_[_0x0a9e('0x6e')](_0x148fd9[_0x0a9e('0x72')])){if(fs[_0x0a9e('0x6b')](path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9[_0x0a9e('0x72')]))&&_0x148fd9['showCustomerAvatar']){_0x5b93dd=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9['customerAvatar']);}}return _0x248368[_0x0a9e('0x6d')](_0x5b93dd);}})[_0x0a9e('0x45')](handleError(_0x248368,null));};exports[_0x0a9e('0x73')]=function(_0x1a7f58,_0x2394d3){var _0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/images/avatars/system_avatar.png');var _0x3bab3e={'where':{'id':_0x1a7f58[_0x0a9e('0x47')]['id']},'attributes':['id',_0x0a9e('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x3bab3e)['then'](handleEntityNotFound(_0x2394d3,null))[_0x0a9e('0x13')](function(_0x4a70ce){if(_0x4a70ce){if(!_['isNil'](_0x4a70ce[_0x0a9e('0x74')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config['root'],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]))){_0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]);}}return _0x2394d3[_0x0a9e('0x6d')](_0x555780);}})[_0x0a9e('0x45')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x75')]=function(_0x5a1848,_0x43c397){var _0x5526a7=require(_0x0a9e('0x76'));var _0x4093e6=new _0x5526a7();var _0x2097d8=_0x4093e6[_0x0a9e('0x77')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x79')])['getResult']();var _0x1a0314={'body':_0x5a1848[_0x0a9e('0x50')],'channel':_0x0a9e('0x7a')};var _0x1af799=[];var _0x51aa2f=[];var _0x2e4887={};var _0x3c9135=![];return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x2be526){if(!_0x2be526){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x1af799=_[_0x0a9e('0x7f')](_['keys'](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81')]);_0x51aa2f=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81'),_0x0a9e('0x82'),_0x0a9e('0x83')]);if(_0x5a1848['body']['id']){delete _0x5a1848[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')]['from'])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x84'));}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x86')+_0x51aa2f);}if(!_['includes'](_0x51aa2f,_0x5a1848[_0x0a9e('0x50')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a9e('0x87')+_0x51aa2f);}_0x2e4887[_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')]['from'];})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5a1848[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x88')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0a9e('0x89'),'where':_0x2e4887,'limit':0x1,'order':[[_0x0a9e('0x81'),_0x0a9e('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x0a9e('0x8b')}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x4cee8c){if(_0x4cee8c&&_0x4cee8c[_0x0a9e('0x8c')]){_0x1a0314[_0x0a9e('0x8d')]=_0x4cee8c;_0x1a0314[_0x0a9e('0x8e')]=_0x4cee8c['Applications'];_0x1a0314[_0x0a9e('0x8f')]=_0x4cee8c[_0x0a9e('0x8c')];_0x1a0314[_0x0a9e('0x8e')]=_['orderBy'](_0x1a0314['applications'],['priority'],[_0x0a9e('0x90')]);if(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8b')]){delete _0x1a0314[_0x0a9e('0x8d')]['Applications'];}if(_0x1a0314[_0x0a9e('0x8d')]['List']&&_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')]['length']){return _0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')][0x0];}var _0x580dd6=_[_0x0a9e('0xb')](_0x5a1848['body'],{'firstName':_0x5a1848[_0x0a9e('0x50')]['from'],'ListId':_0x4cee8c[_0x0a9e('0x83')]});_0x580dd6[_0x5a1848['body'][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0x4b')](_0x580dd6,{'fields':_0x1af799,'raw':!![]});}})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x5acdc9){_0x1a0314[_0x0a9e('0x92')]=_0x5acdc9;var _0x1c9ea2=_0x5a1848['body'][_0x0a9e('0x93')];if(_0x5a1848[_0x0a9e('0x78')]['cf-connecting-ip']){_0x1c9ea2=_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x94')];}else if(_0x5a1848[_0x0a9e('0x78')]['x-forwarded-for']){_0x1c9ea2=_[_0x0a9e('0x95')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x96')][_0x0a9e('0x97')](','));}if(_0x5acdc9){var _0x2003bc={'ContactId':_0x5acdc9['id'],'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'from':(_0x5acdc9[_0x0a9e('0x98')]||'')+'\x20'+(_0x5acdc9[_0x0a9e('0x99')]||''),'customerIp':_0x1c9ea2,'customerPort':_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x9a')]?_0x5a1848['headers'][_0x0a9e('0x9a')]:null,'referer':_0x5a1848['body'][_0x0a9e('0x9b')],'browserName':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')]&&_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]?util[_0x0a9e('0x9e')]('%s\x20%s',_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')],_0x2097d8[_0x0a9e('0x9c')]['version']):_0x0a9e('0x9f'),'browserVersion':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]||_0x0a9e('0x9f'),'osName':util[_0x0a9e('0x9e')](_0x0a9e('0xa0'),_0x2097d8['os'][_0x0a9e('0x2b')],_0x2097d8['os']['version']),'osVersion':_0x2097d8['os'][_0x0a9e('0x9d')],'deviceModel':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x32')]&&_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')]?util[_0x0a9e('0x9e')](_0x0a9e('0xa3'),_0x2097d8['device']['model'],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x31')]):null,'deviceVendor':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],'deviceType':_0x2097d8[_0x0a9e('0xa1')]['type'],'formData':JSON[_0x0a9e('0xa4')](_0x5a1848[_0x0a9e('0x50')])};var _0x2d8e91={'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'closed':![]};if(_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]){_0x2d8e91[_0x0a9e('0xa5')]=_0x5a1848['body'][_0x0a9e('0xa5')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':_0x2d8e91})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return[_0x2b8ad4,![]];}_0x2003bc[_0x0a9e('0xa5')]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')];_0x2003bc['externalUrl']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa7')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4b')](_0x2003bc)[_0x0a9e('0x13')](function(_0x20c130){return[_0x20c130,!![]];});});}_0x2d8e91[_0x0a9e('0xa8')]=_0x5acdc9['id'];if(_0x5a1848[_0x0a9e('0x50')]['interaction']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id']){_0x2d8e91['id']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id'];return db['ChatInteraction']['find']({'where':_0x2d8e91})[_0x0a9e('0x13')](function(_0x2abe55){if(_0x2abe55){return[_0x2abe55,![]];}return db[_0x0a9e('0xa6')]['create'](_0x2003bc)[_0x0a9e('0x13')](function(_0x40180d){return[_0x40180d,!![]];});});}return db['ChatInteraction'][_0x0a9e('0x4b')](_0x2003bc)['then'](function(_0x35cc2a){return[_0x35cc2a,!![]];});}})['spread'](function(_0x5b42b9,_0x48eaa3){if(_0x5b42b9){_0x3c9135=_0x48eaa3;if(!_0x48eaa3){var _0xad4d10={'from':(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x98')]||'')+'\x20'+(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x99')]||'')};if(_0x5a1848[_0x0a9e('0x50')]['threadId']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]!=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]){_0xad4d10[_0x0a9e('0xa5')]=_0x5a1848['body']['messageId'];}return _0x5b42b9[_0x0a9e('0x25')](_0xad4d10);}else{return _0x5b42b9;}}})['then'](function(_0x29537a){_0x1a0314[_0x0a9e('0xa9')]=_0x29537a[_0x0a9e('0x27')]({'plain':!![]});_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xab')]=_0x3c9135;if(_0x1a0314[_0x0a9e('0xa9')]['created']){if(_0x1a0314[_0x0a9e('0x8d')]['autoclose']){_0x1a0314['applications'][_0x0a9e('0xac')]({'id':0x0,'priority':_0x1a0314['applications'][_0x0a9e('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0a9e('0xad')});}}return db['ChatMessage'][_0x0a9e('0x4b')]({'body':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')],'ChatWebsiteId':_0x5a1848['params']['id'],'ChatInteractionId':_0x29537a['id'],'direction':'in','ContactId':_0x1a0314[_0x0a9e('0x92')]['id'],'AttachmentId':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xae')]});})['then'](function(_0x5236c9){_0x1a0314[_0x0a9e('0x19')]=_0x5236c9;if(_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]){return db[_0x0a9e('0xb0')][_0x0a9e('0x4a')]({'attributes':['id',_0x0a9e('0x2b')],'where':{'id':_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]}})[_0x0a9e('0x13')](function(_0x1020a0){if(_0x1020a0){_0x1a0314['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1020a0[_0x0a9e('0x2b')]+','+(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0xb1')]||0xa),'interval':_0x0a9e('0xad')});_0x1a0314[_0x0a9e('0xb2')]=!![];}return respondWithRpcPromise(_0x0a9e('0xb3'),_0x0a9e('0xb4'),_0x1a0314);});}return respondWithRpcPromise(_0x0a9e('0xb3'),'startRouting',_0x1a0314);})['then'](function(_0x2869cc){respondWithRpcPromise(_0x0a9e('0xb5'),'EventManager',{'event':_0x0a9e('0x75'),'message':_0x2869cc},client9002);return _0x2869cc;})[_0x0a9e('0x13')](respondWithResult(_0x43c397,null))[_0x0a9e('0x45')](handleError(_0x43c397,null));};exports[_0x0a9e('0xb6')]=function(_0x2bb549,_0x2683ad){var _0x167196,_0x262281,_0x59f8f7;var _0x400800=[];var _0xbd1af3={};var _0x20e191=_0x2bb549['files']||[];var _0x4412a5=[];var _0x261ef8;return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x21ada7){if(!_0x21ada7){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x400800=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x21ada7),[_0x0a9e('0x80'),'updatedAt','CompanyId',_0x0a9e('0x83')]);if(_0x2bb549[_0x0a9e('0x50')]['id']){delete _0x2bb549[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)['send'](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0x84')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0xb7')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db['Sequelize']['ValidationError'](_0x0a9e('0xb9')+_0x400800));}if(!_[_0x0a9e('0xba')](_0x400800,_0x2bb549['body']['mapKeyOffline'])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0xbb')+_0x400800));}_0xbd1af3[_0x2bb549['body'][_0x0a9e('0xb8')]]=_0x2bb549['body'][_0x0a9e('0x91')];})['then'](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x2bb549[_0x0a9e('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x0a9e('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x2683ad,null))[_0x0a9e('0x13')](function(_0x3c691f){if(_0x3c691f&&_0x3c691f[_0x0a9e('0x8c')]){_0x262281=_0x3c691f;var _0x1d51fd=_[_0x0a9e('0xb')](_0x2bb549[_0x0a9e('0x50')],{'firstName':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'phone':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'ListId':_0x3c691f[_0x0a9e('0x83')]});_0x1d51fd[_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')]]=_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0xbc')]({'where':_0xbd1af3,'defaults':_0x1d51fd});}})[_0x0a9e('0xbd')](function(_0x51a987){if(_0x51a987){_0x59f8f7=_0x51a987;var _0x233e48=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x54658d=ejs[_0x0a9e('0xbf')](_0x233e48,{'body':_['toPairs'](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]),'bodyTitle':_0x262281[_0x0a9e('0xc0')]});return db[_0x0a9e('0xc1')][_0x0a9e('0x4b')]({'body':_0x54658d,'plainBody':htmlToText[_0x0a9e('0xc2')](_0x54658d),'ContactId':_0x51a987['id'],'ChatWebsiteId':_0x262281['id']});}})[_0x0a9e('0x13')](function(_0x1cc73e){_0x261ef8=_0x1cc73e;if(_0x20e191[_0x0a9e('0x38')]){var _0x6b948a=_0x20e191['map'](function(_0x283c59){return{'name':_0x283c59['originalname'],'basename':_0x283c59[_0x0a9e('0x60')],'type':_0x283c59['mimetype'],'ChatOfflineMessageId':_0x1cc73e['id']};});_0x4412a5=_0x6b948a[_0x0a9e('0x2e')](_0x2c5385=>{var _0x216791={'filename':_0x2c5385['name'],'path':path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server','files',_0x0a9e('0xc3'),_0x0a9e('0xc4'),_0x2c5385[_0x0a9e('0xc5')])};return _0x216791;});if(!_0x262281['openNewInteraction']){return db['sequelize']['transaction'](function(_0x374964){return db[_0x0a9e('0xc6')][_0x0a9e('0xc7')](_0x6b948a,{'transaction':_0x374964});});}}})[_0x0a9e('0x13')](function(){if(_0x261ef8){_0x167196=_0x261ef8;return db[_0x0a9e('0xc8')][_0x0a9e('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xca'),'raw':!![],'include':[{'model':db[_0x0a9e('0xcb')],'as':_0x0a9e('0xcb'),'raw':!![]}]}]});}})[_0x0a9e('0x13')](function(_0x2f4de1){if(_0x2f4de1&&_0x2f4de1[_0x0a9e('0xca')]&&_0x262281[_0x0a9e('0xcc')]&&_0x262281[_0x0a9e('0xcd')]){var _0x1a74c4=_0x2f4de1[_0x0a9e('0xce')]();return respondWithRpcPromise(_0x0a9e('0xcf'),'sendMail',{'account':_0x1a74c4,'message':{'from':util[_0x0a9e('0x9e')](_0x0a9e('0xd0'),_0x2f4de1[_0x0a9e('0x2b')],_0x2f4de1[_0x0a9e('0xd1')]||_0x2f4de1[_0x0a9e('0xca')][_0x0a9e('0x4c')]),'to':_0x262281['forwardOfflineAddress'],'subject':_0x262281[_0x0a9e('0xd2')],'html':_0x167196[_0x0a9e('0x50')],'attachments':_0x4412a5}},client9003)[_0x0a9e('0x13')](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x37390b){logger[_0x0a9e('0x18')](_0x37390b);});}})[_0x0a9e('0x13')](function(){if(_0x262281&&_0x262281[_0x0a9e('0xd3')]&&_0x262281[_0x0a9e('0xd4')]){var _0x541af6=[];if(_0x20e191['length']){_0x541af6=_0x20e191[_0x0a9e('0x2e')](function(_0x3a0b30){return{'name':_0x3a0b30['originalname'],'basename':_0x3a0b30[_0x0a9e('0x60')],'type':_0x3a0b30[_0x0a9e('0xd5')],'ChatOfflineMessageId':_0x261ef8['id']};});}var _0x4c8d75;if(!_[_0x0a9e('0x6e')](_0x262281['subjectOffline'])){var _0x3468a4=_[_0x0a9e('0x2e')](_0x2bb549['body'],function(_0x27a41c){return _0x27a41c;});var _0x31ab12=_['toPairsIn'](_0x3468a4)[0x0];var _0x197d65=_[_0x0a9e('0xd6')](_0x31ab12,function(_0x53ad2b){return _0x53ad2b;});_0x4c8d75=_0x197d65[0x1][_0x262281[_0x0a9e('0xd7')]];}var _0x237994={'from':_0x59f8f7[_0x0a9e('0xd1')],'firstName':_0x59f8f7[_0x0a9e('0x98')],'lastName':_0x59f8f7[_0x0a9e('0x99')],'mapKey':_0x0a9e('0xd1'),'message':{'from':_0x59f8f7['email'],'to':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')],'cc':'','subject':_['isNil'](_0x4c8d75)?_0x262281[_0x0a9e('0xd2')]:_0x4c8d75,'messageId':'','sentAt':new Date(),'attach':_0x541af6[_0x0a9e('0x38')],'attachments':_0x541af6,'originChannel':_0x0a9e('0xd8'),'ChatWebsiteId':_0x262281['id'],'ChatOfflineMessageId':_0x167196['id'],'originTo':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')]},'body':_0x167196[_0x0a9e('0x50')]};var _0x368a12={'account':{'id':_0x262281['MailAccountId']},'body':_0x237994,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x368a12,client9001)['then'](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x23ef4e){logger['error'](_0x23ef4e);});}return;})['then'](function(){if(_0x167196){return _0x167196;}})[_0x0a9e('0x13')](respondWithResult(_0x2683ad,null))['catch'](function(_0x41600e){logger[_0x0a9e('0x18')](_0x0a9e('0x45'),_0x41600e);for(var _0x175c97 of _0x20e191){var _0x336518=path[_0x0a9e('0x66')](config['root'],_0x0a9e('0xd9'),_0x0a9e('0xda'),'attachments',_0x0a9e('0xc4'),_0x175c97[_0x0a9e('0x60')]);fs_extra[_0x0a9e('0xdb')](_0x336518)[_0x0a9e('0x45')](function(_0x1282da){logger[_0x0a9e('0x18')](_0x0a9e('0xdc'),_0x336518,_0x1282da);});}});};exports['addInteraction']=function(_0x331216,_0x508395){return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':{'id':_0x331216['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x508395,null))[_0x0a9e('0x13')](function(_0x5061e5){if(_0x5061e5){return _0x5061e5[_0x0a9e('0xdd')](_0x331216['body'][_0x0a9e('0x5e')],_[_0x0a9e('0xde')](_0x331216['body'],[_0x0a9e('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x508395,null))[_0x0a9e('0x45')](handleError(_0x508395,null));};exports[_0x0a9e('0xdf')]=function(_0x732141,_0x37ef45){var _0x288127={'raw':![],'where':{}};var _0x26d010={};var _0xa45906={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x732141[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x37ef45,null))[_0x0a9e('0x13')](function(_0x38e256){if(_0x38e256){_0x26d010['model']=_[_0x0a9e('0x49')](db['ChatInteraction']['rawAttributes']);_0x26d010[_0x0a9e('0x33')]=_['keys'](_0x732141[_0x0a9e('0x33')]);_0x26d010[_0x0a9e('0x34')]=_['intersection'](_0x26d010[_0x0a9e('0x32')],_0x26d010[_0x0a9e('0x33')]);_0x288127[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x26d010[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x288127[_0x0a9e('0x36')]=_0x288127['attributes'][_0x0a9e('0x38')]?_0x288127[_0x0a9e('0x36')]:_0x26d010[_0x0a9e('0x32')];if(!_0x732141[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x288127[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x732141['query'][_0x0a9e('0x21')]);_0x288127[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x732141['query'][_0x0a9e('0x1f')]);}_0x288127['order']=qs[_0x0a9e('0x3b')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x288127[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x732141[_0x0a9e('0x33')],_0x26d010['filters']));_0x288127[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x38e256['id'];if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x288127[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x288127[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x288127[_0x0a9e('0x36')],function(_0x4712c9){var _0x4542d3={};_0x4542d3[_0x4712c9]={'$like':'%'+_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x4542d3;})});}_0x288127=_[_0x0a9e('0x3f')]({},_0x288127,_0x732141[_0x0a9e('0x41')]);return db[_0x0a9e('0xa6')][_0x0a9e('0x22')]({'where':_0x288127[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x611e46){_0xa45906[_0x0a9e('0x22')]=_0x611e46;if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x288127['include']=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xb0')],'as':'Owner','attributes':[_0x0a9e('0x2b'),'fullname',_0x0a9e('0xe1')],'required':![]},{'model':db[_0x0a9e('0xe2')],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2b'),_0x0a9e('0xe4')],'where':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?{'id':_0x732141[_0x0a9e('0x33')]['tag']}:undefined,'required':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a9e('0x44')](_0x288127);})[_0x0a9e('0x13')](function(_0x579bb0){_0xa45906['rows']=_0x579bb0;return _0xa45906;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x37ef45,_0x288127))[_0x0a9e('0x45')](handleError(_0x37ef45,null));};function iftimePromise(_0x315299,_0x1bf053){return respondWithRpcPromise('Command',_0x0a9e('0xe6'),{'command':_0x1bf053[_0x0a9e('0xe7')]?util[_0x0a9e('0x9e')](_0x0a9e('0xe8'),_0x315299[_0x0a9e('0xe9')],_0x1bf053['timezone']):util[_0x0a9e('0x9e')](_0x0a9e('0xea'),_0x315299['interval'])},client9002)[_0x0a9e('0x13')](function(_0x2d20a0){var _0x38284a=_0x2d20a0&&_0x2d20a0['indexOf']('true')>=0x0?!![]:![];logger[_0x0a9e('0x14')](_0x0a9e('0xeb'),_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],_0x38284a?_0x0a9e('0xec'):_0x0a9e('0xed'),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:_0x0a9e('0xee'));return _0x38284a;})['catch'](function(_0x5cc8cb){logger[_0x0a9e('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],util[_0x0a9e('0xef')](_0x5cc8cb,{'showHidden':![],'depth':null}),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:'No\x20timezone');return![];});}exports[_0x0a9e('0xe6')]=function(_0x43c1d1,_0x546bc9){var _0x10e370=0x0;var _0x5092af=0x0;var _0x2e1de7=![];var _0x30a77e;var _0xd63c87;return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x43c1d1[_0x0a9e('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x0a9e('0xf0'),'include':[{'model':db['Interval'],'as':_0x0a9e('0xf1'),'attributes':['id',_0x0a9e('0xe9')],'raw':!![]}]}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x546bc9,null))[_0x0a9e('0x13')](function(_0xa244bc){if(_0xa244bc){_0x30a77e=_0xa244bc;return _0xa244bc[_0x0a9e('0xf2')]({'raw':!![]});}})[_0x0a9e('0x13')](function(_0x5bdba6){if(_0x30a77e){if(_0x5bdba6){_0xd63c87=_0x5bdba6;}}return require(_0x0a9e('0xf3'))[_0x0a9e('0x69')]();})[_0x0a9e('0x13')](function(_0x188231){if(_0x188231){_0x5092af=_0x188231[_0x0a9e('0xf4')];_0x2e1de7=_0x188231['custom'];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0xa6')]['count']({'where':{'closed':![]}});})['then'](function(_0x2240ea){_0x10e370=_0x2240ea;if(_0x5092af&&_0x2240ea>_0x5092af){return db[_0x0a9e('0xf5')][_0x0a9e('0x56')]({'where':{'id':0x1}})[_0x0a9e('0x13')](function(_0x380539){if(_0x380539){_0x380539[_0x0a9e('0xf6')]('chatLicenseExceeded');}});}})[_0x0a9e('0x13')](function(){if(_0x30a77e[_0x0a9e('0xf0')]&&_0x30a77e[_0x0a9e('0xf0')]['Intervals']){var _0x294e90=[];for(var _0x1969e3=0x0;_0x1969e3<_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')]['length'];_0x1969e3++){var _0x5d4935=_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')][_0x1969e3][_0x0a9e('0x27')]({'plain':!![]});_0x294e90[_0x0a9e('0xac')](iftimePromise(_0x5d4935,_0x30a77e));}return BPromise[_0x0a9e('0xf7')](_0x294e90)[_0x0a9e('0x13')](function(_0x371943){return _[_0x0a9e('0xf8')](_0x371943);});}else{return!![];}})['then'](function(_0x17187c){var _0x4be017=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x462ecd={'remote':_0x30a77e['remote'],'query':querystring[_0x0a9e('0xa4')](_['merge'](_0x30a77e['get']({'plain':!![]}),{'customerIp':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x96')]||_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0xf9')]||_0x43c1d1[_0x0a9e('0xfa')][_0x0a9e('0xfb')]||_0x43c1d1['ip'],'referer':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x9b')],'openedInteractions':_0x10e370,'maxInteractions':_0x5092af,'virtual':_0x2e1de7[_0x0a9e('0xf4')],'online':_0x17187c,'custom':_0x2e1de7}))[_0x0a9e('0xfc')](/'/g,'\x5c\x27')};_0x546bc9[_0x0a9e('0x2c')](ejs[_0x0a9e('0xbf')](Mustache[_0x0a9e('0xbf')](_0x4be017,_0x462ecd),{'proactiveActions':_0xd63c87,'alignment':_0x30a77e['alignment'],'verticalAlignment':_0x30a77e['verticalAlignment'],'div_color':_0x30a77e[_0x0a9e('0xe4')],'labelText':_0x30a77e['labelText'],'text_color':_0x30a77e[_0x0a9e('0xfd')],'button_color':_0x30a77e[_0x0a9e('0xfe')],'background_color':_0x30a77e[_0x0a9e('0xff')],'hideWhenOffline':_0x30a77e['hideWhenOffline'],'interval':_0x30a77e['IntervalId']}));})[_0x0a9e('0x45')](handleError(_0x546bc9,null));};exports[_0x0a9e('0x100')]=function(_0x2c316b,_0x142c65){var _0x193e3b=_0x2c316b[_0x0a9e('0x47')]['id'];var _0x36e428=_0x2c316b['body'];var _0x12984a=0xc8;var _0x5799a6=null;return db[_0x0a9e('0x101')][_0x0a9e('0x102')]({'isolationLevel':db['sequelize'][_0x0a9e('0x103')][_0x0a9e('0x104')][_0x0a9e('0x105')]},function(_0x4524b8){return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x193e3b},'transaction':_0x4524b8})['then'](function(_0x475bcd){if(_0x475bcd){return db[_0x0a9e('0x106')][_0x0a9e('0x26')]({'where':{'ChatWebsiteId':_0x193e3b},'transaction':_0x4524b8})['then'](function(){var _0x857983=_[_0x0a9e('0x2e')](_0x36e428,function(_0x24dc3f){_0x24dc3f['ChatWebsiteId']=_0x193e3b;return _0x24dc3f;});return db[_0x0a9e('0x106')][_0x0a9e('0xc7')](_0x857983,{'transaction':_0x4524b8});});}else{_0x12984a=0x194;_0x5799a6=[];}});})[_0x0a9e('0x13')](function(){if(_0x12984a!==0x194){return db[_0x0a9e('0x106')][_0x0a9e('0x107')]({'where':{'ChatWebsiteId':_0x193e3b},'order':_0x0a9e('0x108')})['then'](function(_0x483aed){_0x5799a6=_0x483aed;});}})[_0x0a9e('0x45')](function(_0x1e01af){_0x12984a=0x1f4;logger['error'](_0x1e01af[_0x0a9e('0x2a')]);if(_0x1e01af[_0x0a9e('0x2b')]){delete _0x1e01af[_0x0a9e('0x2b')];}_0x5799a6=_0x1e01af;})[_0x0a9e('0x109')](function(){if(_0x5799a6===null){_0x142c65[_0x0a9e('0x1b')](_0x12984a);}else{if(_0x12984a===0x1f4){_0x142c65[_0x0a9e('0x1d')](_0x12984a)['send'](_0x5799a6);}else{_0x142c65[_0x0a9e('0x1d')](_0x12984a)[_0x0a9e('0x1e')](_0x5799a6);}}});};exports[_0x0a9e('0x10a')]=function(_0x4edb79,_0x45c6ce){var _0x4532de={};var _0x1747ab={};var _0x3afafa;var _0x5beea6;return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x4edb79[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45c6ce,null))['then'](function(_0x3d75c9){if(_0x3d75c9){_0x3afafa=_0x3d75c9;_0x1747ab[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x106')][_0x0a9e('0x30')]);_0x1747ab[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x4edb79[_0x0a9e('0x33')]);_0x1747ab['filters']=_['intersection'](_0x1747ab[_0x0a9e('0x32')],_0x1747ab[_0x0a9e('0x33')]);_0x4532de['attributes']=_[_0x0a9e('0x35')](_0x1747ab['model'],qs[_0x0a9e('0x37')](_0x4edb79[_0x0a9e('0x33')]['fields']));_0x4532de[_0x0a9e('0x36')]=_0x4532de[_0x0a9e('0x36')]['length']?_0x4532de[_0x0a9e('0x36')]:_0x1747ab[_0x0a9e('0x32')];_0x4532de[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4532de[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x4edb79[_0x0a9e('0x33')],_0x1747ab[_0x0a9e('0x34')]));if(_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4532de[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x4532de['where'],{'$or':_['map'](_0x4532de[_0x0a9e('0x36')],function(_0x14c3f1){var _0x1e6bba={};_0x1e6bba[_0x14c3f1]={'$like':'%'+_0x4edb79['query']['filter']+'%'};return _0x1e6bba;})});}_0x4532de=_[_0x0a9e('0x3f')]({},_0x4532de,_0x4edb79['options']);return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x112789){if(_0x112789){_0x5beea6=_0x112789[_0x0a9e('0x38')];if(!_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4532de[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4edb79['query']['limit']);_0x4532de[_0x0a9e('0x1f')]=qs['offset'](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x4ad6fc){if(_0x4ad6fc){return _0x4ad6fc?{'count':_0x5beea6,'rows':_0x4ad6fc}:null;}})[_0x0a9e('0x13')](respondWithResult(_0x45c6ce,null))[_0x0a9e('0x45')](handleError(_0x45c6ce,null));};exports[_0x0a9e('0x10b')]=function(_0x5174c5,_0x1ebf20){return db[_0x0a9e('0x10c')][_0x0a9e('0x4a')]({'where':{'id':_0x5174c5['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x1ebf20,null))[_0x0a9e('0x13')](function(_0x459ab7){if(_0x459ab7){return _0x459ab7[_0x0a9e('0x10b')](_0x5174c5[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x5174c5['body'],[_0x0a9e('0x5e'),'id'])||{});}})[_0x0a9e('0x13')](respondWithResult(_0x1ebf20,null))[_0x0a9e('0x45')](handleError(_0x1ebf20,null));};exports['getProactiveActions']=function(_0x5990e1,_0x2a5c2a){var _0x304a57={};var _0x2302a2={};var _0x5f5963;var _0x4b51ff;return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5990e1[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2a5c2a,null))[_0x0a9e('0x13')](function(_0x4f0bca){if(_0x4f0bca){_0x5f5963=_0x4f0bca;_0x2302a2[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x10d')][_0x0a9e('0x30')]);_0x2302a2['query']=_[_0x0a9e('0x49')](_0x5990e1['query']);_0x2302a2[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2302a2[_0x0a9e('0x32')],_0x2302a2[_0x0a9e('0x33')]);_0x304a57[_0x0a9e('0x36')]=_['intersection'](_0x2302a2[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5990e1[_0x0a9e('0x33')]['fields']));_0x304a57[_0x0a9e('0x36')]=_0x304a57['attributes'][_0x0a9e('0x38')]?_0x304a57[_0x0a9e('0x36')]:_0x2302a2[_0x0a9e('0x32')];_0x304a57['order']=qs[_0x0a9e('0x3b')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x304a57[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5990e1['query'],_0x2302a2[_0x0a9e('0x34')]));if(_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x304a57[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x304a57[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x304a57[_0x0a9e('0x36')],function(_0x597e99){var _0x2dc0de={};_0x2dc0de[_0x597e99]={'$like':'%'+_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2dc0de;})});}_0x304a57=_[_0x0a9e('0x3f')]({},_0x304a57,_0x5990e1['options']);return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})['then'](function(_0xf81cc){if(_0xf81cc){_0x4b51ff=_0xf81cc[_0x0a9e('0x38')];if(!_0x5990e1[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x304a57[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5990e1[_0x0a9e('0x33')]['limit']);_0x304a57[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})[_0x0a9e('0x13')](function(_0xbdc88e){if(_0xbdc88e){return _0xbdc88e?{'count':_0x4b51ff,'rows':_0xbdc88e}:null;}})['then'](respondWithResult(_0x2a5c2a,null))[_0x0a9e('0x45')](handleError(_0x2a5c2a,null));};exports[_0x0a9e('0x10e')]=function(_0x337c29,_0xa42055){var _0x52cdf4=_0x337c29[_0x0a9e('0x33')]['online']===_0x0a9e('0x10f')?_0x0a9e('0x110'):_0x0a9e('0x111');return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'attributes':['id',_0x52cdf4],'where':{'id':_0x337c29[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xa42055,null))['then'](function(_0x173f03){if(_0x173f03){var _0x4ac7f1=_0x173f03[_0x52cdf4];var _0x382412=_0x4ac7f1&&_0x4ac7f1[_0x0a9e('0x112')]?_0x4ac7f1['items']:[];_0xa42055[_0x0a9e('0x2c')]({'fromKey':_[_0x0a9e('0x6e')](_0x4ac7f1[_0x0a9e('0x113')])?undefined:_0x4ac7f1[_0x0a9e('0x113')],'count':_0x382412['length'],'rows':_0x382412});}})[_0x0a9e('0x45')](handleError(_0xa42055,null));};exports[_0x0a9e('0x114')]=function(_0x5a75d9,_0xcc859d){var _0x4a396c={'raw':![],'where':{}};var _0x58cb87={};var _0x50e7ec={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5a75d9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xcc859d,null))[_0x0a9e('0x13')](function(_0x5ef7e8){if(_0x5ef7e8){_0x58cb87[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0xc1')][_0x0a9e('0x30')]);_0x58cb87[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x5a75d9[_0x0a9e('0x33')]);_0x58cb87['filters']=_[_0x0a9e('0x35')](_0x58cb87['model'],_0x58cb87[_0x0a9e('0x33')]);_0x4a396c[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x58cb87[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5a75d9[_0x0a9e('0x33')]['fields']));_0x4a396c[_0x0a9e('0x36')]=_0x4a396c[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x4a396c['attributes']:_0x58cb87[_0x0a9e('0x32')];if(!_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4a396c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x4a396c[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x4a396c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4a396c['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5a75d9[_0x0a9e('0x33')],_0x58cb87['filters']));_0x4a396c[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x5ef7e8['id'];if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4a396c['where']=_[_0x0a9e('0x3f')](_0x4a396c[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x4a396c[_0x0a9e('0x36')],function(_0x4e8eb9){var _0x2b263b={};_0x2b263b[_0x4e8eb9]={'$like':'%'+_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2b263b;})});}_0x4a396c=_[_0x0a9e('0x3f')]({},_0x4a396c,_0x5a75d9['options']);return db['ChatOfflineMessage'][_0x0a9e('0x22')]({'where':_0x4a396c[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x353960){_0x50e7ec[_0x0a9e('0x22')]=_0x353960;if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x4a396c[_0x0a9e('0x43')]=[{'all':!![]}];}else{_0x4a396c[_0x0a9e('0x43')]=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xc6')],'as':_0x0a9e('0x115'),'required':![]}];}return db[_0x0a9e('0xc1')]['findAll'](_0x4a396c);})[_0x0a9e('0x13')](function(_0x5ce227){_0x50e7ec[_0x0a9e('0x58')]=_0x5ce227;return _0x50e7ec;});}})['then'](respondWithFilteredResult(_0xcc859d,_0x4a396c))['catch'](handleError(_0xcc859d,null));};exports[_0x0a9e('0x116')]=function(_0x51ec16,_0x3d2007){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51ec16[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d2007,null))['then'](function(_0x2ad86f){if(_0x2ad86f){return _0x2ad86f[_0x0a9e('0x116')](_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x51ec16[_0x0a9e('0x50')],[_0x0a9e('0x5e'),'id'])||{})[_0x0a9e('0xbd')](function(_0x25f5fa){for(var _0x193ef7=0x0;_0x193ef7<_0x51ec16['body']['ids'][_0x0a9e('0x38')];_0x193ef7+=0x1){socket[_0x0a9e('0x117')](_0x0a9e('0x118'),{'UserId':Number(_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')][_0x193ef7]),'ChatWebsiteId':Number(_0x51ec16[_0x0a9e('0x47')]['id'])});}return _0x25f5fa;});}})[_0x0a9e('0x13')](respondWithResult(_0x3d2007,null))['catch'](handleError(_0x3d2007,null));};exports[_0x0a9e('0x119')]=function(_0xd73712,_0x173daf){return db['ChatWebsite']['find']({'where':{'id':_0xd73712['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x173daf,null))[_0x0a9e('0x13')](function(_0x5448ee){if(_0x5448ee){return _0x5448ee[_0x0a9e('0x119')](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])['then'](function(){if(_['isArray'](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])){for(var _0xf10a48=0x0;_0xf10a48<_0xd73712[_0x0a9e('0x33')]['ids'][_0x0a9e('0x38')];_0xf10a48+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd73712[_0x0a9e('0x33')]['ids'][_0xf10a48]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}}else{socket[_0x0a9e('0x117')](_0x0a9e('0x11a'),{'UserId':Number(_0xd73712['query'][_0x0a9e('0x5e')]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}});}})[_0x0a9e('0x13')](respondWithStatusCode(_0x173daf,null))['catch'](handleError(_0x173daf,null));};exports['getAgents']=function(_0x3aa901,_0xb3e9cb){var _0x34b05f={};var _0x21fcaa={};var _0x1c3b0e;var _0x1966dd;return db['ChatWebsite']['findOne']({'where':{'id':_0x3aa901[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xb3e9cb,null))['then'](function(_0x539f84){if(_0x539f84){_0x1c3b0e=_0x539f84;_0x21fcaa['model']=_['keys'](db['User']['rawAttributes']);_0x21fcaa[_0x0a9e('0x33')]=_['keys'](_0x3aa901[_0x0a9e('0x33')]);_0x21fcaa[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21fcaa[_0x0a9e('0x32')],_0x21fcaa[_0x0a9e('0x33')]);_0x34b05f[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x21fcaa['model'],qs[_0x0a9e('0x37')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x34b05f[_0x0a9e('0x36')]=_0x34b05f[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x34b05f[_0x0a9e('0x36')]:_0x21fcaa[_0x0a9e('0x32')];_0x34b05f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3aa901[_0x0a9e('0x33')]['sort']);_0x34b05f[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x3aa901[_0x0a9e('0x33')],_0x21fcaa['filters']));if(_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x34b05f['where']=_['merge'](_0x34b05f[_0x0a9e('0x3c')],{'$or':_['map'](_0x34b05f[_0x0a9e('0x36')],function(_0xa8c784){var _0x132f85={};_0x132f85[_0xa8c784]={'$like':'%'+_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x132f85;})});}_0x34b05f=_['merge']({},_0x34b05f,_0x3aa901[_0x0a9e('0x41')]);return _0x1c3b0e['getAgents'](_0x34b05f);}})['then'](function(_0x398a88){if(_0x398a88){_0x1966dd=_0x398a88[_0x0a9e('0x38')];if(!_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x34b05f['limit']=qs[_0x0a9e('0x21')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x34b05f[_0x0a9e('0x1f')]=qs['offset'](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x1c3b0e['getAgents'](_0x34b05f);}})[_0x0a9e('0x13')](function(_0x36d8a1){if(_0x36d8a1){return _0x36d8a1?{'count':_0x1966dd,'rows':_0x36d8a1}:null;}})[_0x0a9e('0x13')](respondWithResult(_0xb3e9cb,null))[_0x0a9e('0x45')](handleError(_0xb3e9cb,null));}; \ No newline at end of file +var _0x1e5d=['device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','push','close','unmanaged','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','notify','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','mimetype','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','alignment','verticalAlignment','labelText','textColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','order','ChatWebsiteId','filter','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','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','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','headers','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e5d,0x1aa));var _0xd1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd1e5('0x0'));var Mustache=require(_0xd1e5('0x1'));var util=require(_0xd1e5('0x2'));var path=require(_0xd1e5('0x3'));var ejs=require(_0xd1e5('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xd1e5('0x5'));var Redis=require(_0xd1e5('0x6'));var qs=require(_0xd1e5('0x7'));var logger=require(_0xd1e5('0x8'))(_0xd1e5('0x9'));var config=require('../../config/environment');var db=require(_0xd1e5('0xa'))['db'];config[_0xd1e5('0xb')]=_[_0xd1e5('0xc')](config[_0xd1e5('0xb')],{'host':_0xd1e5('0xd'),'port':0x18eb});var socket=require(_0xd1e5('0xe'))(new Redis(config[_0xd1e5('0xb')]));require(_0xd1e5('0xf'))[_0xd1e5('0x10')](socket);var htmlToText=require(_0xd1e5('0x11'));var jayson=require(_0xd1e5('0x12'));var client=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x232c});var client9002=jayson[_0xd1e5('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x232b});var client9001=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x282ce2,_0x116426,_0x1e71b7,_0x2375ac){return new BPromise(function(_0x35973c,_0xe87c14){var _0x1a99a7=_0x2375ac||client;return _0x1a99a7[_0xd1e5('0x15')](_0x282ce2,_0x1e71b7)[_0xd1e5('0x16')](function(_0x593ff0){logger[_0xd1e5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x116426,'request\x20sent');logger[_0xd1e5('0x18')](_0xd1e5('0x19'),_0x116426,_0xd1e5('0x1a'),JSON['stringify'](_0x593ff0));if(_0x593ff0['error']){if(_0x593ff0[_0xd1e5('0x1b')]['code']===0x1f4){logger[_0xd1e5('0x1b')](_0xd1e5('0x1c'),_0x116426,_0x593ff0[_0xd1e5('0x1b')][_0xd1e5('0x1d')]);return _0xe87c14(_0x593ff0['error'][_0xd1e5('0x1d')]);}logger[_0xd1e5('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x116426,_0x593ff0['error']['message']);return _0x35973c(_0x593ff0[_0xd1e5('0x1b')][_0xd1e5('0x1d')]);}else{logger['info'](_0xd1e5('0x1c'),_0x116426,_0xd1e5('0x1a'));_0x35973c(_0x593ff0[_0xd1e5('0x1e')][_0xd1e5('0x1d')]);}})[_0xd1e5('0x1f')](function(_0x32d80c){logger[_0xd1e5('0x1b')](_0xd1e5('0x1c'),_0x116426,_0x32d80c);_0xe87c14(_0x32d80c);});});}function respondWithStatusCode(_0x4dc4e6,_0x425478){_0x425478=_0x425478||0xcc;return function(_0x241d5c){if(_0x241d5c){return _0x4dc4e6[_0xd1e5('0x20')](_0x425478);}return _0x4dc4e6[_0xd1e5('0x21')](_0x425478)['end']();};}function respondWithResult(_0x4f26ef,_0x19783f){_0x19783f=_0x19783f||0xc8;return function(_0x386f13){if(_0x386f13){return _0x4f26ef[_0xd1e5('0x21')](_0x19783f)[_0xd1e5('0x22')](_0x386f13);}};}function respondWithFilteredResult(_0x21604d,_0x46a8b4){return function(_0x18e25a){if(_0x18e25a){var _0x1f5185=typeof _0x46a8b4[_0xd1e5('0x23')]===_0xd1e5('0x24')&&typeof _0x46a8b4[_0xd1e5('0x25')]===_0xd1e5('0x24');var _0x28352d=_0x18e25a[_0xd1e5('0x26')];var _0x30a414=_0x1f5185?0x0:_0x46a8b4[_0xd1e5('0x23')];var _0x2d95de=_0x1f5185?_0x18e25a[_0xd1e5('0x26')]:_0x46a8b4['offset']+_0x46a8b4[_0xd1e5('0x25')];var _0x183c38;if(_0x2d95de>=_0x28352d){_0x2d95de=_0x28352d;_0x183c38=0xc8;}else{_0x183c38=0xce;}_0x21604d[_0xd1e5('0x21')](_0x183c38);return _0x21604d[_0xd1e5('0x27')](_0xd1e5('0x28'),_0x30a414+'-'+_0x2d95de+'/'+_0x28352d)[_0xd1e5('0x22')](_0x18e25a);}return null;};}function saveUpdates(_0x3f18b8){return function(_0x46ad9e){if(_0x46ad9e){return _0x46ad9e[_0xd1e5('0x29')](_0x3f18b8)[_0xd1e5('0x16')](function(_0x943b0e){return _0x943b0e;});}return null;};}function removeEntity(_0x3417de){return function(_0x1fda26){if(_0x1fda26){return _0x1fda26['destroy']()['then'](function(){var _0x2b75cf=_0x1fda26['get']({'plain':!![]});var _0x31321c=_0xd1e5('0x2a');return db[_0xd1e5('0x2b')][_0xd1e5('0x2c')]({'where':{'type':_0x31321c,'resourceId':_0x2b75cf['id']}})[_0xd1e5('0x16')](function(){return _0x1fda26;});})[_0xd1e5('0x16')](function(){_0x3417de[_0xd1e5('0x21')](0xcc)[_0xd1e5('0x2d')]();});}};}function handleEntityNotFound(_0x25cd9f){return function(_0x18cd70){if(!_0x18cd70){_0x25cd9f[_0xd1e5('0x20')](0x194);}return _0x18cd70;};}function handleError(_0x1c02c5,_0x2906ff){_0x2906ff=_0x2906ff||0x1f4;return function(_0x4f4b5f){logger[_0xd1e5('0x1b')](_0x4f4b5f[_0xd1e5('0x2e')]);if(_0x4f4b5f['name']){delete _0x4f4b5f[_0xd1e5('0x2f')];}_0x1c02c5[_0xd1e5('0x21')](_0x2906ff)[_0xd1e5('0x30')](_0x4f4b5f);};}exports[_0xd1e5('0x31')]=function(_0x5415bb,_0x385daf){var _0x33b480={'include':[{'model':db[_0xd1e5('0x32')],'as':_0xd1e5('0x33')}]},_0x50ea31={},_0x252778={'count':0x0,'rows':[]};var _0x272eb7=_['map'](db[_0xd1e5('0x34')][_0xd1e5('0x35')],function(_0x3af150){return{'name':_0x3af150[_0xd1e5('0x36')],'type':_0x3af150[_0xd1e5('0x37')][_0xd1e5('0x38')]};});_0x50ea31[_0xd1e5('0x39')]=_[_0xd1e5('0x3a')](_0x272eb7,_0xd1e5('0x2f'));_0x50ea31['query']=_[_0xd1e5('0x3b')](_0x5415bb[_0xd1e5('0x3c')]);_0x50ea31[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x50ea31[_0xd1e5('0x39')],_0x50ea31['query']);_0x33b480[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x50ea31[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x5415bb[_0xd1e5('0x3c')]['fields']));_0x33b480[_0xd1e5('0x3f')]=_0x33b480[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x33b480[_0xd1e5('0x3f')]:_0x50ea31[_0xd1e5('0x39')];if(!_0x5415bb[_0xd1e5('0x3c')]['hasOwnProperty'](_0xd1e5('0x42'))){_0x33b480[_0xd1e5('0x25')]=qs['limit'](_0x5415bb['query'][_0xd1e5('0x25')]);_0x33b480['offset']=qs[_0xd1e5('0x23')](_0x5415bb[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x33b480['order']=qs[_0xd1e5('0x43')](_0x5415bb[_0xd1e5('0x3c')]['sort']);_0x33b480['where']=qs['filters'](_[_0xd1e5('0x44')](_0x5415bb[_0xd1e5('0x3c')],_0x50ea31[_0xd1e5('0x3d')]),_0x272eb7);if(_0x5415bb[_0xd1e5('0x3c')]['filter']){_0x33b480[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x33b480['where'],{'$or':_[_0xd1e5('0x3a')](_0x272eb7,function(_0xa1ecef){if(_0xa1ecef[_0xd1e5('0x37')]!==_0xd1e5('0x47')){var _0x3faeb5={};_0x3faeb5[_0xa1ecef[_0xd1e5('0x2f')]]={'$like':'%'+_0x5415bb['query']['filter']+'%'};return _0x3faeb5;}})});}_0x33b480=_[_0xd1e5('0x46')]({},_0x33b480,_0x5415bb[_0xd1e5('0x48')]);var _0x2765d6={'where':_0x33b480[_0xd1e5('0x45')]};return db[_0xd1e5('0x34')]['count'](_0x2765d6)[_0xd1e5('0x16')](function(_0x5da948){_0x252778[_0xd1e5('0x26')]=_0x5da948;if(_0x5415bb[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x33b480[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x34')][_0xd1e5('0x4b')](_0x33b480);})[_0xd1e5('0x16')](function(_0x61de1d){_0x252778[_0xd1e5('0x4c')]=_0x61de1d;return _0x252778;})[_0xd1e5('0x16')](respondWithFilteredResult(_0x385daf,_0x33b480))[_0xd1e5('0x1f')](handleError(_0x385daf,null));};exports[_0xd1e5('0x4d')]=function(_0x580332,_0x42346e){var _0x5cc6ab={'raw':![],'where':{'id':_0x580332[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x32')],'as':_0xd1e5('0x33')}]},_0x120e8f={};_0x120e8f[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x34')]['rawAttributes']);_0x120e8f['query']=_[_0xd1e5('0x3b')](_0x580332[_0xd1e5('0x3c')]);_0x120e8f[_0xd1e5('0x3d')]=_['intersection'](_0x120e8f['model'],_0x120e8f['query']);_0x5cc6ab[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x120e8f['model'],qs[_0xd1e5('0x40')](_0x580332[_0xd1e5('0x3c')]['fields']));_0x5cc6ab[_0xd1e5('0x3f')]=_0x5cc6ab[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x5cc6ab[_0xd1e5('0x3f')]:_0x120e8f[_0xd1e5('0x39')];if(_0x580332[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x5cc6ab[_0xd1e5('0x4a')]=[{'all':!![]}];}_0x5cc6ab=_[_0xd1e5('0x46')]({},_0x5cc6ab,_0x580332[_0xd1e5('0x48')]);return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0x5cc6ab)[_0xd1e5('0x16')](handleEntityNotFound(_0x42346e,null))[_0xd1e5('0x16')](respondWithResult(_0x42346e,null))[_0xd1e5('0x1f')](handleError(_0x42346e,null));};exports[_0xd1e5('0x50')]=function(_0x53d672,_0x2cff3e){return db[_0xd1e5('0x34')][_0xd1e5('0x50')](_0x53d672[_0xd1e5('0x51')],{})['then'](function(_0x157280){var _0x34fb52=_0x53d672['user'][_0xd1e5('0x52')]({'plain':!![]});if(!_0x34fb52)throw new Error(_0xd1e5('0x53'));if(_0x34fb52['role']===_0xd1e5('0x54')){var _0xc719e4=_0x157280['get']({'plain':!![]});var _0x68f7e3=_0xd1e5('0x2a');return db['UserProfileSection'][_0xd1e5('0x4f')]({'where':{'name':_0x68f7e3,'userProfileId':_0x34fb52[_0xd1e5('0x55')]},'raw':!![]})[_0xd1e5('0x16')](function(_0x509318){if(_0x509318&&_0x509318[_0xd1e5('0x56')]===0x0){return db[_0xd1e5('0x2b')]['create']({'name':_0xc719e4[_0xd1e5('0x2f')],'resourceId':_0xc719e4['id'],'type':_0x509318[_0xd1e5('0x2f')],'sectionId':_0x509318['id']},{})[_0xd1e5('0x16')](function(){return _0x157280;});}else{return _0x157280;}})[_0xd1e5('0x1f')](function(_0x1e5e23){logger[_0xd1e5('0x1b')](_0xd1e5('0x57'),_0x1e5e23);throw _0x1e5e23;});}return _0x157280;})[_0xd1e5('0x16')](respondWithResult(_0x2cff3e,0xc9))[_0xd1e5('0x1f')](handleError(_0x2cff3e,null));};exports[_0xd1e5('0x29')]=function(_0x24d7f5,_0x49752b){if(_0x24d7f5['body']['id']){delete _0x24d7f5[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x24d7f5['params']['id']},'include':[{'model':db['Pause'],'as':_0xd1e5('0x33')}]})[_0xd1e5('0x16')](handleEntityNotFound(_0x49752b,null))[_0xd1e5('0x16')](saveUpdates(_0x24d7f5[_0xd1e5('0x51')],null))[_0xd1e5('0x16')](respondWithResult(_0x49752b,null))['catch'](handleError(_0x49752b,null));};exports[_0xd1e5('0x2c')]=function(_0x337f1b,_0x4a9a9a){return db['ChatWebsite'][_0xd1e5('0x4f')]({'where':{'id':_0x337f1b[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a9a9a,null))[_0xd1e5('0x16')](removeEntity(_0x4a9a9a,null))[_0xd1e5('0x1f')](handleError(_0x4a9a9a,null));};exports[_0xd1e5('0x58')]=function(_0x3c85bb,_0x494346){return db['ChatWebsite'][_0xd1e5('0x58')]()['then'](respondWithResult(_0x494346,null))[_0xd1e5('0x1f')](handleError(_0x494346,null));};exports[_0xd1e5('0x59')]=function(_0x3ea951,_0x1fc3d3){if(_0x3ea951['body']['id']){delete _0x3ea951[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x3ea951[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x1fc3d3,null))['then'](function(_0x3e0418){if(_0x3e0418){_0x3ea951[_0xd1e5('0x51')]['ChatWebsiteId']=_0x3e0418['id'];return db[_0xd1e5('0x5a')][_0xd1e5('0x50')](_0x3ea951[_0xd1e5('0x51')]);}})[_0xd1e5('0x16')](respondWithResult(_0x1fc3d3,null))[_0xd1e5('0x1f')](handleError(_0x1fc3d3,null));};exports['getDispositions']=function(_0x457d16,_0x292a8d){var _0x2824cb={'raw':![],'where':{}};var _0x379d75={};var _0x486530={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')][_0xd1e5('0x5b')]({'where':{'id':_0x457d16[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x292a8d,null))[_0xd1e5('0x16')](function(_0x1e4fd7){if(_0x1e4fd7){_0x379d75[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x5a')][_0xd1e5('0x35')]);_0x379d75[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x457d16[_0xd1e5('0x3c')]);_0x379d75[_0xd1e5('0x3d')]=_['intersection'](_0x379d75[_0xd1e5('0x39')],_0x379d75[_0xd1e5('0x3c')]);_0x2824cb[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x379d75[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2824cb[_0xd1e5('0x3f')]=_0x2824cb[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x2824cb[_0xd1e5('0x3f')]:_0x379d75['model'];if(!_0x457d16['query']['hasOwnProperty']('nolimit')){_0x2824cb[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x457d16['query']['limit']);_0x2824cb[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x457d16['query'][_0xd1e5('0x23')]);}_0x2824cb[_0xd1e5('0x5c')]=qs['sort'](_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x2824cb[_0xd1e5('0x45')]=qs['filters'](_[_0xd1e5('0x44')](_0x457d16[_0xd1e5('0x3c')],_0x379d75[_0xd1e5('0x3d')]));_0x2824cb['where'][_0xd1e5('0x5d')]=_0x1e4fd7['id'];if(_0x457d16['query'][_0xd1e5('0x5e')]){_0x2824cb[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2824cb[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x2824cb['attributes'],function(_0x5be513){var _0x1a9d0c={};_0x1a9d0c[_0x5be513]={'$like':'%'+_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x1a9d0c;})});}_0x2824cb=_['merge']({},_0x2824cb,_0x457d16[_0xd1e5('0x48')]);return db[_0xd1e5('0x5a')][_0xd1e5('0x26')]({'where':_0x2824cb[_0xd1e5('0x45')]})[_0xd1e5('0x16')](function(_0x1d4f4a){_0x486530[_0xd1e5('0x26')]=_0x1d4f4a;if(_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x2824cb[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x5a')][_0xd1e5('0x4b')](_0x2824cb);})[_0xd1e5('0x16')](function(_0x35561f){_0x486530[_0xd1e5('0x4c')]=_0x35561f;return _0x486530;});}})['then'](respondWithFilteredResult(_0x292a8d,_0x2824cb))['catch'](handleError(_0x292a8d,null));};exports[_0xd1e5('0x5f')]=function(_0x3b06a1,_0x637a31){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x3b06a1['params']['id']}})['then'](handleEntityNotFound(_0x637a31,null))['then'](function(_0x596193){if(_0x596193){return _0x596193[_0xd1e5('0x5f')](_0x3b06a1[_0xd1e5('0x3c')][_0xd1e5('0x60')]);}})[_0xd1e5('0x16')](respondWithStatusCode(_0x637a31,null))[_0xd1e5('0x1f')](handleError(_0x637a31,null));};exports['addAnswer']=function(_0x8b3f83,_0x4dcb09){if(_0x8b3f83[_0xd1e5('0x51')]['id']){delete _0x8b3f83[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x8b3f83[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4dcb09,null))[_0xd1e5('0x16')](function(_0x440fdd){if(_0x440fdd){_0x8b3f83[_0xd1e5('0x51')][_0xd1e5('0x5d')]=_0x440fdd['id'];return db[_0xd1e5('0x61')]['create'](_0x8b3f83['body']);}})['then'](respondWithResult(_0x4dcb09,null))[_0xd1e5('0x1f')](handleError(_0x4dcb09,null));};exports[_0xd1e5('0x62')]=function(_0x190de6,_0x236dd){var _0x1826c4={'raw':![],'where':{}};var _0x4e6768={};var _0x27922c={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x190de6[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x236dd,null))['then'](function(_0x2398bd){if(_0x2398bd){_0x4e6768['model']=_['keys'](db[_0xd1e5('0x61')][_0xd1e5('0x35')]);_0x4e6768[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x190de6[_0xd1e5('0x3c')]);_0x4e6768[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x4e6768[_0xd1e5('0x39')],_0x4e6768['query']);_0x1826c4[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x4e6768[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x1826c4[_0xd1e5('0x3f')]=_0x1826c4[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x1826c4[_0xd1e5('0x3f')]:_0x4e6768['model'];if(!_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x1826c4['limit']=qs[_0xd1e5('0x25')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x1826c4['offset']=qs[_0xd1e5('0x23')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x1826c4[_0xd1e5('0x5c')]=qs[_0xd1e5('0x43')](_0x190de6[_0xd1e5('0x3c')]['sort']);_0x1826c4['where']=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x190de6[_0xd1e5('0x3c')],_0x4e6768[_0xd1e5('0x3d')]));_0x1826c4['where'][_0xd1e5('0x5d')]=_0x2398bd['id'];if(_0x190de6['query']['filter']){_0x1826c4['where']=_[_0xd1e5('0x46')](_0x1826c4[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x1826c4[_0xd1e5('0x3f')],function(_0x3ca15c){var _0x3abf5b={};_0x3abf5b[_0x3ca15c]={'$like':'%'+_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x3abf5b;})});}_0x1826c4=_['merge']({},_0x1826c4,_0x190de6[_0xd1e5('0x48')]);return db['CannedAnswer'][_0xd1e5('0x26')]({'where':_0x1826c4[_0xd1e5('0x45')]})['then'](function(_0xe40d6e){_0x27922c[_0xd1e5('0x26')]=_0xe40d6e;if(_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x1826c4[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x61')][_0xd1e5('0x4b')](_0x1826c4);})[_0xd1e5('0x16')](function(_0x569f6a){_0x27922c[_0xd1e5('0x4c')]=_0x569f6a;return _0x27922c;});}})['then'](respondWithFilteredResult(_0x236dd,_0x1826c4))[_0xd1e5('0x1f')](handleError(_0x236dd,null));};exports[_0xd1e5('0x64')]=function(_0x1860b5,_0x29517a){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x1860b5[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29517a,null))[_0xd1e5('0x16')](function(_0x1a7276){if(_0x1a7276){return _0x1a7276[_0xd1e5('0x64')](_0x1860b5[_0xd1e5('0x3c')][_0xd1e5('0x60')]);}})[_0xd1e5('0x16')](respondWithStatusCode(_0x29517a,null))[_0xd1e5('0x1f')](handleError(_0x29517a,null));};exports[_0xd1e5('0x65')]=function(_0x4976c1,_0xb19682){_0x4976c1[_0xd1e5('0x51')]['sitepic']=_0x4976c1[_0xd1e5('0x66')][_0xd1e5('0x67')];return db['ChatWebsite'][_0xd1e5('0x4f')]({'where':{'id':_0x4976c1[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xb19682,null))[_0xd1e5('0x16')](saveUpdates(_0x4976c1[_0xd1e5('0x51')],null))['then'](respondWithResult(_0xb19682,null))['catch'](handleError(_0xb19682,null));};exports[_0xd1e5('0x68')]=function(_0x484c8c,_0x53c6fb){_0x484c8c[_0xd1e5('0x51')]['agentAvatar']=_0x484c8c[_0xd1e5('0x66')][_0xd1e5('0x67')];return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x484c8c['params']['id']}})['then'](handleEntityNotFound(_0x53c6fb,null))[_0xd1e5('0x16')](saveUpdates(_0x484c8c[_0xd1e5('0x51')],null))['then'](respondWithResult(_0x53c6fb,null))[_0xd1e5('0x1f')](handleError(_0x53c6fb,null));};exports[_0xd1e5('0x69')]=function(_0x1a0b39,_0xdb5579){_0x1a0b39[_0xd1e5('0x51')][_0xd1e5('0x6a')]=_0x1a0b39[_0xd1e5('0x66')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x1a0b39[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xdb5579,null))[_0xd1e5('0x16')](saveUpdates(_0x1a0b39[_0xd1e5('0x51')],null))[_0xd1e5('0x16')](respondWithResult(_0xdb5579,null))[_0xd1e5('0x1f')](handleError(_0xdb5579,null));};exports[_0xd1e5('0x6b')]=function(_0x4501be,_0x20ac11){_0x4501be[_0xd1e5('0x51')][_0xd1e5('0x6c')]=_0x4501be['file']['filename'];return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x4501be[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x20ac11,null))[_0xd1e5('0x16')](saveUpdates(_0x4501be[_0xd1e5('0x51')],null))['then'](respondWithResult(_0x20ac11,null))[_0xd1e5('0x1f')](handleError(_0x20ac11,null));};exports['getLogo']=function(_0x18b964,_0x1bc64f){var _0x81fcc4=path['join'](config[_0xd1e5('0x6d')],'server/files/images/logos/default_logo.svg');var _0x1d7262={'where':{'id':_0x18b964[_0xd1e5('0x4e')]['id']},'attributes':['id',_0xd1e5('0x6e')],'raw':!![]};var _0x31491c=![];return require(_0xd1e5('0x6f'))[_0xd1e5('0x70')]()[_0xd1e5('0x16')](function(_0x1cb8cc){if(_0x1cb8cc){_0x31491c=_0x1cb8cc[_0xd1e5('0x71')];}})[_0xd1e5('0x16')](function(){return db['ChatWebsite'][_0xd1e5('0x4f')](_0x1d7262);})[_0xd1e5('0x16')](handleEntityNotFound(_0x1bc64f,null))[_0xd1e5('0x16')](function(_0x2cad31){if(_0x2cad31){if(!_[_0xd1e5('0x72')](_0x2cad31[_0xd1e5('0x6e')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x75'),_0x2cad31['sitepic']))&&_0x31491c){_0x81fcc4=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x75'),_0x2cad31[_0xd1e5('0x6e')]);}}return _0x1bc64f[_0xd1e5('0x76')](_0x81fcc4);}})['catch'](handleError(_0x1bc64f,null));};exports[_0xd1e5('0x77')]=function(_0x27e6fc,_0x49050e){var _0x5f401d=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x78'));var _0x3b64cd={'where':{'id':_0x27e6fc['params']['id']},'attributes':['id',_0xd1e5('0x79')],'raw':!![]};return db[_0xd1e5('0x34')]['find'](_0x3b64cd)[_0xd1e5('0x16')](handleEntityNotFound(_0x49050e,null))[_0xd1e5('0x16')](function(_0x9a77f6){if(_0x9a77f6){if(!_[_0xd1e5('0x72')](_0x9a77f6[_0xd1e5('0x79')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],'server/files/images/avatars/',_0x9a77f6['agentAvatar']))){_0x5f401d=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7a'),_0x9a77f6['agentAvatar']);}}return _0x49050e[_0xd1e5('0x76')](_0x5f401d);}})[_0xd1e5('0x1f')](handleError(_0x49050e,null));};exports[_0xd1e5('0x7b')]=function(_0x2f161f,_0x1fff3f){var _0x3547f9=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7c'));var _0xfb5766={'where':{'id':_0x2f161f['params']['id']},'attributes':['id',_0xd1e5('0x6a'),_0xd1e5('0x7d')],'raw':!![]};return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0xfb5766)['then'](handleEntityNotFound(_0x1fff3f,null))[_0xd1e5('0x16')](function(_0x2f0652){if(_0x2f0652){if(!_[_0xd1e5('0x72')](_0x2f0652[_0xd1e5('0x6a')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7a'),_0x2f0652[_0xd1e5('0x6a')]))&&_0x2f0652[_0xd1e5('0x7d')]){_0x3547f9=path['join'](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x2f0652[_0xd1e5('0x6a')]);}}return _0x1fff3f['download'](_0x3547f9);}})[_0xd1e5('0x1f')](handleError(_0x1fff3f,null));};exports['getSystemAvatar']=function(_0x1dd9fd,_0x36d59c){var _0x1050c7=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7e'));var _0x4d954c={'where':{'id':_0x1dd9fd[_0xd1e5('0x4e')]['id']},'attributes':['id',_0xd1e5('0x6c')],'raw':!![]};return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0x4d954c)[_0xd1e5('0x16')](handleEntityNotFound(_0x36d59c,null))[_0xd1e5('0x16')](function(_0x1ff077){if(_0x1ff077){if(!_['isNil'](_0x1ff077[_0xd1e5('0x6c')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x1ff077[_0xd1e5('0x6c')]))){_0x1050c7=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x1ff077[_0xd1e5('0x6c')]);}}return _0x36d59c[_0xd1e5('0x76')](_0x1050c7);}})[_0xd1e5('0x1f')](handleError(_0x36d59c,null));};exports['notify']=function(_0x2fc728,_0x34820f){var _0x49986b=require(_0xd1e5('0x7f'));var _0x4abde6=new _0x49986b();var _0x695cef=_0x4abde6[_0xd1e5('0x80')](_0x2fc728['headers']['user-agent'])[_0xd1e5('0x81')]();var _0x18bdc8={'body':_0x2fc728[_0xd1e5('0x51')],'channel':_0xd1e5('0x82')};var _0x5c070a=[];var _0x31a869=[];var _0x4d7702={};var _0x5a20b3=![];return db[_0xd1e5('0x83')][_0xd1e5('0x58')]()[_0xd1e5('0x16')](function(_0x45ef48){if(!_0x45ef48){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))]('no\x20available\x20attributes');}_0x5c070a=_['difference'](_[_0xd1e5('0x3b')](_0x45ef48),[_0xd1e5('0x86'),_0xd1e5('0x87')]);_0x31a869=_[_0xd1e5('0x88')](_[_0xd1e5('0x3b')](_0x45ef48),['createdAt',_0xd1e5('0x87'),_0xd1e5('0x89'),_0xd1e5('0x8a')]);if(_0x2fc728[_0xd1e5('0x51')]['id']){delete _0x2fc728[_0xd1e5('0x51')]['id'];}if(_[_0xd1e5('0x72')](_0x2fc728['body']['from'])){throw new db[(_0xd1e5('0x84'))]['ValidationError'](_0xd1e5('0x8b'));}if(_['isNil'](_0x2fc728['body'][_0xd1e5('0x51')])||_0x2fc728['body'][_0xd1e5('0x51')]===''){throw new db['Sequelize']['ValidationError'](_0xd1e5('0x8c'));}if(_[_0xd1e5('0x72')](_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')])){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31a869);}if(!_[_0xd1e5('0x8e')](_0x31a869,_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31a869);}_0x4d7702[_0x2fc728['body'][_0xd1e5('0x8d')]]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')];})['then'](function(){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x2fc728[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x90')],'as':_0xd1e5('0x91'),'include':[{'model':db[_0xd1e5('0x83')],'as':_0xd1e5('0x92'),'where':_0x4d7702,'limit':0x1,'order':[[_0xd1e5('0x87'),_0xd1e5('0x93')]]}]},{'model':db['ChatApplication'],'as':_0xd1e5('0x94')}]});})[_0xd1e5('0x16')](handleEntityNotFound(_0x34820f,null))[_0xd1e5('0x16')](function(_0x308cca){if(_0x308cca&&_0x308cca['List']){_0x18bdc8[_0xd1e5('0x95')]=_0x308cca;_0x18bdc8[_0xd1e5('0x96')]=_0x308cca[_0xd1e5('0x94')];_0x18bdc8[_0xd1e5('0x97')]=_0x308cca[_0xd1e5('0x91')];_0x18bdc8[_0xd1e5('0x96')]=_[_0xd1e5('0x98')](_0x18bdc8[_0xd1e5('0x96')],[_0xd1e5('0x99')],['asc']);if(_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x94')]){delete _0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x94')];}if(_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x91')]&&_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x91')][_0xd1e5('0x92')][_0xd1e5('0x41')]){return _0x18bdc8[_0xd1e5('0x95')]['List'][_0xd1e5('0x92')][0x0];}var _0x4a9927=_[_0xd1e5('0xc')](_0x2fc728[_0xd1e5('0x51')],{'firstName':_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')],'ListId':_0x308cca['ListId']});_0x4a9927[_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')]]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')];return db[_0xd1e5('0x83')][_0xd1e5('0x50')](_0x4a9927,{'fields':_0x5c070a,'raw':!![]});}})[_0xd1e5('0x16')](handleEntityNotFound(_0x34820f,null))[_0xd1e5('0x16')](function(_0x342875){_0x18bdc8['contact']=_0x342875;var _0x33e129=_0x2fc728[_0xd1e5('0x51')]['customerIp'];if(_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9b')]){_0x33e129=_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9b')];}else if(_0x2fc728[_0xd1e5('0x9a')]['x-forwarded-for']){_0x33e129=_[_0xd1e5('0x9c')](_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9d')][_0xd1e5('0x9e')](','));}if(_0x342875){var _0x565184={'ContactId':_0x342875['id'],'ChatWebsiteId':_0x2fc728['params']['id'],'from':(_0x342875['firstName']||'')+'\x20'+(_0x342875[_0xd1e5('0x9f')]||''),'customerIp':_0x33e129,'customerPort':_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0xa0')]?_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0xa0')]:null,'referer':_0x2fc728[_0xd1e5('0x51')]['referer'],'browserName':_0x695cef[_0xd1e5('0xa1')]['name']&&_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0xa2')]?util[_0xd1e5('0xa3')](_0xd1e5('0xa4'),_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0x2f')],_0x695cef['browser'][_0xd1e5('0xa2')]):_0xd1e5('0xa5'),'browserVersion':_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0xa2')]||_0xd1e5('0xa5'),'osName':util['format'](_0xd1e5('0xa4'),_0x695cef['os'][_0xd1e5('0x2f')],_0x695cef['os'][_0xd1e5('0xa2')]),'osVersion':_0x695cef['os']['version'],'deviceModel':_0x695cef[_0xd1e5('0xa6')]['model']&&_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')]?util[_0xd1e5('0xa3')](_0xd1e5('0xa8'),_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0x39')],_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')],_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0x37')]):null,'deviceVendor':_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')],'deviceType':_0x695cef[_0xd1e5('0xa6')]['type'],'formData':JSON[_0xd1e5('0xa9')](_0x2fc728[_0xd1e5('0x51')])};var _0x4de6c3={'ChatWebsiteId':_0x2fc728[_0xd1e5('0x4e')]['id'],'closed':![]};if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]){_0x4de6c3[_0xd1e5('0xaa')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')];return db[_0xd1e5('0xab')]['find']({'where':_0x4de6c3})['then'](function(_0x10fcaf){if(_0x10fcaf){return[_0x10fcaf,![]];}_0x565184[_0xd1e5('0xaa')]=_0x2fc728['body'][_0xd1e5('0xaa')];_0x565184[_0xd1e5('0xac')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xac')];return db[_0xd1e5('0xab')]['create'](_0x565184)[_0xd1e5('0x16')](function(_0x171c20){return[_0x171c20,!![]];});});}_0x4de6c3[_0xd1e5('0xad')]=_0x342875['id'];if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xae')]&&_0x2fc728[_0xd1e5('0x51')]['interaction']['id']){_0x4de6c3['id']=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xae')]['id'];return db['ChatInteraction']['find']({'where':_0x4de6c3})['then'](function(_0x45b878){if(_0x45b878){return[_0x45b878,![]];}return db[_0xd1e5('0xab')]['create'](_0x565184)[_0xd1e5('0x16')](function(_0xce5172){return[_0xce5172,!![]];});});}return db['ChatInteraction']['create'](_0x565184)[_0xd1e5('0x16')](function(_0x406a58){return[_0x406a58,!![]];});}})[_0xd1e5('0xaf')](function(_0x12f5b4,_0x40c708){if(_0x12f5b4){_0x5a20b3=_0x40c708;if(!_0x40c708){var _0x4d675d={'from':(_0x18bdc8[_0xd1e5('0xb0')][_0xd1e5('0xb1')]||'')+'\x20'+(_0x18bdc8[_0xd1e5('0xb0')][_0xd1e5('0x9f')]||'')};if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]&&_0x2fc728[_0xd1e5('0x51')]['messageId']&&_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]!=_0x2fc728[_0xd1e5('0x51')]['messageId']){_0x4d675d[_0xd1e5('0xaa')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xb2')];}return _0x12f5b4[_0xd1e5('0x29')](_0x4d675d);}else{return _0x12f5b4;}}})['then'](function(_0x1b0d06){_0x18bdc8[_0xd1e5('0xae')]=_0x1b0d06[_0xd1e5('0x52')]({'plain':!![]});_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb3')]=_0x5a20b3;if(_0x18bdc8[_0xd1e5('0xae')]['created']){if(_0x18bdc8['account']['autoclose']){_0x18bdc8['applications'][_0xd1e5('0xb4')]({'id':0x0,'priority':_0x18bdc8[_0xd1e5('0x96')][_0xd1e5('0x41')]+0x1,'app':_0xd1e5('0xb5'),'appdata':_0xd1e5('0xb6'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xd1e5('0x50')]({'body':_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x51')],'ChatWebsiteId':_0x2fc728[_0xd1e5('0x4e')]['id'],'ChatInteractionId':_0x1b0d06['id'],'direction':'in','ContactId':_0x18bdc8[_0xd1e5('0xb0')]['id'],'AttachmentId':_0x2fc728[_0xd1e5('0x51')]['AttachmentId']});})['then'](function(_0x1b66c7){_0x18bdc8['message']=_0x1b66c7;if(_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb7')]){return db['User'][_0xd1e5('0x4f')]({'attributes':['id',_0xd1e5('0x2f')],'where':{'id':_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb7')]}})[_0xd1e5('0x16')](function(_0x5d2a62){if(_0x5d2a62){_0x18bdc8[_0xd1e5('0x96')][_0xd1e5('0xb8')]({'id':0x0,'priority':0x0,'app':_0xd1e5('0xb9'),'appdata':_0x5d2a62[_0xd1e5('0x2f')]+','+(_0x18bdc8['account'][_0xd1e5('0xba')]||0xa),'interval':_0xd1e5('0xbb')});_0x18bdc8['forcedOwnership']=!![];}return respondWithRpcPromise(_0xd1e5('0xbc'),_0xd1e5('0xbd'),_0x18bdc8);});}return respondWithRpcPromise(_0xd1e5('0xbc'),_0xd1e5('0xbd'),_0x18bdc8);})[_0xd1e5('0x16')](function(_0x1f1ba6){respondWithRpcPromise(_0xd1e5('0xbe'),_0xd1e5('0xbe'),{'event':_0xd1e5('0xbf'),'message':_0x1f1ba6},client9002);return _0x1f1ba6;})['then'](respondWithResult(_0x34820f,null))[_0xd1e5('0x1f')](handleError(_0x34820f,null));};exports['offline']=function(_0x304ac9,_0x360d4b){var _0xa88d8e,_0x36cdee,_0x359a90;var _0x2b70c0=[];var _0x13020d={};var _0x273bcd=_0x304ac9[_0xd1e5('0xc0')]||[];var _0xab2f15=[];var _0x586a7b;return db[_0xd1e5('0x83')][_0xd1e5('0x58')]()[_0xd1e5('0x16')](function(_0x274242){if(!_0x274242){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0xc1'));}_0x2b70c0=_[_0xd1e5('0x88')](_['keys'](_0x274242),['createdAt','updatedAt','CompanyId',_0xd1e5('0x8a')]);if(_0x304ac9[_0xd1e5('0x51')]['id']){delete _0x304ac9['body']['id'];}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')]['from'])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)[_0xd1e5('0x30')](new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0x8b')));}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')]['body'])||_0x304ac9['body'][_0xd1e5('0x51')]===''){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)[_0xd1e5('0x30')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)['send'](new db[(_0xd1e5('0x84'))]['ValidationError'](_0xd1e5('0xc3')+_0x2b70c0));}if(!_[_0xd1e5('0x8e')](_0x2b70c0,_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)['send'](new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0xc4')+_0x2b70c0));}_0x13020d[_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')]]=_0x304ac9['body'][_0xd1e5('0x8f')];})[_0xd1e5('0x16')](function(){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x304ac9[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x90')],'as':'List'},{'model':db[_0xd1e5('0xc5')],'as':_0xd1e5('0xc5')}]});})['then'](handleEntityNotFound(_0x360d4b,null))[_0xd1e5('0x16')](function(_0x2334b6){if(_0x2334b6&&_0x2334b6[_0xd1e5('0x91')]){_0x36cdee=_0x2334b6;var _0x1a4ee8=_[_0xd1e5('0xc')](_0x304ac9[_0xd1e5('0x51')],{'firstName':_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x8f')],'phone':_0x304ac9['body'][_0xd1e5('0x8f')],'ListId':_0x2334b6[_0xd1e5('0x8a')]});_0x1a4ee8[_0x304ac9['body'][_0xd1e5('0xc2')]]=_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x8f')];return db['CmContact']['findOrCreate']({'where':_0x13020d,'defaults':_0x1a4ee8});}})[_0xd1e5('0xaf')](function(_0x49d02d){if(_0x49d02d){_0x359a90=_0x49d02d;var _0x1b5e8e=fs[_0xd1e5('0xc6')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0xc7')),_0xd1e5('0xc8'));var _0x210c08=ejs[_0xd1e5('0xc9')](_0x1b5e8e,{'body':_[_0xd1e5('0xca')](_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x51')]),'bodyTitle':_0x36cdee['offlineMessageBody']});return db['ChatOfflineMessage'][_0xd1e5('0x50')]({'body':_0x210c08,'plainBody':htmlToText[_0xd1e5('0xcb')](_0x210c08),'ContactId':_0x49d02d['id'],'ChatWebsiteId':_0x36cdee['id']});}})[_0xd1e5('0x16')](function(_0x3c1d68){_0x586a7b=_0x3c1d68;if(_0x273bcd[_0xd1e5('0x41')]){var _0x55d72e=_0x273bcd['map'](function(_0x1cee09){return{'name':_0x1cee09[_0xd1e5('0xcc')],'basename':_0x1cee09[_0xd1e5('0x67')],'type':_0x1cee09['mimetype'],'ChatOfflineMessageId':_0x3c1d68['id']};});_0xab2f15=_0x55d72e[_0xd1e5('0x3a')](_0x283268=>{var _0x52101e={'filename':_0x283268[_0xd1e5('0x2f')],'path':path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],'server',_0xd1e5('0xc0'),_0xd1e5('0xcd'),_0xd1e5('0xce'),_0x283268[_0xd1e5('0xcf')])};return _0x52101e;});if(!_0x36cdee[_0xd1e5('0xd0')]){return db[_0xd1e5('0xd1')][_0xd1e5('0xd2')](function(_0x52a5c8){return db[_0xd1e5('0xd3')][_0xd1e5('0xd4')](_0x55d72e,{'transaction':_0x52a5c8});});}}})[_0xd1e5('0x16')](function(){if(_0x586a7b){_0xa88d8e=_0x586a7b;return db[_0xd1e5('0xc5')][_0xd1e5('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xd1e5('0xd5')],'as':_0xd1e5('0xd6'),'raw':!![],'include':[{'model':db[_0xd1e5('0xd7')],'as':_0xd1e5('0xd7'),'raw':!![]}]}]});}})[_0xd1e5('0x16')](function(_0x52b885){if(_0x52b885&&_0x52b885['Smtp']&&_0x36cdee['forwardOffline']&&_0x36cdee[_0xd1e5('0xd8')]){var _0x2f151a=_0x52b885['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xd1e5('0xd9'),{'account':_0x2f151a,'message':{'from':util[_0xd1e5('0xa3')](_0xd1e5('0xda'),_0x52b885[_0xd1e5('0x2f')],_0x52b885[_0xd1e5('0xdb')]||_0x52b885[_0xd1e5('0xd6')]['user']),'to':_0x36cdee[_0xd1e5('0xd8')],'subject':_0x36cdee['offlineMessageSubject'],'html':_0xa88d8e[_0xd1e5('0x51')],'attachments':_0xab2f15}},client9003)[_0xd1e5('0x16')](function(){return _0xa88d8e;})['catch'](function(_0x3a1234){logger['error'](_0x3a1234);});}})[_0xd1e5('0x16')](function(){if(_0x36cdee&&_0x36cdee[_0xd1e5('0xd0')]&&_0x36cdee[_0xd1e5('0xdc')]){var _0x2525a7=[];if(_0x273bcd['length']){_0x2525a7=_0x273bcd[_0xd1e5('0x3a')](function(_0x465fb5){return{'name':_0x465fb5['originalname'],'basename':_0x465fb5[_0xd1e5('0x67')],'type':_0x465fb5[_0xd1e5('0xdd')],'ChatOfflineMessageId':_0x586a7b['id']};});}var _0x2c04b5;if(!_['isNil'](_0x36cdee[_0xd1e5('0xde')])){var _0x18d8f1=_[_0xd1e5('0x3a')](_0x304ac9[_0xd1e5('0x51')],function(_0x8b2bec){return _0x8b2bec;});var _0x20f32f=_[_0xd1e5('0xdf')](_0x18d8f1)[0x0];var _0x152901=_['mapValues'](_0x20f32f,function(_0x4c5408){return _0x4c5408;});_0x2c04b5=_0x152901[0x1][_0x36cdee['subjectOffline']];}var _0x3dca11={'from':_0x359a90[_0xd1e5('0xdb')],'firstName':_0x359a90[_0xd1e5('0xb1')],'lastName':_0x359a90[_0xd1e5('0x9f')],'mapKey':_0xd1e5('0xdb'),'message':{'from':_0x359a90[_0xd1e5('0xdb')],'to':_0x36cdee[_0xd1e5('0xc5')][_0xd1e5('0xdb')],'cc':'','subject':_[_0xd1e5('0x72')](_0x2c04b5)?_0x36cdee[_0xd1e5('0xe0')]:_0x2c04b5,'messageId':'','sentAt':new Date(),'attach':_0x2525a7[_0xd1e5('0x41')],'attachments':_0x2525a7,'originChannel':_0xd1e5('0xe1'),'ChatWebsiteId':_0x36cdee['id'],'ChatOfflineMessageId':_0xa88d8e['id'],'originTo':_0x36cdee[_0xd1e5('0xc5')][_0xd1e5('0xdb')]},'body':_0xa88d8e[_0xd1e5('0x51')]};var _0x214e5e={'account':{'id':_0x36cdee[_0xd1e5('0xdc')]},'body':_0x3dca11,'log':_0xd1e5('0xe2')};return respondWithRpcPromise(_0xd1e5('0xe2'),_0xd1e5('0xe3'),_0x214e5e,client9001)[_0xd1e5('0x16')](function(){return _0xa88d8e;})[_0xd1e5('0x1f')](function(_0x5cecdc){logger[_0xd1e5('0x1b')](_0x5cecdc);});}return;})[_0xd1e5('0x16')](function(){if(_0xa88d8e){return _0xa88d8e;}})[_0xd1e5('0x16')](respondWithResult(_0x360d4b,null))['catch'](function(_0x5bcfcb){logger[_0xd1e5('0x1b')]('catch',_0x5bcfcb);for(var _0x1d17a0 of _0x273bcd){var _0x5a3417=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0xe4'),_0xd1e5('0xc0'),_0xd1e5('0xcd'),'offline-chat',_0x1d17a0['filename']);fs_extra[_0xd1e5('0xe5')](_0x5a3417)[_0xd1e5('0x1f')](function(_0x162831){logger[_0xd1e5('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x5a3417,_0x162831);});}});};exports[_0xd1e5('0xe6')]=function(_0x5aed11,_0x1738e0){return db[_0xd1e5('0xab')][_0xd1e5('0x4f')]({'where':{'id':_0x5aed11[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1738e0,null))[_0xd1e5('0x16')](function(_0x22a395){if(_0x22a395){return _0x22a395[_0xd1e5('0xe6')](_0x5aed11[_0xd1e5('0x51')]['ids'],_[_0xd1e5('0xe7')](_0x5aed11[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{});}})['then'](respondWithResult(_0x1738e0,null))['catch'](handleError(_0x1738e0,null));};exports[_0xd1e5('0xe8')]=function(_0x16c5de,_0x2452fb){var _0x2e3dce={'raw':![],'where':{}};var _0x17e3e2={};var _0x58d0c0={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x16c5de[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x2452fb,null))['then'](function(_0x206aa2){if(_0x206aa2){_0x17e3e2[_0xd1e5('0x39')]=_['keys'](db[_0xd1e5('0xab')][_0xd1e5('0x35')]);_0x17e3e2[_0xd1e5('0x3c')]=_['keys'](_0x16c5de[_0xd1e5('0x3c')]);_0x17e3e2[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x17e3e2[_0xd1e5('0x39')],_0x17e3e2[_0xd1e5('0x3c')]);_0x2e3dce['attributes']=_[_0xd1e5('0x3e')](_0x17e3e2['model'],qs[_0xd1e5('0x40')](_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2e3dce[_0xd1e5('0x3f')]=_0x2e3dce['attributes'][_0xd1e5('0x41')]?_0x2e3dce[_0xd1e5('0x3f')]:_0x17e3e2[_0xd1e5('0x39')];if(!_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x63')]('nolimit')){_0x2e3dce[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x16c5de['query'][_0xd1e5('0x25')]);_0x2e3dce['offset']=qs[_0xd1e5('0x23')](_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x2e3dce['order']=qs['sort'](_0x16c5de['query'][_0xd1e5('0x43')]);_0x2e3dce['where']=qs['filters'](_['pick'](_0x16c5de[_0xd1e5('0x3c')],_0x17e3e2['filters']));_0x2e3dce['where']['ChatWebsiteId']=_0x206aa2['id'];if(_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x2e3dce[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2e3dce[_0xd1e5('0x45')],{'$or':_['map'](_0x2e3dce[_0xd1e5('0x3f')],function(_0x1a88d7){var _0x295d42={};_0x295d42[_0x1a88d7]={'$like':'%'+_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x295d42;})});}_0x2e3dce=_[_0xd1e5('0x46')]({},_0x2e3dce,_0x16c5de[_0xd1e5('0x48')]);return db[_0xd1e5('0xab')][_0xd1e5('0x26')]({'where':_0x2e3dce['where']})[_0xd1e5('0x16')](function(_0x5047f3){_0x58d0c0[_0xd1e5('0x26')]=_0x5047f3;if(_0x16c5de[_0xd1e5('0x3c')]['includeAll']){_0x2e3dce[_0xd1e5('0x4a')]=[{'model':db[_0xd1e5('0x83')],'as':_0xd1e5('0xe9'),'required':![]},{'model':db[_0xd1e5('0xea')],'as':'Owner','attributes':[_0xd1e5('0x2f'),_0xd1e5('0xeb'),_0xd1e5('0xec')],'required':![]},{'model':db[_0xd1e5('0xed')],'as':_0xd1e5('0xee'),'attributes':['id',_0xd1e5('0x2f'),_0xd1e5('0xef')],'where':_0x16c5de['query'][_0xd1e5('0xf0')]?{'id':_0x16c5de[_0xd1e5('0x3c')]['tag']}:undefined,'required':_0x16c5de['query'][_0xd1e5('0xf0')]?!![]:![]}];}return db[_0xd1e5('0xab')][_0xd1e5('0x4b')](_0x2e3dce);})['then'](function(_0x320217){_0x58d0c0[_0xd1e5('0x4c')]=_0x320217;return _0x58d0c0;});}})[_0xd1e5('0x16')](respondWithFilteredResult(_0x2452fb,_0x2e3dce))[_0xd1e5('0x1f')](handleError(_0x2452fb,null));};function iftimePromise(_0x5a3986,_0x174017){return respondWithRpcPromise(_0xd1e5('0xf1'),'getSnippet',{'command':_0x174017[_0xd1e5('0xf2')]?util[_0xd1e5('0xa3')](_0xd1e5('0xf3'),_0x5a3986[_0xd1e5('0xf4')],_0x174017[_0xd1e5('0xf2')]):util[_0xd1e5('0xa3')](_0xd1e5('0xf5'),_0x5a3986[_0xd1e5('0xf4')])},client9002)[_0xd1e5('0x16')](function(_0x368b89){var _0x4319b3=_0x368b89&&_0x368b89[_0xd1e5('0xf6')](_0xd1e5('0xf7'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x174017['id'],_0x5a3986['id'],_0x5a3986[_0xd1e5('0xf4')],_0x4319b3?_0xd1e5('0xf8'):_0xd1e5('0xf9'),_0x174017[_0xd1e5('0xf2')]?_0x174017['timezone']:'No\x20timezone');return _0x4319b3;})[_0xd1e5('0x1f')](function(_0x560cc8){logger[_0xd1e5('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x174017['id'],_0x5a3986['id'],_0x5a3986[_0xd1e5('0xf4')],util[_0xd1e5('0xfa')](_0x560cc8,{'showHidden':![],'depth':null}),_0x174017[_0xd1e5('0xf2')]?_0x174017[_0xd1e5('0xf2')]:_0xd1e5('0xfb'));return![];});}exports[_0xd1e5('0xfc')]=function(_0x5c6074,_0x29d15c){var _0xdd8419=0x0;var _0x29e774=0x0;var _0x3fe214=![];var _0x43891f;var _0x1424e2;return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x5c6074[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0xfd')],'as':_0xd1e5('0xfd'),'include':[{'model':db[_0xd1e5('0xfd')],'as':_0xd1e5('0xfe'),'attributes':['id',_0xd1e5('0xf4')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x29d15c,null))['then'](function(_0x3fda98){if(_0x3fda98){_0x43891f=_0x3fda98;return _0x3fda98[_0xd1e5('0xff')]({'raw':!![]});}})[_0xd1e5('0x16')](function(_0x115b27){if(_0x43891f){if(_0x115b27){_0x1424e2=_0x115b27;}}return require(_0xd1e5('0x6f'))['getLicense']();})['then'](function(_0x11308f){if(_0x11308f){_0x29e774=_0x11308f[_0xd1e5('0x100')];_0x3fe214=_0x11308f['custom'];}})[_0xd1e5('0x16')](function(){return db[_0xd1e5('0xab')]['count']({'where':{'closed':![]}});})[_0xd1e5('0x16')](function(_0x50fb45){_0xdd8419=_0x50fb45;if(_0x29e774&&_0x50fb45>_0x29e774){return db['License'][_0xd1e5('0x5b')]({'where':{'id':0x1}})[_0xd1e5('0x16')](function(_0x36ef06){if(_0x36ef06){_0x36ef06['increment'](_0xd1e5('0x101'));}});}})[_0xd1e5('0x16')](function(){if(_0x43891f[_0xd1e5('0xfd')]&&_0x43891f[_0xd1e5('0xfd')][_0xd1e5('0xfe')]){var _0x23fb83=[];for(var _0x30b760=0x0;_0x30b760<_0x43891f[_0xd1e5('0xfd')][_0xd1e5('0xfe')][_0xd1e5('0x41')];_0x30b760++){var _0x41dc07=_0x43891f['Interval'][_0xd1e5('0xfe')][_0x30b760][_0xd1e5('0x52')]({'plain':!![]});_0x23fb83['push'](iftimePromise(_0x41dc07,_0x43891f));}return BPromise[_0xd1e5('0x102')](_0x23fb83)[_0xd1e5('0x16')](function(_0x41cf69){return _[_0xd1e5('0x103')](_0x41cf69);});}else{return!![];}})[_0xd1e5('0x16')](function(_0x2dcd44){var _0x39fd31=fs[_0xd1e5('0xc6')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x104')),'utf8');var _0x517d61={'remote':_0x43891f[_0xd1e5('0x105')],'query':querystring[_0xd1e5('0xa9')](_[_0xd1e5('0x46')](_0x43891f[_0xd1e5('0x52')]({'plain':!![]}),{'customerIp':_0x5c6074[_0xd1e5('0x9a')]['x-forwarded-for']||_0x5c6074[_0xd1e5('0x9a')][_0xd1e5('0x106')]||_0x5c6074[_0xd1e5('0x107')]['remoteAddress']||_0x5c6074['ip'],'referer':_0x5c6074[_0xd1e5('0x9a')][_0xd1e5('0x108')],'openedInteractions':_0xdd8419,'maxInteractions':_0x29e774,'virtual':_0x3fe214[_0xd1e5('0x100')],'online':_0x2dcd44,'custom':_0x3fe214}))[_0xd1e5('0x109')](/'/g,'\x5c\x27')};_0x29d15c[_0xd1e5('0x30')](ejs[_0xd1e5('0xc9')](Mustache[_0xd1e5('0xc9')](_0x39fd31,_0x517d61),{'proactiveActions':_0x1424e2,'alignment':_0x43891f[_0xd1e5('0x10a')],'verticalAlignment':_0x43891f[_0xd1e5('0x10b')],'div_color':_0x43891f[_0xd1e5('0xef')],'labelText':_0x43891f[_0xd1e5('0x10c')],'text_color':_0x43891f[_0xd1e5('0x10d')],'button_color':_0x43891f['color_button'],'background_color':_0x43891f[_0xd1e5('0x10e')],'hideWhenOffline':_0x43891f['hideWhenOffline'],'interval':_0x43891f[_0xd1e5('0x10f')]}));})['catch'](handleError(_0x29d15c,null));};exports[_0xd1e5('0x110')]=function(_0x1c2b5d,_0x583461){var _0x4f160d=_0x1c2b5d[_0xd1e5('0x4e')]['id'];var _0x1ee32f=_0x1c2b5d[_0xd1e5('0x51')];var _0x4f9f40=0xc8;var _0x3e0573=null;return db[_0xd1e5('0xd1')][_0xd1e5('0xd2')]({'isolationLevel':db[_0xd1e5('0xd1')][_0xd1e5('0x111')][_0xd1e5('0x112')][_0xd1e5('0x113')]},function(_0x2ef09f){return db['ChatWebsite']['findOne']({'where':{'id':_0x4f160d},'transaction':_0x2ef09f})['then'](function(_0x24b4c3){if(_0x24b4c3){return db[_0xd1e5('0x114')][_0xd1e5('0x2c')]({'where':{'ChatWebsiteId':_0x4f160d},'transaction':_0x2ef09f})[_0xd1e5('0x16')](function(){var _0x13d401=_[_0xd1e5('0x3a')](_0x1ee32f,function(_0x483d4f){_0x483d4f[_0xd1e5('0x5d')]=_0x4f160d;return _0x483d4f;});return db['ChatApplication'][_0xd1e5('0xd4')](_0x13d401,{'transaction':_0x2ef09f});});}else{_0x4f9f40=0x194;_0x3e0573=[];}});})[_0xd1e5('0x16')](function(){if(_0x4f9f40!==0x194){return db[_0xd1e5('0x114')][_0xd1e5('0x115')]({'where':{'ChatWebsiteId':_0x4f160d},'order':_0xd1e5('0x99')})[_0xd1e5('0x16')](function(_0x1b89ea){_0x3e0573=_0x1b89ea;});}})[_0xd1e5('0x1f')](function(_0x3a5b99){_0x4f9f40=0x1f4;logger[_0xd1e5('0x1b')](_0x3a5b99[_0xd1e5('0x2e')]);if(_0x3a5b99[_0xd1e5('0x2f')]){delete _0x3a5b99[_0xd1e5('0x2f')];}_0x3e0573=_0x3a5b99;})[_0xd1e5('0x116')](function(){if(_0x3e0573===null){_0x583461[_0xd1e5('0x20')](_0x4f9f40);}else{if(_0x4f9f40===0x1f4){_0x583461[_0xd1e5('0x21')](_0x4f9f40)[_0xd1e5('0x30')](_0x3e0573);}else{_0x583461[_0xd1e5('0x21')](_0x4f9f40)[_0xd1e5('0x22')](_0x3e0573);}}});};exports[_0xd1e5('0x117')]=function(_0xe81d1e,_0xc72656){var _0x342788={};var _0x152fe2={};var _0x2a57f8;var _0x1df0ba;return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0xe81d1e[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xc72656,null))[_0xd1e5('0x16')](function(_0x425234){if(_0x425234){_0x2a57f8=_0x425234;_0x152fe2[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x114')]['rawAttributes']);_0x152fe2[_0xd1e5('0x3c')]=_['keys'](_0xe81d1e[_0xd1e5('0x3c')]);_0x152fe2['filters']=_[_0xd1e5('0x3e')](_0x152fe2[_0xd1e5('0x39')],_0x152fe2[_0xd1e5('0x3c')]);_0x342788[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x152fe2[_0xd1e5('0x39')],qs['fields'](_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x342788[_0xd1e5('0x3f')]=_0x342788[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x342788[_0xd1e5('0x3f')]:_0x152fe2[_0xd1e5('0x39')];_0x342788[_0xd1e5('0x5c')]=qs['sort'](_0xe81d1e[_0xd1e5('0x3c')]['sort']);_0x342788['where']=qs[_0xd1e5('0x3d')](_['pick'](_0xe81d1e[_0xd1e5('0x3c')],_0x152fe2[_0xd1e5('0x3d')]));if(_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x342788[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x342788[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x342788['attributes'],function(_0x5e4b67){var _0x482fb4={};_0x482fb4[_0x5e4b67]={'$like':'%'+_0xe81d1e['query']['filter']+'%'};return _0x482fb4;})});}_0x342788=_[_0xd1e5('0x46')]({},_0x342788,_0xe81d1e['options']);return _0x2a57f8[_0xd1e5('0x117')](_0x342788);}})[_0xd1e5('0x16')](function(_0x38a8f9){if(_0x38a8f9){_0x1df0ba=_0x38a8f9[_0xd1e5('0x41')];if(!_0xe81d1e[_0xd1e5('0x3c')]['hasOwnProperty'](_0xd1e5('0x42'))){_0x342788['limit']=qs[_0xd1e5('0x25')](_0xe81d1e[_0xd1e5('0x3c')]['limit']);_0x342788[_0xd1e5('0x23')]=qs['offset'](_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}return _0x2a57f8[_0xd1e5('0x117')](_0x342788);}})[_0xd1e5('0x16')](function(_0x2c8e2f){if(_0x2c8e2f){return _0x2c8e2f?{'count':_0x1df0ba,'rows':_0x2c8e2f}:null;}})['then'](respondWithResult(_0xc72656,null))['catch'](handleError(_0xc72656,null));};exports[_0xd1e5('0x118')]=function(_0x59dda3,_0x1e320e){return db[_0xd1e5('0x119')][_0xd1e5('0x4f')]({'where':{'id':_0x59dda3[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x1e320e,null))[_0xd1e5('0x16')](function(_0x4ea63a){if(_0x4ea63a){return _0x4ea63a[_0xd1e5('0x118')](_0x59dda3['body']['ids'],_[_0xd1e5('0xe7')](_0x59dda3[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{});}})['then'](respondWithResult(_0x1e320e,null))['catch'](handleError(_0x1e320e,null));};exports[_0xd1e5('0xff')]=function(_0x1231f0,_0x56ece0){var _0x5e990a={};var _0x370855={};var _0x1779b3;var _0x2549d8;return db[_0xd1e5('0x34')][_0xd1e5('0x5b')]({'where':{'id':_0x1231f0['params']['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x56ece0,null))['then'](function(_0x1367c3){if(_0x1367c3){_0x1779b3=_0x1367c3;_0x370855['model']=_['keys'](db[_0xd1e5('0x11a')][_0xd1e5('0x35')]);_0x370855[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x1231f0[_0xd1e5('0x3c')]);_0x370855[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x370855[_0xd1e5('0x39')],_0x370855[_0xd1e5('0x3c')]);_0x5e990a[_0xd1e5('0x3f')]=_['intersection'](_0x370855[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x1231f0['query']['fields']));_0x5e990a[_0xd1e5('0x3f')]=_0x5e990a[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x5e990a[_0xd1e5('0x3f')]:_0x370855[_0xd1e5('0x39')];_0x5e990a[_0xd1e5('0x5c')]=qs['sort'](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x5e990a['where']=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x1231f0[_0xd1e5('0x3c')],_0x370855['filters']));if(_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x5e990a[_0xd1e5('0x45')]=_['merge'](_0x5e990a[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x5e990a[_0xd1e5('0x3f')],function(_0x2d2dfb){var _0x48bbd6={};_0x48bbd6[_0x2d2dfb]={'$like':'%'+_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x48bbd6;})});}_0x5e990a=_[_0xd1e5('0x46')]({},_0x5e990a,_0x1231f0[_0xd1e5('0x48')]);return _0x1779b3['getProactiveActions'](_0x5e990a);}})[_0xd1e5('0x16')](function(_0x261b29){if(_0x261b29){_0x2549d8=_0x261b29['length'];if(!_0x1231f0['query'][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x5e990a[_0xd1e5('0x25')]=qs['limit'](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x5e990a[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}return _0x1779b3[_0xd1e5('0xff')](_0x5e990a);}})[_0xd1e5('0x16')](function(_0x207326){if(_0x207326){return _0x207326?{'count':_0x2549d8,'rows':_0x207326}:null;}})[_0xd1e5('0x16')](respondWithResult(_0x56ece0,null))[_0xd1e5('0x1f')](handleError(_0x56ece0,null));};exports[_0xd1e5('0x11b')]=function(_0x1a988b,_0x241a53){var _0x45a050=_0x1a988b[_0xd1e5('0x3c')][_0xd1e5('0x11c')]==='false'?_0xd1e5('0x11d'):'onlineForm';return db[_0xd1e5('0x34')]['find']({'attributes':['id',_0x45a050],'where':{'id':_0x1a988b['params']['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x241a53,null))[_0xd1e5('0x16')](function(_0x40c8df){if(_0x40c8df){var _0x3cba02=_0x40c8df[_0x45a050];var _0x49dd8a=_0x3cba02&&_0x3cba02[_0xd1e5('0x11e')]?_0x3cba02[_0xd1e5('0x11e')]:[];_0x241a53[_0xd1e5('0x30')]({'fromKey':_[_0xd1e5('0x72')](_0x3cba02[_0xd1e5('0x11f')])?undefined:_0x3cba02[_0xd1e5('0x11f')],'count':_0x49dd8a[_0xd1e5('0x41')],'rows':_0x49dd8a});}})[_0xd1e5('0x1f')](handleError(_0x241a53,null));};exports['getOfflineMessages']=function(_0x5af8de,_0x59b2d3){var _0x2ac16e={'raw':![],'where':{}};var _0x1a75fa={};var _0x5cbf51={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x5af8de[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59b2d3,null))[_0xd1e5('0x16')](function(_0x1a8554){if(_0x1a8554){_0x1a75fa[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x120')]['rawAttributes']);_0x1a75fa[_0xd1e5('0x3c')]=_['keys'](_0x5af8de['query']);_0x1a75fa[_0xd1e5('0x3d')]=_['intersection'](_0x1a75fa[_0xd1e5('0x39')],_0x1a75fa[_0xd1e5('0x3c')]);_0x2ac16e[_0xd1e5('0x3f')]=_['intersection'](_0x1a75fa[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2ac16e[_0xd1e5('0x3f')]=_0x2ac16e[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x2ac16e[_0xd1e5('0x3f')]:_0x1a75fa['model'];if(!_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x2ac16e[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x2ac16e[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x2ac16e['order']=qs[_0xd1e5('0x43')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x2ac16e[_0xd1e5('0x45')]=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x5af8de[_0xd1e5('0x3c')],_0x1a75fa[_0xd1e5('0x3d')]));_0x2ac16e[_0xd1e5('0x45')]['ChatWebsiteId']=_0x1a8554['id'];if(_0x5af8de[_0xd1e5('0x3c')]['filter']){_0x2ac16e[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2ac16e[_0xd1e5('0x45')],{'$or':_['map'](_0x2ac16e[_0xd1e5('0x3f')],function(_0x350544){var _0x34c0c3={};_0x34c0c3[_0x350544]={'$like':'%'+_0x5af8de[_0xd1e5('0x3c')]['filter']+'%'};return _0x34c0c3;})});}_0x2ac16e=_[_0xd1e5('0x46')]({},_0x2ac16e,_0x5af8de[_0xd1e5('0x48')]);return db[_0xd1e5('0x120')]['count']({'where':_0x2ac16e[_0xd1e5('0x45')]})['then'](function(_0x32c428){_0x5cbf51['count']=_0x32c428;if(_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x2ac16e['include']=[{'all':!![]}];}else{_0x2ac16e[_0xd1e5('0x4a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xd1e5('0x120')][_0xd1e5('0x4b')](_0x2ac16e);})[_0xd1e5('0x16')](function(_0x55e45d){_0x5cbf51[_0xd1e5('0x4c')]=_0x55e45d;return _0x5cbf51;});}})[_0xd1e5('0x16')](respondWithFilteredResult(_0x59b2d3,_0x2ac16e))[_0xd1e5('0x1f')](handleError(_0x59b2d3,null));};exports[_0xd1e5('0x121')]=function(_0x595d54,_0x5c19bb){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x595d54[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x5c19bb,null))[_0xd1e5('0x16')](function(_0x32281d){if(_0x32281d){return _0x32281d[_0xd1e5('0x121')](_0x595d54['body'][_0xd1e5('0x60')],_[_0xd1e5('0xe7')](_0x595d54[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{})[_0xd1e5('0xaf')](function(_0x29cacc){for(var _0x58f3a7=0x0;_0x58f3a7<_0x595d54[_0xd1e5('0x51')]['ids']['length'];_0x58f3a7+=0x1){socket[_0xd1e5('0x122')](_0xd1e5('0x123'),{'UserId':Number(_0x595d54[_0xd1e5('0x51')][_0xd1e5('0x60')][_0x58f3a7]),'ChatWebsiteId':Number(_0x595d54[_0xd1e5('0x4e')]['id'])});}return _0x29cacc;});}})[_0xd1e5('0x16')](respondWithResult(_0x5c19bb,null))[_0xd1e5('0x1f')](handleError(_0x5c19bb,null));};exports[_0xd1e5('0x124')]=function(_0x43968d,_0x18b7c2){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x43968d[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18b7c2,null))[_0xd1e5('0x16')](function(_0x4e1f4){if(_0x4e1f4){return _0x4e1f4[_0xd1e5('0x124')](_0x43968d[_0xd1e5('0x3c')]['ids'])[_0xd1e5('0x16')](function(){if(_[_0xd1e5('0x125')](_0x43968d[_0xd1e5('0x3c')][_0xd1e5('0x60')])){for(var _0x486895=0x0;_0x486895<_0x43968d[_0xd1e5('0x3c')][_0xd1e5('0x60')][_0xd1e5('0x41')];_0x486895+=0x1){socket[_0xd1e5('0x122')](_0xd1e5('0x126'),{'UserId':Number(_0x43968d[_0xd1e5('0x3c')]['ids'][_0x486895]),'ChatWebsiteId':Number(_0x43968d[_0xd1e5('0x4e')]['id'])});}}else{socket['emit'](_0xd1e5('0x126'),{'UserId':Number(_0x43968d[_0xd1e5('0x3c')]['ids']),'ChatWebsiteId':Number(_0x43968d[_0xd1e5('0x4e')]['id'])});}});}})[_0xd1e5('0x16')](respondWithStatusCode(_0x18b7c2,null))['catch'](handleError(_0x18b7c2,null));};exports[_0xd1e5('0x127')]=function(_0x38d5ec,_0x172948){var _0x59fbc8={};var _0x49759a={};var _0x30e32b;var _0x3cdde4;return db['ChatWebsite'][_0xd1e5('0x5b')]({'where':{'id':_0x38d5ec[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x172948,null))[_0xd1e5('0x16')](function(_0x39fab2){if(_0x39fab2){_0x30e32b=_0x39fab2;_0x49759a['model']=_[_0xd1e5('0x3b')](db[_0xd1e5('0xea')][_0xd1e5('0x35')]);_0x49759a[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x38d5ec[_0xd1e5('0x3c')]);_0x49759a[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x49759a[_0xd1e5('0x39')],_0x49759a[_0xd1e5('0x3c')]);_0x59fbc8['attributes']=_[_0xd1e5('0x3e')](_0x49759a[_0xd1e5('0x39')],qs['fields'](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x59fbc8[_0xd1e5('0x3f')]=_0x59fbc8[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x59fbc8[_0xd1e5('0x3f')]:_0x49759a['model'];_0x59fbc8[_0xd1e5('0x5c')]=qs[_0xd1e5('0x43')](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x59fbc8[_0xd1e5('0x45')]=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x38d5ec['query'],_0x49759a[_0xd1e5('0x3d')]));if(_0x38d5ec[_0xd1e5('0x3c')]['filter']){_0x59fbc8[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x59fbc8[_0xd1e5('0x45')],{'$or':_['map'](_0x59fbc8[_0xd1e5('0x3f')],function(_0x46c8bf){var _0x455e5b={};_0x455e5b[_0x46c8bf]={'$like':'%'+_0x38d5ec['query'][_0xd1e5('0x5e')]+'%'};return _0x455e5b;})});}_0x59fbc8=_[_0xd1e5('0x46')]({},_0x59fbc8,_0x38d5ec[_0xd1e5('0x48')]);return _0x30e32b[_0xd1e5('0x127')](_0x59fbc8);}})['then'](function(_0x1f1104){if(_0x1f1104){_0x3cdde4=_0x1f1104['length'];if(!_0x38d5ec[_0xd1e5('0x3c')]['hasOwnProperty']('nolimit')){_0x59fbc8[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x59fbc8['offset']=qs[_0xd1e5('0x23')](_0x38d5ec['query'][_0xd1e5('0x23')]);}return _0x30e32b[_0xd1e5('0x127')](_0x59fbc8);}})['then'](function(_0x402de0){if(_0x402de0){return _0x402de0?{'count':_0x3cdde4,'rows':_0x402de0}:null;}})[_0xd1e5('0x16')](respondWithResult(_0x172948,null))[_0xd1e5('0x1f')](handleError(_0x172948,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 11c1e9b..d48d60c 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 _0x8e0f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4ab7bb,_0x290191){var _0x2624b3=function(_0x2852f2){while(--_0x2852f2){_0x4ab7bb['push'](_0x4ab7bb['shift']());}};_0x2624b3(++_0x290191);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x5741a3,_0x1258f3){_0x5741a3=_0x5741a3-0x0;var _0x4db4a0=_0x8e0f[_0x5741a3];return _0x4db4a0;};'use strict';var EventEmitter=require(_0xf8e0('0x0'));var ChatWebsite=require(_0xf8e0('0x1'))['db'][_0xf8e0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf8e0('0x3')](0x0);var events={'afterCreate':_0xf8e0('0x4'),'afterUpdate':_0xf8e0('0x5'),'afterDestroy':_0xf8e0('0x6')};function emitEvent(_0x5e954c){return function(_0x40d121,_0x4a6acb,_0xa0826a){ChatWebsiteEvents[_0xf8e0('0x7')](_0x5e954c+':'+_0x40d121['id'],_0x40d121);ChatWebsiteEvents['emit'](_0x5e954c,_0x40d121);_0xa0826a(null);};}for(var e in events){if(events[_0xf8e0('0x8')](e)){var event=events[e];ChatWebsite[_0xf8e0('0x9')](e,emitEvent(event));}}module[_0xf8e0('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x61df=['emit','hasOwnProperty','hook','setMaxListeners','save','remove'];(function(_0x302e63,_0x2ae115){var _0x57eda1=function(_0x24c3a4){while(--_0x24c3a4){_0x302e63['push'](_0x302e63['shift']());}};_0x57eda1(++_0x2ae115);}(_0x61df,0xbd));var _0xf61d=function(_0x23ebd2,_0x1ab958){_0x23ebd2=_0x23ebd2-0x0;var _0x186752=_0x61df[_0x23ebd2];return _0x186752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf61d('0x0')](0x0);var events={'afterCreate':_0xf61d('0x1'),'afterUpdate':'update','afterDestroy':_0xf61d('0x2')};function emitEvent(_0x380f27){return function(_0x485a55,_0x3170e7,_0x153a3c){ChatWebsiteEvents[_0xf61d('0x3')](_0x380f27+':'+_0x485a55['id'],_0x485a55);ChatWebsiteEvents[_0xf61d('0x3')](_0x380f27,_0x485a55);_0x153a3c(null);};}for(var e in events){if(events[_0xf61d('0x4')](e)){var event=events[e];ChatWebsite[_0xf61d('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 26b2253..df64daf 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 _0x440b=['define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x9f033e,_0xa9c326){var _0x467993=function(_0x42f7cb){while(--_0x42f7cb){_0x9f033e['push'](_0x9f033e['shift']());}};_0x467993(++_0xa9c326);}(_0x440b,0x18b));var _0xb440=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0x440b[_0x1e2c73];return _0x46f8d5;};'use strict';var _=require(_0xb440('0x0'));var util=require(_0xb440('0x1'));var logger=require(_0xb440('0x2'))(_0xb440('0x3'));var moment=require(_0xb440('0x4'));var BPromise=require(_0xb440('0x5'));var rp=require(_0xb440('0x6'));var fs=require('fs');var path=require(_0xb440('0x7'));var rimraf=require(_0xb440('0x8'));var config=require(_0xb440('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xb440('0xa')]=function(_0x2d856d,_0x16f9d3){return _0x2d856d[_0xb440('0xb')](_0xb440('0xc'),attributes,{'tableName':_0xb440('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefc3=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','bluebird'];(function(_0x1dfee3,_0x585b79){var _0x37eb5a=function(_0x2e0628){while(--_0x2e0628){_0x1dfee3['push'](_0x1dfee3['shift']());}};_0x37eb5a(++_0x585b79);}(_0xefc3,0x171));var _0x3efc=function(_0x5075f8,_0x421862){_0x5075f8=_0x5075f8-0x0;var _0x78db03=_0xefc3[_0x5075f8];return _0x78db03;};'use strict';var _=require(_0x3efc('0x0'));var util=require(_0x3efc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3efc('0x2'));var rp=require(_0x3efc('0x3'));var fs=require('fs');var path=require(_0x3efc('0x4'));var rimraf=require(_0x3efc('0x5'));var config=require(_0x3efc('0x6'));var attributes=require(_0x3efc('0x7'));module[_0x3efc('0x8')]=function(_0x42028a,_0x2bf6f6){return _0x42028a[_0x3efc('0x9')](_0x3efc('0xa'),attributes,{'tableName':_0x3efc('0xb'),'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 0104292..3a1150a 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 _0xfc57=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x3f591e,_0xe02469){var _0x41d0c6=function(_0x112622){while(--_0x112622){_0x3f591e['push'](_0x3f591e['shift']());}};_0x41d0c6(++_0xe02469);}(_0xfc57,0xe2));var _0x7fc5=function(_0x22a648,_0x5e884e){_0x22a648=_0x22a648-0x0;var _0x4c0b91=_0xfc57[_0x22a648];return _0x4c0b91;};'use strict';var _=require('lodash');var util=require(_0x7fc5('0x0'));var moment=require(_0x7fc5('0x1'));var BPromise=require(_0x7fc5('0x2'));var rs=require(_0x7fc5('0x3'));var fs=require('fs');var Redis=require(_0x7fc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fc5('0x5'));var logger=require(_0x7fc5('0x6'))(_0x7fc5('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fc5('0x8'));var client=jayson[_0x7fc5('0x9')][_0x7fc5('0xa')]({'port':0x232a});config[_0x7fc5('0xb')]=_[_0x7fc5('0xc')](config[_0x7fc5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7fc5('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7fc5('0xe')](socket);function respondWithRpcPromise(_0xf3d595,_0x11b01b,_0x498d63){return new BPromise(function(_0x6e5da0,_0x305b6c){return client[_0x7fc5('0xf')](_0xf3d595,_0x498d63)[_0x7fc5('0x10')](function(_0x12dbb5){logger[_0x7fc5('0x11')](_0x7fc5('0x12'),_0x11b01b,_0x7fc5('0x13'));logger[_0x7fc5('0x14')](_0x7fc5('0x15'),_0x11b01b,_0x7fc5('0x13'),JSON[_0x7fc5('0x16')](_0x12dbb5));if(_0x12dbb5['error']){if(_0x12dbb5['error'][_0x7fc5('0x17')]===0x1f4){logger['error'](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')]['message']);return _0x305b6c(_0x12dbb5[_0x7fc5('0x18')]['message']);}logger[_0x7fc5('0x18')](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);return _0x6e5da0(_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x7fc5('0x13'));_0x6e5da0(_0x12dbb5[_0x7fc5('0x1a')][_0x7fc5('0x19')]);}})['catch'](function(_0x10ac83){logger[_0x7fc5('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x10ac83);_0x305b6c(_0x10ac83);});});} \ No newline at end of file +var _0xd99a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x3d4052,_0x502cfb){var _0x45dcd2=function(_0x1d948e){while(--_0x1d948e){_0x3d4052['push'](_0x3d4052['shift']());}};_0x45dcd2(++_0x502cfb);}(_0xd99a,0xdc));var _0xad99=function(_0x399ec8,_0xae6c1b){_0x399ec8=_0x399ec8-0x0;var _0xbd731c=_0xd99a[_0x399ec8];return _0xbd731c;};'use strict';var _=require(_0xad99('0x0'));var util=require(_0xad99('0x1'));var moment=require(_0xad99('0x2'));var BPromise=require(_0xad99('0x3'));var rs=require(_0xad99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad99('0x5'))['db'];var utils=require(_0xad99('0x6'));var logger=require(_0xad99('0x7'))('rpc');var config=require(_0xad99('0x8'));var jayson=require(_0xad99('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xad99('0xa')]=_[_0xad99('0xb')](config[_0xad99('0xa')],{'host':_0xad99('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad99('0xa')]));require(_0xad99('0xd'))[_0xad99('0xe')](socket);function respondWithRpcPromise(_0x56775f,_0x1439c5,_0x4718b7){return new BPromise(function(_0x1a2f21,_0x23bf63){return client['request'](_0x56775f,_0x4718b7)['then'](function(_0x45100a){logger['info'](_0xad99('0xf'),_0x1439c5,'request\x20sent');logger[_0xad99('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1439c5,_0xad99('0x11'),JSON[_0xad99('0x12')](_0x45100a));if(_0x45100a['error']){if(_0x45100a[_0xad99('0x13')][_0xad99('0x14')]===0x1f4){logger[_0xad99('0x13')](_0xad99('0xf'),_0x1439c5,_0x45100a[_0xad99('0x13')][_0xad99('0x15')]);return _0x23bf63(_0x45100a[_0xad99('0x13')][_0xad99('0x15')]);}logger[_0xad99('0x13')](_0xad99('0xf'),_0x1439c5,_0x45100a[_0xad99('0x13')]['message']);return _0x1a2f21(_0x45100a['error'][_0xad99('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1439c5,_0xad99('0x11'));_0x1a2f21(_0x45100a[_0xad99('0x16')]['message']);}})[_0xad99('0x17')](function(_0x1455f2){logger[_0xad99('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1439c5,_0x1455f2);_0x23bf63(_0x1455f2);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index f129a41..b3141ae 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 _0x25b0=['save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x309381,_0x336fa7){var _0x11f429=function(_0x206cdf){while(--_0x206cdf){_0x309381['push'](_0x309381['shift']());}};_0x11f429(++_0x336fa7);}(_0x25b0,0x170));var _0x025b=function(_0x22e056,_0x2cc7bd){_0x22e056=_0x22e056-0x0;var _0x20d872=_0x25b0[_0x22e056];return _0x20d872;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x025b('0x0'),_0x025b('0x1'),_0x025b('0x2')];function createListener(_0x3be0a0,_0x2fd3fb){return function(_0x4b270f){_0x2fd3fb[_0x025b('0x3')](_0x3be0a0,_0x4b270f);};}function removeListener(_0x2c6c59,_0x438af9){return function(){ChatWebsiteEvents[_0x025b('0x4')](_0x2c6c59,_0x438af9);};}exports[_0x025b('0x5')]=function(_0x2af29a){for(var _0x1da0fb=0x0,_0x4d6eef=events[_0x025b('0x6')];_0x1da0fb<_0x4d6eef;_0x1da0fb++){var _0x4b3877=events[_0x1da0fb];var _0x5bd27f=createListener(_0x025b('0x7')+_0x4b3877,_0x2af29a);ChatWebsiteEvents['on'](_0x4b3877,_0x5bd27f);}}; \ No newline at end of file +var _0xd890=['register','length','./chatWebsite.events','save','emit','removeListener'];(function(_0x302dd0,_0x46d210){var _0x3cb00f=function(_0x44f775){while(--_0x44f775){_0x302dd0['push'](_0x302dd0['shift']());}};_0x3cb00f(++_0x46d210);}(_0xd890,0x1ac));var _0x0d89=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xd890[_0x2dbce7];return _0x3a3ed0;};'use strict';var ChatWebsiteEvents=require(_0x0d89('0x0'));var events=[_0x0d89('0x1'),'remove','update'];function createListener(_0x42bf76,_0x1fcd6e){return function(_0x344d6f){_0x1fcd6e[_0x0d89('0x2')](_0x42bf76,_0x344d6f);};}function removeListener(_0xd2e389,_0x37f27d){return function(){ChatWebsiteEvents[_0x0d89('0x3')](_0xd2e389,_0x37f27d);};}exports[_0x0d89('0x4')]=function(_0x2ea564){for(var _0xbe8a2d=0x0,_0x25ce65=events[_0x0d89('0x5')];_0xbe8a2d<_0x25ce65;_0xbe8a2d++){var _0x19a9d7=events[_0xbe8a2d];var _0x443ca5=createListener('chatWebsite:'+_0x19a9d7,_0x2ea564);ChatWebsiteEvents['on'](_0x19a9d7,_0x443ca5);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index b7c94e9..b18f497 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 _0x40e8=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addAnswer','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','diskStorage','now','addAvatar','server/files/images/avatars/','%s-%s','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x40e8,0x74));var _0x840e=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x40e8[_0x4067ac];return _0x53d74d;};'use strict';var multer=require(_0x840e('0x0'));var util=require('util');var path=require(_0x840e('0x1'));var timeout=require(_0x840e('0x2'));var express=require(_0x840e('0x3'));var router=express[_0x840e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x840e('0x5'));var interaction=require(_0x840e('0x6'));var config=require(_0x840e('0x7'));var controller=require('./chatWebsite.controller');router[_0x840e('0x8')]('/',auth[_0x840e('0x9')](),controller[_0x840e('0xa')]);router[_0x840e('0x8')]('/describe',auth[_0x840e('0x9')](),controller[_0x840e('0xb')]);router[_0x840e('0x8')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0xd')]);router['get'](_0x840e('0xe'),auth[_0x840e('0x9')](),controller[_0x840e('0xf')]);router['get'](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x11')]);router[_0x840e('0x8')](_0x840e('0x12'),controller['getLogo']);router['get'](_0x840e('0x13'),controller[_0x840e('0x14')]);router[_0x840e('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x840e('0x8')](_0x840e('0x15'),controller['getSystemAvatar']);router[_0x840e('0x8')](_0x840e('0x16'),auth[_0x840e('0x9')](),controller[_0x840e('0x17')]);router[_0x840e('0x8')](_0x840e('0x18'),controller[_0x840e('0x19')]);router[_0x840e('0x8')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x1b')]);router['get'](_0x840e('0x1c'),auth[_0x840e('0x9')](),controller[_0x840e('0x1d')]);router[_0x840e('0x8')](_0x840e('0x1e'),controller[_0x840e('0x1f')]);router[_0x840e('0x8')](_0x840e('0x20'),auth['isAuthenticated'](),controller[_0x840e('0x21')]);router[_0x840e('0x8')](_0x840e('0x22'),auth['isAuthenticated'](),controller[_0x840e('0x23')]);router['post']('/',auth[_0x840e('0x9')](),controller[_0x840e('0x24')]);router[_0x840e('0x25')]('/:id/dispositions',auth[_0x840e('0x9')](),controller['addDisposition']);router[_0x840e('0x25')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159950,_0x342627,_0x1ea2e0){_0x1ea2e0(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x29')));},'filename':function(_0x1c7b75,_0x1f5b1f,_0x2fc83e){_0x2fc83e(null,util[_0x840e('0x2a')]('%s-%s',Date['now'](),_0x1f5b1f[_0x840e('0x2b')]));}})});router['post']('/:id/logo',upload[_0x840e('0x2c')](_0x840e('0x2d')),controller[_0x840e('0x2e')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x590d2d,_0x3daf29,_0x54005a){_0x54005a(null,path[_0x840e('0x27')](config[_0x840e('0x28')],'server/files/images/avatars/'));},'filename':function(_0x45968a,_0x3f48f9,_0xbf6eb1){_0xbf6eb1(null,util[_0x840e('0x2a')]('%s-%s',Date[_0x840e('0x30')](),_0x3f48f9['originalname']));}})});router[_0x840e('0x25')]('/:id/avatar',upload['single'](_0x840e('0x2d')),controller[_0x840e('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25d594,_0x1203c5,_0x587b65){_0x587b65(null,path['join'](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x2f94d2,_0x3dee4a,_0x333f2d){_0x333f2d(null,util['format'](_0x840e('0x33'),Date[_0x840e('0x30')](),_0x3dee4a[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x34'),upload['single'](_0x840e('0x2d')),controller[_0x840e('0x35')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x269015,_0x5a8d81,_0x28fddd){_0x28fddd(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x432350,_0x3e5608,_0x4412bb){_0x4412bb(null,util['format']('%s-%s',Date[_0x840e('0x30')](),_0x3e5608[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x15'),upload['single']('file'),controller[_0x840e('0x36')]);router[_0x840e('0x25')]('/:id/notify',controller[_0x840e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x1e6af7,_0x341d02,_0x49b338){const _0x5bad33=path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x38'),_0x840e('0x39'),'offline-chat');fs_extra[_0x840e('0x3a')](_0x5bad33,function(){_0x49b338(null,_0x5bad33);});},'filename':function(_0x22878f,_0x31e91d,_0x3cbc98){const _0xe1136c=_0x31e91d[_0x840e('0x2b')][_0x840e('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xb08292=path['extname'](_0xe1136c);const _0x193c9c=Date[_0x840e('0x30')]()+'-'+_0xe1136c[_0x840e('0x3b')](_0xb08292,'')+_0xb08292;_0x3cbc98(null,_0x193c9c);}})});router[_0x840e('0x25')](_0x840e('0x3c'),offlineUploadMulter[_0x840e('0x3d')](),controller[_0x840e('0x3e')]);router[_0x840e('0x25')](_0x840e('0x16'),auth['isAuthenticated'](),controller[_0x840e('0x3f')]);router[_0x840e('0x25')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x40')]);router['post']('/:id/proactive_actions',auth[_0x840e('0x9')](),controller[_0x840e('0x41')]);router[_0x840e('0x25')]('/:id/users',auth[_0x840e('0x9')](),controller[_0x840e('0x42')]);router[_0x840e('0x43')](_0x840e('0xc'),auth[_0x840e('0x9')](),controller[_0x840e('0x44')]);router[_0x840e('0x45')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0x46')]);router[_0x840e('0x45')]('/:id/dispositions',auth[_0x840e('0x9')](),controller[_0x840e('0x47')]);router[_0x840e('0x45')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x48')]);router[_0x840e('0x45')](_0x840e('0x22'),auth[_0x840e('0x9')](),controller[_0x840e('0x49')]);module['exports']=router; \ No newline at end of file +var _0xd178=['notify','server/files','offline-chat','extname','replace','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','multer','path','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd178,0xd8));var _0x8d17=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd178[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x8d17('0x0'));var util=require('util');var path=require(_0x8d17('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d17('0x2')]();var fs_extra=require(_0x8d17('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d17('0x4'));var controller=require(_0x8d17('0x5'));router[_0x8d17('0x6')]('/',auth[_0x8d17('0x7')](),controller[_0x8d17('0x8')]);router[_0x8d17('0x6')](_0x8d17('0x9'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xa')]);router[_0x8d17('0x6')](_0x8d17('0xb'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xc')]);router[_0x8d17('0x6')]('/:id/dispositions',auth[_0x8d17('0x7')](),controller[_0x8d17('0xd')]);router[_0x8d17('0x6')](_0x8d17('0xe'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xf')]);router[_0x8d17('0x6')]('/:id/logo',controller[_0x8d17('0x10')]);router['get']('/:id/avatar',controller[_0x8d17('0x11')]);router[_0x8d17('0x6')](_0x8d17('0x12'),controller[_0x8d17('0x13')]);router[_0x8d17('0x6')]('/:id/system_avatar',controller[_0x8d17('0x14')]);router[_0x8d17('0x6')]('/:id/interactions',auth[_0x8d17('0x7')](),controller['getInteractions']);router[_0x8d17('0x6')](_0x8d17('0x15'),controller['getSnippet']);router['get'](_0x8d17('0x16'),auth['isAuthenticated'](),controller[_0x8d17('0x17')]);router[_0x8d17('0x6')](_0x8d17('0x18'),auth['isAuthenticated'](),controller[_0x8d17('0x19')]);router[_0x8d17('0x6')](_0x8d17('0x1a'),controller[_0x8d17('0x1b')]);router['get'](_0x8d17('0x1c'),auth[_0x8d17('0x7')](),controller['getOfflineMessages']);router[_0x8d17('0x6')](_0x8d17('0x1d'),auth['isAuthenticated'](),controller[_0x8d17('0x1e')]);router[_0x8d17('0x1f')]('/',auth[_0x8d17('0x7')](),controller[_0x8d17('0x20')]);router[_0x8d17('0x1f')](_0x8d17('0x21'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x22')]);router['post']('/:id/canned_answers',auth[_0x8d17('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x8d17('0x23')]({'destination':function(_0xe68622,_0x5353cf,_0x2205d7){_0x2205d7(null,path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x26')));},'filename':function(_0x144c8b,_0x3cb8d9,_0x5d2420){_0x5d2420(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date[_0x8d17('0x29')](),_0x3cb8d9[_0x8d17('0x2a')]));}})});router['post'](_0x8d17('0x2b'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x323a33,_0x2959b1,_0x1699c1){_0x1699c1(null,path[_0x8d17('0x24')](config['root'],_0x8d17('0x2e')));},'filename':function(_0x59b7a1,_0x2b30a3,_0x57f03b){_0x57f03b(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x2b30a3[_0x8d17('0x2a')]));}})});router[_0x8d17('0x1f')](_0x8d17('0x2f'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f5ec9,_0x16a15f,_0x3d96a0){_0x3d96a0(null,path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x2e')));},'filename':function(_0x260625,_0x4c8ee2,_0x30296f){_0x30296f(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x4c8ee2['originalname']));}})});router[_0x8d17('0x1f')]('/:id/customer_avatar',upload[_0x8d17('0x2c')]('file'),controller[_0x8d17('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c4a1c,_0x460173,_0x2e4c8a){_0x2e4c8a(null,path[_0x8d17('0x24')](config['root'],_0x8d17('0x2e')));},'filename':function(_0x58e745,_0x18ea69,_0x59e605){_0x59e605(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x18ea69['originalname']));}})});router[_0x8d17('0x1f')](_0x8d17('0x31'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller[_0x8d17('0x32')]);router[_0x8d17('0x1f')](_0x8d17('0x33'),controller[_0x8d17('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x8d17('0x23')]({'destination':function(_0x1c542d,_0x44215c,_0x1d1552){const _0x5de3e9=path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x35'),'attachments',_0x8d17('0x36'));fs_extra['ensureDir'](_0x5de3e9,function(){_0x1d1552(null,_0x5de3e9);});},'filename':function(_0x14542e,_0x453053,_0x5e1ded){const _0x57fdb8=_0x453053[_0x8d17('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x210c0f=path[_0x8d17('0x37')](_0x57fdb8);const _0x38413f=Date[_0x8d17('0x29')]()+'-'+_0x57fdb8[_0x8d17('0x38')](_0x210c0f,'')+_0x210c0f;_0x5e1ded(null,_0x38413f);}})});router[_0x8d17('0x1f')](_0x8d17('0x39'),offlineUploadMulter['any'](),controller[_0x8d17('0x3a')]);router['post'](_0x8d17('0x3b'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3c')]);router[_0x8d17('0x1f')](_0x8d17('0x16'),auth[_0x8d17('0x7')](),controller['addApplications']);router[_0x8d17('0x1f')](_0x8d17('0x18'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3d')]);router[_0x8d17('0x1f')](_0x8d17('0x1d'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3e')]);router['put'](_0x8d17('0xb'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3f')]);router[_0x8d17('0x40')](_0x8d17('0xb'),auth['isAuthenticated'](),controller[_0x8d17('0x41')]);router[_0x8d17('0x40')](_0x8d17('0x21'),auth['isAuthenticated'](),controller[_0x8d17('0x42')]);router[_0x8d17('0x40')](_0x8d17('0xe'),auth[_0x8d17('0x7')](),controller['removeAnswers']);router[_0x8d17('0x40')](_0x8d17('0x1d'),auth[_0x8d17('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index c934aec..f2d0070 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e8=['use','isAuthenticated','../config/environment','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e8,0xe9));var _0x855e=function(_0x50849b,_0x4fe986){_0x50849b=_0x50849b-0x0;var _0x3c5f2a=_0x55e8[_0x50849b];return _0x3c5f2a;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x855e('0x0'));var router=express[_0x855e('0x1')]();var isProduction=config[_0x855e('0x2')]===_0x855e('0x3')||![];function clientSideLogs(_0x107649,_0x3e8802,_0x4d590f){var _0x4687e9=_0x107649[_0x855e('0x4')]['get'](_0x855e('0x5'));if(!_0x4687e9){throw new Error(_0x855e('0x6'));}return beaverLogger[_0x855e('0x7')]({'uri':_0x855e('0x8'),'logger':_0x4687e9,'enableCors':!isProduction})(_0x107649,_0x3e8802,_0x4d590f);}router[_0x855e('0x9')](auth[_0x855e('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xa2ef=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','Router','env','production','app'];(function(_0x1ba256,_0x4d67c1){var _0x3254b0=function(_0x3e8588){while(--_0x3e8588){_0x1ba256['push'](_0x1ba256['shift']());}};_0x3254b0(++_0x4d67c1);}(_0xa2ef,0x13f));var _0xfa2e=function(_0x23089d,_0x1ac088){_0x23089d=_0x23089d-0x0;var _0x5a0868=_0xa2ef[_0x23089d];return _0x5a0868;};var beaverLogger=require('beaver-logger/server');var express=require(_0xfa2e('0x0'));var auth=require(_0xfa2e('0x1'));var config=require('../config/environment');var router=express[_0xfa2e('0x2')]();var isProduction=config[_0xfa2e('0x3')]===_0xfa2e('0x4')||![];function clientSideLogs(_0x450d35,_0x5e989c,_0x1dcc49){var _0x26f05c=_0x450d35[_0xfa2e('0x5')][_0xfa2e('0x6')](_0xfa2e('0x7'));if(!_0x26f05c){throw new Error(_0xfa2e('0x8'));}return beaverLogger[_0xfa2e('0x9')]({'uri':_0xfa2e('0xa'),'logger':_0x26f05c,'enableCors':!isProduction})(_0x450d35,_0x5e989c,_0x1dcc49);}router['use'](auth[_0xfa2e('0xb')](),clientSideLogs);module[_0xfa2e('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 02fdab3..92ebf7d 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 _0x54b2=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0xd911fc,_0x34372f){var _0x531b21=function(_0x23efca){while(--_0x23efca){_0xd911fc['push'](_0xd911fc['shift']());}};_0x531b21(++_0x34372f);}(_0x54b2,0xa6));var _0x254b=function(_0x4add46,_0x40c151){_0x4add46=_0x4add46-0x0;var _0x13fe3d=_0x54b2[_0x4add46];return _0x13fe3d;};'use strict';var Sequelize=require(_0x254b('0x0'));module[_0x254b('0x1')]={'name':{'type':Sequelize[_0x254b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x254b('0x3')](_0x254b('0x4'),_0x254b('0x5'),_0x254b('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x254b('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x9')},'data4':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0xa')},'data5':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xd')}}; \ No newline at end of file +var _0xa6fa=['exports','STRING','AmazonAWS','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x1f5b9e,_0x4331e6){var _0x5947b0=function(_0x398b18){while(--_0x398b18){_0x1f5b9e['push'](_0x1f5b9e['shift']());}};_0x5947b0(++_0x4331e6);}(_0xa6fa,0x81));var _0xaa6f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6fa[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xaa6f('0x0'));module[_0xaa6f('0x1')]={'name':{'type':Sequelize[_0xaa6f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xaa6f('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xaa6f('0x4')]('Outlook365',_0xaa6f('0x5'))},'data1':{'type':Sequelize[_0xaa6f('0x2')],'comment':_0xaa6f('0x6')},'data2':{'type':Sequelize[_0xaa6f('0x2')],'comment':_0xaa6f('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xaa6f('0x8')},'data4':{'type':Sequelize[_0xaa6f('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xa')},'data6':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xb')},'data7':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 5a87b87..e91b52c 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 _0x91f3=['filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','find','create','Service\x20parameter\x20not\x20specified','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','update','destroy','then','error','stack','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x91f3,0x13c));var _0x391f=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x91f3[_0x598efc];return _0x435e4f;};'use strict';var _=require(_0x391f('0x0'));var Redis=require(_0x391f('0x1'));var qs=require(_0x391f('0x2'));var encryptor=require(_0x391f('0x3'));var config=require(_0x391f('0x4'));var logger=require(_0x391f('0x5'))('api');var db=require(_0x391f('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x391f('0x7')]=_['defaults'](config[_0x391f('0x7')],{'host':_0x391f('0x8'),'port':0x18eb});var socket=require(_0x391f('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x391f('0x7')]);function respondWithStatusCode(_0x20f60e,_0x32b3bc){_0x32b3bc=_0x32b3bc||0xcc;return function(_0xc568d8){if(_0xc568d8){return _0x20f60e[_0x391f('0xa')](_0x32b3bc);}return _0x20f60e[_0x391f('0xb')](_0x32b3bc)[_0x391f('0xc')]();};}function respondWithResult(_0x3871dd,_0x51bd71){_0x51bd71=_0x51bd71||0xc8;return function(_0x56b8db){if(_0x56b8db){return _0x3871dd['status'](_0x51bd71)['json'](_0x56b8db);}};}function respondWithFilteredResult(_0x59c2e1,_0x479452){return function(_0x57ab95){if(_0x57ab95){var _0x20d0db=typeof _0x479452[_0x391f('0xd')]==='undefined'&&typeof _0x479452[_0x391f('0xe')]==='undefined';var _0x1c93d3=_0x57ab95[_0x391f('0xf')];var _0x673393=_0x20d0db?0x0:_0x479452[_0x391f('0xd')];var _0x30589a=_0x20d0db?_0x57ab95[_0x391f('0xf')]:_0x479452['offset']+_0x479452[_0x391f('0xe')];var _0x1a8891;if(_0x30589a>=_0x1c93d3){_0x30589a=_0x1c93d3;_0x1a8891=0xc8;}else{_0x1a8891=0xce;}_0x59c2e1[_0x391f('0xb')](_0x1a8891);return _0x59c2e1[_0x391f('0x10')](_0x391f('0x11'),_0x673393+'-'+_0x30589a+'/'+_0x1c93d3)[_0x391f('0x12')](_0x57ab95);}return null;};}function saveUpdates(_0x4d17f3){return function(_0xaa9a80){if(_0xaa9a80){return _0xaa9a80[_0x391f('0x13')](_0x4d17f3)['then'](function(_0xe45580){return _0xe45580;});}return null;};}function removeEntity(_0x788a3){return function(_0x19f5aa){if(_0x19f5aa){return _0x19f5aa[_0x391f('0x14')]()[_0x391f('0x15')](function(){_0x788a3[_0x391f('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c522){return function(_0x5322f0){if(!_0x5322f0){_0x40c522[_0x391f('0xa')](0x194);}return _0x5322f0;};}function handleError(_0x3ddd2b,_0x5e0d95){_0x5e0d95=_0x5e0d95||0x1f4;return function(_0xb3a4c9){logger[_0x391f('0x16')](_0xb3a4c9[_0x391f('0x17')]);if(_0xb3a4c9['name']){delete _0xb3a4c9['name'];}_0x3ddd2b[_0x391f('0xb')](_0x5e0d95)[_0x391f('0x18')](_0xb3a4c9);};}function maskClientSecret(_0x428f32){return _['padEnd'](_0x428f32['slice'](0x0,0x3),0x14,'*');}exports[_0x391f('0x19')]=function(_0x5d179b,_0x57e96a){var _0x565699={},_0xfcadec={},_0xc6622e={'count':0x0,'rows':[]};var _0x713a07=_[_0x391f('0x1a')](db[_0x391f('0x1b')][_0x391f('0x1c')],function(_0x1f87c9){return{'name':_0x1f87c9[_0x391f('0x1d')],'type':_0x1f87c9[_0x391f('0x1e')][_0x391f('0x1f')]};});_0xfcadec[_0x391f('0x20')]=_[_0x391f('0x1a')](_0x713a07,_0x391f('0x21'));_0xfcadec[_0x391f('0x22')]=_[_0x391f('0x23')](_0x5d179b[_0x391f('0x22')]);_0xfcadec[_0x391f('0x24')]=_[_0x391f('0x25')](_0xfcadec['model'],_0xfcadec[_0x391f('0x22')]);_0x565699[_0x391f('0x26')]=_[_0x391f('0x25')](_0xfcadec[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5d179b[_0x391f('0x22')][_0x391f('0x27')]));_0x565699[_0x391f('0x26')]=_0x565699[_0x391f('0x26')][_0x391f('0x28')]?_0x565699[_0x391f('0x26')]:_0xfcadec['model'];if(!_0x5d179b['query']['hasOwnProperty'](_0x391f('0x29'))){_0x565699[_0x391f('0xe')]=qs[_0x391f('0xe')](_0x5d179b['query'][_0x391f('0xe')]);_0x565699[_0x391f('0xd')]=qs[_0x391f('0xd')](_0x5d179b[_0x391f('0x22')]['offset']);}_0x565699[_0x391f('0x2a')]=qs[_0x391f('0x2b')](_0x5d179b[_0x391f('0x22')][_0x391f('0x2b')]);_0x565699['where']=qs[_0x391f('0x24')](_['pick'](_0x5d179b[_0x391f('0x22')],_0xfcadec[_0x391f('0x24')]),_0x713a07);if(_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]){_0x565699['where']=_[_0x391f('0x2d')](_0x565699['where'],{'$or':_[_0x391f('0x1a')](_0x713a07,function(_0x50721a){if(_0x50721a['type']!==_0x391f('0x2e')){var _0x44295f={};_0x44295f[_0x50721a['name']]={'$like':'%'+_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]+'%'};return _0x44295f;}})});}_0x565699=_[_0x391f('0x2d')]({},_0x565699,_0x5d179b[_0x391f('0x2f')]);var _0x591564={'where':_0x565699[_0x391f('0x30')]};return db[_0x391f('0x1b')][_0x391f('0xf')](_0x591564)['then'](function(_0x4ed686){_0xc6622e[_0x391f('0xf')]=_0x4ed686;if(_0x5d179b[_0x391f('0x22')][_0x391f('0x31')]){_0x565699['include']=[{'all':!![]}];}return db[_0x391f('0x1b')][_0x391f('0x32')](_0x565699);})[_0x391f('0x15')](function(_0x2cd325){_0xc6622e[_0x391f('0x33')]=_[_0x391f('0x1a')](_0x2cd325,function(_0x449ba9){if(_0x449ba9[_0x391f('0x34')]===_0x391f('0x35')){var _0x2a75d1=encryptor[_0x391f('0x36')](_0x449ba9['data3']);_0x449ba9[_0x391f('0x37')]=maskClientSecret(_0x2a75d1);}return _0x449ba9;});return _0xc6622e;})[_0x391f('0x15')](respondWithFilteredResult(_0x57e96a,_0x565699))['catch'](handleError(_0x57e96a,null));};exports[_0x391f('0x38')]=function(_0x5c883e,_0x5cd244){var _0x43a6f9={'raw':!![],'where':{'id':_0x5c883e[_0x391f('0x39')]['id']}},_0x553006={};_0x553006[_0x391f('0x20')]=_[_0x391f('0x23')](db[_0x391f('0x1b')][_0x391f('0x1c')]);_0x553006['query']=_[_0x391f('0x23')](_0x5c883e[_0x391f('0x22')]);_0x553006[_0x391f('0x24')]=_['intersection'](_0x553006['model'],_0x553006[_0x391f('0x22')]);_0x43a6f9[_0x391f('0x26')]=_[_0x391f('0x25')](_0x553006[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5c883e[_0x391f('0x22')][_0x391f('0x27')]));_0x43a6f9['attributes']=_0x43a6f9['attributes'][_0x391f('0x28')]?_0x43a6f9[_0x391f('0x26')]:_0x553006[_0x391f('0x20')];if(_0x5c883e[_0x391f('0x22')]['includeAll']){_0x43a6f9['include']=[{'all':!![]}];}_0x43a6f9=_[_0x391f('0x2d')]({},_0x43a6f9,_0x5c883e['options']);return db[_0x391f('0x1b')][_0x391f('0x3a')](_0x43a6f9)[_0x391f('0x15')](handleEntityNotFound(_0x5cd244,null))[_0x391f('0x15')](function(_0x1f9ae4){if(_0x1f9ae4[_0x391f('0x34')]===_0x391f('0x35')){var _0x20c4d3=encryptor[_0x391f('0x36')](_0x1f9ae4[_0x391f('0x37')]);_0x1f9ae4[_0x391f('0x37')]=maskClientSecret(_0x20c4d3);}return _0x1f9ae4;})[_0x391f('0x15')](respondWithResult(_0x5cd244,null))['catch'](handleError(_0x5cd244,null));};exports[_0x391f('0x3b')]=function(_0x352d2c,_0x541ba3){if(!_0x352d2c['body'][_0x391f('0x21')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x352d2c['body'][_0x391f('0x34')])throw new Error(_0x391f('0x3c'));var _0xeff2ec=db[_0x391f('0x1b')]['rawAttributes'][_0x391f('0x34')]['values'];if(!_0xeff2ec['includes'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]))throw new Error(_0x391f('0x3e')+_0xeff2ec[_0x391f('0x3f')](',\x20'));if(_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]===_0x391f('0x35')&&_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]){_0x352d2c['body'][_0x391f('0x37')]=encryptor['encryptString'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]);}return db[_0x391f('0x1b')][_0x391f('0x3b')](_0x352d2c[_0x391f('0x3d')],{})[_0x391f('0x15')](respondWithResult(_0x541ba3,0xc9))[_0x391f('0x40')](handleError(_0x541ba3,null));};exports[_0x391f('0x13')]=function(_0x1d7bc4,_0x19b9cd){if(_0x1d7bc4[_0x391f('0x3d')]['id']){delete _0x1d7bc4['body']['id'];}return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x1d7bc4['params']['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x19b9cd,null))[_0x391f('0x15')](function(_0x255775){if(_0x255775[_0x391f('0x34')]===_0x391f('0x35')&&_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]){_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]=encryptor[_0x391f('0x41')](_0x1d7bc4[_0x391f('0x3d')]['data3']);}return _0x255775;})[_0x391f('0x15')](saveUpdates(_0x1d7bc4[_0x391f('0x3d')],null))[_0x391f('0x15')](respondWithResult(_0x19b9cd,null))[_0x391f('0x40')](handleError(_0x19b9cd,null));};exports[_0x391f('0x14')]=function(_0x3a345e,_0x51613c){return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x3a345e[_0x391f('0x39')]['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x51613c,null))[_0x391f('0x15')](removeEntity(_0x51613c,null))['catch'](handleError(_0x51613c,null));};exports[_0x391f('0x42')]=function(_0x55686e,_0x541bc5){return db['CloudProvider'][_0x391f('0x43')]({'where':{'id':_0x55686e[_0x391f('0x39')]['id']},'raw':!![]})[_0x391f('0x15')](function(_0x268bff){if(!_0x268bff)return _0x541bc5['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x268bff,_0x55686e[_0x391f('0x44')]['id'])};})['then'](respondWithResult(_0x541bc5,null))[_0x391f('0x40')](handleError(_0x541bc5,null));};exports[_0x391f('0x45')]=function(_0x2e0aba,_0x295c6f){var _0x3b6296=_0x2e0aba[_0x391f('0x3d')];var _0x35b4dd;var _0x592270;if(_0x3b6296['error'])throw _0x3b6296;redis[_0x391f('0x46')](_0x3b6296[_0x391f('0x47')])['then'](function(_0x1235af){if(!_0x1235af)throw new Error(_0x391f('0x48'));_0x35b4dd=JSON[_0x391f('0x49')](_0x1235af);var _0x3de730=Buffer[_0x391f('0x4a')](_0x3b6296[_0x391f('0x47')],'base64')[_0x391f('0x4b')](_0x391f('0x4c'));_0x592270=JSON['parse'](_0x3de730);if(!oauth['isValidIdToken'](_0x3b6296[_0x391f('0x4d')],_0x35b4dd['oauth2Claims']))throw new Error(_0x391f('0x4e'));redis['del'](_0x3b6296[_0x391f('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3b6296[_0x391f('0x4f')],_0x35b4dd);})['then'](function(_0x11341f){_0x35b4dd[_0x391f('0x50')]=_0x11341f[_0x391f('0x51')];_0x35b4dd[_0x391f('0x52')]=_0x11341f['refresh_token'];return db['CloudProvider'][_0x391f('0x13')]({'data5':_0x35b4dd[_0x391f('0x50')],'data6':_0x35b4dd[_0x391f('0x52')]},{'where':{'id':_0x35b4dd['id']}});})[_0x391f('0x15')](function(){oauth[_0x391f('0x53')](_0x35b4dd);socket[_0x391f('0x54')]('microsoftAuthorization:success',{'id':_0x592270['id']});return;})[_0x391f('0x15')](respondWithStatusCode(_0x295c6f,null))[_0x391f('0x40')](function(_0x3d65a7){if(_0x592270){socket['emit'](_0x391f('0x55'),{'id':_0x592270['id']});}if(!_0x35b4dd){logger[_0x391f('0x16')](_0x391f('0x56'),_0x3d65a7);return _0x295c6f['status'](0x1f4)['send'](_0x3d65a7[_0x391f('0x57')]);}logger[_0x391f('0x16')](_0x391f('0x58'),_0x35b4dd['id'],JSON[_0x391f('0x59')](_0x3d65a7));});}; \ No newline at end of file +var _0x54dc=['MicrosoftAzure','data3','find','decryptString','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','params','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','isValidIdToken','id_token','code','access_token','data6','refresh_token','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','service'];(function(_0x4654c6,_0x17c4a8){var _0x286118=function(_0x29df7e){while(--_0x29df7e){_0x4654c6['push'](_0x4654c6['shift']());}};_0x286118(++_0x17c4a8);}(_0x54dc,0x1e9));var _0xc54d=function(_0x4383e9,_0xa4b307){_0x4383e9=_0x4383e9-0x0;var _0x355405=_0x54dc[_0x4383e9];return _0x355405;};'use strict';var _=require('lodash');var Redis=require(_0xc54d('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc54d('0x1'));var config=require('../../config/environment');var logger=require(_0xc54d('0x2'))(_0xc54d('0x3'));var db=require(_0xc54d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xc54d('0x5')]=_[_0xc54d('0x6')](config[_0xc54d('0x5')],{'host':_0xc54d('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xc54d('0x5')]);function respondWithStatusCode(_0x4b2507,_0x47db3d){_0x47db3d=_0x47db3d||0xcc;return function(_0x19c3d3){if(_0x19c3d3){return _0x4b2507['sendStatus'](_0x47db3d);}return _0x4b2507[_0xc54d('0x8')](_0x47db3d)[_0xc54d('0x9')]();};}function respondWithResult(_0x53d0e1,_0x336ebf){_0x336ebf=_0x336ebf||0xc8;return function(_0xb0a71a){if(_0xb0a71a){return _0x53d0e1[_0xc54d('0x8')](_0x336ebf)[_0xc54d('0xa')](_0xb0a71a);}};}function respondWithFilteredResult(_0x184c0d,_0x1c73ea){return function(_0x1863b0){if(_0x1863b0){var _0x39c9c7=typeof _0x1c73ea[_0xc54d('0xb')]===_0xc54d('0xc')&&typeof _0x1c73ea[_0xc54d('0xd')]==='undefined';var _0x4a82c0=_0x1863b0['count'];var _0x502497=_0x39c9c7?0x0:_0x1c73ea[_0xc54d('0xb')];var _0x4e8946=_0x39c9c7?_0x1863b0[_0xc54d('0xe')]:_0x1c73ea[_0xc54d('0xb')]+_0x1c73ea[_0xc54d('0xd')];var _0x562729;if(_0x4e8946>=_0x4a82c0){_0x4e8946=_0x4a82c0;_0x562729=0xc8;}else{_0x562729=0xce;}_0x184c0d[_0xc54d('0x8')](_0x562729);return _0x184c0d[_0xc54d('0xf')](_0xc54d('0x10'),_0x502497+'-'+_0x4e8946+'/'+_0x4a82c0)[_0xc54d('0xa')](_0x1863b0);}return null;};}function saveUpdates(_0x4536b8){return function(_0x31c1ab){if(_0x31c1ab){return _0x31c1ab[_0xc54d('0x11')](_0x4536b8)[_0xc54d('0x12')](function(_0x13d596){return _0x13d596;});}return null;};}function removeEntity(_0x12148a){return function(_0x4d01ec){if(_0x4d01ec){return _0x4d01ec['destroy']()[_0xc54d('0x12')](function(){_0x12148a[_0xc54d('0x8')](0xcc)[_0xc54d('0x9')]();});}};}function handleEntityNotFound(_0x366128){return function(_0x41da05){if(!_0x41da05){_0x366128[_0xc54d('0x13')](0x194);}return _0x41da05;};}function handleError(_0x3f49bf,_0x494258){_0x494258=_0x494258||0x1f4;return function(_0x18b092){logger[_0xc54d('0x14')](_0x18b092[_0xc54d('0x15')]);if(_0x18b092[_0xc54d('0x16')]){delete _0x18b092['name'];}_0x3f49bf['status'](_0x494258)[_0xc54d('0x17')](_0x18b092);};}function maskClientSecret(_0x3c165d){return _[_0xc54d('0x18')](_0x3c165d[_0xc54d('0x19')](0x0,0x3),0x14,'*');}exports[_0xc54d('0x1a')]=function(_0x1a6320,_0x13d023){var _0x2478c5={},_0x1b680e={},_0x19ed7d={'count':0x0,'rows':[]};var _0x1ae93b=_[_0xc54d('0x1b')](db[_0xc54d('0x1c')]['rawAttributes'],function(_0x4f6529){return{'name':_0x4f6529['fieldName'],'type':_0x4f6529[_0xc54d('0x1d')][_0xc54d('0x1e')]};});_0x1b680e[_0xc54d('0x1f')]=_[_0xc54d('0x1b')](_0x1ae93b,_0xc54d('0x16'));_0x1b680e[_0xc54d('0x20')]=_[_0xc54d('0x21')](_0x1a6320['query']);_0x1b680e[_0xc54d('0x22')]=_[_0xc54d('0x23')](_0x1b680e['model'],_0x1b680e[_0xc54d('0x20')]);_0x2478c5[_0xc54d('0x24')]=_[_0xc54d('0x23')](_0x1b680e['model'],qs[_0xc54d('0x25')](_0x1a6320['query']['fields']));_0x2478c5[_0xc54d('0x24')]=_0x2478c5[_0xc54d('0x24')]['length']?_0x2478c5[_0xc54d('0x24')]:_0x1b680e['model'];if(!_0x1a6320[_0xc54d('0x20')][_0xc54d('0x26')]('nolimit')){_0x2478c5[_0xc54d('0xd')]=qs['limit'](_0x1a6320[_0xc54d('0x20')][_0xc54d('0xd')]);_0x2478c5[_0xc54d('0xb')]=qs[_0xc54d('0xb')](_0x1a6320['query'][_0xc54d('0xb')]);}_0x2478c5[_0xc54d('0x27')]=qs[_0xc54d('0x28')](_0x1a6320[_0xc54d('0x20')]['sort']);_0x2478c5[_0xc54d('0x29')]=qs[_0xc54d('0x22')](_[_0xc54d('0x2a')](_0x1a6320[_0xc54d('0x20')],_0x1b680e[_0xc54d('0x22')]),_0x1ae93b);if(_0x1a6320[_0xc54d('0x20')][_0xc54d('0x2b')]){_0x2478c5[_0xc54d('0x29')]=_[_0xc54d('0x2c')](_0x2478c5[_0xc54d('0x29')],{'$or':_['map'](_0x1ae93b,function(_0x5934b0){if(_0x5934b0[_0xc54d('0x1d')]!=='VIRTUAL'){var _0x1ac942={};_0x1ac942[_0x5934b0[_0xc54d('0x16')]]={'$like':'%'+_0x1a6320['query'][_0xc54d('0x2b')]+'%'};return _0x1ac942;}})});}_0x2478c5=_[_0xc54d('0x2c')]({},_0x2478c5,_0x1a6320[_0xc54d('0x2d')]);var _0xfa02ed={'where':_0x2478c5[_0xc54d('0x29')]};return db[_0xc54d('0x1c')][_0xc54d('0xe')](_0xfa02ed)[_0xc54d('0x12')](function(_0x3ec02a){_0x19ed7d[_0xc54d('0xe')]=_0x3ec02a;if(_0x1a6320[_0xc54d('0x20')][_0xc54d('0x2e')]){_0x2478c5[_0xc54d('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xc54d('0x30')](_0x2478c5);})['then'](function(_0x3c01d6){_0x19ed7d[_0xc54d('0x31')]=_[_0xc54d('0x1b')](_0x3c01d6,function(_0x775153){if(_0x775153[_0xc54d('0x32')]===_0xc54d('0x33')){var _0x1832c6=encryptor['decryptString'](_0x775153[_0xc54d('0x34')]);_0x775153['data3']=maskClientSecret(_0x1832c6);}return _0x775153;});return _0x19ed7d;})[_0xc54d('0x12')](respondWithFilteredResult(_0x13d023,_0x2478c5))['catch'](handleError(_0x13d023,null));};exports['show']=function(_0x3980cc,_0x10ee7f){var _0x544acd={'raw':!![],'where':{'id':_0x3980cc['params']['id']}},_0x1c329b={};_0x1c329b['model']=_[_0xc54d('0x21')](db[_0xc54d('0x1c')]['rawAttributes']);_0x1c329b[_0xc54d('0x20')]=_[_0xc54d('0x21')](_0x3980cc[_0xc54d('0x20')]);_0x1c329b['filters']=_[_0xc54d('0x23')](_0x1c329b[_0xc54d('0x1f')],_0x1c329b[_0xc54d('0x20')]);_0x544acd[_0xc54d('0x24')]=_[_0xc54d('0x23')](_0x1c329b['model'],qs[_0xc54d('0x25')](_0x3980cc['query'][_0xc54d('0x25')]));_0x544acd['attributes']=_0x544acd[_0xc54d('0x24')]['length']?_0x544acd['attributes']:_0x1c329b[_0xc54d('0x1f')];if(_0x3980cc[_0xc54d('0x20')]['includeAll']){_0x544acd[_0xc54d('0x2f')]=[{'all':!![]}];}_0x544acd=_[_0xc54d('0x2c')]({},_0x544acd,_0x3980cc['options']);return db[_0xc54d('0x1c')][_0xc54d('0x35')](_0x544acd)[_0xc54d('0x12')](handleEntityNotFound(_0x10ee7f,null))[_0xc54d('0x12')](function(_0x7b7e72){if(_0x7b7e72['service']===_0xc54d('0x33')){var _0x2e11ff=encryptor[_0xc54d('0x36')](_0x7b7e72['data3']);_0x7b7e72[_0xc54d('0x34')]=maskClientSecret(_0x2e11ff);}return _0x7b7e72;})[_0xc54d('0x12')](respondWithResult(_0x10ee7f,null))[_0xc54d('0x37')](handleError(_0x10ee7f,null));};exports[_0xc54d('0x38')]=function(_0x6f0e5f,_0x5f4c60){if(!_0x6f0e5f[_0xc54d('0x39')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')])throw new Error(_0xc54d('0x3a'));var _0x31ec55=db['CloudProvider']['rawAttributes']['service'][_0xc54d('0x3b')];if(!_0x31ec55[_0xc54d('0x3c')](_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')]))throw new Error(_0xc54d('0x3d')+_0x31ec55[_0xc54d('0x3e')](',\x20'));if(_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')]==='MicrosoftAzure'&&_0x6f0e5f[_0xc54d('0x39')]['data3']){_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x34')]=encryptor['encryptString'](_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x34')]);}return db[_0xc54d('0x1c')][_0xc54d('0x38')](_0x6f0e5f['body'],{})[_0xc54d('0x12')](respondWithResult(_0x5f4c60,0xc9))[_0xc54d('0x37')](handleError(_0x5f4c60,null));};exports[_0xc54d('0x11')]=function(_0x1f0e3b,_0x5a503c){if(_0x1f0e3b[_0xc54d('0x39')]['id']){delete _0x1f0e3b['body']['id'];}return db[_0xc54d('0x1c')]['find']({'where':{'id':_0x1f0e3b[_0xc54d('0x3f')]['id']}})[_0xc54d('0x12')](handleEntityNotFound(_0x5a503c,null))[_0xc54d('0x12')](function(_0xbfd79d){if(_0xbfd79d[_0xc54d('0x32')]===_0xc54d('0x33')&&_0x1f0e3b[_0xc54d('0x39')][_0xc54d('0x34')]){_0x1f0e3b['body'][_0xc54d('0x34')]=encryptor[_0xc54d('0x40')](_0x1f0e3b['body'][_0xc54d('0x34')]);}return _0xbfd79d;})['then'](saveUpdates(_0x1f0e3b[_0xc54d('0x39')],null))[_0xc54d('0x12')](respondWithResult(_0x5a503c,null))[_0xc54d('0x37')](handleError(_0x5a503c,null));};exports['destroy']=function(_0x158baf,_0x2dac7a){return db[_0xc54d('0x1c')][_0xc54d('0x35')]({'where':{'id':_0x158baf[_0xc54d('0x3f')]['id']}})[_0xc54d('0x12')](handleEntityNotFound(_0x2dac7a,null))[_0xc54d('0x12')](removeEntity(_0x2dac7a,null))[_0xc54d('0x37')](handleError(_0x2dac7a,null));};exports[_0xc54d('0x41')]=function(_0x3ed7c3,_0x150ff0){return db['CloudProvider'][_0xc54d('0x42')]({'where':{'id':_0x3ed7c3[_0xc54d('0x3f')]['id']},'raw':!![]})[_0xc54d('0x12')](function(_0x466dd6){if(!_0x466dd6)return _0x150ff0[_0xc54d('0x13')](0x194);return{'url':oauth[_0xc54d('0x43')](_0x466dd6,_0x3ed7c3[_0xc54d('0x44')]['id'])};})['then'](respondWithResult(_0x150ff0,null))['catch'](handleError(_0x150ff0,null));};exports[_0xc54d('0x45')]=function(_0xc5a48c,_0x3cbd04){var _0x33b935=_0xc5a48c['body'];var _0x40ded1;var _0x33ceab;if(_0x33b935[_0xc54d('0x14')])throw _0x33b935;redis['get'](_0x33b935[_0xc54d('0x46')])['then'](function(_0x56eb99){if(!_0x56eb99)throw new Error(_0xc54d('0x47'));_0x40ded1=JSON['parse'](_0x56eb99);var _0x4f6aea=Buffer[_0xc54d('0x48')](_0x33b935[_0xc54d('0x46')],_0xc54d('0x49'))[_0xc54d('0x4a')](_0xc54d('0x4b'));_0x33ceab=JSON['parse'](_0x4f6aea);if(!oauth[_0xc54d('0x4c')](_0x33b935[_0xc54d('0x4d')],_0x40ded1['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x33b935[_0xc54d('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x33b935[_0xc54d('0x4e')],_0x40ded1);})['then'](function(_0x22b91c){_0x40ded1['data5']=_0x22b91c[_0xc54d('0x4f')];_0x40ded1[_0xc54d('0x50')]=_0x22b91c[_0xc54d('0x51')];return db['CloudProvider'][_0xc54d('0x11')]({'data5':_0x40ded1[_0xc54d('0x52')],'data6':_0x40ded1['data6']},{'where':{'id':_0x40ded1['id']}});})[_0xc54d('0x12')](function(){oauth['startRefreshInterval'](_0x40ded1);socket[_0xc54d('0x53')](_0xc54d('0x54'),{'id':_0x33ceab['id']});return;})[_0xc54d('0x12')](respondWithStatusCode(_0x3cbd04,null))[_0xc54d('0x37')](function(_0x2bcbc8){if(_0x33ceab){socket[_0xc54d('0x53')](_0xc54d('0x55'),{'id':_0x33ceab['id']});}if(!_0x40ded1){logger[_0xc54d('0x14')](_0xc54d('0x56'),_0x2bcbc8);return _0x3cbd04[_0xc54d('0x8')](0x1f4)[_0xc54d('0x17')](_0x2bcbc8[_0xc54d('0x57')]);}logger[_0xc54d('0x14')](_0xc54d('0x58'),_0x40ded1['id'],JSON[_0xc54d('0x59')](_0x2bcbc8));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 08fe68b..e98f562 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 _0xa8a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0x1ef5f9,_0x44dad1){var _0x25f75b=function(_0x1b9955){while(--_0x1b9955){_0x1ef5f9['push'](_0x1ef5f9['shift']());}};_0x25f75b(++_0x44dad1);}(_0xa8a3,0x197));var _0x3a8a=function(_0x590f55,_0x314c3b){_0x590f55=_0x590f55-0x0;var _0x14142f=_0xa8a3[_0x590f55];return _0x14142f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a8a('0x0'))('api');var moment=require(_0x3a8a('0x1'));var BPromise=require(_0x3a8a('0x2'));var rp=require(_0x3a8a('0x3'));var fs=require('fs');var path=require(_0x3a8a('0x4'));var rimraf=require(_0x3a8a('0x5'));var config=require(_0x3a8a('0x6'));var attributes=require(_0x3a8a('0x7'));module[_0x3a8a('0x8')]=function(_0x2d9629,_0x570fb3){return _0x2d9629[_0x3a8a('0x9')](_0x3a8a('0xa'),attributes,{'tableName':_0x3a8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4ab=['request-promise','path','rimraf','../../config/environment','define','CloudProvider','cloud_providers','util','../../config/logger','api','bluebird'];(function(_0x37cf36,_0x124489){var _0x4678d5=function(_0x29168b){while(--_0x29168b){_0x37cf36['push'](_0x37cf36['shift']());}};_0x4678d5(++_0x124489);}(_0xb4ab,0x1ca));var _0xbb4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xbb4a('0x0'));var logger=require(_0xbb4a('0x1'))(_0xbb4a('0x2'));var moment=require('moment');var BPromise=require(_0xbb4a('0x3'));var rp=require(_0xbb4a('0x4'));var fs=require('fs');var path=require(_0xbb4a('0x5'));var rimraf=require(_0xbb4a('0x6'));var config=require(_0xbb4a('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x5ba824,_0x40adb4){return _0x5ba824[_0xbb4a('0x8')](_0xbb4a('0x9'),attributes,{'tableName':_0xbb4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 32930d5..703d86f 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2279=['catch','error','authorization_code','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','type','push','data7','join','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','form_post','state','prompt','login','map','key','value','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','nonce','isAfter','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','{TENANT_ID}','update'];(function(_0x514d96,_0x27dc94){var _0x3d1eeb=function(_0x3f0518){while(--_0x3f0518){_0x514d96['push'](_0x514d96['shift']());}};_0x3d1eeb(++_0x27dc94);}(_0x2279,0x18e));var _0x9227=function(_0x3d4a53,_0x41b236){_0x3d4a53=_0x3d4a53-0x0;var _0x4a4279=_0x2279[_0x3d4a53];return _0x4a4279;};'use strict';var _=require(_0x9227('0x0'));var crypto=require(_0x9227('0x1'));var jwt=require(_0x9227('0x2'));var moment=require(_0x9227('0x3'));var Redis=require(_0x9227('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x9227('0x5'));var config=require(_0x9227('0x6'));var logger=require(_0x9227('0x7'))(_0x9227('0x8'));var schedule=require(_0x9227('0x9'));var db=require(_0x9227('0xa'))['db'];config[_0x9227('0xb')]=_[_0x9227('0xc')](config[_0x9227('0xb')],{'host':_0x9227('0xd'),'port':0x18eb});var redis=new Redis(config[_0x9227('0xb')]);var MICROSOFT_AUTH_URL=_0x9227('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9227('0xf'),_0x9227('0x10'),_0x9227('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x9227('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9227('0x13'),_0x9227('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9227('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x9227('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2184d7){var _0x5c9d5e=_['map'](AZURE_AUTH_SCOPES[_0x2184d7[_0x9227('0x16')]]);if(_0x2184d7['type']==='Dynamics365')_0x5c9d5e[_0x9227('0x17')](_0x2184d7[_0x9227('0x18')]+'/.default');return _0x5c9d5e[_0x9227('0x19')]('\x20');}function getAccessTokenScope(_0x593597){if(_0x593597['type']==='Outlook365')return _0x9227('0x1a');if(_0x593597[_0x9227('0x16')]==='Dynamics365')return _0x593597[_0x9227('0x18')]+_0x9227('0x1b');}function generateMicrosoftAuthorizationUrl(_0x4239f2,_0x2854f3){var _0xe8b359=MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x4239f2[_0x9227('0x1d')]);var _0x1b889c=[_0x9227('0x1e'),_0x9227('0x1f')];var _0x5af2bf=Buffer[_0x9227('0x20')](JSON[_0x9227('0x21')]({'id':_0x2854f3}))[_0x9227('0x22')](_0x9227('0x23'));var _0x3d1507=crypto[_0x9227('0x24')](0x10)[_0x9227('0x22')](_0x9227('0x25'));var _0x377bbc=getAuthorizationScopes(_0x4239f2);var _0x270c0d=[{'key':_0x9227('0x26'),'value':_0x4239f2[_0x9227('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x1b889c[_0x9227('0x19')]('\x20'))},{'key':_0x9227('0x28'),'value':_0x4239f2[_0x9227('0x29')]},{'key':'response_mode','value':_0x9227('0x2a')},{'key':'scope','value':encodeURIComponent(_0x377bbc)},{'key':_0x9227('0x2b'),'value':_0x5af2bf},{'key':'nonce','value':_0x3d1507},{'key':_0x9227('0x2c'),'value':_0x9227('0x2d')}];var _0x223160=_0xe8b359+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9227('0x2e')](_0x270c0d,function(_0x5ae7fc){return _0x5ae7fc[_0x9227('0x2f')]+'='+_0x5ae7fc[_0x9227('0x30')];})['join']('&');_0x4239f2[_0x9227('0x31')]={'issuer':_0xe8b359[_0x9227('0x1c')](_0x9227('0x32'),''),'audience':_0x4239f2[_0x9227('0x27')],'state':_0x5af2bf,'nonce':_0x3d1507};redis[_0x9227('0x33')](_0x5af2bf,JSON[_0x9227('0x21')](_0x4239f2));return _0x223160;}function isValidIdToken(_0x5436fd,_0x3342be){try{var _0x26bac0=jwt['decode'](_0x5436fd,{'complete':!![]});var _0xe9eb8e=_0x26bac0[_0x9227('0x34')];if(_0xe9eb8e['iss']!==_0x3342be[_0x9227('0x35')])return![];if(_0xe9eb8e[_0x9227('0x36')]!==_0x3342be[_0x9227('0x37')])return![];if(_0xe9eb8e[_0x9227('0x38')]!==_0x3342be[_0x9227('0x38')])return![];if(moment()[_0x9227('0x39')](moment['unix'](_0xe9eb8e[_0x9227('0x3a')])))return![];return!![];}catch(_0x329cfd){throw _0x329cfd;}}function refreshOauth2MicrosoftAccessToken(_0x5dcbe2){return Promise[_0x9227('0x3b')]()[_0x9227('0x3c')](function(){if(_0x5dcbe2['data3'])return _0x5dcbe2;return db[_0x9227('0x3d')][_0x9227('0x3e')]({'where':{'id':_0x5dcbe2['id']},'raw':!![]});})[_0x9227('0x3c')](function(_0x6e2259){var _0x2fe3d5={'grant_type':_0x9227('0x3f'),'refresh_token':_0x6e2259[_0x9227('0x40')],'scope':getAccessTokenScope(_0x6e2259),'redirect_uri':_0x6e2259['data4'],'client_id':_0x6e2259['data1'],'client_secret':encryptor[_0x9227('0x41')](_0x6e2259[_0x9227('0x42')])};var _0x138ed0={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')](_0x9227('0x44'),_0x6e2259['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2fe3d5,'json':!![]};return rp(_0x138ed0);})[_0x9227('0x3c')](function(_0x3b7e75){_0x5dcbe2['data5']=_0x3b7e75['access_token'];_0x5dcbe2[_0x9227('0x40')]=_0x3b7e75[_0x9227('0x3f')];return db['CloudProvider'][_0x9227('0x45')]({'data5':_0x5dcbe2['data5'],'data6':_0x5dcbe2[_0x9227('0x40')]},{'where':{'id':_0x5dcbe2['id']}});})['then'](function(){return _0x5dcbe2;})[_0x9227('0x46')](function(_0x2f85aa){logger[_0x9227('0x47')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5dcbe2['id'],_0x2f85aa);});}function getOauth2MicrosoftAccessToken(_0x22aae0,_0x33e887){var _0x3a1936={'grant_type':_0x9227('0x48'),'code':_0x22aae0,'scope':getAccessTokenScope(_0x33e887),'redirect_uri':_0x33e887['data4'],'client_id':_0x33e887[_0x9227('0x27')],'client_secret':encryptor['decryptString'](_0x33e887[_0x9227('0x42')])};var _0x4f3e1a={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x33e887[_0x9227('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3a1936,'json':!![]};return rp(_0x4f3e1a);}function startRefreshInterval(_0x4b66e8){var _0x387e83=schedule[_0x9227('0x49')];if(_0x387e83[_0x4b66e8['id']])clearInterval(_0x387e83[_0x4b66e8['id']]);_0x387e83[_0x4b66e8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9227('0x4a')](this,{'id':_0x4b66e8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9227('0x49')]=_0x387e83;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9227('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9227('0x3c')](function(_0x84a2d6){var _0x55f8df=_0x84a2d6[_0x9227('0x2e')](function(_0x4c1ce8){return refreshOauth2MicrosoftAccessToken(_0x4c1ce8)[_0x9227('0x3c')](function(_0x2974dc){startRefreshInterval(_0x2974dc);});});return Promise[_0x9227('0x4c')](_0x55f8df);})[_0x9227('0x46')](function(_0x26c906){var _0x4539fe=_0x26c906?util['inspect'](_0x26c906,{'showHidden':![],'depth':null}):'';logger[_0x9227('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4539fe);});}module[_0x9227('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x9485=['https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','decode','iss','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','data2','data5','access_token','data6','update','POST','intervals','findAll','catch','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9485,0x89));var _0x5948=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0x9485[_0x5d7686];return _0x408ab4;};'use strict';var _=require(_0x5948('0x0'));var crypto=require(_0x5948('0x1'));var jwt=require(_0x5948('0x2'));var moment=require(_0x5948('0x3'));var Redis=require('ioredis');var rp=require(_0x5948('0x4'));var util=require(_0x5948('0x5'));var encryptor=require(_0x5948('0x6'));var config=require(_0x5948('0x7'));var logger=require(_0x5948('0x8'))('api');var schedule=require(_0x5948('0x9'));var db=require(_0x5948('0xa'))['db'];config[_0x5948('0xb')]=_['defaults'](config[_0x5948('0xb')],{'host':_0x5948('0xc'),'port':0x18eb});var redis=new Redis(config[_0x5948('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5948('0xd'),_0x5948('0xe'),_0x5948('0xf'),_0x5948('0x10'),_0x5948('0x11'),_0x5948('0x12'),_0x5948('0x13')],'Dynamics365':['openid',_0x5948('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x5948('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x5948('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x376e6c){var _0x31431d=_[_0x5948('0x16')](AZURE_AUTH_SCOPES[_0x376e6c[_0x5948('0x17')]]);if(_0x376e6c[_0x5948('0x17')]==='Dynamics365')_0x31431d[_0x5948('0x18')](_0x376e6c['data7']+_0x5948('0x19'));return _0x31431d[_0x5948('0x1a')]('\x20');}function getAccessTokenScope(_0x50cbfd){if(_0x50cbfd['type']===_0x5948('0x1b'))return _0x5948('0x11');if(_0x50cbfd['type']===_0x5948('0x1c'))return _0x50cbfd['data7']+_0x5948('0x19');}function generateMicrosoftAuthorizationUrl(_0xc43f8a,_0x4c7e6e){var _0x216205=MICROSOFT_AUTH_URL[_0x5948('0x1d')](_0x5948('0x1e'),_0xc43f8a['data2']);var _0x5c69d3=['code',_0x5948('0x1f')];var _0x103cc9=Buffer['from'](JSON[_0x5948('0x20')]({'id':_0x4c7e6e}))[_0x5948('0x21')](_0x5948('0x22'));var _0x220384=crypto[_0x5948('0x23')](0x10)[_0x5948('0x21')](_0x5948('0x24'));var _0x4fa564=getAuthorizationScopes(_0xc43f8a);var _0x137bb6=[{'key':_0x5948('0x25'),'value':_0xc43f8a[_0x5948('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x5c69d3[_0x5948('0x1a')]('\x20'))},{'key':_0x5948('0x27'),'value':_0xc43f8a[_0x5948('0x28')]},{'key':_0x5948('0x29'),'value':_0x5948('0x2a')},{'key':_0x5948('0x2b'),'value':encodeURIComponent(_0x4fa564)},{'key':_0x5948('0x2c'),'value':_0x103cc9},{'key':_0x5948('0x2d'),'value':_0x220384},{'key':'prompt','value':_0x5948('0x2e')}];var _0x54ced0=_0x216205+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5948('0x16')](_0x137bb6,function(_0x1daafe){return _0x1daafe[_0x5948('0x2f')]+'='+_0x1daafe[_0x5948('0x30')];})[_0x5948('0x1a')]('&');_0xc43f8a[_0x5948('0x31')]={'issuer':_0x216205[_0x5948('0x1d')](_0x5948('0x32'),''),'audience':_0xc43f8a[_0x5948('0x26')],'state':_0x103cc9,'nonce':_0x220384};redis[_0x5948('0x33')](_0x103cc9,JSON[_0x5948('0x20')](_0xc43f8a));return _0x54ced0;}function isValidIdToken(_0x41c30d,_0xc4baee){try{var _0x24fb27=jwt[_0x5948('0x34')](_0x41c30d,{'complete':!![]});var _0x2f4854=_0x24fb27['payload'];if(_0x2f4854[_0x5948('0x35')]!==_0xc4baee['issuer'])return![];if(_0x2f4854[_0x5948('0x36')]!==_0xc4baee[_0x5948('0x37')])return![];if(_0x2f4854[_0x5948('0x2d')]!==_0xc4baee[_0x5948('0x2d')])return![];if(moment()[_0x5948('0x38')](moment[_0x5948('0x39')](_0x2f4854[_0x5948('0x3a')])))return![];return!![];}catch(_0x1f5b97){throw _0x1f5b97;}}function refreshOauth2MicrosoftAccessToken(_0xa12e4e){return Promise['resolve']()[_0x5948('0x3b')](function(){if(_0xa12e4e[_0x5948('0x3c')])return _0xa12e4e;return db[_0x5948('0x3d')][_0x5948('0x3e')]({'where':{'id':_0xa12e4e['id']},'raw':!![]});})['then'](function(_0x35c098){var _0x1d2a68={'grant_type':_0x5948('0x3f'),'refresh_token':_0x35c098['data6'],'scope':getAccessTokenScope(_0x35c098),'redirect_uri':_0x35c098[_0x5948('0x28')],'client_id':_0x35c098[_0x5948('0x26')],'client_secret':encryptor[_0x5948('0x40')](_0x35c098['data3'])};var _0x297164={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5948('0x1d')](_0x5948('0x1e'),_0x35c098[_0x5948('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d2a68,'json':!![]};return rp(_0x297164);})['then'](function(_0x3e949f){_0xa12e4e[_0x5948('0x42')]=_0x3e949f[_0x5948('0x43')];_0xa12e4e[_0x5948('0x44')]=_0x3e949f[_0x5948('0x3f')];return db['CloudProvider'][_0x5948('0x45')]({'data5':_0xa12e4e[_0x5948('0x42')],'data6':_0xa12e4e[_0x5948('0x44')]},{'where':{'id':_0xa12e4e['id']}});})['then'](function(){return _0xa12e4e;})['catch'](function(_0x4b3223){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xa12e4e['id'],_0x4b3223);});}function getOauth2MicrosoftAccessToken(_0x15a15e,_0x5b6991){var _0x3ed588={'grant_type':'authorization_code','code':_0x15a15e,'scope':getAccessTokenScope(_0x5b6991),'redirect_uri':_0x5b6991[_0x5948('0x28')],'client_id':_0x5b6991[_0x5948('0x26')],'client_secret':encryptor['decryptString'](_0x5b6991[_0x5948('0x3c')])};var _0x35201d={'method':_0x5948('0x46'),'uri':MICROSOFT_AUTH_URL['replace'](_0x5948('0x1e'),_0x5b6991[_0x5948('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ed588,'json':!![]};return rp(_0x35201d);}function startRefreshInterval(_0x185f7e){var _0x3290be=schedule[_0x5948('0x47')];if(_0x3290be[_0x185f7e['id']])clearInterval(_0x3290be[_0x185f7e['id']]);_0x3290be[_0x185f7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x185f7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5948('0x47')]=_0x3290be;}function startAllRefreshIntervals(){return db[_0x5948('0x3d')][_0x5948('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5948('0x3b')](function(_0x27702e){var _0x13f03e=_0x27702e[_0x5948('0x16')](function(_0x398033){return refreshOauth2MicrosoftAccessToken(_0x398033)['then'](function(_0x3fb61c){startRefreshInterval(_0x3fb61c);});});return Promise['all'](_0x13f03e);})[_0x5948('0x49')](function(_0x4e5853){var _0x4da144=_0x4e5853?util[_0x5948('0x4a')](_0x4e5853,{'showHidden':![],'depth':null}):'';logger[_0x5948('0x4b')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4da144);});}module[_0x5948('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index e91ea56..d899460 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 _0xce62=['code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x3dc9ce,_0x3f76b0){var _0x1747f2=function(_0x38ec7d){while(--_0x38ec7d){_0x3dc9ce['push'](_0x3dc9ce['shift']());}};_0x1747f2(++_0x3f76b0);}(_0xce62,0x83));var _0x2ce6=function(_0x45204c,_0x1eefaa){_0x45204c=_0x45204c-0x0;var _0x5dc667=_0xce62[_0x45204c];return _0x5dc667;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});} \ No newline at end of file +var _0x9db7=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x29d524,_0x1df569){var _0x3949fe=function(_0x35ad47){while(--_0x35ad47){_0x29d524['push'](_0x29d524['shift']());}};_0x3949fe(++_0x1df569);}(_0x9db7,0x1bf));var _0x79db=function(_0x540886,_0x4c6eff){_0x540886=_0x540886-0x0;var _0x1ef0b7=_0x9db7[_0x540886];return _0x1ef0b7;};'use strict';var _=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var moment=require(_0x79db('0x2'));var BPromise=require(_0x79db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79db('0x5'));var logger=require(_0x79db('0x6'))('rpc');var config=require(_0x79db('0x7'));var jayson=require(_0x79db('0x8'));var client=jayson[_0x79db('0x9')][_0x79db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7980b1,_0x395883,_0x214bf9){return new BPromise(function(_0x792510,_0x27d02a){return client[_0x79db('0xb')](_0x7980b1,_0x214bf9)[_0x79db('0xc')](function(_0x145a31){logger['info'](_0x79db('0xd'),_0x395883,_0x79db('0xe'));logger[_0x79db('0xf')](_0x79db('0x10'),_0x395883,_0x79db('0xe'),JSON[_0x79db('0x11')](_0x145a31));if(_0x145a31[_0x79db('0x12')]){if(_0x145a31[_0x79db('0x12')][_0x79db('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x395883,_0x145a31['error'][_0x79db('0x14')]);return _0x27d02a(_0x145a31['error'][_0x79db('0x14')]);}logger['error'](_0x79db('0xd'),_0x395883,_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);return _0x792510(_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);}else{logger[_0x79db('0x15')](_0x79db('0xd'),_0x395883,_0x79db('0xe'));_0x792510(_0x145a31[_0x79db('0x16')][_0x79db('0x14')]);}})[_0x79db('0x17')](function(_0x365889){logger[_0x79db('0x12')]('CloudProvider,\x20%s,\x20%s',_0x395883,_0x365889);_0x27d02a(_0x365889);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7e48363..0f3c106 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4f4365,_0x2aee26){var _0x128f6e=function(_0x72a92f){while(--_0x72a92f){_0x4f4365['push'](_0x4f4365['shift']());}};_0x128f6e(++_0x2aee26);}(_0xadb5,0xad));var _0x5adb=function(_0x321ceb,_0x100a58){_0x321ceb=_0x321ceb-0x0;var _0x512dbc=_0xadb5[_0x321ceb];return _0x512dbc;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x59ba39,_0x1af940){var _0x1ace8e=function(_0x2b64be){while(--_0x2b64be){_0x59ba39['push'](_0x59ba39['shift']());}};_0x1ace8e(++_0x1af940);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c6eef,_0x5830f7){_0x1c6eef=_0x1c6eef-0x0;var _0xa8e6f7=_0x2ef3[_0x1c6eef];return _0xa8e6f7;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 15fb684..35032be 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 _0xec43=['STRING','name','sequelize','exports'];(function(_0x304998,_0x2635c9){var _0x136067=function(_0x519e6e){while(--_0x519e6e){_0x304998['push'](_0x304998['shift']());}};_0x136067(++_0x2635c9);}(_0xec43,0x1c2));var _0x3ec4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec43[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec4('0x0'));module[_0x3ec4('0x1')]={'name':{'type':Sequelize[_0x3ec4('0x2')],'unique':_0x3ec4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3ec4('0x2')]},'companyId':{'type':Sequelize[_0x3ec4('0x2')]},'website':{'type':Sequelize[_0x3ec4('0x2')]},'phone':{'type':Sequelize[_0x3ec4('0x2')]},'fax':{'type':Sequelize[_0x3ec4('0x2')]},'type':{'type':Sequelize[_0x3ec4('0x2')]},'street':{'type':Sequelize[_0x3ec4('0x2')]},'postalCode':{'type':Sequelize[_0x3ec4('0x2')]},'city':{'type':Sequelize[_0x3ec4('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ec4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3ec4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3ec4('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb9c5=['STRING','name'];(function(_0x61d9c8,_0x46dc82){var _0x20319e=function(_0x3a9f89){while(--_0x3a9f89){_0x61d9c8['push'](_0x61d9c8['shift']());}};_0x20319e(++_0x46dc82);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x33d0e7,_0x336442){_0x33d0e7=_0x33d0e7-0x0;var _0x4aff0e=_0xb9c5[_0x33d0e7];return _0x4aff0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5b9c('0x0')],'unique':_0x5b9c('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5b9c('0x0')]},'companyId':{'type':Sequelize[_0x5b9c('0x0')]},'website':{'type':Sequelize[_0x5b9c('0x0')]},'phone':{'type':Sequelize[_0x5b9c('0x0')]},'fax':{'type':Sequelize[_0x5b9c('0x0')]},'type':{'type':Sequelize[_0x5b9c('0x0')]},'street':{'type':Sequelize[_0x5b9c('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5b9c('0x0')]},'country':{'type':Sequelize[_0x5b9c('0x0')]},'email':{'type':Sequelize[_0x5b9c('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5b9c('0x0')]},'sPostalCode':{'type':Sequelize[_0x5b9c('0x0')]},'sCity':{'type':Sequelize[_0x5b9c('0x0')]},'sCountry':{'type':Sequelize[_0x5b9c('0x0')]},'description':{'type':Sequelize[_0x5b9c('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 60fe266..7202cc3 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 _0xbcd1=['sendStatus','status','offset','limit','set','json','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','map','options','count','includeAll','findAll','rows','catch','show','rawAttributes','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','findOne','sort','pick','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbcd1,0xe9));var _0x1bcd=function(_0x2e1cd7,_0x293ea1){_0x2e1cd7=_0x2e1cd7-0x0;var _0x515226=_0xbcd1[_0x2e1cd7];return _0x515226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bcd('0x0'));var zipdir=require(_0x1bcd('0x1'));var jsonpatch=require(_0x1bcd('0x2'));var rp=require(_0x1bcd('0x3'));var moment=require('moment');var BPromise=require(_0x1bcd('0x4'));var Mustache=require(_0x1bcd('0x5'));var util=require(_0x1bcd('0x6'));var path=require('path');var sox=require(_0x1bcd('0x7'));var csv=require(_0x1bcd('0x8'));var ejs=require(_0x1bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x1bcd('0xa'));var _=require(_0x1bcd('0xb'));var squel=require(_0x1bcd('0xc'));var crypto=require(_0x1bcd('0xd'));var jsforce=require(_0x1bcd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1bcd('0x8'));var querystring=require(_0x1bcd('0xf'));var Papa=require('papaparse');var Redis=require(_0x1bcd('0x10'));var authService=require(_0x1bcd('0x11'));var qs=require(_0x1bcd('0x12'));var as=require(_0x1bcd('0x13'));var hardwareService=require(_0x1bcd('0x14'));var logger=require(_0x1bcd('0x15'))(_0x1bcd('0x16'));var utils=require(_0x1bcd('0x17'));var config=require(_0x1bcd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3cd0,_0x53a60c){_0x53a60c=_0x53a60c||0xcc;return function(_0x3999da){if(_0x3999da){return _0x5b3cd0[_0x1bcd('0x19')](_0x53a60c);}return _0x5b3cd0[_0x1bcd('0x1a')](_0x53a60c)['end']();};}function respondWithResult(_0x3cb2c0,_0x1f6ad6){_0x1f6ad6=_0x1f6ad6||0xc8;return function(_0x550a41){if(_0x550a41){return _0x3cb2c0[_0x1bcd('0x1a')](_0x1f6ad6)['json'](_0x550a41);}};}function respondWithFilteredResult(_0x413b70,_0x21af94){return function(_0x1876fc){if(_0x1876fc){var _0x408f91=typeof _0x21af94[_0x1bcd('0x1b')]==='undefined'&&typeof _0x21af94[_0x1bcd('0x1c')]==='undefined';var _0x3535da=_0x1876fc['count'];var _0x5a1a38=_0x408f91?0x0:_0x21af94[_0x1bcd('0x1b')];var _0xd64780=_0x408f91?_0x1876fc['count']:_0x21af94[_0x1bcd('0x1b')]+_0x21af94['limit'];var _0x5b5772;if(_0xd64780>=_0x3535da){_0xd64780=_0x3535da;_0x5b5772=0xc8;}else{_0x5b5772=0xce;}_0x413b70[_0x1bcd('0x1a')](_0x5b5772);return _0x413b70[_0x1bcd('0x1d')]('Content-Range',_0x5a1a38+'-'+_0xd64780+'/'+_0x3535da)[_0x1bcd('0x1e')](_0x1876fc);}return null;};}function patchUpdates(_0x581747){return function(_0x4dcfdf){try{jsonpatch[_0x1bcd('0x1f')](_0x4dcfdf,_0x581747,!![]);}catch(_0x14df57){return BPromise[_0x1bcd('0x20')](_0x14df57);}return _0x4dcfdf[_0x1bcd('0x21')]();};}function saveUpdates(_0x14ca60,_0x3c9292){return function(_0x104f4b){if(_0x104f4b){return _0x104f4b[_0x1bcd('0x22')](_0x14ca60)[_0x1bcd('0x23')](function(_0x161fb9){return _0x161fb9;});}return null;};}function removeEntity(_0x1ce295,_0x2c8601){return function(_0x30c468){if(_0x30c468){return _0x30c468[_0x1bcd('0x24')]()['then'](function(){var _0x4729bd=_0x30c468['get']({'plain':!![]});var _0x37ef5b='Companies';return db[_0x1bcd('0x25')][_0x1bcd('0x24')]({'where':{'type':_0x37ef5b,'resourceId':_0x4729bd['id']}})[_0x1bcd('0x23')](function(){return _0x30c468;});})[_0x1bcd('0x23')](function(){_0x1ce295[_0x1bcd('0x1a')](0xcc)[_0x1bcd('0x26')]();});}};}function handleEntityNotFound(_0x3ffbd9,_0x3516d2){return function(_0x15c8a0){if(!_0x15c8a0){_0x3ffbd9['sendStatus'](0x194);}return _0x15c8a0;};}function handleError(_0x54d86a,_0x418815){_0x418815=_0x418815||0x1f4;return function(_0x21e7ff){logger[_0x1bcd('0x27')](_0x21e7ff['stack']);if(_0x21e7ff[_0x1bcd('0x28')]){delete _0x21e7ff[_0x1bcd('0x28')];}_0x54d86a[_0x1bcd('0x1a')](_0x418815)['send'](_0x21e7ff);};}exports[_0x1bcd('0x29')]=function(_0x4a6c8c,_0x2bf5ad){var _0x29615b={},_0x3b3b1d={},_0xb9f698={'count':0x0,'rows':[]};return db[_0x1bcd('0x2a')]['describe']()['then'](function(_0xbbca44){_0x3b3b1d['model']=_[_0x1bcd('0x2b')](_0xbbca44);_0x3b3b1d[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4a6c8c[_0x1bcd('0x2c')]);_0x3b3b1d[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],_0x3b3b1d[_0x1bcd('0x2c')]);_0x29615b[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],qs[_0x1bcd('0x31')](_0x4a6c8c['query'][_0x1bcd('0x31')]));_0x29615b[_0x1bcd('0x30')]=_0x29615b[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x29615b[_0x1bcd('0x30')]:_0x3b3b1d[_0x1bcd('0x2f')];if(!_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0x29615b[_0x1bcd('0x1c')]=qs['limit'](_0x4a6c8c[_0x1bcd('0x2c')]['limit']);_0x29615b[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x4a6c8c['query'][_0x1bcd('0x1b')]);}_0x29615b[_0x1bcd('0x35')]=qs['sort'](_0x4a6c8c[_0x1bcd('0x2c')]['sort']);_0x29615b[_0x1bcd('0x36')]=qs[_0x1bcd('0x2d')](_['pick'](_0x4a6c8c[_0x1bcd('0x2c')],_0x3b3b1d[_0x1bcd('0x2d')]),_0xbbca44);if(_0x4a6c8c['query'][_0x1bcd('0x37')]){_0x29615b[_0x1bcd('0x36')]=_['merge'](_0x29615b[_0x1bcd('0x36')],{'$or':_[_0x1bcd('0x38')](_0x29615b[_0x1bcd('0x30')],function(_0x3a8f27){var _0x43c5c5={};_0x43c5c5[_0x3a8f27]={'$like':'%'+_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x43c5c5;})});}_0x29615b=_['merge']({},_0x29615b,_0x4a6c8c[_0x1bcd('0x39')]);var _0x4cedb8={'where':_0x29615b[_0x1bcd('0x36')]};return db[_0x1bcd('0x2a')]['count'](_0x4cedb8)[_0x1bcd('0x23')](function(_0x4bfe13){_0xb9f698[_0x1bcd('0x3a')]=_0x4bfe13;if(_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x29615b['include']=[{'all':!![]}];}return db[_0x1bcd('0x2a')][_0x1bcd('0x3c')](_0x29615b);})[_0x1bcd('0x23')](function(_0x445497){_0xb9f698[_0x1bcd('0x3d')]=_0x445497;return _0xb9f698;})[_0x1bcd('0x23')](respondWithFilteredResult(_0x2bf5ad,_0x29615b))[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));})[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));};exports[_0x1bcd('0x3f')]=function(_0x4dab25,_0x320f84){var _0x1818d9={'raw':![],'where':{'id':_0x4dab25['params']['id']}},_0x23efd7={};_0x23efd7[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x2a')][_0x1bcd('0x40')]);_0x23efd7[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4dab25['query']);_0x23efd7[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],_0x23efd7[_0x1bcd('0x2c')]);_0x1818d9[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],qs['fields'](_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x31')]));_0x1818d9[_0x1bcd('0x30')]=_0x1818d9[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x1818d9['attributes']:_0x23efd7[_0x1bcd('0x2f')];if(_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x1818d9[_0x1bcd('0x41')]=[{'all':!![]}];}_0x1818d9=_[_0x1bcd('0x42')]({},_0x1818d9,_0x4dab25[_0x1bcd('0x39')]);return db[_0x1bcd('0x2a')][_0x1bcd('0x43')](_0x1818d9)[_0x1bcd('0x23')](handleEntityNotFound(_0x320f84,null))[_0x1bcd('0x23')](respondWithResult(_0x320f84,null))[_0x1bcd('0x3e')](handleError(_0x320f84,null));};exports[_0x1bcd('0x44')]=function(_0x361977,_0xa04945){return db[_0x1bcd('0x2a')][_0x1bcd('0x44')](_0x361977[_0x1bcd('0x45')],{})['then'](function(_0x5e5a33){var _0x1c115a=_0x361977[_0x1bcd('0x46')][_0x1bcd('0x47')]({'plain':!![]});if(!_0x1c115a)throw new Error(_0x1bcd('0x48'));if(_0x1c115a[_0x1bcd('0x49')]==='user'){var _0x1376c3=_0x5e5a33[_0x1bcd('0x47')]({'plain':!![]});var _0x523da3=_0x1bcd('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x523da3,'userProfileId':_0x1c115a['userProfileId']},'raw':!![]})[_0x1bcd('0x23')](function(_0x34904d){if(_0x34904d&&_0x34904d[_0x1bcd('0x4b')]===0x0){return db[_0x1bcd('0x25')][_0x1bcd('0x44')]({'name':_0x1376c3[_0x1bcd('0x28')],'resourceId':_0x1376c3['id'],'type':_0x34904d[_0x1bcd('0x28')],'sectionId':_0x34904d['id']},{})[_0x1bcd('0x23')](function(){return _0x5e5a33;});}else{return _0x5e5a33;}})[_0x1bcd('0x3e')](function(_0x3d8f83){logger[_0x1bcd('0x27')](_0x1bcd('0x4c'),_0x3d8f83);throw _0x3d8f83;});}return _0x5e5a33;})['then'](respondWithResult(_0xa04945,0xc9))[_0x1bcd('0x3e')](handleError(_0xa04945,null));};exports['update']=function(_0xe1f92,_0xfa2b2f){if(_0xe1f92[_0x1bcd('0x45')]['id']){delete _0xe1f92[_0x1bcd('0x45')]['id'];}return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0xe1f92[_0x1bcd('0x4d')]['id']}})['then'](handleEntityNotFound(_0xfa2b2f,null))[_0x1bcd('0x23')](saveUpdates(_0xe1f92[_0x1bcd('0x45')],null))[_0x1bcd('0x23')](respondWithResult(_0xfa2b2f,null))[_0x1bcd('0x3e')](handleError(_0xfa2b2f,null));};exports[_0x1bcd('0x24')]=function(_0x4de844,_0x4ac031){return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0x4de844[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x4ac031,null))[_0x1bcd('0x23')](removeEntity(_0x4ac031,null))[_0x1bcd('0x3e')](handleError(_0x4ac031,null));};exports[_0x1bcd('0x4e')]=function(_0x5eb026,_0x5812cb){return db[_0x1bcd('0x2a')][_0x1bcd('0x4e')]()[_0x1bcd('0x23')](respondWithResult(_0x5812cb,null))['catch'](handleError(_0x5812cb,null));};exports['addContacts']=function(_0xe25a7c,_0x51275a,_0x18af40){return db[_0x1bcd('0x4f')][_0x1bcd('0x43')]({'where':{'id':_0xe25a7c[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x51275a,null))[_0x1bcd('0x23')](function(_0x418689){if(_0x418689){return _0x418689[_0x1bcd('0x50')](_0xe25a7c[_0x1bcd('0x45')][_0x1bcd('0x51')],_['omit'](_0xe25a7c[_0x1bcd('0x45')],[_0x1bcd('0x51'),'id'])||{});}})['then'](respondWithResult(_0x51275a,null))['catch'](handleError(_0x51275a,null));};exports['getContacts']=function(_0x1f147b,_0x5d6280,_0x3ed84f){var _0xe7c08c={};var _0x29c08f={};var _0x584692;var _0x5c6cfd;return db[_0x1bcd('0x2a')][_0x1bcd('0x52')]({'where':{'id':_0x1f147b['params']['id']}})['then'](handleEntityNotFound(_0x5d6280,null))[_0x1bcd('0x23')](function(_0x4ce427){if(_0x4ce427){_0x584692=_0x4ce427;_0x29c08f[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x4f')][_0x1bcd('0x40')]);_0x29c08f[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x1f147b[_0x1bcd('0x2c')]);_0x29c08f[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],_0x29c08f[_0x1bcd('0x2c')]);_0xe7c08c[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],qs['fields'](_0x1f147b['query'][_0x1bcd('0x31')]));_0xe7c08c['attributes']=_0xe7c08c[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0xe7c08c['attributes']:_0x29c08f['model'];_0xe7c08c[_0x1bcd('0x35')]=qs[_0x1bcd('0x53')](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x53')]);_0xe7c08c[_0x1bcd('0x36')]=qs['filters'](_[_0x1bcd('0x54')](_0x1f147b[_0x1bcd('0x2c')],_0x29c08f[_0x1bcd('0x2d')]));if(_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]){_0xe7c08c[_0x1bcd('0x36')]=_[_0x1bcd('0x42')](_0xe7c08c['where'],{'$or':_[_0x1bcd('0x38')](_0xe7c08c['attributes'],function(_0x233152){var _0x3774ea={};_0x3774ea[_0x233152]={'$like':'%'+_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x3774ea;})});}_0xe7c08c=_['merge']({},_0xe7c08c,_0x1f147b[_0x1bcd('0x39')]);return _0x584692[_0x1bcd('0x55')](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x4843ec){if(_0x4843ec){_0x5c6cfd=_0x4843ec[_0x1bcd('0x32')];if(!_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0xe7c08c[_0x1bcd('0x1c')]=qs['limit'](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x1c')]);_0xe7c08c[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x1f147b['query']['offset']);}return _0x584692['getContacts'](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x417599){if(_0x417599){return _0x417599?{'count':_0x5c6cfd,'rows':_0x417599}:null;}})[_0x1bcd('0x23')](respondWithResult(_0x5d6280,null))[_0x1bcd('0x3e')](handleError(_0x5d6280,null));}; \ No newline at end of file +var _0x9f5b=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','stack','name','index','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','addContacts','CmContact','ids','findOne','map','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash'];(function(_0x168bf8,_0xb7f2bc){var _0x271322=function(_0x3e30b6){while(--_0x3e30b6){_0x168bf8['push'](_0x168bf8['shift']());}};_0x271322(++_0xb7f2bc);}(_0x9f5b,0x18c));var _0xb9f5=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x9f5b[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb9f5('0x0'));var jsonpatch=require(_0xb9f5('0x1'));var rp=require(_0xb9f5('0x2'));var moment=require(_0xb9f5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb9f5('0x4'));var path=require('path');var sox=require(_0xb9f5('0x5'));var csv=require(_0xb9f5('0x6'));var ejs=require(_0xb9f5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9f5('0x8'));var squel=require(_0xb9f5('0x9'));var crypto=require(_0xb9f5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb9f5('0xb'));var toCsv=require(_0xb9f5('0x6'));var querystring=require(_0xb9f5('0xc'));var Papa=require(_0xb9f5('0xd'));var Redis=require('ioredis');var authService=require(_0xb9f5('0xe'));var qs=require(_0xb9f5('0xf'));var as=require(_0xb9f5('0x10'));var hardwareService=require(_0xb9f5('0x11'));var logger=require(_0xb9f5('0x12'))('api');var utils=require(_0xb9f5('0x13'));var config=require(_0xb9f5('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb29c63,_0x22784e){_0x22784e=_0x22784e||0xcc;return function(_0x400dce){if(_0x400dce){return _0xb29c63[_0xb9f5('0x15')](_0x22784e);}return _0xb29c63['status'](_0x22784e)[_0xb9f5('0x16')]();};}function respondWithResult(_0x39190f,_0x963a51){_0x963a51=_0x963a51||0xc8;return function(_0xf9bc23){if(_0xf9bc23){return _0x39190f['status'](_0x963a51)[_0xb9f5('0x17')](_0xf9bc23);}};}function respondWithFilteredResult(_0x12c688,_0x2341f5){return function(_0x474865){if(_0x474865){var _0x57f1c0=typeof _0x2341f5[_0xb9f5('0x18')]===_0xb9f5('0x19')&&typeof _0x2341f5[_0xb9f5('0x1a')]===_0xb9f5('0x19');var _0x207175=_0x474865['count'];var _0x4453f7=_0x57f1c0?0x0:_0x2341f5['offset'];var _0x1aa200=_0x57f1c0?_0x474865[_0xb9f5('0x1b')]:_0x2341f5[_0xb9f5('0x18')]+_0x2341f5[_0xb9f5('0x1a')];var _0x57a7e4;if(_0x1aa200>=_0x207175){_0x1aa200=_0x207175;_0x57a7e4=0xc8;}else{_0x57a7e4=0xce;}_0x12c688[_0xb9f5('0x1c')](_0x57a7e4);return _0x12c688[_0xb9f5('0x1d')](_0xb9f5('0x1e'),_0x4453f7+'-'+_0x1aa200+'/'+_0x207175)[_0xb9f5('0x17')](_0x474865);}return null;};}function patchUpdates(_0x4cc32d){return function(_0x37065d){try{jsonpatch[_0xb9f5('0x1f')](_0x37065d,_0x4cc32d,!![]);}catch(_0x25b2bb){return BPromise[_0xb9f5('0x20')](_0x25b2bb);}return _0x37065d[_0xb9f5('0x21')]();};}function saveUpdates(_0x3af981,_0x2f0284){return function(_0x148f1d){if(_0x148f1d){return _0x148f1d[_0xb9f5('0x22')](_0x3af981)[_0xb9f5('0x23')](function(_0x65f2c3){return _0x65f2c3;});}return null;};}function removeEntity(_0x5ca233,_0x36c7e8){return function(_0x3893e0){if(_0x3893e0){return _0x3893e0['destroy']()[_0xb9f5('0x23')](function(){var _0x1959c3=_0x3893e0[_0xb9f5('0x24')]({'plain':!![]});var _0x3c9928=_0xb9f5('0x25');return db[_0xb9f5('0x26')][_0xb9f5('0x27')]({'where':{'type':_0x3c9928,'resourceId':_0x1959c3['id']}})[_0xb9f5('0x23')](function(){return _0x3893e0;});})['then'](function(){_0x5ca233[_0xb9f5('0x1c')](0xcc)[_0xb9f5('0x16')]();});}};}function handleEntityNotFound(_0x51c325,_0x3bf30d){return function(_0x36c1b3){if(!_0x36c1b3){_0x51c325[_0xb9f5('0x15')](0x194);}return _0x36c1b3;};}function handleError(_0x2b22fa,_0x51b395){_0x51b395=_0x51b395||0x1f4;return function(_0x3be2fd){logger['error'](_0x3be2fd[_0xb9f5('0x28')]);if(_0x3be2fd[_0xb9f5('0x29')]){delete _0x3be2fd[_0xb9f5('0x29')];}_0x2b22fa[_0xb9f5('0x1c')](_0x51b395)['send'](_0x3be2fd);};}exports[_0xb9f5('0x2a')]=function(_0x5dd809,_0x4cbd76){var _0x17688b={},_0x35f630={},_0x4e446e={'count':0x0,'rows':[]};return db[_0xb9f5('0x2b')][_0xb9f5('0x2c')]()[_0xb9f5('0x23')](function(_0x421375){_0x35f630[_0xb9f5('0x2d')]=_['keys'](_0x421375);_0x35f630[_0xb9f5('0x2e')]=_[_0xb9f5('0x2f')](_0x5dd809[_0xb9f5('0x2e')]);_0x35f630[_0xb9f5('0x30')]=_['intersection'](_0x35f630['model'],_0x35f630[_0xb9f5('0x2e')]);_0x17688b[_0xb9f5('0x31')]=_[_0xb9f5('0x32')](_0x35f630[_0xb9f5('0x2d')],qs[_0xb9f5('0x33')](_0x5dd809['query']['fields']));_0x17688b[_0xb9f5('0x31')]=_0x17688b['attributes'][_0xb9f5('0x34')]?_0x17688b['attributes']:_0x35f630[_0xb9f5('0x2d')];if(!_0x5dd809['query'][_0xb9f5('0x35')](_0xb9f5('0x36'))){_0x17688b[_0xb9f5('0x1a')]=qs[_0xb9f5('0x1a')](_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x1a')]);_0x17688b['offset']=qs[_0xb9f5('0x18')](_0x5dd809['query'][_0xb9f5('0x18')]);}_0x17688b[_0xb9f5('0x37')]=qs[_0xb9f5('0x38')](_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x38')]);_0x17688b[_0xb9f5('0x39')]=qs['filters'](_[_0xb9f5('0x3a')](_0x5dd809['query'],_0x35f630[_0xb9f5('0x30')]),_0x421375);if(_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3b')]){_0x17688b['where']=_[_0xb9f5('0x3c')](_0x17688b[_0xb9f5('0x39')],{'$or':_['map'](_0x17688b['attributes'],function(_0x3b2ef1){var _0x4b1a1b={};_0x4b1a1b[_0x3b2ef1]={'$like':'%'+_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3b')]+'%'};return _0x4b1a1b;})});}_0x17688b=_[_0xb9f5('0x3c')]({},_0x17688b,_0x5dd809[_0xb9f5('0x3d')]);var _0x20f1b8={'where':_0x17688b[_0xb9f5('0x39')]};return db['CmCompany']['count'](_0x20f1b8)[_0xb9f5('0x23')](function(_0xe0d125){_0x4e446e[_0xb9f5('0x1b')]=_0xe0d125;if(_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3e')]){_0x17688b[_0xb9f5('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0xb9f5('0x40')](_0x17688b);})['then'](function(_0x42d1bf){_0x4e446e['rows']=_0x42d1bf;return _0x4e446e;})[_0xb9f5('0x23')](respondWithFilteredResult(_0x4cbd76,_0x17688b))[_0xb9f5('0x41')](handleError(_0x4cbd76,null));})[_0xb9f5('0x41')](handleError(_0x4cbd76,null));};exports['show']=function(_0x1dc586,_0x570eaf){var _0xa6eaea={'raw':![],'where':{'id':_0x1dc586[_0xb9f5('0x42')]['id']}},_0x2b93cc={};_0x2b93cc['model']=_['keys'](db['CmCompany']['rawAttributes']);_0x2b93cc[_0xb9f5('0x2e')]=_[_0xb9f5('0x2f')](_0x1dc586[_0xb9f5('0x2e')]);_0x2b93cc[_0xb9f5('0x30')]=_['intersection'](_0x2b93cc[_0xb9f5('0x2d')],_0x2b93cc['query']);_0xa6eaea[_0xb9f5('0x31')]=_['intersection'](_0x2b93cc[_0xb9f5('0x2d')],qs[_0xb9f5('0x33')](_0x1dc586['query'][_0xb9f5('0x33')]));_0xa6eaea[_0xb9f5('0x31')]=_0xa6eaea['attributes']['length']?_0xa6eaea['attributes']:_0x2b93cc['model'];if(_0x1dc586['query'][_0xb9f5('0x3e')]){_0xa6eaea[_0xb9f5('0x3f')]=[{'all':!![]}];}_0xa6eaea=_[_0xb9f5('0x3c')]({},_0xa6eaea,_0x1dc586[_0xb9f5('0x3d')]);return db[_0xb9f5('0x2b')][_0xb9f5('0x43')](_0xa6eaea)[_0xb9f5('0x23')](handleEntityNotFound(_0x570eaf,null))['then'](respondWithResult(_0x570eaf,null))[_0xb9f5('0x41')](handleError(_0x570eaf,null));};exports[_0xb9f5('0x44')]=function(_0x3c79dd,_0x207f29){return db[_0xb9f5('0x2b')][_0xb9f5('0x44')](_0x3c79dd[_0xb9f5('0x45')],{})[_0xb9f5('0x23')](function(_0x8bbb5b){var _0x4765f5=_0x3c79dd[_0xb9f5('0x46')][_0xb9f5('0x24')]({'plain':!![]});if(!_0x4765f5)throw new Error(_0xb9f5('0x47'));if(_0x4765f5[_0xb9f5('0x48')]===_0xb9f5('0x46')){var _0x35f8c8=_0x8bbb5b['get']({'plain':!![]});var _0x1b73f1=_0xb9f5('0x25');return db['UserProfileSection'][_0xb9f5('0x43')]({'where':{'name':_0x1b73f1,'userProfileId':_0x4765f5[_0xb9f5('0x49')]},'raw':!![]})[_0xb9f5('0x23')](function(_0x22bb21){if(_0x22bb21&&_0x22bb21[_0xb9f5('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x35f8c8[_0xb9f5('0x29')],'resourceId':_0x35f8c8['id'],'type':_0x22bb21[_0xb9f5('0x29')],'sectionId':_0x22bb21['id']},{})['then'](function(){return _0x8bbb5b;});}else{return _0x8bbb5b;}})[_0xb9f5('0x41')](function(_0x3473ff){logger[_0xb9f5('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3473ff);throw _0x3473ff;});}return _0x8bbb5b;})['then'](respondWithResult(_0x207f29,0xc9))[_0xb9f5('0x41')](handleError(_0x207f29,null));};exports[_0xb9f5('0x22')]=function(_0x43f9a8,_0x4d9ab2){if(_0x43f9a8['body']['id']){delete _0x43f9a8[_0xb9f5('0x45')]['id'];}return db[_0xb9f5('0x2b')][_0xb9f5('0x43')]({'where':{'id':_0x43f9a8[_0xb9f5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d9ab2,null))['then'](saveUpdates(_0x43f9a8[_0xb9f5('0x45')],null))[_0xb9f5('0x23')](respondWithResult(_0x4d9ab2,null))[_0xb9f5('0x41')](handleError(_0x4d9ab2,null));};exports[_0xb9f5('0x27')]=function(_0x148069,_0x1f97e5){return db['CmCompany'][_0xb9f5('0x43')]({'where':{'id':_0x148069[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x1f97e5,null))[_0xb9f5('0x23')](removeEntity(_0x1f97e5,null))[_0xb9f5('0x41')](handleError(_0x1f97e5,null));};exports[_0xb9f5('0x2c')]=function(_0x27626c,_0x29937e){return db['CmCompany']['describe']()[_0xb9f5('0x23')](respondWithResult(_0x29937e,null))[_0xb9f5('0x41')](handleError(_0x29937e,null));};exports[_0xb9f5('0x4c')]=function(_0x557615,_0x1c438a,_0x55f0b6){return db[_0xb9f5('0x4d')][_0xb9f5('0x43')]({'where':{'id':_0x557615[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x1c438a,null))['then'](function(_0xb89cf){if(_0xb89cf){return _0xb89cf['addContacts'](_0x557615[_0xb9f5('0x45')][_0xb9f5('0x4e')],_['omit'](_0x557615[_0xb9f5('0x45')],[_0xb9f5('0x4e'),'id'])||{});}})[_0xb9f5('0x23')](respondWithResult(_0x1c438a,null))[_0xb9f5('0x41')](handleError(_0x1c438a,null));};exports['getContacts']=function(_0x175fdd,_0x542c6a,_0x42098a){var _0x2955bf={};var _0x3e2504={};var _0x4e3cc3;var _0x40076c;return db[_0xb9f5('0x2b')][_0xb9f5('0x4f')]({'where':{'id':_0x175fdd[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x542c6a,null))['then'](function(_0x19c139){if(_0x19c139){_0x4e3cc3=_0x19c139;_0x3e2504[_0xb9f5('0x2d')]=_[_0xb9f5('0x2f')](db[_0xb9f5('0x4d')]['rawAttributes']);_0x3e2504['query']=_[_0xb9f5('0x2f')](_0x175fdd['query']);_0x3e2504['filters']=_[_0xb9f5('0x32')](_0x3e2504['model'],_0x3e2504[_0xb9f5('0x2e')]);_0x2955bf[_0xb9f5('0x31')]=_[_0xb9f5('0x32')](_0x3e2504['model'],qs[_0xb9f5('0x33')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x33')]));_0x2955bf[_0xb9f5('0x31')]=_0x2955bf[_0xb9f5('0x31')]['length']?_0x2955bf['attributes']:_0x3e2504[_0xb9f5('0x2d')];_0x2955bf[_0xb9f5('0x37')]=qs[_0xb9f5('0x38')](_0x175fdd['query']['sort']);_0x2955bf['where']=qs['filters'](_[_0xb9f5('0x3a')](_0x175fdd[_0xb9f5('0x2e')],_0x3e2504['filters']));if(_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x3b')]){_0x2955bf[_0xb9f5('0x39')]=_[_0xb9f5('0x3c')](_0x2955bf[_0xb9f5('0x39')],{'$or':_[_0xb9f5('0x50')](_0x2955bf[_0xb9f5('0x31')],function(_0x406eff){var _0x517880={};_0x517880[_0x406eff]={'$like':'%'+_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x3b')]+'%'};return _0x517880;})});}_0x2955bf=_[_0xb9f5('0x3c')]({},_0x2955bf,_0x175fdd[_0xb9f5('0x3d')]);return _0x4e3cc3['getContacts'](_0x2955bf);}})['then'](function(_0x2b6252){if(_0x2b6252){_0x40076c=_0x2b6252[_0xb9f5('0x34')];if(!_0x175fdd[_0xb9f5('0x2e')]['hasOwnProperty'](_0xb9f5('0x36'))){_0x2955bf[_0xb9f5('0x1a')]=qs[_0xb9f5('0x1a')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x1a')]);_0x2955bf['offset']=qs[_0xb9f5('0x18')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x18')]);}return _0x4e3cc3['getContacts'](_0x2955bf);}})[_0xb9f5('0x23')](function(_0x254e45){if(_0x254e45){return _0x254e45?{'count':_0x40076c,'rows':_0x254e45}:null;}})[_0xb9f5('0x23')](respondWithResult(_0x542c6a,null))['catch'](handleError(_0x542c6a,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 9cfea6a..ff53a95 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 _0xee20=['api','moment','request-promise','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x1b7523,_0x51b4e9){var _0x1dc12e=function(_0x2573f3){while(--_0x2573f3){_0x1b7523['push'](_0x1b7523['shift']());}};_0x1dc12e(++_0x51b4e9);}(_0xee20,0x18a));var _0x0ee2=function(_0x999162,_0x289750){_0x999162=_0x999162-0x0;var _0x4f899a=_0xee20[_0x999162];return _0x4f899a;};'use strict';var _=require(_0x0ee2('0x0'));var util=require(_0x0ee2('0x1'));var logger=require('../../config/logger')(_0x0ee2('0x2'));var moment=require(_0x0ee2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ee2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ee2('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ee2('0x6'));module[_0x0ee2('0x7')]=function(_0x21f993,_0x583cfe){return _0x21f993[_0x0ee2('0x8')](_0x0ee2('0x9'),attributes,{'tableName':_0x0ee2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d8c=['./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0x7d8c,0x7d));var _0xc7d8=function(_0x54b0df,_0x5d8e9a){_0x54b0df=_0x54b0df-0x0;var _0x5a0872=_0x7d8c[_0x54b0df];return _0x5a0872;};'use strict';var _=require('lodash');var util=require(_0xc7d8('0x0'));var logger=require(_0xc7d8('0x1'))(_0xc7d8('0x2'));var moment=require(_0xc7d8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7d8('0x4'));var rimraf=require(_0xc7d8('0x5'));var config=require(_0xc7d8('0x6'));var attributes=require(_0xc7d8('0x7'));module[_0xc7d8('0x8')]=function(_0x1c1dfd,_0x228f38){return _0x1c1dfd[_0xc7d8('0x9')](_0xc7d8('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 e87fe5b..de23667 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 _0xde9b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmCompany,\x20%s,\x20%s'];(function(_0x5dbd29,_0xc9dd40){var _0x577f92=function(_0x42b53c){while(--_0x42b53c){_0x5dbd29['push'](_0x5dbd29['shift']());}};_0x577f92(++_0xc9dd40);}(_0xde9b,0xc9));var _0xbde9=function(_0x460e6d,_0x26bbf9){_0x460e6d=_0x460e6d-0x0;var _0x288333=_0xde9b[_0x460e6d];return _0x288333;};'use strict';var _=require(_0xbde9('0x0'));var util=require(_0xbde9('0x1'));var moment=require(_0xbde9('0x2'));var BPromise=require(_0xbde9('0x3'));var rs=require(_0xbde9('0x4'));var fs=require('fs');var Redis=require(_0xbde9('0x5'));var db=require(_0xbde9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbde9('0x8'));var client=jayson[_0xbde9('0x9')][_0xbde9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe64b86,_0x298185,_0x3760b7){return new BPromise(function(_0x4aacb0,_0x257d52){return client[_0xbde9('0xb')](_0xe64b86,_0x3760b7)[_0xbde9('0xc')](function(_0x3b9036){logger[_0xbde9('0xd')]('CmCompany,\x20%s,\x20%s',_0x298185,_0xbde9('0xe'));logger[_0xbde9('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x298185,'request\x20sent',JSON[_0xbde9('0x10')](_0x3b9036));if(_0x3b9036['error']){if(_0x3b9036['error']['code']===0x1f4){logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x257d52(_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);}logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x4aacb0(_0x3b9036[_0xbde9('0x11')]['message']);}else{logger[_0xbde9('0xd')](_0xbde9('0x12'),_0x298185,_0xbde9('0xe'));_0x4aacb0(_0x3b9036[_0xbde9('0x14')]['message']);}})[_0xbde9('0x15')](function(_0x439187){logger[_0xbde9('0x11')]('CmCompany,\x20%s,\x20%s',_0x298185,_0x439187);_0x257d52(_0x439187);});});} \ No newline at end of file +var _0xea41=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','error','code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x25e430,_0xa18ab6){var _0x286e8b=function(_0x4a734a){while(--_0x4a734a){_0x25e430['push'](_0x25e430['shift']());}};_0x286e8b(++_0xa18ab6);}(_0xea41,0x104));var _0x1ea4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xea41[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1ea4('0x0'));var util=require(_0x1ea4('0x1'));var moment=require(_0x1ea4('0x2'));var BPromise=require(_0x1ea4('0x3'));var rs=require(_0x1ea4('0x4'));var fs=require('fs');var Redis=require(_0x1ea4('0x5'));var db=require(_0x1ea4('0x6'))['db'];var utils=require(_0x1ea4('0x7'));var logger=require(_0x1ea4('0x8'))(_0x1ea4('0x9'));var config=require(_0x1ea4('0xa'));var jayson=require(_0x1ea4('0xb'));var client=jayson[_0x1ea4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337753,_0x4d6f72,_0x4e4cc0){return new BPromise(function(_0x8c7e6,_0x350d38){return client[_0x1ea4('0xd')](_0x337753,_0x4e4cc0)[_0x1ea4('0xe')](function(_0x345ede){logger['info']('CmCompany,\x20%s,\x20%s',_0x4d6f72,_0x1ea4('0xf'));logger[_0x1ea4('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4d6f72,_0x1ea4('0xf'),JSON['stringify'](_0x345ede));if(_0x345ede[_0x1ea4('0x11')]){if(_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x12')]===0x1f4){logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x14')]);return _0x350d38(_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x14')]);}logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x345ede['error'][_0x1ea4('0x14')]);return _0x8c7e6(_0x345ede['error'][_0x1ea4('0x14')]);}else{logger[_0x1ea4('0x15')](_0x1ea4('0x13'),_0x4d6f72,_0x1ea4('0xf'));_0x8c7e6(_0x345ede[_0x1ea4('0x16')][_0x1ea4('0x14')]);}})[_0x1ea4('0x17')](function(_0x2d2155){logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x2d2155);_0x350d38(_0x2d2155);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 50b3cd8..d32190e 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 _0x06a7=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06a7,0x18f));var _0x706a=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x06a7[_0x2e2d89];return _0x3aba90;};'use strict';var multer=require(_0x706a('0x0'));var util=require(_0x706a('0x1'));var path=require(_0x706a('0x2'));var timeout=require('connect-timeout');var express=require(_0x706a('0x3'));var router=express[_0x706a('0x4')]();var fs_extra=require(_0x706a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x706a('0x6'));var controller=require(_0x706a('0x7'));router[_0x706a('0x8')]('/',auth[_0x706a('0x9')](),controller[_0x706a('0xa')]);router[_0x706a('0x8')](_0x706a('0xb'),auth[_0x706a('0x9')](),controller[_0x706a('0xc')]);router[_0x706a('0x8')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0xe')]);router[_0x706a('0x8')](_0x706a('0xf'),auth[_0x706a('0x9')](),controller[_0x706a('0x10')]);router[_0x706a('0x11')]('/',auth[_0x706a('0x9')](),controller['create']);router[_0x706a('0x11')](_0x706a('0xf'),auth['isAuthenticated'](),controller[_0x706a('0x12')]);router[_0x706a('0x13')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0x14')]);router[_0x706a('0x15')](_0x706a('0xd'),auth['isAuthenticated'](),controller[_0x706a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd634=['index','/describe','/:id/contacts','post','addContacts','put','/:id','update','delete','exports','util','path','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xd634,0xf4));var _0x4d63=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd634[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require('multer');var util=require(_0x4d63('0x0'));var path=require(_0x4d63('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d63('0x2')]();var fs_extra=require(_0x4d63('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d63('0x4'));var controller=require(_0x4d63('0x5'));router[_0x4d63('0x6')]('/',auth[_0x4d63('0x7')](),controller[_0x4d63('0x8')]);router[_0x4d63('0x6')](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4d63('0x6')](_0x4d63('0xa'),auth[_0x4d63('0x7')](),controller['getContacts']);router[_0x4d63('0xb')]('/',auth[_0x4d63('0x7')](),controller['create']);router['post'](_0x4d63('0xa'),auth['isAuthenticated'](),controller[_0x4d63('0xc')]);router[_0x4d63('0xd')](_0x4d63('0xe'),auth[_0x4d63('0x7')](),controller[_0x4d63('0xf')]);router[_0x4d63('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4d63('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index fdc612c..f5571fc 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 _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x1fc9da,_0x2675d5){var _0x52065c=function(_0x488ad1){while(--_0x488ad1){_0x1fc9da['push'](_0x1fc9da['shift']());}};_0x52065c(++_0x2675d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x614c88,_0x184f02){_0x614c88=_0x614c88-0x0;var _0x1a768e=_0xb10b[_0x614c88];return _0x1a768e;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0x371f33,_0x278a69){var _0x246c96=function(_0x4f8bad){while(--_0x4f8bad){_0x371f33['push'](_0x371f33['shift']());}};_0x246c96(++_0x278a69);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index cb6b498..42dde2b 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 _0x5aad=['FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','each','duplicates','$or','findOrCreate','Tag','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','join','root','server/files/tmp','file','filename','0777','CompanyId','pid','createReadStream','parse','meta','binding','firstName','No\x20firstName\x20column\x20specified','fork','stringify','message','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','voice','resolve','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','findAndCountAll','startCase','secondDisposition','UserId','Account','Owner','fullname','color','chat','customerPort','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','all','flatten','sortBy','reverse','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','end','error','stack','name','send','describe','keys','startsWith','cf_','push','findOne','trimStart','fieldType','type','model','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','union','and','datetime','castTo','buildExpression','text','start','hasOwnProperty','isNil','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','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.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','clone','DESC','isEmpty','having','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','fields','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','CmContact','params','tags','columnName','analytics','CmCustomField','findAll','displayName','alias','custom','values','body','get','mergeWith','isArray','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','MailMessage','MailInteraction','SmsInteraction'];(function(_0x38fae4,_0x2f54ce){var _0x5d0c95=function(_0x4d10ef){while(--_0x4d10ef){_0x38fae4['push'](_0x38fae4['shift']());}};_0x5d0c95(++_0x2f54ce);}(_0x5aad,0x78));var _0xd5aa=function(_0x1c6bbd,_0x467c08){_0x1c6bbd=_0x1c6bbd-0x0;var _0x3cd37f=_0x5aad[_0x1c6bbd];return _0x3cd37f;};'use strict';var moment=require('moment');var BPromise=require(_0xd5aa('0x0'));var util=require(_0xd5aa('0x1'));var path=require(_0xd5aa('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd5aa('0x3'));var Papa=require(_0xd5aa('0x4'));var Redis=require(_0xd5aa('0x5'));var qs=require(_0xd5aa('0x6'));var as=require(_0xd5aa('0x7'));var logger=require('../../config/logger')(_0xd5aa('0x8'));var config=require(_0xd5aa('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd5aa('0xa')],{'host':_0xd5aa('0xb'),'port':0x18eb});var socket=require(_0xd5aa('0xc'))(new Redis(config[_0xd5aa('0xa')]));require('./cmContact.socket')[_0xd5aa('0xd')](socket);function respondWithResult(_0x517276,_0x330a91){_0x330a91=_0x330a91||0xc8;return function(_0x50fc8c){if(_0x50fc8c){return _0x517276[_0xd5aa('0xe')](_0x330a91)[_0xd5aa('0xf')](_0x50fc8c);}};}function respondWithFilteredResult(_0x46c1f8,_0x2742c4){return function(_0xaa05f1){if(_0xaa05f1){var _0x60e879=typeof _0x2742c4[_0xd5aa('0x10')]===_0xd5aa('0x11')&&typeof _0x2742c4['limit']===_0xd5aa('0x11');var _0x55689a=_0xaa05f1[_0xd5aa('0x12')];var _0x19f4ad=_0x60e879?0x0:_0x2742c4[_0xd5aa('0x10')];var _0x2e2a42=_0x60e879?_0xaa05f1[_0xd5aa('0x12')]:_0x2742c4['offset']+_0x2742c4[_0xd5aa('0x13')];var _0x59d7fd;if(_0x2e2a42>=_0x55689a){_0x2e2a42=_0x55689a;_0x59d7fd=0xc8;}else{_0x59d7fd=0xce;}_0x46c1f8['status'](_0x59d7fd);return _0x46c1f8['set'](_0xd5aa('0x14'),_0x19f4ad+'-'+_0x2e2a42+'/'+_0x55689a)['json'](_0xaa05f1);}return null;};}function saveUpdates(_0x3db918){return function(_0x5b34a3){if(_0x5b34a3){return _0x5b34a3[_0xd5aa('0x15')](_0x3db918)[_0xd5aa('0x16')](function(_0x25845d){return _0x25845d;});}return null;};}function removeEntity(_0x4d75e4){return function(_0x2d91f4){if(_0x2d91f4){return _0x2d91f4[_0xd5aa('0x17')]()[_0xd5aa('0x16')](function(){_0x4d75e4[_0xd5aa('0xe')](0xcc)[_0xd5aa('0x18')]();});}};}function handleEntityNotFound(_0x374df7){return function(_0x422e36){if(!_0x422e36){_0x374df7['sendStatus'](0x194);}return _0x422e36;};}function handleError(_0x3561d2,_0x48dfe9){_0x48dfe9=_0x48dfe9||0x1f4;return function(_0x501c7a){logger[_0xd5aa('0x19')](_0x501c7a[_0xd5aa('0x1a')]);if(_0x501c7a[_0xd5aa('0x1b')]){delete _0x501c7a['name'];}_0x3561d2[_0xd5aa('0xe')](_0x48dfe9)[_0xd5aa('0x1c')](_0x501c7a);};}exports['index']=function(_0xaa96e5,_0x2d8dcd){var _0x5a1d78={},_0x30a9d8={},_0x76b080={'count':0x0,'rows':[]};return db['CmContact'][_0xd5aa('0x1d')]()[_0xd5aa('0x16')](function(_0x713539){var _0x5b5bf2=[];for(var _0x18c1a3=0x0;_0x18c1a30x1){_0x307057['or'](_0xd5aa('0x57'),qs[_0xd5aa('0x58')](_0x14d073),null);}else{if(qs[_0xd5aa('0x59')](_0x14d073)){_0x307057['or'](_0xd5aa('0x5a'),_0x14d073+'%');_0x307057['or'](_0xd5aa('0x5b'),_0x14d073+'%');_0x307057['or'](_0xd5aa('0x5c'),_0x14d073+'%');_0x307057['or']('c.fax\x20LIKE\x20?',_0x14d073+'%');}else if(qs[_0xd5aa('0x5d')](_0x14d073)){_0x307057['or'](_0xd5aa('0x5e'),_0x14d073+'%');}else{_0x307057['or']('c.firstName\x20LIKE\x20?','%'+_0x14d073+'%');_0x307057['or'](_0xd5aa('0x5f'),'%'+_0x14d073+'%');_0x307057['or'](_0xd5aa('0x5e'),'%'+_0x14d073+'%');}}}}_0x32a592[_0xd5aa('0x2f')](_0x307057);_0x32a592[_0xd5aa('0x60')](_0xd5aa('0x61'));var _0x23a788={'type':db[_0xd5aa('0x62')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3ca504=_0x32a592[_0xd5aa('0x63')]()[_0xd5aa('0x32')](_0xd5aa('0x61'));if(_0x5a1d78[_0xd5aa('0x2d')]){_0x5a1d78[_0xd5aa('0x2d')][_0xd5aa('0x45')](function(_0x17c6ec){_0x32a592[_0xd5aa('0x2d')]('c.'+_0x17c6ec[0x0],_0x17c6ec[0x1]===_0xd5aa('0x64')?![]:!![]);});}if(!_[_0xd5aa('0x65')](_0x33f4d4)){_0x32a592[_0xd5aa('0x66')](_0x552169);_0x3ca504['where']('t.id\x20IN\x20?',_0x33f4d4);}BPromise['resolve']()[_0xd5aa('0x16')](function(){if(!_0x292baa)return;if(_0xaa96e5[_0xd5aa('0x67')][_0xd5aa('0x68')]!==_0xd5aa('0x69'))return;if(!_[_0xd5aa('0x6a')](_0x292baa[_0xd5aa('0x40')],[_0xd5aa('0x32'),_0xd5aa('0x6b')])){return _0xaa96e5[_0xd5aa('0x67')][_0xd5aa('0x6c')]({'attributes':['id'],'raw':!![]})[_0xd5aa('0x16')](function(_0x3b36b3){if(_[_0xd5aa('0x65')](_0x3b36b3)){_0x3ca504['where'](_0xd5aa('0x6d'));_0x32a592[_0xd5aa('0x2f')](_0xd5aa('0x6d'));}else{_0x3ca504[_0xd5aa('0x2f')](_0xd5aa('0x50'),_[_0xd5aa('0x44')](_0x3b36b3,'id'));_0x32a592[_0xd5aa('0x2f')](_0xd5aa('0x50'),_[_0xd5aa('0x44')](_0x3b36b3,'id'));}});}})['then'](function(){if(_0xaa96e5['user']['role']===_0xd5aa('0x69')&&!_0x292baa&&!_0xaa96e5['query'][_0xd5aa('0x6e')])return[];return db[_0xd5aa('0x6f')]['query'](_0x3ca504[_0xd5aa('0x70')](),_0x23a788);})[_0xd5aa('0x16')](function(_0x56ec91){_0x76b080[_0xd5aa('0x12')]=_0x56ec91[_0xd5aa('0x2b')];if(_0x76b080[_0xd5aa('0x12')]===0x0)return[];return db[_0xd5aa('0x6f')][_0xd5aa('0x27')](_0x5cfe32[_0xd5aa('0x70')](),_0x23a788)[_0xd5aa('0x16')](function(_0x1cb83e){_0x1f0c1d=_[_0xd5aa('0x71')](_0x1cb83e,'id');_0x23a788=_[_0xd5aa('0x72')](_0x23a788,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xaa96e5[_0xd5aa('0x27')][_0xd5aa('0x73')]){_0x5a1d78['attributes'][_0xd5aa('0x45')](function(_0x4cdcd8){_0x32a592[_0xd5aa('0x32')]('c.'+_0x4cdcd8);});}else{_0x32a592['field'](_0xd5aa('0x61'));_0x32a592['field']('c.firstName');_0x32a592['field'](_0xd5aa('0x74'));_0x32a592['field'](_0xd5aa('0x75'));_0x32a592['field']('c.mobile');_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x76'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x77'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x78'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x79'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x7a'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x7b'));_0x32a592[_0xd5aa('0x32')](_0xd5aa('0x7c'),'TagIds');}if(_0x5a1d78['limit'])_0x32a592[_0xd5aa('0x13')](_0x5a1d78[_0xd5aa('0x13')]);if(_0x5a1d78[_0xd5aa('0x10')])_0x32a592[_0xd5aa('0x10')](_0x5a1d78[_0xd5aa('0x10')]);return db['sequelize']['query'](_0x32a592[_0xd5aa('0x70')](),_0x23a788);});})[_0xd5aa('0x16')](function(_0x3690ed){_0x3690ed[_0xd5aa('0x45')](function(_0x25f846){if(_0x25f846[_0xd5aa('0x7d')]){_0x25f846[_0xd5aa('0x7e')]=[];_0x25f846[_0xd5aa('0x7d')]['split'](',')[_0xd5aa('0x45')](function(_0x508ac9){_0x25f846[_0xd5aa('0x7e')][_0xd5aa('0x21')](_0x1f0c1d[_0x508ac9]);});}delete _0x25f846['TagIds'];});_0x76b080[_0xd5aa('0x7f')]=_0x3690ed;return _0x76b080;})['then'](respondWithFilteredResult(_0x2d8dcd,_0x5a1d78));})[_0xd5aa('0x80')](handleError(_0x2d8dcd,null));};exports[_0xd5aa('0x17')]=function(_0x4ad95e,_0x2e1de7){return db[_0xd5aa('0x81')]['find']({'where':{'id':_0x4ad95e[_0xd5aa('0x82')]['id']}})[_0xd5aa('0x16')](handleEntityNotFound(_0x2e1de7,null))[_0xd5aa('0x16')](removeEntity(_0x2e1de7,null))[_0xd5aa('0x80')](handleError(_0x2e1de7,null));};exports[_0xd5aa('0x1d')]=function(_0x5364be,_0x33b419){return db[_0xd5aa('0x81')]['describe']()[_0xd5aa('0x16')](function(_0xb34cb){delete _0xb34cb[_0xd5aa('0x83')];for(var _0xb0a6be=0x0;_0xb0a6be=_0x2d8eb3){_0x3b36bb=_0x2d8eb3;_0x4812a2=0xc8;}else{_0x4812a2=0xce;}_0x1163e0['status'](_0x4812a2);return _0x1163e0[_0x1597('0x16')]('Content-Range',_0x3b58eb+'-'+_0x3b36bb+'/'+_0x2d8eb3)['json'](_0xae7b8b);}return null;};}function saveUpdates(_0x23bd6b){return function(_0x3764b9){if(_0x3764b9){return _0x3764b9[_0x1597('0x17')](_0x23bd6b)[_0x1597('0x18')](function(_0x489569){return _0x489569;});}return null;};}function removeEntity(_0x4b79e0){return function(_0x4a9f65){if(_0x4a9f65){return _0x4a9f65[_0x1597('0x19')]()[_0x1597('0x18')](function(){_0x4b79e0[_0x1597('0x11')](0xcc)[_0x1597('0x1a')]();});}};}function handleEntityNotFound(_0x484934){return function(_0x134d7b){if(!_0x134d7b){_0x484934[_0x1597('0x1b')](0x194);}return _0x134d7b;};}function handleError(_0xb436e6,_0x16cf8d){_0x16cf8d=_0x16cf8d||0x1f4;return function(_0x413af6){logger[_0x1597('0x1c')](_0x413af6['stack']);if(_0x413af6['name']){delete _0x413af6[_0x1597('0x1d')];}_0xb436e6[_0x1597('0x11')](_0x16cf8d)['send'](_0x413af6);};}exports['index']=function(_0x124f2c,_0x80f68d){var _0x57759e={},_0x2a04b2={},_0x54de6c={'count':0x0,'rows':[]};return db[_0x1597('0x1e')]['describe']()[_0x1597('0x18')](function(_0x973ec0){var _0x3f14f3=[];for(var _0x5aef3a=0x0;_0x5aef3a0x1){_0x4ba674['or'](_0x1597('0x5c'),qs['getFullTextValue'](_0x106008),null);}else{if(qs[_0x1597('0x5d')](_0x106008)){_0x4ba674['or'](_0x1597('0x5e'),_0x106008+'%');_0x4ba674['or'](_0x1597('0x5f'),_0x106008+'%');_0x4ba674['or'](_0x1597('0x60'),_0x106008+'%');_0x4ba674['or'](_0x1597('0x61'),_0x106008+'%');}else if(qs[_0x1597('0x62')](_0x106008)){_0x4ba674['or']('c.email\x20LIKE\x20?',_0x106008+'%');}else{_0x4ba674['or'](_0x1597('0x63'),'%'+_0x106008+'%');_0x4ba674['or']('c.lastName\x20LIKE\x20?','%'+_0x106008+'%');_0x4ba674['or'](_0x1597('0x64'),'%'+_0x106008+'%');}}}}_0x4eb4c7[_0x1597('0x3c')](_0x4ba674);_0x4eb4c7[_0x1597('0x65')](_0x1597('0x66'));var _0x2f6e2d={'type':db[_0x1597('0x67')]['QueryTypes'][_0x1597('0x68')],'raw':!![]};var _0x116a07=_0x4eb4c7[_0x1597('0x69')]()['field']('c.id');if(_0x57759e[_0x1597('0x6a')]){_0x57759e[_0x1597('0x6a')][_0x1597('0x43')](function(_0x5159b2){_0x4eb4c7[_0x1597('0x6a')]('c.'+_0x5159b2[0x0],_0x5159b2[0x1]===_0x1597('0x6b')?![]:!![]);});}if(!_[_0x1597('0x52')](_0x51f160)){_0x4eb4c7[_0x1597('0x6c')](_0x555881);_0x116a07[_0x1597('0x3c')]('t.id\x20IN\x20?',_0x51f160);}BPromise[_0x1597('0x6d')]()['then'](function(){if(!_0x4c2220)return;if(_0x124f2c[_0x1597('0x6e')]['role']!=='agent')return;if(!_[_0x1597('0x6f')](_0x4c2220[_0x1597('0x40')],[_0x1597('0x32'),_0x1597('0x45')])){return _0x124f2c[_0x1597('0x6e')]['getLists']({'attributes':['id'],'raw':!![]})[_0x1597('0x18')](function(_0x2726b6){if(_[_0x1597('0x52')](_0x2726b6)){_0x116a07[_0x1597('0x3c')](_0x1597('0x70'));_0x4eb4c7[_0x1597('0x3c')](_0x1597('0x70'));}else{_0x116a07['where'](_0x1597('0x53'),_[_0x1597('0x71')](_0x2726b6,'id'));_0x4eb4c7['where']('c.ListId\x20IN\x20?',_[_0x1597('0x71')](_0x2726b6,'id'));}});}})[_0x1597('0x18')](function(){if(_0x124f2c[_0x1597('0x6e')]['role']==='agent'&&!_0x4c2220&&!_0x124f2c[_0x1597('0x2a')][_0x1597('0x72')])return[];return db[_0x1597('0x73')][_0x1597('0x2a')](_0x116a07[_0x1597('0x74')](),_0x2f6e2d);})[_0x1597('0x18')](function(_0x1f40b8){_0x54de6c[_0x1597('0x75')]=_0x1f40b8[_0x1597('0x1f')];if(_0x54de6c[_0x1597('0x75')]===0x0)return[];return db[_0x1597('0x73')][_0x1597('0x2a')](_0x2f4b80['toString'](),_0x2f6e2d)['then'](function(_0x241f8e){_0x1e1a2e=_[_0x1597('0x76')](_0x241f8e,'id');_0x2f6e2d=_[_0x1597('0x77')](_0x2f6e2d,{'model':db[_0x1597('0x1e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x124f2c[_0x1597('0x2a')][_0x1597('0x2e')]){_0x57759e['attributes'][_0x1597('0x43')](function(_0x29f27f){_0x4eb4c7[_0x1597('0x32')]('c.'+_0x29f27f);});}else{_0x4eb4c7['field'](_0x1597('0x66'));_0x4eb4c7['field'](_0x1597('0x78'));_0x4eb4c7[_0x1597('0x32')](_0x1597('0x79'));_0x4eb4c7[_0x1597('0x32')](_0x1597('0x7a'));_0x4eb4c7[_0x1597('0x32')](_0x1597('0x7b'));_0x4eb4c7[_0x1597('0x32')](_0x1597('0x7c'));_0x4eb4c7['field'](_0x1597('0x7d'));_0x4eb4c7['field'](_0x1597('0x7e'));_0x4eb4c7['field'](_0x1597('0x7f'));_0x4eb4c7[_0x1597('0x32')]('c.deletedAt');_0x4eb4c7[_0x1597('0x32')](_0x1597('0x80'));_0x4eb4c7[_0x1597('0x32')](_0x1597('0x81'),'TagIds');}if(_0x57759e[_0x1597('0x15')])_0x4eb4c7['limit'](_0x57759e[_0x1597('0x15')]);if(_0x57759e[_0x1597('0x13')])_0x4eb4c7[_0x1597('0x13')](_0x57759e[_0x1597('0x13')]);return db[_0x1597('0x73')][_0x1597('0x2a')](_0x4eb4c7[_0x1597('0x74')](),_0x2f6e2d);});})['then'](function(_0x49679e){_0x49679e['forEach'](function(_0x385f4d){if(_0x385f4d[_0x1597('0x82')]){_0x385f4d[_0x1597('0x83')]=[];_0x385f4d[_0x1597('0x82')][_0x1597('0x42')](',')[_0x1597('0x43')](function(_0x231078){_0x385f4d[_0x1597('0x83')]['push'](_0x1e1a2e[_0x231078]);});}delete _0x385f4d[_0x1597('0x82')];});_0x54de6c[_0x1597('0x84')]=_0x49679e;return _0x54de6c;})[_0x1597('0x18')](respondWithFilteredResult(_0x80f68d,_0x57759e));})[_0x1597('0x85')](handleError(_0x80f68d,null));};exports[_0x1597('0x19')]=function(_0x3e7849,_0x493722){return db['CmContact'][_0x1597('0x86')]({'where':{'id':_0x3e7849[_0x1597('0x87')]['id']}})[_0x1597('0x18')](handleEntityNotFound(_0x493722,null))[_0x1597('0x18')](removeEntity(_0x493722,null))[_0x1597('0x85')](handleError(_0x493722,null));};exports['describe']=function(_0x128a0a,_0x1285c6){return db[_0x1597('0x1e')][_0x1597('0x88')]()[_0x1597('0x18')](function(_0x53adba){delete _0x53adba[_0x1597('0x89')];for(var _0x3650e5=0x0;_0x3650e5{}\s\\|]/g,'-');_0x1a7080(null,util[_0x100d('0x25')](_0x100d('0x26'),path[_0x100d('0x27')](_0x150eb8[_0x100d('0x23')],path['extname'](_0x150eb8[_0x100d('0x23')])),Date[_0x100d('0x28')](),path['extname'](_0x150eb8[_0x100d('0x23')])));}})});router[_0x100d('0x19')](_0x100d('0x29'),upload[_0x100d('0x2a')](_0x100d('0x2b')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x100d('0x20')]({'destination':function(_0x395ae0,_0x4f0714,_0x325cbc){_0x325cbc(null,path[_0x100d('0x21')](config[_0x100d('0x22')],'server/files/tmp'));},'filename':function(_0x503616,_0x3e81cb,_0x1e7501){_0x3e81cb[_0x100d('0x23')]=_0x3e81cb[_0x100d('0x23')][_0x100d('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e7501(null,util[_0x100d('0x25')](_0x100d('0x26'),path[_0x100d('0x27')](_0x3e81cb['originalname'],path[_0x100d('0x2c')](_0x3e81cb[_0x100d('0x23')])),Date[_0x100d('0x28')](),path[_0x100d('0x2c')](_0x3e81cb['originalname'])));}})});router['post'](_0x100d('0x2d'),upload[_0x100d('0x2a')](_0x100d('0x2b')),controller[_0x100d('0x2e')]);router[_0x100d('0x19')](_0x100d('0x2f'),auth[_0x100d('0x9')](),controller['import']);router['put'](_0x100d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x100d('0x30')]('/:id',auth[_0x100d('0x9')](),controller[_0x100d('0x31')]);module['exports']=router; \ No newline at end of file +var _0xfce9=['now','/csv','file','uploadCsv','join','%s-%s%s','/upload','single','/upload/:id','import','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','getTags','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','/:id/tags','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','basename','extname'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0xfce9,0x16b));var _0x9fce=function(_0x24b13c,_0x3fac12){_0x24b13c=_0x24b13c-0x0;var _0x5980d2=_0xfce9[_0x24b13c];return _0x5980d2;};'use strict';var multer=require(_0x9fce('0x0'));var util=require(_0x9fce('0x1'));var path=require('path');var timeout=require(_0x9fce('0x2'));var express=require(_0x9fce('0x3'));var router=express[_0x9fce('0x4')]();var fs_extra=require(_0x9fce('0x5'));var auth=require(_0x9fce('0x6'));var interaction=require(_0x9fce('0x7'));var config=require(_0x9fce('0x8'));var controller=require('./cmContact.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9fce('0x9')]);router[_0x9fce('0xa')]('/describe',auth[_0x9fce('0xb')](),controller[_0x9fce('0xc')]);router[_0x9fce('0xa')](_0x9fce('0xd'),auth['isAuthenticated'](),controller[_0x9fce('0xe')]);router[_0x9fce('0xa')]('/:id/tags',auth[_0x9fce('0xb')](),controller[_0x9fce('0xf')]);router[_0x9fce('0xa')]('/:id/hoppers',auth[_0x9fce('0xb')](),controller[_0x9fce('0x10')]);router[_0x9fce('0xa')]('/:id/hopper_histories',auth[_0x9fce('0xb')](),controller[_0x9fce('0x11')]);router[_0x9fce('0xa')](_0x9fce('0x12'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x13')]);router[_0x9fce('0xa')]('/:id/jscripty_sessions',auth[_0x9fce('0xb')](),controller[_0x9fce('0x14')]);router[_0x9fce('0xa')]('/:id/journey',auth['isAuthenticated'](),controller[_0x9fce('0x15')]);router[_0x9fce('0x16')](_0x9fce('0x17'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x18')]);router['post']('/',auth[_0x9fce('0xb')](),controller[_0x9fce('0x19')]);router[_0x9fce('0x16')](_0x9fce('0x1a'),auth[_0x9fce('0xb')](),controller['bulkCreate']);router[_0x9fce('0x16')](_0x9fce('0x1b'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x1c')]);var upload=multer({'storage':multer[_0x9fce('0x1d')]({'destination':function(_0x4c8f28,_0x2f797a,_0x4a06da){_0x4a06da(null,path['join'](config[_0x9fce('0x1e')],_0x9fce('0x1f')));},'filename':function(_0x3267eb,_0x89f755,_0x1cb137){_0x89f755['originalname']=_0x89f755[_0x9fce('0x20')][_0x9fce('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1cb137(null,util[_0x9fce('0x22')]('%s-%s%s',path[_0x9fce('0x23')](_0x89f755['originalname'],path[_0x9fce('0x24')](_0x89f755['originalname'])),Date[_0x9fce('0x25')](),path[_0x9fce('0x24')](_0x89f755['originalname'])));}})});router[_0x9fce('0x16')](_0x9fce('0x26'),upload['single'](_0x9fce('0x27')),controller[_0x9fce('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56cc84,_0x4d59e5,_0x4cf68d){_0x4cf68d(null,path[_0x9fce('0x29')](config[_0x9fce('0x1e')],_0x9fce('0x1f')));},'filename':function(_0x5cc28f,_0x52a8b5,_0x49dc7a){_0x52a8b5[_0x9fce('0x20')]=_0x52a8b5[_0x9fce('0x20')][_0x9fce('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x49dc7a(null,util[_0x9fce('0x22')](_0x9fce('0x2a'),path[_0x9fce('0x23')](_0x52a8b5[_0x9fce('0x20')],path[_0x9fce('0x24')](_0x52a8b5[_0x9fce('0x20')])),Date[_0x9fce('0x25')](),path['extname'](_0x52a8b5[_0x9fce('0x20')])));}})});router[_0x9fce('0x16')](_0x9fce('0x2b'),upload[_0x9fce('0x2c')](_0x9fce('0x27')),controller['upload']);router[_0x9fce('0x16')](_0x9fce('0x2d'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x2e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9fce('0x2f')]);router[_0x9fce('0x30')]('/:id',auth[_0x9fce('0xb')](),controller['destroy']);module[_0x9fce('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 157a632..2bc9388 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 _0x893f=['name','STRING','TEXT','long','type','parse','values','stringify','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','alias','setDataValue'];(function(_0xde0c87,_0x122c9e){var _0x27469d=function(_0x34413d){while(--_0x34413d){_0xde0c87['push'](_0xde0c87['shift']());}};_0x27469d(++_0x122c9e);}(_0x893f,0x1da));var _0xf893=function(_0x45523a,_0x2ef861){_0x45523a=_0x45523a-0x0;var _0x2c31d0=_0x893f[_0x45523a];return _0x2c31d0;};'use strict';var Sequelize=require(_0xf893('0x0'));var _=require('lodash');module[_0xf893('0x1')]={'name':{'type':Sequelize[_0xf893('0x2')],'get':function(_0x23a862){return this[_0xf893('0x3')](_0xf893('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x47e86c){this[_0xf893('0x5')](_0xf893('0x4'),_0x47e86c?_0x47e86c:this[_0xf893('0x3')](_0xf893('0x6')));}},'type':{'type':Sequelize[_0xf893('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xf893('0x8')](_0xf893('0x9')),'get':function(){if(this[_0xf893('0x3')](_0xf893('0xa'))==='select'){return JSON[_0xf893('0xb')](this[_0xf893('0x3')](_0xf893('0xc')));}else{return this[_0xf893('0x3')](_0xf893('0xc'));}},'set':function(_0x155103){if(Array['isArray'](_0x155103)){this['setDataValue']('values',JSON[_0xf893('0xd')](_0x155103));}else{this[_0xf893('0x5')]('values',_0x155103);}}},'required':{'type':Sequelize[_0xf893('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf893('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf893('0xf')]('voice')}}; \ No newline at end of file +var _0xa64c=['type','select','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long'];(function(_0x4ece4b,_0x5a6f03){var _0x31bd1b=function(_0x259849){while(--_0x259849){_0x4ece4b['push'](_0x4ece4b['shift']());}};_0x31bd1b(++_0x5a6f03);}(_0xa64c,0xce));var _0xca64=function(_0x537deb,_0x1222af){_0x537deb=_0x537deb-0x0;var _0x404355=_0xa64c[_0x537deb];return _0x404355;};'use strict';var Sequelize=require(_0xca64('0x0'));var _=require(_0xca64('0x1'));module[_0xca64('0x2')]={'name':{'type':Sequelize[_0xca64('0x3')],'get':function(_0x272c53){return this[_0xca64('0x4')](_0xca64('0x5'));}},'alias':{'type':Sequelize[_0xca64('0x6')],'allowNull':![],'set':function(_0x1f78e0){this[_0xca64('0x7')]('alias',_0x1f78e0?_0x1f78e0:this[_0xca64('0x4')]('name'));}},'type':{'type':Sequelize[_0xca64('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xca64('0x8')](_0xca64('0x9')),'get':function(){if(this[_0xca64('0x4')](_0xca64('0xa'))===_0xca64('0xb')){return JSON['parse'](this[_0xca64('0x4')](_0xca64('0xc')));}else{return this[_0xca64('0x4')](_0xca64('0xc'));}},'set':function(_0x58c7fe){if(Array[_0xca64('0xd')](_0x58c7fe)){this['setDataValue'](_0xca64('0xc'),JSON[_0xca64('0xe')](_0x58c7fe));}else{this[_0xca64('0x7')](_0xca64('0xc'),_0x58c7fe);}}},'required':{'type':Sequelize[_0xca64('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xca64('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xca64('0x10')](_0xca64('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d03ed97..b6f69a7 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 _0xc2c7=['end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','find','body','params','create','Sequelize','text','TEXT','number','switch','defaultValue','sequelize','addColumn','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x56e4e7,_0x348779){var _0x2e74cf=function(_0x170567){while(--_0x170567){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x2e74cf(++_0x348779);}(_0xc2c7,0x197));var _0x7c2c=function(_0x44c46c,_0x41e18e){_0x44c46c=_0x44c46c-0x0;var _0x81dc10=_0xc2c7[_0x44c46c];return _0x81dc10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c2c('0x0'));var jsonpatch=require(_0x7c2c('0x1'));var rp=require(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var Mustache=require(_0x7c2c('0x5'));var util=require(_0x7c2c('0x6'));var path=require(_0x7c2c('0x7'));var sox=require(_0x7c2c('0x8'));var csv=require(_0x7c2c('0x9'));var ejs=require(_0x7c2c('0xa'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xb'));var _=require(_0x7c2c('0xc'));var squel=require(_0x7c2c('0xd'));var crypto=require('crypto');var jsforce=require(_0x7c2c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c2c('0xf'));var Papa=require('papaparse');var Redis=require(_0x7c2c('0x10'));var authService=require(_0x7c2c('0x11'));var qs=require(_0x7c2c('0x12'));var as=require(_0x7c2c('0x13'));var hardwareService=require(_0x7c2c('0x14'));var logger=require(_0x7c2c('0x15'))(_0x7c2c('0x16'));var utils=require(_0x7c2c('0x17'));var config=require(_0x7c2c('0x18'));var licenseUtil=require(_0x7c2c('0x19'));var db=require(_0x7c2c('0x1a'))['db'];function respondWithStatusCode(_0x2b45e9,_0x1409bc){_0x1409bc=_0x1409bc||0xcc;return function(_0x743159){if(_0x743159){return _0x2b45e9[_0x7c2c('0x1b')](_0x1409bc);}return _0x2b45e9['status'](_0x1409bc)[_0x7c2c('0x1c')]();};}function respondWithResult(_0x35b0c7,_0x21bf49){_0x21bf49=_0x21bf49||0xc8;return function(_0x165910){if(_0x165910){return _0x35b0c7[_0x7c2c('0x1d')](_0x21bf49)[_0x7c2c('0x1e')](_0x165910);}};}function respondWithFilteredResult(_0x5d2594,_0x5cbe37){return function(_0x310598){if(_0x310598){var _0x49ee63=typeof _0x5cbe37[_0x7c2c('0x1f')]===_0x7c2c('0x20')&&typeof _0x5cbe37[_0x7c2c('0x21')]===_0x7c2c('0x20');var _0x1193af=_0x310598[_0x7c2c('0x22')];var _0x526c9b=_0x49ee63?0x0:_0x5cbe37[_0x7c2c('0x1f')];var _0x3bcdb9=_0x49ee63?_0x310598[_0x7c2c('0x22')]:_0x5cbe37['offset']+_0x5cbe37[_0x7c2c('0x21')];var _0x5e97a7;if(_0x3bcdb9>=_0x1193af){_0x3bcdb9=_0x1193af;_0x5e97a7=0xc8;}else{_0x5e97a7=0xce;}_0x5d2594[_0x7c2c('0x1d')](_0x5e97a7);return _0x5d2594[_0x7c2c('0x23')](_0x7c2c('0x24'),_0x526c9b+'-'+_0x3bcdb9+'/'+_0x1193af)[_0x7c2c('0x1e')](_0x310598);}return null;};}function patchUpdates(_0x436d21){return function(_0x5aa0a2){try{jsonpatch['apply'](_0x5aa0a2,_0x436d21,!![]);}catch(_0x352ba7){return BPromise['reject'](_0x352ba7);}return _0x5aa0a2[_0x7c2c('0x25')]();};}function saveUpdates(_0x5eac56,_0x521531){return function(_0x494707){if(_0x494707){return _0x494707[_0x7c2c('0x26')](_0x5eac56)[_0x7c2c('0x27')](function(_0xd970e6){return _0xd970e6;});}return null;};}function removeEntity(_0xfd9f43,_0x36612e){return function(_0x88450f){if(_0x88450f){return _0x88450f[_0x7c2c('0x28')]()['then'](function(){_0xfd9f43[_0x7c2c('0x1d')](0xcc)[_0x7c2c('0x1c')]();});}};}function handleEntityNotFound(_0x721558,_0x39e866){return function(_0x22c6a8){if(!_0x22c6a8){_0x721558[_0x7c2c('0x1b')](0x194);}return _0x22c6a8;};}function handleError(_0x4606eb,_0x20a3c4){_0x20a3c4=_0x20a3c4||0x1f4;return function(_0x176745){logger['error'](_0x176745['stack']);if(_0x176745['name']){delete _0x176745[_0x7c2c('0x29')];}_0x4606eb[_0x7c2c('0x1d')](_0x20a3c4)[_0x7c2c('0x2a')](_0x176745);};}exports[_0x7c2c('0x2b')]=function(_0x24114f,_0x1a5b43){var _0x23b4e7={},_0x5d43c9={},_0x324cdc={'count':0x0,'rows':[]};var _0x37bcfc=_[_0x7c2c('0x2c')](db[_0x7c2c('0x2d')]['rawAttributes'],function(_0x2e563f){return{'name':_0x2e563f[_0x7c2c('0x2e')],'type':_0x2e563f[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0x5d43c9[_0x7c2c('0x31')]=_[_0x7c2c('0x32')](_[_0x7c2c('0x2c')](_0x37bcfc,_0x7c2c('0x29')),['name']);_0x5d43c9[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x24114f[_0x7c2c('0x33')]);_0x5d43c9['filters']=_[_0x7c2c('0x35')](_0x5d43c9[_0x7c2c('0x31')],_0x5d43c9['query']);_0x23b4e7[_0x7c2c('0x36')]=_[_0x7c2c('0x35')](_0x5d43c9[_0x7c2c('0x31')],qs['fields'](_0x24114f[_0x7c2c('0x33')][_0x7c2c('0x37')]));_0x23b4e7[_0x7c2c('0x36')]=_0x23b4e7['attributes'][_0x7c2c('0x38')]?_0x23b4e7['attributes']:_0x5d43c9[_0x7c2c('0x31')];if(!_0x24114f[_0x7c2c('0x33')][_0x7c2c('0x39')](_0x7c2c('0x3a'))){_0x23b4e7[_0x7c2c('0x21')]=qs[_0x7c2c('0x21')](_0x24114f[_0x7c2c('0x33')][_0x7c2c('0x21')]);_0x23b4e7['offset']=qs[_0x7c2c('0x1f')](_0x24114f['query']['offset']);}_0x23b4e7[_0x7c2c('0x3b')]=qs[_0x7c2c('0x3c')](_0x24114f[_0x7c2c('0x33')][_0x7c2c('0x3c')]);_0x23b4e7[_0x7c2c('0x3d')]=qs[_0x7c2c('0x3e')](_['pick'](_0x24114f[_0x7c2c('0x33')],_0x5d43c9['filters']),_0x37bcfc);if(_0x24114f[_0x7c2c('0x33')]['filter']){_0x23b4e7[_0x7c2c('0x3d')]=_[_0x7c2c('0x3f')](_0x23b4e7[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2c')](_0x37bcfc,function(_0x4cd740){if(_0x4cd740['type']!=='VIRTUAL'){var _0x25969e={};_0x25969e[_0x4cd740['name']]={'$like':'%'+_0x24114f['query'][_0x7c2c('0x40')]+'%'};return _0x25969e;}})});}_0x23b4e7=_['merge']({},_0x23b4e7,_0x24114f[_0x7c2c('0x41')]);var _0x173abf={'where':_0x23b4e7[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2d')][_0x7c2c('0x22')](_0x173abf)[_0x7c2c('0x27')](function(_0x4cc85c){_0x324cdc[_0x7c2c('0x22')]=_0x4cc85c;if(_0x24114f[_0x7c2c('0x33')][_0x7c2c('0x42')]){_0x23b4e7[_0x7c2c('0x43')]=[{'all':!![]}];}return db[_0x7c2c('0x2d')][_0x7c2c('0x44')](_0x23b4e7);})[_0x7c2c('0x27')](function(_0x484398){_0x324cdc[_0x7c2c('0x45')]=_0x484398;return _0x324cdc;})['then'](respondWithFilteredResult(_0x1a5b43,_0x23b4e7))[_0x7c2c('0x46')](handleError(_0x1a5b43,null));};exports['show']=function(_0x1b2edc,_0x1f0b3f){var _0x321e49={'raw':!![],'where':{'id':_0x1b2edc['params']['id']}},_0x1b55c1={};_0x1b55c1['model']=_[_0x7c2c('0x34')](db[_0x7c2c('0x2d')][_0x7c2c('0x47')]);_0x1b55c1[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x1b2edc[_0x7c2c('0x33')]);_0x1b55c1[_0x7c2c('0x3e')]=_[_0x7c2c('0x35')](_0x1b55c1[_0x7c2c('0x31')],_0x1b55c1['query']);_0x321e49[_0x7c2c('0x36')]=_['intersection'](_0x1b55c1['model'],qs[_0x7c2c('0x37')](_0x1b2edc['query'][_0x7c2c('0x37')]));_0x321e49[_0x7c2c('0x36')]=_0x321e49[_0x7c2c('0x36')][_0x7c2c('0x38')]?_0x321e49[_0x7c2c('0x36')]:_0x1b55c1[_0x7c2c('0x31')];if(_0x1b2edc[_0x7c2c('0x33')][_0x7c2c('0x42')]){_0x321e49[_0x7c2c('0x43')]=[{'all':!![]}];}_0x321e49=_['merge']({},_0x321e49,_0x1b2edc[_0x7c2c('0x41')]);return db[_0x7c2c('0x2d')][_0x7c2c('0x48')](_0x321e49)['then'](handleEntityNotFound(_0x1f0b3f,null))[_0x7c2c('0x27')](respondWithResult(_0x1f0b3f,null))[_0x7c2c('0x46')](handleError(_0x1f0b3f,null));};exports['update']=function(_0x2f7d34,_0x32b4d8){if(_0x2f7d34['body']['id']){delete _0x2f7d34[_0x7c2c('0x49')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x2f7d34[_0x7c2c('0x4a')]['id']}})[_0x7c2c('0x27')](handleEntityNotFound(_0x32b4d8,null))[_0x7c2c('0x27')](saveUpdates(_0x2f7d34['body'],null))[_0x7c2c('0x27')](respondWithResult(_0x32b4d8,null))['catch'](handleError(_0x32b4d8,null));};exports[_0x7c2c('0x28')]=function(_0xa4fba7,_0x326de9){return db[_0x7c2c('0x2d')]['find']({'where':{'id':_0xa4fba7[_0x7c2c('0x4a')]['id']}})[_0x7c2c('0x27')](handleEntityNotFound(_0x326de9,null))[_0x7c2c('0x27')](removeEntity(_0x326de9,null))[_0x7c2c('0x46')](handleError(_0x326de9,null));};exports[_0x7c2c('0x4b')]=function(_0x47c491,_0x19bedc){var _0x1b7c18;return db['sequelize']['transaction'](function(_0x84fdb){return db[_0x7c2c('0x2d')][_0x7c2c('0x4b')](_0x47c491[_0x7c2c('0x49')],{'transaction':_0x84fdb})['then'](function(_0x1af735){_0x1b7c18=_0x1af735;var _0x325f72={'type':db[_0x7c2c('0x4c')]['TEXT'],'transaction':_0x84fdb};switch(_0x47c491['body'][_0x7c2c('0x2f')]){case _0x7c2c('0x4d'):_0x325f72[_0x7c2c('0x2f')]=db['Sequelize'][_0x7c2c('0x4e')];break;case _0x7c2c('0x4f'):_0x325f72[_0x7c2c('0x2f')]=db[_0x7c2c('0x4c')]['INTEGER'];break;case _0x7c2c('0x50'):_0x325f72[_0x7c2c('0x2f')]=db['Sequelize']['BOOLEAN'];_0x325f72[_0x7c2c('0x51')]=![];break;default:}return db[_0x7c2c('0x52')]['queryInterface'][_0x7c2c('0x53')](_0x7c2c('0x54'),util[_0x7c2c('0x55')](_0x7c2c('0x56'),_0x1b7c18['id']),_0x325f72);})['then'](function(){return _0x1b7c18;});})[_0x7c2c('0x27')](respondWithResult(_0x19bedc,0xc9))[_0x7c2c('0x46')](handleError(_0x19bedc,null));}; \ No newline at end of file +var _0xb761=['../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cm_contacts','format','fast-json-patch','request-promise','moment','util','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x2748fb,_0x35f385){var _0x3652ba=function(_0x293dfc){while(--_0x293dfc){_0x2748fb['push'](_0x2748fb['shift']());}};_0x3652ba(++_0x35f385);}(_0xb761,0x1d4));var _0x1b76=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb761[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b76('0x0'));var rp=require(_0x1b76('0x1'));var moment=require(_0x1b76('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b76('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x1b76('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b76('0x5'));var _=require('lodash');var squel=require(_0x1b76('0x6'));var crypto=require('crypto');var jsforce=require(_0x1b76('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x1b76('0x4'));var querystring=require('querystring');var Papa=require(_0x1b76('0x8'));var Redis=require(_0x1b76('0x9'));var authService=require(_0x1b76('0xa'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b76('0xb'));var logger=require(_0x1b76('0xc'))(_0x1b76('0xd'));var utils=require(_0x1b76('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b76('0xf'))['db'];function respondWithStatusCode(_0x587026,_0x33e7e7){_0x33e7e7=_0x33e7e7||0xcc;return function(_0x35eb4b){if(_0x35eb4b){return _0x587026['sendStatus'](_0x33e7e7);}return _0x587026[_0x1b76('0x10')](_0x33e7e7)[_0x1b76('0x11')]();};}function respondWithResult(_0x463479,_0x4ab89f){_0x4ab89f=_0x4ab89f||0xc8;return function(_0x52ed1b){if(_0x52ed1b){return _0x463479[_0x1b76('0x10')](_0x4ab89f)[_0x1b76('0x12')](_0x52ed1b);}};}function respondWithFilteredResult(_0x254969,_0x3f3d19){return function(_0x74c8f4){if(_0x74c8f4){var _0x231582=typeof _0x3f3d19[_0x1b76('0x13')]===_0x1b76('0x14')&&typeof _0x3f3d19[_0x1b76('0x15')]==='undefined';var _0xbd6a0d=_0x74c8f4['count'];var _0x53b54c=_0x231582?0x0:_0x3f3d19['offset'];var _0x361c1c=_0x231582?_0x74c8f4[_0x1b76('0x16')]:_0x3f3d19['offset']+_0x3f3d19[_0x1b76('0x15')];var _0x49000b;if(_0x361c1c>=_0xbd6a0d){_0x361c1c=_0xbd6a0d;_0x49000b=0xc8;}else{_0x49000b=0xce;}_0x254969[_0x1b76('0x10')](_0x49000b);return _0x254969[_0x1b76('0x17')](_0x1b76('0x18'),_0x53b54c+'-'+_0x361c1c+'/'+_0xbd6a0d)['json'](_0x74c8f4);}return null;};}function patchUpdates(_0x266f73){return function(_0x2625e5){try{jsonpatch[_0x1b76('0x19')](_0x2625e5,_0x266f73,!![]);}catch(_0x129746){return BPromise[_0x1b76('0x1a')](_0x129746);}return _0x2625e5[_0x1b76('0x1b')]();};}function saveUpdates(_0x95a8c4,_0x4a86a8){return function(_0x2adc6f){if(_0x2adc6f){return _0x2adc6f[_0x1b76('0x1c')](_0x95a8c4)[_0x1b76('0x1d')](function(_0x24f23c){return _0x24f23c;});}return null;};}function removeEntity(_0x415fba,_0x334a2d){return function(_0x44e5ea){if(_0x44e5ea){return _0x44e5ea[_0x1b76('0x1e')]()[_0x1b76('0x1d')](function(){_0x415fba[_0x1b76('0x10')](0xcc)[_0x1b76('0x11')]();});}};}function handleEntityNotFound(_0x4314df,_0x1c356b){return function(_0x54f194){if(!_0x54f194){_0x4314df[_0x1b76('0x1f')](0x194);}return _0x54f194;};}function handleError(_0x10bdd6,_0x3bd755){_0x3bd755=_0x3bd755||0x1f4;return function(_0x17eb8a){logger[_0x1b76('0x20')](_0x17eb8a[_0x1b76('0x21')]);if(_0x17eb8a[_0x1b76('0x22')]){delete _0x17eb8a[_0x1b76('0x22')];}_0x10bdd6[_0x1b76('0x10')](_0x3bd755)[_0x1b76('0x23')](_0x17eb8a);};}exports[_0x1b76('0x24')]=function(_0x26416c,_0x2722dc){var _0x215dc3={},_0x1da9d5={},_0x5900f9={'count':0x0,'rows':[]};var _0x1f7d60=_[_0x1b76('0x25')](db[_0x1b76('0x26')]['rawAttributes'],function(_0x412602){return{'name':_0x412602[_0x1b76('0x27')],'type':_0x412602['type'][_0x1b76('0x28')]};});_0x1da9d5[_0x1b76('0x29')]=_[_0x1b76('0x2a')](_[_0x1b76('0x25')](_0x1f7d60,'name'),[_0x1b76('0x22')]);_0x1da9d5[_0x1b76('0x2b')]=_[_0x1b76('0x2c')](_0x26416c[_0x1b76('0x2b')]);_0x1da9d5[_0x1b76('0x2d')]=_[_0x1b76('0x2e')](_0x1da9d5[_0x1b76('0x29')],_0x1da9d5[_0x1b76('0x2b')]);_0x215dc3[_0x1b76('0x2f')]=_[_0x1b76('0x2e')](_0x1da9d5[_0x1b76('0x29')],qs[_0x1b76('0x30')](_0x26416c[_0x1b76('0x2b')]['fields']));_0x215dc3[_0x1b76('0x2f')]=_0x215dc3[_0x1b76('0x2f')][_0x1b76('0x31')]?_0x215dc3[_0x1b76('0x2f')]:_0x1da9d5['model'];if(!_0x26416c['query'][_0x1b76('0x32')](_0x1b76('0x33'))){_0x215dc3[_0x1b76('0x15')]=qs[_0x1b76('0x15')](_0x26416c['query']['limit']);_0x215dc3[_0x1b76('0x13')]=qs[_0x1b76('0x13')](_0x26416c['query'][_0x1b76('0x13')]);}_0x215dc3['order']=qs[_0x1b76('0x34')](_0x26416c['query'][_0x1b76('0x34')]);_0x215dc3[_0x1b76('0x35')]=qs[_0x1b76('0x2d')](_['pick'](_0x26416c[_0x1b76('0x2b')],_0x1da9d5[_0x1b76('0x2d')]),_0x1f7d60);if(_0x26416c[_0x1b76('0x2b')][_0x1b76('0x36')]){_0x215dc3['where']=_[_0x1b76('0x37')](_0x215dc3[_0x1b76('0x35')],{'$or':_[_0x1b76('0x25')](_0x1f7d60,function(_0xab214b){if(_0xab214b[_0x1b76('0x38')]!==_0x1b76('0x39')){var _0x5032fb={};_0x5032fb[_0xab214b['name']]={'$like':'%'+_0x26416c[_0x1b76('0x2b')][_0x1b76('0x36')]+'%'};return _0x5032fb;}})});}_0x215dc3=_['merge']({},_0x215dc3,_0x26416c[_0x1b76('0x3a')]);var _0x1c301f={'where':_0x215dc3[_0x1b76('0x35')]};return db[_0x1b76('0x26')]['count'](_0x1c301f)[_0x1b76('0x1d')](function(_0x590a53){_0x5900f9[_0x1b76('0x16')]=_0x590a53;if(_0x26416c[_0x1b76('0x2b')][_0x1b76('0x3b')]){_0x215dc3[_0x1b76('0x3c')]=[{'all':!![]}];}return db[_0x1b76('0x26')]['findAll'](_0x215dc3);})[_0x1b76('0x1d')](function(_0x2ddf13){_0x5900f9[_0x1b76('0x3d')]=_0x2ddf13;return _0x5900f9;})[_0x1b76('0x1d')](respondWithFilteredResult(_0x2722dc,_0x215dc3))[_0x1b76('0x3e')](handleError(_0x2722dc,null));};exports[_0x1b76('0x3f')]=function(_0x127190,_0x5a8145){var _0x179e85={'raw':!![],'where':{'id':_0x127190[_0x1b76('0x40')]['id']}},_0x370b12={};_0x370b12[_0x1b76('0x29')]=_[_0x1b76('0x2c')](db[_0x1b76('0x26')]['rawAttributes']);_0x370b12[_0x1b76('0x2b')]=_[_0x1b76('0x2c')](_0x127190[_0x1b76('0x2b')]);_0x370b12[_0x1b76('0x2d')]=_[_0x1b76('0x2e')](_0x370b12[_0x1b76('0x29')],_0x370b12['query']);_0x179e85[_0x1b76('0x2f')]=_[_0x1b76('0x2e')](_0x370b12[_0x1b76('0x29')],qs[_0x1b76('0x30')](_0x127190['query'][_0x1b76('0x30')]));_0x179e85['attributes']=_0x179e85[_0x1b76('0x2f')][_0x1b76('0x31')]?_0x179e85[_0x1b76('0x2f')]:_0x370b12[_0x1b76('0x29')];if(_0x127190[_0x1b76('0x2b')][_0x1b76('0x3b')]){_0x179e85['include']=[{'all':!![]}];}_0x179e85=_[_0x1b76('0x37')]({},_0x179e85,_0x127190['options']);return db[_0x1b76('0x26')][_0x1b76('0x41')](_0x179e85)[_0x1b76('0x1d')](handleEntityNotFound(_0x5a8145,null))[_0x1b76('0x1d')](respondWithResult(_0x5a8145,null))[_0x1b76('0x3e')](handleError(_0x5a8145,null));};exports[_0x1b76('0x1c')]=function(_0x4ad8a7,_0x2571a1){if(_0x4ad8a7[_0x1b76('0x42')]['id']){delete _0x4ad8a7[_0x1b76('0x42')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x4ad8a7[_0x1b76('0x40')]['id']}})[_0x1b76('0x1d')](handleEntityNotFound(_0x2571a1,null))[_0x1b76('0x1d')](saveUpdates(_0x4ad8a7['body'],null))['then'](respondWithResult(_0x2571a1,null))['catch'](handleError(_0x2571a1,null));};exports['destroy']=function(_0x574212,_0x47a885){return db[_0x1b76('0x26')][_0x1b76('0x41')]({'where':{'id':_0x574212[_0x1b76('0x40')]['id']}})[_0x1b76('0x1d')](handleEntityNotFound(_0x47a885,null))[_0x1b76('0x1d')](removeEntity(_0x47a885,null))[_0x1b76('0x3e')](handleError(_0x47a885,null));};exports[_0x1b76('0x43')]=function(_0x275664,_0x28e525){var _0x1e86de;return db[_0x1b76('0x44')][_0x1b76('0x45')](function(_0x3e5048){return db['CmCustomField']['create'](_0x275664[_0x1b76('0x42')],{'transaction':_0x3e5048})[_0x1b76('0x1d')](function(_0x4da899){_0x1e86de=_0x4da899;var _0x1960db={'type':db[_0x1b76('0x46')][_0x1b76('0x47')],'transaction':_0x3e5048};switch(_0x275664['body'][_0x1b76('0x38')]){case _0x1b76('0x48'):_0x1960db['type']=db[_0x1b76('0x46')][_0x1b76('0x47')];break;case _0x1b76('0x49'):_0x1960db[_0x1b76('0x38')]=db[_0x1b76('0x46')][_0x1b76('0x4a')];break;case'switch':_0x1960db['type']=db[_0x1b76('0x46')][_0x1b76('0x4b')];_0x1960db['defaultValue']=![];break;default:}return db[_0x1b76('0x44')][_0x1b76('0x4c')][_0x1b76('0x4d')](_0x1b76('0x4e'),util[_0x1b76('0x4f')]('cf_%d',_0x1e86de['id']),_0x1960db);})[_0x1b76('0x1d')](function(){return _0x1e86de;});})[_0x1b76('0x1d')](respondWithResult(_0x28e525,0xc9))[_0x1b76('0x3e')](handleError(_0x28e525,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8951c7d..fd16566 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 _0x7e93=['exports','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x49b420,_0x3dba14){var _0x147252=function(_0x138a9d){while(--_0x138a9d){_0x49b420['push'](_0x49b420['shift']());}};_0x147252(++_0x3dba14);}(_0x7e93,0xc5));var _0x37e9=function(_0x1ecc25,_0x217243){_0x1ecc25=_0x1ecc25-0x0;var _0x53f55a=_0x7e93[_0x1ecc25];return _0x53f55a;};'use strict';var _=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var logger=require(_0x37e9('0x2'))(_0x37e9('0x3'));var moment=require(_0x37e9('0x4'));var BPromise=require(_0x37e9('0x5'));var rp=require(_0x37e9('0x6'));var fs=require('fs');var path=require(_0x37e9('0x7'));var rimraf=require(_0x37e9('0x8'));var config=require(_0x37e9('0x9'));var attributes=require(_0x37e9('0xa'));module[_0x37e9('0xb')]=function(_0xf4322a,_0x1d67d9){return _0xf4322a['define'](_0x37e9('0xc'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0087=['bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','api','moment'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x0087,0x1d7));var _0x7008=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x0087[_0x345a17];return _0xd0f947;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7008('0x0'));var moment=require(_0x7008('0x1'));var BPromise=require(_0x7008('0x2'));var rp=require(_0x7008('0x3'));var fs=require('fs');var path=require(_0x7008('0x4'));var rimraf=require(_0x7008('0x5'));var config=require('../../config/environment');var attributes=require(_0x7008('0x6'));module[_0x7008('0x7')]=function(_0x4db77a,_0x455dd5){return _0x4db77a[_0x7008('0x8')](_0x7008('0x9'),attributes,{'tableName':_0x7008('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 0074eb8..6585a87 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 _0x5606=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x50225f,_0x1148fa){var _0x2a5625=function(_0x36fd1e){while(--_0x36fd1e){_0x50225f['push'](_0x50225f['shift']());}};_0x2a5625(++_0x1148fa);}(_0x5606,0x19e));var _0x6560=function(_0x5190e2,_0x4c7901){_0x5190e2=_0x5190e2-0x0;var _0x138d3b=_0x5606[_0x5190e2];return _0x138d3b;};'use strict';var _=require(_0x6560('0x0'));var util=require(_0x6560('0x1'));var moment=require(_0x6560('0x2'));var BPromise=require(_0x6560('0x3'));var rs=require(_0x6560('0x4'));var fs=require('fs');var Redis=require(_0x6560('0x5'));var db=require(_0x6560('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6560('0x7'))(_0x6560('0x8'));var config=require(_0x6560('0x9'));var jayson=require(_0x6560('0xa'));var client=jayson[_0x6560('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x138d6d,_0x47db6d,_0x5a3283){return new BPromise(function(_0x25bb5c,_0x4b57c6){return client[_0x6560('0xc')](_0x138d6d,_0x5a3283)[_0x6560('0xd')](function(_0xc8a15b){logger[_0x6560('0xe')](_0x6560('0xf'),_0x47db6d,_0x6560('0x10'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x47db6d,_0x6560('0x10'),JSON['stringify'](_0xc8a15b));if(_0xc8a15b[_0x6560('0x11')]){if(_0xc8a15b[_0x6560('0x11')][_0x6560('0x12')]===0x1f4){logger[_0x6560('0x11')](_0x6560('0xf'),_0x47db6d,_0xc8a15b[_0x6560('0x11')][_0x6560('0x13')]);return _0x4b57c6(_0xc8a15b[_0x6560('0x11')]['message']);}logger[_0x6560('0x11')](_0x6560('0xf'),_0x47db6d,_0xc8a15b[_0x6560('0x11')]['message']);return _0x25bb5c(_0xc8a15b[_0x6560('0x11')][_0x6560('0x13')]);}else{logger['info'](_0x6560('0xf'),_0x47db6d,_0x6560('0x10'));_0x25bb5c(_0xc8a15b[_0x6560('0x14')][_0x6560('0x13')]);}})['catch'](function(_0x42c05c){logger[_0x6560('0x11')](_0x6560('0xf'),_0x47db6d,_0x42c05c);_0x4b57c6(_0x42c05c);});});} \ No newline at end of file +var _0xc682=['../../config/environment','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a1e7e,_0xda6073){var _0x598d33=function(_0x3c7f4c){while(--_0x3c7f4c){_0x4a1e7e['push'](_0x4a1e7e['shift']());}};_0x598d33(++_0xda6073);}(_0xc682,0x9c));var _0x2c68=function(_0x1f4621,_0x5a67fc){_0x1f4621=_0x1f4621-0x0;var _0x160177=_0xc682[_0x1f4621];return _0x160177;};'use strict';var _=require(_0x2c68('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c68('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c68('0x2'));var db=require(_0x2c68('0x3'))['db'];var utils=require(_0x2c68('0x4'));var logger=require(_0x2c68('0x5'))('rpc');var config=require(_0x2c68('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53e12c,_0x312bb0,_0x50c120){return new BPromise(function(_0xa68fe6,_0x4abcee){return client[_0x2c68('0x7')](_0x53e12c,_0x50c120)[_0x2c68('0x8')](function(_0x360b5f){logger[_0x2c68('0x9')](_0x2c68('0xa'),_0x312bb0,_0x2c68('0xb'));logger['debug'](_0x2c68('0xc'),_0x312bb0,_0x2c68('0xb'),JSON[_0x2c68('0xd')](_0x360b5f));if(_0x360b5f[_0x2c68('0xe')]){if(_0x360b5f[_0x2c68('0xe')][_0x2c68('0xf')]===0x1f4){logger[_0x2c68('0xe')](_0x2c68('0xa'),_0x312bb0,_0x360b5f[_0x2c68('0xe')][_0x2c68('0x10')]);return _0x4abcee(_0x360b5f[_0x2c68('0xe')][_0x2c68('0x10')]);}logger[_0x2c68('0xe')](_0x2c68('0xa'),_0x312bb0,_0x360b5f[_0x2c68('0xe')][_0x2c68('0x10')]);return _0xa68fe6(_0x360b5f[_0x2c68('0xe')][_0x2c68('0x10')]);}else{logger[_0x2c68('0x9')](_0x2c68('0xa'),_0x312bb0,_0x2c68('0xb'));_0xa68fe6(_0x360b5f['result']['message']);}})[_0x2c68('0x11')](function(_0x42833b){logger[_0x2c68('0xe')]('CmCustomField,\x20%s,\x20%s',_0x312bb0,_0x42833b);_0x4abcee(_0x42833b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index c243a1c..ded52de 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 _0xcc05=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x5e5cea,_0x247905){var _0x25e9e6=function(_0x4f197c){while(--_0x4f197c){_0x5e5cea['push'](_0x5e5cea['shift']());}};_0x25e9e6(++_0x247905);}(_0xcc05,0x95));var _0x5cc0=function(_0x2d0c33,_0x2b22cf){_0x2d0c33=_0x2d0c33-0x0;var _0x50f706=_0xcc05[_0x2d0c33];return _0x50f706;};'use strict';var multer=require(_0x5cc0('0x0'));var util=require(_0x5cc0('0x1'));var path=require('path');var timeout=require(_0x5cc0('0x2'));var express=require(_0x5cc0('0x3'));var router=express[_0x5cc0('0x4')]();var fs_extra=require(_0x5cc0('0x5'));var auth=require(_0x5cc0('0x6'));var interaction=require(_0x5cc0('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x5cc0('0x8')]('/',auth[_0x5cc0('0x9')](),controller[_0x5cc0('0xa')]);router['get'](_0x5cc0('0xb'),auth[_0x5cc0('0x9')](),controller[_0x5cc0('0xc')]);router[_0x5cc0('0xd')]('/',auth['isAuthenticated'](),controller[_0x5cc0('0xe')]);router[_0x5cc0('0xf')](_0x5cc0('0xb'),auth[_0x5cc0('0x9')](),controller[_0x5cc0('0x10')]);router[_0x5cc0('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5cc0('0x12')]=router; \ No newline at end of file +var _0x6f7b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7b,0x168));var _0xb6f7=function(_0x49f400,_0x49210f){_0x49f400=_0x49f400-0x0;var _0xc84ff0=_0x6f7b[_0x49f400];return _0xc84ff0;};'use strict';var multer=require('multer');var util=require(_0xb6f7('0x0'));var path=require(_0xb6f7('0x1'));var timeout=require(_0xb6f7('0x2'));var express=require(_0xb6f7('0x3'));var router=express[_0xb6f7('0x4')]();var fs_extra=require(_0xb6f7('0x5'));var auth=require(_0xb6f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb6f7('0x7'));var controller=require('./cmCustomField.controller');router[_0xb6f7('0x8')]('/',auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xa')]);router[_0xb6f7('0x8')]('/:id',auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xb')]);router[_0xb6f7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb6f7('0xd'),auth[_0xb6f7('0x9')](),controller[_0xb6f7('0xe')]);router[_0xb6f7('0xf')](_0xb6f7('0xd'),auth[_0xb6f7('0x9')](),controller[_0xb6f7('0x10')]);module[_0xb6f7('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 51574b2..183ba06 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 _0x4137=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x55830a,_0x91caf2){var _0x3d3c4f=function(_0x3f0597){while(--_0x3f0597){_0x55830a['push'](_0x55830a['shift']());}};_0x3d3c4f(++_0x91caf2);}(_0x4137,0xf8));var _0x7413=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4137[_0x178e48];return _0x440d7e;};'use strict';var moment=require(_0x7413('0x0'));var Sequelize=require(_0x7413('0x1'));module[_0x7413('0x2')]={'phone':{'type':Sequelize[_0x7413('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7413('0x5')],'defaultValue':moment()[_0x7413('0x6')](_0x7413('0x7'))},'countbusyretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7413('0x5')]},'priority':{'type':Sequelize[_0x7413('0x8')](0x2)[_0x7413('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7413('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x7413('0xa')},'ListId':{'type':Sequelize[_0x7413('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x7413('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x7413('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x7413('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7413('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7413('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x7413('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x2542=['contactListQueue','moment','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x2542,0x169));var _0x2254=function(_0x41a037,_0x4274d4){_0x41a037=_0x41a037-0x0;var _0x5a274e=_0x2542[_0x41a037];return _0x5a274e;};'use strict';var moment=require(_0x2254('0x0'));var Sequelize=require(_0x2254('0x1'));module[_0x2254('0x2')]={'phone':{'type':Sequelize[_0x2254('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2254('0x4')],'defaultValue':moment()['format'](_0x2254('0x5'))},'countbusyretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2254('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2254('0x4')]},'priority':{'type':Sequelize[_0x2254('0x6')](0x2)[_0x2254('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2254('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x2254('0x6')],'unique':_0x2254('0x9')},'ListId':{'type':Sequelize[_0x2254('0x6')],'unique':_0x2254('0x9')},'UserId':{'type':Sequelize[_0x2254('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x2254('0x6')],'unique':_0x2254('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2254('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x2254('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 92afd69..fb8577f 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 _0x1fa7=['dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','getVoiceQueues','hopperId','UPDATE','VoiceQueue','getOpenContacts','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','push','utcOffset','getTimezone','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','CmHopper','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','VoiceQueueId','dataValues','createdAt','updatedAt','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','outbound','preview'];(function(_0x5673a0,_0x217887){var _0x142f1e=function(_0x132745){while(--_0x132745){_0x5673a0['push'](_0x5673a0['shift']());}};_0x142f1e(++_0x217887);}(_0x1fa7,0x151));var _0x71fa=function(_0x54b35a,_0x44ad63){_0x54b35a=_0x54b35a-0x0;var _0x444ec3=_0x1fa7[_0x54b35a];return _0x444ec3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71fa('0x0'));var zipdir=require(_0x71fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71fa('0x2'));var BPromise=require(_0x71fa('0x3'));var Mustache=require('mustache');var util=require(_0x71fa('0x4'));var path=require('path');var sox=require(_0x71fa('0x5'));var csv=require(_0x71fa('0x6'));var ejs=require(_0x71fa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71fa('0x8'));var squel=require(_0x71fa('0x9'));var crypto=require(_0x71fa('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x71fa('0x6'));var querystring=require(_0x71fa('0xb'));var Papa=require(_0x71fa('0xc'));var Redis=require(_0x71fa('0xd'));var authService=require(_0x71fa('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x71fa('0xf'));var hardwareService=require(_0x71fa('0x10'));var logger=require(_0x71fa('0x11'))(_0x71fa('0x12'));var utils=require(_0x71fa('0x13'));var config=require('../../config/environment');var shared=require(_0x71fa('0x14'));var licenseUtil=require(_0x71fa('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2966d5,_0x23751d){_0x23751d=_0x23751d||0xcc;return function(_0x5efa7d){if(_0x5efa7d){return _0x2966d5[_0x71fa('0x16')](_0x23751d);}return _0x2966d5[_0x71fa('0x17')](_0x23751d)[_0x71fa('0x18')]();};}function respondWithResult(_0x157024,_0xc1fc2a){_0xc1fc2a=_0xc1fc2a||0xc8;return function(_0x3f5d30){if(_0x3f5d30){return _0x157024[_0x71fa('0x17')](_0xc1fc2a)[_0x71fa('0x19')](_0x3f5d30);}};}function respondWithFilteredResult(_0x50e6c8,_0x25b825){return function(_0x29ba6a){if(_0x29ba6a){var _0x1e79a8=typeof _0x25b825[_0x71fa('0x1a')]==='undefined'&&typeof _0x25b825['limit']===_0x71fa('0x1b');var _0x14b56b=_0x29ba6a[_0x71fa('0x1c')];var _0x2e8d57=_0x1e79a8?0x0:_0x25b825[_0x71fa('0x1a')];var _0x3ddb6b=_0x1e79a8?_0x29ba6a['count']:_0x25b825[_0x71fa('0x1a')]+_0x25b825['limit'];var _0x3eb2f2;if(_0x3ddb6b>=_0x14b56b){_0x3ddb6b=_0x14b56b;_0x3eb2f2=0xc8;}else{_0x3eb2f2=0xce;}_0x50e6c8[_0x71fa('0x17')](_0x3eb2f2);return _0x50e6c8[_0x71fa('0x1d')](_0x71fa('0x1e'),_0x2e8d57+'-'+_0x3ddb6b+'/'+_0x14b56b)[_0x71fa('0x19')](_0x29ba6a);}return null;};}function patchUpdates(_0x54d52d){return function(_0x12f3cd){try{jsonpatch[_0x71fa('0x1f')](_0x12f3cd,_0x54d52d,!![]);}catch(_0x470efd){return BPromise[_0x71fa('0x20')](_0x470efd);}return _0x12f3cd['save']();};}function saveUpdates(_0x472440,_0x51fd35){return function(_0x49429e){if(_0x49429e){return _0x49429e[_0x71fa('0x21')](_0x472440)[_0x71fa('0x22')](function(_0x408e13){return _0x408e13;});}return null;};}function removeEntity(_0x16e0c3,_0x358591){return function(_0xf662ae){if(_0xf662ae){return _0xf662ae[_0x71fa('0x23')]()[_0x71fa('0x22')](function(){_0x16e0c3[_0x71fa('0x17')](0xcc)[_0x71fa('0x18')]();});}};}function handleEntityNotFound(_0x4d3818,_0x16fdfe){return function(_0x4ad521){if(!_0x4ad521){_0x4d3818[_0x71fa('0x16')](0x194);}return _0x4ad521;};}function handleError(_0x12457c,_0x3d5c60){_0x3d5c60=_0x3d5c60||0x1f4;return function(_0x24274c){logger['error'](_0x24274c['stack']);if(_0x24274c[_0x71fa('0x24')]){delete _0x24274c[_0x71fa('0x24')];}_0x12457c[_0x71fa('0x17')](_0x3d5c60)[_0x71fa('0x25')](_0x24274c);};}exports[_0x71fa('0x26')]=function(_0x3ba2b2,_0xcb78){var _0x2fa76d={},_0x2773a0={},_0x12605b={'count':0x0,'rows':[]};var _0x14d552=_[_0x71fa('0x27')](db['CmHopper'][_0x71fa('0x28')],function(_0x56c812){return{'name':_0x56c812['fieldName'],'type':_0x56c812[_0x71fa('0x29')][_0x71fa('0x2a')]};});_0x2773a0[_0x71fa('0x2b')]=_[_0x71fa('0x27')](_0x14d552,_0x71fa('0x24'));_0x2773a0[_0x71fa('0x2c')]=_[_0x71fa('0x2d')](_0x3ba2b2[_0x71fa('0x2c')]);_0x2773a0[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x2773a0[_0x71fa('0x2b')],_0x2773a0['query']);_0x2773a0[_0x71fa('0x2e')]=_[_0x71fa('0x30')](_0x2773a0[_0x71fa('0x2e')],['$and','$or','$gt',_0x71fa('0x31'),_0x71fa('0x32'),_0x71fa('0x33'),_0x71fa('0x34'),_0x71fa('0x35'),_0x71fa('0x36'),_0x71fa('0x37'),'$notBetween',_0x71fa('0x38'),_0x71fa('0x39'),_0x71fa('0x3a'),_0x71fa('0x3b'),_0x71fa('0x3c'),'$notILike',_0x71fa('0x3a'),_0x71fa('0x3d'),_0x71fa('0x3e'),_0x71fa('0x3f'),_0x71fa('0x40')]);_0x2fa76d[_0x71fa('0x41')]=_[_0x71fa('0x2f')](_0x2773a0[_0x71fa('0x2b')],qs[_0x71fa('0x42')](_0x3ba2b2[_0x71fa('0x2c')]['fields']));_0x2fa76d[_0x71fa('0x41')]=_0x2fa76d[_0x71fa('0x41')][_0x71fa('0x43')]?_0x2fa76d[_0x71fa('0x41')]:_0x2773a0[_0x71fa('0x2b')];if(!_0x3ba2b2[_0x71fa('0x2c')][_0x71fa('0x44')](_0x71fa('0x45'))){_0x2fa76d[_0x71fa('0x46')]=qs[_0x71fa('0x46')](_0x3ba2b2[_0x71fa('0x2c')][_0x71fa('0x46')]);_0x2fa76d[_0x71fa('0x1a')]=qs[_0x71fa('0x1a')](_0x3ba2b2[_0x71fa('0x2c')]['offset']);}_0x2fa76d['order']=qs['sort'](_0x3ba2b2[_0x71fa('0x2c')][_0x71fa('0x47')]);_0x2fa76d['where']=qs[_0x71fa('0x2e')](_[_0x71fa('0x48')](_0x3ba2b2['query'],_0x2773a0[_0x71fa('0x2e')]),_0x14d552);if(_0x3ba2b2[_0x71fa('0x2c')][_0x71fa('0x49')]){_0x2fa76d[_0x71fa('0x4a')]=_[_0x71fa('0x4b')](_0x2fa76d['where'],{'$or':_[_0x71fa('0x27')](_0x14d552,function(_0x35d6b6){if(_0x35d6b6[_0x71fa('0x29')]!==_0x71fa('0x4c')){var _0x1bebab={};_0x1bebab[_0x35d6b6['name']]={'$like':'%'+_0x3ba2b2['query']['filter']+'%'};return _0x1bebab;}})});}_0x2fa76d=_['merge']({},_0x2fa76d,_0x3ba2b2['options']);var _0x2f5a37={'where':_0x2fa76d[_0x71fa('0x4a')]};return db[_0x71fa('0x4d')]['count'](_0x2f5a37)[_0x71fa('0x22')](function(_0x31b3de){_0x12605b[_0x71fa('0x1c')]=_0x31b3de;if(_0x3ba2b2[_0x71fa('0x2c')][_0x71fa('0x4e')]){_0x2fa76d[_0x71fa('0x4f')]=[{'all':!![]}];}return db[_0x71fa('0x4d')][_0x71fa('0x50')](_0x2fa76d);})[_0x71fa('0x22')](function(_0x393832){_0x12605b[_0x71fa('0x51')]=_0x393832;return _0x12605b;})[_0x71fa('0x22')](respondWithFilteredResult(_0xcb78,_0x2fa76d))[_0x71fa('0x52')](handleError(_0xcb78,null));};exports[_0x71fa('0x53')]=function(_0x5b9bd8,_0xd1936c){var _0x2fb251={'raw':!![],'where':{'id':_0x5b9bd8[_0x71fa('0x54')]['id']}},_0x50090c={};_0x50090c[_0x71fa('0x2b')]=_[_0x71fa('0x2d')](db['CmHopper'][_0x71fa('0x28')]);_0x50090c[_0x71fa('0x2c')]=_[_0x71fa('0x2d')](_0x5b9bd8[_0x71fa('0x2c')]);_0x50090c[_0x71fa('0x2e')]=_[_0x71fa('0x2f')](_0x50090c[_0x71fa('0x2b')],_0x50090c[_0x71fa('0x2c')]);_0x2fb251[_0x71fa('0x41')]=_['intersection'](_0x50090c[_0x71fa('0x2b')],qs[_0x71fa('0x42')](_0x5b9bd8[_0x71fa('0x2c')]['fields']));_0x2fb251['attributes']=_0x2fb251[_0x71fa('0x41')]['length']?_0x2fb251[_0x71fa('0x41')]:_0x50090c['model'];if(_0x5b9bd8['query'][_0x71fa('0x4e')]){_0x2fb251['include']=[{'all':!![]}];}_0x2fb251=_['merge']({},_0x2fb251,_0x5b9bd8['options']);return db['CmHopper'][_0x71fa('0x55')](_0x2fb251)[_0x71fa('0x22')](handleEntityNotFound(_0xd1936c,null))[_0x71fa('0x22')](respondWithResult(_0xd1936c,null))['catch'](handleError(_0xd1936c,null));};exports[_0x71fa('0x56')]=function(_0x5637b7,_0xd0c7a0){return db[_0x71fa('0x4d')][_0x71fa('0x56')](_0x5637b7['body'],{})['then'](respondWithResult(_0xd0c7a0,0xc9))['catch'](handleError(_0xd0c7a0,null));};exports[_0x71fa('0x21')]=function(_0x52d5a0,_0x1a67b6){if(_0x52d5a0[_0x71fa('0x57')]['id']){delete _0x52d5a0['body']['id'];}return db['CmHopper'][_0x71fa('0x55')]({'where':{'id':_0x52d5a0['params']['id']}})[_0x71fa('0x22')](handleEntityNotFound(_0x1a67b6,null))[_0x71fa('0x22')](saveUpdates(_0x52d5a0[_0x71fa('0x57')],null))[_0x71fa('0x22')](respondWithResult(_0x1a67b6,null))[_0x71fa('0x52')](handleError(_0x1a67b6,null));};exports[_0x71fa('0x58')]=function(_0x4b00b7,_0x50980a){return db[_0x71fa('0x4d')][_0x71fa('0x58')]()[_0x71fa('0x22')](respondWithResult(_0x50980a,null))[_0x71fa('0x52')](handleError(_0x50980a,null));};exports[_0x71fa('0x23')]=function(_0x342d9d,_0x583c0d){var _0x1249f3;return db['CmHopper']['find']({'where':{'id':_0x342d9d[_0x71fa('0x54')]['id']}})['then'](handleEntityNotFound(_0x583c0d,null))[_0x71fa('0x22')](function(_0x1d8d23){if(_0x1d8d23){return _0x1d8d23[_0x71fa('0x23')]()[_0x71fa('0x22')](function(_0x378708){return _0x378708;});}})[_0x71fa('0x22')](function(_0xf462d1){_0x1249f3=_0xf462d1;if(_0xf462d1){if(_0xf462d1[_0x71fa('0x59')]||_0xf462d1['CampaignId']){return db[_0xf462d1[_0x71fa('0x59')]?'VoiceQueue':'Campaign'][_0x71fa('0x55')]({'where':{'id':_0xf462d1[_0x71fa('0x59')]?_0xf462d1[_0x71fa('0x59')]:_0xf462d1['CampaignId']},'attributes':['id',_0x71fa('0x24')],'raw':!![]});}}})[_0x71fa('0x22')](function(_0x47df85){var _0x171e24={};if(_0x47df85){_[_0x71fa('0x4b')](_0x171e24,_['omit'](_0x1249f3[_0x71fa('0x5a')],[_0x71fa('0x5b'),_0x71fa('0x5c'),'id']));_0x171e24['state']=0x15;_0x171e24['statedesc']=_0x71fa('0x5d');_0x171e24['campaign']=_0x47df85['name'];_0x171e24[_0x71fa('0x5e')]=_0x342d9d[_0x71fa('0x5f')][_0x71fa('0x24')];_0x171e24[_0x71fa('0x60')]=_0x342d9d[_0x71fa('0x5f')]['id'];_0x171e24[_0x71fa('0x5d')]=!![];_0x171e24[_0x71fa('0x61')]=moment()['format'](_0x71fa('0x62'));_0x171e24['calleridnum']=_0x1249f3['phone'];_0x171e24[_0x71fa('0x63')]=_0x1249f3[_0x71fa('0x59')]?'queue':_0x71fa('0x64');return db[_0x71fa('0x65')][_0x71fa('0x55')]({'where':{'id':_0x171e24[_0x71fa('0x66')]},'attributes':[_0x71fa('0x67'),_0x71fa('0x68')]})[_0x71fa('0x22')](function(_0x170f47){if(!_[_0x71fa('0x69')](_0x583c0d)&&!_[_0x71fa('0x69')](_0x170f47[_0x71fa('0x67')])){_0x171e24[_0x71fa('0x6a')]=_0x170f47['firstName'];if(!_[_0x71fa('0x69')](_0x170f47[_0x71fa('0x68')])){_0x171e24[_0x71fa('0x6a')]+='\x20'+_0x170f47[_0x71fa('0x68')];}}})[_0x71fa('0x6b')](function(){return db['CmHopperFinal'][_0x71fa('0x56')](_0x171e24);});}})[_0x71fa('0x22')](function(){return _0x583c0d[_0x71fa('0x17')](0xcc)[_0x71fa('0x18')]();})[_0x71fa('0x52')](handleError(_0x583c0d,null));};exports['getPreview']=function(_0x3dfb54,_0x1f14e4,_0x29e416){var _0x2675a4=[];return db[_0x71fa('0x65')][_0x71fa('0x58')]()[_0x71fa('0x22')](function(_0x1aa465){_0x2675a4=_[_0x71fa('0x2d')](_0x1aa465);return _0x3dfb54[_0x71fa('0x5f')]['getVoiceQueues']({'where':{'type':_0x71fa('0x6c'),'dialActive':!![],'dialMethod':_0x71fa('0x6d')},'attributes':['id',_0x71fa('0x6e'),_0x71fa('0x6f')],'raw':!![]});})[_0x71fa('0x22')](function(_0x2e247f){if(_0x2e247f&&_0x2e247f['length']){return db[_0x71fa('0x70')][_0x71fa('0x71')](function(_0x495291){var _0x17a6bb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x71fa('0x72')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x2e247f,'id')},'$or':[{'UserId':null},{'UserId':_0x3dfb54[_0x71fa('0x5f')]['id']}]};var _0x1d99c5={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2e247f)['filter']([_0x71fa('0x6f'),0x0])['map']('id')[_0x71fa('0x73')]()},'$or':[{'UserId':null},{'UserId':_0x3dfb54[_0x71fa('0x5f')]['id']}]};var _0x3d7cc7={'$or':[_0x17a6bb,_0x1d99c5]};var _0x13118d=[];if(_0x3dfb54['body']['direction']&&_0x3dfb54[_0x71fa('0x57')][_0x71fa('0x74')]===_0x71fa('0x75')){if(!_['isEmpty'](_0x3dfb54[_0x71fa('0x57')]['hopperIds'])){_0x3d7cc7['id']={'$in':_0x3dfb54[_0x71fa('0x57')][_0x71fa('0x76')]};}_0x13118d=[[_0x71fa('0x77'),_0x71fa('0x78')],[_0x71fa('0x79'),_0x2e247f[0x0]['dialOrderByScheduledAt']===_0x71fa('0x78')?_0x71fa('0x7a'):_0x71fa('0x78')],db[_0x71fa('0x70')][_0x71fa('0x7b')](_0x71fa('0x7c')),['id',_0x71fa('0x7a')]];}else{if(!_[_0x71fa('0x7d')](_0x3dfb54[_0x71fa('0x57')][_0x71fa('0x76')])){_0x3d7cc7['id']={'$notIn':_0x3dfb54['body'][_0x71fa('0x76')]};}_0x13118d=[[_0x71fa('0x77'),'DESC'],['scheduledAt',_0x2e247f[0x0][_0x71fa('0x6e')]],db[_0x71fa('0x70')][_0x71fa('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x71fa('0x78')]];}return db[_0x71fa('0x4d')][_0x71fa('0x7e')]({'attributes':['id',_0x71fa('0x7f'),_0x71fa('0x80')],'where':_0x3d7cc7,'order':_0x13118d,'transaction':_0x495291,'lock':_0x495291[_0x71fa('0x81')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x71fa('0x82'),'attributes':_0x2675a4,'include':[{'model':db[_0x71fa('0x83')],'as':_0x71fa('0x84'),'attributes':['id',_0x71fa('0x24')]}]},{'model':db[_0x71fa('0x85')],'as':_0x71fa('0x86'),'attributes':['id',_0x71fa('0x24')]},{'model':db['VoiceQueue'],'as':_0x71fa('0x87'),'attributes':['id',_0x71fa('0x24'),_0x71fa('0x88')]}]})[_0x71fa('0x22')](function(_0x2476d8){if(_0x2476d8){return _0x2476d8[_0x71fa('0x21')]({'UserId':_0x3dfb54[_0x71fa('0x5f')]['id']},{'transaction':_0x495291});}});});}})[_0x71fa('0x22')](handleEntityNotFound(_0x1f14e4,null))[_0x71fa('0x22')](respondWithResult(_0x1f14e4,null))[_0x71fa('0x52')](handleError(_0x1f14e4,null));};exports[_0x71fa('0x89')]=function(_0xb655bc,_0x3d554d,_0x102dfa){var _0x17fde4=[];return db[_0x71fa('0x65')][_0x71fa('0x58')]()[_0x71fa('0x22')](function(_0x4d5448){_0x17fde4=_[_0x71fa('0x2d')](_0x4d5448);return _0xb655bc[_0x71fa('0x5f')][_0x71fa('0x8a')]({'where':{'type':_0x71fa('0x6c'),'dialActive':!![],'dialMethod':_0x71fa('0x6d')},'attributes':['id',_0x71fa('0x6e'),_0x71fa('0x6f')],'raw':!![]});})[_0x71fa('0x22')](function(_0x3e6116){if(_0x3e6116&&_0x3e6116[_0x71fa('0x43')]){return db[_0x71fa('0x70')][_0x71fa('0x71')](function(_0x3fbd34){var _0x4020fb={'active':![],'recallme':!![],'id':_0xb655bc['body'][_0x71fa('0x8b')]};return db['CmHopper'][_0x71fa('0x7e')]({'attributes':['id',_0x71fa('0x7f'),'recallme'],'where':_0x4020fb,'transaction':_0x3fbd34,'lock':_0x3fbd34[_0x71fa('0x81')][_0x71fa('0x8c')],'include':[{'model':db[_0x71fa('0x65')],'as':_0x71fa('0x82'),'attributes':_0x17fde4,'include':[{'model':db['CmCompany'],'as':_0x71fa('0x84'),'attributes':['id',_0x71fa('0x24')]}]},{'model':db[_0x71fa('0x85')],'as':_0x71fa('0x86'),'attributes':['id',_0x71fa('0x24')]},{'model':db[_0x71fa('0x8d')],'as':_0x71fa('0x87'),'attributes':['id',_0x71fa('0x24'),'dialActive']}]})[_0x71fa('0x22')](function(_0x373191){if(_0x373191){return _0x373191[_0x71fa('0x21')]({'UserId':_0xb655bc[_0x71fa('0x5f')]['id']},{'transaction':_0x3fbd34});}});});}})[_0x71fa('0x22')](handleEntityNotFound(_0x3d554d,null))[_0x71fa('0x22')](respondWithResult(_0x3d554d,null))[_0x71fa('0x52')](handleError(_0x3d554d,null));};exports[_0x71fa('0x8e')]=function(_0xea510e,_0x371bdb,_0x38b5c3){return _0xea510e[_0x71fa('0x5f')][_0x71fa('0x8a')]({'where':{'type':_0x71fa('0x6c'),'dialActive':!![],'dialMethod':_0x71fa('0x6d')},'attributes':['id'],'raw':!![]})[_0x71fa('0x22')](function(_0xa80d15){if(_0xa80d15&&_0xa80d15[_0x71fa('0x43')]){return db['CmHopper'][_0x71fa('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x71fa('0x72')](_0x71fa('0x62'))},'VoiceQueueId':{'$in':_['map'](_0xa80d15,'id')},'$or':[{'UserId':null},{'UserId':_0xea510e[_0x71fa('0x5f')]['id']}]}});}return 0x0;})[_0x71fa('0x22')](function(_0x16584a){if(!_[_0x71fa('0x69')](_0x16584a)&&_['isNumber'](_0x16584a)){return _0x371bdb[_0x71fa('0x17')](0xc8)[_0x71fa('0x19')]({'contacts':_0x16584a});}else{logger[_0x71fa('0x8f')](_0x71fa('0x90'),_0x71fa('0x8e'),0x194,_0x71fa('0x91'));_0x371bdb[_0x71fa('0x16')](0x194);}})['catch'](handleError(_0x371bdb,null));};exports['getTimezones']=function(_0x43392e,_0x5f1424,_0xce9db8){var _0x291316=shared['timezones'];var _0x5ede76=[];_[_0x71fa('0x27')](_0x291316,function(_0x4f7e46){_0x5ede76[_0x71fa('0x92')]({'id':_0x4f7e46[_0x71fa('0x24')],'name':_0x4f7e46[_0x71fa('0x24')],'utcOffset':_0x4f7e46[_0x71fa('0x93')]});});return _0x5f1424[_0x71fa('0x17')](0xc8)[_0x71fa('0x19')]({'tz':_0x5ede76});};exports[_0x71fa('0x94')]=function(_0x12f797,_0x30fcd2,_0x1d9810){var _0x424a52=shared['timezones'];var _0x572421={};if(!_[_0x71fa('0x69')](_0x424a52[_0x12f797[_0x71fa('0x57')]['id']]))_0x572421=_0x424a52[_0x12f797['body']['id']];return _0x30fcd2[_0x71fa('0x17')](0xc8)[_0x71fa('0x19')](_0x572421);}; \ No newline at end of file +var _0xfba1=['ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$notILike','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','count','includeAll','include','findAll','catch','create','body','find','params','describe','destroy','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','VoiceQueueId','queue','ivr','CmContact','ContactId','calleridname','firstName','isNil','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','dialActive','preview','hopperId','recallme','CmList','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x587981,_0x1ce02c){var _0x1b4572=function(_0x71204f){while(--_0x71204f){_0x587981['push'](_0x587981['shift']());}};_0x1b4572(++_0x1ce02c);}(_0xfba1,0x132));var _0x1fba=function(_0x1df1a6,_0x3846d5){_0x1df1a6=_0x1df1a6-0x0;var _0x19847f=_0xfba1[_0x1df1a6];return _0x19847f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1fba('0x0'));var zipdir=require(_0x1fba('0x1'));var jsonpatch=require(_0x1fba('0x2'));var rp=require('request-promise');var moment=require(_0x1fba('0x3'));var BPromise=require(_0x1fba('0x4'));var Mustache=require(_0x1fba('0x5'));var util=require(_0x1fba('0x6'));var path=require(_0x1fba('0x7'));var sox=require(_0x1fba('0x8'));var csv=require(_0x1fba('0x9'));var ejs=require(_0x1fba('0xa'));var fs=require('fs');var fs_extra=require(_0x1fba('0xb'));var _=require(_0x1fba('0xc'));var squel=require('squel');var crypto=require(_0x1fba('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fba('0xe'));var toCsv=require(_0x1fba('0x9'));var querystring=require(_0x1fba('0xf'));var Papa=require(_0x1fba('0x10'));var Redis=require(_0x1fba('0x11'));var authService=require(_0x1fba('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fba('0x13'));var logger=require(_0x1fba('0x14'))(_0x1fba('0x15'));var utils=require(_0x1fba('0x16'));var config=require(_0x1fba('0x17'));var shared=require(_0x1fba('0x17'));var licenseUtil=require(_0x1fba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c0c50,_0x4556ee){_0x4556ee=_0x4556ee||0xcc;return function(_0x3c718b){if(_0x3c718b){return _0x5c0c50[_0x1fba('0x19')](_0x4556ee);}return _0x5c0c50[_0x1fba('0x1a')](_0x4556ee)[_0x1fba('0x1b')]();};}function respondWithResult(_0x16d956,_0x3cc61d){_0x3cc61d=_0x3cc61d||0xc8;return function(_0xbce064){if(_0xbce064){return _0x16d956[_0x1fba('0x1a')](_0x3cc61d)[_0x1fba('0x1c')](_0xbce064);}};}function respondWithFilteredResult(_0x255055,_0x91c3e6){return function(_0x305460){if(_0x305460){var _0xdbbb9c=typeof _0x91c3e6[_0x1fba('0x1d')]===_0x1fba('0x1e')&&typeof _0x91c3e6['limit']==='undefined';var _0x2af978=_0x305460['count'];var _0x5ef4ca=_0xdbbb9c?0x0:_0x91c3e6[_0x1fba('0x1d')];var _0x117cf5=_0xdbbb9c?_0x305460['count']:_0x91c3e6['offset']+_0x91c3e6[_0x1fba('0x1f')];var _0x556179;if(_0x117cf5>=_0x2af978){_0x117cf5=_0x2af978;_0x556179=0xc8;}else{_0x556179=0xce;}_0x255055[_0x1fba('0x1a')](_0x556179);return _0x255055[_0x1fba('0x20')](_0x1fba('0x21'),_0x5ef4ca+'-'+_0x117cf5+'/'+_0x2af978)['json'](_0x305460);}return null;};}function patchUpdates(_0x217d0f){return function(_0x2390a7){try{jsonpatch[_0x1fba('0x22')](_0x2390a7,_0x217d0f,!![]);}catch(_0x57332b){return BPromise[_0x1fba('0x23')](_0x57332b);}return _0x2390a7[_0x1fba('0x24')]();};}function saveUpdates(_0x5d72ac,_0x3b2bb2){return function(_0x2ba0b2){if(_0x2ba0b2){return _0x2ba0b2[_0x1fba('0x25')](_0x5d72ac)[_0x1fba('0x26')](function(_0x343d0b){return _0x343d0b;});}return null;};}function removeEntity(_0x144054,_0x3ed5a9){return function(_0x164bff){if(_0x164bff){return _0x164bff['destroy']()['then'](function(){_0x144054['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x543f57,_0x1e166b){return function(_0x1b8ae6){if(!_0x1b8ae6){_0x543f57[_0x1fba('0x19')](0x194);}return _0x1b8ae6;};}function handleError(_0x16c1e8,_0x2e1949){_0x2e1949=_0x2e1949||0x1f4;return function(_0x698dd5){logger[_0x1fba('0x27')](_0x698dd5[_0x1fba('0x28')]);if(_0x698dd5[_0x1fba('0x29')]){delete _0x698dd5[_0x1fba('0x29')];}_0x16c1e8[_0x1fba('0x1a')](_0x2e1949)['send'](_0x698dd5);};}exports[_0x1fba('0x2a')]=function(_0x45c929,_0x3803ee){var _0x4cc477={},_0x5940cc={},_0x197301={'count':0x0,'rows':[]};var _0x309213=_[_0x1fba('0x2b')](db[_0x1fba('0x2c')][_0x1fba('0x2d')],function(_0x368e6b){return{'name':_0x368e6b[_0x1fba('0x2e')],'type':_0x368e6b['type'][_0x1fba('0x2f')]};});_0x5940cc[_0x1fba('0x30')]=_['map'](_0x309213,'name');_0x5940cc[_0x1fba('0x31')]=_[_0x1fba('0x32')](_0x45c929[_0x1fba('0x31')]);_0x5940cc[_0x1fba('0x33')]=_[_0x1fba('0x34')](_0x5940cc[_0x1fba('0x30')],_0x5940cc[_0x1fba('0x31')]);_0x5940cc[_0x1fba('0x33')]=_[_0x1fba('0x35')](_0x5940cc[_0x1fba('0x33')],[_0x1fba('0x36'),'$or',_0x1fba('0x37'),_0x1fba('0x38'),_0x1fba('0x39'),_0x1fba('0x3a'),_0x1fba('0x3b'),'$eq','$not',_0x1fba('0x3c'),_0x1fba('0x3d'),_0x1fba('0x3e'),'$notIn',_0x1fba('0x3f'),_0x1fba('0x40'),'$iLike',_0x1fba('0x41'),'$like','$overlap','$contains',_0x1fba('0x42'),_0x1fba('0x43')]);_0x4cc477[_0x1fba('0x44')]=_[_0x1fba('0x34')](_0x5940cc[_0x1fba('0x30')],qs['fields'](_0x45c929['query'][_0x1fba('0x45')]));_0x4cc477[_0x1fba('0x44')]=_0x4cc477[_0x1fba('0x44')][_0x1fba('0x46')]?_0x4cc477[_0x1fba('0x44')]:_0x5940cc['model'];if(!_0x45c929['query'][_0x1fba('0x47')](_0x1fba('0x48'))){_0x4cc477[_0x1fba('0x1f')]=qs[_0x1fba('0x1f')](_0x45c929[_0x1fba('0x31')][_0x1fba('0x1f')]);_0x4cc477[_0x1fba('0x1d')]=qs[_0x1fba('0x1d')](_0x45c929[_0x1fba('0x31')]['offset']);}_0x4cc477[_0x1fba('0x49')]=qs[_0x1fba('0x4a')](_0x45c929[_0x1fba('0x31')]['sort']);_0x4cc477['where']=qs[_0x1fba('0x33')](_[_0x1fba('0x4b')](_0x45c929[_0x1fba('0x31')],_0x5940cc[_0x1fba('0x33')]),_0x309213);if(_0x45c929[_0x1fba('0x31')]['filter']){_0x4cc477[_0x1fba('0x4c')]=_[_0x1fba('0x4d')](_0x4cc477[_0x1fba('0x4c')],{'$or':_['map'](_0x309213,function(_0x3763d2){if(_0x3763d2[_0x1fba('0x4e')]!=='VIRTUAL'){var _0x45f09c={};_0x45f09c[_0x3763d2[_0x1fba('0x29')]]={'$like':'%'+_0x45c929['query'][_0x1fba('0x4f')]+'%'};return _0x45f09c;}})});}_0x4cc477=_[_0x1fba('0x4d')]({},_0x4cc477,_0x45c929[_0x1fba('0x50')]);var _0x4f8976={'where':_0x4cc477['where']};return db[_0x1fba('0x2c')]['count'](_0x4f8976)[_0x1fba('0x26')](function(_0x5d5275){_0x197301[_0x1fba('0x51')]=_0x5d5275;if(_0x45c929[_0x1fba('0x31')][_0x1fba('0x52')]){_0x4cc477[_0x1fba('0x53')]=[{'all':!![]}];}return db[_0x1fba('0x2c')][_0x1fba('0x54')](_0x4cc477);})[_0x1fba('0x26')](function(_0xbc25c8){_0x197301['rows']=_0xbc25c8;return _0x197301;})[_0x1fba('0x26')](respondWithFilteredResult(_0x3803ee,_0x4cc477))[_0x1fba('0x55')](handleError(_0x3803ee,null));};exports['show']=function(_0x3f7179,_0x3213ae){var _0x2e8692={'raw':!![],'where':{'id':_0x3f7179['params']['id']}},_0x8d7343={};_0x8d7343[_0x1fba('0x30')]=_['keys'](db[_0x1fba('0x2c')]['rawAttributes']);_0x8d7343[_0x1fba('0x31')]=_[_0x1fba('0x32')](_0x3f7179[_0x1fba('0x31')]);_0x8d7343['filters']=_[_0x1fba('0x34')](_0x8d7343[_0x1fba('0x30')],_0x8d7343[_0x1fba('0x31')]);_0x2e8692[_0x1fba('0x44')]=_[_0x1fba('0x34')](_0x8d7343[_0x1fba('0x30')],qs[_0x1fba('0x45')](_0x3f7179['query'][_0x1fba('0x45')]));_0x2e8692[_0x1fba('0x44')]=_0x2e8692[_0x1fba('0x44')][_0x1fba('0x46')]?_0x2e8692[_0x1fba('0x44')]:_0x8d7343[_0x1fba('0x30')];if(_0x3f7179[_0x1fba('0x31')][_0x1fba('0x52')]){_0x2e8692[_0x1fba('0x53')]=[{'all':!![]}];}_0x2e8692=_[_0x1fba('0x4d')]({},_0x2e8692,_0x3f7179['options']);return db[_0x1fba('0x2c')]['find'](_0x2e8692)[_0x1fba('0x26')](handleEntityNotFound(_0x3213ae,null))['then'](respondWithResult(_0x3213ae,null))[_0x1fba('0x55')](handleError(_0x3213ae,null));};exports[_0x1fba('0x56')]=function(_0x7bf511,_0x4d2a0e){return db[_0x1fba('0x2c')][_0x1fba('0x56')](_0x7bf511[_0x1fba('0x57')],{})[_0x1fba('0x26')](respondWithResult(_0x4d2a0e,0xc9))[_0x1fba('0x55')](handleError(_0x4d2a0e,null));};exports[_0x1fba('0x25')]=function(_0x5a4d7e,_0x3b2fa5){if(_0x5a4d7e[_0x1fba('0x57')]['id']){delete _0x5a4d7e[_0x1fba('0x57')]['id'];}return db['CmHopper'][_0x1fba('0x58')]({'where':{'id':_0x5a4d7e[_0x1fba('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b2fa5,null))[_0x1fba('0x26')](saveUpdates(_0x5a4d7e['body'],null))[_0x1fba('0x26')](respondWithResult(_0x3b2fa5,null))['catch'](handleError(_0x3b2fa5,null));};exports[_0x1fba('0x5a')]=function(_0xb3ccdf,_0x591222){return db['CmHopper'][_0x1fba('0x5a')]()[_0x1fba('0x26')](respondWithResult(_0x591222,null))[_0x1fba('0x55')](handleError(_0x591222,null));};exports[_0x1fba('0x5b')]=function(_0x3dca34,_0xf72e62){var _0x1f6239;return db[_0x1fba('0x2c')][_0x1fba('0x58')]({'where':{'id':_0x3dca34[_0x1fba('0x59')]['id']}})['then'](handleEntityNotFound(_0xf72e62,null))[_0x1fba('0x26')](function(_0x3d0772){if(_0x3d0772){return _0x3d0772[_0x1fba('0x5b')]()[_0x1fba('0x26')](function(_0x1c968f){return _0x1c968f;});}})[_0x1fba('0x26')](function(_0x775753){_0x1f6239=_0x775753;if(_0x775753){if(_0x775753['VoiceQueueId']||_0x775753[_0x1fba('0x5c')]){return db[_0x775753['VoiceQueueId']?_0x1fba('0x5d'):_0x1fba('0x5e')][_0x1fba('0x58')]({'where':{'id':_0x775753['VoiceQueueId']?_0x775753['VoiceQueueId']:_0x775753[_0x1fba('0x5c')]},'attributes':['id',_0x1fba('0x29')],'raw':!![]});}}})[_0x1fba('0x26')](function(_0x5f4393){var _0x1a73bf={};if(_0x5f4393){_['merge'](_0x1a73bf,_[_0x1fba('0x5f')](_0x1f6239[_0x1fba('0x60')],[_0x1fba('0x61'),_0x1fba('0x62'),'id']));_0x1a73bf[_0x1fba('0x63')]=0x15;_0x1a73bf[_0x1fba('0x64')]=_0x1fba('0x65');_0x1a73bf[_0x1fba('0x66')]=_0x5f4393['name'];_0x1a73bf[_0x1fba('0x67')]=_0x3dca34[_0x1fba('0x68')]['name'];_0x1a73bf[_0x1fba('0x69')]=_0x3dca34[_0x1fba('0x68')]['id'];_0x1a73bf[_0x1fba('0x65')]=!![];_0x1a73bf['deletedat']=moment()[_0x1fba('0x6a')](_0x1fba('0x6b'));_0x1a73bf[_0x1fba('0x6c')]=_0x1f6239[_0x1fba('0x6d')];_0x1a73bf[_0x1fba('0x6e')]=_0x1f6239[_0x1fba('0x6f')]?_0x1fba('0x70'):_0x1fba('0x71');return db[_0x1fba('0x72')]['find']({'where':{'id':_0x1a73bf[_0x1fba('0x73')]},'attributes':['firstName','lastName']})['then'](function(_0xf23e2c){if(!_['isNil'](_0xf72e62)&&!_['isNil'](_0xf23e2c['firstName'])){_0x1a73bf[_0x1fba('0x74')]=_0xf23e2c[_0x1fba('0x75')];if(!_[_0x1fba('0x76')](_0xf23e2c[_0x1fba('0x77')])){_0x1a73bf[_0x1fba('0x74')]+='\x20'+_0xf23e2c[_0x1fba('0x77')];}}})[_0x1fba('0x78')](function(){return db[_0x1fba('0x79')][_0x1fba('0x56')](_0x1a73bf);});}})[_0x1fba('0x26')](function(){return _0xf72e62[_0x1fba('0x1a')](0xcc)[_0x1fba('0x1b')]();})['catch'](handleError(_0xf72e62,null));};exports[_0x1fba('0x7a')]=function(_0x5a5e1f,_0x235aec,_0x583d10){var _0x9f4fd9=[];return db['CmContact'][_0x1fba('0x5a')]()[_0x1fba('0x26')](function(_0x53c05e){_0x9f4fd9=_['keys'](_0x53c05e);return _0x5a5e1f[_0x1fba('0x68')][_0x1fba('0x7b')]({'where':{'type':_0x1fba('0x7c'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x1fba('0x7d'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x1fba('0x26')](function(_0x4f884b){if(_0x4f884b&&_0x4f884b[_0x1fba('0x46')]){return db[_0x1fba('0x7e')][_0x1fba('0x7f')](function(_0x21f2bc){var _0x50c1a1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1fba('0x6a')](_0x1fba('0x6b'))},'VoiceQueueId':{'$in':_[_0x1fba('0x2b')](_0x4f884b,'id')},'$or':[{'UserId':null},{'UserId':_0x5a5e1f[_0x1fba('0x68')]['id']}]};var _0x245dc2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4f884b)[_0x1fba('0x4f')]([_0x1fba('0x80'),0x0])['map']('id')[_0x1fba('0x81')]()},'$or':[{'UserId':null},{'UserId':_0x5a5e1f[_0x1fba('0x68')]['id']}]};var _0x524dd1={'$or':[_0x50c1a1,_0x245dc2]};var _0x51b54a=[];if(_0x5a5e1f[_0x1fba('0x57')]['direction']&&_0x5a5e1f[_0x1fba('0x57')][_0x1fba('0x82')]===_0x1fba('0x83')){if(!_[_0x1fba('0x84')](_0x5a5e1f[_0x1fba('0x57')][_0x1fba('0x85')])){_0x524dd1['id']={'$in':_0x5a5e1f[_0x1fba('0x57')][_0x1fba('0x85')]};}_0x51b54a=[['priority',_0x1fba('0x86')],[_0x1fba('0x87'),_0x4f884b[0x0][_0x1fba('0x7d')]==='ASC'?_0x1fba('0x88'):_0x1fba('0x86')],db['sequelize'][_0x1fba('0x89')](_0x1fba('0x8a')),['id',_0x1fba('0x88')]];}else{if(!_[_0x1fba('0x84')](_0x5a5e1f[_0x1fba('0x57')][_0x1fba('0x85')])){_0x524dd1['id']={'$notIn':_0x5a5e1f[_0x1fba('0x57')][_0x1fba('0x85')]};}_0x51b54a=[['priority',_0x1fba('0x88')],[_0x1fba('0x87'),_0x4f884b[0x0][_0x1fba('0x7d')]],db[_0x1fba('0x7e')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x1fba('0x2c')][_0x1fba('0x8b')]({'attributes':['id',_0x1fba('0x8c'),'recallme'],'where':_0x524dd1,'order':_0x51b54a,'transaction':_0x21f2bc,'lock':_0x21f2bc[_0x1fba('0x8d')][_0x1fba('0x8e')],'include':[{'model':db['CmContact'],'as':_0x1fba('0x8f'),'attributes':_0x9f4fd9,'include':[{'model':db[_0x1fba('0x90')],'as':_0x1fba('0x91'),'attributes':['id',_0x1fba('0x29')]}]},{'model':db['CmList'],'as':_0x1fba('0x92'),'attributes':['id',_0x1fba('0x29')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x1fba('0x29'),_0x1fba('0x93')]}]})[_0x1fba('0x26')](function(_0x59bd91){if(_0x59bd91){return _0x59bd91[_0x1fba('0x25')]({'UserId':_0x5a5e1f[_0x1fba('0x68')]['id']},{'transaction':_0x21f2bc});}});});}})[_0x1fba('0x26')](handleEntityNotFound(_0x235aec,null))[_0x1fba('0x26')](respondWithResult(_0x235aec,null))[_0x1fba('0x55')](handleError(_0x235aec,null));};exports['getPreviewRecall']=function(_0x2755ce,_0x17f676,_0x363f83){var _0x397ac2=[];return db[_0x1fba('0x72')]['describe']()['then'](function(_0x1047a8){_0x397ac2=_[_0x1fba('0x32')](_0x1047a8);return _0x2755ce['user'][_0x1fba('0x7b')]({'where':{'type':_0x1fba('0x7c'),'dialActive':!![],'dialMethod':_0x1fba('0x94')},'attributes':['id',_0x1fba('0x7d'),_0x1fba('0x80')],'raw':!![]});})['then'](function(_0x304f6e){if(_0x304f6e&&_0x304f6e[_0x1fba('0x46')]){return db[_0x1fba('0x7e')][_0x1fba('0x7f')](function(_0x5cfe76){var _0x4c6f3f={'active':![],'recallme':!![],'id':_0x2755ce[_0x1fba('0x57')][_0x1fba('0x95')]};return db[_0x1fba('0x2c')][_0x1fba('0x8b')]({'attributes':['id',_0x1fba('0x8c'),_0x1fba('0x96')],'where':_0x4c6f3f,'transaction':_0x5cfe76,'lock':_0x5cfe76[_0x1fba('0x8d')][_0x1fba('0x8e')],'include':[{'model':db['CmContact'],'as':_0x1fba('0x8f'),'attributes':_0x397ac2,'include':[{'model':db[_0x1fba('0x90')],'as':_0x1fba('0x91'),'attributes':['id','name']}]},{'model':db[_0x1fba('0x97')],'as':'List','attributes':['id',_0x1fba('0x29')]},{'model':db[_0x1fba('0x5d')],'as':'Queue','attributes':['id',_0x1fba('0x29'),_0x1fba('0x93')]}]})[_0x1fba('0x26')](function(_0x115980){if(_0x115980){return _0x115980['update']({'UserId':_0x2755ce['user']['id']},{'transaction':_0x5cfe76});}});});}})[_0x1fba('0x26')](handleEntityNotFound(_0x17f676,null))[_0x1fba('0x26')](respondWithResult(_0x17f676,null))[_0x1fba('0x55')](handleError(_0x17f676,null));};exports[_0x1fba('0x98')]=function(_0x5f0b02,_0x5ed996,_0x14d96a){return _0x5f0b02[_0x1fba('0x68')][_0x1fba('0x7b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x1fba('0x94')},'attributes':['id'],'raw':!![]})[_0x1fba('0x26')](function(_0x51eb6e){if(_0x51eb6e&&_0x51eb6e[_0x1fba('0x46')]){return db[_0x1fba('0x2c')][_0x1fba('0x51')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1fba('0x6a')](_0x1fba('0x6b'))},'VoiceQueueId':{'$in':_[_0x1fba('0x2b')](_0x51eb6e,'id')},'$or':[{'UserId':null},{'UserId':_0x5f0b02[_0x1fba('0x68')]['id']}]}});}return 0x0;})[_0x1fba('0x26')](function(_0x18bad8){if(!_[_0x1fba('0x76')](_0x18bad8)&&_['isNumber'](_0x18bad8)){return _0x5ed996[_0x1fba('0x1a')](0xc8)[_0x1fba('0x1c')]({'contacts':_0x18bad8});}else{logger['error'](_0x1fba('0x99'),_0x1fba('0x98'),0x194,_0x1fba('0x9a'));_0x5ed996[_0x1fba('0x19')](0x194);}})[_0x1fba('0x55')](handleError(_0x5ed996,null));};exports[_0x1fba('0x9b')]=function(_0x5ac042,_0x3beaa8,_0x44edbe){var _0x5ac13e=shared[_0x1fba('0x9c')];var _0x16dc82=[];_[_0x1fba('0x2b')](_0x5ac13e,function(_0x4dc29d){_0x16dc82['push']({'id':_0x4dc29d[_0x1fba('0x29')],'name':_0x4dc29d[_0x1fba('0x29')],'utcOffset':_0x4dc29d[_0x1fba('0x9d')]});});return _0x3beaa8['status'](0xc8)[_0x1fba('0x1c')]({'tz':_0x16dc82});};exports['getTimezone']=function(_0x298821,_0x31a80b,_0x30f059){var _0x462aa9=shared[_0x1fba('0x9c')];var _0x3c8bef={};if(!_[_0x1fba('0x76')](_0x462aa9[_0x298821[_0x1fba('0x57')]['id']]))_0x3c8bef=_0x462aa9[_0x298821[_0x1fba('0x57')]['id']];return _0x31a80b[_0x1fba('0x1a')](0xc8)[_0x1fba('0x1c')](_0x3c8bef);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index de7df16..2237d4f 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 _0x7096=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api'];(function(_0x333f55,_0x4b800e){var _0xea3b68=function(_0x3f8db2){while(--_0x3f8db2){_0x333f55['push'](_0x333f55['shift']());}};_0xea3b68(++_0x4b800e);}(_0x7096,0x10c));var _0x6709=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7096[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x6709('0xd')]},{'name':_0x6709('0xe'),'fields':[_0x6709('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x508e38,_0x2ef385){var _0x282ff4=function(_0x4a85a8){while(--_0x4a85a8){_0x508e38['push'](_0x508e38['shift']());}};_0x282ff4(++_0x2ef385);}(_0x5d17,0x114));var _0x75d1=function(_0x18bfdb,_0x241d43){_0x18bfdb=_0x18bfdb-0x0;var _0x44334c=_0x5d17[_0x18bfdb];return _0x44334c;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[{'name':_0x75d1('0xc'),'fields':[_0x75d1('0xc')]},{'name':_0x75d1('0xd'),'fields':['phone']},{'name':'priority','fields':[_0x75d1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index d024f8a..13ce76a 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 _0x59aa=['CmContact','describe','transaction','order','Contact','keys','User','Agent','voicePause','length','UserId','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','LOCK','UPDATE','GetContactRecallMe','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','interval','\x20MINUTE','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowCmHopper','CmHopper','find','then','create','CreateCmHopper','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','destroy'];(function(_0xdfcf97,_0x3459dc){var _0x541b99=function(_0x3b2db1){while(--_0x3b2db1){_0xdfcf97['push'](_0xdfcf97['shift']());}};_0x541b99(++_0x3459dc);}(_0x59aa,0x1dd));var _0xa59a=function(_0x3344c0,_0x18a644){_0x3344c0=_0x3344c0-0x0;var _0x409cb7=_0x59aa[_0x3344c0];return _0x409cb7;};'use strict';var _=require(_0xa59a('0x0'));var util=require(_0xa59a('0x1'));var moment=require(_0xa59a('0x2'));var BPromise=require(_0xa59a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa59a('0x4'));var db=require(_0xa59a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa59a('0x6'))(_0xa59a('0x7'));var config=require(_0xa59a('0x8'));var jayson=require(_0xa59a('0x9'));const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0xa59a('0xa')][_0xa59a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b2bca,_0x4746fa,_0x1520ac){return new BPromise(function(_0x28d322,_0x3542bf){return client['request'](_0x2b2bca,_0x1520ac)['then'](function(_0x266235){logger['info'](_0xa59a('0xc'),_0x4746fa,'request\x20sent');logger['debug'](_0xa59a('0xd'),_0x4746fa,_0xa59a('0xe'),JSON[_0xa59a('0xf')](_0x266235));if(_0x266235[_0xa59a('0x10')]){if(_0x266235[_0xa59a('0x10')]['code']===0x1f4){logger[_0xa59a('0x10')]('CmHopper,\x20%s,\x20%s',_0x4746fa,_0x266235[_0xa59a('0x10')][_0xa59a('0x11')]);return _0x3542bf(_0x266235[_0xa59a('0x10')][_0xa59a('0x11')]);}logger[_0xa59a('0x10')](_0xa59a('0xc'),_0x4746fa,_0x266235['error'][_0xa59a('0x11')]);return _0x28d322(_0x266235[_0xa59a('0x10')][_0xa59a('0x11')]);}else{logger[_0xa59a('0x12')]('CmHopper,\x20%s,\x20%s',_0x4746fa,_0xa59a('0xe'));_0x28d322(_0x266235[_0xa59a('0x13')][_0xa59a('0x11')]);}})[_0xa59a('0x14')](function(_0x1c7aa7){logger[_0xa59a('0x10')](_0xa59a('0xc'),_0x4746fa,_0x1c7aa7);_0x3542bf(_0x1c7aa7);});});}exports[_0xa59a('0x15')]=function(_0x43cf40){var _0x238892=this;return new Promise(function(_0x3046ec,_0x446abb){return db['CmHopper'][_0xa59a('0x16')]({'raw':_0x43cf40[_0xa59a('0x17')]?_0x43cf40[_0xa59a('0x17')][_0xa59a('0x18')]===undefined?!![]:![]:!![],'where':_0x43cf40['options']?_0x43cf40[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'attributes':_0x43cf40[_0xa59a('0x17')]?_0x43cf40[_0xa59a('0x17')][_0xa59a('0x1a')]||null:null,'limit':_0x43cf40[_0xa59a('0x17')]?_0x43cf40[_0xa59a('0x17')][_0xa59a('0x1b')]||null:null,'include':_0x43cf40[_0xa59a('0x17')]?_0x43cf40[_0xa59a('0x17')][_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x43cf40[_0xa59a('0x17')][_0xa59a('0x1c')],function(_0x3e67ef){return{'model':db[_0x3e67ef[_0xa59a('0x1e')]],'as':_0x3e67ef['as'],'attributes':_0x3e67ef[_0xa59a('0x1a')],'include':_0x3e67ef[_0xa59a('0x1c')]?_['map'](_0x3e67ef[_0xa59a('0x1c')],function(_0x243a48){return{'model':db[_0x243a48[_0xa59a('0x1e')]],'as':_0x243a48['as'],'attributes':_0x243a48[_0xa59a('0x1a')],'include':_0x243a48[_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x243a48[_0xa59a('0x1c')],function(_0x3a640b){return{'model':db[_0x3a640b['model']],'as':_0x3a640b['as'],'attributes':_0x3a640b[_0xa59a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50d705){logger['info'](_0xa59a('0x15'),_0x43cf40);logger[_0xa59a('0x1f')](_0xa59a('0x15'),_0x43cf40,JSON[_0xa59a('0xf')](_0x50d705));_0x3046ec(_0x50d705);})[_0xa59a('0x14')](function(_0x22816a){logger[_0xa59a('0x10')](_0xa59a('0x15'),_0x22816a[_0xa59a('0x11')],_0x43cf40);_0x446abb(_0x238892[_0xa59a('0x10')](0x1f4,_0x22816a['message']));});});};exports[_0xa59a('0x20')]=function(_0x30e03c){var _0x863062=this;return new Promise(function(_0x19b495,_0x12f6bc){return db[_0xa59a('0x21')][_0xa59a('0x22')]({'raw':_0x30e03c[_0xa59a('0x17')]?_0x30e03c[_0xa59a('0x17')][_0xa59a('0x18')]===undefined?!![]:![]:!![],'where':_0x30e03c[_0xa59a('0x17')]?_0x30e03c[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'attributes':_0x30e03c['options']?_0x30e03c['options'][_0xa59a('0x1a')]||null:null,'include':_0x30e03c[_0xa59a('0x17')]?_0x30e03c['options'][_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x30e03c[_0xa59a('0x17')][_0xa59a('0x1c')],function(_0x37a28c){return{'model':db[_0x37a28c[_0xa59a('0x1e')]],'as':_0x37a28c['as'],'attributes':_0x37a28c[_0xa59a('0x1a')],'include':_0x37a28c[_0xa59a('0x1c')]?_['map'](_0x37a28c[_0xa59a('0x1c')],function(_0xf2f230){return{'model':db[_0xf2f230[_0xa59a('0x1e')]],'as':_0xf2f230['as'],'attributes':_0xf2f230[_0xa59a('0x1a')],'include':_0xf2f230[_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0xf2f230[_0xa59a('0x1c')],function(_0x1d26d5){return{'model':db[_0x1d26d5[_0xa59a('0x1e')]],'as':_0x1d26d5['as'],'attributes':_0x1d26d5[_0xa59a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa59a('0x23')](function(_0x1dbaa9){logger[_0xa59a('0x12')]('ShowCmHopper',_0x30e03c);logger[_0xa59a('0x1f')](_0xa59a('0x20'),_0x30e03c,JSON['stringify'](_0x1dbaa9));_0x19b495(_0x1dbaa9);})[_0xa59a('0x14')](function(_0x1278ff){logger[_0xa59a('0x10')](_0xa59a('0x20'),_0x1278ff[_0xa59a('0x11')],_0x30e03c);_0x12f6bc(_0x863062[_0xa59a('0x10')](0x1f4,_0x1278ff[_0xa59a('0x11')]));});});};exports['CreateCmHopper']=function(_0x4e8593){var _0x2c7003=this;return new Promise(function(_0x4a5908,_0xcd8cd6){return db[_0xa59a('0x21')][_0xa59a('0x24')](_0x4e8593['body'],{'raw':_0x4e8593[_0xa59a('0x17')]?_0x4e8593[_0xa59a('0x17')][_0xa59a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2c4223){logger[_0xa59a('0x12')](_0xa59a('0x25'),_0x4e8593);logger[_0xa59a('0x1f')](_0xa59a('0x25'),_0x4e8593,JSON[_0xa59a('0xf')](_0x2c4223));_0x4a5908(_0x2c4223);})[_0xa59a('0x14')](function(_0x30f505){logger[_0xa59a('0x10')](_0xa59a('0x25'),_0x30f505[_0xa59a('0x11')],_0x4e8593);_0xcd8cd6(_0x2c7003['error'](0x1f4,_0x30f505['message']));});});};exports['UpdateCmHopper']=function(_0x38124c){var _0x4356d3=this;return new Promise(function(_0x1255bb,_0x4d1549){return db[_0xa59a('0x21')][_0xa59a('0x26')](_0x38124c['body'],{'raw':_0x38124c[_0xa59a('0x17')]?_0x38124c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38124c['options']?_0x38124c[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'attributes':_0x38124c[_0xa59a('0x17')]?_0x38124c[_0xa59a('0x17')]['attributes']||null:null,'limit':_0x38124c[_0xa59a('0x17')]?_0x38124c[_0xa59a('0x17')][_0xa59a('0x1b')]||null:null})[_0xa59a('0x23')](function(_0x419c0c){logger['info'](_0xa59a('0x27'),_0x38124c);logger['info'](_0xa59a('0x28'),JSON[_0xa59a('0xf')](_0x38124c[_0xa59a('0x17')][_0xa59a('0x19')]),_0x38124c[_0xa59a('0x29')][_0xa59a('0x2a')]);logger[_0xa59a('0x1f')](_0xa59a('0x27'),_0x38124c,JSON[_0xa59a('0xf')](_0x419c0c));_0x1255bb(_0x419c0c);})[_0xa59a('0x14')](function(_0x1b35f4){logger[_0xa59a('0x10')]('UpdateCmHopper',_0x1b35f4[_0xa59a('0x11')],_0x38124c);_0x4d1549(_0x4356d3[_0xa59a('0x10')](0x1f4,_0x1b35f4[_0xa59a('0x11')]));});});};exports[_0xa59a('0x2b')]=function(_0x3ae84b){var _0x4430c8=this;return new Promise(function(_0x17516b,_0x66a283){return db[_0xa59a('0x21')][_0xa59a('0x2c')]({'where':_0x3ae84b['options']?_0x3ae84b[_0xa59a('0x17')][_0xa59a('0x19')]||null:null})[_0xa59a('0x23')](function(_0x4221b1){logger['info']('DestroyCmHopper',_0x3ae84b);logger[_0xa59a('0x1f')](_0xa59a('0x2b'),_0x3ae84b,JSON[_0xa59a('0xf')](_0x4221b1));_0x17516b(_0x4221b1);})[_0xa59a('0x14')](function(_0x2fd8b4){logger['error'](_0xa59a('0x2b'),_0x2fd8b4['message'],_0x3ae84b);_0x66a283(_0x4430c8['error'](0x1f4,_0x2fd8b4[_0xa59a('0x11')]));});});};exports['GetContactDialer']=function(_0x41fecb){var _0x52f9c6=this;return new Promise(function(_0x183037,_0x364728){return db[_0xa59a('0x2d')][_0xa59a('0x2e')]()[_0xa59a('0x23')](function(_0x2073c){return db['sequelize'][_0xa59a('0x2f')](function(_0x4eb2e8){return db[_0xa59a('0x21')]['findAll']({'where':_0x41fecb['options']?_0x41fecb['options']['where']||null:null,'attributes':_0x41fecb[_0xa59a('0x17')]?_0x41fecb['options']['attributes']||null:null,'limit':_0x41fecb[_0xa59a('0x17')]?_0x41fecb[_0xa59a('0x17')][_0xa59a('0x1b')]||null:null,'order':_0x41fecb[_0xa59a('0x17')]?_0x41fecb[_0xa59a('0x17')][_0xa59a('0x30')]||null:null,'transaction':_0x4eb2e8,'lock':_0x4eb2e8['LOCK']['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xa59a('0x31'),'attributes':_[_0xa59a('0x32')](_0x2073c)},{'model':db[_0xa59a('0x33')],'as':_0xa59a('0x34'),'attributes':['id','name',_0xa59a('0x35')]}]})[_0xa59a('0x23')](function(_0xf2b3f0){var _0x38bd21=[];var _0x2f8646=[];for(var _0x55f9ce=0x0;_0x55f9ce<_0xf2b3f0[_0xa59a('0x36')];_0x55f9ce+=0x1){var _0x202b0d=_0xf2b3f0[_0x55f9ce][_0xa59a('0x37')];if(_0x202b0d===null){_0x38bd21[_0xa59a('0x38')](_0xf2b3f0[_0x55f9ce][_0xa59a('0x26')](_0x41fecb[_0xa59a('0x29')],{'transaction':_0x4eb2e8}));}else if(!_0x2f8646[_0xa59a('0x39')](_0x202b0d)){_0x2f8646[_0xa59a('0x38')](_0x202b0d);_0x38bd21[_0xa59a('0x38')](_0xf2b3f0[_0x55f9ce][_0xa59a('0x26')](_0x41fecb[_0xa59a('0x29')],{'transaction':_0x4eb2e8}));}}return BPromise[_0xa59a('0x3a')](_0x38bd21);});})[_0xa59a('0x23')](function(_0x56be8e){logger[_0xa59a('0x12')](_0xa59a('0x3b'),_0x41fecb);if(_0x56be8e[_0xa59a('0x36')]>0x0){logger[_0xa59a('0x12')](_0xa59a('0x3c'),_0x56be8e[0x0][_0xa59a('0x3d')]['id'],_0x56be8e[0x0][_0xa59a('0x3d')][_0xa59a('0x3e')],_0x56be8e[0x0][_0xa59a('0x3d')][_0xa59a('0x2a')]);}logger[_0xa59a('0x1f')]('GetContactDialer',_0x41fecb,JSON[_0xa59a('0xf')](_0x56be8e));_0x183037(_0x56be8e);})[_0xa59a('0x14')](function(_0x19489e){logger[_0xa59a('0x10')](_0xa59a('0x3b'),_0x19489e[_0xa59a('0x11')],_0x41fecb);_0x364728(_0x52f9c6[_0xa59a('0x10')](0x1f4,_0x19489e[_0xa59a('0x11')]));});});});};exports[_0xa59a('0x3f')]=function(_0x340fbc){var _0x1eefc8=this;return new Promise(function(_0x190b15,_0x395d8e){return db[_0xa59a('0x40')][_0xa59a('0x2f')](function(_0xf35887){return db['CmHopperFinal'][_0xa59a('0x24')](_0x340fbc[_0xa59a('0x29')],{'raw':_0x340fbc['options']?_0x340fbc['options'][_0xa59a('0x18')]===undefined?!![]:![]:!![],'transaction':_0xf35887})['then'](function(){logger[_0xa59a('0x12')](_0xa59a('0x41'),JSON[_0xa59a('0xf')](_0x340fbc['options'][_0xa59a('0x19')]),_0x340fbc[_0xa59a('0x17')][_0xa59a('0x19')][_0xa59a('0x2a')]);return db[_0xa59a('0x21')][_0xa59a('0x2c')]({'where':_0x340fbc[_0xa59a('0x17')]?_0x340fbc[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'transaction':_0xf35887});});})[_0xa59a('0x23')](function(_0x205430){logger[_0xa59a('0x12')]('MoveContactManagedDialer',_0x340fbc);logger[_0xa59a('0x1f')]('MoveContactManagedDialer',_0x340fbc,JSON['stringify'](_0x205430));_0x190b15(_0x205430);})[_0xa59a('0x14')](function(_0x31da55){logger[_0xa59a('0x10')](_0xa59a('0x3f'),_0x31da55[_0xa59a('0x11')],_0x340fbc);_0x395d8e(_0x1eefc8[_0xa59a('0x10')](0x1f4,_0x31da55['message']));});});};exports[_0xa59a('0x42')]=function(_0x141e6a){var _0x23258c=this;return new Promise(function(_0xc492a1,_0x22897b){return db[_0xa59a('0x21')][_0xa59a('0x16')]({'raw':_0x141e6a[_0xa59a('0x17')]?_0x141e6a['options'][_0xa59a('0x18')]===undefined?!![]:![]:!![],'where':_0x141e6a['options']?_0x141e6a[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'attributes':[[db[_0xa59a('0x40')]['fn']('COUNT',db[_0xa59a('0x40')]['fn']('IF',db[_0xa59a('0x40')][_0xa59a('0x43')]('`scheduledat`\x20>=\x20'+util[_0xa59a('0x44')](_0xa59a('0x45'),moment()[_0xa59a('0x44')](_0xa59a('0x46')))+_0xa59a('0x47')))),_0xa59a('0x48')]]})[_0xa59a('0x23')](function(_0xc1f6f5){logger[_0xa59a('0x12')](_0xa59a('0x42'),_0x141e6a);logger[_0xa59a('0x1f')](_0xa59a('0x42'),_0x141e6a,JSON[_0xa59a('0xf')](_0xc1f6f5));_0xc492a1(_0xc1f6f5);})[_0xa59a('0x14')](function(_0x3f57d9){logger[_0xa59a('0x10')]('CountReScheduled',_0x3f57d9['message'],_0x141e6a);_0x22897b(_0x23258c[_0xa59a('0x10')](0x1f4,_0x3f57d9[_0xa59a('0x11')]));});});};exports['GetContactRecallMe']=function(_0x4d181a){var _0x387cb0=this;return new Promise(function(_0x531251,_0x55541c){return db[_0xa59a('0x2d')][_0xa59a('0x2e')]()[_0xa59a('0x23')](function(_0x5ed09c){return db[_0xa59a('0x40')][_0xa59a('0x2f')](function(_0x43a1d5){return db[_0xa59a('0x21')][_0xa59a('0x16')]({'where':_0x4d181a[_0xa59a('0x17')]?_0x4d181a['options'][_0xa59a('0x19')]||null:null,'attributes':_0x4d181a[_0xa59a('0x17')]?_0x4d181a[_0xa59a('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x4d181a[_0xa59a('0x17')]?_0x4d181a[_0xa59a('0x17')]['order']||null:null,'group':db[_0xa59a('0x21')][_0xa59a('0x37')],'transaction':_0x43a1d5,'lock':_0x43a1d5[_0xa59a('0x49')][_0xa59a('0x4a')],'include':_0x4d181a[_0xa59a('0x17')]?_0x4d181a[_0xa59a('0x17')][_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x4d181a['options'][_0xa59a('0x1c')],function(_0x23d626){return{'model':db[_0x23d626['model']],'as':_0x23d626['as'],'attributes':_0x23d626[_0xa59a('0x1a')],'include':_0x23d626[_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x23d626['include'],function(_0x24d67e){return{'model':db[_0x24d67e[_0xa59a('0x1e')]],'as':_0x24d67e['as'],'attributes':_0x24d67e[_0xa59a('0x1a')],'include':_0x24d67e['include']?_[_0xa59a('0x1d')](_0x24d67e[_0xa59a('0x1c')],function(_0x1698df){return{'model':db[_0x1698df[_0xa59a('0x1e')]],'as':_0x1698df['as'],'attributes':_0x1698df[_0xa59a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6f42){var _0x10958e=[];for(var _0x5eacbd=0x0;_0x5eacbd<_0x4b6f42[_0xa59a('0x36')];_0x5eacbd+=0x1){_0x10958e[_0xa59a('0x38')](_0x4b6f42[_0x5eacbd]['update'](_0x4d181a[_0xa59a('0x29')],{'transaction':_0x43a1d5}));}return BPromise[_0xa59a('0x3a')](_0x10958e);});})[_0xa59a('0x23')](function(_0x267033){logger[_0xa59a('0x12')](_0xa59a('0x4b'),_0x4d181a);logger[_0xa59a('0x1f')](_0xa59a('0x4b'),_0x4d181a,JSON['stringify'](_0x267033));_0x531251(_0x267033);})['catch'](function(_0x41f290){logger[_0xa59a('0x10')]('GetContactRecallMe',_0x41f290[_0xa59a('0x11')],_0x4d181a);_0x55541c(_0x387cb0[_0xa59a('0x10')](0x1f4,_0x41f290[_0xa59a('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x10d081){var _0x73417b=this;return new Promise(function(_0xda53b7,_0x256ccc){db[_0xa59a('0x2d')]['describe']()[_0xa59a('0x23')](function(_0x407b6e){return db[_0xa59a('0x21')][_0xa59a('0x16')]({'raw':_0x10d081[_0xa59a('0x17')]?_0x10d081[_0xa59a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x10d081[_0xa59a('0x17')]?_0x10d081[_0xa59a('0x17')][_0xa59a('0x19')]||null:null,'attributes':_0x10d081['options']?_0x10d081['options'][_0xa59a('0x1a')]||null:null,'limit':_0x10d081[_0xa59a('0x17')]?_0x10d081[_0xa59a('0x17')]['limit']||null:null,'include':_0x10d081[_0xa59a('0x17')]?_0x10d081[_0xa59a('0x17')]['include']?_[_0xa59a('0x1d')](_0x10d081[_0xa59a('0x17')][_0xa59a('0x1c')],function(_0x35994c){return{'model':db[_0x35994c[_0xa59a('0x1e')]],'as':_0x35994c['as'],'attributes':_0x35994c['as']===_0xa59a('0x31')?_[_0xa59a('0x32')](_0x407b6e):_0x35994c[_0xa59a('0x1a')],'include':_0x35994c[_0xa59a('0x1c')]?_[_0xa59a('0x1d')](_0x35994c[_0xa59a('0x1c')],function(_0x136568){return{'model':db[_0x136568[_0xa59a('0x1e')]],'as':_0x136568['as'],'attributes':_0x136568[_0xa59a('0x1a')],'include':_0x136568['include']?_[_0xa59a('0x1d')](_0x136568[_0xa59a('0x1c')],function(_0x15f149){return{'model':db[_0x15f149['model']],'as':_0x15f149['as'],'attributes':_0x15f149['attributes']};}):[]};}):[]};}):[]:[]})[_0xa59a('0x23')](function(_0x465c59){logger[_0xa59a('0x12')](_0xa59a('0x15'),_0x10d081);logger[_0xa59a('0x1f')](_0xa59a('0x15'),_0x10d081,JSON['stringify'](_0x465c59));_0xda53b7(_0x465c59);})[_0xa59a('0x14')](function(_0x2d1439){logger[_0xa59a('0x10')](_0xa59a('0x15'),_0x2d1439['message'],_0x10d081);_0x256ccc(_0x73417b[_0xa59a('0x10')](0x1f4,_0x2d1439[_0xa59a('0x11')]));});});});};exports['GetContactByPhone']=function(_0x59c2e2){var _0x14a7c9=this;return new Promise(function(_0x2b0026,_0x300b5d){return db['CmContact'][_0xa59a('0x4c')]({'raw':!![],'where':{'phone':_0x59c2e2[_0xa59a('0x17')][_0xa59a('0x19')][_0xa59a('0x4d')]},'attributes':['id','dialTimezone'],'order':[['id',_0xa59a('0x4e')]]})[_0xa59a('0x23')](function(_0x51f2c0){logger[_0xa59a('0x12')](_0xa59a('0x4f'),_0x59c2e2);logger['debug'](_0xa59a('0x4f'),_0x59c2e2,JSON[_0xa59a('0xf')](_0x51f2c0));_0x2b0026(_0x51f2c0);})[_0xa59a('0x14')](function(_0x3b514e){logger[_0xa59a('0x10')](_0xa59a('0x4f'),_0x3b514e['message'],_0x59c2e2);_0x300b5d(_0x14a7c9[_0xa59a('0x10')](0x1f4,_0x3b514e[_0xa59a('0x11')]));});});};exports['ResetActiveCalls']=function(_0x126600){var _0x27ad4e=this;return new Promise(function(_0x915657,_0x271758){return db[_0xa59a('0x40')][_0xa59a('0x2f')](function(_0x3fc85e){return db[_0xa59a('0x21')][_0xa59a('0x26')]({'active':![]},{'where':{},'transaction':_0x3fc85e})[_0xa59a('0x23')](function(_0x3f29be){logger[_0xa59a('0x12')]('ResetActiveCalls',_0x126600);logger['debug']('ResetActiveCalls',_0x126600,JSON[_0xa59a('0xf')](_0x3f29be));_0x915657(_0x3f29be);})[_0xa59a('0x14')](function(_0x4749b9){logger[_0xa59a('0x10')](_0xa59a('0x50'),_0x4749b9['message'],_0x126600);_0x271758(_0x27ad4e['error'](0x1f4,_0x4749b9[_0xa59a('0x11')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1e127c){var _0x518653=this;var _0x94ae9d=_0x1e127c[_0xa59a('0x29')][_0xa59a('0x19')]['voiceQueueId'];var _0x577331=_0x1e127c[_0xa59a('0x29')][_0xa59a('0x19')][_0xa59a('0x51')];return new Promise(function(_0x37cdde,_0x27aa2f){return db[_0xa59a('0x21')][_0xa59a('0x16')]({'where':{'voiceQueueId':_0x94ae9d,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xa59a('0x40')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x577331+_0xa59a('0x52'))}},'include':[{'model':db[_0xa59a('0x2d')],'as':_0xa59a('0x31')},{'model':db['User'],'as':_0xa59a('0x34'),'attributes':['id',_0xa59a('0x53'),_0xa59a('0x35')]},{'model':db[_0xa59a('0x54')],'as':_0xa59a('0x55')}]})['then'](function(_0x2b3768){return db[_0xa59a('0x40')][_0xa59a('0x2f')](function(_0x2921ca){return db[_0xa59a('0x21')][_0xa59a('0x26')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x94ae9d,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0xa59a('0x40')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x577331+_0xa59a('0x52'))}},'transaction':_0x2921ca})[_0xa59a('0x23')](function(_0x48f000){_0x37cdde(_0x2b3768);})[_0xa59a('0x14')](function(_0x2a28d0){logger[_0xa59a('0x10')](_0xa59a('0x56'),_0x2a28d0['message'],_0x1e127c);_0x27aa2f(validateExpressRequest);});});})['catch'](function(_0x2bbc79){logger[_0xa59a('0x10')](_0xa59a('0x56'),_0x2bbc79[_0xa59a('0x11')],_0x1e127c);_0x27aa2f(_0x518653['error'](0x1f4,_0x2bbc79[_0xa59a('0x11')]));});});}; \ No newline at end of file +var _0x8971=['push','includes','all','dataValues','ContactId','active','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','http','request','then','info','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','options','raw','limit','include','map','attributes','model','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','where','order','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId'];(function(_0x2b31a8,_0x28b862){var _0x1175a5=function(_0x2cdb5d){while(--_0x2cdb5d){_0x2b31a8['push'](_0x2b31a8['shift']());}};_0x1175a5(++_0x28b862);}(_0x8971,0x7c));var _0x1897=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8971[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1897('0x0'));var util=require(_0x1897('0x1'));var moment=require(_0x1897('0x2'));var BPromise=require(_0x1897('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1897('0x4'));var db=require(_0x1897('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1897('0x6'));var config=require(_0x1897('0x7'));var jayson=require(_0x1897('0x8'));const {validateExpressRequest}=require(_0x1897('0x9'));var client=jayson['client'][_0x1897('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xefce9c,_0x371a92,_0x26f5b9){return new BPromise(function(_0x261a47,_0x2e65d8){return client[_0x1897('0xb')](_0xefce9c,_0x26f5b9)[_0x1897('0xc')](function(_0x5d1d72){logger[_0x1897('0xd')]('CmHopper,\x20%s,\x20%s',_0x371a92,_0x1897('0xe'));logger[_0x1897('0xf')](_0x1897('0x10'),_0x371a92,'request\x20sent',JSON[_0x1897('0x11')](_0x5d1d72));if(_0x5d1d72['error']){if(_0x5d1d72[_0x1897('0x12')][_0x1897('0x13')]===0x1f4){logger[_0x1897('0x12')](_0x1897('0x14'),_0x371a92,_0x5d1d72[_0x1897('0x12')][_0x1897('0x15')]);return _0x2e65d8(_0x5d1d72[_0x1897('0x12')][_0x1897('0x15')]);}logger[_0x1897('0x12')](_0x1897('0x14'),_0x371a92,_0x5d1d72[_0x1897('0x12')][_0x1897('0x15')]);return _0x261a47(_0x5d1d72[_0x1897('0x12')][_0x1897('0x15')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x371a92,_0x1897('0xe'));_0x261a47(_0x5d1d72[_0x1897('0x16')][_0x1897('0x15')]);}})[_0x1897('0x17')](function(_0x580b4f){logger[_0x1897('0x12')](_0x1897('0x14'),_0x371a92,_0x580b4f);_0x2e65d8(_0x580b4f);});});}exports[_0x1897('0x18')]=function(_0x4ed58f){var _0x15992a=this;return new Promise(function(_0x26bf0a,_0x16a600){return db[_0x1897('0x19')]['findAll']({'raw':_0x4ed58f['options']?_0x4ed58f[_0x1897('0x1a')][_0x1897('0x1b')]===undefined?!![]:![]:!![],'where':_0x4ed58f[_0x1897('0x1a')]?_0x4ed58f['options']['where']||null:null,'attributes':_0x4ed58f[_0x1897('0x1a')]?_0x4ed58f[_0x1897('0x1a')]['attributes']||null:null,'limit':_0x4ed58f[_0x1897('0x1a')]?_0x4ed58f[_0x1897('0x1a')][_0x1897('0x1c')]||null:null,'include':_0x4ed58f[_0x1897('0x1a')]?_0x4ed58f[_0x1897('0x1a')][_0x1897('0x1d')]?_[_0x1897('0x1e')](_0x4ed58f[_0x1897('0x1a')]['include'],function(_0x322fa6){return{'model':db[_0x322fa6['model']],'as':_0x322fa6['as'],'attributes':_0x322fa6[_0x1897('0x1f')],'include':_0x322fa6[_0x1897('0x1d')]?_[_0x1897('0x1e')](_0x322fa6[_0x1897('0x1d')],function(_0x3a6ff8){return{'model':db[_0x3a6ff8[_0x1897('0x20')]],'as':_0x3a6ff8['as'],'attributes':_0x3a6ff8[_0x1897('0x1f')],'include':_0x3a6ff8['include']?_[_0x1897('0x1e')](_0x3a6ff8['include'],function(_0x53f929){return{'model':db[_0x53f929[_0x1897('0x20')]],'as':_0x53f929['as'],'attributes':_0x53f929['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1359ed){logger['info']('GetCmHopper',_0x4ed58f);logger['debug']('GetCmHopper',_0x4ed58f,JSON[_0x1897('0x11')](_0x1359ed));_0x26bf0a(_0x1359ed);})[_0x1897('0x17')](function(_0x5242cd){logger[_0x1897('0x12')]('GetCmHopper',_0x5242cd['message'],_0x4ed58f);_0x16a600(_0x15992a['error'](0x1f4,_0x5242cd[_0x1897('0x15')]));});});};exports[_0x1897('0x21')]=function(_0x45bebd){var _0x47e4e1=this;return new Promise(function(_0xbe2054,_0x3b90d0){return db['CmHopper']['find']({'raw':_0x45bebd[_0x1897('0x1a')]?_0x45bebd['options']['raw']===undefined?!![]:![]:!![],'where':_0x45bebd[_0x1897('0x1a')]?_0x45bebd[_0x1897('0x1a')]['where']||null:null,'attributes':_0x45bebd[_0x1897('0x1a')]?_0x45bebd[_0x1897('0x1a')][_0x1897('0x1f')]||null:null,'include':_0x45bebd[_0x1897('0x1a')]?_0x45bebd[_0x1897('0x1a')][_0x1897('0x1d')]?_['map'](_0x45bebd['options'][_0x1897('0x1d')],function(_0x10d00c){return{'model':db[_0x10d00c[_0x1897('0x20')]],'as':_0x10d00c['as'],'attributes':_0x10d00c[_0x1897('0x1f')],'include':_0x10d00c['include']?_['map'](_0x10d00c[_0x1897('0x1d')],function(_0x243008){return{'model':db[_0x243008[_0x1897('0x20')]],'as':_0x243008['as'],'attributes':_0x243008[_0x1897('0x1f')],'include':_0x243008[_0x1897('0x1d')]?_[_0x1897('0x1e')](_0x243008['include'],function(_0x3585b9){return{'model':db[_0x3585b9['model']],'as':_0x3585b9['as'],'attributes':_0x3585b9[_0x1897('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1897('0xc')](function(_0x336625){logger[_0x1897('0xd')]('ShowCmHopper',_0x45bebd);logger['debug'](_0x1897('0x21'),_0x45bebd,JSON[_0x1897('0x11')](_0x336625));_0xbe2054(_0x336625);})[_0x1897('0x17')](function(_0x2c6aa0){logger[_0x1897('0x12')](_0x1897('0x21'),_0x2c6aa0[_0x1897('0x15')],_0x45bebd);_0x3b90d0(_0x47e4e1[_0x1897('0x12')](0x1f4,_0x2c6aa0['message']));});});};exports[_0x1897('0x22')]=function(_0x3c6f23){var _0x3a7ed1=this;return new Promise(function(_0x11da5a,_0x3997b8){return db['CmHopper'][_0x1897('0x23')](_0x3c6f23['body'],{'raw':_0x3c6f23['options']?_0x3c6f23[_0x1897('0x1a')][_0x1897('0x1b')]===undefined?!![]:![]:!![]})[_0x1897('0xc')](function(_0x4ab65e){logger['info'](_0x1897('0x22'),_0x3c6f23);logger[_0x1897('0xf')]('CreateCmHopper',_0x3c6f23,JSON[_0x1897('0x11')](_0x4ab65e));_0x11da5a(_0x4ab65e);})[_0x1897('0x17')](function(_0x5e70f4){logger[_0x1897('0x12')]('CreateCmHopper',_0x5e70f4[_0x1897('0x15')],_0x3c6f23);_0x3997b8(_0x3a7ed1['error'](0x1f4,_0x5e70f4[_0x1897('0x15')]));});});};exports[_0x1897('0x24')]=function(_0x265fa1){var _0x2927b5=this;return new Promise(function(_0x443fc2,_0x4cc574){return db['CmHopper'][_0x1897('0x25')](_0x265fa1[_0x1897('0x26')],{'raw':_0x265fa1[_0x1897('0x1a')]?_0x265fa1[_0x1897('0x1a')][_0x1897('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265fa1[_0x1897('0x1a')]?_0x265fa1[_0x1897('0x1a')]['where']||null:null,'attributes':_0x265fa1[_0x1897('0x1a')]?_0x265fa1[_0x1897('0x1a')]['attributes']||null:null,'limit':_0x265fa1['options']?_0x265fa1['options']['limit']||null:null})[_0x1897('0xc')](function(_0x3d9715){logger[_0x1897('0xd')]('UpdateCmHopper',_0x265fa1);logger[_0x1897('0xd')](_0x1897('0x27'),JSON[_0x1897('0x11')](_0x265fa1[_0x1897('0x1a')]['where']),_0x265fa1[_0x1897('0x26')]['active']);logger[_0x1897('0xf')](_0x1897('0x24'),_0x265fa1,JSON['stringify'](_0x3d9715));_0x443fc2(_0x3d9715);})[_0x1897('0x17')](function(_0x4dbbc2){logger[_0x1897('0x12')]('UpdateCmHopper',_0x4dbbc2[_0x1897('0x15')],_0x265fa1);_0x4cc574(_0x2927b5['error'](0x1f4,_0x4dbbc2[_0x1897('0x15')]));});});};exports[_0x1897('0x28')]=function(_0x3f1a1f){var _0x32ef9e=this;return new Promise(function(_0x4e59f9,_0x620119){return db[_0x1897('0x19')][_0x1897('0x29')]({'where':_0x3f1a1f[_0x1897('0x1a')]?_0x3f1a1f[_0x1897('0x1a')]['where']||null:null})[_0x1897('0xc')](function(_0x33e58c){logger[_0x1897('0xd')](_0x1897('0x28'),_0x3f1a1f);logger[_0x1897('0xf')](_0x1897('0x28'),_0x3f1a1f,JSON['stringify'](_0x33e58c));_0x4e59f9(_0x33e58c);})[_0x1897('0x17')](function(_0x3112eb){logger[_0x1897('0x12')](_0x1897('0x28'),_0x3112eb['message'],_0x3f1a1f);_0x620119(_0x32ef9e[_0x1897('0x12')](0x1f4,_0x3112eb[_0x1897('0x15')]));});});};exports[_0x1897('0x2a')]=function(_0xf5ca0){var _0x1590e3=this;return new Promise(function(_0x325290,_0x1aec9f){return db[_0x1897('0x2b')][_0x1897('0x2c')]()['then'](function(_0x12a57f){return db[_0x1897('0x2d')]['transaction'](function(_0x2d1795){return db[_0x1897('0x19')][_0x1897('0x2e')]({'where':_0xf5ca0[_0x1897('0x1a')]?_0xf5ca0[_0x1897('0x1a')][_0x1897('0x2f')]||null:null,'attributes':_0xf5ca0[_0x1897('0x1a')]?_0xf5ca0['options']['attributes']||null:null,'limit':_0xf5ca0['options']?_0xf5ca0[_0x1897('0x1a')][_0x1897('0x1c')]||null:null,'order':_0xf5ca0[_0x1897('0x1a')]?_0xf5ca0['options'][_0x1897('0x30')]||null:null,'transaction':_0x2d1795,'lock':_0x2d1795[_0x1897('0x31')][_0x1897('0x32')],'include':[{'model':db[_0x1897('0x2b')],'as':_0x1897('0x33'),'attributes':_['keys'](_0x12a57f)},{'model':db[_0x1897('0x34')],'as':_0x1897('0x35'),'attributes':['id',_0x1897('0x36'),_0x1897('0x37')]}]})[_0x1897('0xc')](function(_0x17dfcc){var _0x5651b6=[];var _0x1e43a9=[];for(var _0x59e2e1=0x0;_0x59e2e1<_0x17dfcc[_0x1897('0x38')];_0x59e2e1+=0x1){var _0x532f94=_0x17dfcc[_0x59e2e1][_0x1897('0x39')];if(_0x532f94===null){_0x5651b6[_0x1897('0x3a')](_0x17dfcc[_0x59e2e1][_0x1897('0x25')](_0xf5ca0[_0x1897('0x26')],{'transaction':_0x2d1795}));}else if(!_0x1e43a9[_0x1897('0x3b')](_0x532f94)){_0x1e43a9[_0x1897('0x3a')](_0x532f94);_0x5651b6[_0x1897('0x3a')](_0x17dfcc[_0x59e2e1][_0x1897('0x25')](_0xf5ca0[_0x1897('0x26')],{'transaction':_0x2d1795}));}}return BPromise[_0x1897('0x3c')](_0x5651b6);});})[_0x1897('0xc')](function(_0x5bc155){logger['info'](_0x1897('0x2a'),_0xf5ca0);if(_0x5bc155['length']>0x0){logger[_0x1897('0xd')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x5bc155[0x0][_0x1897('0x3d')]['id'],_0x5bc155[0x0][_0x1897('0x3d')][_0x1897('0x3e')],_0x5bc155[0x0][_0x1897('0x3d')][_0x1897('0x3f')]);}logger[_0x1897('0xf')]('GetContactDialer',_0xf5ca0,JSON[_0x1897('0x11')](_0x5bc155));_0x325290(_0x5bc155);})['catch'](function(_0x3c54fb){logger[_0x1897('0x12')](_0x1897('0x2a'),_0x3c54fb[_0x1897('0x15')],_0xf5ca0);_0x1aec9f(_0x1590e3['error'](0x1f4,_0x3c54fb[_0x1897('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x503bab){var _0x38f606=this;return new Promise(function(_0xfa4385,_0x18921c){return db[_0x1897('0x2d')][_0x1897('0x40')](function(_0x58dd5e){return db[_0x1897('0x41')]['create'](_0x503bab[_0x1897('0x26')],{'raw':_0x503bab['options']?_0x503bab['options'][_0x1897('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x58dd5e})[_0x1897('0xc')](function(){logger[_0x1897('0xd')](_0x1897('0x42'),JSON[_0x1897('0x11')](_0x503bab[_0x1897('0x1a')]['where']),_0x503bab[_0x1897('0x1a')][_0x1897('0x2f')][_0x1897('0x3f')]);return db[_0x1897('0x19')][_0x1897('0x29')]({'where':_0x503bab[_0x1897('0x1a')]?_0x503bab[_0x1897('0x1a')][_0x1897('0x2f')]||null:null,'transaction':_0x58dd5e});});})['then'](function(_0x4fe7a7){logger['info'](_0x1897('0x43'),_0x503bab);logger[_0x1897('0xf')](_0x1897('0x43'),_0x503bab,JSON[_0x1897('0x11')](_0x4fe7a7));_0xfa4385(_0x4fe7a7);})[_0x1897('0x17')](function(_0x507e5a){logger['error']('MoveContactManagedDialer',_0x507e5a[_0x1897('0x15')],_0x503bab);_0x18921c(_0x38f606[_0x1897('0x12')](0x1f4,_0x507e5a[_0x1897('0x15')]));});});};exports[_0x1897('0x44')]=function(_0x580580){var _0x4ad1cd=this;return new Promise(function(_0x25215b,_0x103390){return db[_0x1897('0x19')][_0x1897('0x2e')]({'raw':_0x580580[_0x1897('0x1a')]?_0x580580[_0x1897('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x580580[_0x1897('0x1a')]?_0x580580[_0x1897('0x1a')][_0x1897('0x2f')]||null:null,'attributes':[[db[_0x1897('0x2d')]['fn']('COUNT',db[_0x1897('0x2d')]['fn']('IF',db[_0x1897('0x2d')]['literal'](_0x1897('0x45')+util[_0x1897('0x46')](_0x1897('0x47'),moment()[_0x1897('0x46')](_0x1897('0x48')))+_0x1897('0x49')))),_0x1897('0x4a')]]})[_0x1897('0xc')](function(_0x53310d){logger[_0x1897('0xd')](_0x1897('0x44'),_0x580580);logger[_0x1897('0xf')]('CountReScheduled',_0x580580,JSON[_0x1897('0x11')](_0x53310d));_0x25215b(_0x53310d);})['catch'](function(_0x3150ad){logger[_0x1897('0x12')](_0x1897('0x44'),_0x3150ad['message'],_0x580580);_0x103390(_0x4ad1cd[_0x1897('0x12')](0x1f4,_0x3150ad[_0x1897('0x15')]));});});};exports['GetContactRecallMe']=function(_0x3bfb56){var _0x1078ec=this;return new Promise(function(_0x38460b,_0x5dd091){return db[_0x1897('0x2b')][_0x1897('0x2c')]()[_0x1897('0xc')](function(_0x18969c){return db[_0x1897('0x2d')][_0x1897('0x40')](function(_0x295ea6){return db[_0x1897('0x19')][_0x1897('0x2e')]({'where':_0x3bfb56['options']?_0x3bfb56[_0x1897('0x1a')][_0x1897('0x2f')]||null:null,'attributes':_0x3bfb56[_0x1897('0x1a')]?_0x3bfb56['options'][_0x1897('0x1f')]||null:null,'limit':0x1,'order':_0x3bfb56['options']?_0x3bfb56['options'][_0x1897('0x30')]||null:null,'group':db['CmHopper'][_0x1897('0x39')],'transaction':_0x295ea6,'lock':_0x295ea6[_0x1897('0x31')][_0x1897('0x32')],'include':_0x3bfb56[_0x1897('0x1a')]?_0x3bfb56[_0x1897('0x1a')]['include']?_[_0x1897('0x1e')](_0x3bfb56[_0x1897('0x1a')][_0x1897('0x1d')],function(_0x46b2f7){return{'model':db[_0x46b2f7[_0x1897('0x20')]],'as':_0x46b2f7['as'],'attributes':_0x46b2f7[_0x1897('0x1f')],'include':_0x46b2f7[_0x1897('0x1d')]?_[_0x1897('0x1e')](_0x46b2f7[_0x1897('0x1d')],function(_0x2ee077){return{'model':db[_0x2ee077[_0x1897('0x20')]],'as':_0x2ee077['as'],'attributes':_0x2ee077['attributes'],'include':_0x2ee077[_0x1897('0x1d')]?_[_0x1897('0x1e')](_0x2ee077[_0x1897('0x1d')],function(_0x41162c){return{'model':db[_0x41162c[_0x1897('0x20')]],'as':_0x41162c['as'],'attributes':_0x41162c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1897('0xc')](function(_0x185b17){var _0x3ba63f=[];for(var _0x4bdaab=0x0;_0x4bdaab<_0x185b17['length'];_0x4bdaab+=0x1){_0x3ba63f[_0x1897('0x3a')](_0x185b17[_0x4bdaab][_0x1897('0x25')](_0x3bfb56[_0x1897('0x26')],{'transaction':_0x295ea6}));}return BPromise[_0x1897('0x3c')](_0x3ba63f);});})[_0x1897('0xc')](function(_0x16e8d7){logger[_0x1897('0xd')](_0x1897('0x4b'),_0x3bfb56);logger[_0x1897('0xf')](_0x1897('0x4b'),_0x3bfb56,JSON[_0x1897('0x11')](_0x16e8d7));_0x38460b(_0x16e8d7);})[_0x1897('0x17')](function(_0x6370b4){logger[_0x1897('0x12')](_0x1897('0x4b'),_0x6370b4[_0x1897('0x15')],_0x3bfb56);_0x5dd091(_0x1078ec[_0x1897('0x12')](0x1f4,_0x6370b4[_0x1897('0x15')]));});});});};exports[_0x1897('0x4c')]=function(_0x15275b){var _0x4dfec0=this;return new Promise(function(_0x2cf127,_0x35d2d2){db[_0x1897('0x2b')][_0x1897('0x2c')]()['then'](function(_0x51aabc){return db[_0x1897('0x19')][_0x1897('0x2e')]({'raw':_0x15275b[_0x1897('0x1a')]?_0x15275b[_0x1897('0x1a')][_0x1897('0x1b')]===undefined?!![]:![]:!![],'where':_0x15275b['options']?_0x15275b[_0x1897('0x1a')][_0x1897('0x2f')]||null:null,'attributes':_0x15275b[_0x1897('0x1a')]?_0x15275b['options'][_0x1897('0x1f')]||null:null,'limit':_0x15275b['options']?_0x15275b[_0x1897('0x1a')]['limit']||null:null,'include':_0x15275b[_0x1897('0x1a')]?_0x15275b[_0x1897('0x1a')][_0x1897('0x1d')]?_['map'](_0x15275b[_0x1897('0x1a')][_0x1897('0x1d')],function(_0x10f243){return{'model':db[_0x10f243[_0x1897('0x20')]],'as':_0x10f243['as'],'attributes':_0x10f243['as']===_0x1897('0x33')?_[_0x1897('0x4d')](_0x51aabc):_0x10f243['attributes'],'include':_0x10f243['include']?_[_0x1897('0x1e')](_0x10f243[_0x1897('0x1d')],function(_0x425aaa){return{'model':db[_0x425aaa[_0x1897('0x20')]],'as':_0x425aaa['as'],'attributes':_0x425aaa[_0x1897('0x1f')],'include':_0x425aaa['include']?_[_0x1897('0x1e')](_0x425aaa[_0x1897('0x1d')],function(_0x2f63a1){return{'model':db[_0x2f63a1[_0x1897('0x20')]],'as':_0x2f63a1['as'],'attributes':_0x2f63a1[_0x1897('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b9b3){logger[_0x1897('0xd')](_0x1897('0x18'),_0x15275b);logger[_0x1897('0xf')](_0x1897('0x18'),_0x15275b,JSON[_0x1897('0x11')](_0x29b9b3));_0x2cf127(_0x29b9b3);})[_0x1897('0x17')](function(_0x386125){logger[_0x1897('0x12')](_0x1897('0x18'),_0x386125[_0x1897('0x15')],_0x15275b);_0x35d2d2(_0x4dfec0[_0x1897('0x12')](0x1f4,_0x386125[_0x1897('0x15')]));});});});};exports[_0x1897('0x4e')]=function(_0x4854b6){var _0x3a887=this;return new Promise(function(_0x447d64,_0x9fa202){return db[_0x1897('0x2b')][_0x1897('0x4f')]({'raw':!![],'where':{'phone':_0x4854b6[_0x1897('0x1a')][_0x1897('0x2f')]['phone']},'attributes':['id',_0x1897('0x50')],'order':[['id',_0x1897('0x51')]]})[_0x1897('0xc')](function(_0x1f67a9){logger['info'](_0x1897('0x52'),_0x4854b6);logger[_0x1897('0xf')](_0x1897('0x52'),_0x4854b6,JSON[_0x1897('0x11')](_0x1f67a9));_0x447d64(_0x1f67a9);})[_0x1897('0x17')](function(_0x5713ab){logger['error'](_0x1897('0x52'),_0x5713ab['message'],_0x4854b6);_0x9fa202(_0x3a887[_0x1897('0x12')](0x1f4,_0x5713ab['message']));});});};exports[_0x1897('0x53')]=function(_0x2813a4){var _0x4c6704=this;return new Promise(function(_0x13ab54,_0x32ffa4){return db[_0x1897('0x2d')][_0x1897('0x40')](function(_0x49d9b7){return db['CmHopper'][_0x1897('0x25')]({'active':![]},{'where':{},'transaction':_0x49d9b7})[_0x1897('0xc')](function(_0x44733a){logger[_0x1897('0xd')]('ResetActiveCalls',_0x2813a4);logger[_0x1897('0xf')](_0x1897('0x53'),_0x2813a4,JSON[_0x1897('0x11')](_0x44733a));_0x13ab54(_0x44733a);})[_0x1897('0x17')](function(_0x3ce57d){logger[_0x1897('0x12')](_0x1897('0x53'),_0x3ce57d[_0x1897('0x15')],_0x2813a4);_0x32ffa4(_0x4c6704[_0x1897('0x12')](0x1f4,_0x3ce57d['message']));});});});};exports[_0x1897('0x54')]=function(_0x512474){var _0x66c052=this;var _0x226b89=_0x512474[_0x1897('0x26')][_0x1897('0x2f')][_0x1897('0x55')];var _0x19212c=_0x512474[_0x1897('0x26')]['where'][_0x1897('0x56')];return new Promise(function(_0x39de63,_0x1dc181){return db[_0x1897('0x19')][_0x1897('0x2e')]({'where':{'voiceQueueId':_0x226b89,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x1897('0x2d')][_0x1897('0x57')](_0x1897('0x58')+_0x19212c+_0x1897('0x59'))}},'include':[{'model':db[_0x1897('0x2b')],'as':_0x1897('0x33')},{'model':db[_0x1897('0x34')],'as':'Agent','attributes':['id',_0x1897('0x36'),_0x1897('0x37')]},{'model':db[_0x1897('0x5a')],'as':'List'}]})[_0x1897('0xc')](function(_0x1148cf){return db['sequelize'][_0x1897('0x40')](function(_0xcada3d){return db[_0x1897('0x19')][_0x1897('0x25')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x226b89,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x1897('0x2d')][_0x1897('0x57')](_0x1897('0x58')+_0x19212c+_0x1897('0x59'))}},'transaction':_0xcada3d})[_0x1897('0xc')](function(_0x3e3888){_0x39de63(_0x1148cf);})[_0x1897('0x17')](function(_0x119e94){logger[_0x1897('0x12')](_0x1897('0x54'),_0x119e94[_0x1897('0x15')],_0x512474);_0x1dc181(validateExpressRequest);});});})[_0x1897('0x17')](function(_0x379be9){logger[_0x1897('0x12')](_0x1897('0x54'),_0x379be9[_0x1897('0x15')],_0x512474);_0x1dc181(_0x66c052[_0x1897('0x12')](0x1f4,_0x379be9['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2b8b084..c8b6b72 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 _0x7859=['/:id','post','/previewrecall','getPreviewRecall','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','/timezones','getTimezones'];(function(_0x2ad678,_0x35ca0f){var _0x8427f6=function(_0x5f4829){while(--_0x5f4829){_0x2ad678['push'](_0x2ad678['shift']());}};_0x8427f6(++_0x35ca0f);}(_0x7859,0x1ef));var _0x9785=function(_0x2ed2f1,_0x56e766){_0x2ed2f1=_0x2ed2f1-0x0;var _0x22f337=_0x7859[_0x2ed2f1];return _0x22f337;};'use strict';var multer=require(_0x9785('0x0'));var util=require(_0x9785('0x1'));var path=require(_0x9785('0x2'));var timeout=require(_0x9785('0x3'));var express=require(_0x9785('0x4'));var router=express[_0x9785('0x5')]();var fs_extra=require(_0x9785('0x6'));var auth=require(_0x9785('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9785('0x8'));var controller=require(_0x9785('0x9'));router[_0x9785('0xa')]('/',auth[_0x9785('0xb')](),controller[_0x9785('0xc')]);router[_0x9785('0xa')]('/describe',auth[_0x9785('0xb')](),controller[_0x9785('0xd')]);router['get'](_0x9785('0xe'),auth['isAuthenticated'](),controller[_0x9785('0xf')]);router['get'](_0x9785('0x10'),auth[_0x9785('0xb')](),controller[_0x9785('0x11')]);router['get'](_0x9785('0x12'),auth[_0x9785('0xb')](),controller['show']);router[_0x9785('0x13')]('/',auth[_0x9785('0xb')](),controller['create']);router[_0x9785('0x13')]('/preview',auth[_0x9785('0xb')](),controller['getPreview']);router['post']('/timezone',auth[_0x9785('0xb')](),controller['getTimezone']);router[_0x9785('0x13')](_0x9785('0x14'),auth[_0x9785('0xb')](),controller[_0x9785('0x15')]);router[_0x9785('0x16')](_0x9785('0x12'),auth['isAuthenticated'](),controller[_0x9785('0x17')]);router[_0x9785('0x18')](_0x9785('0x12'),auth[_0x9785('0xb')](),controller[_0x9785('0x19')]);module[_0x9785('0x1a')]=router; \ No newline at end of file +var _0x920a=['getTimezone','getPreviewRecall','put','/:id','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/timezones','show','create','post','/preview','getPreview','/timezone'];(function(_0x5385bd,_0x4b15e6){var _0x3cc83a=function(_0x557a4f){while(--_0x557a4f){_0x5385bd['push'](_0x5385bd['shift']());}};_0x3cc83a(++_0x4b15e6);}(_0x920a,0x1ac));var _0xa920=function(_0x45aea8,_0x1a3f82){_0x45aea8=_0x45aea8-0x0;var _0x25b5e7=_0x920a[_0x45aea8];return _0x25b5e7;};'use strict';var multer=require(_0xa920('0x0'));var util=require('util');var path=require(_0xa920('0x1'));var timeout=require('connect-timeout');var express=require(_0xa920('0x2'));var router=express[_0xa920('0x3')]();var fs_extra=require(_0xa920('0x4'));var auth=require(_0xa920('0x5'));var interaction=require(_0xa920('0x6'));var config=require(_0xa920('0x7'));var controller=require(_0xa920('0x8'));router['get']('/',auth[_0xa920('0x9')](),controller[_0xa920('0xa')]);router[_0xa920('0xb')](_0xa920('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xa920('0xb')](_0xa920('0xd'),auth['isAuthenticated'](),controller[_0xa920('0xe')]);router[_0xa920('0xb')](_0xa920('0xf'),auth[_0xa920('0x9')](),controller['getTimezones']);router[_0xa920('0xb')]('/:id',auth[_0xa920('0x9')](),controller[_0xa920('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa920('0x11')]);router[_0xa920('0x12')](_0xa920('0x13'),auth[_0xa920('0x9')](),controller[_0xa920('0x14')]);router[_0xa920('0x12')](_0xa920('0x15'),auth['isAuthenticated'](),controller[_0xa920('0x16')]);router['post']('/previewrecall',auth['isAuthenticated'](),controller[_0xa920('0x17')]);router[_0xa920('0x18')](_0xa920('0x19'),auth[_0xa920('0x9')](),controller[_0xa920('0x1a')]);router[_0xa920('0x1b')](_0xa920('0x19'),auth[_0xa920('0x9')](),controller[_0xa920('0x1c')]);module[_0xa920('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ad86dfe..89fc4c8 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 _0x119a=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x99c2dd,_0x1d32eb){var _0x173349=function(_0x211a30){while(--_0x211a30){_0x99c2dd['push'](_0x99c2dd['shift']());}};_0x173349(++_0x1d32eb);}(_0x119a,0x69));var _0xa119=function(_0x1c3fae,_0x231153){_0x1c3fae=_0x1c3fae-0x0;var _0x47e4b5=_0x119a[_0x1c3fae];return _0x47e4b5;};'use strict';var moment=require(_0xa119('0x0'));var Sequelize=require(_0xa119('0x1'));module[_0xa119('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa119('0x3')],'unique':_0xa119('0x4')},'ListId':{'type':Sequelize[_0xa119('0x3')],'unique':_0xa119('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa119('0x4')}}; \ No newline at end of file +var _0x952a=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3ee39a,_0x511194){var _0x28b454=function(_0x80c084){while(--_0x80c084){_0x3ee39a['push'](_0x3ee39a['shift']());}};_0x28b454(++_0x511194);}(_0x952a,0x1b1));var _0xa952=function(_0x7a7889,_0x5d61d7){_0x7a7889=_0x7a7889-0x0;var _0x251510=_0x952a[_0x7a7889];return _0x251510;};'use strict';var moment=require(_0xa952('0x0'));var Sequelize=require(_0xa952('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa952('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa952('0x3')],'unique':_0xa952('0x4')},'ListId':{'type':Sequelize[_0xa952('0x3')],'unique':_0xa952('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa952('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ba979e4..1d88aef 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 _0xf04d=['json','apply','reject','save','destroy','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','count','then','includeAll','include','rows','catch','show','params','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','offset','undefined','limit','set','Content-Range'];(function(_0x3b2e63,_0x17936c){var _0x5bb3db=function(_0x42e703){while(--_0x42e703){_0x3b2e63['push'](_0x3b2e63['shift']());}};_0x5bb3db(++_0x17936c);}(_0xf04d,0x1e6));var _0xdf04=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0xf04d[_0xdbe2de];return _0x2facd7;};'use strict';var emlformat=require(_0xdf04('0x0'));var rimraf=require(_0xdf04('0x1'));var zipdir=require(_0xdf04('0x2'));var jsonpatch=require(_0xdf04('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf04('0x4'));var Mustache=require(_0xdf04('0x5'));var util=require(_0xdf04('0x6'));var path=require(_0xdf04('0x7'));var sox=require(_0xdf04('0x8'));var csv=require(_0xdf04('0x9'));var ejs=require(_0xdf04('0xa'));var fs=require('fs');var fs_extra=require(_0xdf04('0xb'));var _=require(_0xdf04('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf04('0xd'));var deskjs=require(_0xdf04('0xe'));var toCsv=require(_0xdf04('0x9'));var querystring=require(_0xdf04('0xf'));var Papa=require('papaparse');var Redis=require(_0xdf04('0x10'));var authService=require(_0xdf04('0x11'));var qs=require(_0xdf04('0x12'));var as=require(_0xdf04('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf04('0x14'))(_0xdf04('0x15'));var utils=require(_0xdf04('0x16'));var config=require(_0xdf04('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485b12,_0x1d5dac){_0x1d5dac=_0x1d5dac||0xcc;return function(_0x42e40a){if(_0x42e40a){return _0x485b12[_0xdf04('0x18')](_0x1d5dac);}return _0x485b12['status'](_0x1d5dac)[_0xdf04('0x19')]();};}function respondWithResult(_0x377d3b,_0x5a7eb1){_0x5a7eb1=_0x5a7eb1||0xc8;return function(_0x554de9){if(_0x554de9){return _0x377d3b[_0xdf04('0x1a')](_0x5a7eb1)['json'](_0x554de9);}};}function respondWithFilteredResult(_0x13a1cc,_0x3189f7){return function(_0x9c2c43){if(_0x9c2c43){var _0x2a2e85=typeof _0x3189f7[_0xdf04('0x1b')]===_0xdf04('0x1c')&&typeof _0x3189f7[_0xdf04('0x1d')]==='undefined';var _0x5eb8a8=_0x9c2c43['count'];var _0x46ef03=_0x2a2e85?0x0:_0x3189f7[_0xdf04('0x1b')];var _0x43840f=_0x2a2e85?_0x9c2c43['count']:_0x3189f7[_0xdf04('0x1b')]+_0x3189f7[_0xdf04('0x1d')];var _0x19b2be;if(_0x43840f>=_0x5eb8a8){_0x43840f=_0x5eb8a8;_0x19b2be=0xc8;}else{_0x19b2be=0xce;}_0x13a1cc['status'](_0x19b2be);return _0x13a1cc[_0xdf04('0x1e')](_0xdf04('0x1f'),_0x46ef03+'-'+_0x43840f+'/'+_0x5eb8a8)[_0xdf04('0x20')](_0x9c2c43);}return null;};}function patchUpdates(_0xf22a42){return function(_0x5dc18c){try{jsonpatch[_0xdf04('0x21')](_0x5dc18c,_0xf22a42,!![]);}catch(_0x16e0f5){return BPromise[_0xdf04('0x22')](_0x16e0f5);}return _0x5dc18c[_0xdf04('0x23')]();};}function saveUpdates(_0x1d1e1f,_0x510436){return function(_0x32799a){if(_0x32799a){return _0x32799a['update'](_0x1d1e1f)['then'](function(_0x17a024){return _0x17a024;});}return null;};}function removeEntity(_0x14a15b,_0x4ba20e){return function(_0x272881){if(_0x272881){return _0x272881[_0xdf04('0x24')]()['then'](function(){_0x14a15b[_0xdf04('0x1a')](0xcc)[_0xdf04('0x19')]();});}};}function handleEntityNotFound(_0x205a6a,_0x14eb7c){return function(_0xb2e7f6){if(!_0xb2e7f6){_0x205a6a[_0xdf04('0x18')](0x194);}return _0xb2e7f6;};}function handleError(_0x34366e,_0x2c7833){_0x2c7833=_0x2c7833||0x1f4;return function(_0x5ad234){logger[_0xdf04('0x25')](_0x5ad234['stack']);if(_0x5ad234[_0xdf04('0x26')]){delete _0x5ad234[_0xdf04('0x26')];}_0x34366e[_0xdf04('0x1a')](_0x2c7833)[_0xdf04('0x27')](_0x5ad234);};}exports[_0xdf04('0x28')]=function(_0x3c24ae,_0x29a9e8){var _0x58ef67={},_0xd187af={},_0x59d931={'count':0x0,'rows':[]};var _0x360031=_[_0xdf04('0x29')](db[_0xdf04('0x2a')][_0xdf04('0x2b')],function(_0x3d0aa1){return{'name':_0x3d0aa1[_0xdf04('0x2c')],'type':_0x3d0aa1[_0xdf04('0x2d')][_0xdf04('0x2e')]};});_0xd187af[_0xdf04('0x2f')]=_[_0xdf04('0x29')](_0x360031,'name');_0xd187af['query']=_[_0xdf04('0x30')](_0x3c24ae[_0xdf04('0x31')]);_0xd187af[_0xdf04('0x32')]=_[_0xdf04('0x33')](_0xd187af[_0xdf04('0x2f')],_0xd187af[_0xdf04('0x31')]);_0x58ef67[_0xdf04('0x34')]=_[_0xdf04('0x33')](_0xd187af['model'],qs[_0xdf04('0x35')](_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x35')]));_0x58ef67['attributes']=_0x58ef67[_0xdf04('0x34')][_0xdf04('0x36')]?_0x58ef67[_0xdf04('0x34')]:_0xd187af[_0xdf04('0x2f')];if(!_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x37')]('nolimit')){_0x58ef67[_0xdf04('0x1d')]=qs[_0xdf04('0x1d')](_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x1d')]);_0x58ef67[_0xdf04('0x1b')]=qs[_0xdf04('0x1b')](_0x3c24ae['query'][_0xdf04('0x1b')]);}_0x58ef67['order']=qs['sort'](_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x38')]);_0x58ef67['where']=qs[_0xdf04('0x32')](_['pick'](_0x3c24ae[_0xdf04('0x31')],_0xd187af[_0xdf04('0x32')]),_0x360031);if(_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x39')]){_0x58ef67[_0xdf04('0x3a')]=_[_0xdf04('0x3b')](_0x58ef67[_0xdf04('0x3a')],{'$or':_[_0xdf04('0x29')](_0x360031,function(_0x41cc44){if(_0x41cc44[_0xdf04('0x2d')]!==_0xdf04('0x3c')){var _0x3aed04={};_0x3aed04[_0x41cc44[_0xdf04('0x26')]]={'$like':'%'+_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x39')]+'%'};return _0x3aed04;}})});}_0x58ef67=_[_0xdf04('0x3b')]({},_0x58ef67,_0x3c24ae[_0xdf04('0x3d')]);var _0x146185={'where':_0x58ef67['where']};return db[_0xdf04('0x2a')][_0xdf04('0x3e')](_0x146185)[_0xdf04('0x3f')](function(_0x29a42f){_0x59d931[_0xdf04('0x3e')]=_0x29a42f;if(_0x3c24ae[_0xdf04('0x31')][_0xdf04('0x40')]){_0x58ef67[_0xdf04('0x41')]=[{'all':!![]}];}return db[_0xdf04('0x2a')]['findAll'](_0x58ef67);})['then'](function(_0x1498fd){_0x59d931[_0xdf04('0x42')]=_0x1498fd;return _0x59d931;})['then'](respondWithFilteredResult(_0x29a9e8,_0x58ef67))[_0xdf04('0x43')](handleError(_0x29a9e8,null));};exports[_0xdf04('0x44')]=function(_0x436ec9,_0xf521f1){var _0xd6e9be={'raw':!![],'where':{'id':_0x436ec9[_0xdf04('0x45')]['id']}},_0x2e02fd={};_0x2e02fd['model']=_[_0xdf04('0x30')](db[_0xdf04('0x2a')]['rawAttributes']);_0x2e02fd[_0xdf04('0x31')]=_['keys'](_0x436ec9[_0xdf04('0x31')]);_0x2e02fd[_0xdf04('0x32')]=_['intersection'](_0x2e02fd[_0xdf04('0x2f')],_0x2e02fd[_0xdf04('0x31')]);_0xd6e9be['attributes']=_[_0xdf04('0x33')](_0x2e02fd[_0xdf04('0x2f')],qs[_0xdf04('0x35')](_0x436ec9['query'][_0xdf04('0x35')]));_0xd6e9be[_0xdf04('0x34')]=_0xd6e9be['attributes'][_0xdf04('0x36')]?_0xd6e9be['attributes']:_0x2e02fd['model'];if(_0x436ec9[_0xdf04('0x31')][_0xdf04('0x40')]){_0xd6e9be[_0xdf04('0x41')]=[{'all':!![]}];}_0xd6e9be=_[_0xdf04('0x3b')]({},_0xd6e9be,_0x436ec9[_0xdf04('0x3d')]);return db[_0xdf04('0x2a')][_0xdf04('0x46')](_0xd6e9be)[_0xdf04('0x3f')](handleEntityNotFound(_0xf521f1,null))[_0xdf04('0x3f')](respondWithResult(_0xf521f1,null))[_0xdf04('0x43')](handleError(_0xf521f1,null));};exports[_0xdf04('0x47')]=function(_0x3ce0af,_0x391dea){if(_0x3ce0af[_0xdf04('0x48')]['id']){delete _0x3ce0af['body']['id'];}return db[_0xdf04('0x2a')][_0xdf04('0x46')]({'where':{'id':_0x3ce0af[_0xdf04('0x45')]['id']}})[_0xdf04('0x3f')](handleEntityNotFound(_0x391dea,null))['then'](saveUpdates(_0x3ce0af[_0xdf04('0x48')],null))[_0xdf04('0x3f')](respondWithResult(_0x391dea,null))['catch'](handleError(_0x391dea,null));};exports['destroy']=function(_0xd609a3,_0x5cfea4){return db[_0xdf04('0x2a')][_0xdf04('0x46')]({'where':{'id':_0xd609a3[_0xdf04('0x45')]['id']}})[_0xdf04('0x3f')](handleEntityNotFound(_0x5cfea4,null))[_0xdf04('0x3f')](removeEntity(_0x5cfea4,null))['catch'](handleError(_0x5cfea4,null));};exports['describe']=function(_0x28c04e,_0x58ef1c){return db[_0xdf04('0x2a')][_0xdf04('0x49')]()['then'](respondWithResult(_0x58ef1c,null))['catch'](handleError(_0x58ef1c,null));}; \ No newline at end of file +var _0x3281=['update','then','destroy','sendStatus','error','name','send','map','CmHopperBlack','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x1c41f5,_0x443b60){var _0x56a664=function(_0x2e704d){while(--_0x2e704d){_0x1c41f5['push'](_0x1c41f5['shift']());}};_0x56a664(++_0x443b60);}(_0x3281,0xbe));var _0x1328=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3281[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1328('0x0'));var zipdir=require(_0x1328('0x1'));var jsonpatch=require(_0x1328('0x2'));var rp=require(_0x1328('0x3'));var moment=require(_0x1328('0x4'));var BPromise=require(_0x1328('0x5'));var Mustache=require(_0x1328('0x6'));var util=require(_0x1328('0x7'));var path=require(_0x1328('0x8'));var sox=require(_0x1328('0x9'));var csv=require(_0x1328('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1328('0xb'));var _=require(_0x1328('0xc'));var squel=require('squel');var crypto=require(_0x1328('0xd'));var jsforce=require(_0x1328('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1328('0xf'));var Redis=require(_0x1328('0x10'));var authService=require(_0x1328('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1328('0x12'));var logger=require(_0x1328('0x13'))(_0x1328('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1328('0x15'));var db=require(_0x1328('0x16'))['db'];function respondWithStatusCode(_0x4c4f97,_0x24b678){_0x24b678=_0x24b678||0xcc;return function(_0x266253){if(_0x266253){return _0x4c4f97['sendStatus'](_0x24b678);}return _0x4c4f97[_0x1328('0x17')](_0x24b678)[_0x1328('0x18')]();};}function respondWithResult(_0x5503fc,_0x28c40b){_0x28c40b=_0x28c40b||0xc8;return function(_0x438461){if(_0x438461){return _0x5503fc['status'](_0x28c40b)[_0x1328('0x19')](_0x438461);}};}function respondWithFilteredResult(_0x5566d1,_0x512481){return function(_0x18dd7a){if(_0x18dd7a){var _0xdba798=typeof _0x512481[_0x1328('0x1a')]===_0x1328('0x1b')&&typeof _0x512481[_0x1328('0x1c')]===_0x1328('0x1b');var _0x2cbbe7=_0x18dd7a[_0x1328('0x1d')];var _0xd839f9=_0xdba798?0x0:_0x512481['offset'];var _0x50ee36=_0xdba798?_0x18dd7a['count']:_0x512481['offset']+_0x512481[_0x1328('0x1c')];var _0x14d0e9;if(_0x50ee36>=_0x2cbbe7){_0x50ee36=_0x2cbbe7;_0x14d0e9=0xc8;}else{_0x14d0e9=0xce;}_0x5566d1['status'](_0x14d0e9);return _0x5566d1[_0x1328('0x1e')](_0x1328('0x1f'),_0xd839f9+'-'+_0x50ee36+'/'+_0x2cbbe7)[_0x1328('0x19')](_0x18dd7a);}return null;};}function patchUpdates(_0x2ff33d){return function(_0x4becaf){try{jsonpatch[_0x1328('0x20')](_0x4becaf,_0x2ff33d,!![]);}catch(_0x4b0863){return BPromise[_0x1328('0x21')](_0x4b0863);}return _0x4becaf[_0x1328('0x22')]();};}function saveUpdates(_0x496766,_0x533d6e){return function(_0x589573){if(_0x589573){return _0x589573[_0x1328('0x23')](_0x496766)[_0x1328('0x24')](function(_0x4c302d){return _0x4c302d;});}return null;};}function removeEntity(_0x3c9a24,_0xa2d361){return function(_0x5dc825){if(_0x5dc825){return _0x5dc825[_0x1328('0x25')]()[_0x1328('0x24')](function(){_0x3c9a24[_0x1328('0x17')](0xcc)[_0x1328('0x18')]();});}};}function handleEntityNotFound(_0x1ecdc6,_0xb4d68b){return function(_0x14e580){if(!_0x14e580){_0x1ecdc6[_0x1328('0x26')](0x194);}return _0x14e580;};}function handleError(_0x427952,_0x2467d9){_0x2467d9=_0x2467d9||0x1f4;return function(_0x299129){logger[_0x1328('0x27')](_0x299129['stack']);if(_0x299129[_0x1328('0x28')]){delete _0x299129['name'];}_0x427952['status'](_0x2467d9)[_0x1328('0x29')](_0x299129);};}exports['index']=function(_0x4af920,_0x19e29b){var _0x37a296={},_0x4e84f6={},_0x392ee9={'count':0x0,'rows':[]};var _0x565048=_[_0x1328('0x2a')](db[_0x1328('0x2b')][_0x1328('0x2c')],function(_0x4d962a){return{'name':_0x4d962a[_0x1328('0x2d')],'type':_0x4d962a['type'][_0x1328('0x2e')]};});_0x4e84f6[_0x1328('0x2f')]=_['map'](_0x565048,_0x1328('0x28'));_0x4e84f6[_0x1328('0x30')]=_[_0x1328('0x31')](_0x4af920[_0x1328('0x30')]);_0x4e84f6[_0x1328('0x32')]=_[_0x1328('0x33')](_0x4e84f6['model'],_0x4e84f6[_0x1328('0x30')]);_0x37a296['attributes']=_[_0x1328('0x33')](_0x4e84f6[_0x1328('0x2f')],qs[_0x1328('0x34')](_0x4af920[_0x1328('0x30')][_0x1328('0x34')]));_0x37a296[_0x1328('0x35')]=_0x37a296[_0x1328('0x35')]['length']?_0x37a296['attributes']:_0x4e84f6[_0x1328('0x2f')];if(!_0x4af920[_0x1328('0x30')][_0x1328('0x36')](_0x1328('0x37'))){_0x37a296['limit']=qs[_0x1328('0x1c')](_0x4af920['query'][_0x1328('0x1c')]);_0x37a296[_0x1328('0x1a')]=qs[_0x1328('0x1a')](_0x4af920['query'][_0x1328('0x1a')]);}_0x37a296[_0x1328('0x38')]=qs['sort'](_0x4af920[_0x1328('0x30')][_0x1328('0x39')]);_0x37a296[_0x1328('0x3a')]=qs[_0x1328('0x32')](_[_0x1328('0x3b')](_0x4af920['query'],_0x4e84f6['filters']),_0x565048);if(_0x4af920[_0x1328('0x30')]['filter']){_0x37a296[_0x1328('0x3a')]=_[_0x1328('0x3c')](_0x37a296[_0x1328('0x3a')],{'$or':_['map'](_0x565048,function(_0x2ddde1){if(_0x2ddde1[_0x1328('0x3d')]!==_0x1328('0x3e')){var _0x6ee817={};_0x6ee817[_0x2ddde1[_0x1328('0x28')]]={'$like':'%'+_0x4af920['query'][_0x1328('0x3f')]+'%'};return _0x6ee817;}})});}_0x37a296=_[_0x1328('0x3c')]({},_0x37a296,_0x4af920['options']);var _0x4590a9={'where':_0x37a296[_0x1328('0x3a')]};return db[_0x1328('0x2b')][_0x1328('0x1d')](_0x4590a9)[_0x1328('0x24')](function(_0x2e1b6e){_0x392ee9['count']=_0x2e1b6e;if(_0x4af920[_0x1328('0x30')][_0x1328('0x40')]){_0x37a296[_0x1328('0x41')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x37a296);})[_0x1328('0x24')](function(_0x3c0b4e){_0x392ee9[_0x1328('0x42')]=_0x3c0b4e;return _0x392ee9;})[_0x1328('0x24')](respondWithFilteredResult(_0x19e29b,_0x37a296))[_0x1328('0x43')](handleError(_0x19e29b,null));};exports[_0x1328('0x44')]=function(_0x16344b,_0x53befc){var _0x4e3599={'raw':!![],'where':{'id':_0x16344b[_0x1328('0x45')]['id']}},_0x406554={};_0x406554['model']=_[_0x1328('0x31')](db[_0x1328('0x2b')]['rawAttributes']);_0x406554[_0x1328('0x30')]=_[_0x1328('0x31')](_0x16344b['query']);_0x406554[_0x1328('0x32')]=_[_0x1328('0x33')](_0x406554[_0x1328('0x2f')],_0x406554['query']);_0x4e3599['attributes']=_[_0x1328('0x33')](_0x406554[_0x1328('0x2f')],qs[_0x1328('0x34')](_0x16344b[_0x1328('0x30')][_0x1328('0x34')]));_0x4e3599[_0x1328('0x35')]=_0x4e3599['attributes'][_0x1328('0x46')]?_0x4e3599[_0x1328('0x35')]:_0x406554[_0x1328('0x2f')];if(_0x16344b[_0x1328('0x30')]['includeAll']){_0x4e3599[_0x1328('0x41')]=[{'all':!![]}];}_0x4e3599=_['merge']({},_0x4e3599,_0x16344b[_0x1328('0x47')]);return db[_0x1328('0x2b')][_0x1328('0x48')](_0x4e3599)[_0x1328('0x24')](handleEntityNotFound(_0x53befc,null))[_0x1328('0x24')](respondWithResult(_0x53befc,null))[_0x1328('0x43')](handleError(_0x53befc,null));};exports['update']=function(_0x1a5a6c,_0x53ccf5){if(_0x1a5a6c[_0x1328('0x49')]['id']){delete _0x1a5a6c[_0x1328('0x49')]['id'];}return db[_0x1328('0x2b')][_0x1328('0x48')]({'where':{'id':_0x1a5a6c['params']['id']}})['then'](handleEntityNotFound(_0x53ccf5,null))[_0x1328('0x24')](saveUpdates(_0x1a5a6c[_0x1328('0x49')],null))[_0x1328('0x24')](respondWithResult(_0x53ccf5,null))[_0x1328('0x43')](handleError(_0x53ccf5,null));};exports[_0x1328('0x25')]=function(_0x10b4ed,_0x3dabae){return db[_0x1328('0x2b')][_0x1328('0x48')]({'where':{'id':_0x10b4ed[_0x1328('0x45')]['id']}})[_0x1328('0x24')](handleEntityNotFound(_0x3dabae,null))['then'](removeEntity(_0x3dabae,null))['catch'](handleError(_0x3dabae,null));};exports[_0x1328('0x4a')]=function(_0x503898,_0x55c52c){return db[_0x1328('0x2b')][_0x1328('0x4a')]()['then'](respondWithResult(_0x55c52c,null))[_0x1328('0x43')](handleError(_0x55c52c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d03237c..a098f8f 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 _0xc566=['path','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc566,0x72));var _0x6c56=function(_0x490173,_0x43ce31){_0x490173=_0x490173-0x0;var _0x5b2028=_0xc566[_0x490173];return _0x5b2028;};'use strict';var _=require(_0x6c56('0x0'));var util=require(_0x6c56('0x1'));var logger=require('../../config/logger')(_0x6c56('0x2'));var moment=require(_0x6c56('0x3'));var BPromise=require(_0x6c56('0x4'));var rp=require(_0x6c56('0x5'));var fs=require('fs');var path=require(_0x6c56('0x6'));var rimraf=require(_0x6c56('0x7'));var config=require(_0x6c56('0x8'));var attributes=require('./cmHopperBlack.attributes');module[_0x6c56('0x9')]=function(_0x1fe7c9,_0x5ea479){return _0x1fe7c9['define'](_0x6c56('0xa'),attributes,{'tableName':_0x6c56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb752=['bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','define','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xb752,0x125));var _0x2b75=function(_0x5906ee,_0x4cbb5a){_0x5906ee=_0x5906ee-0x0;var _0x26775d=_0xb752[_0x5906ee];return _0x26775d;};'use strict';var _=require(_0x2b75('0x0'));var util=require(_0x2b75('0x1'));var logger=require(_0x2b75('0x2'))(_0x2b75('0x3'));var moment=require('moment');var BPromise=require(_0x2b75('0x4'));var rp=require(_0x2b75('0x5'));var fs=require('fs');var path=require(_0x2b75('0x6'));var rimraf=require('rimraf');var config=require(_0x2b75('0x7'));var attributes=require(_0x2b75('0x8'));module['exports']=function(_0x50a5d1,_0x561098){return _0x50a5d1[_0x2b75('0x9')]('CmHopperBlack',attributes,{'tableName':_0x2b75('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index e9956e6..f16f249 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 _0x3310=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','findAll','raw','options','where','attributes','limit','include','map','model','info','debug','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash'];(function(_0x43fda2,_0x1c5662){var _0xa492a2=function(_0x3a92c4){while(--_0x3a92c4){_0x43fda2['push'](_0x43fda2['shift']());}};_0xa492a2(++_0x1c5662);}(_0x3310,0xa3));var _0x0331=function(_0x2c9aec,_0x51171b){_0x2c9aec=_0x2c9aec-0x0;var _0x13c1bd=_0x3310[_0x2c9aec];return _0x13c1bd;};'use strict';var _=require(_0x0331('0x0'));var util=require(_0x0331('0x1'));var moment=require(_0x0331('0x2'));var BPromise=require(_0x0331('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0331('0x4'));var db=require(_0x0331('0x5'))['db'];var utils=require(_0x0331('0x6'));var logger=require(_0x0331('0x7'))(_0x0331('0x8'));var config=require(_0x0331('0x9'));var jayson=require(_0x0331('0xa'));var client=jayson[_0x0331('0xb')][_0x0331('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3543f6,_0x52dda6,_0x405fb4){return new BPromise(function(_0x55c635,_0x8a711b){return client[_0x0331('0xd')](_0x3543f6,_0x405fb4)[_0x0331('0xe')](function(_0x3caeef){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x52dda6,_0x0331('0xf'));logger['debug'](_0x0331('0x10'),_0x52dda6,_0x0331('0xf'),JSON[_0x0331('0x11')](_0x3caeef));if(_0x3caeef[_0x0331('0x12')]){if(_0x3caeef[_0x0331('0x12')]['code']===0x1f4){logger[_0x0331('0x12')](_0x0331('0x13'),_0x52dda6,_0x3caeef[_0x0331('0x12')][_0x0331('0x14')]);return _0x8a711b(_0x3caeef[_0x0331('0x12')][_0x0331('0x14')]);}logger[_0x0331('0x12')](_0x0331('0x13'),_0x52dda6,_0x3caeef[_0x0331('0x12')][_0x0331('0x14')]);return _0x55c635(_0x3caeef['error']['message']);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x52dda6,_0x0331('0xf'));_0x55c635(_0x3caeef[_0x0331('0x15')][_0x0331('0x14')]);}})[_0x0331('0x16')](function(_0x44ec8a){logger[_0x0331('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x52dda6,_0x44ec8a);_0x8a711b(_0x44ec8a);});});}exports[_0x0331('0x17')]=function(_0x2ef3cb){var _0x61f42a=this;return new Promise(function(_0x182042,_0x1b6671){return db['CmHopperBlack'][_0x0331('0x18')]({'raw':_0x2ef3cb['options']?_0x2ef3cb['options'][_0x0331('0x19')]===undefined?!![]:![]:!![],'where':_0x2ef3cb[_0x0331('0x1a')]?_0x2ef3cb['options'][_0x0331('0x1b')]||null:null,'attributes':_0x2ef3cb[_0x0331('0x1a')]?_0x2ef3cb[_0x0331('0x1a')][_0x0331('0x1c')]||null:null,'limit':_0x2ef3cb[_0x0331('0x1a')]?_0x2ef3cb[_0x0331('0x1a')][_0x0331('0x1d')]||null:null,'include':_0x2ef3cb[_0x0331('0x1a')]?_0x2ef3cb[_0x0331('0x1a')][_0x0331('0x1e')]?_[_0x0331('0x1f')](_0x2ef3cb[_0x0331('0x1a')]['include'],function(_0x51ad39){return{'model':db[_0x51ad39[_0x0331('0x20')]],'as':_0x51ad39['as'],'attributes':_0x51ad39[_0x0331('0x1c')],'include':_0x51ad39['include']?_[_0x0331('0x1f')](_0x51ad39[_0x0331('0x1e')],function(_0x57d147){return{'model':db[_0x57d147[_0x0331('0x20')]],'as':_0x57d147['as'],'attributes':_0x57d147[_0x0331('0x1c')],'include':_0x57d147[_0x0331('0x1e')]?_[_0x0331('0x1f')](_0x57d147['include'],function(_0x368061){return{'model':db[_0x368061[_0x0331('0x20')]],'as':_0x368061['as'],'attributes':_0x368061[_0x0331('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x540116){logger[_0x0331('0x21')](_0x0331('0x17'),_0x2ef3cb);logger[_0x0331('0x22')](_0x0331('0x17'),_0x2ef3cb,JSON[_0x0331('0x11')](_0x540116));_0x182042(_0x540116);})[_0x0331('0x16')](function(_0x50dff6){logger[_0x0331('0x12')](_0x0331('0x17'),_0x50dff6[_0x0331('0x14')],_0x2ef3cb);_0x1b6671(_0x61f42a['error'](0x1f4,_0x50dff6['message']));});});};exports[_0x0331('0x23')]=function(_0x3c33c6){var _0x24c250=this;return new Promise(function(_0x4cca72,_0x11defe){return db[_0x0331('0x24')][_0x0331('0x25')](_0x3c33c6[_0x0331('0x26')],{'raw':_0x3c33c6[_0x0331('0x1a')]?_0x3c33c6[_0x0331('0x1a')][_0x0331('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c33c6['options']?_0x3c33c6['options'][_0x0331('0x1b')]||null:null,'attributes':_0x3c33c6[_0x0331('0x1a')]?_0x3c33c6[_0x0331('0x1a')][_0x0331('0x1c')]||null:null,'limit':_0x3c33c6[_0x0331('0x1a')]?_0x3c33c6[_0x0331('0x1a')][_0x0331('0x1d')]||null:null})[_0x0331('0xe')](function(_0x3c2ba4){logger[_0x0331('0x21')](_0x0331('0x23'),_0x3c33c6);logger['debug'](_0x0331('0x23'),_0x3c33c6,JSON[_0x0331('0x11')](_0x3c2ba4));_0x4cca72(_0x3c2ba4);})[_0x0331('0x16')](function(_0x3afc9d){logger[_0x0331('0x12')](_0x0331('0x23'),_0x3afc9d[_0x0331('0x14')],_0x3c33c6);_0x11defe(_0x24c250['error'](0x1f4,_0x3afc9d[_0x0331('0x14')]));});});};exports[_0x0331('0x27')]=function(_0x5f555b){var _0x21699f=this;return new Promise(function(_0x7126ba,_0x111cec){return db[_0x0331('0x24')][_0x0331('0x28')]({'where':_0x5f555b[_0x0331('0x1a')]?_0x5f555b[_0x0331('0x1a')][_0x0331('0x1b')]||null:null})[_0x0331('0xe')](function(_0x401e0d){logger['info'](_0x0331('0x27'),_0x5f555b);logger[_0x0331('0x22')](_0x0331('0x27'),_0x5f555b,JSON['stringify'](_0x401e0d));_0x7126ba(_0x401e0d);})['catch'](function(_0x2b1f82){logger[_0x0331('0x12')](_0x0331('0x27'),_0x2b1f82[_0x0331('0x14')],_0x5f555b);_0x111cec(_0x21699f[_0x0331('0x12')](0x1f4,_0x2b1f82[_0x0331('0x14')]));});});}; \ No newline at end of file +var _0xfb2d=['debug','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmHopperBlack'];(function(_0x183518,_0x51e545){var _0x40afaf=function(_0x1dfd4a){while(--_0x1dfd4a){_0x183518['push'](_0x183518['shift']());}};_0x40afaf(++_0x51e545);}(_0xfb2d,0x95));var _0xdfb2=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0xfb2d[_0x166e96];return _0x553d73;};'use strict';var _=require('lodash');var util=require(_0xdfb2('0x0'));var moment=require(_0xdfb2('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfb2('0x2'));var fs=require('fs');var Redis=require(_0xdfb2('0x3'));var db=require(_0xdfb2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdfb2('0x5'))('rpc');var config=require(_0xdfb2('0x6'));var jayson=require(_0xdfb2('0x7'));var client=jayson[_0xdfb2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc54b,_0xf678ce,_0x452b57){return new BPromise(function(_0x55ebbf,_0x2e2d77){return client[_0xdfb2('0x9')](_0x3cc54b,_0x452b57)['then'](function(_0x1bad57){logger[_0xdfb2('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0xf678ce,'request\x20sent');logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0xf678ce,_0xdfb2('0xb'),JSON[_0xdfb2('0xc')](_0x1bad57));if(_0x1bad57[_0xdfb2('0xd')]){if(_0x1bad57[_0xdfb2('0xd')][_0xdfb2('0xe')]===0x1f4){logger[_0xdfb2('0xd')](_0xdfb2('0xf'),_0xf678ce,_0x1bad57[_0xdfb2('0xd')][_0xdfb2('0x10')]);return _0x2e2d77(_0x1bad57[_0xdfb2('0xd')][_0xdfb2('0x10')]);}logger['error'](_0xdfb2('0xf'),_0xf678ce,_0x1bad57[_0xdfb2('0xd')][_0xdfb2('0x10')]);return _0x55ebbf(_0x1bad57['error']['message']);}else{logger[_0xdfb2('0xa')](_0xdfb2('0xf'),_0xf678ce,_0xdfb2('0xb'));_0x55ebbf(_0x1bad57[_0xdfb2('0x11')]['message']);}})[_0xdfb2('0x12')](function(_0x1a62fc){logger[_0xdfb2('0xd')](_0xdfb2('0xf'),_0xf678ce,_0x1a62fc);_0x2e2d77(_0x1a62fc);});});}exports['GetCmHopperBlack']=function(_0xc8bf17){var _0x180610=this;return new Promise(function(_0x2d5fe2,_0x1d4058){return db[_0xdfb2('0x13')][_0xdfb2('0x14')]({'raw':_0xc8bf17[_0xdfb2('0x15')]?_0xc8bf17['options'][_0xdfb2('0x16')]===undefined?!![]:![]:!![],'where':_0xc8bf17[_0xdfb2('0x15')]?_0xc8bf17[_0xdfb2('0x15')][_0xdfb2('0x17')]||null:null,'attributes':_0xc8bf17['options']?_0xc8bf17[_0xdfb2('0x15')][_0xdfb2('0x18')]||null:null,'limit':_0xc8bf17[_0xdfb2('0x15')]?_0xc8bf17[_0xdfb2('0x15')][_0xdfb2('0x19')]||null:null,'include':_0xc8bf17[_0xdfb2('0x15')]?_0xc8bf17[_0xdfb2('0x15')][_0xdfb2('0x1a')]?_[_0xdfb2('0x1b')](_0xc8bf17[_0xdfb2('0x15')][_0xdfb2('0x1a')],function(_0x2a04b7){return{'model':db[_0x2a04b7['model']],'as':_0x2a04b7['as'],'attributes':_0x2a04b7['attributes'],'include':_0x2a04b7[_0xdfb2('0x1a')]?_[_0xdfb2('0x1b')](_0x2a04b7[_0xdfb2('0x1a')],function(_0x29d307){return{'model':db[_0x29d307[_0xdfb2('0x1c')]],'as':_0x29d307['as'],'attributes':_0x29d307[_0xdfb2('0x18')],'include':_0x29d307[_0xdfb2('0x1a')]?_[_0xdfb2('0x1b')](_0x29d307[_0xdfb2('0x1a')],function(_0x542f52){return{'model':db[_0x542f52[_0xdfb2('0x1c')]],'as':_0x542f52['as'],'attributes':_0x542f52['attributes']};}):[]};}):[]};}):[]:[]})[_0xdfb2('0x1d')](function(_0x1b5425){logger[_0xdfb2('0xa')](_0xdfb2('0x1e'),_0xc8bf17);logger[_0xdfb2('0x1f')](_0xdfb2('0x1e'),_0xc8bf17,JSON['stringify'](_0x1b5425));_0x2d5fe2(_0x1b5425);})[_0xdfb2('0x12')](function(_0x394937){logger[_0xdfb2('0xd')](_0xdfb2('0x1e'),_0x394937[_0xdfb2('0x10')],_0xc8bf17);_0x1d4058(_0x180610['error'](0x1f4,_0x394937[_0xdfb2('0x10')]));});});};exports['UpdateCmHopperBlack']=function(_0x4fab83){var _0x12513c=this;return new Promise(function(_0x2749f4,_0x2b5b8a){return db[_0xdfb2('0x13')]['update'](_0x4fab83[_0xdfb2('0x20')],{'raw':_0x4fab83[_0xdfb2('0x15')]?_0x4fab83[_0xdfb2('0x15')][_0xdfb2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fab83[_0xdfb2('0x15')]?_0x4fab83[_0xdfb2('0x15')]['where']||null:null,'attributes':_0x4fab83[_0xdfb2('0x15')]?_0x4fab83[_0xdfb2('0x15')][_0xdfb2('0x18')]||null:null,'limit':_0x4fab83[_0xdfb2('0x15')]?_0x4fab83[_0xdfb2('0x15')][_0xdfb2('0x19')]||null:null})[_0xdfb2('0x1d')](function(_0x4683c4){logger['info'](_0xdfb2('0x21'),_0x4fab83);logger[_0xdfb2('0x1f')]('UpdateCmHopperBlack',_0x4fab83,JSON[_0xdfb2('0xc')](_0x4683c4));_0x2749f4(_0x4683c4);})[_0xdfb2('0x12')](function(_0x424121){logger[_0xdfb2('0xd')]('UpdateCmHopperBlack',_0x424121['message'],_0x4fab83);_0x2b5b8a(_0x12513c[_0xdfb2('0xd')](0x1f4,_0x424121[_0xdfb2('0x10')]));});});};exports[_0xdfb2('0x22')]=function(_0x1ddb6c){var _0x4d2039=this;return new Promise(function(_0x5c1c71,_0x19c05c){return db[_0xdfb2('0x13')][_0xdfb2('0x23')]({'where':_0x1ddb6c[_0xdfb2('0x15')]?_0x1ddb6c[_0xdfb2('0x15')][_0xdfb2('0x17')]||null:null})[_0xdfb2('0x1d')](function(_0x41f512){logger['info'](_0xdfb2('0x22'),_0x1ddb6c);logger[_0xdfb2('0x1f')](_0xdfb2('0x22'),_0x1ddb6c,JSON[_0xdfb2('0xc')](_0x41f512));_0x5c1c71(_0x41f512);})[_0xdfb2('0x12')](function(_0x4d3731){logger[_0xdfb2('0xd')](_0xdfb2('0x22'),_0x4d3731['message'],_0x1ddb6c);_0x19c05c(_0x4d2039[_0xdfb2('0xd')](0x1f4,_0x4d3731[_0xdfb2('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 36faf96..1d3809d 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 _0x53ec=['../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','get','/describe','describe','/:id','show','put','update','multer','util','path','connect-timeout','express','Router'];(function(_0x3b6eb9,_0x409248){var _0x2d48a4=function(_0x5c5fb8){while(--_0x5c5fb8){_0x3b6eb9['push'](_0x3b6eb9['shift']());}};_0x2d48a4(++_0x409248);}(_0x53ec,0x192));var _0xc53e=function(_0x585723,_0x25250e){_0x585723=_0x585723-0x0;var _0x54edcf=_0x53ec[_0x585723];return _0x54edcf;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfb11=['show','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xfb11[_0xdc37a1];return _0x99b4fe;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xe')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller['update']);router[_0x1fb1('0xf')]('/:id',auth[_0x1fb1('0x7')](),controller['destroy']);module[_0x1fb1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 264bd8a..00fc3d3 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 _0xc530=['dispositionat','BOOLEAN','sequelize','moment','STRING','DATE','INTEGER','endtime','setDataValue','followuptime','diff'];(function(_0x22f6a7,_0x1e5ec2){var _0x24c3a4=function(_0x5e23a6){while(--_0x5e23a6){_0x22f6a7['push'](_0x22f6a7['shift']());}};_0x24c3a4(++_0x1e5ec2);}(_0xc530,0x157));var _0x0c53=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc530[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x0c53('0x0'));var moment=require(_0x0c53('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0c53('0x2')]},'scheduledat':{'type':Sequelize[_0x0c53('0x3')]},'countbusyretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x0c53('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0c53('0x2')]},'calleridname':{'type':Sequelize[_0x0c53('0x2')]},'starttime':{'type':Sequelize[_0x0c53('0x3')]},'responsetime':{'type':Sequelize[_0x0c53('0x3')]},'answertime':{'type':Sequelize[_0x0c53('0x3')]},'droptime':{'type':Sequelize[_0x0c53('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0c53('0x2')]},'campaigntype':{'type':Sequelize[_0x0c53('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x0c53('0x2')]},'disposition':{'type':Sequelize[_0x0c53('0x2')]},'secondDisposition':{'type':Sequelize[_0x0c53('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x0c53('0x3')],'set':function(_0x462414){var _0x3b876a=this['getDataValue'](_0x0c53('0x5'));if(_0x3b876a&&_0x462414){this[_0x0c53('0x6')](_0x0c53('0x7'),moment(_0x462414)[_0x0c53('0x8')](moment(_0x3b876a),'seconds'));}return this['setDataValue'](_0x0c53('0x9'),_0x462414);}},'amd':{'type':Sequelize[_0x0c53('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0c53('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0c53('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0c53('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0c53('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0c53('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0c53('0x3')]},'deleted':{'type':Sequelize[_0x0c53('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0c53('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0c53('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0c53('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb132=['DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','INTEGER','STRING'];(function(_0x2de964,_0x8a4be1){var _0x3db725=function(_0x349a7c){while(--_0x349a7c){_0x2de964['push'](_0x2de964['shift']());}};_0x3db725(++_0x8a4be1);}(_0xb132,0x110));var _0x2b13=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xb132[_0x452968];return _0xb6f9ae;};'use strict';var Sequelize=require(_0x2b13('0x0'));var moment=require(_0x2b13('0x1'));module['exports']={'state':{'type':Sequelize[_0x2b13('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x2b13('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2b13('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2b13('0x3')]},'calleridname':{'type':Sequelize[_0x2b13('0x3')]},'starttime':{'type':Sequelize[_0x2b13('0x4')]},'responsetime':{'type':Sequelize[_0x2b13('0x4')]},'answertime':{'type':Sequelize[_0x2b13('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x2b13('0x3')]},'campaigntype':{'type':Sequelize[_0x2b13('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x2b13('0x3')]},'disposition':{'type':Sequelize[_0x2b13('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2b13('0x3')]},'dispositionat':{'type':Sequelize[_0x2b13('0x4')],'set':function(_0x45ee5b){var _0x23b884=this[_0x2b13('0x5')](_0x2b13('0x6'));if(_0x23b884&&_0x45ee5b){this[_0x2b13('0x7')](_0x2b13('0x8'),moment(_0x45ee5b)['diff'](moment(_0x23b884),_0x2b13('0x9')));}return this['setDataValue'](_0x2b13('0xa'),_0x45ee5b);}},'amd':{'type':Sequelize[_0x2b13('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2b13('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2b13('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2b13('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2b13('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2b13('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2b13('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2b13('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2b13('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 38ab571..b50f1d8 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 _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4db45a,_0x4724a1){var _0x50b7d1=function(_0x323d8d){while(--_0x323d8d){_0x4db45a['push'](_0x4db45a['shift']());}};_0x50b7d1(++_0x4724a1);}(_0x2a07,0x74));var _0x72a0=function(_0x1ff804,_0x263135){_0x1ff804=_0x1ff804-0x0;var _0x3454b8=_0x2a07[_0x1ff804];return _0x3454b8;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file +var _0xfdbd=['status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','length','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','params','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','checkContactHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0xfdbd[_0x470e67];return _0x28bbde;};'use strict';var emlformat=require(_0xdfdb('0x0'));var rimraf=require(_0xdfdb('0x1'));var zipdir=require(_0xdfdb('0x2'));var jsonpatch=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var moment=require(_0xdfdb('0x5'));var BPromise=require(_0xdfdb('0x6'));var Mustache=require(_0xdfdb('0x7'));var util=require(_0xdfdb('0x8'));var path=require('path');var sox=require(_0xdfdb('0x9'));var csv=require('to-csv');var ejs=require(_0xdfdb('0xa'));var fs=require('fs');var fs_extra=require(_0xdfdb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfdb('0xc'));var deskjs=require(_0xdfdb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfdb('0xe'));var Papa=require(_0xdfdb('0xf'));var Redis=require(_0xdfdb('0x10'));var authService=require(_0xdfdb('0x11'));var qs=require(_0xdfdb('0x12'));var as=require(_0xdfdb('0x13'));var hardwareService=require(_0xdfdb('0x14'));var logger=require('../../config/logger')(_0xdfdb('0x15'));var utils=require(_0xdfdb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdfdb('0x17'));var db=require(_0xdfdb('0x18'))['db'];function respondWithStatusCode(_0x2bee3b,_0x1918c1){_0x1918c1=_0x1918c1||0xcc;return function(_0x2a95f1){if(_0x2a95f1){return _0x2bee3b[_0xdfdb('0x19')](_0x1918c1);}return _0x2bee3b[_0xdfdb('0x1a')](_0x1918c1)[_0xdfdb('0x1b')]();};}function respondWithResult(_0x51162f,_0x48a66a){_0x48a66a=_0x48a66a||0xc8;return function(_0x2c44dc){if(_0x2c44dc){return _0x51162f['status'](_0x48a66a)[_0xdfdb('0x1c')](_0x2c44dc);}};}function respondWithFilteredResult(_0x9f3039,_0x11a56a){return function(_0x40bc8a){if(_0x40bc8a){var _0x3bfd81=typeof _0x11a56a[_0xdfdb('0x1d')]==='undefined'&&typeof _0x11a56a['limit']===_0xdfdb('0x1e');var _0x8b9193=_0x40bc8a[_0xdfdb('0x1f')];var _0x55ab5a=_0x3bfd81?0x0:_0x11a56a[_0xdfdb('0x1d')];var _0xb677b1=_0x3bfd81?_0x40bc8a[_0xdfdb('0x1f')]:_0x11a56a[_0xdfdb('0x1d')]+_0x11a56a[_0xdfdb('0x20')];var _0x2294de;if(_0xb677b1>=_0x8b9193){_0xb677b1=_0x8b9193;_0x2294de=0xc8;}else{_0x2294de=0xce;}_0x9f3039[_0xdfdb('0x1a')](_0x2294de);return _0x9f3039[_0xdfdb('0x21')]('Content-Range',_0x55ab5a+'-'+_0xb677b1+'/'+_0x8b9193)[_0xdfdb('0x1c')](_0x40bc8a);}return null;};}function patchUpdates(_0xb7417c){return function(_0x172c63){try{jsonpatch['apply'](_0x172c63,_0xb7417c,!![]);}catch(_0x377112){return BPromise[_0xdfdb('0x22')](_0x377112);}return _0x172c63[_0xdfdb('0x23')]();};}function saveUpdates(_0x4d55e5,_0x280e53){return function(_0x789bd2){if(_0x789bd2){return _0x789bd2[_0xdfdb('0x24')](_0x4d55e5)['then'](function(_0x2a80c1){return _0x2a80c1;});}return null;};}function removeEntity(_0x526057,_0x2db1c1){return function(_0x145350){if(_0x145350){return _0x145350[_0xdfdb('0x25')]()[_0xdfdb('0x26')](function(){_0x526057['status'](0xcc)[_0xdfdb('0x1b')]();});}};}function handleEntityNotFound(_0x4363d8,_0x956843){return function(_0x400663){if(!_0x400663){_0x4363d8[_0xdfdb('0x19')](0x194);}return _0x400663;};}function handleError(_0x305954,_0x57d24f){_0x57d24f=_0x57d24f||0x1f4;return function(_0xec4d22){logger[_0xdfdb('0x27')](_0xec4d22[_0xdfdb('0x28')]);if(_0xec4d22['name']){delete _0xec4d22[_0xdfdb('0x29')];}_0x305954['status'](_0x57d24f)[_0xdfdb('0x2a')](_0xec4d22);};}exports[_0xdfdb('0x2b')]=function(_0x19c36f,_0x513fa0){var _0x5bc174={},_0x1c8ca8={},_0xc56435={'count':0x0,'rows':[]};var _0xedbb91=_[_0xdfdb('0x2c')](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')],function(_0x5a9fc4){return{'name':_0x5a9fc4[_0xdfdb('0x2f')],'type':_0x5a9fc4[_0xdfdb('0x30')][_0xdfdb('0x31')]};});_0x1c8ca8[_0xdfdb('0x32')]=_[_0xdfdb('0x2c')](_0xedbb91,_0xdfdb('0x29'));_0x1c8ca8[_0xdfdb('0x33')]=_[_0xdfdb('0x34')](_0x19c36f[_0xdfdb('0x33')]);_0x1c8ca8[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x1c8ca8['model'],_0x1c8ca8['query']);_0x5bc174[_0xdfdb('0x37')]=_['intersection'](_0x1c8ca8[_0xdfdb('0x32')],qs[_0xdfdb('0x38')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x38')]));_0x5bc174['attributes']=_0x5bc174[_0xdfdb('0x37')]['length']?_0x5bc174[_0xdfdb('0x37')]:_0x1c8ca8[_0xdfdb('0x32')];if(!_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x39')](_0xdfdb('0x3a'))){_0x5bc174[_0xdfdb('0x20')]=qs['limit'](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x20')]);_0x5bc174['offset']=qs[_0xdfdb('0x1d')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x1d')]);}_0x5bc174[_0xdfdb('0x3b')]=qs[_0xdfdb('0x3c')](_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3c')]);_0x5bc174[_0xdfdb('0x3d')]=qs[_0xdfdb('0x35')](_[_0xdfdb('0x3e')](_0x19c36f[_0xdfdb('0x33')],_0x1c8ca8['filters']),_0xedbb91);if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]){_0x5bc174[_0xdfdb('0x3d')]=_[_0xdfdb('0x40')](_0x5bc174[_0xdfdb('0x3d')],{'$or':_[_0xdfdb('0x2c')](_0xedbb91,function(_0x3ec73a){if(_0x3ec73a[_0xdfdb('0x30')]!=='VIRTUAL'){var _0x55d707={};_0x55d707[_0x3ec73a[_0xdfdb('0x29')]]={'$like':'%'+_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x3f')]+'%'};return _0x55d707;}})});}_0x5bc174=_[_0xdfdb('0x40')]({},_0x5bc174,_0x19c36f[_0xdfdb('0x41')]);var _0x300884={'where':_0x5bc174[_0xdfdb('0x3d')]};return db[_0xdfdb('0x2d')][_0xdfdb('0x1f')](_0x300884)['then'](function(_0x175f57){_0xc56435[_0xdfdb('0x1f')]=_0x175f57;if(_0x19c36f[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5bc174[_0xdfdb('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xdfdb('0x44')](_0x5bc174);})[_0xdfdb('0x26')](function(_0x3e9f88){_0xc56435[_0xdfdb('0x45')]=_0x3e9f88;return _0xc56435;})[_0xdfdb('0x26')](respondWithFilteredResult(_0x513fa0,_0x5bc174))['catch'](handleError(_0x513fa0,null));};exports[_0xdfdb('0x46')]=function(_0xd2f8bd,_0xf0482a){var _0x5b4381={'raw':!![],'where':{'id':_0xd2f8bd['params']['id']}},_0x2b5139={};_0x2b5139[_0xdfdb('0x32')]=_['keys'](db[_0xdfdb('0x2d')][_0xdfdb('0x2e')]);_0x2b5139['query']=_[_0xdfdb('0x34')](_0xd2f8bd['query']);_0x2b5139[_0xdfdb('0x35')]=_[_0xdfdb('0x36')](_0x2b5139[_0xdfdb('0x32')],_0x2b5139[_0xdfdb('0x33')]);_0x5b4381[_0xdfdb('0x37')]=_['intersection'](_0x2b5139['model'],qs[_0xdfdb('0x38')](_0xd2f8bd[_0xdfdb('0x33')]['fields']));_0x5b4381[_0xdfdb('0x37')]=_0x5b4381['attributes'][_0xdfdb('0x47')]?_0x5b4381[_0xdfdb('0x37')]:_0x2b5139[_0xdfdb('0x32')];if(_0xd2f8bd[_0xdfdb('0x33')][_0xdfdb('0x42')]){_0x5b4381[_0xdfdb('0x43')]=[{'all':!![]}];}_0x5b4381=_[_0xdfdb('0x40')]({},_0x5b4381,_0xd2f8bd[_0xdfdb('0x41')]);return db[_0xdfdb('0x2d')][_0xdfdb('0x48')](_0x5b4381)[_0xdfdb('0x26')](handleEntityNotFound(_0xf0482a,null))[_0xdfdb('0x26')](respondWithResult(_0xf0482a,null))[_0xdfdb('0x49')](handleError(_0xf0482a,null));};exports[_0xdfdb('0x4a')]=function(_0x1c08fb,_0x273477){return db['CmHopperFinal']['describe']()[_0xdfdb('0x26')](respondWithResult(_0x273477,null))[_0xdfdb('0x49')](handleError(_0x273477,null));};exports[_0xdfdb('0x24')]=function(_0x4bbb88,_0x36149e){if(_0x4bbb88[_0xdfdb('0x4b')][_0xdfdb('0x4c')]){delete _0x4bbb88[_0xdfdb('0x4b')]['uniqueid'];}return db[_0xdfdb('0x2d')][_0xdfdb('0x48')]({'where':{'uniqueid':_0x4bbb88['params']['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x36149e,null))[_0xdfdb('0x26')](saveUpdates(_0x4bbb88[_0xdfdb('0x4b')],null))[_0xdfdb('0x26')](respondWithResult(_0x36149e,null))[_0xdfdb('0x49')](handleError(_0x36149e,null));};exports[_0xdfdb('0x4d')]=function(_0x17dfdb,_0x1f5b88,_0x1da7af){return db['CmHopperFinal'][_0xdfdb('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x17dfdb['params']['id']},'attributes':[[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x53')))),'noAnswerContacts'],[db[_0xdfdb('0x4e')]['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x54')))),_0xdfdb('0x55')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x56')))),_0xdfdb('0x57')],[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x58')))),_0xdfdb('0x59')],[db['sequelize']['fn']('COUNT',db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5b')))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')]['literal'](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x1f5b88,null))['then'](respondWithResult(_0x1f5b88,null))[_0xdfdb('0x49')](handleError(_0x1f5b88,null));};exports[_0xdfdb('0x5f')]=function(_0x349cf7,_0x2f69a8,_0x424212){return db[_0xdfdb('0x2d')][_0xdfdb('0x44')]({'raw':![],'where':{'CampaignId':_0x349cf7[_0xdfdb('0x60')]['id']},'attributes':[[db['sequelize']['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x51')))),_0xdfdb('0x52')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x203,\x201,\x20null'))),_0xdfdb('0x61')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')](_0xdfdb('0x54')))),'busyContacts'],[db['sequelize']['fn'](_0xdfdb('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0xdfdb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0xdfdb('0x57')],[db[_0xdfdb('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xdfdb('0x59')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdfdb('0x5a')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xdfdb('0x5c')],[db[_0xdfdb('0x4e')]['fn'](_0xdfdb('0x4f'),db[_0xdfdb('0x4e')]['fn']('IF',db[_0xdfdb('0x4e')][_0xdfdb('0x50')](_0xdfdb('0x5d')))),_0xdfdb('0x5e')]]})[_0xdfdb('0x26')](handleEntityNotFound(_0x2f69a8,null))[_0xdfdb('0x26')](respondWithResult(_0x2f69a8,null))['catch'](handleError(_0x2f69a8,null));};exports[_0xdfdb('0x62')]=function(_0x198cfa,_0x2831d6,_0x45bfc0){return db[_0xdfdb('0x63')]['find']({'where':{'id':_0x198cfa[_0xdfdb('0x60')]['id']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x2831d6,null))[_0xdfdb('0x26')](function(_0x1a31b9){var _0x4999c4;if(_0x1a31b9){_0x4999c4=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')](_0xdfdb('0x66'))[_0xdfdb('0x67')]([_0xdfdb('0x68'),_0xdfdb('0x69'),_0xdfdb('0x6a'),_0xdfdb('0x6b'),_0xdfdb('0x6c'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel['select']()[_0xdfdb('0x6f')](_0xdfdb('0x70'),'phone')[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)','ContactId')[_0xdfdb('0x6f')](_0xdfdb('0x72'),_0xdfdb('0x6b'))[_0xdfdb('0x6f')](_0xdfdb('0x73'),_0xdfdb('0x6c'))[_0xdfdb('0x6f')]('NOW()',_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')]('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id'][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x77'),_0x198cfa[_0xdfdb('0x4b')]['state'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')]('phone')[_0xdfdb('0x74')](_0xdfdb('0x66'))['where']('VoiceQueueId\x20=\x20?',_0x198cfa[_0xdfdb('0x60')]['id']['toString']()))['where'](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x7c'),_0x198cfa['params']['id'][_0xdfdb('0x76')]())['where'](_0xdfdb('0x7d')))[_0xdfdb('0x7e')](_0xdfdb('0x6a')))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x4999c4);}return[];})[_0xdfdb('0x26')](respondWithResult(_0x2831d6,null))[_0xdfdb('0x49')](handleError(_0x2831d6,null));};exports[_0xdfdb('0x7f')]=function(_0x1b6445,_0x36241c,_0x4c833f){return db['Campaign'][_0xdfdb('0x48')]({'where':{'id':_0x1b6445[_0xdfdb('0x60')]['id']}})['then'](handleEntityNotFound(_0x36241c,null))[_0xdfdb('0x26')](function(_0x50d5d4){var _0x158454;if(_0x50d5d4){_0x158454=squel[_0xdfdb('0x64')]()[_0xdfdb('0x65')]('cm_hopper')[_0xdfdb('0x67')](['phone','scheduledAt',_0xdfdb('0x6a'),'ListId',_0xdfdb('0x80'),_0xdfdb('0x6d'),_0xdfdb('0x6e')],squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x70'),_0xdfdb('0x68'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x69'))['field']('ANY_VALUE(ContactId)',_0xdfdb('0x6a'))['field']('ANY_VALUE(ListId)','ListId')['field'](_0xdfdb('0x81'),_0xdfdb('0x80'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6d'))[_0xdfdb('0x6f')](_0xdfdb('0x71'),_0xdfdb('0x6e'))[_0xdfdb('0x74')](_0xdfdb('0x75'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x77'),_0x1b6445[_0xdfdb('0x4b')][_0xdfdb('0x83')][_0xdfdb('0x76')]())[_0xdfdb('0x3d')](_0xdfdb('0x78'))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()['field'](_0xdfdb('0x68'))[_0xdfdb('0x74')](_0xdfdb('0x66'))[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']()))[_0xdfdb('0x3d')](_0xdfdb('0x79'),squel[_0xdfdb('0x7a')]()[_0xdfdb('0x6f')](_0xdfdb('0x7b'))[_0xdfdb('0x74')]('cm_hopper_final')[_0xdfdb('0x3d')](_0xdfdb('0x82'),_0x1b6445[_0xdfdb('0x60')]['id']['toString']())['where'](_0xdfdb('0x7d')))['group']('ContactId'))[_0xdfdb('0x76')]();return db[_0xdfdb('0x4e')]['query'](_0x158454);}return[];})['then'](respondWithResult(_0x36241c,null))[_0xdfdb('0x49')](handleError(_0x36241c,null));};exports[_0xdfdb('0x84')]=function(_0x1f87d3,_0x1bc293,_0x36b01e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x1f87d3[_0xdfdb('0x4b')]['VoiceQueueId'],'CampaignId':_0x1f87d3[_0xdfdb('0x4b')][_0xdfdb('0x80')],'ContactId':_0x1f87d3[_0xdfdb('0x4b')]['ContactId']}})[_0xdfdb('0x26')](handleEntityNotFound(_0x1bc293,null))[_0xdfdb('0x26')](function(_0x3e0208){if(_0x3e0208){return _0x3e0208;}return null;})[_0xdfdb('0x26')](respondWithResult(_0x1bc293,null))['catch'](handleError(_0x1bc293,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index c20c004..11262a5 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 _0xff96=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0xff96,0x9c));var _0x6ff9=function(_0x3382e5,_0x4bfaa8){_0x3382e5=_0x3382e5-0x0;var _0x5efe1a=_0xff96[_0x3382e5];return _0x5efe1a;};'use strict';var _=require('lodash');var util=require(_0x6ff9('0x0'));var logger=require(_0x6ff9('0x1'))(_0x6ff9('0x2'));var moment=require(_0x6ff9('0x3'));var BPromise=require(_0x6ff9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ff9('0x5'));var rimraf=require(_0x6ff9('0x6'));var config=require(_0x6ff9('0x7'));var attributes=require(_0x6ff9('0x8'));module[_0x6ff9('0x9')]=function(_0x5aa59e,_0x4a702b){return _0x5aa59e[_0x6ff9('0xa')](_0x6ff9('0xb'),attributes,{'tableName':_0x6ff9('0xc'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x6ff9('0xd')]},{'name':_0x6ff9('0xe'),'fields':[_0x6ff9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad92=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x22d506,_0x47e664){var _0x2e2a3c=function(_0x1aad7e){while(--_0x1aad7e){_0x22d506['push'](_0x22d506['shift']());}};_0x2e2a3c(++_0x47e664);}(_0xad92,0x158));var _0x2ad9=function(_0x19ec97,_0x4b2bd9){_0x19ec97=_0x19ec97-0x0;var _0xbff8b7=_0xad92[_0x19ec97];return _0xbff8b7;};'use strict';var _=require(_0x2ad9('0x0'));var util=require(_0x2ad9('0x1'));var logger=require(_0x2ad9('0x2'))(_0x2ad9('0x3'));var moment=require(_0x2ad9('0x4'));var BPromise=require(_0x2ad9('0x5'));var rp=require(_0x2ad9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ad9('0x7'));var config=require(_0x2ad9('0x8'));var attributes=require(_0x2ad9('0x9'));module['exports']=function(_0x3234d1,_0x3a53ec){return _0x3234d1[_0x2ad9('0xa')](_0x2ad9('0xb'),attributes,{'tableName':_0x2ad9('0xc'),'paranoid':![],'indexes':[{'name':_0x2ad9('0xd'),'fields':[_0x2ad9('0xd')]},{'name':'uniqueid','fields':[_0x2ad9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 48060aa..397c3e5 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(_0xeea1cf,_0x24ffe6){var _0x5dd395=function(_0x3cf5a1){while(--_0x3cf5a1){_0xeea1cf['push'](_0xeea1cf['shift']());}};_0x5dd395(++_0x24ffe6);}(_0xb10b,0x12a));var _0xbb10=function(_0x440fde,_0x445ce0){_0x440fde=_0x440fde-0x0;var _0x11052c=_0xb10b[_0x440fde];return _0x11052c;};'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(_0x55df6d,_0x4ab503){var _0x444012=function(_0x1d3f3a){while(--_0x1d3f3a){_0x55df6d['push'](_0x55df6d['shift']());}};_0x444012(++_0x4ab503);}(_0xb10b,0x12a));var _0xbb10=function(_0x3cfe76,_0x1d9d61){_0x3cfe76=_0x3cfe76-0x0;var _0x1f6f12=_0xb10b[_0x3cfe76];return _0x1f6f12;};'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 ee26a68..71351de 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 _0x07e1=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','checkContactHopper','multer','path'];(function(_0x27bfe0,_0x437ba7){var _0x5dd160=function(_0x229d42){while(--_0x229d42){_0x27bfe0['push'](_0x27bfe0['shift']());}};_0x5dd160(++_0x437ba7);}(_0x07e1,0x18a));var _0x107e=function(_0x5dbcef,_0x5efec6){_0x5dbcef=_0x5dbcef-0x0;var _0x5690b9=_0x07e1[_0x5dbcef];return _0x5690b9;};'use strict';var multer=require(_0x107e('0x0'));var util=require('util');var path=require(_0x107e('0x1'));var timeout=require(_0x107e('0x2'));var express=require(_0x107e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x107e('0x4'));var interaction=require(_0x107e('0x5'));var config=require(_0x107e('0x6'));var controller=require(_0x107e('0x7'));router['get']('/',auth[_0x107e('0x8')](),controller[_0x107e('0x9')]);router[_0x107e('0xa')](_0x107e('0xb'),auth[_0x107e('0x8')](),controller[_0x107e('0xc')]);router[_0x107e('0xa')](_0x107e('0xd'),auth[_0x107e('0x8')](),controller[_0x107e('0xe')]);router['get'](_0x107e('0xf'),auth[_0x107e('0x8')](),controller[_0x107e('0x10')]);router[_0x107e('0xa')](_0x107e('0x11'),auth[_0x107e('0x8')](),controller[_0x107e('0x12')]);router[_0x107e('0x13')](_0x107e('0x14'),auth[_0x107e('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x107e('0x13')]('/voice/campaign/moveContacts/:id',auth[_0x107e('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x107e('0x13')]('/checkContactHopper',auth[_0x107e('0x8')](),controller[_0x107e('0x15')]);router['put'](_0x107e('0xd'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x254c=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe'];(function(_0x405b3b,_0x580899){var _0x3debc8=function(_0xd20027){while(--_0xd20027){_0x405b3b['push'](_0x405b3b['shift']());}};_0x3debc8(++_0x580899);}(_0x254c,0x135));var _0xc254=function(_0x1f0529,_0x2942c0){_0x1f0529=_0x1f0529-0x0;var _0x5bd106=_0x254c[_0x1f0529];return _0x5bd106;};'use strict';var multer=require(_0xc254('0x0'));var util=require(_0xc254('0x1'));var path=require(_0xc254('0x2'));var timeout=require(_0xc254('0x3'));var express=require(_0xc254('0x4'));var router=express[_0xc254('0x5')]();var fs_extra=require(_0xc254('0x6'));var auth=require(_0xc254('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc254('0x8'));router[_0xc254('0x9')]('/',auth[_0xc254('0xa')](),controller['index']);router[_0xc254('0x9')](_0xc254('0xb'),auth[_0xc254('0xa')](),controller[_0xc254('0xc')]);router[_0xc254('0x9')](_0xc254('0xd'),auth[_0xc254('0xa')](),controller[_0xc254('0xe')]);router['get'](_0xc254('0xf'),auth[_0xc254('0xa')](),controller[_0xc254('0x10')]);router['get'](_0xc254('0x11'),auth[_0xc254('0xa')](),controller[_0xc254('0x12')]);router[_0xc254('0x13')]('/voice/queue/moveContacts/:id',auth[_0xc254('0xa')](),controller[_0xc254('0x14')]);router[_0xc254('0x13')]('/voice/campaign/moveContacts/:id',auth[_0xc254('0xa')](),controller[_0xc254('0x15')]);router[_0xc254('0x13')]('/checkContactHopper',auth[_0xc254('0xa')](),controller[_0xc254('0x16')]);router['put'](_0xc254('0xd'),auth[_0xc254('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 0367d89..f886bde 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 _0xde76=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x494e4b,_0x57ea49){var _0x4a86c8=function(_0x8a75e){while(--_0x8a75e){_0x494e4b['push'](_0x494e4b['shift']());}};_0x4a86c8(++_0x57ea49);}(_0xde76,0xe9));var _0x6de7=function(_0x5cc96a,_0x5af128){_0x5cc96a=_0x5cc96a-0x0;var _0x4f3fde=_0xde76[_0x5cc96a];return _0x4f3fde;};'use strict';var Sequelize=require(_0x6de7('0x0'));module[_0x6de7('0x1')]={'state':{'type':Sequelize[_0x6de7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6de7('0x3')]},'scheduledat':{'type':Sequelize[_0x6de7('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6de7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6de7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6de7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6de7('0x3')]},'calleridnum':{'type':Sequelize[_0x6de7('0x3')]},'calleridname':{'type':Sequelize[_0x6de7('0x3')]},'starttime':{'type':Sequelize[_0x6de7('0x4')]},'responsetime':{'type':Sequelize[_0x6de7('0x4')]},'answertime':{'type':Sequelize[_0x6de7('0x4')]},'droptime':{'type':Sequelize[_0x6de7('0x4')]},'endtime':{'type':Sequelize[_0x6de7('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6de7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6de7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6de7('0x3')]},'campaign':{'type':Sequelize[_0x6de7('0x3')]},'campaigntype':{'type':Sequelize[_0x6de7('0x3')]},'membername':{'type':Sequelize[_0x6de7('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x6de7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6de7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6de7('0x4')]},'recallme':{'type':Sequelize[_0x6de7('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6de7('0x4')]},'edited':{'type':Sequelize[_0x6de7('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6de7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6de7('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6de7('0x3')]}}; \ No newline at end of file +var _0x2568=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x1920b5,_0x2addd7){var _0x5911a0=function(_0x5f4ab7){while(--_0x5f4ab7){_0x1920b5['push'](_0x1920b5['shift']());}};_0x5911a0(++_0x2addd7);}(_0x2568,0x148));var _0x8256=function(_0x36394d,_0x54f2e9){_0x36394d=_0x36394d-0x0;var _0x569405=_0x2568[_0x36394d];return _0x569405;};'use strict';var Sequelize=require('sequelize');module[_0x8256('0x0')]={'state':{'type':Sequelize[_0x8256('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x8256('0x2')]},'scheduledat':{'type':Sequelize[_0x8256('0x3')]},'countbusyretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8256('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x8256('0x2')]},'originatecalleridname':{'type':Sequelize[_0x8256('0x2')]},'calleridnum':{'type':Sequelize[_0x8256('0x2')]},'calleridname':{'type':Sequelize[_0x8256('0x2')]},'starttime':{'type':Sequelize[_0x8256('0x3')]},'responsetime':{'type':Sequelize[_0x8256('0x3')]},'answertime':{'type':Sequelize[_0x8256('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8256('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8256('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x8256('0x2')]},'membername':{'type':Sequelize[_0x8256('0x2')]},'reason':{'type':Sequelize[_0x8256('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x8256('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8256('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8256('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8256('0x3')]},'recallme':{'type':Sequelize[_0x8256('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8256('0x3')]},'edited':{'type':Sequelize[_0x8256('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8256('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9fcce17..0cc5e3d 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 _0x2af1=['include','find','catch','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','limit','sort','where','pick','filter','merge','VIRTUAL','findAll','show','keys','includeAll'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x2af1,0xe0));var _0x12af=function(_0x5d7719,_0x52350d){_0x5d7719=_0x5d7719-0x0;var _0x38407a=_0x2af1[_0x5d7719];return _0x38407a;};'use strict';var emlformat=require(_0x12af('0x0'));var rimraf=require(_0x12af('0x1'));var zipdir=require(_0x12af('0x2'));var jsonpatch=require(_0x12af('0x3'));var rp=require(_0x12af('0x4'));var moment=require(_0x12af('0x5'));var BPromise=require(_0x12af('0x6'));var Mustache=require('mustache');var util=require(_0x12af('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x12af('0x8'));var ejs=require(_0x12af('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x12af('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x12af('0xb'));var toCsv=require(_0x12af('0x8'));var querystring=require(_0x12af('0xc'));var Papa=require('papaparse');var Redis=require(_0x12af('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x12af('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12af('0xf'));var logger=require(_0x12af('0x10'))(_0x12af('0x11'));var utils=require(_0x12af('0x12'));var config=require(_0x12af('0x13'));var licenseUtil=require(_0x12af('0x14'));var db=require(_0x12af('0x15'))['db'];function respondWithStatusCode(_0x2867f7,_0x59d671){_0x59d671=_0x59d671||0xcc;return function(_0x319546){if(_0x319546){return _0x2867f7[_0x12af('0x16')](_0x59d671);}return _0x2867f7[_0x12af('0x17')](_0x59d671)[_0x12af('0x18')]();};}function respondWithResult(_0x57698c,_0x429d44){_0x429d44=_0x429d44||0xc8;return function(_0x390f9e){if(_0x390f9e){return _0x57698c[_0x12af('0x17')](_0x429d44)[_0x12af('0x19')](_0x390f9e);}};}function respondWithFilteredResult(_0x578f7f,_0x3dcdc4){return function(_0x264dae){if(_0x264dae){var _0x5052cc=typeof _0x3dcdc4[_0x12af('0x1a')]==='undefined'&&typeof _0x3dcdc4['limit']===_0x12af('0x1b');var _0x412283=_0x264dae[_0x12af('0x1c')];var _0x3ff67a=_0x5052cc?0x0:_0x3dcdc4[_0x12af('0x1a')];var _0x15421f=_0x5052cc?_0x264dae[_0x12af('0x1c')]:_0x3dcdc4[_0x12af('0x1a')]+_0x3dcdc4['limit'];var _0x9249f7;if(_0x15421f>=_0x412283){_0x15421f=_0x412283;_0x9249f7=0xc8;}else{_0x9249f7=0xce;}_0x578f7f[_0x12af('0x17')](_0x9249f7);return _0x578f7f[_0x12af('0x1d')](_0x12af('0x1e'),_0x3ff67a+'-'+_0x15421f+'/'+_0x412283)[_0x12af('0x19')](_0x264dae);}return null;};}function patchUpdates(_0x2d18a5){return function(_0xad82dd){try{jsonpatch[_0x12af('0x1f')](_0xad82dd,_0x2d18a5,!![]);}catch(_0x235c02){return BPromise[_0x12af('0x20')](_0x235c02);}return _0xad82dd[_0x12af('0x21')]();};}function saveUpdates(_0x4dc9be,_0x3db6b9){return function(_0x2d1f67){if(_0x2d1f67){return _0x2d1f67[_0x12af('0x22')](_0x4dc9be)[_0x12af('0x23')](function(_0x1cb720){return _0x1cb720;});}return null;};}function removeEntity(_0x5c8526,_0x4633cb){return function(_0x45f247){if(_0x45f247){return _0x45f247[_0x12af('0x24')]()[_0x12af('0x23')](function(){_0x5c8526[_0x12af('0x17')](0xcc)[_0x12af('0x18')]();});}};}function handleEntityNotFound(_0x5d20c0,_0x3dc933){return function(_0x16c05b){if(!_0x16c05b){_0x5d20c0[_0x12af('0x16')](0x194);}return _0x16c05b;};}function handleError(_0x3fb83e,_0x5c904d){_0x5c904d=_0x5c904d||0x1f4;return function(_0x3d0af4){logger[_0x12af('0x25')](_0x3d0af4[_0x12af('0x26')]);if(_0x3d0af4[_0x12af('0x27')]){delete _0x3d0af4['name'];}_0x3fb83e[_0x12af('0x17')](_0x5c904d)[_0x12af('0x28')](_0x3d0af4);};}exports[_0x12af('0x29')]=function(_0x2b4607,_0x2ff364){var _0x85d213={},_0x562244={},_0x847040={'count':0x0,'rows':[]};var _0x234df5=_['map'](db[_0x12af('0x2a')][_0x12af('0x2b')],function(_0x785206){return{'name':_0x785206['fieldName'],'type':_0x785206[_0x12af('0x2c')][_0x12af('0x2d')]};});_0x562244[_0x12af('0x2e')]=_['map'](_0x234df5,'name');_0x562244[_0x12af('0x2f')]=_['keys'](_0x2b4607[_0x12af('0x2f')]);_0x562244[_0x12af('0x30')]=_[_0x12af('0x31')](_0x562244[_0x12af('0x2e')],_0x562244[_0x12af('0x2f')]);_0x85d213[_0x12af('0x32')]=_[_0x12af('0x31')](_0x562244[_0x12af('0x2e')],qs[_0x12af('0x33')](_0x2b4607['query'][_0x12af('0x33')]));_0x85d213['attributes']=_0x85d213[_0x12af('0x32')][_0x12af('0x34')]?_0x85d213['attributes']:_0x562244['model'];if(!_0x2b4607[_0x12af('0x2f')]['hasOwnProperty']('nolimit')){_0x85d213['limit']=qs[_0x12af('0x35')](_0x2b4607[_0x12af('0x2f')][_0x12af('0x35')]);_0x85d213['offset']=qs[_0x12af('0x1a')](_0x2b4607[_0x12af('0x2f')][_0x12af('0x1a')]);}_0x85d213['order']=qs[_0x12af('0x36')](_0x2b4607[_0x12af('0x2f')][_0x12af('0x36')]);_0x85d213[_0x12af('0x37')]=qs[_0x12af('0x30')](_[_0x12af('0x38')](_0x2b4607[_0x12af('0x2f')],_0x562244['filters']),_0x234df5);if(_0x2b4607[_0x12af('0x2f')][_0x12af('0x39')]){_0x85d213[_0x12af('0x37')]=_[_0x12af('0x3a')](_0x85d213[_0x12af('0x37')],{'$or':_['map'](_0x234df5,function(_0x5f44d0){if(_0x5f44d0[_0x12af('0x2c')]!==_0x12af('0x3b')){var _0x46d34d={};_0x46d34d[_0x5f44d0[_0x12af('0x27')]]={'$like':'%'+_0x2b4607[_0x12af('0x2f')]['filter']+'%'};return _0x46d34d;}})});}_0x85d213=_[_0x12af('0x3a')]({},_0x85d213,_0x2b4607['options']);var _0x2f746d={'where':_0x85d213['where']};return db[_0x12af('0x2a')][_0x12af('0x1c')](_0x2f746d)[_0x12af('0x23')](function(_0xd39321){_0x847040[_0x12af('0x1c')]=_0xd39321;if(_0x2b4607[_0x12af('0x2f')]['includeAll']){_0x85d213['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x12af('0x3c')](_0x85d213);})[_0x12af('0x23')](function(_0x5df360){_0x847040['rows']=_0x5df360;return _0x847040;})[_0x12af('0x23')](respondWithFilteredResult(_0x2ff364,_0x85d213))['catch'](handleError(_0x2ff364,null));};exports[_0x12af('0x3d')]=function(_0x4920d1,_0x377c50){var _0x4f63fa={'raw':!![],'where':{'id':_0x4920d1['params']['id']}},_0x38740e={};_0x38740e[_0x12af('0x2e')]=_[_0x12af('0x3e')](db[_0x12af('0x2a')][_0x12af('0x2b')]);_0x38740e['query']=_[_0x12af('0x3e')](_0x4920d1[_0x12af('0x2f')]);_0x38740e[_0x12af('0x30')]=_['intersection'](_0x38740e[_0x12af('0x2e')],_0x38740e[_0x12af('0x2f')]);_0x4f63fa[_0x12af('0x32')]=_['intersection'](_0x38740e[_0x12af('0x2e')],qs[_0x12af('0x33')](_0x4920d1['query']['fields']));_0x4f63fa['attributes']=_0x4f63fa[_0x12af('0x32')][_0x12af('0x34')]?_0x4f63fa['attributes']:_0x38740e['model'];if(_0x4920d1['query'][_0x12af('0x3f')]){_0x4f63fa[_0x12af('0x40')]=[{'all':!![]}];}_0x4f63fa=_[_0x12af('0x3a')]({},_0x4f63fa,_0x4920d1['options']);return db[_0x12af('0x2a')][_0x12af('0x41')](_0x4f63fa)[_0x12af('0x23')](handleEntityNotFound(_0x377c50,null))[_0x12af('0x23')](respondWithResult(_0x377c50,null))[_0x12af('0x42')](handleError(_0x377c50,null));};exports[_0x12af('0x43')]=function(_0x365bc5,_0x3829d3){return db[_0x12af('0x2a')]['create'](_0x365bc5[_0x12af('0x44')],{})[_0x12af('0x23')](respondWithResult(_0x3829d3,0xc9))[_0x12af('0x42')](handleError(_0x3829d3,null));};exports[_0x12af('0x45')]=function(_0x58e7fd,_0x15d5dd){return db[_0x12af('0x2a')][_0x12af('0x45')]()[_0x12af('0x23')](respondWithResult(_0x15d5dd,null))[_0x12af('0x42')](handleError(_0x15d5dd,null));};exports[_0x12af('0x22')]=function(_0x365c3e,_0x531a92){if(_0x365c3e[_0x12af('0x44')][_0x12af('0x46')]){delete _0x365c3e[_0x12af('0x44')][_0x12af('0x46')];}return db[_0x12af('0x2a')]['find']({'where':{'uniqueid':_0x365c3e[_0x12af('0x47')]['id']}})[_0x12af('0x23')](handleEntityNotFound(_0x531a92,null))[_0x12af('0x23')](saveUpdates(_0x365c3e['body'],null))[_0x12af('0x23')](respondWithResult(_0x531a92,null))[_0x12af('0x42')](handleError(_0x531a92,null));}; \ No newline at end of file +var _0x76c7=['rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','Content-Range','apply','reject','destroy','then','sendStatus','stack','name','send','map','CmHopperHistory'];(function(_0x5e46b8,_0x21f878){var _0x2935ac=function(_0x366876){while(--_0x366876){_0x5e46b8['push'](_0x5e46b8['shift']());}};_0x2935ac(++_0x21f878);}(_0x76c7,0x13e));var _0x776c=function(_0x558081,_0x58cec1){_0x558081=_0x558081-0x0;var _0x33d9f3=_0x76c7[_0x558081];return _0x33d9f3;};'use strict';var emlformat=require(_0x776c('0x0'));var rimraf=require(_0x776c('0x1'));var zipdir=require(_0x776c('0x2'));var jsonpatch=require(_0x776c('0x3'));var rp=require('request-promise');var moment=require(_0x776c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x776c('0x5'));var util=require('util');var path=require(_0x776c('0x6'));var sox=require(_0x776c('0x7'));var csv=require(_0x776c('0x8'));var ejs=require(_0x776c('0x9'));var fs=require('fs');var fs_extra=require(_0x776c('0xa'));var _=require('lodash');var squel=require(_0x776c('0xb'));var crypto=require(_0x776c('0xc'));var jsforce=require(_0x776c('0xd'));var deskjs=require(_0x776c('0xe'));var toCsv=require(_0x776c('0x8'));var querystring=require('querystring');var Papa=require(_0x776c('0xf'));var Redis=require(_0x776c('0x10'));var authService=require(_0x776c('0x11'));var qs=require(_0x776c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x776c('0x13'));var logger=require('../../config/logger')(_0x776c('0x14'));var utils=require(_0x776c('0x15'));var config=require(_0x776c('0x16'));var licenseUtil=require(_0x776c('0x17'));var db=require(_0x776c('0x18'))['db'];function respondWithStatusCode(_0x400a1c,_0x1e9b73){_0x1e9b73=_0x1e9b73||0xcc;return function(_0x335b3d){if(_0x335b3d){return _0x400a1c['sendStatus'](_0x1e9b73);}return _0x400a1c[_0x776c('0x19')](_0x1e9b73)[_0x776c('0x1a')]();};}function respondWithResult(_0xd4051,_0x47b63f){_0x47b63f=_0x47b63f||0xc8;return function(_0x5f41e6){if(_0x5f41e6){return _0xd4051[_0x776c('0x19')](_0x47b63f)[_0x776c('0x1b')](_0x5f41e6);}};}function respondWithFilteredResult(_0x1fa6c3,_0x1cae1d){return function(_0x1923d5){if(_0x1923d5){var _0x52b04b=typeof _0x1cae1d['offset']===_0x776c('0x1c')&&typeof _0x1cae1d['limit']===_0x776c('0x1c');var _0x464c58=_0x1923d5['count'];var _0xd37b30=_0x52b04b?0x0:_0x1cae1d['offset'];var _0x8da31a=_0x52b04b?_0x1923d5[_0x776c('0x1d')]:_0x1cae1d[_0x776c('0x1e')]+_0x1cae1d['limit'];var _0x3cfa6;if(_0x8da31a>=_0x464c58){_0x8da31a=_0x464c58;_0x3cfa6=0xc8;}else{_0x3cfa6=0xce;}_0x1fa6c3[_0x776c('0x19')](_0x3cfa6);return _0x1fa6c3['set'](_0x776c('0x1f'),_0xd37b30+'-'+_0x8da31a+'/'+_0x464c58)[_0x776c('0x1b')](_0x1923d5);}return null;};}function patchUpdates(_0xb26c29){return function(_0x4d2a50){try{jsonpatch[_0x776c('0x20')](_0x4d2a50,_0xb26c29,!![]);}catch(_0x17837e){return BPromise[_0x776c('0x21')](_0x17837e);}return _0x4d2a50['save']();};}function saveUpdates(_0x12ec62,_0x5b5031){return function(_0x304159){if(_0x304159){return _0x304159['update'](_0x12ec62)['then'](function(_0x2a1f58){return _0x2a1f58;});}return null;};}function removeEntity(_0x150972,_0x579ff4){return function(_0x34f643){if(_0x34f643){return _0x34f643[_0x776c('0x22')]()[_0x776c('0x23')](function(){_0x150972[_0x776c('0x19')](0xcc)[_0x776c('0x1a')]();});}};}function handleEntityNotFound(_0x2cdacc,_0x1f15da){return function(_0xdb83ce){if(!_0xdb83ce){_0x2cdacc[_0x776c('0x24')](0x194);}return _0xdb83ce;};}function handleError(_0x109088,_0x1a6fbf){_0x1a6fbf=_0x1a6fbf||0x1f4;return function(_0x32706a){logger['error'](_0x32706a[_0x776c('0x25')]);if(_0x32706a['name']){delete _0x32706a[_0x776c('0x26')];}_0x109088[_0x776c('0x19')](_0x1a6fbf)[_0x776c('0x27')](_0x32706a);};}exports['index']=function(_0x3d5a94,_0x1ae8ff){var _0x4e19d5={},_0x2fdff5={},_0xedd48b={'count':0x0,'rows':[]};var _0x3481a6=_[_0x776c('0x28')](db[_0x776c('0x29')][_0x776c('0x2a')],function(_0x26b5a6){return{'name':_0x26b5a6[_0x776c('0x2b')],'type':_0x26b5a6[_0x776c('0x2c')]['key']};});_0x2fdff5[_0x776c('0x2d')]=_[_0x776c('0x28')](_0x3481a6,_0x776c('0x26'));_0x2fdff5[_0x776c('0x2e')]=_[_0x776c('0x2f')](_0x3d5a94[_0x776c('0x2e')]);_0x2fdff5['filters']=_[_0x776c('0x30')](_0x2fdff5[_0x776c('0x2d')],_0x2fdff5[_0x776c('0x2e')]);_0x4e19d5['attributes']=_[_0x776c('0x30')](_0x2fdff5[_0x776c('0x2d')],qs[_0x776c('0x31')](_0x3d5a94[_0x776c('0x2e')][_0x776c('0x31')]));_0x4e19d5[_0x776c('0x32')]=_0x4e19d5[_0x776c('0x32')]['length']?_0x4e19d5['attributes']:_0x2fdff5[_0x776c('0x2d')];if(!_0x3d5a94['query']['hasOwnProperty']('nolimit')){_0x4e19d5['limit']=qs[_0x776c('0x33')](_0x3d5a94[_0x776c('0x2e')][_0x776c('0x33')]);_0x4e19d5[_0x776c('0x1e')]=qs[_0x776c('0x1e')](_0x3d5a94['query'][_0x776c('0x1e')]);}_0x4e19d5[_0x776c('0x34')]=qs[_0x776c('0x35')](_0x3d5a94['query']['sort']);_0x4e19d5[_0x776c('0x36')]=qs[_0x776c('0x37')](_[_0x776c('0x38')](_0x3d5a94[_0x776c('0x2e')],_0x2fdff5['filters']),_0x3481a6);if(_0x3d5a94[_0x776c('0x2e')][_0x776c('0x39')]){_0x4e19d5[_0x776c('0x36')]=_[_0x776c('0x3a')](_0x4e19d5[_0x776c('0x36')],{'$or':_[_0x776c('0x28')](_0x3481a6,function(_0x9fa284){if(_0x9fa284[_0x776c('0x2c')]!=='VIRTUAL'){var _0x1e6458={};_0x1e6458[_0x9fa284[_0x776c('0x26')]]={'$like':'%'+_0x3d5a94[_0x776c('0x2e')]['filter']+'%'};return _0x1e6458;}})});}_0x4e19d5=_[_0x776c('0x3a')]({},_0x4e19d5,_0x3d5a94[_0x776c('0x3b')]);var _0x2950c4={'where':_0x4e19d5[_0x776c('0x36')]};return db[_0x776c('0x29')][_0x776c('0x1d')](_0x2950c4)[_0x776c('0x23')](function(_0x4e4dc6){_0xedd48b[_0x776c('0x1d')]=_0x4e4dc6;if(_0x3d5a94[_0x776c('0x2e')][_0x776c('0x3c')]){_0x4e19d5[_0x776c('0x3d')]=[{'all':!![]}];}return db[_0x776c('0x29')][_0x776c('0x3e')](_0x4e19d5);})[_0x776c('0x23')](function(_0x5b0ab7){_0xedd48b[_0x776c('0x3f')]=_0x5b0ab7;return _0xedd48b;})['then'](respondWithFilteredResult(_0x1ae8ff,_0x4e19d5))[_0x776c('0x40')](handleError(_0x1ae8ff,null));};exports[_0x776c('0x41')]=function(_0x4638a7,_0x4b343f){var _0x39e7a0={'raw':!![],'where':{'id':_0x4638a7[_0x776c('0x42')]['id']}},_0x3bc1d7={};_0x3bc1d7[_0x776c('0x2d')]=_[_0x776c('0x2f')](db[_0x776c('0x29')][_0x776c('0x2a')]);_0x3bc1d7['query']=_[_0x776c('0x2f')](_0x4638a7[_0x776c('0x2e')]);_0x3bc1d7[_0x776c('0x37')]=_['intersection'](_0x3bc1d7['model'],_0x3bc1d7[_0x776c('0x2e')]);_0x39e7a0[_0x776c('0x32')]=_['intersection'](_0x3bc1d7[_0x776c('0x2d')],qs['fields'](_0x4638a7['query'][_0x776c('0x31')]));_0x39e7a0[_0x776c('0x32')]=_0x39e7a0[_0x776c('0x32')][_0x776c('0x43')]?_0x39e7a0[_0x776c('0x32')]:_0x3bc1d7[_0x776c('0x2d')];if(_0x4638a7[_0x776c('0x2e')]['includeAll']){_0x39e7a0[_0x776c('0x3d')]=[{'all':!![]}];}_0x39e7a0=_[_0x776c('0x3a')]({},_0x39e7a0,_0x4638a7[_0x776c('0x3b')]);return db[_0x776c('0x29')][_0x776c('0x44')](_0x39e7a0)[_0x776c('0x23')](handleEntityNotFound(_0x4b343f,null))[_0x776c('0x23')](respondWithResult(_0x4b343f,null))[_0x776c('0x40')](handleError(_0x4b343f,null));};exports[_0x776c('0x45')]=function(_0x2cd5a1,_0x682152){return db[_0x776c('0x29')]['create'](_0x2cd5a1[_0x776c('0x46')],{})[_0x776c('0x23')](respondWithResult(_0x682152,0xc9))[_0x776c('0x40')](handleError(_0x682152,null));};exports[_0x776c('0x47')]=function(_0x5d2589,_0x1a3b61){return db['CmHopperHistory'][_0x776c('0x47')]()['then'](respondWithResult(_0x1a3b61,null))[_0x776c('0x40')](handleError(_0x1a3b61,null));};exports['update']=function(_0x35fb74,_0x303b4f){if(_0x35fb74[_0x776c('0x46')]['uniqueid']){delete _0x35fb74[_0x776c('0x46')]['uniqueid'];}return db[_0x776c('0x29')][_0x776c('0x44')]({'where':{'uniqueid':_0x35fb74[_0x776c('0x42')]['id']}})[_0x776c('0x23')](handleEntityNotFound(_0x303b4f,null))['then'](saveUpdates(_0x35fb74[_0x776c('0x46')],null))[_0x776c('0x23')](respondWithResult(_0x303b4f,null))[_0x776c('0x40')](handleError(_0x303b4f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 2d7a961..335e6bd 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 _0x082a=['endtime','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_history'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x082a,0x154));var _0xa082=function(_0x56b7bf,_0x278652){_0x56b7bf=_0x56b7bf-0x0;var _0x5b2cc6=_0x082a[_0x56b7bf];return _0x5b2cc6;};'use strict';var _=require('lodash');var util=require(_0xa082('0x0'));var logger=require(_0xa082('0x1'))(_0xa082('0x2'));var moment=require('moment');var BPromise=require(_0xa082('0x3'));var rp=require(_0xa082('0x4'));var fs=require('fs');var path=require(_0xa082('0x5'));var rimraf=require(_0xa082('0x6'));var config=require(_0xa082('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xa082('0x8')]=function(_0x59b4a8,_0x1ada27){return _0x59b4a8[_0xa082('0x9')]('CmHopperHistory',attributes,{'tableName':_0xa082('0xa'),'paranoid':![],'indexes':[{'name':_0xa082('0xb'),'fields':[_0xa082('0xb')]},{'name':'uniqueid','fields':[_0xa082('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11c8=['rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x45e6f9,_0xc9dba3){var _0x47c290=function(_0x24584f){while(--_0x24584f){_0x45e6f9['push'](_0x45e6f9['shift']());}};_0x47c290(++_0xc9dba3);}(_0x11c8,0x19a));var _0x811c=function(_0x425ecd,_0x1e1bed){_0x425ecd=_0x425ecd-0x0;var _0xddc406=_0x11c8[_0x425ecd];return _0xddc406;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var logger=require(_0x811c('0x1'))('api');var moment=require(_0x811c('0x2'));var BPromise=require(_0x811c('0x3'));var rp=require(_0x811c('0x4'));var fs=require('fs');var path=require(_0x811c('0x5'));var rimraf=require(_0x811c('0x6'));var config=require(_0x811c('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x811c('0x8')]=function(_0x40cc07,_0x537216){return _0x40cc07[_0x811c('0x9')](_0x811c('0xa'),attributes,{'tableName':_0x811c('0xb'),'paranoid':![],'indexes':[{'name':_0x811c('0xc'),'fields':['endtime']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 840bb4a..4fa7ed9 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 _0xcdcc=['code','message','result','catch','CmHopperHistory','body','options','raw','then','CreateCmHopperHistory','stringify','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xcdcc,0x1d2));var _0xccdc=function(_0x2b636c,_0x3b7317){_0x2b636c=_0x2b636c-0x0;var _0x213a3b=_0xcdcc[_0x2b636c];return _0x213a3b;};'use strict';var _=require(_0xccdc('0x0'));var util=require(_0xccdc('0x1'));var moment=require(_0xccdc('0x2'));var BPromise=require('bluebird');var rs=require(_0xccdc('0x3'));var fs=require('fs');var Redis=require(_0xccdc('0x4'));var db=require(_0xccdc('0x5'))['db'];var utils=require(_0xccdc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xccdc('0x7'));var jayson=require(_0xccdc('0x8'));var client=jayson['client'][_0xccdc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fb2c6,_0x188a11,_0x2c5732){return new BPromise(function(_0x17a77d,_0x364fa8){return client[_0xccdc('0xa')](_0x4fb2c6,_0x2c5732)['then'](function(_0x2d0263){logger[_0xccdc('0xb')](_0xccdc('0xc'),_0x188a11,_0xccdc('0xd'));logger[_0xccdc('0xe')](_0xccdc('0xf'),_0x188a11,_0xccdc('0xd'),JSON['stringify'](_0x2d0263));if(_0x2d0263[_0xccdc('0x10')]){if(_0x2d0263['error'][_0xccdc('0x11')]===0x1f4){logger['error'](_0xccdc('0xc'),_0x188a11,_0x2d0263[_0xccdc('0x10')][_0xccdc('0x12')]);return _0x364fa8(_0x2d0263[_0xccdc('0x10')][_0xccdc('0x12')]);}logger[_0xccdc('0x10')](_0xccdc('0xc'),_0x188a11,_0x2d0263[_0xccdc('0x10')][_0xccdc('0x12')]);return _0x17a77d(_0x2d0263[_0xccdc('0x10')][_0xccdc('0x12')]);}else{logger[_0xccdc('0xb')](_0xccdc('0xc'),_0x188a11,'request\x20sent');_0x17a77d(_0x2d0263[_0xccdc('0x13')]['message']);}})[_0xccdc('0x14')](function(_0x4b9c8b){logger['error'](_0xccdc('0xc'),_0x188a11,_0x4b9c8b);_0x364fa8(_0x4b9c8b);});});}exports['CreateCmHopperHistory']=function(_0x7927e3){var _0x4c768d=this;return new Promise(function(_0x496654,_0x225048){return db[_0xccdc('0x15')]['create'](_0x7927e3[_0xccdc('0x16')],{'raw':_0x7927e3[_0xccdc('0x17')]?_0x7927e3[_0xccdc('0x17')][_0xccdc('0x18')]===undefined?!![]:![]:!![]})[_0xccdc('0x19')](function(_0x1b5ae7){logger[_0xccdc('0xb')](_0xccdc('0x1a'),_0x7927e3);logger[_0xccdc('0xe')](_0xccdc('0x1a'),_0x7927e3,JSON[_0xccdc('0x1b')](_0x1b5ae7));_0x496654(_0x1b5ae7);})[_0xccdc('0x14')](function(_0x12cc53){logger[_0xccdc('0x10')](_0xccdc('0x1a'),_0x12cc53[_0xccdc('0x12')],_0x7927e3);_0x225048(_0x4c768d[_0xccdc('0x10')](0x1f4,_0x12cc53[_0xccdc('0x12')]));});});};exports['AvgHandleTime']=function(_0x3e2648){var _0xc2ccd0=this;return new Promise(function(_0x58c57,_0x1fe032){return db[_0xccdc('0x15')]['findAll']({'raw':_0x3e2648[_0xccdc('0x17')]?_0x3e2648[_0xccdc('0x17')][_0xccdc('0x18')]===undefined?!![]:![]:!![],'where':_0x3e2648['options']?_0x3e2648[_0xccdc('0x17')][_0xccdc('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')][_0xccdc('0x1f')]('id')),_0xccdc('0x20')],[db['sequelize']['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xccdc('0x21')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x24')))),_0xccdc('0x25')],[db['sequelize']['fn'](_0xccdc('0x26'),db['sequelize']['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x27')))),_0xccdc('0x28')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x26'),db['sequelize']['fn']('IF',db[_0xccdc('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xccdc('0x29')]]})[_0xccdc('0x19')](function(_0x5b3328){logger[_0xccdc('0xb')]('AvgHandleTime',_0x3e2648);logger[_0xccdc('0xe')](_0xccdc('0x2a'),_0x3e2648,JSON['stringify'](_0x5b3328));_0x58c57(_0x5b3328);})['catch'](function(_0x3547d3){logger[_0xccdc('0x10')](_0xccdc('0x2a'),_0x3547d3['message'],_0x3e2648);_0x1fe032(_0xc2ccd0[_0xccdc('0x10')](0x1f4,_0x3547d3[_0xccdc('0x12')]));});});};exports[_0xccdc('0x2b')]=function(_0x434b63){var _0x531efe=this;return new Promise(function(_0x1badd5,_0xe612a){return db[_0xccdc('0x15')][_0xccdc('0x2c')]({'raw':_0x434b63[_0xccdc('0x17')]?_0x434b63[_0xccdc('0x17')][_0xccdc('0x18')]===undefined?!![]:![]:!![],'where':_0x434b63[_0xccdc('0x17')]?_0x434b63[_0xccdc('0x17')][_0xccdc('0x1c')]||null:null,'attributes':[[_0xccdc('0x2d'),'name'],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x2e')))),_0xccdc('0x2f')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xccdc('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0xccdc('0x30')],[db[_0xccdc('0x1e')]['fn']('COUNT',db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x21')))),_0xccdc('0x31')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db['sequelize'][_0xccdc('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0xccdc('0x32')],[db[_0xccdc('0x1e')]['fn']('COUNT',db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x33')))),_0xccdc('0x34')],[db[_0xccdc('0x1e')]['fn']('COUNT',db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x35')))),_0xccdc('0x36')],[db[_0xccdc('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x37')))),_0xccdc('0x38')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xccdc('0x39')))),'outboundUnknownCallsDay'],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0xccdc('0x3a')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0xccdc('0x3b')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')]['literal'](_0xccdc('0x3c')))),_0xccdc('0x3d')],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xccdc('0x3e')))),_0xccdc('0x3f')],[db['sequelize']['fn']('COUNT',db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')]['literal'](_0xccdc('0x40')))),_0xccdc('0x3d')],[db[_0xccdc('0x1e')]['fn']('COUNT',db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x41')))),'outboundReCallsDay']],'group':[_0xccdc('0x2d')]})['then'](function(_0x201f3b){logger[_0xccdc('0xb')](_0xccdc('0x2b'),_0x434b63);logger[_0xccdc('0xe')](_0xccdc('0x2b'),_0x434b63,JSON[_0xccdc('0x1b')](_0x201f3b));_0x1badd5(_0x201f3b);})['catch'](function(_0x430b8c){logger['error'](_0xccdc('0x2b'),_0x430b8c[_0xccdc('0x12')],_0x434b63);_0xe612a(_0x531efe[_0xccdc('0x10')](0x1f4,_0x430b8c[_0xccdc('0x12')]));});});};exports[_0xccdc('0x42')]=function(_0x58e618){var _0x1dc8d2=this;return new Promise(function(_0x6bfb4e,_0x93ff88){return db[_0xccdc('0x15')][_0xccdc('0x2c')]({'raw':_0x58e618['options']?_0x58e618[_0xccdc('0x17')][_0xccdc('0x18')]===undefined?!![]:![]:!![],'where':_0x58e618[_0xccdc('0x17')]?_0x58e618['options'][_0xccdc('0x1c')]||null:null,'attributes':[[_0xccdc('0x2d'),'name'],[db[_0xccdc('0x1e')]['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['col']('id')),_0xccdc('0x43')],[db['sequelize']['fn'](_0xccdc('0x1d'),db[_0xccdc('0x1e')]['fn']('IF',db[_0xccdc('0x1e')][_0xccdc('0x22')](_0xccdc('0x21')))),_0xccdc('0x44')]],'group':[_0xccdc('0x2d')]})['then'](function(_0x330b04){logger[_0xccdc('0xb')](_0xccdc('0x42'),_0x58e618);logger[_0xccdc('0xe')]('GetCampaignHopperHistory',_0x58e618,JSON[_0xccdc('0x1b')](_0x330b04));_0x6bfb4e(_0x330b04);})['catch'](function(_0x33fe95){logger['error'](_0xccdc('0x42'),_0x33fe95['message'],_0x58e618);_0x93ff88(_0x1dc8d2['error'](0x1f4,_0x33fe95['message']));});});}; \ No newline at end of file +var _0x3526=['predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','where','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','catch','CreateCmHopperHistory','create','options','raw','debug','AvgHandleTime','CmHopperHistory','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null'];(function(_0x2fac89,_0x3f50a0){var _0x4e1d71=function(_0x4e02ae){while(--_0x4e02ae){_0x2fac89['push'](_0x2fac89['shift']());}};_0x4e1d71(++_0x3f50a0);}(_0x3526,0x1db));var _0x6352=function(_0x57e468,_0x4c0814){_0x57e468=_0x57e468-0x0;var _0x391cb4=_0x3526[_0x57e468];return _0x391cb4;};'use strict';var _=require('lodash');var util=require(_0x6352('0x0'));var moment=require(_0x6352('0x1'));var BPromise=require(_0x6352('0x2'));var rs=require(_0x6352('0x3'));var fs=require('fs');var Redis=require(_0x6352('0x4'));var db=require(_0x6352('0x5'))['db'];var utils=require(_0x6352('0x6'));var logger=require(_0x6352('0x7'))(_0x6352('0x8'));var config=require(_0x6352('0x9'));var jayson=require(_0x6352('0xa'));var client=jayson[_0x6352('0xb')][_0x6352('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2271f9,_0x1d5498,_0xdae2f9){return new BPromise(function(_0x342a21,_0x35a296){return client[_0x6352('0xd')](_0x2271f9,_0xdae2f9)[_0x6352('0xe')](function(_0x4d3073){logger[_0x6352('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1d5498,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1d5498,_0x6352('0x10'),JSON[_0x6352('0x11')](_0x4d3073));if(_0x4d3073[_0x6352('0x12')]){if(_0x4d3073[_0x6352('0x12')][_0x6352('0x13')]===0x1f4){logger[_0x6352('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x1d5498,_0x4d3073[_0x6352('0x12')][_0x6352('0x14')]);return _0x35a296(_0x4d3073[_0x6352('0x12')][_0x6352('0x14')]);}logger[_0x6352('0x12')](_0x6352('0x15'),_0x1d5498,_0x4d3073['error']['message']);return _0x342a21(_0x4d3073[_0x6352('0x12')][_0x6352('0x14')]);}else{logger[_0x6352('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1d5498,_0x6352('0x10'));_0x342a21(_0x4d3073[_0x6352('0x16')][_0x6352('0x14')]);}})[_0x6352('0x17')](function(_0x2d0de7){logger[_0x6352('0x12')](_0x6352('0x15'),_0x1d5498,_0x2d0de7);_0x35a296(_0x2d0de7);});});}exports[_0x6352('0x18')]=function(_0x2fcc57){var _0x47646d=this;return new Promise(function(_0x486d35,_0x14ebdc){return db['CmHopperHistory'][_0x6352('0x19')](_0x2fcc57['body'],{'raw':_0x2fcc57[_0x6352('0x1a')]?_0x2fcc57[_0x6352('0x1a')][_0x6352('0x1b')]===undefined?!![]:![]:!![]})[_0x6352('0xe')](function(_0xaf2621){logger[_0x6352('0xf')]('CreateCmHopperHistory',_0x2fcc57);logger[_0x6352('0x1c')](_0x6352('0x18'),_0x2fcc57,JSON[_0x6352('0x11')](_0xaf2621));_0x486d35(_0xaf2621);})[_0x6352('0x17')](function(_0x105755){logger['error']('CreateCmHopperHistory',_0x105755[_0x6352('0x14')],_0x2fcc57);_0x14ebdc(_0x47646d[_0x6352('0x12')](0x1f4,_0x105755[_0x6352('0x14')]));});});};exports[_0x6352('0x1d')]=function(_0x335cfd){var _0x187a62=this;return new Promise(function(_0x5ce583,_0x57e927){return db[_0x6352('0x1e')]['findAll']({'raw':_0x335cfd['options']?_0x335cfd['options'][_0x6352('0x1b')]===undefined?!![]:![]:!![],'where':_0x335cfd[_0x6352('0x1a')]?_0x335cfd[_0x6352('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x6352('0x1f'),db[_0x6352('0x20')][_0x6352('0x21')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x23')))),_0x6352('0x24')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x25')))),_0x6352('0x26')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db['sequelize']['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x6352('0x27')],[db[_0x6352('0x20')]['fn'](_0x6352('0x28'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x29')))),_0x6352('0x2a')],[db[_0x6352('0x20')]['fn'](_0x6352('0x28'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')]['literal'](_0x6352('0x2b')))),_0x6352('0x2c')]]})[_0x6352('0xe')](function(_0x408f43){logger['info'](_0x6352('0x1d'),_0x335cfd);logger[_0x6352('0x1c')](_0x6352('0x1d'),_0x335cfd,JSON[_0x6352('0x11')](_0x408f43));_0x5ce583(_0x408f43);})[_0x6352('0x17')](function(_0x514d7d){logger['error']('AvgHandleTime',_0x514d7d[_0x6352('0x14')],_0x335cfd);_0x57e927(_0x187a62[_0x6352('0x12')](0x1f4,_0x514d7d['message']));});});};exports[_0x6352('0x2d')]=function(_0x4ffdd0){var _0x3df1c4=this;return new Promise(function(_0x34b8ef,_0x8ff4d1){return db[_0x6352('0x1e')][_0x6352('0x2e')]({'raw':_0x4ffdd0[_0x6352('0x1a')]?_0x4ffdd0['options'][_0x6352('0x1b')]===undefined?!![]:![]:!![],'where':_0x4ffdd0['options']?_0x4ffdd0['options'][_0x6352('0x2f')]||null:null,'attributes':[['campaign',_0x6352('0x30')],[db[_0x6352('0x20')]['fn']('COUNT',db[_0x6352('0x20')]['fn']('IF',db['sequelize']['literal'](_0x6352('0x31')))),_0x6352('0x32')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')]['literal'](_0x6352('0x33')))),'outboundNoAnswerCallsDay'],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db['sequelize'][_0x6352('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x6352('0x34')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x35')))),_0x6352('0x36')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')]('`state`\x20=\x208,\x201,\x20null'))),_0x6352('0x37')],[db['sequelize']['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db['sequelize'][_0x6352('0x22')](_0x6352('0x38')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6352('0x39')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6352('0x3a')))),_0x6352('0x3b')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')]['literal'](_0x6352('0x3c')))),'outboundBlacklistCallsDay'],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db['sequelize']['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x3d')))),_0x6352('0x3e')],[db['sequelize']['fn'](_0x6352('0x1f'),db['sequelize']['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x3f')))),_0x6352('0x40')],[db['sequelize']['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x41')))),_0x6352('0x42')],[db['sequelize']['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db['sequelize'][_0x6352('0x22')](_0x6352('0x43')))),_0x6352('0x40')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x6352('0x44')]],'group':[_0x6352('0x45')]})[_0x6352('0xe')](function(_0xa0c13d){logger[_0x6352('0xf')](_0x6352('0x2d'),_0x4ffdd0);logger['debug']('GetVoiceQueueHopperHistory',_0x4ffdd0,JSON['stringify'](_0xa0c13d));_0x34b8ef(_0xa0c13d);})[_0x6352('0x17')](function(_0x15416a){logger[_0x6352('0x12')]('GetVoiceQueueHopperHistory',_0x15416a[_0x6352('0x14')],_0x4ffdd0);_0x8ff4d1(_0x3df1c4['error'](0x1f4,_0x15416a[_0x6352('0x14')]));});});};exports[_0x6352('0x46')]=function(_0x2d9572){var _0x4135b8=this;return new Promise(function(_0x3056ae,_0x31086d){return db[_0x6352('0x1e')]['findAll']({'raw':_0x2d9572[_0x6352('0x1a')]?_0x2d9572['options'][_0x6352('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d9572['options']?_0x2d9572[_0x6352('0x1a')][_0x6352('0x2f')]||null:null,'attributes':[[_0x6352('0x45'),_0x6352('0x30')],[db[_0x6352('0x20')]['fn'](_0x6352('0x1f'),db[_0x6352('0x20')][_0x6352('0x21')]('id')),_0x6352('0x47')],[db['sequelize']['fn']('COUNT',db[_0x6352('0x20')]['fn']('IF',db[_0x6352('0x20')][_0x6352('0x22')](_0x6352('0x23')))),_0x6352('0x48')]],'group':[_0x6352('0x45')]})[_0x6352('0xe')](function(_0x2b06f5){logger[_0x6352('0xf')](_0x6352('0x46'),_0x2d9572);logger[_0x6352('0x1c')]('GetCampaignHopperHistory',_0x2d9572,JSON[_0x6352('0x11')](_0x2b06f5));_0x3056ae(_0x2b06f5);})[_0x6352('0x17')](function(_0x4af12d){logger[_0x6352('0x12')](_0x6352('0x46'),_0x4af12d[_0x6352('0x14')],_0x2d9572);_0x31086d(_0x4135b8[_0x6352('0x12')](0x1f4,_0x4af12d[_0x6352('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3ae3424..382166d 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 _0xc150=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x33aa42,_0x19b09f){var _0x195523=function(_0x3b7d76){while(--_0x3b7d76){_0x33aa42['push'](_0x33aa42['shift']());}};_0x195523(++_0x19b09f);}(_0xc150,0xae));var _0x0c15=function(_0x45509f,_0x412835){_0x45509f=_0x45509f-0x0;var _0x17de53=_0xc150[_0x45509f];return _0x17de53;};'use strict';var multer=require(_0x0c15('0x0'));var util=require(_0x0c15('0x1'));var path=require(_0x0c15('0x2'));var timeout=require(_0x0c15('0x3'));var express=require('express');var router=express[_0x0c15('0x4')]();var fs_extra=require(_0x0c15('0x5'));var auth=require(_0x0c15('0x6'));var interaction=require(_0x0c15('0x7'));var config=require(_0x0c15('0x8'));var controller=require(_0x0c15('0x9'));router[_0x0c15('0xa')]('/',auth[_0x0c15('0xb')](),controller[_0x0c15('0xc')]);router[_0x0c15('0xa')](_0x0c15('0xd'),auth[_0x0c15('0xb')](),controller['describe']);router['get'](_0x0c15('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0c15('0xe'),auth[_0x0c15('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x82a4=['/describe','describe','/:id','post','create','multer','path','connect-timeout','fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x49253a,_0x2c347d){var _0x749351=function(_0x291645){while(--_0x291645){_0x49253a['push'](_0x49253a['shift']());}};_0x749351(++_0x2c347d);}(_0x82a4,0x83));var _0x482a=function(_0x38cfaf,_0x1ce22a){_0x38cfaf=_0x38cfaf-0x0;var _0x1bf5f7=_0x82a4[_0x38cfaf];return _0x1bf5f7;};'use strict';var multer=require(_0x482a('0x0'));var util=require('util');var path=require(_0x482a('0x1'));var timeout=require(_0x482a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x482a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x482a('0x4'));var config=require('../../config/environment');var controller=require(_0x482a('0x5'));router[_0x482a('0x6')]('/',auth[_0x482a('0x7')](),controller[_0x482a('0x8')]);router[_0x482a('0x6')](_0x482a('0x9'),auth[_0x482a('0x7')](),controller[_0x482a('0xa')]);router['get'](_0x482a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x482a('0xc')]('/',auth['isAuthenticated'](),controller[_0x482a('0xd')]);router['put'](_0x482a('0xb'),auth[_0x482a('0x7')](),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 c68e006..4f13f51 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 _0xec39=['exports','STRING','name','sequelize'];(function(_0x5ae8f1,_0x58098e){var _0x4ac982=function(_0x469656){while(--_0x469656){_0x5ae8f1['push'](_0x5ae8f1['shift']());}};_0x4ac982(++_0x58098e);}(_0xec39,0x19f));var _0x9ec3=function(_0x56fc46,_0x1f673d){_0x56fc46=_0x56fc46-0x0;var _0x5f40f4=_0xec39[_0x56fc46];return _0x5f40f4;};'use strict';var Sequelize=require(_0x9ec3('0x0'));module[_0x9ec3('0x1')]={'name':{'type':Sequelize[_0x9ec3('0x2')],'unique':_0x9ec3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9ec3('0x2')]},'dialPrefix':{'type':Sequelize[_0x9ec3('0x2')]}}; \ No newline at end of file +var _0x6c7b=['STRING','sequelize'];(function(_0x4c71e0,_0x1f68be){var _0x52741f=function(_0x15e2ba){while(--_0x15e2ba){_0x4c71e0['push'](_0x4c71e0['shift']());}};_0x52741f(++_0x1f68be);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x56fb38,_0x5dcac3){_0x56fb38=_0x56fb38-0x0;var _0x194e10=_0x6c7b[_0x56fb38];return _0x194e10;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb6c7('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 755537b..cda90e6 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 _0x05c3=['ids','addContacts','CmContact','tags','isArray','length','join','push','omit','dataValues','errors','message','CmCustomField','CustomFields','format','raw','getContactsCsv','cf_%d','getContacts','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','sendStatus','error','stack','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','type','merge','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','options','removeDispositions'];(function(_0x294e67,_0xdfb197){var _0xdeb282=function(_0x1c3c86){while(--_0x1c3c86){_0x294e67['push'](_0x294e67['shift']());}};_0xdeb282(++_0xdfb197);}(_0x05c3,0xbd));var _0x305c=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0x05c3[_0x58efa6];return _0x5d643c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x305c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x305c('0x1'));var moment=require(_0x305c('0x2'));var BPromise=require(_0x305c('0x3'));var Mustache=require('mustache');var util=require(_0x305c('0x4'));var path=require(_0x305c('0x5'));var sox=require(_0x305c('0x6'));var csv=require(_0x305c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x305c('0x8'));var _=require(_0x305c('0x9'));var squel=require('squel');var crypto=require(_0x305c('0xa'));var jsforce=require(_0x305c('0xb'));var deskjs=require(_0x305c('0xc'));var toCsv=require(_0x305c('0x7'));var querystring=require(_0x305c('0xd'));var Papa=require('papaparse');var Redis=require(_0x305c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x305c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x305c('0x10'))(_0x305c('0x11'));var utils=require(_0x305c('0x12'));var config=require(_0x305c('0x13'));var licenseUtil=require(_0x305c('0x14'));var db=require(_0x305c('0x15'))['db'];config[_0x305c('0x16')]=_[_0x305c('0x17')](config[_0x305c('0x16')],{'host':_0x305c('0x18'),'port':0x18eb});var socket=require(_0x305c('0x19'))(new Redis(config[_0x305c('0x16')]));require('./cmList.socket')[_0x305c('0x1a')](socket);function respondWithStatusCode(_0x17bce0,_0xc4cf66){_0xc4cf66=_0xc4cf66||0xcc;return function(_0x173ac0){if(_0x173ac0){return _0x17bce0['sendStatus'](_0xc4cf66);}return _0x17bce0[_0x305c('0x1b')](_0xc4cf66)['end']();};}function respondWithResult(_0x5df231,_0x1f082c){_0x1f082c=_0x1f082c||0xc8;return function(_0x20ad72){if(_0x20ad72){return _0x5df231[_0x305c('0x1b')](_0x1f082c)[_0x305c('0x1c')](_0x20ad72);}};}function respondWithFilteredResult(_0xde9500,_0x560023){return function(_0x112fd1){if(_0x112fd1){var _0x432485=typeof _0x560023['offset']===_0x305c('0x1d')&&typeof _0x560023['limit']===_0x305c('0x1d');var _0x24a44c=_0x112fd1[_0x305c('0x1e')];var _0x3adb93=_0x432485?0x0:_0x560023['offset'];var _0x1f0b46=_0x432485?_0x112fd1[_0x305c('0x1e')]:_0x560023[_0x305c('0x1f')]+_0x560023[_0x305c('0x20')];var _0x35410e;if(_0x1f0b46>=_0x24a44c){_0x1f0b46=_0x24a44c;_0x35410e=0xc8;}else{_0x35410e=0xce;}_0xde9500[_0x305c('0x1b')](_0x35410e);return _0xde9500[_0x305c('0x21')]('Content-Range',_0x3adb93+'-'+_0x1f0b46+'/'+_0x24a44c)[_0x305c('0x1c')](_0x112fd1);}return null;};}function patchUpdates(_0x43430a){return function(_0x5bc985){try{jsonpatch[_0x305c('0x22')](_0x5bc985,_0x43430a,!![]);}catch(_0x587ef0){return BPromise[_0x305c('0x23')](_0x587ef0);}return _0x5bc985[_0x305c('0x24')]();};}function saveUpdates(_0x2712d5,_0x2b3bf6){return function(_0x4a5bd4){if(_0x4a5bd4){return _0x4a5bd4[_0x305c('0x25')](_0x2712d5)[_0x305c('0x26')](function(_0x28808d){return _0x28808d;});}return null;};}function removeEntity(_0x281201,_0x3bec31){return function(_0x469426){if(_0x469426){return _0x469426[_0x305c('0x27')]()['then'](function(){var _0x1a8757=_0x469426[_0x305c('0x28')]({'plain':!![]});var _0x50a287=_0x305c('0x29');return db[_0x305c('0x2a')][_0x305c('0x27')]({'where':{'type':_0x50a287,'resourceId':_0x1a8757['id']}})[_0x305c('0x26')](function(){return _0x469426;});})[_0x305c('0x26')](function(){_0x281201['status'](0xcc)[_0x305c('0x2b')]();});}};}function handleEntityNotFound(_0x2c5c62,_0x2561fa){return function(_0x1c00b3){if(!_0x1c00b3){_0x2c5c62[_0x305c('0x2c')](0x194);}return _0x1c00b3;};}function handleError(_0x28e00c,_0x48caf4){_0x48caf4=_0x48caf4||0x1f4;return function(_0x220a72){logger[_0x305c('0x2d')](_0x220a72[_0x305c('0x2e')]);if(_0x220a72['name']){delete _0x220a72['name'];}_0x28e00c[_0x305c('0x1b')](_0x48caf4)[_0x305c('0x2f')](_0x220a72);};}exports[_0x305c('0x30')]=function(_0x2204b1,_0x5ae28b){var _0x4615d7={},_0x5b70b2={},_0x5da8a6={'count':0x0,'rows':[]};var _0x5bfb41=_[_0x305c('0x31')](db[_0x305c('0x32')][_0x305c('0x33')],function(_0x3fcb3b){return{'name':_0x3fcb3b[_0x305c('0x34')],'type':_0x3fcb3b['type'][_0x305c('0x35')]};});_0x5b70b2[_0x305c('0x36')]=_[_0x305c('0x31')](_0x5bfb41,'name');_0x5b70b2[_0x305c('0x37')]=_[_0x305c('0x38')](_0x2204b1[_0x305c('0x37')]);_0x5b70b2[_0x305c('0x39')]=_[_0x305c('0x3a')](_0x5b70b2[_0x305c('0x36')],_0x5b70b2[_0x305c('0x37')]);_0x4615d7[_0x305c('0x3b')]=_['intersection'](_0x5b70b2['model'],qs[_0x305c('0x3c')](_0x2204b1['query'][_0x305c('0x3c')]));_0x4615d7[_0x305c('0x3b')]=_0x4615d7[_0x305c('0x3b')]['length']?_0x4615d7['attributes']:_0x5b70b2[_0x305c('0x36')];if(!_0x2204b1['query']['hasOwnProperty'](_0x305c('0x3d'))){_0x4615d7['limit']=qs[_0x305c('0x20')](_0x2204b1[_0x305c('0x37')][_0x305c('0x20')]);_0x4615d7['offset']=qs[_0x305c('0x1f')](_0x2204b1[_0x305c('0x37')]['offset']);}_0x4615d7[_0x305c('0x3e')]=qs[_0x305c('0x3f')](_0x2204b1[_0x305c('0x37')][_0x305c('0x3f')]);_0x4615d7[_0x305c('0x40')]=qs[_0x305c('0x39')](_[_0x305c('0x41')](_0x2204b1[_0x305c('0x37')],_0x5b70b2[_0x305c('0x39')]),_0x5bfb41);if(_0x2204b1['query'][_0x305c('0x42')]){_0x4615d7[_0x305c('0x40')]=_['merge'](_0x4615d7[_0x305c('0x40')],{'$or':_[_0x305c('0x31')](_0x5bfb41,function(_0x12823f){if(_0x12823f[_0x305c('0x43')]!=='VIRTUAL'){var _0x98163a={};_0x98163a[_0x12823f['name']]={'$like':'%'+_0x2204b1[_0x305c('0x37')][_0x305c('0x42')]+'%'};return _0x98163a;}})});}_0x4615d7=_[_0x305c('0x44')]({},_0x4615d7,_0x2204b1['options']);var _0x3eb0af={'where':_0x4615d7[_0x305c('0x40')]};return db['CmList'][_0x305c('0x1e')](_0x3eb0af)['then'](function(_0x295397){_0x5da8a6[_0x305c('0x1e')]=_0x295397;if(_0x2204b1['query'][_0x305c('0x45')]){_0x4615d7[_0x305c('0x46')]=[{'all':!![]}];}return db[_0x305c('0x32')]['findAll'](_0x4615d7);})[_0x305c('0x26')](function(_0x32c260){_0x5da8a6[_0x305c('0x47')]=_0x32c260;return _0x5da8a6;})[_0x305c('0x26')](respondWithFilteredResult(_0x5ae28b,_0x4615d7))[_0x305c('0x48')](handleError(_0x5ae28b,null));};exports[_0x305c('0x49')]=function(_0x248c79,_0x14566d){var _0x2c1f1e={'raw':![],'where':{'id':_0x248c79[_0x305c('0x4a')]['id']}},_0x39521f={};_0x39521f[_0x305c('0x36')]=_['keys'](db['CmList'][_0x305c('0x33')]);_0x39521f[_0x305c('0x37')]=_['keys'](_0x248c79[_0x305c('0x37')]);_0x39521f[_0x305c('0x39')]=_['intersection'](_0x39521f[_0x305c('0x36')],_0x39521f[_0x305c('0x37')]);_0x2c1f1e[_0x305c('0x3b')]=_[_0x305c('0x3a')](_0x39521f[_0x305c('0x36')],qs[_0x305c('0x3c')](_0x248c79[_0x305c('0x37')][_0x305c('0x3c')]));_0x2c1f1e[_0x305c('0x3b')]=_0x2c1f1e[_0x305c('0x3b')]['length']?_0x2c1f1e['attributes']:_0x39521f[_0x305c('0x36')];if(_0x248c79['query']['includeAll']){_0x2c1f1e[_0x305c('0x46')]=[{'all':!![]}];}_0x2c1f1e=_[_0x305c('0x44')]({},_0x2c1f1e,_0x248c79['options']);return db[_0x305c('0x32')][_0x305c('0x4b')](_0x2c1f1e)[_0x305c('0x26')](handleEntityNotFound(_0x14566d,null))[_0x305c('0x26')](respondWithResult(_0x14566d,null))[_0x305c('0x48')](handleError(_0x14566d,null));};exports['create']=function(_0x2a3eb7,_0x582117){return db[_0x305c('0x32')][_0x305c('0x4c')](_0x2a3eb7['body'],{})[_0x305c('0x26')](function(_0x32e7f6){var _0x113937=_0x2a3eb7['user'][_0x305c('0x28')]({'plain':!![]});if(!_0x113937)throw new Error(_0x305c('0x4d'));if(_0x113937[_0x305c('0x4e')]==='user'){var _0x4822db=_0x32e7f6['get']({'plain':!![]});var _0x53d990=_0x305c('0x29');return db['UserProfileSection'][_0x305c('0x4b')]({'where':{'name':_0x53d990,'userProfileId':_0x113937[_0x305c('0x4f')]},'raw':!![]})[_0x305c('0x26')](function(_0x28df22){if(_0x28df22&&_0x28df22[_0x305c('0x50')]===0x0){return db[_0x305c('0x2a')][_0x305c('0x4c')]({'name':_0x4822db[_0x305c('0x51')],'resourceId':_0x4822db['id'],'type':_0x28df22[_0x305c('0x51')],'sectionId':_0x28df22['id']},{})['then'](function(){return _0x32e7f6;});}else{return _0x32e7f6;}})[_0x305c('0x48')](function(_0x54b900){logger[_0x305c('0x2d')](_0x305c('0x52'),_0x54b900);throw _0x54b900;});}return _0x32e7f6;})[_0x305c('0x26')](respondWithResult(_0x582117,0xc9))[_0x305c('0x48')](handleError(_0x582117,null));};exports[_0x305c('0x25')]=function(_0x14a260,_0x23e8b8){if(_0x14a260[_0x305c('0x53')]['id']){delete _0x14a260[_0x305c('0x53')]['id'];}return db[_0x305c('0x32')][_0x305c('0x4b')]({'where':{'id':_0x14a260[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x23e8b8,null))[_0x305c('0x26')](saveUpdates(_0x14a260['body'],null))[_0x305c('0x26')](respondWithResult(_0x23e8b8,null))[_0x305c('0x48')](handleError(_0x23e8b8,null));};exports['destroy']=function(_0x3ef18c,_0x4f82f6){return db[_0x305c('0x32')][_0x305c('0x4b')]({'where':{'id':_0x3ef18c['params']['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x4f82f6,null))[_0x305c('0x26')](removeEntity(_0x4f82f6,null))[_0x305c('0x48')](handleError(_0x4f82f6,null));};exports[_0x305c('0x54')]=function(_0x7b536b,_0x2209af){return db[_0x305c('0x32')][_0x305c('0x54')]()[_0x305c('0x26')](respondWithResult(_0x2209af,null))['catch'](handleError(_0x2209af,null));};exports[_0x305c('0x55')]=function(_0xd0bb48,_0xae0a85,_0x4c9b43){if(_0xd0bb48[_0x305c('0x53')]['id']){delete _0xd0bb48[_0x305c('0x53')]['id'];}return db['CmList'][_0x305c('0x4b')]({'where':{'id':_0xd0bb48[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0xae0a85,null))[_0x305c('0x26')](function(_0x9a88d0){if(_0x9a88d0){_0xd0bb48[_0x305c('0x53')][_0x305c('0x56')]=_0x9a88d0['id'];return db[_0x305c('0x57')][_0x305c('0x4c')](_0xd0bb48[_0x305c('0x53')]);}})[_0x305c('0x26')](respondWithResult(_0xae0a85,null))[_0x305c('0x48')](handleError(_0xae0a85,null));};exports[_0x305c('0x58')]=function(_0x201b12,_0x4d126e,_0x332d50){var _0x1bf802={'raw':![],'where':{}};var _0x2158a0={};var _0x493250={'count':0x0,'rows':[]};return db[_0x305c('0x32')][_0x305c('0x59')]({'where':{'id':_0x201b12[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x4d126e,null))['then'](function(_0x4fd5d9){if(_0x4fd5d9){_0x2158a0['model']=_['keys'](db['Disposition']['rawAttributes']);_0x2158a0[_0x305c('0x37')]=_[_0x305c('0x38')](_0x201b12['query']);_0x2158a0[_0x305c('0x39')]=_['intersection'](_0x2158a0[_0x305c('0x36')],_0x2158a0[_0x305c('0x37')]);_0x1bf802['attributes']=_[_0x305c('0x3a')](_0x2158a0['model'],qs[_0x305c('0x3c')](_0x201b12[_0x305c('0x37')][_0x305c('0x3c')]));_0x1bf802[_0x305c('0x3b')]=_0x1bf802[_0x305c('0x3b')]['length']?_0x1bf802[_0x305c('0x3b')]:_0x2158a0[_0x305c('0x36')];if(!_0x201b12[_0x305c('0x37')][_0x305c('0x5a')]('nolimit')){_0x1bf802['limit']=qs[_0x305c('0x20')](_0x201b12[_0x305c('0x37')][_0x305c('0x20')]);_0x1bf802[_0x305c('0x1f')]=qs[_0x305c('0x1f')](_0x201b12[_0x305c('0x37')][_0x305c('0x1f')]);}_0x1bf802[_0x305c('0x3e')]=qs[_0x305c('0x3f')](_0x201b12[_0x305c('0x37')][_0x305c('0x3f')]);_0x1bf802['where']=qs[_0x305c('0x39')](_[_0x305c('0x41')](_0x201b12['query'],_0x2158a0[_0x305c('0x39')]));_0x1bf802[_0x305c('0x40')][_0x305c('0x56')]=_0x4fd5d9['id'];if(_0x201b12[_0x305c('0x37')][_0x305c('0x42')]){_0x1bf802[_0x305c('0x40')]=_[_0x305c('0x44')](_0x1bf802[_0x305c('0x40')],{'$or':_[_0x305c('0x31')](_0x1bf802['attributes'],function(_0x3b50e2){var _0x38b0c9={};_0x38b0c9[_0x3b50e2]={'$like':'%'+_0x201b12['query'][_0x305c('0x42')]+'%'};return _0x38b0c9;})});}_0x1bf802=_['merge']({},_0x1bf802,_0x201b12[_0x305c('0x5b')]);return db['Disposition'][_0x305c('0x1e')]({'where':_0x1bf802[_0x305c('0x40')]})[_0x305c('0x26')](function(_0x1aae0e){_0x493250['count']=_0x1aae0e;if(_0x201b12['query'][_0x305c('0x45')]){_0x1bf802['include']=[{'all':!![]}];}return db[_0x305c('0x57')]['findAll'](_0x1bf802);})[_0x305c('0x26')](function(_0x1cabe1){_0x493250[_0x305c('0x47')]=_0x1cabe1;return _0x493250;});}})['then'](respondWithFilteredResult(_0x4d126e,_0x1bf802))['catch'](handleError(_0x4d126e,null));};exports[_0x305c('0x5c')]=function(_0x390a04,_0x1f5af9,_0x15bf3c){return db['CmList'][_0x305c('0x4b')]({'where':{'id':_0x390a04[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x1f5af9,null))[_0x305c('0x26')](function(_0x5cbfda){if(_0x5cbfda){return _0x5cbfda[_0x305c('0x5c')](_0x390a04[_0x305c('0x37')][_0x305c('0x5d')]);}})[_0x305c('0x26')](respondWithStatusCode(_0x1f5af9,null))[_0x305c('0x48')](handleError(_0x1f5af9,null));};exports[_0x305c('0x5e')]=function(_0x6726c5,_0x593f4f,_0x53fef7){return db[_0x305c('0x32')]['find']({'where':{'id':_0x6726c5[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x593f4f,null))[_0x305c('0x26')](function(_0x4c816b){if(_0x4c816b){var _0x1144f2=[];var _0x1fd96a={'success':[],'errors':[]};return db[_0x305c('0x5f')][_0x305c('0x54')]()['then'](function(_0x38f4e9){if(_0x6726c5[_0x305c('0x53')][_0x305c('0x60')]&&_[_0x305c('0x61')](_0x6726c5['body'][_0x305c('0x60')])){if(_0x6726c5[_0x305c('0x53')]['tags'][_0x305c('0x62')]){_0x6726c5['body']['tags']=_0x6726c5['body'][_0x305c('0x60')][_0x305c('0x63')](';')+';';}else{_0x6726c5[_0x305c('0x53')][_0x305c('0x60')]=null;}}else{_0x6726c5['body']['tags']=null;}if(_0x6726c5[_0x305c('0x53')]&&_[_0x305c('0x61')](_0x6726c5[_0x305c('0x53')])){for(var _0x1c2912=0x0;_0x1c2912<_0x6726c5[_0x305c('0x53')][_0x305c('0x62')];_0x1c2912+=0x1){_0x6726c5[_0x305c('0x53')][_0x1c2912][_0x305c('0x56')]=_0x6726c5[_0x305c('0x4a')]['id'];_0x1144f2[_0x305c('0x64')](_0x6726c5[_0x305c('0x53')][_0x1c2912]);}return BPromise['each'](_0x1144f2,function(_0x1737f6){return db[_0x305c('0x5f')][_0x305c('0x4c')](_[_0x305c('0x65')](_0x1737f6,['ids','id'])||{},{'fields':_[_0x305c('0x38')](_0x38f4e9),'raw':!![]})[_0x305c('0x26')](function(_0x26a186){_0x1fd96a['success'][_0x305c('0x64')](_0x26a186[_0x305c('0x66')]);})[_0x305c('0x48')](function(_0x3c48af){_0x1fd96a[_0x305c('0x67')][_0x305c('0x64')]({'data':_0x1737f6,'error':_0x3c48af[_0x305c('0x68')]});});})[_0x305c('0x26')](function(_0x1bb3da){return _0x1fd96a;})[_0x305c('0x48')](function(_0x3db33d){return _0x3db33d;});}else{_0x593f4f[_0x305c('0x1b')](0x190)[_0x305c('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x305c('0x26')](respondWithResult(_0x593f4f,null))[_0x305c('0x48')](handleError(_0x593f4f,null));};exports['getContacts']=function(_0x374c10,_0x4c4f0f,_0x371b40){var _0x400ff9;return db[_0x305c('0x32')]['find']({'where':{'id':_0x374c10[_0x305c('0x4a')]['id']},'include':[{'model':db[_0x305c('0x69')],'as':'CustomFields'}]})[_0x305c('0x26')](handleEntityNotFound(_0x4c4f0f,null))[_0x305c('0x26')](function(_0x1e1915){if(_0x1e1915){_0x400ff9=_0x1e1915;return db[_0x305c('0x5f')][_0x305c('0x33')];}})[_0x305c('0x26')](function(_0x499eb5){if(_0x499eb5){var _0x5e4a76={};var _0x156663={};_0x156663[_0x305c('0x36')]=_['concat'](_[_0x305c('0x38')](_0x499eb5),_['map'](_0x400ff9[_0x305c('0x6a')],function(_0x378eba){return util[_0x305c('0x6b')]('cf_%d',_0x378eba['id']);}));_0x156663[_0x305c('0x37')]=_['keys'](_0x374c10[_0x305c('0x37')]);_0x156663['filters']=_['intersection'](_0x156663['model'],_0x156663[_0x305c('0x37')]);_0x5e4a76[_0x305c('0x3b')]=_[_0x305c('0x3a')](_0x156663[_0x305c('0x36')],qs[_0x305c('0x3c')](_0x374c10[_0x305c('0x37')][_0x305c('0x3c')]));_0x5e4a76['attributes']=_0x5e4a76[_0x305c('0x3b')][_0x305c('0x62')]?_0x5e4a76['attributes']:_0x156663[_0x305c('0x36')];if(!_0x374c10[_0x305c('0x37')]['hasOwnProperty'](_0x305c('0x3d'))){_0x5e4a76[_0x305c('0x20')]=qs[_0x305c('0x20')](_0x374c10[_0x305c('0x37')]['limit']);_0x5e4a76['offset']=qs[_0x305c('0x1f')](_0x374c10[_0x305c('0x37')][_0x305c('0x1f')]);}_0x5e4a76[_0x305c('0x3e')]=qs[_0x305c('0x3f')](_0x374c10[_0x305c('0x37')][_0x305c('0x3f')]);_0x5e4a76[_0x305c('0x40')]=qs['filters'](_[_0x305c('0x41')](_0x374c10['query'],_0x156663[_0x305c('0x39')]));_0x5e4a76[_0x305c('0x6c')]=!![];if(_0x374c10[_0x305c('0x37')][_0x305c('0x42')]){_0x5e4a76[_0x305c('0x40')]=_[_0x305c('0x44')](_0x5e4a76['where'],{'$or':_[_0x305c('0x31')](_0x5e4a76['attributes'],function(_0x31e292){var _0x292649={};_0x292649[_0x31e292]={'$like':'%'+_0x374c10[_0x305c('0x37')][_0x305c('0x42')]+'%'};return _0x292649;})});}_0x5e4a76=_[_0x305c('0x44')]({},_0x5e4a76,_0x374c10['options']);return _0x400ff9['getContacts'](_0x5e4a76);}})[_0x305c('0x26')](respondWithResult(_0x4c4f0f,null))['catch'](handleError(_0x4c4f0f,null));};exports[_0x305c('0x6d')]=function(_0x166c3d,_0x22fe55,_0x41feee){var _0x171ef1;return db[_0x305c('0x32')][_0x305c('0x4b')]({'where':{'id':_0x166c3d[_0x305c('0x4a')]['id']},'include':[{'model':db[_0x305c('0x69')],'as':_0x305c('0x6a')}]})['then'](handleEntityNotFound(_0x22fe55,null))[_0x305c('0x26')](function(_0x339960){if(_0x339960){_0x171ef1=_0x339960;return db[_0x305c('0x5f')][_0x305c('0x33')];}})[_0x305c('0x26')](function(_0x194aac){if(_0x194aac){var _0x3318c9={};var _0x216063={};_0x216063[_0x305c('0x36')]=_['concat'](_[_0x305c('0x38')](_0x194aac),_[_0x305c('0x31')](_0x171ef1['CustomFields'],function(_0x29da48){return util[_0x305c('0x6b')](_0x305c('0x6e'),_0x29da48['id']);}));_0x216063[_0x305c('0x37')]=_[_0x305c('0x38')](_0x166c3d[_0x305c('0x37')]);_0x216063['filters']=_[_0x305c('0x3a')](_0x216063[_0x305c('0x36')],_0x216063[_0x305c('0x37')]);_0x3318c9['attributes']=_[_0x305c('0x3a')](_0x216063[_0x305c('0x36')],qs[_0x305c('0x3c')](_0x166c3d['query'][_0x305c('0x3c')]));_0x3318c9['attributes']=_0x3318c9[_0x305c('0x3b')][_0x305c('0x62')]?_0x3318c9[_0x305c('0x3b')]:_0x216063[_0x305c('0x36')];if(!_0x166c3d[_0x305c('0x37')][_0x305c('0x5a')]('nolimit')){_0x3318c9['limit']=qs[_0x305c('0x20')](_0x166c3d[_0x305c('0x37')][_0x305c('0x20')]);_0x3318c9[_0x305c('0x1f')]=qs[_0x305c('0x1f')](_0x166c3d[_0x305c('0x37')][_0x305c('0x1f')]);}_0x3318c9['order']=qs['sort'](_0x166c3d[_0x305c('0x37')][_0x305c('0x3f')]);_0x3318c9['where']=qs[_0x305c('0x39')](_[_0x305c('0x41')](_0x166c3d[_0x305c('0x37')],_0x216063[_0x305c('0x39')]));_0x3318c9[_0x305c('0x6c')]=!![];if(_0x166c3d[_0x305c('0x37')]['filter']){_0x3318c9[_0x305c('0x40')]=_[_0x305c('0x44')](_0x3318c9[_0x305c('0x40')],{'$or':_['map'](_0x3318c9[_0x305c('0x3b')],function(_0x166fc4){var _0x2c7804={};_0x2c7804[_0x166fc4]={'$like':'%'+_0x166c3d['query'][_0x305c('0x42')]+'%'};return _0x2c7804;})});}_0x3318c9=_[_0x305c('0x44')]({},_0x3318c9,_0x166c3d[_0x305c('0x5b')]);return _0x171ef1[_0x305c('0x6f')](_0x3318c9);}})['then'](function(_0x28853b){if(!_['isEmpty'](_0x28853b)){var _0x6deee5=toCsv(_0x28853b);var _0x20da46=Date[_0x305c('0x70')]();fs[_0x305c('0x71')](util[_0x305c('0x6b')](_0x305c('0x72'),_0x171ef1['id'],_0x20da46),_0x6deee5);_0x22fe55['setHeader'](_0x305c('0x73'),'attachment;\x20filename='+util[_0x305c('0x6b')](_0x305c('0x74'),_0x171ef1['id'],_0x20da46));_0x22fe55[_0x305c('0x75')](_0x305c('0x76'),_0x305c('0x77'));return _0x22fe55[_0x305c('0x78')](util[_0x305c('0x6b')](_0x305c('0x72'),_0x171ef1['id'],_0x20da46));}else{return _0x22fe55[_0x305c('0x2c')](0xcc);}})['catch'](handleError(_0x22fe55,null));};exports['addCustomField']=function(_0x37e05a,_0x1f2902,_0x172b37){var _0x30ab6b;delete _0x37e05a[_0x305c('0x53')]['id'];return db[_0x305c('0x32')][_0x305c('0x59')]({'where':{'id':_0x37e05a[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x1f2902,null))[_0x305c('0x26')](function(_0x589e82){if(_0x589e82){return db[_0x305c('0x79')][_0x305c('0x7a')](function(_0x320afd){return db['CmCustomField'][_0x305c('0x4c')](_0x37e05a[_0x305c('0x53')],{'transaction':_0x320afd})['then'](function(_0x4a1cd2){_0x30ab6b=_0x4a1cd2;return _0x589e82['addCustomFields'](_0x4a1cd2,{'transaction':_0x320afd});})[_0x305c('0x26')](function(){var _0x1a5095={'type':db[_0x305c('0x7b')]['TEXT'],'transaction':_0x320afd};switch(_0x37e05a[_0x305c('0x53')][_0x305c('0x43')]){case _0x305c('0x7c'):_0x1a5095[_0x305c('0x43')]=db[_0x305c('0x7b')][_0x305c('0x7d')];break;case _0x305c('0x7e'):_0x1a5095[_0x305c('0x43')]=db['Sequelize'][_0x305c('0x7f')];break;case'switch':_0x1a5095[_0x305c('0x43')]=db['Sequelize'][_0x305c('0x80')];_0x1a5095['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x305c('0x81')](_0x305c('0x82'),util[_0x305c('0x6b')](_0x305c('0x83'),_0x30ab6b['id']),_0x1a5095);})['then'](function(){return _0x30ab6b;});});}})[_0x305c('0x26')](respondWithResult(_0x1f2902,null))['catch'](handleError(_0x1f2902,null));};exports[_0x305c('0x84')]=function(_0x46abe5,_0x2c7e71,_0x3b3589){var _0x3fbb89={};var _0x13ca63={};var _0x238a25;var _0x4f5485;return db[_0x305c('0x32')][_0x305c('0x59')]({'where':{'id':_0x46abe5[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x2c7e71,null))[_0x305c('0x26')](function(_0x59340e){if(_0x59340e){_0x238a25=_0x59340e;_0x13ca63['model']=_[_0x305c('0x38')](db[_0x305c('0x69')]['rawAttributes']);_0x13ca63[_0x305c('0x37')]=_[_0x305c('0x38')](_0x46abe5[_0x305c('0x37')]);_0x13ca63['filters']=_[_0x305c('0x3a')](_0x13ca63[_0x305c('0x36')],_0x13ca63[_0x305c('0x37')]);_0x3fbb89[_0x305c('0x3b')]=_['intersection'](_0x13ca63[_0x305c('0x36')],qs[_0x305c('0x3c')](_0x46abe5[_0x305c('0x37')][_0x305c('0x3c')]));_0x3fbb89['attributes']=_0x3fbb89[_0x305c('0x3b')][_0x305c('0x62')]?_0x3fbb89[_0x305c('0x3b')]:_0x13ca63[_0x305c('0x36')];_0x3fbb89[_0x305c('0x3e')]=qs[_0x305c('0x3f')](_0x46abe5[_0x305c('0x37')][_0x305c('0x3f')]);_0x3fbb89[_0x305c('0x40')]=qs[_0x305c('0x39')](_[_0x305c('0x41')](_0x46abe5[_0x305c('0x37')],_0x13ca63[_0x305c('0x39')]));_0x3fbb89['where']=_[_0x305c('0x44')](_0x3fbb89[_0x305c('0x40')],{'$or':[{'ListId':_0x59340e['id']},{'ListId':null}]});if(_0x46abe5[_0x305c('0x37')][_0x305c('0x42')]){_0x3fbb89[_0x305c('0x40')]=_[_0x305c('0x44')](_0x3fbb89[_0x305c('0x40')],{'$or':_[_0x305c('0x31')](_0x3fbb89[_0x305c('0x3b')],function(_0x3db671){var _0x507618={};_0x507618[_0x3db671]={'$like':'%'+_0x46abe5[_0x305c('0x37')][_0x305c('0x42')]+'%'};return _0x507618;})});}_0x3fbb89=_[_0x305c('0x44')]({},_0x3fbb89,_0x46abe5[_0x305c('0x5b')]);return db[_0x305c('0x69')][_0x305c('0x85')](_0x3fbb89);}})[_0x305c('0x26')](respondWithResult(_0x2c7e71,null))[_0x305c('0x48')](handleError(_0x2c7e71,null));};exports['addAgents']=function(_0x3ff864,_0x27b9bb,_0x2bc16a){return db[_0x305c('0x32')]['find']({'where':{'id':_0x3ff864[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x27b9bb,null))['then'](function(_0x475a52){if(_0x475a52){return _0x475a52[_0x305c('0x86')](_0x3ff864[_0x305c('0x53')][_0x305c('0x5d')],_['omit'](_0x3ff864[_0x305c('0x53')],['ids','id'])||{})['spread'](function(_0x3ad04c){for(var _0x1bc91d=0x0;_0x1bc91d<_0x3ff864[_0x305c('0x53')]['ids'][_0x305c('0x62')];_0x1bc91d+=0x1){socket['emit'](_0x305c('0x87'),{'UserId':Number(_0x3ff864['body']['ids'][_0x1bc91d]),'CmListId':Number(_0x3ff864[_0x305c('0x4a')]['id'])});}return _0x3ad04c;});}})[_0x305c('0x26')](respondWithResult(_0x27b9bb,null))[_0x305c('0x48')](handleError(_0x27b9bb,null));};exports[_0x305c('0x88')]=function(_0x23b9dd,_0x1b0138,_0xe5082e){return db[_0x305c('0x32')]['find']({'where':{'id':_0x23b9dd[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x1b0138,null))[_0x305c('0x26')](function(_0x34ccbb){if(_0x34ccbb){return _0x34ccbb[_0x305c('0x88')](_0x23b9dd[_0x305c('0x37')]['ids'])[_0x305c('0x26')](function(){if(_[_0x305c('0x61')](_0x23b9dd[_0x305c('0x37')][_0x305c('0x5d')])){for(var _0x38407a=0x0;_0x38407a<_0x23b9dd[_0x305c('0x37')][_0x305c('0x5d')][_0x305c('0x62')];_0x38407a+=0x1){socket[_0x305c('0x89')](_0x305c('0x8a'),{'UserId':Number(_0x23b9dd[_0x305c('0x37')][_0x305c('0x5d')][_0x38407a]),'CmListId':Number(_0x23b9dd[_0x305c('0x4a')]['id'])});}}else{socket[_0x305c('0x89')](_0x305c('0x8a'),{'UserId':Number(_0x23b9dd[_0x305c('0x37')][_0x305c('0x5d')]),'CmListId':Number(_0x23b9dd[_0x305c('0x4a')]['id'])});}});}})[_0x305c('0x26')](respondWithStatusCode(_0x1b0138,null))['catch'](handleError(_0x1b0138,null));};exports['getAgents']=function(_0x2bdfdc,_0x4d20a0,_0x2a6215){var _0x39f5c6={};var _0x660e3e={};var _0x51e03d;var _0x324b09;return db[_0x305c('0x32')]['findOne']({'where':{'id':_0x2bdfdc[_0x305c('0x4a')]['id']}})[_0x305c('0x26')](handleEntityNotFound(_0x4d20a0,null))[_0x305c('0x26')](function(_0x557a3b){if(_0x557a3b){_0x51e03d=_0x557a3b;_0x660e3e[_0x305c('0x36')]=_[_0x305c('0x38')](db[_0x305c('0x8b')][_0x305c('0x33')]);_0x660e3e[_0x305c('0x37')]=_[_0x305c('0x38')](_0x2bdfdc[_0x305c('0x37')]);_0x660e3e[_0x305c('0x39')]=_[_0x305c('0x3a')](_0x660e3e[_0x305c('0x36')],_0x660e3e[_0x305c('0x37')]);_0x39f5c6[_0x305c('0x3b')]=_[_0x305c('0x3a')](_0x660e3e['model'],qs[_0x305c('0x3c')](_0x2bdfdc[_0x305c('0x37')][_0x305c('0x3c')]));_0x39f5c6['attributes']=_0x39f5c6[_0x305c('0x3b')][_0x305c('0x62')]?_0x39f5c6[_0x305c('0x3b')]:_0x660e3e['model'];_0x39f5c6[_0x305c('0x3e')]=qs[_0x305c('0x3f')](_0x2bdfdc['query'][_0x305c('0x3f')]);_0x39f5c6['where']=qs['filters'](_['pick'](_0x2bdfdc['query'],_0x660e3e['filters']));if(_0x2bdfdc['query'][_0x305c('0x42')]){_0x39f5c6[_0x305c('0x40')]=_['merge'](_0x39f5c6[_0x305c('0x40')],{'$or':_[_0x305c('0x31')](_0x39f5c6['attributes'],function(_0x12d15e){var _0x410470={};_0x410470[_0x12d15e]={'$like':'%'+_0x2bdfdc[_0x305c('0x37')][_0x305c('0x42')]+'%'};return _0x410470;})});}_0x39f5c6=_[_0x305c('0x44')]({},_0x39f5c6,_0x2bdfdc[_0x305c('0x5b')]);return _0x51e03d[_0x305c('0x8c')](_0x39f5c6);}})[_0x305c('0x26')](function(_0x5ca07d){if(_0x5ca07d){_0x324b09=_0x5ca07d[_0x305c('0x62')];if(!_0x2bdfdc['query'][_0x305c('0x5a')](_0x305c('0x3d'))){_0x39f5c6[_0x305c('0x20')]=qs[_0x305c('0x20')](_0x2bdfdc[_0x305c('0x37')][_0x305c('0x20')]);_0x39f5c6[_0x305c('0x1f')]=qs[_0x305c('0x1f')](_0x2bdfdc[_0x305c('0x37')][_0x305c('0x1f')]);}return _0x51e03d[_0x305c('0x8c')](_0x39f5c6);}})[_0x305c('0x26')](function(_0x5c5da9){if(_0x5c5da9){return _0x5c5da9?{'count':_0x324b09,'rows':_0x5c5da9}:null;}})[_0x305c('0x26')](respondWithResult(_0x4d20a0,null))[_0x305c('0x48')](handleError(_0x4d20a0,null));}; \ No newline at end of file +var _0xf4de=['success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','TEXT','text','type','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','get','Lists','then','error','stack','name','index','map','CmList','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','update','describe','addDisposition','ListId','Disposition','findOne','pick','removeDispositions','addContacts','CmContact','isArray','tags','join','push','ids'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf4de,0xca));var _0xef4d=function(_0x36fe26,_0x474b1a){_0x36fe26=_0x36fe26-0x0;var _0x37984c=_0xf4de[_0x36fe26];return _0x37984c;};'use strict';var emlformat=require(_0xef4d('0x0'));var rimraf=require(_0xef4d('0x1'));var zipdir=require(_0xef4d('0x2'));var jsonpatch=require(_0xef4d('0x3'));var rp=require(_0xef4d('0x4'));var moment=require(_0xef4d('0x5'));var BPromise=require(_0xef4d('0x6'));var Mustache=require(_0xef4d('0x7'));var util=require(_0xef4d('0x8'));var path=require(_0xef4d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef4d('0xa'));var fs=require('fs');var fs_extra=require(_0xef4d('0xb'));var _=require(_0xef4d('0xc'));var squel=require(_0xef4d('0xd'));var crypto=require(_0xef4d('0xe'));var jsforce=require(_0xef4d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xef4d('0x10'));var querystring=require(_0xef4d('0x11'));var Papa=require('papaparse');var Redis=require(_0xef4d('0x12'));var authService=require(_0xef4d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef4d('0x14'));var logger=require(_0xef4d('0x15'))(_0xef4d('0x16'));var utils=require(_0xef4d('0x17'));var config=require(_0xef4d('0x18'));var licenseUtil=require(_0xef4d('0x19'));var db=require(_0xef4d('0x1a'))['db'];config[_0xef4d('0x1b')]=_['defaults'](config['redis'],{'host':_0xef4d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xef4d('0x1d'))[_0xef4d('0x1e')](socket);function respondWithStatusCode(_0x240fad,_0x187eb6){_0x187eb6=_0x187eb6||0xcc;return function(_0x3a8889){if(_0x3a8889){return _0x240fad[_0xef4d('0x1f')](_0x187eb6);}return _0x240fad[_0xef4d('0x20')](_0x187eb6)[_0xef4d('0x21')]();};}function respondWithResult(_0x760709,_0x58c53e){_0x58c53e=_0x58c53e||0xc8;return function(_0x68863b){if(_0x68863b){return _0x760709[_0xef4d('0x20')](_0x58c53e)[_0xef4d('0x22')](_0x68863b);}};}function respondWithFilteredResult(_0x3a0963,_0x29647f){return function(_0x45f001){if(_0x45f001){var _0x1b127e=typeof _0x29647f['offset']===_0xef4d('0x23')&&typeof _0x29647f[_0xef4d('0x24')]===_0xef4d('0x23');var _0x331d2c=_0x45f001[_0xef4d('0x25')];var _0x870570=_0x1b127e?0x0:_0x29647f[_0xef4d('0x26')];var _0xdb2267=_0x1b127e?_0x45f001[_0xef4d('0x25')]:_0x29647f['offset']+_0x29647f[_0xef4d('0x24')];var _0x2dfcc2;if(_0xdb2267>=_0x331d2c){_0xdb2267=_0x331d2c;_0x2dfcc2=0xc8;}else{_0x2dfcc2=0xce;}_0x3a0963['status'](_0x2dfcc2);return _0x3a0963[_0xef4d('0x27')](_0xef4d('0x28'),_0x870570+'-'+_0xdb2267+'/'+_0x331d2c)[_0xef4d('0x22')](_0x45f001);}return null;};}function patchUpdates(_0x2b1964){return function(_0x19f81f){try{jsonpatch[_0xef4d('0x29')](_0x19f81f,_0x2b1964,!![]);}catch(_0x1f6cfe){return BPromise[_0xef4d('0x2a')](_0x1f6cfe);}return _0x19f81f['save']();};}function saveUpdates(_0x4298ed,_0x1d964f){return function(_0x1a2cae){if(_0x1a2cae){return _0x1a2cae['update'](_0x4298ed)['then'](function(_0x2d7bd6){return _0x2d7bd6;});}return null;};}function removeEntity(_0x1314d7,_0xf2676d){return function(_0x13ce6c){if(_0x13ce6c){return _0x13ce6c[_0xef4d('0x2b')]()['then'](function(){var _0x36d0fa=_0x13ce6c[_0xef4d('0x2c')]({'plain':!![]});var _0x50cafe=_0xef4d('0x2d');return db['UserProfileResource'][_0xef4d('0x2b')]({'where':{'type':_0x50cafe,'resourceId':_0x36d0fa['id']}})['then'](function(){return _0x13ce6c;});})[_0xef4d('0x2e')](function(){_0x1314d7['status'](0xcc)[_0xef4d('0x21')]();});}};}function handleEntityNotFound(_0x461db0,_0x379133){return function(_0x1e0d3c){if(!_0x1e0d3c){_0x461db0[_0xef4d('0x1f')](0x194);}return _0x1e0d3c;};}function handleError(_0x3a78f9,_0x54167b){_0x54167b=_0x54167b||0x1f4;return function(_0x3d8ce1){logger[_0xef4d('0x2f')](_0x3d8ce1[_0xef4d('0x30')]);if(_0x3d8ce1[_0xef4d('0x31')]){delete _0x3d8ce1[_0xef4d('0x31')];}_0x3a78f9['status'](_0x54167b)['send'](_0x3d8ce1);};}exports[_0xef4d('0x32')]=function(_0x5e3b5a,_0x51fc1f){var _0x4c6117={},_0x841815={},_0xfb79a2={'count':0x0,'rows':[]};var _0x475e34=_[_0xef4d('0x33')](db[_0xef4d('0x34')]['rawAttributes'],function(_0x15b22b){return{'name':_0x15b22b[_0xef4d('0x35')],'type':_0x15b22b['type'][_0xef4d('0x36')]};});_0x841815['model']=_[_0xef4d('0x33')](_0x475e34,'name');_0x841815['query']=_[_0xef4d('0x37')](_0x5e3b5a[_0xef4d('0x38')]);_0x841815[_0xef4d('0x39')]=_[_0xef4d('0x3a')](_0x841815['model'],_0x841815[_0xef4d('0x38')]);_0x4c6117[_0xef4d('0x3b')]=_[_0xef4d('0x3a')](_0x841815[_0xef4d('0x3c')],qs[_0xef4d('0x3d')](_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x3d')]));_0x4c6117[_0xef4d('0x3b')]=_0x4c6117['attributes'][_0xef4d('0x3e')]?_0x4c6117[_0xef4d('0x3b')]:_0x841815[_0xef4d('0x3c')];if(!_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x3f')](_0xef4d('0x40'))){_0x4c6117[_0xef4d('0x24')]=qs['limit'](_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x24')]);_0x4c6117[_0xef4d('0x26')]=qs[_0xef4d('0x26')](_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x26')]);}_0x4c6117[_0xef4d('0x41')]=qs[_0xef4d('0x42')](_0x5e3b5a['query'][_0xef4d('0x42')]);_0x4c6117[_0xef4d('0x43')]=qs[_0xef4d('0x39')](_['pick'](_0x5e3b5a[_0xef4d('0x38')],_0x841815['filters']),_0x475e34);if(_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x44')]){_0x4c6117[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0x4c6117[_0xef4d('0x43')],{'$or':_[_0xef4d('0x33')](_0x475e34,function(_0x5e9c90){if(_0x5e9c90['type']!==_0xef4d('0x46')){var _0xe6ae52={};_0xe6ae52[_0x5e9c90[_0xef4d('0x31')]]={'$like':'%'+_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x44')]+'%'};return _0xe6ae52;}})});}_0x4c6117=_['merge']({},_0x4c6117,_0x5e3b5a[_0xef4d('0x47')]);var _0x56a2ea={'where':_0x4c6117[_0xef4d('0x43')]};return db['CmList'][_0xef4d('0x25')](_0x56a2ea)[_0xef4d('0x2e')](function(_0x555579){_0xfb79a2[_0xef4d('0x25')]=_0x555579;if(_0x5e3b5a[_0xef4d('0x38')][_0xef4d('0x48')]){_0x4c6117[_0xef4d('0x49')]=[{'all':!![]}];}return db['CmList'][_0xef4d('0x4a')](_0x4c6117);})['then'](function(_0x5ae410){_0xfb79a2[_0xef4d('0x4b')]=_0x5ae410;return _0xfb79a2;})[_0xef4d('0x2e')](respondWithFilteredResult(_0x51fc1f,_0x4c6117))['catch'](handleError(_0x51fc1f,null));};exports['show']=function(_0x39963d,_0x306751){var _0x30e72f={'raw':![],'where':{'id':_0x39963d[_0xef4d('0x4c')]['id']}},_0x3f5500={};_0x3f5500['model']=_[_0xef4d('0x37')](db[_0xef4d('0x34')][_0xef4d('0x4d')]);_0x3f5500[_0xef4d('0x38')]=_['keys'](_0x39963d[_0xef4d('0x38')]);_0x3f5500[_0xef4d('0x39')]=_['intersection'](_0x3f5500['model'],_0x3f5500[_0xef4d('0x38')]);_0x30e72f['attributes']=_[_0xef4d('0x3a')](_0x3f5500[_0xef4d('0x3c')],qs[_0xef4d('0x3d')](_0x39963d[_0xef4d('0x38')][_0xef4d('0x3d')]));_0x30e72f[_0xef4d('0x3b')]=_0x30e72f[_0xef4d('0x3b')][_0xef4d('0x3e')]?_0x30e72f[_0xef4d('0x3b')]:_0x3f5500[_0xef4d('0x3c')];if(_0x39963d[_0xef4d('0x38')]['includeAll']){_0x30e72f['include']=[{'all':!![]}];}_0x30e72f=_[_0xef4d('0x45')]({},_0x30e72f,_0x39963d[_0xef4d('0x47')]);return db[_0xef4d('0x34')]['find'](_0x30e72f)['then'](handleEntityNotFound(_0x306751,null))[_0xef4d('0x2e')](respondWithResult(_0x306751,null))[_0xef4d('0x4e')](handleError(_0x306751,null));};exports[_0xef4d('0x4f')]=function(_0x1eced1,_0x3d833c){return db[_0xef4d('0x34')][_0xef4d('0x4f')](_0x1eced1[_0xef4d('0x50')],{})[_0xef4d('0x2e')](function(_0x1d42b4){var _0x43d328=_0x1eced1[_0xef4d('0x51')][_0xef4d('0x2c')]({'plain':!![]});if(!_0x43d328)throw new Error(_0xef4d('0x52'));if(_0x43d328['role']===_0xef4d('0x51')){var _0x51810f=_0x1d42b4['get']({'plain':!![]});var _0x14c130=_0xef4d('0x2d');return db[_0xef4d('0x53')][_0xef4d('0x54')]({'where':{'name':_0x14c130,'userProfileId':_0x43d328[_0xef4d('0x55')]},'raw':!![]})[_0xef4d('0x2e')](function(_0x4afae2){if(_0x4afae2&&_0x4afae2[_0xef4d('0x56')]===0x0){return db['UserProfileResource'][_0xef4d('0x4f')]({'name':_0x51810f[_0xef4d('0x31')],'resourceId':_0x51810f['id'],'type':_0x4afae2['name'],'sectionId':_0x4afae2['id']},{})['then'](function(){return _0x1d42b4;});}else{return _0x1d42b4;}})[_0xef4d('0x4e')](function(_0xfdc434){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfdc434);throw _0xfdc434;});}return _0x1d42b4;})[_0xef4d('0x2e')](respondWithResult(_0x3d833c,0xc9))['catch'](handleError(_0x3d833c,null));};exports[_0xef4d('0x57')]=function(_0x43c44d,_0x54fb95){if(_0x43c44d['body']['id']){delete _0x43c44d[_0xef4d('0x50')]['id'];}return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x43c44d[_0xef4d('0x4c')]['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x54fb95,null))[_0xef4d('0x2e')](saveUpdates(_0x43c44d[_0xef4d('0x50')],null))[_0xef4d('0x2e')](respondWithResult(_0x54fb95,null))[_0xef4d('0x4e')](handleError(_0x54fb95,null));};exports[_0xef4d('0x2b')]=function(_0x38ce52,_0x1b4ada){return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x38ce52[_0xef4d('0x4c')]['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x1b4ada,null))[_0xef4d('0x2e')](removeEntity(_0x1b4ada,null))[_0xef4d('0x4e')](handleError(_0x1b4ada,null));};exports[_0xef4d('0x58')]=function(_0x230754,_0x1f9ee4){return db[_0xef4d('0x34')][_0xef4d('0x58')]()[_0xef4d('0x2e')](respondWithResult(_0x1f9ee4,null))[_0xef4d('0x4e')](handleError(_0x1f9ee4,null));};exports[_0xef4d('0x59')]=function(_0x1726cf,_0x163511,_0x24305e){if(_0x1726cf[_0xef4d('0x50')]['id']){delete _0x1726cf[_0xef4d('0x50')]['id'];}return db[_0xef4d('0x34')]['find']({'where':{'id':_0x1726cf['params']['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x163511,null))[_0xef4d('0x2e')](function(_0x11433d){if(_0x11433d){_0x1726cf['body'][_0xef4d('0x5a')]=_0x11433d['id'];return db[_0xef4d('0x5b')][_0xef4d('0x4f')](_0x1726cf[_0xef4d('0x50')]);}})[_0xef4d('0x2e')](respondWithResult(_0x163511,null))[_0xef4d('0x4e')](handleError(_0x163511,null));};exports['getDispositions']=function(_0xdc9bd4,_0x5afc0b,_0x486d41){var _0x23b0f3={'raw':![],'where':{}};var _0x16d7e5={};var _0x2a9e2c={'count':0x0,'rows':[]};return db[_0xef4d('0x34')][_0xef4d('0x5c')]({'where':{'id':_0xdc9bd4['params']['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x5afc0b,null))[_0xef4d('0x2e')](function(_0x2f1a69){if(_0x2f1a69){_0x16d7e5[_0xef4d('0x3c')]=_['keys'](db[_0xef4d('0x5b')]['rawAttributes']);_0x16d7e5[_0xef4d('0x38')]=_[_0xef4d('0x37')](_0xdc9bd4['query']);_0x16d7e5[_0xef4d('0x39')]=_[_0xef4d('0x3a')](_0x16d7e5[_0xef4d('0x3c')],_0x16d7e5[_0xef4d('0x38')]);_0x23b0f3[_0xef4d('0x3b')]=_[_0xef4d('0x3a')](_0x16d7e5[_0xef4d('0x3c')],qs['fields'](_0xdc9bd4[_0xef4d('0x38')][_0xef4d('0x3d')]));_0x23b0f3[_0xef4d('0x3b')]=_0x23b0f3[_0xef4d('0x3b')][_0xef4d('0x3e')]?_0x23b0f3[_0xef4d('0x3b')]:_0x16d7e5['model'];if(!_0xdc9bd4['query'][_0xef4d('0x3f')](_0xef4d('0x40'))){_0x23b0f3[_0xef4d('0x24')]=qs[_0xef4d('0x24')](_0xdc9bd4[_0xef4d('0x38')][_0xef4d('0x24')]);_0x23b0f3['offset']=qs[_0xef4d('0x26')](_0xdc9bd4[_0xef4d('0x38')][_0xef4d('0x26')]);}_0x23b0f3[_0xef4d('0x41')]=qs['sort'](_0xdc9bd4[_0xef4d('0x38')]['sort']);_0x23b0f3[_0xef4d('0x43')]=qs[_0xef4d('0x39')](_[_0xef4d('0x5d')](_0xdc9bd4['query'],_0x16d7e5['filters']));_0x23b0f3[_0xef4d('0x43')][_0xef4d('0x5a')]=_0x2f1a69['id'];if(_0xdc9bd4[_0xef4d('0x38')][_0xef4d('0x44')]){_0x23b0f3[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0x23b0f3['where'],{'$or':_['map'](_0x23b0f3['attributes'],function(_0x133f2b){var _0x4a3361={};_0x4a3361[_0x133f2b]={'$like':'%'+_0xdc9bd4[_0xef4d('0x38')][_0xef4d('0x44')]+'%'};return _0x4a3361;})});}_0x23b0f3=_[_0xef4d('0x45')]({},_0x23b0f3,_0xdc9bd4[_0xef4d('0x47')]);return db[_0xef4d('0x5b')][_0xef4d('0x25')]({'where':_0x23b0f3[_0xef4d('0x43')]})['then'](function(_0x5efadc){_0x2a9e2c['count']=_0x5efadc;if(_0xdc9bd4['query'][_0xef4d('0x48')]){_0x23b0f3[_0xef4d('0x49')]=[{'all':!![]}];}return db[_0xef4d('0x5b')][_0xef4d('0x4a')](_0x23b0f3);})[_0xef4d('0x2e')](function(_0x5da7c5){_0x2a9e2c[_0xef4d('0x4b')]=_0x5da7c5;return _0x2a9e2c;});}})[_0xef4d('0x2e')](respondWithFilteredResult(_0x5afc0b,_0x23b0f3))[_0xef4d('0x4e')](handleError(_0x5afc0b,null));};exports[_0xef4d('0x5e')]=function(_0x22f406,_0x4db1ca,_0x598e19){return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x22f406[_0xef4d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4db1ca,null))[_0xef4d('0x2e')](function(_0x588d36){if(_0x588d36){return _0x588d36['removeDispositions'](_0x22f406[_0xef4d('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x4db1ca,null))[_0xef4d('0x4e')](handleError(_0x4db1ca,null));};exports[_0xef4d('0x5f')]=function(_0x2ef517,_0xd91158,_0x5a96a3){return db[_0xef4d('0x34')]['find']({'where':{'id':_0x2ef517['params']['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0xd91158,null))[_0xef4d('0x2e')](function(_0xda5800){if(_0xda5800){var _0xc0f15a=[];var _0x51ded5={'success':[],'errors':[]};return db[_0xef4d('0x60')][_0xef4d('0x58')]()[_0xef4d('0x2e')](function(_0xe2db1a){if(_0x2ef517['body']['tags']&&_[_0xef4d('0x61')](_0x2ef517[_0xef4d('0x50')][_0xef4d('0x62')])){if(_0x2ef517[_0xef4d('0x50')][_0xef4d('0x62')][_0xef4d('0x3e')]){_0x2ef517[_0xef4d('0x50')][_0xef4d('0x62')]=_0x2ef517[_0xef4d('0x50')]['tags'][_0xef4d('0x63')](';')+';';}else{_0x2ef517['body'][_0xef4d('0x62')]=null;}}else{_0x2ef517[_0xef4d('0x50')]['tags']=null;}if(_0x2ef517[_0xef4d('0x50')]&&_['isArray'](_0x2ef517['body'])){for(var _0x4a4578=0x0;_0x4a4578<_0x2ef517['body'][_0xef4d('0x3e')];_0x4a4578+=0x1){_0x2ef517[_0xef4d('0x50')][_0x4a4578]['ListId']=_0x2ef517[_0xef4d('0x4c')]['id'];_0xc0f15a[_0xef4d('0x64')](_0x2ef517['body'][_0x4a4578]);}return BPromise['each'](_0xc0f15a,function(_0x1b21c1){return db['CmContact'][_0xef4d('0x4f')](_['omit'](_0x1b21c1,[_0xef4d('0x65'),'id'])||{},{'fields':_[_0xef4d('0x37')](_0xe2db1a),'raw':!![]})[_0xef4d('0x2e')](function(_0x97c3b2){_0x51ded5[_0xef4d('0x66')]['push'](_0x97c3b2[_0xef4d('0x67')]);})[_0xef4d('0x4e')](function(_0x147cdb){_0x51ded5[_0xef4d('0x68')]['push']({'data':_0x1b21c1,'error':_0x147cdb[_0xef4d('0x69')]});});})[_0xef4d('0x2e')](function(_0x370ef1){return _0x51ded5;})['catch'](function(_0x17d68f){return _0x17d68f;});}else{_0xd91158[_0xef4d('0x20')](0x190)[_0xef4d('0x22')]({'message':_0xef4d('0x6a')});}});}})[_0xef4d('0x2e')](respondWithResult(_0xd91158,null))['catch'](handleError(_0xd91158,null));};exports[_0xef4d('0x6b')]=function(_0x4cb91f,_0x996293,_0x2b98c9){var _0x54e62f;return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x4cb91f[_0xef4d('0x4c')]['id']},'include':[{'model':db[_0xef4d('0x6c')],'as':_0xef4d('0x6d')}]})['then'](handleEntityNotFound(_0x996293,null))['then'](function(_0x4d1fa2){if(_0x4d1fa2){_0x54e62f=_0x4d1fa2;return db[_0xef4d('0x60')][_0xef4d('0x4d')];}})[_0xef4d('0x2e')](function(_0x25e3ab){if(_0x25e3ab){var _0x4acb37={};var _0x5f5ddb={};_0x5f5ddb[_0xef4d('0x3c')]=_[_0xef4d('0x6e')](_['keys'](_0x25e3ab),_[_0xef4d('0x33')](_0x54e62f[_0xef4d('0x6d')],function(_0x5eb3fb){return util[_0xef4d('0x6f')](_0xef4d('0x70'),_0x5eb3fb['id']);}));_0x5f5ddb[_0xef4d('0x38')]=_['keys'](_0x4cb91f[_0xef4d('0x38')]);_0x5f5ddb[_0xef4d('0x39')]=_[_0xef4d('0x3a')](_0x5f5ddb[_0xef4d('0x3c')],_0x5f5ddb[_0xef4d('0x38')]);_0x4acb37[_0xef4d('0x3b')]=_[_0xef4d('0x3a')](_0x5f5ddb[_0xef4d('0x3c')],qs[_0xef4d('0x3d')](_0x4cb91f['query']['fields']));_0x4acb37[_0xef4d('0x3b')]=_0x4acb37['attributes'][_0xef4d('0x3e')]?_0x4acb37[_0xef4d('0x3b')]:_0x5f5ddb[_0xef4d('0x3c')];if(!_0x4cb91f[_0xef4d('0x38')][_0xef4d('0x3f')](_0xef4d('0x40'))){_0x4acb37[_0xef4d('0x24')]=qs[_0xef4d('0x24')](_0x4cb91f[_0xef4d('0x38')][_0xef4d('0x24')]);_0x4acb37[_0xef4d('0x26')]=qs[_0xef4d('0x26')](_0x4cb91f[_0xef4d('0x38')]['offset']);}_0x4acb37[_0xef4d('0x41')]=qs['sort'](_0x4cb91f[_0xef4d('0x38')][_0xef4d('0x42')]);_0x4acb37['where']=qs[_0xef4d('0x39')](_['pick'](_0x4cb91f[_0xef4d('0x38')],_0x5f5ddb[_0xef4d('0x39')]));_0x4acb37[_0xef4d('0x71')]=!![];if(_0x4cb91f[_0xef4d('0x38')][_0xef4d('0x44')]){_0x4acb37[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0x4acb37[_0xef4d('0x43')],{'$or':_[_0xef4d('0x33')](_0x4acb37[_0xef4d('0x3b')],function(_0x40977d){var _0x499e93={};_0x499e93[_0x40977d]={'$like':'%'+_0x4cb91f[_0xef4d('0x38')][_0xef4d('0x44')]+'%'};return _0x499e93;})});}_0x4acb37=_[_0xef4d('0x45')]({},_0x4acb37,_0x4cb91f[_0xef4d('0x47')]);return _0x54e62f['getContacts'](_0x4acb37);}})['then'](respondWithResult(_0x996293,null))[_0xef4d('0x4e')](handleError(_0x996293,null));};exports[_0xef4d('0x72')]=function(_0x221e06,_0x5f0b86,_0x48dccb){var _0x589e28;return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x221e06[_0xef4d('0x4c')]['id']},'include':[{'model':db[_0xef4d('0x6c')],'as':_0xef4d('0x6d')}]})[_0xef4d('0x2e')](handleEntityNotFound(_0x5f0b86,null))[_0xef4d('0x2e')](function(_0x532da9){if(_0x532da9){_0x589e28=_0x532da9;return db['CmContact'][_0xef4d('0x4d')];}})[_0xef4d('0x2e')](function(_0x3a8a6e){if(_0x3a8a6e){var _0xc0f3dc={};var _0x320c6a={};_0x320c6a[_0xef4d('0x3c')]=_[_0xef4d('0x6e')](_[_0xef4d('0x37')](_0x3a8a6e),_['map'](_0x589e28[_0xef4d('0x6d')],function(_0x4cc864){return util['format']('cf_%d',_0x4cc864['id']);}));_0x320c6a[_0xef4d('0x38')]=_[_0xef4d('0x37')](_0x221e06[_0xef4d('0x38')]);_0x320c6a[_0xef4d('0x39')]=_[_0xef4d('0x3a')](_0x320c6a[_0xef4d('0x3c')],_0x320c6a[_0xef4d('0x38')]);_0xc0f3dc['attributes']=_[_0xef4d('0x3a')](_0x320c6a[_0xef4d('0x3c')],qs[_0xef4d('0x3d')](_0x221e06[_0xef4d('0x38')][_0xef4d('0x3d')]));_0xc0f3dc[_0xef4d('0x3b')]=_0xc0f3dc[_0xef4d('0x3b')]['length']?_0xc0f3dc[_0xef4d('0x3b')]:_0x320c6a[_0xef4d('0x3c')];if(!_0x221e06[_0xef4d('0x38')][_0xef4d('0x3f')](_0xef4d('0x40'))){_0xc0f3dc['limit']=qs[_0xef4d('0x24')](_0x221e06[_0xef4d('0x38')][_0xef4d('0x24')]);_0xc0f3dc[_0xef4d('0x26')]=qs[_0xef4d('0x26')](_0x221e06[_0xef4d('0x38')]['offset']);}_0xc0f3dc[_0xef4d('0x41')]=qs['sort'](_0x221e06[_0xef4d('0x38')][_0xef4d('0x42')]);_0xc0f3dc[_0xef4d('0x43')]=qs['filters'](_[_0xef4d('0x5d')](_0x221e06[_0xef4d('0x38')],_0x320c6a[_0xef4d('0x39')]));_0xc0f3dc[_0xef4d('0x71')]=!![];if(_0x221e06[_0xef4d('0x38')]['filter']){_0xc0f3dc[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0xc0f3dc[_0xef4d('0x43')],{'$or':_[_0xef4d('0x33')](_0xc0f3dc[_0xef4d('0x3b')],function(_0x17e7d7){var _0x30e2db={};_0x30e2db[_0x17e7d7]={'$like':'%'+_0x221e06[_0xef4d('0x38')][_0xef4d('0x44')]+'%'};return _0x30e2db;})});}_0xc0f3dc=_[_0xef4d('0x45')]({},_0xc0f3dc,_0x221e06[_0xef4d('0x47')]);return _0x589e28[_0xef4d('0x6b')](_0xc0f3dc);}})[_0xef4d('0x2e')](function(_0x26b0cf){if(!_[_0xef4d('0x73')](_0x26b0cf)){var _0x1d60a8=toCsv(_0x26b0cf);var _0x3f965c=Date[_0xef4d('0x74')]();fs[_0xef4d('0x75')](util[_0xef4d('0x6f')](_0xef4d('0x76'),_0x589e28['id'],_0x3f965c),_0x1d60a8);_0x5f0b86[_0xef4d('0x77')](_0xef4d('0x78'),_0xef4d('0x79')+util[_0xef4d('0x6f')]('list_%d_%s.csv',_0x589e28['id'],_0x3f965c));_0x5f0b86[_0xef4d('0x77')](_0xef4d('0x7a'),_0xef4d('0x7b'));return _0x5f0b86[_0xef4d('0x7c')](util[_0xef4d('0x6f')](_0xef4d('0x76'),_0x589e28['id'],_0x3f965c));}else{return _0x5f0b86[_0xef4d('0x1f')](0xcc);}})['catch'](handleError(_0x5f0b86,null));};exports[_0xef4d('0x7d')]=function(_0x3ea4fc,_0x5e4ed5,_0x5c7fab){var _0x22e11f;delete _0x3ea4fc[_0xef4d('0x50')]['id'];return db[_0xef4d('0x34')][_0xef4d('0x5c')]({'where':{'id':_0x3ea4fc[_0xef4d('0x4c')]['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x5e4ed5,null))[_0xef4d('0x2e')](function(_0x5c752b){if(_0x5c752b){return db[_0xef4d('0x7e')]['transaction'](function(_0x207bee){return db[_0xef4d('0x6c')][_0xef4d('0x4f')](_0x3ea4fc[_0xef4d('0x50')],{'transaction':_0x207bee})[_0xef4d('0x2e')](function(_0x22f18f){_0x22e11f=_0x22f18f;return _0x5c752b[_0xef4d('0x7f')](_0x22f18f,{'transaction':_0x207bee});})[_0xef4d('0x2e')](function(){var _0x2e8304={'type':db['Sequelize'][_0xef4d('0x80')],'transaction':_0x207bee};switch(_0x3ea4fc[_0xef4d('0x50')]['type']){case _0xef4d('0x81'):_0x2e8304[_0xef4d('0x82')]=db[_0xef4d('0x83')][_0xef4d('0x80')];break;case _0xef4d('0x84'):_0x2e8304[_0xef4d('0x82')]=db[_0xef4d('0x83')][_0xef4d('0x85')];break;case _0xef4d('0x86'):_0x2e8304['type']=db[_0xef4d('0x83')][_0xef4d('0x87')];_0x2e8304[_0xef4d('0x88')]=![];break;default:}return db[_0xef4d('0x7e')][_0xef4d('0x89')][_0xef4d('0x8a')](_0xef4d('0x8b'),util[_0xef4d('0x6f')](_0xef4d('0x8c'),_0x22e11f['id']),_0x2e8304);})[_0xef4d('0x2e')](function(){return _0x22e11f;});});}})[_0xef4d('0x2e')](respondWithResult(_0x5e4ed5,null))['catch'](handleError(_0x5e4ed5,null));};exports[_0xef4d('0x8d')]=function(_0x4d36e4,_0xf57814,_0x2013ff){var _0x221bd7={};var _0x121dff={};var _0x13ad90;var _0x20a29c;return db[_0xef4d('0x34')][_0xef4d('0x5c')]({'where':{'id':_0x4d36e4[_0xef4d('0x4c')]['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0xf57814,null))[_0xef4d('0x2e')](function(_0x1ff9fb){if(_0x1ff9fb){_0x13ad90=_0x1ff9fb;_0x121dff[_0xef4d('0x3c')]=_[_0xef4d('0x37')](db['CmCustomField']['rawAttributes']);_0x121dff[_0xef4d('0x38')]=_[_0xef4d('0x37')](_0x4d36e4[_0xef4d('0x38')]);_0x121dff[_0xef4d('0x39')]=_['intersection'](_0x121dff[_0xef4d('0x3c')],_0x121dff[_0xef4d('0x38')]);_0x221bd7['attributes']=_['intersection'](_0x121dff['model'],qs[_0xef4d('0x3d')](_0x4d36e4[_0xef4d('0x38')][_0xef4d('0x3d')]));_0x221bd7[_0xef4d('0x3b')]=_0x221bd7[_0xef4d('0x3b')][_0xef4d('0x3e')]?_0x221bd7['attributes']:_0x121dff[_0xef4d('0x3c')];_0x221bd7[_0xef4d('0x41')]=qs[_0xef4d('0x42')](_0x4d36e4[_0xef4d('0x38')]['sort']);_0x221bd7[_0xef4d('0x43')]=qs[_0xef4d('0x39')](_[_0xef4d('0x5d')](_0x4d36e4[_0xef4d('0x38')],_0x121dff[_0xef4d('0x39')]));_0x221bd7[_0xef4d('0x43')]=_['merge'](_0x221bd7[_0xef4d('0x43')],{'$or':[{'ListId':_0x1ff9fb['id']},{'ListId':null}]});if(_0x4d36e4[_0xef4d('0x38')][_0xef4d('0x44')]){_0x221bd7[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0x221bd7[_0xef4d('0x43')],{'$or':_[_0xef4d('0x33')](_0x221bd7['attributes'],function(_0x581acc){var _0x355e87={};_0x355e87[_0x581acc]={'$like':'%'+_0x4d36e4[_0xef4d('0x38')][_0xef4d('0x44')]+'%'};return _0x355e87;})});}_0x221bd7=_[_0xef4d('0x45')]({},_0x221bd7,_0x4d36e4[_0xef4d('0x47')]);return db['CmCustomField'][_0xef4d('0x8e')](_0x221bd7);}})[_0xef4d('0x2e')](respondWithResult(_0xf57814,null))['catch'](handleError(_0xf57814,null));};exports[_0xef4d('0x8f')]=function(_0x1182b7,_0x2fc651,_0x549408){return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x1182b7['params']['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x2fc651,null))[_0xef4d('0x2e')](function(_0x1facf5){if(_0x1facf5){return _0x1facf5['addAgents'](_0x1182b7[_0xef4d('0x50')][_0xef4d('0x65')],_[_0xef4d('0x90')](_0x1182b7['body'],['ids','id'])||{})[_0xef4d('0x91')](function(_0x4c1a17){for(var _0x8256c9=0x0;_0x8256c9<_0x1182b7[_0xef4d('0x50')][_0xef4d('0x65')]['length'];_0x8256c9+=0x1){socket[_0xef4d('0x92')](_0xef4d('0x93'),{'UserId':Number(_0x1182b7['body'][_0xef4d('0x65')][_0x8256c9]),'CmListId':Number(_0x1182b7['params']['id'])});}return _0x4c1a17;});}})[_0xef4d('0x2e')](respondWithResult(_0x2fc651,null))['catch'](handleError(_0x2fc651,null));};exports[_0xef4d('0x94')]=function(_0x1d4471,_0x36ed92,_0x5d06ec){return db[_0xef4d('0x34')][_0xef4d('0x54')]({'where':{'id':_0x1d4471[_0xef4d('0x4c')]['id']}})[_0xef4d('0x2e')](handleEntityNotFound(_0x36ed92,null))['then'](function(_0x3d5440){if(_0x3d5440){return _0x3d5440[_0xef4d('0x94')](_0x1d4471[_0xef4d('0x38')][_0xef4d('0x65')])['then'](function(){if(_[_0xef4d('0x61')](_0x1d4471[_0xef4d('0x38')][_0xef4d('0x65')])){for(var _0x5d5fa9=0x0;_0x5d5fa9<_0x1d4471[_0xef4d('0x38')][_0xef4d('0x65')][_0xef4d('0x3e')];_0x5d5fa9+=0x1){socket[_0xef4d('0x92')](_0xef4d('0x95'),{'UserId':Number(_0x1d4471['query'][_0xef4d('0x65')][_0x5d5fa9]),'CmListId':Number(_0x1d4471[_0xef4d('0x4c')]['id'])});}}else{socket[_0xef4d('0x92')](_0xef4d('0x95'),{'UserId':Number(_0x1d4471[_0xef4d('0x38')][_0xef4d('0x65')]),'CmListId':Number(_0x1d4471[_0xef4d('0x4c')]['id'])});}});}})[_0xef4d('0x2e')](respondWithStatusCode(_0x36ed92,null))[_0xef4d('0x4e')](handleError(_0x36ed92,null));};exports[_0xef4d('0x96')]=function(_0x4d34dc,_0x2e3dd1,_0x991ac8){var _0x3da242={};var _0x1c7d7a={};var _0x55c702;var _0x6308be;return db[_0xef4d('0x34')][_0xef4d('0x5c')]({'where':{'id':_0x4d34dc[_0xef4d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e3dd1,null))[_0xef4d('0x2e')](function(_0x2fd05b){if(_0x2fd05b){_0x55c702=_0x2fd05b;_0x1c7d7a[_0xef4d('0x3c')]=_[_0xef4d('0x37')](db[_0xef4d('0x97')][_0xef4d('0x4d')]);_0x1c7d7a['query']=_[_0xef4d('0x37')](_0x4d34dc[_0xef4d('0x38')]);_0x1c7d7a[_0xef4d('0x39')]=_[_0xef4d('0x3a')](_0x1c7d7a[_0xef4d('0x3c')],_0x1c7d7a[_0xef4d('0x38')]);_0x3da242['attributes']=_[_0xef4d('0x3a')](_0x1c7d7a[_0xef4d('0x3c')],qs['fields'](_0x4d34dc[_0xef4d('0x38')][_0xef4d('0x3d')]));_0x3da242[_0xef4d('0x3b')]=_0x3da242[_0xef4d('0x3b')]['length']?_0x3da242[_0xef4d('0x3b')]:_0x1c7d7a[_0xef4d('0x3c')];_0x3da242['order']=qs[_0xef4d('0x42')](_0x4d34dc[_0xef4d('0x38')]['sort']);_0x3da242[_0xef4d('0x43')]=qs[_0xef4d('0x39')](_[_0xef4d('0x5d')](_0x4d34dc['query'],_0x1c7d7a[_0xef4d('0x39')]));if(_0x4d34dc[_0xef4d('0x38')][_0xef4d('0x44')]){_0x3da242[_0xef4d('0x43')]=_[_0xef4d('0x45')](_0x3da242[_0xef4d('0x43')],{'$or':_['map'](_0x3da242[_0xef4d('0x3b')],function(_0x464997){var _0x478863={};_0x478863[_0x464997]={'$like':'%'+_0x4d34dc['query'][_0xef4d('0x44')]+'%'};return _0x478863;})});}_0x3da242=_[_0xef4d('0x45')]({},_0x3da242,_0x4d34dc[_0xef4d('0x47')]);return _0x55c702[_0xef4d('0x96')](_0x3da242);}})[_0xef4d('0x2e')](function(_0x5a479e){if(_0x5a479e){_0x6308be=_0x5a479e[_0xef4d('0x3e')];if(!_0x4d34dc[_0xef4d('0x38')][_0xef4d('0x3f')](_0xef4d('0x40'))){_0x3da242['limit']=qs[_0xef4d('0x24')](_0x4d34dc[_0xef4d('0x38')][_0xef4d('0x24')]);_0x3da242[_0xef4d('0x26')]=qs[_0xef4d('0x26')](_0x4d34dc[_0xef4d('0x38')][_0xef4d('0x26')]);}return _0x55c702[_0xef4d('0x96')](_0x3da242);}})[_0xef4d('0x2e')](function(_0x4c713a){if(_0x4c713a){return _0x4c713a?{'count':_0x6308be,'rows':_0x4c713a}:null;}})[_0xef4d('0x2e')](respondWithResult(_0x2e3dd1,null))[_0xef4d('0x4e')](handleError(_0x2e3dd1,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b6f730b..a32ec6e 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x2c9056,_0x552f14){var _0x3e6959=function(_0x556247){while(--_0x556247){_0x2c9056['push'](_0x2c9056['shift']());}};_0x3e6959(++_0x552f14);}(_0x7217,0x19e));var _0x7721=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7217[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x326f,0xd1));var _0xf326=function(_0x58977a,_0xcb5243){_0x58977a=_0x58977a-0x0;var _0x2cc4a9=_0x326f[_0x58977a];return _0x2cc4a9;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index bb3c75a..e7d3a8c 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 _0xd2ea=['cm_lists','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0xd2ea,0x15f));var _0xad2e=function(_0x3ad88c,_0x3e6fb0){_0x3ad88c=_0x3ad88c-0x0;var _0x44b377=_0xd2ea[_0x3ad88c];return _0x44b377;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var moment=require(_0xad2e('0x4'));var BPromise=require('bluebird');var rp=require(_0xad2e('0x5'));var fs=require('fs');var path=require(_0xad2e('0x6'));var rimraf=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var attributes=require(_0xad2e('0x9'));module[_0xad2e('0xa')]=function(_0x29e97f,_0x592e8b){return _0x29e97f[_0xad2e('0xb')](_0xad2e('0xc'),attributes,{'tableName':_0xad2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x3a2ce8,_0x367dfc){var _0x2973a1=function(_0x56a4af){while(--_0x56a4af){_0x3a2ce8['push'](_0x3a2ce8['shift']());}};_0x2973a1(++_0x367dfc);}(_0xf109,0xce));var _0x9f10=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xf109[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index e1f2439..4b1aab7 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 _0x3aab=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','error','message','result','catch','util','moment'];(function(_0x4c24c2,_0x52cf87){var _0x3a6e0f=function(_0x184b57){while(--_0x184b57){_0x4c24c2['push'](_0x4c24c2['shift']());}};_0x3a6e0f(++_0x52cf87);}(_0x3aab,0x1a2));var _0xb3aa=function(_0x22368a,_0x21548d){_0x22368a=_0x22368a-0x0;var _0x390b59=_0x3aab[_0x22368a];return _0x390b59;};'use strict';var _=require('lodash');var util=require(_0xb3aa('0x0'));var moment=require(_0xb3aa('0x1'));var BPromise=require(_0xb3aa('0x2'));var rs=require(_0xb3aa('0x3'));var fs=require('fs');var Redis=require(_0xb3aa('0x4'));var db=require(_0xb3aa('0x5'))['db'];var utils=require(_0xb3aa('0x6'));var logger=require(_0xb3aa('0x7'))(_0xb3aa('0x8'));var config=require('../../config/environment');var jayson=require(_0xb3aa('0x9'));var client=jayson[_0xb3aa('0xa')]['http']({'port':0x232a});config[_0xb3aa('0xb')]=_[_0xb3aa('0xc')](config[_0xb3aa('0xb')],{'host':_0xb3aa('0xd'),'port':0x18eb});var socket=require(_0xb3aa('0xe'))(new Redis(config[_0xb3aa('0xb')]));require(_0xb3aa('0xf'))[_0xb3aa('0x10')](socket);function respondWithRpcPromise(_0x495794,_0x1d06ef,_0x231174){return new BPromise(function(_0x7d121e,_0x38aa0b){return client[_0xb3aa('0x11')](_0x495794,_0x231174)['then'](function(_0x26fe66){logger[_0xb3aa('0x12')](_0xb3aa('0x13'),_0x1d06ef,_0xb3aa('0x14'));logger[_0xb3aa('0x15')](_0xb3aa('0x16'),_0x1d06ef,_0xb3aa('0x14'),JSON[_0xb3aa('0x17')](_0x26fe66));if(_0x26fe66['error']){if(_0x26fe66[_0xb3aa('0x18')]['code']===0x1f4){logger[_0xb3aa('0x18')](_0xb3aa('0x13'),_0x1d06ef,_0x26fe66[_0xb3aa('0x18')][_0xb3aa('0x19')]);return _0x38aa0b(_0x26fe66[_0xb3aa('0x18')][_0xb3aa('0x19')]);}logger[_0xb3aa('0x18')]('CmList,\x20%s,\x20%s',_0x1d06ef,_0x26fe66[_0xb3aa('0x18')][_0xb3aa('0x19')]);return _0x7d121e(_0x26fe66[_0xb3aa('0x18')]['message']);}else{logger[_0xb3aa('0x12')](_0xb3aa('0x13'),_0x1d06ef,_0xb3aa('0x14'));_0x7d121e(_0x26fe66[_0xb3aa('0x1a')]['message']);}})[_0xb3aa('0x1b')](function(_0x57cedc){logger[_0xb3aa('0x18')](_0xb3aa('0x13'),_0x1d06ef,_0x57cedc);_0x38aa0b(_0x57cedc);});});} \ No newline at end of file +var _0xe44c=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x308d18,_0x1eebaa){var _0x4f4bad=function(_0x18eeee){while(--_0x18eeee){_0x308d18['push'](_0x308d18['shift']());}};_0x4f4bad(++_0x1eebaa);}(_0xe44c,0xb4));var _0xce44=function(_0x57c9ac,_0x15e943){_0x57c9ac=_0x57c9ac-0x0;var _0x3d0908=_0xe44c[_0x57c9ac];return _0x3d0908;};'use strict';var _=require('lodash');var util=require(_0xce44('0x0'));var moment=require('moment');var BPromise=require(_0xce44('0x1'));var rs=require(_0xce44('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce44('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce44('0x4'));var config=require(_0xce44('0x5'));var jayson=require(_0xce44('0x6'));var client=jayson[_0xce44('0x7')][_0xce44('0x8')]({'port':0x232a});config[_0xce44('0x9')]=_['defaults'](config[_0xce44('0x9')],{'host':_0xce44('0xa'),'port':0x18eb});var socket=require(_0xce44('0xb'))(new Redis(config[_0xce44('0x9')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4fa9de,_0x54e1bb,_0x576361){return new BPromise(function(_0x28502f,_0x3ae76d){return client[_0xce44('0xc')](_0x4fa9de,_0x576361)[_0xce44('0xd')](function(_0x58b96c){logger[_0xce44('0xe')](_0xce44('0xf'),_0x54e1bb,_0xce44('0x10'));logger[_0xce44('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x54e1bb,_0xce44('0x10'),JSON[_0xce44('0x12')](_0x58b96c));if(_0x58b96c[_0xce44('0x13')]){if(_0x58b96c[_0xce44('0x13')]['code']===0x1f4){logger['error'](_0xce44('0xf'),_0x54e1bb,_0x58b96c[_0xce44('0x13')][_0xce44('0x14')]);return _0x3ae76d(_0x58b96c[_0xce44('0x13')][_0xce44('0x14')]);}logger[_0xce44('0x13')](_0xce44('0xf'),_0x54e1bb,_0x58b96c['error'][_0xce44('0x14')]);return _0x28502f(_0x58b96c[_0xce44('0x13')][_0xce44('0x14')]);}else{logger[_0xce44('0xe')](_0xce44('0xf'),_0x54e1bb,_0xce44('0x10'));_0x28502f(_0x58b96c[_0xce44('0x15')]['message']);}})[_0xce44('0x16')](function(_0x584638){logger[_0xce44('0x13')]('CmList,\x20%s,\x20%s',_0x54e1bb,_0x584638);_0x3ae76d(_0x584638);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index aac1c53..ab7d0ec 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 _0x8228=['cmList:','removeListener','register','length'];(function(_0x20e430,_0x241c7a){var _0x1e1e0d=function(_0x2f8f90){while(--_0x2f8f90){_0x20e430['push'](_0x20e430['shift']());}};_0x1e1e0d(++_0x241c7a);}(_0x8228,0x145));var _0x8822=function(_0x304d0c,_0x5f05ae){_0x304d0c=_0x304d0c-0x0;var _0x3aa39b=_0x8228[_0x304d0c];return _0x3aa39b;};'use strict';var CmListEvents=require('./cmList.events');var events=['save','remove','update'];function createListener(_0x5a2117,_0x45d91e){return function(_0x577a27){_0x45d91e['emit'](_0x5a2117,_0x577a27);};}function removeListener(_0x259ad4,_0xcf212b){return function(){CmListEvents[_0x8822('0x0')](_0x259ad4,_0xcf212b);};}exports[_0x8822('0x1')]=function(_0x283bb1){for(var _0x2b664c=0x0,_0x58a00a=events[_0x8822('0x2')];_0x2b664c<_0x58a00a;_0x2b664c++){var _0x4d5a6c=events[_0x2b664c];var _0x10ec97=createListener(_0x8822('0x3')+_0x4d5a6c,_0x283bb1);CmListEvents['on'](_0x4d5a6c,_0x10ec97);}}; \ No newline at end of file +var _0xb7a6=['update','removeListener','./cmList.events','save'];(function(_0x426267,_0x422e6e){var _0x59e163=function(_0x1abaa3){while(--_0x1abaa3){_0x426267['push'](_0x426267['shift']());}};_0x59e163(++_0x422e6e);}(_0xb7a6,0x66));var _0x6b7a=function(_0x65ea6c,_0x1a2d48){_0x65ea6c=_0x65ea6c-0x0;var _0x56e82e=_0xb7a6[_0x65ea6c];return _0x56e82e;};'use strict';var CmListEvents=require(_0x6b7a('0x0'));var events=[_0x6b7a('0x1'),'remove',_0x6b7a('0x2')];function createListener(_0x3626a8,_0x429ca6){return function(_0x48d5a3){_0x429ca6['emit'](_0x3626a8,_0x48d5a3);};}function removeListener(_0x3f50ef,_0x2e33c4){return function(){CmListEvents[_0x6b7a('0x3')](_0x3f50ef,_0x2e33c4);};}exports['register']=function(_0x5df617){for(var _0x122521=0x0,_0x5ca393=events['length'];_0x122521<_0x5ca393;_0x122521++){var _0x10bd01=events[_0x122521];var _0x69fc9e=createListener('cmList:'+_0x10bd01,_0x5df617);CmListEvents['on'](_0x10bd01,_0x69fc9e);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 335dd39..31cd516 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 _0x7922=['/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id'];(function(_0x34c92b,_0x173432){var _0x10bc29=function(_0x180d22){while(--_0x180d22){_0x34c92b['push'](_0x34c92b['shift']());}};_0x10bc29(++_0x173432);}(_0x7922,0x15e));var _0x2792=function(_0x3c3b95,_0x366237){_0x3c3b95=_0x3c3b95-0x0;var _0x313db4=_0x7922[_0x3c3b95];return _0x313db4;};'use strict';var multer=require(_0x2792('0x0'));var util=require('util');var path=require(_0x2792('0x1'));var timeout=require(_0x2792('0x2'));var express=require(_0x2792('0x3'));var router=express['Router']();var fs_extra=require(_0x2792('0x4'));var auth=require(_0x2792('0x5'));var interaction=require(_0x2792('0x6'));var config=require(_0x2792('0x7'));var controller=require('./cmList.controller');router[_0x2792('0x8')]('/',auth['isAuthenticated'](),controller[_0x2792('0x9')]);router[_0x2792('0x8')](_0x2792('0xa'),auth[_0x2792('0xb')](),controller['describe']);router['get'](_0x2792('0xc'),auth[_0x2792('0xb')](),controller['show']);router[_0x2792('0x8')](_0x2792('0xd'),auth[_0x2792('0xb')](),controller[_0x2792('0xe')]);router[_0x2792('0x8')](_0x2792('0xf'),auth[_0x2792('0xb')](),controller['getContacts']);router[_0x2792('0x8')](_0x2792('0x10'),auth[_0x2792('0xb')](),controller[_0x2792('0x11')]);router[_0x2792('0x8')](_0x2792('0x12'),auth['isAuthenticated'](),controller[_0x2792('0x13')]);router[_0x2792('0x8')](_0x2792('0x14'),auth[_0x2792('0xb')](),controller[_0x2792('0x15')]);router['post']('/',auth[_0x2792('0xb')](),controller[_0x2792('0x16')]);router[_0x2792('0x17')](_0x2792('0xd'),auth[_0x2792('0xb')](),controller[_0x2792('0x18')]);router['post'](_0x2792('0xf'),auth[_0x2792('0xb')](),controller[_0x2792('0x19')]);router[_0x2792('0x17')](_0x2792('0x12'),auth['isAuthenticated'](),controller[_0x2792('0x1a')]);router[_0x2792('0x17')]('/:id/users',auth[_0x2792('0xb')](),controller[_0x2792('0x1b')]);router[_0x2792('0x1c')](_0x2792('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2792('0x1d')](_0x2792('0xc'),auth[_0x2792('0xb')](),controller[_0x2792('0x1e')]);router[_0x2792('0x1d')]('/:id/dispositions',auth[_0x2792('0xb')](),controller[_0x2792('0x1f')]);router[_0x2792('0x1d')](_0x2792('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x2792('0x20')]=router; \ No newline at end of file +var _0x1631=['show','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addContacts','/:id/fields','addAgents','update','delete','destroy','/:id/dispositions','removeDispositions','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1631,0x173));var _0x1163=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x1631[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0x1163('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1163('0x1'));var express=require('express');var router=express[_0x1163('0x2')]();var fs_extra=require(_0x1163('0x3'));var auth=require(_0x1163('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1163('0x5'));var controller=require(_0x1163('0x6'));router[_0x1163('0x7')]('/',auth[_0x1163('0x8')](),controller[_0x1163('0x9')]);router[_0x1163('0x7')](_0x1163('0xa'),auth[_0x1163('0x8')](),controller[_0x1163('0xb')]);router[_0x1163('0x7')](_0x1163('0xc'),auth[_0x1163('0x8')](),controller[_0x1163('0xd')]);router[_0x1163('0x7')]('/:id/dispositions',auth[_0x1163('0x8')](),controller[_0x1163('0xe')]);router[_0x1163('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x1163('0xf')]);router[_0x1163('0x7')](_0x1163('0x10'),auth[_0x1163('0x8')](),controller[_0x1163('0x11')]);router[_0x1163('0x7')]('/:id/fields',auth[_0x1163('0x8')](),controller[_0x1163('0x12')]);router[_0x1163('0x7')](_0x1163('0x13'),auth[_0x1163('0x8')](),controller[_0x1163('0x14')]);router[_0x1163('0x15')]('/',auth[_0x1163('0x8')](),controller[_0x1163('0x16')]);router['post']('/:id/dispositions',auth[_0x1163('0x8')](),controller['addDisposition']);router[_0x1163('0x15')]('/:id/contacts',auth[_0x1163('0x8')](),controller[_0x1163('0x17')]);router['post'](_0x1163('0x18'),auth[_0x1163('0x8')](),controller['addCustomField']);router[_0x1163('0x15')](_0x1163('0x13'),auth[_0x1163('0x8')](),controller[_0x1163('0x19')]);router['put'](_0x1163('0xc'),auth[_0x1163('0x8')](),controller[_0x1163('0x1a')]);router[_0x1163('0x1b')](_0x1163('0xc'),auth['isAuthenticated'](),controller[_0x1163('0x1c')]);router['delete'](_0x1163('0x1d'),auth[_0x1163('0x8')](),controller[_0x1163('0x1e')]);router[_0x1163('0x1b')]('/:id/users',auth[_0x1163('0x8')](),controller['removeAgents']);module[_0x1163('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0f226d3..946b232 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 _0xc65d=['STRING','exports','VIRTUAL','field'];(function(_0x52aee7,_0x3497a7){var _0x22cbf3=function(_0xac7002){while(--_0xac7002){_0x52aee7['push'](_0x52aee7['shift']());}};_0x22cbf3(++_0x3497a7);}(_0xc65d,0xa9));var _0xdc65=function(_0x666f26,_0x2bac4){_0x666f26=_0x666f26-0x0;var _0x30152a=_0xc65d[_0x666f26];return _0x30152a;};'use strict';var Sequelize=require('sequelize');module[_0xdc65('0x0')]={'name':{'type':Sequelize[_0xdc65('0x1')],'get':function(_0x444939){return this['getDataValue'](_0xdc65('0x2'));}},'field':{'type':Sequelize[_0xdc65('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xdc65('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xf563=['sequelize','getDataValue','field','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf563,0x1f0));var _0x3f56=function(_0x543083,_0x2a7767){_0x543083=_0x543083-0x0;var _0x832f50=_0xf563[_0x543083];return _0x832f50;};'use strict';var Sequelize=require(_0x3f56('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5740ff){return this[_0x3f56('0x1')](_0x3f56('0x2'));}},'field':{'type':Sequelize[_0x3f56('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3f56('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b93c7c3..80e0a1c 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x48ff69,_0xfea383){var _0x596d1e=function(_0x47febe){while(--_0x47febe){_0x48ff69['push'](_0x48ff69['shift']());}};_0x596d1e(++_0xfea383);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x519df1,_0x2e4de1){var _0x2ffd13=function(_0x3db8de){while(--_0x3db8de){_0x519df1['push'](_0x519df1['shift']());}};_0x2ffd13(++_0x2e4de1);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index dbb5d16..551942f 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 _0x0137=['tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition'];(function(_0x259b7f,_0x1d59bd){var _0x277849=function(_0x4e3063){while(--_0x4e3063){_0x259b7f['push'](_0x259b7f['shift']());}};_0x277849(++_0x1d59bd);}(_0x0137,0x9d));var _0x7013=function(_0x17788a,_0x150887){_0x17788a=_0x17788a-0x0;var _0x33f47c=_0x0137[_0x17788a];return _0x33f47c;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require('rimraf');var config=require(_0x7013('0x7'));var attributes=require(_0x7013('0x8'));module[_0x7013('0x9')]=function(_0x1dad9d,_0x50a4d2){return _0x1dad9d[_0x7013('0xa')](_0x7013('0xb'),attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6468=['define','Condition','tools_conditions','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6468,0xe7));var _0x8646=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x6468[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x8646('0x0'));var util=require(_0x8646('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8646('0x2'));var BPromise=require('bluebird');var rp=require(_0x8646('0x3'));var fs=require('fs');var path=require(_0x8646('0x4'));var rimraf=require(_0x8646('0x5'));var config=require(_0x8646('0x6'));var attributes=require(_0x8646('0x7'));module[_0x8646('0x8')]=function(_0xd3ff16,_0x44d930){return _0xd3ff16[_0x8646('0x9')](_0x8646('0xa'),attributes,{'tableName':_0x8646('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 7bb8232..025d76e 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 _0xd2ee=['jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xd2ee,0x1b0));var _0xed2e=function(_0x822c4e,_0x21f855){_0x822c4e=_0x822c4e-0x0;var _0x2aab89=_0xd2ee[_0x822c4e];return _0x2aab89;};'use strict';var _=require(_0xed2e('0x0'));var util=require('util');var moment=require(_0xed2e('0x1'));var BPromise=require(_0xed2e('0x2'));var rs=require(_0xed2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed2e('0x4'))['db'];var utils=require(_0xed2e('0x5'));var logger=require('../../config/logger')(_0xed2e('0x6'));var config=require(_0xed2e('0x7'));var jayson=require(_0xed2e('0x8'));var client=jayson[_0xed2e('0x9')][_0xed2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f360d,_0x25a07b,_0x1d59ef){return new BPromise(function(_0x2e41ed,_0x3d2e7c){return client['request'](_0x4f360d,_0x1d59ef)[_0xed2e('0xb')](function(_0x368bb6){logger[_0xed2e('0xc')](_0xed2e('0xd'),_0x25a07b,_0xed2e('0xe'));logger[_0xed2e('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x25a07b,_0xed2e('0xe'),JSON[_0xed2e('0x10')](_0x368bb6));if(_0x368bb6[_0xed2e('0x11')]){if(_0x368bb6[_0xed2e('0x11')][_0xed2e('0x12')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x25a07b,_0x368bb6[_0xed2e('0x11')][_0xed2e('0x13')]);return _0x3d2e7c(_0x368bb6['error']['message']);}logger[_0xed2e('0x11')](_0xed2e('0xd'),_0x25a07b,_0x368bb6[_0xed2e('0x11')]['message']);return _0x2e41ed(_0x368bb6[_0xed2e('0x11')][_0xed2e('0x13')]);}else{logger[_0xed2e('0xc')](_0xed2e('0xd'),_0x25a07b,_0xed2e('0xe'));_0x2e41ed(_0x368bb6[_0xed2e('0x14')][_0xed2e('0x13')]);}})[_0xed2e('0x15')](function(_0x767777){logger[_0xed2e('0x11')](_0xed2e('0xd'),_0x25a07b,_0x767777);_0x3d2e7c(_0x767777);});});} \ No newline at end of file +var _0xf4ef=['client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf4ef,0x18e));var _0xff4e=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0xf4ef[_0x470f63];return _0x4f09e2;};'use strict';var _=require('lodash');var util=require(_0xff4e('0x0'));var moment=require(_0xff4e('0x1'));var BPromise=require(_0xff4e('0x2'));var rs=require(_0xff4e('0x3'));var fs=require('fs');var Redis=require(_0xff4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xff4e('0x5'));var logger=require(_0xff4e('0x6'))(_0xff4e('0x7'));var config=require(_0xff4e('0x8'));var jayson=require(_0xff4e('0x9'));var client=jayson[_0xff4e('0xa')][_0xff4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518a4a,_0x479736,_0x137791){return new BPromise(function(_0x3b46c6,_0x142815){return client[_0xff4e('0xc')](_0x518a4a,_0x137791)[_0xff4e('0xd')](function(_0x32f31e){logger[_0xff4e('0xe')](_0xff4e('0xf'),_0x479736,_0xff4e('0x10'));logger[_0xff4e('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x479736,_0xff4e('0x10'),JSON[_0xff4e('0x12')](_0x32f31e));if(_0x32f31e[_0xff4e('0x13')]){if(_0x32f31e[_0xff4e('0x13')][_0xff4e('0x14')]===0x1f4){logger[_0xff4e('0x13')](_0xff4e('0xf'),_0x479736,_0x32f31e[_0xff4e('0x13')][_0xff4e('0x15')]);return _0x142815(_0x32f31e['error'][_0xff4e('0x15')]);}logger[_0xff4e('0x13')](_0xff4e('0xf'),_0x479736,_0x32f31e[_0xff4e('0x13')][_0xff4e('0x15')]);return _0x3b46c6(_0x32f31e[_0xff4e('0x13')][_0xff4e('0x15')]);}else{logger[_0xff4e('0xe')](_0xff4e('0xf'),_0x479736,_0xff4e('0x10'));_0x3b46c6(_0x32f31e[_0xff4e('0x16')][_0xff4e('0x15')]);}})[_0xff4e('0x17')](function(_0x2283f2){logger[_0xff4e('0x13')](_0xff4e('0xf'),_0x479736,_0x2283f2);_0x142815(_0x2283f2);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 89ac0c5..bf1392d 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 _0x93ba=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util'];(function(_0x329e44,_0x2bec9b){var _0xe0eaac=function(_0x2fe957){while(--_0x2fe957){_0x329e44['push'](_0x329e44['shift']());}};_0xe0eaac(++_0x2bec9b);}(_0x93ba,0x8a));var _0xa93b=function(_0x353501,_0x27c84e){_0x353501=_0x353501-0x0;var _0x3dd779=_0x93ba[_0x353501];return _0x3dd779;};'use strict';var multer=require(_0xa93b('0x0'));var util=require(_0xa93b('0x1'));var path=require(_0xa93b('0x2'));var timeout=require('connect-timeout');var express=require(_0xa93b('0x3'));var router=express['Router']();var fs_extra=require(_0xa93b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa93b('0x5'));var config=require(_0xa93b('0x6'));var controller=require(_0xa93b('0x7'));router[_0xa93b('0x8')](_0xa93b('0x9'),auth[_0xa93b('0xa')](),controller[_0xa93b('0xb')]);router['delete'](_0xa93b('0x9'),auth[_0xa93b('0xa')](),controller[_0xa93b('0xc')]);module[_0xa93b('0xd')]=router; \ No newline at end of file +var _0x3258=['put','isAuthenticated','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x3258,0x135));var _0x8325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3258[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var path=require(_0x8325('0x2'));var timeout=require(_0x8325('0x3'));var express=require(_0x8325('0x4'));var router=express[_0x8325('0x5')]();var fs_extra=require(_0x8325('0x6'));var auth=require(_0x8325('0x7'));var interaction=require(_0x8325('0x8'));var config=require(_0x8325('0x9'));var controller=require(_0x8325('0xa'));router[_0x8325('0xb')]('/:id',auth[_0x8325('0xc')](),controller['update']);router['delete'](_0x8325('0xd'),auth[_0x8325('0xc')](),controller[_0x8325('0xe')]);module[_0x8325('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 505d111..00b307d 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 _0x2032=['name','exports','STRING'];(function(_0x1b83b6,_0x53478f){var _0x3f160e=function(_0x118ee1){while(--_0x118ee1){_0x1b83b6['push'](_0x1b83b6['shift']());}};_0x3f160e(++_0x53478f);}(_0x2032,0xd9));var _0x2203=function(_0x565f84,_0x2197ec){_0x565f84=_0x565f84-0x0;var _0x33137c=_0x2032[_0x565f84];return _0x33137c;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe706=['STRING','sequelize','exports'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xe706,0xa3));var _0x6e70=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xe706[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 39760b7..d915d55 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 _0x9fc4=['update','then','get','destroy','error','stack','name','send','map','Dashboard','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0xfc2dc,_0x465465){var _0x466519=function(_0x56b16e){while(--_0x56b16e){_0xfc2dc['push'](_0xfc2dc['shift']());}};_0x466519(++_0x465465);}(_0x9fc4,0x15f));var _0x49fc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9fc4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49fc('0x0'));var zipdir=require(_0x49fc('0x1'));var jsonpatch=require(_0x49fc('0x2'));var rp=require(_0x49fc('0x3'));var moment=require(_0x49fc('0x4'));var BPromise=require(_0x49fc('0x5'));var Mustache=require(_0x49fc('0x6'));var util=require(_0x49fc('0x7'));var path=require(_0x49fc('0x8'));var sox=require(_0x49fc('0x9'));var csv=require(_0x49fc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49fc('0xb'));var _=require('lodash');var squel=require(_0x49fc('0xc'));var crypto=require(_0x49fc('0xd'));var jsforce=require(_0x49fc('0xe'));var deskjs=require(_0x49fc('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x49fc('0x10'));var Redis=require(_0x49fc('0x11'));var authService=require(_0x49fc('0x12'));var qs=require(_0x49fc('0x13'));var as=require(_0x49fc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49fc('0x15'))(_0x49fc('0x16'));var utils=require(_0x49fc('0x17'));var config=require(_0x49fc('0x18'));var licenseUtil=require(_0x49fc('0x19'));var db=require(_0x49fc('0x1a'))['db'];config[_0x49fc('0x1b')]=_[_0x49fc('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x49fc('0x1d'))(new Redis(config[_0x49fc('0x1b')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x315f63,_0x8ee19b){_0x8ee19b=_0x8ee19b||0xcc;return function(_0x16d5e8){if(_0x16d5e8){return _0x315f63[_0x49fc('0x1e')](_0x8ee19b);}return _0x315f63['status'](_0x8ee19b)[_0x49fc('0x1f')]();};}function respondWithResult(_0x32f044,_0x41feef){_0x41feef=_0x41feef||0xc8;return function(_0x228db6){if(_0x228db6){return _0x32f044[_0x49fc('0x20')](_0x41feef)[_0x49fc('0x21')](_0x228db6);}};}function respondWithFilteredResult(_0x399601,_0x213e03){return function(_0x1fd58d){if(_0x1fd58d){var _0x292f2b=typeof _0x213e03[_0x49fc('0x22')]===_0x49fc('0x23')&&typeof _0x213e03[_0x49fc('0x24')]==='undefined';var _0x392b23=_0x1fd58d[_0x49fc('0x25')];var _0x5ae5c6=_0x292f2b?0x0:_0x213e03['offset'];var _0x2cf09f=_0x292f2b?_0x1fd58d[_0x49fc('0x25')]:_0x213e03[_0x49fc('0x22')]+_0x213e03[_0x49fc('0x24')];var _0x8ae520;if(_0x2cf09f>=_0x392b23){_0x2cf09f=_0x392b23;_0x8ae520=0xc8;}else{_0x8ae520=0xce;}_0x399601['status'](_0x8ae520);return _0x399601[_0x49fc('0x26')]('Content-Range',_0x5ae5c6+'-'+_0x2cf09f+'/'+_0x392b23)[_0x49fc('0x21')](_0x1fd58d);}return null;};}function patchUpdates(_0x2ca496){return function(_0x263451){try{jsonpatch[_0x49fc('0x27')](_0x263451,_0x2ca496,!![]);}catch(_0x443c3d){return BPromise[_0x49fc('0x28')](_0x443c3d);}return _0x263451[_0x49fc('0x29')]();};}function saveUpdates(_0x48c92c,_0x1278e8){return function(_0xcb75a7){if(_0xcb75a7){return _0xcb75a7[_0x49fc('0x2a')](_0x48c92c)[_0x49fc('0x2b')](function(_0x2002ae){return _0x2002ae;});}return null;};}function removeEntity(_0x52c42f,_0x5c55d2){return function(_0x5b8608){if(_0x5b8608){return _0x5b8608['destroy']()[_0x49fc('0x2b')](function(){var _0x27d062=_0x5b8608[_0x49fc('0x2c')]({'plain':!![]});var _0x23f7af='CustomDashboards';return db['UserProfileResource'][_0x49fc('0x2d')]({'where':{'type':_0x23f7af,'resourceId':_0x27d062['id']}})[_0x49fc('0x2b')](function(){return _0x5b8608;});})[_0x49fc('0x2b')](function(){_0x52c42f[_0x49fc('0x20')](0xcc)[_0x49fc('0x1f')]();});}};}function handleEntityNotFound(_0x53107e,_0x2f2248){return function(_0x17b966){if(!_0x17b966){_0x53107e['sendStatus'](0x194);}return _0x17b966;};}function handleError(_0x16a6c7,_0x574fb1){_0x574fb1=_0x574fb1||0x1f4;return function(_0x42dcaa){logger[_0x49fc('0x2e')](_0x42dcaa[_0x49fc('0x2f')]);if(_0x42dcaa[_0x49fc('0x30')]){delete _0x42dcaa[_0x49fc('0x30')];}_0x16a6c7['status'](_0x574fb1)[_0x49fc('0x31')](_0x42dcaa);};}exports['index']=function(_0x39e27c,_0x594f58){var _0x3e325b={},_0x2e4398={},_0x3ed84b={'count':0x0,'rows':[]};var _0x3e66d8=_[_0x49fc('0x32')](db[_0x49fc('0x33')]['rawAttributes'],function(_0x24ebda){return{'name':_0x24ebda[_0x49fc('0x34')],'type':_0x24ebda[_0x49fc('0x35')][_0x49fc('0x36')]};});_0x2e4398[_0x49fc('0x37')]=_['map'](_0x3e66d8,_0x49fc('0x30'));_0x2e4398[_0x49fc('0x38')]=_[_0x49fc('0x39')](_0x39e27c[_0x49fc('0x38')]);_0x2e4398[_0x49fc('0x3a')]=_['intersection'](_0x2e4398[_0x49fc('0x37')],_0x2e4398[_0x49fc('0x38')]);_0x3e325b[_0x49fc('0x3b')]=_[_0x49fc('0x3c')](_0x2e4398[_0x49fc('0x37')],qs[_0x49fc('0x3d')](_0x39e27c[_0x49fc('0x38')][_0x49fc('0x3d')]));_0x3e325b[_0x49fc('0x3b')]=_0x3e325b[_0x49fc('0x3b')][_0x49fc('0x3e')]?_0x3e325b[_0x49fc('0x3b')]:_0x2e4398[_0x49fc('0x37')];if(!_0x39e27c[_0x49fc('0x38')][_0x49fc('0x3f')](_0x49fc('0x40'))){_0x3e325b[_0x49fc('0x24')]=qs[_0x49fc('0x24')](_0x39e27c[_0x49fc('0x38')][_0x49fc('0x24')]);_0x3e325b[_0x49fc('0x22')]=qs['offset'](_0x39e27c[_0x49fc('0x38')][_0x49fc('0x22')]);}_0x3e325b[_0x49fc('0x41')]=qs[_0x49fc('0x42')](_0x39e27c[_0x49fc('0x38')][_0x49fc('0x42')]);_0x3e325b[_0x49fc('0x43')]=qs[_0x49fc('0x3a')](_[_0x49fc('0x44')](_0x39e27c[_0x49fc('0x38')],_0x2e4398[_0x49fc('0x3a')]),_0x3e66d8);if(_0x39e27c['query'][_0x49fc('0x45')]){_0x3e325b[_0x49fc('0x43')]=_[_0x49fc('0x46')](_0x3e325b[_0x49fc('0x43')],{'$or':_['map'](_0x3e66d8,function(_0x27e238){if(_0x27e238['type']!==_0x49fc('0x47')){var _0x533df1={};_0x533df1[_0x27e238[_0x49fc('0x30')]]={'$like':'%'+_0x39e27c[_0x49fc('0x38')][_0x49fc('0x45')]+'%'};return _0x533df1;}})});}_0x3e325b=_[_0x49fc('0x46')]({},_0x3e325b,_0x39e27c[_0x49fc('0x48')]);var _0x2ef659={'where':_0x3e325b[_0x49fc('0x43')]};return db[_0x49fc('0x33')][_0x49fc('0x25')](_0x2ef659)[_0x49fc('0x2b')](function(_0x1aa232){_0x3ed84b['count']=_0x1aa232;if(_0x39e27c['query'][_0x49fc('0x49')]){_0x3e325b[_0x49fc('0x4a')]=[{'all':!![]}];}return db[_0x49fc('0x33')]['findAll'](_0x3e325b);})[_0x49fc('0x2b')](function(_0x5f0ec2){_0x3ed84b['rows']=_0x5f0ec2;return _0x3ed84b;})[_0x49fc('0x2b')](respondWithFilteredResult(_0x594f58,_0x3e325b))[_0x49fc('0x4b')](handleError(_0x594f58,null));};exports[_0x49fc('0x4c')]=function(_0x4dfed8,_0x21e9b2){var _0x5c5562={'raw':![],'where':{'id':_0x4dfed8[_0x49fc('0x4d')]['id']}},_0x3403dd={};_0x3403dd[_0x49fc('0x37')]=_[_0x49fc('0x39')](db['Dashboard'][_0x49fc('0x4e')]);_0x3403dd[_0x49fc('0x38')]=_[_0x49fc('0x39')](_0x4dfed8['query']);_0x3403dd[_0x49fc('0x3a')]=_[_0x49fc('0x3c')](_0x3403dd['model'],_0x3403dd[_0x49fc('0x38')]);_0x5c5562[_0x49fc('0x3b')]=_[_0x49fc('0x3c')](_0x3403dd[_0x49fc('0x37')],qs[_0x49fc('0x3d')](_0x4dfed8[_0x49fc('0x38')]['fields']));_0x5c5562[_0x49fc('0x3b')]=_0x5c5562['attributes']['length']?_0x5c5562['attributes']:_0x3403dd['model'];if(_0x4dfed8['query']['includeAll']){_0x5c5562[_0x49fc('0x4a')]=[{'all':!![]}];}_0x5c5562=_[_0x49fc('0x46')]({},_0x5c5562,_0x4dfed8['options']);return db['Dashboard'][_0x49fc('0x4f')](_0x5c5562)['then'](handleEntityNotFound(_0x21e9b2,null))['then'](respondWithResult(_0x21e9b2,null))[_0x49fc('0x4b')](handleError(_0x21e9b2,null));};exports[_0x49fc('0x50')]=function(_0x1b9487,_0x112176){return db[_0x49fc('0x33')][_0x49fc('0x50')](_0x1b9487[_0x49fc('0x51')],{})['then'](function(_0x27a311){var _0x127779=_0x1b9487['user'][_0x49fc('0x2c')]({'plain':!![]});if(!_0x127779)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x127779['role']===_0x49fc('0x52')){var _0x50dc39=_0x27a311['get']({'plain':!![]});var _0x3ae33d=_0x49fc('0x53');return db[_0x49fc('0x54')][_0x49fc('0x4f')]({'where':{'name':_0x3ae33d,'userProfileId':_0x127779[_0x49fc('0x55')]},'raw':!![]})['then'](function(_0x20361e){if(_0x20361e&&_0x20361e[_0x49fc('0x56')]===0x0){return db[_0x49fc('0x57')][_0x49fc('0x50')]({'name':_0x50dc39[_0x49fc('0x30')],'resourceId':_0x50dc39['id'],'type':_0x20361e['name'],'sectionId':_0x20361e['id']},{})[_0x49fc('0x2b')](function(){return _0x27a311;});}else{return _0x27a311;}})[_0x49fc('0x4b')](function(_0x25a35d){logger[_0x49fc('0x2e')](_0x49fc('0x58'),_0x25a35d);throw _0x25a35d;});}return _0x27a311;})['then'](respondWithResult(_0x112176,0xc9))[_0x49fc('0x4b')](handleError(_0x112176,null));};exports[_0x49fc('0x59')]=function(_0x276ba,_0x1e7896){var _0x34423a={'where':{'id':_0x276ba[_0x49fc('0x4d')]['id']}},_0x39d58a={};_0x39d58a[_0x49fc('0x37')]=_[_0x49fc('0x39')](db[_0x49fc('0x33')][_0x49fc('0x4e')]);_0x34423a[_0x49fc('0x3b')]=_[_0x49fc('0x3c')](_0x39d58a[_0x49fc('0x37')],qs[_0x49fc('0x3d')](_0x276ba[_0x49fc('0x38')][_0x49fc('0x3d')]));_0x34423a[_0x49fc('0x3b')]=_0x34423a[_0x49fc('0x3b')]['length']?_0x34423a[_0x49fc('0x3b')]:_0x39d58a[_0x49fc('0x37')];if(_0x276ba[_0x49fc('0x38')][_0x49fc('0x49')]){_0x34423a['include']=[{'all':!![]}];}_0x34423a=_[_0x49fc('0x46')]({},_0x34423a,_0x276ba[_0x49fc('0x48')]);return db[_0x49fc('0x33')]['find'](_0x34423a)[_0x49fc('0x2b')](handleEntityNotFound(_0x1e7896,null))[_0x49fc('0x2b')](function(_0x5ae4da){if(_0x5ae4da){var _0xd5beef=_0x5ae4da[_0x49fc('0x2c')]({'plain':!![]});_0xd5beef=qs[_0x49fc('0x5a')](_0xd5beef,['id',_0x49fc('0x5b'),_0x49fc('0x5c')]);_0x276ba[_0x49fc('0x51')]=_[_0x49fc('0x5a')](_0x276ba[_0x49fc('0x51')],['id',_0x49fc('0x5b'),_0x49fc('0x5c')]);return db['Dashboard'][_0x49fc('0x50')](_[_0x49fc('0x46')](_0xd5beef,_0x276ba[_0x49fc('0x51')]),{'include':_0x276ba[_0x49fc('0x38')][_0x49fc('0x49')]?[{'all':!![]}]:undefined})[_0x49fc('0x2b')](function(_0x3b902a){var _0x203e89=_0x276ba['user'][_0x49fc('0x2c')]({'plain':!![]});if(!_0x203e89)throw new Error(_0x49fc('0x5d'));if(_0x203e89[_0x49fc('0x5e')]===_0x49fc('0x52')){var _0x73e682=_0x3b902a['get']({'plain':!![]});var _0x135018=_0x49fc('0x53');return db['UserProfileSection'][_0x49fc('0x4f')]({'where':{'name':_0x135018,'userProfileId':_0x203e89[_0x49fc('0x55')]},'raw':!![]})[_0x49fc('0x2b')](function(_0x4a9648){if(_0x4a9648&&_0x4a9648[_0x49fc('0x56')]===0x0){return db[_0x49fc('0x57')][_0x49fc('0x50')]({'name':_0x73e682['name'],'resourceId':_0x73e682['id'],'type':_0x4a9648[_0x49fc('0x30')],'sectionId':_0x4a9648['id']},{})['then'](function(){return _0x3b902a;});}else{return _0x3b902a;}})['catch'](function(_0x5d22af){logger[_0x49fc('0x2e')](_0x49fc('0x58'),_0x5d22af);throw _0x5d22af;});}return _0x3b902a;});}})[_0x49fc('0x2b')](respondWithResult(_0x1e7896,0xc9))[_0x49fc('0x4b')](handleError(_0x1e7896,null));};exports[_0x49fc('0x2a')]=function(_0xcd2681,_0x1f988b){if(_0xcd2681[_0x49fc('0x51')]['id']){delete _0xcd2681['body']['id'];}return db['Dashboard'][_0x49fc('0x4f')]({'where':{'id':_0xcd2681['params']['id']}})[_0x49fc('0x2b')](handleEntityNotFound(_0x1f988b,null))['then'](saveUpdates(_0xcd2681[_0x49fc('0x51')],null))[_0x49fc('0x2b')](respondWithResult(_0x1f988b,null))[_0x49fc('0x4b')](handleError(_0x1f988b,null));};exports[_0x49fc('0x2d')]=function(_0x321580,_0x23d2b){return db['Dashboard'][_0x49fc('0x4f')]({'where':{'id':_0x321580['params']['id']}})[_0x49fc('0x2b')](handleEntityNotFound(_0x23d2b,null))['then'](removeEntity(_0x23d2b,null))['catch'](handleError(_0x23d2b,null));};function widgetAttributes(_0x42e35b){try{switch(_0x42e35b[_0x49fc('0x35')]){case _0x49fc('0x5f'):return[{'name':'attrUrl','value':_0x42e35b['attrUrl']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b[_0x49fc('0x60')][0x0][_0x49fc('0x61')]:undefined)||_0x49fc('0x62')}];case _0x49fc('0x63'):return[{'name':_0x49fc('0x64'),'value':_0x42e35b['attrPath']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b['attrs'][0x0][_0x49fc('0x61')]:undefined)||''}];case _0x49fc('0x65'):return[{'name':_0x49fc('0x66'),'value':_0x42e35b[_0x49fc('0x66')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b[_0x49fc('0x60')][0x0][_0x49fc('0x61')]:undefined)||'HH:mm:ss'},{'name':_0x49fc('0x67'),'value':_0x42e35b[_0x49fc('0x67')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x1]?_0x42e35b[_0x49fc('0x60')][0x1][_0x49fc('0x61')]:undefined)||'0.00'},{'name':_0x49fc('0x68'),'value':_0x42e35b[_0x49fc('0x68')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x2]?_0x42e35b[_0x49fc('0x60')][0x2][_0x49fc('0x61')]:undefined)||0xc}];case _0x49fc('0x69'):return[{'name':_0x49fc('0x6a'),'value':_0x42e35b[_0x49fc('0x6a')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b[_0x49fc('0x60')][0x0][_0x49fc('0x61')]:undefined)||_0x49fc('0x6b')},{'name':'attrVoiceQueues','value':_0x42e35b[_0x49fc('0x6c')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x1]?_0x42e35b['attrs'][0x1][_0x49fc('0x61')]:undefined)||[]},{'name':_0x49fc('0x68'),'value':_0x42e35b[_0x49fc('0x68')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b['attrs'][0x2]?_0x42e35b[_0x49fc('0x60')][0x2][_0x49fc('0x61')]:undefined)||0x14},{'name':_0x49fc('0x6d'),'value':_0x42e35b[_0x49fc('0x6d')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b['attrs'][0x3]?_0x42e35b['attrs'][0x3][_0x49fc('0x61')]:undefined)||_0x49fc('0x6e')},{'name':_0x49fc('0x6f'),'value':_0x42e35b[_0x49fc('0x6f')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x4]?_0x42e35b['attrs'][0x4][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x70'),'value':_0x42e35b[_0x49fc('0x70')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x5]?_0x42e35b[_0x49fc('0x60')][0x5][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x71'),'value':_0x42e35b[_0x49fc('0x71')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x6]?_0x42e35b['attrs'][0x6][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x72'),'value':_0x42e35b[_0x49fc('0x72')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x7]?_0x42e35b[_0x49fc('0x60')][0x7][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x73'),'value':_0x42e35b[_0x49fc('0x73')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x8]?_0x42e35b[_0x49fc('0x60')][0x8][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x74'),'value':_0x42e35b['attrChatWebsites']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x9]?_0x42e35b['attrs'][0x9][_0x49fc('0x61')]:undefined)||''}];case _0x49fc('0x75'):case _0x49fc('0x76'):return[{'name':_0x49fc('0x77'),'value':_0x42e35b['attrSerie1']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b[_0x49fc('0x60')][0x0]['value']:undefined)||_0x49fc('0x6b')},{'name':_0x49fc('0x78'),'value':_0x42e35b['attrSerie2']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x1]?_0x42e35b[_0x49fc('0x60')][0x1]['value']:undefined)||null},{'name':_0x49fc('0x79'),'value':_0x42e35b[_0x49fc('0x79')]||(_0x42e35b['attrs']&&_0x42e35b[_0x49fc('0x60')][0x2]?_0x42e35b['attrs'][0x2][_0x49fc('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x42e35b[_0x49fc('0x6c')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x3]?_0x42e35b[_0x49fc('0x60')][0x3][_0x49fc('0x61')]:undefined)||[]},{'name':_0x49fc('0x6d'),'value':_0x42e35b[_0x49fc('0x6d')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x4]?_0x42e35b[_0x49fc('0x60')][0x4]['value']:undefined)||_0x49fc('0x6e')},{'name':_0x49fc('0x6f'),'value':_0x42e35b[_0x49fc('0x6f')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x5]?_0x42e35b[_0x49fc('0x60')][0x5][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x70'),'value':_0x42e35b['attrFaxAccounts']||(_0x42e35b['attrs']&&_0x42e35b[_0x49fc('0x60')][0x6]?_0x42e35b['attrs'][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x42e35b[_0x49fc('0x71')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b['attrs'][0x7]?_0x42e35b['attrs'][0x7][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x72'),'value':_0x42e35b[_0x49fc('0x72')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0x8]?_0x42e35b[_0x49fc('0x60')][0x8][_0x49fc('0x61')]:undefined)||''},{'name':_0x49fc('0x73'),'value':_0x42e35b[_0x49fc('0x73')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b['attrs'][0x9]?_0x42e35b[_0x49fc('0x60')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x42e35b[_0x49fc('0x74')]||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b[_0x49fc('0x60')][0xa]?_0x42e35b['attrs'][0xa][_0x49fc('0x61')]:undefined)||''}];case _0x49fc('0x7a'):return[{'name':_0x49fc('0x7b'),'type':_0x42e35b['reportType']||(_0x42e35b[_0x49fc('0x60')]&&_0x42e35b['attrs'][0x0]?_0x42e35b[_0x49fc('0x60')][0x0][_0x49fc('0x35')]:undefined)||null,'value':_0x42e35b['attrReport']||(_0x42e35b['attrs']&&_0x42e35b[_0x49fc('0x60')][0x0]?_0x42e35b[_0x49fc('0x60')][0x0][_0x49fc('0x61')]:undefined)||null},{'name':_0x49fc('0x7c'),'value':_0x42e35b[_0x49fc('0x7c')]||(_0x42e35b['attrs']&&_0x42e35b['attrs'][0x1]?_0x42e35b[_0x49fc('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x53b511){logger[_0x49fc('0x2e')](_0x49fc('0x7d'),JSON[_0x49fc('0x7e')](_0x53b511));return[];}}exports[_0x49fc('0x7f')]=function(_0x35b9cc,_0x25c489,_0x1df839){if(_0x35b9cc[_0x49fc('0x51')]['id']){delete _0x35b9cc[_0x49fc('0x51')]['id'];}return db[_0x49fc('0x33')][_0x49fc('0x4f')]({'where':{'id':_0x35b9cc[_0x49fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25c489,null))[_0x49fc('0x2b')](function(_0x2c2cc4){if(_0x2c2cc4){_0x35b9cc[_0x49fc('0x51')][_0x49fc('0x80')]=_0x2c2cc4['id'];_0x35b9cc[_0x49fc('0x51')][_0x49fc('0x60')]=widgetAttributes(_0x35b9cc[_0x49fc('0x51')]);return db['DashboardItem'][_0x49fc('0x50')](_0x35b9cc[_0x49fc('0x51')]);}})[_0x49fc('0x2b')](respondWithResult(_0x25c489,null))[_0x49fc('0x4b')](handleError(_0x25c489,null));};exports['getItems']=function(_0x3a92fa,_0x49cf3d,_0x2e89cf){var _0x2f73d8={};var _0x2de61d={};var _0x5f2f72;var _0x1ea7f1;return db[_0x49fc('0x33')]['findOne']({'where':{'id':_0x3a92fa['params']['id']}})[_0x49fc('0x2b')](handleEntityNotFound(_0x49cf3d,null))['then'](function(_0x2c698e){if(_0x2c698e){_0x5f2f72=_0x2c698e;_0x2de61d[_0x49fc('0x37')]=_['keys'](db[_0x49fc('0x81')][_0x49fc('0x4e')]);_0x2de61d[_0x49fc('0x38')]=_[_0x49fc('0x39')](_0x3a92fa['query']);_0x2de61d[_0x49fc('0x3a')]=_[_0x49fc('0x3c')](_0x2de61d[_0x49fc('0x37')],_0x2de61d[_0x49fc('0x38')]);_0x2f73d8[_0x49fc('0x3b')]=_[_0x49fc('0x3c')](_0x2de61d[_0x49fc('0x37')],qs[_0x49fc('0x3d')](_0x3a92fa['query'][_0x49fc('0x3d')]));_0x2f73d8['attributes']=_0x2f73d8['attributes'][_0x49fc('0x3e')]?_0x2f73d8[_0x49fc('0x3b')]:_0x2de61d[_0x49fc('0x37')];_0x2f73d8['order']=qs[_0x49fc('0x42')](_0x3a92fa[_0x49fc('0x38')]['sort']);_0x2f73d8[_0x49fc('0x43')]=qs[_0x49fc('0x3a')](_['pick'](_0x3a92fa[_0x49fc('0x38')],_0x2de61d[_0x49fc('0x3a')]));if(_0x3a92fa[_0x49fc('0x38')][_0x49fc('0x45')]){_0x2f73d8[_0x49fc('0x43')]=_[_0x49fc('0x46')](_0x2f73d8[_0x49fc('0x43')],{'$or':_['map'](_0x2f73d8['attributes'],function(_0x216247){var _0x384830={};_0x384830[_0x216247]={'$like':'%'+_0x3a92fa[_0x49fc('0x38')]['filter']+'%'};return _0x384830;})});}_0x2f73d8=_[_0x49fc('0x46')]({},_0x2f73d8,_0x3a92fa['options']);return _0x5f2f72['getItems'](_0x2f73d8);}})['then'](function(_0x2a5bd6){if(_0x2a5bd6){_0x1ea7f1=_0x2a5bd6['length'];if(!_0x3a92fa[_0x49fc('0x38')][_0x49fc('0x3f')](_0x49fc('0x40'))){_0x2f73d8['limit']=qs[_0x49fc('0x24')](_0x3a92fa['query'][_0x49fc('0x24')]);_0x2f73d8[_0x49fc('0x22')]=qs['offset'](_0x3a92fa[_0x49fc('0x38')]['offset']);}return _0x5f2f72[_0x49fc('0x82')](_0x2f73d8);}})[_0x49fc('0x2b')](function(_0x3afc1f){if(_0x3afc1f){return _0x3afc1f?{'count':_0x1ea7f1,'rows':_0x3afc1f}:null;}})[_0x49fc('0x2b')](respondWithResult(_0x49cf3d,null))[_0x49fc('0x4b')](handleError(_0x49cf3d,null));}; \ No newline at end of file +var _0x3b39=['custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrFaxAccounts','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','pick','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','iframe','attrUrl','attrs','https://'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3b39,0x12f));var _0x93b3=function(_0x486efc,_0x1cca6a){_0x486efc=_0x486efc-0x0;var _0x42ae7e=_0x3b39[_0x486efc];return _0x42ae7e;};'use strict';var emlformat=require(_0x93b3('0x0'));var rimraf=require(_0x93b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93b3('0x2'));var rp=require(_0x93b3('0x3'));var moment=require(_0x93b3('0x4'));var BPromise=require(_0x93b3('0x5'));var Mustache=require(_0x93b3('0x6'));var util=require('util');var path=require(_0x93b3('0x7'));var sox=require('sox');var csv=require(_0x93b3('0x8'));var ejs=require(_0x93b3('0x9'));var fs=require('fs');var fs_extra=require(_0x93b3('0xa'));var _=require('lodash');var squel=require(_0x93b3('0xb'));var crypto=require(_0x93b3('0xc'));var jsforce=require(_0x93b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x93b3('0x8'));var querystring=require(_0x93b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x93b3('0xf'));var authService=require(_0x93b3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x93b3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93b3('0x12'))(_0x93b3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x93b3('0x14'));var db=require(_0x93b3('0x15'))['db'];config[_0x93b3('0x16')]=_[_0x93b3('0x17')](config[_0x93b3('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x93b3('0x18'))(new Redis(config[_0x93b3('0x16')]));require(_0x93b3('0x19'))['register'](socket);function respondWithStatusCode(_0x471c0b,_0x33eec0){_0x33eec0=_0x33eec0||0xcc;return function(_0x191a63){if(_0x191a63){return _0x471c0b[_0x93b3('0x1a')](_0x33eec0);}return _0x471c0b[_0x93b3('0x1b')](_0x33eec0)[_0x93b3('0x1c')]();};}function respondWithResult(_0x13d9f4,_0x4f62ee){_0x4f62ee=_0x4f62ee||0xc8;return function(_0x4fca58){if(_0x4fca58){return _0x13d9f4['status'](_0x4f62ee)[_0x93b3('0x1d')](_0x4fca58);}};}function respondWithFilteredResult(_0x11e153,_0x553e28){return function(_0x55ad8a){if(_0x55ad8a){var _0x4a1908=typeof _0x553e28['offset']==='undefined'&&typeof _0x553e28[_0x93b3('0x1e')]===_0x93b3('0x1f');var _0xeaf6d8=_0x55ad8a[_0x93b3('0x20')];var _0x141b37=_0x4a1908?0x0:_0x553e28['offset'];var _0xf8e28f=_0x4a1908?_0x55ad8a[_0x93b3('0x20')]:_0x553e28[_0x93b3('0x21')]+_0x553e28[_0x93b3('0x1e')];var _0x369578;if(_0xf8e28f>=_0xeaf6d8){_0xf8e28f=_0xeaf6d8;_0x369578=0xc8;}else{_0x369578=0xce;}_0x11e153[_0x93b3('0x1b')](_0x369578);return _0x11e153[_0x93b3('0x22')](_0x93b3('0x23'),_0x141b37+'-'+_0xf8e28f+'/'+_0xeaf6d8)[_0x93b3('0x1d')](_0x55ad8a);}return null;};}function patchUpdates(_0x4c4e9a){return function(_0x22d307){try{jsonpatch[_0x93b3('0x24')](_0x22d307,_0x4c4e9a,!![]);}catch(_0x4fffa1){return BPromise[_0x93b3('0x25')](_0x4fffa1);}return _0x22d307[_0x93b3('0x26')]();};}function saveUpdates(_0xa2c49c,_0xd1af70){return function(_0x371f6b){if(_0x371f6b){return _0x371f6b[_0x93b3('0x27')](_0xa2c49c)[_0x93b3('0x28')](function(_0x2afd63){return _0x2afd63;});}return null;};}function removeEntity(_0x16d079,_0x18b9dd){return function(_0x143e41){if(_0x143e41){return _0x143e41[_0x93b3('0x29')]()['then'](function(){var _0x459963=_0x143e41[_0x93b3('0x2a')]({'plain':!![]});var _0x4a87ba='CustomDashboards';return db[_0x93b3('0x2b')][_0x93b3('0x29')]({'where':{'type':_0x4a87ba,'resourceId':_0x459963['id']}})[_0x93b3('0x28')](function(){return _0x143e41;});})[_0x93b3('0x28')](function(){_0x16d079[_0x93b3('0x1b')](0xcc)[_0x93b3('0x1c')]();});}};}function handleEntityNotFound(_0x5a3d7c,_0x33a7f1){return function(_0x55b2a2){if(!_0x55b2a2){_0x5a3d7c[_0x93b3('0x1a')](0x194);}return _0x55b2a2;};}function handleError(_0xd84318,_0x5583c4){_0x5583c4=_0x5583c4||0x1f4;return function(_0x207605){logger['error'](_0x207605[_0x93b3('0x2c')]);if(_0x207605[_0x93b3('0x2d')]){delete _0x207605[_0x93b3('0x2d')];}_0xd84318[_0x93b3('0x1b')](_0x5583c4)['send'](_0x207605);};}exports[_0x93b3('0x2e')]=function(_0x40b716,_0x33fcd4){var _0x593269={},_0x61dcde={},_0x5a8f73={'count':0x0,'rows':[]};var _0x11a9c1=_[_0x93b3('0x2f')](db[_0x93b3('0x30')][_0x93b3('0x31')],function(_0x556a7f){return{'name':_0x556a7f[_0x93b3('0x32')],'type':_0x556a7f[_0x93b3('0x33')][_0x93b3('0x34')]};});_0x61dcde[_0x93b3('0x35')]=_[_0x93b3('0x2f')](_0x11a9c1,_0x93b3('0x2d'));_0x61dcde['query']=_[_0x93b3('0x36')](_0x40b716[_0x93b3('0x37')]);_0x61dcde[_0x93b3('0x38')]=_[_0x93b3('0x39')](_0x61dcde[_0x93b3('0x35')],_0x61dcde['query']);_0x593269[_0x93b3('0x3a')]=_[_0x93b3('0x39')](_0x61dcde[_0x93b3('0x35')],qs[_0x93b3('0x3b')](_0x40b716[_0x93b3('0x37')][_0x93b3('0x3b')]));_0x593269[_0x93b3('0x3a')]=_0x593269[_0x93b3('0x3a')]['length']?_0x593269[_0x93b3('0x3a')]:_0x61dcde[_0x93b3('0x35')];if(!_0x40b716[_0x93b3('0x37')]['hasOwnProperty'](_0x93b3('0x3c'))){_0x593269[_0x93b3('0x1e')]=qs[_0x93b3('0x1e')](_0x40b716['query'][_0x93b3('0x1e')]);_0x593269[_0x93b3('0x21')]=qs[_0x93b3('0x21')](_0x40b716[_0x93b3('0x37')][_0x93b3('0x21')]);}_0x593269[_0x93b3('0x3d')]=qs[_0x93b3('0x3e')](_0x40b716[_0x93b3('0x37')][_0x93b3('0x3e')]);_0x593269[_0x93b3('0x3f')]=qs[_0x93b3('0x38')](_['pick'](_0x40b716[_0x93b3('0x37')],_0x61dcde[_0x93b3('0x38')]),_0x11a9c1);if(_0x40b716[_0x93b3('0x37')][_0x93b3('0x40')]){_0x593269['where']=_[_0x93b3('0x41')](_0x593269[_0x93b3('0x3f')],{'$or':_[_0x93b3('0x2f')](_0x11a9c1,function(_0x123d2a){if(_0x123d2a['type']!==_0x93b3('0x42')){var _0xc6af81={};_0xc6af81[_0x123d2a[_0x93b3('0x2d')]]={'$like':'%'+_0x40b716[_0x93b3('0x37')][_0x93b3('0x40')]+'%'};return _0xc6af81;}})});}_0x593269=_[_0x93b3('0x41')]({},_0x593269,_0x40b716[_0x93b3('0x43')]);var _0x1dd187={'where':_0x593269[_0x93b3('0x3f')]};return db['Dashboard'][_0x93b3('0x20')](_0x1dd187)[_0x93b3('0x28')](function(_0x273d33){_0x5a8f73['count']=_0x273d33;if(_0x40b716[_0x93b3('0x37')]['includeAll']){_0x593269[_0x93b3('0x44')]=[{'all':!![]}];}return db[_0x93b3('0x30')][_0x93b3('0x45')](_0x593269);})['then'](function(_0x424770){_0x5a8f73[_0x93b3('0x46')]=_0x424770;return _0x5a8f73;})['then'](respondWithFilteredResult(_0x33fcd4,_0x593269))[_0x93b3('0x47')](handleError(_0x33fcd4,null));};exports[_0x93b3('0x48')]=function(_0x1bfeea,_0x349e2a){var _0x1a583f={'raw':![],'where':{'id':_0x1bfeea[_0x93b3('0x49')]['id']}},_0x5c14ab={};_0x5c14ab[_0x93b3('0x35')]=_['keys'](db[_0x93b3('0x30')][_0x93b3('0x31')]);_0x5c14ab[_0x93b3('0x37')]=_['keys'](_0x1bfeea[_0x93b3('0x37')]);_0x5c14ab[_0x93b3('0x38')]=_['intersection'](_0x5c14ab[_0x93b3('0x35')],_0x5c14ab[_0x93b3('0x37')]);_0x1a583f[_0x93b3('0x3a')]=_['intersection'](_0x5c14ab[_0x93b3('0x35')],qs['fields'](_0x1bfeea['query'][_0x93b3('0x3b')]));_0x1a583f[_0x93b3('0x3a')]=_0x1a583f[_0x93b3('0x3a')][_0x93b3('0x4a')]?_0x1a583f[_0x93b3('0x3a')]:_0x5c14ab[_0x93b3('0x35')];if(_0x1bfeea[_0x93b3('0x37')][_0x93b3('0x4b')]){_0x1a583f[_0x93b3('0x44')]=[{'all':!![]}];}_0x1a583f=_[_0x93b3('0x41')]({},_0x1a583f,_0x1bfeea['options']);return db[_0x93b3('0x30')]['find'](_0x1a583f)[_0x93b3('0x28')](handleEntityNotFound(_0x349e2a,null))[_0x93b3('0x28')](respondWithResult(_0x349e2a,null))[_0x93b3('0x47')](handleError(_0x349e2a,null));};exports['create']=function(_0xb6b5ad,_0x1b5893){return db[_0x93b3('0x30')][_0x93b3('0x4c')](_0xb6b5ad[_0x93b3('0x4d')],{})['then'](function(_0xba5690){var _0x4bafc0=_0xb6b5ad[_0x93b3('0x4e')][_0x93b3('0x2a')]({'plain':!![]});if(!_0x4bafc0)throw new Error(_0x93b3('0x4f'));if(_0x4bafc0[_0x93b3('0x50')]===_0x93b3('0x4e')){var _0x170a4f=_0xba5690[_0x93b3('0x2a')]({'plain':!![]});var _0x4f8b65=_0x93b3('0x51');return db[_0x93b3('0x52')][_0x93b3('0x53')]({'where':{'name':_0x4f8b65,'userProfileId':_0x4bafc0[_0x93b3('0x54')]},'raw':!![]})[_0x93b3('0x28')](function(_0x4a1c90){if(_0x4a1c90&&_0x4a1c90['autoAssociation']===0x0){return db[_0x93b3('0x2b')][_0x93b3('0x4c')]({'name':_0x170a4f[_0x93b3('0x2d')],'resourceId':_0x170a4f['id'],'type':_0x4a1c90[_0x93b3('0x2d')],'sectionId':_0x4a1c90['id']},{})[_0x93b3('0x28')](function(){return _0xba5690;});}else{return _0xba5690;}})[_0x93b3('0x47')](function(_0x3ca856){logger[_0x93b3('0x55')](_0x93b3('0x56'),_0x3ca856);throw _0x3ca856;});}return _0xba5690;})[_0x93b3('0x28')](respondWithResult(_0x1b5893,0xc9))[_0x93b3('0x47')](handleError(_0x1b5893,null));};exports[_0x93b3('0x57')]=function(_0x242a56,_0x3b6c21){var _0x1e14e2={'where':{'id':_0x242a56[_0x93b3('0x49')]['id']}},_0x1e73dd={};_0x1e73dd[_0x93b3('0x35')]=_[_0x93b3('0x36')](db[_0x93b3('0x30')][_0x93b3('0x31')]);_0x1e14e2[_0x93b3('0x3a')]=_['intersection'](_0x1e73dd['model'],qs[_0x93b3('0x3b')](_0x242a56[_0x93b3('0x37')]['fields']));_0x1e14e2[_0x93b3('0x3a')]=_0x1e14e2[_0x93b3('0x3a')][_0x93b3('0x4a')]?_0x1e14e2[_0x93b3('0x3a')]:_0x1e73dd[_0x93b3('0x35')];if(_0x242a56[_0x93b3('0x37')][_0x93b3('0x4b')]){_0x1e14e2[_0x93b3('0x44')]=[{'all':!![]}];}_0x1e14e2=_[_0x93b3('0x41')]({},_0x1e14e2,_0x242a56[_0x93b3('0x43')]);return db[_0x93b3('0x30')][_0x93b3('0x53')](_0x1e14e2)['then'](handleEntityNotFound(_0x3b6c21,null))['then'](function(_0x26b516){if(_0x26b516){var _0x2bc9a5=_0x26b516[_0x93b3('0x2a')]({'plain':!![]});_0x2bc9a5=qs[_0x93b3('0x58')](_0x2bc9a5,['id','createdAt',_0x93b3('0x59')]);_0x242a56[_0x93b3('0x4d')]=_['omit'](_0x242a56[_0x93b3('0x4d')],['id',_0x93b3('0x5a'),_0x93b3('0x59')]);return db['Dashboard'][_0x93b3('0x4c')](_[_0x93b3('0x41')](_0x2bc9a5,_0x242a56[_0x93b3('0x4d')]),{'include':_0x242a56[_0x93b3('0x37')][_0x93b3('0x4b')]?[{'all':!![]}]:undefined})[_0x93b3('0x28')](function(_0xb505e7){var _0x531215=_0x242a56[_0x93b3('0x4e')][_0x93b3('0x2a')]({'plain':!![]});if(!_0x531215)throw new Error(_0x93b3('0x4f'));if(_0x531215[_0x93b3('0x50')]===_0x93b3('0x4e')){var _0xa64d48=_0xb505e7[_0x93b3('0x2a')]({'plain':!![]});var _0x159027=_0x93b3('0x51');return db[_0x93b3('0x52')]['find']({'where':{'name':_0x159027,'userProfileId':_0x531215[_0x93b3('0x54')]},'raw':!![]})[_0x93b3('0x28')](function(_0x2f0050){if(_0x2f0050&&_0x2f0050[_0x93b3('0x5b')]===0x0){return db[_0x93b3('0x2b')]['create']({'name':_0xa64d48[_0x93b3('0x2d')],'resourceId':_0xa64d48['id'],'type':_0x2f0050['name'],'sectionId':_0x2f0050['id']},{})[_0x93b3('0x28')](function(){return _0xb505e7;});}else{return _0xb505e7;}})[_0x93b3('0x47')](function(_0x21e754){logger[_0x93b3('0x55')](_0x93b3('0x56'),_0x21e754);throw _0x21e754;});}return _0xb505e7;});}})[_0x93b3('0x28')](respondWithResult(_0x3b6c21,0xc9))[_0x93b3('0x47')](handleError(_0x3b6c21,null));};exports[_0x93b3('0x27')]=function(_0x5ca6ab,_0x5e698d){if(_0x5ca6ab['body']['id']){delete _0x5ca6ab[_0x93b3('0x4d')]['id'];}return db[_0x93b3('0x30')][_0x93b3('0x53')]({'where':{'id':_0x5ca6ab['params']['id']}})[_0x93b3('0x28')](handleEntityNotFound(_0x5e698d,null))[_0x93b3('0x28')](saveUpdates(_0x5ca6ab[_0x93b3('0x4d')],null))[_0x93b3('0x28')](respondWithResult(_0x5e698d,null))[_0x93b3('0x47')](handleError(_0x5e698d,null));};exports['destroy']=function(_0x3a021f,_0x2b6721){return db[_0x93b3('0x30')][_0x93b3('0x53')]({'where':{'id':_0x3a021f[_0x93b3('0x49')]['id']}})[_0x93b3('0x28')](handleEntityNotFound(_0x2b6721,null))['then'](removeEntity(_0x2b6721,null))[_0x93b3('0x47')](handleError(_0x2b6721,null));};function widgetAttributes(_0x172b4a){try{switch(_0x172b4a['type']){case _0x93b3('0x5c'):return[{'name':_0x93b3('0x5d'),'value':_0x172b4a[_0x93b3('0x5d')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0]['value']:undefined)||_0x93b3('0x5f')}];case _0x93b3('0x60'):return[{'name':'attrPath','value':_0x172b4a['attrPath']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0][_0x93b3('0x61')]:undefined)||''}];case _0x93b3('0x62'):return[{'name':_0x93b3('0x63'),'value':_0x172b4a['attrHourFormat']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0][_0x93b3('0x61')]:undefined)||_0x93b3('0x64')},{'name':'attrTimezone','value':_0x172b4a[_0x93b3('0x65')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x1]?_0x172b4a[_0x93b3('0x5e')][0x1][_0x93b3('0x61')]:undefined)||_0x93b3('0x66')},{'name':_0x93b3('0x67'),'value':_0x172b4a[_0x93b3('0x67')]||(_0x172b4a['attrs']&&_0x172b4a[_0x93b3('0x5e')][0x2]?_0x172b4a[_0x93b3('0x5e')][0x2][_0x93b3('0x61')]:undefined)||0xc}];case _0x93b3('0x68'):return[{'name':_0x93b3('0x69'),'value':_0x172b4a[_0x93b3('0x69')]||(_0x172b4a['attrs']&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a['attrs'][0x0][_0x93b3('0x61')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x172b4a[_0x93b3('0x6a')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a['attrs'][0x1]?_0x172b4a[_0x93b3('0x5e')][0x1][_0x93b3('0x61')]:undefined)||[]},{'name':_0x93b3('0x67'),'value':_0x172b4a[_0x93b3('0x67')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x2]?_0x172b4a['attrs'][0x2][_0x93b3('0x61')]:undefined)||0x14},{'name':'attrChannel','value':_0x172b4a[_0x93b3('0x6b')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x3]?_0x172b4a[_0x93b3('0x5e')][0x3][_0x93b3('0x61')]:undefined)||_0x93b3('0x6c')},{'name':_0x93b3('0x6d'),'value':_0x172b4a['attrEmailAccounts']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x4]?_0x172b4a[_0x93b3('0x5e')][0x4][_0x93b3('0x61')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x172b4a['attrFaxAccounts']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a['attrs'][0x5]?_0x172b4a['attrs'][0x5][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x6e'),'value':_0x172b4a[_0x93b3('0x6e')]||(_0x172b4a['attrs']&&_0x172b4a[_0x93b3('0x5e')][0x6]?_0x172b4a[_0x93b3('0x5e')][0x6][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x6f'),'value':_0x172b4a['attrOpenchannelAccounts']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x7]?_0x172b4a[_0x93b3('0x5e')][0x7][_0x93b3('0x61')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x172b4a['attrWhatsappAccounts']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x8]?_0x172b4a[_0x93b3('0x5e')][0x8][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x70'),'value':_0x172b4a[_0x93b3('0x70')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x9]?_0x172b4a[_0x93b3('0x5e')][0x9][_0x93b3('0x61')]:undefined)||''}];case _0x93b3('0x71'):case _0x93b3('0x72'):return[{'name':_0x93b3('0x73'),'value':_0x172b4a['attrSerie1']||(_0x172b4a['attrs']&&_0x172b4a['attrs'][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0]['value']:undefined)||_0x93b3('0x74')},{'name':_0x93b3('0x75'),'value':_0x172b4a[_0x93b3('0x75')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a['attrs'][0x1]?_0x172b4a[_0x93b3('0x5e')][0x1][_0x93b3('0x61')]:undefined)||null},{'name':_0x93b3('0x76'),'value':_0x172b4a[_0x93b3('0x76')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x2]?_0x172b4a['attrs'][0x2]['value']:undefined)||null},{'name':_0x93b3('0x6a'),'value':_0x172b4a[_0x93b3('0x6a')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x3]?_0x172b4a[_0x93b3('0x5e')][0x3][_0x93b3('0x61')]:undefined)||[]},{'name':_0x93b3('0x6b'),'value':_0x172b4a[_0x93b3('0x6b')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x4]?_0x172b4a[_0x93b3('0x5e')][0x4]['value']:undefined)||_0x93b3('0x6c')},{'name':'attrEmailAccounts','value':_0x172b4a[_0x93b3('0x6d')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x5]?_0x172b4a[_0x93b3('0x5e')][0x5][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x77'),'value':_0x172b4a[_0x93b3('0x77')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x6]?_0x172b4a['attrs'][0x6][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x6e'),'value':_0x172b4a[_0x93b3('0x6e')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x7]?_0x172b4a[_0x93b3('0x5e')][0x7][_0x93b3('0x61')]:undefined)||''},{'name':_0x93b3('0x6f'),'value':_0x172b4a[_0x93b3('0x6f')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x8]?_0x172b4a[_0x93b3('0x5e')][0x8]['value']:undefined)||''},{'name':_0x93b3('0x78'),'value':_0x172b4a[_0x93b3('0x78')]||(_0x172b4a['attrs']&&_0x172b4a[_0x93b3('0x5e')][0x9]?_0x172b4a[_0x93b3('0x5e')][0x9]['value']:undefined)||''},{'name':_0x93b3('0x70'),'value':_0x172b4a[_0x93b3('0x70')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0xa]?_0x172b4a[_0x93b3('0x5e')][0xa]['value']:undefined)||''}];case _0x93b3('0x79'):return[{'name':_0x93b3('0x7a'),'type':_0x172b4a[_0x93b3('0x7b')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0]['type']:undefined)||null,'value':_0x172b4a['attrReport']||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x0]?_0x172b4a[_0x93b3('0x5e')][0x0][_0x93b3('0x61')]:undefined)||null},{'name':_0x93b3('0x7c'),'value':_0x172b4a[_0x93b3('0x7c')]||(_0x172b4a[_0x93b3('0x5e')]&&_0x172b4a[_0x93b3('0x5e')][0x1]?_0x172b4a['attrs'][0x1][_0x93b3('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x5c11aa){logger[_0x93b3('0x55')](_0x93b3('0x7d'),JSON[_0x93b3('0x7e')](_0x5c11aa));return[];}}exports[_0x93b3('0x7f')]=function(_0x154488,_0x283f37,_0x219025){if(_0x154488[_0x93b3('0x4d')]['id']){delete _0x154488[_0x93b3('0x4d')]['id'];}return db[_0x93b3('0x30')][_0x93b3('0x53')]({'where':{'id':_0x154488[_0x93b3('0x49')]['id']}})[_0x93b3('0x28')](handleEntityNotFound(_0x283f37,null))[_0x93b3('0x28')](function(_0x3ab45d){if(_0x3ab45d){_0x154488[_0x93b3('0x4d')][_0x93b3('0x80')]=_0x3ab45d['id'];_0x154488[_0x93b3('0x4d')][_0x93b3('0x5e')]=widgetAttributes(_0x154488[_0x93b3('0x4d')]);return db[_0x93b3('0x81')][_0x93b3('0x4c')](_0x154488[_0x93b3('0x4d')]);}})[_0x93b3('0x28')](respondWithResult(_0x283f37,null))[_0x93b3('0x47')](handleError(_0x283f37,null));};exports[_0x93b3('0x82')]=function(_0x534ec4,_0xf16eb5,_0x4ae8e5){var _0x37b84c={};var _0x5844e3={};var _0x4dac47;var _0x1a1d34;return db['Dashboard']['findOne']({'where':{'id':_0x534ec4[_0x93b3('0x49')]['id']}})[_0x93b3('0x28')](handleEntityNotFound(_0xf16eb5,null))['then'](function(_0x2bc6a3){if(_0x2bc6a3){_0x4dac47=_0x2bc6a3;_0x5844e3[_0x93b3('0x35')]=_[_0x93b3('0x36')](db[_0x93b3('0x81')]['rawAttributes']);_0x5844e3[_0x93b3('0x37')]=_[_0x93b3('0x36')](_0x534ec4[_0x93b3('0x37')]);_0x5844e3['filters']=_['intersection'](_0x5844e3[_0x93b3('0x35')],_0x5844e3[_0x93b3('0x37')]);_0x37b84c[_0x93b3('0x3a')]=_['intersection'](_0x5844e3[_0x93b3('0x35')],qs['fields'](_0x534ec4['query'][_0x93b3('0x3b')]));_0x37b84c['attributes']=_0x37b84c['attributes'][_0x93b3('0x4a')]?_0x37b84c[_0x93b3('0x3a')]:_0x5844e3['model'];_0x37b84c['order']=qs[_0x93b3('0x3e')](_0x534ec4[_0x93b3('0x37')][_0x93b3('0x3e')]);_0x37b84c['where']=qs[_0x93b3('0x38')](_[_0x93b3('0x83')](_0x534ec4[_0x93b3('0x37')],_0x5844e3[_0x93b3('0x38')]));if(_0x534ec4[_0x93b3('0x37')][_0x93b3('0x40')]){_0x37b84c['where']=_['merge'](_0x37b84c[_0x93b3('0x3f')],{'$or':_[_0x93b3('0x2f')](_0x37b84c[_0x93b3('0x3a')],function(_0x29c83b){var _0x37ec58={};_0x37ec58[_0x29c83b]={'$like':'%'+_0x534ec4['query'][_0x93b3('0x40')]+'%'};return _0x37ec58;})});}_0x37b84c=_[_0x93b3('0x41')]({},_0x37b84c,_0x534ec4['options']);return _0x4dac47['getItems'](_0x37b84c);}})[_0x93b3('0x28')](function(_0x26a038){if(_0x26a038){_0x1a1d34=_0x26a038[_0x93b3('0x4a')];if(!_0x534ec4[_0x93b3('0x37')][_0x93b3('0x84')](_0x93b3('0x3c'))){_0x37b84c[_0x93b3('0x1e')]=qs['limit'](_0x534ec4['query']['limit']);_0x37b84c[_0x93b3('0x21')]=qs['offset'](_0x534ec4[_0x93b3('0x37')][_0x93b3('0x21')]);}return _0x4dac47['getItems'](_0x37b84c);}})[_0x93b3('0x28')](function(_0x22afac){if(_0x22afac){return _0x22afac?{'count':_0x1a1d34,'rows':_0x22afac}:null;}})[_0x93b3('0x28')](respondWithResult(_0xf16eb5,null))['catch'](handleError(_0xf16eb5,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 336463d..50192b4 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 _0xeda7=['../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeda7,0x196));var _0x7eda=function(_0x946518,_0x22816f){_0x946518=_0x946518-0x0;var _0x909b69=_0xeda7[_0x946518];return _0x909b69;};'use strict';var EventEmitter=require(_0x7eda('0x0'));var Dashboard=require(_0x7eda('0x1'))['db'][_0x7eda('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7eda('0x3')](0x0);var events={'afterCreate':_0x7eda('0x4'),'afterUpdate':_0x7eda('0x5'),'afterDestroy':_0x7eda('0x6')};function emitEvent(_0x2b1d21){return function(_0x324a25,_0x36a9f1,_0x15856b){DashboardEvents[_0x7eda('0x7')](_0x2b1d21+':'+_0x324a25['id'],_0x324a25);DashboardEvents[_0x7eda('0x7')](_0x2b1d21,_0x324a25);_0x15856b(null);};}for(var e in events){if(events[_0x7eda('0x8')](e)){var event=events[e];Dashboard[_0x7eda('0x9')](e,emitEvent(event));}}module[_0x7eda('0xa')]=DashboardEvents; \ No newline at end of file +var _0x79c0=['remove','emit','hasOwnProperty','exports','events','Dashboard','setMaxListeners','save','update'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x79c0,0x82));var _0x079c=function(_0x4fe72c,_0x156f7b){_0x4fe72c=_0x4fe72c-0x0;var _0x4a6ea6=_0x79c0[_0x4fe72c];return _0x4a6ea6;};'use strict';var EventEmitter=require(_0x079c('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x079c('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x079c('0x2')](0x0);var events={'afterCreate':_0x079c('0x3'),'afterUpdate':_0x079c('0x4'),'afterDestroy':_0x079c('0x5')};function emitEvent(_0x53f551){return function(_0x8c5b44,_0x5884db,_0x215798){DashboardEvents[_0x079c('0x6')](_0x53f551+':'+_0x8c5b44['id'],_0x8c5b44);DashboardEvents[_0x079c('0x6')](_0x53f551,_0x8c5b44);_0x215798(null);};}for(var e in events){if(events[_0x079c('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x079c('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index aadb48a..b20a12f 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 _0x6d41=['../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','api','bluebird','request-promise','path'];(function(_0x37789b,_0xfa89c8){var _0x138388=function(_0x4136c5){while(--_0x4136c5){_0x37789b['push'](_0x37789b['shift']());}};_0x138388(++_0xfa89c8);}(_0x6d41,0x118));var _0x16d4=function(_0x1bc9b8,_0x379fc7){_0x1bc9b8=_0x1bc9b8-0x0;var _0x1a9a13=_0x6d41[_0x1bc9b8];return _0x1a9a13;};'use strict';var _=require(_0x16d4('0x0'));var util=require(_0x16d4('0x1'));var logger=require('../../config/logger')(_0x16d4('0x2'));var moment=require('moment');var BPromise=require(_0x16d4('0x3'));var rp=require(_0x16d4('0x4'));var fs=require('fs');var path=require(_0x16d4('0x5'));var rimraf=require('rimraf');var config=require(_0x16d4('0x6'));var attributes=require(_0x16d4('0x7'));module[_0x16d4('0x8')]=function(_0x10a301,_0x34e67c){return _0x10a301['define'](_0x16d4('0x9'),attributes,{'tableName':_0x16d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d98=['moment','request-promise','./dashboard.attributes','exports','Dashboard','lodash','../../config/logger','api'];(function(_0xe65aa7,_0x3ce76b){var _0x31ee36=function(_0x2252a1){while(--_0x2252a1){_0xe65aa7['push'](_0xe65aa7['shift']());}};_0x31ee36(++_0x3ce76b);}(_0x7d98,0x75));var _0x87d9=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x7d98[_0xd8a8af];return _0x5b7278;};'use strict';var _=require(_0x87d9('0x0'));var util=require('util');var logger=require(_0x87d9('0x1'))(_0x87d9('0x2'));var moment=require(_0x87d9('0x3'));var BPromise=require('bluebird');var rp=require(_0x87d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87d9('0x5'));module[_0x87d9('0x6')]=function(_0x2bc9fd,_0x23a797){return _0x2bc9fd['define'](_0x87d9('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 30a21b8..b9dd01e 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 _0x3095=['../../config/environment','client','http','redis','defaults','./dashboard.socket','register','request','info','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x1df999,_0x49c69d){var _0x13b087=function(_0xf20d93){while(--_0xf20d93){_0x1df999['push'](_0x1df999['shift']());}};_0x13b087(++_0x49c69d);}(_0x3095,0x15f));var _0x5309=function(_0xb08125,_0x561acb){_0xb08125=_0xb08125-0x0;var _0x2ace23=_0x3095[_0xb08125];return _0x2ace23;};'use strict';var _=require(_0x5309('0x0'));var util=require(_0x5309('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5309('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5309('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5309('0x4'))(_0x5309('0x5'));var config=require(_0x5309('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5309('0x7')][_0x5309('0x8')]({'port':0x232a});config[_0x5309('0x9')]=_[_0x5309('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5309('0xb'))[_0x5309('0xc')](socket);function respondWithRpcPromise(_0x3510ab,_0x1de8f1,_0xd34f67){return new BPromise(function(_0x4c7d32,_0x2be0c4){return client[_0x5309('0xd')](_0x3510ab,_0xd34f67)['then'](function(_0xb1a94e){logger[_0x5309('0xe')]('Dashboard,\x20%s,\x20%s',_0x1de8f1,_0x5309('0xf'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1de8f1,_0x5309('0xf'),JSON[_0x5309('0x10')](_0xb1a94e));if(_0xb1a94e[_0x5309('0x11')]){if(_0xb1a94e[_0x5309('0x11')][_0x5309('0x12')]===0x1f4){logger[_0x5309('0x11')](_0x5309('0x13'),_0x1de8f1,_0xb1a94e[_0x5309('0x11')][_0x5309('0x14')]);return _0x2be0c4(_0xb1a94e[_0x5309('0x11')][_0x5309('0x14')]);}logger['error'](_0x5309('0x13'),_0x1de8f1,_0xb1a94e[_0x5309('0x11')][_0x5309('0x14')]);return _0x4c7d32(_0xb1a94e[_0x5309('0x11')][_0x5309('0x14')]);}else{logger[_0x5309('0xe')](_0x5309('0x13'),_0x1de8f1,'request\x20sent');_0x4c7d32(_0xb1a94e['result'][_0x5309('0x14')]);}})['catch'](function(_0x285ccd){logger[_0x5309('0x11')](_0x5309('0x13'),_0x1de8f1,_0x285ccd);_0x2be0c4(_0x285ccd);});});} \ No newline at end of file +var _0xf777=['Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboard.socket','register','request','info'];(function(_0x56fa72,_0x399e48){var _0x54ddcb=function(_0x2b4251){while(--_0x2b4251){_0x56fa72['push'](_0x56fa72['shift']());}};_0x54ddcb(++_0x399e48);}(_0xf777,0x134));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7f77('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f77('0x1'));var fs=require('fs');var Redis=require(_0x7f77('0x2'));var db=require(_0x7f77('0x3'))['db'];var utils=require(_0x7f77('0x4'));var logger=require(_0x7f77('0x5'))(_0x7f77('0x6'));var config=require(_0x7f77('0x7'));var jayson=require(_0x7f77('0x8'));var client=jayson[_0x7f77('0x9')][_0x7f77('0xa')]({'port':0x232a});config[_0x7f77('0xb')]=_['defaults'](config[_0x7f77('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f77('0xc'))(new Redis(config['redis']));require(_0x7f77('0xd'))[_0x7f77('0xe')](socket);function respondWithRpcPromise(_0x17bce4,_0x4b7f80,_0x4ab58b){return new BPromise(function(_0x3c3bcd,_0x4b2782){return client[_0x7f77('0xf')](_0x17bce4,_0x4ab58b)['then'](function(_0x3e3e0d){logger[_0x7f77('0x10')](_0x7f77('0x11'),_0x4b7f80,'request\x20sent');logger[_0x7f77('0x12')](_0x7f77('0x13'),_0x4b7f80,_0x7f77('0x14'),JSON[_0x7f77('0x15')](_0x3e3e0d));if(_0x3e3e0d[_0x7f77('0x16')]){if(_0x3e3e0d['error']['code']===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x4b7f80,_0x3e3e0d[_0x7f77('0x16')][_0x7f77('0x17')]);return _0x4b2782(_0x3e3e0d[_0x7f77('0x16')][_0x7f77('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x4b7f80,_0x3e3e0d[_0x7f77('0x16')][_0x7f77('0x17')]);return _0x3c3bcd(_0x3e3e0d['error'][_0x7f77('0x17')]);}else{logger[_0x7f77('0x10')](_0x7f77('0x11'),_0x4b7f80,_0x7f77('0x14'));_0x3c3bcd(_0x3e3e0d[_0x7f77('0x18')][_0x7f77('0x17')]);}})['catch'](function(_0x189005){logger[_0x7f77('0x16')](_0x7f77('0x11'),_0x4b7f80,_0x189005);_0x4b2782(_0x189005);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index bee64dd..ee07dce 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 _0x79ca=['dashboard:','./dashboard.events','remove','update','removeListener','length'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x79ca,0xdf));var _0xa79c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x79ca[_0x20a584];return _0x4b41a8;};'use strict';var DashboardEvents=require(_0xa79c('0x0'));var events=['save',_0xa79c('0x1'),_0xa79c('0x2')];function createListener(_0x15e41a,_0x478c24){return function(_0x453d43){_0x478c24['emit'](_0x15e41a,_0x453d43);};}function removeListener(_0x3e4f9a,_0x17a9a8){return function(){DashboardEvents[_0xa79c('0x3')](_0x3e4f9a,_0x17a9a8);};}exports['register']=function(_0xe6b1d3){for(var _0x212992=0x0,_0x43ff9b=events[_0xa79c('0x4')];_0x212992<_0x43ff9b;_0x212992++){var _0x295e74=events[_0x212992];var _0x54e0b8=createListener(_0xa79c('0x5')+_0x295e74,_0xe6b1d3);DashboardEvents['on'](_0x295e74,_0x54e0b8);}}; \ No newline at end of file +var _0xf40a=['remove','update','removeListener','register','length','dashboard:','save'];(function(_0x313100,_0x2a625e){var _0x415164=function(_0xe6ee84){while(--_0xe6ee84){_0x313100['push'](_0x313100['shift']());}};_0x415164(++_0x2a625e);}(_0xf40a,0x1b8));var _0xaf40=function(_0x1bfc72,_0x45f543){_0x1bfc72=_0x1bfc72-0x0;var _0x575ab3=_0xf40a[_0x1bfc72];return _0x575ab3;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xaf40('0x0'),_0xaf40('0x1'),_0xaf40('0x2')];function createListener(_0x1d69a9,_0x4e7e21){return function(_0xd24a2d){_0x4e7e21['emit'](_0x1d69a9,_0xd24a2d);};}function removeListener(_0x4c6a02,_0x505f86){return function(){DashboardEvents[_0xaf40('0x3')](_0x4c6a02,_0x505f86);};}exports[_0xaf40('0x4')]=function(_0x1f256c){for(var _0xa3a854=0x0,_0x4f1e9a=events[_0xaf40('0x5')];_0xa3a854<_0x4f1e9a;_0xa3a854++){var _0x3f6104=events[_0xa3a854];var _0x196a2f=createListener(_0xaf40('0x6')+_0x3f6104,_0x1f256c);DashboardEvents['on'](_0x3f6104,_0x196a2f);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 44fa58d..d7bdb30 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 _0x7179=['multer','util','connect-timeout','express','fs-extra','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','post','create','/:id/clone','addItem','put','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7179,0x18c));var _0x9717=function(_0x1052e9,_0x12a216){_0x1052e9=_0x1052e9-0x0;var _0x5b0fc=_0x7179[_0x1052e9];return _0x5b0fc;};'use strict';var multer=require(_0x9717('0x0'));var util=require(_0x9717('0x1'));var path=require('path');var timeout=require(_0x9717('0x2'));var express=require(_0x9717('0x3'));var router=express['Router']();var fs_extra=require(_0x9717('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9717('0x5'));var controller=require(_0x9717('0x6'));router[_0x9717('0x7')]('/',auth[_0x9717('0x8')](),controller[_0x9717('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9717('0xa')]);router[_0x9717('0x7')](_0x9717('0xb'),auth['isAuthenticated'](),controller['getItems']);router[_0x9717('0xc')]('/',auth['isAuthenticated'](),controller[_0x9717('0xd')]);router[_0x9717('0xc')](_0x9717('0xe'),auth[_0x9717('0x8')](),controller['clone']);router[_0x9717('0xc')](_0x9717('0xb'),auth['isAuthenticated'](),controller[_0x9717('0xf')]);router[_0x9717('0x10')](_0x9717('0x11'),auth[_0x9717('0x8')](),controller[_0x9717('0x12')]);router[_0x9717('0x13')](_0x9717('0x11'),auth['isAuthenticated'](),controller[_0x9717('0x14')]);module[_0x9717('0x15')]=router; \ No newline at end of file +var _0x994e=['/:id/items','getItems','post','create','/:id/clone','clone','addItem','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show'];(function(_0x145c0d,_0x2f3411){var _0x15f33f=function(_0x5dab90){while(--_0x5dab90){_0x145c0d['push'](_0x145c0d['shift']());}};_0x15f33f(++_0x2f3411);}(_0x994e,0x1ee));var _0xe994=function(_0x3ef844,_0x5a3e25){_0x3ef844=_0x3ef844-0x0;var _0x5858d4=_0x994e[_0x3ef844];return _0x5858d4;};'use strict';var multer=require('multer');var util=require(_0xe994('0x0'));var path=require(_0xe994('0x1'));var timeout=require(_0xe994('0x2'));var express=require(_0xe994('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe994('0x4'));var interaction=require(_0xe994('0x5'));var config=require(_0xe994('0x6'));var controller=require(_0xe994('0x7'));router[_0xe994('0x8')]('/',auth[_0xe994('0x9')](),controller[_0xe994('0xa')]);router['get']('/:id',auth[_0xe994('0x9')](),controller[_0xe994('0xb')]);router[_0xe994('0x8')](_0xe994('0xc'),auth[_0xe994('0x9')](),controller[_0xe994('0xd')]);router[_0xe994('0xe')]('/',auth['isAuthenticated'](),controller[_0xe994('0xf')]);router[_0xe994('0xe')](_0xe994('0x10'),auth[_0xe994('0x9')](),controller[_0xe994('0x11')]);router['post'](_0xe994('0xc'),auth[_0xe994('0x9')](),controller[_0xe994('0x12')]);router['put']('/:id',auth[_0xe994('0x9')](),controller['update']);router[_0xe994('0x13')](_0xe994('0x14'),auth[_0xe994('0x9')](),controller[_0xe994('0x15')]);module[_0xe994('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7016e41..7c4f336 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 _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x5d58=['attrs','stringify','INTEGER','#2196f3','STRING','TEXT','parse','getDataValue','setDataValue'];(function(_0x19635f,_0x564859){var _0x482132=function(_0x177ea7){while(--_0x177ea7){_0x19635f['push'](_0x19635f['shift']());}};_0x482132(++_0x564859);}(_0x5d58,0x187));var _0x85d5=function(_0x1ae54d,_0x18c53b){_0x1ae54d=_0x1ae54d-0x0;var _0x8ccfb2=_0x5d58[_0x1ae54d];return _0x8ccfb2;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x85d5('0x0')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x85d5('0x1')]('long'),'get':function(){try{return JSON[_0x85d5('0x2')](this[_0x85d5('0x3')]('attrs'));}catch(_0x1eb211){return[];}},'set':function(_0x2d457a){try{this[_0x85d5('0x4')](_0x85d5('0x5'),JSON['stringify'](_0x2d457a));}catch(_0x98c963){this[_0x85d5('0x4')]('attrs',JSON[_0x85d5('0x6')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x85d5('0x7')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x85d5('0x7')]},'col':{'type':Sequelize[_0x85d5('0x7')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x85d5('0x8'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x85d5('0x0')]},'titleFontSize':{'type':Sequelize[_0x85d5('0x7')],'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 72634ea..0b50a6a 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 _0xd1f9=['DashboardItem','catch','type','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','create','body','find','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options'];(function(_0x2e8a3b,_0x2c02a9){var _0x5236c0=function(_0x214332){while(--_0x214332){_0x2e8a3b['push'](_0x2e8a3b['shift']());}};_0x5236c0(++_0x2c02a9);}(_0xd1f9,0x88));var _0x9d1f=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0xd1f9[_0x28407a];return _0x8bd6ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d1f('0x0'));var jsonpatch=require(_0x9d1f('0x1'));var rp=require(_0x9d1f('0x2'));var moment=require(_0x9d1f('0x3'));var BPromise=require(_0x9d1f('0x4'));var Mustache=require(_0x9d1f('0x5'));var util=require(_0x9d1f('0x6'));var path=require(_0x9d1f('0x7'));var sox=require(_0x9d1f('0x8'));var csv=require('to-csv');var ejs=require(_0x9d1f('0x9'));var fs=require('fs');var fs_extra=require(_0x9d1f('0xa'));var _=require(_0x9d1f('0xb'));var squel=require(_0x9d1f('0xc'));var crypto=require(_0x9d1f('0xd'));var jsforce=require(_0x9d1f('0xe'));var deskjs=require(_0x9d1f('0xf'));var toCsv=require(_0x9d1f('0x10'));var querystring=require(_0x9d1f('0x11'));var Papa=require(_0x9d1f('0x12'));var Redis=require(_0x9d1f('0x13'));var authService=require(_0x9d1f('0x14'));var qs=require(_0x9d1f('0x15'));var as=require(_0x9d1f('0x16'));var hardwareService=require(_0x9d1f('0x17'));var logger=require(_0x9d1f('0x18'))(_0x9d1f('0x19'));var utils=require(_0x9d1f('0x1a'));var config=require(_0x9d1f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d1f('0x1c'))['db'];config[_0x9d1f('0x1d')]=_[_0x9d1f('0x1e')](config['redis'],{'host':_0x9d1f('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d1f('0x20'))[_0x9d1f('0x21')](socket);function respondWithStatusCode(_0x25c0b0,_0x1d6f6e){_0x1d6f6e=_0x1d6f6e||0xcc;return function(_0x1fea4f){if(_0x1fea4f){return _0x25c0b0[_0x9d1f('0x22')](_0x1d6f6e);}return _0x25c0b0[_0x9d1f('0x23')](_0x1d6f6e)[_0x9d1f('0x24')]();};}function respondWithResult(_0x24cd8a,_0x45a870){_0x45a870=_0x45a870||0xc8;return function(_0x1f9338){if(_0x1f9338){return _0x24cd8a[_0x9d1f('0x23')](_0x45a870)[_0x9d1f('0x25')](_0x1f9338);}};}function respondWithFilteredResult(_0x57ba11,_0x47832c){return function(_0x42a2b4){if(_0x42a2b4){var _0x4e5328=typeof _0x47832c[_0x9d1f('0x26')]==='undefined'&&typeof _0x47832c['limit']==='undefined';var _0x2d39f3=_0x42a2b4[_0x9d1f('0x27')];var _0x380a14=_0x4e5328?0x0:_0x47832c['offset'];var _0x3671f7=_0x4e5328?_0x42a2b4['count']:_0x47832c[_0x9d1f('0x26')]+_0x47832c['limit'];var _0x552a84;if(_0x3671f7>=_0x2d39f3){_0x3671f7=_0x2d39f3;_0x552a84=0xc8;}else{_0x552a84=0xce;}_0x57ba11[_0x9d1f('0x23')](_0x552a84);return _0x57ba11[_0x9d1f('0x28')](_0x9d1f('0x29'),_0x380a14+'-'+_0x3671f7+'/'+_0x2d39f3)[_0x9d1f('0x25')](_0x42a2b4);}return null;};}function patchUpdates(_0x44ef15){return function(_0x41e88f){try{jsonpatch[_0x9d1f('0x2a')](_0x41e88f,_0x44ef15,!![]);}catch(_0x3b10f7){return BPromise[_0x9d1f('0x2b')](_0x3b10f7);}return _0x41e88f[_0x9d1f('0x2c')]();};}function saveUpdates(_0x1ab0f4,_0x426c31){return function(_0x1b0ba7){if(_0x1b0ba7){return _0x1b0ba7[_0x9d1f('0x2d')](_0x1ab0f4)['then'](function(_0x2b234d){return _0x2b234d;});}return null;};}function removeEntity(_0xa2392f,_0x48245c){return function(_0x5c9fe7){if(_0x5c9fe7){return _0x5c9fe7[_0x9d1f('0x2e')]()[_0x9d1f('0x2f')](function(){_0xa2392f[_0x9d1f('0x23')](0xcc)[_0x9d1f('0x24')]();});}};}function handleEntityNotFound(_0x1aeaf3,_0x55f7de){return function(_0x47fc5e){if(!_0x47fc5e){_0x1aeaf3[_0x9d1f('0x22')](0x194);}return _0x47fc5e;};}function handleError(_0x12385d,_0x21ba80){_0x21ba80=_0x21ba80||0x1f4;return function(_0x44515d){logger[_0x9d1f('0x30')](_0x44515d[_0x9d1f('0x31')]);if(_0x44515d['name']){delete _0x44515d[_0x9d1f('0x32')];}_0x12385d['status'](_0x21ba80)[_0x9d1f('0x33')](_0x44515d);};}exports[_0x9d1f('0x34')]=function(_0x18a937,_0x579c46){var _0x1bb45e={'raw':![],'where':{'id':_0x18a937[_0x9d1f('0x35')]['id']}},_0x57f521={};_0x57f521[_0x9d1f('0x36')]=_[_0x9d1f('0x37')](db['DashboardItem']['rawAttributes']);_0x57f521[_0x9d1f('0x38')]=_[_0x9d1f('0x37')](_0x18a937['query']);_0x57f521[_0x9d1f('0x39')]=_[_0x9d1f('0x3a')](_0x57f521[_0x9d1f('0x36')],_0x57f521[_0x9d1f('0x38')]);_0x1bb45e['attributes']=_[_0x9d1f('0x3a')](_0x57f521[_0x9d1f('0x36')],qs[_0x9d1f('0x3b')](_0x18a937[_0x9d1f('0x38')]['fields']));_0x1bb45e[_0x9d1f('0x3c')]=_0x1bb45e['attributes'][_0x9d1f('0x3d')]?_0x1bb45e[_0x9d1f('0x3c')]:_0x57f521[_0x9d1f('0x36')];if(_0x18a937['query'][_0x9d1f('0x3e')]){_0x1bb45e[_0x9d1f('0x3f')]=[{'all':!![]}];}_0x1bb45e=_[_0x9d1f('0x40')]({},_0x1bb45e,_0x18a937[_0x9d1f('0x41')]);return db[_0x9d1f('0x42')]['find'](_0x1bb45e)[_0x9d1f('0x2f')](handleEntityNotFound(_0x579c46,null))[_0x9d1f('0x2f')](respondWithResult(_0x579c46,null))[_0x9d1f('0x43')](handleError(_0x579c46,null));};exports[_0x9d1f('0x2e')]=function(_0x245675,_0x381654){return db[_0x9d1f('0x42')]['find']({'where':{'id':_0x245675[_0x9d1f('0x35')]['id']}})[_0x9d1f('0x2f')](handleEntityNotFound(_0x381654,null))[_0x9d1f('0x2f')](removeEntity(_0x381654,null))[_0x9d1f('0x43')](handleError(_0x381654,null));};function widgetAttributes(_0x529dca){try{switch(_0x529dca[_0x9d1f('0x44')]){case'iframe':return[{'name':'attrUrl','value':_0x529dca['attrUrl']||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x0]?_0x529dca['attrs'][0x0][_0x9d1f('0x46')]:undefined)||_0x9d1f('0x47')}];case _0x9d1f('0x48'):return[{'name':_0x9d1f('0x49'),'value':_0x529dca[_0x9d1f('0x49')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x0]?_0x529dca['attrs'][0x0][_0x9d1f('0x46')]:undefined)||''}];case'clock':return[{'name':_0x9d1f('0x4a'),'value':_0x529dca[_0x9d1f('0x4a')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x0]?_0x529dca[_0x9d1f('0x45')][0x0][_0x9d1f('0x46')]:undefined)||_0x9d1f('0x4b')},{'name':_0x9d1f('0x4c'),'value':_0x529dca[_0x9d1f('0x4c')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x1]?_0x529dca[_0x9d1f('0x45')][0x1][_0x9d1f('0x46')]:undefined)||'0.00'},{'name':_0x9d1f('0x4d'),'value':_0x529dca['attrFontSize']||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x2]?_0x529dca['attrs'][0x2][_0x9d1f('0x46')]:undefined)||0xc}];case _0x9d1f('0x4e'):return[{'name':_0x9d1f('0x4f'),'value':_0x529dca[_0x9d1f('0x4f')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x0]?_0x529dca[_0x9d1f('0x45')][0x0][_0x9d1f('0x46')]:undefined)||'total'},{'name':_0x9d1f('0x50'),'value':_0x529dca[_0x9d1f('0x50')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x1]?_0x529dca[_0x9d1f('0x45')][0x1][_0x9d1f('0x46')]:undefined)||[]},{'name':_0x9d1f('0x4d'),'value':_0x529dca[_0x9d1f('0x4d')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x2]?_0x529dca[_0x9d1f('0x45')][0x2][_0x9d1f('0x46')]:undefined)||0x14},{'name':_0x9d1f('0x51'),'value':_0x529dca[_0x9d1f('0x51')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x3]?_0x529dca[_0x9d1f('0x45')][0x3][_0x9d1f('0x46')]:undefined)||_0x9d1f('0x52')},{'name':_0x9d1f('0x53'),'value':_0x529dca[_0x9d1f('0x53')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x4]?_0x529dca['attrs'][0x4][_0x9d1f('0x46')]:undefined)||''},{'name':_0x9d1f('0x54'),'value':_0x529dca[_0x9d1f('0x54')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x5]?_0x529dca[_0x9d1f('0x45')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x529dca[_0x9d1f('0x55')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x6]?_0x529dca[_0x9d1f('0x45')][0x6][_0x9d1f('0x46')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x529dca[_0x9d1f('0x56')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x7]?_0x529dca[_0x9d1f('0x45')][0x7][_0x9d1f('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x529dca[_0x9d1f('0x57')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x8]?_0x529dca['attrs'][0x8][_0x9d1f('0x46')]:undefined)||''},{'name':_0x9d1f('0x58'),'value':_0x529dca[_0x9d1f('0x58')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x9]?_0x529dca['attrs'][0x9]['value']:undefined)||''}];case _0x9d1f('0x59'):case _0x9d1f('0x5a'):return[{'name':_0x9d1f('0x5b'),'value':_0x529dca[_0x9d1f('0x5b')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x0]?_0x529dca['attrs'][0x0][_0x9d1f('0x46')]:undefined)||_0x9d1f('0x5c')},{'name':_0x9d1f('0x5d'),'value':_0x529dca['attrSerie2']||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x1]?_0x529dca[_0x9d1f('0x45')][0x1][_0x9d1f('0x46')]:undefined)||null},{'name':_0x9d1f('0x5e'),'value':_0x529dca[_0x9d1f('0x5e')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x2]?_0x529dca['attrs'][0x2][_0x9d1f('0x46')]:undefined)||null},{'name':_0x9d1f('0x50'),'value':_0x529dca[_0x9d1f('0x50')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x3]?_0x529dca['attrs'][0x3][_0x9d1f('0x46')]:undefined)||[]},{'name':'attrChannel','value':_0x529dca[_0x9d1f('0x51')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x4]?_0x529dca[_0x9d1f('0x45')][0x4][_0x9d1f('0x46')]:undefined)||_0x9d1f('0x52')},{'name':_0x9d1f('0x53'),'value':_0x529dca[_0x9d1f('0x53')]||(_0x529dca['attrs']&&_0x529dca['attrs'][0x5]?_0x529dca[_0x9d1f('0x45')][0x5]['value']:undefined)||''},{'name':_0x9d1f('0x54'),'value':_0x529dca[_0x9d1f('0x54')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x6]?_0x529dca['attrs'][0x6][_0x9d1f('0x46')]:undefined)||''},{'name':_0x9d1f('0x55'),'value':_0x529dca[_0x9d1f('0x55')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x7]?_0x529dca['attrs'][0x7][_0x9d1f('0x46')]:undefined)||''},{'name':_0x9d1f('0x56'),'value':_0x529dca[_0x9d1f('0x56')]||(_0x529dca['attrs']&&_0x529dca[_0x9d1f('0x45')][0x8]?_0x529dca[_0x9d1f('0x45')][0x8][_0x9d1f('0x46')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x529dca[_0x9d1f('0x57')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x9]?_0x529dca['attrs'][0x9][_0x9d1f('0x46')]:undefined)||''},{'name':_0x9d1f('0x58'),'value':_0x529dca[_0x9d1f('0x58')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0xa]?_0x529dca['attrs'][0xa][_0x9d1f('0x46')]:undefined)||''}];case'web-report':return[{'name':_0x9d1f('0x5f'),'type':_0x529dca['reportType']||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca['attrs'][0x0]?_0x529dca[_0x9d1f('0x45')][0x0][_0x9d1f('0x44')]:undefined)||null,'value':_0x529dca[_0x9d1f('0x5f')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x0]?_0x529dca['attrs'][0x0]['value']:undefined)||null},{'name':_0x9d1f('0x60'),'value':_0x529dca[_0x9d1f('0x60')]||(_0x529dca[_0x9d1f('0x45')]&&_0x529dca[_0x9d1f('0x45')][0x1]?_0x529dca[_0x9d1f('0x45')][0x1][_0x9d1f('0x46')]:undefined)||0x0}];default:return[];}}catch(_0xa5a47e){logger[_0x9d1f('0x30')]('widgetAttributes:\x20%s',JSON[_0x9d1f('0x61')](_0xa5a47e));return[];}}exports[_0x9d1f('0x62')]=function(_0x32cb18,_0x45bde8){if(_0x32cb18[_0x9d1f('0x63')]){_0x32cb18[_0x9d1f('0x63')][_0x9d1f('0x45')]=widgetAttributes(_0x32cb18[_0x9d1f('0x63')]);}return db[_0x9d1f('0x42')][_0x9d1f('0x62')](_0x32cb18[_0x9d1f('0x63')],{})[_0x9d1f('0x2f')](respondWithResult(_0x45bde8,0xc9))[_0x9d1f('0x43')](handleError(_0x45bde8,null));};exports[_0x9d1f('0x2d')]=function(_0x686aaa,_0x4e4741){if(_0x686aaa[_0x9d1f('0x63')]['id']){delete _0x686aaa[_0x9d1f('0x63')]['id'];}_0x686aaa['body'][_0x9d1f('0x45')]=widgetAttributes(_0x686aaa[_0x9d1f('0x63')]);return db[_0x9d1f('0x42')][_0x9d1f('0x64')]({'where':{'id':_0x686aaa[_0x9d1f('0x35')]['id']}})[_0x9d1f('0x2f')](handleEntityNotFound(_0x4e4741,null))[_0x9d1f('0x2f')](saveUpdates(_0x686aaa[_0x9d1f('0x63')],null))['then'](respondWithResult(_0x4e4741,null))['catch'](handleError(_0x4e4741,null));}; \ No newline at end of file +var _0x16d8=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','show','params','model','keys','query','intersection','attributes','fields','length','include','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','end'];(function(_0x909dfe,_0x36e38a){var _0x5cb58f=function(_0x3f3000){while(--_0x3f3000){_0x909dfe['push'](_0x909dfe['shift']());}};_0x5cb58f(++_0x36e38a);}(_0x16d8,0xa3));var _0x816d=function(_0x291957,_0xac2331){_0x291957=_0x291957-0x0;var _0x319381=_0x16d8[_0x291957];return _0x319381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x816d('0x0'));var zipdir=require(_0x816d('0x1'));var jsonpatch=require(_0x816d('0x2'));var rp=require(_0x816d('0x3'));var moment=require(_0x816d('0x4'));var BPromise=require(_0x816d('0x5'));var Mustache=require(_0x816d('0x6'));var util=require(_0x816d('0x7'));var path=require(_0x816d('0x8'));var sox=require('sox');var csv=require(_0x816d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x816d('0xa'));var _=require(_0x816d('0xb'));var squel=require(_0x816d('0xc'));var crypto=require(_0x816d('0xd'));var jsforce=require(_0x816d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x816d('0x9'));var querystring=require(_0x816d('0xf'));var Papa=require(_0x816d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x816d('0x11'));var hardwareService=require(_0x816d('0x12'));var logger=require(_0x816d('0x13'))(_0x816d('0x14'));var utils=require('../../config/utils');var config=require(_0x816d('0x15'));var licenseUtil=require(_0x816d('0x16'));var db=require(_0x816d('0x17'))['db'];config['redis']=_[_0x816d('0x18')](config[_0x816d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x816d('0x1a'))(new Redis(config[_0x816d('0x19')]));require('./dashboardItem.socket')[_0x816d('0x1b')](socket);function respondWithStatusCode(_0x3a50c8,_0x4e2aa9){_0x4e2aa9=_0x4e2aa9||0xcc;return function(_0x1225c4){if(_0x1225c4){return _0x3a50c8[_0x816d('0x1c')](_0x4e2aa9);}return _0x3a50c8[_0x816d('0x1d')](_0x4e2aa9)[_0x816d('0x1e')]();};}function respondWithResult(_0x61942,_0x212d20){_0x212d20=_0x212d20||0xc8;return function(_0x63847c){if(_0x63847c){return _0x61942[_0x816d('0x1d')](_0x212d20)[_0x816d('0x1f')](_0x63847c);}};}function respondWithFilteredResult(_0x525c3b,_0x33e94c){return function(_0x2cee1c){if(_0x2cee1c){var _0x175e6d=typeof _0x33e94c['offset']===_0x816d('0x20')&&typeof _0x33e94c[_0x816d('0x21')]===_0x816d('0x20');var _0x8bea23=_0x2cee1c[_0x816d('0x22')];var _0x46011d=_0x175e6d?0x0:_0x33e94c['offset'];var _0x40455e=_0x175e6d?_0x2cee1c[_0x816d('0x22')]:_0x33e94c[_0x816d('0x23')]+_0x33e94c[_0x816d('0x21')];var _0x128865;if(_0x40455e>=_0x8bea23){_0x40455e=_0x8bea23;_0x128865=0xc8;}else{_0x128865=0xce;}_0x525c3b[_0x816d('0x1d')](_0x128865);return _0x525c3b[_0x816d('0x24')](_0x816d('0x25'),_0x46011d+'-'+_0x40455e+'/'+_0x8bea23)['json'](_0x2cee1c);}return null;};}function patchUpdates(_0x430009){return function(_0x546944){try{jsonpatch[_0x816d('0x26')](_0x546944,_0x430009,!![]);}catch(_0x2d4ff2){return BPromise[_0x816d('0x27')](_0x2d4ff2);}return _0x546944[_0x816d('0x28')]();};}function saveUpdates(_0x1cf6db,_0x2bdc60){return function(_0x38edc8){if(_0x38edc8){return _0x38edc8[_0x816d('0x29')](_0x1cf6db)[_0x816d('0x2a')](function(_0x3d4410){return _0x3d4410;});}return null;};}function removeEntity(_0x2d2d98,_0xf79dfd){return function(_0x32f944){if(_0x32f944){return _0x32f944[_0x816d('0x2b')]()[_0x816d('0x2a')](function(){_0x2d2d98[_0x816d('0x1d')](0xcc)[_0x816d('0x1e')]();});}};}function handleEntityNotFound(_0x579edb,_0x39247a){return function(_0x6a4acd){if(!_0x6a4acd){_0x579edb[_0x816d('0x1c')](0x194);}return _0x6a4acd;};}function handleError(_0x349486,_0x25d4b5){_0x25d4b5=_0x25d4b5||0x1f4;return function(_0x54c775){logger['error'](_0x54c775['stack']);if(_0x54c775[_0x816d('0x2c')]){delete _0x54c775[_0x816d('0x2c')];}_0x349486[_0x816d('0x1d')](_0x25d4b5)['send'](_0x54c775);};}exports[_0x816d('0x2d')]=function(_0x72a543,_0x30bba2){var _0x510a6={'raw':![],'where':{'id':_0x72a543[_0x816d('0x2e')]['id']}},_0x548734={};_0x548734[_0x816d('0x2f')]=_[_0x816d('0x30')](db['DashboardItem']['rawAttributes']);_0x548734['query']=_['keys'](_0x72a543[_0x816d('0x31')]);_0x548734['filters']=_[_0x816d('0x32')](_0x548734[_0x816d('0x2f')],_0x548734[_0x816d('0x31')]);_0x510a6[_0x816d('0x33')]=_[_0x816d('0x32')](_0x548734['model'],qs['fields'](_0x72a543[_0x816d('0x31')][_0x816d('0x34')]));_0x510a6[_0x816d('0x33')]=_0x510a6['attributes'][_0x816d('0x35')]?_0x510a6[_0x816d('0x33')]:_0x548734[_0x816d('0x2f')];if(_0x72a543[_0x816d('0x31')]['includeAll']){_0x510a6[_0x816d('0x36')]=[{'all':!![]}];}_0x510a6=_[_0x816d('0x37')]({},_0x510a6,_0x72a543[_0x816d('0x38')]);return db[_0x816d('0x39')][_0x816d('0x3a')](_0x510a6)['then'](handleEntityNotFound(_0x30bba2,null))[_0x816d('0x2a')](respondWithResult(_0x30bba2,null))[_0x816d('0x3b')](handleError(_0x30bba2,null));};exports[_0x816d('0x2b')]=function(_0x15bf0e,_0x2c4711){return db[_0x816d('0x39')][_0x816d('0x3a')]({'where':{'id':_0x15bf0e['params']['id']}})[_0x816d('0x2a')](handleEntityNotFound(_0x2c4711,null))[_0x816d('0x2a')](removeEntity(_0x2c4711,null))[_0x816d('0x3b')](handleError(_0x2c4711,null));};function widgetAttributes(_0x3e1adf){try{switch(_0x3e1adf[_0x816d('0x3c')]){case _0x816d('0x3d'):return[{'name':_0x816d('0x3e'),'value':_0x3e1adf[_0x816d('0x3e')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf['attrs'][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x40')]:undefined)||_0x816d('0x41')}];case _0x816d('0x42'):return[{'name':'attrPath','value':_0x3e1adf[_0x816d('0x43')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x40')]:undefined)||''}];case _0x816d('0x44'):return[{'name':_0x816d('0x45'),'value':_0x3e1adf[_0x816d('0x45')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x0]?_0x3e1adf['attrs'][0x0]['value']:undefined)||_0x816d('0x46')},{'name':_0x816d('0x47'),'value':_0x3e1adf[_0x816d('0x47')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x1]?_0x3e1adf[_0x816d('0x3f')][0x1][_0x816d('0x40')]:undefined)||_0x816d('0x48')},{'name':'attrFontSize','value':_0x3e1adf['attrFontSize']||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x2]?_0x3e1adf[_0x816d('0x3f')][0x2][_0x816d('0x40')]:undefined)||0xc}];case _0x816d('0x49'):return[{'name':_0x816d('0x4a'),'value':_0x3e1adf[_0x816d('0x4a')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x40')]:undefined)||_0x816d('0x4b')},{'name':_0x816d('0x4c'),'value':_0x3e1adf[_0x816d('0x4c')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x1]?_0x3e1adf[_0x816d('0x3f')][0x1][_0x816d('0x40')]:undefined)||[]},{'name':_0x816d('0x4d'),'value':_0x3e1adf[_0x816d('0x4d')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x2]?_0x3e1adf[_0x816d('0x3f')][0x2][_0x816d('0x40')]:undefined)||0x14},{'name':_0x816d('0x4e'),'value':_0x3e1adf['attrChannel']||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x3]?_0x3e1adf['attrs'][0x3]['value']:undefined)||_0x816d('0x4f')},{'name':'attrEmailAccounts','value':_0x3e1adf[_0x816d('0x50')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x4]?_0x3e1adf[_0x816d('0x3f')][0x4][_0x816d('0x40')]:undefined)||''},{'name':_0x816d('0x51'),'value':_0x3e1adf['attrFaxAccounts']||(_0x3e1adf['attrs']&&_0x3e1adf['attrs'][0x5]?_0x3e1adf['attrs'][0x5][_0x816d('0x40')]:undefined)||''},{'name':_0x816d('0x52'),'value':_0x3e1adf['attrSmsAccounts']||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf['attrs'][0x6]?_0x3e1adf[_0x816d('0x3f')][0x6][_0x816d('0x40')]:undefined)||''},{'name':_0x816d('0x53'),'value':_0x3e1adf[_0x816d('0x53')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x7]?_0x3e1adf[_0x816d('0x3f')][0x7][_0x816d('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3e1adf['attrWhatsappAccounts']||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x8]?_0x3e1adf[_0x816d('0x3f')][0x8][_0x816d('0x40')]:undefined)||''},{'name':_0x816d('0x54'),'value':_0x3e1adf['attrChatWebsites']||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf['attrs'][0x9]?_0x3e1adf[_0x816d('0x3f')][0x9][_0x816d('0x40')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x3e1adf[_0x816d('0x55')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf['attrs'][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x40')]:undefined)||_0x816d('0x4b')},{'name':_0x816d('0x56'),'value':_0x3e1adf[_0x816d('0x56')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x1]?_0x3e1adf[_0x816d('0x3f')][0x1][_0x816d('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x3e1adf[_0x816d('0x57')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x2]?_0x3e1adf['attrs'][0x2]['value']:undefined)||null},{'name':_0x816d('0x4c'),'value':_0x3e1adf[_0x816d('0x4c')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x3]?_0x3e1adf[_0x816d('0x3f')][0x3][_0x816d('0x40')]:undefined)||[]},{'name':_0x816d('0x4e'),'value':_0x3e1adf[_0x816d('0x4e')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x4]?_0x3e1adf[_0x816d('0x3f')][0x4][_0x816d('0x40')]:undefined)||'voice'},{'name':_0x816d('0x50'),'value':_0x3e1adf[_0x816d('0x50')]||(_0x3e1adf['attrs']&&_0x3e1adf['attrs'][0x5]?_0x3e1adf[_0x816d('0x3f')][0x5][_0x816d('0x40')]:undefined)||''},{'name':_0x816d('0x51'),'value':_0x3e1adf[_0x816d('0x51')]||(_0x3e1adf['attrs']&&_0x3e1adf[_0x816d('0x3f')][0x6]?_0x3e1adf[_0x816d('0x3f')][0x6][_0x816d('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3e1adf[_0x816d('0x52')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf['attrs'][0x7]?_0x3e1adf[_0x816d('0x3f')][0x7][_0x816d('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3e1adf[_0x816d('0x53')]||(_0x3e1adf['attrs']&&_0x3e1adf['attrs'][0x8]?_0x3e1adf['attrs'][0x8]['value']:undefined)||''},{'name':_0x816d('0x58'),'value':_0x3e1adf[_0x816d('0x58')]||(_0x3e1adf['attrs']&&_0x3e1adf[_0x816d('0x3f')][0x9]?_0x3e1adf[_0x816d('0x3f')][0x9][_0x816d('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3e1adf[_0x816d('0x54')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0xa]?_0x3e1adf[_0x816d('0x3f')][0xa]['value']:undefined)||''}];case _0x816d('0x59'):return[{'name':_0x816d('0x5a'),'type':_0x3e1adf[_0x816d('0x5b')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x3c')]:undefined)||null,'value':_0x3e1adf[_0x816d('0x5a')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x0]?_0x3e1adf[_0x816d('0x3f')][0x0][_0x816d('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x3e1adf[_0x816d('0x5c')]||(_0x3e1adf[_0x816d('0x3f')]&&_0x3e1adf[_0x816d('0x3f')][0x1]?_0x3e1adf['attrs'][0x1][_0x816d('0x40')]:undefined)||0x0}];default:return[];}}catch(_0xb5b5d6){logger[_0x816d('0x5d')](_0x816d('0x5e'),JSON['stringify'](_0xb5b5d6));return[];}}exports[_0x816d('0x5f')]=function(_0x2764a2,_0x331e10){if(_0x2764a2[_0x816d('0x60')]){_0x2764a2[_0x816d('0x60')]['attrs']=widgetAttributes(_0x2764a2['body']);}return db[_0x816d('0x39')][_0x816d('0x5f')](_0x2764a2[_0x816d('0x60')],{})[_0x816d('0x2a')](respondWithResult(_0x331e10,0xc9))[_0x816d('0x3b')](handleError(_0x331e10,null));};exports[_0x816d('0x29')]=function(_0x5513ad,_0x483046){if(_0x5513ad['body']['id']){delete _0x5513ad[_0x816d('0x60')]['id'];}_0x5513ad[_0x816d('0x60')][_0x816d('0x3f')]=widgetAttributes(_0x5513ad[_0x816d('0x60')]);return db[_0x816d('0x39')]['find']({'where':{'id':_0x5513ad['params']['id']}})[_0x816d('0x2a')](handleEntityNotFound(_0x483046,null))[_0x816d('0x2a')](saveUpdates(_0x5513ad[_0x816d('0x60')],null))[_0x816d('0x2a')](respondWithResult(_0x483046,null))[_0x816d('0x3b')](handleError(_0x483046,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2c8a18f..c856619 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 _0x007d=['hasOwnProperty','hook','exports','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0x36896c,_0x46f3b6){var _0x4baf6e=function(_0x54847d){while(--_0x54847d){_0x36896c['push'](_0x36896c['shift']());}};_0x4baf6e(++_0x46f3b6);}(_0x007d,0xff));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xd007('0x0'))['db'][_0xd007('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd007('0x2')](0x0);var events={'afterCreate':_0xd007('0x3'),'afterUpdate':'update','afterDestroy':_0xd007('0x4')};function emitEvent(_0x3ca797){return function(_0xd29a1,_0x3cb5e8,_0x7e6b8d){DashboardItemEvents[_0xd007('0x5')](_0x3ca797+':'+_0xd29a1['id'],_0xd29a1);DashboardItemEvents[_0xd007('0x5')](_0x3ca797,_0xd29a1);_0x7e6b8d(null);};}for(var e in events){if(events[_0xd007('0x6')](e)){var event=events[e];DashboardItem[_0xd007('0x7')](e,emitEvent(event));}}module[_0xd007('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x7ef1=['save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1e05d1,_0x146a44){var _0x468192=function(_0x27d0e9){while(--_0x27d0e9){_0x1e05d1['push'](_0x1e05d1['shift']());}};_0x468192(++_0x146a44);}(_0x7ef1,0x12d));var _0x17ef=function(_0x2dd7b0,_0x1e9cae){_0x2dd7b0=_0x2dd7b0-0x0;var _0x39139c=_0x7ef1[_0x2dd7b0];return _0x39139c;};'use strict';var EventEmitter=require(_0x17ef('0x0'));var DashboardItem=require(_0x17ef('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x17ef('0x2')](0x0);var events={'afterCreate':_0x17ef('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b5068){return function(_0x2ff49b,_0x3263ad,_0x3a225c){DashboardItemEvents[_0x17ef('0x4')](_0x1b5068+':'+_0x2ff49b['id'],_0x2ff49b);DashboardItemEvents[_0x17ef('0x4')](_0x1b5068,_0x2ff49b);_0x3a225c(null);};}for(var e in events){if(events[_0x17ef('0x5')](e)){var event=events[e];DashboardItem[_0x17ef('0x6')](e,emitEvent(event));}}module[_0x17ef('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 61a487e..b3cf46f 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 _0x7d28=['util','../../config/logger','api','moment','bluebird','path','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash'];(function(_0x457766,_0x39f036){var _0x2ad888=function(_0x335c30){while(--_0x335c30){_0x457766['push'](_0x457766['shift']());}};_0x2ad888(++_0x39f036);}(_0x7d28,0x112));var _0x87d2=function(_0x52ed6e,_0x10a030){_0x52ed6e=_0x52ed6e-0x0;var _0x582f08=_0x7d28[_0x52ed6e];return _0x582f08;};'use strict';var _=require(_0x87d2('0x0'));var util=require(_0x87d2('0x1'));var logger=require(_0x87d2('0x2'))(_0x87d2('0x3'));var moment=require(_0x87d2('0x4'));var BPromise=require(_0x87d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x87d2('0x7'));module['exports']=function(_0x15bfa4,_0x16bb80){return _0x15bfa4[_0x87d2('0x8')](_0x87d2('0x9'),attributes,{'tableName':_0x87d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92fb=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','api','bluebird','request-promise','path'];(function(_0x3f9d5d,_0x4ee8dd){var _0x1b2cd7=function(_0x380e51){while(--_0x380e51){_0x3f9d5d['push'](_0x3f9d5d['shift']());}};_0x1b2cd7(++_0x4ee8dd);}(_0x92fb,0x1b3));var _0xb92f=function(_0x528511,_0x815fd3){_0x528511=_0x528511-0x0;var _0xd1b2b7=_0x92fb[_0x528511];return _0xd1b2b7;};'use strict';var _=require('lodash');var util=require(_0xb92f('0x0'));var logger=require('../../config/logger')(_0xb92f('0x1'));var moment=require('moment');var BPromise=require(_0xb92f('0x2'));var rp=require(_0xb92f('0x3'));var fs=require('fs');var path=require(_0xb92f('0x4'));var rimraf=require('rimraf');var config=require(_0xb92f('0x5'));var attributes=require(_0xb92f('0x6'));module[_0xb92f('0x7')]=function(_0x4dfa40,_0x2f7314){return _0x4dfa40[_0xb92f('0x8')](_0xb92f('0x9'),attributes,{'tableName':'dashboard_items','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 4c11c19..4cf9f3d 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 _0xbbb3=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','socket.io-emitter','redis','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x596363,_0x951078){var _0x4f514a=function(_0x3719a7){while(--_0x3719a7){_0x596363['push'](_0x596363['shift']());}};_0x4f514a(++_0x951078);}(_0xbbb3,0x19b));var _0x3bbb=function(_0x11220a,_0x250683){_0x11220a=_0x11220a-0x0;var _0xee0a0=_0xbbb3[_0x11220a];return _0xee0a0;};'use strict';var _=require('lodash');var util=require(_0x3bbb('0x0'));var moment=require('moment');var BPromise=require(_0x3bbb('0x1'));var rs=require(_0x3bbb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bbb('0x3'))['db'];var utils=require(_0x3bbb('0x4'));var logger=require(_0x3bbb('0x5'))('rpc');var config=require(_0x3bbb('0x6'));var jayson=require(_0x3bbb('0x7'));var client=jayson[_0x3bbb('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3bbb('0x9'))(new Redis(config[_0x3bbb('0xa')]));require('./dashboardItem.socket')[_0x3bbb('0xb')](socket);function respondWithRpcPromise(_0x413fda,_0x94ce5e,_0x1d44c2){return new BPromise(function(_0x17ee84,_0x4df585){return client[_0x3bbb('0xc')](_0x413fda,_0x1d44c2)['then'](function(_0x581737){logger[_0x3bbb('0xd')](_0x3bbb('0xe'),_0x94ce5e,_0x3bbb('0xf'));logger[_0x3bbb('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x94ce5e,'request\x20sent',JSON[_0x3bbb('0x11')](_0x581737));if(_0x581737[_0x3bbb('0x12')]){if(_0x581737[_0x3bbb('0x12')][_0x3bbb('0x13')]===0x1f4){logger[_0x3bbb('0x12')](_0x3bbb('0xe'),_0x94ce5e,_0x581737['error'][_0x3bbb('0x14')]);return _0x4df585(_0x581737[_0x3bbb('0x12')]['message']);}logger['error'](_0x3bbb('0xe'),_0x94ce5e,_0x581737['error'][_0x3bbb('0x14')]);return _0x17ee84(_0x581737['error'][_0x3bbb('0x14')]);}else{logger['info'](_0x3bbb('0xe'),_0x94ce5e,_0x3bbb('0xf'));_0x17ee84(_0x581737[_0x3bbb('0x15')][_0x3bbb('0x14')]);}})[_0x3bbb('0x16')](function(_0x342f35){logger[_0x3bbb('0x12')](_0x3bbb('0xe'),_0x94ce5e,_0x342f35);_0x4df585(_0x342f35);});});} \ No newline at end of file +var _0xc283=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xaad974,_0x396049){var _0x3801e9=function(_0x21bfc3){while(--_0x21bfc3){_0xaad974['push'](_0xaad974['shift']());}};_0x3801e9(++_0x396049);}(_0xc283,0x107));var _0x3c28=function(_0x429a71,_0x1ef71e){_0x429a71=_0x429a71-0x0;var _0x23a1e9=_0xc283[_0x429a71];return _0x23a1e9;};'use strict';var _=require('lodash');var util=require(_0x3c28('0x0'));var moment=require(_0x3c28('0x1'));var BPromise=require(_0x3c28('0x2'));var rs=require(_0x3c28('0x3'));var fs=require('fs');var Redis=require(_0x3c28('0x4'));var db=require(_0x3c28('0x5'))['db'];var utils=require(_0x3c28('0x6'));var logger=require(_0x3c28('0x7'))(_0x3c28('0x8'));var config=require(_0x3c28('0x9'));var jayson=require(_0x3c28('0xa'));var client=jayson[_0x3c28('0xb')][_0x3c28('0xc')]({'port':0x232a});config[_0x3c28('0xd')]=_[_0x3c28('0xe')](config[_0x3c28('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c28('0xf'))(new Redis(config[_0x3c28('0xd')]));require('./dashboardItem.socket')[_0x3c28('0x10')](socket);function respondWithRpcPromise(_0x578d74,_0x3d07b2,_0x334ec1){return new BPromise(function(_0x3f733b,_0x209d08){return client[_0x3c28('0x11')](_0x578d74,_0x334ec1)['then'](function(_0x3c1fa3){logger[_0x3c28('0x12')](_0x3c28('0x13'),_0x3d07b2,'request\x20sent');logger[_0x3c28('0x14')](_0x3c28('0x15'),_0x3d07b2,_0x3c28('0x16'),JSON['stringify'](_0x3c1fa3));if(_0x3c1fa3['error']){if(_0x3c1fa3['error']['code']===0x1f4){logger[_0x3c28('0x17')]('DashboardItem,\x20%s,\x20%s',_0x3d07b2,_0x3c1fa3[_0x3c28('0x17')][_0x3c28('0x18')]);return _0x209d08(_0x3c1fa3['error'][_0x3c28('0x18')]);}logger[_0x3c28('0x17')](_0x3c28('0x13'),_0x3d07b2,_0x3c1fa3['error'][_0x3c28('0x18')]);return _0x3f733b(_0x3c1fa3['error'][_0x3c28('0x18')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x3d07b2,_0x3c28('0x16'));_0x3f733b(_0x3c1fa3[_0x3c28('0x19')][_0x3c28('0x18')]);}})[_0x3c28('0x1a')](function(_0x5f410e){logger[_0x3c28('0x17')]('DashboardItem,\x20%s,\x20%s',_0x3d07b2,_0x5f410e);_0x209d08(_0x5f410e);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 5b08fd7..b847127 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 _0xb77e=['save','remove','update','emit','removeListener','register','length','dashboardItem:'];(function(_0x281784,_0x171733){var _0x211035=function(_0x17ab0d){while(--_0x17ab0d){_0x281784['push'](_0x281784['shift']());}};_0x211035(++_0x171733);}(_0xb77e,0xb8));var _0xeb77=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb77e[_0x501510];return _0x1e6ee5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xeb77('0x0'),_0xeb77('0x1'),_0xeb77('0x2')];function createListener(_0x5aae3b,_0x432f08){return function(_0x101ca8){_0x432f08[_0xeb77('0x3')](_0x5aae3b,_0x101ca8);};}function removeListener(_0x574d3e,_0x169f15){return function(){DashboardItemEvents[_0xeb77('0x4')](_0x574d3e,_0x169f15);};}exports[_0xeb77('0x5')]=function(_0x9ae693){for(var _0x3e5f66=0x0,_0xc185fb=events[_0xeb77('0x6')];_0x3e5f66<_0xc185fb;_0x3e5f66++){var _0x37281d=events[_0x3e5f66];var _0x1f970e=createListener(_0xeb77('0x7')+_0x37281d,_0x9ae693);DashboardItemEvents['on'](_0x37281d,_0x1f970e);}}; \ No newline at end of file +var _0xd915=['register','dashboardItem:','save','remove','update','emit','removeListener'];(function(_0xa861aa,_0x2895a4){var _0x1e34de=function(_0x41ed53){while(--_0x41ed53){_0xa861aa['push'](_0xa861aa['shift']());}};_0x1e34de(++_0x2895a4);}(_0xd915,0x8e));var _0x5d91=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xd915[_0x4b2863];return _0x567d67;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x5d91('0x0'),_0x5d91('0x1'),_0x5d91('0x2')];function createListener(_0x5b69de,_0x5b8126){return function(_0x348a3e){_0x5b8126[_0x5d91('0x3')](_0x5b69de,_0x348a3e);};}function removeListener(_0x29dbb6,_0x3b8a58){return function(){DashboardItemEvents[_0x5d91('0x4')](_0x29dbb6,_0x3b8a58);};}exports[_0x5d91('0x5')]=function(_0x2aa485){for(var _0x2d976d=0x0,_0x4b8eb3=events['length'];_0x2d976d<_0x4b8eb3;_0x2d976d++){var _0x44dc07=events[_0x2d976d];var _0x3cf741=createListener(_0x5d91('0x6')+_0x44dc07,_0x2aa485);DashboardItemEvents['on'](_0x44dc07,_0x3cf741);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 886a198..2362963 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 _0x75f7=['destroy','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','update','delete'];(function(_0x3cb2e7,_0x54db4c){var _0x39308c=function(_0x1e8381){while(--_0x1e8381){_0x3cb2e7['push'](_0x3cb2e7['shift']());}};_0x39308c(++_0x54db4c);}(_0x75f7,0x7f));var _0x775f=function(_0x40025c,_0x4115f1){_0x40025c=_0x40025c-0x0;var _0x57bb0c=_0x75f7[_0x40025c];return _0x57bb0c;};'use strict';var multer=require('multer');var util=require(_0x775f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x775f('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x775f('0x2'));var interaction=require(_0x775f('0x3'));var config=require(_0x775f('0x4'));var controller=require(_0x775f('0x5'));router[_0x775f('0x6')](_0x775f('0x7'),auth[_0x775f('0x8')](),controller[_0x775f('0x9')]);router['post']('/',auth[_0x775f('0x8')](),controller[_0x775f('0xa')]);router['put']('/:id',auth[_0x775f('0x8')](),controller[_0x775f('0xb')]);router[_0x775f('0xc')](_0x775f('0x7'),auth[_0x775f('0x8')](),controller[_0x775f('0xd')]);module['exports']=router; \ No newline at end of file +var _0x2c4b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0x2c4b,0x92));var _0xb2c4=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x2c4b[_0x585d81];return _0x1aca0d;};'use strict';var multer=require(_0xb2c4('0x0'));var util=require(_0xb2c4('0x1'));var path=require(_0xb2c4('0x2'));var timeout=require(_0xb2c4('0x3'));var express=require(_0xb2c4('0x4'));var router=express['Router']();var fs_extra=require(_0xb2c4('0x5'));var auth=require(_0xb2c4('0x6'));var interaction=require(_0xb2c4('0x7'));var config=require(_0xb2c4('0x8'));var controller=require(_0xb2c4('0x9'));router[_0xb2c4('0xa')](_0xb2c4('0xb'),auth[_0xb2c4('0xc')](),controller[_0xb2c4('0xd')]);router[_0xb2c4('0xe')]('/',auth[_0xb2c4('0xc')](),controller[_0xb2c4('0xf')]);router['put'](_0xb2c4('0xb'),auth[_0xb2c4('0xc')](),controller[_0xb2c4('0x10')]);router[_0xb2c4('0x11')]('/:id',auth[_0xb2c4('0xc')](),controller[_0xb2c4('0x12')]);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 62b38e0..0d08eb8 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 _0xea97=['first','sequelize','exports','STRING','ENUM','second'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0xea97,0x151));var _0x7ea9=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xea97[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x7ea9('0x0'));module[_0x7ea9('0x1')]={'name':{'type':Sequelize[_0x7ea9('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x7ea9('0x3')]('first',_0x7ea9('0x4'),'third'),'allowNull':![],'defaultValue':_0x7ea9('0x5')},'description':{'type':Sequelize[_0x7ea9('0x2')]}}; \ No newline at end of file +var _0xcd04=['STRING','ENUM','first','second','third','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xcd04,0x1e5));var _0x4cd0=function(_0x498633,_0x3c095a){_0x498633=_0x498633-0x0;var _0x56e3fe=_0xcd04[_0x498633];return _0x56e3fe;};'use strict';var Sequelize=require('sequelize');module[_0x4cd0('0x0')]={'name':{'type':Sequelize[_0x4cd0('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x4cd0('0x2')](_0x4cd0('0x3'),_0x4cd0('0x4'),_0x4cd0('0x5')),'allowNull':![],'defaultValue':_0x4cd0('0x3')},'description':{'type':Sequelize[_0x4cd0('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d92d0da..6ada12c 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 _0xe397=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','Content-Range','reject','then','destroy','get','Dispositions','sendStatus','error','stack','name','send','index','Disposition','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','catch','params','keys','includeAll','find'];(function(_0x5e6be5,_0xf2805c){var _0x3e6e05=function(_0x5a5bb2){while(--_0x5a5bb2){_0x5e6be5['push'](_0x5e6be5['shift']());}};_0x3e6e05(++_0xf2805c);}(_0xe397,0xac));var _0x7e39=function(_0x59947d,_0x27ad58){_0x59947d=_0x59947d-0x0;var _0x4b59e0=_0xe397[_0x59947d];return _0x4b59e0;};'use strict';var emlformat=require(_0x7e39('0x0'));var rimraf=require(_0x7e39('0x1'));var zipdir=require(_0x7e39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e39('0x3'));var moment=require(_0x7e39('0x4'));var BPromise=require(_0x7e39('0x5'));var Mustache=require(_0x7e39('0x6'));var util=require(_0x7e39('0x7'));var path=require(_0x7e39('0x8'));var sox=require('sox');var csv=require(_0x7e39('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e39('0xa'));var _=require(_0x7e39('0xb'));var squel=require(_0x7e39('0xc'));var crypto=require('crypto');var jsforce=require(_0x7e39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7e39('0x9'));var querystring=require(_0x7e39('0xe'));var Papa=require(_0x7e39('0xf'));var Redis=require(_0x7e39('0x10'));var authService=require(_0x7e39('0x11'));var qs=require(_0x7e39('0x12'));var as=require(_0x7e39('0x13'));var hardwareService=require(_0x7e39('0x14'));var logger=require('../../config/logger')(_0x7e39('0x15'));var utils=require(_0x7e39('0x16'));var config=require(_0x7e39('0x17'));var licenseUtil=require(_0x7e39('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a7b39,_0x5738ed){_0x5738ed=_0x5738ed||0xcc;return function(_0x279bd1){if(_0x279bd1){return _0x4a7b39['sendStatus'](_0x5738ed);}return _0x4a7b39[_0x7e39('0x19')](_0x5738ed)['end']();};}function respondWithResult(_0x31b3fd,_0x5210d3){_0x5210d3=_0x5210d3||0xc8;return function(_0xf7e9af){if(_0xf7e9af){return _0x31b3fd[_0x7e39('0x19')](_0x5210d3)[_0x7e39('0x1a')](_0xf7e9af);}};}function respondWithFilteredResult(_0x276f09,_0x31b73f){return function(_0x4be7e0){if(_0x4be7e0){var _0x425b68=typeof _0x31b73f[_0x7e39('0x1b')]===_0x7e39('0x1c')&&typeof _0x31b73f['limit']===_0x7e39('0x1c');var _0x26eb46=_0x4be7e0['count'];var _0x4918ea=_0x425b68?0x0:_0x31b73f[_0x7e39('0x1b')];var _0x5bc780=_0x425b68?_0x4be7e0[_0x7e39('0x1d')]:_0x31b73f['offset']+_0x31b73f[_0x7e39('0x1e')];var _0x45a085;if(_0x5bc780>=_0x26eb46){_0x5bc780=_0x26eb46;_0x45a085=0xc8;}else{_0x45a085=0xce;}_0x276f09[_0x7e39('0x19')](_0x45a085);return _0x276f09['set'](_0x7e39('0x1f'),_0x4918ea+'-'+_0x5bc780+'/'+_0x26eb46)[_0x7e39('0x1a')](_0x4be7e0);}return null;};}function patchUpdates(_0x345eca){return function(_0x61b10d){try{jsonpatch['apply'](_0x61b10d,_0x345eca,!![]);}catch(_0x7ccfd7){return BPromise[_0x7e39('0x20')](_0x7ccfd7);}return _0x61b10d['save']();};}function saveUpdates(_0x5b8435,_0x568572){return function(_0x5c65e5){if(_0x5c65e5){return _0x5c65e5['update'](_0x5b8435)[_0x7e39('0x21')](function(_0x410e7b){return _0x410e7b;});}return null;};}function removeEntity(_0x31e74c,_0x58bbe5){return function(_0x4df0dd){if(_0x4df0dd){return _0x4df0dd[_0x7e39('0x22')]()[_0x7e39('0x21')](function(){var _0x11e7ae=_0x4df0dd[_0x7e39('0x23')]({'plain':!![]});var _0x4a1a47=_0x7e39('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a1a47,'resourceId':_0x11e7ae['id']}})[_0x7e39('0x21')](function(){return _0x4df0dd;});})[_0x7e39('0x21')](function(){_0x31e74c[_0x7e39('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d6d02,_0x587687){return function(_0x338d9c){if(!_0x338d9c){_0x3d6d02[_0x7e39('0x25')](0x194);}return _0x338d9c;};}function handleError(_0x58223f,_0x1fe467){_0x1fe467=_0x1fe467||0x1f4;return function(_0x30c66e){logger[_0x7e39('0x26')](_0x30c66e[_0x7e39('0x27')]);if(_0x30c66e['name']){delete _0x30c66e[_0x7e39('0x28')];}_0x58223f[_0x7e39('0x19')](_0x1fe467)[_0x7e39('0x29')](_0x30c66e);};}exports[_0x7e39('0x2a')]=function(_0x45e6d3,_0x5b81a0){var _0x242f56={},_0x1d459f={},_0x1c117a={'count':0x0,'rows':[]};var _0x369fe9=_['map'](db[_0x7e39('0x2b')]['rawAttributes'],function(_0x4f7cb7){return{'name':_0x4f7cb7[_0x7e39('0x2c')],'type':_0x4f7cb7[_0x7e39('0x2d')][_0x7e39('0x2e')]};});_0x1d459f[_0x7e39('0x2f')]=_[_0x7e39('0x30')](_0x369fe9,_0x7e39('0x28'));_0x1d459f[_0x7e39('0x31')]=_['keys'](_0x45e6d3[_0x7e39('0x31')]);_0x1d459f[_0x7e39('0x32')]=_['intersection'](_0x1d459f[_0x7e39('0x2f')],_0x1d459f[_0x7e39('0x31')]);_0x242f56[_0x7e39('0x33')]=_[_0x7e39('0x34')](_0x1d459f[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0x45e6d3[_0x7e39('0x31')][_0x7e39('0x35')]));_0x242f56[_0x7e39('0x33')]=_0x242f56[_0x7e39('0x33')][_0x7e39('0x36')]?_0x242f56[_0x7e39('0x33')]:_0x1d459f[_0x7e39('0x2f')];if(!_0x45e6d3[_0x7e39('0x31')][_0x7e39('0x37')](_0x7e39('0x38'))){_0x242f56[_0x7e39('0x1e')]=qs[_0x7e39('0x1e')](_0x45e6d3['query'][_0x7e39('0x1e')]);_0x242f56['offset']=qs['offset'](_0x45e6d3['query'][_0x7e39('0x1b')]);}_0x242f56[_0x7e39('0x39')]=qs['sort'](_0x45e6d3[_0x7e39('0x31')][_0x7e39('0x3a')]);_0x242f56[_0x7e39('0x3b')]=qs[_0x7e39('0x32')](_[_0x7e39('0x3c')](_0x45e6d3[_0x7e39('0x31')],_0x1d459f[_0x7e39('0x32')]),_0x369fe9);if(_0x45e6d3[_0x7e39('0x31')]['filter']){_0x242f56[_0x7e39('0x3b')]=_[_0x7e39('0x3d')](_0x242f56[_0x7e39('0x3b')],{'$or':_[_0x7e39('0x30')](_0x369fe9,function(_0x38b8fc){if(_0x38b8fc[_0x7e39('0x2d')]!==_0x7e39('0x3e')){var _0x14fc01={};_0x14fc01[_0x38b8fc[_0x7e39('0x28')]]={'$like':'%'+_0x45e6d3[_0x7e39('0x31')][_0x7e39('0x3f')]+'%'};return _0x14fc01;}})});}_0x242f56=_[_0x7e39('0x3d')]({},_0x242f56,_0x45e6d3[_0x7e39('0x40')]);var _0x6cf9f3={'where':_0x242f56[_0x7e39('0x3b')]};return db['Disposition'][_0x7e39('0x1d')](_0x6cf9f3)[_0x7e39('0x21')](function(_0xdb46eb){_0x1c117a[_0x7e39('0x1d')]=_0xdb46eb;if(_0x45e6d3[_0x7e39('0x31')]['includeAll']){_0x242f56[_0x7e39('0x41')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x242f56);})[_0x7e39('0x21')](function(_0xe7cfc3){_0x1c117a['rows']=_0xe7cfc3;return _0x1c117a;})[_0x7e39('0x21')](respondWithFilteredResult(_0x5b81a0,_0x242f56))[_0x7e39('0x42')](handleError(_0x5b81a0,null));};exports['show']=function(_0x5ca526,_0x59e57d){var _0x2b090c={'raw':!![],'where':{'id':_0x5ca526[_0x7e39('0x43')]['id']}},_0x3e6cf5={};_0x3e6cf5[_0x7e39('0x2f')]=_[_0x7e39('0x44')](db[_0x7e39('0x2b')]['rawAttributes']);_0x3e6cf5[_0x7e39('0x31')]=_[_0x7e39('0x44')](_0x5ca526[_0x7e39('0x31')]);_0x3e6cf5[_0x7e39('0x32')]=_['intersection'](_0x3e6cf5[_0x7e39('0x2f')],_0x3e6cf5[_0x7e39('0x31')]);_0x2b090c['attributes']=_[_0x7e39('0x34')](_0x3e6cf5[_0x7e39('0x2f')],qs[_0x7e39('0x35')](_0x5ca526[_0x7e39('0x31')]['fields']));_0x2b090c[_0x7e39('0x33')]=_0x2b090c[_0x7e39('0x33')][_0x7e39('0x36')]?_0x2b090c['attributes']:_0x3e6cf5['model'];if(_0x5ca526['query'][_0x7e39('0x45')]){_0x2b090c[_0x7e39('0x41')]=[{'all':!![]}];}_0x2b090c=_[_0x7e39('0x3d')]({},_0x2b090c,_0x5ca526[_0x7e39('0x40')]);return db[_0x7e39('0x2b')][_0x7e39('0x46')](_0x2b090c)[_0x7e39('0x21')](handleEntityNotFound(_0x59e57d,null))['then'](respondWithResult(_0x59e57d,null))[_0x7e39('0x42')](handleError(_0x59e57d,null));};exports[_0x7e39('0x47')]=function(_0x6d2728,_0x7e1394){return db[_0x7e39('0x2b')][_0x7e39('0x47')](_0x6d2728[_0x7e39('0x48')],{})[_0x7e39('0x21')](function(_0x1a4710){var _0x5735ae=_0x6d2728[_0x7e39('0x49')][_0x7e39('0x23')]({'plain':!![]});if(!_0x5735ae)throw new Error(_0x7e39('0x4a'));if(_0x5735ae[_0x7e39('0x4b')]==='user'){var _0x317af1=_0x1a4710['get']({'plain':!![]});var _0x1b8c5a=_0x7e39('0x24');return db[_0x7e39('0x4c')][_0x7e39('0x46')]({'where':{'name':_0x1b8c5a,'userProfileId':_0x5735ae['userProfileId']},'raw':!![]})[_0x7e39('0x21')](function(_0x30124c){if(_0x30124c&&_0x30124c[_0x7e39('0x4d')]===0x0){return db[_0x7e39('0x4e')][_0x7e39('0x47')]({'name':_0x317af1['name'],'resourceId':_0x317af1['id'],'type':_0x30124c[_0x7e39('0x28')],'sectionId':_0x30124c['id']},{})[_0x7e39('0x21')](function(){return _0x1a4710;});}else{return _0x1a4710;}})[_0x7e39('0x42')](function(_0x22c4d6){logger[_0x7e39('0x26')](_0x7e39('0x4f'),_0x22c4d6);throw _0x22c4d6;});}return _0x1a4710;})[_0x7e39('0x21')](respondWithResult(_0x7e1394,0xc9))[_0x7e39('0x42')](handleError(_0x7e1394,null));};exports[_0x7e39('0x50')]=function(_0x4e7929,_0x1c6e0f){if(_0x4e7929['body']['id']){delete _0x4e7929[_0x7e39('0x48')]['id'];}return db[_0x7e39('0x2b')]['find']({'where':{'id':_0x4e7929[_0x7e39('0x43')]['id']}})[_0x7e39('0x21')](handleEntityNotFound(_0x1c6e0f,null))['then'](saveUpdates(_0x4e7929[_0x7e39('0x48')],null))[_0x7e39('0x21')](respondWithResult(_0x1c6e0f,null))['catch'](handleError(_0x1c6e0f,null));};exports[_0x7e39('0x22')]=function(_0x5240f8,_0x8c3ef){return db[_0x7e39('0x2b')][_0x7e39('0x46')]({'where':{'id':_0x5240f8[_0x7e39('0x43')]['id']}})[_0x7e39('0x21')](handleEntityNotFound(_0x8c3ef,null))[_0x7e39('0x21')](removeEntity(_0x8c3ef,null))[_0x7e39('0x42')](handleError(_0x8c3ef,null));}; \ No newline at end of file +var _0x9a14=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','name','send','map','Disposition','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','find','params'];(function(_0x1325fb,_0xa9c76e){var _0x52712c=function(_0x15a56d){while(--_0x15a56d){_0x1325fb['push'](_0x1325fb['shift']());}};_0x52712c(++_0xa9c76e);}(_0x9a14,0xa8));var _0x49a1=function(_0x25dfe1,_0x5d385b){_0x25dfe1=_0x25dfe1-0x0;var _0x2464b7=_0x9a14[_0x25dfe1];return _0x2464b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49a1('0x0'));var jsonpatch=require(_0x49a1('0x1'));var rp=require(_0x49a1('0x2'));var moment=require(_0x49a1('0x3'));var BPromise=require(_0x49a1('0x4'));var Mustache=require(_0x49a1('0x5'));var util=require(_0x49a1('0x6'));var path=require(_0x49a1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x49a1('0x8'));var squel=require(_0x49a1('0x9'));var crypto=require(_0x49a1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x49a1('0xb'));var toCsv=require(_0x49a1('0xc'));var querystring=require(_0x49a1('0xd'));var Papa=require('papaparse');var Redis=require(_0x49a1('0xe'));var authService=require(_0x49a1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x49a1('0x10'));var hardwareService=require(_0x49a1('0x11'));var logger=require(_0x49a1('0x12'))(_0x49a1('0x13'));var utils=require(_0x49a1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x49a1('0x15'));var db=require(_0x49a1('0x16'))['db'];function respondWithStatusCode(_0x380db3,_0x58101a){_0x58101a=_0x58101a||0xcc;return function(_0x20138b){if(_0x20138b){return _0x380db3[_0x49a1('0x17')](_0x58101a);}return _0x380db3[_0x49a1('0x18')](_0x58101a)[_0x49a1('0x19')]();};}function respondWithResult(_0x35f2fd,_0x6bce27){_0x6bce27=_0x6bce27||0xc8;return function(_0x278713){if(_0x278713){return _0x35f2fd[_0x49a1('0x18')](_0x6bce27)[_0x49a1('0x1a')](_0x278713);}};}function respondWithFilteredResult(_0x39676e,_0x13fe24){return function(_0x5c6d06){if(_0x5c6d06){var _0x27dff1=typeof _0x13fe24[_0x49a1('0x1b')]===_0x49a1('0x1c')&&typeof _0x13fe24['limit']===_0x49a1('0x1c');var _0x7b53dc=_0x5c6d06['count'];var _0xd93b68=_0x27dff1?0x0:_0x13fe24['offset'];var _0x3c1352=_0x27dff1?_0x5c6d06[_0x49a1('0x1d')]:_0x13fe24['offset']+_0x13fe24[_0x49a1('0x1e')];var _0x508f32;if(_0x3c1352>=_0x7b53dc){_0x3c1352=_0x7b53dc;_0x508f32=0xc8;}else{_0x508f32=0xce;}_0x39676e[_0x49a1('0x18')](_0x508f32);return _0x39676e[_0x49a1('0x1f')](_0x49a1('0x20'),_0xd93b68+'-'+_0x3c1352+'/'+_0x7b53dc)['json'](_0x5c6d06);}return null;};}function patchUpdates(_0x15d7e6){return function(_0x37b66f){try{jsonpatch[_0x49a1('0x21')](_0x37b66f,_0x15d7e6,!![]);}catch(_0x286cb9){return BPromise[_0x49a1('0x22')](_0x286cb9);}return _0x37b66f[_0x49a1('0x23')]();};}function saveUpdates(_0x50aace,_0xe5c860){return function(_0x108d66){if(_0x108d66){return _0x108d66[_0x49a1('0x24')](_0x50aace)['then'](function(_0x12011d){return _0x12011d;});}return null;};}function removeEntity(_0x14a5bf,_0x28785d){return function(_0x4b4bf3){if(_0x4b4bf3){return _0x4b4bf3['destroy']()[_0x49a1('0x25')](function(){var _0x1ed188=_0x4b4bf3[_0x49a1('0x26')]({'plain':!![]});var _0x38c624=_0x49a1('0x27');return db[_0x49a1('0x28')][_0x49a1('0x29')]({'where':{'type':_0x38c624,'resourceId':_0x1ed188['id']}})['then'](function(){return _0x4b4bf3;});})[_0x49a1('0x25')](function(){_0x14a5bf[_0x49a1('0x18')](0xcc)[_0x49a1('0x19')]();});}};}function handleEntityNotFound(_0x2935d1,_0x20af10){return function(_0x1e3f21){if(!_0x1e3f21){_0x2935d1[_0x49a1('0x17')](0x194);}return _0x1e3f21;};}function handleError(_0x232289,_0x5b3842){_0x5b3842=_0x5b3842||0x1f4;return function(_0x3cd5ff){logger['error'](_0x3cd5ff['stack']);if(_0x3cd5ff['name']){delete _0x3cd5ff[_0x49a1('0x2a')];}_0x232289[_0x49a1('0x18')](_0x5b3842)[_0x49a1('0x2b')](_0x3cd5ff);};}exports['index']=function(_0x542be7,_0x22ddf9){var _0x30a265={},_0x330ec6={},_0x2a979c={'count':0x0,'rows':[]};var _0x1c3579=_[_0x49a1('0x2c')](db[_0x49a1('0x2d')][_0x49a1('0x2e')],function(_0x237b32){return{'name':_0x237b32[_0x49a1('0x2f')],'type':_0x237b32[_0x49a1('0x30')][_0x49a1('0x31')]};});_0x330ec6[_0x49a1('0x32')]=_[_0x49a1('0x2c')](_0x1c3579,_0x49a1('0x2a'));_0x330ec6['query']=_[_0x49a1('0x33')](_0x542be7['query']);_0x330ec6['filters']=_[_0x49a1('0x34')](_0x330ec6[_0x49a1('0x32')],_0x330ec6[_0x49a1('0x35')]);_0x30a265['attributes']=_[_0x49a1('0x34')](_0x330ec6[_0x49a1('0x32')],qs['fields'](_0x542be7['query'][_0x49a1('0x36')]));_0x30a265[_0x49a1('0x37')]=_0x30a265[_0x49a1('0x37')][_0x49a1('0x38')]?_0x30a265[_0x49a1('0x37')]:_0x330ec6[_0x49a1('0x32')];if(!_0x542be7[_0x49a1('0x35')][_0x49a1('0x39')](_0x49a1('0x3a'))){_0x30a265[_0x49a1('0x1e')]=qs[_0x49a1('0x1e')](_0x542be7[_0x49a1('0x35')][_0x49a1('0x1e')]);_0x30a265[_0x49a1('0x1b')]=qs[_0x49a1('0x1b')](_0x542be7[_0x49a1('0x35')]['offset']);}_0x30a265[_0x49a1('0x3b')]=qs[_0x49a1('0x3c')](_0x542be7['query'][_0x49a1('0x3c')]);_0x30a265['where']=qs[_0x49a1('0x3d')](_[_0x49a1('0x3e')](_0x542be7['query'],_0x330ec6[_0x49a1('0x3d')]),_0x1c3579);if(_0x542be7[_0x49a1('0x35')][_0x49a1('0x3f')]){_0x30a265[_0x49a1('0x40')]=_[_0x49a1('0x41')](_0x30a265[_0x49a1('0x40')],{'$or':_[_0x49a1('0x2c')](_0x1c3579,function(_0x247469){if(_0x247469[_0x49a1('0x30')]!==_0x49a1('0x42')){var _0x40b60d={};_0x40b60d[_0x247469[_0x49a1('0x2a')]]={'$like':'%'+_0x542be7[_0x49a1('0x35')][_0x49a1('0x3f')]+'%'};return _0x40b60d;}})});}_0x30a265=_[_0x49a1('0x41')]({},_0x30a265,_0x542be7[_0x49a1('0x43')]);var _0x12d742={'where':_0x30a265[_0x49a1('0x40')]};return db['Disposition'][_0x49a1('0x1d')](_0x12d742)[_0x49a1('0x25')](function(_0x7aa1bf){_0x2a979c[_0x49a1('0x1d')]=_0x7aa1bf;if(_0x542be7[_0x49a1('0x35')][_0x49a1('0x44')]){_0x30a265['include']=[{'all':!![]}];}return db[_0x49a1('0x2d')][_0x49a1('0x45')](_0x30a265);})[_0x49a1('0x25')](function(_0x5dddb8){_0x2a979c[_0x49a1('0x46')]=_0x5dddb8;return _0x2a979c;})['then'](respondWithFilteredResult(_0x22ddf9,_0x30a265))['catch'](handleError(_0x22ddf9,null));};exports[_0x49a1('0x47')]=function(_0x174fd8,_0x27bf5a){var _0x45e125={'raw':!![],'where':{'id':_0x174fd8['params']['id']}},_0x1295ca={};_0x1295ca[_0x49a1('0x32')]=_[_0x49a1('0x33')](db[_0x49a1('0x2d')][_0x49a1('0x2e')]);_0x1295ca['query']=_['keys'](_0x174fd8[_0x49a1('0x35')]);_0x1295ca[_0x49a1('0x3d')]=_['intersection'](_0x1295ca[_0x49a1('0x32')],_0x1295ca[_0x49a1('0x35')]);_0x45e125['attributes']=_[_0x49a1('0x34')](_0x1295ca[_0x49a1('0x32')],qs[_0x49a1('0x36')](_0x174fd8[_0x49a1('0x35')][_0x49a1('0x36')]));_0x45e125[_0x49a1('0x37')]=_0x45e125['attributes'][_0x49a1('0x38')]?_0x45e125['attributes']:_0x1295ca[_0x49a1('0x32')];if(_0x174fd8[_0x49a1('0x35')][_0x49a1('0x44')]){_0x45e125[_0x49a1('0x48')]=[{'all':!![]}];}_0x45e125=_[_0x49a1('0x41')]({},_0x45e125,_0x174fd8[_0x49a1('0x43')]);return db[_0x49a1('0x2d')]['find'](_0x45e125)[_0x49a1('0x25')](handleEntityNotFound(_0x27bf5a,null))[_0x49a1('0x25')](respondWithResult(_0x27bf5a,null))[_0x49a1('0x49')](handleError(_0x27bf5a,null));};exports[_0x49a1('0x4a')]=function(_0x57c3df,_0x6a35f6){return db[_0x49a1('0x2d')][_0x49a1('0x4a')](_0x57c3df[_0x49a1('0x4b')],{})[_0x49a1('0x25')](function(_0x37cc84){var _0x3730cd=_0x57c3df[_0x49a1('0x4c')][_0x49a1('0x26')]({'plain':!![]});if(!_0x3730cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3730cd[_0x49a1('0x4d')]===_0x49a1('0x4c')){var _0xd9a544=_0x37cc84[_0x49a1('0x26')]({'plain':!![]});var _0x295c0f=_0x49a1('0x27');return db[_0x49a1('0x4e')]['find']({'where':{'name':_0x295c0f,'userProfileId':_0x3730cd[_0x49a1('0x4f')]},'raw':!![]})['then'](function(_0x45a4be){if(_0x45a4be&&_0x45a4be[_0x49a1('0x50')]===0x0){return db[_0x49a1('0x28')][_0x49a1('0x4a')]({'name':_0xd9a544[_0x49a1('0x2a')],'resourceId':_0xd9a544['id'],'type':_0x45a4be[_0x49a1('0x2a')],'sectionId':_0x45a4be['id']},{})[_0x49a1('0x25')](function(){return _0x37cc84;});}else{return _0x37cc84;}})['catch'](function(_0x19c0d1){logger[_0x49a1('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19c0d1);throw _0x19c0d1;});}return _0x37cc84;})[_0x49a1('0x25')](respondWithResult(_0x6a35f6,0xc9))[_0x49a1('0x49')](handleError(_0x6a35f6,null));};exports[_0x49a1('0x24')]=function(_0x9919f4,_0x9b31ba){if(_0x9919f4['body']['id']){delete _0x9919f4[_0x49a1('0x4b')]['id'];}return db[_0x49a1('0x2d')][_0x49a1('0x52')]({'where':{'id':_0x9919f4[_0x49a1('0x53')]['id']}})[_0x49a1('0x25')](handleEntityNotFound(_0x9b31ba,null))[_0x49a1('0x25')](saveUpdates(_0x9919f4[_0x49a1('0x4b')],null))[_0x49a1('0x25')](respondWithResult(_0x9b31ba,null))[_0x49a1('0x49')](handleError(_0x9b31ba,null));};exports['destroy']=function(_0x3072e1,_0x37e33f){return db[_0x49a1('0x2d')]['find']({'where':{'id':_0x3072e1[_0x49a1('0x53')]['id']}})[_0x49a1('0x25')](handleEntityNotFound(_0x37e33f,null))[_0x49a1('0x25')](removeEntity(_0x37e33f,null))[_0x49a1('0x49')](handleError(_0x37e33f,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1b0f5d8..50bcd5b 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 _0x331c=['ChatWebsiteId','name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','request-promise','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId'];(function(_0x136315,_0x45411c){var _0x483132=function(_0x536af0){while(--_0x536af0){_0x136315['push'](_0x136315['shift']());}};_0x483132(++_0x45411c);}(_0x331c,0x148));var _0xc331=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x331c[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0xc331('0x0'));var logger=require(_0xc331('0x1'))(_0xc331('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc331('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc331('0x4'));var attributes=require(_0xc331('0x5'));module[_0xc331('0x6')]=function(_0xd0bb0,_0x192526){return _0xd0bb0[_0xc331('0x7')](_0xc331('0x8'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xc331('0x9'),'fields':[_0xc331('0xa'),_0xc331('0xb')]},{'unique':!![],'name':'name_chat','fields':['name',_0xc331('0xc')]},{'unique':!![],'name':_0xc331('0xd'),'fields':[_0xc331('0xa'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0xc331('0xe')]},{'unique':!![],'name':_0xc331('0xf'),'fields':[_0xc331('0xa'),_0xc331('0x10')]},{'unique':!![],'name':_0xc331('0x11'),'fields':[_0xc331('0xa'),_0xc331('0x12')]},{'unique':!![],'name':_0xc331('0x13'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x17e2=['MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','path','../../config/environment','./disposition.attributes','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId'];(function(_0x1bbf32,_0x3b785a){var _0x1a58ae=function(_0x597a3d){while(--_0x597a3d){_0x1bbf32['push'](_0x1bbf32['shift']());}};_0x1a58ae(++_0x3b785a);}(_0x17e2,0x181));var _0x217e=function(_0x30d5c3,_0x59f7a1){_0x30d5c3=_0x30d5c3-0x0;var _0x4766ea=_0x17e2[_0x30d5c3];return _0x4766ea;};'use strict';var _=require(_0x217e('0x0'));var util=require(_0x217e('0x1'));var logger=require(_0x217e('0x2'))(_0x217e('0x3'));var moment=require(_0x217e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x217e('0x5'));var rimraf=require('rimraf');var config=require(_0x217e('0x6'));var attributes=require(_0x217e('0x7'));module['exports']=function(_0x2ccf29,_0x35ce27){return _0x2ccf29['define'](_0x217e('0x8'),attributes,{'tableName':_0x217e('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x217e('0xa')]},{'unique':!![],'name':_0x217e('0xb'),'fields':[_0x217e('0xc'),_0x217e('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x217e('0xc'),_0x217e('0xe')]},{'unique':!![],'name':_0x217e('0xf'),'fields':[_0x217e('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x217e('0x10'),'fields':[_0x217e('0xc'),_0x217e('0x11')]},{'unique':!![],'name':_0x217e('0x12'),'fields':[_0x217e('0xc'),'OpenchannelAccountId']},{'unique':!![],'name':_0x217e('0x13'),'fields':['name',_0x217e('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 1774629..0b50450 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(_0x2be490,_0x29f00d){var _0x3059aa=function(_0x51b6ab){while(--_0x51b6ab){_0x2be490['push'](_0x2be490['shift']());}};_0x3059aa(++_0x29f00d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x183b16,_0xd622ff){var _0x1bd69a=function(_0x346658){while(--_0x346658){_0x183b16['push'](_0x183b16['shift']());}};_0x1bd69a(++_0xd622ff);}(_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 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 e159933..c3ad5b3 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 _0xa492=['index','show','create','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x525ae8,_0x37081d){var _0x36e410=function(_0x1977c3){while(--_0x1977c3){_0x525ae8['push'](_0x525ae8['shift']());}};_0x36e410(++_0x37081d);}(_0xa492,0x1c4));var _0x2a49=function(_0x33ca94,_0x329754){_0x33ca94=_0x33ca94-0x0;var _0x54edb1=_0xa492[_0x33ca94];return _0x54edb1;};'use strict';var multer=require(_0x2a49('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a49('0x1'));var express=require(_0x2a49('0x2'));var router=express['Router']();var fs_extra=require(_0x2a49('0x3'));var auth=require(_0x2a49('0x4'));var interaction=require(_0x2a49('0x5'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x2a49('0x6')]('/',auth['isAuthenticated'](),controller[_0x2a49('0x7')]);router[_0x2a49('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2a49('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2a49('0x9')]);router[_0x2a49('0xa')](_0x2a49('0xb'),auth[_0x2a49('0xc')](),controller[_0x2a49('0xd')]);router[_0x2a49('0xe')]('/:id',auth[_0x2a49('0xc')](),controller[_0x2a49('0xf')]);module[_0x2a49('0x10')]=router; \ No newline at end of file +var _0x292d=['show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x4d2aea,_0x4a8f11){var _0x1715b8=function(_0x50aadc){while(--_0x50aadc){_0x4d2aea['push'](_0x4d2aea['shift']());}};_0x1715b8(++_0x4a8f11);}(_0x292d,0x72));var _0xd292=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x292d[_0x42e25e];return _0x1ed3a6;};'use strict';var multer=require(_0xd292('0x0'));var util=require('util');var path=require(_0xd292('0x1'));var timeout=require(_0xd292('0x2'));var express=require(_0xd292('0x3'));var router=express[_0xd292('0x4')]();var fs_extra=require(_0xd292('0x5'));var auth=require(_0xd292('0x6'));var interaction=require(_0xd292('0x7'));var config=require(_0xd292('0x8'));var controller=require('./disposition.controller');router[_0xd292('0x9')]('/',auth[_0xd292('0xa')](),controller['index']);router[_0xd292('0x9')](_0xd292('0xb'),auth[_0xd292('0xa')](),controller[_0xd292('0xc')]);router[_0xd292('0xd')]('/',auth[_0xd292('0xa')](),controller[_0xd292('0xe')]);router['put'](_0xd292('0xb'),auth[_0xd292('0xa')](),controller[_0xd292('0xf')]);router[_0xd292('0x10')](_0xd292('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd292('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 39cdac4..2ccd206 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 _0x7d9f=['SIP','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','12000','14400','INTEGER'];(function(_0x13b200,_0xb00e8a){var _0x489875=function(_0x3b261e){while(--_0x3b261e){_0x13b200['push'](_0x13b200['shift']());}};_0x489875(++_0xb00e8a);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x7d9f[_0x4dbc5d];return _0x45b461;};'use strict';var Sequelize=require(_0xf7d9('0x0'));module[_0xf7d9('0x1')]={'name':{'type':Sequelize[_0xf7d9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf7d9('0x2')]},'ecm':{'type':Sequelize[_0xf7d9('0x3')]('yes','no'),'defaultValue':_0xf7d9('0x4')},'headerinfo':{'type':Sequelize[_0xf7d9('0x2')],'defaultValue':_0xf7d9('0x5')},'localstationid':{'type':Sequelize[_0xf7d9('0x2')],'unique':_0xf7d9('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0xf7d9('0x7'),_0xf7d9('0x8'),'9600',_0xf7d9('0x9'),_0xf7d9('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xf7d9('0x3')]('2400',_0xf7d9('0x7'),_0xf7d9('0x8'),'9600','12000',_0xf7d9('0xa')),'defaultValue':_0xf7d9('0xa')},'modem':{'type':Sequelize[_0xf7d9('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf7d9('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf7d9('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf7d9('0x3')](_0xf7d9('0xc'),'IAX',_0xf7d9('0xd'),_0xf7d9('0xe')),'defaultValue':_0xf7d9('0xc')},'key':{'type':Sequelize[_0xf7d9('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf7d9('0xf');}},'notificationSound':{'type':Sequelize[_0xf7d9('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf7d9('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf7d9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf7d9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf7d9('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf7d9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf7d9('0x10')],'defaultValue':![],'comment':_0xf7d9('0x11'),'set':function(_0xe29103){if(!_0xe29103)this['setDataValue'](_0xf7d9('0x12'),null);this[_0xf7d9('0x13')]('mandatoryDisposition',_0xe29103);}}}; \ No newline at end of file +var _0x6f48=['KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','7200','14400','9600','12000','SIP','IAX','DADHI'];(function(_0x324914,_0x454bd2){var _0x18b096=function(_0x344830){while(--_0x344830){_0x324914['push'](_0x324914['shift']());}};_0x18b096(++_0x454bd2);}(_0x6f48,0x11c));var _0x86f4=function(_0x23d500,_0x3aedea){_0x23d500=_0x23d500-0x0;var _0x149e26=_0x6f48[_0x23d500];return _0x149e26;};'use strict';var Sequelize=require(_0x86f4('0x0'));module[_0x86f4('0x1')]={'name':{'type':Sequelize[_0x86f4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x86f4('0x2')]},'ecm':{'type':Sequelize[_0x86f4('0x3')]('yes','no'),'defaultValue':_0x86f4('0x4')},'headerinfo':{'type':Sequelize[_0x86f4('0x2')],'defaultValue':_0x86f4('0x5')},'localstationid':{'type':Sequelize[_0x86f4('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0x86f4('0x6'),_0x86f4('0x7'),_0x86f4('0x8'),'9600','12000',_0x86f4('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x86f4('0x3')](_0x86f4('0x6'),_0x86f4('0x7'),_0x86f4('0x8'),_0x86f4('0xa'),_0x86f4('0xb'),_0x86f4('0x9')),'defaultValue':_0x86f4('0x9')},'modem':{'type':Sequelize[_0x86f4('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x86f4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x86f4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x86f4('0xc'),_0x86f4('0xd'),_0x86f4('0xe'),_0x86f4('0xf')),'defaultValue':_0x86f4('0xc')},'key':{'type':Sequelize[_0x86f4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x86f4('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x86f4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x86f4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x86f4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x86f4('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x86f4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x86f4('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x86f4('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x86f4('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb6dc1c){if(!_0xb6dc1c)this['setDataValue'](_0x86f4('0x14'),null);this[_0x86f4('0x15')](_0x86f4('0x16'),_0xb6dc1c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7fdf22a..28384ee 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 _0x5161=['register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','Pause','params','describe','FaxAccountId','Disposition','getDispositions','findOne','length','hasOwnProperty','nolimit','sort','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','Contact','User','Owner','fullname','Tags','color','tag','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','sequelize','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','CmList','CmContact','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxAccount.socket'];(function(_0x3ed384,_0x4560e4){var _0x337eab=function(_0x552d24){while(--_0x552d24){_0x3ed384['push'](_0x3ed384['shift']());}};_0x337eab(++_0x4560e4);}(_0x5161,0x179));var _0x1516=function(_0x2b5076,_0x3a4a2d){_0x2b5076=_0x2b5076-0x0;var _0x169ee1=_0x5161[_0x2b5076];return _0x169ee1;};'use strict';var emlformat=require(_0x1516('0x0'));var rimraf=require(_0x1516('0x1'));var zipdir=require(_0x1516('0x2'));var jsonpatch=require(_0x1516('0x3'));var rp=require(_0x1516('0x4'));var moment=require(_0x1516('0x5'));var BPromise=require(_0x1516('0x6'));var Mustache=require(_0x1516('0x7'));var util=require(_0x1516('0x8'));var path=require(_0x1516('0x9'));var sox=require(_0x1516('0xa'));var csv=require(_0x1516('0xb'));var ejs=require(_0x1516('0xc'));var fs=require('fs');var fs_extra=require(_0x1516('0xd'));var _=require(_0x1516('0xe'));var squel=require(_0x1516('0xf'));var crypto=require(_0x1516('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1516('0xb'));var querystring=require(_0x1516('0x11'));var Papa=require(_0x1516('0x12'));var Redis=require(_0x1516('0x13'));var authService=require(_0x1516('0x14'));var qs=require(_0x1516('0x15'));var as=require(_0x1516('0x16'));var hardwareService=require(_0x1516('0x17'));var logger=require(_0x1516('0x18'))(_0x1516('0x19'));var utils=require(_0x1516('0x1a'));var config=require(_0x1516('0x1b'));var licenseUtil=require(_0x1516('0x1c'));var db=require('../../mysqldb')['db'];config[_0x1516('0x1d')]=_[_0x1516('0x1e')](config[_0x1516('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x1516('0x1f'))(new Redis(config['redis']));require(_0x1516('0x20'))[_0x1516('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1516('0x22')][_0x1516('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x1516('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x4f4a61,_0x37a209,_0x58c47f,_0x3921a5){return new BPromise(function(_0x3c9db4,_0x218043){var _0x205068=_0x3921a5||client;return _0x205068[_0x1516('0x24')](_0x4f4a61,_0x58c47f)[_0x1516('0x25')](function(_0x27ec51){logger[_0x1516('0x26')](_0x1516('0x27'),_0x37a209,'request\x20sent');logger[_0x1516('0x28')](_0x1516('0x29'),_0x37a209,_0x1516('0x2a'),JSON[_0x1516('0x2b')](_0x27ec51));if(_0x27ec51[_0x1516('0x2c')]){if(_0x27ec51[_0x1516('0x2c')]['code']===0x1f4){logger['error'](_0x1516('0x27'),_0x37a209,_0x27ec51[_0x1516('0x2c')][_0x1516('0x2d')]);return _0x218043(_0x27ec51[_0x1516('0x2c')][_0x1516('0x2d')]);}logger[_0x1516('0x2c')](_0x1516('0x27'),_0x37a209,_0x27ec51[_0x1516('0x2c')]['message']);return _0x3c9db4(_0x27ec51['error']['message']);}else{logger[_0x1516('0x26')](_0x1516('0x27'),_0x37a209,_0x1516('0x2a'));_0x3c9db4(_0x27ec51[_0x1516('0x2e')]['message']);}})[_0x1516('0x2f')](function(_0x267bca){logger[_0x1516('0x2c')]('FaxAccount,\x20%s,\x20%s',_0x37a209,_0x267bca);_0x218043(_0x267bca);});});}function respondWithStatusCode(_0x3b8e56,_0x3bb565){_0x3bb565=_0x3bb565||0xcc;return function(_0x1489aa){if(_0x1489aa){return _0x3b8e56[_0x1516('0x30')](_0x3bb565);}return _0x3b8e56[_0x1516('0x31')](_0x3bb565)[_0x1516('0x32')]();};}function respondWithResult(_0x151776,_0x148d14){_0x148d14=_0x148d14||0xc8;return function(_0x21a9f2){if(_0x21a9f2){return _0x151776[_0x1516('0x31')](_0x148d14)[_0x1516('0x33')](_0x21a9f2);}};}function respondWithFilteredResult(_0x48a456,_0x5a4204){return function(_0x1a58ac){if(_0x1a58ac){var _0x114a61=typeof _0x5a4204[_0x1516('0x34')]==='undefined'&&typeof _0x5a4204['limit']===_0x1516('0x35');var _0x4c25f1=_0x1a58ac[_0x1516('0x36')];var _0x5a991b=_0x114a61?0x0:_0x5a4204[_0x1516('0x34')];var _0x2787f7=_0x114a61?_0x1a58ac[_0x1516('0x36')]:_0x5a4204[_0x1516('0x34')]+_0x5a4204[_0x1516('0x37')];var _0x16d61a;if(_0x2787f7>=_0x4c25f1){_0x2787f7=_0x4c25f1;_0x16d61a=0xc8;}else{_0x16d61a=0xce;}_0x48a456[_0x1516('0x31')](_0x16d61a);return _0x48a456[_0x1516('0x38')](_0x1516('0x39'),_0x5a991b+'-'+_0x2787f7+'/'+_0x4c25f1)[_0x1516('0x33')](_0x1a58ac);}return null;};}function patchUpdates(_0x2d346e){return function(_0x2e18b7){try{jsonpatch['apply'](_0x2e18b7,_0x2d346e,!![]);}catch(_0x12f557){return BPromise[_0x1516('0x3a')](_0x12f557);}return _0x2e18b7[_0x1516('0x3b')]();};}function saveUpdates(_0x186e9b,_0x7dd83){return function(_0x2aa94e){if(_0x2aa94e){return _0x2aa94e['update'](_0x186e9b)[_0x1516('0x25')](function(_0x15a85d){return _0x15a85d;});}return null;};}function removeEntity(_0xd7e292,_0x29d4d7){return function(_0x14e565){if(_0x14e565){return _0x14e565[_0x1516('0x3c')]()[_0x1516('0x25')](function(){var _0x527ef7=_0x14e565[_0x1516('0x3d')]({'plain':!![]});var _0x3a560e=_0x1516('0x3e');return db[_0x1516('0x3f')][_0x1516('0x3c')]({'where':{'type':_0x3a560e,'resourceId':_0x527ef7['id']}})[_0x1516('0x25')](function(){return _0x14e565;});})[_0x1516('0x25')](function(){_0xd7e292[_0x1516('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x546b73,_0xa3c6f9){return function(_0x2402da){if(!_0x2402da){_0x546b73[_0x1516('0x30')](0x194);}return _0x2402da;};}function handleError(_0x2f3c8f,_0x5cb779){_0x5cb779=_0x5cb779||0x1f4;return function(_0x4d7ee){logger[_0x1516('0x2c')](_0x4d7ee[_0x1516('0x40')]);if(_0x4d7ee[_0x1516('0x41')]){delete _0x4d7ee['name'];}_0x2f3c8f[_0x1516('0x31')](_0x5cb779)[_0x1516('0x42')](_0x4d7ee);};}exports[_0x1516('0x43')]=function(_0x331537,_0x55b193){var _0x20080f={'include':[{'model':db['Pause'],'as':_0x1516('0x44')}]},_0x3aa8e3={},_0x9ea83e={'count':0x0,'rows':[]};var _0x5b8a9e=_[_0x1516('0x45')](db[_0x1516('0x46')][_0x1516('0x47')],function(_0x432337){return{'name':_0x432337[_0x1516('0x48')],'type':_0x432337[_0x1516('0x49')][_0x1516('0x4a')]};});_0x3aa8e3[_0x1516('0x4b')]=_[_0x1516('0x45')](_0x5b8a9e,'name');_0x3aa8e3[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x331537['query']);_0x3aa8e3[_0x1516('0x4e')]=_[_0x1516('0x4f')](_0x3aa8e3[_0x1516('0x4b')],_0x3aa8e3['query']);_0x20080f[_0x1516('0x50')]=_['intersection'](_0x3aa8e3[_0x1516('0x4b')],qs[_0x1516('0x51')](_0x331537[_0x1516('0x4c')][_0x1516('0x51')]));_0x20080f[_0x1516('0x50')]=_0x20080f[_0x1516('0x50')]['length']?_0x20080f[_0x1516('0x50')]:_0x3aa8e3[_0x1516('0x4b')];if(!_0x331537[_0x1516('0x4c')]['hasOwnProperty']('nolimit')){_0x20080f[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x331537[_0x1516('0x4c')][_0x1516('0x37')]);_0x20080f['offset']=qs[_0x1516('0x34')](_0x331537[_0x1516('0x4c')]['offset']);}_0x20080f[_0x1516('0x52')]=qs['sort'](_0x331537['query']['sort']);_0x20080f[_0x1516('0x53')]=qs[_0x1516('0x4e')](_[_0x1516('0x54')](_0x331537[_0x1516('0x4c')],_0x3aa8e3[_0x1516('0x4e')]),_0x5b8a9e);if(_0x331537[_0x1516('0x4c')][_0x1516('0x55')]){_0x20080f[_0x1516('0x53')]=_[_0x1516('0x56')](_0x20080f['where'],{'$or':_[_0x1516('0x45')](_0x5b8a9e,function(_0x2c0a92){if(_0x2c0a92[_0x1516('0x49')]!==_0x1516('0x57')){var _0x231275={};_0x231275[_0x2c0a92[_0x1516('0x41')]]={'$like':'%'+_0x331537[_0x1516('0x4c')][_0x1516('0x55')]+'%'};return _0x231275;}})});}_0x20080f=_[_0x1516('0x56')]({},_0x20080f,_0x331537[_0x1516('0x58')]);var _0x8c1bbe={'where':_0x20080f[_0x1516('0x53')]};return db[_0x1516('0x46')][_0x1516('0x36')](_0x8c1bbe)['then'](function(_0x177bf6){_0x9ea83e['count']=_0x177bf6;if(_0x331537[_0x1516('0x4c')]['includeAll']){_0x20080f[_0x1516('0x59')]=[{'all':!![]}];}return db[_0x1516('0x46')][_0x1516('0x5a')](_0x20080f);})[_0x1516('0x25')](function(_0xb06dfa){_0x9ea83e[_0x1516('0x5b')]=_0xb06dfa;return _0x9ea83e;})['then'](respondWithFilteredResult(_0x55b193,_0x20080f))['catch'](handleError(_0x55b193,null));};exports['show']=function(_0x29c9db,_0x314f1c){var _0xd2a914={'raw':![],'where':{'id':_0x29c9db['params']['id']},'include':[{'model':db['Pause'],'as':_0x1516('0x44')}]},_0x4ab397={};_0x4ab397[_0x1516('0x4b')]=_[_0x1516('0x4d')](db[_0x1516('0x46')][_0x1516('0x47')]);_0x4ab397[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x29c9db[_0x1516('0x4c')]);_0x4ab397[_0x1516('0x4e')]=_[_0x1516('0x4f')](_0x4ab397[_0x1516('0x4b')],_0x4ab397[_0x1516('0x4c')]);_0xd2a914[_0x1516('0x50')]=_[_0x1516('0x4f')](_0x4ab397[_0x1516('0x4b')],qs[_0x1516('0x51')](_0x29c9db['query']['fields']));_0xd2a914[_0x1516('0x50')]=_0xd2a914[_0x1516('0x50')]['length']?_0xd2a914[_0x1516('0x50')]:_0x4ab397['model'];if(_0x29c9db[_0x1516('0x4c')][_0x1516('0x5c')]){_0xd2a914[_0x1516('0x59')]=[{'all':!![]}];}_0xd2a914=_[_0x1516('0x56')]({},_0xd2a914,_0x29c9db[_0x1516('0x58')]);return db[_0x1516('0x46')][_0x1516('0x5d')](_0xd2a914)[_0x1516('0x25')](handleEntityNotFound(_0x314f1c,null))[_0x1516('0x25')](respondWithResult(_0x314f1c,null))[_0x1516('0x2f')](handleError(_0x314f1c,null));};exports['create']=function(_0x4a9133,_0x5ddac7){return db[_0x1516('0x46')][_0x1516('0x5e')](_0x4a9133['body'],{})[_0x1516('0x25')](function(_0x115a04){var _0x4ec5ca=_0x4a9133['user'][_0x1516('0x3d')]({'plain':!![]});if(!_0x4ec5ca)throw new Error(_0x1516('0x5f'));if(_0x4ec5ca[_0x1516('0x60')]===_0x1516('0x61')){var _0x44ca05=_0x115a04['get']({'plain':!![]});var _0x25e129=_0x1516('0x3e');return db[_0x1516('0x62')][_0x1516('0x5d')]({'where':{'name':_0x25e129,'userProfileId':_0x4ec5ca[_0x1516('0x63')]},'raw':!![]})[_0x1516('0x25')](function(_0x553075){if(_0x553075&&_0x553075[_0x1516('0x64')]===0x0){return db[_0x1516('0x3f')][_0x1516('0x5e')]({'name':_0x44ca05[_0x1516('0x41')],'resourceId':_0x44ca05['id'],'type':_0x553075['name'],'sectionId':_0x553075['id']},{})[_0x1516('0x25')](function(){return _0x115a04;});}else{return _0x115a04;}})[_0x1516('0x2f')](function(_0x277c83){logger[_0x1516('0x2c')](_0x1516('0x65'),_0x277c83);throw _0x277c83;});}return _0x115a04;})[_0x1516('0x25')](respondWithResult(_0x5ddac7,0xc9))[_0x1516('0x2f')](handleError(_0x5ddac7,null));};exports[_0x1516('0x66')]=function(_0x3478de,_0x341c20){if(_0x3478de[_0x1516('0x67')]['id']){delete _0x3478de[_0x1516('0x67')]['id'];}return db[_0x1516('0x46')]['find']({'where':{'id':_0x3478de['params']['id']},'include':[{'model':db[_0x1516('0x68')],'as':_0x1516('0x44')}]})[_0x1516('0x25')](handleEntityNotFound(_0x341c20,null))['then'](saveUpdates(_0x3478de[_0x1516('0x67')],null))[_0x1516('0x25')](respondWithResult(_0x341c20,null))[_0x1516('0x2f')](handleError(_0x341c20,null));};exports[_0x1516('0x3c')]=function(_0xe2bedf,_0x4a4a04){return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0xe2bedf[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x4a4a04,null))[_0x1516('0x25')](removeEntity(_0x4a4a04,null))['catch'](handleError(_0x4a4a04,null));};exports[_0x1516('0x6a')]=function(_0x3c6a16,_0x4d4e2b){return db[_0x1516('0x46')][_0x1516('0x6a')]()[_0x1516('0x25')](respondWithResult(_0x4d4e2b,null))[_0x1516('0x2f')](handleError(_0x4d4e2b,null));};exports['addDisposition']=function(_0x3bcafe,_0x462ebe,_0x3ea24f){if(_0x3bcafe[_0x1516('0x67')]['id']){delete _0x3bcafe[_0x1516('0x67')]['id'];}return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0x3bcafe[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x462ebe,null))['then'](function(_0x3f425c){if(_0x3f425c){_0x3bcafe['body'][_0x1516('0x6b')]=_0x3f425c['id'];return db[_0x1516('0x6c')][_0x1516('0x5e')](_0x3bcafe['body']);}})[_0x1516('0x25')](respondWithResult(_0x462ebe,null))[_0x1516('0x2f')](handleError(_0x462ebe,null));};exports[_0x1516('0x6d')]=function(_0x2d85ef,_0x38be1e,_0x5b9c2a){var _0x494713={'raw':![],'where':{}};var _0x7f793e={};var _0x198172={'count':0x0,'rows':[]};return db[_0x1516('0x46')][_0x1516('0x6e')]({'where':{'id':_0x2d85ef[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x38be1e,null))[_0x1516('0x25')](function(_0x1311e4){if(_0x1311e4){_0x7f793e[_0x1516('0x4b')]=_[_0x1516('0x4d')](db[_0x1516('0x6c')]['rawAttributes']);_0x7f793e[_0x1516('0x4c')]=_['keys'](_0x2d85ef[_0x1516('0x4c')]);_0x7f793e[_0x1516('0x4e')]=_[_0x1516('0x4f')](_0x7f793e[_0x1516('0x4b')],_0x7f793e[_0x1516('0x4c')]);_0x494713['attributes']=_[_0x1516('0x4f')](_0x7f793e[_0x1516('0x4b')],qs['fields'](_0x2d85ef['query'][_0x1516('0x51')]));_0x494713[_0x1516('0x50')]=_0x494713[_0x1516('0x50')][_0x1516('0x6f')]?_0x494713[_0x1516('0x50')]:_0x7f793e[_0x1516('0x4b')];if(!_0x2d85ef[_0x1516('0x4c')][_0x1516('0x70')](_0x1516('0x71'))){_0x494713[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x2d85ef[_0x1516('0x4c')]['limit']);_0x494713['offset']=qs['offset'](_0x2d85ef['query'][_0x1516('0x34')]);}_0x494713[_0x1516('0x52')]=qs[_0x1516('0x72')](_0x2d85ef['query'][_0x1516('0x72')]);_0x494713['where']=qs[_0x1516('0x4e')](_['pick'](_0x2d85ef[_0x1516('0x4c')],_0x7f793e[_0x1516('0x4e')]));_0x494713['where'][_0x1516('0x6b')]=_0x1311e4['id'];if(_0x2d85ef[_0x1516('0x4c')][_0x1516('0x55')]){_0x494713[_0x1516('0x53')]=_['merge'](_0x494713[_0x1516('0x53')],{'$or':_['map'](_0x494713[_0x1516('0x50')],function(_0x440398){var _0x1c7647={};_0x1c7647[_0x440398]={'$like':'%'+_0x2d85ef[_0x1516('0x4c')]['filter']+'%'};return _0x1c7647;})});}_0x494713=_[_0x1516('0x56')]({},_0x494713,_0x2d85ef[_0x1516('0x58')]);return db[_0x1516('0x6c')][_0x1516('0x36')]({'where':_0x494713[_0x1516('0x53')]})[_0x1516('0x25')](function(_0x43f70e){_0x198172[_0x1516('0x36')]=_0x43f70e;if(_0x2d85ef[_0x1516('0x4c')][_0x1516('0x5c')]){_0x494713[_0x1516('0x59')]=[{'all':!![]}];}return db[_0x1516('0x6c')][_0x1516('0x5a')](_0x494713);})[_0x1516('0x25')](function(_0x2bebbe){_0x198172[_0x1516('0x5b')]=_0x2bebbe;return _0x198172;});}})['then'](respondWithFilteredResult(_0x38be1e,_0x494713))[_0x1516('0x2f')](handleError(_0x38be1e,null));};exports['removeDispositions']=function(_0x354f53,_0x263aa3,_0x2b95cb){return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0x354f53['params']['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x263aa3,null))['then'](function(_0x4ee67d){if(_0x4ee67d){return _0x4ee67d['removeDispositions'](_0x354f53['query']['ids']);}})['then'](respondWithStatusCode(_0x263aa3,null))['catch'](handleError(_0x263aa3,null));};exports[_0x1516('0x73')]=function(_0xb0eb97,_0x16c1ce,_0x38edd0){if(_0xb0eb97[_0x1516('0x67')]['id']){delete _0xb0eb97['body']['id'];}return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0xb0eb97[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x16c1ce,null))[_0x1516('0x25')](function(_0x37ea9a){if(_0x37ea9a){_0xb0eb97['body'][_0x1516('0x6b')]=_0x37ea9a['id'];return db[_0x1516('0x74')]['create'](_0xb0eb97['body']);}})[_0x1516('0x25')](respondWithResult(_0x16c1ce,null))['catch'](handleError(_0x16c1ce,null));};exports[_0x1516('0x75')]=function(_0x486c90,_0x2966bb,_0x3ed65f){var _0x379325={'raw':![],'where':{}};var _0xcdc3e9={};var _0x286944={'count':0x0,'rows':[]};return db[_0x1516('0x46')][_0x1516('0x6e')]({'where':{'id':_0x486c90[_0x1516('0x69')]['id']}})['then'](handleEntityNotFound(_0x2966bb,null))[_0x1516('0x25')](function(_0x23eb96){if(_0x23eb96){_0xcdc3e9[_0x1516('0x4b')]=_[_0x1516('0x4d')](db[_0x1516('0x74')][_0x1516('0x47')]);_0xcdc3e9[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x486c90['query']);_0xcdc3e9['filters']=_[_0x1516('0x4f')](_0xcdc3e9[_0x1516('0x4b')],_0xcdc3e9['query']);_0x379325[_0x1516('0x50')]=_[_0x1516('0x4f')](_0xcdc3e9[_0x1516('0x4b')],qs['fields'](_0x486c90['query'][_0x1516('0x51')]));_0x379325['attributes']=_0x379325['attributes'][_0x1516('0x6f')]?_0x379325[_0x1516('0x50')]:_0xcdc3e9[_0x1516('0x4b')];if(!_0x486c90[_0x1516('0x4c')][_0x1516('0x70')](_0x1516('0x71'))){_0x379325['limit']=qs[_0x1516('0x37')](_0x486c90['query'][_0x1516('0x37')]);_0x379325[_0x1516('0x34')]=qs['offset'](_0x486c90[_0x1516('0x4c')][_0x1516('0x34')]);}_0x379325[_0x1516('0x52')]=qs[_0x1516('0x72')](_0x486c90[_0x1516('0x4c')][_0x1516('0x72')]);_0x379325['where']=qs[_0x1516('0x4e')](_[_0x1516('0x54')](_0x486c90['query'],_0xcdc3e9[_0x1516('0x4e')]));_0x379325['where'][_0x1516('0x6b')]=_0x23eb96['id'];if(_0x486c90['query'][_0x1516('0x55')]){_0x379325['where']=_[_0x1516('0x56')](_0x379325[_0x1516('0x53')],{'$or':_[_0x1516('0x45')](_0x379325['attributes'],function(_0x255145){var _0x118ef0={};_0x118ef0[_0x255145]={'$like':'%'+_0x486c90[_0x1516('0x4c')][_0x1516('0x55')]+'%'};return _0x118ef0;})});}_0x379325=_['merge']({},_0x379325,_0x486c90[_0x1516('0x58')]);return db[_0x1516('0x74')][_0x1516('0x36')]({'where':_0x379325[_0x1516('0x53')]})[_0x1516('0x25')](function(_0x5cd59a){_0x286944[_0x1516('0x36')]=_0x5cd59a;if(_0x486c90['query'][_0x1516('0x5c')]){_0x379325[_0x1516('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1516('0x5a')](_0x379325);})[_0x1516('0x25')](function(_0x307fed){_0x286944[_0x1516('0x5b')]=_0x307fed;return _0x286944;});}})[_0x1516('0x25')](respondWithFilteredResult(_0x2966bb,_0x379325))[_0x1516('0x2f')](handleError(_0x2966bb,null));};exports[_0x1516('0x76')]=function(_0x108e9e,_0x3bae16,_0x2187cd){return db[_0x1516('0x46')]['find']({'where':{'id':_0x108e9e['params']['id']}})['then'](handleEntityNotFound(_0x3bae16,null))[_0x1516('0x25')](function(_0x598d22){if(_0x598d22){return _0x598d22[_0x1516('0x76')](_0x108e9e[_0x1516('0x4c')][_0x1516('0x77')]);}})[_0x1516('0x25')](respondWithStatusCode(_0x3bae16,null))['catch'](handleError(_0x3bae16,null));};exports[_0x1516('0x78')]=function(_0xc5c583,_0x5e3f28,_0x508a0f){return db[_0x1516('0x79')][_0x1516('0x5d')]({'where':{'id':_0xc5c583[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x5e3f28,null))[_0x1516('0x25')](function(_0x29b1d5){if(_0x29b1d5){return _0x29b1d5[_0x1516('0x78')](_0xc5c583[_0x1516('0x67')][_0x1516('0x77')],_[_0x1516('0x7a')](_0xc5c583[_0x1516('0x67')],['ids','id'])||{});}})['then'](respondWithResult(_0x5e3f28,null))[_0x1516('0x2f')](handleError(_0x5e3f28,null));};exports['getInteractions']=function(_0x478504,_0x4755d3,_0x38bce2){var _0x5351a0={'raw':![],'where':{}};var _0x41630e={};var _0x3d1219={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x478504['params']['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x4755d3,null))[_0x1516('0x25')](function(_0x27e7e9){if(_0x27e7e9){_0x41630e[_0x1516('0x4b')]=_[_0x1516('0x4d')](db[_0x1516('0x79')][_0x1516('0x47')]);_0x41630e['query']=_['keys'](_0x478504[_0x1516('0x4c')]);_0x41630e['filters']=_['intersection'](_0x41630e[_0x1516('0x4b')],_0x41630e[_0x1516('0x4c')]);_0x5351a0[_0x1516('0x50')]=_[_0x1516('0x4f')](_0x41630e[_0x1516('0x4b')],qs[_0x1516('0x51')](_0x478504[_0x1516('0x4c')][_0x1516('0x51')]));_0x5351a0[_0x1516('0x50')]=_0x5351a0[_0x1516('0x50')][_0x1516('0x6f')]?_0x5351a0[_0x1516('0x50')]:_0x41630e[_0x1516('0x4b')];if(!_0x478504[_0x1516('0x4c')][_0x1516('0x70')]('nolimit')){_0x5351a0[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x478504['query'][_0x1516('0x37')]);_0x5351a0[_0x1516('0x34')]=qs[_0x1516('0x34')](_0x478504[_0x1516('0x4c')][_0x1516('0x34')]);}_0x5351a0[_0x1516('0x52')]=qs['sort'](_0x478504[_0x1516('0x4c')][_0x1516('0x72')]);_0x5351a0['where']=qs[_0x1516('0x4e')](_['pick'](_0x478504[_0x1516('0x4c')],_0x41630e['filters']));_0x5351a0[_0x1516('0x53')][_0x1516('0x6b')]=_0x27e7e9['id'];if(_0x478504[_0x1516('0x4c')][_0x1516('0x55')]){_0x5351a0[_0x1516('0x53')]=_[_0x1516('0x56')](_0x5351a0[_0x1516('0x53')],{'$or':_[_0x1516('0x45')](_0x5351a0[_0x1516('0x50')],function(_0x3b7150){var _0x1adf57={};_0x1adf57[_0x3b7150]={'$like':'%'+_0x478504[_0x1516('0x4c')]['filter']+'%'};return _0x1adf57;})});}_0x5351a0=_['merge']({},_0x5351a0,_0x478504[_0x1516('0x58')]);return db['FaxInteraction'][_0x1516('0x36')]({'where':_0x5351a0[_0x1516('0x53')]})['then'](function(_0x26eb1b){_0x3d1219['count']=_0x26eb1b;if(_0x478504[_0x1516('0x4c')][_0x1516('0x5c')]){_0x5351a0[_0x1516('0x59')]=[{'model':db['CmContact'],'as':_0x1516('0x7b'),'required':![]},{'model':db[_0x1516('0x7c')],'as':_0x1516('0x7d'),'attributes':[_0x1516('0x41'),_0x1516('0x7e'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x1516('0x7f'),'attributes':['id',_0x1516('0x41'),_0x1516('0x80')],'where':_0x478504[_0x1516('0x4c')][_0x1516('0x81')]?{'id':_0x478504[_0x1516('0x4c')][_0x1516('0x81')]}:undefined,'required':_0x478504['query'][_0x1516('0x81')]?!![]:![]}];}return db['FaxInteraction'][_0x1516('0x5a')](_0x5351a0);})['then'](function(_0x536ab7){_0x3d1219[_0x1516('0x5b')]=_0x536ab7;return _0x3d1219;});}})[_0x1516('0x25')](respondWithFilteredResult(_0x4755d3,_0x5351a0))[_0x1516('0x2f')](handleError(_0x4755d3,null));};exports[_0x1516('0x82')]=function(_0x551c03,_0xbcfcf0){var _0x35a7f8=_0x551c03[_0x1516('0x69')]['id'];var _0x56b391=_0x551c03['body'];var _0xd1aef9=0xc8;var _0x3eb69b=null;return db['sequelize'][_0x1516('0x83')]({'isolationLevel':db['sequelize']['Transaction'][_0x1516('0x84')][_0x1516('0x85')]},function(_0x57415c){return db[_0x1516('0x46')][_0x1516('0x6e')]({'where':{'id':_0x35a7f8},'transaction':_0x57415c})[_0x1516('0x25')](function(_0x4a13af){if(_0x4a13af){return db[_0x1516('0x86')][_0x1516('0x3c')]({'where':{'FaxAccountId':_0x35a7f8},'transaction':_0x57415c})['then'](function(){var _0x51ade5=_[_0x1516('0x45')](_0x56b391,function(_0x2a1535){_0x2a1535['FaxAccountId']=_0x35a7f8;return _0x2a1535;});return db[_0x1516('0x86')][_0x1516('0x87')](_0x51ade5,{'transaction':_0x57415c});});}else{_0xd1aef9=0x194;_0x3eb69b=[];}});})[_0x1516('0x25')](function(){if(_0xd1aef9!==0x194){return db[_0x1516('0x86')][_0x1516('0x88')]({'where':{'FaxAccountId':_0x35a7f8},'order':_0x1516('0x89')})[_0x1516('0x25')](function(_0x23ddca){_0x3eb69b=_0x23ddca;});}})[_0x1516('0x2f')](function(_0xacab3f){_0xd1aef9=0x1f4;logger[_0x1516('0x2c')](_0xacab3f[_0x1516('0x40')]);if(_0xacab3f[_0x1516('0x41')]){delete _0xacab3f[_0x1516('0x41')];}_0x3eb69b=_0xacab3f;})[_0x1516('0x8a')](function(){if(_0x3eb69b===null){_0xbcfcf0[_0x1516('0x30')](_0xd1aef9);}else{if(_0xd1aef9===0x1f4){_0xbcfcf0[_0x1516('0x31')](_0xd1aef9)[_0x1516('0x42')](_0x3eb69b);}else{_0xbcfcf0[_0x1516('0x31')](_0xd1aef9)['json'](_0x3eb69b);}}});};exports[_0x1516('0x8b')]=function(_0x3eb911,_0x5ed078,_0x4ac456){var _0x24de47={};var _0x22bfcd={};var _0x1b7e97;var _0x366d8c;return db['FaxAccount'][_0x1516('0x6e')]({'where':{'id':_0x3eb911[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x5ed078,null))['then'](function(_0xb6ac32){if(_0xb6ac32){_0x1b7e97=_0xb6ac32;_0x22bfcd['model']=_['keys'](db[_0x1516('0x86')][_0x1516('0x47')]);_0x22bfcd[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x3eb911[_0x1516('0x4c')]);_0x22bfcd[_0x1516('0x4e')]=_[_0x1516('0x4f')](_0x22bfcd[_0x1516('0x4b')],_0x22bfcd[_0x1516('0x4c')]);_0x24de47[_0x1516('0x50')]=_[_0x1516('0x4f')](_0x22bfcd[_0x1516('0x4b')],qs[_0x1516('0x51')](_0x3eb911['query'][_0x1516('0x51')]));_0x24de47[_0x1516('0x50')]=_0x24de47[_0x1516('0x50')][_0x1516('0x6f')]?_0x24de47[_0x1516('0x50')]:_0x22bfcd[_0x1516('0x4b')];_0x24de47[_0x1516('0x52')]=qs[_0x1516('0x72')](_0x3eb911[_0x1516('0x4c')]['sort']);_0x24de47[_0x1516('0x53')]=qs[_0x1516('0x4e')](_[_0x1516('0x54')](_0x3eb911[_0x1516('0x4c')],_0x22bfcd['filters']));if(_0x3eb911['query'][_0x1516('0x55')]){_0x24de47[_0x1516('0x53')]=_[_0x1516('0x56')](_0x24de47[_0x1516('0x53')],{'$or':_[_0x1516('0x45')](_0x24de47[_0x1516('0x50')],function(_0x587d17){var _0x53047b={};_0x53047b[_0x587d17]={'$like':'%'+_0x3eb911[_0x1516('0x4c')][_0x1516('0x55')]+'%'};return _0x53047b;})});}_0x24de47=_[_0x1516('0x56')]({},_0x24de47,_0x3eb911[_0x1516('0x58')]);return _0x1b7e97[_0x1516('0x8b')](_0x24de47);}})[_0x1516('0x25')](function(_0x28822f){if(_0x28822f){_0x366d8c=_0x28822f[_0x1516('0x6f')];if(!_0x3eb911[_0x1516('0x4c')][_0x1516('0x70')](_0x1516('0x71'))){_0x24de47[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x3eb911[_0x1516('0x4c')][_0x1516('0x37')]);_0x24de47[_0x1516('0x34')]=qs[_0x1516('0x34')](_0x3eb911[_0x1516('0x4c')]['offset']);}return _0x1b7e97[_0x1516('0x8b')](_0x24de47);}})[_0x1516('0x25')](function(_0x5988c5){if(_0x5988c5){return _0x5988c5?{'count':_0x366d8c,'rows':_0x5988c5}:null;}})[_0x1516('0x25')](respondWithResult(_0x5ed078,null))[_0x1516('0x2f')](handleError(_0x5ed078,null));};function Extension(_0x39d1ea,_0x5f1511,_0x428daf,_0x3dbdbb){this[_0x1516('0x8c')]='from-voip-provider';this[_0x1516('0x8d')]=_0x39d1ea['localstationid'];this[_0x1516('0x8e')]=_0x3dbdbb;this['type']=_0x1516('0x8f');this[_0x1516('0x90')]=_0x1516('0x91');this[_0x1516('0x6b')]=_0x39d1ea['id'];this['priority']=_0x5f1511;this[_0x1516('0x92')]=_0x428daf;}function createExtensionsReciveFax(_0x2d98ef){var _0x2559fa=0x1;var _0x3d39eb=[];_0x3d39eb[_0x1516('0x93')](new Extension(_0x2d98ef,_0x2559fa,'',_0x1516('0x94')));_0x2559fa+=0x1;_0x3d39eb[_0x1516('0x93')](new Extension(_0x2d98ef,_0x2559fa,_0x1516('0x95'),_0x1516('0x96')));_0x2559fa+=0x1;for(var _0x1a7f92 in _0x2d98ef){if(_0x2d98ef['hasOwnProperty'](_0x1a7f92)&&(_0x1a7f92===_0x1516('0x97')||_0x1a7f92===_0x1516('0x98')||_0x1a7f92===_0x1516('0x99')||_0x1a7f92===_0x1516('0x9a')||_0x1a7f92===_0x1516('0x9b')||_0x1a7f92===_0x1516('0x9c')||_0x1a7f92===_0x1516('0x9d')||_0x1a7f92===_0x1516('0x9e')||_0x1a7f92==='t38timeout')){_0x3d39eb[_0x1516('0x93')](new Extension(_0x2d98ef,_0x2559fa,_0x1516('0x9f')+_0x1a7f92+')='+_0x2d98ef[_0x1a7f92],_0x1516('0x96')));_0x2559fa+=0x1;}}_0x3d39eb[_0x1516('0x93')](new Extension(_0x2d98ef,_0x2559fa,'6',_0x1516('0xa0')));_0x2559fa+=0x1;_0x3d39eb[_0x1516('0x93')](new Extension(_0x2d98ef,_0x2559fa,_0x1516('0xa1'),_0x1516('0xa2')));_0x2559fa=0x0;return _0x3d39eb;}exports['addAccountApplications']=function(_0x115727,_0xa8a0b,_0x9cc58d){var _0x2a60a8;return db[_0x1516('0xa3')][_0x1516('0x83')](function(_0x5ad233){return db[_0x1516('0x46')][_0x1516('0x5e')](_0x115727[_0x1516('0x67')],{'transaction':_0x5ad233})[_0x1516('0x25')](function(_0x43b18c){_0x2a60a8=_0x43b18c[_0x1516('0x3d')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x2a60a8),{'transaction':_0x5ad233});});})[_0x1516('0x25')](function(){return _0x2a60a8;})[_0x1516('0x25')](respondWithResult(_0xa8a0b,null))[_0x1516('0x2f')](handleError(_0xa8a0b,null));};exports[_0x1516('0xa4')]=function(_0x1d4352,_0x404dda,_0x4dbe4d){var _0x54d721;return db[_0x1516('0xa3')]['transaction'](function(_0x575c8d){return db['FaxAccount']['update'](_0x1d4352[_0x1516('0x67')],{'where':{'id':_0x1d4352[_0x1516('0x67')]['id']},'transaction':_0x575c8d})['then'](function(_0xb58321){return db[_0x1516('0xa5')][_0x1516('0x3c')]({'where':{'FaxAccountId':_0x1d4352[_0x1516('0x67')]['id']},'transaction':_0x575c8d})['then'](function(_0x29f9a3){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x1516('0x7a')](_0x1d4352[_0x1516('0x67')],[_0x1516('0xa6'),_0x1516('0x4a'),_0x1516('0xa7'),_0x1516('0xa8'),_0x1516('0xa9'),_0x1516('0xaa')])),{'transaction':_0x575c8d});});});})[_0x1516('0x25')](function(){return db[_0x1516('0x46')]['findById'](_0x1d4352[_0x1516('0x67')]['id']);})[_0x1516('0x25')](respondWithResult(_0x404dda,null))[_0x1516('0x2f')](handleError(_0x404dda,null));};exports[_0x1516('0xab')]=function(_0x1d1ac3,_0x1e036a,_0x30ed1f){var _0x508aff={'raw':!![],'where':{}};var _0x88e7e7={};var _0x3ad2f4={'count':0x0,'rows':[]};return db[_0x1516('0x46')][_0x1516('0x6e')]({'where':{'id':_0x1d1ac3['params']['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x1e036a,null))[_0x1516('0x25')](function(_0x5553cb){if(_0x5553cb){_0x88e7e7[_0x1516('0x4b')]=_[_0x1516('0x4d')](db[_0x1516('0xac')][_0x1516('0x47')]);_0x88e7e7[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x1d1ac3['query']);_0x88e7e7['filters']=_['intersection'](_0x88e7e7['model'],_0x88e7e7['query']);_0x508aff[_0x1516('0x50')]=_[_0x1516('0x4f')](_0x88e7e7[_0x1516('0x4b')],qs[_0x1516('0x51')](_0x1d1ac3[_0x1516('0x4c')][_0x1516('0x51')]));_0x508aff['attributes']=_0x508aff[_0x1516('0x50')][_0x1516('0x6f')]?_0x508aff[_0x1516('0x50')]:_0x88e7e7[_0x1516('0x4b')];if(!_0x1d1ac3[_0x1516('0x4c')]['hasOwnProperty'](_0x1516('0x71'))){_0x508aff[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x1d1ac3[_0x1516('0x4c')]['limit']);_0x508aff[_0x1516('0x34')]=qs[_0x1516('0x34')](_0x1d1ac3['query']['offset']);}_0x508aff[_0x1516('0x52')]=qs[_0x1516('0x72')](_0x1d1ac3[_0x1516('0x4c')][_0x1516('0x72')]);_0x508aff[_0x1516('0x53')]=qs[_0x1516('0x4e')](_[_0x1516('0x54')](_0x1d1ac3[_0x1516('0x4c')],_0x88e7e7[_0x1516('0x4e')]));_0x508aff['where'][_0x1516('0x6b')]=_0x5553cb['id'];if(_0x1d1ac3[_0x1516('0x4c')][_0x1516('0x55')]){_0x508aff[_0x1516('0x53')]=_['merge'](_0x508aff[_0x1516('0x53')],{'$or':_[_0x1516('0x45')](_0x508aff[_0x1516('0x50')],function(_0x4bf8d6){var _0x3fcfb1={};_0x3fcfb1[_0x4bf8d6]={'$like':'%'+_0x1d1ac3[_0x1516('0x4c')][_0x1516('0x55')]+'%'};return _0x3fcfb1;})});}if(_0x1d1ac3[_0x1516('0x4c')][_0x1516('0xad')]){var _0x522a67=_0x1d1ac3[_0x1516('0x4c')][_0x1516('0xad')][_0x1516('0xae')](',');var _0xb5bf90={};_0xb5bf90[_0x522a67[0x0]]={'$gte':moment(_0x522a67[0x1])[_0x1516('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x508aff[_0x1516('0x53')]=_['merge'](_0x508aff[_0x1516('0x53')],_0xb5bf90);}_0x508aff=_['merge']({},_0x508aff,_0x1d1ac3[_0x1516('0x58')]);return db['FaxMessage'][_0x1516('0x36')]({'where':_0x508aff[_0x1516('0x53')]})[_0x1516('0x25')](function(_0x27d58e){_0x3ad2f4[_0x1516('0x36')]=_0x27d58e;if(_0x1d1ac3[_0x1516('0x4c')][_0x1516('0x5c')]){_0x508aff[_0x1516('0x59')]=[{'all':!![]}];}return db['FaxMessage'][_0x1516('0x5a')](_0x508aff);})[_0x1516('0x25')](function(_0x478c76){_0x3ad2f4[_0x1516('0x5b')]=_0x478c76;return _0x3ad2f4;});}})[_0x1516('0x25')](respondWithFilteredResult(_0x1e036a,_0x508aff))['catch'](handleError(_0x1e036a,null));};exports[_0x1516('0x42')]=function(_0x1d383f,_0x44a4c6,_0x4e8917){var _0x375cd8,_0x79e7cb={},_0x5f57ee;if(_0x1d383f[_0x1516('0x67')]['to']){_0x5f57ee=_0x1d383f[_0x1516('0x67')]['to'][0x0];}return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0x1d383f[_0x1516('0x69')]['id']},'include':[{'model':db[_0x1516('0xb0')],'as':'List','include':[{'model':db[_0x1516('0xb1')],'as':_0x1516('0xb2'),'where':{'fax':_0x5f57ee},'limit':0x1,'order':[[_0x1516('0xa8'),_0x1516('0xb3')]]}]}]})[_0x1516('0x25')](handleEntityNotFound(_0x44a4c6,null))[_0x1516('0x25')](function(_0x50db26){_0x375cd8=_0x50db26;if(_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')]&&_0x1d383f['body'][_0x1516('0xb4')][_0x1516('0x6f')]){for(var _0x3b3cf1=0x0;_0x3b3cf1<_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][_0x1516('0x6f')];_0x3b3cf1+=0x1){_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][_0x3b3cf1]={'filename':_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][_0x3b3cf1][_0x1516('0x41')],'id':_0x1d383f['body'][_0x1516('0xb4')][_0x3b3cf1]['id'],'path':path[_0x1516('0xb5')](config['root'],_0x1516('0xb6'),_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][_0x3b3cf1][_0x1516('0xb7')])};}}return respondWithRpcPromise(_0x1516('0xb8'),_0x1516('0xb8'),{'FaxAccountId':_[_0x1516('0xb9')](_0x1d383f[_0x1516('0x69')]['id'])?undefined:_0x1d383f[_0x1516('0x69')]['id'],'path':_['isNil'](_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][0x0][_0x1516('0x9')])?undefined:_0x1d383f['body'][_0x1516('0xb4')][0x0]['path'],'fax':_[_0x1516('0xb9')](_0x1d383f[_0x1516('0x67')]['to'][0x0])?undefined:_0x1d383f[_0x1516('0x67')]['to'][0x0]},client9002);})[_0x1516('0x25')](function(){if(_0x375cd8){if(_[_0x1516('0xb9')](_0x1d383f[_0x1516('0x67')][_0x1516('0xba')])){_0x1d383f[_0x1516('0x67')][_0x1516('0xba')]=util[_0x1516('0xaf')](_0x1516('0xbb'),_0x375cd8[_0x1516('0x41')],_0x375cd8['fax']);}if(_0x375cd8[_0x1516('0xbc')]){if(_0x375cd8[_0x1516('0xbc')][_0x1516('0xb2')][_0x1516('0x6f')]){return _0x375cd8[_0x1516('0xbc')][_0x1516('0xb2')][0x0];}else{return db['CmContact'][_0x1516('0x5e')](_['defaults'](_0x1d383f[_0x1516('0x67')],{'firstName':_0x1d383f[_0x1516('0x67')]['to'][0x0],'phone':_0x1d383f[_0x1516('0x67')]['to'][0x0],'fax':_0x1d383f[_0x1516('0x67')]['to'][0x0],'ListId':_0x375cd8[_0x1516('0xaa')]}));}}else{throw new Error(_0x1516('0xbd'));}}else{throw new Error(_0x1516('0xbe'));}})[_0x1516('0x25')](function(_0x4f91ee){if(_0x4f91ee){return db[_0x1516('0x79')][_0x1516('0x5d')]({'where':{'ContactId':_0x4f91ee['id'],'closed':![],'FaxAccountId':_0x375cd8['id']}})['then'](function(_0x55105f){if(_0x55105f){return[_0x55105f,![]];}return db['FaxInteraction'][_0x1516('0x5e')]({'UserId':_0x1d383f[_0x1516('0x61')]['id'],'ContactId':_0x4f91ee['id'],'FaxAccountId':_0x375cd8['id'],'fax':_0x1d383f[_0x1516('0x67')]['to'][0x0],'firstMsgDirection':_0x1516('0xbf'),'Messages':[_[_0x1516('0x56')](_0x1d383f[_0x1516('0x67')],{'read':![],'body':_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][0x0]['filename'],'FaxAccountId':_0x375cd8['id'],'UserId':_0x1d383f[_0x1516('0x61')]['id'],'ContactId':_0x4f91ee['id'],'AttachmentId':_0x1d383f['body'][_0x1516('0xb4')][0x0]['id']})]},{'include':[{'model':db[_0x1516('0xac')],'as':_0x1516('0xc0')}]})[_0x1516('0x25')](function(_0x352d50){return[_0x352d50,!![]];});});}else{throw new Error(_0x1516('0xc1'));}})['spread'](function(_0x24b670,_0x2352b8){if(_0x2352b8){return _0x24b670;}return db['FaxMessage']['create']({'direction':_0x1516('0xbf'),'read':![],'body':_0x1d383f['body'][_0x1516('0xb4')][0x0]['filename'],'FaxAccountId':_0x375cd8['id'],'FaxInteractionId':_0x24b670['id'],'UserId':_0x1d383f[_0x1516('0x61')]['id'],'ContactId':_0x24b670[_0x1516('0xc2')],'AttachmentId':_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][0x0]['id']})[_0x1516('0x25')](function(_0x1b4571){_0x24b670['dataValues'][_0x1516('0xc0')]=[];_0x24b670[_0x1516('0xc3')][_0x1516('0xc0')][_0x1516('0x93')](_0x1b4571['dataValues']);return _0x24b670;});})[_0x1516('0x25')](function(_0x32107c){respondWithRpcPromise('SendFax',_0x1516('0xc4'),{'FaxAccountId':_[_0x1516('0xb9')](_0x1d383f['params']['id'])?undefined:_0x1d383f[_0x1516('0x69')]['id'],'path':_[_0x1516('0xb9')](_0x1d383f[_0x1516('0x67')]['attachments'][0x0]['path'])?undefined:_0x1d383f['body']['attachments'][0x0][_0x1516('0x9')],'fax':_[_0x1516('0xb9')](_0x1d383f['body']['to'][0x0])?undefined:_0x1d383f[_0x1516('0x67')]['to'][0x0],'AttachmentId':_0x1d383f[_0x1516('0x67')][_0x1516('0xb4')][0x0]['id']},client9002)[_0x1516('0x25')](function(_0x38e4e){logger['info'](_0x1516('0xc5'),_0x38e4e);})[_0x1516('0x2f')](function(_0x3dd576){logger[_0x1516('0x26')](_0x1516('0xc5'),_0x3dd576);});return _0x32107c;})['then'](respondWithResult(_0x44a4c6,null))[_0x1516('0x2f')](handleError(_0x44a4c6,null));};exports[_0x1516('0xc6')]=function(_0x3c8ae7,_0x25df30,_0x1a113c){return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0x3c8ae7[_0x1516('0x69')]['id']}})['then'](handleEntityNotFound(_0x25df30,null))[_0x1516('0x25')](function(_0x5611a2){if(_0x5611a2){return _0x5611a2[_0x1516('0xc6')](_0x3c8ae7[_0x1516('0x67')][_0x1516('0x77')],_['omit'](_0x3c8ae7['body'],[_0x1516('0x77'),'id'])||{})['spread'](function(_0x44dd86){for(var _0x595d92=0x0;_0x595d92<_0x3c8ae7[_0x1516('0x67')][_0x1516('0x77')][_0x1516('0x6f')];_0x595d92+=0x1){socket[_0x1516('0xc7')](_0x1516('0xc8'),{'UserId':Number(_0x3c8ae7['body'][_0x1516('0x77')][_0x595d92]),'FaxAccountId':Number(_0x3c8ae7['params']['id'])});}return _0x44dd86;});}})[_0x1516('0x25')](respondWithResult(_0x25df30,null))[_0x1516('0x2f')](handleError(_0x25df30,null));};exports['removeAgents']=function(_0x39b034,_0xe0932f,_0x1b16bc){return db[_0x1516('0x46')][_0x1516('0x5d')]({'where':{'id':_0x39b034[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0xe0932f,null))[_0x1516('0x25')](function(_0x2a8589){if(_0x2a8589){return _0x2a8589[_0x1516('0xc9')](_0x39b034[_0x1516('0x4c')][_0x1516('0x77')])['then'](function(){if(_[_0x1516('0xca')](_0x39b034[_0x1516('0x4c')][_0x1516('0x77')])){for(var _0x41803d=0x0;_0x41803d<_0x39b034[_0x1516('0x4c')]['ids']['length'];_0x41803d+=0x1){socket[_0x1516('0xc7')](_0x1516('0xcb'),{'UserId':Number(_0x39b034[_0x1516('0x4c')][_0x1516('0x77')][_0x41803d]),'FaxAccountId':Number(_0x39b034[_0x1516('0x69')]['id'])});}}else{socket[_0x1516('0xc7')](_0x1516('0xcb'),{'UserId':Number(_0x39b034[_0x1516('0x4c')][_0x1516('0x77')]),'FaxAccountId':Number(_0x39b034[_0x1516('0x69')]['id'])});}});}})[_0x1516('0x25')](respondWithStatusCode(_0xe0932f,null))[_0x1516('0x2f')](handleError(_0xe0932f,null));};exports['getAgents']=function(_0x3eeb38,_0x4ab455,_0xaa2f0d){var _0x17e8aa={};var _0x53d7a3={};var _0x31218a;var _0x12d7a7;return db[_0x1516('0x46')][_0x1516('0x6e')]({'where':{'id':_0x3eeb38[_0x1516('0x69')]['id']}})[_0x1516('0x25')](handleEntityNotFound(_0x4ab455,null))[_0x1516('0x25')](function(_0x14abe3){if(_0x14abe3){_0x31218a=_0x14abe3;_0x53d7a3[_0x1516('0x4b')]=_[_0x1516('0x4d')](db['User'][_0x1516('0x47')]);_0x53d7a3[_0x1516('0x4c')]=_[_0x1516('0x4d')](_0x3eeb38[_0x1516('0x4c')]);_0x53d7a3['filters']=_[_0x1516('0x4f')](_0x53d7a3[_0x1516('0x4b')],_0x53d7a3['query']);_0x17e8aa[_0x1516('0x50')]=_['intersection'](_0x53d7a3['model'],qs['fields'](_0x3eeb38[_0x1516('0x4c')]['fields']));_0x17e8aa[_0x1516('0x50')]=_0x17e8aa[_0x1516('0x50')][_0x1516('0x6f')]?_0x17e8aa[_0x1516('0x50')]:_0x53d7a3[_0x1516('0x4b')];_0x17e8aa[_0x1516('0x52')]=qs[_0x1516('0x72')](_0x3eeb38[_0x1516('0x4c')]['sort']);_0x17e8aa[_0x1516('0x53')]=qs[_0x1516('0x4e')](_[_0x1516('0x54')](_0x3eeb38[_0x1516('0x4c')],_0x53d7a3[_0x1516('0x4e')]));if(_0x3eeb38[_0x1516('0x4c')][_0x1516('0x55')]){_0x17e8aa['where']=_[_0x1516('0x56')](_0x17e8aa[_0x1516('0x53')],{'$or':_[_0x1516('0x45')](_0x17e8aa[_0x1516('0x50')],function(_0x2d2f4f){var _0x5c6c7d={};_0x5c6c7d[_0x2d2f4f]={'$like':'%'+_0x3eeb38[_0x1516('0x4c')][_0x1516('0x55')]+'%'};return _0x5c6c7d;})});}_0x17e8aa=_[_0x1516('0x56')]({},_0x17e8aa,_0x3eeb38['options']);return _0x31218a[_0x1516('0xcc')](_0x17e8aa);}})[_0x1516('0x25')](function(_0x8c30ca){if(_0x8c30ca){_0x12d7a7=_0x8c30ca[_0x1516('0x6f')];if(!_0x3eeb38[_0x1516('0x4c')]['hasOwnProperty']('nolimit')){_0x17e8aa[_0x1516('0x37')]=qs[_0x1516('0x37')](_0x3eeb38[_0x1516('0x4c')][_0x1516('0x37')]);_0x17e8aa[_0x1516('0x34')]=qs[_0x1516('0x34')](_0x3eeb38['query'][_0x1516('0x34')]);}return _0x31218a['getAgents'](_0x17e8aa);}})[_0x1516('0x25')](function(_0x14035a){if(_0x14035a){return _0x14035a?{'count':_0x12d7a7,'rows':_0x14035a}:null;}})[_0x1516('0x25')](respondWithResult(_0x4ab455,null))[_0x1516('0x2f')](handleError(_0x4ab455,null));}; \ No newline at end of file +var _0x137c=['nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','Pause','keys','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','includeAll','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','finally','getApplications','order','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','key','createdAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','attachments','join','root','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','addAgents','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','FaxAccount','fieldName','type','query','filters','intersection','model','fields','attributes','length'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x137c,0x141));var _0xc137=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x137c[_0x3b3cc6];return _0x1161e4;};'use strict';var emlformat=require(_0xc137('0x0'));var rimraf=require(_0xc137('0x1'));var zipdir=require(_0xc137('0x2'));var jsonpatch=require(_0xc137('0x3'));var rp=require(_0xc137('0x4'));var moment=require(_0xc137('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc137('0x6'));var path=require(_0xc137('0x7'));var sox=require(_0xc137('0x8'));var csv=require(_0xc137('0x9'));var ejs=require(_0xc137('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc137('0xb'));var squel=require(_0xc137('0xc'));var crypto=require(_0xc137('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc137('0xe'));var toCsv=require(_0xc137('0x9'));var querystring=require(_0xc137('0xf'));var Papa=require(_0xc137('0x10'));var Redis=require(_0xc137('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc137('0x12'));var as=require(_0xc137('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc137('0x14'))(_0xc137('0x15'));var utils=require(_0xc137('0x16'));var config=require(_0xc137('0x17'));var licenseUtil=require(_0xc137('0x18'));var db=require(_0xc137('0x19'))['db'];config[_0xc137('0x1a')]=_['defaults'](config['redis'],{'host':_0xc137('0x1b'),'port':0x18eb});var socket=require(_0xc137('0x1c'))(new Redis(config[_0xc137('0x1a')]));require(_0xc137('0x1d'))[_0xc137('0x1e')](socket);var jayson=require(_0xc137('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc137('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad6d3,_0x3d0323,_0x410139,_0x344c5f){return new BPromise(function(_0x255e34,_0x74f850){var _0x464f8d=_0x344c5f||client;return _0x464f8d[_0xc137('0x21')](_0x2ad6d3,_0x410139)[_0xc137('0x22')](function(_0x2ffaea){logger[_0xc137('0x23')](_0xc137('0x24'),_0x3d0323,'request\x20sent');logger[_0xc137('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3d0323,_0xc137('0x26'),JSON[_0xc137('0x27')](_0x2ffaea));if(_0x2ffaea['error']){if(_0x2ffaea[_0xc137('0x28')]['code']===0x1f4){logger['error'](_0xc137('0x24'),_0x3d0323,_0x2ffaea['error']['message']);return _0x74f850(_0x2ffaea[_0xc137('0x28')][_0xc137('0x29')]);}logger[_0xc137('0x28')]('FaxAccount,\x20%s,\x20%s',_0x3d0323,_0x2ffaea[_0xc137('0x28')][_0xc137('0x29')]);return _0x255e34(_0x2ffaea[_0xc137('0x28')][_0xc137('0x29')]);}else{logger['info'](_0xc137('0x24'),_0x3d0323,_0xc137('0x26'));_0x255e34(_0x2ffaea[_0xc137('0x2a')]['message']);}})['catch'](function(_0x3a72d8){logger[_0xc137('0x28')](_0xc137('0x24'),_0x3d0323,_0x3a72d8);_0x74f850(_0x3a72d8);});});}function respondWithStatusCode(_0x14fa23,_0x2f1677){_0x2f1677=_0x2f1677||0xcc;return function(_0x23cf5d){if(_0x23cf5d){return _0x14fa23[_0xc137('0x2b')](_0x2f1677);}return _0x14fa23[_0xc137('0x2c')](_0x2f1677)[_0xc137('0x2d')]();};}function respondWithResult(_0x1250d8,_0x6d6692){_0x6d6692=_0x6d6692||0xc8;return function(_0xad0998){if(_0xad0998){return _0x1250d8[_0xc137('0x2c')](_0x6d6692)[_0xc137('0x2e')](_0xad0998);}};}function respondWithFilteredResult(_0x5ae6df,_0x4c7a7f){return function(_0x1896c9){if(_0x1896c9){var _0x1208d9=typeof _0x4c7a7f[_0xc137('0x2f')]===_0xc137('0x30')&&typeof _0x4c7a7f[_0xc137('0x31')]===_0xc137('0x30');var _0x571746=_0x1896c9[_0xc137('0x32')];var _0x13bf3c=_0x1208d9?0x0:_0x4c7a7f[_0xc137('0x2f')];var _0x22886f=_0x1208d9?_0x1896c9[_0xc137('0x32')]:_0x4c7a7f[_0xc137('0x2f')]+_0x4c7a7f[_0xc137('0x31')];var _0x46a484;if(_0x22886f>=_0x571746){_0x22886f=_0x571746;_0x46a484=0xc8;}else{_0x46a484=0xce;}_0x5ae6df[_0xc137('0x2c')](_0x46a484);return _0x5ae6df[_0xc137('0x33')](_0xc137('0x34'),_0x13bf3c+'-'+_0x22886f+'/'+_0x571746)['json'](_0x1896c9);}return null;};}function patchUpdates(_0x143160){return function(_0x4e5576){try{jsonpatch['apply'](_0x4e5576,_0x143160,!![]);}catch(_0x58d94e){return BPromise[_0xc137('0x35')](_0x58d94e);}return _0x4e5576[_0xc137('0x36')]();};}function saveUpdates(_0x1748f5,_0x330b5d){return function(_0x202208){if(_0x202208){return _0x202208[_0xc137('0x37')](_0x1748f5)['then'](function(_0x1fa8cf){return _0x1fa8cf;});}return null;};}function removeEntity(_0x413811,_0x127918){return function(_0x3cd0c7){if(_0x3cd0c7){return _0x3cd0c7[_0xc137('0x38')]()[_0xc137('0x22')](function(){var _0x425f5f=_0x3cd0c7[_0xc137('0x39')]({'plain':!![]});var _0x30b1a9=_0xc137('0x3a');return db[_0xc137('0x3b')][_0xc137('0x38')]({'where':{'type':_0x30b1a9,'resourceId':_0x425f5f['id']}})[_0xc137('0x22')](function(){return _0x3cd0c7;});})['then'](function(){_0x413811['status'](0xcc)[_0xc137('0x2d')]();});}};}function handleEntityNotFound(_0x3da459,_0x1462ff){return function(_0xac6e38){if(!_0xac6e38){_0x3da459[_0xc137('0x2b')](0x194);}return _0xac6e38;};}function handleError(_0x4bd2f9,_0x43bd74){_0x43bd74=_0x43bd74||0x1f4;return function(_0x30a4a5){logger[_0xc137('0x28')](_0x30a4a5[_0xc137('0x3c')]);if(_0x30a4a5[_0xc137('0x3d')]){delete _0x30a4a5[_0xc137('0x3d')];}_0x4bd2f9[_0xc137('0x2c')](_0x43bd74)[_0xc137('0x3e')](_0x30a4a5);};}exports['index']=function(_0x5d7bf6,_0x5fa675){var _0x42f1cd={'include':[{'model':db['Pause'],'as':_0xc137('0x3f')}]},_0x5e84ee={},_0x1344a1={'count':0x0,'rows':[]};var _0x404efb=_[_0xc137('0x40')](db[_0xc137('0x41')]['rawAttributes'],function(_0x367c07){return{'name':_0x367c07[_0xc137('0x42')],'type':_0x367c07[_0xc137('0x43')]['key']};});_0x5e84ee['model']=_[_0xc137('0x40')](_0x404efb,_0xc137('0x3d'));_0x5e84ee['query']=_['keys'](_0x5d7bf6[_0xc137('0x44')]);_0x5e84ee[_0xc137('0x45')]=_[_0xc137('0x46')](_0x5e84ee[_0xc137('0x47')],_0x5e84ee[_0xc137('0x44')]);_0x42f1cd['attributes']=_[_0xc137('0x46')](_0x5e84ee[_0xc137('0x47')],qs[_0xc137('0x48')](_0x5d7bf6[_0xc137('0x44')][_0xc137('0x48')]));_0x42f1cd[_0xc137('0x49')]=_0x42f1cd[_0xc137('0x49')][_0xc137('0x4a')]?_0x42f1cd[_0xc137('0x49')]:_0x5e84ee['model'];if(!_0x5d7bf6['query']['hasOwnProperty'](_0xc137('0x4b'))){_0x42f1cd[_0xc137('0x31')]=qs['limit'](_0x5d7bf6['query'][_0xc137('0x31')]);_0x42f1cd[_0xc137('0x2f')]=qs[_0xc137('0x2f')](_0x5d7bf6['query'][_0xc137('0x2f')]);}_0x42f1cd['order']=qs[_0xc137('0x4c')](_0x5d7bf6[_0xc137('0x44')]['sort']);_0x42f1cd[_0xc137('0x4d')]=qs[_0xc137('0x45')](_[_0xc137('0x4e')](_0x5d7bf6[_0xc137('0x44')],_0x5e84ee[_0xc137('0x45')]),_0x404efb);if(_0x5d7bf6[_0xc137('0x44')][_0xc137('0x4f')]){_0x42f1cd[_0xc137('0x4d')]=_['merge'](_0x42f1cd[_0xc137('0x4d')],{'$or':_['map'](_0x404efb,function(_0x309c8f){if(_0x309c8f['type']!=='VIRTUAL'){var _0x4d3504={};_0x4d3504[_0x309c8f[_0xc137('0x3d')]]={'$like':'%'+_0x5d7bf6['query'][_0xc137('0x4f')]+'%'};return _0x4d3504;}})});}_0x42f1cd=_[_0xc137('0x50')]({},_0x42f1cd,_0x5d7bf6[_0xc137('0x51')]);var _0x2791c4={'where':_0x42f1cd['where']};return db[_0xc137('0x41')][_0xc137('0x32')](_0x2791c4)[_0xc137('0x22')](function(_0x487792){_0x1344a1[_0xc137('0x32')]=_0x487792;if(_0x5d7bf6[_0xc137('0x44')]['includeAll']){_0x42f1cd[_0xc137('0x52')]=[{'all':!![]}];}return db['FaxAccount'][_0xc137('0x53')](_0x42f1cd);})['then'](function(_0x1bf4b0){_0x1344a1[_0xc137('0x54')]=_0x1bf4b0;return _0x1344a1;})[_0xc137('0x22')](respondWithFilteredResult(_0x5fa675,_0x42f1cd))[_0xc137('0x55')](handleError(_0x5fa675,null));};exports[_0xc137('0x56')]=function(_0x4a7622,_0x48ee2a){var _0x1019be={'raw':![],'where':{'id':_0x4a7622[_0xc137('0x57')]['id']},'include':[{'model':db[_0xc137('0x58')],'as':_0xc137('0x3f')}]},_0x178fca={};_0x178fca[_0xc137('0x47')]=_[_0xc137('0x59')](db['FaxAccount'][_0xc137('0x5a')]);_0x178fca[_0xc137('0x44')]=_[_0xc137('0x59')](_0x4a7622[_0xc137('0x44')]);_0x178fca[_0xc137('0x45')]=_['intersection'](_0x178fca['model'],_0x178fca[_0xc137('0x44')]);_0x1019be[_0xc137('0x49')]=_['intersection'](_0x178fca[_0xc137('0x47')],qs['fields'](_0x4a7622[_0xc137('0x44')][_0xc137('0x48')]));_0x1019be[_0xc137('0x49')]=_0x1019be[_0xc137('0x49')][_0xc137('0x4a')]?_0x1019be[_0xc137('0x49')]:_0x178fca['model'];if(_0x4a7622[_0xc137('0x44')]['includeAll']){_0x1019be[_0xc137('0x52')]=[{'all':!![]}];}_0x1019be=_[_0xc137('0x50')]({},_0x1019be,_0x4a7622['options']);return db[_0xc137('0x41')][_0xc137('0x5b')](_0x1019be)[_0xc137('0x22')](handleEntityNotFound(_0x48ee2a,null))[_0xc137('0x22')](respondWithResult(_0x48ee2a,null))[_0xc137('0x55')](handleError(_0x48ee2a,null));};exports[_0xc137('0x5c')]=function(_0x3693dc,_0x4efc50){return db[_0xc137('0x41')][_0xc137('0x5c')](_0x3693dc[_0xc137('0x5d')],{})[_0xc137('0x22')](function(_0x71ae8c){var _0x1f87cf=_0x3693dc[_0xc137('0x5e')][_0xc137('0x39')]({'plain':!![]});if(!_0x1f87cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f87cf[_0xc137('0x5f')]==='user'){var _0x107bc9=_0x71ae8c['get']({'plain':!![]});var _0x2c7ee9='FaxAccounts';return db[_0xc137('0x60')][_0xc137('0x5b')]({'where':{'name':_0x2c7ee9,'userProfileId':_0x1f87cf['userProfileId']},'raw':!![]})[_0xc137('0x22')](function(_0x2a27d6){if(_0x2a27d6&&_0x2a27d6[_0xc137('0x61')]===0x0){return db['UserProfileResource'][_0xc137('0x5c')]({'name':_0x107bc9[_0xc137('0x3d')],'resourceId':_0x107bc9['id'],'type':_0x2a27d6[_0xc137('0x3d')],'sectionId':_0x2a27d6['id']},{})[_0xc137('0x22')](function(){return _0x71ae8c;});}else{return _0x71ae8c;}})[_0xc137('0x55')](function(_0x4c0f07){logger[_0xc137('0x28')](_0xc137('0x62'),_0x4c0f07);throw _0x4c0f07;});}return _0x71ae8c;})[_0xc137('0x22')](respondWithResult(_0x4efc50,0xc9))[_0xc137('0x55')](handleError(_0x4efc50,null));};exports[_0xc137('0x37')]=function(_0x2ef0bb,_0x1cfdaf){if(_0x2ef0bb[_0xc137('0x5d')]['id']){delete _0x2ef0bb[_0xc137('0x5d')]['id'];}return db[_0xc137('0x41')]['find']({'where':{'id':_0x2ef0bb['params']['id']},'include':[{'model':db[_0xc137('0x58')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1cfdaf,null))['then'](saveUpdates(_0x2ef0bb[_0xc137('0x5d')],null))[_0xc137('0x22')](respondWithResult(_0x1cfdaf,null))[_0xc137('0x55')](handleError(_0x1cfdaf,null));};exports[_0xc137('0x38')]=function(_0x2bb8a6,_0x2931ea){return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x2bb8a6[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x2931ea,null))[_0xc137('0x22')](removeEntity(_0x2931ea,null))['catch'](handleError(_0x2931ea,null));};exports[_0xc137('0x63')]=function(_0x4fff68,_0x1b3d5f){return db['FaxAccount'][_0xc137('0x63')]()[_0xc137('0x22')](respondWithResult(_0x1b3d5f,null))[_0xc137('0x55')](handleError(_0x1b3d5f,null));};exports[_0xc137('0x64')]=function(_0x2d48e0,_0x205956,_0x1cf48f){if(_0x2d48e0[_0xc137('0x5d')]['id']){delete _0x2d48e0[_0xc137('0x5d')]['id'];}return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x2d48e0['params']['id']}})['then'](handleEntityNotFound(_0x205956,null))[_0xc137('0x22')](function(_0x3439f8){if(_0x3439f8){_0x2d48e0[_0xc137('0x5d')][_0xc137('0x65')]=_0x3439f8['id'];return db['Disposition'][_0xc137('0x5c')](_0x2d48e0[_0xc137('0x5d')]);}})['then'](respondWithResult(_0x205956,null))[_0xc137('0x55')](handleError(_0x205956,null));};exports[_0xc137('0x66')]=function(_0x9ca422,_0x1816ec,_0x550217){var _0x2e1d6c={'raw':![],'where':{}};var _0x113afe={};var _0x5f4a27={'count':0x0,'rows':[]};return db[_0xc137('0x41')][_0xc137('0x67')]({'where':{'id':_0x9ca422[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x1816ec,null))[_0xc137('0x22')](function(_0x9633d3){if(_0x9633d3){_0x113afe[_0xc137('0x47')]=_['keys'](db[_0xc137('0x68')][_0xc137('0x5a')]);_0x113afe['query']=_[_0xc137('0x59')](_0x9ca422[_0xc137('0x44')]);_0x113afe[_0xc137('0x45')]=_['intersection'](_0x113afe['model'],_0x113afe[_0xc137('0x44')]);_0x2e1d6c[_0xc137('0x49')]=_[_0xc137('0x46')](_0x113afe[_0xc137('0x47')],qs['fields'](_0x9ca422[_0xc137('0x44')][_0xc137('0x48')]));_0x2e1d6c['attributes']=_0x2e1d6c['attributes'][_0xc137('0x4a')]?_0x2e1d6c[_0xc137('0x49')]:_0x113afe[_0xc137('0x47')];if(!_0x9ca422[_0xc137('0x44')][_0xc137('0x69')](_0xc137('0x4b'))){_0x2e1d6c[_0xc137('0x31')]=qs['limit'](_0x9ca422[_0xc137('0x44')]['limit']);_0x2e1d6c['offset']=qs[_0xc137('0x2f')](_0x9ca422[_0xc137('0x44')][_0xc137('0x2f')]);}_0x2e1d6c['order']=qs[_0xc137('0x4c')](_0x9ca422[_0xc137('0x44')][_0xc137('0x4c')]);_0x2e1d6c['where']=qs[_0xc137('0x45')](_[_0xc137('0x4e')](_0x9ca422[_0xc137('0x44')],_0x113afe[_0xc137('0x45')]));_0x2e1d6c[_0xc137('0x4d')]['FaxAccountId']=_0x9633d3['id'];if(_0x9ca422[_0xc137('0x44')][_0xc137('0x4f')]){_0x2e1d6c[_0xc137('0x4d')]=_[_0xc137('0x50')](_0x2e1d6c[_0xc137('0x4d')],{'$or':_[_0xc137('0x40')](_0x2e1d6c[_0xc137('0x49')],function(_0x3e8b81){var _0x242264={};_0x242264[_0x3e8b81]={'$like':'%'+_0x9ca422[_0xc137('0x44')][_0xc137('0x4f')]+'%'};return _0x242264;})});}_0x2e1d6c=_[_0xc137('0x50')]({},_0x2e1d6c,_0x9ca422[_0xc137('0x51')]);return db['Disposition'][_0xc137('0x32')]({'where':_0x2e1d6c[_0xc137('0x4d')]})[_0xc137('0x22')](function(_0xd73065){_0x5f4a27['count']=_0xd73065;if(_0x9ca422[_0xc137('0x44')]['includeAll']){_0x2e1d6c[_0xc137('0x52')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2e1d6c);})[_0xc137('0x22')](function(_0x138812){_0x5f4a27[_0xc137('0x54')]=_0x138812;return _0x5f4a27;});}})['then'](respondWithFilteredResult(_0x1816ec,_0x2e1d6c))[_0xc137('0x55')](handleError(_0x1816ec,null));};exports[_0xc137('0x6a')]=function(_0x2fe91a,_0x125193,_0x510aad){return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x2fe91a['params']['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x125193,null))['then'](function(_0x3f2128){if(_0x3f2128){return _0x3f2128[_0xc137('0x6a')](_0x2fe91a[_0xc137('0x44')][_0xc137('0x6b')]);}})[_0xc137('0x22')](respondWithStatusCode(_0x125193,null))['catch'](handleError(_0x125193,null));};exports[_0xc137('0x6c')]=function(_0x2f85af,_0x42ac32,_0x472a38){if(_0x2f85af[_0xc137('0x5d')]['id']){delete _0x2f85af[_0xc137('0x5d')]['id'];}return db[_0xc137('0x41')]['find']({'where':{'id':_0x2f85af['params']['id']}})['then'](handleEntityNotFound(_0x42ac32,null))[_0xc137('0x22')](function(_0x1883d3){if(_0x1883d3){_0x2f85af[_0xc137('0x5d')][_0xc137('0x65')]=_0x1883d3['id'];return db[_0xc137('0x6d')][_0xc137('0x5c')](_0x2f85af[_0xc137('0x5d')]);}})[_0xc137('0x22')](respondWithResult(_0x42ac32,null))[_0xc137('0x55')](handleError(_0x42ac32,null));};exports[_0xc137('0x6e')]=function(_0x5a08cc,_0x114d17,_0x5b1342){var _0x44e814={'raw':![],'where':{}};var _0x544346={};var _0x49b54f={'count':0x0,'rows':[]};return db[_0xc137('0x41')][_0xc137('0x67')]({'where':{'id':_0x5a08cc[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x114d17,null))[_0xc137('0x22')](function(_0xc91055){if(_0xc91055){_0x544346[_0xc137('0x47')]=_[_0xc137('0x59')](db[_0xc137('0x6d')][_0xc137('0x5a')]);_0x544346[_0xc137('0x44')]=_[_0xc137('0x59')](_0x5a08cc[_0xc137('0x44')]);_0x544346['filters']=_[_0xc137('0x46')](_0x544346[_0xc137('0x47')],_0x544346[_0xc137('0x44')]);_0x44e814[_0xc137('0x49')]=_[_0xc137('0x46')](_0x544346[_0xc137('0x47')],qs[_0xc137('0x48')](_0x5a08cc[_0xc137('0x44')][_0xc137('0x48')]));_0x44e814[_0xc137('0x49')]=_0x44e814[_0xc137('0x49')][_0xc137('0x4a')]?_0x44e814['attributes']:_0x544346[_0xc137('0x47')];if(!_0x5a08cc['query'][_0xc137('0x69')](_0xc137('0x4b'))){_0x44e814['limit']=qs[_0xc137('0x31')](_0x5a08cc[_0xc137('0x44')][_0xc137('0x31')]);_0x44e814['offset']=qs[_0xc137('0x2f')](_0x5a08cc['query'][_0xc137('0x2f')]);}_0x44e814['order']=qs['sort'](_0x5a08cc['query'][_0xc137('0x4c')]);_0x44e814[_0xc137('0x4d')]=qs[_0xc137('0x45')](_[_0xc137('0x4e')](_0x5a08cc['query'],_0x544346[_0xc137('0x45')]));_0x44e814[_0xc137('0x4d')][_0xc137('0x65')]=_0xc91055['id'];if(_0x5a08cc['query']['filter']){_0x44e814[_0xc137('0x4d')]=_['merge'](_0x44e814['where'],{'$or':_[_0xc137('0x40')](_0x44e814[_0xc137('0x49')],function(_0x91ba74){var _0x4d48d4={};_0x4d48d4[_0x91ba74]={'$like':'%'+_0x5a08cc[_0xc137('0x44')][_0xc137('0x4f')]+'%'};return _0x4d48d4;})});}_0x44e814=_[_0xc137('0x50')]({},_0x44e814,_0x5a08cc[_0xc137('0x51')]);return db[_0xc137('0x6d')]['count']({'where':_0x44e814[_0xc137('0x4d')]})[_0xc137('0x22')](function(_0x4611db){_0x49b54f[_0xc137('0x32')]=_0x4611db;if(_0x5a08cc[_0xc137('0x44')]['includeAll']){_0x44e814['include']=[{'all':!![]}];}return db[_0xc137('0x6d')][_0xc137('0x53')](_0x44e814);})[_0xc137('0x22')](function(_0x1bf157){_0x49b54f[_0xc137('0x54')]=_0x1bf157;return _0x49b54f;});}})[_0xc137('0x22')](respondWithFilteredResult(_0x114d17,_0x44e814))[_0xc137('0x55')](handleError(_0x114d17,null));};exports[_0xc137('0x6f')]=function(_0x12b5d2,_0x21dfc1,_0x483c71){return db['FaxAccount'][_0xc137('0x5b')]({'where':{'id':_0x12b5d2[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x21dfc1,null))['then'](function(_0x4b0364){if(_0x4b0364){return _0x4b0364['removeAnswers'](_0x12b5d2[_0xc137('0x44')][_0xc137('0x6b')]);}})[_0xc137('0x22')](respondWithStatusCode(_0x21dfc1,null))['catch'](handleError(_0x21dfc1,null));};exports[_0xc137('0x70')]=function(_0x2366a6,_0x31a1b3,_0x2ff5a8){return db[_0xc137('0x71')][_0xc137('0x5b')]({'where':{'id':_0x2366a6['params']['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x31a1b3,null))[_0xc137('0x22')](function(_0x3d67cd){if(_0x3d67cd){return _0x3d67cd[_0xc137('0x70')](_0x2366a6[_0xc137('0x5d')][_0xc137('0x6b')],_[_0xc137('0x72')](_0x2366a6[_0xc137('0x5d')],[_0xc137('0x6b'),'id'])||{});}})[_0xc137('0x22')](respondWithResult(_0x31a1b3,null))[_0xc137('0x55')](handleError(_0x31a1b3,null));};exports[_0xc137('0x73')]=function(_0x426f4d,_0x58ac02,_0x3f9416){var _0x4b5958={'raw':![],'where':{}};var _0x39a65a={};var _0x572f4a={'count':0x0,'rows':[]};return db[_0xc137('0x41')][_0xc137('0x67')]({'where':{'id':_0x426f4d[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x58ac02,null))[_0xc137('0x22')](function(_0xd3d2d0){if(_0xd3d2d0){_0x39a65a[_0xc137('0x47')]=_[_0xc137('0x59')](db[_0xc137('0x71')][_0xc137('0x5a')]);_0x39a65a[_0xc137('0x44')]=_[_0xc137('0x59')](_0x426f4d['query']);_0x39a65a[_0xc137('0x45')]=_['intersection'](_0x39a65a[_0xc137('0x47')],_0x39a65a[_0xc137('0x44')]);_0x4b5958[_0xc137('0x49')]=_[_0xc137('0x46')](_0x39a65a[_0xc137('0x47')],qs[_0xc137('0x48')](_0x426f4d[_0xc137('0x44')][_0xc137('0x48')]));_0x4b5958[_0xc137('0x49')]=_0x4b5958['attributes'][_0xc137('0x4a')]?_0x4b5958[_0xc137('0x49')]:_0x39a65a[_0xc137('0x47')];if(!_0x426f4d['query'][_0xc137('0x69')](_0xc137('0x4b'))){_0x4b5958[_0xc137('0x31')]=qs[_0xc137('0x31')](_0x426f4d[_0xc137('0x44')][_0xc137('0x31')]);_0x4b5958[_0xc137('0x2f')]=qs['offset'](_0x426f4d[_0xc137('0x44')]['offset']);}_0x4b5958['order']=qs[_0xc137('0x4c')](_0x426f4d[_0xc137('0x44')][_0xc137('0x4c')]);_0x4b5958[_0xc137('0x4d')]=qs['filters'](_['pick'](_0x426f4d['query'],_0x39a65a[_0xc137('0x45')]));_0x4b5958[_0xc137('0x4d')]['FaxAccountId']=_0xd3d2d0['id'];if(_0x426f4d[_0xc137('0x44')][_0xc137('0x4f')]){_0x4b5958[_0xc137('0x4d')]=_['merge'](_0x4b5958[_0xc137('0x4d')],{'$or':_[_0xc137('0x40')](_0x4b5958[_0xc137('0x49')],function(_0x5e4baf){var _0x31e0ef={};_0x31e0ef[_0x5e4baf]={'$like':'%'+_0x426f4d[_0xc137('0x44')]['filter']+'%'};return _0x31e0ef;})});}_0x4b5958=_['merge']({},_0x4b5958,_0x426f4d[_0xc137('0x51')]);return db[_0xc137('0x71')][_0xc137('0x32')]({'where':_0x4b5958['where']})[_0xc137('0x22')](function(_0xc75325){_0x572f4a[_0xc137('0x32')]=_0xc75325;if(_0x426f4d['query'][_0xc137('0x74')]){_0x4b5958[_0xc137('0x52')]=[{'model':db[_0xc137('0x75')],'as':_0xc137('0x76'),'required':![]},{'model':db['User'],'as':_0xc137('0x77'),'attributes':[_0xc137('0x3d'),_0xc137('0x78'),_0xc137('0x79')],'required':![]},{'model':db[_0xc137('0x7a')],'as':_0xc137('0x7b'),'attributes':['id',_0xc137('0x3d'),_0xc137('0x7c')],'where':_0x426f4d[_0xc137('0x44')]['tag']?{'id':_0x426f4d[_0xc137('0x44')][_0xc137('0x7d')]}:undefined,'required':_0x426f4d[_0xc137('0x44')]['tag']?!![]:![]}];}return db[_0xc137('0x71')]['findAll'](_0x4b5958);})[_0xc137('0x22')](function(_0x113f61){_0x572f4a[_0xc137('0x54')]=_0x113f61;return _0x572f4a;});}})[_0xc137('0x22')](respondWithFilteredResult(_0x58ac02,_0x4b5958))[_0xc137('0x55')](handleError(_0x58ac02,null));};exports[_0xc137('0x7e')]=function(_0x2dd545,_0x40f6da){var _0x742622=_0x2dd545['params']['id'];var _0x317610=_0x2dd545[_0xc137('0x5d')];var _0x3aadd6=0xc8;var _0x48c59b=null;return db['sequelize'][_0xc137('0x7f')]({'isolationLevel':db[_0xc137('0x80')][_0xc137('0x81')][_0xc137('0x82')][_0xc137('0x83')]},function(_0x1932b7){return db[_0xc137('0x41')]['findOne']({'where':{'id':_0x742622},'transaction':_0x1932b7})[_0xc137('0x22')](function(_0x3f9744){if(_0x3f9744){return db['FaxApplication'][_0xc137('0x38')]({'where':{'FaxAccountId':_0x742622},'transaction':_0x1932b7})['then'](function(){var _0x4c116a=_[_0xc137('0x40')](_0x317610,function(_0x811b3){_0x811b3[_0xc137('0x65')]=_0x742622;return _0x811b3;});return db['FaxApplication'][_0xc137('0x84')](_0x4c116a,{'transaction':_0x1932b7});});}else{_0x3aadd6=0x194;_0x48c59b=[];}});})[_0xc137('0x22')](function(){if(_0x3aadd6!==0x194){return db[_0xc137('0x85')][_0xc137('0x86')]({'where':{'FaxAccountId':_0x742622},'order':'priority'})[_0xc137('0x22')](function(_0x8f6730){_0x48c59b=_0x8f6730;});}})['catch'](function(_0x4469ed){_0x3aadd6=0x1f4;logger[_0xc137('0x28')](_0x4469ed[_0xc137('0x3c')]);if(_0x4469ed[_0xc137('0x3d')]){delete _0x4469ed['name'];}_0x48c59b=_0x4469ed;})[_0xc137('0x87')](function(){if(_0x48c59b===null){_0x40f6da[_0xc137('0x2b')](_0x3aadd6);}else{if(_0x3aadd6===0x1f4){_0x40f6da[_0xc137('0x2c')](_0x3aadd6)[_0xc137('0x3e')](_0x48c59b);}else{_0x40f6da[_0xc137('0x2c')](_0x3aadd6)[_0xc137('0x2e')](_0x48c59b);}}});};exports[_0xc137('0x88')]=function(_0x31a898,_0x1c03bb,_0x49fefc){var _0x45ebd3={};var _0x409cdd={};var _0x43576e;var _0x9f565a;return db[_0xc137('0x41')][_0xc137('0x67')]({'where':{'id':_0x31a898[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x1c03bb,null))['then'](function(_0x3c84cc){if(_0x3c84cc){_0x43576e=_0x3c84cc;_0x409cdd['model']=_[_0xc137('0x59')](db['FaxApplication'][_0xc137('0x5a')]);_0x409cdd[_0xc137('0x44')]=_[_0xc137('0x59')](_0x31a898[_0xc137('0x44')]);_0x409cdd['filters']=_['intersection'](_0x409cdd[_0xc137('0x47')],_0x409cdd[_0xc137('0x44')]);_0x45ebd3[_0xc137('0x49')]=_[_0xc137('0x46')](_0x409cdd[_0xc137('0x47')],qs[_0xc137('0x48')](_0x31a898[_0xc137('0x44')][_0xc137('0x48')]));_0x45ebd3[_0xc137('0x49')]=_0x45ebd3['attributes'][_0xc137('0x4a')]?_0x45ebd3['attributes']:_0x409cdd[_0xc137('0x47')];_0x45ebd3[_0xc137('0x89')]=qs[_0xc137('0x4c')](_0x31a898[_0xc137('0x44')][_0xc137('0x4c')]);_0x45ebd3[_0xc137('0x4d')]=qs[_0xc137('0x45')](_[_0xc137('0x4e')](_0x31a898[_0xc137('0x44')],_0x409cdd['filters']));if(_0x31a898[_0xc137('0x44')][_0xc137('0x4f')]){_0x45ebd3['where']=_[_0xc137('0x50')](_0x45ebd3[_0xc137('0x4d')],{'$or':_[_0xc137('0x40')](_0x45ebd3[_0xc137('0x49')],function(_0x5ca590){var _0x8f3b0d={};_0x8f3b0d[_0x5ca590]={'$like':'%'+_0x31a898['query'][_0xc137('0x4f')]+'%'};return _0x8f3b0d;})});}_0x45ebd3=_[_0xc137('0x50')]({},_0x45ebd3,_0x31a898[_0xc137('0x51')]);return _0x43576e['getApplications'](_0x45ebd3);}})[_0xc137('0x22')](function(_0x5b7aef){if(_0x5b7aef){_0x9f565a=_0x5b7aef['length'];if(!_0x31a898[_0xc137('0x44')][_0xc137('0x69')](_0xc137('0x4b'))){_0x45ebd3[_0xc137('0x31')]=qs[_0xc137('0x31')](_0x31a898[_0xc137('0x44')][_0xc137('0x31')]);_0x45ebd3[_0xc137('0x2f')]=qs[_0xc137('0x2f')](_0x31a898[_0xc137('0x44')][_0xc137('0x2f')]);}return _0x43576e['getApplications'](_0x45ebd3);}})[_0xc137('0x22')](function(_0x45b219){if(_0x45b219){return _0x45b219?{'count':_0x9f565a,'rows':_0x45b219}:null;}})[_0xc137('0x22')](respondWithResult(_0x1c03bb,null))['catch'](handleError(_0x1c03bb,null));};function Extension(_0x5d9e56,_0x33e153,_0x2a5c94,_0x47bc23){this[_0xc137('0x8a')]=_0xc137('0x8b');this[_0xc137('0x8c')]=_0x5d9e56[_0xc137('0x8d')];this[_0xc137('0x8e')]=_0x47bc23;this[_0xc137('0x43')]=_0xc137('0x8f');this[_0xc137('0x90')]=_0xc137('0x91');this[_0xc137('0x65')]=_0x5d9e56['id'];this[_0xc137('0x92')]=_0x33e153;this['appdata']=_0x2a5c94;}function createExtensionsReciveFax(_0x1b5c43){var _0x383adf=0x1;var _0x7d073=[];_0x7d073[_0xc137('0x93')](new Extension(_0x1b5c43,_0x383adf,'',_0xc137('0x94')));_0x383adf+=0x1;_0x7d073[_0xc137('0x93')](new Extension(_0x1b5c43,_0x383adf,_0xc137('0x95'),_0xc137('0x96')));_0x383adf+=0x1;for(var _0x2fbbaa in _0x1b5c43){if(_0x1b5c43[_0xc137('0x69')](_0x2fbbaa)&&(_0x2fbbaa===_0xc137('0x97')||_0x2fbbaa===_0xc137('0x8d')||_0x2fbbaa===_0xc137('0x98')||_0x2fbbaa==='faxdetect'||_0x2fbbaa===_0xc137('0x99')||_0x2fbbaa===_0xc137('0x9a')||_0x2fbbaa===_0xc137('0x9b')||_0x2fbbaa==='modem'||_0x2fbbaa===_0xc137('0x9c'))){_0x7d073[_0xc137('0x93')](new Extension(_0x1b5c43,_0x383adf,_0xc137('0x9d')+_0x2fbbaa+')='+_0x1b5c43[_0x2fbbaa],_0xc137('0x96')));_0x383adf+=0x1;}}_0x7d073['push'](new Extension(_0x1b5c43,_0x383adf,'6',_0xc137('0x9e')));_0x383adf+=0x1;_0x7d073[_0xc137('0x93')](new Extension(_0x1b5c43,_0x383adf,'/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',_0xc137('0x9f')));_0x383adf=0x0;return _0x7d073;}exports[_0xc137('0xa0')]=function(_0x3701bb,_0xbaeaf0,_0x291d66){var _0x2cf03c;return db['sequelize'][_0xc137('0x7f')](function(_0x29a3aa){return db[_0xc137('0x41')][_0xc137('0x5c')](_0x3701bb[_0xc137('0x5d')],{'transaction':_0x29a3aa})[_0xc137('0x22')](function(_0x2a7e99){_0x2cf03c=_0x2a7e99[_0xc137('0x39')]({'plain':!![]});return db['VoiceExtension'][_0xc137('0x84')](createExtensionsReciveFax(_0x2cf03c),{'transaction':_0x29a3aa});});})[_0xc137('0x22')](function(){return _0x2cf03c;})[_0xc137('0x22')](respondWithResult(_0xbaeaf0,null))[_0xc137('0x55')](handleError(_0xbaeaf0,null));};exports[_0xc137('0xa1')]=function(_0x45ca04,_0x2661d0,_0x440037){var _0x30a1de;return db[_0xc137('0x80')][_0xc137('0x7f')](function(_0x337085){return db['FaxAccount']['update'](_0x45ca04['body'],{'where':{'id':_0x45ca04[_0xc137('0x5d')]['id']},'transaction':_0x337085})['then'](function(_0x309079){return db['VoiceExtension'][_0xc137('0x38')]({'where':{'FaxAccountId':_0x45ca04[_0xc137('0x5d')]['id']},'transaction':_0x337085})['then'](function(_0x4d5c19){return db[_0xc137('0xa2')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x45ca04['body'],['tech',_0xc137('0xa3'),_0xc137('0xa4'),'updatedAt','TrunkId','ListId'])),{'transaction':_0x337085});});});})['then'](function(){return db['FaxAccount'][_0xc137('0xa5')](_0x45ca04[_0xc137('0x5d')]['id']);})[_0xc137('0x22')](respondWithResult(_0x2661d0,null))['catch'](handleError(_0x2661d0,null));};exports[_0xc137('0xa6')]=function(_0x3a8c1c,_0x4a245f,_0x125131){var _0x41137d={'raw':!![],'where':{}};var _0x8155ac={};var _0x4d63dc={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3a8c1c[_0xc137('0x57')]['id']}})['then'](handleEntityNotFound(_0x4a245f,null))[_0xc137('0x22')](function(_0x13f67d){if(_0x13f67d){_0x8155ac[_0xc137('0x47')]=_[_0xc137('0x59')](db[_0xc137('0xa7')][_0xc137('0x5a')]);_0x8155ac[_0xc137('0x44')]=_[_0xc137('0x59')](_0x3a8c1c[_0xc137('0x44')]);_0x8155ac['filters']=_[_0xc137('0x46')](_0x8155ac[_0xc137('0x47')],_0x8155ac['query']);_0x41137d[_0xc137('0x49')]=_[_0xc137('0x46')](_0x8155ac['model'],qs['fields'](_0x3a8c1c['query'][_0xc137('0x48')]));_0x41137d[_0xc137('0x49')]=_0x41137d['attributes'][_0xc137('0x4a')]?_0x41137d['attributes']:_0x8155ac[_0xc137('0x47')];if(!_0x3a8c1c[_0xc137('0x44')][_0xc137('0x69')](_0xc137('0x4b'))){_0x41137d[_0xc137('0x31')]=qs[_0xc137('0x31')](_0x3a8c1c['query'][_0xc137('0x31')]);_0x41137d[_0xc137('0x2f')]=qs[_0xc137('0x2f')](_0x3a8c1c[_0xc137('0x44')][_0xc137('0x2f')]);}_0x41137d[_0xc137('0x89')]=qs[_0xc137('0x4c')](_0x3a8c1c[_0xc137('0x44')]['sort']);_0x41137d[_0xc137('0x4d')]=qs[_0xc137('0x45')](_[_0xc137('0x4e')](_0x3a8c1c[_0xc137('0x44')],_0x8155ac[_0xc137('0x45')]));_0x41137d[_0xc137('0x4d')][_0xc137('0x65')]=_0x13f67d['id'];if(_0x3a8c1c['query'][_0xc137('0x4f')]){_0x41137d[_0xc137('0x4d')]=_[_0xc137('0x50')](_0x41137d[_0xc137('0x4d')],{'$or':_['map'](_0x41137d[_0xc137('0x49')],function(_0x46a5e1){var _0x1193d4={};_0x1193d4[_0x46a5e1]={'$like':'%'+_0x3a8c1c['query']['filter']+'%'};return _0x1193d4;})});}if(_0x3a8c1c[_0xc137('0x44')][_0xc137('0xa8')]){var _0x48d642=_0x3a8c1c[_0xc137('0x44')][_0xc137('0xa8')][_0xc137('0xa9')](',');var _0x16b662={};_0x16b662[_0x48d642[0x0]]={'$gte':moment(_0x48d642[0x1])[_0xc137('0xaa')](_0xc137('0xab'))};_0x41137d['where']=_[_0xc137('0x50')](_0x41137d[_0xc137('0x4d')],_0x16b662);}_0x41137d=_[_0xc137('0x50')]({},_0x41137d,_0x3a8c1c[_0xc137('0x51')]);return db[_0xc137('0xa7')][_0xc137('0x32')]({'where':_0x41137d[_0xc137('0x4d')]})['then'](function(_0x410770){_0x4d63dc[_0xc137('0x32')]=_0x410770;if(_0x3a8c1c[_0xc137('0x44')]['includeAll']){_0x41137d[_0xc137('0x52')]=[{'all':!![]}];}return db[_0xc137('0xa7')][_0xc137('0x53')](_0x41137d);})['then'](function(_0xca8a13){_0x4d63dc['rows']=_0xca8a13;return _0x4d63dc;});}})[_0xc137('0x22')](respondWithFilteredResult(_0x4a245f,_0x41137d))[_0xc137('0x55')](handleError(_0x4a245f,null));};exports['send']=function(_0x8f1bc6,_0x26eafd,_0x53a721){var _0x224580,_0x1157ed={},_0x190c1c;if(_0x8f1bc6['body']['to']){_0x190c1c=_0x8f1bc6['body']['to'][0x0];}return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x8f1bc6[_0xc137('0x57')]['id']},'include':[{'model':db[_0xc137('0xac')],'as':_0xc137('0xad'),'include':[{'model':db[_0xc137('0x75')],'as':'Contacts','where':{'fax':_0x190c1c},'limit':0x1,'order':[[_0xc137('0xae'),_0xc137('0xaf')]]}]}]})[_0xc137('0x22')](handleEntityNotFound(_0x26eafd,null))[_0xc137('0x22')](function(_0x466fa7){_0x224580=_0x466fa7;if(_0x8f1bc6[_0xc137('0x5d')]['attachments']&&_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][_0xc137('0x4a')]){for(var _0x593eab=0x0;_0x593eab<_0x8f1bc6[_0xc137('0x5d')]['attachments'][_0xc137('0x4a')];_0x593eab+=0x1){_0x8f1bc6['body']['attachments'][_0x593eab]={'filename':_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][_0x593eab]['name'],'id':_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][_0x593eab]['id'],'path':path[_0xc137('0xb1')](config[_0xc137('0xb2')],'server/files/attachments',_0x8f1bc6[_0xc137('0x5d')]['attachments'][_0x593eab]['basename'])};}}return respondWithRpcPromise(_0xc137('0xb3'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x8f1bc6[_0xc137('0x57')]['id'])?undefined:_0x8f1bc6[_0xc137('0x57')]['id'],'path':_[_0xc137('0xb4')](_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][0x0][_0xc137('0x7')])?undefined:_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][0x0][_0xc137('0x7')],'fax':_[_0xc137('0xb4')](_0x8f1bc6[_0xc137('0x5d')]['to'][0x0])?undefined:_0x8f1bc6[_0xc137('0x5d')]['to'][0x0]},client9002);})[_0xc137('0x22')](function(){if(_0x224580){if(_[_0xc137('0xb4')](_0x8f1bc6[_0xc137('0x5d')]['from'])){_0x8f1bc6['body']['from']=util['format'](_0xc137('0xb5'),_0x224580[_0xc137('0x3d')],_0x224580['fax']);}if(_0x224580['List']){if(_0x224580[_0xc137('0xad')][_0xc137('0xb6')]['length']){return _0x224580[_0xc137('0xad')][_0xc137('0xb6')][0x0];}else{return db[_0xc137('0x75')][_0xc137('0x5c')](_[_0xc137('0xb7')](_0x8f1bc6[_0xc137('0x5d')],{'firstName':_0x8f1bc6[_0xc137('0x5d')]['to'][0x0],'phone':_0x8f1bc6[_0xc137('0x5d')]['to'][0x0],'fax':_0x8f1bc6[_0xc137('0x5d')]['to'][0x0],'ListId':_0x224580['ListId']}));}}else{throw new Error(_0xc137('0xb8'));}}else{throw new Error(_0xc137('0xb9'));}})[_0xc137('0x22')](function(_0x2f48f4){if(_0x2f48f4){return db['FaxInteraction']['find']({'where':{'ContactId':_0x2f48f4['id'],'closed':![],'FaxAccountId':_0x224580['id']}})[_0xc137('0x22')](function(_0x378ee3){if(_0x378ee3){return[_0x378ee3,![]];}return db[_0xc137('0x71')][_0xc137('0x5c')]({'UserId':_0x8f1bc6['user']['id'],'ContactId':_0x2f48f4['id'],'FaxAccountId':_0x224580['id'],'fax':_0x8f1bc6[_0xc137('0x5d')]['to'][0x0],'firstMsgDirection':_0xc137('0xba'),'Messages':[_[_0xc137('0x50')](_0x8f1bc6['body'],{'read':![],'body':_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][0x0][_0xc137('0xbb')],'FaxAccountId':_0x224580['id'],'UserId':_0x8f1bc6[_0xc137('0x5e')]['id'],'ContactId':_0x2f48f4['id'],'AttachmentId':_0x8f1bc6['body'][_0xc137('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0xc137('0xa7')],'as':'Messages'}]})[_0xc137('0x22')](function(_0x103527){return[_0x103527,!![]];});});}else{throw new Error(_0xc137('0xbc'));}})['spread'](function(_0x3b794d,_0x1d4563){if(_0x1d4563){return _0x3b794d;}return db[_0xc137('0xa7')]['create']({'direction':_0xc137('0xba'),'read':![],'body':_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][0x0]['filename'],'FaxAccountId':_0x224580['id'],'FaxInteractionId':_0x3b794d['id'],'UserId':_0x8f1bc6['user']['id'],'ContactId':_0x3b794d[_0xc137('0xbd')],'AttachmentId':_0x8f1bc6[_0xc137('0x5d')][_0xc137('0xb0')][0x0]['id']})[_0xc137('0x22')](function(_0x244211){_0x3b794d[_0xc137('0xbe')][_0xc137('0xbf')]=[];_0x3b794d[_0xc137('0xbe')][_0xc137('0xbf')][_0xc137('0x93')](_0x244211[_0xc137('0xbe')]);return _0x3b794d;});})[_0xc137('0x22')](function(_0x5c0908){respondWithRpcPromise(_0xc137('0xc0'),_0xc137('0xc0'),{'FaxAccountId':_['isNil'](_0x8f1bc6[_0xc137('0x57')]['id'])?undefined:_0x8f1bc6[_0xc137('0x57')]['id'],'path':_[_0xc137('0xb4')](_0x8f1bc6['body'][_0xc137('0xb0')][0x0][_0xc137('0x7')])?undefined:_0x8f1bc6[_0xc137('0x5d')]['attachments'][0x0][_0xc137('0x7')],'fax':_['isNil'](_0x8f1bc6[_0xc137('0x5d')]['to'][0x0])?undefined:_0x8f1bc6[_0xc137('0x5d')]['to'][0x0],'AttachmentId':_0x8f1bc6['body'][_0xc137('0xb0')][0x0]['id']},client9002)[_0xc137('0x22')](function(_0xa95996){logger[_0xc137('0x23')]('SendFaxRpc,\x20%s',_0xa95996);})[_0xc137('0x55')](function(_0x1b4a79){logger['info']('SendFaxRpc,\x20%s',_0x1b4a79);});return _0x5c0908;})[_0xc137('0x22')](respondWithResult(_0x26eafd,null))['catch'](handleError(_0x26eafd,null));};exports[_0xc137('0xc1')]=function(_0x82dd63,_0xb1d117,_0x4e6516){return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x82dd63[_0xc137('0x57')]['id']}})['then'](handleEntityNotFound(_0xb1d117,null))[_0xc137('0x22')](function(_0x34374c){if(_0x34374c){return _0x34374c['addAgents'](_0x82dd63[_0xc137('0x5d')][_0xc137('0x6b')],_['omit'](_0x82dd63[_0xc137('0x5d')],[_0xc137('0x6b'),'id'])||{})['spread'](function(_0x47ed25){for(var _0x46ff8b=0x0;_0x46ff8b<_0x82dd63[_0xc137('0x5d')][_0xc137('0x6b')][_0xc137('0x4a')];_0x46ff8b+=0x1){socket[_0xc137('0xc2')]('userFaxAccount:save',{'UserId':Number(_0x82dd63[_0xc137('0x5d')][_0xc137('0x6b')][_0x46ff8b]),'FaxAccountId':Number(_0x82dd63[_0xc137('0x57')]['id'])});}return _0x47ed25;});}})[_0xc137('0x22')](respondWithResult(_0xb1d117,null))['catch'](handleError(_0xb1d117,null));};exports[_0xc137('0xc3')]=function(_0x560858,_0x422035,_0x20cff5){return db[_0xc137('0x41')][_0xc137('0x5b')]({'where':{'id':_0x560858[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x422035,null))['then'](function(_0x1cb03d){if(_0x1cb03d){return _0x1cb03d[_0xc137('0xc3')](_0x560858['query']['ids'])[_0xc137('0x22')](function(){if(_[_0xc137('0xc4')](_0x560858[_0xc137('0x44')][_0xc137('0x6b')])){for(var _0x12c430=0x0;_0x12c430<_0x560858[_0xc137('0x44')]['ids'][_0xc137('0x4a')];_0x12c430+=0x1){socket[_0xc137('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x560858['query'][_0xc137('0x6b')][_0x12c430]),'FaxAccountId':Number(_0x560858['params']['id'])});}}else{socket[_0xc137('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x560858[_0xc137('0x44')][_0xc137('0x6b')]),'FaxAccountId':Number(_0x560858[_0xc137('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x422035,null))[_0xc137('0x55')](handleError(_0x422035,null));};exports[_0xc137('0xc5')]=function(_0xc3e37d,_0x4b9676,_0x12d178){var _0x312101={};var _0x44bd60={};var _0x4fa411;var _0x4a5cb0;return db['FaxAccount'][_0xc137('0x67')]({'where':{'id':_0xc3e37d[_0xc137('0x57')]['id']}})[_0xc137('0x22')](handleEntityNotFound(_0x4b9676,null))[_0xc137('0x22')](function(_0x1a869f){if(_0x1a869f){_0x4fa411=_0x1a869f;_0x44bd60[_0xc137('0x47')]=_[_0xc137('0x59')](db['User'][_0xc137('0x5a')]);_0x44bd60[_0xc137('0x44')]=_[_0xc137('0x59')](_0xc3e37d['query']);_0x44bd60[_0xc137('0x45')]=_[_0xc137('0x46')](_0x44bd60[_0xc137('0x47')],_0x44bd60[_0xc137('0x44')]);_0x312101[_0xc137('0x49')]=_[_0xc137('0x46')](_0x44bd60['model'],qs['fields'](_0xc3e37d[_0xc137('0x44')][_0xc137('0x48')]));_0x312101[_0xc137('0x49')]=_0x312101[_0xc137('0x49')][_0xc137('0x4a')]?_0x312101[_0xc137('0x49')]:_0x44bd60['model'];_0x312101[_0xc137('0x89')]=qs[_0xc137('0x4c')](_0xc3e37d['query'][_0xc137('0x4c')]);_0x312101[_0xc137('0x4d')]=qs['filters'](_[_0xc137('0x4e')](_0xc3e37d[_0xc137('0x44')],_0x44bd60[_0xc137('0x45')]));if(_0xc3e37d[_0xc137('0x44')][_0xc137('0x4f')]){_0x312101[_0xc137('0x4d')]=_[_0xc137('0x50')](_0x312101[_0xc137('0x4d')],{'$or':_['map'](_0x312101[_0xc137('0x49')],function(_0x5cab49){var _0x31201e={};_0x31201e[_0x5cab49]={'$like':'%'+_0xc3e37d[_0xc137('0x44')]['filter']+'%'};return _0x31201e;})});}_0x312101=_[_0xc137('0x50')]({},_0x312101,_0xc3e37d[_0xc137('0x51')]);return _0x4fa411[_0xc137('0xc5')](_0x312101);}})[_0xc137('0x22')](function(_0x456346){if(_0x456346){_0x4a5cb0=_0x456346[_0xc137('0x4a')];if(!_0xc3e37d[_0xc137('0x44')][_0xc137('0x69')](_0xc137('0x4b'))){_0x312101['limit']=qs[_0xc137('0x31')](_0xc3e37d[_0xc137('0x44')][_0xc137('0x31')]);_0x312101['offset']=qs[_0xc137('0x2f')](_0xc3e37d[_0xc137('0x44')][_0xc137('0x2f')]);}return _0x4fa411['getAgents'](_0x312101);}})[_0xc137('0x22')](function(_0x5c8450){if(_0x5c8450){return _0x5c8450?{'count':_0x4a5cb0,'rows':_0x5c8450}:null;}})[_0xc137('0x22')](respondWithResult(_0x4b9676,null))[_0xc137('0x55')](handleError(_0x4b9676,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 40f2472..cb50ed4 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 _0x1303=['../../mysqldb','FaxAccount','save','update','emit','hook','exports','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1303,0x117));var _0x3130=function(_0x137603,_0xbb12a8){_0x137603=_0x137603-0x0;var _0x3dbcf4=_0x1303[_0x137603];return _0x3dbcf4;};'use strict';var EventEmitter=require(_0x3130('0x0'));var FaxAccount=require(_0x3130('0x1'))['db'][_0x3130('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3130('0x3'),'afterUpdate':_0x3130('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4792cd){return function(_0x27b876,_0x4c1a65,_0x46ae43){FaxAccountEvents['emit'](_0x4792cd+':'+_0x27b876['id'],_0x27b876);FaxAccountEvents[_0x3130('0x5')](_0x4792cd,_0x27b876);_0x46ae43(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x3130('0x6')](e,emitEvent(event));}}module[_0x3130('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xd5eb=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2918e1,_0x9613bc){var _0x2f5165=function(_0x12d6e2){while(--_0x12d6e2){_0x2918e1['push'](_0x2918e1['shift']());}};_0x2f5165(++_0x9613bc);}(_0xd5eb,0x183));var _0xbd5e=function(_0x1bf6b7,_0x12519b){_0x1bf6b7=_0x1bf6b7-0x0;var _0x5e2768=_0xd5eb[_0x1bf6b7];return _0x5e2768;};'use strict';var EventEmitter=require(_0xbd5e('0x0'));var FaxAccount=require(_0xbd5e('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xbd5e('0x2')](0x0);var events={'afterCreate':_0xbd5e('0x3'),'afterUpdate':_0xbd5e('0x4'),'afterDestroy':_0xbd5e('0x5')};function emitEvent(_0x1aa352){return function(_0x381ed9,_0x5005d2,_0x4eedc1){FaxAccountEvents['emit'](_0x1aa352+':'+_0x381ed9['id'],_0x381ed9);FaxAccountEvents[_0xbd5e('0x6')](_0x1aa352,_0x381ed9);_0x4eedc1(null);};}for(var e in events){if(events[_0xbd5e('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xbd5e('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 5495fe1..0b86bab 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 _0x2e22=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x498ba1,_0x3b3b26){var _0x30c018=function(_0x3c5da5){while(--_0x3c5da5){_0x498ba1['push'](_0x498ba1['shift']());}};_0x30c018(++_0x3b3b26);}(_0x2e22,0x1b6));var _0x22e2=function(_0x3500e7,_0x38ea3b){_0x3500e7=_0x3500e7-0x0;var _0x177cfe=_0x2e22[_0x3500e7];return _0x177cfe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x22e2('0x0'))(_0x22e2('0x1'));var moment=require(_0x22e2('0x2'));var BPromise=require(_0x22e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22e2('0x4'));var rimraf=require(_0x22e2('0x5'));var config=require(_0x22e2('0x6'));var attributes=require(_0x22e2('0x7'));module[_0x22e2('0x8')]=function(_0x223791,_0xb0bf1d){return _0x223791[_0x22e2('0x9')](_0x22e2('0xa'),attributes,{'tableName':_0x22e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd2a=['define','fax_accounts','lodash','util','api','moment','rimraf'];(function(_0x569eb6,_0x1a2b02){var _0xe86b41=function(_0x1d310f){while(--_0x1d310f){_0x569eb6['push'](_0x569eb6['shift']());}};_0xe86b41(++_0x1a2b02);}(_0xcd2a,0x1bb));var _0xacd2=function(_0x2f023d,_0x29dfe5){_0x2f023d=_0x2f023d-0x0;var _0x4ef240=_0xcd2a[_0x2f023d];return _0x4ef240;};'use strict';var _=require(_0xacd2('0x0'));var util=require(_0xacd2('0x1'));var logger=require('../../config/logger')(_0xacd2('0x2'));var moment=require(_0xacd2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xacd2('0x4'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x2e687b,_0x551ce3){return _0x2e687b[_0xacd2('0x5')]('FaxAccount',attributes,{'tableName':_0xacd2('0x6'),'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 18332c1..7b6ce22 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 _0xfa42=['FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','findAll','options','where','attributes','limit','include','map','model','stringify','body','fax','CmContact','ValidationError','difference','keys','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','Contacts','FaxApplication','Applications','List','list','applications','orderBy','priority','length','create','contact','FaxInteraction','get','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','name','unshift','agent','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa42,0x140));var _0x2fa4=function(_0x3f0eaa,_0x8bb233){_0x3f0eaa=_0x3f0eaa-0x0;var _0x7a151c=_0xfa42[_0x3f0eaa];return _0x7a151c;};'use strict';var _=require(_0x2fa4('0x0'));var util=require(_0x2fa4('0x1'));var moment=require(_0x2fa4('0x2'));var BPromise=require(_0x2fa4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fa4('0x4'));var db=require(_0x2fa4('0x5'))['db'];var utils=require(_0x2fa4('0x6'));var logger=require(_0x2fa4('0x7'))(_0x2fa4('0x8'));var config=require(_0x2fa4('0x9'));var jayson=require(_0x2fa4('0xa'));var client=jayson[_0x2fa4('0xb')][_0x2fa4('0xc')]({'port':0x232c});config[_0x2fa4('0xd')]=_[_0x2fa4('0xe')](config[_0x2fa4('0xd')],{'host':_0x2fa4('0xf'),'port':0x18eb});var socket=require(_0x2fa4('0x10'))(new Redis(config[_0x2fa4('0xd')]));require('./faxAccount.socket')[_0x2fa4('0x11')](socket);function respondWithRpcPromise(_0xe7087,_0xa6900,_0x1d6e3f){return new BPromise(function(_0x2b6263,_0x540536){return client[_0x2fa4('0x12')](_0xe7087,_0x1d6e3f)[_0x2fa4('0x13')](function(_0x59a9f0){logger[_0x2fa4('0x14')](_0x2fa4('0x15'),_0xa6900,_0x2fa4('0x16'));logger[_0x2fa4('0x17')](_0x2fa4('0x18'),_0xa6900,'request\x20sent',JSON['stringify'](_0x59a9f0));if(_0x59a9f0['error']){if(_0x59a9f0[_0x2fa4('0x19')][_0x2fa4('0x1a')]===0x1f4){logger[_0x2fa4('0x19')](_0x2fa4('0x15'),_0xa6900,_0x59a9f0['error'][_0x2fa4('0x1b')]);return _0x540536(_0x59a9f0[_0x2fa4('0x19')][_0x2fa4('0x1b')]);}logger[_0x2fa4('0x19')](_0x2fa4('0x15'),_0xa6900,_0x59a9f0[_0x2fa4('0x19')][_0x2fa4('0x1b')]);return _0x2b6263(_0x59a9f0['error'][_0x2fa4('0x1b')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0xa6900,_0x2fa4('0x16'));_0x2b6263(_0x59a9f0[_0x2fa4('0x1c')]['message']);}})[_0x2fa4('0x1d')](function(_0x1f7922){logger[_0x2fa4('0x19')]('FaxAccount,\x20%s,\x20%s',_0xa6900,_0x1f7922);_0x540536(_0x1f7922);});});}exports[_0x2fa4('0x1e')]=function(_0x335b3d){var _0x342ba0=this;return new Promise(function(_0x46b0f9,_0x1a961b){return db['FaxAccount'][_0x2fa4('0x1f')]({'raw':_0x335b3d[_0x2fa4('0x20')]?_0x335b3d[_0x2fa4('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x335b3d[_0x2fa4('0x20')]?_0x335b3d[_0x2fa4('0x20')][_0x2fa4('0x21')]||null:null,'attributes':_0x335b3d[_0x2fa4('0x20')]?_0x335b3d[_0x2fa4('0x20')][_0x2fa4('0x22')]||null:null,'limit':_0x335b3d[_0x2fa4('0x20')]?_0x335b3d[_0x2fa4('0x20')][_0x2fa4('0x23')]||null:null,'include':_0x335b3d[_0x2fa4('0x20')]?_0x335b3d[_0x2fa4('0x20')][_0x2fa4('0x24')]?_['map'](_0x335b3d[_0x2fa4('0x20')][_0x2fa4('0x24')],function(_0x5d60a4){return{'model':db[_0x5d60a4['model']],'as':_0x5d60a4['as'],'attributes':_0x5d60a4['attributes'],'include':_0x5d60a4[_0x2fa4('0x24')]?_[_0x2fa4('0x25')](_0x5d60a4['include'],function(_0x61c264){return{'model':db[_0x61c264[_0x2fa4('0x26')]],'as':_0x61c264['as'],'attributes':_0x61c264[_0x2fa4('0x22')],'include':_0x61c264[_0x2fa4('0x24')]?_[_0x2fa4('0x25')](_0x61c264[_0x2fa4('0x24')],function(_0x10347a){return{'model':db[_0x10347a['model']],'as':_0x10347a['as'],'attributes':_0x10347a[_0x2fa4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2fa4('0x13')](function(_0x306c84){logger['info']('GetFaxAccount',_0x335b3d);logger[_0x2fa4('0x17')](_0x2fa4('0x1e'),_0x335b3d,JSON[_0x2fa4('0x27')](_0x306c84));_0x46b0f9(_0x306c84);})[_0x2fa4('0x1d')](function(_0x4657d2){logger['error'](_0x2fa4('0x1e'),_0x4657d2[_0x2fa4('0x1b')],_0x335b3d);_0x1a961b(_0x342ba0[_0x2fa4('0x19')](0x1f4,_0x4657d2[_0x2fa4('0x1b')]));});});};exports['NotifyFaxAccount']=function(_0x1e3643,_0x2078a3,_0x2e4a3e){var _0x3cd554=this;return new Promise(function(_0x16d67d,_0x13c8f8){var _0x8fc739={'body':_0x1e3643[_0x2fa4('0x28')],'channel':_0x2fa4('0x29')};var _0x171b90=[];var _0x46ccf0=[];var _0x2b754b={};return db[_0x2fa4('0x2a')]['describe']()[_0x2fa4('0x13')](function(_0x50f3e0){if(!_0x50f3e0){throw new db['Sequelize'][(_0x2fa4('0x2b'))]('no\x20available\x20attributes');}_0x171b90=_[_0x2fa4('0x2c')](_[_0x2fa4('0x2d')](_0x50f3e0),['createdAt',_0x2fa4('0x2e')]);_0x46ccf0=_['difference'](_[_0x2fa4('0x2d')](_0x50f3e0),['createdAt',_0x2fa4('0x2e'),_0x2fa4('0x2f'),_0x2fa4('0x30')]);if(_0x1e3643[_0x2fa4('0x28')]['id']){delete _0x1e3643[_0x2fa4('0x28')]['id'];}if(_['isNil'](_0x1e3643['body'][_0x2fa4('0x31')])){throw new db[(_0x2fa4('0x32'))][(_0x2fa4('0x2b'))](_0x2fa4('0x33'));}if(_[_0x2fa4('0x34')](_0x1e3643[_0x2fa4('0x28')]['body'])||_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x28')]===''){throw new db['Sequelize'][(_0x2fa4('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2fa4('0x34')](_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x35')])){throw new db[(_0x2fa4('0x32'))][(_0x2fa4('0x2b'))](_0x2fa4('0x36')+_0x46ccf0);}if(!_[_0x2fa4('0x37')](_0x46ccf0,_0x1e3643['body'][_0x2fa4('0x35')])){throw new db[(_0x2fa4('0x32'))][(_0x2fa4('0x2b'))](_0x2fa4('0x38')+_0x46ccf0);}_0x2b754b[_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x35')]]=_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x31')];})[_0x2fa4('0x13')](function(){return db[_0x2fa4('0x39')][_0x2fa4('0x3a')]({'where':{'id':_0x1e3643[_0x2fa4('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x2fa4('0x2a')],'as':_0x2fa4('0x3c'),'where':_0x2b754b,'limit':0x1,'order':[[_0x2fa4('0x2e'),'DESC']]}]},{'model':db[_0x2fa4('0x3d')],'as':_0x2fa4('0x3e')}]});})[_0x2fa4('0x13')](function(_0xcd20df){if(_0xcd20df&&_0xcd20df[_0x2fa4('0x3f')]){var _0x111cf6=_0xcd20df['get']({'plain':!![]});_0x8fc739['account']=_0x111cf6;_0x8fc739['applications']=_0x111cf6['Applications'];_0x8fc739[_0x2fa4('0x40')]=_0x111cf6[_0x2fa4('0x3f')];_0x8fc739[_0x2fa4('0x41')]=_[_0x2fa4('0x42')](_0x8fc739[_0x2fa4('0x41')],[_0x2fa4('0x43')],['asc']);if(_0x8fc739[_0x2fa4('0x3b')][_0x2fa4('0x3e')]){delete _0x8fc739['account']['Applications'];}if(_0x8fc739['account'][_0x2fa4('0x3f')]&&_0x8fc739[_0x2fa4('0x3b')][_0x2fa4('0x3f')][_0x2fa4('0x3c')][_0x2fa4('0x44')]){return _0x8fc739[_0x2fa4('0x3b')][_0x2fa4('0x3f')][_0x2fa4('0x3c')][0x0];}var _0x4a4b99=_[_0x2fa4('0xe')](_0x1e3643[_0x2fa4('0x28')],{'firstName':_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x31')],'ListId':_0x111cf6[_0x2fa4('0x30')]});_0x4a4b99[_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x35')]]=_0x1e3643[_0x2fa4('0x28')][_0x2fa4('0x31')];return db[_0x2fa4('0x2a')][_0x2fa4('0x45')](_0x4a4b99,{'fields':_0x171b90,'raw':!![]});}})[_0x2fa4('0x13')](function(_0x316313){_0x8fc739[_0x2fa4('0x46')]=_0x316313;if(_0x316313){var _0x391408={'ContactId':_0x316313['id'],'FaxAccountId':_0x1e3643['account']['id'],'fax':_0x316313['fax']};return db[_0x2fa4('0x47')]['find']({'where':{'ContactId':_0x316313['id'],'closed':![],'FaxAccountId':_0x1e3643[_0x2fa4('0x3b')]['id']}})['then'](function(_0x5f321f){if(_0x5f321f){return[_0x5f321f,![]];}return db[_0x2fa4('0x47')][_0x2fa4('0x45')](_0x391408)[_0x2fa4('0x13')](function(_0x1d68b1){return[_0x1d68b1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x2c25da,_0x4bd740){var _0x5e551c=_0x2c25da[_0x2fa4('0x48')]({'plain':!![]});if(_0x4bd740){if(_0x8fc739[_0x2fa4('0x3b')]['autoclose']){_0x8fc739[_0x2fa4('0x41')]['push']({'id':0x0,'priority':_0x8fc739[_0x2fa4('0x41')][_0x2fa4('0x44')]+0x1,'app':_0x2fa4('0x49'),'appdata':_0x2fa4('0x4a'),'interval':_0x2fa4('0x4b')});}_0x5e551c[_0x2fa4('0x4c')]=!![];}else{_0x5e551c[_0x2fa4('0x4c')]=![];}_0x8fc739['interaction']=_0x5e551c;return db[_0x2fa4('0x4d')][_0x2fa4('0x45')]({'body':_0x1e3643['body'][_0x2fa4('0x28')],'FaxAccountId':_0x1e3643[_0x2fa4('0x3b')]['id'],'FaxInteractionId':_0x2c25da['id'],'direction':'in','ContactId':_0x2c25da[_0x2fa4('0x4e')],'AttachmentId':_0x1e3643[_0x2fa4('0x28')]['AttachmentId']});})[_0x2fa4('0x13')](function(_0x2901ac){_0x8fc739[_0x2fa4('0x1b')]=_0x2901ac;if(_0x8fc739[_0x2fa4('0x4f')][_0x2fa4('0x50')]){return db[_0x2fa4('0x51')]['find']({'attributes':['id',_0x2fa4('0x52')],'where':{'id':_0x8fc739[_0x2fa4('0x4f')][_0x2fa4('0x50')]}})[_0x2fa4('0x13')](function(_0x3f357c){if(_0x3f357c){_0x8fc739[_0x2fa4('0x41')][_0x2fa4('0x53')]({'id':0x0,'priority':0x0,'app':_0x2fa4('0x54'),'appdata':_0x3f357c[_0x2fa4('0x52')]+','+(_0x8fc739['account']['waitForTheAssignedAgent']||0xa),'interval':_0x2fa4('0x4b')});}return respondWithRpcPromise('Start','startRouting',_0x8fc739);});}return respondWithRpcPromise(_0x2fa4('0x55'),'startRouting',_0x8fc739);})[_0x2fa4('0x13')](function(_0x23e170){_0x16d67d(_0x23e170);})['catch'](function(_0x459cf6){_0x13c8f8(_0x3cd554[_0x2fa4('0x19')](0x1f4,_0x459cf6[_0x2fa4('0x1b')]));});});}; \ No newline at end of file +var _0x3a63=['isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','account','applications','list','orderBy','priority','Applications','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','map','model','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x3a63,0xd0));var _0x33a6=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x3a63[_0x5d8018];return _0x151ac4;};'use strict';var _=require(_0x33a6('0x0'));var util=require(_0x33a6('0x1'));var moment=require(_0x33a6('0x2'));var BPromise=require(_0x33a6('0x3'));var rs=require(_0x33a6('0x4'));var fs=require('fs');var Redis=require(_0x33a6('0x5'));var db=require(_0x33a6('0x6'))['db'];var utils=require(_0x33a6('0x7'));var logger=require('../../config/logger')(_0x33a6('0x8'));var config=require(_0x33a6('0x9'));var jayson=require(_0x33a6('0xa'));var client=jayson[_0x33a6('0xb')][_0x33a6('0xc')]({'port':0x232c});config[_0x33a6('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0x33a6('0xe')](socket);function respondWithRpcPromise(_0x545325,_0x40e61b,_0x2e155a){return new BPromise(function(_0x1ee42b,_0x3a482a){return client[_0x33a6('0xf')](_0x545325,_0x2e155a)[_0x33a6('0x10')](function(_0x2f96f3){logger[_0x33a6('0x11')](_0x33a6('0x12'),_0x40e61b,_0x33a6('0x13'));logger[_0x33a6('0x14')](_0x33a6('0x15'),_0x40e61b,_0x33a6('0x13'),JSON[_0x33a6('0x16')](_0x2f96f3));if(_0x2f96f3[_0x33a6('0x17')]){if(_0x2f96f3[_0x33a6('0x17')]['code']===0x1f4){logger[_0x33a6('0x17')](_0x33a6('0x12'),_0x40e61b,_0x2f96f3['error'][_0x33a6('0x18')]);return _0x3a482a(_0x2f96f3[_0x33a6('0x17')][_0x33a6('0x18')]);}logger['error'](_0x33a6('0x12'),_0x40e61b,_0x2f96f3['error'][_0x33a6('0x18')]);return _0x1ee42b(_0x2f96f3[_0x33a6('0x17')][_0x33a6('0x18')]);}else{logger['info'](_0x33a6('0x12'),_0x40e61b,'request\x20sent');_0x1ee42b(_0x2f96f3[_0x33a6('0x19')][_0x33a6('0x18')]);}})['catch'](function(_0x5df5e3){logger[_0x33a6('0x17')](_0x33a6('0x12'),_0x40e61b,_0x5df5e3);_0x3a482a(_0x5df5e3);});});}exports[_0x33a6('0x1a')]=function(_0x14a0b4){var _0x5efef5=this;return new Promise(function(_0xeda3a3,_0xc879e8){return db[_0x33a6('0x1b')]['findAll']({'raw':_0x14a0b4[_0x33a6('0x1c')]?_0x14a0b4[_0x33a6('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x14a0b4[_0x33a6('0x1c')]?_0x14a0b4[_0x33a6('0x1c')][_0x33a6('0x1d')]||null:null,'attributes':_0x14a0b4[_0x33a6('0x1c')]?_0x14a0b4['options'][_0x33a6('0x1e')]||null:null,'limit':_0x14a0b4[_0x33a6('0x1c')]?_0x14a0b4[_0x33a6('0x1c')][_0x33a6('0x1f')]||null:null,'include':_0x14a0b4[_0x33a6('0x1c')]?_0x14a0b4[_0x33a6('0x1c')][_0x33a6('0x20')]?_[_0x33a6('0x21')](_0x14a0b4[_0x33a6('0x1c')][_0x33a6('0x20')],function(_0x271271){return{'model':db[_0x271271[_0x33a6('0x22')]],'as':_0x271271['as'],'attributes':_0x271271[_0x33a6('0x1e')],'include':_0x271271[_0x33a6('0x20')]?_['map'](_0x271271[_0x33a6('0x20')],function(_0xd0e5f9){return{'model':db[_0xd0e5f9[_0x33a6('0x22')]],'as':_0xd0e5f9['as'],'attributes':_0xd0e5f9[_0x33a6('0x1e')],'include':_0xd0e5f9[_0x33a6('0x20')]?_[_0x33a6('0x21')](_0xd0e5f9[_0x33a6('0x20')],function(_0x14c80b){return{'model':db[_0x14c80b[_0x33a6('0x22')]],'as':_0x14c80b['as'],'attributes':_0x14c80b[_0x33a6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d440d){logger[_0x33a6('0x11')]('GetFaxAccount',_0x14a0b4);logger[_0x33a6('0x14')]('GetFaxAccount',_0x14a0b4,JSON['stringify'](_0x2d440d));_0xeda3a3(_0x2d440d);})['catch'](function(_0x31f32a){logger[_0x33a6('0x17')](_0x33a6('0x1a'),_0x31f32a[_0x33a6('0x18')],_0x14a0b4);_0xc879e8(_0x5efef5[_0x33a6('0x17')](0x1f4,_0x31f32a[_0x33a6('0x18')]));});});};exports['NotifyFaxAccount']=function(_0xb36b85,_0x1c39f1,_0x1a17bb){var _0x34f2d6=this;return new Promise(function(_0x428e28,_0x378c43){var _0x5d0bfe={'body':_0xb36b85[_0x33a6('0x23')],'channel':_0x33a6('0x24')};var _0x4578cf=[];var _0x11aecd=[];var _0x5b0e88={};return db[_0x33a6('0x25')][_0x33a6('0x26')]()['then'](function(_0x103863){if(!_0x103863){throw new db[(_0x33a6('0x27'))][(_0x33a6('0x28'))]('no\x20available\x20attributes');}_0x4578cf=_[_0x33a6('0x29')](_[_0x33a6('0x2a')](_0x103863),[_0x33a6('0x2b'),_0x33a6('0x2c')]);_0x11aecd=_['difference'](_[_0x33a6('0x2a')](_0x103863),[_0x33a6('0x2b'),'updatedAt',_0x33a6('0x2d'),_0x33a6('0x2e')]);if(_0xb36b85[_0x33a6('0x23')]['id']){delete _0xb36b85[_0x33a6('0x23')]['id'];}if(_[_0x33a6('0x2f')](_0xb36b85['body'][_0x33a6('0x30')])){throw new db[(_0x33a6('0x27'))][(_0x33a6('0x28'))]('from\x20is\x20mandatory');}if(_[_0x33a6('0x2f')](_0xb36b85[_0x33a6('0x23')]['body'])||_0xb36b85['body'][_0x33a6('0x23')]===''){throw new db[(_0x33a6('0x27'))][(_0x33a6('0x28'))](_0x33a6('0x31'));}if(_[_0x33a6('0x2f')](_0xb36b85[_0x33a6('0x23')][_0x33a6('0x32')])){throw new db['Sequelize'][(_0x33a6('0x28'))](_0x33a6('0x33')+_0x11aecd);}if(!_['includes'](_0x11aecd,_0xb36b85[_0x33a6('0x23')][_0x33a6('0x32')])){throw new db[(_0x33a6('0x27'))][(_0x33a6('0x28'))](_0x33a6('0x34')+_0x11aecd);}_0x5b0e88[_0xb36b85['body']['mapKey']]=_0xb36b85['body'][_0x33a6('0x30')];})[_0x33a6('0x10')](function(){return db['FaxAccount'][_0x33a6('0x35')]({'where':{'id':_0xb36b85['account']['id']},'include':[{'model':db[_0x33a6('0x36')],'as':_0x33a6('0x37'),'include':[{'model':db['CmContact'],'as':_0x33a6('0x38'),'where':_0x5b0e88,'limit':0x1,'order':[[_0x33a6('0x2c'),_0x33a6('0x39')]]}]},{'model':db[_0x33a6('0x3a')],'as':'Applications'}]});})[_0x33a6('0x10')](function(_0x956860){if(_0x956860&&_0x956860['List']){var _0x4ba8c2=_0x956860['get']({'plain':!![]});_0x5d0bfe[_0x33a6('0x3b')]=_0x4ba8c2;_0x5d0bfe[_0x33a6('0x3c')]=_0x4ba8c2['Applications'];_0x5d0bfe[_0x33a6('0x3d')]=_0x4ba8c2['List'];_0x5d0bfe[_0x33a6('0x3c')]=_[_0x33a6('0x3e')](_0x5d0bfe[_0x33a6('0x3c')],[_0x33a6('0x3f')],['asc']);if(_0x5d0bfe[_0x33a6('0x3b')][_0x33a6('0x40')]){delete _0x5d0bfe[_0x33a6('0x3b')][_0x33a6('0x40')];}if(_0x5d0bfe['account'][_0x33a6('0x37')]&&_0x5d0bfe[_0x33a6('0x3b')]['List'][_0x33a6('0x38')]['length']){return _0x5d0bfe[_0x33a6('0x3b')][_0x33a6('0x37')][_0x33a6('0x38')][0x0];}var _0x1f24da=_['defaults'](_0xb36b85['body'],{'firstName':_0xb36b85[_0x33a6('0x23')][_0x33a6('0x30')],'ListId':_0x4ba8c2[_0x33a6('0x2e')]});_0x1f24da[_0xb36b85[_0x33a6('0x23')][_0x33a6('0x32')]]=_0xb36b85[_0x33a6('0x23')][_0x33a6('0x30')];return db['CmContact'][_0x33a6('0x41')](_0x1f24da,{'fields':_0x4578cf,'raw':!![]});}})[_0x33a6('0x10')](function(_0x4de91e){_0x5d0bfe[_0x33a6('0x42')]=_0x4de91e;if(_0x4de91e){var _0x33540c={'ContactId':_0x4de91e['id'],'FaxAccountId':_0xb36b85['account']['id'],'fax':_0x4de91e['fax']};return db[_0x33a6('0x43')]['find']({'where':{'ContactId':_0x4de91e['id'],'closed':![],'FaxAccountId':_0xb36b85[_0x33a6('0x3b')]['id']}})[_0x33a6('0x10')](function(_0x4aab52){if(_0x4aab52){return[_0x4aab52,![]];}return db[_0x33a6('0x43')]['create'](_0x33540c)[_0x33a6('0x10')](function(_0x63ea0){return[_0x63ea0,!![]];});});}else{throw new Error(_0x33a6('0x44'));}})[_0x33a6('0x45')](function(_0x1bcc0b,_0x3dc501){var _0x5084ca=_0x1bcc0b[_0x33a6('0x46')]({'plain':!![]});if(_0x3dc501){if(_0x5d0bfe['account'][_0x33a6('0x47')]){_0x5d0bfe['applications'][_0x33a6('0x48')]({'id':0x0,'priority':_0x5d0bfe[_0x33a6('0x3c')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x5084ca['created']=!![];}else{_0x5084ca['created']=![];}_0x5d0bfe[_0x33a6('0x49')]=_0x5084ca;return db['FaxMessage']['create']({'body':_0xb36b85[_0x33a6('0x23')][_0x33a6('0x23')],'FaxAccountId':_0xb36b85[_0x33a6('0x3b')]['id'],'FaxInteractionId':_0x1bcc0b['id'],'direction':'in','ContactId':_0x1bcc0b[_0x33a6('0x4a')],'AttachmentId':_0xb36b85[_0x33a6('0x23')][_0x33a6('0x4b')]});})[_0x33a6('0x10')](function(_0x3be8ad){_0x5d0bfe[_0x33a6('0x18')]=_0x3be8ad;if(_0x5d0bfe[_0x33a6('0x49')][_0x33a6('0x4c')]){return db[_0x33a6('0x4d')]['find']({'attributes':['id',_0x33a6('0x4e')],'where':{'id':_0x5d0bfe[_0x33a6('0x49')][_0x33a6('0x4c')]}})[_0x33a6('0x10')](function(_0x4444a4){if(_0x4444a4){_0x5d0bfe[_0x33a6('0x3c')][_0x33a6('0x4f')]({'id':0x0,'priority':0x0,'app':_0x33a6('0x50'),'appdata':_0x4444a4[_0x33a6('0x4e')]+','+(_0x5d0bfe[_0x33a6('0x3b')][_0x33a6('0x51')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x33a6('0x52'),'startRouting',_0x5d0bfe);});}return respondWithRpcPromise(_0x33a6('0x52'),_0x33a6('0x53'),_0x5d0bfe);})['then'](function(_0x55a3ce){_0x428e28(_0x55a3ce);})[_0x33a6('0x54')](function(_0x2029c6){_0x378c43(_0x34f2d6[_0x33a6('0x17')](0x1f4,_0x2029c6[_0x33a6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e64e876..f134d67 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 _0xbe4a=['register','length','save','remove','update','emit','removeListener'];(function(_0x16a464,_0x118602){var _0x336697=function(_0xb2004a){while(--_0xb2004a){_0x16a464['push'](_0x16a464['shift']());}};_0x336697(++_0x118602);}(_0xbe4a,0x105));var _0xabe4=function(_0x31ce32,_0x3870a8){_0x31ce32=_0x31ce32-0x0;var _0x40958b=_0xbe4a[_0x31ce32];return _0x40958b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xabe4('0x0'),_0xabe4('0x1'),_0xabe4('0x2')];function createListener(_0x1e2691,_0x10e6c0){return function(_0x20734d){_0x10e6c0[_0xabe4('0x3')](_0x1e2691,_0x20734d);};}function removeListener(_0x463a00,_0x86d4b0){return function(){FaxAccountEvents[_0xabe4('0x4')](_0x463a00,_0x86d4b0);};}exports[_0xabe4('0x5')]=function(_0x3a21d2){for(var _0x1326b9=0x0,_0x32ff59=events[_0xabe4('0x6')];_0x1326b9<_0x32ff59;_0x1326b9++){var _0x99c679=events[_0x1326b9];var _0x2cebb2=createListener('faxAccount:'+_0x99c679,_0x3a21d2);FaxAccountEvents['on'](_0x99c679,_0x2cebb2);}}; \ No newline at end of file +var _0xde93=['removeListener','register','length','faxAccount:','./faxAccount.events','save','emit'];(function(_0x1e862b,_0x58b945){var _0x171fcd=function(_0x5b8456){while(--_0x5b8456){_0x1e862b['push'](_0x1e862b['shift']());}};_0x171fcd(++_0x58b945);}(_0xde93,0x18c));var _0x3de9=function(_0x544123,_0x48d2c9){_0x544123=_0x544123-0x0;var _0x34dcd4=_0xde93[_0x544123];return _0x34dcd4;};'use strict';var FaxAccountEvents=require(_0x3de9('0x0'));var events=[_0x3de9('0x1'),'remove','update'];function createListener(_0x348666,_0x26ceb3){return function(_0x142a81){_0x26ceb3[_0x3de9('0x2')](_0x348666,_0x142a81);};}function removeListener(_0xb3a402,_0x161586){return function(){FaxAccountEvents[_0x3de9('0x3')](_0xb3a402,_0x161586);};}exports[_0x3de9('0x4')]=function(_0x30bc46){for(var _0x10ecb3=0x0,_0x23eaed=events[_0x3de9('0x5')];_0x10ecb3<_0x23eaed;_0x10ecb3++){var _0x1a376d=events[_0x10ecb3];var _0x302029=createListener(_0x3de9('0x6')+_0x1a376d,_0x30bc46);FaxAccountEvents['on'](_0x1a376d,_0x302029);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1246734..c335a83 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(_0x4bd2a9,_0x14cde1){var _0x5c5a82=function(_0x3b857a){while(--_0x3b857a){_0x4bd2a9['push'](_0x4bd2a9['shift']());}};_0x5c5a82(++_0x14cde1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x41342e,_0x427f74){var _0x5155e6=function(_0x3c953d){while(--_0x3c953d){_0x41342e['push'](_0x41342e['shift']());}};_0x5155e6(++_0x427f74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 3a31bb8..f0eee16 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 _0xa4df=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x506632,_0x2bbf2e){var _0x510d15=function(_0x444572){while(--_0x444572){_0x506632['push'](_0x506632['shift']());}};_0x510d15(++_0x2bbf2e);}(_0xa4df,0xd0));var _0xfa4d=function(_0x223c68,_0x28ce25){_0x223c68=_0x223c68-0x0;var _0x45880c=_0xa4df[_0x223c68];return _0x45880c;};'use strict';var Sequelize=require(_0xfa4d('0x0'));module[_0xfa4d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfa4d('0x2')],'allowNull':![],'defaultValue':_0xfa4d('0x3')},'appdata':{'type':Sequelize[_0xfa4d('0x4')]()},'description':{'type':Sequelize[_0xfa4d('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfa4d('0x5')}}; \ No newline at end of file +var _0x3df0=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x518502,_0x23df26){var _0x59791d=function(_0x1a9845){while(--_0x1a9845){_0x518502['push'](_0x518502['shift']());}};_0x59791d(++_0x23df26);}(_0x3df0,0xb3));var _0x03df=function(_0x2101f2,_0x405ba2){_0x2101f2=_0x2101f2-0x0;var _0x1dfc10=_0x3df0[_0x2101f2];return _0x1dfc10;};'use strict';var Sequelize=require(_0x03df('0x0'));module['exports']={'priority':{'type':Sequelize[_0x03df('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x03df('0x2')],'allowNull':![],'defaultValue':_0x03df('0x3')},'appdata':{'type':Sequelize[_0x03df('0x4')]()},'description':{'type':Sequelize[_0x03df('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x03df('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6ba46b1..d302d13 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 _0x4c25=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','fast-json-patch','mustache','util','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse'];(function(_0x2e8613,_0x4b6256){var _0x1f85c0=function(_0x5a2e40){while(--_0x5a2e40){_0x2e8613['push'](_0x2e8613['shift']());}};_0x1f85c0(++_0x4b6256);}(_0x4c25,0x106));var _0x54c2=function(_0x22d667,_0x4ab6f6){_0x22d667=_0x22d667-0x0;var _0xc8eba0=_0x4c25[_0x22d667];return _0xc8eba0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54c2('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x54c2('0x1'));var util=require(_0x54c2('0x2'));var path=require('path');var sox=require(_0x54c2('0x3'));var csv=require('to-csv');var ejs=require(_0x54c2('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54c2('0x5'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x54c2('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x54c2('0x7'));var querystring=require(_0x54c2('0x8'));var Papa=require(_0x54c2('0x9'));var Redis=require(_0x54c2('0xa'));var authService=require(_0x54c2('0xb'));var qs=require(_0x54c2('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54c2('0xd'));var logger=require(_0x54c2('0xe'))('api');var utils=require(_0x54c2('0xf'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x54c2('0x10'))['db'];function respondWithStatusCode(_0x308059,_0x56c51b){_0x56c51b=_0x56c51b||0xcc;return function(_0x2d85c5){if(_0x2d85c5){return _0x308059['sendStatus'](_0x56c51b);}return _0x308059[_0x54c2('0x11')](_0x56c51b)[_0x54c2('0x12')]();};}function respondWithResult(_0xbeb82d,_0x576cc7){_0x576cc7=_0x576cc7||0xc8;return function(_0x5c43b2){if(_0x5c43b2){return _0xbeb82d[_0x54c2('0x11')](_0x576cc7)[_0x54c2('0x13')](_0x5c43b2);}};}function respondWithFilteredResult(_0x5eb7a1,_0x28bf2a){return function(_0x3f91bc){if(_0x3f91bc){var _0x15f059=typeof _0x28bf2a[_0x54c2('0x14')]===_0x54c2('0x15')&&typeof _0x28bf2a[_0x54c2('0x16')]===_0x54c2('0x15');var _0x46f485=_0x3f91bc[_0x54c2('0x17')];var _0x52241b=_0x15f059?0x0:_0x28bf2a[_0x54c2('0x14')];var _0x43cf48=_0x15f059?_0x3f91bc[_0x54c2('0x17')]:_0x28bf2a[_0x54c2('0x14')]+_0x28bf2a['limit'];var _0x4480b3;if(_0x43cf48>=_0x46f485){_0x43cf48=_0x46f485;_0x4480b3=0xc8;}else{_0x4480b3=0xce;}_0x5eb7a1[_0x54c2('0x11')](_0x4480b3);return _0x5eb7a1[_0x54c2('0x18')](_0x54c2('0x19'),_0x52241b+'-'+_0x43cf48+'/'+_0x46f485)[_0x54c2('0x13')](_0x3f91bc);}return null;};}function patchUpdates(_0x403d34){return function(_0x41d742){try{jsonpatch[_0x54c2('0x1a')](_0x41d742,_0x403d34,!![]);}catch(_0x33cbeb){return BPromise[_0x54c2('0x1b')](_0x33cbeb);}return _0x41d742['save']();};}function saveUpdates(_0x2f5638,_0x46ecbe){return function(_0xfd53bf){if(_0xfd53bf){return _0xfd53bf[_0x54c2('0x1c')](_0x2f5638)[_0x54c2('0x1d')](function(_0x4860b9){return _0x4860b9;});}return null;};}function removeEntity(_0x1e673b,_0x1d27ca){return function(_0x1ef9dc){if(_0x1ef9dc){return _0x1ef9dc[_0x54c2('0x1e')]()[_0x54c2('0x1d')](function(){_0x1e673b[_0x54c2('0x11')](0xcc)[_0x54c2('0x12')]();});}};}function handleEntityNotFound(_0x752f2e,_0x3e7780){return function(_0x1de644){if(!_0x1de644){_0x752f2e[_0x54c2('0x1f')](0x194);}return _0x1de644;};}function handleError(_0x532f03,_0x499e0d){_0x499e0d=_0x499e0d||0x1f4;return function(_0x36cce4){logger[_0x54c2('0x20')](_0x36cce4['stack']);if(_0x36cce4[_0x54c2('0x21')]){delete _0x36cce4['name'];}_0x532f03[_0x54c2('0x11')](_0x499e0d)[_0x54c2('0x22')](_0x36cce4);};}exports[_0x54c2('0x23')]=function(_0x4db615,_0x509dd7){var _0x18c6b4={},_0xae3632={},_0x566a1f={'count':0x0,'rows':[]};var _0x1166cb=_[_0x54c2('0x24')](db[_0x54c2('0x25')][_0x54c2('0x26')],function(_0x1fc72b){return{'name':_0x1fc72b[_0x54c2('0x27')],'type':_0x1fc72b[_0x54c2('0x28')][_0x54c2('0x29')]};});_0xae3632[_0x54c2('0x2a')]=_['map'](_0x1166cb,'name');_0xae3632[_0x54c2('0x2b')]=_[_0x54c2('0x2c')](_0x4db615[_0x54c2('0x2b')]);_0xae3632[_0x54c2('0x2d')]=_[_0x54c2('0x2e')](_0xae3632[_0x54c2('0x2a')],_0xae3632['query']);_0x18c6b4[_0x54c2('0x2f')]=_[_0x54c2('0x2e')](_0xae3632['model'],qs[_0x54c2('0x30')](_0x4db615[_0x54c2('0x2b')]['fields']));_0x18c6b4[_0x54c2('0x2f')]=_0x18c6b4[_0x54c2('0x2f')][_0x54c2('0x31')]?_0x18c6b4[_0x54c2('0x2f')]:_0xae3632['model'];if(!_0x4db615[_0x54c2('0x2b')]['hasOwnProperty'](_0x54c2('0x32'))){_0x18c6b4[_0x54c2('0x16')]=qs[_0x54c2('0x16')](_0x4db615[_0x54c2('0x2b')][_0x54c2('0x16')]);_0x18c6b4[_0x54c2('0x14')]=qs['offset'](_0x4db615['query']['offset']);}_0x18c6b4[_0x54c2('0x33')]=qs['sort'](_0x4db615[_0x54c2('0x2b')][_0x54c2('0x34')]);_0x18c6b4[_0x54c2('0x35')]=qs[_0x54c2('0x2d')](_[_0x54c2('0x36')](_0x4db615[_0x54c2('0x2b')],_0xae3632[_0x54c2('0x2d')]),_0x1166cb);if(_0x4db615[_0x54c2('0x2b')][_0x54c2('0x37')]){_0x18c6b4['where']=_[_0x54c2('0x38')](_0x18c6b4['where'],{'$or':_[_0x54c2('0x24')](_0x1166cb,function(_0x138441){if(_0x138441[_0x54c2('0x28')]!==_0x54c2('0x39')){var _0x2c809b={};_0x2c809b[_0x138441[_0x54c2('0x21')]]={'$like':'%'+_0x4db615['query'][_0x54c2('0x37')]+'%'};return _0x2c809b;}})});}_0x18c6b4=_[_0x54c2('0x38')]({},_0x18c6b4,_0x4db615[_0x54c2('0x3a')]);var _0x293707={'where':_0x18c6b4[_0x54c2('0x35')]};return db[_0x54c2('0x25')]['count'](_0x293707)[_0x54c2('0x1d')](function(_0x5f5348){_0x566a1f[_0x54c2('0x17')]=_0x5f5348;if(_0x4db615[_0x54c2('0x2b')][_0x54c2('0x3b')]){_0x18c6b4[_0x54c2('0x3c')]=[{'all':!![]}];}return db['FaxApplication'][_0x54c2('0x3d')](_0x18c6b4);})[_0x54c2('0x1d')](function(_0x556608){_0x566a1f['rows']=_0x556608;return _0x566a1f;})['then'](respondWithFilteredResult(_0x509dd7,_0x18c6b4))[_0x54c2('0x3e')](handleError(_0x509dd7,null));};exports[_0x54c2('0x3f')]=function(_0x73dc8c,_0x591126){var _0x35dc6b={'raw':!![],'where':{'id':_0x73dc8c['params']['id']}},_0x508910={};_0x508910[_0x54c2('0x2a')]=_[_0x54c2('0x2c')](db[_0x54c2('0x25')]['rawAttributes']);_0x508910['query']=_[_0x54c2('0x2c')](_0x73dc8c[_0x54c2('0x2b')]);_0x508910[_0x54c2('0x2d')]=_[_0x54c2('0x2e')](_0x508910[_0x54c2('0x2a')],_0x508910['query']);_0x35dc6b[_0x54c2('0x2f')]=_[_0x54c2('0x2e')](_0x508910[_0x54c2('0x2a')],qs[_0x54c2('0x30')](_0x73dc8c['query'][_0x54c2('0x30')]));_0x35dc6b['attributes']=_0x35dc6b[_0x54c2('0x2f')][_0x54c2('0x31')]?_0x35dc6b['attributes']:_0x508910[_0x54c2('0x2a')];if(_0x73dc8c[_0x54c2('0x2b')][_0x54c2('0x3b')]){_0x35dc6b[_0x54c2('0x3c')]=[{'all':!![]}];}_0x35dc6b=_['merge']({},_0x35dc6b,_0x73dc8c[_0x54c2('0x3a')]);return db['FaxApplication'][_0x54c2('0x40')](_0x35dc6b)[_0x54c2('0x1d')](handleEntityNotFound(_0x591126,null))['then'](respondWithResult(_0x591126,null))[_0x54c2('0x3e')](handleError(_0x591126,null));};exports['create']=function(_0x1ce198,_0x24d863){return db[_0x54c2('0x25')][_0x54c2('0x41')](_0x1ce198['body'],{})[_0x54c2('0x1d')](respondWithResult(_0x24d863,0xc9))[_0x54c2('0x3e')](handleError(_0x24d863,null));};exports[_0x54c2('0x1c')]=function(_0x2846be,_0x32dc8e){if(_0x2846be[_0x54c2('0x42')]['id']){delete _0x2846be[_0x54c2('0x42')]['id'];}return db[_0x54c2('0x25')][_0x54c2('0x40')]({'where':{'id':_0x2846be[_0x54c2('0x43')]['id']}})[_0x54c2('0x1d')](handleEntityNotFound(_0x32dc8e,null))['then'](saveUpdates(_0x2846be[_0x54c2('0x42')],null))[_0x54c2('0x1d')](respondWithResult(_0x32dc8e,null))[_0x54c2('0x3e')](handleError(_0x32dc8e,null));};exports[_0x54c2('0x1e')]=function(_0x4d7e6c,_0x1ce518){return db[_0x54c2('0x25')][_0x54c2('0x40')]({'where':{'id':_0x4d7e6c[_0x54c2('0x43')]['id']}})[_0x54c2('0x1d')](handleEntityNotFound(_0x1ce518,null))[_0x54c2('0x1d')](removeEntity(_0x1ce518,null))[_0x54c2('0x3e')](handleError(_0x1ce518,null));}; \ No newline at end of file +var _0xb900=['end','offset','undefined','limit','count','set','Content-Range','json','save','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0xb900,0x19c));var _0x0b90=function(_0x1b1cce,_0x267557){_0x1b1cce=_0x1b1cce-0x0;var _0x5d515d=_0xb900[_0x1b1cce];return _0x5d515d;};'use strict';var emlformat=require(_0x0b90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b90('0x1'));var jsonpatch=require(_0x0b90('0x2'));var rp=require(_0x0b90('0x3'));var moment=require('moment');var BPromise=require(_0x0b90('0x4'));var Mustache=require('mustache');var util=require(_0x0b90('0x5'));var path=require(_0x0b90('0x6'));var sox=require(_0x0b90('0x7'));var csv=require('to-csv');var ejs=require(_0x0b90('0x8'));var fs=require('fs');var fs_extra=require(_0x0b90('0x9'));var _=require(_0x0b90('0xa'));var squel=require(_0x0b90('0xb'));var crypto=require('crypto');var jsforce=require(_0x0b90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0b90('0xd'));var querystring=require(_0x0b90('0xe'));var Papa=require(_0x0b90('0xf'));var Redis=require(_0x0b90('0x10'));var authService=require(_0x0b90('0x11'));var qs=require(_0x0b90('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b90('0x13'))('api');var utils=require(_0x0b90('0x14'));var config=require(_0x0b90('0x15'));var licenseUtil=require(_0x0b90('0x16'));var db=require(_0x0b90('0x17'))['db'];function respondWithStatusCode(_0x5aff51,_0x4759ac){_0x4759ac=_0x4759ac||0xcc;return function(_0x49a357){if(_0x49a357){return _0x5aff51[_0x0b90('0x18')](_0x4759ac);}return _0x5aff51[_0x0b90('0x19')](_0x4759ac)[_0x0b90('0x1a')]();};}function respondWithResult(_0x5a4d49,_0x2194ad){_0x2194ad=_0x2194ad||0xc8;return function(_0x34870a){if(_0x34870a){return _0x5a4d49[_0x0b90('0x19')](_0x2194ad)['json'](_0x34870a);}};}function respondWithFilteredResult(_0x3e2334,_0x476bfa){return function(_0x589917){if(_0x589917){var _0xb10ba1=typeof _0x476bfa[_0x0b90('0x1b')]===_0x0b90('0x1c')&&typeof _0x476bfa[_0x0b90('0x1d')]===_0x0b90('0x1c');var _0x2bab37=_0x589917[_0x0b90('0x1e')];var _0x348de1=_0xb10ba1?0x0:_0x476bfa[_0x0b90('0x1b')];var _0x2a93d7=_0xb10ba1?_0x589917['count']:_0x476bfa['offset']+_0x476bfa[_0x0b90('0x1d')];var _0x318c90;if(_0x2a93d7>=_0x2bab37){_0x2a93d7=_0x2bab37;_0x318c90=0xc8;}else{_0x318c90=0xce;}_0x3e2334['status'](_0x318c90);return _0x3e2334[_0x0b90('0x1f')](_0x0b90('0x20'),_0x348de1+'-'+_0x2a93d7+'/'+_0x2bab37)[_0x0b90('0x21')](_0x589917);}return null;};}function patchUpdates(_0x4aeaee){return function(_0x5f0bba){try{jsonpatch['apply'](_0x5f0bba,_0x4aeaee,!![]);}catch(_0xd8b606){return BPromise['reject'](_0xd8b606);}return _0x5f0bba[_0x0b90('0x22')]();};}function saveUpdates(_0x21e64a,_0x531292){return function(_0x252f7d){if(_0x252f7d){return _0x252f7d['update'](_0x21e64a)[_0x0b90('0x23')](function(_0x31176d){return _0x31176d;});}return null;};}function removeEntity(_0x5c36c8,_0x438a40){return function(_0x395dd5){if(_0x395dd5){return _0x395dd5['destroy']()[_0x0b90('0x23')](function(){_0x5c36c8[_0x0b90('0x19')](0xcc)[_0x0b90('0x1a')]();});}};}function handleEntityNotFound(_0x2ef42d,_0x1d1926){return function(_0x47a556){if(!_0x47a556){_0x2ef42d[_0x0b90('0x18')](0x194);}return _0x47a556;};}function handleError(_0x449bca,_0x47c7a6){_0x47c7a6=_0x47c7a6||0x1f4;return function(_0x16df19){logger[_0x0b90('0x24')](_0x16df19[_0x0b90('0x25')]);if(_0x16df19['name']){delete _0x16df19[_0x0b90('0x26')];}_0x449bca['status'](_0x47c7a6)[_0x0b90('0x27')](_0x16df19);};}exports[_0x0b90('0x28')]=function(_0x50a188,_0xffe9a3){var _0x18ba82={},_0x163db2={},_0x49cb60={'count':0x0,'rows':[]};var _0x2e073c=_[_0x0b90('0x29')](db[_0x0b90('0x2a')][_0x0b90('0x2b')],function(_0x1219b0){return{'name':_0x1219b0[_0x0b90('0x2c')],'type':_0x1219b0[_0x0b90('0x2d')][_0x0b90('0x2e')]};});_0x163db2[_0x0b90('0x2f')]=_[_0x0b90('0x29')](_0x2e073c,'name');_0x163db2[_0x0b90('0x30')]=_[_0x0b90('0x31')](_0x50a188[_0x0b90('0x30')]);_0x163db2[_0x0b90('0x32')]=_[_0x0b90('0x33')](_0x163db2[_0x0b90('0x2f')],_0x163db2[_0x0b90('0x30')]);_0x18ba82['attributes']=_[_0x0b90('0x33')](_0x163db2[_0x0b90('0x2f')],qs[_0x0b90('0x34')](_0x50a188[_0x0b90('0x30')][_0x0b90('0x34')]));_0x18ba82['attributes']=_0x18ba82[_0x0b90('0x35')][_0x0b90('0x36')]?_0x18ba82['attributes']:_0x163db2[_0x0b90('0x2f')];if(!_0x50a188[_0x0b90('0x30')][_0x0b90('0x37')](_0x0b90('0x38'))){_0x18ba82[_0x0b90('0x1d')]=qs[_0x0b90('0x1d')](_0x50a188[_0x0b90('0x30')]['limit']);_0x18ba82[_0x0b90('0x1b')]=qs[_0x0b90('0x1b')](_0x50a188['query']['offset']);}_0x18ba82[_0x0b90('0x39')]=qs['sort'](_0x50a188[_0x0b90('0x30')][_0x0b90('0x3a')]);_0x18ba82[_0x0b90('0x3b')]=qs['filters'](_[_0x0b90('0x3c')](_0x50a188['query'],_0x163db2[_0x0b90('0x32')]),_0x2e073c);if(_0x50a188[_0x0b90('0x30')][_0x0b90('0x3d')]){_0x18ba82['where']=_[_0x0b90('0x3e')](_0x18ba82[_0x0b90('0x3b')],{'$or':_['map'](_0x2e073c,function(_0x2db558){if(_0x2db558[_0x0b90('0x2d')]!==_0x0b90('0x3f')){var _0x1b55e6={};_0x1b55e6[_0x2db558[_0x0b90('0x26')]]={'$like':'%'+_0x50a188['query'][_0x0b90('0x3d')]+'%'};return _0x1b55e6;}})});}_0x18ba82=_[_0x0b90('0x3e')]({},_0x18ba82,_0x50a188[_0x0b90('0x40')]);var _0x583229={'where':_0x18ba82[_0x0b90('0x3b')]};return db[_0x0b90('0x2a')]['count'](_0x583229)['then'](function(_0xa58670){_0x49cb60[_0x0b90('0x1e')]=_0xa58670;if(_0x50a188['query']['includeAll']){_0x18ba82[_0x0b90('0x41')]=[{'all':!![]}];}return db[_0x0b90('0x2a')][_0x0b90('0x42')](_0x18ba82);})['then'](function(_0x4a8743){_0x49cb60['rows']=_0x4a8743;return _0x49cb60;})[_0x0b90('0x23')](respondWithFilteredResult(_0xffe9a3,_0x18ba82))[_0x0b90('0x43')](handleError(_0xffe9a3,null));};exports[_0x0b90('0x44')]=function(_0x4520b2,_0x17b26c){var _0xd753b6={'raw':!![],'where':{'id':_0x4520b2['params']['id']}},_0x3aa309={};_0x3aa309[_0x0b90('0x2f')]=_[_0x0b90('0x31')](db[_0x0b90('0x2a')][_0x0b90('0x2b')]);_0x3aa309[_0x0b90('0x30')]=_['keys'](_0x4520b2[_0x0b90('0x30')]);_0x3aa309[_0x0b90('0x32')]=_[_0x0b90('0x33')](_0x3aa309[_0x0b90('0x2f')],_0x3aa309[_0x0b90('0x30')]);_0xd753b6[_0x0b90('0x35')]=_[_0x0b90('0x33')](_0x3aa309[_0x0b90('0x2f')],qs[_0x0b90('0x34')](_0x4520b2[_0x0b90('0x30')][_0x0b90('0x34')]));_0xd753b6['attributes']=_0xd753b6[_0x0b90('0x35')]['length']?_0xd753b6[_0x0b90('0x35')]:_0x3aa309['model'];if(_0x4520b2[_0x0b90('0x30')]['includeAll']){_0xd753b6[_0x0b90('0x41')]=[{'all':!![]}];}_0xd753b6=_['merge']({},_0xd753b6,_0x4520b2['options']);return db[_0x0b90('0x2a')][_0x0b90('0x45')](_0xd753b6)[_0x0b90('0x23')](handleEntityNotFound(_0x17b26c,null))[_0x0b90('0x23')](respondWithResult(_0x17b26c,null))['catch'](handleError(_0x17b26c,null));};exports[_0x0b90('0x46')]=function(_0x3d7417,_0x350893){return db[_0x0b90('0x2a')]['create'](_0x3d7417['body'],{})[_0x0b90('0x23')](respondWithResult(_0x350893,0xc9))['catch'](handleError(_0x350893,null));};exports['update']=function(_0x320287,_0x235607){if(_0x320287[_0x0b90('0x47')]['id']){delete _0x320287[_0x0b90('0x47')]['id'];}return db[_0x0b90('0x2a')]['find']({'where':{'id':_0x320287['params']['id']}})[_0x0b90('0x23')](handleEntityNotFound(_0x235607,null))[_0x0b90('0x23')](saveUpdates(_0x320287[_0x0b90('0x47')],null))['then'](respondWithResult(_0x235607,null))[_0x0b90('0x43')](handleError(_0x235607,null));};exports[_0x0b90('0x48')]=function(_0x5f510b,_0x3fac65){return db[_0x0b90('0x2a')][_0x0b90('0x45')]({'where':{'id':_0x5f510b['params']['id']}})[_0x0b90('0x23')](handleEntityNotFound(_0x3fac65,null))['then'](removeEntity(_0x3fac65,null))['catch'](handleError(_0x3fac65,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index c4dc6d7..7fa298c 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 _0x0889=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2d0d9f,_0x22c0d8){var _0x30243d=function(_0x29a92b){while(--_0x29a92b){_0x2d0d9f['push'](_0x2d0d9f['shift']());}};_0x30243d(++_0x22c0d8);}(_0x0889,0x103));var _0x9088=function(_0x2da0f6,_0x3986fb){_0x2da0f6=_0x2da0f6-0x0;var _0x53ebeb=_0x0889[_0x2da0f6];return _0x53ebeb;};'use strict';var _=require(_0x9088('0x0'));var util=require(_0x9088('0x1'));var logger=require(_0x9088('0x2'))(_0x9088('0x3'));var moment=require('moment');var BPromise=require(_0x9088('0x4'));var rp=require(_0x9088('0x5'));var fs=require('fs');var path=require(_0x9088('0x6'));var rimraf=require('rimraf');var config=require(_0x9088('0x7'));var attributes=require(_0x9088('0x8'));module[_0x9088('0x9')]=function(_0x5b9a8a,_0xe92e73){return _0x5b9a8a[_0x9088('0xa')](_0x9088('0xb'),attributes,{'tableName':_0x9088('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9088('0xd')});}; \ No newline at end of file +var _0x9757=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x34a057,_0x3d3299){var _0xf2361f=function(_0x8c3c42){while(--_0x8c3c42){_0x34a057['push'](_0x34a057['shift']());}};_0xf2361f(++_0x3d3299);}(_0x9757,0xca));var _0x7975=function(_0x18b256,_0x3c110f){_0x18b256=_0x18b256-0x0;var _0x2bc0f6=_0x9757[_0x18b256];return _0x2bc0f6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7975('0x0'))(_0x7975('0x1'));var moment=require(_0x7975('0x2'));var BPromise=require(_0x7975('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7975('0x4'));var rimraf=require(_0x7975('0x5'));var config=require(_0x7975('0x6'));var attributes=require(_0x7975('0x7'));module[_0x7975('0x8')]=function(_0x4348ad,_0x232963){return _0x4348ad[_0x7975('0x9')](_0x7975('0xa'),attributes,{'tableName':_0x7975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7975('0xc'),'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 eef4a8b..a55d951 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 _0x9bb9=['http','request','then','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9bb9,0x84));var _0x99bb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bb9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x99bb('0x0'));var util=require(_0x99bb('0x1'));var moment=require('moment');var BPromise=require(_0x99bb('0x2'));var rs=require(_0x99bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x99bb('0x4'));var logger=require(_0x99bb('0x5'))(_0x99bb('0x6'));var config=require('../../config/environment');var jayson=require(_0x99bb('0x7'));var client=jayson['client'][_0x99bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c16a1,_0x43e721,_0x3c5da2){return new BPromise(function(_0x36e625,_0x3cb654){return client[_0x99bb('0x9')](_0x1c16a1,_0x3c5da2)[_0x99bb('0xa')](function(_0x478767){logger['info']('FaxApplication,\x20%s,\x20%s',_0x43e721,_0x99bb('0xb'));logger[_0x99bb('0xc')](_0x99bb('0xd'),_0x43e721,_0x99bb('0xb'),JSON[_0x99bb('0xe')](_0x478767));if(_0x478767[_0x99bb('0xf')]){if(_0x478767[_0x99bb('0xf')][_0x99bb('0x10')]===0x1f4){logger['error'](_0x99bb('0x11'),_0x43e721,_0x478767[_0x99bb('0xf')]['message']);return _0x3cb654(_0x478767['error'][_0x99bb('0x12')]);}logger[_0x99bb('0xf')](_0x99bb('0x11'),_0x43e721,_0x478767[_0x99bb('0xf')]['message']);return _0x36e625(_0x478767[_0x99bb('0xf')]['message']);}else{logger[_0x99bb('0x13')](_0x99bb('0x11'),_0x43e721,_0x99bb('0xb'));_0x36e625(_0x478767[_0x99bb('0x14')][_0x99bb('0x12')]);}})[_0x99bb('0x15')](function(_0x612338){logger[_0x99bb('0xf')](_0x99bb('0x11'),_0x43e721,_0x612338);_0x3cb654(_0x612338);});});}exports[_0x99bb('0x16')]=function(_0x3bd64a){var _0x523902=this;return new Promise(function(_0x32fd8b,_0x21c467){return db[_0x99bb('0x17')]['update'](_0x3bd64a['body'],{'raw':_0x3bd64a['options']?_0x3bd64a[_0x99bb('0x18')][_0x99bb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bd64a[_0x99bb('0x18')]?_0x3bd64a['options'][_0x99bb('0x1a')]||null:null,'attributes':_0x3bd64a[_0x99bb('0x18')]?_0x3bd64a[_0x99bb('0x18')][_0x99bb('0x1b')]||null:null,'limit':_0x3bd64a[_0x99bb('0x18')]?_0x3bd64a[_0x99bb('0x18')]['limit']||null:null})['then'](function(_0x164f06){logger[_0x99bb('0x13')](_0x99bb('0x16'),_0x3bd64a);logger[_0x99bb('0xc')]('UpdateFaxApplication',_0x3bd64a,JSON[_0x99bb('0xe')](_0x164f06));_0x32fd8b(_0x164f06);})[_0x99bb('0x15')](function(_0x35fcb5){logger[_0x99bb('0xf')](_0x99bb('0x16'),_0x35fcb5[_0x99bb('0x12')],_0x3bd64a);_0x21c467(_0x523902[_0x99bb('0xf')](0x1f4,_0x35fcb5[_0x99bb('0x12')]));});});}; \ No newline at end of file +var _0x5d59=['attributes','limit','then','UpdateFaxApplication','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','options','raw','where'];(function(_0x125ee6,_0x5224bd){var _0x215486=function(_0x3df604){while(--_0x3df604){_0x125ee6['push'](_0x125ee6['shift']());}};_0x215486(++_0x5224bd);}(_0x5d59,0x159));var _0x95d5=function(_0x454d94,_0x2d5642){_0x454d94=_0x454d94-0x0;var _0x1389b0=_0x5d59[_0x454d94];return _0x1389b0;};'use strict';var _=require(_0x95d5('0x0'));var util=require(_0x95d5('0x1'));var moment=require(_0x95d5('0x2'));var BPromise=require('bluebird');var rs=require(_0x95d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95d5('0x4'));var logger=require(_0x95d5('0x5'))(_0x95d5('0x6'));var config=require(_0x95d5('0x7'));var jayson=require(_0x95d5('0x8'));var client=jayson['client'][_0x95d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b9e2b,_0x3f8399,_0x57c95f){return new BPromise(function(_0x158e13,_0x196456){return client['request'](_0x2b9e2b,_0x57c95f)['then'](function(_0x542aab){logger[_0x95d5('0xa')](_0x95d5('0xb'),_0x3f8399,_0x95d5('0xc'));logger[_0x95d5('0xd')](_0x95d5('0xe'),_0x3f8399,_0x95d5('0xc'),JSON[_0x95d5('0xf')](_0x542aab));if(_0x542aab[_0x95d5('0x10')]){if(_0x542aab[_0x95d5('0x10')][_0x95d5('0x11')]===0x1f4){logger[_0x95d5('0x10')](_0x95d5('0xb'),_0x3f8399,_0x542aab['error'][_0x95d5('0x12')]);return _0x196456(_0x542aab['error'][_0x95d5('0x12')]);}logger[_0x95d5('0x10')](_0x95d5('0xb'),_0x3f8399,_0x542aab[_0x95d5('0x10')]['message']);return _0x158e13(_0x542aab[_0x95d5('0x10')][_0x95d5('0x12')]);}else{logger[_0x95d5('0xa')](_0x95d5('0xb'),_0x3f8399,_0x95d5('0xc'));_0x158e13(_0x542aab[_0x95d5('0x13')]['message']);}})[_0x95d5('0x14')](function(_0x578647){logger['error'](_0x95d5('0xb'),_0x3f8399,_0x578647);_0x196456(_0x578647);});});}exports['UpdateFaxApplication']=function(_0x4520f2){var _0x5afeb6=this;return new Promise(function(_0x6b4da2,_0x47b1e8){return db[_0x95d5('0x15')][_0x95d5('0x16')](_0x4520f2[_0x95d5('0x17')],{'raw':_0x4520f2[_0x95d5('0x18')]?_0x4520f2[_0x95d5('0x18')][_0x95d5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4520f2['options']?_0x4520f2[_0x95d5('0x18')][_0x95d5('0x1a')]||null:null,'attributes':_0x4520f2['options']?_0x4520f2[_0x95d5('0x18')][_0x95d5('0x1b')]||null:null,'limit':_0x4520f2['options']?_0x4520f2[_0x95d5('0x18')][_0x95d5('0x1c')]||null:null})[_0x95d5('0x1d')](function(_0x26099f){logger[_0x95d5('0xa')](_0x95d5('0x1e'),_0x4520f2);logger[_0x95d5('0xd')](_0x95d5('0x1e'),_0x4520f2,JSON[_0x95d5('0xf')](_0x26099f));_0x6b4da2(_0x26099f);})[_0x95d5('0x14')](function(_0x2425ce){logger[_0x95d5('0x10')](_0x95d5('0x1e'),_0x2425ce[_0x95d5('0x12')],_0x4520f2);_0x47b1e8(_0x5afeb6['error'](0x1f4,_0x2425ce['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 62f8d6a..07fa011 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 _0x6cb4=['get','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated'];(function(_0x578c1f,_0x3b2de0){var _0x15dadc=function(_0x4d982a){while(--_0x4d982a){_0x578c1f['push'](_0x578c1f['shift']());}};_0x15dadc(++_0x3b2de0);}(_0x6cb4,0xff));var _0x46cb=function(_0xb5be44,_0x475bc0){_0xb5be44=_0xb5be44-0x0;var _0x25651f=_0x6cb4[_0xb5be44];return _0x25651f;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xe')]('/',auth[_0x46cb('0xa')](),controller['create']);router[_0x46cb('0xf')](_0x46cb('0xc'),auth['isAuthenticated'](),controller[_0x46cb('0x10')]);router[_0x46cb('0x11')]('/:id',auth[_0x46cb('0xa')](),controller[_0x46cb('0x12')]);module['exports']=router; \ No newline at end of file +var _0xef0f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0xef0f,0x168));var _0xfef0=function(_0x2cc3c5,_0x5afa5b){_0x2cc3c5=_0x2cc3c5-0x0;var _0x18b51a=_0xef0f[_0x2cc3c5];return _0x18b51a;};'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['post']('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xd')]);router[_0xfef0('0xe')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xf')]);router[_0xfef0('0x10')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x11')]);module[_0xfef0('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 40b5ddf..c68eb4d 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 _0x11d0=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0xa2d11,_0x5b7f27){var _0x103a96=function(_0x3f83ff){while(--_0x3f83ff){_0xa2d11['push'](_0xa2d11['shift']());}};_0x103a96(++_0x5b7f27);}(_0x11d0,0x76));var _0x011d=function(_0xe2deca,_0x395b70){_0xe2deca=_0xe2deca-0x0;var _0x1cbf79=_0x11d0[_0xe2deca];return _0x1cbf79;};'use strict';var Sequelize=require(_0x011d('0x0'));module[_0x011d('0x1')]={'closed':{'type':Sequelize[_0x011d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x011d('0x3')]},'disposition':{'type':Sequelize[_0x011d('0x4')]},'secondDisposition':{'type':Sequelize[_0x011d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x011d('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x011d('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x011d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x011d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x011d('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xe68f=['DATE','STRING','ENUM','out','sequelize'];(function(_0x3543b2,_0x2e55b0){var _0x249255=function(_0x19f269){while(--_0x19f269){_0x3543b2['push'](_0x3543b2['shift']());}};_0x249255(++_0x2e55b0);}(_0xe68f,0x158));var _0xfe68=function(_0xec6887,_0x2a2226){_0xec6887=_0xec6887-0x0;var _0x2f39a5=_0xe68f[_0xec6887];return _0x2f39a5;};'use strict';var Sequelize=require(_0xfe68('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfe68('0x1')]},'disposition':{'type':Sequelize[_0xfe68('0x2')]},'secondDisposition':{'type':Sequelize[_0xfe68('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfe68('0x2')]},'note':{'type':Sequelize[_0xfe68('0x2')]},'read1stAt':{'type':Sequelize[_0xfe68('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xfe68('0x3')]('in',_0xfe68('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfe68('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xfe68('0x3')]('in',_0xfe68('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 33b05b1..f541689 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 _0xc62c=['operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','ContactId','type','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','text','body','buildExpression','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','user','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','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','c.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','show','params','includeAll','include','create','FaxInteraction','describe','addMessage','FaxMessage','ids','omit','getMessages','nolimit','FaxInteractionId','merge','$gte','format','options','addTags','setTags','spread','emit','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','waiting','talking','answered','unmanaged','total','UserId','closed','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','field','color','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','t.id\x20=\x20it.TagId','search','sqlOperator','find','unreadMessages','having','`\x20=\x200','Contact'];(function(_0x5558fb,_0xe6bb5e){var _0x11368d=function(_0x4f0cd6){while(--_0x4f0cd6){_0x5558fb['push'](_0x5558fb['shift']());}};_0x11368d(++_0xe6bb5e);}(_0xc62c,0x152));var _0xcc62=function(_0x55a984,_0x3c1a84){_0x55a984=_0x55a984-0x0;var _0x36c8f3=_0xc62c[_0x55a984];return _0x36c8f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc62('0x0'));var zipdir=require(_0xcc62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcc62('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcc62('0x3'));var util=require(_0xcc62('0x4'));var path=require(_0xcc62('0x5'));var sox=require(_0xcc62('0x6'));var csv=require('to-csv');var ejs=require(_0xcc62('0x7'));var fs=require('fs');var fs_extra=require(_0xcc62('0x8'));var _=require(_0xcc62('0x9'));var squel=require(_0xcc62('0xa'));var crypto=require(_0xcc62('0xb'));var jsforce=require(_0xcc62('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcc62('0xd'));var querystring=require(_0xcc62('0xe'));var Papa=require(_0xcc62('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcc62('0x10'));var as=require(_0xcc62('0x11'));var hardwareService=require(_0xcc62('0x12'));var logger=require(_0xcc62('0x13'))(_0xcc62('0x14'));var utils=require(_0xcc62('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcc62('0x16'))['db'];config[_0xcc62('0x17')]=_[_0xcc62('0x18')](config[_0xcc62('0x17')],{'host':_0xcc62('0x19'),'port':0x18eb});var socket=require(_0xcc62('0x1a'))(new Redis(config['redis']));require(_0xcc62('0x1b'))[_0xcc62('0x1c')](socket);function respondWithStatusCode(_0x4d4aa7,_0x1cf5a5){_0x1cf5a5=_0x1cf5a5||0xcc;return function(_0x2a88cb){if(_0x2a88cb){return _0x4d4aa7[_0xcc62('0x1d')](_0x1cf5a5);}return _0x4d4aa7[_0xcc62('0x1e')](_0x1cf5a5)['end']();};}function respondWithResult(_0x1aad77,_0x3c902b){_0x3c902b=_0x3c902b||0xc8;return function(_0x522d73){if(_0x522d73){return _0x1aad77[_0xcc62('0x1e')](_0x3c902b)['json'](_0x522d73);}};}function respondWithFilteredResult(_0x31fb67,_0x182eae){return function(_0x4f0b37){if(_0x4f0b37){var _0x5613c5=typeof _0x182eae[_0xcc62('0x1f')]===_0xcc62('0x20')&&typeof _0x182eae[_0xcc62('0x21')]==='undefined';var _0x5539cd=_0x4f0b37[_0xcc62('0x22')];var _0x19aa7a=_0x5613c5?0x0:_0x182eae[_0xcc62('0x1f')];var _0x2cc672=_0x5613c5?_0x4f0b37['count']:_0x182eae[_0xcc62('0x1f')]+_0x182eae[_0xcc62('0x21')];var _0x328a4f;if(_0x2cc672>=_0x5539cd){_0x2cc672=_0x5539cd;_0x328a4f=0xc8;}else{_0x328a4f=0xce;}_0x31fb67[_0xcc62('0x1e')](_0x328a4f);return _0x31fb67['set'](_0xcc62('0x23'),_0x19aa7a+'-'+_0x2cc672+'/'+_0x5539cd)[_0xcc62('0x24')](_0x4f0b37);}return null;};}function patchUpdates(_0x30bea1){return function(_0x1a7d08){try{jsonpatch['apply'](_0x1a7d08,_0x30bea1,!![]);}catch(_0x17b957){return BPromise[_0xcc62('0x25')](_0x17b957);}return _0x1a7d08[_0xcc62('0x26')]();};}function saveUpdates(_0x492873,_0x486059){return function(_0x20630d){if(_0x20630d){return _0x20630d[_0xcc62('0x27')](_0x492873)['then'](function(_0x37d516){return _0x37d516;});}return null;};}function removeEntity(_0x482c81,_0x50ac5c){return function(_0x2bfe0a){if(_0x2bfe0a){return _0x2bfe0a[_0xcc62('0x28')]()[_0xcc62('0x29')](function(){_0x482c81[_0xcc62('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dbb5f,_0x425027){return function(_0xed403d){if(!_0xed403d){_0x4dbb5f[_0xcc62('0x1d')](0x194);}return _0xed403d;};}function handleError(_0x4ce179,_0x4cb76f){_0x4cb76f=_0x4cb76f||0x1f4;return function(_0x70b3f6){logger[_0xcc62('0x2a')](_0x70b3f6['stack']);if(_0x70b3f6[_0xcc62('0x2b')]){delete _0x70b3f6[_0xcc62('0x2b')];}_0x4ce179[_0xcc62('0x1e')](_0x4cb76f)[_0xcc62('0x2c')](_0x70b3f6);};}function getInteractionUsers(_0x564894,_0x3763d3){return new BPromise(function(_0x50c91c,_0x519308){try{if(_0x3763d3[_0x564894['id']]){_0x564894[_0xcc62('0x2d')]=_[_0xcc62('0x2e')](_0x3763d3[_0x564894['id']],function(_0x3eaf8f){return{'id':_0x3eaf8f['id'],'fullname':_0x3eaf8f[_0xcc62('0x2f')]};});}}catch(_0x29cec5){_0x519308(_0x29cec5);}_0x50c91c(_0x564894);});}function getInteractionTags(_0x379f5b,_0x2a516a){return new BPromise(function(_0x277c92,_0x4061a3){try{if(_0x379f5b[_0xcc62('0x30')]){_0x379f5b['Tags']=[];_0x379f5b[_0xcc62('0x30')][_0xcc62('0x31')](',')[_0xcc62('0x32')](function(_0x99a985){_0x379f5b[_0xcc62('0x33')][_0xcc62('0x34')](_0x2a516a[_0x99a985]);});}delete _0x379f5b['TagIds'];}catch(_0x3810b1){_0x4061a3(_0x3810b1);}_0x277c92(_0x379f5b);});}function updateFaxInteraction(_0x21bebc,_0x2b75c8,_0x59178a){return new BPromise(function(_0x45b520,_0x3ef007){return getInteractionUsers(_0x21bebc,_0x59178a)['then'](function(_0x579bc9){return getInteractionTags(_0x579bc9,_0x2b75c8);})['then'](function(_0x1e20c9){return getStateInteraction(_0x1e20c9);})[_0xcc62('0x29')](function(_0x43a254){_0x45b520(_0x43a254);})[_0xcc62('0x35')](function(_0x497b55){_0x3ef007(_0x497b55);});});}function getStateInteraction(_0x112e10){return new BPromise(function(_0x477a23){_0x112e10[_0xcc62('0x36')]=0x0;_0x112e10[_0xcc62('0x37')]=0x0;_0x112e10[_0xcc62('0x38')]=0x0;_0x112e10[_0xcc62('0x39')]=0x0;_0x112e10[_0xcc62('0x3a')]=0x0;if(!_0x112e10['closed']&&!_0x112e10[_0xcc62('0x3b')]){_0x112e10[_0xcc62('0x36')]+=0x1;}if(!_0x112e10[_0xcc62('0x3c')]&&_0x112e10[_0xcc62('0x3b')]){_0x112e10[_0xcc62('0x37')]+=0x1;if(_0x112e10['waiting']){_0x112e10[_0xcc62('0x36')]-=0x1;}}if(_0x112e10[_0xcc62('0x3c')]&&_0x112e10[_0xcc62('0x3b')]){_0x112e10[_0xcc62('0x38')]+=0x1;if(_0x112e10[_0xcc62('0x37')]){_0x112e10[_0xcc62('0x37')]-=0x1;}}if(_0x112e10[_0xcc62('0x3c')]&&!_0x112e10[_0xcc62('0x3b')]){_0x112e10[_0xcc62('0x39')]+=0x1;if(_0x112e10[_0xcc62('0x36')]){_0x112e10[_0xcc62('0x36')]-=0x1;}}_0x112e10[_0xcc62('0x3a')]+=0x1;_0x477a23(_0x112e10);});}exports[_0xcc62('0x3d')]=function(_0x3b87f9,_0x2f5159){var _0x5125a0={},_0x455ec3={},_0x1d598b={'count':0x0,'rows':[]};var _0x37a820=_[_0xcc62('0x2e')](db['FaxInteraction'][_0xcc62('0x3e')],function(_0x193330){return{'name':_0x193330['fieldName'],'type':_0x193330['type']['key']};});_0x455ec3[_0xcc62('0x3f')]=_[_0xcc62('0x2e')](_0x37a820,_0xcc62('0x2b'));_0x455ec3[_0xcc62('0x40')]=_[_0xcc62('0x41')](_0x3b87f9['query']);_0x455ec3[_0xcc62('0x42')]=_[_0xcc62('0x43')](_0x455ec3['model'],_0x455ec3[_0xcc62('0x40')]);_0x5125a0['attributes']=_[_0xcc62('0x43')](_0x455ec3[_0xcc62('0x3f')],qs[_0xcc62('0x44')](_0x3b87f9['query'][_0xcc62('0x44')]));_0x5125a0['attributes']=_0x5125a0[_0xcc62('0x45')][_0xcc62('0x46')]?_0x5125a0['attributes']:_0x455ec3[_0xcc62('0x3f')];if(!_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x47')]('nolimit')){_0x5125a0[_0xcc62('0x21')]=qs['limit'](_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x21')]);_0x5125a0[_0xcc62('0x1f')]=qs['offset'](_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x1f')]);}_0x5125a0['order']=qs[_0xcc62('0x48')](_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x48')]);_0x5125a0[_0xcc62('0x49')]=qs['filters'](_[_0xcc62('0x4a')](_0x3b87f9[_0xcc62('0x40')],_0x455ec3[_0xcc62('0x42')]),_0x37a820);var _0x1232e1=[];var _0x5d7a46=squel['select']()[_0xcc62('0x4b')]('id')['field'](_0xcc62('0x2b'))[_0xcc62('0x4b')](_0xcc62('0x4c'))[_0xcc62('0x4d')]('tools_tags');var _0x473986=squel['select']()[_0xcc62('0x4b')](_0xcc62('0x4e'))[_0xcc62('0x4b')](_0xcc62('0x4f'))[_0xcc62('0x4b')](_0xcc62('0x50'))[_0xcc62('0x4d')](_0xcc62('0x51'),'ui')[_0xcc62('0x52')](_0xcc62('0x53'),'u',_0xcc62('0x54'));var _0x1f6501=squel[_0xcc62('0x55')]()[_0xcc62('0x4d')](_0xcc62('0x56'),'i')[_0xcc62('0x52')]('cm_contacts','c',_0xcc62('0x57'))[_0xcc62('0x52')]('users','o',_0xcc62('0x58'))[_0xcc62('0x52')](_0xcc62('0x59'),'a',_0xcc62('0x5a'))[_0xcc62('0x52')](_0xcc62('0x5b'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xcc62('0x52')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0xcc62('0x52')]('tools_tags','t',_0xcc62('0x5c'));var _0x343f93=squel['expr']();var _0x3da269=[];var _0x21cef9=squel['expr']();var _0x3cb235;if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x5d')]){_0x3cb235=as['parseSearch'](_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x5d')]);var _0x2aaf8a=_0x3cb235[_0xcc62('0x5e')];for(var _0x1cd2b6=0x0;_0x1cd2b6<_0x3cb235['conditions'][_0xcc62('0x46')];_0x1cd2b6++){var _0x27b011=_0x3cb235['conditions'][_0x1cd2b6];var _0x164690='i';var _0x46a945=_[_0xcc62('0x5f')](_0x37a820,[_0xcc62('0x2b'),_0x27b011['field']]);if(!_0x46a945){switch(_0x27b011[_0xcc62('0x4b')]){case _0xcc62('0x60'):if(_0x27b011['value']==0x1){_0x1f6501[_0xcc62('0x61')]('`'+_0x27b011['field']+_0xcc62('0x62'));}else{_0x1f6501[_0xcc62('0x61')]('`'+_0x27b011[_0xcc62('0x4b')]+'`\x20>\x200');}break;case _0xcc62('0x63'):if(_0x27b011[_0xcc62('0x64')]==='$substring'){if(_0x27b011['value'][_0xcc62('0x31')]('\x20')[_0xcc62('0x46')]>0x1){_0x343f93[_0x2aaf8a](_0xcc62('0x65'),qs['getFullTextValue'](_0x27b011[_0xcc62('0x66')]),null);}else{var _0x1c6094='%'+_0x27b011['value']+'%';_0x343f93[_0x2aaf8a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1c6094,_0x1c6094,_0x1c6094);}}else{_0x46a945=_[_0xcc62('0x5f')](_0x37a820,[_0xcc62('0x2b'),_0xcc62('0x67')]);_0x27b011[_0xcc62('0x4b')]=_0xcc62('0x67');_0x143aad=as['buildExpression'](_0x164690,_0x46a945[_0xcc62('0x68')],_0x27b011);_0x343f93[_0x2aaf8a](_0x143aad['text'],_0x143aad[_0xcc62('0x66')][_0xcc62('0x69')],_0x143aad[_0xcc62('0x66')][_0xcc62('0x6a')]);}break;case _0xcc62('0x6b'):var _0x5225e8=_0x27b011['value']['split'](',')[_0xcc62('0x2e')](function(_0x218c9d){return Number(_0x218c9d);});_0x5225e8[_0xcc62('0x32')](function(_0x1df023){_0x21cef9['or'](_0xcc62('0x6c'),'%,'+_0x1df023+',%');});_0x3da269=_[_0xcc62('0x6d')](_0x3da269,_0x5225e8);break;case _0xcc62('0x6e'):if(_0x27b011[_0xcc62('0x64')]===_0xcc62('0x6f')){_0x343f93[_0x2aaf8a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x27b011[_0xcc62('0x66')]+'%',null);}else{_0x46a945=_[_0xcc62('0x5f')](_0x37a820,['name',_0xcc62('0x3b')]);_0x27b011[_0xcc62('0x4b')]=_0xcc62('0x3b');_0x143aad=as['buildExpression'](_0x164690,_0x46a945[_0xcc62('0x68')],_0x27b011);_0x343f93[_0x2aaf8a](_0x143aad[_0xcc62('0x70')],_0x143aad[_0xcc62('0x66')][_0xcc62('0x69')],_0x143aad['value'][_0xcc62('0x6a')]);}break;case _0xcc62('0x71'):_0x143aad=as[_0xcc62('0x72')]('me',null,_0x27b011);_0x343f93[_0x2aaf8a](_0x143aad['text'],_0x143aad['value']['start'],_0x143aad[_0xcc62('0x66')][_0xcc62('0x6a')]);break;}}else{var _0x143aad=as['buildExpression'](_0x164690,_0x46a945[_0xcc62('0x68')],_0x27b011);_0x343f93[_0x2aaf8a](_0x143aad[_0xcc62('0x70')],_0x143aad[_0xcc62('0x66')]['start'],_0x143aad[_0xcc62('0x66')][_0xcc62('0x6a')]);}}}else{var _0x16118c=_(_0x3b87f9['query'])[_0xcc62('0x41')]()[_0xcc62('0x2e')](function(_0x3bc6ca){return _[_0xcc62('0x73')](_0x37a820,[_0xcc62('0x2b'),_0x3bc6ca])?_0x3bc6ca:undefined;})['compact']()[_0xcc62('0x66')]();if(!_[_0xcc62('0x74')](_0x16118c)){_0x16118c[_0xcc62('0x32')](function(_0x136ff4){if(_0x136ff4===_0xcc62('0x75')){_0x1f6501[_0xcc62('0x49')](_0xcc62('0x76'),[][_0xcc62('0x77')](_0x3b87f9[_0xcc62('0x40')][_0x136ff4]));}else if(_0x136ff4===_0xcc62('0x78')){var _0x40e6c4=JSON[_0xcc62('0x79')](_0x3b87f9[_0xcc62('0x40')][_0x136ff4])['$gte'];var _0x5ed316=JSON[_0xcc62('0x79')](_0x3b87f9[_0xcc62('0x40')][_0x136ff4])[_0xcc62('0x7a')];_0x1f6501['where'](_0xcc62('0x7b'),_0x40e6c4,_0x5ed316);}else{if(_0x3b87f9[_0xcc62('0x40')][_0x136ff4]===_0xcc62('0x7c')){_0x1f6501[_0xcc62('0x49')]('i.'+_0x136ff4+'\x20IS\x20NULL');}else{_0x1f6501[_0xcc62('0x49')]('i.'+_0x136ff4+_0xcc62('0x7d'),_0x3b87f9[_0xcc62('0x40')][_0x136ff4]);}}});}if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x7e')]){if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x7e')]==0x1){_0x1f6501[_0xcc62('0x61')](_0xcc62('0x7f'));}else{_0x1f6501[_0xcc62('0x61')](_0xcc62('0x80'));}}if(_0x3b87f9[_0xcc62('0x40')]['tag']){_0x3da269=_['isArray'](_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x81')])?_0x3b87f9[_0xcc62('0x40')]['tag']:new Array(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x81')]);_0x3da269[_0xcc62('0x32')](function(_0x2b7e78){_0x21cef9['or'](_0xcc62('0x6c'),'%,'+_0x2b7e78+',%');});}if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x82')]){var _0x4cb506=_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x82')][_0xcc62('0x83')]('\x5c','\x5c\x5c')[_0xcc62('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4cb506)){_0x343f93['or'](_0xcc62('0x84'),_0x4cb506+'%')['or'](_0xcc62('0x85'),_0x4cb506+'%');}_0x343f93['or'](_0xcc62('0x86'),_0x4cb506+'%');}}_0x1f6501[_0xcc62('0x49')](_0x343f93);_0x1f6501[_0xcc62('0x87')]('i.id');var _0x30e7dc={'type':db[_0xcc62('0x88')][_0xcc62('0x89')][_0xcc62('0x8a')],'raw':!![]};var _0x538f59=_0x1f6501[_0xcc62('0x8b')]();_0x538f59[_0xcc62('0x4b')](_0xcc62('0x8c'));_0x538f59[_0xcc62('0x4b')](_0xcc62('0x8d'),_0xcc62('0x60'));if(_0x5125a0['order']){_0x5125a0[_0xcc62('0x8e')][_0xcc62('0x32')](function(_0x408df2){var _0x358ce6=_0x408df2[0x0]==='contactName'?_0x408df2[0x0]:'i.'+_0x408df2[0x0];_0x1f6501['order'](_0x358ce6,_0x408df2[0x1]===_0xcc62('0x8f')?![]:!![]);});}if(!_[_0xcc62('0x74')](_0x3da269)){_0x1f6501[_0xcc62('0x61')](_0x21cef9);_0x538f59[_0xcc62('0x49')](_0xcc62('0x90'),_0x3da269);}BPromise[_0xcc62('0x91')]()['then'](function(){if(!_0x3cb235){if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x75')])return;_0x538f59[_0xcc62('0x49')](_0xcc62('0x92'));_0x1f6501[_0xcc62('0x49')](_0xcc62('0x92'));return;}if(_0x3b87f9['user']['role']!==_0xcc62('0x93'))return;return _0x3b87f9[_0xcc62('0x94')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xcc62('0x29')](function(_0xfb7661){if(_['isEmpty'](_0xfb7661)){_0x538f59[_0xcc62('0x49')](_0xcc62('0x95'));_0x1f6501[_0xcc62('0x49')](_0xcc62('0x95'));}else{_0x538f59[_0xcc62('0x49')]('i.FaxAccountId\x20IN\x20?',_[_0xcc62('0x2e')](_0xfb7661,'id'));_0x1f6501[_0xcc62('0x49')](_0xcc62('0x76'),_[_0xcc62('0x2e')](_0xfb7661,'id'));}});})[_0xcc62('0x29')](function(){if(_0x3b87f9[_0xcc62('0x94')][_0xcc62('0x96')]===_0xcc62('0x93')&&!_0x3cb235&&!_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x75')])return[];return db[_0xcc62('0x97')][_0xcc62('0x40')](_0x538f59['toString'](),_0x30e7dc);})[_0xcc62('0x29')](function(_0x3ca1fa){_0x1d598b[_0xcc62('0x22')]=_0x3ca1fa['length'];if(_0x1d598b['count']===0x0)return[];return db[_0xcc62('0x97')][_0xcc62('0x40')](_0x5d7a46[_0xcc62('0x98')](),_0x30e7dc)[_0xcc62('0x29')](function(_0xd7066c){_0x1232e1=_[_0xcc62('0x99')](_0xd7066c,'id');_0x30e7dc=_['merge'](_0x30e7dc,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b87f9[_0xcc62('0x40')][_0xcc62('0x44')]){_0x5125a0['attributes'][_0xcc62('0x32')](function(_0xb289a7){_0x1f6501[_0xcc62('0x4b')]('i.'+_0xb289a7);});}else{_0x1f6501['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xcc62('0x60'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0x9a'),_0xcc62('0x9b'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0x9c'),_0xcc62('0x9d'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0x9e'),_0xcc62('0x9f'));_0x1f6501['field'](_0xcc62('0xa0'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xa1'),_0xcc62('0xa2'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xa3'),_0xcc62('0xa4'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xa5'),'Contact.email');_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xa6'),'Contact.phone');_0x1f6501[_0xcc62('0x4b')]('c.mobile',_0xcc62('0xa7'));_0x1f6501[_0xcc62('0x4b')]('c.fax','Contact.fax');_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xa8'),_0xcc62('0xa9'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xaa'),_0xcc62('0xab'));_0x1f6501[_0xcc62('0x4b')](_0xcc62('0xac'),_0xcc62('0x30'));}if(_0x5125a0[_0xcc62('0x21')])_0x1f6501[_0xcc62('0x21')](_0x5125a0[_0xcc62('0x21')]);if(_0x5125a0[_0xcc62('0x1f')])_0x1f6501[_0xcc62('0x1f')](_0x5125a0[_0xcc62('0x1f')]);return db[_0xcc62('0x97')]['query'](_0x1f6501['toString'](),_0x30e7dc);})[_0xcc62('0x29')](function(_0x45fb39){if(_0x45fb39[_0xcc62('0x46')]>0x0)_0x473986[_0xcc62('0x49')](_0xcc62('0xad'),_[_0xcc62('0x2e')](_0x45fb39,'id'));return db[_0xcc62('0x97')]['query'](_0x473986[_0xcc62('0x98')](),_0x30e7dc)[_0xcc62('0x29')](function(_0x341f0a){var _0xfe7475=_[_0xcc62('0xae')](_0x341f0a,'FaxInteractionId');var _0x37930a=[];_0x45fb39[_0xcc62('0x32')](function(_0x298f42){_0x37930a[_0xcc62('0x34')](updateFaxInteraction(_0x298f42,_0x1232e1,_0xfe7475));});return BPromise['all'](_0x37930a);});});})[_0xcc62('0x29')](function(_0x1eb05d){_0x1d598b[_0xcc62('0xaf')]=_0x1eb05d;return _0x1d598b;})[_0xcc62('0x29')](respondWithFilteredResult(_0x2f5159,_0x5125a0))[_0xcc62('0x35')](handleError(_0x2f5159,null));};exports[_0xcc62('0xb0')]=function(_0x50784c,_0xc5a284){var _0x2f827e={'raw':![],'where':{'id':_0x50784c[_0xcc62('0xb1')]['id']}},_0x1163ed={};_0x1163ed[_0xcc62('0x3f')]=_['keys'](db['FaxInteraction'][_0xcc62('0x3e')]);_0x1163ed[_0xcc62('0x40')]=_[_0xcc62('0x41')](_0x50784c[_0xcc62('0x40')]);_0x1163ed['filters']=_[_0xcc62('0x43')](_0x1163ed[_0xcc62('0x3f')],_0x1163ed['query']);_0x2f827e[_0xcc62('0x45')]=_[_0xcc62('0x43')](_0x1163ed[_0xcc62('0x3f')],qs[_0xcc62('0x44')](_0x50784c[_0xcc62('0x40')][_0xcc62('0x44')]));_0x2f827e[_0xcc62('0x45')]=_0x2f827e[_0xcc62('0x45')][_0xcc62('0x46')]?_0x2f827e[_0xcc62('0x45')]:_0x1163ed[_0xcc62('0x3f')];if(_0x50784c[_0xcc62('0x40')][_0xcc62('0xb2')]){_0x2f827e[_0xcc62('0xb3')]=[{'all':!![]}];}_0x2f827e=_['merge']({},_0x2f827e,_0x50784c['options']);return db['FaxInteraction'][_0xcc62('0x5f')](_0x2f827e)[_0xcc62('0x29')](handleEntityNotFound(_0xc5a284,null))[_0xcc62('0x29')](respondWithResult(_0xc5a284,null))[_0xcc62('0x35')](handleError(_0xc5a284,null));};exports[_0xcc62('0xb4')]=function(_0x404fc7,_0x27440a){return db[_0xcc62('0xb5')][_0xcc62('0xb4')](_0x404fc7[_0xcc62('0x71')],{})[_0xcc62('0x29')](respondWithResult(_0x27440a,0xc9))['catch'](handleError(_0x27440a,null));};exports[_0xcc62('0x27')]=function(_0x1964c3,_0x44af25){if(_0x1964c3[_0xcc62('0x71')]['id']){delete _0x1964c3[_0xcc62('0x71')]['id'];}return db[_0xcc62('0xb5')]['find']({'where':{'id':_0x1964c3[_0xcc62('0xb1')]['id']}})[_0xcc62('0x29')](handleEntityNotFound(_0x44af25,null))[_0xcc62('0x29')](saveUpdates(_0x1964c3['body'],null))[_0xcc62('0x29')](respondWithResult(_0x44af25,null))[_0xcc62('0x35')](handleError(_0x44af25,null));};exports['destroy']=function(_0x16fc71,_0x576882){return db[_0xcc62('0xb5')][_0xcc62('0x5f')]({'where':{'id':_0x16fc71[_0xcc62('0xb1')]['id']}})[_0xcc62('0x29')](handleEntityNotFound(_0x576882,null))['then'](removeEntity(_0x576882,null))[_0xcc62('0x35')](handleError(_0x576882,null));};exports[_0xcc62('0xb6')]=function(_0x3b818f,_0x3fa4af){return db[_0xcc62('0xb5')][_0xcc62('0xb6')]()['then'](respondWithResult(_0x3fa4af,null))['catch'](handleError(_0x3fa4af,null));};exports[_0xcc62('0xb7')]=function(_0x194f29,_0xb1095c,_0x5a8083){return db[_0xcc62('0xb8')][_0xcc62('0x5f')]({'where':{'id':_0x194f29[_0xcc62('0xb1')]['id']}})[_0xcc62('0x29')](handleEntityNotFound(_0xb1095c,null))[_0xcc62('0x29')](function(_0x4a6085){if(_0x4a6085){return _0x4a6085[_0xcc62('0xb7')](_0x194f29[_0xcc62('0x71')][_0xcc62('0xb9')],_[_0xcc62('0xba')](_0x194f29[_0xcc62('0x71')],['ids','id'])||{});}})['then'](respondWithResult(_0xb1095c,null))[_0xcc62('0x35')](handleError(_0xb1095c,null));};exports[_0xcc62('0xbb')]=function(_0x36cdce,_0x25f04e,_0x2043bf){var _0x4fee0d={'raw':![],'where':{}};var _0x277af7={};var _0x260c6e={'count':0x0,'rows':[]};return db[_0xcc62('0xb5')]['findOne']({'where':{'id':_0x36cdce[_0xcc62('0xb1')]['id']}})[_0xcc62('0x29')](handleEntityNotFound(_0x25f04e,null))['then'](function(_0x2a08f4){if(_0x2a08f4){_0x277af7['model']=_['keys'](db['FaxMessage'][_0xcc62('0x3e')]);_0x277af7[_0xcc62('0x40')]=_['keys'](_0x36cdce[_0xcc62('0x40')]);_0x277af7[_0xcc62('0x42')]=_[_0xcc62('0x43')](_0x277af7[_0xcc62('0x3f')],_0x277af7['query']);_0x4fee0d[_0xcc62('0x45')]=_['intersection'](_0x277af7['model'],qs[_0xcc62('0x44')](_0x36cdce[_0xcc62('0x40')]['fields']));_0x4fee0d['attributes']=_0x4fee0d['attributes']['length']?_0x4fee0d[_0xcc62('0x45')]:_0x277af7[_0xcc62('0x3f')];if(!_0x36cdce[_0xcc62('0x40')][_0xcc62('0x47')](_0xcc62('0xbc'))){_0x4fee0d[_0xcc62('0x21')]=qs[_0xcc62('0x21')](_0x36cdce[_0xcc62('0x40')]['limit']);_0x4fee0d[_0xcc62('0x1f')]=qs['offset'](_0x36cdce[_0xcc62('0x40')][_0xcc62('0x1f')]);}_0x4fee0d['order']=qs[_0xcc62('0x48')](_0x36cdce['query'][_0xcc62('0x48')]);_0x4fee0d[_0xcc62('0x49')]=qs[_0xcc62('0x42')](_[_0xcc62('0x4a')](_0x36cdce[_0xcc62('0x40')],_0x277af7[_0xcc62('0x42')]));_0x4fee0d[_0xcc62('0x49')][_0xcc62('0xbd')]=_0x2a08f4['id'];if(_0x36cdce['query'][_0xcc62('0x82')]){_0x4fee0d[_0xcc62('0x49')]=_[_0xcc62('0xbe')](_0x4fee0d['where'],{'$or':_[_0xcc62('0x2e')](_0x4fee0d['attributes'],function(_0x39601f){var _0x526877={};_0x526877[_0x39601f]={'$like':'%'+_0x36cdce[_0xcc62('0x40')][_0xcc62('0x82')]+'%'};return _0x526877;})});}if(_0x36cdce[_0xcc62('0x40')]['$gte']){var _0x2ea85f=_0x36cdce[_0xcc62('0x40')][_0xcc62('0xbf')][_0xcc62('0x31')](',');var _0x583d30={};_0x583d30[_0x2ea85f[0x0]]={'$gte':moment(_0x2ea85f[0x1])[_0xcc62('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4fee0d[_0xcc62('0x49')]=_[_0xcc62('0xbe')](_0x4fee0d[_0xcc62('0x49')],_0x583d30);}_0x4fee0d=_[_0xcc62('0xbe')]({},_0x4fee0d,_0x36cdce[_0xcc62('0xc1')]);return db[_0xcc62('0xb8')]['count']({'where':_0x4fee0d[_0xcc62('0x49')]})[_0xcc62('0x29')](function(_0x27f594){_0x260c6e[_0xcc62('0x22')]=_0x27f594;if(_0x36cdce['query'][_0xcc62('0xb2')]){_0x4fee0d['include']=[{'all':!![]}];}return db[_0xcc62('0xb8')]['findAll'](_0x4fee0d);})[_0xcc62('0x29')](function(_0x1cd21b){_0x260c6e[_0xcc62('0xaf')]=_0x1cd21b;return _0x260c6e;});}})['then'](respondWithFilteredResult(_0x25f04e,_0x4fee0d))[_0xcc62('0x35')](handleError(_0x25f04e,null));};exports[_0xcc62('0xc2')]=function(_0x441050,_0x49da04,_0x2ca2e9){return db[_0xcc62('0xb5')][_0xcc62('0x5f')]({'where':{'id':_0x441050[_0xcc62('0xb1')]['id']}})['then'](handleEntityNotFound(_0x49da04,null))[_0xcc62('0x29')](function(_0x3fd82c){if(_0x3fd82c){return _0x3fd82c[_0xcc62('0xc3')](_0x441050['body']['ids'],_['omit'](_0x441050['body'],[_0xcc62('0xb9'),'id'])||{})[_0xcc62('0xc4')](function(){return db['Tag']['findAll']({'attributes':['id',_0xcc62('0x2b'),_0xcc62('0x4c')],'where':{'id':_0x441050[_0xcc62('0x71')][_0xcc62('0xb9')]}});})[_0xcc62('0x29')](function(_0x2bf540){socket[_0xcc62('0xc5')]('faxInteractionTags:save',{'id':Number(_0x441050[_0xcc62('0xb1')]['id']),'tags':_0x2bf540||[]});return{'id':Number(_0x441050[_0xcc62('0xb1')]['id']),'tags':_0x2bf540||[]};});}})[_0xcc62('0x29')](respondWithResult(_0x49da04,null))['catch'](handleError(_0x49da04,null));};exports[_0xcc62('0xc6')]=function(_0x382bdb,_0x3e9d62,_0x52d613){return db['FaxInteraction']['find']({'where':{'id':_0x382bdb['params']['id']}})[_0xcc62('0x29')](handleEntityNotFound(_0x3e9d62,null))[_0xcc62('0x29')](function(_0x782270){if(_0x782270){return _0x782270[_0xcc62('0xc6')](_0x382bdb[_0xcc62('0x40')][_0xcc62('0xb9')]);}})[_0xcc62('0x29')](respondWithStatusCode(_0x3e9d62,null))['catch'](handleError(_0x3e9d62,null));};exports['download']=function(_0x4e5c87,_0x453294){var _0x323bd2=moment()[_0xcc62('0xc7')]()[_0xcc62('0x98')]();var _0x244350=path[_0xcc62('0xc8')](config[_0xcc62('0xc9')],_0xcc62('0xca'),_0xcc62('0xcb'),_0xcc62('0xcc'));var _0x559068=path['join'](config['root'],_0xcc62('0xca'),_0xcc62('0xcb'),_0xcc62('0xcd'));var _0x183e36=path[_0xcc62('0xc8')](_0x244350,_0x323bd2);var _0x15563e=util[_0xcc62('0xc0')](_0xcc62('0xce'),_0x4e5c87[_0xcc62('0xb1')]['id'],_0x323bd2);var _0x1c303a=path[_0xcc62('0xc8')](_0x244350,_0x15563e);var _0x3bbf0c=[];_0x3bbf0c[_0xcc62('0x34')]({'model':db[_0xcc62('0xcf')],'as':_0xcc62('0xcf'),'raw':!![]});var _0x26f892=[{'model':db[_0xcc62('0xb8')],'as':'Messages','attributes':['id',_0xcc62('0x71'),_0xcc62('0x78')],'include':_0x3bbf0c}];return db['FaxInteraction'][_0xcc62('0x5f')]({'where':{'id':_0x4e5c87[_0xcc62('0xb1')]['id']},'include':_0x26f892})[_0xcc62('0x29')](handleEntityNotFound(_0x453294,null))[_0xcc62('0x29')](function(_0x50e6d4){if(_0x50e6d4&&_0x50e6d4[_0xcc62('0xd0')]){var _0x413a28=_0x50e6d4[_0xcc62('0xd1')]({'plain':!![]});fs[_0xcc62('0xd2')](_0x183e36);for(var _0x2de292=0x0;_0x2de292<_0x413a28['Messages'][_0xcc62('0x46')];_0x2de292++){var _0x1af7d3=_0x413a28[_0xcc62('0xd0')][_0x2de292][_0xcc62('0xcf')];if(_0x1af7d3){var _0x2fd7fb=path[_0xcc62('0xc8')](_0x559068,_0x1af7d3[_0xcc62('0xd3')]);if(fs['existsSync'](_0x2fd7fb)){fs[_0xcc62('0xd4')](_0x2fd7fb)[_0xcc62('0xd5')](fs[_0xcc62('0xd6')](path[_0xcc62('0xc8')](_0x183e36,_0x1af7d3[_0xcc62('0xd3')])));}}}return BPromise['resolve']()[_0xcc62('0x29')](function(){return new BPromise(function(_0x3f3b0f,_0x2a5377){zipdir(_0x183e36,{'saveTo':_0x1c303a},function(_0x1b6870,_0x1ff8b3){if(_0x1b6870)return _0x2a5377(_0x1b6870);return _0x3f3b0f(_0x1ff8b3);});})[_0xcc62('0x29')](function(){return new BPromise(function(_0x3a4952,_0x1ce984){rimraf(_0x183e36,function(_0x2e5135){if(_0x2e5135)_0x1ce984(_0x2e5135);return _0x3a4952();});});})[_0xcc62('0x29')](function(){return _0x453294[_0xcc62('0xd7')](_0x1c303a,_0x15563e,function(_0x306fdb){if(_0x306fdb){console[_0xcc62('0xd8')](_0xcc62('0xd9'),_0x306fdb);}else{fs[_0xcc62('0xda')](_0x1c303a);}});});});}else{return _0x453294[_0xcc62('0x1d')](0xc8);}})['catch'](handleError(_0x453294,null));}; \ No newline at end of file +var _0xefde=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','end','error','name','Users','map','fullname','TagIds','forEach','push','catch','waiting','talking','answered','total','UserId','closed','unmanaged','index','FaxInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','field','color','from','select','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','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?','ContactId','buildExpression','type','text','Tag','split','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','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','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3d0016,_0x4a37e0){var _0x1dcb28=function(_0x57bef9){while(--_0x57bef9){_0x3d0016['push'](_0x3d0016['shift']());}};_0x1dcb28(++_0x4a37e0);}(_0xefde,0xbf));var _0xeefd=function(_0x419501,_0x3c9959){_0x419501=_0x419501-0x0;var _0x5f10bb=_0xefde[_0x419501];return _0x5f10bb;};'use strict';var emlformat=require(_0xeefd('0x0'));var rimraf=require(_0xeefd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeefd('0x2'));var rp=require(_0xeefd('0x3'));var moment=require(_0xeefd('0x4'));var BPromise=require(_0xeefd('0x5'));var Mustache=require('mustache');var util=require(_0xeefd('0x6'));var path=require('path');var sox=require(_0xeefd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeefd('0x8'));var _=require(_0xeefd('0x9'));var squel=require(_0xeefd('0xa'));var crypto=require(_0xeefd('0xb'));var jsforce=require(_0xeefd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeefd('0xd'));var Redis=require('ioredis');var authService=require(_0xeefd('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeefd('0xf'));var logger=require(_0xeefd('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xeefd('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xeefd('0x12')],{'host':_0xeefd('0x13'),'port':0x18eb});var socket=require(_0xeefd('0x14'))(new Redis(config[_0xeefd('0x12')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4cb3c6,_0x50425e){_0x50425e=_0x50425e||0xcc;return function(_0x5a2558){if(_0x5a2558){return _0x4cb3c6[_0xeefd('0x15')](_0x50425e);}return _0x4cb3c6['status'](_0x50425e)['end']();};}function respondWithResult(_0x4dc0cc,_0x56d887){_0x56d887=_0x56d887||0xc8;return function(_0x5b1ca5){if(_0x5b1ca5){return _0x4dc0cc[_0xeefd('0x16')](_0x56d887)[_0xeefd('0x17')](_0x5b1ca5);}};}function respondWithFilteredResult(_0x3ffcc7,_0x5722f2){return function(_0x4c83b9){if(_0x4c83b9){var _0x13080b=typeof _0x5722f2[_0xeefd('0x18')]===_0xeefd('0x19')&&typeof _0x5722f2[_0xeefd('0x1a')]===_0xeefd('0x19');var _0x506e54=_0x4c83b9[_0xeefd('0x1b')];var _0x2c155e=_0x13080b?0x0:_0x5722f2[_0xeefd('0x18')];var _0x1edaea=_0x13080b?_0x4c83b9[_0xeefd('0x1b')]:_0x5722f2['offset']+_0x5722f2[_0xeefd('0x1a')];var _0x5466eb;if(_0x1edaea>=_0x506e54){_0x1edaea=_0x506e54;_0x5466eb=0xc8;}else{_0x5466eb=0xce;}_0x3ffcc7[_0xeefd('0x16')](_0x5466eb);return _0x3ffcc7[_0xeefd('0x1c')]('Content-Range',_0x2c155e+'-'+_0x1edaea+'/'+_0x506e54)[_0xeefd('0x17')](_0x4c83b9);}return null;};}function patchUpdates(_0x289610){return function(_0x577c4a){try{jsonpatch[_0xeefd('0x1d')](_0x577c4a,_0x289610,!![]);}catch(_0x4905aa){return BPromise[_0xeefd('0x1e')](_0x4905aa);}return _0x577c4a['save']();};}function saveUpdates(_0x450bb9,_0x2e9a7b){return function(_0x5d8e1b){if(_0x5d8e1b){return _0x5d8e1b['update'](_0x450bb9)[_0xeefd('0x1f')](function(_0x4f97d4){return _0x4f97d4;});}return null;};}function removeEntity(_0x3dd899,_0x2e3ab5){return function(_0x54cd9b){if(_0x54cd9b){return _0x54cd9b[_0xeefd('0x20')]()['then'](function(){_0x3dd899['status'](0xcc)[_0xeefd('0x21')]();});}};}function handleEntityNotFound(_0x4df643,_0x2aacc1){return function(_0xf961b1){if(!_0xf961b1){_0x4df643[_0xeefd('0x15')](0x194);}return _0xf961b1;};}function handleError(_0x267f03,_0x41c32e){_0x41c32e=_0x41c32e||0x1f4;return function(_0x51a943){logger[_0xeefd('0x22')](_0x51a943['stack']);if(_0x51a943[_0xeefd('0x23')]){delete _0x51a943[_0xeefd('0x23')];}_0x267f03[_0xeefd('0x16')](_0x41c32e)['send'](_0x51a943);};}function getInteractionUsers(_0x4e6996,_0x37e952){return new BPromise(function(_0x251e23,_0x1bd39f){try{if(_0x37e952[_0x4e6996['id']]){_0x4e6996[_0xeefd('0x24')]=_[_0xeefd('0x25')](_0x37e952[_0x4e6996['id']],function(_0x482d39){return{'id':_0x482d39['id'],'fullname':_0x482d39[_0xeefd('0x26')]};});}}catch(_0x2cd2a8){_0x1bd39f(_0x2cd2a8);}_0x251e23(_0x4e6996);});}function getInteractionTags(_0x55c168,_0x389154){return new BPromise(function(_0x123fd9,_0x19ee8d){try{if(_0x55c168[_0xeefd('0x27')]){_0x55c168['Tags']=[];_0x55c168[_0xeefd('0x27')]['split'](',')[_0xeefd('0x28')](function(_0x474ac5){_0x55c168['Tags'][_0xeefd('0x29')](_0x389154[_0x474ac5]);});}delete _0x55c168[_0xeefd('0x27')];}catch(_0x422268){_0x19ee8d(_0x422268);}_0x123fd9(_0x55c168);});}function updateFaxInteraction(_0x3c13f8,_0x50fb45,_0x2009f2){return new BPromise(function(_0x956240,_0xc5670b){return getInteractionUsers(_0x3c13f8,_0x2009f2)[_0xeefd('0x1f')](function(_0x65e81e){return getInteractionTags(_0x65e81e,_0x50fb45);})['then'](function(_0xb9d613){return getStateInteraction(_0xb9d613);})[_0xeefd('0x1f')](function(_0x2099ff){_0x956240(_0x2099ff);})[_0xeefd('0x2a')](function(_0x46e5f6){_0xc5670b(_0x46e5f6);});});}function getStateInteraction(_0x1dce21){return new BPromise(function(_0x5d3c29){_0x1dce21[_0xeefd('0x2b')]=0x0;_0x1dce21[_0xeefd('0x2c')]=0x0;_0x1dce21[_0xeefd('0x2d')]=0x0;_0x1dce21['unmanaged']=0x0;_0x1dce21[_0xeefd('0x2e')]=0x0;if(!_0x1dce21['closed']&&!_0x1dce21[_0xeefd('0x2f')]){_0x1dce21[_0xeefd('0x2b')]+=0x1;}if(!_0x1dce21['closed']&&_0x1dce21['UserId']){_0x1dce21['talking']+=0x1;if(_0x1dce21['waiting']){_0x1dce21[_0xeefd('0x2b')]-=0x1;}}if(_0x1dce21[_0xeefd('0x30')]&&_0x1dce21[_0xeefd('0x2f')]){_0x1dce21[_0xeefd('0x2d')]+=0x1;if(_0x1dce21['talking']){_0x1dce21['talking']-=0x1;}}if(_0x1dce21['closed']&&!_0x1dce21[_0xeefd('0x2f')]){_0x1dce21[_0xeefd('0x31')]+=0x1;if(_0x1dce21[_0xeefd('0x2b')]){_0x1dce21['waiting']-=0x1;}}_0x1dce21['total']+=0x1;_0x5d3c29(_0x1dce21);});}exports[_0xeefd('0x32')]=function(_0x189074,_0x3e340c){var _0x555f73={},_0x1c0113={},_0x5e8de1={'count':0x0,'rows':[]};var _0x2f0fb8=_[_0xeefd('0x25')](db[_0xeefd('0x33')][_0xeefd('0x34')],function(_0xe51dee){return{'name':_0xe51dee[_0xeefd('0x35')],'type':_0xe51dee['type'][_0xeefd('0x36')]};});_0x1c0113[_0xeefd('0x37')]=_[_0xeefd('0x25')](_0x2f0fb8,'name');_0x1c0113['query']=_[_0xeefd('0x38')](_0x189074[_0xeefd('0x39')]);_0x1c0113[_0xeefd('0x3a')]=_[_0xeefd('0x3b')](_0x1c0113[_0xeefd('0x37')],_0x1c0113[_0xeefd('0x39')]);_0x555f73[_0xeefd('0x3c')]=_[_0xeefd('0x3b')](_0x1c0113[_0xeefd('0x37')],qs[_0xeefd('0x3d')](_0x189074[_0xeefd('0x39')][_0xeefd('0x3d')]));_0x555f73[_0xeefd('0x3c')]=_0x555f73[_0xeefd('0x3c')]['length']?_0x555f73[_0xeefd('0x3c')]:_0x1c0113[_0xeefd('0x37')];if(!_0x189074[_0xeefd('0x39')][_0xeefd('0x3e')](_0xeefd('0x3f'))){_0x555f73[_0xeefd('0x1a')]=qs[_0xeefd('0x1a')](_0x189074[_0xeefd('0x39')]['limit']);_0x555f73[_0xeefd('0x18')]=qs[_0xeefd('0x18')](_0x189074[_0xeefd('0x39')][_0xeefd('0x18')]);}_0x555f73['order']=qs['sort'](_0x189074[_0xeefd('0x39')][_0xeefd('0x40')]);_0x555f73['where']=qs[_0xeefd('0x3a')](_[_0xeefd('0x41')](_0x189074[_0xeefd('0x39')],_0x1c0113[_0xeefd('0x3a')]),_0x2f0fb8);var _0x337b22=[];var _0x29a65f=squel['select']()['field']('id')[_0xeefd('0x42')](_0xeefd('0x23'))[_0xeefd('0x42')](_0xeefd('0x43'))[_0xeefd('0x44')]('tools_tags');var _0x52a9c8=squel[_0xeefd('0x45')]()[_0xeefd('0x42')](_0xeefd('0x46'))[_0xeefd('0x42')]('u.fullname')[_0xeefd('0x42')](_0xeefd('0x47'))[_0xeefd('0x44')](_0xeefd('0x48'),'ui')[_0xeefd('0x49')](_0xeefd('0x4a'),'u',_0xeefd('0x4b'));var _0x15fb69=squel[_0xeefd('0x45')]()[_0xeefd('0x44')](_0xeefd('0x4c'),'i')[_0xeefd('0x49')](_0xeefd('0x4d'),'c',_0xeefd('0x4e'))['left_join'](_0xeefd('0x4a'),'o',_0xeefd('0x4f'))[_0xeefd('0x49')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0xeefd('0x49')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0xeefd('0x49')](_0xeefd('0x50'),'it',_0xeefd('0x51'))[_0xeefd('0x49')](_0xeefd('0x52'),'t','t.id\x20=\x20it.TagId');var _0x40c56d=squel['expr']();var _0x40a885=[];var _0x2f660d=squel['expr']();var _0x1b28f0;if(_0x189074[_0xeefd('0x39')]['search']){_0x1b28f0=as['parseSearch'](_0x189074[_0xeefd('0x39')]['search']);var _0x23c8e6=_0x1b28f0[_0xeefd('0x53')];for(var _0x494067=0x0;_0x494067<_0x1b28f0[_0xeefd('0x54')]['length'];_0x494067++){var _0x5c51ec=_0x1b28f0[_0xeefd('0x54')][_0x494067];var _0x32e2a4='i';var _0x2d2f24=_[_0xeefd('0x55')](_0x2f0fb8,[_0xeefd('0x23'),_0x5c51ec['field']]);if(!_0x2d2f24){switch(_0x5c51ec[_0xeefd('0x42')]){case _0xeefd('0x56'):if(_0x5c51ec[_0xeefd('0x57')]==0x1){_0x15fb69[_0xeefd('0x58')]('`'+_0x5c51ec[_0xeefd('0x42')]+_0xeefd('0x59'));}else{_0x15fb69['having']('`'+_0x5c51ec[_0xeefd('0x42')]+_0xeefd('0x5a'));}break;case _0xeefd('0x5b'):if(_0x5c51ec[_0xeefd('0x5c')]==='$substring'){if(_0x5c51ec[_0xeefd('0x57')]['split']('\x20')[_0xeefd('0x5d')]>0x1){_0x40c56d[_0x23c8e6](_0xeefd('0x5e'),qs['getFullTextValue'](_0x5c51ec[_0xeefd('0x57')]),null);}else{var _0x476e3b='%'+_0x5c51ec[_0xeefd('0x57')]+'%';_0x40c56d[_0x23c8e6](_0xeefd('0x5f'),_0x476e3b,_0x476e3b,_0x476e3b);}}else{_0x2d2f24=_[_0xeefd('0x55')](_0x2f0fb8,[_0xeefd('0x23'),'ContactId']);_0x5c51ec[_0xeefd('0x42')]=_0xeefd('0x60');_0x54eb64=as[_0xeefd('0x61')](_0x32e2a4,_0x2d2f24[_0xeefd('0x62')],_0x5c51ec);_0x40c56d[_0x23c8e6](_0x54eb64[_0xeefd('0x63')],_0x54eb64[_0xeefd('0x57')]['start'],_0x54eb64[_0xeefd('0x57')][_0xeefd('0x21')]);}break;case _0xeefd('0x64'):var _0x335237=_0x5c51ec[_0xeefd('0x57')][_0xeefd('0x65')](',')[_0xeefd('0x25')](function(_0x2b211e){return Number(_0x2b211e);});_0x335237[_0xeefd('0x28')](function(_0x5bbd79){_0x2f660d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5bbd79+',%');});_0x40a885=_['union'](_0x40a885,_0x335237);break;case'User':if(_0x5c51ec['operator']===_0xeefd('0x66')){_0x40c56d[_0x23c8e6](_0xeefd('0x67'),'%'+_0x5c51ec[_0xeefd('0x57')]+'%',null);}else{_0x2d2f24=_[_0xeefd('0x55')](_0x2f0fb8,[_0xeefd('0x23'),'UserId']);_0x5c51ec[_0xeefd('0x42')]=_0xeefd('0x2f');_0x54eb64=as['buildExpression'](_0x32e2a4,_0x2d2f24[_0xeefd('0x62')],_0x5c51ec);_0x40c56d[_0x23c8e6](_0x54eb64[_0xeefd('0x63')],_0x54eb64[_0xeefd('0x57')][_0xeefd('0x68')],_0x54eb64['value'][_0xeefd('0x21')]);}break;case _0xeefd('0x69'):_0x54eb64=as['buildExpression']('me',null,_0x5c51ec);_0x40c56d[_0x23c8e6](_0x54eb64[_0xeefd('0x63')],_0x54eb64[_0xeefd('0x57')][_0xeefd('0x68')],_0x54eb64['value'][_0xeefd('0x21')]);break;}}else{var _0x54eb64=as[_0xeefd('0x61')](_0x32e2a4,_0x2d2f24[_0xeefd('0x62')],_0x5c51ec);_0x40c56d[_0x23c8e6](_0x54eb64['text'],_0x54eb64['value'][_0xeefd('0x68')],_0x54eb64[_0xeefd('0x57')][_0xeefd('0x21')]);}}}else{var _0x2ba966=_(_0x189074[_0xeefd('0x39')])[_0xeefd('0x38')]()[_0xeefd('0x25')](function(_0x56ba6a){return _[_0xeefd('0x6a')](_0x2f0fb8,[_0xeefd('0x23'),_0x56ba6a])?_0x56ba6a:undefined;})['compact']()[_0xeefd('0x57')]();if(!_[_0xeefd('0x6b')](_0x2ba966)){_0x2ba966[_0xeefd('0x28')](function(_0x39a77d){if(_0x39a77d===_0xeefd('0x6c')){_0x15fb69['where'](_0xeefd('0x6d'),[]['concat'](_0x189074[_0xeefd('0x39')][_0x39a77d]));}else if(_0x39a77d===_0xeefd('0x6e')){var _0x30a8f9=JSON[_0xeefd('0x6f')](_0x189074['query'][_0x39a77d])[_0xeefd('0x70')];var _0x4cdd74=JSON[_0xeefd('0x6f')](_0x189074[_0xeefd('0x39')][_0x39a77d])[_0xeefd('0x71')];_0x15fb69[_0xeefd('0x72')](_0xeefd('0x73'),_0x30a8f9,_0x4cdd74);}else{if(_0x189074[_0xeefd('0x39')][_0x39a77d]===_0xeefd('0x74')){_0x15fb69[_0xeefd('0x72')]('i.'+_0x39a77d+_0xeefd('0x75'));}else{_0x15fb69['where']('i.'+_0x39a77d+_0xeefd('0x76'),_0x189074[_0xeefd('0x39')][_0x39a77d]);}}});}if(_0x189074[_0xeefd('0x39')][_0xeefd('0x77')]){if(_0x189074[_0xeefd('0x39')][_0xeefd('0x77')]==0x1){_0x15fb69[_0xeefd('0x58')]('`unreadMessages`\x20=\x200');}else{_0x15fb69[_0xeefd('0x58')](_0xeefd('0x78'));}}if(_0x189074[_0xeefd('0x39')][_0xeefd('0x79')]){_0x40a885=_[_0xeefd('0x7a')](_0x189074[_0xeefd('0x39')][_0xeefd('0x79')])?_0x189074[_0xeefd('0x39')][_0xeefd('0x79')]:new Array(_0x189074[_0xeefd('0x39')][_0xeefd('0x79')]);_0x40a885[_0xeefd('0x28')](function(_0x2dcc49){_0x2f660d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2dcc49+',%');});}if(_0x189074[_0xeefd('0x39')][_0xeefd('0x7b')]){var _0x418f0a=_0x189074[_0xeefd('0x39')]['filter']['replace']('\x5c','\x5c\x5c')[_0xeefd('0x7c')](/'/g,'\x27\x27');if(qs[_0xeefd('0x7d')](_0x418f0a)){_0x40c56d['or']('i.id\x20LIKE\x20?',_0x418f0a+'%')['or']('i.fax\x20LIKE\x20?',_0x418f0a+'%');}_0x40c56d['or'](_0xeefd('0x7e'),_0x418f0a+'%');}}_0x15fb69[_0xeefd('0x72')](_0x40c56d);_0x15fb69[_0xeefd('0x7f')](_0xeefd('0x80'));var _0x1b7b26={'type':db[_0xeefd('0x81')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4e76d3=_0x15fb69[_0xeefd('0x82')]();_0x4e76d3[_0xeefd('0x42')](_0xeefd('0x80'));_0x4e76d3[_0xeefd('0x42')](_0xeefd('0x83'),'unreadMessages');if(_0x555f73[_0xeefd('0x84')]){_0x555f73[_0xeefd('0x84')][_0xeefd('0x28')](function(_0x4ff3de){var _0x3db5e0=_0x4ff3de[0x0]==='contactName'?_0x4ff3de[0x0]:'i.'+_0x4ff3de[0x0];_0x15fb69[_0xeefd('0x84')](_0x3db5e0,_0x4ff3de[0x1]===_0xeefd('0x85')?![]:!![]);});}if(!_[_0xeefd('0x6b')](_0x40a885)){_0x15fb69[_0xeefd('0x58')](_0x2f660d);_0x4e76d3[_0xeefd('0x72')]('t.id\x20IN\x20?',_0x40a885);}BPromise[_0xeefd('0x86')]()[_0xeefd('0x1f')](function(){if(!_0x1b28f0){if(_0x189074[_0xeefd('0x39')][_0xeefd('0x6c')])return;_0x4e76d3[_0xeefd('0x72')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x15fb69[_0xeefd('0x72')](_0xeefd('0x87'));return;}if(_0x189074[_0xeefd('0x88')][_0xeefd('0x89')]!=='agent')return;return _0x189074[_0xeefd('0x88')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xeefd('0x1f')](function(_0xf8063f){if(_['isEmpty'](_0xf8063f)){_0x4e76d3[_0xeefd('0x72')](_0xeefd('0x8a'));_0x15fb69[_0xeefd('0x72')](_0xeefd('0x8a'));}else{_0x4e76d3[_0xeefd('0x72')](_0xeefd('0x6d'),_[_0xeefd('0x25')](_0xf8063f,'id'));_0x15fb69[_0xeefd('0x72')](_0xeefd('0x6d'),_[_0xeefd('0x25')](_0xf8063f,'id'));}});})[_0xeefd('0x1f')](function(){if(_0x189074['user'][_0xeefd('0x89')]===_0xeefd('0x8b')&&!_0x1b28f0&&!_0x189074[_0xeefd('0x39')][_0xeefd('0x6c')])return[];return db['sequelize']['query'](_0x4e76d3['toString'](),_0x1b7b26);})[_0xeefd('0x1f')](function(_0x378dc4){_0x5e8de1[_0xeefd('0x1b')]=_0x378dc4[_0xeefd('0x5d')];if(_0x5e8de1[_0xeefd('0x1b')]===0x0)return[];return db[_0xeefd('0x8c')][_0xeefd('0x39')](_0x29a65f[_0xeefd('0x8d')](),_0x1b7b26)[_0xeefd('0x1f')](function(_0x1bae81){_0x337b22=_['keyBy'](_0x1bae81,'id');_0x1b7b26=_[_0xeefd('0x8e')](_0x1b7b26,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x189074['query'][_0xeefd('0x3d')]){_0x555f73['attributes']['forEach'](function(_0x4e732e){_0x15fb69[_0xeefd('0x42')]('i.'+_0x4e732e);});}else{_0x15fb69['field'](_0xeefd('0x83'),_0xeefd('0x56'));_0x15fb69[_0xeefd('0x42')]('a.key','Account.key');_0x15fb69[_0xeefd('0x42')](_0xeefd('0x8f'),_0xeefd('0x90'));_0x15fb69['field'](_0xeefd('0x91'),_0xeefd('0x92'));_0x15fb69[_0xeefd('0x42')](_0xeefd('0x93'));_0x15fb69[_0xeefd('0x42')](_0xeefd('0x94'),'Contact.firstName');_0x15fb69[_0xeefd('0x42')](_0xeefd('0x95'),_0xeefd('0x96'));_0x15fb69[_0xeefd('0x42')](_0xeefd('0x97'),_0xeefd('0x98'));_0x15fb69['field'](_0xeefd('0x99'),_0xeefd('0x9a'));_0x15fb69['field']('c.mobile',_0xeefd('0x9b'));_0x15fb69[_0xeefd('0x42')](_0xeefd('0x9c'),_0xeefd('0x9d'));_0x15fb69[_0xeefd('0x42')](_0xeefd('0x9e'),'Owner.fullname');_0x15fb69[_0xeefd('0x42')]('o.internal','Owner.internal');_0x15fb69[_0xeefd('0x42')](_0xeefd('0x9f'),_0xeefd('0x27'));}if(_0x555f73[_0xeefd('0x1a')])_0x15fb69[_0xeefd('0x1a')](_0x555f73['limit']);if(_0x555f73[_0xeefd('0x18')])_0x15fb69['offset'](_0x555f73[_0xeefd('0x18')]);return db[_0xeefd('0x8c')][_0xeefd('0x39')](_0x15fb69[_0xeefd('0x8d')](),_0x1b7b26);})['then'](function(_0x20ac40){if(_0x20ac40['length']>0x0)_0x52a9c8[_0xeefd('0x72')](_0xeefd('0xa0'),_[_0xeefd('0x25')](_0x20ac40,'id'));return db['sequelize'][_0xeefd('0x39')](_0x52a9c8[_0xeefd('0x8d')](),_0x1b7b26)[_0xeefd('0x1f')](function(_0xbb714b){var _0x3e4c1f=_[_0xeefd('0xa1')](_0xbb714b,_0xeefd('0xa2'));var _0x5b08a3=[];_0x20ac40[_0xeefd('0x28')](function(_0xd796e5){_0x5b08a3[_0xeefd('0x29')](updateFaxInteraction(_0xd796e5,_0x337b22,_0x3e4c1f));});return BPromise[_0xeefd('0xa3')](_0x5b08a3);});});})['then'](function(_0x15e9f1){_0x5e8de1[_0xeefd('0xa4')]=_0x15e9f1;return _0x5e8de1;})[_0xeefd('0x1f')](respondWithFilteredResult(_0x3e340c,_0x555f73))[_0xeefd('0x2a')](handleError(_0x3e340c,null));};exports[_0xeefd('0xa5')]=function(_0x7223eb,_0x41f50e){var _0x199296={'raw':![],'where':{'id':_0x7223eb[_0xeefd('0xa6')]['id']}},_0x1e2f5c={};_0x1e2f5c[_0xeefd('0x37')]=_[_0xeefd('0x38')](db['FaxInteraction']['rawAttributes']);_0x1e2f5c['query']=_[_0xeefd('0x38')](_0x7223eb[_0xeefd('0x39')]);_0x1e2f5c[_0xeefd('0x3a')]=_[_0xeefd('0x3b')](_0x1e2f5c[_0xeefd('0x37')],_0x1e2f5c[_0xeefd('0x39')]);_0x199296[_0xeefd('0x3c')]=_[_0xeefd('0x3b')](_0x1e2f5c[_0xeefd('0x37')],qs['fields'](_0x7223eb[_0xeefd('0x39')]['fields']));_0x199296['attributes']=_0x199296[_0xeefd('0x3c')][_0xeefd('0x5d')]?_0x199296[_0xeefd('0x3c')]:_0x1e2f5c[_0xeefd('0x37')];if(_0x7223eb[_0xeefd('0x39')][_0xeefd('0xa7')]){_0x199296[_0xeefd('0xa8')]=[{'all':!![]}];}_0x199296=_[_0xeefd('0x8e')]({},_0x199296,_0x7223eb[_0xeefd('0xa9')]);return db['FaxInteraction'][_0xeefd('0x55')](_0x199296)['then'](handleEntityNotFound(_0x41f50e,null))[_0xeefd('0x1f')](respondWithResult(_0x41f50e,null))[_0xeefd('0x2a')](handleError(_0x41f50e,null));};exports[_0xeefd('0xaa')]=function(_0x55cd37,_0x259fe1){return db[_0xeefd('0x33')][_0xeefd('0xaa')](_0x55cd37[_0xeefd('0x69')],{})[_0xeefd('0x1f')](respondWithResult(_0x259fe1,0xc9))[_0xeefd('0x2a')](handleError(_0x259fe1,null));};exports['update']=function(_0x386f7f,_0x19782f){if(_0x386f7f[_0xeefd('0x69')]['id']){delete _0x386f7f[_0xeefd('0x69')]['id'];}return db[_0xeefd('0x33')][_0xeefd('0x55')]({'where':{'id':_0x386f7f[_0xeefd('0xa6')]['id']}})[_0xeefd('0x1f')](handleEntityNotFound(_0x19782f,null))[_0xeefd('0x1f')](saveUpdates(_0x386f7f[_0xeefd('0x69')],null))[_0xeefd('0x1f')](respondWithResult(_0x19782f,null))['catch'](handleError(_0x19782f,null));};exports[_0xeefd('0x20')]=function(_0x4b73a9,_0x1d5726){return db['FaxInteraction'][_0xeefd('0x55')]({'where':{'id':_0x4b73a9['params']['id']}})[_0xeefd('0x1f')](handleEntityNotFound(_0x1d5726,null))[_0xeefd('0x1f')](removeEntity(_0x1d5726,null))[_0xeefd('0x2a')](handleError(_0x1d5726,null));};exports[_0xeefd('0xab')]=function(_0x4cff27,_0x47f3f9){return db[_0xeefd('0x33')][_0xeefd('0xab')]()[_0xeefd('0x1f')](respondWithResult(_0x47f3f9,null))['catch'](handleError(_0x47f3f9,null));};exports[_0xeefd('0xac')]=function(_0x279edf,_0x2d5a5f,_0x53851b){return db[_0xeefd('0xad')][_0xeefd('0x55')]({'where':{'id':_0x279edf[_0xeefd('0xa6')]['id']}})[_0xeefd('0x1f')](handleEntityNotFound(_0x2d5a5f,null))[_0xeefd('0x1f')](function(_0x5c30ce){if(_0x5c30ce){return _0x5c30ce[_0xeefd('0xac')](_0x279edf[_0xeefd('0x69')][_0xeefd('0xae')],_[_0xeefd('0xaf')](_0x279edf[_0xeefd('0x69')],[_0xeefd('0xae'),'id'])||{});}})['then'](respondWithResult(_0x2d5a5f,null))[_0xeefd('0x2a')](handleError(_0x2d5a5f,null));};exports[_0xeefd('0xb0')]=function(_0x195f1a,_0x21fd99,_0x23c14c){var _0x2ebfe7={'raw':![],'where':{}};var _0x360d74={};var _0x176468={'count':0x0,'rows':[]};return db[_0xeefd('0x33')][_0xeefd('0xb1')]({'where':{'id':_0x195f1a[_0xeefd('0xa6')]['id']}})['then'](handleEntityNotFound(_0x21fd99,null))[_0xeefd('0x1f')](function(_0x2447ae){if(_0x2447ae){_0x360d74['model']=_[_0xeefd('0x38')](db['FaxMessage']['rawAttributes']);_0x360d74[_0xeefd('0x39')]=_[_0xeefd('0x38')](_0x195f1a[_0xeefd('0x39')]);_0x360d74[_0xeefd('0x3a')]=_['intersection'](_0x360d74[_0xeefd('0x37')],_0x360d74[_0xeefd('0x39')]);_0x2ebfe7['attributes']=_[_0xeefd('0x3b')](_0x360d74['model'],qs[_0xeefd('0x3d')](_0x195f1a['query'][_0xeefd('0x3d')]));_0x2ebfe7[_0xeefd('0x3c')]=_0x2ebfe7[_0xeefd('0x3c')][_0xeefd('0x5d')]?_0x2ebfe7[_0xeefd('0x3c')]:_0x360d74['model'];if(!_0x195f1a[_0xeefd('0x39')][_0xeefd('0x3e')](_0xeefd('0x3f'))){_0x2ebfe7['limit']=qs[_0xeefd('0x1a')](_0x195f1a['query'][_0xeefd('0x1a')]);_0x2ebfe7[_0xeefd('0x18')]=qs['offset'](_0x195f1a[_0xeefd('0x39')][_0xeefd('0x18')]);}_0x2ebfe7[_0xeefd('0x84')]=qs[_0xeefd('0x40')](_0x195f1a['query']['sort']);_0x2ebfe7[_0xeefd('0x72')]=qs['filters'](_[_0xeefd('0x41')](_0x195f1a[_0xeefd('0x39')],_0x360d74['filters']));_0x2ebfe7['where']['FaxInteractionId']=_0x2447ae['id'];if(_0x195f1a[_0xeefd('0x39')][_0xeefd('0x7b')]){_0x2ebfe7['where']=_[_0xeefd('0x8e')](_0x2ebfe7['where'],{'$or':_[_0xeefd('0x25')](_0x2ebfe7[_0xeefd('0x3c')],function(_0x27045d){var _0x382d1b={};_0x382d1b[_0x27045d]={'$like':'%'+_0x195f1a['query'][_0xeefd('0x7b')]+'%'};return _0x382d1b;})});}if(_0x195f1a[_0xeefd('0x39')][_0xeefd('0x70')]){var _0x18646c=_0x195f1a[_0xeefd('0x39')][_0xeefd('0x70')][_0xeefd('0x65')](',');var _0x4a1847={};_0x4a1847[_0x18646c[0x0]]={'$gte':moment(_0x18646c[0x1])[_0xeefd('0xb2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2ebfe7[_0xeefd('0x72')]=_[_0xeefd('0x8e')](_0x2ebfe7[_0xeefd('0x72')],_0x4a1847);}_0x2ebfe7=_[_0xeefd('0x8e')]({},_0x2ebfe7,_0x195f1a[_0xeefd('0xa9')]);return db['FaxMessage'][_0xeefd('0x1b')]({'where':_0x2ebfe7[_0xeefd('0x72')]})[_0xeefd('0x1f')](function(_0x2ad161){_0x176468[_0xeefd('0x1b')]=_0x2ad161;if(_0x195f1a[_0xeefd('0x39')][_0xeefd('0xa7')]){_0x2ebfe7[_0xeefd('0xa8')]=[{'all':!![]}];}return db[_0xeefd('0xad')][_0xeefd('0xb3')](_0x2ebfe7);})['then'](function(_0x2ec5dd){_0x176468[_0xeefd('0xa4')]=_0x2ec5dd;return _0x176468;});}})[_0xeefd('0x1f')](respondWithFilteredResult(_0x21fd99,_0x2ebfe7))[_0xeefd('0x2a')](handleError(_0x21fd99,null));};exports['addTags']=function(_0x21b35e,_0x534dce,_0x267636){return db[_0xeefd('0x33')][_0xeefd('0x55')]({'where':{'id':_0x21b35e[_0xeefd('0xa6')]['id']}})[_0xeefd('0x1f')](handleEntityNotFound(_0x534dce,null))[_0xeefd('0x1f')](function(_0x4fba44){if(_0x4fba44){return _0x4fba44[_0xeefd('0xb4')](_0x21b35e[_0xeefd('0x69')]['ids'],_[_0xeefd('0xaf')](_0x21b35e[_0xeefd('0x69')],['ids','id'])||{})[_0xeefd('0xb5')](function(){return db[_0xeefd('0x64')][_0xeefd('0xb3')]({'attributes':['id',_0xeefd('0x23'),_0xeefd('0x43')],'where':{'id':_0x21b35e[_0xeefd('0x69')]['ids']}});})[_0xeefd('0x1f')](function(_0x1f7b5b){socket[_0xeefd('0xb6')](_0xeefd('0xb7'),{'id':Number(_0x21b35e[_0xeefd('0xa6')]['id']),'tags':_0x1f7b5b||[]});return{'id':Number(_0x21b35e[_0xeefd('0xa6')]['id']),'tags':_0x1f7b5b||[]};});}})[_0xeefd('0x1f')](respondWithResult(_0x534dce,null))[_0xeefd('0x2a')](handleError(_0x534dce,null));};exports['removeTags']=function(_0x2491c9,_0x187222,_0x1d0b4a){return db[_0xeefd('0x33')][_0xeefd('0x55')]({'where':{'id':_0x2491c9[_0xeefd('0xa6')]['id']}})[_0xeefd('0x1f')](handleEntityNotFound(_0x187222,null))['then'](function(_0x3030f3){if(_0x3030f3){return _0x3030f3[_0xeefd('0xb8')](_0x2491c9[_0xeefd('0x39')]['ids']);}})[_0xeefd('0x1f')](respondWithStatusCode(_0x187222,null))[_0xeefd('0x2a')](handleError(_0x187222,null));};exports[_0xeefd('0xb9')]=function(_0x24ba56,_0x54821c){var _0x480f2c=moment()[_0xeefd('0xba')]()[_0xeefd('0x8d')]();var _0x37d871=path[_0xeefd('0xbb')](config['root'],_0xeefd('0xbc'),'files',_0xeefd('0xbd'));var _0x59c2d2=path['join'](config[_0xeefd('0xbe')],_0xeefd('0xbc'),_0xeefd('0xbf'),_0xeefd('0xc0'));var _0x1ab740=path[_0xeefd('0xbb')](_0x37d871,_0x480f2c);var _0x1ecded=util['format'](_0xeefd('0xc1'),_0x24ba56[_0xeefd('0xa6')]['id'],_0x480f2c);var _0x514c07=path[_0xeefd('0xbb')](_0x37d871,_0x1ecded);var _0x15b7ee=[];_0x15b7ee['push']({'model':db[_0xeefd('0xc2')],'as':_0xeefd('0xc2'),'raw':!![]});var _0x3c8d5a=[{'model':db['FaxMessage'],'as':_0xeefd('0xc3'),'attributes':['id',_0xeefd('0x69'),_0xeefd('0x6e')],'include':_0x15b7ee}];return db['FaxInteraction'][_0xeefd('0x55')]({'where':{'id':_0x24ba56[_0xeefd('0xa6')]['id']},'include':_0x3c8d5a})[_0xeefd('0x1f')](handleEntityNotFound(_0x54821c,null))[_0xeefd('0x1f')](function(_0x199a47){if(_0x199a47&&_0x199a47[_0xeefd('0xc3')]){var _0xd8bd0=_0x199a47['get']({'plain':!![]});fs['mkdirSync'](_0x1ab740);for(var _0x48d47f=0x0;_0x48d47f<_0xd8bd0[_0xeefd('0xc3')][_0xeefd('0x5d')];_0x48d47f++){var _0x452f88=_0xd8bd0[_0xeefd('0xc3')][_0x48d47f][_0xeefd('0xc2')];if(_0x452f88){var _0x5d2353=path[_0xeefd('0xbb')](_0x59c2d2,_0x452f88[_0xeefd('0xc4')]);if(fs[_0xeefd('0xc5')](_0x5d2353)){fs[_0xeefd('0xc6')](_0x5d2353)[_0xeefd('0xc7')](fs[_0xeefd('0xc8')](path[_0xeefd('0xbb')](_0x1ab740,_0x452f88['basename'])));}}}return BPromise[_0xeefd('0x86')]()[_0xeefd('0x1f')](function(){return new BPromise(function(_0x1feec7,_0x48f87e){zipdir(_0x1ab740,{'saveTo':_0x514c07},function(_0x346a8c,_0x2d4ef5){if(_0x346a8c)return _0x48f87e(_0x346a8c);return _0x1feec7(_0x2d4ef5);});})[_0xeefd('0x1f')](function(){return new BPromise(function(_0x11a5d3,_0x1bae9c){rimraf(_0x1ab740,function(_0x4f74bd){if(_0x4f74bd)_0x1bae9c(_0x4f74bd);return _0x11a5d3();});});})[_0xeefd('0x1f')](function(){return _0x54821c['download'](_0x514c07,_0x1ecded,function(_0x381452){if(_0x381452){console[_0xeefd('0xc9')](_0xeefd('0xca'),_0x381452);}else{fs[_0xeefd('0xcb')](_0x514c07);}});});});}else{return _0x54821c[_0xeefd('0x15')](0xc8);}})[_0xeefd('0x2a')](handleError(_0x54821c,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 3d5c684..d203fc1 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 _0x4065=['then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','update','getUsers'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4065,0x13d));var _0x5406=function(_0x43c8ef,_0x34b34d){_0x43c8ef=_0x43c8ef-0x0;var _0x31684e=_0x4065[_0x43c8ef];return _0x31684e;};'use strict';var EventEmitter=require(_0x5406('0x0'));var FaxInteraction=require(_0x5406('0x1'))['db'][_0x5406('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5406('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5406('0x4'),'afterDestroy':'remove'};function emitEvent(_0x522408){return function(_0x53d4ab,_0x263eae,_0x368a6c){_0x53d4ab[_0x5406('0x5')]({'attributes':['id'],'raw':!![]})[_0x5406('0x6')](function(_0x40fd6b){_0x53d4ab[_0x5406('0x7')](_0x5406('0x8'),_0x40fd6b['map'](function(_0x190593){return{'id':_0x190593['id']};}));return FaxMessage[_0x5406('0x9')]({'where':{'FaxInteractionId':_0x53d4ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5406('0x6')](function(_0x4e34e5){_0x53d4ab[_0x5406('0x7')](_0x5406('0xa'),_0x4e34e5[_0x5406('0xb')]);FaxInteractionEvents[_0x5406('0xc')](_0x522408+':'+_0x53d4ab['id'],_0x53d4ab);FaxInteractionEvents[_0x5406('0xc')](_0x522408,_0x53d4ab);_0x368a6c(null);})[_0x5406('0xd')](_0x368a6c(null));};}for(var e in events){if(events[_0x5406('0xe')](e)){var event=events[e];FaxInteraction[_0x5406('0xf')](e,emitEvent(event));}}module[_0x5406('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xbadc=['unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','FaxInteraction','setMaxListeners','remove','getUsers','Users','map','findAll','then','setDataValue'];(function(_0x4e9567,_0x93dc27){var _0xde0bc3=function(_0x5a2328){while(--_0x5a2328){_0x4e9567['push'](_0x4e9567['shift']());}};_0xde0bc3(++_0x93dc27);}(_0xbadc,0x76));var _0xcbad=function(_0x5281ce,_0x210279){_0x5281ce=_0x5281ce-0x0;var _0x138d09=_0xbadc[_0x5281ce];return _0x138d09;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xcbad('0x0'))['db'][_0xcbad('0x1')];var FaxMessage=require(_0xcbad('0x0'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xcbad('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcbad('0x3')};function emitEvent(_0x25feac){return function(_0x222362,_0x282d13,_0x48ba1c){_0x222362[_0xcbad('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0xe01049){_0x222362['setDataValue'](_0xcbad('0x5'),_0xe01049[_0xcbad('0x6')](function(_0x6f7dcc){return{'id':_0x6f7dcc['id']};}));return FaxMessage[_0xcbad('0x7')]({'where':{'FaxInteractionId':_0x222362['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcbad('0x8')](function(_0xdf0c5f){_0x222362[_0xcbad('0x9')](_0xcbad('0xa'),_0xdf0c5f[_0xcbad('0xb')]);FaxInteractionEvents[_0xcbad('0xc')](_0x25feac+':'+_0x222362['id'],_0x222362);FaxInteractionEvents[_0xcbad('0xc')](_0x25feac,_0x222362);_0x48ba1c(null);})[_0xcbad('0xd')](_0x48ba1c(null));};}for(var e in events){if(events[_0xcbad('0xe')](e)){var event=events[e];FaxInteraction[_0xcbad('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 89833b5..30f3f74 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 _0x77de=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4f4b98,_0x4fc762){var _0x4f32cd=function(_0x21ba11){while(--_0x21ba11){_0x4f4b98['push'](_0x4f4b98['shift']());}};_0x4f32cd(++_0x4fc762);}(_0x77de,0x1d0));var _0xe77d=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x77de[_0x25e109];return _0xc0f7d6;};'use strict';var _=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var logger=require(_0xe77d('0x2'))(_0xe77d('0x3'));var moment=require('moment');var BPromise=require(_0xe77d('0x4'));var rp=require(_0xe77d('0x5'));var fs=require('fs');var path=require(_0xe77d('0x6'));var rimraf=require(_0xe77d('0x7'));var config=require(_0xe77d('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x30a0e5,_0x2d8811){return _0x30a0e5[_0xe77d('0x9')](_0xe77d('0xa'),attributes,{'tableName':_0xe77d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcc5d1f,_0x42be92,_0x1c6088){if(_0xcc5d1f[_0xe77d('0xc')]('closed')){_0xcc5d1f[_0xe77d('0xd')]=moment()[_0xe77d('0xe')](_0xe77d('0xf'));}_0x1c6088(null,_0xcc5d1f);}}});}; \ No newline at end of file +var _0xe46d=['./faxInteraction.attributes','exports','define','FaxInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0xe46d,0x91));var _0xde46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe46d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde46('0x0'));var util=require(_0xde46('0x1'));var logger=require(_0xde46('0x2'))(_0xde46('0x3'));var moment=require('moment');var BPromise=require(_0xde46('0x4'));var rp=require(_0xde46('0x5'));var fs=require('fs');var path=require(_0xde46('0x6'));var rimraf=require(_0xde46('0x7'));var config=require('../../config/environment');var attributes=require(_0xde46('0x8'));module[_0xde46('0x9')]=function(_0x4d0284,_0x18ed54){return _0x4d0284[_0xde46('0xa')](_0xde46('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb5aa4,_0x5faaa6,_0x4d6b0e){if(_0xb5aa4[_0xde46('0xc')](_0xde46('0xd'))){_0xb5aa4[_0xde46('0xe')]=moment()[_0xde46('0xf')](_0xde46('0x10'));}_0x4d6b0e(null,_0xb5aa4);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 765a6b4..b1ece49 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 _0x3ef5=['attributes','debug','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./faxInteraction.socket','register','then','info','request\x20sent','stringify','error','message','FaxInteraction,\x20%s,\x20%s','result','catch','UpdateFaxInteraction','update','body','options','where'];(function(_0x394a43,_0xfcdb69){var _0x190b5a=function(_0x31c0a3){while(--_0x31c0a3){_0x394a43['push'](_0x394a43['shift']());}};_0x190b5a(++_0xfcdb69);}(_0x3ef5,0xa1));var _0x53ef=function(_0x5d7047,_0x4d9f67){_0x5d7047=_0x5d7047-0x0;var _0x20101d=_0x3ef5[_0x5d7047];return _0x20101d;};'use strict';var _=require(_0x53ef('0x0'));var util=require(_0x53ef('0x1'));var moment=require(_0x53ef('0x2'));var BPromise=require(_0x53ef('0x3'));var rs=require(_0x53ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53ef('0x6'))(_0x53ef('0x7'));var config=require('../../config/environment');var jayson=require(_0x53ef('0x8'));var client=jayson[_0x53ef('0x9')]['http']({'port':0x232a});config[_0x53ef('0xa')]=_[_0x53ef('0xb')](config['redis'],{'host':_0x53ef('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x53ef('0xd'))[_0x53ef('0xe')](socket);function respondWithRpcPromise(_0x133aa0,_0x132caa,_0xa27d4a){return new BPromise(function(_0x215d64,_0x3442e2){return client['request'](_0x133aa0,_0xa27d4a)[_0x53ef('0xf')](function(_0x23ae11){logger[_0x53ef('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x132caa,_0x53ef('0x11'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x132caa,_0x53ef('0x11'),JSON[_0x53ef('0x12')](_0x23ae11));if(_0x23ae11[_0x53ef('0x13')]){if(_0x23ae11['error']['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x132caa,_0x23ae11[_0x53ef('0x13')][_0x53ef('0x14')]);return _0x3442e2(_0x23ae11[_0x53ef('0x13')][_0x53ef('0x14')]);}logger[_0x53ef('0x13')](_0x53ef('0x15'),_0x132caa,_0x23ae11[_0x53ef('0x13')][_0x53ef('0x14')]);return _0x215d64(_0x23ae11[_0x53ef('0x13')]['message']);}else{logger[_0x53ef('0x10')](_0x53ef('0x15'),_0x132caa,'request\x20sent');_0x215d64(_0x23ae11[_0x53ef('0x16')]['message']);}})[_0x53ef('0x17')](function(_0x5a2a4c){logger[_0x53ef('0x13')](_0x53ef('0x15'),_0x132caa,_0x5a2a4c);_0x3442e2(_0x5a2a4c);});});}exports[_0x53ef('0x18')]=function(_0x5ab566){var _0x2236ab=this;return new Promise(function(_0x4ea1ba,_0x499434){return db['FaxInteraction'][_0x53ef('0x19')](_0x5ab566[_0x53ef('0x1a')],{'raw':_0x5ab566[_0x53ef('0x1b')]?_0x5ab566[_0x53ef('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ab566[_0x53ef('0x1b')]?_0x5ab566[_0x53ef('0x1b')][_0x53ef('0x1c')]||null:null,'attributes':_0x5ab566['options']?_0x5ab566[_0x53ef('0x1b')][_0x53ef('0x1d')]||null:null,'limit':_0x5ab566[_0x53ef('0x1b')]?_0x5ab566[_0x53ef('0x1b')]['limit']||null:null})[_0x53ef('0xf')](function(_0x1d3cda){logger[_0x53ef('0x10')](_0x53ef('0x18'),_0x5ab566);logger[_0x53ef('0x1e')]('UpdateFaxInteraction',_0x5ab566,JSON[_0x53ef('0x12')](_0x1d3cda));_0x4ea1ba(_0x1d3cda);})[_0x53ef('0x17')](function(_0x5b2538){logger['error'](_0x53ef('0x18'),_0x5b2538['message'],_0x5ab566);_0x499434(_0x2236ab[_0x53ef('0x13')](0x1f4,_0x5b2538[_0x53ef('0x14')]));});});};exports[_0x53ef('0x1f')]=function(_0xb4aefd){return new Promise(function(_0x2a54a8,_0x48080a){return db[_0x53ef('0x20')][_0x53ef('0x21')]({'where':_0xb4aefd[_0x53ef('0x1b')]?_0xb4aefd[_0x53ef('0x1b')][_0x53ef('0x1c')]||null:null})[_0x53ef('0xf')](function(_0x54db7b){if(_0x54db7b){return _0x54db7b[_0x53ef('0x22')](_0xb4aefd[_0x53ef('0x1a')][_0x53ef('0x23')],_['omit'](_0xb4aefd['body'],[_0x53ef('0x23'),'id'])||{});}})[_0x53ef('0x24')](function(_0x33d647){logger[_0x53ef('0x10')](_0x53ef('0x25'),_0xb4aefd);logger[_0x53ef('0x1e')](_0x53ef('0x25'),_0xb4aefd,JSON[_0x53ef('0x12')](_0x33d647));_0x2a54a8(_0x33d647);})['catch'](function(_0x5019af){logger[_0x53ef('0x13')](_0x53ef('0x25'),_0x5019af[_0x53ef('0x14')],_0xb4aefd);_0x48080a(_this['error'](0x1f4,_0x5019af['message']));});});}; \ No newline at end of file +var _0xef2d=['error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4bcac3,_0x596681){var _0x5f5318=function(_0x382d31){while(--_0x382d31){_0x4bcac3['push'](_0x4bcac3['shift']());}};_0x5f5318(++_0x596681);}(_0xef2d,0x1af));var _0xdef2=function(_0x124593,_0x3e558f){_0x124593=_0x124593-0x0;var _0x23cbb1=_0xef2d[_0x124593];return _0x23cbb1;};'use strict';var _=require(_0xdef2('0x0'));var util=require('util');var moment=require(_0xdef2('0x1'));var BPromise=require('bluebird');var rs=require(_0xdef2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdef2('0x3'))['db'];var utils=require(_0xdef2('0x4'));var logger=require(_0xdef2('0x5'))(_0xdef2('0x6'));var config=require('../../config/environment');var jayson=require(_0xdef2('0x7'));var client=jayson['client'][_0xdef2('0x8')]({'port':0x232a});config[_0xdef2('0x9')]=_[_0xdef2('0xa')](config[_0xdef2('0x9')],{'host':_0xdef2('0xb'),'port':0x18eb});var socket=require(_0xdef2('0xc'))(new Redis(config[_0xdef2('0x9')]));require(_0xdef2('0xd'))[_0xdef2('0xe')](socket);function respondWithRpcPromise(_0x311f5d,_0x2f7201,_0x595c98){return new BPromise(function(_0x4602d1,_0x2b7b88){return client['request'](_0x311f5d,_0x595c98)[_0xdef2('0xf')](function(_0x5dbae9){logger[_0xdef2('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x2f7201,_0xdef2('0x11'));logger[_0xdef2('0x12')](_0xdef2('0x13'),_0x2f7201,_0xdef2('0x11'),JSON['stringify'](_0x5dbae9));if(_0x5dbae9[_0xdef2('0x14')]){if(_0x5dbae9[_0xdef2('0x14')][_0xdef2('0x15')]===0x1f4){logger['error'](_0xdef2('0x16'),_0x2f7201,_0x5dbae9['error']['message']);return _0x2b7b88(_0x5dbae9[_0xdef2('0x14')]['message']);}logger[_0xdef2('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x2f7201,_0x5dbae9[_0xdef2('0x14')][_0xdef2('0x17')]);return _0x4602d1(_0x5dbae9[_0xdef2('0x14')][_0xdef2('0x17')]);}else{logger[_0xdef2('0x10')](_0xdef2('0x16'),_0x2f7201,'request\x20sent');_0x4602d1(_0x5dbae9[_0xdef2('0x18')][_0xdef2('0x17')]);}})[_0xdef2('0x19')](function(_0x4dfdde){logger['error'](_0xdef2('0x16'),_0x2f7201,_0x4dfdde);_0x2b7b88(_0x4dfdde);});});}exports[_0xdef2('0x1a')]=function(_0x44a2a1){var _0x111a61=this;return new Promise(function(_0xc36c97,_0x540e52){return db['FaxInteraction']['update'](_0x44a2a1[_0xdef2('0x1b')],{'raw':_0x44a2a1[_0xdef2('0x1c')]?_0x44a2a1['options'][_0xdef2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a2a1[_0xdef2('0x1c')]?_0x44a2a1[_0xdef2('0x1c')][_0xdef2('0x1e')]||null:null,'attributes':_0x44a2a1[_0xdef2('0x1c')]?_0x44a2a1[_0xdef2('0x1c')][_0xdef2('0x1f')]||null:null,'limit':_0x44a2a1[_0xdef2('0x1c')]?_0x44a2a1[_0xdef2('0x1c')][_0xdef2('0x20')]||null:null})[_0xdef2('0xf')](function(_0x2e81b7){logger[_0xdef2('0x10')](_0xdef2('0x1a'),_0x44a2a1);logger[_0xdef2('0x12')](_0xdef2('0x1a'),_0x44a2a1,JSON[_0xdef2('0x21')](_0x2e81b7));_0xc36c97(_0x2e81b7);})['catch'](function(_0x28f38f){logger[_0xdef2('0x14')](_0xdef2('0x1a'),_0x28f38f[_0xdef2('0x17')],_0x44a2a1);_0x540e52(_0x111a61[_0xdef2('0x14')](0x1f4,_0x28f38f[_0xdef2('0x17')]));});});};exports[_0xdef2('0x22')]=function(_0x446ea0){return new Promise(function(_0x1ec5a9,_0x53484e){return db[_0xdef2('0x23')][_0xdef2('0x24')]({'where':_0x446ea0[_0xdef2('0x1c')]?_0x446ea0['options'][_0xdef2('0x1e')]||null:null})['then'](function(_0x3f9e3c){if(_0x3f9e3c){return _0x3f9e3c[_0xdef2('0x25')](_0x446ea0[_0xdef2('0x1b')][_0xdef2('0x26')],_['omit'](_0x446ea0['body'],[_0xdef2('0x26'),'id'])||{});}})[_0xdef2('0x27')](function(_0x279926){logger['info'](_0xdef2('0x28'),_0x446ea0);logger[_0xdef2('0x12')](_0xdef2('0x28'),_0x446ea0,JSON[_0xdef2('0x21')](_0x279926));_0x1ec5a9(_0x279926);})[_0xdef2('0x19')](function(_0x2b02ea){logger[_0xdef2('0x14')](_0xdef2('0x28'),_0x2b02ea[_0xdef2('0x17')],_0x446ea0);_0x53484e(_this['error'](0x1f4,_0x2b02ea[_0xdef2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 9a0869d..ab7e6d0 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 _0xa9b4=['length','faxInteraction:','./faxInteraction.events','save','remove','update'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xa9b4,0x74));var _0x4a9b=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xa9b4[_0x412e27];return _0x53da42;};'use strict';var FaxInteractionEvents=require(_0x4a9b('0x0'));var events=[_0x4a9b('0x1'),_0x4a9b('0x2'),_0x4a9b('0x3')];function createListener(_0x3c75c7,_0x4bb9d7){return function(_0x3c6bc6){_0x4bb9d7['emit'](_0x3c75c7,_0x3c6bc6);};}function removeListener(_0x245a15,_0x59e654){return function(){FaxInteractionEvents['removeListener'](_0x245a15,_0x59e654);};}exports['register']=function(_0x180662){for(var _0x33d839=0x0,_0x45ab82=events[_0x4a9b('0x4')];_0x33d839<_0x45ab82;_0x33d839++){var _0x1adc59=events[_0x33d839];var _0x4d575b=createListener(_0x4a9b('0x5')+_0x1adc59,_0x180662);FaxInteractionEvents['on'](_0x1adc59,_0x4d575b);}}; \ No newline at end of file +var _0xb14b=['emit','removeListener','register','length','./faxInteraction.events','save','remove','update'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb14b,0x64));var _0xbb14=function(_0x36b5c8,_0x16c0cf){_0x36b5c8=_0x36b5c8-0x0;var _0x4e70e5=_0xb14b[_0x36b5c8];return _0x4e70e5;};'use strict';var FaxInteractionEvents=require(_0xbb14('0x0'));var events=[_0xbb14('0x1'),_0xbb14('0x2'),_0xbb14('0x3')];function createListener(_0x2bf454,_0x1fcace){return function(_0x2cb259){_0x1fcace[_0xbb14('0x4')](_0x2bf454,_0x2cb259);};}function removeListener(_0x105501,_0x4bf04f){return function(){FaxInteractionEvents[_0xbb14('0x5')](_0x105501,_0x4bf04f);};}exports[_0xbb14('0x6')]=function(_0x1afe61){for(var _0x39255e=0x0,_0x3de457=events[_0xbb14('0x7')];_0x39255e<_0x3de457;_0x39255e++){var _0x2fbe19=events[_0x39255e];var _0x368d14=createListener('faxInteraction:'+_0x2fbe19,_0x1afe61);FaxInteractionEvents['on'](_0x2fbe19,_0x368d14);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index ab49a96..1d8a78e 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 _0x14d8=['get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x1ce926,_0x108f46){var _0x28ba23=function(_0x27a518){while(--_0x27a518){_0x1ce926['push'](_0x1ce926['shift']());}};_0x28ba23(++_0x108f46);}(_0x14d8,0x9f));var _0x814d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x14d8[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var path=require(_0x814d('0x2'));var timeout=require(_0x814d('0x3'));var express=require(_0x814d('0x4'));var router=express[_0x814d('0x5')]();var fs_extra=require(_0x814d('0x6'));var auth=require(_0x814d('0x7'));var interaction=require(_0x814d('0x8'));var config=require(_0x814d('0x9'));var controller=require(_0x814d('0xa'));router[_0x814d('0xb')]('/',auth[_0x814d('0xc')](),controller[_0x814d('0xd')]);router[_0x814d('0xb')](_0x814d('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x814d('0xb')](_0x814d('0xf'),auth[_0x814d('0xc')](),controller['show']);router[_0x814d('0xb')](_0x814d('0x10'),auth['isAuthenticated'](),controller[_0x814d('0x11')]);router[_0x814d('0xb')](_0x814d('0x12'),auth['isAuthenticated'](),controller[_0x814d('0x13')]);router[_0x814d('0x14')]('/',auth[_0x814d('0xc')](),controller[_0x814d('0x15')]);router[_0x814d('0x14')](_0x814d('0x10'),auth[_0x814d('0xc')](),controller[_0x814d('0x16')]);router['post'](_0x814d('0x17'),auth[_0x814d('0xc')](),interaction[_0x814d('0x18')](_0x814d('0x19'),_0x814d('0x1a')),controller[_0x814d('0x1b')]);router[_0x814d('0x1c')](_0x814d('0xf'),auth[_0x814d('0xc')](),interaction[_0x814d('0x18')](_0x814d('0x19'),_0x814d('0x1d')),controller['update']);router[_0x814d('0x1e')]('/:id',auth[_0x814d('0xc')](),interaction[_0x814d('0x18')]('fax',_0x814d('0x1f')),controller['destroy']);router['delete']('/:id/tags',auth[_0x814d('0xc')](),controller[_0x814d('0x20')]);module[_0x814d('0x21')]=router; \ No newline at end of file +var _0xb010=['/:id/messages','getMessages','/:id/download','post','/:id/tags','tracked','fax','put','/:id','faxinteraction:update','update','delete','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x10fc9a,_0x78f66a){var _0x1b26d3=function(_0x5847d7){while(--_0x5847d7){_0x10fc9a['push'](_0x10fc9a['shift']());}};_0x1b26d3(++_0x78f66a);}(_0xb010,0x70));var _0x0b01=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb010[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x0b01('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b01('0x1'));var express=require(_0x0b01('0x2'));var router=express['Router']();var fs_extra=require(_0x0b01('0x3'));var auth=require(_0x0b01('0x4'));var interaction=require(_0x0b01('0x5'));var config=require(_0x0b01('0x6'));var controller=require(_0x0b01('0x7'));router[_0x0b01('0x8')]('/',auth[_0x0b01('0x9')](),controller[_0x0b01('0xa')]);router['get'](_0x0b01('0xb'),auth[_0x0b01('0x9')](),controller[_0x0b01('0xc')]);router[_0x0b01('0x8')]('/:id',auth[_0x0b01('0x9')](),controller['show']);router[_0x0b01('0x8')](_0x0b01('0xd'),auth['isAuthenticated'](),controller[_0x0b01('0xe')]);router[_0x0b01('0x8')](_0x0b01('0xf'),auth[_0x0b01('0x9')](),controller['download']);router[_0x0b01('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0b01('0x10')](_0x0b01('0xd'),auth['isAuthenticated'](),controller['addMessage']);router[_0x0b01('0x10')](_0x0b01('0x11'),auth[_0x0b01('0x9')](),interaction[_0x0b01('0x12')](_0x0b01('0x13'),'faxinteraction:addtags'),controller['addTags']);router[_0x0b01('0x14')](_0x0b01('0x15'),auth['isAuthenticated'](),interaction[_0x0b01('0x12')](_0x0b01('0x13'),_0x0b01('0x16')),controller[_0x0b01('0x17')]);router['delete'](_0x0b01('0x15'),auth[_0x0b01('0x9')](),interaction['tracked'](_0x0b01('0x13'),'faxinteraction:destroy'),controller['destroy']);router[_0x0b01('0x18')](_0x0b01('0x11'),auth[_0x0b01('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 1fe2d52..8ae99ad 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 _0x72b1=['sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x72b1,0x16e));var _0x172b=function(_0xcac133,_0x3c84fd){_0xcac133=_0xcac133-0x0;var _0x38dc9a=_0x72b1[_0xcac133];return _0x38dc9a;};'use strict';var Sequelize=require(_0x172b('0x0'));module['exports']={'body':{'type':Sequelize[_0x172b('0x1')](_0x172b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x172b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x172b('0x4')]('in',_0x172b('0x5')),'defaultValue':_0x172b('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x172b('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x7c8e=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x2c6c27,_0x583885){_0x2c6c27=_0x2c6c27-0x0;var _0x4bf010=_0x7c8e[_0x2c6c27];return _0x4bf010;};'use strict';var Sequelize=require('sequelize');module[_0xe7c8('0x0')]={'body':{'type':Sequelize[_0xe7c8('0x1')](_0xe7c8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe7c8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe7c8('0x4')]('in',_0xe7c8('0x5')),'defaultValue':_0xe7c8('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe7c8('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe7c8('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 7114703..e70b6d0 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 _0x4b3f=['where','pick','filter','name','merge','includeAll','include','findAll','rows','params','options','body','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','find','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','event','create','CmContact','findOne','ContactId','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server','Attachment','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x102fdd,_0x2947b8){var _0x199250=function(_0x3b221f){while(--_0x3b221f){_0x102fdd['push'](_0x102fdd['shift']());}};_0x199250(++_0x2947b8);}(_0x4b3f,0x1ef));var _0xf4b3=function(_0x1fdf10,_0x13bb3a){_0x1fdf10=_0x1fdf10-0x0;var _0x16f2a6=_0x4b3f[_0x1fdf10];return _0x16f2a6;};'use strict';var emlformat=require(_0xf4b3('0x0'));var rimraf=require(_0xf4b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4b3('0x2'));var rp=require(_0xf4b3('0x3'));var moment=require(_0xf4b3('0x4'));var BPromise=require(_0xf4b3('0x5'));var Mustache=require(_0xf4b3('0x6'));var util=require(_0xf4b3('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4b3('0x8'));var fs=require('fs');var fs_extra=require(_0xf4b3('0x9'));var _=require(_0xf4b3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf4b3('0xb'));var toCsv=require(_0xf4b3('0xc'));var querystring=require(_0xf4b3('0xd'));var Papa=require(_0xf4b3('0xe'));var Redis=require(_0xf4b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf4b3('0x10'));var as=require(_0xf4b3('0x11'));var hardwareService=require(_0xf4b3('0x12'));var logger=require('../../config/logger')(_0xf4b3('0x13'));var utils=require(_0xf4b3('0x14'));var config=require(_0xf4b3('0x15'));var licenseUtil=require(_0xf4b3('0x16'));var db=require(_0xf4b3('0x17'))['db'];config[_0xf4b3('0x18')]=_[_0xf4b3('0x19')](config[_0xf4b3('0x18')],{'host':_0xf4b3('0x1a'),'port':0x18eb});var socket=require(_0xf4b3('0x1b'))(new Redis(config[_0xf4b3('0x18')]));require(_0xf4b3('0x1c'))[_0xf4b3('0x1d')](socket);var jayson=require(_0xf4b3('0x1e'));var client=jayson[_0xf4b3('0x1f')][_0xf4b3('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xf4b3('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x8db3ad,_0x66119f,_0x593914,_0x1abc07){return new BPromise(function(_0x27954f,_0x568aab){var _0x2c5d2f=_0x1abc07||client;return _0x2c5d2f['request'](_0x8db3ad,_0x593914)[_0xf4b3('0x21')](function(_0x47557a){logger[_0xf4b3('0x22')](_0xf4b3('0x23'),_0x66119f,_0xf4b3('0x24'));logger[_0xf4b3('0x25')](_0xf4b3('0x26'),_0x66119f,_0xf4b3('0x24'),JSON['stringify'](_0x47557a));if(_0x47557a[_0xf4b3('0x27')]){if(_0x47557a[_0xf4b3('0x27')][_0xf4b3('0x28')]===0x1f4){logger[_0xf4b3('0x27')](_0xf4b3('0x23'),_0x66119f,_0x47557a[_0xf4b3('0x27')][_0xf4b3('0x29')]);return _0x568aab(_0x47557a[_0xf4b3('0x27')][_0xf4b3('0x29')]);}logger[_0xf4b3('0x27')](_0xf4b3('0x23'),_0x66119f,_0x47557a[_0xf4b3('0x27')][_0xf4b3('0x29')]);return _0x27954f(_0x47557a[_0xf4b3('0x27')][_0xf4b3('0x29')]);}else{logger[_0xf4b3('0x22')](_0xf4b3('0x23'),_0x66119f,_0xf4b3('0x24'));_0x27954f(_0x47557a[_0xf4b3('0x2a')]['message']);}})[_0xf4b3('0x2b')](function(_0x462743){logger[_0xf4b3('0x27')](_0xf4b3('0x23'),_0x66119f,_0x462743);_0x568aab(_0x462743);});});}function respondWithStatusCode(_0xba667a,_0x15c0c2){_0x15c0c2=_0x15c0c2||0xcc;return function(_0x490ca5){if(_0x490ca5){return _0xba667a[_0xf4b3('0x2c')](_0x15c0c2);}return _0xba667a['status'](_0x15c0c2)[_0xf4b3('0x2d')]();};}function respondWithResult(_0x352c37,_0x1e4afd){_0x1e4afd=_0x1e4afd||0xc8;return function(_0x4d6585){if(_0x4d6585){return _0x352c37[_0xf4b3('0x2e')](_0x1e4afd)[_0xf4b3('0x2f')](_0x4d6585);}};}function respondWithFilteredResult(_0x56e526,_0x195fbf){return function(_0x3c3e7f){if(_0x3c3e7f){var _0x11ac72=typeof _0x195fbf[_0xf4b3('0x30')]===_0xf4b3('0x31')&&typeof _0x195fbf[_0xf4b3('0x32')]===_0xf4b3('0x31');var _0x5b83a9=_0x3c3e7f[_0xf4b3('0x33')];var _0x2cf39a=_0x11ac72?0x0:_0x195fbf['offset'];var _0x433f97=_0x11ac72?_0x3c3e7f[_0xf4b3('0x33')]:_0x195fbf[_0xf4b3('0x30')]+_0x195fbf[_0xf4b3('0x32')];var _0x27605d;if(_0x433f97>=_0x5b83a9){_0x433f97=_0x5b83a9;_0x27605d=0xc8;}else{_0x27605d=0xce;}_0x56e526[_0xf4b3('0x2e')](_0x27605d);return _0x56e526[_0xf4b3('0x34')](_0xf4b3('0x35'),_0x2cf39a+'-'+_0x433f97+'/'+_0x5b83a9)[_0xf4b3('0x2f')](_0x3c3e7f);}return null;};}function patchUpdates(_0xaa0299){return function(_0x31c94e){try{jsonpatch[_0xf4b3('0x36')](_0x31c94e,_0xaa0299,!![]);}catch(_0x220a49){return BPromise[_0xf4b3('0x37')](_0x220a49);}return _0x31c94e[_0xf4b3('0x38')]();};}function saveUpdates(_0x935c8b,_0x5f4eed){return function(_0x13243b){if(_0x13243b){return _0x13243b[_0xf4b3('0x39')](_0x935c8b)[_0xf4b3('0x21')](function(_0x2a2a6c){return _0x2a2a6c;});}return null;};}function removeEntity(_0x5f0c0f,_0x1cee88){return function(_0x1e3d12){if(_0x1e3d12){return _0x1e3d12[_0xf4b3('0x3a')]()[_0xf4b3('0x21')](function(){_0x5f0c0f[_0xf4b3('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xffd923,_0x2ef619){return function(_0x14628b){if(!_0x14628b){_0xffd923[_0xf4b3('0x2c')](0x194);}return _0x14628b;};}function handleError(_0x369ad8,_0x386ecc){_0x386ecc=_0x386ecc||0x1f4;return function(_0x5b87b9){logger['error'](_0x5b87b9['stack']);if(_0x5b87b9['name']){delete _0x5b87b9['name'];}_0x369ad8[_0xf4b3('0x2e')](_0x386ecc)[_0xf4b3('0x3b')](_0x5b87b9);};}exports[_0xf4b3('0x3c')]=function(_0x2d1986,_0x75fa20){var _0xdfb80a={},_0x377939={},_0x54d23e={'count':0x0,'rows':[]};var _0x5b940f=_[_0xf4b3('0x3d')](db[_0xf4b3('0x3e')][_0xf4b3('0x3f')],function(_0x80dccc){return{'name':_0x80dccc[_0xf4b3('0x40')],'type':_0x80dccc[_0xf4b3('0x41')]['key']};});_0x377939[_0xf4b3('0x42')]=_[_0xf4b3('0x3d')](_0x5b940f,'name');_0x377939[_0xf4b3('0x43')]=_[_0xf4b3('0x44')](_0x2d1986[_0xf4b3('0x43')]);_0x377939[_0xf4b3('0x45')]=_[_0xf4b3('0x46')](_0x377939[_0xf4b3('0x42')],_0x377939['query']);_0xdfb80a[_0xf4b3('0x47')]=_[_0xf4b3('0x46')](_0x377939[_0xf4b3('0x42')],qs[_0xf4b3('0x48')](_0x2d1986[_0xf4b3('0x43')][_0xf4b3('0x48')]));_0xdfb80a[_0xf4b3('0x47')]=_0xdfb80a['attributes'][_0xf4b3('0x49')]?_0xdfb80a[_0xf4b3('0x47')]:_0x377939[_0xf4b3('0x42')];if(!_0x2d1986[_0xf4b3('0x43')][_0xf4b3('0x4a')](_0xf4b3('0x4b'))){_0xdfb80a['limit']=qs[_0xf4b3('0x32')](_0x2d1986[_0xf4b3('0x43')]['limit']);_0xdfb80a[_0xf4b3('0x30')]=qs[_0xf4b3('0x30')](_0x2d1986[_0xf4b3('0x43')]['offset']);}_0xdfb80a['order']=qs[_0xf4b3('0x4c')](_0x2d1986[_0xf4b3('0x43')][_0xf4b3('0x4c')]);_0xdfb80a[_0xf4b3('0x4d')]=qs[_0xf4b3('0x45')](_[_0xf4b3('0x4e')](_0x2d1986['query'],_0x377939['filters']),_0x5b940f);if(_0x2d1986[_0xf4b3('0x43')][_0xf4b3('0x4f')]){_0xdfb80a['where']=_['merge'](_0xdfb80a[_0xf4b3('0x4d')],{'$or':_['map'](_0x5b940f,function(_0x11591a){if(_0x11591a[_0xf4b3('0x41')]!=='VIRTUAL'){var _0xaab860={};_0xaab860[_0x11591a[_0xf4b3('0x50')]]={'$like':'%'+_0x2d1986[_0xf4b3('0x43')][_0xf4b3('0x4f')]+'%'};return _0xaab860;}})});}_0xdfb80a=_[_0xf4b3('0x51')]({},_0xdfb80a,_0x2d1986['options']);var _0x14ba6d={'where':_0xdfb80a['where']};return db[_0xf4b3('0x3e')]['count'](_0x14ba6d)[_0xf4b3('0x21')](function(_0x392992){_0x54d23e[_0xf4b3('0x33')]=_0x392992;if(_0x2d1986['query'][_0xf4b3('0x52')]){_0xdfb80a[_0xf4b3('0x53')]=[{'all':!![]}];}return db[_0xf4b3('0x3e')][_0xf4b3('0x54')](_0xdfb80a);})[_0xf4b3('0x21')](function(_0x4c7ccb){_0x54d23e[_0xf4b3('0x55')]=_0x4c7ccb;return _0x54d23e;})[_0xf4b3('0x21')](respondWithFilteredResult(_0x75fa20,_0xdfb80a))[_0xf4b3('0x2b')](handleError(_0x75fa20,null));};exports['show']=function(_0x250ea3,_0x536c70){var _0xe1d7b7={'raw':!![],'where':{'id':_0x250ea3[_0xf4b3('0x56')]['id']}},_0x37fd11={};_0x37fd11[_0xf4b3('0x42')]=_[_0xf4b3('0x44')](db['FaxMessage'][_0xf4b3('0x3f')]);_0x37fd11[_0xf4b3('0x43')]=_[_0xf4b3('0x44')](_0x250ea3[_0xf4b3('0x43')]);_0x37fd11[_0xf4b3('0x45')]=_[_0xf4b3('0x46')](_0x37fd11['model'],_0x37fd11[_0xf4b3('0x43')]);_0xe1d7b7['attributes']=_[_0xf4b3('0x46')](_0x37fd11['model'],qs[_0xf4b3('0x48')](_0x250ea3['query'][_0xf4b3('0x48')]));_0xe1d7b7[_0xf4b3('0x47')]=_0xe1d7b7[_0xf4b3('0x47')][_0xf4b3('0x49')]?_0xe1d7b7[_0xf4b3('0x47')]:_0x37fd11[_0xf4b3('0x42')];if(_0x250ea3['query']['includeAll']){_0xe1d7b7[_0xf4b3('0x53')]=[{'all':!![]}];}_0xe1d7b7=_[_0xf4b3('0x51')]({},_0xe1d7b7,_0x250ea3[_0xf4b3('0x57')]);return db['FaxMessage']['find'](_0xe1d7b7)[_0xf4b3('0x21')](handleEntityNotFound(_0x536c70,null))[_0xf4b3('0x21')](respondWithResult(_0x536c70,null))[_0xf4b3('0x2b')](handleError(_0x536c70,null));};exports[_0xf4b3('0x39')]=function(_0x1ae432,_0x482fcb){if(_0x1ae432['body']['id']){delete _0x1ae432[_0xf4b3('0x58')]['id'];}return db[_0xf4b3('0x3e')]['find']({'where':{'id':_0x1ae432[_0xf4b3('0x56')]['id']}})[_0xf4b3('0x21')](handleEntityNotFound(_0x482fcb,null))[_0xf4b3('0x21')](saveUpdates(_0x1ae432[_0xf4b3('0x58')],null))[_0xf4b3('0x21')](respondWithResult(_0x482fcb,null))[_0xf4b3('0x2b')](handleError(_0x482fcb,null));};exports['destroy']=function(_0x1708c8,_0x4c941f){return db[_0xf4b3('0x3e')]['find']({'where':{'id':_0x1708c8[_0xf4b3('0x56')]['id']}})[_0xf4b3('0x21')](handleEntityNotFound(_0x4c941f,null))[_0xf4b3('0x21')](removeEntity(_0x4c941f,null))['catch'](handleError(_0x4c941f,null));};exports['describe']=function(_0x5c21dc,_0x3f76ec){return db[_0xf4b3('0x3e')]['describe']()[_0xf4b3('0x21')](respondWithResult(_0x3f76ec,null))[_0xf4b3('0x2b')](handleError(_0x3f76ec,null));};var interaction_log=require(_0xf4b3('0x59'))(_0xf4b3('0x5a'));exports[_0xf4b3('0x5b')]=function(_0x745378,_0x487726,_0x436e13){var _0x5ed4f0={'agent':{},'channel':_0xf4b3('0x5c')};if(_0x745378[_0xf4b3('0x58')]['id']){delete _0x745378['body']['id'];}_0x745378[_0xf4b3('0x58')][_0xf4b3('0x5d')]=!![];_0x745378[_0xf4b3('0x58')][_0xf4b3('0x5e')]=moment()[_0xf4b3('0x5f')](_0xf4b3('0x60'));_0x745378[_0xf4b3('0x58')][_0xf4b3('0x61')]=_0x745378[_0xf4b3('0x58')][_0xf4b3('0x61')]||_0x745378[_0xf4b3('0x62')]['id'];_0x5ed4f0[_0xf4b3('0x63')]['id']=_0x745378['body'][_0xf4b3('0x61')];return db[_0xf4b3('0x3e')]['find']({'where':{'id':_0x745378[_0xf4b3('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x487726,null))[_0xf4b3('0x21')](saveUpdates(_0x745378[_0xf4b3('0x58')],null))[_0xf4b3('0x21')](function(_0x3935ca){if(_0x3935ca){_0x5ed4f0[_0xf4b3('0x29')]=_0x3935ca[_0xf4b3('0x64')]({'plain':!![]});return db[_0xf4b3('0x65')][_0xf4b3('0x66')]({'where':{'id':_0x3935ca[_0xf4b3('0x67')]}});}return null;})[_0xf4b3('0x21')](handleEntityNotFound(_0x487726,null))[_0xf4b3('0x21')](function(_0x4f7ecf){if(_0x4f7ecf){return _0x4f7ecf[_0xf4b3('0x39')]({'UserId':_0x745378[_0xf4b3('0x58')][_0xf4b3('0x61')],'read1stAt':_[_0xf4b3('0x68')](_0x4f7ecf[_0xf4b3('0x69')])?moment()[_0xf4b3('0x5f')](_0xf4b3('0x60')):undefined});}return null;})[_0xf4b3('0x21')](function(_0x4f1e20){if(_0x4f1e20){_0x5ed4f0['interaction']=_0x4f1e20[_0xf4b3('0x64')]({'plain':!![]});interaction_log['info'](_0xf4b3('0x6a'),_0x745378[_0xf4b3('0x62')]['id'],_0x745378['user'][_0xf4b3('0x50')],_0x745378['user']['role'],_0x5ed4f0[_0xf4b3('0x6b')]['id'],_0x745378[_0xf4b3('0x58')]?JSON[_0xf4b3('0x6c')](_0x745378[_0xf4b3('0x58')]):_0xf4b3('0x6d'));return respondWithRpcPromise(_0xf4b3('0x6e'),_0xf4b3('0x6f'),_0x5ed4f0);}return null;})['then'](function(_0x202dec){var _0x339d77='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x202dec[_0xf4b3('0x29')]['ContactId'];return db['sequelize']['query'](_0x339d77,{'type':db[_0xf4b3('0x70')][_0xf4b3('0x71')][_0xf4b3('0x72')],'raw':!![]})[_0xf4b3('0x21')](function(_0x29abf9){return _0x29abf9;});})['then'](function(_0x5c1322){if(_0x5c1322){_0x5ed4f0[_0xf4b3('0x29')]['contact']=_0x5c1322[0x0];if(!_0x745378[_0xf4b3('0x58')][_0xf4b3('0x61')])return;return db['User'][_0xf4b3('0x66')]({'where':{'id':_0x745378[_0xf4b3('0x58')]['UserId'],'role':_0xf4b3('0x63')},'attributes':['id','name',_0xf4b3('0x73'),_0xf4b3('0x74'),_0xf4b3('0x75')],'raw':!![]});}return null;})[_0xf4b3('0x21')](function(_0xa794c0){if(!_0xa794c0)return null;_0x5ed4f0[_0xf4b3('0x29')][_0xf4b3('0x63')]=_0xa794c0;return _0x5ed4f0;})['then'](function(_0x5730ed){if(_0x5730ed){if(_0x745378[_0xf4b3('0x58')]['manual']){_0x5ed4f0[_0xf4b3('0x29')][_0xf4b3('0x76')]=util['format'](_0xf4b3('0x77'),_0x745378[_0xf4b3('0x62')][_0xf4b3('0x50')]);_0x5ed4f0[_0xf4b3('0x29')][_0xf4b3('0x78')]=_0x5ed4f0[_0xf4b3('0x78')];_0x5ed4f0[_0xf4b3('0x29')][_0xf4b3('0x79')]=_0x5ed4f0[_0xf4b3('0x78')];_0x5ed4f0[_0xf4b3('0x29')]['event']=_0xf4b3('0x5b');return respondWithRpcPromise(_0xf4b3('0x7a'),_0xf4b3('0x7a'),{'event':'acceptmessage','message':_0x5ed4f0[_0xf4b3('0x29')]},client9002)[_0xf4b3('0x21')](function(){return _0x5ed4f0;});}return _0x5ed4f0;}return null;})[_0xf4b3('0x21')](respondWithResult(_0x487726,null))[_0xf4b3('0x2b')](handleError(_0x487726,null));};var interaction_log=require(_0xf4b3('0x59'))(_0xf4b3('0x5a'));exports[_0xf4b3('0x37')]=function(_0x3f0af2,_0x235496,_0x5a1bd2){var _0x27714c={'agent':{},'channel':'fax'};if(_0x3f0af2[_0xf4b3('0x58')]['id']){delete _0x3f0af2[_0xf4b3('0x58')]['id'];}_0x3f0af2[_0xf4b3('0x58')][_0xf4b3('0x61')]=_0x3f0af2[_0xf4b3('0x58')][_0xf4b3('0x61')]||_0x3f0af2[_0xf4b3('0x62')]['id'];_0x27714c[_0xf4b3('0x63')]['id']=_0x3f0af2[_0xf4b3('0x58')][_0xf4b3('0x61')];return db['FaxMessage'][_0xf4b3('0x66')]({'where':{'id':_0x3f0af2['params']['id'],'UserId':null}})[_0xf4b3('0x21')](handleEntityNotFound(_0x235496,null))[_0xf4b3('0x21')](function(_0x295bb8){if(_0x295bb8){_0x27714c[_0xf4b3('0x29')]=_0x295bb8['get']({'plain':!![]});return db['FaxInteraction'][_0xf4b3('0x66')]({'where':{'id':_0x295bb8[_0xf4b3('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x235496,null))['then'](function(_0x14cf43){if(_0x14cf43){_0x27714c['interaction']=_0x14cf43[_0xf4b3('0x64')]({'plain':!![]});interaction_log[_0xf4b3('0x22')](_0xf4b3('0x7b'),_0x3f0af2[_0xf4b3('0x62')]['id'],_0x3f0af2[_0xf4b3('0x62')][_0xf4b3('0x50')],_0x3f0af2[_0xf4b3('0x62')]['role'],_0x27714c[_0xf4b3('0x6b')]['id'],_0x3f0af2[_0xf4b3('0x58')]?JSON[_0xf4b3('0x6c')](_0x3f0af2[_0xf4b3('0x58')]):_0xf4b3('0x6d'));return respondWithRpcPromise(_0xf4b3('0x7c'),_0xf4b3('0x7d'),_0x27714c);}return null;})[_0xf4b3('0x21')](function(_0x121852){var _0x161a6e=_0xf4b3('0x7e')+_0x121852['message']['ContactId'];return db['sequelize'][_0xf4b3('0x43')](_0x161a6e,{'type':db[_0xf4b3('0x70')][_0xf4b3('0x71')][_0xf4b3('0x72')],'raw':!![]})['then'](function(_0x2c7dc4){return _0x2c7dc4;});})[_0xf4b3('0x21')](function(_0x2d5afa){if(_0x2d5afa){_0x27714c[_0xf4b3('0x29')][_0xf4b3('0x7f')]=_0x2d5afa[0x0];if(!_0x3f0af2[_0xf4b3('0x58')]['UserId'])return;return db[_0xf4b3('0x80')][_0xf4b3('0x66')]({'where':{'id':_0x3f0af2[_0xf4b3('0x58')][_0xf4b3('0x61')],'role':_0xf4b3('0x63')},'attributes':['id',_0xf4b3('0x50'),_0xf4b3('0x73'),_0xf4b3('0x74'),_0xf4b3('0x75')],'raw':!![]});}return null;})[_0xf4b3('0x21')](function(_0x3a2d52){if(!_0x3a2d52)return null;_0x27714c['message']['agent']=_0x3a2d52;return _0x27714c;})[_0xf4b3('0x21')](function(_0x2809b5){if(_0x2809b5){_0x2809b5[_0xf4b3('0x29')][_0xf4b3('0x76')]=util[_0xf4b3('0x5f')](_0xf4b3('0x77'),_0x3f0af2[_0xf4b3('0x62')][_0xf4b3('0x50')]);_0x2809b5['message'][_0xf4b3('0x78')]=_0x27714c[_0xf4b3('0x78')];_0x2809b5[_0xf4b3('0x29')][_0xf4b3('0x79')]=_0x27714c['channel'];_0x2809b5[_0xf4b3('0x29')][_0xf4b3('0x81')]=_0xf4b3('0x37');respondWithRpcPromise(_0xf4b3('0x7a'),_0xf4b3('0x7a'),{'event':'rejectmessage','message':_0x2809b5[_0xf4b3('0x29')]},client9002);return _0x27714c;}return null;})[_0xf4b3('0x21')](respondWithResult(_0x235496,null))['catch'](handleError(_0x235496,null));};exports[_0xf4b3('0x82')]=function(_0xc3726d,_0x344815){var _0x2b3e37;return db['FaxMessage'][_0xf4b3('0x82')](_0xc3726d['body'],{})[_0xf4b3('0x21')](function(_0x5ce585){_0x2b3e37=_0x5ce585;return db[_0xf4b3('0x83')][_0xf4b3('0x84')]({'where':{'id':_0x2b3e37[_0xf4b3('0x85')]}});})[_0xf4b3('0x21')](function(_0x2390b9){if(_[_0xf4b3('0x68')](_0x2390b9)){return;}else{_0x2b3e37[_0xf4b3('0x5c')]=_0x2390b9[_0xf4b3('0x5c')];return db['Attachment']['findOne']({'where':{'id':_0x2b3e37['AttachmentId']}});}})[_0xf4b3('0x21')](function(_0x100f0a){return respondWithRpcPromise(_0xf4b3('0x86'),'SendFax',{'FaxAccountId':_[_0xf4b3('0x68')](_0xc3726d['body'])?undefined:_0xc3726d[_0xf4b3('0x58')][_0xf4b3('0x87')],'path':_[_0xf4b3('0x68')](_0x100f0a)?undefined:util[_0xf4b3('0x5f')]('/var/opt/motion2/server/files/attachments/%s',_0x100f0a[_0xf4b3('0x88')]),'fax':_[_0xf4b3('0x68')](_0x2b3e37['fax'])?undefined:_0x2b3e37['fax'],'AttachmentId':_0x2b3e37[_0xf4b3('0x89')]},client9002);})[_0xf4b3('0x21')](respondWithResult(_0x344815,0xc9))[_0xf4b3('0x2b')](handleError(_0x344815,null));};exports[_0xf4b3('0x8a')]=function(_0x48cc8d,_0x14ed29){var _0x386c45=path[_0xf4b3('0x8b')](config[_0xf4b3('0x8c')],_0xf4b3('0x8d'),'files','attachments');return db[_0xf4b3('0x3e')][_0xf4b3('0x66')]({'where':{'id':_0x48cc8d[_0xf4b3('0x56')]['id']},'include':[{'model':db['Attachment'],'as':_0xf4b3('0x8e')}]})[_0xf4b3('0x21')](handleEntityNotFound(_0x14ed29,null))[_0xf4b3('0x21')](function(_0x3245aa){if(_0x3245aa){return _0x14ed29[_0xf4b3('0x8a')](path[_0xf4b3('0x8b')](_0x386c45,_0x3245aa['Attachment'][_0xf4b3('0x88')]));}})['catch'](handleError(_0x14ed29,null));}; \ No newline at end of file +var _0xec4e=['show','params','length','find','body','describe','read','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','email','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','info','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','QueryTypes','User','internal','SIP/%s','create','findOne','fax','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','join','server','files','download','basename','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','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','./faxMessage.socket','register','http','client','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','FaxMessage','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','rows','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec4e,0xc6));var _0xeec4=function(_0x26dd5,_0x27b03f){_0x26dd5=_0x26dd5-0x0;var _0x47efc1=_0xec4e[_0x26dd5];return _0x47efc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeec4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeec4('0x1'));var rp=require(_0xeec4('0x2'));var moment=require('moment');var BPromise=require(_0xeec4('0x3'));var Mustache=require(_0xeec4('0x4'));var util=require(_0xeec4('0x5'));var path=require(_0xeec4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeec4('0x7'));var fs=require('fs');var fs_extra=require(_0xeec4('0x8'));var _=require(_0xeec4('0x9'));var squel=require(_0xeec4('0xa'));var crypto=require('crypto');var jsforce=require(_0xeec4('0xb'));var deskjs=require(_0xeec4('0xc'));var toCsv=require(_0xeec4('0xd'));var querystring=require(_0xeec4('0xe'));var Papa=require('papaparse');var Redis=require(_0xeec4('0xf'));var authService=require(_0xeec4('0x10'));var qs=require(_0xeec4('0x11'));var as=require(_0xeec4('0x12'));var hardwareService=require(_0xeec4('0x13'));var logger=require(_0xeec4('0x14'))('api');var utils=require(_0xeec4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeec4('0x16'));var db=require('../../mysqldb')['db'];config[_0xeec4('0x17')]=_[_0xeec4('0x18')](config[_0xeec4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xeec4('0x19'))(new Redis(config[_0xeec4('0x17')]));require(_0xeec4('0x1a'))[_0xeec4('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xeec4('0x1c')]({'port':0x232c});var client9002=jayson[_0xeec4('0x1d')][_0xeec4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xd1f609,_0x2be529,_0x5739a6,_0x34e484){return new BPromise(function(_0x75534c,_0x252444){var _0x3f4257=_0x34e484||client;return _0x3f4257['request'](_0xd1f609,_0x5739a6)['then'](function(_0x4dc373){logger['info'](_0xeec4('0x1e'),_0x2be529,_0xeec4('0x1f'));logger[_0xeec4('0x20')](_0xeec4('0x21'),_0x2be529,_0xeec4('0x1f'),JSON['stringify'](_0x4dc373));if(_0x4dc373[_0xeec4('0x22')]){if(_0x4dc373[_0xeec4('0x22')]['code']===0x1f4){logger[_0xeec4('0x22')](_0xeec4('0x1e'),_0x2be529,_0x4dc373[_0xeec4('0x22')]['message']);return _0x252444(_0x4dc373['error']['message']);}logger[_0xeec4('0x22')]('FaxMessage,\x20%s,\x20%s',_0x2be529,_0x4dc373[_0xeec4('0x22')]['message']);return _0x75534c(_0x4dc373[_0xeec4('0x22')][_0xeec4('0x23')]);}else{logger['info'](_0xeec4('0x1e'),_0x2be529,'request\x20sent');_0x75534c(_0x4dc373[_0xeec4('0x24')][_0xeec4('0x23')]);}})['catch'](function(_0x40fee5){logger[_0xeec4('0x22')](_0xeec4('0x1e'),_0x2be529,_0x40fee5);_0x252444(_0x40fee5);});});}function respondWithStatusCode(_0x5e9733,_0x190f77){_0x190f77=_0x190f77||0xcc;return function(_0x33e4bd){if(_0x33e4bd){return _0x5e9733[_0xeec4('0x25')](_0x190f77);}return _0x5e9733[_0xeec4('0x26')](_0x190f77)['end']();};}function respondWithResult(_0x4b76d2,_0x4d9103){_0x4d9103=_0x4d9103||0xc8;return function(_0x561446){if(_0x561446){return _0x4b76d2[_0xeec4('0x26')](_0x4d9103)['json'](_0x561446);}};}function respondWithFilteredResult(_0x2fba93,_0x340cb9){return function(_0x40a52d){if(_0x40a52d){var _0xabfb6f=typeof _0x340cb9[_0xeec4('0x27')]===_0xeec4('0x28')&&typeof _0x340cb9[_0xeec4('0x29')]===_0xeec4('0x28');var _0x58b143=_0x40a52d[_0xeec4('0x2a')];var _0x2b25b1=_0xabfb6f?0x0:_0x340cb9[_0xeec4('0x27')];var _0x5f3567=_0xabfb6f?_0x40a52d[_0xeec4('0x2a')]:_0x340cb9[_0xeec4('0x27')]+_0x340cb9[_0xeec4('0x29')];var _0x15c553;if(_0x5f3567>=_0x58b143){_0x5f3567=_0x58b143;_0x15c553=0xc8;}else{_0x15c553=0xce;}_0x2fba93[_0xeec4('0x26')](_0x15c553);return _0x2fba93['set'](_0xeec4('0x2b'),_0x2b25b1+'-'+_0x5f3567+'/'+_0x58b143)[_0xeec4('0x2c')](_0x40a52d);}return null;};}function patchUpdates(_0x494a40){return function(_0x7da8d4){try{jsonpatch[_0xeec4('0x2d')](_0x7da8d4,_0x494a40,!![]);}catch(_0x10e837){return BPromise['reject'](_0x10e837);}return _0x7da8d4[_0xeec4('0x2e')]();};}function saveUpdates(_0x34eda1,_0x4b32dc){return function(_0x3ed5a4){if(_0x3ed5a4){return _0x3ed5a4[_0xeec4('0x2f')](_0x34eda1)[_0xeec4('0x30')](function(_0x408f80){return _0x408f80;});}return null;};}function removeEntity(_0x3bc961,_0x58676e){return function(_0x5c10ee){if(_0x5c10ee){return _0x5c10ee[_0xeec4('0x31')]()['then'](function(){_0x3bc961[_0xeec4('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47adc4,_0x6941dc){return function(_0x10fa2c){if(!_0x10fa2c){_0x47adc4['sendStatus'](0x194);}return _0x10fa2c;};}function handleError(_0x5b24ce,_0x26261c){_0x26261c=_0x26261c||0x1f4;return function(_0x5e2087){logger['error'](_0x5e2087[_0xeec4('0x32')]);if(_0x5e2087[_0xeec4('0x33')]){delete _0x5e2087[_0xeec4('0x33')];}_0x5b24ce[_0xeec4('0x26')](_0x26261c)[_0xeec4('0x34')](_0x5e2087);};}exports[_0xeec4('0x35')]=function(_0x6c4471,_0x850e2f){var _0x476dbc={},_0x12d4ac={},_0x5528f9={'count':0x0,'rows':[]};var _0x518627=_['map'](db[_0xeec4('0x36')][_0xeec4('0x37')],function(_0x446b31){return{'name':_0x446b31[_0xeec4('0x38')],'type':_0x446b31['type'][_0xeec4('0x39')]};});_0x12d4ac[_0xeec4('0x3a')]=_[_0xeec4('0x3b')](_0x518627,_0xeec4('0x33'));_0x12d4ac[_0xeec4('0x3c')]=_[_0xeec4('0x3d')](_0x6c4471[_0xeec4('0x3c')]);_0x12d4ac['filters']=_['intersection'](_0x12d4ac[_0xeec4('0x3a')],_0x12d4ac[_0xeec4('0x3c')]);_0x476dbc[_0xeec4('0x3e')]=_[_0xeec4('0x3f')](_0x12d4ac[_0xeec4('0x3a')],qs[_0xeec4('0x40')](_0x6c4471['query'][_0xeec4('0x40')]));_0x476dbc['attributes']=_0x476dbc[_0xeec4('0x3e')]['length']?_0x476dbc[_0xeec4('0x3e')]:_0x12d4ac[_0xeec4('0x3a')];if(!_0x6c4471['query'][_0xeec4('0x41')](_0xeec4('0x42'))){_0x476dbc['limit']=qs[_0xeec4('0x29')](_0x6c4471[_0xeec4('0x3c')][_0xeec4('0x29')]);_0x476dbc[_0xeec4('0x27')]=qs[_0xeec4('0x27')](_0x6c4471[_0xeec4('0x3c')][_0xeec4('0x27')]);}_0x476dbc[_0xeec4('0x43')]=qs[_0xeec4('0x44')](_0x6c4471[_0xeec4('0x3c')]['sort']);_0x476dbc[_0xeec4('0x45')]=qs[_0xeec4('0x46')](_[_0xeec4('0x47')](_0x6c4471['query'],_0x12d4ac[_0xeec4('0x46')]),_0x518627);if(_0x6c4471[_0xeec4('0x3c')][_0xeec4('0x48')]){_0x476dbc['where']=_[_0xeec4('0x49')](_0x476dbc[_0xeec4('0x45')],{'$or':_[_0xeec4('0x3b')](_0x518627,function(_0x4a3122){if(_0x4a3122[_0xeec4('0x4a')]!=='VIRTUAL'){var _0x4aaf5c={};_0x4aaf5c[_0x4a3122[_0xeec4('0x33')]]={'$like':'%'+_0x6c4471[_0xeec4('0x3c')][_0xeec4('0x48')]+'%'};return _0x4aaf5c;}})});}_0x476dbc=_[_0xeec4('0x49')]({},_0x476dbc,_0x6c4471[_0xeec4('0x4b')]);var _0x79892b={'where':_0x476dbc[_0xeec4('0x45')]};return db[_0xeec4('0x36')]['count'](_0x79892b)[_0xeec4('0x30')](function(_0x59c1ad){_0x5528f9[_0xeec4('0x2a')]=_0x59c1ad;if(_0x6c4471[_0xeec4('0x3c')][_0xeec4('0x4c')]){_0x476dbc[_0xeec4('0x4d')]=[{'all':!![]}];}return db[_0xeec4('0x36')]['findAll'](_0x476dbc);})[_0xeec4('0x30')](function(_0x2e8278){_0x5528f9[_0xeec4('0x4e')]=_0x2e8278;return _0x5528f9;})[_0xeec4('0x30')](respondWithFilteredResult(_0x850e2f,_0x476dbc))[_0xeec4('0x4f')](handleError(_0x850e2f,null));};exports[_0xeec4('0x50')]=function(_0x40d15a,_0x4cc16b){var _0xeb06bd={'raw':!![],'where':{'id':_0x40d15a[_0xeec4('0x51')]['id']}},_0x17e4e8={};_0x17e4e8['model']=_['keys'](db[_0xeec4('0x36')][_0xeec4('0x37')]);_0x17e4e8['query']=_[_0xeec4('0x3d')](_0x40d15a[_0xeec4('0x3c')]);_0x17e4e8[_0xeec4('0x46')]=_[_0xeec4('0x3f')](_0x17e4e8['model'],_0x17e4e8[_0xeec4('0x3c')]);_0xeb06bd[_0xeec4('0x3e')]=_['intersection'](_0x17e4e8['model'],qs[_0xeec4('0x40')](_0x40d15a[_0xeec4('0x3c')]['fields']));_0xeb06bd[_0xeec4('0x3e')]=_0xeb06bd[_0xeec4('0x3e')][_0xeec4('0x52')]?_0xeb06bd['attributes']:_0x17e4e8[_0xeec4('0x3a')];if(_0x40d15a['query']['includeAll']){_0xeb06bd[_0xeec4('0x4d')]=[{'all':!![]}];}_0xeb06bd=_[_0xeec4('0x49')]({},_0xeb06bd,_0x40d15a[_0xeec4('0x4b')]);return db[_0xeec4('0x36')][_0xeec4('0x53')](_0xeb06bd)[_0xeec4('0x30')](handleEntityNotFound(_0x4cc16b,null))[_0xeec4('0x30')](respondWithResult(_0x4cc16b,null))['catch'](handleError(_0x4cc16b,null));};exports[_0xeec4('0x2f')]=function(_0x3d6bbc,_0x18e114){if(_0x3d6bbc[_0xeec4('0x54')]['id']){delete _0x3d6bbc[_0xeec4('0x54')]['id'];}return db[_0xeec4('0x36')][_0xeec4('0x53')]({'where':{'id':_0x3d6bbc[_0xeec4('0x51')]['id']}})[_0xeec4('0x30')](handleEntityNotFound(_0x18e114,null))[_0xeec4('0x30')](saveUpdates(_0x3d6bbc['body'],null))[_0xeec4('0x30')](respondWithResult(_0x18e114,null))[_0xeec4('0x4f')](handleError(_0x18e114,null));};exports[_0xeec4('0x31')]=function(_0x1c20b2,_0x1f899c){return db['FaxMessage']['find']({'where':{'id':_0x1c20b2[_0xeec4('0x51')]['id']}})[_0xeec4('0x30')](handleEntityNotFound(_0x1f899c,null))[_0xeec4('0x30')](removeEntity(_0x1f899c,null))['catch'](handleError(_0x1f899c,null));};exports[_0xeec4('0x55')]=function(_0x3a26d6,_0x1043f2){return db[_0xeec4('0x36')][_0xeec4('0x55')]()['then'](respondWithResult(_0x1043f2,null))[_0xeec4('0x4f')](handleError(_0x1043f2,null));};var interaction_log=require(_0xeec4('0x14'))('fax-interactions');exports['accept']=function(_0x1130a0,_0x1c4bbb,_0x5c49ce){var _0x4876e0={'agent':{},'channel':'fax'};if(_0x1130a0[_0xeec4('0x54')]['id']){delete _0x1130a0[_0xeec4('0x54')]['id'];}_0x1130a0[_0xeec4('0x54')][_0xeec4('0x56')]=!![];_0x1130a0[_0xeec4('0x54')]['readAt']=moment()[_0xeec4('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1130a0[_0xeec4('0x54')][_0xeec4('0x58')]=_0x1130a0['body'][_0xeec4('0x58')]||_0x1130a0[_0xeec4('0x59')]['id'];_0x4876e0[_0xeec4('0x5a')]['id']=_0x1130a0[_0xeec4('0x54')][_0xeec4('0x58')];return db[_0xeec4('0x36')]['find']({'where':{'id':_0x1130a0[_0xeec4('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1c4bbb,null))['then'](saveUpdates(_0x1130a0['body'],null))[_0xeec4('0x30')](function(_0x1df779){if(_0x1df779){_0x4876e0[_0xeec4('0x23')]=_0x1df779[_0xeec4('0x5b')]({'plain':!![]});return db[_0xeec4('0x5c')]['find']({'where':{'id':_0x1df779[_0xeec4('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x1c4bbb,null))['then'](function(_0x4e2ae2){if(_0x4e2ae2){return _0x4e2ae2[_0xeec4('0x2f')]({'UserId':_0x1130a0[_0xeec4('0x54')][_0xeec4('0x58')],'read1stAt':_[_0xeec4('0x5e')](_0x4e2ae2[_0xeec4('0x5f')])?moment()[_0xeec4('0x57')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeec4('0x30')](function(_0x2829c0){if(_0x2829c0){_0x4876e0[_0xeec4('0x60')]=_0x2829c0[_0xeec4('0x5b')]({'plain':!![]});interaction_log['info'](_0xeec4('0x61'),_0x1130a0[_0xeec4('0x59')]['id'],_0x1130a0['user'][_0xeec4('0x33')],_0x1130a0[_0xeec4('0x59')][_0xeec4('0x62')],_0x4876e0[_0xeec4('0x60')]['id'],_0x1130a0[_0xeec4('0x54')]?JSON[_0xeec4('0x63')](_0x1130a0['body']):_0xeec4('0x64'));return respondWithRpcPromise(_0xeec4('0x65'),_0xeec4('0x66'),_0x4876e0);}return null;})[_0xeec4('0x30')](function(_0x532175){var _0x3b6826=_0xeec4('0x67')+_0x532175[_0xeec4('0x23')][_0xeec4('0x68')];return db['sequelize'][_0xeec4('0x3c')](_0x3b6826,{'type':db[_0xeec4('0x69')]['QueryTypes'][_0xeec4('0x6a')],'raw':!![]})[_0xeec4('0x30')](function(_0x391a28){return _0x391a28;});})[_0xeec4('0x30')](function(_0x2a348d){if(_0x2a348d){_0x4876e0[_0xeec4('0x23')][_0xeec4('0x6b')]=_0x2a348d[0x0];if(!_0x1130a0['body'][_0xeec4('0x58')])return;return db['User'][_0xeec4('0x53')]({'where':{'id':_0x1130a0[_0xeec4('0x54')][_0xeec4('0x58')],'role':_0xeec4('0x5a')},'attributes':['id','name',_0xeec4('0x6c'),_0xeec4('0x6d'),'internal'],'raw':!![]});}return null;})[_0xeec4('0x30')](function(_0xfdc463){if(!_0xfdc463)return null;_0x4876e0[_0xeec4('0x23')][_0xeec4('0x5a')]=_0xfdc463;return _0x4876e0;})[_0xeec4('0x30')](function(_0x3a84dc){if(_0x3a84dc){if(_0x1130a0[_0xeec4('0x54')][_0xeec4('0x6e')]){_0x4876e0[_0xeec4('0x23')][_0xeec4('0x6f')]=util[_0xeec4('0x57')]('SIP/%s',_0x1130a0['user']['name']);_0x4876e0[_0xeec4('0x23')][_0xeec4('0x70')]=_0x4876e0[_0xeec4('0x70')];_0x4876e0['message'][_0xeec4('0x71')]=_0x4876e0[_0xeec4('0x70')];_0x4876e0[_0xeec4('0x23')][_0xeec4('0x72')]=_0xeec4('0x73');return respondWithRpcPromise(_0xeec4('0x74'),_0xeec4('0x74'),{'event':_0xeec4('0x75'),'message':_0x4876e0[_0xeec4('0x23')]},client9002)['then'](function(){return _0x4876e0;});}return _0x4876e0;}return null;})[_0xeec4('0x30')](respondWithResult(_0x1c4bbb,null))[_0xeec4('0x4f')](handleError(_0x1c4bbb,null));};var interaction_log=require(_0xeec4('0x14'))('fax-interactions');exports[_0xeec4('0x76')]=function(_0x15c84d,_0x2fa662,_0x25fda9){var _0x1b771f={'agent':{},'channel':'fax'};if(_0x15c84d['body']['id']){delete _0x15c84d['body']['id'];}_0x15c84d['body']['UserId']=_0x15c84d[_0xeec4('0x54')][_0xeec4('0x58')]||_0x15c84d[_0xeec4('0x59')]['id'];_0x1b771f[_0xeec4('0x5a')]['id']=_0x15c84d[_0xeec4('0x54')][_0xeec4('0x58')];return db['FaxMessage'][_0xeec4('0x53')]({'where':{'id':_0x15c84d[_0xeec4('0x51')]['id'],'UserId':null}})[_0xeec4('0x30')](handleEntityNotFound(_0x2fa662,null))[_0xeec4('0x30')](function(_0x57e049){if(_0x57e049){_0x1b771f[_0xeec4('0x23')]=_0x57e049[_0xeec4('0x5b')]({'plain':!![]});return db['FaxInteraction'][_0xeec4('0x53')]({'where':{'id':_0x57e049['FaxInteractionId']}});}return null;})[_0xeec4('0x30')](handleEntityNotFound(_0x2fa662,null))[_0xeec4('0x30')](function(_0x53ea36){if(_0x53ea36){_0x1b771f[_0xeec4('0x60')]=_0x53ea36['get']({'plain':!![]});interaction_log[_0xeec4('0x77')](_0xeec4('0x78'),_0x15c84d[_0xeec4('0x59')]['id'],_0x15c84d[_0xeec4('0x59')][_0xeec4('0x33')],_0x15c84d[_0xeec4('0x59')][_0xeec4('0x62')],_0x1b771f[_0xeec4('0x60')]['id'],_0x15c84d[_0xeec4('0x54')]?JSON[_0xeec4('0x63')](_0x15c84d[_0xeec4('0x54')]):_0xeec4('0x64'));return respondWithRpcPromise(_0xeec4('0x79'),'rejectMessage',_0x1b771f);}return null;})['then'](function(_0x2bd980){var _0xf5bfe2=_0xeec4('0x67')+_0x2bd980[_0xeec4('0x23')][_0xeec4('0x68')];return db[_0xeec4('0x7a')][_0xeec4('0x3c')](_0xf5bfe2,{'type':db[_0xeec4('0x69')][_0xeec4('0x7b')][_0xeec4('0x6a')],'raw':!![]})[_0xeec4('0x30')](function(_0x6ff882){return _0x6ff882;});})[_0xeec4('0x30')](function(_0x36e8f){if(_0x36e8f){_0x1b771f[_0xeec4('0x23')][_0xeec4('0x6b')]=_0x36e8f[0x0];if(!_0x15c84d[_0xeec4('0x54')][_0xeec4('0x58')])return;return db[_0xeec4('0x7c')]['find']({'where':{'id':_0x15c84d[_0xeec4('0x54')][_0xeec4('0x58')],'role':'agent'},'attributes':['id',_0xeec4('0x33'),_0xeec4('0x6c'),_0xeec4('0x6d'),_0xeec4('0x7d')],'raw':!![]});}return null;})[_0xeec4('0x30')](function(_0x3fbf68){if(!_0x3fbf68)return null;_0x1b771f[_0xeec4('0x23')][_0xeec4('0x5a')]=_0x3fbf68;return _0x1b771f;})['then'](function(_0x2dfd75){if(_0x2dfd75){_0x2dfd75[_0xeec4('0x23')][_0xeec4('0x6f')]=util[_0xeec4('0x57')](_0xeec4('0x7e'),_0x15c84d['user']['name']);_0x2dfd75[_0xeec4('0x23')][_0xeec4('0x70')]=_0x1b771f['channel'];_0x2dfd75['message']['motionChannel']=_0x1b771f[_0xeec4('0x70')];_0x2dfd75['message']['event']=_0xeec4('0x76');respondWithRpcPromise(_0xeec4('0x74'),_0xeec4('0x74'),{'event':'rejectmessage','message':_0x2dfd75[_0xeec4('0x23')]},client9002);return _0x1b771f;}return null;})['then'](respondWithResult(_0x2fa662,null))[_0xeec4('0x4f')](handleError(_0x2fa662,null));};exports['create']=function(_0x17ec0e,_0x2edb79){var _0xbfba46;return db[_0xeec4('0x36')][_0xeec4('0x7f')](_0x17ec0e[_0xeec4('0x54')],{})[_0xeec4('0x30')](function(_0x3e0b51){_0xbfba46=_0x3e0b51;return db['CmContact'][_0xeec4('0x80')]({'where':{'id':_0xbfba46[_0xeec4('0x68')]}});})[_0xeec4('0x30')](function(_0x130adb){if(_[_0xeec4('0x5e')](_0x130adb)){return;}else{_0xbfba46[_0xeec4('0x81')]=_0x130adb[_0xeec4('0x81')];return db[_0xeec4('0x82')][_0xeec4('0x80')]({'where':{'id':_0xbfba46[_0xeec4('0x83')]}});}})[_0xeec4('0x30')](function(_0x3df323){return respondWithRpcPromise(_0xeec4('0x84'),_0xeec4('0x84'),{'FaxAccountId':_[_0xeec4('0x5e')](_0x17ec0e['body'])?undefined:_0x17ec0e[_0xeec4('0x54')]['FaxAccountId'],'path':_[_0xeec4('0x5e')](_0x3df323)?undefined:util[_0xeec4('0x57')](_0xeec4('0x85'),_0x3df323['basename']),'fax':_['isNil'](_0xbfba46[_0xeec4('0x81')])?undefined:_0xbfba46[_0xeec4('0x81')],'AttachmentId':_0xbfba46[_0xeec4('0x83')]},client9002);})[_0xeec4('0x30')](respondWithResult(_0x2edb79,0xc9))[_0xeec4('0x4f')](handleError(_0x2edb79,null));};exports['download']=function(_0x1e9395,_0x5af54b){var _0x144da7=path[_0xeec4('0x86')](config['root'],_0xeec4('0x87'),_0xeec4('0x88'),'attachments');return db['FaxMessage'][_0xeec4('0x53')]({'where':{'id':_0x1e9395[_0xeec4('0x51')]['id']},'include':[{'model':db[_0xeec4('0x82')],'as':_0xeec4('0x82')}]})[_0xeec4('0x30')](handleEntityNotFound(_0x5af54b,null))[_0xeec4('0x30')](function(_0xfb4b88){if(_0xfb4b88){return _0x5af54b[_0xeec4('0x89')](path[_0xeec4('0x86')](_0x144da7,_0xfb4b88[_0xeec4('0x82')][_0xeec4('0x8a')]));}})[_0xeec4('0x4f')](handleError(_0x5af54b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index c1d75af..859f53d 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 _0xaa37=['../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1c9721,_0x3f83a4){var _0x5b1a4c=function(_0x44f048){while(--_0x44f048){_0x1c9721['push'](_0x1c9721['shift']());}};_0x5b1a4c(++_0x3f83a4);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaa37[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x7aa3('0x0'));var FaxMessage=require(_0x7aa3('0x1'))['db'][_0x7aa3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7aa3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7aa3('0x4'),'afterDestroy':_0x7aa3('0x5')};function emitEvent(_0x27333d){return function(_0x11e64c,_0x334919,_0x2801a2){FaxMessageEvents[_0x7aa3('0x6')](_0x27333d+':'+_0x11e64c['id'],_0x11e64c);FaxMessageEvents['emit'](_0x27333d,_0x11e64c);_0x2801a2(null);};}for(var e in events){if(events[_0x7aa3('0x7')](e)){var event=events[e];FaxMessage[_0x7aa3('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x9aac=['hook','events','FaxMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xbcbd76,_0x25722b){var _0x503680=function(_0x163649){while(--_0x163649){_0xbcbd76['push'](_0xbcbd76['shift']());}};_0x503680(++_0x25722b);}(_0x9aac,0x135));var _0xc9aa=function(_0xe30d11,_0x3fa953){_0xe30d11=_0xe30d11-0x0;var _0x52b314=_0x9aac[_0xe30d11];return _0x52b314;};'use strict';var EventEmitter=require(_0xc9aa('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xc9aa('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc9aa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9aa('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8ca086){return function(_0x5c8ce2,_0x28c49c,_0x267772){FaxMessageEvents['emit'](_0x8ca086+':'+_0x5c8ce2['id'],_0x5c8ce2);FaxMessageEvents[_0xc9aa('0x4')](_0x8ca086,_0x5c8ce2);_0x267772(null);};}for(var e in events){if(events[_0xc9aa('0x5')](e)){var event=events[e];FaxMessage[_0xc9aa('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index f871396..601756d 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 _0x1679=['models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','FULLTEXT'];(function(_0x2c803a,_0x5722fc){var _0x28e9fb=function(_0x8e9c21){while(--_0x8e9c21){_0x2c803a['push'](_0x2c803a['shift']());}};_0x28e9fb(++_0x5722fc);}(_0x1679,0xff));var _0x9167=function(_0x4dbd6b,_0x19ab95){_0x4dbd6b=_0x4dbd6b-0x0;var _0x2024a9=_0x1679[_0x4dbd6b];return _0x2024a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9167('0x0'))(_0x9167('0x1'));var moment=require(_0x9167('0x2'));var BPromise=require(_0x9167('0x3'));var rp=require(_0x9167('0x4'));var fs=require('fs');var path=require(_0x9167('0x5'));var rimraf=require('rimraf');var config=require(_0x9167('0x6'));var attributes=require('./faxMessage.attributes');module[_0x9167('0x7')]=function(_0x52b8bf,_0x5b15e7){return _0x52b8bf['define']('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x9167('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56c5ce,_0x3f9a73,_0x493aff){var _0x2947eb=_0x52b8bf[_0x9167('0x9')];var _0x59e4d7=_0x56c5ce[_0x9167('0xa')]({'plain':!![]});if(_0x59e4d7[_0x9167('0xb')]['toLowerCase']()==='in'||_0x59e4d7[_0x9167('0xb')][_0x9167('0xc')]()===_0x9167('0xd')&&!_0x59e4d7[_0x9167('0xe')]&&!_[_0x9167('0xf')](_0x59e4d7[_0x9167('0x10')])){_0x2947eb['FaxInteraction']['findOne']({'where':{'id':_0x59e4d7[_0x9167('0x11')]}})[_0x9167('0x12')](function(_0x1591ce){if(_0x1591ce){_0x1591ce[_0x9167('0x13')]({'lastMsgAt':_0x59e4d7[_0x9167('0x14')],'lastMsgDirection':_0x59e4d7[_0x9167('0xb')]['toLowerCase']()});}})['catch'](function(_0x332a09){console['error'](_0x332a09);});}_0x493aff();}},'charset':'utf8mb4','collate':_0x9167('0x15')});}; \ No newline at end of file +var _0xed49=['secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','lodash','util','moment','request-promise','path','rimraf','exports','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x2606f4,_0x7b0faa){var _0x27e501=function(_0x3e7833){while(--_0x3e7833){_0x2606f4['push'](_0x2606f4['shift']());}};_0x27e501(++_0x7b0faa);}(_0xed49,0x86));var _0x9ed4=function(_0x46a662,_0xd89d56){_0x46a662=_0x46a662-0x0;var _0x3c6982=_0xed49[_0x46a662];return _0x3c6982;};'use strict';var _=require(_0x9ed4('0x0'));var util=require(_0x9ed4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9ed4('0x2'));var BPromise=require('bluebird');var rp=require(_0x9ed4('0x3'));var fs=require('fs');var path=require(_0x9ed4('0x4'));var rimraf=require(_0x9ed4('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x9ed4('0x6')]=function(_0x457ca8,_0xe8b65b){return _0x457ca8['define']('FaxMessage',attributes,{'tableName':_0x9ed4('0x7'),'paranoid':![],'indexes':[{'name':_0x9ed4('0x8'),'fields':[_0x9ed4('0x9')],'type':_0x9ed4('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x553afd,_0x33ab33,_0xf644b8){var _0x5b4208=_0x457ca8[_0x9ed4('0xb')];var _0x3c83e3=_0x553afd[_0x9ed4('0xc')]({'plain':!![]});if(_0x3c83e3[_0x9ed4('0xd')][_0x9ed4('0xe')]()==='in'||_0x3c83e3[_0x9ed4('0xd')][_0x9ed4('0xe')]()===_0x9ed4('0xf')&&!_0x3c83e3[_0x9ed4('0x10')]&&!_[_0x9ed4('0x11')](_0x3c83e3[_0x9ed4('0x12')])){_0x5b4208[_0x9ed4('0x13')][_0x9ed4('0x14')]({'where':{'id':_0x3c83e3[_0x9ed4('0x15')]}})[_0x9ed4('0x16')](function(_0x383542){if(_0x383542){_0x383542[_0x9ed4('0x17')]({'lastMsgAt':_0x3c83e3['createdAt'],'lastMsgDirection':_0x3c83e3[_0x9ed4('0xd')][_0x9ed4('0xe')]()});}})[_0x9ed4('0x18')](function(_0x1b7386){console['error'](_0x1b7386);});}_0xf644b8();}},'charset':'utf8mb4','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 1dd63cf..a8e4ce0 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 _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x21482b,_0x3a8966){var _0x19235d=function(_0x56c2c2){while(--_0x56c2c2){_0x21482b['push'](_0x21482b['shift']());}};_0x19235d(++_0x3a8966);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0x4b84[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});}; \ No newline at end of file +var _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7bae[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e69fac5..ca3b2ab 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 _0xa107=['save','remove','update','emit','removeListener','register','length','./faxMessage.events'];(function(_0x49ebed,_0x2ed245){var _0x247194=function(_0x5384b9){while(--_0x5384b9){_0x49ebed['push'](_0x49ebed['shift']());}};_0x247194(++_0x2ed245);}(_0xa107,0x177));var _0x7a10=function(_0x1a0517,_0x1da755){_0x1a0517=_0x1a0517-0x0;var _0x2e71cd=_0xa107[_0x1a0517];return _0x2e71cd;};'use strict';var FaxMessageEvents=require(_0x7a10('0x0'));var events=[_0x7a10('0x1'),_0x7a10('0x2'),_0x7a10('0x3')];function createListener(_0x5e63c9,_0x141399){return function(_0x2aef1e){_0x141399[_0x7a10('0x4')](_0x5e63c9,_0x2aef1e);};}function removeListener(_0xb97f06,_0x587f81){return function(){FaxMessageEvents[_0x7a10('0x5')](_0xb97f06,_0x587f81);};}exports[_0x7a10('0x6')]=function(_0xbf41e3){for(var _0x3174b6=0x0,_0x2c76c9=events[_0x7a10('0x7')];_0x3174b6<_0x2c76c9;_0x3174b6++){var _0x4efd1d=events[_0x3174b6];var _0x39084f=createListener('faxMessage:'+_0x4efd1d,_0xbf41e3);FaxMessageEvents['on'](_0x4efd1d,_0x39084f);}}; \ No newline at end of file +var _0x3a87=['faxMessage:','./faxMessage.events','remove','update','emit','removeListener','length'];(function(_0x3546ed,_0x4a7c9d){var _0x27a61a=function(_0x3d1790){while(--_0x3d1790){_0x3546ed['push'](_0x3546ed['shift']());}};_0x27a61a(++_0x4a7c9d);}(_0x3a87,0xfd));var _0x73a8=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x3a87[_0x3da72b];return _0xc64ac4;};'use strict';var FaxMessageEvents=require(_0x73a8('0x0'));var events=['save',_0x73a8('0x1'),_0x73a8('0x2')];function createListener(_0x40376a,_0x79f8f4){return function(_0x22ce88){_0x79f8f4[_0x73a8('0x3')](_0x40376a,_0x22ce88);};}function removeListener(_0xe7167f,_0xc5505b){return function(){FaxMessageEvents[_0x73a8('0x4')](_0xe7167f,_0xc5505b);};}exports['register']=function(_0x1528ce){for(var _0x5755bd=0x0,_0x5763d8=events[_0x73a8('0x5')];_0x5755bd<_0x5763d8;_0x5755bd++){var _0x5dff7b=events[_0x5755bd];var _0x3a4f01=createListener(_0x73a8('0x6')+_0x5dff7b,_0x1528ce);FaxMessageEvents['on'](_0x5dff7b,_0x3a4f01);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d5c4952..b926c07 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 _0xde2c=['/describe','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x147a8e,_0x17a1a0){var _0x12c13e=function(_0x22a009){while(--_0x22a009){_0x147a8e['push'](_0x147a8e['shift']());}};_0x12c13e(++_0x17a1a0);}(_0xde2c,0x7f));var _0xcde2=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0xde2c[_0x328534];return _0x2796c0;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xcde2('0x13'),_0xcde2('0x14')),controller[_0xcde2('0x15')]);router[_0xcde2('0x16')](_0xcde2('0x17'),auth[_0xcde2('0xb')](),controller['update']);router[_0xcde2('0x16')]('/:id/accept',auth[_0xcde2('0xb')](),controller['accept']);router['put'](_0xcde2('0x18'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x19')]);router[_0xcde2('0x1a')](_0xcde2('0x17'),auth['isAuthenticated'](),controller[_0xcde2('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3140=['download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0xd440ab,_0x4cfdd5){var _0x4f707f=function(_0x16b930){while(--_0x16b930){_0xd440ab['push'](_0xd440ab['shift']());}};_0x4f707f(++_0x4cfdd5);}(_0x3140,0xaf));var _0x0314=function(_0xbc13e1,_0x14d88b){_0xbc13e1=_0xbc13e1-0x0;var _0xa87f5a=_0x3140[_0xbc13e1];return _0xa87f5a;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['describe']);router[_0x0314('0x9')](_0x0314('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0314('0x9')]('/:id/download',auth[_0x0314('0xa')](),controller[_0x0314('0xe')]);router[_0x0314('0xf')]('/',auth[_0x0314('0xa')](),interaction[_0x0314('0x10')](_0x0314('0x11'),'faxmessage:create'),controller[_0x0314('0x12')]);router[_0x0314('0x13')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller[_0x0314('0x14')]);router[_0x0314('0x13')](_0x0314('0x15'),auth['isAuthenticated'](),controller[_0x0314('0x16')]);router[_0x0314('0x13')](_0x0314('0x17'),auth[_0x0314('0xa')](),controller[_0x0314('0x18')]);router[_0x0314('0x19')](_0x0314('0xd'),auth[_0x0314('0xa')](),controller['destroy']);module[_0x0314('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 330be37..cbef5ea 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 _0x6b4a=['exports','STRING','name','ENUM','rrmemory','roundrobin','INTEGER','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6b4a,0x147));var _0xa6b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b4a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa6b4('0x0'));module[_0xa6b4('0x1')]={'name':{'type':Sequelize[_0xa6b4('0x2')],'unique':_0xa6b4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa6b4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa6b4('0x4')](_0xa6b4('0x5'),'beepall',_0xa6b4('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa6b4('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d5d=['ENUM','rrmemory','roundrobin','exports','STRING','INTEGER'];(function(_0x45ac0c,_0x2f8a58){var _0x4b4074=function(_0x1ddc53){while(--_0x1ddc53){_0x45ac0c['push'](_0x45ac0c['shift']());}};_0x4b4074(++_0x2f8a58);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x162572,_0x472ee0){_0x162572=_0x162572-0x0;var _0x31efcf=_0x7d5d[_0x162572];return _0x31efcf;};'use strict';var Sequelize=require('sequelize');module[_0xd7d5('0x0')]={'name':{'type':Sequelize[_0xd7d5('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd7d5('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd7d5('0x3')](_0xd7d5('0x4'),'beepall',_0xd7d5('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xd7d5('0x2')],'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 f309c06..41ca256 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 _0x11dd=['emit','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','FaxQueue','findAll','rows','catch','params','include','create','body','role','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','keys','order','FaxQueueId','options','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','faxPause','createdAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each'];(function(_0x1caabc,_0x4fc375){var _0x403e38=function(_0x3aaa89){while(--_0x3aaa89){_0x1caabc['push'](_0x1caabc['shift']());}};_0x403e38(++_0x4fc375);}(_0x11dd,0x139));var _0xd11d=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x11dd[_0x386c3e];return _0x4b8e13;};'use strict';var emlformat=require(_0xd11d('0x0'));var rimraf=require(_0xd11d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd11d('0x2'));var rp=require(_0xd11d('0x3'));var moment=require(_0xd11d('0x4'));var BPromise=require(_0xd11d('0x5'));var Mustache=require(_0xd11d('0x6'));var util=require(_0xd11d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd11d('0x8'));var ejs=require(_0xd11d('0x9'));var fs=require('fs');var fs_extra=require(_0xd11d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd11d('0xb'));var deskjs=require(_0xd11d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd11d('0xd'));var Papa=require(_0xd11d('0xe'));var Redis=require(_0xd11d('0xf'));var authService=require(_0xd11d('0x10'));var qs=require(_0xd11d('0x11'));var as=require(_0xd11d('0x12'));var hardwareService=require(_0xd11d('0x13'));var logger=require(_0xd11d('0x14'))(_0xd11d('0x15'));var utils=require(_0xd11d('0x16'));var config=require(_0xd11d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd11d('0x18')]=_[_0xd11d('0x19')](config[_0xd11d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd11d('0x1a'))(new Redis(config[_0xd11d('0x18')]));require(_0xd11d('0x1b'))[_0xd11d('0x1c')](socket);function respondWithStatusCode(_0x459817,_0x266341){_0x266341=_0x266341||0xcc;return function(_0x5adf9b){if(_0x5adf9b){return _0x459817[_0xd11d('0x1d')](_0x266341);}return _0x459817[_0xd11d('0x1e')](_0x266341)['end']();};}function respondWithResult(_0x310a8d,_0x5e3422){_0x5e3422=_0x5e3422||0xc8;return function(_0x15a1aa){if(_0x15a1aa){return _0x310a8d[_0xd11d('0x1e')](_0x5e3422)[_0xd11d('0x1f')](_0x15a1aa);}};}function respondWithFilteredResult(_0x4bf005,_0x496f82){return function(_0x1ab195){if(_0x1ab195){var _0x5c4ad7=typeof _0x496f82[_0xd11d('0x20')]===_0xd11d('0x21')&&typeof _0x496f82[_0xd11d('0x22')]===_0xd11d('0x21');var _0x836fc3=_0x1ab195[_0xd11d('0x23')];var _0x5b7777=_0x5c4ad7?0x0:_0x496f82[_0xd11d('0x20')];var _0x51568c=_0x5c4ad7?_0x1ab195[_0xd11d('0x23')]:_0x496f82['offset']+_0x496f82[_0xd11d('0x22')];var _0x779e3f;if(_0x51568c>=_0x836fc3){_0x51568c=_0x836fc3;_0x779e3f=0xc8;}else{_0x779e3f=0xce;}_0x4bf005[_0xd11d('0x1e')](_0x779e3f);return _0x4bf005[_0xd11d('0x24')](_0xd11d('0x25'),_0x5b7777+'-'+_0x51568c+'/'+_0x836fc3)[_0xd11d('0x1f')](_0x1ab195);}return null;};}function patchUpdates(_0x5e9fef){return function(_0x3b7303){try{jsonpatch[_0xd11d('0x26')](_0x3b7303,_0x5e9fef,!![]);}catch(_0x402c71){return BPromise[_0xd11d('0x27')](_0x402c71);}return _0x3b7303[_0xd11d('0x28')]();};}function saveUpdates(_0x3a3678,_0x9578a4){return function(_0x427ee0){if(_0x427ee0){return _0x427ee0[_0xd11d('0x29')](_0x3a3678)['then'](function(_0x292a05){return _0x292a05;});}return null;};}function removeEntity(_0x38c205,_0x1f9fb9){return function(_0x5b5d5a){if(_0x5b5d5a){return _0x5b5d5a[_0xd11d('0x2a')]()[_0xd11d('0x2b')](function(){var _0xbca489=_0x5b5d5a['get']({'plain':!![]});var _0x419629=_0xd11d('0x2c');return db[_0xd11d('0x2d')]['destroy']({'where':{'type':_0x419629,'resourceId':_0xbca489['id']}})[_0xd11d('0x2b')](function(){return _0x5b5d5a;});})['then'](function(){_0x38c205[_0xd11d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24737b,_0x4697c4){return function(_0xacf540){if(!_0xacf540){_0x24737b[_0xd11d('0x1d')](0x194);}return _0xacf540;};}function handleError(_0x2f49ea,_0x4eb9c8){_0x4eb9c8=_0x4eb9c8||0x1f4;return function(_0x28c898){logger[_0xd11d('0x2e')](_0x28c898[_0xd11d('0x2f')]);if(_0x28c898[_0xd11d('0x30')]){delete _0x28c898[_0xd11d('0x30')];}_0x2f49ea[_0xd11d('0x1e')](_0x4eb9c8)['send'](_0x28c898);};}exports[_0xd11d('0x31')]=function(_0x484081,_0x4681a0){var _0x190087={},_0x40d7ed={},_0xfec29a={'count':0x0,'rows':[]};var _0x5dfa64=_[_0xd11d('0x32')](db['FaxQueue'][_0xd11d('0x33')],function(_0x5e81e3){return{'name':_0x5e81e3[_0xd11d('0x34')],'type':_0x5e81e3[_0xd11d('0x35')][_0xd11d('0x36')]};});_0x40d7ed['model']=_[_0xd11d('0x32')](_0x5dfa64,_0xd11d('0x30'));_0x40d7ed['query']=_['keys'](_0x484081[_0xd11d('0x37')]);_0x40d7ed['filters']=_[_0xd11d('0x38')](_0x40d7ed['model'],_0x40d7ed[_0xd11d('0x37')]);_0x190087[_0xd11d('0x39')]=_['intersection'](_0x40d7ed[_0xd11d('0x3a')],qs[_0xd11d('0x3b')](_0x484081[_0xd11d('0x37')][_0xd11d('0x3b')]));_0x190087[_0xd11d('0x39')]=_0x190087[_0xd11d('0x39')][_0xd11d('0x3c')]?_0x190087[_0xd11d('0x39')]:_0x40d7ed['model'];if(!_0x484081[_0xd11d('0x37')][_0xd11d('0x3d')](_0xd11d('0x3e'))){_0x190087[_0xd11d('0x22')]=qs[_0xd11d('0x22')](_0x484081[_0xd11d('0x37')][_0xd11d('0x22')]);_0x190087[_0xd11d('0x20')]=qs[_0xd11d('0x20')](_0x484081[_0xd11d('0x37')][_0xd11d('0x20')]);}_0x190087['order']=qs[_0xd11d('0x3f')](_0x484081[_0xd11d('0x37')][_0xd11d('0x3f')]);_0x190087[_0xd11d('0x40')]=qs[_0xd11d('0x41')](_[_0xd11d('0x42')](_0x484081['query'],_0x40d7ed[_0xd11d('0x41')]),_0x5dfa64);if(_0x484081[_0xd11d('0x37')][_0xd11d('0x43')]){_0x190087['where']=_[_0xd11d('0x44')](_0x190087[_0xd11d('0x40')],{'$or':_[_0xd11d('0x32')](_0x5dfa64,function(_0x2bba4d){if(_0x2bba4d['type']!==_0xd11d('0x45')){var _0x1384f5={};_0x1384f5[_0x2bba4d[_0xd11d('0x30')]]={'$like':'%'+_0x484081[_0xd11d('0x37')][_0xd11d('0x43')]+'%'};return _0x1384f5;}})});}_0x190087=_[_0xd11d('0x44')]({},_0x190087,_0x484081['options']);var _0x2dc149={'where':_0x190087[_0xd11d('0x40')]};return db[_0xd11d('0x46')]['count'](_0x2dc149)[_0xd11d('0x2b')](function(_0x4b6426){_0xfec29a[_0xd11d('0x23')]=_0x4b6426;if(_0x484081[_0xd11d('0x37')]['includeAll']){_0x190087['include']=[{'all':!![]}];}return db[_0xd11d('0x46')][_0xd11d('0x47')](_0x190087);})[_0xd11d('0x2b')](function(_0x5444b5){_0xfec29a[_0xd11d('0x48')]=_0x5444b5;return _0xfec29a;})[_0xd11d('0x2b')](respondWithFilteredResult(_0x4681a0,_0x190087))[_0xd11d('0x49')](handleError(_0x4681a0,null));};exports['show']=function(_0x3b9153,_0x3c752b){var _0x28f1c9={'raw':!![],'where':{'id':_0x3b9153[_0xd11d('0x4a')]['id']}},_0x26ea2d={};_0x26ea2d['model']=_['keys'](db[_0xd11d('0x46')]['rawAttributes']);_0x26ea2d[_0xd11d('0x37')]=_['keys'](_0x3b9153[_0xd11d('0x37')]);_0x26ea2d[_0xd11d('0x41')]=_[_0xd11d('0x38')](_0x26ea2d[_0xd11d('0x3a')],_0x26ea2d[_0xd11d('0x37')]);_0x28f1c9[_0xd11d('0x39')]=_[_0xd11d('0x38')](_0x26ea2d['model'],qs[_0xd11d('0x3b')](_0x3b9153[_0xd11d('0x37')][_0xd11d('0x3b')]));_0x28f1c9[_0xd11d('0x39')]=_0x28f1c9[_0xd11d('0x39')]['length']?_0x28f1c9[_0xd11d('0x39')]:_0x26ea2d[_0xd11d('0x3a')];if(_0x3b9153['query']['includeAll']){_0x28f1c9[_0xd11d('0x4b')]=[{'all':!![]}];}_0x28f1c9=_[_0xd11d('0x44')]({},_0x28f1c9,_0x3b9153['options']);return db['FaxQueue']['find'](_0x28f1c9)[_0xd11d('0x2b')](handleEntityNotFound(_0x3c752b,null))[_0xd11d('0x2b')](respondWithResult(_0x3c752b,null))[_0xd11d('0x49')](handleError(_0x3c752b,null));};exports['create']=function(_0x3e5649,_0x2f1b5c){return db['FaxQueue'][_0xd11d('0x4c')](_0x3e5649[_0xd11d('0x4d')],{})[_0xd11d('0x2b')](function(_0x3cf999){var _0x59b75e=_0x3e5649['user']['get']({'plain':!![]});if(!_0x59b75e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59b75e[_0xd11d('0x4e')]===_0xd11d('0x4f')){var _0x1199b2=_0x3cf999[_0xd11d('0x50')]({'plain':!![]});var _0x2aa9a0='FaxQueues';return db['UserProfileSection'][_0xd11d('0x51')]({'where':{'name':_0x2aa9a0,'userProfileId':_0x59b75e[_0xd11d('0x52')]},'raw':!![]})['then'](function(_0x1f82f1){if(_0x1f82f1&&_0x1f82f1[_0xd11d('0x53')]===0x0){return db[_0xd11d('0x2d')][_0xd11d('0x4c')]({'name':_0x1199b2['name'],'resourceId':_0x1199b2['id'],'type':_0x1f82f1['name'],'sectionId':_0x1f82f1['id']},{})[_0xd11d('0x2b')](function(){return _0x3cf999;});}else{return _0x3cf999;}})[_0xd11d('0x49')](function(_0x2906b4){logger[_0xd11d('0x2e')](_0xd11d('0x54'),_0x2906b4);throw _0x2906b4;});}return _0x3cf999;})[_0xd11d('0x2b')](respondWithResult(_0x2f1b5c,0xc9))[_0xd11d('0x49')](handleError(_0x2f1b5c,null));};exports['update']=function(_0x114b7b,_0x3bcd88){if(_0x114b7b[_0xd11d('0x4d')]['id']){delete _0x114b7b['body']['id'];}return db[_0xd11d('0x46')][_0xd11d('0x51')]({'where':{'id':_0x114b7b[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](handleEntityNotFound(_0x3bcd88,null))['then'](saveUpdates(_0x114b7b[_0xd11d('0x4d')],null))[_0xd11d('0x2b')](respondWithResult(_0x3bcd88,null))[_0xd11d('0x49')](handleError(_0x3bcd88,null));};exports[_0xd11d('0x2a')]=function(_0x1a2b05,_0x2b4e5d){return db[_0xd11d('0x46')][_0xd11d('0x51')]({'where':{'id':_0x1a2b05[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](handleEntityNotFound(_0x2b4e5d,null))[_0xd11d('0x2b')](removeEntity(_0x2b4e5d,null))[_0xd11d('0x49')](handleError(_0x2b4e5d,null));};exports[_0xd11d('0x55')]=function(_0x3dffb4,_0x20f2c3){return db[_0xd11d('0x46')][_0xd11d('0x55')]()['then'](respondWithResult(_0x20f2c3,null))[_0xd11d('0x49')](handleError(_0x20f2c3,null));};exports[_0xd11d('0x56')]=function(_0x1a0d29,_0x271fd1,_0x3c1386){var _0x1da9de={'raw':!![],'where':{}},_0x25502a={},_0x3ef0b9;return db['FaxQueue']['findOne']({'where':{'id':_0x1a0d29[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](handleEntityNotFound(_0x271fd1,null))[_0xd11d('0x2b')](function(_0x3ae9a9){if(_0x3ae9a9){_0x3ef0b9=_0x3ae9a9['get']({'plain':!![]});_0x25502a[_0xd11d('0x3a')]=_[_0xd11d('0x57')](db['UserFaxQueue'][_0xd11d('0x33')]);_0x25502a['query']=_['keys'](_0x1a0d29[_0xd11d('0x37')]);_0x25502a['filters']=_[_0xd11d('0x38')](_0x25502a[_0xd11d('0x3a')],_0x25502a[_0xd11d('0x37')]);_0x1da9de['attributes']=_[_0xd11d('0x38')](_0x25502a['model'],qs['fields'](_0x1a0d29[_0xd11d('0x37')][_0xd11d('0x3b')]));_0x1da9de[_0xd11d('0x39')]=_0x1da9de[_0xd11d('0x39')][_0xd11d('0x3c')]?_0x1da9de['attributes']:_0x25502a['model'];if(!_0x1a0d29[_0xd11d('0x37')][_0xd11d('0x3d')](_0xd11d('0x3e'))){_0x1da9de['limit']=qs['limit'](_0x1a0d29['query'][_0xd11d('0x22')]);_0x1da9de['offset']=qs[_0xd11d('0x20')](_0x1a0d29[_0xd11d('0x37')][_0xd11d('0x20')]);}_0x1da9de[_0xd11d('0x58')]=qs[_0xd11d('0x3f')](_0x1a0d29[_0xd11d('0x37')][_0xd11d('0x3f')]);_0x1da9de[_0xd11d('0x40')]=qs[_0xd11d('0x41')](_[_0xd11d('0x42')](_0x1a0d29[_0xd11d('0x37')],_0x25502a[_0xd11d('0x41')]));_0x1da9de['where'][_0xd11d('0x59')]=_0x3ae9a9['id'];if(_0x1a0d29[_0xd11d('0x37')][_0xd11d('0x43')]){_0x1da9de[_0xd11d('0x40')]=_[_0xd11d('0x44')](_0x1da9de[_0xd11d('0x40')],{'$or':_[_0xd11d('0x32')](_0x1da9de['attributes'],function(_0x3012fe){var _0x3da471={};_0x3da471[_0x3012fe]={'$like':'%'+_0x1a0d29['query'][_0xd11d('0x43')]+'%'};return _0x3da471;})});}_0x1da9de=_[_0xd11d('0x44')]({},_0x1da9de,_0x1a0d29[_0xd11d('0x5a')]);return db['UserFaxQueue'][_0xd11d('0x47')](_0x1da9de);}})[_0xd11d('0x2b')](function(_0x50e508){if(_0x50e508){return db[_0xd11d('0x5b')][_0xd11d('0x5c')]({'where':{'id':_[_0xd11d('0x32')](_0x50e508,_0xd11d('0x5d')),'role':_0xd11d('0x5e')},'attributes':['id',_0xd11d('0x30'),'faxPause',_0xd11d('0x5f'),'createdAt']});}})['then'](function(_0x150eb5){if(_0x150eb5){return{'count':_0x150eb5[_0xd11d('0x23')],'rows':_[_0xd11d('0x32')](_0x150eb5[_0xd11d('0x48')],function(_0x2e25c9){return{'membername':_0x2e25c9[_0xd11d('0x30')],'UserId':_0x2e25c9['id'],'queue_name':_0x3ef0b9['name'],'FaxQueueId':_0x3ef0b9['id'],'interface':util[_0xd11d('0x60')](_0xd11d('0x61'),'SIP',_0x2e25c9[_0xd11d('0x30')]),'penalty':0x0,'paused':_0x2e25c9[_0xd11d('0x62')],'createdAt':_0x2e25c9[_0xd11d('0x63')],'updatedAt':_0x2e25c9[_0xd11d('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd11d('0x2b')](respondWithFilteredResult(_0x271fd1,_0x1da9de))[_0xd11d('0x49')](handleError(_0x271fd1,null));};exports[_0xd11d('0x64')]=function(_0x4b9441,_0xa22a1f,_0x5cf0c1){var _0x2336c6={};var _0x338932={};var _0x393a11;var _0x46a309;return db[_0xd11d('0x46')][_0xd11d('0x65')]({'where':{'id':_0x4b9441[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](handleEntityNotFound(_0xa22a1f,null))[_0xd11d('0x2b')](function(_0x2bb5d3){if(_0x2bb5d3){_0x393a11=_0x2bb5d3;_0x338932[_0xd11d('0x3a')]=_[_0xd11d('0x57')](db[_0xd11d('0x66')][_0xd11d('0x33')]);_0x338932[_0xd11d('0x37')]=_[_0xd11d('0x57')](_0x4b9441[_0xd11d('0x37')]);_0x338932[_0xd11d('0x41')]=_[_0xd11d('0x38')](_0x338932[_0xd11d('0x3a')],_0x338932[_0xd11d('0x37')]);_0x2336c6[_0xd11d('0x39')]=_[_0xd11d('0x38')](_0x338932[_0xd11d('0x3a')],qs[_0xd11d('0x3b')](_0x4b9441['query']['fields']));_0x2336c6['attributes']=_0x2336c6['attributes'][_0xd11d('0x3c')]?_0x2336c6[_0xd11d('0x39')]:_0x338932['model'];_0x2336c6[_0xd11d('0x58')]=qs[_0xd11d('0x3f')](_0x4b9441['query']['sort']);_0x2336c6[_0xd11d('0x40')]=qs[_0xd11d('0x41')](_[_0xd11d('0x42')](_0x4b9441[_0xd11d('0x37')],_0x338932[_0xd11d('0x41')]));if(_0x4b9441[_0xd11d('0x37')][_0xd11d('0x43')]){_0x2336c6['where']=_[_0xd11d('0x44')](_0x2336c6[_0xd11d('0x40')],{'$or':_[_0xd11d('0x32')](_0x2336c6['attributes'],function(_0x3c844f){var _0x3b29e4={};_0x3b29e4[_0x3c844f]={'$like':'%'+_0x4b9441[_0xd11d('0x37')][_0xd11d('0x43')]+'%'};return _0x3b29e4;})});}_0x2336c6=_['merge']({},_0x2336c6,_0x4b9441[_0xd11d('0x5a')]);return _0x393a11['getTeams'](_0x2336c6);}})[_0xd11d('0x2b')](function(_0x12cae6){if(_0x12cae6){_0x46a309=_0x12cae6[_0xd11d('0x3c')];if(!_0x4b9441[_0xd11d('0x37')][_0xd11d('0x3d')](_0xd11d('0x3e'))){_0x2336c6[_0xd11d('0x22')]=qs['limit'](_0x4b9441[_0xd11d('0x37')]['limit']);_0x2336c6[_0xd11d('0x20')]=qs[_0xd11d('0x20')](_0x4b9441['query'][_0xd11d('0x20')]);}return _0x393a11[_0xd11d('0x64')](_0x2336c6);}})[_0xd11d('0x2b')](function(_0x4b1b3a){if(_0x4b1b3a){return _0x4b1b3a?{'count':_0x46a309,'rows':_0x4b1b3a}:null;}})[_0xd11d('0x2b')](respondWithResult(_0xa22a1f,null))[_0xd11d('0x49')](handleError(_0xa22a1f,null));};exports[_0xd11d('0x67')]=function(_0x417cd1,_0x414738,_0x2a0965){var _0x25ffbb=_0x417cd1[_0xd11d('0x4d')][_0xd11d('0x68')];return db[_0xd11d('0x66')][_0xd11d('0x47')]({'where':{'id':_0x25ffbb},'attributes':['id'],'include':[{'model':db[_0xd11d('0x5b')],'as':_0xd11d('0x69'),'attributes':['id',_0xd11d('0x30'),_0xd11d('0x6a'),_0xd11d('0x6b'),_0xd11d('0x6c')],'raw':!![]}]})['then'](function(_0x3147b1){if(_0x3147b1){var _0x2d0022=_[_0xd11d('0x6d')](_0x3147b1,function(_0x22338b){var _0x49b197=_0x22338b[_0xd11d('0x50')]({'plain':!![]});return _0x49b197[_0xd11d('0x69')];});return db[_0xd11d('0x46')][_0xd11d('0x51')]({'where':{'id':_0x417cd1[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](function(_0xbd2fb7){return db[_0xd11d('0x6e')][_0xd11d('0x6f')](function(_0x57a3e4){return _0xbd2fb7['addTeams'](_0x25ffbb,{'transaction':_0x57a3e4})[_0xd11d('0x2b')](function(){return BPromise[_0xd11d('0x70')](_0x2d0022,function(_0x35a955){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x35a955['id'],'FaxQueueId':_0x417cd1[_0xd11d('0x4a')]['id']},'transaction':_0x57a3e4});});})['then'](function(){_0x2d0022['forEach'](function(_0x34b125){socket[_0xd11d('0x71')]('userFaxQueue:save',{'UserId':_0x34b125['id'],'FaxQueueId':_0xbd2fb7['id']});});});});});}})[_0xd11d('0x2b')](respondWithStatusCode(_0x414738,null))[_0xd11d('0x49')](handleError(_0x414738,null));};exports['removeTeams']=function(_0x5f3824,_0xadb4f0,_0x1cc4fe){return db[_0xd11d('0x66')][_0xd11d('0x47')]({'where':{'id':_0x5f3824[_0xd11d('0x37')][_0xd11d('0x68')]},'attributes':['id'],'include':[{'model':db[_0xd11d('0x5b')],'as':_0xd11d('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xadb4f0,null))[_0xd11d('0x2b')](function(_0x297843){var _0x197b8f=_['map'](_0x297843,'id');var _0x27da25=[];var _0x22e9b6=[];var _0x306700=squel[_0xd11d('0x72')]();_0x306700[_0xd11d('0x73')](_0xd11d('0x74'))[_0xd11d('0x75')](_0xd11d('0x76'),'tq')['join'](_0xd11d('0x77'),'ut',_0xd11d('0x78'))[_0xd11d('0x40')](_0xd11d('0x79'),_0x5f3824[_0xd11d('0x4a')]['id']);for(var _0x2593df=0x0;_0x2593df<_0x297843[_0xd11d('0x3c')];_0x2593df+=0x1){let _0xf4cd11=_0x297843[_0x2593df];for(var _0x570ccc=0x0;_0x570ccc<_0xf4cd11['Agents'][_0xd11d('0x3c')];_0x570ccc+=0x1){let _0x7de45=_0xf4cd11[_0xd11d('0x69')][_0x570ccc];var _0x3a794d=_0x306700[_0xd11d('0x7a')]();_0x3a794d[_0xd11d('0x40')](_0xd11d('0x7b'),_0x7de45['id']);_0x22e9b6[_0xd11d('0x7c')](db[_0xd11d('0x6e')][_0xd11d('0x37')](_0x3a794d[_0xd11d('0x7d')](),{'type':db[_0xd11d('0x6e')][_0xd11d('0x7e')]['SELECT']})[_0xd11d('0x2b')](function(_0x455518){if(_0x455518[_0xd11d('0x3c')]===0x1){return _0x7de45['id'];}else{var _0x2af2b3=_[_0xd11d('0x7f')](_[_0xd11d('0x32')](_0x455518,_0xd11d('0x80')),function(_0x1d970d){return _[_0xd11d('0x81')](_0x197b8f,_0x1d970d);});if(_0x2af2b3){return _0x7de45['id'];}}}));}}return BPromise[_0xd11d('0x82')](_0x22e9b6)[_0xd11d('0x2b')](function(_0x2ca95e){_0x27da25=_(_0x27da25)[_0xd11d('0x83')](_0x2ca95e)[_0xd11d('0x84')]()['value']();return db['FaxQueue'][_0xd11d('0x51')]({'where':{'id':_0x5f3824['params']['id']}})['then'](function(_0x4907fb){return db[_0xd11d('0x6e')][_0xd11d('0x6f')](function(_0x2c08fd){return _0x4907fb['removeTeams'](_0x5f3824[_0xd11d('0x37')][_0xd11d('0x68')],{'transaction':_0x2c08fd})[_0xd11d('0x2b')](function(){if(!_['isEmpty'](_0x27da25)){return _0x4907fb[_0xd11d('0x85')](_0x27da25,{'transaction':_0x2c08fd});}})[_0xd11d('0x2b')](function(){_0x27da25[_0xd11d('0x86')](function(_0x28ad49){socket[_0xd11d('0x71')](_0xd11d('0x87'),{'UserId':_0x28ad49,'FaxQueueId':_0x4907fb['id']});});});});});});})[_0xd11d('0x2b')](respondWithStatusCode(_0xadb4f0,null))[_0xd11d('0x49')](handleError(_0xadb4f0,null));};exports[_0xd11d('0x88')]=function(_0x44decc,_0xac781f,_0x233c48){return db[_0xd11d('0x46')]['find']({'where':{'id':_0x44decc[_0xd11d('0x4a')]['id']}})['then'](handleEntityNotFound(_0xac781f,null))[_0xd11d('0x2b')](function(_0x47fcf0){if(_0x47fcf0){return _0x47fcf0[_0xd11d('0x88')](_0x44decc[_0xd11d('0x4d')][_0xd11d('0x68')],_[_0xd11d('0x89')](_0x44decc[_0xd11d('0x4d')],['ids','id'])||{})[_0xd11d('0x8a')](function(_0x9914bb){for(var _0xc60fec=0x0;_0xc60fec<_0x44decc[_0xd11d('0x4d')][_0xd11d('0x68')][_0xd11d('0x3c')];_0xc60fec+=0x1){socket[_0xd11d('0x71')](_0xd11d('0x8b'),{'UserId':Number(_0x44decc['body'][_0xd11d('0x68')][_0xc60fec]),'FaxQueueId':Number(_0x44decc[_0xd11d('0x4a')]['id'])});}return _0x9914bb;});}})[_0xd11d('0x2b')](respondWithResult(_0xac781f,null))[_0xd11d('0x49')](handleError(_0xac781f,null));};exports[_0xd11d('0x85')]=function(_0x2f63bf,_0x4fa1f7,_0x598da1){return db[_0xd11d('0x46')][_0xd11d('0x51')]({'where':{'id':_0x2f63bf[_0xd11d('0x4a')]['id']}})[_0xd11d('0x2b')](handleEntityNotFound(_0x4fa1f7,null))[_0xd11d('0x2b')](function(_0x174d58){if(_0x174d58){return _0x174d58[_0xd11d('0x85')](_0x2f63bf[_0xd11d('0x37')]['ids'])[_0xd11d('0x2b')](function(){if(_[_0xd11d('0x8c')](_0x2f63bf[_0xd11d('0x37')][_0xd11d('0x68')])){for(var _0x1a293a=0x0;_0x1a293a<_0x2f63bf[_0xd11d('0x37')]['ids'][_0xd11d('0x3c')];_0x1a293a+=0x1){socket[_0xd11d('0x71')](_0xd11d('0x87'),{'UserId':Number(_0x2f63bf['query'][_0xd11d('0x68')][_0x1a293a]),'FaxQueueId':Number(_0x2f63bf[_0xd11d('0x4a')]['id'])});}}else{socket[_0xd11d('0x71')](_0xd11d('0x87'),{'UserId':Number(_0x2f63bf[_0xd11d('0x37')][_0xd11d('0x68')]),'FaxQueueId':Number(_0x2f63bf[_0xd11d('0x4a')]['id'])});}});}})[_0xd11d('0x2b')](respondWithStatusCode(_0x4fa1f7,null))[_0xd11d('0x49')](handleError(_0x4fa1f7,null));};exports[_0xd11d('0x8d')]=function(_0x217258,_0x363243,_0x5d329a){var _0x4b14a8={};var _0x2d4ab4={};var _0x29f3fd;var _0x1120ad;return db[_0xd11d('0x46')][_0xd11d('0x65')]({'where':{'id':_0x217258['params']['id']}})['then'](handleEntityNotFound(_0x363243,null))['then'](function(_0x2c7acb){if(_0x2c7acb){_0x29f3fd=_0x2c7acb;_0x2d4ab4[_0xd11d('0x3a')]=_[_0xd11d('0x57')](db['User'][_0xd11d('0x33')]);_0x2d4ab4[_0xd11d('0x37')]=_[_0xd11d('0x57')](_0x217258[_0xd11d('0x37')]);_0x2d4ab4[_0xd11d('0x41')]=_['intersection'](_0x2d4ab4[_0xd11d('0x3a')],_0x2d4ab4[_0xd11d('0x37')]);_0x4b14a8[_0xd11d('0x39')]=_[_0xd11d('0x38')](_0x2d4ab4['model'],qs[_0xd11d('0x3b')](_0x217258[_0xd11d('0x37')][_0xd11d('0x3b')]));_0x4b14a8[_0xd11d('0x39')]=_0x4b14a8[_0xd11d('0x39')]['length']?_0x4b14a8[_0xd11d('0x39')]:_0x2d4ab4[_0xd11d('0x3a')];_0x4b14a8[_0xd11d('0x58')]=qs[_0xd11d('0x3f')](_0x217258[_0xd11d('0x37')][_0xd11d('0x3f')]);_0x4b14a8['where']=qs[_0xd11d('0x41')](_[_0xd11d('0x42')](_0x217258[_0xd11d('0x37')],_0x2d4ab4['filters']));if(_0x217258[_0xd11d('0x37')]['filter']){_0x4b14a8[_0xd11d('0x40')]=_[_0xd11d('0x44')](_0x4b14a8[_0xd11d('0x40')],{'$or':_[_0xd11d('0x32')](_0x4b14a8['attributes'],function(_0x4eeef2){var _0x2bc15c={};_0x2bc15c[_0x4eeef2]={'$like':'%'+_0x217258[_0xd11d('0x37')][_0xd11d('0x43')]+'%'};return _0x2bc15c;})});}_0x4b14a8=_['merge']({},_0x4b14a8,_0x217258['options']);return _0x29f3fd[_0xd11d('0x8d')](_0x4b14a8);}})[_0xd11d('0x2b')](function(_0x1643b7){if(_0x1643b7){_0x1120ad=_0x1643b7[_0xd11d('0x3c')];if(!_0x217258[_0xd11d('0x37')][_0xd11d('0x3d')]('nolimit')){_0x4b14a8[_0xd11d('0x22')]=qs[_0xd11d('0x22')](_0x217258[_0xd11d('0x37')][_0xd11d('0x22')]);_0x4b14a8[_0xd11d('0x20')]=qs[_0xd11d('0x20')](_0x217258[_0xd11d('0x37')][_0xd11d('0x20')]);}return _0x29f3fd[_0xd11d('0x8d')](_0x4b14a8);}})[_0xd11d('0x2b')](function(_0x39cf96){if(_0x39cf96){return _0x39cf96?{'count':_0x1120ad,'rows':_0x39cf96}:null;}})[_0xd11d('0x2b')](respondWithResult(_0x363243,null))[_0xd11d('0x49')](handleError(_0x363243,null));}; \ No newline at end of file +var _0x8cf0=['ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','json','offset','limit','count','set','Content-Range','save','then','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','fieldName','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','findOne','UserFaxQueue','pick','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','faxPause','Team','getTeams','addTeams','Agents','online','interface','flatMap','transaction','each','findOrCreate','emit','userFaxQueue:save','ids','select','field','tq.TeamId','from','user_has_teams'];(function(_0x413ddd,_0x15c4de){var _0x2d3849=function(_0x519225){while(--_0x519225){_0x413ddd['push'](_0x413ddd['shift']());}};_0x2d3849(++_0x15c4de);}(_0x8cf0,0x128));var _0x08cf=function(_0x5180c9,_0x38423e){_0x5180c9=_0x5180c9-0x0;var _0x215630=_0x8cf0[_0x5180c9];return _0x215630;};'use strict';var emlformat=require(_0x08cf('0x0'));var rimraf=require(_0x08cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x08cf('0x2'));var rp=require('request-promise');var moment=require(_0x08cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x08cf('0x4'));var util=require(_0x08cf('0x5'));var path=require('path');var sox=require(_0x08cf('0x6'));var csv=require(_0x08cf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08cf('0x8'));var _=require(_0x08cf('0x9'));var squel=require('squel');var crypto=require(_0x08cf('0xa'));var jsforce=require(_0x08cf('0xb'));var deskjs=require(_0x08cf('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x08cf('0xd'));var Redis=require(_0x08cf('0xe'));var authService=require(_0x08cf('0xf'));var qs=require(_0x08cf('0x10'));var as=require(_0x08cf('0x11'));var hardwareService=require(_0x08cf('0x12'));var logger=require(_0x08cf('0x13'))(_0x08cf('0x14'));var utils=require(_0x08cf('0x15'));var config=require(_0x08cf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x08cf('0x17'))['db'];config[_0x08cf('0x18')]=_['defaults'](config[_0x08cf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x08cf('0x19'))(new Redis(config[_0x08cf('0x18')]));require('./faxQueue.socket')[_0x08cf('0x1a')](socket);function respondWithStatusCode(_0x2be958,_0x1afbb7){_0x1afbb7=_0x1afbb7||0xcc;return function(_0x1046db){if(_0x1046db){return _0x2be958[_0x08cf('0x1b')](_0x1afbb7);}return _0x2be958[_0x08cf('0x1c')](_0x1afbb7)['end']();};}function respondWithResult(_0x2553aa,_0x3b4a77){_0x3b4a77=_0x3b4a77||0xc8;return function(_0x145cd3){if(_0x145cd3){return _0x2553aa[_0x08cf('0x1c')](_0x3b4a77)[_0x08cf('0x1d')](_0x145cd3);}};}function respondWithFilteredResult(_0x3fdc0d,_0x51c162){return function(_0x313bc6){if(_0x313bc6){var _0x100db9=typeof _0x51c162[_0x08cf('0x1e')]==='undefined'&&typeof _0x51c162[_0x08cf('0x1f')]==='undefined';var _0x24fd45=_0x313bc6['count'];var _0x1e053b=_0x100db9?0x0:_0x51c162['offset'];var _0x57e4f6=_0x100db9?_0x313bc6[_0x08cf('0x20')]:_0x51c162[_0x08cf('0x1e')]+_0x51c162[_0x08cf('0x1f')];var _0x522b71;if(_0x57e4f6>=_0x24fd45){_0x57e4f6=_0x24fd45;_0x522b71=0xc8;}else{_0x522b71=0xce;}_0x3fdc0d[_0x08cf('0x1c')](_0x522b71);return _0x3fdc0d[_0x08cf('0x21')](_0x08cf('0x22'),_0x1e053b+'-'+_0x57e4f6+'/'+_0x24fd45)['json'](_0x313bc6);}return null;};}function patchUpdates(_0xfa9626){return function(_0x3de1ef){try{jsonpatch['apply'](_0x3de1ef,_0xfa9626,!![]);}catch(_0x4c75c7){return BPromise['reject'](_0x4c75c7);}return _0x3de1ef[_0x08cf('0x23')]();};}function saveUpdates(_0x534f77,_0x20a362){return function(_0x4767b9){if(_0x4767b9){return _0x4767b9['update'](_0x534f77)[_0x08cf('0x24')](function(_0x1b0d57){return _0x1b0d57;});}return null;};}function removeEntity(_0x6b6287,_0x4a92ca){return function(_0x400c8e){if(_0x400c8e){return _0x400c8e['destroy']()['then'](function(){var _0x32ee41=_0x400c8e['get']({'plain':!![]});var _0x1e0970=_0x08cf('0x25');return db[_0x08cf('0x26')]['destroy']({'where':{'type':_0x1e0970,'resourceId':_0x32ee41['id']}})[_0x08cf('0x24')](function(){return _0x400c8e;});})['then'](function(){_0x6b6287['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf514d6,_0x4b6da4){return function(_0x6bb5bd){if(!_0x6bb5bd){_0xf514d6[_0x08cf('0x1b')](0x194);}return _0x6bb5bd;};}function handleError(_0x402ba8,_0x1c9175){_0x1c9175=_0x1c9175||0x1f4;return function(_0x1c3884){logger[_0x08cf('0x27')](_0x1c3884[_0x08cf('0x28')]);if(_0x1c3884['name']){delete _0x1c3884[_0x08cf('0x29')];}_0x402ba8[_0x08cf('0x1c')](_0x1c9175)[_0x08cf('0x2a')](_0x1c3884);};}exports[_0x08cf('0x2b')]=function(_0x5127d3,_0x578a06){var _0x300c4a={},_0x506718={},_0x13e2c4={'count':0x0,'rows':[]};var _0x3653c4=_['map'](db[_0x08cf('0x2c')]['rawAttributes'],function(_0x86cb88){return{'name':_0x86cb88[_0x08cf('0x2d')],'type':_0x86cb88['type']['key']};});_0x506718[_0x08cf('0x2e')]=_[_0x08cf('0x2f')](_0x3653c4,'name');_0x506718[_0x08cf('0x30')]=_[_0x08cf('0x31')](_0x5127d3['query']);_0x506718['filters']=_['intersection'](_0x506718[_0x08cf('0x2e')],_0x506718[_0x08cf('0x30')]);_0x300c4a[_0x08cf('0x32')]=_[_0x08cf('0x33')](_0x506718[_0x08cf('0x2e')],qs['fields'](_0x5127d3['query'][_0x08cf('0x34')]));_0x300c4a[_0x08cf('0x32')]=_0x300c4a[_0x08cf('0x32')][_0x08cf('0x35')]?_0x300c4a[_0x08cf('0x32')]:_0x506718[_0x08cf('0x2e')];if(!_0x5127d3[_0x08cf('0x30')][_0x08cf('0x36')](_0x08cf('0x37'))){_0x300c4a[_0x08cf('0x1f')]=qs['limit'](_0x5127d3['query'][_0x08cf('0x1f')]);_0x300c4a[_0x08cf('0x1e')]=qs[_0x08cf('0x1e')](_0x5127d3[_0x08cf('0x30')]['offset']);}_0x300c4a[_0x08cf('0x38')]=qs['sort'](_0x5127d3['query'][_0x08cf('0x39')]);_0x300c4a['where']=qs[_0x08cf('0x3a')](_['pick'](_0x5127d3[_0x08cf('0x30')],_0x506718[_0x08cf('0x3a')]),_0x3653c4);if(_0x5127d3[_0x08cf('0x30')][_0x08cf('0x3b')]){_0x300c4a[_0x08cf('0x3c')]=_['merge'](_0x300c4a[_0x08cf('0x3c')],{'$or':_[_0x08cf('0x2f')](_0x3653c4,function(_0x491f77){if(_0x491f77[_0x08cf('0x3d')]!==_0x08cf('0x3e')){var _0x496ecf={};_0x496ecf[_0x491f77[_0x08cf('0x29')]]={'$like':'%'+_0x5127d3[_0x08cf('0x30')]['filter']+'%'};return _0x496ecf;}})});}_0x300c4a=_['merge']({},_0x300c4a,_0x5127d3[_0x08cf('0x3f')]);var _0x2279a4={'where':_0x300c4a[_0x08cf('0x3c')]};return db[_0x08cf('0x2c')]['count'](_0x2279a4)[_0x08cf('0x24')](function(_0x31da1c){_0x13e2c4['count']=_0x31da1c;if(_0x5127d3[_0x08cf('0x30')]['includeAll']){_0x300c4a[_0x08cf('0x40')]=[{'all':!![]}];}return db[_0x08cf('0x2c')][_0x08cf('0x41')](_0x300c4a);})['then'](function(_0x3ecf93){_0x13e2c4['rows']=_0x3ecf93;return _0x13e2c4;})[_0x08cf('0x24')](respondWithFilteredResult(_0x578a06,_0x300c4a))[_0x08cf('0x42')](handleError(_0x578a06,null));};exports[_0x08cf('0x43')]=function(_0x2a698d,_0x204527){var _0xc4deed={'raw':!![],'where':{'id':_0x2a698d[_0x08cf('0x44')]['id']}},_0x1e5215={};_0x1e5215[_0x08cf('0x2e')]=_[_0x08cf('0x31')](db['FaxQueue'][_0x08cf('0x45')]);_0x1e5215[_0x08cf('0x30')]=_[_0x08cf('0x31')](_0x2a698d['query']);_0x1e5215[_0x08cf('0x3a')]=_['intersection'](_0x1e5215[_0x08cf('0x2e')],_0x1e5215[_0x08cf('0x30')]);_0xc4deed[_0x08cf('0x32')]=_[_0x08cf('0x33')](_0x1e5215['model'],qs[_0x08cf('0x34')](_0x2a698d['query'][_0x08cf('0x34')]));_0xc4deed[_0x08cf('0x32')]=_0xc4deed[_0x08cf('0x32')][_0x08cf('0x35')]?_0xc4deed['attributes']:_0x1e5215[_0x08cf('0x2e')];if(_0x2a698d['query']['includeAll']){_0xc4deed[_0x08cf('0x40')]=[{'all':!![]}];}_0xc4deed=_[_0x08cf('0x46')]({},_0xc4deed,_0x2a698d[_0x08cf('0x3f')]);return db[_0x08cf('0x2c')][_0x08cf('0x47')](_0xc4deed)[_0x08cf('0x24')](handleEntityNotFound(_0x204527,null))[_0x08cf('0x24')](respondWithResult(_0x204527,null))['catch'](handleError(_0x204527,null));};exports[_0x08cf('0x48')]=function(_0xc70705,_0x4ac50d){return db[_0x08cf('0x2c')][_0x08cf('0x48')](_0xc70705[_0x08cf('0x49')],{})[_0x08cf('0x24')](function(_0x47fee0){var _0x239c1e=_0xc70705[_0x08cf('0x4a')]['get']({'plain':!![]});if(!_0x239c1e)throw new Error(_0x08cf('0x4b'));if(_0x239c1e[_0x08cf('0x4c')]===_0x08cf('0x4a')){var _0x23dbaa=_0x47fee0[_0x08cf('0x4d')]({'plain':!![]});var _0xd792c6=_0x08cf('0x25');return db[_0x08cf('0x4e')][_0x08cf('0x47')]({'where':{'name':_0xd792c6,'userProfileId':_0x239c1e[_0x08cf('0x4f')]},'raw':!![]})[_0x08cf('0x24')](function(_0x7d0c74){if(_0x7d0c74&&_0x7d0c74[_0x08cf('0x50')]===0x0){return db['UserProfileResource'][_0x08cf('0x48')]({'name':_0x23dbaa[_0x08cf('0x29')],'resourceId':_0x23dbaa['id'],'type':_0x7d0c74[_0x08cf('0x29')],'sectionId':_0x7d0c74['id']},{})['then'](function(){return _0x47fee0;});}else{return _0x47fee0;}})[_0x08cf('0x42')](function(_0x1efde7){logger[_0x08cf('0x27')](_0x08cf('0x51'),_0x1efde7);throw _0x1efde7;});}return _0x47fee0;})[_0x08cf('0x24')](respondWithResult(_0x4ac50d,0xc9))[_0x08cf('0x42')](handleError(_0x4ac50d,null));};exports['update']=function(_0x42f80a,_0x3f305f){if(_0x42f80a[_0x08cf('0x49')]['id']){delete _0x42f80a[_0x08cf('0x49')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x42f80a[_0x08cf('0x44')]['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x3f305f,null))[_0x08cf('0x24')](saveUpdates(_0x42f80a[_0x08cf('0x49')],null))[_0x08cf('0x24')](respondWithResult(_0x3f305f,null))[_0x08cf('0x42')](handleError(_0x3f305f,null));};exports[_0x08cf('0x52')]=function(_0x1d0310,_0x1d8339){return db[_0x08cf('0x2c')][_0x08cf('0x47')]({'where':{'id':_0x1d0310[_0x08cf('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d8339,null))[_0x08cf('0x24')](removeEntity(_0x1d8339,null))[_0x08cf('0x42')](handleError(_0x1d8339,null));};exports[_0x08cf('0x53')]=function(_0x1b2d83,_0xd970aa){return db[_0x08cf('0x2c')][_0x08cf('0x53')]()[_0x08cf('0x24')](respondWithResult(_0xd970aa,null))[_0x08cf('0x42')](handleError(_0xd970aa,null));};exports['getMembers']=function(_0x10846d,_0x41b4bd,_0x1add70){var _0x13a936={'raw':!![],'where':{}},_0x456e2c={},_0x3d28ad;return db[_0x08cf('0x2c')][_0x08cf('0x54')]({'where':{'id':_0x10846d[_0x08cf('0x44')]['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x41b4bd,null))[_0x08cf('0x24')](function(_0x56cb82){if(_0x56cb82){_0x3d28ad=_0x56cb82[_0x08cf('0x4d')]({'plain':!![]});_0x456e2c[_0x08cf('0x2e')]=_[_0x08cf('0x31')](db[_0x08cf('0x55')][_0x08cf('0x45')]);_0x456e2c[_0x08cf('0x30')]=_[_0x08cf('0x31')](_0x10846d[_0x08cf('0x30')]);_0x456e2c[_0x08cf('0x3a')]=_[_0x08cf('0x33')](_0x456e2c[_0x08cf('0x2e')],_0x456e2c['query']);_0x13a936['attributes']=_[_0x08cf('0x33')](_0x456e2c['model'],qs[_0x08cf('0x34')](_0x10846d['query']['fields']));_0x13a936[_0x08cf('0x32')]=_0x13a936[_0x08cf('0x32')]['length']?_0x13a936[_0x08cf('0x32')]:_0x456e2c[_0x08cf('0x2e')];if(!_0x10846d[_0x08cf('0x30')][_0x08cf('0x36')](_0x08cf('0x37'))){_0x13a936['limit']=qs[_0x08cf('0x1f')](_0x10846d['query'][_0x08cf('0x1f')]);_0x13a936[_0x08cf('0x1e')]=qs['offset'](_0x10846d[_0x08cf('0x30')][_0x08cf('0x1e')]);}_0x13a936[_0x08cf('0x38')]=qs[_0x08cf('0x39')](_0x10846d[_0x08cf('0x30')]['sort']);_0x13a936[_0x08cf('0x3c')]=qs['filters'](_[_0x08cf('0x56')](_0x10846d[_0x08cf('0x30')],_0x456e2c[_0x08cf('0x3a')]));_0x13a936[_0x08cf('0x3c')]['FaxQueueId']=_0x56cb82['id'];if(_0x10846d[_0x08cf('0x30')][_0x08cf('0x3b')]){_0x13a936[_0x08cf('0x3c')]=_[_0x08cf('0x46')](_0x13a936[_0x08cf('0x3c')],{'$or':_[_0x08cf('0x2f')](_0x13a936[_0x08cf('0x32')],function(_0x167ec2){var _0x3faa26={};_0x3faa26[_0x167ec2]={'$like':'%'+_0x10846d[_0x08cf('0x30')][_0x08cf('0x3b')]+'%'};return _0x3faa26;})});}_0x13a936=_[_0x08cf('0x46')]({},_0x13a936,_0x10846d['options']);return db[_0x08cf('0x55')][_0x08cf('0x41')](_0x13a936);}})['then'](function(_0x32cee5){if(_0x32cee5){return db[_0x08cf('0x57')]['findAndCountAll']({'where':{'id':_[_0x08cf('0x2f')](_0x32cee5,_0x08cf('0x58')),'role':_0x08cf('0x59')},'attributes':['id','name','faxPause',_0x08cf('0x5a'),_0x08cf('0x5b')]});}})['then'](function(_0x4e8765){if(_0x4e8765){return{'count':_0x4e8765['count'],'rows':_[_0x08cf('0x2f')](_0x4e8765[_0x08cf('0x5c')],function(_0x2dcfd9){return{'membername':_0x2dcfd9[_0x08cf('0x29')],'UserId':_0x2dcfd9['id'],'queue_name':_0x3d28ad['name'],'FaxQueueId':_0x3d28ad['id'],'interface':util[_0x08cf('0x5d')](_0x08cf('0x5e'),_0x08cf('0x5f'),_0x2dcfd9[_0x08cf('0x29')]),'penalty':0x0,'paused':_0x2dcfd9[_0x08cf('0x60')],'createdAt':_0x2dcfd9[_0x08cf('0x5b')],'updatedAt':_0x2dcfd9[_0x08cf('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x08cf('0x24')](respondWithFilteredResult(_0x41b4bd,_0x13a936))[_0x08cf('0x42')](handleError(_0x41b4bd,null));};exports['getTeams']=function(_0x50df16,_0x3ebcf6,_0x38074e){var _0x135c15={};var _0x1ad108={};var _0x3bf445;var _0x1f28d9;return db['FaxQueue'][_0x08cf('0x54')]({'where':{'id':_0x50df16[_0x08cf('0x44')]['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x3ebcf6,null))['then'](function(_0x35ce17){if(_0x35ce17){_0x3bf445=_0x35ce17;_0x1ad108[_0x08cf('0x2e')]=_['keys'](db[_0x08cf('0x61')][_0x08cf('0x45')]);_0x1ad108[_0x08cf('0x30')]=_['keys'](_0x50df16['query']);_0x1ad108[_0x08cf('0x3a')]=_[_0x08cf('0x33')](_0x1ad108[_0x08cf('0x2e')],_0x1ad108['query']);_0x135c15[_0x08cf('0x32')]=_[_0x08cf('0x33')](_0x1ad108['model'],qs[_0x08cf('0x34')](_0x50df16[_0x08cf('0x30')]['fields']));_0x135c15[_0x08cf('0x32')]=_0x135c15[_0x08cf('0x32')][_0x08cf('0x35')]?_0x135c15['attributes']:_0x1ad108[_0x08cf('0x2e')];_0x135c15[_0x08cf('0x38')]=qs[_0x08cf('0x39')](_0x50df16[_0x08cf('0x30')][_0x08cf('0x39')]);_0x135c15[_0x08cf('0x3c')]=qs[_0x08cf('0x3a')](_[_0x08cf('0x56')](_0x50df16[_0x08cf('0x30')],_0x1ad108['filters']));if(_0x50df16[_0x08cf('0x30')][_0x08cf('0x3b')]){_0x135c15[_0x08cf('0x3c')]=_['merge'](_0x135c15['where'],{'$or':_[_0x08cf('0x2f')](_0x135c15[_0x08cf('0x32')],function(_0x2c835f){var _0x43f816={};_0x43f816[_0x2c835f]={'$like':'%'+_0x50df16[_0x08cf('0x30')][_0x08cf('0x3b')]+'%'};return _0x43f816;})});}_0x135c15=_['merge']({},_0x135c15,_0x50df16['options']);return _0x3bf445[_0x08cf('0x62')](_0x135c15);}})[_0x08cf('0x24')](function(_0x4eedb0){if(_0x4eedb0){_0x1f28d9=_0x4eedb0['length'];if(!_0x50df16[_0x08cf('0x30')][_0x08cf('0x36')]('nolimit')){_0x135c15[_0x08cf('0x1f')]=qs[_0x08cf('0x1f')](_0x50df16[_0x08cf('0x30')]['limit']);_0x135c15[_0x08cf('0x1e')]=qs[_0x08cf('0x1e')](_0x50df16[_0x08cf('0x30')]['offset']);}return _0x3bf445['getTeams'](_0x135c15);}})['then'](function(_0x56e467){if(_0x56e467){return _0x56e467?{'count':_0x1f28d9,'rows':_0x56e467}:null;}})[_0x08cf('0x24')](respondWithResult(_0x3ebcf6,null))[_0x08cf('0x42')](handleError(_0x3ebcf6,null));};exports[_0x08cf('0x63')]=function(_0xa07840,_0xa51d0e,_0x3247e4){var _0x224586=_0xa07840[_0x08cf('0x49')]['ids'];return db[_0x08cf('0x61')]['findAll']({'where':{'id':_0x224586},'attributes':['id'],'include':[{'model':db[_0x08cf('0x57')],'as':_0x08cf('0x64'),'attributes':['id',_0x08cf('0x29'),_0x08cf('0x65'),'voicePause',_0x08cf('0x66')],'raw':!![]}]})[_0x08cf('0x24')](function(_0x4d1f53){if(_0x4d1f53){var _0x302911=_[_0x08cf('0x67')](_0x4d1f53,function(_0x1bd6be){var _0x390311=_0x1bd6be[_0x08cf('0x4d')]({'plain':!![]});return _0x390311[_0x08cf('0x64')];});return db[_0x08cf('0x2c')][_0x08cf('0x47')]({'where':{'id':_0xa07840[_0x08cf('0x44')]['id']}})[_0x08cf('0x24')](function(_0x81669e){return db['sequelize'][_0x08cf('0x68')](function(_0x255eeb){return _0x81669e[_0x08cf('0x63')](_0x224586,{'transaction':_0x255eeb})[_0x08cf('0x24')](function(){return BPromise[_0x08cf('0x69')](_0x302911,function(_0xf9b74f){return db[_0x08cf('0x55')][_0x08cf('0x6a')]({'where':{'UserId':_0xf9b74f['id'],'FaxQueueId':_0xa07840[_0x08cf('0x44')]['id']},'transaction':_0x255eeb});});})[_0x08cf('0x24')](function(){_0x302911['forEach'](function(_0x180a62){socket[_0x08cf('0x6b')](_0x08cf('0x6c'),{'UserId':_0x180a62['id'],'FaxQueueId':_0x81669e['id']});});});});});}})[_0x08cf('0x24')](respondWithStatusCode(_0xa51d0e,null))['catch'](handleError(_0xa51d0e,null));};exports['removeTeams']=function(_0x2018b2,_0x2c6063,_0x224d2a){return db[_0x08cf('0x61')][_0x08cf('0x41')]({'where':{'id':_0x2018b2['query'][_0x08cf('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x08cf('0x57')],'as':_0x08cf('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2c6063,null))[_0x08cf('0x24')](function(_0xa213f6){var _0x3e5ea0=_[_0x08cf('0x2f')](_0xa213f6,'id');var _0x2df8f7=[];var _0x2b9bd3=[];var _0x577620=squel[_0x08cf('0x6e')]();_0x577620[_0x08cf('0x6f')](_0x08cf('0x70'))[_0x08cf('0x71')]('team_has_fax_queues','tq')['join'](_0x08cf('0x72'),'ut',_0x08cf('0x73'))[_0x08cf('0x3c')](_0x08cf('0x74'),_0x2018b2[_0x08cf('0x44')]['id']);for(var _0x34da77=0x0;_0x34da77<_0xa213f6[_0x08cf('0x35')];_0x34da77+=0x1){let _0x23d27c=_0xa213f6[_0x34da77];for(var _0xc6b8d=0x0;_0xc6b8d<_0x23d27c[_0x08cf('0x64')][_0x08cf('0x35')];_0xc6b8d+=0x1){let _0x4b77df=_0x23d27c[_0x08cf('0x64')][_0xc6b8d];var _0x51f68f=_0x577620[_0x08cf('0x75')]();_0x51f68f['where'](_0x08cf('0x76'),_0x4b77df['id']);_0x2b9bd3[_0x08cf('0x77')](db[_0x08cf('0x78')]['query'](_0x51f68f[_0x08cf('0x79')](),{'type':db[_0x08cf('0x78')][_0x08cf('0x7a')]['SELECT']})[_0x08cf('0x24')](function(_0x27a875){if(_0x27a875['length']===0x1){return _0x4b77df['id'];}else{var _0x111e1f=_[_0x08cf('0x7b')](_[_0x08cf('0x2f')](_0x27a875,_0x08cf('0x7c')),function(_0xa81869){return _[_0x08cf('0x7d')](_0x3e5ea0,_0xa81869);});if(_0x111e1f){return _0x4b77df['id'];}}}));}}return BPromise[_0x08cf('0x7e')](_0x2b9bd3)['then'](function(_0x48207c){_0x2df8f7=_(_0x2df8f7)[_0x08cf('0x7f')](_0x48207c)['compact']()['value']();return db[_0x08cf('0x2c')][_0x08cf('0x47')]({'where':{'id':_0x2018b2[_0x08cf('0x44')]['id']}})[_0x08cf('0x24')](function(_0x4e5c54){return db[_0x08cf('0x78')][_0x08cf('0x68')](function(_0x144bbc){return _0x4e5c54[_0x08cf('0x80')](_0x2018b2[_0x08cf('0x30')]['ids'],{'transaction':_0x144bbc})['then'](function(){if(!_[_0x08cf('0x81')](_0x2df8f7)){return _0x4e5c54['removeAgents'](_0x2df8f7,{'transaction':_0x144bbc});}})[_0x08cf('0x24')](function(){_0x2df8f7['forEach'](function(_0x7fb5fe){socket[_0x08cf('0x6b')](_0x08cf('0x82'),{'UserId':_0x7fb5fe,'FaxQueueId':_0x4e5c54['id']});});});});});});})[_0x08cf('0x24')](respondWithStatusCode(_0x2c6063,null))[_0x08cf('0x42')](handleError(_0x2c6063,null));};exports['addAgents']=function(_0xf72286,_0x1b8125,_0x2b6bab){return db['FaxQueue'][_0x08cf('0x47')]({'where':{'id':_0xf72286['params']['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x1b8125,null))['then'](function(_0x1b8b6c){if(_0x1b8b6c){return _0x1b8b6c[_0x08cf('0x83')](_0xf72286[_0x08cf('0x49')][_0x08cf('0x6d')],_[_0x08cf('0x84')](_0xf72286['body'],['ids','id'])||{})[_0x08cf('0x85')](function(_0x2642a3){for(var _0x45fc5c=0x0;_0x45fc5c<_0xf72286['body'][_0x08cf('0x6d')][_0x08cf('0x35')];_0x45fc5c+=0x1){socket[_0x08cf('0x6b')](_0x08cf('0x6c'),{'UserId':Number(_0xf72286['body']['ids'][_0x45fc5c]),'FaxQueueId':Number(_0xf72286['params']['id'])});}return _0x2642a3;});}})[_0x08cf('0x24')](respondWithResult(_0x1b8125,null))[_0x08cf('0x42')](handleError(_0x1b8125,null));};exports[_0x08cf('0x86')]=function(_0x39084d,_0x308863,_0x1c55fc){return db['FaxQueue']['find']({'where':{'id':_0x39084d['params']['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x308863,null))[_0x08cf('0x24')](function(_0x3d7a73){if(_0x3d7a73){return _0x3d7a73[_0x08cf('0x86')](_0x39084d[_0x08cf('0x30')][_0x08cf('0x6d')])[_0x08cf('0x24')](function(){if(_[_0x08cf('0x87')](_0x39084d[_0x08cf('0x30')][_0x08cf('0x6d')])){for(var _0x40d70e=0x0;_0x40d70e<_0x39084d['query'][_0x08cf('0x6d')]['length'];_0x40d70e+=0x1){socket[_0x08cf('0x6b')](_0x08cf('0x82'),{'UserId':Number(_0x39084d[_0x08cf('0x30')][_0x08cf('0x6d')][_0x40d70e]),'FaxQueueId':Number(_0x39084d[_0x08cf('0x44')]['id'])});}}else{socket[_0x08cf('0x6b')](_0x08cf('0x82'),{'UserId':Number(_0x39084d[_0x08cf('0x30')][_0x08cf('0x6d')]),'FaxQueueId':Number(_0x39084d[_0x08cf('0x44')]['id'])});}});}})[_0x08cf('0x24')](respondWithStatusCode(_0x308863,null))[_0x08cf('0x42')](handleError(_0x308863,null));};exports[_0x08cf('0x88')]=function(_0x4fc5a1,_0x46ef10,_0x6d735a){var _0x15ff3f={};var _0x601ce3={};var _0x8680b9;var _0x53292e;return db[_0x08cf('0x2c')]['findOne']({'where':{'id':_0x4fc5a1['params']['id']}})[_0x08cf('0x24')](handleEntityNotFound(_0x46ef10,null))['then'](function(_0x29a43a){if(_0x29a43a){_0x8680b9=_0x29a43a;_0x601ce3[_0x08cf('0x2e')]=_[_0x08cf('0x31')](db[_0x08cf('0x57')][_0x08cf('0x45')]);_0x601ce3[_0x08cf('0x30')]=_[_0x08cf('0x31')](_0x4fc5a1[_0x08cf('0x30')]);_0x601ce3['filters']=_[_0x08cf('0x33')](_0x601ce3[_0x08cf('0x2e')],_0x601ce3['query']);_0x15ff3f[_0x08cf('0x32')]=_['intersection'](_0x601ce3['model'],qs[_0x08cf('0x34')](_0x4fc5a1[_0x08cf('0x30')][_0x08cf('0x34')]));_0x15ff3f[_0x08cf('0x32')]=_0x15ff3f[_0x08cf('0x32')][_0x08cf('0x35')]?_0x15ff3f[_0x08cf('0x32')]:_0x601ce3[_0x08cf('0x2e')];_0x15ff3f[_0x08cf('0x38')]=qs[_0x08cf('0x39')](_0x4fc5a1['query'][_0x08cf('0x39')]);_0x15ff3f['where']=qs[_0x08cf('0x3a')](_[_0x08cf('0x56')](_0x4fc5a1[_0x08cf('0x30')],_0x601ce3[_0x08cf('0x3a')]));if(_0x4fc5a1[_0x08cf('0x30')]['filter']){_0x15ff3f['where']=_[_0x08cf('0x46')](_0x15ff3f[_0x08cf('0x3c')],{'$or':_[_0x08cf('0x2f')](_0x15ff3f[_0x08cf('0x32')],function(_0x3b368c){var _0xf03484={};_0xf03484[_0x3b368c]={'$like':'%'+_0x4fc5a1[_0x08cf('0x30')][_0x08cf('0x3b')]+'%'};return _0xf03484;})});}_0x15ff3f=_['merge']({},_0x15ff3f,_0x4fc5a1[_0x08cf('0x3f')]);return _0x8680b9['getAgents'](_0x15ff3f);}})[_0x08cf('0x24')](function(_0x34816e){if(_0x34816e){_0x53292e=_0x34816e['length'];if(!_0x4fc5a1[_0x08cf('0x30')][_0x08cf('0x36')](_0x08cf('0x37'))){_0x15ff3f[_0x08cf('0x1f')]=qs[_0x08cf('0x1f')](_0x4fc5a1[_0x08cf('0x30')][_0x08cf('0x1f')]);_0x15ff3f[_0x08cf('0x1e')]=qs[_0x08cf('0x1e')](_0x4fc5a1[_0x08cf('0x30')]['offset']);}return _0x8680b9['getAgents'](_0x15ff3f);}})[_0x08cf('0x24')](function(_0x1d391f){if(_0x1d391f){return _0x1d391f?{'count':_0x53292e,'rows':_0x1d391f}:null;}})[_0x08cf('0x24')](respondWithResult(_0x46ef10,null))[_0x08cf('0x42')](handleError(_0x46ef10,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index d1bd749..854bfd2 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 _0x6d6f=['emit','hook','exports','FaxQueue','setMaxListeners','update'];(function(_0x533a86,_0x49c481){var _0x52b173=function(_0x268e07){while(--_0x268e07){_0x533a86['push'](_0x533a86['shift']());}};_0x52b173(++_0x49c481);}(_0x6d6f,0x1cb));var _0xf6d6=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0x6d6f[_0x23be51];return _0x47a26d;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xf6d6('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf6d6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf6d6('0x2'),'afterDestroy':'remove'};function emitEvent(_0x54db59){return function(_0x172b0a,_0x26689e,_0x1e94d7){FaxQueueEvents[_0xf6d6('0x3')](_0x54db59+':'+_0x172b0a['id'],_0x172b0a);FaxQueueEvents[_0xf6d6('0x3')](_0x54db59,_0x172b0a);_0x1e94d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xf6d6('0x4')](e,emitEvent(event));}}module[_0xf6d6('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0xa315=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x8c110a,_0x4c1d23){var _0x2f50fd=function(_0x5f7a37){while(--_0x5f7a37){_0x8c110a['push'](_0x8c110a['shift']());}};_0x2f50fd(++_0x4c1d23);}(_0xa315,0x71));var _0x5a31=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0xa315[_0x11309c];return _0x3fea9c;};'use strict';var EventEmitter=require(_0x5a31('0x0'));var FaxQueue=require(_0x5a31('0x1'))['db'][_0x5a31('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5a31('0x3')](0x0);var events={'afterCreate':_0x5a31('0x4'),'afterUpdate':'update','afterDestroy':_0x5a31('0x5')};function emitEvent(_0x2c6e2a){return function(_0x35ff06,_0x35f946,_0x17f7d6){FaxQueueEvents[_0x5a31('0x6')](_0x2c6e2a+':'+_0x35ff06['id'],_0x35ff06);FaxQueueEvents[_0x5a31('0x6')](_0x2c6e2a,_0x35ff06);_0x17f7d6(null);};}for(var e in events){if(events[_0x5a31('0x7')](e)){var event=events[e];FaxQueue[_0x5a31('0x8')](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 8db62b1..02be3e5 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 _0xd885=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd885,0xa8));var _0x5d88=function(_0x1439e4,_0x3eafab){_0x1439e4=_0x1439e4-0x0;var _0x19c384=_0xd885[_0x1439e4];return _0x19c384;};'use strict';var _=require(_0x5d88('0x0'));var util=require('util');var logger=require(_0x5d88('0x1'))(_0x5d88('0x2'));var moment=require(_0x5d88('0x3'));var BPromise=require(_0x5d88('0x4'));var rp=require(_0x5d88('0x5'));var fs=require('fs');var path=require(_0x5d88('0x6'));var rimraf=require(_0x5d88('0x7'));var config=require(_0x5d88('0x8'));var attributes=require(_0x5d88('0x9'));module[_0x5d88('0xa')]=function(_0x1ec21e,_0x81dcfe){return _0x1ec21e[_0x5d88('0xb')]('FaxQueue',attributes,{'tableName':_0x5d88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3088=['exports','define','fax_queues','lodash','util','moment','bluebird','request-promise','rimraf','./faxQueue.attributes'];(function(_0x4ae2d5,_0x2161c6){var _0x387ea1=function(_0x5b1b5b){while(--_0x5b1b5b){_0x4ae2d5['push'](_0x4ae2d5['shift']());}};_0x387ea1(++_0x2161c6);}(_0x3088,0x193));var _0x8308=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x3088[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0x8308('0x0'));var util=require(_0x8308('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8308('0x2'));var BPromise=require(_0x8308('0x3'));var rp=require(_0x8308('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8308('0x5'));var config=require('../../config/environment');var attributes=require(_0x8308('0x6'));module[_0x8308('0x7')]=function(_0x4e0c15,_0x420131){return _0x4e0c15[_0x8308('0x8')]('FaxQueue',attributes,{'tableName':_0x8308('0x9'),'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 6f92c50..886621f 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 _0x20af=['request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowFaxQueue','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x570eab,_0x190c64){var _0x373780=function(_0x50310b){while(--_0x50310b){_0x570eab['push'](_0x570eab['shift']());}};_0x373780(++_0x190c64);}(_0x20af,0x1ee));var _0xf20a=function(_0x31151f,_0xcc0630){_0x31151f=_0x31151f-0x0;var _0x39c430=_0x20af[_0x31151f];return _0x39c430;};'use strict';var _=require(_0xf20a('0x0'));var util=require(_0xf20a('0x1'));var moment=require('moment');var BPromise=require(_0xf20a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf20a('0x3'))['db'];var utils=require(_0xf20a('0x4'));var logger=require(_0xf20a('0x5'))(_0xf20a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf20a('0x7')][_0xf20a('0x8')]({'port':0x232a});config['redis']=_[_0xf20a('0x9')](config[_0xf20a('0xa')],{'host':_0xf20a('0xb'),'port':0x18eb});var socket=require(_0xf20a('0xc'))(new Redis(config[_0xf20a('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4f25fa,_0xffedc0,_0x5e12cf){return new BPromise(function(_0x266e6f,_0x2e1e8f){return client[_0xf20a('0xd')](_0x4f25fa,_0x5e12cf)[_0xf20a('0xe')](function(_0x21cc95){logger[_0xf20a('0xf')](_0xf20a('0x10'),_0xffedc0,'request\x20sent');logger[_0xf20a('0x11')](_0xf20a('0x12'),_0xffedc0,'request\x20sent',JSON[_0xf20a('0x13')](_0x21cc95));if(_0x21cc95[_0xf20a('0x14')]){if(_0x21cc95[_0xf20a('0x14')][_0xf20a('0x15')]===0x1f4){logger['error'](_0xf20a('0x10'),_0xffedc0,_0x21cc95[_0xf20a('0x14')][_0xf20a('0x16')]);return _0x2e1e8f(_0x21cc95[_0xf20a('0x14')][_0xf20a('0x16')]);}logger[_0xf20a('0x14')](_0xf20a('0x10'),_0xffedc0,_0x21cc95[_0xf20a('0x14')][_0xf20a('0x16')]);return _0x266e6f(_0x21cc95['error'][_0xf20a('0x16')]);}else{logger[_0xf20a('0xf')](_0xf20a('0x10'),_0xffedc0,_0xf20a('0x17'));_0x266e6f(_0x21cc95[_0xf20a('0x18')][_0xf20a('0x16')]);}})[_0xf20a('0x19')](function(_0x4291d3){logger[_0xf20a('0x14')]('FaxQueue,\x20%s,\x20%s',_0xffedc0,_0x4291d3);_0x2e1e8f(_0x4291d3);});});}exports[_0xf20a('0x1a')]=function(_0x36c861){var _0x12e944=this;return new Promise(function(_0x6ab77f,_0x2d1115){return db[_0xf20a('0x1b')][_0xf20a('0x1c')]({'raw':_0x36c861[_0xf20a('0x1d')]?_0x36c861[_0xf20a('0x1d')][_0xf20a('0x1e')]===undefined?!![]:![]:!![],'where':_0x36c861['options']?_0x36c861[_0xf20a('0x1d')][_0xf20a('0x1f')]||null:null,'attributes':_0x36c861[_0xf20a('0x1d')]?_0x36c861[_0xf20a('0x1d')][_0xf20a('0x20')]||null:null,'limit':_0x36c861[_0xf20a('0x1d')]?_0x36c861[_0xf20a('0x1d')][_0xf20a('0x21')]||null:null,'include':_0x36c861[_0xf20a('0x1d')]?_0x36c861[_0xf20a('0x1d')]['include']?_[_0xf20a('0x22')](_0x36c861[_0xf20a('0x1d')][_0xf20a('0x23')],function(_0x1bf3a3){return{'model':db[_0x1bf3a3['model']],'as':_0x1bf3a3['as'],'attributes':_0x1bf3a3[_0xf20a('0x20')],'include':_0x1bf3a3[_0xf20a('0x23')]?_['map'](_0x1bf3a3['include'],function(_0x3b0694){return{'model':db[_0x3b0694['model']],'as':_0x3b0694['as'],'attributes':_0x3b0694[_0xf20a('0x20')],'include':_0x3b0694[_0xf20a('0x23')]?_[_0xf20a('0x22')](_0x3b0694[_0xf20a('0x23')],function(_0x3392ca){return{'model':db[_0x3392ca[_0xf20a('0x24')]],'as':_0x3392ca['as'],'attributes':_0x3392ca[_0xf20a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf20a('0xe')](function(_0x20fbb6){logger[_0xf20a('0xf')](_0xf20a('0x1a'),_0x36c861);logger['debug'](_0xf20a('0x1a'),_0x36c861,JSON[_0xf20a('0x13')](_0x20fbb6));_0x6ab77f(_0x20fbb6);})[_0xf20a('0x19')](function(_0x2b0af6){logger[_0xf20a('0x14')](_0xf20a('0x1a'),_0x2b0af6['message'],_0x36c861);_0x2d1115(_0x12e944[_0xf20a('0x14')](0x1f4,_0x2b0af6[_0xf20a('0x16')]));});});};exports['ShowFaxQueue']=function(_0x158696){var _0x38e04b=this;return new Promise(function(_0x5a61a0,_0x44aacc){return db['FaxQueue'][_0xf20a('0x25')]({'raw':_0x158696[_0xf20a('0x1d')]?_0x158696[_0xf20a('0x1d')][_0xf20a('0x1e')]===undefined?!![]:![]:!![],'where':_0x158696[_0xf20a('0x1d')]?_0x158696['options'][_0xf20a('0x1f')]||null:null,'attributes':_0x158696['options']?_0x158696['options']['attributes']||null:null,'include':_0x158696['options']?_0x158696[_0xf20a('0x1d')][_0xf20a('0x23')]?_['map'](_0x158696[_0xf20a('0x1d')][_0xf20a('0x23')],function(_0x2b53eb){return{'model':db[_0x2b53eb['model']],'as':_0x2b53eb['as'],'attributes':_0x2b53eb[_0xf20a('0x20')],'include':_0x2b53eb[_0xf20a('0x23')]?_['map'](_0x2b53eb[_0xf20a('0x23')],function(_0x5a6b8a){return{'model':db[_0x5a6b8a[_0xf20a('0x24')]],'as':_0x5a6b8a['as'],'attributes':_0x5a6b8a[_0xf20a('0x20')],'include':_0x5a6b8a[_0xf20a('0x23')]?_[_0xf20a('0x22')](_0x5a6b8a[_0xf20a('0x23')],function(_0x184c12){return{'model':db[_0x184c12['model']],'as':_0x184c12['as'],'attributes':_0x184c12[_0xf20a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf20a('0xe')](function(_0x3cfa92){logger[_0xf20a('0xf')](_0xf20a('0x26'),_0x158696);logger['debug'](_0xf20a('0x26'),_0x158696,JSON['stringify'](_0x3cfa92));_0x5a61a0(_0x3cfa92);})['catch'](function(_0x1a13a0){logger[_0xf20a('0x14')]('ShowFaxQueue',_0x1a13a0[_0xf20a('0x16')],_0x158696);_0x44aacc(_0x38e04b[_0xf20a('0x14')](0x1f4,_0x1a13a0[_0xf20a('0x16')]));});});}; \ No newline at end of file +var _0x77b3=['defaults','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','include','attributes','map','model','ShowFaxQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0x77b3,0x95));var _0x377b=function(_0x29e342,_0x160ebc){_0x29e342=_0x29e342-0x0;var _0x1a0fd7=_0x77b3[_0x29e342];return _0x1a0fd7;};'use strict';var _=require(_0x377b('0x0'));var util=require(_0x377b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x377b('0x2'));var fs=require('fs');var Redis=require(_0x377b('0x3'));var db=require(_0x377b('0x4'))['db'];var utils=require(_0x377b('0x5'));var logger=require(_0x377b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x377b('0x7'));var client=jayson[_0x377b('0x8')][_0x377b('0x9')]({'port':0x232a});config[_0x377b('0xa')]=_[_0x377b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x377b('0xc'))(new Redis(config[_0x377b('0xa')]));require(_0x377b('0xd'))[_0x377b('0xe')](socket);function respondWithRpcPromise(_0x664e0c,_0x1e4a4a,_0x129b04){return new BPromise(function(_0x2ffe6a,_0x188e5e){return client[_0x377b('0xf')](_0x664e0c,_0x129b04)[_0x377b('0x10')](function(_0x27f0a6){logger['info'](_0x377b('0x11'),_0x1e4a4a,'request\x20sent');logger[_0x377b('0x12')](_0x377b('0x13'),_0x1e4a4a,_0x377b('0x14'),JSON['stringify'](_0x27f0a6));if(_0x27f0a6[_0x377b('0x15')]){if(_0x27f0a6['error'][_0x377b('0x16')]===0x1f4){logger['error'](_0x377b('0x11'),_0x1e4a4a,_0x27f0a6[_0x377b('0x15')][_0x377b('0x17')]);return _0x188e5e(_0x27f0a6[_0x377b('0x15')]['message']);}logger[_0x377b('0x15')](_0x377b('0x11'),_0x1e4a4a,_0x27f0a6[_0x377b('0x15')][_0x377b('0x17')]);return _0x2ffe6a(_0x27f0a6[_0x377b('0x15')][_0x377b('0x17')]);}else{logger[_0x377b('0x18')]('FaxQueue,\x20%s,\x20%s',_0x1e4a4a,'request\x20sent');_0x2ffe6a(_0x27f0a6[_0x377b('0x19')][_0x377b('0x17')]);}})[_0x377b('0x1a')](function(_0xbb0935){logger[_0x377b('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1e4a4a,_0xbb0935);_0x188e5e(_0xbb0935);});});}exports[_0x377b('0x1b')]=function(_0x20c3dc){var _0x2fa899=this;return new Promise(function(_0x2bd8ef,_0x2e6ed1){return db[_0x377b('0x1c')][_0x377b('0x1d')]({'raw':_0x20c3dc['options']?_0x20c3dc[_0x377b('0x1e')][_0x377b('0x1f')]===undefined?!![]:![]:!![],'where':_0x20c3dc[_0x377b('0x1e')]?_0x20c3dc[_0x377b('0x1e')][_0x377b('0x20')]||null:null,'attributes':_0x20c3dc[_0x377b('0x1e')]?_0x20c3dc[_0x377b('0x1e')]['attributes']||null:null,'limit':_0x20c3dc[_0x377b('0x1e')]?_0x20c3dc[_0x377b('0x1e')][_0x377b('0x21')]||null:null,'include':_0x20c3dc[_0x377b('0x1e')]?_0x20c3dc[_0x377b('0x1e')][_0x377b('0x22')]?_['map'](_0x20c3dc[_0x377b('0x1e')]['include'],function(_0x1f4327){return{'model':db[_0x1f4327['model']],'as':_0x1f4327['as'],'attributes':_0x1f4327[_0x377b('0x23')],'include':_0x1f4327[_0x377b('0x22')]?_[_0x377b('0x24')](_0x1f4327[_0x377b('0x22')],function(_0x2c9130){return{'model':db[_0x2c9130['model']],'as':_0x2c9130['as'],'attributes':_0x2c9130['attributes'],'include':_0x2c9130['include']?_[_0x377b('0x24')](_0x2c9130[_0x377b('0x22')],function(_0xa0c8b8){return{'model':db[_0xa0c8b8[_0x377b('0x25')]],'as':_0xa0c8b8['as'],'attributes':_0xa0c8b8[_0x377b('0x23')]};}):[]};}):[]};}):[]:[]})[_0x377b('0x10')](function(_0x539454){logger[_0x377b('0x18')](_0x377b('0x1b'),_0x20c3dc);logger[_0x377b('0x12')](_0x377b('0x1b'),_0x20c3dc,JSON['stringify'](_0x539454));_0x2bd8ef(_0x539454);})[_0x377b('0x1a')](function(_0x5ac270){logger['error'](_0x377b('0x1b'),_0x5ac270[_0x377b('0x17')],_0x20c3dc);_0x2e6ed1(_0x2fa899[_0x377b('0x15')](0x1f4,_0x5ac270['message']));});});};exports[_0x377b('0x26')]=function(_0x2e75cf){var _0x345099=this;return new Promise(function(_0x54112c,_0x153aa8){return db[_0x377b('0x1c')][_0x377b('0x27')]({'raw':_0x2e75cf['options']?_0x2e75cf[_0x377b('0x1e')][_0x377b('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e75cf[_0x377b('0x1e')]?_0x2e75cf['options'][_0x377b('0x20')]||null:null,'attributes':_0x2e75cf[_0x377b('0x1e')]?_0x2e75cf[_0x377b('0x1e')][_0x377b('0x23')]||null:null,'include':_0x2e75cf[_0x377b('0x1e')]?_0x2e75cf[_0x377b('0x1e')][_0x377b('0x22')]?_[_0x377b('0x24')](_0x2e75cf[_0x377b('0x1e')][_0x377b('0x22')],function(_0x569c17){return{'model':db[_0x569c17[_0x377b('0x25')]],'as':_0x569c17['as'],'attributes':_0x569c17['attributes'],'include':_0x569c17[_0x377b('0x22')]?_['map'](_0x569c17[_0x377b('0x22')],function(_0x2785c9){return{'model':db[_0x2785c9[_0x377b('0x25')]],'as':_0x2785c9['as'],'attributes':_0x2785c9[_0x377b('0x23')],'include':_0x2785c9['include']?_[_0x377b('0x24')](_0x2785c9[_0x377b('0x22')],function(_0x5a8a66){return{'model':db[_0x5a8a66['model']],'as':_0x5a8a66['as'],'attributes':_0x5a8a66[_0x377b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5814b8){logger[_0x377b('0x18')]('ShowFaxQueue',_0x2e75cf);logger[_0x377b('0x12')](_0x377b('0x26'),_0x2e75cf,JSON['stringify'](_0x5814b8));_0x54112c(_0x5814b8);})[_0x377b('0x1a')](function(_0xbc2390){logger[_0x377b('0x15')]('ShowFaxQueue',_0xbc2390['message'],_0x2e75cf);_0x153aa8(_0x345099[_0x377b('0x15')](0x1f4,_0xbc2390[_0x377b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 043c847..040aedb 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 _0x256d=['remove','update','emit','register','./faxQueue.events','save'];(function(_0x1274c1,_0x15de12){var _0x47f51d=function(_0x4213bf){while(--_0x4213bf){_0x1274c1['push'](_0x1274c1['shift']());}};_0x47f51d(++_0x15de12);}(_0x256d,0x70));var _0xd256=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x256d[_0x8ba19a];return _0x2bd8b4;};'use strict';var FaxQueueEvents=require(_0xd256('0x0'));var events=[_0xd256('0x1'),_0xd256('0x2'),_0xd256('0x3')];function createListener(_0x503103,_0x3499f0){return function(_0x45d6aa){_0x3499f0[_0xd256('0x4')](_0x503103,_0x45d6aa);};}function removeListener(_0x1262f4,_0x1b3321){return function(){FaxQueueEvents['removeListener'](_0x1262f4,_0x1b3321);};}exports[_0xd256('0x5')]=function(_0x1137b3){for(var _0x23faf4=0x0,_0x28dca5=events['length'];_0x23faf4<_0x28dca5;_0x23faf4++){var _0x51c150=events[_0x23faf4];var _0x11c053=createListener('faxQueue:'+_0x51c150,_0x1137b3);FaxQueueEvents['on'](_0x51c150,_0x11c053);}}; \ No newline at end of file +var _0xd187=['emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove'];(function(_0x4a6468,_0x548b1a){var _0x2d8a06=function(_0x49395b){while(--_0x49395b){_0x4a6468['push'](_0x4a6468['shift']());}};_0x2d8a06(++_0x548b1a);}(_0xd187,0x90));var _0x7d18=function(_0x52f159,_0x419d8a){_0x52f159=_0x52f159-0x0;var _0x156799=_0xd187[_0x52f159];return _0x156799;};'use strict';var FaxQueueEvents=require(_0x7d18('0x0'));var events=[_0x7d18('0x1'),_0x7d18('0x2'),'update'];function createListener(_0xb25ed8,_0x32ee20){return function(_0x2f65f2){_0x32ee20[_0x7d18('0x3')](_0xb25ed8,_0x2f65f2);};}function removeListener(_0x305cf7,_0x2ceb9a){return function(){FaxQueueEvents[_0x7d18('0x4')](_0x305cf7,_0x2ceb9a);};}exports[_0x7d18('0x5')]=function(_0x520109){for(var _0x30e2bd=0x0,_0x4757be=events['length'];_0x30e2bd<_0x4757be;_0x30e2bd++){var _0x2e5993=events[_0x30e2bd];var _0x3ce418=createListener(_0x7d18('0x6')+_0x2e5993,_0x520109);FaxQueueEvents['on'](_0x2e5993,_0x3ce418);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 19c67f4..accf7c8 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 _0x07e8=['post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0x07e8,0x10f));var _0x807e=function(_0x3fa472,_0x289495){_0x3fa472=_0x3fa472-0x0;var _0xf18ea1=_0x07e8[_0x3fa472];return _0xf18ea1;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require(_0x807e('0x2'));var timeout=require('connect-timeout');var express=require(_0x807e('0x3'));var router=express['Router']();var fs_extra=require(_0x807e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x807e('0x5'));var controller=require(_0x807e('0x6'));router[_0x807e('0x7')]('/',auth['isAuthenticated'](),controller[_0x807e('0x8')]);router[_0x807e('0x7')](_0x807e('0x9'),auth[_0x807e('0xa')](),controller[_0x807e('0xb')]);router['get'](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0xd')]);router[_0x807e('0x7')](_0x807e('0xe'),auth[_0x807e('0xa')](),controller[_0x807e('0xf')]);router[_0x807e('0x7')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x11')]);router[_0x807e('0x7')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller['getAgents']);router[_0x807e('0x13')]('/',auth[_0x807e('0xa')](),controller[_0x807e('0x14')]);router[_0x807e('0x13')](_0x807e('0x10'),auth[_0x807e('0xa')](),controller[_0x807e('0x15')]);router['post']('/:id/users',auth[_0x807e('0xa')](),controller[_0x807e('0x16')]);router[_0x807e('0x17')](_0x807e('0xc'),auth['isAuthenticated'](),controller[_0x807e('0x18')]);router[_0x807e('0x19')](_0x807e('0xc'),auth[_0x807e('0xa')](),controller[_0x807e('0x1a')]);router[_0x807e('0x19')]('/:id/teams',auth[_0x807e('0xa')](),controller['removeTeams']);router[_0x807e('0x19')](_0x807e('0x12'),auth[_0x807e('0xa')](),controller[_0x807e('0x1b')]);module[_0x807e('0x1c')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','update','delete','removeAgents','exports','multer','util','path'];(function(_0x5064a3,_0x5ec65c){var _0x1eade5=function(_0x19ecf7){while(--_0x19ecf7){_0x5064a3['push'](_0x5064a3['shift']());}};_0x1eade5(++_0x5ec65c);}(_0x2ef3,0xba));var _0x32ef=function(_0x5533be,_0xf38417){_0x5533be=_0x5533be-0x0;var _0x46b5c4=_0x2ef3[_0x5533be];return _0x46b5c4;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['post']('/',auth[_0x32ef('0xb')](),controller[_0x32ef('0x14')]);router['post']('/:id/teams',auth[_0x32ef('0xb')](),controller['addTeams']);router[_0x32ef('0x15')](_0x32ef('0x12'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x18')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x32ef('0x18')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller['removeTeams']);router[_0x32ef('0x18')](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x19')]);module[_0x32ef('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6d21ddb..69b12b1 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 _0x222a=['moment','exports','STRING','DATE'];(function(_0x506380,_0x4cc05e){var _0x2d7d52=function(_0x5a7c5f){while(--_0x5a7c5f){_0x506380['push'](_0x506380['shift']());}};_0x2d7d52(++_0x4cc05e);}(_0x222a,0x1ec));var _0xa222=function(_0x14a645,_0x783bf8){_0x14a645=_0x14a645-0x0;var _0x2d4c9b=_0x222a[_0x14a645];return _0x2d4c9b;};'use strict';var moment=require(_0xa222('0x0'));var Sequelize=require('sequelize');module[_0xa222('0x1')]={'uniqueid':{'type':Sequelize[_0xa222('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa222('0x2')]},'joinAt':{'type':Sequelize[_0xa222('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa222('0x3')]},'exitAt':{'type':Sequelize[_0xa222('0x3')]},'reason':{'type':Sequelize[_0xa222('0x2')]}}; \ No newline at end of file +var _0x0047=['exports','STRING','DATE','moment','sequelize'];(function(_0x3faa54,_0x1679c8){var _0x46d9e3=function(_0x54b41e){while(--_0x54b41e){_0x3faa54['push'](_0x3faa54['shift']());}};_0x46d9e3(++_0x1679c8);}(_0x0047,0x99));var _0x7004=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0x0047[_0x4d121d];return _0xffa031;};'use strict';var moment=require(_0x7004('0x0'));var Sequelize=require(_0x7004('0x1'));module[_0x7004('0x2')]={'uniqueid':{'type':Sequelize[_0x7004('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7004('0x3')]},'joinAt':{'type':Sequelize[_0x7004('0x4')]},'leaveAt':{'type':Sequelize[_0x7004('0x4')]},'acceptAt':{'type':Sequelize[_0x7004('0x4')]},'exitAt':{'type':Sequelize[_0x7004('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 e5914c3..64a907c 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 _0xc737=['apply','reject','save','update','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','limit','Content-Range'];(function(_0xb02d52,_0x3107aa){var _0x37ce22=function(_0x3bfa81){while(--_0x3bfa81){_0xb02d52['push'](_0xb02d52['shift']());}};_0x37ce22(++_0x3107aa);}(_0xc737,0x154));var _0x7c73=function(_0x1b1a41,_0x37fdba){_0x1b1a41=_0x1b1a41-0x0;var _0x2ef3b7=_0xc737[_0x1b1a41];return _0x2ef3b7;};'use strict';var emlformat=require(_0x7c73('0x0'));var rimraf=require(_0x7c73('0x1'));var zipdir=require(_0x7c73('0x2'));var jsonpatch=require(_0x7c73('0x3'));var rp=require('request-promise');var moment=require(_0x7c73('0x4'));var BPromise=require(_0x7c73('0x5'));var Mustache=require(_0x7c73('0x6'));var util=require('util');var path=require(_0x7c73('0x7'));var sox=require(_0x7c73('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c73('0x9'));var _=require(_0x7c73('0xa'));var squel=require('squel');var crypto=require(_0x7c73('0xb'));var jsforce=require(_0x7c73('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c73('0xd'));var Papa=require(_0x7c73('0xe'));var Redis=require(_0x7c73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7c73('0x10'));var as=require(_0x7c73('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c73('0x12'))('api');var utils=require(_0x7c73('0x13'));var config=require(_0x7c73('0x14'));var licenseUtil=require(_0x7c73('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa28cb5,_0x301cae){_0x301cae=_0x301cae||0xcc;return function(_0x446320){if(_0x446320){return _0xa28cb5[_0x7c73('0x16')](_0x301cae);}return _0xa28cb5['status'](_0x301cae)[_0x7c73('0x17')]();};}function respondWithResult(_0x5207f0,_0x41864b){_0x41864b=_0x41864b||0xc8;return function(_0x3afd48){if(_0x3afd48){return _0x5207f0[_0x7c73('0x18')](_0x41864b)[_0x7c73('0x19')](_0x3afd48);}};}function respondWithFilteredResult(_0x346514,_0x8d1a6b){return function(_0x2ca472){if(_0x2ca472){var _0x15be28=typeof _0x8d1a6b['offset']===_0x7c73('0x1a')&&typeof _0x8d1a6b['limit']===_0x7c73('0x1a');var _0x768ba9=_0x2ca472['count'];var _0x534a39=_0x15be28?0x0:_0x8d1a6b[_0x7c73('0x1b')];var _0x4a2ebc=_0x15be28?_0x2ca472['count']:_0x8d1a6b[_0x7c73('0x1b')]+_0x8d1a6b[_0x7c73('0x1c')];var _0x15f094;if(_0x4a2ebc>=_0x768ba9){_0x4a2ebc=_0x768ba9;_0x15f094=0xc8;}else{_0x15f094=0xce;}_0x346514[_0x7c73('0x18')](_0x15f094);return _0x346514['set'](_0x7c73('0x1d'),_0x534a39+'-'+_0x4a2ebc+'/'+_0x768ba9)[_0x7c73('0x19')](_0x2ca472);}return null;};}function patchUpdates(_0x2d7e82){return function(_0x2d04dd){try{jsonpatch[_0x7c73('0x1e')](_0x2d04dd,_0x2d7e82,!![]);}catch(_0x4e840d){return BPromise[_0x7c73('0x1f')](_0x4e840d);}return _0x2d04dd[_0x7c73('0x20')]();};}function saveUpdates(_0x42867c,_0x1745d9){return function(_0x3b752c){if(_0x3b752c){return _0x3b752c[_0x7c73('0x21')](_0x42867c)[_0x7c73('0x22')](function(_0x6d5714){return _0x6d5714;});}return null;};}function removeEntity(_0x12650f,_0x4c8933){return function(_0x427b12){if(_0x427b12){return _0x427b12['destroy']()[_0x7c73('0x22')](function(){_0x12650f['status'](0xcc)[_0x7c73('0x17')]();});}};}function handleEntityNotFound(_0x57dd84,_0x1abfc5){return function(_0x5c8f9d){if(!_0x5c8f9d){_0x57dd84[_0x7c73('0x16')](0x194);}return _0x5c8f9d;};}function handleError(_0x21a4a3,_0xb758d3){_0xb758d3=_0xb758d3||0x1f4;return function(_0x5b8bc9){logger[_0x7c73('0x23')](_0x5b8bc9[_0x7c73('0x24')]);if(_0x5b8bc9[_0x7c73('0x25')]){delete _0x5b8bc9['name'];}_0x21a4a3[_0x7c73('0x18')](_0xb758d3)[_0x7c73('0x26')](_0x5b8bc9);};}exports[_0x7c73('0x27')]=function(_0x3c9a44,_0x270d3d){var _0x23af7e={},_0x5800eb={},_0x5909ec={'count':0x0,'rows':[]};var _0x485f0a=_[_0x7c73('0x28')](db[_0x7c73('0x29')][_0x7c73('0x2a')],function(_0x49b1ad){return{'name':_0x49b1ad['fieldName'],'type':_0x49b1ad[_0x7c73('0x2b')][_0x7c73('0x2c')]};});_0x5800eb[_0x7c73('0x2d')]=_[_0x7c73('0x28')](_0x485f0a,_0x7c73('0x25'));_0x5800eb[_0x7c73('0x2e')]=_[_0x7c73('0x2f')](_0x3c9a44[_0x7c73('0x2e')]);_0x5800eb[_0x7c73('0x30')]=_[_0x7c73('0x31')](_0x5800eb['model'],_0x5800eb['query']);_0x23af7e[_0x7c73('0x32')]=_[_0x7c73('0x31')](_0x5800eb[_0x7c73('0x2d')],qs['fields'](_0x3c9a44[_0x7c73('0x2e')][_0x7c73('0x33')]));_0x23af7e[_0x7c73('0x32')]=_0x23af7e[_0x7c73('0x32')][_0x7c73('0x34')]?_0x23af7e[_0x7c73('0x32')]:_0x5800eb[_0x7c73('0x2d')];if(!_0x3c9a44[_0x7c73('0x2e')]['hasOwnProperty'](_0x7c73('0x35'))){_0x23af7e[_0x7c73('0x1c')]=qs[_0x7c73('0x1c')](_0x3c9a44[_0x7c73('0x2e')][_0x7c73('0x1c')]);_0x23af7e[_0x7c73('0x1b')]=qs[_0x7c73('0x1b')](_0x3c9a44[_0x7c73('0x2e')][_0x7c73('0x1b')]);}_0x23af7e[_0x7c73('0x36')]=qs[_0x7c73('0x37')](_0x3c9a44[_0x7c73('0x2e')][_0x7c73('0x37')]);_0x23af7e[_0x7c73('0x38')]=qs[_0x7c73('0x30')](_[_0x7c73('0x39')](_0x3c9a44['query'],_0x5800eb[_0x7c73('0x30')]),_0x485f0a);if(_0x3c9a44[_0x7c73('0x2e')]['filter']){_0x23af7e[_0x7c73('0x38')]=_[_0x7c73('0x3a')](_0x23af7e['where'],{'$or':_[_0x7c73('0x28')](_0x485f0a,function(_0x5b96dd){if(_0x5b96dd[_0x7c73('0x2b')]!==_0x7c73('0x3b')){var _0xde1390={};_0xde1390[_0x5b96dd[_0x7c73('0x25')]]={'$like':'%'+_0x3c9a44[_0x7c73('0x2e')][_0x7c73('0x3c')]+'%'};return _0xde1390;}})});}_0x23af7e=_[_0x7c73('0x3a')]({},_0x23af7e,_0x3c9a44[_0x7c73('0x3d')]);var _0x419a8a={'where':_0x23af7e['where']};return db[_0x7c73('0x29')][_0x7c73('0x3e')](_0x419a8a)[_0x7c73('0x22')](function(_0xc3bc03){_0x5909ec[_0x7c73('0x3e')]=_0xc3bc03;if(_0x3c9a44['query']['includeAll']){_0x23af7e[_0x7c73('0x3f')]=[{'all':!![]}];}return db[_0x7c73('0x29')][_0x7c73('0x40')](_0x23af7e);})[_0x7c73('0x22')](function(_0x248a58){_0x5909ec[_0x7c73('0x41')]=_0x248a58;return _0x5909ec;})[_0x7c73('0x22')](respondWithFilteredResult(_0x270d3d,_0x23af7e))[_0x7c73('0x42')](handleError(_0x270d3d,null));};exports['show']=function(_0x36ad41,_0x4212f8){var _0x36b18e={'raw':!![],'where':{'id':_0x36ad41[_0x7c73('0x43')]['id']}},_0x43b35e={};_0x43b35e[_0x7c73('0x2d')]=_['keys'](db[_0x7c73('0x29')][_0x7c73('0x2a')]);_0x43b35e[_0x7c73('0x2e')]=_[_0x7c73('0x2f')](_0x36ad41['query']);_0x43b35e['filters']=_['intersection'](_0x43b35e[_0x7c73('0x2d')],_0x43b35e[_0x7c73('0x2e')]);_0x36b18e[_0x7c73('0x32')]=_[_0x7c73('0x31')](_0x43b35e['model'],qs[_0x7c73('0x33')](_0x36ad41[_0x7c73('0x2e')][_0x7c73('0x33')]));_0x36b18e[_0x7c73('0x32')]=_0x36b18e[_0x7c73('0x32')][_0x7c73('0x34')]?_0x36b18e[_0x7c73('0x32')]:_0x43b35e[_0x7c73('0x2d')];if(_0x36ad41['query'][_0x7c73('0x44')]){_0x36b18e['include']=[{'all':!![]}];}_0x36b18e=_['merge']({},_0x36b18e,_0x36ad41[_0x7c73('0x3d')]);return db[_0x7c73('0x29')][_0x7c73('0x45')](_0x36b18e)[_0x7c73('0x22')](handleEntityNotFound(_0x4212f8,null))['then'](respondWithResult(_0x4212f8,null))[_0x7c73('0x42')](handleError(_0x4212f8,null));};exports['create']=function(_0xcb9bd0,_0x51425d){return db['FaxQueueReport'][_0x7c73('0x46')](_0xcb9bd0[_0x7c73('0x47')],{})[_0x7c73('0x22')](respondWithResult(_0x51425d,0xc9))[_0x7c73('0x42')](handleError(_0x51425d,null));};exports['update']=function(_0x291c15,_0x2866bb){if(_0x291c15['body']['id']){delete _0x291c15[_0x7c73('0x47')]['id'];}return db['FaxQueueReport'][_0x7c73('0x45')]({'where':{'id':_0x291c15['params']['id']}})['then'](handleEntityNotFound(_0x2866bb,null))[_0x7c73('0x22')](saveUpdates(_0x291c15['body'],null))['then'](respondWithResult(_0x2866bb,null))[_0x7c73('0x42')](handleError(_0x2866bb,null));};exports[_0x7c73('0x48')]=function(_0x400077,_0x488308){return db['FaxQueueReport'][_0x7c73('0x45')]({'where':{'id':_0x400077[_0x7c73('0x43')]['id']}})[_0x7c73('0x22')](handleEntityNotFound(_0x488308,null))[_0x7c73('0x22')](removeEntity(_0x488308,null))[_0x7c73('0x42')](handleError(_0x488308,null));};exports['describe']=function(_0x4b85b3,_0x12d83f){return db[_0x7c73('0x29')][_0x7c73('0x49')]()[_0x7c73('0x22')](respondWithResult(_0x12d83f,null))[_0x7c73('0x42')](handleError(_0x12d83f,null));}; \ No newline at end of file +var _0x705f=['apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','pick','where','merge','filter','count','includeAll','FaxQueueReport','findAll','rows','catch','show','rawAttributes','fields','include','options','find','create','body','params','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','Content-Range','json'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x705f,0x75));var _0xf705=function(_0x326407,_0x2c9181){_0x326407=_0x326407-0x0;var _0x1b69f1=_0x705f[_0x326407];return _0x1b69f1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf705('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf705('0x1'));var moment=require(_0xf705('0x2'));var BPromise=require(_0xf705('0x3'));var Mustache=require(_0xf705('0x4'));var util=require(_0xf705('0x5'));var path=require(_0xf705('0x6'));var sox=require(_0xf705('0x7'));var csv=require(_0xf705('0x8'));var ejs=require(_0xf705('0x9'));var fs=require('fs');var fs_extra=require(_0xf705('0xa'));var _=require(_0xf705('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf705('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf705('0x8'));var querystring=require(_0xf705('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf705('0xe'));var qs=require(_0xf705('0xf'));var as=require(_0xf705('0x10'));var hardwareService=require(_0xf705('0x11'));var logger=require(_0xf705('0x12'))(_0xf705('0x13'));var utils=require(_0xf705('0x14'));var config=require(_0xf705('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf705('0x16'))['db'];function respondWithStatusCode(_0x296a62,_0xb50c9f){_0xb50c9f=_0xb50c9f||0xcc;return function(_0xf625da){if(_0xf625da){return _0x296a62[_0xf705('0x17')](_0xb50c9f);}return _0x296a62['status'](_0xb50c9f)['end']();};}function respondWithResult(_0x26cb9a,_0x10763f){_0x10763f=_0x10763f||0xc8;return function(_0x15d2e2){if(_0x15d2e2){return _0x26cb9a[_0xf705('0x18')](_0x10763f)['json'](_0x15d2e2);}};}function respondWithFilteredResult(_0x9c7b75,_0x23a64b){return function(_0x4555a8){if(_0x4555a8){var _0x32f48b=typeof _0x23a64b['offset']===_0xf705('0x19')&&typeof _0x23a64b['limit']===_0xf705('0x19');var _0x1c0778=_0x4555a8['count'];var _0xa9a2ca=_0x32f48b?0x0:_0x23a64b['offset'];var _0x425cd6=_0x32f48b?_0x4555a8['count']:_0x23a64b['offset']+_0x23a64b[_0xf705('0x1a')];var _0xfee2a8;if(_0x425cd6>=_0x1c0778){_0x425cd6=_0x1c0778;_0xfee2a8=0xc8;}else{_0xfee2a8=0xce;}_0x9c7b75[_0xf705('0x18')](_0xfee2a8);return _0x9c7b75['set'](_0xf705('0x1b'),_0xa9a2ca+'-'+_0x425cd6+'/'+_0x1c0778)[_0xf705('0x1c')](_0x4555a8);}return null;};}function patchUpdates(_0x8d5b49){return function(_0x57456a){try{jsonpatch[_0xf705('0x1d')](_0x57456a,_0x8d5b49,!![]);}catch(_0x4d34cd){return BPromise['reject'](_0x4d34cd);}return _0x57456a[_0xf705('0x1e')]();};}function saveUpdates(_0x1052a6,_0x2a2fb7){return function(_0x24622b){if(_0x24622b){return _0x24622b[_0xf705('0x1f')](_0x1052a6)[_0xf705('0x20')](function(_0xcab54f){return _0xcab54f;});}return null;};}function removeEntity(_0x10dfc9,_0x424d4e){return function(_0x39dddb){if(_0x39dddb){return _0x39dddb[_0xf705('0x21')]()['then'](function(){_0x10dfc9[_0xf705('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23bb4a,_0x4ccff8){return function(_0x5eadda){if(!_0x5eadda){_0x23bb4a[_0xf705('0x17')](0x194);}return _0x5eadda;};}function handleError(_0x33da21,_0x593180){_0x593180=_0x593180||0x1f4;return function(_0x4f5435){logger[_0xf705('0x22')](_0x4f5435[_0xf705('0x23')]);if(_0x4f5435[_0xf705('0x24')]){delete _0x4f5435[_0xf705('0x24')];}_0x33da21[_0xf705('0x18')](_0x593180)['send'](_0x4f5435);};}exports[_0xf705('0x25')]=function(_0x2c4a5d,_0x3a6343){var _0x54f905={},_0x4a09ab={},_0x4a0fd3={'count':0x0,'rows':[]};var _0x54ff43=_[_0xf705('0x26')](db['FaxQueueReport']['rawAttributes'],function(_0x29ac24){return{'name':_0x29ac24[_0xf705('0x27')],'type':_0x29ac24[_0xf705('0x28')][_0xf705('0x29')]};});_0x4a09ab[_0xf705('0x2a')]=_['map'](_0x54ff43,'name');_0x4a09ab[_0xf705('0x2b')]=_[_0xf705('0x2c')](_0x2c4a5d[_0xf705('0x2b')]);_0x4a09ab[_0xf705('0x2d')]=_[_0xf705('0x2e')](_0x4a09ab[_0xf705('0x2a')],_0x4a09ab[_0xf705('0x2b')]);_0x54f905[_0xf705('0x2f')]=_['intersection'](_0x4a09ab[_0xf705('0x2a')],qs['fields'](_0x2c4a5d[_0xf705('0x2b')]['fields']));_0x54f905[_0xf705('0x2f')]=_0x54f905[_0xf705('0x2f')][_0xf705('0x30')]?_0x54f905[_0xf705('0x2f')]:_0x4a09ab[_0xf705('0x2a')];if(!_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x31')]('nolimit')){_0x54f905[_0xf705('0x1a')]=qs[_0xf705('0x1a')](_0x2c4a5d[_0xf705('0x2b')]['limit']);_0x54f905['offset']=qs[_0xf705('0x32')](_0x2c4a5d['query'][_0xf705('0x32')]);}_0x54f905[_0xf705('0x33')]=qs[_0xf705('0x34')](_0x2c4a5d['query'][_0xf705('0x34')]);_0x54f905['where']=qs[_0xf705('0x2d')](_[_0xf705('0x35')](_0x2c4a5d[_0xf705('0x2b')],_0x4a09ab['filters']),_0x54ff43);if(_0x2c4a5d[_0xf705('0x2b')]['filter']){_0x54f905[_0xf705('0x36')]=_[_0xf705('0x37')](_0x54f905[_0xf705('0x36')],{'$or':_[_0xf705('0x26')](_0x54ff43,function(_0x38f9d5){if(_0x38f9d5[_0xf705('0x28')]!=='VIRTUAL'){var _0x2b9902={};_0x2b9902[_0x38f9d5[_0xf705('0x24')]]={'$like':'%'+_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x38')]+'%'};return _0x2b9902;}})});}_0x54f905=_['merge']({},_0x54f905,_0x2c4a5d['options']);var _0x3b02f7={'where':_0x54f905[_0xf705('0x36')]};return db['FaxQueueReport'][_0xf705('0x39')](_0x3b02f7)[_0xf705('0x20')](function(_0x10e28b){_0x4a0fd3['count']=_0x10e28b;if(_0x2c4a5d[_0xf705('0x2b')][_0xf705('0x3a')]){_0x54f905['include']=[{'all':!![]}];}return db[_0xf705('0x3b')][_0xf705('0x3c')](_0x54f905);})[_0xf705('0x20')](function(_0x4382cd){_0x4a0fd3[_0xf705('0x3d')]=_0x4382cd;return _0x4a0fd3;})[_0xf705('0x20')](respondWithFilteredResult(_0x3a6343,_0x54f905))[_0xf705('0x3e')](handleError(_0x3a6343,null));};exports[_0xf705('0x3f')]=function(_0x3355b1,_0x108663){var _0x343f1a={'raw':!![],'where':{'id':_0x3355b1['params']['id']}},_0x50520d={};_0x50520d['model']=_[_0xf705('0x2c')](db[_0xf705('0x3b')][_0xf705('0x40')]);_0x50520d['query']=_[_0xf705('0x2c')](_0x3355b1[_0xf705('0x2b')]);_0x50520d[_0xf705('0x2d')]=_[_0xf705('0x2e')](_0x50520d[_0xf705('0x2a')],_0x50520d[_0xf705('0x2b')]);_0x343f1a['attributes']=_['intersection'](_0x50520d[_0xf705('0x2a')],qs[_0xf705('0x41')](_0x3355b1['query'][_0xf705('0x41')]));_0x343f1a[_0xf705('0x2f')]=_0x343f1a[_0xf705('0x2f')][_0xf705('0x30')]?_0x343f1a['attributes']:_0x50520d[_0xf705('0x2a')];if(_0x3355b1[_0xf705('0x2b')]['includeAll']){_0x343f1a[_0xf705('0x42')]=[{'all':!![]}];}_0x343f1a=_[_0xf705('0x37')]({},_0x343f1a,_0x3355b1[_0xf705('0x43')]);return db[_0xf705('0x3b')][_0xf705('0x44')](_0x343f1a)[_0xf705('0x20')](handleEntityNotFound(_0x108663,null))[_0xf705('0x20')](respondWithResult(_0x108663,null))[_0xf705('0x3e')](handleError(_0x108663,null));};exports[_0xf705('0x45')]=function(_0x4a5a02,_0x5b5463){return db[_0xf705('0x3b')][_0xf705('0x45')](_0x4a5a02['body'],{})[_0xf705('0x20')](respondWithResult(_0x5b5463,0xc9))[_0xf705('0x3e')](handleError(_0x5b5463,null));};exports[_0xf705('0x1f')]=function(_0x2c6861,_0x99c560){if(_0x2c6861[_0xf705('0x46')]['id']){delete _0x2c6861['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2c6861[_0xf705('0x47')]['id']}})[_0xf705('0x20')](handleEntityNotFound(_0x99c560,null))[_0xf705('0x20')](saveUpdates(_0x2c6861['body'],null))[_0xf705('0x20')](respondWithResult(_0x99c560,null))[_0xf705('0x3e')](handleError(_0x99c560,null));};exports[_0xf705('0x21')]=function(_0x598441,_0x5b8f3f){return db['FaxQueueReport'][_0xf705('0x44')]({'where':{'id':_0x598441[_0xf705('0x47')]['id']}})[_0xf705('0x20')](handleEntityNotFound(_0x5b8f3f,null))[_0xf705('0x20')](removeEntity(_0x5b8f3f,null))[_0xf705('0x3e')](handleError(_0x5b8f3f,null));};exports[_0xf705('0x48')]=function(_0x52a792,_0x149c10){return db[_0xf705('0x3b')][_0xf705('0x48')]()[_0xf705('0x20')](respondWithResult(_0x149c10,null))[_0xf705('0x3e')](handleError(_0x149c10,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 42bdb53..773d50c 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0xe3edfe,_0x3569c5){var _0x2e53a3=function(_0x58197b){while(--_0x58197b){_0xe3edfe['push'](_0xe3edfe['shift']());}};_0x2e53a3(++_0x3569c5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'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 +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x101a9b,_0x12e7d8){var _0x285117=function(_0x190e24){while(--_0x190e24){_0x101a9b['push'](_0x101a9b['shift']());}};_0x285117(++_0x12e7d8);}(_0xabce,0x103));var _0xeabc=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xabce[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 84552df..7b04f26 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 _0x5661=['error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','debug','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5661,0x1ae));var _0x1566=function(_0x38dbb5,_0x427be1){_0x38dbb5=_0x38dbb5-0x0;var _0x34bd46=_0x5661[_0x38dbb5];return _0x34bd46;};'use strict';var _=require(_0x1566('0x0'));var util=require(_0x1566('0x1'));var moment=require(_0x1566('0x2'));var BPromise=require('bluebird');var rs=require(_0x1566('0x3'));var fs=require('fs');var Redis=require(_0x1566('0x4'));var db=require(_0x1566('0x5'))['db'];var utils=require(_0x1566('0x6'));var logger=require('../../config/logger')(_0x1566('0x7'));var config=require(_0x1566('0x8'));var jayson=require(_0x1566('0x9'));var client=jayson[_0x1566('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e7c47,_0x1d8dfb,_0xbe3fe8){return new BPromise(function(_0x4c39e0,_0x4673e9){return client[_0x1566('0xb')](_0x2e7c47,_0xbe3fe8)[_0x1566('0xc')](function(_0x15095c){logger[_0x1566('0xd')](_0x1566('0xe'),_0x1d8dfb,_0x1566('0xf'));logger['debug'](_0x1566('0x10'),_0x1d8dfb,_0x1566('0xf'),JSON[_0x1566('0x11')](_0x15095c));if(_0x15095c[_0x1566('0x12')]){if(_0x15095c['error'][_0x1566('0x13')]===0x1f4){logger[_0x1566('0x12')](_0x1566('0xe'),_0x1d8dfb,_0x15095c[_0x1566('0x12')][_0x1566('0x14')]);return _0x4673e9(_0x15095c['error'][_0x1566('0x14')]);}logger['error'](_0x1566('0xe'),_0x1d8dfb,_0x15095c['error']['message']);return _0x4c39e0(_0x15095c[_0x1566('0x12')][_0x1566('0x14')]);}else{logger[_0x1566('0xd')](_0x1566('0xe'),_0x1d8dfb,_0x1566('0xf'));_0x4c39e0(_0x15095c[_0x1566('0x15')][_0x1566('0x14')]);}})[_0x1566('0x16')](function(_0x326ffb){logger[_0x1566('0x12')](_0x1566('0xe'),_0x1d8dfb,_0x326ffb);_0x4673e9(_0x326ffb);});});}exports[_0x1566('0x17')]=function(_0x144eca){var _0x4de49d=this;return new Promise(function(_0x40e52d,_0x29ba54){return db[_0x1566('0x18')]['create'](_0x144eca[_0x1566('0x19')],{'raw':_0x144eca[_0x1566('0x1a')]?_0x144eca[_0x1566('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1566('0xc')](function(_0x331122){logger[_0x1566('0xd')](_0x1566('0x17'),_0x144eca);logger[_0x1566('0x1b')]('CreateFaxQueueReport',_0x144eca,JSON[_0x1566('0x11')](_0x331122));_0x40e52d(_0x331122);})['catch'](function(_0x121749){logger[_0x1566('0x12')]('CreateFaxQueueReport',_0x121749['message'],_0x144eca);_0x29ba54(_0x4de49d[_0x1566('0x12')](0x1f4,_0x121749['message']));});});};exports[_0x1566('0x1c')]=function(_0x57d9b7){var _0x1c28f8=this;return new Promise(function(_0x34997a,_0x45f615){return db[_0x1566('0x18')][_0x1566('0x1d')](_0x57d9b7[_0x1566('0x19')],{'raw':_0x57d9b7[_0x1566('0x1a')]?_0x57d9b7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d9b7['options']?_0x57d9b7['options']['where']||null:null,'attributes':_0x57d9b7[_0x1566('0x1a')]?_0x57d9b7['options'][_0x1566('0x1e')]||null:null,'limit':_0x57d9b7[_0x1566('0x1a')]?_0x57d9b7['options'][_0x1566('0x1f')]||null:null})['then'](function(_0x278ee4){logger[_0x1566('0xd')](_0x1566('0x1c'),_0x57d9b7);logger[_0x1566('0x1b')]('UpdateFaxQueueReport',_0x57d9b7,JSON[_0x1566('0x11')](_0x278ee4));_0x34997a(_0x278ee4);})[_0x1566('0x16')](function(_0x516de3){logger[_0x1566('0x12')](_0x1566('0x1c'),_0x516de3['message'],_0x57d9b7);_0x45f615(_0x1c28f8[_0x1566('0x12')](0x1f4,_0x516de3[_0x1566('0x14')]));});});}; \ No newline at end of file +var _0xe4ed=['catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','info','result'];(function(_0x4058bf,_0x3fa909){var _0x3136be=function(_0x1c47ae){while(--_0x1c47ae){_0x4058bf['push'](_0x4058bf['shift']());}};_0x3136be(++_0x3fa909);}(_0xe4ed,0x70));var _0xde4e=function(_0x212cd3,_0x34bd12){_0x212cd3=_0x212cd3-0x0;var _0x413695=_0xe4ed[_0x212cd3];return _0x413695;};'use strict';var _=require(_0xde4e('0x0'));var util=require('util');var moment=require(_0xde4e('0x1'));var BPromise=require(_0xde4e('0x2'));var rs=require(_0xde4e('0x3'));var fs=require('fs');var Redis=require(_0xde4e('0x4'));var db=require(_0xde4e('0x5'))['db'];var utils=require(_0xde4e('0x6'));var logger=require(_0xde4e('0x7'))(_0xde4e('0x8'));var config=require('../../config/environment');var jayson=require(_0xde4e('0x9'));var client=jayson[_0xde4e('0xa')][_0xde4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e4143,_0x530d75,_0x27233b){return new BPromise(function(_0x4b85b3,_0x47424b){return client[_0xde4e('0xc')](_0x1e4143,_0x27233b)[_0xde4e('0xd')](function(_0x24a82b){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x530d75,'request\x20sent');logger[_0xde4e('0xe')](_0xde4e('0xf'),_0x530d75,_0xde4e('0x10'),JSON[_0xde4e('0x11')](_0x24a82b));if(_0x24a82b[_0xde4e('0x12')]){if(_0x24a82b[_0xde4e('0x12')][_0xde4e('0x13')]===0x1f4){logger[_0xde4e('0x12')](_0xde4e('0x14'),_0x530d75,_0x24a82b[_0xde4e('0x12')][_0xde4e('0x15')]);return _0x47424b(_0x24a82b['error'][_0xde4e('0x15')]);}logger[_0xde4e('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x530d75,_0x24a82b['error']['message']);return _0x4b85b3(_0x24a82b[_0xde4e('0x12')][_0xde4e('0x15')]);}else{logger[_0xde4e('0x16')](_0xde4e('0x14'),_0x530d75,'request\x20sent');_0x4b85b3(_0x24a82b[_0xde4e('0x17')][_0xde4e('0x15')]);}})[_0xde4e('0x18')](function(_0x479e27){logger[_0xde4e('0x12')](_0xde4e('0x14'),_0x530d75,_0x479e27);_0x47424b(_0x479e27);});});}exports[_0xde4e('0x19')]=function(_0x29c36f){var _0x533fd9=this;return new Promise(function(_0x197c52,_0x15b440){return db['FaxQueueReport'][_0xde4e('0x1a')](_0x29c36f[_0xde4e('0x1b')],{'raw':_0x29c36f[_0xde4e('0x1c')]?_0x29c36f[_0xde4e('0x1c')][_0xde4e('0x1d')]===undefined?!![]:![]:!![]})[_0xde4e('0xd')](function(_0x429081){logger[_0xde4e('0x16')](_0xde4e('0x19'),_0x29c36f);logger['debug'](_0xde4e('0x19'),_0x29c36f,JSON[_0xde4e('0x11')](_0x429081));_0x197c52(_0x429081);})[_0xde4e('0x18')](function(_0x1c248c){logger[_0xde4e('0x12')](_0xde4e('0x19'),_0x1c248c[_0xde4e('0x15')],_0x29c36f);_0x15b440(_0x533fd9[_0xde4e('0x12')](0x1f4,_0x1c248c[_0xde4e('0x15')]));});});};exports[_0xde4e('0x1e')]=function(_0x1eced3){var _0x6ca552=this;return new Promise(function(_0x4ba423,_0x37ad6e){return db[_0xde4e('0x1f')]['update'](_0x1eced3['body'],{'raw':_0x1eced3[_0xde4e('0x1c')]?_0x1eced3[_0xde4e('0x1c')][_0xde4e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eced3['options']?_0x1eced3[_0xde4e('0x1c')]['where']||null:null,'attributes':_0x1eced3[_0xde4e('0x1c')]?_0x1eced3[_0xde4e('0x1c')][_0xde4e('0x20')]||null:null,'limit':_0x1eced3[_0xde4e('0x1c')]?_0x1eced3[_0xde4e('0x1c')][_0xde4e('0x21')]||null:null})['then'](function(_0x1370d7){logger[_0xde4e('0x16')](_0xde4e('0x1e'),_0x1eced3);logger[_0xde4e('0xe')](_0xde4e('0x1e'),_0x1eced3,JSON[_0xde4e('0x11')](_0x1370d7));_0x4ba423(_0x1370d7);})['catch'](function(_0x1e0b64){logger['error'](_0xde4e('0x1e'),_0x1e0b64[_0xde4e('0x15')],_0x1eced3);_0x37ad6e(_0x6ca552['error'](0x1f4,_0x1e0b64[_0xde4e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8b5a9e3..ab9b8fb 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 _0xa8f6=['/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x10aeef,_0x5a8c0f){var _0x534f59=function(_0x3cb83d){while(--_0x3cb83d){_0x10aeef['push'](_0x10aeef['shift']());}};_0x534f59(++_0x5a8c0f);}(_0xa8f6,0xfe));var _0x6a8f=function(_0x1890fe,_0x500cff){_0x1890fe=_0x1890fe-0x0;var _0x2a5984=_0xa8f6[_0x1890fe];return _0x2a5984;};'use strict';var multer=require(_0x6a8f('0x0'));var util=require(_0x6a8f('0x1'));var path=require('path');var timeout=require(_0x6a8f('0x2'));var express=require(_0x6a8f('0x3'));var router=express[_0x6a8f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6a8f('0x5'));var interaction=require(_0x6a8f('0x6'));var config=require(_0x6a8f('0x7'));var controller=require('./faxQueueReport.controller');router[_0x6a8f('0x8')]('/',auth[_0x6a8f('0x9')](),controller[_0x6a8f('0xa')]);router[_0x6a8f('0x8')]('/describe',auth[_0x6a8f('0x9')](),controller[_0x6a8f('0xb')]);router[_0x6a8f('0x8')](_0x6a8f('0xc'),auth[_0x6a8f('0x9')](),controller[_0x6a8f('0xd')]);router[_0x6a8f('0xe')]('/',auth[_0x6a8f('0x9')](),controller[_0x6a8f('0xf')]);router[_0x6a8f('0x10')](_0x6a8f('0xc'),auth[_0x6a8f('0x9')](),controller['update']);router[_0x6a8f('0x11')](_0x6a8f('0xc'),auth[_0x6a8f('0x9')](),controller['destroy']);module[_0x6a8f('0x12')]=router; \ No newline at end of file +var _0xe7a7=['get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x3593ab,_0x440001){var _0x7e3f68=function(_0x203b15){while(--_0x203b15){_0x3593ab['push'](_0x3593ab['shift']());}};_0x7e3f68(++_0x440001);}(_0xe7a7,0x16d));var _0x7e7a=function(_0x4ffba9,_0x31e611){_0x4ffba9=_0x4ffba9-0x0;var _0x27d144=_0xe7a7[_0x4ffba9];return _0x27d144;};'use strict';var multer=require(_0x7e7a('0x0'));var util=require('util');var path=require(_0x7e7a('0x1'));var timeout=require(_0x7e7a('0x2'));var express=require(_0x7e7a('0x3'));var router=express[_0x7e7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7e7a('0x5'));var interaction=require(_0x7e7a('0x6'));var config=require(_0x7e7a('0x7'));var controller=require(_0x7e7a('0x8'));router[_0x7e7a('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e7a('0xa')]);router[_0x7e7a('0x9')](_0x7e7a('0xb'),auth[_0x7e7a('0xc')](),controller[_0x7e7a('0xd')]);router[_0x7e7a('0x9')](_0x7e7a('0xe'),auth[_0x7e7a('0xc')](),controller['show']);router[_0x7e7a('0xf')]('/',auth[_0x7e7a('0xc')](),controller[_0x7e7a('0x10')]);router[_0x7e7a('0x11')]('/:id',auth[_0x7e7a('0xc')](),controller[_0x7e7a('0x12')]);router[_0x7e7a('0x13')](_0x7e7a('0xe'),auth[_0x7e7a('0xc')](),controller[_0x7e7a('0x14')]);module[_0x7e7a('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4229c99..49e46e0 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0xb43b,0x1b2));var _0xbb43=function(_0xfe75f5,_0x3eb41d){_0xfe75f5=_0xfe75f5-0x0;var _0x2ce754=_0xb43b[_0xfe75f5];return _0x2ce754;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x1109ff,_0x1bdee8){var _0x1e42d4=function(_0x9bcfda){while(--_0x9bcfda){_0x1109ff['push'](_0x1109ff['shift']());}};_0x1e42d4(++_0x1bdee8);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x4b84[_0x3f8282];return _0x50f918;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a3e9775..1131806 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 _0xd9b1=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','map','FaxTransferReport','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service'];(function(_0x35a9a7,_0x5e8c7f){var _0x142c13=function(_0x6f2671){while(--_0x6f2671){_0x35a9a7['push'](_0x35a9a7['shift']());}};_0x142c13(++_0x5e8c7f);}(_0xd9b1,0x10b));var _0x1d9b=function(_0x23012c,_0x14ffaf){_0x23012c=_0x23012c-0x0;var _0x318c14=_0xd9b1[_0x23012c];return _0x318c14;};'use strict';var emlformat=require(_0x1d9b('0x0'));var rimraf=require(_0x1d9b('0x1'));var zipdir=require(_0x1d9b('0x2'));var jsonpatch=require(_0x1d9b('0x3'));var rp=require(_0x1d9b('0x4'));var moment=require('moment');var BPromise=require(_0x1d9b('0x5'));var Mustache=require('mustache');var util=require(_0x1d9b('0x6'));var path=require(_0x1d9b('0x7'));var sox=require(_0x1d9b('0x8'));var csv=require(_0x1d9b('0x9'));var ejs=require(_0x1d9b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d9b('0xb'));var squel=require(_0x1d9b('0xc'));var crypto=require(_0x1d9b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d9b('0xe'));var toCsv=require(_0x1d9b('0x9'));var querystring=require('querystring');var Papa=require(_0x1d9b('0xf'));var Redis=require('ioredis');var authService=require(_0x1d9b('0x10'));var qs=require(_0x1d9b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d9b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1d9b('0x13'));var config=require(_0x1d9b('0x14'));var licenseUtil=require(_0x1d9b('0x15'));var db=require(_0x1d9b('0x16'))['db'];function respondWithStatusCode(_0x1653bf,_0x5ab0df){_0x5ab0df=_0x5ab0df||0xcc;return function(_0x493999){if(_0x493999){return _0x1653bf[_0x1d9b('0x17')](_0x5ab0df);}return _0x1653bf[_0x1d9b('0x18')](_0x5ab0df)['end']();};}function respondWithResult(_0x458476,_0x5ec7f6){_0x5ec7f6=_0x5ec7f6||0xc8;return function(_0x5d6d58){if(_0x5d6d58){return _0x458476[_0x1d9b('0x18')](_0x5ec7f6)[_0x1d9b('0x19')](_0x5d6d58);}};}function respondWithFilteredResult(_0x2975b6,_0x1e844d){return function(_0x13c3d4){if(_0x13c3d4){var _0x985563=typeof _0x1e844d['offset']===_0x1d9b('0x1a')&&typeof _0x1e844d[_0x1d9b('0x1b')]===_0x1d9b('0x1a');var _0x3c098b=_0x13c3d4[_0x1d9b('0x1c')];var _0x105f4b=_0x985563?0x0:_0x1e844d[_0x1d9b('0x1d')];var _0x5caf05=_0x985563?_0x13c3d4['count']:_0x1e844d[_0x1d9b('0x1d')]+_0x1e844d[_0x1d9b('0x1b')];var _0x20c459;if(_0x5caf05>=_0x3c098b){_0x5caf05=_0x3c098b;_0x20c459=0xc8;}else{_0x20c459=0xce;}_0x2975b6[_0x1d9b('0x18')](_0x20c459);return _0x2975b6[_0x1d9b('0x1e')](_0x1d9b('0x1f'),_0x105f4b+'-'+_0x5caf05+'/'+_0x3c098b)[_0x1d9b('0x19')](_0x13c3d4);}return null;};}function patchUpdates(_0x455269){return function(_0x333827){try{jsonpatch[_0x1d9b('0x20')](_0x333827,_0x455269,!![]);}catch(_0x502ed2){return BPromise['reject'](_0x502ed2);}return _0x333827['save']();};}function saveUpdates(_0x27e120,_0x2ec59b){return function(_0x445006){if(_0x445006){return _0x445006[_0x1d9b('0x21')](_0x27e120)[_0x1d9b('0x22')](function(_0x5d0ddd){return _0x5d0ddd;});}return null;};}function removeEntity(_0x774df0,_0x478d1c){return function(_0x137ae3){if(_0x137ae3){return _0x137ae3[_0x1d9b('0x23')]()['then'](function(){_0x774df0[_0x1d9b('0x18')](0xcc)[_0x1d9b('0x24')]();});}};}function handleEntityNotFound(_0x4d5296,_0x619a26){return function(_0x3c9151){if(!_0x3c9151){_0x4d5296[_0x1d9b('0x17')](0x194);}return _0x3c9151;};}function handleError(_0x38bb91,_0x46866f){_0x46866f=_0x46866f||0x1f4;return function(_0x50b606){logger[_0x1d9b('0x25')](_0x50b606['stack']);if(_0x50b606[_0x1d9b('0x26')]){delete _0x50b606[_0x1d9b('0x26')];}_0x38bb91[_0x1d9b('0x18')](_0x46866f)['send'](_0x50b606);};}exports['index']=function(_0x12002e,_0x313425){var _0x553489={},_0x15664a={},_0x584296={'count':0x0,'rows':[]};var _0x51a588=_[_0x1d9b('0x27')](db[_0x1d9b('0x28')]['rawAttributes'],function(_0x2d7f87){return{'name':_0x2d7f87['fieldName'],'type':_0x2d7f87[_0x1d9b('0x29')]['key']};});_0x15664a[_0x1d9b('0x2a')]=_[_0x1d9b('0x27')](_0x51a588,_0x1d9b('0x26'));_0x15664a['query']=_[_0x1d9b('0x2b')](_0x12002e[_0x1d9b('0x2c')]);_0x15664a[_0x1d9b('0x2d')]=_[_0x1d9b('0x2e')](_0x15664a[_0x1d9b('0x2a')],_0x15664a[_0x1d9b('0x2c')]);_0x553489[_0x1d9b('0x2f')]=_[_0x1d9b('0x2e')](_0x15664a[_0x1d9b('0x2a')],qs[_0x1d9b('0x30')](_0x12002e[_0x1d9b('0x2c')][_0x1d9b('0x30')]));_0x553489[_0x1d9b('0x2f')]=_0x553489[_0x1d9b('0x2f')]['length']?_0x553489[_0x1d9b('0x2f')]:_0x15664a[_0x1d9b('0x2a')];if(!_0x12002e[_0x1d9b('0x2c')][_0x1d9b('0x31')](_0x1d9b('0x32'))){_0x553489['limit']=qs[_0x1d9b('0x1b')](_0x12002e['query'][_0x1d9b('0x1b')]);_0x553489[_0x1d9b('0x1d')]=qs['offset'](_0x12002e[_0x1d9b('0x2c')][_0x1d9b('0x1d')]);}_0x553489[_0x1d9b('0x33')]=qs[_0x1d9b('0x34')](_0x12002e[_0x1d9b('0x2c')]['sort']);_0x553489[_0x1d9b('0x35')]=qs[_0x1d9b('0x2d')](_[_0x1d9b('0x36')](_0x12002e[_0x1d9b('0x2c')],_0x15664a['filters']),_0x51a588);if(_0x12002e[_0x1d9b('0x2c')]['filter']){_0x553489['where']=_[_0x1d9b('0x37')](_0x553489[_0x1d9b('0x35')],{'$or':_[_0x1d9b('0x27')](_0x51a588,function(_0x3bdd0c){if(_0x3bdd0c['type']!==_0x1d9b('0x38')){var _0x59243b={};_0x59243b[_0x3bdd0c[_0x1d9b('0x26')]]={'$like':'%'+_0x12002e[_0x1d9b('0x2c')][_0x1d9b('0x39')]+'%'};return _0x59243b;}})});}_0x553489=_[_0x1d9b('0x37')]({},_0x553489,_0x12002e[_0x1d9b('0x3a')]);var _0x17e582={'where':_0x553489[_0x1d9b('0x35')]};return db[_0x1d9b('0x28')][_0x1d9b('0x1c')](_0x17e582)[_0x1d9b('0x22')](function(_0x47d692){_0x584296[_0x1d9b('0x1c')]=_0x47d692;if(_0x12002e[_0x1d9b('0x2c')][_0x1d9b('0x3b')]){_0x553489[_0x1d9b('0x3c')]=[{'all':!![]}];}return db[_0x1d9b('0x28')]['findAll'](_0x553489);})[_0x1d9b('0x22')](function(_0x272b63){_0x584296[_0x1d9b('0x3d')]=_0x272b63;return _0x584296;})['then'](respondWithFilteredResult(_0x313425,_0x553489))[_0x1d9b('0x3e')](handleError(_0x313425,null));};exports[_0x1d9b('0x3f')]=function(_0x1a7927,_0x1ebc46){var _0x51c66a={'raw':!![],'where':{'id':_0x1a7927[_0x1d9b('0x40')]['id']}},_0x2cb3da={};_0x2cb3da[_0x1d9b('0x2a')]=_[_0x1d9b('0x2b')](db[_0x1d9b('0x28')][_0x1d9b('0x41')]);_0x2cb3da[_0x1d9b('0x2c')]=_[_0x1d9b('0x2b')](_0x1a7927['query']);_0x2cb3da['filters']=_[_0x1d9b('0x2e')](_0x2cb3da[_0x1d9b('0x2a')],_0x2cb3da[_0x1d9b('0x2c')]);_0x51c66a[_0x1d9b('0x2f')]=_[_0x1d9b('0x2e')](_0x2cb3da[_0x1d9b('0x2a')],qs[_0x1d9b('0x30')](_0x1a7927[_0x1d9b('0x2c')]['fields']));_0x51c66a[_0x1d9b('0x2f')]=_0x51c66a[_0x1d9b('0x2f')][_0x1d9b('0x42')]?_0x51c66a[_0x1d9b('0x2f')]:_0x2cb3da[_0x1d9b('0x2a')];if(_0x1a7927[_0x1d9b('0x2c')][_0x1d9b('0x3b')]){_0x51c66a['include']=[{'all':!![]}];}_0x51c66a=_[_0x1d9b('0x37')]({},_0x51c66a,_0x1a7927[_0x1d9b('0x3a')]);return db[_0x1d9b('0x28')][_0x1d9b('0x43')](_0x51c66a)[_0x1d9b('0x22')](handleEntityNotFound(_0x1ebc46,null))[_0x1d9b('0x22')](respondWithResult(_0x1ebc46,null))[_0x1d9b('0x3e')](handleError(_0x1ebc46,null));};exports[_0x1d9b('0x44')]=function(_0xc7699d,_0x407539){return db['FaxTransferReport']['create'](_0xc7699d[_0x1d9b('0x45')],{})[_0x1d9b('0x22')](respondWithResult(_0x407539,0xc9))[_0x1d9b('0x3e')](handleError(_0x407539,null));};exports[_0x1d9b('0x21')]=function(_0x19714f,_0xf14f71){if(_0x19714f[_0x1d9b('0x45')]['id']){delete _0x19714f[_0x1d9b('0x45')]['id'];}return db[_0x1d9b('0x28')][_0x1d9b('0x43')]({'where':{'id':_0x19714f[_0x1d9b('0x40')]['id']}})[_0x1d9b('0x22')](handleEntityNotFound(_0xf14f71,null))[_0x1d9b('0x22')](saveUpdates(_0x19714f[_0x1d9b('0x45')],null))['then'](respondWithResult(_0xf14f71,null))[_0x1d9b('0x3e')](handleError(_0xf14f71,null));};exports[_0x1d9b('0x23')]=function(_0x3cf973,_0x338261){return db[_0x1d9b('0x28')][_0x1d9b('0x43')]({'where':{'id':_0x3cf973['params']['id']}})['then'](handleEntityNotFound(_0x338261,null))[_0x1d9b('0x22')](removeEntity(_0x338261,null))[_0x1d9b('0x3e')](handleError(_0x338261,null));};exports['describe']=function(_0x4abf46,_0x4d9fa3){return db[_0x1d9b('0x28')][_0x1d9b('0x46')]()['then'](respondWithResult(_0x4d9fa3,null))[_0x1d9b('0x3e')](handleError(_0x4d9fa3,null));}; \ No newline at end of file +var _0x9e0e=['status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','destroy','sendStatus','error','stack','name','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','then','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xff6bbd,_0x34e0b6){var _0x2a2697=function(_0x2d5d9c){while(--_0x2d5d9c){_0xff6bbd['push'](_0xff6bbd['shift']());}};_0x2a2697(++_0x34e0b6);}(_0x9e0e,0x1a8));var _0xe9e0=function(_0x3b7607,_0x440644){_0x3b7607=_0x3b7607-0x0;var _0xaba951=_0x9e0e[_0x3b7607];return _0xaba951;};'use strict';var emlformat=require(_0xe9e0('0x0'));var rimraf=require(_0xe9e0('0x1'));var zipdir=require(_0xe9e0('0x2'));var jsonpatch=require(_0xe9e0('0x3'));var rp=require(_0xe9e0('0x4'));var moment=require(_0xe9e0('0x5'));var BPromise=require(_0xe9e0('0x6'));var Mustache=require('mustache');var util=require(_0xe9e0('0x7'));var path=require(_0xe9e0('0x8'));var sox=require(_0xe9e0('0x9'));var csv=require(_0xe9e0('0xa'));var ejs=require(_0xe9e0('0xb'));var fs=require('fs');var fs_extra=require(_0xe9e0('0xc'));var _=require(_0xe9e0('0xd'));var squel=require(_0xe9e0('0xe'));var crypto=require('crypto');var jsforce=require(_0xe9e0('0xf'));var deskjs=require(_0xe9e0('0x10'));var toCsv=require(_0xe9e0('0xa'));var querystring=require(_0xe9e0('0x11'));var Papa=require(_0xe9e0('0x12'));var Redis=require(_0xe9e0('0x13'));var authService=require(_0xe9e0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe9e0('0x15'));var hardwareService=require(_0xe9e0('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe9e0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe9e0('0x18'));var db=require(_0xe9e0('0x19'))['db'];function respondWithStatusCode(_0x37bf57,_0x1c7553){_0x1c7553=_0x1c7553||0xcc;return function(_0x2827be){if(_0x2827be){return _0x37bf57['sendStatus'](_0x1c7553);}return _0x37bf57[_0xe9e0('0x1a')](_0x1c7553)['end']();};}function respondWithResult(_0x5563f2,_0x4b018e){_0x4b018e=_0x4b018e||0xc8;return function(_0x35b775){if(_0x35b775){return _0x5563f2[_0xe9e0('0x1a')](_0x4b018e)['json'](_0x35b775);}};}function respondWithFilteredResult(_0x125838,_0x2f756c){return function(_0x126e7e){if(_0x126e7e){var _0x3247e8=typeof _0x2f756c['offset']==='undefined'&&typeof _0x2f756c[_0xe9e0('0x1b')]===_0xe9e0('0x1c');var _0x59ce87=_0x126e7e[_0xe9e0('0x1d')];var _0x29e6cc=_0x3247e8?0x0:_0x2f756c['offset'];var _0x57e061=_0x3247e8?_0x126e7e['count']:_0x2f756c[_0xe9e0('0x1e')]+_0x2f756c['limit'];var _0x3e8022;if(_0x57e061>=_0x59ce87){_0x57e061=_0x59ce87;_0x3e8022=0xc8;}else{_0x3e8022=0xce;}_0x125838[_0xe9e0('0x1a')](_0x3e8022);return _0x125838[_0xe9e0('0x1f')](_0xe9e0('0x20'),_0x29e6cc+'-'+_0x57e061+'/'+_0x59ce87)[_0xe9e0('0x21')](_0x126e7e);}return null;};}function patchUpdates(_0x4d1040){return function(_0x56f20d){try{jsonpatch['apply'](_0x56f20d,_0x4d1040,!![]);}catch(_0x57994a){return BPromise[_0xe9e0('0x22')](_0x57994a);}return _0x56f20d[_0xe9e0('0x23')]();};}function saveUpdates(_0x35fe9e,_0x49b551){return function(_0x318221){if(_0x318221){return _0x318221[_0xe9e0('0x24')](_0x35fe9e)['then'](function(_0xdc69d4){return _0xdc69d4;});}return null;};}function removeEntity(_0x1f9b21,_0x22c000){return function(_0x4dd310){if(_0x4dd310){return _0x4dd310[_0xe9e0('0x25')]()['then'](function(){_0x1f9b21[_0xe9e0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b8c97,_0x1c39e3){return function(_0x4fc6a8){if(!_0x4fc6a8){_0x1b8c97[_0xe9e0('0x26')](0x194);}return _0x4fc6a8;};}function handleError(_0x176536,_0x1976f8){_0x1976f8=_0x1976f8||0x1f4;return function(_0x3a3715){logger[_0xe9e0('0x27')](_0x3a3715[_0xe9e0('0x28')]);if(_0x3a3715[_0xe9e0('0x29')]){delete _0x3a3715[_0xe9e0('0x29')];}_0x176536[_0xe9e0('0x1a')](_0x1976f8)['send'](_0x3a3715);};}exports['index']=function(_0x1a5bb6,_0x199956){var _0x5b9988={},_0x3954e9={},_0x58a307={'count':0x0,'rows':[]};var _0xa3d423=_[_0xe9e0('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x46a031){return{'name':_0x46a031[_0xe9e0('0x2b')],'type':_0x46a031[_0xe9e0('0x2c')][_0xe9e0('0x2d')]};});_0x3954e9[_0xe9e0('0x2e')]=_[_0xe9e0('0x2a')](_0xa3d423,_0xe9e0('0x29'));_0x3954e9['query']=_[_0xe9e0('0x2f')](_0x1a5bb6['query']);_0x3954e9[_0xe9e0('0x30')]=_[_0xe9e0('0x31')](_0x3954e9[_0xe9e0('0x2e')],_0x3954e9[_0xe9e0('0x32')]);_0x5b9988[_0xe9e0('0x33')]=_[_0xe9e0('0x31')](_0x3954e9[_0xe9e0('0x2e')],qs['fields'](_0x1a5bb6[_0xe9e0('0x32')][_0xe9e0('0x34')]));_0x5b9988[_0xe9e0('0x33')]=_0x5b9988[_0xe9e0('0x33')]['length']?_0x5b9988[_0xe9e0('0x33')]:_0x3954e9['model'];if(!_0x1a5bb6[_0xe9e0('0x32')][_0xe9e0('0x35')](_0xe9e0('0x36'))){_0x5b9988['limit']=qs['limit'](_0x1a5bb6['query'][_0xe9e0('0x1b')]);_0x5b9988['offset']=qs[_0xe9e0('0x1e')](_0x1a5bb6[_0xe9e0('0x32')][_0xe9e0('0x1e')]);}_0x5b9988['order']=qs[_0xe9e0('0x37')](_0x1a5bb6['query'][_0xe9e0('0x37')]);_0x5b9988[_0xe9e0('0x38')]=qs['filters'](_['pick'](_0x1a5bb6[_0xe9e0('0x32')],_0x3954e9['filters']),_0xa3d423);if(_0x1a5bb6[_0xe9e0('0x32')][_0xe9e0('0x39')]){_0x5b9988[_0xe9e0('0x38')]=_[_0xe9e0('0x3a')](_0x5b9988[_0xe9e0('0x38')],{'$or':_[_0xe9e0('0x2a')](_0xa3d423,function(_0x1c7968){if(_0x1c7968[_0xe9e0('0x2c')]!==_0xe9e0('0x3b')){var _0x51f98c={};_0x51f98c[_0x1c7968[_0xe9e0('0x29')]]={'$like':'%'+_0x1a5bb6['query']['filter']+'%'};return _0x51f98c;}})});}_0x5b9988=_[_0xe9e0('0x3a')]({},_0x5b9988,_0x1a5bb6[_0xe9e0('0x3c')]);var _0x221974={'where':_0x5b9988[_0xe9e0('0x38')]};return db[_0xe9e0('0x3d')][_0xe9e0('0x1d')](_0x221974)['then'](function(_0x36ef54){_0x58a307['count']=_0x36ef54;if(_0x1a5bb6[_0xe9e0('0x32')][_0xe9e0('0x3e')]){_0x5b9988[_0xe9e0('0x3f')]=[{'all':!![]}];}return db[_0xe9e0('0x3d')]['findAll'](_0x5b9988);})[_0xe9e0('0x40')](function(_0x1e65bb){_0x58a307[_0xe9e0('0x41')]=_0x1e65bb;return _0x58a307;})[_0xe9e0('0x40')](respondWithFilteredResult(_0x199956,_0x5b9988))[_0xe9e0('0x42')](handleError(_0x199956,null));};exports[_0xe9e0('0x43')]=function(_0x558223,_0x341e4f){var _0x375bc7={'raw':!![],'where':{'id':_0x558223[_0xe9e0('0x44')]['id']}},_0x5ac287={};_0x5ac287[_0xe9e0('0x2e')]=_[_0xe9e0('0x2f')](db[_0xe9e0('0x3d')][_0xe9e0('0x45')]);_0x5ac287[_0xe9e0('0x32')]=_[_0xe9e0('0x2f')](_0x558223[_0xe9e0('0x32')]);_0x5ac287[_0xe9e0('0x30')]=_[_0xe9e0('0x31')](_0x5ac287[_0xe9e0('0x2e')],_0x5ac287[_0xe9e0('0x32')]);_0x375bc7[_0xe9e0('0x33')]=_['intersection'](_0x5ac287['model'],qs[_0xe9e0('0x34')](_0x558223[_0xe9e0('0x32')][_0xe9e0('0x34')]));_0x375bc7[_0xe9e0('0x33')]=_0x375bc7['attributes'][_0xe9e0('0x46')]?_0x375bc7[_0xe9e0('0x33')]:_0x5ac287[_0xe9e0('0x2e')];if(_0x558223[_0xe9e0('0x32')][_0xe9e0('0x3e')]){_0x375bc7[_0xe9e0('0x3f')]=[{'all':!![]}];}_0x375bc7=_[_0xe9e0('0x3a')]({},_0x375bc7,_0x558223[_0xe9e0('0x3c')]);return db[_0xe9e0('0x3d')][_0xe9e0('0x47')](_0x375bc7)[_0xe9e0('0x40')](handleEntityNotFound(_0x341e4f,null))['then'](respondWithResult(_0x341e4f,null))[_0xe9e0('0x42')](handleError(_0x341e4f,null));};exports[_0xe9e0('0x48')]=function(_0x330596,_0x1e997d){return db[_0xe9e0('0x3d')]['create'](_0x330596[_0xe9e0('0x49')],{})['then'](respondWithResult(_0x1e997d,0xc9))[_0xe9e0('0x42')](handleError(_0x1e997d,null));};exports[_0xe9e0('0x24')]=function(_0x4247e1,_0x5cb968){if(_0x4247e1[_0xe9e0('0x49')]['id']){delete _0x4247e1[_0xe9e0('0x49')]['id'];}return db['FaxTransferReport'][_0xe9e0('0x47')]({'where':{'id':_0x4247e1[_0xe9e0('0x44')]['id']}})[_0xe9e0('0x40')](handleEntityNotFound(_0x5cb968,null))[_0xe9e0('0x40')](saveUpdates(_0x4247e1[_0xe9e0('0x49')],null))[_0xe9e0('0x40')](respondWithResult(_0x5cb968,null))[_0xe9e0('0x42')](handleError(_0x5cb968,null));};exports[_0xe9e0('0x25')]=function(_0x3faa44,_0x3071e2){return db['FaxTransferReport'][_0xe9e0('0x47')]({'where':{'id':_0x3faa44['params']['id']}})[_0xe9e0('0x40')](handleEntityNotFound(_0x3071e2,null))[_0xe9e0('0x40')](removeEntity(_0x3071e2,null))[_0xe9e0('0x42')](handleError(_0x3071e2,null));};exports[_0xe9e0('0x4a')]=function(_0x3fda9b,_0x589b74){return db[_0xe9e0('0x3d')]['describe']()[_0xe9e0('0x40')](respondWithResult(_0x589b74,null))['catch'](handleError(_0x589b74,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ece614f..fde6c8e 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 _0xac7a=['moment','bluebird','request-promise','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x445d6e,_0x3a9cc1){var _0x2368f5=function(_0x546173){while(--_0x546173){_0x445d6e['push'](_0x445d6e['shift']());}};_0x2368f5(++_0x3a9cc1);}(_0xac7a,0x1f4));var _0xaac7=function(_0xb2fbcf,_0x28a699){_0xb2fbcf=_0xb2fbcf-0x0;var _0x448577=_0xac7a[_0xb2fbcf];return _0x448577;};'use strict';var _=require(_0xaac7('0x0'));var util=require(_0xaac7('0x1'));var logger=require(_0xaac7('0x2'))(_0xaac7('0x3'));var moment=require(_0xaac7('0x4'));var BPromise=require(_0xaac7('0x5'));var rp=require(_0xaac7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaac7('0x7'));var config=require('../../config/environment');var attributes=require(_0xaac7('0x8'));module[_0xaac7('0x9')]=function(_0x5a0c51,_0x3be9c1){return _0x5a0c51['define'](_0xaac7('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xaac7('0xb'),'fields':[_0xaac7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e38=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x1ecbd4,_0x556696){var _0x4e73d8=function(_0x110821){while(--_0x110821){_0x1ecbd4['push'](_0x1ecbd4['shift']());}};_0x4e73d8(++_0x556696);}(_0x9e38,0x155));var _0x89e3=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x9e38[_0x786e9];return _0x1f891b;};'use strict';var _=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var logger=require(_0x89e3('0x2'))(_0x89e3('0x3'));var moment=require(_0x89e3('0x4'));var BPromise=require(_0x89e3('0x5'));var rp=require(_0x89e3('0x6'));var fs=require('fs');var path=require(_0x89e3('0x7'));var rimraf=require(_0x89e3('0x8'));var config=require(_0x89e3('0x9'));var attributes=require(_0x89e3('0xa'));module[_0x89e3('0xb')]=function(_0x424668,_0x592c1f){return _0x424668[_0x89e3('0xc')](_0x89e3('0xd'),attributes,{'tableName':_0x89e3('0xe'),'paranoid':![],'indexes':[{'name':_0x89e3('0xf'),'fields':[_0x89e3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 000d22e..a83731d 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 _0xc9c2=['stringify','code','error','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x32cb63,_0x50c74b){var _0xc78d79=function(_0x282fda){while(--_0x282fda){_0x32cb63['push'](_0x32cb63['shift']());}};_0xc78d79(++_0x50c74b);}(_0xc9c2,0xc4));var _0x2c9c=function(_0x81d23e,_0x176dc5){_0x81d23e=_0x81d23e-0x0;var _0x1ec56d=_0xc9c2[_0x81d23e];return _0x1ec56d;};'use strict';var _=require(_0x2c9c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c9c('0x1'));var rs=require(_0x2c9c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c9c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c9c('0x4'));var config=require(_0x2c9c('0x5'));var jayson=require(_0x2c9c('0x6'));var client=jayson[_0x2c9c('0x7')][_0x2c9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x845b70,_0x40402f,_0x3c54c8){return new BPromise(function(_0x2c1fc2,_0x381e5e){return client['request'](_0x845b70,_0x3c54c8)[_0x2c9c('0x9')](function(_0x3962c5){logger['info'](_0x2c9c('0xa'),_0x40402f,_0x2c9c('0xb'));logger[_0x2c9c('0xc')](_0x2c9c('0xd'),_0x40402f,'request\x20sent',JSON[_0x2c9c('0xe')](_0x3962c5));if(_0x3962c5['error']){if(_0x3962c5['error'][_0x2c9c('0xf')]===0x1f4){logger['error'](_0x2c9c('0xa'),_0x40402f,_0x3962c5[_0x2c9c('0x10')][_0x2c9c('0x11')]);return _0x381e5e(_0x3962c5[_0x2c9c('0x10')][_0x2c9c('0x11')]);}logger[_0x2c9c('0x10')](_0x2c9c('0xa'),_0x40402f,_0x3962c5[_0x2c9c('0x10')][_0x2c9c('0x11')]);return _0x2c1fc2(_0x3962c5['error'][_0x2c9c('0x11')]);}else{logger[_0x2c9c('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x40402f,_0x2c9c('0xb'));_0x2c1fc2(_0x3962c5[_0x2c9c('0x13')][_0x2c9c('0x11')]);}})[_0x2c9c('0x14')](function(_0x1939cf){logger[_0x2c9c('0x10')](_0x2c9c('0xa'),_0x40402f,_0x1939cf);_0x381e5e(_0x1939cf);});});} \ No newline at end of file +var _0x88fe=['rpc','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xdfe6af,_0x2e5e94){var _0x3e56ae=function(_0x13719f){while(--_0x13719f){_0xdfe6af['push'](_0xdfe6af['shift']());}};_0x3e56ae(++_0x2e5e94);}(_0x88fe,0x1f1));var _0xe88f=function(_0xf10840,_0xad3916){_0xf10840=_0xf10840-0x0;var _0x1fdf7e=_0x88fe[_0xf10840];return _0x1fdf7e;};'use strict';var _=require('lodash');var util=require(_0xe88f('0x0'));var moment=require(_0xe88f('0x1'));var BPromise=require(_0xe88f('0x2'));var rs=require(_0xe88f('0x3'));var fs=require('fs');var Redis=require(_0xe88f('0x4'));var db=require(_0xe88f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe88f('0x6'))(_0xe88f('0x7'));var config=require(_0xe88f('0x8'));var jayson=require(_0xe88f('0x9'));var client=jayson[_0xe88f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23a6ba,_0x277f0d,_0x5c95f9){return new BPromise(function(_0x3a5b3e,_0x183bff){return client[_0xe88f('0xb')](_0x23a6ba,_0x5c95f9)['then'](function(_0x89d8ba){logger[_0xe88f('0xc')](_0xe88f('0xd'),_0x277f0d,_0xe88f('0xe'));logger[_0xe88f('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x277f0d,_0xe88f('0xe'),JSON[_0xe88f('0x10')](_0x89d8ba));if(_0x89d8ba[_0xe88f('0x11')]){if(_0x89d8ba['error']['code']===0x1f4){logger[_0xe88f('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x277f0d,_0x89d8ba[_0xe88f('0x11')][_0xe88f('0x12')]);return _0x183bff(_0x89d8ba[_0xe88f('0x11')][_0xe88f('0x12')]);}logger['error'](_0xe88f('0xd'),_0x277f0d,_0x89d8ba['error'][_0xe88f('0x12')]);return _0x3a5b3e(_0x89d8ba[_0xe88f('0x11')][_0xe88f('0x12')]);}else{logger['info'](_0xe88f('0xd'),_0x277f0d,_0xe88f('0xe'));_0x3a5b3e(_0x89d8ba[_0xe88f('0x13')][_0xe88f('0x12')]);}})[_0xe88f('0x14')](function(_0x3dbe66){logger[_0xe88f('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x277f0d,_0x3dbe66);_0x183bff(_0x3dbe66);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 653d540..6f27356 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 _0x97cc=['index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','path','express','Router','fs-extra','../../config/environment'];(function(_0x569970,_0x16f028){var _0x13cc81=function(_0x313dc2){while(--_0x313dc2){_0x569970['push'](_0x569970['shift']());}};_0x13cc81(++_0x16f028);}(_0x97cc,0x163));var _0xc97c=function(_0x41e8fc,_0x109b29){_0x41e8fc=_0x41e8fc-0x0;var _0x22b788=_0x97cc[_0x41e8fc];return _0x22b788;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc97c('0x0'));var timeout=require('connect-timeout');var express=require(_0xc97c('0x1'));var router=express[_0xc97c('0x2')]();var fs_extra=require(_0xc97c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc97c('0x4'));var controller=require('./faxTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc97c('0x5')]);router[_0xc97c('0x6')](_0xc97c('0x7'),auth[_0xc97c('0x8')](),controller[_0xc97c('0x9')]);router[_0xc97c('0x6')](_0xc97c('0xa'),auth[_0xc97c('0x8')](),controller[_0xc97c('0xb')]);router[_0xc97c('0xc')]('/',auth[_0xc97c('0x8')](),controller[_0xc97c('0xd')]);router[_0xc97c('0xe')](_0xc97c('0xa'),auth[_0xc97c('0x8')](),controller[_0xc97c('0xf')]);router[_0xc97c('0x10')](_0xc97c('0xa'),auth[_0xc97c('0x8')](),controller[_0xc97c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x00e4=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1229e7,_0x516ba7){var _0x42f7ee=function(_0x40dafb){while(--_0x40dafb){_0x1229e7['push'](_0x1229e7['shift']());}};_0x42f7ee(++_0x516ba7);}(_0x00e4,0x1bd));var _0x400e=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00e4[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x400e('0x0'));var util=require(_0x400e('0x1'));var path=require(_0x400e('0x2'));var timeout=require(_0x400e('0x3'));var express=require(_0x400e('0x4'));var router=express['Router']();var fs_extra=require(_0x400e('0x5'));var auth=require(_0x400e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x400e('0x7'));var controller=require(_0x400e('0x8'));router[_0x400e('0x9')]('/',auth[_0x400e('0xa')](),controller[_0x400e('0xb')]);router[_0x400e('0x9')](_0x400e('0xc'),auth[_0x400e('0xa')](),controller[_0x400e('0xd')]);router['get'](_0x400e('0xe'),auth[_0x400e('0xa')](),controller[_0x400e('0xf')]);router[_0x400e('0x10')]('/',auth[_0x400e('0xa')](),controller[_0x400e('0x11')]);router[_0x400e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x400e('0x13')]);router[_0x400e('0x14')](_0x400e('0xe'),auth[_0x400e('0xa')](),controller[_0x400e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 926ea3f..9c107a5 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 _0x5c66=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','delete'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x5c66,0x14b));var _0x65c6=function(_0x3ef806,_0x4eae75){_0x3ef806=_0x3ef806-0x0;var _0x4e3570=_0x5c66[_0x3ef806];return _0x4e3570;};'use strict';var multer=require(_0x65c6('0x0'));var util=require('util');var path=require(_0x65c6('0x1'));var timeout=require(_0x65c6('0x2'));var express=require('express');var router=express[_0x65c6('0x3')]();var fs_extra=require(_0x65c6('0x4'));var auth=require(_0x65c6('0x5'));var interaction=require(_0x65c6('0x6'));var config=require(_0x65c6('0x7'));var controller=require(_0x65c6('0x8'));router[_0x65c6('0x9')]('/',auth['isAuthenticated'](),controller[_0x65c6('0xa')]);router[_0x65c6('0x9')](_0x65c6('0xb'),auth[_0x65c6('0xc')](),controller[_0x65c6('0xd')]);router[_0x65c6('0x9')]('/:id/configurations',auth[_0x65c6('0xc')](),controller['getConfigurations']);router[_0x65c6('0x9')](_0x65c6('0xe'),auth[_0x65c6('0xc')](),controller[_0x65c6('0xf')]);router[_0x65c6('0x10')]('/',auth[_0x65c6('0xc')](),controller['create']);router[_0x65c6('0x10')](_0x65c6('0x11'),auth[_0x65c6('0xc')](),controller[_0x65c6('0x12')]);router[_0x65c6('0x13')](_0x65c6('0xb'),auth[_0x65c6('0xc')](),controller['update']);router[_0x65c6('0x14')]('/:id',auth[_0x65c6('0xc')](),controller['destroy']);module[_0x65c6('0x15')]=router; \ No newline at end of file +var _0x3253=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','util','connect-timeout','express'];(function(_0x169346,_0x5c39ee){var _0x199e80=function(_0x6bf7c0){while(--_0x6bf7c0){_0x169346['push'](_0x169346['shift']());}};_0x199e80(++_0x5c39ee);}(_0x3253,0x11a));var _0x3325=function(_0x5fe69a,_0x5484f5){_0x5fe69a=_0x5fe69a-0x0;var _0x3f1aee=_0x3253[_0x5fe69a];return _0x3f1aee;};'use strict';var multer=require('multer');var util=require(_0x3325('0x0'));var path=require('path');var timeout=require(_0x3325('0x1'));var express=require(_0x3325('0x2'));var router=express[_0x3325('0x3')]();var fs_extra=require(_0x3325('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3325('0x5'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x3325('0x6')]('/',auth[_0x3325('0x7')](),controller[_0x3325('0x8')]);router[_0x3325('0x6')](_0x3325('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3325('0x6')](_0x3325('0xa'),auth[_0x3325('0x7')](),controller['getConfigurations']);router[_0x3325('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3325('0xb')]);router[_0x3325('0xc')]('/',auth[_0x3325('0x7')](),controller[_0x3325('0xd')]);router[_0x3325('0xc')](_0x3325('0xa'),auth[_0x3325('0x7')](),controller[_0x3325('0xe')]);router[_0x3325('0xf')](_0x3325('0x9'),auth[_0x3325('0x7')](),controller[_0x3325('0x10')]);router[_0x3325('0x11')](_0x3325('0x9'),auth[_0x3325('0x7')](),controller[_0x3325('0x12')]);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 70dafb4..509793a 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 _0x83af=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0xca3e47,_0x49e3d1){var _0x3e09cf=function(_0x386cd6){while(--_0x386cd6){_0xca3e47['push'](_0xca3e47['shift']());}};_0x3e09cf(++_0x49e3d1);}(_0x83af,0x1ec));var _0xf83a=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x83af[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0xf83a('0x0'));module[_0xf83a('0x1')]={'name':{'type':Sequelize[_0xf83a('0x2')]},'description':{'type':Sequelize[_0xf83a('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf83a('0x2')]},'authType':{'type':Sequelize[_0xf83a('0x3')](_0xf83a('0x4')),'defaultValue':_0xf83a('0x4')},'password':{'type':Sequelize[_0xf83a('0x2')]},'consumerKey':{'type':Sequelize[_0xf83a('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf83a('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf83a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf83a('0x3')](_0xf83a('0x5'),_0xf83a('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x167c=['STRING','basic','integrationTab','exports'];(function(_0x420a9e,_0x5b2bf1){var _0x15476e=function(_0x1b43c1){while(--_0x1b43c1){_0x420a9e['push'](_0x420a9e['shift']());}};_0x15476e(++_0x5b2bf1);}(_0x167c,0x12b));var _0xc167=function(_0x41ca72,_0x18aad5){_0x41ca72=_0x41ca72-0x0;var _0x501345=_0x167c[_0x41ca72];return _0x501345;};'use strict';var Sequelize=require('sequelize');module[_0xc167('0x0')]={'name':{'type':Sequelize[_0xc167('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xc167('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xc167('0x1')]},'consumerKey':{'type':Sequelize[_0xc167('0x1')]},'consumerSecret':{'type':Sequelize[_0xc167('0x1')]},'token':{'type':Sequelize[_0xc167('0x1')]},'tokenSecret':{'type':Sequelize[_0xc167('0x1')]},'serverUrl':{'type':Sequelize[_0xc167('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc167('0x3'),'newTab'),'defaultValue':_0xc167('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 7c54bbc..1e118f5 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 _0xb074=['password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','base64','concat','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','show','params','options','catch','body','find','getConfigurations','findOne','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','create','DeskField','Subjects','getFields','priority','authType'];(function(_0x429e11,_0x5566dd){var _0x20a53c=function(_0x1b6e11){while(--_0x1b6e11){_0x429e11['push'](_0x429e11['shift']());}};_0x20a53c(++_0x5566dd);}(_0xb074,0xfb));var _0x4b07=function(_0x5cff18,_0x5615f5){_0x5cff18=_0x5cff18-0x0;var _0x33027d=_0xb074[_0x5cff18];return _0x33027d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b07('0x0'));var zipdir=require(_0x4b07('0x1'));var jsonpatch=require(_0x4b07('0x2'));var rp=require(_0x4b07('0x3'));var moment=require(_0x4b07('0x4'));var BPromise=require(_0x4b07('0x5'));var Mustache=require(_0x4b07('0x6'));var util=require('util');var path=require(_0x4b07('0x7'));var sox=require(_0x4b07('0x8'));var csv=require(_0x4b07('0x9'));var ejs=require(_0x4b07('0xa'));var fs=require('fs');var fs_extra=require(_0x4b07('0xb'));var _=require('lodash');var squel=require(_0x4b07('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b07('0xd'));var deskjs=require(_0x4b07('0xe'));var toCsv=require(_0x4b07('0x9'));var querystring=require(_0x4b07('0xf'));var Papa=require(_0x4b07('0x10'));var Redis=require(_0x4b07('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4b07('0x12'));var as=require(_0x4b07('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b07('0x14'))(_0x4b07('0x15'));var utils=require(_0x4b07('0x16'));var config=require(_0x4b07('0x17'));var licenseUtil=require(_0x4b07('0x18'));var db=require(_0x4b07('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5cfa4b,_0x5ddecd){_0x5ddecd=_0x5ddecd||0xcc;return function(_0x3e8873){if(_0x3e8873){return _0x5cfa4b[_0x4b07('0x1a')](_0x5ddecd);}return _0x5cfa4b[_0x4b07('0x1b')](_0x5ddecd)['end']();};}function respondWithResult(_0x523d76,_0x4ef9b5){_0x4ef9b5=_0x4ef9b5||0xc8;return function(_0x4825d4){if(_0x4825d4){return _0x523d76['status'](_0x4ef9b5)['json'](_0x4825d4);}};}function respondWithFilteredResult(_0x4aa878,_0x792a8a){return function(_0x3fa032){if(_0x3fa032){var _0x1380a4=typeof _0x792a8a[_0x4b07('0x1c')]==='undefined'&&typeof _0x792a8a[_0x4b07('0x1d')]==='undefined';var _0x279d16=_0x3fa032[_0x4b07('0x1e')];var _0x2034ae=_0x1380a4?0x0:_0x792a8a[_0x4b07('0x1c')];var _0x3ae919=_0x1380a4?_0x3fa032['count']:_0x792a8a[_0x4b07('0x1c')]+_0x792a8a['limit'];var _0x287f3f;if(_0x3ae919>=_0x279d16){_0x3ae919=_0x279d16;_0x287f3f=0xc8;}else{_0x287f3f=0xce;}_0x4aa878[_0x4b07('0x1b')](_0x287f3f);return _0x4aa878[_0x4b07('0x1f')](_0x4b07('0x20'),_0x2034ae+'-'+_0x3ae919+'/'+_0x279d16)['json'](_0x3fa032);}return null;};}function patchUpdates(_0x1e6126){return function(_0xf4d804){try{jsonpatch[_0x4b07('0x21')](_0xf4d804,_0x1e6126,!![]);}catch(_0x3a352a){return BPromise[_0x4b07('0x22')](_0x3a352a);}return _0xf4d804[_0x4b07('0x23')]();};}function saveUpdates(_0x41443f,_0x5662f2){return function(_0x4752f0){if(_0x4752f0){return _0x4752f0[_0x4b07('0x24')](_0x41443f)[_0x4b07('0x25')](function(_0x531039){return _0x531039;});}return null;};}function removeEntity(_0x16cf51,_0x51f0d9){return function(_0x5cc0b9){if(_0x5cc0b9){return _0x5cc0b9[_0x4b07('0x26')]()[_0x4b07('0x25')](function(){_0x16cf51[_0x4b07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429ded,_0x32e876){return function(_0x5c6f45){if(!_0x5c6f45){_0x429ded[_0x4b07('0x1a')](0x194);}return _0x5c6f45;};}function handleError(_0x212e1c,_0x1c7b37){_0x1c7b37=_0x1c7b37||0x1f4;return function(_0x45cf6d){logger[_0x4b07('0x27')](_0x45cf6d[_0x4b07('0x28')]);if(_0x45cf6d['name']){delete _0x45cf6d[_0x4b07('0x29')];}_0x212e1c[_0x4b07('0x1b')](_0x1c7b37)['send'](_0x45cf6d);};}exports[_0x4b07('0x2a')]=function(_0x132b82,_0xbaed57){var _0x296cab={},_0x5e4270={},_0x561a55={'count':0x0,'rows':[]};var _0x525e2d=_[_0x4b07('0x2b')](db[_0x4b07('0x2c')][_0x4b07('0x2d')],function(_0x4b5e73){return{'name':_0x4b5e73[_0x4b07('0x2e')],'type':_0x4b5e73['type'][_0x4b07('0x2f')]};});_0x5e4270[_0x4b07('0x30')]=_[_0x4b07('0x2b')](_0x525e2d,_0x4b07('0x29'));_0x5e4270['query']=_[_0x4b07('0x31')](_0x132b82[_0x4b07('0x32')]);_0x5e4270['filters']=_[_0x4b07('0x33')](_0x5e4270[_0x4b07('0x30')],_0x5e4270[_0x4b07('0x32')]);_0x296cab[_0x4b07('0x34')]=_['intersection'](_0x5e4270[_0x4b07('0x30')],qs[_0x4b07('0x35')](_0x132b82[_0x4b07('0x32')][_0x4b07('0x35')]));_0x296cab[_0x4b07('0x34')]=_0x296cab['attributes'][_0x4b07('0x36')]?_0x296cab[_0x4b07('0x34')]:_0x5e4270[_0x4b07('0x30')];if(!_0x132b82[_0x4b07('0x32')][_0x4b07('0x37')](_0x4b07('0x38'))){_0x296cab[_0x4b07('0x1d')]=qs[_0x4b07('0x1d')](_0x132b82[_0x4b07('0x32')][_0x4b07('0x1d')]);_0x296cab['offset']=qs[_0x4b07('0x1c')](_0x132b82['query']['offset']);}_0x296cab[_0x4b07('0x39')]=qs[_0x4b07('0x3a')](_0x132b82[_0x4b07('0x32')]['sort']);_0x296cab[_0x4b07('0x3b')]=qs[_0x4b07('0x3c')](_[_0x4b07('0x3d')](_0x132b82[_0x4b07('0x32')],_0x5e4270[_0x4b07('0x3c')]),_0x525e2d);if(_0x132b82[_0x4b07('0x32')][_0x4b07('0x3e')]){_0x296cab[_0x4b07('0x3b')]=_[_0x4b07('0x3f')](_0x296cab[_0x4b07('0x3b')],{'$or':_[_0x4b07('0x2b')](_0x525e2d,function(_0x3e992c){if(_0x3e992c[_0x4b07('0x40')]!==_0x4b07('0x41')){var _0x59f908={};_0x59f908[_0x3e992c[_0x4b07('0x29')]]={'$like':'%'+_0x132b82[_0x4b07('0x32')]['filter']+'%'};return _0x59f908;}})});}_0x296cab=_[_0x4b07('0x3f')]({},_0x296cab,_0x132b82['options']);var _0xd5f5b7={'where':_0x296cab['where']};return db[_0x4b07('0x2c')][_0x4b07('0x1e')](_0xd5f5b7)['then'](function(_0x26d23c){_0x561a55['count']=_0x26d23c;if(_0x132b82[_0x4b07('0x32')][_0x4b07('0x42')]){_0x296cab[_0x4b07('0x43')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x296cab);})['then'](function(_0xbb2370){_0x561a55['rows']=_0xbb2370;return _0x561a55;})[_0x4b07('0x25')](respondWithFilteredResult(_0xbaed57,_0x296cab))['catch'](handleError(_0xbaed57,null));};exports[_0x4b07('0x44')]=function(_0x223e82,_0x3a34a6){var _0x587f9e={'raw':![],'where':{'id':_0x223e82[_0x4b07('0x45')]['id']}},_0x325b27={};_0x325b27[_0x4b07('0x30')]=_[_0x4b07('0x31')](db[_0x4b07('0x2c')][_0x4b07('0x2d')]);_0x325b27[_0x4b07('0x32')]=_[_0x4b07('0x31')](_0x223e82[_0x4b07('0x32')]);_0x325b27[_0x4b07('0x3c')]=_[_0x4b07('0x33')](_0x325b27[_0x4b07('0x30')],_0x325b27[_0x4b07('0x32')]);_0x587f9e[_0x4b07('0x34')]=_['intersection'](_0x325b27[_0x4b07('0x30')],qs['fields'](_0x223e82[_0x4b07('0x32')]['fields']));_0x587f9e[_0x4b07('0x34')]=_0x587f9e['attributes'][_0x4b07('0x36')]?_0x587f9e[_0x4b07('0x34')]:_0x325b27[_0x4b07('0x30')];if(_0x223e82['query']['includeAll']){_0x587f9e[_0x4b07('0x43')]=[{'all':!![]}];}_0x587f9e=_['merge']({},_0x587f9e,_0x223e82[_0x4b07('0x46')]);return db[_0x4b07('0x2c')]['find'](_0x587f9e)[_0x4b07('0x25')](handleEntityNotFound(_0x3a34a6,null))[_0x4b07('0x25')](respondWithResult(_0x3a34a6,null))[_0x4b07('0x47')](handleError(_0x3a34a6,null));};exports['create']=function(_0x11afe0,_0x40873b){return db[_0x4b07('0x2c')]['create'](_0x11afe0[_0x4b07('0x48')],{})['then'](respondWithResult(_0x40873b,0xc9))['catch'](handleError(_0x40873b,null));};exports['update']=function(_0x188126,_0x10cef5){if(_0x188126[_0x4b07('0x48')]['id']){delete _0x188126['body']['id'];}return db[_0x4b07('0x2c')][_0x4b07('0x49')]({'where':{'id':_0x188126[_0x4b07('0x45')]['id']}})[_0x4b07('0x25')](handleEntityNotFound(_0x10cef5,null))['then'](saveUpdates(_0x188126['body'],null))[_0x4b07('0x25')](respondWithResult(_0x10cef5,null))[_0x4b07('0x47')](handleError(_0x10cef5,null));};exports[_0x4b07('0x26')]=function(_0x4e562f,_0x2acd3c){return db[_0x4b07('0x2c')]['find']({'where':{'id':_0x4e562f[_0x4b07('0x45')]['id']}})[_0x4b07('0x25')](handleEntityNotFound(_0x2acd3c,null))['then'](removeEntity(_0x2acd3c,null))[_0x4b07('0x47')](handleError(_0x2acd3c,null));};exports[_0x4b07('0x4a')]=function(_0x1df049,_0x1059f5,_0x39e589){var _0x1e5b54={};var _0x483c2c={};var _0x46ad71;var _0x2caf61;return db[_0x4b07('0x2c')][_0x4b07('0x4b')]({'where':{'id':_0x1df049[_0x4b07('0x45')]['id']}})[_0x4b07('0x25')](handleEntityNotFound(_0x1059f5,null))[_0x4b07('0x25')](function(_0x2eb6de){if(_0x2eb6de){_0x46ad71=_0x2eb6de;_0x483c2c['model']=_[_0x4b07('0x31')](db['DeskConfiguration'][_0x4b07('0x2d')]);_0x483c2c[_0x4b07('0x32')]=_[_0x4b07('0x31')](_0x1df049[_0x4b07('0x32')]);_0x483c2c[_0x4b07('0x3c')]=_[_0x4b07('0x33')](_0x483c2c[_0x4b07('0x30')],_0x483c2c['query']);_0x1e5b54['attributes']=_[_0x4b07('0x33')](_0x483c2c['model'],qs['fields'](_0x1df049[_0x4b07('0x32')][_0x4b07('0x35')]));_0x1e5b54[_0x4b07('0x34')]=_0x1e5b54[_0x4b07('0x34')][_0x4b07('0x36')]?_0x1e5b54[_0x4b07('0x34')]:_0x483c2c[_0x4b07('0x30')];_0x1e5b54[_0x4b07('0x39')]=qs[_0x4b07('0x3a')](_0x1df049['query'][_0x4b07('0x3a')]);_0x1e5b54[_0x4b07('0x3b')]=qs[_0x4b07('0x3c')](_[_0x4b07('0x3d')](_0x1df049[_0x4b07('0x32')],_0x483c2c[_0x4b07('0x3c')]));if(_0x1df049[_0x4b07('0x32')]['filter']){_0x1e5b54[_0x4b07('0x3b')]=_[_0x4b07('0x3f')](_0x1e5b54[_0x4b07('0x3b')],{'$or':_[_0x4b07('0x2b')](_0x1e5b54[_0x4b07('0x34')],function(_0x457c76){var _0x55a3f1={};_0x55a3f1[_0x457c76]={'$like':'%'+_0x1df049['query'][_0x4b07('0x3e')]+'%'};return _0x55a3f1;})});}_0x1e5b54=_[_0x4b07('0x3f')]({},_0x1e5b54,_0x1df049['options']);return _0x46ad71[_0x4b07('0x4a')](_0x1e5b54);}})[_0x4b07('0x25')](function(_0x128c0a){if(_0x128c0a){_0x2caf61=_0x128c0a[_0x4b07('0x36')];if(!_0x1df049[_0x4b07('0x32')][_0x4b07('0x37')](_0x4b07('0x38'))){_0x1e5b54['limit']=qs[_0x4b07('0x1d')](_0x1df049[_0x4b07('0x32')][_0x4b07('0x1d')]);_0x1e5b54[_0x4b07('0x1c')]=qs[_0x4b07('0x1c')](_0x1df049[_0x4b07('0x32')][_0x4b07('0x1c')]);}return _0x46ad71['getConfigurations'](_0x1e5b54);}})[_0x4b07('0x25')](function(_0x3ab03a){if(_0x3ab03a){return _0x3ab03a?{'count':_0x2caf61,'rows':_0x3ab03a}:null;}})['then'](respondWithResult(_0x1059f5,null))[_0x4b07('0x47')](handleError(_0x1059f5,null));};exports[_0x4b07('0x4c')]=function(_0x120a18,_0x22a064,_0x2abdbf){if(_0x120a18[_0x4b07('0x48')]['id']){delete _0x120a18[_0x4b07('0x48')]['id'];}return db[_0x4b07('0x2c')][_0x4b07('0x4b')]({'where':{'id':_0x120a18[_0x4b07('0x45')]['id']}})[_0x4b07('0x25')](handleEntityNotFound(_0x22a064,null))['then'](function(_0x1cce59){if(_0x1cce59){_0x120a18[_0x4b07('0x48')]['AccountId']=_0x1cce59['id'];_0x120a18[_0x4b07('0x48')]['Subjects']=integrations[_0x4b07('0x4d')](_0x120a18[_0x4b07('0x48')][_0x4b07('0x4e')],_0x120a18[_0x4b07('0x48')][_0x4b07('0x40')]);_0x120a18[_0x4b07('0x48')][_0x4b07('0x4f')]=integrations[_0x4b07('0x50')](_0x120a18['body'][_0x4b07('0x4e')],_0x120a18[_0x4b07('0x48')]['type']);return db[_0x4b07('0x51')][_0x4b07('0x52')](_0x120a18['body'],{'include':[{'model':db[_0x4b07('0x53')],'as':_0x4b07('0x54')},{'model':db[_0x4b07('0x53')],'as':_0x4b07('0x4f')}]});}return null;})[_0x4b07('0x25')](respondWithResult(_0x22a064,null))[_0x4b07('0x47')](handleError(_0x22a064,null));};exports[_0x4b07('0x55')]=function(_0x48b02e,_0x4294e7,_0x4ae5fb){var _0x32f1f2=[{'name':_0x4b07('0x56'),'label':_0x4b07('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 _0xda826f='';return db[_0x4b07('0x2c')][_0x4b07('0x4b')]({'where':{'id':_0x48b02e[_0x4b07('0x45')]['id']},'attributes':['id','remoteUri',_0x4b07('0x57'),'username',_0x4b07('0x58'),_0x4b07('0x59'),_0x4b07('0x5a'),_0x4b07('0x5b'),_0x4b07('0x5c')]})['then'](handleEntityNotFound(_0x4294e7,null))[_0x4b07('0x25')](function(_0x340993){if(_0x340993){_0xda826f=_0x340993[_0x4b07('0x5d')];var _0xc6a08d=_0xda826f[_0x4b07('0x5e')](-0x1);if(_0xc6a08d==='/'){_0xda826f=_0xda826f['substring'](0x0,_0xda826f['lastIndexOf'](_0xc6a08d));}var _0x355745={'method':_0x4b07('0x5f'),'uri':util[_0x4b07('0x60')](_0x4b07('0x61'),_0xda826f),'headers':{'Content-Type':_0x4b07('0x62'),'Accept':_0x4b07('0x62')},'json':!![]};if(_0x340993[_0x4b07('0x57')]===_0x4b07('0x63')){_0x355745[_0x4b07('0x64')][_0x4b07('0x65')]=util[_0x4b07('0x60')]('Basic\x20%s',new Buffer(util[_0x4b07('0x60')](_0x4b07('0x66'),_0x340993['username'],_0x340993[_0x4b07('0x58')]))['toString'](_0x4b07('0x67')));}return rp(_0x355745)['then'](function(_0xc698b1){return _0x32f1f2[_0x4b07('0x68')](_[_0x4b07('0x2b')](_0xc698b1['_embedded'][_0x4b07('0x69')],function(_0x2ddf8c){return{'id':_0x2ddf8c[_0x4b07('0x29')],'name':_0x2ddf8c[_0x4b07('0x29')],'type':_0x2ddf8c[_0x4b07('0x40')],'active':_0x2ddf8c[_0x4b07('0x6a')],'label':_0x2ddf8c[_0x4b07('0x6b')],'custom':!![]};}));});}})[_0x4b07('0x25')](function(_0x30bbd5){return{'count':_0x30bbd5[_0x4b07('0x36')],'rows':_0x30bbd5};})[_0x4b07('0x25')](respondWithResult(_0x4294e7,null))[_0x4b07('0x47')](function(_0x1896fd){var _0x3b9c2e=_0x48b02e[_0x4b07('0x32')][_0x4b07('0x6c')]?0x1f4:_0x1896fd['statusCode']||0x1f4;logger[_0x4b07('0x27')](_0x4b07('0x6d'),_0x4b07('0x55'),_0x3b9c2e,JSON[_0x4b07('0x6e')](_0x1896fd));delete _0x1896fd['name'];if(_0x3b9c2e===0x191){_0x3b9c2e=0x190;}_0x4294e7[_0x4b07('0x1b')](_0x3b9c2e)['send'](_0x48b02e[_0x4b07('0x32')][_0x4b07('0x6c')]?{'message':_0x4b07('0x6f'),'statusCode':_0x1896fd[_0x4b07('0x70')]}:_0x1896fd);});}; \ No newline at end of file +var _0xce72=['priority','authType','username','password','consumerSecret','token','tokenSecret','substring','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','toString','concat','entries','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','DeskAccount','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','options','find','create','update','body','getConfigurations','findOne','DeskConfiguration','order','nolimit','addConfiguration','Subjects','getDescriptions','DeskField','Descriptions','getFields'];(function(_0x8c0431,_0x412010){var _0x50087a=function(_0x8f0caa){while(--_0x8f0caa){_0x8c0431['push'](_0x8c0431['shift']());}};_0x50087a(++_0x412010);}(_0xce72,0xf1));var _0x2ce7=function(_0x4ed9b4,_0x2a37ec){_0x4ed9b4=_0x4ed9b4-0x0;var _0x38c24b=_0xce72[_0x4ed9b4];return _0x38c24b;};'use strict';var emlformat=require(_0x2ce7('0x0'));var rimraf=require(_0x2ce7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ce7('0x2'));var rp=require(_0x2ce7('0x3'));var moment=require('moment');var BPromise=require(_0x2ce7('0x4'));var Mustache=require(_0x2ce7('0x5'));var util=require(_0x2ce7('0x6'));var path=require(_0x2ce7('0x7'));var sox=require(_0x2ce7('0x8'));var csv=require(_0x2ce7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ce7('0xa'));var _=require(_0x2ce7('0xb'));var squel=require(_0x2ce7('0xc'));var crypto=require(_0x2ce7('0xd'));var jsforce=require(_0x2ce7('0xe'));var deskjs=require(_0x2ce7('0xf'));var toCsv=require(_0x2ce7('0x9'));var querystring=require(_0x2ce7('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ce7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2ce7('0x12'));var as=require(_0x2ce7('0x13'));var hardwareService=require(_0x2ce7('0x14'));var logger=require(_0x2ce7('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2ce7('0x16'));var licenseUtil=require(_0x2ce7('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xbb17c4,_0x5927f0){_0x5927f0=_0x5927f0||0xcc;return function(_0x37c885){if(_0x37c885){return _0xbb17c4[_0x2ce7('0x18')](_0x5927f0);}return _0xbb17c4[_0x2ce7('0x19')](_0x5927f0)[_0x2ce7('0x1a')]();};}function respondWithResult(_0x54d624,_0x502db1){_0x502db1=_0x502db1||0xc8;return function(_0xfc3dde){if(_0xfc3dde){return _0x54d624[_0x2ce7('0x19')](_0x502db1)['json'](_0xfc3dde);}};}function respondWithFilteredResult(_0x5e02b7,_0x50f3e1){return function(_0x3c4cec){if(_0x3c4cec){var _0x43be76=typeof _0x50f3e1[_0x2ce7('0x1b')]===_0x2ce7('0x1c')&&typeof _0x50f3e1['limit']==='undefined';var _0x3300c9=_0x3c4cec[_0x2ce7('0x1d')];var _0x518d01=_0x43be76?0x0:_0x50f3e1[_0x2ce7('0x1b')];var _0x4a68ac=_0x43be76?_0x3c4cec[_0x2ce7('0x1d')]:_0x50f3e1['offset']+_0x50f3e1[_0x2ce7('0x1e')];var _0x11c165;if(_0x4a68ac>=_0x3300c9){_0x4a68ac=_0x3300c9;_0x11c165=0xc8;}else{_0x11c165=0xce;}_0x5e02b7[_0x2ce7('0x19')](_0x11c165);return _0x5e02b7[_0x2ce7('0x1f')](_0x2ce7('0x20'),_0x518d01+'-'+_0x4a68ac+'/'+_0x3300c9)[_0x2ce7('0x21')](_0x3c4cec);}return null;};}function patchUpdates(_0x4023f9){return function(_0x435067){try{jsonpatch['apply'](_0x435067,_0x4023f9,!![]);}catch(_0x18044a){return BPromise[_0x2ce7('0x22')](_0x18044a);}return _0x435067[_0x2ce7('0x23')]();};}function saveUpdates(_0x7dc49c,_0x556c77){return function(_0x7f4938){if(_0x7f4938){return _0x7f4938['update'](_0x7dc49c)['then'](function(_0x5706e3){return _0x5706e3;});}return null;};}function removeEntity(_0x36672d,_0x361fd4){return function(_0x34d64b){if(_0x34d64b){return _0x34d64b[_0x2ce7('0x24')]()[_0x2ce7('0x25')](function(){_0x36672d[_0x2ce7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3233cd,_0x2b48d2){return function(_0x4fb3a0){if(!_0x4fb3a0){_0x3233cd[_0x2ce7('0x18')](0x194);}return _0x4fb3a0;};}function handleError(_0xe18c68,_0x3e2783){_0x3e2783=_0x3e2783||0x1f4;return function(_0x37fd6d){logger[_0x2ce7('0x26')](_0x37fd6d[_0x2ce7('0x27')]);if(_0x37fd6d[_0x2ce7('0x28')]){delete _0x37fd6d[_0x2ce7('0x28')];}_0xe18c68[_0x2ce7('0x19')](_0x3e2783)[_0x2ce7('0x29')](_0x37fd6d);};}exports[_0x2ce7('0x2a')]=function(_0xd2a2f0,_0x168321){var _0x13306b={},_0x13d1de={},_0x508451={'count':0x0,'rows':[]};var _0x5dc3ab=_[_0x2ce7('0x2b')](db[_0x2ce7('0x2c')]['rawAttributes'],function(_0x5f0d45){return{'name':_0x5f0d45[_0x2ce7('0x2d')],'type':_0x5f0d45[_0x2ce7('0x2e')]['key']};});_0x13d1de[_0x2ce7('0x2f')]=_['map'](_0x5dc3ab,'name');_0x13d1de['query']=_['keys'](_0xd2a2f0['query']);_0x13d1de['filters']=_['intersection'](_0x13d1de[_0x2ce7('0x2f')],_0x13d1de[_0x2ce7('0x30')]);_0x13306b[_0x2ce7('0x31')]=_[_0x2ce7('0x32')](_0x13d1de[_0x2ce7('0x2f')],qs['fields'](_0xd2a2f0[_0x2ce7('0x30')][_0x2ce7('0x33')]));_0x13306b['attributes']=_0x13306b[_0x2ce7('0x31')][_0x2ce7('0x34')]?_0x13306b[_0x2ce7('0x31')]:_0x13d1de[_0x2ce7('0x2f')];if(!_0xd2a2f0[_0x2ce7('0x30')][_0x2ce7('0x35')]('nolimit')){_0x13306b[_0x2ce7('0x1e')]=qs[_0x2ce7('0x1e')](_0xd2a2f0['query']['limit']);_0x13306b[_0x2ce7('0x1b')]=qs[_0x2ce7('0x1b')](_0xd2a2f0[_0x2ce7('0x30')]['offset']);}_0x13306b['order']=qs[_0x2ce7('0x36')](_0xd2a2f0['query'][_0x2ce7('0x36')]);_0x13306b[_0x2ce7('0x37')]=qs[_0x2ce7('0x38')](_[_0x2ce7('0x39')](_0xd2a2f0['query'],_0x13d1de[_0x2ce7('0x38')]),_0x5dc3ab);if(_0xd2a2f0[_0x2ce7('0x30')][_0x2ce7('0x3a')]){_0x13306b[_0x2ce7('0x37')]=_[_0x2ce7('0x3b')](_0x13306b['where'],{'$or':_[_0x2ce7('0x2b')](_0x5dc3ab,function(_0x48a9c4){if(_0x48a9c4[_0x2ce7('0x2e')]!==_0x2ce7('0x3c')){var _0x56f805={};_0x56f805[_0x48a9c4['name']]={'$like':'%'+_0xd2a2f0[_0x2ce7('0x30')][_0x2ce7('0x3a')]+'%'};return _0x56f805;}})});}_0x13306b=_[_0x2ce7('0x3b')]({},_0x13306b,_0xd2a2f0['options']);var _0x311db1={'where':_0x13306b[_0x2ce7('0x37')]};return db[_0x2ce7('0x2c')][_0x2ce7('0x1d')](_0x311db1)[_0x2ce7('0x25')](function(_0x33674f){_0x508451[_0x2ce7('0x1d')]=_0x33674f;if(_0xd2a2f0[_0x2ce7('0x30')]['includeAll']){_0x13306b[_0x2ce7('0x3d')]=[{'all':!![]}];}return db[_0x2ce7('0x2c')][_0x2ce7('0x3e')](_0x13306b);})[_0x2ce7('0x25')](function(_0x3cb07a){_0x508451[_0x2ce7('0x3f')]=_0x3cb07a;return _0x508451;})[_0x2ce7('0x25')](respondWithFilteredResult(_0x168321,_0x13306b))[_0x2ce7('0x40')](handleError(_0x168321,null));};exports[_0x2ce7('0x41')]=function(_0x1f8ce6,_0x205a1e){var _0x53cbba={'raw':![],'where':{'id':_0x1f8ce6[_0x2ce7('0x42')]['id']}},_0x596d37={};_0x596d37[_0x2ce7('0x2f')]=_[_0x2ce7('0x43')](db['DeskAccount'][_0x2ce7('0x44')]);_0x596d37['query']=_[_0x2ce7('0x43')](_0x1f8ce6[_0x2ce7('0x30')]);_0x596d37[_0x2ce7('0x38')]=_[_0x2ce7('0x32')](_0x596d37[_0x2ce7('0x2f')],_0x596d37[_0x2ce7('0x30')]);_0x53cbba[_0x2ce7('0x31')]=_[_0x2ce7('0x32')](_0x596d37[_0x2ce7('0x2f')],qs[_0x2ce7('0x33')](_0x1f8ce6[_0x2ce7('0x30')][_0x2ce7('0x33')]));_0x53cbba[_0x2ce7('0x31')]=_0x53cbba[_0x2ce7('0x31')][_0x2ce7('0x34')]?_0x53cbba[_0x2ce7('0x31')]:_0x596d37[_0x2ce7('0x2f')];if(_0x1f8ce6[_0x2ce7('0x30')][_0x2ce7('0x45')]){_0x53cbba['include']=[{'all':!![]}];}_0x53cbba=_[_0x2ce7('0x3b')]({},_0x53cbba,_0x1f8ce6[_0x2ce7('0x46')]);return db[_0x2ce7('0x2c')][_0x2ce7('0x47')](_0x53cbba)[_0x2ce7('0x25')](handleEntityNotFound(_0x205a1e,null))['then'](respondWithResult(_0x205a1e,null))[_0x2ce7('0x40')](handleError(_0x205a1e,null));};exports[_0x2ce7('0x48')]=function(_0x5ed661,_0x53ce50){return db[_0x2ce7('0x2c')][_0x2ce7('0x48')](_0x5ed661['body'],{})[_0x2ce7('0x25')](respondWithResult(_0x53ce50,0xc9))[_0x2ce7('0x40')](handleError(_0x53ce50,null));};exports[_0x2ce7('0x49')]=function(_0x5ec3b0,_0x29ecb5){if(_0x5ec3b0[_0x2ce7('0x4a')]['id']){delete _0x5ec3b0[_0x2ce7('0x4a')]['id'];}return db[_0x2ce7('0x2c')]['find']({'where':{'id':_0x5ec3b0[_0x2ce7('0x42')]['id']}})['then'](handleEntityNotFound(_0x29ecb5,null))['then'](saveUpdates(_0x5ec3b0[_0x2ce7('0x4a')],null))[_0x2ce7('0x25')](respondWithResult(_0x29ecb5,null))[_0x2ce7('0x40')](handleError(_0x29ecb5,null));};exports[_0x2ce7('0x24')]=function(_0x36e285,_0x243b6a){return db[_0x2ce7('0x2c')][_0x2ce7('0x47')]({'where':{'id':_0x36e285[_0x2ce7('0x42')]['id']}})['then'](handleEntityNotFound(_0x243b6a,null))[_0x2ce7('0x25')](removeEntity(_0x243b6a,null))['catch'](handleError(_0x243b6a,null));};exports[_0x2ce7('0x4b')]=function(_0x3abf42,_0x265fca,_0x29fa5c){var _0xccd3e5={};var _0x174d53={};var _0x29d68e;var _0x554f0;return db['DeskAccount'][_0x2ce7('0x4c')]({'where':{'id':_0x3abf42['params']['id']}})[_0x2ce7('0x25')](handleEntityNotFound(_0x265fca,null))[_0x2ce7('0x25')](function(_0x48b9b2){if(_0x48b9b2){_0x29d68e=_0x48b9b2;_0x174d53[_0x2ce7('0x2f')]=_[_0x2ce7('0x43')](db[_0x2ce7('0x4d')][_0x2ce7('0x44')]);_0x174d53[_0x2ce7('0x30')]=_['keys'](_0x3abf42['query']);_0x174d53[_0x2ce7('0x38')]=_[_0x2ce7('0x32')](_0x174d53[_0x2ce7('0x2f')],_0x174d53[_0x2ce7('0x30')]);_0xccd3e5[_0x2ce7('0x31')]=_[_0x2ce7('0x32')](_0x174d53[_0x2ce7('0x2f')],qs['fields'](_0x3abf42['query'][_0x2ce7('0x33')]));_0xccd3e5[_0x2ce7('0x31')]=_0xccd3e5['attributes'][_0x2ce7('0x34')]?_0xccd3e5[_0x2ce7('0x31')]:_0x174d53['model'];_0xccd3e5[_0x2ce7('0x4e')]=qs['sort'](_0x3abf42[_0x2ce7('0x30')][_0x2ce7('0x36')]);_0xccd3e5[_0x2ce7('0x37')]=qs[_0x2ce7('0x38')](_[_0x2ce7('0x39')](_0x3abf42[_0x2ce7('0x30')],_0x174d53[_0x2ce7('0x38')]));if(_0x3abf42[_0x2ce7('0x30')][_0x2ce7('0x3a')]){_0xccd3e5[_0x2ce7('0x37')]=_['merge'](_0xccd3e5[_0x2ce7('0x37')],{'$or':_['map'](_0xccd3e5[_0x2ce7('0x31')],function(_0x3c4082){var _0x290ade={};_0x290ade[_0x3c4082]={'$like':'%'+_0x3abf42[_0x2ce7('0x30')][_0x2ce7('0x3a')]+'%'};return _0x290ade;})});}_0xccd3e5=_[_0x2ce7('0x3b')]({},_0xccd3e5,_0x3abf42[_0x2ce7('0x46')]);return _0x29d68e[_0x2ce7('0x4b')](_0xccd3e5);}})[_0x2ce7('0x25')](function(_0x27575a){if(_0x27575a){_0x554f0=_0x27575a['length'];if(!_0x3abf42[_0x2ce7('0x30')]['hasOwnProperty'](_0x2ce7('0x4f'))){_0xccd3e5[_0x2ce7('0x1e')]=qs['limit'](_0x3abf42[_0x2ce7('0x30')][_0x2ce7('0x1e')]);_0xccd3e5[_0x2ce7('0x1b')]=qs[_0x2ce7('0x1b')](_0x3abf42['query'][_0x2ce7('0x1b')]);}return _0x29d68e[_0x2ce7('0x4b')](_0xccd3e5);}})[_0x2ce7('0x25')](function(_0x1b161b){if(_0x1b161b){return _0x1b161b?{'count':_0x554f0,'rows':_0x1b161b}:null;}})['then'](respondWithResult(_0x265fca,null))[_0x2ce7('0x40')](handleError(_0x265fca,null));};exports[_0x2ce7('0x50')]=function(_0x42a2cc,_0x35aace,_0x13140e){if(_0x42a2cc[_0x2ce7('0x4a')]['id']){delete _0x42a2cc[_0x2ce7('0x4a')]['id'];}return db[_0x2ce7('0x2c')][_0x2ce7('0x4c')]({'where':{'id':_0x42a2cc['params']['id']}})['then'](handleEntityNotFound(_0x35aace,null))[_0x2ce7('0x25')](function(_0x2aa1ee){if(_0x2aa1ee){_0x42a2cc[_0x2ce7('0x4a')]['AccountId']=_0x2aa1ee['id'];_0x42a2cc[_0x2ce7('0x4a')][_0x2ce7('0x51')]=integrations['getSubjects'](_0x42a2cc[_0x2ce7('0x4a')]['channel'],_0x42a2cc[_0x2ce7('0x4a')][_0x2ce7('0x2e')]);_0x42a2cc[_0x2ce7('0x4a')]['Descriptions']=integrations[_0x2ce7('0x52')](_0x42a2cc['body']['channel'],_0x42a2cc['body'][_0x2ce7('0x2e')]);return db[_0x2ce7('0x4d')]['create'](_0x42a2cc[_0x2ce7('0x4a')],{'include':[{'model':db[_0x2ce7('0x53')],'as':'Subjects'},{'model':db[_0x2ce7('0x53')],'as':_0x2ce7('0x54')}]});}return null;})[_0x2ce7('0x25')](respondWithResult(_0x35aace,null))['catch'](handleError(_0x35aace,null));};exports[_0x2ce7('0x55')]=function(_0x556523,_0x4ca271,_0x21617d){var _0x5e1506=[{'name':_0x2ce7('0x56'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5ef67a='';return db['DeskAccount']['findOne']({'where':{'id':_0x556523[_0x2ce7('0x42')]['id']},'attributes':['id','remoteUri',_0x2ce7('0x57'),_0x2ce7('0x58'),_0x2ce7('0x59'),'consumerKey',_0x2ce7('0x5a'),_0x2ce7('0x5b'),_0x2ce7('0x5c')]})[_0x2ce7('0x25')](handleEntityNotFound(_0x4ca271,null))[_0x2ce7('0x25')](function(_0x3a83d7){if(_0x3a83d7){_0x5ef67a=_0x3a83d7['remoteUri'];var _0x4d0fb1=_0x5ef67a['slice'](-0x1);if(_0x4d0fb1==='/'){_0x5ef67a=_0x5ef67a[_0x2ce7('0x5d')](0x0,_0x5ef67a['lastIndexOf'](_0x4d0fb1));}var _0x42f1ac={'method':'GET','uri':util['format'](_0x2ce7('0x5e'),_0x5ef67a),'headers':{'Content-Type':_0x2ce7('0x5f'),'Accept':_0x2ce7('0x5f')},'json':!![]};if(_0x3a83d7[_0x2ce7('0x57')]===_0x2ce7('0x60')){_0x42f1ac[_0x2ce7('0x61')][_0x2ce7('0x62')]=util[_0x2ce7('0x63')](_0x2ce7('0x64'),new Buffer(util[_0x2ce7('0x63')]('%s:%s',_0x3a83d7['username'],_0x3a83d7[_0x2ce7('0x59')]))[_0x2ce7('0x65')]('base64'));}return rp(_0x42f1ac)[_0x2ce7('0x25')](function(_0x23ac98){return _0x5e1506[_0x2ce7('0x66')](_['map'](_0x23ac98['_embedded'][_0x2ce7('0x67')],function(_0x19cfef){return{'id':_0x19cfef[_0x2ce7('0x28')],'name':_0x19cfef['name'],'type':_0x19cfef[_0x2ce7('0x2e')],'active':_0x19cfef['active'],'label':_0x19cfef[_0x2ce7('0x68')],'custom':!![]};}));});}})[_0x2ce7('0x25')](function(_0x381af6){return{'count':_0x381af6['length'],'rows':_0x381af6};})[_0x2ce7('0x25')](respondWithResult(_0x4ca271,null))[_0x2ce7('0x40')](function(_0x5dd340){var _0xeaa715=_0x556523['query'][_0x2ce7('0x69')]?0x1f4:_0x5dd340[_0x2ce7('0x6a')]||0x1f4;logger[_0x2ce7('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xeaa715,JSON[_0x2ce7('0x6b')](_0x5dd340));delete _0x5dd340[_0x2ce7('0x28')];if(_0xeaa715===0x191){_0xeaa715=0x190;}_0x4ca271[_0x2ce7('0x19')](_0xeaa715)['send'](_0x556523[_0x2ce7('0x30')][_0x2ce7('0x69')]?{'message':_0x2ce7('0x6c'),'statusCode':_0x5dd340[_0x2ce7('0x6a')]}:_0x5dd340);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index db42c07..658b98e 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 _0x3e33=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','int_desk_accounts'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x3e33,0x1ef));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x33e3('0x0'));var logger=require(_0x33e3('0x1'))(_0x33e3('0x2'));var moment=require('moment');var BPromise=require(_0x33e3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33e3('0x4'));var rimraf=require(_0x33e3('0x5'));var config=require(_0x33e3('0x6'));var attributes=require(_0x33e3('0x7'));var integrations=require(_0x33e3('0x8'));module['exports']=function(_0xe2231c,_0x75cf8e){return _0xe2231c['define'](_0x33e3('0x9'),attributes,{'tableName':_0x33e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc876=['int_desk_accounts','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount'];(function(_0x3ba1a3,_0x3d1a38){var _0x454223=function(_0x417a26){while(--_0x417a26){_0x3ba1a3['push'](_0x3ba1a3['shift']());}};_0x454223(++_0x3d1a38);}(_0xc876,0xfd));var _0x6c87=function(_0x31f0bd,_0x45f95c){_0x31f0bd=_0x31f0bd-0x0;var _0x326629=_0xc876[_0x31f0bd];return _0x326629;};'use strict';var _=require('lodash');var util=require(_0x6c87('0x0'));var logger=require(_0x6c87('0x1'))(_0x6c87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c87('0x3'));var fs=require('fs');var path=require(_0x6c87('0x4'));var rimraf=require(_0x6c87('0x5'));var config=require(_0x6c87('0x6'));var attributes=require(_0x6c87('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x6c87('0x8')]=function(_0x48363c,_0x499089){return _0x48363c[_0x6c87('0x9')](_0x6c87('0xa'),attributes,{'tableName':_0x6c87('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 01799ec..b0b88cb 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 _0x55d2=['../../config/logger','rpc','../../config/environment','http','request','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetDeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowDeskAccount','DeskAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x55d2,0x66));var _0x255d=function(_0x5c8f3e,_0x11f776){_0x5c8f3e=_0x5c8f3e-0x0;var _0x26f42f=_0x55d2[_0x5c8f3e];return _0x26f42f;};'use strict';var _=require(_0x255d('0x0'));var util=require(_0x255d('0x1'));var moment=require('moment');var BPromise=require(_0x255d('0x2'));var rs=require(_0x255d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x255d('0x4'))['db'];var utils=require(_0x255d('0x5'));var logger=require(_0x255d('0x6'))(_0x255d('0x7'));var config=require(_0x255d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x255d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f06d,_0x2715b9,_0x67fb5c){return new BPromise(function(_0x150d9d,_0x350273){return client[_0x255d('0xa')](_0x49f06d,_0x67fb5c)['then'](function(_0x28a318){logger['info'](_0x255d('0xb'),_0x2715b9,'request\x20sent');logger[_0x255d('0xc')](_0x255d('0xd'),_0x2715b9,_0x255d('0xe'),JSON[_0x255d('0xf')](_0x28a318));if(_0x28a318[_0x255d('0x10')]){if(_0x28a318[_0x255d('0x10')][_0x255d('0x11')]===0x1f4){logger[_0x255d('0x10')]('DeskAccount,\x20%s,\x20%s',_0x2715b9,_0x28a318[_0x255d('0x10')][_0x255d('0x12')]);return _0x350273(_0x28a318[_0x255d('0x10')][_0x255d('0x12')]);}logger[_0x255d('0x10')](_0x255d('0xb'),_0x2715b9,_0x28a318[_0x255d('0x10')][_0x255d('0x12')]);return _0x150d9d(_0x28a318[_0x255d('0x10')][_0x255d('0x12')]);}else{logger[_0x255d('0x13')](_0x255d('0xb'),_0x2715b9,'request\x20sent');_0x150d9d(_0x28a318[_0x255d('0x14')]['message']);}})[_0x255d('0x15')](function(_0x47701a){logger[_0x255d('0x10')](_0x255d('0xb'),_0x2715b9,_0x47701a);_0x350273(_0x47701a);});});}exports[_0x255d('0x16')]=function(_0x4bd8f7){var _0x352bf4=this;return new Promise(function(_0x24637a,_0x1eb8a7){return db['DeskAccount'][_0x255d('0x17')]({'raw':_0x4bd8f7[_0x255d('0x18')]?_0x4bd8f7[_0x255d('0x18')][_0x255d('0x19')]===undefined?!![]:![]:!![],'where':_0x4bd8f7[_0x255d('0x18')]?_0x4bd8f7[_0x255d('0x18')][_0x255d('0x1a')]||null:null,'attributes':_0x4bd8f7[_0x255d('0x18')]?_0x4bd8f7[_0x255d('0x18')][_0x255d('0x1b')]||null:null,'limit':_0x4bd8f7[_0x255d('0x18')]?_0x4bd8f7[_0x255d('0x18')][_0x255d('0x1c')]||null:null,'include':_0x4bd8f7[_0x255d('0x18')]?_0x4bd8f7[_0x255d('0x18')]['include']?_[_0x255d('0x1d')](_0x4bd8f7[_0x255d('0x18')][_0x255d('0x1e')],function(_0x170961){return{'model':db[_0x170961[_0x255d('0x1f')]],'as':_0x170961['as'],'attributes':_0x170961[_0x255d('0x1b')],'include':_0x170961['include']?_['map'](_0x170961[_0x255d('0x1e')],function(_0x46f478){return{'model':db[_0x46f478[_0x255d('0x1f')]],'as':_0x46f478['as'],'attributes':_0x46f478['attributes'],'include':_0x46f478[_0x255d('0x1e')]?_[_0x255d('0x1d')](_0x46f478['include'],function(_0x3a95fd){return{'model':db[_0x3a95fd[_0x255d('0x1f')]],'as':_0x3a95fd['as'],'attributes':_0x3a95fd[_0x255d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x255d('0x20')](function(_0x3d97a4){logger[_0x255d('0x13')](_0x255d('0x16'),_0x4bd8f7);logger[_0x255d('0xc')](_0x255d('0x16'),_0x4bd8f7,JSON['stringify'](_0x3d97a4));_0x24637a(_0x3d97a4);})[_0x255d('0x15')](function(_0x201390){logger[_0x255d('0x10')](_0x255d('0x16'),_0x201390[_0x255d('0x12')],_0x4bd8f7);_0x1eb8a7(_0x352bf4[_0x255d('0x10')](0x1f4,_0x201390['message']));});});};exports[_0x255d('0x21')]=function(_0x2492e3){var _0x18da54=this;return new Promise(function(_0x3b505b,_0x104dfc){return db[_0x255d('0x22')][_0x255d('0x23')]({'raw':_0x2492e3[_0x255d('0x18')]?_0x2492e3[_0x255d('0x18')][_0x255d('0x19')]===undefined?!![]:![]:!![],'where':_0x2492e3['options']?_0x2492e3['options'][_0x255d('0x1a')]||null:null,'attributes':_0x2492e3[_0x255d('0x18')]?_0x2492e3[_0x255d('0x18')]['attributes']||null:null,'include':_0x2492e3[_0x255d('0x18')]?_0x2492e3['options'][_0x255d('0x1e')]?_[_0x255d('0x1d')](_0x2492e3['options'][_0x255d('0x1e')],function(_0x2eeaaa){return{'model':db[_0x2eeaaa[_0x255d('0x1f')]],'as':_0x2eeaaa['as'],'attributes':_0x2eeaaa['attributes'],'include':_0x2eeaaa['include']?_[_0x255d('0x1d')](_0x2eeaaa[_0x255d('0x1e')],function(_0xfcda07){return{'model':db[_0xfcda07[_0x255d('0x1f')]],'as':_0xfcda07['as'],'attributes':_0xfcda07['attributes'],'include':_0xfcda07[_0x255d('0x1e')]?_['map'](_0xfcda07['include'],function(_0x25c47e){return{'model':db[_0x25c47e[_0x255d('0x1f')]],'as':_0x25c47e['as'],'attributes':_0x25c47e[_0x255d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x255d('0x20')](function(_0x3ae84e){logger[_0x255d('0x13')](_0x255d('0x21'),_0x2492e3);logger[_0x255d('0xc')](_0x255d('0x21'),_0x2492e3,JSON[_0x255d('0xf')](_0x3ae84e));_0x3b505b(_0x3ae84e);})[_0x255d('0x15')](function(_0x36b840){logger['error']('ShowDeskAccount',_0x36b840[_0x255d('0x12')],_0x2492e3);_0x104dfc(_0x18da54[_0x255d('0x10')](0x1f4,_0x36b840['message']));});});}; \ No newline at end of file +var _0x5f97=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','where','attributes','limit','include','map','model','then','GetDeskAccount','ShowDeskAccount','DeskAccount','find','raw','info'];(function(_0x12833b,_0x26c1d2){var _0x3acad3=function(_0x2f9ec9){while(--_0x2f9ec9){_0x12833b['push'](_0x12833b['shift']());}};_0x3acad3(++_0x26c1d2);}(_0x5f97,0x1c7));var _0x75f9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f97[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x75f9('0x0'));var moment=require(_0x75f9('0x1'));var BPromise=require('bluebird');var rs=require(_0x75f9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75f9('0x3'))['db'];var utils=require(_0x75f9('0x4'));var logger=require(_0x75f9('0x5'))(_0x75f9('0x6'));var config=require(_0x75f9('0x7'));var jayson=require(_0x75f9('0x8'));var client=jayson['client'][_0x75f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x534590,_0x417b9e,_0xd2c00f){return new BPromise(function(_0x1b9f1d,_0x40fdf9){return client['request'](_0x534590,_0xd2c00f)['then'](function(_0x27dfb1){logger['info'](_0x75f9('0xa'),_0x417b9e,'request\x20sent');logger[_0x75f9('0xb')](_0x75f9('0xc'),_0x417b9e,_0x75f9('0xd'),JSON[_0x75f9('0xe')](_0x27dfb1));if(_0x27dfb1[_0x75f9('0xf')]){if(_0x27dfb1[_0x75f9('0xf')][_0x75f9('0x10')]===0x1f4){logger[_0x75f9('0xf')]('DeskAccount,\x20%s,\x20%s',_0x417b9e,_0x27dfb1['error'][_0x75f9('0x11')]);return _0x40fdf9(_0x27dfb1[_0x75f9('0xf')][_0x75f9('0x11')]);}logger[_0x75f9('0xf')](_0x75f9('0xa'),_0x417b9e,_0x27dfb1[_0x75f9('0xf')][_0x75f9('0x11')]);return _0x1b9f1d(_0x27dfb1[_0x75f9('0xf')][_0x75f9('0x11')]);}else{logger['info'](_0x75f9('0xa'),_0x417b9e,'request\x20sent');_0x1b9f1d(_0x27dfb1[_0x75f9('0x12')][_0x75f9('0x11')]);}})[_0x75f9('0x13')](function(_0x54f495){logger[_0x75f9('0xf')]('DeskAccount,\x20%s,\x20%s',_0x417b9e,_0x54f495);_0x40fdf9(_0x54f495);});});}exports['GetDeskAccount']=function(_0xd3a9bb){var _0x3d7947=this;return new Promise(function(_0x1a3f55,_0x5045d4){return db['DeskAccount'][_0x75f9('0x14')]({'raw':_0xd3a9bb[_0x75f9('0x15')]?_0xd3a9bb[_0x75f9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xd3a9bb[_0x75f9('0x15')]?_0xd3a9bb['options'][_0x75f9('0x16')]||null:null,'attributes':_0xd3a9bb[_0x75f9('0x15')]?_0xd3a9bb[_0x75f9('0x15')][_0x75f9('0x17')]||null:null,'limit':_0xd3a9bb['options']?_0xd3a9bb[_0x75f9('0x15')][_0x75f9('0x18')]||null:null,'include':_0xd3a9bb[_0x75f9('0x15')]?_0xd3a9bb[_0x75f9('0x15')][_0x75f9('0x19')]?_[_0x75f9('0x1a')](_0xd3a9bb[_0x75f9('0x15')][_0x75f9('0x19')],function(_0x275228){return{'model':db[_0x275228[_0x75f9('0x1b')]],'as':_0x275228['as'],'attributes':_0x275228[_0x75f9('0x17')],'include':_0x275228[_0x75f9('0x19')]?_[_0x75f9('0x1a')](_0x275228['include'],function(_0xc569ed){return{'model':db[_0xc569ed['model']],'as':_0xc569ed['as'],'attributes':_0xc569ed[_0x75f9('0x17')],'include':_0xc569ed[_0x75f9('0x19')]?_[_0x75f9('0x1a')](_0xc569ed[_0x75f9('0x19')],function(_0x39b4dd){return{'model':db[_0x39b4dd['model']],'as':_0x39b4dd['as'],'attributes':_0x39b4dd[_0x75f9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x75f9('0x1c')](function(_0xcbbbc6){logger['info'](_0x75f9('0x1d'),_0xd3a9bb);logger['debug'](_0x75f9('0x1d'),_0xd3a9bb,JSON[_0x75f9('0xe')](_0xcbbbc6));_0x1a3f55(_0xcbbbc6);})[_0x75f9('0x13')](function(_0x19b428){logger[_0x75f9('0xf')](_0x75f9('0x1d'),_0x19b428[_0x75f9('0x11')],_0xd3a9bb);_0x5045d4(_0x3d7947[_0x75f9('0xf')](0x1f4,_0x19b428[_0x75f9('0x11')]));});});};exports[_0x75f9('0x1e')]=function(_0x3076fa){var _0x227754=this;return new Promise(function(_0x5e7dad,_0x120fa1){return db[_0x75f9('0x1f')][_0x75f9('0x20')]({'raw':_0x3076fa[_0x75f9('0x15')]?_0x3076fa[_0x75f9('0x15')][_0x75f9('0x21')]===undefined?!![]:![]:!![],'where':_0x3076fa[_0x75f9('0x15')]?_0x3076fa[_0x75f9('0x15')][_0x75f9('0x16')]||null:null,'attributes':_0x3076fa[_0x75f9('0x15')]?_0x3076fa['options'][_0x75f9('0x17')]||null:null,'include':_0x3076fa[_0x75f9('0x15')]?_0x3076fa[_0x75f9('0x15')][_0x75f9('0x19')]?_['map'](_0x3076fa['options']['include'],function(_0xe5832c){return{'model':db[_0xe5832c[_0x75f9('0x1b')]],'as':_0xe5832c['as'],'attributes':_0xe5832c[_0x75f9('0x17')],'include':_0xe5832c[_0x75f9('0x19')]?_[_0x75f9('0x1a')](_0xe5832c['include'],function(_0x592570){return{'model':db[_0x592570[_0x75f9('0x1b')]],'as':_0x592570['as'],'attributes':_0x592570[_0x75f9('0x17')],'include':_0x592570[_0x75f9('0x19')]?_[_0x75f9('0x1a')](_0x592570[_0x75f9('0x19')],function(_0x58de9a){return{'model':db[_0x58de9a['model']],'as':_0x58de9a['as'],'attributes':_0x58de9a['attributes']};}):[]};}):[]};}):[]:[]})[_0x75f9('0x1c')](function(_0x56576f){logger[_0x75f9('0x22')](_0x75f9('0x1e'),_0x3076fa);logger[_0x75f9('0xb')]('ShowDeskAccount',_0x3076fa,JSON[_0x75f9('0xe')](_0x56576f));_0x5e7dad(_0x56576f);})[_0x75f9('0x13')](function(_0x2aac9d){logger[_0x75f9('0xf')]('ShowDeskAccount',_0x2aac9d[_0x75f9('0x11')],_0x3076fa);_0x120fa1(_0x227754[_0x75f9('0xf')](0x1f4,_0x2aac9d[_0x75f9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4786a46..5886c3b 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x197fde,_0x175d73){var _0x4fe854=function(_0x5484af){while(--_0x5484af){_0x197fde['push'](_0x197fde['shift']());}};_0x4fe854(++_0x175d73);}(_0x34e8,0x12c));var _0x834e=function(_0x11c7d8,_0x5f01a7){_0x11c7d8=_0x11c7d8-0x0;var _0x3bec6f=_0x34e8[_0x11c7d8];return _0x3bec6f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x113d16,_0x2c97d7){var _0x212df6=function(_0x30f000){while(--_0x30f000){_0x113d16['push'](_0x113d16['shift']());}};_0x212df6(++_0x2c97d7);}(_0x34e8,0x12c));var _0x834e=function(_0x23a0f2,_0x5ef187){_0x23a0f2=_0x23a0f2-0x0;var _0x292761=_0x34e8[_0x23a0f2];return _0x292761;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index d8b0465..6259047 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 _0x455c=['STRING','exports'];(function(_0x142691,_0x281ee4){var _0x7ff861=function(_0x19f6a3){while(--_0x19f6a3){_0x142691['push'](_0x142691['shift']());}};_0x7ff861(++_0x281ee4);}(_0x455c,0x1db));var _0xc455=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x455c[_0x545fe3];return _0x480702;};'use strict';var Sequelize=require('sequelize');module[_0xc455('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc455('0x1')]}}; \ No newline at end of file +var _0x52f1=['sequelize','STRING'];(function(_0x274876,_0x55aeab){var _0x2c18e1=function(_0x29dc8d){while(--_0x29dc8d){_0x274876['push'](_0x274876['shift']());}};_0x2c18e1(++_0x55aeab);}(_0x52f1,0x196));var _0x152f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x52f1[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x152f('0x0'));module['exports']={'name':{'type':Sequelize[_0x152f('0x1')]},'description':{'type':Sequelize[_0x152f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 3b13372..42ba70e 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 _0xe357=['type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','hasOwnProperty','getSubjects','findOne','map','getDescriptions','DeskField','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName'];(function(_0x22a8f1,_0x1b203d){var _0x508cbe=function(_0x4df9af){while(--_0x4df9af){_0x22a8f1['push'](_0x22a8f1['shift']());}};_0x508cbe(++_0x1b203d);}(_0xe357,0x11e));var _0x7e35=function(_0x37d0bc,_0x109b96){_0x37d0bc=_0x37d0bc-0x0;var _0x170e60=_0xe357[_0x37d0bc];return _0x170e60;};'use strict';var emlformat=require(_0x7e35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e35('0x1'));var jsonpatch=require(_0x7e35('0x2'));var rp=require(_0x7e35('0x3'));var moment=require(_0x7e35('0x4'));var BPromise=require(_0x7e35('0x5'));var Mustache=require(_0x7e35('0x6'));var util=require(_0x7e35('0x7'));var path=require(_0x7e35('0x8'));var sox=require(_0x7e35('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e35('0xa'));var _=require(_0x7e35('0xb'));var squel=require('squel');var crypto=require(_0x7e35('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e35('0xd'));var querystring=require(_0x7e35('0xe'));var Papa=require(_0x7e35('0xf'));var Redis=require(_0x7e35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7e35('0x11'));var as=require(_0x7e35('0x12'));var hardwareService=require(_0x7e35('0x13'));var logger=require(_0x7e35('0x14'))('api');var utils=require(_0x7e35('0x15'));var config=require(_0x7e35('0x16'));var licenseUtil=require(_0x7e35('0x17'));var db=require(_0x7e35('0x18'))['db'];function respondWithStatusCode(_0x47a0ad,_0x4ab10c){_0x4ab10c=_0x4ab10c||0xcc;return function(_0x430b41){if(_0x430b41){return _0x47a0ad[_0x7e35('0x19')](_0x4ab10c);}return _0x47a0ad[_0x7e35('0x1a')](_0x4ab10c)[_0x7e35('0x1b')]();};}function respondWithResult(_0x12fc00,_0x356ad2){_0x356ad2=_0x356ad2||0xc8;return function(_0x5d7edd){if(_0x5d7edd){return _0x12fc00[_0x7e35('0x1a')](_0x356ad2)[_0x7e35('0x1c')](_0x5d7edd);}};}function respondWithFilteredResult(_0x279ca9,_0xc556bd){return function(_0x13046e){if(_0x13046e){var _0xb9b0d=typeof _0xc556bd[_0x7e35('0x1d')]==='undefined'&&typeof _0xc556bd[_0x7e35('0x1e')]===_0x7e35('0x1f');var _0x578af3=_0x13046e[_0x7e35('0x20')];var _0x40296f=_0xb9b0d?0x0:_0xc556bd[_0x7e35('0x1d')];var _0x1e91f9=_0xb9b0d?_0x13046e['count']:_0xc556bd['offset']+_0xc556bd['limit'];var _0x45fe04;if(_0x1e91f9>=_0x578af3){_0x1e91f9=_0x578af3;_0x45fe04=0xc8;}else{_0x45fe04=0xce;}_0x279ca9[_0x7e35('0x1a')](_0x45fe04);return _0x279ca9[_0x7e35('0x21')]('Content-Range',_0x40296f+'-'+_0x1e91f9+'/'+_0x578af3)[_0x7e35('0x1c')](_0x13046e);}return null;};}function patchUpdates(_0x3283ec){return function(_0x2af038){try{jsonpatch[_0x7e35('0x22')](_0x2af038,_0x3283ec,!![]);}catch(_0x30f7e5){return BPromise[_0x7e35('0x23')](_0x30f7e5);}return _0x2af038[_0x7e35('0x24')]();};}function saveUpdates(_0x411b6b,_0x59d58e){return function(_0x2abc11){if(_0x2abc11){return _0x2abc11[_0x7e35('0x25')](_0x411b6b)[_0x7e35('0x26')](function(_0x2736ec){return _0x2736ec;});}return null;};}function removeEntity(_0x4574b8,_0x304fec){return function(_0x14c35c){if(_0x14c35c){return _0x14c35c['destroy']()['then'](function(){_0x4574b8[_0x7e35('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x411252,_0x37068a){return function(_0x1002bc){if(!_0x1002bc){_0x411252['sendStatus'](0x194);}return _0x1002bc;};}function handleError(_0x4cb6cf,_0x10804e){_0x10804e=_0x10804e||0x1f4;return function(_0xb62006){logger['error'](_0xb62006[_0x7e35('0x27')]);if(_0xb62006[_0x7e35('0x28')]){delete _0xb62006[_0x7e35('0x28')];}_0x4cb6cf[_0x7e35('0x1a')](_0x10804e)[_0x7e35('0x29')](_0xb62006);};}exports[_0x7e35('0x2a')]=function(_0x422a69,_0x35e6da){var _0x19b45b={},_0xccb414={},_0x17bb63={'count':0x0,'rows':[]};var _0x2c7974=_['map'](db[_0x7e35('0x2b')][_0x7e35('0x2c')],function(_0x1de378){return{'name':_0x1de378[_0x7e35('0x2d')],'type':_0x1de378[_0x7e35('0x2e')][_0x7e35('0x2f')]};});_0xccb414[_0x7e35('0x30')]=_['map'](_0x2c7974,_0x7e35('0x28'));_0xccb414[_0x7e35('0x31')]=_[_0x7e35('0x32')](_0x422a69['query']);_0xccb414['filters']=_[_0x7e35('0x33')](_0xccb414[_0x7e35('0x30')],_0xccb414[_0x7e35('0x31')]);_0x19b45b[_0x7e35('0x34')]=_['intersection'](_0xccb414[_0x7e35('0x30')],qs[_0x7e35('0x35')](_0x422a69['query'][_0x7e35('0x35')]));_0x19b45b[_0x7e35('0x34')]=_0x19b45b[_0x7e35('0x34')][_0x7e35('0x36')]?_0x19b45b['attributes']:_0xccb414[_0x7e35('0x30')];if(!_0x422a69[_0x7e35('0x31')]['hasOwnProperty'](_0x7e35('0x37'))){_0x19b45b[_0x7e35('0x1e')]=qs[_0x7e35('0x1e')](_0x422a69[_0x7e35('0x31')][_0x7e35('0x1e')]);_0x19b45b['offset']=qs[_0x7e35('0x1d')](_0x422a69['query'][_0x7e35('0x1d')]);}_0x19b45b[_0x7e35('0x38')]=qs[_0x7e35('0x39')](_0x422a69['query']['sort']);_0x19b45b[_0x7e35('0x3a')]=qs[_0x7e35('0x3b')](_[_0x7e35('0x3c')](_0x422a69['query'],_0xccb414[_0x7e35('0x3b')]),_0x2c7974);if(_0x422a69['query'][_0x7e35('0x3d')]){_0x19b45b['where']=_[_0x7e35('0x3e')](_0x19b45b[_0x7e35('0x3a')],{'$or':_['map'](_0x2c7974,function(_0x126c80){if(_0x126c80[_0x7e35('0x2e')]!=='VIRTUAL'){var _0x2b76e0={};_0x2b76e0[_0x126c80[_0x7e35('0x28')]]={'$like':'%'+_0x422a69['query'][_0x7e35('0x3d')]+'%'};return _0x2b76e0;}})});}_0x19b45b=_[_0x7e35('0x3e')]({},_0x19b45b,_0x422a69[_0x7e35('0x3f')]);var _0x25b5ac={'where':_0x19b45b[_0x7e35('0x3a')]};return db[_0x7e35('0x2b')][_0x7e35('0x20')](_0x25b5ac)[_0x7e35('0x26')](function(_0x587952){_0x17bb63[_0x7e35('0x20')]=_0x587952;if(_0x422a69[_0x7e35('0x31')][_0x7e35('0x40')]){_0x19b45b[_0x7e35('0x41')]=[{'all':!![]}];}return db[_0x7e35('0x2b')][_0x7e35('0x42')](_0x19b45b);})['then'](function(_0x11a630){_0x17bb63['rows']=_0x11a630;return _0x17bb63;})[_0x7e35('0x26')](respondWithFilteredResult(_0x35e6da,_0x19b45b))[_0x7e35('0x43')](handleError(_0x35e6da,null));};exports[_0x7e35('0x44')]=function(_0x2a0cb1,_0x5030f6){var _0xfd2884={'raw':![],'where':{'id':_0x2a0cb1[_0x7e35('0x45')]['id']}},_0x48f5a8={};_0x48f5a8[_0x7e35('0x30')]=_['keys'](db['DeskConfiguration'][_0x7e35('0x2c')]);_0x48f5a8[_0x7e35('0x31')]=_[_0x7e35('0x32')](_0x2a0cb1[_0x7e35('0x31')]);_0x48f5a8['filters']=_[_0x7e35('0x33')](_0x48f5a8[_0x7e35('0x30')],_0x48f5a8['query']);_0xfd2884[_0x7e35('0x34')]=_[_0x7e35('0x33')](_0x48f5a8[_0x7e35('0x30')],qs[_0x7e35('0x35')](_0x2a0cb1[_0x7e35('0x31')][_0x7e35('0x35')]));_0xfd2884['attributes']=_0xfd2884[_0x7e35('0x34')][_0x7e35('0x36')]?_0xfd2884[_0x7e35('0x34')]:_0x48f5a8['model'];if(_0x2a0cb1[_0x7e35('0x31')]['includeAll']){_0xfd2884[_0x7e35('0x41')]=[{'all':!![]}];}_0xfd2884=_[_0x7e35('0x3e')]({},_0xfd2884,_0x2a0cb1[_0x7e35('0x3f')]);return db['DeskConfiguration'][_0x7e35('0x46')](_0xfd2884)[_0x7e35('0x26')](handleEntityNotFound(_0x5030f6,null))[_0x7e35('0x26')](respondWithResult(_0x5030f6,null))[_0x7e35('0x43')](handleError(_0x5030f6,null));};exports[_0x7e35('0x47')]=function(_0x417754,_0x104827){return db['DeskConfiguration'][_0x7e35('0x47')](_0x417754['body'],{})[_0x7e35('0x26')](respondWithResult(_0x104827,0xc9))['catch'](handleError(_0x104827,null));};exports[_0x7e35('0x25')]=function(_0x613a52,_0x14b8f6){if(_0x613a52[_0x7e35('0x48')]['id']){delete _0x613a52[_0x7e35('0x48')]['id'];}return db[_0x7e35('0x2b')][_0x7e35('0x46')]({'where':{'id':_0x613a52['params']['id']}})[_0x7e35('0x26')](handleEntityNotFound(_0x14b8f6,null))[_0x7e35('0x26')](saveUpdates(_0x613a52[_0x7e35('0x48')],null))['then'](respondWithResult(_0x14b8f6,null))[_0x7e35('0x43')](handleError(_0x14b8f6,null));};exports['destroy']=function(_0x18fa98,_0x294306){return db[_0x7e35('0x2b')][_0x7e35('0x46')]({'where':{'id':_0x18fa98[_0x7e35('0x45')]['id']}})[_0x7e35('0x26')](handleEntityNotFound(_0x294306,null))[_0x7e35('0x26')](removeEntity(_0x294306,null))[_0x7e35('0x43')](handleError(_0x294306,null));};exports[_0x7e35('0x49')]=function(_0x4f4efc,_0x18d984,_0x548100){var _0x2e6fc7={};var _0x100239={};var _0x45969c;var _0x22a555;return db[_0x7e35('0x2b')]['findOne']({'where':{'id':_0x4f4efc[_0x7e35('0x45')]['id']}})[_0x7e35('0x26')](handleEntityNotFound(_0x18d984,null))[_0x7e35('0x26')](function(_0x168e73){if(_0x168e73){_0x45969c=_0x168e73;_0x100239[_0x7e35('0x30')]=_[_0x7e35('0x32')](db['DeskField']['rawAttributes']);_0x100239['query']=_[_0x7e35('0x32')](_0x4f4efc[_0x7e35('0x31')]);_0x100239[_0x7e35('0x3b')]=_[_0x7e35('0x33')](_0x100239[_0x7e35('0x30')],_0x100239[_0x7e35('0x31')]);_0x2e6fc7[_0x7e35('0x34')]=_[_0x7e35('0x33')](_0x100239[_0x7e35('0x30')],qs['fields'](_0x4f4efc['query'][_0x7e35('0x35')]));_0x2e6fc7[_0x7e35('0x34')]=_0x2e6fc7['attributes']['length']?_0x2e6fc7[_0x7e35('0x34')]:_0x100239[_0x7e35('0x30')];_0x2e6fc7[_0x7e35('0x38')]=qs[_0x7e35('0x39')](_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x39')]);_0x2e6fc7['where']=qs[_0x7e35('0x3b')](_[_0x7e35('0x3c')](_0x4f4efc[_0x7e35('0x31')],_0x100239['filters']));if(_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x3d')]){_0x2e6fc7[_0x7e35('0x3a')]=_[_0x7e35('0x3e')](_0x2e6fc7['where'],{'$or':_['map'](_0x2e6fc7[_0x7e35('0x34')],function(_0x39746a){var _0x1d149e={};_0x1d149e[_0x39746a]={'$like':'%'+_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x3d')]+'%'};return _0x1d149e;})});}_0x2e6fc7=_[_0x7e35('0x3e')]({},_0x2e6fc7,_0x4f4efc['options']);return _0x45969c[_0x7e35('0x49')](_0x2e6fc7);}})[_0x7e35('0x26')](function(_0x41bc03){if(_0x41bc03){_0x22a555=_0x41bc03['length'];if(!_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x4a')](_0x7e35('0x37'))){_0x2e6fc7['limit']=qs['limit'](_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x1e')]);_0x2e6fc7[_0x7e35('0x1d')]=qs[_0x7e35('0x1d')](_0x4f4efc[_0x7e35('0x31')][_0x7e35('0x1d')]);}return _0x45969c[_0x7e35('0x49')](_0x2e6fc7);}})[_0x7e35('0x26')](function(_0xe88912){if(_0xe88912){return _0xe88912?{'count':_0x22a555,'rows':_0xe88912}:null;}})[_0x7e35('0x26')](respondWithResult(_0x18d984,null))[_0x7e35('0x43')](handleError(_0x18d984,null));};exports[_0x7e35('0x4b')]=function(_0xd4b6e1,_0x15cf73,_0x2ba6f0){var _0x3409d6={};var _0x4fe234={};var _0x43d905;var _0x5a136a;return db[_0x7e35('0x2b')][_0x7e35('0x4c')]({'where':{'id':_0xd4b6e1[_0x7e35('0x45')]['id']}})['then'](handleEntityNotFound(_0x15cf73,null))[_0x7e35('0x26')](function(_0x3d7fd5){if(_0x3d7fd5){_0x43d905=_0x3d7fd5;_0x4fe234[_0x7e35('0x30')]=_[_0x7e35('0x32')](db['DeskField'][_0x7e35('0x2c')]);_0x4fe234[_0x7e35('0x31')]=_['keys'](_0xd4b6e1['query']);_0x4fe234[_0x7e35('0x3b')]=_[_0x7e35('0x33')](_0x4fe234[_0x7e35('0x30')],_0x4fe234[_0x7e35('0x31')]);_0x3409d6['attributes']=_[_0x7e35('0x33')](_0x4fe234[_0x7e35('0x30')],qs[_0x7e35('0x35')](_0xd4b6e1[_0x7e35('0x31')][_0x7e35('0x35')]));_0x3409d6[_0x7e35('0x34')]=_0x3409d6['attributes']['length']?_0x3409d6['attributes']:_0x4fe234[_0x7e35('0x30')];_0x3409d6[_0x7e35('0x38')]=qs['sort'](_0xd4b6e1[_0x7e35('0x31')][_0x7e35('0x39')]);_0x3409d6[_0x7e35('0x3a')]=qs['filters'](_['pick'](_0xd4b6e1[_0x7e35('0x31')],_0x4fe234[_0x7e35('0x3b')]));if(_0xd4b6e1['query']['filter']){_0x3409d6[_0x7e35('0x3a')]=_['merge'](_0x3409d6[_0x7e35('0x3a')],{'$or':_[_0x7e35('0x4d')](_0x3409d6[_0x7e35('0x34')],function(_0x1da674){var _0x3a4e5b={};_0x3a4e5b[_0x1da674]={'$like':'%'+_0xd4b6e1[_0x7e35('0x31')][_0x7e35('0x3d')]+'%'};return _0x3a4e5b;})});}_0x3409d6=_[_0x7e35('0x3e')]({},_0x3409d6,_0xd4b6e1[_0x7e35('0x3f')]);return _0x43d905[_0x7e35('0x4b')](_0x3409d6);}})['then'](function(_0x3ad729){if(_0x3ad729){_0x5a136a=_0x3ad729[_0x7e35('0x36')];if(!_0xd4b6e1[_0x7e35('0x31')][_0x7e35('0x4a')]('nolimit')){_0x3409d6[_0x7e35('0x1e')]=qs[_0x7e35('0x1e')](_0xd4b6e1[_0x7e35('0x31')]['limit']);_0x3409d6['offset']=qs['offset'](_0xd4b6e1[_0x7e35('0x31')][_0x7e35('0x1d')]);}return _0x43d905[_0x7e35('0x4b')](_0x3409d6);}})[_0x7e35('0x26')](function(_0x25a3ed){if(_0x25a3ed){return _0x25a3ed?{'count':_0x5a136a,'rows':_0x25a3ed}:null;}})['then'](respondWithResult(_0x15cf73,null))[_0x7e35('0x43')](handleError(_0x15cf73,null));};exports[_0x7e35('0x4e')]=function(_0x142a74,_0xd4a01c,_0x450cbc){var _0x10e8e={};var _0x365c1c={};var _0x5da13a;var _0x1cd614;return db['DeskConfiguration'][_0x7e35('0x4c')]({'where':{'id':_0x142a74[_0x7e35('0x45')]['id']}})[_0x7e35('0x26')](handleEntityNotFound(_0xd4a01c,null))[_0x7e35('0x26')](function(_0xaba752){if(_0xaba752){_0x5da13a=_0xaba752;_0x365c1c[_0x7e35('0x30')]=_[_0x7e35('0x32')](db[_0x7e35('0x4f')][_0x7e35('0x2c')]);_0x365c1c[_0x7e35('0x31')]=_[_0x7e35('0x32')](_0x142a74['query']);_0x365c1c[_0x7e35('0x3b')]=_['intersection'](_0x365c1c['model'],_0x365c1c[_0x7e35('0x31')]);_0x10e8e[_0x7e35('0x34')]=_[_0x7e35('0x33')](_0x365c1c[_0x7e35('0x30')],qs['fields'](_0x142a74[_0x7e35('0x31')][_0x7e35('0x35')]));_0x10e8e[_0x7e35('0x34')]=_0x10e8e['attributes'][_0x7e35('0x36')]?_0x10e8e[_0x7e35('0x34')]:_0x365c1c[_0x7e35('0x30')];_0x10e8e[_0x7e35('0x38')]=qs[_0x7e35('0x39')](_0x142a74[_0x7e35('0x31')]['sort']);_0x10e8e['where']=qs[_0x7e35('0x3b')](_[_0x7e35('0x3c')](_0x142a74[_0x7e35('0x31')],_0x365c1c[_0x7e35('0x3b')]));if(_0x142a74[_0x7e35('0x31')][_0x7e35('0x3d')]){_0x10e8e[_0x7e35('0x3a')]=_[_0x7e35('0x3e')](_0x10e8e[_0x7e35('0x3a')],{'$or':_[_0x7e35('0x4d')](_0x10e8e['attributes'],function(_0x7f3fb9){var _0xc2147c={};_0xc2147c[_0x7f3fb9]={'$like':'%'+_0x142a74[_0x7e35('0x31')][_0x7e35('0x3d')]+'%'};return _0xc2147c;})});}_0x10e8e=_['merge']({},_0x10e8e,_0x142a74[_0x7e35('0x3f')]);return _0x5da13a[_0x7e35('0x4e')](_0x10e8e);}})[_0x7e35('0x26')](function(_0x553f6c){if(_0x553f6c){_0x1cd614=_0x553f6c[_0x7e35('0x36')];if(!_0x142a74[_0x7e35('0x31')][_0x7e35('0x4a')]('nolimit')){_0x10e8e[_0x7e35('0x1e')]=qs[_0x7e35('0x1e')](_0x142a74[_0x7e35('0x31')][_0x7e35('0x1e')]);_0x10e8e[_0x7e35('0x1d')]=qs[_0x7e35('0x1d')](_0x142a74[_0x7e35('0x31')][_0x7e35('0x1d')]);}return _0x5da13a['getDescriptions'](_0x10e8e);}})[_0x7e35('0x26')](function(_0x13d52c){if(_0x13d52c){return _0x13d52c?{'count':_0x1cd614,'rows':_0x13d52c}:null;}})[_0x7e35('0x26')](respondWithResult(_0xd4a01c,null))['catch'](handleError(_0xd4a01c,null));};exports[_0x7e35('0x50')]=function(_0x336bde,_0x3c9a35,_0x16fe1c){var _0x29b5db={};var _0x4e9bbf={};var _0x24c889;var _0x26b1bd;return db[_0x7e35('0x2b')][_0x7e35('0x4c')]({'where':{'id':_0x336bde[_0x7e35('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c9a35,null))['then'](function(_0x1bff80){if(_0x1bff80){_0x24c889=_0x1bff80;_0x4e9bbf['model']=_[_0x7e35('0x32')](db['Tag']['rawAttributes']);_0x4e9bbf['query']=_[_0x7e35('0x32')](_0x336bde[_0x7e35('0x31')]);_0x4e9bbf[_0x7e35('0x3b')]=_[_0x7e35('0x33')](_0x4e9bbf['model'],_0x4e9bbf[_0x7e35('0x31')]);_0x29b5db['attributes']=_[_0x7e35('0x33')](_0x4e9bbf['model'],qs[_0x7e35('0x35')](_0x336bde['query'][_0x7e35('0x35')]));_0x29b5db['attributes']=_0x29b5db[_0x7e35('0x34')][_0x7e35('0x36')]?_0x29b5db[_0x7e35('0x34')]:_0x4e9bbf[_0x7e35('0x30')];_0x29b5db[_0x7e35('0x38')]=qs[_0x7e35('0x39')](_0x336bde[_0x7e35('0x31')][_0x7e35('0x39')]);_0x29b5db['where']=qs[_0x7e35('0x3b')](_[_0x7e35('0x3c')](_0x336bde[_0x7e35('0x31')],_0x4e9bbf[_0x7e35('0x3b')]));if(_0x336bde[_0x7e35('0x31')][_0x7e35('0x3d')]){_0x29b5db[_0x7e35('0x3a')]=_[_0x7e35('0x3e')](_0x29b5db['where'],{'$or':_[_0x7e35('0x4d')](_0x29b5db[_0x7e35('0x34')],function(_0x53d385){var _0x4455bd={};_0x4455bd[_0x53d385]={'$like':'%'+_0x336bde[_0x7e35('0x31')][_0x7e35('0x3d')]+'%'};return _0x4455bd;})});}_0x29b5db=_[_0x7e35('0x3e')]({},_0x29b5db,_0x336bde['options']);return _0x24c889[_0x7e35('0x50')](_0x29b5db);}})[_0x7e35('0x26')](function(_0x42d599){if(_0x42d599){_0x26b1bd=_0x42d599[_0x7e35('0x36')];if(!_0x336bde[_0x7e35('0x31')]['hasOwnProperty'](_0x7e35('0x37'))){_0x29b5db[_0x7e35('0x1e')]=qs[_0x7e35('0x1e')](_0x336bde[_0x7e35('0x31')]['limit']);_0x29b5db[_0x7e35('0x1d')]=qs['offset'](_0x336bde[_0x7e35('0x31')][_0x7e35('0x1d')]);}return _0x24c889['getTags'](_0x29b5db);}})[_0x7e35('0x26')](function(_0x3eea3d){if(_0x3eea3d){return _0x3eea3d?{'count':_0x26b1bd,'rows':_0x3eea3d}:null;}})['then'](respondWithResult(_0x3c9a35,null))[_0x7e35('0x43')](handleError(_0x3c9a35,null));};exports[_0x7e35('0x51')]=function(_0x169d4b,_0x546e5f,_0x1f3700){if(_0x169d4b[_0x7e35('0x48')]['id']){delete _0x169d4b[_0x7e35('0x48')]['id'];}return db[_0x7e35('0x2b')][_0x7e35('0x4c')]({'where':{'id':_0x169d4b[_0x7e35('0x45')]['id']}})['then'](handleEntityNotFound(_0x546e5f,null))['then'](function(_0x4e3590){if(_0x4e3590){return _0x4e3590[_0x7e35('0x51')](_0x169d4b['body'][_0x7e35('0x52')]||[]);}return null;})[_0x7e35('0x26')](respondWithResult(_0x546e5f,null))['catch'](handleError(_0x546e5f,null));}; \ No newline at end of file +var _0x1892=['rows','catch','show','params','include','merge','find','create','body','getFields','findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll'];(function(_0xc64946,_0x229695){var _0x2f66e5=function(_0x3028d5){while(--_0x3028d5){_0xc64946['push'](_0xc64946['shift']());}};_0x2f66e5(++_0x229695);}(_0x1892,0x6b));var _0x2189=function(_0x1ac8d8,_0x1d74c3){_0x1ac8d8=_0x1ac8d8-0x0;var _0x1de20e=_0x1892[_0x1ac8d8];return _0x1de20e;};'use strict';var emlformat=require(_0x2189('0x0'));var rimraf=require(_0x2189('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2189('0x2'));var rp=require(_0x2189('0x3'));var moment=require(_0x2189('0x4'));var BPromise=require(_0x2189('0x5'));var Mustache=require(_0x2189('0x6'));var util=require(_0x2189('0x7'));var path=require(_0x2189('0x8'));var sox=require(_0x2189('0x9'));var csv=require(_0x2189('0xa'));var ejs=require(_0x2189('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2189('0xc'));var squel=require(_0x2189('0xd'));var crypto=require('crypto');var jsforce=require(_0x2189('0xe'));var deskjs=require(_0x2189('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2189('0x10'));var Papa=require(_0x2189('0x11'));var Redis=require(_0x2189('0x12'));var authService=require(_0x2189('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2189('0x14'));var hardwareService=require(_0x2189('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2189('0x16'));var config=require(_0x2189('0x17'));var licenseUtil=require(_0x2189('0x18'));var db=require(_0x2189('0x19'))['db'];function respondWithStatusCode(_0x564a39,_0x2b1e8d){_0x2b1e8d=_0x2b1e8d||0xcc;return function(_0x1bf444){if(_0x1bf444){return _0x564a39['sendStatus'](_0x2b1e8d);}return _0x564a39[_0x2189('0x1a')](_0x2b1e8d)[_0x2189('0x1b')]();};}function respondWithResult(_0x17425a,_0x1b01bd){_0x1b01bd=_0x1b01bd||0xc8;return function(_0x5a1475){if(_0x5a1475){return _0x17425a[_0x2189('0x1a')](_0x1b01bd)[_0x2189('0x1c')](_0x5a1475);}};}function respondWithFilteredResult(_0x49439f,_0x470f1f){return function(_0x4ef718){if(_0x4ef718){var _0xaf19cb=typeof _0x470f1f[_0x2189('0x1d')]==='undefined'&&typeof _0x470f1f['limit']===_0x2189('0x1e');var _0x45bb52=_0x4ef718[_0x2189('0x1f')];var _0x58105b=_0xaf19cb?0x0:_0x470f1f[_0x2189('0x1d')];var _0x51af48=_0xaf19cb?_0x4ef718[_0x2189('0x1f')]:_0x470f1f[_0x2189('0x1d')]+_0x470f1f['limit'];var _0x3e68fe;if(_0x51af48>=_0x45bb52){_0x51af48=_0x45bb52;_0x3e68fe=0xc8;}else{_0x3e68fe=0xce;}_0x49439f[_0x2189('0x1a')](_0x3e68fe);return _0x49439f[_0x2189('0x20')](_0x2189('0x21'),_0x58105b+'-'+_0x51af48+'/'+_0x45bb52)[_0x2189('0x1c')](_0x4ef718);}return null;};}function patchUpdates(_0x3fb08e){return function(_0x3446a1){try{jsonpatch['apply'](_0x3446a1,_0x3fb08e,!![]);}catch(_0x217884){return BPromise[_0x2189('0x22')](_0x217884);}return _0x3446a1[_0x2189('0x23')]();};}function saveUpdates(_0x25b06a,_0x503431){return function(_0x522966){if(_0x522966){return _0x522966[_0x2189('0x24')](_0x25b06a)[_0x2189('0x25')](function(_0x5a3964){return _0x5a3964;});}return null;};}function removeEntity(_0x10e1fa,_0x1fa44f){return function(_0x218104){if(_0x218104){return _0x218104[_0x2189('0x26')]()['then'](function(){_0x10e1fa['status'](0xcc)[_0x2189('0x1b')]();});}};}function handleEntityNotFound(_0xefe770,_0x3a243f){return function(_0x1d0029){if(!_0x1d0029){_0xefe770[_0x2189('0x27')](0x194);}return _0x1d0029;};}function handleError(_0x47f53b,_0x3249da){_0x3249da=_0x3249da||0x1f4;return function(_0x1227e3){logger[_0x2189('0x28')](_0x1227e3[_0x2189('0x29')]);if(_0x1227e3[_0x2189('0x2a')]){delete _0x1227e3[_0x2189('0x2a')];}_0x47f53b[_0x2189('0x1a')](_0x3249da)[_0x2189('0x2b')](_0x1227e3);};}exports[_0x2189('0x2c')]=function(_0x222abb,_0x5e1590){var _0x123933={},_0x26ad37={},_0x11110b={'count':0x0,'rows':[]};var _0x3989e2=_[_0x2189('0x2d')](db[_0x2189('0x2e')][_0x2189('0x2f')],function(_0x40e112){return{'name':_0x40e112[_0x2189('0x30')],'type':_0x40e112[_0x2189('0x31')]['key']};});_0x26ad37['model']=_[_0x2189('0x2d')](_0x3989e2,_0x2189('0x2a'));_0x26ad37[_0x2189('0x32')]=_[_0x2189('0x33')](_0x222abb['query']);_0x26ad37[_0x2189('0x34')]=_[_0x2189('0x35')](_0x26ad37[_0x2189('0x36')],_0x26ad37[_0x2189('0x32')]);_0x123933[_0x2189('0x37')]=_[_0x2189('0x35')](_0x26ad37[_0x2189('0x36')],qs[_0x2189('0x38')](_0x222abb[_0x2189('0x32')]['fields']));_0x123933[_0x2189('0x37')]=_0x123933[_0x2189('0x37')][_0x2189('0x39')]?_0x123933[_0x2189('0x37')]:_0x26ad37['model'];if(!_0x222abb[_0x2189('0x32')]['hasOwnProperty'](_0x2189('0x3a'))){_0x123933[_0x2189('0x3b')]=qs[_0x2189('0x3b')](_0x222abb[_0x2189('0x32')][_0x2189('0x3b')]);_0x123933[_0x2189('0x1d')]=qs[_0x2189('0x1d')](_0x222abb[_0x2189('0x32')]['offset']);}_0x123933[_0x2189('0x3c')]=qs[_0x2189('0x3d')](_0x222abb[_0x2189('0x32')][_0x2189('0x3d')]);_0x123933[_0x2189('0x3e')]=qs[_0x2189('0x34')](_[_0x2189('0x3f')](_0x222abb['query'],_0x26ad37[_0x2189('0x34')]),_0x3989e2);if(_0x222abb[_0x2189('0x32')][_0x2189('0x40')]){_0x123933[_0x2189('0x3e')]=_['merge'](_0x123933['where'],{'$or':_[_0x2189('0x2d')](_0x3989e2,function(_0x6664c){if(_0x6664c['type']!==_0x2189('0x41')){var _0x26d366={};_0x26d366[_0x6664c['name']]={'$like':'%'+_0x222abb[_0x2189('0x32')][_0x2189('0x40')]+'%'};return _0x26d366;}})});}_0x123933=_['merge']({},_0x123933,_0x222abb[_0x2189('0x42')]);var _0x7bb72d={'where':_0x123933[_0x2189('0x3e')]};return db[_0x2189('0x2e')]['count'](_0x7bb72d)['then'](function(_0x1ed016){_0x11110b[_0x2189('0x1f')]=_0x1ed016;if(_0x222abb['query'][_0x2189('0x43')]){_0x123933['include']=[{'all':!![]}];}return db[_0x2189('0x2e')][_0x2189('0x44')](_0x123933);})[_0x2189('0x25')](function(_0x1fcb9){_0x11110b[_0x2189('0x45')]=_0x1fcb9;return _0x11110b;})[_0x2189('0x25')](respondWithFilteredResult(_0x5e1590,_0x123933))[_0x2189('0x46')](handleError(_0x5e1590,null));};exports[_0x2189('0x47')]=function(_0x5e75f1,_0x7c1e60){var _0x4efaf5={'raw':![],'where':{'id':_0x5e75f1[_0x2189('0x48')]['id']}},_0x54b9bf={};_0x54b9bf[_0x2189('0x36')]=_[_0x2189('0x33')](db['DeskConfiguration']['rawAttributes']);_0x54b9bf[_0x2189('0x32')]=_[_0x2189('0x33')](_0x5e75f1[_0x2189('0x32')]);_0x54b9bf[_0x2189('0x34')]=_[_0x2189('0x35')](_0x54b9bf['model'],_0x54b9bf['query']);_0x4efaf5[_0x2189('0x37')]=_[_0x2189('0x35')](_0x54b9bf[_0x2189('0x36')],qs[_0x2189('0x38')](_0x5e75f1[_0x2189('0x32')][_0x2189('0x38')]));_0x4efaf5[_0x2189('0x37')]=_0x4efaf5['attributes'][_0x2189('0x39')]?_0x4efaf5[_0x2189('0x37')]:_0x54b9bf[_0x2189('0x36')];if(_0x5e75f1['query']['includeAll']){_0x4efaf5[_0x2189('0x49')]=[{'all':!![]}];}_0x4efaf5=_[_0x2189('0x4a')]({},_0x4efaf5,_0x5e75f1[_0x2189('0x42')]);return db['DeskConfiguration'][_0x2189('0x4b')](_0x4efaf5)[_0x2189('0x25')](handleEntityNotFound(_0x7c1e60,null))['then'](respondWithResult(_0x7c1e60,null))['catch'](handleError(_0x7c1e60,null));};exports[_0x2189('0x4c')]=function(_0x1a7db2,_0x58ca00){return db[_0x2189('0x2e')][_0x2189('0x4c')](_0x1a7db2['body'],{})[_0x2189('0x25')](respondWithResult(_0x58ca00,0xc9))[_0x2189('0x46')](handleError(_0x58ca00,null));};exports[_0x2189('0x24')]=function(_0x315da1,_0xf3329e){if(_0x315da1[_0x2189('0x4d')]['id']){delete _0x315da1[_0x2189('0x4d')]['id'];}return db[_0x2189('0x2e')][_0x2189('0x4b')]({'where':{'id':_0x315da1['params']['id']}})['then'](handleEntityNotFound(_0xf3329e,null))[_0x2189('0x25')](saveUpdates(_0x315da1[_0x2189('0x4d')],null))[_0x2189('0x25')](respondWithResult(_0xf3329e,null))[_0x2189('0x46')](handleError(_0xf3329e,null));};exports[_0x2189('0x26')]=function(_0x27ab04,_0x40511d){return db[_0x2189('0x2e')]['find']({'where':{'id':_0x27ab04['params']['id']}})[_0x2189('0x25')](handleEntityNotFound(_0x40511d,null))['then'](removeEntity(_0x40511d,null))[_0x2189('0x46')](handleError(_0x40511d,null));};exports[_0x2189('0x4e')]=function(_0x25ba9f,_0xb1209f,_0x4b65cf){var _0xe91a27={};var _0x4c09a8={};var _0x4d2007;var _0x1ccb8c;return db[_0x2189('0x2e')][_0x2189('0x4f')]({'where':{'id':_0x25ba9f[_0x2189('0x48')]['id']}})['then'](handleEntityNotFound(_0xb1209f,null))[_0x2189('0x25')](function(_0x358cc8){if(_0x358cc8){_0x4d2007=_0x358cc8;_0x4c09a8[_0x2189('0x36')]=_['keys'](db[_0x2189('0x50')][_0x2189('0x2f')]);_0x4c09a8['query']=_['keys'](_0x25ba9f['query']);_0x4c09a8['filters']=_[_0x2189('0x35')](_0x4c09a8[_0x2189('0x36')],_0x4c09a8['query']);_0xe91a27[_0x2189('0x37')]=_['intersection'](_0x4c09a8[_0x2189('0x36')],qs[_0x2189('0x38')](_0x25ba9f[_0x2189('0x32')][_0x2189('0x38')]));_0xe91a27[_0x2189('0x37')]=_0xe91a27[_0x2189('0x37')]['length']?_0xe91a27[_0x2189('0x37')]:_0x4c09a8[_0x2189('0x36')];_0xe91a27[_0x2189('0x3c')]=qs[_0x2189('0x3d')](_0x25ba9f[_0x2189('0x32')][_0x2189('0x3d')]);_0xe91a27[_0x2189('0x3e')]=qs[_0x2189('0x34')](_[_0x2189('0x3f')](_0x25ba9f[_0x2189('0x32')],_0x4c09a8[_0x2189('0x34')]));if(_0x25ba9f['query']['filter']){_0xe91a27[_0x2189('0x3e')]=_[_0x2189('0x4a')](_0xe91a27[_0x2189('0x3e')],{'$or':_[_0x2189('0x2d')](_0xe91a27[_0x2189('0x37')],function(_0x1c7e2e){var _0x311f3a={};_0x311f3a[_0x1c7e2e]={'$like':'%'+_0x25ba9f[_0x2189('0x32')][_0x2189('0x40')]+'%'};return _0x311f3a;})});}_0xe91a27=_[_0x2189('0x4a')]({},_0xe91a27,_0x25ba9f['options']);return _0x4d2007['getFields'](_0xe91a27);}})['then'](function(_0x2c3e54){if(_0x2c3e54){_0x1ccb8c=_0x2c3e54[_0x2189('0x39')];if(!_0x25ba9f['query'][_0x2189('0x51')]('nolimit')){_0xe91a27[_0x2189('0x3b')]=qs[_0x2189('0x3b')](_0x25ba9f['query']['limit']);_0xe91a27[_0x2189('0x1d')]=qs[_0x2189('0x1d')](_0x25ba9f[_0x2189('0x32')][_0x2189('0x1d')]);}return _0x4d2007[_0x2189('0x4e')](_0xe91a27);}})[_0x2189('0x25')](function(_0x774262){if(_0x774262){return _0x774262?{'count':_0x1ccb8c,'rows':_0x774262}:null;}})[_0x2189('0x25')](respondWithResult(_0xb1209f,null))['catch'](handleError(_0xb1209f,null));};exports[_0x2189('0x52')]=function(_0x5dd1aa,_0x4e7dc7,_0x4b402d){var _0x3248ba={};var _0x2ed5ac={};var _0x1532d0;var _0x178073;return db[_0x2189('0x2e')][_0x2189('0x4f')]({'where':{'id':_0x5dd1aa['params']['id']}})[_0x2189('0x25')](handleEntityNotFound(_0x4e7dc7,null))['then'](function(_0x1bc267){if(_0x1bc267){_0x1532d0=_0x1bc267;_0x2ed5ac['model']=_[_0x2189('0x33')](db[_0x2189('0x50')][_0x2189('0x2f')]);_0x2ed5ac[_0x2189('0x32')]=_[_0x2189('0x33')](_0x5dd1aa[_0x2189('0x32')]);_0x2ed5ac[_0x2189('0x34')]=_['intersection'](_0x2ed5ac['model'],_0x2ed5ac[_0x2189('0x32')]);_0x3248ba['attributes']=_[_0x2189('0x35')](_0x2ed5ac[_0x2189('0x36')],qs[_0x2189('0x38')](_0x5dd1aa['query'][_0x2189('0x38')]));_0x3248ba[_0x2189('0x37')]=_0x3248ba['attributes'][_0x2189('0x39')]?_0x3248ba[_0x2189('0x37')]:_0x2ed5ac[_0x2189('0x36')];_0x3248ba[_0x2189('0x3c')]=qs[_0x2189('0x3d')](_0x5dd1aa[_0x2189('0x32')][_0x2189('0x3d')]);_0x3248ba[_0x2189('0x3e')]=qs['filters'](_[_0x2189('0x3f')](_0x5dd1aa[_0x2189('0x32')],_0x2ed5ac[_0x2189('0x34')]));if(_0x5dd1aa[_0x2189('0x32')][_0x2189('0x40')]){_0x3248ba[_0x2189('0x3e')]=_[_0x2189('0x4a')](_0x3248ba['where'],{'$or':_[_0x2189('0x2d')](_0x3248ba[_0x2189('0x37')],function(_0x550d27){var _0x7ddec3={};_0x7ddec3[_0x550d27]={'$like':'%'+_0x5dd1aa[_0x2189('0x32')][_0x2189('0x40')]+'%'};return _0x7ddec3;})});}_0x3248ba=_[_0x2189('0x4a')]({},_0x3248ba,_0x5dd1aa[_0x2189('0x42')]);return _0x1532d0['getSubjects'](_0x3248ba);}})[_0x2189('0x25')](function(_0x23f914){if(_0x23f914){_0x178073=_0x23f914[_0x2189('0x39')];if(!_0x5dd1aa[_0x2189('0x32')][_0x2189('0x51')](_0x2189('0x3a'))){_0x3248ba[_0x2189('0x3b')]=qs[_0x2189('0x3b')](_0x5dd1aa[_0x2189('0x32')]['limit']);_0x3248ba[_0x2189('0x1d')]=qs['offset'](_0x5dd1aa[_0x2189('0x32')][_0x2189('0x1d')]);}return _0x1532d0[_0x2189('0x52')](_0x3248ba);}})[_0x2189('0x25')](function(_0x13f5cf){if(_0x13f5cf){return _0x13f5cf?{'count':_0x178073,'rows':_0x13f5cf}:null;}})[_0x2189('0x25')](respondWithResult(_0x4e7dc7,null))[_0x2189('0x46')](handleError(_0x4e7dc7,null));};exports[_0x2189('0x53')]=function(_0x55eb2e,_0x112ba9,_0x101c4d){var _0x1c7ee0={};var _0x58907f={};var _0x4bc0e3;var _0xee9d10;return db[_0x2189('0x2e')][_0x2189('0x4f')]({'where':{'id':_0x55eb2e[_0x2189('0x48')]['id']}})[_0x2189('0x25')](handleEntityNotFound(_0x112ba9,null))[_0x2189('0x25')](function(_0x3b2b49){if(_0x3b2b49){_0x4bc0e3=_0x3b2b49;_0x58907f['model']=_[_0x2189('0x33')](db['DeskField'][_0x2189('0x2f')]);_0x58907f[_0x2189('0x32')]=_[_0x2189('0x33')](_0x55eb2e[_0x2189('0x32')]);_0x58907f[_0x2189('0x34')]=_[_0x2189('0x35')](_0x58907f['model'],_0x58907f[_0x2189('0x32')]);_0x1c7ee0[_0x2189('0x37')]=_[_0x2189('0x35')](_0x58907f[_0x2189('0x36')],qs[_0x2189('0x38')](_0x55eb2e[_0x2189('0x32')][_0x2189('0x38')]));_0x1c7ee0[_0x2189('0x37')]=_0x1c7ee0[_0x2189('0x37')][_0x2189('0x39')]?_0x1c7ee0[_0x2189('0x37')]:_0x58907f[_0x2189('0x36')];_0x1c7ee0[_0x2189('0x3c')]=qs[_0x2189('0x3d')](_0x55eb2e[_0x2189('0x32')]['sort']);_0x1c7ee0[_0x2189('0x3e')]=qs[_0x2189('0x34')](_['pick'](_0x55eb2e[_0x2189('0x32')],_0x58907f[_0x2189('0x34')]));if(_0x55eb2e['query'][_0x2189('0x40')]){_0x1c7ee0[_0x2189('0x3e')]=_[_0x2189('0x4a')](_0x1c7ee0[_0x2189('0x3e')],{'$or':_[_0x2189('0x2d')](_0x1c7ee0[_0x2189('0x37')],function(_0x379da9){var _0x448ebb={};_0x448ebb[_0x379da9]={'$like':'%'+_0x55eb2e[_0x2189('0x32')][_0x2189('0x40')]+'%'};return _0x448ebb;})});}_0x1c7ee0=_[_0x2189('0x4a')]({},_0x1c7ee0,_0x55eb2e[_0x2189('0x42')]);return _0x4bc0e3[_0x2189('0x53')](_0x1c7ee0);}})[_0x2189('0x25')](function(_0x3492aa){if(_0x3492aa){_0xee9d10=_0x3492aa[_0x2189('0x39')];if(!_0x55eb2e['query']['hasOwnProperty']('nolimit')){_0x1c7ee0[_0x2189('0x3b')]=qs['limit'](_0x55eb2e[_0x2189('0x32')][_0x2189('0x3b')]);_0x1c7ee0[_0x2189('0x1d')]=qs[_0x2189('0x1d')](_0x55eb2e['query'][_0x2189('0x1d')]);}return _0x4bc0e3['getDescriptions'](_0x1c7ee0);}})[_0x2189('0x25')](function(_0x5d9a9c){if(_0x5d9a9c){return _0x5d9a9c?{'count':_0xee9d10,'rows':_0x5d9a9c}:null;}})[_0x2189('0x25')](respondWithResult(_0x112ba9,null))[_0x2189('0x46')](handleError(_0x112ba9,null));};exports['getTags']=function(_0x20d1ff,_0x104934,_0x1ab22c){var _0x199fce={};var _0x431937={};var _0xefa9d7;var _0x41fab5;return db[_0x2189('0x2e')]['findOne']({'where':{'id':_0x20d1ff[_0x2189('0x48')]['id']}})[_0x2189('0x25')](handleEntityNotFound(_0x104934,null))[_0x2189('0x25')](function(_0x2eec93){if(_0x2eec93){_0xefa9d7=_0x2eec93;_0x431937[_0x2189('0x36')]=_[_0x2189('0x33')](db[_0x2189('0x54')][_0x2189('0x2f')]);_0x431937[_0x2189('0x32')]=_[_0x2189('0x33')](_0x20d1ff[_0x2189('0x32')]);_0x431937[_0x2189('0x34')]=_['intersection'](_0x431937[_0x2189('0x36')],_0x431937[_0x2189('0x32')]);_0x199fce[_0x2189('0x37')]=_[_0x2189('0x35')](_0x431937['model'],qs[_0x2189('0x38')](_0x20d1ff[_0x2189('0x32')][_0x2189('0x38')]));_0x199fce[_0x2189('0x37')]=_0x199fce[_0x2189('0x37')]['length']?_0x199fce[_0x2189('0x37')]:_0x431937[_0x2189('0x36')];_0x199fce[_0x2189('0x3c')]=qs['sort'](_0x20d1ff[_0x2189('0x32')][_0x2189('0x3d')]);_0x199fce[_0x2189('0x3e')]=qs['filters'](_[_0x2189('0x3f')](_0x20d1ff['query'],_0x431937[_0x2189('0x34')]));if(_0x20d1ff[_0x2189('0x32')][_0x2189('0x40')]){_0x199fce[_0x2189('0x3e')]=_[_0x2189('0x4a')](_0x199fce[_0x2189('0x3e')],{'$or':_[_0x2189('0x2d')](_0x199fce[_0x2189('0x37')],function(_0x3f208c){var _0x4bde03={};_0x4bde03[_0x3f208c]={'$like':'%'+_0x20d1ff[_0x2189('0x32')][_0x2189('0x40')]+'%'};return _0x4bde03;})});}_0x199fce=_[_0x2189('0x4a')]({},_0x199fce,_0x20d1ff['options']);return _0xefa9d7[_0x2189('0x55')](_0x199fce);}})[_0x2189('0x25')](function(_0x4858e6){if(_0x4858e6){_0x41fab5=_0x4858e6[_0x2189('0x39')];if(!_0x20d1ff['query']['hasOwnProperty'](_0x2189('0x3a'))){_0x199fce[_0x2189('0x3b')]=qs[_0x2189('0x3b')](_0x20d1ff[_0x2189('0x32')]['limit']);_0x199fce['offset']=qs['offset'](_0x20d1ff[_0x2189('0x32')][_0x2189('0x1d')]);}return _0xefa9d7['getTags'](_0x199fce);}})['then'](function(_0x8baaab){if(_0x8baaab){return _0x8baaab?{'count':_0x41fab5,'rows':_0x8baaab}:null;}})[_0x2189('0x25')](respondWithResult(_0x104934,null))[_0x2189('0x46')](handleError(_0x104934,null));};exports[_0x2189('0x56')]=function(_0x1ab219,_0x2e33da,_0x3a7d12){if(_0x1ab219[_0x2189('0x4d')]['id']){delete _0x1ab219[_0x2189('0x4d')]['id'];}return db['DeskConfiguration'][_0x2189('0x4f')]({'where':{'id':_0x1ab219['params']['id']}})[_0x2189('0x25')](handleEntityNotFound(_0x2e33da,null))[_0x2189('0x25')](function(_0x36eaff){if(_0x36eaff){return _0x36eaff[_0x2189('0x56')](_0x1ab219[_0x2189('0x4d')][_0x2189('0x57')]||[]);}return null;})[_0x2189('0x25')](respondWithResult(_0x2e33da,null))[_0x2189('0x46')](handleError(_0x2e33da,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0f598cc..8de5300 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 _0x9722=['util','../../config/logger','api','moment','bluebird','request-promise','./intDeskConfiguration.attributes','exports','define','int_desk_configurations'];(function(_0x2246f2,_0x32d10d){var _0x57438f=function(_0xafc755){while(--_0xafc755){_0x2246f2['push'](_0x2246f2['shift']());}};_0x57438f(++_0x32d10d);}(_0x9722,0x140));var _0x2972=function(_0x37ec84,_0x14c659){_0x37ec84=_0x37ec84-0x0;var _0x108cfd=_0x9722[_0x37ec84];return _0x108cfd;};'use strict';var _=require('lodash');var util=require(_0x2972('0x0'));var logger=require(_0x2972('0x1'))(_0x2972('0x2'));var moment=require(_0x2972('0x3'));var BPromise=require(_0x2972('0x4'));var rp=require(_0x2972('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2972('0x6'));module[_0x2972('0x7')]=function(_0x3e203d,_0x28c6c5){return _0x3e203d[_0x2972('0x8')]('DeskConfiguration',attributes,{'tableName':_0x2972('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd45=['bluebird','request-promise','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment'];(function(_0x263901,_0x36ae24){var _0x31f81e=function(_0x3c36d9){while(--_0x3c36d9){_0x263901['push'](_0x263901['shift']());}};_0x31f81e(++_0x36ae24);}(_0xdd45,0x10a));var _0x5dd4=function(_0x264350,_0x5bad2c){_0x264350=_0x264350-0x0;var _0x4217cb=_0xdd45[_0x264350];return _0x4217cb;};'use strict';var _=require(_0x5dd4('0x0'));var util=require('util');var logger=require(_0x5dd4('0x1'))(_0x5dd4('0x2'));var moment=require(_0x5dd4('0x3'));var BPromise=require(_0x5dd4('0x4'));var rp=require(_0x5dd4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5dd4('0x6'));var attributes=require(_0x5dd4('0x7'));module['exports']=function(_0x46dd0e,_0xbb4ae4){return _0x46dd0e['define'](_0x5dd4('0x8'),attributes,{'tableName':_0x5dd4('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 18a1856..b83369a 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 _0x5fa1=['request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3c957d,_0x40d8f3){var _0x46ab64=function(_0x470663){while(--_0x470663){_0x3c957d['push'](_0x3c957d['shift']());}};_0x46ab64(++_0x40d8f3);}(_0x5fa1,0xd2));var _0x15fa=function(_0xe3f14f,_0x4f38d1){_0xe3f14f=_0xe3f14f-0x0;var _0x3fc066=_0x5fa1[_0xe3f14f];return _0x3fc066;};'use strict';var _=require(_0x15fa('0x0'));var util=require(_0x15fa('0x1'));var moment=require('moment');var BPromise=require(_0x15fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15fa('0x3'));var db=require(_0x15fa('0x4'))['db'];var utils=require(_0x15fa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x15fa('0x6'));var jayson=require(_0x15fa('0x7'));var client=jayson[_0x15fa('0x8')][_0x15fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eba46,_0x251f6d,_0x38fd8d){return new BPromise(function(_0x3de7f3,_0x557013){return client[_0x15fa('0xa')](_0x5eba46,_0x38fd8d)[_0x15fa('0xb')](function(_0x4a081e){logger[_0x15fa('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x251f6d,'request\x20sent');logger[_0x15fa('0xd')](_0x15fa('0xe'),_0x251f6d,_0x15fa('0xf'),JSON[_0x15fa('0x10')](_0x4a081e));if(_0x4a081e[_0x15fa('0x11')]){if(_0x4a081e[_0x15fa('0x11')][_0x15fa('0x12')]===0x1f4){logger['error'](_0x15fa('0x13'),_0x251f6d,_0x4a081e['error']['message']);return _0x557013(_0x4a081e[_0x15fa('0x11')][_0x15fa('0x14')]);}logger[_0x15fa('0x11')](_0x15fa('0x13'),_0x251f6d,_0x4a081e['error']['message']);return _0x3de7f3(_0x4a081e[_0x15fa('0x11')][_0x15fa('0x14')]);}else{logger[_0x15fa('0xc')](_0x15fa('0x13'),_0x251f6d,'request\x20sent');_0x3de7f3(_0x4a081e['result'][_0x15fa('0x14')]);}})[_0x15fa('0x15')](function(_0x444a73){logger['error'](_0x15fa('0x13'),_0x251f6d,_0x444a73);_0x557013(_0x444a73);});});} \ No newline at end of file +var _0x2432=['message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2432,0x7a));var _0x2243=function(_0x3e6d6e,_0x3f83b7){_0x3e6d6e=_0x3e6d6e-0x0;var _0xbc81d3=_0x2432[_0x3e6d6e];return _0xbc81d3;};'use strict';var _=require(_0x2243('0x0'));var util=require(_0x2243('0x1'));var moment=require(_0x2243('0x2'));var BPromise=require(_0x2243('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2243('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2243('0x5'));var logger=require(_0x2243('0x6'))(_0x2243('0x7'));var config=require(_0x2243('0x8'));var jayson=require(_0x2243('0x9'));var client=jayson[_0x2243('0xa')][_0x2243('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28678a,_0x1c42af,_0x4f196b){return new BPromise(function(_0x440203,_0x128d83){return client[_0x2243('0xc')](_0x28678a,_0x4f196b)[_0x2243('0xd')](function(_0x31a479){logger[_0x2243('0xe')](_0x2243('0xf'),_0x1c42af,_0x2243('0x10'));logger[_0x2243('0x11')](_0x2243('0x12'),_0x1c42af,_0x2243('0x10'),JSON[_0x2243('0x13')](_0x31a479));if(_0x31a479[_0x2243('0x14')]){if(_0x31a479[_0x2243('0x14')][_0x2243('0x15')]===0x1f4){logger[_0x2243('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x1c42af,_0x31a479[_0x2243('0x14')][_0x2243('0x16')]);return _0x128d83(_0x31a479[_0x2243('0x14')][_0x2243('0x16')]);}logger['error'](_0x2243('0xf'),_0x1c42af,_0x31a479['error'][_0x2243('0x16')]);return _0x440203(_0x31a479['error'][_0x2243('0x16')]);}else{logger[_0x2243('0xe')](_0x2243('0xf'),_0x1c42af,_0x2243('0x10'));_0x440203(_0x31a479['result']['message']);}})[_0x2243('0x17')](function(_0x31ca17){logger[_0x2243('0x14')](_0x2243('0xf'),_0x1c42af,_0x31ca17);_0x128d83(_0x31ca17);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d8d3a2a..ce1d3d6 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 _0x8286=['index','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated'];(function(_0x40dc29,_0x4a07e5){var _0x1cb592=function(_0x5901c3){while(--_0x5901c3){_0x40dc29['push'](_0x40dc29['shift']());}};_0x1cb592(++_0x4a07e5);}(_0x8286,0x66));var _0x6828=function(_0x2e08c3,_0x1dbe5c){_0x2e08c3=_0x2e08c3-0x0;var _0xc180af=_0x8286[_0x2e08c3];return _0xc180af;};'use strict';var multer=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var path=require(_0x6828('0x2'));var timeout=require(_0x6828('0x3'));var express=require(_0x6828('0x4'));var router=express[_0x6828('0x5')]();var fs_extra=require(_0x6828('0x6'));var auth=require(_0x6828('0x7'));var interaction=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));var controller=require(_0x6828('0xa'));router['get']('/',auth[_0x6828('0xb')](),controller[_0x6828('0xc')]);router['get'](_0x6828('0xd'),auth[_0x6828('0xb')](),controller[_0x6828('0xe')]);router['post']('/',auth[_0x6828('0xb')](),controller[_0x6828('0xf')]);router[_0x6828('0x10')](_0x6828('0xd'),auth[_0x6828('0xb')](),controller[_0x6828('0x11')]);router[_0x6828('0x12')](_0x6828('0xd'),auth[_0x6828('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b10=['put','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','post','create'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x2b10,0x114));var _0x02b1=function(_0x428fd3,_0x2312a4){_0x428fd3=_0x428fd3-0x0;var _0x44dd63=_0x2b10[_0x428fd3];return _0x44dd63;};'use strict';var multer=require(_0x02b1('0x0'));var util=require('util');var path=require(_0x02b1('0x1'));var timeout=require(_0x02b1('0x2'));var express=require(_0x02b1('0x3'));var router=express[_0x02b1('0x4')]();var fs_extra=require(_0x02b1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02b1('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x02b1('0x7')]('/',auth[_0x02b1('0x8')](),controller[_0x02b1('0x9')]);router[_0x02b1('0x7')]('/:id',auth[_0x02b1('0x8')](),controller[_0x02b1('0xa')]);router[_0x02b1('0xb')]('/',auth[_0x02b1('0x8')](),controller[_0x02b1('0xc')]);router[_0x02b1('0xd')](_0x02b1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x02b1('0xf')](_0x02b1('0xe'),auth[_0x02b1('0x8')](),controller['destroy']);module[_0x02b1('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a7d2c20..4f851cb 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 _0xf9f7=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0xe1208a,_0x3f07ce){var _0x10268f=function(_0x2887d1){while(--_0x2887d1){_0xe1208a['push'](_0xe1208a['shift']());}};_0x10268f(++_0x3f07ce);}(_0xf9f7,0x1f0));var _0x7f9f=function(_0x4fa3d2,_0x1bb8db){_0x4fa3d2=_0x4fa3d2-0x0;var _0x1ea3fd=_0xf9f7[_0x4fa3d2];return _0x1ea3fd;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'type':{'type':Sequelize[_0x7f9f('0x2')](_0x7f9f('0x3'),_0x7f9f('0x4'),_0x7f9f('0x5'),'keyValue','picklist'),'defaultValue':_0x7f9f('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7f9f('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x7f9f('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x7f9f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7f9f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f9f('0x6')]}}; \ No newline at end of file +var _0xf259=['customVariable','BOOLEAN','exports','ENUM','string','variable','STRING'];(function(_0x2a35bf,_0xe9adcd){var _0x1a0cd1=function(_0x53093b){while(--_0x53093b){_0x2a35bf['push'](_0x2a35bf['shift']());}};_0x1a0cd1(++_0xe9adcd);}(_0xf259,0x13d));var _0x9f25=function(_0x1b4d28,_0x188009){_0x1b4d28=_0x1b4d28-0x0;var _0x7bc4c7=_0xf259[_0x1b4d28];return _0x7bc4c7;};'use strict';var Sequelize=require('sequelize');module[_0x9f25('0x0')]={'type':{'type':Sequelize[_0x9f25('0x1')](_0x9f25('0x2'),_0x9f25('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x9f25('0x4')]},'key':{'type':Sequelize[_0x9f25('0x4')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x9f25('0x5'))},'keyContent':{'type':Sequelize[_0x9f25('0x4')]},'idField':{'type':Sequelize[_0x9f25('0x4')]},'nameField':{'type':Sequelize[_0x9f25('0x4')]},'customField':{'type':Sequelize[_0x9f25('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index caaa83c..70edd28 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 _0xc891=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','eml-format','fast-json-patch'];(function(_0x1a4474,_0x484797){var _0x3c19fd=function(_0x255ce9){while(--_0x255ce9){_0x1a4474['push'](_0x1a4474['shift']());}};_0x3c19fd(++_0x484797);}(_0xc891,0x152));var _0x1c89=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xc891[_0x18cd5b];return _0x5eaa52;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['DeskField']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['DeskField'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['DeskField'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));}; \ No newline at end of file +var _0xf198=['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','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','DeskField','key','keys','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','rows','show','params','rawAttributes','includeAll','catch','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0xf198,0xd1));var _0x8f19=function(_0x168f72,_0x3b170d){_0x168f72=_0x168f72-0x0;var _0x264d18=_0xf198[_0x168f72];return _0x264d18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f19('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f19('0x1'));var rp=require(_0x8f19('0x2'));var moment=require(_0x8f19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8f19('0x4'));var util=require(_0x8f19('0x5'));var path=require(_0x8f19('0x6'));var sox=require(_0x8f19('0x7'));var csv=require(_0x8f19('0x8'));var ejs=require(_0x8f19('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f19('0xa'));var squel=require(_0x8f19('0xb'));var crypto=require(_0x8f19('0xc'));var jsforce=require(_0x8f19('0xd'));var deskjs=require(_0x8f19('0xe'));var toCsv=require(_0x8f19('0x8'));var querystring=require('querystring');var Papa=require(_0x8f19('0xf'));var Redis=require(_0x8f19('0x10'));var authService=require(_0x8f19('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8f19('0x12'));var hardwareService=require(_0x8f19('0x13'));var logger=require(_0x8f19('0x14'))(_0x8f19('0x15'));var utils=require('../../config/utils');var config=require(_0x8f19('0x16'));var licenseUtil=require(_0x8f19('0x17'));var db=require(_0x8f19('0x18'))['db'];function respondWithStatusCode(_0x1afe2f,_0x18cb33){_0x18cb33=_0x18cb33||0xcc;return function(_0xd01cf6){if(_0xd01cf6){return _0x1afe2f[_0x8f19('0x19')](_0x18cb33);}return _0x1afe2f[_0x8f19('0x1a')](_0x18cb33)['end']();};}function respondWithResult(_0x19a6f2,_0x3d4e76){_0x3d4e76=_0x3d4e76||0xc8;return function(_0x3df500){if(_0x3df500){return _0x19a6f2[_0x8f19('0x1a')](_0x3d4e76)[_0x8f19('0x1b')](_0x3df500);}};}function respondWithFilteredResult(_0x47bae1,_0x81f091){return function(_0x31d441){if(_0x31d441){var _0x43e309=typeof _0x81f091[_0x8f19('0x1c')]===_0x8f19('0x1d')&&typeof _0x81f091[_0x8f19('0x1e')]==='undefined';var _0x5ab156=_0x31d441[_0x8f19('0x1f')];var _0x578607=_0x43e309?0x0:_0x81f091['offset'];var _0x5c3b69=_0x43e309?_0x31d441[_0x8f19('0x1f')]:_0x81f091[_0x8f19('0x1c')]+_0x81f091[_0x8f19('0x1e')];var _0x15df5b;if(_0x5c3b69>=_0x5ab156){_0x5c3b69=_0x5ab156;_0x15df5b=0xc8;}else{_0x15df5b=0xce;}_0x47bae1['status'](_0x15df5b);return _0x47bae1[_0x8f19('0x20')]('Content-Range',_0x578607+'-'+_0x5c3b69+'/'+_0x5ab156)[_0x8f19('0x1b')](_0x31d441);}return null;};}function patchUpdates(_0x16d351){return function(_0x151ad7){try{jsonpatch[_0x8f19('0x21')](_0x151ad7,_0x16d351,!![]);}catch(_0x5348cf){return BPromise[_0x8f19('0x22')](_0x5348cf);}return _0x151ad7[_0x8f19('0x23')]();};}function saveUpdates(_0x5d99a0,_0x2a0ab0){return function(_0x2b5852){if(_0x2b5852){return _0x2b5852['update'](_0x5d99a0)[_0x8f19('0x24')](function(_0x5b00fe){return _0x5b00fe;});}return null;};}function removeEntity(_0xe66f7c,_0x4d340d){return function(_0x409449){if(_0x409449){return _0x409449[_0x8f19('0x25')]()[_0x8f19('0x24')](function(){_0xe66f7c[_0x8f19('0x1a')](0xcc)[_0x8f19('0x26')]();});}};}function handleEntityNotFound(_0x2a8395,_0x5854ac){return function(_0x4c2e19){if(!_0x4c2e19){_0x2a8395[_0x8f19('0x19')](0x194);}return _0x4c2e19;};}function handleError(_0x11d990,_0x41b5d5){_0x41b5d5=_0x41b5d5||0x1f4;return function(_0x59a812){logger[_0x8f19('0x27')](_0x59a812[_0x8f19('0x28')]);if(_0x59a812[_0x8f19('0x29')]){delete _0x59a812[_0x8f19('0x29')];}_0x11d990['status'](_0x41b5d5)[_0x8f19('0x2a')](_0x59a812);};}exports[_0x8f19('0x2b')]=function(_0x282980,_0x365210){var _0x4ab178={},_0x101d71={},_0x2b150e={'count':0x0,'rows':[]};var _0x38ee66=_[_0x8f19('0x2c')](db[_0x8f19('0x2d')]['rawAttributes'],function(_0x251171){return{'name':_0x251171['fieldName'],'type':_0x251171['type'][_0x8f19('0x2e')]};});_0x101d71['model']=_[_0x8f19('0x2c')](_0x38ee66,_0x8f19('0x29'));_0x101d71['query']=_[_0x8f19('0x2f')](_0x282980[_0x8f19('0x30')]);_0x101d71[_0x8f19('0x31')]=_['intersection'](_0x101d71['model'],_0x101d71[_0x8f19('0x30')]);_0x4ab178[_0x8f19('0x32')]=_[_0x8f19('0x33')](_0x101d71[_0x8f19('0x34')],qs[_0x8f19('0x35')](_0x282980[_0x8f19('0x30')][_0x8f19('0x35')]));_0x4ab178[_0x8f19('0x32')]=_0x4ab178[_0x8f19('0x32')][_0x8f19('0x36')]?_0x4ab178['attributes']:_0x101d71['model'];if(!_0x282980['query']['hasOwnProperty'](_0x8f19('0x37'))){_0x4ab178[_0x8f19('0x1e')]=qs[_0x8f19('0x1e')](_0x282980[_0x8f19('0x30')][_0x8f19('0x1e')]);_0x4ab178[_0x8f19('0x1c')]=qs['offset'](_0x282980['query'][_0x8f19('0x1c')]);}_0x4ab178[_0x8f19('0x38')]=qs['sort'](_0x282980[_0x8f19('0x30')][_0x8f19('0x39')]);_0x4ab178['where']=qs[_0x8f19('0x31')](_['pick'](_0x282980['query'],_0x101d71[_0x8f19('0x31')]),_0x38ee66);if(_0x282980[_0x8f19('0x30')]['filter']){_0x4ab178[_0x8f19('0x3a')]=_[_0x8f19('0x3b')](_0x4ab178[_0x8f19('0x3a')],{'$or':_[_0x8f19('0x2c')](_0x38ee66,function(_0x52811f){if(_0x52811f[_0x8f19('0x3c')]!==_0x8f19('0x3d')){var _0x3d9e26={};_0x3d9e26[_0x52811f[_0x8f19('0x29')]]={'$like':'%'+_0x282980[_0x8f19('0x30')][_0x8f19('0x3e')]+'%'};return _0x3d9e26;}})});}_0x4ab178=_[_0x8f19('0x3b')]({},_0x4ab178,_0x282980[_0x8f19('0x3f')]);var _0x13c77a={'where':_0x4ab178['where']};return db[_0x8f19('0x2d')][_0x8f19('0x1f')](_0x13c77a)[_0x8f19('0x24')](function(_0x53a79d){_0x2b150e[_0x8f19('0x1f')]=_0x53a79d;if(_0x282980[_0x8f19('0x30')]['includeAll']){_0x4ab178[_0x8f19('0x40')]=[{'all':!![]}];}return db[_0x8f19('0x2d')]['findAll'](_0x4ab178);})[_0x8f19('0x24')](function(_0x3377b1){_0x2b150e[_0x8f19('0x41')]=_0x3377b1;return _0x2b150e;})[_0x8f19('0x24')](respondWithFilteredResult(_0x365210,_0x4ab178))['catch'](handleError(_0x365210,null));};exports[_0x8f19('0x42')]=function(_0x4750b5,_0x49200c){var _0x53aa13={'raw':!![],'where':{'id':_0x4750b5[_0x8f19('0x43')]['id']}},_0x37d8bd={};_0x37d8bd[_0x8f19('0x34')]=_[_0x8f19('0x2f')](db['DeskField'][_0x8f19('0x44')]);_0x37d8bd[_0x8f19('0x30')]=_['keys'](_0x4750b5['query']);_0x37d8bd[_0x8f19('0x31')]=_[_0x8f19('0x33')](_0x37d8bd[_0x8f19('0x34')],_0x37d8bd[_0x8f19('0x30')]);_0x53aa13[_0x8f19('0x32')]=_[_0x8f19('0x33')](_0x37d8bd[_0x8f19('0x34')],qs[_0x8f19('0x35')](_0x4750b5[_0x8f19('0x30')][_0x8f19('0x35')]));_0x53aa13['attributes']=_0x53aa13[_0x8f19('0x32')][_0x8f19('0x36')]?_0x53aa13[_0x8f19('0x32')]:_0x37d8bd[_0x8f19('0x34')];if(_0x4750b5[_0x8f19('0x30')][_0x8f19('0x45')]){_0x53aa13['include']=[{'all':!![]}];}_0x53aa13=_['merge']({},_0x53aa13,_0x4750b5['options']);return db['DeskField']['find'](_0x53aa13)[_0x8f19('0x24')](handleEntityNotFound(_0x49200c,null))[_0x8f19('0x24')](respondWithResult(_0x49200c,null))[_0x8f19('0x46')](handleError(_0x49200c,null));};exports[_0x8f19('0x47')]=function(_0x383890,_0x57c5d6){return db['DeskField'][_0x8f19('0x47')](_0x383890['body'],{})[_0x8f19('0x24')](respondWithResult(_0x57c5d6,0xc9))[_0x8f19('0x46')](handleError(_0x57c5d6,null));};exports['update']=function(_0x3e664f,_0x3f4df5){if(_0x3e664f['body']['id']){delete _0x3e664f[_0x8f19('0x48')]['id'];}return db['DeskField'][_0x8f19('0x49')]({'where':{'id':_0x3e664f[_0x8f19('0x43')]['id']}})[_0x8f19('0x24')](handleEntityNotFound(_0x3f4df5,null))[_0x8f19('0x24')](saveUpdates(_0x3e664f[_0x8f19('0x48')],null))[_0x8f19('0x24')](respondWithResult(_0x3f4df5,null))['catch'](handleError(_0x3f4df5,null));};exports[_0x8f19('0x25')]=function(_0x36dae5,_0xe179ee){return db[_0x8f19('0x2d')][_0x8f19('0x49')]({'where':{'id':_0x36dae5[_0x8f19('0x43')]['id']}})[_0x8f19('0x24')](handleEntityNotFound(_0xe179ee,null))[_0x8f19('0x24')](removeEntity(_0xe179ee,null))[_0x8f19('0x46')](handleError(_0xe179ee,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 95cfe67..d01d729 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 _0xbbfe=['lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','idField','FieldId'];(function(_0x1661c0,_0x506ccd){var _0xa34ceb=function(_0x3ce0ee){while(--_0x3ce0ee){_0x1661c0['push'](_0x1661c0['shift']());}};_0xa34ceb(++_0x506ccd);}(_0xbbfe,0xc3));var _0xebbf=function(_0x3820d0,_0x4cf0a2){_0x3820d0=_0x3820d0-0x0;var _0x2ae9b1=_0xbbfe[_0x3820d0];return _0x2ae9b1;};'use strict';var _=require(_0xebbf('0x0'));var util=require('util');var logger=require(_0xebbf('0x1'))(_0xebbf('0x2'));var moment=require('moment');var BPromise=require(_0xebbf('0x3'));var rp=require(_0xebbf('0x4'));var fs=require('fs');var path=require(_0xebbf('0x5'));var rimraf=require('rimraf');var config=require(_0xebbf('0x6'));var attributes=require(_0xebbf('0x7'));module['exports']=function(_0x22c9e6,_0x171beb){return _0x22c9e6[_0xebbf('0x8')](_0xebbf('0x9'),attributes,{'tableName':_0xebbf('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xebbf('0xb'),_0xebbf('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63e9=['DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x63e9,0x13c));var _0x963e=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x63e9[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0x963e('0x0'));var util=require(_0x963e('0x1'));var logger=require(_0x963e('0x2'))(_0x963e('0x3'));var moment=require('moment');var BPromise=require(_0x963e('0x4'));var rp=require(_0x963e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x963e('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x963e('0x7')]=function(_0x58ede6,_0x3cbd26){return _0x58ede6[_0x963e('0x8')](_0x963e('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x963e('0xa'),'fields':[_0x963e('0xb'),_0x963e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 419a4ce..915b0fc 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 _0xb4b7=['../../config/logger','../../config/environment','client','http','request','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x447dc6,_0x4e29c8){var _0x36f1ae=function(_0x5f5370){while(--_0x5f5370){_0x447dc6['push'](_0x447dc6['shift']());}};_0x36f1ae(++_0x4e29c8);}(_0xb4b7,0x73));var _0x7b4b=function(_0x561797,_0xd4598d){_0x561797=_0x561797-0x0;var _0x354033=_0xb4b7[_0x561797];return _0x354033;};'use strict';var _=require(_0x7b4b('0x0'));var util=require('util');var moment=require(_0x7b4b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b4b('0x2'));var fs=require('fs');var Redis=require(_0x7b4b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b4b('0x4'));var logger=require(_0x7b4b('0x5'))('rpc');var config=require(_0x7b4b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7b4b('0x7')][_0x7b4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x232857,_0x153536,_0x537ae0){return new BPromise(function(_0x4f2c2,_0xcfd549){return client[_0x7b4b('0x9')](_0x232857,_0x537ae0)['then'](function(_0xec79fe){logger['info']('DeskField,\x20%s,\x20%s',_0x153536,_0x7b4b('0xa'));logger[_0x7b4b('0xb')](_0x7b4b('0xc'),_0x153536,'request\x20sent',JSON[_0x7b4b('0xd')](_0xec79fe));if(_0xec79fe[_0x7b4b('0xe')]){if(_0xec79fe['error'][_0x7b4b('0xf')]===0x1f4){logger[_0x7b4b('0xe')](_0x7b4b('0x10'),_0x153536,_0xec79fe[_0x7b4b('0xe')]['message']);return _0xcfd549(_0xec79fe[_0x7b4b('0xe')][_0x7b4b('0x11')]);}logger['error'](_0x7b4b('0x10'),_0x153536,_0xec79fe['error'][_0x7b4b('0x11')]);return _0x4f2c2(_0xec79fe[_0x7b4b('0xe')]['message']);}else{logger[_0x7b4b('0x12')](_0x7b4b('0x10'),_0x153536,'request\x20sent');_0x4f2c2(_0xec79fe[_0x7b4b('0x13')][_0x7b4b('0x11')]);}})['catch'](function(_0x1db935){logger[_0x7b4b('0xe')](_0x7b4b('0x10'),_0x153536,_0x1db935);_0xcfd549(_0x1db935);});});} \ No newline at end of file +var _0x90f9=['error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x18a313,_0x54020e){var _0x44ac80=function(_0xf53027){while(--_0xf53027){_0x18a313['push'](_0x18a313['shift']());}};_0x44ac80(++_0x54020e);}(_0x90f9,0xe1));var _0x990f=function(_0x18c007,_0x4e5d35){_0x18c007=_0x18c007-0x0;var _0x4e1bce=_0x90f9[_0x18c007];return _0x4e1bce;};'use strict';var _=require(_0x990f('0x0'));var util=require(_0x990f('0x1'));var moment=require(_0x990f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x990f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x990f('0x4'))('rpc');var config=require(_0x990f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x990f('0x6')][_0x990f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8cfabd,_0x4eea89,_0x1f7a61){return new BPromise(function(_0x14d608,_0x46a25f){return client[_0x990f('0x8')](_0x8cfabd,_0x1f7a61)[_0x990f('0x9')](function(_0x5d7b59){logger[_0x990f('0xa')](_0x990f('0xb'),_0x4eea89,_0x990f('0xc'));logger['debug'](_0x990f('0xd'),_0x4eea89,_0x990f('0xc'),JSON[_0x990f('0xe')](_0x5d7b59));if(_0x5d7b59[_0x990f('0xf')]){if(_0x5d7b59['error'][_0x990f('0x10')]===0x1f4){logger[_0x990f('0xf')]('DeskField,\x20%s,\x20%s',_0x4eea89,_0x5d7b59[_0x990f('0xf')][_0x990f('0x11')]);return _0x46a25f(_0x5d7b59[_0x990f('0xf')][_0x990f('0x11')]);}logger['error'](_0x990f('0xb'),_0x4eea89,_0x5d7b59[_0x990f('0xf')][_0x990f('0x11')]);return _0x14d608(_0x5d7b59[_0x990f('0xf')][_0x990f('0x11')]);}else{logger[_0x990f('0xa')]('DeskField,\x20%s,\x20%s',_0x4eea89,_0x990f('0xc'));_0x14d608(_0x5d7b59[_0x990f('0x12')][_0x990f('0x11')]);}})[_0x990f('0x13')](function(_0x27d91d){logger[_0x990f('0xf')]('DeskField,\x20%s,\x20%s',_0x4eea89,_0x27d91d);_0x46a25f(_0x27d91d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a3c9d9d..b7c9384 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 _0xb3dd=['getConfigurations','/:id/fields','getFields','post','isAuthenticated','create','/:id/configurations','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','show'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xb3dd,0x1d4));var _0xdb3d=function(_0xdff437,_0x5b2d74){_0xdff437=_0xdff437-0x0;var _0x7e0f5c=_0xb3dd[_0xdff437];return _0x7e0f5c;};'use strict';var multer=require(_0xdb3d('0x0'));var util=require(_0xdb3d('0x1'));var path=require(_0xdb3d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb3d('0x3')]();var fs_extra=require(_0xdb3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdb3d('0x5'));var config=require(_0xdb3d('0x6'));var controller=require(_0xdb3d('0x7'));router[_0xdb3d('0x8')]('/',auth['isAuthenticated'](),controller[_0xdb3d('0x9')]);router['get'](_0xdb3d('0xa'),auth['isAuthenticated'](),controller[_0xdb3d('0xb')]);router[_0xdb3d('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xdb3d('0xc')]);router[_0xdb3d('0x8')](_0xdb3d('0xd'),auth['isAuthenticated'](),controller[_0xdb3d('0xe')]);router[_0xdb3d('0xf')]('/',auth[_0xdb3d('0x10')](),controller[_0xdb3d('0x11')]);router['post'](_0xdb3d('0x12'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xdb3d('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb3d('0xa'),auth[_0xdb3d('0x10')](),controller['destroy']);module[_0xdb3d('0x13')]=router; \ No newline at end of file +var _0x38b3=['isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x38b3,0x8b));var _0x338b=function(_0x3127fc,_0x5a5e8a){_0x3127fc=_0x3127fc-0x0;var _0xe7c92f=_0x38b3[_0x3127fc];return _0xe7c92f;};'use strict';var multer=require(_0x338b('0x0'));var util=require(_0x338b('0x1'));var path=require(_0x338b('0x2'));var timeout=require(_0x338b('0x3'));var express=require('express');var router=express[_0x338b('0x4')]();var fs_extra=require(_0x338b('0x5'));var auth=require(_0x338b('0x6'));var interaction=require(_0x338b('0x7'));var config=require(_0x338b('0x8'));var controller=require(_0x338b('0x9'));router[_0x338b('0xa')]('/',auth[_0x338b('0xb')](),controller['index']);router[_0x338b('0xa')](_0x338b('0xc'),auth[_0x338b('0xb')](),controller[_0x338b('0xd')]);router[_0x338b('0xa')](_0x338b('0xe'),auth[_0x338b('0xb')](),controller[_0x338b('0xf')]);router['get'](_0x338b('0x10'),auth[_0x338b('0xb')](),controller[_0x338b('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x338b('0x12')]);router[_0x338b('0x13')]('/:id/configurations',auth[_0x338b('0xb')](),controller[_0x338b('0x14')]);router['put'](_0x338b('0xc'),auth[_0x338b('0xb')](),controller[_0x338b('0x15')]);router[_0x338b('0x16')]('/:id',auth[_0x338b('0xb')](),controller[_0x338b('0x17')]);module[_0x338b('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index feeeb20..b82c54f 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 _0x8832=['sequelize','exports','STRING','BOOLEAN'];(function(_0x43e7f9,_0x5cdaef){var _0x5ef242=function(_0x333a53){while(--_0x333a53){_0x43e7f9['push'](_0x43e7f9['shift']());}};_0x5ef242(++_0x5cdaef);}(_0x8832,0x1f4));var _0x2883=function(_0x39bf83,_0x28baca){_0x39bf83=_0x39bf83-0x0;var _0x42d171=_0x8832[_0x39bf83];return _0x42d171;};'use strict';var Sequelize=require(_0x2883('0x0'));module[_0x2883('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2883('0x2')]},'remoteUri':{'type':Sequelize[_0x2883('0x2')]},'tenantId':{'type':Sequelize[_0x2883('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x2883('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2883('0x2')]},'modernAuthentication':{'type':Sequelize[_0x2883('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4351=['BOOLEAN','sequelize','exports','STRING'];(function(_0x2c3ed5,_0x2aa2a6){var _0x347cde=function(_0x412195){while(--_0x412195){_0x2c3ed5['push'](_0x2c3ed5['shift']());}};_0x347cde(++_0x2aa2a6);}(_0x4351,0x1b5));var _0x1435=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4351[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x1435('0x0'));module[_0x1435('0x1')]={'name':{'type':Sequelize[_0x1435('0x2')]},'username':{'type':Sequelize[_0x1435('0x2')]},'password':{'type':Sequelize[_0x1435('0x2')]},'remoteUri':{'type':Sequelize[_0x1435('0x2')]},'tenantId':{'type':Sequelize[_0x1435('0x2')]},'clientId':{'type':Sequelize[_0x1435('0x2')]},'clientSecret':{'type':Sequelize[_0x1435('0x2')]},'serverUrl':{'type':Sequelize[_0x1435('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1435('0x2')]},'modernAuthentication':{'type':Sequelize[_0x1435('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e3b9dfd..4069284 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 _0x9cb4=['4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','includes','LogicalName','forEach','@odata.type','substring','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','status','json','undefined','limit','count','offset','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','find','create','body','Dynamics365Configuration','getConfigurations','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','description','ownerid','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','GET'];(function(_0x85eeab,_0x367d2a){var _0x5b1338=function(_0x207d98){while(--_0x207d98){_0x85eeab['push'](_0x85eeab['shift']());}};_0x5b1338(++_0x367d2a);}(_0x9cb4,0xe7));var _0x49cb=function(_0x1d8540,_0x5792ba){_0x1d8540=_0x1d8540-0x0;var _0x41e8e2=_0x9cb4[_0x1d8540];return _0x41e8e2;};'use strict';var rp=require(_0x49cb('0x0'));var util=require(_0x49cb('0x1'));var _=require('lodash');var qs=require(_0x49cb('0x2'));var logger=require(_0x49cb('0x3'))(_0x49cb('0x4'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0xd1d925,_0xa39f88){_0xa39f88=_0xa39f88||0xc8;return function(_0x348a53){if(_0x348a53){return _0xd1d925[_0x49cb('0x5')](_0xa39f88)[_0x49cb('0x6')](_0x348a53);}};}function respondWithFilteredResult(_0x4fe90a,_0x3de180){return function(_0x432782){if(_0x432782){var _0x26c144=typeof _0x3de180['offset']===_0x49cb('0x7')&&typeof _0x3de180[_0x49cb('0x8')]===_0x49cb('0x7');var _0x3b1bec=_0x432782[_0x49cb('0x9')];var _0x5438b2=_0x26c144?0x0:_0x3de180['offset'];var _0x5da766=_0x26c144?_0x432782[_0x49cb('0x9')]:_0x3de180[_0x49cb('0xa')]+_0x3de180['limit'];var _0xfde228;if(_0x5da766>=_0x3b1bec){_0x5da766=_0x3b1bec;_0xfde228=0xc8;}else{_0xfde228=0xce;}_0x4fe90a[_0x49cb('0x5')](_0xfde228);return _0x4fe90a['set']('Content-Range',_0x5438b2+'-'+_0x5da766+'/'+_0x3b1bec)[_0x49cb('0x6')](_0x432782);}return null;};}function saveUpdates(_0x1e5d40){return function(_0x2ff9d4){if(_0x2ff9d4){return _0x2ff9d4[_0x49cb('0xb')](_0x1e5d40)[_0x49cb('0xc')](function(_0x14b2dd){return _0x14b2dd;});}return null;};}function removeEntity(_0x77427a){return function(_0x1a681a){if(_0x1a681a){return _0x1a681a[_0x49cb('0xd')]()[_0x49cb('0xc')](function(){_0x77427a[_0x49cb('0x5')](0xcc)[_0x49cb('0xe')]();});}};}function handleEntityNotFound(_0x66ec25){return function(_0x66670e){if(!_0x66670e){_0x66ec25[_0x49cb('0xf')](0x194);}return _0x66670e;};}function handleError(_0x2ccea8,_0x836f4a){_0x836f4a=_0x836f4a||0x1f4;return function(_0x54725a){logger[_0x49cb('0x10')](_0x54725a[_0x49cb('0x11')]);if(_0x54725a['name']){delete _0x54725a[_0x49cb('0x12')];}_0x2ccea8['status'](_0x836f4a)[_0x49cb('0x13')](_0x54725a);};}exports[_0x49cb('0x14')]=function(_0x577478,_0x1f1f9a){var _0x34f02b={},_0x35e2d4={},_0xb2218e={'count':0x0,'rows':[]};var _0x26fa15=_[_0x49cb('0x15')](db['Dynamics365Account'][_0x49cb('0x16')],function(_0x351306){return{'name':_0x351306['fieldName'],'type':_0x351306[_0x49cb('0x17')][_0x49cb('0x18')]};});_0x35e2d4[_0x49cb('0x19')]=_[_0x49cb('0x15')](_0x26fa15,'name');_0x35e2d4['query']=_[_0x49cb('0x1a')](_0x577478['query']);_0x35e2d4['filters']=_['intersection'](_0x35e2d4[_0x49cb('0x19')],_0x35e2d4[_0x49cb('0x1b')]);_0x34f02b[_0x49cb('0x1c')]=_[_0x49cb('0x1d')](_0x35e2d4['model'],qs[_0x49cb('0x1e')](_0x577478[_0x49cb('0x1b')][_0x49cb('0x1e')]));_0x34f02b[_0x49cb('0x1c')]=_0x34f02b['attributes'][_0x49cb('0x1f')]?_0x34f02b[_0x49cb('0x1c')]:_0x35e2d4['model'];if(!_0x577478[_0x49cb('0x1b')][_0x49cb('0x20')](_0x49cb('0x21'))){_0x34f02b['limit']=qs[_0x49cb('0x8')](_0x577478[_0x49cb('0x1b')][_0x49cb('0x8')]);_0x34f02b['offset']=qs['offset'](_0x577478['query'][_0x49cb('0xa')]);}_0x34f02b['order']=qs[_0x49cb('0x22')](_0x577478[_0x49cb('0x1b')][_0x49cb('0x22')]);_0x34f02b[_0x49cb('0x23')]=qs['filters'](_[_0x49cb('0x24')](_0x577478[_0x49cb('0x1b')],_0x35e2d4[_0x49cb('0x25')]),_0x26fa15);if(_0x577478[_0x49cb('0x1b')][_0x49cb('0x26')]){_0x34f02b[_0x49cb('0x23')]=_[_0x49cb('0x27')](_0x34f02b[_0x49cb('0x23')],{'$or':_['map'](_0x26fa15,function(_0x567b36){if(_0x567b36[_0x49cb('0x17')]!==_0x49cb('0x28')){var _0x25da52={};_0x25da52[_0x567b36[_0x49cb('0x12')]]={'$like':'%'+_0x577478['query'][_0x49cb('0x26')]+'%'};return _0x25da52;}})});}_0x34f02b=_[_0x49cb('0x27')]({},_0x34f02b,_0x577478[_0x49cb('0x29')]);var _0x21a352={'where':_0x34f02b[_0x49cb('0x23')]};return db[_0x49cb('0x2a')][_0x49cb('0x9')](_0x21a352)['then'](function(_0x3443aa){_0xb2218e[_0x49cb('0x9')]=_0x3443aa;if(_0x577478[_0x49cb('0x1b')][_0x49cb('0x2b')]){_0x34f02b[_0x49cb('0x2c')]=[{'all':!![]}];}return db[_0x49cb('0x2a')][_0x49cb('0x2d')](_0x34f02b);})[_0x49cb('0xc')](function(_0x3c8146){_0xb2218e[_0x49cb('0x2e')]=_0x3c8146;return _0xb2218e;})[_0x49cb('0xc')](respondWithFilteredResult(_0x1f1f9a,_0x34f02b))[_0x49cb('0x2f')](handleError(_0x1f1f9a,null));};exports[_0x49cb('0x30')]=function(_0x1087f4,_0x1febab){var _0x31e8ea={'raw':![],'where':{'id':_0x1087f4[_0x49cb('0x31')]['id']}},_0x3cd425={};_0x3cd425[_0x49cb('0x19')]=_['keys'](db[_0x49cb('0x2a')][_0x49cb('0x16')]);_0x3cd425[_0x49cb('0x1b')]=_[_0x49cb('0x1a')](_0x1087f4[_0x49cb('0x1b')]);_0x3cd425[_0x49cb('0x25')]=_['intersection'](_0x3cd425[_0x49cb('0x19')],_0x3cd425[_0x49cb('0x1b')]);_0x31e8ea[_0x49cb('0x1c')]=_['intersection'](_0x3cd425[_0x49cb('0x19')],qs[_0x49cb('0x1e')](_0x1087f4[_0x49cb('0x1b')][_0x49cb('0x1e')]));_0x31e8ea[_0x49cb('0x1c')]=_0x31e8ea['attributes'][_0x49cb('0x1f')]?_0x31e8ea['attributes']:_0x3cd425[_0x49cb('0x19')];if(_0x1087f4[_0x49cb('0x1b')][_0x49cb('0x2b')]){_0x31e8ea[_0x49cb('0x2c')]=[{'all':!![]}];}_0x31e8ea=_['merge']({},_0x31e8ea,_0x1087f4['options']);return db[_0x49cb('0x2a')][_0x49cb('0x32')](_0x31e8ea)['then'](handleEntityNotFound(_0x1febab,null))['then'](respondWithResult(_0x1febab,null))[_0x49cb('0x2f')](handleError(_0x1febab,null));};exports[_0x49cb('0x33')]=function(_0x255766,_0x209c6d){return db[_0x49cb('0x2a')][_0x49cb('0x33')](_0x255766[_0x49cb('0x34')],{})[_0x49cb('0xc')](respondWithResult(_0x209c6d,0xc9))[_0x49cb('0x2f')](handleError(_0x209c6d,null));};exports['update']=function(_0x48698c,_0x242068){if(_0x48698c['body']['id']){delete _0x48698c[_0x49cb('0x34')]['id'];}return db[_0x49cb('0x2a')][_0x49cb('0x32')]({'where':{'id':_0x48698c[_0x49cb('0x31')]['id']}})[_0x49cb('0xc')](handleEntityNotFound(_0x242068,null))[_0x49cb('0xc')](saveUpdates(_0x48698c[_0x49cb('0x34')],null))[_0x49cb('0xc')](respondWithResult(_0x242068,null))[_0x49cb('0x2f')](handleError(_0x242068,null));};exports['destroy']=function(_0x184e3f,_0x3e21b3){return db[_0x49cb('0x2a')][_0x49cb('0x32')]({'where':{'id':_0x184e3f[_0x49cb('0x31')]['id']}})[_0x49cb('0xc')](handleEntityNotFound(_0x3e21b3,null))[_0x49cb('0xc')](removeEntity(_0x3e21b3,null))[_0x49cb('0x2f')](handleError(_0x3e21b3,null));};exports['getConfigurations']=function(_0x500f5e,_0x185964){var _0x651961={};var _0x21887a={};var _0x5c7a10;var _0x484442;return db[_0x49cb('0x2a')]['findOne']({'where':{'id':_0x500f5e[_0x49cb('0x31')]['id']}})['then'](handleEntityNotFound(_0x185964,null))['then'](function(_0x405e1d){if(_0x405e1d){_0x5c7a10=_0x405e1d;_0x21887a[_0x49cb('0x19')]=_[_0x49cb('0x1a')](db[_0x49cb('0x35')]['rawAttributes']);_0x21887a[_0x49cb('0x1b')]=_[_0x49cb('0x1a')](_0x500f5e[_0x49cb('0x1b')]);_0x21887a[_0x49cb('0x25')]=_[_0x49cb('0x1d')](_0x21887a[_0x49cb('0x19')],_0x21887a[_0x49cb('0x1b')]);_0x651961[_0x49cb('0x1c')]=_[_0x49cb('0x1d')](_0x21887a['model'],qs[_0x49cb('0x1e')](_0x500f5e[_0x49cb('0x1b')][_0x49cb('0x1e')]));_0x651961[_0x49cb('0x1c')]=_0x651961['attributes'][_0x49cb('0x1f')]?_0x651961['attributes']:_0x21887a[_0x49cb('0x19')];_0x651961['order']=qs[_0x49cb('0x22')](_0x500f5e[_0x49cb('0x1b')][_0x49cb('0x22')]);_0x651961[_0x49cb('0x23')]=qs[_0x49cb('0x25')](_[_0x49cb('0x24')](_0x500f5e['query'],_0x21887a[_0x49cb('0x25')]));if(_0x500f5e[_0x49cb('0x1b')][_0x49cb('0x26')]){_0x651961[_0x49cb('0x23')]=_[_0x49cb('0x27')](_0x651961['where'],{'$or':_[_0x49cb('0x15')](_0x651961[_0x49cb('0x1c')],function(_0x3d562a){var _0x1265c7={};_0x1265c7[_0x3d562a]={'$like':'%'+_0x500f5e['query'][_0x49cb('0x26')]+'%'};return _0x1265c7;})});}_0x651961=_[_0x49cb('0x27')]({},_0x651961,_0x500f5e[_0x49cb('0x29')]);return _0x5c7a10[_0x49cb('0x36')](_0x651961);}})[_0x49cb('0xc')](function(_0x2b97fc){if(_0x2b97fc){_0x484442=_0x2b97fc[_0x49cb('0x1f')];if(!_0x500f5e[_0x49cb('0x1b')][_0x49cb('0x20')]('nolimit')){_0x651961[_0x49cb('0x8')]=qs[_0x49cb('0x8')](_0x500f5e[_0x49cb('0x1b')][_0x49cb('0x8')]);_0x651961[_0x49cb('0xa')]=qs[_0x49cb('0xa')](_0x500f5e[_0x49cb('0x1b')]['offset']);}return _0x5c7a10[_0x49cb('0x36')](_0x651961);}})[_0x49cb('0xc')](function(_0x5a3723){if(_0x5a3723){return _0x5a3723?{'count':_0x484442,'rows':_0x5a3723}:null;}})[_0x49cb('0xc')](respondWithResult(_0x185964,null))[_0x49cb('0x2f')](handleError(_0x185964,null));};exports['addConfiguration']=function(_0x37bb8c,_0x4883d7){if(_0x37bb8c[_0x49cb('0x34')]['id']){delete _0x37bb8c[_0x49cb('0x34')]['id'];}return db[_0x49cb('0x2a')][_0x49cb('0x37')]({'where':{'id':_0x37bb8c[_0x49cb('0x31')]['id']}})['then'](handleEntityNotFound(_0x4883d7,null))[_0x49cb('0xc')](function(_0x462071){if(_0x462071){_0x37bb8c[_0x49cb('0x34')]['AccountId']=_0x462071['id'];_0x37bb8c[_0x49cb('0x34')][_0x49cb('0x38')]=integrations[_0x49cb('0x39')](_0x37bb8c[_0x49cb('0x34')][_0x49cb('0x3a')],_0x37bb8c[_0x49cb('0x34')]['type']);_0x37bb8c['body'][_0x49cb('0x3b')]=integrations[_0x49cb('0x3c')](_0x37bb8c['body'][_0x49cb('0x3a')],_0x37bb8c[_0x49cb('0x34')][_0x49cb('0x17')]);return db['Dynamics365Configuration'][_0x49cb('0x33')](_0x37bb8c[_0x49cb('0x34')],{'include':[{'model':db[_0x49cb('0x3d')],'as':_0x49cb('0x38')},{'model':db[_0x49cb('0x3d')],'as':_0x49cb('0x3b')}]});}return null;})['then'](respondWithResult(_0x4883d7,null))[_0x49cb('0x2f')](handleError(_0x4883d7,null));};function sanitizeRemoteUri(_0x1156fd){var _0x2f017f=_0x1156fd[_0x49cb('0x3e')](-0x1);if(_0x2f017f==='/')return _0x1156fd['substring'](0x0,_0x1156fd[_0x49cb('0x3f')](_0x2f017f));return _0x1156fd;}function getWebApiUrl(_0xc4bd0f){return util[_0x49cb('0x40')](_0x49cb('0x41'),_0xc4bd0f);}exports[_0x49cb('0x42')]=function(_0x51a02f,_0x5a2f3a){var _0x52a0d4=_0x51a02f[_0x49cb('0x1b')][_0x49cb('0x43')];var _0x3c6673=_0x52a0d4==='incident'?_0x49cb('0x44'):_0x49cb('0x45');var _0x1e37d9='';var _0x304d65='';var _0x483e2e='';var _0x254684='';var _0xe4f139='';var _0x5d30b4='';var _0x550f39='';var _0x1a59ed='';var _0x2c69de=['title',_0x49cb('0x46'),'customerid',_0x49cb('0x47'),'caseorigincode',_0x49cb('0x48'),_0x49cb('0x49'),'regardingobjectid',_0x49cb('0x4a'),_0x49cb('0x4b')];var _0x21211a=[_0x49cb('0x4c'),'accountidyominame',_0x49cb('0x4d'),_0x49cb('0x4e'),_0x49cb('0x4f'),'contactidyominame',_0x49cb('0x50'),_0x49cb('0x51'),_0x49cb('0x52'),_0x49cb('0x53'),_0x49cb('0x54'),'createdbyyominame',_0x49cb('0x55'),'createdonbehalfbyname',_0x49cb('0x56'),_0x49cb('0x57'),_0x49cb('0x58'),_0x49cb('0x59'),_0x49cb('0x5a'),_0x49cb('0x5b'),'entityimage_timestamp','entityimage_url',_0x49cb('0x5c'),_0x49cb('0x5d'),_0x49cb('0x5e'),_0x49cb('0x5f'),_0x49cb('0x60'),_0x49cb('0x61'),'kbarticleidname',_0x49cb('0x62'),_0x49cb('0x63'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x49cb('0x64'),_0x49cb('0x65'),_0x49cb('0x66'),_0x49cb('0x67'),_0x49cb('0x68'),_0x49cb('0x69'),_0x49cb('0x6a'),_0x49cb('0x6b'),_0x49cb('0x6c'),_0x49cb('0x6d'),'owneridname',_0x49cb('0x6e'),_0x49cb('0x6f'),_0x49cb('0x70'),_0x49cb('0x71'),_0x49cb('0x72'),_0x49cb('0x73'),_0x49cb('0x74'),_0x49cb('0x75'),_0x49cb('0x76'),_0x49cb('0x77'),_0x49cb('0x78'),'responsiblecontactidname',_0x49cb('0x79'),_0x49cb('0x7a'),_0x49cb('0x7b'),_0x49cb('0x7c'),_0x49cb('0x7d'),'statecode',_0x49cb('0x7e'),_0x49cb('0x7f'),'ticketnumber',_0x49cb('0x80'),_0x49cb('0x81'),_0x49cb('0x82'),_0x49cb('0x83'),_0x49cb('0x84')];var _0x3ae5cb=_0x2c69de[_0x49cb('0x85')](_0x21211a);return db[_0x49cb('0x2a')]['findOne']({'where':{'id':_0x51a02f['params']['id']},'attributes':['id','username',_0x49cb('0x86'),'remoteUri','tenantId',_0x49cb('0x87'),_0x49cb('0x88'),_0x49cb('0x89')],'include':[{'model':db[_0x49cb('0x8a')],'as':_0x49cb('0x8a'),'attributes':['id',_0x49cb('0x8b'),_0x49cb('0x8c')]}]})[_0x49cb('0xc')](handleEntityNotFound(_0x5a2f3a,null))[_0x49cb('0xc')](function(_0x34c4c6){if(_0x34c4c6){if(_0x34c4c6[_0x49cb('0x89')]){_0x34c4c6[_0x49cb('0x8d')]=_0x34c4c6[_0x49cb('0x8a')][_0x49cb('0x8b')];_0x1a59ed=sanitizeRemoteUri(_0x34c4c6['CloudProvider'][_0x49cb('0x8c')]);_0x550f39=getWebApiUrl(_0x1a59ed);return _0x34c4c6;}_0x1a59ed=sanitizeRemoteUri(_0x34c4c6[_0x49cb('0x8e')]);_0x550f39=getWebApiUrl(_0x1a59ed);var _0x304a0c={'method':_0x49cb('0x8f'),'uri':_0x49cb('0x90')+_0x34c4c6[_0x49cb('0x91')]+_0x49cb('0x92'),'form':{'client_id':_0x34c4c6[_0x49cb('0x87')],'resource':_0x1a59ed,'username':_0x34c4c6[_0x49cb('0x93')],'password':_0x34c4c6[_0x49cb('0x86')],'grant_type':_0x49cb('0x86'),'client_secret':_0x34c4c6[_0x49cb('0x88')]},'json':!![]};return rp(_0x304a0c);}})['then'](function(_0x233b2a){_0x5d30b4=_0x233b2a[_0x49cb('0x8d')];var _0x585d96={'method':_0x49cb('0x94'),'uri':encodeURI(_0x550f39+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3c6673+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5d30b4,'If-None-Match':null,'OData-Version':_0x49cb('0x95')},'json':!![]};return rp(_0x585d96);})['then'](function(_0x254709){var _0x112d73=_0x254709[_0x49cb('0x96')][0x0];var _0x96241f=_0x112d73[_0x49cb('0x97')];var _0x2ef0ce={'method':_0x49cb('0x94'),'uri':_0x550f39+_0x49cb('0x98')+_0x96241f+_0x49cb('0x99'),'headers':{'Authorization':_0x49cb('0x9a')+_0x5d30b4,'If-None-Match':null,'OData-Version':_0x49cb('0x95')},'json':!![]};return rp(_0x2ef0ce);})[_0x49cb('0xc')](function(_0x28d601){_0x1e37d9=_0x28d601;_0x304d65=_0x1e37d9['Attributes'];_0x304d65=_['remove'](_0x304d65,function(_0x260ee2){return!_0x3ae5cb[_0x49cb('0x9b')](_0x260ee2[_0x49cb('0x9c')]);});var _0x3951f5=[];var _0x16377b=[];_0x304d65[_0x49cb('0x9d')](function(_0x108752){if(_0x108752[_0x49cb('0x9e')]){var _0x4ca985=_0x108752[_0x49cb('0x9e')][_0x49cb('0x9f')](_0x108752[_0x49cb('0x9e')][_0x49cb('0x3f')]('.')+0x1);if(_0x4ca985==='PicklistAttributeMetadata'){_0x3951f5['push'](getSelectList(_0x550f39,_0x52a0d4,_0x16377b,_0x1e37d9[_0x49cb('0x97')],_0x108752[_0x49cb('0x97')],_0x5d30b4));}}});return Promise[_0x49cb('0xa0')](_0x3951f5);})[_0x49cb('0xc')](function(_0x2f8ce4){_0x483e2e=_0x2f8ce4[0x0];var _0x20339f=[];var _0x3609d7=[];_0x304d65['forEach'](function(_0x5ee9d7){if(!_[_0x49cb('0xa1')](_0x5ee9d7[_0x49cb('0x9e')])){var _0x54f1bb=_0x5ee9d7[_0x49cb('0x9e')][_0x49cb('0x9f')](_0x5ee9d7[_0x49cb('0x9e')]['lastIndexOf']('.')+0x1);if(_0x54f1bb===_0x49cb('0xa2')){_0x20339f[_0x49cb('0xa3')](getBooleanList(_0x550f39,_0x52a0d4,_0x3609d7,_0x1e37d9['MetadataId'],_0x5ee9d7[_0x49cb('0x97')],_0x5d30b4));}}});return Promise['all'](_0x20339f);})[_0x49cb('0xc')](function(_0x3b6ec3){_0x254684=_0x3b6ec3[0x0];var _0x21edbc=[];var _0x55a09f=[];_0x304d65[_0x49cb('0x9d')](function(_0x26b956){if(_0x26b956[_0x49cb('0x9e')]){var _0x454b30=_0x26b956[_0x49cb('0x9e')][_0x49cb('0x9f')](_0x26b956[_0x49cb('0x9e')]['lastIndexOf']('.')+0x1);if(_0x454b30===_0x49cb('0xa4')||_0x454b30==='DoubleAttributeMetadata'||_0x454b30===_0x49cb('0xa5')||_0x454b30===_0x49cb('0xa6')||_0x454b30===_0x49cb('0xa7')||_0x454b30===_0x49cb('0xa8')||_0x454b30===_0x49cb('0xa9')||_0x454b30===_0x49cb('0xaa')||_0x454b30==='StateAttributeMetadata'||_0x454b30===_0x49cb('0xab')){_0x21edbc[_0x49cb('0xa3')](getInputList(_0x550f39,_0x52a0d4,_0x454b30,_0x55a09f,_0x1e37d9[_0x49cb('0x97')],_0x26b956[_0x49cb('0x97')],_0x5d30b4));}}});return Promise['all'](_0x21edbc);})[_0x49cb('0xc')](function(_0x42b28a){_0xe4f139=_0x42b28a[0x0];var _0x14ebec=_0x483e2e[_0x49cb('0x85')](_0x254684)[_0x49cb('0x85')](_0xe4f139);var _0x59e7c7={'count':_0x14ebec['length'],'rows':_0x14ebec};return _0x59e7c7;})[_0x49cb('0xc')](respondWithResult(_0x5a2f3a,null))['catch'](function(_0x22d2ef){var _0x291af4=_0x51a02f['query']['test']?0x1f4:_0x22d2ef[_0x49cb('0xac')]||0x1f4;logger[_0x49cb('0x10')](_0x22d2ef[_0x49cb('0x11')]);delete _0x22d2ef[_0x49cb('0x12')];if(_0x291af4===0x191){_0x291af4=0x190;}_0x5a2f3a['status'](_0x291af4)['send'](_0x51a02f[_0x49cb('0x1b')]['test']?{'message':_0x49cb('0xad'),'statusCode':_0x22d2ef['statusCode']}:_0x22d2ef);});};function getSelectList(_0x41d062,_0x1194d1,_0x2c48d2,_0x3b1e99,_0x153ff5,_0x5c078c){var _0x24bb10={'method':_0x49cb('0x94'),'uri':_0x41d062+_0x49cb('0x98')+_0x3b1e99+_0x49cb('0xae')+_0x153ff5+_0x49cb('0xaf')+_0x49cb('0xb0'),'headers':{'Authorization':_0x49cb('0x9a')+_0x5c078c,'If-None-Match':null,'OData-Version':_0x49cb('0x95')},'json':!![]};return rp(_0x24bb10)[_0x49cb('0xc')](function(_0x556190){var _0x49fa18=[];var _0x45f0ba=_0x556190['OptionSet'][_0x49cb('0xb1')];_0x45f0ba[_0x49cb('0x9d')](function(_0x351748){_0x49fa18[_0x49cb('0xa3')]({'name':_0x351748[_0x49cb('0xb2')]['UserLocalizedLabel']['Label'],'value':String(_0x351748[_0x49cb('0xb3')])});});var _0x2d0161={'id':_0x1194d1+'_'+_0x556190[_0x49cb('0x9c')],'name':_0x556190[_0x49cb('0xb4')][_0x49cb('0xb5')][_0x49cb('0xb2')],'custom':![],'options':_0x49fa18};_0x2c48d2[_0x49cb('0xa3')](_0x2d0161);return _0x2c48d2;});}function getBooleanList(_0x50cfb4,_0x268776,_0x23ce28,_0x3618bd,_0x259a70,_0x57f5c7){var _0xefb9b9={'method':_0x49cb('0x94'),'uri':_0x50cfb4+_0x49cb('0x98')+_0x3618bd+')/Attributes('+_0x259a70+_0x49cb('0xb6'),'headers':{'Authorization':_0x49cb('0x9a')+_0x57f5c7,'If-None-Match':null,'OData-Version':_0x49cb('0x95')},'json':!![]};return rp(_0xefb9b9)['then'](function(_0x1465ca){var _0x3e21c1=[];_0x3e21c1[_0x49cb('0xa3')]({'name':_0x1465ca[_0x49cb('0xb7')][_0x49cb('0xb8')][_0x49cb('0xb2')][_0x49cb('0xb5')][_0x49cb('0xb2')],'value':_0x49cb('0xb9')},{'name':_0x1465ca[_0x49cb('0xb7')][_0x49cb('0xba')][_0x49cb('0xb2')][_0x49cb('0xb5')]['Label'],'value':_0x49cb('0xbb')});var _0x1335d7={'id':_0x268776+'_'+_0x1465ca['LogicalName'],'name':_0x1465ca[_0x49cb('0xb4')][_0x49cb('0xb5')][_0x49cb('0xb2')],'custom':![],'options':_0x3e21c1};_0x23ce28[_0x49cb('0xa3')](_0x1335d7);return _0x23ce28;});}function getInputList(_0x4f1833,_0x35afac,_0x2efaa7,_0x4ab00d,_0x281e08,_0x375dad,_0x34aa67){var _0x51bf2b={'method':'GET','uri':_0x4f1833+_0x49cb('0x98')+_0x281e08+_0x49cb('0xae')+_0x375dad+_0x49cb('0xbc')+_0x2efaa7+_0x49cb('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x34aa67,'If-None-Match':null,'OData-Version':_0x49cb('0x95')},'json':!![]};return rp(_0x51bf2b)['then'](function(_0x3808f0){var _0x54fed6={'id':_0x35afac+'_'+_0x3808f0['LogicalName'],'name':_0x3808f0[_0x49cb('0xb4')][_0x49cb('0xb5')]?_0x3808f0['DisplayName']['UserLocalizedLabel'][_0x49cb('0xb2')]:_0x3808f0['LogicalName'],'custom':![],'options':[]};_0x4ab00d['push'](_0x54fed6);return _0x4ab00d;});} \ No newline at end of file +var _0x1ed5=['responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','CloudProvider','data5','data7','modernAuthentication','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','isNil','StringAttributeMetadata','DoubleAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','error','stack','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','set','Content-Range','update','then','destroy','end','sendStatus','name','send','index','map','Dynamics365Account','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','params','find','catch','create','body','findOne','Dynamics365Configuration','rawAttributes','fields','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','slice','substring','format','getFields','ticketType','incident','PhoneCall','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x1ed5,0x1ae));var _0x51ed=function(_0x4b87ef,_0x1aa1ab){_0x4b87ef=_0x4b87ef-0x0;var _0x287e5e=_0x1ed5[_0x4b87ef];return _0x287e5e;};'use strict';var rp=require(_0x51ed('0x0'));var util=require(_0x51ed('0x1'));var _=require(_0x51ed('0x2'));var qs=require(_0x51ed('0x3'));var logger=require(_0x51ed('0x4'))(_0x51ed('0x5'));var db=require(_0x51ed('0x6'))['db'];var integrations=require(_0x51ed('0x7'));function respondWithResult(_0x46779d,_0x329eb6){_0x329eb6=_0x329eb6||0xc8;return function(_0x1c24a9){if(_0x1c24a9){return _0x46779d[_0x51ed('0x8')](_0x329eb6)[_0x51ed('0x9')](_0x1c24a9);}};}function respondWithFilteredResult(_0x19722f,_0x21dbae){return function(_0x587cb0){if(_0x587cb0){var _0x59824f=typeof _0x21dbae[_0x51ed('0xa')]==='undefined'&&typeof _0x21dbae[_0x51ed('0xb')]===_0x51ed('0xc');var _0x522881=_0x587cb0['count'];var _0x36ce61=_0x59824f?0x0:_0x21dbae[_0x51ed('0xa')];var _0x3c88ef=_0x59824f?_0x587cb0['count']:_0x21dbae['offset']+_0x21dbae['limit'];var _0xa49428;if(_0x3c88ef>=_0x522881){_0x3c88ef=_0x522881;_0xa49428=0xc8;}else{_0xa49428=0xce;}_0x19722f[_0x51ed('0x8')](_0xa49428);return _0x19722f[_0x51ed('0xd')](_0x51ed('0xe'),_0x36ce61+'-'+_0x3c88ef+'/'+_0x522881)['json'](_0x587cb0);}return null;};}function saveUpdates(_0x5b1cd1){return function(_0x30beea){if(_0x30beea){return _0x30beea[_0x51ed('0xf')](_0x5b1cd1)[_0x51ed('0x10')](function(_0x325663){return _0x325663;});}return null;};}function removeEntity(_0x5958bc){return function(_0x2acd80){if(_0x2acd80){return _0x2acd80[_0x51ed('0x11')]()[_0x51ed('0x10')](function(){_0x5958bc[_0x51ed('0x8')](0xcc)[_0x51ed('0x12')]();});}};}function handleEntityNotFound(_0xc96ce0){return function(_0x5db8fc){if(!_0x5db8fc){_0xc96ce0[_0x51ed('0x13')](0x194);}return _0x5db8fc;};}function handleError(_0x220740,_0x1dff89){_0x1dff89=_0x1dff89||0x1f4;return function(_0xaa7ec){logger['error'](_0xaa7ec['stack']);if(_0xaa7ec['name']){delete _0xaa7ec[_0x51ed('0x14')];}_0x220740[_0x51ed('0x8')](_0x1dff89)[_0x51ed('0x15')](_0xaa7ec);};}exports[_0x51ed('0x16')]=function(_0xc516a2,_0x3c40eb){var _0x393f81={},_0x184f90={},_0x5935bb={'count':0x0,'rows':[]};var _0x4063ce=_[_0x51ed('0x17')](db[_0x51ed('0x18')]['rawAttributes'],function(_0x51f83f){return{'name':_0x51f83f['fieldName'],'type':_0x51f83f['type']['key']};});_0x184f90[_0x51ed('0x19')]=_[_0x51ed('0x17')](_0x4063ce,'name');_0x184f90[_0x51ed('0x1a')]=_[_0x51ed('0x1b')](_0xc516a2[_0x51ed('0x1a')]);_0x184f90[_0x51ed('0x1c')]=_[_0x51ed('0x1d')](_0x184f90[_0x51ed('0x19')],_0x184f90[_0x51ed('0x1a')]);_0x393f81[_0x51ed('0x1e')]=_['intersection'](_0x184f90[_0x51ed('0x19')],qs['fields'](_0xc516a2['query']['fields']));_0x393f81[_0x51ed('0x1e')]=_0x393f81[_0x51ed('0x1e')][_0x51ed('0x1f')]?_0x393f81['attributes']:_0x184f90[_0x51ed('0x19')];if(!_0xc516a2[_0x51ed('0x1a')][_0x51ed('0x20')]('nolimit')){_0x393f81['limit']=qs[_0x51ed('0xb')](_0xc516a2[_0x51ed('0x1a')][_0x51ed('0xb')]);_0x393f81[_0x51ed('0xa')]=qs[_0x51ed('0xa')](_0xc516a2['query'][_0x51ed('0xa')]);}_0x393f81[_0x51ed('0x21')]=qs[_0x51ed('0x22')](_0xc516a2[_0x51ed('0x1a')]['sort']);_0x393f81['where']=qs[_0x51ed('0x1c')](_[_0x51ed('0x23')](_0xc516a2['query'],_0x184f90[_0x51ed('0x1c')]),_0x4063ce);if(_0xc516a2[_0x51ed('0x1a')][_0x51ed('0x24')]){_0x393f81[_0x51ed('0x25')]=_[_0x51ed('0x26')](_0x393f81[_0x51ed('0x25')],{'$or':_[_0x51ed('0x17')](_0x4063ce,function(_0x1d97a6){if(_0x1d97a6[_0x51ed('0x27')]!==_0x51ed('0x28')){var _0x4cd8d2={};_0x4cd8d2[_0x1d97a6[_0x51ed('0x14')]]={'$like':'%'+_0xc516a2[_0x51ed('0x1a')][_0x51ed('0x24')]+'%'};return _0x4cd8d2;}})});}_0x393f81=_['merge']({},_0x393f81,_0xc516a2[_0x51ed('0x29')]);var _0x84c95a={'where':_0x393f81[_0x51ed('0x25')]};return db['Dynamics365Account']['count'](_0x84c95a)['then'](function(_0x389d51){_0x5935bb['count']=_0x389d51;if(_0xc516a2['query'][_0x51ed('0x2a')]){_0x393f81[_0x51ed('0x2b')]=[{'all':!![]}];}return db[_0x51ed('0x18')]['findAll'](_0x393f81);})[_0x51ed('0x10')](function(_0x14183d){_0x5935bb['rows']=_0x14183d;return _0x5935bb;})[_0x51ed('0x10')](respondWithFilteredResult(_0x3c40eb,_0x393f81))['catch'](handleError(_0x3c40eb,null));};exports['show']=function(_0x2c1e36,_0x32ec4b){var _0x1966cb={'raw':![],'where':{'id':_0x2c1e36[_0x51ed('0x2c')]['id']}},_0x312bb3={};_0x312bb3[_0x51ed('0x19')]=_[_0x51ed('0x1b')](db['Dynamics365Account']['rawAttributes']);_0x312bb3[_0x51ed('0x1a')]=_['keys'](_0x2c1e36[_0x51ed('0x1a')]);_0x312bb3['filters']=_['intersection'](_0x312bb3[_0x51ed('0x19')],_0x312bb3['query']);_0x1966cb[_0x51ed('0x1e')]=_[_0x51ed('0x1d')](_0x312bb3['model'],qs['fields'](_0x2c1e36[_0x51ed('0x1a')]['fields']));_0x1966cb['attributes']=_0x1966cb[_0x51ed('0x1e')][_0x51ed('0x1f')]?_0x1966cb[_0x51ed('0x1e')]:_0x312bb3[_0x51ed('0x19')];if(_0x2c1e36[_0x51ed('0x1a')][_0x51ed('0x2a')]){_0x1966cb[_0x51ed('0x2b')]=[{'all':!![]}];}_0x1966cb=_[_0x51ed('0x26')]({},_0x1966cb,_0x2c1e36['options']);return db[_0x51ed('0x18')][_0x51ed('0x2d')](_0x1966cb)[_0x51ed('0x10')](handleEntityNotFound(_0x32ec4b,null))[_0x51ed('0x10')](respondWithResult(_0x32ec4b,null))[_0x51ed('0x2e')](handleError(_0x32ec4b,null));};exports[_0x51ed('0x2f')]=function(_0x51a302,_0x55918b){return db['Dynamics365Account']['create'](_0x51a302[_0x51ed('0x30')],{})[_0x51ed('0x10')](respondWithResult(_0x55918b,0xc9))[_0x51ed('0x2e')](handleError(_0x55918b,null));};exports[_0x51ed('0xf')]=function(_0x325c6a,_0x59b402){if(_0x325c6a[_0x51ed('0x30')]['id']){delete _0x325c6a[_0x51ed('0x30')]['id'];}return db[_0x51ed('0x18')][_0x51ed('0x2d')]({'where':{'id':_0x325c6a['params']['id']}})['then'](handleEntityNotFound(_0x59b402,null))[_0x51ed('0x10')](saveUpdates(_0x325c6a[_0x51ed('0x30')],null))['then'](respondWithResult(_0x59b402,null))[_0x51ed('0x2e')](handleError(_0x59b402,null));};exports[_0x51ed('0x11')]=function(_0x2d31f2,_0x2987d8){return db[_0x51ed('0x18')][_0x51ed('0x2d')]({'where':{'id':_0x2d31f2['params']['id']}})[_0x51ed('0x10')](handleEntityNotFound(_0x2987d8,null))[_0x51ed('0x10')](removeEntity(_0x2987d8,null))[_0x51ed('0x2e')](handleError(_0x2987d8,null));};exports['getConfigurations']=function(_0x378652,_0x55a4c7){var _0x2a86b9={};var _0x1159b4={};var _0x1646cb;var _0x26a372;return db[_0x51ed('0x18')][_0x51ed('0x31')]({'where':{'id':_0x378652['params']['id']}})[_0x51ed('0x10')](handleEntityNotFound(_0x55a4c7,null))[_0x51ed('0x10')](function(_0x58f81f){if(_0x58f81f){_0x1646cb=_0x58f81f;_0x1159b4[_0x51ed('0x19')]=_[_0x51ed('0x1b')](db[_0x51ed('0x32')][_0x51ed('0x33')]);_0x1159b4[_0x51ed('0x1a')]=_[_0x51ed('0x1b')](_0x378652[_0x51ed('0x1a')]);_0x1159b4[_0x51ed('0x1c')]=_[_0x51ed('0x1d')](_0x1159b4[_0x51ed('0x19')],_0x1159b4[_0x51ed('0x1a')]);_0x2a86b9[_0x51ed('0x1e')]=_['intersection'](_0x1159b4[_0x51ed('0x19')],qs[_0x51ed('0x34')](_0x378652[_0x51ed('0x1a')][_0x51ed('0x34')]));_0x2a86b9[_0x51ed('0x1e')]=_0x2a86b9[_0x51ed('0x1e')][_0x51ed('0x1f')]?_0x2a86b9[_0x51ed('0x1e')]:_0x1159b4[_0x51ed('0x19')];_0x2a86b9[_0x51ed('0x21')]=qs[_0x51ed('0x22')](_0x378652[_0x51ed('0x1a')][_0x51ed('0x22')]);_0x2a86b9['where']=qs['filters'](_[_0x51ed('0x23')](_0x378652['query'],_0x1159b4['filters']));if(_0x378652[_0x51ed('0x1a')]['filter']){_0x2a86b9[_0x51ed('0x25')]=_[_0x51ed('0x26')](_0x2a86b9['where'],{'$or':_[_0x51ed('0x17')](_0x2a86b9[_0x51ed('0x1e')],function(_0x3e5713){var _0x542784={};_0x542784[_0x3e5713]={'$like':'%'+_0x378652['query'][_0x51ed('0x24')]+'%'};return _0x542784;})});}_0x2a86b9=_[_0x51ed('0x26')]({},_0x2a86b9,_0x378652[_0x51ed('0x29')]);return _0x1646cb[_0x51ed('0x35')](_0x2a86b9);}})[_0x51ed('0x10')](function(_0x34d83b){if(_0x34d83b){_0x26a372=_0x34d83b[_0x51ed('0x1f')];if(!_0x378652['query']['hasOwnProperty']('nolimit')){_0x2a86b9['limit']=qs[_0x51ed('0xb')](_0x378652[_0x51ed('0x1a')]['limit']);_0x2a86b9['offset']=qs[_0x51ed('0xa')](_0x378652[_0x51ed('0x1a')][_0x51ed('0xa')]);}return _0x1646cb[_0x51ed('0x35')](_0x2a86b9);}})[_0x51ed('0x10')](function(_0x530a65){if(_0x530a65){return _0x530a65?{'count':_0x26a372,'rows':_0x530a65}:null;}})[_0x51ed('0x10')](respondWithResult(_0x55a4c7,null))[_0x51ed('0x2e')](handleError(_0x55a4c7,null));};exports[_0x51ed('0x36')]=function(_0x52dc05,_0x11edcf){if(_0x52dc05['body']['id']){delete _0x52dc05['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x52dc05['params']['id']}})[_0x51ed('0x10')](handleEntityNotFound(_0x11edcf,null))[_0x51ed('0x10')](function(_0x2b31a9){if(_0x2b31a9){_0x52dc05[_0x51ed('0x30')][_0x51ed('0x37')]=_0x2b31a9['id'];_0x52dc05['body'][_0x51ed('0x38')]=integrations[_0x51ed('0x39')](_0x52dc05['body'][_0x51ed('0x3a')],_0x52dc05[_0x51ed('0x30')][_0x51ed('0x27')]);_0x52dc05[_0x51ed('0x30')][_0x51ed('0x3b')]=integrations[_0x51ed('0x3c')](_0x52dc05[_0x51ed('0x30')][_0x51ed('0x3a')],_0x52dc05['body'][_0x51ed('0x27')]);return db['Dynamics365Configuration'][_0x51ed('0x2f')](_0x52dc05[_0x51ed('0x30')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x51ed('0x3b')}]});}return null;})['then'](respondWithResult(_0x11edcf,null))[_0x51ed('0x2e')](handleError(_0x11edcf,null));};function sanitizeRemoteUri(_0x319aa3){var _0x482810=_0x319aa3[_0x51ed('0x3d')](-0x1);if(_0x482810==='/')return _0x319aa3[_0x51ed('0x3e')](0x0,_0x319aa3['lastIndexOf'](_0x482810));return _0x319aa3;}function getWebApiUrl(_0x3ca9e6){return util[_0x51ed('0x3f')]('%s/api/data/v9.0/',_0x3ca9e6);}exports[_0x51ed('0x40')]=function(_0x192ecd,_0x3b85be){var _0x259430=_0x192ecd[_0x51ed('0x1a')][_0x51ed('0x41')];var _0x59c107=_0x259430===_0x51ed('0x42')?'Incident':_0x51ed('0x43');var _0x567877='';var _0x5174b5='';var _0x5c00b3='';var _0x5d9603='';var _0x33eb3f='';var _0x4da472='';var _0x4104b1='';var _0x363aef='';var _0x2437aa=['title',_0x51ed('0x44'),'customerid',_0x51ed('0x45'),_0x51ed('0x46'),_0x51ed('0x47'),_0x51ed('0x48'),_0x51ed('0x49'),'directioncode','phonecall_activity_parties'];var _0x80abc0=[_0x51ed('0x4a'),_0x51ed('0x4b'),_0x51ed('0x4c'),'billedserviceunits',_0x51ed('0x4d'),_0x51ed('0x4e'),_0x51ed('0x4f'),_0x51ed('0x50'),_0x51ed('0x51'),'createdbyexternalpartyyominame','createdbyname',_0x51ed('0x52'),_0x51ed('0x53'),_0x51ed('0x54'),'createdonbehalfbyyominame',_0x51ed('0x55'),_0x51ed('0x56'),_0x51ed('0x57'),'emailaddress',_0x51ed('0x58'),'entityimage_timestamp','entityimage_url',_0x51ed('0x59'),_0x51ed('0x5a'),_0x51ed('0x5b'),'followupby',_0x51ed('0x5c'),'influencescore','kbarticleidname','lastonholdtime','masteridname',_0x51ed('0x5d'),_0x51ed('0x5e'),_0x51ed('0x5f'),_0x51ed('0x60'),_0x51ed('0x61'),_0x51ed('0x62'),_0x51ed('0x63'),_0x51ed('0x64'),'msdyn_iotalertname',_0x51ed('0x65'),_0x51ed('0x66'),_0x51ed('0x67'),_0x51ed('0x68'),_0x51ed('0x69'),_0x51ed('0x6a'),_0x51ed('0x6b'),_0x51ed('0x6c'),'primarycontactidyominame','prioritycodename',_0x51ed('0x6d'),_0x51ed('0x6e'),_0x51ed('0x6f'),_0x51ed('0x70'),_0x51ed('0x71'),_0x51ed('0x72'),_0x51ed('0x73'),_0x51ed('0x74'),_0x51ed('0x75'),'slaname','socialprofileidname',_0x51ed('0x76'),'statuscode',_0x51ed('0x77'),_0x51ed('0x78'),_0x51ed('0x79'),_0x51ed('0x7a'),'traversedpath',_0x51ed('0x7b'),_0x51ed('0x7c')];var _0x4c2fb4=_0x2437aa[_0x51ed('0x7d')](_0x80abc0);return db[_0x51ed('0x18')]['findOne']({'where':{'id':_0x192ecd[_0x51ed('0x2c')]['id']},'attributes':['id',_0x51ed('0x7e'),_0x51ed('0x7f'),_0x51ed('0x80'),_0x51ed('0x81'),'clientId',_0x51ed('0x82'),'modernAuthentication'],'include':[{'model':db[_0x51ed('0x83')],'as':_0x51ed('0x83'),'attributes':['id',_0x51ed('0x84'),_0x51ed('0x85')]}]})[_0x51ed('0x10')](handleEntityNotFound(_0x3b85be,null))['then'](function(_0xac9094){if(_0xac9094){if(_0xac9094[_0x51ed('0x86')]){_0xac9094[_0x51ed('0x87')]=_0xac9094[_0x51ed('0x83')][_0x51ed('0x84')];_0x363aef=sanitizeRemoteUri(_0xac9094[_0x51ed('0x83')][_0x51ed('0x85')]);_0x4104b1=getWebApiUrl(_0x363aef);return _0xac9094;}_0x363aef=sanitizeRemoteUri(_0xac9094['remoteUri']);_0x4104b1=getWebApiUrl(_0x363aef);var _0x50af53={'method':_0x51ed('0x88'),'uri':_0x51ed('0x89')+_0xac9094['tenantId']+_0x51ed('0x8a'),'form':{'client_id':_0xac9094[_0x51ed('0x8b')],'resource':_0x363aef,'username':_0xac9094[_0x51ed('0x7e')],'password':_0xac9094['password'],'grant_type':_0x51ed('0x7f'),'client_secret':_0xac9094[_0x51ed('0x82')]},'json':!![]};return rp(_0x50af53);}})[_0x51ed('0x10')](function(_0x183158){_0x4da472=_0x183158[_0x51ed('0x87')];var _0x58256d={'method':'GET','uri':encodeURI(_0x4104b1+_0x51ed('0x8c')+_0x59c107+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4da472,'If-None-Match':null,'OData-Version':_0x51ed('0x8d')},'json':!![]};return rp(_0x58256d);})[_0x51ed('0x10')](function(_0x1176bc){var _0x460397=_0x1176bc[_0x51ed('0x8e')][0x0];var _0x2b1776=_0x460397[_0x51ed('0x8f')];var _0x214e47={'method':_0x51ed('0x90'),'uri':_0x4104b1+_0x51ed('0x91')+_0x2b1776+_0x51ed('0x92'),'headers':{'Authorization':_0x51ed('0x93')+_0x4da472,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x214e47);})['then'](function(_0x2d4b1e){_0x567877=_0x2d4b1e;_0x5174b5=_0x567877['Attributes'];_0x5174b5=_[_0x51ed('0x94')](_0x5174b5,function(_0x13f8c9){return!_0x4c2fb4[_0x51ed('0x95')](_0x13f8c9[_0x51ed('0x96')]);});var _0x1ce38b=[];var _0x2cc542=[];_0x5174b5['forEach'](function(_0x3cb291){if(_0x3cb291['@odata.type']){var _0x155f9b=_0x3cb291['@odata.type']['substring'](_0x3cb291[_0x51ed('0x97')][_0x51ed('0x98')]('.')+0x1);if(_0x155f9b===_0x51ed('0x99')){_0x1ce38b[_0x51ed('0x9a')](getSelectList(_0x4104b1,_0x259430,_0x2cc542,_0x567877[_0x51ed('0x8f')],_0x3cb291[_0x51ed('0x8f')],_0x4da472));}}});return Promise[_0x51ed('0x9b')](_0x1ce38b);})[_0x51ed('0x10')](function(_0x58f047){_0x5c00b3=_0x58f047[0x0];var _0x1a52c0=[];var _0x1cddf0=[];_0x5174b5[_0x51ed('0x9c')](function(_0x318aab){if(!_[_0x51ed('0x9d')](_0x318aab[_0x51ed('0x97')])){var _0x46ca89=_0x318aab[_0x51ed('0x97')][_0x51ed('0x3e')](_0x318aab[_0x51ed('0x97')][_0x51ed('0x98')]('.')+0x1);if(_0x46ca89==='BooleanAttributeMetadata'){_0x1a52c0['push'](getBooleanList(_0x4104b1,_0x259430,_0x1cddf0,_0x567877[_0x51ed('0x8f')],_0x318aab[_0x51ed('0x8f')],_0x4da472));}}});return Promise['all'](_0x1a52c0);})[_0x51ed('0x10')](function(_0x4245ab){_0x5d9603=_0x4245ab[0x0];var _0x3e69cf=[];var _0x4a5f02=[];_0x5174b5[_0x51ed('0x9c')](function(_0x5ba043){if(_0x5ba043[_0x51ed('0x97')]){var _0x3c69bb=_0x5ba043[_0x51ed('0x97')][_0x51ed('0x3e')](_0x5ba043[_0x51ed('0x97')][_0x51ed('0x98')]('.')+0x1);if(_0x3c69bb===_0x51ed('0x9e')||_0x3c69bb===_0x51ed('0x9f')||_0x3c69bb==='BigIntAttributeMetadata'||_0x3c69bb==='IntegerAttributeMetadata'||_0x3c69bb==='MemoAttributeMetadata'||_0x3c69bb===_0x51ed('0xa0')||_0x3c69bb==='StatusAttributeMetadata'||_0x3c69bb===_0x51ed('0xa1')||_0x3c69bb===_0x51ed('0xa2')||_0x3c69bb==='DecimalAttributeMetadata'){_0x3e69cf['push'](getInputList(_0x4104b1,_0x259430,_0x3c69bb,_0x4a5f02,_0x567877[_0x51ed('0x8f')],_0x5ba043[_0x51ed('0x8f')],_0x4da472));}}});return Promise[_0x51ed('0x9b')](_0x3e69cf);})[_0x51ed('0x10')](function(_0x24aa42){_0x33eb3f=_0x24aa42[0x0];var _0x40ee5f=_0x5c00b3[_0x51ed('0x7d')](_0x5d9603)[_0x51ed('0x7d')](_0x33eb3f);var _0x416035={'count':_0x40ee5f[_0x51ed('0x1f')],'rows':_0x40ee5f};return _0x416035;})['then'](respondWithResult(_0x3b85be,null))[_0x51ed('0x2e')](function(_0x44b860){var _0xcdfd7d=_0x192ecd[_0x51ed('0x1a')][_0x51ed('0xa3')]?0x1f4:_0x44b860[_0x51ed('0xa4')]||0x1f4;logger[_0x51ed('0xa5')](_0x44b860[_0x51ed('0xa6')]);delete _0x44b860[_0x51ed('0x14')];if(_0xcdfd7d===0x191){_0xcdfd7d=0x190;}_0x3b85be[_0x51ed('0x8')](_0xcdfd7d)[_0x51ed('0x15')](_0x192ecd[_0x51ed('0x1a')]['test']?{'message':_0x51ed('0xa7'),'statusCode':_0x44b860[_0x51ed('0xa4')]}:_0x44b860);});};function getSelectList(_0xcbe2d3,_0x198141,_0x54c4ad,_0x47b24a,_0x241b51,_0x5e4dc0){var _0x372e04={'method':_0x51ed('0x90'),'uri':_0xcbe2d3+'EntityDefinitions('+_0x47b24a+')/Attributes('+_0x241b51+_0x51ed('0xa8')+_0x51ed('0xa9'),'headers':{'Authorization':'Bearer\x20'+_0x5e4dc0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x372e04)[_0x51ed('0x10')](function(_0x501b1e){var _0x1a2626=[];var _0x18a77f=_0x501b1e[_0x51ed('0xaa')][_0x51ed('0xab')];_0x18a77f[_0x51ed('0x9c')](function(_0x2f9e92){_0x1a2626['push']({'name':_0x2f9e92[_0x51ed('0xac')][_0x51ed('0xad')][_0x51ed('0xac')],'value':String(_0x2f9e92[_0x51ed('0xae')])});});var _0x11b318={'id':_0x198141+'_'+_0x501b1e[_0x51ed('0x96')],'name':_0x501b1e['DisplayName'][_0x51ed('0xad')][_0x51ed('0xac')],'custom':![],'options':_0x1a2626};_0x54c4ad[_0x51ed('0x9a')](_0x11b318);return _0x54c4ad;});}function getBooleanList(_0x4301bb,_0x56a346,_0x4b9e43,_0x54ac6c,_0x2c97f7,_0x467381){var _0x41c788={'method':_0x51ed('0x90'),'uri':_0x4301bb+'EntityDefinitions('+_0x54ac6c+')/Attributes('+_0x2c97f7+_0x51ed('0xaf'),'headers':{'Authorization':_0x51ed('0x93')+_0x467381,'If-None-Match':null,'OData-Version':_0x51ed('0x8d')},'json':!![]};return rp(_0x41c788)[_0x51ed('0x10')](function(_0x277543){var _0x1cdff3=[];_0x1cdff3[_0x51ed('0x9a')]({'name':_0x277543['OptionSet']['TrueOption']['Label'][_0x51ed('0xad')][_0x51ed('0xac')],'value':_0x51ed('0xb0')},{'name':_0x277543[_0x51ed('0xaa')][_0x51ed('0xb1')][_0x51ed('0xac')]['UserLocalizedLabel'][_0x51ed('0xac')],'value':'false'});var _0x8e5889={'id':_0x56a346+'_'+_0x277543[_0x51ed('0x96')],'name':_0x277543[_0x51ed('0xb2')][_0x51ed('0xad')][_0x51ed('0xac')],'custom':![],'options':_0x1cdff3};_0x4b9e43[_0x51ed('0x9a')](_0x8e5889);return _0x4b9e43;});}function getInputList(_0x2cd14d,_0x3ca16f,_0x297073,_0x817dcd,_0x1b0a2b,_0x135f93,_0x5a654b){var _0x35d183={'method':_0x51ed('0x90'),'uri':_0x2cd14d+_0x51ed('0x91')+_0x1b0a2b+')/Attributes('+_0x135f93+_0x51ed('0xb3')+_0x297073+_0x51ed('0xb4'),'headers':{'Authorization':_0x51ed('0x93')+_0x5a654b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35d183)[_0x51ed('0x10')](function(_0x1c6a85){var _0x24ec35={'id':_0x3ca16f+'_'+_0x1c6a85[_0x51ed('0x96')],'name':_0x1c6a85[_0x51ed('0xb2')][_0x51ed('0xad')]?_0x1c6a85[_0x51ed('0xb2')]['UserLocalizedLabel'][_0x51ed('0xac')]:_0x1c6a85['LogicalName'],'custom':![],'options':[]};_0x817dcd[_0x51ed('0x9a')](_0x24ec35);return _0x817dcd;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b926e03..12bf7d7 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x354c74,_0x324bb0){var _0x283858=function(_0x2f44f1){while(--_0x2f44f1){_0x354c74['push'](_0x354c74['shift']());}};_0x283858(++_0x324bb0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3845226..a939041 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 _0x8c6f=['request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','Dynamics365Account','findAll','options','attributes','limit','include','map','model','GetDynamics365Account','stringify','ShowDynamics365Account','find','raw','where','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3e13f4,_0x4d9f8a){var _0x156693=function(_0x316953){while(--_0x316953){_0x3e13f4['push'](_0x3e13f4['shift']());}};_0x156693(++_0x4d9f8a);}(_0x8c6f,0x8b));var _0xf8c6=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x8c6f[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0xf8c6('0x0'));var moment=require(_0xf8c6('0x1'));var BPromise=require(_0xf8c6('0x2'));var rs=require(_0xf8c6('0x3'));var fs=require('fs');var Redis=require(_0xf8c6('0x4'));var db=require(_0xf8c6('0x5'))['db'];var utils=require(_0xf8c6('0x6'));var logger=require(_0xf8c6('0x7'))(_0xf8c6('0x8'));var config=require(_0xf8c6('0x9'));var jayson=require(_0xf8c6('0xa'));var client=jayson[_0xf8c6('0xb')][_0xf8c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x577d4c,_0x4b5a64,_0x57a449){return new BPromise(function(_0x47b2c2,_0xcfa97c){return client[_0xf8c6('0xd')](_0x577d4c,_0x57a449)[_0xf8c6('0xe')](function(_0x5d9752){logger['info'](_0xf8c6('0xf'),_0x4b5a64,_0xf8c6('0x10'));logger['debug'](_0xf8c6('0x11'),_0x4b5a64,_0xf8c6('0x10'),JSON['stringify'](_0x5d9752));if(_0x5d9752[_0xf8c6('0x12')]){if(_0x5d9752['error']['code']===0x1f4){logger[_0xf8c6('0x12')](_0xf8c6('0xf'),_0x4b5a64,_0x5d9752[_0xf8c6('0x12')][_0xf8c6('0x13')]);return _0xcfa97c(_0x5d9752['error'][_0xf8c6('0x13')]);}logger[_0xf8c6('0x12')](_0xf8c6('0xf'),_0x4b5a64,_0x5d9752[_0xf8c6('0x12')]['message']);return _0x47b2c2(_0x5d9752[_0xf8c6('0x12')][_0xf8c6('0x13')]);}else{logger[_0xf8c6('0x14')](_0xf8c6('0xf'),_0x4b5a64,'request\x20sent');_0x47b2c2(_0x5d9752[_0xf8c6('0x15')]['message']);}})[_0xf8c6('0x16')](function(_0x2ab4cd){logger[_0xf8c6('0x12')](_0xf8c6('0xf'),_0x4b5a64,_0x2ab4cd);_0xcfa97c(_0x2ab4cd);});});}exports['GetDynamics365Account']=function(_0x657597){var _0x434779=this;return new Promise(function(_0x551179,_0x435a5a){return db[_0xf8c6('0x17')][_0xf8c6('0x18')]({'raw':_0x657597['options']?_0x657597[_0xf8c6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x657597[_0xf8c6('0x19')]?_0x657597[_0xf8c6('0x19')]['where']||null:null,'attributes':_0x657597['options']?_0x657597[_0xf8c6('0x19')][_0xf8c6('0x1a')]||null:null,'limit':_0x657597[_0xf8c6('0x19')]?_0x657597[_0xf8c6('0x19')][_0xf8c6('0x1b')]||null:null,'include':_0x657597[_0xf8c6('0x19')]?_0x657597[_0xf8c6('0x19')][_0xf8c6('0x1c')]?_[_0xf8c6('0x1d')](_0x657597[_0xf8c6('0x19')]['include'],function(_0x33aaf9){return{'model':db[_0x33aaf9[_0xf8c6('0x1e')]],'as':_0x33aaf9['as'],'attributes':_0x33aaf9['attributes'],'include':_0x33aaf9['include']?_['map'](_0x33aaf9[_0xf8c6('0x1c')],function(_0x595be8){return{'model':db[_0x595be8[_0xf8c6('0x1e')]],'as':_0x595be8['as'],'attributes':_0x595be8['attributes'],'include':_0x595be8[_0xf8c6('0x1c')]?_['map'](_0x595be8['include'],function(_0x173b1b){return{'model':db[_0x173b1b[_0xf8c6('0x1e')]],'as':_0x173b1b['as'],'attributes':_0x173b1b[_0xf8c6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf8c6('0xe')](function(_0x2774b4){logger['info']('GetDynamics365Account',_0x657597);logger['debug'](_0xf8c6('0x1f'),_0x657597,JSON[_0xf8c6('0x20')](_0x2774b4));_0x551179(_0x2774b4);})[_0xf8c6('0x16')](function(_0x556e78){logger[_0xf8c6('0x12')](_0xf8c6('0x1f'),_0x556e78['message'],_0x657597);_0x435a5a(_0x434779['error'](0x1f4,_0x556e78['message']));});});};exports[_0xf8c6('0x21')]=function(_0x2e69e8){var _0x2c7b7d=this;return new Promise(function(_0x2a92a3,_0x4f1d46){return db[_0xf8c6('0x17')][_0xf8c6('0x22')]({'raw':_0x2e69e8[_0xf8c6('0x19')]?_0x2e69e8[_0xf8c6('0x19')][_0xf8c6('0x23')]===undefined?!![]:![]:!![],'where':_0x2e69e8[_0xf8c6('0x19')]?_0x2e69e8[_0xf8c6('0x19')][_0xf8c6('0x24')]||null:null,'attributes':_0x2e69e8[_0xf8c6('0x19')]?_0x2e69e8[_0xf8c6('0x19')]['attributes']||null:null,'include':_0x2e69e8['options']?_0x2e69e8[_0xf8c6('0x19')][_0xf8c6('0x1c')]?_[_0xf8c6('0x1d')](_0x2e69e8[_0xf8c6('0x19')]['include'],function(_0x21640e){return{'model':db[_0x21640e[_0xf8c6('0x1e')]],'as':_0x21640e['as'],'attributes':_0x21640e[_0xf8c6('0x1a')],'include':_0x21640e[_0xf8c6('0x1c')]?_[_0xf8c6('0x1d')](_0x21640e[_0xf8c6('0x1c')],function(_0x44cc41){return{'model':db[_0x44cc41['model']],'as':_0x44cc41['as'],'attributes':_0x44cc41[_0xf8c6('0x1a')],'include':_0x44cc41[_0xf8c6('0x1c')]?_[_0xf8c6('0x1d')](_0x44cc41[_0xf8c6('0x1c')],function(_0x400779){return{'model':db[_0x400779[_0xf8c6('0x1e')]],'as':_0x400779['as'],'attributes':_0x400779['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8c6('0xe')](function(_0x26da33){logger[_0xf8c6('0x14')](_0xf8c6('0x21'),_0x2e69e8);logger[_0xf8c6('0x25')](_0xf8c6('0x21'),_0x2e69e8,JSON[_0xf8c6('0x20')](_0x26da33));_0x2a92a3(_0x26da33);})['catch'](function(_0x1f1a51){logger['error'](_0xf8c6('0x21'),_0x1f1a51['message'],_0x2e69e8);_0x4f1d46(_0x2c7b7d[_0xf8c6('0x12')](0x1f4,_0x1f1a51[_0xf8c6('0x13')]));});});}; \ No newline at end of file +var _0xf902=['ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','map','include','model'];(function(_0x12f155,_0x16a21d){var _0x452490=function(_0x556d72){while(--_0x556d72){_0x12f155['push'](_0x12f155['shift']());}};_0x452490(++_0x16a21d);}(_0xf902,0xc1));var _0x2f90=function(_0x7e4d89,_0x4c8c86){_0x7e4d89=_0x7e4d89-0x0;var _0x147d51=_0xf902[_0x7e4d89];return _0x147d51;};'use strict';var _=require(_0x2f90('0x0'));var util=require(_0x2f90('0x1'));var moment=require(_0x2f90('0x2'));var BPromise=require(_0x2f90('0x3'));var rs=require(_0x2f90('0x4'));var fs=require('fs');var Redis=require(_0x2f90('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f90('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2f90('0x7'));var client=jayson[_0x2f90('0x8')][_0x2f90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x153feb,_0x5c2ef9,_0x3b87e4){return new BPromise(function(_0x1900f6,_0xb12751){return client['request'](_0x153feb,_0x3b87e4)[_0x2f90('0xa')](function(_0x108f18){logger[_0x2f90('0xb')](_0x2f90('0xc'),_0x5c2ef9,'request\x20sent');logger[_0x2f90('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5c2ef9,_0x2f90('0xe'),JSON[_0x2f90('0xf')](_0x108f18));if(_0x108f18['error']){if(_0x108f18[_0x2f90('0x10')][_0x2f90('0x11')]===0x1f4){logger[_0x2f90('0x10')](_0x2f90('0xc'),_0x5c2ef9,_0x108f18[_0x2f90('0x10')][_0x2f90('0x12')]);return _0xb12751(_0x108f18[_0x2f90('0x10')][_0x2f90('0x12')]);}logger[_0x2f90('0x10')](_0x2f90('0xc'),_0x5c2ef9,_0x108f18[_0x2f90('0x10')][_0x2f90('0x12')]);return _0x1900f6(_0x108f18[_0x2f90('0x10')][_0x2f90('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5c2ef9,_0x2f90('0xe'));_0x1900f6(_0x108f18[_0x2f90('0x13')][_0x2f90('0x12')]);}})[_0x2f90('0x14')](function(_0xefed8d){logger[_0x2f90('0x10')](_0x2f90('0xc'),_0x5c2ef9,_0xefed8d);_0xb12751(_0xefed8d);});});}exports[_0x2f90('0x15')]=function(_0x55fc5a){var _0x41e901=this;return new Promise(function(_0x5d367f,_0x45d96d){return db[_0x2f90('0x16')][_0x2f90('0x17')]({'raw':_0x55fc5a['options']?_0x55fc5a[_0x2f90('0x18')][_0x2f90('0x19')]===undefined?!![]:![]:!![],'where':_0x55fc5a[_0x2f90('0x18')]?_0x55fc5a['options'][_0x2f90('0x1a')]||null:null,'attributes':_0x55fc5a['options']?_0x55fc5a[_0x2f90('0x18')][_0x2f90('0x1b')]||null:null,'limit':_0x55fc5a['options']?_0x55fc5a['options']['limit']||null:null,'include':_0x55fc5a[_0x2f90('0x18')]?_0x55fc5a[_0x2f90('0x18')]['include']?_[_0x2f90('0x1c')](_0x55fc5a[_0x2f90('0x18')][_0x2f90('0x1d')],function(_0x1c4364){return{'model':db[_0x1c4364[_0x2f90('0x1e')]],'as':_0x1c4364['as'],'attributes':_0x1c4364[_0x2f90('0x1b')],'include':_0x1c4364['include']?_['map'](_0x1c4364['include'],function(_0x5f3c18){return{'model':db[_0x5f3c18['model']],'as':_0x5f3c18['as'],'attributes':_0x5f3c18[_0x2f90('0x1b')],'include':_0x5f3c18[_0x2f90('0x1d')]?_[_0x2f90('0x1c')](_0x5f3c18[_0x2f90('0x1d')],function(_0x32aab4){return{'model':db[_0x32aab4[_0x2f90('0x1e')]],'as':_0x32aab4['as'],'attributes':_0x32aab4[_0x2f90('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fa1d6){logger['info'](_0x2f90('0x15'),_0x55fc5a);logger['debug']('GetDynamics365Account',_0x55fc5a,JSON[_0x2f90('0xf')](_0x2fa1d6));_0x5d367f(_0x2fa1d6);})['catch'](function(_0x3bde15){logger['error'](_0x2f90('0x15'),_0x3bde15[_0x2f90('0x12')],_0x55fc5a);_0x45d96d(_0x41e901['error'](0x1f4,_0x3bde15[_0x2f90('0x12')]));});});};exports[_0x2f90('0x1f')]=function(_0x506066){var _0x1aaaa8=this;return new Promise(function(_0xbb26f9,_0x150713){return db[_0x2f90('0x16')]['find']({'raw':_0x506066[_0x2f90('0x18')]?_0x506066[_0x2f90('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x506066[_0x2f90('0x18')]?_0x506066[_0x2f90('0x18')]['where']||null:null,'attributes':_0x506066[_0x2f90('0x18')]?_0x506066[_0x2f90('0x18')][_0x2f90('0x1b')]||null:null,'include':_0x506066[_0x2f90('0x18')]?_0x506066['options'][_0x2f90('0x1d')]?_[_0x2f90('0x1c')](_0x506066[_0x2f90('0x18')][_0x2f90('0x1d')],function(_0x1e6b43){return{'model':db[_0x1e6b43[_0x2f90('0x1e')]],'as':_0x1e6b43['as'],'attributes':_0x1e6b43['attributes'],'include':_0x1e6b43[_0x2f90('0x1d')]?_[_0x2f90('0x1c')](_0x1e6b43[_0x2f90('0x1d')],function(_0x5c0da7){return{'model':db[_0x5c0da7[_0x2f90('0x1e')]],'as':_0x5c0da7['as'],'attributes':_0x5c0da7[_0x2f90('0x1b')],'include':_0x5c0da7[_0x2f90('0x1d')]?_[_0x2f90('0x1c')](_0x5c0da7[_0x2f90('0x1d')],function(_0x4cff5a){return{'model':db[_0x4cff5a[_0x2f90('0x1e')]],'as':_0x4cff5a['as'],'attributes':_0x4cff5a[_0x2f90('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37a68e){logger[_0x2f90('0xb')]('ShowDynamics365Account',_0x506066);logger[_0x2f90('0xd')]('ShowDynamics365Account',_0x506066,JSON['stringify'](_0x37a68e));_0xbb26f9(_0x37a68e);})[_0x2f90('0x14')](function(_0x14fda2){logger[_0x2f90('0x10')](_0x2f90('0x1f'),_0x14fda2['message'],_0x506066);_0x150713(_0x1aaaa8[_0x2f90('0x10')](0x1f4,_0x14fda2[_0x2f90('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c8b350d..5718bc9 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 _0xe3a5=['/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe3a5,0x127));var _0x5e3a=function(_0x7dc133,_0x448c68){_0x7dc133=_0x7dc133-0x0;var _0x4e25d6=_0xe3a5[_0x7dc133];return _0x4e25d6;};'use strict';var multer=require(_0x5e3a('0x0'));var util=require(_0x5e3a('0x1'));var path=require(_0x5e3a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e3a('0x3')]();var fs_extra=require(_0x5e3a('0x4'));var auth=require(_0x5e3a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5e3a('0x6'));var controller=require(_0x5e3a('0x7'));router[_0x5e3a('0x8')]('/',auth[_0x5e3a('0x9')](),controller[_0x5e3a('0xa')]);router['get'](_0x5e3a('0xb'),auth['isAuthenticated'](),controller[_0x5e3a('0xc')]);router['get'](_0x5e3a('0xd'),auth[_0x5e3a('0x9')](),controller['getFields']);router['get'](_0x5e3a('0xe'),auth[_0x5e3a('0x9')](),controller[_0x5e3a('0xf')]);router[_0x5e3a('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x5e3a('0x10')]);router[_0x5e3a('0x11')]('/',auth[_0x5e3a('0x9')](),controller[_0x5e3a('0x12')]);router[_0x5e3a('0x13')](_0x5e3a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5e3a('0x14')]('/:id',auth[_0x5e3a('0x9')](),controller['destroy']);module[_0x5e3a('0x15')]=router; \ No newline at end of file +var _0xb77e=['/:id','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x20beea,_0x5db625){var _0x570955=function(_0x3803d5){while(--_0x3803d5){_0x20beea['push'](_0x20beea['shift']());}};_0x570955(++_0x5db625);}(_0xb77e,0x1e6));var _0xeb77=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xb77e[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xeb77('0x0'));var util=require(_0xeb77('0x1'));var path=require(_0xeb77('0x2'));var timeout=require(_0xeb77('0x3'));var express=require(_0xeb77('0x4'));var router=express[_0xeb77('0x5')]();var fs_extra=require(_0xeb77('0x6'));var auth=require(_0xeb77('0x7'));var interaction=require(_0xeb77('0x8'));var config=require(_0xeb77('0x9'));var controller=require(_0xeb77('0xa'));router[_0xeb77('0xb')]('/',auth[_0xeb77('0xc')](),controller[_0xeb77('0xd')]);router['get'](_0xeb77('0xe'),auth[_0xeb77('0xc')](),controller[_0xeb77('0xf')]);router[_0xeb77('0xb')](_0xeb77('0x10'),auth[_0xeb77('0xc')](),controller['getFields']);router[_0xeb77('0xb')](_0xeb77('0x11'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xeb77('0xb')](_0xeb77('0x12'),auth[_0xeb77('0xc')](),controller[_0xeb77('0x13')]);router[_0xeb77('0x14')]('/',auth[_0xeb77('0xc')](),controller['create']);router[_0xeb77('0x15')](_0xeb77('0xe'),auth[_0xeb77('0xc')](),controller[_0xeb77('0x16')]);router['delete'](_0xeb77('0xe'),auth[_0xeb77('0xc')](),controller[_0xeb77('0x17')]);module[_0xeb77('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f83bbf3..9d197d4 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 _0xb370=['phonecall','nothing','contact','sequelize','exports','STRING','ENUM','incident'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xb370,0x123));var _0x0b37=function(_0x4bb034,_0x3de1a4){_0x4bb034=_0x4bb034-0x0;var _0x1ea86b=_0xb370[_0x4bb034];return _0x1ea86b;};'use strict';var Sequelize=require(_0x0b37('0x0'));module[_0x0b37('0x1')]={'name':{'type':Sequelize[_0x0b37('0x2')]},'description':{'type':Sequelize[_0x0b37('0x2')]},'ticketType':{'type':Sequelize[_0x0b37('0x3')](_0x0b37('0x4'),_0x0b37('0x5')),'defaultValue':_0x0b37('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x0b37('0x6')),'defaultValue':_0x0b37('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x3032=['nothing','sequelize','exports','STRING','ENUM','phonecall','contact'];(function(_0x322722,_0xc7981c){var _0x5e6eed=function(_0x4761e5){while(--_0x4761e5){_0x322722['push'](_0x322722['shift']());}};_0x5e6eed(++_0xc7981c);}(_0x3032,0xef));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2303('0x0'));module[_0x2303('0x1')]={'name':{'type':Sequelize[_0x2303('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2303('0x3')]('incident',_0x2303('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x2303('0x5'),_0x2303('0x6')),'defaultValue':_0x2303('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 72c65e9..740ed54 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 _0xa01d=['order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','includeAll','find','catch','create','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x356bb2,_0x471e7a){var _0x198620=function(_0x2f92b2){while(--_0x2f92b2){_0x356bb2['push'](_0x356bb2['shift']());}};_0x198620(++_0x471e7a);}(_0xa01d,0x1e4));var _0xda01=function(_0x500663,_0x2a329b){_0x500663=_0x500663-0x0;var _0xa9908=_0xa01d[_0x500663];return _0xa9908;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda01('0x1'));var rp=require(_0xda01('0x2'));var moment=require('moment');var BPromise=require(_0xda01('0x3'));var Mustache=require(_0xda01('0x4'));var util=require(_0xda01('0x5'));var path=require('path');var sox=require(_0xda01('0x6'));var csv=require(_0xda01('0x7'));var ejs=require(_0xda01('0x8'));var fs=require('fs');var fs_extra=require(_0xda01('0x9'));var _=require('lodash');var squel=require(_0xda01('0xa'));var crypto=require(_0xda01('0xb'));var jsforce=require(_0xda01('0xc'));var deskjs=require(_0xda01('0xd'));var toCsv=require(_0xda01('0x7'));var querystring=require('querystring');var Papa=require(_0xda01('0xe'));var Redis=require(_0xda01('0xf'));var authService=require(_0xda01('0x10'));var qs=require(_0xda01('0x11'));var as=require(_0xda01('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda01('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda01('0x14'))['db'];function respondWithStatusCode(_0x2a4f2a,_0x416427){_0x416427=_0x416427||0xcc;return function(_0x209b1c){if(_0x209b1c){return _0x2a4f2a[_0xda01('0x15')](_0x416427);}return _0x2a4f2a[_0xda01('0x16')](_0x416427)[_0xda01('0x17')]();};}function respondWithResult(_0x53d482,_0x4f66f9){_0x4f66f9=_0x4f66f9||0xc8;return function(_0x252a59){if(_0x252a59){return _0x53d482['status'](_0x4f66f9)[_0xda01('0x18')](_0x252a59);}};}function respondWithFilteredResult(_0xebdb1e,_0x498c9c){return function(_0x51b475){if(_0x51b475){var _0x50192c=typeof _0x498c9c[_0xda01('0x19')]===_0xda01('0x1a')&&typeof _0x498c9c[_0xda01('0x1b')]==='undefined';var _0x570483=_0x51b475['count'];var _0x1f4e0f=_0x50192c?0x0:_0x498c9c['offset'];var _0xaa202c=_0x50192c?_0x51b475[_0xda01('0x1c')]:_0x498c9c['offset']+_0x498c9c['limit'];var _0xfe3e2c;if(_0xaa202c>=_0x570483){_0xaa202c=_0x570483;_0xfe3e2c=0xc8;}else{_0xfe3e2c=0xce;}_0xebdb1e[_0xda01('0x16')](_0xfe3e2c);return _0xebdb1e[_0xda01('0x1d')](_0xda01('0x1e'),_0x1f4e0f+'-'+_0xaa202c+'/'+_0x570483)[_0xda01('0x18')](_0x51b475);}return null;};}function patchUpdates(_0x25dbbb){return function(_0x4a9cc0){try{jsonpatch[_0xda01('0x1f')](_0x4a9cc0,_0x25dbbb,!![]);}catch(_0x47b49e){return BPromise[_0xda01('0x20')](_0x47b49e);}return _0x4a9cc0['save']();};}function saveUpdates(_0x1638f4,_0xa9f454){return function(_0xc06f0e){if(_0xc06f0e){return _0xc06f0e[_0xda01('0x21')](_0x1638f4)[_0xda01('0x22')](function(_0x113e3c){return _0x113e3c;});}return null;};}function removeEntity(_0xf1f984,_0x6a525b){return function(_0x432e6e){if(_0x432e6e){return _0x432e6e[_0xda01('0x23')]()[_0xda01('0x22')](function(){_0xf1f984['status'](0xcc)[_0xda01('0x17')]();});}};}function handleEntityNotFound(_0x44181b,_0x5c3196){return function(_0x4e9eb6){if(!_0x4e9eb6){_0x44181b[_0xda01('0x15')](0x194);}return _0x4e9eb6;};}function handleError(_0x514bc4,_0x19756c){_0x19756c=_0x19756c||0x1f4;return function(_0x1d3e17){logger[_0xda01('0x24')](_0x1d3e17['stack']);if(_0x1d3e17[_0xda01('0x25')]){delete _0x1d3e17['name'];}_0x514bc4[_0xda01('0x16')](_0x19756c)[_0xda01('0x26')](_0x1d3e17);};}exports[_0xda01('0x27')]=function(_0x1467c6,_0x455fdb){var _0x35d9b7={},_0x2bfa87={},_0x49b752={'count':0x0,'rows':[]};var _0x26b8a2=_[_0xda01('0x28')](db[_0xda01('0x29')][_0xda01('0x2a')],function(_0x3116d){return{'name':_0x3116d['fieldName'],'type':_0x3116d[_0xda01('0x2b')][_0xda01('0x2c')]};});_0x2bfa87[_0xda01('0x2d')]=_[_0xda01('0x28')](_0x26b8a2,_0xda01('0x25'));_0x2bfa87[_0xda01('0x2e')]=_[_0xda01('0x2f')](_0x1467c6[_0xda01('0x2e')]);_0x2bfa87[_0xda01('0x30')]=_[_0xda01('0x31')](_0x2bfa87[_0xda01('0x2d')],_0x2bfa87[_0xda01('0x2e')]);_0x35d9b7[_0xda01('0x32')]=_[_0xda01('0x31')](_0x2bfa87[_0xda01('0x2d')],qs[_0xda01('0x33')](_0x1467c6[_0xda01('0x2e')]['fields']));_0x35d9b7['attributes']=_0x35d9b7['attributes'][_0xda01('0x34')]?_0x35d9b7['attributes']:_0x2bfa87[_0xda01('0x2d')];if(!_0x1467c6[_0xda01('0x2e')][_0xda01('0x35')](_0xda01('0x36'))){_0x35d9b7['limit']=qs[_0xda01('0x1b')](_0x1467c6[_0xda01('0x2e')][_0xda01('0x1b')]);_0x35d9b7['offset']=qs[_0xda01('0x19')](_0x1467c6[_0xda01('0x2e')][_0xda01('0x19')]);}_0x35d9b7[_0xda01('0x37')]=qs[_0xda01('0x38')](_0x1467c6[_0xda01('0x2e')][_0xda01('0x38')]);_0x35d9b7[_0xda01('0x39')]=qs[_0xda01('0x30')](_[_0xda01('0x3a')](_0x1467c6['query'],_0x2bfa87['filters']),_0x26b8a2);if(_0x1467c6[_0xda01('0x2e')][_0xda01('0x3b')]){_0x35d9b7[_0xda01('0x39')]=_[_0xda01('0x3c')](_0x35d9b7[_0xda01('0x39')],{'$or':_['map'](_0x26b8a2,function(_0x4c0097){if(_0x4c0097[_0xda01('0x2b')]!==_0xda01('0x3d')){var _0x29e997={};_0x29e997[_0x4c0097[_0xda01('0x25')]]={'$like':'%'+_0x1467c6[_0xda01('0x2e')][_0xda01('0x3b')]+'%'};return _0x29e997;}})});}_0x35d9b7=_['merge']({},_0x35d9b7,_0x1467c6[_0xda01('0x3e')]);var _0x3b1e55={'where':_0x35d9b7[_0xda01('0x39')]};return db['Dynamics365Configuration'][_0xda01('0x1c')](_0x3b1e55)['then'](function(_0x24afc6){_0x49b752[_0xda01('0x1c')]=_0x24afc6;if(_0x1467c6[_0xda01('0x2e')]['includeAll']){_0x35d9b7[_0xda01('0x3f')]=[{'all':!![]}];}return db[_0xda01('0x29')]['findAll'](_0x35d9b7);})[_0xda01('0x22')](function(_0x4f69f8){_0x49b752[_0xda01('0x40')]=_0x4f69f8;return _0x49b752;})[_0xda01('0x22')](respondWithFilteredResult(_0x455fdb,_0x35d9b7))['catch'](handleError(_0x455fdb,null));};exports[_0xda01('0x41')]=function(_0x55e28a,_0x51ce5d){var _0x34ffcc={'raw':![],'where':{'id':_0x55e28a['params']['id']}},_0x32e3d5={};_0x32e3d5['model']=_[_0xda01('0x2f')](db[_0xda01('0x29')][_0xda01('0x2a')]);_0x32e3d5[_0xda01('0x2e')]=_[_0xda01('0x2f')](_0x55e28a[_0xda01('0x2e')]);_0x32e3d5['filters']=_[_0xda01('0x31')](_0x32e3d5[_0xda01('0x2d')],_0x32e3d5[_0xda01('0x2e')]);_0x34ffcc[_0xda01('0x32')]=_[_0xda01('0x31')](_0x32e3d5['model'],qs[_0xda01('0x33')](_0x55e28a[_0xda01('0x2e')][_0xda01('0x33')]));_0x34ffcc[_0xda01('0x32')]=_0x34ffcc[_0xda01('0x32')][_0xda01('0x34')]?_0x34ffcc[_0xda01('0x32')]:_0x32e3d5[_0xda01('0x2d')];if(_0x55e28a[_0xda01('0x2e')][_0xda01('0x42')]){_0x34ffcc[_0xda01('0x3f')]=[{'all':!![]}];}_0x34ffcc=_[_0xda01('0x3c')]({},_0x34ffcc,_0x55e28a[_0xda01('0x3e')]);return db[_0xda01('0x29')][_0xda01('0x43')](_0x34ffcc)[_0xda01('0x22')](handleEntityNotFound(_0x51ce5d,null))[_0xda01('0x22')](respondWithResult(_0x51ce5d,null))[_0xda01('0x44')](handleError(_0x51ce5d,null));};exports[_0xda01('0x45')]=function(_0x4eb03b,_0x47d57f){return db[_0xda01('0x29')][_0xda01('0x45')](_0x4eb03b['body'],{})[_0xda01('0x22')](respondWithResult(_0x47d57f,0xc9))[_0xda01('0x44')](handleError(_0x47d57f,null));};exports['update']=function(_0x194ce0,_0x1c03b6){if(_0x194ce0[_0xda01('0x46')]['id']){delete _0x194ce0[_0xda01('0x46')]['id'];}return db[_0xda01('0x29')][_0xda01('0x43')]({'where':{'id':_0x194ce0[_0xda01('0x47')]['id']}})[_0xda01('0x22')](handleEntityNotFound(_0x1c03b6,null))['then'](saveUpdates(_0x194ce0[_0xda01('0x46')],null))[_0xda01('0x22')](respondWithResult(_0x1c03b6,null))[_0xda01('0x44')](handleError(_0x1c03b6,null));};exports[_0xda01('0x23')]=function(_0x371332,_0x3a1ff2){return db[_0xda01('0x29')][_0xda01('0x43')]({'where':{'id':_0x371332[_0xda01('0x47')]['id']}})[_0xda01('0x22')](handleEntityNotFound(_0x3a1ff2,null))[_0xda01('0x22')](removeEntity(_0x3a1ff2,null))['catch'](handleError(_0x3a1ff2,null));};exports[_0xda01('0x48')]=function(_0x1f6558,_0x247bf4,_0x44877a){var _0x2002b2={};var _0x9868f2={};var _0x2987db;var _0x27e7be;return db[_0xda01('0x29')][_0xda01('0x49')]({'where':{'id':_0x1f6558['params']['id']}})[_0xda01('0x22')](handleEntityNotFound(_0x247bf4,null))[_0xda01('0x22')](function(_0x1f4f9e){if(_0x1f4f9e){_0x2987db=_0x1f4f9e;_0x9868f2['model']=_['keys'](db[_0xda01('0x4a')][_0xda01('0x2a')]);_0x9868f2[_0xda01('0x2e')]=_[_0xda01('0x2f')](_0x1f6558[_0xda01('0x2e')]);_0x9868f2[_0xda01('0x30')]=_[_0xda01('0x31')](_0x9868f2[_0xda01('0x2d')],_0x9868f2['query']);_0x2002b2[_0xda01('0x32')]=_[_0xda01('0x31')](_0x9868f2[_0xda01('0x2d')],qs[_0xda01('0x33')](_0x1f6558[_0xda01('0x2e')][_0xda01('0x33')]));_0x2002b2[_0xda01('0x32')]=_0x2002b2['attributes']['length']?_0x2002b2[_0xda01('0x32')]:_0x9868f2[_0xda01('0x2d')];_0x2002b2[_0xda01('0x37')]=qs[_0xda01('0x38')](_0x1f6558[_0xda01('0x2e')][_0xda01('0x38')]);_0x2002b2[_0xda01('0x39')]=qs[_0xda01('0x30')](_[_0xda01('0x3a')](_0x1f6558[_0xda01('0x2e')],_0x9868f2['filters']));if(_0x1f6558['query'][_0xda01('0x3b')]){_0x2002b2[_0xda01('0x39')]=_['merge'](_0x2002b2['where'],{'$or':_['map'](_0x2002b2[_0xda01('0x32')],function(_0x467966){var _0x9fc084={};_0x9fc084[_0x467966]={'$like':'%'+_0x1f6558[_0xda01('0x2e')][_0xda01('0x3b')]+'%'};return _0x9fc084;})});}_0x2002b2=_[_0xda01('0x3c')]({},_0x2002b2,_0x1f6558[_0xda01('0x3e')]);return _0x2987db[_0xda01('0x48')](_0x2002b2);}})[_0xda01('0x22')](function(_0x68c61d){if(_0x68c61d){_0x27e7be=_0x68c61d[_0xda01('0x34')];if(!_0x1f6558[_0xda01('0x2e')][_0xda01('0x35')]('nolimit')){_0x2002b2[_0xda01('0x1b')]=qs['limit'](_0x1f6558[_0xda01('0x2e')][_0xda01('0x1b')]);_0x2002b2[_0xda01('0x19')]=qs[_0xda01('0x19')](_0x1f6558['query'][_0xda01('0x19')]);}return _0x2987db['getFields'](_0x2002b2);}})[_0xda01('0x22')](function(_0x3f05b1){if(_0x3f05b1){return _0x3f05b1?{'count':_0x27e7be,'rows':_0x3f05b1}:null;}})[_0xda01('0x22')](respondWithResult(_0x247bf4,null))[_0xda01('0x44')](handleError(_0x247bf4,null));};exports[_0xda01('0x4b')]=function(_0x5adfa2,_0x23b77e,_0x311dae){var _0x4de519={};var _0x255be4={};var _0x4c49eb;var _0x54b449;return db[_0xda01('0x29')][_0xda01('0x49')]({'where':{'id':_0x5adfa2[_0xda01('0x47')]['id']}})[_0xda01('0x22')](handleEntityNotFound(_0x23b77e,null))[_0xda01('0x22')](function(_0x2c5de1){if(_0x2c5de1){_0x4c49eb=_0x2c5de1;_0x255be4[_0xda01('0x2d')]=_['keys'](db[_0xda01('0x4a')][_0xda01('0x2a')]);_0x255be4[_0xda01('0x2e')]=_['keys'](_0x5adfa2[_0xda01('0x2e')]);_0x255be4[_0xda01('0x30')]=_[_0xda01('0x31')](_0x255be4[_0xda01('0x2d')],_0x255be4[_0xda01('0x2e')]);_0x4de519[_0xda01('0x32')]=_[_0xda01('0x31')](_0x255be4['model'],qs['fields'](_0x5adfa2[_0xda01('0x2e')][_0xda01('0x33')]));_0x4de519[_0xda01('0x32')]=_0x4de519[_0xda01('0x32')][_0xda01('0x34')]?_0x4de519['attributes']:_0x255be4[_0xda01('0x2d')];_0x4de519[_0xda01('0x37')]=qs[_0xda01('0x38')](_0x5adfa2[_0xda01('0x2e')][_0xda01('0x38')]);_0x4de519[_0xda01('0x39')]=qs[_0xda01('0x30')](_[_0xda01('0x3a')](_0x5adfa2['query'],_0x255be4[_0xda01('0x30')]));if(_0x5adfa2['query'][_0xda01('0x3b')]){_0x4de519[_0xda01('0x39')]=_[_0xda01('0x3c')](_0x4de519['where'],{'$or':_[_0xda01('0x28')](_0x4de519[_0xda01('0x32')],function(_0x2d4b74){var _0x3a7df8={};_0x3a7df8[_0x2d4b74]={'$like':'%'+_0x5adfa2[_0xda01('0x2e')]['filter']+'%'};return _0x3a7df8;})});}_0x4de519=_[_0xda01('0x3c')]({},_0x4de519,_0x5adfa2[_0xda01('0x3e')]);return _0x4c49eb[_0xda01('0x4b')](_0x4de519);}})['then'](function(_0x3e3862){if(_0x3e3862){_0x54b449=_0x3e3862['length'];if(!_0x5adfa2[_0xda01('0x2e')][_0xda01('0x35')]('nolimit')){_0x4de519['limit']=qs[_0xda01('0x1b')](_0x5adfa2[_0xda01('0x2e')][_0xda01('0x1b')]);_0x4de519['offset']=qs['offset'](_0x5adfa2[_0xda01('0x2e')][_0xda01('0x19')]);}return _0x4c49eb[_0xda01('0x4b')](_0x4de519);}})[_0xda01('0x22')](function(_0x4fa17e){if(_0x4fa17e){return _0x4fa17e?{'count':_0x54b449,'rows':_0x4fa17e}:null;}})['then'](respondWithResult(_0x23b77e,null))[_0xda01('0x44')](handleError(_0x23b77e,null));};exports[_0xda01('0x4c')]=function(_0x1e01ef,_0x420dbb,_0x2ea2c0){var _0x2ca4d5={};var _0x57ae3a={};var _0x2a88b2;var _0x4ea6ca;return db[_0xda01('0x29')][_0xda01('0x49')]({'where':{'id':_0x1e01ef[_0xda01('0x47')]['id']}})[_0xda01('0x22')](handleEntityNotFound(_0x420dbb,null))[_0xda01('0x22')](function(_0x1143f7){if(_0x1143f7){_0x2a88b2=_0x1143f7;_0x57ae3a[_0xda01('0x2d')]=_[_0xda01('0x2f')](db[_0xda01('0x4a')]['rawAttributes']);_0x57ae3a[_0xda01('0x2e')]=_[_0xda01('0x2f')](_0x1e01ef[_0xda01('0x2e')]);_0x57ae3a['filters']=_['intersection'](_0x57ae3a[_0xda01('0x2d')],_0x57ae3a[_0xda01('0x2e')]);_0x2ca4d5[_0xda01('0x32')]=_['intersection'](_0x57ae3a['model'],qs[_0xda01('0x33')](_0x1e01ef[_0xda01('0x2e')][_0xda01('0x33')]));_0x2ca4d5[_0xda01('0x32')]=_0x2ca4d5[_0xda01('0x32')][_0xda01('0x34')]?_0x2ca4d5[_0xda01('0x32')]:_0x57ae3a[_0xda01('0x2d')];_0x2ca4d5[_0xda01('0x37')]=qs[_0xda01('0x38')](_0x1e01ef[_0xda01('0x2e')]['sort']);_0x2ca4d5[_0xda01('0x39')]=qs[_0xda01('0x30')](_[_0xda01('0x3a')](_0x1e01ef[_0xda01('0x2e')],_0x57ae3a[_0xda01('0x30')]));if(_0x1e01ef[_0xda01('0x2e')][_0xda01('0x3b')]){_0x2ca4d5['where']=_[_0xda01('0x3c')](_0x2ca4d5['where'],{'$or':_[_0xda01('0x28')](_0x2ca4d5[_0xda01('0x32')],function(_0x33dc23){var _0x5c339a={};_0x5c339a[_0x33dc23]={'$like':'%'+_0x1e01ef['query'][_0xda01('0x3b')]+'%'};return _0x5c339a;})});}_0x2ca4d5=_['merge']({},_0x2ca4d5,_0x1e01ef['options']);return _0x2a88b2['getDescriptions'](_0x2ca4d5);}})[_0xda01('0x22')](function(_0x10d00e){if(_0x10d00e){_0x4ea6ca=_0x10d00e['length'];if(!_0x1e01ef[_0xda01('0x2e')][_0xda01('0x35')]('nolimit')){_0x2ca4d5[_0xda01('0x1b')]=qs[_0xda01('0x1b')](_0x1e01ef[_0xda01('0x2e')][_0xda01('0x1b')]);_0x2ca4d5[_0xda01('0x19')]=qs[_0xda01('0x19')](_0x1e01ef[_0xda01('0x2e')][_0xda01('0x19')]);}return _0x2a88b2[_0xda01('0x4c')](_0x2ca4d5);}})[_0xda01('0x22')](function(_0x4ecf5c){if(_0x4ecf5c){return _0x4ecf5c?{'count':_0x4ea6ca,'rows':_0x4ecf5c}:null;}})[_0xda01('0x22')](respondWithResult(_0x420dbb,null))[_0xda01('0x44')](handleError(_0x420dbb,null));}; \ No newline at end of file +var _0x0657=['Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','findOne','Dynamics365Field','length','sort','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map'];(function(_0xda65c9,_0xfa79a2){var _0x181cb6=function(_0x4312ac){while(--_0x4312ac){_0xda65c9['push'](_0xda65c9['shift']());}};_0x181cb6(++_0xfa79a2);}(_0x0657,0x15c));var _0x7065=function(_0x3754b3,_0x3b3a73){_0x3754b3=_0x3754b3-0x0;var _0x5eebcd=_0x0657[_0x3754b3];return _0x5eebcd;};'use strict';var emlformat=require(_0x7065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7065('0x1'));var rp=require(_0x7065('0x2'));var moment=require('moment');var BPromise=require(_0x7065('0x3'));var Mustache=require(_0x7065('0x4'));var util=require(_0x7065('0x5'));var path=require('path');var sox=require(_0x7065('0x6'));var csv=require('to-csv');var ejs=require(_0x7065('0x7'));var fs=require('fs');var fs_extra=require(_0x7065('0x8'));var _=require(_0x7065('0x9'));var squel=require('squel');var crypto=require(_0x7065('0xa'));var jsforce=require(_0x7065('0xb'));var deskjs=require(_0x7065('0xc'));var toCsv=require(_0x7065('0xd'));var querystring=require(_0x7065('0xe'));var Papa=require('papaparse');var Redis=require(_0x7065('0xf'));var authService=require(_0x7065('0x10'));var qs=require(_0x7065('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7065('0x12'));var logger=require(_0x7065('0x13'))('api');var utils=require(_0x7065('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7065('0x15'));var db=require(_0x7065('0x16'))['db'];function respondWithStatusCode(_0x2854e5,_0x44dfb8){_0x44dfb8=_0x44dfb8||0xcc;return function(_0x2fff41){if(_0x2fff41){return _0x2854e5[_0x7065('0x17')](_0x44dfb8);}return _0x2854e5[_0x7065('0x18')](_0x44dfb8)[_0x7065('0x19')]();};}function respondWithResult(_0x510e9b,_0x4e3592){_0x4e3592=_0x4e3592||0xc8;return function(_0x41c1e3){if(_0x41c1e3){return _0x510e9b[_0x7065('0x18')](_0x4e3592)[_0x7065('0x1a')](_0x41c1e3);}};}function respondWithFilteredResult(_0x2ed02e,_0x2ca66b){return function(_0x8eca7f){if(_0x8eca7f){var _0x3bd439=typeof _0x2ca66b[_0x7065('0x1b')]===_0x7065('0x1c')&&typeof _0x2ca66b[_0x7065('0x1d')]===_0x7065('0x1c');var _0x143ec8=_0x8eca7f[_0x7065('0x1e')];var _0x5ef6b1=_0x3bd439?0x0:_0x2ca66b[_0x7065('0x1b')];var _0x383583=_0x3bd439?_0x8eca7f[_0x7065('0x1e')]:_0x2ca66b[_0x7065('0x1b')]+_0x2ca66b['limit'];var _0x278b74;if(_0x383583>=_0x143ec8){_0x383583=_0x143ec8;_0x278b74=0xc8;}else{_0x278b74=0xce;}_0x2ed02e['status'](_0x278b74);return _0x2ed02e[_0x7065('0x1f')](_0x7065('0x20'),_0x5ef6b1+'-'+_0x383583+'/'+_0x143ec8)[_0x7065('0x1a')](_0x8eca7f);}return null;};}function patchUpdates(_0x134a61){return function(_0x571ac2){try{jsonpatch['apply'](_0x571ac2,_0x134a61,!![]);}catch(_0x20f6e2){return BPromise[_0x7065('0x21')](_0x20f6e2);}return _0x571ac2['save']();};}function saveUpdates(_0x4016cd,_0x2b91a1){return function(_0x4e562a){if(_0x4e562a){return _0x4e562a[_0x7065('0x22')](_0x4016cd)[_0x7065('0x23')](function(_0x3683d5){return _0x3683d5;});}return null;};}function removeEntity(_0x3219da,_0x3f6c85){return function(_0x9ce288){if(_0x9ce288){return _0x9ce288[_0x7065('0x24')]()[_0x7065('0x23')](function(){_0x3219da[_0x7065('0x18')](0xcc)[_0x7065('0x19')]();});}};}function handleEntityNotFound(_0xa6f91d,_0x8c303c){return function(_0x5e795d){if(!_0x5e795d){_0xa6f91d[_0x7065('0x17')](0x194);}return _0x5e795d;};}function handleError(_0x283f59,_0x2d35c7){_0x2d35c7=_0x2d35c7||0x1f4;return function(_0x30b160){logger[_0x7065('0x25')](_0x30b160[_0x7065('0x26')]);if(_0x30b160[_0x7065('0x27')]){delete _0x30b160[_0x7065('0x27')];}_0x283f59[_0x7065('0x18')](_0x2d35c7)[_0x7065('0x28')](_0x30b160);};}exports['index']=function(_0x57cc3e,_0x59e383){var _0x5c6fa4={},_0x84b40c={},_0x118781={'count':0x0,'rows':[]};var _0x1ec1a6=_[_0x7065('0x29')](db[_0x7065('0x2a')][_0x7065('0x2b')],function(_0x3fe9bd){return{'name':_0x3fe9bd[_0x7065('0x2c')],'type':_0x3fe9bd[_0x7065('0x2d')][_0x7065('0x2e')]};});_0x84b40c[_0x7065('0x2f')]=_[_0x7065('0x29')](_0x1ec1a6,_0x7065('0x27'));_0x84b40c[_0x7065('0x30')]=_[_0x7065('0x31')](_0x57cc3e[_0x7065('0x30')]);_0x84b40c[_0x7065('0x32')]=_[_0x7065('0x33')](_0x84b40c[_0x7065('0x2f')],_0x84b40c[_0x7065('0x30')]);_0x5c6fa4[_0x7065('0x34')]=_[_0x7065('0x33')](_0x84b40c[_0x7065('0x2f')],qs[_0x7065('0x35')](_0x57cc3e[_0x7065('0x30')]['fields']));_0x5c6fa4[_0x7065('0x34')]=_0x5c6fa4[_0x7065('0x34')]['length']?_0x5c6fa4['attributes']:_0x84b40c[_0x7065('0x2f')];if(!_0x57cc3e[_0x7065('0x30')][_0x7065('0x36')](_0x7065('0x37'))){_0x5c6fa4[_0x7065('0x1d')]=qs[_0x7065('0x1d')](_0x57cc3e[_0x7065('0x30')]['limit']);_0x5c6fa4['offset']=qs[_0x7065('0x1b')](_0x57cc3e[_0x7065('0x30')]['offset']);}_0x5c6fa4[_0x7065('0x38')]=qs['sort'](_0x57cc3e[_0x7065('0x30')]['sort']);_0x5c6fa4[_0x7065('0x39')]=qs[_0x7065('0x32')](_[_0x7065('0x3a')](_0x57cc3e[_0x7065('0x30')],_0x84b40c['filters']),_0x1ec1a6);if(_0x57cc3e[_0x7065('0x30')][_0x7065('0x3b')]){_0x5c6fa4['where']=_[_0x7065('0x3c')](_0x5c6fa4['where'],{'$or':_[_0x7065('0x29')](_0x1ec1a6,function(_0x3fcc21){if(_0x3fcc21[_0x7065('0x2d')]!==_0x7065('0x3d')){var _0xfc5aad={};_0xfc5aad[_0x3fcc21[_0x7065('0x27')]]={'$like':'%'+_0x57cc3e[_0x7065('0x30')]['filter']+'%'};return _0xfc5aad;}})});}_0x5c6fa4=_['merge']({},_0x5c6fa4,_0x57cc3e[_0x7065('0x3e')]);var _0x3d74ed={'where':_0x5c6fa4[_0x7065('0x39')]};return db[_0x7065('0x2a')][_0x7065('0x1e')](_0x3d74ed)[_0x7065('0x23')](function(_0x303241){_0x118781[_0x7065('0x1e')]=_0x303241;if(_0x57cc3e[_0x7065('0x30')][_0x7065('0x3f')]){_0x5c6fa4['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x7065('0x40')](_0x5c6fa4);})[_0x7065('0x23')](function(_0x1f5d3d){_0x118781[_0x7065('0x41')]=_0x1f5d3d;return _0x118781;})[_0x7065('0x23')](respondWithFilteredResult(_0x59e383,_0x5c6fa4))[_0x7065('0x42')](handleError(_0x59e383,null));};exports[_0x7065('0x43')]=function(_0x2ebc45,_0x30fc08){var _0x29d88b={'raw':![],'where':{'id':_0x2ebc45[_0x7065('0x44')]['id']}},_0x32ddb7={};_0x32ddb7['model']=_['keys'](db[_0x7065('0x2a')]['rawAttributes']);_0x32ddb7[_0x7065('0x30')]=_[_0x7065('0x31')](_0x2ebc45[_0x7065('0x30')]);_0x32ddb7[_0x7065('0x32')]=_[_0x7065('0x33')](_0x32ddb7[_0x7065('0x2f')],_0x32ddb7[_0x7065('0x30')]);_0x29d88b[_0x7065('0x34')]=_[_0x7065('0x33')](_0x32ddb7[_0x7065('0x2f')],qs['fields'](_0x2ebc45[_0x7065('0x30')][_0x7065('0x35')]));_0x29d88b[_0x7065('0x34')]=_0x29d88b[_0x7065('0x34')]['length']?_0x29d88b['attributes']:_0x32ddb7[_0x7065('0x2f')];if(_0x2ebc45[_0x7065('0x30')]['includeAll']){_0x29d88b['include']=[{'all':!![]}];}_0x29d88b=_[_0x7065('0x3c')]({},_0x29d88b,_0x2ebc45[_0x7065('0x3e')]);return db[_0x7065('0x2a')][_0x7065('0x45')](_0x29d88b)[_0x7065('0x23')](handleEntityNotFound(_0x30fc08,null))['then'](respondWithResult(_0x30fc08,null))['catch'](handleError(_0x30fc08,null));};exports['create']=function(_0x4e73b1,_0xff116c){return db['Dynamics365Configuration'][_0x7065('0x46')](_0x4e73b1[_0x7065('0x47')],{})[_0x7065('0x23')](respondWithResult(_0xff116c,0xc9))['catch'](handleError(_0xff116c,null));};exports['update']=function(_0x281479,_0x557bc0){if(_0x281479[_0x7065('0x47')]['id']){delete _0x281479[_0x7065('0x47')]['id'];}return db[_0x7065('0x2a')][_0x7065('0x45')]({'where':{'id':_0x281479[_0x7065('0x44')]['id']}})['then'](handleEntityNotFound(_0x557bc0,null))[_0x7065('0x23')](saveUpdates(_0x281479[_0x7065('0x47')],null))[_0x7065('0x23')](respondWithResult(_0x557bc0,null))[_0x7065('0x42')](handleError(_0x557bc0,null));};exports[_0x7065('0x24')]=function(_0x4a703c,_0x3fdffb){return db[_0x7065('0x2a')][_0x7065('0x45')]({'where':{'id':_0x4a703c[_0x7065('0x44')]['id']}})[_0x7065('0x23')](handleEntityNotFound(_0x3fdffb,null))['then'](removeEntity(_0x3fdffb,null))[_0x7065('0x42')](handleError(_0x3fdffb,null));};exports['getFields']=function(_0x1791b5,_0x2b3902,_0x18c45a){var _0x420c7d={};var _0x57729a={};var _0x163237;var _0x1f0f15;return db[_0x7065('0x2a')][_0x7065('0x48')]({'where':{'id':_0x1791b5[_0x7065('0x44')]['id']}})[_0x7065('0x23')](handleEntityNotFound(_0x2b3902,null))[_0x7065('0x23')](function(_0x26fae8){if(_0x26fae8){_0x163237=_0x26fae8;_0x57729a['model']=_[_0x7065('0x31')](db[_0x7065('0x49')][_0x7065('0x2b')]);_0x57729a['query']=_[_0x7065('0x31')](_0x1791b5[_0x7065('0x30')]);_0x57729a[_0x7065('0x32')]=_[_0x7065('0x33')](_0x57729a[_0x7065('0x2f')],_0x57729a['query']);_0x420c7d[_0x7065('0x34')]=_[_0x7065('0x33')](_0x57729a['model'],qs[_0x7065('0x35')](_0x1791b5[_0x7065('0x30')]['fields']));_0x420c7d[_0x7065('0x34')]=_0x420c7d['attributes'][_0x7065('0x4a')]?_0x420c7d['attributes']:_0x57729a['model'];_0x420c7d[_0x7065('0x38')]=qs['sort'](_0x1791b5[_0x7065('0x30')][_0x7065('0x4b')]);_0x420c7d[_0x7065('0x39')]=qs['filters'](_[_0x7065('0x3a')](_0x1791b5['query'],_0x57729a[_0x7065('0x32')]));if(_0x1791b5[_0x7065('0x30')]['filter']){_0x420c7d[_0x7065('0x39')]=_[_0x7065('0x3c')](_0x420c7d[_0x7065('0x39')],{'$or':_[_0x7065('0x29')](_0x420c7d['attributes'],function(_0x273765){var _0x3a127c={};_0x3a127c[_0x273765]={'$like':'%'+_0x1791b5[_0x7065('0x30')][_0x7065('0x3b')]+'%'};return _0x3a127c;})});}_0x420c7d=_[_0x7065('0x3c')]({},_0x420c7d,_0x1791b5[_0x7065('0x3e')]);return _0x163237['getFields'](_0x420c7d);}})[_0x7065('0x23')](function(_0x21bc5c){if(_0x21bc5c){_0x1f0f15=_0x21bc5c['length'];if(!_0x1791b5[_0x7065('0x30')][_0x7065('0x36')]('nolimit')){_0x420c7d[_0x7065('0x1d')]=qs['limit'](_0x1791b5[_0x7065('0x30')][_0x7065('0x1d')]);_0x420c7d['offset']=qs['offset'](_0x1791b5['query']['offset']);}return _0x163237['getFields'](_0x420c7d);}})['then'](function(_0x18adb9){if(_0x18adb9){return _0x18adb9?{'count':_0x1f0f15,'rows':_0x18adb9}:null;}})['then'](respondWithResult(_0x2b3902,null))['catch'](handleError(_0x2b3902,null));};exports['getSubjects']=function(_0x3babf1,_0x29dd86,_0x28fb86){var _0xa8a697={};var _0x49782e={};var _0x5b0676;var _0x3c3588;return db['Dynamics365Configuration'][_0x7065('0x48')]({'where':{'id':_0x3babf1[_0x7065('0x44')]['id']}})[_0x7065('0x23')](handleEntityNotFound(_0x29dd86,null))[_0x7065('0x23')](function(_0x5ae5ec){if(_0x5ae5ec){_0x5b0676=_0x5ae5ec;_0x49782e[_0x7065('0x2f')]=_[_0x7065('0x31')](db[_0x7065('0x49')][_0x7065('0x2b')]);_0x49782e[_0x7065('0x30')]=_[_0x7065('0x31')](_0x3babf1[_0x7065('0x30')]);_0x49782e[_0x7065('0x32')]=_[_0x7065('0x33')](_0x49782e['model'],_0x49782e['query']);_0xa8a697['attributes']=_[_0x7065('0x33')](_0x49782e[_0x7065('0x2f')],qs[_0x7065('0x35')](_0x3babf1[_0x7065('0x30')][_0x7065('0x35')]));_0xa8a697[_0x7065('0x34')]=_0xa8a697[_0x7065('0x34')][_0x7065('0x4a')]?_0xa8a697[_0x7065('0x34')]:_0x49782e['model'];_0xa8a697[_0x7065('0x38')]=qs[_0x7065('0x4b')](_0x3babf1[_0x7065('0x30')][_0x7065('0x4b')]);_0xa8a697[_0x7065('0x39')]=qs[_0x7065('0x32')](_['pick'](_0x3babf1[_0x7065('0x30')],_0x49782e[_0x7065('0x32')]));if(_0x3babf1[_0x7065('0x30')][_0x7065('0x3b')]){_0xa8a697[_0x7065('0x39')]=_[_0x7065('0x3c')](_0xa8a697['where'],{'$or':_['map'](_0xa8a697['attributes'],function(_0x498c1f){var _0x31b498={};_0x31b498[_0x498c1f]={'$like':'%'+_0x3babf1[_0x7065('0x30')][_0x7065('0x3b')]+'%'};return _0x31b498;})});}_0xa8a697=_[_0x7065('0x3c')]({},_0xa8a697,_0x3babf1[_0x7065('0x3e')]);return _0x5b0676[_0x7065('0x4c')](_0xa8a697);}})[_0x7065('0x23')](function(_0x1dbade){if(_0x1dbade){_0x3c3588=_0x1dbade['length'];if(!_0x3babf1[_0x7065('0x30')][_0x7065('0x36')](_0x7065('0x37'))){_0xa8a697['limit']=qs['limit'](_0x3babf1['query'][_0x7065('0x1d')]);_0xa8a697['offset']=qs[_0x7065('0x1b')](_0x3babf1['query'][_0x7065('0x1b')]);}return _0x5b0676[_0x7065('0x4c')](_0xa8a697);}})['then'](function(_0x2cc290){if(_0x2cc290){return _0x2cc290?{'count':_0x3c3588,'rows':_0x2cc290}:null;}})[_0x7065('0x23')](respondWithResult(_0x29dd86,null))[_0x7065('0x42')](handleError(_0x29dd86,null));};exports[_0x7065('0x4d')]=function(_0x3dbe77,_0x40d103,_0x3b9f0f){var _0x27fe83={};var _0x7c0d86={};var _0x31b9fc;var _0x4fb8ef;return db[_0x7065('0x2a')][_0x7065('0x48')]({'where':{'id':_0x3dbe77['params']['id']}})[_0x7065('0x23')](handleEntityNotFound(_0x40d103,null))['then'](function(_0x26e373){if(_0x26e373){_0x31b9fc=_0x26e373;_0x7c0d86[_0x7065('0x2f')]=_[_0x7065('0x31')](db[_0x7065('0x49')][_0x7065('0x2b')]);_0x7c0d86[_0x7065('0x30')]=_['keys'](_0x3dbe77[_0x7065('0x30')]);_0x7c0d86['filters']=_[_0x7065('0x33')](_0x7c0d86[_0x7065('0x2f')],_0x7c0d86[_0x7065('0x30')]);_0x27fe83['attributes']=_[_0x7065('0x33')](_0x7c0d86[_0x7065('0x2f')],qs[_0x7065('0x35')](_0x3dbe77[_0x7065('0x30')][_0x7065('0x35')]));_0x27fe83['attributes']=_0x27fe83[_0x7065('0x34')][_0x7065('0x4a')]?_0x27fe83[_0x7065('0x34')]:_0x7c0d86['model'];_0x27fe83[_0x7065('0x38')]=qs[_0x7065('0x4b')](_0x3dbe77['query'][_0x7065('0x4b')]);_0x27fe83[_0x7065('0x39')]=qs[_0x7065('0x32')](_['pick'](_0x3dbe77[_0x7065('0x30')],_0x7c0d86[_0x7065('0x32')]));if(_0x3dbe77[_0x7065('0x30')][_0x7065('0x3b')]){_0x27fe83['where']=_['merge'](_0x27fe83[_0x7065('0x39')],{'$or':_[_0x7065('0x29')](_0x27fe83['attributes'],function(_0x1ccfd1){var _0x231b60={};_0x231b60[_0x1ccfd1]={'$like':'%'+_0x3dbe77[_0x7065('0x30')][_0x7065('0x3b')]+'%'};return _0x231b60;})});}_0x27fe83=_['merge']({},_0x27fe83,_0x3dbe77['options']);return _0x31b9fc[_0x7065('0x4d')](_0x27fe83);}})[_0x7065('0x23')](function(_0x10c3d8){if(_0x10c3d8){_0x4fb8ef=_0x10c3d8['length'];if(!_0x3dbe77[_0x7065('0x30')][_0x7065('0x36')](_0x7065('0x37'))){_0x27fe83['limit']=qs[_0x7065('0x1d')](_0x3dbe77[_0x7065('0x30')][_0x7065('0x1d')]);_0x27fe83['offset']=qs['offset'](_0x3dbe77['query'][_0x7065('0x1b')]);}return _0x31b9fc[_0x7065('0x4d')](_0x27fe83);}})[_0x7065('0x23')](function(_0x51bee3){if(_0x51bee3){return _0x51bee3?{'count':_0x4fb8ef,'rows':_0x51bee3}:null;}})[_0x7065('0x23')](respondWithResult(_0x40d103,null))['catch'](handleError(_0x40d103,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 40c7877..ea97555 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 _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x1b528e,_0x5be309){var _0x176f6f=function(_0x4c810b){while(--_0x4c810b){_0x1b528e['push'](_0x1b528e['shift']());}};_0x176f6f(++_0x5be309);}(_0x84ab,0x12f));var _0xb84a=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0x84ab[_0x3877c1];return _0x59056a;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0xcb9553,_0x44e01c){var _0x5f0b7d=function(_0x50bcad){while(--_0x50bcad){_0xcb9553['push'](_0xcb9553['shift']());}};_0x5f0b7d(++_0x44e01c);}(_0xedd9,0xfc));var _0x9edd=function(_0x19ef9c,_0x1965d6){_0x19ef9c=_0x19ef9c-0x0;var _0x1fa6df=_0xedd9[_0x19ef9c];return _0x1fa6df;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 8aad385..78ec5eb 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 _0x2fe2=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x203b83,_0x4671f6){var _0x3725c6=function(_0xc6a169){while(--_0xc6a169){_0x203b83['push'](_0x203b83['shift']());}};_0x3725c6(++_0x4671f6);}(_0x2fe2,0xd8));var _0x22fe=function(_0xe89c08,_0x48cb9d){_0xe89c08=_0xe89c08-0x0;var _0x16738e=_0x2fe2[_0xe89c08];return _0x16738e;};'use strict';var _=require('lodash');var util=require(_0x22fe('0x0'));var moment=require(_0x22fe('0x1'));var BPromise=require(_0x22fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22fe('0x3'));var db=require(_0x22fe('0x4'))['db'];var utils=require(_0x22fe('0x5'));var logger=require(_0x22fe('0x6'))(_0x22fe('0x7'));var config=require('../../config/environment');var jayson=require(_0x22fe('0x8'));var client=jayson['client'][_0x22fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59e38d,_0x2ab082,_0x53ccaf){return new BPromise(function(_0x12865e,_0xbe4dd0){return client[_0x22fe('0xa')](_0x59e38d,_0x53ccaf)[_0x22fe('0xb')](function(_0x53c470){logger[_0x22fe('0xc')](_0x22fe('0xd'),_0x2ab082,_0x22fe('0xe'));logger[_0x22fe('0xf')](_0x22fe('0x10'),_0x2ab082,_0x22fe('0xe'),JSON[_0x22fe('0x11')](_0x53c470));if(_0x53c470['error']){if(_0x53c470[_0x22fe('0x12')][_0x22fe('0x13')]===0x1f4){logger[_0x22fe('0x12')](_0x22fe('0xd'),_0x2ab082,_0x53c470[_0x22fe('0x12')][_0x22fe('0x14')]);return _0xbe4dd0(_0x53c470[_0x22fe('0x12')][_0x22fe('0x14')]);}logger['error'](_0x22fe('0xd'),_0x2ab082,_0x53c470[_0x22fe('0x12')][_0x22fe('0x14')]);return _0x12865e(_0x53c470[_0x22fe('0x12')][_0x22fe('0x14')]);}else{logger[_0x22fe('0xc')](_0x22fe('0xd'),_0x2ab082,'request\x20sent');_0x12865e(_0x53c470[_0x22fe('0x15')][_0x22fe('0x14')]);}})[_0x22fe('0x16')](function(_0x1f6403){logger[_0x22fe('0x12')](_0x22fe('0xd'),_0x2ab082,_0x1f6403);_0xbe4dd0(_0x1f6403);});});} \ No newline at end of file +var _0x22d7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x32bd25,_0x5a449a){var _0x27a2e7=function(_0x2581f6){while(--_0x2581f6){_0x32bd25['push'](_0x32bd25['shift']());}};_0x27a2e7(++_0x5a449a);}(_0x22d7,0x15b));var _0x722d=function(_0x25e995,_0x143cdc){_0x25e995=_0x25e995-0x0;var _0x446a58=_0x22d7[_0x25e995];return _0x446a58;};'use strict';var _=require(_0x722d('0x0'));var util=require(_0x722d('0x1'));var moment=require('moment');var BPromise=require(_0x722d('0x2'));var rs=require(_0x722d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x722d('0x4'))['db'];var utils=require(_0x722d('0x5'));var logger=require(_0x722d('0x6'))(_0x722d('0x7'));var config=require(_0x722d('0x8'));var jayson=require(_0x722d('0x9'));var client=jayson[_0x722d('0xa')][_0x722d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2725c2,_0x36fd39,_0x16591d){return new BPromise(function(_0x20150b,_0x728b7e){return client[_0x722d('0xc')](_0x2725c2,_0x16591d)['then'](function(_0x28b791){logger[_0x722d('0xd')](_0x722d('0xe'),_0x36fd39,_0x722d('0xf'));logger[_0x722d('0x10')](_0x722d('0x11'),_0x36fd39,_0x722d('0xf'),JSON['stringify'](_0x28b791));if(_0x28b791[_0x722d('0x12')]){if(_0x28b791[_0x722d('0x12')][_0x722d('0x13')]===0x1f4){logger[_0x722d('0x12')](_0x722d('0xe'),_0x36fd39,_0x28b791[_0x722d('0x12')]['message']);return _0x728b7e(_0x28b791['error'][_0x722d('0x14')]);}logger['error'](_0x722d('0xe'),_0x36fd39,_0x28b791[_0x722d('0x12')][_0x722d('0x14')]);return _0x20150b(_0x28b791[_0x722d('0x12')][_0x722d('0x14')]);}else{logger[_0x722d('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x36fd39,_0x722d('0xf'));_0x20150b(_0x28b791['result'][_0x722d('0x14')]);}})[_0x722d('0x15')](function(_0x524a2d){logger['error'](_0x722d('0xe'),_0x36fd39,_0x524a2d);_0x728b7e(_0x524a2d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 3479e51..4625a22 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 _0x48f2=['./intDynamics365Field.controller','get','index','isAuthenticated','create','put','update','delete','/:id','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service'];(function(_0x2ccbd1,_0x5da465){var _0x101d73=function(_0x55a901){while(--_0x55a901){_0x2ccbd1['push'](_0x2ccbd1['shift']());}};_0x101d73(++_0x5da465);}(_0x48f2,0x16b));var _0x248f=function(_0x207177,_0x5d450c){_0x207177=_0x207177-0x0;var _0x1ed60c=_0x48f2[_0x207177];return _0x1ed60c;};'use strict';var multer=require(_0x248f('0x0'));var util=require('util');var path=require(_0x248f('0x1'));var timeout=require('connect-timeout');var express=require(_0x248f('0x2'));var router=express['Router']();var fs_extra=require(_0x248f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x248f('0x4'));var config=require('../../config/environment');var controller=require(_0x248f('0x5'));router[_0x248f('0x6')]('/',auth['isAuthenticated'](),controller[_0x248f('0x7')]);router['get']('/:id',auth[_0x248f('0x8')](),controller['show']);router['post']('/',auth[_0x248f('0x8')](),controller[_0x248f('0x9')]);router[_0x248f('0xa')]('/:id',auth[_0x248f('0x8')](),controller[_0x248f('0xb')]);router[_0x248f('0xc')](_0x248f('0xd'),auth[_0x248f('0x8')](),controller[_0x248f('0xe')]);module[_0x248f('0xf')]=router; \ No newline at end of file +var _0xe420=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5e7fe0,_0x48f825){var _0x4a38d6=function(_0x1d5a28){while(--_0x1d5a28){_0x5e7fe0['push'](_0x5e7fe0['shift']());}};_0x4a38d6(++_0x48f825);}(_0xe420,0x1c8));var _0x0e42=function(_0x245455,_0x3334ad){_0x245455=_0x245455-0x0;var _0x46264b=_0xe420[_0x245455];return _0x46264b;};'use strict';var multer=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var path=require(_0x0e42('0x2'));var timeout=require(_0x0e42('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0e42('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e42('0x5'));var config=require(_0x0e42('0x6'));var controller=require(_0x0e42('0x7'));router[_0x0e42('0x8')]('/',auth[_0x0e42('0x9')](),controller[_0x0e42('0xa')]);router[_0x0e42('0x8')](_0x0e42('0xb'),auth[_0x0e42('0x9')](),controller[_0x0e42('0xc')]);router[_0x0e42('0xd')]('/',auth[_0x0e42('0x9')](),controller[_0x0e42('0xe')]);router[_0x0e42('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0e42('0x10')]);router[_0x0e42('0x11')](_0x0e42('0xb'),auth[_0x0e42('0x9')](),controller[_0x0e42('0x12')]);module[_0x0e42('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 4566f9b..34b4ff7 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 _0x9fa4=['keyValue','picklist','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x2c523a,_0x5ac80f){var _0x3334ca=function(_0x48c686){while(--_0x48c686){_0x2c523a['push'](_0x2c523a['shift']());}};_0x3334ca(++_0x5ac80f);}(_0x9fa4,0x145));var _0x49fa=function(_0x23c2ed,_0x4ad287){_0x23c2ed=_0x23c2ed-0x0;var _0x4315c3=_0x9fa4[_0x23c2ed];return _0x4315c3;};'use strict';var Sequelize=require(_0x49fa('0x0'));module[_0x49fa('0x1')]={'type':{'type':Sequelize[_0x49fa('0x2')]('string',_0x49fa('0x3'),_0x49fa('0x4'),_0x49fa('0x5'),_0x49fa('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x49fa('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x49fa('0x2')](_0x49fa('0x8'),_0x49fa('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x49fa('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x49fa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49fa('0x7')]}}; \ No newline at end of file +var _0xe301=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe301,0x18a));var _0x1e30=function(_0x2506d6,_0x4a8e7e){_0x2506d6=_0x2506d6-0x0;var _0x2907ae=_0xe301[_0x2506d6];return _0x2907ae;};'use strict';var Sequelize=require(_0x1e30('0x0'));module[_0x1e30('0x1')]={'type':{'type':Sequelize[_0x1e30('0x2')](_0x1e30('0x3'),_0x1e30('0x4'),_0x1e30('0x5'),_0x1e30('0x6'),'picklist'),'defaultValue':_0x1e30('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x1e30('0x3'),_0x1e30('0x4'),_0x1e30('0x5'))},'keyContent':{'type':Sequelize[_0x1e30('0x7')]},'idField':{'type':Sequelize[_0x1e30('0x7')]},'nameField':{'type':Sequelize[_0x1e30('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e30('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 285efaf..ea74b41 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 _0xd131=['json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','Dynamics365Field','findAll','show','params','include','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2e700a,_0x5585a2){var _0x31e0f8=function(_0x4a1187){while(--_0x4a1187){_0x2e700a['push'](_0x2e700a['shift']());}};_0x31e0f8(++_0x5585a2);}(_0xd131,0x15a));var _0x1d13=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0xd131[_0xb6e2ea];return _0x2a57bb;};'use strict';var emlformat=require(_0x1d13('0x0'));var rimraf=require(_0x1d13('0x1'));var zipdir=require(_0x1d13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d13('0x3'));var BPromise=require(_0x1d13('0x4'));var Mustache=require('mustache');var util=require(_0x1d13('0x5'));var path=require(_0x1d13('0x6'));var sox=require(_0x1d13('0x7'));var csv=require(_0x1d13('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d13('0x9'));var _=require(_0x1d13('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1d13('0xb'));var deskjs=require(_0x1d13('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d13('0xd'));var Redis=require(_0x1d13('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1d13('0xf'));var as=require(_0x1d13('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d13('0x11'))(_0x1d13('0x12'));var utils=require(_0x1d13('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1d13('0x14'));var db=require(_0x1d13('0x15'))['db'];function respondWithStatusCode(_0x3c16bf,_0x2d1987){_0x2d1987=_0x2d1987||0xcc;return function(_0x1f9022){if(_0x1f9022){return _0x3c16bf[_0x1d13('0x16')](_0x2d1987);}return _0x3c16bf[_0x1d13('0x17')](_0x2d1987)['end']();};}function respondWithResult(_0x104743,_0x26e34f){_0x26e34f=_0x26e34f||0xc8;return function(_0x3ca241){if(_0x3ca241){return _0x104743[_0x1d13('0x17')](_0x26e34f)[_0x1d13('0x18')](_0x3ca241);}};}function respondWithFilteredResult(_0x558c78,_0x2bae03){return function(_0xb26453){if(_0xb26453){var _0xb34f7d=typeof _0x2bae03['offset']==='undefined'&&typeof _0x2bae03['limit']===_0x1d13('0x19');var _0x312b72=_0xb26453[_0x1d13('0x1a')];var _0x2602a2=_0xb34f7d?0x0:_0x2bae03[_0x1d13('0x1b')];var _0xf3c1af=_0xb34f7d?_0xb26453['count']:_0x2bae03[_0x1d13('0x1b')]+_0x2bae03[_0x1d13('0x1c')];var _0x3aad01;if(_0xf3c1af>=_0x312b72){_0xf3c1af=_0x312b72;_0x3aad01=0xc8;}else{_0x3aad01=0xce;}_0x558c78[_0x1d13('0x17')](_0x3aad01);return _0x558c78[_0x1d13('0x1d')]('Content-Range',_0x2602a2+'-'+_0xf3c1af+'/'+_0x312b72)[_0x1d13('0x18')](_0xb26453);}return null;};}function patchUpdates(_0xdef15c){return function(_0x4c626a){try{jsonpatch[_0x1d13('0x1e')](_0x4c626a,_0xdef15c,!![]);}catch(_0x1718ac){return BPromise[_0x1d13('0x1f')](_0x1718ac);}return _0x4c626a[_0x1d13('0x20')]();};}function saveUpdates(_0x5c8adf,_0x3d874f){return function(_0xe1c12f){if(_0xe1c12f){return _0xe1c12f['update'](_0x5c8adf)[_0x1d13('0x21')](function(_0x175f75){return _0x175f75;});}return null;};}function removeEntity(_0x22a28d,_0x311722){return function(_0x332dfe){if(_0x332dfe){return _0x332dfe[_0x1d13('0x22')]()[_0x1d13('0x21')](function(){_0x22a28d[_0x1d13('0x17')](0xcc)[_0x1d13('0x23')]();});}};}function handleEntityNotFound(_0x5878b7,_0xe9d5e){return function(_0x44ab40){if(!_0x44ab40){_0x5878b7[_0x1d13('0x16')](0x194);}return _0x44ab40;};}function handleError(_0x34d885,_0x4995ed){_0x4995ed=_0x4995ed||0x1f4;return function(_0x55889c){logger[_0x1d13('0x24')](_0x55889c[_0x1d13('0x25')]);if(_0x55889c['name']){delete _0x55889c[_0x1d13('0x26')];}_0x34d885[_0x1d13('0x17')](_0x4995ed)[_0x1d13('0x27')](_0x55889c);};}exports[_0x1d13('0x28')]=function(_0x60a631,_0xa51865){var _0x3cf2e6={},_0x4d2048={},_0x38b5b0={'count':0x0,'rows':[]};var _0x76c4e8=_[_0x1d13('0x29')](db['Dynamics365Field'][_0x1d13('0x2a')],function(_0x296b7e){return{'name':_0x296b7e[_0x1d13('0x2b')],'type':_0x296b7e[_0x1d13('0x2c')][_0x1d13('0x2d')]};});_0x4d2048['model']=_['map'](_0x76c4e8,_0x1d13('0x26'));_0x4d2048['query']=_[_0x1d13('0x2e')](_0x60a631['query']);_0x4d2048[_0x1d13('0x2f')]=_['intersection'](_0x4d2048['model'],_0x4d2048[_0x1d13('0x30')]);_0x3cf2e6['attributes']=_[_0x1d13('0x31')](_0x4d2048[_0x1d13('0x32')],qs[_0x1d13('0x33')](_0x60a631['query']['fields']));_0x3cf2e6[_0x1d13('0x34')]=_0x3cf2e6['attributes'][_0x1d13('0x35')]?_0x3cf2e6[_0x1d13('0x34')]:_0x4d2048[_0x1d13('0x32')];if(!_0x60a631[_0x1d13('0x30')][_0x1d13('0x36')]('nolimit')){_0x3cf2e6[_0x1d13('0x1c')]=qs['limit'](_0x60a631[_0x1d13('0x30')][_0x1d13('0x1c')]);_0x3cf2e6['offset']=qs[_0x1d13('0x1b')](_0x60a631[_0x1d13('0x30')]['offset']);}_0x3cf2e6[_0x1d13('0x37')]=qs[_0x1d13('0x38')](_0x60a631['query'][_0x1d13('0x38')]);_0x3cf2e6[_0x1d13('0x39')]=qs[_0x1d13('0x2f')](_[_0x1d13('0x3a')](_0x60a631[_0x1d13('0x30')],_0x4d2048[_0x1d13('0x2f')]),_0x76c4e8);if(_0x60a631[_0x1d13('0x30')][_0x1d13('0x3b')]){_0x3cf2e6[_0x1d13('0x39')]=_[_0x1d13('0x3c')](_0x3cf2e6[_0x1d13('0x39')],{'$or':_[_0x1d13('0x29')](_0x76c4e8,function(_0x57c4cb){if(_0x57c4cb['type']!==_0x1d13('0x3d')){var _0x3d966c={};_0x3d966c[_0x57c4cb[_0x1d13('0x26')]]={'$like':'%'+_0x60a631[_0x1d13('0x30')][_0x1d13('0x3b')]+'%'};return _0x3d966c;}})});}_0x3cf2e6=_[_0x1d13('0x3c')]({},_0x3cf2e6,_0x60a631['options']);var _0xd9cc93={'where':_0x3cf2e6[_0x1d13('0x39')]};return db['Dynamics365Field'][_0x1d13('0x1a')](_0xd9cc93)[_0x1d13('0x21')](function(_0x13bfcb){_0x38b5b0[_0x1d13('0x1a')]=_0x13bfcb;if(_0x60a631[_0x1d13('0x30')][_0x1d13('0x3e')]){_0x3cf2e6['include']=[{'all':!![]}];}return db[_0x1d13('0x3f')][_0x1d13('0x40')](_0x3cf2e6);})[_0x1d13('0x21')](function(_0x3a1ef9){_0x38b5b0['rows']=_0x3a1ef9;return _0x38b5b0;})[_0x1d13('0x21')](respondWithFilteredResult(_0xa51865,_0x3cf2e6))['catch'](handleError(_0xa51865,null));};exports[_0x1d13('0x41')]=function(_0x46e480,_0x395d0c){var _0x72c548={'raw':!![],'where':{'id':_0x46e480[_0x1d13('0x42')]['id']}},_0x36a1f9={};_0x36a1f9[_0x1d13('0x32')]=_[_0x1d13('0x2e')](db[_0x1d13('0x3f')]['rawAttributes']);_0x36a1f9[_0x1d13('0x30')]=_[_0x1d13('0x2e')](_0x46e480[_0x1d13('0x30')]);_0x36a1f9['filters']=_[_0x1d13('0x31')](_0x36a1f9['model'],_0x36a1f9[_0x1d13('0x30')]);_0x72c548[_0x1d13('0x34')]=_[_0x1d13('0x31')](_0x36a1f9['model'],qs[_0x1d13('0x33')](_0x46e480[_0x1d13('0x30')][_0x1d13('0x33')]));_0x72c548[_0x1d13('0x34')]=_0x72c548[_0x1d13('0x34')][_0x1d13('0x35')]?_0x72c548[_0x1d13('0x34')]:_0x36a1f9[_0x1d13('0x32')];if(_0x46e480[_0x1d13('0x30')][_0x1d13('0x3e')]){_0x72c548[_0x1d13('0x43')]=[{'all':!![]}];}_0x72c548=_[_0x1d13('0x3c')]({},_0x72c548,_0x46e480[_0x1d13('0x44')]);return db[_0x1d13('0x3f')][_0x1d13('0x45')](_0x72c548)[_0x1d13('0x21')](handleEntityNotFound(_0x395d0c,null))['then'](respondWithResult(_0x395d0c,null))[_0x1d13('0x46')](handleError(_0x395d0c,null));};exports[_0x1d13('0x47')]=function(_0x3366de,_0x20a138){return db[_0x1d13('0x3f')][_0x1d13('0x47')](_0x3366de[_0x1d13('0x48')],{})[_0x1d13('0x21')](respondWithResult(_0x20a138,0xc9))[_0x1d13('0x46')](handleError(_0x20a138,null));};exports[_0x1d13('0x49')]=function(_0x25bf3b,_0x1bb600){if(_0x25bf3b[_0x1d13('0x48')]['id']){delete _0x25bf3b['body']['id'];}return db['Dynamics365Field'][_0x1d13('0x45')]({'where':{'id':_0x25bf3b[_0x1d13('0x42')]['id']}})[_0x1d13('0x21')](handleEntityNotFound(_0x1bb600,null))['then'](saveUpdates(_0x25bf3b[_0x1d13('0x48')],null))['then'](respondWithResult(_0x1bb600,null))[_0x1d13('0x46')](handleError(_0x1bb600,null));};exports['destroy']=function(_0x5a98df,_0x3f12b3){return db[_0x1d13('0x3f')][_0x1d13('0x45')]({'where':{'id':_0x5a98df[_0x1d13('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f12b3,null))[_0x1d13('0x21')](removeEntity(_0x3f12b3,null))[_0x1d13('0x46')](handleError(_0x3f12b3,null));}; \ No newline at end of file +var _0xed6e=['status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','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'];(function(_0x4ff138,_0x3b736d){var _0x3856b0=function(_0x59f0bb){while(--_0x59f0bb){_0x4ff138['push'](_0x4ff138['shift']());}};_0x3856b0(++_0x3b736d);}(_0xed6e,0xc7));var _0xeed6=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xed6e[_0x9cfe28];return _0x54a1d0;};'use strict';var emlformat=require(_0xeed6('0x0'));var rimraf=require(_0xeed6('0x1'));var zipdir=require(_0xeed6('0x2'));var jsonpatch=require(_0xeed6('0x3'));var rp=require(_0xeed6('0x4'));var moment=require('moment');var BPromise=require(_0xeed6('0x5'));var Mustache=require('mustache');var util=require(_0xeed6('0x6'));var path=require(_0xeed6('0x7'));var sox=require(_0xeed6('0x8'));var csv=require(_0xeed6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeed6('0xa'));var crypto=require('crypto');var jsforce=require(_0xeed6('0xb'));var deskjs=require(_0xeed6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeed6('0xd'));var Papa=require(_0xeed6('0xe'));var Redis=require(_0xeed6('0xf'));var authService=require(_0xeed6('0x10'));var qs=require(_0xeed6('0x11'));var as=require(_0xeed6('0x12'));var hardwareService=require(_0xeed6('0x13'));var logger=require(_0xeed6('0x14'))(_0xeed6('0x15'));var utils=require(_0xeed6('0x16'));var config=require(_0xeed6('0x17'));var licenseUtil=require(_0xeed6('0x18'));var db=require(_0xeed6('0x19'))['db'];function respondWithStatusCode(_0x49570d,_0x381bc2){_0x381bc2=_0x381bc2||0xcc;return function(_0x13089c){if(_0x13089c){return _0x49570d['sendStatus'](_0x381bc2);}return _0x49570d[_0xeed6('0x1a')](_0x381bc2)['end']();};}function respondWithResult(_0x70dfe,_0x458495){_0x458495=_0x458495||0xc8;return function(_0x3ab3f2){if(_0x3ab3f2){return _0x70dfe[_0xeed6('0x1a')](_0x458495)[_0xeed6('0x1b')](_0x3ab3f2);}};}function respondWithFilteredResult(_0x1c0048,_0x25abe4){return function(_0x3a5c9c){if(_0x3a5c9c){var _0x3294cc=typeof _0x25abe4['offset']===_0xeed6('0x1c')&&typeof _0x25abe4[_0xeed6('0x1d')]===_0xeed6('0x1c');var _0x4b5e60=_0x3a5c9c[_0xeed6('0x1e')];var _0x253e8b=_0x3294cc?0x0:_0x25abe4['offset'];var _0x5948a2=_0x3294cc?_0x3a5c9c[_0xeed6('0x1e')]:_0x25abe4[_0xeed6('0x1f')]+_0x25abe4[_0xeed6('0x1d')];var _0x153a8c;if(_0x5948a2>=_0x4b5e60){_0x5948a2=_0x4b5e60;_0x153a8c=0xc8;}else{_0x153a8c=0xce;}_0x1c0048[_0xeed6('0x1a')](_0x153a8c);return _0x1c0048['set']('Content-Range',_0x253e8b+'-'+_0x5948a2+'/'+_0x4b5e60)[_0xeed6('0x1b')](_0x3a5c9c);}return null;};}function patchUpdates(_0x11988d){return function(_0x2b5cfc){try{jsonpatch[_0xeed6('0x20')](_0x2b5cfc,_0x11988d,!![]);}catch(_0x54dbf0){return BPromise[_0xeed6('0x21')](_0x54dbf0);}return _0x2b5cfc[_0xeed6('0x22')]();};}function saveUpdates(_0x33dd70,_0x4e821c){return function(_0x4b0078){if(_0x4b0078){return _0x4b0078[_0xeed6('0x23')](_0x33dd70)[_0xeed6('0x24')](function(_0x5868ee){return _0x5868ee;});}return null;};}function removeEntity(_0x65191f,_0x207793){return function(_0x50cafa){if(_0x50cafa){return _0x50cafa[_0xeed6('0x25')]()[_0xeed6('0x24')](function(){_0x65191f[_0xeed6('0x1a')](0xcc)[_0xeed6('0x26')]();});}};}function handleEntityNotFound(_0x1dff62,_0x2cc7db){return function(_0x2ee380){if(!_0x2ee380){_0x1dff62[_0xeed6('0x27')](0x194);}return _0x2ee380;};}function handleError(_0x4b1aaa,_0xb951d7){_0xb951d7=_0xb951d7||0x1f4;return function(_0xb06bc4){logger[_0xeed6('0x28')](_0xb06bc4[_0xeed6('0x29')]);if(_0xb06bc4[_0xeed6('0x2a')]){delete _0xb06bc4['name'];}_0x4b1aaa[_0xeed6('0x1a')](_0xb951d7)[_0xeed6('0x2b')](_0xb06bc4);};}exports[_0xeed6('0x2c')]=function(_0x3e7823,_0x5bbcce){var _0x4936e2={},_0x2f15f7={},_0x135d24={'count':0x0,'rows':[]};var _0xec04d5=_[_0xeed6('0x2d')](db[_0xeed6('0x2e')][_0xeed6('0x2f')],function(_0x4cc585){return{'name':_0x4cc585[_0xeed6('0x30')],'type':_0x4cc585['type'][_0xeed6('0x31')]};});_0x2f15f7[_0xeed6('0x32')]=_[_0xeed6('0x2d')](_0xec04d5,_0xeed6('0x2a'));_0x2f15f7['query']=_[_0xeed6('0x33')](_0x3e7823['query']);_0x2f15f7[_0xeed6('0x34')]=_['intersection'](_0x2f15f7[_0xeed6('0x32')],_0x2f15f7[_0xeed6('0x35')]);_0x4936e2[_0xeed6('0x36')]=_[_0xeed6('0x37')](_0x2f15f7[_0xeed6('0x32')],qs[_0xeed6('0x38')](_0x3e7823['query'][_0xeed6('0x38')]));_0x4936e2[_0xeed6('0x36')]=_0x4936e2[_0xeed6('0x36')][_0xeed6('0x39')]?_0x4936e2['attributes']:_0x2f15f7[_0xeed6('0x32')];if(!_0x3e7823[_0xeed6('0x35')]['hasOwnProperty']('nolimit')){_0x4936e2['limit']=qs[_0xeed6('0x1d')](_0x3e7823[_0xeed6('0x35')][_0xeed6('0x1d')]);_0x4936e2[_0xeed6('0x1f')]=qs[_0xeed6('0x1f')](_0x3e7823[_0xeed6('0x35')][_0xeed6('0x1f')]);}_0x4936e2[_0xeed6('0x3a')]=qs[_0xeed6('0x3b')](_0x3e7823[_0xeed6('0x35')][_0xeed6('0x3b')]);_0x4936e2[_0xeed6('0x3c')]=qs[_0xeed6('0x34')](_[_0xeed6('0x3d')](_0x3e7823[_0xeed6('0x35')],_0x2f15f7[_0xeed6('0x34')]),_0xec04d5);if(_0x3e7823[_0xeed6('0x35')][_0xeed6('0x3e')]){_0x4936e2[_0xeed6('0x3c')]=_[_0xeed6('0x3f')](_0x4936e2[_0xeed6('0x3c')],{'$or':_[_0xeed6('0x2d')](_0xec04d5,function(_0x4c6790){if(_0x4c6790['type']!==_0xeed6('0x40')){var _0x3d487b={};_0x3d487b[_0x4c6790[_0xeed6('0x2a')]]={'$like':'%'+_0x3e7823['query'][_0xeed6('0x3e')]+'%'};return _0x3d487b;}})});}_0x4936e2=_[_0xeed6('0x3f')]({},_0x4936e2,_0x3e7823[_0xeed6('0x41')]);var _0xfe5c80={'where':_0x4936e2['where']};return db['Dynamics365Field'][_0xeed6('0x1e')](_0xfe5c80)['then'](function(_0x23ca86){_0x135d24[_0xeed6('0x1e')]=_0x23ca86;if(_0x3e7823[_0xeed6('0x35')]['includeAll']){_0x4936e2[_0xeed6('0x42')]=[{'all':!![]}];}return db[_0xeed6('0x2e')][_0xeed6('0x43')](_0x4936e2);})[_0xeed6('0x24')](function(_0xd828c7){_0x135d24['rows']=_0xd828c7;return _0x135d24;})[_0xeed6('0x24')](respondWithFilteredResult(_0x5bbcce,_0x4936e2))['catch'](handleError(_0x5bbcce,null));};exports[_0xeed6('0x44')]=function(_0x2caa09,_0x2c58d1){var _0x2fa0f5={'raw':!![],'where':{'id':_0x2caa09['params']['id']}},_0xabbd8b={};_0xabbd8b[_0xeed6('0x32')]=_[_0xeed6('0x33')](db[_0xeed6('0x2e')][_0xeed6('0x2f')]);_0xabbd8b[_0xeed6('0x35')]=_[_0xeed6('0x33')](_0x2caa09['query']);_0xabbd8b[_0xeed6('0x34')]=_[_0xeed6('0x37')](_0xabbd8b[_0xeed6('0x32')],_0xabbd8b[_0xeed6('0x35')]);_0x2fa0f5[_0xeed6('0x36')]=_[_0xeed6('0x37')](_0xabbd8b['model'],qs[_0xeed6('0x38')](_0x2caa09[_0xeed6('0x35')]['fields']));_0x2fa0f5[_0xeed6('0x36')]=_0x2fa0f5[_0xeed6('0x36')][_0xeed6('0x39')]?_0x2fa0f5[_0xeed6('0x36')]:_0xabbd8b[_0xeed6('0x32')];if(_0x2caa09[_0xeed6('0x35')][_0xeed6('0x45')]){_0x2fa0f5[_0xeed6('0x42')]=[{'all':!![]}];}_0x2fa0f5=_[_0xeed6('0x3f')]({},_0x2fa0f5,_0x2caa09[_0xeed6('0x41')]);return db[_0xeed6('0x2e')][_0xeed6('0x46')](_0x2fa0f5)['then'](handleEntityNotFound(_0x2c58d1,null))['then'](respondWithResult(_0x2c58d1,null))[_0xeed6('0x47')](handleError(_0x2c58d1,null));};exports[_0xeed6('0x48')]=function(_0xc8f0d1,_0x1070df){return db['Dynamics365Field']['create'](_0xc8f0d1[_0xeed6('0x49')],{})[_0xeed6('0x24')](respondWithResult(_0x1070df,0xc9))[_0xeed6('0x47')](handleError(_0x1070df,null));};exports[_0xeed6('0x23')]=function(_0x13bd7d,_0x1cfb42){if(_0x13bd7d[_0xeed6('0x49')]['id']){delete _0x13bd7d[_0xeed6('0x49')]['id'];}return db[_0xeed6('0x2e')][_0xeed6('0x46')]({'where':{'id':_0x13bd7d[_0xeed6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1cfb42,null))[_0xeed6('0x24')](saveUpdates(_0x13bd7d['body'],null))[_0xeed6('0x24')](respondWithResult(_0x1cfb42,null))[_0xeed6('0x47')](handleError(_0x1cfb42,null));};exports[_0xeed6('0x25')]=function(_0x557450,_0x23d8b7){return db[_0xeed6('0x2e')][_0xeed6('0x46')]({'where':{'id':_0x557450[_0xeed6('0x4a')]['id']}})[_0xeed6('0x24')](handleEntityNotFound(_0x23d8b7,null))['then'](removeEntity(_0x23d8b7,null))[_0xeed6('0x47')](handleError(_0x23d8b7,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 11d539f..dcd74b8 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 _0xab40=['rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','../../config/logger','bluebird'];(function(_0x101b9a,_0x3bf5e2){var _0x2c1453=function(_0x3cc722){while(--_0x3cc722){_0x101b9a['push'](_0x101b9a['shift']());}};_0x2c1453(++_0x3bf5e2);}(_0xab40,0x6c));var _0x0ab4=function(_0x39947b,_0x3d690b){_0x39947b=_0x39947b-0x0;var _0x1b3a24=_0xab40[_0x39947b];return _0x1b3a24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ab4('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0ab4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ab4('0x2'));var config=require('../../config/environment');var attributes=require(_0x0ab4('0x3'));module[_0x0ab4('0x4')]=function(_0x2cba19,_0x18fa3a){return _0x2cba19[_0x0ab4('0x5')](_0x0ab4('0x6'),attributes,{'tableName':_0x0ab4('0x7'),'paranoid':![],'indexes':[{'name':_0x0ab4('0x8'),'fields':[_0x0ab4('0x9'),_0x0ab4('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e84=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x6e84,0x106));var _0x46e8=function(_0x3f6058,_0x32581e){_0x3f6058=_0x3f6058-0x0;var _0x591256=_0x6e84[_0x3f6058];return _0x591256;};'use strict';var _=require(_0x46e8('0x0'));var util=require(_0x46e8('0x1'));var logger=require('../../config/logger')(_0x46e8('0x2'));var moment=require(_0x46e8('0x3'));var BPromise=require(_0x46e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46e8('0x5'));var rimraf=require(_0x46e8('0x6'));var config=require(_0x46e8('0x7'));var attributes=require(_0x46e8('0x8'));module[_0x46e8('0x9')]=function(_0x5ee6d6,_0x1168ec){return _0x5ee6d6[_0x46e8('0xa')](_0x46e8('0xb'),attributes,{'tableName':_0x46e8('0xc'),'paranoid':![],'indexes':[{'name':_0x46e8('0xd'),'fields':[_0x46e8('0xe'),_0x46e8('0xf')],'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 850c66d..70b0cb6 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 _0x8c1e=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Field,\x20%s,\x20%s'];(function(_0x5593aa,_0x2b9791){var _0x30d201=function(_0x5580bc){while(--_0x5580bc){_0x5593aa['push'](_0x5593aa['shift']());}};_0x30d201(++_0x2b9791);}(_0x8c1e,0xde));var _0xe8c1=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x8c1e[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0xe8c1('0x0'));var util=require('util');var moment=require(_0xe8c1('0x1'));var BPromise=require(_0xe8c1('0x2'));var rs=require(_0xe8c1('0x3'));var fs=require('fs');var Redis=require(_0xe8c1('0x4'));var db=require(_0xe8c1('0x5'))['db'];var utils=require(_0xe8c1('0x6'));var logger=require('../../config/logger')(_0xe8c1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe8c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7826a,_0x2b562b,_0x573677){return new BPromise(function(_0x45cf47,_0x2b5d54){return client[_0xe8c1('0x9')](_0x7826a,_0x573677)[_0xe8c1('0xa')](function(_0x45ce17){logger[_0xe8c1('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x2b562b,_0xe8c1('0xc'));logger[_0xe8c1('0xd')](_0xe8c1('0xe'),_0x2b562b,_0xe8c1('0xc'),JSON['stringify'](_0x45ce17));if(_0x45ce17[_0xe8c1('0xf')]){if(_0x45ce17[_0xe8c1('0xf')][_0xe8c1('0x10')]===0x1f4){logger['error'](_0xe8c1('0x11'),_0x2b562b,_0x45ce17['error'][_0xe8c1('0x12')]);return _0x2b5d54(_0x45ce17[_0xe8c1('0xf')][_0xe8c1('0x12')]);}logger[_0xe8c1('0xf')](_0xe8c1('0x11'),_0x2b562b,_0x45ce17[_0xe8c1('0xf')][_0xe8c1('0x12')]);return _0x45cf47(_0x45ce17[_0xe8c1('0xf')]['message']);}else{logger[_0xe8c1('0xb')](_0xe8c1('0x11'),_0x2b562b,'request\x20sent');_0x45cf47(_0x45ce17[_0xe8c1('0x13')][_0xe8c1('0x12')]);}})['catch'](function(_0x584b48){logger['error'](_0xe8c1('0x11'),_0x2b562b,_0x584b48);_0x2b5d54(_0x584b48);});});} \ No newline at end of file +var _0x5eb7=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x33f614,_0x5242a8){var _0x564db2=function(_0x16d3e0){while(--_0x16d3e0){_0x33f614['push'](_0x33f614['shift']());}};_0x564db2(++_0x5242a8);}(_0x5eb7,0x192));var _0x75eb=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x5eb7[_0x538c70];return _0x42ae01;};'use strict';var _=require('lodash');var util=require(_0x75eb('0x0'));var moment=require(_0x75eb('0x1'));var BPromise=require(_0x75eb('0x2'));var rs=require(_0x75eb('0x3'));var fs=require('fs');var Redis=require(_0x75eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x75eb('0x5'));var jayson=require(_0x75eb('0x6'));var client=jayson['client'][_0x75eb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d64d4,_0x3a4c09,_0x37f919){return new BPromise(function(_0x2bb3f2,_0x2c64b8){return client[_0x75eb('0x8')](_0x4d64d4,_0x37f919)[_0x75eb('0x9')](function(_0x5a9621){logger[_0x75eb('0xa')](_0x75eb('0xb'),_0x3a4c09,'request\x20sent');logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3a4c09,_0x75eb('0xc'),JSON[_0x75eb('0xd')](_0x5a9621));if(_0x5a9621[_0x75eb('0xe')]){if(_0x5a9621['error'][_0x75eb('0xf')]===0x1f4){logger[_0x75eb('0xe')](_0x75eb('0xb'),_0x3a4c09,_0x5a9621['error'][_0x75eb('0x10')]);return _0x2c64b8(_0x5a9621[_0x75eb('0xe')]['message']);}logger[_0x75eb('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x3a4c09,_0x5a9621[_0x75eb('0xe')][_0x75eb('0x10')]);return _0x2bb3f2(_0x5a9621[_0x75eb('0xe')][_0x75eb('0x10')]);}else{logger[_0x75eb('0xa')](_0x75eb('0xb'),_0x3a4c09,_0x75eb('0xc'));_0x2bb3f2(_0x5a9621[_0x75eb('0x11')][_0x75eb('0x10')]);}})[_0x75eb('0x12')](function(_0xf9dd90){logger[_0x75eb('0xe')](_0x75eb('0xb'),_0x3a4c09,_0xf9dd90);_0x2c64b8(_0xf9dd90);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f8387c2..c86cf26 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 _0x035d=['/:id/fields','getFields','/:id/configurations','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations'];(function(_0x3f1d63,_0x1fbfa){var _0x2311d7=function(_0xf7e5f8){while(--_0xf7e5f8){_0x3f1d63['push'](_0x3f1d63['shift']());}};_0x2311d7(++_0x1fbfa);}(_0x035d,0x192));var _0xd035=function(_0x3dc155,_0x4c9429){_0x3dc155=_0x3dc155-0x0;var _0x25613b=_0x035d[_0x3dc155];return _0x25613b;};'use strict';var multer=require(_0xd035('0x0'));var util=require('util');var path=require(_0xd035('0x1'));var timeout=require(_0xd035('0x2'));var express=require(_0xd035('0x3'));var router=express[_0xd035('0x4')]();var fs_extra=require(_0xd035('0x5'));var auth=require(_0xd035('0x6'));var interaction=require(_0xd035('0x7'));var config=require(_0xd035('0x8'));var controller=require(_0xd035('0x9'));router[_0xd035('0xa')]('/',auth['isAuthenticated'](),controller[_0xd035('0xb')]);router['get'](_0xd035('0xc'),auth[_0xd035('0xd')](),controller[_0xd035('0xe')]);router['get']('/:id/configurations',auth[_0xd035('0xd')](),controller[_0xd035('0xf')]);router[_0xd035('0xa')](_0xd035('0x10'),auth[_0xd035('0xd')](),controller[_0xd035('0x11')]);router['post']('/',auth[_0xd035('0xd')](),controller['create']);router['post'](_0xd035('0x12'),auth[_0xd035('0xd')](),controller['addConfiguration']);router['put'](_0xd035('0xc'),auth[_0xd035('0xd')](),controller[_0xd035('0x13')]);router[_0xd035('0x14')](_0xd035('0xc'),auth[_0xd035('0xd')](),controller[_0xd035('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9239=['getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x2bb539,_0x141da3){var _0x545913=function(_0x4fd0b4){while(--_0x4fd0b4){_0x2bb539['push'](_0x2bb539['shift']());}};_0x545913(++_0x141da3);}(_0x9239,0x158));var _0x9923=function(_0x4482a2,_0x2b2a5a){_0x4482a2=_0x4482a2-0x0;var _0x40bc84=_0x9239[_0x4482a2];return _0x40bc84;};'use strict';var multer=require(_0x9923('0x0'));var util=require(_0x9923('0x1'));var path=require('path');var timeout=require(_0x9923('0x2'));var express=require(_0x9923('0x3'));var router=express[_0x9923('0x4')]();var fs_extra=require(_0x9923('0x5'));var auth=require(_0x9923('0x6'));var interaction=require(_0x9923('0x7'));var config=require(_0x9923('0x8'));var controller=require(_0x9923('0x9'));router[_0x9923('0xa')]('/',auth[_0x9923('0xb')](),controller[_0x9923('0xc')]);router['get'](_0x9923('0xd'),auth[_0x9923('0xb')](),controller[_0x9923('0xe')]);router[_0x9923('0xa')](_0x9923('0xf'),auth[_0x9923('0xb')](),controller[_0x9923('0x10')]);router[_0x9923('0xa')](_0x9923('0x11'),auth[_0x9923('0xb')](),controller['getFields']);router[_0x9923('0x12')]('/',auth[_0x9923('0xb')](),controller[_0x9923('0x13')]);router['post'](_0x9923('0xf'),auth[_0x9923('0xb')](),controller[_0x9923('0x14')]);router[_0x9923('0x15')](_0x9923('0xd'),auth[_0x9923('0xb')](),controller['update']);router[_0x9923('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9923('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 515e706..dfdbfc1 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 _0x2032=['remoteUri','exports','STRING','username'];(function(_0x446ab2,_0x4206de){var _0x597d84=function(_0x4cb110){while(--_0x4cb110){_0x446ab2['push'](_0x446ab2['shift']());}};_0x597d84(++_0x4206de);}(_0x2032,0xd9));var _0x2203=function(_0x1c6260,_0xea4f11){_0x1c6260=_0x1c6260-0x0;var _0x4c0d9a=_0x2032[_0x1c6260];return _0x4c0d9a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9536,0x179));var _0x6953=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9536[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 5688af5..218b0a6 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 _0x151b=['default','custom_text','label','choices','capitalize','statusCode','stringify','test','Wrong\x20credentials','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../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','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','channel','Descriptions','type','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','priority','source','remove','includes'];(function(_0x34bf03,_0x7ebc65){var _0x478925=function(_0x46508c){while(--_0x46508c){_0x34bf03['push'](_0x34bf03['shift']());}};_0x478925(++_0x7ebc65);}(_0x151b,0x153));var _0xb151=function(_0x2e57ab,_0x2a8a62){_0x2e57ab=_0x2e57ab-0x0;var _0x6b5c2b=_0x151b[_0x2e57ab];return _0x6b5c2b;};'use strict';var emlformat=require(_0xb151('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb151('0x1'));var rp=require('request-promise');var moment=require(_0xb151('0x2'));var BPromise=require(_0xb151('0x3'));var Mustache=require(_0xb151('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb151('0x5'));var csv=require(_0xb151('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb151('0x7'));var _=require('lodash');var squel=require(_0xb151('0x8'));var crypto=require(_0xb151('0x9'));var jsforce=require(_0xb151('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb151('0xb'));var Papa=require(_0xb151('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb151('0xd'));var as=require(_0xb151('0xe'));var hardwareService=require(_0xb151('0xf'));var logger=require(_0xb151('0x10'))(_0xb151('0x11'));var utils=require(_0xb151('0x12'));var config=require(_0xb151('0x13'));var licenseUtil=require(_0xb151('0x14'));var db=require(_0xb151('0x15'))['db'];var integrations=require(_0xb151('0x16'));function respondWithStatusCode(_0x4e54ca,_0x1ae9b4){_0x1ae9b4=_0x1ae9b4||0xcc;return function(_0x4ac0f0){if(_0x4ac0f0){return _0x4e54ca[_0xb151('0x17')](_0x1ae9b4);}return _0x4e54ca[_0xb151('0x18')](_0x1ae9b4)[_0xb151('0x19')]();};}function respondWithResult(_0xfd071d,_0x4af767){_0x4af767=_0x4af767||0xc8;return function(_0x3bb725){if(_0x3bb725){return _0xfd071d[_0xb151('0x18')](_0x4af767)[_0xb151('0x1a')](_0x3bb725);}};}function respondWithFilteredResult(_0x5b12e5,_0x56ea81){return function(_0x5b2faa){if(_0x5b2faa){var _0x4af1c2=typeof _0x56ea81[_0xb151('0x1b')]==='undefined'&&typeof _0x56ea81[_0xb151('0x1c')]==='undefined';var _0x4eccca=_0x5b2faa[_0xb151('0x1d')];var _0x1d620e=_0x4af1c2?0x0:_0x56ea81[_0xb151('0x1b')];var _0x2ba8bf=_0x4af1c2?_0x5b2faa[_0xb151('0x1d')]:_0x56ea81[_0xb151('0x1b')]+_0x56ea81[_0xb151('0x1c')];var _0x5525fd;if(_0x2ba8bf>=_0x4eccca){_0x2ba8bf=_0x4eccca;_0x5525fd=0xc8;}else{_0x5525fd=0xce;}_0x5b12e5[_0xb151('0x18')](_0x5525fd);return _0x5b12e5[_0xb151('0x1e')]('Content-Range',_0x1d620e+'-'+_0x2ba8bf+'/'+_0x4eccca)[_0xb151('0x1a')](_0x5b2faa);}return null;};}function patchUpdates(_0x22b1cd){return function(_0x1dd369){try{jsonpatch[_0xb151('0x1f')](_0x1dd369,_0x22b1cd,!![]);}catch(_0x2a06c7){return BPromise[_0xb151('0x20')](_0x2a06c7);}return _0x1dd369[_0xb151('0x21')]();};}function saveUpdates(_0x8ab45,_0x49c2e){return function(_0x370110){if(_0x370110){return _0x370110['update'](_0x8ab45)[_0xb151('0x22')](function(_0x23cb48){return _0x23cb48;});}return null;};}function removeEntity(_0x37768a,_0x41c508){return function(_0x724bd7){if(_0x724bd7){return _0x724bd7[_0xb151('0x23')]()[_0xb151('0x22')](function(){_0x37768a[_0xb151('0x18')](0xcc)[_0xb151('0x19')]();});}};}function handleEntityNotFound(_0x55689c,_0x13b3dd){return function(_0x46b235){if(!_0x46b235){_0x55689c[_0xb151('0x17')](0x194);}return _0x46b235;};}function handleError(_0x303479,_0x2d65f8){_0x2d65f8=_0x2d65f8||0x1f4;return function(_0x1c0b04){logger[_0xb151('0x24')](_0x1c0b04[_0xb151('0x25')]);if(_0x1c0b04['name']){delete _0x1c0b04[_0xb151('0x26')];}_0x303479['status'](_0x2d65f8)[_0xb151('0x27')](_0x1c0b04);};}exports[_0xb151('0x28')]=function(_0x5e494c,_0x1faf67){var _0x495847={},_0x277814={},_0x45dc3c={'count':0x0,'rows':[]};var _0x4215b7=_[_0xb151('0x29')](db[_0xb151('0x2a')][_0xb151('0x2b')],function(_0x3d070b){return{'name':_0x3d070b[_0xb151('0x2c')],'type':_0x3d070b['type'][_0xb151('0x2d')]};});_0x277814[_0xb151('0x2e')]=_[_0xb151('0x29')](_0x4215b7,_0xb151('0x26'));_0x277814[_0xb151('0x2f')]=_[_0xb151('0x30')](_0x5e494c[_0xb151('0x2f')]);_0x277814['filters']=_[_0xb151('0x31')](_0x277814[_0xb151('0x2e')],_0x277814[_0xb151('0x2f')]);_0x495847[_0xb151('0x32')]=_[_0xb151('0x31')](_0x277814['model'],qs['fields'](_0x5e494c[_0xb151('0x2f')][_0xb151('0x33')]));_0x495847[_0xb151('0x32')]=_0x495847[_0xb151('0x32')]['length']?_0x495847[_0xb151('0x32')]:_0x277814['model'];if(!_0x5e494c[_0xb151('0x2f')][_0xb151('0x34')](_0xb151('0x35'))){_0x495847[_0xb151('0x1c')]=qs[_0xb151('0x1c')](_0x5e494c[_0xb151('0x2f')][_0xb151('0x1c')]);_0x495847[_0xb151('0x1b')]=qs[_0xb151('0x1b')](_0x5e494c[_0xb151('0x2f')][_0xb151('0x1b')]);}_0x495847['order']=qs[_0xb151('0x36')](_0x5e494c[_0xb151('0x2f')][_0xb151('0x36')]);_0x495847['where']=qs[_0xb151('0x37')](_[_0xb151('0x38')](_0x5e494c[_0xb151('0x2f')],_0x277814[_0xb151('0x37')]),_0x4215b7);if(_0x5e494c[_0xb151('0x2f')][_0xb151('0x39')]){_0x495847[_0xb151('0x3a')]=_[_0xb151('0x3b')](_0x495847[_0xb151('0x3a')],{'$or':_[_0xb151('0x29')](_0x4215b7,function(_0x29d4d8){if(_0x29d4d8['type']!==_0xb151('0x3c')){var _0x4ce704={};_0x4ce704[_0x29d4d8[_0xb151('0x26')]]={'$like':'%'+_0x5e494c[_0xb151('0x2f')][_0xb151('0x39')]+'%'};return _0x4ce704;}})});}_0x495847=_[_0xb151('0x3b')]({},_0x495847,_0x5e494c[_0xb151('0x3d')]);var _0x47035e={'where':_0x495847[_0xb151('0x3a')]};return db['FreshdeskAccount'][_0xb151('0x1d')](_0x47035e)[_0xb151('0x22')](function(_0x135e52){_0x45dc3c[_0xb151('0x1d')]=_0x135e52;if(_0x5e494c[_0xb151('0x2f')][_0xb151('0x3e')]){_0x495847[_0xb151('0x3f')]=[{'all':!![]}];}return db[_0xb151('0x2a')][_0xb151('0x40')](_0x495847);})[_0xb151('0x22')](function(_0x3b4776){_0x45dc3c[_0xb151('0x41')]=_0x3b4776;return _0x45dc3c;})[_0xb151('0x22')](respondWithFilteredResult(_0x1faf67,_0x495847))[_0xb151('0x42')](handleError(_0x1faf67,null));};exports[_0xb151('0x43')]=function(_0x128eff,_0x16de3b){var _0x4075bf={'raw':![],'where':{'id':_0x128eff[_0xb151('0x44')]['id']}},_0x27fbe4={};_0x27fbe4[_0xb151('0x2e')]=_[_0xb151('0x30')](db[_0xb151('0x2a')][_0xb151('0x2b')]);_0x27fbe4['query']=_[_0xb151('0x30')](_0x128eff[_0xb151('0x2f')]);_0x27fbe4[_0xb151('0x37')]=_[_0xb151('0x31')](_0x27fbe4[_0xb151('0x2e')],_0x27fbe4[_0xb151('0x2f')]);_0x4075bf['attributes']=_[_0xb151('0x31')](_0x27fbe4[_0xb151('0x2e')],qs[_0xb151('0x33')](_0x128eff[_0xb151('0x2f')][_0xb151('0x33')]));_0x4075bf[_0xb151('0x32')]=_0x4075bf[_0xb151('0x32')][_0xb151('0x45')]?_0x4075bf[_0xb151('0x32')]:_0x27fbe4[_0xb151('0x2e')];if(_0x128eff['query'][_0xb151('0x3e')]){_0x4075bf['include']=[{'all':!![]}];}_0x4075bf=_[_0xb151('0x3b')]({},_0x4075bf,_0x128eff[_0xb151('0x3d')]);return db[_0xb151('0x2a')]['find'](_0x4075bf)[_0xb151('0x22')](handleEntityNotFound(_0x16de3b,null))['then'](respondWithResult(_0x16de3b,null))[_0xb151('0x42')](handleError(_0x16de3b,null));};exports[_0xb151('0x46')]=function(_0xba7534,_0xa8f920){return db[_0xb151('0x2a')]['create'](_0xba7534[_0xb151('0x47')],{})['then'](respondWithResult(_0xa8f920,0xc9))[_0xb151('0x42')](handleError(_0xa8f920,null));};exports[_0xb151('0x48')]=function(_0x964b2b,_0x2ce3ca){if(_0x964b2b['body']['id']){delete _0x964b2b[_0xb151('0x47')]['id'];}return db[_0xb151('0x2a')][_0xb151('0x49')]({'where':{'id':_0x964b2b[_0xb151('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ce3ca,null))[_0xb151('0x22')](saveUpdates(_0x964b2b['body'],null))[_0xb151('0x22')](respondWithResult(_0x2ce3ca,null))[_0xb151('0x42')](handleError(_0x2ce3ca,null));};exports[_0xb151('0x23')]=function(_0x50b4dd,_0x211e0c){return db['FreshdeskAccount']['find']({'where':{'id':_0x50b4dd[_0xb151('0x44')]['id']}})[_0xb151('0x22')](handleEntityNotFound(_0x211e0c,null))[_0xb151('0x22')](removeEntity(_0x211e0c,null))[_0xb151('0x42')](handleError(_0x211e0c,null));};exports[_0xb151('0x4a')]=function(_0x4cb261,_0xd94c1d,_0x55117d){var _0x3ba19f={};var _0x4e352e={};var _0x74b4f3;var _0x21c382;return db['FreshdeskAccount'][_0xb151('0x4b')]({'where':{'id':_0x4cb261[_0xb151('0x44')]['id']}})[_0xb151('0x22')](handleEntityNotFound(_0xd94c1d,null))[_0xb151('0x22')](function(_0x2e4389){if(_0x2e4389){_0x74b4f3=_0x2e4389;_0x4e352e[_0xb151('0x2e')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x4e352e[_0xb151('0x2f')]=_[_0xb151('0x30')](_0x4cb261[_0xb151('0x2f')]);_0x4e352e[_0xb151('0x37')]=_[_0xb151('0x31')](_0x4e352e['model'],_0x4e352e[_0xb151('0x2f')]);_0x3ba19f['attributes']=_['intersection'](_0x4e352e[_0xb151('0x2e')],qs[_0xb151('0x33')](_0x4cb261['query']['fields']));_0x3ba19f[_0xb151('0x32')]=_0x3ba19f[_0xb151('0x32')][_0xb151('0x45')]?_0x3ba19f[_0xb151('0x32')]:_0x4e352e[_0xb151('0x2e')];_0x3ba19f[_0xb151('0x4c')]=qs[_0xb151('0x36')](_0x4cb261['query'][_0xb151('0x36')]);_0x3ba19f[_0xb151('0x3a')]=qs[_0xb151('0x37')](_[_0xb151('0x38')](_0x4cb261[_0xb151('0x2f')],_0x4e352e[_0xb151('0x37')]));if(_0x4cb261[_0xb151('0x2f')][_0xb151('0x39')]){_0x3ba19f[_0xb151('0x3a')]=_[_0xb151('0x3b')](_0x3ba19f[_0xb151('0x3a')],{'$or':_['map'](_0x3ba19f['attributes'],function(_0x24b552){var _0x253464={};_0x253464[_0x24b552]={'$like':'%'+_0x4cb261[_0xb151('0x2f')][_0xb151('0x39')]+'%'};return _0x253464;})});}_0x3ba19f=_[_0xb151('0x3b')]({},_0x3ba19f,_0x4cb261['options']);return _0x74b4f3[_0xb151('0x4a')](_0x3ba19f);}})[_0xb151('0x22')](function(_0x54b97f){if(_0x54b97f){_0x21c382=_0x54b97f[_0xb151('0x45')];if(!_0x4cb261[_0xb151('0x2f')][_0xb151('0x34')]('nolimit')){_0x3ba19f[_0xb151('0x1c')]=qs['limit'](_0x4cb261[_0xb151('0x2f')][_0xb151('0x1c')]);_0x3ba19f[_0xb151('0x1b')]=qs[_0xb151('0x1b')](_0x4cb261[_0xb151('0x2f')][_0xb151('0x1b')]);}return _0x74b4f3[_0xb151('0x4a')](_0x3ba19f);}})[_0xb151('0x22')](function(_0x1cfc6e){if(_0x1cfc6e){return _0x1cfc6e?{'count':_0x21c382,'rows':_0x1cfc6e}:null;}})[_0xb151('0x22')](respondWithResult(_0xd94c1d,null))[_0xb151('0x42')](handleError(_0xd94c1d,null));};exports[_0xb151('0x4d')]=function(_0x5efd97,_0x216575,_0x26438f){if(_0x5efd97['body']['id']){delete _0x5efd97[_0xb151('0x47')]['id'];}return db[_0xb151('0x2a')]['findOne']({'where':{'id':_0x5efd97[_0xb151('0x44')]['id']}})[_0xb151('0x22')](handleEntityNotFound(_0x216575,null))[_0xb151('0x22')](function(_0x333d09){if(_0x333d09){_0x5efd97['body'][_0xb151('0x4e')]=_0x333d09['id'];_0x5efd97[_0xb151('0x47')][_0xb151('0x4f')]=integrations['getSubjects'](_0x5efd97[_0xb151('0x47')][_0xb151('0x50')],_0x5efd97[_0xb151('0x47')]['type']);_0x5efd97[_0xb151('0x47')][_0xb151('0x51')]=integrations['getDescriptions'](_0x5efd97[_0xb151('0x47')][_0xb151('0x50')],_0x5efd97[_0xb151('0x47')][_0xb151('0x52')]);return db[_0xb151('0x53')][_0xb151('0x46')](_0x5efd97[_0xb151('0x47')],{'include':[{'model':db['FreshdeskField'],'as':_0xb151('0x4f')},{'model':db[_0xb151('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x216575,null))[_0xb151('0x42')](handleError(_0x216575,null));};exports[_0xb151('0x55')]=function(_0x25e3d3,_0x46b7d0,_0x5d41d5){var _0x365972='';return db[_0xb151('0x2a')][_0xb151('0x4b')]({'where':{'id':_0x25e3d3['params']['id']},'attributes':['id',_0xb151('0x56'),_0xb151('0x57')]})['then'](handleEntityNotFound(_0x46b7d0,null))[_0xb151('0x22')](function(_0x42a051){if(_0x42a051){_0x365972=_0x42a051[_0xb151('0x56')];var _0x4900bb=_0x365972['slice'](-0x1);if(_0x4900bb==='/'){_0x365972=_0x365972[_0xb151('0x58')](0x0,_0x365972[_0xb151('0x59')](_0x4900bb));}return rp({'method':'GET','uri':util[_0xb151('0x5a')]('%s/%s',_0x365972,_0xb151('0x5b')),'headers':{'Authorization':util[_0xb151('0x5a')](_0xb151('0x5c'),new Buffer(util[_0xb151('0x5a')](_0xb151('0x5d'),_0x42a051[_0xb151('0x57')]))['toString'](_0xb151('0x5e')))},'json':!![]});}})[_0xb151('0x22')](function(_0x1b5a68){if(_0x1b5a68){var _0xeb662e=[_0xb151('0x5f'),_0xb151('0x60'),'agent','description','status',_0xb151('0x61'),'group',_0xb151('0x62'),'ticket_type','group','company'];_[_0xb151('0x63')](_0x1b5a68,function(_0x1a9f1a){return _0xeb662e[_0xb151('0x64')](_0x1a9f1a[_0xb151('0x26')])||!_0x1a9f1a[_0xb151('0x65')]&&_0x1a9f1a[_0xb151('0x52')]!==_0xb151('0x66')&&_0x1a9f1a['type']!=='custom_dropdown';});return{'count':_0x1b5a68['length'],'rows':_['map'](_0x1b5a68,function(_0x41fca0){return{'id':_0x41fca0[_0xb151('0x26')],'name':_0x41fca0[_0xb151('0x67')],'custom':!_0x41fca0[_0xb151('0x65')],'options':_0x41fca0[_0xb151('0x68')]?_[_0xb151('0x29')](_0x41fca0[_0xb151('0x68')],function(_0x3ccc70){return{'name':_[_0xb151('0x69')](_0x3ccc70),'value':_0x3ccc70};}):[]};})};}})[_0xb151('0x22')](respondWithResult(_0x46b7d0,null))['catch'](function(_0x12875a){var _0x555ca3=_0x25e3d3[_0xb151('0x2f')]['test']?0x1f4:_0x12875a[_0xb151('0x6a')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb151('0x55'),_0x555ca3,JSON[_0xb151('0x6b')](_0x12875a));delete _0x12875a['name'];if(_0x555ca3===0x191){_0x555ca3=0x190;}_0x46b7d0[_0xb151('0x18')](_0x555ca3)[_0xb151('0x27')](_0x25e3d3[_0xb151('0x2f')][_0xb151('0x6c')]?{'message':_0xb151('0x6d'),'statusCode':_0x12875a['statusCode']}:_0x12875a);});}; \ No newline at end of file +var _0x02f7=['Subjects','Descriptions','channel','FreshdeskField','getFields','remoteUri','slice','substring','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','description','ticket_type','group','company','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','limit','count','offset','set','reject','save','update','then','destroy','stack','name','send','FreshdeskAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId'];(function(_0x1e61b8,_0x21ca64){var _0xd1d510=function(_0x1a0f40){while(--_0x1a0f40){_0x1e61b8['push'](_0x1e61b8['shift']());}};_0xd1d510(++_0x21ca64);}(_0x02f7,0x1d3));var _0x702f=function(_0x288d17,_0xb1bf09){_0x288d17=_0x288d17-0x0;var _0x5936a9=_0x02f7[_0x288d17];return _0x5936a9;};'use strict';var emlformat=require(_0x702f('0x0'));var rimraf=require(_0x702f('0x1'));var zipdir=require(_0x702f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x702f('0x3'));var moment=require(_0x702f('0x4'));var BPromise=require(_0x702f('0x5'));var Mustache=require(_0x702f('0x6'));var util=require(_0x702f('0x7'));var path=require(_0x702f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x702f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702f('0xa'));var squel=require(_0x702f('0xb'));var crypto=require(_0x702f('0xc'));var jsforce=require(_0x702f('0xd'));var deskjs=require(_0x702f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x702f('0xf'));var Papa=require(_0x702f('0x10'));var Redis=require(_0x702f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x702f('0x12'));var as=require(_0x702f('0x13'));var hardwareService=require(_0x702f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x702f('0x15'));var config=require(_0x702f('0x16'));var licenseUtil=require(_0x702f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x702f('0x18'));function respondWithStatusCode(_0x3ac816,_0x4f8528){_0x4f8528=_0x4f8528||0xcc;return function(_0x39c277){if(_0x39c277){return _0x3ac816[_0x702f('0x19')](_0x4f8528);}return _0x3ac816[_0x702f('0x1a')](_0x4f8528)[_0x702f('0x1b')]();};}function respondWithResult(_0x1a714d,_0xe4f824){_0xe4f824=_0xe4f824||0xc8;return function(_0xa07719){if(_0xa07719){return _0x1a714d['status'](_0xe4f824)[_0x702f('0x1c')](_0xa07719);}};}function respondWithFilteredResult(_0x4104ae,_0x3bef6c){return function(_0x67a47e){if(_0x67a47e){var _0x1ab677=typeof _0x3bef6c['offset']==='undefined'&&typeof _0x3bef6c[_0x702f('0x1d')]==='undefined';var _0x922c85=_0x67a47e[_0x702f('0x1e')];var _0xa749fd=_0x1ab677?0x0:_0x3bef6c[_0x702f('0x1f')];var _0x53dd8f=_0x1ab677?_0x67a47e[_0x702f('0x1e')]:_0x3bef6c['offset']+_0x3bef6c['limit'];var _0x429813;if(_0x53dd8f>=_0x922c85){_0x53dd8f=_0x922c85;_0x429813=0xc8;}else{_0x429813=0xce;}_0x4104ae[_0x702f('0x1a')](_0x429813);return _0x4104ae[_0x702f('0x20')]('Content-Range',_0xa749fd+'-'+_0x53dd8f+'/'+_0x922c85)[_0x702f('0x1c')](_0x67a47e);}return null;};}function patchUpdates(_0x218e30){return function(_0x34864e){try{jsonpatch['apply'](_0x34864e,_0x218e30,!![]);}catch(_0x38ecba){return BPromise[_0x702f('0x21')](_0x38ecba);}return _0x34864e[_0x702f('0x22')]();};}function saveUpdates(_0x3f573e,_0x16cc77){return function(_0x431e6d){if(_0x431e6d){return _0x431e6d[_0x702f('0x23')](_0x3f573e)[_0x702f('0x24')](function(_0x1f47a2){return _0x1f47a2;});}return null;};}function removeEntity(_0xc030e5,_0x4699b4){return function(_0x28a0d8){if(_0x28a0d8){return _0x28a0d8[_0x702f('0x25')]()[_0x702f('0x24')](function(){_0xc030e5[_0x702f('0x1a')](0xcc)[_0x702f('0x1b')]();});}};}function handleEntityNotFound(_0x386086,_0x5f2961){return function(_0x3a2aeb){if(!_0x3a2aeb){_0x386086[_0x702f('0x19')](0x194);}return _0x3a2aeb;};}function handleError(_0x46136d,_0x244f42){_0x244f42=_0x244f42||0x1f4;return function(_0x9bb674){logger['error'](_0x9bb674[_0x702f('0x26')]);if(_0x9bb674['name']){delete _0x9bb674[_0x702f('0x27')];}_0x46136d[_0x702f('0x1a')](_0x244f42)[_0x702f('0x28')](_0x9bb674);};}exports['index']=function(_0x573103,_0x10d5c4){var _0x52fa34={},_0x2ee69d={},_0x228d4e={'count':0x0,'rows':[]};var _0x38dde7=_['map'](db[_0x702f('0x29')][_0x702f('0x2a')],function(_0x25e9df){return{'name':_0x25e9df['fieldName'],'type':_0x25e9df['type'][_0x702f('0x2b')]};});_0x2ee69d[_0x702f('0x2c')]=_[_0x702f('0x2d')](_0x38dde7,_0x702f('0x27'));_0x2ee69d[_0x702f('0x2e')]=_[_0x702f('0x2f')](_0x573103['query']);_0x2ee69d[_0x702f('0x30')]=_[_0x702f('0x31')](_0x2ee69d[_0x702f('0x2c')],_0x2ee69d[_0x702f('0x2e')]);_0x52fa34[_0x702f('0x32')]=_['intersection'](_0x2ee69d[_0x702f('0x2c')],qs[_0x702f('0x33')](_0x573103[_0x702f('0x2e')]['fields']));_0x52fa34[_0x702f('0x32')]=_0x52fa34[_0x702f('0x32')][_0x702f('0x34')]?_0x52fa34[_0x702f('0x32')]:_0x2ee69d[_0x702f('0x2c')];if(!_0x573103[_0x702f('0x2e')][_0x702f('0x35')](_0x702f('0x36'))){_0x52fa34[_0x702f('0x1d')]=qs[_0x702f('0x1d')](_0x573103[_0x702f('0x2e')]['limit']);_0x52fa34['offset']=qs[_0x702f('0x1f')](_0x573103[_0x702f('0x2e')][_0x702f('0x1f')]);}_0x52fa34[_0x702f('0x37')]=qs[_0x702f('0x38')](_0x573103[_0x702f('0x2e')]['sort']);_0x52fa34[_0x702f('0x39')]=qs[_0x702f('0x30')](_[_0x702f('0x3a')](_0x573103[_0x702f('0x2e')],_0x2ee69d[_0x702f('0x30')]),_0x38dde7);if(_0x573103[_0x702f('0x2e')][_0x702f('0x3b')]){_0x52fa34['where']=_[_0x702f('0x3c')](_0x52fa34[_0x702f('0x39')],{'$or':_[_0x702f('0x2d')](_0x38dde7,function(_0x2bbde4){if(_0x2bbde4[_0x702f('0x3d')]!==_0x702f('0x3e')){var _0x8f1d4={};_0x8f1d4[_0x2bbde4['name']]={'$like':'%'+_0x573103['query'][_0x702f('0x3b')]+'%'};return _0x8f1d4;}})});}_0x52fa34=_[_0x702f('0x3c')]({},_0x52fa34,_0x573103['options']);var _0xed3590={'where':_0x52fa34[_0x702f('0x39')]};return db['FreshdeskAccount'][_0x702f('0x1e')](_0xed3590)[_0x702f('0x24')](function(_0x334630){_0x228d4e[_0x702f('0x1e')]=_0x334630;if(_0x573103[_0x702f('0x2e')][_0x702f('0x3f')]){_0x52fa34[_0x702f('0x40')]=[{'all':!![]}];}return db[_0x702f('0x29')][_0x702f('0x41')](_0x52fa34);})[_0x702f('0x24')](function(_0xbfd3c9){_0x228d4e[_0x702f('0x42')]=_0xbfd3c9;return _0x228d4e;})['then'](respondWithFilteredResult(_0x10d5c4,_0x52fa34))['catch'](handleError(_0x10d5c4,null));};exports[_0x702f('0x43')]=function(_0x161ac4,_0xe8831a){var _0x180e6e={'raw':![],'where':{'id':_0x161ac4[_0x702f('0x44')]['id']}},_0x43f7ad={};_0x43f7ad[_0x702f('0x2c')]=_[_0x702f('0x2f')](db['FreshdeskAccount']['rawAttributes']);_0x43f7ad[_0x702f('0x2e')]=_[_0x702f('0x2f')](_0x161ac4[_0x702f('0x2e')]);_0x43f7ad[_0x702f('0x30')]=_['intersection'](_0x43f7ad[_0x702f('0x2c')],_0x43f7ad['query']);_0x180e6e[_0x702f('0x32')]=_[_0x702f('0x31')](_0x43f7ad['model'],qs['fields'](_0x161ac4[_0x702f('0x2e')][_0x702f('0x33')]));_0x180e6e['attributes']=_0x180e6e['attributes'][_0x702f('0x34')]?_0x180e6e[_0x702f('0x32')]:_0x43f7ad[_0x702f('0x2c')];if(_0x161ac4[_0x702f('0x2e')][_0x702f('0x3f')]){_0x180e6e[_0x702f('0x40')]=[{'all':!![]}];}_0x180e6e=_['merge']({},_0x180e6e,_0x161ac4['options']);return db[_0x702f('0x29')][_0x702f('0x45')](_0x180e6e)[_0x702f('0x24')](handleEntityNotFound(_0xe8831a,null))[_0x702f('0x24')](respondWithResult(_0xe8831a,null))[_0x702f('0x46')](handleError(_0xe8831a,null));};exports[_0x702f('0x47')]=function(_0x4d9e5e,_0x2e957b){return db[_0x702f('0x29')]['create'](_0x4d9e5e[_0x702f('0x48')],{})['then'](respondWithResult(_0x2e957b,0xc9))['catch'](handleError(_0x2e957b,null));};exports['update']=function(_0x2c8599,_0x1ae430){if(_0x2c8599['body']['id']){delete _0x2c8599[_0x702f('0x48')]['id'];}return db['FreshdeskAccount'][_0x702f('0x45')]({'where':{'id':_0x2c8599[_0x702f('0x44')]['id']}})[_0x702f('0x24')](handleEntityNotFound(_0x1ae430,null))[_0x702f('0x24')](saveUpdates(_0x2c8599[_0x702f('0x48')],null))[_0x702f('0x24')](respondWithResult(_0x1ae430,null))[_0x702f('0x46')](handleError(_0x1ae430,null));};exports[_0x702f('0x25')]=function(_0x3f378c,_0x8f260d){return db[_0x702f('0x29')][_0x702f('0x45')]({'where':{'id':_0x3f378c['params']['id']}})[_0x702f('0x24')](handleEntityNotFound(_0x8f260d,null))[_0x702f('0x24')](removeEntity(_0x8f260d,null))[_0x702f('0x46')](handleError(_0x8f260d,null));};exports[_0x702f('0x49')]=function(_0x4a7ea9,_0x13cfdc,_0xe28bb5){var _0x1d7a1a={};var _0x1f305a={};var _0x3f1da0;var _0x3f5899;return db['FreshdeskAccount'][_0x702f('0x4a')]({'where':{'id':_0x4a7ea9[_0x702f('0x44')]['id']}})[_0x702f('0x24')](handleEntityNotFound(_0x13cfdc,null))[_0x702f('0x24')](function(_0x541b9b){if(_0x541b9b){_0x3f1da0=_0x541b9b;_0x1f305a[_0x702f('0x2c')]=_[_0x702f('0x2f')](db[_0x702f('0x4b')]['rawAttributes']);_0x1f305a[_0x702f('0x2e')]=_[_0x702f('0x2f')](_0x4a7ea9[_0x702f('0x2e')]);_0x1f305a[_0x702f('0x30')]=_[_0x702f('0x31')](_0x1f305a['model'],_0x1f305a[_0x702f('0x2e')]);_0x1d7a1a['attributes']=_[_0x702f('0x31')](_0x1f305a[_0x702f('0x2c')],qs[_0x702f('0x33')](_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x33')]));_0x1d7a1a[_0x702f('0x32')]=_0x1d7a1a[_0x702f('0x32')][_0x702f('0x34')]?_0x1d7a1a[_0x702f('0x32')]:_0x1f305a[_0x702f('0x2c')];_0x1d7a1a['order']=qs['sort'](_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x38')]);_0x1d7a1a[_0x702f('0x39')]=qs[_0x702f('0x30')](_[_0x702f('0x3a')](_0x4a7ea9[_0x702f('0x2e')],_0x1f305a[_0x702f('0x30')]));if(_0x4a7ea9['query'][_0x702f('0x3b')]){_0x1d7a1a[_0x702f('0x39')]=_[_0x702f('0x3c')](_0x1d7a1a[_0x702f('0x39')],{'$or':_['map'](_0x1d7a1a['attributes'],function(_0x5e5c82){var _0x23d1d3={};_0x23d1d3[_0x5e5c82]={'$like':'%'+_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x3b')]+'%'};return _0x23d1d3;})});}_0x1d7a1a=_['merge']({},_0x1d7a1a,_0x4a7ea9['options']);return _0x3f1da0[_0x702f('0x49')](_0x1d7a1a);}})[_0x702f('0x24')](function(_0x599a40){if(_0x599a40){_0x3f5899=_0x599a40[_0x702f('0x34')];if(!_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x35')](_0x702f('0x36'))){_0x1d7a1a['limit']=qs[_0x702f('0x1d')](_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x1d')]);_0x1d7a1a[_0x702f('0x1f')]=qs['offset'](_0x4a7ea9[_0x702f('0x2e')][_0x702f('0x1f')]);}return _0x3f1da0['getConfigurations'](_0x1d7a1a);}})[_0x702f('0x24')](function(_0x336ef6){if(_0x336ef6){return _0x336ef6?{'count':_0x3f5899,'rows':_0x336ef6}:null;}})[_0x702f('0x24')](respondWithResult(_0x13cfdc,null))[_0x702f('0x46')](handleError(_0x13cfdc,null));};exports[_0x702f('0x4c')]=function(_0x10de2a,_0x32e37b,_0x4facae){if(_0x10de2a[_0x702f('0x48')]['id']){delete _0x10de2a['body']['id'];}return db[_0x702f('0x29')][_0x702f('0x4a')]({'where':{'id':_0x10de2a[_0x702f('0x44')]['id']}})['then'](handleEntityNotFound(_0x32e37b,null))[_0x702f('0x24')](function(_0x4ca7ba){if(_0x4ca7ba){_0x10de2a[_0x702f('0x48')][_0x702f('0x4d')]=_0x4ca7ba['id'];_0x10de2a[_0x702f('0x48')][_0x702f('0x4e')]=integrations['getSubjects'](_0x10de2a[_0x702f('0x48')]['channel'],_0x10de2a[_0x702f('0x48')][_0x702f('0x3d')]);_0x10de2a[_0x702f('0x48')][_0x702f('0x4f')]=integrations['getDescriptions'](_0x10de2a['body'][_0x702f('0x50')],_0x10de2a[_0x702f('0x48')][_0x702f('0x3d')]);return db[_0x702f('0x4b')]['create'](_0x10de2a[_0x702f('0x48')],{'include':[{'model':db[_0x702f('0x51')],'as':_0x702f('0x4e')},{'model':db[_0x702f('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32e37b,null))[_0x702f('0x46')](handleError(_0x32e37b,null));};exports[_0x702f('0x52')]=function(_0x3ee283,_0x57d505,_0x25709c){var _0x30b74f='';return db['FreshdeskAccount'][_0x702f('0x4a')]({'where':{'id':_0x3ee283[_0x702f('0x44')]['id']},'attributes':['id',_0x702f('0x53'),'apiKey']})['then'](handleEntityNotFound(_0x57d505,null))['then'](function(_0x31efbf){if(_0x31efbf){_0x30b74f=_0x31efbf[_0x702f('0x53')];var _0x1bf58f=_0x30b74f[_0x702f('0x54')](-0x1);if(_0x1bf58f==='/'){_0x30b74f=_0x30b74f[_0x702f('0x55')](0x0,_0x30b74f['lastIndexOf'](_0x1bf58f));}return rp({'method':'GET','uri':util[_0x702f('0x56')](_0x702f('0x57'),_0x30b74f,_0x702f('0x58')),'headers':{'Authorization':util['format'](_0x702f('0x59'),new Buffer(util[_0x702f('0x56')](_0x702f('0x5a'),_0x31efbf[_0x702f('0x5b')]))[_0x702f('0x5c')](_0x702f('0x5d')))},'json':!![]});}})[_0x702f('0x24')](function(_0x13142f){if(_0x13142f){var _0x2b6454=[_0x702f('0x5e'),'subject','agent',_0x702f('0x5f'),_0x702f('0x1a'),'priority','group','source',_0x702f('0x60'),_0x702f('0x61'),_0x702f('0x62')];_['remove'](_0x13142f,function(_0xc86c4b){return _0x2b6454[_0x702f('0x63')](_0xc86c4b['name'])||!_0xc86c4b['default']&&_0xc86c4b['type']!==_0x702f('0x64')&&_0xc86c4b[_0x702f('0x3d')]!==_0x702f('0x65');});return{'count':_0x13142f[_0x702f('0x34')],'rows':_[_0x702f('0x2d')](_0x13142f,function(_0x45ee70){return{'id':_0x45ee70['name'],'name':_0x45ee70[_0x702f('0x66')],'custom':!_0x45ee70['default'],'options':_0x45ee70[_0x702f('0x67')]?_[_0x702f('0x2d')](_0x45ee70[_0x702f('0x67')],function(_0x1daac9){return{'name':_[_0x702f('0x68')](_0x1daac9),'value':_0x1daac9};}):[]};})};}})[_0x702f('0x24')](respondWithResult(_0x57d505,null))[_0x702f('0x46')](function(_0x1ee2c0){var _0x13340e=_0x3ee283[_0x702f('0x2e')][_0x702f('0x69')]?0x1f4:_0x1ee2c0[_0x702f('0x6a')]||0x1f4;logger['error'](_0x702f('0x6b'),_0x702f('0x52'),_0x13340e,JSON['stringify'](_0x1ee2c0));delete _0x1ee2c0['name'];if(_0x13340e===0x191){_0x13340e=0x190;}_0x57d505['status'](_0x13340e)[_0x702f('0x28')](_0x3ee283[_0x702f('0x2e')][_0x702f('0x69')]?{'message':_0x702f('0x6c'),'statusCode':_0x1ee2c0['statusCode']}:_0x1ee2c0);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a2b0fa5..f98d7be 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 _0xd124=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','int_freshdesk_accounts'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd124,0x18c));var _0x4d12=function(_0x12f0fc,_0x3c2bd6){_0x12f0fc=_0x12f0fc-0x0;var _0x3b9534=_0xd124[_0x12f0fc];return _0x3b9534;};'use strict';var _=require(_0x4d12('0x0'));var util=require(_0x4d12('0x1'));var logger=require(_0x4d12('0x2'))(_0x4d12('0x3'));var moment=require('moment');var BPromise=require(_0x4d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d12('0x5'));var rimraf=require(_0x4d12('0x6'));var config=require(_0x4d12('0x7'));var attributes=require(_0x4d12('0x8'));var integrations=require(_0x4d12('0x9'));module['exports']=function(_0x2797ee,_0x2d5b79){return _0x2797ee[_0x4d12('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x4d12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3a4=['../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshdeskAccount.attributes'];(function(_0xa3259c,_0x5ccc5b){var _0x1d72a5=function(_0x64ecba){while(--_0x64ecba){_0xa3259c['push'](_0xa3259c['shift']());}};_0x1d72a5(++_0x5ccc5b);}(_0xd3a4,0x117));var _0x4d3a=function(_0x2c619f,_0x1a9503){_0x2c619f=_0x2c619f-0x0;var _0xb8c66a=_0xd3a4[_0x2c619f];return _0xb8c66a;};'use strict';var _=require(_0x4d3a('0x0'));var util=require(_0x4d3a('0x1'));var logger=require(_0x4d3a('0x2'))(_0x4d3a('0x3'));var moment=require(_0x4d3a('0x4'));var BPromise=require(_0x4d3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d3a('0x6'));var rimraf=require(_0x4d3a('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d3a('0x8'));var integrations=require(_0x4d3a('0x9'));module[_0x4d3a('0xa')]=function(_0x147b08,_0x40e322){return _0x147b08[_0x4d3a('0xb')]('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 2825402..5101e54 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 _0xe6f1=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','include','model','map','catch','ShowFreshdeskAccount','lodash'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xe6f1,0x16a));var _0x1e6f=function(_0x42d41d,_0x17b8ea){_0x42d41d=_0x42d41d-0x0;var _0x2e6184=_0xe6f1[_0x42d41d];return _0x2e6184;};'use strict';var _=require(_0x1e6f('0x0'));var util=require(_0x1e6f('0x1'));var moment=require(_0x1e6f('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e6f('0x3'));var fs=require('fs');var Redis=require(_0x1e6f('0x4'));var db=require(_0x1e6f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e6f('0x6'))(_0x1e6f('0x7'));var config=require(_0x1e6f('0x8'));var jayson=require(_0x1e6f('0x9'));var client=jayson[_0x1e6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2154f7,_0x1b1ec4,_0x4b1916){return new BPromise(function(_0x3cc1f8,_0x1e3b72){return client[_0x1e6f('0xb')](_0x2154f7,_0x4b1916)[_0x1e6f('0xc')](function(_0x1e5bcc){logger[_0x1e6f('0xd')](_0x1e6f('0xe'),_0x1b1ec4,_0x1e6f('0xf'));logger[_0x1e6f('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1b1ec4,_0x1e6f('0xf'),JSON[_0x1e6f('0x11')](_0x1e5bcc));if(_0x1e5bcc[_0x1e6f('0x12')]){if(_0x1e5bcc[_0x1e6f('0x12')][_0x1e6f('0x13')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x1b1ec4,_0x1e5bcc['error'][_0x1e6f('0x14')]);return _0x1e3b72(_0x1e5bcc[_0x1e6f('0x12')][_0x1e6f('0x14')]);}logger[_0x1e6f('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b1ec4,_0x1e5bcc[_0x1e6f('0x12')][_0x1e6f('0x14')]);return _0x3cc1f8(_0x1e5bcc['error'][_0x1e6f('0x14')]);}else{logger[_0x1e6f('0xd')](_0x1e6f('0xe'),_0x1b1ec4,_0x1e6f('0xf'));_0x3cc1f8(_0x1e5bcc[_0x1e6f('0x15')][_0x1e6f('0x14')]);}})['catch'](function(_0xb2b5d4){logger['error'](_0x1e6f('0xe'),_0x1b1ec4,_0xb2b5d4);_0x1e3b72(_0xb2b5d4);});});}exports[_0x1e6f('0x16')]=function(_0x2203c8){var _0x1f976f=this;return new Promise(function(_0x171a50,_0x32919c){return db[_0x1e6f('0x17')]['findAll']({'raw':_0x2203c8[_0x1e6f('0x18')]?_0x2203c8[_0x1e6f('0x18')][_0x1e6f('0x19')]===undefined?!![]:![]:!![],'where':_0x2203c8[_0x1e6f('0x18')]?_0x2203c8[_0x1e6f('0x18')][_0x1e6f('0x1a')]||null:null,'attributes':_0x2203c8[_0x1e6f('0x18')]?_0x2203c8[_0x1e6f('0x18')][_0x1e6f('0x1b')]||null:null,'limit':_0x2203c8[_0x1e6f('0x18')]?_0x2203c8[_0x1e6f('0x18')]['limit']||null:null,'include':_0x2203c8[_0x1e6f('0x18')]?_0x2203c8['options']['include']?_['map'](_0x2203c8[_0x1e6f('0x18')][_0x1e6f('0x1c')],function(_0x1b219a){return{'model':db[_0x1b219a[_0x1e6f('0x1d')]],'as':_0x1b219a['as'],'attributes':_0x1b219a[_0x1e6f('0x1b')],'include':_0x1b219a[_0x1e6f('0x1c')]?_[_0x1e6f('0x1e')](_0x1b219a[_0x1e6f('0x1c')],function(_0x56cc9b){return{'model':db[_0x56cc9b['model']],'as':_0x56cc9b['as'],'attributes':_0x56cc9b['attributes'],'include':_0x56cc9b[_0x1e6f('0x1c')]?_[_0x1e6f('0x1e')](_0x56cc9b[_0x1e6f('0x1c')],function(_0x31af77){return{'model':db[_0x31af77['model']],'as':_0x31af77['as'],'attributes':_0x31af77['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e6f('0xc')](function(_0x432efa){logger['info'](_0x1e6f('0x16'),_0x2203c8);logger[_0x1e6f('0x10')](_0x1e6f('0x16'),_0x2203c8,JSON['stringify'](_0x432efa));_0x171a50(_0x432efa);})[_0x1e6f('0x1f')](function(_0x4b1ecb){logger[_0x1e6f('0x12')](_0x1e6f('0x16'),_0x4b1ecb['message'],_0x2203c8);_0x32919c(_0x1f976f[_0x1e6f('0x12')](0x1f4,_0x4b1ecb[_0x1e6f('0x14')]));});});};exports[_0x1e6f('0x20')]=function(_0x15c6d6){var _0x42a4ef=this;return new Promise(function(_0x3433fa,_0xccc474){return db[_0x1e6f('0x17')]['find']({'raw':_0x15c6d6['options']?_0x15c6d6[_0x1e6f('0x18')][_0x1e6f('0x19')]===undefined?!![]:![]:!![],'where':_0x15c6d6[_0x1e6f('0x18')]?_0x15c6d6[_0x1e6f('0x18')]['where']||null:null,'attributes':_0x15c6d6['options']?_0x15c6d6[_0x1e6f('0x18')]['attributes']||null:null,'include':_0x15c6d6[_0x1e6f('0x18')]?_0x15c6d6[_0x1e6f('0x18')][_0x1e6f('0x1c')]?_[_0x1e6f('0x1e')](_0x15c6d6[_0x1e6f('0x18')]['include'],function(_0x3bf82b){return{'model':db[_0x3bf82b['model']],'as':_0x3bf82b['as'],'attributes':_0x3bf82b[_0x1e6f('0x1b')],'include':_0x3bf82b[_0x1e6f('0x1c')]?_['map'](_0x3bf82b[_0x1e6f('0x1c')],function(_0x45dde3){return{'model':db[_0x45dde3[_0x1e6f('0x1d')]],'as':_0x45dde3['as'],'attributes':_0x45dde3[_0x1e6f('0x1b')],'include':_0x45dde3[_0x1e6f('0x1c')]?_['map'](_0x45dde3[_0x1e6f('0x1c')],function(_0x1ff45f){return{'model':db[_0x1ff45f[_0x1e6f('0x1d')]],'as':_0x1ff45f['as'],'attributes':_0x1ff45f[_0x1e6f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4692dd){logger[_0x1e6f('0xd')]('ShowFreshdeskAccount',_0x15c6d6);logger[_0x1e6f('0x10')](_0x1e6f('0x20'),_0x15c6d6,JSON[_0x1e6f('0x11')](_0x4692dd));_0x3433fa(_0x4692dd);})[_0x1e6f('0x1f')](function(_0x29a08b){logger['error'](_0x1e6f('0x20'),_0x29a08b[_0x1e6f('0x14')],_0x15c6d6);_0xccc474(_0x42a4ef[_0x1e6f('0x12')](0x1f4,_0x29a08b['message']));});});}; \ No newline at end of file +var _0xab53=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','limit','include','model','map','attributes','then','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab53,0x12d));var _0x3ab5=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xab53[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x3ab5('0x0'));var util=require(_0x3ab5('0x1'));var moment=require(_0x3ab5('0x2'));var BPromise=require(_0x3ab5('0x3'));var rs=require(_0x3ab5('0x4'));var fs=require('fs');var Redis=require(_0x3ab5('0x5'));var db=require(_0x3ab5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ab5('0x7'))(_0x3ab5('0x8'));var config=require('../../config/environment');var jayson=require(_0x3ab5('0x9'));var client=jayson[_0x3ab5('0xa')][_0x3ab5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a157,_0x518ea6,_0x564577){return new BPromise(function(_0x4c460e,_0x5d61ed){return client[_0x3ab5('0xc')](_0x40a157,_0x564577)['then'](function(_0x251e33){logger[_0x3ab5('0xd')](_0x3ab5('0xe'),_0x518ea6,_0x3ab5('0xf'));logger[_0x3ab5('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x518ea6,_0x3ab5('0xf'),JSON[_0x3ab5('0x11')](_0x251e33));if(_0x251e33[_0x3ab5('0x12')]){if(_0x251e33[_0x3ab5('0x12')][_0x3ab5('0x13')]===0x1f4){logger[_0x3ab5('0x12')](_0x3ab5('0xe'),_0x518ea6,_0x251e33['error'][_0x3ab5('0x14')]);return _0x5d61ed(_0x251e33[_0x3ab5('0x12')]['message']);}logger[_0x3ab5('0x12')](_0x3ab5('0xe'),_0x518ea6,_0x251e33[_0x3ab5('0x12')]['message']);return _0x4c460e(_0x251e33[_0x3ab5('0x12')][_0x3ab5('0x14')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x518ea6,_0x3ab5('0xf'));_0x4c460e(_0x251e33['result'][_0x3ab5('0x14')]);}})[_0x3ab5('0x15')](function(_0x25f26a){logger[_0x3ab5('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x518ea6,_0x25f26a);_0x5d61ed(_0x25f26a);});});}exports[_0x3ab5('0x16')]=function(_0x5502c6){var _0x3cee68=this;return new Promise(function(_0x1dcf80,_0x59e6a4){return db[_0x3ab5('0x17')][_0x3ab5('0x18')]({'raw':_0x5502c6[_0x3ab5('0x19')]?_0x5502c6['options']['raw']===undefined?!![]:![]:!![],'where':_0x5502c6[_0x3ab5('0x19')]?_0x5502c6['options'][_0x3ab5('0x1a')]||null:null,'attributes':_0x5502c6[_0x3ab5('0x19')]?_0x5502c6[_0x3ab5('0x19')]['attributes']||null:null,'limit':_0x5502c6[_0x3ab5('0x19')]?_0x5502c6[_0x3ab5('0x19')][_0x3ab5('0x1b')]||null:null,'include':_0x5502c6['options']?_0x5502c6[_0x3ab5('0x19')]['include']?_['map'](_0x5502c6[_0x3ab5('0x19')][_0x3ab5('0x1c')],function(_0x429b27){return{'model':db[_0x429b27[_0x3ab5('0x1d')]],'as':_0x429b27['as'],'attributes':_0x429b27['attributes'],'include':_0x429b27[_0x3ab5('0x1c')]?_[_0x3ab5('0x1e')](_0x429b27[_0x3ab5('0x1c')],function(_0x4b532d){return{'model':db[_0x4b532d[_0x3ab5('0x1d')]],'as':_0x4b532d['as'],'attributes':_0x4b532d['attributes'],'include':_0x4b532d['include']?_[_0x3ab5('0x1e')](_0x4b532d[_0x3ab5('0x1c')],function(_0x1728ad){return{'model':db[_0x1728ad[_0x3ab5('0x1d')]],'as':_0x1728ad['as'],'attributes':_0x1728ad[_0x3ab5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3ab5('0x20')](function(_0x469384){logger['info']('GetFreshdeskAccount',_0x5502c6);logger['debug'](_0x3ab5('0x16'),_0x5502c6,JSON['stringify'](_0x469384));_0x1dcf80(_0x469384);})[_0x3ab5('0x15')](function(_0x5b2998){logger[_0x3ab5('0x12')](_0x3ab5('0x16'),_0x5b2998[_0x3ab5('0x14')],_0x5502c6);_0x59e6a4(_0x3cee68[_0x3ab5('0x12')](0x1f4,_0x5b2998['message']));});});};exports['ShowFreshdeskAccount']=function(_0x15b714){var _0x1ae1c0=this;return new Promise(function(_0x3bfc57,_0x3c5836){return db['FreshdeskAccount'][_0x3ab5('0x21')]({'raw':_0x15b714[_0x3ab5('0x19')]?_0x15b714[_0x3ab5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x15b714[_0x3ab5('0x19')]?_0x15b714[_0x3ab5('0x19')][_0x3ab5('0x1a')]||null:null,'attributes':_0x15b714[_0x3ab5('0x19')]?_0x15b714['options'][_0x3ab5('0x1f')]||null:null,'include':_0x15b714[_0x3ab5('0x19')]?_0x15b714['options']['include']?_[_0x3ab5('0x1e')](_0x15b714[_0x3ab5('0x19')]['include'],function(_0x1cad83){return{'model':db[_0x1cad83[_0x3ab5('0x1d')]],'as':_0x1cad83['as'],'attributes':_0x1cad83[_0x3ab5('0x1f')],'include':_0x1cad83[_0x3ab5('0x1c')]?_[_0x3ab5('0x1e')](_0x1cad83['include'],function(_0x24fd70){return{'model':db[_0x24fd70[_0x3ab5('0x1d')]],'as':_0x24fd70['as'],'attributes':_0x24fd70[_0x3ab5('0x1f')],'include':_0x24fd70[_0x3ab5('0x1c')]?_['map'](_0x24fd70[_0x3ab5('0x1c')],function(_0x11a9b7){return{'model':db[_0x11a9b7[_0x3ab5('0x1d')]],'as':_0x11a9b7['as'],'attributes':_0x11a9b7[_0x3ab5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3ab5('0x20')](function(_0x3402ed){logger[_0x3ab5('0xd')](_0x3ab5('0x22'),_0x15b714);logger[_0x3ab5('0x10')](_0x3ab5('0x22'),_0x15b714,JSON['stringify'](_0x3402ed));_0x3bfc57(_0x3402ed);})[_0x3ab5('0x15')](function(_0x316d0e){logger[_0x3ab5('0x12')](_0x3ab5('0x22'),_0x316d0e[_0x3ab5('0x14')],_0x15b714);_0x3c5836(_0x1ae1c0['error'](0x1f4,_0x316d0e[_0x3ab5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index e482831..8ce66a8 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 _0x49a4=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects'];(function(_0x5bcddc,_0x288f93){var _0x578229=function(_0x277e20){while(--_0x277e20){_0x5bcddc['push'](_0x5bcddc['shift']());}};_0x578229(++_0x288f93);}(_0x49a4,0x11d));var _0x449a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49a4[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x449a('0x0'));var util=require(_0x449a('0x1'));var path=require(_0x449a('0x2'));var timeout=require(_0x449a('0x3'));var express=require(_0x449a('0x4'));var router=express[_0x449a('0x5')]();var fs_extra=require(_0x449a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x449a('0x7'));var controller=require(_0x449a('0x8'));router[_0x449a('0x9')]('/',auth[_0x449a('0xa')](),controller['index']);router[_0x449a('0x9')](_0x449a('0xb'),auth[_0x449a('0xa')](),controller[_0x449a('0xc')]);router['get'](_0x449a('0xd'),auth[_0x449a('0xa')](),controller['getFields']);router[_0x449a('0x9')](_0x449a('0xe'),auth[_0x449a('0xa')](),controller[_0x449a('0xf')]);router[_0x449a('0x9')](_0x449a('0x10'),auth[_0x449a('0xa')](),controller[_0x449a('0x11')]);router[_0x449a('0x9')](_0x449a('0x12'),auth['isAuthenticated'](),controller['getTags']);router[_0x449a('0x13')]('/',auth[_0x449a('0xa')](),controller['create']);router[_0x449a('0x13')](_0x449a('0x12'),auth[_0x449a('0xa')](),controller[_0x449a('0x14')]);router[_0x449a('0x15')](_0x449a('0xb'),auth[_0x449a('0xa')](),controller[_0x449a('0x16')]);router[_0x449a('0x17')]('/:id',auth[_0x449a('0xa')](),controller['destroy']);module[_0x449a('0x18')]=router; \ No newline at end of file +var _0x840b=['Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','delete','destroy','util'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x840b,0xd7));var _0xb840=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x840b[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require(_0xb840('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb840('0x1')]();var fs_extra=require(_0xb840('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xb840('0x3'));var config=require('../../config/environment');var controller=require(_0xb840('0x4'));router['get']('/',auth[_0xb840('0x5')](),controller[_0xb840('0x6')]);router['get'](_0xb840('0x7'),auth[_0xb840('0x5')](),controller[_0xb840('0x8')]);router[_0xb840('0x9')](_0xb840('0xa'),auth[_0xb840('0x5')](),controller[_0xb840('0xb')]);router[_0xb840('0x9')](_0xb840('0xc'),auth['isAuthenticated'](),controller[_0xb840('0xd')]);router[_0xb840('0x9')](_0xb840('0xe'),auth[_0xb840('0x5')](),controller[_0xb840('0xf')]);router[_0xb840('0x9')](_0xb840('0x10'),auth['isAuthenticated'](),controller[_0xb840('0x11')]);router[_0xb840('0x12')]('/',auth[_0xb840('0x5')](),controller[_0xb840('0x13')]);router[_0xb840('0x12')](_0xb840('0x10'),auth[_0xb840('0x5')](),controller[_0xb840('0x14')]);router['put'](_0xb840('0x7'),auth[_0xb840('0x5')](),controller[_0xb840('0x15')]);router[_0xb840('0x16')](_0xb840('0x7'),auth['isAuthenticated'](),controller[_0xb840('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index ca7ec39..d22a983 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 _0xb724=['exports','STRING','sequelize'];(function(_0x3242fd,_0x2df22c){var _0x443711=function(_0xc4ef6d){while(--_0xc4ef6d){_0x3242fd['push'](_0x3242fd['shift']());}};_0x443711(++_0x2df22c);}(_0xb724,0x1d9));var _0x4b72=function(_0x19dabf,_0x419c46){_0x19dabf=_0x19dabf-0x0;var _0x5bb62b=_0xb724[_0x19dabf];return _0x5bb62b;};'use strict';var Sequelize=require(_0x4b72('0x0'));module[_0x4b72('0x1')]={'name':{'type':Sequelize[_0x4b72('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x75a3=['STRING','sequelize','exports'];(function(_0x5b445b,_0xd251da){var _0x1a40fe=function(_0x218fce){while(--_0x218fce){_0x5b445b['push'](_0x5b445b['shift']());}};_0x1a40fe(++_0xd251da);}(_0x75a3,0x6d));var _0x375a=function(_0x13e343,_0x5cfaa4){_0x13e343=_0x13e343-0x0;var _0x53f861=_0x75a3[_0x13e343];return _0x53f861;};'use strict';var Sequelize=require(_0x375a('0x0'));module[_0x375a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x375a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e199468..e69a5b2 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 _0xb0a0=['undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','catch','show','params','find','create','body','FreshdeskField','pick','getFields','getSubjects','findOne','hasOwnProperty','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xb0a0,0x85));var _0x0b0a=function(_0xd92e0f,_0x4c28de){_0xd92e0f=_0xd92e0f-0x0;var _0x408a33=_0xb0a0[_0xd92e0f];return _0x408a33;};'use strict';var emlformat=require(_0x0b0a('0x0'));var rimraf=require(_0x0b0a('0x1'));var zipdir=require(_0x0b0a('0x2'));var jsonpatch=require(_0x0b0a('0x3'));var rp=require(_0x0b0a('0x4'));var moment=require(_0x0b0a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b0a('0x6'));var util=require(_0x0b0a('0x7'));var path=require(_0x0b0a('0x8'));var sox=require('sox');var csv=require(_0x0b0a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b0a('0xa'));var squel=require('squel');var crypto=require(_0x0b0a('0xb'));var jsforce=require(_0x0b0a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0b0a('0x9'));var querystring=require(_0x0b0a('0xd'));var Papa=require(_0x0b0a('0xe'));var Redis=require('ioredis');var authService=require(_0x0b0a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b0a('0x10'));var logger=require(_0x0b0a('0x11'))(_0x0b0a('0x12'));var utils=require(_0x0b0a('0x13'));var config=require(_0x0b0a('0x14'));var licenseUtil=require(_0x0b0a('0x15'));var db=require(_0x0b0a('0x16'))['db'];function respondWithStatusCode(_0x4015ff,_0x5c3b98){_0x5c3b98=_0x5c3b98||0xcc;return function(_0x5cfac8){if(_0x5cfac8){return _0x4015ff[_0x0b0a('0x17')](_0x5c3b98);}return _0x4015ff[_0x0b0a('0x18')](_0x5c3b98)[_0x0b0a('0x19')]();};}function respondWithResult(_0x4c1ba9,_0x8a9455){_0x8a9455=_0x8a9455||0xc8;return function(_0x1d5fba){if(_0x1d5fba){return _0x4c1ba9[_0x0b0a('0x18')](_0x8a9455)[_0x0b0a('0x1a')](_0x1d5fba);}};}function respondWithFilteredResult(_0x1791ba,_0x2e4d5e){return function(_0x25f0c6){if(_0x25f0c6){var _0x3bb583=typeof _0x2e4d5e[_0x0b0a('0x1b')]==='undefined'&&typeof _0x2e4d5e[_0x0b0a('0x1c')]===_0x0b0a('0x1d');var _0x17310a=_0x25f0c6[_0x0b0a('0x1e')];var _0x51436b=_0x3bb583?0x0:_0x2e4d5e['offset'];var _0xccec4c=_0x3bb583?_0x25f0c6[_0x0b0a('0x1e')]:_0x2e4d5e[_0x0b0a('0x1b')]+_0x2e4d5e['limit'];var _0x480949;if(_0xccec4c>=_0x17310a){_0xccec4c=_0x17310a;_0x480949=0xc8;}else{_0x480949=0xce;}_0x1791ba[_0x0b0a('0x18')](_0x480949);return _0x1791ba[_0x0b0a('0x1f')](_0x0b0a('0x20'),_0x51436b+'-'+_0xccec4c+'/'+_0x17310a)[_0x0b0a('0x1a')](_0x25f0c6);}return null;};}function patchUpdates(_0x16698a){return function(_0x5de9b5){try{jsonpatch[_0x0b0a('0x21')](_0x5de9b5,_0x16698a,!![]);}catch(_0x3e3e8a){return BPromise[_0x0b0a('0x22')](_0x3e3e8a);}return _0x5de9b5[_0x0b0a('0x23')]();};}function saveUpdates(_0x1fd2a0,_0x1ec9fb){return function(_0xc0ffb8){if(_0xc0ffb8){return _0xc0ffb8[_0x0b0a('0x24')](_0x1fd2a0)['then'](function(_0x16a90b){return _0x16a90b;});}return null;};}function removeEntity(_0x4f1ea4,_0x2024bd){return function(_0x212be4){if(_0x212be4){return _0x212be4['destroy']()[_0x0b0a('0x25')](function(){_0x4f1ea4[_0x0b0a('0x18')](0xcc)[_0x0b0a('0x19')]();});}};}function handleEntityNotFound(_0x1411fe,_0x128cbb){return function(_0x4928ff){if(!_0x4928ff){_0x1411fe[_0x0b0a('0x17')](0x194);}return _0x4928ff;};}function handleError(_0x44f71c,_0x55f5f9){_0x55f5f9=_0x55f5f9||0x1f4;return function(_0x143d43){logger['error'](_0x143d43[_0x0b0a('0x26')]);if(_0x143d43[_0x0b0a('0x27')]){delete _0x143d43[_0x0b0a('0x27')];}_0x44f71c['status'](_0x55f5f9)[_0x0b0a('0x28')](_0x143d43);};}exports[_0x0b0a('0x29')]=function(_0x3b6ac0,_0x5f2db0){var _0x361853={},_0x14d228={},_0xb9a201={'count':0x0,'rows':[]};var _0x12fcb8=_['map'](db[_0x0b0a('0x2a')][_0x0b0a('0x2b')],function(_0x2e44f1){return{'name':_0x2e44f1[_0x0b0a('0x2c')],'type':_0x2e44f1[_0x0b0a('0x2d')]['key']};});_0x14d228[_0x0b0a('0x2e')]=_['map'](_0x12fcb8,_0x0b0a('0x27'));_0x14d228[_0x0b0a('0x2f')]=_[_0x0b0a('0x30')](_0x3b6ac0['query']);_0x14d228[_0x0b0a('0x31')]=_[_0x0b0a('0x32')](_0x14d228[_0x0b0a('0x2e')],_0x14d228[_0x0b0a('0x2f')]);_0x361853[_0x0b0a('0x33')]=_[_0x0b0a('0x32')](_0x14d228[_0x0b0a('0x2e')],qs[_0x0b0a('0x34')](_0x3b6ac0[_0x0b0a('0x2f')]['fields']));_0x361853[_0x0b0a('0x33')]=_0x361853[_0x0b0a('0x33')][_0x0b0a('0x35')]?_0x361853[_0x0b0a('0x33')]:_0x14d228[_0x0b0a('0x2e')];if(!_0x3b6ac0[_0x0b0a('0x2f')]['hasOwnProperty'](_0x0b0a('0x36'))){_0x361853['limit']=qs['limit'](_0x3b6ac0[_0x0b0a('0x2f')][_0x0b0a('0x1c')]);_0x361853[_0x0b0a('0x1b')]=qs['offset'](_0x3b6ac0[_0x0b0a('0x2f')][_0x0b0a('0x1b')]);}_0x361853[_0x0b0a('0x37')]=qs[_0x0b0a('0x38')](_0x3b6ac0[_0x0b0a('0x2f')]['sort']);_0x361853[_0x0b0a('0x39')]=qs['filters'](_['pick'](_0x3b6ac0[_0x0b0a('0x2f')],_0x14d228[_0x0b0a('0x31')]),_0x12fcb8);if(_0x3b6ac0[_0x0b0a('0x2f')][_0x0b0a('0x3a')]){_0x361853[_0x0b0a('0x39')]=_[_0x0b0a('0x3b')](_0x361853[_0x0b0a('0x39')],{'$or':_[_0x0b0a('0x3c')](_0x12fcb8,function(_0x40b97b){if(_0x40b97b[_0x0b0a('0x2d')]!=='VIRTUAL'){var _0x146e6d={};_0x146e6d[_0x40b97b['name']]={'$like':'%'+_0x3b6ac0['query'][_0x0b0a('0x3a')]+'%'};return _0x146e6d;}})});}_0x361853=_[_0x0b0a('0x3b')]({},_0x361853,_0x3b6ac0[_0x0b0a('0x3d')]);var _0x2709eb={'where':_0x361853['where']};return db[_0x0b0a('0x2a')][_0x0b0a('0x1e')](_0x2709eb)['then'](function(_0x13f3e2){_0xb9a201[_0x0b0a('0x1e')]=_0x13f3e2;if(_0x3b6ac0[_0x0b0a('0x2f')][_0x0b0a('0x3e')]){_0x361853[_0x0b0a('0x3f')]=[{'all':!![]}];}return db[_0x0b0a('0x2a')][_0x0b0a('0x40')](_0x361853);})[_0x0b0a('0x25')](function(_0x2071d7){_0xb9a201['rows']=_0x2071d7;return _0xb9a201;})['then'](respondWithFilteredResult(_0x5f2db0,_0x361853))[_0x0b0a('0x41')](handleError(_0x5f2db0,null));};exports[_0x0b0a('0x42')]=function(_0x41c149,_0x17330c){var _0x33730f={'raw':![],'where':{'id':_0x41c149[_0x0b0a('0x43')]['id']}},_0x1f09df={};_0x1f09df[_0x0b0a('0x2e')]=_[_0x0b0a('0x30')](db[_0x0b0a('0x2a')][_0x0b0a('0x2b')]);_0x1f09df['query']=_[_0x0b0a('0x30')](_0x41c149['query']);_0x1f09df['filters']=_[_0x0b0a('0x32')](_0x1f09df['model'],_0x1f09df[_0x0b0a('0x2f')]);_0x33730f['attributes']=_[_0x0b0a('0x32')](_0x1f09df[_0x0b0a('0x2e')],qs[_0x0b0a('0x34')](_0x41c149['query'][_0x0b0a('0x34')]));_0x33730f[_0x0b0a('0x33')]=_0x33730f['attributes']['length']?_0x33730f[_0x0b0a('0x33')]:_0x1f09df[_0x0b0a('0x2e')];if(_0x41c149[_0x0b0a('0x2f')][_0x0b0a('0x3e')]){_0x33730f[_0x0b0a('0x3f')]=[{'all':!![]}];}_0x33730f=_[_0x0b0a('0x3b')]({},_0x33730f,_0x41c149['options']);return db[_0x0b0a('0x2a')][_0x0b0a('0x44')](_0x33730f)[_0x0b0a('0x25')](handleEntityNotFound(_0x17330c,null))[_0x0b0a('0x25')](respondWithResult(_0x17330c,null))[_0x0b0a('0x41')](handleError(_0x17330c,null));};exports[_0x0b0a('0x45')]=function(_0x4935a4,_0x3eb702){return db['FreshdeskConfiguration'][_0x0b0a('0x45')](_0x4935a4[_0x0b0a('0x46')],{})[_0x0b0a('0x25')](respondWithResult(_0x3eb702,0xc9))[_0x0b0a('0x41')](handleError(_0x3eb702,null));};exports['update']=function(_0x132537,_0x184bbf){if(_0x132537[_0x0b0a('0x46')]['id']){delete _0x132537[_0x0b0a('0x46')]['id'];}return db[_0x0b0a('0x2a')][_0x0b0a('0x44')]({'where':{'id':_0x132537[_0x0b0a('0x43')]['id']}})[_0x0b0a('0x25')](handleEntityNotFound(_0x184bbf,null))[_0x0b0a('0x25')](saveUpdates(_0x132537[_0x0b0a('0x46')],null))[_0x0b0a('0x25')](respondWithResult(_0x184bbf,null))[_0x0b0a('0x41')](handleError(_0x184bbf,null));};exports['destroy']=function(_0x3b6c64,_0x3f1707){return db[_0x0b0a('0x2a')][_0x0b0a('0x44')]({'where':{'id':_0x3b6c64['params']['id']}})['then'](handleEntityNotFound(_0x3f1707,null))['then'](removeEntity(_0x3f1707,null))[_0x0b0a('0x41')](handleError(_0x3f1707,null));};exports['getFields']=function(_0x30e6fd,_0x468ffa,_0x7372d2){var _0x5d809={};var _0x57e3cf={};var _0xe4e60d;var _0x727f39;return db[_0x0b0a('0x2a')]['findOne']({'where':{'id':_0x30e6fd['params']['id']}})[_0x0b0a('0x25')](handleEntityNotFound(_0x468ffa,null))[_0x0b0a('0x25')](function(_0x5d447f){if(_0x5d447f){_0xe4e60d=_0x5d447f;_0x57e3cf[_0x0b0a('0x2e')]=_[_0x0b0a('0x30')](db[_0x0b0a('0x47')]['rawAttributes']);_0x57e3cf[_0x0b0a('0x2f')]=_[_0x0b0a('0x30')](_0x30e6fd[_0x0b0a('0x2f')]);_0x57e3cf[_0x0b0a('0x31')]=_[_0x0b0a('0x32')](_0x57e3cf[_0x0b0a('0x2e')],_0x57e3cf['query']);_0x5d809[_0x0b0a('0x33')]=_['intersection'](_0x57e3cf['model'],qs['fields'](_0x30e6fd['query']['fields']));_0x5d809[_0x0b0a('0x33')]=_0x5d809[_0x0b0a('0x33')][_0x0b0a('0x35')]?_0x5d809[_0x0b0a('0x33')]:_0x57e3cf['model'];_0x5d809[_0x0b0a('0x37')]=qs[_0x0b0a('0x38')](_0x30e6fd[_0x0b0a('0x2f')]['sort']);_0x5d809[_0x0b0a('0x39')]=qs['filters'](_[_0x0b0a('0x48')](_0x30e6fd[_0x0b0a('0x2f')],_0x57e3cf[_0x0b0a('0x31')]));if(_0x30e6fd[_0x0b0a('0x2f')][_0x0b0a('0x3a')]){_0x5d809[_0x0b0a('0x39')]=_[_0x0b0a('0x3b')](_0x5d809['where'],{'$or':_[_0x0b0a('0x3c')](_0x5d809[_0x0b0a('0x33')],function(_0x5795ee){var _0x43221={};_0x43221[_0x5795ee]={'$like':'%'+_0x30e6fd[_0x0b0a('0x2f')][_0x0b0a('0x3a')]+'%'};return _0x43221;})});}_0x5d809=_[_0x0b0a('0x3b')]({},_0x5d809,_0x30e6fd['options']);return _0xe4e60d[_0x0b0a('0x49')](_0x5d809);}})[_0x0b0a('0x25')](function(_0x5b5c7a){if(_0x5b5c7a){_0x727f39=_0x5b5c7a[_0x0b0a('0x35')];if(!_0x30e6fd['query']['hasOwnProperty']('nolimit')){_0x5d809[_0x0b0a('0x1c')]=qs['limit'](_0x30e6fd['query'][_0x0b0a('0x1c')]);_0x5d809[_0x0b0a('0x1b')]=qs[_0x0b0a('0x1b')](_0x30e6fd['query']['offset']);}return _0xe4e60d[_0x0b0a('0x49')](_0x5d809);}})[_0x0b0a('0x25')](function(_0x495de2){if(_0x495de2){return _0x495de2?{'count':_0x727f39,'rows':_0x495de2}:null;}})['then'](respondWithResult(_0x468ffa,null))[_0x0b0a('0x41')](handleError(_0x468ffa,null));};exports[_0x0b0a('0x4a')]=function(_0x2d5068,_0x47f122,_0x407564){var _0x40332b={};var _0x4e2119={};var _0x5d791b;var _0x51c772;return db[_0x0b0a('0x2a')][_0x0b0a('0x4b')]({'where':{'id':_0x2d5068['params']['id']}})[_0x0b0a('0x25')](handleEntityNotFound(_0x47f122,null))[_0x0b0a('0x25')](function(_0x4e1311){if(_0x4e1311){_0x5d791b=_0x4e1311;_0x4e2119[_0x0b0a('0x2e')]=_[_0x0b0a('0x30')](db[_0x0b0a('0x47')][_0x0b0a('0x2b')]);_0x4e2119[_0x0b0a('0x2f')]=_[_0x0b0a('0x30')](_0x2d5068[_0x0b0a('0x2f')]);_0x4e2119['filters']=_[_0x0b0a('0x32')](_0x4e2119[_0x0b0a('0x2e')],_0x4e2119['query']);_0x40332b[_0x0b0a('0x33')]=_[_0x0b0a('0x32')](_0x4e2119[_0x0b0a('0x2e')],qs['fields'](_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x34')]));_0x40332b[_0x0b0a('0x33')]=_0x40332b['attributes'][_0x0b0a('0x35')]?_0x40332b[_0x0b0a('0x33')]:_0x4e2119['model'];_0x40332b[_0x0b0a('0x37')]=qs[_0x0b0a('0x38')](_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x38')]);_0x40332b['where']=qs[_0x0b0a('0x31')](_[_0x0b0a('0x48')](_0x2d5068[_0x0b0a('0x2f')],_0x4e2119[_0x0b0a('0x31')]));if(_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x3a')]){_0x40332b[_0x0b0a('0x39')]=_[_0x0b0a('0x3b')](_0x40332b['where'],{'$or':_[_0x0b0a('0x3c')](_0x40332b['attributes'],function(_0x4396ee){var _0x41ccb1={};_0x41ccb1[_0x4396ee]={'$like':'%'+_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x3a')]+'%'};return _0x41ccb1;})});}_0x40332b=_['merge']({},_0x40332b,_0x2d5068[_0x0b0a('0x3d')]);return _0x5d791b[_0x0b0a('0x4a')](_0x40332b);}})[_0x0b0a('0x25')](function(_0x50b424){if(_0x50b424){_0x51c772=_0x50b424[_0x0b0a('0x35')];if(!_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x4c')]('nolimit')){_0x40332b[_0x0b0a('0x1c')]=qs[_0x0b0a('0x1c')](_0x2d5068['query'][_0x0b0a('0x1c')]);_0x40332b[_0x0b0a('0x1b')]=qs['offset'](_0x2d5068[_0x0b0a('0x2f')][_0x0b0a('0x1b')]);}return _0x5d791b[_0x0b0a('0x4a')](_0x40332b);}})['then'](function(_0x17c95c){if(_0x17c95c){return _0x17c95c?{'count':_0x51c772,'rows':_0x17c95c}:null;}})['then'](respondWithResult(_0x47f122,null))[_0x0b0a('0x41')](handleError(_0x47f122,null));};exports['getDescriptions']=function(_0x25eec0,_0x583750,_0x3887e6){var _0x373744={};var _0x366e2f={};var _0x2a7e2b;var _0x20ee51;return db[_0x0b0a('0x2a')][_0x0b0a('0x4b')]({'where':{'id':_0x25eec0['params']['id']}})[_0x0b0a('0x25')](handleEntityNotFound(_0x583750,null))[_0x0b0a('0x25')](function(_0x712b5){if(_0x712b5){_0x2a7e2b=_0x712b5;_0x366e2f[_0x0b0a('0x2e')]=_[_0x0b0a('0x30')](db[_0x0b0a('0x47')][_0x0b0a('0x2b')]);_0x366e2f[_0x0b0a('0x2f')]=_[_0x0b0a('0x30')](_0x25eec0[_0x0b0a('0x2f')]);_0x366e2f['filters']=_[_0x0b0a('0x32')](_0x366e2f[_0x0b0a('0x2e')],_0x366e2f[_0x0b0a('0x2f')]);_0x373744['attributes']=_['intersection'](_0x366e2f['model'],qs[_0x0b0a('0x34')](_0x25eec0[_0x0b0a('0x2f')]['fields']));_0x373744[_0x0b0a('0x33')]=_0x373744['attributes']['length']?_0x373744['attributes']:_0x366e2f[_0x0b0a('0x2e')];_0x373744[_0x0b0a('0x37')]=qs[_0x0b0a('0x38')](_0x25eec0['query'][_0x0b0a('0x38')]);_0x373744['where']=qs['filters'](_[_0x0b0a('0x48')](_0x25eec0[_0x0b0a('0x2f')],_0x366e2f[_0x0b0a('0x31')]));if(_0x25eec0[_0x0b0a('0x2f')][_0x0b0a('0x3a')]){_0x373744['where']=_['merge'](_0x373744['where'],{'$or':_[_0x0b0a('0x3c')](_0x373744[_0x0b0a('0x33')],function(_0x5b0dcf){var _0x384288={};_0x384288[_0x5b0dcf]={'$like':'%'+_0x25eec0[_0x0b0a('0x2f')]['filter']+'%'};return _0x384288;})});}_0x373744=_[_0x0b0a('0x3b')]({},_0x373744,_0x25eec0[_0x0b0a('0x3d')]);return _0x2a7e2b[_0x0b0a('0x4d')](_0x373744);}})[_0x0b0a('0x25')](function(_0x367d45){if(_0x367d45){_0x20ee51=_0x367d45[_0x0b0a('0x35')];if(!_0x25eec0['query'][_0x0b0a('0x4c')]('nolimit')){_0x373744[_0x0b0a('0x1c')]=qs[_0x0b0a('0x1c')](_0x25eec0[_0x0b0a('0x2f')][_0x0b0a('0x1c')]);_0x373744[_0x0b0a('0x1b')]=qs[_0x0b0a('0x1b')](_0x25eec0['query'][_0x0b0a('0x1b')]);}return _0x2a7e2b[_0x0b0a('0x4d')](_0x373744);}})[_0x0b0a('0x25')](function(_0x283051){if(_0x283051){return _0x283051?{'count':_0x20ee51,'rows':_0x283051}:null;}})[_0x0b0a('0x25')](respondWithResult(_0x583750,null))[_0x0b0a('0x41')](handleError(_0x583750,null));};exports[_0x0b0a('0x4e')]=function(_0x2e241f,_0x58bd79,_0x2b4ede){var _0x197c60={};var _0x1101cd={};var _0x845230;var _0x43b4b3;return db[_0x0b0a('0x2a')][_0x0b0a('0x4b')]({'where':{'id':_0x2e241f[_0x0b0a('0x43')]['id']}})[_0x0b0a('0x25')](handleEntityNotFound(_0x58bd79,null))[_0x0b0a('0x25')](function(_0x4b142e){if(_0x4b142e){_0x845230=_0x4b142e;_0x1101cd[_0x0b0a('0x2e')]=_[_0x0b0a('0x30')](db['Tag'][_0x0b0a('0x2b')]);_0x1101cd[_0x0b0a('0x2f')]=_[_0x0b0a('0x30')](_0x2e241f['query']);_0x1101cd[_0x0b0a('0x31')]=_[_0x0b0a('0x32')](_0x1101cd['model'],_0x1101cd['query']);_0x197c60[_0x0b0a('0x33')]=_[_0x0b0a('0x32')](_0x1101cd['model'],qs[_0x0b0a('0x34')](_0x2e241f[_0x0b0a('0x2f')]['fields']));_0x197c60[_0x0b0a('0x33')]=_0x197c60[_0x0b0a('0x33')]['length']?_0x197c60[_0x0b0a('0x33')]:_0x1101cd['model'];_0x197c60['order']=qs[_0x0b0a('0x38')](_0x2e241f['query'][_0x0b0a('0x38')]);_0x197c60['where']=qs['filters'](_[_0x0b0a('0x48')](_0x2e241f['query'],_0x1101cd[_0x0b0a('0x31')]));if(_0x2e241f[_0x0b0a('0x2f')][_0x0b0a('0x3a')]){_0x197c60[_0x0b0a('0x39')]=_[_0x0b0a('0x3b')](_0x197c60['where'],{'$or':_[_0x0b0a('0x3c')](_0x197c60[_0x0b0a('0x33')],function(_0x215a0a){var _0x46268b={};_0x46268b[_0x215a0a]={'$like':'%'+_0x2e241f[_0x0b0a('0x2f')][_0x0b0a('0x3a')]+'%'};return _0x46268b;})});}_0x197c60=_[_0x0b0a('0x3b')]({},_0x197c60,_0x2e241f[_0x0b0a('0x3d')]);return _0x845230[_0x0b0a('0x4e')](_0x197c60);}})[_0x0b0a('0x25')](function(_0x4680f3){if(_0x4680f3){_0x43b4b3=_0x4680f3['length'];if(!_0x2e241f['query'][_0x0b0a('0x4c')](_0x0b0a('0x36'))){_0x197c60[_0x0b0a('0x1c')]=qs[_0x0b0a('0x1c')](_0x2e241f[_0x0b0a('0x2f')][_0x0b0a('0x1c')]);_0x197c60[_0x0b0a('0x1b')]=qs[_0x0b0a('0x1b')](_0x2e241f[_0x0b0a('0x2f')]['offset']);}return _0x845230[_0x0b0a('0x4e')](_0x197c60);}})['then'](function(_0x3634b7){if(_0x3634b7){return _0x3634b7?{'count':_0x43b4b3,'rows':_0x3634b7}:null;}})[_0x0b0a('0x25')](respondWithResult(_0x58bd79,null))[_0x0b0a('0x41')](handleError(_0x58bd79,null));};exports[_0x0b0a('0x4f')]=function(_0x338985,_0x3eddcc,_0x175bd7){if(_0x338985[_0x0b0a('0x46')]['id']){delete _0x338985[_0x0b0a('0x46')]['id'];}return db[_0x0b0a('0x2a')][_0x0b0a('0x4b')]({'where':{'id':_0x338985['params']['id']}})['then'](handleEntityNotFound(_0x3eddcc,null))[_0x0b0a('0x25')](function(_0x535d8b){if(_0x535d8b){return _0x535d8b[_0x0b0a('0x4f')](_0x338985[_0x0b0a('0x46')][_0x0b0a('0x50')]||[]);}return null;})[_0x0b0a('0x25')](respondWithResult(_0x3eddcc,null))['catch'](handleError(_0x3eddcc,null));}; \ No newline at end of file +var _0xf19c=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','keys','find','create','body','params','findOne','FreshdeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis'];(function(_0x82c7c4,_0x3d9534){var _0x1cf158=function(_0x38bbef){while(--_0x38bbef){_0x82c7c4['push'](_0x82c7c4['shift']());}};_0x1cf158(++_0x3d9534);}(_0xf19c,0x93));var _0xcf19=function(_0x1b5763,_0x42dc8a){_0x1b5763=_0x1b5763-0x0;var _0xcd16bc=_0xf19c[_0x1b5763];return _0xcd16bc;};'use strict';var emlformat=require(_0xcf19('0x0'));var rimraf=require(_0xcf19('0x1'));var zipdir=require(_0xcf19('0x2'));var jsonpatch=require(_0xcf19('0x3'));var rp=require('request-promise');var moment=require(_0xcf19('0x4'));var BPromise=require(_0xcf19('0x5'));var Mustache=require(_0xcf19('0x6'));var util=require(_0xcf19('0x7'));var path=require(_0xcf19('0x8'));var sox=require('sox');var csv=require(_0xcf19('0x9'));var ejs=require(_0xcf19('0xa'));var fs=require('fs');var fs_extra=require(_0xcf19('0xb'));var _=require(_0xcf19('0xc'));var squel=require(_0xcf19('0xd'));var crypto=require(_0xcf19('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcf19('0xf'));var toCsv=require(_0xcf19('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcf19('0x10'));var authService=require(_0xcf19('0x11'));var qs=require(_0xcf19('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf19('0x13'));var logger=require(_0xcf19('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xcf19('0x15'));var licenseUtil=require(_0xcf19('0x16'));var db=require(_0xcf19('0x17'))['db'];function respondWithStatusCode(_0x4ca092,_0x69705f){_0x69705f=_0x69705f||0xcc;return function(_0x3c3e81){if(_0x3c3e81){return _0x4ca092[_0xcf19('0x18')](_0x69705f);}return _0x4ca092[_0xcf19('0x19')](_0x69705f)['end']();};}function respondWithResult(_0x39ea2a,_0x13f0d0){_0x13f0d0=_0x13f0d0||0xc8;return function(_0x59461d){if(_0x59461d){return _0x39ea2a[_0xcf19('0x19')](_0x13f0d0)[_0xcf19('0x1a')](_0x59461d);}};}function respondWithFilteredResult(_0x360fe5,_0x14c030){return function(_0x1c4aa6){if(_0x1c4aa6){var _0x47caa3=typeof _0x14c030[_0xcf19('0x1b')]===_0xcf19('0x1c')&&typeof _0x14c030[_0xcf19('0x1d')]==='undefined';var _0x1f4503=_0x1c4aa6[_0xcf19('0x1e')];var _0x474589=_0x47caa3?0x0:_0x14c030[_0xcf19('0x1b')];var _0xde0459=_0x47caa3?_0x1c4aa6[_0xcf19('0x1e')]:_0x14c030[_0xcf19('0x1b')]+_0x14c030[_0xcf19('0x1d')];var _0x4ed452;if(_0xde0459>=_0x1f4503){_0xde0459=_0x1f4503;_0x4ed452=0xc8;}else{_0x4ed452=0xce;}_0x360fe5['status'](_0x4ed452);return _0x360fe5[_0xcf19('0x1f')](_0xcf19('0x20'),_0x474589+'-'+_0xde0459+'/'+_0x1f4503)[_0xcf19('0x1a')](_0x1c4aa6);}return null;};}function patchUpdates(_0x3932d5){return function(_0x390fc1){try{jsonpatch['apply'](_0x390fc1,_0x3932d5,!![]);}catch(_0x4e0036){return BPromise[_0xcf19('0x21')](_0x4e0036);}return _0x390fc1['save']();};}function saveUpdates(_0x3e309d,_0x44cd5f){return function(_0x3999fe){if(_0x3999fe){return _0x3999fe[_0xcf19('0x22')](_0x3e309d)[_0xcf19('0x23')](function(_0x392a0f){return _0x392a0f;});}return null;};}function removeEntity(_0x4d3e22,_0x14d16d){return function(_0x501915){if(_0x501915){return _0x501915[_0xcf19('0x24')]()[_0xcf19('0x23')](function(){_0x4d3e22[_0xcf19('0x19')](0xcc)[_0xcf19('0x25')]();});}};}function handleEntityNotFound(_0x30eb63,_0x5dab60){return function(_0x258931){if(!_0x258931){_0x30eb63[_0xcf19('0x18')](0x194);}return _0x258931;};}function handleError(_0x514df4,_0x2b1b72){_0x2b1b72=_0x2b1b72||0x1f4;return function(_0x5d88fc){logger[_0xcf19('0x26')](_0x5d88fc[_0xcf19('0x27')]);if(_0x5d88fc[_0xcf19('0x28')]){delete _0x5d88fc[_0xcf19('0x28')];}_0x514df4['status'](_0x2b1b72)['send'](_0x5d88fc);};}exports[_0xcf19('0x29')]=function(_0x46ff67,_0x1a59ac){var _0x3a45f0={},_0x24fdbe={},_0x5f2397={'count':0x0,'rows':[]};var _0xe8b421=_[_0xcf19('0x2a')](db['FreshdeskConfiguration'][_0xcf19('0x2b')],function(_0x56a188){return{'name':_0x56a188[_0xcf19('0x2c')],'type':_0x56a188[_0xcf19('0x2d')][_0xcf19('0x2e')]};});_0x24fdbe['model']=_[_0xcf19('0x2a')](_0xe8b421,_0xcf19('0x28'));_0x24fdbe[_0xcf19('0x2f')]=_['keys'](_0x46ff67[_0xcf19('0x2f')]);_0x24fdbe['filters']=_[_0xcf19('0x30')](_0x24fdbe[_0xcf19('0x31')],_0x24fdbe[_0xcf19('0x2f')]);_0x3a45f0[_0xcf19('0x32')]=_['intersection'](_0x24fdbe['model'],qs[_0xcf19('0x33')](_0x46ff67['query'][_0xcf19('0x33')]));_0x3a45f0[_0xcf19('0x32')]=_0x3a45f0[_0xcf19('0x32')][_0xcf19('0x34')]?_0x3a45f0[_0xcf19('0x32')]:_0x24fdbe[_0xcf19('0x31')];if(!_0x46ff67[_0xcf19('0x2f')]['hasOwnProperty'](_0xcf19('0x35'))){_0x3a45f0[_0xcf19('0x1d')]=qs[_0xcf19('0x1d')](_0x46ff67[_0xcf19('0x2f')][_0xcf19('0x1d')]);_0x3a45f0[_0xcf19('0x1b')]=qs[_0xcf19('0x1b')](_0x46ff67[_0xcf19('0x2f')][_0xcf19('0x1b')]);}_0x3a45f0[_0xcf19('0x36')]=qs[_0xcf19('0x37')](_0x46ff67[_0xcf19('0x2f')][_0xcf19('0x37')]);_0x3a45f0['where']=qs[_0xcf19('0x38')](_[_0xcf19('0x39')](_0x46ff67['query'],_0x24fdbe[_0xcf19('0x38')]),_0xe8b421);if(_0x46ff67[_0xcf19('0x2f')][_0xcf19('0x3a')]){_0x3a45f0[_0xcf19('0x3b')]=_[_0xcf19('0x3c')](_0x3a45f0[_0xcf19('0x3b')],{'$or':_[_0xcf19('0x2a')](_0xe8b421,function(_0xfe5245){if(_0xfe5245['type']!=='VIRTUAL'){var _0xc96c26={};_0xc96c26[_0xfe5245[_0xcf19('0x28')]]={'$like':'%'+_0x46ff67[_0xcf19('0x2f')][_0xcf19('0x3a')]+'%'};return _0xc96c26;}})});}_0x3a45f0=_[_0xcf19('0x3c')]({},_0x3a45f0,_0x46ff67[_0xcf19('0x3d')]);var _0x44c38a={'where':_0x3a45f0['where']};return db[_0xcf19('0x3e')][_0xcf19('0x1e')](_0x44c38a)['then'](function(_0x3acfa2){_0x5f2397[_0xcf19('0x1e')]=_0x3acfa2;if(_0x46ff67['query'][_0xcf19('0x3f')]){_0x3a45f0[_0xcf19('0x40')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xcf19('0x41')](_0x3a45f0);})[_0xcf19('0x23')](function(_0x256770){_0x5f2397[_0xcf19('0x42')]=_0x256770;return _0x5f2397;})[_0xcf19('0x23')](respondWithFilteredResult(_0x1a59ac,_0x3a45f0))[_0xcf19('0x43')](handleError(_0x1a59ac,null));};exports['show']=function(_0x38fa91,_0x42c1eb){var _0x3d5d4a={'raw':![],'where':{'id':_0x38fa91['params']['id']}},_0x47ee02={};_0x47ee02[_0xcf19('0x31')]=_['keys'](db[_0xcf19('0x3e')][_0xcf19('0x2b')]);_0x47ee02[_0xcf19('0x2f')]=_[_0xcf19('0x44')](_0x38fa91[_0xcf19('0x2f')]);_0x47ee02[_0xcf19('0x38')]=_[_0xcf19('0x30')](_0x47ee02[_0xcf19('0x31')],_0x47ee02[_0xcf19('0x2f')]);_0x3d5d4a['attributes']=_['intersection'](_0x47ee02[_0xcf19('0x31')],qs[_0xcf19('0x33')](_0x38fa91['query'][_0xcf19('0x33')]));_0x3d5d4a[_0xcf19('0x32')]=_0x3d5d4a[_0xcf19('0x32')][_0xcf19('0x34')]?_0x3d5d4a['attributes']:_0x47ee02[_0xcf19('0x31')];if(_0x38fa91['query'][_0xcf19('0x3f')]){_0x3d5d4a[_0xcf19('0x40')]=[{'all':!![]}];}_0x3d5d4a=_[_0xcf19('0x3c')]({},_0x3d5d4a,_0x38fa91[_0xcf19('0x3d')]);return db[_0xcf19('0x3e')][_0xcf19('0x45')](_0x3d5d4a)[_0xcf19('0x23')](handleEntityNotFound(_0x42c1eb,null))[_0xcf19('0x23')](respondWithResult(_0x42c1eb,null))[_0xcf19('0x43')](handleError(_0x42c1eb,null));};exports[_0xcf19('0x46')]=function(_0x303abc,_0x3bf820){return db[_0xcf19('0x3e')][_0xcf19('0x46')](_0x303abc[_0xcf19('0x47')],{})['then'](respondWithResult(_0x3bf820,0xc9))[_0xcf19('0x43')](handleError(_0x3bf820,null));};exports[_0xcf19('0x22')]=function(_0x235485,_0x298c1d){if(_0x235485[_0xcf19('0x47')]['id']){delete _0x235485[_0xcf19('0x47')]['id'];}return db[_0xcf19('0x3e')][_0xcf19('0x45')]({'where':{'id':_0x235485['params']['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x298c1d,null))['then'](saveUpdates(_0x235485[_0xcf19('0x47')],null))['then'](respondWithResult(_0x298c1d,null))[_0xcf19('0x43')](handleError(_0x298c1d,null));};exports['destroy']=function(_0x1dfa8f,_0x1ad2c5){return db[_0xcf19('0x3e')][_0xcf19('0x45')]({'where':{'id':_0x1dfa8f[_0xcf19('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ad2c5,null))[_0xcf19('0x23')](removeEntity(_0x1ad2c5,null))['catch'](handleError(_0x1ad2c5,null));};exports['getFields']=function(_0x4bc51a,_0x27805a,_0x27f7f8){var _0x1fcce5={};var _0x42410d={};var _0x22c1d5;var _0x2192fc;return db[_0xcf19('0x3e')][_0xcf19('0x49')]({'where':{'id':_0x4bc51a[_0xcf19('0x48')]['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x27805a,null))[_0xcf19('0x23')](function(_0x43ed81){if(_0x43ed81){_0x22c1d5=_0x43ed81;_0x42410d['model']=_[_0xcf19('0x44')](db[_0xcf19('0x4a')][_0xcf19('0x2b')]);_0x42410d[_0xcf19('0x2f')]=_[_0xcf19('0x44')](_0x4bc51a[_0xcf19('0x2f')]);_0x42410d[_0xcf19('0x38')]=_[_0xcf19('0x30')](_0x42410d['model'],_0x42410d['query']);_0x1fcce5[_0xcf19('0x32')]=_[_0xcf19('0x30')](_0x42410d['model'],qs[_0xcf19('0x33')](_0x4bc51a[_0xcf19('0x2f')]['fields']));_0x1fcce5[_0xcf19('0x32')]=_0x1fcce5[_0xcf19('0x32')][_0xcf19('0x34')]?_0x1fcce5[_0xcf19('0x32')]:_0x42410d[_0xcf19('0x31')];_0x1fcce5[_0xcf19('0x36')]=qs[_0xcf19('0x37')](_0x4bc51a[_0xcf19('0x2f')][_0xcf19('0x37')]);_0x1fcce5[_0xcf19('0x3b')]=qs['filters'](_[_0xcf19('0x39')](_0x4bc51a[_0xcf19('0x2f')],_0x42410d[_0xcf19('0x38')]));if(_0x4bc51a[_0xcf19('0x2f')][_0xcf19('0x3a')]){_0x1fcce5[_0xcf19('0x3b')]=_['merge'](_0x1fcce5[_0xcf19('0x3b')],{'$or':_[_0xcf19('0x2a')](_0x1fcce5[_0xcf19('0x32')],function(_0x310784){var _0x4dacc8={};_0x4dacc8[_0x310784]={'$like':'%'+_0x4bc51a[_0xcf19('0x2f')]['filter']+'%'};return _0x4dacc8;})});}_0x1fcce5=_[_0xcf19('0x3c')]({},_0x1fcce5,_0x4bc51a[_0xcf19('0x3d')]);return _0x22c1d5['getFields'](_0x1fcce5);}})[_0xcf19('0x23')](function(_0x1efd85){if(_0x1efd85){_0x2192fc=_0x1efd85['length'];if(!_0x4bc51a[_0xcf19('0x2f')][_0xcf19('0x4b')](_0xcf19('0x35'))){_0x1fcce5[_0xcf19('0x1d')]=qs[_0xcf19('0x1d')](_0x4bc51a[_0xcf19('0x2f')][_0xcf19('0x1d')]);_0x1fcce5[_0xcf19('0x1b')]=qs['offset'](_0x4bc51a[_0xcf19('0x2f')][_0xcf19('0x1b')]);}return _0x22c1d5['getFields'](_0x1fcce5);}})[_0xcf19('0x23')](function(_0x2921da){if(_0x2921da){return _0x2921da?{'count':_0x2192fc,'rows':_0x2921da}:null;}})[_0xcf19('0x23')](respondWithResult(_0x27805a,null))[_0xcf19('0x43')](handleError(_0x27805a,null));};exports[_0xcf19('0x4c')]=function(_0x54a420,_0x688cc2,_0x15db70){var _0x3257ec={};var _0x5271b1={};var _0x42d43b;var _0x2ba747;return db[_0xcf19('0x3e')]['findOne']({'where':{'id':_0x54a420[_0xcf19('0x48')]['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x688cc2,null))[_0xcf19('0x23')](function(_0x210176){if(_0x210176){_0x42d43b=_0x210176;_0x5271b1[_0xcf19('0x31')]=_[_0xcf19('0x44')](db[_0xcf19('0x4a')]['rawAttributes']);_0x5271b1[_0xcf19('0x2f')]=_[_0xcf19('0x44')](_0x54a420[_0xcf19('0x2f')]);_0x5271b1[_0xcf19('0x38')]=_[_0xcf19('0x30')](_0x5271b1[_0xcf19('0x31')],_0x5271b1[_0xcf19('0x2f')]);_0x3257ec[_0xcf19('0x32')]=_[_0xcf19('0x30')](_0x5271b1['model'],qs[_0xcf19('0x33')](_0x54a420[_0xcf19('0x2f')][_0xcf19('0x33')]));_0x3257ec[_0xcf19('0x32')]=_0x3257ec[_0xcf19('0x32')][_0xcf19('0x34')]?_0x3257ec[_0xcf19('0x32')]:_0x5271b1[_0xcf19('0x31')];_0x3257ec[_0xcf19('0x36')]=qs['sort'](_0x54a420[_0xcf19('0x2f')][_0xcf19('0x37')]);_0x3257ec['where']=qs['filters'](_['pick'](_0x54a420[_0xcf19('0x2f')],_0x5271b1['filters']));if(_0x54a420[_0xcf19('0x2f')][_0xcf19('0x3a')]){_0x3257ec[_0xcf19('0x3b')]=_[_0xcf19('0x3c')](_0x3257ec[_0xcf19('0x3b')],{'$or':_[_0xcf19('0x2a')](_0x3257ec[_0xcf19('0x32')],function(_0x1d744f){var _0x15d85c={};_0x15d85c[_0x1d744f]={'$like':'%'+_0x54a420[_0xcf19('0x2f')][_0xcf19('0x3a')]+'%'};return _0x15d85c;})});}_0x3257ec=_[_0xcf19('0x3c')]({},_0x3257ec,_0x54a420[_0xcf19('0x3d')]);return _0x42d43b[_0xcf19('0x4c')](_0x3257ec);}})[_0xcf19('0x23')](function(_0x316e21){if(_0x316e21){_0x2ba747=_0x316e21[_0xcf19('0x34')];if(!_0x54a420['query'][_0xcf19('0x4b')](_0xcf19('0x35'))){_0x3257ec['limit']=qs['limit'](_0x54a420[_0xcf19('0x2f')][_0xcf19('0x1d')]);_0x3257ec[_0xcf19('0x1b')]=qs['offset'](_0x54a420['query']['offset']);}return _0x42d43b[_0xcf19('0x4c')](_0x3257ec);}})['then'](function(_0x1540b9){if(_0x1540b9){return _0x1540b9?{'count':_0x2ba747,'rows':_0x1540b9}:null;}})[_0xcf19('0x23')](respondWithResult(_0x688cc2,null))[_0xcf19('0x43')](handleError(_0x688cc2,null));};exports['getDescriptions']=function(_0x2a7707,_0x4b8a0b,_0x542989){var _0x5393b1={};var _0x4440b5={};var _0x31b844;var _0x285103;return db[_0xcf19('0x3e')][_0xcf19('0x49')]({'where':{'id':_0x2a7707[_0xcf19('0x48')]['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x4b8a0b,null))[_0xcf19('0x23')](function(_0x3e3a63){if(_0x3e3a63){_0x31b844=_0x3e3a63;_0x4440b5['model']=_[_0xcf19('0x44')](db[_0xcf19('0x4a')][_0xcf19('0x2b')]);_0x4440b5[_0xcf19('0x2f')]=_[_0xcf19('0x44')](_0x2a7707[_0xcf19('0x2f')]);_0x4440b5['filters']=_[_0xcf19('0x30')](_0x4440b5[_0xcf19('0x31')],_0x4440b5['query']);_0x5393b1[_0xcf19('0x32')]=_[_0xcf19('0x30')](_0x4440b5[_0xcf19('0x31')],qs[_0xcf19('0x33')](_0x2a7707['query'][_0xcf19('0x33')]));_0x5393b1[_0xcf19('0x32')]=_0x5393b1[_0xcf19('0x32')]['length']?_0x5393b1[_0xcf19('0x32')]:_0x4440b5[_0xcf19('0x31')];_0x5393b1[_0xcf19('0x36')]=qs[_0xcf19('0x37')](_0x2a7707[_0xcf19('0x2f')]['sort']);_0x5393b1['where']=qs[_0xcf19('0x38')](_[_0xcf19('0x39')](_0x2a7707[_0xcf19('0x2f')],_0x4440b5[_0xcf19('0x38')]));if(_0x2a7707[_0xcf19('0x2f')][_0xcf19('0x3a')]){_0x5393b1[_0xcf19('0x3b')]=_['merge'](_0x5393b1[_0xcf19('0x3b')],{'$or':_[_0xcf19('0x2a')](_0x5393b1[_0xcf19('0x32')],function(_0x4c7e99){var _0x54cbd6={};_0x54cbd6[_0x4c7e99]={'$like':'%'+_0x2a7707[_0xcf19('0x2f')][_0xcf19('0x3a')]+'%'};return _0x54cbd6;})});}_0x5393b1=_[_0xcf19('0x3c')]({},_0x5393b1,_0x2a7707[_0xcf19('0x3d')]);return _0x31b844[_0xcf19('0x4d')](_0x5393b1);}})[_0xcf19('0x23')](function(_0x4590a2){if(_0x4590a2){_0x285103=_0x4590a2[_0xcf19('0x34')];if(!_0x2a7707[_0xcf19('0x2f')][_0xcf19('0x4b')](_0xcf19('0x35'))){_0x5393b1[_0xcf19('0x1d')]=qs[_0xcf19('0x1d')](_0x2a7707[_0xcf19('0x2f')][_0xcf19('0x1d')]);_0x5393b1[_0xcf19('0x1b')]=qs[_0xcf19('0x1b')](_0x2a7707[_0xcf19('0x2f')][_0xcf19('0x1b')]);}return _0x31b844['getDescriptions'](_0x5393b1);}})[_0xcf19('0x23')](function(_0x14b6a4){if(_0x14b6a4){return _0x14b6a4?{'count':_0x285103,'rows':_0x14b6a4}:null;}})[_0xcf19('0x23')](respondWithResult(_0x4b8a0b,null))[_0xcf19('0x43')](handleError(_0x4b8a0b,null));};exports[_0xcf19('0x4e')]=function(_0x29b9aa,_0x5f31c0,_0x41b4b6){var _0x5653ea={};var _0x414e7e={};var _0x41e81a;var _0x4420f4;return db[_0xcf19('0x3e')][_0xcf19('0x49')]({'where':{'id':_0x29b9aa['params']['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x5f31c0,null))[_0xcf19('0x23')](function(_0x2d462b){if(_0x2d462b){_0x41e81a=_0x2d462b;_0x414e7e[_0xcf19('0x31')]=_[_0xcf19('0x44')](db[_0xcf19('0x4f')][_0xcf19('0x2b')]);_0x414e7e[_0xcf19('0x2f')]=_['keys'](_0x29b9aa[_0xcf19('0x2f')]);_0x414e7e['filters']=_[_0xcf19('0x30')](_0x414e7e[_0xcf19('0x31')],_0x414e7e['query']);_0x5653ea['attributes']=_[_0xcf19('0x30')](_0x414e7e['model'],qs[_0xcf19('0x33')](_0x29b9aa['query']['fields']));_0x5653ea['attributes']=_0x5653ea[_0xcf19('0x32')][_0xcf19('0x34')]?_0x5653ea[_0xcf19('0x32')]:_0x414e7e[_0xcf19('0x31')];_0x5653ea['order']=qs[_0xcf19('0x37')](_0x29b9aa[_0xcf19('0x2f')][_0xcf19('0x37')]);_0x5653ea['where']=qs['filters'](_[_0xcf19('0x39')](_0x29b9aa[_0xcf19('0x2f')],_0x414e7e[_0xcf19('0x38')]));if(_0x29b9aa[_0xcf19('0x2f')][_0xcf19('0x3a')]){_0x5653ea[_0xcf19('0x3b')]=_[_0xcf19('0x3c')](_0x5653ea[_0xcf19('0x3b')],{'$or':_['map'](_0x5653ea[_0xcf19('0x32')],function(_0x3e3b16){var _0x4a937d={};_0x4a937d[_0x3e3b16]={'$like':'%'+_0x29b9aa[_0xcf19('0x2f')][_0xcf19('0x3a')]+'%'};return _0x4a937d;})});}_0x5653ea=_[_0xcf19('0x3c')]({},_0x5653ea,_0x29b9aa[_0xcf19('0x3d')]);return _0x41e81a[_0xcf19('0x4e')](_0x5653ea);}})['then'](function(_0x27251b){if(_0x27251b){_0x4420f4=_0x27251b[_0xcf19('0x34')];if(!_0x29b9aa[_0xcf19('0x2f')]['hasOwnProperty']('nolimit')){_0x5653ea[_0xcf19('0x1d')]=qs[_0xcf19('0x1d')](_0x29b9aa['query'][_0xcf19('0x1d')]);_0x5653ea['offset']=qs['offset'](_0x29b9aa[_0xcf19('0x2f')]['offset']);}return _0x41e81a[_0xcf19('0x4e')](_0x5653ea);}})[_0xcf19('0x23')](function(_0x26a884){if(_0x26a884){return _0x26a884?{'count':_0x4420f4,'rows':_0x26a884}:null;}})[_0xcf19('0x23')](respondWithResult(_0x5f31c0,null))[_0xcf19('0x43')](handleError(_0x5f31c0,null));};exports[_0xcf19('0x50')]=function(_0x19b01b,_0x4a722f,_0x2fb64f){if(_0x19b01b[_0xcf19('0x47')]['id']){delete _0x19b01b[_0xcf19('0x47')]['id'];}return db[_0xcf19('0x3e')][_0xcf19('0x49')]({'where':{'id':_0x19b01b['params']['id']}})[_0xcf19('0x23')](handleEntityNotFound(_0x4a722f,null))['then'](function(_0x526c2b){if(_0x526c2b){return _0x526c2b[_0xcf19('0x50')](_0x19b01b['body'][_0xcf19('0x51')]||[]);}return null;})[_0xcf19('0x23')](respondWithResult(_0x4a722f,null))[_0xcf19('0x43')](handleError(_0x4a722f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 6d48c89..b980ee6 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 _0xecfd=['FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xecfd,0x199));var _0xdecf=function(_0x4c4f54,_0x55c818){_0x4c4f54=_0x4c4f54-0x0;var _0x2a888c=_0xecfd[_0x4c4f54];return _0x2a888c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdecf('0x0'))('api');var moment=require(_0xdecf('0x1'));var BPromise=require(_0xdecf('0x2'));var rp=require(_0xdecf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdecf('0x4'));var config=require(_0xdecf('0x5'));var attributes=require(_0xdecf('0x6'));module[_0xdecf('0x7')]=function(_0x1bb905,_0x11a3f5){return _0x1bb905[_0xdecf('0x8')](_0xdecf('0x9'),attributes,{'tableName':_0xdecf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x550c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0x45aa0c,_0x3b1092){var _0x51b6a5=function(_0x54b824){while(--_0x54b824){_0x45aa0c['push'](_0x45aa0c['shift']());}};_0x51b6a5(++_0x3b1092);}(_0x550c,0x1ec));var _0xc550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc550('0x0'));var util=require(_0xc550('0x1'));var logger=require(_0xc550('0x2'))('api');var moment=require(_0xc550('0x3'));var BPromise=require(_0xc550('0x4'));var rp=require(_0xc550('0x5'));var fs=require('fs');var path=require(_0xc550('0x6'));var rimraf=require(_0xc550('0x7'));var config=require('../../config/environment');var attributes=require(_0xc550('0x8'));module[_0xc550('0x9')]=function(_0x420453,_0x46ad5a){return _0x420453[_0xc550('0xa')](_0xc550('0xb'),attributes,{'tableName':_0xc550('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index df456b8..a2eb2f6 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 _0xdaec=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5c3e7b,_0x53259c){var _0x18234e=function(_0x14c1fe){while(--_0x14c1fe){_0x5c3e7b['push'](_0x5c3e7b['shift']());}};_0x18234e(++_0x53259c);}(_0xdaec,0xda));var _0xcdae=function(_0x57d5c1,_0x55a5ef){_0x57d5c1=_0x57d5c1-0x0;var _0x4347c1=_0xdaec[_0x57d5c1];return _0x4347c1;};'use strict';var _=require(_0xcdae('0x0'));var util=require('util');var moment=require(_0xcdae('0x1'));var BPromise=require('bluebird');var rs=require(_0xcdae('0x2'));var fs=require('fs');var Redis=require(_0xcdae('0x3'));var db=require(_0xcdae('0x4'))['db'];var utils=require(_0xcdae('0x5'));var logger=require(_0xcdae('0x6'))(_0xcdae('0x7'));var config=require(_0xcdae('0x8'));var jayson=require(_0xcdae('0x9'));var client=jayson[_0xcdae('0xa')][_0xcdae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af7cb,_0x11b292,_0x4832ec){return new BPromise(function(_0x5a0306,_0x132833){return client[_0xcdae('0xc')](_0x3af7cb,_0x4832ec)[_0xcdae('0xd')](function(_0x1e8f39){logger[_0xcdae('0xe')](_0xcdae('0xf'),_0x11b292,_0xcdae('0x10'));logger['debug'](_0xcdae('0x11'),_0x11b292,_0xcdae('0x10'),JSON[_0xcdae('0x12')](_0x1e8f39));if(_0x1e8f39['error']){if(_0x1e8f39[_0xcdae('0x13')]['code']===0x1f4){logger[_0xcdae('0x13')](_0xcdae('0xf'),_0x11b292,_0x1e8f39[_0xcdae('0x13')]['message']);return _0x132833(_0x1e8f39[_0xcdae('0x13')][_0xcdae('0x14')]);}logger[_0xcdae('0x13')](_0xcdae('0xf'),_0x11b292,_0x1e8f39[_0xcdae('0x13')][_0xcdae('0x14')]);return _0x5a0306(_0x1e8f39['error']['message']);}else{logger[_0xcdae('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x11b292,'request\x20sent');_0x5a0306(_0x1e8f39[_0xcdae('0x15')][_0xcdae('0x14')]);}})[_0xcdae('0x16')](function(_0x2172f1){logger[_0xcdae('0x13')](_0xcdae('0xf'),_0x11b292,_0x2172f1);_0x132833(_0x2172f1);});});} \ No newline at end of file +var _0xd113=['jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d12b5,_0x3c47b1){var _0x4724a3=function(_0x54465b){while(--_0x54465b){_0x3d12b5['push'](_0x3d12b5['shift']());}};_0x4724a3(++_0x3c47b1);}(_0xd113,0x1b1));var _0x3d11=function(_0x41e270,_0x12d030){_0x41e270=_0x41e270-0x0;var _0x2485c3=_0xd113[_0x41e270];return _0x2485c3;};'use strict';var _=require(_0x3d11('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d11('0x1'));var db=require(_0x3d11('0x2'))['db'];var utils=require(_0x3d11('0x3'));var logger=require(_0x3d11('0x4'))(_0x3d11('0x5'));var config=require(_0x3d11('0x6'));var jayson=require(_0x3d11('0x7'));var client=jayson[_0x3d11('0x8')][_0x3d11('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x267534,_0x5127e3,_0x2bba24){return new BPromise(function(_0x520710,_0xbe388c){return client[_0x3d11('0xa')](_0x267534,_0x2bba24)[_0x3d11('0xb')](function(_0x283e0){logger[_0x3d11('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5127e3,_0x3d11('0xd'));logger[_0x3d11('0xe')](_0x3d11('0xf'),_0x5127e3,_0x3d11('0xd'),JSON[_0x3d11('0x10')](_0x283e0));if(_0x283e0[_0x3d11('0x11')]){if(_0x283e0['error'][_0x3d11('0x12')]===0x1f4){logger[_0x3d11('0x11')](_0x3d11('0x13'),_0x5127e3,_0x283e0['error'][_0x3d11('0x14')]);return _0xbe388c(_0x283e0['error'][_0x3d11('0x14')]);}logger[_0x3d11('0x11')](_0x3d11('0x13'),_0x5127e3,_0x283e0[_0x3d11('0x11')][_0x3d11('0x14')]);return _0x520710(_0x283e0[_0x3d11('0x11')][_0x3d11('0x14')]);}else{logger['info'](_0x3d11('0x13'),_0x5127e3,_0x3d11('0xd'));_0x520710(_0x283e0['result'][_0x3d11('0x14')]);}})[_0x3d11('0x15')](function(_0x5d26f9){logger['error'](_0x3d11('0x13'),_0x5127e3,_0x5d26f9);_0xbe388c(_0x5d26f9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 44ccb4c..a48c216 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 _0xa5a8=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x24f052,_0x2d48e6){var _0x26d48f=function(_0x1c4be5){while(--_0x1c4be5){_0x24f052['push'](_0x24f052['shift']());}};_0x26d48f(++_0x2d48e6);}(_0xa5a8,0x18a));var _0x8a5a=function(_0x349c9f,_0x3d4703){_0x349c9f=_0x349c9f-0x0;var _0x108243=_0xa5a8[_0x349c9f];return _0x108243;};'use strict';var multer=require(_0x8a5a('0x0'));var util=require(_0x8a5a('0x1'));var path=require(_0x8a5a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a5a('0x3'));var router=express[_0x8a5a('0x4')]();var fs_extra=require(_0x8a5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8a5a('0x6'));var config=require(_0x8a5a('0x7'));var controller=require(_0x8a5a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a5a('0x9')]);router[_0x8a5a('0xa')](_0x8a5a('0xb'),auth['isAuthenticated'](),controller[_0x8a5a('0xc')]);router[_0x8a5a('0xd')]('/',auth[_0x8a5a('0xe')](),controller[_0x8a5a('0xf')]);router[_0x8a5a('0x10')](_0x8a5a('0xb'),auth[_0x8a5a('0xe')](),controller[_0x8a5a('0x11')]);router[_0x8a5a('0x12')](_0x8a5a('0xb'),auth[_0x8a5a('0xe')](),controller['destroy']);module[_0x8a5a('0x13')]=router; \ No newline at end of file +var _0x4d1b=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','isAuthenticated','put','update','delete'];(function(_0x23a3d9,_0x24b7b2){var _0x555775=function(_0x26d4ca){while(--_0x26d4ca){_0x23a3d9['push'](_0x23a3d9['shift']());}};_0x555775(++_0x24b7b2);}(_0x4d1b,0xaa));var _0xb4d1=function(_0x437b02,_0x34b630){_0x437b02=_0x437b02-0x0;var _0xf8c681=_0x4d1b[_0x437b02];return _0xf8c681;};'use strict';var multer=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var path=require(_0xb4d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4d1('0x3'));var router=express[_0xb4d1('0x4')]();var fs_extra=require(_0xb4d1('0x5'));var auth=require(_0xb4d1('0x6'));var interaction=require(_0xb4d1('0x7'));var config=require(_0xb4d1('0x8'));var controller=require(_0xb4d1('0x9'));router[_0xb4d1('0xa')]('/',auth['isAuthenticated'](),controller[_0xb4d1('0xb')]);router[_0xb4d1('0xa')](_0xb4d1('0xc'),auth['isAuthenticated'](),controller[_0xb4d1('0xd')]);router[_0xb4d1('0xe')]('/',auth[_0xb4d1('0xf')](),controller['create']);router[_0xb4d1('0x10')](_0xb4d1('0xc'),auth[_0xb4d1('0xf')](),controller[_0xb4d1('0x11')]);router[_0xb4d1('0x12')](_0xb4d1('0xc'),auth['isAuthenticated'](),controller[_0xb4d1('0x13')]);module[_0xb4d1('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 485793d..d921a83 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 _0x41c9=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x36d2ef,_0x5095e6){var _0x2c2da6=function(_0x4944b7){while(--_0x4944b7){_0x36d2ef['push'](_0x36d2ef['shift']());}};_0x2c2da6(++_0x5095e6);}(_0x41c9,0xf6));var _0x941c=function(_0xc9139b,_0x298b58){_0xc9139b=_0xc9139b-0x0;var _0x3904ba=_0x41c9[_0xc9139b];return _0x3904ba;};'use strict';var Sequelize=require(_0x941c('0x0'));module['exports']={'type':{'type':Sequelize[_0x941c('0x1')](_0x941c('0x2'),_0x941c('0x3'),_0x941c('0x4'),_0x941c('0x5'),'picklist'),'defaultValue':_0x941c('0x2')},'content':{'type':Sequelize[_0x941c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x941c('0x1')](_0x941c('0x2'),_0x941c('0x3'),_0x941c('0x4'))},'keyContent':{'type':Sequelize[_0x941c('0x6')]},'idField':{'type':Sequelize[_0x941c('0x6')]},'nameField':{'type':Sequelize[_0x941c('0x6')]},'customField':{'type':Sequelize[_0x941c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x941c('0x6')]}}; \ No newline at end of file +var _0xa2e3=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2e3,0x195));var _0x3a2e=function(_0xfabe36,_0x27df7b){_0xfabe36=_0xfabe36-0x0;var _0x147474=_0xa2e3[_0xfabe36];return _0x147474;};'use strict';var Sequelize=require(_0x3a2e('0x0'));module[_0x3a2e('0x1')]={'type':{'type':Sequelize[_0x3a2e('0x2')](_0x3a2e('0x3'),_0x3a2e('0x4'),_0x3a2e('0x5'),'keyValue','picklist'),'defaultValue':_0x3a2e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3a2e('0x6')]},'keyType':{'type':Sequelize[_0x3a2e('0x2')](_0x3a2e('0x3'),_0x3a2e('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x3a2e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3a2e('0x6')]},'customField':{'type':Sequelize[_0x3a2e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a2e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index cf13281..4405478 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 _0x1bca=['index','map','fieldName','key','model','keys','filters','intersection','fields','attributes','query','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','FreshdeskField','body','find','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','send'];(function(_0x3cfc6e,_0x570fb1){var _0x27f848=function(_0x2cc428){while(--_0x2cc428){_0x3cfc6e['push'](_0x3cfc6e['shift']());}};_0x27f848(++_0x570fb1);}(_0x1bca,0xb6));var _0xa1bc=function(_0x61d9c8,_0x46dc82){_0x61d9c8=_0x61d9c8-0x0;var _0x20319e=_0x1bca[_0x61d9c8];return _0x20319e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1bc('0x1'));var moment=require('moment');var BPromise=require(_0xa1bc('0x2'));var Mustache=require(_0xa1bc('0x3'));var util=require(_0xa1bc('0x4'));var path=require('path');var sox=require(_0xa1bc('0x5'));var csv=require(_0xa1bc('0x6'));var ejs=require(_0xa1bc('0x7'));var fs=require('fs');var fs_extra=require(_0xa1bc('0x8'));var _=require('lodash');var squel=require(_0xa1bc('0x9'));var crypto=require(_0xa1bc('0xa'));var jsforce=require(_0xa1bc('0xb'));var deskjs=require(_0xa1bc('0xc'));var toCsv=require(_0xa1bc('0x6'));var querystring=require(_0xa1bc('0xd'));var Papa=require(_0xa1bc('0xe'));var Redis=require('ioredis');var authService=require(_0xa1bc('0xf'));var qs=require(_0xa1bc('0x10'));var as=require(_0xa1bc('0x11'));var hardwareService=require(_0xa1bc('0x12'));var logger=require(_0xa1bc('0x13'))(_0xa1bc('0x14'));var utils=require(_0xa1bc('0x15'));var config=require(_0xa1bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f65bc,_0x37913b){_0x37913b=_0x37913b||0xcc;return function(_0x2b38cf){if(_0x2b38cf){return _0x1f65bc[_0xa1bc('0x17')](_0x37913b);}return _0x1f65bc[_0xa1bc('0x18')](_0x37913b)[_0xa1bc('0x19')]();};}function respondWithResult(_0x165acf,_0x2c5f01){_0x2c5f01=_0x2c5f01||0xc8;return function(_0xe0d028){if(_0xe0d028){return _0x165acf[_0xa1bc('0x18')](_0x2c5f01)[_0xa1bc('0x1a')](_0xe0d028);}};}function respondWithFilteredResult(_0x5a22e0,_0x565bc2){return function(_0xdb513d){if(_0xdb513d){var _0xf8c08e=typeof _0x565bc2[_0xa1bc('0x1b')]===_0xa1bc('0x1c')&&typeof _0x565bc2[_0xa1bc('0x1d')]===_0xa1bc('0x1c');var _0x36b899=_0xdb513d[_0xa1bc('0x1e')];var _0x4765be=_0xf8c08e?0x0:_0x565bc2['offset'];var _0x510046=_0xf8c08e?_0xdb513d[_0xa1bc('0x1e')]:_0x565bc2[_0xa1bc('0x1b')]+_0x565bc2[_0xa1bc('0x1d')];var _0x2b0410;if(_0x510046>=_0x36b899){_0x510046=_0x36b899;_0x2b0410=0xc8;}else{_0x2b0410=0xce;}_0x5a22e0['status'](_0x2b0410);return _0x5a22e0['set'](_0xa1bc('0x1f'),_0x4765be+'-'+_0x510046+'/'+_0x36b899)[_0xa1bc('0x1a')](_0xdb513d);}return null;};}function patchUpdates(_0x322703){return function(_0x95a766){try{jsonpatch[_0xa1bc('0x20')](_0x95a766,_0x322703,!![]);}catch(_0x3e8cd7){return BPromise['reject'](_0x3e8cd7);}return _0x95a766[_0xa1bc('0x21')]();};}function saveUpdates(_0xc81195,_0x1e4f4e){return function(_0x4fdf7d){if(_0x4fdf7d){return _0x4fdf7d[_0xa1bc('0x22')](_0xc81195)['then'](function(_0x10636d){return _0x10636d;});}return null;};}function removeEntity(_0x44f952,_0x23d67d){return function(_0x2a77a2){if(_0x2a77a2){return _0x2a77a2[_0xa1bc('0x23')]()[_0xa1bc('0x24')](function(){_0x44f952['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc2e0,_0x3a87f4){return function(_0x5eff38){if(!_0x5eff38){_0x3cc2e0[_0xa1bc('0x17')](0x194);}return _0x5eff38;};}function handleError(_0x31d31c,_0x14e37b){_0x14e37b=_0x14e37b||0x1f4;return function(_0x2a0348){logger[_0xa1bc('0x25')](_0x2a0348[_0xa1bc('0x26')]);if(_0x2a0348['name']){delete _0x2a0348['name'];}_0x31d31c[_0xa1bc('0x18')](_0x14e37b)[_0xa1bc('0x27')](_0x2a0348);};}exports[_0xa1bc('0x28')]=function(_0x1270f5,_0x16a9d7){var _0x4ae5d0={},_0x228fc8={},_0x512608={'count':0x0,'rows':[]};var _0x332201=_[_0xa1bc('0x29')](db['FreshdeskField']['rawAttributes'],function(_0x4a120c){return{'name':_0x4a120c[_0xa1bc('0x2a')],'type':_0x4a120c['type'][_0xa1bc('0x2b')]};});_0x228fc8[_0xa1bc('0x2c')]=_[_0xa1bc('0x29')](_0x332201,'name');_0x228fc8['query']=_[_0xa1bc('0x2d')](_0x1270f5['query']);_0x228fc8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x228fc8[_0xa1bc('0x2c')],_0x228fc8['query']);_0x4ae5d0['attributes']=_['intersection'](_0x228fc8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x1270f5['query'][_0xa1bc('0x30')]));_0x4ae5d0[_0xa1bc('0x31')]=_0x4ae5d0[_0xa1bc('0x31')]['length']?_0x4ae5d0[_0xa1bc('0x31')]:_0x228fc8[_0xa1bc('0x2c')];if(!_0x1270f5[_0xa1bc('0x32')]['hasOwnProperty'](_0xa1bc('0x33'))){_0x4ae5d0[_0xa1bc('0x1d')]=qs[_0xa1bc('0x1d')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x1d')]);_0x4ae5d0[_0xa1bc('0x1b')]=qs[_0xa1bc('0x1b')](_0x1270f5[_0xa1bc('0x32')]['offset']);}_0x4ae5d0[_0xa1bc('0x34')]=qs[_0xa1bc('0x35')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x35')]);_0x4ae5d0['where']=qs[_0xa1bc('0x2e')](_[_0xa1bc('0x36')](_0x1270f5['query'],_0x228fc8[_0xa1bc('0x2e')]),_0x332201);if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]){_0x4ae5d0[_0xa1bc('0x38')]=_[_0xa1bc('0x39')](_0x4ae5d0['where'],{'$or':_[_0xa1bc('0x29')](_0x332201,function(_0x14c645){if(_0x14c645[_0xa1bc('0x3a')]!==_0xa1bc('0x3b')){var _0x3abf84={};_0x3abf84[_0x14c645['name']]={'$like':'%'+_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]+'%'};return _0x3abf84;}})});}_0x4ae5d0=_[_0xa1bc('0x39')]({},_0x4ae5d0,_0x1270f5[_0xa1bc('0x3c')]);var _0xf9b275={'where':_0x4ae5d0['where']};return db['FreshdeskField']['count'](_0xf9b275)[_0xa1bc('0x24')](function(_0x57160e){_0x512608[_0xa1bc('0x1e')]=_0x57160e;if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x3d')]){_0x4ae5d0[_0xa1bc('0x3e')]=[{'all':!![]}];}return db['FreshdeskField'][_0xa1bc('0x3f')](_0x4ae5d0);})['then'](function(_0x482d37){_0x512608[_0xa1bc('0x40')]=_0x482d37;return _0x512608;})['then'](respondWithFilteredResult(_0x16a9d7,_0x4ae5d0))[_0xa1bc('0x41')](handleError(_0x16a9d7,null));};exports[_0xa1bc('0x42')]=function(_0x5d6c5c,_0x1d8e3c){var _0x5cd49d={'raw':!![],'where':{'id':_0x5d6c5c[_0xa1bc('0x43')]['id']}},_0x1544c8={};_0x1544c8[_0xa1bc('0x2c')]=_[_0xa1bc('0x2d')](db['FreshdeskField'][_0xa1bc('0x44')]);_0x1544c8[_0xa1bc('0x32')]=_['keys'](_0x5d6c5c[_0xa1bc('0x32')]);_0x1544c8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],_0x1544c8[_0xa1bc('0x32')]);_0x5cd49d[_0xa1bc('0x31')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x5d6c5c[_0xa1bc('0x32')][_0xa1bc('0x30')]));_0x5cd49d[_0xa1bc('0x31')]=_0x5cd49d[_0xa1bc('0x31')][_0xa1bc('0x45')]?_0x5cd49d['attributes']:_0x1544c8[_0xa1bc('0x2c')];if(_0x5d6c5c['query'][_0xa1bc('0x3d')]){_0x5cd49d[_0xa1bc('0x3e')]=[{'all':!![]}];}_0x5cd49d=_[_0xa1bc('0x39')]({},_0x5cd49d,_0x5d6c5c[_0xa1bc('0x3c')]);return db['FreshdeskField']['find'](_0x5cd49d)['then'](handleEntityNotFound(_0x1d8e3c,null))['then'](respondWithResult(_0x1d8e3c,null))['catch'](handleError(_0x1d8e3c,null));};exports[_0xa1bc('0x46')]=function(_0x5cc542,_0x2dfad5){return db[_0xa1bc('0x47')][_0xa1bc('0x46')](_0x5cc542[_0xa1bc('0x48')],{})['then'](respondWithResult(_0x2dfad5,0xc9))[_0xa1bc('0x41')](handleError(_0x2dfad5,null));};exports[_0xa1bc('0x22')]=function(_0x3fa784,_0x3eb3d7){if(_0x3fa784[_0xa1bc('0x48')]['id']){delete _0x3fa784['body']['id'];}return db[_0xa1bc('0x47')][_0xa1bc('0x49')]({'where':{'id':_0x3fa784[_0xa1bc('0x43')]['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x3eb3d7,null))['then'](saveUpdates(_0x3fa784['body'],null))['then'](respondWithResult(_0x3eb3d7,null))[_0xa1bc('0x41')](handleError(_0x3eb3d7,null));};exports[_0xa1bc('0x23')]=function(_0x5b3b1,_0x274684){return db[_0xa1bc('0x47')]['find']({'where':{'id':_0x5b3b1['params']['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x274684,null))[_0xa1bc('0x24')](removeEntity(_0x274684,null))[_0xa1bc('0x41')](handleError(_0x274684,null));}; \ No newline at end of file +var _0x4522=['querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','type','merge','options','FreshdeskField','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5121b9,_0x30d553){var _0x544949=function(_0x136996){while(--_0x136996){_0x5121b9['push'](_0x5121b9['shift']());}};_0x544949(++_0x30d553);}(_0x4522,0x1a0));var _0x2452=function(_0x3a1b9e,_0x1154d5){_0x3a1b9e=_0x3a1b9e-0x0;var _0x323e33=_0x4522[_0x3a1b9e];return _0x323e33;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2452('0x0'));var jsonpatch=require(_0x2452('0x1'));var rp=require(_0x2452('0x2'));var moment=require('moment');var BPromise=require(_0x2452('0x3'));var Mustache=require(_0x2452('0x4'));var util=require(_0x2452('0x5'));var path=require(_0x2452('0x6'));var sox=require(_0x2452('0x7'));var csv=require(_0x2452('0x8'));var ejs=require(_0x2452('0x9'));var fs=require('fs');var fs_extra=require(_0x2452('0xa'));var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x8'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var licenseUtil=require(_0x2452('0x17'));var db=require(_0x2452('0x18'))['db'];function respondWithStatusCode(_0x2c1e0f,_0x2377b9){_0x2377b9=_0x2377b9||0xcc;return function(_0x4968e8){if(_0x4968e8){return _0x2c1e0f['sendStatus'](_0x2377b9);}return _0x2c1e0f['status'](_0x2377b9)[_0x2452('0x19')]();};}function respondWithResult(_0x4fafa0,_0x33e592){_0x33e592=_0x33e592||0xc8;return function(_0x506cd4){if(_0x506cd4){return _0x4fafa0[_0x2452('0x1a')](_0x33e592)[_0x2452('0x1b')](_0x506cd4);}};}function respondWithFilteredResult(_0x5d0438,_0x1dbadf){return function(_0x47930c){if(_0x47930c){var _0x3dd8cc=typeof _0x1dbadf[_0x2452('0x1c')]===_0x2452('0x1d')&&typeof _0x1dbadf[_0x2452('0x1e')]==='undefined';var _0x2108e4=_0x47930c[_0x2452('0x1f')];var _0x59d89a=_0x3dd8cc?0x0:_0x1dbadf['offset'];var _0x1bfb44=_0x3dd8cc?_0x47930c[_0x2452('0x1f')]:_0x1dbadf[_0x2452('0x1c')]+_0x1dbadf['limit'];var _0x914d2b;if(_0x1bfb44>=_0x2108e4){_0x1bfb44=_0x2108e4;_0x914d2b=0xc8;}else{_0x914d2b=0xce;}_0x5d0438[_0x2452('0x1a')](_0x914d2b);return _0x5d0438[_0x2452('0x20')](_0x2452('0x21'),_0x59d89a+'-'+_0x1bfb44+'/'+_0x2108e4)[_0x2452('0x1b')](_0x47930c);}return null;};}function patchUpdates(_0x1c70cb){return function(_0x3f48c2){try{jsonpatch[_0x2452('0x22')](_0x3f48c2,_0x1c70cb,!![]);}catch(_0x5e921d){return BPromise['reject'](_0x5e921d);}return _0x3f48c2[_0x2452('0x23')]();};}function saveUpdates(_0x32dfe7,_0x4bb3ff){return function(_0x17d0a0){if(_0x17d0a0){return _0x17d0a0[_0x2452('0x24')](_0x32dfe7)[_0x2452('0x25')](function(_0x617ba7){return _0x617ba7;});}return null;};}function removeEntity(_0x285281,_0x397f21){return function(_0x155caa){if(_0x155caa){return _0x155caa['destroy']()[_0x2452('0x25')](function(){_0x285281[_0x2452('0x1a')](0xcc)[_0x2452('0x19')]();});}};}function handleEntityNotFound(_0x231410,_0x3a4326){return function(_0x516fcf){if(!_0x516fcf){_0x231410['sendStatus'](0x194);}return _0x516fcf;};}function handleError(_0x295be0,_0x159ba1){_0x159ba1=_0x159ba1||0x1f4;return function(_0x46fcbb){logger[_0x2452('0x26')](_0x46fcbb[_0x2452('0x27')]);if(_0x46fcbb['name']){delete _0x46fcbb[_0x2452('0x28')];}_0x295be0[_0x2452('0x1a')](_0x159ba1)['send'](_0x46fcbb);};}exports['index']=function(_0x332878,_0xe8d39b){var _0x36cb6c={},_0x28e6ea={},_0x43fde0={'count':0x0,'rows':[]};var _0x258fa6=_['map'](db['FreshdeskField'][_0x2452('0x29')],function(_0x454e0a){return{'name':_0x454e0a[_0x2452('0x2a')],'type':_0x454e0a['type'][_0x2452('0x2b')]};});_0x28e6ea[_0x2452('0x2c')]=_['map'](_0x258fa6,_0x2452('0x28'));_0x28e6ea[_0x2452('0x2d')]=_[_0x2452('0x2e')](_0x332878[_0x2452('0x2d')]);_0x28e6ea[_0x2452('0x2f')]=_[_0x2452('0x30')](_0x28e6ea[_0x2452('0x2c')],_0x28e6ea[_0x2452('0x2d')]);_0x36cb6c[_0x2452('0x31')]=_[_0x2452('0x30')](_0x28e6ea[_0x2452('0x2c')],qs[_0x2452('0x32')](_0x332878[_0x2452('0x2d')]['fields']));_0x36cb6c[_0x2452('0x31')]=_0x36cb6c[_0x2452('0x31')]['length']?_0x36cb6c[_0x2452('0x31')]:_0x28e6ea['model'];if(!_0x332878[_0x2452('0x2d')][_0x2452('0x33')]('nolimit')){_0x36cb6c[_0x2452('0x1e')]=qs[_0x2452('0x1e')](_0x332878[_0x2452('0x2d')]['limit']);_0x36cb6c[_0x2452('0x1c')]=qs[_0x2452('0x1c')](_0x332878['query'][_0x2452('0x1c')]);}_0x36cb6c[_0x2452('0x34')]=qs[_0x2452('0x35')](_0x332878[_0x2452('0x2d')][_0x2452('0x35')]);_0x36cb6c['where']=qs['filters'](_['pick'](_0x332878[_0x2452('0x2d')],_0x28e6ea[_0x2452('0x2f')]),_0x258fa6);if(_0x332878[_0x2452('0x2d')][_0x2452('0x36')]){_0x36cb6c[_0x2452('0x37')]=_['merge'](_0x36cb6c[_0x2452('0x37')],{'$or':_['map'](_0x258fa6,function(_0x5be9b4){if(_0x5be9b4[_0x2452('0x38')]!=='VIRTUAL'){var _0x44ef50={};_0x44ef50[_0x5be9b4[_0x2452('0x28')]]={'$like':'%'+_0x332878['query'][_0x2452('0x36')]+'%'};return _0x44ef50;}})});}_0x36cb6c=_[_0x2452('0x39')]({},_0x36cb6c,_0x332878[_0x2452('0x3a')]);var _0x34d7f9={'where':_0x36cb6c[_0x2452('0x37')]};return db[_0x2452('0x3b')][_0x2452('0x1f')](_0x34d7f9)[_0x2452('0x25')](function(_0x5b864e){_0x43fde0[_0x2452('0x1f')]=_0x5b864e;if(_0x332878['query'][_0x2452('0x3c')]){_0x36cb6c[_0x2452('0x3d')]=[{'all':!![]}];}return db['FreshdeskField'][_0x2452('0x3e')](_0x36cb6c);})[_0x2452('0x25')](function(_0xb4e3f5){_0x43fde0[_0x2452('0x3f')]=_0xb4e3f5;return _0x43fde0;})[_0x2452('0x25')](respondWithFilteredResult(_0xe8d39b,_0x36cb6c))['catch'](handleError(_0xe8d39b,null));};exports[_0x2452('0x40')]=function(_0x29910e,_0x5379a9){var _0xfabbd8={'raw':!![],'where':{'id':_0x29910e[_0x2452('0x41')]['id']}},_0x449b89={};_0x449b89[_0x2452('0x2c')]=_['keys'](db[_0x2452('0x3b')][_0x2452('0x29')]);_0x449b89[_0x2452('0x2d')]=_[_0x2452('0x2e')](_0x29910e[_0x2452('0x2d')]);_0x449b89[_0x2452('0x2f')]=_['intersection'](_0x449b89[_0x2452('0x2c')],_0x449b89['query']);_0xfabbd8[_0x2452('0x31')]=_[_0x2452('0x30')](_0x449b89['model'],qs['fields'](_0x29910e['query']['fields']));_0xfabbd8[_0x2452('0x31')]=_0xfabbd8['attributes'][_0x2452('0x42')]?_0xfabbd8['attributes']:_0x449b89[_0x2452('0x2c')];if(_0x29910e[_0x2452('0x2d')]['includeAll']){_0xfabbd8['include']=[{'all':!![]}];}_0xfabbd8=_[_0x2452('0x39')]({},_0xfabbd8,_0x29910e['options']);return db[_0x2452('0x3b')][_0x2452('0x43')](_0xfabbd8)[_0x2452('0x25')](handleEntityNotFound(_0x5379a9,null))[_0x2452('0x25')](respondWithResult(_0x5379a9,null))['catch'](handleError(_0x5379a9,null));};exports['create']=function(_0x3e4a8b,_0x38615e){return db[_0x2452('0x3b')][_0x2452('0x44')](_0x3e4a8b[_0x2452('0x45')],{})['then'](respondWithResult(_0x38615e,0xc9))[_0x2452('0x46')](handleError(_0x38615e,null));};exports['update']=function(_0x3634f7,_0x53fd05){if(_0x3634f7[_0x2452('0x45')]['id']){delete _0x3634f7[_0x2452('0x45')]['id'];}return db['FreshdeskField'][_0x2452('0x43')]({'where':{'id':_0x3634f7['params']['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x53fd05,null))['then'](saveUpdates(_0x3634f7['body'],null))['then'](respondWithResult(_0x53fd05,null))[_0x2452('0x46')](handleError(_0x53fd05,null));};exports[_0x2452('0x47')]=function(_0x36ebcb,_0x4b705f){return db[_0x2452('0x3b')][_0x2452('0x43')]({'where':{'id':_0x36ebcb[_0x2452('0x41')]['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x4b705f,null))[_0x2452('0x25')](removeEntity(_0x4b705f,null))['catch'](handleError(_0x4b705f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 7f200b9..3d6f7e3 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 _0x4369=['./intFreshdeskField.attributes','exports','define','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x114373,_0x1b9f2d){var _0x403f3d=function(_0x978d49){while(--_0x978d49){_0x114373['push'](_0x114373['shift']());}};_0x403f3d(++_0x1b9f2d);}(_0x4369,0x147));var _0x9436=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0x4369[_0x503cd5];return _0x1fdf1e;};'use strict';var _=require(_0x9436('0x0'));var util=require(_0x9436('0x1'));var logger=require(_0x9436('0x2'))(_0x9436('0x3'));var moment=require(_0x9436('0x4'));var BPromise=require(_0x9436('0x5'));var rp=require(_0x9436('0x6'));var fs=require('fs');var path=require(_0x9436('0x7'));var rimraf=require(_0x9436('0x8'));var config=require('../../config/environment');var attributes=require(_0x9436('0x9'));module[_0x9436('0xa')]=function(_0x499f50,_0x3f0b52){return _0x499f50[_0x9436('0xb')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x9436('0xc'),'fields':[_0x9436('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9658=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x9658,0x6f));var _0x8965=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x9658[_0x9b5bb2];return _0x2e1e92;};'use strict';var _=require(_0x8965('0x0'));var util=require('util');var logger=require(_0x8965('0x1'))(_0x8965('0x2'));var moment=require('moment');var BPromise=require(_0x8965('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8965('0x4'));var rimraf=require(_0x8965('0x5'));var config=require(_0x8965('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0x8965('0x7')]=function(_0x20493e,_0x1d0745){return _0x20493e[_0x8965('0x8')](_0x8965('0x9'),attributes,{'tableName':_0x8965('0xa'),'paranoid':![],'indexes':[{'name':_0x8965('0xb'),'fields':[_0x8965('0xc'),_0x8965('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 610f794..041b5fb 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 _0x09ba=['FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4495b6,_0x1660d5){var _0x2ff893=function(_0x381027){while(--_0x381027){_0x4495b6['push'](_0x4495b6['shift']());}};_0x2ff893(++_0x1660d5);}(_0x09ba,0x1be));var _0xa09b=function(_0x124ca2,_0x5d5659){_0x124ca2=_0x124ca2-0x0;var _0x329cda=_0x09ba[_0x124ca2];return _0x329cda;};'use strict';var _=require(_0xa09b('0x0'));var util=require(_0xa09b('0x1'));var moment=require(_0xa09b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa09b('0x3'));var fs=require('fs');var Redis=require(_0xa09b('0x4'));var db=require(_0xa09b('0x5'))['db'];var utils=require(_0xa09b('0x6'));var logger=require(_0xa09b('0x7'))(_0xa09b('0x8'));var config=require(_0xa09b('0x9'));var jayson=require(_0xa09b('0xa'));var client=jayson[_0xa09b('0xb')][_0xa09b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x470bae,_0x32e0ed,_0x524b96){return new BPromise(function(_0x2d57c6,_0x2245a7){return client[_0xa09b('0xd')](_0x470bae,_0x524b96)[_0xa09b('0xe')](function(_0x49e664){logger[_0xa09b('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x32e0ed,_0xa09b('0x10'));logger[_0xa09b('0x11')](_0xa09b('0x12'),_0x32e0ed,_0xa09b('0x10'),JSON[_0xa09b('0x13')](_0x49e664));if(_0x49e664[_0xa09b('0x14')]){if(_0x49e664[_0xa09b('0x14')][_0xa09b('0x15')]===0x1f4){logger[_0xa09b('0x14')](_0xa09b('0x16'),_0x32e0ed,_0x49e664[_0xa09b('0x14')][_0xa09b('0x17')]);return _0x2245a7(_0x49e664[_0xa09b('0x14')]['message']);}logger['error'](_0xa09b('0x16'),_0x32e0ed,_0x49e664['error']['message']);return _0x2d57c6(_0x49e664[_0xa09b('0x14')][_0xa09b('0x17')]);}else{logger[_0xa09b('0xf')](_0xa09b('0x16'),_0x32e0ed,_0xa09b('0x10'));_0x2d57c6(_0x49e664[_0xa09b('0x18')][_0xa09b('0x17')]);}})[_0xa09b('0x19')](function(_0x502dd6){logger['error'](_0xa09b('0x16'),_0x32e0ed,_0x502dd6);_0x2245a7(_0x502dd6);});});} \ No newline at end of file +var _0x116c=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x116c,0x84));var _0xc116=function(_0xe5ef12,_0x24a119){_0xe5ef12=_0xe5ef12-0x0;var _0xc1a625=_0x116c[_0xe5ef12];return _0xc1a625;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var moment=require(_0xc116('0x2'));var BPromise=require(_0xc116('0x3'));var rs=require(_0xc116('0x4'));var fs=require('fs');var Redis=require(_0xc116('0x5'));var db=require(_0xc116('0x6'))['db'];var utils=require(_0xc116('0x7'));var logger=require(_0xc116('0x8'))(_0xc116('0x9'));var config=require(_0xc116('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc116('0xb')][_0xc116('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fb641,_0x48033f,_0x49a5c){return new BPromise(function(_0x32a2ce,_0x4c03b9){return client[_0xc116('0xd')](_0x1fb641,_0x49a5c)[_0xc116('0xe')](function(_0x4844c5){logger['info'](_0xc116('0xf'),_0x48033f,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x48033f,_0xc116('0x10'),JSON[_0xc116('0x11')](_0x4844c5));if(_0x4844c5[_0xc116('0x12')]){if(_0x4844c5['error'][_0xc116('0x13')]===0x1f4){logger['error'](_0xc116('0xf'),_0x48033f,_0x4844c5[_0xc116('0x12')][_0xc116('0x14')]);return _0x4c03b9(_0x4844c5['error'][_0xc116('0x14')]);}logger[_0xc116('0x12')](_0xc116('0xf'),_0x48033f,_0x4844c5[_0xc116('0x12')]['message']);return _0x32a2ce(_0x4844c5[_0xc116('0x12')][_0xc116('0x14')]);}else{logger[_0xc116('0x15')]('FreshdeskField,\x20%s,\x20%s',_0x48033f,'request\x20sent');_0x32a2ce(_0x4844c5[_0xc116('0x16')][_0xc116('0x14')]);}})[_0xc116('0x17')](function(_0x1b0b1a){logger[_0xc116('0x12')](_0xc116('0xf'),_0x48033f,_0x1b0b1a);_0x4c03b9(_0x1b0b1a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 29b3773..b58b642 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 _0x4522=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','create','post','addConfiguration','put','destroy','path','connect-timeout','express','fs-extra'];(function(_0x1e40da,_0x505367){var _0x1e13c9=function(_0x4d6546){while(--_0x4d6546){_0x1e40da['push'](_0x1e40da['shift']());}};_0x1e13c9(++_0x505367);}(_0x4522,0x1a0));var _0x2452=function(_0x1f3b93,_0x5e92d3){_0x1f3b93=_0x1f3b93-0x0;var _0x4b44e3=_0x4522[_0x1f3b93];return _0x4b44e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/fields',auth[_0x2452('0x9')](),controller['getFields']);router['post']('/',auth[_0x2452('0x9')](),controller[_0x2452('0xf')]);router[_0x2452('0x10')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0x11')]);router[_0x2452('0x12')](_0x2452('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2452('0xb'),auth['isAuthenticated'](),controller[_0x2452('0x13')]);module['exports']=router; \ No newline at end of file +var _0xbee3=['isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x28f99,_0x442c51){var _0x2bd031=function(_0x55e7b7){while(--_0x55e7b7){_0x28f99['push'](_0x28f99['shift']());}};_0x2bd031(++_0x442c51);}(_0xbee3,0xd5));var _0x3bee=function(_0x2e6da6,_0x10f6e7){_0x2e6da6=_0x2e6da6-0x0;var _0x2dd631=_0xbee3[_0x2e6da6];return _0x2dd631;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bee('0x3'));var interaction=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var controller=require('./intFreshsalesAccount.controller');router[_0x3bee('0x6')]('/',auth[_0x3bee('0x7')](),controller['index']);router[_0x3bee('0x6')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x9')]);router[_0x3bee('0x6')](_0x3bee('0xa'),auth[_0x3bee('0x7')](),controller['getConfigurations']);router[_0x3bee('0x6')](_0x3bee('0xb'),auth[_0x3bee('0x7')](),controller[_0x3bee('0xc')]);router[_0x3bee('0xd')]('/',auth[_0x3bee('0x7')](),controller['create']);router[_0x3bee('0xd')]('/:id/configurations',auth[_0x3bee('0x7')](),controller[_0x3bee('0xe')]);router[_0x3bee('0xf')](_0x3bee('0x8'),auth[_0x3bee('0x7')](),controller[_0x3bee('0x10')]);router[_0x3bee('0x11')]('/:id',auth[_0x3bee('0x7')](),controller[_0x3bee('0x12')]);module[_0x3bee('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 93f6d34..b3b966d 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdf55=['exports','STRING','remoteUri','sequelize'];(function(_0x381a6d,_0x42c0d3){var _0x54c28d=function(_0x1bae4e){while(--_0x1bae4e){_0x381a6d['push'](_0x381a6d['shift']());}};_0x54c28d(++_0x42c0d3);}(_0xdf55,0x83));var _0x5df5=function(_0x20f4af,_0x4163e6){_0x20f4af=_0x20f4af-0x0;var _0x20b7ed=_0xdf55[_0x20f4af];return _0x20b7ed;};'use strict';var Sequelize=require(_0x5df5('0x0'));module[_0x5df5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5df5('0x2')]},'username':{'type':Sequelize[_0x5df5('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x5df5('0x2')]},'remoteUri':{'type':Sequelize[_0x5df5('0x2')],'unique':_0x5df5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6a95=['exports','STRING','username','sequelize'];(function(_0x5a5ad8,_0x34911c){var _0x5512e5=function(_0x18cbe6){while(--_0x18cbe6){_0x5a5ad8['push'](_0x5a5ad8['shift']());}};_0x5512e5(++_0x34911c);}(_0x6a95,0x1db));var _0x56a9=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x6a95[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'name':{'type':Sequelize[_0x56a9('0x2')]},'description':{'type':Sequelize[_0x56a9('0x2')]},'username':{'type':Sequelize[_0x56a9('0x2')],'unique':_0x56a9('0x3')},'apiKey':{'type':Sequelize[_0x56a9('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a9('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 8566875..499b007 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 _0x1d53=['stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','params','find','catch','create','body','update','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','error'];(function(_0x8ce99,_0xe40fa0){var _0x186ca7=function(_0xa277bc){while(--_0xa277bc){_0x8ce99['push'](_0x8ce99['shift']());}};_0x186ca7(++_0xe40fa0);}(_0x1d53,0xd0));var _0x31d5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1d53[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x31d5('0x0'));var rimraf=require(_0x31d5('0x1'));var zipdir=require(_0x31d5('0x2'));var jsonpatch=require(_0x31d5('0x3'));var rp=require(_0x31d5('0x4'));var moment=require(_0x31d5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31d5('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x31d5('0x7'));var ejs=require(_0x31d5('0x8'));var fs=require('fs');var fs_extra=require(_0x31d5('0x9'));var _=require(_0x31d5('0xa'));var squel=require(_0x31d5('0xb'));var crypto=require(_0x31d5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x31d5('0xd'));var toCsv=require(_0x31d5('0x7'));var querystring=require(_0x31d5('0xe'));var Papa=require('papaparse');var Redis=require(_0x31d5('0xf'));var authService=require(_0x31d5('0x10'));var qs=require(_0x31d5('0x11'));var as=require(_0x31d5('0x12'));var hardwareService=require(_0x31d5('0x13'));var logger=require(_0x31d5('0x14'))(_0x31d5('0x15'));var utils=require(_0x31d5('0x16'));var config=require(_0x31d5('0x17'));var licenseUtil=require(_0x31d5('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x31d5('0x19'));function respondWithStatusCode(_0x5709be,_0x17a41c){_0x17a41c=_0x17a41c||0xcc;return function(_0x5127c4){if(_0x5127c4){return _0x5709be[_0x31d5('0x1a')](_0x17a41c);}return _0x5709be[_0x31d5('0x1b')](_0x17a41c)[_0x31d5('0x1c')]();};}function respondWithResult(_0x524282,_0x172ba8){_0x172ba8=_0x172ba8||0xc8;return function(_0x1a85e8){if(_0x1a85e8){return _0x524282[_0x31d5('0x1b')](_0x172ba8)['json'](_0x1a85e8);}};}function respondWithFilteredResult(_0xbdf4e,_0x4a465b){return function(_0x3c32fa){if(_0x3c32fa){var _0x2f5b28=typeof _0x4a465b[_0x31d5('0x1d')]===_0x31d5('0x1e')&&typeof _0x4a465b[_0x31d5('0x1f')]===_0x31d5('0x1e');var _0x68b01a=_0x3c32fa[_0x31d5('0x20')];var _0x40c02e=_0x2f5b28?0x0:_0x4a465b[_0x31d5('0x1d')];var _0x503386=_0x2f5b28?_0x3c32fa[_0x31d5('0x20')]:_0x4a465b[_0x31d5('0x1d')]+_0x4a465b[_0x31d5('0x1f')];var _0x466eae;if(_0x503386>=_0x68b01a){_0x503386=_0x68b01a;_0x466eae=0xc8;}else{_0x466eae=0xce;}_0xbdf4e[_0x31d5('0x1b')](_0x466eae);return _0xbdf4e[_0x31d5('0x21')](_0x31d5('0x22'),_0x40c02e+'-'+_0x503386+'/'+_0x68b01a)['json'](_0x3c32fa);}return null;};}function patchUpdates(_0x413af5){return function(_0x28ebe3){try{jsonpatch[_0x31d5('0x23')](_0x28ebe3,_0x413af5,!![]);}catch(_0x16fb30){return BPromise[_0x31d5('0x24')](_0x16fb30);}return _0x28ebe3['save']();};}function saveUpdates(_0x1b77e4,_0xc7338c){return function(_0x36b447){if(_0x36b447){return _0x36b447['update'](_0x1b77e4)[_0x31d5('0x25')](function(_0x35610a){return _0x35610a;});}return null;};}function removeEntity(_0x3242f9,_0x496352){return function(_0xe6829b){if(_0xe6829b){return _0xe6829b[_0x31d5('0x26')]()[_0x31d5('0x25')](function(){_0x3242f9['status'](0xcc)[_0x31d5('0x1c')]();});}};}function handleEntityNotFound(_0x300a12,_0x5c8e10){return function(_0x2804cb){if(!_0x2804cb){_0x300a12['sendStatus'](0x194);}return _0x2804cb;};}function handleError(_0x217f11,_0x42ed50){_0x42ed50=_0x42ed50||0x1f4;return function(_0x219a13){logger['error'](_0x219a13[_0x31d5('0x27')]);if(_0x219a13['name']){delete _0x219a13[_0x31d5('0x28')];}_0x217f11[_0x31d5('0x1b')](_0x42ed50)['send'](_0x219a13);};}exports[_0x31d5('0x29')]=function(_0x1cf20f,_0xd848f3){var _0x16f994={},_0x368d54={},_0x3aaa15={'count':0x0,'rows':[]};var _0x2ed015=_[_0x31d5('0x2a')](db['FreshsalesAccount'][_0x31d5('0x2b')],function(_0x487f02){return{'name':_0x487f02[_0x31d5('0x2c')],'type':_0x487f02[_0x31d5('0x2d')]['key']};});_0x368d54['model']=_['map'](_0x2ed015,_0x31d5('0x28'));_0x368d54[_0x31d5('0x2e')]=_[_0x31d5('0x2f')](_0x1cf20f[_0x31d5('0x2e')]);_0x368d54[_0x31d5('0x30')]=_[_0x31d5('0x31')](_0x368d54['model'],_0x368d54[_0x31d5('0x2e')]);_0x16f994[_0x31d5('0x32')]=_[_0x31d5('0x31')](_0x368d54[_0x31d5('0x33')],qs[_0x31d5('0x34')](_0x1cf20f[_0x31d5('0x2e')][_0x31d5('0x34')]));_0x16f994[_0x31d5('0x32')]=_0x16f994[_0x31d5('0x32')][_0x31d5('0x35')]?_0x16f994[_0x31d5('0x32')]:_0x368d54['model'];if(!_0x1cf20f[_0x31d5('0x2e')]['hasOwnProperty'](_0x31d5('0x36'))){_0x16f994[_0x31d5('0x1f')]=qs[_0x31d5('0x1f')](_0x1cf20f[_0x31d5('0x2e')][_0x31d5('0x1f')]);_0x16f994[_0x31d5('0x1d')]=qs[_0x31d5('0x1d')](_0x1cf20f[_0x31d5('0x2e')]['offset']);}_0x16f994['order']=qs[_0x31d5('0x37')](_0x1cf20f[_0x31d5('0x2e')]['sort']);_0x16f994[_0x31d5('0x38')]=qs['filters'](_['pick'](_0x1cf20f['query'],_0x368d54[_0x31d5('0x30')]),_0x2ed015);if(_0x1cf20f[_0x31d5('0x2e')][_0x31d5('0x39')]){_0x16f994[_0x31d5('0x38')]=_[_0x31d5('0x3a')](_0x16f994[_0x31d5('0x38')],{'$or':_[_0x31d5('0x2a')](_0x2ed015,function(_0x537626){if(_0x537626['type']!==_0x31d5('0x3b')){var _0x3ef376={};_0x3ef376[_0x537626['name']]={'$like':'%'+_0x1cf20f[_0x31d5('0x2e')][_0x31d5('0x39')]+'%'};return _0x3ef376;}})});}_0x16f994=_[_0x31d5('0x3a')]({},_0x16f994,_0x1cf20f[_0x31d5('0x3c')]);var _0x355019={'where':_0x16f994[_0x31d5('0x38')]};return db[_0x31d5('0x3d')][_0x31d5('0x20')](_0x355019)[_0x31d5('0x25')](function(_0x47ef66){_0x3aaa15[_0x31d5('0x20')]=_0x47ef66;if(_0x1cf20f[_0x31d5('0x2e')][_0x31d5('0x3e')]){_0x16f994[_0x31d5('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x31d5('0x40')](_0x16f994);})[_0x31d5('0x25')](function(_0x55ec0a){_0x3aaa15[_0x31d5('0x41')]=_0x55ec0a;return _0x3aaa15;})['then'](respondWithFilteredResult(_0xd848f3,_0x16f994))['catch'](handleError(_0xd848f3,null));};exports['show']=function(_0x1f0b4d,_0x2d30fb){var _0x7cf4d4={'raw':![],'where':{'id':_0x1f0b4d[_0x31d5('0x42')]['id']}},_0x35536b={};_0x35536b[_0x31d5('0x33')]=_[_0x31d5('0x2f')](db[_0x31d5('0x3d')][_0x31d5('0x2b')]);_0x35536b[_0x31d5('0x2e')]=_[_0x31d5('0x2f')](_0x1f0b4d['query']);_0x35536b[_0x31d5('0x30')]=_['intersection'](_0x35536b[_0x31d5('0x33')],_0x35536b[_0x31d5('0x2e')]);_0x7cf4d4['attributes']=_[_0x31d5('0x31')](_0x35536b[_0x31d5('0x33')],qs[_0x31d5('0x34')](_0x1f0b4d[_0x31d5('0x2e')][_0x31d5('0x34')]));_0x7cf4d4[_0x31d5('0x32')]=_0x7cf4d4[_0x31d5('0x32')]['length']?_0x7cf4d4['attributes']:_0x35536b['model'];if(_0x1f0b4d[_0x31d5('0x2e')][_0x31d5('0x3e')]){_0x7cf4d4[_0x31d5('0x3f')]=[{'all':!![]}];}_0x7cf4d4=_['merge']({},_0x7cf4d4,_0x1f0b4d[_0x31d5('0x3c')]);return db['FreshsalesAccount'][_0x31d5('0x43')](_0x7cf4d4)['then'](handleEntityNotFound(_0x2d30fb,null))[_0x31d5('0x25')](respondWithResult(_0x2d30fb,null))[_0x31d5('0x44')](handleError(_0x2d30fb,null));};exports[_0x31d5('0x45')]=function(_0xccb93b,_0x1a5bcf){return db['FreshsalesAccount'][_0x31d5('0x45')](_0xccb93b[_0x31d5('0x46')],{})[_0x31d5('0x25')](respondWithResult(_0x1a5bcf,0xc9))[_0x31d5('0x44')](handleError(_0x1a5bcf,null));};exports[_0x31d5('0x47')]=function(_0x5dc2fb,_0x38be22){if(_0x5dc2fb['body']['id']){delete _0x5dc2fb[_0x31d5('0x46')]['id'];}return db[_0x31d5('0x3d')][_0x31d5('0x43')]({'where':{'id':_0x5dc2fb[_0x31d5('0x42')]['id']}})[_0x31d5('0x25')](handleEntityNotFound(_0x38be22,null))[_0x31d5('0x25')](saveUpdates(_0x5dc2fb['body'],null))['then'](respondWithResult(_0x38be22,null))[_0x31d5('0x44')](handleError(_0x38be22,null));};exports[_0x31d5('0x26')]=function(_0x4e45c5,_0x452feb){return db[_0x31d5('0x3d')][_0x31d5('0x43')]({'where':{'id':_0x4e45c5['params']['id']}})[_0x31d5('0x25')](handleEntityNotFound(_0x452feb,null))['then'](removeEntity(_0x452feb,null))['catch'](handleError(_0x452feb,null));};exports[_0x31d5('0x48')]=function(_0x4e2ade,_0x3b2070,_0x5e09e7){var _0x3da404={};var _0x4336be={};var _0x5cb1eb;var _0x932d94;return db[_0x31d5('0x3d')][_0x31d5('0x49')]({'where':{'id':_0x4e2ade[_0x31d5('0x42')]['id']}})[_0x31d5('0x25')](handleEntityNotFound(_0x3b2070,null))[_0x31d5('0x25')](function(_0x4f72b0){if(_0x4f72b0){_0x5cb1eb=_0x4f72b0;_0x4336be[_0x31d5('0x33')]=_[_0x31d5('0x2f')](db['FreshsalesConfiguration'][_0x31d5('0x2b')]);_0x4336be['query']=_[_0x31d5('0x2f')](_0x4e2ade[_0x31d5('0x2e')]);_0x4336be['filters']=_[_0x31d5('0x31')](_0x4336be[_0x31d5('0x33')],_0x4336be[_0x31d5('0x2e')]);_0x3da404['attributes']=_[_0x31d5('0x31')](_0x4336be['model'],qs[_0x31d5('0x34')](_0x4e2ade[_0x31d5('0x2e')][_0x31d5('0x34')]));_0x3da404[_0x31d5('0x32')]=_0x3da404['attributes'][_0x31d5('0x35')]?_0x3da404[_0x31d5('0x32')]:_0x4336be['model'];_0x3da404['order']=qs[_0x31d5('0x37')](_0x4e2ade[_0x31d5('0x2e')][_0x31d5('0x37')]);_0x3da404[_0x31d5('0x38')]=qs[_0x31d5('0x30')](_['pick'](_0x4e2ade[_0x31d5('0x2e')],_0x4336be[_0x31d5('0x30')]));if(_0x4e2ade['query'][_0x31d5('0x39')]){_0x3da404[_0x31d5('0x38')]=_[_0x31d5('0x3a')](_0x3da404['where'],{'$or':_['map'](_0x3da404[_0x31d5('0x32')],function(_0x519307){var _0x348b7b={};_0x348b7b[_0x519307]={'$like':'%'+_0x4e2ade['query'][_0x31d5('0x39')]+'%'};return _0x348b7b;})});}_0x3da404=_['merge']({},_0x3da404,_0x4e2ade[_0x31d5('0x3c')]);return _0x5cb1eb['getConfigurations'](_0x3da404);}})[_0x31d5('0x25')](function(_0x3aefba){if(_0x3aefba){_0x932d94=_0x3aefba[_0x31d5('0x35')];if(!_0x4e2ade[_0x31d5('0x2e')][_0x31d5('0x4a')](_0x31d5('0x36'))){_0x3da404[_0x31d5('0x1f')]=qs[_0x31d5('0x1f')](_0x4e2ade['query'][_0x31d5('0x1f')]);_0x3da404['offset']=qs[_0x31d5('0x1d')](_0x4e2ade[_0x31d5('0x2e')]['offset']);}return _0x5cb1eb[_0x31d5('0x48')](_0x3da404);}})[_0x31d5('0x25')](function(_0xe713df){if(_0xe713df){return _0xe713df?{'count':_0x932d94,'rows':_0xe713df}:null;}})[_0x31d5('0x25')](respondWithResult(_0x3b2070,null))[_0x31d5('0x44')](handleError(_0x3b2070,null));};exports[_0x31d5('0x4b')]=function(_0x5bf0f8,_0x2cc760,_0x3ad82e){if(_0x5bf0f8['body']['id']){delete _0x5bf0f8[_0x31d5('0x46')]['id'];}return db[_0x31d5('0x3d')][_0x31d5('0x49')]({'where':{'id':_0x5bf0f8[_0x31d5('0x42')]['id']}})[_0x31d5('0x25')](handleEntityNotFound(_0x2cc760,null))[_0x31d5('0x25')](function(_0x50683a){if(_0x50683a){_0x5bf0f8[_0x31d5('0x46')][_0x31d5('0x4c')]=_0x50683a['id'];_0x5bf0f8['body'][_0x31d5('0x4d')]=integrations[_0x31d5('0x4e')](_0x5bf0f8[_0x31d5('0x46')][_0x31d5('0x4f')],_0x5bf0f8['body'][_0x31d5('0x2d')]);_0x5bf0f8[_0x31d5('0x46')][_0x31d5('0x50')]=integrations[_0x31d5('0x51')](_0x5bf0f8[_0x31d5('0x46')][_0x31d5('0x4f')],_0x5bf0f8['body'][_0x31d5('0x2d')]);return db[_0x31d5('0x52')]['create'](_0x5bf0f8[_0x31d5('0x46')],{'include':[{'model':db[_0x31d5('0x53')],'as':_0x31d5('0x4d')},{'model':db[_0x31d5('0x53')],'as':_0x31d5('0x50')}]});}return null;})[_0x31d5('0x25')](respondWithResult(_0x2cc760,null))['catch'](handleError(_0x2cc760,null));};exports[_0x31d5('0x54')]=function(_0x595501,_0x1e643b,_0x3e7203){var _0x5c4fef='';var _0x173f22='';return db[_0x31d5('0x3d')]['findOne']({'where':{'id':_0x595501[_0x31d5('0x42')]['id']},'attributes':['id',_0x31d5('0x55'),_0x31d5('0x56'),_0x31d5('0x57')]})[_0x31d5('0x25')](handleEntityNotFound(_0x1e643b,null))[_0x31d5('0x25')](function(_0x5c225f){if(_0x5c225f){_0x173f22=_0x5c225f[_0x31d5('0x55')];_0x5c4fef=_0x5c225f[_0x31d5('0x56')];var _0x5ab57e=_0x5c225f[_0x31d5('0x56')][_0x31d5('0x58')](-0x1);if(_0x5ab57e==='/'){_0x5c4fef=_0x5c4fef['substring'](0x0,_0x5c4fef['lastIndexOf'](_0x5ab57e));}return rp({'method':_0x31d5('0x59'),'uri':util[_0x31d5('0x5a')](_0x31d5('0x5b'),_0x5c4fef,_0x31d5('0x5c')),'headers':{'Authorization':_0x31d5('0x5d')+_0x5c225f['apiKey']},'json':!![]});}})[_0x31d5('0x25')](function(_0x1e66a1){if(_0x1e66a1){var _0x52b21f=_0x1e66a1[_0x31d5('0x5e')];var _0x1be781=![];var _0x15d434=null;for(_0x15d434=0x0;_0x15d434<_0x52b21f[_0x31d5('0x35')];_0x15d434++){if(_0x52b21f[_0x15d434]['email']===_0x173f22){_0x1be781=!![];}}if(_0x1be781){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x31d5('0x5f')});}}})[_0x31d5('0x25')](respondWithResult(_0x1e643b,null))[_0x31d5('0x44')](function(_0x346414){var _0x31de9e=_0x595501[_0x31d5('0x2e')][_0x31d5('0x60')]?0x1f4:_0x346414['statusCode']||0x1f4;logger[_0x31d5('0x61')]('getFields,\x20%s,\x20%s,\x20%s',_0x31d5('0x54'),_0x31de9e,JSON[_0x31d5('0x62')](_0x346414));delete _0x346414[_0x31d5('0x28')];if(_0x31de9e===0x191){_0x31de9e=0x190;}_0x1e643b[_0x31d5('0x1b')](_0x31de9e)[_0x31d5('0x63')](_0x595501[_0x31d5('0x2e')][_0x31d5('0x60')]?{'message':_0x31d5('0x64'),'statusCode':_0x346414[_0x31d5('0x65')]}:_0x346414);});}; \ No newline at end of file +var _0xd249=['FreshsalesConfiguration','create','FreshsalesField','getFields','username','apiKey','remoteUri','substring','GET','format','%s%s','/api/selector/owners','users','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','then','catch','show','params','includeAll','options','find','update','body','getConfigurations','findOne','length','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions'];(function(_0x1d4465,_0x2636fa){var _0xf66648=function(_0x4d73cd){while(--_0x4d73cd){_0x1d4465['push'](_0x1d4465['shift']());}};_0xf66648(++_0x2636fa);}(_0xd249,0xd6));var _0x9d24=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xd249[_0x4a8bad];return _0x30cf32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d24('0x0'));var zipdir=require(_0x9d24('0x1'));var jsonpatch=require(_0x9d24('0x2'));var rp=require(_0x9d24('0x3'));var moment=require('moment');var BPromise=require(_0x9d24('0x4'));var Mustache=require(_0x9d24('0x5'));var util=require(_0x9d24('0x6'));var path=require('path');var sox=require(_0x9d24('0x7'));var csv=require('to-csv');var ejs=require(_0x9d24('0x8'));var fs=require('fs');var fs_extra=require(_0x9d24('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9d24('0xa'));var jsforce=require(_0x9d24('0xb'));var deskjs=require(_0x9d24('0xc'));var toCsv=require(_0x9d24('0xd'));var querystring=require(_0x9d24('0xe'));var Papa=require(_0x9d24('0xf'));var Redis=require(_0x9d24('0x10'));var authService=require(_0x9d24('0x11'));var qs=require(_0x9d24('0x12'));var as=require(_0x9d24('0x13'));var hardwareService=require(_0x9d24('0x14'));var logger=require(_0x9d24('0x15'))(_0x9d24('0x16'));var utils=require(_0x9d24('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9d24('0x18'));var db=require(_0x9d24('0x19'))['db'];var integrations=require(_0x9d24('0x1a'));function respondWithStatusCode(_0x2a71f4,_0x49a519){_0x49a519=_0x49a519||0xcc;return function(_0x241460){if(_0x241460){return _0x2a71f4['sendStatus'](_0x49a519);}return _0x2a71f4[_0x9d24('0x1b')](_0x49a519)[_0x9d24('0x1c')]();};}function respondWithResult(_0x206a17,_0x2bc4d2){_0x2bc4d2=_0x2bc4d2||0xc8;return function(_0x23d852){if(_0x23d852){return _0x206a17['status'](_0x2bc4d2)['json'](_0x23d852);}};}function respondWithFilteredResult(_0x26ebfb,_0x90c36){return function(_0x57199f){if(_0x57199f){var _0x4f482f=typeof _0x90c36['offset']===_0x9d24('0x1d')&&typeof _0x90c36[_0x9d24('0x1e')]===_0x9d24('0x1d');var _0x4789b5=_0x57199f[_0x9d24('0x1f')];var _0x24b812=_0x4f482f?0x0:_0x90c36[_0x9d24('0x20')];var _0x48a563=_0x4f482f?_0x57199f[_0x9d24('0x1f')]:_0x90c36['offset']+_0x90c36[_0x9d24('0x1e')];var _0x11f1c4;if(_0x48a563>=_0x4789b5){_0x48a563=_0x4789b5;_0x11f1c4=0xc8;}else{_0x11f1c4=0xce;}_0x26ebfb[_0x9d24('0x1b')](_0x11f1c4);return _0x26ebfb['set'](_0x9d24('0x21'),_0x24b812+'-'+_0x48a563+'/'+_0x4789b5)[_0x9d24('0x22')](_0x57199f);}return null;};}function patchUpdates(_0x4abf1c){return function(_0x466e86){try{jsonpatch[_0x9d24('0x23')](_0x466e86,_0x4abf1c,!![]);}catch(_0x3ebec9){return BPromise[_0x9d24('0x24')](_0x3ebec9);}return _0x466e86[_0x9d24('0x25')]();};}function saveUpdates(_0x6df9a,_0x2dcc9b){return function(_0x40753f){if(_0x40753f){return _0x40753f['update'](_0x6df9a)['then'](function(_0x26d5d7){return _0x26d5d7;});}return null;};}function removeEntity(_0x4216c0,_0x19bbbf){return function(_0x2e3bb3){if(_0x2e3bb3){return _0x2e3bb3[_0x9d24('0x26')]()['then'](function(){_0x4216c0[_0x9d24('0x1b')](0xcc)[_0x9d24('0x1c')]();});}};}function handleEntityNotFound(_0x131b87,_0x74b4fa){return function(_0x24e3f6){if(!_0x24e3f6){_0x131b87['sendStatus'](0x194);}return _0x24e3f6;};}function handleError(_0x58b2ac,_0x2b6145){_0x2b6145=_0x2b6145||0x1f4;return function(_0x1b2886){logger[_0x9d24('0x27')](_0x1b2886['stack']);if(_0x1b2886[_0x9d24('0x28')]){delete _0x1b2886[_0x9d24('0x28')];}_0x58b2ac[_0x9d24('0x1b')](_0x2b6145)[_0x9d24('0x29')](_0x1b2886);};}exports[_0x9d24('0x2a')]=function(_0x5f41f1,_0x187136){var _0x3aa66c={},_0x56e3af={},_0xd8c620={'count':0x0,'rows':[]};var _0x260ef1=_[_0x9d24('0x2b')](db[_0x9d24('0x2c')][_0x9d24('0x2d')],function(_0x24e837){return{'name':_0x24e837[_0x9d24('0x2e')],'type':_0x24e837[_0x9d24('0x2f')][_0x9d24('0x30')]};});_0x56e3af[_0x9d24('0x31')]=_[_0x9d24('0x2b')](_0x260ef1,_0x9d24('0x28'));_0x56e3af['query']=_[_0x9d24('0x32')](_0x5f41f1[_0x9d24('0x33')]);_0x56e3af[_0x9d24('0x34')]=_[_0x9d24('0x35')](_0x56e3af[_0x9d24('0x31')],_0x56e3af['query']);_0x3aa66c['attributes']=_['intersection'](_0x56e3af['model'],qs[_0x9d24('0x36')](_0x5f41f1['query'][_0x9d24('0x36')]));_0x3aa66c[_0x9d24('0x37')]=_0x3aa66c[_0x9d24('0x37')]['length']?_0x3aa66c[_0x9d24('0x37')]:_0x56e3af[_0x9d24('0x31')];if(!_0x5f41f1[_0x9d24('0x33')]['hasOwnProperty'](_0x9d24('0x38'))){_0x3aa66c[_0x9d24('0x1e')]=qs['limit'](_0x5f41f1[_0x9d24('0x33')]['limit']);_0x3aa66c[_0x9d24('0x20')]=qs['offset'](_0x5f41f1['query'][_0x9d24('0x20')]);}_0x3aa66c[_0x9d24('0x39')]=qs[_0x9d24('0x3a')](_0x5f41f1[_0x9d24('0x33')]['sort']);_0x3aa66c[_0x9d24('0x3b')]=qs['filters'](_[_0x9d24('0x3c')](_0x5f41f1[_0x9d24('0x33')],_0x56e3af[_0x9d24('0x34')]),_0x260ef1);if(_0x5f41f1['query'][_0x9d24('0x3d')]){_0x3aa66c[_0x9d24('0x3b')]=_['merge'](_0x3aa66c['where'],{'$or':_[_0x9d24('0x2b')](_0x260ef1,function(_0x4a2805){if(_0x4a2805[_0x9d24('0x2f')]!==_0x9d24('0x3e')){var _0x67d17b={};_0x67d17b[_0x4a2805['name']]={'$like':'%'+_0x5f41f1[_0x9d24('0x33')][_0x9d24('0x3d')]+'%'};return _0x67d17b;}})});}_0x3aa66c=_[_0x9d24('0x3f')]({},_0x3aa66c,_0x5f41f1['options']);var _0x1db12b={'where':_0x3aa66c[_0x9d24('0x3b')]};return db[_0x9d24('0x2c')][_0x9d24('0x1f')](_0x1db12b)['then'](function(_0x1ab876){_0xd8c620[_0x9d24('0x1f')]=_0x1ab876;if(_0x5f41f1['query']['includeAll']){_0x3aa66c[_0x9d24('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x9d24('0x41')](_0x3aa66c);})[_0x9d24('0x42')](function(_0x7979e4){_0xd8c620['rows']=_0x7979e4;return _0xd8c620;})['then'](respondWithFilteredResult(_0x187136,_0x3aa66c))[_0x9d24('0x43')](handleError(_0x187136,null));};exports[_0x9d24('0x44')]=function(_0x494de6,_0x490899){var _0xbe2d06={'raw':![],'where':{'id':_0x494de6[_0x9d24('0x45')]['id']}},_0x1ff510={};_0x1ff510[_0x9d24('0x31')]=_[_0x9d24('0x32')](db[_0x9d24('0x2c')]['rawAttributes']);_0x1ff510[_0x9d24('0x33')]=_[_0x9d24('0x32')](_0x494de6[_0x9d24('0x33')]);_0x1ff510[_0x9d24('0x34')]=_[_0x9d24('0x35')](_0x1ff510[_0x9d24('0x31')],_0x1ff510[_0x9d24('0x33')]);_0xbe2d06['attributes']=_['intersection'](_0x1ff510[_0x9d24('0x31')],qs['fields'](_0x494de6[_0x9d24('0x33')]['fields']));_0xbe2d06[_0x9d24('0x37')]=_0xbe2d06[_0x9d24('0x37')]['length']?_0xbe2d06[_0x9d24('0x37')]:_0x1ff510[_0x9d24('0x31')];if(_0x494de6[_0x9d24('0x33')][_0x9d24('0x46')]){_0xbe2d06[_0x9d24('0x40')]=[{'all':!![]}];}_0xbe2d06=_[_0x9d24('0x3f')]({},_0xbe2d06,_0x494de6[_0x9d24('0x47')]);return db[_0x9d24('0x2c')][_0x9d24('0x48')](_0xbe2d06)[_0x9d24('0x42')](handleEntityNotFound(_0x490899,null))[_0x9d24('0x42')](respondWithResult(_0x490899,null))[_0x9d24('0x43')](handleError(_0x490899,null));};exports['create']=function(_0xc1aa38,_0x196fdb){return db[_0x9d24('0x2c')]['create'](_0xc1aa38['body'],{})[_0x9d24('0x42')](respondWithResult(_0x196fdb,0xc9))['catch'](handleError(_0x196fdb,null));};exports[_0x9d24('0x49')]=function(_0x58234b,_0x51b6f0){if(_0x58234b[_0x9d24('0x4a')]['id']){delete _0x58234b[_0x9d24('0x4a')]['id'];}return db[_0x9d24('0x2c')][_0x9d24('0x48')]({'where':{'id':_0x58234b[_0x9d24('0x45')]['id']}})[_0x9d24('0x42')](handleEntityNotFound(_0x51b6f0,null))[_0x9d24('0x42')](saveUpdates(_0x58234b[_0x9d24('0x4a')],null))['then'](respondWithResult(_0x51b6f0,null))[_0x9d24('0x43')](handleError(_0x51b6f0,null));};exports['destroy']=function(_0x331313,_0xc13f08){return db[_0x9d24('0x2c')]['find']({'where':{'id':_0x331313[_0x9d24('0x45')]['id']}})[_0x9d24('0x42')](handleEntityNotFound(_0xc13f08,null))[_0x9d24('0x42')](removeEntity(_0xc13f08,null))[_0x9d24('0x43')](handleError(_0xc13f08,null));};exports[_0x9d24('0x4b')]=function(_0x3844f9,_0x3a3069,_0x59ba32){var _0x9c1da3={};var _0x35e636={};var _0x5acb57;var _0x5a24cc;return db[_0x9d24('0x2c')][_0x9d24('0x4c')]({'where':{'id':_0x3844f9[_0x9d24('0x45')]['id']}})[_0x9d24('0x42')](handleEntityNotFound(_0x3a3069,null))['then'](function(_0x2ec702){if(_0x2ec702){_0x5acb57=_0x2ec702;_0x35e636['model']=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x35e636[_0x9d24('0x33')]=_[_0x9d24('0x32')](_0x3844f9[_0x9d24('0x33')]);_0x35e636['filters']=_[_0x9d24('0x35')](_0x35e636['model'],_0x35e636[_0x9d24('0x33')]);_0x9c1da3['attributes']=_['intersection'](_0x35e636['model'],qs[_0x9d24('0x36')](_0x3844f9[_0x9d24('0x33')]['fields']));_0x9c1da3[_0x9d24('0x37')]=_0x9c1da3['attributes'][_0x9d24('0x4d')]?_0x9c1da3[_0x9d24('0x37')]:_0x35e636['model'];_0x9c1da3['order']=qs[_0x9d24('0x3a')](_0x3844f9[_0x9d24('0x33')][_0x9d24('0x3a')]);_0x9c1da3['where']=qs[_0x9d24('0x34')](_[_0x9d24('0x3c')](_0x3844f9[_0x9d24('0x33')],_0x35e636[_0x9d24('0x34')]));if(_0x3844f9[_0x9d24('0x33')][_0x9d24('0x3d')]){_0x9c1da3['where']=_['merge'](_0x9c1da3[_0x9d24('0x3b')],{'$or':_['map'](_0x9c1da3[_0x9d24('0x37')],function(_0x4ba198){var _0x324230={};_0x324230[_0x4ba198]={'$like':'%'+_0x3844f9[_0x9d24('0x33')][_0x9d24('0x3d')]+'%'};return _0x324230;})});}_0x9c1da3=_[_0x9d24('0x3f')]({},_0x9c1da3,_0x3844f9[_0x9d24('0x47')]);return _0x5acb57['getConfigurations'](_0x9c1da3);}})[_0x9d24('0x42')](function(_0x5c8d72){if(_0x5c8d72){_0x5a24cc=_0x5c8d72[_0x9d24('0x4d')];if(!_0x3844f9[_0x9d24('0x33')][_0x9d24('0x4e')]('nolimit')){_0x9c1da3[_0x9d24('0x1e')]=qs[_0x9d24('0x1e')](_0x3844f9[_0x9d24('0x33')]['limit']);_0x9c1da3['offset']=qs['offset'](_0x3844f9['query']['offset']);}return _0x5acb57[_0x9d24('0x4b')](_0x9c1da3);}})[_0x9d24('0x42')](function(_0x50ffed){if(_0x50ffed){return _0x50ffed?{'count':_0x5a24cc,'rows':_0x50ffed}:null;}})[_0x9d24('0x42')](respondWithResult(_0x3a3069,null))[_0x9d24('0x43')](handleError(_0x3a3069,null));};exports[_0x9d24('0x4f')]=function(_0x63f1b5,_0x41a7f8,_0x4cd33f){if(_0x63f1b5['body']['id']){delete _0x63f1b5[_0x9d24('0x4a')]['id'];}return db[_0x9d24('0x2c')][_0x9d24('0x4c')]({'where':{'id':_0x63f1b5[_0x9d24('0x45')]['id']}})['then'](handleEntityNotFound(_0x41a7f8,null))['then'](function(_0x176c58){if(_0x176c58){_0x63f1b5[_0x9d24('0x4a')]['AccountId']=_0x176c58['id'];_0x63f1b5[_0x9d24('0x4a')][_0x9d24('0x50')]=integrations['getSubjects'](_0x63f1b5[_0x9d24('0x4a')][_0x9d24('0x51')],_0x63f1b5[_0x9d24('0x4a')][_0x9d24('0x2f')]);_0x63f1b5[_0x9d24('0x4a')]['Descriptions']=integrations[_0x9d24('0x52')](_0x63f1b5[_0x9d24('0x4a')][_0x9d24('0x51')],_0x63f1b5['body'][_0x9d24('0x2f')]);return db[_0x9d24('0x53')][_0x9d24('0x54')](_0x63f1b5[_0x9d24('0x4a')],{'include':[{'model':db[_0x9d24('0x55')],'as':'Subjects'},{'model':db[_0x9d24('0x55')],'as':'Descriptions'}]});}return null;})[_0x9d24('0x42')](respondWithResult(_0x41a7f8,null))[_0x9d24('0x43')](handleError(_0x41a7f8,null));};exports[_0x9d24('0x56')]=function(_0x42b40e,_0x1249b1,_0x22a680){var _0x35256a='';var _0xd86599='';return db[_0x9d24('0x2c')]['findOne']({'where':{'id':_0x42b40e['params']['id']},'attributes':['id',_0x9d24('0x57'),'remoteUri',_0x9d24('0x58')]})[_0x9d24('0x42')](handleEntityNotFound(_0x1249b1,null))['then'](function(_0xbc576){if(_0xbc576){_0xd86599=_0xbc576[_0x9d24('0x57')];_0x35256a=_0xbc576[_0x9d24('0x59')];var _0x225d75=_0xbc576[_0x9d24('0x59')]['slice'](-0x1);if(_0x225d75==='/'){_0x35256a=_0x35256a[_0x9d24('0x5a')](0x0,_0x35256a['lastIndexOf'](_0x225d75));}return rp({'method':_0x9d24('0x5b'),'uri':util[_0x9d24('0x5c')](_0x9d24('0x5d'),_0x35256a,_0x9d24('0x5e')),'headers':{'Authorization':'Token\x20token='+_0xbc576[_0x9d24('0x58')]},'json':!![]});}})[_0x9d24('0x42')](function(_0x20523e){if(_0x20523e){var _0x43b0cc=_0x20523e[_0x9d24('0x5f')];var _0x27907e=![];var _0xe61a79=null;for(_0xe61a79=0x0;_0xe61a79<_0x43b0cc[_0x9d24('0x4d')];_0xe61a79++){if(_0x43b0cc[_0xe61a79]['email']===_0xd86599){_0x27907e=!![];}}if(_0x27907e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x9d24('0x42')](respondWithResult(_0x1249b1,null))[_0x9d24('0x43')](function(_0x4f6a08){var _0x105cdd=_0x42b40e[_0x9d24('0x33')][_0x9d24('0x60')]?0x1f4:_0x4f6a08['statusCode']||0x1f4;logger[_0x9d24('0x27')](_0x9d24('0x61'),'getFields',_0x105cdd,JSON['stringify'](_0x4f6a08));delete _0x4f6a08[_0x9d24('0x28')];if(_0x105cdd===0x191){_0x105cdd=0x190;}_0x1249b1['status'](_0x105cdd)[_0x9d24('0x29')](_0x42b40e[_0x9d24('0x33')][_0x9d24('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x4f6a08[_0x9d24('0x62')]}:_0x4f6a08);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index cf117d8..4651ba0 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 _0x1893=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f2d44,_0x3f3e67){var _0x3c5298=function(_0xf36c0b){while(--_0xf36c0b){_0x5f2d44['push'](_0x5f2d44['shift']());}};_0x3c5298(++_0x3f3e67);}(_0x1893,0xa2));var _0x3189=function(_0x5832be,_0x382b95){_0x5832be=_0x5832be-0x0;var _0x5d0088=_0x1893[_0x5832be];return _0x5d0088;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));var integrations=require(_0x3189('0x8'));module[_0x3189('0x9')]=function(_0x4080a9,_0x77c566){return _0x4080a9[_0x3189('0xa')](_0x3189('0xb'),attributes,{'tableName':_0x3189('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshsalesAccount.attributes','exports'];(function(_0x487040,_0x46a3b0){var _0xb9a6a2=function(_0x145d68){while(--_0x145d68){_0x487040['push'](_0x487040['shift']());}};_0xb9a6a2(++_0x46a3b0);}(_0x82c4,0x1ca));var _0x482c=function(_0x19a465,_0x47790a){_0x19a465=_0x19a465-0x0;var _0xda00f8=_0x82c4[_0x19a465];return _0xda00f8;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x482c('0x9')]=function(_0x5d7c76,_0xfdb92){return _0x5d7c76[_0x482c('0xa')](_0x482c('0xb'),attributes,{'tableName':_0x482c('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 3a9a897..e11e893 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 _0x5430=['map','model','find','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include'];(function(_0x48f5d6,_0x36bd82){var _0x2cf127=function(_0x17f84c){while(--_0x17f84c){_0x48f5d6['push'](_0x48f5d6['shift']());}};_0x2cf127(++_0x36bd82);}(_0x5430,0x10c));var _0x0543=function(_0x56054c,_0x49d876){_0x56054c=_0x56054c-0x0;var _0x1c2910=_0x5430[_0x56054c];return _0x1c2910;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}exports[_0x0543('0x15')]=function(_0x20b396){var _0x285080=this;return new Promise(function(_0x577cf0,_0x5eb03e){return db[_0x0543('0x16')]['findAll']({'raw':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x20b396[_0x0543('0x17')]?_0x20b396['options'][_0x0543('0x19')]||null:null,'attributes':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'limit':_0x20b396['options']?_0x20b396[_0x0543('0x17')][_0x0543('0x1b')]||null:null,'include':_0x20b396[_0x0543('0x17')]?_0x20b396[_0x0543('0x17')][_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x20b396['options']['include'],function(_0x59f1b2){return{'model':db[_0x59f1b2[_0x0543('0x1e')]],'as':_0x59f1b2['as'],'attributes':_0x59f1b2[_0x0543('0x1a')],'include':_0x59f1b2[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x59f1b2[_0x0543('0x1c')],function(_0x26e500){return{'model':db[_0x26e500[_0x0543('0x1e')]],'as':_0x26e500['as'],'attributes':_0x26e500[_0x0543('0x1a')],'include':_0x26e500[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x26e500[_0x0543('0x1c')],function(_0x21fc63){return{'model':db[_0x21fc63['model']],'as':_0x21fc63['as'],'attributes':_0x21fc63[_0x0543('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x30ad9e){logger['info'](_0x0543('0x15'),_0x20b396);logger[_0x0543('0xe')](_0x0543('0x15'),_0x20b396,JSON[_0x0543('0xf')](_0x30ad9e));_0x577cf0(_0x30ad9e);})['catch'](function(_0x1732be){logger[_0x0543('0x10')]('GetFreshsalesAccount',_0x1732be['message'],_0x20b396);_0x5eb03e(_0x285080[_0x0543('0x10')](0x1f4,_0x1732be[_0x0543('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x3b879b){var _0x2e03d1=this;return new Promise(function(_0x931ccc,_0x2bd6ce){return db[_0x0543('0x16')][_0x0543('0x1f')]({'raw':_0x3b879b[_0x0543('0x17')]?_0x3b879b['options'][_0x0543('0x18')]===undefined?!![]:![]:!![],'where':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')][_0x0543('0x19')]||null:null,'attributes':_0x3b879b[_0x0543('0x17')]?_0x3b879b[_0x0543('0x17')][_0x0543('0x1a')]||null:null,'include':_0x3b879b['options']?_0x3b879b[_0x0543('0x17')]['include']?_[_0x0543('0x1d')](_0x3b879b[_0x0543('0x17')][_0x0543('0x1c')],function(_0x327027){return{'model':db[_0x327027['model']],'as':_0x327027['as'],'attributes':_0x327027[_0x0543('0x1a')],'include':_0x327027['include']?_[_0x0543('0x1d')](_0x327027[_0x0543('0x1c')],function(_0x3fbf5f){return{'model':db[_0x3fbf5f[_0x0543('0x1e')]],'as':_0x3fbf5f['as'],'attributes':_0x3fbf5f[_0x0543('0x1a')],'include':_0x3fbf5f[_0x0543('0x1c')]?_[_0x0543('0x1d')](_0x3fbf5f[_0x0543('0x1c')],function(_0x8ef4d4){return{'model':db[_0x8ef4d4[_0x0543('0x1e')]],'as':_0x8ef4d4['as'],'attributes':_0x8ef4d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x0543('0xb')](function(_0x2d76d6){logger['info'](_0x0543('0x20'),_0x3b879b);logger['debug'](_0x0543('0x20'),_0x3b879b,JSON[_0x0543('0xf')](_0x2d76d6));_0x931ccc(_0x2d76d6);})['catch'](function(_0x5e8800){logger[_0x0543('0x10')](_0x0543('0x20'),_0x5e8800['message'],_0x3b879b);_0x2bd6ce(_0x2e03d1[_0x0543('0x10')](0x1f4,_0x5e8800[_0x0543('0x13')]));});});}; \ No newline at end of file +var _0xf61e=['include','map','then','ShowFreshsalesAccount','FreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','model'];(function(_0x4dd2fe,_0x52b2a1){var _0x33378b=function(_0x12f3ba){while(--_0x12f3ba){_0x4dd2fe['push'](_0x4dd2fe['shift']());}};_0x33378b(++_0x52b2a1);}(_0xf61e,0x191));var _0xef61=function(_0x2adda6,_0x53d65d){_0x2adda6=_0x2adda6-0x0;var _0xb37b43=_0xf61e[_0x2adda6];return _0xb37b43;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['FreshsalesAccount'][_0xef61('0x18')]({'raw':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b['options'][_0xef61('0x1a')]===undefined?!![]:![]:!![],'where':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1b')]||null:null,'attributes':_0x22dc1b[_0xef61('0x19')]?_0x22dc1b[_0xef61('0x19')][_0xef61('0x1c')]||null:null,'limit':_0x22dc1b['options']?_0x22dc1b['options'][_0xef61('0x1d')]||null:null,'include':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x19')]['include']?_['map'](_0x22dc1b[_0xef61('0x19')]['include'],function(_0x53181b){return{'model':db[_0x53181b[_0xef61('0x1e')]],'as':_0x53181b['as'],'attributes':_0x53181b[_0xef61('0x1c')],'include':_0x53181b[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x53181b['include'],function(_0x16b144){return{'model':db[_0x16b144['model']],'as':_0x16b144['as'],'attributes':_0x16b144[_0xef61('0x1c')],'include':_0x16b144[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x16b144[_0xef61('0x1f')],function(_0x2155f1){return{'model':db[_0x2155f1[_0xef61('0x1e')]],'as':_0x2155f1['as'],'attributes':_0x2155f1[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef61('0x21')](function(_0x297df7){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')](_0xef61('0x17'),_0x22dc1b,JSON[_0xef61('0x12')](_0x297df7));_0x28315a(_0x297df7);})[_0xef61('0x16')](function(_0x85978){logger[_0xef61('0x13')](_0xef61('0x17'),_0x85978[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x85978[_0xef61('0x15')]));});});};exports[_0xef61('0x22')]=function(_0x4f35ad){var _0x51d5d1=this;return new Promise(function(_0x38b522,_0x36713e){return db[_0xef61('0x23')]['find']({'raw':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad[_0xef61('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options']['where']||null:null,'attributes':_0x4f35ad[_0xef61('0x19')]?_0x4f35ad['options'][_0xef61('0x1c')]||null:null,'include':_0x4f35ad['options']?_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')]?_[_0xef61('0x20')](_0x4f35ad[_0xef61('0x19')][_0xef61('0x1f')],function(_0x1bdcb9){return{'model':db[_0x1bdcb9[_0xef61('0x1e')]],'as':_0x1bdcb9['as'],'attributes':_0x1bdcb9[_0xef61('0x1c')],'include':_0x1bdcb9[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x1bdcb9['include'],function(_0x569db6){return{'model':db[_0x569db6[_0xef61('0x1e')]],'as':_0x569db6['as'],'attributes':_0x569db6[_0xef61('0x1c')],'include':_0x569db6[_0xef61('0x1f')]?_[_0xef61('0x20')](_0x569db6['include'],function(_0x1c38dc){return{'model':db[_0x1c38dc[_0xef61('0x1e')]],'as':_0x1c38dc['as'],'attributes':_0x1c38dc[_0xef61('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b97b){logger['info'](_0xef61('0x22'),_0x4f35ad);logger['debug']('ShowFreshsalesAccount',_0x4f35ad,JSON['stringify'](_0x59b97b));_0x38b522(_0x59b97b);})[_0xef61('0x16')](function(_0x294063){logger[_0xef61('0x13')]('ShowFreshsalesAccount',_0x294063['message'],_0x4f35ad);_0x36713e(_0x51d5d1['error'](0x1f4,_0x294063[_0xef61('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 7832ec0..2909935 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 _0x3e1a=['exports','connect-timeout','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','/:id','update','destroy'];(function(_0x340921,_0x19e57d){var _0xa5365a=function(_0x166dbc){while(--_0x166dbc){_0x340921['push'](_0x340921['shift']());}};_0xa5365a(++_0x19e57d);}(_0x3e1a,0x190));var _0xa3e1=function(_0xf72fe,_0x37463c){_0xf72fe=_0xf72fe-0x0;var _0x540dbf=_0x3e1a[_0xf72fe];return _0x540dbf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa3e1('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa3e1('0x1'));var interaction=require(_0xa3e1('0x2'));var config=require('../../config/environment');var controller=require(_0xa3e1('0x3'));router[_0xa3e1('0x4')]('/',auth[_0xa3e1('0x5')](),controller[_0xa3e1('0x6')]);router[_0xa3e1('0x4')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa3e1('0x4')](_0xa3e1('0x7'),auth['isAuthenticated'](),controller[_0xa3e1('0x8')]);router[_0xa3e1('0x4')](_0xa3e1('0x9'),auth[_0xa3e1('0x5')](),controller[_0xa3e1('0xa')]);router['get'](_0xa3e1('0xb'),auth[_0xa3e1('0x5')](),controller[_0xa3e1('0xc')]);router['post']('/',auth[_0xa3e1('0x5')](),controller[_0xa3e1('0xd')]);router[_0xa3e1('0xe')](_0xa3e1('0xf'),auth['isAuthenticated'](),controller[_0xa3e1('0x10')]);router['delete'](_0xa3e1('0xf'),auth['isAuthenticated'](),controller[_0xa3e1('0x11')]);module[_0xa3e1('0x12')]=router; \ No newline at end of file +var _0x232f=['express','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x3a94ea,_0x4b2f67){var _0x27af25=function(_0x121f28){while(--_0x121f28){_0x3a94ea['push'](_0x3a94ea['shift']());}};_0x27af25(++_0x4b2f67);}(_0x232f,0x1cb));var _0xf232=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x232f[_0x4d9bb2];return _0x3179fe;};'use strict';var multer=require('multer');var util=require(_0xf232('0x0'));var path=require(_0xf232('0x1'));var timeout=require(_0xf232('0x2'));var express=require(_0xf232('0x3'));var router=express[_0xf232('0x4')]();var fs_extra=require(_0xf232('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf232('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xf232('0x7')]('/',auth['isAuthenticated'](),controller[_0xf232('0x8')]);router['get'](_0xf232('0x9'),auth[_0xf232('0xa')](),controller[_0xf232('0xb')]);router['get'](_0xf232('0xc'),auth[_0xf232('0xa')](),controller[_0xf232('0xd')]);router[_0xf232('0x7')](_0xf232('0xe'),auth[_0xf232('0xa')](),controller['getDescriptions']);router['get'](_0xf232('0xf'),auth[_0xf232('0xa')](),controller[_0xf232('0x10')]);router['post']('/',auth[_0xf232('0xa')](),controller[_0xf232('0x11')]);router[_0xf232('0x12')](_0xf232('0x9'),auth['isAuthenticated'](),controller[_0xf232('0x13')]);router['delete']('/:id',auth[_0xf232('0xa')](),controller[_0xf232('0x14')]);module[_0xf232('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b7385fe..a688135 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 _0x12a8=['STRING','exports'];(function(_0x1c92d9,_0x3ae205){var _0x183705=function(_0x39ca54){while(--_0x39ca54){_0x1c92d9['push'](_0x1c92d9['shift']());}};_0x183705(++_0x3ae205);}(_0x12a8,0xb9));var _0x812a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x12a8[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x812a('0x0')]={'name':{'type':Sequelize[_0x812a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'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 f34e929..7ee4d70 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 _0xbf2c=['params','length','include','find','create','body','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show'];(function(_0x38232b,_0x43cb04){var _0x4c4ffe=function(_0x417c33){while(--_0x417c33){_0x38232b['push'](_0x38232b['shift']());}};_0x4c4ffe(++_0x43cb04);}(_0xbf2c,0x1f1));var _0xcbf2=function(_0xbba984,_0x52aeb0){_0xbba984=_0xbba984-0x0;var _0x49024d=_0xbf2c[_0xbba984];return _0x49024d;};'use strict';var emlformat=require(_0xcbf2('0x0'));var rimraf=require(_0xcbf2('0x1'));var zipdir=require(_0xcbf2('0x2'));var jsonpatch=require(_0xcbf2('0x3'));var rp=require(_0xcbf2('0x4'));var moment=require(_0xcbf2('0x5'));var BPromise=require(_0xcbf2('0x6'));var Mustache=require(_0xcbf2('0x7'));var util=require(_0xcbf2('0x8'));var path=require(_0xcbf2('0x9'));var sox=require(_0xcbf2('0xa'));var csv=require(_0xcbf2('0xb'));var ejs=require(_0xcbf2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbf2('0xd'));var squel=require(_0xcbf2('0xe'));var crypto=require(_0xcbf2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcbf2('0x10'));var toCsv=require(_0xcbf2('0xb'));var querystring=require('querystring');var Papa=require(_0xcbf2('0x11'));var Redis=require(_0xcbf2('0x12'));var authService=require(_0xcbf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcbf2('0x14'));var hardwareService=require(_0xcbf2('0x15'));var logger=require(_0xcbf2('0x16'))(_0xcbf2('0x17'));var utils=require('../../config/utils');var config=require(_0xcbf2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a2e21,_0x457279){_0x457279=_0x457279||0xcc;return function(_0x1ff42b){if(_0x1ff42b){return _0x5a2e21['sendStatus'](_0x457279);}return _0x5a2e21[_0xcbf2('0x19')](_0x457279)[_0xcbf2('0x1a')]();};}function respondWithResult(_0x172458,_0xdb0bd){_0xdb0bd=_0xdb0bd||0xc8;return function(_0x24ca6b){if(_0x24ca6b){return _0x172458[_0xcbf2('0x19')](_0xdb0bd)[_0xcbf2('0x1b')](_0x24ca6b);}};}function respondWithFilteredResult(_0x4b6763,_0x23e438){return function(_0x37cdf2){if(_0x37cdf2){var _0x27285c=typeof _0x23e438['offset']===_0xcbf2('0x1c')&&typeof _0x23e438[_0xcbf2('0x1d')]==='undefined';var _0x92ffa=_0x37cdf2[_0xcbf2('0x1e')];var _0x18644e=_0x27285c?0x0:_0x23e438[_0xcbf2('0x1f')];var _0x47d571=_0x27285c?_0x37cdf2['count']:_0x23e438[_0xcbf2('0x1f')]+_0x23e438[_0xcbf2('0x1d')];var _0x546663;if(_0x47d571>=_0x92ffa){_0x47d571=_0x92ffa;_0x546663=0xc8;}else{_0x546663=0xce;}_0x4b6763['status'](_0x546663);return _0x4b6763[_0xcbf2('0x20')](_0xcbf2('0x21'),_0x18644e+'-'+_0x47d571+'/'+_0x92ffa)[_0xcbf2('0x1b')](_0x37cdf2);}return null;};}function patchUpdates(_0x25bbf1){return function(_0x29c66f){try{jsonpatch[_0xcbf2('0x22')](_0x29c66f,_0x25bbf1,!![]);}catch(_0x13cf92){return BPromise[_0xcbf2('0x23')](_0x13cf92);}return _0x29c66f[_0xcbf2('0x24')]();};}function saveUpdates(_0x2678e4,_0xcf68e6){return function(_0x1446b6){if(_0x1446b6){return _0x1446b6[_0xcbf2('0x25')](_0x2678e4)[_0xcbf2('0x26')](function(_0x2ebb5a){return _0x2ebb5a;});}return null;};}function removeEntity(_0x337ff6,_0x321d2a){return function(_0x3407b3){if(_0x3407b3){return _0x3407b3['destroy']()[_0xcbf2('0x26')](function(){_0x337ff6[_0xcbf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32760b,_0x1e4b82){return function(_0x4716c3){if(!_0x4716c3){_0x32760b['sendStatus'](0x194);}return _0x4716c3;};}function handleError(_0x35991e,_0x2ff837){_0x2ff837=_0x2ff837||0x1f4;return function(_0xc0057e){logger[_0xcbf2('0x27')](_0xc0057e[_0xcbf2('0x28')]);if(_0xc0057e[_0xcbf2('0x29')]){delete _0xc0057e[_0xcbf2('0x29')];}_0x35991e['status'](_0x2ff837)[_0xcbf2('0x2a')](_0xc0057e);};}exports[_0xcbf2('0x2b')]=function(_0x4b2827,_0x2ba6cf){var _0x1c554a={},_0x13fced={},_0x248c17={'count':0x0,'rows':[]};var _0x2e9a75=_[_0xcbf2('0x2c')](db[_0xcbf2('0x2d')][_0xcbf2('0x2e')],function(_0x21ffa6){return{'name':_0x21ffa6[_0xcbf2('0x2f')],'type':_0x21ffa6[_0xcbf2('0x30')][_0xcbf2('0x31')]};});_0x13fced[_0xcbf2('0x32')]=_[_0xcbf2('0x2c')](_0x2e9a75,_0xcbf2('0x29'));_0x13fced[_0xcbf2('0x33')]=_[_0xcbf2('0x34')](_0x4b2827[_0xcbf2('0x33')]);_0x13fced[_0xcbf2('0x35')]=_[_0xcbf2('0x36')](_0x13fced[_0xcbf2('0x32')],_0x13fced[_0xcbf2('0x33')]);_0x1c554a[_0xcbf2('0x37')]=_[_0xcbf2('0x36')](_0x13fced[_0xcbf2('0x32')],qs[_0xcbf2('0x38')](_0x4b2827['query'][_0xcbf2('0x38')]));_0x1c554a[_0xcbf2('0x37')]=_0x1c554a[_0xcbf2('0x37')]['length']?_0x1c554a[_0xcbf2('0x37')]:_0x13fced[_0xcbf2('0x32')];if(!_0x4b2827[_0xcbf2('0x33')][_0xcbf2('0x39')](_0xcbf2('0x3a'))){_0x1c554a['limit']=qs['limit'](_0x4b2827['query'][_0xcbf2('0x1d')]);_0x1c554a['offset']=qs['offset'](_0x4b2827[_0xcbf2('0x33')][_0xcbf2('0x1f')]);}_0x1c554a[_0xcbf2('0x3b')]=qs[_0xcbf2('0x3c')](_0x4b2827[_0xcbf2('0x33')][_0xcbf2('0x3c')]);_0x1c554a[_0xcbf2('0x3d')]=qs['filters'](_['pick'](_0x4b2827['query'],_0x13fced[_0xcbf2('0x35')]),_0x2e9a75);if(_0x4b2827[_0xcbf2('0x33')]['filter']){_0x1c554a['where']=_[_0xcbf2('0x3e')](_0x1c554a[_0xcbf2('0x3d')],{'$or':_[_0xcbf2('0x2c')](_0x2e9a75,function(_0x435247){if(_0x435247[_0xcbf2('0x30')]!==_0xcbf2('0x3f')){var _0x3641fe={};_0x3641fe[_0x435247[_0xcbf2('0x29')]]={'$like':'%'+_0x4b2827['query'][_0xcbf2('0x40')]+'%'};return _0x3641fe;}})});}_0x1c554a=_['merge']({},_0x1c554a,_0x4b2827[_0xcbf2('0x41')]);var _0x5abdd1={'where':_0x1c554a[_0xcbf2('0x3d')]};return db['FreshsalesConfiguration'][_0xcbf2('0x1e')](_0x5abdd1)['then'](function(_0x5ed2b3){_0x248c17[_0xcbf2('0x1e')]=_0x5ed2b3;if(_0x4b2827[_0xcbf2('0x33')][_0xcbf2('0x42')]){_0x1c554a['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x1c554a);})[_0xcbf2('0x26')](function(_0x11c354){_0x248c17[_0xcbf2('0x43')]=_0x11c354;return _0x248c17;})[_0xcbf2('0x26')](respondWithFilteredResult(_0x2ba6cf,_0x1c554a))[_0xcbf2('0x44')](handleError(_0x2ba6cf,null));};exports[_0xcbf2('0x45')]=function(_0x9987ee,_0xc881b6){var _0x1cb894={'raw':![],'where':{'id':_0x9987ee[_0xcbf2('0x46')]['id']}},_0x2dc64b={};_0x2dc64b[_0xcbf2('0x32')]=_[_0xcbf2('0x34')](db['FreshsalesConfiguration']['rawAttributes']);_0x2dc64b[_0xcbf2('0x33')]=_[_0xcbf2('0x34')](_0x9987ee[_0xcbf2('0x33')]);_0x2dc64b[_0xcbf2('0x35')]=_[_0xcbf2('0x36')](_0x2dc64b[_0xcbf2('0x32')],_0x2dc64b[_0xcbf2('0x33')]);_0x1cb894[_0xcbf2('0x37')]=_[_0xcbf2('0x36')](_0x2dc64b['model'],qs[_0xcbf2('0x38')](_0x9987ee[_0xcbf2('0x33')][_0xcbf2('0x38')]));_0x1cb894[_0xcbf2('0x37')]=_0x1cb894[_0xcbf2('0x37')][_0xcbf2('0x47')]?_0x1cb894['attributes']:_0x2dc64b[_0xcbf2('0x32')];if(_0x9987ee[_0xcbf2('0x33')][_0xcbf2('0x42')]){_0x1cb894[_0xcbf2('0x48')]=[{'all':!![]}];}_0x1cb894=_[_0xcbf2('0x3e')]({},_0x1cb894,_0x9987ee['options']);return db[_0xcbf2('0x2d')][_0xcbf2('0x49')](_0x1cb894)[_0xcbf2('0x26')](handleEntityNotFound(_0xc881b6,null))[_0xcbf2('0x26')](respondWithResult(_0xc881b6,null))['catch'](handleError(_0xc881b6,null));};exports[_0xcbf2('0x4a')]=function(_0xba3e25,_0x1b7094){return db[_0xcbf2('0x2d')][_0xcbf2('0x4a')](_0xba3e25[_0xcbf2('0x4b')],{})['then'](respondWithResult(_0x1b7094,0xc9))[_0xcbf2('0x44')](handleError(_0x1b7094,null));};exports['update']=function(_0x26e9b4,_0x52d5f5){if(_0x26e9b4[_0xcbf2('0x4b')]['id']){delete _0x26e9b4[_0xcbf2('0x4b')]['id'];}return db[_0xcbf2('0x2d')][_0xcbf2('0x49')]({'where':{'id':_0x26e9b4[_0xcbf2('0x46')]['id']}})[_0xcbf2('0x26')](handleEntityNotFound(_0x52d5f5,null))[_0xcbf2('0x26')](saveUpdates(_0x26e9b4['body'],null))[_0xcbf2('0x26')](respondWithResult(_0x52d5f5,null))[_0xcbf2('0x44')](handleError(_0x52d5f5,null));};exports['destroy']=function(_0x14ff5d,_0x3d89c5){return db[_0xcbf2('0x2d')][_0xcbf2('0x49')]({'where':{'id':_0x14ff5d['params']['id']}})['then'](handleEntityNotFound(_0x3d89c5,null))[_0xcbf2('0x26')](removeEntity(_0x3d89c5,null))[_0xcbf2('0x44')](handleError(_0x3d89c5,null));};exports[_0xcbf2('0x4c')]=function(_0x2c12fb,_0x493076,_0x41902c){var _0x3e18d2={};var _0x1f602b={};var _0x55de99;var _0x1d8bc5;return db[_0xcbf2('0x2d')]['findOne']({'where':{'id':_0x2c12fb[_0xcbf2('0x46')]['id']}})[_0xcbf2('0x26')](handleEntityNotFound(_0x493076,null))['then'](function(_0x23beb8){if(_0x23beb8){_0x55de99=_0x23beb8;_0x1f602b['model']=_[_0xcbf2('0x34')](db[_0xcbf2('0x4d')]['rawAttributes']);_0x1f602b[_0xcbf2('0x33')]=_['keys'](_0x2c12fb[_0xcbf2('0x33')]);_0x1f602b[_0xcbf2('0x35')]=_[_0xcbf2('0x36')](_0x1f602b[_0xcbf2('0x32')],_0x1f602b[_0xcbf2('0x33')]);_0x3e18d2[_0xcbf2('0x37')]=_[_0xcbf2('0x36')](_0x1f602b[_0xcbf2('0x32')],qs[_0xcbf2('0x38')](_0x2c12fb[_0xcbf2('0x33')]['fields']));_0x3e18d2[_0xcbf2('0x37')]=_0x3e18d2['attributes'][_0xcbf2('0x47')]?_0x3e18d2[_0xcbf2('0x37')]:_0x1f602b[_0xcbf2('0x32')];_0x3e18d2[_0xcbf2('0x3b')]=qs[_0xcbf2('0x3c')](_0x2c12fb[_0xcbf2('0x33')]['sort']);_0x3e18d2[_0xcbf2('0x3d')]=qs['filters'](_['pick'](_0x2c12fb[_0xcbf2('0x33')],_0x1f602b[_0xcbf2('0x35')]));if(_0x2c12fb[_0xcbf2('0x33')][_0xcbf2('0x40')]){_0x3e18d2['where']=_[_0xcbf2('0x3e')](_0x3e18d2[_0xcbf2('0x3d')],{'$or':_[_0xcbf2('0x2c')](_0x3e18d2[_0xcbf2('0x37')],function(_0x10bd48){var _0x51ca74={};_0x51ca74[_0x10bd48]={'$like':'%'+_0x2c12fb[_0xcbf2('0x33')][_0xcbf2('0x40')]+'%'};return _0x51ca74;})});}_0x3e18d2=_[_0xcbf2('0x3e')]({},_0x3e18d2,_0x2c12fb['options']);return _0x55de99[_0xcbf2('0x4c')](_0x3e18d2);}})[_0xcbf2('0x26')](function(_0x3ecadb){if(_0x3ecadb){_0x1d8bc5=_0x3ecadb[_0xcbf2('0x47')];if(!_0x2c12fb[_0xcbf2('0x33')][_0xcbf2('0x39')](_0xcbf2('0x3a'))){_0x3e18d2[_0xcbf2('0x1d')]=qs[_0xcbf2('0x1d')](_0x2c12fb[_0xcbf2('0x33')][_0xcbf2('0x1d')]);_0x3e18d2[_0xcbf2('0x1f')]=qs['offset'](_0x2c12fb[_0xcbf2('0x33')][_0xcbf2('0x1f')]);}return _0x55de99[_0xcbf2('0x4c')](_0x3e18d2);}})[_0xcbf2('0x26')](function(_0x1bc8de){if(_0x1bc8de){return _0x1bc8de?{'count':_0x1d8bc5,'rows':_0x1bc8de}:null;}})[_0xcbf2('0x26')](respondWithResult(_0x493076,null))['catch'](handleError(_0x493076,null));};exports[_0xcbf2('0x4e')]=function(_0x4e92d,_0x13349a,_0x11f57d){var _0x4b9391={};var _0x281588={};var _0x3e1204;var _0x455c5a;return db[_0xcbf2('0x2d')][_0xcbf2('0x4f')]({'where':{'id':_0x4e92d[_0xcbf2('0x46')]['id']}})[_0xcbf2('0x26')](handleEntityNotFound(_0x13349a,null))[_0xcbf2('0x26')](function(_0x2a9f31){if(_0x2a9f31){_0x3e1204=_0x2a9f31;_0x281588['model']=_[_0xcbf2('0x34')](db[_0xcbf2('0x4d')][_0xcbf2('0x2e')]);_0x281588[_0xcbf2('0x33')]=_[_0xcbf2('0x34')](_0x4e92d[_0xcbf2('0x33')]);_0x281588[_0xcbf2('0x35')]=_[_0xcbf2('0x36')](_0x281588[_0xcbf2('0x32')],_0x281588['query']);_0x4b9391[_0xcbf2('0x37')]=_[_0xcbf2('0x36')](_0x281588[_0xcbf2('0x32')],qs[_0xcbf2('0x38')](_0x4e92d[_0xcbf2('0x33')][_0xcbf2('0x38')]));_0x4b9391[_0xcbf2('0x37')]=_0x4b9391['attributes'][_0xcbf2('0x47')]?_0x4b9391[_0xcbf2('0x37')]:_0x281588[_0xcbf2('0x32')];_0x4b9391['order']=qs['sort'](_0x4e92d[_0xcbf2('0x33')]['sort']);_0x4b9391[_0xcbf2('0x3d')]=qs[_0xcbf2('0x35')](_['pick'](_0x4e92d[_0xcbf2('0x33')],_0x281588[_0xcbf2('0x35')]));if(_0x4e92d[_0xcbf2('0x33')][_0xcbf2('0x40')]){_0x4b9391[_0xcbf2('0x3d')]=_[_0xcbf2('0x3e')](_0x4b9391[_0xcbf2('0x3d')],{'$or':_[_0xcbf2('0x2c')](_0x4b9391['attributes'],function(_0x4ce81e){var _0x3d326a={};_0x3d326a[_0x4ce81e]={'$like':'%'+_0x4e92d['query'][_0xcbf2('0x40')]+'%'};return _0x3d326a;})});}_0x4b9391=_['merge']({},_0x4b9391,_0x4e92d['options']);return _0x3e1204[_0xcbf2('0x4e')](_0x4b9391);}})[_0xcbf2('0x26')](function(_0xeba33b){if(_0xeba33b){_0x455c5a=_0xeba33b[_0xcbf2('0x47')];if(!_0x4e92d[_0xcbf2('0x33')][_0xcbf2('0x39')](_0xcbf2('0x3a'))){_0x4b9391['limit']=qs['limit'](_0x4e92d['query'][_0xcbf2('0x1d')]);_0x4b9391[_0xcbf2('0x1f')]=qs[_0xcbf2('0x1f')](_0x4e92d[_0xcbf2('0x33')][_0xcbf2('0x1f')]);}return _0x3e1204[_0xcbf2('0x4e')](_0x4b9391);}})[_0xcbf2('0x26')](function(_0x6b047d){if(_0x6b047d){return _0x6b047d?{'count':_0x455c5a,'rows':_0x6b047d}:null;}})[_0xcbf2('0x26')](respondWithResult(_0x13349a,null))[_0xcbf2('0x44')](handleError(_0x13349a,null));};exports[_0xcbf2('0x50')]=function(_0x1656d2,_0x5b0113,_0x209128){var _0x94c450={};var _0x147435={};var _0x5242f4;var _0x2890f2;return db[_0xcbf2('0x2d')][_0xcbf2('0x4f')]({'where':{'id':_0x1656d2[_0xcbf2('0x46')]['id']}})[_0xcbf2('0x26')](handleEntityNotFound(_0x5b0113,null))[_0xcbf2('0x26')](function(_0x5322c4){if(_0x5322c4){_0x5242f4=_0x5322c4;_0x147435[_0xcbf2('0x32')]=_['keys'](db[_0xcbf2('0x4d')][_0xcbf2('0x2e')]);_0x147435[_0xcbf2('0x33')]=_[_0xcbf2('0x34')](_0x1656d2[_0xcbf2('0x33')]);_0x147435['filters']=_[_0xcbf2('0x36')](_0x147435[_0xcbf2('0x32')],_0x147435[_0xcbf2('0x33')]);_0x94c450[_0xcbf2('0x37')]=_['intersection'](_0x147435['model'],qs['fields'](_0x1656d2[_0xcbf2('0x33')][_0xcbf2('0x38')]));_0x94c450[_0xcbf2('0x37')]=_0x94c450['attributes']['length']?_0x94c450[_0xcbf2('0x37')]:_0x147435[_0xcbf2('0x32')];_0x94c450[_0xcbf2('0x3b')]=qs[_0xcbf2('0x3c')](_0x1656d2[_0xcbf2('0x33')]['sort']);_0x94c450['where']=qs[_0xcbf2('0x35')](_['pick'](_0x1656d2[_0xcbf2('0x33')],_0x147435[_0xcbf2('0x35')]));if(_0x1656d2[_0xcbf2('0x33')][_0xcbf2('0x40')]){_0x94c450['where']=_['merge'](_0x94c450[_0xcbf2('0x3d')],{'$or':_['map'](_0x94c450[_0xcbf2('0x37')],function(_0x26f03d){var _0x5a37c3={};_0x5a37c3[_0x26f03d]={'$like':'%'+_0x1656d2['query'][_0xcbf2('0x40')]+'%'};return _0x5a37c3;})});}_0x94c450=_['merge']({},_0x94c450,_0x1656d2[_0xcbf2('0x41')]);return _0x5242f4['getFields'](_0x94c450);}})[_0xcbf2('0x26')](function(_0x47a8b9){if(_0x47a8b9){_0x2890f2=_0x47a8b9['length'];if(!_0x1656d2[_0xcbf2('0x33')][_0xcbf2('0x39')](_0xcbf2('0x3a'))){_0x94c450['limit']=qs['limit'](_0x1656d2[_0xcbf2('0x33')][_0xcbf2('0x1d')]);_0x94c450[_0xcbf2('0x1f')]=qs[_0xcbf2('0x1f')](_0x1656d2[_0xcbf2('0x33')][_0xcbf2('0x1f')]);}return _0x5242f4['getFields'](_0x94c450);}})[_0xcbf2('0x26')](function(_0x3146a7){if(_0x3146a7){return _0x3146a7?{'count':_0x2890f2,'rows':_0x3146a7}:null;}})[_0xcbf2('0x26')](respondWithResult(_0x5b0113,null))[_0xcbf2('0x44')](handleError(_0x5b0113,null));}; \ No newline at end of file +var _0x8b82=['bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','create','body','update','find','getSubjects','findOne','FreshsalesField','length','order','filter','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','moment'];(function(_0x380c7f,_0x234003){var _0x57f3c2=function(_0x5b0848){while(--_0x5b0848){_0x380c7f['push'](_0x380c7f['shift']());}};_0x57f3c2(++_0x234003);}(_0x8b82,0x182));var _0x28b8=function(_0x4d080d,_0x4269ef){_0x4d080d=_0x4d080d-0x0;var _0x4abb25=_0x8b82[_0x4d080d];return _0x4abb25;};'use strict';var emlformat=require(_0x28b8('0x0'));var rimraf=require(_0x28b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28b8('0x2'));var rp=require('request-promise');var moment=require(_0x28b8('0x3'));var BPromise=require(_0x28b8('0x4'));var Mustache=require('mustache');var util=require(_0x28b8('0x5'));var path=require('path');var sox=require(_0x28b8('0x6'));var csv=require(_0x28b8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28b8('0x8'));var squel=require(_0x28b8('0x9'));var crypto=require(_0x28b8('0xa'));var jsforce=require(_0x28b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x28b8('0x7'));var querystring=require(_0x28b8('0xc'));var Papa=require(_0x28b8('0xd'));var Redis=require(_0x28b8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x28b8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b8('0x10'));var logger=require('../../config/logger')(_0x28b8('0x11'));var utils=require('../../config/utils');var config=require(_0x28b8('0x12'));var licenseUtil=require(_0x28b8('0x13'));var db=require(_0x28b8('0x14'))['db'];function respondWithStatusCode(_0x49e366,_0x21c9c6){_0x21c9c6=_0x21c9c6||0xcc;return function(_0x36648f){if(_0x36648f){return _0x49e366[_0x28b8('0x15')](_0x21c9c6);}return _0x49e366[_0x28b8('0x16')](_0x21c9c6)[_0x28b8('0x17')]();};}function respondWithResult(_0x55f6ee,_0x2eeb7c){_0x2eeb7c=_0x2eeb7c||0xc8;return function(_0xd144b0){if(_0xd144b0){return _0x55f6ee[_0x28b8('0x16')](_0x2eeb7c)[_0x28b8('0x18')](_0xd144b0);}};}function respondWithFilteredResult(_0x5211ec,_0x265b26){return function(_0x51e58e){if(_0x51e58e){var _0x269ad9=typeof _0x265b26[_0x28b8('0x19')]===_0x28b8('0x1a')&&typeof _0x265b26[_0x28b8('0x1b')]===_0x28b8('0x1a');var _0x479bd7=_0x51e58e[_0x28b8('0x1c')];var _0x36d669=_0x269ad9?0x0:_0x265b26[_0x28b8('0x19')];var _0x20de35=_0x269ad9?_0x51e58e[_0x28b8('0x1c')]:_0x265b26[_0x28b8('0x19')]+_0x265b26[_0x28b8('0x1b')];var _0x9d9fb8;if(_0x20de35>=_0x479bd7){_0x20de35=_0x479bd7;_0x9d9fb8=0xc8;}else{_0x9d9fb8=0xce;}_0x5211ec[_0x28b8('0x16')](_0x9d9fb8);return _0x5211ec[_0x28b8('0x1d')](_0x28b8('0x1e'),_0x36d669+'-'+_0x20de35+'/'+_0x479bd7)['json'](_0x51e58e);}return null;};}function patchUpdates(_0x2e7982){return function(_0x4a42e3){try{jsonpatch['apply'](_0x4a42e3,_0x2e7982,!![]);}catch(_0xf4c0af){return BPromise['reject'](_0xf4c0af);}return _0x4a42e3[_0x28b8('0x1f')]();};}function saveUpdates(_0x1427ec,_0x2d6b3a){return function(_0x2fd45e){if(_0x2fd45e){return _0x2fd45e['update'](_0x1427ec)[_0x28b8('0x20')](function(_0x44d136){return _0x44d136;});}return null;};}function removeEntity(_0x24b833,_0x32b01e){return function(_0xf0dd22){if(_0xf0dd22){return _0xf0dd22[_0x28b8('0x21')]()[_0x28b8('0x20')](function(){_0x24b833[_0x28b8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd2c0fc,_0x698d40){return function(_0x34ba3a){if(!_0x34ba3a){_0xd2c0fc[_0x28b8('0x15')](0x194);}return _0x34ba3a;};}function handleError(_0x376b13,_0x57a09b){_0x57a09b=_0x57a09b||0x1f4;return function(_0x4fc66c){logger[_0x28b8('0x22')](_0x4fc66c[_0x28b8('0x23')]);if(_0x4fc66c[_0x28b8('0x24')]){delete _0x4fc66c[_0x28b8('0x24')];}_0x376b13['status'](_0x57a09b)[_0x28b8('0x25')](_0x4fc66c);};}exports[_0x28b8('0x26')]=function(_0x453f9c,_0x56636b){var _0x553124={},_0x508cd3={},_0x2cdccf={'count':0x0,'rows':[]};var _0x22dea6=_['map'](db['FreshsalesConfiguration'][_0x28b8('0x27')],function(_0x5794ae){return{'name':_0x5794ae[_0x28b8('0x28')],'type':_0x5794ae['type'][_0x28b8('0x29')]};});_0x508cd3['model']=_[_0x28b8('0x2a')](_0x22dea6,_0x28b8('0x24'));_0x508cd3[_0x28b8('0x2b')]=_['keys'](_0x453f9c[_0x28b8('0x2b')]);_0x508cd3[_0x28b8('0x2c')]=_[_0x28b8('0x2d')](_0x508cd3[_0x28b8('0x2e')],_0x508cd3[_0x28b8('0x2b')]);_0x553124['attributes']=_[_0x28b8('0x2d')](_0x508cd3[_0x28b8('0x2e')],qs[_0x28b8('0x2f')](_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x2f')]));_0x553124[_0x28b8('0x30')]=_0x553124[_0x28b8('0x30')]['length']?_0x553124[_0x28b8('0x30')]:_0x508cd3['model'];if(!_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x31')](_0x28b8('0x32'))){_0x553124['limit']=qs[_0x28b8('0x1b')](_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x1b')]);_0x553124[_0x28b8('0x19')]=qs[_0x28b8('0x19')](_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x19')]);}_0x553124['order']=qs[_0x28b8('0x33')](_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x33')]);_0x553124[_0x28b8('0x34')]=qs['filters'](_[_0x28b8('0x35')](_0x453f9c[_0x28b8('0x2b')],_0x508cd3[_0x28b8('0x2c')]),_0x22dea6);if(_0x453f9c[_0x28b8('0x2b')]['filter']){_0x553124[_0x28b8('0x34')]=_['merge'](_0x553124[_0x28b8('0x34')],{'$or':_[_0x28b8('0x2a')](_0x22dea6,function(_0xfeb91b){if(_0xfeb91b['type']!==_0x28b8('0x36')){var _0x18bd09={};_0x18bd09[_0xfeb91b[_0x28b8('0x24')]]={'$like':'%'+_0x453f9c[_0x28b8('0x2b')]['filter']+'%'};return _0x18bd09;}})});}_0x553124=_[_0x28b8('0x37')]({},_0x553124,_0x453f9c[_0x28b8('0x38')]);var _0x457cf7={'where':_0x553124[_0x28b8('0x34')]};return db[_0x28b8('0x39')][_0x28b8('0x1c')](_0x457cf7)[_0x28b8('0x20')](function(_0x320224){_0x2cdccf['count']=_0x320224;if(_0x453f9c[_0x28b8('0x2b')][_0x28b8('0x3a')]){_0x553124[_0x28b8('0x3b')]=[{'all':!![]}];}return db[_0x28b8('0x39')][_0x28b8('0x3c')](_0x553124);})['then'](function(_0x3e3842){_0x2cdccf[_0x28b8('0x3d')]=_0x3e3842;return _0x2cdccf;})[_0x28b8('0x20')](respondWithFilteredResult(_0x56636b,_0x553124))[_0x28b8('0x3e')](handleError(_0x56636b,null));};exports[_0x28b8('0x3f')]=function(_0x3390ec,_0x481ab3){var _0x41f35c={'raw':![],'where':{'id':_0x3390ec[_0x28b8('0x40')]['id']}},_0x1b0d74={};_0x1b0d74[_0x28b8('0x2e')]=_[_0x28b8('0x41')](db[_0x28b8('0x39')][_0x28b8('0x27')]);_0x1b0d74[_0x28b8('0x2b')]=_[_0x28b8('0x41')](_0x3390ec['query']);_0x1b0d74[_0x28b8('0x2c')]=_[_0x28b8('0x2d')](_0x1b0d74[_0x28b8('0x2e')],_0x1b0d74[_0x28b8('0x2b')]);_0x41f35c['attributes']=_[_0x28b8('0x2d')](_0x1b0d74[_0x28b8('0x2e')],qs['fields'](_0x3390ec[_0x28b8('0x2b')]['fields']));_0x41f35c[_0x28b8('0x30')]=_0x41f35c[_0x28b8('0x30')]['length']?_0x41f35c[_0x28b8('0x30')]:_0x1b0d74[_0x28b8('0x2e')];if(_0x3390ec[_0x28b8('0x2b')][_0x28b8('0x3a')]){_0x41f35c[_0x28b8('0x3b')]=[{'all':!![]}];}_0x41f35c=_[_0x28b8('0x37')]({},_0x41f35c,_0x3390ec[_0x28b8('0x38')]);return db[_0x28b8('0x39')]['find'](_0x41f35c)[_0x28b8('0x20')](handleEntityNotFound(_0x481ab3,null))[_0x28b8('0x20')](respondWithResult(_0x481ab3,null))['catch'](handleError(_0x481ab3,null));};exports['create']=function(_0x320197,_0x3d3964){return db[_0x28b8('0x39')][_0x28b8('0x42')](_0x320197[_0x28b8('0x43')],{})['then'](respondWithResult(_0x3d3964,0xc9))['catch'](handleError(_0x3d3964,null));};exports[_0x28b8('0x44')]=function(_0x4a0b00,_0x2d5d1b){if(_0x4a0b00[_0x28b8('0x43')]['id']){delete _0x4a0b00[_0x28b8('0x43')]['id'];}return db['FreshsalesConfiguration'][_0x28b8('0x45')]({'where':{'id':_0x4a0b00['params']['id']}})[_0x28b8('0x20')](handleEntityNotFound(_0x2d5d1b,null))[_0x28b8('0x20')](saveUpdates(_0x4a0b00[_0x28b8('0x43')],null))[_0x28b8('0x20')](respondWithResult(_0x2d5d1b,null))[_0x28b8('0x3e')](handleError(_0x2d5d1b,null));};exports['destroy']=function(_0x43f3ad,_0x318e69){return db[_0x28b8('0x39')][_0x28b8('0x45')]({'where':{'id':_0x43f3ad[_0x28b8('0x40')]['id']}})[_0x28b8('0x20')](handleEntityNotFound(_0x318e69,null))[_0x28b8('0x20')](removeEntity(_0x318e69,null))[_0x28b8('0x3e')](handleError(_0x318e69,null));};exports[_0x28b8('0x46')]=function(_0x1b5d8d,_0x6d7ed,_0x23c8af){var _0x21123a={};var _0x3485b7={};var _0x55e3dc;var _0xee9e9;return db[_0x28b8('0x39')][_0x28b8('0x47')]({'where':{'id':_0x1b5d8d[_0x28b8('0x40')]['id']}})['then'](handleEntityNotFound(_0x6d7ed,null))['then'](function(_0x7c84f9){if(_0x7c84f9){_0x55e3dc=_0x7c84f9;_0x3485b7[_0x28b8('0x2e')]=_[_0x28b8('0x41')](db[_0x28b8('0x48')][_0x28b8('0x27')]);_0x3485b7[_0x28b8('0x2b')]=_[_0x28b8('0x41')](_0x1b5d8d['query']);_0x3485b7[_0x28b8('0x2c')]=_['intersection'](_0x3485b7['model'],_0x3485b7['query']);_0x21123a['attributes']=_[_0x28b8('0x2d')](_0x3485b7['model'],qs[_0x28b8('0x2f')](_0x1b5d8d[_0x28b8('0x2b')][_0x28b8('0x2f')]));_0x21123a[_0x28b8('0x30')]=_0x21123a[_0x28b8('0x30')][_0x28b8('0x49')]?_0x21123a[_0x28b8('0x30')]:_0x3485b7[_0x28b8('0x2e')];_0x21123a[_0x28b8('0x4a')]=qs[_0x28b8('0x33')](_0x1b5d8d[_0x28b8('0x2b')][_0x28b8('0x33')]);_0x21123a[_0x28b8('0x34')]=qs[_0x28b8('0x2c')](_[_0x28b8('0x35')](_0x1b5d8d['query'],_0x3485b7[_0x28b8('0x2c')]));if(_0x1b5d8d['query'][_0x28b8('0x4b')]){_0x21123a[_0x28b8('0x34')]=_['merge'](_0x21123a[_0x28b8('0x34')],{'$or':_[_0x28b8('0x2a')](_0x21123a[_0x28b8('0x30')],function(_0x7644f0){var _0x253aed={};_0x253aed[_0x7644f0]={'$like':'%'+_0x1b5d8d[_0x28b8('0x2b')][_0x28b8('0x4b')]+'%'};return _0x253aed;})});}_0x21123a=_[_0x28b8('0x37')]({},_0x21123a,_0x1b5d8d[_0x28b8('0x38')]);return _0x55e3dc['getSubjects'](_0x21123a);}})[_0x28b8('0x20')](function(_0x2c87bd){if(_0x2c87bd){_0xee9e9=_0x2c87bd['length'];if(!_0x1b5d8d[_0x28b8('0x2b')]['hasOwnProperty'](_0x28b8('0x32'))){_0x21123a['limit']=qs[_0x28b8('0x1b')](_0x1b5d8d[_0x28b8('0x2b')][_0x28b8('0x1b')]);_0x21123a[_0x28b8('0x19')]=qs[_0x28b8('0x19')](_0x1b5d8d['query']['offset']);}return _0x55e3dc[_0x28b8('0x46')](_0x21123a);}})[_0x28b8('0x20')](function(_0x4b961f){if(_0x4b961f){return _0x4b961f?{'count':_0xee9e9,'rows':_0x4b961f}:null;}})[_0x28b8('0x20')](respondWithResult(_0x6d7ed,null))[_0x28b8('0x3e')](handleError(_0x6d7ed,null));};exports[_0x28b8('0x4c')]=function(_0x2a84ad,_0x3bbea8,_0x326b33){var _0x5ccc6a={};var _0x516457={};var _0x1f4e67;var _0x526578;return db[_0x28b8('0x39')][_0x28b8('0x47')]({'where':{'id':_0x2a84ad[_0x28b8('0x40')]['id']}})[_0x28b8('0x20')](handleEntityNotFound(_0x3bbea8,null))[_0x28b8('0x20')](function(_0x592783){if(_0x592783){_0x1f4e67=_0x592783;_0x516457[_0x28b8('0x2e')]=_[_0x28b8('0x41')](db['FreshsalesField'][_0x28b8('0x27')]);_0x516457[_0x28b8('0x2b')]=_[_0x28b8('0x41')](_0x2a84ad[_0x28b8('0x2b')]);_0x516457[_0x28b8('0x2c')]=_[_0x28b8('0x2d')](_0x516457[_0x28b8('0x2e')],_0x516457[_0x28b8('0x2b')]);_0x5ccc6a[_0x28b8('0x30')]=_[_0x28b8('0x2d')](_0x516457[_0x28b8('0x2e')],qs[_0x28b8('0x2f')](_0x2a84ad[_0x28b8('0x2b')][_0x28b8('0x2f')]));_0x5ccc6a[_0x28b8('0x30')]=_0x5ccc6a['attributes']['length']?_0x5ccc6a[_0x28b8('0x30')]:_0x516457[_0x28b8('0x2e')];_0x5ccc6a['order']=qs['sort'](_0x2a84ad[_0x28b8('0x2b')][_0x28b8('0x33')]);_0x5ccc6a[_0x28b8('0x34')]=qs[_0x28b8('0x2c')](_[_0x28b8('0x35')](_0x2a84ad[_0x28b8('0x2b')],_0x516457[_0x28b8('0x2c')]));if(_0x2a84ad['query'][_0x28b8('0x4b')]){_0x5ccc6a['where']=_[_0x28b8('0x37')](_0x5ccc6a[_0x28b8('0x34')],{'$or':_['map'](_0x5ccc6a[_0x28b8('0x30')],function(_0x3fc984){var _0x183db1={};_0x183db1[_0x3fc984]={'$like':'%'+_0x2a84ad[_0x28b8('0x2b')][_0x28b8('0x4b')]+'%'};return _0x183db1;})});}_0x5ccc6a=_[_0x28b8('0x37')]({},_0x5ccc6a,_0x2a84ad[_0x28b8('0x38')]);return _0x1f4e67[_0x28b8('0x4c')](_0x5ccc6a);}})[_0x28b8('0x20')](function(_0xaa3c7c){if(_0xaa3c7c){_0x526578=_0xaa3c7c[_0x28b8('0x49')];if(!_0x2a84ad['query'][_0x28b8('0x31')](_0x28b8('0x32'))){_0x5ccc6a[_0x28b8('0x1b')]=qs[_0x28b8('0x1b')](_0x2a84ad[_0x28b8('0x2b')][_0x28b8('0x1b')]);_0x5ccc6a[_0x28b8('0x19')]=qs['offset'](_0x2a84ad[_0x28b8('0x2b')][_0x28b8('0x19')]);}return _0x1f4e67[_0x28b8('0x4c')](_0x5ccc6a);}})[_0x28b8('0x20')](function(_0x2d03ec){if(_0x2d03ec){return _0x2d03ec?{'count':_0x526578,'rows':_0x2d03ec}:null;}})['then'](respondWithResult(_0x3bbea8,null))[_0x28b8('0x3e')](handleError(_0x3bbea8,null));};exports[_0x28b8('0x4d')]=function(_0x403166,_0x45bfdf,_0x3e39db){var _0x5eca1d={};var _0x41eae7={};var _0x5e171e;var _0x47dd98;return db[_0x28b8('0x39')][_0x28b8('0x47')]({'where':{'id':_0x403166[_0x28b8('0x40')]['id']}})[_0x28b8('0x20')](handleEntityNotFound(_0x45bfdf,null))['then'](function(_0x4485e1){if(_0x4485e1){_0x5e171e=_0x4485e1;_0x41eae7[_0x28b8('0x2e')]=_[_0x28b8('0x41')](db[_0x28b8('0x48')][_0x28b8('0x27')]);_0x41eae7[_0x28b8('0x2b')]=_[_0x28b8('0x41')](_0x403166[_0x28b8('0x2b')]);_0x41eae7[_0x28b8('0x2c')]=_[_0x28b8('0x2d')](_0x41eae7[_0x28b8('0x2e')],_0x41eae7['query']);_0x5eca1d[_0x28b8('0x30')]=_[_0x28b8('0x2d')](_0x41eae7[_0x28b8('0x2e')],qs[_0x28b8('0x2f')](_0x403166[_0x28b8('0x2b')][_0x28b8('0x2f')]));_0x5eca1d[_0x28b8('0x30')]=_0x5eca1d[_0x28b8('0x30')][_0x28b8('0x49')]?_0x5eca1d[_0x28b8('0x30')]:_0x41eae7['model'];_0x5eca1d[_0x28b8('0x4a')]=qs[_0x28b8('0x33')](_0x403166['query']['sort']);_0x5eca1d[_0x28b8('0x34')]=qs[_0x28b8('0x2c')](_[_0x28b8('0x35')](_0x403166[_0x28b8('0x2b')],_0x41eae7[_0x28b8('0x2c')]));if(_0x403166[_0x28b8('0x2b')][_0x28b8('0x4b')]){_0x5eca1d['where']=_['merge'](_0x5eca1d[_0x28b8('0x34')],{'$or':_['map'](_0x5eca1d['attributes'],function(_0x1e6c17){var _0x18279a={};_0x18279a[_0x1e6c17]={'$like':'%'+_0x403166[_0x28b8('0x2b')][_0x28b8('0x4b')]+'%'};return _0x18279a;})});}_0x5eca1d=_['merge']({},_0x5eca1d,_0x403166[_0x28b8('0x38')]);return _0x5e171e['getFields'](_0x5eca1d);}})[_0x28b8('0x20')](function(_0x128cf8){if(_0x128cf8){_0x47dd98=_0x128cf8[_0x28b8('0x49')];if(!_0x403166['query']['hasOwnProperty'](_0x28b8('0x32'))){_0x5eca1d['limit']=qs[_0x28b8('0x1b')](_0x403166[_0x28b8('0x2b')][_0x28b8('0x1b')]);_0x5eca1d['offset']=qs['offset'](_0x403166['query']['offset']);}return _0x5e171e[_0x28b8('0x4d')](_0x5eca1d);}})[_0x28b8('0x20')](function(_0x5111e9){if(_0x5111e9){return _0x5111e9?{'count':_0x47dd98,'rows':_0x5111e9}:null;}})[_0x28b8('0x20')](respondWithResult(_0x45bfdf,null))['catch'](handleError(_0x45bfdf,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6dccbe4..9b0b8a1 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 _0x63bd=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x63bd,0x13b));var _0xd63b=function(_0x544fe4,_0x19f284){_0x544fe4=_0x544fe4-0x0;var _0x466b71=_0x63bd[_0x544fe4];return _0x466b71;};'use strict';var _=require(_0xd63b('0x0'));var util=require(_0xd63b('0x1'));var logger=require(_0xd63b('0x2'))(_0xd63b('0x3'));var moment=require(_0xd63b('0x4'));var BPromise=require(_0xd63b('0x5'));var rp=require(_0xd63b('0x6'));var fs=require('fs');var path=require(_0xd63b('0x7'));var rimraf=require(_0xd63b('0x8'));var config=require(_0xd63b('0x9'));var attributes=require(_0xd63b('0xa'));module[_0xd63b('0xb')]=function(_0x1bb626,_0x4c2252){return _0x1bb626[_0xd63b('0xc')]('FreshsalesConfiguration',attributes,{'tableName':_0xd63b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ff8=['FreshsalesConfiguration','util','moment','bluebird','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','define'];(function(_0x1e93fa,_0x210f48){var _0xd4e1e6=function(_0x3149da){while(--_0x3149da){_0x1e93fa['push'](_0x1e93fa['shift']());}};_0xd4e1e6(++_0x210f48);}(_0x3ff8,0xc7));var _0x83ff=function(_0x38cd4c,_0x2702cf){_0x38cd4c=_0x38cd4c-0x0;var _0x31f5a4=_0x3ff8[_0x38cd4c];return _0x31f5a4;};'use strict';var _=require('lodash');var util=require(_0x83ff('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x83ff('0x1'));var BPromise=require(_0x83ff('0x2'));var rp=require(_0x83ff('0x3'));var fs=require('fs');var path=require(_0x83ff('0x4'));var rimraf=require(_0x83ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x83ff('0x6'));module['exports']=function(_0x596c5f,_0x47db78){return _0x596c5f[_0x83ff('0x7')](_0x83ff('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 26a2b2e..54a47ec 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 _0x393d=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x27f8e7,_0x27873e){var _0x2bda25=function(_0x38643e){while(--_0x38643e){_0x27f8e7['push'](_0x27f8e7['shift']());}};_0x2bda25(++_0x27873e);}(_0x393d,0x84));var _0xd393=function(_0x40a69b,_0x30a7e9){_0x40a69b=_0x40a69b-0x0;var _0x31c177=_0x393d[_0x40a69b];return _0x31c177;};'use strict';var _=require(_0xd393('0x0'));var util=require(_0xd393('0x1'));var moment=require(_0xd393('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd393('0x3'));var db=require(_0xd393('0x4'))['db'];var utils=require(_0xd393('0x5'));var logger=require('../../config/logger')(_0xd393('0x6'));var config=require(_0xd393('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd393('0x8')][_0xd393('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x253c4c,_0x7a0230,_0x5c20f4){return new BPromise(function(_0xfd430d,_0x5016da){return client['request'](_0x253c4c,_0x5c20f4)[_0xd393('0xa')](function(_0x1b92a8){logger[_0xd393('0xb')](_0xd393('0xc'),_0x7a0230,_0xd393('0xd'));logger[_0xd393('0xe')](_0xd393('0xf'),_0x7a0230,_0xd393('0xd'),JSON[_0xd393('0x10')](_0x1b92a8));if(_0x1b92a8[_0xd393('0x11')]){if(_0x1b92a8[_0xd393('0x11')][_0xd393('0x12')]===0x1f4){logger[_0xd393('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x7a0230,_0x1b92a8[_0xd393('0x11')][_0xd393('0x13')]);return _0x5016da(_0x1b92a8['error']['message']);}logger[_0xd393('0x11')](_0xd393('0xc'),_0x7a0230,_0x1b92a8[_0xd393('0x11')][_0xd393('0x13')]);return _0xfd430d(_0x1b92a8[_0xd393('0x11')][_0xd393('0x13')]);}else{logger[_0xd393('0xb')](_0xd393('0xc'),_0x7a0230,_0xd393('0xd'));_0xfd430d(_0x1b92a8[_0xd393('0x14')][_0xd393('0x13')]);}})[_0xd393('0x15')](function(_0x589e1f){logger[_0xd393('0x11')](_0xd393('0xc'),_0x7a0230,_0x589e1f);_0x5016da(_0x589e1f);});});} \ No newline at end of file +var _0x2f91=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x2577e7,_0x2a4097){var _0x2fcd88=function(_0x13b00d){while(--_0x13b00d){_0x2577e7['push'](_0x2577e7['shift']());}};_0x2fcd88(++_0x2a4097);}(_0x2f91,0xf9));var _0x12f9=function(_0x436291,_0x770cbe){_0x436291=_0x436291-0x0;var _0x59dfc3=_0x2f91[_0x436291];return _0x59dfc3;};'use strict';var _=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var moment=require('moment');var BPromise=require(_0x12f9('0x2'));var rs=require(_0x12f9('0x3'));var fs=require('fs');var Redis=require(_0x12f9('0x4'));var db=require(_0x12f9('0x5'))['db'];var utils=require(_0x12f9('0x6'));var logger=require(_0x12f9('0x7'))(_0x12f9('0x8'));var config=require(_0x12f9('0x9'));var jayson=require(_0x12f9('0xa'));var client=jayson[_0x12f9('0xb')][_0x12f9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x215a40,_0x2bb946,_0x1910cc){return new BPromise(function(_0x49e838,_0x56ffdd){return client['request'](_0x215a40,_0x1910cc)['then'](function(_0x28b4db){logger[_0x12f9('0xd')](_0x12f9('0xe'),_0x2bb946,_0x12f9('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2bb946,'request\x20sent',JSON[_0x12f9('0x10')](_0x28b4db));if(_0x28b4db[_0x12f9('0x11')]){if(_0x28b4db['error'][_0x12f9('0x12')]===0x1f4){logger[_0x12f9('0x11')](_0x12f9('0xe'),_0x2bb946,_0x28b4db[_0x12f9('0x11')]['message']);return _0x56ffdd(_0x28b4db[_0x12f9('0x11')][_0x12f9('0x13')]);}logger['error'](_0x12f9('0xe'),_0x2bb946,_0x28b4db[_0x12f9('0x11')][_0x12f9('0x13')]);return _0x49e838(_0x28b4db[_0x12f9('0x11')]['message']);}else{logger[_0x12f9('0xd')](_0x12f9('0xe'),_0x2bb946,'request\x20sent');_0x49e838(_0x28b4db[_0x12f9('0x14')][_0x12f9('0x13')]);}})[_0x12f9('0x15')](function(_0x28c641){logger['error'](_0x12f9('0xe'),_0x2bb946,_0x28c641);_0x56ffdd(_0x28c641);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8b4772f..034f0ed 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 _0xd3b4=['fs-extra','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x55e3cb,_0x14ce9d){_0x55e3cb=_0x55e3cb-0x0;var _0x19a1c8=_0xd3b4[_0x55e3cb];return _0x19a1c8;};'use strict';var multer=require(_0x4d3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4d3b('0x1'));var express=require(_0x4d3b('0x2'));var router=express[_0x4d3b('0x3')]();var fs_extra=require(_0x4d3b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4d3b('0x5'));var config=require('../../config/environment');var controller=require(_0x4d3b('0x6'));router[_0x4d3b('0x7')]('/',auth[_0x4d3b('0x8')](),controller[_0x4d3b('0x9')]);router[_0x4d3b('0x7')](_0x4d3b('0xa'),auth[_0x4d3b('0x8')](),controller[_0x4d3b('0xb')]);router[_0x4d3b('0xc')]('/',auth[_0x4d3b('0x8')](),controller['create']);router[_0x4d3b('0xd')]('/:id',auth[_0x4d3b('0x8')](),controller['update']);router[_0x4d3b('0xe')](_0x4d3b('0xa'),auth[_0x4d3b('0x8')](),controller[_0x4d3b('0xf')]);module[_0x4d3b('0x10')]=router; \ No newline at end of file +var _0x34e5=['update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x20d4db,_0x4e82b4){var _0x974b0a=function(_0x3018fd){while(--_0x3018fd){_0x20d4db['push'](_0x20d4db['shift']());}};_0x974b0a(++_0x4e82b4);}(_0x34e5,0x172));var _0x534e=function(_0x3d3a9d,_0x1ebddd){_0x3d3a9d=_0x3d3a9d-0x0;var _0x217d6f=_0x34e5[_0x3d3a9d];return _0x217d6f;};'use strict';var multer=require('multer');var util=require(_0x534e('0x0'));var path=require('path');var timeout=require(_0x534e('0x1'));var express=require(_0x534e('0x2'));var router=express[_0x534e('0x3')]();var fs_extra=require(_0x534e('0x4'));var auth=require(_0x534e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x534e('0x6'));var controller=require(_0x534e('0x7'));router[_0x534e('0x8')]('/',auth[_0x534e('0x9')](),controller[_0x534e('0xa')]);router[_0x534e('0x8')](_0x534e('0xb'),auth['isAuthenticated'](),controller[_0x534e('0xc')]);router[_0x534e('0xd')]('/',auth[_0x534e('0x9')](),controller['create']);router['put'](_0x534e('0xb'),auth['isAuthenticated'](),controller[_0x534e('0xe')]);router['delete'](_0x534e('0xb'),auth[_0x534e('0x9')](),controller[_0x534e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 9ef4d62..ef25325 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 _0x4df7=['picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x41e083,_0x6e9eb6){var _0x12894a=function(_0x5d7a68){while(--_0x5d7a68){_0x41e083['push'](_0x41e083['shift']());}};_0x12894a(++_0x6e9eb6);}(_0x4df7,0x12b));var _0x74df=function(_0x9cffbe,_0x5bd6d2){_0x9cffbe=_0x9cffbe-0x0;var _0x94b478=_0x4df7[_0x9cffbe];return _0x94b478;};'use strict';var Sequelize=require(_0x74df('0x0'));module['exports']={'type':{'type':Sequelize[_0x74df('0x1')](_0x74df('0x2'),_0x74df('0x3'),_0x74df('0x4'),'keyValue',_0x74df('0x5')),'defaultValue':_0x74df('0x2')},'content':{'type':Sequelize[_0x74df('0x6')]},'key':{'type':Sequelize[_0x74df('0x6')]},'keyType':{'type':Sequelize[_0x74df('0x1')](_0x74df('0x2'),_0x74df('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x74df('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x74df('0x6')]},'customField':{'type':Sequelize[_0x74df('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x74df('0x6')]}}; \ No newline at end of file +var _0xa0f5=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xa0f5,0xcb));var _0x5a0f=function(_0x382f2e,_0x51a760){_0x382f2e=_0x382f2e-0x0;var _0xc41dda=_0xa0f5[_0x382f2e];return _0xc41dda;};'use strict';var Sequelize=require(_0x5a0f('0x0'));module[_0x5a0f('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5a0f('0x2'),_0x5a0f('0x3'),_0x5a0f('0x4'),_0x5a0f('0x5'),_0x5a0f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5a0f('0x7')]},'key':{'type':Sequelize[_0x5a0f('0x7')]},'keyType':{'type':Sequelize[_0x5a0f('0x8')](_0x5a0f('0x2'),'variable',_0x5a0f('0x4'))},'keyContent':{'type':Sequelize[_0x5a0f('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5a0f('0x7')]},'customField':{'type':Sequelize[_0x5a0f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a0f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 93f3fbc..ed007f4 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 _0x9180=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','stack','send','index','map','FreshsalesField','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x59577e,_0x16bdf1){var _0x1c1215=function(_0x2339c2){while(--_0x2339c2){_0x59577e['push'](_0x59577e['shift']());}};_0x1c1215(++_0x16bdf1);}(_0x9180,0x1e7));var _0x0918=function(_0x4bd4ce,_0x5981fe){_0x4bd4ce=_0x4bd4ce-0x0;var _0x1ea87e=_0x9180[_0x4bd4ce];return _0x1ea87e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0918('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0918('0x1'));var rp=require(_0x0918('0x2'));var moment=require(_0x0918('0x3'));var BPromise=require(_0x0918('0x4'));var Mustache=require(_0x0918('0x5'));var util=require(_0x0918('0x6'));var path=require('path');var sox=require(_0x0918('0x7'));var csv=require(_0x0918('0x8'));var ejs=require(_0x0918('0x9'));var fs=require('fs');var fs_extra=require(_0x0918('0xa'));var _=require(_0x0918('0xb'));var squel=require(_0x0918('0xc'));var crypto=require('crypto');var jsforce=require(_0x0918('0xd'));var deskjs=require(_0x0918('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0918('0xf'));var Papa=require(_0x0918('0x10'));var Redis=require(_0x0918('0x11'));var authService=require(_0x0918('0x12'));var qs=require(_0x0918('0x13'));var as=require(_0x0918('0x14'));var hardwareService=require(_0x0918('0x15'));var logger=require('../../config/logger')(_0x0918('0x16'));var utils=require('../../config/utils');var config=require(_0x0918('0x17'));var licenseUtil=require(_0x0918('0x18'));var db=require(_0x0918('0x19'))['db'];function respondWithStatusCode(_0x16a33a,_0x1e155b){_0x1e155b=_0x1e155b||0xcc;return function(_0x20773d){if(_0x20773d){return _0x16a33a[_0x0918('0x1a')](_0x1e155b);}return _0x16a33a[_0x0918('0x1b')](_0x1e155b)['end']();};}function respondWithResult(_0x543fff,_0x374513){_0x374513=_0x374513||0xc8;return function(_0x3dc88f){if(_0x3dc88f){return _0x543fff[_0x0918('0x1b')](_0x374513)['json'](_0x3dc88f);}};}function respondWithFilteredResult(_0x4f69a8,_0x247430){return function(_0x61c57){if(_0x61c57){var _0xbd78a4=typeof _0x247430[_0x0918('0x1c')]===_0x0918('0x1d')&&typeof _0x247430[_0x0918('0x1e')]===_0x0918('0x1d');var _0x207b04=_0x61c57['count'];var _0xd2da69=_0xbd78a4?0x0:_0x247430[_0x0918('0x1c')];var _0x31e3bf=_0xbd78a4?_0x61c57[_0x0918('0x1f')]:_0x247430[_0x0918('0x1c')]+_0x247430['limit'];var _0x299ce7;if(_0x31e3bf>=_0x207b04){_0x31e3bf=_0x207b04;_0x299ce7=0xc8;}else{_0x299ce7=0xce;}_0x4f69a8['status'](_0x299ce7);return _0x4f69a8[_0x0918('0x20')]('Content-Range',_0xd2da69+'-'+_0x31e3bf+'/'+_0x207b04)[_0x0918('0x21')](_0x61c57);}return null;};}function patchUpdates(_0x4c9ce4){return function(_0x533224){try{jsonpatch[_0x0918('0x22')](_0x533224,_0x4c9ce4,!![]);}catch(_0x1104b3){return BPromise[_0x0918('0x23')](_0x1104b3);}return _0x533224['save']();};}function saveUpdates(_0x244de7,_0x2203d6){return function(_0x17d346){if(_0x17d346){return _0x17d346[_0x0918('0x24')](_0x244de7)['then'](function(_0x5a0455){return _0x5a0455;});}return null;};}function removeEntity(_0x14b52d,_0x3f375c){return function(_0xebae66){if(_0xebae66){return _0xebae66[_0x0918('0x25')]()[_0x0918('0x26')](function(){_0x14b52d[_0x0918('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x226436,_0x4477e7){return function(_0x5b336c){if(!_0x5b336c){_0x226436['sendStatus'](0x194);}return _0x5b336c;};}function handleError(_0x7405ae,_0x10b28a){_0x10b28a=_0x10b28a||0x1f4;return function(_0x479fe6){logger['error'](_0x479fe6[_0x0918('0x27')]);if(_0x479fe6['name']){delete _0x479fe6['name'];}_0x7405ae[_0x0918('0x1b')](_0x10b28a)[_0x0918('0x28')](_0x479fe6);};}exports[_0x0918('0x29')]=function(_0x2d1a14,_0x4b58ce){var _0x1b1aee={},_0x58386c={},_0x408b2d={'count':0x0,'rows':[]};var _0x55071c=_[_0x0918('0x2a')](db[_0x0918('0x2b')][_0x0918('0x2c')],function(_0x547461){return{'name':_0x547461['fieldName'],'type':_0x547461[_0x0918('0x2d')][_0x0918('0x2e')]};});_0x58386c['model']=_['map'](_0x55071c,'name');_0x58386c['query']=_[_0x0918('0x2f')](_0x2d1a14['query']);_0x58386c[_0x0918('0x30')]=_[_0x0918('0x31')](_0x58386c[_0x0918('0x32')],_0x58386c[_0x0918('0x33')]);_0x1b1aee[_0x0918('0x34')]=_[_0x0918('0x31')](_0x58386c['model'],qs[_0x0918('0x35')](_0x2d1a14[_0x0918('0x33')]['fields']));_0x1b1aee[_0x0918('0x34')]=_0x1b1aee[_0x0918('0x34')][_0x0918('0x36')]?_0x1b1aee[_0x0918('0x34')]:_0x58386c[_0x0918('0x32')];if(!_0x2d1a14['query'][_0x0918('0x37')]('nolimit')){_0x1b1aee[_0x0918('0x1e')]=qs[_0x0918('0x1e')](_0x2d1a14[_0x0918('0x33')]['limit']);_0x1b1aee[_0x0918('0x1c')]=qs[_0x0918('0x1c')](_0x2d1a14[_0x0918('0x33')][_0x0918('0x1c')]);}_0x1b1aee[_0x0918('0x38')]=qs[_0x0918('0x39')](_0x2d1a14[_0x0918('0x33')][_0x0918('0x39')]);_0x1b1aee[_0x0918('0x3a')]=qs[_0x0918('0x30')](_[_0x0918('0x3b')](_0x2d1a14[_0x0918('0x33')],_0x58386c[_0x0918('0x30')]),_0x55071c);if(_0x2d1a14[_0x0918('0x33')][_0x0918('0x3c')]){_0x1b1aee['where']=_[_0x0918('0x3d')](_0x1b1aee[_0x0918('0x3a')],{'$or':_['map'](_0x55071c,function(_0x4db4f7){if(_0x4db4f7['type']!==_0x0918('0x3e')){var _0x2c85d3={};_0x2c85d3[_0x4db4f7['name']]={'$like':'%'+_0x2d1a14[_0x0918('0x33')][_0x0918('0x3c')]+'%'};return _0x2c85d3;}})});}_0x1b1aee=_[_0x0918('0x3d')]({},_0x1b1aee,_0x2d1a14[_0x0918('0x3f')]);var _0x58e8e4={'where':_0x1b1aee[_0x0918('0x3a')]};return db[_0x0918('0x2b')]['count'](_0x58e8e4)[_0x0918('0x26')](function(_0x30658e){_0x408b2d[_0x0918('0x1f')]=_0x30658e;if(_0x2d1a14['query'][_0x0918('0x40')]){_0x1b1aee[_0x0918('0x41')]=[{'all':!![]}];}return db[_0x0918('0x2b')][_0x0918('0x42')](_0x1b1aee);})[_0x0918('0x26')](function(_0x5a1f06){_0x408b2d[_0x0918('0x43')]=_0x5a1f06;return _0x408b2d;})[_0x0918('0x26')](respondWithFilteredResult(_0x4b58ce,_0x1b1aee))['catch'](handleError(_0x4b58ce,null));};exports['show']=function(_0x43508b,_0x46fc68){var _0x5bafaa={'raw':!![],'where':{'id':_0x43508b[_0x0918('0x44')]['id']}},_0x325d1c={};_0x325d1c[_0x0918('0x32')]=_[_0x0918('0x2f')](db[_0x0918('0x2b')]['rawAttributes']);_0x325d1c[_0x0918('0x33')]=_['keys'](_0x43508b[_0x0918('0x33')]);_0x325d1c[_0x0918('0x30')]=_[_0x0918('0x31')](_0x325d1c['model'],_0x325d1c['query']);_0x5bafaa['attributes']=_['intersection'](_0x325d1c[_0x0918('0x32')],qs['fields'](_0x43508b[_0x0918('0x33')][_0x0918('0x35')]));_0x5bafaa[_0x0918('0x34')]=_0x5bafaa['attributes'][_0x0918('0x36')]?_0x5bafaa[_0x0918('0x34')]:_0x325d1c['model'];if(_0x43508b[_0x0918('0x33')][_0x0918('0x40')]){_0x5bafaa[_0x0918('0x41')]=[{'all':!![]}];}_0x5bafaa=_[_0x0918('0x3d')]({},_0x5bafaa,_0x43508b[_0x0918('0x3f')]);return db[_0x0918('0x2b')][_0x0918('0x45')](_0x5bafaa)['then'](handleEntityNotFound(_0x46fc68,null))[_0x0918('0x26')](respondWithResult(_0x46fc68,null))[_0x0918('0x46')](handleError(_0x46fc68,null));};exports[_0x0918('0x47')]=function(_0x3957be,_0x279aa4){return db[_0x0918('0x2b')][_0x0918('0x47')](_0x3957be[_0x0918('0x48')],{})[_0x0918('0x26')](respondWithResult(_0x279aa4,0xc9))[_0x0918('0x46')](handleError(_0x279aa4,null));};exports['update']=function(_0x5814f5,_0x2fc64d){if(_0x5814f5[_0x0918('0x48')]['id']){delete _0x5814f5[_0x0918('0x48')]['id'];}return db[_0x0918('0x2b')]['find']({'where':{'id':_0x5814f5[_0x0918('0x44')]['id']}})[_0x0918('0x26')](handleEntityNotFound(_0x2fc64d,null))[_0x0918('0x26')](saveUpdates(_0x5814f5['body'],null))[_0x0918('0x26')](respondWithResult(_0x2fc64d,null))[_0x0918('0x46')](handleError(_0x2fc64d,null));};exports[_0x0918('0x25')]=function(_0x255b53,_0x2a9236){return db[_0x0918('0x2b')][_0x0918('0x45')]({'where':{'id':_0x255b53[_0x0918('0x44')]['id']}})[_0x0918('0x26')](handleEntityNotFound(_0x2a9236,null))[_0x0918('0x26')](removeEntity(_0x2a9236,null))[_0x0918('0x46')](handleError(_0x2a9236,null));}; \ No newline at end of file +var _0x19a3=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','stack','send','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','show','params','keys','length','find','catch','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x9117bb,_0x3cc3d9){var _0x4df1ad=function(_0x1a1e02){while(--_0x1a1e02){_0x9117bb['push'](_0x9117bb['shift']());}};_0x4df1ad(++_0x3cc3d9);}(_0x19a3,0xc1));var _0x319a=function(_0x941fde,_0x10e1ee){_0x941fde=_0x941fde-0x0;var _0x158aeb=_0x19a3[_0x941fde];return _0x158aeb;};'use strict';var emlformat=require(_0x319a('0x0'));var rimraf=require(_0x319a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x319a('0x2'));var moment=require(_0x319a('0x3'));var BPromise=require(_0x319a('0x4'));var Mustache=require(_0x319a('0x5'));var util=require(_0x319a('0x6'));var path=require(_0x319a('0x7'));var sox=require(_0x319a('0x8'));var csv=require(_0x319a('0x9'));var ejs=require(_0x319a('0xa'));var fs=require('fs');var fs_extra=require(_0x319a('0xb'));var _=require(_0x319a('0xc'));var squel=require(_0x319a('0xd'));var crypto=require(_0x319a('0xe'));var jsforce=require(_0x319a('0xf'));var deskjs=require(_0x319a('0x10'));var toCsv=require(_0x319a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x319a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x319a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x319a('0x13'));var logger=require(_0x319a('0x14'))(_0x319a('0x15'));var utils=require('../../config/utils');var config=require(_0x319a('0x16'));var licenseUtil=require(_0x319a('0x17'));var db=require(_0x319a('0x18'))['db'];function respondWithStatusCode(_0x29aedc,_0x5958db){_0x5958db=_0x5958db||0xcc;return function(_0x520ce5){if(_0x520ce5){return _0x29aedc['sendStatus'](_0x5958db);}return _0x29aedc[_0x319a('0x19')](_0x5958db)['end']();};}function respondWithResult(_0x5af038,_0x52774b){_0x52774b=_0x52774b||0xc8;return function(_0x386c39){if(_0x386c39){return _0x5af038[_0x319a('0x19')](_0x52774b)[_0x319a('0x1a')](_0x386c39);}};}function respondWithFilteredResult(_0x4ba51b,_0x4fafc1){return function(_0x22d0e4){if(_0x22d0e4){var _0x40978c=typeof _0x4fafc1[_0x319a('0x1b')]==='undefined'&&typeof _0x4fafc1[_0x319a('0x1c')]==='undefined';var _0x570681=_0x22d0e4[_0x319a('0x1d')];var _0x35e3f6=_0x40978c?0x0:_0x4fafc1[_0x319a('0x1b')];var _0xc1ad9c=_0x40978c?_0x22d0e4[_0x319a('0x1d')]:_0x4fafc1[_0x319a('0x1b')]+_0x4fafc1[_0x319a('0x1c')];var _0x3ff41e;if(_0xc1ad9c>=_0x570681){_0xc1ad9c=_0x570681;_0x3ff41e=0xc8;}else{_0x3ff41e=0xce;}_0x4ba51b[_0x319a('0x19')](_0x3ff41e);return _0x4ba51b[_0x319a('0x1e')](_0x319a('0x1f'),_0x35e3f6+'-'+_0xc1ad9c+'/'+_0x570681)[_0x319a('0x1a')](_0x22d0e4);}return null;};}function patchUpdates(_0x44ada0){return function(_0x51800d){try{jsonpatch['apply'](_0x51800d,_0x44ada0,!![]);}catch(_0x73c78a){return BPromise['reject'](_0x73c78a);}return _0x51800d[_0x319a('0x20')]();};}function saveUpdates(_0x2236be,_0x2acac5){return function(_0x1fae93){if(_0x1fae93){return _0x1fae93[_0x319a('0x21')](_0x2236be)[_0x319a('0x22')](function(_0x24dfe4){return _0x24dfe4;});}return null;};}function removeEntity(_0x28a433,_0x4a56aa){return function(_0x30cbaa){if(_0x30cbaa){return _0x30cbaa[_0x319a('0x23')]()[_0x319a('0x22')](function(){_0x28a433[_0x319a('0x19')](0xcc)[_0x319a('0x24')]();});}};}function handleEntityNotFound(_0x4e2287,_0x318abe){return function(_0x24b965){if(!_0x24b965){_0x4e2287[_0x319a('0x25')](0x194);}return _0x24b965;};}function handleError(_0x412c1c,_0x41a407){_0x41a407=_0x41a407||0x1f4;return function(_0xa6c114){logger[_0x319a('0x26')](_0xa6c114[_0x319a('0x27')]);if(_0xa6c114['name']){delete _0xa6c114['name'];}_0x412c1c['status'](_0x41a407)[_0x319a('0x28')](_0xa6c114);};}exports[_0x319a('0x29')]=function(_0x111a59,_0xdd3681){var _0x175c3d={},_0x29349d={},_0x476e45={'count':0x0,'rows':[]};var _0x2d2a34=_[_0x319a('0x2a')](db[_0x319a('0x2b')][_0x319a('0x2c')],function(_0x21fa55){return{'name':_0x21fa55[_0x319a('0x2d')],'type':_0x21fa55[_0x319a('0x2e')]['key']};});_0x29349d[_0x319a('0x2f')]=_[_0x319a('0x2a')](_0x2d2a34,'name');_0x29349d[_0x319a('0x30')]=_['keys'](_0x111a59['query']);_0x29349d['filters']=_['intersection'](_0x29349d[_0x319a('0x2f')],_0x29349d[_0x319a('0x30')]);_0x175c3d[_0x319a('0x31')]=_[_0x319a('0x32')](_0x29349d['model'],qs[_0x319a('0x33')](_0x111a59[_0x319a('0x30')][_0x319a('0x33')]));_0x175c3d[_0x319a('0x31')]=_0x175c3d[_0x319a('0x31')]['length']?_0x175c3d[_0x319a('0x31')]:_0x29349d[_0x319a('0x2f')];if(!_0x111a59['query'][_0x319a('0x34')](_0x319a('0x35'))){_0x175c3d['limit']=qs[_0x319a('0x1c')](_0x111a59[_0x319a('0x30')][_0x319a('0x1c')]);_0x175c3d['offset']=qs[_0x319a('0x1b')](_0x111a59[_0x319a('0x30')][_0x319a('0x1b')]);}_0x175c3d[_0x319a('0x36')]=qs[_0x319a('0x37')](_0x111a59[_0x319a('0x30')][_0x319a('0x37')]);_0x175c3d[_0x319a('0x38')]=qs['filters'](_[_0x319a('0x39')](_0x111a59[_0x319a('0x30')],_0x29349d['filters']),_0x2d2a34);if(_0x111a59[_0x319a('0x30')][_0x319a('0x3a')]){_0x175c3d[_0x319a('0x38')]=_[_0x319a('0x3b')](_0x175c3d[_0x319a('0x38')],{'$or':_['map'](_0x2d2a34,function(_0x43904c){if(_0x43904c[_0x319a('0x2e')]!==_0x319a('0x3c')){var _0x3e13c6={};_0x3e13c6[_0x43904c['name']]={'$like':'%'+_0x111a59[_0x319a('0x30')][_0x319a('0x3a')]+'%'};return _0x3e13c6;}})});}_0x175c3d=_[_0x319a('0x3b')]({},_0x175c3d,_0x111a59['options']);var _0x47c0fc={'where':_0x175c3d[_0x319a('0x38')]};return db[_0x319a('0x2b')][_0x319a('0x1d')](_0x47c0fc)[_0x319a('0x22')](function(_0x59171b){_0x476e45['count']=_0x59171b;if(_0x111a59[_0x319a('0x30')]['includeAll']){_0x175c3d[_0x319a('0x3d')]=[{'all':!![]}];}return db[_0x319a('0x2b')]['findAll'](_0x175c3d);})['then'](function(_0x51dda7){_0x476e45['rows']=_0x51dda7;return _0x476e45;})[_0x319a('0x22')](respondWithFilteredResult(_0xdd3681,_0x175c3d))['catch'](handleError(_0xdd3681,null));};exports[_0x319a('0x3e')]=function(_0x1e03b6,_0x16b146){var _0x493783={'raw':!![],'where':{'id':_0x1e03b6[_0x319a('0x3f')]['id']}},_0x698be6={};_0x698be6[_0x319a('0x2f')]=_[_0x319a('0x40')](db[_0x319a('0x2b')][_0x319a('0x2c')]);_0x698be6[_0x319a('0x30')]=_[_0x319a('0x40')](_0x1e03b6[_0x319a('0x30')]);_0x698be6['filters']=_[_0x319a('0x32')](_0x698be6[_0x319a('0x2f')],_0x698be6['query']);_0x493783[_0x319a('0x31')]=_[_0x319a('0x32')](_0x698be6[_0x319a('0x2f')],qs['fields'](_0x1e03b6[_0x319a('0x30')][_0x319a('0x33')]));_0x493783[_0x319a('0x31')]=_0x493783['attributes'][_0x319a('0x41')]?_0x493783[_0x319a('0x31')]:_0x698be6[_0x319a('0x2f')];if(_0x1e03b6[_0x319a('0x30')]['includeAll']){_0x493783[_0x319a('0x3d')]=[{'all':!![]}];}_0x493783=_[_0x319a('0x3b')]({},_0x493783,_0x1e03b6['options']);return db[_0x319a('0x2b')][_0x319a('0x42')](_0x493783)['then'](handleEntityNotFound(_0x16b146,null))['then'](respondWithResult(_0x16b146,null))[_0x319a('0x43')](handleError(_0x16b146,null));};exports['create']=function(_0x41e92d,_0x6be786){return db[_0x319a('0x2b')][_0x319a('0x44')](_0x41e92d[_0x319a('0x45')],{})['then'](respondWithResult(_0x6be786,0xc9))['catch'](handleError(_0x6be786,null));};exports[_0x319a('0x21')]=function(_0x4645ca,_0x423b5b){if(_0x4645ca[_0x319a('0x45')]['id']){delete _0x4645ca[_0x319a('0x45')]['id'];}return db[_0x319a('0x2b')]['find']({'where':{'id':_0x4645ca[_0x319a('0x3f')]['id']}})[_0x319a('0x22')](handleEntityNotFound(_0x423b5b,null))[_0x319a('0x22')](saveUpdates(_0x4645ca[_0x319a('0x45')],null))[_0x319a('0x22')](respondWithResult(_0x423b5b,null))['catch'](handleError(_0x423b5b,null));};exports[_0x319a('0x23')]=function(_0x21e6db,_0x1f2fed){return db['FreshsalesField']['find']({'where':{'id':_0x21e6db['params']['id']}})['then'](handleEntityNotFound(_0x1f2fed,null))['then'](removeEntity(_0x1f2fed,null))[_0x319a('0x43')](handleError(_0x1f2fed,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 52f23ca..7a81858 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 _0xd481=['../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x92791a,_0x425c65){var _0x2c17fb=function(_0x2c0b21){while(--_0x2c0b21){_0x92791a['push'](_0x92791a['shift']());}};_0x2c17fb(++_0x425c65);}(_0xd481,0x1e4));var _0x1d48=function(_0x3a1dda,_0x5c56d7){_0x3a1dda=_0x3a1dda-0x0;var _0x5ca3e1=_0xd481[_0x3a1dda];return _0x5ca3e1;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var logger=require(_0x1d48('0x1'))(_0x1d48('0x2'));var moment=require('moment');var BPromise=require(_0x1d48('0x3'));var rp=require(_0x1d48('0x4'));var fs=require('fs');var path=require(_0x1d48('0x5'));var rimraf=require('rimraf');var config=require(_0x1d48('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x1d48('0x7')]=function(_0x2a4830,_0x5a0c28){return _0x2a4830[_0x1d48('0x8')](_0x1d48('0x9'),attributes,{'tableName':_0x1d48('0xa'),'paranoid':![],'indexes':[{'name':_0x1d48('0xb'),'fields':[_0x1d48('0xc'),_0x1d48('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5853=['request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x6ca428,_0x2f1930){var _0x42d121=function(_0x34af63){while(--_0x34af63){_0x6ca428['push'](_0x6ca428['shift']());}};_0x42d121(++_0x2f1930);}(_0x5853,0x113));var _0x3585=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x5853[_0x1f7201];return _0x289fd2;};'use strict';var _=require(_0x3585('0x0'));var util=require(_0x3585('0x1'));var logger=require(_0x3585('0x2'))(_0x3585('0x3'));var moment=require(_0x3585('0x4'));var BPromise=require('bluebird');var rp=require(_0x3585('0x5'));var fs=require('fs');var path=require(_0x3585('0x6'));var rimraf=require(_0x3585('0x7'));var config=require(_0x3585('0x8'));var attributes=require(_0x3585('0x9'));module[_0x3585('0xa')]=function(_0x561ebe,_0x2e895d){return _0x561ebe['define']('FreshsalesField',attributes,{'tableName':_0x3585('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x3585('0xc'),_0x3585('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 53bb01f..ee29276 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 _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x3a2f2e,_0x48839b){var _0x4c8f7d=function(_0x5bf16b){while(--_0x5bf16b){_0x3a2f2e['push'](_0x3a2f2e['shift']());}};_0x4c8f7d(++_0x48839b);}(_0xeda8,0x104));var _0x8eda=function(_0x23e0c5,_0x146aca){_0x23e0c5=_0x23e0c5-0x0;var _0x4b4fe0=_0xeda8[_0x23e0c5];return _0x4b4fe0;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xe2ae2b,_0x48d240){var _0xa5cac5=function(_0x384b82){while(--_0x384b82){_0xe2ae2b['push'](_0xe2ae2b['shift']());}};_0xa5cac5(++_0x48d240);}(_0x5fab,0x177));var _0xb5fa=function(_0x4fe93e,_0x44f9e2){_0x4fe93e=_0x4fe93e-0x0;var _0x5f1d5a=_0x5fab[_0x4fe93e];return _0x5f1d5a;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3921613..d79dc1c 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xf87e8b,_0x3d8fb7){var _0x35f67c=function(_0x594a74){while(--_0x594a74){_0xf87e8b['push'](_0xf87e8b['shift']());}};_0x35f67c(++_0x3d8fb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4d24ea,_0x3f5526){var _0x268e16=function(_0x54bb82){while(--_0x54bb82){_0x4d24ea['push'](_0x4d24ea['shift']());}};_0x268e16(++_0x3f5526);}(_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/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index cfd2c3d..d00b707 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 _0x3646=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x13a835,_0x38eb0e){var _0x5eef55=function(_0x532dd1){while(--_0x532dd1){_0x13a835['push'](_0x13a835['shift']());}};_0x5eef55(++_0x38eb0e);}(_0x3646,0x15f));var _0x6364=function(_0x14248c,_0x1b087f){_0x14248c=_0x14248c-0x0;var _0x263376=_0x3646[_0x14248c];return _0x263376;};'use strict';var Sequelize=require(_0x6364('0x0'));module[_0x6364('0x1')]={'name':{'type':Sequelize[_0x6364('0x2')]},'description':{'type':Sequelize[_0x6364('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6364('0x3')},'remoteUri':{'type':Sequelize[_0x6364('0x2')]},'password':{'type':Sequelize[_0x6364('0x2')]},'clientId':{'type':Sequelize[_0x6364('0x2')]},'clientSecret':{'type':Sequelize[_0x6364('0x2')]},'securityToken':{'type':Sequelize[_0x6364('0x2')]},'serverUrl':{'type':Sequelize[_0x6364('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6364('0x4')](_0x6364('0x5'),_0x6364('0x6')),'defaultValue':_0x6364('0x5')}}; \ No newline at end of file +var _0x20d8=['STRING','username','ENUM','integrationTab','sequelize','exports'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x20d8,0xee));var _0x820d=function(_0x319784,_0x47e6d4){_0x319784=_0x319784-0x0;var _0x1917da=_0x20d8[_0x319784];return _0x1917da;};'use strict';var Sequelize=require(_0x820d('0x0'));module[_0x820d('0x1')]={'name':{'type':Sequelize[_0x820d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x820d('0x3')},'remoteUri':{'type':Sequelize[_0x820d('0x2')]},'password':{'type':Sequelize[_0x820d('0x2')]},'clientId':{'type':Sequelize[_0x820d('0x2')]},'clientSecret':{'type':Sequelize[_0x820d('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x820d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x820d('0x4')](_0x820d('0x5'),'newTab'),'defaultValue':_0x820d('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 859a8e7..8ca9efb 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 _0x8914=['map','SalesforceAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','update','getConfigurations','SalesforceConfiguration','length','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','isNil','ticketType','sobject','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','textarea','includes','label','custom','picklistValues','value','boolean','True','False','false','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','index'];(function(_0x3496e4,_0x550764){var _0x5690a0=function(_0x33445d){while(--_0x33445d){_0x3496e4['push'](_0x3496e4['shift']());}};_0x5690a0(++_0x550764);}(_0x8914,0xcc));var _0x4891=function(_0x31b4ad,_0x4ea918){_0x31b4ad=_0x31b4ad-0x0;var _0x18f198=_0x8914[_0x31b4ad];return _0x18f198;};'use strict';var emlformat=require(_0x4891('0x0'));var rimraf=require(_0x4891('0x1'));var zipdir=require(_0x4891('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4891('0x3'));var moment=require(_0x4891('0x4'));var BPromise=require(_0x4891('0x5'));var Mustache=require(_0x4891('0x6'));var util=require(_0x4891('0x7'));var path=require(_0x4891('0x8'));var sox=require(_0x4891('0x9'));var csv=require(_0x4891('0xa'));var ejs=require(_0x4891('0xb'));var fs=require('fs');var fs_extra=require(_0x4891('0xc'));var _=require(_0x4891('0xd'));var squel=require(_0x4891('0xe'));var crypto=require(_0x4891('0xf'));var jsforce=require(_0x4891('0x10'));var deskjs=require(_0x4891('0x11'));var toCsv=require(_0x4891('0xa'));var querystring=require(_0x4891('0x12'));var Papa=require(_0x4891('0x13'));var Redis=require('ioredis');var authService=require(_0x4891('0x14'));var qs=require(_0x4891('0x15'));var as=require(_0x4891('0x16'));var hardwareService=require(_0x4891('0x17'));var logger=require(_0x4891('0x18'))(_0x4891('0x19'));var utils=require(_0x4891('0x1a'));var config=require(_0x4891('0x1b'));var licenseUtil=require(_0x4891('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x56ea02,_0x5bfc69){_0x5bfc69=_0x5bfc69||0xcc;return function(_0x5c736b){if(_0x5c736b){return _0x56ea02[_0x4891('0x1d')](_0x5bfc69);}return _0x56ea02[_0x4891('0x1e')](_0x5bfc69)[_0x4891('0x1f')]();};}function respondWithResult(_0x32d4f4,_0x820e7d){_0x820e7d=_0x820e7d||0xc8;return function(_0x58e7e7){if(_0x58e7e7){return _0x32d4f4[_0x4891('0x1e')](_0x820e7d)['json'](_0x58e7e7);}};}function respondWithFilteredResult(_0x12e85f,_0x46daf5){return function(_0x2ef78a){if(_0x2ef78a){var _0x3d5ce4=typeof _0x46daf5[_0x4891('0x20')]==='undefined'&&typeof _0x46daf5[_0x4891('0x21')]==='undefined';var _0x39fb64=_0x2ef78a['count'];var _0x5d4eb6=_0x3d5ce4?0x0:_0x46daf5[_0x4891('0x20')];var _0x54ce5d=_0x3d5ce4?_0x2ef78a[_0x4891('0x22')]:_0x46daf5[_0x4891('0x20')]+_0x46daf5[_0x4891('0x21')];var _0x545ddf;if(_0x54ce5d>=_0x39fb64){_0x54ce5d=_0x39fb64;_0x545ddf=0xc8;}else{_0x545ddf=0xce;}_0x12e85f['status'](_0x545ddf);return _0x12e85f[_0x4891('0x23')](_0x4891('0x24'),_0x5d4eb6+'-'+_0x54ce5d+'/'+_0x39fb64)[_0x4891('0x25')](_0x2ef78a);}return null;};}function patchUpdates(_0x2ff296){return function(_0x46f37d){try{jsonpatch[_0x4891('0x26')](_0x46f37d,_0x2ff296,!![]);}catch(_0x4cadf7){return BPromise[_0x4891('0x27')](_0x4cadf7);}return _0x46f37d['save']();};}function saveUpdates(_0x3d5124,_0x1cb0df){return function(_0x403147){if(_0x403147){return _0x403147['update'](_0x3d5124)[_0x4891('0x28')](function(_0x4560b7){return _0x4560b7;});}return null;};}function removeEntity(_0x7169c7,_0x1998ba){return function(_0x4f04af){if(_0x4f04af){return _0x4f04af[_0x4891('0x29')]()[_0x4891('0x28')](function(){_0x7169c7[_0x4891('0x1e')](0xcc)[_0x4891('0x1f')]();});}};}function handleEntityNotFound(_0x5f3466,_0x5b3d49){return function(_0x4c6428){if(!_0x4c6428){_0x5f3466['sendStatus'](0x194);}return _0x4c6428;};}function handleError(_0x3a3027,_0x22d174){_0x22d174=_0x22d174||0x1f4;return function(_0x44d1eb){logger[_0x4891('0x2a')](_0x44d1eb[_0x4891('0x2b')]);if(_0x44d1eb['name']){delete _0x44d1eb[_0x4891('0x2c')];}_0x3a3027[_0x4891('0x1e')](_0x22d174)['send'](_0x44d1eb);};}exports[_0x4891('0x2d')]=function(_0x59ab48,_0xf6d8a1){var _0x3916dc={},_0x2236af={},_0x3c1517={'count':0x0,'rows':[]};var _0x3dd3b9=_[_0x4891('0x2e')](db[_0x4891('0x2f')][_0x4891('0x30')],function(_0x496f0a){return{'name':_0x496f0a['fieldName'],'type':_0x496f0a[_0x4891('0x31')][_0x4891('0x32')]};});_0x2236af['model']=_[_0x4891('0x2e')](_0x3dd3b9,_0x4891('0x2c'));_0x2236af[_0x4891('0x33')]=_[_0x4891('0x34')](_0x59ab48['query']);_0x2236af[_0x4891('0x35')]=_[_0x4891('0x36')](_0x2236af[_0x4891('0x37')],_0x2236af[_0x4891('0x33')]);_0x3916dc[_0x4891('0x38')]=_[_0x4891('0x36')](_0x2236af[_0x4891('0x37')],qs[_0x4891('0x39')](_0x59ab48[_0x4891('0x33')]['fields']));_0x3916dc['attributes']=_0x3916dc['attributes']['length']?_0x3916dc[_0x4891('0x38')]:_0x2236af['model'];if(!_0x59ab48[_0x4891('0x33')][_0x4891('0x3a')](_0x4891('0x3b'))){_0x3916dc[_0x4891('0x21')]=qs[_0x4891('0x21')](_0x59ab48['query'][_0x4891('0x21')]);_0x3916dc[_0x4891('0x20')]=qs[_0x4891('0x20')](_0x59ab48[_0x4891('0x33')][_0x4891('0x20')]);}_0x3916dc[_0x4891('0x3c')]=qs[_0x4891('0x3d')](_0x59ab48[_0x4891('0x33')]['sort']);_0x3916dc[_0x4891('0x3e')]=qs['filters'](_[_0x4891('0x3f')](_0x59ab48[_0x4891('0x33')],_0x2236af[_0x4891('0x35')]),_0x3dd3b9);if(_0x59ab48['query'][_0x4891('0x40')]){_0x3916dc['where']=_[_0x4891('0x41')](_0x3916dc['where'],{'$or':_['map'](_0x3dd3b9,function(_0x2150da){if(_0x2150da[_0x4891('0x31')]!==_0x4891('0x42')){var _0x5246be={};_0x5246be[_0x2150da[_0x4891('0x2c')]]={'$like':'%'+_0x59ab48[_0x4891('0x33')][_0x4891('0x40')]+'%'};return _0x5246be;}})});}_0x3916dc=_['merge']({},_0x3916dc,_0x59ab48[_0x4891('0x43')]);var _0x2b03fa={'where':_0x3916dc[_0x4891('0x3e')]};return db[_0x4891('0x2f')][_0x4891('0x22')](_0x2b03fa)[_0x4891('0x28')](function(_0x49c3d5){_0x3c1517[_0x4891('0x22')]=_0x49c3d5;if(_0x59ab48[_0x4891('0x33')][_0x4891('0x44')]){_0x3916dc[_0x4891('0x45')]=[{'all':!![]}];}return db[_0x4891('0x2f')]['findAll'](_0x3916dc);})['then'](function(_0xc66e6b){_0x3c1517[_0x4891('0x46')]=_0xc66e6b;return _0x3c1517;})[_0x4891('0x28')](respondWithFilteredResult(_0xf6d8a1,_0x3916dc))[_0x4891('0x47')](handleError(_0xf6d8a1,null));};exports['show']=function(_0x1d6a80,_0x5996c6){var _0x3c344b={'raw':![],'where':{'id':_0x1d6a80[_0x4891('0x48')]['id']}},_0x1def53={};_0x1def53['model']=_[_0x4891('0x34')](db[_0x4891('0x2f')][_0x4891('0x30')]);_0x1def53['query']=_[_0x4891('0x34')](_0x1d6a80[_0x4891('0x33')]);_0x1def53['filters']=_[_0x4891('0x36')](_0x1def53[_0x4891('0x37')],_0x1def53['query']);_0x3c344b[_0x4891('0x38')]=_[_0x4891('0x36')](_0x1def53['model'],qs[_0x4891('0x39')](_0x1d6a80['query'][_0x4891('0x39')]));_0x3c344b['attributes']=_0x3c344b[_0x4891('0x38')]['length']?_0x3c344b[_0x4891('0x38')]:_0x1def53[_0x4891('0x37')];if(_0x1d6a80['query'][_0x4891('0x44')]){_0x3c344b[_0x4891('0x45')]=[{'all':!![]}];}_0x3c344b=_[_0x4891('0x41')]({},_0x3c344b,_0x1d6a80[_0x4891('0x43')]);return db[_0x4891('0x2f')][_0x4891('0x49')](_0x3c344b)[_0x4891('0x28')](handleEntityNotFound(_0x5996c6,null))[_0x4891('0x28')](respondWithResult(_0x5996c6,null))[_0x4891('0x47')](handleError(_0x5996c6,null));};exports['create']=function(_0x19d09e,_0x307e87){return db[_0x4891('0x2f')][_0x4891('0x4a')](_0x19d09e[_0x4891('0x4b')],{})[_0x4891('0x28')](respondWithResult(_0x307e87,0xc9))['catch'](handleError(_0x307e87,null));};exports[_0x4891('0x4c')]=function(_0x2393c1,_0x49b347){if(_0x2393c1[_0x4891('0x4b')]['id']){delete _0x2393c1[_0x4891('0x4b')]['id'];}return db[_0x4891('0x2f')][_0x4891('0x49')]({'where':{'id':_0x2393c1[_0x4891('0x48')]['id']}})[_0x4891('0x28')](handleEntityNotFound(_0x49b347,null))[_0x4891('0x28')](saveUpdates(_0x2393c1[_0x4891('0x4b')],null))['then'](respondWithResult(_0x49b347,null))[_0x4891('0x47')](handleError(_0x49b347,null));};exports[_0x4891('0x29')]=function(_0x5c7013,_0x76eac3){return db['SalesforceAccount'][_0x4891('0x49')]({'where':{'id':_0x5c7013['params']['id']}})[_0x4891('0x28')](handleEntityNotFound(_0x76eac3,null))[_0x4891('0x28')](removeEntity(_0x76eac3,null))[_0x4891('0x47')](handleError(_0x76eac3,null));};exports[_0x4891('0x4d')]=function(_0x26acb6,_0x22368c,_0x3ff27a){var _0xe4f7c7={};var _0x2e7922={};var _0x2ce13f;var _0x1f85bb;return db[_0x4891('0x2f')]['findOne']({'where':{'id':_0x26acb6['params']['id']}})[_0x4891('0x28')](handleEntityNotFound(_0x22368c,null))[_0x4891('0x28')](function(_0x3f9740){if(_0x3f9740){_0x2ce13f=_0x3f9740;_0x2e7922['model']=_[_0x4891('0x34')](db[_0x4891('0x4e')]['rawAttributes']);_0x2e7922[_0x4891('0x33')]=_[_0x4891('0x34')](_0x26acb6[_0x4891('0x33')]);_0x2e7922['filters']=_[_0x4891('0x36')](_0x2e7922[_0x4891('0x37')],_0x2e7922[_0x4891('0x33')]);_0xe4f7c7[_0x4891('0x38')]=_['intersection'](_0x2e7922[_0x4891('0x37')],qs['fields'](_0x26acb6['query']['fields']));_0xe4f7c7[_0x4891('0x38')]=_0xe4f7c7[_0x4891('0x38')][_0x4891('0x4f')]?_0xe4f7c7[_0x4891('0x38')]:_0x2e7922[_0x4891('0x37')];_0xe4f7c7[_0x4891('0x3c')]=qs[_0x4891('0x3d')](_0x26acb6[_0x4891('0x33')][_0x4891('0x3d')]);_0xe4f7c7[_0x4891('0x3e')]=qs[_0x4891('0x35')](_[_0x4891('0x3f')](_0x26acb6[_0x4891('0x33')],_0x2e7922[_0x4891('0x35')]));if(_0x26acb6[_0x4891('0x33')]['filter']){_0xe4f7c7[_0x4891('0x3e')]=_[_0x4891('0x41')](_0xe4f7c7[_0x4891('0x3e')],{'$or':_[_0x4891('0x2e')](_0xe4f7c7[_0x4891('0x38')],function(_0x5675f2){var _0x9d2085={};_0x9d2085[_0x5675f2]={'$like':'%'+_0x26acb6['query']['filter']+'%'};return _0x9d2085;})});}_0xe4f7c7=_[_0x4891('0x41')]({},_0xe4f7c7,_0x26acb6[_0x4891('0x43')]);return _0x2ce13f[_0x4891('0x4d')](_0xe4f7c7);}})[_0x4891('0x28')](function(_0x33c753){if(_0x33c753){_0x1f85bb=_0x33c753[_0x4891('0x4f')];if(!_0x26acb6['query'][_0x4891('0x3a')](_0x4891('0x3b'))){_0xe4f7c7['limit']=qs['limit'](_0x26acb6[_0x4891('0x33')]['limit']);_0xe4f7c7['offset']=qs[_0x4891('0x20')](_0x26acb6['query'][_0x4891('0x20')]);}return _0x2ce13f['getConfigurations'](_0xe4f7c7);}})[_0x4891('0x28')](function(_0x1eb52f){if(_0x1eb52f){return _0x1eb52f?{'count':_0x1f85bb,'rows':_0x1eb52f}:null;}})[_0x4891('0x28')](respondWithResult(_0x22368c,null))[_0x4891('0x47')](handleError(_0x22368c,null));};exports[_0x4891('0x50')]=function(_0x455684,_0x48ae11,_0x3ce155){if(_0x455684[_0x4891('0x4b')]['id']){delete _0x455684['body']['id'];}return db[_0x4891('0x2f')]['findOne']({'where':{'id':_0x455684[_0x4891('0x48')]['id']}})[_0x4891('0x28')](handleEntityNotFound(_0x48ae11,null))[_0x4891('0x28')](function(_0x5ab4ee){if(_0x5ab4ee){_0x455684[_0x4891('0x4b')]['AccountId']=_0x5ab4ee['id'];_0x455684[_0x4891('0x4b')][_0x4891('0x51')]=integrations[_0x4891('0x52')](_0x455684[_0x4891('0x4b')][_0x4891('0x53')],_0x455684[_0x4891('0x4b')][_0x4891('0x31')]);_0x455684['body'][_0x4891('0x54')]=integrations[_0x4891('0x55')](_0x455684['body'][_0x4891('0x53')],_0x455684[_0x4891('0x4b')][_0x4891('0x31')]);return db[_0x4891('0x4e')][_0x4891('0x4a')](_0x455684['body'],{'include':[{'model':db[_0x4891('0x56')],'as':_0x4891('0x51')},{'model':db[_0x4891('0x56')],'as':_0x4891('0x54')}]});}return null;})[_0x4891('0x28')](respondWithResult(_0x48ae11,null))[_0x4891('0x47')](handleError(_0x48ae11,null));};exports['getFields']=function(_0x182e4f,_0x4663e8,_0x2f851a){var _0x47afe8;var _0x31b83d='';var _0x3d7415=_0x4891('0x57');return db['SalesforceAccount'][_0x4891('0x58')]({'where':{'id':_0x182e4f[_0x4891('0x48')]['id']},'attributes':['id',_0x4891('0x59'),_0x4891('0x5a'),_0x4891('0x5b'),_0x4891('0x5c'),_0x4891('0x5d'),_0x4891('0x5e')]})[_0x4891('0x28')](handleEntityNotFound(_0x4663e8,null))[_0x4891('0x28')](function(_0x341a8b){if(_0x341a8b){_0x31b83d=_0x341a8b[_0x4891('0x59')];var _0x2ebdec=_0x31b83d[_0x4891('0x5f')](-0x1);if(_0x2ebdec==='/'){_0x31b83d=_0x31b83d['substring'](0x0,_0x31b83d[_0x4891('0x60')](_0x2ebdec));}_0x47afe8=new jsforce[(_0x4891('0x61'))]({'oauth2':{'loginUrl':_0x31b83d,'clientId':_0x341a8b[_0x4891('0x5a')],'clientSecret':_0x341a8b['clientSecret']}});return _0x47afe8[_0x4891('0x62')](_0x341a8b['username'],_0x341a8b[_0x4891('0x5d')]['concat'](_0x341a8b[_0x4891('0x5e')]));}})[_0x4891('0x28')](function(_0x2933bf){if(_0x2933bf){if(!_[_0x4891('0x63')](_0x182e4f['query'][_0x4891('0x64')])){_0x3d7415=_0x182e4f[_0x4891('0x33')]['ticketType'];}return _0x47afe8[_0x4891('0x65')](_0x3d7415)['describe']();}})['then'](function(_0x3cae70){var _0x55715b=['OwnerId','ActivityDate',_0x4891('0x66'),_0x4891('0x67'),_0x4891('0x68'),_0x4891('0x69')];var _0x33a1e1=[_0x4891('0x6a'),'int',_0x4891('0x6b'),'boolean','email',_0x4891('0x6c'),'phone'];if(_0x3cae70){_['remove'](_0x3cae70[_0x4891('0x39')],function(_0x544ce0){return _0x55715b[_0x4891('0x6d')](_0x544ce0[_0x4891('0x2c')])||!_0x33a1e1[_0x4891('0x6d')](_0x544ce0[_0x4891('0x31')]);});return{'count':_0x3cae70['fields'][_0x4891('0x4f')],'rows':_['map'](_0x3cae70[_0x4891('0x39')],function(_0xdf2835){return{'id':_0xdf2835[_0x4891('0x2c')],'name':_0xdf2835[_0x4891('0x6e')],'custom':_0xdf2835[_0x4891('0x6f')],'options':_0xdf2835['picklistValues']['length']>0x0?_['map'](_0xdf2835[_0x4891('0x70')],function(_0x25ab1a){return{'name':_0x25ab1a[_0x4891('0x6e')],'value':_0x25ab1a[_0x4891('0x71')]};}):_0xdf2835['type']==_0x4891('0x72')?[{'name':_0x4891('0x73'),'value':'true'},{'name':_0x4891('0x74'),'value':_0x4891('0x75')}]:[]};})};}})[_0x4891('0x28')](respondWithResult(_0x4663e8,null))['catch'](function(_0x5aa358){var _0x3914aa=_0x182e4f[_0x4891('0x33')]['test']?0x1f4:_0x5aa358['statusCode']||0x1f4;logger[_0x4891('0x2a')](_0x4891('0x76'),_0x4891('0x77'),_0x3914aa,JSON[_0x4891('0x78')](_0x5aa358));delete _0x5aa358[_0x4891('0x2c')];if(_0x3914aa===0x191){_0x3914aa=0x190;}_0x4663e8[_0x4891('0x1e')](_0x3914aa)[_0x4891('0x79')](_0x182e4f[_0x4891('0x33')][_0x4891('0x7a')]?{'message':_0x4891('0x7b'),'statusCode':_0x5aa358[_0x4891('0x7c')]}:_0x5aa358);});}; \ No newline at end of file +var _0x75c9=['catch','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','string','int','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','reject','save','update','then','sendStatus','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create'];(function(_0x4dc9be,_0x17e700){var _0x4d2bb5=function(_0x1d8819){while(--_0x1d8819){_0x4dc9be['push'](_0x4dc9be['shift']());}};_0x4d2bb5(++_0x17e700);}(_0x75c9,0xb2));var _0x975c=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x75c9[_0x6173fc];return _0x965fbe;};'use strict';var emlformat=require(_0x975c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x975c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x975c('0x2'));var moment=require(_0x975c('0x3'));var BPromise=require(_0x975c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x975c('0x5'));var sox=require(_0x975c('0x6'));var csv=require('to-csv');var ejs=require(_0x975c('0x7'));var fs=require('fs');var fs_extra=require(_0x975c('0x8'));var _=require(_0x975c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x975c('0xa'));var deskjs=require(_0x975c('0xb'));var toCsv=require(_0x975c('0xc'));var querystring=require(_0x975c('0xd'));var Papa=require('papaparse');var Redis=require(_0x975c('0xe'));var authService=require(_0x975c('0xf'));var qs=require(_0x975c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x975c('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x975c('0x12'));var licenseUtil=require(_0x975c('0x13'));var db=require(_0x975c('0x14'))['db'];var integrations=require(_0x975c('0x15'));function respondWithStatusCode(_0x4b9bb1,_0x4f3568){_0x4f3568=_0x4f3568||0xcc;return function(_0x1c643a){if(_0x1c643a){return _0x4b9bb1['sendStatus'](_0x4f3568);}return _0x4b9bb1[_0x975c('0x16')](_0x4f3568)[_0x975c('0x17')]();};}function respondWithResult(_0x11339f,_0x1b1e51){_0x1b1e51=_0x1b1e51||0xc8;return function(_0x33e330){if(_0x33e330){return _0x11339f['status'](_0x1b1e51)[_0x975c('0x18')](_0x33e330);}};}function respondWithFilteredResult(_0x53122c,_0x40d8c1){return function(_0x18e198){if(_0x18e198){var _0x5ecf0b=typeof _0x40d8c1['offset']==='undefined'&&typeof _0x40d8c1[_0x975c('0x19')]===_0x975c('0x1a');var _0x30592b=_0x18e198[_0x975c('0x1b')];var _0x37e500=_0x5ecf0b?0x0:_0x40d8c1[_0x975c('0x1c')];var _0x3198a7=_0x5ecf0b?_0x18e198[_0x975c('0x1b')]:_0x40d8c1['offset']+_0x40d8c1[_0x975c('0x19')];var _0x2e9dc5;if(_0x3198a7>=_0x30592b){_0x3198a7=_0x30592b;_0x2e9dc5=0xc8;}else{_0x2e9dc5=0xce;}_0x53122c[_0x975c('0x16')](_0x2e9dc5);return _0x53122c['set']('Content-Range',_0x37e500+'-'+_0x3198a7+'/'+_0x30592b)['json'](_0x18e198);}return null;};}function patchUpdates(_0x2ea41e){return function(_0x114b35){try{jsonpatch['apply'](_0x114b35,_0x2ea41e,!![]);}catch(_0xff170a){return BPromise[_0x975c('0x1d')](_0xff170a);}return _0x114b35[_0x975c('0x1e')]();};}function saveUpdates(_0x1b61c0,_0x3c9013){return function(_0x515a49){if(_0x515a49){return _0x515a49[_0x975c('0x1f')](_0x1b61c0)['then'](function(_0x35a295){return _0x35a295;});}return null;};}function removeEntity(_0x3a9c4b,_0x46cf5c){return function(_0x2664ae){if(_0x2664ae){return _0x2664ae['destroy']()[_0x975c('0x20')](function(){_0x3a9c4b['status'](0xcc)[_0x975c('0x17')]();});}};}function handleEntityNotFound(_0x491179,_0x3b32f9){return function(_0x3d9fa9){if(!_0x3d9fa9){_0x491179[_0x975c('0x21')](0x194);}return _0x3d9fa9;};}function handleError(_0x302852,_0x15b8cd){_0x15b8cd=_0x15b8cd||0x1f4;return function(_0x17b100){logger[_0x975c('0x22')](_0x17b100[_0x975c('0x23')]);if(_0x17b100['name']){delete _0x17b100[_0x975c('0x24')];}_0x302852['status'](_0x15b8cd)['send'](_0x17b100);};}exports[_0x975c('0x25')]=function(_0x2a2f6e,_0x3ae42b){var _0x1dabda={},_0x33ea5d={},_0x21ba2f={'count':0x0,'rows':[]};var _0x33bbc7=_[_0x975c('0x26')](db[_0x975c('0x27')][_0x975c('0x28')],function(_0x3b072e){return{'name':_0x3b072e[_0x975c('0x29')],'type':_0x3b072e[_0x975c('0x2a')][_0x975c('0x2b')]};});_0x33ea5d[_0x975c('0x2c')]=_[_0x975c('0x26')](_0x33bbc7,_0x975c('0x24'));_0x33ea5d['query']=_[_0x975c('0x2d')](_0x2a2f6e[_0x975c('0x2e')]);_0x33ea5d[_0x975c('0x2f')]=_['intersection'](_0x33ea5d[_0x975c('0x2c')],_0x33ea5d[_0x975c('0x2e')]);_0x1dabda[_0x975c('0x30')]=_[_0x975c('0x31')](_0x33ea5d['model'],qs[_0x975c('0x32')](_0x2a2f6e[_0x975c('0x2e')]['fields']));_0x1dabda[_0x975c('0x30')]=_0x1dabda[_0x975c('0x30')][_0x975c('0x33')]?_0x1dabda[_0x975c('0x30')]:_0x33ea5d[_0x975c('0x2c')];if(!_0x2a2f6e[_0x975c('0x2e')][_0x975c('0x34')](_0x975c('0x35'))){_0x1dabda[_0x975c('0x19')]=qs['limit'](_0x2a2f6e['query'][_0x975c('0x19')]);_0x1dabda[_0x975c('0x1c')]=qs[_0x975c('0x1c')](_0x2a2f6e[_0x975c('0x2e')][_0x975c('0x1c')]);}_0x1dabda[_0x975c('0x36')]=qs[_0x975c('0x37')](_0x2a2f6e[_0x975c('0x2e')]['sort']);_0x1dabda[_0x975c('0x38')]=qs['filters'](_[_0x975c('0x39')](_0x2a2f6e[_0x975c('0x2e')],_0x33ea5d['filters']),_0x33bbc7);if(_0x2a2f6e[_0x975c('0x2e')][_0x975c('0x3a')]){_0x1dabda['where']=_['merge'](_0x1dabda[_0x975c('0x38')],{'$or':_[_0x975c('0x26')](_0x33bbc7,function(_0x5b2cc4){if(_0x5b2cc4[_0x975c('0x2a')]!==_0x975c('0x3b')){var _0x2d4fa0={};_0x2d4fa0[_0x5b2cc4['name']]={'$like':'%'+_0x2a2f6e[_0x975c('0x2e')][_0x975c('0x3a')]+'%'};return _0x2d4fa0;}})});}_0x1dabda=_[_0x975c('0x3c')]({},_0x1dabda,_0x2a2f6e[_0x975c('0x3d')]);var _0x177dc3={'where':_0x1dabda['where']};return db[_0x975c('0x27')][_0x975c('0x1b')](_0x177dc3)['then'](function(_0x5320db){_0x21ba2f[_0x975c('0x1b')]=_0x5320db;if(_0x2a2f6e[_0x975c('0x2e')][_0x975c('0x3e')]){_0x1dabda[_0x975c('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x975c('0x40')](_0x1dabda);})[_0x975c('0x20')](function(_0x1136d3){_0x21ba2f[_0x975c('0x41')]=_0x1136d3;return _0x21ba2f;})[_0x975c('0x20')](respondWithFilteredResult(_0x3ae42b,_0x1dabda))['catch'](handleError(_0x3ae42b,null));};exports[_0x975c('0x42')]=function(_0x2fb449,_0x399536){var _0x161754={'raw':![],'where':{'id':_0x2fb449[_0x975c('0x43')]['id']}},_0xe8307f={};_0xe8307f['model']=_[_0x975c('0x2d')](db['SalesforceAccount'][_0x975c('0x28')]);_0xe8307f[_0x975c('0x2e')]=_['keys'](_0x2fb449['query']);_0xe8307f[_0x975c('0x2f')]=_[_0x975c('0x31')](_0xe8307f[_0x975c('0x2c')],_0xe8307f['query']);_0x161754[_0x975c('0x30')]=_[_0x975c('0x31')](_0xe8307f[_0x975c('0x2c')],qs[_0x975c('0x32')](_0x2fb449[_0x975c('0x2e')][_0x975c('0x32')]));_0x161754[_0x975c('0x30')]=_0x161754[_0x975c('0x30')][_0x975c('0x33')]?_0x161754[_0x975c('0x30')]:_0xe8307f[_0x975c('0x2c')];if(_0x2fb449[_0x975c('0x2e')][_0x975c('0x3e')]){_0x161754[_0x975c('0x3f')]=[{'all':!![]}];}_0x161754=_[_0x975c('0x3c')]({},_0x161754,_0x2fb449[_0x975c('0x3d')]);return db[_0x975c('0x27')][_0x975c('0x44')](_0x161754)[_0x975c('0x20')](handleEntityNotFound(_0x399536,null))[_0x975c('0x20')](respondWithResult(_0x399536,null))['catch'](handleError(_0x399536,null));};exports[_0x975c('0x45')]=function(_0x4ed9be,_0x491489){return db[_0x975c('0x27')][_0x975c('0x45')](_0x4ed9be['body'],{})['then'](respondWithResult(_0x491489,0xc9))[_0x975c('0x46')](handleError(_0x491489,null));};exports[_0x975c('0x1f')]=function(_0x482db1,_0x2f12c0){if(_0x482db1['body']['id']){delete _0x482db1['body']['id'];}return db[_0x975c('0x27')][_0x975c('0x44')]({'where':{'id':_0x482db1[_0x975c('0x43')]['id']}})[_0x975c('0x20')](handleEntityNotFound(_0x2f12c0,null))['then'](saveUpdates(_0x482db1['body'],null))[_0x975c('0x20')](respondWithResult(_0x2f12c0,null))[_0x975c('0x46')](handleError(_0x2f12c0,null));};exports[_0x975c('0x47')]=function(_0x4ebbe4,_0x130cc9){return db[_0x975c('0x27')][_0x975c('0x44')]({'where':{'id':_0x4ebbe4[_0x975c('0x43')]['id']}})[_0x975c('0x20')](handleEntityNotFound(_0x130cc9,null))[_0x975c('0x20')](removeEntity(_0x130cc9,null))[_0x975c('0x46')](handleError(_0x130cc9,null));};exports[_0x975c('0x48')]=function(_0x1ce472,_0x4d0017,_0x56c7e4){var _0x3136c6={};var _0x54666d={};var _0x54c70c;var _0x16bf75;return db[_0x975c('0x27')][_0x975c('0x49')]({'where':{'id':_0x1ce472[_0x975c('0x43')]['id']}})[_0x975c('0x20')](handleEntityNotFound(_0x4d0017,null))['then'](function(_0x8ac161){if(_0x8ac161){_0x54c70c=_0x8ac161;_0x54666d[_0x975c('0x2c')]=_['keys'](db[_0x975c('0x4a')]['rawAttributes']);_0x54666d[_0x975c('0x2e')]=_[_0x975c('0x2d')](_0x1ce472[_0x975c('0x2e')]);_0x54666d['filters']=_[_0x975c('0x31')](_0x54666d[_0x975c('0x2c')],_0x54666d[_0x975c('0x2e')]);_0x3136c6[_0x975c('0x30')]=_[_0x975c('0x31')](_0x54666d[_0x975c('0x2c')],qs['fields'](_0x1ce472[_0x975c('0x2e')][_0x975c('0x32')]));_0x3136c6['attributes']=_0x3136c6[_0x975c('0x30')]['length']?_0x3136c6['attributes']:_0x54666d[_0x975c('0x2c')];_0x3136c6[_0x975c('0x36')]=qs[_0x975c('0x37')](_0x1ce472[_0x975c('0x2e')][_0x975c('0x37')]);_0x3136c6[_0x975c('0x38')]=qs[_0x975c('0x2f')](_[_0x975c('0x39')](_0x1ce472[_0x975c('0x2e')],_0x54666d[_0x975c('0x2f')]));if(_0x1ce472[_0x975c('0x2e')]['filter']){_0x3136c6['where']=_[_0x975c('0x3c')](_0x3136c6['where'],{'$or':_[_0x975c('0x26')](_0x3136c6[_0x975c('0x30')],function(_0x1c3c64){var _0x33ac5e={};_0x33ac5e[_0x1c3c64]={'$like':'%'+_0x1ce472[_0x975c('0x2e')][_0x975c('0x3a')]+'%'};return _0x33ac5e;})});}_0x3136c6=_[_0x975c('0x3c')]({},_0x3136c6,_0x1ce472[_0x975c('0x3d')]);return _0x54c70c[_0x975c('0x48')](_0x3136c6);}})['then'](function(_0x586ef5){if(_0x586ef5){_0x16bf75=_0x586ef5[_0x975c('0x33')];if(!_0x1ce472[_0x975c('0x2e')][_0x975c('0x34')](_0x975c('0x35'))){_0x3136c6[_0x975c('0x19')]=qs['limit'](_0x1ce472['query'][_0x975c('0x19')]);_0x3136c6[_0x975c('0x1c')]=qs[_0x975c('0x1c')](_0x1ce472['query'][_0x975c('0x1c')]);}return _0x54c70c['getConfigurations'](_0x3136c6);}})[_0x975c('0x20')](function(_0x4dd029){if(_0x4dd029){return _0x4dd029?{'count':_0x16bf75,'rows':_0x4dd029}:null;}})['then'](respondWithResult(_0x4d0017,null))[_0x975c('0x46')](handleError(_0x4d0017,null));};exports[_0x975c('0x4b')]=function(_0x4b78f6,_0x58a6e1,_0xa77c22){if(_0x4b78f6[_0x975c('0x4c')]['id']){delete _0x4b78f6['body']['id'];}return db[_0x975c('0x27')][_0x975c('0x49')]({'where':{'id':_0x4b78f6[_0x975c('0x43')]['id']}})[_0x975c('0x20')](handleEntityNotFound(_0x58a6e1,null))['then'](function(_0x7db485){if(_0x7db485){_0x4b78f6[_0x975c('0x4c')][_0x975c('0x4d')]=_0x7db485['id'];_0x4b78f6['body'][_0x975c('0x4e')]=integrations[_0x975c('0x4f')](_0x4b78f6[_0x975c('0x4c')][_0x975c('0x50')],_0x4b78f6['body'][_0x975c('0x2a')]);_0x4b78f6[_0x975c('0x4c')][_0x975c('0x51')]=integrations['getDescriptions'](_0x4b78f6['body'][_0x975c('0x50')],_0x4b78f6['body']['type']);return db[_0x975c('0x4a')][_0x975c('0x45')](_0x4b78f6[_0x975c('0x4c')],{'include':[{'model':db[_0x975c('0x52')],'as':'Subjects'},{'model':db[_0x975c('0x52')],'as':_0x975c('0x51')}]});}return null;})[_0x975c('0x20')](respondWithResult(_0x58a6e1,null))[_0x975c('0x46')](handleError(_0x58a6e1,null));};exports[_0x975c('0x53')]=function(_0x116279,_0x503442,_0x1151b0){var _0x199380;var _0x43b01e='';var _0x442c60=_0x975c('0x54');return db[_0x975c('0x27')][_0x975c('0x49')]({'where':{'id':_0x116279[_0x975c('0x43')]['id']},'attributes':['id',_0x975c('0x55'),_0x975c('0x56'),_0x975c('0x57'),_0x975c('0x58'),_0x975c('0x59'),_0x975c('0x5a')]})[_0x975c('0x20')](handleEntityNotFound(_0x503442,null))[_0x975c('0x20')](function(_0x1067cb){if(_0x1067cb){_0x43b01e=_0x1067cb[_0x975c('0x55')];var _0x5f2bf5=_0x43b01e['slice'](-0x1);if(_0x5f2bf5==='/'){_0x43b01e=_0x43b01e[_0x975c('0x5b')](0x0,_0x43b01e[_0x975c('0x5c')](_0x5f2bf5));}_0x199380=new jsforce[(_0x975c('0x5d'))]({'oauth2':{'loginUrl':_0x43b01e,'clientId':_0x1067cb['clientId'],'clientSecret':_0x1067cb[_0x975c('0x57')]}});return _0x199380[_0x975c('0x5e')](_0x1067cb[_0x975c('0x58')],_0x1067cb[_0x975c('0x59')][_0x975c('0x5f')](_0x1067cb[_0x975c('0x5a')]));}})[_0x975c('0x20')](function(_0x460e74){if(_0x460e74){if(!_[_0x975c('0x60')](_0x116279[_0x975c('0x2e')][_0x975c('0x61')])){_0x442c60=_0x116279['query']['ticketType'];}return _0x199380[_0x975c('0x62')](_0x442c60)[_0x975c('0x63')]();}})[_0x975c('0x20')](function(_0x3417ac){var _0x492baa=['OwnerId','ActivityDate',_0x975c('0x64'),_0x975c('0x65'),'Subject','Description'];var _0x3414d7=[_0x975c('0x66'),_0x975c('0x67'),'picklist',_0x975c('0x68'),_0x975c('0x69'),_0x975c('0x6a'),_0x975c('0x6b')];if(_0x3417ac){_[_0x975c('0x6c')](_0x3417ac[_0x975c('0x32')],function(_0x5ef6b1){return _0x492baa[_0x975c('0x6d')](_0x5ef6b1[_0x975c('0x24')])||!_0x3414d7['includes'](_0x5ef6b1[_0x975c('0x2a')]);});return{'count':_0x3417ac[_0x975c('0x32')][_0x975c('0x33')],'rows':_['map'](_0x3417ac['fields'],function(_0x35c1fc){return{'id':_0x35c1fc[_0x975c('0x24')],'name':_0x35c1fc[_0x975c('0x6e')],'custom':_0x35c1fc[_0x975c('0x6f')],'options':_0x35c1fc[_0x975c('0x70')][_0x975c('0x33')]>0x0?_['map'](_0x35c1fc[_0x975c('0x70')],function(_0x3245b8){return{'name':_0x3245b8['label'],'value':_0x3245b8[_0x975c('0x71')]};}):_0x35c1fc[_0x975c('0x2a')]=='boolean'?[{'name':_0x975c('0x72'),'value':_0x975c('0x73')},{'name':_0x975c('0x74'),'value':_0x975c('0x75')}]:[]};})};}})['then'](respondWithResult(_0x503442,null))[_0x975c('0x46')](function(_0x22b840){var _0x257f6b=_0x116279[_0x975c('0x2e')]['test']?0x1f4:_0x22b840['statusCode']||0x1f4;logger[_0x975c('0x22')](_0x975c('0x76'),_0x975c('0x53'),_0x257f6b,JSON[_0x975c('0x77')](_0x22b840));delete _0x22b840[_0x975c('0x24')];if(_0x257f6b===0x191){_0x257f6b=0x190;}_0x503442[_0x975c('0x16')](_0x257f6b)[_0x975c('0x78')](_0x116279[_0x975c('0x2e')][_0x975c('0x79')]?{'message':_0x975c('0x7a'),'statusCode':_0x22b840[_0x975c('0x7b')]}:_0x22b840);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 14aa20f..24836aa 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 _0x0fca=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0x0fca,0x185));var _0xa0fc=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0fca[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xa0fc('0x0'));var util=require(_0xa0fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa0fc('0x2'));var BPromise=require(_0xa0fc('0x3'));var rp=require(_0xa0fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0fc('0x5'));var config=require(_0xa0fc('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xa0fc('0x7'));module[_0xa0fc('0x8')]=function(_0x42b04d,_0x4301b6){return _0x42b04d[_0xa0fc('0x9')](_0xa0fc('0xa'),attributes,{'tableName':_0xa0fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ac5=['bluebird','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','lodash','util','../../config/logger'];(function(_0x45df7d,_0xe130fa){var _0x51cb41=function(_0x20e909){while(--_0x20e909){_0x45df7d['push'](_0x45df7d['shift']());}};_0x51cb41(++_0xe130fa);}(_0x4ac5,0x1ed));var _0x54ac=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x4ac5[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0x54ac('0x0'));var util=require(_0x54ac('0x1'));var logger=require(_0x54ac('0x2'))('api');var moment=require('moment');var BPromise=require(_0x54ac('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x54ac('0x4'));var attributes=require(_0x54ac('0x5'));var integrations=require(_0x54ac('0x6'));module['exports']=function(_0x4a518d,_0x408b97){return _0x4a518d['define'](_0x54ac('0x7'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 5bead11..fad5964 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 _0xe137=['raw','where','attributes','limit','model','include','map','then','info','find','ShowSalesforceAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xe137,0x176));var _0x7e13=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xe137[_0x216d45];return _0xbaac0b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e13('0x0'));var BPromise=require(_0x7e13('0x1'));var rs=require(_0x7e13('0x2'));var fs=require('fs');var Redis=require(_0x7e13('0x3'));var db=require(_0x7e13('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e13('0x5'));var config=require('../../config/environment');var jayson=require(_0x7e13('0x6'));var client=jayson['client'][_0x7e13('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50902f,_0x2bb94a,_0x1d6c8f){return new BPromise(function(_0x47acd7,_0x5e2d19){return client['request'](_0x50902f,_0x1d6c8f)['then'](function(_0x4f01a2){logger['info'](_0x7e13('0x8'),_0x2bb94a,_0x7e13('0x9'));logger[_0x7e13('0xa')](_0x7e13('0xb'),_0x2bb94a,_0x7e13('0x9'),JSON[_0x7e13('0xc')](_0x4f01a2));if(_0x4f01a2[_0x7e13('0xd')]){if(_0x4f01a2['error'][_0x7e13('0xe')]===0x1f4){logger[_0x7e13('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x2bb94a,_0x4f01a2['error'][_0x7e13('0xf')]);return _0x5e2d19(_0x4f01a2[_0x7e13('0xd')][_0x7e13('0xf')]);}logger[_0x7e13('0xd')](_0x7e13('0x8'),_0x2bb94a,_0x4f01a2['error'][_0x7e13('0xf')]);return _0x47acd7(_0x4f01a2[_0x7e13('0xd')]['message']);}else{logger['info'](_0x7e13('0x8'),_0x2bb94a,_0x7e13('0x9'));_0x47acd7(_0x4f01a2[_0x7e13('0x10')][_0x7e13('0xf')]);}})[_0x7e13('0x11')](function(_0x1a2c44){logger[_0x7e13('0xd')](_0x7e13('0x8'),_0x2bb94a,_0x1a2c44);_0x5e2d19(_0x1a2c44);});});}exports[_0x7e13('0x12')]=function(_0x27ec4c){var _0xdfa7c2=this;return new Promise(function(_0x3ac440,_0x1d53aa){return db[_0x7e13('0x13')][_0x7e13('0x14')]({'raw':_0x27ec4c['options']?_0x27ec4c[_0x7e13('0x15')][_0x7e13('0x16')]===undefined?!![]:![]:!![],'where':_0x27ec4c['options']?_0x27ec4c['options'][_0x7e13('0x17')]||null:null,'attributes':_0x27ec4c[_0x7e13('0x15')]?_0x27ec4c['options'][_0x7e13('0x18')]||null:null,'limit':_0x27ec4c[_0x7e13('0x15')]?_0x27ec4c[_0x7e13('0x15')][_0x7e13('0x19')]||null:null,'include':_0x27ec4c[_0x7e13('0x15')]?_0x27ec4c[_0x7e13('0x15')]['include']?_['map'](_0x27ec4c[_0x7e13('0x15')]['include'],function(_0x39e2fd){return{'model':db[_0x39e2fd[_0x7e13('0x1a')]],'as':_0x39e2fd['as'],'attributes':_0x39e2fd[_0x7e13('0x18')],'include':_0x39e2fd[_0x7e13('0x1b')]?_[_0x7e13('0x1c')](_0x39e2fd['include'],function(_0x856cbe){return{'model':db[_0x856cbe['model']],'as':_0x856cbe['as'],'attributes':_0x856cbe[_0x7e13('0x18')],'include':_0x856cbe[_0x7e13('0x1b')]?_[_0x7e13('0x1c')](_0x856cbe['include'],function(_0x101923){return{'model':db[_0x101923[_0x7e13('0x1a')]],'as':_0x101923['as'],'attributes':_0x101923['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e13('0x1d')](function(_0x3660bb){logger[_0x7e13('0x1e')](_0x7e13('0x12'),_0x27ec4c);logger[_0x7e13('0xa')]('GetSalesforceAccount',_0x27ec4c,JSON[_0x7e13('0xc')](_0x3660bb));_0x3ac440(_0x3660bb);})[_0x7e13('0x11')](function(_0x40bb03){logger['error'](_0x7e13('0x12'),_0x40bb03['message'],_0x27ec4c);_0x1d53aa(_0xdfa7c2['error'](0x1f4,_0x40bb03[_0x7e13('0xf')]));});});};exports['ShowSalesforceAccount']=function(_0x343da3){var _0x5d39e8=this;return new Promise(function(_0x2d2a90,_0x38c2e7){return db[_0x7e13('0x13')][_0x7e13('0x1f')]({'raw':_0x343da3['options']?_0x343da3[_0x7e13('0x15')][_0x7e13('0x16')]===undefined?!![]:![]:!![],'where':_0x343da3[_0x7e13('0x15')]?_0x343da3[_0x7e13('0x15')][_0x7e13('0x17')]||null:null,'attributes':_0x343da3[_0x7e13('0x15')]?_0x343da3[_0x7e13('0x15')]['attributes']||null:null,'include':_0x343da3[_0x7e13('0x15')]?_0x343da3[_0x7e13('0x15')][_0x7e13('0x1b')]?_[_0x7e13('0x1c')](_0x343da3[_0x7e13('0x15')]['include'],function(_0x29931c){return{'model':db[_0x29931c[_0x7e13('0x1a')]],'as':_0x29931c['as'],'attributes':_0x29931c[_0x7e13('0x18')],'include':_0x29931c[_0x7e13('0x1b')]?_[_0x7e13('0x1c')](_0x29931c[_0x7e13('0x1b')],function(_0x2effd5){return{'model':db[_0x2effd5[_0x7e13('0x1a')]],'as':_0x2effd5['as'],'attributes':_0x2effd5['attributes'],'include':_0x2effd5['include']?_[_0x7e13('0x1c')](_0x2effd5['include'],function(_0x4208f7){return{'model':db[_0x4208f7[_0x7e13('0x1a')]],'as':_0x4208f7['as'],'attributes':_0x4208f7[_0x7e13('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e13('0x1d')](function(_0x4634f9){logger['info'](_0x7e13('0x20'),_0x343da3);logger[_0x7e13('0xa')](_0x7e13('0x20'),_0x343da3,JSON[_0x7e13('0xc')](_0x4634f9));_0x2d2a90(_0x4634f9);})[_0x7e13('0x11')](function(_0x350c08){logger[_0x7e13('0xd')](_0x7e13('0x20'),_0x350c08[_0x7e13('0xf')],_0x343da3);_0x38c2e7(_0x5d39e8[_0x7e13('0xd')](0x1f4,_0x350c08[_0x7e13('0xf')]));});});}; \ No newline at end of file +var _0x392c=['find','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowSalesforceAccount'];(function(_0x297f8c,_0x3a8986){var _0x27fd31=function(_0x5105ee){while(--_0x5105ee){_0x297f8c['push'](_0x297f8c['shift']());}};_0x27fd31(++_0x3a8986);}(_0x392c,0x183));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc392('0x0'));var util=require(_0xc392('0x1'));var moment=require(_0xc392('0x2'));var BPromise=require('bluebird');var rs=require(_0xc392('0x3'));var fs=require('fs');var Redis=require(_0xc392('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc392('0x5'));var logger=require(_0xc392('0x6'))(_0xc392('0x7'));var config=require(_0xc392('0x8'));var jayson=require(_0xc392('0x9'));var client=jayson[_0xc392('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400b06,_0x3899ef,_0x2c5058){return new BPromise(function(_0x19ecc0,_0x2f64ca){return client['request'](_0x400b06,_0x2c5058)[_0xc392('0xb')](function(_0x244aec){logger[_0xc392('0xc')](_0xc392('0xd'),_0x3899ef,_0xc392('0xe'));logger['debug'](_0xc392('0xf'),_0x3899ef,_0xc392('0xe'),JSON['stringify'](_0x244aec));if(_0x244aec[_0xc392('0x10')]){if(_0x244aec[_0xc392('0x10')][_0xc392('0x11')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x3899ef,_0x244aec[_0xc392('0x10')][_0xc392('0x12')]);return _0x2f64ca(_0x244aec['error'][_0xc392('0x12')]);}logger[_0xc392('0x10')](_0xc392('0xd'),_0x3899ef,_0x244aec[_0xc392('0x10')][_0xc392('0x12')]);return _0x19ecc0(_0x244aec[_0xc392('0x10')]['message']);}else{logger[_0xc392('0xc')](_0xc392('0xd'),_0x3899ef,_0xc392('0xe'));_0x19ecc0(_0x244aec[_0xc392('0x13')][_0xc392('0x12')]);}})[_0xc392('0x14')](function(_0x4e6ee9){logger['error'](_0xc392('0xd'),_0x3899ef,_0x4e6ee9);_0x2f64ca(_0x4e6ee9);});});}exports[_0xc392('0x15')]=function(_0x3c6895){var _0x351f57=this;return new Promise(function(_0x28d196,_0x4b1390){return db[_0xc392('0x16')][_0xc392('0x17')]({'raw':_0x3c6895[_0xc392('0x18')]?_0x3c6895['options'][_0xc392('0x19')]===undefined?!![]:![]:!![],'where':_0x3c6895[_0xc392('0x18')]?_0x3c6895['options'][_0xc392('0x1a')]||null:null,'attributes':_0x3c6895['options']?_0x3c6895[_0xc392('0x18')][_0xc392('0x1b')]||null:null,'limit':_0x3c6895['options']?_0x3c6895[_0xc392('0x18')][_0xc392('0x1c')]||null:null,'include':_0x3c6895[_0xc392('0x18')]?_0x3c6895[_0xc392('0x18')][_0xc392('0x1d')]?_['map'](_0x3c6895[_0xc392('0x18')][_0xc392('0x1d')],function(_0x253368){return{'model':db[_0x253368[_0xc392('0x1e')]],'as':_0x253368['as'],'attributes':_0x253368[_0xc392('0x1b')],'include':_0x253368[_0xc392('0x1d')]?_[_0xc392('0x1f')](_0x253368[_0xc392('0x1d')],function(_0xa6cf4d){return{'model':db[_0xa6cf4d[_0xc392('0x1e')]],'as':_0xa6cf4d['as'],'attributes':_0xa6cf4d[_0xc392('0x1b')],'include':_0xa6cf4d[_0xc392('0x1d')]?_[_0xc392('0x1f')](_0xa6cf4d[_0xc392('0x1d')],function(_0x10389d){return{'model':db[_0x10389d[_0xc392('0x1e')]],'as':_0x10389d['as'],'attributes':_0x10389d[_0xc392('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102ed3){logger['info']('GetSalesforceAccount',_0x3c6895);logger['debug'](_0xc392('0x15'),_0x3c6895,JSON['stringify'](_0x102ed3));_0x28d196(_0x102ed3);})['catch'](function(_0x4d9dbf){logger[_0xc392('0x10')](_0xc392('0x15'),_0x4d9dbf[_0xc392('0x12')],_0x3c6895);_0x4b1390(_0x351f57['error'](0x1f4,_0x4d9dbf[_0xc392('0x12')]));});});};exports[_0xc392('0x20')]=function(_0x31a9ee){var _0x1ba39f=this;return new Promise(function(_0x4d474c,_0x337a69){return db['SalesforceAccount'][_0xc392('0x21')]({'raw':_0x31a9ee[_0xc392('0x18')]?_0x31a9ee[_0xc392('0x18')][_0xc392('0x19')]===undefined?!![]:![]:!![],'where':_0x31a9ee[_0xc392('0x18')]?_0x31a9ee[_0xc392('0x18')][_0xc392('0x1a')]||null:null,'attributes':_0x31a9ee[_0xc392('0x18')]?_0x31a9ee[_0xc392('0x18')]['attributes']||null:null,'include':_0x31a9ee['options']?_0x31a9ee['options']['include']?_[_0xc392('0x1f')](_0x31a9ee[_0xc392('0x18')][_0xc392('0x1d')],function(_0x5c8ca9){return{'model':db[_0x5c8ca9['model']],'as':_0x5c8ca9['as'],'attributes':_0x5c8ca9[_0xc392('0x1b')],'include':_0x5c8ca9['include']?_[_0xc392('0x1f')](_0x5c8ca9['include'],function(_0x3ee2d0){return{'model':db[_0x3ee2d0[_0xc392('0x1e')]],'as':_0x3ee2d0['as'],'attributes':_0x3ee2d0[_0xc392('0x1b')],'include':_0x3ee2d0[_0xc392('0x1d')]?_[_0xc392('0x1f')](_0x3ee2d0[_0xc392('0x1d')],function(_0x1131d0){return{'model':db[_0x1131d0[_0xc392('0x1e')]],'as':_0x1131d0['as'],'attributes':_0x1131d0[_0xc392('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc392('0xb')](function(_0x312c4e){logger[_0xc392('0xc')](_0xc392('0x20'),_0x31a9ee);logger[_0xc392('0x22')](_0xc392('0x20'),_0x31a9ee,JSON['stringify'](_0x312c4e));_0x4d474c(_0x312c4e);})['catch'](function(_0x3367af){logger['error'](_0xc392('0x20'),_0x3367af[_0xc392('0x12')],_0x31a9ee);_0x337a69(_0x1ba39f[_0xc392('0x10')](0x1f4,_0x3367af[_0xc392('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 311fb4f..1de7db1 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 _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x1792cf,_0x30143a){var _0x2e490c=function(_0x42ce34){while(--_0x42ce34){_0x1792cf['push'](_0x1792cf['shift']());}};_0x2e490c(++_0x30143a);}(_0x2ef3,0xba));var _0x32ef=function(_0x5a1bc0,_0x8422a5){_0x5a1bc0=_0x5a1bc0-0x0;var _0x3baf67=_0x2ef3[_0x5a1bc0];return _0x3baf67;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +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(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x0b0e,0x187));var _0xe0b0=function(_0x139b63,_0x389ca8){_0x139b63=_0x139b63-0x0;var _0x2493f2=_0x0b0e[_0x139b63];return _0x2493f2;};'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 de38818..33ee6be 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 _0xc35f=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xc35f,0x82));var _0xfc35=function(_0xcc4c6b,_0x403f00){_0xcc4c6b=_0xcc4c6b-0x0;var _0x409805=_0xc35f[_0xcc4c6b];return _0x409805;};'use strict';var Sequelize=require(_0xfc35('0x0'));module[_0xfc35('0x1')]={'name':{'type':Sequelize[_0xfc35('0x2')]},'description':{'type':Sequelize[_0xfc35('0x2')]},'ticketType':{'type':Sequelize[_0xfc35('0x3')](_0xfc35('0x4'),_0xfc35('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xfc35('0x3')](_0xfc35('0x6'),_0xfc35('0x7'),_0xfc35('0x8'),'account_contact_lead',_0xfc35('0x9')),'defaultValue':_0xfc35('0x6')},'moduleCreate':{'type':Sequelize[_0xfc35('0x3')](_0xfc35('0xa'),_0xfc35('0x7'),_0xfc35('0x8'),'account'),'defaultValue':_0xfc35('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xfc35('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xfc35('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xfc35('0x2')]}}; \ No newline at end of file +var _0xf4e6=['nothing','contact','sequelize','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account'];(function(_0x5144e6,_0x561398){var _0x5c1472=function(_0x507424){while(--_0x507424){_0x5144e6['push'](_0x5144e6['shift']());}};_0x5c1472(++_0x561398);}(_0xf4e6,0xa7));var _0x6f4e=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xf4e6[_0x5dc03e];return _0x466a07;};'use strict';var Sequelize=require(_0x6f4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f4e('0x1')]},'description':{'type':Sequelize[_0x6f4e('0x1')]},'ticketType':{'type':Sequelize[_0x6f4e('0x2')](_0x6f4e('0x3'),_0x6f4e('0x4')),'defaultValue':_0x6f4e('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x6f4e('0x5'),'contact',_0x6f4e('0x6'),_0x6f4e('0x7'),_0x6f4e('0x8')),'defaultValue':_0x6f4e('0x5')},'moduleCreate':{'type':Sequelize[_0x6f4e('0x2')](_0x6f4e('0x9'),_0x6f4e('0xa'),_0x6f4e('0x6'),_0x6f4e('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x6f4e('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6f4e('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x6f4e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 39b6fc8..dd3015b 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 _0xc8c0=['include','findAll','rows','catch','show','params','create','body','find','destroy','findOne','SalesforceField','getFields','getSubjects','nolimit','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x1c8c07,_0x2579af){var _0x4aa88f=function(_0x2ad13d){while(--_0x2ad13d){_0x1c8c07['push'](_0x1c8c07['shift']());}};_0x4aa88f(++_0x2579af);}(_0xc8c0,0x100));var _0x0c8c=function(_0x9c71e8,_0x30db09){_0x9c71e8=_0x9c71e8-0x0;var _0x5c6004=_0xc8c0[_0x9c71e8];return _0x5c6004;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c8c('0x0'));var jsonpatch=require(_0x0c8c('0x1'));var rp=require(_0x0c8c('0x2'));var moment=require(_0x0c8c('0x3'));var BPromise=require(_0x0c8c('0x4'));var Mustache=require(_0x0c8c('0x5'));var util=require('util');var path=require(_0x0c8c('0x6'));var sox=require(_0x0c8c('0x7'));var csv=require(_0x0c8c('0x8'));var ejs=require(_0x0c8c('0x9'));var fs=require('fs');var fs_extra=require(_0x0c8c('0xa'));var _=require('lodash');var squel=require(_0x0c8c('0xb'));var crypto=require(_0x0c8c('0xc'));var jsforce=require(_0x0c8c('0xd'));var deskjs=require(_0x0c8c('0xe'));var toCsv=require(_0x0c8c('0x8'));var querystring=require('querystring');var Papa=require(_0x0c8c('0xf'));var Redis=require(_0x0c8c('0x10'));var authService=require(_0x0c8c('0x11'));var qs=require(_0x0c8c('0x12'));var as=require(_0x0c8c('0x13'));var hardwareService=require(_0x0c8c('0x14'));var logger=require('../../config/logger')(_0x0c8c('0x15'));var utils=require(_0x0c8c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0c8c('0x17'));var db=require(_0x0c8c('0x18'))['db'];function respondWithStatusCode(_0x8b06b7,_0x363b92){_0x363b92=_0x363b92||0xcc;return function(_0x45608f){if(_0x45608f){return _0x8b06b7[_0x0c8c('0x19')](_0x363b92);}return _0x8b06b7[_0x0c8c('0x1a')](_0x363b92)[_0x0c8c('0x1b')]();};}function respondWithResult(_0x10fc84,_0x94f387){_0x94f387=_0x94f387||0xc8;return function(_0x18572a){if(_0x18572a){return _0x10fc84[_0x0c8c('0x1a')](_0x94f387)[_0x0c8c('0x1c')](_0x18572a);}};}function respondWithFilteredResult(_0x46eb4d,_0x3d591a){return function(_0x53179b){if(_0x53179b){var _0x262f25=typeof _0x3d591a[_0x0c8c('0x1d')]==='undefined'&&typeof _0x3d591a[_0x0c8c('0x1e')]===_0x0c8c('0x1f');var _0xac89a8=_0x53179b[_0x0c8c('0x20')];var _0x4c289a=_0x262f25?0x0:_0x3d591a[_0x0c8c('0x1d')];var _0xa98821=_0x262f25?_0x53179b[_0x0c8c('0x20')]:_0x3d591a[_0x0c8c('0x1d')]+_0x3d591a['limit'];var _0xaea9a1;if(_0xa98821>=_0xac89a8){_0xa98821=_0xac89a8;_0xaea9a1=0xc8;}else{_0xaea9a1=0xce;}_0x46eb4d[_0x0c8c('0x1a')](_0xaea9a1);return _0x46eb4d[_0x0c8c('0x21')]('Content-Range',_0x4c289a+'-'+_0xa98821+'/'+_0xac89a8)['json'](_0x53179b);}return null;};}function patchUpdates(_0x5231a2){return function(_0xcd20e5){try{jsonpatch[_0x0c8c('0x22')](_0xcd20e5,_0x5231a2,!![]);}catch(_0xf9f2a4){return BPromise[_0x0c8c('0x23')](_0xf9f2a4);}return _0xcd20e5['save']();};}function saveUpdates(_0x4f0a91,_0xd50e86){return function(_0x2429a8){if(_0x2429a8){return _0x2429a8[_0x0c8c('0x24')](_0x4f0a91)[_0x0c8c('0x25')](function(_0x5b8ccc){return _0x5b8ccc;});}return null;};}function removeEntity(_0x2bef0c,_0x2cc8de){return function(_0x230830){if(_0x230830){return _0x230830['destroy']()[_0x0c8c('0x25')](function(){_0x2bef0c[_0x0c8c('0x1a')](0xcc)[_0x0c8c('0x1b')]();});}};}function handleEntityNotFound(_0x43861a,_0xff36d6){return function(_0x129ef3){if(!_0x129ef3){_0x43861a[_0x0c8c('0x19')](0x194);}return _0x129ef3;};}function handleError(_0x223263,_0xf90c02){_0xf90c02=_0xf90c02||0x1f4;return function(_0x1cf81c){logger['error'](_0x1cf81c[_0x0c8c('0x26')]);if(_0x1cf81c[_0x0c8c('0x27')]){delete _0x1cf81c[_0x0c8c('0x27')];}_0x223263['status'](_0xf90c02)[_0x0c8c('0x28')](_0x1cf81c);};}exports['index']=function(_0x266ae5,_0x445edd){var _0x360ec9={},_0x36d3cf={},_0x5ec3a3={'count':0x0,'rows':[]};var _0x51c769=_[_0x0c8c('0x29')](db[_0x0c8c('0x2a')][_0x0c8c('0x2b')],function(_0x39a8e0){return{'name':_0x39a8e0[_0x0c8c('0x2c')],'type':_0x39a8e0[_0x0c8c('0x2d')]['key']};});_0x36d3cf[_0x0c8c('0x2e')]=_['map'](_0x51c769,'name');_0x36d3cf[_0x0c8c('0x2f')]=_[_0x0c8c('0x30')](_0x266ae5[_0x0c8c('0x2f')]);_0x36d3cf[_0x0c8c('0x31')]=_[_0x0c8c('0x32')](_0x36d3cf[_0x0c8c('0x2e')],_0x36d3cf[_0x0c8c('0x2f')]);_0x360ec9[_0x0c8c('0x33')]=_[_0x0c8c('0x32')](_0x36d3cf[_0x0c8c('0x2e')],qs[_0x0c8c('0x34')](_0x266ae5[_0x0c8c('0x2f')]['fields']));_0x360ec9[_0x0c8c('0x33')]=_0x360ec9['attributes'][_0x0c8c('0x35')]?_0x360ec9[_0x0c8c('0x33')]:_0x36d3cf[_0x0c8c('0x2e')];if(!_0x266ae5['query'][_0x0c8c('0x36')]('nolimit')){_0x360ec9[_0x0c8c('0x1e')]=qs[_0x0c8c('0x1e')](_0x266ae5[_0x0c8c('0x2f')][_0x0c8c('0x1e')]);_0x360ec9[_0x0c8c('0x1d')]=qs['offset'](_0x266ae5['query'][_0x0c8c('0x1d')]);}_0x360ec9[_0x0c8c('0x37')]=qs[_0x0c8c('0x38')](_0x266ae5[_0x0c8c('0x2f')][_0x0c8c('0x38')]);_0x360ec9[_0x0c8c('0x39')]=qs[_0x0c8c('0x31')](_[_0x0c8c('0x3a')](_0x266ae5[_0x0c8c('0x2f')],_0x36d3cf[_0x0c8c('0x31')]),_0x51c769);if(_0x266ae5[_0x0c8c('0x2f')]['filter']){_0x360ec9[_0x0c8c('0x39')]=_[_0x0c8c('0x3b')](_0x360ec9[_0x0c8c('0x39')],{'$or':_['map'](_0x51c769,function(_0x33a261){if(_0x33a261[_0x0c8c('0x2d')]!==_0x0c8c('0x3c')){var _0x5ad775={};_0x5ad775[_0x33a261[_0x0c8c('0x27')]]={'$like':'%'+_0x266ae5[_0x0c8c('0x2f')][_0x0c8c('0x3d')]+'%'};return _0x5ad775;}})});}_0x360ec9=_['merge']({},_0x360ec9,_0x266ae5[_0x0c8c('0x3e')]);var _0x266cfa={'where':_0x360ec9[_0x0c8c('0x39')]};return db[_0x0c8c('0x2a')]['count'](_0x266cfa)[_0x0c8c('0x25')](function(_0xeec002){_0x5ec3a3['count']=_0xeec002;if(_0x266ae5[_0x0c8c('0x2f')][_0x0c8c('0x3f')]){_0x360ec9[_0x0c8c('0x40')]=[{'all':!![]}];}return db[_0x0c8c('0x2a')][_0x0c8c('0x41')](_0x360ec9);})[_0x0c8c('0x25')](function(_0x2d87a1){_0x5ec3a3[_0x0c8c('0x42')]=_0x2d87a1;return _0x5ec3a3;})['then'](respondWithFilteredResult(_0x445edd,_0x360ec9))[_0x0c8c('0x43')](handleError(_0x445edd,null));};exports[_0x0c8c('0x44')]=function(_0x57cf3b,_0x3884be){var _0x3f9748={'raw':![],'where':{'id':_0x57cf3b[_0x0c8c('0x45')]['id']}},_0x23e602={};_0x23e602[_0x0c8c('0x2e')]=_[_0x0c8c('0x30')](db[_0x0c8c('0x2a')][_0x0c8c('0x2b')]);_0x23e602['query']=_[_0x0c8c('0x30')](_0x57cf3b[_0x0c8c('0x2f')]);_0x23e602[_0x0c8c('0x31')]=_['intersection'](_0x23e602[_0x0c8c('0x2e')],_0x23e602[_0x0c8c('0x2f')]);_0x3f9748[_0x0c8c('0x33')]=_[_0x0c8c('0x32')](_0x23e602[_0x0c8c('0x2e')],qs[_0x0c8c('0x34')](_0x57cf3b[_0x0c8c('0x2f')][_0x0c8c('0x34')]));_0x3f9748[_0x0c8c('0x33')]=_0x3f9748[_0x0c8c('0x33')][_0x0c8c('0x35')]?_0x3f9748['attributes']:_0x23e602[_0x0c8c('0x2e')];if(_0x57cf3b[_0x0c8c('0x2f')]['includeAll']){_0x3f9748[_0x0c8c('0x40')]=[{'all':!![]}];}_0x3f9748=_['merge']({},_0x3f9748,_0x57cf3b[_0x0c8c('0x3e')]);return db['SalesforceConfiguration']['find'](_0x3f9748)[_0x0c8c('0x25')](handleEntityNotFound(_0x3884be,null))[_0x0c8c('0x25')](respondWithResult(_0x3884be,null))[_0x0c8c('0x43')](handleError(_0x3884be,null));};exports['create']=function(_0x36353c,_0x43305b){return db[_0x0c8c('0x2a')][_0x0c8c('0x46')](_0x36353c['body'],{})[_0x0c8c('0x25')](respondWithResult(_0x43305b,0xc9))[_0x0c8c('0x43')](handleError(_0x43305b,null));};exports[_0x0c8c('0x24')]=function(_0x43df0b,_0x21bbcf){if(_0x43df0b[_0x0c8c('0x47')]['id']){delete _0x43df0b[_0x0c8c('0x47')]['id'];}return db[_0x0c8c('0x2a')][_0x0c8c('0x48')]({'where':{'id':_0x43df0b[_0x0c8c('0x45')]['id']}})[_0x0c8c('0x25')](handleEntityNotFound(_0x21bbcf,null))[_0x0c8c('0x25')](saveUpdates(_0x43df0b[_0x0c8c('0x47')],null))['then'](respondWithResult(_0x21bbcf,null))[_0x0c8c('0x43')](handleError(_0x21bbcf,null));};exports[_0x0c8c('0x49')]=function(_0x2a2553,_0x4c649a){return db['SalesforceConfiguration'][_0x0c8c('0x48')]({'where':{'id':_0x2a2553[_0x0c8c('0x45')]['id']}})[_0x0c8c('0x25')](handleEntityNotFound(_0x4c649a,null))[_0x0c8c('0x25')](removeEntity(_0x4c649a,null))['catch'](handleError(_0x4c649a,null));};exports['getFields']=function(_0x2c741e,_0x3aba4e,_0x1c4217){var _0x16c7e2={};var _0x5431be={};var _0x5ab7c0;var _0x374f80;return db[_0x0c8c('0x2a')][_0x0c8c('0x4a')]({'where':{'id':_0x2c741e['params']['id']}})[_0x0c8c('0x25')](handleEntityNotFound(_0x3aba4e,null))[_0x0c8c('0x25')](function(_0x1416c2){if(_0x1416c2){_0x5ab7c0=_0x1416c2;_0x5431be[_0x0c8c('0x2e')]=_[_0x0c8c('0x30')](db[_0x0c8c('0x4b')][_0x0c8c('0x2b')]);_0x5431be[_0x0c8c('0x2f')]=_[_0x0c8c('0x30')](_0x2c741e[_0x0c8c('0x2f')]);_0x5431be[_0x0c8c('0x31')]=_['intersection'](_0x5431be[_0x0c8c('0x2e')],_0x5431be[_0x0c8c('0x2f')]);_0x16c7e2[_0x0c8c('0x33')]=_[_0x0c8c('0x32')](_0x5431be['model'],qs[_0x0c8c('0x34')](_0x2c741e[_0x0c8c('0x2f')]['fields']));_0x16c7e2[_0x0c8c('0x33')]=_0x16c7e2[_0x0c8c('0x33')][_0x0c8c('0x35')]?_0x16c7e2['attributes']:_0x5431be[_0x0c8c('0x2e')];_0x16c7e2['order']=qs[_0x0c8c('0x38')](_0x2c741e[_0x0c8c('0x2f')]['sort']);_0x16c7e2['where']=qs[_0x0c8c('0x31')](_[_0x0c8c('0x3a')](_0x2c741e[_0x0c8c('0x2f')],_0x5431be[_0x0c8c('0x31')]));if(_0x2c741e[_0x0c8c('0x2f')]['filter']){_0x16c7e2[_0x0c8c('0x39')]=_[_0x0c8c('0x3b')](_0x16c7e2['where'],{'$or':_['map'](_0x16c7e2[_0x0c8c('0x33')],function(_0xa8f996){var _0x4edc0d={};_0x4edc0d[_0xa8f996]={'$like':'%'+_0x2c741e[_0x0c8c('0x2f')][_0x0c8c('0x3d')]+'%'};return _0x4edc0d;})});}_0x16c7e2=_[_0x0c8c('0x3b')]({},_0x16c7e2,_0x2c741e['options']);return _0x5ab7c0[_0x0c8c('0x4c')](_0x16c7e2);}})[_0x0c8c('0x25')](function(_0x4976fb){if(_0x4976fb){_0x374f80=_0x4976fb['length'];if(!_0x2c741e[_0x0c8c('0x2f')]['hasOwnProperty']('nolimit')){_0x16c7e2[_0x0c8c('0x1e')]=qs[_0x0c8c('0x1e')](_0x2c741e[_0x0c8c('0x2f')]['limit']);_0x16c7e2['offset']=qs['offset'](_0x2c741e[_0x0c8c('0x2f')][_0x0c8c('0x1d')]);}return _0x5ab7c0[_0x0c8c('0x4c')](_0x16c7e2);}})[_0x0c8c('0x25')](function(_0x41dc7d){if(_0x41dc7d){return _0x41dc7d?{'count':_0x374f80,'rows':_0x41dc7d}:null;}})[_0x0c8c('0x25')](respondWithResult(_0x3aba4e,null))['catch'](handleError(_0x3aba4e,null));};exports[_0x0c8c('0x4d')]=function(_0x196073,_0x32ae81,_0x42882f){var _0x2609a4={};var _0x5a764b={};var _0x163bd2;var _0x3838a7;return db['SalesforceConfiguration'][_0x0c8c('0x4a')]({'where':{'id':_0x196073[_0x0c8c('0x45')]['id']}})['then'](handleEntityNotFound(_0x32ae81,null))[_0x0c8c('0x25')](function(_0x585acd){if(_0x585acd){_0x163bd2=_0x585acd;_0x5a764b[_0x0c8c('0x2e')]=_['keys'](db[_0x0c8c('0x4b')][_0x0c8c('0x2b')]);_0x5a764b[_0x0c8c('0x2f')]=_[_0x0c8c('0x30')](_0x196073[_0x0c8c('0x2f')]);_0x5a764b['filters']=_[_0x0c8c('0x32')](_0x5a764b['model'],_0x5a764b[_0x0c8c('0x2f')]);_0x2609a4[_0x0c8c('0x33')]=_[_0x0c8c('0x32')](_0x5a764b[_0x0c8c('0x2e')],qs[_0x0c8c('0x34')](_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x34')]));_0x2609a4[_0x0c8c('0x33')]=_0x2609a4[_0x0c8c('0x33')][_0x0c8c('0x35')]?_0x2609a4[_0x0c8c('0x33')]:_0x5a764b[_0x0c8c('0x2e')];_0x2609a4[_0x0c8c('0x37')]=qs[_0x0c8c('0x38')](_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x38')]);_0x2609a4[_0x0c8c('0x39')]=qs[_0x0c8c('0x31')](_['pick'](_0x196073['query'],_0x5a764b[_0x0c8c('0x31')]));if(_0x196073[_0x0c8c('0x2f')]['filter']){_0x2609a4[_0x0c8c('0x39')]=_['merge'](_0x2609a4['where'],{'$or':_[_0x0c8c('0x29')](_0x2609a4['attributes'],function(_0x41bf2a){var _0x2cd55d={};_0x2cd55d[_0x41bf2a]={'$like':'%'+_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x3d')]+'%'};return _0x2cd55d;})});}_0x2609a4=_['merge']({},_0x2609a4,_0x196073[_0x0c8c('0x3e')]);return _0x163bd2[_0x0c8c('0x4d')](_0x2609a4);}})[_0x0c8c('0x25')](function(_0x50eea5){if(_0x50eea5){_0x3838a7=_0x50eea5['length'];if(!_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x36')](_0x0c8c('0x4e'))){_0x2609a4[_0x0c8c('0x1e')]=qs[_0x0c8c('0x1e')](_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x1e')]);_0x2609a4[_0x0c8c('0x1d')]=qs[_0x0c8c('0x1d')](_0x196073[_0x0c8c('0x2f')][_0x0c8c('0x1d')]);}return _0x163bd2[_0x0c8c('0x4d')](_0x2609a4);}})[_0x0c8c('0x25')](function(_0x26422a){if(_0x26422a){return _0x26422a?{'count':_0x3838a7,'rows':_0x26422a}:null;}})[_0x0c8c('0x25')](respondWithResult(_0x32ae81,null))[_0x0c8c('0x43')](handleError(_0x32ae81,null));};exports[_0x0c8c('0x4f')]=function(_0x2fcd70,_0x904fb9,_0x4560d3){var _0x448583={};var _0x507980={};var _0x11467e;var _0x2ea2b6;return db[_0x0c8c('0x2a')][_0x0c8c('0x4a')]({'where':{'id':_0x2fcd70[_0x0c8c('0x45')]['id']}})[_0x0c8c('0x25')](handleEntityNotFound(_0x904fb9,null))['then'](function(_0x231a41){if(_0x231a41){_0x11467e=_0x231a41;_0x507980[_0x0c8c('0x2e')]=_[_0x0c8c('0x30')](db['SalesforceField'][_0x0c8c('0x2b')]);_0x507980[_0x0c8c('0x2f')]=_['keys'](_0x2fcd70['query']);_0x507980[_0x0c8c('0x31')]=_[_0x0c8c('0x32')](_0x507980[_0x0c8c('0x2e')],_0x507980[_0x0c8c('0x2f')]);_0x448583[_0x0c8c('0x33')]=_[_0x0c8c('0x32')](_0x507980['model'],qs[_0x0c8c('0x34')](_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x34')]));_0x448583[_0x0c8c('0x33')]=_0x448583[_0x0c8c('0x33')][_0x0c8c('0x35')]?_0x448583[_0x0c8c('0x33')]:_0x507980[_0x0c8c('0x2e')];_0x448583[_0x0c8c('0x37')]=qs[_0x0c8c('0x38')](_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x38')]);_0x448583[_0x0c8c('0x39')]=qs[_0x0c8c('0x31')](_[_0x0c8c('0x3a')](_0x2fcd70[_0x0c8c('0x2f')],_0x507980[_0x0c8c('0x31')]));if(_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x3d')]){_0x448583[_0x0c8c('0x39')]=_[_0x0c8c('0x3b')](_0x448583[_0x0c8c('0x39')],{'$or':_[_0x0c8c('0x29')](_0x448583[_0x0c8c('0x33')],function(_0x5bf1f3){var _0x4e1b2d={};_0x4e1b2d[_0x5bf1f3]={'$like':'%'+_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x3d')]+'%'};return _0x4e1b2d;})});}_0x448583=_['merge']({},_0x448583,_0x2fcd70[_0x0c8c('0x3e')]);return _0x11467e[_0x0c8c('0x4f')](_0x448583);}})['then'](function(_0x3dfe00){if(_0x3dfe00){_0x2ea2b6=_0x3dfe00[_0x0c8c('0x35')];if(!_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x36')](_0x0c8c('0x4e'))){_0x448583[_0x0c8c('0x1e')]=qs[_0x0c8c('0x1e')](_0x2fcd70['query']['limit']);_0x448583['offset']=qs[_0x0c8c('0x1d')](_0x2fcd70[_0x0c8c('0x2f')][_0x0c8c('0x1d')]);}return _0x11467e['getDescriptions'](_0x448583);}})[_0x0c8c('0x25')](function(_0xf84a37){if(_0xf84a37){return _0xf84a37?{'count':_0x2ea2b6,'rows':_0xf84a37}:null;}})[_0x0c8c('0x25')](respondWithResult(_0x904fb9,null))[_0x0c8c('0x43')](handleError(_0x904fb9,null));}; \ No newline at end of file +var _0xb338=['find','create','body','catch','getFields','findOne','SalesforceField','sort','pick','getSubjects','getDescriptions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','then','end','error','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','length','nolimit','query','order','where','merge','filter','options','SalesforceConfiguration','includeAll','include','findAll','rows','params'];(function(_0x623c35,_0x3bf04b){var _0x40c468=function(_0x4aec0e){while(--_0x4aec0e){_0x623c35['push'](_0x623c35['shift']());}};_0x40c468(++_0x3bf04b);}(_0xb338,0x130));var _0x8b33=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0xb338[_0x533528];return _0x3189f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b33('0x0'));var zipdir=require(_0x8b33('0x1'));var jsonpatch=require(_0x8b33('0x2'));var rp=require(_0x8b33('0x3'));var moment=require('moment');var BPromise=require(_0x8b33('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8b33('0x5'));var sox=require(_0x8b33('0x6'));var csv=require(_0x8b33('0x7'));var ejs=require(_0x8b33('0x8'));var fs=require('fs');var fs_extra=require(_0x8b33('0x9'));var _=require(_0x8b33('0xa'));var squel=require(_0x8b33('0xb'));var crypto=require(_0x8b33('0xc'));var jsforce=require(_0x8b33('0xd'));var deskjs=require(_0x8b33('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b33('0xf'));var qs=require(_0x8b33('0x10'));var as=require(_0x8b33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b33('0x12'))(_0x8b33('0x13'));var utils=require('../../config/utils');var config=require(_0x8b33('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b33('0x15'))['db'];function respondWithStatusCode(_0x1e1538,_0x459397){_0x459397=_0x459397||0xcc;return function(_0x2c7040){if(_0x2c7040){return _0x1e1538[_0x8b33('0x16')](_0x459397);}return _0x1e1538[_0x8b33('0x17')](_0x459397)['end']();};}function respondWithResult(_0x21e0a5,_0x5dfe5e){_0x5dfe5e=_0x5dfe5e||0xc8;return function(_0x2f0c34){if(_0x2f0c34){return _0x21e0a5['status'](_0x5dfe5e)[_0x8b33('0x18')](_0x2f0c34);}};}function respondWithFilteredResult(_0x569d91,_0x18557f){return function(_0x2f6e2d){if(_0x2f6e2d){var _0x1ac263=typeof _0x18557f[_0x8b33('0x19')]==='undefined'&&typeof _0x18557f[_0x8b33('0x1a')]===_0x8b33('0x1b');var _0x4b4a61=_0x2f6e2d[_0x8b33('0x1c')];var _0x366581=_0x1ac263?0x0:_0x18557f[_0x8b33('0x19')];var _0x288273=_0x1ac263?_0x2f6e2d['count']:_0x18557f['offset']+_0x18557f[_0x8b33('0x1a')];var _0x3c4905;if(_0x288273>=_0x4b4a61){_0x288273=_0x4b4a61;_0x3c4905=0xc8;}else{_0x3c4905=0xce;}_0x569d91[_0x8b33('0x17')](_0x3c4905);return _0x569d91['set'](_0x8b33('0x1d'),_0x366581+'-'+_0x288273+'/'+_0x4b4a61)[_0x8b33('0x18')](_0x2f6e2d);}return null;};}function patchUpdates(_0x513989){return function(_0x598801){try{jsonpatch['apply'](_0x598801,_0x513989,!![]);}catch(_0x526dce){return BPromise[_0x8b33('0x1e')](_0x526dce);}return _0x598801['save']();};}function saveUpdates(_0x256a0c,_0x1fd150){return function(_0x43af80){if(_0x43af80){return _0x43af80['update'](_0x256a0c)[_0x8b33('0x1f')](function(_0x2385f4){return _0x2385f4;});}return null;};}function removeEntity(_0x41b5e1,_0x31ac86){return function(_0x18b892){if(_0x18b892){return _0x18b892['destroy']()[_0x8b33('0x1f')](function(){_0x41b5e1[_0x8b33('0x17')](0xcc)[_0x8b33('0x20')]();});}};}function handleEntityNotFound(_0x33935c,_0x1a36cb){return function(_0x31268c){if(!_0x31268c){_0x33935c[_0x8b33('0x16')](0x194);}return _0x31268c;};}function handleError(_0x554ca6,_0x3a15c2){_0x3a15c2=_0x3a15c2||0x1f4;return function(_0x79ab08){logger[_0x8b33('0x21')](_0x79ab08['stack']);if(_0x79ab08[_0x8b33('0x22')]){delete _0x79ab08['name'];}_0x554ca6['status'](_0x3a15c2)[_0x8b33('0x23')](_0x79ab08);};}exports[_0x8b33('0x24')]=function(_0x520c16,_0x3e0388){var _0x31539b={},_0x58c4f4={},_0x5950cf={'count':0x0,'rows':[]};var _0x118225=_[_0x8b33('0x25')](db['SalesforceConfiguration'][_0x8b33('0x26')],function(_0x420f45){return{'name':_0x420f45['fieldName'],'type':_0x420f45[_0x8b33('0x27')][_0x8b33('0x28')]};});_0x58c4f4[_0x8b33('0x29')]=_[_0x8b33('0x25')](_0x118225,_0x8b33('0x22'));_0x58c4f4['query']=_[_0x8b33('0x2a')](_0x520c16['query']);_0x58c4f4[_0x8b33('0x2b')]=_[_0x8b33('0x2c')](_0x58c4f4[_0x8b33('0x29')],_0x58c4f4['query']);_0x31539b[_0x8b33('0x2d')]=_[_0x8b33('0x2c')](_0x58c4f4[_0x8b33('0x29')],qs[_0x8b33('0x2e')](_0x520c16['query']['fields']));_0x31539b[_0x8b33('0x2d')]=_0x31539b['attributes'][_0x8b33('0x2f')]?_0x31539b[_0x8b33('0x2d')]:_0x58c4f4[_0x8b33('0x29')];if(!_0x520c16['query']['hasOwnProperty'](_0x8b33('0x30'))){_0x31539b[_0x8b33('0x1a')]=qs[_0x8b33('0x1a')](_0x520c16[_0x8b33('0x31')][_0x8b33('0x1a')]);_0x31539b['offset']=qs[_0x8b33('0x19')](_0x520c16[_0x8b33('0x31')][_0x8b33('0x19')]);}_0x31539b[_0x8b33('0x32')]=qs['sort'](_0x520c16[_0x8b33('0x31')]['sort']);_0x31539b[_0x8b33('0x33')]=qs[_0x8b33('0x2b')](_['pick'](_0x520c16[_0x8b33('0x31')],_0x58c4f4[_0x8b33('0x2b')]),_0x118225);if(_0x520c16[_0x8b33('0x31')]['filter']){_0x31539b[_0x8b33('0x33')]=_[_0x8b33('0x34')](_0x31539b[_0x8b33('0x33')],{'$or':_[_0x8b33('0x25')](_0x118225,function(_0x22bea7){if(_0x22bea7['type']!=='VIRTUAL'){var _0x6e4afb={};_0x6e4afb[_0x22bea7[_0x8b33('0x22')]]={'$like':'%'+_0x520c16[_0x8b33('0x31')][_0x8b33('0x35')]+'%'};return _0x6e4afb;}})});}_0x31539b=_[_0x8b33('0x34')]({},_0x31539b,_0x520c16[_0x8b33('0x36')]);var _0x4b050f={'where':_0x31539b[_0x8b33('0x33')]};return db[_0x8b33('0x37')][_0x8b33('0x1c')](_0x4b050f)[_0x8b33('0x1f')](function(_0x22f883){_0x5950cf[_0x8b33('0x1c')]=_0x22f883;if(_0x520c16[_0x8b33('0x31')][_0x8b33('0x38')]){_0x31539b[_0x8b33('0x39')]=[{'all':!![]}];}return db[_0x8b33('0x37')][_0x8b33('0x3a')](_0x31539b);})[_0x8b33('0x1f')](function(_0x26809b){_0x5950cf[_0x8b33('0x3b')]=_0x26809b;return _0x5950cf;})[_0x8b33('0x1f')](respondWithFilteredResult(_0x3e0388,_0x31539b))['catch'](handleError(_0x3e0388,null));};exports['show']=function(_0x2a2a68,_0x3ce07c){var _0x163e64={'raw':![],'where':{'id':_0x2a2a68[_0x8b33('0x3c')]['id']}},_0x5c3a2a={};_0x5c3a2a[_0x8b33('0x29')]=_[_0x8b33('0x2a')](db[_0x8b33('0x37')]['rawAttributes']);_0x5c3a2a[_0x8b33('0x31')]=_[_0x8b33('0x2a')](_0x2a2a68[_0x8b33('0x31')]);_0x5c3a2a['filters']=_[_0x8b33('0x2c')](_0x5c3a2a['model'],_0x5c3a2a[_0x8b33('0x31')]);_0x163e64[_0x8b33('0x2d')]=_[_0x8b33('0x2c')](_0x5c3a2a[_0x8b33('0x29')],qs[_0x8b33('0x2e')](_0x2a2a68[_0x8b33('0x31')][_0x8b33('0x2e')]));_0x163e64[_0x8b33('0x2d')]=_0x163e64['attributes'][_0x8b33('0x2f')]?_0x163e64[_0x8b33('0x2d')]:_0x5c3a2a[_0x8b33('0x29')];if(_0x2a2a68[_0x8b33('0x31')][_0x8b33('0x38')]){_0x163e64[_0x8b33('0x39')]=[{'all':!![]}];}_0x163e64=_['merge']({},_0x163e64,_0x2a2a68[_0x8b33('0x36')]);return db['SalesforceConfiguration'][_0x8b33('0x3d')](_0x163e64)[_0x8b33('0x1f')](handleEntityNotFound(_0x3ce07c,null))[_0x8b33('0x1f')](respondWithResult(_0x3ce07c,null))['catch'](handleError(_0x3ce07c,null));};exports[_0x8b33('0x3e')]=function(_0x305ca0,_0x221ef1){return db[_0x8b33('0x37')][_0x8b33('0x3e')](_0x305ca0[_0x8b33('0x3f')],{})[_0x8b33('0x1f')](respondWithResult(_0x221ef1,0xc9))[_0x8b33('0x40')](handleError(_0x221ef1,null));};exports['update']=function(_0x188ec8,_0x5e96b6){if(_0x188ec8[_0x8b33('0x3f')]['id']){delete _0x188ec8[_0x8b33('0x3f')]['id'];}return db['SalesforceConfiguration'][_0x8b33('0x3d')]({'where':{'id':_0x188ec8[_0x8b33('0x3c')]['id']}})[_0x8b33('0x1f')](handleEntityNotFound(_0x5e96b6,null))[_0x8b33('0x1f')](saveUpdates(_0x188ec8['body'],null))['then'](respondWithResult(_0x5e96b6,null))[_0x8b33('0x40')](handleError(_0x5e96b6,null));};exports['destroy']=function(_0x43beb9,_0x44ab0a){return db[_0x8b33('0x37')]['find']({'where':{'id':_0x43beb9[_0x8b33('0x3c')]['id']}})['then'](handleEntityNotFound(_0x44ab0a,null))[_0x8b33('0x1f')](removeEntity(_0x44ab0a,null))[_0x8b33('0x40')](handleError(_0x44ab0a,null));};exports[_0x8b33('0x41')]=function(_0x5fa9bf,_0x2cb569,_0x580ab6){var _0x104a1e={};var _0x1ed47c={};var _0x4a877a;var _0x4c0ef2;return db['SalesforceConfiguration'][_0x8b33('0x42')]({'where':{'id':_0x5fa9bf['params']['id']}})[_0x8b33('0x1f')](handleEntityNotFound(_0x2cb569,null))[_0x8b33('0x1f')](function(_0x5b50dc){if(_0x5b50dc){_0x4a877a=_0x5b50dc;_0x1ed47c[_0x8b33('0x29')]=_[_0x8b33('0x2a')](db[_0x8b33('0x43')]['rawAttributes']);_0x1ed47c['query']=_[_0x8b33('0x2a')](_0x5fa9bf[_0x8b33('0x31')]);_0x1ed47c[_0x8b33('0x2b')]=_[_0x8b33('0x2c')](_0x1ed47c[_0x8b33('0x29')],_0x1ed47c[_0x8b33('0x31')]);_0x104a1e[_0x8b33('0x2d')]=_[_0x8b33('0x2c')](_0x1ed47c[_0x8b33('0x29')],qs[_0x8b33('0x2e')](_0x5fa9bf[_0x8b33('0x31')]['fields']));_0x104a1e['attributes']=_0x104a1e[_0x8b33('0x2d')][_0x8b33('0x2f')]?_0x104a1e[_0x8b33('0x2d')]:_0x1ed47c[_0x8b33('0x29')];_0x104a1e['order']=qs[_0x8b33('0x44')](_0x5fa9bf['query']['sort']);_0x104a1e[_0x8b33('0x33')]=qs['filters'](_[_0x8b33('0x45')](_0x5fa9bf[_0x8b33('0x31')],_0x1ed47c[_0x8b33('0x2b')]));if(_0x5fa9bf[_0x8b33('0x31')]['filter']){_0x104a1e[_0x8b33('0x33')]=_[_0x8b33('0x34')](_0x104a1e[_0x8b33('0x33')],{'$or':_[_0x8b33('0x25')](_0x104a1e[_0x8b33('0x2d')],function(_0x4b9928){var _0x1146d7={};_0x1146d7[_0x4b9928]={'$like':'%'+_0x5fa9bf['query'][_0x8b33('0x35')]+'%'};return _0x1146d7;})});}_0x104a1e=_[_0x8b33('0x34')]({},_0x104a1e,_0x5fa9bf[_0x8b33('0x36')]);return _0x4a877a['getFields'](_0x104a1e);}})[_0x8b33('0x1f')](function(_0x537994){if(_0x537994){_0x4c0ef2=_0x537994[_0x8b33('0x2f')];if(!_0x5fa9bf['query']['hasOwnProperty'](_0x8b33('0x30'))){_0x104a1e['limit']=qs[_0x8b33('0x1a')](_0x5fa9bf['query']['limit']);_0x104a1e[_0x8b33('0x19')]=qs['offset'](_0x5fa9bf['query'][_0x8b33('0x19')]);}return _0x4a877a[_0x8b33('0x41')](_0x104a1e);}})[_0x8b33('0x1f')](function(_0x2b7f89){if(_0x2b7f89){return _0x2b7f89?{'count':_0x4c0ef2,'rows':_0x2b7f89}:null;}})[_0x8b33('0x1f')](respondWithResult(_0x2cb569,null))[_0x8b33('0x40')](handleError(_0x2cb569,null));};exports[_0x8b33('0x46')]=function(_0x40c115,_0xc90c4e,_0x3156fb){var _0x795341={};var _0x3e5748={};var _0x5ac665;var _0x199c51;return db[_0x8b33('0x37')]['findOne']({'where':{'id':_0x40c115['params']['id']}})[_0x8b33('0x1f')](handleEntityNotFound(_0xc90c4e,null))[_0x8b33('0x1f')](function(_0x1df56e){if(_0x1df56e){_0x5ac665=_0x1df56e;_0x3e5748[_0x8b33('0x29')]=_['keys'](db[_0x8b33('0x43')][_0x8b33('0x26')]);_0x3e5748[_0x8b33('0x31')]=_[_0x8b33('0x2a')](_0x40c115['query']);_0x3e5748[_0x8b33('0x2b')]=_[_0x8b33('0x2c')](_0x3e5748[_0x8b33('0x29')],_0x3e5748['query']);_0x795341[_0x8b33('0x2d')]=_[_0x8b33('0x2c')](_0x3e5748[_0x8b33('0x29')],qs[_0x8b33('0x2e')](_0x40c115['query'][_0x8b33('0x2e')]));_0x795341[_0x8b33('0x2d')]=_0x795341[_0x8b33('0x2d')][_0x8b33('0x2f')]?_0x795341[_0x8b33('0x2d')]:_0x3e5748[_0x8b33('0x29')];_0x795341['order']=qs[_0x8b33('0x44')](_0x40c115[_0x8b33('0x31')]['sort']);_0x795341['where']=qs[_0x8b33('0x2b')](_[_0x8b33('0x45')](_0x40c115[_0x8b33('0x31')],_0x3e5748[_0x8b33('0x2b')]));if(_0x40c115[_0x8b33('0x31')][_0x8b33('0x35')]){_0x795341[_0x8b33('0x33')]=_[_0x8b33('0x34')](_0x795341[_0x8b33('0x33')],{'$or':_['map'](_0x795341['attributes'],function(_0xd19d69){var _0x5232a5={};_0x5232a5[_0xd19d69]={'$like':'%'+_0x40c115[_0x8b33('0x31')]['filter']+'%'};return _0x5232a5;})});}_0x795341=_[_0x8b33('0x34')]({},_0x795341,_0x40c115['options']);return _0x5ac665[_0x8b33('0x46')](_0x795341);}})['then'](function(_0x22af69){if(_0x22af69){_0x199c51=_0x22af69[_0x8b33('0x2f')];if(!_0x40c115[_0x8b33('0x31')]['hasOwnProperty'](_0x8b33('0x30'))){_0x795341[_0x8b33('0x1a')]=qs['limit'](_0x40c115[_0x8b33('0x31')][_0x8b33('0x1a')]);_0x795341[_0x8b33('0x19')]=qs[_0x8b33('0x19')](_0x40c115['query'][_0x8b33('0x19')]);}return _0x5ac665[_0x8b33('0x46')](_0x795341);}})[_0x8b33('0x1f')](function(_0x19e763){if(_0x19e763){return _0x19e763?{'count':_0x199c51,'rows':_0x19e763}:null;}})[_0x8b33('0x1f')](respondWithResult(_0xc90c4e,null))[_0x8b33('0x40')](handleError(_0xc90c4e,null));};exports['getDescriptions']=function(_0x26c019,_0x29317c,_0x546a08){var _0xb16e4f={};var _0x19c93c={};var _0x1761f9;var _0x112333;return db[_0x8b33('0x37')]['findOne']({'where':{'id':_0x26c019['params']['id']}})[_0x8b33('0x1f')](handleEntityNotFound(_0x29317c,null))[_0x8b33('0x1f')](function(_0x39f4d6){if(_0x39f4d6){_0x1761f9=_0x39f4d6;_0x19c93c[_0x8b33('0x29')]=_[_0x8b33('0x2a')](db[_0x8b33('0x43')]['rawAttributes']);_0x19c93c[_0x8b33('0x31')]=_[_0x8b33('0x2a')](_0x26c019[_0x8b33('0x31')]);_0x19c93c['filters']=_[_0x8b33('0x2c')](_0x19c93c[_0x8b33('0x29')],_0x19c93c[_0x8b33('0x31')]);_0xb16e4f[_0x8b33('0x2d')]=_[_0x8b33('0x2c')](_0x19c93c[_0x8b33('0x29')],qs[_0x8b33('0x2e')](_0x26c019['query'][_0x8b33('0x2e')]));_0xb16e4f[_0x8b33('0x2d')]=_0xb16e4f[_0x8b33('0x2d')][_0x8b33('0x2f')]?_0xb16e4f[_0x8b33('0x2d')]:_0x19c93c['model'];_0xb16e4f[_0x8b33('0x32')]=qs['sort'](_0x26c019[_0x8b33('0x31')][_0x8b33('0x44')]);_0xb16e4f['where']=qs[_0x8b33('0x2b')](_['pick'](_0x26c019[_0x8b33('0x31')],_0x19c93c['filters']));if(_0x26c019[_0x8b33('0x31')][_0x8b33('0x35')]){_0xb16e4f[_0x8b33('0x33')]=_[_0x8b33('0x34')](_0xb16e4f[_0x8b33('0x33')],{'$or':_[_0x8b33('0x25')](_0xb16e4f[_0x8b33('0x2d')],function(_0x777bc3){var _0x5729e8={};_0x5729e8[_0x777bc3]={'$like':'%'+_0x26c019[_0x8b33('0x31')][_0x8b33('0x35')]+'%'};return _0x5729e8;})});}_0xb16e4f=_[_0x8b33('0x34')]({},_0xb16e4f,_0x26c019['options']);return _0x1761f9[_0x8b33('0x47')](_0xb16e4f);}})[_0x8b33('0x1f')](function(_0x4c1b0a){if(_0x4c1b0a){_0x112333=_0x4c1b0a['length'];if(!_0x26c019['query'][_0x8b33('0x48')](_0x8b33('0x30'))){_0xb16e4f[_0x8b33('0x1a')]=qs[_0x8b33('0x1a')](_0x26c019[_0x8b33('0x31')][_0x8b33('0x1a')]);_0xb16e4f[_0x8b33('0x19')]=qs['offset'](_0x26c019[_0x8b33('0x31')]['offset']);}return _0x1761f9[_0x8b33('0x47')](_0xb16e4f);}})[_0x8b33('0x1f')](function(_0x5b13c8){if(_0x5b13c8){return _0x5b13c8?{'count':_0x112333,'rows':_0x5b13c8}:null;}})[_0x8b33('0x1f')](respondWithResult(_0x29317c,null))[_0x8b33('0x40')](handleError(_0x29317c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6a19bdd..fb6e5c1 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 _0x347b=['exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x13ec89,_0x1cc1ba){var _0x969623=function(_0x1451eb){while(--_0x1451eb){_0x13ec89['push'](_0x13ec89['shift']());}};_0x969623(++_0x1cc1ba);}(_0x347b,0x9f));var _0xb347=function(_0x529a72,_0x3a841b){_0x529a72=_0x529a72-0x0;var _0x5f0d01=_0x347b[_0x529a72];return _0x5f0d01;};'use strict';var _=require(_0xb347('0x0'));var util=require(_0xb347('0x1'));var logger=require(_0xb347('0x2'))(_0xb347('0x3'));var moment=require('moment');var BPromise=require(_0xb347('0x4'));var rp=require(_0xb347('0x5'));var fs=require('fs');var path=require(_0xb347('0x6'));var rimraf=require(_0xb347('0x7'));var config=require(_0xb347('0x8'));var attributes=require(_0xb347('0x9'));module[_0xb347('0xa')]=function(_0x2938fa,_0xd9cbf6){return _0x2938fa[_0xb347('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0xb347('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x120c=['bluebird','request-promise','path','rimraf','define','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x120c,0x180));var _0xc120=function(_0x2d6e18,_0x34ef7e){_0x2d6e18=_0x2d6e18-0x0;var _0x39bd86=_0x120c[_0x2d6e18];return _0x39bd86;};'use strict';var _=require(_0xc120('0x0'));var util=require(_0xc120('0x1'));var logger=require(_0xc120('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc120('0x3'));var rp=require(_0xc120('0x4'));var fs=require('fs');var path=require(_0xc120('0x5'));var rimraf=require(_0xc120('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x278984,_0x4f02fb){return _0x278984[_0xc120('0x7')]('SalesforceConfiguration',attributes,{'tableName':_0xc120('0x8'),'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 e80c07a..75817b8 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 _0xa3cd=['message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5c14d0,_0x545572){var _0x24fef4=function(_0x220c94){while(--_0x220c94){_0x5c14d0['push'](_0x5c14d0['shift']());}};_0x24fef4(++_0x545572);}(_0xa3cd,0x1ce));var _0xda3c=function(_0x4b8f7b,_0x1c757b){_0x4b8f7b=_0x4b8f7b-0x0;var _0x4439fd=_0xa3cd[_0x4b8f7b];return _0x4439fd;};'use strict';var _=require(_0xda3c('0x0'));var util=require('util');var moment=require(_0xda3c('0x1'));var BPromise=require(_0xda3c('0x2'));var rs=require(_0xda3c('0x3'));var fs=require('fs');var Redis=require(_0xda3c('0x4'));var db=require(_0xda3c('0x5'))['db'];var utils=require(_0xda3c('0x6'));var logger=require(_0xda3c('0x7'))(_0xda3c('0x8'));var config=require(_0xda3c('0x9'));var jayson=require(_0xda3c('0xa'));var client=jayson[_0xda3c('0xb')][_0xda3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x480a52,_0x1d989a,_0x363bb){return new BPromise(function(_0x66407b,_0x1ee41e){return client[_0xda3c('0xd')](_0x480a52,_0x363bb)[_0xda3c('0xe')](function(_0x509eee){logger[_0xda3c('0xf')](_0xda3c('0x10'),_0x1d989a,_0xda3c('0x11'));logger[_0xda3c('0x12')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x1d989a,'request\x20sent',JSON[_0xda3c('0x13')](_0x509eee));if(_0x509eee[_0xda3c('0x14')]){if(_0x509eee['error']['code']===0x1f4){logger[_0xda3c('0x14')](_0xda3c('0x10'),_0x1d989a,_0x509eee[_0xda3c('0x14')][_0xda3c('0x15')]);return _0x1ee41e(_0x509eee[_0xda3c('0x14')][_0xda3c('0x15')]);}logger['error'](_0xda3c('0x10'),_0x1d989a,_0x509eee[_0xda3c('0x14')]['message']);return _0x66407b(_0x509eee[_0xda3c('0x14')][_0xda3c('0x15')]);}else{logger[_0xda3c('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1d989a,_0xda3c('0x11'));_0x66407b(_0x509eee[_0xda3c('0x16')]['message']);}})['catch'](function(_0x1198cd){logger[_0xda3c('0x14')](_0xda3c('0x10'),_0x1d989a,_0x1198cd);_0x1ee41e(_0x1198cd);});});} \ No newline at end of file +var _0x901d=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x173f79,_0x3b2224){var _0x59ce8c=function(_0x4f317a){while(--_0x4f317a){_0x173f79['push'](_0x173f79['shift']());}};_0x59ce8c(++_0x3b2224);}(_0x901d,0x137));var _0xd901=function(_0x539dd0,_0x5635eb){_0x539dd0=_0x539dd0-0x0;var _0x2ce500=_0x901d[_0x539dd0];return _0x2ce500;};'use strict';var _=require(_0xd901('0x0'));var util=require(_0xd901('0x1'));var moment=require(_0xd901('0x2'));var BPromise=require(_0xd901('0x3'));var rs=require(_0xd901('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd901('0x5'))['db'];var utils=require(_0xd901('0x6'));var logger=require(_0xd901('0x7'))(_0xd901('0x8'));var config=require(_0xd901('0x9'));var jayson=require(_0xd901('0xa'));var client=jayson[_0xd901('0xb')][_0xd901('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fd953,_0x110079,_0x59aff8){return new BPromise(function(_0x16304f,_0x917322){return client[_0xd901('0xd')](_0x2fd953,_0x59aff8)[_0xd901('0xe')](function(_0x362a34){logger[_0xd901('0xf')](_0xd901('0x10'),_0x110079,_0xd901('0x11'));logger[_0xd901('0x12')](_0xd901('0x13'),_0x110079,'request\x20sent',JSON['stringify'](_0x362a34));if(_0x362a34[_0xd901('0x14')]){if(_0x362a34['error'][_0xd901('0x15')]===0x1f4){logger[_0xd901('0x14')](_0xd901('0x10'),_0x110079,_0x362a34['error']['message']);return _0x917322(_0x362a34[_0xd901('0x14')]['message']);}logger[_0xd901('0x14')](_0xd901('0x10'),_0x110079,_0x362a34[_0xd901('0x14')][_0xd901('0x16')]);return _0x16304f(_0x362a34[_0xd901('0x14')][_0xd901('0x16')]);}else{logger[_0xd901('0xf')](_0xd901('0x10'),_0x110079,'request\x20sent');_0x16304f(_0x362a34[_0xd901('0x17')][_0xd901('0x16')]);}})['catch'](function(_0x5f3975){logger[_0xd901('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x110079,_0x5f3975);_0x917322(_0x5f3975);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index b24a08a..2838770 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 _0x0d1a=['delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x446a96,_0x4330bd){var _0x4aa4e1=function(_0x49326c){while(--_0x49326c){_0x446a96['push'](_0x446a96['shift']());}};_0x4aa4e1(++_0x4330bd);}(_0x0d1a,0x1b3));var _0xa0d1=function(_0x5c40bc,_0x2a121f){_0x5c40bc=_0x5c40bc-0x0;var _0x3b73d5=_0x0d1a[_0x5c40bc];return _0x3b73d5;};'use strict';var multer=require(_0xa0d1('0x0'));var util=require(_0xa0d1('0x1'));var path=require('path');var timeout=require(_0xa0d1('0x2'));var express=require(_0xa0d1('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(_0xa0d1('0x4'));var controller=require('./intSalesforceField.controller');router[_0xa0d1('0x5')]('/',auth[_0xa0d1('0x6')](),controller[_0xa0d1('0x7')]);router[_0xa0d1('0x5')](_0xa0d1('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xa0d1('0x9')]('/',auth[_0xa0d1('0x6')](),controller[_0xa0d1('0xa')]);router[_0xa0d1('0xb')]('/:id',auth[_0xa0d1('0x6')](),controller[_0xa0d1('0xc')]);router[_0xa0d1('0xd')]('/:id',auth[_0xa0d1('0x6')](),controller[_0xa0d1('0xe')]);module[_0xa0d1('0xf')]=router; \ No newline at end of file +var _0x3636=['destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','put','delete'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x3636,0x86));var _0x6363=function(_0x57acd0,_0x5c8d9f){_0x57acd0=_0x57acd0-0x0;var _0x2f1515=_0x3636[_0x57acd0];return _0x2f1515;};'use strict';var multer=require(_0x6363('0x0'));var util=require('util');var path=require(_0x6363('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6363('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6363('0x3'));var interaction=require(_0x6363('0x4'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x6363('0x5')]('/',auth[_0x6363('0x6')](),controller['index']);router[_0x6363('0x5')](_0x6363('0x7'),auth[_0x6363('0x6')](),controller['show']);router['post']('/',auth[_0x6363('0x6')](),controller['create']);router[_0x6363('0x8')](_0x6363('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x6363('0x9')](_0x6363('0x7'),auth[_0x6363('0x6')](),controller[_0x6363('0xa')]);module[_0x6363('0xb')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 6b283ad..93782d3 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 _0xf000=['string','variable','STRING','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xf000,0x1a3));var _0x0f00=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0xf000[_0x258fb0];return _0x4d1afe;};'use strict';var Sequelize=require(_0x0f00('0x0'));module['exports']={'type':{'type':Sequelize[_0x0f00('0x1')]('string','variable',_0x0f00('0x2'),_0x0f00('0x3'),_0x0f00('0x4')),'defaultValue':_0x0f00('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f00('0x1')](_0x0f00('0x5'),_0x0f00('0x6'),_0x0f00('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0f00('0x7')]},'variableName':{'type':Sequelize[_0x0f00('0x7')]}}; \ No newline at end of file +var _0x9406=['sequelize','exports','ENUM','string','keyValue','STRING','variable','customVariable'];(function(_0x1e6031,_0x50b48f){var _0xb6f5ce=function(_0x2cca85){while(--_0x2cca85){_0x1e6031['push'](_0x1e6031['shift']());}};_0xb6f5ce(++_0x50b48f);}(_0x9406,0xe0));var _0x6940=function(_0x1ba062,_0x5a1f40){_0x1ba062=_0x1ba062-0x0;var _0x226f84=_0x9406[_0x1ba062];return _0x226f84;};'use strict';var Sequelize=require(_0x6940('0x0'));module[_0x6940('0x1')]={'type':{'type':Sequelize[_0x6940('0x2')](_0x6940('0x3'),'variable','customVariable',_0x6940('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x6940('0x5')]},'key':{'type':Sequelize[_0x6940('0x5')]},'keyType':{'type':Sequelize[_0x6940('0x2')](_0x6940('0x3'),_0x6940('0x6'),_0x6940('0x7'))},'keyContent':{'type':Sequelize[_0x6940('0x5')]},'idField':{'type':Sequelize[_0x6940('0x5')]},'variableName':{'type':Sequelize[_0x6940('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index e73ce55..d8f5fab 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 _0x16db=['nolimit','sort','merge','options','then','include','findAll','rows','catch','params','length','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x16db,0x126));var _0xb16d=function(_0x33deaf,_0x5c43b5){_0x33deaf=_0x33deaf-0x0;var _0x3f1076=_0x16db[_0x33deaf];return _0x3f1076;};'use strict';var emlformat=require(_0xb16d('0x0'));var rimraf=require(_0xb16d('0x1'));var zipdir=require(_0xb16d('0x2'));var jsonpatch=require(_0xb16d('0x3'));var rp=require(_0xb16d('0x4'));var moment=require(_0xb16d('0x5'));var BPromise=require(_0xb16d('0x6'));var Mustache=require(_0xb16d('0x7'));var util=require(_0xb16d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb16d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb16d('0xa'));var _=require(_0xb16d('0xb'));var squel=require('squel');var crypto=require(_0xb16d('0xc'));var jsforce=require(_0xb16d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb16d('0x9'));var querystring=require(_0xb16d('0xe'));var Papa=require(_0xb16d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb16d('0x10'));var as=require(_0xb16d('0x11'));var hardwareService=require(_0xb16d('0x12'));var logger=require(_0xb16d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb16d('0x14'));var licenseUtil=require(_0xb16d('0x15'));var db=require(_0xb16d('0x16'))['db'];function respondWithStatusCode(_0x53d078,_0x16e418){_0x16e418=_0x16e418||0xcc;return function(_0x513cd3){if(_0x513cd3){return _0x53d078[_0xb16d('0x17')](_0x16e418);}return _0x53d078[_0xb16d('0x18')](_0x16e418)[_0xb16d('0x19')]();};}function respondWithResult(_0x4be0a9,_0x50a28d){_0x50a28d=_0x50a28d||0xc8;return function(_0x237597){if(_0x237597){return _0x4be0a9[_0xb16d('0x18')](_0x50a28d)[_0xb16d('0x1a')](_0x237597);}};}function respondWithFilteredResult(_0x538c31,_0x16315){return function(_0x399fc1){if(_0x399fc1){var _0x2b787d=typeof _0x16315[_0xb16d('0x1b')]===_0xb16d('0x1c')&&typeof _0x16315[_0xb16d('0x1d')]===_0xb16d('0x1c');var _0x681657=_0x399fc1[_0xb16d('0x1e')];var _0x5963f5=_0x2b787d?0x0:_0x16315[_0xb16d('0x1b')];var _0xe39d6f=_0x2b787d?_0x399fc1[_0xb16d('0x1e')]:_0x16315[_0xb16d('0x1b')]+_0x16315[_0xb16d('0x1d')];var _0x2561f6;if(_0xe39d6f>=_0x681657){_0xe39d6f=_0x681657;_0x2561f6=0xc8;}else{_0x2561f6=0xce;}_0x538c31[_0xb16d('0x18')](_0x2561f6);return _0x538c31[_0xb16d('0x1f')](_0xb16d('0x20'),_0x5963f5+'-'+_0xe39d6f+'/'+_0x681657)[_0xb16d('0x1a')](_0x399fc1);}return null;};}function patchUpdates(_0x1ccb1b){return function(_0x3cc9f8){try{jsonpatch[_0xb16d('0x21')](_0x3cc9f8,_0x1ccb1b,!![]);}catch(_0x39ce98){return BPromise[_0xb16d('0x22')](_0x39ce98);}return _0x3cc9f8[_0xb16d('0x23')]();};}function saveUpdates(_0x41533b,_0x5d5894){return function(_0x5d60c9){if(_0x5d60c9){return _0x5d60c9[_0xb16d('0x24')](_0x41533b)['then'](function(_0x2b731f){return _0x2b731f;});}return null;};}function removeEntity(_0x5e2fb1,_0x26402e){return function(_0x7bf03c){if(_0x7bf03c){return _0x7bf03c['destroy']()['then'](function(){_0x5e2fb1[_0xb16d('0x18')](0xcc)[_0xb16d('0x19')]();});}};}function handleEntityNotFound(_0xef8da3,_0x3e82ce){return function(_0x56c3b7){if(!_0x56c3b7){_0xef8da3[_0xb16d('0x17')](0x194);}return _0x56c3b7;};}function handleError(_0x1a74d0,_0x37bb0b){_0x37bb0b=_0x37bb0b||0x1f4;return function(_0x492f10){logger[_0xb16d('0x25')](_0x492f10[_0xb16d('0x26')]);if(_0x492f10[_0xb16d('0x27')]){delete _0x492f10[_0xb16d('0x27')];}_0x1a74d0[_0xb16d('0x18')](_0x37bb0b)[_0xb16d('0x28')](_0x492f10);};}exports[_0xb16d('0x29')]=function(_0x2c6779,_0xba8283){var _0x92dd8={},_0x5f3629={},_0x11e26b={'count':0x0,'rows':[]};var _0x1bf9d6=_[_0xb16d('0x2a')](db[_0xb16d('0x2b')][_0xb16d('0x2c')],function(_0x116cab){return{'name':_0x116cab[_0xb16d('0x2d')],'type':_0x116cab[_0xb16d('0x2e')][_0xb16d('0x2f')]};});_0x5f3629[_0xb16d('0x30')]=_[_0xb16d('0x2a')](_0x1bf9d6,_0xb16d('0x27'));_0x5f3629['query']=_[_0xb16d('0x31')](_0x2c6779['query']);_0x5f3629[_0xb16d('0x32')]=_[_0xb16d('0x33')](_0x5f3629[_0xb16d('0x30')],_0x5f3629['query']);_0x92dd8[_0xb16d('0x34')]=_[_0xb16d('0x33')](_0x5f3629[_0xb16d('0x30')],qs[_0xb16d('0x35')](_0x2c6779[_0xb16d('0x36')][_0xb16d('0x35')]));_0x92dd8[_0xb16d('0x34')]=_0x92dd8[_0xb16d('0x34')]['length']?_0x92dd8['attributes']:_0x5f3629['model'];if(!_0x2c6779[_0xb16d('0x36')][_0xb16d('0x37')](_0xb16d('0x38'))){_0x92dd8[_0xb16d('0x1d')]=qs[_0xb16d('0x1d')](_0x2c6779[_0xb16d('0x36')][_0xb16d('0x1d')]);_0x92dd8[_0xb16d('0x1b')]=qs[_0xb16d('0x1b')](_0x2c6779[_0xb16d('0x36')][_0xb16d('0x1b')]);}_0x92dd8['order']=qs['sort'](_0x2c6779[_0xb16d('0x36')][_0xb16d('0x39')]);_0x92dd8['where']=qs[_0xb16d('0x32')](_['pick'](_0x2c6779[_0xb16d('0x36')],_0x5f3629[_0xb16d('0x32')]),_0x1bf9d6);if(_0x2c6779[_0xb16d('0x36')]['filter']){_0x92dd8['where']=_[_0xb16d('0x3a')](_0x92dd8['where'],{'$or':_[_0xb16d('0x2a')](_0x1bf9d6,function(_0x430578){if(_0x430578[_0xb16d('0x2e')]!=='VIRTUAL'){var _0xf5f9e3={};_0xf5f9e3[_0x430578[_0xb16d('0x27')]]={'$like':'%'+_0x2c6779[_0xb16d('0x36')]['filter']+'%'};return _0xf5f9e3;}})});}_0x92dd8=_[_0xb16d('0x3a')]({},_0x92dd8,_0x2c6779[_0xb16d('0x3b')]);var _0x1ec175={'where':_0x92dd8['where']};return db[_0xb16d('0x2b')][_0xb16d('0x1e')](_0x1ec175)[_0xb16d('0x3c')](function(_0xa0593a){_0x11e26b[_0xb16d('0x1e')]=_0xa0593a;if(_0x2c6779[_0xb16d('0x36')]['includeAll']){_0x92dd8[_0xb16d('0x3d')]=[{'all':!![]}];}return db[_0xb16d('0x2b')][_0xb16d('0x3e')](_0x92dd8);})['then'](function(_0x23f831){_0x11e26b[_0xb16d('0x3f')]=_0x23f831;return _0x11e26b;})[_0xb16d('0x3c')](respondWithFilteredResult(_0xba8283,_0x92dd8))[_0xb16d('0x40')](handleError(_0xba8283,null));};exports['show']=function(_0x3e3f9d,_0x20bab4){var _0x5a76b8={'raw':!![],'where':{'id':_0x3e3f9d[_0xb16d('0x41')]['id']}},_0x1a6123={};_0x1a6123[_0xb16d('0x30')]=_['keys'](db[_0xb16d('0x2b')][_0xb16d('0x2c')]);_0x1a6123['query']=_[_0xb16d('0x31')](_0x3e3f9d[_0xb16d('0x36')]);_0x1a6123[_0xb16d('0x32')]=_['intersection'](_0x1a6123['model'],_0x1a6123['query']);_0x5a76b8[_0xb16d('0x34')]=_['intersection'](_0x1a6123[_0xb16d('0x30')],qs[_0xb16d('0x35')](_0x3e3f9d[_0xb16d('0x36')][_0xb16d('0x35')]));_0x5a76b8[_0xb16d('0x34')]=_0x5a76b8[_0xb16d('0x34')][_0xb16d('0x42')]?_0x5a76b8[_0xb16d('0x34')]:_0x1a6123[_0xb16d('0x30')];if(_0x3e3f9d[_0xb16d('0x36')]['includeAll']){_0x5a76b8[_0xb16d('0x3d')]=[{'all':!![]}];}_0x5a76b8=_[_0xb16d('0x3a')]({},_0x5a76b8,_0x3e3f9d[_0xb16d('0x3b')]);return db[_0xb16d('0x2b')][_0xb16d('0x43')](_0x5a76b8)[_0xb16d('0x3c')](handleEntityNotFound(_0x20bab4,null))[_0xb16d('0x3c')](respondWithResult(_0x20bab4,null))[_0xb16d('0x40')](handleError(_0x20bab4,null));};exports['create']=function(_0xa56bdf,_0x34d3a3){return db[_0xb16d('0x2b')]['create'](_0xa56bdf['body'],{})[_0xb16d('0x3c')](respondWithResult(_0x34d3a3,0xc9))['catch'](handleError(_0x34d3a3,null));};exports[_0xb16d('0x24')]=function(_0x2ad7f9,_0x60ab79){if(_0x2ad7f9['body']['id']){delete _0x2ad7f9[_0xb16d('0x44')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x2ad7f9['params']['id']}})[_0xb16d('0x3c')](handleEntityNotFound(_0x60ab79,null))[_0xb16d('0x3c')](saveUpdates(_0x2ad7f9['body'],null))[_0xb16d('0x3c')](respondWithResult(_0x60ab79,null))[_0xb16d('0x40')](handleError(_0x60ab79,null));};exports[_0xb16d('0x45')]=function(_0x3d03e9,_0xcc54e9){return db[_0xb16d('0x2b')][_0xb16d('0x43')]({'where':{'id':_0x3d03e9[_0xb16d('0x41')]['id']}})['then'](handleEntityNotFound(_0xcc54e9,null))['then'](removeEntity(_0xcc54e9,null))[_0xb16d('0x40')](handleError(_0xcc54e9,null));}; \ No newline at end of file +var _0xd54c=['reject','update','then','name','index','map','SalesforceField','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd54c,0x1c1));var _0xcd54=function(_0xc440b2,_0x54f42d){_0xc440b2=_0xc440b2-0x0;var _0x3ff6b8=_0xd54c[_0xc440b2];return _0x3ff6b8;};'use strict';var emlformat=require(_0xcd54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd54('0x1'));var jsonpatch=require(_0xcd54('0x2'));var rp=require(_0xcd54('0x3'));var moment=require(_0xcd54('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd54('0x5'));var util=require(_0xcd54('0x6'));var path=require(_0xcd54('0x7'));var sox=require('sox');var csv=require(_0xcd54('0x8'));var ejs=require(_0xcd54('0x9'));var fs=require('fs');var fs_extra=require(_0xcd54('0xa'));var _=require(_0xcd54('0xb'));var squel=require(_0xcd54('0xc'));var crypto=require(_0xcd54('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcd54('0xe'));var toCsv=require(_0xcd54('0x8'));var querystring=require('querystring');var Papa=require(_0xcd54('0xf'));var Redis=require(_0xcd54('0x10'));var authService=require(_0xcd54('0x11'));var qs=require(_0xcd54('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd54('0x13'));var logger=require(_0xcd54('0x14'))('api');var utils=require(_0xcd54('0x15'));var config=require(_0xcd54('0x16'));var licenseUtil=require(_0xcd54('0x17'));var db=require(_0xcd54('0x18'))['db'];function respondWithStatusCode(_0x19e90a,_0x2b39d4){_0x2b39d4=_0x2b39d4||0xcc;return function(_0xb00a5c){if(_0xb00a5c){return _0x19e90a[_0xcd54('0x19')](_0x2b39d4);}return _0x19e90a['status'](_0x2b39d4)[_0xcd54('0x1a')]();};}function respondWithResult(_0x3ec75b,_0x1d32bd){_0x1d32bd=_0x1d32bd||0xc8;return function(_0x2605b8){if(_0x2605b8){return _0x3ec75b[_0xcd54('0x1b')](_0x1d32bd)[_0xcd54('0x1c')](_0x2605b8);}};}function respondWithFilteredResult(_0x4c4e02,_0x186c96){return function(_0x45a12f){if(_0x45a12f){var _0x476ed8=typeof _0x186c96[_0xcd54('0x1d')]==='undefined'&&typeof _0x186c96['limit']===_0xcd54('0x1e');var _0x4c332f=_0x45a12f['count'];var _0x31299d=_0x476ed8?0x0:_0x186c96[_0xcd54('0x1d')];var _0x56f245=_0x476ed8?_0x45a12f[_0xcd54('0x1f')]:_0x186c96[_0xcd54('0x1d')]+_0x186c96[_0xcd54('0x20')];var _0x551b3c;if(_0x56f245>=_0x4c332f){_0x56f245=_0x4c332f;_0x551b3c=0xc8;}else{_0x551b3c=0xce;}_0x4c4e02[_0xcd54('0x1b')](_0x551b3c);return _0x4c4e02['set'](_0xcd54('0x21'),_0x31299d+'-'+_0x56f245+'/'+_0x4c332f)[_0xcd54('0x1c')](_0x45a12f);}return null;};}function patchUpdates(_0x5d9e34){return function(_0x15571c){try{jsonpatch['apply'](_0x15571c,_0x5d9e34,!![]);}catch(_0xe2c664){return BPromise[_0xcd54('0x22')](_0xe2c664);}return _0x15571c['save']();};}function saveUpdates(_0x23c7d9,_0x4f6f2e){return function(_0x3fbd6f){if(_0x3fbd6f){return _0x3fbd6f[_0xcd54('0x23')](_0x23c7d9)[_0xcd54('0x24')](function(_0x4563d8){return _0x4563d8;});}return null;};}function removeEntity(_0x5b3a95,_0x26b325){return function(_0x37f33d){if(_0x37f33d){return _0x37f33d['destroy']()[_0xcd54('0x24')](function(){_0x5b3a95[_0xcd54('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bff3b,_0x3968dc){return function(_0x25b309){if(!_0x25b309){_0x3bff3b[_0xcd54('0x19')](0x194);}return _0x25b309;};}function handleError(_0x587ab5,_0x4953a8){_0x4953a8=_0x4953a8||0x1f4;return function(_0x1b8f1b){logger['error'](_0x1b8f1b['stack']);if(_0x1b8f1b['name']){delete _0x1b8f1b[_0xcd54('0x25')];}_0x587ab5[_0xcd54('0x1b')](_0x4953a8)['send'](_0x1b8f1b);};}exports[_0xcd54('0x26')]=function(_0xebf3c3,_0x5d69d8){var _0x35d5cf={},_0x1bef8b={},_0x12c753={'count':0x0,'rows':[]};var _0x159d5b=_[_0xcd54('0x27')](db[_0xcd54('0x28')]['rawAttributes'],function(_0x76076d){return{'name':_0x76076d['fieldName'],'type':_0x76076d[_0xcd54('0x29')][_0xcd54('0x2a')]};});_0x1bef8b[_0xcd54('0x2b')]=_[_0xcd54('0x27')](_0x159d5b,_0xcd54('0x25'));_0x1bef8b[_0xcd54('0x2c')]=_[_0xcd54('0x2d')](_0xebf3c3[_0xcd54('0x2c')]);_0x1bef8b['filters']=_[_0xcd54('0x2e')](_0x1bef8b[_0xcd54('0x2b')],_0x1bef8b[_0xcd54('0x2c')]);_0x35d5cf[_0xcd54('0x2f')]=_['intersection'](_0x1bef8b[_0xcd54('0x2b')],qs[_0xcd54('0x30')](_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x30')]));_0x35d5cf[_0xcd54('0x2f')]=_0x35d5cf[_0xcd54('0x2f')][_0xcd54('0x31')]?_0x35d5cf[_0xcd54('0x2f')]:_0x1bef8b[_0xcd54('0x2b')];if(!_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x32')]('nolimit')){_0x35d5cf[_0xcd54('0x20')]=qs[_0xcd54('0x20')](_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x20')]);_0x35d5cf[_0xcd54('0x1d')]=qs[_0xcd54('0x1d')](_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x1d')]);}_0x35d5cf['order']=qs[_0xcd54('0x33')](_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x33')]);_0x35d5cf[_0xcd54('0x34')]=qs[_0xcd54('0x35')](_['pick'](_0xebf3c3['query'],_0x1bef8b[_0xcd54('0x35')]),_0x159d5b);if(_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x36')]){_0x35d5cf['where']=_[_0xcd54('0x37')](_0x35d5cf[_0xcd54('0x34')],{'$or':_[_0xcd54('0x27')](_0x159d5b,function(_0x2d5e85){if(_0x2d5e85[_0xcd54('0x29')]!=='VIRTUAL'){var _0xe99492={};_0xe99492[_0x2d5e85[_0xcd54('0x25')]]={'$like':'%'+_0xebf3c3['query']['filter']+'%'};return _0xe99492;}})});}_0x35d5cf=_[_0xcd54('0x37')]({},_0x35d5cf,_0xebf3c3['options']);var _0x2982fe={'where':_0x35d5cf[_0xcd54('0x34')]};return db[_0xcd54('0x28')][_0xcd54('0x1f')](_0x2982fe)[_0xcd54('0x24')](function(_0x1f38eb){_0x12c753[_0xcd54('0x1f')]=_0x1f38eb;if(_0xebf3c3[_0xcd54('0x2c')][_0xcd54('0x38')]){_0x35d5cf[_0xcd54('0x39')]=[{'all':!![]}];}return db[_0xcd54('0x28')][_0xcd54('0x3a')](_0x35d5cf);})[_0xcd54('0x24')](function(_0xc6c330){_0x12c753[_0xcd54('0x3b')]=_0xc6c330;return _0x12c753;})['then'](respondWithFilteredResult(_0x5d69d8,_0x35d5cf))[_0xcd54('0x3c')](handleError(_0x5d69d8,null));};exports[_0xcd54('0x3d')]=function(_0x9498e,_0x5d43c9){var _0x372310={'raw':!![],'where':{'id':_0x9498e[_0xcd54('0x3e')]['id']}},_0x13edb4={};_0x13edb4[_0xcd54('0x2b')]=_['keys'](db[_0xcd54('0x28')][_0xcd54('0x3f')]);_0x13edb4[_0xcd54('0x2c')]=_['keys'](_0x9498e[_0xcd54('0x2c')]);_0x13edb4[_0xcd54('0x35')]=_['intersection'](_0x13edb4[_0xcd54('0x2b')],_0x13edb4['query']);_0x372310[_0xcd54('0x2f')]=_[_0xcd54('0x2e')](_0x13edb4[_0xcd54('0x2b')],qs[_0xcd54('0x30')](_0x9498e[_0xcd54('0x2c')]['fields']));_0x372310['attributes']=_0x372310['attributes'][_0xcd54('0x31')]?_0x372310['attributes']:_0x13edb4[_0xcd54('0x2b')];if(_0x9498e[_0xcd54('0x2c')][_0xcd54('0x38')]){_0x372310[_0xcd54('0x39')]=[{'all':!![]}];}_0x372310=_[_0xcd54('0x37')]({},_0x372310,_0x9498e[_0xcd54('0x40')]);return db[_0xcd54('0x28')][_0xcd54('0x41')](_0x372310)[_0xcd54('0x24')](handleEntityNotFound(_0x5d43c9,null))[_0xcd54('0x24')](respondWithResult(_0x5d43c9,null))[_0xcd54('0x3c')](handleError(_0x5d43c9,null));};exports[_0xcd54('0x42')]=function(_0x4eb250,_0x5f3d94){return db['SalesforceField'][_0xcd54('0x42')](_0x4eb250[_0xcd54('0x43')],{})[_0xcd54('0x24')](respondWithResult(_0x5f3d94,0xc9))[_0xcd54('0x3c')](handleError(_0x5f3d94,null));};exports[_0xcd54('0x23')]=function(_0x5d6e2c,_0x304f8a){if(_0x5d6e2c[_0xcd54('0x43')]['id']){delete _0x5d6e2c[_0xcd54('0x43')]['id'];}return db[_0xcd54('0x28')]['find']({'where':{'id':_0x5d6e2c[_0xcd54('0x3e')]['id']}})[_0xcd54('0x24')](handleEntityNotFound(_0x304f8a,null))[_0xcd54('0x24')](saveUpdates(_0x5d6e2c[_0xcd54('0x43')],null))[_0xcd54('0x24')](respondWithResult(_0x304f8a,null))[_0xcd54('0x3c')](handleError(_0x304f8a,null));};exports[_0xcd54('0x44')]=function(_0x1fcb47,_0x285e7d){return db['SalesforceField'][_0xcd54('0x41')]({'where':{'id':_0x1fcb47[_0xcd54('0x3e')]['id']}})[_0xcd54('0x24')](handleEntityNotFound(_0x285e7d,null))[_0xcd54('0x24')](removeEntity(_0x285e7d,null))[_0xcd54('0x3c')](handleError(_0x285e7d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index c687353..9f63d38 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 _0x824d=['rimraf','exports','define','SalesforceField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x824d,0x1f1));var _0xd824=function(_0x447bda,_0x44c248){_0x447bda=_0x447bda-0x0;var _0x247fd6=_0x824d[_0x447bda];return _0x247fd6;};'use strict';var _=require(_0xd824('0x0'));var util=require(_0xd824('0x1'));var logger=require(_0xd824('0x2'))(_0xd824('0x3'));var moment=require(_0xd824('0x4'));var BPromise=require(_0xd824('0x5'));var rp=require(_0xd824('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd824('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xd824('0x8')]=function(_0x48106c,_0xe76f50){return _0x48106c[_0xd824('0x9')](_0xd824('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xd824('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e0=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','int_salesforce_fields','salesforce_unique_index','FieldId'];(function(_0x353730,_0x504fdf){var _0x901b87=function(_0x3adf24){while(--_0x3adf24){_0x353730['push'](_0x353730['shift']());}};_0x901b87(++_0x504fdf);}(_0xd0e0,0xb6));var _0x0d0e=function(_0x13f335,_0x49f649){_0x13f335=_0x13f335-0x0;var _0x1932d5=_0xd0e0[_0x13f335];return _0x1932d5;};'use strict';var _=require(_0x0d0e('0x0'));var util=require('util');var logger=require(_0x0d0e('0x1'))(_0x0d0e('0x2'));var moment=require(_0x0d0e('0x3'));var BPromise=require(_0x0d0e('0x4'));var rp=require(_0x0d0e('0x5'));var fs=require('fs');var path=require(_0x0d0e('0x6'));var rimraf=require(_0x0d0e('0x7'));var config=require(_0x0d0e('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x0d0e('0x9')]=function(_0x56e3c1,_0x319783){return _0x56e3c1['define']('SalesforceField',attributes,{'tableName':_0x0d0e('0xa'),'paranoid':![],'indexes':[{'name':_0x0d0e('0xb'),'fields':['idField',_0x0d0e('0xc')],'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 03cf436..b7ae85a 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 _0x7d49=['info','request\x20sent','debug','error','message','SalesforceField,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x3ed6ee,_0x5cf650){var _0x1a88a0=function(_0x5e1161){while(--_0x5e1161){_0x3ed6ee['push'](_0x3ed6ee['shift']());}};_0x1a88a0(++_0x5cf650);}(_0x7d49,0xcc));var _0x97d4=function(_0x546215,_0x3ad7d6){_0x546215=_0x546215-0x0;var _0x24017c=_0x7d49[_0x546215];return _0x24017c;};'use strict';var _=require(_0x97d4('0x0'));var util=require(_0x97d4('0x1'));var moment=require(_0x97d4('0x2'));var BPromise=require(_0x97d4('0x3'));var rs=require(_0x97d4('0x4'));var fs=require('fs');var Redis=require(_0x97d4('0x5'));var db=require(_0x97d4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x97d4('0x7'))('rpc');var config=require(_0x97d4('0x8'));var jayson=require(_0x97d4('0x9'));var client=jayson['client'][_0x97d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa00c68,_0x48b352,_0x5a1700){return new BPromise(function(_0x25fbca,_0x901f6b){return client['request'](_0xa00c68,_0x5a1700)[_0x97d4('0xb')](function(_0x542073){logger[_0x97d4('0xc')]('SalesforceField,\x20%s,\x20%s',_0x48b352,_0x97d4('0xd'));logger[_0x97d4('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x48b352,_0x97d4('0xd'),JSON['stringify'](_0x542073));if(_0x542073['error']){if(_0x542073[_0x97d4('0xf')]['code']===0x1f4){logger[_0x97d4('0xf')]('SalesforceField,\x20%s,\x20%s',_0x48b352,_0x542073[_0x97d4('0xf')][_0x97d4('0x10')]);return _0x901f6b(_0x542073[_0x97d4('0xf')]['message']);}logger[_0x97d4('0xf')]('SalesforceField,\x20%s,\x20%s',_0x48b352,_0x542073[_0x97d4('0xf')]['message']);return _0x25fbca(_0x542073[_0x97d4('0xf')][_0x97d4('0x10')]);}else{logger[_0x97d4('0xc')](_0x97d4('0x11'),_0x48b352,_0x97d4('0xd'));_0x25fbca(_0x542073['result'][_0x97d4('0x10')]);}})['catch'](function(_0x339359){logger[_0x97d4('0xf')](_0x97d4('0x11'),_0x48b352,_0x339359);_0x901f6b(_0x339359);});});} \ No newline at end of file +var _0xd915=['bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment'];(function(_0x2fd898,_0x216b7d){var _0xaca540=function(_0x9b5359){while(--_0x9b5359){_0x2fd898['push'](_0x2fd898['shift']());}};_0xaca540(++_0x216b7d);}(_0xd915,0x1dd));var _0x5d91=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd915[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5d91('0x0'));var util=require(_0x5d91('0x1'));var moment=require(_0x5d91('0x2'));var BPromise=require(_0x5d91('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d91('0x4'));var db=require(_0x5d91('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d91('0x6'));var config=require(_0x5d91('0x7'));var jayson=require(_0x5d91('0x8'));var client=jayson[_0x5d91('0x9')][_0x5d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x762717,_0x16d7c5,_0x4abb18){return new BPromise(function(_0x61e610,_0xb4c2e5){return client['request'](_0x762717,_0x4abb18)[_0x5d91('0xb')](function(_0x3d0387){logger[_0x5d91('0xc')](_0x5d91('0xd'),_0x16d7c5,_0x5d91('0xe'));logger['debug'](_0x5d91('0xf'),_0x16d7c5,_0x5d91('0xe'),JSON['stringify'](_0x3d0387));if(_0x3d0387['error']){if(_0x3d0387[_0x5d91('0x10')][_0x5d91('0x11')]===0x1f4){logger[_0x5d91('0x10')](_0x5d91('0xd'),_0x16d7c5,_0x3d0387[_0x5d91('0x10')]['message']);return _0xb4c2e5(_0x3d0387[_0x5d91('0x10')][_0x5d91('0x12')]);}logger[_0x5d91('0x10')](_0x5d91('0xd'),_0x16d7c5,_0x3d0387[_0x5d91('0x10')]['message']);return _0x61e610(_0x3d0387[_0x5d91('0x10')][_0x5d91('0x12')]);}else{logger[_0x5d91('0xc')](_0x5d91('0xd'),_0x16d7c5,_0x5d91('0xe'));_0x61e610(_0x3d0387['result'][_0x5d91('0x12')]);}})[_0x5d91('0x13')](function(_0x3f2317){logger[_0x5d91('0x10')]('SalesforceField,\x20%s,\x20%s',_0x16d7c5,_0x3f2317);_0xb4c2e5(_0x3f2317);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 4d8072d..db654b1 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 _0xfecd=['Router','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','getFields','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfecd,0x107));var _0xdfec=function(_0x1a1e57,_0x2cb6fd){_0x1a1e57=_0x1a1e57-0x0;var _0x177217=_0xfecd[_0x1a1e57];return _0x177217;};'use strict';var multer=require(_0xdfec('0x0'));var util=require('util');var path=require(_0xdfec('0x1'));var timeout=require(_0xdfec('0x2'));var express=require('express');var router=express[_0xdfec('0x3')]();var fs_extra=require(_0xdfec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdfec('0x5'));var config=require('../../config/environment');var controller=require(_0xdfec('0x6'));router[_0xdfec('0x7')]('/',auth[_0xdfec('0x8')](),controller['index']);router[_0xdfec('0x7')](_0xdfec('0x9'),auth[_0xdfec('0x8')](),controller[_0xdfec('0xa')]);router[_0xdfec('0x7')]('/:id/configurations',auth[_0xdfec('0x8')](),controller[_0xdfec('0xb')]);router[_0xdfec('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdfec('0xc')]);router[_0xdfec('0xd')]('/',auth['isAuthenticated'](),controller[_0xdfec('0xe')]);router[_0xdfec('0xd')]('/:id/configurations',auth[_0xdfec('0x8')](),controller['addConfiguration']);router[_0xdfec('0xf')](_0xdfec('0x9'),auth[_0xdfec('0x8')](),controller[_0xdfec('0x10')]);router[_0xdfec('0x11')](_0xdfec('0x9'),auth[_0xdfec('0x8')](),controller[_0xdfec('0x12')]);module['exports']=router; \ No newline at end of file +var _0xbc61=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0xa0dd9a,_0xa3fa57){var _0x1a2392=function(_0x54ed42){while(--_0x54ed42){_0xa0dd9a['push'](_0xa0dd9a['shift']());}};_0x1a2392(++_0xa3fa57);}(_0xbc61,0xdc));var _0x1bc6=function(_0x61c691,_0xdaeb1d){_0x61c691=_0x61c691-0x0;var _0x2f3976=_0xbc61[_0x61c691];return _0x2f3976;};'use strict';var multer=require(_0x1bc6('0x0'));var util=require(_0x1bc6('0x1'));var path=require(_0x1bc6('0x2'));var timeout=require(_0x1bc6('0x3'));var express=require(_0x1bc6('0x4'));var router=express[_0x1bc6('0x5')]();var fs_extra=require(_0x1bc6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1bc6('0x7'));var config=require(_0x1bc6('0x8'));var controller=require(_0x1bc6('0x9'));router[_0x1bc6('0xa')]('/',auth[_0x1bc6('0xb')](),controller[_0x1bc6('0xc')]);router[_0x1bc6('0xa')]('/:id',auth[_0x1bc6('0xb')](),controller[_0x1bc6('0xd')]);router['get'](_0x1bc6('0xe'),auth[_0x1bc6('0xb')](),controller[_0x1bc6('0xf')]);router[_0x1bc6('0xa')](_0x1bc6('0x10'),auth['isAuthenticated'](),controller[_0x1bc6('0x11')]);router[_0x1bc6('0x12')]('/',auth['isAuthenticated'](),controller[_0x1bc6('0x13')]);router[_0x1bc6('0x12')](_0x1bc6('0xe'),auth['isAuthenticated'](),controller[_0x1bc6('0x14')]);router[_0x1bc6('0x15')]('/:id',auth[_0x1bc6('0xb')](),controller[_0x1bc6('0x16')]);router[_0x1bc6('0x17')](_0x1bc6('0x18'),auth[_0x1bc6('0xb')](),controller[_0x1bc6('0x19')]);module[_0x1bc6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 2d8e288..ef9774d 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 _0x555c=['exports','STRING','username','remoteUri'];(function(_0x2baea6,_0x17e57f){var _0x5f0913=function(_0x590805){while(--_0x590805){_0x2baea6['push'](_0x2baea6['shift']());}};_0x5f0913(++_0x17e57f);}(_0x555c,0xc4));var _0xc555=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x555c[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require('sequelize');module[_0xc555('0x0')]={'name':{'type':Sequelize[_0xc555('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc555('0x1')],'unique':_0xc555('0x2')},'password':{'type':Sequelize[_0xc555('0x1')]},'email':{'type':Sequelize[_0xc555('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc555('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x777c=['username','remoteUri','STRING'];(function(_0x281062,_0x3eb225){var _0x4becc5=function(_0x37118b){while(--_0x37118b){_0x281062['push'](_0x281062['shift']());}};_0x4becc5(++_0x3eb225);}(_0x777c,0x1c7));var _0xc777=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x777c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc777('0x0')]},'description':{'type':Sequelize[_0xc777('0x0')]},'username':{'type':Sequelize[_0xc777('0x0')],'unique':_0xc777('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc777('0x0')],'unique':_0xc777('0x2')},'serverUrl':{'type':Sequelize[_0xc777('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f3cc2a7..7cfbe5f 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 _0xb3ad=['hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','assigned_to','severity','comments','approval','comments_and_work_notes','sys_mod_count','sys_tags','correlation_id','location','remoteUri','serverUrl','substring','lastIndexOf','format','username','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','error','boolean','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','map','ServicenowAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','ServicenowConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla'];(function(_0x41c513,_0x494765){var _0x34f76b=function(_0x1b46f7){while(--_0x1b46f7){_0x41c513['push'](_0x41c513['shift']());}};_0x34f76b(++_0x494765);}(_0xb3ad,0x1c6));var _0xdb3a=function(_0xfb1d48,_0x22bcaa){_0xfb1d48=_0xfb1d48-0x0;var _0x30cbb2=_0xb3ad[_0xfb1d48];return _0x30cbb2;};'use strict';var emlformat=require(_0xdb3a('0x0'));var rimraf=require(_0xdb3a('0x1'));var zipdir=require(_0xdb3a('0x2'));var jsonpatch=require(_0xdb3a('0x3'));var rp=require(_0xdb3a('0x4'));var moment=require(_0xdb3a('0x5'));var BPromise=require(_0xdb3a('0x6'));var Mustache=require(_0xdb3a('0x7'));var util=require(_0xdb3a('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb3a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb3a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdb3a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb3a('0xc'));var querystring=require(_0xdb3a('0xd'));var Papa=require(_0xdb3a('0xe'));var Redis=require('ioredis');var authService=require(_0xdb3a('0xf'));var qs=require(_0xdb3a('0x10'));var as=require(_0xdb3a('0x11'));var hardwareService=require(_0xdb3a('0x12'));var logger=require(_0xdb3a('0x13'))('api');var utils=require(_0xdb3a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdb3a('0x15'));var db=require(_0xdb3a('0x16'))['db'];var integrations=require(_0xdb3a('0x17'));function respondWithStatusCode(_0x345932,_0x58a3c4){_0x58a3c4=_0x58a3c4||0xcc;return function(_0x3e044d){if(_0x3e044d){return _0x345932[_0xdb3a('0x18')](_0x58a3c4);}return _0x345932[_0xdb3a('0x19')](_0x58a3c4)[_0xdb3a('0x1a')]();};}function respondWithResult(_0x9df218,_0x3b417f){_0x3b417f=_0x3b417f||0xc8;return function(_0x484659){if(_0x484659){return _0x9df218[_0xdb3a('0x19')](_0x3b417f)[_0xdb3a('0x1b')](_0x484659);}};}function respondWithFilteredResult(_0x3c0d8b,_0xb5eb29){return function(_0x580e6d){if(_0x580e6d){var _0x960d96=typeof _0xb5eb29[_0xdb3a('0x1c')]===_0xdb3a('0x1d')&&typeof _0xb5eb29[_0xdb3a('0x1e')]===_0xdb3a('0x1d');var _0x8af4f=_0x580e6d['count'];var _0x1a74fd=_0x960d96?0x0:_0xb5eb29['offset'];var _0x3dd786=_0x960d96?_0x580e6d[_0xdb3a('0x1f')]:_0xb5eb29[_0xdb3a('0x1c')]+_0xb5eb29[_0xdb3a('0x1e')];var _0x2ad74;if(_0x3dd786>=_0x8af4f){_0x3dd786=_0x8af4f;_0x2ad74=0xc8;}else{_0x2ad74=0xce;}_0x3c0d8b[_0xdb3a('0x19')](_0x2ad74);return _0x3c0d8b[_0xdb3a('0x20')]('Content-Range',_0x1a74fd+'-'+_0x3dd786+'/'+_0x8af4f)[_0xdb3a('0x1b')](_0x580e6d);}return null;};}function patchUpdates(_0x453253){return function(_0x4b4782){try{jsonpatch[_0xdb3a('0x21')](_0x4b4782,_0x453253,!![]);}catch(_0x2c3180){return BPromise[_0xdb3a('0x22')](_0x2c3180);}return _0x4b4782[_0xdb3a('0x23')]();};}function saveUpdates(_0x19cb71,_0x34be5e){return function(_0x579b32){if(_0x579b32){return _0x579b32[_0xdb3a('0x24')](_0x19cb71)['then'](function(_0x2815f3){return _0x2815f3;});}return null;};}function removeEntity(_0x5caeed,_0x2aab7e){return function(_0x4fd0e6){if(_0x4fd0e6){return _0x4fd0e6[_0xdb3a('0x25')]()[_0xdb3a('0x26')](function(){_0x5caeed[_0xdb3a('0x19')](0xcc)[_0xdb3a('0x1a')]();});}};}function handleEntityNotFound(_0x556bac,_0x541039){return function(_0x589e9b){if(!_0x589e9b){_0x556bac[_0xdb3a('0x18')](0x194);}return _0x589e9b;};}function handleError(_0x38248e,_0xf641eb){_0xf641eb=_0xf641eb||0x1f4;return function(_0x49f280){logger['error'](_0x49f280[_0xdb3a('0x27')]);if(_0x49f280['name']){delete _0x49f280[_0xdb3a('0x28')];}_0x38248e['status'](_0xf641eb)[_0xdb3a('0x29')](_0x49f280);};}exports[_0xdb3a('0x2a')]=function(_0x4dcffc,_0xd6d1e1){var _0xdd1403={},_0x3401bb={},_0x391977={'count':0x0,'rows':[]};var _0x211238=_[_0xdb3a('0x2b')](db[_0xdb3a('0x2c')]['rawAttributes'],function(_0x28cdf5){return{'name':_0x28cdf5[_0xdb3a('0x2d')],'type':_0x28cdf5[_0xdb3a('0x2e')]['key']};});_0x3401bb[_0xdb3a('0x2f')]=_[_0xdb3a('0x2b')](_0x211238,_0xdb3a('0x28'));_0x3401bb[_0xdb3a('0x30')]=_[_0xdb3a('0x31')](_0x4dcffc['query']);_0x3401bb[_0xdb3a('0x32')]=_[_0xdb3a('0x33')](_0x3401bb[_0xdb3a('0x2f')],_0x3401bb['query']);_0xdd1403[_0xdb3a('0x34')]=_['intersection'](_0x3401bb[_0xdb3a('0x2f')],qs[_0xdb3a('0x35')](_0x4dcffc['query'][_0xdb3a('0x35')]));_0xdd1403[_0xdb3a('0x34')]=_0xdd1403[_0xdb3a('0x34')][_0xdb3a('0x36')]?_0xdd1403[_0xdb3a('0x34')]:_0x3401bb[_0xdb3a('0x2f')];if(!_0x4dcffc['query']['hasOwnProperty'](_0xdb3a('0x37'))){_0xdd1403[_0xdb3a('0x1e')]=qs[_0xdb3a('0x1e')](_0x4dcffc['query']['limit']);_0xdd1403[_0xdb3a('0x1c')]=qs['offset'](_0x4dcffc['query']['offset']);}_0xdd1403[_0xdb3a('0x38')]=qs[_0xdb3a('0x39')](_0x4dcffc['query'][_0xdb3a('0x39')]);_0xdd1403[_0xdb3a('0x3a')]=qs[_0xdb3a('0x32')](_['pick'](_0x4dcffc[_0xdb3a('0x30')],_0x3401bb[_0xdb3a('0x32')]),_0x211238);if(_0x4dcffc[_0xdb3a('0x30')]['filter']){_0xdd1403[_0xdb3a('0x3a')]=_['merge'](_0xdd1403[_0xdb3a('0x3a')],{'$or':_['map'](_0x211238,function(_0x43dd20){if(_0x43dd20[_0xdb3a('0x2e')]!==_0xdb3a('0x3b')){var _0x2cdb96={};_0x2cdb96[_0x43dd20[_0xdb3a('0x28')]]={'$like':'%'+_0x4dcffc[_0xdb3a('0x30')][_0xdb3a('0x3c')]+'%'};return _0x2cdb96;}})});}_0xdd1403=_[_0xdb3a('0x3d')]({},_0xdd1403,_0x4dcffc[_0xdb3a('0x3e')]);var _0x5b230e={'where':_0xdd1403[_0xdb3a('0x3a')]};return db[_0xdb3a('0x2c')][_0xdb3a('0x1f')](_0x5b230e)['then'](function(_0x1bca56){_0x391977[_0xdb3a('0x1f')]=_0x1bca56;if(_0x4dcffc[_0xdb3a('0x30')][_0xdb3a('0x3f')]){_0xdd1403[_0xdb3a('0x40')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xdb3a('0x41')](_0xdd1403);})[_0xdb3a('0x26')](function(_0x2dd9d2){_0x391977[_0xdb3a('0x42')]=_0x2dd9d2;return _0x391977;})[_0xdb3a('0x26')](respondWithFilteredResult(_0xd6d1e1,_0xdd1403))[_0xdb3a('0x43')](handleError(_0xd6d1e1,null));};exports[_0xdb3a('0x44')]=function(_0x2dc5b0,_0x706183){var _0x4efb3b={'raw':![],'where':{'id':_0x2dc5b0[_0xdb3a('0x45')]['id']}},_0x3a6031={};_0x3a6031[_0xdb3a('0x2f')]=_[_0xdb3a('0x31')](db[_0xdb3a('0x2c')][_0xdb3a('0x46')]);_0x3a6031['query']=_['keys'](_0x2dc5b0[_0xdb3a('0x30')]);_0x3a6031[_0xdb3a('0x32')]=_[_0xdb3a('0x33')](_0x3a6031[_0xdb3a('0x2f')],_0x3a6031[_0xdb3a('0x30')]);_0x4efb3b['attributes']=_[_0xdb3a('0x33')](_0x3a6031[_0xdb3a('0x2f')],qs[_0xdb3a('0x35')](_0x2dc5b0[_0xdb3a('0x30')][_0xdb3a('0x35')]));_0x4efb3b[_0xdb3a('0x34')]=_0x4efb3b['attributes']['length']?_0x4efb3b[_0xdb3a('0x34')]:_0x3a6031['model'];if(_0x2dc5b0[_0xdb3a('0x30')][_0xdb3a('0x3f')]){_0x4efb3b[_0xdb3a('0x40')]=[{'all':!![]}];}_0x4efb3b=_[_0xdb3a('0x3d')]({},_0x4efb3b,_0x2dc5b0[_0xdb3a('0x3e')]);return db['ServicenowAccount'][_0xdb3a('0x47')](_0x4efb3b)[_0xdb3a('0x26')](handleEntityNotFound(_0x706183,null))[_0xdb3a('0x26')](respondWithResult(_0x706183,null))[_0xdb3a('0x43')](handleError(_0x706183,null));};exports[_0xdb3a('0x48')]=function(_0x5c79b2,_0xf17306){return db[_0xdb3a('0x2c')][_0xdb3a('0x48')](_0x5c79b2[_0xdb3a('0x49')],{})[_0xdb3a('0x26')](respondWithResult(_0xf17306,0xc9))[_0xdb3a('0x43')](handleError(_0xf17306,null));};exports[_0xdb3a('0x24')]=function(_0x3fd88e,_0x79cdbf){if(_0x3fd88e['body']['id']){delete _0x3fd88e[_0xdb3a('0x49')]['id'];}return db[_0xdb3a('0x2c')]['find']({'where':{'id':_0x3fd88e['params']['id']}})[_0xdb3a('0x26')](handleEntityNotFound(_0x79cdbf,null))['then'](saveUpdates(_0x3fd88e[_0xdb3a('0x49')],null))[_0xdb3a('0x26')](respondWithResult(_0x79cdbf,null))[_0xdb3a('0x43')](handleError(_0x79cdbf,null));};exports[_0xdb3a('0x25')]=function(_0x28eed9,_0x89c821){return db[_0xdb3a('0x2c')][_0xdb3a('0x47')]({'where':{'id':_0x28eed9[_0xdb3a('0x45')]['id']}})['then'](handleEntityNotFound(_0x89c821,null))[_0xdb3a('0x26')](removeEntity(_0x89c821,null))[_0xdb3a('0x43')](handleError(_0x89c821,null));};exports[_0xdb3a('0x4a')]=function(_0x4acb40,_0x29ae3d,_0x113a55){var _0x55e48b={};var _0x5bf884={};var _0x12d260;var _0x1357b6;return db[_0xdb3a('0x2c')][_0xdb3a('0x4b')]({'where':{'id':_0x4acb40[_0xdb3a('0x45')]['id']}})['then'](handleEntityNotFound(_0x29ae3d,null))['then'](function(_0x330621){if(_0x330621){_0x12d260=_0x330621;_0x5bf884[_0xdb3a('0x2f')]=_[_0xdb3a('0x31')](db[_0xdb3a('0x4c')][_0xdb3a('0x46')]);_0x5bf884[_0xdb3a('0x30')]=_[_0xdb3a('0x31')](_0x4acb40[_0xdb3a('0x30')]);_0x5bf884[_0xdb3a('0x32')]=_[_0xdb3a('0x33')](_0x5bf884[_0xdb3a('0x2f')],_0x5bf884['query']);_0x55e48b['attributes']=_['intersection'](_0x5bf884[_0xdb3a('0x2f')],qs['fields'](_0x4acb40[_0xdb3a('0x30')]['fields']));_0x55e48b[_0xdb3a('0x34')]=_0x55e48b[_0xdb3a('0x34')]['length']?_0x55e48b[_0xdb3a('0x34')]:_0x5bf884[_0xdb3a('0x2f')];_0x55e48b[_0xdb3a('0x38')]=qs[_0xdb3a('0x39')](_0x4acb40[_0xdb3a('0x30')][_0xdb3a('0x39')]);_0x55e48b[_0xdb3a('0x3a')]=qs[_0xdb3a('0x32')](_[_0xdb3a('0x4d')](_0x4acb40['query'],_0x5bf884['filters']));if(_0x4acb40['query'][_0xdb3a('0x3c')]){_0x55e48b[_0xdb3a('0x3a')]=_[_0xdb3a('0x3d')](_0x55e48b[_0xdb3a('0x3a')],{'$or':_[_0xdb3a('0x2b')](_0x55e48b['attributes'],function(_0x244ab9){var _0x18c0e7={};_0x18c0e7[_0x244ab9]={'$like':'%'+_0x4acb40['query']['filter']+'%'};return _0x18c0e7;})});}_0x55e48b=_['merge']({},_0x55e48b,_0x4acb40[_0xdb3a('0x3e')]);return _0x12d260['getConfigurations'](_0x55e48b);}})[_0xdb3a('0x26')](function(_0x4bcfca){if(_0x4bcfca){_0x1357b6=_0x4bcfca[_0xdb3a('0x36')];if(!_0x4acb40[_0xdb3a('0x30')][_0xdb3a('0x4e')](_0xdb3a('0x37'))){_0x55e48b['limit']=qs[_0xdb3a('0x1e')](_0x4acb40[_0xdb3a('0x30')][_0xdb3a('0x1e')]);_0x55e48b[_0xdb3a('0x1c')]=qs['offset'](_0x4acb40[_0xdb3a('0x30')][_0xdb3a('0x1c')]);}return _0x12d260[_0xdb3a('0x4a')](_0x55e48b);}})[_0xdb3a('0x26')](function(_0x31dc06){if(_0x31dc06){return _0x31dc06?{'count':_0x1357b6,'rows':_0x31dc06}:null;}})[_0xdb3a('0x26')](respondWithResult(_0x29ae3d,null))['catch'](handleError(_0x29ae3d,null));};exports[_0xdb3a('0x4f')]=function(_0x39d256,_0x32801b,_0x23c19c){if(_0x39d256[_0xdb3a('0x49')]['id']){delete _0x39d256['body']['id'];}return db['ServicenowAccount'][_0xdb3a('0x4b')]({'where':{'id':_0x39d256[_0xdb3a('0x45')]['id']}})['then'](handleEntityNotFound(_0x32801b,null))[_0xdb3a('0x26')](function(_0x272031){if(_0x272031){_0x39d256[_0xdb3a('0x49')][_0xdb3a('0x50')]=_0x272031['id'];_0x39d256[_0xdb3a('0x49')][_0xdb3a('0x51')]=integrations[_0xdb3a('0x52')](_0x39d256['body'][_0xdb3a('0x53')],_0x39d256['body'][_0xdb3a('0x2e')]);_0x39d256[_0xdb3a('0x49')][_0xdb3a('0x54')]=integrations[_0xdb3a('0x55')](_0x39d256[_0xdb3a('0x49')][_0xdb3a('0x53')],_0x39d256[_0xdb3a('0x49')][_0xdb3a('0x2e')]);return db[_0xdb3a('0x4c')][_0xdb3a('0x48')](_0x39d256['body'],{'include':[{'model':db[_0xdb3a('0x56')],'as':_0xdb3a('0x51')},{'model':db['ServicenowField'],'as':_0xdb3a('0x54')}]});}return null;})[_0xdb3a('0x26')](respondWithResult(_0x32801b,null))[_0xdb3a('0x43')](handleError(_0x32801b,null));};exports[_0xdb3a('0x57')]=function(_0x2f9986,_0x1577ac,_0x2dd356){var _0xc06cd7=[_0xdb3a('0x58'),_0xdb3a('0x59'),_0xdb3a('0x5a'),_0xdb3a('0x5b'),_0xdb3a('0x5c'),_0xdb3a('0x5d'),_0xdb3a('0x5e'),'severity',_0xdb3a('0x5f')];var _0x4a43a1=[_0xdb3a('0x60'),_0xdb3a('0x58'),'caused_by',_0xdb3a('0x61'),_0xdb3a('0x62'),_0xdb3a('0x63'),_0xdb3a('0x64'),_0xdb3a('0x59'),_0xdb3a('0x65'),_0xdb3a('0x66'),'resolved_by','sys_updated_by',_0xdb3a('0x67'),_0xdb3a('0x68'),_0xdb3a('0x69'),_0xdb3a('0x6a'),_0xdb3a('0x6b'),'sys_created_by',_0xdb3a('0x5a'),_0xdb3a('0x38'),_0xdb3a('0x6c'),_0xdb3a('0x6d'),_0xdb3a('0x6e'),_0xdb3a('0x6f'),_0xdb3a('0x70'),'active','work_notes_list',_0xdb3a('0x71'),'priority','sys_domain_path','rfc',_0xdb3a('0x72'),_0xdb3a('0x73'),_0xdb3a('0x74'),_0xdb3a('0x75'),_0xdb3a('0x76'),_0xdb3a('0x77'),_0xdb3a('0x78'),_0xdb3a('0x79'),'caller_id','approval_set',_0xdb3a('0x5b'),'work_notes',_0xdb3a('0x7a'),_0xdb3a('0x5c'),_0xdb3a('0x7b'),'delivery_task',_0xdb3a('0x7c'),_0xdb3a('0x7d'),_0xdb3a('0x7e'),_0xdb3a('0x7f'),'description',_0xdb3a('0x80'),_0xdb3a('0x5d'),_0xdb3a('0x81'),_0xdb3a('0x82'),_0xdb3a('0x83'),_0xdb3a('0x84'),_0xdb3a('0x85'),_0xdb3a('0x86'),_0xdb3a('0x87'),_0xdb3a('0x88'),_0xdb3a('0x5e'),_0xdb3a('0x89'),_0xdb3a('0x8a'),_0xdb3a('0x8b'),'reassignment_count','activity_due',_0xdb3a('0x8c'),_0xdb3a('0x8d'),_0xdb3a('0x8e'),'sla_due',_0xdb3a('0x8f'),_0xdb3a('0x90'),'due_date',_0xdb3a('0x91'),'reopen_count',_0xdb3a('0x92'),'escalation','upon_approval',_0xdb3a('0x93'),_0xdb3a('0x94'),_0xdb3a('0x5f')];var _0x502b19='';var _0x1e24db='';var _0xd388eb=[];var _0x27846f='';var _0x45546d='';var _0x175912=[];var _0x3b65a4='';var _0x222b24='';var _0x376509={};var _0x45a0da='';return db[_0xdb3a('0x2c')]['findOne']({'where':{'id':_0x2f9986[_0xdb3a('0x45')]['id']},'attributes':['id','username','password','email',_0xdb3a('0x95'),_0xdb3a('0x96')]})[_0xdb3a('0x26')](handleEntityNotFound(_0x1577ac,null))[_0xdb3a('0x26')](function(_0x52fb4a){if(_0x52fb4a){_0x45a0da=_0x52fb4a[_0xdb3a('0x95')];var _0x360b14=_0x45a0da['slice'](-0x1);if(_0x360b14==='/'){_0x45a0da=_0x45a0da[_0xdb3a('0x97')](0x0,_0x45a0da[_0xdb3a('0x98')](_0x360b14));}_0x222b24=util['format']('%s/api/now/doc/table/schema/',_0x45a0da);_0x3b65a4=util[_0xdb3a('0x99')]('%s/api/now/table/',_0x45a0da);_0x376509={'user':_0x52fb4a[_0xdb3a('0x9a')],'pass':_0x52fb4a[_0xdb3a('0x9b')]};var _0x36e9e4={'method':_0xdb3a('0x9c'),'uri':_0x222b24+_0xdb3a('0x9d'),'auth':_0x376509,'json':!![]};return rp(_0x36e9e4);}})[_0xdb3a('0x26')](function(_0x2dc491){if(_0x2dc491[_0xdb3a('0x9e')][_0xdb3a('0x36')]>0x0){_0x502b19=_0x2dc491['result'];}console[_0xdb3a('0x9f')](_0xdb3a('0xa0'),_0x502b19);_0x175912=[];_0x1e24db=Object[_0xdb3a('0xa1')]([],_0x502b19);_[_0xdb3a('0xa2')](_0x1e24db,function(_0x5b9a67){return!_0xc06cd7[_0xdb3a('0xa3')](_0x5b9a67['name']);});_0x1e24db[_0xdb3a('0xa4')](function(_0x37ec48){var _0x112918=createFieldObject(_0x3b65a4,_0x376509,_0x37ec48[_0xdb3a('0xa5')],_0x37ec48['name'],_0x37ec48[_0xdb3a('0xa6')],![]);_0x175912[_0xdb3a('0xa7')](_0x112918);});return Promise[_0xdb3a('0xa8')](_0x175912);})[_0xdb3a('0x26')](function(_0x445705){_0xd388eb=_0x445705;_0x27846f=Object['assign']([],_0x502b19);console[_0xdb3a('0x9f')](_0xdb3a('0xa9'),_0x502b19);_[_0xdb3a('0xa2')](_0x27846f,function(_0x1a38f0){return _0x4a43a1['includes'](_0x1a38f0[_0xdb3a('0x28')]);});console[_0xdb3a('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x27846f);_0x175912=[];_0x27846f[_0xdb3a('0xa4')](function(_0x534c8e){var _0x5cb27f=createFieldObject(_0x3b65a4,_0x376509,_0x534c8e[_0xdb3a('0xa5')],_0x534c8e[_0xdb3a('0x28')],_0x534c8e['label'],!![]);_0x175912[_0xdb3a('0xa7')](_0x5cb27f);});return Promise['all'](_0x175912);})[_0xdb3a('0x26')](function(_0x599ca2){_0x45546d=_0x599ca2;var _0xb8d7b5=_0xd388eb[_0xdb3a('0xaa')](_0x45546d);return{'count':_0xb8d7b5[_0xdb3a('0x36')],'rows':_0xb8d7b5};})[_0xdb3a('0x26')](respondWithResult(_0x1577ac,null))['catch'](function(_0x57591c){console[_0xdb3a('0x9f')](_0xdb3a('0xab')+_0x57591c);var _0x35b6b8=_0x2f9986[_0xdb3a('0x30')][_0xdb3a('0xac')]?0x1f4:_0x57591c[_0xdb3a('0xad')]||0x1f4;logger[_0xdb3a('0xae')](_0x57591c[_0xdb3a('0x27')]);delete _0x57591c[_0xdb3a('0x28')];if(_0x35b6b8===0x191){_0x35b6b8=0x190;}_0x1577ac[_0xdb3a('0x19')](_0x35b6b8)['send'](_0x2f9986['query'][_0xdb3a('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x57591c[_0xdb3a('0xad')]}:_0x57591c);});};function createFieldObject(_0x2e2e1c,_0x27a252,_0x5bbf13,_0x5c3ee4,_0x11b444,_0x44611a){return new Promise(function(_0x2d06c7,_0x4e791d){var _0x2b0f58={'id':_0x5c3ee4,'name':_0x11b444,'custom':_0x44611a};if(_0x5bbf13===_0xdb3a('0xaf')){_0x2b0f58[_0xdb3a('0x3e')]=[{'name':'True','value':_0xdb3a('0xb0')},{'name':_0xdb3a('0xb1'),'value':_0xdb3a('0xb2')}];_0x2d06c7(_0x2b0f58);}else{var _0x398920={'method':_0xdb3a('0x9c'),'uri':_0x2e2e1c+'sys_choice?sysparm_query=name=incident^element='+_0x5c3ee4,'auth':_0x27a252,'json':!![]};return rp(_0x398920)[_0xdb3a('0x26')](function(_0x2a49c4){var _0x3510da=[];if(_0x2a49c4[_0xdb3a('0x9e')][_0xdb3a('0x36')]>0x0){_0x2a49c4[_0xdb3a('0x9e')][_0xdb3a('0xa4')](function(_0x131c90){if(_0x131c90[_0xdb3a('0xb3')]==='false'){var _0x34773f={'name':_0x131c90[_0xdb3a('0xa6')],'value':_0x131c90[_0xdb3a('0xb4')]};_0x3510da[_0xdb3a('0xa7')](_0x34773f);}});}_0x2b0f58[_0xdb3a('0x3e')]=_0x3510da;if(_0x2b0f58[_0xdb3a('0x3e')]['length']>0x0){_0x2d06c7(_0x2b0f58);}else{if(_0x44611a==![]){_0x2d06c7();}else{_0x2d06c7(_0x2b0f58);}}});}});} \ No newline at end of file +var _0x87ad=['addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','all','assign','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','ServiceNow\x20error:\x20','test','statusCode','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','ServicenowAccount','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','pick'];(function(_0x2f9fae,_0x1705c6){var _0x1d17e2=function(_0x2ec4f0){while(--_0x2ec4f0){_0x2f9fae['push'](_0x2f9fae['shift']());}};_0x1d17e2(++_0x1705c6);}(_0x87ad,0x1e1));var _0xd87a=function(_0x454a61,_0x4ccd0f){_0x454a61=_0x454a61-0x0;var _0xad597=_0x87ad[_0x454a61];return _0xad597;};'use strict';var emlformat=require(_0xd87a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd87a('0x1'));var jsonpatch=require(_0xd87a('0x2'));var rp=require('request-promise');var moment=require(_0xd87a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd87a('0x4'));var util=require(_0xd87a('0x5'));var path=require(_0xd87a('0x6'));var sox=require(_0xd87a('0x7'));var csv=require(_0xd87a('0x8'));var ejs=require(_0xd87a('0x9'));var fs=require('fs');var fs_extra=require(_0xd87a('0xa'));var _=require(_0xd87a('0xb'));var squel=require(_0xd87a('0xc'));var crypto=require('crypto');var jsforce=require(_0xd87a('0xd'));var deskjs=require(_0xd87a('0xe'));var toCsv=require(_0xd87a('0x8'));var querystring=require('querystring');var Papa=require(_0xd87a('0xf'));var Redis=require(_0xd87a('0x10'));var authService=require(_0xd87a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd87a('0x12'));var hardwareService=require(_0xd87a('0x13'));var logger=require(_0xd87a('0x14'))(_0xd87a('0x15'));var utils=require(_0xd87a('0x16'));var config=require(_0xd87a('0x17'));var licenseUtil=require(_0xd87a('0x18'));var db=require(_0xd87a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xaca72d,_0x62b17a){_0x62b17a=_0x62b17a||0xcc;return function(_0x3e6939){if(_0x3e6939){return _0xaca72d[_0xd87a('0x1a')](_0x62b17a);}return _0xaca72d['status'](_0x62b17a)[_0xd87a('0x1b')]();};}function respondWithResult(_0x54ae95,_0xd65249){_0xd65249=_0xd65249||0xc8;return function(_0x459b75){if(_0x459b75){return _0x54ae95[_0xd87a('0x1c')](_0xd65249)['json'](_0x459b75);}};}function respondWithFilteredResult(_0x1fd070,_0xe82394){return function(_0x1a4d34){if(_0x1a4d34){var _0x5a56c8=typeof _0xe82394[_0xd87a('0x1d')]===_0xd87a('0x1e')&&typeof _0xe82394[_0xd87a('0x1f')]===_0xd87a('0x1e');var _0x463f43=_0x1a4d34[_0xd87a('0x20')];var _0x4642f9=_0x5a56c8?0x0:_0xe82394[_0xd87a('0x1d')];var _0x411b50=_0x5a56c8?_0x1a4d34[_0xd87a('0x20')]:_0xe82394['offset']+_0xe82394[_0xd87a('0x1f')];var _0x362c35;if(_0x411b50>=_0x463f43){_0x411b50=_0x463f43;_0x362c35=0xc8;}else{_0x362c35=0xce;}_0x1fd070[_0xd87a('0x1c')](_0x362c35);return _0x1fd070['set'](_0xd87a('0x21'),_0x4642f9+'-'+_0x411b50+'/'+_0x463f43)[_0xd87a('0x22')](_0x1a4d34);}return null;};}function patchUpdates(_0x334f2f){return function(_0x2b58a){try{jsonpatch['apply'](_0x2b58a,_0x334f2f,!![]);}catch(_0xde7968){return BPromise[_0xd87a('0x23')](_0xde7968);}return _0x2b58a[_0xd87a('0x24')]();};}function saveUpdates(_0x5176f9,_0x3f6a51){return function(_0x23546d){if(_0x23546d){return _0x23546d[_0xd87a('0x25')](_0x5176f9)[_0xd87a('0x26')](function(_0x423fbc){return _0x423fbc;});}return null;};}function removeEntity(_0x15c239,_0x5f2a67){return function(_0x1b2f0a){if(_0x1b2f0a){return _0x1b2f0a[_0xd87a('0x27')]()[_0xd87a('0x26')](function(){_0x15c239[_0xd87a('0x1c')](0xcc)[_0xd87a('0x1b')]();});}};}function handleEntityNotFound(_0x57953a,_0x5f5a6d){return function(_0x5b3cc2){if(!_0x5b3cc2){_0x57953a[_0xd87a('0x1a')](0x194);}return _0x5b3cc2;};}function handleError(_0x45018a,_0xbf600b){_0xbf600b=_0xbf600b||0x1f4;return function(_0x48bc4c){logger[_0xd87a('0x28')](_0x48bc4c[_0xd87a('0x29')]);if(_0x48bc4c['name']){delete _0x48bc4c[_0xd87a('0x2a')];}_0x45018a[_0xd87a('0x1c')](_0xbf600b)[_0xd87a('0x2b')](_0x48bc4c);};}exports['index']=function(_0x5d1c67,_0x2ed750){var _0x1e676a={},_0xc92301={},_0x42700={'count':0x0,'rows':[]};var _0x2194ca=_[_0xd87a('0x2c')](db['ServicenowAccount'][_0xd87a('0x2d')],function(_0x5a75a2){return{'name':_0x5a75a2[_0xd87a('0x2e')],'type':_0x5a75a2[_0xd87a('0x2f')][_0xd87a('0x30')]};});_0xc92301[_0xd87a('0x31')]=_[_0xd87a('0x2c')](_0x2194ca,_0xd87a('0x2a'));_0xc92301['query']=_['keys'](_0x5d1c67[_0xd87a('0x32')]);_0xc92301[_0xd87a('0x33')]=_[_0xd87a('0x34')](_0xc92301[_0xd87a('0x31')],_0xc92301['query']);_0x1e676a[_0xd87a('0x35')]=_[_0xd87a('0x34')](_0xc92301[_0xd87a('0x31')],qs['fields'](_0x5d1c67['query'][_0xd87a('0x36')]));_0x1e676a['attributes']=_0x1e676a['attributes'][_0xd87a('0x37')]?_0x1e676a['attributes']:_0xc92301[_0xd87a('0x31')];if(!_0x5d1c67['query'][_0xd87a('0x38')](_0xd87a('0x39'))){_0x1e676a['limit']=qs['limit'](_0x5d1c67[_0xd87a('0x32')][_0xd87a('0x1f')]);_0x1e676a[_0xd87a('0x1d')]=qs[_0xd87a('0x1d')](_0x5d1c67[_0xd87a('0x32')][_0xd87a('0x1d')]);}_0x1e676a[_0xd87a('0x3a')]=qs['sort'](_0x5d1c67[_0xd87a('0x32')][_0xd87a('0x3b')]);_0x1e676a['where']=qs[_0xd87a('0x33')](_['pick'](_0x5d1c67[_0xd87a('0x32')],_0xc92301[_0xd87a('0x33')]),_0x2194ca);if(_0x5d1c67[_0xd87a('0x32')][_0xd87a('0x3c')]){_0x1e676a['where']=_[_0xd87a('0x3d')](_0x1e676a[_0xd87a('0x3e')],{'$or':_[_0xd87a('0x2c')](_0x2194ca,function(_0x592525){if(_0x592525['type']!=='VIRTUAL'){var _0x15ce2e={};_0x15ce2e[_0x592525[_0xd87a('0x2a')]]={'$like':'%'+_0x5d1c67[_0xd87a('0x32')][_0xd87a('0x3c')]+'%'};return _0x15ce2e;}})});}_0x1e676a=_[_0xd87a('0x3d')]({},_0x1e676a,_0x5d1c67[_0xd87a('0x3f')]);var _0x2b173a={'where':_0x1e676a[_0xd87a('0x3e')]};return db[_0xd87a('0x40')]['count'](_0x2b173a)[_0xd87a('0x26')](function(_0x1e0267){_0x42700[_0xd87a('0x20')]=_0x1e0267;if(_0x5d1c67[_0xd87a('0x32')]['includeAll']){_0x1e676a[_0xd87a('0x41')]=[{'all':!![]}];}return db[_0xd87a('0x40')][_0xd87a('0x42')](_0x1e676a);})['then'](function(_0x568624){_0x42700[_0xd87a('0x43')]=_0x568624;return _0x42700;})[_0xd87a('0x26')](respondWithFilteredResult(_0x2ed750,_0x1e676a))['catch'](handleError(_0x2ed750,null));};exports[_0xd87a('0x44')]=function(_0x33946c,_0x25d220){var _0x50e505={'raw':![],'where':{'id':_0x33946c[_0xd87a('0x45')]['id']}},_0x2a880f={};_0x2a880f[_0xd87a('0x31')]=_[_0xd87a('0x46')](db[_0xd87a('0x40')][_0xd87a('0x2d')]);_0x2a880f[_0xd87a('0x32')]=_['keys'](_0x33946c[_0xd87a('0x32')]);_0x2a880f[_0xd87a('0x33')]=_[_0xd87a('0x34')](_0x2a880f[_0xd87a('0x31')],_0x2a880f['query']);_0x50e505[_0xd87a('0x35')]=_[_0xd87a('0x34')](_0x2a880f['model'],qs[_0xd87a('0x36')](_0x33946c['query'][_0xd87a('0x36')]));_0x50e505[_0xd87a('0x35')]=_0x50e505[_0xd87a('0x35')][_0xd87a('0x37')]?_0x50e505[_0xd87a('0x35')]:_0x2a880f[_0xd87a('0x31')];if(_0x33946c[_0xd87a('0x32')][_0xd87a('0x47')]){_0x50e505[_0xd87a('0x41')]=[{'all':!![]}];}_0x50e505=_[_0xd87a('0x3d')]({},_0x50e505,_0x33946c[_0xd87a('0x3f')]);return db[_0xd87a('0x40')]['find'](_0x50e505)[_0xd87a('0x26')](handleEntityNotFound(_0x25d220,null))['then'](respondWithResult(_0x25d220,null))[_0xd87a('0x48')](handleError(_0x25d220,null));};exports[_0xd87a('0x49')]=function(_0x1ab016,_0x4b423e){return db['ServicenowAccount'][_0xd87a('0x49')](_0x1ab016[_0xd87a('0x4a')],{})['then'](respondWithResult(_0x4b423e,0xc9))[_0xd87a('0x48')](handleError(_0x4b423e,null));};exports['update']=function(_0x3f0016,_0x47ccc6){if(_0x3f0016['body']['id']){delete _0x3f0016[_0xd87a('0x4a')]['id'];}return db['ServicenowAccount'][_0xd87a('0x4b')]({'where':{'id':_0x3f0016[_0xd87a('0x45')]['id']}})['then'](handleEntityNotFound(_0x47ccc6,null))['then'](saveUpdates(_0x3f0016['body'],null))[_0xd87a('0x26')](respondWithResult(_0x47ccc6,null))[_0xd87a('0x48')](handleError(_0x47ccc6,null));};exports[_0xd87a('0x27')]=function(_0x16f369,_0x24c51f){return db[_0xd87a('0x40')][_0xd87a('0x4b')]({'where':{'id':_0x16f369[_0xd87a('0x45')]['id']}})[_0xd87a('0x26')](handleEntityNotFound(_0x24c51f,null))['then'](removeEntity(_0x24c51f,null))[_0xd87a('0x48')](handleError(_0x24c51f,null));};exports[_0xd87a('0x4c')]=function(_0x108206,_0x1d2ada,_0xaf04d0){var _0xef6e14={};var _0x405490={};var _0x55e5fb;var _0x257a82;return db['ServicenowAccount'][_0xd87a('0x4d')]({'where':{'id':_0x108206[_0xd87a('0x45')]['id']}})[_0xd87a('0x26')](handleEntityNotFound(_0x1d2ada,null))[_0xd87a('0x26')](function(_0x52e9d3){if(_0x52e9d3){_0x55e5fb=_0x52e9d3;_0x405490[_0xd87a('0x31')]=_[_0xd87a('0x46')](db[_0xd87a('0x4e')][_0xd87a('0x2d')]);_0x405490[_0xd87a('0x32')]=_['keys'](_0x108206[_0xd87a('0x32')]);_0x405490[_0xd87a('0x33')]=_[_0xd87a('0x34')](_0x405490[_0xd87a('0x31')],_0x405490[_0xd87a('0x32')]);_0xef6e14['attributes']=_[_0xd87a('0x34')](_0x405490[_0xd87a('0x31')],qs[_0xd87a('0x36')](_0x108206['query'][_0xd87a('0x36')]));_0xef6e14[_0xd87a('0x35')]=_0xef6e14[_0xd87a('0x35')][_0xd87a('0x37')]?_0xef6e14['attributes']:_0x405490[_0xd87a('0x31')];_0xef6e14[_0xd87a('0x3a')]=qs['sort'](_0x108206[_0xd87a('0x32')][_0xd87a('0x3b')]);_0xef6e14[_0xd87a('0x3e')]=qs[_0xd87a('0x33')](_[_0xd87a('0x4f')](_0x108206[_0xd87a('0x32')],_0x405490[_0xd87a('0x33')]));if(_0x108206[_0xd87a('0x32')][_0xd87a('0x3c')]){_0xef6e14[_0xd87a('0x3e')]=_['merge'](_0xef6e14['where'],{'$or':_[_0xd87a('0x2c')](_0xef6e14[_0xd87a('0x35')],function(_0x18901c){var _0x35183d={};_0x35183d[_0x18901c]={'$like':'%'+_0x108206[_0xd87a('0x32')]['filter']+'%'};return _0x35183d;})});}_0xef6e14=_[_0xd87a('0x3d')]({},_0xef6e14,_0x108206[_0xd87a('0x3f')]);return _0x55e5fb[_0xd87a('0x4c')](_0xef6e14);}})[_0xd87a('0x26')](function(_0xe1ce70){if(_0xe1ce70){_0x257a82=_0xe1ce70[_0xd87a('0x37')];if(!_0x108206[_0xd87a('0x32')]['hasOwnProperty'](_0xd87a('0x39'))){_0xef6e14['limit']=qs['limit'](_0x108206['query']['limit']);_0xef6e14[_0xd87a('0x1d')]=qs[_0xd87a('0x1d')](_0x108206['query']['offset']);}return _0x55e5fb[_0xd87a('0x4c')](_0xef6e14);}})[_0xd87a('0x26')](function(_0x3e5044){if(_0x3e5044){return _0x3e5044?{'count':_0x257a82,'rows':_0x3e5044}:null;}})[_0xd87a('0x26')](respondWithResult(_0x1d2ada,null))[_0xd87a('0x48')](handleError(_0x1d2ada,null));};exports[_0xd87a('0x50')]=function(_0x2889e1,_0x3019f1,_0x28305d){if(_0x2889e1['body']['id']){delete _0x2889e1['body']['id'];}return db[_0xd87a('0x40')]['findOne']({'where':{'id':_0x2889e1[_0xd87a('0x45')]['id']}})[_0xd87a('0x26')](handleEntityNotFound(_0x3019f1,null))['then'](function(_0x10109c){if(_0x10109c){_0x2889e1['body']['AccountId']=_0x10109c['id'];_0x2889e1[_0xd87a('0x4a')][_0xd87a('0x51')]=integrations[_0xd87a('0x52')](_0x2889e1[_0xd87a('0x4a')][_0xd87a('0x53')],_0x2889e1[_0xd87a('0x4a')][_0xd87a('0x2f')]);_0x2889e1[_0xd87a('0x4a')][_0xd87a('0x54')]=integrations[_0xd87a('0x55')](_0x2889e1['body'][_0xd87a('0x53')],_0x2889e1['body'][_0xd87a('0x2f')]);return db[_0xd87a('0x4e')][_0xd87a('0x49')](_0x2889e1[_0xd87a('0x4a')],{'include':[{'model':db[_0xd87a('0x56')],'as':_0xd87a('0x51')},{'model':db[_0xd87a('0x56')],'as':'Descriptions'}]});}return null;})[_0xd87a('0x26')](respondWithResult(_0x3019f1,null))['catch'](handleError(_0x3019f1,null));};exports[_0xd87a('0x57')]=function(_0x17c394,_0x5edadf,_0x34c77d){var _0xe086d0=[_0xd87a('0x58'),_0xd87a('0x59'),_0xd87a('0x5a'),_0xd87a('0x5b'),_0xd87a('0x5c'),_0xd87a('0x5d'),_0xd87a('0x5e'),'severity',_0xd87a('0x5f')];var _0x31999f=[_0xd87a('0x60'),_0xd87a('0x58'),_0xd87a('0x61'),_0xd87a('0x62'),_0xd87a('0x63'),'sys_updated_on',_0xd87a('0x64'),_0xd87a('0x59'),'approval_history','number',_0xd87a('0x65'),'sys_updated_by',_0xd87a('0x66'),_0xd87a('0x67'),_0xd87a('0x68'),_0xd87a('0x69'),_0xd87a('0x6a'),'sys_created_by',_0xd87a('0x5a'),_0xd87a('0x3a'),_0xd87a('0x6b'),_0xd87a('0x6c'),_0xd87a('0x6d'),_0xd87a('0x6e'),_0xd87a('0x6f'),_0xd87a('0x70'),_0xd87a('0x71'),'business_service',_0xd87a('0x72'),_0xd87a('0x73'),_0xd87a('0x74'),_0xd87a('0x75'),'expected_start',_0xd87a('0x76'),'business_duration',_0xd87a('0x77'),_0xd87a('0x78'),_0xd87a('0x79'),_0xd87a('0x7a'),_0xd87a('0x7b'),_0xd87a('0x7c'),'subcategory',_0xd87a('0x7d'),_0xd87a('0x7e'),_0xd87a('0x5c'),_0xd87a('0x7f'),'delivery_task',_0xd87a('0x80'),'assignment_group',_0xd87a('0x81'),_0xd87a('0x82'),_0xd87a('0x83'),_0xd87a('0x84'),_0xd87a('0x5d'),_0xd87a('0x85'),'close_notes',_0xd87a('0x86'),_0xd87a('0x87'),'parent_incident',_0xd87a('0x88'),_0xd87a('0x89'),_0xd87a('0x8a'),_0xd87a('0x5e'),_0xd87a('0x8b'),_0xd87a('0x8c'),_0xd87a('0x8d'),_0xd87a('0x8e'),_0xd87a('0x8f'),'assigned_to',_0xd87a('0x90'),_0xd87a('0x91'),_0xd87a('0x92'),'approval',_0xd87a('0x93'),_0xd87a('0x94'),_0xd87a('0x95'),_0xd87a('0x96'),'sys_tags',_0xd87a('0x97'),_0xd87a('0x98'),_0xd87a('0x99'),'location',_0xd87a('0x5f')];var _0x3b675c='';var _0x41cd9a='';var _0x29bde4=[];var _0x10a3df='';var _0x13b7d2='';var _0x51cf88=[];var _0x2cc192='';var _0x1de16f='';var _0x583cc3={};var _0x4f42bb='';return db[_0xd87a('0x40')]['findOne']({'where':{'id':_0x17c394[_0xd87a('0x45')]['id']},'attributes':['id',_0xd87a('0x9a'),_0xd87a('0x9b'),_0xd87a('0x9c'),_0xd87a('0x9d'),_0xd87a('0x9e')]})[_0xd87a('0x26')](handleEntityNotFound(_0x5edadf,null))[_0xd87a('0x26')](function(_0x52e924){if(_0x52e924){_0x4f42bb=_0x52e924[_0xd87a('0x9d')];var _0x4fe85d=_0x4f42bb['slice'](-0x1);if(_0x4fe85d==='/'){_0x4f42bb=_0x4f42bb[_0xd87a('0x9f')](0x0,_0x4f42bb[_0xd87a('0xa0')](_0x4fe85d));}_0x1de16f=util[_0xd87a('0xa1')](_0xd87a('0xa2'),_0x4f42bb);_0x2cc192=util[_0xd87a('0xa1')](_0xd87a('0xa3'),_0x4f42bb);_0x583cc3={'user':_0x52e924[_0xd87a('0x9a')],'pass':_0x52e924[_0xd87a('0x9b')]};var _0x210bd3={'method':_0xd87a('0xa4'),'uri':_0x1de16f+_0xd87a('0xa5'),'auth':_0x583cc3,'json':!![]};return rp(_0x210bd3);}})[_0xd87a('0x26')](function(_0x4a6a9c){if(_0x4a6a9c[_0xd87a('0xa6')][_0xd87a('0x37')]>0x0){_0x3b675c=_0x4a6a9c[_0xd87a('0xa6')];}console[_0xd87a('0xa7')](_0xd87a('0xa8'),_0x3b675c);_0x51cf88=[];_0x41cd9a=Object['assign']([],_0x3b675c);_[_0xd87a('0xa9')](_0x41cd9a,function(_0x224cb3){return!_0xe086d0[_0xd87a('0xaa')](_0x224cb3[_0xd87a('0x2a')]);});_0x41cd9a[_0xd87a('0xab')](function(_0x59c3d9){var _0x5dfa06=createFieldObject(_0x2cc192,_0x583cc3,_0x59c3d9[_0xd87a('0xac')],_0x59c3d9['name'],_0x59c3d9[_0xd87a('0xad')],![]);_0x51cf88['push'](_0x5dfa06);});return Promise[_0xd87a('0xae')](_0x51cf88);})[_0xd87a('0x26')](function(_0x569b39){_0x29bde4=_0x569b39;_0x10a3df=Object[_0xd87a('0xaf')]([],_0x3b675c);console[_0xd87a('0xa7')]('TCL:\x20_object',_0x3b675c);_[_0xd87a('0xa9')](_0x10a3df,function(_0x4889d1){return _0x31999f[_0xd87a('0xaa')](_0x4889d1[_0xd87a('0x2a')]);});console[_0xd87a('0xa7')](_0xd87a('0xb0'),_0x10a3df);_0x51cf88=[];_0x10a3df[_0xd87a('0xab')](function(_0x368999){var _0x497827=createFieldObject(_0x2cc192,_0x583cc3,_0x368999[_0xd87a('0xac')],_0x368999[_0xd87a('0x2a')],_0x368999[_0xd87a('0xad')],!![]);_0x51cf88[_0xd87a('0xb1')](_0x497827);});return Promise[_0xd87a('0xae')](_0x51cf88);})[_0xd87a('0x26')](function(_0x4b5d0b){_0x13b7d2=_0x4b5d0b;var _0x2cd1fb=_0x29bde4['concat'](_0x13b7d2);return{'count':_0x2cd1fb[_0xd87a('0x37')],'rows':_0x2cd1fb};})['then'](respondWithResult(_0x5edadf,null))[_0xd87a('0x48')](function(_0x1a1985){console[_0xd87a('0xa7')](_0xd87a('0xb2')+_0x1a1985);var _0x5a4ee6=_0x17c394[_0xd87a('0x32')][_0xd87a('0xb3')]?0x1f4:_0x1a1985[_0xd87a('0xb4')]||0x1f4;logger[_0xd87a('0x28')](_0x1a1985[_0xd87a('0x29')]);delete _0x1a1985[_0xd87a('0x2a')];if(_0x5a4ee6===0x191){_0x5a4ee6=0x190;}_0x5edadf['status'](_0x5a4ee6)[_0xd87a('0x2b')](_0x17c394[_0xd87a('0x32')][_0xd87a('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x1a1985['statusCode']}:_0x1a1985);});};function createFieldObject(_0x4f40bc,_0x2b7893,_0x34d989,_0x3bb641,_0x24a45b,_0x4855e4){return new Promise(function(_0x327377,_0x2bf2cb){var _0x596114={'id':_0x3bb641,'name':_0x24a45b,'custom':_0x4855e4};if(_0x34d989===_0xd87a('0xb5')){_0x596114[_0xd87a('0x3f')]=[{'name':_0xd87a('0xb6'),'value':'true'},{'name':'False','value':_0xd87a('0xb7')}];_0x327377(_0x596114);}else{var _0x112f4d={'method':_0xd87a('0xa4'),'uri':_0x4f40bc+_0xd87a('0xb8')+_0x3bb641,'auth':_0x2b7893,'json':!![]};return rp(_0x112f4d)[_0xd87a('0x26')](function(_0x579bc6){var _0x43e22b=[];if(_0x579bc6[_0xd87a('0xa6')][_0xd87a('0x37')]>0x0){_0x579bc6[_0xd87a('0xa6')][_0xd87a('0xab')](function(_0xf721e7){if(_0xf721e7[_0xd87a('0xb9')]===_0xd87a('0xb7')){var _0x31b51b={'name':_0xf721e7[_0xd87a('0xad')],'value':_0xf721e7[_0xd87a('0xba')]};_0x43e22b['push'](_0x31b51b);}});}_0x596114[_0xd87a('0x3f')]=_0x43e22b;if(_0x596114[_0xd87a('0x3f')][_0xd87a('0x37')]>0x0){_0x327377(_0x596114);}else{if(_0x4855e4==![]){_0x327377();}else{_0x327377(_0x596114);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index f0e4c61..c8d770e 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 _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x578f34,_0x4b1866){var _0x1220d9=function(_0x5bbfd0){while(--_0x5bbfd0){_0x578f34['push'](_0x578f34['shift']());}};_0x1220d9(++_0x4b1866);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4992a7,_0x483cde){_0x4992a7=_0x4992a7-0x0;var _0x167311=_0x9c5a[_0x4992a7];return _0x167311;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x53ec,0x192));var _0xc53e=function(_0x5caabb,_0x2b0cc1){_0x5caabb=_0x5caabb-0x0;var _0x2929d8=_0x53ec[_0x5caabb];return _0x2929d8;};'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'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('ServicenowAccount',attributes,{'tableName':_0xc53e('0xb'),'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 ce6d407..6324243 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 _0x031b=['map','model','then','info','catch','ShowServicenowAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x031b,0x186));var _0xb031=function(_0x1386ef,_0x3e459d){_0x1386ef=_0x1386ef-0x0;var _0x8490be=_0x031b[_0x1386ef];return _0x8490be;};'use strict';var _=require(_0xb031('0x0'));var util=require(_0xb031('0x1'));var moment=require(_0xb031('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb031('0x3'));var db=require(_0xb031('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb031('0x5'))('rpc');var config=require(_0xb031('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb031('0x7')][_0xb031('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d3992,_0x7ff680,_0x146c16){return new BPromise(function(_0x35df98,_0x572fd7){return client['request'](_0x3d3992,_0x146c16)['then'](function(_0x4fd310){logger['info'](_0xb031('0x9'),_0x7ff680,_0xb031('0xa'));logger[_0xb031('0xb')](_0xb031('0xc'),_0x7ff680,_0xb031('0xa'),JSON[_0xb031('0xd')](_0x4fd310));if(_0x4fd310[_0xb031('0xe')]){if(_0x4fd310['error'][_0xb031('0xf')]===0x1f4){logger[_0xb031('0xe')](_0xb031('0x9'),_0x7ff680,_0x4fd310[_0xb031('0xe')]['message']);return _0x572fd7(_0x4fd310[_0xb031('0xe')][_0xb031('0x10')]);}logger[_0xb031('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x7ff680,_0x4fd310[_0xb031('0xe')]['message']);return _0x35df98(_0x4fd310[_0xb031('0xe')][_0xb031('0x10')]);}else{logger['info'](_0xb031('0x9'),_0x7ff680,_0xb031('0xa'));_0x35df98(_0x4fd310[_0xb031('0x11')][_0xb031('0x10')]);}})['catch'](function(_0x1e1940){logger[_0xb031('0xe')](_0xb031('0x9'),_0x7ff680,_0x1e1940);_0x572fd7(_0x1e1940);});});}exports[_0xb031('0x12')]=function(_0x16f1b5){var _0xc372d1=this;return new Promise(function(_0x4bba8a,_0x4263be){return db[_0xb031('0x13')]['findAll']({'raw':_0x16f1b5[_0xb031('0x14')]?_0x16f1b5['options'][_0xb031('0x15')]===undefined?!![]:![]:!![],'where':_0x16f1b5[_0xb031('0x14')]?_0x16f1b5[_0xb031('0x14')][_0xb031('0x16')]||null:null,'attributes':_0x16f1b5[_0xb031('0x14')]?_0x16f1b5[_0xb031('0x14')][_0xb031('0x17')]||null:null,'limit':_0x16f1b5[_0xb031('0x14')]?_0x16f1b5['options'][_0xb031('0x18')]||null:null,'include':_0x16f1b5[_0xb031('0x14')]?_0x16f1b5['options'][_0xb031('0x19')]?_[_0xb031('0x1a')](_0x16f1b5[_0xb031('0x14')][_0xb031('0x19')],function(_0x460021){return{'model':db[_0x460021[_0xb031('0x1b')]],'as':_0x460021['as'],'attributes':_0x460021[_0xb031('0x17')],'include':_0x460021[_0xb031('0x19')]?_['map'](_0x460021[_0xb031('0x19')],function(_0x49ab0c){return{'model':db[_0x49ab0c['model']],'as':_0x49ab0c['as'],'attributes':_0x49ab0c[_0xb031('0x17')],'include':_0x49ab0c[_0xb031('0x19')]?_[_0xb031('0x1a')](_0x49ab0c['include'],function(_0x35cd73){return{'model':db[_0x35cd73[_0xb031('0x1b')]],'as':_0x35cd73['as'],'attributes':_0x35cd73[_0xb031('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb031('0x1c')](function(_0x3d68be){logger[_0xb031('0x1d')](_0xb031('0x12'),_0x16f1b5);logger[_0xb031('0xb')]('GetServicenowAccount',_0x16f1b5,JSON[_0xb031('0xd')](_0x3d68be));_0x4bba8a(_0x3d68be);})[_0xb031('0x1e')](function(_0x544bdc){logger['error'](_0xb031('0x12'),_0x544bdc[_0xb031('0x10')],_0x16f1b5);_0x4263be(_0xc372d1[_0xb031('0xe')](0x1f4,_0x544bdc[_0xb031('0x10')]));});});};exports['ShowServicenowAccount']=function(_0x2099a1){var _0x5c2ccc=this;return new Promise(function(_0x37382c,_0x44f5c9){return db['ServicenowAccount']['find']({'raw':_0x2099a1[_0xb031('0x14')]?_0x2099a1[_0xb031('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2099a1[_0xb031('0x14')]?_0x2099a1['options']['where']||null:null,'attributes':_0x2099a1[_0xb031('0x14')]?_0x2099a1[_0xb031('0x14')][_0xb031('0x17')]||null:null,'include':_0x2099a1['options']?_0x2099a1['options'][_0xb031('0x19')]?_[_0xb031('0x1a')](_0x2099a1[_0xb031('0x14')][_0xb031('0x19')],function(_0x2427fd){return{'model':db[_0x2427fd[_0xb031('0x1b')]],'as':_0x2427fd['as'],'attributes':_0x2427fd[_0xb031('0x17')],'include':_0x2427fd['include']?_[_0xb031('0x1a')](_0x2427fd['include'],function(_0x2f0e98){return{'model':db[_0x2f0e98[_0xb031('0x1b')]],'as':_0x2f0e98['as'],'attributes':_0x2f0e98['attributes'],'include':_0x2f0e98['include']?_['map'](_0x2f0e98['include'],function(_0x222599){return{'model':db[_0x222599['model']],'as':_0x222599['as'],'attributes':_0x222599[_0xb031('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3efccc){logger[_0xb031('0x1d')](_0xb031('0x1f'),_0x2099a1);logger[_0xb031('0xb')](_0xb031('0x1f'),_0x2099a1,JSON[_0xb031('0xd')](_0x3efccc));_0x37382c(_0x3efccc);})[_0xb031('0x1e')](function(_0x3d1bd3){logger[_0xb031('0xe')](_0xb031('0x1f'),_0x3d1bd3[_0xb031('0x10')],_0x2099a1);_0x44f5c9(_0x5c2ccc[_0xb031('0xe')](0x1f4,_0x3d1bd3[_0xb031('0x10')]));});});}; \ No newline at end of file +var _0xbb88=['debug','request\x20sent','stringify','error','code','message','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','include','map','model','find','ShowServicenowAccount','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbb88,0x78));var _0x8bb8=function(_0x1b4cab,_0x133714){_0x1b4cab=_0x1b4cab-0x0;var _0x5189d3=_0xbb88[_0x1b4cab];return _0x5189d3;};'use strict';var _=require(_0x8bb8('0x0'));var util=require('util');var moment=require(_0x8bb8('0x1'));var BPromise=require(_0x8bb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bb8('0x3'));var db=require(_0x8bb8('0x4'))['db'];var utils=require(_0x8bb8('0x5'));var logger=require(_0x8bb8('0x6'))(_0x8bb8('0x7'));var config=require(_0x8bb8('0x8'));var jayson=require(_0x8bb8('0x9'));var client=jayson[_0x8bb8('0xa')][_0x8bb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d877f,_0x41da29,_0x54a9e8){return new BPromise(function(_0x47590f,_0x59e36e){return client[_0x8bb8('0xc')](_0x5d877f,_0x54a9e8)[_0x8bb8('0xd')](function(_0x46c064){logger[_0x8bb8('0xe')](_0x8bb8('0xf'),_0x41da29,'request\x20sent');logger[_0x8bb8('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x41da29,_0x8bb8('0x11'),JSON[_0x8bb8('0x12')](_0x46c064));if(_0x46c064[_0x8bb8('0x13')]){if(_0x46c064[_0x8bb8('0x13')][_0x8bb8('0x14')]===0x1f4){logger['error'](_0x8bb8('0xf'),_0x41da29,_0x46c064[_0x8bb8('0x13')][_0x8bb8('0x15')]);return _0x59e36e(_0x46c064[_0x8bb8('0x13')][_0x8bb8('0x15')]);}logger[_0x8bb8('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x41da29,_0x46c064['error'][_0x8bb8('0x15')]);return _0x47590f(_0x46c064[_0x8bb8('0x13')][_0x8bb8('0x15')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x41da29,'request\x20sent');_0x47590f(_0x46c064['result'][_0x8bb8('0x15')]);}})['catch'](function(_0x303ddc){logger[_0x8bb8('0x13')](_0x8bb8('0xf'),_0x41da29,_0x303ddc);_0x59e36e(_0x303ddc);});});}exports[_0x8bb8('0x16')]=function(_0x516121){var _0x17c15b=this;return new Promise(function(_0xbcdb20,_0x5000f8){return db[_0x8bb8('0x17')]['findAll']({'raw':_0x516121[_0x8bb8('0x18')]?_0x516121[_0x8bb8('0x18')][_0x8bb8('0x19')]===undefined?!![]:![]:!![],'where':_0x516121[_0x8bb8('0x18')]?_0x516121['options'][_0x8bb8('0x1a')]||null:null,'attributes':_0x516121[_0x8bb8('0x18')]?_0x516121[_0x8bb8('0x18')][_0x8bb8('0x1b')]||null:null,'limit':_0x516121[_0x8bb8('0x18')]?_0x516121[_0x8bb8('0x18')]['limit']||null:null,'include':_0x516121[_0x8bb8('0x18')]?_0x516121[_0x8bb8('0x18')][_0x8bb8('0x1c')]?_[_0x8bb8('0x1d')](_0x516121[_0x8bb8('0x18')][_0x8bb8('0x1c')],function(_0xcf7bc3){return{'model':db[_0xcf7bc3['model']],'as':_0xcf7bc3['as'],'attributes':_0xcf7bc3[_0x8bb8('0x1b')],'include':_0xcf7bc3[_0x8bb8('0x1c')]?_['map'](_0xcf7bc3[_0x8bb8('0x1c')],function(_0x219b37){return{'model':db[_0x219b37[_0x8bb8('0x1e')]],'as':_0x219b37['as'],'attributes':_0x219b37['attributes'],'include':_0x219b37[_0x8bb8('0x1c')]?_[_0x8bb8('0x1d')](_0x219b37[_0x8bb8('0x1c')],function(_0x325e53){return{'model':db[_0x325e53['model']],'as':_0x325e53['as'],'attributes':_0x325e53['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bb8('0xd')](function(_0x477ba2){logger[_0x8bb8('0xe')](_0x8bb8('0x16'),_0x516121);logger[_0x8bb8('0x10')](_0x8bb8('0x16'),_0x516121,JSON[_0x8bb8('0x12')](_0x477ba2));_0xbcdb20(_0x477ba2);})['catch'](function(_0x108b8d){logger[_0x8bb8('0x13')](_0x8bb8('0x16'),_0x108b8d['message'],_0x516121);_0x5000f8(_0x17c15b['error'](0x1f4,_0x108b8d[_0x8bb8('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x1cb868){var _0x3c068b=this;return new Promise(function(_0x1a782c,_0x2644fe){return db['ServicenowAccount'][_0x8bb8('0x1f')]({'raw':_0x1cb868['options']?_0x1cb868[_0x8bb8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1cb868[_0x8bb8('0x18')]?_0x1cb868[_0x8bb8('0x18')][_0x8bb8('0x1a')]||null:null,'attributes':_0x1cb868[_0x8bb8('0x18')]?_0x1cb868[_0x8bb8('0x18')]['attributes']||null:null,'include':_0x1cb868['options']?_0x1cb868['options'][_0x8bb8('0x1c')]?_[_0x8bb8('0x1d')](_0x1cb868[_0x8bb8('0x18')][_0x8bb8('0x1c')],function(_0x35ba6c){return{'model':db[_0x35ba6c['model']],'as':_0x35ba6c['as'],'attributes':_0x35ba6c['attributes'],'include':_0x35ba6c[_0x8bb8('0x1c')]?_[_0x8bb8('0x1d')](_0x35ba6c[_0x8bb8('0x1c')],function(_0x2d308e){return{'model':db[_0x2d308e['model']],'as':_0x2d308e['as'],'attributes':_0x2d308e[_0x8bb8('0x1b')],'include':_0x2d308e[_0x8bb8('0x1c')]?_['map'](_0x2d308e[_0x8bb8('0x1c')],function(_0x38ac8c){return{'model':db[_0x38ac8c['model']],'as':_0x38ac8c['as'],'attributes':_0x38ac8c[_0x8bb8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8bb8('0xd')](function(_0x23dc2d){logger[_0x8bb8('0xe')](_0x8bb8('0x20'),_0x1cb868);logger['debug'](_0x8bb8('0x20'),_0x1cb868,JSON['stringify'](_0x23dc2d));_0x1a782c(_0x23dc2d);})[_0x8bb8('0x21')](function(_0x414957){logger[_0x8bb8('0x13')](_0x8bb8('0x20'),_0x414957[_0x8bb8('0x15')],_0x1cb868);_0x2644fe(_0x3c068b[_0x8bb8('0x13')](0x1f4,_0x414957['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index fbcac73..6c396fd 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 _0x8fde=['/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getSubjects'];(function(_0x39249b,_0x95190){var _0x5bb65f=function(_0x40bfb3){while(--_0x40bfb3){_0x39249b['push'](_0x39249b['shift']());}};_0x5bb65f(++_0x95190);}(_0x8fde,0x1bd));var _0xe8fd=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x8fde[_0x3070dc];return _0x431489;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8fd('0x0'));var timeout=require(_0xe8fd('0x1'));var express=require(_0xe8fd('0x2'));var router=express[_0xe8fd('0x3')]();var fs_extra=require(_0xe8fd('0x4'));var auth=require(_0xe8fd('0x5'));var interaction=require(_0xe8fd('0x6'));var config=require('../../config/environment');var controller=require(_0xe8fd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8fd('0x8')]);router[_0xe8fd('0x9')](_0xe8fd('0xa'),auth['isAuthenticated'](),controller[_0xe8fd('0xb')]);router[_0xe8fd('0x9')](_0xe8fd('0xc'),auth[_0xe8fd('0xd')](),controller['getFields']);router[_0xe8fd('0x9')]('/:id/subjects',auth[_0xe8fd('0xd')](),controller[_0xe8fd('0xe')]);router['get'](_0xe8fd('0xf'),auth[_0xe8fd('0xd')](),controller[_0xe8fd('0x10')]);router[_0xe8fd('0x11')]('/',auth['isAuthenticated'](),controller[_0xe8fd('0x12')]);router[_0xe8fd('0x13')]('/:id',auth[_0xe8fd('0xd')](),controller[_0xe8fd('0x14')]);router['delete'](_0xe8fd('0xa'),auth[_0xe8fd('0xd')](),controller[_0xe8fd('0x15')]);module[_0xe8fd('0x16')]=router; \ No newline at end of file +var _0x271d=['getDescriptions','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions'];(function(_0x4409eb,_0x4589ee){var _0x3b7010=function(_0x14c49){while(--_0x14c49){_0x4409eb['push'](_0x4409eb['shift']());}};_0x3b7010(++_0x4589ee);}(_0x271d,0x1d6));var _0xd271=function(_0x3dc4ac,_0x5e8363){_0x3dc4ac=_0x3dc4ac-0x0;var _0x351114=_0x271d[_0x3dc4ac];return _0x351114;};'use strict';var multer=require('multer');var util=require(_0xd271('0x0'));var path=require(_0xd271('0x1'));var timeout=require(_0xd271('0x2'));var express=require(_0xd271('0x3'));var router=express[_0xd271('0x4')]();var fs_extra=require(_0xd271('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd271('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0xd271('0x7')]('/',auth[_0xd271('0x8')](),controller[_0xd271('0x9')]);router['get']('/:id',auth[_0xd271('0x8')](),controller[_0xd271('0xa')]);router['get']('/:id/fields',auth[_0xd271('0x8')](),controller[_0xd271('0xb')]);router[_0xd271('0x7')]('/:id/subjects',auth[_0xd271('0x8')](),controller[_0xd271('0xc')]);router['get'](_0xd271('0xd'),auth[_0xd271('0x8')](),controller[_0xd271('0xe')]);router[_0xd271('0xf')]('/',auth[_0xd271('0x8')](),controller[_0xd271('0x10')]);router[_0xd271('0x11')](_0xd271('0x12'),auth[_0xd271('0x8')](),controller[_0xd271('0x13')]);router['delete'](_0xd271('0x12'),auth[_0xd271('0x8')](),controller[_0xd271('0x14')]);module[_0xd271('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 3cf5c99..a47cb43 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 _0x9cd1=['sequelize','STRING'];(function(_0x33ac69,_0x4e428d){var _0x4715a7=function(_0x2d1077){while(--_0x2d1077){_0x33ac69['push'](_0x33ac69['shift']());}};_0x4715a7(++_0x4e428d);}(_0x9cd1,0x11c));var _0x19cd=function(_0x5034de,_0x1f010c){_0x5034de=_0x5034de-0x0;var _0x347e46=_0x9cd1[_0x5034de];return _0x347e46;};'use strict';var Sequelize=require(_0x19cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x19cd('0x1')]},'description':{'type':Sequelize[_0x19cd('0x1')]}}; \ No newline at end of file +var _0x9872=['STRING','sequelize','exports'];(function(_0x5d9938,_0x47929b){var _0x1d1f17=function(_0x23ac33){while(--_0x23ac33){_0x5d9938['push'](_0x5d9938['shift']());}};_0x1d1f17(++_0x47929b);}(_0x9872,0x199));var _0x2987=function(_0x466419,_0x25b982){_0x466419=_0x466419-0x0;var _0x312698=_0x9872[_0x466419];return _0x312698;};'use strict';var Sequelize=require(_0x2987('0x0'));module[_0x2987('0x1')]={'name':{'type':Sequelize[_0x2987('0x2')]},'description':{'type':Sequelize[_0x2987('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d4911de..f8874be 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 _0x5eaf=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','rawAttributes','keys','options','create','body','find','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring'];(function(_0x1f54f4,_0x3b19b3){var _0xb08144=function(_0xd1ae73){while(--_0xd1ae73){_0x1f54f4['push'](_0x1f54f4['shift']());}};_0xb08144(++_0x3b19b3);}(_0x5eaf,0x96));var _0xf5ea=function(_0x3da696,_0x53e7fe){_0x3da696=_0x3da696-0x0;var _0x25288d=_0x5eaf[_0x3da696];return _0x25288d;};'use strict';var emlformat=require(_0xf5ea('0x0'));var rimraf=require(_0xf5ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf5ea('0x2'));var BPromise=require(_0xf5ea('0x3'));var Mustache=require('mustache');var util=require(_0xf5ea('0x4'));var path=require(_0xf5ea('0x5'));var sox=require(_0xf5ea('0x6'));var csv=require(_0xf5ea('0x7'));var ejs=require(_0xf5ea('0x8'));var fs=require('fs');var fs_extra=require(_0xf5ea('0x9'));var _=require('lodash');var squel=require(_0xf5ea('0xa'));var crypto=require(_0xf5ea('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf5ea('0xc'));var toCsv=require(_0xf5ea('0x7'));var querystring=require(_0xf5ea('0xd'));var Papa=require(_0xf5ea('0xe'));var Redis=require(_0xf5ea('0xf'));var authService=require(_0xf5ea('0x10'));var qs=require(_0xf5ea('0x11'));var as=require(_0xf5ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5ea('0x13'))(_0xf5ea('0x14'));var utils=require(_0xf5ea('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5ea('0x16'));var db=require(_0xf5ea('0x17'))['db'];function respondWithStatusCode(_0x83cef9,_0xdd4760){_0xdd4760=_0xdd4760||0xcc;return function(_0x984b34){if(_0x984b34){return _0x83cef9[_0xf5ea('0x18')](_0xdd4760);}return _0x83cef9[_0xf5ea('0x19')](_0xdd4760)['end']();};}function respondWithResult(_0x216a89,_0x2a9047){_0x2a9047=_0x2a9047||0xc8;return function(_0x524ec4){if(_0x524ec4){return _0x216a89['status'](_0x2a9047)[_0xf5ea('0x1a')](_0x524ec4);}};}function respondWithFilteredResult(_0x468e24,_0x5b54d1){return function(_0x3a4c18){if(_0x3a4c18){var _0xdf8b6=typeof _0x5b54d1['offset']===_0xf5ea('0x1b')&&typeof _0x5b54d1[_0xf5ea('0x1c')]==='undefined';var _0x4ace45=_0x3a4c18[_0xf5ea('0x1d')];var _0x4bb25e=_0xdf8b6?0x0:_0x5b54d1['offset'];var _0x3ca41c=_0xdf8b6?_0x3a4c18['count']:_0x5b54d1[_0xf5ea('0x1e')]+_0x5b54d1['limit'];var _0xbbaad7;if(_0x3ca41c>=_0x4ace45){_0x3ca41c=_0x4ace45;_0xbbaad7=0xc8;}else{_0xbbaad7=0xce;}_0x468e24[_0xf5ea('0x19')](_0xbbaad7);return _0x468e24[_0xf5ea('0x1f')](_0xf5ea('0x20'),_0x4bb25e+'-'+_0x3ca41c+'/'+_0x4ace45)[_0xf5ea('0x1a')](_0x3a4c18);}return null;};}function patchUpdates(_0x513efc){return function(_0x384412){try{jsonpatch[_0xf5ea('0x21')](_0x384412,_0x513efc,!![]);}catch(_0x50809a){return BPromise[_0xf5ea('0x22')](_0x50809a);}return _0x384412[_0xf5ea('0x23')]();};}function saveUpdates(_0x264eb1,_0x171525){return function(_0xcc482){if(_0xcc482){return _0xcc482[_0xf5ea('0x24')](_0x264eb1)[_0xf5ea('0x25')](function(_0x35e30b){return _0x35e30b;});}return null;};}function removeEntity(_0x2508d9,_0xff6d6a){return function(_0x3a784a){if(_0x3a784a){return _0x3a784a[_0xf5ea('0x26')]()[_0xf5ea('0x25')](function(){_0x2508d9[_0xf5ea('0x19')](0xcc)[_0xf5ea('0x27')]();});}};}function handleEntityNotFound(_0x2fb7a3,_0x122a61){return function(_0x29c180){if(!_0x29c180){_0x2fb7a3[_0xf5ea('0x18')](0x194);}return _0x29c180;};}function handleError(_0x14e8bf,_0x23a756){_0x23a756=_0x23a756||0x1f4;return function(_0x521f38){logger['error'](_0x521f38[_0xf5ea('0x28')]);if(_0x521f38[_0xf5ea('0x29')]){delete _0x521f38[_0xf5ea('0x29')];}_0x14e8bf[_0xf5ea('0x19')](_0x23a756)[_0xf5ea('0x2a')](_0x521f38);};}exports[_0xf5ea('0x2b')]=function(_0x537436,_0x4b7041){var _0x3e1951={},_0x5d77b2={},_0x2fd988={'count':0x0,'rows':[]};var _0x39e177=_[_0xf5ea('0x2c')](db[_0xf5ea('0x2d')]['rawAttributes'],function(_0x1d97c7){return{'name':_0x1d97c7[_0xf5ea('0x2e')],'type':_0x1d97c7[_0xf5ea('0x2f')][_0xf5ea('0x30')]};});_0x5d77b2['model']=_[_0xf5ea('0x2c')](_0x39e177,_0xf5ea('0x29'));_0x5d77b2[_0xf5ea('0x31')]=_['keys'](_0x537436['query']);_0x5d77b2[_0xf5ea('0x32')]=_[_0xf5ea('0x33')](_0x5d77b2['model'],_0x5d77b2[_0xf5ea('0x31')]);_0x3e1951[_0xf5ea('0x34')]=_[_0xf5ea('0x33')](_0x5d77b2['model'],qs[_0xf5ea('0x35')](_0x537436[_0xf5ea('0x31')]['fields']));_0x3e1951[_0xf5ea('0x34')]=_0x3e1951[_0xf5ea('0x34')][_0xf5ea('0x36')]?_0x3e1951[_0xf5ea('0x34')]:_0x5d77b2[_0xf5ea('0x37')];if(!_0x537436[_0xf5ea('0x31')]['hasOwnProperty'](_0xf5ea('0x38'))){_0x3e1951[_0xf5ea('0x1c')]=qs[_0xf5ea('0x1c')](_0x537436[_0xf5ea('0x31')][_0xf5ea('0x1c')]);_0x3e1951['offset']=qs[_0xf5ea('0x1e')](_0x537436['query'][_0xf5ea('0x1e')]);}_0x3e1951[_0xf5ea('0x39')]=qs['sort'](_0x537436[_0xf5ea('0x31')][_0xf5ea('0x3a')]);_0x3e1951['where']=qs[_0xf5ea('0x32')](_[_0xf5ea('0x3b')](_0x537436[_0xf5ea('0x31')],_0x5d77b2['filters']),_0x39e177);if(_0x537436[_0xf5ea('0x31')][_0xf5ea('0x3c')]){_0x3e1951[_0xf5ea('0x3d')]=_['merge'](_0x3e1951[_0xf5ea('0x3d')],{'$or':_[_0xf5ea('0x2c')](_0x39e177,function(_0x3e69c1){if(_0x3e69c1[_0xf5ea('0x2f')]!==_0xf5ea('0x3e')){var _0x494212={};_0x494212[_0x3e69c1[_0xf5ea('0x29')]]={'$like':'%'+_0x537436[_0xf5ea('0x31')][_0xf5ea('0x3c')]+'%'};return _0x494212;}})});}_0x3e1951=_[_0xf5ea('0x3f')]({},_0x3e1951,_0x537436['options']);var _0x160274={'where':_0x3e1951[_0xf5ea('0x3d')]};return db[_0xf5ea('0x2d')][_0xf5ea('0x1d')](_0x160274)[_0xf5ea('0x25')](function(_0x367051){_0x2fd988[_0xf5ea('0x1d')]=_0x367051;if(_0x537436[_0xf5ea('0x31')][_0xf5ea('0x40')]){_0x3e1951[_0xf5ea('0x41')]=[{'all':!![]}];}return db[_0xf5ea('0x2d')][_0xf5ea('0x42')](_0x3e1951);})[_0xf5ea('0x25')](function(_0x2f577b){_0x2fd988['rows']=_0x2f577b;return _0x2fd988;})[_0xf5ea('0x25')](respondWithFilteredResult(_0x4b7041,_0x3e1951))[_0xf5ea('0x43')](handleError(_0x4b7041,null));};exports[_0xf5ea('0x44')]=function(_0x3a792a,_0x406b50){var _0x38a08d={'raw':![],'where':{'id':_0x3a792a[_0xf5ea('0x45')]['id']}},_0x6d4245={};_0x6d4245[_0xf5ea('0x37')]=_['keys'](db[_0xf5ea('0x2d')][_0xf5ea('0x46')]);_0x6d4245[_0xf5ea('0x31')]=_[_0xf5ea('0x47')](_0x3a792a[_0xf5ea('0x31')]);_0x6d4245['filters']=_[_0xf5ea('0x33')](_0x6d4245['model'],_0x6d4245[_0xf5ea('0x31')]);_0x38a08d[_0xf5ea('0x34')]=_[_0xf5ea('0x33')](_0x6d4245[_0xf5ea('0x37')],qs[_0xf5ea('0x35')](_0x3a792a[_0xf5ea('0x31')][_0xf5ea('0x35')]));_0x38a08d[_0xf5ea('0x34')]=_0x38a08d[_0xf5ea('0x34')]['length']?_0x38a08d[_0xf5ea('0x34')]:_0x6d4245[_0xf5ea('0x37')];if(_0x3a792a['query'][_0xf5ea('0x40')]){_0x38a08d[_0xf5ea('0x41')]=[{'all':!![]}];}_0x38a08d=_[_0xf5ea('0x3f')]({},_0x38a08d,_0x3a792a[_0xf5ea('0x48')]);return db[_0xf5ea('0x2d')]['find'](_0x38a08d)['then'](handleEntityNotFound(_0x406b50,null))[_0xf5ea('0x25')](respondWithResult(_0x406b50,null))[_0xf5ea('0x43')](handleError(_0x406b50,null));};exports[_0xf5ea('0x49')]=function(_0x10f530,_0x255f90){return db[_0xf5ea('0x2d')][_0xf5ea('0x49')](_0x10f530['body'],{})[_0xf5ea('0x25')](respondWithResult(_0x255f90,0xc9))[_0xf5ea('0x43')](handleError(_0x255f90,null));};exports[_0xf5ea('0x24')]=function(_0x53ff92,_0x9a6a9e){if(_0x53ff92[_0xf5ea('0x4a')]['id']){delete _0x53ff92[_0xf5ea('0x4a')]['id'];}return db[_0xf5ea('0x2d')][_0xf5ea('0x4b')]({'where':{'id':_0x53ff92[_0xf5ea('0x45')]['id']}})[_0xf5ea('0x25')](handleEntityNotFound(_0x9a6a9e,null))[_0xf5ea('0x25')](saveUpdates(_0x53ff92[_0xf5ea('0x4a')],null))[_0xf5ea('0x25')](respondWithResult(_0x9a6a9e,null))[_0xf5ea('0x43')](handleError(_0x9a6a9e,null));};exports[_0xf5ea('0x26')]=function(_0x47b4d7,_0x31eb05){return db[_0xf5ea('0x2d')]['find']({'where':{'id':_0x47b4d7['params']['id']}})['then'](handleEntityNotFound(_0x31eb05,null))[_0xf5ea('0x25')](removeEntity(_0x31eb05,null))[_0xf5ea('0x43')](handleError(_0x31eb05,null));};exports[_0xf5ea('0x4c')]=function(_0x33c691,_0x4d637c,_0x5d2b6a){var _0x4fe7b0={};var _0xee5abe={};var _0x249ab0;var _0x58ea3f;return db[_0xf5ea('0x2d')][_0xf5ea('0x4d')]({'where':{'id':_0x33c691[_0xf5ea('0x45')]['id']}})[_0xf5ea('0x25')](handleEntityNotFound(_0x4d637c,null))[_0xf5ea('0x25')](function(_0x37cb19){if(_0x37cb19){_0x249ab0=_0x37cb19;_0xee5abe['model']=_[_0xf5ea('0x47')](db[_0xf5ea('0x4e')][_0xf5ea('0x46')]);_0xee5abe[_0xf5ea('0x31')]=_[_0xf5ea('0x47')](_0x33c691[_0xf5ea('0x31')]);_0xee5abe[_0xf5ea('0x32')]=_[_0xf5ea('0x33')](_0xee5abe['model'],_0xee5abe[_0xf5ea('0x31')]);_0x4fe7b0['attributes']=_[_0xf5ea('0x33')](_0xee5abe[_0xf5ea('0x37')],qs[_0xf5ea('0x35')](_0x33c691[_0xf5ea('0x31')][_0xf5ea('0x35')]));_0x4fe7b0['attributes']=_0x4fe7b0[_0xf5ea('0x34')][_0xf5ea('0x36')]?_0x4fe7b0[_0xf5ea('0x34')]:_0xee5abe[_0xf5ea('0x37')];_0x4fe7b0[_0xf5ea('0x39')]=qs[_0xf5ea('0x3a')](_0x33c691[_0xf5ea('0x31')][_0xf5ea('0x3a')]);_0x4fe7b0['where']=qs[_0xf5ea('0x32')](_['pick'](_0x33c691['query'],_0xee5abe['filters']));if(_0x33c691['query'][_0xf5ea('0x3c')]){_0x4fe7b0[_0xf5ea('0x3d')]=_[_0xf5ea('0x3f')](_0x4fe7b0[_0xf5ea('0x3d')],{'$or':_[_0xf5ea('0x2c')](_0x4fe7b0[_0xf5ea('0x34')],function(_0x5e85f5){var _0x21ed18={};_0x21ed18[_0x5e85f5]={'$like':'%'+_0x33c691[_0xf5ea('0x31')][_0xf5ea('0x3c')]+'%'};return _0x21ed18;})});}_0x4fe7b0=_[_0xf5ea('0x3f')]({},_0x4fe7b0,_0x33c691[_0xf5ea('0x48')]);return _0x249ab0[_0xf5ea('0x4c')](_0x4fe7b0);}})[_0xf5ea('0x25')](function(_0x31e768){if(_0x31e768){_0x58ea3f=_0x31e768[_0xf5ea('0x36')];if(!_0x33c691['query'][_0xf5ea('0x4f')](_0xf5ea('0x38'))){_0x4fe7b0['limit']=qs['limit'](_0x33c691[_0xf5ea('0x31')][_0xf5ea('0x1c')]);_0x4fe7b0['offset']=qs[_0xf5ea('0x1e')](_0x33c691['query'][_0xf5ea('0x1e')]);}return _0x249ab0[_0xf5ea('0x4c')](_0x4fe7b0);}})[_0xf5ea('0x25')](function(_0x35d764){if(_0x35d764){return _0x35d764?{'count':_0x58ea3f,'rows':_0x35d764}:null;}})[_0xf5ea('0x25')](respondWithResult(_0x4d637c,null))[_0xf5ea('0x43')](handleError(_0x4d637c,null));};exports['getSubjects']=function(_0x3d800c,_0x5c826d,_0x360872){var _0x270f96={};var _0x4bfb43={};var _0x449c4d;var _0x329d6d;return db[_0xf5ea('0x2d')][_0xf5ea('0x4d')]({'where':{'id':_0x3d800c[_0xf5ea('0x45')]['id']}})[_0xf5ea('0x25')](handleEntityNotFound(_0x5c826d,null))['then'](function(_0x5c17dd){if(_0x5c17dd){_0x449c4d=_0x5c17dd;_0x4bfb43['model']=_['keys'](db[_0xf5ea('0x4e')]['rawAttributes']);_0x4bfb43[_0xf5ea('0x31')]=_['keys'](_0x3d800c[_0xf5ea('0x31')]);_0x4bfb43['filters']=_[_0xf5ea('0x33')](_0x4bfb43[_0xf5ea('0x37')],_0x4bfb43[_0xf5ea('0x31')]);_0x270f96[_0xf5ea('0x34')]=_[_0xf5ea('0x33')](_0x4bfb43[_0xf5ea('0x37')],qs['fields'](_0x3d800c['query'][_0xf5ea('0x35')]));_0x270f96[_0xf5ea('0x34')]=_0x270f96[_0xf5ea('0x34')][_0xf5ea('0x36')]?_0x270f96['attributes']:_0x4bfb43[_0xf5ea('0x37')];_0x270f96[_0xf5ea('0x39')]=qs[_0xf5ea('0x3a')](_0x3d800c[_0xf5ea('0x31')][_0xf5ea('0x3a')]);_0x270f96[_0xf5ea('0x3d')]=qs['filters'](_[_0xf5ea('0x3b')](_0x3d800c[_0xf5ea('0x31')],_0x4bfb43[_0xf5ea('0x32')]));if(_0x3d800c[_0xf5ea('0x31')][_0xf5ea('0x3c')]){_0x270f96[_0xf5ea('0x3d')]=_[_0xf5ea('0x3f')](_0x270f96[_0xf5ea('0x3d')],{'$or':_[_0xf5ea('0x2c')](_0x270f96[_0xf5ea('0x34')],function(_0x5f3d70){var _0x26cde7={};_0x26cde7[_0x5f3d70]={'$like':'%'+_0x3d800c[_0xf5ea('0x31')][_0xf5ea('0x3c')]+'%'};return _0x26cde7;})});}_0x270f96=_['merge']({},_0x270f96,_0x3d800c[_0xf5ea('0x48')]);return _0x449c4d['getSubjects'](_0x270f96);}})[_0xf5ea('0x25')](function(_0x395b81){if(_0x395b81){_0x329d6d=_0x395b81[_0xf5ea('0x36')];if(!_0x3d800c[_0xf5ea('0x31')][_0xf5ea('0x4f')](_0xf5ea('0x38'))){_0x270f96[_0xf5ea('0x1c')]=qs['limit'](_0x3d800c['query'][_0xf5ea('0x1c')]);_0x270f96['offset']=qs[_0xf5ea('0x1e')](_0x3d800c[_0xf5ea('0x31')][_0xf5ea('0x1e')]);}return _0x449c4d[_0xf5ea('0x50')](_0x270f96);}})['then'](function(_0x55aecf){if(_0x55aecf){return _0x55aecf?{'count':_0x329d6d,'rows':_0x55aecf}:null;}})['then'](respondWithResult(_0x5c826d,null))['catch'](handleError(_0x5c826d,null));};exports[_0xf5ea('0x51')]=function(_0x4c7066,_0x479eaa,_0x103c9e){var _0x456bce={};var _0x246114={};var _0x40c7c6;var _0x579e73;return db[_0xf5ea('0x2d')][_0xf5ea('0x4d')]({'where':{'id':_0x4c7066[_0xf5ea('0x45')]['id']}})[_0xf5ea('0x25')](handleEntityNotFound(_0x479eaa,null))[_0xf5ea('0x25')](function(_0x3cf17d){if(_0x3cf17d){_0x40c7c6=_0x3cf17d;_0x246114[_0xf5ea('0x37')]=_['keys'](db['ServicenowField'][_0xf5ea('0x46')]);_0x246114[_0xf5ea('0x31')]=_[_0xf5ea('0x47')](_0x4c7066[_0xf5ea('0x31')]);_0x246114[_0xf5ea('0x32')]=_[_0xf5ea('0x33')](_0x246114[_0xf5ea('0x37')],_0x246114[_0xf5ea('0x31')]);_0x456bce[_0xf5ea('0x34')]=_[_0xf5ea('0x33')](_0x246114['model'],qs['fields'](_0x4c7066[_0xf5ea('0x31')][_0xf5ea('0x35')]));_0x456bce[_0xf5ea('0x34')]=_0x456bce['attributes'][_0xf5ea('0x36')]?_0x456bce[_0xf5ea('0x34')]:_0x246114['model'];_0x456bce['order']=qs[_0xf5ea('0x3a')](_0x4c7066[_0xf5ea('0x31')][_0xf5ea('0x3a')]);_0x456bce['where']=qs[_0xf5ea('0x32')](_['pick'](_0x4c7066['query'],_0x246114[_0xf5ea('0x32')]));if(_0x4c7066['query']['filter']){_0x456bce[_0xf5ea('0x3d')]=_[_0xf5ea('0x3f')](_0x456bce['where'],{'$or':_[_0xf5ea('0x2c')](_0x456bce[_0xf5ea('0x34')],function(_0x1ac5e6){var _0x45d6ef={};_0x45d6ef[_0x1ac5e6]={'$like':'%'+_0x4c7066[_0xf5ea('0x31')]['filter']+'%'};return _0x45d6ef;})});}_0x456bce=_[_0xf5ea('0x3f')]({},_0x456bce,_0x4c7066[_0xf5ea('0x48')]);return _0x40c7c6[_0xf5ea('0x51')](_0x456bce);}})[_0xf5ea('0x25')](function(_0x493e18){if(_0x493e18){_0x579e73=_0x493e18[_0xf5ea('0x36')];if(!_0x4c7066['query']['hasOwnProperty'](_0xf5ea('0x38'))){_0x456bce[_0xf5ea('0x1c')]=qs[_0xf5ea('0x1c')](_0x4c7066[_0xf5ea('0x31')][_0xf5ea('0x1c')]);_0x456bce['offset']=qs[_0xf5ea('0x1e')](_0x4c7066[_0xf5ea('0x31')][_0xf5ea('0x1e')]);}return _0x40c7c6[_0xf5ea('0x51')](_0x456bce);}})[_0xf5ea('0x25')](function(_0x6e3115){if(_0x6e3115){return _0x6e3115?{'count':_0x579e73,'rows':_0x6e3115}:null;}})[_0xf5ea('0x25')](respondWithResult(_0x479eaa,null))[_0xf5ea('0x43')](handleError(_0x479eaa,null));}; \ No newline at end of file +var _0x005c=['destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','then'];(function(_0x530bc2,_0x365baa){var _0x43c080=function(_0x185f47){while(--_0x185f47){_0x530bc2['push'](_0x530bc2['shift']());}};_0x43c080(++_0x365baa);}(_0x005c,0x7e));var _0xc005=function(_0x3e4b6f,_0x269661){_0x3e4b6f=_0x3e4b6f-0x0;var _0x3d71a7=_0x005c[_0x3e4b6f];return _0x3d71a7;};'use strict';var emlformat=require(_0xc005('0x0'));var rimraf=require(_0xc005('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc005('0x2'));var moment=require(_0xc005('0x3'));var BPromise=require(_0xc005('0x4'));var Mustache=require(_0xc005('0x5'));var util=require('util');var path=require(_0xc005('0x6'));var sox=require(_0xc005('0x7'));var csv=require(_0xc005('0x8'));var ejs=require(_0xc005('0x9'));var fs=require('fs');var fs_extra=require(_0xc005('0xa'));var _=require(_0xc005('0xb'));var squel=require(_0xc005('0xc'));var crypto=require(_0xc005('0xd'));var jsforce=require(_0xc005('0xe'));var deskjs=require(_0xc005('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc005('0x10'));var Redis=require(_0xc005('0x11'));var authService=require(_0xc005('0x12'));var qs=require(_0xc005('0x13'));var as=require(_0xc005('0x14'));var hardwareService=require(_0xc005('0x15'));var logger=require(_0xc005('0x16'))('api');var utils=require(_0xc005('0x17'));var config=require(_0xc005('0x18'));var licenseUtil=require(_0xc005('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bd893,_0x359de2){_0x359de2=_0x359de2||0xcc;return function(_0x5868d5){if(_0x5868d5){return _0x4bd893[_0xc005('0x1a')](_0x359de2);}return _0x4bd893[_0xc005('0x1b')](_0x359de2)[_0xc005('0x1c')]();};}function respondWithResult(_0xebbea1,_0x4c1b59){_0x4c1b59=_0x4c1b59||0xc8;return function(_0x535289){if(_0x535289){return _0xebbea1[_0xc005('0x1b')](_0x4c1b59)[_0xc005('0x1d')](_0x535289);}};}function respondWithFilteredResult(_0x19d81d,_0x377918){return function(_0x167ffc){if(_0x167ffc){var _0x57bf96=typeof _0x377918['offset']===_0xc005('0x1e')&&typeof _0x377918[_0xc005('0x1f')]==='undefined';var _0x27e555=_0x167ffc[_0xc005('0x20')];var _0x180652=_0x57bf96?0x0:_0x377918['offset'];var _0x4d9267=_0x57bf96?_0x167ffc[_0xc005('0x20')]:_0x377918[_0xc005('0x21')]+_0x377918[_0xc005('0x1f')];var _0x45a7c0;if(_0x4d9267>=_0x27e555){_0x4d9267=_0x27e555;_0x45a7c0=0xc8;}else{_0x45a7c0=0xce;}_0x19d81d[_0xc005('0x1b')](_0x45a7c0);return _0x19d81d[_0xc005('0x22')]('Content-Range',_0x180652+'-'+_0x4d9267+'/'+_0x27e555)[_0xc005('0x1d')](_0x167ffc);}return null;};}function patchUpdates(_0x50d5cd){return function(_0x8db262){try{jsonpatch[_0xc005('0x23')](_0x8db262,_0x50d5cd,!![]);}catch(_0x592f33){return BPromise['reject'](_0x592f33);}return _0x8db262[_0xc005('0x24')]();};}function saveUpdates(_0x3bfa48,_0x1ba0bb){return function(_0x139e28){if(_0x139e28){return _0x139e28['update'](_0x3bfa48)[_0xc005('0x25')](function(_0x3566b1){return _0x3566b1;});}return null;};}function removeEntity(_0x5e949a,_0x1bf75e){return function(_0x3c1a94){if(_0x3c1a94){return _0x3c1a94[_0xc005('0x26')]()[_0xc005('0x25')](function(){_0x5e949a[_0xc005('0x1b')](0xcc)[_0xc005('0x1c')]();});}};}function handleEntityNotFound(_0x32a826,_0x453e2f){return function(_0x151ad8){if(!_0x151ad8){_0x32a826['sendStatus'](0x194);}return _0x151ad8;};}function handleError(_0x56e747,_0x39daa7){_0x39daa7=_0x39daa7||0x1f4;return function(_0x3e7a9f){logger[_0xc005('0x27')](_0x3e7a9f[_0xc005('0x28')]);if(_0x3e7a9f[_0xc005('0x29')]){delete _0x3e7a9f[_0xc005('0x29')];}_0x56e747['status'](_0x39daa7)[_0xc005('0x2a')](_0x3e7a9f);};}exports[_0xc005('0x2b')]=function(_0x5ea87b,_0xd5d987){var _0x412e24={},_0x244a20={},_0x4c8ec6={'count':0x0,'rows':[]};var _0x4af606=_[_0xc005('0x2c')](db[_0xc005('0x2d')][_0xc005('0x2e')],function(_0x202bde){return{'name':_0x202bde[_0xc005('0x2f')],'type':_0x202bde[_0xc005('0x30')][_0xc005('0x31')]};});_0x244a20[_0xc005('0x32')]=_[_0xc005('0x2c')](_0x4af606,'name');_0x244a20[_0xc005('0x33')]=_['keys'](_0x5ea87b[_0xc005('0x33')]);_0x244a20['filters']=_['intersection'](_0x244a20[_0xc005('0x32')],_0x244a20[_0xc005('0x33')]);_0x412e24[_0xc005('0x34')]=_[_0xc005('0x35')](_0x244a20['model'],qs[_0xc005('0x36')](_0x5ea87b[_0xc005('0x33')][_0xc005('0x36')]));_0x412e24['attributes']=_0x412e24['attributes']['length']?_0x412e24[_0xc005('0x34')]:_0x244a20['model'];if(!_0x5ea87b['query'][_0xc005('0x37')](_0xc005('0x38'))){_0x412e24['limit']=qs[_0xc005('0x1f')](_0x5ea87b[_0xc005('0x33')][_0xc005('0x1f')]);_0x412e24[_0xc005('0x21')]=qs[_0xc005('0x21')](_0x5ea87b['query'][_0xc005('0x21')]);}_0x412e24[_0xc005('0x39')]=qs[_0xc005('0x3a')](_0x5ea87b[_0xc005('0x33')][_0xc005('0x3a')]);_0x412e24[_0xc005('0x3b')]=qs[_0xc005('0x3c')](_[_0xc005('0x3d')](_0x5ea87b[_0xc005('0x33')],_0x244a20[_0xc005('0x3c')]),_0x4af606);if(_0x5ea87b[_0xc005('0x33')][_0xc005('0x3e')]){_0x412e24[_0xc005('0x3b')]=_[_0xc005('0x3f')](_0x412e24[_0xc005('0x3b')],{'$or':_[_0xc005('0x2c')](_0x4af606,function(_0x51c801){if(_0x51c801[_0xc005('0x30')]!==_0xc005('0x40')){var _0x50786d={};_0x50786d[_0x51c801[_0xc005('0x29')]]={'$like':'%'+_0x5ea87b[_0xc005('0x33')][_0xc005('0x3e')]+'%'};return _0x50786d;}})});}_0x412e24=_[_0xc005('0x3f')]({},_0x412e24,_0x5ea87b[_0xc005('0x41')]);var _0x183ab3={'where':_0x412e24[_0xc005('0x3b')]};return db[_0xc005('0x2d')][_0xc005('0x20')](_0x183ab3)['then'](function(_0x6c6085){_0x4c8ec6[_0xc005('0x20')]=_0x6c6085;if(_0x5ea87b[_0xc005('0x33')][_0xc005('0x42')]){_0x412e24[_0xc005('0x43')]=[{'all':!![]}];}return db[_0xc005('0x2d')][_0xc005('0x44')](_0x412e24);})[_0xc005('0x25')](function(_0x2aceb2){_0x4c8ec6['rows']=_0x2aceb2;return _0x4c8ec6;})['then'](respondWithFilteredResult(_0xd5d987,_0x412e24))[_0xc005('0x45')](handleError(_0xd5d987,null));};exports[_0xc005('0x46')]=function(_0x12eedb,_0x4be583){var _0x49fa72={'raw':![],'where':{'id':_0x12eedb['params']['id']}},_0x43c5fd={};_0x43c5fd['model']=_[_0xc005('0x47')](db[_0xc005('0x2d')]['rawAttributes']);_0x43c5fd['query']=_[_0xc005('0x47')](_0x12eedb['query']);_0x43c5fd[_0xc005('0x3c')]=_['intersection'](_0x43c5fd[_0xc005('0x32')],_0x43c5fd['query']);_0x49fa72['attributes']=_[_0xc005('0x35')](_0x43c5fd[_0xc005('0x32')],qs['fields'](_0x12eedb[_0xc005('0x33')][_0xc005('0x36')]));_0x49fa72[_0xc005('0x34')]=_0x49fa72[_0xc005('0x34')][_0xc005('0x48')]?_0x49fa72[_0xc005('0x34')]:_0x43c5fd[_0xc005('0x32')];if(_0x12eedb[_0xc005('0x33')][_0xc005('0x42')]){_0x49fa72[_0xc005('0x43')]=[{'all':!![]}];}_0x49fa72=_[_0xc005('0x3f')]({},_0x49fa72,_0x12eedb[_0xc005('0x41')]);return db['ServicenowConfiguration'][_0xc005('0x49')](_0x49fa72)['then'](handleEntityNotFound(_0x4be583,null))['then'](respondWithResult(_0x4be583,null))[_0xc005('0x45')](handleError(_0x4be583,null));};exports[_0xc005('0x4a')]=function(_0x2e0f42,_0x4babb8){return db[_0xc005('0x2d')][_0xc005('0x4a')](_0x2e0f42['body'],{})['then'](respondWithResult(_0x4babb8,0xc9))[_0xc005('0x45')](handleError(_0x4babb8,null));};exports['update']=function(_0x32c8e3,_0x5b0743){if(_0x32c8e3['body']['id']){delete _0x32c8e3[_0xc005('0x4b')]['id'];}return db[_0xc005('0x2d')][_0xc005('0x49')]({'where':{'id':_0x32c8e3['params']['id']}})['then'](handleEntityNotFound(_0x5b0743,null))[_0xc005('0x25')](saveUpdates(_0x32c8e3['body'],null))['then'](respondWithResult(_0x5b0743,null))[_0xc005('0x45')](handleError(_0x5b0743,null));};exports[_0xc005('0x26')]=function(_0x3c8c5d,_0x745602){return db[_0xc005('0x2d')]['find']({'where':{'id':_0x3c8c5d[_0xc005('0x4c')]['id']}})[_0xc005('0x25')](handleEntityNotFound(_0x745602,null))[_0xc005('0x25')](removeEntity(_0x745602,null))[_0xc005('0x45')](handleError(_0x745602,null));};exports['getFields']=function(_0x60ab47,_0x74e908,_0x5448e2){var _0xbab2ed={};var _0x111e96={};var _0x2d3fe7;var _0x5118db;return db[_0xc005('0x2d')][_0xc005('0x4d')]({'where':{'id':_0x60ab47[_0xc005('0x4c')]['id']}})[_0xc005('0x25')](handleEntityNotFound(_0x74e908,null))['then'](function(_0x2f8243){if(_0x2f8243){_0x2d3fe7=_0x2f8243;_0x111e96[_0xc005('0x32')]=_['keys'](db[_0xc005('0x4e')]['rawAttributes']);_0x111e96[_0xc005('0x33')]=_['keys'](_0x60ab47[_0xc005('0x33')]);_0x111e96[_0xc005('0x3c')]=_[_0xc005('0x35')](_0x111e96[_0xc005('0x32')],_0x111e96[_0xc005('0x33')]);_0xbab2ed[_0xc005('0x34')]=_[_0xc005('0x35')](_0x111e96['model'],qs[_0xc005('0x36')](_0x60ab47[_0xc005('0x33')][_0xc005('0x36')]));_0xbab2ed[_0xc005('0x34')]=_0xbab2ed[_0xc005('0x34')][_0xc005('0x48')]?_0xbab2ed[_0xc005('0x34')]:_0x111e96[_0xc005('0x32')];_0xbab2ed[_0xc005('0x39')]=qs['sort'](_0x60ab47[_0xc005('0x33')][_0xc005('0x3a')]);_0xbab2ed['where']=qs[_0xc005('0x3c')](_['pick'](_0x60ab47[_0xc005('0x33')],_0x111e96[_0xc005('0x3c')]));if(_0x60ab47[_0xc005('0x33')][_0xc005('0x3e')]){_0xbab2ed['where']=_[_0xc005('0x3f')](_0xbab2ed[_0xc005('0x3b')],{'$or':_[_0xc005('0x2c')](_0xbab2ed['attributes'],function(_0x9730c4){var _0x4cc775={};_0x4cc775[_0x9730c4]={'$like':'%'+_0x60ab47['query'][_0xc005('0x3e')]+'%'};return _0x4cc775;})});}_0xbab2ed=_['merge']({},_0xbab2ed,_0x60ab47[_0xc005('0x41')]);return _0x2d3fe7[_0xc005('0x4f')](_0xbab2ed);}})[_0xc005('0x25')](function(_0x4e42fd){if(_0x4e42fd){_0x5118db=_0x4e42fd['length'];if(!_0x60ab47[_0xc005('0x33')][_0xc005('0x37')]('nolimit')){_0xbab2ed[_0xc005('0x1f')]=qs[_0xc005('0x1f')](_0x60ab47[_0xc005('0x33')][_0xc005('0x1f')]);_0xbab2ed[_0xc005('0x21')]=qs[_0xc005('0x21')](_0x60ab47[_0xc005('0x33')][_0xc005('0x21')]);}return _0x2d3fe7[_0xc005('0x4f')](_0xbab2ed);}})[_0xc005('0x25')](function(_0x255f7f){if(_0x255f7f){return _0x255f7f?{'count':_0x5118db,'rows':_0x255f7f}:null;}})[_0xc005('0x25')](respondWithResult(_0x74e908,null))[_0xc005('0x45')](handleError(_0x74e908,null));};exports['getSubjects']=function(_0x5470c4,_0x5ec6fd,_0x3271d3){var _0x573c98={};var _0x119e04={};var _0x4cf724;var _0x13c311;return db[_0xc005('0x2d')][_0xc005('0x4d')]({'where':{'id':_0x5470c4['params']['id']}})['then'](handleEntityNotFound(_0x5ec6fd,null))[_0xc005('0x25')](function(_0x34869a){if(_0x34869a){_0x4cf724=_0x34869a;_0x119e04['model']=_[_0xc005('0x47')](db[_0xc005('0x4e')]['rawAttributes']);_0x119e04[_0xc005('0x33')]=_['keys'](_0x5470c4[_0xc005('0x33')]);_0x119e04[_0xc005('0x3c')]=_['intersection'](_0x119e04[_0xc005('0x32')],_0x119e04[_0xc005('0x33')]);_0x573c98['attributes']=_['intersection'](_0x119e04[_0xc005('0x32')],qs[_0xc005('0x36')](_0x5470c4[_0xc005('0x33')]['fields']));_0x573c98['attributes']=_0x573c98[_0xc005('0x34')][_0xc005('0x48')]?_0x573c98[_0xc005('0x34')]:_0x119e04[_0xc005('0x32')];_0x573c98['order']=qs[_0xc005('0x3a')](_0x5470c4[_0xc005('0x33')]['sort']);_0x573c98['where']=qs['filters'](_[_0xc005('0x3d')](_0x5470c4[_0xc005('0x33')],_0x119e04[_0xc005('0x3c')]));if(_0x5470c4[_0xc005('0x33')]['filter']){_0x573c98[_0xc005('0x3b')]=_[_0xc005('0x3f')](_0x573c98[_0xc005('0x3b')],{'$or':_['map'](_0x573c98[_0xc005('0x34')],function(_0x21d5b7){var _0x27be77={};_0x27be77[_0x21d5b7]={'$like':'%'+_0x5470c4[_0xc005('0x33')][_0xc005('0x3e')]+'%'};return _0x27be77;})});}_0x573c98=_[_0xc005('0x3f')]({},_0x573c98,_0x5470c4[_0xc005('0x41')]);return _0x4cf724[_0xc005('0x50')](_0x573c98);}})['then'](function(_0x3224e1){if(_0x3224e1){_0x13c311=_0x3224e1[_0xc005('0x48')];if(!_0x5470c4[_0xc005('0x33')][_0xc005('0x37')](_0xc005('0x38'))){_0x573c98['limit']=qs[_0xc005('0x1f')](_0x5470c4['query']['limit']);_0x573c98[_0xc005('0x21')]=qs[_0xc005('0x21')](_0x5470c4[_0xc005('0x33')][_0xc005('0x21')]);}return _0x4cf724[_0xc005('0x50')](_0x573c98);}})['then'](function(_0x594b38){if(_0x594b38){return _0x594b38?{'count':_0x13c311,'rows':_0x594b38}:null;}})[_0xc005('0x25')](respondWithResult(_0x5ec6fd,null))[_0xc005('0x45')](handleError(_0x5ec6fd,null));};exports[_0xc005('0x51')]=function(_0x2a8447,_0xc52fe,_0x116946){var _0xb88b37={};var _0x2e3f9b={};var _0x3a2b6c;var _0x521d88;return db[_0xc005('0x2d')][_0xc005('0x4d')]({'where':{'id':_0x2a8447['params']['id']}})[_0xc005('0x25')](handleEntityNotFound(_0xc52fe,null))[_0xc005('0x25')](function(_0x19bc42){if(_0x19bc42){_0x3a2b6c=_0x19bc42;_0x2e3f9b[_0xc005('0x32')]=_[_0xc005('0x47')](db[_0xc005('0x4e')][_0xc005('0x2e')]);_0x2e3f9b[_0xc005('0x33')]=_[_0xc005('0x47')](_0x2a8447[_0xc005('0x33')]);_0x2e3f9b[_0xc005('0x3c')]=_[_0xc005('0x35')](_0x2e3f9b['model'],_0x2e3f9b[_0xc005('0x33')]);_0xb88b37[_0xc005('0x34')]=_['intersection'](_0x2e3f9b[_0xc005('0x32')],qs['fields'](_0x2a8447[_0xc005('0x33')][_0xc005('0x36')]));_0xb88b37[_0xc005('0x34')]=_0xb88b37[_0xc005('0x34')][_0xc005('0x48')]?_0xb88b37['attributes']:_0x2e3f9b[_0xc005('0x32')];_0xb88b37[_0xc005('0x39')]=qs[_0xc005('0x3a')](_0x2a8447[_0xc005('0x33')]['sort']);_0xb88b37[_0xc005('0x3b')]=qs[_0xc005('0x3c')](_['pick'](_0x2a8447[_0xc005('0x33')],_0x2e3f9b[_0xc005('0x3c')]));if(_0x2a8447[_0xc005('0x33')][_0xc005('0x3e')]){_0xb88b37['where']=_['merge'](_0xb88b37[_0xc005('0x3b')],{'$or':_[_0xc005('0x2c')](_0xb88b37[_0xc005('0x34')],function(_0x1c46cb){var _0x224e84={};_0x224e84[_0x1c46cb]={'$like':'%'+_0x2a8447[_0xc005('0x33')][_0xc005('0x3e')]+'%'};return _0x224e84;})});}_0xb88b37=_[_0xc005('0x3f')]({},_0xb88b37,_0x2a8447[_0xc005('0x41')]);return _0x3a2b6c[_0xc005('0x51')](_0xb88b37);}})[_0xc005('0x25')](function(_0x4915ae){if(_0x4915ae){_0x521d88=_0x4915ae[_0xc005('0x48')];if(!_0x2a8447[_0xc005('0x33')][_0xc005('0x37')](_0xc005('0x38'))){_0xb88b37[_0xc005('0x1f')]=qs[_0xc005('0x1f')](_0x2a8447[_0xc005('0x33')]['limit']);_0xb88b37[_0xc005('0x21')]=qs[_0xc005('0x21')](_0x2a8447[_0xc005('0x33')][_0xc005('0x21')]);}return _0x3a2b6c[_0xc005('0x51')](_0xb88b37);}})[_0xc005('0x25')](function(_0x1bc374){if(_0x1bc374){return _0x1bc374?{'count':_0x521d88,'rows':_0x1bc374}:null;}})[_0xc005('0x25')](respondWithResult(_0xc52fe,null))[_0xc005('0x45')](handleError(_0xc52fe,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b992f89..2b7cfd6 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 _0x7cd6=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x576357,_0x4b7bb9){_0x576357=_0x576357-0x0;var _0x55cbdf=_0x7cd6[_0x576357];return _0x55cbdf;};'use strict';var _=require(_0x67cd('0x0'));var util=require(_0x67cd('0x1'));var logger=require(_0x67cd('0x2'))(_0x67cd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67cd('0x4'));var fs=require('fs');var path=require(_0x67cd('0x5'));var rimraf=require(_0x67cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x67cd('0x7'));module['exports']=function(_0x218c1c,_0x2cec15){return _0x218c1c[_0x67cd('0x8')](_0x67cd('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f9b=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','ServicenowConfiguration'];(function(_0x5ea19b,_0xceacfa){var _0x18a9ac=function(_0x4ae80f){while(--_0x4ae80f){_0x5ea19b['push'](_0x5ea19b['shift']());}};_0x18a9ac(++_0xceacfa);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x1bcb52,_0x4d389f){_0x1bcb52=_0x1bcb52-0x0;var _0x1b7865=_0x4f9b[_0x1bcb52];return _0x1b7865;};'use strict';var _=require(_0xb4f9('0x0'));var util=require(_0xb4f9('0x1'));var logger=require(_0xb4f9('0x2'))(_0xb4f9('0x3'));var moment=require(_0xb4f9('0x4'));var BPromise=require(_0xb4f9('0x5'));var rp=require(_0xb4f9('0x6'));var fs=require('fs');var path=require(_0xb4f9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0xb4f9('0x8')]=function(_0x38c813,_0x2fa71b){return _0x38c813[_0xb4f9('0x9')](_0xb4f9('0xa'),attributes,{'tableName':_0xb4f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index bd2ed83..95b9138 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 _0xe3e4=['request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x15ebbe,_0x14f8fc){var _0x3ff72e=function(_0x1e9085){while(--_0x1e9085){_0x15ebbe['push'](_0x15ebbe['shift']());}};_0x3ff72e(++_0x14f8fc);}(_0xe3e4,0xc3));var _0x4e3e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe3e4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4e3e('0x0'));var util=require(_0x4e3e('0x1'));var moment=require(_0x4e3e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e3e('0x3'));var fs=require('fs');var Redis=require(_0x4e3e('0x4'));var db=require(_0x4e3e('0x5'))['db'];var utils=require(_0x4e3e('0x6'));var logger=require(_0x4e3e('0x7'))('rpc');var config=require(_0x4e3e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4e3e('0x9')][_0x4e3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f5942,_0x1edbea,_0x33c6dd){return new BPromise(function(_0x2727c7,_0x1b794e){return client[_0x4e3e('0xb')](_0x2f5942,_0x33c6dd)[_0x4e3e('0xc')](function(_0x2baa65){logger[_0x4e3e('0xd')](_0x4e3e('0xe'),_0x1edbea,_0x4e3e('0xf'));logger[_0x4e3e('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1edbea,_0x4e3e('0xf'),JSON[_0x4e3e('0x11')](_0x2baa65));if(_0x2baa65[_0x4e3e('0x12')]){if(_0x2baa65['error'][_0x4e3e('0x13')]===0x1f4){logger['error'](_0x4e3e('0xe'),_0x1edbea,_0x2baa65['error']['message']);return _0x1b794e(_0x2baa65[_0x4e3e('0x12')]['message']);}logger['error'](_0x4e3e('0xe'),_0x1edbea,_0x2baa65[_0x4e3e('0x12')][_0x4e3e('0x14')]);return _0x2727c7(_0x2baa65['error']['message']);}else{logger[_0x4e3e('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1edbea,_0x4e3e('0xf'));_0x2727c7(_0x2baa65['result'][_0x4e3e('0x14')]);}})['catch'](function(_0x58f8db){logger[_0x4e3e('0x12')](_0x4e3e('0xe'),_0x1edbea,_0x58f8db);_0x1b794e(_0x58f8db);});});} \ No newline at end of file +var _0x94a6=['request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x87867b,_0x2cc4fb){var _0xc95e2e=function(_0x5e2300){while(--_0x5e2300){_0x87867b['push'](_0x87867b['shift']());}};_0xc95e2e(++_0x2cc4fb);}(_0x94a6,0x1ec));var _0x694a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x694a('0x0'));var util=require(_0x694a('0x1'));var moment=require('moment');var BPromise=require(_0x694a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x694a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x694a('0x4'));var logger=require(_0x694a('0x5'))(_0x694a('0x6'));var config=require(_0x694a('0x7'));var jayson=require(_0x694a('0x8'));var client=jayson[_0x694a('0x9')][_0x694a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459677,_0x5e7fbe,_0x5c0a00){return new BPromise(function(_0x3389e2,_0x4ac10e){return client[_0x694a('0xb')](_0x459677,_0x5c0a00)[_0x694a('0xc')](function(_0x394995){logger[_0x694a('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e7fbe,_0x694a('0xe'));logger[_0x694a('0xf')](_0x694a('0x10'),_0x5e7fbe,_0x694a('0xe'),JSON['stringify'](_0x394995));if(_0x394995[_0x694a('0x11')]){if(_0x394995['error'][_0x694a('0x12')]===0x1f4){logger[_0x694a('0x11')](_0x694a('0x13'),_0x5e7fbe,_0x394995[_0x694a('0x11')][_0x694a('0x14')]);return _0x4ac10e(_0x394995[_0x694a('0x11')][_0x694a('0x14')]);}logger[_0x694a('0x11')](_0x694a('0x13'),_0x5e7fbe,_0x394995[_0x694a('0x11')]['message']);return _0x3389e2(_0x394995[_0x694a('0x11')][_0x694a('0x14')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5e7fbe,_0x694a('0xe'));_0x3389e2(_0x394995[_0x694a('0x15')]['message']);}})[_0x694a('0x16')](function(_0x27b27b){logger[_0x694a('0x11')](_0x694a('0x13'),_0x5e7fbe,_0x27b27b);_0x4ac10e(_0x27b27b);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index bf4c104..e0cb67f 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 _0x6fe1=['post','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x2e7c69,_0x25327c){var _0x1b84c1=function(_0x5cdcfe){while(--_0x5cdcfe){_0x2e7c69['push'](_0x2e7c69['shift']());}};_0x1b84c1(++_0x25327c);}(_0x6fe1,0xbb));var _0x16fe=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x6fe1[_0x58e469];return _0x4c01c5;};'use strict';var multer=require('multer');var util=require(_0x16fe('0x0'));var path=require(_0x16fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x16fe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x16fe('0x3'));var interaction=require(_0x16fe('0x4'));var config=require(_0x16fe('0x5'));var controller=require(_0x16fe('0x6'));router[_0x16fe('0x7')]('/',auth['isAuthenticated'](),controller[_0x16fe('0x8')]);router[_0x16fe('0x7')](_0x16fe('0x9'),auth[_0x16fe('0xa')](),controller['show']);router[_0x16fe('0xb')]('/',auth[_0x16fe('0xa')](),controller[_0x16fe('0xc')]);router[_0x16fe('0xd')]('/:id',auth[_0x16fe('0xa')](),controller[_0x16fe('0xe')]);router[_0x16fe('0xf')](_0x16fe('0x9'),auth[_0x16fe('0xa')](),controller[_0x16fe('0x10')]);module[_0x16fe('0x11')]=router; \ No newline at end of file +var _0xf9de=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xf9de,0x1dd));var _0xef9d=function(_0x545867,_0x32f29b){_0x545867=_0x545867-0x0;var _0x5c97af=_0xf9de[_0x545867];return _0x5c97af;};'use strict';var multer=require(_0xef9d('0x0'));var util=require(_0xef9d('0x1'));var path=require(_0xef9d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef9d('0x3')]();var fs_extra=require(_0xef9d('0x4'));var auth=require(_0xef9d('0x5'));var interaction=require(_0xef9d('0x6'));var config=require(_0xef9d('0x7'));var controller=require(_0xef9d('0x8'));router[_0xef9d('0x9')]('/',auth[_0xef9d('0xa')](),controller[_0xef9d('0xb')]);router[_0xef9d('0x9')](_0xef9d('0xc'),auth[_0xef9d('0xa')](),controller[_0xef9d('0xd')]);router[_0xef9d('0xe')]('/',auth['isAuthenticated'](),controller[_0xef9d('0xf')]);router[_0xef9d('0x10')](_0xef9d('0xc'),auth[_0xef9d('0xa')](),controller[_0xef9d('0x11')]);router[_0xef9d('0x12')](_0xef9d('0xc'),auth[_0xef9d('0xa')](),controller[_0xef9d('0x13')]);module[_0xef9d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c2d2025..c0ad929 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 _0xea92=['ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','STRING'];(function(_0x31f034,_0x57dff8){var _0x591ae4=function(_0x1e32dc){while(--_0x1e32dc){_0x31f034['push'](_0x31f034['shift']());}};_0x591ae4(++_0x57dff8);}(_0xea92,0x6e));var _0x2ea9=function(_0x3d0a1a,_0x422a1b){_0x3d0a1a=_0x3d0a1a-0x0;var _0x21e838=_0xea92[_0x3d0a1a];return _0x21e838;};'use strict';var Sequelize=require(_0x2ea9('0x0'));module[_0x2ea9('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2ea9('0x2'),_0x2ea9('0x3'),_0x2ea9('0x4'),'picklist'),'defaultValue':_0x2ea9('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2ea9('0x6')]},'keyType':{'type':Sequelize[_0x2ea9('0x7')]('string',_0x2ea9('0x2'),_0x2ea9('0x3'))},'keyContent':{'type':Sequelize[_0x2ea9('0x6')]},'idField':{'type':Sequelize[_0x2ea9('0x6')]},'nameField':{'type':Sequelize[_0x2ea9('0x6')]},'customField':{'type':Sequelize[_0x2ea9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ea9('0x6')]}}; \ No newline at end of file +var _0xf158=['variable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x58572c,_0x386076){var _0x1ce1e2=function(_0x5c9aff){while(--_0x5c9aff){_0x58572c['push'](_0x58572c['shift']());}};_0x1ce1e2(++_0x386076);}(_0xf158,0x1d8));var _0x8f15=function(_0x591fdd,_0x51248f){_0x591fdd=_0x591fdd-0x0;var _0x15d93c=_0xf158[_0x591fdd];return _0x15d93c;};'use strict';var Sequelize=require(_0x8f15('0x0'));module[_0x8f15('0x1')]={'type':{'type':Sequelize[_0x8f15('0x2')](_0x8f15('0x3'),_0x8f15('0x4'),'customVariable',_0x8f15('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8f15('0x6')]},'keyType':{'type':Sequelize[_0x8f15('0x2')](_0x8f15('0x3'),_0x8f15('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x8f15('0x6')]},'idField':{'type':Sequelize[_0x8f15('0x6')]},'nameField':{'type':Sequelize[_0x8f15('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f15('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 9668858..3b95499 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 _0xd76c=['includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','send','index','map','ServicenowField','rawAttributes','fieldName','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','merge','options'];(function(_0x26f6e2,_0x5daf41){var _0x2c7a1a=function(_0x3793db){while(--_0x3793db){_0x26f6e2['push'](_0x26f6e2['shift']());}};_0x2c7a1a(++_0x5daf41);}(_0xd76c,0x1d2));var _0xcd76=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0xd76c[_0x496738];return _0xee1381;};'use strict';var emlformat=require(_0xcd76('0x0'));var rimraf=require(_0xcd76('0x1'));var zipdir=require(_0xcd76('0x2'));var jsonpatch=require(_0xcd76('0x3'));var rp=require(_0xcd76('0x4'));var moment=require(_0xcd76('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcd76('0x6'));var util=require(_0xcd76('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcd76('0x8'));var ejs=require(_0xcd76('0x9'));var fs=require('fs');var fs_extra=require(_0xcd76('0xa'));var _=require(_0xcd76('0xb'));var squel=require(_0xcd76('0xc'));var crypto=require(_0xcd76('0xd'));var jsforce=require(_0xcd76('0xe'));var deskjs=require(_0xcd76('0xf'));var toCsv=require(_0xcd76('0x8'));var querystring=require(_0xcd76('0x10'));var Papa=require(_0xcd76('0x11'));var Redis=require(_0xcd76('0x12'));var authService=require(_0xcd76('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd76('0x14'))(_0xcd76('0x15'));var utils=require(_0xcd76('0x16'));var config=require(_0xcd76('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd76('0x18'))['db'];function respondWithStatusCode(_0x383ace,_0x22939a){_0x22939a=_0x22939a||0xcc;return function(_0x5e6735){if(_0x5e6735){return _0x383ace[_0xcd76('0x19')](_0x22939a);}return _0x383ace['status'](_0x22939a)['end']();};}function respondWithResult(_0x1dbb4c,_0x5c3dfe){_0x5c3dfe=_0x5c3dfe||0xc8;return function(_0x223791){if(_0x223791){return _0x1dbb4c[_0xcd76('0x1a')](_0x5c3dfe)['json'](_0x223791);}};}function respondWithFilteredResult(_0x17efc7,_0x6344d3){return function(_0x37abef){if(_0x37abef){var _0x46f490=typeof _0x6344d3[_0xcd76('0x1b')]===_0xcd76('0x1c')&&typeof _0x6344d3['limit']===_0xcd76('0x1c');var _0x327ecf=_0x37abef['count'];var _0x12d376=_0x46f490?0x0:_0x6344d3[_0xcd76('0x1b')];var _0x670c95=_0x46f490?_0x37abef[_0xcd76('0x1d')]:_0x6344d3[_0xcd76('0x1b')]+_0x6344d3[_0xcd76('0x1e')];var _0x364abe;if(_0x670c95>=_0x327ecf){_0x670c95=_0x327ecf;_0x364abe=0xc8;}else{_0x364abe=0xce;}_0x17efc7[_0xcd76('0x1a')](_0x364abe);return _0x17efc7[_0xcd76('0x1f')](_0xcd76('0x20'),_0x12d376+'-'+_0x670c95+'/'+_0x327ecf)[_0xcd76('0x21')](_0x37abef);}return null;};}function patchUpdates(_0x4d908f){return function(_0x47b090){try{jsonpatch[_0xcd76('0x22')](_0x47b090,_0x4d908f,!![]);}catch(_0x1231fe){return BPromise[_0xcd76('0x23')](_0x1231fe);}return _0x47b090['save']();};}function saveUpdates(_0x4f9563,_0xa3fa08){return function(_0x162532){if(_0x162532){return _0x162532[_0xcd76('0x24')](_0x4f9563)[_0xcd76('0x25')](function(_0xe657ea){return _0xe657ea;});}return null;};}function removeEntity(_0x5c40f4,_0x1c1136){return function(_0x531b93){if(_0x531b93){return _0x531b93[_0xcd76('0x26')]()[_0xcd76('0x25')](function(){_0x5c40f4[_0xcd76('0x1a')](0xcc)[_0xcd76('0x27')]();});}};}function handleEntityNotFound(_0x3a4092,_0x49ee6d){return function(_0x5ba120){if(!_0x5ba120){_0x3a4092[_0xcd76('0x19')](0x194);}return _0x5ba120;};}function handleError(_0x875cd4,_0x1d1007){_0x1d1007=_0x1d1007||0x1f4;return function(_0x26f0ce){logger[_0xcd76('0x28')](_0x26f0ce['stack']);if(_0x26f0ce['name']){delete _0x26f0ce['name'];}_0x875cd4['status'](_0x1d1007)[_0xcd76('0x29')](_0x26f0ce);};}exports[_0xcd76('0x2a')]=function(_0x56abfd,_0xe34adb){var _0x579c6c={},_0x48ec85={},_0x58b4bb={'count':0x0,'rows':[]};var _0x313bc8=_[_0xcd76('0x2b')](db[_0xcd76('0x2c')][_0xcd76('0x2d')],function(_0x5cb55a){return{'name':_0x5cb55a[_0xcd76('0x2e')],'type':_0x5cb55a['type'][_0xcd76('0x2f')]};});_0x48ec85[_0xcd76('0x30')]=_[_0xcd76('0x2b')](_0x313bc8,_0xcd76('0x31'));_0x48ec85[_0xcd76('0x32')]=_[_0xcd76('0x33')](_0x56abfd[_0xcd76('0x32')]);_0x48ec85['filters']=_['intersection'](_0x48ec85['model'],_0x48ec85[_0xcd76('0x32')]);_0x579c6c[_0xcd76('0x34')]=_[_0xcd76('0x35')](_0x48ec85[_0xcd76('0x30')],qs[_0xcd76('0x36')](_0x56abfd[_0xcd76('0x32')][_0xcd76('0x36')]));_0x579c6c['attributes']=_0x579c6c[_0xcd76('0x34')][_0xcd76('0x37')]?_0x579c6c[_0xcd76('0x34')]:_0x48ec85[_0xcd76('0x30')];if(!_0x56abfd[_0xcd76('0x32')][_0xcd76('0x38')]('nolimit')){_0x579c6c[_0xcd76('0x1e')]=qs['limit'](_0x56abfd[_0xcd76('0x32')][_0xcd76('0x1e')]);_0x579c6c[_0xcd76('0x1b')]=qs[_0xcd76('0x1b')](_0x56abfd['query'][_0xcd76('0x1b')]);}_0x579c6c['order']=qs[_0xcd76('0x39')](_0x56abfd[_0xcd76('0x32')][_0xcd76('0x39')]);_0x579c6c[_0xcd76('0x3a')]=qs[_0xcd76('0x3b')](_[_0xcd76('0x3c')](_0x56abfd[_0xcd76('0x32')],_0x48ec85[_0xcd76('0x3b')]),_0x313bc8);if(_0x56abfd[_0xcd76('0x32')][_0xcd76('0x3d')]){_0x579c6c[_0xcd76('0x3a')]=_['merge'](_0x579c6c[_0xcd76('0x3a')],{'$or':_[_0xcd76('0x2b')](_0x313bc8,function(_0x3be8eb){if(_0x3be8eb[_0xcd76('0x3e')]!==_0xcd76('0x3f')){var _0x36c6bc={};_0x36c6bc[_0x3be8eb['name']]={'$like':'%'+_0x56abfd[_0xcd76('0x32')][_0xcd76('0x3d')]+'%'};return _0x36c6bc;}})});}_0x579c6c=_[_0xcd76('0x40')]({},_0x579c6c,_0x56abfd[_0xcd76('0x41')]);var _0x39be24={'where':_0x579c6c[_0xcd76('0x3a')]};return db[_0xcd76('0x2c')]['count'](_0x39be24)[_0xcd76('0x25')](function(_0x121862){_0x58b4bb[_0xcd76('0x1d')]=_0x121862;if(_0x56abfd[_0xcd76('0x32')][_0xcd76('0x42')]){_0x579c6c[_0xcd76('0x43')]=[{'all':!![]}];}return db['ServicenowField'][_0xcd76('0x44')](_0x579c6c);})[_0xcd76('0x25')](function(_0x11fa75){_0x58b4bb[_0xcd76('0x45')]=_0x11fa75;return _0x58b4bb;})['then'](respondWithFilteredResult(_0xe34adb,_0x579c6c))[_0xcd76('0x46')](handleError(_0xe34adb,null));};exports[_0xcd76('0x47')]=function(_0x1fe220,_0x519761){var _0x25001e={'raw':!![],'where':{'id':_0x1fe220[_0xcd76('0x48')]['id']}},_0x36434c={};_0x36434c[_0xcd76('0x30')]=_[_0xcd76('0x33')](db[_0xcd76('0x2c')][_0xcd76('0x2d')]);_0x36434c[_0xcd76('0x32')]=_[_0xcd76('0x33')](_0x1fe220['query']);_0x36434c[_0xcd76('0x3b')]=_[_0xcd76('0x35')](_0x36434c['model'],_0x36434c[_0xcd76('0x32')]);_0x25001e[_0xcd76('0x34')]=_[_0xcd76('0x35')](_0x36434c[_0xcd76('0x30')],qs[_0xcd76('0x36')](_0x1fe220[_0xcd76('0x32')]['fields']));_0x25001e[_0xcd76('0x34')]=_0x25001e['attributes']['length']?_0x25001e[_0xcd76('0x34')]:_0x36434c[_0xcd76('0x30')];if(_0x1fe220[_0xcd76('0x32')][_0xcd76('0x42')]){_0x25001e[_0xcd76('0x43')]=[{'all':!![]}];}_0x25001e=_[_0xcd76('0x40')]({},_0x25001e,_0x1fe220[_0xcd76('0x41')]);return db[_0xcd76('0x2c')][_0xcd76('0x49')](_0x25001e)['then'](handleEntityNotFound(_0x519761,null))[_0xcd76('0x25')](respondWithResult(_0x519761,null))[_0xcd76('0x46')](handleError(_0x519761,null));};exports[_0xcd76('0x4a')]=function(_0x2f210c,_0x10b0bd){return db[_0xcd76('0x2c')][_0xcd76('0x4a')](_0x2f210c[_0xcd76('0x4b')],{})['then'](respondWithResult(_0x10b0bd,0xc9))[_0xcd76('0x46')](handleError(_0x10b0bd,null));};exports[_0xcd76('0x24')]=function(_0x58ea0a,_0x2e419c){if(_0x58ea0a['body']['id']){delete _0x58ea0a[_0xcd76('0x4b')]['id'];}return db['ServicenowField'][_0xcd76('0x49')]({'where':{'id':_0x58ea0a[_0xcd76('0x48')]['id']}})[_0xcd76('0x25')](handleEntityNotFound(_0x2e419c,null))[_0xcd76('0x25')](saveUpdates(_0x58ea0a[_0xcd76('0x4b')],null))[_0xcd76('0x25')](respondWithResult(_0x2e419c,null))[_0xcd76('0x46')](handleError(_0x2e419c,null));};exports[_0xcd76('0x26')]=function(_0x37d30d,_0x19a810){return db[_0xcd76('0x2c')][_0xcd76('0x49')]({'where':{'id':_0x37d30d[_0xcd76('0x48')]['id']}})[_0xcd76('0x25')](handleEntityNotFound(_0x19a810,null))[_0xcd76('0x25')](removeEntity(_0x19a810,null))['catch'](handleError(_0x19a810,null));}; \ No newline at end of file +var _0x6b32=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ServicenowField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','fields','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x6b32,0x10c));var _0x26b3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26b3('0x0'));var zipdir=require(_0x26b3('0x1'));var jsonpatch=require(_0x26b3('0x2'));var rp=require(_0x26b3('0x3'));var moment=require(_0x26b3('0x4'));var BPromise=require(_0x26b3('0x5'));var Mustache=require(_0x26b3('0x6'));var util=require(_0x26b3('0x7'));var path=require('path');var sox=require(_0x26b3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26b3('0x9'));var _=require(_0x26b3('0xa'));var squel=require(_0x26b3('0xb'));var crypto=require(_0x26b3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26b3('0xd'));var querystring=require('querystring');var Papa=require(_0x26b3('0xe'));var Redis=require(_0x26b3('0xf'));var authService=require(_0x26b3('0x10'));var qs=require(_0x26b3('0x11'));var as=require(_0x26b3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26b3('0x13'))('api');var utils=require(_0x26b3('0x14'));var config=require(_0x26b3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x26b3('0x16'))['db'];function respondWithStatusCode(_0x169588,_0x546bed){_0x546bed=_0x546bed||0xcc;return function(_0x1e16a9){if(_0x1e16a9){return _0x169588[_0x26b3('0x17')](_0x546bed);}return _0x169588[_0x26b3('0x18')](_0x546bed)[_0x26b3('0x19')]();};}function respondWithResult(_0xdf26c5,_0x421bac){_0x421bac=_0x421bac||0xc8;return function(_0x3892b0){if(_0x3892b0){return _0xdf26c5[_0x26b3('0x18')](_0x421bac)[_0x26b3('0x1a')](_0x3892b0);}};}function respondWithFilteredResult(_0x15b214,_0x36f0f5){return function(_0x1dfb2c){if(_0x1dfb2c){var _0x3135f6=typeof _0x36f0f5['offset']===_0x26b3('0x1b')&&typeof _0x36f0f5['limit']===_0x26b3('0x1b');var _0x10ae56=_0x1dfb2c[_0x26b3('0x1c')];var _0x421244=_0x3135f6?0x0:_0x36f0f5[_0x26b3('0x1d')];var _0x2dd5ac=_0x3135f6?_0x1dfb2c[_0x26b3('0x1c')]:_0x36f0f5[_0x26b3('0x1d')]+_0x36f0f5[_0x26b3('0x1e')];var _0x56c1e9;if(_0x2dd5ac>=_0x10ae56){_0x2dd5ac=_0x10ae56;_0x56c1e9=0xc8;}else{_0x56c1e9=0xce;}_0x15b214['status'](_0x56c1e9);return _0x15b214[_0x26b3('0x1f')](_0x26b3('0x20'),_0x421244+'-'+_0x2dd5ac+'/'+_0x10ae56)[_0x26b3('0x1a')](_0x1dfb2c);}return null;};}function patchUpdates(_0xc39dbe){return function(_0x5489d7){try{jsonpatch[_0x26b3('0x21')](_0x5489d7,_0xc39dbe,!![]);}catch(_0x42a4a2){return BPromise[_0x26b3('0x22')](_0x42a4a2);}return _0x5489d7[_0x26b3('0x23')]();};}function saveUpdates(_0x3d1a6b,_0xf33801){return function(_0x3a0311){if(_0x3a0311){return _0x3a0311[_0x26b3('0x24')](_0x3d1a6b)[_0x26b3('0x25')](function(_0x1db4cb){return _0x1db4cb;});}return null;};}function removeEntity(_0x2a7bb2,_0x10697d){return function(_0x3b76c0){if(_0x3b76c0){return _0x3b76c0[_0x26b3('0x26')]()[_0x26b3('0x25')](function(){_0x2a7bb2[_0x26b3('0x18')](0xcc)[_0x26b3('0x19')]();});}};}function handleEntityNotFound(_0xd50c1c,_0x580dca){return function(_0x81d4ac){if(!_0x81d4ac){_0xd50c1c[_0x26b3('0x17')](0x194);}return _0x81d4ac;};}function handleError(_0x6f8e18,_0x12d6b5){_0x12d6b5=_0x12d6b5||0x1f4;return function(_0x4156b0){logger[_0x26b3('0x27')](_0x4156b0['stack']);if(_0x4156b0[_0x26b3('0x28')]){delete _0x4156b0[_0x26b3('0x28')];}_0x6f8e18[_0x26b3('0x18')](_0x12d6b5)[_0x26b3('0x29')](_0x4156b0);};}exports[_0x26b3('0x2a')]=function(_0x107f9a,_0x5b05b4){var _0x47e755={},_0x1e6055={},_0x5b5ac8={'count':0x0,'rows':[]};var _0x4e1d1c=_['map'](db[_0x26b3('0x2b')][_0x26b3('0x2c')],function(_0x36f31d){return{'name':_0x36f31d[_0x26b3('0x2d')],'type':_0x36f31d['type'][_0x26b3('0x2e')]};});_0x1e6055[_0x26b3('0x2f')]=_[_0x26b3('0x30')](_0x4e1d1c,_0x26b3('0x28'));_0x1e6055[_0x26b3('0x31')]=_[_0x26b3('0x32')](_0x107f9a[_0x26b3('0x31')]);_0x1e6055[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0x1e6055['model'],_0x1e6055[_0x26b3('0x31')]);_0x47e755[_0x26b3('0x35')]=_[_0x26b3('0x34')](_0x1e6055[_0x26b3('0x2f')],qs['fields'](_0x107f9a[_0x26b3('0x31')]['fields']));_0x47e755['attributes']=_0x47e755[_0x26b3('0x35')][_0x26b3('0x36')]?_0x47e755[_0x26b3('0x35')]:_0x1e6055['model'];if(!_0x107f9a['query'][_0x26b3('0x37')]('nolimit')){_0x47e755[_0x26b3('0x1e')]=qs[_0x26b3('0x1e')](_0x107f9a[_0x26b3('0x31')][_0x26b3('0x1e')]);_0x47e755[_0x26b3('0x1d')]=qs['offset'](_0x107f9a[_0x26b3('0x31')][_0x26b3('0x1d')]);}_0x47e755[_0x26b3('0x38')]=qs['sort'](_0x107f9a[_0x26b3('0x31')][_0x26b3('0x39')]);_0x47e755[_0x26b3('0x3a')]=qs['filters'](_['pick'](_0x107f9a['query'],_0x1e6055['filters']),_0x4e1d1c);if(_0x107f9a[_0x26b3('0x31')]['filter']){_0x47e755[_0x26b3('0x3a')]=_[_0x26b3('0x3b')](_0x47e755['where'],{'$or':_[_0x26b3('0x30')](_0x4e1d1c,function(_0x455351){if(_0x455351['type']!==_0x26b3('0x3c')){var _0x14ff82={};_0x14ff82[_0x455351['name']]={'$like':'%'+_0x107f9a[_0x26b3('0x31')][_0x26b3('0x3d')]+'%'};return _0x14ff82;}})});}_0x47e755=_[_0x26b3('0x3b')]({},_0x47e755,_0x107f9a[_0x26b3('0x3e')]);var _0x23a880={'where':_0x47e755[_0x26b3('0x3a')]};return db['ServicenowField'][_0x26b3('0x1c')](_0x23a880)[_0x26b3('0x25')](function(_0x40025e){_0x5b5ac8['count']=_0x40025e;if(_0x107f9a[_0x26b3('0x31')][_0x26b3('0x3f')]){_0x47e755[_0x26b3('0x40')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x47e755);})[_0x26b3('0x25')](function(_0x4e7709){_0x5b5ac8[_0x26b3('0x41')]=_0x4e7709;return _0x5b5ac8;})['then'](respondWithFilteredResult(_0x5b05b4,_0x47e755))['catch'](handleError(_0x5b05b4,null));};exports[_0x26b3('0x42')]=function(_0x3886dd,_0x3cbb70){var _0x3da095={'raw':!![],'where':{'id':_0x3886dd['params']['id']}},_0x5d9f44={};_0x5d9f44[_0x26b3('0x2f')]=_[_0x26b3('0x32')](db[_0x26b3('0x2b')][_0x26b3('0x2c')]);_0x5d9f44[_0x26b3('0x31')]=_[_0x26b3('0x32')](_0x3886dd['query']);_0x5d9f44[_0x26b3('0x33')]=_[_0x26b3('0x34')](_0x5d9f44[_0x26b3('0x2f')],_0x5d9f44[_0x26b3('0x31')]);_0x3da095[_0x26b3('0x35')]=_['intersection'](_0x5d9f44['model'],qs[_0x26b3('0x43')](_0x3886dd[_0x26b3('0x31')][_0x26b3('0x43')]));_0x3da095[_0x26b3('0x35')]=_0x3da095[_0x26b3('0x35')][_0x26b3('0x36')]?_0x3da095['attributes']:_0x5d9f44[_0x26b3('0x2f')];if(_0x3886dd[_0x26b3('0x31')][_0x26b3('0x3f')]){_0x3da095[_0x26b3('0x40')]=[{'all':!![]}];}_0x3da095=_[_0x26b3('0x3b')]({},_0x3da095,_0x3886dd[_0x26b3('0x3e')]);return db[_0x26b3('0x2b')][_0x26b3('0x44')](_0x3da095)['then'](handleEntityNotFound(_0x3cbb70,null))[_0x26b3('0x25')](respondWithResult(_0x3cbb70,null))[_0x26b3('0x45')](handleError(_0x3cbb70,null));};exports[_0x26b3('0x46')]=function(_0x4f8cba,_0x2cc41a){return db[_0x26b3('0x2b')][_0x26b3('0x46')](_0x4f8cba[_0x26b3('0x47')],{})[_0x26b3('0x25')](respondWithResult(_0x2cc41a,0xc9))[_0x26b3('0x45')](handleError(_0x2cc41a,null));};exports[_0x26b3('0x24')]=function(_0x585871,_0x224f40){if(_0x585871['body']['id']){delete _0x585871['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x585871['params']['id']}})['then'](handleEntityNotFound(_0x224f40,null))[_0x26b3('0x25')](saveUpdates(_0x585871[_0x26b3('0x47')],null))[_0x26b3('0x25')](respondWithResult(_0x224f40,null))[_0x26b3('0x45')](handleError(_0x224f40,null));};exports[_0x26b3('0x26')]=function(_0x13d9d0,_0x1e7d12){return db['ServicenowField'][_0x26b3('0x44')]({'where':{'id':_0x13d9d0['params']['id']}})['then'](handleEntityNotFound(_0x1e7d12,null))[_0x26b3('0x25')](removeEntity(_0x1e7d12,null))[_0x26b3('0x45')](handleError(_0x1e7d12,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 577feee..55b1277 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 _0x8e31=['rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x31e042,_0x1808fd){var _0x2c8005=function(_0x4ec0a3){while(--_0x4ec0a3){_0x31e042['push'](_0x31e042['shift']());}};_0x2c8005(++_0x1808fd);}(_0x8e31,0x139));var _0x18e3=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x8e31[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x18e3('0x0'));var util=require('util');var logger=require(_0x18e3('0x1'))(_0x18e3('0x2'));var moment=require(_0x18e3('0x3'));var BPromise=require(_0x18e3('0x4'));var rp=require(_0x18e3('0x5'));var fs=require('fs');var path=require(_0x18e3('0x6'));var rimraf=require(_0x18e3('0x7'));var config=require('../../config/environment');var attributes=require(_0x18e3('0x8'));module[_0x18e3('0x9')]=function(_0x25644e,_0x16807a){return _0x25644e[_0x18e3('0xa')](_0x18e3('0xb'),attributes,{'tableName':_0x18e3('0xc'),'paranoid':![],'indexes':[{'name':_0x18e3('0xd'),'fields':[_0x18e3('0xe'),_0x18e3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc367=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0xc367,0x14b));var _0x7c36=function(_0x5694bd,_0x3d29f0){_0x5694bd=_0x5694bd-0x0;var _0x42ca79=_0xc367[_0x5694bd];return _0x42ca79;};'use strict';var _=require(_0x7c36('0x0'));var util=require(_0x7c36('0x1'));var logger=require(_0x7c36('0x2'))(_0x7c36('0x3'));var moment=require(_0x7c36('0x4'));var BPromise=require(_0x7c36('0x5'));var rp=require(_0x7c36('0x6'));var fs=require('fs');var path=require(_0x7c36('0x7'));var rimraf=require(_0x7c36('0x8'));var config=require(_0x7c36('0x9'));var attributes=require(_0x7c36('0xa'));module[_0x7c36('0xb')]=function(_0x28e1c4,_0x44eb37){return _0x28e1c4[_0x7c36('0xc')](_0x7c36('0xd'),attributes,{'tableName':_0x7c36('0xe'),'paranoid':![],'indexes':[{'name':_0x7c36('0xf'),'fields':['idField',_0x7c36('0x10')],'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 47d0ff8..60fec03 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2558ee,_0x2a2574){var _0x431306=function(_0x32cb67){while(--_0x32cb67){_0x2558ee['push'](_0x2558ee['shift']());}};_0x431306(++_0x2a2574);}(_0xf4eb,0xec));var _0xbf4e=function(_0x494237,_0x2e406b){_0x494237=_0x494237-0x0;var _0x4c994e=_0xf4eb[_0x494237];return _0x4c994e;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x304e0e,_0x2654a3){var _0x4449c8=function(_0x5a9242){while(--_0x5a9242){_0x304e0e['push'](_0x304e0e['shift']());}};_0x4449c8(++_0x2654a3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1952fd,_0x5416e0){_0x1952fd=_0x1952fd-0x0;var _0x4f554c=_0xf4eb[_0x1952fd];return _0x4f554c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index cd92b48..36320e6 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(_0x17c8e4,_0x568d53){var _0x2d5041=function(_0x76ad43){while(--_0x76ad43){_0x17c8e4['push'](_0x17c8e4['shift']());}};_0x2d5041(++_0x568d53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0xc12c5f,_0x8c43f5){var _0x469332=function(_0x216a9b){while(--_0x216a9b){_0xc12c5f['push'](_0xc12c5f['shift']());}};_0x469332(++_0x8c43f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 75ccce8..b2f011b 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(_0x116b2c,_0x35d54b){var _0x5bd021=function(_0x493757){while(--_0x493757){_0x116b2c['push'](_0x116b2c['shift']());}};_0x5bd021(++_0x35d54b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3d156f,_0x263ab4){var _0x4fdcdb=function(_0x299f6f){while(--_0x299f6f){_0x3d156f['push'](_0x3d156f['shift']());}};_0x4fdcdb(++_0x263ab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 ef5bdc1..3672e29 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 _0xcf92=['findAll','rows','catch','show','params','create','update','body','find','getConfigurations','findOne','pick','AccountId','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','Subjects','assigned_user_id','created_by','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x591877,_0x1d3d65){var _0x33c7d7=function(_0x268a53){while(--_0x268a53){_0x591877['push'](_0x591877['shift']());}};_0x33c7d7(++_0x1d3d65);}(_0xcf92,0x182));var _0x2cf9=function(_0x3ed319,_0x2f7833){_0x3ed319=_0x3ed319-0x0;var _0x2b82f7=_0xcf92[_0x3ed319];return _0x2b82f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2cf9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cf9('0x1'));var moment=require(_0x2cf9('0x2'));var BPromise=require(_0x2cf9('0x3'));var Mustache=require('mustache');var util=require(_0x2cf9('0x4'));var path=require('path');var sox=require(_0x2cf9('0x5'));var csv=require(_0x2cf9('0x6'));var ejs=require(_0x2cf9('0x7'));var fs=require('fs');var fs_extra=require(_0x2cf9('0x8'));var _=require('lodash');var squel=require(_0x2cf9('0x9'));var crypto=require('crypto');var jsforce=require(_0x2cf9('0xa'));var deskjs=require(_0x2cf9('0xb'));var toCsv=require(_0x2cf9('0x6'));var querystring=require(_0x2cf9('0xc'));var Papa=require(_0x2cf9('0xd'));var Redis=require(_0x2cf9('0xe'));var authService=require(_0x2cf9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2cf9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2cf9('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cf9('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2cf9('0x13'));function respondWithStatusCode(_0x1923c5,_0x3c4043){_0x3c4043=_0x3c4043||0xcc;return function(_0x227c0b){if(_0x227c0b){return _0x1923c5[_0x2cf9('0x14')](_0x3c4043);}return _0x1923c5[_0x2cf9('0x15')](_0x3c4043)[_0x2cf9('0x16')]();};}function respondWithResult(_0x317802,_0x2bc7da){_0x2bc7da=_0x2bc7da||0xc8;return function(_0x9c2acc){if(_0x9c2acc){return _0x317802[_0x2cf9('0x15')](_0x2bc7da)[_0x2cf9('0x17')](_0x9c2acc);}};}function respondWithFilteredResult(_0x36fea5,_0x2c3be3){return function(_0x54ea43){if(_0x54ea43){var _0x1c0356=typeof _0x2c3be3['offset']==='undefined'&&typeof _0x2c3be3[_0x2cf9('0x18')]===_0x2cf9('0x19');var _0x2ca88b=_0x54ea43[_0x2cf9('0x1a')];var _0x446ffe=_0x1c0356?0x0:_0x2c3be3[_0x2cf9('0x1b')];var _0x2f578b=_0x1c0356?_0x54ea43['count']:_0x2c3be3[_0x2cf9('0x1b')]+_0x2c3be3['limit'];var _0x5cf788;if(_0x2f578b>=_0x2ca88b){_0x2f578b=_0x2ca88b;_0x5cf788=0xc8;}else{_0x5cf788=0xce;}_0x36fea5[_0x2cf9('0x15')](_0x5cf788);return _0x36fea5[_0x2cf9('0x1c')](_0x2cf9('0x1d'),_0x446ffe+'-'+_0x2f578b+'/'+_0x2ca88b)[_0x2cf9('0x17')](_0x54ea43);}return null;};}function patchUpdates(_0x5e2237){return function(_0x248076){try{jsonpatch['apply'](_0x248076,_0x5e2237,!![]);}catch(_0x30854c){return BPromise[_0x2cf9('0x1e')](_0x30854c);}return _0x248076[_0x2cf9('0x1f')]();};}function saveUpdates(_0x19bbce,_0x50b594){return function(_0x5a77b4){if(_0x5a77b4){return _0x5a77b4['update'](_0x19bbce)[_0x2cf9('0x20')](function(_0x11bf5c){return _0x11bf5c;});}return null;};}function removeEntity(_0x3f9fe8,_0x4981f1){return function(_0x16c239){if(_0x16c239){return _0x16c239[_0x2cf9('0x21')]()[_0x2cf9('0x20')](function(){_0x3f9fe8[_0x2cf9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352b1f,_0x24dda0){return function(_0x29d425){if(!_0x29d425){_0x352b1f[_0x2cf9('0x14')](0x194);}return _0x29d425;};}function handleError(_0x184f36,_0x2752e0){_0x2752e0=_0x2752e0||0x1f4;return function(_0x57c5a3){logger[_0x2cf9('0x22')](_0x57c5a3[_0x2cf9('0x23')]);if(_0x57c5a3[_0x2cf9('0x24')]){delete _0x57c5a3[_0x2cf9('0x24')];}_0x184f36[_0x2cf9('0x15')](_0x2752e0)['send'](_0x57c5a3);};}exports[_0x2cf9('0x25')]=function(_0x9e2947,_0x4a6de4){var _0x41338a={},_0x2b6eb6={},_0x345879={'count':0x0,'rows':[]};var _0x3caaa7=_[_0x2cf9('0x26')](db[_0x2cf9('0x27')][_0x2cf9('0x28')],function(_0x50c708){return{'name':_0x50c708[_0x2cf9('0x29')],'type':_0x50c708['type'][_0x2cf9('0x2a')]};});_0x2b6eb6[_0x2cf9('0x2b')]=_[_0x2cf9('0x26')](_0x3caaa7,_0x2cf9('0x24'));_0x2b6eb6[_0x2cf9('0x2c')]=_[_0x2cf9('0x2d')](_0x9e2947[_0x2cf9('0x2c')]);_0x2b6eb6['filters']=_[_0x2cf9('0x2e')](_0x2b6eb6[_0x2cf9('0x2b')],_0x2b6eb6[_0x2cf9('0x2c')]);_0x41338a[_0x2cf9('0x2f')]=_[_0x2cf9('0x2e')](_0x2b6eb6['model'],qs[_0x2cf9('0x30')](_0x9e2947['query']['fields']));_0x41338a[_0x2cf9('0x2f')]=_0x41338a['attributes'][_0x2cf9('0x31')]?_0x41338a[_0x2cf9('0x2f')]:_0x2b6eb6['model'];if(!_0x9e2947[_0x2cf9('0x2c')]['hasOwnProperty'](_0x2cf9('0x32'))){_0x41338a['limit']=qs[_0x2cf9('0x18')](_0x9e2947[_0x2cf9('0x2c')][_0x2cf9('0x18')]);_0x41338a[_0x2cf9('0x1b')]=qs[_0x2cf9('0x1b')](_0x9e2947['query'][_0x2cf9('0x1b')]);}_0x41338a[_0x2cf9('0x33')]=qs[_0x2cf9('0x34')](_0x9e2947[_0x2cf9('0x2c')][_0x2cf9('0x34')]);_0x41338a[_0x2cf9('0x35')]=qs[_0x2cf9('0x36')](_['pick'](_0x9e2947[_0x2cf9('0x2c')],_0x2b6eb6[_0x2cf9('0x36')]),_0x3caaa7);if(_0x9e2947[_0x2cf9('0x2c')][_0x2cf9('0x37')]){_0x41338a[_0x2cf9('0x35')]=_[_0x2cf9('0x38')](_0x41338a[_0x2cf9('0x35')],{'$or':_['map'](_0x3caaa7,function(_0x1bec58){if(_0x1bec58[_0x2cf9('0x39')]!==_0x2cf9('0x3a')){var _0x1d7b8d={};_0x1d7b8d[_0x1bec58[_0x2cf9('0x24')]]={'$like':'%'+_0x9e2947[_0x2cf9('0x2c')][_0x2cf9('0x37')]+'%'};return _0x1d7b8d;}})});}_0x41338a=_[_0x2cf9('0x38')]({},_0x41338a,_0x9e2947[_0x2cf9('0x3b')]);var _0x703f97={'where':_0x41338a[_0x2cf9('0x35')]};return db['SugarcrmAccount'][_0x2cf9('0x1a')](_0x703f97)[_0x2cf9('0x20')](function(_0x5bacf0){_0x345879[_0x2cf9('0x1a')]=_0x5bacf0;if(_0x9e2947[_0x2cf9('0x2c')][_0x2cf9('0x3c')]){_0x41338a[_0x2cf9('0x3d')]=[{'all':!![]}];}return db[_0x2cf9('0x27')][_0x2cf9('0x3e')](_0x41338a);})['then'](function(_0xe92b37){_0x345879[_0x2cf9('0x3f')]=_0xe92b37;return _0x345879;})[_0x2cf9('0x20')](respondWithFilteredResult(_0x4a6de4,_0x41338a))[_0x2cf9('0x40')](handleError(_0x4a6de4,null));};exports[_0x2cf9('0x41')]=function(_0x1dc325,_0x23acc7){var _0x4b33f4={'raw':![],'where':{'id':_0x1dc325[_0x2cf9('0x42')]['id']}},_0x4c157a={};_0x4c157a['model']=_[_0x2cf9('0x2d')](db[_0x2cf9('0x27')][_0x2cf9('0x28')]);_0x4c157a[_0x2cf9('0x2c')]=_[_0x2cf9('0x2d')](_0x1dc325[_0x2cf9('0x2c')]);_0x4c157a[_0x2cf9('0x36')]=_[_0x2cf9('0x2e')](_0x4c157a[_0x2cf9('0x2b')],_0x4c157a['query']);_0x4b33f4[_0x2cf9('0x2f')]=_['intersection'](_0x4c157a['model'],qs['fields'](_0x1dc325[_0x2cf9('0x2c')]['fields']));_0x4b33f4[_0x2cf9('0x2f')]=_0x4b33f4[_0x2cf9('0x2f')][_0x2cf9('0x31')]?_0x4b33f4[_0x2cf9('0x2f')]:_0x4c157a[_0x2cf9('0x2b')];if(_0x1dc325[_0x2cf9('0x2c')]['includeAll']){_0x4b33f4[_0x2cf9('0x3d')]=[{'all':!![]}];}_0x4b33f4=_[_0x2cf9('0x38')]({},_0x4b33f4,_0x1dc325[_0x2cf9('0x3b')]);return db[_0x2cf9('0x27')]['find'](_0x4b33f4)[_0x2cf9('0x20')](handleEntityNotFound(_0x23acc7,null))[_0x2cf9('0x20')](respondWithResult(_0x23acc7,null))[_0x2cf9('0x40')](handleError(_0x23acc7,null));};exports[_0x2cf9('0x43')]=function(_0x46d624,_0x153cf1){return db[_0x2cf9('0x27')]['create'](_0x46d624['body'],{})[_0x2cf9('0x20')](respondWithResult(_0x153cf1,0xc9))[_0x2cf9('0x40')](handleError(_0x153cf1,null));};exports[_0x2cf9('0x44')]=function(_0x4c8b03,_0x49814e){if(_0x4c8b03['body']['id']){delete _0x4c8b03[_0x2cf9('0x45')]['id'];}return db[_0x2cf9('0x27')]['find']({'where':{'id':_0x4c8b03[_0x2cf9('0x42')]['id']}})['then'](handleEntityNotFound(_0x49814e,null))['then'](saveUpdates(_0x4c8b03[_0x2cf9('0x45')],null))[_0x2cf9('0x20')](respondWithResult(_0x49814e,null))[_0x2cf9('0x40')](handleError(_0x49814e,null));};exports[_0x2cf9('0x21')]=function(_0x2b89e5,_0x4074e9){return db[_0x2cf9('0x27')][_0x2cf9('0x46')]({'where':{'id':_0x2b89e5[_0x2cf9('0x42')]['id']}})[_0x2cf9('0x20')](handleEntityNotFound(_0x4074e9,null))[_0x2cf9('0x20')](removeEntity(_0x4074e9,null))[_0x2cf9('0x40')](handleError(_0x4074e9,null));};exports[_0x2cf9('0x47')]=function(_0x24300d,_0x416e4b,_0x1f82e0){var _0x29638d={};var _0x4189f5={};var _0x2154b3;var _0x3c9741;return db['SugarcrmAccount'][_0x2cf9('0x48')]({'where':{'id':_0x24300d['params']['id']}})['then'](handleEntityNotFound(_0x416e4b,null))['then'](function(_0x9b2def){if(_0x9b2def){_0x2154b3=_0x9b2def;_0x4189f5[_0x2cf9('0x2b')]=_['keys'](db['SugarcrmConfiguration'][_0x2cf9('0x28')]);_0x4189f5[_0x2cf9('0x2c')]=_[_0x2cf9('0x2d')](_0x24300d[_0x2cf9('0x2c')]);_0x4189f5['filters']=_[_0x2cf9('0x2e')](_0x4189f5['model'],_0x4189f5[_0x2cf9('0x2c')]);_0x29638d['attributes']=_[_0x2cf9('0x2e')](_0x4189f5[_0x2cf9('0x2b')],qs[_0x2cf9('0x30')](_0x24300d['query'][_0x2cf9('0x30')]));_0x29638d['attributes']=_0x29638d[_0x2cf9('0x2f')][_0x2cf9('0x31')]?_0x29638d[_0x2cf9('0x2f')]:_0x4189f5[_0x2cf9('0x2b')];_0x29638d[_0x2cf9('0x33')]=qs['sort'](_0x24300d[_0x2cf9('0x2c')][_0x2cf9('0x34')]);_0x29638d[_0x2cf9('0x35')]=qs[_0x2cf9('0x36')](_[_0x2cf9('0x49')](_0x24300d[_0x2cf9('0x2c')],_0x4189f5[_0x2cf9('0x36')]));if(_0x24300d['query']['filter']){_0x29638d[_0x2cf9('0x35')]=_[_0x2cf9('0x38')](_0x29638d['where'],{'$or':_['map'](_0x29638d['attributes'],function(_0xd1102b){var _0x3cae1e={};_0x3cae1e[_0xd1102b]={'$like':'%'+_0x24300d[_0x2cf9('0x2c')][_0x2cf9('0x37')]+'%'};return _0x3cae1e;})});}_0x29638d=_[_0x2cf9('0x38')]({},_0x29638d,_0x24300d[_0x2cf9('0x3b')]);return _0x2154b3[_0x2cf9('0x47')](_0x29638d);}})['then'](function(_0x1e083c){if(_0x1e083c){_0x3c9741=_0x1e083c[_0x2cf9('0x31')];if(!_0x24300d['query']['hasOwnProperty']('nolimit')){_0x29638d[_0x2cf9('0x18')]=qs[_0x2cf9('0x18')](_0x24300d['query']['limit']);_0x29638d[_0x2cf9('0x1b')]=qs[_0x2cf9('0x1b')](_0x24300d['query'][_0x2cf9('0x1b')]);}return _0x2154b3[_0x2cf9('0x47')](_0x29638d);}})[_0x2cf9('0x20')](function(_0x3ad22a){if(_0x3ad22a){return _0x3ad22a?{'count':_0x3c9741,'rows':_0x3ad22a}:null;}})[_0x2cf9('0x20')](respondWithResult(_0x416e4b,null))['catch'](handleError(_0x416e4b,null));};exports['addConfiguration']=function(_0xa0d070,_0x38473b,_0x5dc330){if(_0xa0d070[_0x2cf9('0x45')]['id']){delete _0xa0d070[_0x2cf9('0x45')]['id'];}return db[_0x2cf9('0x27')]['findOne']({'where':{'id':_0xa0d070[_0x2cf9('0x42')]['id']}})[_0x2cf9('0x20')](handleEntityNotFound(_0x38473b,null))[_0x2cf9('0x20')](function(_0x14947f){if(_0x14947f){_0xa0d070['body'][_0x2cf9('0x4a')]=_0x14947f['id'];_0xa0d070['body']['Subjects']=integrations['getSubjects'](_0xa0d070['body'][_0x2cf9('0x4b')],_0xa0d070[_0x2cf9('0x45')][_0x2cf9('0x39')]);_0xa0d070[_0x2cf9('0x45')][_0x2cf9('0x4c')]=integrations[_0x2cf9('0x4d')](_0xa0d070[_0x2cf9('0x45')][_0x2cf9('0x4b')],_0xa0d070[_0x2cf9('0x45')][_0x2cf9('0x39')]);return db[_0x2cf9('0x4e')][_0x2cf9('0x43')](_0xa0d070[_0x2cf9('0x45')],{'include':[{'model':db[_0x2cf9('0x4f')],'as':_0x2cf9('0x50')},{'model':db[_0x2cf9('0x4f')],'as':_0x2cf9('0x4c')}]});}return null;})[_0x2cf9('0x20')](respondWithResult(_0x38473b,null))[_0x2cf9('0x40')](handleError(_0x38473b,null));};exports['getFields']=function(_0x232edf,_0x5923bc,_0x54be78){var _0x2afb8b='';var _0x55e864=['id',_0x2cf9('0x24'),_0x2cf9('0x51'),_0x2cf9('0x52'),'description','date_start','duration_hours','duration_minutes',_0x2cf9('0x53'),'parent_type',_0x2cf9('0x54'),'direction'];return db[_0x2cf9('0x27')][_0x2cf9('0x48')]({'where':{'id':_0x232edf[_0x2cf9('0x42')]['id']},'attributes':['id',_0x2cf9('0x55'),_0x2cf9('0x56'),_0x2cf9('0x57')]})[_0x2cf9('0x20')](handleEntityNotFound(_0x5923bc,null))[_0x2cf9('0x20')](function(_0x414647){if(_0x414647){_0x2afb8b=_0x414647['remoteUri'];var _0x53df66=_0x2afb8b[_0x2cf9('0x58')](-0x1);if(_0x53df66==='/'){_0x2afb8b=_0x2afb8b[_0x2cf9('0x59')](0x0,_0x2afb8b[_0x2cf9('0x5a')](_0x53df66));}return rp({'method':'POST','uri':util[_0x2cf9('0x5b')](_0x2cf9('0x5c'),_0x2afb8b,_0x2cf9('0x5d')),'json':!![],'form':{'method':_0x2cf9('0x5e'),'input_type':_0x2cf9('0x5f'),'response_type':_0x2cf9('0x5f'),'rest_data':JSON[_0x2cf9('0x60')]({'user_auth':{'user_name':_0x414647['username'],'password':_0x414647[_0x2cf9('0x56')],'encryption':'PLAIN'},'application':_0x2cf9('0x61')})}});}})[_0x2cf9('0x20')](function(_0x412a24){if(_0x412a24&&_0x412a24['name']!==_0x2cf9('0x62')&&_0x412a24[_0x2cf9('0x24')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x2cf9('0x5b')](_0x2cf9('0x5c'),_0x2afb8b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2cf9('0x63'),'input_type':_0x2cf9('0x5f'),'response_type':_0x2cf9('0x5f'),'rest_data':JSON['stringify']({'session':_0x412a24['id'],'module_name':_0x2cf9('0x64')})}})[_0x2cf9('0x20')](function(_0x4dead9){if(_0x4dead9){var _0x11f4e3=_[_0x2cf9('0x65')](_0x4dead9[_0x2cf9('0x66')]);_['remove'](_0x11f4e3,function(_0x58774b){return _0x55e864['includes'](_0x58774b[_0x2cf9('0x24')]);});return{'count':_0x11f4e3[_0x2cf9('0x31')],'rows':_[_0x2cf9('0x26')](_0x11f4e3,function(_0x1b4c7b){return{'id':_0x1b4c7b[_0x2cf9('0x24')],'name':_0x1b4c7b[_0x2cf9('0x67')],'custom':_[_0x2cf9('0x68')](_0x1b4c7b[_0x2cf9('0x24')],'_c')?!![]:![],'options':_0x1b4c7b[_0x2cf9('0x3b')]?_[_0x2cf9('0x26')](_['values'](_0x1b4c7b['options']),function(_0x48aaff){return{'name':_0x48aaff[_0x2cf9('0x69')],'value':_0x48aaff[_0x2cf9('0x24')]};}):[]};})};}})[_0x2cf9('0x20')](respondWithResult(_0x5923bc,null))[_0x2cf9('0x40')](function(_0x125266){var _0x3de458=_0x232edf[_0x2cf9('0x2c')][_0x2cf9('0x6a')]?0x1f4:_0x125266[_0x2cf9('0x6b')]||0x1f4;logger[_0x2cf9('0x22')](_0x2cf9('0x6c'),_0x2cf9('0x6d'),_0x3de458,JSON[_0x2cf9('0x60')](_0x125266));delete _0x125266[_0x2cf9('0x24')];if(_0x3de458===0x191){_0x3de458=0x190;}_0x5923bc[_0x2cf9('0x15')](_0x3de458)['send'](_0x232edf[_0x2cf9('0x2c')][_0x2cf9('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x125266[_0x2cf9('0x6b')]}:_0x125266);});}else{var _0x5de11f=0x1f4;_0x5923bc['status'](_0x5de11f)[_0x2cf9('0x6e')]({'message':_0x2cf9('0x6f'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xcf1d=['stack','name','send','index','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','SugarcrmAccount','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','length','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error'];(function(_0x37ede0,_0x238899){var _0x4a7c39=function(_0xe6fbc1){while(--_0xe6fbc1){_0x37ede0['push'](_0x37ede0['shift']());}};_0x4a7c39(++_0x238899);}(_0xcf1d,0x143));var _0xdcf1=function(_0x1c6af1,_0x3cadc6){_0x1c6af1=_0x1c6af1-0x0;var _0x1ef3a3=_0xcf1d[_0x1c6af1];return _0x1ef3a3;};'use strict';var emlformat=require(_0xdcf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcf1('0x1'));var jsonpatch=require(_0xdcf1('0x2'));var rp=require(_0xdcf1('0x3'));var moment=require(_0xdcf1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdcf1('0x5'));var util=require(_0xdcf1('0x6'));var path=require(_0xdcf1('0x7'));var sox=require(_0xdcf1('0x8'));var csv=require(_0xdcf1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdcf1('0xa'));var _=require(_0xdcf1('0xb'));var squel=require(_0xdcf1('0xc'));var crypto=require(_0xdcf1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdcf1('0x9'));var querystring=require(_0xdcf1('0xe'));var Papa=require(_0xdcf1('0xf'));var Redis=require(_0xdcf1('0x10'));var authService=require(_0xdcf1('0x11'));var qs=require(_0xdcf1('0x12'));var as=require(_0xdcf1('0x13'));var hardwareService=require(_0xdcf1('0x14'));var logger=require(_0xdcf1('0x15'))(_0xdcf1('0x16'));var utils=require(_0xdcf1('0x17'));var config=require(_0xdcf1('0x18'));var licenseUtil=require(_0xdcf1('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdcf1('0x1a'));function respondWithStatusCode(_0x1cfc03,_0x4e9e93){_0x4e9e93=_0x4e9e93||0xcc;return function(_0x47d2a2){if(_0x47d2a2){return _0x1cfc03[_0xdcf1('0x1b')](_0x4e9e93);}return _0x1cfc03[_0xdcf1('0x1c')](_0x4e9e93)[_0xdcf1('0x1d')]();};}function respondWithResult(_0x54e9da,_0x22042e){_0x22042e=_0x22042e||0xc8;return function(_0x17069e){if(_0x17069e){return _0x54e9da[_0xdcf1('0x1c')](_0x22042e)[_0xdcf1('0x1e')](_0x17069e);}};}function respondWithFilteredResult(_0x7088e3,_0x5b9cfb){return function(_0x458124){if(_0x458124){var _0x585cb9=typeof _0x5b9cfb[_0xdcf1('0x1f')]===_0xdcf1('0x20')&&typeof _0x5b9cfb[_0xdcf1('0x21')]===_0xdcf1('0x20');var _0x114a8b=_0x458124['count'];var _0x561976=_0x585cb9?0x0:_0x5b9cfb[_0xdcf1('0x1f')];var _0x2444fe=_0x585cb9?_0x458124[_0xdcf1('0x22')]:_0x5b9cfb['offset']+_0x5b9cfb[_0xdcf1('0x21')];var _0x24ca28;if(_0x2444fe>=_0x114a8b){_0x2444fe=_0x114a8b;_0x24ca28=0xc8;}else{_0x24ca28=0xce;}_0x7088e3[_0xdcf1('0x1c')](_0x24ca28);return _0x7088e3[_0xdcf1('0x23')](_0xdcf1('0x24'),_0x561976+'-'+_0x2444fe+'/'+_0x114a8b)['json'](_0x458124);}return null;};}function patchUpdates(_0x5bfa6e){return function(_0x3b3930){try{jsonpatch['apply'](_0x3b3930,_0x5bfa6e,!![]);}catch(_0xbf537){return BPromise[_0xdcf1('0x25')](_0xbf537);}return _0x3b3930[_0xdcf1('0x26')]();};}function saveUpdates(_0x29bf8f,_0x10ccce){return function(_0x23bfaa){if(_0x23bfaa){return _0x23bfaa[_0xdcf1('0x27')](_0x29bf8f)['then'](function(_0x3adede){return _0x3adede;});}return null;};}function removeEntity(_0x3e81ab,_0x506702){return function(_0x526190){if(_0x526190){return _0x526190[_0xdcf1('0x28')]()[_0xdcf1('0x29')](function(){_0x3e81ab[_0xdcf1('0x1c')](0xcc)[_0xdcf1('0x1d')]();});}};}function handleEntityNotFound(_0x42ce88,_0x13f8f5){return function(_0x4addb3){if(!_0x4addb3){_0x42ce88['sendStatus'](0x194);}return _0x4addb3;};}function handleError(_0x326d0f,_0x3c1dd4){_0x3c1dd4=_0x3c1dd4||0x1f4;return function(_0x142a31){logger[_0xdcf1('0x2a')](_0x142a31[_0xdcf1('0x2b')]);if(_0x142a31[_0xdcf1('0x2c')]){delete _0x142a31[_0xdcf1('0x2c')];}_0x326d0f[_0xdcf1('0x1c')](_0x3c1dd4)[_0xdcf1('0x2d')](_0x142a31);};}exports[_0xdcf1('0x2e')]=function(_0x14d70d,_0x1210d3){var _0x487fdd={},_0x22ced3={},_0x5d266e={'count':0x0,'rows':[]};var _0xb4bf25=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0x1284f1){return{'name':_0x1284f1[_0xdcf1('0x2f')],'type':_0x1284f1[_0xdcf1('0x30')][_0xdcf1('0x31')]};});_0x22ced3['model']=_[_0xdcf1('0x32')](_0xb4bf25,'name');_0x22ced3[_0xdcf1('0x33')]=_[_0xdcf1('0x34')](_0x14d70d['query']);_0x22ced3[_0xdcf1('0x35')]=_[_0xdcf1('0x36')](_0x22ced3[_0xdcf1('0x37')],_0x22ced3[_0xdcf1('0x33')]);_0x487fdd[_0xdcf1('0x38')]=_['intersection'](_0x22ced3[_0xdcf1('0x37')],qs[_0xdcf1('0x39')](_0x14d70d['query'][_0xdcf1('0x39')]));_0x487fdd['attributes']=_0x487fdd[_0xdcf1('0x38')]['length']?_0x487fdd[_0xdcf1('0x38')]:_0x22ced3['model'];if(!_0x14d70d[_0xdcf1('0x33')][_0xdcf1('0x3a')](_0xdcf1('0x3b'))){_0x487fdd['limit']=qs['limit'](_0x14d70d[_0xdcf1('0x33')][_0xdcf1('0x21')]);_0x487fdd[_0xdcf1('0x1f')]=qs[_0xdcf1('0x1f')](_0x14d70d['query'][_0xdcf1('0x1f')]);}_0x487fdd[_0xdcf1('0x3c')]=qs[_0xdcf1('0x3d')](_0x14d70d[_0xdcf1('0x33')][_0xdcf1('0x3d')]);_0x487fdd['where']=qs['filters'](_[_0xdcf1('0x3e')](_0x14d70d[_0xdcf1('0x33')],_0x22ced3['filters']),_0xb4bf25);if(_0x14d70d[_0xdcf1('0x33')]['filter']){_0x487fdd[_0xdcf1('0x3f')]=_[_0xdcf1('0x40')](_0x487fdd[_0xdcf1('0x3f')],{'$or':_['map'](_0xb4bf25,function(_0x4ae70b){if(_0x4ae70b['type']!=='VIRTUAL'){var _0x3c8058={};_0x3c8058[_0x4ae70b[_0xdcf1('0x2c')]]={'$like':'%'+_0x14d70d[_0xdcf1('0x33')]['filter']+'%'};return _0x3c8058;}})});}_0x487fdd=_[_0xdcf1('0x40')]({},_0x487fdd,_0x14d70d[_0xdcf1('0x41')]);var _0x503208={'where':_0x487fdd['where']};return db[_0xdcf1('0x42')][_0xdcf1('0x22')](_0x503208)['then'](function(_0x31546b){_0x5d266e[_0xdcf1('0x22')]=_0x31546b;if(_0x14d70d['query'][_0xdcf1('0x43')]){_0x487fdd[_0xdcf1('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xdcf1('0x45')](_0x487fdd);})[_0xdcf1('0x29')](function(_0x474955){_0x5d266e[_0xdcf1('0x46')]=_0x474955;return _0x5d266e;})[_0xdcf1('0x29')](respondWithFilteredResult(_0x1210d3,_0x487fdd))['catch'](handleError(_0x1210d3,null));};exports['show']=function(_0xc40b69,_0x440720){var _0x182fe8={'raw':![],'where':{'id':_0xc40b69[_0xdcf1('0x47')]['id']}},_0x35cb0a={};_0x35cb0a[_0xdcf1('0x37')]=_[_0xdcf1('0x34')](db[_0xdcf1('0x42')][_0xdcf1('0x48')]);_0x35cb0a['query']=_[_0xdcf1('0x34')](_0xc40b69[_0xdcf1('0x33')]);_0x35cb0a[_0xdcf1('0x35')]=_[_0xdcf1('0x36')](_0x35cb0a['model'],_0x35cb0a[_0xdcf1('0x33')]);_0x182fe8[_0xdcf1('0x38')]=_[_0xdcf1('0x36')](_0x35cb0a[_0xdcf1('0x37')],qs[_0xdcf1('0x39')](_0xc40b69[_0xdcf1('0x33')][_0xdcf1('0x39')]));_0x182fe8[_0xdcf1('0x38')]=_0x182fe8[_0xdcf1('0x38')]['length']?_0x182fe8[_0xdcf1('0x38')]:_0x35cb0a[_0xdcf1('0x37')];if(_0xc40b69['query'][_0xdcf1('0x43')]){_0x182fe8['include']=[{'all':!![]}];}_0x182fe8=_[_0xdcf1('0x40')]({},_0x182fe8,_0xc40b69[_0xdcf1('0x41')]);return db[_0xdcf1('0x42')][_0xdcf1('0x49')](_0x182fe8)[_0xdcf1('0x29')](handleEntityNotFound(_0x440720,null))['then'](respondWithResult(_0x440720,null))[_0xdcf1('0x4a')](handleError(_0x440720,null));};exports[_0xdcf1('0x4b')]=function(_0x54f74a,_0x4d8adb){return db[_0xdcf1('0x42')][_0xdcf1('0x4b')](_0x54f74a['body'],{})['then'](respondWithResult(_0x4d8adb,0xc9))['catch'](handleError(_0x4d8adb,null));};exports[_0xdcf1('0x27')]=function(_0x91243,_0x4955d2){if(_0x91243[_0xdcf1('0x4c')]['id']){delete _0x91243[_0xdcf1('0x4c')]['id'];}return db[_0xdcf1('0x42')][_0xdcf1('0x49')]({'where':{'id':_0x91243[_0xdcf1('0x47')]['id']}})['then'](handleEntityNotFound(_0x4955d2,null))[_0xdcf1('0x29')](saveUpdates(_0x91243[_0xdcf1('0x4c')],null))['then'](respondWithResult(_0x4955d2,null))[_0xdcf1('0x4a')](handleError(_0x4955d2,null));};exports[_0xdcf1('0x28')]=function(_0x550d5c,_0x3460cd){return db[_0xdcf1('0x42')][_0xdcf1('0x49')]({'where':{'id':_0x550d5c['params']['id']}})[_0xdcf1('0x29')](handleEntityNotFound(_0x3460cd,null))[_0xdcf1('0x29')](removeEntity(_0x3460cd,null))[_0xdcf1('0x4a')](handleError(_0x3460cd,null));};exports[_0xdcf1('0x4d')]=function(_0x4f0516,_0x2dcf42,_0x4cad68){var _0x32fda6={};var _0x959592={};var _0x5721e3;var _0x17713f;return db[_0xdcf1('0x42')][_0xdcf1('0x4e')]({'where':{'id':_0x4f0516['params']['id']}})[_0xdcf1('0x29')](handleEntityNotFound(_0x2dcf42,null))[_0xdcf1('0x29')](function(_0x26a03d){if(_0x26a03d){_0x5721e3=_0x26a03d;_0x959592[_0xdcf1('0x37')]=_[_0xdcf1('0x34')](db[_0xdcf1('0x4f')][_0xdcf1('0x48')]);_0x959592['query']=_[_0xdcf1('0x34')](_0x4f0516['query']);_0x959592[_0xdcf1('0x35')]=_['intersection'](_0x959592[_0xdcf1('0x37')],_0x959592['query']);_0x32fda6[_0xdcf1('0x38')]=_[_0xdcf1('0x36')](_0x959592['model'],qs[_0xdcf1('0x39')](_0x4f0516[_0xdcf1('0x33')][_0xdcf1('0x39')]));_0x32fda6[_0xdcf1('0x38')]=_0x32fda6['attributes'][_0xdcf1('0x50')]?_0x32fda6[_0xdcf1('0x38')]:_0x959592['model'];_0x32fda6[_0xdcf1('0x3c')]=qs[_0xdcf1('0x3d')](_0x4f0516['query'][_0xdcf1('0x3d')]);_0x32fda6[_0xdcf1('0x3f')]=qs[_0xdcf1('0x35')](_[_0xdcf1('0x3e')](_0x4f0516['query'],_0x959592[_0xdcf1('0x35')]));if(_0x4f0516['query'][_0xdcf1('0x51')]){_0x32fda6['where']=_[_0xdcf1('0x40')](_0x32fda6[_0xdcf1('0x3f')],{'$or':_['map'](_0x32fda6['attributes'],function(_0x596e66){var _0x3d4369={};_0x3d4369[_0x596e66]={'$like':'%'+_0x4f0516[_0xdcf1('0x33')][_0xdcf1('0x51')]+'%'};return _0x3d4369;})});}_0x32fda6=_[_0xdcf1('0x40')]({},_0x32fda6,_0x4f0516['options']);return _0x5721e3['getConfigurations'](_0x32fda6);}})[_0xdcf1('0x29')](function(_0x5d8d54){if(_0x5d8d54){_0x17713f=_0x5d8d54[_0xdcf1('0x50')];if(!_0x4f0516[_0xdcf1('0x33')][_0xdcf1('0x3a')]('nolimit')){_0x32fda6[_0xdcf1('0x21')]=qs[_0xdcf1('0x21')](_0x4f0516['query'][_0xdcf1('0x21')]);_0x32fda6[_0xdcf1('0x1f')]=qs[_0xdcf1('0x1f')](_0x4f0516[_0xdcf1('0x33')]['offset']);}return _0x5721e3[_0xdcf1('0x4d')](_0x32fda6);}})['then'](function(_0x175871){if(_0x175871){return _0x175871?{'count':_0x17713f,'rows':_0x175871}:null;}})[_0xdcf1('0x29')](respondWithResult(_0x2dcf42,null))['catch'](handleError(_0x2dcf42,null));};exports[_0xdcf1('0x52')]=function(_0x547cf6,_0x58796a,_0x2142f0){if(_0x547cf6[_0xdcf1('0x4c')]['id']){delete _0x547cf6[_0xdcf1('0x4c')]['id'];}return db['SugarcrmAccount'][_0xdcf1('0x4e')]({'where':{'id':_0x547cf6['params']['id']}})[_0xdcf1('0x29')](handleEntityNotFound(_0x58796a,null))[_0xdcf1('0x29')](function(_0x279e8b){if(_0x279e8b){_0x547cf6[_0xdcf1('0x4c')]['AccountId']=_0x279e8b['id'];_0x547cf6[_0xdcf1('0x4c')][_0xdcf1('0x53')]=integrations[_0xdcf1('0x54')](_0x547cf6['body'][_0xdcf1('0x55')],_0x547cf6[_0xdcf1('0x4c')]['type']);_0x547cf6['body'][_0xdcf1('0x56')]=integrations[_0xdcf1('0x57')](_0x547cf6[_0xdcf1('0x4c')][_0xdcf1('0x55')],_0x547cf6[_0xdcf1('0x4c')][_0xdcf1('0x30')]);return db[_0xdcf1('0x4f')]['create'](_0x547cf6['body'],{'include':[{'model':db[_0xdcf1('0x58')],'as':_0xdcf1('0x53')},{'model':db[_0xdcf1('0x58')],'as':_0xdcf1('0x56')}]});}return null;})[_0xdcf1('0x29')](respondWithResult(_0x58796a,null))[_0xdcf1('0x4a')](handleError(_0x58796a,null));};exports['getFields']=function(_0x5c958e,_0x274dc6,_0x144fb4){var _0x51094b='';var _0x3b4c64=['id',_0xdcf1('0x2c'),_0xdcf1('0x59'),_0xdcf1('0x5a'),'description',_0xdcf1('0x5b'),_0xdcf1('0x5c'),_0xdcf1('0x5d'),_0xdcf1('0x5e'),_0xdcf1('0x5f'),_0xdcf1('0x60'),_0xdcf1('0x61')];return db[_0xdcf1('0x42')]['findOne']({'where':{'id':_0x5c958e[_0xdcf1('0x47')]['id']},'attributes':['id',_0xdcf1('0x62'),_0xdcf1('0x63'),_0xdcf1('0x64')]})[_0xdcf1('0x29')](handleEntityNotFound(_0x274dc6,null))['then'](function(_0x2f5197){if(_0x2f5197){_0x51094b=_0x2f5197[_0xdcf1('0x64')];var _0x332026=_0x51094b['slice'](-0x1);if(_0x332026==='/'){_0x51094b=_0x51094b['substring'](0x0,_0x51094b['lastIndexOf'](_0x332026));}return rp({'method':_0xdcf1('0x65'),'uri':util[_0xdcf1('0x66')](_0xdcf1('0x67'),_0x51094b,_0xdcf1('0x68')),'json':!![],'form':{'method':_0xdcf1('0x69'),'input_type':_0xdcf1('0x6a'),'response_type':_0xdcf1('0x6a'),'rest_data':JSON[_0xdcf1('0x6b')]({'user_auth':{'user_name':_0x2f5197['username'],'password':_0x2f5197[_0xdcf1('0x63')],'encryption':'PLAIN'},'application':_0xdcf1('0x6c')})}});}})[_0xdcf1('0x29')](function(_0x12306d){if(_0x12306d&&_0x12306d[_0xdcf1('0x2c')]!==_0xdcf1('0x6d')&&_0x12306d['name']!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xdcf1('0x66')](_0xdcf1('0x67'),_0x51094b,_0xdcf1('0x68')),'json':!![],'form':{'method':_0xdcf1('0x6e'),'input_type':_0xdcf1('0x6a'),'response_type':'JSON','rest_data':JSON[_0xdcf1('0x6b')]({'session':_0x12306d['id'],'module_name':_0xdcf1('0x6f')})}})['then'](function(_0x3109e4){if(_0x3109e4){var _0xc8430c=_[_0xdcf1('0x70')](_0x3109e4[_0xdcf1('0x71')]);_[_0xdcf1('0x72')](_0xc8430c,function(_0x515a38){return _0x3b4c64[_0xdcf1('0x73')](_0x515a38[_0xdcf1('0x2c')]);});return{'count':_0xc8430c['length'],'rows':_[_0xdcf1('0x32')](_0xc8430c,function(_0x29a7bb){return{'id':_0x29a7bb[_0xdcf1('0x2c')],'name':_0x29a7bb['label'],'custom':_[_0xdcf1('0x74')](_0x29a7bb[_0xdcf1('0x2c')],'_c')?!![]:![],'options':_0x29a7bb[_0xdcf1('0x41')]?_[_0xdcf1('0x32')](_[_0xdcf1('0x70')](_0x29a7bb[_0xdcf1('0x41')]),function(_0x5e06a5){return{'name':_0x5e06a5['value'],'value':_0x5e06a5[_0xdcf1('0x2c')]};}):[]};})};}})[_0xdcf1('0x29')](respondWithResult(_0x274dc6,null))['catch'](function(_0x51f2f3){var _0x488093=_0x5c958e[_0xdcf1('0x33')][_0xdcf1('0x75')]?0x1f4:_0x51f2f3[_0xdcf1('0x76')]||0x1f4;logger[_0xdcf1('0x2a')](_0xdcf1('0x77'),_0xdcf1('0x78'),_0x488093,JSON[_0xdcf1('0x6b')](_0x51f2f3));delete _0x51f2f3['name'];if(_0x488093===0x191){_0x488093=0x190;}_0x274dc6[_0xdcf1('0x1c')](_0x488093)['send'](_0x5c958e[_0xdcf1('0x33')][_0xdcf1('0x75')]?{'message':_0xdcf1('0x79'),'statusCode':_0x51f2f3['statusCode']}:_0x51f2f3);});}else{var _0x4135b4=0x1f4;_0x274dc6[_0xdcf1('0x1c')](_0x4135b4)['send']({'message':_0xdcf1('0x79'),'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 22ae0df..ded8287 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 _0xe3cc=['../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xe3cc,0x122));var _0xce3c=function(_0xdecfdd,_0x375f9b){_0xdecfdd=_0xdecfdd-0x0;var _0x2fdb56=_0xe3cc[_0xdecfdd];return _0x2fdb56;};'use strict';var _=require(_0xce3c('0x0'));var util=require(_0xce3c('0x1'));var logger=require(_0xce3c('0x2'))('api');var moment=require(_0xce3c('0x3'));var BPromise=require(_0xce3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce3c('0x5'));var rimraf=require(_0xce3c('0x6'));var config=require(_0xce3c('0x7'));var attributes=require(_0xce3c('0x8'));var integrations=require(_0xce3c('0x9'));module[_0xce3c('0xa')]=function(_0x116073,_0x285f95){return _0x116073['define'](_0xce3c('0xb'),attributes,{'tableName':_0xce3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b22=['SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x291270,_0x8f4f34){var _0x21e5a3=function(_0x37e40d){while(--_0x37e40d){_0x291270['push'](_0x291270['shift']());}};_0x21e5a3(++_0x8f4f34);}(_0x7b22,0x1e6));var _0x27b2=function(_0x295a92,_0x7d70dc){_0x295a92=_0x295a92-0x0;var _0x3f5dac=_0x7b22[_0x295a92];return _0x3f5dac;};'use strict';var _=require('lodash');var util=require(_0x27b2('0x0'));var logger=require(_0x27b2('0x1'))(_0x27b2('0x2'));var moment=require('moment');var BPromise=require(_0x27b2('0x3'));var rp=require(_0x27b2('0x4'));var fs=require('fs');var path=require(_0x27b2('0x5'));var rimraf=require(_0x27b2('0x6'));var config=require(_0x27b2('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x27b2('0x8'));module['exports']=function(_0x10205b,_0x5dcd80){return _0x10205b['define'](_0x27b2('0x9'),attributes,{'tableName':_0x27b2('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 30eb525..4c633d9 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 _0xe5b1=['code','message','result','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','include','map','stringify','catch','ShowSugarcrmAccount','find','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x5d7acc,_0x19815c){var _0x4af4c7=function(_0x2e47a3){while(--_0x2e47a3){_0x5d7acc['push'](_0x5d7acc['shift']());}};_0x4af4c7(++_0x19815c);}(_0xe5b1,0x165));var _0x1e5b=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0xe5b1[_0x193ddf];return _0x5bc6df;};'use strict';var _=require(_0x1e5b('0x0'));var util=require('util');var moment=require(_0x1e5b('0x1'));var BPromise=require(_0x1e5b('0x2'));var rs=require(_0x1e5b('0x3'));var fs=require('fs');var Redis=require(_0x1e5b('0x4'));var db=require(_0x1e5b('0x5'))['db'];var utils=require(_0x1e5b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e5b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24be60,_0x8595ad,_0x2268a5){return new BPromise(function(_0x3fc63d,_0x5e146a){return client[_0x1e5b('0x9')](_0x24be60,_0x2268a5)[_0x1e5b('0xa')](function(_0x186957){logger[_0x1e5b('0xb')](_0x1e5b('0xc'),_0x8595ad,_0x1e5b('0xd'));logger[_0x1e5b('0xe')](_0x1e5b('0xf'),_0x8595ad,_0x1e5b('0xd'),JSON['stringify'](_0x186957));if(_0x186957[_0x1e5b('0x10')]){if(_0x186957[_0x1e5b('0x10')][_0x1e5b('0x11')]===0x1f4){logger[_0x1e5b('0x10')](_0x1e5b('0xc'),_0x8595ad,_0x186957['error'][_0x1e5b('0x12')]);return _0x5e146a(_0x186957[_0x1e5b('0x10')]['message']);}logger[_0x1e5b('0x10')](_0x1e5b('0xc'),_0x8595ad,_0x186957[_0x1e5b('0x10')]['message']);return _0x3fc63d(_0x186957['error'][_0x1e5b('0x12')]);}else{logger[_0x1e5b('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x8595ad,_0x1e5b('0xd'));_0x3fc63d(_0x186957[_0x1e5b('0x13')][_0x1e5b('0x12')]);}})['catch'](function(_0x271f8b){logger[_0x1e5b('0x10')](_0x1e5b('0xc'),_0x8595ad,_0x271f8b);_0x5e146a(_0x271f8b);});});}exports[_0x1e5b('0x14')]=function(_0x28dc1c){var _0x5c086d=this;return new Promise(function(_0x28a421,_0x2cc6cf){return db[_0x1e5b('0x15')]['findAll']({'raw':_0x28dc1c[_0x1e5b('0x16')]?_0x28dc1c[_0x1e5b('0x16')][_0x1e5b('0x17')]===undefined?!![]:![]:!![],'where':_0x28dc1c[_0x1e5b('0x16')]?_0x28dc1c[_0x1e5b('0x16')][_0x1e5b('0x18')]||null:null,'attributes':_0x28dc1c[_0x1e5b('0x16')]?_0x28dc1c[_0x1e5b('0x16')][_0x1e5b('0x19')]||null:null,'limit':_0x28dc1c[_0x1e5b('0x16')]?_0x28dc1c[_0x1e5b('0x16')][_0x1e5b('0x1a')]||null:null,'include':_0x28dc1c['options']?_0x28dc1c['options'][_0x1e5b('0x1b')]?_[_0x1e5b('0x1c')](_0x28dc1c['options'][_0x1e5b('0x1b')],function(_0x1c8b89){return{'model':db[_0x1c8b89['model']],'as':_0x1c8b89['as'],'attributes':_0x1c8b89[_0x1e5b('0x19')],'include':_0x1c8b89[_0x1e5b('0x1b')]?_[_0x1e5b('0x1c')](_0x1c8b89[_0x1e5b('0x1b')],function(_0x18166f){return{'model':db[_0x18166f['model']],'as':_0x18166f['as'],'attributes':_0x18166f['attributes'],'include':_0x18166f[_0x1e5b('0x1b')]?_[_0x1e5b('0x1c')](_0x18166f[_0x1e5b('0x1b')],function(_0x1a6d7b){return{'model':db[_0x1a6d7b['model']],'as':_0x1a6d7b['as'],'attributes':_0x1a6d7b[_0x1e5b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1e5b('0xa')](function(_0x432656){logger[_0x1e5b('0xb')](_0x1e5b('0x14'),_0x28dc1c);logger[_0x1e5b('0xe')](_0x1e5b('0x14'),_0x28dc1c,JSON[_0x1e5b('0x1d')](_0x432656));_0x28a421(_0x432656);})[_0x1e5b('0x1e')](function(_0x3eeb83){logger[_0x1e5b('0x10')](_0x1e5b('0x14'),_0x3eeb83[_0x1e5b('0x12')],_0x28dc1c);_0x2cc6cf(_0x5c086d[_0x1e5b('0x10')](0x1f4,_0x3eeb83[_0x1e5b('0x12')]));});});};exports[_0x1e5b('0x1f')]=function(_0x1930e8){var _0x20bad4=this;return new Promise(function(_0x27e382,_0x4364a8){return db[_0x1e5b('0x15')][_0x1e5b('0x20')]({'raw':_0x1930e8[_0x1e5b('0x16')]?_0x1930e8[_0x1e5b('0x16')][_0x1e5b('0x17')]===undefined?!![]:![]:!![],'where':_0x1930e8[_0x1e5b('0x16')]?_0x1930e8['options'][_0x1e5b('0x18')]||null:null,'attributes':_0x1930e8['options']?_0x1930e8[_0x1e5b('0x16')][_0x1e5b('0x19')]||null:null,'include':_0x1930e8[_0x1e5b('0x16')]?_0x1930e8[_0x1e5b('0x16')][_0x1e5b('0x1b')]?_[_0x1e5b('0x1c')](_0x1930e8[_0x1e5b('0x16')][_0x1e5b('0x1b')],function(_0x885369){return{'model':db[_0x885369[_0x1e5b('0x21')]],'as':_0x885369['as'],'attributes':_0x885369[_0x1e5b('0x19')],'include':_0x885369[_0x1e5b('0x1b')]?_[_0x1e5b('0x1c')](_0x885369[_0x1e5b('0x1b')],function(_0x14d7e3){return{'model':db[_0x14d7e3[_0x1e5b('0x21')]],'as':_0x14d7e3['as'],'attributes':_0x14d7e3[_0x1e5b('0x19')],'include':_0x14d7e3['include']?_[_0x1e5b('0x1c')](_0x14d7e3[_0x1e5b('0x1b')],function(_0x28e31d){return{'model':db[_0x28e31d[_0x1e5b('0x21')]],'as':_0x28e31d['as'],'attributes':_0x28e31d[_0x1e5b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x100fa3){logger[_0x1e5b('0xb')]('ShowSugarcrmAccount',_0x1930e8);logger['debug'](_0x1e5b('0x1f'),_0x1930e8,JSON[_0x1e5b('0x1d')](_0x100fa3));_0x27e382(_0x100fa3);})[_0x1e5b('0x1e')](function(_0x14284b){logger[_0x1e5b('0x10')](_0x1e5b('0x1f'),_0x14284b[_0x1e5b('0x12')],_0x1930e8);_0x4364a8(_0x20bad4[_0x1e5b('0x10')](0x1f4,_0x14284b[_0x1e5b('0x12')]));});});}; \ No newline at end of file +var _0x55ed=['stringify','error','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0x55ed,0x1da));var _0xd55e=function(_0x292561,_0x2f3ebc){_0x292561=_0x292561-0x0;var _0x114e7c=_0x55ed[_0x292561];return _0x114e7c;};'use strict';var _=require(_0xd55e('0x0'));var util=require(_0xd55e('0x1'));var moment=require(_0xd55e('0x2'));var BPromise=require(_0xd55e('0x3'));var rs=require(_0xd55e('0x4'));var fs=require('fs');var Redis=require(_0xd55e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd55e('0x6'));var logger=require(_0xd55e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd55e('0x8')][_0xd55e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x298df8,_0x5ed78e,_0x399971){return new BPromise(function(_0x5f455b,_0x43bd67){return client[_0xd55e('0xa')](_0x298df8,_0x399971)[_0xd55e('0xb')](function(_0x44f5d8){logger['info'](_0xd55e('0xc'),_0x5ed78e,_0xd55e('0xd'));logger[_0xd55e('0xe')](_0xd55e('0xf'),_0x5ed78e,_0xd55e('0xd'),JSON[_0xd55e('0x10')](_0x44f5d8));if(_0x44f5d8['error']){if(_0x44f5d8[_0xd55e('0x11')]['code']===0x1f4){logger['error'](_0xd55e('0xc'),_0x5ed78e,_0x44f5d8['error'][_0xd55e('0x12')]);return _0x43bd67(_0x44f5d8[_0xd55e('0x11')]['message']);}logger[_0xd55e('0x11')](_0xd55e('0xc'),_0x5ed78e,_0x44f5d8[_0xd55e('0x11')][_0xd55e('0x12')]);return _0x5f455b(_0x44f5d8['error'][_0xd55e('0x12')]);}else{logger[_0xd55e('0x13')](_0xd55e('0xc'),_0x5ed78e,_0xd55e('0xd'));_0x5f455b(_0x44f5d8[_0xd55e('0x14')][_0xd55e('0x12')]);}})[_0xd55e('0x15')](function(_0x54c51a){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x5ed78e,_0x54c51a);_0x43bd67(_0x54c51a);});});}exports[_0xd55e('0x16')]=function(_0x434c82){var _0x1dfe70=this;return new Promise(function(_0x239af8,_0x1c4161){return db[_0xd55e('0x17')][_0xd55e('0x18')]({'raw':_0x434c82[_0xd55e('0x19')]?_0x434c82['options'][_0xd55e('0x1a')]===undefined?!![]:![]:!![],'where':_0x434c82[_0xd55e('0x19')]?_0x434c82[_0xd55e('0x19')][_0xd55e('0x1b')]||null:null,'attributes':_0x434c82[_0xd55e('0x19')]?_0x434c82[_0xd55e('0x19')][_0xd55e('0x1c')]||null:null,'limit':_0x434c82['options']?_0x434c82[_0xd55e('0x19')][_0xd55e('0x1d')]||null:null,'include':_0x434c82[_0xd55e('0x19')]?_0x434c82[_0xd55e('0x19')]['include']?_[_0xd55e('0x1e')](_0x434c82[_0xd55e('0x19')][_0xd55e('0x1f')],function(_0x3117cb){return{'model':db[_0x3117cb[_0xd55e('0x20')]],'as':_0x3117cb['as'],'attributes':_0x3117cb[_0xd55e('0x1c')],'include':_0x3117cb[_0xd55e('0x1f')]?_[_0xd55e('0x1e')](_0x3117cb[_0xd55e('0x1f')],function(_0x260af3){return{'model':db[_0x260af3[_0xd55e('0x20')]],'as':_0x260af3['as'],'attributes':_0x260af3['attributes'],'include':_0x260af3['include']?_[_0xd55e('0x1e')](_0x260af3[_0xd55e('0x1f')],function(_0x1d56f2){return{'model':db[_0x1d56f2[_0xd55e('0x20')]],'as':_0x1d56f2['as'],'attributes':_0x1d56f2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd55e('0xb')](function(_0x4931ed){logger['info']('GetSugarcrmAccount',_0x434c82);logger[_0xd55e('0xe')](_0xd55e('0x16'),_0x434c82,JSON[_0xd55e('0x10')](_0x4931ed));_0x239af8(_0x4931ed);})['catch'](function(_0x1b2155){logger[_0xd55e('0x11')](_0xd55e('0x16'),_0x1b2155['message'],_0x434c82);_0x1c4161(_0x1dfe70[_0xd55e('0x11')](0x1f4,_0x1b2155['message']));});});};exports[_0xd55e('0x21')]=function(_0x50927b){var _0x3a35b3=this;return new Promise(function(_0x191712,_0x16f917){return db[_0xd55e('0x17')][_0xd55e('0x22')]({'raw':_0x50927b[_0xd55e('0x19')]?_0x50927b[_0xd55e('0x19')][_0xd55e('0x1a')]===undefined?!![]:![]:!![],'where':_0x50927b['options']?_0x50927b['options'][_0xd55e('0x1b')]||null:null,'attributes':_0x50927b[_0xd55e('0x19')]?_0x50927b[_0xd55e('0x19')][_0xd55e('0x1c')]||null:null,'include':_0x50927b['options']?_0x50927b['options'][_0xd55e('0x1f')]?_[_0xd55e('0x1e')](_0x50927b[_0xd55e('0x19')][_0xd55e('0x1f')],function(_0x4ff2a7){return{'model':db[_0x4ff2a7[_0xd55e('0x20')]],'as':_0x4ff2a7['as'],'attributes':_0x4ff2a7['attributes'],'include':_0x4ff2a7[_0xd55e('0x1f')]?_[_0xd55e('0x1e')](_0x4ff2a7[_0xd55e('0x1f')],function(_0x2119c5){return{'model':db[_0x2119c5[_0xd55e('0x20')]],'as':_0x2119c5['as'],'attributes':_0x2119c5[_0xd55e('0x1c')],'include':_0x2119c5['include']?_[_0xd55e('0x1e')](_0x2119c5[_0xd55e('0x1f')],function(_0x1b06db){return{'model':db[_0x1b06db[_0xd55e('0x20')]],'as':_0x1b06db['as'],'attributes':_0x1b06db['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x248ff8){logger[_0xd55e('0x13')](_0xd55e('0x21'),_0x50927b);logger[_0xd55e('0xe')](_0xd55e('0x21'),_0x50927b,JSON[_0xd55e('0x10')](_0x248ff8));_0x191712(_0x248ff8);})[_0xd55e('0x15')](function(_0x5543e5){logger[_0xd55e('0x11')]('ShowSugarcrmAccount',_0x5543e5['message'],_0x50927b);_0x16f917(_0x3a35b3[_0xd55e('0x11')](0x1f4,_0x5543e5[_0xd55e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f301b02..db9c261 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 _0x51f2=['get','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','index'];(function(_0x2f8223,_0x299659){var _0x3c327b=function(_0x2b882a){while(--_0x2b882a){_0x2f8223['push'](_0x2f8223['shift']());}};_0x3c327b(++_0x299659);}(_0x51f2,0x1f2));var _0x251f=function(_0x482173,_0x9a0d0f){_0x482173=_0x482173-0x0;var _0x659021=_0x51f2[_0x482173];return _0x659021;};'use strict';var multer=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var path=require(_0x251f('0x2'));var timeout=require(_0x251f('0x3'));var express=require('express');var router=express[_0x251f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x251f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x251f('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x251f('0x7')]);router[_0x251f('0x8')]('/:id',auth[_0x251f('0x9')](),controller['show']);router[_0x251f('0x8')](_0x251f('0xa'),auth[_0x251f('0x9')](),controller['getFields']);router['get'](_0x251f('0xb'),auth[_0x251f('0x9')](),controller[_0x251f('0xc')]);router[_0x251f('0x8')](_0x251f('0xd'),auth[_0x251f('0x9')](),controller[_0x251f('0xe')]);router[_0x251f('0xf')]('/',auth[_0x251f('0x9')](),controller[_0x251f('0x10')]);router[_0x251f('0x11')](_0x251f('0x12'),auth[_0x251f('0x9')](),controller[_0x251f('0x13')]);router[_0x251f('0x14')](_0x251f('0x12'),auth['isAuthenticated'](),controller[_0x251f('0x15')]);module[_0x251f('0x16')]=router; \ No newline at end of file +var _0x1016=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','update','delete','destroy','multer','util','path'];(function(_0x53c0bc,_0x42c2ec){var _0x40eac0=function(_0x294119){while(--_0x294119){_0x53c0bc['push'](_0x53c0bc['shift']());}};_0x40eac0(++_0x42c2ec);}(_0x1016,0x87));var _0x6101=function(_0x43b0a8,_0x385b08){_0x43b0a8=_0x43b0a8-0x0;var _0x35b89d=_0x1016[_0x43b0a8];return _0x35b89d;};'use strict';var multer=require(_0x6101('0x0'));var util=require(_0x6101('0x1'));var path=require(_0x6101('0x2'));var timeout=require('connect-timeout');var express=require(_0x6101('0x3'));var router=express['Router']();var fs_extra=require(_0x6101('0x4'));var auth=require(_0x6101('0x5'));var interaction=require(_0x6101('0x6'));var config=require(_0x6101('0x7'));var controller=require(_0x6101('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6101('0x9')](_0x6101('0xa'),auth['isAuthenticated'](),controller[_0x6101('0xb')]);router['get'](_0x6101('0xc'),auth[_0x6101('0xd')](),controller[_0x6101('0xe')]);router['get'](_0x6101('0xf'),auth['isAuthenticated'](),controller[_0x6101('0x10')]);router['get']('/:id/descriptions',auth[_0x6101('0xd')](),controller[_0x6101('0x11')]);router[_0x6101('0x12')]('/',auth[_0x6101('0xd')](),controller['create']);router[_0x6101('0x13')](_0x6101('0xa'),auth[_0x6101('0xd')](),controller[_0x6101('0x14')]);router[_0x6101('0x15')](_0x6101('0xa'),auth[_0x6101('0xd')](),controller[_0x6101('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1add0a1..4be05be 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 _0xeb96=['exports','STRING','sequelize'];(function(_0x13f0ab,_0x27f545){var _0x4b4acd=function(_0x32846a){while(--_0x32846a){_0x13f0ab['push'](_0x13f0ab['shift']());}};_0x4b4acd(++_0x27f545);}(_0xeb96,0x12b));var _0x6eb9=function(_0x1029f7,_0x3ed986){_0x1029f7=_0x1029f7-0x0;var _0x2f3c95=_0xeb96[_0x1029f7];return _0x2f3c95;};'use strict';var Sequelize=require(_0x6eb9('0x0'));module[_0x6eb9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6eb9('0x2')]}}; \ No newline at end of file +var _0xcf5d=['sequelize','exports','STRING'];(function(_0x25cafa,_0x3cdd2b){var _0x132e11=function(_0x1f24d3){while(--_0x1f24d3){_0x25cafa['push'](_0x25cafa['shift']());}};_0x132e11(++_0x3cdd2b);}(_0xcf5d,0x84));var _0xdcf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf5d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdcf5('0x0'));module[_0xdcf5('0x1')]={'name':{'type':Sequelize[_0xdcf5('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index fb0f35a..b546576 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 _0x3354=['SugarcrmField','pick','filter','nolimit','getSubjects','findOne','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','SugarcrmConfiguration','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','update','body','params','find','getFields'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3354,0x1ec));var _0x4335=function(_0x370ed3,_0x33ac18){_0x370ed3=_0x370ed3-0x0;var _0x332338=_0x3354[_0x370ed3];return _0x332338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4335('0x0'));var zipdir=require(_0x4335('0x1'));var jsonpatch=require(_0x4335('0x2'));var rp=require('request-promise');var moment=require(_0x4335('0x3'));var BPromise=require(_0x4335('0x4'));var Mustache=require(_0x4335('0x5'));var util=require(_0x4335('0x6'));var path=require('path');var sox=require(_0x4335('0x7'));var csv=require(_0x4335('0x8'));var ejs=require(_0x4335('0x9'));var fs=require('fs');var fs_extra=require(_0x4335('0xa'));var _=require(_0x4335('0xb'));var squel=require(_0x4335('0xc'));var crypto=require(_0x4335('0xd'));var jsforce=require(_0x4335('0xe'));var deskjs=require(_0x4335('0xf'));var toCsv=require(_0x4335('0x8'));var querystring=require(_0x4335('0x10'));var Papa=require(_0x4335('0x11'));var Redis=require(_0x4335('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4335('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4335('0x14'));var logger=require(_0x4335('0x15'))('api');var utils=require(_0x4335('0x16'));var config=require(_0x4335('0x17'));var licenseUtil=require(_0x4335('0x18'));var db=require(_0x4335('0x19'))['db'];function respondWithStatusCode(_0x323a95,_0x19649e){_0x19649e=_0x19649e||0xcc;return function(_0x316639){if(_0x316639){return _0x323a95[_0x4335('0x1a')](_0x19649e);}return _0x323a95[_0x4335('0x1b')](_0x19649e)[_0x4335('0x1c')]();};}function respondWithResult(_0x3111cb,_0x4afee8){_0x4afee8=_0x4afee8||0xc8;return function(_0xe5d5cd){if(_0xe5d5cd){return _0x3111cb[_0x4335('0x1b')](_0x4afee8)[_0x4335('0x1d')](_0xe5d5cd);}};}function respondWithFilteredResult(_0x963190,_0x3778f9){return function(_0x21d535){if(_0x21d535){var _0x7a3ac1=typeof _0x3778f9[_0x4335('0x1e')]==='undefined'&&typeof _0x3778f9[_0x4335('0x1f')]==='undefined';var _0x59c055=_0x21d535[_0x4335('0x20')];var _0xd2cd40=_0x7a3ac1?0x0:_0x3778f9['offset'];var _0x4e56e0=_0x7a3ac1?_0x21d535['count']:_0x3778f9['offset']+_0x3778f9['limit'];var _0x16d6d4;if(_0x4e56e0>=_0x59c055){_0x4e56e0=_0x59c055;_0x16d6d4=0xc8;}else{_0x16d6d4=0xce;}_0x963190[_0x4335('0x1b')](_0x16d6d4);return _0x963190[_0x4335('0x21')](_0x4335('0x22'),_0xd2cd40+'-'+_0x4e56e0+'/'+_0x59c055)[_0x4335('0x1d')](_0x21d535);}return null;};}function patchUpdates(_0x45d959){return function(_0x102618){try{jsonpatch[_0x4335('0x23')](_0x102618,_0x45d959,!![]);}catch(_0x1fcb5c){return BPromise[_0x4335('0x24')](_0x1fcb5c);}return _0x102618[_0x4335('0x25')]();};}function saveUpdates(_0x102532,_0x1f4bfc){return function(_0x50ce9d){if(_0x50ce9d){return _0x50ce9d['update'](_0x102532)[_0x4335('0x26')](function(_0x4e0af9){return _0x4e0af9;});}return null;};}function removeEntity(_0x3e6277,_0x1cc0da){return function(_0x4f1f26){if(_0x4f1f26){return _0x4f1f26[_0x4335('0x27')]()[_0x4335('0x26')](function(){_0x3e6277[_0x4335('0x1b')](0xcc)[_0x4335('0x1c')]();});}};}function handleEntityNotFound(_0xa15eee,_0x18d8f8){return function(_0x2e8cd2){if(!_0x2e8cd2){_0xa15eee['sendStatus'](0x194);}return _0x2e8cd2;};}function handleError(_0xfdd660,_0x46b314){_0x46b314=_0x46b314||0x1f4;return function(_0x5cc080){logger['error'](_0x5cc080[_0x4335('0x28')]);if(_0x5cc080['name']){delete _0x5cc080[_0x4335('0x29')];}_0xfdd660[_0x4335('0x1b')](_0x46b314)[_0x4335('0x2a')](_0x5cc080);};}exports['index']=function(_0x42ce5b,_0x1a235b){var _0xa51396={},_0x5b0d09={},_0x5d8b4e={'count':0x0,'rows':[]};var _0x237876=_['map'](db[_0x4335('0x2b')][_0x4335('0x2c')],function(_0x26fc70){return{'name':_0x26fc70['fieldName'],'type':_0x26fc70[_0x4335('0x2d')][_0x4335('0x2e')]};});_0x5b0d09[_0x4335('0x2f')]=_[_0x4335('0x30')](_0x237876,'name');_0x5b0d09[_0x4335('0x31')]=_[_0x4335('0x32')](_0x42ce5b[_0x4335('0x31')]);_0x5b0d09[_0x4335('0x33')]=_['intersection'](_0x5b0d09[_0x4335('0x2f')],_0x5b0d09[_0x4335('0x31')]);_0xa51396[_0x4335('0x34')]=_[_0x4335('0x35')](_0x5b0d09[_0x4335('0x2f')],qs[_0x4335('0x36')](_0x42ce5b[_0x4335('0x31')][_0x4335('0x36')]));_0xa51396[_0x4335('0x34')]=_0xa51396[_0x4335('0x34')][_0x4335('0x37')]?_0xa51396['attributes']:_0x5b0d09[_0x4335('0x2f')];if(!_0x42ce5b[_0x4335('0x31')][_0x4335('0x38')]('nolimit')){_0xa51396[_0x4335('0x1f')]=qs['limit'](_0x42ce5b[_0x4335('0x31')][_0x4335('0x1f')]);_0xa51396[_0x4335('0x1e')]=qs['offset'](_0x42ce5b[_0x4335('0x31')][_0x4335('0x1e')]);}_0xa51396[_0x4335('0x39')]=qs[_0x4335('0x3a')](_0x42ce5b[_0x4335('0x31')][_0x4335('0x3a')]);_0xa51396[_0x4335('0x3b')]=qs[_0x4335('0x33')](_['pick'](_0x42ce5b[_0x4335('0x31')],_0x5b0d09['filters']),_0x237876);if(_0x42ce5b[_0x4335('0x31')]['filter']){_0xa51396['where']=_[_0x4335('0x3c')](_0xa51396[_0x4335('0x3b')],{'$or':_[_0x4335('0x30')](_0x237876,function(_0x5a90cf){if(_0x5a90cf[_0x4335('0x2d')]!==_0x4335('0x3d')){var _0x2411d5={};_0x2411d5[_0x5a90cf[_0x4335('0x29')]]={'$like':'%'+_0x42ce5b[_0x4335('0x31')]['filter']+'%'};return _0x2411d5;}})});}_0xa51396=_[_0x4335('0x3c')]({},_0xa51396,_0x42ce5b[_0x4335('0x3e')]);var _0x445bd={'where':_0xa51396['where']};return db['SugarcrmConfiguration'][_0x4335('0x20')](_0x445bd)[_0x4335('0x26')](function(_0x558e0b){_0x5d8b4e[_0x4335('0x20')]=_0x558e0b;if(_0x42ce5b[_0x4335('0x31')][_0x4335('0x3f')]){_0xa51396['include']=[{'all':!![]}];}return db[_0x4335('0x2b')][_0x4335('0x40')](_0xa51396);})[_0x4335('0x26')](function(_0x3f80bc){_0x5d8b4e[_0x4335('0x41')]=_0x3f80bc;return _0x5d8b4e;})[_0x4335('0x26')](respondWithFilteredResult(_0x1a235b,_0xa51396))[_0x4335('0x42')](handleError(_0x1a235b,null));};exports[_0x4335('0x43')]=function(_0x584319,_0x3608aa){var _0x24484c={'raw':![],'where':{'id':_0x584319['params']['id']}},_0x4cbe8d={};_0x4cbe8d[_0x4335('0x2f')]=_[_0x4335('0x32')](db[_0x4335('0x2b')][_0x4335('0x2c')]);_0x4cbe8d[_0x4335('0x31')]=_['keys'](_0x584319[_0x4335('0x31')]);_0x4cbe8d[_0x4335('0x33')]=_[_0x4335('0x35')](_0x4cbe8d['model'],_0x4cbe8d[_0x4335('0x31')]);_0x24484c['attributes']=_[_0x4335('0x35')](_0x4cbe8d[_0x4335('0x2f')],qs[_0x4335('0x36')](_0x584319['query'][_0x4335('0x36')]));_0x24484c['attributes']=_0x24484c[_0x4335('0x34')][_0x4335('0x37')]?_0x24484c[_0x4335('0x34')]:_0x4cbe8d[_0x4335('0x2f')];if(_0x584319['query'][_0x4335('0x3f')]){_0x24484c[_0x4335('0x44')]=[{'all':!![]}];}_0x24484c=_[_0x4335('0x3c')]({},_0x24484c,_0x584319['options']);return db[_0x4335('0x2b')]['find'](_0x24484c)['then'](handleEntityNotFound(_0x3608aa,null))[_0x4335('0x26')](respondWithResult(_0x3608aa,null))['catch'](handleError(_0x3608aa,null));};exports[_0x4335('0x45')]=function(_0x2c2284,_0xa551a9){return db[_0x4335('0x2b')]['create'](_0x2c2284['body'],{})[_0x4335('0x26')](respondWithResult(_0xa551a9,0xc9))[_0x4335('0x42')](handleError(_0xa551a9,null));};exports[_0x4335('0x46')]=function(_0x9f81cd,_0x1f5e88){if(_0x9f81cd[_0x4335('0x47')]['id']){delete _0x9f81cd[_0x4335('0x47')]['id'];}return db[_0x4335('0x2b')]['find']({'where':{'id':_0x9f81cd[_0x4335('0x48')]['id']}})[_0x4335('0x26')](handleEntityNotFound(_0x1f5e88,null))[_0x4335('0x26')](saveUpdates(_0x9f81cd[_0x4335('0x47')],null))['then'](respondWithResult(_0x1f5e88,null))['catch'](handleError(_0x1f5e88,null));};exports[_0x4335('0x27')]=function(_0x4208bc,_0x4c85b9){return db[_0x4335('0x2b')][_0x4335('0x49')]({'where':{'id':_0x4208bc[_0x4335('0x48')]['id']}})[_0x4335('0x26')](handleEntityNotFound(_0x4c85b9,null))['then'](removeEntity(_0x4c85b9,null))['catch'](handleError(_0x4c85b9,null));};exports[_0x4335('0x4a')]=function(_0x39a9c0,_0x44731a,_0x540e02){var _0x341203={};var _0x283717={};var _0x38edd2;var _0x139d0c;return db[_0x4335('0x2b')]['findOne']({'where':{'id':_0x39a9c0[_0x4335('0x48')]['id']}})['then'](handleEntityNotFound(_0x44731a,null))[_0x4335('0x26')](function(_0x2b7475){if(_0x2b7475){_0x38edd2=_0x2b7475;_0x283717['model']=_[_0x4335('0x32')](db[_0x4335('0x4b')]['rawAttributes']);_0x283717['query']=_[_0x4335('0x32')](_0x39a9c0[_0x4335('0x31')]);_0x283717['filters']=_[_0x4335('0x35')](_0x283717[_0x4335('0x2f')],_0x283717[_0x4335('0x31')]);_0x341203[_0x4335('0x34')]=_[_0x4335('0x35')](_0x283717[_0x4335('0x2f')],qs[_0x4335('0x36')](_0x39a9c0['query'][_0x4335('0x36')]));_0x341203[_0x4335('0x34')]=_0x341203[_0x4335('0x34')][_0x4335('0x37')]?_0x341203[_0x4335('0x34')]:_0x283717[_0x4335('0x2f')];_0x341203[_0x4335('0x39')]=qs['sort'](_0x39a9c0[_0x4335('0x31')][_0x4335('0x3a')]);_0x341203[_0x4335('0x3b')]=qs[_0x4335('0x33')](_[_0x4335('0x4c')](_0x39a9c0['query'],_0x283717[_0x4335('0x33')]));if(_0x39a9c0[_0x4335('0x31')][_0x4335('0x4d')]){_0x341203[_0x4335('0x3b')]=_[_0x4335('0x3c')](_0x341203['where'],{'$or':_[_0x4335('0x30')](_0x341203['attributes'],function(_0x1bfa95){var _0xaf4fc7={};_0xaf4fc7[_0x1bfa95]={'$like':'%'+_0x39a9c0[_0x4335('0x31')]['filter']+'%'};return _0xaf4fc7;})});}_0x341203=_[_0x4335('0x3c')]({},_0x341203,_0x39a9c0[_0x4335('0x3e')]);return _0x38edd2[_0x4335('0x4a')](_0x341203);}})[_0x4335('0x26')](function(_0x6e60da){if(_0x6e60da){_0x139d0c=_0x6e60da['length'];if(!_0x39a9c0['query'][_0x4335('0x38')](_0x4335('0x4e'))){_0x341203[_0x4335('0x1f')]=qs[_0x4335('0x1f')](_0x39a9c0[_0x4335('0x31')][_0x4335('0x1f')]);_0x341203[_0x4335('0x1e')]=qs[_0x4335('0x1e')](_0x39a9c0[_0x4335('0x31')][_0x4335('0x1e')]);}return _0x38edd2[_0x4335('0x4a')](_0x341203);}})[_0x4335('0x26')](function(_0x568487){if(_0x568487){return _0x568487?{'count':_0x139d0c,'rows':_0x568487}:null;}})[_0x4335('0x26')](respondWithResult(_0x44731a,null))[_0x4335('0x42')](handleError(_0x44731a,null));};exports[_0x4335('0x4f')]=function(_0x3c673b,_0x355788,_0x56b46b){var _0x33ed5e={};var _0x55e0c0={};var _0x81bcce;var _0x3e07bf;return db[_0x4335('0x2b')][_0x4335('0x50')]({'where':{'id':_0x3c673b['params']['id']}})[_0x4335('0x26')](handleEntityNotFound(_0x355788,null))[_0x4335('0x26')](function(_0x1b2055){if(_0x1b2055){_0x81bcce=_0x1b2055;_0x55e0c0[_0x4335('0x2f')]=_[_0x4335('0x32')](db[_0x4335('0x4b')][_0x4335('0x2c')]);_0x55e0c0[_0x4335('0x31')]=_[_0x4335('0x32')](_0x3c673b['query']);_0x55e0c0['filters']=_[_0x4335('0x35')](_0x55e0c0[_0x4335('0x2f')],_0x55e0c0[_0x4335('0x31')]);_0x33ed5e[_0x4335('0x34')]=_['intersection'](_0x55e0c0[_0x4335('0x2f')],qs[_0x4335('0x36')](_0x3c673b['query'][_0x4335('0x36')]));_0x33ed5e[_0x4335('0x34')]=_0x33ed5e[_0x4335('0x34')][_0x4335('0x37')]?_0x33ed5e[_0x4335('0x34')]:_0x55e0c0[_0x4335('0x2f')];_0x33ed5e[_0x4335('0x39')]=qs[_0x4335('0x3a')](_0x3c673b[_0x4335('0x31')]['sort']);_0x33ed5e[_0x4335('0x3b')]=qs[_0x4335('0x33')](_[_0x4335('0x4c')](_0x3c673b[_0x4335('0x31')],_0x55e0c0['filters']));if(_0x3c673b[_0x4335('0x31')]['filter']){_0x33ed5e['where']=_[_0x4335('0x3c')](_0x33ed5e[_0x4335('0x3b')],{'$or':_[_0x4335('0x30')](_0x33ed5e['attributes'],function(_0x590ebe){var _0x331b3c={};_0x331b3c[_0x590ebe]={'$like':'%'+_0x3c673b[_0x4335('0x31')][_0x4335('0x4d')]+'%'};return _0x331b3c;})});}_0x33ed5e=_['merge']({},_0x33ed5e,_0x3c673b[_0x4335('0x3e')]);return _0x81bcce[_0x4335('0x4f')](_0x33ed5e);}})['then'](function(_0x5bcb53){if(_0x5bcb53){_0x3e07bf=_0x5bcb53[_0x4335('0x37')];if(!_0x3c673b['query'][_0x4335('0x38')](_0x4335('0x4e'))){_0x33ed5e['limit']=qs[_0x4335('0x1f')](_0x3c673b[_0x4335('0x31')]['limit']);_0x33ed5e[_0x4335('0x1e')]=qs[_0x4335('0x1e')](_0x3c673b[_0x4335('0x31')][_0x4335('0x1e')]);}return _0x81bcce[_0x4335('0x4f')](_0x33ed5e);}})['then'](function(_0x9fa9b3){if(_0x9fa9b3){return _0x9fa9b3?{'count':_0x3e07bf,'rows':_0x9fa9b3}:null;}})[_0x4335('0x26')](respondWithResult(_0x355788,null))['catch'](handleError(_0x355788,null));};exports['getDescriptions']=function(_0x161388,_0x3db835,_0x14e1db){var _0x732b41={};var _0xca9654={};var _0x5a60e2;var _0xa72452;return db[_0x4335('0x2b')]['findOne']({'where':{'id':_0x161388[_0x4335('0x48')]['id']}})[_0x4335('0x26')](handleEntityNotFound(_0x3db835,null))[_0x4335('0x26')](function(_0x2aa2b2){if(_0x2aa2b2){_0x5a60e2=_0x2aa2b2;_0xca9654[_0x4335('0x2f')]=_[_0x4335('0x32')](db['SugarcrmField'][_0x4335('0x2c')]);_0xca9654[_0x4335('0x31')]=_[_0x4335('0x32')](_0x161388[_0x4335('0x31')]);_0xca9654[_0x4335('0x33')]=_[_0x4335('0x35')](_0xca9654[_0x4335('0x2f')],_0xca9654[_0x4335('0x31')]);_0x732b41[_0x4335('0x34')]=_[_0x4335('0x35')](_0xca9654[_0x4335('0x2f')],qs[_0x4335('0x36')](_0x161388['query'][_0x4335('0x36')]));_0x732b41[_0x4335('0x34')]=_0x732b41[_0x4335('0x34')][_0x4335('0x37')]?_0x732b41[_0x4335('0x34')]:_0xca9654['model'];_0x732b41[_0x4335('0x39')]=qs[_0x4335('0x3a')](_0x161388[_0x4335('0x31')]['sort']);_0x732b41[_0x4335('0x3b')]=qs['filters'](_[_0x4335('0x4c')](_0x161388[_0x4335('0x31')],_0xca9654[_0x4335('0x33')]));if(_0x161388[_0x4335('0x31')][_0x4335('0x4d')]){_0x732b41[_0x4335('0x3b')]=_[_0x4335('0x3c')](_0x732b41[_0x4335('0x3b')],{'$or':_['map'](_0x732b41[_0x4335('0x34')],function(_0x3cea98){var _0x5e296a={};_0x5e296a[_0x3cea98]={'$like':'%'+_0x161388[_0x4335('0x31')][_0x4335('0x4d')]+'%'};return _0x5e296a;})});}_0x732b41=_['merge']({},_0x732b41,_0x161388[_0x4335('0x3e')]);return _0x5a60e2['getDescriptions'](_0x732b41);}})['then'](function(_0x5e95c5){if(_0x5e95c5){_0xa72452=_0x5e95c5[_0x4335('0x37')];if(!_0x161388[_0x4335('0x31')][_0x4335('0x38')](_0x4335('0x4e'))){_0x732b41[_0x4335('0x1f')]=qs[_0x4335('0x1f')](_0x161388[_0x4335('0x31')][_0x4335('0x1f')]);_0x732b41[_0x4335('0x1e')]=qs[_0x4335('0x1e')](_0x161388[_0x4335('0x31')][_0x4335('0x1e')]);}return _0x5a60e2['getDescriptions'](_0x732b41);}})['then'](function(_0x18a66c){if(_0x18a66c){return _0x18a66c?{'count':_0xa72452,'rows':_0x18a66c}:null;}})[_0x4335('0x26')](respondWithResult(_0x3db835,null))[_0x4335('0x42')](handleError(_0x3db835,null));}; \ No newline at end of file +var _0x207e=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','params','length','includeAll','options','create','body','findOne','SugarcrmField','map','getFields','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','moment'];(function(_0x5c6310,_0x57afac){var _0x3e6db4=function(_0x5a88e3){while(--_0x5a88e3){_0x5c6310['push'](_0x5c6310['shift']());}};_0x3e6db4(++_0x57afac);}(_0x207e,0x98));var _0xe207=function(_0x50d420,_0x42c997){_0x50d420=_0x50d420-0x0;var _0x5c861e=_0x207e[_0x50d420];return _0x5c861e;};'use strict';var emlformat=require(_0xe207('0x0'));var rimraf=require(_0xe207('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe207('0x2'));var rp=require('request-promise');var moment=require(_0xe207('0x3'));var BPromise=require(_0xe207('0x4'));var Mustache=require(_0xe207('0x5'));var util=require(_0xe207('0x6'));var path=require('path');var sox=require(_0xe207('0x7'));var csv=require(_0xe207('0x8'));var ejs=require(_0xe207('0x9'));var fs=require('fs');var fs_extra=require(_0xe207('0xa'));var _=require(_0xe207('0xb'));var squel=require(_0xe207('0xc'));var crypto=require(_0xe207('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe207('0x8'));var querystring=require(_0xe207('0xe'));var Papa=require(_0xe207('0xf'));var Redis=require(_0xe207('0x10'));var authService=require(_0xe207('0x11'));var qs=require(_0xe207('0x12'));var as=require(_0xe207('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe207('0x14'))(_0xe207('0x15'));var utils=require(_0xe207('0x16'));var config=require(_0xe207('0x17'));var licenseUtil=require(_0xe207('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30e2f8,_0x4d4727){_0x4d4727=_0x4d4727||0xcc;return function(_0x273295){if(_0x273295){return _0x30e2f8[_0xe207('0x19')](_0x4d4727);}return _0x30e2f8[_0xe207('0x1a')](_0x4d4727)[_0xe207('0x1b')]();};}function respondWithResult(_0x1d5b9d,_0x273bba){_0x273bba=_0x273bba||0xc8;return function(_0x38755c){if(_0x38755c){return _0x1d5b9d['status'](_0x273bba)['json'](_0x38755c);}};}function respondWithFilteredResult(_0x284334,_0x37a19d){return function(_0x133099){if(_0x133099){var _0x2e2de2=typeof _0x37a19d[_0xe207('0x1c')]===_0xe207('0x1d')&&typeof _0x37a19d[_0xe207('0x1e')]===_0xe207('0x1d');var _0x5a86ad=_0x133099[_0xe207('0x1f')];var _0x4d6b02=_0x2e2de2?0x0:_0x37a19d[_0xe207('0x1c')];var _0xe721d0=_0x2e2de2?_0x133099[_0xe207('0x1f')]:_0x37a19d['offset']+_0x37a19d[_0xe207('0x1e')];var _0x5279dc;if(_0xe721d0>=_0x5a86ad){_0xe721d0=_0x5a86ad;_0x5279dc=0xc8;}else{_0x5279dc=0xce;}_0x284334[_0xe207('0x1a')](_0x5279dc);return _0x284334[_0xe207('0x20')](_0xe207('0x21'),_0x4d6b02+'-'+_0xe721d0+'/'+_0x5a86ad)[_0xe207('0x22')](_0x133099);}return null;};}function patchUpdates(_0x8541ff){return function(_0x59634e){try{jsonpatch['apply'](_0x59634e,_0x8541ff,!![]);}catch(_0x39b135){return BPromise['reject'](_0x39b135);}return _0x59634e[_0xe207('0x23')]();};}function saveUpdates(_0x342c66,_0x46f90c){return function(_0x330cf9){if(_0x330cf9){return _0x330cf9[_0xe207('0x24')](_0x342c66)[_0xe207('0x25')](function(_0x15a79b){return _0x15a79b;});}return null;};}function removeEntity(_0x597208,_0x431e49){return function(_0x1d8ad2){if(_0x1d8ad2){return _0x1d8ad2[_0xe207('0x26')]()[_0xe207('0x25')](function(){_0x597208[_0xe207('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c1d9f,_0x499dbd){return function(_0x5a1ae9){if(!_0x5a1ae9){_0x1c1d9f['sendStatus'](0x194);}return _0x5a1ae9;};}function handleError(_0x6cc9c3,_0x51244e){_0x51244e=_0x51244e||0x1f4;return function(_0x2d1b2b){logger[_0xe207('0x27')](_0x2d1b2b[_0xe207('0x28')]);if(_0x2d1b2b[_0xe207('0x29')]){delete _0x2d1b2b['name'];}_0x6cc9c3[_0xe207('0x1a')](_0x51244e)['send'](_0x2d1b2b);};}exports['index']=function(_0x5cfd4a,_0x1d6e22){var _0x2bb58e={},_0x11d06c={},_0x22073c={'count':0x0,'rows':[]};var _0x4efd0e=_['map'](db[_0xe207('0x2a')][_0xe207('0x2b')],function(_0x2e6424){return{'name':_0x2e6424[_0xe207('0x2c')],'type':_0x2e6424[_0xe207('0x2d')][_0xe207('0x2e')]};});_0x11d06c['model']=_['map'](_0x4efd0e,_0xe207('0x29'));_0x11d06c[_0xe207('0x2f')]=_[_0xe207('0x30')](_0x5cfd4a['query']);_0x11d06c[_0xe207('0x31')]=_[_0xe207('0x32')](_0x11d06c[_0xe207('0x33')],_0x11d06c[_0xe207('0x2f')]);_0x2bb58e[_0xe207('0x34')]=_[_0xe207('0x32')](_0x11d06c['model'],qs[_0xe207('0x35')](_0x5cfd4a[_0xe207('0x2f')][_0xe207('0x35')]));_0x2bb58e[_0xe207('0x34')]=_0x2bb58e[_0xe207('0x34')]['length']?_0x2bb58e[_0xe207('0x34')]:_0x11d06c['model'];if(!_0x5cfd4a['query']['hasOwnProperty']('nolimit')){_0x2bb58e[_0xe207('0x1e')]=qs[_0xe207('0x1e')](_0x5cfd4a[_0xe207('0x2f')][_0xe207('0x1e')]);_0x2bb58e['offset']=qs['offset'](_0x5cfd4a[_0xe207('0x2f')][_0xe207('0x1c')]);}_0x2bb58e[_0xe207('0x36')]=qs[_0xe207('0x37')](_0x5cfd4a[_0xe207('0x2f')][_0xe207('0x37')]);_0x2bb58e[_0xe207('0x38')]=qs['filters'](_['pick'](_0x5cfd4a['query'],_0x11d06c[_0xe207('0x31')]),_0x4efd0e);if(_0x5cfd4a['query'][_0xe207('0x39')]){_0x2bb58e[_0xe207('0x38')]=_[_0xe207('0x3a')](_0x2bb58e['where'],{'$or':_['map'](_0x4efd0e,function(_0x1713a2){if(_0x1713a2[_0xe207('0x2d')]!==_0xe207('0x3b')){var _0x5b1ba7={};_0x5b1ba7[_0x1713a2['name']]={'$like':'%'+_0x5cfd4a[_0xe207('0x2f')][_0xe207('0x39')]+'%'};return _0x5b1ba7;}})});}_0x2bb58e=_[_0xe207('0x3a')]({},_0x2bb58e,_0x5cfd4a['options']);var _0x4ffd87={'where':_0x2bb58e['where']};return db['SugarcrmConfiguration'][_0xe207('0x1f')](_0x4ffd87)[_0xe207('0x25')](function(_0x5ace2f){_0x22073c[_0xe207('0x1f')]=_0x5ace2f;if(_0x5cfd4a[_0xe207('0x2f')]['includeAll']){_0x2bb58e[_0xe207('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x2bb58e);})[_0xe207('0x25')](function(_0x4fd29d){_0x22073c[_0xe207('0x3d')]=_0x4fd29d;return _0x22073c;})[_0xe207('0x25')](respondWithFilteredResult(_0x1d6e22,_0x2bb58e))[_0xe207('0x3e')](handleError(_0x1d6e22,null));};exports[_0xe207('0x3f')]=function(_0x42a9a6,_0x2544f2){var _0x5633cf={'raw':![],'where':{'id':_0x42a9a6[_0xe207('0x40')]['id']}},_0x1f6668={};_0x1f6668[_0xe207('0x33')]=_[_0xe207('0x30')](db[_0xe207('0x2a')][_0xe207('0x2b')]);_0x1f6668[_0xe207('0x2f')]=_['keys'](_0x42a9a6[_0xe207('0x2f')]);_0x1f6668[_0xe207('0x31')]=_[_0xe207('0x32')](_0x1f6668['model'],_0x1f6668['query']);_0x5633cf['attributes']=_['intersection'](_0x1f6668[_0xe207('0x33')],qs[_0xe207('0x35')](_0x42a9a6[_0xe207('0x2f')]['fields']));_0x5633cf[_0xe207('0x34')]=_0x5633cf[_0xe207('0x34')][_0xe207('0x41')]?_0x5633cf[_0xe207('0x34')]:_0x1f6668['model'];if(_0x42a9a6['query'][_0xe207('0x42')]){_0x5633cf['include']=[{'all':!![]}];}_0x5633cf=_[_0xe207('0x3a')]({},_0x5633cf,_0x42a9a6[_0xe207('0x43')]);return db['SugarcrmConfiguration']['find'](_0x5633cf)[_0xe207('0x25')](handleEntityNotFound(_0x2544f2,null))[_0xe207('0x25')](respondWithResult(_0x2544f2,null))[_0xe207('0x3e')](handleError(_0x2544f2,null));};exports[_0xe207('0x44')]=function(_0x99e331,_0x403202){return db[_0xe207('0x2a')][_0xe207('0x44')](_0x99e331[_0xe207('0x45')],{})[_0xe207('0x25')](respondWithResult(_0x403202,0xc9))[_0xe207('0x3e')](handleError(_0x403202,null));};exports[_0xe207('0x24')]=function(_0x2a3faa,_0x53d70d){if(_0x2a3faa['body']['id']){delete _0x2a3faa['body']['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x2a3faa[_0xe207('0x40')]['id']}})[_0xe207('0x25')](handleEntityNotFound(_0x53d70d,null))[_0xe207('0x25')](saveUpdates(_0x2a3faa[_0xe207('0x45')],null))[_0xe207('0x25')](respondWithResult(_0x53d70d,null))['catch'](handleError(_0x53d70d,null));};exports[_0xe207('0x26')]=function(_0x5ba0a9,_0xac3c20){return db[_0xe207('0x2a')]['find']({'where':{'id':_0x5ba0a9[_0xe207('0x40')]['id']}})[_0xe207('0x25')](handleEntityNotFound(_0xac3c20,null))[_0xe207('0x25')](removeEntity(_0xac3c20,null))['catch'](handleError(_0xac3c20,null));};exports['getFields']=function(_0x56947c,_0x49a0fe,_0x58dfa9){var _0x2e51be={};var _0x4dc1a1={};var _0x143c49;var _0x1746d0;return db['SugarcrmConfiguration'][_0xe207('0x46')]({'where':{'id':_0x56947c[_0xe207('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a0fe,null))[_0xe207('0x25')](function(_0x10d8d0){if(_0x10d8d0){_0x143c49=_0x10d8d0;_0x4dc1a1[_0xe207('0x33')]=_[_0xe207('0x30')](db[_0xe207('0x47')][_0xe207('0x2b')]);_0x4dc1a1[_0xe207('0x2f')]=_[_0xe207('0x30')](_0x56947c['query']);_0x4dc1a1[_0xe207('0x31')]=_['intersection'](_0x4dc1a1['model'],_0x4dc1a1[_0xe207('0x2f')]);_0x2e51be[_0xe207('0x34')]=_[_0xe207('0x32')](_0x4dc1a1['model'],qs['fields'](_0x56947c[_0xe207('0x2f')][_0xe207('0x35')]));_0x2e51be[_0xe207('0x34')]=_0x2e51be[_0xe207('0x34')][_0xe207('0x41')]?_0x2e51be[_0xe207('0x34')]:_0x4dc1a1[_0xe207('0x33')];_0x2e51be['order']=qs[_0xe207('0x37')](_0x56947c[_0xe207('0x2f')][_0xe207('0x37')]);_0x2e51be[_0xe207('0x38')]=qs[_0xe207('0x31')](_['pick'](_0x56947c[_0xe207('0x2f')],_0x4dc1a1[_0xe207('0x31')]));if(_0x56947c[_0xe207('0x2f')][_0xe207('0x39')]){_0x2e51be[_0xe207('0x38')]=_[_0xe207('0x3a')](_0x2e51be[_0xe207('0x38')],{'$or':_[_0xe207('0x48')](_0x2e51be['attributes'],function(_0x471fdf){var _0x2d6c41={};_0x2d6c41[_0x471fdf]={'$like':'%'+_0x56947c[_0xe207('0x2f')][_0xe207('0x39')]+'%'};return _0x2d6c41;})});}_0x2e51be=_[_0xe207('0x3a')]({},_0x2e51be,_0x56947c[_0xe207('0x43')]);return _0x143c49[_0xe207('0x49')](_0x2e51be);}})[_0xe207('0x25')](function(_0x443560){if(_0x443560){_0x1746d0=_0x443560[_0xe207('0x41')];if(!_0x56947c[_0xe207('0x2f')]['hasOwnProperty']('nolimit')){_0x2e51be[_0xe207('0x1e')]=qs[_0xe207('0x1e')](_0x56947c['query']['limit']);_0x2e51be['offset']=qs[_0xe207('0x1c')](_0x56947c['query'][_0xe207('0x1c')]);}return _0x143c49[_0xe207('0x49')](_0x2e51be);}})[_0xe207('0x25')](function(_0x16c4cf){if(_0x16c4cf){return _0x16c4cf?{'count':_0x1746d0,'rows':_0x16c4cf}:null;}})[_0xe207('0x25')](respondWithResult(_0x49a0fe,null))['catch'](handleError(_0x49a0fe,null));};exports['getSubjects']=function(_0x11fff6,_0x20bd90,_0x584c10){var _0x4113fe={};var _0x39369f={};var _0x457bc0;var _0xc91903;return db['SugarcrmConfiguration'][_0xe207('0x46')]({'where':{'id':_0x11fff6[_0xe207('0x40')]['id']}})[_0xe207('0x25')](handleEntityNotFound(_0x20bd90,null))[_0xe207('0x25')](function(_0x13d6c9){if(_0x13d6c9){_0x457bc0=_0x13d6c9;_0x39369f[_0xe207('0x33')]=_['keys'](db['SugarcrmField'][_0xe207('0x2b')]);_0x39369f['query']=_[_0xe207('0x30')](_0x11fff6['query']);_0x39369f[_0xe207('0x31')]=_['intersection'](_0x39369f[_0xe207('0x33')],_0x39369f[_0xe207('0x2f')]);_0x4113fe['attributes']=_['intersection'](_0x39369f[_0xe207('0x33')],qs['fields'](_0x11fff6['query'][_0xe207('0x35')]));_0x4113fe[_0xe207('0x34')]=_0x4113fe[_0xe207('0x34')]['length']?_0x4113fe['attributes']:_0x39369f['model'];_0x4113fe[_0xe207('0x36')]=qs[_0xe207('0x37')](_0x11fff6['query'][_0xe207('0x37')]);_0x4113fe[_0xe207('0x38')]=qs['filters'](_[_0xe207('0x4a')](_0x11fff6[_0xe207('0x2f')],_0x39369f[_0xe207('0x31')]));if(_0x11fff6[_0xe207('0x2f')][_0xe207('0x39')]){_0x4113fe[_0xe207('0x38')]=_[_0xe207('0x3a')](_0x4113fe[_0xe207('0x38')],{'$or':_['map'](_0x4113fe['attributes'],function(_0x5c5450){var _0x41c4f3={};_0x41c4f3[_0x5c5450]={'$like':'%'+_0x11fff6[_0xe207('0x2f')][_0xe207('0x39')]+'%'};return _0x41c4f3;})});}_0x4113fe=_['merge']({},_0x4113fe,_0x11fff6['options']);return _0x457bc0[_0xe207('0x4b')](_0x4113fe);}})['then'](function(_0x36b8d5){if(_0x36b8d5){_0xc91903=_0x36b8d5[_0xe207('0x41')];if(!_0x11fff6[_0xe207('0x2f')][_0xe207('0x4c')]('nolimit')){_0x4113fe[_0xe207('0x1e')]=qs[_0xe207('0x1e')](_0x11fff6[_0xe207('0x2f')][_0xe207('0x1e')]);_0x4113fe[_0xe207('0x1c')]=qs['offset'](_0x11fff6[_0xe207('0x2f')][_0xe207('0x1c')]);}return _0x457bc0[_0xe207('0x4b')](_0x4113fe);}})['then'](function(_0x5f23f4){if(_0x5f23f4){return _0x5f23f4?{'count':_0xc91903,'rows':_0x5f23f4}:null;}})[_0xe207('0x25')](respondWithResult(_0x20bd90,null))[_0xe207('0x3e')](handleError(_0x20bd90,null));};exports[_0xe207('0x4d')]=function(_0x39caf6,_0x217a19,_0x752b32){var _0x2ea70e={};var _0x45ffdc={};var _0x450ddb;var _0x1f7f73;return db[_0xe207('0x2a')][_0xe207('0x46')]({'where':{'id':_0x39caf6[_0xe207('0x40')]['id']}})[_0xe207('0x25')](handleEntityNotFound(_0x217a19,null))[_0xe207('0x25')](function(_0x284c6d){if(_0x284c6d){_0x450ddb=_0x284c6d;_0x45ffdc[_0xe207('0x33')]=_[_0xe207('0x30')](db['SugarcrmField'][_0xe207('0x2b')]);_0x45ffdc[_0xe207('0x2f')]=_['keys'](_0x39caf6[_0xe207('0x2f')]);_0x45ffdc[_0xe207('0x31')]=_['intersection'](_0x45ffdc['model'],_0x45ffdc[_0xe207('0x2f')]);_0x2ea70e['attributes']=_[_0xe207('0x32')](_0x45ffdc[_0xe207('0x33')],qs['fields'](_0x39caf6[_0xe207('0x2f')]['fields']));_0x2ea70e['attributes']=_0x2ea70e[_0xe207('0x34')]['length']?_0x2ea70e[_0xe207('0x34')]:_0x45ffdc[_0xe207('0x33')];_0x2ea70e[_0xe207('0x36')]=qs['sort'](_0x39caf6[_0xe207('0x2f')][_0xe207('0x37')]);_0x2ea70e[_0xe207('0x38')]=qs['filters'](_['pick'](_0x39caf6[_0xe207('0x2f')],_0x45ffdc[_0xe207('0x31')]));if(_0x39caf6[_0xe207('0x2f')][_0xe207('0x39')]){_0x2ea70e['where']=_[_0xe207('0x3a')](_0x2ea70e['where'],{'$or':_[_0xe207('0x48')](_0x2ea70e[_0xe207('0x34')],function(_0x207b5b){var _0x4be8de={};_0x4be8de[_0x207b5b]={'$like':'%'+_0x39caf6['query'][_0xe207('0x39')]+'%'};return _0x4be8de;})});}_0x2ea70e=_[_0xe207('0x3a')]({},_0x2ea70e,_0x39caf6[_0xe207('0x43')]);return _0x450ddb['getDescriptions'](_0x2ea70e);}})[_0xe207('0x25')](function(_0x19365b){if(_0x19365b){_0x1f7f73=_0x19365b['length'];if(!_0x39caf6[_0xe207('0x2f')][_0xe207('0x4c')]('nolimit')){_0x2ea70e[_0xe207('0x1e')]=qs[_0xe207('0x1e')](_0x39caf6[_0xe207('0x2f')][_0xe207('0x1e')]);_0x2ea70e[_0xe207('0x1c')]=qs['offset'](_0x39caf6['query'][_0xe207('0x1c')]);}return _0x450ddb[_0xe207('0x4d')](_0x2ea70e);}})['then'](function(_0x3709ac){if(_0x3709ac){return _0x3709ac?{'count':_0x1f7f73,'rows':_0x3709ac}:null;}})[_0xe207('0x25')](respondWithResult(_0x217a19,null))[_0xe207('0x3e')](handleError(_0x217a19,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 5a46fea..a41ccbf 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 _0x4f2e=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x273890,_0x3b58ea){var _0x262402=function(_0x7aad43){while(--_0x7aad43){_0x273890['push'](_0x273890['shift']());}};_0x262402(++_0x3b58ea);}(_0x4f2e,0x16b));var _0xe4f2=function(_0x2e7698,_0x2d1bb8){_0x2e7698=_0x2e7698-0x0;var _0x438792=_0x4f2e[_0x2e7698];return _0x438792;};'use strict';var _=require(_0xe4f2('0x0'));var util=require(_0xe4f2('0x1'));var logger=require(_0xe4f2('0x2'))(_0xe4f2('0x3'));var moment=require(_0xe4f2('0x4'));var BPromise=require('bluebird');var rp=require(_0xe4f2('0x5'));var fs=require('fs');var path=require(_0xe4f2('0x6'));var rimraf=require(_0xe4f2('0x7'));var config=require('../../config/environment');var attributes=require(_0xe4f2('0x8'));module[_0xe4f2('0x9')]=function(_0x391646,_0x3c2358){return _0x391646[_0xe4f2('0xa')](_0xe4f2('0xb'),attributes,{'tableName':_0xe4f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04ec=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','lodash','util','api','request-promise'];(function(_0x48eed7,_0x5e1075){var _0x37ade4=function(_0x4278c5){while(--_0x4278c5){_0x48eed7['push'](_0x48eed7['shift']());}};_0x37ade4(++_0x5e1075);}(_0x04ec,0x15b));var _0xc04e=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x04ec[_0x38854e];return _0x3f8415;};'use strict';var _=require(_0xc04e('0x0'));var util=require(_0xc04e('0x1'));var logger=require('../../config/logger')(_0xc04e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc04e('0x3'));var fs=require('fs');var path=require(_0xc04e('0x4'));var rimraf=require(_0xc04e('0x5'));var config=require(_0xc04e('0x6'));var attributes=require(_0xc04e('0x7'));module[_0xc04e('0x8')]=function(_0x5de6ff,_0x4b678a){return _0x5de6ff['define']('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 0e8dcf1..12216f1 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 _0xad72=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x470f63,_0x48d80b){var _0x4f09e2=function(_0x3aa3a4){while(--_0x3aa3a4){_0x470f63['push'](_0x470f63['shift']());}};_0x4f09e2(++_0x48d80b);}(_0xad72,0x19b));var _0x2ad7=function(_0x999ddd,_0x4bbd39){_0x999ddd=_0x999ddd-0x0;var _0x1f9f4d=_0xad72[_0x999ddd];return _0x1f9f4d;};'use strict';var _=require('lodash');var util=require(_0x2ad7('0x0'));var moment=require(_0x2ad7('0x1'));var BPromise=require(_0x2ad7('0x2'));var rs=require(_0x2ad7('0x3'));var fs=require('fs');var Redis=require(_0x2ad7('0x4'));var db=require(_0x2ad7('0x5'))['db'];var utils=require(_0x2ad7('0x6'));var logger=require(_0x2ad7('0x7'))('rpc');var config=require(_0x2ad7('0x8'));var jayson=require(_0x2ad7('0x9'));var client=jayson[_0x2ad7('0xa')][_0x2ad7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5137b4,_0x5cc94c,_0x11718c){return new BPromise(function(_0x1da808,_0x25d6f6){return client[_0x2ad7('0xc')](_0x5137b4,_0x11718c)[_0x2ad7('0xd')](function(_0x4ed790){logger['info'](_0x2ad7('0xe'),_0x5cc94c,_0x2ad7('0xf'));logger[_0x2ad7('0x10')](_0x2ad7('0x11'),_0x5cc94c,'request\x20sent',JSON[_0x2ad7('0x12')](_0x4ed790));if(_0x4ed790[_0x2ad7('0x13')]){if(_0x4ed790[_0x2ad7('0x13')][_0x2ad7('0x14')]===0x1f4){logger[_0x2ad7('0x13')](_0x2ad7('0xe'),_0x5cc94c,_0x4ed790[_0x2ad7('0x13')]['message']);return _0x25d6f6(_0x4ed790['error'][_0x2ad7('0x15')]);}logger['error'](_0x2ad7('0xe'),_0x5cc94c,_0x4ed790[_0x2ad7('0x13')][_0x2ad7('0x15')]);return _0x1da808(_0x4ed790[_0x2ad7('0x13')]['message']);}else{logger[_0x2ad7('0x16')](_0x2ad7('0xe'),_0x5cc94c,'request\x20sent');_0x1da808(_0x4ed790[_0x2ad7('0x17')][_0x2ad7('0x15')]);}})[_0x2ad7('0x18')](function(_0x3044ee){logger[_0x2ad7('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5cc94c,_0x3044ee);_0x25d6f6(_0x3044ee);});});} \ No newline at end of file +var _0x53a6=['request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0xddef8,_0x23d498){var _0x5c469a=function(_0x5d7af3){while(--_0x5d7af3){_0xddef8['push'](_0xddef8['shift']());}};_0x5c469a(++_0x23d498);}(_0x53a6,0xfa));var _0x653a=function(_0x2e3593,_0xb35bc9){_0x2e3593=_0x2e3593-0x0;var _0x399221=_0x53a6[_0x2e3593];return _0x399221;};'use strict';var _=require(_0x653a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x653a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x653a('0x2'))['db'];var utils=require(_0x653a('0x3'));var logger=require(_0x653a('0x4'))(_0x653a('0x5'));var config=require(_0x653a('0x6'));var jayson=require(_0x653a('0x7'));var client=jayson[_0x653a('0x8')][_0x653a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x162720,_0x3e1554,_0x4fd701){return new BPromise(function(_0x3187d8,_0x4d3b0d){return client[_0x653a('0xa')](_0x162720,_0x4fd701)[_0x653a('0xb')](function(_0xac6565){logger[_0x653a('0xc')](_0x653a('0xd'),_0x3e1554,_0x653a('0xe'));logger[_0x653a('0xf')](_0x653a('0x10'),_0x3e1554,_0x653a('0xe'),JSON[_0x653a('0x11')](_0xac6565));if(_0xac6565['error']){if(_0xac6565[_0x653a('0x12')]['code']===0x1f4){logger[_0x653a('0x12')](_0x653a('0xd'),_0x3e1554,_0xac6565['error']['message']);return _0x4d3b0d(_0xac6565[_0x653a('0x12')][_0x653a('0x13')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3e1554,_0xac6565[_0x653a('0x12')][_0x653a('0x13')]);return _0x3187d8(_0xac6565['error'][_0x653a('0x13')]);}else{logger['info'](_0x653a('0xd'),_0x3e1554,_0x653a('0xe'));_0x3187d8(_0xac6565[_0x653a('0x14')][_0x653a('0x13')]);}})[_0x653a('0x15')](function(_0x1094df){logger['error'](_0x653a('0xd'),_0x3e1554,_0x1094df);_0x4d3b0d(_0x1094df);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9a87c6e..1f1ae8c 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 _0x0bb8=['index','/:id','post','isAuthenticated','create','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x2073bd,_0x34b6b6){var _0x88f8d9=function(_0x4af44d){while(--_0x4af44d){_0x2073bd['push'](_0x2073bd['shift']());}};_0x88f8d9(++_0x34b6b6);}(_0x0bb8,0x112));var _0x80bb=function(_0x41b960,_0x25d61d){_0x41b960=_0x41b960-0x0;var _0x32b3f1=_0x0bb8[_0x41b960];return _0x32b3f1;};'use strict';var multer=require(_0x80bb('0x0'));var util=require(_0x80bb('0x1'));var path=require(_0x80bb('0x2'));var timeout=require(_0x80bb('0x3'));var express=require(_0x80bb('0x4'));var router=express[_0x80bb('0x5')]();var fs_extra=require(_0x80bb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x80bb('0x7'));var config=require(_0x80bb('0x8'));var controller=require(_0x80bb('0x9'));router[_0x80bb('0xa')]('/',auth['isAuthenticated'](),controller[_0x80bb('0xb')]);router[_0x80bb('0xa')](_0x80bb('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x80bb('0xd')]('/',auth[_0x80bb('0xe')](),controller[_0x80bb('0xf')]);router[_0x80bb('0x10')](_0x80bb('0xc'),auth[_0x80bb('0xe')](),controller[_0x80bb('0x11')]);router[_0x80bb('0x12')](_0x80bb('0xc'),auth[_0x80bb('0xe')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd291=['../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x29e2c9,_0x25c19b){var _0x52f045=function(_0x295a9b){while(--_0x295a9b){_0x29e2c9['push'](_0x29e2c9['shift']());}};_0x52f045(++_0x25c19b);}(_0xd291,0xde));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1d29('0x0'));var util=require(_0x1d29('0x1'));var path=require('path');var timeout=require(_0x1d29('0x2'));var express=require(_0x1d29('0x3'));var router=express[_0x1d29('0x4')]();var fs_extra=require(_0x1d29('0x5'));var auth=require(_0x1d29('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d29('0x7'));var controller=require(_0x1d29('0x8'));router[_0x1d29('0x9')]('/',auth[_0x1d29('0xa')](),controller[_0x1d29('0xb')]);router['get'](_0x1d29('0xc'),auth[_0x1d29('0xa')](),controller[_0x1d29('0xd')]);router[_0x1d29('0xe')]('/',auth[_0x1d29('0xa')](),controller[_0x1d29('0xf')]);router['put']('/:id',auth[_0x1d29('0xa')](),controller[_0x1d29('0x10')]);router[_0x1d29('0x11')](_0x1d29('0xc'),auth[_0x1d29('0xa')](),controller[_0x1d29('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 05eeca3..ee6b3ea 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 _0x6e73=['string','variable','customVariable','keyValue','STRING','exports','ENUM'];(function(_0x129d52,_0x1beadf){var _0x79ef89=function(_0x4913bb){while(--_0x4913bb){_0x129d52['push'](_0x129d52['shift']());}};_0x79ef89(++_0x1beadf);}(_0x6e73,0x147));var _0x36e7=function(_0x10c4ea,_0x2d310d){_0x10c4ea=_0x10c4ea-0x0;var _0x355478=_0x6e73[_0x10c4ea];return _0x355478;};'use strict';var Sequelize=require('sequelize');module[_0x36e7('0x0')]={'type':{'type':Sequelize[_0x36e7('0x1')](_0x36e7('0x2'),_0x36e7('0x3'),_0x36e7('0x4'),_0x36e7('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x36e7('0x6')]},'key':{'type':Sequelize[_0x36e7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x36e7('0x2'),_0x36e7('0x3'),_0x36e7('0x4'))},'keyContent':{'type':Sequelize[_0x36e7('0x6')]},'idField':{'type':Sequelize[_0x36e7('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0f79=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x34d83a,_0x27d0d1){var _0x226815=function(_0x3b1431){while(--_0x3b1431){_0x34d83a['push'](_0x34d83a['shift']());}};_0x226815(++_0x27d0d1);}(_0x0f79,0xdc));var _0x90f7=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x0f79[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require('sequelize');module[_0x90f7('0x0')]={'type':{'type':Sequelize[_0x90f7('0x1')]('string',_0x90f7('0x2'),_0x90f7('0x3'),_0x90f7('0x4'),_0x90f7('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x90f7('0x6')]},'key':{'type':Sequelize[_0x90f7('0x6')]},'keyType':{'type':Sequelize[_0x90f7('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x90f7('0x6')]},'idField':{'type':Sequelize[_0x90f7('0x6')]},'nameField':{'type':Sequelize[_0x90f7('0x6')]},'customField':{'type':Sequelize[_0x90f7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90f7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 03b942c..c3bf4fb 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 _0xd6eb=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','catch','show','params','includeAll','options','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2c2491,_0x1df20){var _0x4c3971=function(_0x36d861){while(--_0x36d861){_0x2c2491['push'](_0x2c2491['shift']());}};_0x4c3971(++_0x1df20);}(_0xd6eb,0x15a));var _0xbd6e=function(_0x4fcfda,_0x45099a){_0x4fcfda=_0x4fcfda-0x0;var _0x12c8a5=_0xd6eb[_0x4fcfda];return _0x12c8a5;};'use strict';var emlformat=require(_0xbd6e('0x0'));var rimraf=require(_0xbd6e('0x1'));var zipdir=require(_0xbd6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbd6e('0x3'));var BPromise=require(_0xbd6e('0x4'));var Mustache=require(_0xbd6e('0x5'));var util=require(_0xbd6e('0x6'));var path=require(_0xbd6e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd6e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbd6e('0x9'));var squel=require(_0xbd6e('0xa'));var crypto=require(_0xbd6e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbd6e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd6e('0xd'));var Redis=require(_0xbd6e('0xe'));var authService=require(_0xbd6e('0xf'));var qs=require(_0xbd6e('0x10'));var as=require(_0xbd6e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd6e('0x12'))('api');var utils=require(_0xbd6e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbd6e('0x14'));var db=require(_0xbd6e('0x15'))['db'];function respondWithStatusCode(_0x50883c,_0x4e3834){_0x4e3834=_0x4e3834||0xcc;return function(_0x25062b){if(_0x25062b){return _0x50883c[_0xbd6e('0x16')](_0x4e3834);}return _0x50883c[_0xbd6e('0x17')](_0x4e3834)[_0xbd6e('0x18')]();};}function respondWithResult(_0x331d09,_0x3c77e0){_0x3c77e0=_0x3c77e0||0xc8;return function(_0x1a5560){if(_0x1a5560){return _0x331d09[_0xbd6e('0x17')](_0x3c77e0)[_0xbd6e('0x19')](_0x1a5560);}};}function respondWithFilteredResult(_0x4049ff,_0x49e8cb){return function(_0x59a668){if(_0x59a668){var _0x5f424b=typeof _0x49e8cb[_0xbd6e('0x1a')]==='undefined'&&typeof _0x49e8cb[_0xbd6e('0x1b')]===_0xbd6e('0x1c');var _0x1889bd=_0x59a668[_0xbd6e('0x1d')];var _0x10be4e=_0x5f424b?0x0:_0x49e8cb[_0xbd6e('0x1a')];var _0x12fa5a=_0x5f424b?_0x59a668[_0xbd6e('0x1d')]:_0x49e8cb[_0xbd6e('0x1a')]+_0x49e8cb[_0xbd6e('0x1b')];var _0x2d96aa;if(_0x12fa5a>=_0x1889bd){_0x12fa5a=_0x1889bd;_0x2d96aa=0xc8;}else{_0x2d96aa=0xce;}_0x4049ff[_0xbd6e('0x17')](_0x2d96aa);return _0x4049ff[_0xbd6e('0x1e')](_0xbd6e('0x1f'),_0x10be4e+'-'+_0x12fa5a+'/'+_0x1889bd)[_0xbd6e('0x19')](_0x59a668);}return null;};}function patchUpdates(_0x3eb8ff){return function(_0x5c5905){try{jsonpatch['apply'](_0x5c5905,_0x3eb8ff,!![]);}catch(_0x126fa7){return BPromise[_0xbd6e('0x20')](_0x126fa7);}return _0x5c5905[_0xbd6e('0x21')]();};}function saveUpdates(_0x1a5f0b,_0x146959){return function(_0x52f20d){if(_0x52f20d){return _0x52f20d[_0xbd6e('0x22')](_0x1a5f0b)[_0xbd6e('0x23')](function(_0x4ca119){return _0x4ca119;});}return null;};}function removeEntity(_0x3bb490,_0x3e7f2e){return function(_0x81bd95){if(_0x81bd95){return _0x81bd95[_0xbd6e('0x24')]()[_0xbd6e('0x23')](function(){_0x3bb490[_0xbd6e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389a21,_0x3d7d25){return function(_0x39ad68){if(!_0x39ad68){_0x389a21[_0xbd6e('0x16')](0x194);}return _0x39ad68;};}function handleError(_0x2e273a,_0x42d38f){_0x42d38f=_0x42d38f||0x1f4;return function(_0x4a3f7f){logger[_0xbd6e('0x25')](_0x4a3f7f[_0xbd6e('0x26')]);if(_0x4a3f7f[_0xbd6e('0x27')]){delete _0x4a3f7f[_0xbd6e('0x27')];}_0x2e273a[_0xbd6e('0x17')](_0x42d38f)[_0xbd6e('0x28')](_0x4a3f7f);};}exports[_0xbd6e('0x29')]=function(_0x4520bd,_0x95bfdf){var _0x3f557c={},_0x543e83={},_0x3f0ff4={'count':0x0,'rows':[]};var _0x37e67d=_['map'](db[_0xbd6e('0x2a')][_0xbd6e('0x2b')],function(_0x410d3b){return{'name':_0x410d3b[_0xbd6e('0x2c')],'type':_0x410d3b['type']['key']};});_0x543e83[_0xbd6e('0x2d')]=_[_0xbd6e('0x2e')](_0x37e67d,_0xbd6e('0x27'));_0x543e83[_0xbd6e('0x2f')]=_[_0xbd6e('0x30')](_0x4520bd[_0xbd6e('0x2f')]);_0x543e83[_0xbd6e('0x31')]=_[_0xbd6e('0x32')](_0x543e83['model'],_0x543e83[_0xbd6e('0x2f')]);_0x3f557c[_0xbd6e('0x33')]=_[_0xbd6e('0x32')](_0x543e83[_0xbd6e('0x2d')],qs[_0xbd6e('0x34')](_0x4520bd[_0xbd6e('0x2f')][_0xbd6e('0x34')]));_0x3f557c[_0xbd6e('0x33')]=_0x3f557c[_0xbd6e('0x33')][_0xbd6e('0x35')]?_0x3f557c[_0xbd6e('0x33')]:_0x543e83['model'];if(!_0x4520bd['query'][_0xbd6e('0x36')]('nolimit')){_0x3f557c[_0xbd6e('0x1b')]=qs[_0xbd6e('0x1b')](_0x4520bd[_0xbd6e('0x2f')][_0xbd6e('0x1b')]);_0x3f557c[_0xbd6e('0x1a')]=qs['offset'](_0x4520bd['query']['offset']);}_0x3f557c[_0xbd6e('0x37')]=qs[_0xbd6e('0x38')](_0x4520bd[_0xbd6e('0x2f')][_0xbd6e('0x38')]);_0x3f557c[_0xbd6e('0x39')]=qs[_0xbd6e('0x31')](_[_0xbd6e('0x3a')](_0x4520bd['query'],_0x543e83[_0xbd6e('0x31')]),_0x37e67d);if(_0x4520bd['query'][_0xbd6e('0x3b')]){_0x3f557c[_0xbd6e('0x39')]=_[_0xbd6e('0x3c')](_0x3f557c[_0xbd6e('0x39')],{'$or':_['map'](_0x37e67d,function(_0x5a8cd7){if(_0x5a8cd7[_0xbd6e('0x3d')]!==_0xbd6e('0x3e')){var _0x235d55={};_0x235d55[_0x5a8cd7['name']]={'$like':'%'+_0x4520bd[_0xbd6e('0x2f')][_0xbd6e('0x3b')]+'%'};return _0x235d55;}})});}_0x3f557c=_[_0xbd6e('0x3c')]({},_0x3f557c,_0x4520bd['options']);var _0x52e109={'where':_0x3f557c['where']};return db[_0xbd6e('0x2a')][_0xbd6e('0x1d')](_0x52e109)[_0xbd6e('0x23')](function(_0x41ab89){_0x3f0ff4[_0xbd6e('0x1d')]=_0x41ab89;if(_0x4520bd['query']['includeAll']){_0x3f557c[_0xbd6e('0x3f')]=[{'all':!![]}];}return db[_0xbd6e('0x2a')][_0xbd6e('0x40')](_0x3f557c);})[_0xbd6e('0x23')](function(_0x4603a0){_0x3f0ff4['rows']=_0x4603a0;return _0x3f0ff4;})[_0xbd6e('0x23')](respondWithFilteredResult(_0x95bfdf,_0x3f557c))[_0xbd6e('0x41')](handleError(_0x95bfdf,null));};exports[_0xbd6e('0x42')]=function(_0x5e157b,_0x42d7e2){var _0xc621d={'raw':!![],'where':{'id':_0x5e157b[_0xbd6e('0x43')]['id']}},_0x3f07d0={};_0x3f07d0[_0xbd6e('0x2d')]=_[_0xbd6e('0x30')](db[_0xbd6e('0x2a')]['rawAttributes']);_0x3f07d0[_0xbd6e('0x2f')]=_['keys'](_0x5e157b[_0xbd6e('0x2f')]);_0x3f07d0['filters']=_[_0xbd6e('0x32')](_0x3f07d0[_0xbd6e('0x2d')],_0x3f07d0['query']);_0xc621d[_0xbd6e('0x33')]=_[_0xbd6e('0x32')](_0x3f07d0['model'],qs[_0xbd6e('0x34')](_0x5e157b[_0xbd6e('0x2f')][_0xbd6e('0x34')]));_0xc621d[_0xbd6e('0x33')]=_0xc621d[_0xbd6e('0x33')]['length']?_0xc621d[_0xbd6e('0x33')]:_0x3f07d0[_0xbd6e('0x2d')];if(_0x5e157b[_0xbd6e('0x2f')][_0xbd6e('0x44')]){_0xc621d[_0xbd6e('0x3f')]=[{'all':!![]}];}_0xc621d=_[_0xbd6e('0x3c')]({},_0xc621d,_0x5e157b[_0xbd6e('0x45')]);return db[_0xbd6e('0x2a')]['find'](_0xc621d)[_0xbd6e('0x23')](handleEntityNotFound(_0x42d7e2,null))[_0xbd6e('0x23')](respondWithResult(_0x42d7e2,null))[_0xbd6e('0x41')](handleError(_0x42d7e2,null));};exports[_0xbd6e('0x46')]=function(_0x5813d7,_0x4f839f){return db[_0xbd6e('0x2a')]['create'](_0x5813d7['body'],{})[_0xbd6e('0x23')](respondWithResult(_0x4f839f,0xc9))[_0xbd6e('0x41')](handleError(_0x4f839f,null));};exports[_0xbd6e('0x22')]=function(_0x49fad3,_0x2089c1){if(_0x49fad3[_0xbd6e('0x47')]['id']){delete _0x49fad3['body']['id'];}return db['SugarcrmField'][_0xbd6e('0x48')]({'where':{'id':_0x49fad3[_0xbd6e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2089c1,null))['then'](saveUpdates(_0x49fad3[_0xbd6e('0x47')],null))[_0xbd6e('0x23')](respondWithResult(_0x2089c1,null))[_0xbd6e('0x41')](handleError(_0x2089c1,null));};exports[_0xbd6e('0x24')]=function(_0x2e80ec,_0x1741bd){return db[_0xbd6e('0x2a')][_0xbd6e('0x48')]({'where':{'id':_0x2e80ec[_0xbd6e('0x43')]['id']}})[_0xbd6e('0x23')](handleEntityNotFound(_0x1741bd,null))['then'](removeEntity(_0x1741bd,null))[_0xbd6e('0x41')](handleError(_0x1741bd,null));}; \ No newline at end of file +var _0xa7e6=['find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body'];(function(_0x98ae28,_0x380162){var _0x3f0caa=function(_0x15a8a0){while(--_0x15a8a0){_0x98ae28['push'](_0x98ae28['shift']());}};_0x3f0caa(++_0x380162);}(_0xa7e6,0x98));var _0x6a7e=function(_0x57d4b2,_0x43236a){_0x57d4b2=_0x57d4b2-0x0;var _0x57fc1c=_0xa7e6[_0x57d4b2];return _0x57fc1c;};'use strict';var emlformat=require(_0x6a7e('0x0'));var rimraf=require(_0x6a7e('0x1'));var zipdir=require(_0x6a7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var Mustache=require(_0x6a7e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6a7e('0x7'));var csv=require(_0x6a7e('0x8'));var ejs=require(_0x6a7e('0x9'));var fs=require('fs');var fs_extra=require(_0x6a7e('0xa'));var _=require(_0x6a7e('0xb'));var squel=require('squel');var crypto=require(_0x6a7e('0xc'));var jsforce=require(_0x6a7e('0xd'));var deskjs=require(_0x6a7e('0xe'));var toCsv=require(_0x6a7e('0x8'));var querystring=require(_0x6a7e('0xf'));var Papa=require(_0x6a7e('0x10'));var Redis=require(_0x6a7e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6a7e('0x12'));var as=require(_0x6a7e('0x13'));var hardwareService=require(_0x6a7e('0x14'));var logger=require(_0x6a7e('0x15'))(_0x6a7e('0x16'));var utils=require('../../config/utils');var config=require(_0x6a7e('0x17'));var licenseUtil=require(_0x6a7e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xabccbb,_0x2c1e7b){_0x2c1e7b=_0x2c1e7b||0xcc;return function(_0x32de24){if(_0x32de24){return _0xabccbb[_0x6a7e('0x19')](_0x2c1e7b);}return _0xabccbb[_0x6a7e('0x1a')](_0x2c1e7b)[_0x6a7e('0x1b')]();};}function respondWithResult(_0x10a31e,_0x34303f){_0x34303f=_0x34303f||0xc8;return function(_0x2f2546){if(_0x2f2546){return _0x10a31e[_0x6a7e('0x1a')](_0x34303f)[_0x6a7e('0x1c')](_0x2f2546);}};}function respondWithFilteredResult(_0x7368d3,_0x95919a){return function(_0x390b82){if(_0x390b82){var _0x15ff4b=typeof _0x95919a[_0x6a7e('0x1d')]===_0x6a7e('0x1e')&&typeof _0x95919a[_0x6a7e('0x1f')]==='undefined';var _0x502867=_0x390b82[_0x6a7e('0x20')];var _0xd3b024=_0x15ff4b?0x0:_0x95919a['offset'];var _0x565d8d=_0x15ff4b?_0x390b82[_0x6a7e('0x20')]:_0x95919a['offset']+_0x95919a[_0x6a7e('0x1f')];var _0x266bfa;if(_0x565d8d>=_0x502867){_0x565d8d=_0x502867;_0x266bfa=0xc8;}else{_0x266bfa=0xce;}_0x7368d3[_0x6a7e('0x1a')](_0x266bfa);return _0x7368d3[_0x6a7e('0x21')](_0x6a7e('0x22'),_0xd3b024+'-'+_0x565d8d+'/'+_0x502867)['json'](_0x390b82);}return null;};}function patchUpdates(_0x414fb6){return function(_0xb2a506){try{jsonpatch[_0x6a7e('0x23')](_0xb2a506,_0x414fb6,!![]);}catch(_0x2c84f5){return BPromise['reject'](_0x2c84f5);}return _0xb2a506[_0x6a7e('0x24')]();};}function saveUpdates(_0x13ded8,_0x19d528){return function(_0x24971c){if(_0x24971c){return _0x24971c[_0x6a7e('0x25')](_0x13ded8)['then'](function(_0x2c5132){return _0x2c5132;});}return null;};}function removeEntity(_0x3e00cf,_0x2c9c95){return function(_0x1fd543){if(_0x1fd543){return _0x1fd543[_0x6a7e('0x26')]()[_0x6a7e('0x27')](function(){_0x3e00cf['status'](0xcc)[_0x6a7e('0x1b')]();});}};}function handleEntityNotFound(_0x37c78e,_0x59666b){return function(_0x1024c2){if(!_0x1024c2){_0x37c78e[_0x6a7e('0x19')](0x194);}return _0x1024c2;};}function handleError(_0x524b31,_0x3e6af6){_0x3e6af6=_0x3e6af6||0x1f4;return function(_0x517321){logger['error'](_0x517321['stack']);if(_0x517321[_0x6a7e('0x28')]){delete _0x517321[_0x6a7e('0x28')];}_0x524b31[_0x6a7e('0x1a')](_0x3e6af6)['send'](_0x517321);};}exports[_0x6a7e('0x29')]=function(_0x311e24,_0x4b1a61){var _0x917fa5={},_0x1c77c3={},_0x2d0b96={'count':0x0,'rows':[]};var _0x14fa42=_[_0x6a7e('0x2a')](db[_0x6a7e('0x2b')][_0x6a7e('0x2c')],function(_0x4f54dd){return{'name':_0x4f54dd[_0x6a7e('0x2d')],'type':_0x4f54dd[_0x6a7e('0x2e')][_0x6a7e('0x2f')]};});_0x1c77c3[_0x6a7e('0x30')]=_[_0x6a7e('0x2a')](_0x14fa42,_0x6a7e('0x28'));_0x1c77c3[_0x6a7e('0x31')]=_[_0x6a7e('0x32')](_0x311e24['query']);_0x1c77c3['filters']=_[_0x6a7e('0x33')](_0x1c77c3[_0x6a7e('0x30')],_0x1c77c3['query']);_0x917fa5[_0x6a7e('0x34')]=_['intersection'](_0x1c77c3[_0x6a7e('0x30')],qs[_0x6a7e('0x35')](_0x311e24[_0x6a7e('0x31')][_0x6a7e('0x35')]));_0x917fa5[_0x6a7e('0x34')]=_0x917fa5[_0x6a7e('0x34')][_0x6a7e('0x36')]?_0x917fa5['attributes']:_0x1c77c3[_0x6a7e('0x30')];if(!_0x311e24[_0x6a7e('0x31')]['hasOwnProperty'](_0x6a7e('0x37'))){_0x917fa5['limit']=qs['limit'](_0x311e24[_0x6a7e('0x31')]['limit']);_0x917fa5[_0x6a7e('0x1d')]=qs[_0x6a7e('0x1d')](_0x311e24[_0x6a7e('0x31')][_0x6a7e('0x1d')]);}_0x917fa5[_0x6a7e('0x38')]=qs[_0x6a7e('0x39')](_0x311e24[_0x6a7e('0x31')][_0x6a7e('0x39')]);_0x917fa5[_0x6a7e('0x3a')]=qs[_0x6a7e('0x3b')](_[_0x6a7e('0x3c')](_0x311e24['query'],_0x1c77c3['filters']),_0x14fa42);if(_0x311e24[_0x6a7e('0x31')][_0x6a7e('0x3d')]){_0x917fa5[_0x6a7e('0x3a')]=_[_0x6a7e('0x3e')](_0x917fa5[_0x6a7e('0x3a')],{'$or':_[_0x6a7e('0x2a')](_0x14fa42,function(_0x297058){if(_0x297058[_0x6a7e('0x2e')]!==_0x6a7e('0x3f')){var _0x83dfb8={};_0x83dfb8[_0x297058['name']]={'$like':'%'+_0x311e24['query'][_0x6a7e('0x3d')]+'%'};return _0x83dfb8;}})});}_0x917fa5=_[_0x6a7e('0x3e')]({},_0x917fa5,_0x311e24[_0x6a7e('0x40')]);var _0x18a97a={'where':_0x917fa5[_0x6a7e('0x3a')]};return db[_0x6a7e('0x2b')][_0x6a7e('0x20')](_0x18a97a)[_0x6a7e('0x27')](function(_0x1b9ad3){_0x2d0b96[_0x6a7e('0x20')]=_0x1b9ad3;if(_0x311e24[_0x6a7e('0x31')][_0x6a7e('0x41')]){_0x917fa5[_0x6a7e('0x42')]=[{'all':!![]}];}return db[_0x6a7e('0x2b')][_0x6a7e('0x43')](_0x917fa5);})[_0x6a7e('0x27')](function(_0x11738a){_0x2d0b96[_0x6a7e('0x44')]=_0x11738a;return _0x2d0b96;})[_0x6a7e('0x27')](respondWithFilteredResult(_0x4b1a61,_0x917fa5))[_0x6a7e('0x45')](handleError(_0x4b1a61,null));};exports[_0x6a7e('0x46')]=function(_0x960036,_0x36fdfe){var _0x519bb4={'raw':!![],'where':{'id':_0x960036['params']['id']}},_0x516cac={};_0x516cac['model']=_[_0x6a7e('0x32')](db[_0x6a7e('0x2b')]['rawAttributes']);_0x516cac[_0x6a7e('0x31')]=_[_0x6a7e('0x32')](_0x960036[_0x6a7e('0x31')]);_0x516cac[_0x6a7e('0x3b')]=_['intersection'](_0x516cac[_0x6a7e('0x30')],_0x516cac[_0x6a7e('0x31')]);_0x519bb4[_0x6a7e('0x34')]=_[_0x6a7e('0x33')](_0x516cac[_0x6a7e('0x30')],qs[_0x6a7e('0x35')](_0x960036['query'][_0x6a7e('0x35')]));_0x519bb4['attributes']=_0x519bb4['attributes'][_0x6a7e('0x36')]?_0x519bb4[_0x6a7e('0x34')]:_0x516cac[_0x6a7e('0x30')];if(_0x960036[_0x6a7e('0x31')][_0x6a7e('0x41')]){_0x519bb4[_0x6a7e('0x42')]=[{'all':!![]}];}_0x519bb4=_['merge']({},_0x519bb4,_0x960036['options']);return db[_0x6a7e('0x2b')]['find'](_0x519bb4)[_0x6a7e('0x27')](handleEntityNotFound(_0x36fdfe,null))[_0x6a7e('0x27')](respondWithResult(_0x36fdfe,null))[_0x6a7e('0x45')](handleError(_0x36fdfe,null));};exports[_0x6a7e('0x47')]=function(_0x2ef501,_0x5a064e){return db[_0x6a7e('0x2b')]['create'](_0x2ef501[_0x6a7e('0x48')],{})[_0x6a7e('0x27')](respondWithResult(_0x5a064e,0xc9))[_0x6a7e('0x45')](handleError(_0x5a064e,null));};exports['update']=function(_0x1b2757,_0x504aa6){if(_0x1b2757[_0x6a7e('0x48')]['id']){delete _0x1b2757[_0x6a7e('0x48')]['id'];}return db[_0x6a7e('0x2b')][_0x6a7e('0x49')]({'where':{'id':_0x1b2757[_0x6a7e('0x4a')]['id']}})[_0x6a7e('0x27')](handleEntityNotFound(_0x504aa6,null))['then'](saveUpdates(_0x1b2757[_0x6a7e('0x48')],null))[_0x6a7e('0x27')](respondWithResult(_0x504aa6,null))['catch'](handleError(_0x504aa6,null));};exports['destroy']=function(_0x2a974e,_0x1df517){return db[_0x6a7e('0x2b')]['find']({'where':{'id':_0x2a974e['params']['id']}})[_0x6a7e('0x27')](handleEntityNotFound(_0x1df517,null))[_0x6a7e('0x27')](removeEntity(_0x1df517,null))[_0x6a7e('0x45')](handleError(_0x1df517,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5a90f58..fb7c552 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 _0x0daf=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x16cade,_0x49787d){var _0x1f9a74=function(_0x557eb8){while(--_0x557eb8){_0x16cade['push'](_0x16cade['shift']());}};_0x1f9a74(++_0x49787d);}(_0x0daf,0x121));var _0xf0da=function(_0x28015a,_0x37d2d7){_0x28015a=_0x28015a-0x0;var _0x43bbd5=_0x0daf[_0x28015a];return _0x43bbd5;};'use strict';var _=require(_0xf0da('0x0'));var util=require(_0xf0da('0x1'));var logger=require(_0xf0da('0x2'))(_0xf0da('0x3'));var moment=require(_0xf0da('0x4'));var BPromise=require(_0xf0da('0x5'));var rp=require(_0xf0da('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0da('0x7'));var config=require('../../config/environment');var attributes=require(_0xf0da('0x8'));module[_0xf0da('0x9')]=function(_0x3ac9bc,_0x582c2e){return _0x3ac9bc[_0xf0da('0xa')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xf0da('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbab=['path','../../config/environment','./intSugarcrmField.attributes','exports','sugarcrm_unique_index','idField','FieldId','util','api','moment','bluebird'];(function(_0x421eeb,_0x3d3e3e){var _0x2c7371=function(_0x174b74){while(--_0x174b74){_0x421eeb['push'](_0x421eeb['shift']());}};_0x2c7371(++_0x3d3e3e);}(_0xdbab,0x80));var _0xbdba=function(_0xfb8f31,_0x2d3880){_0xfb8f31=_0xfb8f31-0x0;var _0x28b6e0=_0xdbab[_0xfb8f31];return _0x28b6e0;};'use strict';var _=require('lodash');var util=require(_0xbdba('0x0'));var logger=require('../../config/logger')(_0xbdba('0x1'));var moment=require(_0xbdba('0x2'));var BPromise=require(_0xbdba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbdba('0x4'));var rimraf=require('rimraf');var config=require(_0xbdba('0x5'));var attributes=require(_0xbdba('0x6'));module[_0xbdba('0x7')]=function(_0x4dc065,_0x5c49d2){return _0x4dc065['define']('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xbdba('0x8'),'fields':[_0xbdba('0x9'),_0xbdba('0xa')],'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 67ce16c..9fb4619 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 _0x45cd=['info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x49bdb1,_0x320ca2){var _0x183039=function(_0x1d0713){while(--_0x1d0713){_0x49bdb1['push'](_0x49bdb1['shift']());}};_0x183039(++_0x320ca2);}(_0x45cd,0xda));var _0xd45c=function(_0x1f10d9,_0x1b29cd){_0x1f10d9=_0x1f10d9-0x0;var _0x34fbfd=_0x45cd[_0x1f10d9];return _0x34fbfd;};'use strict';var _=require('lodash');var util=require(_0xd45c('0x0'));var moment=require(_0xd45c('0x1'));var BPromise=require(_0xd45c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd45c('0x3'))['db'];var utils=require(_0xd45c('0x4'));var logger=require(_0xd45c('0x5'))(_0xd45c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd45c('0x7')][_0xd45c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4aa5ac,_0x36bc7c,_0x346b38){return new BPromise(function(_0x5aa83a,_0x10217f){return client[_0xd45c('0x9')](_0x4aa5ac,_0x346b38)['then'](function(_0xdea105){logger[_0xd45c('0xa')](_0xd45c('0xb'),_0x36bc7c,'request\x20sent');logger[_0xd45c('0xc')](_0xd45c('0xd'),_0x36bc7c,'request\x20sent',JSON[_0xd45c('0xe')](_0xdea105));if(_0xdea105[_0xd45c('0xf')]){if(_0xdea105['error'][_0xd45c('0x10')]===0x1f4){logger['error'](_0xd45c('0xb'),_0x36bc7c,_0xdea105['error'][_0xd45c('0x11')]);return _0x10217f(_0xdea105[_0xd45c('0xf')]['message']);}logger['error'](_0xd45c('0xb'),_0x36bc7c,_0xdea105[_0xd45c('0xf')]['message']);return _0x5aa83a(_0xdea105[_0xd45c('0xf')][_0xd45c('0x11')]);}else{logger['info'](_0xd45c('0xb'),_0x36bc7c,'request\x20sent');_0x5aa83a(_0xdea105['result'][_0xd45c('0x11')]);}})[_0xd45c('0x12')](function(_0x252b86){logger[_0xd45c('0xf')](_0xd45c('0xb'),_0x36bc7c,_0x252b86);_0x10217f(_0x252b86);});});} \ No newline at end of file +var _0x75f5=['http','request','info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0x75f5,0x16a));var _0x575f=function(_0x41dfac,_0x278319){_0x41dfac=_0x41dfac-0x0;var _0x12900b=_0x75f5[_0x41dfac];return _0x12900b;};'use strict';var _=require(_0x575f('0x0'));var util=require(_0x575f('0x1'));var moment=require(_0x575f('0x2'));var BPromise=require(_0x575f('0x3'));var rs=require(_0x575f('0x4'));var fs=require('fs');var Redis=require(_0x575f('0x5'));var db=require(_0x575f('0x6'))['db'];var utils=require(_0x575f('0x7'));var logger=require(_0x575f('0x8'))(_0x575f('0x9'));var config=require(_0x575f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x575f('0xb')][_0x575f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f97f4,_0xd6ac00,_0x2adc27){return new BPromise(function(_0x188276,_0x1a192b){return client[_0x575f('0xd')](_0x3f97f4,_0x2adc27)['then'](function(_0xe57777){logger[_0x575f('0xe')](_0x575f('0xf'),_0xd6ac00,'request\x20sent');logger[_0x575f('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0xd6ac00,_0x575f('0x11'),JSON[_0x575f('0x12')](_0xe57777));if(_0xe57777[_0x575f('0x13')]){if(_0xe57777[_0x575f('0x13')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0xd6ac00,_0xe57777[_0x575f('0x13')][_0x575f('0x14')]);return _0x1a192b(_0xe57777[_0x575f('0x13')]['message']);}logger[_0x575f('0x13')](_0x575f('0xf'),_0xd6ac00,_0xe57777[_0x575f('0x13')][_0x575f('0x14')]);return _0x188276(_0xe57777[_0x575f('0x13')][_0x575f('0x14')]);}else{logger[_0x575f('0xe')]('SugarcrmField,\x20%s,\x20%s',_0xd6ac00,_0x575f('0x11'));_0x188276(_0xe57777[_0x575f('0x15')][_0x575f('0x14')]);}})['catch'](function(_0x959c70){logger['error'](_0x575f('0xf'),_0xd6ac00,_0x959c70);_0x1a192b(_0x959c70);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 561fdc9..1489c48 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 _0xc831=['getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations'];(function(_0x554e2c,_0x47a7e3){var _0x5e1b49=function(_0x1b5677){while(--_0x1b5677){_0x554e2c['push'](_0x554e2c['shift']());}};_0x5e1b49(++_0x47a7e3);}(_0xc831,0x103));var _0x1c83=function(_0x9fe27b,_0x298af3){_0x9fe27b=_0x9fe27b-0x0;var _0x188392=_0xc831[_0x9fe27b];return _0x188392;};'use strict';var multer=require('multer');var util=require(_0x1c83('0x0'));var path=require(_0x1c83('0x1'));var timeout=require(_0x1c83('0x2'));var express=require(_0x1c83('0x3'));var router=express[_0x1c83('0x4')]();var fs_extra=require(_0x1c83('0x5'));var auth=require(_0x1c83('0x6'));var interaction=require(_0x1c83('0x7'));var config=require(_0x1c83('0x8'));var controller=require(_0x1c83('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1c83('0xa')]);router['get'](_0x1c83('0xb'),auth[_0x1c83('0xc')](),controller[_0x1c83('0xd')]);router[_0x1c83('0xe')](_0x1c83('0xf'),auth['isAuthenticated'](),controller[_0x1c83('0x10')]);router[_0x1c83('0xe')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1c83('0x11')]);router[_0x1c83('0x12')]('/',auth[_0x1c83('0xc')](),controller['create']);router[_0x1c83('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1c83('0x13')]);router[_0x1c83('0x14')](_0x1c83('0xb'),auth[_0x1c83('0xc')](),controller[_0x1c83('0x15')]);router[_0x1c83('0x16')](_0x1c83('0xb'),auth['isAuthenticated'](),controller[_0x1c83('0x17')]);module[_0x1c83('0x18')]=router; \ No newline at end of file +var _0xb73c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x3ea566,_0x267b05){var _0x226df2=function(_0x3912d){while(--_0x3912d){_0x3ea566['push'](_0x3ea566['shift']());}};_0x226df2(++_0x267b05);}(_0xb73c,0x1cd));var _0xcb73=function(_0x10b378,_0x1ae977){_0x10b378=_0x10b378-0x0;var _0x46261e=_0xb73c[_0x10b378];return _0x46261e;};'use strict';var multer=require(_0xcb73('0x0'));var util=require('util');var path=require(_0xcb73('0x1'));var timeout=require(_0xcb73('0x2'));var express=require(_0xcb73('0x3'));var router=express[_0xcb73('0x4')]();var fs_extra=require(_0xcb73('0x5'));var auth=require(_0xcb73('0x6'));var interaction=require(_0xcb73('0x7'));var config=require('../../config/environment');var controller=require(_0xcb73('0x8'));router[_0xcb73('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcb73('0xa'),auth[_0xcb73('0xb')](),controller[_0xcb73('0xc')]);router[_0xcb73('0x9')](_0xcb73('0xd'),auth[_0xcb73('0xb')](),controller['getConfigurations']);router[_0xcb73('0x9')]('/:id/fields',auth[_0xcb73('0xb')](),controller[_0xcb73('0xe')]);router[_0xcb73('0xf')]('/',auth[_0xcb73('0xb')](),controller[_0xcb73('0x10')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xcb73('0x11')]);router[_0xcb73('0x12')]('/:id',auth[_0xcb73('0xb')](),controller[_0xcb73('0x13')]);router[_0xcb73('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xcb73('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index b85a6ec..0ce47e1 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 _0xcd1d=['HelpDesk','sequelize','exports','STRING'];(function(_0xd2df56,_0x5b74ff){var _0x28fc24=function(_0xdc9521){while(--_0xdc9521){_0xd2df56['push'](_0xd2df56['shift']());}};_0x28fc24(++_0x5b74ff);}(_0xcd1d,0x1a1));var _0xdcd1=function(_0x2b76de,_0x4665ed){_0x2b76de=_0x2b76de-0x0;var _0x43986a=_0xcd1d[_0x2b76de];return _0x43986a;};'use strict';var Sequelize=require(_0xdcd1('0x0'));module[_0xdcd1('0x1')]={'name':{'type':Sequelize[_0xdcd1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdcd1('0x2')]},'username':{'type':Sequelize[_0xdcd1('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xdcd1('0x2')],'allowNull':![],'defaultValue':_0xdcd1('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xdcd1('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xdcd1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4908=['STRING','HelpDesk','sequelize','exports'];(function(_0x115bbe,_0x38277a){var _0x365449=function(_0x54e625){while(--_0x54e625){_0x115bbe['push'](_0x115bbe['shift']());}};_0x365449(++_0x38277a);}(_0x4908,0x1aa));var _0x8490=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x4908[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require(_0x8490('0x0'));module[_0x8490('0x1')]={'name':{'type':Sequelize[_0x8490('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8490('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8490('0x2')],'allowNull':![],'defaultValue':_0x8490('0x3')},'remoteUri':{'type':Sequelize[_0x8490('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8490('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 48173c4..83c8068 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 _0x1085=['../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','send','map','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','filter','where','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','accessKey','lastIndexOf','format','%s/webservice.php','success','login','token','describe','result','sessionName','autogenerated','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','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/environment','../../config/license/util'];(function(_0x568319,_0x4bd4bc){var _0x23435d=function(_0x278728){while(--_0x278728){_0x568319['push'](_0x568319['shift']());}};_0x23435d(++_0x4bd4bc);}(_0x1085,0xd7));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5108('0x0'));var jsonpatch=require(_0x5108('0x1'));var rp=require(_0x5108('0x2'));var moment=require(_0x5108('0x3'));var BPromise=require(_0x5108('0x4'));var Mustache=require('mustache');var util=require(_0x5108('0x5'));var path=require(_0x5108('0x6'));var sox=require(_0x5108('0x7'));var csv=require('to-csv');var ejs=require(_0x5108('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5108('0x9'));var squel=require(_0x5108('0xa'));var crypto=require(_0x5108('0xb'));var jsforce=require(_0x5108('0xc'));var deskjs=require(_0x5108('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5108('0xe'));var Papa=require(_0x5108('0xf'));var Redis=require(_0x5108('0x10'));var authService=require(_0x5108('0x11'));var qs=require(_0x5108('0x12'));var as=require(_0x5108('0x13'));var hardwareService=require(_0x5108('0x14'));var logger=require(_0x5108('0x15'))('api');var utils=require(_0x5108('0x16'));var config=require(_0x5108('0x17'));var licenseUtil=require(_0x5108('0x18'));var db=require(_0x5108('0x19'))['db'];var integrations=require(_0x5108('0x1a'));function respondWithStatusCode(_0x3e8d72,_0x406e51){_0x406e51=_0x406e51||0xcc;return function(_0x44b0fc){if(_0x44b0fc){return _0x3e8d72['sendStatus'](_0x406e51);}return _0x3e8d72[_0x5108('0x1b')](_0x406e51)['end']();};}function respondWithResult(_0x3846ed,_0x44f066){_0x44f066=_0x44f066||0xc8;return function(_0xdd50f5){if(_0xdd50f5){return _0x3846ed[_0x5108('0x1b')](_0x44f066)[_0x5108('0x1c')](_0xdd50f5);}};}function respondWithFilteredResult(_0x4e2e47,_0xaee9ab){return function(_0x3478d5){if(_0x3478d5){var _0x1aa959=typeof _0xaee9ab[_0x5108('0x1d')]===_0x5108('0x1e')&&typeof _0xaee9ab[_0x5108('0x1f')]===_0x5108('0x1e');var _0x23f3c3=_0x3478d5[_0x5108('0x20')];var _0x69fa3e=_0x1aa959?0x0:_0xaee9ab[_0x5108('0x1d')];var _0x525e1a=_0x1aa959?_0x3478d5['count']:_0xaee9ab[_0x5108('0x1d')]+_0xaee9ab['limit'];var _0x40f85a;if(_0x525e1a>=_0x23f3c3){_0x525e1a=_0x23f3c3;_0x40f85a=0xc8;}else{_0x40f85a=0xce;}_0x4e2e47[_0x5108('0x1b')](_0x40f85a);return _0x4e2e47[_0x5108('0x21')](_0x5108('0x22'),_0x69fa3e+'-'+_0x525e1a+'/'+_0x23f3c3)[_0x5108('0x1c')](_0x3478d5);}return null;};}function patchUpdates(_0x5f4913){return function(_0x2b885e){try{jsonpatch[_0x5108('0x23')](_0x2b885e,_0x5f4913,!![]);}catch(_0x4f77f8){return BPromise[_0x5108('0x24')](_0x4f77f8);}return _0x2b885e[_0x5108('0x25')]();};}function saveUpdates(_0xd2a613,_0x389576){return function(_0x2e4772){if(_0x2e4772){return _0x2e4772[_0x5108('0x26')](_0xd2a613)[_0x5108('0x27')](function(_0x11101e){return _0x11101e;});}return null;};}function removeEntity(_0xb9cb7e,_0x36c049){return function(_0x5c6e9c){if(_0x5c6e9c){return _0x5c6e9c[_0x5108('0x28')]()[_0x5108('0x27')](function(){_0xb9cb7e[_0x5108('0x1b')](0xcc)[_0x5108('0x29')]();});}};}function handleEntityNotFound(_0x3b8b17,_0x59623b){return function(_0x25830f){if(!_0x25830f){_0x3b8b17[_0x5108('0x2a')](0x194);}return _0x25830f;};}function handleError(_0x267571,_0x1376f3){_0x1376f3=_0x1376f3||0x1f4;return function(_0x4e09d8){logger[_0x5108('0x2b')](_0x4e09d8['stack']);if(_0x4e09d8['name']){delete _0x4e09d8['name'];}_0x267571[_0x5108('0x1b')](_0x1376f3)[_0x5108('0x2c')](_0x4e09d8);};}exports['index']=function(_0x62096,_0x3c93a7){var _0x2fe8f5={},_0x29e10c={},_0x17f7fd={'count':0x0,'rows':[]};var _0x26766a=_[_0x5108('0x2d')](db['VtigerAccount'][_0x5108('0x2e')],function(_0x311de5){return{'name':_0x311de5[_0x5108('0x2f')],'type':_0x311de5[_0x5108('0x30')]['key']};});_0x29e10c['model']=_[_0x5108('0x2d')](_0x26766a,_0x5108('0x31'));_0x29e10c[_0x5108('0x32')]=_[_0x5108('0x33')](_0x62096[_0x5108('0x32')]);_0x29e10c[_0x5108('0x34')]=_['intersection'](_0x29e10c['model'],_0x29e10c[_0x5108('0x32')]);_0x2fe8f5['attributes']=_[_0x5108('0x35')](_0x29e10c[_0x5108('0x36')],qs[_0x5108('0x37')](_0x62096[_0x5108('0x32')][_0x5108('0x37')]));_0x2fe8f5[_0x5108('0x38')]=_0x2fe8f5[_0x5108('0x38')][_0x5108('0x39')]?_0x2fe8f5[_0x5108('0x38')]:_0x29e10c[_0x5108('0x36')];if(!_0x62096['query'][_0x5108('0x3a')](_0x5108('0x3b'))){_0x2fe8f5[_0x5108('0x1f')]=qs[_0x5108('0x1f')](_0x62096['query']['limit']);_0x2fe8f5['offset']=qs[_0x5108('0x1d')](_0x62096['query'][_0x5108('0x1d')]);}_0x2fe8f5['order']=qs['sort'](_0x62096[_0x5108('0x32')]['sort']);_0x2fe8f5['where']=qs[_0x5108('0x34')](_['pick'](_0x62096[_0x5108('0x32')],_0x29e10c[_0x5108('0x34')]),_0x26766a);if(_0x62096[_0x5108('0x32')][_0x5108('0x3c')]){_0x2fe8f5[_0x5108('0x3d')]=_[_0x5108('0x3e')](_0x2fe8f5['where'],{'$or':_[_0x5108('0x2d')](_0x26766a,function(_0x2b16dc){if(_0x2b16dc[_0x5108('0x30')]!==_0x5108('0x3f')){var _0x265176={};_0x265176[_0x2b16dc[_0x5108('0x31')]]={'$like':'%'+_0x62096[_0x5108('0x32')]['filter']+'%'};return _0x265176;}})});}_0x2fe8f5=_[_0x5108('0x3e')]({},_0x2fe8f5,_0x62096[_0x5108('0x40')]);var _0x3a9832={'where':_0x2fe8f5[_0x5108('0x3d')]};return db[_0x5108('0x41')][_0x5108('0x20')](_0x3a9832)[_0x5108('0x27')](function(_0x68b26f){_0x17f7fd[_0x5108('0x20')]=_0x68b26f;if(_0x62096[_0x5108('0x32')][_0x5108('0x42')]){_0x2fe8f5[_0x5108('0x43')]=[{'all':!![]}];}return db['VtigerAccount'][_0x5108('0x44')](_0x2fe8f5);})[_0x5108('0x27')](function(_0x3df1f8){_0x17f7fd[_0x5108('0x45')]=_0x3df1f8;return _0x17f7fd;})[_0x5108('0x27')](respondWithFilteredResult(_0x3c93a7,_0x2fe8f5))[_0x5108('0x46')](handleError(_0x3c93a7,null));};exports['show']=function(_0x1c9b6b,_0x946ec8){var _0x5aabc7={'raw':![],'where':{'id':_0x1c9b6b[_0x5108('0x47')]['id']}},_0x158e52={};_0x158e52[_0x5108('0x36')]=_['keys'](db[_0x5108('0x41')][_0x5108('0x2e')]);_0x158e52[_0x5108('0x32')]=_['keys'](_0x1c9b6b['query']);_0x158e52[_0x5108('0x34')]=_[_0x5108('0x35')](_0x158e52[_0x5108('0x36')],_0x158e52[_0x5108('0x32')]);_0x5aabc7['attributes']=_[_0x5108('0x35')](_0x158e52[_0x5108('0x36')],qs['fields'](_0x1c9b6b[_0x5108('0x32')][_0x5108('0x37')]));_0x5aabc7[_0x5108('0x38')]=_0x5aabc7[_0x5108('0x38')][_0x5108('0x39')]?_0x5aabc7[_0x5108('0x38')]:_0x158e52[_0x5108('0x36')];if(_0x1c9b6b[_0x5108('0x32')]['includeAll']){_0x5aabc7['include']=[{'all':!![]}];}_0x5aabc7=_[_0x5108('0x3e')]({},_0x5aabc7,_0x1c9b6b[_0x5108('0x40')]);return db[_0x5108('0x41')][_0x5108('0x48')](_0x5aabc7)[_0x5108('0x27')](handleEntityNotFound(_0x946ec8,null))['then'](respondWithResult(_0x946ec8,null))[_0x5108('0x46')](handleError(_0x946ec8,null));};exports[_0x5108('0x49')]=function(_0x5bbe5f,_0x19c48a){return db['VtigerAccount'][_0x5108('0x49')](_0x5bbe5f[_0x5108('0x4a')],{})[_0x5108('0x27')](respondWithResult(_0x19c48a,0xc9))[_0x5108('0x46')](handleError(_0x19c48a,null));};exports[_0x5108('0x26')]=function(_0x2d1776,_0x5e4653){if(_0x2d1776[_0x5108('0x4a')]['id']){delete _0x2d1776['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x2d1776[_0x5108('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e4653,null))[_0x5108('0x27')](saveUpdates(_0x2d1776['body'],null))['then'](respondWithResult(_0x5e4653,null))['catch'](handleError(_0x5e4653,null));};exports['destroy']=function(_0xeb5cc4,_0x2c98ce){return db['VtigerAccount'][_0x5108('0x48')]({'where':{'id':_0xeb5cc4[_0x5108('0x47')]['id']}})[_0x5108('0x27')](handleEntityNotFound(_0x2c98ce,null))[_0x5108('0x27')](removeEntity(_0x2c98ce,null))[_0x5108('0x46')](handleError(_0x2c98ce,null));};exports[_0x5108('0x4b')]=function(_0x3eef85,_0x5a245d,_0x228388){var _0xdbb16e={};var _0x46da4b={};var _0x4fd7d7;var _0x4d9314;return db[_0x5108('0x41')][_0x5108('0x4c')]({'where':{'id':_0x3eef85[_0x5108('0x47')]['id']}})[_0x5108('0x27')](handleEntityNotFound(_0x5a245d,null))[_0x5108('0x27')](function(_0x237f7a){if(_0x237f7a){_0x4fd7d7=_0x237f7a;_0x46da4b[_0x5108('0x36')]=_[_0x5108('0x33')](db[_0x5108('0x4d')][_0x5108('0x2e')]);_0x46da4b[_0x5108('0x32')]=_['keys'](_0x3eef85['query']);_0x46da4b[_0x5108('0x34')]=_[_0x5108('0x35')](_0x46da4b[_0x5108('0x36')],_0x46da4b[_0x5108('0x32')]);_0xdbb16e[_0x5108('0x38')]=_[_0x5108('0x35')](_0x46da4b[_0x5108('0x36')],qs[_0x5108('0x37')](_0x3eef85['query'][_0x5108('0x37')]));_0xdbb16e[_0x5108('0x38')]=_0xdbb16e[_0x5108('0x38')]['length']?_0xdbb16e['attributes']:_0x46da4b[_0x5108('0x36')];_0xdbb16e['order']=qs['sort'](_0x3eef85[_0x5108('0x32')]['sort']);_0xdbb16e['where']=qs[_0x5108('0x34')](_[_0x5108('0x4e')](_0x3eef85[_0x5108('0x32')],_0x46da4b['filters']));if(_0x3eef85['query'][_0x5108('0x3c')]){_0xdbb16e[_0x5108('0x3d')]=_[_0x5108('0x3e')](_0xdbb16e[_0x5108('0x3d')],{'$or':_[_0x5108('0x2d')](_0xdbb16e[_0x5108('0x38')],function(_0x93cc0c){var _0x39197c={};_0x39197c[_0x93cc0c]={'$like':'%'+_0x3eef85[_0x5108('0x32')][_0x5108('0x3c')]+'%'};return _0x39197c;})});}_0xdbb16e=_['merge']({},_0xdbb16e,_0x3eef85[_0x5108('0x40')]);return _0x4fd7d7[_0x5108('0x4b')](_0xdbb16e);}})[_0x5108('0x27')](function(_0x442e75){if(_0x442e75){_0x4d9314=_0x442e75[_0x5108('0x39')];if(!_0x3eef85[_0x5108('0x32')][_0x5108('0x3a')](_0x5108('0x3b'))){_0xdbb16e['limit']=qs[_0x5108('0x1f')](_0x3eef85[_0x5108('0x32')][_0x5108('0x1f')]);_0xdbb16e[_0x5108('0x1d')]=qs[_0x5108('0x1d')](_0x3eef85['query'][_0x5108('0x1d')]);}return _0x4fd7d7[_0x5108('0x4b')](_0xdbb16e);}})['then'](function(_0x28cf6a){if(_0x28cf6a){return _0x28cf6a?{'count':_0x4d9314,'rows':_0x28cf6a}:null;}})[_0x5108('0x27')](respondWithResult(_0x5a245d,null))[_0x5108('0x46')](handleError(_0x5a245d,null));};exports[_0x5108('0x4f')]=function(_0xd1299c,_0x4cef0c,_0x2c5aed){if(_0xd1299c[_0x5108('0x4a')]['id']){delete _0xd1299c[_0x5108('0x4a')]['id'];}return db['VtigerAccount'][_0x5108('0x4c')]({'where':{'id':_0xd1299c[_0x5108('0x47')]['id']}})[_0x5108('0x27')](handleEntityNotFound(_0x4cef0c,null))[_0x5108('0x27')](function(_0x497275){if(_0x497275){_0xd1299c[_0x5108('0x4a')][_0x5108('0x50')]=_0x497275['id'];_0xd1299c['body'][_0x5108('0x51')]=integrations[_0x5108('0x52')](_0xd1299c[_0x5108('0x4a')][_0x5108('0x53')],_0xd1299c[_0x5108('0x4a')][_0x5108('0x30')]);_0xd1299c[_0x5108('0x4a')]['Descriptions']=integrations[_0x5108('0x54')](_0xd1299c[_0x5108('0x4a')]['channel'],_0xd1299c['body'][_0x5108('0x30')]);return db[_0x5108('0x4d')][_0x5108('0x49')](_0xd1299c[_0x5108('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x5108('0x51')},{'model':db[_0x5108('0x55')],'as':_0x5108('0x56')}]});}return null;})[_0x5108('0x27')](respondWithResult(_0x4cef0c,null))[_0x5108('0x46')](handleError(_0x4cef0c,null));};var md5=require(_0x5108('0x57'));exports[_0x5108('0x58')]=function(_0x4e76ce,_0x5bce92,_0x363e07){var _0x4996fd=null;var _0x2d8462=null;var _0x4ee8aa=null;var _0x4e0abe=null;var _0xc993af='';return db[_0x5108('0x41')][_0x5108('0x4c')]({'where':{'id':_0x4e76ce[_0x5108('0x47')]['id']},'attributes':['id',_0x5108('0x31'),_0x5108('0x59'),_0x5108('0x5a'),_0x5108('0x5b'),_0x5108('0x5c'),'serverUrl',_0x5108('0x5d')]})[_0x5108('0x27')](handleEntityNotFound(_0x5bce92,null))[_0x5108('0x27')](function(_0x4098ae){if(_0x4098ae){_0x4996fd=_0x4098ae['username'];_0x2d8462=_0x4098ae[_0x5108('0x5d')];_0x4ee8aa=_0x4098ae[_0x5108('0x5b')];_0xc993af=_0x4098ae[_0x5108('0x5c')];var _0x1bddc1=_0xc993af['slice'](-0x1);if(_0x1bddc1==='/'){_0xc993af=_0xc993af['substring'](0x0,_0xc993af[_0x5108('0x5e')](_0x1bddc1));}_0x4e0abe=util[_0x5108('0x5f')](_0x5108('0x60'),_0xc993af);var _0x32fc0f={'method':'GET','uri':_0x4e0abe,'qs':{'operation':'getchallenge','username':_0x4098ae['username']},'json':!![]};return rp(_0x32fc0f);}})[_0x5108('0x27')](function(_0x1e8f14){if(_0x1e8f14[_0x5108('0x61')]){var _0x1ff317={'method':'POST','uri':_0x4e0abe,'form':{'operation':_0x5108('0x62'),'username':_0x4996fd,'accessKey':md5(_0x1e8f14['result'][_0x5108('0x63')]+_0x2d8462)},'json':!![]};return rp(_0x1ff317);}})['then'](function(_0x5a51d5){if(_0x5a51d5[_0x5108('0x61')]){var _0x94a304={'method':'GET','uri':_0x4e0abe,'qs':{'operation':_0x5108('0x64'),'username':_0x4996fd,'sessionName':_0x5a51d5[_0x5108('0x65')][_0x5108('0x66')],'elementType':_0x4ee8aa},'json':!![]};return rp(_0x94a304);}})[_0x5108('0x27')](function(_0x10b1f8){if(_0x10b1f8['success']){var _0x460685=[_0x5108('0x67'),'reference','owner'];_[_0x5108('0x68')](_0x10b1f8[_0x5108('0x65')]['fields'],function(_0x3f498d){return _0x460685[_0x5108('0x69')](_0x3f498d[_0x5108('0x30')][_0x5108('0x31')]);});_[_0x5108('0x68')](_0x10b1f8[_0x5108('0x65')][_0x5108('0x37')],function(_0x2e150e){return _0x2e150e['editable']===_0x5108('0x6a');});return{'count':_0x10b1f8['result'][_0x5108('0x37')][_0x5108('0x39')],'rows':_[_0x5108('0x2d')](_0x10b1f8[_0x5108('0x65')][_0x5108('0x37')],function(_0x18897c){return{'id':_0x18897c[_0x5108('0x31')],'name':_0x18897c[_0x5108('0x6b')],'custom':_[_0x5108('0x6c')](_0x18897c[_0x5108('0x31')],_0x5108('0x6d'))?!![]:![],'options':_0x18897c['type'][_0x5108('0x31')]===_0x5108('0x6e')&&_0x18897c['type']['picklistValues'][_0x5108('0x39')]>0x0?_['map'](_0x18897c[_0x5108('0x30')][_0x5108('0x6f')],function(_0x2d1269){return{'name':_0x2d1269[_0x5108('0x6b')],'value':_0x2d1269[_0x5108('0x70')]};}):[]};})};}})[_0x5108('0x27')](respondWithResult(_0x5bce92,null))[_0x5108('0x46')](function(_0x139c79){console[_0x5108('0x71')](_0x5108('0x72')+_0x139c79);var _0x1748d4=_0x4e76ce[_0x5108('0x32')]['test']?0x1f4:_0x139c79[_0x5108('0x73')]||0x1f4;logger[_0x5108('0x2b')](_0x5108('0x74'),_0x5108('0x58'),_0x1748d4,JSON[_0x5108('0x75')](_0x139c79));delete _0x139c79[_0x5108('0x31')];if(_0x1748d4===0x191){_0x1748d4=0x190;}_0x5bce92[_0x5108('0x1b')](_0x1748d4)[_0x5108('0x2c')](_0x4e76ce[_0x5108('0x32')][_0x5108('0x76')]?{'message':_0x5108('0x77'),'statusCode':_0x139c79['statusCode']}:_0x139c79);});}; \ No newline at end of file +var _0x3482=['getSubjects','getDescriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','getchallenge','success','POST','login','token','GET','describe','result','sessionName','autogenerated','reference','owner','remove','editable','false','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','VtigerConfiguration','pick','findOne','AccountId','Subjects'];(function(_0x141c2d,_0x134f5a){var _0x274589=function(_0x52c9a2){while(--_0x52c9a2){_0x141c2d['push'](_0x141c2d['shift']());}};_0x274589(++_0x134f5a);}(_0x3482,0x123));var _0x2348=function(_0x48b267,_0x169fc4){_0x48b267=_0x48b267-0x0;var _0x55cc70=_0x3482[_0x48b267];return _0x55cc70;};'use strict';var emlformat=require(_0x2348('0x0'));var rimraf=require(_0x2348('0x1'));var zipdir=require(_0x2348('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2348('0x3'));var moment=require(_0x2348('0x4'));var BPromise=require(_0x2348('0x5'));var Mustache=require('mustache');var util=require(_0x2348('0x6'));var path=require(_0x2348('0x7'));var sox=require(_0x2348('0x8'));var csv=require(_0x2348('0x9'));var ejs=require(_0x2348('0xa'));var fs=require('fs');var fs_extra=require(_0x2348('0xb'));var _=require(_0x2348('0xc'));var squel=require(_0x2348('0xd'));var crypto=require(_0x2348('0xe'));var jsforce=require(_0x2348('0xf'));var deskjs=require(_0x2348('0x10'));var toCsv=require(_0x2348('0x9'));var querystring=require(_0x2348('0x11'));var Papa=require(_0x2348('0x12'));var Redis=require(_0x2348('0x13'));var authService=require(_0x2348('0x14'));var qs=require(_0x2348('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2348('0x16'))(_0x2348('0x17'));var utils=require('../../config/utils');var config=require(_0x2348('0x18'));var licenseUtil=require(_0x2348('0x19'));var db=require(_0x2348('0x1a'))['db'];var integrations=require(_0x2348('0x1b'));function respondWithStatusCode(_0x22108b,_0x1f2904){_0x1f2904=_0x1f2904||0xcc;return function(_0x5a51d1){if(_0x5a51d1){return _0x22108b['sendStatus'](_0x1f2904);}return _0x22108b[_0x2348('0x1c')](_0x1f2904)['end']();};}function respondWithResult(_0x29a068,_0xb24f7b){_0xb24f7b=_0xb24f7b||0xc8;return function(_0x58ef64){if(_0x58ef64){return _0x29a068[_0x2348('0x1c')](_0xb24f7b)['json'](_0x58ef64);}};}function respondWithFilteredResult(_0x4c4f7a,_0x1bcaa6){return function(_0x43220d){if(_0x43220d){var _0xb3aecf=typeof _0x1bcaa6[_0x2348('0x1d')]==='undefined'&&typeof _0x1bcaa6[_0x2348('0x1e')]==='undefined';var _0x483472=_0x43220d[_0x2348('0x1f')];var _0x3e5fd7=_0xb3aecf?0x0:_0x1bcaa6[_0x2348('0x1d')];var _0x3612bb=_0xb3aecf?_0x43220d[_0x2348('0x1f')]:_0x1bcaa6[_0x2348('0x1d')]+_0x1bcaa6[_0x2348('0x1e')];var _0x520d12;if(_0x3612bb>=_0x483472){_0x3612bb=_0x483472;_0x520d12=0xc8;}else{_0x520d12=0xce;}_0x4c4f7a[_0x2348('0x1c')](_0x520d12);return _0x4c4f7a[_0x2348('0x20')](_0x2348('0x21'),_0x3e5fd7+'-'+_0x3612bb+'/'+_0x483472)[_0x2348('0x22')](_0x43220d);}return null;};}function patchUpdates(_0x1617e1){return function(_0x35863b){try{jsonpatch[_0x2348('0x23')](_0x35863b,_0x1617e1,!![]);}catch(_0x30f14b){return BPromise[_0x2348('0x24')](_0x30f14b);}return _0x35863b['save']();};}function saveUpdates(_0x2ed11d,_0x12c8a7){return function(_0x4b0174){if(_0x4b0174){return _0x4b0174[_0x2348('0x25')](_0x2ed11d)[_0x2348('0x26')](function(_0x1fc81b){return _0x1fc81b;});}return null;};}function removeEntity(_0xfb3013,_0x37adf1){return function(_0x17836a){if(_0x17836a){return _0x17836a[_0x2348('0x27')]()[_0x2348('0x26')](function(){_0xfb3013[_0x2348('0x1c')](0xcc)[_0x2348('0x28')]();});}};}function handleEntityNotFound(_0x406b4c,_0x14139c){return function(_0x22c7f9){if(!_0x22c7f9){_0x406b4c[_0x2348('0x29')](0x194);}return _0x22c7f9;};}function handleError(_0x50e2bb,_0x384ef4){_0x384ef4=_0x384ef4||0x1f4;return function(_0x313f29){logger[_0x2348('0x2a')](_0x313f29[_0x2348('0x2b')]);if(_0x313f29[_0x2348('0x2c')]){delete _0x313f29[_0x2348('0x2c')];}_0x50e2bb[_0x2348('0x1c')](_0x384ef4)[_0x2348('0x2d')](_0x313f29);};}exports[_0x2348('0x2e')]=function(_0x58f162,_0x43e31f){var _0x334209={},_0x1c0890={},_0x78b99c={'count':0x0,'rows':[]};var _0x159c40=_['map'](db['VtigerAccount'][_0x2348('0x2f')],function(_0x55da0e){return{'name':_0x55da0e[_0x2348('0x30')],'type':_0x55da0e['type']['key']};});_0x1c0890[_0x2348('0x31')]=_['map'](_0x159c40,'name');_0x1c0890[_0x2348('0x32')]=_[_0x2348('0x33')](_0x58f162[_0x2348('0x32')]);_0x1c0890[_0x2348('0x34')]=_[_0x2348('0x35')](_0x1c0890['model'],_0x1c0890[_0x2348('0x32')]);_0x334209['attributes']=_[_0x2348('0x35')](_0x1c0890[_0x2348('0x31')],qs[_0x2348('0x36')](_0x58f162[_0x2348('0x32')][_0x2348('0x36')]));_0x334209[_0x2348('0x37')]=_0x334209[_0x2348('0x37')][_0x2348('0x38')]?_0x334209[_0x2348('0x37')]:_0x1c0890['model'];if(!_0x58f162[_0x2348('0x32')][_0x2348('0x39')](_0x2348('0x3a'))){_0x334209['limit']=qs[_0x2348('0x1e')](_0x58f162[_0x2348('0x32')]['limit']);_0x334209[_0x2348('0x1d')]=qs['offset'](_0x58f162[_0x2348('0x32')][_0x2348('0x1d')]);}_0x334209[_0x2348('0x3b')]=qs['sort'](_0x58f162[_0x2348('0x32')][_0x2348('0x3c')]);_0x334209['where']=qs[_0x2348('0x34')](_['pick'](_0x58f162[_0x2348('0x32')],_0x1c0890[_0x2348('0x34')]),_0x159c40);if(_0x58f162[_0x2348('0x32')][_0x2348('0x3d')]){_0x334209[_0x2348('0x3e')]=_[_0x2348('0x3f')](_0x334209[_0x2348('0x3e')],{'$or':_[_0x2348('0x40')](_0x159c40,function(_0xf3703){if(_0xf3703[_0x2348('0x41')]!==_0x2348('0x42')){var _0x1b9206={};_0x1b9206[_0xf3703[_0x2348('0x2c')]]={'$like':'%'+_0x58f162[_0x2348('0x32')][_0x2348('0x3d')]+'%'};return _0x1b9206;}})});}_0x334209=_[_0x2348('0x3f')]({},_0x334209,_0x58f162[_0x2348('0x43')]);var _0x564a7f={'where':_0x334209[_0x2348('0x3e')]};return db[_0x2348('0x44')][_0x2348('0x1f')](_0x564a7f)['then'](function(_0x25f0e3){_0x78b99c[_0x2348('0x1f')]=_0x25f0e3;if(_0x58f162['query'][_0x2348('0x45')]){_0x334209[_0x2348('0x46')]=[{'all':!![]}];}return db['VtigerAccount'][_0x2348('0x47')](_0x334209);})['then'](function(_0x598b2c){_0x78b99c['rows']=_0x598b2c;return _0x78b99c;})['then'](respondWithFilteredResult(_0x43e31f,_0x334209))[_0x2348('0x48')](handleError(_0x43e31f,null));};exports[_0x2348('0x49')]=function(_0x3ac03a,_0x4d1ed3){var _0x3ca8ad={'raw':![],'where':{'id':_0x3ac03a[_0x2348('0x4a')]['id']}},_0x2b3ae8={};_0x2b3ae8[_0x2348('0x31')]=_[_0x2348('0x33')](db[_0x2348('0x44')]['rawAttributes']);_0x2b3ae8[_0x2348('0x32')]=_[_0x2348('0x33')](_0x3ac03a[_0x2348('0x32')]);_0x2b3ae8[_0x2348('0x34')]=_['intersection'](_0x2b3ae8[_0x2348('0x31')],_0x2b3ae8[_0x2348('0x32')]);_0x3ca8ad[_0x2348('0x37')]=_[_0x2348('0x35')](_0x2b3ae8[_0x2348('0x31')],qs[_0x2348('0x36')](_0x3ac03a['query'][_0x2348('0x36')]));_0x3ca8ad['attributes']=_0x3ca8ad[_0x2348('0x37')][_0x2348('0x38')]?_0x3ca8ad[_0x2348('0x37')]:_0x2b3ae8[_0x2348('0x31')];if(_0x3ac03a['query'][_0x2348('0x45')]){_0x3ca8ad[_0x2348('0x46')]=[{'all':!![]}];}_0x3ca8ad=_[_0x2348('0x3f')]({},_0x3ca8ad,_0x3ac03a[_0x2348('0x43')]);return db[_0x2348('0x44')][_0x2348('0x4b')](_0x3ca8ad)[_0x2348('0x26')](handleEntityNotFound(_0x4d1ed3,null))[_0x2348('0x26')](respondWithResult(_0x4d1ed3,null))[_0x2348('0x48')](handleError(_0x4d1ed3,null));};exports['create']=function(_0x508bf7,_0x417e1f){return db[_0x2348('0x44')][_0x2348('0x4c')](_0x508bf7[_0x2348('0x4d')],{})[_0x2348('0x26')](respondWithResult(_0x417e1f,0xc9))['catch'](handleError(_0x417e1f,null));};exports[_0x2348('0x25')]=function(_0x15c42f,_0x3f3dea){if(_0x15c42f[_0x2348('0x4d')]['id']){delete _0x15c42f[_0x2348('0x4d')]['id'];}return db[_0x2348('0x44')]['find']({'where':{'id':_0x15c42f['params']['id']}})[_0x2348('0x26')](handleEntityNotFound(_0x3f3dea,null))[_0x2348('0x26')](saveUpdates(_0x15c42f['body'],null))[_0x2348('0x26')](respondWithResult(_0x3f3dea,null))[_0x2348('0x48')](handleError(_0x3f3dea,null));};exports[_0x2348('0x27')]=function(_0x2134f4,_0x297eb5){return db[_0x2348('0x44')][_0x2348('0x4b')]({'where':{'id':_0x2134f4[_0x2348('0x4a')]['id']}})[_0x2348('0x26')](handleEntityNotFound(_0x297eb5,null))[_0x2348('0x26')](removeEntity(_0x297eb5,null))[_0x2348('0x48')](handleError(_0x297eb5,null));};exports[_0x2348('0x4e')]=function(_0x431b88,_0x131972,_0x4ffc65){var _0x1abc5c={};var _0x251af2={};var _0x1fb938;var _0x3d67d1;return db[_0x2348('0x44')]['findOne']({'where':{'id':_0x431b88[_0x2348('0x4a')]['id']}})['then'](handleEntityNotFound(_0x131972,null))['then'](function(_0x20922a){if(_0x20922a){_0x1fb938=_0x20922a;_0x251af2[_0x2348('0x31')]=_[_0x2348('0x33')](db[_0x2348('0x4f')][_0x2348('0x2f')]);_0x251af2[_0x2348('0x32')]=_[_0x2348('0x33')](_0x431b88['query']);_0x251af2[_0x2348('0x34')]=_[_0x2348('0x35')](_0x251af2[_0x2348('0x31')],_0x251af2[_0x2348('0x32')]);_0x1abc5c[_0x2348('0x37')]=_[_0x2348('0x35')](_0x251af2[_0x2348('0x31')],qs[_0x2348('0x36')](_0x431b88['query']['fields']));_0x1abc5c[_0x2348('0x37')]=_0x1abc5c[_0x2348('0x37')][_0x2348('0x38')]?_0x1abc5c['attributes']:_0x251af2[_0x2348('0x31')];_0x1abc5c[_0x2348('0x3b')]=qs[_0x2348('0x3c')](_0x431b88[_0x2348('0x32')]['sort']);_0x1abc5c['where']=qs[_0x2348('0x34')](_[_0x2348('0x50')](_0x431b88[_0x2348('0x32')],_0x251af2[_0x2348('0x34')]));if(_0x431b88[_0x2348('0x32')][_0x2348('0x3d')]){_0x1abc5c[_0x2348('0x3e')]=_[_0x2348('0x3f')](_0x1abc5c[_0x2348('0x3e')],{'$or':_[_0x2348('0x40')](_0x1abc5c[_0x2348('0x37')],function(_0x2c78ff){var _0x2c0e46={};_0x2c0e46[_0x2c78ff]={'$like':'%'+_0x431b88[_0x2348('0x32')][_0x2348('0x3d')]+'%'};return _0x2c0e46;})});}_0x1abc5c=_[_0x2348('0x3f')]({},_0x1abc5c,_0x431b88[_0x2348('0x43')]);return _0x1fb938[_0x2348('0x4e')](_0x1abc5c);}})[_0x2348('0x26')](function(_0x403862){if(_0x403862){_0x3d67d1=_0x403862[_0x2348('0x38')];if(!_0x431b88[_0x2348('0x32')][_0x2348('0x39')]('nolimit')){_0x1abc5c[_0x2348('0x1e')]=qs[_0x2348('0x1e')](_0x431b88[_0x2348('0x32')][_0x2348('0x1e')]);_0x1abc5c[_0x2348('0x1d')]=qs['offset'](_0x431b88[_0x2348('0x32')][_0x2348('0x1d')]);}return _0x1fb938[_0x2348('0x4e')](_0x1abc5c);}})['then'](function(_0x466e27){if(_0x466e27){return _0x466e27?{'count':_0x3d67d1,'rows':_0x466e27}:null;}})[_0x2348('0x26')](respondWithResult(_0x131972,null))[_0x2348('0x48')](handleError(_0x131972,null));};exports['addConfiguration']=function(_0x3dc182,_0x14a861,_0x37c4fc){if(_0x3dc182[_0x2348('0x4d')]['id']){delete _0x3dc182['body']['id'];}return db['VtigerAccount'][_0x2348('0x51')]({'where':{'id':_0x3dc182[_0x2348('0x4a')]['id']}})[_0x2348('0x26')](handleEntityNotFound(_0x14a861,null))[_0x2348('0x26')](function(_0x1b46bd){if(_0x1b46bd){_0x3dc182[_0x2348('0x4d')][_0x2348('0x52')]=_0x1b46bd['id'];_0x3dc182['body'][_0x2348('0x53')]=integrations[_0x2348('0x54')](_0x3dc182[_0x2348('0x4d')]['channel'],_0x3dc182['body']['type']);_0x3dc182['body']['Descriptions']=integrations[_0x2348('0x55')](_0x3dc182[_0x2348('0x4d')][_0x2348('0x56')],_0x3dc182[_0x2348('0x4d')]['type']);return db[_0x2348('0x4f')][_0x2348('0x4c')](_0x3dc182[_0x2348('0x4d')],{'include':[{'model':db[_0x2348('0x57')],'as':_0x2348('0x53')},{'model':db[_0x2348('0x57')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14a861,null))[_0x2348('0x48')](handleError(_0x14a861,null));};var md5=require(_0x2348('0x58'));exports[_0x2348('0x59')]=function(_0x2f6a99,_0x256b02,_0x5240fa){var _0x5afeda=null;var _0xcac094=null;var _0x2082cf=null;var _0x4aeef9=null;var _0x5ad7e9='';return db[_0x2348('0x44')]['findOne']({'where':{'id':_0x2f6a99[_0x2348('0x4a')]['id']},'attributes':['id','name',_0x2348('0x5a'),_0x2348('0x5b'),_0x2348('0x5c'),_0x2348('0x5d'),_0x2348('0x5e'),_0x2348('0x5f')]})[_0x2348('0x26')](handleEntityNotFound(_0x256b02,null))[_0x2348('0x26')](function(_0x42027c){if(_0x42027c){_0x5afeda=_0x42027c[_0x2348('0x5a')];_0xcac094=_0x42027c['accessKey'];_0x2082cf=_0x42027c[_0x2348('0x5c')];_0x5ad7e9=_0x42027c['remoteUri'];var _0x2697d2=_0x5ad7e9['slice'](-0x1);if(_0x2697d2==='/'){_0x5ad7e9=_0x5ad7e9[_0x2348('0x60')](0x0,_0x5ad7e9[_0x2348('0x61')](_0x2697d2));}_0x4aeef9=util[_0x2348('0x62')]('%s/webservice.php',_0x5ad7e9);var _0x188561={'method':'GET','uri':_0x4aeef9,'qs':{'operation':_0x2348('0x63'),'username':_0x42027c[_0x2348('0x5a')]},'json':!![]};return rp(_0x188561);}})['then'](function(_0x5c3b39){if(_0x5c3b39[_0x2348('0x64')]){var _0x153565={'method':_0x2348('0x65'),'uri':_0x4aeef9,'form':{'operation':_0x2348('0x66'),'username':_0x5afeda,'accessKey':md5(_0x5c3b39['result'][_0x2348('0x67')]+_0xcac094)},'json':!![]};return rp(_0x153565);}})[_0x2348('0x26')](function(_0x59f714){if(_0x59f714[_0x2348('0x64')]){var _0x2c15ea={'method':_0x2348('0x68'),'uri':_0x4aeef9,'qs':{'operation':_0x2348('0x69'),'username':_0x5afeda,'sessionName':_0x59f714[_0x2348('0x6a')][_0x2348('0x6b')],'elementType':_0x2082cf},'json':!![]};return rp(_0x2c15ea);}})[_0x2348('0x26')](function(_0x5546d5){if(_0x5546d5[_0x2348('0x64')]){var _0x287111=[_0x2348('0x6c'),_0x2348('0x6d'),_0x2348('0x6e')];_[_0x2348('0x6f')](_0x5546d5[_0x2348('0x6a')][_0x2348('0x36')],function(_0x2af743){return _0x287111['includes'](_0x2af743[_0x2348('0x41')]['name']);});_[_0x2348('0x6f')](_0x5546d5['result'][_0x2348('0x36')],function(_0x1bb920){return _0x1bb920[_0x2348('0x70')]===_0x2348('0x71');});return{'count':_0x5546d5[_0x2348('0x6a')][_0x2348('0x36')][_0x2348('0x38')],'rows':_[_0x2348('0x40')](_0x5546d5[_0x2348('0x6a')][_0x2348('0x36')],function(_0x2abbf9){return{'id':_0x2abbf9['name'],'name':_0x2abbf9['label'],'custom':_[_0x2348('0x72')](_0x2abbf9[_0x2348('0x2c')],_0x2348('0x73'))?!![]:![],'options':_0x2abbf9['type'][_0x2348('0x2c')]===_0x2348('0x74')&&_0x2abbf9[_0x2348('0x41')]['picklistValues']['length']>0x0?_[_0x2348('0x40')](_0x2abbf9[_0x2348('0x41')][_0x2348('0x75')],function(_0x54cc50){return{'name':_0x54cc50['label'],'value':_0x54cc50[_0x2348('0x76')]};}):[]};})};}})[_0x2348('0x26')](respondWithResult(_0x256b02,null))[_0x2348('0x48')](function(_0x7a3d74){console[_0x2348('0x77')](_0x2348('0x78')+_0x7a3d74);var _0xbe4903=_0x2f6a99[_0x2348('0x32')][_0x2348('0x79')]?0x1f4:_0x7a3d74[_0x2348('0x7a')]||0x1f4;logger[_0x2348('0x2a')](_0x2348('0x7b'),'getFields',_0xbe4903,JSON['stringify'](_0x7a3d74));delete _0x7a3d74[_0x2348('0x2c')];if(_0xbe4903===0x191){_0xbe4903=0x190;}_0x256b02[_0x2348('0x1c')](_0xbe4903)[_0x2348('0x2d')](_0x2f6a99['query']['test']?{'message':_0x2348('0x7c'),'statusCode':_0x7a3d74['statusCode']}:_0x7a3d74);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 07153d0..d7b71c4 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 _0x68c7=['define','VtigerAccount','lodash','util','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x108250,_0x10c11b){var _0x509782=function(_0x464332){while(--_0x464332){_0x108250['push'](_0x108250['shift']());}};_0x509782(++_0x10c11b);}(_0x68c7,0x16a));var _0x768c=function(_0x38a024,_0x32a7e5){_0x38a024=_0x38a024-0x0;var _0x35e7aa=_0x68c7[_0x38a024];return _0x35e7aa;};'use strict';var _=require(_0x768c('0x0'));var util=require(_0x768c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x768c('0x2'));var fs=require('fs');var path=require(_0x768c('0x3'));var rimraf=require(_0x768c('0x4'));var config=require('../../config/environment');var attributes=require(_0x768c('0x5'));var integrations=require(_0x768c('0x6'));module[_0x768c('0x7')]=function(_0x58390c,_0x59a471){return _0x58390c[_0x768c('0x8')](_0x768c('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf148=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes'];(function(_0x234ce7,_0x3e909c){var _0x57c561=function(_0x8ac1bb){while(--_0x8ac1bb){_0x234ce7['push'](_0x234ce7['shift']());}};_0x57c561(++_0x3e909c);}(_0xf148,0xf4));var _0x8f14=function(_0x41a7a7,_0x1d8527){_0x41a7a7=_0x41a7a7-0x0;var _0x4dcd48=_0xf148[_0x41a7a7];return _0x4dcd48;};'use strict';var _=require(_0x8f14('0x0'));var util=require('util');var logger=require(_0x8f14('0x1'))(_0x8f14('0x2'));var moment=require(_0x8f14('0x3'));var BPromise=require(_0x8f14('0x4'));var rp=require(_0x8f14('0x5'));var fs=require('fs');var path=require(_0x8f14('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8f14('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x8f14('0x8')]=function(_0x449471,_0xdcbd59){return _0x449471[_0x8f14('0x9')](_0x8f14('0xa'),attributes,{'tableName':_0x8f14('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 3bc95e5..f19125c 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 _0x4e81=['find','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','map','include','model','attributes','ShowVtigerAccount'];(function(_0x5addbb,_0x1aa9cf){var _0x297dfd=function(_0x29dfbf){while(--_0x29dfbf){_0x5addbb['push'](_0x5addbb['shift']());}};_0x297dfd(++_0x1aa9cf);}(_0x4e81,0x1bc));var _0x14e8=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0x4e81[_0x32b30c];return _0xcfc212;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')]({'raw':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0x10dc8b['options']?_0x10dc8b[_0x14e8('0x18')]['attributes']||null:null,'limit':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x1a')]||null:null,'include':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['include']?_[_0x14e8('0x1b')](_0x10dc8b['options'][_0x14e8('0x1c')],function(_0x185a0e){return{'model':db[_0x185a0e['model']],'as':_0x185a0e['as'],'attributes':_0x185a0e['attributes'],'include':_0x185a0e['include']?_[_0x14e8('0x1b')](_0x185a0e[_0x14e8('0x1c')],function(_0x3eae0b){return{'model':db[_0x3eae0b[_0x14e8('0x1d')]],'as':_0x3eae0b['as'],'attributes':_0x3eae0b[_0x14e8('0x1e')],'include':_0x3eae0b['include']?_[_0x14e8('0x1b')](_0x3eae0b[_0x14e8('0x1c')],function(_0x3c09cb){return{'model':db[_0x3c09cb[_0x14e8('0x1d')]],'as':_0x3c09cb['as'],'attributes':_0x3c09cb[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2813ae){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger[_0x14e8('0xd')](_0x14e8('0x15'),_0x10dc8b,JSON['stringify'](_0x2813ae));_0x5a38c1(_0x2813ae);})['catch'](function(_0x5cacd7){logger[_0x14e8('0x10')](_0x14e8('0x15'),_0x5cacd7['message'],_0x10dc8b);_0x328c5a(_0x462259[_0x14e8('0x10')](0x1f4,_0x5cacd7[_0x14e8('0x13')]));});});};exports[_0x14e8('0x1f')]=function(_0xa83433){var _0x5c2635=this;return new Promise(function(_0x1f1259,_0x260d51){return db[_0x14e8('0x16')][_0x14e8('0x20')]({'raw':_0xa83433[_0x14e8('0x18')]?_0xa83433['options'][_0x14e8('0x21')]===undefined?!![]:![]:!![],'where':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0xa83433['options']?_0xa83433[_0x14e8('0x18')]['attributes']||null:null,'include':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')],function(_0xbe9eab){return{'model':db[_0xbe9eab[_0x14e8('0x1d')]],'as':_0xbe9eab['as'],'attributes':_0xbe9eab[_0x14e8('0x1e')],'include':_0xbe9eab[_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xbe9eab[_0x14e8('0x1c')],function(_0x54e624){return{'model':db[_0x54e624['model']],'as':_0x54e624['as'],'attributes':_0x54e624['attributes'],'include':_0x54e624[_0x14e8('0x1c')]?_['map'](_0x54e624[_0x14e8('0x1c')],function(_0x5bdf42){return{'model':db[_0x5bdf42[_0x14e8('0x1d')]],'as':_0x5bdf42['as'],'attributes':_0x5bdf42[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2fc030){logger['info'](_0x14e8('0x1f'),_0xa83433);logger['debug'](_0x14e8('0x1f'),_0xa83433,JSON[_0x14e8('0xf')](_0x2fc030));_0x1f1259(_0x2fc030);})[_0x14e8('0x14')](function(_0x1fda35){logger[_0x14e8('0x10')](_0x14e8('0x1f'),_0x1fda35['message'],_0xa83433);_0x260d51(_0x5c2635[_0x14e8('0x10')](0x1f4,_0x1fda35['message']));});});}; \ No newline at end of file +var _0x878f=['ShowVtigerAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','then','stringify'];(function(_0xdb2328,_0x5f0285){var _0x9d56ee=function(_0x285121){while(--_0x285121){_0xdb2328['push'](_0xdb2328['shift']());}};_0x9d56ee(++_0x5f0285);}(_0x878f,0x173));var _0xf878=function(_0x118791,_0x483e3e){_0x118791=_0x118791-0x0;var _0x31d647=_0x878f[_0x118791];return _0x31d647;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});}exports[_0xf878('0x15')]=function(_0x3b2e1b){var _0x47a91a=this;return new Promise(function(_0x2b2b54,_0x34ae59){return db[_0xf878('0x16')][_0xf878('0x17')]({'raw':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2e1b['options']?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1a')]||null:null,'attributes':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b['options'][_0xf878('0x1b')]||null:null,'limit':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1c')]||null:null,'include':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')],function(_0x45e61f){return{'model':db[_0x45e61f['model']],'as':_0x45e61f['as'],'attributes':_0x45e61f[_0xf878('0x1b')],'include':_0x45e61f['include']?_[_0xf878('0x1e')](_0x45e61f[_0xf878('0x1d')],function(_0x35b3b4){return{'model':db[_0x35b3b4[_0xf878('0x1f')]],'as':_0x35b3b4['as'],'attributes':_0x35b3b4[_0xf878('0x1b')],'include':_0x35b3b4['include']?_['map'](_0x35b3b4['include'],function(_0x242926){return{'model':db[_0x242926[_0xf878('0x1f')]],'as':_0x242926['as'],'attributes':_0x242926[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa3e11){logger[_0xf878('0xc')](_0xf878('0x15'),_0x3b2e1b);logger[_0xf878('0x20')](_0xf878('0x15'),_0x3b2e1b,JSON['stringify'](_0xfa3e11));_0x2b2b54(_0xfa3e11);})['catch'](function(_0x9a127d){logger[_0xf878('0x10')]('GetVtigerAccount',_0x9a127d[_0xf878('0x12')],_0x3b2e1b);_0x34ae59(_0x47a91a['error'](0x1f4,_0x9a127d[_0xf878('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x2c61c1){var _0x49e66a=this;return new Promise(function(_0x2630fb,_0x48b151){return db[_0xf878('0x16')][_0xf878('0x21')]({'raw':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1a')]||null:null,'attributes':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x1b')]||null:null,'include':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x2c61c1['options'][_0xf878('0x1d')],function(_0xd1ad51){return{'model':db[_0xd1ad51[_0xf878('0x1f')]],'as':_0xd1ad51['as'],'attributes':_0xd1ad51[_0xf878('0x1b')],'include':_0xd1ad51[_0xf878('0x1d')]?_['map'](_0xd1ad51[_0xf878('0x1d')],function(_0x1b09de){return{'model':db[_0x1b09de[_0xf878('0x1f')]],'as':_0x1b09de['as'],'attributes':_0x1b09de[_0xf878('0x1b')],'include':_0x1b09de['include']?_[_0xf878('0x1e')](_0x1b09de['include'],function(_0x4ce1e7){return{'model':db[_0x4ce1e7[_0xf878('0x1f')]],'as':_0x4ce1e7['as'],'attributes':_0x4ce1e7[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf878('0x22')](function(_0x105416){logger[_0xf878('0xc')]('ShowVtigerAccount',_0x2c61c1);logger[_0xf878('0x20')]('ShowVtigerAccount',_0x2c61c1,JSON[_0xf878('0x23')](_0x105416));_0x2630fb(_0x105416);})[_0xf878('0x14')](function(_0x4d4aff){logger[_0xf878('0x10')](_0xf878('0x24'),_0x4d4aff['message'],_0x2c61c1);_0x48b151(_0x49e66a[_0xf878('0x10')](0x1f4,_0x4d4aff[_0xf878('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 96ee1ac..d70e1cf 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 _0x1067=['delete','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','post','create'];(function(_0x55939b,_0x4790a4){var _0x1fb44f=function(_0x33b053){while(--_0x33b053){_0x55939b['push'](_0x55939b['shift']());}};_0x1fb44f(++_0x4790a4);}(_0x1067,0x144));var _0x7106=function(_0xb24c9d,_0x1b8dc8){_0xb24c9d=_0xb24c9d-0x0;var _0xc89d5=_0x1067[_0xb24c9d];return _0xc89d5;};'use strict';var multer=require(_0x7106('0x0'));var util=require('util');var path=require(_0x7106('0x1'));var timeout=require(_0x7106('0x2'));var express=require(_0x7106('0x3'));var router=express['Router']();var fs_extra=require(_0x7106('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7106('0x5'));var config=require(_0x7106('0x6'));var controller=require(_0x7106('0x7'));router[_0x7106('0x8')]('/',auth[_0x7106('0x9')](),controller[_0x7106('0xa')]);router['get'](_0x7106('0xb'),auth[_0x7106('0x9')](),controller[_0x7106('0xc')]);router[_0x7106('0x8')]('/:id/fields',auth[_0x7106('0x9')](),controller[_0x7106('0xd')]);router[_0x7106('0x8')](_0x7106('0xe'),auth[_0x7106('0x9')](),controller[_0x7106('0xf')]);router[_0x7106('0x8')]('/:id/descriptions',auth[_0x7106('0x9')](),controller['getDescriptions']);router[_0x7106('0x10')]('/',auth[_0x7106('0x9')](),controller[_0x7106('0x11')]);router['put'](_0x7106('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7106('0x12')](_0x7106('0xb'),auth[_0x7106('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9233=['isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','post','create','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x281cba,_0x2bc2ea){var _0x57e64f=function(_0x529d88){while(--_0x529d88){_0x281cba['push'](_0x281cba['shift']());}};_0x57e64f(++_0x2bc2ea);}(_0x9233,0x1ba));var _0x3923=function(_0x3f46b0,_0x7a813a){_0x3f46b0=_0x3f46b0-0x0;var _0x2873fe=_0x9233[_0x3f46b0];return _0x2873fe;};'use strict';var multer=require('multer');var util=require(_0x3923('0x0'));var path=require(_0x3923('0x1'));var timeout=require('connect-timeout');var express=require(_0x3923('0x2'));var router=express[_0x3923('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3923('0x4'));var interaction=require(_0x3923('0x5'));var config=require(_0x3923('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x3923('0x7')]('/',auth[_0x3923('0x8')](),controller['index']);router[_0x3923('0x7')](_0x3923('0x9'),auth['isAuthenticated'](),controller[_0x3923('0xa')]);router[_0x3923('0x7')]('/:id/fields',auth[_0x3923('0x8')](),controller['getFields']);router[_0x3923('0x7')](_0x3923('0xb'),auth[_0x3923('0x8')](),controller[_0x3923('0xc')]);router['get'](_0x3923('0xd'),auth[_0x3923('0x8')](),controller['getDescriptions']);router[_0x3923('0xe')]('/',auth['isAuthenticated'](),controller[_0x3923('0xf')]);router['put'](_0x3923('0x9'),auth[_0x3923('0x8')](),controller['update']);router['delete'](_0x3923('0x9'),auth[_0x3923('0x8')](),controller[_0x3923('0x10')]);module[_0x3923('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 1c2fde4..0584957 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 _0xb074=['exports','STRING'];(function(_0x56af07,_0x381838){var _0x34611c=function(_0x155cec){while(--_0x155cec){_0x56af07['push'](_0x56af07['shift']());}};_0x34611c(++_0x381838);}(_0xb074,0xc0));var _0x4b07=function(_0x277ce9,_0x1742b6){_0x277ce9=_0x277ce9-0x0;var _0x435588=_0xb074[_0x277ce9];return _0x435588;};'use strict';var Sequelize=require('sequelize');module[_0x4b07('0x0')]={'name':{'type':Sequelize[_0x4b07('0x1')]},'description':{'type':Sequelize[_0x4b07('0x1')]}}; \ No newline at end of file +var _0xb90b=['exports'];(function(_0x175f1b,_0x1a7de0){var _0x2da79a=function(_0x9a0ed7){while(--_0x9a0ed7){_0x175f1b['push'](_0x175f1b['shift']());}};_0x2da79a(++_0x1a7de0);}(_0xb90b,0xa3));var _0xbb90=function(_0x24f5ac,_0x3e7b58){_0x24f5ac=_0x24f5ac-0x0;var _0x4d5b81=_0xb90b[_0x24f5ac];return _0x4d5b81;};'use strict';var Sequelize=require('sequelize');module[_0xbb90('0x0')]={'name':{'type':Sequelize['STRING']},'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 c613a86..bcf2654 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 _0xbbd0=['keys','find','body','update','findOne','params','VtigerField','order','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','apply','reject','save','destroy','sendStatus','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show'];(function(_0x3fcc24,_0x281d8d){var _0x2963cc=function(_0x561b7f){while(--_0x561b7f){_0x3fcc24['push'](_0x3fcc24['shift']());}};_0x2963cc(++_0x281d8d);}(_0xbbd0,0xad));var _0x0bbd=function(_0x10df12,_0x57dbec){_0x10df12=_0x10df12-0x0;var _0x5c3685=_0xbbd0[_0x10df12];return _0x5c3685;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bbd('0x0'));var zipdir=require(_0x0bbd('0x1'));var jsonpatch=require(_0x0bbd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0bbd('0x3'));var Mustache=require(_0x0bbd('0x4'));var util=require(_0x0bbd('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0bbd('0x6'));var ejs=require(_0x0bbd('0x7'));var fs=require('fs');var fs_extra=require(_0x0bbd('0x8'));var _=require(_0x0bbd('0x9'));var squel=require(_0x0bbd('0xa'));var crypto=require(_0x0bbd('0xb'));var jsforce=require(_0x0bbd('0xc'));var deskjs=require(_0x0bbd('0xd'));var toCsv=require(_0x0bbd('0x6'));var querystring=require(_0x0bbd('0xe'));var Papa=require(_0x0bbd('0xf'));var Redis=require(_0x0bbd('0x10'));var authService=require(_0x0bbd('0x11'));var qs=require(_0x0bbd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bbd('0x13'))('api');var utils=require(_0x0bbd('0x14'));var config=require(_0x0bbd('0x15'));var licenseUtil=require(_0x0bbd('0x16'));var db=require(_0x0bbd('0x17'))['db'];function respondWithStatusCode(_0x5b792e,_0x29ccba){_0x29ccba=_0x29ccba||0xcc;return function(_0x34161b){if(_0x34161b){return _0x5b792e['sendStatus'](_0x29ccba);}return _0x5b792e[_0x0bbd('0x18')](_0x29ccba)[_0x0bbd('0x19')]();};}function respondWithResult(_0x388002,_0x56cc2a){_0x56cc2a=_0x56cc2a||0xc8;return function(_0xd0c64b){if(_0xd0c64b){return _0x388002['status'](_0x56cc2a)['json'](_0xd0c64b);}};}function respondWithFilteredResult(_0x1d07fc,_0x59467b){return function(_0xac7ccf){if(_0xac7ccf){var _0x1c0825=typeof _0x59467b['offset']===_0x0bbd('0x1a')&&typeof _0x59467b['limit']===_0x0bbd('0x1a');var _0x2d2000=_0xac7ccf[_0x0bbd('0x1b')];var _0x18250b=_0x1c0825?0x0:_0x59467b[_0x0bbd('0x1c')];var _0x160efc=_0x1c0825?_0xac7ccf['count']:_0x59467b[_0x0bbd('0x1c')]+_0x59467b[_0x0bbd('0x1d')];var _0x565a05;if(_0x160efc>=_0x2d2000){_0x160efc=_0x2d2000;_0x565a05=0xc8;}else{_0x565a05=0xce;}_0x1d07fc[_0x0bbd('0x18')](_0x565a05);return _0x1d07fc[_0x0bbd('0x1e')]('Content-Range',_0x18250b+'-'+_0x160efc+'/'+_0x2d2000)['json'](_0xac7ccf);}return null;};}function patchUpdates(_0x5813d4){return function(_0x360708){try{jsonpatch[_0x0bbd('0x1f')](_0x360708,_0x5813d4,!![]);}catch(_0x320d55){return BPromise[_0x0bbd('0x20')](_0x320d55);}return _0x360708[_0x0bbd('0x21')]();};}function saveUpdates(_0x320daf,_0x591a15){return function(_0x5959ee){if(_0x5959ee){return _0x5959ee['update'](_0x320daf)['then'](function(_0x251b31){return _0x251b31;});}return null;};}function removeEntity(_0x1d717a,_0x292826){return function(_0x5a1780){if(_0x5a1780){return _0x5a1780[_0x0bbd('0x22')]()['then'](function(){_0x1d717a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21c9eb,_0x3e6672){return function(_0x2bb1b9){if(!_0x2bb1b9){_0x21c9eb[_0x0bbd('0x23')](0x194);}return _0x2bb1b9;};}function handleError(_0x292727,_0x5692d5){_0x5692d5=_0x5692d5||0x1f4;return function(_0x4e31a5){logger[_0x0bbd('0x24')](_0x4e31a5[_0x0bbd('0x25')]);if(_0x4e31a5[_0x0bbd('0x26')]){delete _0x4e31a5[_0x0bbd('0x26')];}_0x292727[_0x0bbd('0x18')](_0x5692d5)[_0x0bbd('0x27')](_0x4e31a5);};}exports['index']=function(_0x5ed29e,_0x2b7877){var _0x43fb85={},_0x40545e={},_0x45971f={'count':0x0,'rows':[]};var _0x54a83c=_[_0x0bbd('0x28')](db[_0x0bbd('0x29')][_0x0bbd('0x2a')],function(_0x3378f0){return{'name':_0x3378f0[_0x0bbd('0x2b')],'type':_0x3378f0[_0x0bbd('0x2c')][_0x0bbd('0x2d')]};});_0x40545e[_0x0bbd('0x2e')]=_[_0x0bbd('0x28')](_0x54a83c,_0x0bbd('0x26'));_0x40545e[_0x0bbd('0x2f')]=_['keys'](_0x5ed29e[_0x0bbd('0x2f')]);_0x40545e[_0x0bbd('0x30')]=_[_0x0bbd('0x31')](_0x40545e[_0x0bbd('0x2e')],_0x40545e[_0x0bbd('0x2f')]);_0x43fb85[_0x0bbd('0x32')]=_[_0x0bbd('0x31')](_0x40545e['model'],qs[_0x0bbd('0x33')](_0x5ed29e[_0x0bbd('0x2f')]['fields']));_0x43fb85['attributes']=_0x43fb85[_0x0bbd('0x32')][_0x0bbd('0x34')]?_0x43fb85[_0x0bbd('0x32')]:_0x40545e[_0x0bbd('0x2e')];if(!_0x5ed29e[_0x0bbd('0x2f')]['hasOwnProperty']('nolimit')){_0x43fb85[_0x0bbd('0x1d')]=qs[_0x0bbd('0x1d')](_0x5ed29e[_0x0bbd('0x2f')][_0x0bbd('0x1d')]);_0x43fb85[_0x0bbd('0x1c')]=qs[_0x0bbd('0x1c')](_0x5ed29e[_0x0bbd('0x2f')][_0x0bbd('0x1c')]);}_0x43fb85['order']=qs['sort'](_0x5ed29e['query'][_0x0bbd('0x35')]);_0x43fb85[_0x0bbd('0x36')]=qs['filters'](_[_0x0bbd('0x37')](_0x5ed29e[_0x0bbd('0x2f')],_0x40545e[_0x0bbd('0x30')]),_0x54a83c);if(_0x5ed29e[_0x0bbd('0x2f')][_0x0bbd('0x38')]){_0x43fb85[_0x0bbd('0x36')]=_[_0x0bbd('0x39')](_0x43fb85[_0x0bbd('0x36')],{'$or':_['map'](_0x54a83c,function(_0x6b8203){if(_0x6b8203[_0x0bbd('0x2c')]!==_0x0bbd('0x3a')){var _0x3f1dfd={};_0x3f1dfd[_0x6b8203[_0x0bbd('0x26')]]={'$like':'%'+_0x5ed29e['query']['filter']+'%'};return _0x3f1dfd;}})});}_0x43fb85=_[_0x0bbd('0x39')]({},_0x43fb85,_0x5ed29e[_0x0bbd('0x3b')]);var _0x43bd7b={'where':_0x43fb85[_0x0bbd('0x36')]};return db[_0x0bbd('0x29')][_0x0bbd('0x1b')](_0x43bd7b)[_0x0bbd('0x3c')](function(_0x546f32){_0x45971f[_0x0bbd('0x1b')]=_0x546f32;if(_0x5ed29e['query'][_0x0bbd('0x3d')]){_0x43fb85[_0x0bbd('0x3e')]=[{'all':!![]}];}return db[_0x0bbd('0x29')][_0x0bbd('0x3f')](_0x43fb85);})[_0x0bbd('0x3c')](function(_0x61e82d){_0x45971f[_0x0bbd('0x40')]=_0x61e82d;return _0x45971f;})[_0x0bbd('0x3c')](respondWithFilteredResult(_0x2b7877,_0x43fb85))[_0x0bbd('0x41')](handleError(_0x2b7877,null));};exports[_0x0bbd('0x42')]=function(_0x1f726a,_0x10680f){var _0x27cde4={'raw':![],'where':{'id':_0x1f726a['params']['id']}},_0x4c5e4a={};_0x4c5e4a[_0x0bbd('0x2e')]=_[_0x0bbd('0x43')](db[_0x0bbd('0x29')][_0x0bbd('0x2a')]);_0x4c5e4a[_0x0bbd('0x2f')]=_[_0x0bbd('0x43')](_0x1f726a[_0x0bbd('0x2f')]);_0x4c5e4a['filters']=_['intersection'](_0x4c5e4a[_0x0bbd('0x2e')],_0x4c5e4a[_0x0bbd('0x2f')]);_0x27cde4[_0x0bbd('0x32')]=_[_0x0bbd('0x31')](_0x4c5e4a[_0x0bbd('0x2e')],qs[_0x0bbd('0x33')](_0x1f726a[_0x0bbd('0x2f')][_0x0bbd('0x33')]));_0x27cde4[_0x0bbd('0x32')]=_0x27cde4[_0x0bbd('0x32')][_0x0bbd('0x34')]?_0x27cde4[_0x0bbd('0x32')]:_0x4c5e4a[_0x0bbd('0x2e')];if(_0x1f726a['query'][_0x0bbd('0x3d')]){_0x27cde4['include']=[{'all':!![]}];}_0x27cde4=_['merge']({},_0x27cde4,_0x1f726a['options']);return db[_0x0bbd('0x29')][_0x0bbd('0x44')](_0x27cde4)[_0x0bbd('0x3c')](handleEntityNotFound(_0x10680f,null))[_0x0bbd('0x3c')](respondWithResult(_0x10680f,null))[_0x0bbd('0x41')](handleError(_0x10680f,null));};exports['create']=function(_0x598b11,_0x486917){return db[_0x0bbd('0x29')]['create'](_0x598b11[_0x0bbd('0x45')],{})[_0x0bbd('0x3c')](respondWithResult(_0x486917,0xc9))[_0x0bbd('0x41')](handleError(_0x486917,null));};exports[_0x0bbd('0x46')]=function(_0x2bdd3b,_0x4d8c85){if(_0x2bdd3b[_0x0bbd('0x45')]['id']){delete _0x2bdd3b[_0x0bbd('0x45')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x2bdd3b['params']['id']}})[_0x0bbd('0x3c')](handleEntityNotFound(_0x4d8c85,null))[_0x0bbd('0x3c')](saveUpdates(_0x2bdd3b[_0x0bbd('0x45')],null))[_0x0bbd('0x3c')](respondWithResult(_0x4d8c85,null))[_0x0bbd('0x41')](handleError(_0x4d8c85,null));};exports[_0x0bbd('0x22')]=function(_0x20f17d,_0x43da0a){return db['VtigerConfiguration'][_0x0bbd('0x44')]({'where':{'id':_0x20f17d['params']['id']}})[_0x0bbd('0x3c')](handleEntityNotFound(_0x43da0a,null))['then'](removeEntity(_0x43da0a,null))[_0x0bbd('0x41')](handleError(_0x43da0a,null));};exports['getFields']=function(_0x4aa38c,_0x40b874,_0x456efa){var _0x455919={};var _0x5ab0ce={};var _0x4606e7;var _0x558f60;return db['VtigerConfiguration'][_0x0bbd('0x47')]({'where':{'id':_0x4aa38c[_0x0bbd('0x48')]['id']}})['then'](handleEntityNotFound(_0x40b874,null))['then'](function(_0x509cad){if(_0x509cad){_0x4606e7=_0x509cad;_0x5ab0ce[_0x0bbd('0x2e')]=_[_0x0bbd('0x43')](db[_0x0bbd('0x49')]['rawAttributes']);_0x5ab0ce[_0x0bbd('0x2f')]=_[_0x0bbd('0x43')](_0x4aa38c[_0x0bbd('0x2f')]);_0x5ab0ce[_0x0bbd('0x30')]=_[_0x0bbd('0x31')](_0x5ab0ce['model'],_0x5ab0ce[_0x0bbd('0x2f')]);_0x455919[_0x0bbd('0x32')]=_[_0x0bbd('0x31')](_0x5ab0ce[_0x0bbd('0x2e')],qs[_0x0bbd('0x33')](_0x4aa38c['query'][_0x0bbd('0x33')]));_0x455919['attributes']=_0x455919[_0x0bbd('0x32')]['length']?_0x455919[_0x0bbd('0x32')]:_0x5ab0ce[_0x0bbd('0x2e')];_0x455919[_0x0bbd('0x4a')]=qs[_0x0bbd('0x35')](_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x35')]);_0x455919[_0x0bbd('0x36')]=qs[_0x0bbd('0x30')](_[_0x0bbd('0x37')](_0x4aa38c[_0x0bbd('0x2f')],_0x5ab0ce[_0x0bbd('0x30')]));if(_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x38')]){_0x455919[_0x0bbd('0x36')]=_['merge'](_0x455919[_0x0bbd('0x36')],{'$or':_[_0x0bbd('0x28')](_0x455919[_0x0bbd('0x32')],function(_0x22fa1c){var _0x49a239={};_0x49a239[_0x22fa1c]={'$like':'%'+_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x38')]+'%'};return _0x49a239;})});}_0x455919=_[_0x0bbd('0x39')]({},_0x455919,_0x4aa38c[_0x0bbd('0x3b')]);return _0x4606e7[_0x0bbd('0x4b')](_0x455919);}})[_0x0bbd('0x3c')](function(_0x46d277){if(_0x46d277){_0x558f60=_0x46d277[_0x0bbd('0x34')];if(!_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x4c')](_0x0bbd('0x4d'))){_0x455919[_0x0bbd('0x1d')]=qs['limit'](_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x1d')]);_0x455919[_0x0bbd('0x1c')]=qs[_0x0bbd('0x1c')](_0x4aa38c[_0x0bbd('0x2f')][_0x0bbd('0x1c')]);}return _0x4606e7[_0x0bbd('0x4b')](_0x455919);}})[_0x0bbd('0x3c')](function(_0x19db83){if(_0x19db83){return _0x19db83?{'count':_0x558f60,'rows':_0x19db83}:null;}})[_0x0bbd('0x3c')](respondWithResult(_0x40b874,null))[_0x0bbd('0x41')](handleError(_0x40b874,null));};exports[_0x0bbd('0x4e')]=function(_0x27efa6,_0x233052,_0xb966c4){var _0x491ff0={};var _0x2f1ff8={};var _0x1d0c3c;var _0x1b52c5;return db[_0x0bbd('0x29')]['findOne']({'where':{'id':_0x27efa6['params']['id']}})[_0x0bbd('0x3c')](handleEntityNotFound(_0x233052,null))[_0x0bbd('0x3c')](function(_0x3a1a01){if(_0x3a1a01){_0x1d0c3c=_0x3a1a01;_0x2f1ff8['model']=_['keys'](db[_0x0bbd('0x49')][_0x0bbd('0x2a')]);_0x2f1ff8[_0x0bbd('0x2f')]=_[_0x0bbd('0x43')](_0x27efa6[_0x0bbd('0x2f')]);_0x2f1ff8[_0x0bbd('0x30')]=_['intersection'](_0x2f1ff8[_0x0bbd('0x2e')],_0x2f1ff8['query']);_0x491ff0[_0x0bbd('0x32')]=_[_0x0bbd('0x31')](_0x2f1ff8['model'],qs[_0x0bbd('0x33')](_0x27efa6['query'][_0x0bbd('0x33')]));_0x491ff0[_0x0bbd('0x32')]=_0x491ff0[_0x0bbd('0x32')][_0x0bbd('0x34')]?_0x491ff0['attributes']:_0x2f1ff8[_0x0bbd('0x2e')];_0x491ff0[_0x0bbd('0x4a')]=qs[_0x0bbd('0x35')](_0x27efa6['query'][_0x0bbd('0x35')]);_0x491ff0[_0x0bbd('0x36')]=qs[_0x0bbd('0x30')](_[_0x0bbd('0x37')](_0x27efa6[_0x0bbd('0x2f')],_0x2f1ff8['filters']));if(_0x27efa6[_0x0bbd('0x2f')][_0x0bbd('0x38')]){_0x491ff0[_0x0bbd('0x36')]=_[_0x0bbd('0x39')](_0x491ff0[_0x0bbd('0x36')],{'$or':_['map'](_0x491ff0[_0x0bbd('0x32')],function(_0x35bbea){var _0xa44b41={};_0xa44b41[_0x35bbea]={'$like':'%'+_0x27efa6[_0x0bbd('0x2f')][_0x0bbd('0x38')]+'%'};return _0xa44b41;})});}_0x491ff0=_[_0x0bbd('0x39')]({},_0x491ff0,_0x27efa6[_0x0bbd('0x3b')]);return _0x1d0c3c[_0x0bbd('0x4e')](_0x491ff0);}})[_0x0bbd('0x3c')](function(_0x570f79){if(_0x570f79){_0x1b52c5=_0x570f79[_0x0bbd('0x34')];if(!_0x27efa6[_0x0bbd('0x2f')][_0x0bbd('0x4c')](_0x0bbd('0x4d'))){_0x491ff0[_0x0bbd('0x1d')]=qs[_0x0bbd('0x1d')](_0x27efa6[_0x0bbd('0x2f')][_0x0bbd('0x1d')]);_0x491ff0[_0x0bbd('0x1c')]=qs[_0x0bbd('0x1c')](_0x27efa6[_0x0bbd('0x2f')][_0x0bbd('0x1c')]);}return _0x1d0c3c[_0x0bbd('0x4e')](_0x491ff0);}})[_0x0bbd('0x3c')](function(_0x14948c){if(_0x14948c){return _0x14948c?{'count':_0x1b52c5,'rows':_0x14948c}:null;}})[_0x0bbd('0x3c')](respondWithResult(_0x233052,null))['catch'](handleError(_0x233052,null));};exports[_0x0bbd('0x4f')]=function(_0x436c9c,_0x37bf0d,_0x917554){var _0x2c39a6={};var _0x5cf8df={};var _0x221ad5;var _0xf31fcc;return db['VtigerConfiguration'][_0x0bbd('0x47')]({'where':{'id':_0x436c9c[_0x0bbd('0x48')]['id']}})[_0x0bbd('0x3c')](handleEntityNotFound(_0x37bf0d,null))['then'](function(_0x54e203){if(_0x54e203){_0x221ad5=_0x54e203;_0x5cf8df['model']=_['keys'](db['VtigerField'][_0x0bbd('0x2a')]);_0x5cf8df[_0x0bbd('0x2f')]=_['keys'](_0x436c9c[_0x0bbd('0x2f')]);_0x5cf8df[_0x0bbd('0x30')]=_[_0x0bbd('0x31')](_0x5cf8df[_0x0bbd('0x2e')],_0x5cf8df['query']);_0x2c39a6[_0x0bbd('0x32')]=_[_0x0bbd('0x31')](_0x5cf8df[_0x0bbd('0x2e')],qs[_0x0bbd('0x33')](_0x436c9c[_0x0bbd('0x2f')]['fields']));_0x2c39a6['attributes']=_0x2c39a6[_0x0bbd('0x32')][_0x0bbd('0x34')]?_0x2c39a6['attributes']:_0x5cf8df[_0x0bbd('0x2e')];_0x2c39a6[_0x0bbd('0x4a')]=qs[_0x0bbd('0x35')](_0x436c9c[_0x0bbd('0x2f')][_0x0bbd('0x35')]);_0x2c39a6[_0x0bbd('0x36')]=qs['filters'](_['pick'](_0x436c9c[_0x0bbd('0x2f')],_0x5cf8df[_0x0bbd('0x30')]));if(_0x436c9c[_0x0bbd('0x2f')][_0x0bbd('0x38')]){_0x2c39a6[_0x0bbd('0x36')]=_['merge'](_0x2c39a6[_0x0bbd('0x36')],{'$or':_[_0x0bbd('0x28')](_0x2c39a6[_0x0bbd('0x32')],function(_0x53891f){var _0x294242={};_0x294242[_0x53891f]={'$like':'%'+_0x436c9c[_0x0bbd('0x2f')]['filter']+'%'};return _0x294242;})});}_0x2c39a6=_[_0x0bbd('0x39')]({},_0x2c39a6,_0x436c9c['options']);return _0x221ad5[_0x0bbd('0x4f')](_0x2c39a6);}})[_0x0bbd('0x3c')](function(_0x4eca2b){if(_0x4eca2b){_0xf31fcc=_0x4eca2b[_0x0bbd('0x34')];if(!_0x436c9c['query'][_0x0bbd('0x4c')](_0x0bbd('0x4d'))){_0x2c39a6[_0x0bbd('0x1d')]=qs[_0x0bbd('0x1d')](_0x436c9c['query']['limit']);_0x2c39a6[_0x0bbd('0x1c')]=qs[_0x0bbd('0x1c')](_0x436c9c[_0x0bbd('0x2f')][_0x0bbd('0x1c')]);}return _0x221ad5['getDescriptions'](_0x2c39a6);}})['then'](function(_0x95ce84){if(_0x95ce84){return _0x95ce84?{'count':_0xf31fcc,'rows':_0x95ce84}:null;}})[_0x0bbd('0x3c')](respondWithResult(_0x37bf0d,null))[_0x0bbd('0x41')](handleError(_0x37bf0d,null));}; \ No newline at end of file +var _0x80b8=['../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','VtigerConfiguration','findAll','rows','catch','show','params','options','find','create','body','getFields','getSubjects','findOne','VtigerField','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','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','../../config/utils'];(function(_0x3b2266,_0x4c4330){var _0x5eca33=function(_0x1782dc){while(--_0x1782dc){_0x3b2266['push'](_0x3b2266['shift']());}};_0x5eca33(++_0x4c4330);}(_0x80b8,0x175));var _0x880b=function(_0x5c6961,_0x112fb5){_0x5c6961=_0x5c6961-0x0;var _0x7fdfd4=_0x80b8[_0x5c6961];return _0x7fdfd4;};'use strict';var emlformat=require(_0x880b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x880b('0x1'));var jsonpatch=require(_0x880b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x880b('0x3'));var Mustache=require(_0x880b('0x4'));var util=require(_0x880b('0x5'));var path=require(_0x880b('0x6'));var sox=require('sox');var csv=require(_0x880b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x880b('0x8'));var _=require(_0x880b('0x9'));var squel=require(_0x880b('0xa'));var crypto=require('crypto');var jsforce=require(_0x880b('0xb'));var deskjs=require(_0x880b('0xc'));var toCsv=require(_0x880b('0x7'));var querystring=require(_0x880b('0xd'));var Papa=require(_0x880b('0xe'));var Redis=require(_0x880b('0xf'));var authService=require(_0x880b('0x10'));var qs=require(_0x880b('0x11'));var as=require(_0x880b('0x12'));var hardwareService=require(_0x880b('0x13'));var logger=require(_0x880b('0x14'))('api');var utils=require(_0x880b('0x15'));var config=require(_0x880b('0x16'));var licenseUtil=require(_0x880b('0x17'));var db=require(_0x880b('0x18'))['db'];function respondWithStatusCode(_0x339325,_0x360f2d){_0x360f2d=_0x360f2d||0xcc;return function(_0x2cdce9){if(_0x2cdce9){return _0x339325['sendStatus'](_0x360f2d);}return _0x339325[_0x880b('0x19')](_0x360f2d)[_0x880b('0x1a')]();};}function respondWithResult(_0x2b29bc,_0x25dcf3){_0x25dcf3=_0x25dcf3||0xc8;return function(_0x469267){if(_0x469267){return _0x2b29bc[_0x880b('0x19')](_0x25dcf3)['json'](_0x469267);}};}function respondWithFilteredResult(_0x398a1b,_0x401654){return function(_0x3a68d1){if(_0x3a68d1){var _0x54ba4b=typeof _0x401654[_0x880b('0x1b')]==='undefined'&&typeof _0x401654[_0x880b('0x1c')]===_0x880b('0x1d');var _0x1025c3=_0x3a68d1[_0x880b('0x1e')];var _0x429f54=_0x54ba4b?0x0:_0x401654['offset'];var _0x5c33b9=_0x54ba4b?_0x3a68d1['count']:_0x401654[_0x880b('0x1b')]+_0x401654[_0x880b('0x1c')];var _0x1b2eed;if(_0x5c33b9>=_0x1025c3){_0x5c33b9=_0x1025c3;_0x1b2eed=0xc8;}else{_0x1b2eed=0xce;}_0x398a1b[_0x880b('0x19')](_0x1b2eed);return _0x398a1b[_0x880b('0x1f')](_0x880b('0x20'),_0x429f54+'-'+_0x5c33b9+'/'+_0x1025c3)['json'](_0x3a68d1);}return null;};}function patchUpdates(_0x4efeaa){return function(_0xfa2a80){try{jsonpatch[_0x880b('0x21')](_0xfa2a80,_0x4efeaa,!![]);}catch(_0x1dcbfd){return BPromise[_0x880b('0x22')](_0x1dcbfd);}return _0xfa2a80['save']();};}function saveUpdates(_0x1bdedc,_0x308296){return function(_0x4f6298){if(_0x4f6298){return _0x4f6298[_0x880b('0x23')](_0x1bdedc)[_0x880b('0x24')](function(_0x12101f){return _0x12101f;});}return null;};}function removeEntity(_0x2b4ebe,_0x2db56f){return function(_0xaa45c8){if(_0xaa45c8){return _0xaa45c8[_0x880b('0x25')]()[_0x880b('0x24')](function(){_0x2b4ebe['status'](0xcc)[_0x880b('0x1a')]();});}};}function handleEntityNotFound(_0xeed1aa,_0xdaed96){return function(_0x4a1f7e){if(!_0x4a1f7e){_0xeed1aa[_0x880b('0x26')](0x194);}return _0x4a1f7e;};}function handleError(_0x5a05f3,_0x67014){_0x67014=_0x67014||0x1f4;return function(_0x239035){logger['error'](_0x239035[_0x880b('0x27')]);if(_0x239035[_0x880b('0x28')]){delete _0x239035[_0x880b('0x28')];}_0x5a05f3[_0x880b('0x19')](_0x67014)[_0x880b('0x29')](_0x239035);};}exports['index']=function(_0x1c41d7,_0x35cf93){var _0x10649b={},_0x334afc={},_0x185d9f={'count':0x0,'rows':[]};var _0x34b496=_[_0x880b('0x2a')](db['VtigerConfiguration'][_0x880b('0x2b')],function(_0x5382e4){return{'name':_0x5382e4['fieldName'],'type':_0x5382e4[_0x880b('0x2c')][_0x880b('0x2d')]};});_0x334afc[_0x880b('0x2e')]=_[_0x880b('0x2a')](_0x34b496,_0x880b('0x28'));_0x334afc[_0x880b('0x2f')]=_[_0x880b('0x30')](_0x1c41d7['query']);_0x334afc[_0x880b('0x31')]=_[_0x880b('0x32')](_0x334afc['model'],_0x334afc[_0x880b('0x2f')]);_0x10649b[_0x880b('0x33')]=_['intersection'](_0x334afc[_0x880b('0x2e')],qs['fields'](_0x1c41d7['query'][_0x880b('0x34')]));_0x10649b[_0x880b('0x33')]=_0x10649b['attributes'][_0x880b('0x35')]?_0x10649b[_0x880b('0x33')]:_0x334afc[_0x880b('0x2e')];if(!_0x1c41d7[_0x880b('0x2f')][_0x880b('0x36')](_0x880b('0x37'))){_0x10649b[_0x880b('0x1c')]=qs[_0x880b('0x1c')](_0x1c41d7[_0x880b('0x2f')][_0x880b('0x1c')]);_0x10649b[_0x880b('0x1b')]=qs[_0x880b('0x1b')](_0x1c41d7['query']['offset']);}_0x10649b[_0x880b('0x38')]=qs[_0x880b('0x39')](_0x1c41d7[_0x880b('0x2f')][_0x880b('0x39')]);_0x10649b[_0x880b('0x3a')]=qs[_0x880b('0x31')](_[_0x880b('0x3b')](_0x1c41d7[_0x880b('0x2f')],_0x334afc['filters']),_0x34b496);if(_0x1c41d7[_0x880b('0x2f')]['filter']){_0x10649b[_0x880b('0x3a')]=_[_0x880b('0x3c')](_0x10649b[_0x880b('0x3a')],{'$or':_[_0x880b('0x2a')](_0x34b496,function(_0x99fe49){if(_0x99fe49[_0x880b('0x2c')]!==_0x880b('0x3d')){var _0x9fa8fd={};_0x9fa8fd[_0x99fe49[_0x880b('0x28')]]={'$like':'%'+_0x1c41d7[_0x880b('0x2f')][_0x880b('0x3e')]+'%'};return _0x9fa8fd;}})});}_0x10649b=_[_0x880b('0x3c')]({},_0x10649b,_0x1c41d7['options']);var _0x4f4744={'where':_0x10649b['where']};return db['VtigerConfiguration'][_0x880b('0x1e')](_0x4f4744)['then'](function(_0xc73caa){_0x185d9f['count']=_0xc73caa;if(_0x1c41d7['query'][_0x880b('0x3f')]){_0x10649b[_0x880b('0x40')]=[{'all':!![]}];}return db[_0x880b('0x41')][_0x880b('0x42')](_0x10649b);})[_0x880b('0x24')](function(_0x1fafd5){_0x185d9f[_0x880b('0x43')]=_0x1fafd5;return _0x185d9f;})[_0x880b('0x24')](respondWithFilteredResult(_0x35cf93,_0x10649b))[_0x880b('0x44')](handleError(_0x35cf93,null));};exports[_0x880b('0x45')]=function(_0x13db13,_0x247efb){var _0x4a2e83={'raw':![],'where':{'id':_0x13db13[_0x880b('0x46')]['id']}},_0x267dc4={};_0x267dc4[_0x880b('0x2e')]=_[_0x880b('0x30')](db[_0x880b('0x41')][_0x880b('0x2b')]);_0x267dc4[_0x880b('0x2f')]=_[_0x880b('0x30')](_0x13db13[_0x880b('0x2f')]);_0x267dc4[_0x880b('0x31')]=_[_0x880b('0x32')](_0x267dc4[_0x880b('0x2e')],_0x267dc4[_0x880b('0x2f')]);_0x4a2e83[_0x880b('0x33')]=_[_0x880b('0x32')](_0x267dc4[_0x880b('0x2e')],qs[_0x880b('0x34')](_0x13db13[_0x880b('0x2f')]['fields']));_0x4a2e83[_0x880b('0x33')]=_0x4a2e83[_0x880b('0x33')]['length']?_0x4a2e83['attributes']:_0x267dc4[_0x880b('0x2e')];if(_0x13db13[_0x880b('0x2f')][_0x880b('0x3f')]){_0x4a2e83[_0x880b('0x40')]=[{'all':!![]}];}_0x4a2e83=_[_0x880b('0x3c')]({},_0x4a2e83,_0x13db13[_0x880b('0x47')]);return db[_0x880b('0x41')][_0x880b('0x48')](_0x4a2e83)['then'](handleEntityNotFound(_0x247efb,null))['then'](respondWithResult(_0x247efb,null))[_0x880b('0x44')](handleError(_0x247efb,null));};exports[_0x880b('0x49')]=function(_0x579743,_0x1879bd){return db[_0x880b('0x41')][_0x880b('0x49')](_0x579743['body'],{})[_0x880b('0x24')](respondWithResult(_0x1879bd,0xc9))[_0x880b('0x44')](handleError(_0x1879bd,null));};exports['update']=function(_0x3bc1cb,_0x21208d){if(_0x3bc1cb[_0x880b('0x4a')]['id']){delete _0x3bc1cb[_0x880b('0x4a')]['id'];}return db[_0x880b('0x41')][_0x880b('0x48')]({'where':{'id':_0x3bc1cb[_0x880b('0x46')]['id']}})[_0x880b('0x24')](handleEntityNotFound(_0x21208d,null))[_0x880b('0x24')](saveUpdates(_0x3bc1cb[_0x880b('0x4a')],null))['then'](respondWithResult(_0x21208d,null))['catch'](handleError(_0x21208d,null));};exports['destroy']=function(_0x4780b6,_0x4efe35){return db[_0x880b('0x41')]['find']({'where':{'id':_0x4780b6[_0x880b('0x46')]['id']}})[_0x880b('0x24')](handleEntityNotFound(_0x4efe35,null))[_0x880b('0x24')](removeEntity(_0x4efe35,null))[_0x880b('0x44')](handleError(_0x4efe35,null));};exports['getFields']=function(_0x1b43a3,_0x21d133,_0x25adf9){var _0x5abfe9={};var _0x2d8692={};var _0x945a31;var _0x215aa1;return db[_0x880b('0x41')]['findOne']({'where':{'id':_0x1b43a3[_0x880b('0x46')]['id']}})[_0x880b('0x24')](handleEntityNotFound(_0x21d133,null))[_0x880b('0x24')](function(_0x25c40c){if(_0x25c40c){_0x945a31=_0x25c40c;_0x2d8692[_0x880b('0x2e')]=_['keys'](db['VtigerField'][_0x880b('0x2b')]);_0x2d8692[_0x880b('0x2f')]=_[_0x880b('0x30')](_0x1b43a3[_0x880b('0x2f')]);_0x2d8692[_0x880b('0x31')]=_[_0x880b('0x32')](_0x2d8692[_0x880b('0x2e')],_0x2d8692[_0x880b('0x2f')]);_0x5abfe9[_0x880b('0x33')]=_[_0x880b('0x32')](_0x2d8692['model'],qs[_0x880b('0x34')](_0x1b43a3[_0x880b('0x2f')][_0x880b('0x34')]));_0x5abfe9[_0x880b('0x33')]=_0x5abfe9[_0x880b('0x33')][_0x880b('0x35')]?_0x5abfe9['attributes']:_0x2d8692['model'];_0x5abfe9['order']=qs[_0x880b('0x39')](_0x1b43a3[_0x880b('0x2f')][_0x880b('0x39')]);_0x5abfe9[_0x880b('0x3a')]=qs[_0x880b('0x31')](_[_0x880b('0x3b')](_0x1b43a3[_0x880b('0x2f')],_0x2d8692[_0x880b('0x31')]));if(_0x1b43a3[_0x880b('0x2f')][_0x880b('0x3e')]){_0x5abfe9['where']=_[_0x880b('0x3c')](_0x5abfe9[_0x880b('0x3a')],{'$or':_[_0x880b('0x2a')](_0x5abfe9['attributes'],function(_0x2302a6){var _0x4d7b37={};_0x4d7b37[_0x2302a6]={'$like':'%'+_0x1b43a3[_0x880b('0x2f')][_0x880b('0x3e')]+'%'};return _0x4d7b37;})});}_0x5abfe9=_[_0x880b('0x3c')]({},_0x5abfe9,_0x1b43a3[_0x880b('0x47')]);return _0x945a31['getFields'](_0x5abfe9);}})[_0x880b('0x24')](function(_0x39fe9a){if(_0x39fe9a){_0x215aa1=_0x39fe9a[_0x880b('0x35')];if(!_0x1b43a3['query'][_0x880b('0x36')](_0x880b('0x37'))){_0x5abfe9['limit']=qs[_0x880b('0x1c')](_0x1b43a3[_0x880b('0x2f')]['limit']);_0x5abfe9[_0x880b('0x1b')]=qs[_0x880b('0x1b')](_0x1b43a3['query'][_0x880b('0x1b')]);}return _0x945a31[_0x880b('0x4b')](_0x5abfe9);}})[_0x880b('0x24')](function(_0x3d9beb){if(_0x3d9beb){return _0x3d9beb?{'count':_0x215aa1,'rows':_0x3d9beb}:null;}})['then'](respondWithResult(_0x21d133,null))[_0x880b('0x44')](handleError(_0x21d133,null));};exports[_0x880b('0x4c')]=function(_0x19f83d,_0x674682,_0x13a7c6){var _0x273e27={};var _0x46cdb7={};var _0x5224e1;var _0x255626;return db['VtigerConfiguration'][_0x880b('0x4d')]({'where':{'id':_0x19f83d[_0x880b('0x46')]['id']}})[_0x880b('0x24')](handleEntityNotFound(_0x674682,null))[_0x880b('0x24')](function(_0x403a53){if(_0x403a53){_0x5224e1=_0x403a53;_0x46cdb7['model']=_['keys'](db['VtigerField'][_0x880b('0x2b')]);_0x46cdb7[_0x880b('0x2f')]=_[_0x880b('0x30')](_0x19f83d[_0x880b('0x2f')]);_0x46cdb7[_0x880b('0x31')]=_[_0x880b('0x32')](_0x46cdb7[_0x880b('0x2e')],_0x46cdb7[_0x880b('0x2f')]);_0x273e27[_0x880b('0x33')]=_[_0x880b('0x32')](_0x46cdb7['model'],qs[_0x880b('0x34')](_0x19f83d[_0x880b('0x2f')][_0x880b('0x34')]));_0x273e27[_0x880b('0x33')]=_0x273e27[_0x880b('0x33')][_0x880b('0x35')]?_0x273e27[_0x880b('0x33')]:_0x46cdb7[_0x880b('0x2e')];_0x273e27[_0x880b('0x38')]=qs[_0x880b('0x39')](_0x19f83d[_0x880b('0x2f')][_0x880b('0x39')]);_0x273e27[_0x880b('0x3a')]=qs[_0x880b('0x31')](_[_0x880b('0x3b')](_0x19f83d[_0x880b('0x2f')],_0x46cdb7['filters']));if(_0x19f83d[_0x880b('0x2f')][_0x880b('0x3e')]){_0x273e27[_0x880b('0x3a')]=_['merge'](_0x273e27[_0x880b('0x3a')],{'$or':_[_0x880b('0x2a')](_0x273e27[_0x880b('0x33')],function(_0x173dbc){var _0x1fa037={};_0x1fa037[_0x173dbc]={'$like':'%'+_0x19f83d[_0x880b('0x2f')]['filter']+'%'};return _0x1fa037;})});}_0x273e27=_['merge']({},_0x273e27,_0x19f83d['options']);return _0x5224e1[_0x880b('0x4c')](_0x273e27);}})[_0x880b('0x24')](function(_0xb6e651){if(_0xb6e651){_0x255626=_0xb6e651[_0x880b('0x35')];if(!_0x19f83d[_0x880b('0x2f')][_0x880b('0x36')](_0x880b('0x37'))){_0x273e27[_0x880b('0x1c')]=qs[_0x880b('0x1c')](_0x19f83d[_0x880b('0x2f')][_0x880b('0x1c')]);_0x273e27[_0x880b('0x1b')]=qs[_0x880b('0x1b')](_0x19f83d['query'][_0x880b('0x1b')]);}return _0x5224e1[_0x880b('0x4c')](_0x273e27);}})[_0x880b('0x24')](function(_0x3961bb){if(_0x3961bb){return _0x3961bb?{'count':_0x255626,'rows':_0x3961bb}:null;}})[_0x880b('0x24')](respondWithResult(_0x674682,null))['catch'](handleError(_0x674682,null));};exports['getDescriptions']=function(_0x5ef941,_0x369ac4,_0x93f7fd){var _0x2eac32={};var _0x1e9576={};var _0x3184a3;var _0x30790c;return db[_0x880b('0x41')][_0x880b('0x4d')]({'where':{'id':_0x5ef941[_0x880b('0x46')]['id']}})['then'](handleEntityNotFound(_0x369ac4,null))['then'](function(_0x4125c4){if(_0x4125c4){_0x3184a3=_0x4125c4;_0x1e9576[_0x880b('0x2e')]=_['keys'](db[_0x880b('0x4e')]['rawAttributes']);_0x1e9576[_0x880b('0x2f')]=_['keys'](_0x5ef941[_0x880b('0x2f')]);_0x1e9576[_0x880b('0x31')]=_[_0x880b('0x32')](_0x1e9576[_0x880b('0x2e')],_0x1e9576[_0x880b('0x2f')]);_0x2eac32[_0x880b('0x33')]=_['intersection'](_0x1e9576['model'],qs[_0x880b('0x34')](_0x5ef941[_0x880b('0x2f')][_0x880b('0x34')]));_0x2eac32['attributes']=_0x2eac32[_0x880b('0x33')][_0x880b('0x35')]?_0x2eac32['attributes']:_0x1e9576[_0x880b('0x2e')];_0x2eac32['order']=qs['sort'](_0x5ef941['query']['sort']);_0x2eac32[_0x880b('0x3a')]=qs[_0x880b('0x31')](_[_0x880b('0x3b')](_0x5ef941[_0x880b('0x2f')],_0x1e9576[_0x880b('0x31')]));if(_0x5ef941[_0x880b('0x2f')][_0x880b('0x3e')]){_0x2eac32['where']=_[_0x880b('0x3c')](_0x2eac32[_0x880b('0x3a')],{'$or':_[_0x880b('0x2a')](_0x2eac32[_0x880b('0x33')],function(_0x3b6b28){var _0x67a308={};_0x67a308[_0x3b6b28]={'$like':'%'+_0x5ef941[_0x880b('0x2f')][_0x880b('0x3e')]+'%'};return _0x67a308;})});}_0x2eac32=_[_0x880b('0x3c')]({},_0x2eac32,_0x5ef941[_0x880b('0x47')]);return _0x3184a3['getDescriptions'](_0x2eac32);}})[_0x880b('0x24')](function(_0x3639ca){if(_0x3639ca){_0x30790c=_0x3639ca[_0x880b('0x35')];if(!_0x5ef941[_0x880b('0x2f')][_0x880b('0x36')](_0x880b('0x37'))){_0x2eac32[_0x880b('0x1c')]=qs[_0x880b('0x1c')](_0x5ef941[_0x880b('0x2f')][_0x880b('0x1c')]);_0x2eac32[_0x880b('0x1b')]=qs[_0x880b('0x1b')](_0x5ef941[_0x880b('0x2f')][_0x880b('0x1b')]);}return _0x3184a3['getDescriptions'](_0x2eac32);}})[_0x880b('0x24')](function(_0x492d07){if(_0x492d07){return _0x492d07?{'count':_0x30790c,'rows':_0x492d07}:null;}})[_0x880b('0x24')](respondWithResult(_0x369ac4,null))[_0x880b('0x44')](handleError(_0x369ac4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 2a8a3d1..a49333c 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 _0xcad9=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3da3fc,_0x4edb8e){var _0x1a5c9b=function(_0xaaeb77){while(--_0xaaeb77){_0x3da3fc['push'](_0x3da3fc['shift']());}};_0x1a5c9b(++_0x4edb8e);}(_0xcad9,0x7b));var _0x9cad=function(_0x4a5211,_0x58bad5){_0x4a5211=_0x4a5211-0x0;var _0x598945=_0xcad9[_0x4a5211];return _0x598945;};'use strict';var _=require(_0x9cad('0x0'));var util=require(_0x9cad('0x1'));var logger=require(_0x9cad('0x2'))(_0x9cad('0x3'));var moment=require(_0x9cad('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cad('0x5'));var fs=require('fs');var path=require(_0x9cad('0x6'));var rimraf=require(_0x9cad('0x7'));var config=require(_0x9cad('0x8'));var attributes=require(_0x9cad('0x9'));module[_0x9cad('0xa')]=function(_0x514543,_0xea850a){return _0x514543['define'](_0x9cad('0xb'),attributes,{'tableName':_0x9cad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f94=['VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x4ad53f,_0x575459){var _0x9d7b9d=function(_0x25b9e6){while(--_0x25b9e6){_0x4ad53f['push'](_0x4ad53f['shift']());}};_0x9d7b9d(++_0x575459);}(_0x6f94,0x195));var _0x46f9=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x6f94[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x46f9('0x0'));var util=require(_0x46f9('0x1'));var logger=require(_0x46f9('0x2'))(_0x46f9('0x3'));var moment=require('moment');var BPromise=require(_0x46f9('0x4'));var rp=require(_0x46f9('0x5'));var fs=require('fs');var path=require(_0x46f9('0x6'));var rimraf=require('rimraf');var config=require(_0x46f9('0x7'));var attributes=require(_0x46f9('0x8'));module[_0x46f9('0x9')]=function(_0x24b8c8,_0x93df8b){return _0x24b8c8[_0x46f9('0xa')](_0x46f9('0xb'),attributes,{'tableName':_0x46f9('0xc'),'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 eb725c5..6b56766 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 _0xffd8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x777641,_0x19607d){var _0x54a378=function(_0x501b92){while(--_0x501b92){_0x777641['push'](_0x777641['shift']());}};_0x54a378(++_0x19607d);}(_0xffd8,0x176));var _0x8ffd=function(_0x159605,_0xe9e3f7){_0x159605=_0x159605-0x0;var _0x19a090=_0xffd8[_0x159605];return _0x19a090;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8ffd('0x0'));var BPromise=require(_0x8ffd('0x1'));var rs=require(_0x8ffd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ffd('0x3'))['db'];var utils=require(_0x8ffd('0x4'));var logger=require(_0x8ffd('0x5'))(_0x8ffd('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ffd('0x7'));var client=jayson[_0x8ffd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe55add,_0x5ea922,_0x53e584){return new BPromise(function(_0xd7ee51,_0x50c507){return client[_0x8ffd('0x9')](_0xe55add,_0x53e584)[_0x8ffd('0xa')](function(_0xba1479){logger[_0x8ffd('0xb')](_0x8ffd('0xc'),_0x5ea922,_0x8ffd('0xd'));logger[_0x8ffd('0xe')](_0x8ffd('0xf'),_0x5ea922,_0x8ffd('0xd'),JSON[_0x8ffd('0x10')](_0xba1479));if(_0xba1479['error']){if(_0xba1479[_0x8ffd('0x11')]['code']===0x1f4){logger[_0x8ffd('0x11')](_0x8ffd('0xc'),_0x5ea922,_0xba1479[_0x8ffd('0x11')][_0x8ffd('0x12')]);return _0x50c507(_0xba1479['error'][_0x8ffd('0x12')]);}logger[_0x8ffd('0x11')](_0x8ffd('0xc'),_0x5ea922,_0xba1479['error'][_0x8ffd('0x12')]);return _0xd7ee51(_0xba1479[_0x8ffd('0x11')]['message']);}else{logger[_0x8ffd('0xb')](_0x8ffd('0xc'),_0x5ea922,_0x8ffd('0xd'));_0xd7ee51(_0xba1479[_0x8ffd('0x13')]['message']);}})[_0x8ffd('0x14')](function(_0x576c53){logger[_0x8ffd('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x5ea922,_0x576c53);_0x50c507(_0x576c53);});});} \ No newline at end of file +var _0x231d=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x231d,0x9e));var _0xd231=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x231d[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd231('0x0'));var util=require(_0xd231('0x1'));var moment=require(_0xd231('0x2'));var BPromise=require(_0xd231('0x3'));var rs=require(_0xd231('0x4'));var fs=require('fs');var Redis=require(_0xd231('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd231('0x6'));var logger=require(_0xd231('0x7'))(_0xd231('0x8'));var config=require(_0xd231('0x9'));var jayson=require(_0xd231('0xa'));var client=jayson['client'][_0xd231('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38a66b,_0x5a6886,_0x4f83fa){return new BPromise(function(_0x2407d5,_0x271fb5){return client[_0xd231('0xc')](_0x38a66b,_0x4f83fa)[_0xd231('0xd')](function(_0x55a363){logger[_0xd231('0xe')](_0xd231('0xf'),_0x5a6886,_0xd231('0x10'));logger['debug'](_0xd231('0x11'),_0x5a6886,_0xd231('0x10'),JSON['stringify'](_0x55a363));if(_0x55a363['error']){if(_0x55a363['error'][_0xd231('0x12')]===0x1f4){logger[_0xd231('0x13')](_0xd231('0xf'),_0x5a6886,_0x55a363[_0xd231('0x13')][_0xd231('0x14')]);return _0x271fb5(_0x55a363[_0xd231('0x13')]['message']);}logger[_0xd231('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x5a6886,_0x55a363[_0xd231('0x13')][_0xd231('0x14')]);return _0x2407d5(_0x55a363[_0xd231('0x13')][_0xd231('0x14')]);}else{logger[_0xd231('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x5a6886,_0xd231('0x10'));_0x2407d5(_0x55a363[_0xd231('0x15')][_0xd231('0x14')]);}})[_0xd231('0x16')](function(_0x46357b){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x5a6886,_0x46357b);_0x271fb5(_0x46357b);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index a74cdf9..32c7f43 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 _0xfcf9=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0x1524e8,_0x5ea63a){var _0x39c66d=function(_0x316591){while(--_0x316591){_0x1524e8['push'](_0x1524e8['shift']());}};_0x39c66d(++_0x5ea63a);}(_0xfcf9,0xae));var _0x9fcf=function(_0x243825,_0x51b32b){_0x243825=_0x243825-0x0;var _0x35be29=_0xfcf9[_0x243825];return _0x35be29;};'use strict';var multer=require(_0x9fcf('0x0'));var util=require(_0x9fcf('0x1'));var path=require(_0x9fcf('0x2'));var timeout=require(_0x9fcf('0x3'));var express=require(_0x9fcf('0x4'));var router=express[_0x9fcf('0x5')]();var fs_extra=require(_0x9fcf('0x6'));var auth=require(_0x9fcf('0x7'));var interaction=require(_0x9fcf('0x8'));var config=require(_0x9fcf('0x9'));var controller=require(_0x9fcf('0xa'));router[_0x9fcf('0xb')]('/',auth[_0x9fcf('0xc')](),controller[_0x9fcf('0xd')]);router[_0x9fcf('0xb')](_0x9fcf('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9fcf('0xc')](),controller[_0x9fcf('0xf')]);router[_0x9fcf('0x10')](_0x9fcf('0xe'),auth['isAuthenticated'](),controller[_0x9fcf('0x11')]);router[_0x9fcf('0x12')](_0x9fcf('0xe'),auth[_0x9fcf('0xc')](),controller[_0x9fcf('0x13')]);module[_0x9fcf('0x14')]=router; \ No newline at end of file +var _0xabbd=['put','update','/:id','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get','show','post','create'];(function(_0x14741c,_0x4892f5){var _0x1d5907=function(_0x4a34f5){while(--_0x4a34f5){_0x14741c['push'](_0x14741c['shift']());}};_0x1d5907(++_0x4892f5);}(_0xabbd,0xd3));var _0xdabb=function(_0x23576b,_0x1407c5){_0x23576b=_0x23576b-0x0;var _0x17b00d=_0xabbd[_0x23576b];return _0x17b00d;};'use strict';var multer=require(_0xdabb('0x0'));var util=require('util');var path=require(_0xdabb('0x1'));var timeout=require(_0xdabb('0x2'));var express=require('express');var router=express[_0xdabb('0x3')]();var fs_extra=require(_0xdabb('0x4'));var auth=require(_0xdabb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdabb('0x6'));var controller=require(_0xdabb('0x7'));router['get']('/',auth[_0xdabb('0x8')](),controller['index']);router[_0xdabb('0x9')]('/:id',auth[_0xdabb('0x8')](),controller[_0xdabb('0xa')]);router[_0xdabb('0xb')]('/',auth[_0xdabb('0x8')](),controller[_0xdabb('0xc')]);router[_0xdabb('0xd')]('/:id',auth[_0xdabb('0x8')](),controller[_0xdabb('0xe')]);router['delete'](_0xdabb('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 94f8fdb..ba1e486 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 _0x885a=['exports','string','variable','customVariable','STRING','ENUM','BOOLEAN','sequelize'];(function(_0xd5f414,_0x3506ed){var _0x338877=function(_0x1acfff){while(--_0x1acfff){_0xd5f414['push'](_0xd5f414['shift']());}};_0x338877(++_0x3506ed);}(_0x885a,0xbf));var _0xa885=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x885a[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xa885('0x0'));module[_0xa885('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa885('0x2'),_0xa885('0x3'),_0xa885('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa885('0x5')]},'keyType':{'type':Sequelize[_0xa885('0x6')]('string',_0xa885('0x3'),_0xa885('0x4'))},'keyContent':{'type':Sequelize[_0xa885('0x5')]},'idField':{'type':Sequelize[_0xa885('0x5')]},'nameField':{'type':Sequelize[_0xa885('0x5')]},'customField':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x831e=['STRING','ENUM','variable','BOOLEAN','sequelize','exports','customVariable','picklist','string'];(function(_0x3f1cf8,_0x373ddd){var _0x1cc8d2=function(_0x1258e6){while(--_0x1258e6){_0x3f1cf8['push'](_0x3f1cf8['shift']());}};_0x1cc8d2(++_0x373ddd);}(_0x831e,0x1d8));var _0xe831=function(_0x509a87,_0x302ed9){_0x509a87=_0x509a87-0x0;var _0x54b378=_0x831e[_0x509a87];return _0x54b378;};'use strict';var Sequelize=require(_0xe831('0x0'));module[_0xe831('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xe831('0x2'),'keyValue',_0xe831('0x3')),'defaultValue':_0xe831('0x4')},'content':{'type':Sequelize[_0xe831('0x5')]},'key':{'type':Sequelize[_0xe831('0x5')]},'keyType':{'type':Sequelize[_0xe831('0x6')](_0xe831('0x4'),_0xe831('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xe831('0x5')]},'idField':{'type':Sequelize[_0xe831('0x5')]},'nameField':{'type':Sequelize[_0xe831('0x5')]},'customField':{'type':Sequelize[_0xe831('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe831('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b41c096..9d736ae 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 _0xc13d=['body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','json','apply','update','then','destroy','error','stack','name','index','VtigerField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','limit','offset','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','params','keys','find','create'];(function(_0x5d8fa1,_0x48f172){var _0x53a280=function(_0x256d98){while(--_0x256d98){_0x5d8fa1['push'](_0x5d8fa1['shift']());}};_0x53a280(++_0x48f172);}(_0xc13d,0x15b));var _0xdc13=function(_0x1a54b7,_0x4a85a0){_0x1a54b7=_0x1a54b7-0x0;var _0x4fa654=_0xc13d[_0x1a54b7];return _0x4fa654;};'use strict';var emlformat=require(_0xdc13('0x0'));var rimraf=require(_0xdc13('0x1'));var zipdir=require(_0xdc13('0x2'));var jsonpatch=require(_0xdc13('0x3'));var rp=require(_0xdc13('0x4'));var moment=require('moment');var BPromise=require(_0xdc13('0x5'));var Mustache=require(_0xdc13('0x6'));var util=require(_0xdc13('0x7'));var path=require('path');var sox=require(_0xdc13('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc13('0x9'));var squel=require(_0xdc13('0xa'));var crypto=require(_0xdc13('0xb'));var jsforce=require(_0xdc13('0xc'));var deskjs=require(_0xdc13('0xd'));var toCsv=require(_0xdc13('0xe'));var querystring=require(_0xdc13('0xf'));var Papa=require(_0xdc13('0x10'));var Redis=require(_0xdc13('0x11'));var authService=require(_0xdc13('0x12'));var qs=require(_0xdc13('0x13'));var as=require(_0xdc13('0x14'));var hardwareService=require(_0xdc13('0x15'));var logger=require('../../config/logger')(_0xdc13('0x16'));var utils=require(_0xdc13('0x17'));var config=require(_0xdc13('0x18'));var licenseUtil=require(_0xdc13('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc40c01,_0x4bb030){_0x4bb030=_0x4bb030||0xcc;return function(_0x44e3b2){if(_0x44e3b2){return _0xc40c01[_0xdc13('0x1a')](_0x4bb030);}return _0xc40c01[_0xdc13('0x1b')](_0x4bb030)[_0xdc13('0x1c')]();};}function respondWithResult(_0x384ab4,_0x554da2){_0x554da2=_0x554da2||0xc8;return function(_0x524ed1){if(_0x524ed1){return _0x384ab4[_0xdc13('0x1b')](_0x554da2)['json'](_0x524ed1);}};}function respondWithFilteredResult(_0x207b25,_0x11d95c){return function(_0x133ab6){if(_0x133ab6){var _0x796a23=typeof _0x11d95c['offset']===_0xdc13('0x1d')&&typeof _0x11d95c['limit']==='undefined';var _0x580643=_0x133ab6[_0xdc13('0x1e')];var _0x54c628=_0x796a23?0x0:_0x11d95c['offset'];var _0x55535a=_0x796a23?_0x133ab6['count']:_0x11d95c['offset']+_0x11d95c['limit'];var _0xed943d;if(_0x55535a>=_0x580643){_0x55535a=_0x580643;_0xed943d=0xc8;}else{_0xed943d=0xce;}_0x207b25[_0xdc13('0x1b')](_0xed943d);return _0x207b25['set']('Content-Range',_0x54c628+'-'+_0x55535a+'/'+_0x580643)[_0xdc13('0x1f')](_0x133ab6);}return null;};}function patchUpdates(_0x470cc3){return function(_0x446dd1){try{jsonpatch[_0xdc13('0x20')](_0x446dd1,_0x470cc3,!![]);}catch(_0x50ffed){return BPromise['reject'](_0x50ffed);}return _0x446dd1['save']();};}function saveUpdates(_0x2b9804,_0x164ca4){return function(_0x2b3028){if(_0x2b3028){return _0x2b3028[_0xdc13('0x21')](_0x2b9804)[_0xdc13('0x22')](function(_0x4ee4a1){return _0x4ee4a1;});}return null;};}function removeEntity(_0x501daf,_0x330eea){return function(_0x867fbf){if(_0x867fbf){return _0x867fbf[_0xdc13('0x23')]()['then'](function(){_0x501daf[_0xdc13('0x1b')](0xcc)[_0xdc13('0x1c')]();});}};}function handleEntityNotFound(_0x15d449,_0x267c44){return function(_0x426f01){if(!_0x426f01){_0x15d449[_0xdc13('0x1a')](0x194);}return _0x426f01;};}function handleError(_0x168d4a,_0x3ce010){_0x3ce010=_0x3ce010||0x1f4;return function(_0xa28d76){logger[_0xdc13('0x24')](_0xa28d76[_0xdc13('0x25')]);if(_0xa28d76[_0xdc13('0x26')]){delete _0xa28d76[_0xdc13('0x26')];}_0x168d4a[_0xdc13('0x1b')](_0x3ce010)['send'](_0xa28d76);};}exports[_0xdc13('0x27')]=function(_0x30f707,_0x2f66c8){var _0xcd7436={},_0x4e467b={},_0x34fe04={'count':0x0,'rows':[]};var _0x327929=_['map'](db[_0xdc13('0x28')][_0xdc13('0x29')],function(_0x42006a){return{'name':_0x42006a['fieldName'],'type':_0x42006a[_0xdc13('0x2a')][_0xdc13('0x2b')]};});_0x4e467b[_0xdc13('0x2c')]=_['map'](_0x327929,_0xdc13('0x26'));_0x4e467b[_0xdc13('0x2d')]=_['keys'](_0x30f707['query']);_0x4e467b[_0xdc13('0x2e')]=_['intersection'](_0x4e467b[_0xdc13('0x2c')],_0x4e467b[_0xdc13('0x2d')]);_0xcd7436['attributes']=_[_0xdc13('0x2f')](_0x4e467b[_0xdc13('0x2c')],qs['fields'](_0x30f707[_0xdc13('0x2d')][_0xdc13('0x30')]));_0xcd7436[_0xdc13('0x31')]=_0xcd7436[_0xdc13('0x31')][_0xdc13('0x32')]?_0xcd7436[_0xdc13('0x31')]:_0x4e467b[_0xdc13('0x2c')];if(!_0x30f707[_0xdc13('0x2d')]['hasOwnProperty']('nolimit')){_0xcd7436['limit']=qs[_0xdc13('0x33')](_0x30f707[_0xdc13('0x2d')]['limit']);_0xcd7436['offset']=qs[_0xdc13('0x34')](_0x30f707[_0xdc13('0x2d')][_0xdc13('0x34')]);}_0xcd7436['order']=qs[_0xdc13('0x35')](_0x30f707[_0xdc13('0x2d')][_0xdc13('0x35')]);_0xcd7436[_0xdc13('0x36')]=qs[_0xdc13('0x2e')](_[_0xdc13('0x37')](_0x30f707['query'],_0x4e467b[_0xdc13('0x2e')]),_0x327929);if(_0x30f707[_0xdc13('0x2d')][_0xdc13('0x38')]){_0xcd7436[_0xdc13('0x36')]=_[_0xdc13('0x39')](_0xcd7436[_0xdc13('0x36')],{'$or':_[_0xdc13('0x3a')](_0x327929,function(_0x249ce2){if(_0x249ce2[_0xdc13('0x2a')]!==_0xdc13('0x3b')){var _0x295498={};_0x295498[_0x249ce2[_0xdc13('0x26')]]={'$like':'%'+_0x30f707[_0xdc13('0x2d')][_0xdc13('0x38')]+'%'};return _0x295498;}})});}_0xcd7436=_[_0xdc13('0x39')]({},_0xcd7436,_0x30f707[_0xdc13('0x3c')]);var _0x49096d={'where':_0xcd7436[_0xdc13('0x36')]};return db[_0xdc13('0x28')][_0xdc13('0x1e')](_0x49096d)[_0xdc13('0x22')](function(_0x1e4ea0){_0x34fe04[_0xdc13('0x1e')]=_0x1e4ea0;if(_0x30f707[_0xdc13('0x2d')][_0xdc13('0x3d')]){_0xcd7436['include']=[{'all':!![]}];}return db[_0xdc13('0x28')][_0xdc13('0x3e')](_0xcd7436);})[_0xdc13('0x22')](function(_0x5dfa60){_0x34fe04['rows']=_0x5dfa60;return _0x34fe04;})[_0xdc13('0x22')](respondWithFilteredResult(_0x2f66c8,_0xcd7436))['catch'](handleError(_0x2f66c8,null));};exports['show']=function(_0x41822c,_0x3f0aab){var _0x23bc07={'raw':!![],'where':{'id':_0x41822c[_0xdc13('0x3f')]['id']}},_0x9a77eb={};_0x9a77eb[_0xdc13('0x2c')]=_[_0xdc13('0x40')](db[_0xdc13('0x28')][_0xdc13('0x29')]);_0x9a77eb[_0xdc13('0x2d')]=_[_0xdc13('0x40')](_0x41822c[_0xdc13('0x2d')]);_0x9a77eb['filters']=_['intersection'](_0x9a77eb[_0xdc13('0x2c')],_0x9a77eb['query']);_0x23bc07[_0xdc13('0x31')]=_['intersection'](_0x9a77eb[_0xdc13('0x2c')],qs[_0xdc13('0x30')](_0x41822c['query'][_0xdc13('0x30')]));_0x23bc07[_0xdc13('0x31')]=_0x23bc07[_0xdc13('0x31')][_0xdc13('0x32')]?_0x23bc07[_0xdc13('0x31')]:_0x9a77eb[_0xdc13('0x2c')];if(_0x41822c[_0xdc13('0x2d')]['includeAll']){_0x23bc07['include']=[{'all':!![]}];}_0x23bc07=_['merge']({},_0x23bc07,_0x41822c[_0xdc13('0x3c')]);return db['VtigerField'][_0xdc13('0x41')](_0x23bc07)[_0xdc13('0x22')](handleEntityNotFound(_0x3f0aab,null))[_0xdc13('0x22')](respondWithResult(_0x3f0aab,null))['catch'](handleError(_0x3f0aab,null));};exports[_0xdc13('0x42')]=function(_0x5b24bb,_0x569f23){return db[_0xdc13('0x28')][_0xdc13('0x42')](_0x5b24bb[_0xdc13('0x43')],{})['then'](respondWithResult(_0x569f23,0xc9))['catch'](handleError(_0x569f23,null));};exports[_0xdc13('0x21')]=function(_0x1d353d,_0x2e98c7){if(_0x1d353d[_0xdc13('0x43')]['id']){delete _0x1d353d['body']['id'];}return db[_0xdc13('0x28')][_0xdc13('0x41')]({'where':{'id':_0x1d353d[_0xdc13('0x3f')]['id']}})[_0xdc13('0x22')](handleEntityNotFound(_0x2e98c7,null))[_0xdc13('0x22')](saveUpdates(_0x1d353d['body'],null))[_0xdc13('0x22')](respondWithResult(_0x2e98c7,null))['catch'](handleError(_0x2e98c7,null));};exports[_0xdc13('0x23')]=function(_0xf75cf1,_0x4b10ed){return db[_0xdc13('0x28')][_0xdc13('0x41')]({'where':{'id':_0xf75cf1['params']['id']}})[_0xdc13('0x22')](handleEntityNotFound(_0x4b10ed,null))['then'](removeEntity(_0x4b10ed,null))[_0xdc13('0x44')](handleError(_0x4b10ed,null));}; \ No newline at end of file +var _0xf713=['limit','offset','count','set','Content-Range','reject','save','then','destroy','error','name','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x1457e2,_0x393b2d){var _0x2b4dee=function(_0x205d45){while(--_0x205d45){_0x1457e2['push'](_0x1457e2['shift']());}};_0x2b4dee(++_0x393b2d);}(_0xf713,0x74));var _0x3f71=function(_0x58cb21,_0x4737cc){_0x58cb21=_0x58cb21-0x0;var _0x37e679=_0xf713[_0x58cb21];return _0x37e679;};'use strict';var emlformat=require(_0x3f71('0x0'));var rimraf=require(_0x3f71('0x1'));var zipdir=require(_0x3f71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f71('0x3'));var moment=require(_0x3f71('0x4'));var BPromise=require(_0x3f71('0x5'));var Mustache=require(_0x3f71('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3f71('0x7'));var csv=require(_0x3f71('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f71('0x9'));var squel=require('squel');var crypto=require(_0x3f71('0xa'));var jsforce=require(_0x3f71('0xb'));var deskjs=require(_0x3f71('0xc'));var toCsv=require(_0x3f71('0x8'));var querystring=require('querystring');var Papa=require(_0x3f71('0xd'));var Redis=require(_0x3f71('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3f71('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f71('0x10'));var logger=require(_0x3f71('0x11'))(_0x3f71('0x12'));var utils=require(_0x3f71('0x13'));var config=require(_0x3f71('0x14'));var licenseUtil=require(_0x3f71('0x15'));var db=require(_0x3f71('0x16'))['db'];function respondWithStatusCode(_0x8c393c,_0x573434){_0x573434=_0x573434||0xcc;return function(_0x32e3e2){if(_0x32e3e2){return _0x8c393c[_0x3f71('0x17')](_0x573434);}return _0x8c393c[_0x3f71('0x18')](_0x573434)[_0x3f71('0x19')]();};}function respondWithResult(_0x4c6fd0,_0x386f8f){_0x386f8f=_0x386f8f||0xc8;return function(_0x205c0f){if(_0x205c0f){return _0x4c6fd0[_0x3f71('0x18')](_0x386f8f)[_0x3f71('0x1a')](_0x205c0f);}};}function respondWithFilteredResult(_0x5df79d,_0x3c1e0e){return function(_0x355522){if(_0x355522){var _0xa40be5=typeof _0x3c1e0e['offset']===_0x3f71('0x1b')&&typeof _0x3c1e0e[_0x3f71('0x1c')]==='undefined';var _0x511e84=_0x355522['count'];var _0x2dd596=_0xa40be5?0x0:_0x3c1e0e[_0x3f71('0x1d')];var _0x2dcbf9=_0xa40be5?_0x355522[_0x3f71('0x1e')]:_0x3c1e0e[_0x3f71('0x1d')]+_0x3c1e0e[_0x3f71('0x1c')];var _0x66c9d;if(_0x2dcbf9>=_0x511e84){_0x2dcbf9=_0x511e84;_0x66c9d=0xc8;}else{_0x66c9d=0xce;}_0x5df79d[_0x3f71('0x18')](_0x66c9d);return _0x5df79d[_0x3f71('0x1f')](_0x3f71('0x20'),_0x2dd596+'-'+_0x2dcbf9+'/'+_0x511e84)[_0x3f71('0x1a')](_0x355522);}return null;};}function patchUpdates(_0x235e2e){return function(_0x1296ca){try{jsonpatch['apply'](_0x1296ca,_0x235e2e,!![]);}catch(_0x5b0e14){return BPromise[_0x3f71('0x21')](_0x5b0e14);}return _0x1296ca[_0x3f71('0x22')]();};}function saveUpdates(_0x1c71ba,_0x2c11e7){return function(_0x161d2a){if(_0x161d2a){return _0x161d2a['update'](_0x1c71ba)[_0x3f71('0x23')](function(_0x249241){return _0x249241;});}return null;};}function removeEntity(_0x55eb18,_0x4841ad){return function(_0x10106d){if(_0x10106d){return _0x10106d[_0x3f71('0x24')]()[_0x3f71('0x23')](function(){_0x55eb18[_0x3f71('0x18')](0xcc)[_0x3f71('0x19')]();});}};}function handleEntityNotFound(_0x47ab66,_0xb7e044){return function(_0x18b6dc){if(!_0x18b6dc){_0x47ab66[_0x3f71('0x17')](0x194);}return _0x18b6dc;};}function handleError(_0x8bba2,_0x3a01c3){_0x3a01c3=_0x3a01c3||0x1f4;return function(_0x4ff20d){logger[_0x3f71('0x25')](_0x4ff20d['stack']);if(_0x4ff20d[_0x3f71('0x26')]){delete _0x4ff20d['name'];}_0x8bba2['status'](_0x3a01c3)['send'](_0x4ff20d);};}exports[_0x3f71('0x27')]=function(_0x1862a1,_0x19e475){var _0x40a753={},_0x38bc40={},_0xe5bb1b={'count':0x0,'rows':[]};var _0x22b3dc=_[_0x3f71('0x28')](db[_0x3f71('0x29')]['rawAttributes'],function(_0x223fb8){return{'name':_0x223fb8[_0x3f71('0x2a')],'type':_0x223fb8[_0x3f71('0x2b')][_0x3f71('0x2c')]};});_0x38bc40[_0x3f71('0x2d')]=_[_0x3f71('0x28')](_0x22b3dc,_0x3f71('0x26'));_0x38bc40[_0x3f71('0x2e')]=_[_0x3f71('0x2f')](_0x1862a1[_0x3f71('0x2e')]);_0x38bc40[_0x3f71('0x30')]=_[_0x3f71('0x31')](_0x38bc40[_0x3f71('0x2d')],_0x38bc40[_0x3f71('0x2e')]);_0x40a753['attributes']=_[_0x3f71('0x31')](_0x38bc40['model'],qs[_0x3f71('0x32')](_0x1862a1['query'][_0x3f71('0x32')]));_0x40a753[_0x3f71('0x33')]=_0x40a753[_0x3f71('0x33')]['length']?_0x40a753['attributes']:_0x38bc40['model'];if(!_0x1862a1[_0x3f71('0x2e')][_0x3f71('0x34')](_0x3f71('0x35'))){_0x40a753['limit']=qs['limit'](_0x1862a1[_0x3f71('0x2e')]['limit']);_0x40a753[_0x3f71('0x1d')]=qs[_0x3f71('0x1d')](_0x1862a1['query'][_0x3f71('0x1d')]);}_0x40a753['order']=qs[_0x3f71('0x36')](_0x1862a1[_0x3f71('0x2e')]['sort']);_0x40a753['where']=qs[_0x3f71('0x30')](_[_0x3f71('0x37')](_0x1862a1['query'],_0x38bc40[_0x3f71('0x30')]),_0x22b3dc);if(_0x1862a1[_0x3f71('0x2e')]['filter']){_0x40a753[_0x3f71('0x38')]=_[_0x3f71('0x39')](_0x40a753[_0x3f71('0x38')],{'$or':_[_0x3f71('0x28')](_0x22b3dc,function(_0x3b2b05){if(_0x3b2b05[_0x3f71('0x2b')]!=='VIRTUAL'){var _0x1813d4={};_0x1813d4[_0x3b2b05[_0x3f71('0x26')]]={'$like':'%'+_0x1862a1[_0x3f71('0x2e')]['filter']+'%'};return _0x1813d4;}})});}_0x40a753=_[_0x3f71('0x39')]({},_0x40a753,_0x1862a1[_0x3f71('0x3a')]);var _0xf39aeb={'where':_0x40a753[_0x3f71('0x38')]};return db['VtigerField'][_0x3f71('0x1e')](_0xf39aeb)[_0x3f71('0x23')](function(_0x583663){_0xe5bb1b[_0x3f71('0x1e')]=_0x583663;if(_0x1862a1[_0x3f71('0x2e')][_0x3f71('0x3b')]){_0x40a753[_0x3f71('0x3c')]=[{'all':!![]}];}return db[_0x3f71('0x29')][_0x3f71('0x3d')](_0x40a753);})[_0x3f71('0x23')](function(_0x594f4d){_0xe5bb1b[_0x3f71('0x3e')]=_0x594f4d;return _0xe5bb1b;})[_0x3f71('0x23')](respondWithFilteredResult(_0x19e475,_0x40a753))[_0x3f71('0x3f')](handleError(_0x19e475,null));};exports[_0x3f71('0x40')]=function(_0x2591fa,_0x3859fb){var _0x1b6c79={'raw':!![],'where':{'id':_0x2591fa[_0x3f71('0x41')]['id']}},_0x3aba65={};_0x3aba65['model']=_[_0x3f71('0x2f')](db['VtigerField'][_0x3f71('0x42')]);_0x3aba65[_0x3f71('0x2e')]=_[_0x3f71('0x2f')](_0x2591fa[_0x3f71('0x2e')]);_0x3aba65['filters']=_[_0x3f71('0x31')](_0x3aba65['model'],_0x3aba65[_0x3f71('0x2e')]);_0x1b6c79[_0x3f71('0x33')]=_[_0x3f71('0x31')](_0x3aba65[_0x3f71('0x2d')],qs['fields'](_0x2591fa[_0x3f71('0x2e')][_0x3f71('0x32')]));_0x1b6c79[_0x3f71('0x33')]=_0x1b6c79[_0x3f71('0x33')][_0x3f71('0x43')]?_0x1b6c79[_0x3f71('0x33')]:_0x3aba65['model'];if(_0x2591fa['query'][_0x3f71('0x3b')]){_0x1b6c79[_0x3f71('0x3c')]=[{'all':!![]}];}_0x1b6c79=_[_0x3f71('0x39')]({},_0x1b6c79,_0x2591fa[_0x3f71('0x3a')]);return db[_0x3f71('0x29')][_0x3f71('0x44')](_0x1b6c79)['then'](handleEntityNotFound(_0x3859fb,null))[_0x3f71('0x23')](respondWithResult(_0x3859fb,null))[_0x3f71('0x3f')](handleError(_0x3859fb,null));};exports[_0x3f71('0x45')]=function(_0x4f6298,_0x23c442){return db[_0x3f71('0x29')][_0x3f71('0x45')](_0x4f6298[_0x3f71('0x46')],{})[_0x3f71('0x23')](respondWithResult(_0x23c442,0xc9))[_0x3f71('0x3f')](handleError(_0x23c442,null));};exports[_0x3f71('0x47')]=function(_0x4dbff6,_0x232f85){if(_0x4dbff6[_0x3f71('0x46')]['id']){delete _0x4dbff6[_0x3f71('0x46')]['id'];}return db['VtigerField'][_0x3f71('0x44')]({'where':{'id':_0x4dbff6['params']['id']}})[_0x3f71('0x23')](handleEntityNotFound(_0x232f85,null))[_0x3f71('0x23')](saveUpdates(_0x4dbff6[_0x3f71('0x46')],null))[_0x3f71('0x23')](respondWithResult(_0x232f85,null))[_0x3f71('0x3f')](handleError(_0x232f85,null));};exports[_0x3f71('0x24')]=function(_0x1b8117,_0x320af2){return db[_0x3f71('0x29')][_0x3f71('0x44')]({'where':{'id':_0x1b8117[_0x3f71('0x41')]['id']}})[_0x3f71('0x23')](handleEntityNotFound(_0x320af2,null))[_0x3f71('0x23')](removeEntity(_0x320af2,null))[_0x3f71('0x3f')](handleError(_0x320af2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 172d526..696c9de 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 _0x2423=['int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','VtigerField'];(function(_0x35f3c3,_0x520c73){var _0x1781e7=function(_0x2dce24){while(--_0x2dce24){_0x35f3c3['push'](_0x35f3c3['shift']());}};_0x1781e7(++_0x520c73);}(_0x2423,0x1b7));var _0x3242=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2423[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3242('0x0'));var util=require(_0x3242('0x1'));var logger=require(_0x3242('0x2'))(_0x3242('0x3'));var moment=require(_0x3242('0x4'));var BPromise=require(_0x3242('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3242('0x6'));var rimraf=require('rimraf');var config=require(_0x3242('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x3242('0x8')]=function(_0x3826af,_0x314979){return _0x3826af[_0x3242('0x9')](_0x3242('0xa'),attributes,{'tableName':_0x3242('0xb'),'paranoid':![],'indexes':[{'name':_0x3242('0xc'),'fields':[_0x3242('0xd'),_0x3242('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3866=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3866,0x16b));var _0x6386=function(_0x396308,_0x197a90){_0x396308=_0x396308-0x0;var _0x40a50b=_0x3866[_0x396308];return _0x40a50b;};'use strict';var _=require(_0x6386('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6386('0x1'));var moment=require(_0x6386('0x2'));var BPromise=require(_0x6386('0x3'));var rp=require(_0x6386('0x4'));var fs=require('fs');var path=require(_0x6386('0x5'));var rimraf=require(_0x6386('0x6'));var config=require(_0x6386('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x57282c,_0x55c4d9){return _0x57282c[_0x6386('0x8')](_0x6386('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x6386('0xa'),'fields':[_0x6386('0xb'),_0x6386('0xc')],'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 b1387c1..307de9e 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 _0x0592=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x31e810,_0x18f146){var _0x4e0760=function(_0x481724){while(--_0x481724){_0x31e810['push'](_0x31e810['shift']());}};_0x4e0760(++_0x18f146);}(_0x0592,0x18e));var _0x2059=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0592[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2059('0x0'));var util=require(_0x2059('0x1'));var moment=require(_0x2059('0x2'));var BPromise=require(_0x2059('0x3'));var rs=require(_0x2059('0x4'));var fs=require('fs');var Redis=require(_0x2059('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2059('0x6'));var logger=require('../../config/logger')(_0x2059('0x7'));var config=require(_0x2059('0x8'));var jayson=require(_0x2059('0x9'));var client=jayson[_0x2059('0xa')][_0x2059('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x71adbb,_0x2653a4,_0x58530f){return new BPromise(function(_0x5cf05b,_0x575ce1){return client[_0x2059('0xc')](_0x71adbb,_0x58530f)[_0x2059('0xd')](function(_0x27d51e){logger[_0x2059('0xe')](_0x2059('0xf'),_0x2653a4,_0x2059('0x10'));logger['debug'](_0x2059('0x11'),_0x2653a4,_0x2059('0x10'),JSON[_0x2059('0x12')](_0x27d51e));if(_0x27d51e[_0x2059('0x13')]){if(_0x27d51e[_0x2059('0x13')][_0x2059('0x14')]===0x1f4){logger[_0x2059('0x13')]('VtigerField,\x20%s,\x20%s',_0x2653a4,_0x27d51e['error'][_0x2059('0x15')]);return _0x575ce1(_0x27d51e[_0x2059('0x13')][_0x2059('0x15')]);}logger[_0x2059('0x13')](_0x2059('0xf'),_0x2653a4,_0x27d51e['error'][_0x2059('0x15')]);return _0x5cf05b(_0x27d51e[_0x2059('0x13')][_0x2059('0x15')]);}else{logger[_0x2059('0xe')](_0x2059('0xf'),_0x2653a4,_0x2059('0x10'));_0x5cf05b(_0x27d51e[_0x2059('0x16')][_0x2059('0x15')]);}})[_0x2059('0x17')](function(_0x525353){logger['error'](_0x2059('0xf'),_0x2653a4,_0x525353);_0x575ce1(_0x525353);});});} \ No newline at end of file +var _0xf931=['info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x599375,_0xfd0e5b){var _0x17335c=function(_0x1b902a){while(--_0x1b902a){_0x599375['push'](_0x599375['shift']());}};_0x17335c(++_0xfd0e5b);}(_0xf931,0xc5));var _0x1f93=function(_0x3f450e,_0xac734f){_0x3f450e=_0x3f450e-0x0;var _0x2aac28=_0xf931[_0x3f450e];return _0x2aac28;};'use strict';var _=require('lodash');var util=require(_0x1f93('0x0'));var moment=require(_0x1f93('0x1'));var BPromise=require(_0x1f93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f93('0x3'));var db=require(_0x1f93('0x4'))['db'];var utils=require(_0x1f93('0x5'));var logger=require(_0x1f93('0x6'))(_0x1f93('0x7'));var config=require(_0x1f93('0x8'));var jayson=require(_0x1f93('0x9'));var client=jayson[_0x1f93('0xa')][_0x1f93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33f540,_0x477b44,_0x59587d){return new BPromise(function(_0x312f92,_0x1b218c){return client[_0x1f93('0xc')](_0x33f540,_0x59587d)['then'](function(_0x4f17dc){logger[_0x1f93('0xd')](_0x1f93('0xe'),_0x477b44,_0x1f93('0xf'));logger['debug'](_0x1f93('0x10'),_0x477b44,_0x1f93('0xf'),JSON['stringify'](_0x4f17dc));if(_0x4f17dc['error']){if(_0x4f17dc[_0x1f93('0x11')][_0x1f93('0x12')]===0x1f4){logger['error'](_0x1f93('0xe'),_0x477b44,_0x4f17dc[_0x1f93('0x11')][_0x1f93('0x13')]);return _0x1b218c(_0x4f17dc[_0x1f93('0x11')][_0x1f93('0x13')]);}logger[_0x1f93('0x11')]('VtigerField,\x20%s,\x20%s',_0x477b44,_0x4f17dc[_0x1f93('0x11')]['message']);return _0x312f92(_0x4f17dc[_0x1f93('0x11')][_0x1f93('0x13')]);}else{logger[_0x1f93('0xd')](_0x1f93('0xe'),_0x477b44,'request\x20sent');_0x312f92(_0x4f17dc['result'][_0x1f93('0x13')]);}})[_0x1f93('0x14')](function(_0x12f17e){logger[_0x1f93('0x11')]('VtigerField,\x20%s,\x20%s',_0x477b44,_0x12f17e);_0x1b218c(_0x12f17e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 1ae5544..dde5768 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 _0x6500=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','post','create','/:id/configurations','addConfiguration','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x419549,_0x455526){var _0x1eb427=function(_0x40cf2f){while(--_0x40cf2f){_0x419549['push'](_0x419549['shift']());}};_0x1eb427(++_0x455526);}(_0x6500,0x13b));var _0x0650=function(_0x34cad9,_0xe4d7c5){_0x34cad9=_0x34cad9-0x0;var _0x421786=_0x6500[_0x34cad9];return _0x421786;};'use strict';var multer=require('multer');var util=require(_0x0650('0x0'));var path=require(_0x0650('0x1'));var timeout=require(_0x0650('0x2'));var express=require('express');var router=express[_0x0650('0x3')]();var fs_extra=require(_0x0650('0x4'));var auth=require(_0x0650('0x5'));var interaction=require(_0x0650('0x6'));var config=require(_0x0650('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x0650('0x8')]('/',auth[_0x0650('0x9')](),controller['index']);router[_0x0650('0x8')](_0x0650('0xa'),auth[_0x0650('0x9')](),controller[_0x0650('0xb')]);router[_0x0650('0x8')]('/:id/configurations',auth[_0x0650('0x9')](),controller['getConfigurations']);router[_0x0650('0x8')](_0x0650('0xc'),auth[_0x0650('0x9')](),controller['getFields']);router[_0x0650('0xd')]('/',auth[_0x0650('0x9')](),controller[_0x0650('0xe')]);router[_0x0650('0xd')](_0x0650('0xf'),auth['isAuthenticated'](),controller[_0x0650('0x10')]);router['put'](_0x0650('0xa'),auth[_0x0650('0x9')](),controller['update']);router[_0x0650('0x11')]('/:id',auth[_0x0650('0x9')](),controller[_0x0650('0x12')]);module[_0x0650('0x13')]=router; \ No newline at end of file +var _0x7b0d=['util','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer'];(function(_0x297cd1,_0x16c8d1){var _0x274c10=function(_0x2327c9){while(--_0x2327c9){_0x297cd1['push'](_0x297cd1['shift']());}};_0x274c10(++_0x16c8d1);}(_0x7b0d,0x72));var _0xd7b0=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7b0d[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0xd7b0('0x0'));var util=require(_0xd7b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd7b0('0x2'));var router=express['Router']();var fs_extra=require(_0xd7b0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd7b0('0x4'));var config=require(_0xd7b0('0x5'));var controller=require(_0xd7b0('0x6'));router[_0xd7b0('0x7')]('/',auth[_0xd7b0('0x8')](),controller[_0xd7b0('0x9')]);router[_0xd7b0('0x7')](_0xd7b0('0xa'),auth['isAuthenticated'](),controller[_0xd7b0('0xb')]);router[_0xd7b0('0x7')](_0xd7b0('0xc'),auth[_0xd7b0('0x8')](),controller[_0xd7b0('0xd')]);router[_0xd7b0('0x7')](_0xd7b0('0xe'),auth[_0xd7b0('0x8')](),controller[_0xd7b0('0xf')]);router[_0xd7b0('0x10')]('/',auth[_0xd7b0('0x8')](),controller[_0xd7b0('0x11')]);router[_0xd7b0('0x10')](_0xd7b0('0xc'),auth[_0xd7b0('0x8')](),controller['addConfiguration']);router[_0xd7b0('0x12')]('/:id',auth[_0xd7b0('0x8')](),controller[_0xd7b0('0x13')]);router[_0xd7b0('0x14')](_0xd7b0('0xa'),auth[_0xd7b0('0x8')](),controller[_0xd7b0('0x15')]);module[_0xd7b0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 827794b..dd53551 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 _0xdb8b=['ENUM','password','integrationTab','newTab','exports','STRING','remoteUri'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0x5bd54e,_0x46621f){_0x5bd54e=_0x5bd54e-0x0;var _0x276fa7=_0xdb8b[_0x5bd54e];return _0x276fa7;};'use strict';var Sequelize=require('sequelize');module[_0xbdb8('0x0')]={'name':{'type':Sequelize[_0xbdb8('0x1')]},'description':{'type':Sequelize[_0xbdb8('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xbdb8('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbdb8('0x1')],'unique':_0xbdb8('0x2')},'authType':{'type':Sequelize[_0xbdb8('0x3')](_0xbdb8('0x4'),'token'),'defaultValue':_0xbdb8('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbdb8('0x3')](_0xbdb8('0x5'),_0xbdb8('0x6')),'defaultValue':_0xbdb8('0x5')}}; \ No newline at end of file +var _0x2eba=['password','token','integrationTab','exports','STRING','remoteUri','ENUM'];(function(_0x3445a2,_0x4f3fe6){var _0x5751c9=function(_0x53b4ce){while(--_0x53b4ce){_0x3445a2['push'](_0x3445a2['shift']());}};_0x5751c9(++_0x4f3fe6);}(_0x2eba,0xc7));var _0xa2eb=function(_0x28f62f,_0x124cd8){_0x28f62f=_0x28f62f-0x0;var _0x297207=_0x2eba[_0x28f62f];return _0x297207;};'use strict';var Sequelize=require('sequelize');module[_0xa2eb('0x0')]={'name':{'type':Sequelize[_0xa2eb('0x1')]},'description':{'type':Sequelize[_0xa2eb('0x1')]},'username':{'type':Sequelize[_0xa2eb('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa2eb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa2eb('0x2')},'authType':{'type':Sequelize[_0xa2eb('0x3')](_0xa2eb('0x4'),_0xa2eb('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa2eb('0x6'),'newTab'),'defaultValue':_0xa2eb('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 400c69b..58e43cd 100644 --- a/server/api/intZendeskAccount/intZendeskAccount.controller.js +++ b/server/api/intZendeskAccount/intZendeskAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3266=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','count','includeAll','include','findAll','rows','catch','merge','options','create','body','find','params','destroy','findOne','ZendeskConfiguration','order','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','username','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','password','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','system_field_options','custom_field_options','test','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash'];(function(_0x3cff39,_0xc4335){var _0x3507f3=function(_0xcf58fd){while(--_0xcf58fd){_0x3cff39['push'](_0x3cff39['shift']());}};_0x3507f3(++_0xc4335);}(_0x3266,0x6a));var _0x6326=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x3266[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];var integrations=require(_0x6326('0x1c'));function respondWithStatusCode(_0x5c07e1,_0x5381d0){_0x5381d0=_0x5381d0||0xcc;return function(_0x301f34){if(_0x301f34){return _0x5c07e1[_0x6326('0x1d')](_0x5381d0);}return _0x5c07e1['status'](_0x5381d0)[_0x6326('0x1e')]();};}function respondWithResult(_0x4caef3,_0x2d2d9b){_0x2d2d9b=_0x2d2d9b||0xc8;return function(_0x20dcc6){if(_0x20dcc6){return _0x4caef3[_0x6326('0x1f')](_0x2d2d9b)[_0x6326('0x20')](_0x20dcc6);}};}function respondWithFilteredResult(_0x1ed3a3,_0x2c1879){return function(_0x55923a){if(_0x55923a){var _0x1104c5=typeof _0x2c1879['offset']==='undefined'&&typeof _0x2c1879['limit']==='undefined';var _0x5d402d=_0x55923a['count'];var _0xdf5ced=_0x1104c5?0x0:_0x2c1879[_0x6326('0x21')];var _0x2be78e=_0x1104c5?_0x55923a['count']:_0x2c1879['offset']+_0x2c1879[_0x6326('0x22')];var _0x42319c;if(_0x2be78e>=_0x5d402d){_0x2be78e=_0x5d402d;_0x42319c=0xc8;}else{_0x42319c=0xce;}_0x1ed3a3[_0x6326('0x1f')](_0x42319c);return _0x1ed3a3[_0x6326('0x23')](_0x6326('0x24'),_0xdf5ced+'-'+_0x2be78e+'/'+_0x5d402d)[_0x6326('0x20')](_0x55923a);}return null;};}function patchUpdates(_0x21ee7d){return function(_0x53b437){try{jsonpatch[_0x6326('0x25')](_0x53b437,_0x21ee7d,!![]);}catch(_0x549f07){return BPromise[_0x6326('0x26')](_0x549f07);}return _0x53b437[_0x6326('0x27')]();};}function saveUpdates(_0x2482ef,_0x24fb78){return function(_0x43cdfc){if(_0x43cdfc){return _0x43cdfc[_0x6326('0x28')](_0x2482ef)[_0x6326('0x29')](function(_0x429bb0){return _0x429bb0;});}return null;};}function removeEntity(_0x4781cc,_0x2d0d00){return function(_0x34954b){if(_0x34954b){return _0x34954b['destroy']()[_0x6326('0x29')](function(){_0x4781cc[_0x6326('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e272b,_0x4d28fd){return function(_0x405474){if(!_0x405474){_0x4e272b['sendStatus'](0x194);}return _0x405474;};}function handleError(_0x33c466,_0x1a48da){_0x1a48da=_0x1a48da||0x1f4;return function(_0x5a907f){logger[_0x6326('0x2a')](_0x5a907f[_0x6326('0x2b')]);if(_0x5a907f[_0x6326('0x2c')]){delete _0x5a907f[_0x6326('0x2c')];}_0x33c466[_0x6326('0x1f')](_0x1a48da)[_0x6326('0x2d')](_0x5a907f);};}exports[_0x6326('0x2e')]=function(_0x27802c,_0x461e0f){var _0x127744={},_0x4980f6={},_0x2a8873={'count':0x0,'rows':[]};var _0x331772=_[_0x6326('0x2f')](db[_0x6326('0x30')][_0x6326('0x31')],function(_0x520e57){return{'name':_0x520e57[_0x6326('0x32')],'type':_0x520e57[_0x6326('0x33')][_0x6326('0x34')]};});_0x4980f6['model']=_[_0x6326('0x2f')](_0x331772,'name');_0x4980f6['query']=_[_0x6326('0x35')](_0x27802c[_0x6326('0x36')]);_0x4980f6[_0x6326('0x37')]=_[_0x6326('0x38')](_0x4980f6[_0x6326('0x39')],_0x4980f6[_0x6326('0x36')]);_0x127744[_0x6326('0x3a')]=_[_0x6326('0x38')](_0x4980f6[_0x6326('0x39')],qs[_0x6326('0x3b')](_0x27802c[_0x6326('0x36')][_0x6326('0x3b')]));_0x127744['attributes']=_0x127744[_0x6326('0x3a')][_0x6326('0x3c')]?_0x127744['attributes']:_0x4980f6[_0x6326('0x39')];if(!_0x27802c[_0x6326('0x36')][_0x6326('0x3d')]('nolimit')){_0x127744[_0x6326('0x22')]=qs['limit'](_0x27802c['query'][_0x6326('0x22')]);_0x127744[_0x6326('0x21')]=qs[_0x6326('0x21')](_0x27802c['query'][_0x6326('0x21')]);}_0x127744['order']=qs[_0x6326('0x3e')](_0x27802c['query'][_0x6326('0x3e')]);_0x127744[_0x6326('0x3f')]=qs[_0x6326('0x37')](_[_0x6326('0x40')](_0x27802c[_0x6326('0x36')],_0x4980f6[_0x6326('0x37')]),_0x331772);if(_0x27802c['query'][_0x6326('0x41')]){_0x127744[_0x6326('0x3f')]=_['merge'](_0x127744[_0x6326('0x3f')],{'$or':_['map'](_0x331772,function(_0x5607ea){if(_0x5607ea[_0x6326('0x33')]!==_0x6326('0x42')){var _0x3c170b={};_0x3c170b[_0x5607ea[_0x6326('0x2c')]]={'$like':'%'+_0x27802c[_0x6326('0x36')][_0x6326('0x41')]+'%'};return _0x3c170b;}})});}_0x127744=_['merge']({},_0x127744,_0x27802c['options']);var _0x32886f={'where':_0x127744['where']};return db[_0x6326('0x30')]['count'](_0x32886f)[_0x6326('0x29')](function(_0x517f6b){_0x2a8873[_0x6326('0x43')]=_0x517f6b;if(_0x27802c[_0x6326('0x36')][_0x6326('0x44')]){_0x127744[_0x6326('0x45')]=[{'all':!![]}];}return db[_0x6326('0x30')][_0x6326('0x46')](_0x127744);})[_0x6326('0x29')](function(_0x3998ba){_0x2a8873[_0x6326('0x47')]=_0x3998ba;return _0x2a8873;})['then'](respondWithFilteredResult(_0x461e0f,_0x127744))[_0x6326('0x48')](handleError(_0x461e0f,null));};exports['show']=function(_0x29f2fd,_0x1d9d4c){var _0x16fc33={'raw':![],'where':{'id':_0x29f2fd['params']['id']}},_0x50582a={};_0x50582a[_0x6326('0x39')]=_[_0x6326('0x35')](db['ZendeskAccount'][_0x6326('0x31')]);_0x50582a[_0x6326('0x36')]=_[_0x6326('0x35')](_0x29f2fd[_0x6326('0x36')]);_0x50582a['filters']=_[_0x6326('0x38')](_0x50582a[_0x6326('0x39')],_0x50582a[_0x6326('0x36')]);_0x16fc33[_0x6326('0x3a')]=_[_0x6326('0x38')](_0x50582a[_0x6326('0x39')],qs[_0x6326('0x3b')](_0x29f2fd['query'][_0x6326('0x3b')]));_0x16fc33[_0x6326('0x3a')]=_0x16fc33[_0x6326('0x3a')][_0x6326('0x3c')]?_0x16fc33['attributes']:_0x50582a[_0x6326('0x39')];if(_0x29f2fd['query'][_0x6326('0x44')]){_0x16fc33[_0x6326('0x45')]=[{'all':!![]}];}_0x16fc33=_[_0x6326('0x49')]({},_0x16fc33,_0x29f2fd[_0x6326('0x4a')]);return db[_0x6326('0x30')]['find'](_0x16fc33)[_0x6326('0x29')](handleEntityNotFound(_0x1d9d4c,null))['then'](respondWithResult(_0x1d9d4c,null))['catch'](handleError(_0x1d9d4c,null));};exports[_0x6326('0x4b')]=function(_0x44cf9d,_0x5b14f4){return db[_0x6326('0x30')][_0x6326('0x4b')](_0x44cf9d[_0x6326('0x4c')],{})[_0x6326('0x29')](respondWithResult(_0x5b14f4,0xc9))[_0x6326('0x48')](handleError(_0x5b14f4,null));};exports['update']=function(_0x4af0ee,_0x2d82c0){if(_0x4af0ee[_0x6326('0x4c')]['id']){delete _0x4af0ee[_0x6326('0x4c')]['id'];}return db[_0x6326('0x30')][_0x6326('0x4d')]({'where':{'id':_0x4af0ee[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x2d82c0,null))['then'](saveUpdates(_0x4af0ee[_0x6326('0x4c')],null))[_0x6326('0x29')](respondWithResult(_0x2d82c0,null))[_0x6326('0x48')](handleError(_0x2d82c0,null));};exports[_0x6326('0x4f')]=function(_0x1b5e9a,_0x4ff8e6){return db[_0x6326('0x30')]['find']({'where':{'id':_0x1b5e9a[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x4ff8e6,null))['then'](removeEntity(_0x4ff8e6,null))[_0x6326('0x48')](handleError(_0x4ff8e6,null));};exports['getConfigurations']=function(_0xaa4c9d,_0x202fd3,_0x2ee8df){var _0x35400e={};var _0x58731d={};var _0x42c8bc;var _0xbe6b3e;return db['ZendeskAccount'][_0x6326('0x50')]({'where':{'id':_0xaa4c9d[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x202fd3,null))['then'](function(_0x2bece1){if(_0x2bece1){_0x42c8bc=_0x2bece1;_0x58731d[_0x6326('0x39')]=_['keys'](db[_0x6326('0x51')]['rawAttributes']);_0x58731d[_0x6326('0x36')]=_[_0x6326('0x35')](_0xaa4c9d[_0x6326('0x36')]);_0x58731d[_0x6326('0x37')]=_[_0x6326('0x38')](_0x58731d[_0x6326('0x39')],_0x58731d[_0x6326('0x36')]);_0x35400e['attributes']=_['intersection'](_0x58731d['model'],qs[_0x6326('0x3b')](_0xaa4c9d['query'][_0x6326('0x3b')]));_0x35400e[_0x6326('0x3a')]=_0x35400e[_0x6326('0x3a')][_0x6326('0x3c')]?_0x35400e[_0x6326('0x3a')]:_0x58731d['model'];_0x35400e[_0x6326('0x52')]=qs[_0x6326('0x3e')](_0xaa4c9d['query'][_0x6326('0x3e')]);_0x35400e[_0x6326('0x3f')]=qs[_0x6326('0x37')](_[_0x6326('0x40')](_0xaa4c9d[_0x6326('0x36')],_0x58731d[_0x6326('0x37')]));if(_0xaa4c9d[_0x6326('0x36')][_0x6326('0x41')]){_0x35400e[_0x6326('0x3f')]=_[_0x6326('0x49')](_0x35400e['where'],{'$or':_[_0x6326('0x2f')](_0x35400e[_0x6326('0x3a')],function(_0x3fc712){var _0x92f535={};_0x92f535[_0x3fc712]={'$like':'%'+_0xaa4c9d['query']['filter']+'%'};return _0x92f535;})});}_0x35400e=_[_0x6326('0x49')]({},_0x35400e,_0xaa4c9d[_0x6326('0x4a')]);return _0x42c8bc[_0x6326('0x53')](_0x35400e);}})[_0x6326('0x29')](function(_0x3ac39d){if(_0x3ac39d){_0xbe6b3e=_0x3ac39d['length'];if(!_0xaa4c9d['query'][_0x6326('0x3d')](_0x6326('0x54'))){_0x35400e[_0x6326('0x22')]=qs[_0x6326('0x22')](_0xaa4c9d['query'][_0x6326('0x22')]);_0x35400e[_0x6326('0x21')]=qs[_0x6326('0x21')](_0xaa4c9d[_0x6326('0x36')][_0x6326('0x21')]);}return _0x42c8bc[_0x6326('0x53')](_0x35400e);}})['then'](function(_0x2bc08a){if(_0x2bc08a){return _0x2bc08a?{'count':_0xbe6b3e,'rows':_0x2bc08a}:null;}})['then'](respondWithResult(_0x202fd3,null))[_0x6326('0x48')](handleError(_0x202fd3,null));};exports[_0x6326('0x55')]=function(_0x57dfde,_0x14d66c,_0x56fb58){if(_0x57dfde[_0x6326('0x4c')]['id']){delete _0x57dfde[_0x6326('0x4c')]['id'];}return db[_0x6326('0x30')][_0x6326('0x50')]({'where':{'id':_0x57dfde[_0x6326('0x4e')]['id']}})[_0x6326('0x29')](handleEntityNotFound(_0x14d66c,null))[_0x6326('0x29')](function(_0x3f5e2e){if(_0x3f5e2e){_0x57dfde['body'][_0x6326('0x56')]=_0x3f5e2e['id'];_0x57dfde[_0x6326('0x4c')][_0x6326('0x57')]=integrations[_0x6326('0x58')](_0x57dfde[_0x6326('0x4c')]['channel'],_0x57dfde[_0x6326('0x4c')][_0x6326('0x33')]);_0x57dfde[_0x6326('0x4c')][_0x6326('0x59')]=integrations[_0x6326('0x5a')](_0x57dfde['body'][_0x6326('0x5b')],_0x57dfde['body']['type']);return db[_0x6326('0x51')][_0x6326('0x4b')](_0x57dfde[_0x6326('0x4c')],{'include':[{'model':db[_0x6326('0x5c')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14d66c,null))[_0x6326('0x48')](handleError(_0x14d66c,null));};exports['getFields']=function(_0x303fef,_0x5f6273,_0x54730e){var _0x4c1d7e='';return db['ZendeskAccount'][_0x6326('0x50')]({'where':{'id':_0x303fef['params']['id']},'attributes':['id',_0x6326('0x5d'),'password','token','authType','remoteUri']})[_0x6326('0x29')](handleEntityNotFound(_0x5f6273,null))['then'](function(_0xe2e249){if(_0xe2e249){_0x4c1d7e=_0xe2e249[_0x6326('0x5e')];var _0x50a1dc=_0x4c1d7e[_0x6326('0x5f')](-0x1);if(_0x50a1dc==='/'){_0x4c1d7e=_0x4c1d7e['substring'](0x0,_0x4c1d7e[_0x6326('0x60')](_0x50a1dc));}var _0x1dda23={'method':_0x6326('0x61'),'uri':util[_0x6326('0x62')](_0x6326('0x63'),_0x4c1d7e,_0x6326('0x64')),'json':!![]};switch(_0xe2e249[_0x6326('0x65')]){case _0x6326('0x66'):_0x1dda23[_0x6326('0x67')]={'Authorization':util[_0x6326('0x62')](_0x6326('0x68'),new Buffer(util[_0x6326('0x62')](_0x6326('0x69'),_0xe2e249[_0x6326('0x5d')],_0xe2e249[_0x6326('0x66')]))[_0x6326('0x6a')](_0x6326('0x6b')))};break;case'token':_0x1dda23['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x6326('0x62')]('%s/token:%s',_0xe2e249['username'],_0xe2e249['token']))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x6326('0x6c'))](_0x6326('0x6d'));}return rp(_0x1dda23);}})['then'](function(_0x3b4bca){if(_0x3b4bca){var _0x2bfc43=[_0x6326('0x6e'),'description',_0x6326('0x6f'),_0x6326('0x70')];_[_0x6326('0x71')](_0x3b4bca[_0x6326('0x64')],function(_0x3e9477){return _0x2bfc43['includes'](_0x3e9477[_0x6326('0x33')]);});return{'count':_0x3b4bca['ticket_fields']['length'],'rows':_[_0x6326('0x2f')](_0x3b4bca['ticket_fields'],function(_0x57c845){return{'id':_0x57c845['id'],'name':_0x57c845['position']>0x7?_0x57c845['title']:_0x57c845['type'],'custom':_0x57c845['position']>0x7?!![]:![],'options':_0x57c845['system_field_options']?_0x57c845[_0x6326('0x72')]:_0x57c845[_0x6326('0x73')]?_0x57c845[_0x6326('0x73')]:[]};})};}})[_0x6326('0x29')](respondWithResult(_0x5f6273,null))['catch'](function(_0x484866){var _0x4b61c4=_0x303fef[_0x6326('0x36')][_0x6326('0x74')]?0x1f4:_0x484866['statusCode']||0x1f4;logger[_0x6326('0x2a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4b61c4,JSON[_0x6326('0x75')](_0x484866));delete _0x484866[_0x6326('0x2c')];if(_0x4b61c4===0x191){_0x4b61c4=0x190;}_0x5f6273[_0x6326('0x1f')](_0x4b61c4)[_0x6326('0x2d')](_0x303fef[_0x6326('0x36')][_0x6326('0x74')]?{'message':_0x6326('0x76'),'statusCode':_0x484866['statusCode']}:_0x484866);});}; \ No newline at end of file +var _0x57f8=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','channel','Descriptions','ZendeskField','Subjects','username','password','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','includes','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','end','error','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x57f8,0x198));var _0x857f=function(_0xe0dee2,_0x35d2a8){_0xe0dee2=_0xe0dee2-0x0;var _0x568ed0=_0x57f8[_0xe0dee2];return _0x568ed0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2e1eda,_0x2d5e26){_0x2d5e26=_0x2d5e26||0xcc;return function(_0x373333){if(_0x373333){return _0x2e1eda[_0x857f('0x1b')](_0x2d5e26);}return _0x2e1eda[_0x857f('0x1c')](_0x2d5e26)['end']();};}function respondWithResult(_0x4bc590,_0x3b09d9){_0x3b09d9=_0x3b09d9||0xc8;return function(_0x5f27b2){if(_0x5f27b2){return _0x4bc590[_0x857f('0x1c')](_0x3b09d9)['json'](_0x5f27b2);}};}function respondWithFilteredResult(_0x1d47bf,_0x134a4f){return function(_0x5c3a69){if(_0x5c3a69){var _0x27e8f1=typeof _0x134a4f[_0x857f('0x1d')]===_0x857f('0x1e')&&typeof _0x134a4f[_0x857f('0x1f')]===_0x857f('0x1e');var _0x38a3c2=_0x5c3a69[_0x857f('0x20')];var _0x429e23=_0x27e8f1?0x0:_0x134a4f[_0x857f('0x1d')];var _0x38a242=_0x27e8f1?_0x5c3a69[_0x857f('0x20')]:_0x134a4f['offset']+_0x134a4f[_0x857f('0x1f')];var _0x1e8fd4;if(_0x38a242>=_0x38a3c2){_0x38a242=_0x38a3c2;_0x1e8fd4=0xc8;}else{_0x1e8fd4=0xce;}_0x1d47bf['status'](_0x1e8fd4);return _0x1d47bf[_0x857f('0x21')](_0x857f('0x22'),_0x429e23+'-'+_0x38a242+'/'+_0x38a3c2)[_0x857f('0x23')](_0x5c3a69);}return null;};}function patchUpdates(_0x484035){return function(_0x57fa8b){try{jsonpatch[_0x857f('0x24')](_0x57fa8b,_0x484035,!![]);}catch(_0x8f278){return BPromise[_0x857f('0x25')](_0x8f278);}return _0x57fa8b['save']();};}function saveUpdates(_0x118237,_0x17a98e){return function(_0xdf8ac3){if(_0xdf8ac3){return _0xdf8ac3['update'](_0x118237)[_0x857f('0x26')](function(_0x14a8ce){return _0x14a8ce;});}return null;};}function removeEntity(_0x50bfb7,_0x3bc543){return function(_0x1a651f){if(_0x1a651f){return _0x1a651f[_0x857f('0x27')]()[_0x857f('0x26')](function(){_0x50bfb7[_0x857f('0x1c')](0xcc)[_0x857f('0x28')]();});}};}function handleEntityNotFound(_0x233a68,_0x2a89ba){return function(_0x181a9e){if(!_0x181a9e){_0x233a68[_0x857f('0x1b')](0x194);}return _0x181a9e;};}function handleError(_0x72f0aa,_0x4782ab){_0x4782ab=_0x4782ab||0x1f4;return function(_0x250731){logger[_0x857f('0x29')](_0x250731['stack']);if(_0x250731[_0x857f('0x2a')]){delete _0x250731[_0x857f('0x2a')];}_0x72f0aa[_0x857f('0x1c')](_0x4782ab)[_0x857f('0x2b')](_0x250731);};}exports['index']=function(_0x40c306,_0x57ceaa){var _0x1b405a={},_0x234048={},_0x45a37f={'count':0x0,'rows':[]};var _0x2ab814=_[_0x857f('0x2c')](db[_0x857f('0x2d')][_0x857f('0x2e')],function(_0xe79241){return{'name':_0xe79241[_0x857f('0x2f')],'type':_0xe79241[_0x857f('0x30')][_0x857f('0x31')]};});_0x234048[_0x857f('0x32')]=_[_0x857f('0x2c')](_0x2ab814,'name');_0x234048[_0x857f('0x33')]=_[_0x857f('0x34')](_0x40c306['query']);_0x234048[_0x857f('0x35')]=_[_0x857f('0x36')](_0x234048['model'],_0x234048[_0x857f('0x33')]);_0x1b405a[_0x857f('0x37')]=_['intersection'](_0x234048[_0x857f('0x32')],qs[_0x857f('0x38')](_0x40c306[_0x857f('0x33')][_0x857f('0x38')]));_0x1b405a['attributes']=_0x1b405a['attributes'][_0x857f('0x39')]?_0x1b405a[_0x857f('0x37')]:_0x234048['model'];if(!_0x40c306[_0x857f('0x33')]['hasOwnProperty'](_0x857f('0x3a'))){_0x1b405a[_0x857f('0x1f')]=qs[_0x857f('0x1f')](_0x40c306[_0x857f('0x33')][_0x857f('0x1f')]);_0x1b405a['offset']=qs['offset'](_0x40c306[_0x857f('0x33')]['offset']);}_0x1b405a[_0x857f('0x3b')]=qs[_0x857f('0x3c')](_0x40c306[_0x857f('0x33')]['sort']);_0x1b405a[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x40c306[_0x857f('0x33')],_0x234048[_0x857f('0x35')]),_0x2ab814);if(_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]){_0x1b405a['where']=_[_0x857f('0x40')](_0x1b405a[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x2ab814,function(_0x28ffe4){if(_0x28ffe4[_0x857f('0x30')]!==_0x857f('0x41')){var _0x447f28={};_0x447f28[_0x28ffe4['name']]={'$like':'%'+_0x40c306[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x447f28;}})});}_0x1b405a=_[_0x857f('0x40')]({},_0x1b405a,_0x40c306[_0x857f('0x42')]);var _0x196c95={'where':_0x1b405a[_0x857f('0x3d')]};return db['ZendeskAccount'][_0x857f('0x20')](_0x196c95)[_0x857f('0x26')](function(_0x167e9d){_0x45a37f[_0x857f('0x20')]=_0x167e9d;if(_0x40c306[_0x857f('0x33')][_0x857f('0x43')]){_0x1b405a[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2d')]['findAll'](_0x1b405a);})[_0x857f('0x26')](function(_0x223095){_0x45a37f[_0x857f('0x45')]=_0x223095;return _0x45a37f;})[_0x857f('0x26')](respondWithFilteredResult(_0x57ceaa,_0x1b405a))[_0x857f('0x46')](handleError(_0x57ceaa,null));};exports[_0x857f('0x47')]=function(_0x374b9f,_0x42d922){var _0xb4d7c2={'raw':![],'where':{'id':_0x374b9f[_0x857f('0x48')]['id']}},_0x3e2079={};_0x3e2079[_0x857f('0x32')]=_[_0x857f('0x34')](db[_0x857f('0x2d')]['rawAttributes']);_0x3e2079[_0x857f('0x33')]=_['keys'](_0x374b9f[_0x857f('0x33')]);_0x3e2079[_0x857f('0x35')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],_0x3e2079[_0x857f('0x33')]);_0xb4d7c2[_0x857f('0x37')]=_[_0x857f('0x36')](_0x3e2079[_0x857f('0x32')],qs[_0x857f('0x38')](_0x374b9f[_0x857f('0x33')][_0x857f('0x38')]));_0xb4d7c2['attributes']=_0xb4d7c2['attributes'][_0x857f('0x39')]?_0xb4d7c2['attributes']:_0x3e2079[_0x857f('0x32')];if(_0x374b9f['query'][_0x857f('0x43')]){_0xb4d7c2[_0x857f('0x44')]=[{'all':!![]}];}_0xb4d7c2=_[_0x857f('0x40')]({},_0xb4d7c2,_0x374b9f[_0x857f('0x42')]);return db[_0x857f('0x2d')][_0x857f('0x49')](_0xb4d7c2)[_0x857f('0x26')](handleEntityNotFound(_0x42d922,null))[_0x857f('0x26')](respondWithResult(_0x42d922,null))['catch'](handleError(_0x42d922,null));};exports[_0x857f('0x4a')]=function(_0x3b431d,_0x3806d4){return db[_0x857f('0x2d')]['create'](_0x3b431d[_0x857f('0x4b')],{})[_0x857f('0x26')](respondWithResult(_0x3806d4,0xc9))[_0x857f('0x46')](handleError(_0x3806d4,null));};exports[_0x857f('0x4c')]=function(_0x67563,_0x53baae){if(_0x67563[_0x857f('0x4b')]['id']){delete _0x67563[_0x857f('0x4b')]['id'];}return db['ZendeskAccount'][_0x857f('0x49')]({'where':{'id':_0x67563[_0x857f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53baae,null))[_0x857f('0x26')](saveUpdates(_0x67563['body'],null))[_0x857f('0x26')](respondWithResult(_0x53baae,null))[_0x857f('0x46')](handleError(_0x53baae,null));};exports[_0x857f('0x27')]=function(_0x2008d5,_0x58bf27){return db[_0x857f('0x2d')][_0x857f('0x49')]({'where':{'id':_0x2008d5[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x58bf27,null))[_0x857f('0x26')](removeEntity(_0x58bf27,null))['catch'](handleError(_0x58bf27,null));};exports[_0x857f('0x4d')]=function(_0x13ef75,_0x9d8273,_0x2670e6){var _0x3e24a5={};var _0x9edee5={};var _0x12712a;var _0x59164a;return db[_0x857f('0x2d')][_0x857f('0x4e')]({'where':{'id':_0x13ef75[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x9d8273,null))[_0x857f('0x26')](function(_0x153e4e){if(_0x153e4e){_0x12712a=_0x153e4e;_0x9edee5['model']=_[_0x857f('0x34')](db[_0x857f('0x4f')][_0x857f('0x2e')]);_0x9edee5[_0x857f('0x33')]=_[_0x857f('0x34')](_0x13ef75[_0x857f('0x33')]);_0x9edee5[_0x857f('0x35')]=_[_0x857f('0x36')](_0x9edee5['model'],_0x9edee5['query']);_0x3e24a5[_0x857f('0x37')]=_[_0x857f('0x36')](_0x9edee5[_0x857f('0x32')],qs[_0x857f('0x38')](_0x13ef75[_0x857f('0x33')][_0x857f('0x38')]));_0x3e24a5['attributes']=_0x3e24a5[_0x857f('0x37')][_0x857f('0x39')]?_0x3e24a5['attributes']:_0x9edee5[_0x857f('0x32')];_0x3e24a5['order']=qs[_0x857f('0x3c')](_0x13ef75[_0x857f('0x33')]['sort']);_0x3e24a5[_0x857f('0x3d')]=qs[_0x857f('0x35')](_[_0x857f('0x3e')](_0x13ef75[_0x857f('0x33')],_0x9edee5[_0x857f('0x35')]));if(_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]){_0x3e24a5[_0x857f('0x3d')]=_['merge'](_0x3e24a5[_0x857f('0x3d')],{'$or':_[_0x857f('0x2c')](_0x3e24a5[_0x857f('0x37')],function(_0x7cc7f7){var _0x3c612f={};_0x3c612f[_0x7cc7f7]={'$like':'%'+_0x13ef75[_0x857f('0x33')][_0x857f('0x3f')]+'%'};return _0x3c612f;})});}_0x3e24a5=_[_0x857f('0x40')]({},_0x3e24a5,_0x13ef75[_0x857f('0x42')]);return _0x12712a[_0x857f('0x4d')](_0x3e24a5);}})[_0x857f('0x26')](function(_0x5631fb){if(_0x5631fb){_0x59164a=_0x5631fb[_0x857f('0x39')];if(!_0x13ef75[_0x857f('0x33')][_0x857f('0x50')](_0x857f('0x3a'))){_0x3e24a5['limit']=qs[_0x857f('0x1f')](_0x13ef75['query'][_0x857f('0x1f')]);_0x3e24a5[_0x857f('0x1d')]=qs[_0x857f('0x1d')](_0x13ef75[_0x857f('0x33')]['offset']);}return _0x12712a['getConfigurations'](_0x3e24a5);}})[_0x857f('0x26')](function(_0x3ee981){if(_0x3ee981){return _0x3ee981?{'count':_0x59164a,'rows':_0x3ee981}:null;}})[_0x857f('0x26')](respondWithResult(_0x9d8273,null))['catch'](handleError(_0x9d8273,null));};exports[_0x857f('0x51')]=function(_0x5e42bc,_0x5b505,_0x1d6c1c){if(_0x5e42bc[_0x857f('0x4b')]['id']){delete _0x5e42bc['body']['id'];}return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x5e42bc[_0x857f('0x48')]['id']}})[_0x857f('0x26')](handleEntityNotFound(_0x5b505,null))[_0x857f('0x26')](function(_0x41f9d8){if(_0x41f9d8){_0x5e42bc[_0x857f('0x4b')][_0x857f('0x52')]=_0x41f9d8['id'];_0x5e42bc[_0x857f('0x4b')]['Subjects']=integrations['getSubjects'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);_0x5e42bc[_0x857f('0x4b')][_0x857f('0x54')]=integrations['getDescriptions'](_0x5e42bc[_0x857f('0x4b')][_0x857f('0x53')],_0x5e42bc[_0x857f('0x4b')][_0x857f('0x30')]);return db[_0x857f('0x4f')][_0x857f('0x4a')](_0x5e42bc[_0x857f('0x4b')],{'include':[{'model':db[_0x857f('0x55')],'as':_0x857f('0x56')},{'model':db[_0x857f('0x55')],'as':'Descriptions'}]});}return null;})[_0x857f('0x26')](respondWithResult(_0x5b505,null))['catch'](handleError(_0x5b505,null));};exports['getFields']=function(_0x35cd3e,_0x48e588,_0x5e5fd9){var _0x2e2cf3='';return db['ZendeskAccount'][_0x857f('0x4e')]({'where':{'id':_0x35cd3e['params']['id']},'attributes':['id',_0x857f('0x57'),_0x857f('0x58'),_0x857f('0x59'),_0x857f('0x5a'),'remoteUri']})[_0x857f('0x26')](handleEntityNotFound(_0x48e588,null))[_0x857f('0x26')](function(_0x3100aa){if(_0x3100aa){_0x2e2cf3=_0x3100aa[_0x857f('0x5b')];var _0x387aaa=_0x2e2cf3[_0x857f('0x5c')](-0x1);if(_0x387aaa==='/'){_0x2e2cf3=_0x2e2cf3[_0x857f('0x5d')](0x0,_0x2e2cf3['lastIndexOf'](_0x387aaa));}var _0x54e75d={'method':_0x857f('0x5e'),'uri':util[_0x857f('0x5f')](_0x857f('0x60'),_0x2e2cf3,_0x857f('0x61')),'json':!![]};switch(_0x3100aa[_0x857f('0x5a')]){case _0x857f('0x58'):_0x54e75d['headers']={'Authorization':util[_0x857f('0x5f')](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s:%s',_0x3100aa['username'],_0x3100aa[_0x857f('0x58')]))['toString']('base64'))};break;case _0x857f('0x59'):_0x54e75d[_0x857f('0x63')]={'Authorization':util['format'](_0x857f('0x62'),new Buffer(util[_0x857f('0x5f')]('%s/token:%s',_0x3100aa[_0x857f('0x57')],_0x3100aa[_0x857f('0x59')]))[_0x857f('0x64')](_0x857f('0x65')))};break;default:throw new db[(_0x857f('0x66'))][(_0x857f('0x67'))](_0x857f('0x68'));}return rp(_0x54e75d);}})[_0x857f('0x26')](function(_0x415fd3){if(_0x415fd3){var _0x465857=[_0x857f('0x69'),_0x857f('0x6a'),'group','assignee'];_['remove'](_0x415fd3[_0x857f('0x61')],function(_0x310b18){return _0x465857[_0x857f('0x6b')](_0x310b18[_0x857f('0x30')]);});return{'count':_0x415fd3[_0x857f('0x61')][_0x857f('0x39')],'rows':_[_0x857f('0x2c')](_0x415fd3['ticket_fields'],function(_0x40077e){return{'id':_0x40077e['id'],'name':_0x40077e['position']>0x7?_0x40077e[_0x857f('0x6c')]:_0x40077e['type'],'custom':_0x40077e['position']>0x7?!![]:![],'options':_0x40077e[_0x857f('0x6d')]?_0x40077e['system_field_options']:_0x40077e[_0x857f('0x6e')]?_0x40077e[_0x857f('0x6e')]:[]};})};}})[_0x857f('0x26')](respondWithResult(_0x48e588,null))['catch'](function(_0x45be3d){var _0x19456f=_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?0x1f4:_0x45be3d[_0x857f('0x70')]||0x1f4;logger[_0x857f('0x29')](_0x857f('0x71'),_0x857f('0x72'),_0x19456f,JSON[_0x857f('0x73')](_0x45be3d));delete _0x45be3d['name'];if(_0x19456f===0x191){_0x19456f=0x190;}_0x48e588[_0x857f('0x1c')](_0x19456f)[_0x857f('0x2b')](_0x35cd3e[_0x857f('0x33')][_0x857f('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x45be3d[_0x857f('0x70')]}:_0x45be3d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e57dede..d9a9221 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 _0x8949=['request-promise','path','../../components/integrations/configuration','exports','define','lodash','../../config/logger','bluebird'];(function(_0x33b8df,_0x2dc79a){var _0xa9e675=function(_0x45c285){while(--_0x45c285){_0x33b8df['push'](_0x33b8df['shift']());}};_0xa9e675(++_0x2dc79a);}(_0x8949,0x15d));var _0x9894=function(_0x2e5bb6,_0x4a569b){_0x2e5bb6=_0x2e5bb6-0x0;var _0xdae9ed=_0x8949[_0x2e5bb6];return _0xdae9ed;};'use strict';var _=require(_0x9894('0x0'));var util=require('util');var logger=require(_0x9894('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9894('0x2'));var rp=require(_0x9894('0x3'));var fs=require('fs');var path=require(_0x9894('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x9894('0x5'));module[_0x9894('0x6')]=function(_0x571a81,_0xeee487){return _0x571a81[_0x9894('0x7')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd420=['bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api'];(function(_0x2e2747,_0xbc0dda){var _0x5bb81a=function(_0x4d8352){while(--_0x4d8352){_0x2e2747['push'](_0x2e2747['shift']());}};_0x5bb81a(++_0xbc0dda);}(_0xd420,0x147));var _0x0d42=function(_0x5acd2b,_0x25abfb){_0x5acd2b=_0x5acd2b-0x0;var _0x5e7e0d=_0xd420[_0x5acd2b];return _0x5e7e0d;};'use strict';var _=require(_0x0d42('0x0'));var util=require(_0x0d42('0x1'));var logger=require('../../config/logger')(_0x0d42('0x2'));var moment=require('moment');var BPromise=require(_0x0d42('0x3'));var rp=require(_0x0d42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d42('0x5'));var config=require(_0x0d42('0x6'));var attributes=require(_0x0d42('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3c2255,_0x1ab545){return _0x3c2255[_0x0d42('0x8')](_0x0d42('0x9'),attributes,{'tableName':_0x0d42('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 7e49955..097c41f 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 _0x8e84=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','limit','include','model','attributes','map','stringify','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x4aa68d,_0x525f62){var _0x32781c=function(_0x427f36){while(--_0x427f36){_0x4aa68d['push'](_0x4aa68d['shift']());}};_0x32781c(++_0x525f62);}(_0x8e84,0x195));var _0x48e8=function(_0x205d34,_0x399b03){_0x205d34=_0x205d34-0x0;var _0x57af30=_0x8e84[_0x205d34];return _0x57af30;};'use strict';var _=require(_0x48e8('0x0'));var util=require(_0x48e8('0x1'));var moment=require(_0x48e8('0x2'));var BPromise=require(_0x48e8('0x3'));var rs=require(_0x48e8('0x4'));var fs=require('fs');var Redis=require(_0x48e8('0x5'));var db=require(_0x48e8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x48e8('0x7'))(_0x48e8('0x8'));var config=require(_0x48e8('0x9'));var jayson=require(_0x48e8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d51fa,_0x356d9a,_0x260cee){return new BPromise(function(_0x46f122,_0x38935e){return client[_0x48e8('0xb')](_0x4d51fa,_0x260cee)[_0x48e8('0xc')](function(_0x540142){logger[_0x48e8('0xd')](_0x48e8('0xe'),_0x356d9a,'request\x20sent');logger[_0x48e8('0xf')](_0x48e8('0x10'),_0x356d9a,_0x48e8('0x11'),JSON['stringify'](_0x540142));if(_0x540142['error']){if(_0x540142[_0x48e8('0x12')][_0x48e8('0x13')]===0x1f4){logger[_0x48e8('0x12')](_0x48e8('0xe'),_0x356d9a,_0x540142[_0x48e8('0x12')]['message']);return _0x38935e(_0x540142[_0x48e8('0x12')][_0x48e8('0x14')]);}logger[_0x48e8('0x12')](_0x48e8('0xe'),_0x356d9a,_0x540142[_0x48e8('0x12')][_0x48e8('0x14')]);return _0x46f122(_0x540142['error'][_0x48e8('0x14')]);}else{logger[_0x48e8('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x356d9a,_0x48e8('0x11'));_0x46f122(_0x540142[_0x48e8('0x15')][_0x48e8('0x14')]);}})[_0x48e8('0x16')](function(_0x16a482){logger[_0x48e8('0x12')](_0x48e8('0xe'),_0x356d9a,_0x16a482);_0x38935e(_0x16a482);});});}exports[_0x48e8('0x17')]=function(_0x14c487){var _0x4672b2=this;return new Promise(function(_0x3c17c2,_0x5c2a1d){return db[_0x48e8('0x18')]['findAll']({'raw':_0x14c487[_0x48e8('0x19')]?_0x14c487['options'][_0x48e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x14c487[_0x48e8('0x19')]?_0x14c487['options']['where']||null:null,'attributes':_0x14c487[_0x48e8('0x19')]?_0x14c487[_0x48e8('0x19')]['attributes']||null:null,'limit':_0x14c487['options']?_0x14c487[_0x48e8('0x19')][_0x48e8('0x1b')]||null:null,'include':_0x14c487[_0x48e8('0x19')]?_0x14c487[_0x48e8('0x19')][_0x48e8('0x1c')]?_['map'](_0x14c487[_0x48e8('0x19')][_0x48e8('0x1c')],function(_0x299e5d){return{'model':db[_0x299e5d[_0x48e8('0x1d')]],'as':_0x299e5d['as'],'attributes':_0x299e5d[_0x48e8('0x1e')],'include':_0x299e5d[_0x48e8('0x1c')]?_['map'](_0x299e5d[_0x48e8('0x1c')],function(_0x6f83d6){return{'model':db[_0x6f83d6[_0x48e8('0x1d')]],'as':_0x6f83d6['as'],'attributes':_0x6f83d6['attributes'],'include':_0x6f83d6[_0x48e8('0x1c')]?_[_0x48e8('0x1f')](_0x6f83d6[_0x48e8('0x1c')],function(_0x2167b9){return{'model':db[_0x2167b9['model']],'as':_0x2167b9['as'],'attributes':_0x2167b9[_0x48e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x48e8('0xc')](function(_0x235896){logger[_0x48e8('0xd')](_0x48e8('0x17'),_0x14c487);logger[_0x48e8('0xf')](_0x48e8('0x17'),_0x14c487,JSON[_0x48e8('0x20')](_0x235896));_0x3c17c2(_0x235896);})[_0x48e8('0x16')](function(_0x5e1ce7){logger[_0x48e8('0x12')](_0x48e8('0x17'),_0x5e1ce7['message'],_0x14c487);_0x5c2a1d(_0x4672b2[_0x48e8('0x12')](0x1f4,_0x5e1ce7[_0x48e8('0x14')]));});});};exports[_0x48e8('0x21')]=function(_0x4f37be){var _0x470177=this;return new Promise(function(_0x4040b5,_0x12b388){return db[_0x48e8('0x18')][_0x48e8('0x22')]({'raw':_0x4f37be[_0x48e8('0x19')]?_0x4f37be[_0x48e8('0x19')][_0x48e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f37be[_0x48e8('0x19')]?_0x4f37be[_0x48e8('0x19')]['where']||null:null,'attributes':_0x4f37be['options']?_0x4f37be[_0x48e8('0x19')][_0x48e8('0x1e')]||null:null,'include':_0x4f37be[_0x48e8('0x19')]?_0x4f37be['options']['include']?_['map'](_0x4f37be[_0x48e8('0x19')]['include'],function(_0x254b2c){return{'model':db[_0x254b2c['model']],'as':_0x254b2c['as'],'attributes':_0x254b2c[_0x48e8('0x1e')],'include':_0x254b2c[_0x48e8('0x1c')]?_[_0x48e8('0x1f')](_0x254b2c[_0x48e8('0x1c')],function(_0x391de5){return{'model':db[_0x391de5['model']],'as':_0x391de5['as'],'attributes':_0x391de5['attributes'],'include':_0x391de5[_0x48e8('0x1c')]?_[_0x48e8('0x1f')](_0x391de5[_0x48e8('0x1c')],function(_0x45038c){return{'model':db[_0x45038c[_0x48e8('0x1d')]],'as':_0x45038c['as'],'attributes':_0x45038c[_0x48e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x48e8('0xc')](function(_0x3b53e2){logger[_0x48e8('0xd')](_0x48e8('0x21'),_0x4f37be);logger[_0x48e8('0xf')](_0x48e8('0x21'),_0x4f37be,JSON['stringify'](_0x3b53e2));_0x4040b5(_0x3b53e2);})[_0x48e8('0x16')](function(_0x43558c){logger['error']('ShowZendeskAccount',_0x43558c[_0x48e8('0x14')],_0x4f37be);_0x12b388(_0x470177[_0x48e8('0x12')](0x1f4,_0x43558c[_0x48e8('0x14')]));});});}; \ No newline at end of file +var _0x6068=['ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x1e0144,_0x2c824b){var _0x1fa9f8=function(_0x1db012){while(--_0x1db012){_0x1e0144['push'](_0x1e0144['shift']());}};_0x1fa9f8(++_0x2c824b);}(_0x6068,0x81));var _0x8606=function(_0x725574,_0x33b5fa){_0x725574=_0x725574-0x0;var _0x299c6e=_0x6068[_0x725574];return _0x299c6e;};'use strict';var _=require(_0x8606('0x0'));var util=require(_0x8606('0x1'));var moment=require(_0x8606('0x2'));var BPromise=require(_0x8606('0x3'));var rs=require(_0x8606('0x4'));var fs=require('fs');var Redis=require(_0x8606('0x5'));var db=require(_0x8606('0x6'))['db'];var utils=require(_0x8606('0x7'));var logger=require(_0x8606('0x8'))(_0x8606('0x9'));var config=require(_0x8606('0xa'));var jayson=require(_0x8606('0xb'));var client=jayson['client'][_0x8606('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3139ef,_0x56c790,_0x44e01c){return new BPromise(function(_0x1b9ed4,_0x13959d){return client['request'](_0x3139ef,_0x44e01c)[_0x8606('0xd')](function(_0x22b92b){logger[_0x8606('0xe')](_0x8606('0xf'),_0x56c790,_0x8606('0x10'));logger['debug'](_0x8606('0x11'),_0x56c790,'request\x20sent',JSON['stringify'](_0x22b92b));if(_0x22b92b[_0x8606('0x12')]){if(_0x22b92b[_0x8606('0x12')][_0x8606('0x13')]===0x1f4){logger['error'](_0x8606('0xf'),_0x56c790,_0x22b92b[_0x8606('0x12')][_0x8606('0x14')]);return _0x13959d(_0x22b92b['error']['message']);}logger[_0x8606('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x56c790,_0x22b92b[_0x8606('0x12')][_0x8606('0x14')]);return _0x1b9ed4(_0x22b92b[_0x8606('0x12')][_0x8606('0x14')]);}else{logger[_0x8606('0xe')](_0x8606('0xf'),_0x56c790,_0x8606('0x10'));_0x1b9ed4(_0x22b92b[_0x8606('0x15')][_0x8606('0x14')]);}})[_0x8606('0x16')](function(_0xd7559f){logger[_0x8606('0x12')](_0x8606('0xf'),_0x56c790,_0xd7559f);_0x13959d(_0xd7559f);});});}exports[_0x8606('0x17')]=function(_0x58cd73){var _0x1a3693=this;return new Promise(function(_0x237d82,_0x57d902){return db[_0x8606('0x18')][_0x8606('0x19')]({'raw':_0x58cd73[_0x8606('0x1a')]?_0x58cd73[_0x8606('0x1a')][_0x8606('0x1b')]===undefined?!![]:![]:!![],'where':_0x58cd73['options']?_0x58cd73['options'][_0x8606('0x1c')]||null:null,'attributes':_0x58cd73[_0x8606('0x1a')]?_0x58cd73['options'][_0x8606('0x1d')]||null:null,'limit':_0x58cd73[_0x8606('0x1a')]?_0x58cd73[_0x8606('0x1a')][_0x8606('0x1e')]||null:null,'include':_0x58cd73[_0x8606('0x1a')]?_0x58cd73[_0x8606('0x1a')][_0x8606('0x1f')]?_[_0x8606('0x20')](_0x58cd73[_0x8606('0x1a')][_0x8606('0x1f')],function(_0x5bf43e){return{'model':db[_0x5bf43e[_0x8606('0x21')]],'as':_0x5bf43e['as'],'attributes':_0x5bf43e[_0x8606('0x1d')],'include':_0x5bf43e[_0x8606('0x1f')]?_[_0x8606('0x20')](_0x5bf43e['include'],function(_0x3747e3){return{'model':db[_0x3747e3[_0x8606('0x21')]],'as':_0x3747e3['as'],'attributes':_0x3747e3['attributes'],'include':_0x3747e3[_0x8606('0x1f')]?_[_0x8606('0x20')](_0x3747e3[_0x8606('0x1f')],function(_0x2a4e16){return{'model':db[_0x2a4e16[_0x8606('0x21')]],'as':_0x2a4e16['as'],'attributes':_0x2a4e16[_0x8606('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8606('0xd')](function(_0x323f8c){logger[_0x8606('0xe')]('GetZendeskAccount',_0x58cd73);logger['debug'](_0x8606('0x17'),_0x58cd73,JSON[_0x8606('0x22')](_0x323f8c));_0x237d82(_0x323f8c);})[_0x8606('0x16')](function(_0x73f8d1){logger[_0x8606('0x12')]('GetZendeskAccount',_0x73f8d1[_0x8606('0x14')],_0x58cd73);_0x57d902(_0x1a3693[_0x8606('0x12')](0x1f4,_0x73f8d1['message']));});});};exports[_0x8606('0x23')]=function(_0x5d4631){var _0x339703=this;return new Promise(function(_0x346a7c,_0x2c463b){return db[_0x8606('0x18')]['find']({'raw':_0x5d4631[_0x8606('0x1a')]?_0x5d4631[_0x8606('0x1a')][_0x8606('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d4631[_0x8606('0x1a')]?_0x5d4631['options'][_0x8606('0x1c')]||null:null,'attributes':_0x5d4631[_0x8606('0x1a')]?_0x5d4631[_0x8606('0x1a')][_0x8606('0x1d')]||null:null,'include':_0x5d4631[_0x8606('0x1a')]?_0x5d4631[_0x8606('0x1a')][_0x8606('0x1f')]?_[_0x8606('0x20')](_0x5d4631[_0x8606('0x1a')][_0x8606('0x1f')],function(_0x480d46){return{'model':db[_0x480d46[_0x8606('0x21')]],'as':_0x480d46['as'],'attributes':_0x480d46[_0x8606('0x1d')],'include':_0x480d46['include']?_['map'](_0x480d46[_0x8606('0x1f')],function(_0x3ef36d){return{'model':db[_0x3ef36d['model']],'as':_0x3ef36d['as'],'attributes':_0x3ef36d[_0x8606('0x1d')],'include':_0x3ef36d[_0x8606('0x1f')]?_[_0x8606('0x20')](_0x3ef36d[_0x8606('0x1f')],function(_0x4fa57a){return{'model':db[_0x4fa57a[_0x8606('0x21')]],'as':_0x4fa57a['as'],'attributes':_0x4fa57a['attributes']};}):[]};}):[]};}):[]:[]})[_0x8606('0xd')](function(_0x1f8b35){logger[_0x8606('0xe')](_0x8606('0x23'),_0x5d4631);logger['debug'](_0x8606('0x23'),_0x5d4631,JSON[_0x8606('0x22')](_0x1f8b35));_0x346a7c(_0x1f8b35);})[_0x8606('0x16')](function(_0x467163){logger['error'](_0x8606('0x23'),_0x467163[_0x8606('0x14')],_0x5d4631);_0x2c463b(_0x339703[_0x8606('0x12')](0x1f4,_0x467163[_0x8606('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 170b090..ecfb1ab 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 _0x757a=['index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','setTags','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x163f48,_0x128fbd){var _0x5bc066=function(_0x58de89){while(--_0x58de89){_0x163f48['push'](_0x163f48['shift']());}};_0x5bc066(++_0x128fbd);}(_0x757a,0xde));var _0xa757=function(_0x3893b9,_0x4daa70){_0x3893b9=_0x3893b9-0x0;var _0x27c24a=_0x757a[_0x3893b9];return _0x27c24a;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getFields']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xa757('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa757('0x10')]);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x15')]);module[_0xa757('0x16')]=router; \ No newline at end of file +var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0x4483,0x1a3));var _0x3448=function(_0x5e7b41,_0x25458d){_0x5e7b41=_0x5e7b41-0x0;var _0x3f1352=_0x4483[_0x5e7b41];return _0x3f1352;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 1503727..05ec1de 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 _0xbf0e=['exports','STRING'];(function(_0x49506d,_0x15eae1){var _0x34fadb=function(_0x40014d){while(--_0x40014d){_0x49506d['push'](_0x49506d['shift']());}};_0x34fadb(++_0x15eae1);}(_0xbf0e,0xa8));var _0xebf0=function(_0x352921,_0x53c2c5){_0x352921=_0x352921-0x0;var _0x38d629=_0xbf0e[_0x352921];return _0x38d629;};'use strict';var Sequelize=require('sequelize');module[_0xebf0('0x0')]={'name':{'type':Sequelize[_0xebf0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9adf=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9adf,0x103));var _0xf9ad=function(_0x369298,_0x151c9c){_0x369298=_0x369298-0x0;var _0x5b964d=_0x9adf[_0x369298];return _0x5b964d;};'use strict';var Sequelize=require(_0xf9ad('0x0'));module[_0xf9ad('0x1')]={'name':{'type':Sequelize[_0xf9ad('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 8b6cad5..2a56b63 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 _0x1b64=['attributes','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','fields','create','body','find','getFields','ZendeskField','pick','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','hasOwnProperty','setTags','ids','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0xbecefa,_0x551907){var _0x19dab4=function(_0xf5c3db){while(--_0xf5c3db){_0xbecefa['push'](_0xbecefa['shift']());}};_0x19dab4(++_0x551907);}(_0x1b64,0x174));var _0x41b6=function(_0x1b2a16,_0x154b64){_0x1b2a16=_0x1b2a16-0x0;var _0x4853ea=_0x1b64[_0x1b2a16];return _0x4853ea;};'use strict';var emlformat=require(_0x41b6('0x0'));var rimraf=require(_0x41b6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x41b6('0x2'));var moment=require('moment');var BPromise=require(_0x41b6('0x3'));var Mustache=require(_0x41b6('0x4'));var util=require('util');var path=require(_0x41b6('0x5'));var sox=require('sox');var csv=require(_0x41b6('0x6'));var ejs=require(_0x41b6('0x7'));var fs=require('fs');var fs_extra=require(_0x41b6('0x8'));var _=require(_0x41b6('0x9'));var squel=require(_0x41b6('0xa'));var crypto=require(_0x41b6('0xb'));var jsforce=require(_0x41b6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x41b6('0x6'));var querystring=require(_0x41b6('0xd'));var Papa=require('papaparse');var Redis=require(_0x41b6('0xe'));var authService=require(_0x41b6('0xf'));var qs=require(_0x41b6('0x10'));var as=require(_0x41b6('0x11'));var hardwareService=require(_0x41b6('0x12'));var logger=require(_0x41b6('0x13'))(_0x41b6('0x14'));var utils=require(_0x41b6('0x15'));var config=require(_0x41b6('0x16'));var licenseUtil=require(_0x41b6('0x17'));var db=require(_0x41b6('0x18'))['db'];function respondWithStatusCode(_0x259e0e,_0xa352d7){_0xa352d7=_0xa352d7||0xcc;return function(_0x52ef9c){if(_0x52ef9c){return _0x259e0e[_0x41b6('0x19')](_0xa352d7);}return _0x259e0e[_0x41b6('0x1a')](_0xa352d7)[_0x41b6('0x1b')]();};}function respondWithResult(_0x262695,_0x448412){_0x448412=_0x448412||0xc8;return function(_0x276666){if(_0x276666){return _0x262695[_0x41b6('0x1a')](_0x448412)[_0x41b6('0x1c')](_0x276666);}};}function respondWithFilteredResult(_0x27ba9f,_0x3d2636){return function(_0x21620d){if(_0x21620d){var _0x6b9766=typeof _0x3d2636['offset']===_0x41b6('0x1d')&&typeof _0x3d2636[_0x41b6('0x1e')]===_0x41b6('0x1d');var _0x5e0a8e=_0x21620d[_0x41b6('0x1f')];var _0x4c43c3=_0x6b9766?0x0:_0x3d2636[_0x41b6('0x20')];var _0x3952fd=_0x6b9766?_0x21620d['count']:_0x3d2636[_0x41b6('0x20')]+_0x3d2636[_0x41b6('0x1e')];var _0x224e1f;if(_0x3952fd>=_0x5e0a8e){_0x3952fd=_0x5e0a8e;_0x224e1f=0xc8;}else{_0x224e1f=0xce;}_0x27ba9f[_0x41b6('0x1a')](_0x224e1f);return _0x27ba9f[_0x41b6('0x21')](_0x41b6('0x22'),_0x4c43c3+'-'+_0x3952fd+'/'+_0x5e0a8e)[_0x41b6('0x1c')](_0x21620d);}return null;};}function patchUpdates(_0x2c9863){return function(_0x24490f){try{jsonpatch[_0x41b6('0x23')](_0x24490f,_0x2c9863,!![]);}catch(_0x1b31d8){return BPromise[_0x41b6('0x24')](_0x1b31d8);}return _0x24490f['save']();};}function saveUpdates(_0x1bb746,_0x5e90e2){return function(_0x6e60e5){if(_0x6e60e5){return _0x6e60e5['update'](_0x1bb746)[_0x41b6('0x25')](function(_0x206189){return _0x206189;});}return null;};}function removeEntity(_0x406780,_0x3beef2){return function(_0x189201){if(_0x189201){return _0x189201[_0x41b6('0x26')]()[_0x41b6('0x25')](function(){_0x406780[_0x41b6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22a50c,_0x356e99){return function(_0x25d86a){if(!_0x25d86a){_0x22a50c[_0x41b6('0x19')](0x194);}return _0x25d86a;};}function handleError(_0x5852b0,_0x385315){_0x385315=_0x385315||0x1f4;return function(_0xbce733){logger['error'](_0xbce733[_0x41b6('0x27')]);if(_0xbce733[_0x41b6('0x28')]){delete _0xbce733[_0x41b6('0x28')];}_0x5852b0[_0x41b6('0x1a')](_0x385315)[_0x41b6('0x29')](_0xbce733);};}exports[_0x41b6('0x2a')]=function(_0x224e16,_0x2258a4){var _0x1a710d={},_0xd81644={},_0x2e9af0={'count':0x0,'rows':[]};var _0x4818d6=_[_0x41b6('0x2b')](db[_0x41b6('0x2c')][_0x41b6('0x2d')],function(_0x461160){return{'name':_0x461160[_0x41b6('0x2e')],'type':_0x461160[_0x41b6('0x2f')][_0x41b6('0x30')]};});_0xd81644[_0x41b6('0x31')]=_[_0x41b6('0x2b')](_0x4818d6,_0x41b6('0x28'));_0xd81644['query']=_['keys'](_0x224e16[_0x41b6('0x32')]);_0xd81644[_0x41b6('0x33')]=_['intersection'](_0xd81644[_0x41b6('0x31')],_0xd81644[_0x41b6('0x32')]);_0x1a710d['attributes']=_[_0x41b6('0x34')](_0xd81644[_0x41b6('0x31')],qs['fields'](_0x224e16[_0x41b6('0x32')]['fields']));_0x1a710d[_0x41b6('0x35')]=_0x1a710d['attributes'][_0x41b6('0x36')]?_0x1a710d['attributes']:_0xd81644[_0x41b6('0x31')];if(!_0x224e16[_0x41b6('0x32')]['hasOwnProperty']('nolimit')){_0x1a710d[_0x41b6('0x1e')]=qs['limit'](_0x224e16[_0x41b6('0x32')][_0x41b6('0x1e')]);_0x1a710d[_0x41b6('0x20')]=qs[_0x41b6('0x20')](_0x224e16[_0x41b6('0x32')][_0x41b6('0x20')]);}_0x1a710d[_0x41b6('0x37')]=qs[_0x41b6('0x38')](_0x224e16[_0x41b6('0x32')][_0x41b6('0x38')]);_0x1a710d[_0x41b6('0x39')]=qs[_0x41b6('0x33')](_['pick'](_0x224e16[_0x41b6('0x32')],_0xd81644[_0x41b6('0x33')]),_0x4818d6);if(_0x224e16[_0x41b6('0x32')][_0x41b6('0x3a')]){_0x1a710d[_0x41b6('0x39')]=_[_0x41b6('0x3b')](_0x1a710d['where'],{'$or':_[_0x41b6('0x2b')](_0x4818d6,function(_0x24f143){if(_0x24f143[_0x41b6('0x2f')]!==_0x41b6('0x3c')){var _0x23bcb8={};_0x23bcb8[_0x24f143[_0x41b6('0x28')]]={'$like':'%'+_0x224e16[_0x41b6('0x32')][_0x41b6('0x3a')]+'%'};return _0x23bcb8;}})});}_0x1a710d=_[_0x41b6('0x3b')]({},_0x1a710d,_0x224e16[_0x41b6('0x3d')]);var _0x27e5c8={'where':_0x1a710d[_0x41b6('0x39')]};return db['ZendeskConfiguration'][_0x41b6('0x1f')](_0x27e5c8)[_0x41b6('0x25')](function(_0xb8e70e){_0x2e9af0[_0x41b6('0x1f')]=_0xb8e70e;if(_0x224e16[_0x41b6('0x32')][_0x41b6('0x3e')]){_0x1a710d['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x41b6('0x3f')](_0x1a710d);})[_0x41b6('0x25')](function(_0x43d51f){_0x2e9af0[_0x41b6('0x40')]=_0x43d51f;return _0x2e9af0;})[_0x41b6('0x25')](respondWithFilteredResult(_0x2258a4,_0x1a710d))[_0x41b6('0x41')](handleError(_0x2258a4,null));};exports[_0x41b6('0x42')]=function(_0x2e370e,_0x45e98d){var _0x51ca1f={'raw':![],'where':{'id':_0x2e370e[_0x41b6('0x43')]['id']}},_0x59ba1a={};_0x59ba1a[_0x41b6('0x31')]=_[_0x41b6('0x44')](db[_0x41b6('0x2c')][_0x41b6('0x2d')]);_0x59ba1a[_0x41b6('0x32')]=_['keys'](_0x2e370e[_0x41b6('0x32')]);_0x59ba1a[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x59ba1a[_0x41b6('0x31')],_0x59ba1a['query']);_0x51ca1f[_0x41b6('0x35')]=_['intersection'](_0x59ba1a[_0x41b6('0x31')],qs['fields'](_0x2e370e['query'][_0x41b6('0x45')]));_0x51ca1f[_0x41b6('0x35')]=_0x51ca1f['attributes']['length']?_0x51ca1f[_0x41b6('0x35')]:_0x59ba1a[_0x41b6('0x31')];if(_0x2e370e['query'][_0x41b6('0x3e')]){_0x51ca1f['include']=[{'all':!![]}];}_0x51ca1f=_[_0x41b6('0x3b')]({},_0x51ca1f,_0x2e370e[_0x41b6('0x3d')]);return db[_0x41b6('0x2c')]['find'](_0x51ca1f)[_0x41b6('0x25')](handleEntityNotFound(_0x45e98d,null))[_0x41b6('0x25')](respondWithResult(_0x45e98d,null))[_0x41b6('0x41')](handleError(_0x45e98d,null));};exports['create']=function(_0x3a8799,_0x249d4c){return db[_0x41b6('0x2c')][_0x41b6('0x46')](_0x3a8799[_0x41b6('0x47')],{})[_0x41b6('0x25')](respondWithResult(_0x249d4c,0xc9))[_0x41b6('0x41')](handleError(_0x249d4c,null));};exports['update']=function(_0x25e3f2,_0x346563){if(_0x25e3f2[_0x41b6('0x47')]['id']){delete _0x25e3f2[_0x41b6('0x47')]['id'];}return db[_0x41b6('0x2c')][_0x41b6('0x48')]({'where':{'id':_0x25e3f2[_0x41b6('0x43')]['id']}})[_0x41b6('0x25')](handleEntityNotFound(_0x346563,null))[_0x41b6('0x25')](saveUpdates(_0x25e3f2['body'],null))[_0x41b6('0x25')](respondWithResult(_0x346563,null))[_0x41b6('0x41')](handleError(_0x346563,null));};exports[_0x41b6('0x26')]=function(_0x280c21,_0xd49631){return db['ZendeskConfiguration']['find']({'where':{'id':_0x280c21[_0x41b6('0x43')]['id']}})['then'](handleEntityNotFound(_0xd49631,null))[_0x41b6('0x25')](removeEntity(_0xd49631,null))['catch'](handleError(_0xd49631,null));};exports[_0x41b6('0x49')]=function(_0x57ab7f,_0x1c7e96,_0x16245f){var _0x6dcaaf={};var _0x22a06d={};var _0x290098;var _0x477fe5;return db[_0x41b6('0x2c')]['findOne']({'where':{'id':_0x57ab7f[_0x41b6('0x43')]['id']}})[_0x41b6('0x25')](handleEntityNotFound(_0x1c7e96,null))[_0x41b6('0x25')](function(_0x1c041f){if(_0x1c041f){_0x290098=_0x1c041f;_0x22a06d[_0x41b6('0x31')]=_[_0x41b6('0x44')](db[_0x41b6('0x4a')][_0x41b6('0x2d')]);_0x22a06d[_0x41b6('0x32')]=_[_0x41b6('0x44')](_0x57ab7f[_0x41b6('0x32')]);_0x22a06d[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x22a06d[_0x41b6('0x31')],_0x22a06d[_0x41b6('0x32')]);_0x6dcaaf[_0x41b6('0x35')]=_[_0x41b6('0x34')](_0x22a06d[_0x41b6('0x31')],qs['fields'](_0x57ab7f[_0x41b6('0x32')]['fields']));_0x6dcaaf[_0x41b6('0x35')]=_0x6dcaaf[_0x41b6('0x35')][_0x41b6('0x36')]?_0x6dcaaf[_0x41b6('0x35')]:_0x22a06d['model'];_0x6dcaaf[_0x41b6('0x37')]=qs[_0x41b6('0x38')](_0x57ab7f[_0x41b6('0x32')][_0x41b6('0x38')]);_0x6dcaaf[_0x41b6('0x39')]=qs[_0x41b6('0x33')](_[_0x41b6('0x4b')](_0x57ab7f[_0x41b6('0x32')],_0x22a06d['filters']));if(_0x57ab7f[_0x41b6('0x32')]['filter']){_0x6dcaaf[_0x41b6('0x39')]=_[_0x41b6('0x3b')](_0x6dcaaf[_0x41b6('0x39')],{'$or':_[_0x41b6('0x2b')](_0x6dcaaf[_0x41b6('0x35')],function(_0x4b089c){var _0x55d7b0={};_0x55d7b0[_0x4b089c]={'$like':'%'+_0x57ab7f[_0x41b6('0x32')][_0x41b6('0x3a')]+'%'};return _0x55d7b0;})});}_0x6dcaaf=_[_0x41b6('0x3b')]({},_0x6dcaaf,_0x57ab7f['options']);return _0x290098[_0x41b6('0x49')](_0x6dcaaf);}})[_0x41b6('0x25')](function(_0xd42704){if(_0xd42704){_0x477fe5=_0xd42704['length'];if(!_0x57ab7f['query']['hasOwnProperty'](_0x41b6('0x4c'))){_0x6dcaaf[_0x41b6('0x1e')]=qs['limit'](_0x57ab7f['query'][_0x41b6('0x1e')]);_0x6dcaaf[_0x41b6('0x20')]=qs['offset'](_0x57ab7f[_0x41b6('0x32')][_0x41b6('0x20')]);}return _0x290098[_0x41b6('0x49')](_0x6dcaaf);}})['then'](function(_0x4e02fd){if(_0x4e02fd){return _0x4e02fd?{'count':_0x477fe5,'rows':_0x4e02fd}:null;}})[_0x41b6('0x25')](respondWithResult(_0x1c7e96,null))[_0x41b6('0x41')](handleError(_0x1c7e96,null));};exports[_0x41b6('0x4d')]=function(_0x43497a,_0x272a67,_0x457a61){var _0x2ee20e={};var _0x4b39ca={};var _0x5d7019;var _0x293c52;return db[_0x41b6('0x2c')]['findOne']({'where':{'id':_0x43497a[_0x41b6('0x43')]['id']}})[_0x41b6('0x25')](handleEntityNotFound(_0x272a67,null))[_0x41b6('0x25')](function(_0x744e9){if(_0x744e9){_0x5d7019=_0x744e9;_0x4b39ca[_0x41b6('0x31')]=_[_0x41b6('0x44')](db['ZendeskField'][_0x41b6('0x2d')]);_0x4b39ca[_0x41b6('0x32')]=_[_0x41b6('0x44')](_0x43497a[_0x41b6('0x32')]);_0x4b39ca[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x4b39ca[_0x41b6('0x31')],_0x4b39ca[_0x41b6('0x32')]);_0x2ee20e[_0x41b6('0x35')]=_[_0x41b6('0x34')](_0x4b39ca[_0x41b6('0x31')],qs['fields'](_0x43497a[_0x41b6('0x32')][_0x41b6('0x45')]));_0x2ee20e[_0x41b6('0x35')]=_0x2ee20e[_0x41b6('0x35')][_0x41b6('0x36')]?_0x2ee20e[_0x41b6('0x35')]:_0x4b39ca[_0x41b6('0x31')];_0x2ee20e[_0x41b6('0x37')]=qs[_0x41b6('0x38')](_0x43497a['query']['sort']);_0x2ee20e[_0x41b6('0x39')]=qs[_0x41b6('0x33')](_[_0x41b6('0x4b')](_0x43497a[_0x41b6('0x32')],_0x4b39ca[_0x41b6('0x33')]));if(_0x43497a['query'][_0x41b6('0x3a')]){_0x2ee20e[_0x41b6('0x39')]=_[_0x41b6('0x3b')](_0x2ee20e['where'],{'$or':_[_0x41b6('0x2b')](_0x2ee20e[_0x41b6('0x35')],function(_0x3a8a26){var _0x35352d={};_0x35352d[_0x3a8a26]={'$like':'%'+_0x43497a[_0x41b6('0x32')][_0x41b6('0x3a')]+'%'};return _0x35352d;})});}_0x2ee20e=_[_0x41b6('0x3b')]({},_0x2ee20e,_0x43497a[_0x41b6('0x3d')]);return _0x5d7019[_0x41b6('0x4d')](_0x2ee20e);}})[_0x41b6('0x25')](function(_0x3f359c){if(_0x3f359c){_0x293c52=_0x3f359c[_0x41b6('0x36')];if(!_0x43497a[_0x41b6('0x32')]['hasOwnProperty'](_0x41b6('0x4c'))){_0x2ee20e[_0x41b6('0x1e')]=qs['limit'](_0x43497a['query'][_0x41b6('0x1e')]);_0x2ee20e[_0x41b6('0x20')]=qs[_0x41b6('0x20')](_0x43497a[_0x41b6('0x32')][_0x41b6('0x20')]);}return _0x5d7019['getSubjects'](_0x2ee20e);}})[_0x41b6('0x25')](function(_0x38e6ce){if(_0x38e6ce){return _0x38e6ce?{'count':_0x293c52,'rows':_0x38e6ce}:null;}})[_0x41b6('0x25')](respondWithResult(_0x272a67,null))[_0x41b6('0x41')](handleError(_0x272a67,null));};exports['getDescriptions']=function(_0x336e39,_0x370b61,_0x43e253){var _0xd6abb6={};var _0x53c0f8={};var _0x50c8d6;var _0x4215c4;return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x336e39[_0x41b6('0x43')]['id']}})[_0x41b6('0x25')](handleEntityNotFound(_0x370b61,null))[_0x41b6('0x25')](function(_0x19b699){if(_0x19b699){_0x50c8d6=_0x19b699;_0x53c0f8[_0x41b6('0x31')]=_[_0x41b6('0x44')](db[_0x41b6('0x4a')]['rawAttributes']);_0x53c0f8['query']=_[_0x41b6('0x44')](_0x336e39['query']);_0x53c0f8[_0x41b6('0x33')]=_[_0x41b6('0x34')](_0x53c0f8[_0x41b6('0x31')],_0x53c0f8[_0x41b6('0x32')]);_0xd6abb6[_0x41b6('0x35')]=_[_0x41b6('0x34')](_0x53c0f8[_0x41b6('0x31')],qs['fields'](_0x336e39['query'][_0x41b6('0x45')]));_0xd6abb6[_0x41b6('0x35')]=_0xd6abb6[_0x41b6('0x35')][_0x41b6('0x36')]?_0xd6abb6[_0x41b6('0x35')]:_0x53c0f8[_0x41b6('0x31')];_0xd6abb6[_0x41b6('0x37')]=qs['sort'](_0x336e39['query'][_0x41b6('0x38')]);_0xd6abb6[_0x41b6('0x39')]=qs[_0x41b6('0x33')](_['pick'](_0x336e39[_0x41b6('0x32')],_0x53c0f8['filters']));if(_0x336e39[_0x41b6('0x32')][_0x41b6('0x3a')]){_0xd6abb6[_0x41b6('0x39')]=_[_0x41b6('0x3b')](_0xd6abb6[_0x41b6('0x39')],{'$or':_[_0x41b6('0x2b')](_0xd6abb6['attributes'],function(_0x1b896){var _0x266191={};_0x266191[_0x1b896]={'$like':'%'+_0x336e39['query'][_0x41b6('0x3a')]+'%'};return _0x266191;})});}_0xd6abb6=_['merge']({},_0xd6abb6,_0x336e39[_0x41b6('0x3d')]);return _0x50c8d6[_0x41b6('0x4f')](_0xd6abb6);}})[_0x41b6('0x25')](function(_0x4e8348){if(_0x4e8348){_0x4215c4=_0x4e8348[_0x41b6('0x36')];if(!_0x336e39[_0x41b6('0x32')]['hasOwnProperty'](_0x41b6('0x4c'))){_0xd6abb6[_0x41b6('0x1e')]=qs['limit'](_0x336e39['query'][_0x41b6('0x1e')]);_0xd6abb6[_0x41b6('0x20')]=qs[_0x41b6('0x20')](_0x336e39[_0x41b6('0x32')][_0x41b6('0x20')]);}return _0x50c8d6[_0x41b6('0x4f')](_0xd6abb6);}})[_0x41b6('0x25')](function(_0xeb3d13){if(_0xeb3d13){return _0xeb3d13?{'count':_0x4215c4,'rows':_0xeb3d13}:null;}})[_0x41b6('0x25')](respondWithResult(_0x370b61,null))[_0x41b6('0x41')](handleError(_0x370b61,null));};exports[_0x41b6('0x50')]=function(_0x4309ea,_0x540e3a,_0x4ef0b8){var _0x588291={};var _0x749061={};var _0x100c27;var _0xae50;return db[_0x41b6('0x2c')][_0x41b6('0x4e')]({'where':{'id':_0x4309ea[_0x41b6('0x43')]['id']}})['then'](handleEntityNotFound(_0x540e3a,null))['then'](function(_0x2dc0da){if(_0x2dc0da){_0x100c27=_0x2dc0da;_0x749061['model']=_['keys'](db[_0x41b6('0x51')][_0x41b6('0x2d')]);_0x749061[_0x41b6('0x32')]=_[_0x41b6('0x44')](_0x4309ea[_0x41b6('0x32')]);_0x749061[_0x41b6('0x33')]=_['intersection'](_0x749061[_0x41b6('0x31')],_0x749061[_0x41b6('0x32')]);_0x588291[_0x41b6('0x35')]=_[_0x41b6('0x34')](_0x749061[_0x41b6('0x31')],qs[_0x41b6('0x45')](_0x4309ea[_0x41b6('0x32')][_0x41b6('0x45')]));_0x588291[_0x41b6('0x35')]=_0x588291[_0x41b6('0x35')][_0x41b6('0x36')]?_0x588291[_0x41b6('0x35')]:_0x749061['model'];_0x588291[_0x41b6('0x37')]=qs[_0x41b6('0x38')](_0x4309ea[_0x41b6('0x32')][_0x41b6('0x38')]);_0x588291['where']=qs[_0x41b6('0x33')](_[_0x41b6('0x4b')](_0x4309ea[_0x41b6('0x32')],_0x749061[_0x41b6('0x33')]));if(_0x4309ea[_0x41b6('0x32')][_0x41b6('0x3a')]){_0x588291['where']=_['merge'](_0x588291[_0x41b6('0x39')],{'$or':_[_0x41b6('0x2b')](_0x588291['attributes'],function(_0x11a6eb){var _0x78f6de={};_0x78f6de[_0x11a6eb]={'$like':'%'+_0x4309ea[_0x41b6('0x32')][_0x41b6('0x3a')]+'%'};return _0x78f6de;})});}_0x588291=_[_0x41b6('0x3b')]({},_0x588291,_0x4309ea[_0x41b6('0x3d')]);return _0x100c27[_0x41b6('0x50')](_0x588291);}})['then'](function(_0x2927b0){if(_0x2927b0){_0xae50=_0x2927b0['length'];if(!_0x4309ea[_0x41b6('0x32')][_0x41b6('0x52')](_0x41b6('0x4c'))){_0x588291['limit']=qs[_0x41b6('0x1e')](_0x4309ea[_0x41b6('0x32')][_0x41b6('0x1e')]);_0x588291[_0x41b6('0x20')]=qs[_0x41b6('0x20')](_0x4309ea[_0x41b6('0x32')][_0x41b6('0x20')]);}return _0x100c27[_0x41b6('0x50')](_0x588291);}})[_0x41b6('0x25')](function(_0x12cdd5){if(_0x12cdd5){return _0x12cdd5?{'count':_0xae50,'rows':_0x12cdd5}:null;}})['then'](respondWithResult(_0x540e3a,null))[_0x41b6('0x41')](handleError(_0x540e3a,null));};exports[_0x41b6('0x53')]=function(_0x330dfc,_0x4db5a9,_0x4b3e10){if(_0x330dfc[_0x41b6('0x47')]['id']){delete _0x330dfc[_0x41b6('0x47')]['id'];}return db[_0x41b6('0x2c')]['findOne']({'where':{'id':_0x330dfc['params']['id']}})[_0x41b6('0x25')](handleEntityNotFound(_0x4db5a9,null))['then'](function(_0x44351a){if(_0x44351a){return _0x44351a['setTags'](_0x330dfc[_0x41b6('0x47')][_0x41b6('0x54')]||[]);}return null;})[_0x41b6('0x25')](respondWithResult(_0x4db5a9,null))[_0x41b6('0x41')](handleError(_0x4db5a9,null));}; \ No newline at end of file +var _0x0b46=['then','destroy','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','update','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x0b46,0x12c));var _0x60b4=function(_0x2330a1,_0x4bb8d3){_0x2330a1=_0x2330a1-0x0;var _0x32c0a6=_0x0b46[_0x2330a1];return _0x32c0a6;};'use strict';var emlformat=require(_0x60b4('0x0'));var rimraf=require(_0x60b4('0x1'));var zipdir=require(_0x60b4('0x2'));var jsonpatch=require(_0x60b4('0x3'));var rp=require(_0x60b4('0x4'));var moment=require(_0x60b4('0x5'));var BPromise=require(_0x60b4('0x6'));var Mustache=require(_0x60b4('0x7'));var util=require('util');var path=require(_0x60b4('0x8'));var sox=require(_0x60b4('0x9'));var csv=require('to-csv');var ejs=require(_0x60b4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60b4('0xb'));var squel=require(_0x60b4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60b4('0xd'));var toCsv=require(_0x60b4('0xe'));var querystring=require(_0x60b4('0xf'));var Papa=require(_0x60b4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x60b4('0x11'));var as=require(_0x60b4('0x12'));var hardwareService=require(_0x60b4('0x13'));var logger=require('../../config/logger')(_0x60b4('0x14'));var utils=require(_0x60b4('0x15'));var config=require(_0x60b4('0x16'));var licenseUtil=require(_0x60b4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429f6a,_0x1199a9){_0x1199a9=_0x1199a9||0xcc;return function(_0x473522){if(_0x473522){return _0x429f6a[_0x60b4('0x18')](_0x1199a9);}return _0x429f6a[_0x60b4('0x19')](_0x1199a9)[_0x60b4('0x1a')]();};}function respondWithResult(_0xb9b3aa,_0x362bda){_0x362bda=_0x362bda||0xc8;return function(_0x3fae66){if(_0x3fae66){return _0xb9b3aa['status'](_0x362bda)['json'](_0x3fae66);}};}function respondWithFilteredResult(_0x1d2f9a,_0x48abfd){return function(_0x585a39){if(_0x585a39){var _0x3d80e=typeof _0x48abfd[_0x60b4('0x1b')]==='undefined'&&typeof _0x48abfd['limit']===_0x60b4('0x1c');var _0x2734af=_0x585a39[_0x60b4('0x1d')];var _0x38fcd4=_0x3d80e?0x0:_0x48abfd[_0x60b4('0x1b')];var _0x2207b3=_0x3d80e?_0x585a39[_0x60b4('0x1d')]:_0x48abfd[_0x60b4('0x1b')]+_0x48abfd[_0x60b4('0x1e')];var _0x4998d1;if(_0x2207b3>=_0x2734af){_0x2207b3=_0x2734af;_0x4998d1=0xc8;}else{_0x4998d1=0xce;}_0x1d2f9a[_0x60b4('0x19')](_0x4998d1);return _0x1d2f9a[_0x60b4('0x1f')](_0x60b4('0x20'),_0x38fcd4+'-'+_0x2207b3+'/'+_0x2734af)['json'](_0x585a39);}return null;};}function patchUpdates(_0x49b6ec){return function(_0x214381){try{jsonpatch[_0x60b4('0x21')](_0x214381,_0x49b6ec,!![]);}catch(_0x45d48e){return BPromise[_0x60b4('0x22')](_0x45d48e);}return _0x214381[_0x60b4('0x23')]();};}function saveUpdates(_0x369af3,_0x2febec){return function(_0x19b2ef){if(_0x19b2ef){return _0x19b2ef['update'](_0x369af3)[_0x60b4('0x24')](function(_0x1b31a4){return _0x1b31a4;});}return null;};}function removeEntity(_0x5cd9d8,_0x3de8b8){return function(_0x52e408){if(_0x52e408){return _0x52e408[_0x60b4('0x25')]()[_0x60b4('0x24')](function(){_0x5cd9d8[_0x60b4('0x19')](0xcc)[_0x60b4('0x1a')]();});}};}function handleEntityNotFound(_0x3c9c22,_0x18b5bd){return function(_0x5a2adf){if(!_0x5a2adf){_0x3c9c22[_0x60b4('0x18')](0x194);}return _0x5a2adf;};}function handleError(_0x218026,_0x23488a){_0x23488a=_0x23488a||0x1f4;return function(_0x2d7293){logger[_0x60b4('0x26')](_0x2d7293[_0x60b4('0x27')]);if(_0x2d7293[_0x60b4('0x28')]){delete _0x2d7293[_0x60b4('0x28')];}_0x218026['status'](_0x23488a)[_0x60b4('0x29')](_0x2d7293);};}exports[_0x60b4('0x2a')]=function(_0xc7ab95,_0x7d2b9a){var _0x44c641={},_0x358bbe={},_0x2fc5b5={'count':0x0,'rows':[]};var _0x129ee2=_['map'](db[_0x60b4('0x2b')][_0x60b4('0x2c')],function(_0x3d1809){return{'name':_0x3d1809[_0x60b4('0x2d')],'type':_0x3d1809[_0x60b4('0x2e')]['key']};});_0x358bbe[_0x60b4('0x2f')]=_[_0x60b4('0x30')](_0x129ee2,_0x60b4('0x28'));_0x358bbe['query']=_['keys'](_0xc7ab95[_0x60b4('0x31')]);_0x358bbe[_0x60b4('0x32')]=_['intersection'](_0x358bbe[_0x60b4('0x2f')],_0x358bbe[_0x60b4('0x31')]);_0x44c641['attributes']=_[_0x60b4('0x33')](_0x358bbe[_0x60b4('0x2f')],qs[_0x60b4('0x34')](_0xc7ab95['query'][_0x60b4('0x34')]));_0x44c641[_0x60b4('0x35')]=_0x44c641[_0x60b4('0x35')][_0x60b4('0x36')]?_0x44c641[_0x60b4('0x35')]:_0x358bbe['model'];if(!_0xc7ab95[_0x60b4('0x31')]['hasOwnProperty'](_0x60b4('0x37'))){_0x44c641[_0x60b4('0x1e')]=qs[_0x60b4('0x1e')](_0xc7ab95[_0x60b4('0x31')][_0x60b4('0x1e')]);_0x44c641[_0x60b4('0x1b')]=qs[_0x60b4('0x1b')](_0xc7ab95[_0x60b4('0x31')][_0x60b4('0x1b')]);}_0x44c641[_0x60b4('0x38')]=qs[_0x60b4('0x39')](_0xc7ab95[_0x60b4('0x31')]['sort']);_0x44c641[_0x60b4('0x3a')]=qs[_0x60b4('0x32')](_[_0x60b4('0x3b')](_0xc7ab95[_0x60b4('0x31')],_0x358bbe[_0x60b4('0x32')]),_0x129ee2);if(_0xc7ab95[_0x60b4('0x31')]['filter']){_0x44c641['where']=_[_0x60b4('0x3c')](_0x44c641[_0x60b4('0x3a')],{'$or':_[_0x60b4('0x30')](_0x129ee2,function(_0x2505b7){if(_0x2505b7[_0x60b4('0x2e')]!==_0x60b4('0x3d')){var _0x4a2297={};_0x4a2297[_0x2505b7[_0x60b4('0x28')]]={'$like':'%'+_0xc7ab95[_0x60b4('0x31')][_0x60b4('0x3e')]+'%'};return _0x4a2297;}})});}_0x44c641=_[_0x60b4('0x3c')]({},_0x44c641,_0xc7ab95['options']);var _0x22a50f={'where':_0x44c641[_0x60b4('0x3a')]};return db[_0x60b4('0x2b')][_0x60b4('0x1d')](_0x22a50f)[_0x60b4('0x24')](function(_0x4b7d37){_0x2fc5b5[_0x60b4('0x1d')]=_0x4b7d37;if(_0xc7ab95[_0x60b4('0x31')][_0x60b4('0x3f')]){_0x44c641['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x60b4('0x40')](_0x44c641);})['then'](function(_0x1fe003){_0x2fc5b5[_0x60b4('0x41')]=_0x1fe003;return _0x2fc5b5;})['then'](respondWithFilteredResult(_0x7d2b9a,_0x44c641))[_0x60b4('0x42')](handleError(_0x7d2b9a,null));};exports[_0x60b4('0x43')]=function(_0x50c213,_0x27f0cc){var _0x22a37f={'raw':![],'where':{'id':_0x50c213[_0x60b4('0x44')]['id']}},_0x445998={};_0x445998[_0x60b4('0x2f')]=_['keys'](db[_0x60b4('0x2b')][_0x60b4('0x2c')]);_0x445998[_0x60b4('0x31')]=_[_0x60b4('0x45')](_0x50c213['query']);_0x445998['filters']=_[_0x60b4('0x33')](_0x445998[_0x60b4('0x2f')],_0x445998[_0x60b4('0x31')]);_0x22a37f[_0x60b4('0x35')]=_[_0x60b4('0x33')](_0x445998['model'],qs[_0x60b4('0x34')](_0x50c213['query'][_0x60b4('0x34')]));_0x22a37f['attributes']=_0x22a37f[_0x60b4('0x35')][_0x60b4('0x36')]?_0x22a37f[_0x60b4('0x35')]:_0x445998['model'];if(_0x50c213[_0x60b4('0x31')]['includeAll']){_0x22a37f['include']=[{'all':!![]}];}_0x22a37f=_[_0x60b4('0x3c')]({},_0x22a37f,_0x50c213[_0x60b4('0x46')]);return db['ZendeskConfiguration'][_0x60b4('0x47')](_0x22a37f)[_0x60b4('0x24')](handleEntityNotFound(_0x27f0cc,null))[_0x60b4('0x24')](respondWithResult(_0x27f0cc,null))['catch'](handleError(_0x27f0cc,null));};exports[_0x60b4('0x48')]=function(_0x3b25a9,_0x523325){return db[_0x60b4('0x2b')][_0x60b4('0x48')](_0x3b25a9[_0x60b4('0x49')],{})['then'](respondWithResult(_0x523325,0xc9))[_0x60b4('0x42')](handleError(_0x523325,null));};exports[_0x60b4('0x4a')]=function(_0x2d363f,_0x2c097e){if(_0x2d363f[_0x60b4('0x49')]['id']){delete _0x2d363f['body']['id'];}return db[_0x60b4('0x2b')]['find']({'where':{'id':_0x2d363f[_0x60b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2c097e,null))['then'](saveUpdates(_0x2d363f[_0x60b4('0x49')],null))['then'](respondWithResult(_0x2c097e,null))['catch'](handleError(_0x2c097e,null));};exports[_0x60b4('0x25')]=function(_0x5d3d2a,_0x2a00e1){return db[_0x60b4('0x2b')][_0x60b4('0x47')]({'where':{'id':_0x5d3d2a[_0x60b4('0x44')]['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x2a00e1,null))['then'](removeEntity(_0x2a00e1,null))[_0x60b4('0x42')](handleError(_0x2a00e1,null));};exports[_0x60b4('0x4b')]=function(_0x21a2f0,_0x21e81b,_0x2898ee){var _0x5c38f7={};var _0x405d7d={};var _0x5f1bca;var _0x368e95;return db[_0x60b4('0x2b')][_0x60b4('0x4c')]({'where':{'id':_0x21a2f0['params']['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x21e81b,null))[_0x60b4('0x24')](function(_0x195ad9){if(_0x195ad9){_0x5f1bca=_0x195ad9;_0x405d7d['model']=_['keys'](db[_0x60b4('0x4d')][_0x60b4('0x2c')]);_0x405d7d[_0x60b4('0x31')]=_[_0x60b4('0x45')](_0x21a2f0['query']);_0x405d7d[_0x60b4('0x32')]=_[_0x60b4('0x33')](_0x405d7d[_0x60b4('0x2f')],_0x405d7d['query']);_0x5c38f7[_0x60b4('0x35')]=_[_0x60b4('0x33')](_0x405d7d[_0x60b4('0x2f')],qs['fields'](_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x34')]));_0x5c38f7[_0x60b4('0x35')]=_0x5c38f7['attributes'][_0x60b4('0x36')]?_0x5c38f7[_0x60b4('0x35')]:_0x405d7d[_0x60b4('0x2f')];_0x5c38f7[_0x60b4('0x38')]=qs['sort'](_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x39')]);_0x5c38f7[_0x60b4('0x3a')]=qs['filters'](_[_0x60b4('0x3b')](_0x21a2f0[_0x60b4('0x31')],_0x405d7d[_0x60b4('0x32')]));if(_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x3e')]){_0x5c38f7[_0x60b4('0x3a')]=_[_0x60b4('0x3c')](_0x5c38f7[_0x60b4('0x3a')],{'$or':_['map'](_0x5c38f7['attributes'],function(_0xe52c98){var _0x4e5cbb={};_0x4e5cbb[_0xe52c98]={'$like':'%'+_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x3e')]+'%'};return _0x4e5cbb;})});}_0x5c38f7=_[_0x60b4('0x3c')]({},_0x5c38f7,_0x21a2f0[_0x60b4('0x46')]);return _0x5f1bca[_0x60b4('0x4b')](_0x5c38f7);}})[_0x60b4('0x24')](function(_0x5778cf){if(_0x5778cf){_0x368e95=_0x5778cf[_0x60b4('0x36')];if(!_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x4e')](_0x60b4('0x37'))){_0x5c38f7['limit']=qs[_0x60b4('0x1e')](_0x21a2f0['query'][_0x60b4('0x1e')]);_0x5c38f7[_0x60b4('0x1b')]=qs[_0x60b4('0x1b')](_0x21a2f0[_0x60b4('0x31')][_0x60b4('0x1b')]);}return _0x5f1bca['getFields'](_0x5c38f7);}})[_0x60b4('0x24')](function(_0x5d325f){if(_0x5d325f){return _0x5d325f?{'count':_0x368e95,'rows':_0x5d325f}:null;}})[_0x60b4('0x24')](respondWithResult(_0x21e81b,null))[_0x60b4('0x42')](handleError(_0x21e81b,null));};exports[_0x60b4('0x4f')]=function(_0x221eb1,_0x2d094a,_0x826823){var _0x9c060d={};var _0x4fde0d={};var _0x1eca8d;var _0x8a4f7;return db[_0x60b4('0x2b')][_0x60b4('0x4c')]({'where':{'id':_0x221eb1['params']['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x2d094a,null))['then'](function(_0x597db5){if(_0x597db5){_0x1eca8d=_0x597db5;_0x4fde0d[_0x60b4('0x2f')]=_[_0x60b4('0x45')](db[_0x60b4('0x4d')]['rawAttributes']);_0x4fde0d[_0x60b4('0x31')]=_[_0x60b4('0x45')](_0x221eb1[_0x60b4('0x31')]);_0x4fde0d['filters']=_[_0x60b4('0x33')](_0x4fde0d['model'],_0x4fde0d[_0x60b4('0x31')]);_0x9c060d['attributes']=_[_0x60b4('0x33')](_0x4fde0d[_0x60b4('0x2f')],qs[_0x60b4('0x34')](_0x221eb1['query'][_0x60b4('0x34')]));_0x9c060d['attributes']=_0x9c060d['attributes']['length']?_0x9c060d[_0x60b4('0x35')]:_0x4fde0d[_0x60b4('0x2f')];_0x9c060d[_0x60b4('0x38')]=qs[_0x60b4('0x39')](_0x221eb1[_0x60b4('0x31')][_0x60b4('0x39')]);_0x9c060d[_0x60b4('0x3a')]=qs[_0x60b4('0x32')](_[_0x60b4('0x3b')](_0x221eb1[_0x60b4('0x31')],_0x4fde0d['filters']));if(_0x221eb1['query'][_0x60b4('0x3e')]){_0x9c060d['where']=_[_0x60b4('0x3c')](_0x9c060d['where'],{'$or':_[_0x60b4('0x30')](_0x9c060d['attributes'],function(_0x29c6b7){var _0x39c4ff={};_0x39c4ff[_0x29c6b7]={'$like':'%'+_0x221eb1[_0x60b4('0x31')]['filter']+'%'};return _0x39c4ff;})});}_0x9c060d=_[_0x60b4('0x3c')]({},_0x9c060d,_0x221eb1[_0x60b4('0x46')]);return _0x1eca8d['getSubjects'](_0x9c060d);}})[_0x60b4('0x24')](function(_0x303152){if(_0x303152){_0x8a4f7=_0x303152[_0x60b4('0x36')];if(!_0x221eb1[_0x60b4('0x31')]['hasOwnProperty'](_0x60b4('0x37'))){_0x9c060d[_0x60b4('0x1e')]=qs['limit'](_0x221eb1[_0x60b4('0x31')][_0x60b4('0x1e')]);_0x9c060d['offset']=qs[_0x60b4('0x1b')](_0x221eb1[_0x60b4('0x31')][_0x60b4('0x1b')]);}return _0x1eca8d[_0x60b4('0x4f')](_0x9c060d);}})[_0x60b4('0x24')](function(_0x1db9bf){if(_0x1db9bf){return _0x1db9bf?{'count':_0x8a4f7,'rows':_0x1db9bf}:null;}})['then'](respondWithResult(_0x2d094a,null))['catch'](handleError(_0x2d094a,null));};exports['getDescriptions']=function(_0x3ce2be,_0x4847b3,_0x51cc6b){var _0x590440={};var _0x59f119={};var _0x47fef3;var _0x22f1aa;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3ce2be[_0x60b4('0x44')]['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x4847b3,null))['then'](function(_0x3a2a46){if(_0x3a2a46){_0x47fef3=_0x3a2a46;_0x59f119[_0x60b4('0x2f')]=_[_0x60b4('0x45')](db[_0x60b4('0x4d')][_0x60b4('0x2c')]);_0x59f119['query']=_[_0x60b4('0x45')](_0x3ce2be[_0x60b4('0x31')]);_0x59f119[_0x60b4('0x32')]=_[_0x60b4('0x33')](_0x59f119[_0x60b4('0x2f')],_0x59f119[_0x60b4('0x31')]);_0x590440[_0x60b4('0x35')]=_[_0x60b4('0x33')](_0x59f119[_0x60b4('0x2f')],qs[_0x60b4('0x34')](_0x3ce2be[_0x60b4('0x31')][_0x60b4('0x34')]));_0x590440['attributes']=_0x590440[_0x60b4('0x35')][_0x60b4('0x36')]?_0x590440['attributes']:_0x59f119['model'];_0x590440[_0x60b4('0x38')]=qs[_0x60b4('0x39')](_0x3ce2be[_0x60b4('0x31')][_0x60b4('0x39')]);_0x590440['where']=qs[_0x60b4('0x32')](_[_0x60b4('0x3b')](_0x3ce2be['query'],_0x59f119[_0x60b4('0x32')]));if(_0x3ce2be[_0x60b4('0x31')]['filter']){_0x590440['where']=_['merge'](_0x590440[_0x60b4('0x3a')],{'$or':_[_0x60b4('0x30')](_0x590440['attributes'],function(_0x103f30){var _0x240c56={};_0x240c56[_0x103f30]={'$like':'%'+_0x3ce2be[_0x60b4('0x31')][_0x60b4('0x3e')]+'%'};return _0x240c56;})});}_0x590440=_[_0x60b4('0x3c')]({},_0x590440,_0x3ce2be['options']);return _0x47fef3[_0x60b4('0x50')](_0x590440);}})['then'](function(_0x409646){if(_0x409646){_0x22f1aa=_0x409646[_0x60b4('0x36')];if(!_0x3ce2be['query'][_0x60b4('0x4e')]('nolimit')){_0x590440[_0x60b4('0x1e')]=qs['limit'](_0x3ce2be[_0x60b4('0x31')][_0x60b4('0x1e')]);_0x590440[_0x60b4('0x1b')]=qs['offset'](_0x3ce2be[_0x60b4('0x31')][_0x60b4('0x1b')]);}return _0x47fef3['getDescriptions'](_0x590440);}})[_0x60b4('0x24')](function(_0x9be273){if(_0x9be273){return _0x9be273?{'count':_0x22f1aa,'rows':_0x9be273}:null;}})[_0x60b4('0x24')](respondWithResult(_0x4847b3,null))[_0x60b4('0x42')](handleError(_0x4847b3,null));};exports[_0x60b4('0x51')]=function(_0x1c59b0,_0x26a1ea,_0x24f47a){var _0x296a80={};var _0x18a596={};var _0x18d2fd;var _0x56dc4a;return db[_0x60b4('0x2b')]['findOne']({'where':{'id':_0x1c59b0[_0x60b4('0x44')]['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x26a1ea,null))[_0x60b4('0x24')](function(_0x570785){if(_0x570785){_0x18d2fd=_0x570785;_0x18a596[_0x60b4('0x2f')]=_['keys'](db['Tag'][_0x60b4('0x2c')]);_0x18a596['query']=_[_0x60b4('0x45')](_0x1c59b0[_0x60b4('0x31')]);_0x18a596[_0x60b4('0x32')]=_[_0x60b4('0x33')](_0x18a596[_0x60b4('0x2f')],_0x18a596[_0x60b4('0x31')]);_0x296a80[_0x60b4('0x35')]=_[_0x60b4('0x33')](_0x18a596[_0x60b4('0x2f')],qs[_0x60b4('0x34')](_0x1c59b0[_0x60b4('0x31')][_0x60b4('0x34')]));_0x296a80[_0x60b4('0x35')]=_0x296a80[_0x60b4('0x35')][_0x60b4('0x36')]?_0x296a80[_0x60b4('0x35')]:_0x18a596[_0x60b4('0x2f')];_0x296a80[_0x60b4('0x38')]=qs[_0x60b4('0x39')](_0x1c59b0['query'][_0x60b4('0x39')]);_0x296a80[_0x60b4('0x3a')]=qs[_0x60b4('0x32')](_['pick'](_0x1c59b0[_0x60b4('0x31')],_0x18a596[_0x60b4('0x32')]));if(_0x1c59b0['query']['filter']){_0x296a80['where']=_['merge'](_0x296a80[_0x60b4('0x3a')],{'$or':_[_0x60b4('0x30')](_0x296a80[_0x60b4('0x35')],function(_0x578347){var _0x279fc2={};_0x279fc2[_0x578347]={'$like':'%'+_0x1c59b0['query'][_0x60b4('0x3e')]+'%'};return _0x279fc2;})});}_0x296a80=_[_0x60b4('0x3c')]({},_0x296a80,_0x1c59b0[_0x60b4('0x46')]);return _0x18d2fd[_0x60b4('0x51')](_0x296a80);}})[_0x60b4('0x24')](function(_0x2339f9){if(_0x2339f9){_0x56dc4a=_0x2339f9[_0x60b4('0x36')];if(!_0x1c59b0[_0x60b4('0x31')]['hasOwnProperty'](_0x60b4('0x37'))){_0x296a80['limit']=qs['limit'](_0x1c59b0['query']['limit']);_0x296a80['offset']=qs[_0x60b4('0x1b')](_0x1c59b0['query']['offset']);}return _0x18d2fd[_0x60b4('0x51')](_0x296a80);}})['then'](function(_0x451bf2){if(_0x451bf2){return _0x451bf2?{'count':_0x56dc4a,'rows':_0x451bf2}:null;}})[_0x60b4('0x24')](respondWithResult(_0x26a1ea,null))['catch'](handleError(_0x26a1ea,null));};exports[_0x60b4('0x52')]=function(_0x2d9b9a,_0x13b74a,_0x4bff00){if(_0x2d9b9a[_0x60b4('0x49')]['id']){delete _0x2d9b9a['body']['id'];}return db[_0x60b4('0x2b')][_0x60b4('0x4c')]({'where':{'id':_0x2d9b9a[_0x60b4('0x44')]['id']}})[_0x60b4('0x24')](handleEntityNotFound(_0x13b74a,null))[_0x60b4('0x24')](function(_0x5693a1){if(_0x5693a1){return _0x5693a1[_0x60b4('0x52')](_0x2d9b9a[_0x60b4('0x49')][_0x60b4('0x53')]||[]);}return null;})[_0x60b4('0x24')](respondWithResult(_0x13b74a,null))[_0x60b4('0x42')](handleError(_0x13b74a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b83f9e0..69ff8ba 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 _0x9c00=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0x9c00[_0x5de967];return _0x5b07a3;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x282b=['moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x465f85,_0x5eaca4){var _0x2e8061=function(_0x4e2312){while(--_0x4e2312){_0x465f85['push'](_0x465f85['shift']());}};_0x2e8061(++_0x5eaca4);}(_0x282b,0xec));var _0xb282=function(_0x30cf6d,_0x305a4f){_0x30cf6d=_0x30cf6d-0x0;var _0x56e29c=_0x282b[_0x30cf6d];return _0x56e29c;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var logger=require(_0xb282('0x2'))(_0xb282('0x3'));var moment=require(_0xb282('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb282('0x5'));var rimraf=require('rimraf');var config=require(_0xb282('0x6'));var attributes=require(_0xb282('0x7'));module[_0xb282('0x8')]=function(_0x1dd19b,_0x3cad41){return _0x1dd19b[_0xb282('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index d422ab4..5fce7dc 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 _0x28d0=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x98a2d0,_0x78a6fb){var _0x5ae4f3=function(_0x236c10){while(--_0x236c10){_0x98a2d0['push'](_0x98a2d0['shift']());}};_0x5ae4f3(++_0x78a6fb);}(_0x28d0,0x17c));var _0x028d=function(_0x2fbe06,_0xe7e67e){_0x2fbe06=_0x2fbe06-0x0;var _0x2efc5f=_0x28d0[_0x2fbe06];return _0x2efc5f;};'use strict';var _=require('lodash');var util=require(_0x028d('0x0'));var moment=require(_0x028d('0x1'));var BPromise=require('bluebird');var rs=require(_0x028d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x028d('0x3'))['db'];var utils=require(_0x028d('0x4'));var logger=require(_0x028d('0x5'))(_0x028d('0x6'));var config=require(_0x028d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x028d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d356a,_0x4ea0c8,_0x9317ce){return new BPromise(function(_0x51d953,_0x300816){return client[_0x028d('0x9')](_0x2d356a,_0x9317ce)[_0x028d('0xa')](function(_0x54e6f0){logger[_0x028d('0xb')](_0x028d('0xc'),_0x4ea0c8,_0x028d('0xd'));logger[_0x028d('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4ea0c8,_0x028d('0xd'),JSON[_0x028d('0xf')](_0x54e6f0));if(_0x54e6f0[_0x028d('0x10')]){if(_0x54e6f0[_0x028d('0x10')]['code']===0x1f4){logger[_0x028d('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ea0c8,_0x54e6f0[_0x028d('0x10')][_0x028d('0x11')]);return _0x300816(_0x54e6f0['error']['message']);}logger[_0x028d('0x10')](_0x028d('0xc'),_0x4ea0c8,_0x54e6f0[_0x028d('0x10')][_0x028d('0x11')]);return _0x51d953(_0x54e6f0[_0x028d('0x10')][_0x028d('0x11')]);}else{logger[_0x028d('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ea0c8,_0x028d('0xd'));_0x51d953(_0x54e6f0[_0x028d('0x12')][_0x028d('0x11')]);}})[_0x028d('0x13')](function(_0x2a13be){logger[_0x028d('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ea0c8,_0x2a13be);_0x300816(_0x2a13be);});});} \ No newline at end of file +var _0xa275=['ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error'];(function(_0x56ea6f,_0x15535a){var _0x43ac31=function(_0x1b6d99){while(--_0x1b6d99){_0x56ea6f['push'](_0x56ea6f['shift']());}};_0x43ac31(++_0x15535a);}(_0xa275,0xcc));var _0x5a27=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa275[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5a27('0x0'));var util=require('util');var moment=require(_0x5a27('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a27('0x2'));var db=require(_0x5a27('0x3'))['db'];var utils=require(_0x5a27('0x4'));var logger=require(_0x5a27('0x5'))(_0x5a27('0x6'));var config=require(_0x5a27('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a27('0x8')][_0x5a27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26354a,_0x42371a,_0x26060b){return new BPromise(function(_0xf0d279,_0x56acf7){return client[_0x5a27('0xa')](_0x26354a,_0x26060b)[_0x5a27('0xb')](function(_0xd52fe3){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x42371a,_0x5a27('0xc'));logger[_0x5a27('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42371a,_0x5a27('0xc'),JSON[_0x5a27('0xe')](_0xd52fe3));if(_0xd52fe3['error']){if(_0xd52fe3[_0x5a27('0xf')]['code']===0x1f4){logger[_0x5a27('0xf')](_0x5a27('0x10'),_0x42371a,_0xd52fe3[_0x5a27('0xf')]['message']);return _0x56acf7(_0xd52fe3[_0x5a27('0xf')][_0x5a27('0x11')]);}logger[_0x5a27('0xf')](_0x5a27('0x10'),_0x42371a,_0xd52fe3[_0x5a27('0xf')][_0x5a27('0x11')]);return _0xf0d279(_0xd52fe3[_0x5a27('0xf')][_0x5a27('0x11')]);}else{logger['info'](_0x5a27('0x10'),_0x42371a,_0x5a27('0xc'));_0xf0d279(_0xd52fe3[_0x5a27('0x12')][_0x5a27('0x11')]);}})[_0x5a27('0x13')](function(_0x1fcd4d){logger['error'](_0x5a27('0x10'),_0x42371a,_0x1fcd4d);_0x56acf7(_0x1fcd4d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 52de845..d736a03 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 _0xcf4d=['create','put','delete','/:id','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0xcf4d,0x123));var _0xdcf4=function(_0x2d3830,_0x2e1240){_0x2d3830=_0x2d3830-0x0;var _0x5c1298=_0xcf4d[_0x2d3830];return _0x5c1298;};'use strict';var multer=require(_0xdcf4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdcf4('0x1'));var router=express[_0xdcf4('0x2')]();var fs_extra=require(_0xdcf4('0x3'));var auth=require(_0xdcf4('0x4'));var interaction=require(_0xdcf4('0x5'));var config=require(_0xdcf4('0x6'));var controller=require(_0xdcf4('0x7'));router[_0xdcf4('0x8')]('/',auth[_0xdcf4('0x9')](),controller[_0xdcf4('0xa')]);router[_0xdcf4('0x8')]('/:id',auth[_0xdcf4('0x9')](),controller[_0xdcf4('0xb')]);router[_0xdcf4('0xc')]('/',auth[_0xdcf4('0x9')](),controller[_0xdcf4('0xd')]);router[_0xdcf4('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdcf4('0xf')](_0xdcf4('0x10'),auth[_0xdcf4('0x9')](),controller[_0xdcf4('0x11')]);module[_0xdcf4('0x12')]=router; \ No newline at end of file +var _0x4a65=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4a65,0xd7));var _0x54a6=function(_0x531c45,_0x2fa53a){_0x531c45=_0x531c45-0x0;var _0x5f17e1=_0x4a65[_0x531c45];return _0x5f17e1;};'use strict';var multer=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var path=require(_0x54a6('0x2'));var timeout=require('connect-timeout');var express=require(_0x54a6('0x3'));var router=express[_0x54a6('0x4')]();var fs_extra=require(_0x54a6('0x5'));var auth=require(_0x54a6('0x6'));var interaction=require(_0x54a6('0x7'));var config=require(_0x54a6('0x8'));var controller=require(_0x54a6('0x9'));router[_0x54a6('0xa')]('/',auth['isAuthenticated'](),controller[_0x54a6('0xb')]);router['get'](_0x54a6('0xc'),auth[_0x54a6('0xd')](),controller[_0x54a6('0xe')]);router[_0x54a6('0xf')]('/',auth[_0x54a6('0xd')](),controller[_0x54a6('0x10')]);router[_0x54a6('0x11')](_0x54a6('0xc'),auth[_0x54a6('0xd')](),controller[_0x54a6('0x12')]);router[_0x54a6('0x13')]('/:id',auth[_0x54a6('0xd')](),controller[_0x54a6('0x14')]);module[_0x54a6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index e3b4406..d73af26 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 _0xdce4=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','ENUM','variable'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0xdce4,0xa6));var _0x4dce=function(_0x23346e,_0x4731e1){_0x23346e=_0x23346e-0x0;var _0x3d4e7c=_0xdce4[_0x23346e];return _0x3d4e7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4dce('0x0')]('string',_0x4dce('0x1'),_0x4dce('0x2'),_0x4dce('0x3'),_0x4dce('0x4')),'defaultValue':_0x4dce('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4dce('0x6')]},'keyType':{'type':Sequelize[_0x4dce('0x0')](_0x4dce('0x5'),_0x4dce('0x1'),_0x4dce('0x2'))},'keyContent':{'type':Sequelize[_0x4dce('0x6')]},'idField':{'type':Sequelize[_0x4dce('0x6')]},'nameField':{'type':Sequelize[_0x4dce('0x6')]},'customField':{'type':Sequelize[_0x4dce('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4dce('0x6')]}}; \ No newline at end of file +var _0xb7a5=['customVariable','STRING','variable','BOOLEAN','sequelize','ENUM','string'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb7a5,0x162));var _0x5b7a=function(_0x863c22,_0x3b1903){_0x863c22=_0x863c22-0x0;var _0x362aaa=_0xb7a5[_0x863c22];return _0x362aaa;};'use strict';var Sequelize=require(_0x5b7a('0x0'));module['exports']={'type':{'type':Sequelize[_0x5b7a('0x1')](_0x5b7a('0x2'),'variable',_0x5b7a('0x3'),'keyValue','picklist'),'defaultValue':_0x5b7a('0x2')},'content':{'type':Sequelize[_0x5b7a('0x4')]},'key':{'type':Sequelize[_0x5b7a('0x4')]},'keyType':{'type':Sequelize[_0x5b7a('0x1')](_0x5b7a('0x2'),_0x5b7a('0x5'),_0x5b7a('0x3'))},'keyContent':{'type':Sequelize[_0x5b7a('0x4')]},'idField':{'type':Sequelize[_0x5b7a('0x4')]},'nameField':{'type':Sequelize[_0x5b7a('0x4')]},'customField':{'type':Sequelize[_0x5b7a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5b7a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 5815be6..f48611c 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 _0xcd1a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service'];(function(_0x16b730,_0x5b07a0){var _0x19e94c=function(_0x48085b){while(--_0x48085b){_0x16b730['push'](_0x16b730['shift']());}};_0x19e94c(++_0x5b07a0);}(_0xcd1a,0x115));var _0xacd1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcd1a[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xacd1('0x0'));var rimraf=require(_0xacd1('0x1'));var zipdir=require(_0xacd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xacd1('0x3'));var moment=require(_0xacd1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xacd1('0x5'));var util=require('util');var path=require(_0xacd1('0x6'));var sox=require(_0xacd1('0x7'));var csv=require(_0xacd1('0x8'));var ejs=require(_0xacd1('0x9'));var fs=require('fs');var fs_extra=require(_0xacd1('0xa'));var _=require('lodash');var squel=require(_0xacd1('0xb'));var crypto=require(_0xacd1('0xc'));var jsforce=require(_0xacd1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xacd1('0xe'));var qs=require(_0xacd1('0xf'));var as=require(_0xacd1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacd1('0x11'))(_0xacd1('0x12'));var utils=require(_0xacd1('0x13'));var config=require(_0xacd1('0x14'));var licenseUtil=require(_0xacd1('0x15'));var db=require(_0xacd1('0x16'))['db'];function respondWithStatusCode(_0x2d1324,_0x179886){_0x179886=_0x179886||0xcc;return function(_0x44e7c7){if(_0x44e7c7){return _0x2d1324[_0xacd1('0x17')](_0x179886);}return _0x2d1324[_0xacd1('0x18')](_0x179886)['end']();};}function respondWithResult(_0x35b5d2,_0x2d0025){_0x2d0025=_0x2d0025||0xc8;return function(_0x139f4d){if(_0x139f4d){return _0x35b5d2[_0xacd1('0x18')](_0x2d0025)['json'](_0x139f4d);}};}function respondWithFilteredResult(_0x535285,_0x3c4de5){return function(_0x227279){if(_0x227279){var _0x338166=typeof _0x3c4de5['offset']==='undefined'&&typeof _0x3c4de5['limit']==='undefined';var _0x56d46b=_0x227279[_0xacd1('0x19')];var _0x1efa2c=_0x338166?0x0:_0x3c4de5[_0xacd1('0x1a')];var _0x709a09=_0x338166?_0x227279[_0xacd1('0x19')]:_0x3c4de5['offset']+_0x3c4de5['limit'];var _0x523c92;if(_0x709a09>=_0x56d46b){_0x709a09=_0x56d46b;_0x523c92=0xc8;}else{_0x523c92=0xce;}_0x535285[_0xacd1('0x18')](_0x523c92);return _0x535285[_0xacd1('0x1b')](_0xacd1('0x1c'),_0x1efa2c+'-'+_0x709a09+'/'+_0x56d46b)[_0xacd1('0x1d')](_0x227279);}return null;};}function patchUpdates(_0x373565){return function(_0x3a23f3){try{jsonpatch[_0xacd1('0x1e')](_0x3a23f3,_0x373565,!![]);}catch(_0x2cb9d8){return BPromise[_0xacd1('0x1f')](_0x2cb9d8);}return _0x3a23f3[_0xacd1('0x20')]();};}function saveUpdates(_0x27fc19,_0xc2371f){return function(_0xbfd9bb){if(_0xbfd9bb){return _0xbfd9bb['update'](_0x27fc19)[_0xacd1('0x21')](function(_0x340371){return _0x340371;});}return null;};}function removeEntity(_0x2301f2,_0x52a1d1){return function(_0x40a448){if(_0x40a448){return _0x40a448[_0xacd1('0x22')]()[_0xacd1('0x21')](function(){_0x2301f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f17b9,_0x4e4edb){return function(_0x3d6a1f){if(!_0x3d6a1f){_0x3f17b9['sendStatus'](0x194);}return _0x3d6a1f;};}function handleError(_0x3cf525,_0x12b531){_0x12b531=_0x12b531||0x1f4;return function(_0x45f6ee){logger[_0xacd1('0x23')](_0x45f6ee[_0xacd1('0x24')]);if(_0x45f6ee[_0xacd1('0x25')]){delete _0x45f6ee[_0xacd1('0x25')];}_0x3cf525['status'](_0x12b531)[_0xacd1('0x26')](_0x45f6ee);};}exports['index']=function(_0x5379ee,_0x46f0f4){var _0x4ee97d={},_0xb31f68={},_0x389082={'count':0x0,'rows':[]};var _0x1bd9c8=_[_0xacd1('0x27')](db['ZendeskField']['rawAttributes'],function(_0x3b13fa){return{'name':_0x3b13fa[_0xacd1('0x28')],'type':_0x3b13fa[_0xacd1('0x29')][_0xacd1('0x2a')]};});_0xb31f68['model']=_[_0xacd1('0x27')](_0x1bd9c8,'name');_0xb31f68[_0xacd1('0x2b')]=_[_0xacd1('0x2c')](_0x5379ee['query']);_0xb31f68[_0xacd1('0x2d')]=_[_0xacd1('0x2e')](_0xb31f68[_0xacd1('0x2f')],_0xb31f68['query']);_0x4ee97d[_0xacd1('0x30')]=_[_0xacd1('0x2e')](_0xb31f68[_0xacd1('0x2f')],qs[_0xacd1('0x31')](_0x5379ee[_0xacd1('0x2b')]['fields']));_0x4ee97d[_0xacd1('0x30')]=_0x4ee97d[_0xacd1('0x30')]['length']?_0x4ee97d['attributes']:_0xb31f68['model'];if(!_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x32')](_0xacd1('0x33'))){_0x4ee97d[_0xacd1('0x34')]=qs[_0xacd1('0x34')](_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x34')]);_0x4ee97d[_0xacd1('0x1a')]=qs['offset'](_0x5379ee[_0xacd1('0x2b')]['offset']);}_0x4ee97d['order']=qs[_0xacd1('0x35')](_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x35')]);_0x4ee97d[_0xacd1('0x36')]=qs[_0xacd1('0x2d')](_[_0xacd1('0x37')](_0x5379ee[_0xacd1('0x2b')],_0xb31f68['filters']),_0x1bd9c8);if(_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x38')]){_0x4ee97d[_0xacd1('0x36')]=_[_0xacd1('0x39')](_0x4ee97d[_0xacd1('0x36')],{'$or':_[_0xacd1('0x27')](_0x1bd9c8,function(_0x504297){if(_0x504297[_0xacd1('0x29')]!==_0xacd1('0x3a')){var _0x3ba0da={};_0x3ba0da[_0x504297['name']]={'$like':'%'+_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x38')]+'%'};return _0x3ba0da;}})});}_0x4ee97d=_[_0xacd1('0x39')]({},_0x4ee97d,_0x5379ee[_0xacd1('0x3b')]);var _0x333212={'where':_0x4ee97d[_0xacd1('0x36')]};return db[_0xacd1('0x3c')]['count'](_0x333212)[_0xacd1('0x21')](function(_0x415368){_0x389082['count']=_0x415368;if(_0x5379ee[_0xacd1('0x2b')][_0xacd1('0x3d')]){_0x4ee97d[_0xacd1('0x3e')]=[{'all':!![]}];}return db[_0xacd1('0x3c')][_0xacd1('0x3f')](_0x4ee97d);})[_0xacd1('0x21')](function(_0x37792f){_0x389082[_0xacd1('0x40')]=_0x37792f;return _0x389082;})['then'](respondWithFilteredResult(_0x46f0f4,_0x4ee97d))[_0xacd1('0x41')](handleError(_0x46f0f4,null));};exports[_0xacd1('0x42')]=function(_0x468635,_0x2928ec){var _0xa415b7={'raw':!![],'where':{'id':_0x468635[_0xacd1('0x43')]['id']}},_0x3d6e2e={};_0x3d6e2e[_0xacd1('0x2f')]=_['keys'](db[_0xacd1('0x3c')][_0xacd1('0x44')]);_0x3d6e2e[_0xacd1('0x2b')]=_[_0xacd1('0x2c')](_0x468635[_0xacd1('0x2b')]);_0x3d6e2e[_0xacd1('0x2d')]=_[_0xacd1('0x2e')](_0x3d6e2e[_0xacd1('0x2f')],_0x3d6e2e[_0xacd1('0x2b')]);_0xa415b7[_0xacd1('0x30')]=_[_0xacd1('0x2e')](_0x3d6e2e[_0xacd1('0x2f')],qs['fields'](_0x468635[_0xacd1('0x2b')][_0xacd1('0x31')]));_0xa415b7[_0xacd1('0x30')]=_0xa415b7[_0xacd1('0x30')][_0xacd1('0x45')]?_0xa415b7[_0xacd1('0x30')]:_0x3d6e2e['model'];if(_0x468635['query'][_0xacd1('0x3d')]){_0xa415b7[_0xacd1('0x3e')]=[{'all':!![]}];}_0xa415b7=_[_0xacd1('0x39')]({},_0xa415b7,_0x468635[_0xacd1('0x3b')]);return db['ZendeskField'][_0xacd1('0x46')](_0xa415b7)[_0xacd1('0x21')](handleEntityNotFound(_0x2928ec,null))[_0xacd1('0x21')](respondWithResult(_0x2928ec,null))[_0xacd1('0x41')](handleError(_0x2928ec,null));};exports[_0xacd1('0x47')]=function(_0x341c91,_0x3c4f45){return db['ZendeskField'][_0xacd1('0x47')](_0x341c91[_0xacd1('0x48')],{})[_0xacd1('0x21')](respondWithResult(_0x3c4f45,0xc9))[_0xacd1('0x41')](handleError(_0x3c4f45,null));};exports['update']=function(_0x4826b2,_0x2775d6){if(_0x4826b2[_0xacd1('0x48')]['id']){delete _0x4826b2[_0xacd1('0x48')]['id'];}return db[_0xacd1('0x3c')][_0xacd1('0x46')]({'where':{'id':_0x4826b2['params']['id']}})[_0xacd1('0x21')](handleEntityNotFound(_0x2775d6,null))[_0xacd1('0x21')](saveUpdates(_0x4826b2[_0xacd1('0x48')],null))[_0xacd1('0x21')](respondWithResult(_0x2775d6,null))[_0xacd1('0x41')](handleError(_0x2775d6,null));};exports[_0xacd1('0x22')]=function(_0x5e9e3f,_0x554f99){return db[_0xacd1('0x3c')]['find']({'where':{'id':_0x5e9e3f[_0xacd1('0x43')]['id']}})[_0xacd1('0x21')](handleEntityNotFound(_0x554f99,null))['then'](removeEntity(_0x554f99,null))[_0xacd1('0x41')](handleError(_0x554f99,null));}; \ No newline at end of file +var _0xa9bb=['set','apply','reject','save','update','then','destroy','error','stack','name','map','ZendeskField','rawAttributes','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','count','includeAll','include','findAll','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0xa9bb,0x1a0));var _0xba9b=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa9bb[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xba9b('0x0'));var rimraf=require(_0xba9b('0x1'));var zipdir=require(_0xba9b('0x2'));var jsonpatch=require(_0xba9b('0x3'));var rp=require(_0xba9b('0x4'));var moment=require(_0xba9b('0x5'));var BPromise=require(_0xba9b('0x6'));var Mustache=require(_0xba9b('0x7'));var util=require(_0xba9b('0x8'));var path=require(_0xba9b('0x9'));var sox=require(_0xba9b('0xa'));var csv=require(_0xba9b('0xb'));var ejs=require(_0xba9b('0xc'));var fs=require('fs');var fs_extra=require(_0xba9b('0xd'));var _=require('lodash');var squel=require(_0xba9b('0xe'));var crypto=require('crypto');var jsforce=require(_0xba9b('0xf'));var deskjs=require(_0xba9b('0x10'));var toCsv=require(_0xba9b('0xb'));var querystring=require(_0xba9b('0x11'));var Papa=require(_0xba9b('0x12'));var Redis=require(_0xba9b('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba9b('0x14'));var logger=require(_0xba9b('0x15'))(_0xba9b('0x16'));var utils=require(_0xba9b('0x17'));var config=require(_0xba9b('0x18'));var licenseUtil=require(_0xba9b('0x19'));var db=require(_0xba9b('0x1a'))['db'];function respondWithStatusCode(_0x134e26,_0x4f5541){_0x4f5541=_0x4f5541||0xcc;return function(_0x4dd7f8){if(_0x4dd7f8){return _0x134e26[_0xba9b('0x1b')](_0x4f5541);}return _0x134e26[_0xba9b('0x1c')](_0x4f5541)[_0xba9b('0x1d')]();};}function respondWithResult(_0x4416a1,_0x1c0fb8){_0x1c0fb8=_0x1c0fb8||0xc8;return function(_0x4a6b7f){if(_0x4a6b7f){return _0x4416a1['status'](_0x1c0fb8)[_0xba9b('0x1e')](_0x4a6b7f);}};}function respondWithFilteredResult(_0x5e3d00,_0x36815a){return function(_0x2c93cc){if(_0x2c93cc){var _0x1ddd7c=typeof _0x36815a[_0xba9b('0x1f')]===_0xba9b('0x20')&&typeof _0x36815a[_0xba9b('0x21')]===_0xba9b('0x20');var _0x1d9c44=_0x2c93cc['count'];var _0x411c06=_0x1ddd7c?0x0:_0x36815a[_0xba9b('0x1f')];var _0x1552cf=_0x1ddd7c?_0x2c93cc['count']:_0x36815a[_0xba9b('0x1f')]+_0x36815a['limit'];var _0x399cb8;if(_0x1552cf>=_0x1d9c44){_0x1552cf=_0x1d9c44;_0x399cb8=0xc8;}else{_0x399cb8=0xce;}_0x5e3d00['status'](_0x399cb8);return _0x5e3d00[_0xba9b('0x22')]('Content-Range',_0x411c06+'-'+_0x1552cf+'/'+_0x1d9c44)['json'](_0x2c93cc);}return null;};}function patchUpdates(_0x4d27ff){return function(_0x1943e8){try{jsonpatch[_0xba9b('0x23')](_0x1943e8,_0x4d27ff,!![]);}catch(_0x48f126){return BPromise[_0xba9b('0x24')](_0x48f126);}return _0x1943e8[_0xba9b('0x25')]();};}function saveUpdates(_0x33555e,_0x4d9188){return function(_0x2bfcb3){if(_0x2bfcb3){return _0x2bfcb3[_0xba9b('0x26')](_0x33555e)[_0xba9b('0x27')](function(_0x1d8cfc){return _0x1d8cfc;});}return null;};}function removeEntity(_0x439cd1,_0x3d1c7a){return function(_0x25e37a){if(_0x25e37a){return _0x25e37a[_0xba9b('0x28')]()['then'](function(){_0x439cd1[_0xba9b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1373bb,_0x5cbdc2){return function(_0x283969){if(!_0x283969){_0x1373bb[_0xba9b('0x1b')](0x194);}return _0x283969;};}function handleError(_0x511747,_0x28d305){_0x28d305=_0x28d305||0x1f4;return function(_0x2241d8){logger[_0xba9b('0x29')](_0x2241d8[_0xba9b('0x2a')]);if(_0x2241d8[_0xba9b('0x2b')]){delete _0x2241d8[_0xba9b('0x2b')];}_0x511747['status'](_0x28d305)['send'](_0x2241d8);};}exports['index']=function(_0x324f43,_0x34ea41){var _0x2d3639={},_0x11564b={},_0x22a8b4={'count':0x0,'rows':[]};var _0x2d0898=_[_0xba9b('0x2c')](db[_0xba9b('0x2d')][_0xba9b('0x2e')],function(_0x4221c1){return{'name':_0x4221c1['fieldName'],'type':_0x4221c1['type']['key']};});_0x11564b['model']=_[_0xba9b('0x2c')](_0x2d0898,'name');_0x11564b[_0xba9b('0x2f')]=_['keys'](_0x324f43[_0xba9b('0x2f')]);_0x11564b['filters']=_['intersection'](_0x11564b[_0xba9b('0x30')],_0x11564b['query']);_0x2d3639[_0xba9b('0x31')]=_[_0xba9b('0x32')](_0x11564b[_0xba9b('0x30')],qs[_0xba9b('0x33')](_0x324f43[_0xba9b('0x2f')][_0xba9b('0x33')]));_0x2d3639[_0xba9b('0x31')]=_0x2d3639[_0xba9b('0x31')][_0xba9b('0x34')]?_0x2d3639['attributes']:_0x11564b[_0xba9b('0x30')];if(!_0x324f43[_0xba9b('0x2f')][_0xba9b('0x35')](_0xba9b('0x36'))){_0x2d3639[_0xba9b('0x21')]=qs[_0xba9b('0x21')](_0x324f43['query'][_0xba9b('0x21')]);_0x2d3639[_0xba9b('0x1f')]=qs[_0xba9b('0x1f')](_0x324f43['query'][_0xba9b('0x1f')]);}_0x2d3639[_0xba9b('0x37')]=qs['sort'](_0x324f43[_0xba9b('0x2f')][_0xba9b('0x38')]);_0x2d3639[_0xba9b('0x39')]=qs[_0xba9b('0x3a')](_[_0xba9b('0x3b')](_0x324f43[_0xba9b('0x2f')],_0x11564b['filters']),_0x2d0898);if(_0x324f43[_0xba9b('0x2f')][_0xba9b('0x3c')]){_0x2d3639[_0xba9b('0x39')]=_[_0xba9b('0x3d')](_0x2d3639['where'],{'$or':_[_0xba9b('0x2c')](_0x2d0898,function(_0x142899){if(_0x142899[_0xba9b('0x3e')]!=='VIRTUAL'){var _0x5b07ae={};_0x5b07ae[_0x142899[_0xba9b('0x2b')]]={'$like':'%'+_0x324f43[_0xba9b('0x2f')][_0xba9b('0x3c')]+'%'};return _0x5b07ae;}})});}_0x2d3639=_[_0xba9b('0x3d')]({},_0x2d3639,_0x324f43[_0xba9b('0x3f')]);var _0x16b8e9={'where':_0x2d3639['where']};return db['ZendeskField'][_0xba9b('0x40')](_0x16b8e9)[_0xba9b('0x27')](function(_0x569fb3){_0x22a8b4[_0xba9b('0x40')]=_0x569fb3;if(_0x324f43['query'][_0xba9b('0x41')]){_0x2d3639[_0xba9b('0x42')]=[{'all':!![]}];}return db[_0xba9b('0x2d')][_0xba9b('0x43')](_0x2d3639);})[_0xba9b('0x27')](function(_0x3ff3b9){_0x22a8b4['rows']=_0x3ff3b9;return _0x22a8b4;})[_0xba9b('0x27')](respondWithFilteredResult(_0x34ea41,_0x2d3639))[_0xba9b('0x44')](handleError(_0x34ea41,null));};exports[_0xba9b('0x45')]=function(_0x779977,_0x84f03){var _0x4c041a={'raw':!![],'where':{'id':_0x779977['params']['id']}},_0x253a4f={};_0x253a4f[_0xba9b('0x30')]=_['keys'](db[_0xba9b('0x2d')][_0xba9b('0x2e')]);_0x253a4f['query']=_[_0xba9b('0x46')](_0x779977[_0xba9b('0x2f')]);_0x253a4f[_0xba9b('0x3a')]=_[_0xba9b('0x32')](_0x253a4f[_0xba9b('0x30')],_0x253a4f[_0xba9b('0x2f')]);_0x4c041a[_0xba9b('0x31')]=_[_0xba9b('0x32')](_0x253a4f[_0xba9b('0x30')],qs[_0xba9b('0x33')](_0x779977[_0xba9b('0x2f')][_0xba9b('0x33')]));_0x4c041a[_0xba9b('0x31')]=_0x4c041a[_0xba9b('0x31')][_0xba9b('0x34')]?_0x4c041a['attributes']:_0x253a4f[_0xba9b('0x30')];if(_0x779977[_0xba9b('0x2f')]['includeAll']){_0x4c041a[_0xba9b('0x42')]=[{'all':!![]}];}_0x4c041a=_[_0xba9b('0x3d')]({},_0x4c041a,_0x779977[_0xba9b('0x3f')]);return db[_0xba9b('0x2d')][_0xba9b('0x47')](_0x4c041a)['then'](handleEntityNotFound(_0x84f03,null))[_0xba9b('0x27')](respondWithResult(_0x84f03,null))['catch'](handleError(_0x84f03,null));};exports[_0xba9b('0x48')]=function(_0x7a5a62,_0x11f91b){return db[_0xba9b('0x2d')][_0xba9b('0x48')](_0x7a5a62['body'],{})[_0xba9b('0x27')](respondWithResult(_0x11f91b,0xc9))[_0xba9b('0x44')](handleError(_0x11f91b,null));};exports[_0xba9b('0x26')]=function(_0x11bcd9,_0x250fb1){if(_0x11bcd9['body']['id']){delete _0x11bcd9[_0xba9b('0x49')]['id'];}return db[_0xba9b('0x2d')][_0xba9b('0x47')]({'where':{'id':_0x11bcd9[_0xba9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x250fb1,null))[_0xba9b('0x27')](saveUpdates(_0x11bcd9[_0xba9b('0x49')],null))['then'](respondWithResult(_0x250fb1,null))[_0xba9b('0x44')](handleError(_0x250fb1,null));};exports[_0xba9b('0x28')]=function(_0x3249e6,_0x330866){return db['ZendeskField'][_0xba9b('0x47')]({'where':{'id':_0x3249e6[_0xba9b('0x4a')]['id']}})[_0xba9b('0x27')](handleEntityNotFound(_0x330866,null))['then'](removeEntity(_0x330866,null))['catch'](handleError(_0x330866,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5483536..a4311da 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 _0x8f96=['define','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x462388,_0xb3f752){var _0x1f5daa=function(_0x5ef434){while(--_0x5ef434){_0x462388['push'](_0x462388['shift']());}};_0x1f5daa(++_0xb3f752);}(_0x8f96,0x1b1));var _0x68f9=function(_0x103f0b,_0x37a842){_0x103f0b=_0x103f0b-0x0;var _0x37671b=_0x8f96[_0x103f0b];return _0x37671b;};'use strict';var _=require('lodash');var util=require(_0x68f9('0x0'));var logger=require(_0x68f9('0x1'))(_0x68f9('0x2'));var moment=require('moment');var BPromise=require(_0x68f9('0x3'));var rp=require(_0x68f9('0x4'));var fs=require('fs');var path=require(_0x68f9('0x5'));var rimraf=require(_0x68f9('0x6'));var config=require(_0x68f9('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x68f9('0x8')]=function(_0x37296f,_0x5b1fc3){return _0x37296f[_0x68f9('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x68f9('0xa'),'fields':[_0x68f9('0xb'),_0x68f9('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb968=['ZendeskField','int_zendesk_fields','idField','FieldId','util','api','moment','bluebird','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x37bab4,_0x4fa85e){var _0x336d20=function(_0xdd4ab8){while(--_0xdd4ab8){_0x37bab4['push'](_0x37bab4['shift']());}};_0x336d20(++_0x4fa85e);}(_0xb968,0x1d8));var _0x8b96=function(_0x4490cf,_0x166f71){_0x4490cf=_0x4490cf-0x0;var _0x5b171b=_0xb968[_0x4490cf];return _0x5b171b;};'use strict';var _=require('lodash');var util=require(_0x8b96('0x0'));var logger=require('../../config/logger')(_0x8b96('0x1'));var moment=require(_0x8b96('0x2'));var BPromise=require(_0x8b96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8b96('0x4'));var config=require(_0x8b96('0x5'));var attributes=require(_0x8b96('0x6'));module[_0x8b96('0x7')]=function(_0x378f16,_0x3c6254){return _0x378f16[_0x8b96('0x8')](_0x8b96('0x9'),attributes,{'tableName':_0x8b96('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x8b96('0xb'),_0x8b96('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 7349d81..1c9ac8e 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 _0xd7bc=['../../config/environment','http','request','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0xd7bc,0xf7));var _0xcd7b=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xd7bc[_0x29e35f];return _0x266b74;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd7b('0x0'));var db=require(_0xcd7b('0x1'))['db'];var utils=require(_0xcd7b('0x2'));var logger=require(_0xcd7b('0x3'))(_0xcd7b('0x4'));var config=require(_0xcd7b('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd7b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x21b5ed,_0xdcbd71,_0x365f7f){return new BPromise(function(_0x2ee759,_0x186bf1){return client[_0xcd7b('0x7')](_0x21b5ed,_0x365f7f)['then'](function(_0x555972){logger[_0xcd7b('0x8')]('ZendeskField,\x20%s,\x20%s',_0xdcbd71,_0xcd7b('0x9'));logger['debug'](_0xcd7b('0xa'),_0xdcbd71,'request\x20sent',JSON[_0xcd7b('0xb')](_0x555972));if(_0x555972[_0xcd7b('0xc')]){if(_0x555972['error'][_0xcd7b('0xd')]===0x1f4){logger[_0xcd7b('0xc')](_0xcd7b('0xe'),_0xdcbd71,_0x555972['error'][_0xcd7b('0xf')]);return _0x186bf1(_0x555972[_0xcd7b('0xc')][_0xcd7b('0xf')]);}logger[_0xcd7b('0xc')]('ZendeskField,\x20%s,\x20%s',_0xdcbd71,_0x555972[_0xcd7b('0xc')]['message']);return _0x2ee759(_0x555972['error'][_0xcd7b('0xf')]);}else{logger[_0xcd7b('0x8')]('ZendeskField,\x20%s,\x20%s',_0xdcbd71,_0xcd7b('0x9'));_0x2ee759(_0x555972[_0xcd7b('0x10')][_0xcd7b('0xf')]);}})[_0xcd7b('0x11')](function(_0x532c72){logger['error'](_0xcd7b('0xe'),_0xdcbd71,_0x532c72);_0x186bf1(_0x532c72);});});} \ No newline at end of file +var _0xd158=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s'];(function(_0x47a51d,_0x190a7a){var _0x5a5c17=function(_0x453cc1){while(--_0x453cc1){_0x47a51d['push'](_0x47a51d['shift']());}};_0x5a5c17(++_0x190a7a);}(_0xd158,0x192));var _0x8d15=function(_0x58e156,_0x4b603e){_0x58e156=_0x58e156-0x0;var _0x5551e3=_0xd158[_0x58e156];return _0x5551e3;};'use strict';var _=require(_0x8d15('0x0'));var util=require(_0x8d15('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8d15('0x2'));var fs=require('fs');var Redis=require(_0x8d15('0x3'));var db=require(_0x8d15('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8d15('0x5'));var config=require(_0x8d15('0x6'));var jayson=require(_0x8d15('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea6eb,_0x21f7e6,_0x569758){return new BPromise(function(_0x5bddbc,_0x26da80){return client[_0x8d15('0x8')](_0x2ea6eb,_0x569758)[_0x8d15('0x9')](function(_0x5e1e09){logger[_0x8d15('0xa')]('ZendeskField,\x20%s,\x20%s',_0x21f7e6,_0x8d15('0xb'));logger['debug'](_0x8d15('0xc'),_0x21f7e6,_0x8d15('0xb'),JSON['stringify'](_0x5e1e09));if(_0x5e1e09[_0x8d15('0xd')]){if(_0x5e1e09[_0x8d15('0xd')][_0x8d15('0xe')]===0x1f4){logger['error'](_0x8d15('0xf'),_0x21f7e6,_0x5e1e09[_0x8d15('0xd')][_0x8d15('0x10')]);return _0x26da80(_0x5e1e09[_0x8d15('0xd')]['message']);}logger[_0x8d15('0xd')]('ZendeskField,\x20%s,\x20%s',_0x21f7e6,_0x5e1e09['error'][_0x8d15('0x10')]);return _0x5bddbc(_0x5e1e09['error'][_0x8d15('0x10')]);}else{logger['info'](_0x8d15('0xf'),_0x21f7e6,_0x8d15('0xb'));_0x5bddbc(_0x5e1e09[_0x8d15('0x11')][_0x8d15('0x10')]);}})[_0x8d15('0x12')](function(_0x3954fb){logger[_0x8d15('0xd')](_0x8d15('0xf'),_0x21f7e6,_0x3954fb);_0x26da80(_0x3954fb);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c9449fb..5d50fcd 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 _0x1ff7=['./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x470ad5,_0x2d7f1b){var _0x3b8b64=function(_0x3ffd9f){while(--_0x3ffd9f){_0x470ad5['push'](_0x470ad5['shift']());}};_0x3b8b64(++_0x2d7f1b);}(_0x1ff7,0x9f));var _0x71ff=function(_0x38d02b,_0x447c94){_0x38d02b=_0x38d02b-0x0;var _0x1d9909=_0x1ff7[_0x38d02b];return _0x1d9909;};'use strict';var multer=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var path=require('path');var timeout=require(_0x71ff('0x2'));var express=require(_0x71ff('0x3'));var router=express[_0x71ff('0x4')]();var fs_extra=require(_0x71ff('0x5'));var auth=require(_0x71ff('0x6'));var interaction=require(_0x71ff('0x7'));var config=require(_0x71ff('0x8'));var controller=require(_0x71ff('0x9'));router[_0x71ff('0xa')]('/',auth[_0x71ff('0xb')](),controller[_0x71ff('0xc')]);router[_0x71ff('0xa')](_0x71ff('0xd'),auth['isAuthenticated'](),controller[_0x71ff('0xe')]);router[_0x71ff('0xa')](_0x71ff('0xf'),auth[_0x71ff('0xb')](),controller[_0x71ff('0x10')]);router[_0x71ff('0xa')](_0x71ff('0x11'),auth['isAuthenticated'](),controller[_0x71ff('0x12')]);router[_0x71ff('0x13')]('/',auth[_0x71ff('0xb')](),controller[_0x71ff('0x14')]);router[_0x71ff('0x13')]('/:id/configurations',auth[_0x71ff('0xb')](),controller['addConfiguration']);router['put'](_0x71ff('0xd'),auth[_0x71ff('0xb')](),controller[_0x71ff('0x15')]);router['delete']('/:id',auth[_0x71ff('0xb')](),controller[_0x71ff('0x16')]);module[_0x71ff('0x17')]=router; \ No newline at end of file +var _0x2a90=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0x240dce,_0x2b293c){var _0x371546=function(_0x2d32e5){while(--_0x2d32e5){_0x240dce['push'](_0x240dce['shift']());}};_0x371546(++_0x2b293c);}(_0x2a90,0x78));var _0x02a9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a90[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x02a9('0x0'));var util=require(_0x02a9('0x1'));var path=require(_0x02a9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x02a9('0x3')]();var fs_extra=require(_0x02a9('0x4'));var auth=require(_0x02a9('0x5'));var interaction=require(_0x02a9('0x6'));var config=require(_0x02a9('0x7'));var controller=require(_0x02a9('0x8'));router[_0x02a9('0x9')]('/',auth[_0x02a9('0xa')](),controller[_0x02a9('0xb')]);router[_0x02a9('0x9')](_0x02a9('0xc'),auth[_0x02a9('0xa')](),controller[_0x02a9('0xd')]);router[_0x02a9('0x9')](_0x02a9('0xe'),auth[_0x02a9('0xa')](),controller['getConfigurations']);router[_0x02a9('0x9')](_0x02a9('0xf'),auth[_0x02a9('0xa')](),controller[_0x02a9('0x10')]);router[_0x02a9('0x11')]('/',auth['isAuthenticated'](),controller[_0x02a9('0x12')]);router[_0x02a9('0x11')](_0x02a9('0xe'),auth[_0x02a9('0xa')](),controller[_0x02a9('0x13')]);router[_0x02a9('0x14')](_0x02a9('0xc'),auth[_0x02a9('0xa')](),controller[_0x02a9('0x15')]);router[_0x02a9('0x16')](_0x02a9('0xc'),auth[_0x02a9('0xa')](),controller[_0x02a9('0x17')]);module[_0x02a9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 6e6c574..022b8d2 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 _0xd64b=['STRING','sequelize'];(function(_0x112e9c,_0x3c4766){var _0x5ecb1d=function(_0x1918bf){while(--_0x1918bf){_0x112e9c['push'](_0x112e9c['shift']());}};_0x5ecb1d(++_0x3c4766);}(_0xd64b,0xc1));var _0xbd64=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0xd64b[_0x2842b4];return _0x2b9521;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaa88=['exports','STRING','sequelize'];(function(_0x56d80b,_0x33426e){var _0x2eb15d=function(_0x42a2c3){while(--_0x42a2c3){_0x56d80b['push'](_0x56d80b['shift']());}};_0x2eb15d(++_0x33426e);}(_0xaa88,0x137));var _0x8aa8=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0xaa88[_0x2a3c4d];return _0x55c390;};'use strict';var Sequelize=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]={'name':{'type':Sequelize[_0x8aa8('0x2')]},'description':{'type':Sequelize[_0x8aa8('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8aa8('0x2')]},'clientId':{'type':Sequelize[_0x8aa8('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa8('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa8('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8aa8('0x2')]},'refreshToken':{'type':Sequelize[_0x8aa8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index c09c6f6..d7593da 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 _0xc4ae=['Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','code','host','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','error','name','index','map','ZohoAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','params','length','find','catch','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','refreshToken','clientId','clientSecret','refresh_token','access_token'];(function(_0x42f5d8,_0x3cf60a){var _0x37464b=function(_0x2497e7){while(--_0x2497e7){_0x42f5d8['push'](_0x42f5d8['shift']());}};_0x37464b(++_0x3cf60a);}(_0xc4ae,0x12b));var _0xec4a=function(_0x529781,_0x2c76f5){_0x529781=_0x529781-0x0;var _0x19f16e=_0xc4ae[_0x529781];return _0x19f16e;};'use strict';var emlformat=require(_0xec4a('0x0'));var rimraf=require(_0xec4a('0x1'));var zipdir=require(_0xec4a('0x2'));var jsonpatch=require(_0xec4a('0x3'));var rp=require(_0xec4a('0x4'));var moment=require(_0xec4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xec4a('0x6'));var util=require('util');var path=require(_0xec4a('0x7'));var sox=require(_0xec4a('0x8'));var csv=require(_0xec4a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec4a('0xa'));var _=require('lodash');var squel=require(_0xec4a('0xb'));var crypto=require(_0xec4a('0xc'));var jsforce=require(_0xec4a('0xd'));var deskjs=require(_0xec4a('0xe'));var toCsv=require(_0xec4a('0x9'));var querystring=require(_0xec4a('0xf'));var Papa=require(_0xec4a('0x10'));var Redis=require('ioredis');var authService=require(_0xec4a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xec4a('0x12'));var hardwareService=require(_0xec4a('0x13'));var logger=require(_0xec4a('0x14'))(_0xec4a('0x15'));var utils=require(_0xec4a('0x16'));var config=require(_0xec4a('0x17'));var licenseUtil=require(_0xec4a('0x18'));var db=require(_0xec4a('0x19'))['db'];var integrations=require(_0xec4a('0x1a'));function respondWithStatusCode(_0x422e9a,_0x2f2e79){_0x2f2e79=_0x2f2e79||0xcc;return function(_0x747c68){if(_0x747c68){return _0x422e9a[_0xec4a('0x1b')](_0x2f2e79);}return _0x422e9a['status'](_0x2f2e79)[_0xec4a('0x1c')]();};}function respondWithResult(_0x4f3e7a,_0x393d14){_0x393d14=_0x393d14||0xc8;return function(_0x56f130){if(_0x56f130){return _0x4f3e7a[_0xec4a('0x1d')](_0x393d14)[_0xec4a('0x1e')](_0x56f130);}};}function respondWithFilteredResult(_0x5ab9eb,_0xaf8945){return function(_0x5c40fe){if(_0x5c40fe){var _0x44439f=typeof _0xaf8945[_0xec4a('0x1f')]==='undefined'&&typeof _0xaf8945['limit']===_0xec4a('0x20');var _0xc5ce62=_0x5c40fe[_0xec4a('0x21')];var _0x42430b=_0x44439f?0x0:_0xaf8945['offset'];var _0x4dca59=_0x44439f?_0x5c40fe[_0xec4a('0x21')]:_0xaf8945[_0xec4a('0x1f')]+_0xaf8945[_0xec4a('0x22')];var _0x1a5f8f;if(_0x4dca59>=_0xc5ce62){_0x4dca59=_0xc5ce62;_0x1a5f8f=0xc8;}else{_0x1a5f8f=0xce;}_0x5ab9eb['status'](_0x1a5f8f);return _0x5ab9eb[_0xec4a('0x23')](_0xec4a('0x24'),_0x42430b+'-'+_0x4dca59+'/'+_0xc5ce62)['json'](_0x5c40fe);}return null;};}function patchUpdates(_0x2711a3){return function(_0x496b7a){try{jsonpatch['apply'](_0x496b7a,_0x2711a3,!![]);}catch(_0x53cbed){return BPromise[_0xec4a('0x25')](_0x53cbed);}return _0x496b7a['save']();};}function saveUpdates(_0x434b44,_0x489a0a){return function(_0x4dcad3){if(_0x4dcad3){return _0x4dcad3[_0xec4a('0x26')](_0x434b44)['then'](function(_0x1c81d2){return _0x1c81d2;});}return null;};}function removeEntity(_0xe601e,_0x4790c9){return function(_0x3b99cf){if(_0x3b99cf){return _0x3b99cf[_0xec4a('0x27')]()['then'](function(){_0xe601e[_0xec4a('0x1d')](0xcc)[_0xec4a('0x1c')]();});}};}function handleEntityNotFound(_0x52faf2,_0x3ff24f){return function(_0x56cffc){if(!_0x56cffc){_0x52faf2[_0xec4a('0x1b')](0x194);}return _0x56cffc;};}function handleError(_0xb9e3c1,_0xbcf4cc){_0xbcf4cc=_0xbcf4cc||0x1f4;return function(_0xf7114c){logger[_0xec4a('0x28')](_0xf7114c['stack']);if(_0xf7114c[_0xec4a('0x29')]){delete _0xf7114c[_0xec4a('0x29')];}_0xb9e3c1[_0xec4a('0x1d')](_0xbcf4cc)['send'](_0xf7114c);};}exports[_0xec4a('0x2a')]=function(_0x183699,_0x502571){var _0x4bbdc5={},_0x2761ee={},_0x442ea8={'count':0x0,'rows':[]};var _0x459a7c=_[_0xec4a('0x2b')](db[_0xec4a('0x2c')][_0xec4a('0x2d')],function(_0x2586d6){return{'name':_0x2586d6['fieldName'],'type':_0x2586d6['type'][_0xec4a('0x2e')]};});_0x2761ee[_0xec4a('0x2f')]=_[_0xec4a('0x2b')](_0x459a7c,_0xec4a('0x29'));_0x2761ee[_0xec4a('0x30')]=_[_0xec4a('0x31')](_0x183699[_0xec4a('0x30')]);_0x2761ee['filters']=_[_0xec4a('0x32')](_0x2761ee['model'],_0x2761ee['query']);_0x4bbdc5[_0xec4a('0x33')]=_[_0xec4a('0x32')](_0x2761ee[_0xec4a('0x2f')],qs[_0xec4a('0x34')](_0x183699[_0xec4a('0x30')][_0xec4a('0x34')]));_0x4bbdc5[_0xec4a('0x33')]=_0x4bbdc5[_0xec4a('0x33')]['length']?_0x4bbdc5['attributes']:_0x2761ee['model'];if(!_0x183699['query'][_0xec4a('0x35')](_0xec4a('0x36'))){_0x4bbdc5[_0xec4a('0x22')]=qs[_0xec4a('0x22')](_0x183699['query'][_0xec4a('0x22')]);_0x4bbdc5[_0xec4a('0x1f')]=qs[_0xec4a('0x1f')](_0x183699[_0xec4a('0x30')][_0xec4a('0x1f')]);}_0x4bbdc5['order']=qs[_0xec4a('0x37')](_0x183699[_0xec4a('0x30')][_0xec4a('0x37')]);_0x4bbdc5[_0xec4a('0x38')]=qs[_0xec4a('0x39')](_[_0xec4a('0x3a')](_0x183699['query'],_0x2761ee[_0xec4a('0x39')]),_0x459a7c);if(_0x183699[_0xec4a('0x30')][_0xec4a('0x3b')]){_0x4bbdc5[_0xec4a('0x38')]=_[_0xec4a('0x3c')](_0x4bbdc5[_0xec4a('0x38')],{'$or':_[_0xec4a('0x2b')](_0x459a7c,function(_0x1b151f){if(_0x1b151f[_0xec4a('0x3d')]!==_0xec4a('0x3e')){var _0x19ae24={};_0x19ae24[_0x1b151f[_0xec4a('0x29')]]={'$like':'%'+_0x183699[_0xec4a('0x30')]['filter']+'%'};return _0x19ae24;}})});}_0x4bbdc5=_[_0xec4a('0x3c')]({},_0x4bbdc5,_0x183699[_0xec4a('0x3f')]);var _0x38382c={'where':_0x4bbdc5[_0xec4a('0x38')]};return db[_0xec4a('0x2c')]['count'](_0x38382c)[_0xec4a('0x40')](function(_0x8bd61b){_0x442ea8[_0xec4a('0x21')]=_0x8bd61b;if(_0x183699[_0xec4a('0x30')][_0xec4a('0x41')]){_0x4bbdc5[_0xec4a('0x42')]=[{'all':!![]}];}return db[_0xec4a('0x2c')][_0xec4a('0x43')](_0x4bbdc5);})['then'](function(_0x5eab2c){_0x442ea8[_0xec4a('0x44')]=_0x5eab2c;return _0x442ea8;})[_0xec4a('0x40')](respondWithFilteredResult(_0x502571,_0x4bbdc5))['catch'](handleError(_0x502571,null));};exports['show']=function(_0x2cbadc,_0x4eb1ba){var _0x590950={'raw':![],'where':{'id':_0x2cbadc[_0xec4a('0x45')]['id']}},_0x4d74f8={};_0x4d74f8['model']=_[_0xec4a('0x31')](db[_0xec4a('0x2c')][_0xec4a('0x2d')]);_0x4d74f8['query']=_[_0xec4a('0x31')](_0x2cbadc[_0xec4a('0x30')]);_0x4d74f8['filters']=_[_0xec4a('0x32')](_0x4d74f8[_0xec4a('0x2f')],_0x4d74f8[_0xec4a('0x30')]);_0x590950['attributes']=_['intersection'](_0x4d74f8[_0xec4a('0x2f')],qs[_0xec4a('0x34')](_0x2cbadc['query']['fields']));_0x590950[_0xec4a('0x33')]=_0x590950[_0xec4a('0x33')][_0xec4a('0x46')]?_0x590950['attributes']:_0x4d74f8[_0xec4a('0x2f')];if(_0x2cbadc[_0xec4a('0x30')][_0xec4a('0x41')]){_0x590950[_0xec4a('0x42')]=[{'all':!![]}];}_0x590950=_[_0xec4a('0x3c')]({},_0x590950,_0x2cbadc['options']);return db[_0xec4a('0x2c')][_0xec4a('0x47')](_0x590950)['then'](handleEntityNotFound(_0x4eb1ba,null))[_0xec4a('0x40')](respondWithResult(_0x4eb1ba,null))[_0xec4a('0x48')](handleError(_0x4eb1ba,null));};exports[_0xec4a('0x49')]=function(_0x4c00eb,_0x2a83de){return db['ZohoAccount'][_0xec4a('0x49')](_0x4c00eb['body'],{})['then'](respondWithResult(_0x2a83de,0xc9))['catch'](handleError(_0x2a83de,null));};exports[_0xec4a('0x26')]=function(_0x2c5d62,_0x3f91b1){if(_0x2c5d62[_0xec4a('0x4a')]['id']){delete _0x2c5d62[_0xec4a('0x4a')]['id'];}return db[_0xec4a('0x2c')][_0xec4a('0x47')]({'where':{'id':_0x2c5d62[_0xec4a('0x45')]['id']}})[_0xec4a('0x40')](handleEntityNotFound(_0x3f91b1,null))['then'](saveUpdates(_0x2c5d62[_0xec4a('0x4a')],null))[_0xec4a('0x40')](respondWithResult(_0x3f91b1,null))['catch'](handleError(_0x3f91b1,null));};exports[_0xec4a('0x27')]=function(_0x4e169e,_0xf2f219){return db[_0xec4a('0x2c')][_0xec4a('0x47')]({'where':{'id':_0x4e169e[_0xec4a('0x45')]['id']}})['then'](handleEntityNotFound(_0xf2f219,null))[_0xec4a('0x40')](removeEntity(_0xf2f219,null))[_0xec4a('0x48')](handleError(_0xf2f219,null));};exports[_0xec4a('0x4b')]=function(_0x507739,_0x4ade0b,_0x69d084){var _0xeb94e0={};var _0x4e0825={};var _0x5055df;var _0x4976bd;return db['ZohoAccount'][_0xec4a('0x4c')]({'where':{'id':_0x507739[_0xec4a('0x45')]['id']}})[_0xec4a('0x40')](handleEntityNotFound(_0x4ade0b,null))[_0xec4a('0x40')](function(_0x4df66c){if(_0x4df66c){_0x5055df=_0x4df66c;_0x4e0825[_0xec4a('0x2f')]=_[_0xec4a('0x31')](db['ZohoConfiguration'][_0xec4a('0x2d')]);_0x4e0825[_0xec4a('0x30')]=_['keys'](_0x507739[_0xec4a('0x30')]);_0x4e0825[_0xec4a('0x39')]=_['intersection'](_0x4e0825[_0xec4a('0x2f')],_0x4e0825[_0xec4a('0x30')]);_0xeb94e0['attributes']=_[_0xec4a('0x32')](_0x4e0825[_0xec4a('0x2f')],qs[_0xec4a('0x34')](_0x507739[_0xec4a('0x30')][_0xec4a('0x34')]));_0xeb94e0[_0xec4a('0x33')]=_0xeb94e0[_0xec4a('0x33')][_0xec4a('0x46')]?_0xeb94e0[_0xec4a('0x33')]:_0x4e0825[_0xec4a('0x2f')];_0xeb94e0[_0xec4a('0x4d')]=qs['sort'](_0x507739[_0xec4a('0x30')][_0xec4a('0x37')]);_0xeb94e0[_0xec4a('0x38')]=qs[_0xec4a('0x39')](_[_0xec4a('0x3a')](_0x507739['query'],_0x4e0825['filters']));if(_0x507739[_0xec4a('0x30')][_0xec4a('0x3b')]){_0xeb94e0[_0xec4a('0x38')]=_[_0xec4a('0x3c')](_0xeb94e0[_0xec4a('0x38')],{'$or':_['map'](_0xeb94e0['attributes'],function(_0x580030){var _0x5b34bb={};_0x5b34bb[_0x580030]={'$like':'%'+_0x507739[_0xec4a('0x30')][_0xec4a('0x3b')]+'%'};return _0x5b34bb;})});}_0xeb94e0=_['merge']({},_0xeb94e0,_0x507739[_0xec4a('0x3f')]);return _0x5055df[_0xec4a('0x4b')](_0xeb94e0);}})['then'](function(_0x497df1){if(_0x497df1){_0x4976bd=_0x497df1['length'];if(!_0x507739[_0xec4a('0x30')][_0xec4a('0x35')](_0xec4a('0x36'))){_0xeb94e0['limit']=qs[_0xec4a('0x22')](_0x507739['query']['limit']);_0xeb94e0[_0xec4a('0x1f')]=qs[_0xec4a('0x1f')](_0x507739[_0xec4a('0x30')]['offset']);}return _0x5055df[_0xec4a('0x4b')](_0xeb94e0);}})[_0xec4a('0x40')](function(_0x4abcf8){if(_0x4abcf8){return _0x4abcf8?{'count':_0x4976bd,'rows':_0x4abcf8}:null;}})[_0xec4a('0x40')](respondWithResult(_0x4ade0b,null))['catch'](handleError(_0x4ade0b,null));};exports[_0xec4a('0x4e')]=function(_0x12e21d,_0x3fe4e2,_0x5af7e8){if(_0x12e21d[_0xec4a('0x4a')]['id']){delete _0x12e21d[_0xec4a('0x4a')]['id'];}return db[_0xec4a('0x2c')][_0xec4a('0x4c')]({'where':{'id':_0x12e21d[_0xec4a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fe4e2,null))['then'](function(_0x32b627){if(_0x32b627){_0x12e21d[_0xec4a('0x4a')][_0xec4a('0x4f')]=_0x32b627['id'];_0x12e21d[_0xec4a('0x4a')][_0xec4a('0x50')]=integrations[_0xec4a('0x51')](_0x12e21d[_0xec4a('0x4a')][_0xec4a('0x52')],_0x12e21d[_0xec4a('0x4a')]['type']);_0x12e21d[_0xec4a('0x4a')][_0xec4a('0x53')]=integrations[_0xec4a('0x54')](_0x12e21d[_0xec4a('0x4a')]['channel'],_0x12e21d['body']['type']);return db[_0xec4a('0x55')][_0xec4a('0x49')](_0x12e21d[_0xec4a('0x4a')],{'include':[{'model':db[_0xec4a('0x56')],'as':'Subjects'},{'model':db[_0xec4a('0x56')],'as':'Descriptions'}]});}return null;})[_0xec4a('0x40')](respondWithResult(_0x3fe4e2,null))[_0xec4a('0x48')](handleError(_0x3fe4e2,null));};function getAccessToken(_0x57422b){return new Promise(function(_0x2a7d79,_0x37cccc){var _0x3ca1b7;switch(_0x57422b[_0xec4a('0x57')]){case'US':_0x3ca1b7=_0xec4a('0x58');break;case'AU':_0x3ca1b7=_0xec4a('0x59');break;case'EU':_0x3ca1b7=_0xec4a('0x5a');break;case'IN':_0x3ca1b7=_0xec4a('0x5b');break;case'CN':_0x3ca1b7='https://accounts.zoho.com.cn';break;default:_0x3ca1b7='https://accounts.zoho.eu';break;}var _0x5e7bf7={'method':'POST','uri':_0x3ca1b7+'/oauth/v2/token','qs':{'refresh_token':_0x57422b[_0xec4a('0x5c')],'client_id':_0x57422b[_0xec4a('0x5d')],'client_secret':_0x57422b[_0xec4a('0x5e')],'grant_type':_0xec4a('0x5f')},'json':!![]};return rp(_0x5e7bf7)['then'](function(_0x495ff7){if(_0x495ff7[_0xec4a('0x60')]){_0x2a7d79(_0x495ff7['access_token']);}else{_0x37cccc(_0xec4a('0x61'));}})['catch'](function(_0x561d4c){_0x37cccc(_0x561d4c);});});}exports[_0xec4a('0x62')]=function(_0x21a920,_0x129ada,_0x3f07c1){var _0x23cb6e,_0x158348,_0xb1a580,_0x3a6c5b,_0x3eb412;return db['ZohoAccount'][_0xec4a('0x4c')]({'where':{'id':_0x21a920[_0xec4a('0x45')]['id']},'attributes':['id','host',_0xec4a('0x57'),'clientId','clientSecret','serverUrl',_0xec4a('0x63'),_0xec4a('0x5c')]})[_0xec4a('0x40')](handleEntityNotFound(_0x129ada,null))[_0xec4a('0x40')](function(_0x199c9a){_0x3eb412=_0x199c9a;_0x23cb6e=_0x3eb412[_0xec4a('0x64')];_0x158348=_0x23cb6e===_0xec4a('0x65')?'eu':_0xec4a('0x66');_0xb1a580=_0x3eb412['serverUrl'];var _0x5a64af=_0xb1a580['slice'](-0x1);if(_0x5a64af==='/'||_0x5a64af==='\x5c'||_0x5a64af===':'){_0xb1a580=_0xb1a580[_0xec4a('0x67')](0x0,_0xb1a580[_0xec4a('0x68')](_0x5a64af));}if(!_0x3eb412[_0xec4a('0x5c')]){throw new Error(_0xec4a('0x69'));}return getAccessToken(_0x3eb412);})[_0xec4a('0x40')](function(_0x732148){if(_0x732148){return rp({'method':_0xec4a('0x6a'),'uri':util[_0xec4a('0x6b')](_0xec4a('0x6c'),_0x158348),'qs':{'module':_0xec4a('0x6d')},'headers':{'Authorization':_0xec4a('0x6e')+_0x732148},'json':!![]});}})[_0xec4a('0x40')](function(_0x407983){if(_0x407983){if(_0x407983[_0xec4a('0x6f')]&&_0x407983[_0xec4a('0x6f')][_0xec4a('0x28')]){throw new Error(_0x407983[_0xec4a('0x6f')][_0xec4a('0x28')][_0xec4a('0x70')]);}var _0xbf4119=[];var _0x4745f6=[];var _0x2bb452=['Owner',_0xec4a('0x71'),_0xec4a('0x72'),_0xec4a('0x73'),_0xec4a('0x74'),_0xec4a('0x75'),_0xec4a('0x76'),'Call_Type'];_0x4745f6=_[_0xec4a('0x77')](_0x407983['fields'],function(_0x17fe36){return _0x2bb452['includes'](_0x17fe36[_0xec4a('0x78')]);});for(var _0x5c5121=0x0;_0x5c5121<_0x4745f6['length'];_0x5c5121++){if(_0x4745f6[_0x5c5121][_0xec4a('0x79')]===![]){_0xbf4119[_0xec4a('0x7a')]({'id':_0x4745f6[_0x5c5121]['id'],'name':_0x4745f6[_0x5c5121][_0xec4a('0x7b')],'custom':_0x4745f6[_0x5c5121][_0xec4a('0x7c')],'options':_0x4745f6[_0x5c5121]['data_type']==='picklist'&&_0x4745f6[_0x5c5121][_0xec4a('0x7d')][_0xec4a('0x46')]>-0x1?_[_0xec4a('0x2b')](_0x4745f6[_0x5c5121][_0xec4a('0x7d')],function(_0x560931){return{'name':_0x560931,'value':_0x560931};}):[]});}}return{'count':_0xbf4119[_0xec4a('0x46')],'rows':_0xbf4119};}else{return{'count':0x0,'rows':[]};}})[_0xec4a('0x40')](respondWithResult(_0x129ada,null))[_0xec4a('0x48')](function(_0x2299d3){var _0x2416f0=_0x21a920['query'][_0xec4a('0x7e')]?0x1f4:_0x2299d3[_0xec4a('0x7f')]||0x1f4;logger[_0xec4a('0x28')](_0xec4a('0x80'),_0xec4a('0x62'),_0x2416f0,JSON[_0xec4a('0x81')](_0x2299d3));delete _0x2299d3[_0xec4a('0x29')];if(_0x2416f0===0x191){_0x2416f0=0x190;}_0x129ada[_0xec4a('0x1d')](_0x2416f0)[_0xec4a('0x82')](_0x21a920[_0xec4a('0x30')][_0xec4a('0x7e')]?{'message':_0xec4a('0x83'),'statusCode':_0x2299d3[_0xec4a('0x7f')]}:_0x2299d3);});}; \ No newline at end of file +var _0x13dd=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','json','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','findAll','rows','catch','show','params','length','includeAll','include','create','body','find','destroy','findOne','ZohoConfiguration','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','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','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','code','zoho.eu','com','serverUrl','slice','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Result','Call_Start_Time','remove','includes','system_mandatory','display_label','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xb867a8,_0x926a63){var _0x1e5dcd=function(_0x1f3c72){while(--_0x1f3c72){_0xb867a8['push'](_0xb867a8['shift']());}};_0x1e5dcd(++_0x926a63);}(_0x13dd,0xec));var _0xd13d=function(_0x13a33b,_0x372e4f){_0x13a33b=_0x13a33b-0x0;var _0x2174bf=_0x13dd[_0x13a33b];return _0x2174bf;};'use strict';var emlformat=require(_0xd13d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd13d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd13d('0x2'));var moment=require(_0xd13d('0x3'));var BPromise=require(_0xd13d('0x4'));var Mustache=require(_0xd13d('0x5'));var util=require(_0xd13d('0x6'));var path=require(_0xd13d('0x7'));var sox=require(_0xd13d('0x8'));var csv=require(_0xd13d('0x9'));var ejs=require(_0xd13d('0xa'));var fs=require('fs');var fs_extra=require(_0xd13d('0xb'));var _=require(_0xd13d('0xc'));var squel=require(_0xd13d('0xd'));var crypto=require('crypto');var jsforce=require(_0xd13d('0xe'));var deskjs=require(_0xd13d('0xf'));var toCsv=require(_0xd13d('0x9'));var querystring=require(_0xd13d('0x10'));var Papa=require(_0xd13d('0x11'));var Redis=require(_0xd13d('0x12'));var authService=require(_0xd13d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd13d('0x14'));var logger=require(_0xd13d('0x15'))(_0xd13d('0x16'));var utils=require(_0xd13d('0x17'));var config=require(_0xd13d('0x18'));var licenseUtil=require(_0xd13d('0x19'));var db=require(_0xd13d('0x1a'))['db'];var integrations=require(_0xd13d('0x1b'));function respondWithStatusCode(_0x4063da,_0x5af479){_0x5af479=_0x5af479||0xcc;return function(_0xc98ea2){if(_0xc98ea2){return _0x4063da[_0xd13d('0x1c')](_0x5af479);}return _0x4063da[_0xd13d('0x1d')](_0x5af479)[_0xd13d('0x1e')]();};}function respondWithResult(_0x2793a6,_0x3638e9){_0x3638e9=_0x3638e9||0xc8;return function(_0x300d79){if(_0x300d79){return _0x2793a6[_0xd13d('0x1d')](_0x3638e9)['json'](_0x300d79);}};}function respondWithFilteredResult(_0x1159fd,_0x506277){return function(_0x2bf182){if(_0x2bf182){var _0x50f65d=typeof _0x506277[_0xd13d('0x1f')]==='undefined'&&typeof _0x506277[_0xd13d('0x20')]===_0xd13d('0x21');var _0x2f130c=_0x2bf182[_0xd13d('0x22')];var _0x59550e=_0x50f65d?0x0:_0x506277[_0xd13d('0x1f')];var _0x2c856a=_0x50f65d?_0x2bf182[_0xd13d('0x22')]:_0x506277[_0xd13d('0x1f')]+_0x506277[_0xd13d('0x20')];var _0x1ffbf2;if(_0x2c856a>=_0x2f130c){_0x2c856a=_0x2f130c;_0x1ffbf2=0xc8;}else{_0x1ffbf2=0xce;}_0x1159fd['status'](_0x1ffbf2);return _0x1159fd[_0xd13d('0x23')]('Content-Range',_0x59550e+'-'+_0x2c856a+'/'+_0x2f130c)[_0xd13d('0x24')](_0x2bf182);}return null;};}function patchUpdates(_0x272748){return function(_0x28b737){try{jsonpatch['apply'](_0x28b737,_0x272748,!![]);}catch(_0x17939b){return BPromise[_0xd13d('0x25')](_0x17939b);}return _0x28b737[_0xd13d('0x26')]();};}function saveUpdates(_0x557c12,_0x425070){return function(_0x3e63db){if(_0x3e63db){return _0x3e63db[_0xd13d('0x27')](_0x557c12)[_0xd13d('0x28')](function(_0x64173f){return _0x64173f;});}return null;};}function removeEntity(_0x41f40f,_0x12b61d){return function(_0x71c984){if(_0x71c984){return _0x71c984['destroy']()[_0xd13d('0x28')](function(){_0x41f40f['status'](0xcc)[_0xd13d('0x1e')]();});}};}function handleEntityNotFound(_0x48ac73,_0x2c4b57){return function(_0x2f9e91){if(!_0x2f9e91){_0x48ac73[_0xd13d('0x1c')](0x194);}return _0x2f9e91;};}function handleError(_0x279c5d,_0x118a56){_0x118a56=_0x118a56||0x1f4;return function(_0x404c90){logger[_0xd13d('0x29')](_0x404c90[_0xd13d('0x2a')]);if(_0x404c90[_0xd13d('0x2b')]){delete _0x404c90[_0xd13d('0x2b')];}_0x279c5d[_0xd13d('0x1d')](_0x118a56)[_0xd13d('0x2c')](_0x404c90);};}exports['index']=function(_0x83990e,_0x58919a){var _0x4df63a={},_0x3f20cf={},_0x53c88c={'count':0x0,'rows':[]};var _0x5e9a78=_['map'](db['ZohoAccount'][_0xd13d('0x2d')],function(_0x56b87a){return{'name':_0x56b87a[_0xd13d('0x2e')],'type':_0x56b87a[_0xd13d('0x2f')][_0xd13d('0x30')]};});_0x3f20cf['model']=_[_0xd13d('0x31')](_0x5e9a78,'name');_0x3f20cf[_0xd13d('0x32')]=_[_0xd13d('0x33')](_0x83990e[_0xd13d('0x32')]);_0x3f20cf[_0xd13d('0x34')]=_[_0xd13d('0x35')](_0x3f20cf[_0xd13d('0x36')],_0x3f20cf[_0xd13d('0x32')]);_0x4df63a[_0xd13d('0x37')]=_[_0xd13d('0x35')](_0x3f20cf[_0xd13d('0x36')],qs['fields'](_0x83990e[_0xd13d('0x32')][_0xd13d('0x38')]));_0x4df63a[_0xd13d('0x37')]=_0x4df63a[_0xd13d('0x37')]['length']?_0x4df63a['attributes']:_0x3f20cf['model'];if(!_0x83990e[_0xd13d('0x32')][_0xd13d('0x39')]('nolimit')){_0x4df63a[_0xd13d('0x20')]=qs[_0xd13d('0x20')](_0x83990e['query'][_0xd13d('0x20')]);_0x4df63a[_0xd13d('0x1f')]=qs[_0xd13d('0x1f')](_0x83990e[_0xd13d('0x32')][_0xd13d('0x1f')]);}_0x4df63a[_0xd13d('0x3a')]=qs[_0xd13d('0x3b')](_0x83990e[_0xd13d('0x32')]['sort']);_0x4df63a[_0xd13d('0x3c')]=qs[_0xd13d('0x34')](_[_0xd13d('0x3d')](_0x83990e['query'],_0x3f20cf[_0xd13d('0x34')]),_0x5e9a78);if(_0x83990e[_0xd13d('0x32')][_0xd13d('0x3e')]){_0x4df63a[_0xd13d('0x3c')]=_[_0xd13d('0x3f')](_0x4df63a[_0xd13d('0x3c')],{'$or':_[_0xd13d('0x31')](_0x5e9a78,function(_0x9f33df){if(_0x9f33df[_0xd13d('0x2f')]!==_0xd13d('0x40')){var _0x1b26fa={};_0x1b26fa[_0x9f33df[_0xd13d('0x2b')]]={'$like':'%'+_0x83990e[_0xd13d('0x32')][_0xd13d('0x3e')]+'%'};return _0x1b26fa;}})});}_0x4df63a=_[_0xd13d('0x3f')]({},_0x4df63a,_0x83990e[_0xd13d('0x41')]);var _0x2aabb4={'where':_0x4df63a[_0xd13d('0x3c')]};return db[_0xd13d('0x42')][_0xd13d('0x22')](_0x2aabb4)[_0xd13d('0x28')](function(_0xb0cc63){_0x53c88c[_0xd13d('0x22')]=_0xb0cc63;if(_0x83990e['query']['includeAll']){_0x4df63a['include']=[{'all':!![]}];}return db[_0xd13d('0x42')][_0xd13d('0x43')](_0x4df63a);})[_0xd13d('0x28')](function(_0x24117c){_0x53c88c[_0xd13d('0x44')]=_0x24117c;return _0x53c88c;})[_0xd13d('0x28')](respondWithFilteredResult(_0x58919a,_0x4df63a))[_0xd13d('0x45')](handleError(_0x58919a,null));};exports[_0xd13d('0x46')]=function(_0x51c595,_0xf983bd){var _0x3a5dd4={'raw':![],'where':{'id':_0x51c595[_0xd13d('0x47')]['id']}},_0x337b36={};_0x337b36[_0xd13d('0x36')]=_[_0xd13d('0x33')](db[_0xd13d('0x42')][_0xd13d('0x2d')]);_0x337b36[_0xd13d('0x32')]=_[_0xd13d('0x33')](_0x51c595[_0xd13d('0x32')]);_0x337b36[_0xd13d('0x34')]=_[_0xd13d('0x35')](_0x337b36['model'],_0x337b36[_0xd13d('0x32')]);_0x3a5dd4[_0xd13d('0x37')]=_[_0xd13d('0x35')](_0x337b36[_0xd13d('0x36')],qs[_0xd13d('0x38')](_0x51c595[_0xd13d('0x32')]['fields']));_0x3a5dd4[_0xd13d('0x37')]=_0x3a5dd4['attributes'][_0xd13d('0x48')]?_0x3a5dd4[_0xd13d('0x37')]:_0x337b36[_0xd13d('0x36')];if(_0x51c595['query'][_0xd13d('0x49')]){_0x3a5dd4[_0xd13d('0x4a')]=[{'all':!![]}];}_0x3a5dd4=_[_0xd13d('0x3f')]({},_0x3a5dd4,_0x51c595[_0xd13d('0x41')]);return db['ZohoAccount']['find'](_0x3a5dd4)['then'](handleEntityNotFound(_0xf983bd,null))[_0xd13d('0x28')](respondWithResult(_0xf983bd,null))[_0xd13d('0x45')](handleError(_0xf983bd,null));};exports[_0xd13d('0x4b')]=function(_0x3a0af9,_0x2ce6bb){return db['ZohoAccount']['create'](_0x3a0af9[_0xd13d('0x4c')],{})[_0xd13d('0x28')](respondWithResult(_0x2ce6bb,0xc9))[_0xd13d('0x45')](handleError(_0x2ce6bb,null));};exports[_0xd13d('0x27')]=function(_0x241c1a,_0x5a12e9){if(_0x241c1a['body']['id']){delete _0x241c1a['body']['id'];}return db[_0xd13d('0x42')][_0xd13d('0x4d')]({'where':{'id':_0x241c1a[_0xd13d('0x47')]['id']}})[_0xd13d('0x28')](handleEntityNotFound(_0x5a12e9,null))[_0xd13d('0x28')](saveUpdates(_0x241c1a[_0xd13d('0x4c')],null))[_0xd13d('0x28')](respondWithResult(_0x5a12e9,null))[_0xd13d('0x45')](handleError(_0x5a12e9,null));};exports[_0xd13d('0x4e')]=function(_0x534260,_0x197200){return db[_0xd13d('0x42')][_0xd13d('0x4d')]({'where':{'id':_0x534260['params']['id']}})[_0xd13d('0x28')](handleEntityNotFound(_0x197200,null))[_0xd13d('0x28')](removeEntity(_0x197200,null))['catch'](handleError(_0x197200,null));};exports['getConfigurations']=function(_0x1545fb,_0x1caed1,_0x1dcdb9){var _0x1a830c={};var _0x35f060={};var _0x355048;var _0x28ee29;return db['ZohoAccount'][_0xd13d('0x4f')]({'where':{'id':_0x1545fb['params']['id']}})[_0xd13d('0x28')](handleEntityNotFound(_0x1caed1,null))['then'](function(_0x11a7b4){if(_0x11a7b4){_0x355048=_0x11a7b4;_0x35f060[_0xd13d('0x36')]=_['keys'](db[_0xd13d('0x50')][_0xd13d('0x2d')]);_0x35f060[_0xd13d('0x32')]=_[_0xd13d('0x33')](_0x1545fb[_0xd13d('0x32')]);_0x35f060['filters']=_[_0xd13d('0x35')](_0x35f060[_0xd13d('0x36')],_0x35f060[_0xd13d('0x32')]);_0x1a830c[_0xd13d('0x37')]=_['intersection'](_0x35f060[_0xd13d('0x36')],qs[_0xd13d('0x38')](_0x1545fb[_0xd13d('0x32')][_0xd13d('0x38')]));_0x1a830c[_0xd13d('0x37')]=_0x1a830c[_0xd13d('0x37')][_0xd13d('0x48')]?_0x1a830c[_0xd13d('0x37')]:_0x35f060[_0xd13d('0x36')];_0x1a830c[_0xd13d('0x3a')]=qs['sort'](_0x1545fb[_0xd13d('0x32')][_0xd13d('0x3b')]);_0x1a830c[_0xd13d('0x3c')]=qs[_0xd13d('0x34')](_[_0xd13d('0x3d')](_0x1545fb[_0xd13d('0x32')],_0x35f060[_0xd13d('0x34')]));if(_0x1545fb[_0xd13d('0x32')][_0xd13d('0x3e')]){_0x1a830c[_0xd13d('0x3c')]=_[_0xd13d('0x3f')](_0x1a830c[_0xd13d('0x3c')],{'$or':_[_0xd13d('0x31')](_0x1a830c[_0xd13d('0x37')],function(_0x496fb3){var _0x2adf84={};_0x2adf84[_0x496fb3]={'$like':'%'+_0x1545fb[_0xd13d('0x32')][_0xd13d('0x3e')]+'%'};return _0x2adf84;})});}_0x1a830c=_[_0xd13d('0x3f')]({},_0x1a830c,_0x1545fb['options']);return _0x355048[_0xd13d('0x51')](_0x1a830c);}})[_0xd13d('0x28')](function(_0x49c2af){if(_0x49c2af){_0x28ee29=_0x49c2af['length'];if(!_0x1545fb[_0xd13d('0x32')]['hasOwnProperty'](_0xd13d('0x52'))){_0x1a830c[_0xd13d('0x20')]=qs['limit'](_0x1545fb['query'][_0xd13d('0x20')]);_0x1a830c['offset']=qs[_0xd13d('0x1f')](_0x1545fb[_0xd13d('0x32')][_0xd13d('0x1f')]);}return _0x355048[_0xd13d('0x51')](_0x1a830c);}})[_0xd13d('0x28')](function(_0x4d72b4){if(_0x4d72b4){return _0x4d72b4?{'count':_0x28ee29,'rows':_0x4d72b4}:null;}})['then'](respondWithResult(_0x1caed1,null))['catch'](handleError(_0x1caed1,null));};exports['addConfiguration']=function(_0x44c5ec,_0x51968c,_0x2446ba){if(_0x44c5ec['body']['id']){delete _0x44c5ec['body']['id'];}return db[_0xd13d('0x42')][_0xd13d('0x4f')]({'where':{'id':_0x44c5ec[_0xd13d('0x47')]['id']}})[_0xd13d('0x28')](handleEntityNotFound(_0x51968c,null))[_0xd13d('0x28')](function(_0x29b2f1){if(_0x29b2f1){_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x53')]=_0x29b2f1['id'];_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x54')]=integrations['getSubjects'](_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x55')],_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x2f')]);_0x44c5ec['body'][_0xd13d('0x56')]=integrations['getDescriptions'](_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x55')],_0x44c5ec[_0xd13d('0x4c')][_0xd13d('0x2f')]);return db[_0xd13d('0x50')]['create'](_0x44c5ec[_0xd13d('0x4c')],{'include':[{'model':db[_0xd13d('0x57')],'as':'Subjects'},{'model':db[_0xd13d('0x57')],'as':_0xd13d('0x56')}]});}return null;})[_0xd13d('0x28')](respondWithResult(_0x51968c,null))[_0xd13d('0x45')](handleError(_0x51968c,null));};function getAccessToken(_0x1cd2ee){return new Promise(function(_0x387efa,_0x2919f4){var _0x49d219;switch(_0x1cd2ee[_0xd13d('0x58')]){case'US':_0x49d219=_0xd13d('0x59');break;case'AU':_0x49d219=_0xd13d('0x5a');break;case'EU':_0x49d219=_0xd13d('0x5b');break;case'IN':_0x49d219=_0xd13d('0x5c');break;case'CN':_0x49d219=_0xd13d('0x5d');break;default:_0x49d219=_0xd13d('0x5b');break;}var _0x1c2217={'method':_0xd13d('0x5e'),'uri':_0x49d219+_0xd13d('0x5f'),'qs':{'refresh_token':_0x1cd2ee[_0xd13d('0x60')],'client_id':_0x1cd2ee['clientId'],'client_secret':_0x1cd2ee[_0xd13d('0x61')],'grant_type':_0xd13d('0x62')},'json':!![]};return rp(_0x1c2217)[_0xd13d('0x28')](function(_0x5d6b7b){if(_0x5d6b7b[_0xd13d('0x63')]){_0x387efa(_0x5d6b7b[_0xd13d('0x63')]);}else{_0x2919f4(_0xd13d('0x64'));}})[_0xd13d('0x45')](function(_0x3513dc){_0x2919f4(_0x3513dc);});});}exports[_0xd13d('0x65')]=function(_0x285d6d,_0xd21714,_0xd04fff){var _0x890663,_0x604b66,_0x58dd91,_0x817648,_0x1cc06e;return db[_0xd13d('0x42')][_0xd13d('0x4f')]({'where':{'id':_0x285d6d['params']['id']},'attributes':['id',_0xd13d('0x66'),_0xd13d('0x58'),_0xd13d('0x67'),_0xd13d('0x61'),'serverUrl',_0xd13d('0x68'),_0xd13d('0x60')]})[_0xd13d('0x28')](handleEntityNotFound(_0xd21714,null))[_0xd13d('0x28')](function(_0x263820){_0x1cc06e=_0x263820;_0x890663=_0x1cc06e[_0xd13d('0x66')];_0x604b66=_0x890663===_0xd13d('0x69')?'eu':_0xd13d('0x6a');_0x58dd91=_0x1cc06e[_0xd13d('0x6b')];var _0x55f8ca=_0x58dd91[_0xd13d('0x6c')](-0x1);if(_0x55f8ca==='/'||_0x55f8ca==='\x5c'||_0x55f8ca===':'){_0x58dd91=_0x58dd91['substring'](0x0,_0x58dd91['lastIndexOf'](_0x55f8ca));}if(!_0x1cc06e[_0xd13d('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1cc06e);})['then'](function(_0x53f16d){if(_0x53f16d){return rp({'method':'GET','uri':util[_0xd13d('0x6d')](_0xd13d('0x6e'),_0x604b66),'qs':{'module':'Calls'},'headers':{'Authorization':_0xd13d('0x6f')+_0x53f16d},'json':!![]});}})[_0xd13d('0x28')](function(_0x144e96){if(_0x144e96){if(_0x144e96[_0xd13d('0x70')]&&_0x144e96['response'][_0xd13d('0x29')]){throw new Error(_0x144e96[_0xd13d('0x70')][_0xd13d('0x29')][_0xd13d('0x71')]);}var _0x110289=[];var _0x2bb4c3=[];var _0x2f8a9f=[_0xd13d('0x72'),_0xd13d('0x73'),'Description','WhoId','Call_Duration',_0xd13d('0x74'),_0xd13d('0x75'),'Call_Type'];_0x2bb4c3=_[_0xd13d('0x76')](_0x144e96['fields'],function(_0x3a7cff){return _0x2f8a9f[_0xd13d('0x77')](_0x3a7cff['api_name']);});for(var _0x206de7=0x0;_0x206de7<_0x2bb4c3[_0xd13d('0x48')];_0x206de7++){if(_0x2bb4c3[_0x206de7][_0xd13d('0x78')]===![]){_0x110289['push']({'id':_0x2bb4c3[_0x206de7]['id'],'name':_0x2bb4c3[_0x206de7][_0xd13d('0x79')],'custom':_0x2bb4c3[_0x206de7]['custom_field'],'options':_0x2bb4c3[_0x206de7]['data_type']==='picklist'&&_0x2bb4c3[_0x206de7][_0xd13d('0x7a')][_0xd13d('0x48')]>-0x1?_['map'](_0x2bb4c3[_0x206de7][_0xd13d('0x7a')],function(_0x5c1d44){return{'name':_0x5c1d44,'value':_0x5c1d44};}):[]});}}return{'count':_0x110289[_0xd13d('0x48')],'rows':_0x110289};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xd21714,null))[_0xd13d('0x45')](function(_0x18b913){var _0x5c8a05=_0x285d6d['query'][_0xd13d('0x7b')]?0x1f4:_0x18b913[_0xd13d('0x7c')]||0x1f4;logger[_0xd13d('0x29')](_0xd13d('0x7d'),'getFields',_0x5c8a05,JSON[_0xd13d('0x7e')](_0x18b913));delete _0x18b913[_0xd13d('0x2b')];if(_0x5c8a05===0x191){_0x5c8a05=0x190;}_0xd21714[_0xd13d('0x1d')](_0x5c8a05)[_0xd13d('0x2c')](_0x285d6d[_0xd13d('0x32')]['test']?{'message':_0xd13d('0x7f'),'statusCode':_0x18b913['statusCode']}:_0x18b913);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 761d93d..9e83657 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 _0xa77c=['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','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','authorization_code','lodash','util','api','moment','bluebird','request-promise','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf'];(function(_0x50ae91,_0x5de6f1){var _0x3934ad=function(_0x5ac578){while(--_0x5ac578){_0x50ae91['push'](_0x50ae91['shift']());}};_0x3934ad(++_0x5de6f1);}(_0xa77c,0x112));var _0xca77=function(_0x56ed90,_0x17d67d){_0x56ed90=_0x56ed90-0x0;var _0x42a0fa=_0xa77c[_0x56ed90];return _0x42a0fa;};'use strict';var _=require(_0xca77('0x0'));var util=require(_0xca77('0x1'));var logger=require('../../config/logger')(_0xca77('0x2'));var moment=require(_0xca77('0x3'));var BPromise=require(_0xca77('0x4'));var rp=require(_0xca77('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca77('0x6'));var integrations=require(_0xca77('0x7'));module[_0xca77('0x8')]=function(_0x5da321,_0x2b1b9a){return _0x5da321[_0xca77('0x9')]('ZohoAccount',attributes,{'tableName':_0xca77('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5f5663,_0x6d395c,_0x526298){if(_0x5f5663[_0xca77('0xb')]('zone')||_0x5f5663['changed'](_0xca77('0xc'))||_0x5f5663['changed'](_0xca77('0xd'))||_0x5f5663['changed'](_0xca77('0xe'))||_0x5f5663['changed'](_0xca77('0xf'))||_0x5f5663[_0xca77('0xb')](_0xca77('0x10'))){var _0x2993ef,_0x363be8;_0x2993ef=_0x5f5663[_0xca77('0xc')];var _0x2dd1b9=_0x2993ef[_0xca77('0x11')](-0x1);if(_0x2dd1b9==='/'||_0x2dd1b9==='\x5c'||_0x2dd1b9===':'){_0x2993ef=_0x2993ef[_0xca77('0x12')](0x0,_0x2993ef[_0xca77('0x13')](_0x2dd1b9));}switch(_0x5f5663[_0xca77('0x14')]){case'US':_0x363be8=_0xca77('0x15');break;case'AU':_0x363be8=_0xca77('0x16');break;case'IN':_0x363be8=_0xca77('0x17');break;case'CN':_0x363be8=_0xca77('0x18');break;default:_0x363be8=_0xca77('0x19');break;}var _0x433a05={'method':_0xca77('0x1a'),'uri':_0x363be8+_0xca77('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x5f5663[_0xca77('0xd')],'client_secret':_0x5f5663['clientSecret'],'redirect_uri':_0x5f5663[_0xca77('0xc')],'code':_0x5f5663[_0xca77('0xf')]},'headers':{'Content-Type':_0xca77('0x1c')}};return rp(_0x433a05)[_0xca77('0x1d')](function(_0xab404e){var _0x11f85d=JSON[_0xca77('0x1e')](_0xab404e);if(_0x11f85d[_0xca77('0x1f')]){_0x5f5663[_0xca77('0x20')]=_0x11f85d[_0xca77('0x1f')];logger[_0xca77('0x21')](util[_0xca77('0x22')](_0xca77('0x23'),_0x5f5663[_0xca77('0x24')],_0x5f5663['id']));}else{logger[_0xca77('0x25')](util[_0xca77('0x22')](_0xca77('0x26'),_0x5f5663[_0xca77('0x24')],_0x5f5663['id']),util['inspect'](_0x11f85d,{'showHidden':![],'depth':null}));}return _0x526298(null,_0x6d395c);})[_0xca77('0x27')](function(_0x513bd8){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5f5663[_0xca77('0x24')],_0x5f5663['id']),util[_0xca77('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x526298(_0x513bd8);});}else{return _0x526298(null,_0x6d395c);}},'beforeUpdate':function(_0x6c27e4,_0x1d8f31,_0x2cf6e4){if(_0x6c27e4[_0xca77('0xb')]('zone')||_0x6c27e4[_0xca77('0xb')](_0xca77('0xc'))||_0x6c27e4['changed'](_0xca77('0xd'))||_0x6c27e4[_0xca77('0xb')](_0xca77('0xe'))||_0x6c27e4[_0xca77('0xb')](_0xca77('0xf'))||_0x6c27e4[_0xca77('0xb')]('host')){var _0x32eba8,_0x12c3c7;_0x32eba8=_0x6c27e4['serverUrl'];var _0x1b87e7=_0x32eba8[_0xca77('0x11')](-0x1);if(_0x1b87e7==='/'||_0x1b87e7==='\x5c'||_0x1b87e7===':'){_0x32eba8=_0x32eba8[_0xca77('0x12')](0x0,_0x32eba8['lastIndexOf'](_0x1b87e7));}switch(_0x6c27e4[_0xca77('0x14')]){case'US':_0x12c3c7=_0xca77('0x15');break;case'AU':_0x12c3c7='https://accounts.zoho.com.au';break;case'IN':_0x12c3c7='https://accounts.zoho.in';break;case'CN':_0x12c3c7=_0xca77('0x18');break;default:_0x12c3c7='https://accounts.zoho.eu';break;}var _0x2ed879={'method':_0xca77('0x1a'),'uri':_0x12c3c7+'/oauth/v2/token','form':{'grant_type':_0xca77('0x29'),'client_id':_0x6c27e4['clientId'],'client_secret':_0x6c27e4[_0xca77('0xe')],'redirect_uri':_0x6c27e4[_0xca77('0xc')],'code':_0x6c27e4[_0xca77('0xf')]},'headers':{'Content-Type':_0xca77('0x1c')}};return rp(_0x2ed879)[_0xca77('0x1d')](function(_0x50d03b){var _0x5d2275=JSON[_0xca77('0x1e')](_0x50d03b);if(_0x5d2275[_0xca77('0x1f')]){_0x6c27e4[_0xca77('0x20')]=_0x5d2275[_0xca77('0x1f')];logger['info'](util[_0xca77('0x22')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6c27e4[_0xca77('0x24')],_0x6c27e4['id']));}else{logger[_0xca77('0x25')](util[_0xca77('0x22')](_0xca77('0x26'),_0x6c27e4['name'],_0x6c27e4['id']),util[_0xca77('0x28')](_0x5d2275,{'showHidden':![],'depth':null}));}return _0x2cf6e4(null,_0x1d8f31);})[_0xca77('0x27')](function(_0x38b52f){logger['error'](util[_0xca77('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x6c27e4[_0xca77('0x24')],_0x6c27e4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2cf6e4(_0x38b52f);});}else{return _0x2cf6e4(null,_0x1d8f31);}}}});}; \ No newline at end of file +var _0x9f63=['host','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','then','refreshToken','refresh_token','info','error','format','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','lastIndexOf','https://accounts.zoho.com.cn','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','changed','serverUrl','clientId','code'];(function(_0x8de75b,_0x3994b3){var _0x1c4f90=function(_0x13c392){while(--_0x13c392){_0x8de75b['push'](_0x8de75b['shift']());}};_0x1c4f90(++_0x3994b3);}(_0x9f63,0x161));var _0x39f6=function(_0x5bf556,_0x53a154){_0x5bf556=_0x5bf556-0x0;var _0x46ce42=_0x9f63[_0x5bf556];return _0x46ce42;};'use strict';var _=require(_0x39f6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x39f6('0x1'));var moment=require(_0x39f6('0x2'));var BPromise=require(_0x39f6('0x3'));var rp=require(_0x39f6('0x4'));var fs=require('fs');var path=require(_0x39f6('0x5'));var rimraf=require(_0x39f6('0x6'));var config=require(_0x39f6('0x7'));var attributes=require(_0x39f6('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x39f6('0x9')]=function(_0x3fc69f,_0x3856f1){return _0x3fc69f[_0x39f6('0xa')](_0x39f6('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2121e1,_0x3e7cd1,_0x1593bf){if(_0x2121e1[_0x39f6('0xc')]('zone')||_0x2121e1[_0x39f6('0xc')](_0x39f6('0xd'))||_0x2121e1[_0x39f6('0xc')](_0x39f6('0xe'))||_0x2121e1[_0x39f6('0xc')]('clientSecret')||_0x2121e1[_0x39f6('0xc')](_0x39f6('0xf'))||_0x2121e1[_0x39f6('0xc')](_0x39f6('0x10'))){var _0x59b66a,_0x5d51fc;_0x59b66a=_0x2121e1['serverUrl'];var _0x3f75c9=_0x59b66a['slice'](-0x1);if(_0x3f75c9==='/'||_0x3f75c9==='\x5c'||_0x3f75c9===':'){_0x59b66a=_0x59b66a[_0x39f6('0x11')](0x0,_0x59b66a['lastIndexOf'](_0x3f75c9));}switch(_0x2121e1[_0x39f6('0x12')]){case'US':_0x5d51fc=_0x39f6('0x13');break;case'AU':_0x5d51fc=_0x39f6('0x14');break;case'IN':_0x5d51fc=_0x39f6('0x15');break;case'CN':_0x5d51fc='https://accounts.zoho.com.cn';break;default:_0x5d51fc=_0x39f6('0x16');break;}var _0x36a6ac={'method':_0x39f6('0x17'),'uri':_0x5d51fc+_0x39f6('0x18'),'form':{'grant_type':_0x39f6('0x19'),'client_id':_0x2121e1[_0x39f6('0xe')],'client_secret':_0x2121e1[_0x39f6('0x1a')],'redirect_uri':_0x2121e1[_0x39f6('0xd')],'code':_0x2121e1['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x36a6ac)[_0x39f6('0x1b')](function(_0x4773d4){var _0x692d8f=JSON['parse'](_0x4773d4);if(_0x692d8f['refresh_token']){_0x2121e1[_0x39f6('0x1c')]=_0x692d8f[_0x39f6('0x1d')];logger[_0x39f6('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2121e1['name'],_0x2121e1['id']));}else{logger[_0x39f6('0x1f')](util[_0x39f6('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2121e1[_0x39f6('0x21')],_0x2121e1['id']),util[_0x39f6('0x22')](_0x692d8f,{'showHidden':![],'depth':null}));}return _0x1593bf(null,_0x3e7cd1);})[_0x39f6('0x23')](function(_0x35e9e6){logger['error'](util[_0x39f6('0x20')](_0x39f6('0x24'),_0x2121e1['name'],_0x2121e1['id']),util[_0x39f6('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x1593bf(_0x35e9e6);});}else{return _0x1593bf(null,_0x3e7cd1);}},'beforeUpdate':function(_0x32f2e3,_0x453ed4,_0x24d6a6){if(_0x32f2e3['changed'](_0x39f6('0x12'))||_0x32f2e3['changed'](_0x39f6('0xd'))||_0x32f2e3['changed'](_0x39f6('0xe'))||_0x32f2e3[_0x39f6('0xc')]('clientSecret')||_0x32f2e3[_0x39f6('0xc')]('code')||_0x32f2e3[_0x39f6('0xc')](_0x39f6('0x10'))){var _0x40d5b5,_0x1794b1;_0x40d5b5=_0x32f2e3[_0x39f6('0xd')];var _0x56bc08=_0x40d5b5[_0x39f6('0x25')](-0x1);if(_0x56bc08==='/'||_0x56bc08==='\x5c'||_0x56bc08===':'){_0x40d5b5=_0x40d5b5[_0x39f6('0x11')](0x0,_0x40d5b5[_0x39f6('0x26')](_0x56bc08));}switch(_0x32f2e3[_0x39f6('0x12')]){case'US':_0x1794b1=_0x39f6('0x13');break;case'AU':_0x1794b1=_0x39f6('0x14');break;case'IN':_0x1794b1=_0x39f6('0x15');break;case'CN':_0x1794b1=_0x39f6('0x27');break;default:_0x1794b1=_0x39f6('0x16');break;}var _0x4e3768={'method':'POST','uri':_0x1794b1+_0x39f6('0x18'),'form':{'grant_type':_0x39f6('0x19'),'client_id':_0x32f2e3[_0x39f6('0xe')],'client_secret':_0x32f2e3[_0x39f6('0x1a')],'redirect_uri':_0x32f2e3[_0x39f6('0xd')],'code':_0x32f2e3[_0x39f6('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4e3768)[_0x39f6('0x1b')](function(_0x4bf5b7){var _0x4183b1=JSON['parse'](_0x4bf5b7);if(_0x4183b1['refresh_token']){_0x32f2e3['refreshToken']=_0x4183b1[_0x39f6('0x1d')];logger[_0x39f6('0x1e')](util[_0x39f6('0x20')](_0x39f6('0x28'),_0x32f2e3[_0x39f6('0x21')],_0x32f2e3['id']));}else{logger[_0x39f6('0x1f')](util[_0x39f6('0x20')](_0x39f6('0x24'),_0x32f2e3['name'],_0x32f2e3['id']),util['inspect'](_0x4183b1,{'showHidden':![],'depth':null}));}return _0x24d6a6(null,_0x453ed4);})[_0x39f6('0x23')](function(_0x256380){logger[_0x39f6('0x1f')](util[_0x39f6('0x20')](_0x39f6('0x24'),_0x32f2e3[_0x39f6('0x21')],_0x32f2e3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x24d6a6(_0x256380);});}else{return _0x24d6a6(null,_0x453ed4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index c7a8cdc..93bab24 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 _0xc6c0=['map','ShowZohoAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x10c257,_0x4d38a7){var _0x3c5e10=function(_0x469ea2){while(--_0x469ea2){_0x10c257['push'](_0x10c257['shift']());}};_0x3c5e10(++_0x4d38a7);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0xc6c0[_0x511b76];return _0x5424ff;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var moment=require(_0x0c6c('0x1'));var BPromise=require(_0x0c6c('0x2'));var rs=require(_0x0c6c('0x3'));var fs=require('fs');var Redis=require(_0x0c6c('0x4'));var db=require(_0x0c6c('0x5'))['db'];var utils=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));var config=require(_0x0c6c('0x9'));var jayson=require(_0x0c6c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1791cb,_0x223b4f,_0x51208d){return new BPromise(function(_0x2e0cd9,_0x15c862){return client[_0x0c6c('0xb')](_0x1791cb,_0x51208d)[_0x0c6c('0xc')](function(_0x317bcf){logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));logger[_0x0c6c('0x10')](_0x0c6c('0x11'),_0x223b4f,_0x0c6c('0xf'),JSON[_0x0c6c('0x12')](_0x317bcf));if(_0x317bcf['error']){if(_0x317bcf[_0x0c6c('0x13')]['code']===0x1f4){logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x15c862(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x2e0cd9(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}else{logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));_0x2e0cd9(_0x317bcf[_0x0c6c('0x15')]['message']);}})[_0x0c6c('0x16')](function(_0x527ade){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x223b4f,_0x527ade);_0x15c862(_0x527ade);});});}exports[_0x0c6c('0x17')]=function(_0x530333){var _0x9463e8=this;return new Promise(function(_0x50be43,_0x316dbe){return db[_0x0c6c('0x18')][_0x0c6c('0x19')]({'raw':_0x530333[_0x0c6c('0x1a')]?_0x530333['options'][_0x0c6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1c')]||null:null,'attributes':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1d')]||null:null,'limit':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')]['limit']||null:null,'include':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1e')]?_['map'](_0x530333[_0x0c6c('0x1a')]['include'],function(_0x76992){return{'model':db[_0x76992[_0x0c6c('0x1f')]],'as':_0x76992['as'],'attributes':_0x76992[_0x0c6c('0x1d')],'include':_0x76992['include']?_[_0x0c6c('0x20')](_0x76992[_0x0c6c('0x1e')],function(_0x200a47){return{'model':db[_0x200a47[_0x0c6c('0x1f')]],'as':_0x200a47['as'],'attributes':_0x200a47[_0x0c6c('0x1d')],'include':_0x200a47[_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x200a47[_0x0c6c('0x1e')],function(_0x194637){return{'model':db[_0x194637[_0x0c6c('0x1f')]],'as':_0x194637['as'],'attributes':_0x194637['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c6c('0xc')](function(_0x557046){logger[_0x0c6c('0xd')]('GetZohoAccount',_0x530333);logger[_0x0c6c('0x10')](_0x0c6c('0x17'),_0x530333,JSON[_0x0c6c('0x12')](_0x557046));_0x50be43(_0x557046);})[_0x0c6c('0x16')](function(_0x2cbfc7){logger[_0x0c6c('0x13')](_0x0c6c('0x17'),_0x2cbfc7[_0x0c6c('0x14')],_0x530333);_0x316dbe(_0x9463e8['error'](0x1f4,_0x2cbfc7[_0x0c6c('0x14')]));});});};exports[_0x0c6c('0x21')]=function(_0x5ec5bc){var _0x40d708=this;return new Promise(function(_0x556dad,_0x37357b){return db[_0x0c6c('0x18')][_0x0c6c('0x22')]({'raw':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1c')]||null:null,'attributes':_0x5ec5bc['options']?_0x5ec5bc['options'][_0x0c6c('0x1d')]||null:null,'include':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x5ec5bc[_0x0c6c('0x1a')]['include'],function(_0x3c97d1){return{'model':db[_0x3c97d1['model']],'as':_0x3c97d1['as'],'attributes':_0x3c97d1[_0x0c6c('0x1d')],'include':_0x3c97d1['include']?_[_0x0c6c('0x20')](_0x3c97d1[_0x0c6c('0x1e')],function(_0x5951f2){return{'model':db[_0x5951f2['model']],'as':_0x5951f2['as'],'attributes':_0x5951f2[_0x0c6c('0x1d')],'include':_0x5951f2[_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x5951f2[_0x0c6c('0x1e')],function(_0x4ed556){return{'model':db[_0x4ed556[_0x0c6c('0x1f')]],'as':_0x4ed556['as'],'attributes':_0x4ed556[_0x0c6c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9d6ee8){logger[_0x0c6c('0xd')](_0x0c6c('0x21'),_0x5ec5bc);logger['debug'](_0x0c6c('0x21'),_0x5ec5bc,JSON[_0x0c6c('0x12')](_0x9d6ee8));_0x556dad(_0x9d6ee8);})[_0x0c6c('0x16')](function(_0x93e98a){logger[_0x0c6c('0x13')](_0x0c6c('0x21'),_0x93e98a[_0x0c6c('0x14')],_0x5ec5bc);_0x37357b(_0x40d708[_0x0c6c('0x13')](0x1f4,_0x93e98a[_0x0c6c('0x14')]));});});}; \ No newline at end of file +var _0x881e=['../../config/logger','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ZohoAccount','findAll','options','raw','where','limit','include','map','attributes','GetZohoAccount','find','model','ShowZohoAccount','moment','bluebird','ioredis','../../config/utils'];(function(_0x4647bd,_0x18d56d){var _0x1754dd=function(_0x2d4489){while(--_0x2d4489){_0x4647bd['push'](_0x4647bd['shift']());}};_0x1754dd(++_0x18d56d);}(_0x881e,0x146));var _0xe881=function(_0x53786f,_0x33fa65){_0x53786f=_0x53786f-0x0;var _0x49346e=_0x881e[_0x53786f];return _0x49346e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe881('0x0'));var BPromise=require(_0xe881('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe881('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe881('0x3'));var logger=require(_0xe881('0x4'))(_0xe881('0x5'));var config=require(_0xe881('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe881('0x7')][_0xe881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x561c1c,_0x3f6894,_0x2413dc){return new BPromise(function(_0xe16d23,_0x547217){return client['request'](_0x561c1c,_0x2413dc)[_0xe881('0x9')](function(_0x26e29e){logger[_0xe881('0xa')](_0xe881('0xb'),_0x3f6894,'request\x20sent');logger[_0xe881('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'),JSON[_0xe881('0xe')](_0x26e29e));if(_0x26e29e[_0xe881('0xf')]){if(_0x26e29e[_0xe881('0xf')][_0xe881('0x10')]===0x1f4){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0x547217(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}logger['error'](_0xe881('0xb'),_0x3f6894,_0x26e29e['error'][_0xe881('0x11')]);return _0xe16d23(_0x26e29e[_0xe881('0xf')][_0xe881('0x11')]);}else{logger[_0xe881('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x3f6894,_0xe881('0xd'));_0xe16d23(_0x26e29e[_0xe881('0x12')][_0xe881('0x11')]);}})[_0xe881('0x13')](function(_0x59b441){logger[_0xe881('0xf')](_0xe881('0xb'),_0x3f6894,_0x59b441);_0x547217(_0x59b441);});});}exports['GetZohoAccount']=function(_0x592fd0){var _0x22b092=this;return new Promise(function(_0x1cfaa9,_0x3e774a){return db[_0xe881('0x14')][_0xe881('0x15')]({'raw':_0x592fd0[_0xe881('0x16')]?_0x592fd0[_0xe881('0x16')][_0xe881('0x17')]===undefined?!![]:![]:!![],'where':_0x592fd0[_0xe881('0x16')]?_0x592fd0[_0xe881('0x16')][_0xe881('0x18')]||null:null,'attributes':_0x592fd0[_0xe881('0x16')]?_0x592fd0[_0xe881('0x16')]['attributes']||null:null,'limit':_0x592fd0[_0xe881('0x16')]?_0x592fd0[_0xe881('0x16')][_0xe881('0x19')]||null:null,'include':_0x592fd0[_0xe881('0x16')]?_0x592fd0[_0xe881('0x16')][_0xe881('0x1a')]?_[_0xe881('0x1b')](_0x592fd0[_0xe881('0x16')][_0xe881('0x1a')],function(_0xd335a0){return{'model':db[_0xd335a0['model']],'as':_0xd335a0['as'],'attributes':_0xd335a0['attributes'],'include':_0xd335a0[_0xe881('0x1a')]?_['map'](_0xd335a0[_0xe881('0x1a')],function(_0x53bd85){return{'model':db[_0x53bd85['model']],'as':_0x53bd85['as'],'attributes':_0x53bd85['attributes'],'include':_0x53bd85['include']?_[_0xe881('0x1b')](_0x53bd85['include'],function(_0x592d02){return{'model':db[_0x592d02['model']],'as':_0x592d02['as'],'attributes':_0x592d02[_0xe881('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe881('0x9')](function(_0x5c4f82){logger[_0xe881('0xa')](_0xe881('0x1d'),_0x592fd0);logger[_0xe881('0xc')](_0xe881('0x1d'),_0x592fd0,JSON[_0xe881('0xe')](_0x5c4f82));_0x1cfaa9(_0x5c4f82);})[_0xe881('0x13')](function(_0x1aba0d){logger[_0xe881('0xf')]('GetZohoAccount',_0x1aba0d[_0xe881('0x11')],_0x592fd0);_0x3e774a(_0x22b092[_0xe881('0xf')](0x1f4,_0x1aba0d[_0xe881('0x11')]));});});};exports['ShowZohoAccount']=function(_0x134ca0){var _0x5551d5=this;return new Promise(function(_0x18d6f2,_0x4552eb){return db[_0xe881('0x14')][_0xe881('0x1e')]({'raw':_0x134ca0[_0xe881('0x16')]?_0x134ca0[_0xe881('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x134ca0['options']?_0x134ca0[_0xe881('0x16')][_0xe881('0x18')]||null:null,'attributes':_0x134ca0[_0xe881('0x16')]?_0x134ca0[_0xe881('0x16')][_0xe881('0x1c')]||null:null,'include':_0x134ca0[_0xe881('0x16')]?_0x134ca0[_0xe881('0x16')]['include']?_[_0xe881('0x1b')](_0x134ca0['options'][_0xe881('0x1a')],function(_0x38353d){return{'model':db[_0x38353d[_0xe881('0x1f')]],'as':_0x38353d['as'],'attributes':_0x38353d[_0xe881('0x1c')],'include':_0x38353d[_0xe881('0x1a')]?_[_0xe881('0x1b')](_0x38353d[_0xe881('0x1a')],function(_0x4a2126){return{'model':db[_0x4a2126[_0xe881('0x1f')]],'as':_0x4a2126['as'],'attributes':_0x4a2126[_0xe881('0x1c')],'include':_0x4a2126['include']?_[_0xe881('0x1b')](_0x4a2126['include'],function(_0x30c325){return{'model':db[_0x30c325[_0xe881('0x1f')]],'as':_0x30c325['as'],'attributes':_0x30c325[_0xe881('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48945f){logger[_0xe881('0xa')](_0xe881('0x20'),_0x134ca0);logger[_0xe881('0xc')](_0xe881('0x20'),_0x134ca0,JSON[_0xe881('0xe')](_0x48945f));_0x18d6f2(_0x48945f);})[_0xe881('0x13')](function(_0x43f250){logger[_0xe881('0xf')](_0xe881('0x20'),_0x43f250['message'],_0x134ca0);_0x4552eb(_0x5551d5[_0xe881('0xf')](0x1f4,_0x43f250['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ec063cc..6f693c5 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 _0x702d=['isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x1db778,_0x5a17fd){var _0x152586=function(_0x52d82c){while(--_0x52d82c){_0x1db778['push'](_0x1db778['shift']());}};_0x152586(++_0x5a17fd);}(_0x702d,0x147));var _0xd702=function(_0x481158,_0x69bfe0){_0x481158=_0x481158-0x0;var _0x26e860=_0x702d[_0x481158];return _0x26e860;};'use strict';var multer=require(_0xd702('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd702('0x1'));var router=express[_0xd702('0x2')]();var fs_extra=require(_0xd702('0x3'));var auth=require(_0xd702('0x4'));var interaction=require(_0xd702('0x5'));var config=require(_0xd702('0x6'));var controller=require(_0xd702('0x7'));router[_0xd702('0x8')]('/',auth[_0xd702('0x9')](),controller[_0xd702('0xa')]);router['get'](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['show']);router[_0xd702('0x8')](_0xd702('0xc'),auth[_0xd702('0x9')](),controller[_0xd702('0xd')]);router[_0xd702('0x8')](_0xd702('0xe'),auth[_0xd702('0x9')](),controller['getSubjects']);router[_0xd702('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xd702('0xf')]);router[_0xd702('0x10')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0x13')]);module[_0xd702('0x14')]=router; \ No newline at end of file +var _0x2851=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update'];(function(_0xdfd063,_0x49dbc2){var _0x5de615=function(_0x3d2565){while(--_0x3d2565){_0xdfd063['push'](_0xdfd063['shift']());}};_0x5de615(++_0x49dbc2);}(_0x2851,0x92));var _0x1285=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2851[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x1285('0x0'));var util=require(_0x1285('0x1'));var path=require(_0x1285('0x2'));var timeout=require(_0x1285('0x3'));var express=require(_0x1285('0x4'));var router=express[_0x1285('0x5')]();var fs_extra=require(_0x1285('0x6'));var auth=require(_0x1285('0x7'));var interaction=require(_0x1285('0x8'));var config=require(_0x1285('0x9'));var controller=require(_0x1285('0xa'));router[_0x1285('0xb')]('/',auth[_0x1285('0xc')](),controller[_0x1285('0xd')]);router[_0x1285('0xb')]('/:id',auth[_0x1285('0xc')](),controller['show']);router['get'](_0x1285('0xe'),auth[_0x1285('0xc')](),controller['getFields']);router[_0x1285('0xb')](_0x1285('0xf'),auth[_0x1285('0xc')](),controller[_0x1285('0x10')]);router[_0x1285('0xb')]('/:id/descriptions',auth[_0x1285('0xc')](),controller[_0x1285('0x11')]);router[_0x1285('0x12')]('/',auth[_0x1285('0xc')](),controller['create']);router[_0x1285('0x13')](_0x1285('0x14'),auth['isAuthenticated'](),controller[_0x1285('0x15')]);router[_0x1285('0x16')](_0x1285('0x14'),auth[_0x1285('0xc')](),controller['destroy']);module[_0x1285('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 06e6053..eac79f3 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 _0x5a96=['contact','nothing','sequelize','exports','ENUM','lead'];(function(_0x1f79c3,_0x5bc43e){var _0x25fe27=function(_0x5415fe){while(--_0x5415fe){_0x1f79c3['push'](_0x1f79c3['shift']());}};_0x25fe27(++_0x5bc43e);}(_0x5a96,0xbc));var _0x65a9=function(_0xe558ed,_0x552a46){_0xe558ed=_0xe558ed-0x0;var _0x1df48=_0x5a96[_0xe558ed];return _0x1df48;};'use strict';var Sequelize=require(_0x65a9('0x0'));module[_0x65a9('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x65a9('0x2')](_0x65a9('0x3'),_0x65a9('0x4'),_0x65a9('0x5')),'defaultValue':_0x65a9('0x3')},'moduleSearch':{'type':Sequelize[_0x65a9('0x2')]('contact_lead',_0x65a9('0x4'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1793=['STRING','ENUM','contact','nothing','lead','contact_lead','sequelize','exports'];(function(_0x12ea3c,_0x56f826){var _0x435787=function(_0x1e0c76){while(--_0x1e0c76){_0x12ea3c['push'](_0x12ea3c['shift']());}};_0x435787(++_0x56f826);}(_0x1793,0x1ce));var _0x3179=function(_0x47f19d,_0x30582c){_0x47f19d=_0x47f19d-0x0;var _0x1fc180=_0x1793[_0x47f19d];return _0x1fc180;};'use strict';var Sequelize=require(_0x3179('0x0'));module[_0x3179('0x1')]={'name':{'type':Sequelize[_0x3179('0x2')]},'moduleCreate':{'type':Sequelize[_0x3179('0x3')]('lead',_0x3179('0x4'),_0x3179('0x5')),'defaultValue':_0x3179('0x6')},'moduleSearch':{'type':Sequelize[_0x3179('0x3')](_0x3179('0x7'),'contact','lead'),'defaultValue':_0x3179('0x7')},'description':{'type':Sequelize[_0x3179('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 28adebb..ac7ce1b 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 _0x1d15=['error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','findAll','params','intersection','includeAll','find','create','body','catch','getFields','findOne','ZohoField','order','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy'];(function(_0x486008,_0x2b2d05){var _0x2fefc7=function(_0x4177fe){while(--_0x4177fe){_0x486008['push'](_0x486008['shift']());}};_0x2fefc7(++_0x2b2d05);}(_0x1d15,0x171));var _0x51d1=function(_0x35ba73,_0x364a8b){_0x35ba73=_0x35ba73-0x0;var _0x47ba46=_0x1d15[_0x35ba73];return _0x47ba46;};'use strict';var emlformat=require(_0x51d1('0x0'));var rimraf=require(_0x51d1('0x1'));var zipdir=require(_0x51d1('0x2'));var jsonpatch=require(_0x51d1('0x3'));var rp=require(_0x51d1('0x4'));var moment=require(_0x51d1('0x5'));var BPromise=require(_0x51d1('0x6'));var Mustache=require('mustache');var util=require(_0x51d1('0x7'));var path=require('path');var sox=require(_0x51d1('0x8'));var csv=require(_0x51d1('0x9'));var ejs=require(_0x51d1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51d1('0xb'));var squel=require(_0x51d1('0xc'));var crypto=require(_0x51d1('0xd'));var jsforce=require(_0x51d1('0xe'));var deskjs=require(_0x51d1('0xf'));var toCsv=require(_0x51d1('0x9'));var querystring=require(_0x51d1('0x10'));var Papa=require(_0x51d1('0x11'));var Redis=require(_0x51d1('0x12'));var authService=require(_0x51d1('0x13'));var qs=require(_0x51d1('0x14'));var as=require(_0x51d1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d1('0x16'))('api');var utils=require(_0x51d1('0x17'));var config=require(_0x51d1('0x18'));var licenseUtil=require(_0x51d1('0x19'));var db=require(_0x51d1('0x1a'))['db'];function respondWithStatusCode(_0x3f3b06,_0x466f86){_0x466f86=_0x466f86||0xcc;return function(_0x48c453){if(_0x48c453){return _0x3f3b06[_0x51d1('0x1b')](_0x466f86);}return _0x3f3b06[_0x51d1('0x1c')](_0x466f86)[_0x51d1('0x1d')]();};}function respondWithResult(_0x58528f,_0x468fe5){_0x468fe5=_0x468fe5||0xc8;return function(_0x2a4c58){if(_0x2a4c58){return _0x58528f[_0x51d1('0x1c')](_0x468fe5)[_0x51d1('0x1e')](_0x2a4c58);}};}function respondWithFilteredResult(_0x2c6cf7,_0x415ba1){return function(_0xd21d43){if(_0xd21d43){var _0x91088d=typeof _0x415ba1[_0x51d1('0x1f')]===_0x51d1('0x20')&&typeof _0x415ba1['limit']===_0x51d1('0x20');var _0x32a1cf=_0xd21d43[_0x51d1('0x21')];var _0x4cb64a=_0x91088d?0x0:_0x415ba1[_0x51d1('0x1f')];var _0x4a3d1d=_0x91088d?_0xd21d43[_0x51d1('0x21')]:_0x415ba1[_0x51d1('0x1f')]+_0x415ba1[_0x51d1('0x22')];var _0x945519;if(_0x4a3d1d>=_0x32a1cf){_0x4a3d1d=_0x32a1cf;_0x945519=0xc8;}else{_0x945519=0xce;}_0x2c6cf7['status'](_0x945519);return _0x2c6cf7['set']('Content-Range',_0x4cb64a+'-'+_0x4a3d1d+'/'+_0x32a1cf)['json'](_0xd21d43);}return null;};}function patchUpdates(_0x573c34){return function(_0x324211){try{jsonpatch[_0x51d1('0x23')](_0x324211,_0x573c34,!![]);}catch(_0x3c45c9){return BPromise[_0x51d1('0x24')](_0x3c45c9);}return _0x324211[_0x51d1('0x25')]();};}function saveUpdates(_0x4d9c88,_0x5870a5){return function(_0x47ae7b){if(_0x47ae7b){return _0x47ae7b[_0x51d1('0x26')](_0x4d9c88)[_0x51d1('0x27')](function(_0x321a19){return _0x321a19;});}return null;};}function removeEntity(_0x14c4c3,_0x420a4c){return function(_0x29b2c6){if(_0x29b2c6){return _0x29b2c6[_0x51d1('0x28')]()['then'](function(){_0x14c4c3['status'](0xcc)[_0x51d1('0x1d')]();});}};}function handleEntityNotFound(_0x3e28d6,_0x14400e){return function(_0x510dc5){if(!_0x510dc5){_0x3e28d6[_0x51d1('0x1b')](0x194);}return _0x510dc5;};}function handleError(_0x13e5c8,_0xf90406){_0xf90406=_0xf90406||0x1f4;return function(_0x3828d9){logger[_0x51d1('0x29')](_0x3828d9[_0x51d1('0x2a')]);if(_0x3828d9[_0x51d1('0x2b')]){delete _0x3828d9['name'];}_0x13e5c8[_0x51d1('0x1c')](_0xf90406)[_0x51d1('0x2c')](_0x3828d9);};}exports[_0x51d1('0x2d')]=function(_0x3e88f4,_0x20d8ef){var _0xfdcdb3={},_0x16ce7e={},_0x3131fe={'count':0x0,'rows':[]};var _0x387b6e=_[_0x51d1('0x2e')](db[_0x51d1('0x2f')][_0x51d1('0x30')],function(_0x4a8c71){return{'name':_0x4a8c71[_0x51d1('0x31')],'type':_0x4a8c71[_0x51d1('0x32')][_0x51d1('0x33')]};});_0x16ce7e[_0x51d1('0x34')]=_[_0x51d1('0x2e')](_0x387b6e,_0x51d1('0x2b'));_0x16ce7e[_0x51d1('0x35')]=_[_0x51d1('0x36')](_0x3e88f4[_0x51d1('0x35')]);_0x16ce7e[_0x51d1('0x37')]=_['intersection'](_0x16ce7e[_0x51d1('0x34')],_0x16ce7e[_0x51d1('0x35')]);_0xfdcdb3['attributes']=_['intersection'](_0x16ce7e[_0x51d1('0x34')],qs[_0x51d1('0x38')](_0x3e88f4['query'][_0x51d1('0x38')]));_0xfdcdb3[_0x51d1('0x39')]=_0xfdcdb3[_0x51d1('0x39')][_0x51d1('0x3a')]?_0xfdcdb3[_0x51d1('0x39')]:_0x16ce7e[_0x51d1('0x34')];if(!_0x3e88f4[_0x51d1('0x35')][_0x51d1('0x3b')]('nolimit')){_0xfdcdb3[_0x51d1('0x22')]=qs[_0x51d1('0x22')](_0x3e88f4['query'][_0x51d1('0x22')]);_0xfdcdb3[_0x51d1('0x1f')]=qs[_0x51d1('0x1f')](_0x3e88f4[_0x51d1('0x35')][_0x51d1('0x1f')]);}_0xfdcdb3['order']=qs[_0x51d1('0x3c')](_0x3e88f4[_0x51d1('0x35')][_0x51d1('0x3c')]);_0xfdcdb3[_0x51d1('0x3d')]=qs[_0x51d1('0x37')](_['pick'](_0x3e88f4['query'],_0x16ce7e['filters']),_0x387b6e);if(_0x3e88f4['query'][_0x51d1('0x3e')]){_0xfdcdb3[_0x51d1('0x3d')]=_[_0x51d1('0x3f')](_0xfdcdb3[_0x51d1('0x3d')],{'$or':_[_0x51d1('0x2e')](_0x387b6e,function(_0xff83fb){if(_0xff83fb[_0x51d1('0x32')]!==_0x51d1('0x40')){var _0x2566f6={};_0x2566f6[_0xff83fb[_0x51d1('0x2b')]]={'$like':'%'+_0x3e88f4[_0x51d1('0x35')][_0x51d1('0x3e')]+'%'};return _0x2566f6;}})});}_0xfdcdb3=_[_0x51d1('0x3f')]({},_0xfdcdb3,_0x3e88f4[_0x51d1('0x41')]);var _0xa7abf={'where':_0xfdcdb3['where']};return db[_0x51d1('0x2f')][_0x51d1('0x21')](_0xa7abf)[_0x51d1('0x27')](function(_0x7a3878){_0x3131fe[_0x51d1('0x21')]=_0x7a3878;if(_0x3e88f4[_0x51d1('0x35')]['includeAll']){_0xfdcdb3['include']=[{'all':!![]}];}return db[_0x51d1('0x2f')][_0x51d1('0x42')](_0xfdcdb3);})[_0x51d1('0x27')](function(_0x40a043){_0x3131fe['rows']=_0x40a043;return _0x3131fe;})[_0x51d1('0x27')](respondWithFilteredResult(_0x20d8ef,_0xfdcdb3))['catch'](handleError(_0x20d8ef,null));};exports['show']=function(_0x270e1b,_0x189e35){var _0x459bdf={'raw':![],'where':{'id':_0x270e1b[_0x51d1('0x43')]['id']}},_0x404b48={};_0x404b48['model']=_['keys'](db['ZohoConfiguration'][_0x51d1('0x30')]);_0x404b48[_0x51d1('0x35')]=_['keys'](_0x270e1b[_0x51d1('0x35')]);_0x404b48[_0x51d1('0x37')]=_[_0x51d1('0x44')](_0x404b48[_0x51d1('0x34')],_0x404b48[_0x51d1('0x35')]);_0x459bdf[_0x51d1('0x39')]=_['intersection'](_0x404b48['model'],qs['fields'](_0x270e1b[_0x51d1('0x35')]['fields']));_0x459bdf[_0x51d1('0x39')]=_0x459bdf['attributes'][_0x51d1('0x3a')]?_0x459bdf[_0x51d1('0x39')]:_0x404b48[_0x51d1('0x34')];if(_0x270e1b[_0x51d1('0x35')][_0x51d1('0x45')]){_0x459bdf['include']=[{'all':!![]}];}_0x459bdf=_[_0x51d1('0x3f')]({},_0x459bdf,_0x270e1b[_0x51d1('0x41')]);return db[_0x51d1('0x2f')][_0x51d1('0x46')](_0x459bdf)[_0x51d1('0x27')](handleEntityNotFound(_0x189e35,null))[_0x51d1('0x27')](respondWithResult(_0x189e35,null))['catch'](handleError(_0x189e35,null));};exports[_0x51d1('0x47')]=function(_0x471110,_0xa372c4){return db[_0x51d1('0x2f')][_0x51d1('0x47')](_0x471110[_0x51d1('0x48')],{})[_0x51d1('0x27')](respondWithResult(_0xa372c4,0xc9))[_0x51d1('0x49')](handleError(_0xa372c4,null));};exports['update']=function(_0x1f6ea6,_0x747c76){if(_0x1f6ea6['body']['id']){delete _0x1f6ea6[_0x51d1('0x48')]['id'];}return db[_0x51d1('0x2f')][_0x51d1('0x46')]({'where':{'id':_0x1f6ea6[_0x51d1('0x43')]['id']}})[_0x51d1('0x27')](handleEntityNotFound(_0x747c76,null))['then'](saveUpdates(_0x1f6ea6[_0x51d1('0x48')],null))['then'](respondWithResult(_0x747c76,null))[_0x51d1('0x49')](handleError(_0x747c76,null));};exports['destroy']=function(_0x209b42,_0x4fbea2){return db[_0x51d1('0x2f')][_0x51d1('0x46')]({'where':{'id':_0x209b42[_0x51d1('0x43')]['id']}})[_0x51d1('0x27')](handleEntityNotFound(_0x4fbea2,null))[_0x51d1('0x27')](removeEntity(_0x4fbea2,null))['catch'](handleError(_0x4fbea2,null));};exports[_0x51d1('0x4a')]=function(_0x35a7f8,_0x489b46,_0x4f657b){var _0x46ba47={};var _0x2950e7={};var _0xd693e1;var _0x47d549;return db['ZohoConfiguration'][_0x51d1('0x4b')]({'where':{'id':_0x35a7f8['params']['id']}})['then'](handleEntityNotFound(_0x489b46,null))[_0x51d1('0x27')](function(_0x287047){if(_0x287047){_0xd693e1=_0x287047;_0x2950e7[_0x51d1('0x34')]=_[_0x51d1('0x36')](db[_0x51d1('0x4c')]['rawAttributes']);_0x2950e7['query']=_[_0x51d1('0x36')](_0x35a7f8[_0x51d1('0x35')]);_0x2950e7[_0x51d1('0x37')]=_[_0x51d1('0x44')](_0x2950e7['model'],_0x2950e7[_0x51d1('0x35')]);_0x46ba47['attributes']=_[_0x51d1('0x44')](_0x2950e7['model'],qs['fields'](_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x38')]));_0x46ba47[_0x51d1('0x39')]=_0x46ba47[_0x51d1('0x39')][_0x51d1('0x3a')]?_0x46ba47[_0x51d1('0x39')]:_0x2950e7[_0x51d1('0x34')];_0x46ba47[_0x51d1('0x4d')]=qs[_0x51d1('0x3c')](_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x3c')]);_0x46ba47['where']=qs[_0x51d1('0x37')](_[_0x51d1('0x4e')](_0x35a7f8[_0x51d1('0x35')],_0x2950e7[_0x51d1('0x37')]));if(_0x35a7f8['query']['filter']){_0x46ba47[_0x51d1('0x3d')]=_[_0x51d1('0x3f')](_0x46ba47[_0x51d1('0x3d')],{'$or':_[_0x51d1('0x2e')](_0x46ba47['attributes'],function(_0x51fb73){var _0x5660c2={};_0x5660c2[_0x51fb73]={'$like':'%'+_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x3e')]+'%'};return _0x5660c2;})});}_0x46ba47=_[_0x51d1('0x3f')]({},_0x46ba47,_0x35a7f8[_0x51d1('0x41')]);return _0xd693e1[_0x51d1('0x4a')](_0x46ba47);}})['then'](function(_0xdb5130){if(_0xdb5130){_0x47d549=_0xdb5130['length'];if(!_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x3b')](_0x51d1('0x4f'))){_0x46ba47[_0x51d1('0x22')]=qs['limit'](_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x22')]);_0x46ba47[_0x51d1('0x1f')]=qs[_0x51d1('0x1f')](_0x35a7f8[_0x51d1('0x35')][_0x51d1('0x1f')]);}return _0xd693e1['getFields'](_0x46ba47);}})[_0x51d1('0x27')](function(_0xaec18){if(_0xaec18){return _0xaec18?{'count':_0x47d549,'rows':_0xaec18}:null;}})[_0x51d1('0x27')](respondWithResult(_0x489b46,null))[_0x51d1('0x49')](handleError(_0x489b46,null));};exports['getSubjects']=function(_0x323c35,_0x56aaab,_0x535e37){var _0xdf3b99={};var _0x9bae3b={};var _0x42e9ca;var _0x16afef;return db[_0x51d1('0x2f')][_0x51d1('0x4b')]({'where':{'id':_0x323c35[_0x51d1('0x43')]['id']}})['then'](handleEntityNotFound(_0x56aaab,null))['then'](function(_0x4dbc8d){if(_0x4dbc8d){_0x42e9ca=_0x4dbc8d;_0x9bae3b['model']=_[_0x51d1('0x36')](db[_0x51d1('0x4c')][_0x51d1('0x30')]);_0x9bae3b[_0x51d1('0x35')]=_[_0x51d1('0x36')](_0x323c35['query']);_0x9bae3b[_0x51d1('0x37')]=_['intersection'](_0x9bae3b[_0x51d1('0x34')],_0x9bae3b['query']);_0xdf3b99[_0x51d1('0x39')]=_[_0x51d1('0x44')](_0x9bae3b[_0x51d1('0x34')],qs[_0x51d1('0x38')](_0x323c35[_0x51d1('0x35')]['fields']));_0xdf3b99[_0x51d1('0x39')]=_0xdf3b99[_0x51d1('0x39')][_0x51d1('0x3a')]?_0xdf3b99[_0x51d1('0x39')]:_0x9bae3b['model'];_0xdf3b99[_0x51d1('0x4d')]=qs[_0x51d1('0x3c')](_0x323c35[_0x51d1('0x35')][_0x51d1('0x3c')]);_0xdf3b99[_0x51d1('0x3d')]=qs[_0x51d1('0x37')](_[_0x51d1('0x4e')](_0x323c35[_0x51d1('0x35')],_0x9bae3b[_0x51d1('0x37')]));if(_0x323c35['query'][_0x51d1('0x3e')]){_0xdf3b99[_0x51d1('0x3d')]=_[_0x51d1('0x3f')](_0xdf3b99['where'],{'$or':_[_0x51d1('0x2e')](_0xdf3b99[_0x51d1('0x39')],function(_0xf697c6){var _0x236b4c={};_0x236b4c[_0xf697c6]={'$like':'%'+_0x323c35[_0x51d1('0x35')]['filter']+'%'};return _0x236b4c;})});}_0xdf3b99=_[_0x51d1('0x3f')]({},_0xdf3b99,_0x323c35[_0x51d1('0x41')]);return _0x42e9ca[_0x51d1('0x50')](_0xdf3b99);}})[_0x51d1('0x27')](function(_0x5f3703){if(_0x5f3703){_0x16afef=_0x5f3703[_0x51d1('0x3a')];if(!_0x323c35[_0x51d1('0x35')][_0x51d1('0x3b')](_0x51d1('0x4f'))){_0xdf3b99[_0x51d1('0x22')]=qs[_0x51d1('0x22')](_0x323c35[_0x51d1('0x35')]['limit']);_0xdf3b99['offset']=qs[_0x51d1('0x1f')](_0x323c35[_0x51d1('0x35')][_0x51d1('0x1f')]);}return _0x42e9ca['getSubjects'](_0xdf3b99);}})[_0x51d1('0x27')](function(_0x4f613e){if(_0x4f613e){return _0x4f613e?{'count':_0x16afef,'rows':_0x4f613e}:null;}})[_0x51d1('0x27')](respondWithResult(_0x56aaab,null))['catch'](handleError(_0x56aaab,null));};exports[_0x51d1('0x51')]=function(_0x234f57,_0xf6bdef,_0x4df14b){var _0x120698={};var _0x3264cc={};var _0x1e9372;var _0x4d2867;return db['ZohoConfiguration'][_0x51d1('0x4b')]({'where':{'id':_0x234f57[_0x51d1('0x43')]['id']}})[_0x51d1('0x27')](handleEntityNotFound(_0xf6bdef,null))[_0x51d1('0x27')](function(_0x4008ff){if(_0x4008ff){_0x1e9372=_0x4008ff;_0x3264cc['model']=_['keys'](db[_0x51d1('0x4c')][_0x51d1('0x30')]);_0x3264cc['query']=_[_0x51d1('0x36')](_0x234f57[_0x51d1('0x35')]);_0x3264cc['filters']=_[_0x51d1('0x44')](_0x3264cc[_0x51d1('0x34')],_0x3264cc[_0x51d1('0x35')]);_0x120698[_0x51d1('0x39')]=_['intersection'](_0x3264cc[_0x51d1('0x34')],qs[_0x51d1('0x38')](_0x234f57['query'][_0x51d1('0x38')]));_0x120698[_0x51d1('0x39')]=_0x120698[_0x51d1('0x39')]['length']?_0x120698['attributes']:_0x3264cc['model'];_0x120698[_0x51d1('0x4d')]=qs[_0x51d1('0x3c')](_0x234f57[_0x51d1('0x35')]['sort']);_0x120698[_0x51d1('0x3d')]=qs[_0x51d1('0x37')](_[_0x51d1('0x4e')](_0x234f57[_0x51d1('0x35')],_0x3264cc['filters']));if(_0x234f57[_0x51d1('0x35')][_0x51d1('0x3e')]){_0x120698[_0x51d1('0x3d')]=_['merge'](_0x120698[_0x51d1('0x3d')],{'$or':_[_0x51d1('0x2e')](_0x120698[_0x51d1('0x39')],function(_0x2c93bc){var _0x476fb2={};_0x476fb2[_0x2c93bc]={'$like':'%'+_0x234f57[_0x51d1('0x35')][_0x51d1('0x3e')]+'%'};return _0x476fb2;})});}_0x120698=_[_0x51d1('0x3f')]({},_0x120698,_0x234f57['options']);return _0x1e9372[_0x51d1('0x51')](_0x120698);}})[_0x51d1('0x27')](function(_0x3eef3f){if(_0x3eef3f){_0x4d2867=_0x3eef3f[_0x51d1('0x3a')];if(!_0x234f57[_0x51d1('0x35')][_0x51d1('0x3b')]('nolimit')){_0x120698[_0x51d1('0x22')]=qs[_0x51d1('0x22')](_0x234f57[_0x51d1('0x35')][_0x51d1('0x22')]);_0x120698['offset']=qs[_0x51d1('0x1f')](_0x234f57['query'][_0x51d1('0x1f')]);}return _0x1e9372[_0x51d1('0x51')](_0x120698);}})[_0x51d1('0x27')](function(_0x4ca5f1){if(_0x4ca5f1){return _0x4ca5f1?{'count':_0x4d2867,'rows':_0x4ca5f1}:null;}})[_0x51d1('0x27')](respondWithResult(_0xf6bdef,null))[_0x51d1('0x49')](handleError(_0xf6bdef,null));}; \ No newline at end of file +var _0xa429=['getFields','findOne','ZohoField','options','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','find','create','body'];(function(_0x2713e0,_0x16fbf9){var _0x3ce6d7=function(_0x577ed3){while(--_0x577ed3){_0x2713e0['push'](_0x2713e0['shift']());}};_0x3ce6d7(++_0x16fbf9);}(_0xa429,0xa7));var _0x9a42=function(_0x18a4b3,_0x3af36b){_0x18a4b3=_0x18a4b3-0x0;var _0x2b8e43=_0xa429[_0x18a4b3];return _0x2b8e43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a42('0x0'));var zipdir=require(_0x9a42('0x1'));var jsonpatch=require(_0x9a42('0x2'));var rp=require(_0x9a42('0x3'));var moment=require(_0x9a42('0x4'));var BPromise=require(_0x9a42('0x5'));var Mustache=require('mustache');var util=require(_0x9a42('0x6'));var path=require(_0x9a42('0x7'));var sox=require(_0x9a42('0x8'));var csv=require(_0x9a42('0x9'));var ejs=require(_0x9a42('0xa'));var fs=require('fs');var fs_extra=require(_0x9a42('0xb'));var _=require(_0x9a42('0xc'));var squel=require('squel');var crypto=require(_0x9a42('0xd'));var jsforce=require(_0x9a42('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9a42('0x9'));var querystring=require(_0x9a42('0xf'));var Papa=require(_0x9a42('0x10'));var Redis=require(_0x9a42('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a42('0x12'));var hardwareService=require(_0x9a42('0x13'));var logger=require(_0x9a42('0x14'))(_0x9a42('0x15'));var utils=require(_0x9a42('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9a42('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c6a09,_0x556b28){_0x556b28=_0x556b28||0xcc;return function(_0x5cee9d){if(_0x5cee9d){return _0x1c6a09[_0x9a42('0x18')](_0x556b28);}return _0x1c6a09[_0x9a42('0x19')](_0x556b28)[_0x9a42('0x1a')]();};}function respondWithResult(_0x469650,_0x11cbd1){_0x11cbd1=_0x11cbd1||0xc8;return function(_0x1263ab){if(_0x1263ab){return _0x469650[_0x9a42('0x19')](_0x11cbd1)[_0x9a42('0x1b')](_0x1263ab);}};}function respondWithFilteredResult(_0x591889,_0x337c8d){return function(_0x4fdcf1){if(_0x4fdcf1){var _0x4004d6=typeof _0x337c8d[_0x9a42('0x1c')]===_0x9a42('0x1d')&&typeof _0x337c8d[_0x9a42('0x1e')]===_0x9a42('0x1d');var _0x2d2ccb=_0x4fdcf1[_0x9a42('0x1f')];var _0x27db84=_0x4004d6?0x0:_0x337c8d[_0x9a42('0x1c')];var _0x2a75ab=_0x4004d6?_0x4fdcf1[_0x9a42('0x1f')]:_0x337c8d[_0x9a42('0x1c')]+_0x337c8d[_0x9a42('0x1e')];var _0x1c9d9d;if(_0x2a75ab>=_0x2d2ccb){_0x2a75ab=_0x2d2ccb;_0x1c9d9d=0xc8;}else{_0x1c9d9d=0xce;}_0x591889[_0x9a42('0x19')](_0x1c9d9d);return _0x591889[_0x9a42('0x20')](_0x9a42('0x21'),_0x27db84+'-'+_0x2a75ab+'/'+_0x2d2ccb)[_0x9a42('0x1b')](_0x4fdcf1);}return null;};}function patchUpdates(_0x29f026){return function(_0x1ff809){try{jsonpatch['apply'](_0x1ff809,_0x29f026,!![]);}catch(_0x37f0e8){return BPromise[_0x9a42('0x22')](_0x37f0e8);}return _0x1ff809[_0x9a42('0x23')]();};}function saveUpdates(_0x1c24d7,_0xd08548){return function(_0x544ecd){if(_0x544ecd){return _0x544ecd[_0x9a42('0x24')](_0x1c24d7)['then'](function(_0x200e64){return _0x200e64;});}return null;};}function removeEntity(_0x56037c,_0x5f5b5b){return function(_0x57b579){if(_0x57b579){return _0x57b579[_0x9a42('0x25')]()[_0x9a42('0x26')](function(){_0x56037c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x356ad4,_0x2f4204){return function(_0x1536e5){if(!_0x1536e5){_0x356ad4[_0x9a42('0x18')](0x194);}return _0x1536e5;};}function handleError(_0x648778,_0x14d562){_0x14d562=_0x14d562||0x1f4;return function(_0x392a4e){logger[_0x9a42('0x27')](_0x392a4e[_0x9a42('0x28')]);if(_0x392a4e[_0x9a42('0x29')]){delete _0x392a4e['name'];}_0x648778['status'](_0x14d562)[_0x9a42('0x2a')](_0x392a4e);};}exports['index']=function(_0x1c5694,_0x5d920c){var _0x3945a2={},_0x2d3058={},_0xa6d85b={'count':0x0,'rows':[]};var _0x32274f=_[_0x9a42('0x2b')](db[_0x9a42('0x2c')][_0x9a42('0x2d')],function(_0x1bd0f4){return{'name':_0x1bd0f4[_0x9a42('0x2e')],'type':_0x1bd0f4[_0x9a42('0x2f')][_0x9a42('0x30')]};});_0x2d3058[_0x9a42('0x31')]=_[_0x9a42('0x2b')](_0x32274f,_0x9a42('0x29'));_0x2d3058['query']=_[_0x9a42('0x32')](_0x1c5694[_0x9a42('0x33')]);_0x2d3058[_0x9a42('0x34')]=_[_0x9a42('0x35')](_0x2d3058[_0x9a42('0x31')],_0x2d3058[_0x9a42('0x33')]);_0x3945a2[_0x9a42('0x36')]=_[_0x9a42('0x35')](_0x2d3058['model'],qs['fields'](_0x1c5694['query'][_0x9a42('0x37')]));_0x3945a2['attributes']=_0x3945a2[_0x9a42('0x36')][_0x9a42('0x38')]?_0x3945a2[_0x9a42('0x36')]:_0x2d3058[_0x9a42('0x31')];if(!_0x1c5694[_0x9a42('0x33')]['hasOwnProperty'](_0x9a42('0x39'))){_0x3945a2['limit']=qs['limit'](_0x1c5694[_0x9a42('0x33')]['limit']);_0x3945a2[_0x9a42('0x1c')]=qs[_0x9a42('0x1c')](_0x1c5694['query'][_0x9a42('0x1c')]);}_0x3945a2[_0x9a42('0x3a')]=qs[_0x9a42('0x3b')](_0x1c5694[_0x9a42('0x33')][_0x9a42('0x3b')]);_0x3945a2[_0x9a42('0x3c')]=qs[_0x9a42('0x34')](_[_0x9a42('0x3d')](_0x1c5694[_0x9a42('0x33')],_0x2d3058[_0x9a42('0x34')]),_0x32274f);if(_0x1c5694[_0x9a42('0x33')]['filter']){_0x3945a2[_0x9a42('0x3c')]=_[_0x9a42('0x3e')](_0x3945a2[_0x9a42('0x3c')],{'$or':_[_0x9a42('0x2b')](_0x32274f,function(_0x5a5eeb){if(_0x5a5eeb[_0x9a42('0x2f')]!==_0x9a42('0x3f')){var _0x34395c={};_0x34395c[_0x5a5eeb[_0x9a42('0x29')]]={'$like':'%'+_0x1c5694['query'][_0x9a42('0x40')]+'%'};return _0x34395c;}})});}_0x3945a2=_[_0x9a42('0x3e')]({},_0x3945a2,_0x1c5694['options']);var _0x4d2abf={'where':_0x3945a2[_0x9a42('0x3c')]};return db[_0x9a42('0x2c')][_0x9a42('0x1f')](_0x4d2abf)['then'](function(_0x32104e){_0xa6d85b['count']=_0x32104e;if(_0x1c5694[_0x9a42('0x33')][_0x9a42('0x41')]){_0x3945a2[_0x9a42('0x42')]=[{'all':!![]}];}return db[_0x9a42('0x2c')]['findAll'](_0x3945a2);})['then'](function(_0x154001){_0xa6d85b['rows']=_0x154001;return _0xa6d85b;})[_0x9a42('0x26')](respondWithFilteredResult(_0x5d920c,_0x3945a2))[_0x9a42('0x43')](handleError(_0x5d920c,null));};exports[_0x9a42('0x44')]=function(_0x569252,_0x152670){var _0x5469c8={'raw':![],'where':{'id':_0x569252[_0x9a42('0x45')]['id']}},_0x29d06d={};_0x29d06d[_0x9a42('0x31')]=_['keys'](db[_0x9a42('0x2c')]['rawAttributes']);_0x29d06d[_0x9a42('0x33')]=_['keys'](_0x569252[_0x9a42('0x33')]);_0x29d06d[_0x9a42('0x34')]=_['intersection'](_0x29d06d[_0x9a42('0x31')],_0x29d06d['query']);_0x5469c8[_0x9a42('0x36')]=_[_0x9a42('0x35')](_0x29d06d['model'],qs[_0x9a42('0x37')](_0x569252[_0x9a42('0x33')][_0x9a42('0x37')]));_0x5469c8['attributes']=_0x5469c8['attributes'][_0x9a42('0x38')]?_0x5469c8[_0x9a42('0x36')]:_0x29d06d['model'];if(_0x569252[_0x9a42('0x33')]['includeAll']){_0x5469c8[_0x9a42('0x42')]=[{'all':!![]}];}_0x5469c8=_[_0x9a42('0x3e')]({},_0x5469c8,_0x569252['options']);return db['ZohoConfiguration'][_0x9a42('0x46')](_0x5469c8)['then'](handleEntityNotFound(_0x152670,null))['then'](respondWithResult(_0x152670,null))[_0x9a42('0x43')](handleError(_0x152670,null));};exports[_0x9a42('0x47')]=function(_0x13a6d4,_0x5dce93){return db[_0x9a42('0x2c')][_0x9a42('0x47')](_0x13a6d4[_0x9a42('0x48')],{})[_0x9a42('0x26')](respondWithResult(_0x5dce93,0xc9))[_0x9a42('0x43')](handleError(_0x5dce93,null));};exports[_0x9a42('0x24')]=function(_0x180c3e,_0x216aae){if(_0x180c3e[_0x9a42('0x48')]['id']){delete _0x180c3e[_0x9a42('0x48')]['id'];}return db[_0x9a42('0x2c')][_0x9a42('0x46')]({'where':{'id':_0x180c3e[_0x9a42('0x45')]['id']}})[_0x9a42('0x26')](handleEntityNotFound(_0x216aae,null))[_0x9a42('0x26')](saveUpdates(_0x180c3e[_0x9a42('0x48')],null))[_0x9a42('0x26')](respondWithResult(_0x216aae,null))[_0x9a42('0x43')](handleError(_0x216aae,null));};exports[_0x9a42('0x25')]=function(_0x19f8ac,_0x3c5037){return db[_0x9a42('0x2c')][_0x9a42('0x46')]({'where':{'id':_0x19f8ac[_0x9a42('0x45')]['id']}})[_0x9a42('0x26')](handleEntityNotFound(_0x3c5037,null))['then'](removeEntity(_0x3c5037,null))[_0x9a42('0x43')](handleError(_0x3c5037,null));};exports[_0x9a42('0x49')]=function(_0x547561,_0x13f9b4,_0xfba586){var _0x2ccb73={};var _0x13c3f2={};var _0x21f7aa;var _0x293e2d;return db[_0x9a42('0x2c')][_0x9a42('0x4a')]({'where':{'id':_0x547561[_0x9a42('0x45')]['id']}})[_0x9a42('0x26')](handleEntityNotFound(_0x13f9b4,null))['then'](function(_0x32711a){if(_0x32711a){_0x21f7aa=_0x32711a;_0x13c3f2[_0x9a42('0x31')]=_[_0x9a42('0x32')](db[_0x9a42('0x4b')]['rawAttributes']);_0x13c3f2['query']=_[_0x9a42('0x32')](_0x547561[_0x9a42('0x33')]);_0x13c3f2[_0x9a42('0x34')]=_[_0x9a42('0x35')](_0x13c3f2[_0x9a42('0x31')],_0x13c3f2[_0x9a42('0x33')]);_0x2ccb73['attributes']=_[_0x9a42('0x35')](_0x13c3f2[_0x9a42('0x31')],qs[_0x9a42('0x37')](_0x547561[_0x9a42('0x33')][_0x9a42('0x37')]));_0x2ccb73[_0x9a42('0x36')]=_0x2ccb73[_0x9a42('0x36')]['length']?_0x2ccb73[_0x9a42('0x36')]:_0x13c3f2['model'];_0x2ccb73[_0x9a42('0x3a')]=qs['sort'](_0x547561[_0x9a42('0x33')][_0x9a42('0x3b')]);_0x2ccb73[_0x9a42('0x3c')]=qs['filters'](_[_0x9a42('0x3d')](_0x547561[_0x9a42('0x33')],_0x13c3f2[_0x9a42('0x34')]));if(_0x547561[_0x9a42('0x33')][_0x9a42('0x40')]){_0x2ccb73['where']=_[_0x9a42('0x3e')](_0x2ccb73[_0x9a42('0x3c')],{'$or':_[_0x9a42('0x2b')](_0x2ccb73[_0x9a42('0x36')],function(_0x2e1956){var _0x420108={};_0x420108[_0x2e1956]={'$like':'%'+_0x547561[_0x9a42('0x33')][_0x9a42('0x40')]+'%'};return _0x420108;})});}_0x2ccb73=_['merge']({},_0x2ccb73,_0x547561[_0x9a42('0x4c')]);return _0x21f7aa[_0x9a42('0x49')](_0x2ccb73);}})[_0x9a42('0x26')](function(_0xae4d85){if(_0xae4d85){_0x293e2d=_0xae4d85[_0x9a42('0x38')];if(!_0x547561[_0x9a42('0x33')][_0x9a42('0x4d')]('nolimit')){_0x2ccb73['limit']=qs[_0x9a42('0x1e')](_0x547561[_0x9a42('0x33')][_0x9a42('0x1e')]);_0x2ccb73[_0x9a42('0x1c')]=qs[_0x9a42('0x1c')](_0x547561[_0x9a42('0x33')][_0x9a42('0x1c')]);}return _0x21f7aa[_0x9a42('0x49')](_0x2ccb73);}})[_0x9a42('0x26')](function(_0x13e410){if(_0x13e410){return _0x13e410?{'count':_0x293e2d,'rows':_0x13e410}:null;}})[_0x9a42('0x26')](respondWithResult(_0x13f9b4,null))['catch'](handleError(_0x13f9b4,null));};exports[_0x9a42('0x4e')]=function(_0x53be82,_0xef201d,_0x108d6f){var _0x47984c={};var _0x5b6e7b={};var _0x52b074;var _0x51690c;return db[_0x9a42('0x2c')][_0x9a42('0x4a')]({'where':{'id':_0x53be82[_0x9a42('0x45')]['id']}})[_0x9a42('0x26')](handleEntityNotFound(_0xef201d,null))[_0x9a42('0x26')](function(_0x211731){if(_0x211731){_0x52b074=_0x211731;_0x5b6e7b[_0x9a42('0x31')]=_[_0x9a42('0x32')](db[_0x9a42('0x4b')]['rawAttributes']);_0x5b6e7b[_0x9a42('0x33')]=_[_0x9a42('0x32')](_0x53be82['query']);_0x5b6e7b[_0x9a42('0x34')]=_[_0x9a42('0x35')](_0x5b6e7b[_0x9a42('0x31')],_0x5b6e7b[_0x9a42('0x33')]);_0x47984c[_0x9a42('0x36')]=_[_0x9a42('0x35')](_0x5b6e7b[_0x9a42('0x31')],qs[_0x9a42('0x37')](_0x53be82[_0x9a42('0x33')][_0x9a42('0x37')]));_0x47984c[_0x9a42('0x36')]=_0x47984c['attributes'][_0x9a42('0x38')]?_0x47984c[_0x9a42('0x36')]:_0x5b6e7b[_0x9a42('0x31')];_0x47984c[_0x9a42('0x3a')]=qs['sort'](_0x53be82[_0x9a42('0x33')][_0x9a42('0x3b')]);_0x47984c[_0x9a42('0x3c')]=qs[_0x9a42('0x34')](_[_0x9a42('0x3d')](_0x53be82[_0x9a42('0x33')],_0x5b6e7b['filters']));if(_0x53be82[_0x9a42('0x33')][_0x9a42('0x40')]){_0x47984c[_0x9a42('0x3c')]=_[_0x9a42('0x3e')](_0x47984c[_0x9a42('0x3c')],{'$or':_[_0x9a42('0x2b')](_0x47984c[_0x9a42('0x36')],function(_0x2a558c){var _0x870061={};_0x870061[_0x2a558c]={'$like':'%'+_0x53be82[_0x9a42('0x33')][_0x9a42('0x40')]+'%'};return _0x870061;})});}_0x47984c=_['merge']({},_0x47984c,_0x53be82[_0x9a42('0x4c')]);return _0x52b074[_0x9a42('0x4e')](_0x47984c);}})['then'](function(_0x133933){if(_0x133933){_0x51690c=_0x133933[_0x9a42('0x38')];if(!_0x53be82['query'][_0x9a42('0x4d')](_0x9a42('0x39'))){_0x47984c[_0x9a42('0x1e')]=qs[_0x9a42('0x1e')](_0x53be82['query'][_0x9a42('0x1e')]);_0x47984c['offset']=qs[_0x9a42('0x1c')](_0x53be82['query'][_0x9a42('0x1c')]);}return _0x52b074[_0x9a42('0x4e')](_0x47984c);}})[_0x9a42('0x26')](function(_0x45d3fa){if(_0x45d3fa){return _0x45d3fa?{'count':_0x51690c,'rows':_0x45d3fa}:null;}})[_0x9a42('0x26')](respondWithResult(_0xef201d,null))[_0x9a42('0x43')](handleError(_0xef201d,null));};exports[_0x9a42('0x4f')]=function(_0x13089d,_0x1ccd7a,_0x455714){var _0x9c4f0c={};var _0x1f3e40={};var _0x3b5912;var _0x233031;return db[_0x9a42('0x2c')][_0x9a42('0x4a')]({'where':{'id':_0x13089d[_0x9a42('0x45')]['id']}})[_0x9a42('0x26')](handleEntityNotFound(_0x1ccd7a,null))['then'](function(_0xf4f8ad){if(_0xf4f8ad){_0x3b5912=_0xf4f8ad;_0x1f3e40[_0x9a42('0x31')]=_[_0x9a42('0x32')](db[_0x9a42('0x4b')][_0x9a42('0x2d')]);_0x1f3e40[_0x9a42('0x33')]=_['keys'](_0x13089d[_0x9a42('0x33')]);_0x1f3e40[_0x9a42('0x34')]=_[_0x9a42('0x35')](_0x1f3e40[_0x9a42('0x31')],_0x1f3e40[_0x9a42('0x33')]);_0x9c4f0c[_0x9a42('0x36')]=_[_0x9a42('0x35')](_0x1f3e40[_0x9a42('0x31')],qs[_0x9a42('0x37')](_0x13089d[_0x9a42('0x33')][_0x9a42('0x37')]));_0x9c4f0c[_0x9a42('0x36')]=_0x9c4f0c[_0x9a42('0x36')][_0x9a42('0x38')]?_0x9c4f0c['attributes']:_0x1f3e40[_0x9a42('0x31')];_0x9c4f0c[_0x9a42('0x3a')]=qs[_0x9a42('0x3b')](_0x13089d[_0x9a42('0x33')][_0x9a42('0x3b')]);_0x9c4f0c[_0x9a42('0x3c')]=qs[_0x9a42('0x34')](_[_0x9a42('0x3d')](_0x13089d[_0x9a42('0x33')],_0x1f3e40[_0x9a42('0x34')]));if(_0x13089d['query'][_0x9a42('0x40')]){_0x9c4f0c[_0x9a42('0x3c')]=_[_0x9a42('0x3e')](_0x9c4f0c[_0x9a42('0x3c')],{'$or':_[_0x9a42('0x2b')](_0x9c4f0c[_0x9a42('0x36')],function(_0x4681ed){var _0x51dab9={};_0x51dab9[_0x4681ed]={'$like':'%'+_0x13089d[_0x9a42('0x33')]['filter']+'%'};return _0x51dab9;})});}_0x9c4f0c=_['merge']({},_0x9c4f0c,_0x13089d[_0x9a42('0x4c')]);return _0x3b5912[_0x9a42('0x4f')](_0x9c4f0c);}})[_0x9a42('0x26')](function(_0x1d81bd){if(_0x1d81bd){_0x233031=_0x1d81bd['length'];if(!_0x13089d['query'][_0x9a42('0x4d')](_0x9a42('0x39'))){_0x9c4f0c['limit']=qs[_0x9a42('0x1e')](_0x13089d[_0x9a42('0x33')][_0x9a42('0x1e')]);_0x9c4f0c[_0x9a42('0x1c')]=qs[_0x9a42('0x1c')](_0x13089d['query'][_0x9a42('0x1c')]);}return _0x3b5912['getDescriptions'](_0x9c4f0c);}})['then'](function(_0x5a9169){if(_0x5a9169){return _0x5a9169?{'count':_0x233031,'rows':_0x5a9169}:null;}})[_0x9a42('0x26')](respondWithResult(_0x1ccd7a,null))[_0x9a42('0x43')](handleError(_0x1ccd7a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7a07d14..6289b9c 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 _0x395d=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x49f913,_0x12ccd8){var _0xf48ea5=function(_0xfd48b0){while(--_0xfd48b0){_0x49f913['push'](_0x49f913['shift']());}};_0xf48ea5(++_0x12ccd8);}(_0x395d,0xad));var _0xd395=function(_0x2b077f,_0x4bb113){_0x2b077f=_0x2b077f-0x0;var _0x59c231=_0x395d[_0x2b077f];return _0x59c231;};'use strict';var _=require(_0xd395('0x0'));var util=require(_0xd395('0x1'));var logger=require(_0xd395('0x2'))('api');var moment=require(_0xd395('0x3'));var BPromise=require(_0xd395('0x4'));var rp=require(_0xd395('0x5'));var fs=require('fs');var path=require(_0xd395('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd395('0x7'));module[_0xd395('0x8')]=function(_0x131d66,_0x293771){return _0x131d66[_0xd395('0x9')](_0xd395('0xa'),attributes,{'tableName':_0xd395('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa78b=['int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration'];(function(_0x20dc2f,_0x1dbf3f){var _0x50f79d=function(_0x1674da){while(--_0x1674da){_0x20dc2f['push'](_0x20dc2f['shift']());}};_0x50f79d(++_0x1dbf3f);}(_0xa78b,0x1dd));var _0xba78=function(_0x1151cf,_0xaa402a){_0x1151cf=_0x1151cf-0x0;var _0xc6504e=_0xa78b[_0x1151cf];return _0xc6504e;};'use strict';var _=require('lodash');var util=require(_0xba78('0x0'));var logger=require(_0xba78('0x1'))(_0xba78('0x2'));var moment=require(_0xba78('0x3'));var BPromise=require(_0xba78('0x4'));var rp=require(_0xba78('0x5'));var fs=require('fs');var path=require(_0xba78('0x6'));var rimraf=require(_0xba78('0x7'));var config=require(_0xba78('0x8'));var attributes=require(_0xba78('0x9'));module[_0xba78('0xa')]=function(_0x3f582f,_0x2dcce2){return _0x3f582f[_0xba78('0xb')](_0xba78('0xc'),attributes,{'tableName':_0xba78('0xd'),'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 0640572..a42492f 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 _0x4e9d=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4e9d,0x171));var _0xd4e9=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0x4e9d[_0x2b0a86];return _0x955940;};'use strict';var _=require(_0xd4e9('0x0'));var util=require(_0xd4e9('0x1'));var moment=require(_0xd4e9('0x2'));var BPromise=require(_0xd4e9('0x3'));var rs=require(_0xd4e9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4e9('0x5'))['db'];var utils=require(_0xd4e9('0x6'));var logger=require(_0xd4e9('0x7'))(_0xd4e9('0x8'));var config=require('../../config/environment');var jayson=require(_0xd4e9('0x9'));var client=jayson[_0xd4e9('0xa')][_0xd4e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24b1dc,_0x1c0deb,_0x14dd00){return new BPromise(function(_0x216fd2,_0x53fd0c){return client[_0xd4e9('0xc')](_0x24b1dc,_0x14dd00)[_0xd4e9('0xd')](function(_0x41aa1f){logger[_0xd4e9('0xe')](_0xd4e9('0xf'),_0x1c0deb,'request\x20sent');logger[_0xd4e9('0x10')](_0xd4e9('0x11'),_0x1c0deb,_0xd4e9('0x12'),JSON['stringify'](_0x41aa1f));if(_0x41aa1f[_0xd4e9('0x13')]){if(_0x41aa1f[_0xd4e9('0x13')]['code']===0x1f4){logger[_0xd4e9('0x13')](_0xd4e9('0xf'),_0x1c0deb,_0x41aa1f[_0xd4e9('0x13')]['message']);return _0x53fd0c(_0x41aa1f[_0xd4e9('0x13')][_0xd4e9('0x14')]);}logger[_0xd4e9('0x13')](_0xd4e9('0xf'),_0x1c0deb,_0x41aa1f[_0xd4e9('0x13')][_0xd4e9('0x14')]);return _0x216fd2(_0x41aa1f[_0xd4e9('0x13')]['message']);}else{logger[_0xd4e9('0xe')](_0xd4e9('0xf'),_0x1c0deb,_0xd4e9('0x12'));_0x216fd2(_0x41aa1f[_0xd4e9('0x15')][_0xd4e9('0x14')]);}})[_0xd4e9('0x16')](function(_0x21217b){logger[_0xd4e9('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x1c0deb,_0x21217b);_0x53fd0c(_0x21217b);});});} \ No newline at end of file +var _0x2f7d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x4e3bff,_0x54ca13){var _0x58de8e=function(_0x558cfb){while(--_0x558cfb){_0x4e3bff['push'](_0x4e3bff['shift']());}};_0x58de8e(++_0x54ca13);}(_0x2f7d,0x188));var _0xd2f7=function(_0x1cdce9,_0x4a515e){_0x1cdce9=_0x1cdce9-0x0;var _0x820c6d=_0x2f7d[_0x1cdce9];return _0x820c6d;};'use strict';var _=require('lodash');var util=require(_0xd2f7('0x0'));var moment=require(_0xd2f7('0x1'));var BPromise=require(_0xd2f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2f7('0x3'));var db=require(_0xd2f7('0x4'))['db'];var utils=require(_0xd2f7('0x5'));var logger=require(_0xd2f7('0x6'))(_0xd2f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xd2f7('0x8'));var client=jayson[_0xd2f7('0x9')][_0xd2f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x554823,_0x82e59e,_0x4f4ff4){return new BPromise(function(_0x5f2662,_0x4dac3b){return client['request'](_0x554823,_0x4f4ff4)['then'](function(_0x2a7269){logger[_0xd2f7('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x82e59e,_0xd2f7('0xc'));logger[_0xd2f7('0xd')](_0xd2f7('0xe'),_0x82e59e,_0xd2f7('0xc'),JSON[_0xd2f7('0xf')](_0x2a7269));if(_0x2a7269[_0xd2f7('0x10')]){if(_0x2a7269[_0xd2f7('0x10')][_0xd2f7('0x11')]===0x1f4){logger[_0xd2f7('0x10')](_0xd2f7('0x12'),_0x82e59e,_0x2a7269[_0xd2f7('0x10')][_0xd2f7('0x13')]);return _0x4dac3b(_0x2a7269[_0xd2f7('0x10')][_0xd2f7('0x13')]);}logger[_0xd2f7('0x10')](_0xd2f7('0x12'),_0x82e59e,_0x2a7269[_0xd2f7('0x10')][_0xd2f7('0x13')]);return _0x5f2662(_0x2a7269['error'][_0xd2f7('0x13')]);}else{logger[_0xd2f7('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x82e59e,_0xd2f7('0xc'));_0x5f2662(_0x2a7269[_0xd2f7('0x14')][_0xd2f7('0x13')]);}})[_0xd2f7('0x15')](function(_0xf59454){logger['error'](_0xd2f7('0x12'),_0x82e59e,_0xf59454);_0x4dac3b(_0xf59454);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f755e33..6e710d4 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 _0x0a6c=['./intZohoField.controller','isAuthenticated','index','/:id','show','post','create','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x103c64,_0x148b2d){var _0x23607c=function(_0x3ceeb3){while(--_0x3ceeb3){_0x103c64['push'](_0x103c64['shift']());}};_0x23607c(++_0x148b2d);}(_0x0a6c,0x159));var _0xc0a6=function(_0x251b98,_0xdb7c23){_0x251b98=_0x251b98-0x0;var _0x1c8880=_0x0a6c[_0x251b98];return _0x1c8880;};'use strict';var multer=require('multer');var util=require(_0xc0a6('0x0'));var path=require(_0xc0a6('0x1'));var timeout=require(_0xc0a6('0x2'));var express=require(_0xc0a6('0x3'));var router=express['Router']();var fs_extra=require(_0xc0a6('0x4'));var auth=require(_0xc0a6('0x5'));var interaction=require(_0xc0a6('0x6'));var config=require('../../config/environment');var controller=require(_0xc0a6('0x7'));router['get']('/',auth[_0xc0a6('0x8')](),controller[_0xc0a6('0x9')]);router['get'](_0xc0a6('0xa'),auth[_0xc0a6('0x8')](),controller[_0xc0a6('0xb')]);router[_0xc0a6('0xc')]('/',auth[_0xc0a6('0x8')](),controller[_0xc0a6('0xd')]);router['put'](_0xc0a6('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc0a6('0xa'),auth[_0xc0a6('0x8')](),controller[_0xc0a6('0xe')]);module[_0xc0a6('0xf')]=router; \ No newline at end of file +var _0x5df4=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports'];(function(_0x1e9417,_0x55a246){var _0x2141c4=function(_0x5cbf33){while(--_0x5cbf33){_0x1e9417['push'](_0x1e9417['shift']());}};_0x2141c4(++_0x55a246);}(_0x5df4,0xab));var _0x45df=function(_0x5e93d1,_0x442f66){_0x5e93d1=_0x5e93d1-0x0;var _0x130126=_0x5df4[_0x5e93d1];return _0x130126;};'use strict';var multer=require(_0x45df('0x0'));var util=require(_0x45df('0x1'));var path=require(_0x45df('0x2'));var timeout=require(_0x45df('0x3'));var express=require(_0x45df('0x4'));var router=express[_0x45df('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x45df('0x6'));var interaction=require(_0x45df('0x7'));var config=require('../../config/environment');var controller=require(_0x45df('0x8'));router[_0x45df('0x9')]('/',auth[_0x45df('0xa')](),controller[_0x45df('0xb')]);router['get'](_0x45df('0xc'),auth[_0x45df('0xa')](),controller[_0x45df('0xd')]);router[_0x45df('0xe')]('/',auth[_0x45df('0xa')](),controller[_0x45df('0xf')]);router[_0x45df('0x10')]('/:id',auth[_0x45df('0xa')](),controller['update']);router[_0x45df('0x11')](_0x45df('0xc'),auth[_0x45df('0xa')](),controller['destroy']);module[_0x45df('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6a8c4b4..b9646c0 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 _0xa730=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x335d2d,_0x26e065){var _0x379073=function(_0x51f553){while(--_0x51f553){_0x335d2d['push'](_0x335d2d['shift']());}};_0x379073(++_0x26e065);}(_0xa730,0x1df));var _0x0a73=function(_0x1ee1d7,_0x5b730d){_0x1ee1d7=_0x1ee1d7-0x0;var _0x2cd5cb=_0xa730[_0x1ee1d7];return _0x2cd5cb;};'use strict';var Sequelize=require(_0x0a73('0x0'));module[_0x0a73('0x1')]={'type':{'type':Sequelize[_0x0a73('0x2')]('string',_0x0a73('0x3'),_0x0a73('0x4'),_0x0a73('0x5'),_0x0a73('0x6')),'defaultValue':_0x0a73('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0a73('0x8')]},'keyType':{'type':Sequelize[_0x0a73('0x2')](_0x0a73('0x7'),_0x0a73('0x3'),_0x0a73('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0a73('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a73('0x8')]}}; \ No newline at end of file +var _0x7f8e=['sequelize','exports','string','variable','picklist','STRING','ENUM','customVariable'];(function(_0x28dbdf,_0x4615ea){var _0x2b3d46=function(_0x22f040){while(--_0x22f040){_0x28dbdf['push'](_0x28dbdf['shift']());}};_0x2b3d46(++_0x4615ea);}(_0x7f8e,0xc0));var _0xe7f8=function(_0xd27544,_0x5e9fb1){_0xd27544=_0xd27544-0x0;var _0x283d71=_0x7f8e[_0xd27544];return _0x283d71;};'use strict';var Sequelize=require(_0xe7f8('0x0'));module[_0xe7f8('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe7f8('0x2'),_0xe7f8('0x3'),'customVariable','keyValue',_0xe7f8('0x4')),'defaultValue':_0xe7f8('0x2')},'content':{'type':Sequelize[_0xe7f8('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe7f8('0x6')](_0xe7f8('0x2'),_0xe7f8('0x3'),_0xe7f8('0x7'))},'keyContent':{'type':Sequelize[_0xe7f8('0x5')]},'idField':{'type':Sequelize[_0xe7f8('0x5')]},'nameField':{'type':Sequelize[_0xe7f8('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe7f8('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8ba1f62..95bafeb 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 _0x0767=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','ZohoField','findAll','rows','catch','params','includeAll','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2a11c6,_0x12d7b8){var _0x4393ff=function(_0x2388d9){while(--_0x2388d9){_0x2a11c6['push'](_0x2a11c6['shift']());}};_0x4393ff(++_0x12d7b8);}(_0x0767,0xd2));var _0x7076=function(_0x4dc7f1,_0x26c9aa){_0x4dc7f1=_0x4dc7f1-0x0;var _0x1e348a=_0x0767[_0x4dc7f1];return _0x1e348a;};'use strict';var emlformat=require(_0x7076('0x0'));var rimraf=require(_0x7076('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7076('0x2'));var rp=require(_0x7076('0x3'));var moment=require('moment');var BPromise=require(_0x7076('0x4'));var Mustache=require(_0x7076('0x5'));var util=require('util');var path=require(_0x7076('0x6'));var sox=require(_0x7076('0x7'));var csv=require('to-csv');var ejs=require(_0x7076('0x8'));var fs=require('fs');var fs_extra=require(_0x7076('0x9'));var _=require(_0x7076('0xa'));var squel=require(_0x7076('0xb'));var crypto=require(_0x7076('0xc'));var jsforce=require(_0x7076('0xd'));var deskjs=require(_0x7076('0xe'));var toCsv=require(_0x7076('0xf'));var querystring=require(_0x7076('0x10'));var Papa=require(_0x7076('0x11'));var Redis=require(_0x7076('0x12'));var authService=require(_0x7076('0x13'));var qs=require(_0x7076('0x14'));var as=require(_0x7076('0x15'));var hardwareService=require(_0x7076('0x16'));var logger=require('../../config/logger')(_0x7076('0x17'));var utils=require('../../config/utils');var config=require(_0x7076('0x18'));var licenseUtil=require(_0x7076('0x19'));var db=require(_0x7076('0x1a'))['db'];function respondWithStatusCode(_0x4dd909,_0xe11e8c){_0xe11e8c=_0xe11e8c||0xcc;return function(_0x503428){if(_0x503428){return _0x4dd909[_0x7076('0x1b')](_0xe11e8c);}return _0x4dd909[_0x7076('0x1c')](_0xe11e8c)[_0x7076('0x1d')]();};}function respondWithResult(_0x99435e,_0x7acdb1){_0x7acdb1=_0x7acdb1||0xc8;return function(_0x260151){if(_0x260151){return _0x99435e[_0x7076('0x1c')](_0x7acdb1)[_0x7076('0x1e')](_0x260151);}};}function respondWithFilteredResult(_0x3241a0,_0x29573d){return function(_0x311c45){if(_0x311c45){var _0x53ea46=typeof _0x29573d[_0x7076('0x1f')]===_0x7076('0x20')&&typeof _0x29573d[_0x7076('0x21')]===_0x7076('0x20');var _0x2d9fc5=_0x311c45[_0x7076('0x22')];var _0x1c2c1e=_0x53ea46?0x0:_0x29573d[_0x7076('0x1f')];var _0x30ed93=_0x53ea46?_0x311c45[_0x7076('0x22')]:_0x29573d[_0x7076('0x1f')]+_0x29573d[_0x7076('0x21')];var _0x3351d2;if(_0x30ed93>=_0x2d9fc5){_0x30ed93=_0x2d9fc5;_0x3351d2=0xc8;}else{_0x3351d2=0xce;}_0x3241a0[_0x7076('0x1c')](_0x3351d2);return _0x3241a0['set'](_0x7076('0x23'),_0x1c2c1e+'-'+_0x30ed93+'/'+_0x2d9fc5)['json'](_0x311c45);}return null;};}function patchUpdates(_0x419f1b){return function(_0x937ae3){try{jsonpatch[_0x7076('0x24')](_0x937ae3,_0x419f1b,!![]);}catch(_0x214597){return BPromise[_0x7076('0x25')](_0x214597);}return _0x937ae3['save']();};}function saveUpdates(_0x41a162,_0x3ca2f1){return function(_0x3e6415){if(_0x3e6415){return _0x3e6415[_0x7076('0x26')](_0x41a162)[_0x7076('0x27')](function(_0x24de06){return _0x24de06;});}return null;};}function removeEntity(_0x3ff1a8,_0x23d415){return function(_0x4647b5){if(_0x4647b5){return _0x4647b5['destroy']()['then'](function(){_0x3ff1a8['status'](0xcc)[_0x7076('0x1d')]();});}};}function handleEntityNotFound(_0x325f6c,_0x93b1d6){return function(_0x174ff4){if(!_0x174ff4){_0x325f6c[_0x7076('0x1b')](0x194);}return _0x174ff4;};}function handleError(_0x505f63,_0x19c02a){_0x19c02a=_0x19c02a||0x1f4;return function(_0x36bec2){logger[_0x7076('0x28')](_0x36bec2[_0x7076('0x29')]);if(_0x36bec2[_0x7076('0x2a')]){delete _0x36bec2['name'];}_0x505f63[_0x7076('0x1c')](_0x19c02a)[_0x7076('0x2b')](_0x36bec2);};}exports[_0x7076('0x2c')]=function(_0x2dca44,_0x485f5d){var _0x526ea5={},_0x51fc78={},_0x139900={'count':0x0,'rows':[]};var _0xa177c6=_[_0x7076('0x2d')](db['ZohoField'][_0x7076('0x2e')],function(_0x24448e){return{'name':_0x24448e['fieldName'],'type':_0x24448e[_0x7076('0x2f')][_0x7076('0x30')]};});_0x51fc78['model']=_[_0x7076('0x2d')](_0xa177c6,_0x7076('0x2a'));_0x51fc78[_0x7076('0x31')]=_[_0x7076('0x32')](_0x2dca44[_0x7076('0x31')]);_0x51fc78[_0x7076('0x33')]=_[_0x7076('0x34')](_0x51fc78[_0x7076('0x35')],_0x51fc78['query']);_0x526ea5[_0x7076('0x36')]=_[_0x7076('0x34')](_0x51fc78[_0x7076('0x35')],qs[_0x7076('0x37')](_0x2dca44[_0x7076('0x31')][_0x7076('0x37')]));_0x526ea5[_0x7076('0x36')]=_0x526ea5['attributes'][_0x7076('0x38')]?_0x526ea5[_0x7076('0x36')]:_0x51fc78[_0x7076('0x35')];if(!_0x2dca44[_0x7076('0x31')][_0x7076('0x39')](_0x7076('0x3a'))){_0x526ea5[_0x7076('0x21')]=qs[_0x7076('0x21')](_0x2dca44[_0x7076('0x31')]['limit']);_0x526ea5[_0x7076('0x1f')]=qs[_0x7076('0x1f')](_0x2dca44[_0x7076('0x31')][_0x7076('0x1f')]);}_0x526ea5['order']=qs['sort'](_0x2dca44[_0x7076('0x31')][_0x7076('0x3b')]);_0x526ea5[_0x7076('0x3c')]=qs[_0x7076('0x33')](_[_0x7076('0x3d')](_0x2dca44[_0x7076('0x31')],_0x51fc78[_0x7076('0x33')]),_0xa177c6);if(_0x2dca44[_0x7076('0x31')]['filter']){_0x526ea5['where']=_[_0x7076('0x3e')](_0x526ea5[_0x7076('0x3c')],{'$or':_[_0x7076('0x2d')](_0xa177c6,function(_0x21ebb4){if(_0x21ebb4[_0x7076('0x2f')]!=='VIRTUAL'){var _0x2a7002={};_0x2a7002[_0x21ebb4[_0x7076('0x2a')]]={'$like':'%'+_0x2dca44[_0x7076('0x31')][_0x7076('0x3f')]+'%'};return _0x2a7002;}})});}_0x526ea5=_[_0x7076('0x3e')]({},_0x526ea5,_0x2dca44[_0x7076('0x40')]);var _0x363539={'where':_0x526ea5['where']};return db[_0x7076('0x41')]['count'](_0x363539)[_0x7076('0x27')](function(_0x377b79){_0x139900['count']=_0x377b79;if(_0x2dca44[_0x7076('0x31')]['includeAll']){_0x526ea5['include']=[{'all':!![]}];}return db[_0x7076('0x41')][_0x7076('0x42')](_0x526ea5);})[_0x7076('0x27')](function(_0x249a9a){_0x139900[_0x7076('0x43')]=_0x249a9a;return _0x139900;})['then'](respondWithFilteredResult(_0x485f5d,_0x526ea5))[_0x7076('0x44')](handleError(_0x485f5d,null));};exports['show']=function(_0x401674,_0x969d92){var _0x5f024c={'raw':!![],'where':{'id':_0x401674[_0x7076('0x45')]['id']}},_0x1186c2={};_0x1186c2[_0x7076('0x35')]=_[_0x7076('0x32')](db[_0x7076('0x41')][_0x7076('0x2e')]);_0x1186c2[_0x7076('0x31')]=_[_0x7076('0x32')](_0x401674[_0x7076('0x31')]);_0x1186c2[_0x7076('0x33')]=_[_0x7076('0x34')](_0x1186c2['model'],_0x1186c2[_0x7076('0x31')]);_0x5f024c[_0x7076('0x36')]=_['intersection'](_0x1186c2['model'],qs[_0x7076('0x37')](_0x401674['query'][_0x7076('0x37')]));_0x5f024c[_0x7076('0x36')]=_0x5f024c[_0x7076('0x36')]['length']?_0x5f024c['attributes']:_0x1186c2[_0x7076('0x35')];if(_0x401674['query'][_0x7076('0x46')]){_0x5f024c['include']=[{'all':!![]}];}_0x5f024c=_['merge']({},_0x5f024c,_0x401674[_0x7076('0x40')]);return db[_0x7076('0x41')][_0x7076('0x47')](_0x5f024c)[_0x7076('0x27')](handleEntityNotFound(_0x969d92,null))[_0x7076('0x27')](respondWithResult(_0x969d92,null))[_0x7076('0x44')](handleError(_0x969d92,null));};exports[_0x7076('0x48')]=function(_0x1d0805,_0x3d97a6){return db[_0x7076('0x41')][_0x7076('0x48')](_0x1d0805[_0x7076('0x49')],{})['then'](respondWithResult(_0x3d97a6,0xc9))[_0x7076('0x44')](handleError(_0x3d97a6,null));};exports['update']=function(_0x1bc849,_0x110215){if(_0x1bc849[_0x7076('0x49')]['id']){delete _0x1bc849[_0x7076('0x49')]['id'];}return db[_0x7076('0x41')][_0x7076('0x47')]({'where':{'id':_0x1bc849[_0x7076('0x45')]['id']}})[_0x7076('0x27')](handleEntityNotFound(_0x110215,null))[_0x7076('0x27')](saveUpdates(_0x1bc849['body'],null))[_0x7076('0x27')](respondWithResult(_0x110215,null))[_0x7076('0x44')](handleError(_0x110215,null));};exports[_0x7076('0x4a')]=function(_0x16a3fb,_0x5270fa){return db[_0x7076('0x41')]['find']({'where':{'id':_0x16a3fb[_0x7076('0x45')]['id']}})[_0x7076('0x27')](handleEntityNotFound(_0x5270fa,null))[_0x7076('0x27')](removeEntity(_0x5270fa,null))[_0x7076('0x44')](handleError(_0x5270fa,null));}; \ No newline at end of file +var _0xf780=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','limit','status','Content-Range','json','apply','reject','save','update','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','filter','ZohoField','then','includeAll','include','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x4dab22,_0x59a530){var _0x515653=function(_0x3df7b6){while(--_0x3df7b6){_0x4dab22['push'](_0x4dab22['shift']());}};_0x515653(++_0x59a530);}(_0xf780,0xd3));var _0x0f78=function(_0x3ff0d1,_0x2afe78){_0x3ff0d1=_0x3ff0d1-0x0;var _0x12e4ab=_0xf780[_0x3ff0d1];return _0x12e4ab;};'use strict';var emlformat=require(_0x0f78('0x0'));var rimraf=require(_0x0f78('0x1'));var zipdir=require(_0x0f78('0x2'));var jsonpatch=require(_0x0f78('0x3'));var rp=require(_0x0f78('0x4'));var moment=require(_0x0f78('0x5'));var BPromise=require(_0x0f78('0x6'));var Mustache=require(_0x0f78('0x7'));var util=require('util');var path=require(_0x0f78('0x8'));var sox=require(_0x0f78('0x9'));var csv=require('to-csv');var ejs=require(_0x0f78('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f78('0xb'));var squel=require(_0x0f78('0xc'));var crypto=require(_0x0f78('0xd'));var jsforce=require(_0x0f78('0xe'));var deskjs=require(_0x0f78('0xf'));var toCsv=require(_0x0f78('0x10'));var querystring=require(_0x0f78('0x11'));var Papa=require(_0x0f78('0x12'));var Redis=require(_0x0f78('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f78('0x15'))(_0x0f78('0x16'));var utils=require('../../config/utils');var config=require(_0x0f78('0x17'));var licenseUtil=require(_0x0f78('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19f24e,_0x3e81a5){_0x3e81a5=_0x3e81a5||0xcc;return function(_0x21dcbd){if(_0x21dcbd){return _0x19f24e[_0x0f78('0x19')](_0x3e81a5);}return _0x19f24e['status'](_0x3e81a5)[_0x0f78('0x1a')]();};}function respondWithResult(_0x4a90ff,_0x520edd){_0x520edd=_0x520edd||0xc8;return function(_0x5e3dda){if(_0x5e3dda){return _0x4a90ff['status'](_0x520edd)['json'](_0x5e3dda);}};}function respondWithFilteredResult(_0xfb422e,_0x1d15ef){return function(_0x13aed3){if(_0x13aed3){var _0x39a834=typeof _0x1d15ef[_0x0f78('0x1b')]===_0x0f78('0x1c')&&typeof _0x1d15ef['limit']===_0x0f78('0x1c');var _0x348d70=_0x13aed3[_0x0f78('0x1d')];var _0x40bccf=_0x39a834?0x0:_0x1d15ef[_0x0f78('0x1b')];var _0x53ee9b=_0x39a834?_0x13aed3[_0x0f78('0x1d')]:_0x1d15ef[_0x0f78('0x1b')]+_0x1d15ef[_0x0f78('0x1e')];var _0x179080;if(_0x53ee9b>=_0x348d70){_0x53ee9b=_0x348d70;_0x179080=0xc8;}else{_0x179080=0xce;}_0xfb422e[_0x0f78('0x1f')](_0x179080);return _0xfb422e['set'](_0x0f78('0x20'),_0x40bccf+'-'+_0x53ee9b+'/'+_0x348d70)[_0x0f78('0x21')](_0x13aed3);}return null;};}function patchUpdates(_0x555db2){return function(_0x1ea714){try{jsonpatch[_0x0f78('0x22')](_0x1ea714,_0x555db2,!![]);}catch(_0x339253){return BPromise[_0x0f78('0x23')](_0x339253);}return _0x1ea714[_0x0f78('0x24')]();};}function saveUpdates(_0x2d5aa9,_0x6302f0){return function(_0x30e25a){if(_0x30e25a){return _0x30e25a[_0x0f78('0x25')](_0x2d5aa9)['then'](function(_0x23a68b){return _0x23a68b;});}return null;};}function removeEntity(_0x4b3db6,_0x54fc6f){return function(_0x5deae4){if(_0x5deae4){return _0x5deae4[_0x0f78('0x26')]()['then'](function(){_0x4b3db6[_0x0f78('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb02c,_0x3658d1){return function(_0x3046c0){if(!_0x3046c0){_0x1eb02c[_0x0f78('0x19')](0x194);}return _0x3046c0;};}function handleError(_0x2a8a8b,_0x492216){_0x492216=_0x492216||0x1f4;return function(_0x4c4c16){logger[_0x0f78('0x27')](_0x4c4c16['stack']);if(_0x4c4c16[_0x0f78('0x28')]){delete _0x4c4c16['name'];}_0x2a8a8b[_0x0f78('0x1f')](_0x492216)[_0x0f78('0x29')](_0x4c4c16);};}exports[_0x0f78('0x2a')]=function(_0x43cd4b,_0x50b8ae){var _0x4ace85={},_0x541e34={},_0x3ca5ca={'count':0x0,'rows':[]};var _0x9fb0cc=_[_0x0f78('0x2b')](db['ZohoField'][_0x0f78('0x2c')],function(_0x2ce8e2){return{'name':_0x2ce8e2[_0x0f78('0x2d')],'type':_0x2ce8e2[_0x0f78('0x2e')]['key']};});_0x541e34[_0x0f78('0x2f')]=_[_0x0f78('0x2b')](_0x9fb0cc,_0x0f78('0x28'));_0x541e34[_0x0f78('0x30')]=_[_0x0f78('0x31')](_0x43cd4b[_0x0f78('0x30')]);_0x541e34[_0x0f78('0x32')]=_[_0x0f78('0x33')](_0x541e34[_0x0f78('0x2f')],_0x541e34[_0x0f78('0x30')]);_0x4ace85['attributes']=_[_0x0f78('0x33')](_0x541e34['model'],qs[_0x0f78('0x34')](_0x43cd4b[_0x0f78('0x30')][_0x0f78('0x34')]));_0x4ace85[_0x0f78('0x35')]=_0x4ace85['attributes'][_0x0f78('0x36')]?_0x4ace85['attributes']:_0x541e34['model'];if(!_0x43cd4b[_0x0f78('0x30')][_0x0f78('0x37')](_0x0f78('0x38'))){_0x4ace85[_0x0f78('0x1e')]=qs['limit'](_0x43cd4b[_0x0f78('0x30')][_0x0f78('0x1e')]);_0x4ace85[_0x0f78('0x1b')]=qs[_0x0f78('0x1b')](_0x43cd4b[_0x0f78('0x30')][_0x0f78('0x1b')]);}_0x4ace85[_0x0f78('0x39')]=qs['sort'](_0x43cd4b['query']['sort']);_0x4ace85[_0x0f78('0x3a')]=qs[_0x0f78('0x32')](_['pick'](_0x43cd4b[_0x0f78('0x30')],_0x541e34['filters']),_0x9fb0cc);if(_0x43cd4b['query']['filter']){_0x4ace85[_0x0f78('0x3a')]=_[_0x0f78('0x3b')](_0x4ace85[_0x0f78('0x3a')],{'$or':_[_0x0f78('0x2b')](_0x9fb0cc,function(_0x4ed47e){if(_0x4ed47e['type']!==_0x0f78('0x3c')){var _0x21f17d={};_0x21f17d[_0x4ed47e[_0x0f78('0x28')]]={'$like':'%'+_0x43cd4b['query'][_0x0f78('0x3d')]+'%'};return _0x21f17d;}})});}_0x4ace85=_['merge']({},_0x4ace85,_0x43cd4b['options']);var _0x414ef1={'where':_0x4ace85[_0x0f78('0x3a')]};return db[_0x0f78('0x3e')][_0x0f78('0x1d')](_0x414ef1)[_0x0f78('0x3f')](function(_0x3d90a4){_0x3ca5ca[_0x0f78('0x1d')]=_0x3d90a4;if(_0x43cd4b[_0x0f78('0x30')][_0x0f78('0x40')]){_0x4ace85[_0x0f78('0x41')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x4ace85);})[_0x0f78('0x3f')](function(_0x3f81f7){_0x3ca5ca[_0x0f78('0x42')]=_0x3f81f7;return _0x3ca5ca;})[_0x0f78('0x3f')](respondWithFilteredResult(_0x50b8ae,_0x4ace85))[_0x0f78('0x43')](handleError(_0x50b8ae,null));};exports[_0x0f78('0x44')]=function(_0x45ba20,_0x118c76){var _0x2b3fcb={'raw':!![],'where':{'id':_0x45ba20[_0x0f78('0x45')]['id']}},_0x2a8877={};_0x2a8877[_0x0f78('0x2f')]=_['keys'](db['ZohoField'][_0x0f78('0x2c')]);_0x2a8877['query']=_[_0x0f78('0x31')](_0x45ba20[_0x0f78('0x30')]);_0x2a8877[_0x0f78('0x32')]=_['intersection'](_0x2a8877[_0x0f78('0x2f')],_0x2a8877[_0x0f78('0x30')]);_0x2b3fcb[_0x0f78('0x35')]=_['intersection'](_0x2a8877[_0x0f78('0x2f')],qs[_0x0f78('0x34')](_0x45ba20['query'][_0x0f78('0x34')]));_0x2b3fcb[_0x0f78('0x35')]=_0x2b3fcb[_0x0f78('0x35')][_0x0f78('0x36')]?_0x2b3fcb['attributes']:_0x2a8877[_0x0f78('0x2f')];if(_0x45ba20[_0x0f78('0x30')]['includeAll']){_0x2b3fcb['include']=[{'all':!![]}];}_0x2b3fcb=_['merge']({},_0x2b3fcb,_0x45ba20[_0x0f78('0x46')]);return db['ZohoField'][_0x0f78('0x47')](_0x2b3fcb)[_0x0f78('0x3f')](handleEntityNotFound(_0x118c76,null))[_0x0f78('0x3f')](respondWithResult(_0x118c76,null))[_0x0f78('0x43')](handleError(_0x118c76,null));};exports[_0x0f78('0x48')]=function(_0x50074c,_0x302123){return db[_0x0f78('0x3e')][_0x0f78('0x48')](_0x50074c[_0x0f78('0x49')],{})[_0x0f78('0x3f')](respondWithResult(_0x302123,0xc9))[_0x0f78('0x43')](handleError(_0x302123,null));};exports[_0x0f78('0x25')]=function(_0xb4e25c,_0x306cbd){if(_0xb4e25c[_0x0f78('0x49')]['id']){delete _0xb4e25c[_0x0f78('0x49')]['id'];}return db[_0x0f78('0x3e')]['find']({'where':{'id':_0xb4e25c[_0x0f78('0x45')]['id']}})['then'](handleEntityNotFound(_0x306cbd,null))[_0x0f78('0x3f')](saveUpdates(_0xb4e25c[_0x0f78('0x49')],null))[_0x0f78('0x3f')](respondWithResult(_0x306cbd,null))[_0x0f78('0x43')](handleError(_0x306cbd,null));};exports[_0x0f78('0x26')]=function(_0x35da43,_0x678b27){return db[_0x0f78('0x3e')][_0x0f78('0x47')]({'where':{'id':_0x35da43['params']['id']}})[_0x0f78('0x3f')](handleEntityNotFound(_0x678b27,null))[_0x0f78('0x3f')](removeEntity(_0x678b27,null))[_0x0f78('0x43')](handleError(_0x678b27,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9601ed1..17db520 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 _0x2ef3=['path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40381d,_0x33fa74){var _0x562178=function(_0x2d2980){while(--_0x2d2980){_0x40381d['push'](_0x40381d['shift']());}};_0x562178(++_0x33fa74);}(_0x2ef3,0xba));var _0x32ef=function(_0x23378e,_0x17cb9d){_0x23378e=_0x23378e-0x0;var _0x47a277=_0x2ef3[_0x23378e];return _0x47a277;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xe'),_0x32ef('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4888=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','define','FieldId'];(function(_0x281154,_0x3d769d){var _0x378009=function(_0x4a220d){while(--_0x4a220d){_0x281154['push'](_0x281154['shift']());}};_0x378009(++_0x3d769d);}(_0x4888,0x198));var _0x8488=function(_0x1551bc,_0x334b59){_0x1551bc=_0x1551bc-0x0;var _0x228deb=_0x4888[_0x1551bc];return _0x228deb;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var logger=require(_0x8488('0x1'))(_0x8488('0x2'));var moment=require(_0x8488('0x3'));var BPromise=require(_0x8488('0x4'));var rp=require(_0x8488('0x5'));var fs=require('fs');var path=require(_0x8488('0x6'));var rimraf=require('rimraf');var config=require(_0x8488('0x7'));var attributes=require(_0x8488('0x8'));module[_0x8488('0x9')]=function(_0x421292,_0x326887){return _0x421292[_0x8488('0xa')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x8488('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 23ddc48..48fb5f2 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 _0x4fdc=['info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x4297df,_0xd06f56){var _0x4ec650=function(_0x164b82){while(--_0x164b82){_0x4297df['push'](_0x4297df['shift']());}};_0x4ec650(++_0xd06f56);}(_0x4fdc,0x128));var _0xc4fd=function(_0x3cd481,_0x8843b3){_0x3cd481=_0x3cd481-0x0;var _0xe946b6=_0x4fdc[_0x3cd481];return _0xe946b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc4fd('0x0'));var BPromise=require(_0xc4fd('0x1'));var rs=require(_0xc4fd('0x2'));var fs=require('fs');var Redis=require(_0xc4fd('0x3'));var db=require(_0xc4fd('0x4'))['db'];var utils=require(_0xc4fd('0x5'));var logger=require(_0xc4fd('0x6'))('rpc');var config=require(_0xc4fd('0x7'));var jayson=require(_0xc4fd('0x8'));var client=jayson['client'][_0xc4fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8c824d,_0x2f685c,_0x37afd9){return new BPromise(function(_0x3242a0,_0x16e874){return client[_0xc4fd('0xa')](_0x8c824d,_0x37afd9)[_0xc4fd('0xb')](function(_0x2506f2){logger[_0xc4fd('0xc')](_0xc4fd('0xd'),_0x2f685c,'request\x20sent');logger['debug'](_0xc4fd('0xe'),_0x2f685c,_0xc4fd('0xf'),JSON[_0xc4fd('0x10')](_0x2506f2));if(_0x2506f2[_0xc4fd('0x11')]){if(_0x2506f2['error'][_0xc4fd('0x12')]===0x1f4){logger[_0xc4fd('0x11')](_0xc4fd('0xd'),_0x2f685c,_0x2506f2[_0xc4fd('0x11')][_0xc4fd('0x13')]);return _0x16e874(_0x2506f2[_0xc4fd('0x11')][_0xc4fd('0x13')]);}logger[_0xc4fd('0x11')](_0xc4fd('0xd'),_0x2f685c,_0x2506f2['error'][_0xc4fd('0x13')]);return _0x3242a0(_0x2506f2[_0xc4fd('0x11')]['message']);}else{logger[_0xc4fd('0xc')](_0xc4fd('0xd'),_0x2f685c,_0xc4fd('0xf'));_0x3242a0(_0x2506f2[_0xc4fd('0x14')][_0xc4fd('0x13')]);}})[_0xc4fd('0x15')](function(_0xeb2dd3){logger[_0xc4fd('0x11')](_0xc4fd('0xd'),_0x2f685c,_0xeb2dd3);_0x16e874(_0xeb2dd3);});});} \ No newline at end of file +var _0xb1be=['error','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xb1be,0xa5));var _0xeb1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb1be[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeb1b('0x0'));var util=require('util');var moment=require(_0xeb1b('0x1'));var BPromise=require(_0xeb1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb1b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb1b('0x4'))(_0xeb1b('0x5'));var config=require(_0xeb1b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xeb1b('0x7')][_0xeb1b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4053d8,_0x4d0568,_0x4219fb){return new BPromise(function(_0x4b53ed,_0x2017a8){return client[_0xeb1b('0x9')](_0x4053d8,_0x4219fb)['then'](function(_0x334a8b){logger['info'](_0xeb1b('0xa'),_0x4d0568,_0xeb1b('0xb'));logger[_0xeb1b('0xc')](_0xeb1b('0xd'),_0x4d0568,_0xeb1b('0xb'),JSON[_0xeb1b('0xe')](_0x334a8b));if(_0x334a8b[_0xeb1b('0xf')]){if(_0x334a8b['error']['code']===0x1f4){logger['error'](_0xeb1b('0xa'),_0x4d0568,_0x334a8b['error'][_0xeb1b('0x10')]);return _0x2017a8(_0x334a8b[_0xeb1b('0xf')]['message']);}logger['error'](_0xeb1b('0xa'),_0x4d0568,_0x334a8b['error']['message']);return _0x4b53ed(_0x334a8b[_0xeb1b('0xf')][_0xeb1b('0x10')]);}else{logger[_0xeb1b('0x11')]('ZohoField,\x20%s,\x20%s',_0x4d0568,'request\x20sent');_0x4b53ed(_0x334a8b[_0xeb1b('0x12')][_0xeb1b('0x10')]);}})[_0xeb1b('0x13')](function(_0x16b486){logger[_0xeb1b('0xf')](_0xeb1b('0xa'),_0x4d0568,_0x16b486);_0x2017a8(_0x16b486);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 1d48ccd..55d6f71 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(_0x59c618,_0x494c31){var _0x6767e3=function(_0x15a77d){while(--_0x15a77d){_0x59c618['push'](_0x59c618['shift']());}};_0x6767e3(++_0x494c31);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xcb91[_0x35485a];return _0x5148e6;};'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(_0x54d0d9,_0x1f2828){var _0x379ae0=function(_0x1d156a){while(--_0x1d156a){_0x54d0d9['push'](_0x54d0d9['shift']());}};_0x379ae0(++_0x1f2828);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 3dcee41..222c314 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 _0xf322=['unique_name_and_version','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x25e373,_0x3f8304){var _0x522da5=function(_0x5e0afc){while(--_0x5e0afc){_0x25e373['push'](_0x25e373['shift']());}};_0x522da5(++_0x3f8304);}(_0xf322,0xac));var _0x2f32=function(_0x1fafde,_0x2b6b23){_0x1fafde=_0x1fafde-0x0;var _0x2dfc80=_0xf322[_0x1fafde];return _0x2dfc80;};'use strict';var Sequelize=require(_0x2f32('0x0'));module[_0x2f32('0x1')]={'name':{'type':Sequelize[_0x2f32('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x2f32('0x2')],'allowNull':![],'unique':_0x2f32('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x2f32('0x2')]},'type':{'type':Sequelize[_0x2f32('0x2')]},'size':{'type':Sequelize[_0x2f32('0x4')]},'active':{'type':Sequelize[_0x2f32('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x2f32('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0x2f32('0x6')},'description':{'type':Sequelize[_0x2f32('0x2')]},'title':{'type':Sequelize[_0x2f32('0x2')]},'remoteUri':{'type':Sequelize[_0x2f32('0x2')]},'link':{'type':Sequelize[_0x2f32('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xd8c8=['INTEGER','BOOLEAN','STRING','unique_name_and_version'];(function(_0x179b80,_0x440291){var _0x1e8d03=function(_0x466a71){while(--_0x466a71){_0x179b80['push'](_0x179b80['shift']());}};_0x1e8d03(++_0x440291);}(_0xd8c8,0xba));var _0x8d8c=function(_0x4dab67,_0x503b28){_0x4dab67=_0x4dab67-0x0;var _0x1a459b=_0xd8c8[_0x4dab67];return _0x1a459b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8d8c('0x0')],'allowNull':![],'unique':_0x8d8c('0x1')},'version':{'type':Sequelize[_0x8d8c('0x0')],'allowNull':![],'unique':_0x8d8c('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x8d8c('0x0')]},'path':{'type':Sequelize[_0x8d8c('0x0')]},'type':{'type':Sequelize[_0x8d8c('0x0')]},'size':{'type':Sequelize[_0x8d8c('0x2')]},'active':{'type':Sequelize[_0x8d8c('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x8d8c('0x0')]},'logo':{'type':Sequelize[_0x8d8c('0x0')]},'state':{'type':Sequelize[_0x8d8c('0x0')],'unique':'state'},'description':{'type':Sequelize[_0x8d8c('0x0')]},'title':{'type':Sequelize[_0x8d8c('0x0')]},'remoteUri':{'type':Sequelize[_0x8d8c('0x0')]},'link':{'type':Sequelize[_0x8d8c('0x0')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 96219ac..fc3d505 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 _0x7096=['offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','Integration','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x1511c3,_0x5b535f){var _0x12a6b0=function(_0x578aa2){while(--_0x578aa2){_0x1511c3['push'](_0x1511c3['shift']());}};_0x12a6b0(++_0x5b535f);}(_0x7096,0x10c));var _0x6709=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x7096[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['Integration'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['Integration'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['Integration'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['Integration']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['Integration'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));}; \ No newline at end of file +var _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x66fa,0x117));var _0xa66f=function(_0x538ed8,_0x9dd894){_0x538ed8=_0x538ed8-0x0;var _0x449967=_0x66fa[_0x538ed8];return _0x449967;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['Integration'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['Integration'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['Integration'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['Integration'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index fbdc604..97b7276 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 _0x9d1a=['./integration.attributes','exports','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4cb272,_0x52c0e9){var _0x57b4aa=function(_0x1efefb){while(--_0x1efefb){_0x4cb272['push'](_0x4cb272['shift']());}};_0x57b4aa(++_0x52c0e9);}(_0x9d1a,0x158));var _0xa9d1=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0x9d1a[_0x30bdff];return _0x1e7ca9;};'use strict';var _=require(_0xa9d1('0x0'));var util=require('util');var logger=require(_0xa9d1('0x1'))(_0xa9d1('0x2'));var moment=require(_0xa9d1('0x3'));var BPromise=require(_0xa9d1('0x4'));var rp=require(_0xa9d1('0x5'));var fs=require('fs');var path=require(_0xa9d1('0x6'));var rimraf=require('rimraf');var config=require(_0xa9d1('0x7'));var attributes=require(_0xa9d1('0x8'));module[_0xa9d1('0x9')]=function(_0x57e920,_0x33a96f){return _0x57e920['define']('Integration',attributes,{'tableName':_0xa9d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae4e=['api','moment','bluebird','request-promise','path','exports','Integration','integrations','lodash','util','../../config/logger'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0xae4e,0x189));var _0xeae4=function(_0x303f18,_0x5700f9){_0x303f18=_0x303f18-0x0;var _0x13c369=_0xae4e[_0x303f18];return _0x13c369;};'use strict';var _=require(_0xeae4('0x0'));var util=require(_0xeae4('0x1'));var logger=require(_0xeae4('0x2'))(_0xeae4('0x3'));var moment=require(_0xeae4('0x4'));var BPromise=require(_0xeae4('0x5'));var rp=require(_0xeae4('0x6'));var fs=require('fs');var path=require(_0xeae4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xeae4('0x8')]=function(_0x2c54bd,_0x33e336){return _0x2c54bd['define'](_0xeae4('0x9'),attributes,{'tableName':_0xeae4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6dc0b19..ea59292 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 _0x0b0e=['Integration,\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','Integration,\x20%s,\x20%s','debug'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0x0b0e[_0x544072];return _0x590bf6;};'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')]('Integration,\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 +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3e8b0c,_0x37c263){var _0x49e6e4=function(_0x410485){while(--_0x410485){_0x3e8b0c['push'](_0x3e8b0c['shift']());}};_0x49e6e4(++_0x37c263);}(_0xdb28,0x106));var _0x8db2=function(_0x3af918,_0x23834a){_0x3af918=_0x3af918-0x0;var _0x5b5429=_0xdb28[_0x3af918];return _0x5b5429;};'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')]('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index 7585ae9..3404bc1 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 _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x1967,0x173));var _0x7196=function(_0x527a2e,_0x5129fe){_0x527a2e=_0x527a2e-0x0;var _0x1ab57=_0x1967[_0x527a2e];return _0x1ab57;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('0x15')]=router; \ No newline at end of file +var _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xd943,0x15d));var _0x3d94=function(_0x16b745,_0x5251be){_0x16b745=_0x16b745-0x0;var _0x2179c0=_0xd943[_0x16b745];return _0x2179c0;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 8704713..cf7baca 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 _0x2044=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','TEXT','SENT','SENDING','RECEIVED','FAILED'];(function(_0x3a1972,_0x194511){var _0xc7e0b5=function(_0x465312){while(--_0x465312){_0x3a1972['push'](_0x3a1972['shift']());}};_0xc7e0b5(++_0x194511);}(_0x2044,0x1d9));var _0x4204=function(_0x830588,_0x40a32d){_0x830588=_0x830588-0x0;var _0xfb1e75=_0x2044[_0x830588];return _0xfb1e75;};'use strict';var Sequelize=require(_0x4204('0x0'));module[_0x4204('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x4204('0x2')]},'ticketId':{'type':Sequelize[_0x4204('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4204('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4204('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4204('0x2')]},'interface':{'type':Sequelize[_0x4204('0x2')]},'membername':{'type':Sequelize[_0x4204('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4204('0x3')]},'agentconnectAt':{'type':Sequelize[_0x4204('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4204('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4204('0x3')]},'talktime':{'type':Sequelize[_0x4204('0x5')]},'agentacw':{'type':Sequelize[_0x4204('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4204('0x5')]},'reason':{'type':Sequelize[_0x4204('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4204('0x3')]},'agentdump':{'type':Sequelize[_0x4204('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4204('0x3')]},'lastevent':{'type':Sequelize[_0x4204('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4204('0x5')]},'channelstatedesc':{'type':Sequelize[_0x4204('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4204('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4204('0x2')]},'accountcode':{'type':Sequelize[_0x4204('0x2')]},'context':{'type':Sequelize[_0x4204('0x2')]},'exten':{'type':Sequelize[_0x4204('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4204('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x4204('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4204('0x2')]},'destcalleridname':{'type':Sequelize[_0x4204('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x4204('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4204('0x2')]},'destcontext':{'type':Sequelize[_0x4204('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4204('0x2')]},'destuniqueid':{'type':Sequelize[_0x4204('0x2')]},'messageId':{'type':Sequelize[_0x4204('0x2')]},'inReplyTo':{'type':Sequelize[_0x4204('0x2')]},'subject':{'type':Sequelize[_0x4204('0x2')]},'from':{'type':Sequelize[_0x4204('0x2')]},'to':{'type':Sequelize[_0x4204('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x4204('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x4204('0x7'),_0x4204('0x8'),_0x4204('0x9'),_0x4204('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x4204('0x2')]},'appdata':{'type':Sequelize[_0x4204('0x2')]},'projectId':{'type':Sequelize[_0x4204('0x5')]}}; \ No newline at end of file +var _0x2e71=['ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2e71,0x12d));var _0x12e7=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x2e71[_0x484c03];return _0x294127;};'use strict';var Sequelize=require(_0x12e7('0x0'));module[_0x12e7('0x1')]={'integration':{'type':Sequelize[_0x12e7('0x2')]},'eventChannel':{'type':Sequelize[_0x12e7('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x12e7('0x2')]},'integrationId':{'type':Sequelize[_0x12e7('0x3')]},'contacts':{'type':Sequelize[_0x12e7('0x2')]},'uniqueid':{'type':Sequelize[_0x12e7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x12e7('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x12e7('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x12e7('0x3')]},'agentcomplete':{'type':Sequelize[_0x12e7('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x12e7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x12e7('0x3')]},'reason':{'type':Sequelize[_0x12e7('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x12e7('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x12e7('0x4')]},'agentdump':{'type':Sequelize[_0x12e7('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x12e7('0x2')]},'channel':{'type':Sequelize[_0x12e7('0x2')]},'channelstate':{'type':Sequelize[_0x12e7('0x3')]},'channelstatedesc':{'type':Sequelize[_0x12e7('0x2')]},'connectedlinenum':{'type':Sequelize[_0x12e7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x12e7('0x2')]},'context':{'type':Sequelize[_0x12e7('0x2')]},'exten':{'type':Sequelize[_0x12e7('0x2')]},'priority':{'type':Sequelize[_0x12e7('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x12e7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x12e7('0x2')]},'destcalleridnum':{'type':Sequelize[_0x12e7('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x12e7('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x12e7('0x2')]},'destlanguage':{'type':Sequelize[_0x12e7('0x2')]},'destaccountcode':{'type':Sequelize[_0x12e7('0x2')]},'destcontext':{'type':Sequelize[_0x12e7('0x2')]},'destexten':{'type':Sequelize[_0x12e7('0x2')]},'destpriority':{'type':Sequelize[_0x12e7('0x2')]},'destuniqueid':{'type':Sequelize[_0x12e7('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x12e7('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x12e7('0x2')]},'to':{'type':Sequelize[_0x12e7('0x2')]},'cc':{'type':Sequelize[_0x12e7('0x2')]},'attachment':{'type':Sequelize[_0x12e7('0x6')]},'html':{'type':Sequelize[_0x12e7('0x6')]},'text':{'type':Sequelize[_0x12e7('0x6')]},'status':{'type':Sequelize[_0x12e7('0x7')](_0x12e7('0x8'),'SENDING',_0x12e7('0x9'),_0x12e7('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x12e7('0x2')]},'projectId':{'type':Sequelize[_0x12e7('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 3d7528a..cdf1ba7 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 _0x2dc4=['fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','IntegrationReport','includeAll','include','rows','catch','show','params','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes'];(function(_0x1e1058,_0x30a95c){var _0x1bd2e5=function(_0x3156e0){while(--_0x3156e0){_0x1e1058['push'](_0x1e1058['shift']());}};_0x1bd2e5(++_0x30a95c);}(_0x2dc4,0x9f));var _0x42dc=function(_0x4106c5,_0x3e2730){_0x4106c5=_0x4106c5-0x0;var _0x229cc6=_0x2dc4[_0x4106c5];return _0x229cc6;};'use strict';var emlformat=require(_0x42dc('0x0'));var rimraf=require(_0x42dc('0x1'));var zipdir=require(_0x42dc('0x2'));var jsonpatch=require(_0x42dc('0x3'));var rp=require('request-promise');var moment=require(_0x42dc('0x4'));var BPromise=require(_0x42dc('0x5'));var Mustache=require(_0x42dc('0x6'));var util=require('util');var path=require(_0x42dc('0x7'));var sox=require('sox');var csv=require(_0x42dc('0x8'));var ejs=require(_0x42dc('0x9'));var fs=require('fs');var fs_extra=require(_0x42dc('0xa'));var _=require(_0x42dc('0xb'));var squel=require('squel');var crypto=require(_0x42dc('0xc'));var jsforce=require(_0x42dc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x42dc('0xe'));var Papa=require(_0x42dc('0xf'));var Redis=require(_0x42dc('0x10'));var authService=require(_0x42dc('0x11'));var qs=require(_0x42dc('0x12'));var as=require(_0x42dc('0x13'));var hardwareService=require(_0x42dc('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x42dc('0x15'));var licenseUtil=require(_0x42dc('0x16'));var db=require(_0x42dc('0x17'))['db'];function respondWithStatusCode(_0x5c5422,_0xfbe985){_0xfbe985=_0xfbe985||0xcc;return function(_0x57596c){if(_0x57596c){return _0x5c5422[_0x42dc('0x18')](_0xfbe985);}return _0x5c5422[_0x42dc('0x19')](_0xfbe985)['end']();};}function respondWithResult(_0x2c8713,_0x170352){_0x170352=_0x170352||0xc8;return function(_0x1d1f77){if(_0x1d1f77){return _0x2c8713['status'](_0x170352)[_0x42dc('0x1a')](_0x1d1f77);}};}function respondWithFilteredResult(_0x580e78,_0x49f986){return function(_0x337e11){if(_0x337e11){var _0x5d3250=typeof _0x49f986['offset']===_0x42dc('0x1b')&&typeof _0x49f986['limit']==='undefined';var _0x7228b4=_0x337e11['count'];var _0x2f954a=_0x5d3250?0x0:_0x49f986[_0x42dc('0x1c')];var _0x5ec018=_0x5d3250?_0x337e11[_0x42dc('0x1d')]:_0x49f986['offset']+_0x49f986[_0x42dc('0x1e')];var _0x1ac56b;if(_0x5ec018>=_0x7228b4){_0x5ec018=_0x7228b4;_0x1ac56b=0xc8;}else{_0x1ac56b=0xce;}_0x580e78['status'](_0x1ac56b);return _0x580e78[_0x42dc('0x1f')](_0x42dc('0x20'),_0x2f954a+'-'+_0x5ec018+'/'+_0x7228b4)[_0x42dc('0x1a')](_0x337e11);}return null;};}function patchUpdates(_0x8b9a5d){return function(_0x37e091){try{jsonpatch['apply'](_0x37e091,_0x8b9a5d,!![]);}catch(_0x5c2a06){return BPromise['reject'](_0x5c2a06);}return _0x37e091['save']();};}function saveUpdates(_0x3b13fe,_0x172be5){return function(_0x125d8f){if(_0x125d8f){return _0x125d8f[_0x42dc('0x21')](_0x3b13fe)[_0x42dc('0x22')](function(_0x3e9ac8){return _0x3e9ac8;});}return null;};}function removeEntity(_0x46de43,_0x57684d){return function(_0x43ed74){if(_0x43ed74){return _0x43ed74[_0x42dc('0x23')]()['then'](function(){_0x46de43[_0x42dc('0x19')](0xcc)[_0x42dc('0x24')]();});}};}function handleEntityNotFound(_0x34d86b,_0x1cb915){return function(_0x21fd5d){if(!_0x21fd5d){_0x34d86b[_0x42dc('0x18')](0x194);}return _0x21fd5d;};}function handleError(_0xa4fe48,_0x1f30fe){_0x1f30fe=_0x1f30fe||0x1f4;return function(_0x2a70a4){logger['error'](_0x2a70a4['stack']);if(_0x2a70a4[_0x42dc('0x25')]){delete _0x2a70a4[_0x42dc('0x25')];}_0xa4fe48[_0x42dc('0x19')](_0x1f30fe)[_0x42dc('0x26')](_0x2a70a4);};}exports['index']=function(_0x56cd4c,_0x44c29c){var _0x24a660={},_0x5a27f6={},_0x47d6b4={'count':0x0,'rows':[]};var _0x435548=_[_0x42dc('0x27')](db['IntegrationReport'][_0x42dc('0x28')],function(_0x305d3f){return{'name':_0x305d3f[_0x42dc('0x29')],'type':_0x305d3f[_0x42dc('0x2a')]['key']};});_0x5a27f6[_0x42dc('0x2b')]=_[_0x42dc('0x27')](_0x435548,_0x42dc('0x25'));_0x5a27f6[_0x42dc('0x2c')]=_[_0x42dc('0x2d')](_0x56cd4c[_0x42dc('0x2c')]);_0x5a27f6['filters']=_[_0x42dc('0x2e')](_0x5a27f6[_0x42dc('0x2b')],_0x5a27f6[_0x42dc('0x2c')]);_0x24a660[_0x42dc('0x2f')]=_[_0x42dc('0x2e')](_0x5a27f6['model'],qs[_0x42dc('0x30')](_0x56cd4c['query'][_0x42dc('0x30')]));_0x24a660['attributes']=_0x24a660[_0x42dc('0x2f')]['length']?_0x24a660['attributes']:_0x5a27f6['model'];if(!_0x56cd4c[_0x42dc('0x2c')][_0x42dc('0x31')](_0x42dc('0x32'))){_0x24a660[_0x42dc('0x1e')]=qs[_0x42dc('0x1e')](_0x56cd4c['query'][_0x42dc('0x1e')]);_0x24a660['offset']=qs[_0x42dc('0x1c')](_0x56cd4c[_0x42dc('0x2c')]['offset']);}_0x24a660[_0x42dc('0x33')]=qs[_0x42dc('0x34')](_0x56cd4c[_0x42dc('0x2c')][_0x42dc('0x34')]);_0x24a660[_0x42dc('0x35')]=qs[_0x42dc('0x36')](_['pick'](_0x56cd4c[_0x42dc('0x2c')],_0x5a27f6[_0x42dc('0x36')]),_0x435548);if(_0x56cd4c['query']['filter']){_0x24a660[_0x42dc('0x35')]=_[_0x42dc('0x37')](_0x24a660[_0x42dc('0x35')],{'$or':_[_0x42dc('0x27')](_0x435548,function(_0x32432e){if(_0x32432e[_0x42dc('0x2a')]!=='VIRTUAL'){var _0x1458b0={};_0x1458b0[_0x32432e[_0x42dc('0x25')]]={'$like':'%'+_0x56cd4c[_0x42dc('0x2c')][_0x42dc('0x38')]+'%'};return _0x1458b0;}})});}_0x24a660=_[_0x42dc('0x37')]({},_0x24a660,_0x56cd4c[_0x42dc('0x39')]);var _0x4ba5eb={'where':_0x24a660['where']};return db[_0x42dc('0x3a')][_0x42dc('0x1d')](_0x4ba5eb)[_0x42dc('0x22')](function(_0x2ada01){_0x47d6b4[_0x42dc('0x1d')]=_0x2ada01;if(_0x56cd4c[_0x42dc('0x2c')][_0x42dc('0x3b')]){_0x24a660[_0x42dc('0x3c')]=[{'all':!![]}];}return db[_0x42dc('0x3a')]['findAll'](_0x24a660);})[_0x42dc('0x22')](function(_0x712a0b){_0x47d6b4[_0x42dc('0x3d')]=_0x712a0b;return _0x47d6b4;})[_0x42dc('0x22')](respondWithFilteredResult(_0x44c29c,_0x24a660))[_0x42dc('0x3e')](handleError(_0x44c29c,null));};exports[_0x42dc('0x3f')]=function(_0x3dbcc0,_0x1ef296){var _0x53c037={'raw':![],'where':{'id':_0x3dbcc0[_0x42dc('0x40')]['id']}},_0x80bc79={};_0x80bc79[_0x42dc('0x2b')]=_[_0x42dc('0x2d')](db['IntegrationReport'][_0x42dc('0x28')]);_0x80bc79[_0x42dc('0x2c')]=_[_0x42dc('0x2d')](_0x3dbcc0[_0x42dc('0x2c')]);_0x80bc79[_0x42dc('0x36')]=_[_0x42dc('0x2e')](_0x80bc79[_0x42dc('0x2b')],_0x80bc79[_0x42dc('0x2c')]);_0x53c037[_0x42dc('0x2f')]=_[_0x42dc('0x2e')](_0x80bc79[_0x42dc('0x2b')],qs[_0x42dc('0x30')](_0x3dbcc0[_0x42dc('0x2c')][_0x42dc('0x30')]));_0x53c037['attributes']=_0x53c037[_0x42dc('0x2f')][_0x42dc('0x41')]?_0x53c037['attributes']:_0x80bc79[_0x42dc('0x2b')];if(_0x3dbcc0['query']['includeAll']){_0x53c037[_0x42dc('0x3c')]=[{'all':!![]}];}_0x53c037=_[_0x42dc('0x37')]({},_0x53c037,_0x3dbcc0[_0x42dc('0x39')]);return db['IntegrationReport'][_0x42dc('0x42')](_0x53c037)['then'](handleEntityNotFound(_0x1ef296,null))[_0x42dc('0x22')](respondWithResult(_0x1ef296,null))[_0x42dc('0x3e')](handleError(_0x1ef296,null));};exports['create']=function(_0x34a7d8,_0x3561e4){return db['IntegrationReport']['create'](_0x34a7d8[_0x42dc('0x43')],{})[_0x42dc('0x22')](respondWithResult(_0x3561e4,0xc9))[_0x42dc('0x3e')](handleError(_0x3561e4,null));};exports[_0x42dc('0x21')]=function(_0x1d6ce9,_0x35e926){if(_0x1d6ce9[_0x42dc('0x43')]['id']){delete _0x1d6ce9[_0x42dc('0x43')]['id'];}return db[_0x42dc('0x3a')][_0x42dc('0x42')]({'where':{'id':_0x1d6ce9[_0x42dc('0x40')]['id']}})[_0x42dc('0x22')](handleEntityNotFound(_0x35e926,null))[_0x42dc('0x22')](saveUpdates(_0x1d6ce9[_0x42dc('0x43')],null))[_0x42dc('0x22')](respondWithResult(_0x35e926,null))[_0x42dc('0x3e')](handleError(_0x35e926,null));};exports[_0x42dc('0x23')]=function(_0x18e027,_0x5a4a36){return db[_0x42dc('0x3a')][_0x42dc('0x42')]({'where':{'id':_0x18e027[_0x42dc('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a4a36,null))[_0x42dc('0x22')](removeEntity(_0x5a4a36,null))[_0x42dc('0x3e')](handleError(_0x5a4a36,null));};exports['describe']=function(_0x2681b7,_0x117b93){return db[_0x42dc('0x3a')][_0x42dc('0x44')]()[_0x42dc('0x22')](respondWithResult(_0x117b93,null))['catch'](handleError(_0x117b93,null));}; \ No newline at end of file +var _0x10dc=['map','IntegrationReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3673ea,_0x405187){var _0x1fc829=function(_0x2509aa){while(--_0x2509aa){_0x3673ea['push'](_0x3673ea['shift']());}};_0x1fc829(++_0x405187);}(_0x10dc,0x151));var _0xc10d=function(_0x5b75c4,_0xca1d42){_0x5b75c4=_0x5b75c4-0x0;var _0x6f2bda=_0x10dc[_0x5b75c4];return _0x6f2bda;};'use strict';var emlformat=require(_0xc10d('0x0'));var rimraf=require(_0xc10d('0x1'));var zipdir=require(_0xc10d('0x2'));var jsonpatch=require(_0xc10d('0x3'));var rp=require('request-promise');var moment=require(_0xc10d('0x4'));var BPromise=require(_0xc10d('0x5'));var Mustache=require('mustache');var util=require(_0xc10d('0x6'));var path=require(_0xc10d('0x7'));var sox=require(_0xc10d('0x8'));var csv=require(_0xc10d('0x9'));var ejs=require(_0xc10d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc10d('0xb'));var squel=require(_0xc10d('0xc'));var crypto=require('crypto');var jsforce=require(_0xc10d('0xd'));var deskjs=require(_0xc10d('0xe'));var toCsv=require(_0xc10d('0x9'));var querystring=require(_0xc10d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc10d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc10d('0x11'))(_0xc10d('0x12'));var utils=require(_0xc10d('0x13'));var config=require(_0xc10d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc10d('0x15'))['db'];function respondWithStatusCode(_0x113cab,_0xd64fcc){_0xd64fcc=_0xd64fcc||0xcc;return function(_0xc10409){if(_0xc10409){return _0x113cab['sendStatus'](_0xd64fcc);}return _0x113cab[_0xc10d('0x16')](_0xd64fcc)[_0xc10d('0x17')]();};}function respondWithResult(_0xa1a434,_0x39d878){_0x39d878=_0x39d878||0xc8;return function(_0x2a6f21){if(_0x2a6f21){return _0xa1a434[_0xc10d('0x16')](_0x39d878)[_0xc10d('0x18')](_0x2a6f21);}};}function respondWithFilteredResult(_0x21aa5d,_0x5c27c2){return function(_0x58e605){if(_0x58e605){var _0xb8f46f=typeof _0x5c27c2['offset']===_0xc10d('0x19')&&typeof _0x5c27c2[_0xc10d('0x1a')]===_0xc10d('0x19');var _0x1f854f=_0x58e605['count'];var _0x45c65d=_0xb8f46f?0x0:_0x5c27c2[_0xc10d('0x1b')];var _0x5ed214=_0xb8f46f?_0x58e605[_0xc10d('0x1c')]:_0x5c27c2[_0xc10d('0x1b')]+_0x5c27c2[_0xc10d('0x1a')];var _0x875b26;if(_0x5ed214>=_0x1f854f){_0x5ed214=_0x1f854f;_0x875b26=0xc8;}else{_0x875b26=0xce;}_0x21aa5d[_0xc10d('0x16')](_0x875b26);return _0x21aa5d[_0xc10d('0x1d')](_0xc10d('0x1e'),_0x45c65d+'-'+_0x5ed214+'/'+_0x1f854f)[_0xc10d('0x18')](_0x58e605);}return null;};}function patchUpdates(_0x3f8c4a){return function(_0x25b725){try{jsonpatch[_0xc10d('0x1f')](_0x25b725,_0x3f8c4a,!![]);}catch(_0x3362a2){return BPromise[_0xc10d('0x20')](_0x3362a2);}return _0x25b725[_0xc10d('0x21')]();};}function saveUpdates(_0x3f4369,_0x4e1a9e){return function(_0x45e3f5){if(_0x45e3f5){return _0x45e3f5[_0xc10d('0x22')](_0x3f4369)[_0xc10d('0x23')](function(_0x5e3437){return _0x5e3437;});}return null;};}function removeEntity(_0x545aa3,_0x3adf48){return function(_0x1041a0){if(_0x1041a0){return _0x1041a0[_0xc10d('0x24')]()[_0xc10d('0x23')](function(){_0x545aa3['status'](0xcc)[_0xc10d('0x17')]();});}};}function handleEntityNotFound(_0x152e27,_0x14bb64){return function(_0x200ebe){if(!_0x200ebe){_0x152e27[_0xc10d('0x25')](0x194);}return _0x200ebe;};}function handleError(_0x42d563,_0x1273fe){_0x1273fe=_0x1273fe||0x1f4;return function(_0x530b07){logger[_0xc10d('0x26')](_0x530b07[_0xc10d('0x27')]);if(_0x530b07[_0xc10d('0x28')]){delete _0x530b07[_0xc10d('0x28')];}_0x42d563['status'](_0x1273fe)[_0xc10d('0x29')](_0x530b07);};}exports[_0xc10d('0x2a')]=function(_0x412956,_0x98e3d0){var _0x4bcf8b={},_0x510107={},_0x2d3022={'count':0x0,'rows':[]};var _0x2dfee4=_[_0xc10d('0x2b')](db[_0xc10d('0x2c')][_0xc10d('0x2d')],function(_0x33736e){return{'name':_0x33736e['fieldName'],'type':_0x33736e[_0xc10d('0x2e')][_0xc10d('0x2f')]};});_0x510107[_0xc10d('0x30')]=_[_0xc10d('0x2b')](_0x2dfee4,_0xc10d('0x28'));_0x510107[_0xc10d('0x31')]=_['keys'](_0x412956[_0xc10d('0x31')]);_0x510107[_0xc10d('0x32')]=_[_0xc10d('0x33')](_0x510107[_0xc10d('0x30')],_0x510107[_0xc10d('0x31')]);_0x4bcf8b[_0xc10d('0x34')]=_['intersection'](_0x510107[_0xc10d('0x30')],qs['fields'](_0x412956[_0xc10d('0x31')][_0xc10d('0x35')]));_0x4bcf8b[_0xc10d('0x34')]=_0x4bcf8b[_0xc10d('0x34')][_0xc10d('0x36')]?_0x4bcf8b[_0xc10d('0x34')]:_0x510107[_0xc10d('0x30')];if(!_0x412956['query'][_0xc10d('0x37')](_0xc10d('0x38'))){_0x4bcf8b[_0xc10d('0x1a')]=qs[_0xc10d('0x1a')](_0x412956[_0xc10d('0x31')]['limit']);_0x4bcf8b[_0xc10d('0x1b')]=qs[_0xc10d('0x1b')](_0x412956[_0xc10d('0x31')][_0xc10d('0x1b')]);}_0x4bcf8b[_0xc10d('0x39')]=qs['sort'](_0x412956[_0xc10d('0x31')]['sort']);_0x4bcf8b[_0xc10d('0x3a')]=qs[_0xc10d('0x32')](_[_0xc10d('0x3b')](_0x412956[_0xc10d('0x31')],_0x510107[_0xc10d('0x32')]),_0x2dfee4);if(_0x412956['query']['filter']){_0x4bcf8b[_0xc10d('0x3a')]=_['merge'](_0x4bcf8b[_0xc10d('0x3a')],{'$or':_[_0xc10d('0x2b')](_0x2dfee4,function(_0x5f2fee){if(_0x5f2fee['type']!==_0xc10d('0x3c')){var _0xfa8889={};_0xfa8889[_0x5f2fee[_0xc10d('0x28')]]={'$like':'%'+_0x412956['query'][_0xc10d('0x3d')]+'%'};return _0xfa8889;}})});}_0x4bcf8b=_[_0xc10d('0x3e')]({},_0x4bcf8b,_0x412956[_0xc10d('0x3f')]);var _0x430168={'where':_0x4bcf8b[_0xc10d('0x3a')]};return db['IntegrationReport']['count'](_0x430168)[_0xc10d('0x23')](function(_0x480775){_0x2d3022[_0xc10d('0x1c')]=_0x480775;if(_0x412956['query'][_0xc10d('0x40')]){_0x4bcf8b[_0xc10d('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0xc10d('0x42')](_0x4bcf8b);})[_0xc10d('0x23')](function(_0x2b6f6b){_0x2d3022[_0xc10d('0x43')]=_0x2b6f6b;return _0x2d3022;})[_0xc10d('0x23')](respondWithFilteredResult(_0x98e3d0,_0x4bcf8b))[_0xc10d('0x44')](handleError(_0x98e3d0,null));};exports[_0xc10d('0x45')]=function(_0x4b8e86,_0x5f53c9){var _0x1917e7={'raw':![],'where':{'id':_0x4b8e86['params']['id']}},_0x11ea01={};_0x11ea01[_0xc10d('0x30')]=_[_0xc10d('0x46')](db[_0xc10d('0x2c')][_0xc10d('0x2d')]);_0x11ea01[_0xc10d('0x31')]=_[_0xc10d('0x46')](_0x4b8e86[_0xc10d('0x31')]);_0x11ea01[_0xc10d('0x32')]=_[_0xc10d('0x33')](_0x11ea01[_0xc10d('0x30')],_0x11ea01[_0xc10d('0x31')]);_0x1917e7[_0xc10d('0x34')]=_['intersection'](_0x11ea01[_0xc10d('0x30')],qs[_0xc10d('0x35')](_0x4b8e86['query']['fields']));_0x1917e7[_0xc10d('0x34')]=_0x1917e7[_0xc10d('0x34')][_0xc10d('0x36')]?_0x1917e7['attributes']:_0x11ea01[_0xc10d('0x30')];if(_0x4b8e86['query'][_0xc10d('0x40')]){_0x1917e7[_0xc10d('0x41')]=[{'all':!![]}];}_0x1917e7=_[_0xc10d('0x3e')]({},_0x1917e7,_0x4b8e86[_0xc10d('0x3f')]);return db[_0xc10d('0x2c')][_0xc10d('0x47')](_0x1917e7)[_0xc10d('0x23')](handleEntityNotFound(_0x5f53c9,null))['then'](respondWithResult(_0x5f53c9,null))[_0xc10d('0x44')](handleError(_0x5f53c9,null));};exports[_0xc10d('0x48')]=function(_0x53b05b,_0x20a74a){return db['IntegrationReport']['create'](_0x53b05b[_0xc10d('0x49')],{})[_0xc10d('0x23')](respondWithResult(_0x20a74a,0xc9))[_0xc10d('0x44')](handleError(_0x20a74a,null));};exports[_0xc10d('0x22')]=function(_0x32332e,_0x20dfb8){if(_0x32332e[_0xc10d('0x49')]['id']){delete _0x32332e['body']['id'];}return db[_0xc10d('0x2c')][_0xc10d('0x47')]({'where':{'id':_0x32332e[_0xc10d('0x4a')]['id']}})[_0xc10d('0x23')](handleEntityNotFound(_0x20dfb8,null))['then'](saveUpdates(_0x32332e[_0xc10d('0x49')],null))[_0xc10d('0x23')](respondWithResult(_0x20dfb8,null))[_0xc10d('0x44')](handleError(_0x20dfb8,null));};exports[_0xc10d('0x24')]=function(_0x4f2e0d,_0xfc13a4){return db[_0xc10d('0x2c')][_0xc10d('0x47')]({'where':{'id':_0x4f2e0d['params']['id']}})['then'](handleEntityNotFound(_0xfc13a4,null))[_0xc10d('0x23')](removeEntity(_0xfc13a4,null))['catch'](handleError(_0xfc13a4,null));};exports['describe']=function(_0x2a8347,_0x5eca3b){return db[_0xc10d('0x2c')][_0xc10d('0x4b')]()[_0xc10d('0x23')](respondWithResult(_0x5eca3b,null))[_0xc10d('0x44')](handleError(_0x5eca3b,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index f806e28..45b614d 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 _0xf0b0=['bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','../../config/logger','moment'];(function(_0x4c94eb,_0x679a1e){var _0x59e3f3=function(_0x4fc035){while(--_0x4fc035){_0x4c94eb['push'](_0x4c94eb['shift']());}};_0x59e3f3(++_0x679a1e);}(_0xf0b0,0x1a2));var _0x0f0b=function(_0x32b2a0,_0x69db4f){_0x32b2a0=_0x32b2a0-0x0;var _0x456ee6=_0xf0b0[_0x32b2a0];return _0x456ee6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f0b('0x0'))('api');var moment=require(_0x0f0b('0x1'));var BPromise=require(_0x0f0b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f0b('0x3'));var rimraf=require(_0x0f0b('0x4'));var config=require(_0x0f0b('0x5'));var attributes=require(_0x0f0b('0x6'));module[_0x0f0b('0x7')]=function(_0x2640e7,_0xd40c06){return _0x2640e7[_0x0f0b('0x8')](_0x0f0b('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbb5=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa93ea2,_0x1d5e35){var _0x16c081=function(_0xd28218){while(--_0xd28218){_0xa93ea2['push'](_0xa93ea2['shift']());}};_0x16c081(++_0x1d5e35);}(_0xbbb5,0xd5));var _0x5bbb=function(_0xbabf6a,_0x2bf73a){_0xbabf6a=_0xbabf6a-0x0;var _0x1b84a3=_0xbbb5[_0xbabf6a];return _0x1b84a3;};'use strict';var _=require('lodash');var util=require(_0x5bbb('0x0'));var logger=require(_0x5bbb('0x1'))(_0x5bbb('0x2'));var moment=require('moment');var BPromise=require(_0x5bbb('0x3'));var rp=require(_0x5bbb('0x4'));var fs=require('fs');var path=require(_0x5bbb('0x5'));var rimraf=require(_0x5bbb('0x6'));var config=require(_0x5bbb('0x7'));var attributes=require(_0x5bbb('0x8'));module[_0x5bbb('0x9')]=function(_0x1c983c,_0x2e35ea){return _0x1c983c[_0x5bbb('0xa')](_0x5bbb('0xb'),attributes,{'tableName':_0x5bbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index a4b5e2f..e655fe9 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 _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\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(_0x91cba2,_0x2b3b24){var _0x19549d=function(_0x1b08e9){while(--_0x1b08e9){_0x91cba2['push'](_0x91cba2['shift']());}};_0x19549d(++_0x2b3b24);}(_0x1261,0x144));var _0x1126=function(_0x10b7de,_0x51cf9d){_0x10b7de=_0x10b7de-0x0;var _0xd51c81=_0x1261[_0x10b7de];return _0xd51c81;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x35900e,_0x1f971a){var _0x2119c9=function(_0x48fe00){while(--_0x48fe00){_0x35900e['push'](_0x35900e['shift']());}};_0x2119c9(++_0x1f971a);}(_0x57ca,0x108));var _0xa57c=function(_0x31205e,_0xc98c62){_0x31205e=_0x31205e-0x0;var _0x598571=_0x57ca[_0x31205e];return _0x598571;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5491479..c149212 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 _0xed1f=['/:id/sub_intervals','getIntervals','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show'];(function(_0x101a61,_0x43011c){var _0x51d456=function(_0x2be688){while(--_0x2be688){_0x101a61['push'](_0x101a61['shift']());}};_0x51d456(++_0x43011c);}(_0xed1f,0x170));var _0xfed1=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xed1f[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfed1('0x2'));var router=express['Router']();var fs_extra=require(_0xfed1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var controller=require(_0xfed1('0x6'));router[_0xfed1('0x7')]('/',auth[_0xfed1('0x8')](),controller[_0xfed1('0x9')]);router[_0xfed1('0x7')](_0xfed1('0xa'),auth[_0xfed1('0x8')](),controller[_0xfed1('0xb')]);router['get'](_0xfed1('0xc'),auth[_0xfed1('0x8')](),controller[_0xfed1('0xd')]);router['post']('/',auth[_0xfed1('0x8')](),controller['create']);router['post'](_0xfed1('0xc'),auth[_0xfed1('0x8')](),controller['addInterval']);router['post'](_0xfed1('0xe'),auth[_0xfed1('0x8')](),controller['addIntervals']);router[_0xfed1('0xf')]('/:id',auth[_0xfed1('0x8')](),controller[_0xfed1('0x10')]);router[_0xfed1('0x11')](_0xfed1('0xa'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module[_0xfed1('0x13')]=router; \ No newline at end of file +var _0x482d=['show','/:id/sub_intervals','getIntervals','post','isAuthenticated','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','index'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x482d,0x16c));var _0xd482=function(_0x15517d,_0x25ddae){_0x15517d=_0x15517d-0x0;var _0x183038=_0x482d[_0x15517d];return _0x183038;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd482('0x0'));var timeout=require(_0xd482('0x1'));var express=require(_0xd482('0x2'));var router=express[_0xd482('0x3')]();var fs_extra=require(_0xd482('0x4'));var auth=require(_0xd482('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd482('0x6'));var controller=require(_0xd482('0x7'));router[_0xd482('0x8')]('/',auth['isAuthenticated'](),controller[_0xd482('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd482('0xa')]);router[_0xd482('0x8')](_0xd482('0xb'),auth['isAuthenticated'](),controller[_0xd482('0xc')]);router[_0xd482('0xd')]('/',auth[_0xd482('0xe')](),controller[_0xd482('0xf')]);router[_0xd482('0xd')](_0xd482('0xb'),auth[_0xd482('0xe')](),controller[_0xd482('0x10')]);router['post'](_0xd482('0x11'),auth[_0xd482('0xe')](),controller[_0xd482('0x12')]);router[_0xd482('0x13')]('/:id',auth[_0xd482('0xe')](),controller[_0xd482('0x14')]);router[_0xd482('0x15')]('/:id',auth[_0xd482('0xe')](),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 a8fda0f..1aa5f35 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 _0xaeb7=['exports','STRING','sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xaeb7,0x119));var _0x7aeb=function(_0x1cf18d,_0x5e2510){_0x1cf18d=_0x1cf18d-0x0;var _0x91f753=_0xaeb7[_0x1cf18d];return _0x91f753;};'use strict';var Sequelize=require(_0x7aeb('0x0'));module[_0x7aeb('0x1')]={'name':{'type':Sequelize[_0x7aeb('0x2')]},'description':{'type':Sequelize[_0x7aeb('0x2')]},'interval':{'type':Sequelize[_0x7aeb('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xb08d=['STRING','exports'];(function(_0x2618c7,_0x238923){var _0x40b96e=function(_0xf089c4){while(--_0xf089c4){_0x2618c7['push'](_0x2618c7['shift']());}};_0x40b96e(++_0x238923);}(_0xb08d,0x123));var _0xdb08=function(_0x23ce5c,_0x2edcac){_0x23ce5c=_0x23ce5c-0x0;var _0x3e6b16=_0xb08d[_0x23ce5c];return _0x3e6b16;};'use strict';var Sequelize=require('sequelize');module[_0xdb08('0x0')]={'name':{'type':Sequelize[_0xdb08('0x1')]},'description':{'type':Sequelize[_0xdb08('0x1')]},'interval':{'type':Sequelize[_0xdb08('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 7581392..59b3cf1 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 _0x9a6b=['UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','sequelize','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','Intervals','end','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','Interval','findAll','rows','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x6a419d,_0x5de8f4){var _0x3536ef=function(_0x41154f){while(--_0x41154f){_0x6a419d['push'](_0x6a419d['shift']());}};_0x3536ef(++_0x5de8f4);}(_0x9a6b,0x11f));var _0xb9a6=function(_0x531c92,_0x11e331){_0x531c92=_0x531c92-0x0;var _0x2e886c=_0x9a6b[_0x531c92];return _0x2e886c;};'use strict';var emlformat=require(_0xb9a6('0x0'));var rimraf=require(_0xb9a6('0x1'));var zipdir=require(_0xb9a6('0x2'));var jsonpatch=require(_0xb9a6('0x3'));var rp=require(_0xb9a6('0x4'));var moment=require('moment');var BPromise=require(_0xb9a6('0x5'));var Mustache=require(_0xb9a6('0x6'));var util=require(_0xb9a6('0x7'));var path=require(_0xb9a6('0x8'));var sox=require(_0xb9a6('0x9'));var csv=require(_0xb9a6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9a6('0xb'));var _=require(_0xb9a6('0xc'));var squel=require(_0xb9a6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9a6('0xe'));var Papa=require(_0xb9a6('0xf'));var Redis=require(_0xb9a6('0x10'));var authService=require(_0xb9a6('0x11'));var qs=require(_0xb9a6('0x12'));var as=require(_0xb9a6('0x13'));var hardwareService=require(_0xb9a6('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb9a6('0x15'));var config=require(_0xb9a6('0x16'));var licenseUtil=require(_0xb9a6('0x17'));var db=require(_0xb9a6('0x18'))['db'];var extensions=require(_0xb9a6('0x19'));function respondWithStatusCode(_0x3364f5,_0x493273){_0x493273=_0x493273||0xcc;return function(_0x115282){if(_0x115282){return _0x3364f5[_0xb9a6('0x1a')](_0x493273);}return _0x3364f5[_0xb9a6('0x1b')](_0x493273)['end']();};}function respondWithResult(_0x4d1497,_0x2e4641){_0x2e4641=_0x2e4641||0xc8;return function(_0x2d2edd){if(_0x2d2edd){return _0x4d1497[_0xb9a6('0x1b')](_0x2e4641)[_0xb9a6('0x1c')](_0x2d2edd);}};}function respondWithFilteredResult(_0x33ccd8,_0x4df703){return function(_0x44f0d3){if(_0x44f0d3){var _0x17286c=typeof _0x4df703[_0xb9a6('0x1d')]===_0xb9a6('0x1e')&&typeof _0x4df703[_0xb9a6('0x1f')]===_0xb9a6('0x1e');var _0x7ade6b=_0x44f0d3[_0xb9a6('0x20')];var _0x269453=_0x17286c?0x0:_0x4df703[_0xb9a6('0x1d')];var _0x4219ba=_0x17286c?_0x44f0d3[_0xb9a6('0x20')]:_0x4df703[_0xb9a6('0x1d')]+_0x4df703[_0xb9a6('0x1f')];var _0x5aeedb;if(_0x4219ba>=_0x7ade6b){_0x4219ba=_0x7ade6b;_0x5aeedb=0xc8;}else{_0x5aeedb=0xce;}_0x33ccd8['status'](_0x5aeedb);return _0x33ccd8[_0xb9a6('0x21')]('Content-Range',_0x269453+'-'+_0x4219ba+'/'+_0x7ade6b)['json'](_0x44f0d3);}return null;};}function patchUpdates(_0x270425){return function(_0x63bb9f){try{jsonpatch[_0xb9a6('0x22')](_0x63bb9f,_0x270425,!![]);}catch(_0x5b273b){return BPromise[_0xb9a6('0x23')](_0x5b273b);}return _0x63bb9f['save']();};}function saveUpdates(_0x1fc6c2,_0x5d4787){return function(_0x3a4f3d){if(_0x3a4f3d){return _0x3a4f3d['update'](_0x1fc6c2)[_0xb9a6('0x24')](function(_0x43caba){return _0x43caba;});}return null;};}function removeEntity(_0x4ea037,_0x134655){return function(_0x2c7727){if(_0x2c7727){return _0x2c7727[_0xb9a6('0x25')]()[_0xb9a6('0x24')](function(){var _0x219ec6=_0x2c7727['get']({'plain':!![]});var _0x4def1=_0xb9a6('0x26');return db['UserProfileResource'][_0xb9a6('0x25')]({'where':{'type':_0x4def1,'resourceId':_0x219ec6['id']}})[_0xb9a6('0x24')](function(){return _0x2c7727;});})[_0xb9a6('0x24')](function(){_0x4ea037[_0xb9a6('0x1b')](0xcc)[_0xb9a6('0x27')]();});}};}function handleEntityNotFound(_0x386dc4,_0x234f6f){return function(_0x1fb23d){if(!_0x1fb23d){_0x386dc4[_0xb9a6('0x1a')](0x194);}return _0x1fb23d;};}function handleError(_0x16fa54,_0x51c410){_0x51c410=_0x51c410||0x1f4;return function(_0x35dd4b){logger['error'](_0x35dd4b[_0xb9a6('0x28')]);if(_0x35dd4b[_0xb9a6('0x29')]){delete _0x35dd4b[_0xb9a6('0x29')];}_0x16fa54['status'](_0x51c410)[_0xb9a6('0x2a')](_0x35dd4b);};}exports['index']=function(_0xa209d0,_0x44be6f){var _0x1c64ca={},_0x30922c={},_0x5ac084={'count':0x0,'rows':[]};var _0x35848c=_[_0xb9a6('0x2b')](db['Interval']['rawAttributes'],function(_0x3a08a5){return{'name':_0x3a08a5['fieldName'],'type':_0x3a08a5[_0xb9a6('0x2c')][_0xb9a6('0x2d')]};});_0x30922c[_0xb9a6('0x2e')]=_['map'](_0x35848c,_0xb9a6('0x29'));_0x30922c[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0xa209d0[_0xb9a6('0x2f')]);_0x30922c[_0xb9a6('0x31')]=_[_0xb9a6('0x32')](_0x30922c[_0xb9a6('0x2e')],_0x30922c[_0xb9a6('0x2f')]);_0x1c64ca[_0xb9a6('0x33')]=_[_0xb9a6('0x32')](_0x30922c['model'],qs[_0xb9a6('0x34')](_0xa209d0[_0xb9a6('0x2f')][_0xb9a6('0x34')]));_0x1c64ca[_0xb9a6('0x33')]=_0x1c64ca['attributes'][_0xb9a6('0x35')]?_0x1c64ca[_0xb9a6('0x33')]:_0x30922c[_0xb9a6('0x2e')];if(!_0xa209d0[_0xb9a6('0x2f')][_0xb9a6('0x36')](_0xb9a6('0x37'))){_0x1c64ca[_0xb9a6('0x1f')]=qs[_0xb9a6('0x1f')](_0xa209d0['query']['limit']);_0x1c64ca[_0xb9a6('0x1d')]=qs['offset'](_0xa209d0[_0xb9a6('0x2f')][_0xb9a6('0x1d')]);}_0x1c64ca['order']=qs[_0xb9a6('0x38')](_0xa209d0[_0xb9a6('0x2f')][_0xb9a6('0x38')]);_0x1c64ca[_0xb9a6('0x39')]=qs[_0xb9a6('0x31')](_[_0xb9a6('0x3a')](_0xa209d0[_0xb9a6('0x2f')],_0x30922c[_0xb9a6('0x31')]),_0x35848c);if(_0xa209d0[_0xb9a6('0x2f')][_0xb9a6('0x3b')]){_0x1c64ca[_0xb9a6('0x39')]=_[_0xb9a6('0x3c')](_0x1c64ca[_0xb9a6('0x39')],{'$or':_['map'](_0x35848c,function(_0x4bf818){if(_0x4bf818['type']!==_0xb9a6('0x3d')){var _0x4f410c={};_0x4f410c[_0x4bf818['name']]={'$like':'%'+_0xa209d0['query'][_0xb9a6('0x3b')]+'%'};return _0x4f410c;}})});}_0x1c64ca=_[_0xb9a6('0x3c')]({},_0x1c64ca,_0xa209d0[_0xb9a6('0x3e')]);var _0x25d864={'where':_0x1c64ca[_0xb9a6('0x39')]};return db['Interval'][_0xb9a6('0x20')](_0x25d864)[_0xb9a6('0x24')](function(_0x26cd36){_0x5ac084[_0xb9a6('0x20')]=_0x26cd36;if(_0xa209d0['query'][_0xb9a6('0x3f')]){_0x1c64ca['include']=[{'all':!![]}];}return db[_0xb9a6('0x40')][_0xb9a6('0x41')](_0x1c64ca);})[_0xb9a6('0x24')](function(_0x26aecb){_0x5ac084[_0xb9a6('0x42')]=_0x26aecb;return _0x5ac084;})[_0xb9a6('0x24')](respondWithFilteredResult(_0x44be6f,_0x1c64ca))[_0xb9a6('0x43')](handleError(_0x44be6f,null));};exports[_0xb9a6('0x44')]=function(_0x3f32ec,_0x18a133){var _0x17c412={'raw':!![],'where':{'id':_0x3f32ec['params']['id']}},_0x26baf0={};_0x26baf0['model']=_['keys'](db[_0xb9a6('0x40')]['rawAttributes']);_0x26baf0['query']=_[_0xb9a6('0x30')](_0x3f32ec[_0xb9a6('0x2f')]);_0x26baf0[_0xb9a6('0x31')]=_[_0xb9a6('0x32')](_0x26baf0['model'],_0x26baf0[_0xb9a6('0x2f')]);_0x17c412[_0xb9a6('0x33')]=_['intersection'](_0x26baf0[_0xb9a6('0x2e')],qs[_0xb9a6('0x34')](_0x3f32ec[_0xb9a6('0x2f')][_0xb9a6('0x34')]));_0x17c412['attributes']=_0x17c412[_0xb9a6('0x33')][_0xb9a6('0x35')]?_0x17c412[_0xb9a6('0x33')]:_0x26baf0[_0xb9a6('0x2e')];if(_0x3f32ec['query'][_0xb9a6('0x3f')]){_0x17c412[_0xb9a6('0x45')]=[{'all':!![]}];}_0x17c412=_[_0xb9a6('0x3c')]({},_0x17c412,_0x3f32ec['options']);return db[_0xb9a6('0x40')][_0xb9a6('0x46')](_0x17c412)['then'](handleEntityNotFound(_0x18a133,null))[_0xb9a6('0x24')](respondWithResult(_0x18a133,null))[_0xb9a6('0x43')](handleError(_0x18a133,null));};exports[_0xb9a6('0x47')]=function(_0x4ab715,_0x4ca69c){return db[_0xb9a6('0x40')][_0xb9a6('0x47')](_0x4ab715[_0xb9a6('0x48')],{})[_0xb9a6('0x24')](function(_0x160064){var _0x1679c6=_0x4ab715[_0xb9a6('0x49')]['get']({'plain':!![]});if(!_0x1679c6)throw new Error(_0xb9a6('0x4a'));if(_0x1679c6[_0xb9a6('0x4b')]===_0xb9a6('0x49')){var _0x5e88aa=_0x160064[_0xb9a6('0x4c')]({'plain':!![]});var _0x391b1e=_0xb9a6('0x26');return db[_0xb9a6('0x4d')][_0xb9a6('0x46')]({'where':{'name':_0x391b1e,'userProfileId':_0x1679c6[_0xb9a6('0x4e')]},'raw':!![]})[_0xb9a6('0x24')](function(_0x4c7195){if(_0x4c7195&&_0x4c7195['autoAssociation']===0x0){return db['UserProfileResource'][_0xb9a6('0x47')]({'name':_0x5e88aa[_0xb9a6('0x29')],'resourceId':_0x5e88aa['id'],'type':_0x4c7195['name'],'sectionId':_0x4c7195['id']},{})['then'](function(){return _0x160064;});}else{return _0x160064;}})[_0xb9a6('0x43')](function(_0x3f1e33){logger[_0xb9a6('0x4f')](_0xb9a6('0x50'),_0x3f1e33);throw _0x3f1e33;});}return _0x160064;})[_0xb9a6('0x24')](respondWithResult(_0x4ca69c,0xc9))[_0xb9a6('0x43')](handleError(_0x4ca69c,null));};exports[_0xb9a6('0x51')]=function(_0x58aea0,_0x3c2f2e){if(_0x58aea0[_0xb9a6('0x48')]['id']){delete _0x58aea0['body']['id'];}return db[_0xb9a6('0x40')][_0xb9a6('0x46')]({'where':{'id':_0x58aea0['params']['id']}})[_0xb9a6('0x24')](handleEntityNotFound(_0x3c2f2e,null))[_0xb9a6('0x24')](saveUpdates(_0x58aea0[_0xb9a6('0x48')],null))[_0xb9a6('0x24')](respondWithResult(_0x3c2f2e,null))['catch'](handleError(_0x3c2f2e,null));};exports[_0xb9a6('0x25')]=function(_0x23638e,_0x555c99){return db[_0xb9a6('0x40')]['find']({'where':{'id':_0x23638e[_0xb9a6('0x52')]['id']}})[_0xb9a6('0x24')](handleEntityNotFound(_0x555c99,null))['then'](removeEntity(_0x555c99,null))['catch'](handleError(_0x555c99,null));};exports[_0xb9a6('0x53')]=function(_0x177ef6,_0x4be8fe,_0x3732a4){if(_0x177ef6['body']['id']){delete _0x177ef6[_0xb9a6('0x48')]['id'];}return db[_0xb9a6('0x40')][_0xb9a6('0x46')]({'where':{'id':_0x177ef6[_0xb9a6('0x52')]['id']}})['then'](handleEntityNotFound(_0x4be8fe,null))['then'](function(_0x4807b4){if(_0x4807b4){_0x177ef6[_0xb9a6('0x48')][_0xb9a6('0x54')]=_0x4807b4['id'];return db['Interval'][_0xb9a6('0x47')](_0x177ef6[_0xb9a6('0x48')]);}})[_0xb9a6('0x24')](respondWithResult(_0x4be8fe,null))[_0xb9a6('0x43')](handleError(_0x4be8fe,null));};exports[_0xb9a6('0x55')]=function(_0x314805,_0x19fb86,_0x454d16){var _0x176706={};var _0x123c03={};var _0x50994a;var _0x5239d3;return db[_0xb9a6('0x40')][_0xb9a6('0x56')]({'where':{'id':_0x314805['params']['id']}})[_0xb9a6('0x24')](handleEntityNotFound(_0x19fb86,null))['then'](function(_0x33872b){if(_0x33872b){_0x50994a=_0x33872b;_0x123c03[_0xb9a6('0x2e')]=_[_0xb9a6('0x30')](db['Interval']['rawAttributes']);_0x123c03[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0x314805[_0xb9a6('0x2f')]);_0x123c03[_0xb9a6('0x31')]=_[_0xb9a6('0x32')](_0x123c03[_0xb9a6('0x2e')],_0x123c03[_0xb9a6('0x2f')]);_0x176706[_0xb9a6('0x33')]=_[_0xb9a6('0x32')](_0x123c03['model'],qs['fields'](_0x314805['query'][_0xb9a6('0x34')]));_0x176706['attributes']=_0x176706['attributes']['length']?_0x176706[_0xb9a6('0x33')]:_0x123c03['model'];_0x176706[_0xb9a6('0x57')]=qs[_0xb9a6('0x38')](_0x314805[_0xb9a6('0x2f')]['sort']);_0x176706[_0xb9a6('0x39')]=qs[_0xb9a6('0x31')](_[_0xb9a6('0x3a')](_0x314805['query'],_0x123c03['filters']));if(_0x314805[_0xb9a6('0x2f')][_0xb9a6('0x3b')]){_0x176706[_0xb9a6('0x39')]=_[_0xb9a6('0x3c')](_0x176706[_0xb9a6('0x39')],{'$or':_[_0xb9a6('0x2b')](_0x176706[_0xb9a6('0x33')],function(_0x56e487){var _0x294585={};_0x294585[_0x56e487]={'$like':'%'+_0x314805['query'][_0xb9a6('0x3b')]+'%'};return _0x294585;})});}_0x176706=_[_0xb9a6('0x3c')]({},_0x176706,_0x314805[_0xb9a6('0x3e')]);return _0x50994a[_0xb9a6('0x55')](_0x176706);}})[_0xb9a6('0x24')](function(_0x116095){if(_0x116095){_0x5239d3=_0x116095[_0xb9a6('0x35')];if(!_0x314805[_0xb9a6('0x2f')][_0xb9a6('0x36')]('nolimit')){_0x176706['limit']=qs['limit'](_0x314805[_0xb9a6('0x2f')][_0xb9a6('0x1f')]);_0x176706[_0xb9a6('0x1d')]=qs['offset'](_0x314805[_0xb9a6('0x2f')][_0xb9a6('0x1d')]);}return _0x50994a[_0xb9a6('0x55')](_0x176706);}})['then'](function(_0x1882ab){if(_0x1882ab){return _0x1882ab?{'count':_0x5239d3,'rows':_0x1882ab}:null;}})[_0xb9a6('0x24')](respondWithResult(_0x19fb86,null))[_0xb9a6('0x43')](handleError(_0x19fb86,null));};exports[_0xb9a6('0x58')]=function(_0x1315eb,_0x2c3089,_0x271eea){return db[_0xb9a6('0x40')][_0xb9a6('0x56')]({'where':{'id':_0x1315eb['params']['id']}})[_0xb9a6('0x24')](handleEntityNotFound(_0x2c3089,null))[_0xb9a6('0x24')](function(_0x55eedf){if(_0x55eedf){return db[_0xb9a6('0x59')]['transaction'](function(_0x51a7b1){return db[_0xb9a6('0x40')][_0xb9a6('0x25')]({'where':{'IntervalId':_0x1315eb['params']['id']},'transaction':_0x51a7b1})[_0xb9a6('0x24')](function(_0x1e2055){var _0x30914d=_[_0xb9a6('0x2b')](_0x1315eb[_0xb9a6('0x48')],function(_0x800f23){delete _0x800f23['id'];_0x800f23[_0xb9a6('0x54')]=_0x1315eb['params']['id'];return _0x800f23;});return db[_0xb9a6('0x40')][_0xb9a6('0x5a')](_0x30914d,{'transaction':_0x51a7b1});});})[_0xb9a6('0x24')](function(){return db[_0xb9a6('0x40')][_0xb9a6('0x41')]({'where':{'IntervalId':_0x1315eb[_0xb9a6('0x52')]['id']}});});}})[_0xb9a6('0x24')](respondWithResult(_0x2c3089,null))[_0xb9a6('0x43')](handleError(_0x2c3089,null));}; \ No newline at end of file +var _0xc977=['../../config/utils','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','destroy','then','get','UserProfileResource','end','error','name','send','Interval','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','VIRTUAL','filter','merge','options','count','include','findAll','show','keys','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5a8038,_0x10047c){var _0x1ab1fd=function(_0x484d1b){while(--_0x484d1b){_0x5a8038['push'](_0x5a8038['shift']());}};_0x1ab1fd(++_0x10047c);}(_0xc977,0x9a));var _0x7c97=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0xc977[_0x47d6dc];return _0x1a1c93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c97('0x0'));var zipdir=require(_0x7c97('0x1'));var jsonpatch=require(_0x7c97('0x2'));var rp=require(_0x7c97('0x3'));var moment=require('moment');var BPromise=require(_0x7c97('0x4'));var Mustache=require(_0x7c97('0x5'));var util=require(_0x7c97('0x6'));var path=require(_0x7c97('0x7'));var sox=require(_0x7c97('0x8'));var csv=require(_0x7c97('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c97('0xa'));var squel=require(_0x7c97('0xb'));var crypto=require(_0x7c97('0xc'));var jsforce=require(_0x7c97('0xd'));var deskjs=require(_0x7c97('0xe'));var toCsv=require(_0x7c97('0x9'));var querystring=require(_0x7c97('0xf'));var Papa=require(_0x7c97('0x10'));var Redis=require(_0x7c97('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7c97('0x12'));var hardwareService=require(_0x7c97('0x13'));var logger=require(_0x7c97('0x14'))(_0x7c97('0x15'));var utils=require(_0x7c97('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7c97('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x7c97('0x18'));function respondWithStatusCode(_0x3485d8,_0x2a94b5){_0x2a94b5=_0x2a94b5||0xcc;return function(_0x34316a){if(_0x34316a){return _0x3485d8[_0x7c97('0x19')](_0x2a94b5);}return _0x3485d8[_0x7c97('0x1a')](_0x2a94b5)['end']();};}function respondWithResult(_0x5246c9,_0x3136ae){_0x3136ae=_0x3136ae||0xc8;return function(_0x52a198){if(_0x52a198){return _0x5246c9['status'](_0x3136ae)[_0x7c97('0x1b')](_0x52a198);}};}function respondWithFilteredResult(_0x2775ba,_0x3261fe){return function(_0x65f4f8){if(_0x65f4f8){var _0x4bf7bc=typeof _0x3261fe[_0x7c97('0x1c')]===_0x7c97('0x1d')&&typeof _0x3261fe['limit']===_0x7c97('0x1d');var _0x45ae9b=_0x65f4f8['count'];var _0x114629=_0x4bf7bc?0x0:_0x3261fe[_0x7c97('0x1c')];var _0x1316fb=_0x4bf7bc?_0x65f4f8['count']:_0x3261fe[_0x7c97('0x1c')]+_0x3261fe[_0x7c97('0x1e')];var _0xe748f1;if(_0x1316fb>=_0x45ae9b){_0x1316fb=_0x45ae9b;_0xe748f1=0xc8;}else{_0xe748f1=0xce;}_0x2775ba[_0x7c97('0x1a')](_0xe748f1);return _0x2775ba[_0x7c97('0x1f')]('Content-Range',_0x114629+'-'+_0x1316fb+'/'+_0x45ae9b)[_0x7c97('0x1b')](_0x65f4f8);}return null;};}function patchUpdates(_0x1423fe){return function(_0x535c15){try{jsonpatch[_0x7c97('0x20')](_0x535c15,_0x1423fe,!![]);}catch(_0x4d7be0){return BPromise[_0x7c97('0x21')](_0x4d7be0);}return _0x535c15[_0x7c97('0x22')]();};}function saveUpdates(_0x3c017d,_0x2e10ed){return function(_0x5c041e){if(_0x5c041e){return _0x5c041e['update'](_0x3c017d)['then'](function(_0x3f4dda){return _0x3f4dda;});}return null;};}function removeEntity(_0x1417e7,_0xee7e3){return function(_0x57fba7){if(_0x57fba7){return _0x57fba7[_0x7c97('0x23')]()[_0x7c97('0x24')](function(){var _0x1113f4=_0x57fba7[_0x7c97('0x25')]({'plain':!![]});var _0x20ad5e='Intervals';return db[_0x7c97('0x26')]['destroy']({'where':{'type':_0x20ad5e,'resourceId':_0x1113f4['id']}})[_0x7c97('0x24')](function(){return _0x57fba7;});})[_0x7c97('0x24')](function(){_0x1417e7['status'](0xcc)[_0x7c97('0x27')]();});}};}function handleEntityNotFound(_0x1807d4,_0x494bf2){return function(_0x2fb457){if(!_0x2fb457){_0x1807d4[_0x7c97('0x19')](0x194);}return _0x2fb457;};}function handleError(_0xb57474,_0x44a9c2){_0x44a9c2=_0x44a9c2||0x1f4;return function(_0x2b1e56){logger[_0x7c97('0x28')](_0x2b1e56['stack']);if(_0x2b1e56[_0x7c97('0x29')]){delete _0x2b1e56[_0x7c97('0x29')];}_0xb57474[_0x7c97('0x1a')](_0x44a9c2)[_0x7c97('0x2a')](_0x2b1e56);};}exports['index']=function(_0x3a28d1,_0x345a8c){var _0x4e2eaf={},_0x234611={},_0x3ab687={'count':0x0,'rows':[]};var _0x4932b9=_['map'](db[_0x7c97('0x2b')][_0x7c97('0x2c')],function(_0x58fd11){return{'name':_0x58fd11['fieldName'],'type':_0x58fd11['type']['key']};});_0x234611[_0x7c97('0x2d')]=_['map'](_0x4932b9,_0x7c97('0x29'));_0x234611[_0x7c97('0x2e')]=_['keys'](_0x3a28d1[_0x7c97('0x2e')]);_0x234611[_0x7c97('0x2f')]=_[_0x7c97('0x30')](_0x234611['model'],_0x234611[_0x7c97('0x2e')]);_0x4e2eaf[_0x7c97('0x31')]=_[_0x7c97('0x30')](_0x234611[_0x7c97('0x2d')],qs[_0x7c97('0x32')](_0x3a28d1[_0x7c97('0x2e')][_0x7c97('0x32')]));_0x4e2eaf[_0x7c97('0x31')]=_0x4e2eaf['attributes'][_0x7c97('0x33')]?_0x4e2eaf[_0x7c97('0x31')]:_0x234611[_0x7c97('0x2d')];if(!_0x3a28d1[_0x7c97('0x2e')][_0x7c97('0x34')](_0x7c97('0x35'))){_0x4e2eaf[_0x7c97('0x1e')]=qs[_0x7c97('0x1e')](_0x3a28d1['query'][_0x7c97('0x1e')]);_0x4e2eaf[_0x7c97('0x1c')]=qs[_0x7c97('0x1c')](_0x3a28d1[_0x7c97('0x2e')]['offset']);}_0x4e2eaf[_0x7c97('0x36')]=qs[_0x7c97('0x37')](_0x3a28d1['query'][_0x7c97('0x37')]);_0x4e2eaf[_0x7c97('0x38')]=qs['filters'](_[_0x7c97('0x39')](_0x3a28d1[_0x7c97('0x2e')],_0x234611[_0x7c97('0x2f')]),_0x4932b9);if(_0x3a28d1[_0x7c97('0x2e')]['filter']){_0x4e2eaf['where']=_['merge'](_0x4e2eaf['where'],{'$or':_[_0x7c97('0x3a')](_0x4932b9,function(_0x29f324){if(_0x29f324[_0x7c97('0x3b')]!==_0x7c97('0x3c')){var _0x57d68b={};_0x57d68b[_0x29f324[_0x7c97('0x29')]]={'$like':'%'+_0x3a28d1[_0x7c97('0x2e')][_0x7c97('0x3d')]+'%'};return _0x57d68b;}})});}_0x4e2eaf=_[_0x7c97('0x3e')]({},_0x4e2eaf,_0x3a28d1[_0x7c97('0x3f')]);var _0x19dd16={'where':_0x4e2eaf[_0x7c97('0x38')]};return db[_0x7c97('0x2b')][_0x7c97('0x40')](_0x19dd16)[_0x7c97('0x24')](function(_0x5f2788){_0x3ab687['count']=_0x5f2788;if(_0x3a28d1[_0x7c97('0x2e')]['includeAll']){_0x4e2eaf[_0x7c97('0x41')]=[{'all':!![]}];}return db[_0x7c97('0x2b')][_0x7c97('0x42')](_0x4e2eaf);})[_0x7c97('0x24')](function(_0x13e2d6){_0x3ab687['rows']=_0x13e2d6;return _0x3ab687;})[_0x7c97('0x24')](respondWithFilteredResult(_0x345a8c,_0x4e2eaf))['catch'](handleError(_0x345a8c,null));};exports[_0x7c97('0x43')]=function(_0x520751,_0x5eff92){var _0x43f360={'raw':!![],'where':{'id':_0x520751['params']['id']}},_0x1db638={};_0x1db638[_0x7c97('0x2d')]=_['keys'](db['Interval'][_0x7c97('0x2c')]);_0x1db638[_0x7c97('0x2e')]=_[_0x7c97('0x44')](_0x520751[_0x7c97('0x2e')]);_0x1db638['filters']=_[_0x7c97('0x30')](_0x1db638['model'],_0x1db638[_0x7c97('0x2e')]);_0x43f360['attributes']=_[_0x7c97('0x30')](_0x1db638[_0x7c97('0x2d')],qs['fields'](_0x520751[_0x7c97('0x2e')][_0x7c97('0x32')]));_0x43f360[_0x7c97('0x31')]=_0x43f360[_0x7c97('0x31')][_0x7c97('0x33')]?_0x43f360[_0x7c97('0x31')]:_0x1db638[_0x7c97('0x2d')];if(_0x520751['query'][_0x7c97('0x45')]){_0x43f360[_0x7c97('0x41')]=[{'all':!![]}];}_0x43f360=_[_0x7c97('0x3e')]({},_0x43f360,_0x520751[_0x7c97('0x3f')]);return db['Interval']['find'](_0x43f360)[_0x7c97('0x24')](handleEntityNotFound(_0x5eff92,null))[_0x7c97('0x24')](respondWithResult(_0x5eff92,null))[_0x7c97('0x46')](handleError(_0x5eff92,null));};exports[_0x7c97('0x47')]=function(_0x3be77e,_0x4a1281){return db['Interval'][_0x7c97('0x47')](_0x3be77e[_0x7c97('0x48')],{})[_0x7c97('0x24')](function(_0x2fdf38){var _0x10d969=_0x3be77e[_0x7c97('0x49')][_0x7c97('0x25')]({'plain':!![]});if(!_0x10d969)throw new Error(_0x7c97('0x4a'));if(_0x10d969['role']===_0x7c97('0x49')){var _0x57cb8e=_0x2fdf38[_0x7c97('0x25')]({'plain':!![]});var _0x5562ea=_0x7c97('0x4b');return db['UserProfileSection'][_0x7c97('0x4c')]({'where':{'name':_0x5562ea,'userProfileId':_0x10d969[_0x7c97('0x4d')]},'raw':!![]})[_0x7c97('0x24')](function(_0x4fcc6a){if(_0x4fcc6a&&_0x4fcc6a['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x57cb8e['name'],'resourceId':_0x57cb8e['id'],'type':_0x4fcc6a[_0x7c97('0x29')],'sectionId':_0x4fcc6a['id']},{})[_0x7c97('0x24')](function(){return _0x2fdf38;});}else{return _0x2fdf38;}})['catch'](function(_0x2238f3){logger[_0x7c97('0x28')](_0x7c97('0x4e'),_0x2238f3);throw _0x2238f3;});}return _0x2fdf38;})[_0x7c97('0x24')](respondWithResult(_0x4a1281,0xc9))[_0x7c97('0x46')](handleError(_0x4a1281,null));};exports[_0x7c97('0x4f')]=function(_0x4fb094,_0x198a46){if(_0x4fb094['body']['id']){delete _0x4fb094[_0x7c97('0x48')]['id'];}return db[_0x7c97('0x2b')][_0x7c97('0x4c')]({'where':{'id':_0x4fb094[_0x7c97('0x50')]['id']}})[_0x7c97('0x24')](handleEntityNotFound(_0x198a46,null))[_0x7c97('0x24')](saveUpdates(_0x4fb094['body'],null))['then'](respondWithResult(_0x198a46,null))[_0x7c97('0x46')](handleError(_0x198a46,null));};exports[_0x7c97('0x23')]=function(_0x1bb7de,_0x4e3dd2){return db[_0x7c97('0x2b')][_0x7c97('0x4c')]({'where':{'id':_0x1bb7de[_0x7c97('0x50')]['id']}})[_0x7c97('0x24')](handleEntityNotFound(_0x4e3dd2,null))[_0x7c97('0x24')](removeEntity(_0x4e3dd2,null))[_0x7c97('0x46')](handleError(_0x4e3dd2,null));};exports[_0x7c97('0x51')]=function(_0x5a9653,_0x418cf4,_0x1884ac){if(_0x5a9653['body']['id']){delete _0x5a9653[_0x7c97('0x48')]['id'];}return db[_0x7c97('0x2b')][_0x7c97('0x4c')]({'where':{'id':_0x5a9653[_0x7c97('0x50')]['id']}})[_0x7c97('0x24')](handleEntityNotFound(_0x418cf4,null))[_0x7c97('0x24')](function(_0x2f5585){if(_0x2f5585){_0x5a9653[_0x7c97('0x48')][_0x7c97('0x52')]=_0x2f5585['id'];return db[_0x7c97('0x2b')][_0x7c97('0x47')](_0x5a9653[_0x7c97('0x48')]);}})[_0x7c97('0x24')](respondWithResult(_0x418cf4,null))[_0x7c97('0x46')](handleError(_0x418cf4,null));};exports[_0x7c97('0x53')]=function(_0x5ac8b8,_0x1cdd55,_0x17bcb2){var _0x338fcc={};var _0x29fe9f={};var _0x553560;var _0x189dbf;return db[_0x7c97('0x2b')][_0x7c97('0x54')]({'where':{'id':_0x5ac8b8[_0x7c97('0x50')]['id']}})[_0x7c97('0x24')](handleEntityNotFound(_0x1cdd55,null))[_0x7c97('0x24')](function(_0x4a80d7){if(_0x4a80d7){_0x553560=_0x4a80d7;_0x29fe9f[_0x7c97('0x2d')]=_[_0x7c97('0x44')](db['Interval'][_0x7c97('0x2c')]);_0x29fe9f['query']=_[_0x7c97('0x44')](_0x5ac8b8['query']);_0x29fe9f['filters']=_['intersection'](_0x29fe9f[_0x7c97('0x2d')],_0x29fe9f['query']);_0x338fcc[_0x7c97('0x31')]=_[_0x7c97('0x30')](_0x29fe9f['model'],qs[_0x7c97('0x32')](_0x5ac8b8[_0x7c97('0x2e')][_0x7c97('0x32')]));_0x338fcc['attributes']=_0x338fcc['attributes'][_0x7c97('0x33')]?_0x338fcc[_0x7c97('0x31')]:_0x29fe9f[_0x7c97('0x2d')];_0x338fcc[_0x7c97('0x36')]=qs[_0x7c97('0x37')](_0x5ac8b8['query'][_0x7c97('0x37')]);_0x338fcc[_0x7c97('0x38')]=qs[_0x7c97('0x2f')](_[_0x7c97('0x39')](_0x5ac8b8['query'],_0x29fe9f[_0x7c97('0x2f')]));if(_0x5ac8b8[_0x7c97('0x2e')]['filter']){_0x338fcc[_0x7c97('0x38')]=_[_0x7c97('0x3e')](_0x338fcc[_0x7c97('0x38')],{'$or':_[_0x7c97('0x3a')](_0x338fcc[_0x7c97('0x31')],function(_0x34d6f9){var _0x44ec82={};_0x44ec82[_0x34d6f9]={'$like':'%'+_0x5ac8b8[_0x7c97('0x2e')]['filter']+'%'};return _0x44ec82;})});}_0x338fcc=_[_0x7c97('0x3e')]({},_0x338fcc,_0x5ac8b8[_0x7c97('0x3f')]);return _0x553560[_0x7c97('0x53')](_0x338fcc);}})[_0x7c97('0x24')](function(_0x4bc6e6){if(_0x4bc6e6){_0x189dbf=_0x4bc6e6[_0x7c97('0x33')];if(!_0x5ac8b8[_0x7c97('0x2e')][_0x7c97('0x34')](_0x7c97('0x35'))){_0x338fcc[_0x7c97('0x1e')]=qs[_0x7c97('0x1e')](_0x5ac8b8[_0x7c97('0x2e')]['limit']);_0x338fcc['offset']=qs[_0x7c97('0x1c')](_0x5ac8b8[_0x7c97('0x2e')][_0x7c97('0x1c')]);}return _0x553560[_0x7c97('0x53')](_0x338fcc);}})[_0x7c97('0x24')](function(_0x6d745b){if(_0x6d745b){return _0x6d745b?{'count':_0x189dbf,'rows':_0x6d745b}:null;}})[_0x7c97('0x24')](respondWithResult(_0x1cdd55,null))[_0x7c97('0x46')](handleError(_0x1cdd55,null));};exports[_0x7c97('0x55')]=function(_0x2fff96,_0x4e9534,_0x5c8ea8){return db[_0x7c97('0x2b')]['findOne']({'where':{'id':_0x2fff96[_0x7c97('0x50')]['id']}})[_0x7c97('0x24')](handleEntityNotFound(_0x4e9534,null))[_0x7c97('0x24')](function(_0x57140b){if(_0x57140b){return db[_0x7c97('0x56')]['transaction'](function(_0x385ab4){return db[_0x7c97('0x2b')][_0x7c97('0x23')]({'where':{'IntervalId':_0x2fff96['params']['id']},'transaction':_0x385ab4})['then'](function(_0x4b0f4b){var _0x28dc71=_[_0x7c97('0x3a')](_0x2fff96[_0x7c97('0x48')],function(_0x1ad8fe){delete _0x1ad8fe['id'];_0x1ad8fe[_0x7c97('0x52')]=_0x2fff96[_0x7c97('0x50')]['id'];return _0x1ad8fe;});return db[_0x7c97('0x2b')][_0x7c97('0x57')](_0x28dc71,{'transaction':_0x385ab4});});})[_0x7c97('0x24')](function(){return db[_0x7c97('0x2b')]['findAll']({'where':{'IntervalId':_0x2fff96[_0x7c97('0x50')]['id']}});});}})['then'](respondWithResult(_0x4e9534,null))[_0x7c97('0x46')](handleError(_0x4e9534,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index da6ceed..13fbab6 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 _0xd507=['rewrite','api','moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval'];(function(_0x443b1e,_0xf7ffe9){var _0x3beb6f=function(_0x1cd133){while(--_0x1cd133){_0x443b1e['push'](_0x443b1e['shift']());}};_0x3beb6f(++_0xf7ffe9);}(_0xd507,0x114));var _0x7d50=function(_0x2b456e,_0x5d713a){_0x2b456e=_0x2b456e-0x0;var _0x47b420=_0xd507[_0x2b456e];return _0x47b420;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7d50('0x0'));var moment=require(_0x7d50('0x1'));var BPromise=require('bluebird');var rp=require(_0x7d50('0x2'));var fs=require('fs');var path=require(_0x7d50('0x3'));var rimraf=require(_0x7d50('0x4'));var config=require(_0x7d50('0x5'));var attributes=require(_0x7d50('0x6'));var extensions=require(_0x7d50('0x7'));module['exports']=function(_0x3d8396,_0x10aab0){return _0x3d8396[_0x7d50('0x8')](_0x7d50('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a4e56,_0x1bf1f8){extensions[_0x7d50('0xa')](_0x3d8396,_0x1a4e56);},'afterBulkCreate':function(_0x212658,_0x3b2c11,_0x169ad0){_0x169ad0();extensions[_0x7d50('0xa')](_0x3d8396,_0x212658[0x0]);},'afterUpdate':function(_0x57299e,_0x4ca1d3){extensions[_0x7d50('0xa')](_0x3d8396,_0x57299e);},'afterDestroy':function(_0x141dc3,_0x1e76ea){extensions['rewrite'](_0x3d8396,_0x141dc3);}}});}; \ No newline at end of file +var _0x0a01=['Interval','tools_intervals','rewrite','api','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x0a01,0x10b));var _0x10a0=function(_0x2b2cf5,_0x2cf1be){_0x2b2cf5=_0x2b2cf5-0x0;var _0x1d8f4a=_0x0a01[_0x2b2cf5];return _0x1d8f4a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x10a0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x10a0('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10a0('0x2'));var config=require(_0x10a0('0x3'));var attributes=require(_0x10a0('0x4'));var extensions=require(_0x10a0('0x5'));module[_0x10a0('0x6')]=function(_0x1d82b6,_0x5441b7){return _0x1d82b6[_0x10a0('0x7')](_0x10a0('0x8'),attributes,{'tableName':_0x10a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xee5289,_0x46fc47){extensions[_0x10a0('0xa')](_0x1d82b6,_0xee5289);},'afterBulkCreate':function(_0x5cfb34,_0x24aede,_0x1b9311){_0x1b9311();extensions[_0x10a0('0xa')](_0x1d82b6,_0x5cfb34[0x0]);},'afterUpdate':function(_0x51ab67,_0x54fb52){extensions[_0x10a0('0xa')](_0x1d82b6,_0x51ab67);},'afterDestroy':function(_0x551b8c,_0x5b030c){extensions[_0x10a0('0xa')](_0x1d82b6,_0x551b8c);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 371faa4..97259c2 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(_0x4bdf64,_0x3022b2){var _0x9a1a19=function(_0x4e551b){while(--_0x4e551b){_0x4bdf64['push'](_0x4bdf64['shift']());}};_0x9a1a19(++_0x3022b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 60024fb..32065aa 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(_0x1b2704,_0x345e20){var _0x4e3e41=function(_0x480222){while(--_0x480222){_0x1b2704['push'](_0x1b2704['shift']());}};_0x4e3e41(++_0x345e20);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3bb9da,_0x502962){_0x3bb9da=_0x3bb9da-0x0;var _0x17eef7=_0x5f2f[_0x3bb9da];return _0x17eef7;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index d1543f0..40d2e53 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 _0x1c49=['Bug','email','customfield_11501','oldToken','fields','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','request','setEncoding','data','end','status','json','api.jira','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify'];(function(_0x27cf94,_0x305114){var _0x9d473a=function(_0xf25d79){while(--_0xf25d79){_0x27cf94['push'](_0x27cf94['shift']());}};_0x9d473a(++_0x305114);}(_0x1c49,0xe6));var _0x91c4=function(_0x5f8af1,_0xf3ba33){_0x5f8af1=_0x5f8af1-0x0;var _0x411e24=_0x1c49[_0x5f8af1];return _0x411e24;};'use strict';var BPromise=require(_0x91c4('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x91c4('0x1'));var USERNAME=_0x91c4('0x2');var PASSWORD=_0x91c4('0x3');function openIssue(_0x1895e6,_0x191118){var _0x2a5232={'fields':{'project':{'key':_0x1895e6[_0x91c4('0x4')]||'MOTGUI'},'summary':(_0x1895e6[_0x91c4('0x5')]||_0x91c4('0x6'))+_0x91c4('0x7')+_0x1895e6['ip'],'description':_0x1895e6[_0x91c4('0x8')]||JSON[_0x91c4('0x9')](_0x1895e6),'issuetype':{'name':_0x1895e6['issuetype']||_0x91c4('0xa')}}};_0x2a5232['fields']['customfield_11500']=_0x1895e6[_0x91c4('0xb')];_0x2a5232['fields'][_0x91c4('0xc')]=_0x1895e6[_0x91c4('0xd')];_0x2a5232[_0x91c4('0xe')][_0x91c4('0xf')]=_0x1895e6['newToken'];_0x2a5232['fields'][_0x91c4('0x10')]=_0x1895e6[_0x91c4('0x11')];_0x2a5232[_0x91c4('0xe')][_0x91c4('0x12')]=_0x1895e6[_0x91c4('0x13')];_0x2a5232[_0x91c4('0xe')][_0x91c4('0x14')]=_0x1895e6['ip'];var _0x28508d={'host':_0x91c4('0x15'),'port':0x1bb,'path':_0x91c4('0x16'),'method':_0x91c4('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x91c4('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x91c4('0x19')]('base64')}};var _0x5e4fcd=JSON[_0x91c4('0x9')](_0x2a5232);var _0x4e51d7=https[_0x91c4('0x1a')](_0x28508d,function(_0x4c72f8){_0x4c72f8[_0x91c4('0x1b')]('utf8');var _0x12cb82='';_0x4c72f8['on'](_0x91c4('0x1c'),function(_0x4c7ab7){_0x12cb82+=_0x4c7ab7;});_0x4c72f8['on'](_0x91c4('0x1d'),function(){if(_0x191118){return _0x191118[_0x91c4('0x1e')](_0x4c72f8['statusCode'])[_0x91c4('0x1f')](JSON['parse'](_0x12cb82));}});});_0x4e51d7['on']('error',function(_0x42cefa){if(_0x191118){return _0x191118['status'](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x91c4('0x20')}]});}});_0x4e51d7['write'](_0x5e4fcd);_0x4e51d7[_0x91c4('0x1d')]();}exports[_0x91c4('0x21')]=openIssue;exports[_0x91c4('0x22')]=function(_0x17eeb8,_0x414ee6){_0x17eeb8[_0x91c4('0x23')]['ip']=_0x17eeb8['headers'][_0x91c4('0x24')]||_0x17eeb8['connection'][_0x91c4('0x25')]||_0x17eeb8[_0x91c4('0x26')][_0x91c4('0x25')]||_0x17eeb8[_0x91c4('0x27')]['socket'][_0x91c4('0x25')];return openIssue(_0x17eeb8[_0x91c4('0x23')],_0x414ee6);}; \ No newline at end of file +var _0x9dba=['Bug','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','stringify','issuetype'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x9dba,0xb5));var _0xa9db=function(_0xf1507c,_0x23f2a9){_0xf1507c=_0xf1507c-0x0;var _0xc0c469=_0x9dba[_0xf1507c];return _0xc0c469;};'use strict';var BPromise=require(_0xa9db('0x0'));var https=require(_0xa9db('0x1'));var logger=require(_0xa9db('0x2'))('api');var USERNAME=_0xa9db('0x3');var PASSWORD=_0xa9db('0x4');function openIssue(_0x171d3d,_0x43187d){var _0x2acee3={'fields':{'project':{'key':_0x171d3d[_0xa9db('0x5')]||_0xa9db('0x6')},'summary':(_0x171d3d['summary']||_0xa9db('0x7'))+_0xa9db('0x8')+_0x171d3d['ip'],'description':_0x171d3d['description']||JSON[_0xa9db('0x9')](_0x171d3d),'issuetype':{'name':_0x171d3d[_0xa9db('0xa')]||_0xa9db('0xb')}}};_0x2acee3[_0xa9db('0xc')]['customfield_11500']=_0x171d3d[_0xa9db('0xd')];_0x2acee3['fields'][_0xa9db('0xe')]=_0x171d3d[_0xa9db('0xf')];_0x2acee3[_0xa9db('0xc')][_0xa9db('0x10')]=_0x171d3d[_0xa9db('0x11')];_0x2acee3[_0xa9db('0xc')][_0xa9db('0x12')]=_0x171d3d['name'];_0x2acee3[_0xa9db('0xc')][_0xa9db('0x13')]=_0x171d3d[_0xa9db('0x14')];_0x2acee3[_0xa9db('0xc')][_0xa9db('0x15')]=_0x171d3d['ip'];var _0x72eb0a={'host':_0xa9db('0x16'),'port':0x1bb,'path':_0xa9db('0x17'),'method':_0xa9db('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xa9db('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xa9db('0x1a')](_0xa9db('0x1b'))}};var _0x172525=JSON[_0xa9db('0x9')](_0x2acee3);var _0x23bf77=https[_0xa9db('0x1c')](_0x72eb0a,function(_0x2a3362){_0x2a3362[_0xa9db('0x1d')](_0xa9db('0x1e'));var _0x209f2b='';_0x2a3362['on'](_0xa9db('0x1f'),function(_0x52ec7d){_0x209f2b+=_0x52ec7d;});_0x2a3362['on'](_0xa9db('0x20'),function(){if(_0x43187d){return _0x43187d[_0xa9db('0x21')](_0x2a3362[_0xa9db('0x22')])['json'](JSON[_0xa9db('0x23')](_0x209f2b));}});});_0x23bf77['on'](_0xa9db('0x24'),function(_0x2154e0){if(_0x43187d){return _0x43187d[_0xa9db('0x21')](0x1f4)[_0xa9db('0x25')]({'errors':[{'message':_0xa9db('0x26'),'type':_0xa9db('0x27')}]});}});_0x23bf77[_0xa9db('0x28')](_0x172525);_0x23bf77[_0xa9db('0x20')]();}exports[_0xa9db('0x29')]=openIssue;exports['send']=function(_0x328dfd,_0x4012f1){_0x328dfd[_0xa9db('0x2a')]['ip']=_0x328dfd[_0xa9db('0x2b')][_0xa9db('0x2c')]||_0x328dfd[_0xa9db('0x2d')][_0xa9db('0x2e')]||_0x328dfd[_0xa9db('0x2f')]['remoteAddress']||_0x328dfd[_0xa9db('0x2d')][_0xa9db('0x2f')]['remoteAddress'];return openIssue(_0x328dfd[_0xa9db('0x2a')],_0x4012f1);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f2873b6..57fea22 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 _0x22fb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e05bc,_0x2e0072){var _0x29f82b=function(_0x571d02){while(--_0x571d02){_0x4e05bc['push'](_0x4e05bc['shift']());}};_0x29f82b(++_0x2e0072);}(_0x22fb,0x192));var _0xb22f=function(_0x288aef,_0x2634d5){_0x288aef=_0x288aef-0x0;var _0x3c4599=_0x22fb[_0x288aef];return _0x3c4599;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x702d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x702d,0x147));var _0xd702=function(_0x307a38,_0x2444c7){_0x307a38=_0x307a38-0x0;var _0x3a5e01=_0x702d[_0x307a38];return _0x3a5e01;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./jscriptyAnswerReport.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0xc')]);router['get'](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0xf')]);router[_0xd702('0x10')]('/',auth[_0xd702('0xe')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0x13')]);router['delete']('/:id',auth[_0xd702('0xe')](),controller[_0xd702('0x14')]);module[_0xd702('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 a5f00ea..42147b0 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(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x2cc258,_0x222576){_0x2cc258=_0x2cc258-0x0;var _0x194a34=_0x7a54[_0x2cc258];return _0x194a34;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x1ec06e,_0x570949){_0x1ec06e=_0x1ec06e-0x0;var _0x1dc9be=_0x7a54[_0x1ec06e];return _0x1dc9be;};'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 a9413ad..7c7cf38 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 _0x3bd7=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','params','create','update','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','to-csv'];(function(_0x18cd9b,_0x5003b8){var _0x5e4b10=function(_0xb97db4){while(--_0xb97db4){_0x18cd9b['push'](_0x18cd9b['shift']());}};_0x5e4b10(++_0x5003b8);}(_0x3bd7,0x199));var _0x73bd=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x3bd7[_0x9b5bb2];return _0x2e1e92;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73bd('0x0'));var jsonpatch=require(_0x73bd('0x1'));var rp=require(_0x73bd('0x2'));var moment=require('moment');var BPromise=require(_0x73bd('0x3'));var Mustache=require(_0x73bd('0x4'));var util=require(_0x73bd('0x5'));var path=require('path');var sox=require(_0x73bd('0x6'));var csv=require('to-csv');var ejs=require(_0x73bd('0x7'));var fs=require('fs');var fs_extra=require(_0x73bd('0x8'));var _=require('lodash');var squel=require(_0x73bd('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x73bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x73bd('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x73bd('0xc'));var as=require(_0x73bd('0xd'));var hardwareService=require(_0x73bd('0xe'));var logger=require(_0x73bd('0xf'))(_0x73bd('0x10'));var utils=require(_0x73bd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x73bd('0x12'));var db=require(_0x73bd('0x13'))['db'];function respondWithStatusCode(_0x31c882,_0x41f324){_0x41f324=_0x41f324||0xcc;return function(_0x2a5dea){if(_0x2a5dea){return _0x31c882[_0x73bd('0x14')](_0x41f324);}return _0x31c882['status'](_0x41f324)[_0x73bd('0x15')]();};}function respondWithResult(_0x5c4bc8,_0x189007){_0x189007=_0x189007||0xc8;return function(_0x3eab86){if(_0x3eab86){return _0x5c4bc8[_0x73bd('0x16')](_0x189007)[_0x73bd('0x17')](_0x3eab86);}};}function respondWithFilteredResult(_0x3e628a,_0x5ea8db){return function(_0x41663e){if(_0x41663e){var _0xfdf66=typeof _0x5ea8db[_0x73bd('0x18')]===_0x73bd('0x19')&&typeof _0x5ea8db[_0x73bd('0x1a')]===_0x73bd('0x19');var _0x10e371=_0x41663e[_0x73bd('0x1b')];var _0x21787b=_0xfdf66?0x0:_0x5ea8db['offset'];var _0x1e559b=_0xfdf66?_0x41663e[_0x73bd('0x1b')]:_0x5ea8db[_0x73bd('0x18')]+_0x5ea8db[_0x73bd('0x1a')];var _0x1cb0e3;if(_0x1e559b>=_0x10e371){_0x1e559b=_0x10e371;_0x1cb0e3=0xc8;}else{_0x1cb0e3=0xce;}_0x3e628a[_0x73bd('0x16')](_0x1cb0e3);return _0x3e628a[_0x73bd('0x1c')](_0x73bd('0x1d'),_0x21787b+'-'+_0x1e559b+'/'+_0x10e371)[_0x73bd('0x17')](_0x41663e);}return null;};}function patchUpdates(_0x57d1ec){return function(_0x459965){try{jsonpatch[_0x73bd('0x1e')](_0x459965,_0x57d1ec,!![]);}catch(_0x292f8c){return BPromise['reject'](_0x292f8c);}return _0x459965['save']();};}function saveUpdates(_0x4f23e6,_0x10b388){return function(_0x269e84){if(_0x269e84){return _0x269e84['update'](_0x4f23e6)[_0x73bd('0x1f')](function(_0x22574c){return _0x22574c;});}return null;};}function removeEntity(_0x5b7bbb,_0x325cc1){return function(_0x1e22c5){if(_0x1e22c5){return _0x1e22c5[_0x73bd('0x20')]()[_0x73bd('0x1f')](function(){_0x5b7bbb[_0x73bd('0x16')](0xcc)[_0x73bd('0x15')]();});}};}function handleEntityNotFound(_0x2dd70b,_0x36f7e0){return function(_0x840215){if(!_0x840215){_0x2dd70b[_0x73bd('0x14')](0x194);}return _0x840215;};}function handleError(_0x473527,_0x388698){_0x388698=_0x388698||0x1f4;return function(_0x52e910){logger['error'](_0x52e910[_0x73bd('0x21')]);if(_0x52e910[_0x73bd('0x22')]){delete _0x52e910['name'];}_0x473527[_0x73bd('0x16')](_0x388698)[_0x73bd('0x23')](_0x52e910);};}exports[_0x73bd('0x24')]=function(_0x5ada8d,_0x5ae04e){var _0x2f38fe={},_0x3f15f8={},_0x315318={'count':0x0,'rows':[]};var _0x5be8d6=_[_0x73bd('0x25')](db['JscriptyAnswerReport'][_0x73bd('0x26')],function(_0x2701da){return{'name':_0x2701da['fieldName'],'type':_0x2701da['type'][_0x73bd('0x27')]};});_0x3f15f8[_0x73bd('0x28')]=_[_0x73bd('0x25')](_0x5be8d6,_0x73bd('0x22'));_0x3f15f8['query']=_[_0x73bd('0x29')](_0x5ada8d['query']);_0x3f15f8[_0x73bd('0x2a')]=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],_0x3f15f8[_0x73bd('0x2c')]);_0x2f38fe['attributes']=_[_0x73bd('0x2b')](_0x3f15f8[_0x73bd('0x28')],qs[_0x73bd('0x2d')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x2f38fe[_0x73bd('0x2e')]=_0x2f38fe[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x2f38fe['attributes']:_0x3f15f8[_0x73bd('0x28')];if(!_0x5ada8d[_0x73bd('0x2c')]['hasOwnProperty'](_0x73bd('0x30'))){_0x2f38fe[_0x73bd('0x1a')]=qs['limit'](_0x5ada8d[_0x73bd('0x2c')]['limit']);_0x2f38fe[_0x73bd('0x18')]=qs['offset'](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x18')]);}_0x2f38fe[_0x73bd('0x31')]=qs[_0x73bd('0x32')](_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x32')]);_0x2f38fe[_0x73bd('0x33')]=qs['filters'](_[_0x73bd('0x34')](_0x5ada8d[_0x73bd('0x2c')],_0x3f15f8['filters']),_0x5be8d6);if(_0x5ada8d[_0x73bd('0x2c')]['filter']){_0x2f38fe[_0x73bd('0x33')]=_[_0x73bd('0x35')](_0x2f38fe[_0x73bd('0x33')],{'$or':_[_0x73bd('0x25')](_0x5be8d6,function(_0x367597){if(_0x367597['type']!==_0x73bd('0x36')){var _0x2de851={};_0x2de851[_0x367597[_0x73bd('0x22')]]={'$like':'%'+_0x5ada8d['query'][_0x73bd('0x37')]+'%'};return _0x2de851;}})});}_0x2f38fe=_[_0x73bd('0x35')]({},_0x2f38fe,_0x5ada8d[_0x73bd('0x38')]);var _0x30e148={'where':_0x2f38fe[_0x73bd('0x33')]};return db[_0x73bd('0x39')][_0x73bd('0x1b')](_0x30e148)[_0x73bd('0x1f')](function(_0x519c3c){_0x315318[_0x73bd('0x1b')]=_0x519c3c;if(_0x5ada8d[_0x73bd('0x2c')][_0x73bd('0x3a')]){_0x2f38fe[_0x73bd('0x3b')]=[{'all':!![]}];}return db[_0x73bd('0x39')][_0x73bd('0x3c')](_0x2f38fe);})[_0x73bd('0x1f')](function(_0x48fed7){_0x315318[_0x73bd('0x3d')]=_0x48fed7;return _0x315318;})[_0x73bd('0x1f')](respondWithFilteredResult(_0x5ae04e,_0x2f38fe))[_0x73bd('0x3e')](handleError(_0x5ae04e,null));};exports[_0x73bd('0x3f')]=function(_0x532afd,_0x142532){var _0x234de7={'raw':!![],'where':{'id':_0x532afd[_0x73bd('0x40')]['id']}},_0xe91596={};_0xe91596[_0x73bd('0x28')]=_['keys'](db[_0x73bd('0x39')]['rawAttributes']);_0xe91596[_0x73bd('0x2c')]=_['keys'](_0x532afd[_0x73bd('0x2c')]);_0xe91596[_0x73bd('0x2a')]=_['intersection'](_0xe91596[_0x73bd('0x28')],_0xe91596[_0x73bd('0x2c')]);_0x234de7[_0x73bd('0x2e')]=_[_0x73bd('0x2b')](_0xe91596[_0x73bd('0x28')],qs['fields'](_0x532afd[_0x73bd('0x2c')][_0x73bd('0x2d')]));_0x234de7[_0x73bd('0x2e')]=_0x234de7[_0x73bd('0x2e')][_0x73bd('0x2f')]?_0x234de7[_0x73bd('0x2e')]:_0xe91596[_0x73bd('0x28')];if(_0x532afd[_0x73bd('0x2c')]['includeAll']){_0x234de7['include']=[{'all':!![]}];}_0x234de7=_[_0x73bd('0x35')]({},_0x234de7,_0x532afd[_0x73bd('0x38')]);return db[_0x73bd('0x39')]['find'](_0x234de7)[_0x73bd('0x1f')](handleEntityNotFound(_0x142532,null))['then'](respondWithResult(_0x142532,null))[_0x73bd('0x3e')](handleError(_0x142532,null));};exports[_0x73bd('0x41')]=function(_0x57df9e,_0x4905a4){return db['JscriptyAnswerReport'][_0x73bd('0x41')](_0x57df9e['body'],{})[_0x73bd('0x1f')](respondWithResult(_0x4905a4,0xc9))['catch'](handleError(_0x4905a4,null));};exports[_0x73bd('0x42')]=function(_0x1e2e28,_0x7b4baf){if(_0x1e2e28[_0x73bd('0x43')]['id']){delete _0x1e2e28['body']['id'];}return db[_0x73bd('0x39')][_0x73bd('0x44')]({'where':{'id':_0x1e2e28[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x7b4baf,null))[_0x73bd('0x1f')](saveUpdates(_0x1e2e28[_0x73bd('0x43')],null))[_0x73bd('0x1f')](respondWithResult(_0x7b4baf,null))[_0x73bd('0x3e')](handleError(_0x7b4baf,null));};exports['destroy']=function(_0x8b88f5,_0x47397d){return db['JscriptyAnswerReport'][_0x73bd('0x44')]({'where':{'id':_0x8b88f5[_0x73bd('0x40')]['id']}})[_0x73bd('0x1f')](handleEntityNotFound(_0x47397d,null))['then'](removeEntity(_0x47397d,null))[_0x73bd('0x3e')](handleError(_0x47397d,null));};exports[_0x73bd('0x45')]=function(_0x23b5ad,_0x2201c7){return db[_0x73bd('0x39')]['describe']()['then'](respondWithResult(_0x2201c7,null))['catch'](handleError(_0x2201c7,null));}; \ No newline at end of file +var _0x2e88=['moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x38f7b7,_0xd361ff){var _0xf50805=function(_0x2a72e6){while(--_0x2a72e6){_0x38f7b7['push'](_0x38f7b7['shift']());}};_0xf50805(++_0xd361ff);}(_0x2e88,0x95));var _0x82e8=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x2e88[_0x1793de];return _0x4f0309;};'use strict';var emlformat=require(_0x82e8('0x0'));var rimraf=require(_0x82e8('0x1'));var zipdir=require(_0x82e8('0x2'));var jsonpatch=require(_0x82e8('0x3'));var rp=require(_0x82e8('0x4'));var moment=require(_0x82e8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x82e8('0x6'));var util=require(_0x82e8('0x7'));var path=require('path');var sox=require(_0x82e8('0x8'));var csv=require(_0x82e8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82e8('0xa'));var _=require(_0x82e8('0xb'));var squel=require(_0x82e8('0xc'));var crypto=require(_0x82e8('0xd'));var jsforce=require(_0x82e8('0xe'));var deskjs=require(_0x82e8('0xf'));var toCsv=require(_0x82e8('0x9'));var querystring=require(_0x82e8('0x10'));var Papa=require(_0x82e8('0x11'));var Redis=require(_0x82e8('0x12'));var authService=require(_0x82e8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x82e8('0x14'));var hardwareService=require(_0x82e8('0x15'));var logger=require(_0x82e8('0x16'))(_0x82e8('0x17'));var utils=require(_0x82e8('0x18'));var config=require(_0x82e8('0x19'));var licenseUtil=require(_0x82e8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253a36,_0xdf1b65){_0xdf1b65=_0xdf1b65||0xcc;return function(_0xb6d94a){if(_0xb6d94a){return _0x253a36[_0x82e8('0x1b')](_0xdf1b65);}return _0x253a36[_0x82e8('0x1c')](_0xdf1b65)['end']();};}function respondWithResult(_0x3353e0,_0x2c9569){_0x2c9569=_0x2c9569||0xc8;return function(_0xad6055){if(_0xad6055){return _0x3353e0[_0x82e8('0x1c')](_0x2c9569)['json'](_0xad6055);}};}function respondWithFilteredResult(_0x25b60e,_0x461744){return function(_0x3253d2){if(_0x3253d2){var _0xf53214=typeof _0x461744[_0x82e8('0x1d')]==='undefined'&&typeof _0x461744[_0x82e8('0x1e')]===_0x82e8('0x1f');var _0x574ba2=_0x3253d2[_0x82e8('0x20')];var _0xf287da=_0xf53214?0x0:_0x461744[_0x82e8('0x1d')];var _0x380f44=_0xf53214?_0x3253d2[_0x82e8('0x20')]:_0x461744[_0x82e8('0x1d')]+_0x461744[_0x82e8('0x1e')];var _0x5d7986;if(_0x380f44>=_0x574ba2){_0x380f44=_0x574ba2;_0x5d7986=0xc8;}else{_0x5d7986=0xce;}_0x25b60e[_0x82e8('0x1c')](_0x5d7986);return _0x25b60e[_0x82e8('0x21')](_0x82e8('0x22'),_0xf287da+'-'+_0x380f44+'/'+_0x574ba2)[_0x82e8('0x23')](_0x3253d2);}return null;};}function patchUpdates(_0xbfecf2){return function(_0x5db337){try{jsonpatch[_0x82e8('0x24')](_0x5db337,_0xbfecf2,!![]);}catch(_0x497c48){return BPromise[_0x82e8('0x25')](_0x497c48);}return _0x5db337[_0x82e8('0x26')]();};}function saveUpdates(_0x1475cf,_0x3ab5a2){return function(_0x198c3d){if(_0x198c3d){return _0x198c3d[_0x82e8('0x27')](_0x1475cf)[_0x82e8('0x28')](function(_0x591583){return _0x591583;});}return null;};}function removeEntity(_0x2b82eb,_0x57cc9c){return function(_0x4de0d2){if(_0x4de0d2){return _0x4de0d2['destroy']()[_0x82e8('0x28')](function(){_0x2b82eb['status'](0xcc)[_0x82e8('0x29')]();});}};}function handleEntityNotFound(_0x305710,_0xeff996){return function(_0x488b06){if(!_0x488b06){_0x305710[_0x82e8('0x1b')](0x194);}return _0x488b06;};}function handleError(_0x476602,_0x336015){_0x336015=_0x336015||0x1f4;return function(_0x2400c5){logger[_0x82e8('0x2a')](_0x2400c5['stack']);if(_0x2400c5['name']){delete _0x2400c5[_0x82e8('0x2b')];}_0x476602[_0x82e8('0x1c')](_0x336015)[_0x82e8('0x2c')](_0x2400c5);};}exports[_0x82e8('0x2d')]=function(_0x1c2160,_0x4756ac){var _0x14450e={},_0x1e9eee={},_0x1c2173={'count':0x0,'rows':[]};var _0xf52391=_[_0x82e8('0x2e')](db[_0x82e8('0x2f')][_0x82e8('0x30')],function(_0x4902af){return{'name':_0x4902af[_0x82e8('0x31')],'type':_0x4902af[_0x82e8('0x32')][_0x82e8('0x33')]};});_0x1e9eee[_0x82e8('0x34')]=_[_0x82e8('0x2e')](_0xf52391,_0x82e8('0x2b'));_0x1e9eee[_0x82e8('0x35')]=_[_0x82e8('0x36')](_0x1c2160[_0x82e8('0x35')]);_0x1e9eee[_0x82e8('0x37')]=_[_0x82e8('0x38')](_0x1e9eee['model'],_0x1e9eee[_0x82e8('0x35')]);_0x14450e[_0x82e8('0x39')]=_[_0x82e8('0x38')](_0x1e9eee[_0x82e8('0x34')],qs[_0x82e8('0x3a')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x3a')]));_0x14450e[_0x82e8('0x39')]=_0x14450e['attributes'][_0x82e8('0x3b')]?_0x14450e['attributes']:_0x1e9eee[_0x82e8('0x34')];if(!_0x1c2160[_0x82e8('0x35')]['hasOwnProperty']('nolimit')){_0x14450e[_0x82e8('0x1e')]=qs['limit'](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x1e')]);_0x14450e[_0x82e8('0x1d')]=qs[_0x82e8('0x1d')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x1d')]);}_0x14450e[_0x82e8('0x3c')]=qs[_0x82e8('0x3d')](_0x1c2160[_0x82e8('0x35')][_0x82e8('0x3d')]);_0x14450e[_0x82e8('0x3e')]=qs[_0x82e8('0x37')](_['pick'](_0x1c2160[_0x82e8('0x35')],_0x1e9eee[_0x82e8('0x37')]),_0xf52391);if(_0x1c2160[_0x82e8('0x35')]['filter']){_0x14450e[_0x82e8('0x3e')]=_[_0x82e8('0x3f')](_0x14450e[_0x82e8('0x3e')],{'$or':_[_0x82e8('0x2e')](_0xf52391,function(_0x28e1b2){if(_0x28e1b2[_0x82e8('0x32')]!==_0x82e8('0x40')){var _0x1eceef={};_0x1eceef[_0x28e1b2[_0x82e8('0x2b')]]={'$like':'%'+_0x1c2160[_0x82e8('0x35')][_0x82e8('0x41')]+'%'};return _0x1eceef;}})});}_0x14450e=_['merge']({},_0x14450e,_0x1c2160[_0x82e8('0x42')]);var _0x3f379d={'where':_0x14450e[_0x82e8('0x3e')]};return db[_0x82e8('0x2f')][_0x82e8('0x20')](_0x3f379d)[_0x82e8('0x28')](function(_0x26c6ad){_0x1c2173[_0x82e8('0x20')]=_0x26c6ad;if(_0x1c2160[_0x82e8('0x35')][_0x82e8('0x43')]){_0x14450e[_0x82e8('0x44')]=[{'all':!![]}];}return db[_0x82e8('0x2f')][_0x82e8('0x45')](_0x14450e);})[_0x82e8('0x28')](function(_0x3878af){_0x1c2173['rows']=_0x3878af;return _0x1c2173;})[_0x82e8('0x28')](respondWithFilteredResult(_0x4756ac,_0x14450e))['catch'](handleError(_0x4756ac,null));};exports[_0x82e8('0x46')]=function(_0x2da19b,_0x8428e1){var _0xc996f7={'raw':!![],'where':{'id':_0x2da19b[_0x82e8('0x47')]['id']}},_0x3ff396={};_0x3ff396['model']=_[_0x82e8('0x36')](db['JscriptyAnswerReport'][_0x82e8('0x30')]);_0x3ff396[_0x82e8('0x35')]=_[_0x82e8('0x36')](_0x2da19b[_0x82e8('0x35')]);_0x3ff396[_0x82e8('0x37')]=_['intersection'](_0x3ff396['model'],_0x3ff396[_0x82e8('0x35')]);_0xc996f7['attributes']=_[_0x82e8('0x38')](_0x3ff396['model'],qs['fields'](_0x2da19b['query']['fields']));_0xc996f7[_0x82e8('0x39')]=_0xc996f7[_0x82e8('0x39')]['length']?_0xc996f7[_0x82e8('0x39')]:_0x3ff396[_0x82e8('0x34')];if(_0x2da19b['query'][_0x82e8('0x43')]){_0xc996f7['include']=[{'all':!![]}];}_0xc996f7=_[_0x82e8('0x3f')]({},_0xc996f7,_0x2da19b[_0x82e8('0x42')]);return db[_0x82e8('0x2f')][_0x82e8('0x48')](_0xc996f7)[_0x82e8('0x28')](handleEntityNotFound(_0x8428e1,null))[_0x82e8('0x28')](respondWithResult(_0x8428e1,null))['catch'](handleError(_0x8428e1,null));};exports[_0x82e8('0x49')]=function(_0x40fcae,_0x33c605){return db[_0x82e8('0x2f')]['create'](_0x40fcae[_0x82e8('0x4a')],{})['then'](respondWithResult(_0x33c605,0xc9))[_0x82e8('0x4b')](handleError(_0x33c605,null));};exports['update']=function(_0x25c206,_0xd3290c){if(_0x25c206[_0x82e8('0x4a')]['id']){delete _0x25c206['body']['id'];}return db[_0x82e8('0x2f')]['find']({'where':{'id':_0x25c206['params']['id']}})[_0x82e8('0x28')](handleEntityNotFound(_0xd3290c,null))[_0x82e8('0x28')](saveUpdates(_0x25c206[_0x82e8('0x4a')],null))['then'](respondWithResult(_0xd3290c,null))[_0x82e8('0x4b')](handleError(_0xd3290c,null));};exports['destroy']=function(_0x5735a2,_0x51710a){return db['JscriptyAnswerReport'][_0x82e8('0x48')]({'where':{'id':_0x5735a2[_0x82e8('0x47')]['id']}})[_0x82e8('0x28')](handleEntityNotFound(_0x51710a,null))[_0x82e8('0x28')](removeEntity(_0x51710a,null))['catch'](handleError(_0x51710a,null));};exports[_0x82e8('0x4c')]=function(_0x7b1c26,_0x17f348){return db[_0x82e8('0x2f')][_0x82e8('0x4c')]()[_0x82e8('0x28')](respondWithResult(_0x17f348,null))['catch'](handleError(_0x17f348,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 0594743..7b3ceae 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 _0xcc69=['rimraf','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','path'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xcc69,0x83));var _0x9cc6=function(_0x93b411,_0x4263ca){_0x93b411=_0x93b411-0x0;var _0x14ce11=_0xcc69[_0x93b411];return _0x14ce11;};'use strict';var _=require(_0x9cc6('0x0'));var util=require(_0x9cc6('0x1'));var logger=require('../../config/logger')(_0x9cc6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cc6('0x3'));var rimraf=require(_0x9cc6('0x4'));var config=require(_0x9cc6('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x9cc6('0x6')]=function(_0x5d6e1e,_0x36d404){return _0x5d6e1e['define'](_0x9cc6('0x7'),attributes,{'tableName':_0x9cc6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe08f=['api','request-promise','path','../../config/environment','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger'];(function(_0x41f02c,_0x16a69e){var _0x367e7f=function(_0x2ac4c1){while(--_0x2ac4c1){_0x41f02c['push'](_0x41f02c['shift']());}};_0x367e7f(++_0x16a69e);}(_0xe08f,0xb1));var _0xfe08=function(_0x2ed8a8,_0x54603e){_0x2ed8a8=_0x2ed8a8-0x0;var _0x469c2b=_0xe08f[_0x2ed8a8];return _0x469c2b;};'use strict';var _=require(_0xfe08('0x0'));var util=require(_0xfe08('0x1'));var logger=require(_0xfe08('0x2'))(_0xfe08('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe08('0x4'));var fs=require('fs');var path=require(_0xfe08('0x5'));var rimraf=require('rimraf');var config=require(_0xfe08('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xfe08('0x7')]=function(_0x278594,_0x47bfff){return _0x278594[_0xfe08('0x8')](_0xfe08('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 9a9fa6b..5fcfec6 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 _0xb482=['rpc','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x542a47,_0x2f1c92){var _0x3850fb=function(_0x301df4){while(--_0x301df4){_0x542a47['push'](_0x542a47['shift']());}};_0x3850fb(++_0x2f1c92);}(_0xb482,0x175));var _0x2b48=function(_0x13cf41,_0x406970){_0x13cf41=_0x13cf41-0x0;var _0x3f1b4e=_0xb482[_0x13cf41];return _0x3f1b4e;};'use strict';var _=require('lodash');var util=require(_0x2b48('0x0'));var moment=require(_0x2b48('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b48('0x2'));var fs=require('fs');var Redis=require(_0x2b48('0x3'));var db=require(_0x2b48('0x4'))['db'];var utils=require(_0x2b48('0x5'));var logger=require(_0x2b48('0x6'))(_0x2b48('0x7'));var config=require('../../config/environment');var jayson=require(_0x2b48('0x8'));var client=jayson['client'][_0x2b48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e8250,_0x284db1,_0x2c32d8){return new BPromise(function(_0xc8966c,_0x14909a){return client[_0x2b48('0xa')](_0x8e8250,_0x2c32d8)[_0x2b48('0xb')](function(_0x4948c4){logger[_0x2b48('0xc')](_0x2b48('0xd'),_0x284db1,'request\x20sent');logger[_0x2b48('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x284db1,'request\x20sent',JSON['stringify'](_0x4948c4));if(_0x4948c4[_0x2b48('0xf')]){if(_0x4948c4[_0x2b48('0xf')][_0x2b48('0x10')]===0x1f4){logger[_0x2b48('0xf')](_0x2b48('0xd'),_0x284db1,_0x4948c4[_0x2b48('0xf')]['message']);return _0x14909a(_0x4948c4[_0x2b48('0xf')][_0x2b48('0x11')]);}logger[_0x2b48('0xf')](_0x2b48('0xd'),_0x284db1,_0x4948c4['error'][_0x2b48('0x11')]);return _0xc8966c(_0x4948c4['error'][_0x2b48('0x11')]);}else{logger[_0x2b48('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x284db1,_0x2b48('0x12'));_0xc8966c(_0x4948c4[_0x2b48('0x13')]['message']);}})['catch'](function(_0x58aede){logger[_0x2b48('0xf')](_0x2b48('0xd'),_0x284db1,_0x58aede);_0x14909a(_0x58aede);});});} \ No newline at end of file +var _0x4551=['rpc','../../config/environment','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4551,0x15f));var _0x1455=function(_0x1f0533,_0x12f344){_0x1f0533=_0x1f0533-0x0;var _0x498dd3=_0x4551[_0x1f0533];return _0x498dd3;};'use strict';var _=require(_0x1455('0x0'));var util=require(_0x1455('0x1'));var moment=require(_0x1455('0x2'));var BPromise=require(_0x1455('0x3'));var rs=require(_0x1455('0x4'));var fs=require('fs');var Redis=require(_0x1455('0x5'));var db=require(_0x1455('0x6'))['db'];var utils=require(_0x1455('0x7'));var logger=require(_0x1455('0x8'))(_0x1455('0x9'));var config=require(_0x1455('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1455('0xb')][_0x1455('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ebec1,_0x464778,_0x196d6f){return new BPromise(function(_0x553bf5,_0x31fbc4){return client[_0x1455('0xd')](_0x4ebec1,_0x196d6f)[_0x1455('0xe')](function(_0x5bd636){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x464778,'request\x20sent');logger['debug'](_0x1455('0xf'),_0x464778,'request\x20sent',JSON[_0x1455('0x10')](_0x5bd636));if(_0x5bd636[_0x1455('0x11')]){if(_0x5bd636[_0x1455('0x11')][_0x1455('0x12')]===0x1f4){logger[_0x1455('0x11')](_0x1455('0x13'),_0x464778,_0x5bd636[_0x1455('0x11')][_0x1455('0x14')]);return _0x31fbc4(_0x5bd636['error'][_0x1455('0x14')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x464778,_0x5bd636[_0x1455('0x11')][_0x1455('0x14')]);return _0x553bf5(_0x5bd636[_0x1455('0x11')][_0x1455('0x14')]);}else{logger[_0x1455('0x15')](_0x1455('0x13'),_0x464778,'request\x20sent');_0x553bf5(_0x5bd636[_0x1455('0x16')][_0x1455('0x14')]);}})[_0x1455('0x17')](function(_0x40f56c){logger[_0x1455('0x11')](_0x1455('0x13'),_0x464778,_0x40f56c);_0x31fbc4(_0x40f56c);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9ec603e..1e134c1 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 _0xaa21=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x7f3667,_0x30c3f1){var _0x2c4c24=function(_0xf070f3){while(--_0xf070f3){_0x7f3667['push'](_0x7f3667['shift']());}};_0x2c4c24(++_0x30c3f1);}(_0xaa21,0x13e));var _0x1aa2=function(_0x200258,_0x5bdf12){_0x200258=_0x200258-0x0;var _0x1edc1d=_0xaa21[_0x200258];return _0x1edc1d;};'use strict';var multer=require(_0x1aa2('0x0'));var util=require(_0x1aa2('0x1'));var path=require(_0x1aa2('0x2'));var timeout=require(_0x1aa2('0x3'));var express=require(_0x1aa2('0x4'));var router=express['Router']();var fs_extra=require(_0x1aa2('0x5'));var auth=require(_0x1aa2('0x6'));var interaction=require(_0x1aa2('0x7'));var config=require(_0x1aa2('0x8'));var controller=require(_0x1aa2('0x9'));router[_0x1aa2('0xa')]('/',auth['isAuthenticated'](),controller[_0x1aa2('0xb')]);router[_0x1aa2('0xa')](_0x1aa2('0xc'),auth[_0x1aa2('0xd')](),controller[_0x1aa2('0xe')]);router[_0x1aa2('0xa')]('/:id/sessions',auth[_0x1aa2('0xd')](),controller[_0x1aa2('0xf')]);router['get'](_0x1aa2('0x10'),auth[_0x1aa2('0xd')](),controller[_0x1aa2('0x11')]);router[_0x1aa2('0xa')](_0x1aa2('0x12'),auth[_0x1aa2('0xd')](),timeout(_0x1aa2('0x13')),controller['getSummary']);router['post']('/',auth[_0x1aa2('0xd')](),controller['create']);router[_0x1aa2('0x14')](_0x1aa2('0x15'),auth[_0x1aa2('0xd')](),controller[_0x1aa2('0x16')]);router[_0x1aa2('0x17')](_0x1aa2('0xc'),auth['isAuthenticated'](),controller[_0x1aa2('0x18')]);router[_0x1aa2('0x19')](_0x1aa2('0xc'),auth[_0x1aa2('0xd')](),controller['destroy']);module[_0x1aa2('0x1a')]=router; \ No newline at end of file +var _0x6fed=['fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','create','/:id/clone','put','update','destroy','exports','multer','path','express','Router'];(function(_0x3e197f,_0x1c985f){var _0x21c35b=function(_0x1c1b0a){while(--_0x1c1b0a){_0x3e197f['push'](_0x3e197f['shift']());}};_0x21c35b(++_0x1c985f);}(_0x6fed,0xec));var _0xd6fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fed[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd6fe('0x0'));var util=require('util');var path=require(_0xd6fe('0x1'));var timeout=require('connect-timeout');var express=require(_0xd6fe('0x2'));var router=express[_0xd6fe('0x3')]();var fs_extra=require(_0xd6fe('0x4'));var auth=require(_0xd6fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd6fe('0x6'));var controller=require(_0xd6fe('0x7'));router[_0xd6fe('0x8')]('/',auth[_0xd6fe('0x9')](),controller['index']);router['get'](_0xd6fe('0xa'),auth['isAuthenticated'](),controller[_0xd6fe('0xb')]);router[_0xd6fe('0x8')](_0xd6fe('0xc'),auth[_0xd6fe('0x9')](),controller[_0xd6fe('0xd')]);router[_0xd6fe('0x8')](_0xd6fe('0xe'),auth[_0xd6fe('0x9')](),controller[_0xd6fe('0xf')]);router[_0xd6fe('0x8')](_0xd6fe('0x10'),auth[_0xd6fe('0x9')](),timeout('30s'),controller['getSummary']);router[_0xd6fe('0x11')]('/',auth['isAuthenticated'](),controller[_0xd6fe('0x12')]);router['post'](_0xd6fe('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0xd6fe('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd6fe('0x15')]);router['delete']('/:id',auth[_0xd6fe('0x9')](),controller[_0xd6fe('0x16')]);module[_0xd6fe('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a8751ea..385cdb8 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 _0xaa02=['lodash','util','exports','STRING','name','TEXT','long','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x31dad5,_0x4fab4d){var _0x35c684=function(_0x265448){while(--_0x265448){_0x31dad5['push'](_0x31dad5['shift']());}};_0x35c684(++_0x4fab4d);}(_0xaa02,0x7e));var _0x2aa0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaa02[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');var _=require(_0x2aa0('0x0'));var util=require(_0x2aa0('0x1'));module[_0x2aa0('0x2')]={'name':{'type':Sequelize[_0x2aa0('0x3')],'unique':_0x2aa0('0x4')},'description':{'type':Sequelize[_0x2aa0('0x3')]},'formData':{'type':Sequelize[_0x2aa0('0x5')](_0x2aa0('0x6')),'set':function(_0x5ea4e4){if(_['isObjectLike'](_0x5ea4e4)){this[_0x2aa0('0x7')](_0x2aa0('0x8'),JSON['stringify'](_0x5ea4e4));}else if(_[_0x2aa0('0x9')](_0x5ea4e4)){this[_0x2aa0('0x7')](_0x2aa0('0x8'),_0x5ea4e4);}else{this[_0x2aa0('0x7')](_0x2aa0('0x8'),util['format'](_0x2aa0('0xa'),this['getDataValue'](_0x2aa0('0x4'))||'',this[_0x2aa0('0xb')](_0x2aa0('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2aa0('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x797a=['getDataValue','BOOLEAN','lodash','util','STRING','name','TEXT','long','isObjectLike','formData','stringify','setDataValue','format'];(function(_0x579a44,_0x30af1c){var _0x27afea=function(_0x3745cd){while(--_0x3745cd){_0x579a44['push'](_0x579a44['shift']());}};_0x27afea(++_0x30af1c);}(_0x797a,0x84));var _0xa797=function(_0x429b58,_0x5d207c){_0x429b58=_0x429b58-0x0;var _0x232976=_0x797a[_0x429b58];return _0x232976;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa797('0x0'));var util=require(_0xa797('0x1'));module['exports']={'name':{'type':Sequelize[_0xa797('0x2')],'unique':_0xa797('0x3')},'description':{'type':Sequelize[_0xa797('0x2')]},'formData':{'type':Sequelize[_0xa797('0x4')](_0xa797('0x5')),'set':function(_0x1b1f5){if(_[_0xa797('0x6')](_0x1b1f5)){this['setDataValue'](_0xa797('0x7'),JSON[_0xa797('0x8')](_0x1b1f5));}else if(_['isString'](_0x1b1f5)){this[_0xa797('0x9')](_0xa797('0x7'),_0x1b1f5);}else{this[_0xa797('0x9')](_0xa797('0x7'),util[_0xa797('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xa797('0x3'))||'',this[_0xa797('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa797('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa797('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 14c1e96..c5b1d05 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 _0x6d77=['error','stack','name','send','JscriptyProject','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','include','findAll','rows','show','filters','includeAll','options','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','userProfileId','update','getSessions','findOne','JscriptySessionReport','hasOwnProperty','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','get','Projects','UserProfileResource','end'];(function(_0x58ab93,_0xdf0e53){var _0x8e8faa=function(_0x48381b){while(--_0x48381b){_0x58ab93['push'](_0x58ab93['shift']());}};_0x8e8faa(++_0xdf0e53);}(_0x6d77,0x13a));var _0x76d7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6d77[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x76d7('0x0'));var rimraf=require(_0x76d7('0x1'));var zipdir=require(_0x76d7('0x2'));var jsonpatch=require(_0x76d7('0x3'));var rp=require('request-promise');var moment=require(_0x76d7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76d7('0x5'));var util=require(_0x76d7('0x6'));var path=require(_0x76d7('0x7'));var sox=require(_0x76d7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76d7('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x76d7('0xa'));var deskjs=require(_0x76d7('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x76d7('0xc'));var Redis=require('ioredis');var authService=require(_0x76d7('0xd'));var qs=require(_0x76d7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76d7('0xf'));var logger=require(_0x76d7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x76d7('0x11'));var licenseUtil=require(_0x76d7('0x12'));var db=require(_0x76d7('0x13'))['db'];function respondWithStatusCode(_0xbb0b97,_0x1037d0){_0x1037d0=_0x1037d0||0xcc;return function(_0x393807){if(_0x393807){return _0xbb0b97[_0x76d7('0x14')](_0x1037d0);}return _0xbb0b97['status'](_0x1037d0)['end']();};}function respondWithResult(_0x242401,_0xc27df5){_0xc27df5=_0xc27df5||0xc8;return function(_0x27f33d){if(_0x27f33d){return _0x242401[_0x76d7('0x15')](_0xc27df5)[_0x76d7('0x16')](_0x27f33d);}};}function respondWithFilteredResult(_0x5c1aaa,_0x36a3ba){return function(_0x5876dd){if(_0x5876dd){var _0x1f6d75=typeof _0x36a3ba['offset']===_0x76d7('0x17')&&typeof _0x36a3ba['limit']===_0x76d7('0x17');var _0x54c965=_0x5876dd[_0x76d7('0x18')];var _0x2d7527=_0x1f6d75?0x0:_0x36a3ba['offset'];var _0x155322=_0x1f6d75?_0x5876dd[_0x76d7('0x18')]:_0x36a3ba[_0x76d7('0x19')]+_0x36a3ba[_0x76d7('0x1a')];var _0x5f586a;if(_0x155322>=_0x54c965){_0x155322=_0x54c965;_0x5f586a=0xc8;}else{_0x5f586a=0xce;}_0x5c1aaa[_0x76d7('0x15')](_0x5f586a);return _0x5c1aaa[_0x76d7('0x1b')]('Content-Range',_0x2d7527+'-'+_0x155322+'/'+_0x54c965)['json'](_0x5876dd);}return null;};}function patchUpdates(_0x54295d){return function(_0x22e2f0){try{jsonpatch[_0x76d7('0x1c')](_0x22e2f0,_0x54295d,!![]);}catch(_0x2a9b3c){return BPromise[_0x76d7('0x1d')](_0x2a9b3c);}return _0x22e2f0[_0x76d7('0x1e')]();};}function saveUpdates(_0x423161,_0x55c7a5){return function(_0x463300){if(_0x463300){return _0x463300['update'](_0x423161)[_0x76d7('0x1f')](function(_0x311e58){return _0x311e58;});}return null;};}function removeEntity(_0x5a97c3,_0x500521){return function(_0x27d6ff){if(_0x27d6ff){return _0x27d6ff[_0x76d7('0x20')]()[_0x76d7('0x1f')](function(){var _0x1371f7=_0x27d6ff[_0x76d7('0x21')]({'plain':!![]});var _0x2d5ecc=_0x76d7('0x22');return db[_0x76d7('0x23')][_0x76d7('0x20')]({'where':{'type':_0x2d5ecc,'resourceId':_0x1371f7['id']}})[_0x76d7('0x1f')](function(){return _0x27d6ff;});})[_0x76d7('0x1f')](function(){_0x5a97c3[_0x76d7('0x15')](0xcc)[_0x76d7('0x24')]();});}};}function handleEntityNotFound(_0x23604e,_0x10b0aa){return function(_0x2e22d5){if(!_0x2e22d5){_0x23604e['sendStatus'](0x194);}return _0x2e22d5;};}function handleError(_0x4c95ae,_0x4868c5){_0x4868c5=_0x4868c5||0x1f4;return function(_0x228a48){logger[_0x76d7('0x25')](_0x228a48[_0x76d7('0x26')]);if(_0x228a48[_0x76d7('0x27')]){delete _0x228a48['name'];}_0x4c95ae[_0x76d7('0x15')](_0x4868c5)[_0x76d7('0x28')](_0x228a48);};}exports['index']=function(_0x3660ea,_0x270f72){var _0x187360={},_0xea025d={},_0x32b002={'count':0x0,'rows':[]};var _0x2f6f73=_['map'](db[_0x76d7('0x29')][_0x76d7('0x2a')],function(_0x9757e8){return{'name':_0x9757e8[_0x76d7('0x2b')],'type':_0x9757e8['type'][_0x76d7('0x2c')]};});_0xea025d[_0x76d7('0x2d')]=_[_0x76d7('0x2e')](_0x2f6f73,_0x76d7('0x27'));_0xea025d[_0x76d7('0x2f')]=_[_0x76d7('0x30')](_0x3660ea['query']);_0xea025d['filters']=_['intersection'](_0xea025d[_0x76d7('0x2d')],_0xea025d[_0x76d7('0x2f')]);_0x187360[_0x76d7('0x31')]=_[_0x76d7('0x32')](_0xea025d['model'],qs['fields'](_0x3660ea[_0x76d7('0x2f')][_0x76d7('0x33')]));_0x187360[_0x76d7('0x31')]=_0x187360['attributes'][_0x76d7('0x34')]?_0x187360['attributes']:_0xea025d[_0x76d7('0x2d')];if(!_0x3660ea['query']['hasOwnProperty'](_0x76d7('0x35'))){_0x187360[_0x76d7('0x1a')]=qs[_0x76d7('0x1a')](_0x3660ea[_0x76d7('0x2f')][_0x76d7('0x1a')]);_0x187360[_0x76d7('0x19')]=qs[_0x76d7('0x19')](_0x3660ea[_0x76d7('0x2f')]['offset']);}_0x187360[_0x76d7('0x36')]=qs['sort'](_0x3660ea['query'][_0x76d7('0x37')]);_0x187360[_0x76d7('0x38')]=qs['filters'](_[_0x76d7('0x39')](_0x3660ea['query'],_0xea025d['filters']),_0x2f6f73);if(_0x3660ea['query']['filter']){_0x187360[_0x76d7('0x38')]=_['merge'](_0x187360[_0x76d7('0x38')],{'$or':_[_0x76d7('0x2e')](_0x2f6f73,function(_0x389466){if(_0x389466[_0x76d7('0x3a')]!==_0x76d7('0x3b')){var _0x2b8956={};_0x2b8956[_0x389466[_0x76d7('0x27')]]={'$like':'%'+_0x3660ea[_0x76d7('0x2f')][_0x76d7('0x3c')]+'%'};return _0x2b8956;}})});}_0x187360=_[_0x76d7('0x3d')]({},_0x187360,_0x3660ea['options']);var _0x5ae435={'where':_0x187360[_0x76d7('0x38')]};return db[_0x76d7('0x29')][_0x76d7('0x18')](_0x5ae435)[_0x76d7('0x1f')](function(_0x35cc85){_0x32b002[_0x76d7('0x18')]=_0x35cc85;if(_0x3660ea[_0x76d7('0x2f')]['includeAll']){_0x187360[_0x76d7('0x3e')]=[{'all':!![]}];}return db[_0x76d7('0x29')][_0x76d7('0x3f')](_0x187360);})[_0x76d7('0x1f')](function(_0x2f98c3){_0x32b002[_0x76d7('0x40')]=_0x2f98c3;return _0x32b002;})[_0x76d7('0x1f')](respondWithFilteredResult(_0x270f72,_0x187360))['catch'](handleError(_0x270f72,null));};exports[_0x76d7('0x41')]=function(_0xffe9e6,_0x176a30){var _0x2be5cf={'raw':![],'where':{'id':_0xffe9e6['params']['id']}},_0x11f988={};_0x11f988['model']=_[_0x76d7('0x30')](db['JscriptyProject'][_0x76d7('0x2a')]);_0x11f988['query']=_[_0x76d7('0x30')](_0xffe9e6['query']);_0x11f988[_0x76d7('0x42')]=_[_0x76d7('0x32')](_0x11f988['model'],_0x11f988['query']);_0x2be5cf[_0x76d7('0x31')]=_[_0x76d7('0x32')](_0x11f988['model'],qs[_0x76d7('0x33')](_0xffe9e6[_0x76d7('0x2f')]['fields']));_0x2be5cf['attributes']=_0x2be5cf[_0x76d7('0x31')][_0x76d7('0x34')]?_0x2be5cf[_0x76d7('0x31')]:_0x11f988['model'];if(_0xffe9e6[_0x76d7('0x2f')][_0x76d7('0x43')]){_0x2be5cf[_0x76d7('0x3e')]=[{'all':!![]}];}_0x2be5cf=_[_0x76d7('0x3d')]({},_0x2be5cf,_0xffe9e6[_0x76d7('0x44')]);return db['JscriptyProject'][_0x76d7('0x45')](_0x2be5cf)[_0x76d7('0x1f')](handleEntityNotFound(_0x176a30,null))[_0x76d7('0x1f')](respondWithResult(_0x176a30,null))['catch'](handleError(_0x176a30,null));};exports[_0x76d7('0x46')]=function(_0x485c8b,_0xf74298){return db['JscriptyProject'][_0x76d7('0x46')](_0x485c8b[_0x76d7('0x47')],{})['then'](function(_0x1b6fef){var _0x5874dc=_0x485c8b[_0x76d7('0x48')]['get']({'plain':!![]});if(!_0x5874dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5874dc[_0x76d7('0x49')]===_0x76d7('0x48')){var _0x3f8b5b=_0x1b6fef[_0x76d7('0x21')]({'plain':!![]});var _0x5e5300=_0x76d7('0x22');return db[_0x76d7('0x4a')]['find']({'where':{'name':_0x5e5300,'userProfileId':_0x5874dc['userProfileId']},'raw':!![]})[_0x76d7('0x1f')](function(_0x4dca94){if(_0x4dca94&&_0x4dca94[_0x76d7('0x4b')]===0x0){return db['UserProfileResource'][_0x76d7('0x46')]({'name':_0x3f8b5b[_0x76d7('0x27')],'resourceId':_0x3f8b5b['id'],'type':_0x4dca94[_0x76d7('0x27')],'sectionId':_0x4dca94['id']},{})[_0x76d7('0x1f')](function(){return _0x1b6fef;});}else{return _0x1b6fef;}})[_0x76d7('0x4c')](function(_0x28d7d9){logger[_0x76d7('0x25')](_0x76d7('0x4d'),_0x28d7d9);throw _0x28d7d9;});}return _0x1b6fef;})['then'](respondWithResult(_0xf74298,0xc9))[_0x76d7('0x4c')](handleError(_0xf74298,null));};exports[_0x76d7('0x4e')]=function(_0x13f9f6,_0x55edf){var _0x52fabb={'where':{'id':_0x13f9f6[_0x76d7('0x4f')]['id']}},_0x38f5de={};_0x38f5de[_0x76d7('0x2d')]=_[_0x76d7('0x30')](db[_0x76d7('0x29')][_0x76d7('0x2a')]);_0x52fabb[_0x76d7('0x31')]=_[_0x76d7('0x32')](_0x38f5de[_0x76d7('0x2d')],qs[_0x76d7('0x33')](_0x13f9f6[_0x76d7('0x2f')]['fields']));_0x52fabb['attributes']=_0x52fabb[_0x76d7('0x31')][_0x76d7('0x34')]?_0x52fabb['attributes']:_0x38f5de[_0x76d7('0x2d')];if(_0x13f9f6[_0x76d7('0x2f')][_0x76d7('0x43')]){_0x52fabb[_0x76d7('0x3e')]=[{'all':!![]}];}_0x52fabb=_[_0x76d7('0x3d')]({},_0x52fabb,_0x13f9f6[_0x76d7('0x44')]);return db[_0x76d7('0x29')][_0x76d7('0x45')](_0x52fabb)[_0x76d7('0x1f')](handleEntityNotFound(_0x55edf,null))[_0x76d7('0x1f')](function(_0x45920b){if(_0x45920b){var _0x4f65cf=_0x45920b[_0x76d7('0x21')]({'plain':!![]});_0x4f65cf=qs[_0x76d7('0x50')](_0x4f65cf,['id','createdAt','updatedAt']);_0x13f9f6[_0x76d7('0x47')]=_[_0x76d7('0x50')](_0x13f9f6['body'],['id','createdAt',_0x76d7('0x51')]);return db['JscriptyProject'][_0x76d7('0x46')](_[_0x76d7('0x3d')](_0x4f65cf,_0x13f9f6[_0x76d7('0x47')]),{'include':_0x13f9f6['query'][_0x76d7('0x43')]?[{'all':!![]}]:undefined})[_0x76d7('0x1f')](function(_0x117c1d){var _0x4a1e8c=_0x13f9f6[_0x76d7('0x48')][_0x76d7('0x21')]({'plain':!![]});if(!_0x4a1e8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a1e8c['role']===_0x76d7('0x48')){var _0x193e7c=_0x117c1d[_0x76d7('0x21')]({'plain':!![]});var _0x3cff2b=_0x76d7('0x22');return db[_0x76d7('0x4a')][_0x76d7('0x45')]({'where':{'name':_0x3cff2b,'userProfileId':_0x4a1e8c[_0x76d7('0x52')]},'raw':!![]})['then'](function(_0x4b3f7e){if(_0x4b3f7e&&_0x4b3f7e[_0x76d7('0x4b')]===0x0){return db[_0x76d7('0x23')][_0x76d7('0x46')]({'name':_0x193e7c['name'],'resourceId':_0x193e7c['id'],'type':_0x4b3f7e['name'],'sectionId':_0x4b3f7e['id']},{})[_0x76d7('0x1f')](function(){return _0x117c1d;});}else{return _0x117c1d;}})[_0x76d7('0x4c')](function(_0x1b8455){logger[_0x76d7('0x25')](_0x76d7('0x4d'),_0x1b8455);throw _0x1b8455;});}return _0x117c1d;});}})[_0x76d7('0x1f')](respondWithResult(_0x55edf,0xc9))[_0x76d7('0x4c')](handleError(_0x55edf,null));};exports[_0x76d7('0x53')]=function(_0x2304f3,_0x3acb42){if(_0x2304f3[_0x76d7('0x47')]['id']){delete _0x2304f3[_0x76d7('0x47')]['id'];}return db['JscriptyProject'][_0x76d7('0x45')]({'where':{'id':_0x2304f3[_0x76d7('0x4f')]['id']}})[_0x76d7('0x1f')](handleEntityNotFound(_0x3acb42,null))[_0x76d7('0x1f')](saveUpdates(_0x2304f3[_0x76d7('0x47')],null))['then'](respondWithResult(_0x3acb42,null))['catch'](handleError(_0x3acb42,null));};exports[_0x76d7('0x20')]=function(_0x28898a,_0x1b8637){return db[_0x76d7('0x29')][_0x76d7('0x45')]({'where':{'id':_0x28898a[_0x76d7('0x4f')]['id']}})[_0x76d7('0x1f')](handleEntityNotFound(_0x1b8637,null))[_0x76d7('0x1f')](removeEntity(_0x1b8637,null))[_0x76d7('0x4c')](handleError(_0x1b8637,null));};exports[_0x76d7('0x54')]=function(_0x3ee7eb,_0x4aab4a,_0x1310c9){var _0x517359={'raw':!![],'where':{}};var _0x10ec2d={};var _0x2bac30={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x76d7('0x55')]({'where':{'id':_0x3ee7eb[_0x76d7('0x4f')]['id']}})[_0x76d7('0x1f')](handleEntityNotFound(_0x4aab4a,null))['then'](function(_0x4f828c){if(_0x4f828c){_0x10ec2d[_0x76d7('0x2d')]=_[_0x76d7('0x30')](db[_0x76d7('0x56')][_0x76d7('0x2a')]);_0x10ec2d[_0x76d7('0x2f')]=_[_0x76d7('0x30')](_0x3ee7eb[_0x76d7('0x2f')]);_0x10ec2d[_0x76d7('0x42')]=_[_0x76d7('0x32')](_0x10ec2d[_0x76d7('0x2d')],_0x10ec2d[_0x76d7('0x2f')]);_0x517359[_0x76d7('0x31')]=_[_0x76d7('0x32')](_0x10ec2d[_0x76d7('0x2d')],qs[_0x76d7('0x33')](_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x33')]));_0x517359[_0x76d7('0x31')]=_0x517359['attributes'][_0x76d7('0x34')]?_0x517359[_0x76d7('0x31')]:_0x10ec2d[_0x76d7('0x2d')];if(!_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x57')](_0x76d7('0x35'))){_0x517359[_0x76d7('0x1a')]=qs['limit'](_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x1a')]);_0x517359[_0x76d7('0x19')]=qs[_0x76d7('0x19')](_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x19')]);}_0x517359['order']=qs['sort'](_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x37')]);_0x517359[_0x76d7('0x38')]=qs[_0x76d7('0x42')](_['pick'](_0x3ee7eb['query'],_0x10ec2d[_0x76d7('0x42')]));_0x517359[_0x76d7('0x38')]['ProjectId']=_0x4f828c['id'];if(_0x3ee7eb['query'][_0x76d7('0x3c')]){_0x517359[_0x76d7('0x38')]=_['merge'](_0x517359[_0x76d7('0x38')],{'$or':_['map'](_0x517359[_0x76d7('0x31')],function(_0x351b54){var _0xa1c2ba={};_0xa1c2ba[_0x351b54]={'$like':'%'+_0x3ee7eb['query'][_0x76d7('0x3c')]+'%'};return _0xa1c2ba;})});}_0x517359=_[_0x76d7('0x3d')]({},_0x517359,_0x3ee7eb[_0x76d7('0x44')]);return db[_0x76d7('0x56')]['count']({'where':_0x517359[_0x76d7('0x38')]})[_0x76d7('0x1f')](function(_0x537b4b){_0x2bac30[_0x76d7('0x18')]=_0x537b4b;if(_0x3ee7eb[_0x76d7('0x2f')][_0x76d7('0x43')]){_0x517359[_0x76d7('0x3e')]=[{'all':!![]}];}return db[_0x76d7('0x56')][_0x76d7('0x3f')](_0x517359);})[_0x76d7('0x1f')](function(_0x4142d2){_0x2bac30[_0x76d7('0x40')]=_0x4142d2;return _0x2bac30;});}})[_0x76d7('0x1f')](respondWithFilteredResult(_0x4aab4a,_0x517359))[_0x76d7('0x4c')](handleError(_0x4aab4a,null));};exports[_0x76d7('0x58')]=function(_0x3e5cdf,_0x59c569,_0xecb844){var _0x351ecb={'raw':!![],'where':{}};var _0x4a4891={};var _0x4744fa={'count':0x0,'rows':[]};return db[_0x76d7('0x29')][_0x76d7('0x55')]({'where':{'id':_0x3e5cdf[_0x76d7('0x4f')]['id']}})[_0x76d7('0x1f')](handleEntityNotFound(_0x59c569,null))[_0x76d7('0x1f')](function(_0x4bad57){if(_0x4bad57){_0x4a4891[_0x76d7('0x2d')]=_[_0x76d7('0x30')](db[_0x76d7('0x59')][_0x76d7('0x2a')]);_0x4a4891[_0x76d7('0x2f')]=_[_0x76d7('0x30')](_0x3e5cdf[_0x76d7('0x2f')]);_0x4a4891[_0x76d7('0x42')]=_[_0x76d7('0x32')](_0x4a4891[_0x76d7('0x2d')],_0x4a4891['query']);_0x351ecb[_0x76d7('0x31')]=_[_0x76d7('0x32')](_0x4a4891[_0x76d7('0x2d')],qs['fields'](_0x3e5cdf['query'][_0x76d7('0x33')]));_0x351ecb[_0x76d7('0x31')]=_0x351ecb[_0x76d7('0x31')][_0x76d7('0x34')]?_0x351ecb['attributes']:_0x4a4891['model'];if(!_0x3e5cdf[_0x76d7('0x2f')][_0x76d7('0x57')](_0x76d7('0x35'))){_0x351ecb[_0x76d7('0x1a')]=qs[_0x76d7('0x1a')](_0x3e5cdf[_0x76d7('0x2f')][_0x76d7('0x1a')]);_0x351ecb[_0x76d7('0x19')]=qs['offset'](_0x3e5cdf[_0x76d7('0x2f')][_0x76d7('0x19')]);}_0x351ecb[_0x76d7('0x36')]=qs[_0x76d7('0x37')](_0x3e5cdf[_0x76d7('0x2f')]['sort']);_0x351ecb['where']=qs[_0x76d7('0x42')](_[_0x76d7('0x39')](_0x3e5cdf[_0x76d7('0x2f')],_0x4a4891[_0x76d7('0x42')]));_0x351ecb[_0x76d7('0x38')]['ProjectId']=_0x4bad57['id'];if(_0x3e5cdf['query'][_0x76d7('0x3c')]){_0x351ecb[_0x76d7('0x38')]=_[_0x76d7('0x3d')](_0x351ecb[_0x76d7('0x38')],{'$or':_['map'](_0x351ecb['attributes'],function(_0x5f203e){var _0x17354d={};_0x17354d[_0x5f203e]={'$like':'%'+_0x3e5cdf[_0x76d7('0x2f')][_0x76d7('0x3c')]+'%'};return _0x17354d;})});}_0x351ecb=_[_0x76d7('0x3d')]({},_0x351ecb,_0x3e5cdf[_0x76d7('0x44')]);return db['JscriptyAnswerReport'][_0x76d7('0x18')]({'where':_0x351ecb[_0x76d7('0x38')]})['then'](function(_0x1efd86){_0x4744fa[_0x76d7('0x18')]=_0x1efd86;if(_0x3e5cdf[_0x76d7('0x2f')]['includeAll']){_0x351ecb[_0x76d7('0x3e')]=[{'all':!![]}];}return db[_0x76d7('0x59')][_0x76d7('0x3f')](_0x351ecb);})[_0x76d7('0x1f')](function(_0x5e8b50){_0x4744fa[_0x76d7('0x40')]=_0x5e8b50;return _0x4744fa;});}})[_0x76d7('0x1f')](respondWithFilteredResult(_0x59c569,_0x351ecb))[_0x76d7('0x4c')](handleError(_0x59c569,null));};function char(_0x18409e){return _0x76d7('0x5a')===typeof _0x18409e?String[_0x76d7('0x5b')]['apply'](null,arguments):_0x18409e;}function needsEncapsulation(_0x11ad40){return!!_0x11ad40&&(_0x11ad40[_0x76d7('0x5c')]()[_0x76d7('0x5d')](char(0xd))>=0x0||_0x11ad40[_0x76d7('0x5c')]()[_0x76d7('0x5d')](char(0xa))>=0x0||_0x11ad40[_0x76d7('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x11ad40['toString']()[_0x76d7('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x51da29){var _0x567e6d=char(0x22),_0x355d18='\x5c'+char(0x22),_0x1a6422=_0x51da29[_0x76d7('0x5c')]()[_0x76d7('0x5e')](new RegExp(_0x567e6d,'g'),_0x355d18);return _0x567e6d+_0x1a6422+_0x567e6d;}exports[_0x76d7('0x5f')]=function(_0x37e554,_0x31ab2c,_0x32be4e){var _0x393501,_0x19c47e;var _0x3d3b1={'where':{'ProjectId':_0x37e554['params']['id']}};if(_0x37e554[_0x76d7('0x2f')]['startTime']){_0x3d3b1[_0x76d7('0x38')][_0x76d7('0x60')]=JSON[_0x76d7('0x61')](_0x37e554['query'][_0x76d7('0x62')]);}return db[_0x76d7('0x56')][_0x76d7('0x3f')](_0x3d3b1)[_0x76d7('0x1f')](handleEntityNotFound(_0x31ab2c,null))[_0x76d7('0x1f')](function(_0x39ad43){if(_0x39ad43){_0x393501=_0x39ad43;return db[_0x76d7('0x63')][_0x76d7('0x3f')]({'where':{'SessionId':{'$in':_[_0x76d7('0x2e')](_0x393501,'id')},'ProjectId':_0x37e554[_0x76d7('0x4f')]['id']},'order':_0x76d7('0x64')});}})[_0x76d7('0x1f')](handleEntityNotFound(_0x31ab2c,null))['then'](function(_0x423f7c){if(_0x423f7c){_0x19c47e=_0x423f7c;var _0x2e7d85={};for(var _0x101145=0x0,_0x23d9f5=_0x19c47e['length'];_0x101145<_0x23d9f5;_0x101145++){if(!_0x2e7d85[_0x76d7('0x57')](_0x19c47e[_0x101145][_0x76d7('0x65')])){_0x2e7d85[_0x19c47e[_0x101145]['questionId']]=needsEncapsulation(_0x19c47e[_0x101145][_0x76d7('0x66')])?encapsulate(_0x19c47e[_0x101145][_0x76d7('0x66')]):_0x19c47e[_0x101145]['question'];}}var _0x5193ce=[],_0x3ab7d9={};for(var _0x294fb1=0x0,_0x44b3cc=_0x393501[_0x76d7('0x34')];_0x294fb1<_0x44b3cc;_0x294fb1++){_0x3ab7d9={'ProjectId':_0x37e554['params']['id'],'SessionId':_0x393501[_0x294fb1]['id'],'StartTime':moment(_0x393501[_0x294fb1][_0x76d7('0x60')])[_0x76d7('0x67')](_0x76d7('0x68'))};for(var _0x187cba=0x0,_0x33869d=_0x19c47e['length'];_0x187cba<_0x33869d;_0x187cba++){if(_0x19c47e[_0x187cba][_0x76d7('0x69')]==_0x393501[_0x294fb1]['id']&&_0x2e7d85[_0x76d7('0x57')](_0x19c47e[_0x187cba][_0x76d7('0x65')])){_0x3ab7d9[_0x2e7d85[_0x19c47e[_0x187cba][_0x76d7('0x65')]]]=_0x19c47e[_0x187cba][_0x76d7('0x6a')];}}for(var _0x5232b6 in _0x2e7d85){if(!_0x3ab7d9['hasOwnProperty'](_0x2e7d85[_0x5232b6])){_0x3ab7d9[_0x2e7d85[_0x5232b6]]=null;}}_0x5193ce[_0x76d7('0x6b')](_0x3ab7d9);}return _0x5193ce;}})[_0x76d7('0x1f')](function(_0x1ba0fb){if(!_['isEmpty'](_0x1ba0fb)){var _0x2cb8e9=toCsv(_0x1ba0fb);var _0x136e28=Date[_0x76d7('0x6c')]();fs[_0x76d7('0x6d')](util[_0x76d7('0x67')](_0x76d7('0x6e'),_0x37e554['params']['id'],_0x136e28),_0x2cb8e9);_0x31ab2c[_0x76d7('0x6f')](_0x76d7('0x70'),_0x76d7('0x71')+util[_0x76d7('0x67')](_0x76d7('0x72'),_0x37e554['params']['id'],_0x136e28));_0x31ab2c[_0x76d7('0x6f')](_0x76d7('0x73'),'text/csv');return _0x31ab2c[_0x76d7('0x74')](util[_0x76d7('0x67')](_0x76d7('0x6e'),_0x37e554[_0x76d7('0x4f')]['id'],_0x136e28));}else{return _0x31ab2c[_0x76d7('0x14')](0xcc);}})[_0x76d7('0x4c')](handleError(_0x31ab2c,null));}; \ No newline at end of file +var _0x66d4=['omit','createdAt','updatedAt','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyProject','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone'];(function(_0x1deb77,_0x258c15){var _0x194f0a=function(_0x240017){while(--_0x240017){_0x1deb77['push'](_0x1deb77['shift']());}};_0x194f0a(++_0x258c15);}(_0x66d4,0x10b));var _0x466d=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x66d4[_0x95411e];return _0x2c8718;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x466d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x466d('0x1'));var rp=require(_0x466d('0x2'));var moment=require(_0x466d('0x3'));var BPromise=require(_0x466d('0x4'));var Mustache=require(_0x466d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x466d('0x6'));var csv=require('to-csv');var ejs=require(_0x466d('0x7'));var fs=require('fs');var fs_extra=require(_0x466d('0x8'));var _=require(_0x466d('0x9'));var squel=require(_0x466d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x466d('0xb'));var toCsv=require(_0x466d('0xc'));var querystring=require(_0x466d('0xd'));var Papa=require(_0x466d('0xe'));var Redis=require('ioredis');var authService=require(_0x466d('0xf'));var qs=require(_0x466d('0x10'));var as=require(_0x466d('0x11'));var hardwareService=require(_0x466d('0x12'));var logger=require(_0x466d('0x13'))(_0x466d('0x14'));var utils=require(_0x466d('0x15'));var config=require(_0x466d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f2f45,_0x261f91){_0x261f91=_0x261f91||0xcc;return function(_0x12e1ea){if(_0x12e1ea){return _0x3f2f45[_0x466d('0x17')](_0x261f91);}return _0x3f2f45[_0x466d('0x18')](_0x261f91)[_0x466d('0x19')]();};}function respondWithResult(_0x3bf1d9,_0x55c500){_0x55c500=_0x55c500||0xc8;return function(_0x3f7aee){if(_0x3f7aee){return _0x3bf1d9[_0x466d('0x18')](_0x55c500)['json'](_0x3f7aee);}};}function respondWithFilteredResult(_0x590ce7,_0x471d4e){return function(_0x1efa66){if(_0x1efa66){var _0x6e9fe2=typeof _0x471d4e[_0x466d('0x1a')]===_0x466d('0x1b')&&typeof _0x471d4e[_0x466d('0x1c')]==='undefined';var _0x111a47=_0x1efa66[_0x466d('0x1d')];var _0x54f580=_0x6e9fe2?0x0:_0x471d4e[_0x466d('0x1a')];var _0x5912fe=_0x6e9fe2?_0x1efa66['count']:_0x471d4e[_0x466d('0x1a')]+_0x471d4e[_0x466d('0x1c')];var _0x1e9bff;if(_0x5912fe>=_0x111a47){_0x5912fe=_0x111a47;_0x1e9bff=0xc8;}else{_0x1e9bff=0xce;}_0x590ce7[_0x466d('0x18')](_0x1e9bff);return _0x590ce7[_0x466d('0x1e')]('Content-Range',_0x54f580+'-'+_0x5912fe+'/'+_0x111a47)[_0x466d('0x1f')](_0x1efa66);}return null;};}function patchUpdates(_0x15f13d){return function(_0x3bb097){try{jsonpatch[_0x466d('0x20')](_0x3bb097,_0x15f13d,!![]);}catch(_0x517269){return BPromise['reject'](_0x517269);}return _0x3bb097[_0x466d('0x21')]();};}function saveUpdates(_0x3c09f4,_0x672e2){return function(_0xd1395c){if(_0xd1395c){return _0xd1395c[_0x466d('0x22')](_0x3c09f4)[_0x466d('0x23')](function(_0x5f056f){return _0x5f056f;});}return null;};}function removeEntity(_0x647db3,_0x112e09){return function(_0x4fb2f1){if(_0x4fb2f1){return _0x4fb2f1[_0x466d('0x24')]()[_0x466d('0x23')](function(){var _0x353394=_0x4fb2f1['get']({'plain':!![]});var _0x35a947='Projects';return db[_0x466d('0x25')][_0x466d('0x24')]({'where':{'type':_0x35a947,'resourceId':_0x353394['id']}})[_0x466d('0x23')](function(){return _0x4fb2f1;});})['then'](function(){_0x647db3[_0x466d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f346,_0x51b08b){return function(_0x267314){if(!_0x267314){_0x51f346[_0x466d('0x17')](0x194);}return _0x267314;};}function handleError(_0x483522,_0x345fff){_0x345fff=_0x345fff||0x1f4;return function(_0x139899){logger[_0x466d('0x26')](_0x139899[_0x466d('0x27')]);if(_0x139899[_0x466d('0x28')]){delete _0x139899[_0x466d('0x28')];}_0x483522[_0x466d('0x18')](_0x345fff)[_0x466d('0x29')](_0x139899);};}exports[_0x466d('0x2a')]=function(_0x2feefd,_0x462d86){var _0x376a55={},_0x18a7bc={},_0x1c9858={'count':0x0,'rows':[]};var _0x3ebc70=_[_0x466d('0x2b')](db['JscriptyProject'][_0x466d('0x2c')],function(_0x15769b){return{'name':_0x15769b[_0x466d('0x2d')],'type':_0x15769b[_0x466d('0x2e')][_0x466d('0x2f')]};});_0x18a7bc[_0x466d('0x30')]=_[_0x466d('0x2b')](_0x3ebc70,_0x466d('0x28'));_0x18a7bc[_0x466d('0x31')]=_[_0x466d('0x32')](_0x2feefd[_0x466d('0x31')]);_0x18a7bc[_0x466d('0x33')]=_[_0x466d('0x34')](_0x18a7bc[_0x466d('0x30')],_0x18a7bc['query']);_0x376a55['attributes']=_[_0x466d('0x34')](_0x18a7bc[_0x466d('0x30')],qs[_0x466d('0x35')](_0x2feefd[_0x466d('0x31')][_0x466d('0x35')]));_0x376a55['attributes']=_0x376a55[_0x466d('0x36')][_0x466d('0x37')]?_0x376a55[_0x466d('0x36')]:_0x18a7bc[_0x466d('0x30')];if(!_0x2feefd['query'][_0x466d('0x38')](_0x466d('0x39'))){_0x376a55[_0x466d('0x1c')]=qs[_0x466d('0x1c')](_0x2feefd[_0x466d('0x31')][_0x466d('0x1c')]);_0x376a55[_0x466d('0x1a')]=qs[_0x466d('0x1a')](_0x2feefd[_0x466d('0x31')][_0x466d('0x1a')]);}_0x376a55[_0x466d('0x3a')]=qs[_0x466d('0x3b')](_0x2feefd[_0x466d('0x31')][_0x466d('0x3b')]);_0x376a55[_0x466d('0x3c')]=qs[_0x466d('0x33')](_[_0x466d('0x3d')](_0x2feefd[_0x466d('0x31')],_0x18a7bc[_0x466d('0x33')]),_0x3ebc70);if(_0x2feefd['query'][_0x466d('0x3e')]){_0x376a55[_0x466d('0x3c')]=_[_0x466d('0x3f')](_0x376a55['where'],{'$or':_[_0x466d('0x2b')](_0x3ebc70,function(_0x11c8b8){if(_0x11c8b8[_0x466d('0x2e')]!==_0x466d('0x40')){var _0x2c30c0={};_0x2c30c0[_0x11c8b8[_0x466d('0x28')]]={'$like':'%'+_0x2feefd['query'][_0x466d('0x3e')]+'%'};return _0x2c30c0;}})});}_0x376a55=_[_0x466d('0x3f')]({},_0x376a55,_0x2feefd['options']);var _0x44692f={'where':_0x376a55[_0x466d('0x3c')]};return db[_0x466d('0x41')]['count'](_0x44692f)[_0x466d('0x23')](function(_0x17ad2f){_0x1c9858[_0x466d('0x1d')]=_0x17ad2f;if(_0x2feefd[_0x466d('0x31')]['includeAll']){_0x376a55[_0x466d('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0x466d('0x43')](_0x376a55);})[_0x466d('0x23')](function(_0x3c68bb){_0x1c9858[_0x466d('0x44')]=_0x3c68bb;return _0x1c9858;})[_0x466d('0x23')](respondWithFilteredResult(_0x462d86,_0x376a55))['catch'](handleError(_0x462d86,null));};exports[_0x466d('0x45')]=function(_0x76bc3f,_0x2c1d62){var _0x4ea9da={'raw':![],'where':{'id':_0x76bc3f[_0x466d('0x46')]['id']}},_0x5be696={};_0x5be696[_0x466d('0x30')]=_[_0x466d('0x32')](db[_0x466d('0x41')][_0x466d('0x2c')]);_0x5be696[_0x466d('0x31')]=_[_0x466d('0x32')](_0x76bc3f['query']);_0x5be696[_0x466d('0x33')]=_['intersection'](_0x5be696[_0x466d('0x30')],_0x5be696[_0x466d('0x31')]);_0x4ea9da['attributes']=_[_0x466d('0x34')](_0x5be696[_0x466d('0x30')],qs[_0x466d('0x35')](_0x76bc3f[_0x466d('0x31')][_0x466d('0x35')]));_0x4ea9da[_0x466d('0x36')]=_0x4ea9da[_0x466d('0x36')][_0x466d('0x37')]?_0x4ea9da['attributes']:_0x5be696[_0x466d('0x30')];if(_0x76bc3f[_0x466d('0x31')][_0x466d('0x47')]){_0x4ea9da['include']=[{'all':!![]}];}_0x4ea9da=_[_0x466d('0x3f')]({},_0x4ea9da,_0x76bc3f[_0x466d('0x48')]);return db[_0x466d('0x41')][_0x466d('0x49')](_0x4ea9da)['then'](handleEntityNotFound(_0x2c1d62,null))['then'](respondWithResult(_0x2c1d62,null))[_0x466d('0x4a')](handleError(_0x2c1d62,null));};exports[_0x466d('0x4b')]=function(_0xed3724,_0x1ff58e){return db['JscriptyProject'][_0x466d('0x4b')](_0xed3724[_0x466d('0x4c')],{})[_0x466d('0x23')](function(_0x5ea992){var _0xb4d9a4=_0xed3724['user']['get']({'plain':!![]});if(!_0xb4d9a4)throw new Error(_0x466d('0x4d'));if(_0xb4d9a4[_0x466d('0x4e')]===_0x466d('0x4f')){var _0x3e517f=_0x5ea992[_0x466d('0x50')]({'plain':!![]});var _0x203d13=_0x466d('0x51');return db[_0x466d('0x52')][_0x466d('0x49')]({'where':{'name':_0x203d13,'userProfileId':_0xb4d9a4[_0x466d('0x53')]},'raw':!![]})['then'](function(_0x4d8e48){if(_0x4d8e48&&_0x4d8e48[_0x466d('0x54')]===0x0){return db[_0x466d('0x25')]['create']({'name':_0x3e517f[_0x466d('0x28')],'resourceId':_0x3e517f['id'],'type':_0x4d8e48[_0x466d('0x28')],'sectionId':_0x4d8e48['id']},{})[_0x466d('0x23')](function(){return _0x5ea992;});}else{return _0x5ea992;}})['catch'](function(_0x4b075f){logger[_0x466d('0x26')](_0x466d('0x55'),_0x4b075f);throw _0x4b075f;});}return _0x5ea992;})[_0x466d('0x23')](respondWithResult(_0x1ff58e,0xc9))[_0x466d('0x4a')](handleError(_0x1ff58e,null));};exports[_0x466d('0x56')]=function(_0x328282,_0x4858a5){var _0x227130={'where':{'id':_0x328282['params']['id']}},_0x4a7b2b={};_0x4a7b2b[_0x466d('0x30')]=_[_0x466d('0x32')](db[_0x466d('0x41')][_0x466d('0x2c')]);_0x227130[_0x466d('0x36')]=_['intersection'](_0x4a7b2b[_0x466d('0x30')],qs[_0x466d('0x35')](_0x328282[_0x466d('0x31')][_0x466d('0x35')]));_0x227130[_0x466d('0x36')]=_0x227130[_0x466d('0x36')][_0x466d('0x37')]?_0x227130['attributes']:_0x4a7b2b[_0x466d('0x30')];if(_0x328282[_0x466d('0x31')][_0x466d('0x47')]){_0x227130['include']=[{'all':!![]}];}_0x227130=_[_0x466d('0x3f')]({},_0x227130,_0x328282[_0x466d('0x48')]);return db[_0x466d('0x41')][_0x466d('0x49')](_0x227130)[_0x466d('0x23')](handleEntityNotFound(_0x4858a5,null))[_0x466d('0x23')](function(_0x45d14d){if(_0x45d14d){var _0x2daf7f=_0x45d14d[_0x466d('0x50')]({'plain':!![]});_0x2daf7f=qs[_0x466d('0x57')](_0x2daf7f,['id',_0x466d('0x58'),_0x466d('0x59')]);_0x328282[_0x466d('0x4c')]=_['omit'](_0x328282[_0x466d('0x4c')],['id',_0x466d('0x58'),_0x466d('0x59')]);return db[_0x466d('0x41')][_0x466d('0x4b')](_[_0x466d('0x3f')](_0x2daf7f,_0x328282['body']),{'include':_0x328282[_0x466d('0x31')][_0x466d('0x47')]?[{'all':!![]}]:undefined})[_0x466d('0x23')](function(_0x56a0e0){var _0x19e78e=_0x328282[_0x466d('0x4f')][_0x466d('0x50')]({'plain':!![]});if(!_0x19e78e)throw new Error(_0x466d('0x4d'));if(_0x19e78e[_0x466d('0x4e')]===_0x466d('0x4f')){var _0x106314=_0x56a0e0[_0x466d('0x50')]({'plain':!![]});var _0x3c071c=_0x466d('0x51');return db['UserProfileSection'][_0x466d('0x49')]({'where':{'name':_0x3c071c,'userProfileId':_0x19e78e[_0x466d('0x53')]},'raw':!![]})[_0x466d('0x23')](function(_0x475f89){if(_0x475f89&&_0x475f89[_0x466d('0x54')]===0x0){return db['UserProfileResource'][_0x466d('0x4b')]({'name':_0x106314['name'],'resourceId':_0x106314['id'],'type':_0x475f89['name'],'sectionId':_0x475f89['id']},{})['then'](function(){return _0x56a0e0;});}else{return _0x56a0e0;}})[_0x466d('0x4a')](function(_0x23d7c4){logger[_0x466d('0x26')](_0x466d('0x55'),_0x23d7c4);throw _0x23d7c4;});}return _0x56a0e0;});}})[_0x466d('0x23')](respondWithResult(_0x4858a5,0xc9))[_0x466d('0x4a')](handleError(_0x4858a5,null));};exports[_0x466d('0x22')]=function(_0x1254c3,_0x1730f8){if(_0x1254c3['body']['id']){delete _0x1254c3[_0x466d('0x4c')]['id'];}return db[_0x466d('0x41')][_0x466d('0x49')]({'where':{'id':_0x1254c3[_0x466d('0x46')]['id']}})[_0x466d('0x23')](handleEntityNotFound(_0x1730f8,null))[_0x466d('0x23')](saveUpdates(_0x1254c3[_0x466d('0x4c')],null))[_0x466d('0x23')](respondWithResult(_0x1730f8,null))[_0x466d('0x4a')](handleError(_0x1730f8,null));};exports[_0x466d('0x24')]=function(_0x3211d8,_0x109a17){return db['JscriptyProject'][_0x466d('0x49')]({'where':{'id':_0x3211d8['params']['id']}})[_0x466d('0x23')](handleEntityNotFound(_0x109a17,null))[_0x466d('0x23')](removeEntity(_0x109a17,null))[_0x466d('0x4a')](handleError(_0x109a17,null));};exports['getSessions']=function(_0x2070bd,_0x5193b4,_0x397bf7){var _0x1b7d9c={'raw':!![],'where':{}};var _0x16a621={};var _0x23ddf={'count':0x0,'rows':[]};return db[_0x466d('0x41')][_0x466d('0x5a')]({'where':{'id':_0x2070bd[_0x466d('0x46')]['id']}})[_0x466d('0x23')](handleEntityNotFound(_0x5193b4,null))[_0x466d('0x23')](function(_0xd65e17){if(_0xd65e17){_0x16a621[_0x466d('0x30')]=_[_0x466d('0x32')](db['JscriptySessionReport'][_0x466d('0x2c')]);_0x16a621['query']=_[_0x466d('0x32')](_0x2070bd[_0x466d('0x31')]);_0x16a621[_0x466d('0x33')]=_[_0x466d('0x34')](_0x16a621[_0x466d('0x30')],_0x16a621[_0x466d('0x31')]);_0x1b7d9c['attributes']=_[_0x466d('0x34')](_0x16a621['model'],qs[_0x466d('0x35')](_0x2070bd[_0x466d('0x31')]['fields']));_0x1b7d9c['attributes']=_0x1b7d9c[_0x466d('0x36')]['length']?_0x1b7d9c[_0x466d('0x36')]:_0x16a621[_0x466d('0x30')];if(!_0x2070bd[_0x466d('0x31')][_0x466d('0x38')](_0x466d('0x39'))){_0x1b7d9c[_0x466d('0x1c')]=qs[_0x466d('0x1c')](_0x2070bd['query'][_0x466d('0x1c')]);_0x1b7d9c['offset']=qs['offset'](_0x2070bd['query'][_0x466d('0x1a')]);}_0x1b7d9c[_0x466d('0x3a')]=qs[_0x466d('0x3b')](_0x2070bd[_0x466d('0x31')][_0x466d('0x3b')]);_0x1b7d9c[_0x466d('0x3c')]=qs[_0x466d('0x33')](_[_0x466d('0x3d')](_0x2070bd[_0x466d('0x31')],_0x16a621[_0x466d('0x33')]));_0x1b7d9c[_0x466d('0x3c')][_0x466d('0x5b')]=_0xd65e17['id'];if(_0x2070bd[_0x466d('0x31')]['filter']){_0x1b7d9c[_0x466d('0x3c')]=_[_0x466d('0x3f')](_0x1b7d9c[_0x466d('0x3c')],{'$or':_[_0x466d('0x2b')](_0x1b7d9c[_0x466d('0x36')],function(_0x14357b){var _0x4e66cc={};_0x4e66cc[_0x14357b]={'$like':'%'+_0x2070bd[_0x466d('0x31')]['filter']+'%'};return _0x4e66cc;})});}_0x1b7d9c=_[_0x466d('0x3f')]({},_0x1b7d9c,_0x2070bd[_0x466d('0x48')]);return db[_0x466d('0x5c')][_0x466d('0x1d')]({'where':_0x1b7d9c[_0x466d('0x3c')]})[_0x466d('0x23')](function(_0xc69d3){_0x23ddf['count']=_0xc69d3;if(_0x2070bd[_0x466d('0x31')][_0x466d('0x47')]){_0x1b7d9c['include']=[{'all':!![]}];}return db[_0x466d('0x5c')]['findAll'](_0x1b7d9c);})[_0x466d('0x23')](function(_0x50c7ff){_0x23ddf[_0x466d('0x44')]=_0x50c7ff;return _0x23ddf;});}})[_0x466d('0x23')](respondWithFilteredResult(_0x5193b4,_0x1b7d9c))[_0x466d('0x4a')](handleError(_0x5193b4,null));};exports[_0x466d('0x5d')]=function(_0xf4f53e,_0x3b476b,_0x12e703){var _0x336a29={'raw':!![],'where':{}};var _0x22e94f={};var _0x4796b6={'count':0x0,'rows':[]};return db[_0x466d('0x41')]['findOne']({'where':{'id':_0xf4f53e[_0x466d('0x46')]['id']}})[_0x466d('0x23')](handleEntityNotFound(_0x3b476b,null))['then'](function(_0x469d49){if(_0x469d49){_0x22e94f[_0x466d('0x30')]=_[_0x466d('0x32')](db[_0x466d('0x5e')]['rawAttributes']);_0x22e94f[_0x466d('0x31')]=_['keys'](_0xf4f53e['query']);_0x22e94f[_0x466d('0x33')]=_[_0x466d('0x34')](_0x22e94f[_0x466d('0x30')],_0x22e94f['query']);_0x336a29[_0x466d('0x36')]=_[_0x466d('0x34')](_0x22e94f[_0x466d('0x30')],qs[_0x466d('0x35')](_0xf4f53e['query']['fields']));_0x336a29['attributes']=_0x336a29['attributes'][_0x466d('0x37')]?_0x336a29[_0x466d('0x36')]:_0x22e94f['model'];if(!_0xf4f53e[_0x466d('0x31')][_0x466d('0x38')](_0x466d('0x39'))){_0x336a29['limit']=qs['limit'](_0xf4f53e['query'][_0x466d('0x1c')]);_0x336a29[_0x466d('0x1a')]=qs['offset'](_0xf4f53e[_0x466d('0x31')][_0x466d('0x1a')]);}_0x336a29[_0x466d('0x3a')]=qs[_0x466d('0x3b')](_0xf4f53e['query'][_0x466d('0x3b')]);_0x336a29[_0x466d('0x3c')]=qs['filters'](_['pick'](_0xf4f53e[_0x466d('0x31')],_0x22e94f['filters']));_0x336a29[_0x466d('0x3c')][_0x466d('0x5b')]=_0x469d49['id'];if(_0xf4f53e['query'][_0x466d('0x3e')]){_0x336a29[_0x466d('0x3c')]=_[_0x466d('0x3f')](_0x336a29[_0x466d('0x3c')],{'$or':_[_0x466d('0x2b')](_0x336a29['attributes'],function(_0x5e3ad4){var _0x186045={};_0x186045[_0x5e3ad4]={'$like':'%'+_0xf4f53e[_0x466d('0x31')][_0x466d('0x3e')]+'%'};return _0x186045;})});}_0x336a29=_['merge']({},_0x336a29,_0xf4f53e['options']);return db[_0x466d('0x5e')][_0x466d('0x1d')]({'where':_0x336a29[_0x466d('0x3c')]})['then'](function(_0x2d2f4a){_0x4796b6[_0x466d('0x1d')]=_0x2d2f4a;if(_0xf4f53e[_0x466d('0x31')][_0x466d('0x47')]){_0x336a29[_0x466d('0x42')]=[{'all':!![]}];}return db[_0x466d('0x5e')][_0x466d('0x43')](_0x336a29);})[_0x466d('0x23')](function(_0x12cc9e){_0x4796b6[_0x466d('0x44')]=_0x12cc9e;return _0x4796b6;});}})[_0x466d('0x23')](respondWithFilteredResult(_0x3b476b,_0x336a29))[_0x466d('0x4a')](handleError(_0x3b476b,null));};function char(_0x2cb24b){return _0x466d('0x5f')===typeof _0x2cb24b?String[_0x466d('0x60')][_0x466d('0x20')](null,arguments):_0x2cb24b;}function needsEncapsulation(_0x1c6b4f){return!!_0x1c6b4f&&(_0x1c6b4f[_0x466d('0x61')]()['indexOf'](char(0xd))>=0x0||_0x1c6b4f['toString']()[_0x466d('0x62')](char(0xa))>=0x0||_0x1c6b4f[_0x466d('0x61')]()[_0x466d('0x62')](char(0x2c))>=0x0||_0x1c6b4f['toString']()[_0x466d('0x62')](char(0x22))>=0x0);}function encapsulate(_0x260cee){var _0x3969=char(0x22),_0x5921d0='\x5c'+char(0x22),_0x305035=_0x260cee[_0x466d('0x61')]()['replace'](new RegExp(_0x3969,'g'),_0x5921d0);return _0x3969+_0x305035+_0x3969;}exports[_0x466d('0x63')]=function(_0x5f014a,_0x51da79,_0x2d7b8b){var _0x22636d,_0x4e8dc9;var _0x557fbe={'where':{'ProjectId':_0x5f014a['params']['id']}};if(_0x5f014a['query']['startTime']){_0x557fbe[_0x466d('0x3c')][_0x466d('0x64')]=JSON[_0x466d('0x65')](_0x5f014a[_0x466d('0x31')][_0x466d('0x66')]);}return db[_0x466d('0x5c')][_0x466d('0x43')](_0x557fbe)[_0x466d('0x23')](handleEntityNotFound(_0x51da79,null))[_0x466d('0x23')](function(_0x1e712e){if(_0x1e712e){_0x22636d=_0x1e712e;return db[_0x466d('0x67')][_0x466d('0x43')]({'where':{'SessionId':{'$in':_[_0x466d('0x2b')](_0x22636d,'id')},'ProjectId':_0x5f014a['params']['id']},'order':'-createdAt'});}})[_0x466d('0x23')](handleEntityNotFound(_0x51da79,null))[_0x466d('0x23')](function(_0x594fc5){if(_0x594fc5){_0x4e8dc9=_0x594fc5;var _0x4d7ab7={};for(var _0x6962ad=0x0,_0x56011f=_0x4e8dc9[_0x466d('0x37')];_0x6962ad<_0x56011f;_0x6962ad++){if(!_0x4d7ab7[_0x466d('0x38')](_0x4e8dc9[_0x6962ad]['questionId'])){_0x4d7ab7[_0x4e8dc9[_0x6962ad][_0x466d('0x68')]]=needsEncapsulation(_0x4e8dc9[_0x6962ad][_0x466d('0x69')])?encapsulate(_0x4e8dc9[_0x6962ad]['question']):_0x4e8dc9[_0x6962ad][_0x466d('0x69')];}}var _0x54b325=[],_0x6f4967={};for(var _0x321241=0x0,_0x8e4d93=_0x22636d[_0x466d('0x37')];_0x321241<_0x8e4d93;_0x321241++){_0x6f4967={'ProjectId':_0x5f014a[_0x466d('0x46')]['id'],'SessionId':_0x22636d[_0x321241]['id'],'StartTime':moment(_0x22636d[_0x321241]['starttime'])['format'](_0x466d('0x6a'))};for(var _0x183ab5=0x0,_0x48ffc0=_0x4e8dc9[_0x466d('0x37')];_0x183ab5<_0x48ffc0;_0x183ab5++){if(_0x4e8dc9[_0x183ab5][_0x466d('0x6b')]==_0x22636d[_0x321241]['id']&&_0x4d7ab7[_0x466d('0x38')](_0x4e8dc9[_0x183ab5][_0x466d('0x68')])){_0x6f4967[_0x4d7ab7[_0x4e8dc9[_0x183ab5][_0x466d('0x68')]]]=_0x4e8dc9[_0x183ab5][_0x466d('0x6c')];}}for(var _0x8a4e95 in _0x4d7ab7){if(!_0x6f4967[_0x466d('0x38')](_0x4d7ab7[_0x8a4e95])){_0x6f4967[_0x4d7ab7[_0x8a4e95]]=null;}}_0x54b325[_0x466d('0x6d')](_0x6f4967);}return _0x54b325;}})[_0x466d('0x23')](function(_0x4cf4d9){if(!_['isEmpty'](_0x4cf4d9)){var _0x2f562f=toCsv(_0x4cf4d9);var _0x1c10db=Date[_0x466d('0x6e')]();fs[_0x466d('0x6f')](util[_0x466d('0x70')](_0x466d('0x71'),_0x5f014a[_0x466d('0x46')]['id'],_0x1c10db),_0x2f562f);_0x51da79[_0x466d('0x72')]('Content-disposition','attachment;\x20filename='+util[_0x466d('0x70')]('Jscripty_Project_%d_Summary_%s.csv',_0x5f014a[_0x466d('0x46')]['id'],_0x1c10db));_0x51da79[_0x466d('0x72')](_0x466d('0x73'),_0x466d('0x74'));return _0x51da79[_0x466d('0x75')](util['format'](_0x466d('0x71'),_0x5f014a[_0x466d('0x46')]['id'],_0x1c10db));}else{return _0x51da79[_0x466d('0x17')](0xcc);}})[_0x466d('0x4a')](handleError(_0x51da79,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e01b233..69e3ae5 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 _0xc770=['path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','moment','bluebird','request-promise'];(function(_0x5e60a2,_0xe85ba3){var _0xb47bd=function(_0x19e91f){while(--_0x19e91f){_0x5e60a2['push'](_0x5e60a2['shift']());}};_0xb47bd(++_0xe85ba3);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('JscriptyProject',attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67a2=['define','jscripty_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2018b9,_0x325ec5){var _0x4073c2=function(_0x20f268){while(--_0x20f268){_0x2018b9['push'](_0x2018b9['shift']());}};_0x4073c2(++_0x325ec5);}(_0x67a2,0xd3));var _0x267a=function(_0x7c50d1,_0xef867f){_0x7c50d1=_0x7c50d1-0x0;var _0x1389a1=_0x67a2[_0x7c50d1];return _0x1389a1;};'use strict';var _=require(_0x267a('0x0'));var util=require(_0x267a('0x1'));var logger=require('../../config/logger')(_0x267a('0x2'));var moment=require(_0x267a('0x3'));var BPromise=require(_0x267a('0x4'));var rp=require(_0x267a('0x5'));var fs=require('fs');var path=require(_0x267a('0x6'));var rimraf=require(_0x267a('0x7'));var config=require(_0x267a('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x17090d,_0x3539d5){return _0x17090d[_0x267a('0x9')]('JscriptyProject',attributes,{'tableName':_0x267a('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 f34af09..7a861f2 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x33cff6,_0x24664e){var _0x5f3171=function(_0x557624){while(--_0x557624){_0x33cff6['push'](_0x33cff6['shift']());}};_0x5f3171(++_0x24664e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x116bad,_0x42d6d2){_0x116bad=_0x116bad-0x0;var _0x53fdef=_0xb43b[_0x116bad];return _0x53fdef;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x47f2c5,_0x40c84b){var _0x38b405=function(_0x22c2aa){while(--_0x22c2aa){_0x47f2c5['push'](_0x47f2c5['shift']());}};_0x38b405(++_0x40c84b);}(_0xf4eb,0xec));var _0xbf4e=function(_0x18e8c7,_0x5d852c){_0x18e8c7=_0x18e8c7-0x0;var _0x2a458c=_0xf4eb[_0x18e8c7];return _0x2a458c;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index e3e25bc..7746cec 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 _0xc0ff=['/describe','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index'];(function(_0x5c763f,_0xd5b7c9){var _0x1a6b7f=function(_0x1c3db4){while(--_0x1c3db4){_0x5c763f['push'](_0x5c763f['shift']());}};_0x1a6b7f(++_0xd5b7c9);}(_0xc0ff,0x134));var _0xfc0f=function(_0x571339,_0x5bcafb){_0x571339=_0x571339-0x0;var _0x5af8a6=_0xc0ff[_0x571339];return _0x5af8a6;};'use strict';var multer=require(_0xfc0f('0x0'));var util=require(_0xfc0f('0x1'));var path=require(_0xfc0f('0x2'));var timeout=require(_0xfc0f('0x3'));var express=require(_0xfc0f('0x4'));var router=express[_0xfc0f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfc0f('0x6'));var interaction=require(_0xfc0f('0x7'));var config=require('../../config/environment');var controller=require(_0xfc0f('0x8'));router[_0xfc0f('0x9')]('/',auth[_0xfc0f('0xa')](),controller[_0xfc0f('0xb')]);router[_0xfc0f('0x9')](_0xfc0f('0xc'),auth[_0xfc0f('0xa')](),controller[_0xfc0f('0xd')]);router['get'](_0xfc0f('0xe'),auth[_0xfc0f('0xa')](),controller[_0xfc0f('0xf')]);router[_0xfc0f('0x10')]('/',auth['isAuthenticated'](),controller[_0xfc0f('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfc0f('0x12')](_0xfc0f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xfc0f('0x13')]=router; \ No newline at end of file +var _0xd5ca=['delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x3365ce,_0x531219){var _0x5b60b8=function(_0x2d197b){while(--_0x2d197b){_0x3365ce['push'](_0x3365ce['shift']());}};_0x5b60b8(++_0x531219);}(_0xd5ca,0x169));var _0xad5c=function(_0x5e13cc,_0xa904b){_0x5e13cc=_0x5e13cc-0x0;var _0x3410db=_0xd5ca[_0x5e13cc];return _0x3410db;};'use strict';var multer=require(_0xad5c('0x0'));var util=require(_0xad5c('0x1'));var path=require(_0xad5c('0x2'));var timeout=require(_0xad5c('0x3'));var express=require(_0xad5c('0x4'));var router=express[_0xad5c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad5c('0x6'));var config=require(_0xad5c('0x7'));var controller=require(_0xad5c('0x8'));router['get']('/',auth[_0xad5c('0x9')](),controller[_0xad5c('0xa')]);router[_0xad5c('0xb')](_0xad5c('0xc'),auth[_0xad5c('0x9')](),controller[_0xad5c('0xd')]);router['get'](_0xad5c('0xe'),auth[_0xad5c('0x9')](),controller[_0xad5c('0xf')]);router[_0xad5c('0x10')]('/',auth[_0xad5c('0x9')](),controller[_0xad5c('0x11')]);router[_0xad5c('0x12')](_0xad5c('0xe'),auth[_0xad5c('0x9')](),controller['update']);router[_0xad5c('0x13')](_0xad5c('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 999f435..cc09630 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(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x3d11c4,_0x3982a4){_0x3d11c4=_0x3d11c4-0x0;var _0x9c3996=_0x7a54[_0x3d11c4];return _0x9c3996;};'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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x581e77,_0x4a5bf9){_0x581e77=_0x581e77-0x0;var _0x638fa5=_0x7a54[_0x581e77];return _0x638fa5;};'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 caf7486..33c553f 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 _0x4d44=['Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','JscriptyQuestionReport','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','request-promise','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/environment','../../config/license/util','../../mysqldb','status','json','limit','count','offset','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d44,0x135));var _0x44d4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4d44[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x44d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44d4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x44d4('0x3'));var csv=require(_0x44d4('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44d4('0x5'));var _=require(_0x44d4('0x6'));var squel=require(_0x44d4('0x7'));var crypto=require(_0x44d4('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x44d4('0x9'));var toCsv=require(_0x44d4('0x4'));var querystring=require('querystring');var Papa=require(_0x44d4('0xa'));var Redis=require(_0x44d4('0xb'));var authService=require(_0x44d4('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x44d4('0xd'));var hardwareService=require(_0x44d4('0xe'));var logger=require(_0x44d4('0xf'))(_0x44d4('0x10'));var utils=require('../../config/utils');var config=require(_0x44d4('0x11'));var licenseUtil=require(_0x44d4('0x12'));var db=require(_0x44d4('0x13'))['db'];function respondWithStatusCode(_0x4d112e,_0x656e1b){_0x656e1b=_0x656e1b||0xcc;return function(_0x18f087){if(_0x18f087){return _0x4d112e['sendStatus'](_0x656e1b);}return _0x4d112e[_0x44d4('0x14')](_0x656e1b)['end']();};}function respondWithResult(_0x52f7e9,_0x1656e){_0x1656e=_0x1656e||0xc8;return function(_0x3094eb){if(_0x3094eb){return _0x52f7e9[_0x44d4('0x14')](_0x1656e)[_0x44d4('0x15')](_0x3094eb);}};}function respondWithFilteredResult(_0x56a402,_0x5862ad){return function(_0x27ec7e){if(_0x27ec7e){var _0x3ae081=typeof _0x5862ad['offset']==='undefined'&&typeof _0x5862ad[_0x44d4('0x16')]==='undefined';var _0x27fbd0=_0x27ec7e[_0x44d4('0x17')];var _0x4aeda8=_0x3ae081?0x0:_0x5862ad['offset'];var _0x23c9a1=_0x3ae081?_0x27ec7e[_0x44d4('0x17')]:_0x5862ad[_0x44d4('0x18')]+_0x5862ad[_0x44d4('0x16')];var _0x51bc27;if(_0x23c9a1>=_0x27fbd0){_0x23c9a1=_0x27fbd0;_0x51bc27=0xc8;}else{_0x51bc27=0xce;}_0x56a402[_0x44d4('0x14')](_0x51bc27);return _0x56a402[_0x44d4('0x19')](_0x44d4('0x1a'),_0x4aeda8+'-'+_0x23c9a1+'/'+_0x27fbd0)[_0x44d4('0x15')](_0x27ec7e);}return null;};}function patchUpdates(_0x7a3ec2){return function(_0x3c5ece){try{jsonpatch[_0x44d4('0x1b')](_0x3c5ece,_0x7a3ec2,!![]);}catch(_0x49b5ec){return BPromise[_0x44d4('0x1c')](_0x49b5ec);}return _0x3c5ece[_0x44d4('0x1d')]();};}function saveUpdates(_0x4cc6af,_0x548917){return function(_0x2f253f){if(_0x2f253f){return _0x2f253f[_0x44d4('0x1e')](_0x4cc6af)[_0x44d4('0x1f')](function(_0x4df76e){return _0x4df76e;});}return null;};}function removeEntity(_0x17a966,_0x1f9d5d){return function(_0x2d3e08){if(_0x2d3e08){return _0x2d3e08[_0x44d4('0x20')]()[_0x44d4('0x1f')](function(){_0x17a966['status'](0xcc)[_0x44d4('0x21')]();});}};}function handleEntityNotFound(_0x45d32e,_0x3e54b3){return function(_0x3ecec2){if(!_0x3ecec2){_0x45d32e[_0x44d4('0x22')](0x194);}return _0x3ecec2;};}function handleError(_0x210198,_0x4e2142){_0x4e2142=_0x4e2142||0x1f4;return function(_0xdcddbe){logger[_0x44d4('0x23')](_0xdcddbe[_0x44d4('0x24')]);if(_0xdcddbe['name']){delete _0xdcddbe[_0x44d4('0x25')];}_0x210198[_0x44d4('0x14')](_0x4e2142)['send'](_0xdcddbe);};}exports[_0x44d4('0x26')]=function(_0xb00821,_0x3dcf24){var _0x2eb840={},_0x437d5a={},_0x366ad4={'count':0x0,'rows':[]};var _0xfbaf67=_['map'](db[_0x44d4('0x27')][_0x44d4('0x28')],function(_0x736c0b){return{'name':_0x736c0b['fieldName'],'type':_0x736c0b[_0x44d4('0x29')][_0x44d4('0x2a')]};});_0x437d5a[_0x44d4('0x2b')]=_[_0x44d4('0x2c')](_0xfbaf67,_0x44d4('0x25'));_0x437d5a[_0x44d4('0x2d')]=_['keys'](_0xb00821[_0x44d4('0x2d')]);_0x437d5a[_0x44d4('0x2e')]=_[_0x44d4('0x2f')](_0x437d5a['model'],_0x437d5a['query']);_0x2eb840['attributes']=_[_0x44d4('0x2f')](_0x437d5a[_0x44d4('0x2b')],qs['fields'](_0xb00821[_0x44d4('0x2d')][_0x44d4('0x30')]));_0x2eb840[_0x44d4('0x31')]=_0x2eb840[_0x44d4('0x31')][_0x44d4('0x32')]?_0x2eb840['attributes']:_0x437d5a[_0x44d4('0x2b')];if(!_0xb00821[_0x44d4('0x2d')]['hasOwnProperty']('nolimit')){_0x2eb840['limit']=qs['limit'](_0xb00821[_0x44d4('0x2d')][_0x44d4('0x16')]);_0x2eb840[_0x44d4('0x18')]=qs[_0x44d4('0x18')](_0xb00821[_0x44d4('0x2d')][_0x44d4('0x18')]);}_0x2eb840['order']=qs[_0x44d4('0x33')](_0xb00821[_0x44d4('0x2d')]['sort']);_0x2eb840[_0x44d4('0x34')]=qs[_0x44d4('0x2e')](_[_0x44d4('0x35')](_0xb00821['query'],_0x437d5a[_0x44d4('0x2e')]),_0xfbaf67);if(_0xb00821[_0x44d4('0x2d')][_0x44d4('0x36')]){_0x2eb840[_0x44d4('0x34')]=_[_0x44d4('0x37')](_0x2eb840[_0x44d4('0x34')],{'$or':_[_0x44d4('0x2c')](_0xfbaf67,function(_0x460921){if(_0x460921['type']!=='VIRTUAL'){var _0x9f1ea8={};_0x9f1ea8[_0x460921[_0x44d4('0x25')]]={'$like':'%'+_0xb00821['query'][_0x44d4('0x36')]+'%'};return _0x9f1ea8;}})});}_0x2eb840=_[_0x44d4('0x37')]({},_0x2eb840,_0xb00821[_0x44d4('0x38')]);var _0x17a6dd={'where':_0x2eb840[_0x44d4('0x34')]};return db[_0x44d4('0x27')][_0x44d4('0x17')](_0x17a6dd)['then'](function(_0x260c46){_0x366ad4[_0x44d4('0x17')]=_0x260c46;if(_0xb00821[_0x44d4('0x2d')][_0x44d4('0x39')]){_0x2eb840['include']=[{'all':!![]}];}return db[_0x44d4('0x27')][_0x44d4('0x3a')](_0x2eb840);})[_0x44d4('0x1f')](function(_0x43012e){_0x366ad4['rows']=_0x43012e;return _0x366ad4;})['then'](respondWithFilteredResult(_0x3dcf24,_0x2eb840))[_0x44d4('0x3b')](handleError(_0x3dcf24,null));};exports[_0x44d4('0x3c')]=function(_0x1b3045,_0x1d28b2){var _0x167a41={'raw':!![],'where':{'id':_0x1b3045[_0x44d4('0x3d')]['id']}},_0x53dcf8={};_0x53dcf8[_0x44d4('0x2b')]=_['keys'](db['JscriptyQuestionReport'][_0x44d4('0x28')]);_0x53dcf8['query']=_['keys'](_0x1b3045[_0x44d4('0x2d')]);_0x53dcf8['filters']=_[_0x44d4('0x2f')](_0x53dcf8[_0x44d4('0x2b')],_0x53dcf8[_0x44d4('0x2d')]);_0x167a41[_0x44d4('0x31')]=_[_0x44d4('0x2f')](_0x53dcf8[_0x44d4('0x2b')],qs[_0x44d4('0x30')](_0x1b3045[_0x44d4('0x2d')][_0x44d4('0x30')]));_0x167a41['attributes']=_0x167a41[_0x44d4('0x31')][_0x44d4('0x32')]?_0x167a41[_0x44d4('0x31')]:_0x53dcf8[_0x44d4('0x2b')];if(_0x1b3045[_0x44d4('0x2d')]['includeAll']){_0x167a41[_0x44d4('0x3e')]=[{'all':!![]}];}_0x167a41=_[_0x44d4('0x37')]({},_0x167a41,_0x1b3045['options']);return db[_0x44d4('0x27')][_0x44d4('0x3f')](_0x167a41)[_0x44d4('0x1f')](handleEntityNotFound(_0x1d28b2,null))[_0x44d4('0x1f')](respondWithResult(_0x1d28b2,null))[_0x44d4('0x3b')](handleError(_0x1d28b2,null));};exports[_0x44d4('0x40')]=function(_0x20b354,_0x5588d2){return db[_0x44d4('0x27')][_0x44d4('0x40')](_0x20b354[_0x44d4('0x41')],{})[_0x44d4('0x1f')](respondWithResult(_0x5588d2,0xc9))[_0x44d4('0x3b')](handleError(_0x5588d2,null));};exports['update']=function(_0x44c7ac,_0x2a5919){if(_0x44c7ac[_0x44d4('0x41')]['id']){delete _0x44c7ac['body']['id'];}return db[_0x44d4('0x27')][_0x44d4('0x3f')]({'where':{'id':_0x44c7ac['params']['id']}})[_0x44d4('0x1f')](handleEntityNotFound(_0x2a5919,null))[_0x44d4('0x1f')](saveUpdates(_0x44c7ac[_0x44d4('0x41')],null))[_0x44d4('0x1f')](respondWithResult(_0x2a5919,null))[_0x44d4('0x3b')](handleError(_0x2a5919,null));};exports[_0x44d4('0x20')]=function(_0x42e584,_0x28729f){return db[_0x44d4('0x27')][_0x44d4('0x3f')]({'where':{'id':_0x42e584['params']['id']}})['then'](handleEntityNotFound(_0x28729f,null))['then'](removeEntity(_0x28729f,null))[_0x44d4('0x3b')](handleError(_0x28729f,null));};exports[_0x44d4('0x42')]=function(_0x2fca43,_0x3adc5a){return db[_0x44d4('0x27')][_0x44d4('0x42')]()[_0x44d4('0x1f')](respondWithResult(_0x3adc5a,null))[_0x44d4('0x3b')](handleError(_0x3adc5a,null));}; \ No newline at end of file +var _0xa17f=['name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','apply','update','destroy','then','error','stack'];(function(_0x4d8764,_0xd13d7b){var _0x4e0b49=function(_0x56126a){while(--_0x56126a){_0x4d8764['push'](_0x4d8764['shift']());}};_0x4e0b49(++_0xd13d7b);}(_0xa17f,0xfc));var _0xfa17=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xa17f[_0x2d91c6];return _0x3a8d19;};'use strict';var emlformat=require(_0xfa17('0x0'));var rimraf=require(_0xfa17('0x1'));var zipdir=require(_0xfa17('0x2'));var jsonpatch=require(_0xfa17('0x3'));var rp=require('request-promise');var moment=require(_0xfa17('0x4'));var BPromise=require(_0xfa17('0x5'));var Mustache=require(_0xfa17('0x6'));var util=require(_0xfa17('0x7'));var path=require(_0xfa17('0x8'));var sox=require('sox');var csv=require(_0xfa17('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa17('0xa'));var _=require(_0xfa17('0xb'));var squel=require(_0xfa17('0xc'));var crypto=require(_0xfa17('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfa17('0x9'));var querystring=require(_0xfa17('0xe'));var Papa=require(_0xfa17('0xf'));var Redis=require(_0xfa17('0x10'));var authService=require(_0xfa17('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa17('0x12'));var utils=require(_0xfa17('0x13'));var config=require(_0xfa17('0x14'));var licenseUtil=require(_0xfa17('0x15'));var db=require(_0xfa17('0x16'))['db'];function respondWithStatusCode(_0x1a9650,_0x5107ca){_0x5107ca=_0x5107ca||0xcc;return function(_0x4f7db5){if(_0x4f7db5){return _0x1a9650[_0xfa17('0x17')](_0x5107ca);}return _0x1a9650['status'](_0x5107ca)['end']();};}function respondWithResult(_0x1a76e2,_0x54ee7f){_0x54ee7f=_0x54ee7f||0xc8;return function(_0x5ca5b9){if(_0x5ca5b9){return _0x1a76e2[_0xfa17('0x18')](_0x54ee7f)[_0xfa17('0x19')](_0x5ca5b9);}};}function respondWithFilteredResult(_0x5acd8f,_0xd63e8a){return function(_0x80a136){if(_0x80a136){var _0x3a1de2=typeof _0xd63e8a['offset']==='undefined'&&typeof _0xd63e8a[_0xfa17('0x1a')]===_0xfa17('0x1b');var _0x568c2a=_0x80a136[_0xfa17('0x1c')];var _0x1615f1=_0x3a1de2?0x0:_0xd63e8a[_0xfa17('0x1d')];var _0x1432a9=_0x3a1de2?_0x80a136['count']:_0xd63e8a[_0xfa17('0x1d')]+_0xd63e8a[_0xfa17('0x1a')];var _0x3cfab0;if(_0x1432a9>=_0x568c2a){_0x1432a9=_0x568c2a;_0x3cfab0=0xc8;}else{_0x3cfab0=0xce;}_0x5acd8f[_0xfa17('0x18')](_0x3cfab0);return _0x5acd8f['set']('Content-Range',_0x1615f1+'-'+_0x1432a9+'/'+_0x568c2a)[_0xfa17('0x19')](_0x80a136);}return null;};}function patchUpdates(_0x7dabd7){return function(_0x58c11f){try{jsonpatch[_0xfa17('0x1e')](_0x58c11f,_0x7dabd7,!![]);}catch(_0x4e5bff){return BPromise['reject'](_0x4e5bff);}return _0x58c11f['save']();};}function saveUpdates(_0x82dd10,_0x3f07ea){return function(_0x51157d){if(_0x51157d){return _0x51157d[_0xfa17('0x1f')](_0x82dd10)['then'](function(_0x3cf24c){return _0x3cf24c;});}return null;};}function removeEntity(_0x46f453,_0x2ba461){return function(_0x52e4a5){if(_0x52e4a5){return _0x52e4a5[_0xfa17('0x20')]()[_0xfa17('0x21')](function(){_0x46f453[_0xfa17('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7139aa,_0x1ef0ac){return function(_0x529afa){if(!_0x529afa){_0x7139aa[_0xfa17('0x17')](0x194);}return _0x529afa;};}function handleError(_0x23aaab,_0x5d1bf6){_0x5d1bf6=_0x5d1bf6||0x1f4;return function(_0x2508b5){logger[_0xfa17('0x22')](_0x2508b5[_0xfa17('0x23')]);if(_0x2508b5['name']){delete _0x2508b5[_0xfa17('0x24')];}_0x23aaab[_0xfa17('0x18')](_0x5d1bf6)[_0xfa17('0x25')](_0x2508b5);};}exports[_0xfa17('0x26')]=function(_0x2a0bb4,_0x117b62){var _0x44d956={},_0x59b4ab={},_0x462dc4={'count':0x0,'rows':[]};var _0x3449d6=_[_0xfa17('0x27')](db[_0xfa17('0x28')][_0xfa17('0x29')],function(_0xfe8f14){return{'name':_0xfe8f14[_0xfa17('0x2a')],'type':_0xfe8f14['type'][_0xfa17('0x2b')]};});_0x59b4ab[_0xfa17('0x2c')]=_[_0xfa17('0x27')](_0x3449d6,_0xfa17('0x24'));_0x59b4ab['query']=_[_0xfa17('0x2d')](_0x2a0bb4['query']);_0x59b4ab[_0xfa17('0x2e')]=_['intersection'](_0x59b4ab[_0xfa17('0x2c')],_0x59b4ab['query']);_0x44d956[_0xfa17('0x2f')]=_[_0xfa17('0x30')](_0x59b4ab[_0xfa17('0x2c')],qs[_0xfa17('0x31')](_0x2a0bb4[_0xfa17('0x32')][_0xfa17('0x31')]));_0x44d956[_0xfa17('0x2f')]=_0x44d956[_0xfa17('0x2f')][_0xfa17('0x33')]?_0x44d956[_0xfa17('0x2f')]:_0x59b4ab[_0xfa17('0x2c')];if(!_0x2a0bb4['query'][_0xfa17('0x34')]('nolimit')){_0x44d956[_0xfa17('0x1a')]=qs[_0xfa17('0x1a')](_0x2a0bb4[_0xfa17('0x32')]['limit']);_0x44d956[_0xfa17('0x1d')]=qs[_0xfa17('0x1d')](_0x2a0bb4[_0xfa17('0x32')]['offset']);}_0x44d956[_0xfa17('0x35')]=qs[_0xfa17('0x36')](_0x2a0bb4['query']['sort']);_0x44d956[_0xfa17('0x37')]=qs[_0xfa17('0x2e')](_[_0xfa17('0x38')](_0x2a0bb4[_0xfa17('0x32')],_0x59b4ab['filters']),_0x3449d6);if(_0x2a0bb4['query'][_0xfa17('0x39')]){_0x44d956[_0xfa17('0x37')]=_[_0xfa17('0x3a')](_0x44d956['where'],{'$or':_[_0xfa17('0x27')](_0x3449d6,function(_0x5c60b9){if(_0x5c60b9[_0xfa17('0x3b')]!=='VIRTUAL'){var _0x95e2fe={};_0x95e2fe[_0x5c60b9['name']]={'$like':'%'+_0x2a0bb4['query'][_0xfa17('0x39')]+'%'};return _0x95e2fe;}})});}_0x44d956=_[_0xfa17('0x3a')]({},_0x44d956,_0x2a0bb4[_0xfa17('0x3c')]);var _0x5c3457={'where':_0x44d956[_0xfa17('0x37')]};return db[_0xfa17('0x28')]['count'](_0x5c3457)[_0xfa17('0x21')](function(_0x2bb531){_0x462dc4[_0xfa17('0x1c')]=_0x2bb531;if(_0x2a0bb4[_0xfa17('0x32')][_0xfa17('0x3d')]){_0x44d956[_0xfa17('0x3e')]=[{'all':!![]}];}return db[_0xfa17('0x28')][_0xfa17('0x3f')](_0x44d956);})[_0xfa17('0x21')](function(_0x5ad85e){_0x462dc4[_0xfa17('0x40')]=_0x5ad85e;return _0x462dc4;})[_0xfa17('0x21')](respondWithFilteredResult(_0x117b62,_0x44d956))[_0xfa17('0x41')](handleError(_0x117b62,null));};exports[_0xfa17('0x42')]=function(_0xa6515c,_0x5b55a1){var _0x165ec9={'raw':!![],'where':{'id':_0xa6515c[_0xfa17('0x43')]['id']}},_0x40413f={};_0x40413f['model']=_[_0xfa17('0x2d')](db[_0xfa17('0x28')]['rawAttributes']);_0x40413f[_0xfa17('0x32')]=_[_0xfa17('0x2d')](_0xa6515c[_0xfa17('0x32')]);_0x40413f[_0xfa17('0x2e')]=_[_0xfa17('0x30')](_0x40413f[_0xfa17('0x2c')],_0x40413f[_0xfa17('0x32')]);_0x165ec9[_0xfa17('0x2f')]=_[_0xfa17('0x30')](_0x40413f[_0xfa17('0x2c')],qs['fields'](_0xa6515c[_0xfa17('0x32')][_0xfa17('0x31')]));_0x165ec9[_0xfa17('0x2f')]=_0x165ec9['attributes'][_0xfa17('0x33')]?_0x165ec9[_0xfa17('0x2f')]:_0x40413f[_0xfa17('0x2c')];if(_0xa6515c[_0xfa17('0x32')]['includeAll']){_0x165ec9[_0xfa17('0x3e')]=[{'all':!![]}];}_0x165ec9=_[_0xfa17('0x3a')]({},_0x165ec9,_0xa6515c[_0xfa17('0x3c')]);return db[_0xfa17('0x28')][_0xfa17('0x44')](_0x165ec9)['then'](handleEntityNotFound(_0x5b55a1,null))[_0xfa17('0x21')](respondWithResult(_0x5b55a1,null))['catch'](handleError(_0x5b55a1,null));};exports[_0xfa17('0x45')]=function(_0x380b6d,_0x58edc1){return db[_0xfa17('0x28')]['create'](_0x380b6d[_0xfa17('0x46')],{})[_0xfa17('0x21')](respondWithResult(_0x58edc1,0xc9))[_0xfa17('0x41')](handleError(_0x58edc1,null));};exports[_0xfa17('0x1f')]=function(_0x3dcf53,_0x57942b){if(_0x3dcf53[_0xfa17('0x46')]['id']){delete _0x3dcf53['body']['id'];}return db[_0xfa17('0x28')]['find']({'where':{'id':_0x3dcf53[_0xfa17('0x43')]['id']}})[_0xfa17('0x21')](handleEntityNotFound(_0x57942b,null))[_0xfa17('0x21')](saveUpdates(_0x3dcf53[_0xfa17('0x46')],null))[_0xfa17('0x21')](respondWithResult(_0x57942b,null))[_0xfa17('0x41')](handleError(_0x57942b,null));};exports['destroy']=function(_0x5b799d,_0x219774){return db[_0xfa17('0x28')][_0xfa17('0x44')]({'where':{'id':_0x5b799d[_0xfa17('0x43')]['id']}})[_0xfa17('0x21')](handleEntityNotFound(_0x219774,null))['then'](removeEntity(_0x219774,null))[_0xfa17('0x41')](handleError(_0x219774,null));};exports[_0xfa17('0x47')]=function(_0x52a1b7,_0x5d68fb){return db[_0xfa17('0x28')][_0xfa17('0x47')]()[_0xfa17('0x21')](respondWithResult(_0x5d68fb,null))[_0xfa17('0x41')](handleError(_0x5d68fb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index bac3801..987d04c 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 _0x798c=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x31ec0b,_0x1716ed){var _0x30d090=function(_0x2e7020){while(--_0x2e7020){_0x31ec0b['push'](_0x31ec0b['shift']());}};_0x30d090(++_0x1716ed);}(_0x798c,0x1b0));var _0xc798=function(_0x11248b,_0x5de4ad){_0x11248b=_0x11248b-0x0;var _0x474a6a=_0x798c[_0x11248b];return _0x474a6a;};'use strict';var _=require(_0xc798('0x0'));var util=require(_0xc798('0x1'));var logger=require(_0xc798('0x2'))('api');var moment=require(_0xc798('0x3'));var BPromise=require('bluebird');var rp=require(_0xc798('0x4'));var fs=require('fs');var path=require(_0xc798('0x5'));var rimraf=require(_0xc798('0x6'));var config=require(_0xc798('0x7'));var attributes=require(_0xc798('0x8'));module[_0xc798('0x9')]=function(_0x6dc99b,_0x19a802){return _0x6dc99b[_0xc798('0xa')](_0xc798('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cdf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util'];(function(_0x22f296,_0x26a4ba){var _0x1f7fde=function(_0x1d153a){while(--_0x1d153a){_0x22f296['push'](_0x22f296['shift']());}};_0x1f7fde(++_0x26a4ba);}(_0x5cdf,0x98));var _0xf5cd=function(_0x3fc4fb,_0x58c04d){_0x3fc4fb=_0x3fc4fb-0x0;var _0x48619c=_0x5cdf[_0x3fc4fb];return _0x48619c;};'use strict';var _=require(_0xf5cd('0x0'));var util=require(_0xf5cd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf5cd('0x2'));var BPromise=require(_0xf5cd('0x3'));var rp=require(_0xf5cd('0x4'));var fs=require('fs');var path=require(_0xf5cd('0x5'));var rimraf=require(_0xf5cd('0x6'));var config=require(_0xf5cd('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xf5cd('0x8')]=function(_0x410722,_0x44d041){return _0x410722[_0xf5cd('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0xf5cd('0xa'),'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 76c2aea..b37bb21 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 _0x652f=['client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0xd00a4a,_0x6e3bbb){var _0x260456=function(_0x3211aa){while(--_0x3211aa){_0xd00a4a['push'](_0xd00a4a['shift']());}};_0x260456(++_0x6e3bbb);}(_0x652f,0x156));var _0xf652=function(_0x4f0360,_0x5af977){_0x4f0360=_0x4f0360-0x0;var _0x312e7d=_0x652f[_0x4f0360];return _0x312e7d;};'use strict';var _=require(_0xf652('0x0'));var util=require(_0xf652('0x1'));var moment=require(_0xf652('0x2'));var BPromise=require(_0xf652('0x3'));var rs=require(_0xf652('0x4'));var fs=require('fs');var Redis=require(_0xf652('0x5'));var db=require(_0xf652('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf652('0x7'))('rpc');var config=require(_0xf652('0x8'));var jayson=require(_0xf652('0x9'));var client=jayson[_0xf652('0xa')][_0xf652('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e05e9,_0x47d1ed,_0x1e9e17){return new BPromise(function(_0x53336e,_0x2d8803){return client[_0xf652('0xc')](_0x2e05e9,_0x1e9e17)[_0xf652('0xd')](function(_0x26639f){logger[_0xf652('0xe')](_0xf652('0xf'),_0x47d1ed,_0xf652('0x10'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x47d1ed,_0xf652('0x10'),JSON[_0xf652('0x11')](_0x26639f));if(_0x26639f[_0xf652('0x12')]){if(_0x26639f[_0xf652('0x12')]['code']===0x1f4){logger[_0xf652('0x12')](_0xf652('0xf'),_0x47d1ed,_0x26639f[_0xf652('0x12')][_0xf652('0x13')]);return _0x2d8803(_0x26639f[_0xf652('0x12')][_0xf652('0x13')]);}logger[_0xf652('0x12')](_0xf652('0xf'),_0x47d1ed,_0x26639f[_0xf652('0x12')][_0xf652('0x13')]);return _0x53336e(_0x26639f[_0xf652('0x12')]['message']);}else{logger[_0xf652('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x47d1ed,'request\x20sent');_0x53336e(_0x26639f[_0xf652('0x14')][_0xf652('0x13')]);}})[_0xf652('0x15')](function(_0x378f64){logger[_0xf652('0x12')](_0xf652('0xf'),_0x47d1ed,_0x378f64);_0x2d8803(_0x378f64);});});} \ No newline at end of file +var _0x5125=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','code','error'];(function(_0x2ea490,_0x4d3bda){var _0x5add65=function(_0x27dd85){while(--_0x27dd85){_0x2ea490['push'](_0x2ea490['shift']());}};_0x5add65(++_0x4d3bda);}(_0x5125,0x8d));var _0x5512=function(_0x478aa8,_0x1d38dd){_0x478aa8=_0x478aa8-0x0;var _0x117609=_0x5125[_0x478aa8];return _0x117609;};'use strict';var _=require(_0x5512('0x0'));var util=require(_0x5512('0x1'));var moment=require(_0x5512('0x2'));var BPromise=require(_0x5512('0x3'));var rs=require(_0x5512('0x4'));var fs=require('fs');var Redis=require(_0x5512('0x5'));var db=require(_0x5512('0x6'))['db'];var utils=require(_0x5512('0x7'));var logger=require(_0x5512('0x8'))(_0x5512('0x9'));var config=require(_0x5512('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5512('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f3ab,_0x561421,_0x4a9ff1){return new BPromise(function(_0x5e8456,_0x1ce654){return client[_0x5512('0xc')](_0x30f3ab,_0x4a9ff1)[_0x5512('0xd')](function(_0x346724){logger[_0x5512('0xe')](_0x5512('0xf'),_0x561421,_0x5512('0x10'));logger[_0x5512('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x561421,_0x5512('0x10'),JSON['stringify'](_0x346724));if(_0x346724['error']){if(_0x346724['error'][_0x5512('0x12')]===0x1f4){logger[_0x5512('0x13')](_0x5512('0xf'),_0x561421,_0x346724[_0x5512('0x13')][_0x5512('0x14')]);return _0x1ce654(_0x346724[_0x5512('0x13')][_0x5512('0x14')]);}logger[_0x5512('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x561421,_0x346724[_0x5512('0x13')][_0x5512('0x14')]);return _0x5e8456(_0x346724[_0x5512('0x13')]['message']);}else{logger[_0x5512('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x561421,'request\x20sent');_0x5e8456(_0x346724[_0x5512('0x15')][_0x5512('0x14')]);}})[_0x5512('0x16')](function(_0x5d0f81){logger[_0x5512('0x13')](_0x5512('0xf'),_0x561421,_0x5d0f81);_0x1ce654(_0x5d0f81);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a1c2311..5fcb7ce 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 _0x13da=['index','/describe','describe','show','/:id/questions','getQuestions','post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x13da,0xcd));var _0xa13d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x13da[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xa13d('0x0'));var util=require(_0xa13d('0x1'));var path=require('path');var timeout=require(_0xa13d('0x2'));var express=require(_0xa13d('0x3'));var router=express[_0xa13d('0x4')]();var fs_extra=require(_0xa13d('0x5'));var auth=require(_0xa13d('0x6'));var interaction=require(_0xa13d('0x7'));var config=require(_0xa13d('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0xa13d('0x9')]('/',auth[_0xa13d('0xa')](),controller[_0xa13d('0xb')]);router[_0xa13d('0x9')](_0xa13d('0xc'),auth[_0xa13d('0xa')](),controller[_0xa13d('0xd')]);router[_0xa13d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa13d('0xe')]);router['get'](_0xa13d('0xf'),auth[_0xa13d('0xa')](),controller[_0xa13d('0x10')]);router[_0xa13d('0x11')]('/',auth[_0xa13d('0xa')](),controller[_0xa13d('0x12')]);router['put'](_0xa13d('0x13'),auth['isAuthenticated'](),controller[_0xa13d('0x14')]);router[_0xa13d('0x15')](_0xa13d('0x13'),auth[_0xa13d('0xa')](),controller[_0xa13d('0x16')]);module[_0xa13d('0x17')]=router; \ No newline at end of file +var _0xcd1d=['update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','/:id','create','put'];(function(_0x3196b3,_0x213b1a){var _0x1828ff=function(_0x59bb9a){while(--_0x59bb9a){_0x3196b3['push'](_0x3196b3['shift']());}};_0x1828ff(++_0x213b1a);}(_0xcd1d,0xc2));var _0xdcd1=function(_0x1daca8,_0x5d2957){_0x1daca8=_0x1daca8-0x0;var _0x2dcdd8=_0xcd1d[_0x1daca8];return _0x2dcdd8;};'use strict';var multer=require(_0xdcd1('0x0'));var util=require(_0xdcd1('0x1'));var path=require('path');var timeout=require(_0xdcd1('0x2'));var express=require('express');var router=express[_0xdcd1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdcd1('0x4'));var interaction=require(_0xdcd1('0x5'));var config=require(_0xdcd1('0x6'));var controller=require(_0xdcd1('0x7'));router[_0xdcd1('0x8')]('/',auth[_0xdcd1('0x9')](),controller[_0xdcd1('0xa')]);router[_0xdcd1('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xdcd1('0xb')]);router[_0xdcd1('0x8')](_0xdcd1('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xdcd1('0x8')]('/:id/questions',auth[_0xdcd1('0x9')](),controller['getQuestions']);router['post']('/',auth[_0xdcd1('0x9')](),controller[_0xdcd1('0xd')]);router[_0xdcd1('0xe')](_0xdcd1('0xc'),auth[_0xdcd1('0x9')](),controller[_0xdcd1('0xf')]);router[_0xdcd1('0x10')](_0xdcd1('0xc'),auth[_0xdcd1('0x9')](),controller[_0xdcd1('0x11')]);module[_0xdcd1('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index d5ca35a..d64b447 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 _0x74f7=['sequelize','exports','DATE','setDataValue','endtime','STRING','BOOLEAN','moment'];(function(_0x237c08,_0x1cc97a){var _0x93df98=function(_0x1aecf8){while(--_0x1aecf8){_0x237c08['push'](_0x237c08['shift']());}};_0x93df98(++_0x1cc97a);}(_0x74f7,0xa7));var _0x774f=function(_0x41f96e,_0x333851){_0x41f96e=_0x41f96e-0x0;var _0x48a4ac=_0x74f7[_0x41f96e];return _0x48a4ac;};'use strict';var moment=require(_0x774f('0x0'));var Sequelize=require(_0x774f('0x1'));module[_0x774f('0x2')]={'starttime':{'type':Sequelize[_0x774f('0x3')],'set':function(_0x4caca3){this[_0x774f('0x4')]('starttime',_0x4caca3);this[_0x774f('0x4')](_0x774f('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x774f('0x3')]},'membername':{'type':Sequelize[_0x774f('0x6')]},'projectname':{'type':Sequelize[_0x774f('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x774f('0x6')]},'calleridname':{'type':Sequelize[_0x774f('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x774f('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x330c=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','starttime','setDataValue','endtime','format'];(function(_0x5b3eaf,_0x4b5588){var _0x35c66b=function(_0x1b29cc){while(--_0x1b29cc){_0x5b3eaf['push'](_0x5b3eaf['shift']());}};_0x35c66b(++_0x4b5588);}(_0x330c,0x7b));var _0xc330=function(_0x87397f,_0x52a3b1){_0x87397f=_0x87397f-0x0;var _0x53674b=_0x330c[_0x87397f];return _0x53674b;};'use strict';var moment=require('moment');var Sequelize=require(_0xc330('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x126ea2){this['setDataValue'](_0xc330('0x1'),_0x126ea2);this[_0xc330('0x2')](_0xc330('0x3'),moment()[_0xc330('0x4')](_0xc330('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xc330('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc330('0x6')]},'calleridnum':{'type':Sequelize[_0xc330('0x6')]},'completed':{'type':Sequelize[_0xc330('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index cfe159e..8949d79 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 _0x9a25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','options','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1f9443,_0x5d6500){var _0x49f109=function(_0x5f4222){while(--_0x5f4222){_0x1f9443['push'](_0x1f9443['shift']());}};_0x49f109(++_0x5d6500);}(_0x9a25,0x1e4));var _0x59a2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9a25[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x59a2('0x0'));var rimraf=require(_0x59a2('0x1'));var zipdir=require(_0x59a2('0x2'));var jsonpatch=require(_0x59a2('0x3'));var rp=require(_0x59a2('0x4'));var moment=require(_0x59a2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x59a2('0x6'));var path=require(_0x59a2('0x7'));var sox=require(_0x59a2('0x8'));var csv=require(_0x59a2('0x9'));var ejs=require(_0x59a2('0xa'));var fs=require('fs');var fs_extra=require(_0x59a2('0xb'));var _=require(_0x59a2('0xc'));var squel=require(_0x59a2('0xd'));var crypto=require('crypto');var jsforce=require(_0x59a2('0xe'));var deskjs=require(_0x59a2('0xf'));var toCsv=require(_0x59a2('0x9'));var querystring=require(_0x59a2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x59a2('0x11'));var qs=require(_0x59a2('0x12'));var as=require(_0x59a2('0x13'));var hardwareService=require(_0x59a2('0x14'));var logger=require(_0x59a2('0x15'))(_0x59a2('0x16'));var utils=require(_0x59a2('0x17'));var config=require(_0x59a2('0x18'));var licenseUtil=require(_0x59a2('0x19'));var db=require(_0x59a2('0x1a'))['db'];function respondWithStatusCode(_0xb6893e,_0x2b0d67){_0x2b0d67=_0x2b0d67||0xcc;return function(_0x1c012a){if(_0x1c012a){return _0xb6893e[_0x59a2('0x1b')](_0x2b0d67);}return _0xb6893e[_0x59a2('0x1c')](_0x2b0d67)[_0x59a2('0x1d')]();};}function respondWithResult(_0x16a9eb,_0x354180){_0x354180=_0x354180||0xc8;return function(_0x5972f1){if(_0x5972f1){return _0x16a9eb['status'](_0x354180)['json'](_0x5972f1);}};}function respondWithFilteredResult(_0x539c77,_0x2d1d36){return function(_0x40444e){if(_0x40444e){var _0x2bc5f3=typeof _0x2d1d36['offset']==='undefined'&&typeof _0x2d1d36[_0x59a2('0x1e')]===_0x59a2('0x1f');var _0x1f1798=_0x40444e[_0x59a2('0x20')];var _0x4449c1=_0x2bc5f3?0x0:_0x2d1d36[_0x59a2('0x21')];var _0x5b0459=_0x2bc5f3?_0x40444e[_0x59a2('0x20')]:_0x2d1d36[_0x59a2('0x21')]+_0x2d1d36[_0x59a2('0x1e')];var _0x43bd1b;if(_0x5b0459>=_0x1f1798){_0x5b0459=_0x1f1798;_0x43bd1b=0xc8;}else{_0x43bd1b=0xce;}_0x539c77[_0x59a2('0x1c')](_0x43bd1b);return _0x539c77[_0x59a2('0x22')](_0x59a2('0x23'),_0x4449c1+'-'+_0x5b0459+'/'+_0x1f1798)['json'](_0x40444e);}return null;};}function patchUpdates(_0x1558a7){return function(_0x5a37e8){try{jsonpatch[_0x59a2('0x24')](_0x5a37e8,_0x1558a7,!![]);}catch(_0x226ff3){return BPromise[_0x59a2('0x25')](_0x226ff3);}return _0x5a37e8[_0x59a2('0x26')]();};}function saveUpdates(_0x2f3292,_0x362da0){return function(_0x1d6161){if(_0x1d6161){return _0x1d6161[_0x59a2('0x27')](_0x2f3292)[_0x59a2('0x28')](function(_0x4e9237){return _0x4e9237;});}return null;};}function removeEntity(_0xa6013a,_0x3be0f9){return function(_0x54f09d){if(_0x54f09d){return _0x54f09d[_0x59a2('0x29')]()['then'](function(){_0xa6013a[_0x59a2('0x1c')](0xcc)[_0x59a2('0x1d')]();});}};}function handleEntityNotFound(_0x5c037d,_0x48d99a){return function(_0x399950){if(!_0x399950){_0x5c037d[_0x59a2('0x1b')](0x194);}return _0x399950;};}function handleError(_0x35c0e1,_0xba792f){_0xba792f=_0xba792f||0x1f4;return function(_0x2da7d9){logger['error'](_0x2da7d9[_0x59a2('0x2a')]);if(_0x2da7d9[_0x59a2('0x2b')]){delete _0x2da7d9[_0x59a2('0x2b')];}_0x35c0e1['status'](_0xba792f)[_0x59a2('0x2c')](_0x2da7d9);};}exports[_0x59a2('0x2d')]=function(_0x5a74f5,_0x5e6d77){var _0x4f83da={},_0x1ea346={},_0x1b6713={'count':0x0,'rows':[]};var _0x666861=_[_0x59a2('0x2e')](db[_0x59a2('0x2f')][_0x59a2('0x30')],function(_0x1ca20e){return{'name':_0x1ca20e[_0x59a2('0x31')],'type':_0x1ca20e[_0x59a2('0x32')]['key']};});_0x1ea346[_0x59a2('0x33')]=_[_0x59a2('0x2e')](_0x666861,_0x59a2('0x2b'));_0x1ea346[_0x59a2('0x34')]=_['keys'](_0x5a74f5[_0x59a2('0x34')]);_0x1ea346[_0x59a2('0x35')]=_[_0x59a2('0x36')](_0x1ea346[_0x59a2('0x33')],_0x1ea346[_0x59a2('0x34')]);_0x4f83da[_0x59a2('0x37')]=_[_0x59a2('0x36')](_0x1ea346[_0x59a2('0x33')],qs[_0x59a2('0x38')](_0x5a74f5[_0x59a2('0x34')]['fields']));_0x4f83da[_0x59a2('0x37')]=_0x4f83da['attributes'][_0x59a2('0x39')]?_0x4f83da[_0x59a2('0x37')]:_0x1ea346[_0x59a2('0x33')];if(!_0x5a74f5[_0x59a2('0x34')][_0x59a2('0x3a')](_0x59a2('0x3b'))){_0x4f83da[_0x59a2('0x1e')]=qs['limit'](_0x5a74f5[_0x59a2('0x34')][_0x59a2('0x1e')]);_0x4f83da[_0x59a2('0x21')]=qs[_0x59a2('0x21')](_0x5a74f5['query']['offset']);}_0x4f83da[_0x59a2('0x3c')]=qs[_0x59a2('0x3d')](_0x5a74f5[_0x59a2('0x34')][_0x59a2('0x3d')]);_0x4f83da[_0x59a2('0x3e')]=qs[_0x59a2('0x35')](_[_0x59a2('0x3f')](_0x5a74f5[_0x59a2('0x34')],_0x1ea346['filters']),_0x666861);if(_0x5a74f5[_0x59a2('0x34')]['filter']){_0x4f83da['where']=_[_0x59a2('0x40')](_0x4f83da['where'],{'$or':_[_0x59a2('0x2e')](_0x666861,function(_0x154667){if(_0x154667[_0x59a2('0x32')]!==_0x59a2('0x41')){var _0x3a7c68={};_0x3a7c68[_0x154667[_0x59a2('0x2b')]]={'$like':'%'+_0x5a74f5[_0x59a2('0x34')][_0x59a2('0x42')]+'%'};return _0x3a7c68;}})});}_0x4f83da=_[_0x59a2('0x40')]({},_0x4f83da,_0x5a74f5['options']);var _0x16ee06={'where':_0x4f83da[_0x59a2('0x3e')]};return db['JscriptySessionReport'][_0x59a2('0x20')](_0x16ee06)[_0x59a2('0x28')](function(_0x6c2fc9){_0x1b6713[_0x59a2('0x20')]=_0x6c2fc9;if(_0x5a74f5[_0x59a2('0x34')]['includeAll']){_0x4f83da[_0x59a2('0x43')]=[{'all':!![]}];}return db[_0x59a2('0x2f')][_0x59a2('0x44')](_0x4f83da);})[_0x59a2('0x28')](function(_0x17ee25){_0x1b6713[_0x59a2('0x45')]=_0x17ee25;return _0x1b6713;})[_0x59a2('0x28')](respondWithFilteredResult(_0x5e6d77,_0x4f83da))[_0x59a2('0x46')](handleError(_0x5e6d77,null));};exports[_0x59a2('0x47')]=function(_0x152266,_0x47368c){var _0x361397={'raw':!![],'where':{'id':_0x152266[_0x59a2('0x48')]['id']}},_0x316c30={};_0x316c30[_0x59a2('0x33')]=_[_0x59a2('0x49')](db[_0x59a2('0x2f')][_0x59a2('0x30')]);_0x316c30[_0x59a2('0x34')]=_[_0x59a2('0x49')](_0x152266[_0x59a2('0x34')]);_0x316c30[_0x59a2('0x35')]=_[_0x59a2('0x36')](_0x316c30[_0x59a2('0x33')],_0x316c30[_0x59a2('0x34')]);_0x361397[_0x59a2('0x37')]=_['intersection'](_0x316c30['model'],qs[_0x59a2('0x38')](_0x152266[_0x59a2('0x34')][_0x59a2('0x38')]));_0x361397['attributes']=_0x361397['attributes'][_0x59a2('0x39')]?_0x361397[_0x59a2('0x37')]:_0x316c30[_0x59a2('0x33')];if(_0x152266[_0x59a2('0x34')]['includeAll']){_0x361397[_0x59a2('0x43')]=[{'all':!![]}];}_0x361397=_[_0x59a2('0x40')]({},_0x361397,_0x152266['options']);return db[_0x59a2('0x2f')]['find'](_0x361397)['then'](handleEntityNotFound(_0x47368c,null))[_0x59a2('0x28')](respondWithResult(_0x47368c,null))[_0x59a2('0x46')](handleError(_0x47368c,null));};exports['create']=function(_0x2f62ba,_0x9bfd6f){return db['JscriptySessionReport'][_0x59a2('0x4a')](_0x2f62ba[_0x59a2('0x4b')],{})[_0x59a2('0x28')](respondWithResult(_0x9bfd6f,0xc9))[_0x59a2('0x46')](handleError(_0x9bfd6f,null));};exports[_0x59a2('0x27')]=function(_0x205bdf,_0x58bd68){if(_0x205bdf[_0x59a2('0x4b')]['id']){delete _0x205bdf[_0x59a2('0x4b')]['id'];}return db[_0x59a2('0x2f')][_0x59a2('0x4c')]({'where':{'id':_0x205bdf[_0x59a2('0x48')]['id']}})[_0x59a2('0x28')](handleEntityNotFound(_0x58bd68,null))[_0x59a2('0x28')](saveUpdates(_0x205bdf[_0x59a2('0x4b')],null))['then'](respondWithResult(_0x58bd68,null))[_0x59a2('0x46')](handleError(_0x58bd68,null));};exports[_0x59a2('0x29')]=function(_0x2fc040,_0x10d59a){return db[_0x59a2('0x2f')]['find']({'where':{'id':_0x2fc040[_0x59a2('0x48')]['id']}})[_0x59a2('0x28')](handleEntityNotFound(_0x10d59a,null))[_0x59a2('0x28')](removeEntity(_0x10d59a,null))[_0x59a2('0x46')](handleError(_0x10d59a,null));};exports[_0x59a2('0x4d')]=function(_0xa56e8d,_0xc24cb7){return db[_0x59a2('0x2f')][_0x59a2('0x4d')]()[_0x59a2('0x28')](respondWithResult(_0xc24cb7,null))['catch'](handleError(_0xc24cb7,null));};exports[_0x59a2('0x4e')]=function(_0x3e4f6b,_0x46b19e,_0x42b844){var _0x323421={'raw':!![],'where':{}};var _0x19bc6f={};var _0xae7159={'count':0x0,'rows':[]};return db[_0x59a2('0x2f')][_0x59a2('0x4f')]({'where':{'id':_0x3e4f6b[_0x59a2('0x48')]['id']}})[_0x59a2('0x28')](handleEntityNotFound(_0x46b19e,null))[_0x59a2('0x28')](function(_0x41b686){if(_0x41b686){_0x19bc6f[_0x59a2('0x33')]=_[_0x59a2('0x49')](db[_0x59a2('0x50')][_0x59a2('0x30')]);_0x19bc6f[_0x59a2('0x34')]=_[_0x59a2('0x49')](_0x3e4f6b[_0x59a2('0x34')]);_0x19bc6f['filters']=_[_0x59a2('0x36')](_0x19bc6f[_0x59a2('0x33')],_0x19bc6f[_0x59a2('0x34')]);_0x323421['attributes']=_[_0x59a2('0x36')](_0x19bc6f[_0x59a2('0x33')],qs[_0x59a2('0x38')](_0x3e4f6b['query'][_0x59a2('0x38')]));_0x323421[_0x59a2('0x37')]=_0x323421[_0x59a2('0x37')][_0x59a2('0x39')]?_0x323421[_0x59a2('0x37')]:_0x19bc6f[_0x59a2('0x33')];if(!_0x3e4f6b[_0x59a2('0x34')][_0x59a2('0x3a')](_0x59a2('0x3b'))){_0x323421[_0x59a2('0x1e')]=qs['limit'](_0x3e4f6b[_0x59a2('0x34')]['limit']);_0x323421[_0x59a2('0x21')]=qs[_0x59a2('0x21')](_0x3e4f6b['query'][_0x59a2('0x21')]);}_0x323421['order']=qs['sort'](_0x3e4f6b[_0x59a2('0x34')]['sort']);_0x323421[_0x59a2('0x3e')]=qs[_0x59a2('0x35')](_[_0x59a2('0x3f')](_0x3e4f6b[_0x59a2('0x34')],_0x19bc6f[_0x59a2('0x35')]));_0x323421[_0x59a2('0x3e')][_0x59a2('0x51')]=_0x41b686['id'];if(_0x3e4f6b[_0x59a2('0x34')][_0x59a2('0x42')]){_0x323421[_0x59a2('0x3e')]=_[_0x59a2('0x40')](_0x323421[_0x59a2('0x3e')],{'$or':_[_0x59a2('0x2e')](_0x323421[_0x59a2('0x37')],function(_0x4edfed){var _0x23bfb5={};_0x23bfb5[_0x4edfed]={'$like':'%'+_0x3e4f6b[_0x59a2('0x34')][_0x59a2('0x42')]+'%'};return _0x23bfb5;})});}_0x323421=_[_0x59a2('0x40')]({},_0x323421,_0x3e4f6b[_0x59a2('0x52')]);return db[_0x59a2('0x50')][_0x59a2('0x20')]({'where':_0x323421[_0x59a2('0x3e')]})[_0x59a2('0x28')](function(_0x18cddd){_0xae7159[_0x59a2('0x20')]=_0x18cddd;if(_0x3e4f6b[_0x59a2('0x34')][_0x59a2('0x53')]){_0x323421[_0x59a2('0x43')]=[{'all':!![]}];}return db[_0x59a2('0x50')][_0x59a2('0x44')](_0x323421);})[_0x59a2('0x28')](function(_0x1c42e4){_0xae7159[_0x59a2('0x45')]=_0x1c42e4;return _0xae7159;});}})[_0x59a2('0x28')](respondWithFilteredResult(_0x46b19e,_0x323421))[_0x59a2('0x46')](handleError(_0x46b19e,null));}; \ No newline at end of file +var _0x2f3e=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','keys','include','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','type','key'];(function(_0x296096,_0x356972){var _0xc4ea79=function(_0x531d10){while(--_0x531d10){_0x296096['push'](_0x296096['shift']());}};_0xc4ea79(++_0x356972);}(_0x2f3e,0xc4));var _0xe2f3=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x2f3e[_0x406e46];return _0x4a3742;};'use strict';var emlformat=require(_0xe2f3('0x0'));var rimraf=require(_0xe2f3('0x1'));var zipdir=require(_0xe2f3('0x2'));var jsonpatch=require(_0xe2f3('0x3'));var rp=require(_0xe2f3('0x4'));var moment=require('moment');var BPromise=require(_0xe2f3('0x5'));var Mustache=require('mustache');var util=require(_0xe2f3('0x6'));var path=require(_0xe2f3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xe2f3('0x9'));var _=require(_0xe2f3('0xa'));var squel=require('squel');var crypto=require(_0xe2f3('0xb'));var jsforce=require(_0xe2f3('0xc'));var deskjs=require(_0xe2f3('0xd'));var toCsv=require(_0xe2f3('0xe'));var querystring=require(_0xe2f3('0xf'));var Papa=require(_0xe2f3('0x10'));var Redis=require('ioredis');var authService=require(_0xe2f3('0x11'));var qs=require(_0xe2f3('0x12'));var as=require(_0xe2f3('0x13'));var hardwareService=require(_0xe2f3('0x14'));var logger=require(_0xe2f3('0x15'))(_0xe2f3('0x16'));var utils=require(_0xe2f3('0x17'));var config=require(_0xe2f3('0x18'));var licenseUtil=require(_0xe2f3('0x19'));var db=require(_0xe2f3('0x1a'))['db'];function respondWithStatusCode(_0x3dc7fa,_0x42e273){_0x42e273=_0x42e273||0xcc;return function(_0x1f3d11){if(_0x1f3d11){return _0x3dc7fa['sendStatus'](_0x42e273);}return _0x3dc7fa[_0xe2f3('0x1b')](_0x42e273)[_0xe2f3('0x1c')]();};}function respondWithResult(_0x2c8df5,_0x3b2c74){_0x3b2c74=_0x3b2c74||0xc8;return function(_0x318771){if(_0x318771){return _0x2c8df5[_0xe2f3('0x1b')](_0x3b2c74)['json'](_0x318771);}};}function respondWithFilteredResult(_0x51abe5,_0x122679){return function(_0x57eca6){if(_0x57eca6){var _0x47add6=typeof _0x122679[_0xe2f3('0x1d')]===_0xe2f3('0x1e')&&typeof _0x122679[_0xe2f3('0x1f')]===_0xe2f3('0x1e');var _0x2aee40=_0x57eca6[_0xe2f3('0x20')];var _0x50062f=_0x47add6?0x0:_0x122679['offset'];var _0x1fedc0=_0x47add6?_0x57eca6['count']:_0x122679[_0xe2f3('0x1d')]+_0x122679[_0xe2f3('0x1f')];var _0x3e48d6;if(_0x1fedc0>=_0x2aee40){_0x1fedc0=_0x2aee40;_0x3e48d6=0xc8;}else{_0x3e48d6=0xce;}_0x51abe5[_0xe2f3('0x1b')](_0x3e48d6);return _0x51abe5[_0xe2f3('0x21')](_0xe2f3('0x22'),_0x50062f+'-'+_0x1fedc0+'/'+_0x2aee40)[_0xe2f3('0x23')](_0x57eca6);}return null;};}function patchUpdates(_0xdd2e82){return function(_0x1a00ad){try{jsonpatch[_0xe2f3('0x24')](_0x1a00ad,_0xdd2e82,!![]);}catch(_0x1a8694){return BPromise[_0xe2f3('0x25')](_0x1a8694);}return _0x1a00ad[_0xe2f3('0x26')]();};}function saveUpdates(_0x2ba073,_0x154fc2){return function(_0x14b532){if(_0x14b532){return _0x14b532['update'](_0x2ba073)['then'](function(_0x50f6bb){return _0x50f6bb;});}return null;};}function removeEntity(_0x10d5ab,_0x16284c){return function(_0x25949b){if(_0x25949b){return _0x25949b[_0xe2f3('0x27')]()[_0xe2f3('0x28')](function(){_0x10d5ab[_0xe2f3('0x1b')](0xcc)[_0xe2f3('0x1c')]();});}};}function handleEntityNotFound(_0x41f8f0,_0x52ebd6){return function(_0x58eebd){if(!_0x58eebd){_0x41f8f0['sendStatus'](0x194);}return _0x58eebd;};}function handleError(_0x35e14a,_0x531b11){_0x531b11=_0x531b11||0x1f4;return function(_0x3d3c88){logger[_0xe2f3('0x29')](_0x3d3c88[_0xe2f3('0x2a')]);if(_0x3d3c88['name']){delete _0x3d3c88[_0xe2f3('0x2b')];}_0x35e14a[_0xe2f3('0x1b')](_0x531b11)[_0xe2f3('0x2c')](_0x3d3c88);};}exports[_0xe2f3('0x2d')]=function(_0x2712e5,_0x141153){var _0x2d31d5={},_0x3224e2={},_0x341faa={'count':0x0,'rows':[]};var _0x33305f=_[_0xe2f3('0x2e')](db[_0xe2f3('0x2f')]['rawAttributes'],function(_0x52a66a){return{'name':_0x52a66a['fieldName'],'type':_0x52a66a[_0xe2f3('0x30')][_0xe2f3('0x31')]};});_0x3224e2[_0xe2f3('0x32')]=_[_0xe2f3('0x2e')](_0x33305f,_0xe2f3('0x2b'));_0x3224e2[_0xe2f3('0x33')]=_['keys'](_0x2712e5['query']);_0x3224e2[_0xe2f3('0x34')]=_[_0xe2f3('0x35')](_0x3224e2[_0xe2f3('0x32')],_0x3224e2[_0xe2f3('0x33')]);_0x2d31d5[_0xe2f3('0x36')]=_['intersection'](_0x3224e2[_0xe2f3('0x32')],qs[_0xe2f3('0x37')](_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x37')]));_0x2d31d5[_0xe2f3('0x36')]=_0x2d31d5[_0xe2f3('0x36')][_0xe2f3('0x38')]?_0x2d31d5['attributes']:_0x3224e2[_0xe2f3('0x32')];if(!_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x39')]('nolimit')){_0x2d31d5[_0xe2f3('0x1f')]=qs[_0xe2f3('0x1f')](_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x1f')]);_0x2d31d5[_0xe2f3('0x1d')]=qs['offset'](_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x1d')]);}_0x2d31d5['order']=qs['sort'](_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x3a')]);_0x2d31d5[_0xe2f3('0x3b')]=qs[_0xe2f3('0x34')](_['pick'](_0x2712e5['query'],_0x3224e2[_0xe2f3('0x34')]),_0x33305f);if(_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x3c')]){_0x2d31d5[_0xe2f3('0x3b')]=_['merge'](_0x2d31d5[_0xe2f3('0x3b')],{'$or':_[_0xe2f3('0x2e')](_0x33305f,function(_0x5b417d){if(_0x5b417d[_0xe2f3('0x30')]!==_0xe2f3('0x3d')){var _0x30b357={};_0x30b357[_0x5b417d[_0xe2f3('0x2b')]]={'$like':'%'+_0x2712e5[_0xe2f3('0x33')]['filter']+'%'};return _0x30b357;}})});}_0x2d31d5=_[_0xe2f3('0x3e')]({},_0x2d31d5,_0x2712e5[_0xe2f3('0x3f')]);var _0x2c3829={'where':_0x2d31d5[_0xe2f3('0x3b')]};return db[_0xe2f3('0x2f')]['count'](_0x2c3829)[_0xe2f3('0x28')](function(_0x3f5693){_0x341faa[_0xe2f3('0x20')]=_0x3f5693;if(_0x2712e5[_0xe2f3('0x33')][_0xe2f3('0x40')]){_0x2d31d5['include']=[{'all':!![]}];}return db[_0xe2f3('0x2f')][_0xe2f3('0x41')](_0x2d31d5);})[_0xe2f3('0x28')](function(_0x3a973d){_0x341faa['rows']=_0x3a973d;return _0x341faa;})[_0xe2f3('0x28')](respondWithFilteredResult(_0x141153,_0x2d31d5))[_0xe2f3('0x42')](handleError(_0x141153,null));};exports[_0xe2f3('0x43')]=function(_0x3b1f85,_0x2117d1){var _0x456a2a={'raw':!![],'where':{'id':_0x3b1f85[_0xe2f3('0x44')]['id']}},_0x572d73={};_0x572d73[_0xe2f3('0x32')]=_['keys'](db[_0xe2f3('0x2f')][_0xe2f3('0x45')]);_0x572d73[_0xe2f3('0x33')]=_[_0xe2f3('0x46')](_0x3b1f85[_0xe2f3('0x33')]);_0x572d73[_0xe2f3('0x34')]=_[_0xe2f3('0x35')](_0x572d73[_0xe2f3('0x32')],_0x572d73['query']);_0x456a2a[_0xe2f3('0x36')]=_['intersection'](_0x572d73['model'],qs[_0xe2f3('0x37')](_0x3b1f85[_0xe2f3('0x33')][_0xe2f3('0x37')]));_0x456a2a[_0xe2f3('0x36')]=_0x456a2a['attributes'][_0xe2f3('0x38')]?_0x456a2a['attributes']:_0x572d73[_0xe2f3('0x32')];if(_0x3b1f85[_0xe2f3('0x33')][_0xe2f3('0x40')]){_0x456a2a[_0xe2f3('0x47')]=[{'all':!![]}];}_0x456a2a=_[_0xe2f3('0x3e')]({},_0x456a2a,_0x3b1f85[_0xe2f3('0x3f')]);return db[_0xe2f3('0x2f')]['find'](_0x456a2a)['then'](handleEntityNotFound(_0x2117d1,null))[_0xe2f3('0x28')](respondWithResult(_0x2117d1,null))[_0xe2f3('0x42')](handleError(_0x2117d1,null));};exports[_0xe2f3('0x48')]=function(_0x253c58,_0x4f6e47){return db[_0xe2f3('0x2f')][_0xe2f3('0x48')](_0x253c58[_0xe2f3('0x49')],{})[_0xe2f3('0x28')](respondWithResult(_0x4f6e47,0xc9))[_0xe2f3('0x42')](handleError(_0x4f6e47,null));};exports['update']=function(_0x3d237f,_0x33bb8c){if(_0x3d237f[_0xe2f3('0x49')]['id']){delete _0x3d237f['body']['id'];}return db['JscriptySessionReport'][_0xe2f3('0x4a')]({'where':{'id':_0x3d237f[_0xe2f3('0x44')]['id']}})[_0xe2f3('0x28')](handleEntityNotFound(_0x33bb8c,null))['then'](saveUpdates(_0x3d237f['body'],null))['then'](respondWithResult(_0x33bb8c,null))[_0xe2f3('0x42')](handleError(_0x33bb8c,null));};exports[_0xe2f3('0x27')]=function(_0x418a9c,_0x50ae8e){return db['JscriptySessionReport']['find']({'where':{'id':_0x418a9c[_0xe2f3('0x44')]['id']}})[_0xe2f3('0x28')](handleEntityNotFound(_0x50ae8e,null))['then'](removeEntity(_0x50ae8e,null))[_0xe2f3('0x42')](handleError(_0x50ae8e,null));};exports[_0xe2f3('0x4b')]=function(_0xe9db06,_0x3d2e6c){return db[_0xe2f3('0x2f')]['describe']()[_0xe2f3('0x28')](respondWithResult(_0x3d2e6c,null))[_0xe2f3('0x42')](handleError(_0x3d2e6c,null));};exports[_0xe2f3('0x4c')]=function(_0xcde226,_0x5f25d2,_0x51134b){var _0x175054={'raw':!![],'where':{}};var _0x470de7={};var _0x55cfa6={'count':0x0,'rows':[]};return db[_0xe2f3('0x2f')][_0xe2f3('0x4d')]({'where':{'id':_0xcde226['params']['id']}})[_0xe2f3('0x28')](handleEntityNotFound(_0x5f25d2,null))[_0xe2f3('0x28')](function(_0x124c41){if(_0x124c41){_0x470de7[_0xe2f3('0x32')]=_['keys'](db[_0xe2f3('0x4e')]['rawAttributes']);_0x470de7[_0xe2f3('0x33')]=_[_0xe2f3('0x46')](_0xcde226[_0xe2f3('0x33')]);_0x470de7['filters']=_[_0xe2f3('0x35')](_0x470de7['model'],_0x470de7[_0xe2f3('0x33')]);_0x175054[_0xe2f3('0x36')]=_[_0xe2f3('0x35')](_0x470de7[_0xe2f3('0x32')],qs['fields'](_0xcde226[_0xe2f3('0x33')][_0xe2f3('0x37')]));_0x175054[_0xe2f3('0x36')]=_0x175054['attributes']['length']?_0x175054[_0xe2f3('0x36')]:_0x470de7[_0xe2f3('0x32')];if(!_0xcde226[_0xe2f3('0x33')]['hasOwnProperty']('nolimit')){_0x175054[_0xe2f3('0x1f')]=qs[_0xe2f3('0x1f')](_0xcde226[_0xe2f3('0x33')]['limit']);_0x175054[_0xe2f3('0x1d')]=qs['offset'](_0xcde226['query'][_0xe2f3('0x1d')]);}_0x175054[_0xe2f3('0x4f')]=qs[_0xe2f3('0x3a')](_0xcde226['query'][_0xe2f3('0x3a')]);_0x175054[_0xe2f3('0x3b')]=qs['filters'](_['pick'](_0xcde226['query'],_0x470de7[_0xe2f3('0x34')]));_0x175054['where'][_0xe2f3('0x50')]=_0x124c41['id'];if(_0xcde226['query'][_0xe2f3('0x3c')]){_0x175054[_0xe2f3('0x3b')]=_[_0xe2f3('0x3e')](_0x175054[_0xe2f3('0x3b')],{'$or':_[_0xe2f3('0x2e')](_0x175054[_0xe2f3('0x36')],function(_0x2d2388){var _0xfef84={};_0xfef84[_0x2d2388]={'$like':'%'+_0xcde226[_0xe2f3('0x33')][_0xe2f3('0x3c')]+'%'};return _0xfef84;})});}_0x175054=_['merge']({},_0x175054,_0xcde226[_0xe2f3('0x3f')]);return db[_0xe2f3('0x4e')][_0xe2f3('0x20')]({'where':_0x175054[_0xe2f3('0x3b')]})['then'](function(_0x4c8c5f){_0x55cfa6[_0xe2f3('0x20')]=_0x4c8c5f;if(_0xcde226[_0xe2f3('0x33')][_0xe2f3('0x40')]){_0x175054[_0xe2f3('0x47')]=[{'all':!![]}];}return db[_0xe2f3('0x4e')]['findAll'](_0x175054);})[_0xe2f3('0x28')](function(_0x3eebfb){_0x55cfa6[_0xe2f3('0x51')]=_0x3eebfb;return _0x55cfa6;});}})[_0xe2f3('0x28')](respondWithFilteredResult(_0x5f25d2,_0x175054))[_0xe2f3('0x42')](handleError(_0x5f25d2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a1697c7..ae162f3 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0x1f1647,_0xc6e878){var _0x5ce694=function(_0x234498){while(--_0x234498){_0x1f1647['push'](_0x1f1647['shift']());}};_0x5ce694(++_0xc6e878);}(_0x1261,0x144));var _0x1126=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0x1261[_0x137f1a];return _0x439923;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['moment','request-promise','path','rimraf','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x291617,_0x321bfd){var _0x261729=function(_0x297f38){while(--_0x297f38){_0x291617['push'](_0x291617['shift']());}};_0x261729(++_0x321bfd);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x461834,_0x25b9f9){_0x461834=_0x461834-0x0;var _0x12e5ce=_0xc1c6[_0x461834];return _0x12e5ce;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'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 8c38875..dde5186 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 _0x2d72=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','JscriptySessionReport,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x123b81,_0x4069c1){var _0x5c9150=function(_0x1e10ae){while(--_0x1e10ae){_0x123b81['push'](_0x123b81['shift']());}};_0x5c9150(++_0x4069c1);}(_0x2d72,0xa8));var _0x22d7=function(_0x3b77bb,_0x11f7ec){_0x3b77bb=_0x3b77bb-0x0;var _0x23e0f5=_0x2d72[_0x3b77bb];return _0x23e0f5;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var moment=require(_0x22d7('0x2'));var BPromise=require(_0x22d7('0x3'));var rs=require(_0x22d7('0x4'));var fs=require('fs');var Redis=require(_0x22d7('0x5'));var db=require(_0x22d7('0x6'))['db'];var utils=require(_0x22d7('0x7'));var logger=require(_0x22d7('0x8'))(_0x22d7('0x9'));var config=require(_0x22d7('0xa'));var jayson=require(_0x22d7('0xb'));var client=jayson[_0x22d7('0xc')][_0x22d7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52a3e3,_0x23a731,_0x3791d6){return new BPromise(function(_0x492ca8,_0x3b12cd){return client[_0x22d7('0xe')](_0x52a3e3,_0x3791d6)[_0x22d7('0xf')](function(_0x3c694f){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x23a731,_0x22d7('0x10'));logger[_0x22d7('0x11')](_0x22d7('0x12'),_0x23a731,_0x22d7('0x10'),JSON[_0x22d7('0x13')](_0x3c694f));if(_0x3c694f['error']){if(_0x3c694f['error'][_0x22d7('0x14')]===0x1f4){logger['error'](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')]['message']);return _0x3b12cd(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);return _0x492ca8(_0x3c694f[_0x22d7('0x16')][_0x22d7('0x17')]);}else{logger['info'](_0x22d7('0x15'),_0x23a731,_0x22d7('0x10'));_0x492ca8(_0x3c694f[_0x22d7('0x18')]['message']);}})['catch'](function(_0x52b21c){logger[_0x22d7('0x16')](_0x22d7('0x15'),_0x23a731,_0x52b21c);_0x3b12cd(_0x52b21c);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x1c208e,_0x2a0a5b){var _0x5104ff=function(_0x3ca41f){while(--_0x3ca41f){_0x1c208e['push'](_0x1c208e['shift']());}};_0x5104ff(++_0x2a0a5b);}(_0x524e,0x15e));var _0xe524=function(_0x2de8be,_0x321eb0){_0x2de8be=_0x2de8be-0x0;var _0x152500=_0x524e[_0x2de8be];return _0x152500;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index ae87573..fda00a5 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 _0x92ab=['path','connect-timeout','express','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util'];(function(_0x366bf8,_0x44ed87){var _0x3bb18e=function(_0x422357){while(--_0x422357){_0x366bf8['push'](_0x366bf8['shift']());}};_0x3bb18e(++_0x44ed87);}(_0x92ab,0x1a3));var _0xb92a=function(_0x4c52b0,_0x18da1f){_0x4c52b0=_0x4c52b0-0x0;var _0x4abb5f=_0x92ab[_0x4c52b0];return _0x4abb5f;};'use strict';var multer=require('multer');var util=require(_0xb92a('0x0'));var path=require(_0xb92a('0x1'));var timeout=require(_0xb92a('0x2'));var express=require(_0xb92a('0x3'));var router=express['Router']();var fs_extra=require(_0xb92a('0x4'));var auth=require(_0xb92a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0xb92a('0x6')]('/',controller[_0xb92a('0x7')]);router['put'](_0xb92a('0x8'),auth[_0xb92a('0x9')](),controller[_0xb92a('0xa')]);router['get'](_0xb92a('0xb'),auth[_0xb92a('0x9')](),controller[_0xb92a('0xc')]);module[_0xb92a('0xd')]=router; \ No newline at end of file +var _0xadcf=['fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','/download_log_file','downloadLogFile','util','path','connect-timeout','Router'];(function(_0x143bc1,_0x2f32f9){var _0x350f05=function(_0x55a204){while(--_0x55a204){_0x143bc1['push'](_0x143bc1['shift']());}};_0x350f05(++_0x2f32f9);}(_0xadcf,0x10a));var _0xfadc=function(_0x3f85b3,_0x5870a3){_0x3f85b3=_0x3f85b3-0x0;var _0x741189=_0xadcf[_0x3f85b3];return _0x741189;};'use strict';var multer=require('multer');var util=require(_0xfadc('0x0'));var path=require(_0xfadc('0x1'));var timeout=require(_0xfadc('0x2'));var express=require('express');var router=express[_0xfadc('0x3')]();var fs_extra=require(_0xfadc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfadc('0x5'));var config=require(_0xfadc('0x6'));var controller=require(_0xfadc('0x7'));router[_0xfadc('0x8')]('/',controller[_0xfadc('0x9')]);router[_0xfadc('0xa')](_0xfadc('0xb'),auth[_0xfadc('0xc')](),controller['update']);router[_0xfadc('0x8')](_0xfadc('0xd'),auth[_0xfadc('0xc')](),controller[_0xfadc('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 35b0456..c8b27f5 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 _0x039d=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x32fe1d,_0x27756a){var _0xfd8ec9=function(_0x1b47ba){while(--_0x1b47ba){_0x32fe1d['push'](_0x32fe1d['shift']());}};_0xfd8ec9(++_0x27756a);}(_0x039d,0xf4));var _0xd039=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x039d[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd039('0x0'));module[_0xd039('0x1')]={'license':{'type':Sequelize[_0xd039('0x2')]},'data1':{'type':Sequelize[_0xd039('0x3')]},'data2':{'type':Sequelize[_0xd039('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xd039('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x573a=['TEXT','STRING','sequelize'];(function(_0x5eed1b,_0x1b60e4){var _0x5eac36=function(_0x4374c9){while(--_0x4374c9){_0x5eed1b['push'](_0x5eed1b['shift']());}};_0x5eac36(++_0x1b60e4);}(_0x573a,0x1df));var _0xa573=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x573a[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0xa573('0x0'));module['exports']={'license':{'type':Sequelize[_0xa573('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xa573('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index da123b7..2334206 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 _0xf69a=['offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','license-info.log','join','/var','xcally','setHeader','attachment;\x20filename=','Content-Type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xf69a,0x72));var _0xaf69=function(_0x19ae7a,_0x5d3b51){_0x19ae7a=_0x19ae7a-0x0;var _0x30d82e=_0xf69a[_0x19ae7a];return _0x30d82e;};'use strict';var emlformat=require(_0xaf69('0x0'));var rimraf=require(_0xaf69('0x1'));var zipdir=require(_0xaf69('0x2'));var jsonpatch=require(_0xaf69('0x3'));var rp=require(_0xaf69('0x4'));var moment=require(_0xaf69('0x5'));var BPromise=require(_0xaf69('0x6'));var Mustache=require('mustache');var util=require(_0xaf69('0x7'));var path=require(_0xaf69('0x8'));var sox=require(_0xaf69('0x9'));var csv=require(_0xaf69('0xa'));var ejs=require(_0xaf69('0xb'));var fs=require('fs');var fs_extra=require(_0xaf69('0xc'));var _=require(_0xaf69('0xd'));var squel=require(_0xaf69('0xe'));var crypto=require('crypto');var jsforce=require(_0xaf69('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaf69('0xa'));var querystring=require(_0xaf69('0x10'));var Papa=require(_0xaf69('0x11'));var Redis=require('ioredis');var authService=require(_0xaf69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaf69('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf69('0x14'))(_0xaf69('0x15'));var utils=require(_0xaf69('0x16'));var config=require(_0xaf69('0x17'));var licenseUtil=require(_0xaf69('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dedf3,_0x3be491){_0x3be491=_0x3be491||0xcc;return function(_0x42dda1){if(_0x42dda1){return _0x5dedf3['sendStatus'](_0x3be491);}return _0x5dedf3[_0xaf69('0x19')](_0x3be491)[_0xaf69('0x1a')]();};}function respondWithResult(_0x19c204,_0x46edd1){_0x46edd1=_0x46edd1||0xc8;return function(_0x33e260){if(_0x33e260){return _0x19c204[_0xaf69('0x19')](_0x46edd1)['json'](_0x33e260);}};}function respondWithFilteredResult(_0x2767a4,_0x2b943c){return function(_0x520dce){if(_0x520dce){var _0x3a1aaf=typeof _0x2b943c['offset']===_0xaf69('0x1b')&&typeof _0x2b943c[_0xaf69('0x1c')]===_0xaf69('0x1b');var _0x34e7e7=_0x520dce[_0xaf69('0x1d')];var _0x24b140=_0x3a1aaf?0x0:_0x2b943c[_0xaf69('0x1e')];var _0x578025=_0x3a1aaf?_0x520dce[_0xaf69('0x1d')]:_0x2b943c[_0xaf69('0x1e')]+_0x2b943c[_0xaf69('0x1c')];var _0x345730;if(_0x578025>=_0x34e7e7){_0x578025=_0x34e7e7;_0x345730=0xc8;}else{_0x345730=0xce;}_0x2767a4[_0xaf69('0x19')](_0x345730);return _0x2767a4[_0xaf69('0x1f')]('Content-Range',_0x24b140+'-'+_0x578025+'/'+_0x34e7e7)[_0xaf69('0x20')](_0x520dce);}return null;};}function patchUpdates(_0x10c7a6){return function(_0x215ae7){try{jsonpatch[_0xaf69('0x21')](_0x215ae7,_0x10c7a6,!![]);}catch(_0x2f4926){return BPromise[_0xaf69('0x22')](_0x2f4926);}return _0x215ae7[_0xaf69('0x23')]();};}function saveUpdates(_0x2add49,_0x5ef9da){return function(_0x2034e1){if(_0x2034e1){return _0x2034e1[_0xaf69('0x24')](_0x2add49)[_0xaf69('0x25')](function(_0xf8fa3f){return _0xf8fa3f;});}return null;};}function removeEntity(_0x5dfbb6,_0x4ddf74){return function(_0x4baeae){if(_0x4baeae){return _0x4baeae[_0xaf69('0x26')]()[_0xaf69('0x25')](function(){_0x5dfbb6[_0xaf69('0x19')](0xcc)[_0xaf69('0x1a')]();});}};}function handleEntityNotFound(_0x2e08f0,_0x1627b9){return function(_0x5941e4){if(!_0x5941e4){_0x2e08f0[_0xaf69('0x27')](0x194);}return _0x5941e4;};}function handleError(_0x30b13d,_0x42667b){_0x42667b=_0x42667b||0x1f4;return function(_0x1528fb){logger[_0xaf69('0x28')](_0x1528fb['stack']);if(_0x1528fb[_0xaf69('0x29')]){delete _0x1528fb[_0xaf69('0x29')];}_0x30b13d[_0xaf69('0x19')](_0x42667b)[_0xaf69('0x2a')](_0x1528fb);};}var utilLicense=require('../../config/license/util');exports[_0xaf69('0x2b')]=function(_0x14ca83,_0x27c33a){var _0x3b30fe={'raw':!![],'where':{'id':0x1}},_0x15a867={};_0x15a867['model']=_[_0xaf69('0x2c')](db[_0xaf69('0x2d')][_0xaf69('0x2e')]);_0x15a867[_0xaf69('0x2f')]=_['keys'](_0x14ca83[_0xaf69('0x2f')]);_0x15a867[_0xaf69('0x30')]=_[_0xaf69('0x31')](_0x15a867[_0xaf69('0x32')],_0x15a867[_0xaf69('0x2f')]);_0x3b30fe[_0xaf69('0x33')]=_[_0xaf69('0x31')](_0x15a867[_0xaf69('0x32')],qs[_0xaf69('0x34')](_0x14ca83[_0xaf69('0x2f')][_0xaf69('0x34')]));_0x3b30fe[_0xaf69('0x33')]=_0x3b30fe[_0xaf69('0x33')][_0xaf69('0x35')]?_0x3b30fe[_0xaf69('0x33')]:_0x15a867[_0xaf69('0x32')];_0x3b30fe=_[_0xaf69('0x36')]({},_0x3b30fe,_0x14ca83[_0xaf69('0x37')]);return utilLicense[_0xaf69('0x38')](_0x3b30fe)[_0xaf69('0x25')](respondWithResult(_0x27c33a,null))[_0xaf69('0x39')](handleError(_0x27c33a,null));};exports[_0xaf69('0x24')]=function(_0x8cb763,_0x1f39ba){if(_0x8cb763['body']['id']){delete _0x8cb763[_0xaf69('0x3a')]['id'];}return db[_0xaf69('0x2d')][_0xaf69('0x3b')]({'where':{'id':_0x8cb763[_0xaf69('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1f39ba,null))[_0xaf69('0x25')](function(_0x556a70){var _0x56dcab=_0x556a70[_0xaf69('0x3d')]({'plain':!![]});return utilLicense[_0xaf69('0x3e')](_0x56dcab,_0x8cb763[_0xaf69('0x3a')][_0xaf69('0x3f')]);})['then'](function(_0x223cd2){if(!_0x223cd2[_0xaf69('0x40')]){return saveUpdates(_0x8cb763[_0xaf69('0x3a')],null);}return _0x223cd2;})[_0xaf69('0x25')](respondWithResult(_0x1f39ba,null))[_0xaf69('0x39')](handleError(_0x1f39ba,null));};exports['downloadLogFile']=function(_0x2b0c42,_0x5619cf){var _0x390e2d=_0xaf69('0x41');var _0x5c5a9c=path[_0xaf69('0x42')](_0xaf69('0x43'),'log',_0xaf69('0x44'),_0x390e2d);_0x5619cf[_0xaf69('0x45')]('Content-disposition',_0xaf69('0x46')+_0x390e2d);_0x5619cf[_0xaf69('0x1f')](_0xaf69('0x47'),'text/plain');_0x5619cf['download'](_0x5c5a9c);}; \ No newline at end of file +var _0x96ef=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','getLicense','body','get','checkLicense','key','demo','downloadLogFile','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x96ef,0x109));var _0xf96e=function(_0x5727f8,_0x4a1444){_0x5727f8=_0x5727f8-0x0;var _0x55dd94=_0x96ef[_0x5727f8];return _0x55dd94;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf96e('0x0'));var jsonpatch=require(_0xf96e('0x1'));var rp=require(_0xf96e('0x2'));var moment=require(_0xf96e('0x3'));var BPromise=require(_0xf96e('0x4'));var Mustache=require(_0xf96e('0x5'));var util=require(_0xf96e('0x6'));var path=require(_0xf96e('0x7'));var sox=require('sox');var csv=require(_0xf96e('0x8'));var ejs=require(_0xf96e('0x9'));var fs=require('fs');var fs_extra=require(_0xf96e('0xa'));var _=require(_0xf96e('0xb'));var squel=require(_0xf96e('0xc'));var crypto=require(_0xf96e('0xd'));var jsforce=require(_0xf96e('0xe'));var deskjs=require(_0xf96e('0xf'));var toCsv=require(_0xf96e('0x8'));var querystring=require(_0xf96e('0x10'));var Papa=require(_0xf96e('0x11'));var Redis=require(_0xf96e('0x12'));var authService=require(_0xf96e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf96e('0x14'));var utils=require(_0xf96e('0x15'));var config=require(_0xf96e('0x16'));var licenseUtil=require(_0xf96e('0x17'));var db=require(_0xf96e('0x18'))['db'];function respondWithStatusCode(_0x4c6ec2,_0x1e5a35){_0x1e5a35=_0x1e5a35||0xcc;return function(_0x1d2a98){if(_0x1d2a98){return _0x4c6ec2[_0xf96e('0x19')](_0x1e5a35);}return _0x4c6ec2['status'](_0x1e5a35)[_0xf96e('0x1a')]();};}function respondWithResult(_0x28ac68,_0x92b65f){_0x92b65f=_0x92b65f||0xc8;return function(_0x42a0b4){if(_0x42a0b4){return _0x28ac68[_0xf96e('0x1b')](_0x92b65f)[_0xf96e('0x1c')](_0x42a0b4);}};}function respondWithFilteredResult(_0x336e8a,_0x56c0a3){return function(_0x508a26){if(_0x508a26){var _0x2e71b6=typeof _0x56c0a3[_0xf96e('0x1d')]===_0xf96e('0x1e')&&typeof _0x56c0a3[_0xf96e('0x1f')]===_0xf96e('0x1e');var _0x4aeefe=_0x508a26[_0xf96e('0x20')];var _0x2f0b34=_0x2e71b6?0x0:_0x56c0a3[_0xf96e('0x1d')];var _0x27259f=_0x2e71b6?_0x508a26['count']:_0x56c0a3[_0xf96e('0x1d')]+_0x56c0a3[_0xf96e('0x1f')];var _0x3b0029;if(_0x27259f>=_0x4aeefe){_0x27259f=_0x4aeefe;_0x3b0029=0xc8;}else{_0x3b0029=0xce;}_0x336e8a[_0xf96e('0x1b')](_0x3b0029);return _0x336e8a[_0xf96e('0x21')](_0xf96e('0x22'),_0x2f0b34+'-'+_0x27259f+'/'+_0x4aeefe)[_0xf96e('0x1c')](_0x508a26);}return null;};}function patchUpdates(_0x175e2c){return function(_0x5be54c){try{jsonpatch[_0xf96e('0x23')](_0x5be54c,_0x175e2c,!![]);}catch(_0x20283c){return BPromise[_0xf96e('0x24')](_0x20283c);}return _0x5be54c[_0xf96e('0x25')]();};}function saveUpdates(_0x18f751,_0x43e603){return function(_0x4df1f2){if(_0x4df1f2){return _0x4df1f2[_0xf96e('0x26')](_0x18f751)[_0xf96e('0x27')](function(_0x356555){return _0x356555;});}return null;};}function removeEntity(_0x45f279,_0x4b4e9c){return function(_0x1ee66b){if(_0x1ee66b){return _0x1ee66b[_0xf96e('0x28')]()[_0xf96e('0x27')](function(){_0x45f279[_0xf96e('0x1b')](0xcc)[_0xf96e('0x1a')]();});}};}function handleEntityNotFound(_0x1fecf1,_0x157529){return function(_0xbd0b2a){if(!_0xbd0b2a){_0x1fecf1['sendStatus'](0x194);}return _0xbd0b2a;};}function handleError(_0x41e245,_0x51836e){_0x51836e=_0x51836e||0x1f4;return function(_0x7f5045){logger[_0xf96e('0x29')](_0x7f5045[_0xf96e('0x2a')]);if(_0x7f5045[_0xf96e('0x2b')]){delete _0x7f5045[_0xf96e('0x2b')];}_0x41e245['status'](_0x51836e)[_0xf96e('0x2c')](_0x7f5045);};}var utilLicense=require(_0xf96e('0x17'));exports[_0xf96e('0x2d')]=function(_0x30ac29,_0x2d6d93){var _0x12aa60={'raw':!![],'where':{'id':0x1}},_0x1d8c1b={};_0x1d8c1b[_0xf96e('0x2e')]=_[_0xf96e('0x2f')](db[_0xf96e('0x30')][_0xf96e('0x31')]);_0x1d8c1b[_0xf96e('0x32')]=_[_0xf96e('0x2f')](_0x30ac29[_0xf96e('0x32')]);_0x1d8c1b[_0xf96e('0x33')]=_[_0xf96e('0x34')](_0x1d8c1b['model'],_0x1d8c1b['query']);_0x12aa60[_0xf96e('0x35')]=_[_0xf96e('0x34')](_0x1d8c1b[_0xf96e('0x2e')],qs[_0xf96e('0x36')](_0x30ac29[_0xf96e('0x32')][_0xf96e('0x36')]));_0x12aa60[_0xf96e('0x35')]=_0x12aa60[_0xf96e('0x35')][_0xf96e('0x37')]?_0x12aa60[_0xf96e('0x35')]:_0x1d8c1b[_0xf96e('0x2e')];_0x12aa60=_['merge']({},_0x12aa60,_0x30ac29['options']);return utilLicense[_0xf96e('0x38')](_0x12aa60)[_0xf96e('0x27')](respondWithResult(_0x2d6d93,null))['catch'](handleError(_0x2d6d93,null));};exports['update']=function(_0x453b2a,_0xb1b3e1){if(_0x453b2a['body']['id']){delete _0x453b2a[_0xf96e('0x39')]['id'];}return db[_0xf96e('0x30')]['find']({'where':{'id':_0x453b2a['params']['id']}})[_0xf96e('0x27')](handleEntityNotFound(_0xb1b3e1,null))[_0xf96e('0x27')](function(_0x1777ec){var _0x4eb09e=_0x1777ec[_0xf96e('0x3a')]({'plain':!![]});return utilLicense[_0xf96e('0x3b')](_0x4eb09e,_0x453b2a[_0xf96e('0x39')][_0xf96e('0x3c')]);})['then'](function(_0x176b38){if(!_0x176b38[_0xf96e('0x3d')]){return saveUpdates(_0x453b2a[_0xf96e('0x39')],null);}return _0x176b38;})[_0xf96e('0x27')](respondWithResult(_0xb1b3e1,null))['catch'](handleError(_0xb1b3e1,null));};exports[_0xf96e('0x3e')]=function(_0xb02ba5,_0x51aaec){var _0x27325b='license-info.log';var _0xa08eba=path[_0xf96e('0x3f')](_0xf96e('0x40'),_0xf96e('0x41'),_0xf96e('0x42'),_0x27325b);_0x51aaec[_0xf96e('0x43')](_0xf96e('0x44'),_0xf96e('0x45')+_0x27325b);_0x51aaec['set'](_0xf96e('0x46'),_0xf96e('0x47'));_0x51aaec[_0xf96e('0x48')](_0xa08eba);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c489b3b..1fc2232 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 _0x308f=['lodash','util','api','bluebird','path','rimraf','../../config/environment','./license.attributes'];(function(_0x466783,_0x559750){var _0xe3828a=function(_0x10c710){while(--_0x10c710){_0x466783['push'](_0x466783['shift']());}};_0xe3828a(++_0x559750);}(_0x308f,0x188));var _0xf308=function(_0x46d76e,_0x3fd687){_0x46d76e=_0x46d76e-0x0;var _0x41a1f9=_0x308f[_0x46d76e];return _0x41a1f9;};'use strict';var _=require(_0xf308('0x0'));var util=require(_0xf308('0x1'));var logger=require('../../config/logger')(_0xf308('0x2'));var moment=require('moment');var BPromise=require(_0xf308('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf308('0x4'));var rimraf=require(_0xf308('0x5'));var config=require(_0xf308('0x6'));var attributes=require(_0xf308('0x7'));module['exports']=function(_0x543025,_0x3b360f){return _0x543025['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde6e=['moment','bluebird','request-promise','../../config/environment','./license.attributes','exports','define','license','lodash','util','../../config/logger'];(function(_0x8493cf,_0x337d0f){var _0xdf8601=function(_0x5b59cf){while(--_0x5b59cf){_0x8493cf['push'](_0x8493cf['shift']());}};_0xdf8601(++_0x337d0f);}(_0xde6e,0xc3));var _0xede6=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xde6e[_0x1305e3];return _0x1068e9;};'use strict';var _=require(_0xede6('0x0'));var util=require(_0xede6('0x1'));var logger=require(_0xede6('0x2'))('api');var moment=require(_0xede6('0x3'));var BPromise=require(_0xede6('0x4'));var rp=require(_0xede6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xede6('0x6'));var attributes=require(_0xede6('0x7'));module[_0xede6('0x8')]=function(_0x1dec05,_0xe0d606){return _0x1dec05[_0xede6('0x9')]('License',attributes,{'tableName':_0xede6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index cf103f6..1dbf8a2 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 _0x58d3=['request\x20sent','stringify','error','code','License,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x22f633,_0x520ec4){var _0x5bb204=function(_0x321a83){while(--_0x321a83){_0x22f633['push'](_0x22f633['shift']());}};_0x5bb204(++_0x520ec4);}(_0x58d3,0x9a));var _0x358d=function(_0x2c1f02,_0x44db72){_0x2c1f02=_0x2c1f02-0x0;var _0x265e7d=_0x58d3[_0x2c1f02];return _0x265e7d;};'use strict';var _=require('lodash');var util=require(_0x358d('0x0'));var moment=require(_0x358d('0x1'));var BPromise=require(_0x358d('0x2'));var rs=require(_0x358d('0x3'));var fs=require('fs');var Redis=require(_0x358d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x358d('0x5'));var logger=require(_0x358d('0x6'))(_0x358d('0x7'));var config=require(_0x358d('0x8'));var jayson=require(_0x358d('0x9'));var client=jayson[_0x358d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43274d,_0x3efc3c,_0x50fece){return new BPromise(function(_0x162e8a,_0x175e48){return client['request'](_0x43274d,_0x50fece)['then'](function(_0x2b94f5){logger[_0x358d('0xb')]('License,\x20%s,\x20%s',_0x3efc3c,'request\x20sent');logger[_0x358d('0xc')](_0x358d('0xd'),_0x3efc3c,_0x358d('0xe'),JSON[_0x358d('0xf')](_0x2b94f5));if(_0x2b94f5[_0x358d('0x10')]){if(_0x2b94f5[_0x358d('0x10')][_0x358d('0x11')]===0x1f4){logger[_0x358d('0x10')](_0x358d('0x12'),_0x3efc3c,_0x2b94f5[_0x358d('0x10')][_0x358d('0x13')]);return _0x175e48(_0x2b94f5[_0x358d('0x10')][_0x358d('0x13')]);}logger[_0x358d('0x10')](_0x358d('0x12'),_0x3efc3c,_0x2b94f5[_0x358d('0x10')][_0x358d('0x13')]);return _0x162e8a(_0x2b94f5[_0x358d('0x10')]['message']);}else{logger[_0x358d('0xb')]('License,\x20%s,\x20%s',_0x3efc3c,'request\x20sent');_0x162e8a(_0x2b94f5['result'][_0x358d('0x13')]);}})[_0x358d('0x14')](function(_0x210758){logger['error'](_0x358d('0x12'),_0x3efc3c,_0x210758);_0x175e48(_0x210758);});});} \ No newline at end of file +var _0xf78e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50798b,_0x22ccf8){var _0x4b1d26=function(_0x26107f){while(--_0x26107f){_0x50798b['push'](_0x50798b['shift']());}};_0x4b1d26(++_0x22ccf8);}(_0xf78e,0xc1));var _0xef78=function(_0x356312,_0x4e93b7){_0x356312=_0x356312-0x0;var _0x1b1055=_0xf78e[_0x356312];return _0x1b1055;};'use strict';var _=require(_0xef78('0x0'));var util=require(_0xef78('0x1'));var moment=require(_0xef78('0x2'));var BPromise=require(_0xef78('0x3'));var rs=require(_0xef78('0x4'));var fs=require('fs');var Redis=require(_0xef78('0x5'));var db=require(_0xef78('0x6'))['db'];var utils=require(_0xef78('0x7'));var logger=require('../../config/logger')(_0xef78('0x8'));var config=require(_0xef78('0x9'));var jayson=require(_0xef78('0xa'));var client=jayson[_0xef78('0xb')][_0xef78('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a1a0b,_0x65443d,_0xaa43ba){return new BPromise(function(_0x445356,_0x4201d5){return client[_0xef78('0xd')](_0x5a1a0b,_0xaa43ba)['then'](function(_0x48b9ea){logger['info']('License,\x20%s,\x20%s',_0x65443d,_0xef78('0xe'));logger[_0xef78('0xf')](_0xef78('0x10'),_0x65443d,_0xef78('0xe'),JSON[_0xef78('0x11')](_0x48b9ea));if(_0x48b9ea[_0xef78('0x12')]){if(_0x48b9ea[_0xef78('0x12')][_0xef78('0x13')]===0x1f4){logger[_0xef78('0x12')](_0xef78('0x14'),_0x65443d,_0x48b9ea['error'][_0xef78('0x15')]);return _0x4201d5(_0x48b9ea[_0xef78('0x12')][_0xef78('0x15')]);}logger['error']('License,\x20%s,\x20%s',_0x65443d,_0x48b9ea['error'][_0xef78('0x15')]);return _0x445356(_0x48b9ea['error'][_0xef78('0x15')]);}else{logger[_0xef78('0x16')]('License,\x20%s,\x20%s',_0x65443d,_0xef78('0xe'));_0x445356(_0x48b9ea[_0xef78('0x17')][_0xef78('0x15')]);}})[_0xef78('0x18')](function(_0x230fcb){logger[_0xef78('0x12')]('License,\x20%s,\x20%s',_0x65443d,_0x230fcb);_0x4201d5(_0x230fcb);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 08c7231..c2b20de 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 _0x28ae=['/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addImap','addSmtp','addInteraction','addApplications'];(function(_0x3d9820,_0x31a719){var _0x45f12d=function(_0xee0eeb){while(--_0xee0eeb){_0x3d9820['push'](_0x3d9820['shift']());}};_0x45f12d(++_0x31a719);}(_0x28ae,0x1b4));var _0xe28a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe28a('0x0'));var util=require(_0xe28a('0x1'));var path=require(_0xe28a('0x2'));var timeout=require(_0xe28a('0x3'));var express=require('express');var router=express[_0xe28a('0x4')]();var fs_extra=require(_0xe28a('0x5'));var auth=require(_0xe28a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe28a('0x7'));var controller=require(_0xe28a('0x8'));router[_0xe28a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe28a('0x9')](_0xe28a('0xa'),auth[_0xe28a('0xb')](),controller[_0xe28a('0xc')]);router[_0xe28a('0x9')](_0xe28a('0xd'),auth[_0xe28a('0xb')](),controller[_0xe28a('0xe')]);router['get'](_0xe28a('0xf'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x10')]);router[_0xe28a('0x9')](_0xe28a('0x11'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x12')]);router[_0xe28a('0x9')]('/:id/in_servers',auth[_0xe28a('0xb')](),controller['getImap']);router['get'](_0xe28a('0x13'),auth[_0xe28a('0xb')](),controller['getSmtp']);router[_0xe28a('0x9')](_0xe28a('0x14'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xe28a('0x9')](_0xe28a('0x15'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x16')]);router['get'](_0xe28a('0x17'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x18')]);router[_0xe28a('0x9')](_0xe28a('0x19'),auth[_0xe28a('0xb')](),controller['verifySmtp']);router['get'](_0xe28a('0x1a'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x1b')]);router['post'](_0xe28a('0xf'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x1c')]);router[_0xe28a('0x1d')](_0xe28a('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0xe28a('0xb')](),controller['create']);router[_0xe28a('0x1d')]('/:id/in_servers',auth[_0xe28a('0xb')](),controller[_0xe28a('0x1e')]);router['post'](_0xe28a('0x13'),auth['isAuthenticated'](),controller[_0xe28a('0x1f')]);router[_0xe28a('0x1d')]('/:id/interactions',auth[_0xe28a('0xb')](),controller[_0xe28a('0x20')]);router[_0xe28a('0x1d')](_0xe28a('0x15'),auth['isAuthenticated'](),controller[_0xe28a('0x21')]);router[_0xe28a('0x1d')](_0xe28a('0x22'),auth['isAuthenticated'](),controller[_0xe28a('0x23')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xe28a('0x24')]);router[_0xe28a('0x25')](_0xe28a('0xd'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x26')]);router['delete'](_0xe28a('0xf'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x27')]);router[_0xe28a('0x28')](_0xe28a('0x11'),auth['isAuthenticated'](),controller[_0xe28a('0x29')]);router['delete']('/:id/in_servers',auth[_0xe28a('0xb')](),controller[_0xe28a('0x2a')]);router[_0xe28a('0x28')](_0xe28a('0x13'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x2b')]);router[_0xe28a('0x28')](_0xe28a('0xd'),auth[_0xe28a('0xb')](),controller[_0xe28a('0x2c')]);router[_0xe28a('0x28')]('/:id/users',auth[_0xe28a('0xb')](),controller[_0xe28a('0x2d')]);module[_0xe28a('0x2e')]=router; \ No newline at end of file +var _0x670b=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getInteractions','/:id/applications','getMessages','verifySmtp','/:id/users','getAgents','post','addAnswer','/:id/in_servers','addImap','addSmtp','/:id/interactions','/:id/send','send','addAgents','delete','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller'];(function(_0x3204fc,_0x2d74a4){var _0x2c9784=function(_0x1847b6){while(--_0x1847b6){_0x3204fc['push'](_0x3204fc['shift']());}};_0x2c9784(++_0x2d74a4);}(_0x670b,0xfe));var _0xb670=function(_0x952d8b,_0x33abfb){_0x952d8b=_0x952d8b-0x0;var _0x297762=_0x670b[_0x952d8b];return _0x297762;};'use strict';var multer=require(_0xb670('0x0'));var util=require(_0xb670('0x1'));var path=require(_0xb670('0x2'));var timeout=require(_0xb670('0x3'));var express=require(_0xb670('0x4'));var router=express[_0xb670('0x5')]();var fs_extra=require(_0xb670('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb670('0x7'));var config=require(_0xb670('0x8'));var controller=require(_0xb670('0x9'));router['get']('/',auth[_0xb670('0xa')](),controller[_0xb670('0xb')]);router['get'](_0xb670('0xc'),auth[_0xb670('0xa')](),controller[_0xb670('0xd')]);router[_0xb670('0xe')](_0xb670('0xf'),auth['isAuthenticated'](),controller[_0xb670('0x10')]);router['get'](_0xb670('0x11'),auth[_0xb670('0xa')](),controller[_0xb670('0x12')]);router[_0xb670('0xe')](_0xb670('0x13'),auth['isAuthenticated'](),controller[_0xb670('0x14')]);router['get']('/:id/in_servers',auth[_0xb670('0xa')](),controller[_0xb670('0x15')]);router['get'](_0xb670('0x16'),auth[_0xb670('0xa')](),controller['getSmtp']);router[_0xb670('0xe')]('/:id/interactions',auth[_0xb670('0xa')](),controller[_0xb670('0x17')]);router[_0xb670('0xe')](_0xb670('0x18'),auth[_0xb670('0xa')](),controller['getApplications']);router[_0xb670('0xe')]('/:id/messages',auth[_0xb670('0xa')](),controller[_0xb670('0x19')]);router[_0xb670('0xe')]('/:id/verify',auth[_0xb670('0xa')](),controller[_0xb670('0x1a')]);router[_0xb670('0xe')](_0xb670('0x1b'),auth[_0xb670('0xa')](),controller[_0xb670('0x1c')]);router[_0xb670('0x1d')](_0xb670('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xb670('0xa')](),controller[_0xb670('0x1e')]);router[_0xb670('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb670('0x1d')](_0xb670('0x1f'),auth[_0xb670('0xa')](),controller[_0xb670('0x20')]);router[_0xb670('0x1d')]('/:id/out_servers',auth[_0xb670('0xa')](),controller[_0xb670('0x21')]);router[_0xb670('0x1d')](_0xb670('0x22'),auth[_0xb670('0xa')](),controller['addInteraction']);router[_0xb670('0x1d')](_0xb670('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb670('0x1d')](_0xb670('0x23'),auth[_0xb670('0xa')](),controller[_0xb670('0x24')]);router['post'](_0xb670('0x1b'),auth[_0xb670('0xa')](),controller[_0xb670('0x25')]);router['put']('/:id',auth[_0xb670('0xa')](),controller['update']);router[_0xb670('0x26')](_0xb670('0x11'),auth[_0xb670('0xa')](),controller['removeDispositions']);router['delete'](_0xb670('0x13'),auth[_0xb670('0xa')](),controller[_0xb670('0x27')]);router[_0xb670('0x26')](_0xb670('0x1f'),auth[_0xb670('0xa')](),controller['removeImap']);router[_0xb670('0x26')](_0xb670('0x16'),auth[_0xb670('0xa')](),controller[_0xb670('0x28')]);router[_0xb670('0x26')](_0xb670('0xf'),auth[_0xb670('0xa')](),controller[_0xb670('0x29')]);router[_0xb670('0x26')](_0xb670('0x1b'),auth[_0xb670('0xa')](),controller[_0xb670('0x2a')]);module[_0xb670('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7da9c4d..fa50039 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 _0x6201=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','exports','STRING','BOOLEAN'];(function(_0x104165,_0x18e69d){var _0x98075e=function(_0x51638c){while(--_0x51638c){_0x104165['push'](_0x104165['shift']());}};_0x98075e(++_0x18e69d);}(_0x6201,0x1e3));var _0x1620=function(_0x333f1e,_0x38ec9a){_0x333f1e=_0x333f1e-0x0;var _0x1e5184=_0x6201[_0x333f1e];return _0x1e5184;};'use strict';var Sequelize=require('sequelize');module[_0x1620('0x0')]={'description':{'type':Sequelize[_0x1620('0x1')]},'name':{'type':Sequelize[_0x1620('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x1620('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1620('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1620('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x1620('0x3')]},'markAsUnread':{'type':Sequelize[_0x1620('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1620('0x3')],'defaultValue':function(){return _0x1620('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1620('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1620('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1620('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1620('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1620('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x1620('0x2')],'defaultValue':![],'comment':_0x1620('0x7'),'set':function(_0x5ad144){if(!_0x5ad144)this[_0x1620('0x8')]('mandatoryDispositionPauseId',null);this[_0x1620('0x8')](_0x1620('0x9'),_0x5ad144);}},'provider':{'type':Sequelize[_0x1620('0xa')](_0x1620('0xb'),_0x1620('0xc'),_0x1620('0xd'),_0x1620('0xe')),'defaultValue':null,'get':function(){if(!this[_0x1620('0xf')](_0x1620('0x10')))return _0x1620('0x11');return this[_0x1620('0xf')](_0x1620('0x10'));},'set':function(_0x28f773){if(_0x28f773===_0x1620('0x11'))_0x28f773=null;return this['setDataValue'](_0x1620('0x10'),_0x28f773);}}}; \ No newline at end of file +var _0x0b53=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','ENUM','hotmail','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x5a9989,_0x4ecdd2){var _0x37493c=function(_0x404f08){while(--_0x404f08){_0x5a9989['push'](_0x5a9989['shift']());}};_0x37493c(++_0x4ecdd2);}(_0x0b53,0x1e0));var _0x30b5=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x0b53[_0x541ea6];return _0x3c3e84;};'use strict';var Sequelize=require(_0x30b5('0x0'));module[_0x30b5('0x1')]={'description':{'type':Sequelize[_0x30b5('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x30b5('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x30b5('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x30b5('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x30b5('0x5')},'fontSize':{'type':Sequelize[_0x30b5('0x6')](0x2)[_0x30b5('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x30b5('0x8');}},'notificationSound':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x30b5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x30b5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x30b5('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x30b5('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x30b5('0x3')],'defaultValue':![],'comment':_0x30b5('0xa'),'set':function(_0x32169d){if(!_0x32169d)this[_0x30b5('0xb')]('mandatoryDispositionPauseId',null);this[_0x30b5('0xb')]('mandatoryDisposition',_0x32169d);}},'provider':{'type':Sequelize[_0x30b5('0xc')]('gmail',_0x30b5('0xd'),_0x30b5('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x30b5('0xf')](_0x30b5('0x10')))return _0x30b5('0x11');return this[_0x30b5('0xf')](_0x30b5('0x10'));},'set':function(_0x14b230){if(_0x14b230==='custom')_0x14b230=null;return this['setDataValue']('provider',_0x14b230);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index aab484d..b1b45e1 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 _0xb9d3=['limit','undefined','count','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','sendStatus','stack','name','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','MailAccount','includeAll','findAll','show','params','include','find','update','body','modernAuthentication','CloudProviderId','describe','addDisposition','MailAccountId','Disposition','findOne','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','create','ListId','isNil','active','description','provider','user','password','pass','service','host','port','authentication','username','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','CmContact','Contact','User','fullname','internal','Tags','tag','addApplications','Transaction','ISOLATION_LEVELS','bulkCreate','MailApplication','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','split','CmList','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','List','Contacts','messageId','attach','out','Interaction','verifySmtp','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','util','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','end','json','offset'];(function(_0x32b8a9,_0x59d62b){var _0x40105c=function(_0x54c048){while(--_0x54c048){_0x32b8a9['push'](_0x32b8a9['shift']());}};_0x40105c(++_0x59d62b);}(_0xb9d3,0x149));var _0x3b9d=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xb9d3[_0x40220a];return _0x3903cc;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x3b9d('0x0'));var path=require('path');var _=require(_0x3b9d('0x1'));var juice=require(_0x3b9d('0x2'));var Redis=require(_0x3b9d('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x3b9d('0x4'))(_0x3b9d('0x5'));var config=require(_0x3b9d('0x6'));var db=require(_0x3b9d('0x7'))['db'];config[_0x3b9d('0x8')]=_[_0x3b9d('0x9')](config['redis'],{'host':_0x3b9d('0xa'),'port':0x18eb});var socket=require(_0x3b9d('0xb'))(new Redis(config[_0x3b9d('0x8')]));require(_0x3b9d('0xc'))['register'](socket);var jayson=require(_0x3b9d('0xd'));var client=jayson['client'][_0x3b9d('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x169cba,_0x293814,_0x472103,_0x3cc4d4){return new BPromise(function(_0x14d939,_0x3b80eb){var _0x1b5e1e=_0x3cc4d4||client;return _0x1b5e1e['request'](_0x169cba,_0x472103)[_0x3b9d('0xf')](function(_0x5ceca2){logger[_0x3b9d('0x10')](_0x3b9d('0x11'),_0x293814,_0x3b9d('0x12'));logger[_0x3b9d('0x13')](_0x3b9d('0x14'),_0x293814,_0x3b9d('0x12'),JSON[_0x3b9d('0x15')](_0x5ceca2));if(_0x5ceca2['error']){if(_0x5ceca2['error'][_0x3b9d('0x16')]===0x1f4){logger[_0x3b9d('0x17')](_0x3b9d('0x11'),_0x293814,_0x5ceca2[_0x3b9d('0x17')][_0x3b9d('0x18')]);return _0x3b80eb(_0x5ceca2[_0x3b9d('0x17')][_0x3b9d('0x18')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x293814,_0x5ceca2[_0x3b9d('0x17')][_0x3b9d('0x18')]);return _0x14d939(_0x5ceca2[_0x3b9d('0x17')]['message']);}else{logger[_0x3b9d('0x10')](_0x3b9d('0x11'),_0x293814,_0x3b9d('0x12'));_0x14d939(_0x5ceca2[_0x3b9d('0x19')][_0x3b9d('0x18')]);}})[_0x3b9d('0x1a')](function(_0x49ab79){logger[_0x3b9d('0x17')](_0x3b9d('0x11'),_0x293814,_0x49ab79);_0x3b80eb(_0x49ab79);});});}function respondWithStatusCode(_0x1c4e60,_0x48c2d1){_0x48c2d1=_0x48c2d1||0xcc;return function(_0x4202aa){if(_0x4202aa){return _0x1c4e60['sendStatus'](_0x48c2d1);}return _0x1c4e60[_0x3b9d('0x1b')](_0x48c2d1)[_0x3b9d('0x1c')]();};}function respondWithResult(_0x13bc89,_0x57c85e){_0x57c85e=_0x57c85e||0xc8;return function(_0x3e806f){if(_0x3e806f){return _0x13bc89[_0x3b9d('0x1b')](_0x57c85e)[_0x3b9d('0x1d')](_0x3e806f);}};}function respondWithFilteredResult(_0x3e0bf1,_0x6c22bd){return function(_0x45ce7e){if(_0x45ce7e){var _0x5c36a8=typeof _0x6c22bd[_0x3b9d('0x1e')]==='undefined'&&typeof _0x6c22bd[_0x3b9d('0x1f')]===_0x3b9d('0x20');var _0x41f9d0=_0x45ce7e[_0x3b9d('0x21')];var _0x316372=_0x5c36a8?0x0:_0x6c22bd[_0x3b9d('0x1e')];var _0x3be03b=_0x5c36a8?_0x45ce7e[_0x3b9d('0x21')]:_0x6c22bd[_0x3b9d('0x1e')]+_0x6c22bd[_0x3b9d('0x1f')];var _0x5c47f;if(_0x3be03b>=_0x41f9d0){_0x3be03b=_0x41f9d0;_0x5c47f=0xc8;}else{_0x5c47f=0xce;}_0x3e0bf1[_0x3b9d('0x1b')](_0x5c47f);return _0x3e0bf1[_0x3b9d('0x22')](_0x3b9d('0x23'),_0x316372+'-'+_0x3be03b+'/'+_0x41f9d0)[_0x3b9d('0x1d')](_0x45ce7e);}return null;};}function saveUpdates(_0x494435){return function(_0xecf9ed){if(_0xecf9ed){return _0xecf9ed['update'](_0x494435)[_0x3b9d('0xf')](function(_0x2e76e3){return _0x2e76e3;});}return null;};}function removeEntity(_0x122657){return function(_0x39df29){if(_0x39df29){return _0x39df29[_0x3b9d('0x24')]()['then'](function(){var _0x38b80c=_0x39df29[_0x3b9d('0x25')]({'plain':!![]});var _0x395873=_0x3b9d('0x26');return db[_0x3b9d('0x27')][_0x3b9d('0x24')]({'where':{'type':_0x395873,'resourceId':_0x38b80c['id']}})[_0x3b9d('0xf')](function(){return _0x39df29;});})[_0x3b9d('0xf')](function(){_0x122657[_0x3b9d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa702c3){return function(_0xf7bb7d){if(!_0xf7bb7d){_0xa702c3[_0x3b9d('0x28')](0x194);}return _0xf7bb7d;};}function handleError(_0x5c38fe,_0x4b28e9){_0x4b28e9=_0x4b28e9||0x1f4;return function(_0x2706be){logger[_0x3b9d('0x17')](_0x2706be[_0x3b9d('0x29')]);if(_0x2706be[_0x3b9d('0x2a')]){delete _0x2706be['name'];}_0x5c38fe['status'](_0x4b28e9)['send'](_0x2706be);};}exports['index']=function(_0x3437fe,_0x207bd3){var _0xda7b4={'include':[{'model':db[_0x3b9d('0x2b')],'as':_0x3b9d('0x2c')},{'model':db[_0x3b9d('0x2d')],'as':_0x3b9d('0x2e')},{'model':db[_0x3b9d('0x2f')],'as':_0x3b9d('0x30')}]},_0x3cc1ba={},_0x1ee4a7={'count':0x0,'rows':[]};var _0x1a37cb=_['map'](db['MailAccount'][_0x3b9d('0x31')],function(_0x198c16){return{'name':_0x198c16['fieldName'],'type':_0x198c16[_0x3b9d('0x32')][_0x3b9d('0x33')]};});_0x3cc1ba[_0x3b9d('0x34')]=_['map'](_0x1a37cb,'name');_0x3cc1ba[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x3437fe[_0x3b9d('0x35')]);_0x3cc1ba[_0x3b9d('0x37')]=_[_0x3b9d('0x38')](_0x3cc1ba[_0x3b9d('0x34')],_0x3cc1ba[_0x3b9d('0x35')]);_0xda7b4[_0x3b9d('0x39')]=_['intersection'](_0x3cc1ba[_0x3b9d('0x34')],qs[_0x3b9d('0x3a')](_0x3437fe[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0xda7b4[_0x3b9d('0x39')]=_0xda7b4[_0x3b9d('0x39')][_0x3b9d('0x3b')]?_0xda7b4[_0x3b9d('0x39')]:_0x3cc1ba[_0x3b9d('0x34')];if(!_0x3437fe['query'][_0x3b9d('0x3c')](_0x3b9d('0x3d'))){_0xda7b4[_0x3b9d('0x1f')]=qs['limit'](_0x3437fe[_0x3b9d('0x35')][_0x3b9d('0x1f')]);_0xda7b4[_0x3b9d('0x1e')]=qs[_0x3b9d('0x1e')](_0x3437fe['query']['offset']);}_0xda7b4[_0x3b9d('0x3e')]=qs[_0x3b9d('0x3f')](_0x3437fe[_0x3b9d('0x35')][_0x3b9d('0x3f')]);_0xda7b4[_0x3b9d('0x40')]=qs[_0x3b9d('0x37')](_[_0x3b9d('0x41')](_0x3437fe[_0x3b9d('0x35')],_0x3cc1ba[_0x3b9d('0x37')]),_0x1a37cb);if(_0x3437fe[_0x3b9d('0x35')]['filter']){_0xda7b4[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0xda7b4[_0x3b9d('0x40')],{'$or':_[_0x3b9d('0x43')](_0x1a37cb,function(_0x448fca){if(_0x448fca[_0x3b9d('0x32')]!==_0x3b9d('0x44')){var _0x56bc74={};_0x56bc74[_0x448fca['name']]={'$like':'%'+_0x3437fe[_0x3b9d('0x35')]['filter']+'%'};return _0x56bc74;}})});}_0xda7b4=_['merge']({},_0xda7b4,_0x3437fe[_0x3b9d('0x45')]);var _0x6db743={'where':_0xda7b4[_0x3b9d('0x40')]};return db[_0x3b9d('0x46')][_0x3b9d('0x21')](_0x6db743)[_0x3b9d('0xf')](function(_0x32f4fb){_0x1ee4a7['count']=_0x32f4fb;if(_0x3437fe['query'][_0x3b9d('0x47')]){_0xda7b4['include']=[{'all':!![]}];}return db[_0x3b9d('0x46')][_0x3b9d('0x48')](_0xda7b4);})[_0x3b9d('0xf')](function(_0x47e96d){_0x1ee4a7['rows']=_0x47e96d;return _0x1ee4a7;})[_0x3b9d('0xf')](respondWithFilteredResult(_0x207bd3,_0xda7b4))['catch'](handleError(_0x207bd3,null));};exports[_0x3b9d('0x49')]=function(_0x3e21d4,_0x4d183a){var _0x388b86={'raw':![],'where':{'id':_0x3e21d4[_0x3b9d('0x4a')]['id']},'include':[{'model':db[_0x3b9d('0x2b')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x3b9d('0x2e')},{'model':db[_0x3b9d('0x2f')],'as':'mandatoryDispositionPause'}]},_0x1d4fe1={};_0x1d4fe1[_0x3b9d('0x34')]=_[_0x3b9d('0x36')](db[_0x3b9d('0x46')][_0x3b9d('0x31')]);_0x1d4fe1[_0x3b9d('0x35')]=_['keys'](_0x3e21d4[_0x3b9d('0x35')]);_0x1d4fe1['filters']=_['intersection'](_0x1d4fe1[_0x3b9d('0x34')],_0x1d4fe1['query']);_0x388b86['attributes']=_[_0x3b9d('0x38')](_0x1d4fe1['model'],qs[_0x3b9d('0x3a')](_0x3e21d4[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0x388b86[_0x3b9d('0x39')]=_0x388b86['attributes'][_0x3b9d('0x3b')]?_0x388b86[_0x3b9d('0x39')]:_0x1d4fe1[_0x3b9d('0x34')];if(_0x3e21d4[_0x3b9d('0x35')]['includeAll']){_0x388b86[_0x3b9d('0x4b')]=[{'all':!![]}];}_0x388b86=_['merge']({},_0x388b86,_0x3e21d4[_0x3b9d('0x45')]);return db[_0x3b9d('0x46')][_0x3b9d('0x4c')](_0x388b86)[_0x3b9d('0xf')](handleEntityNotFound(_0x4d183a,null))[_0x3b9d('0xf')](respondWithResult(_0x4d183a,null))[_0x3b9d('0x1a')](handleError(_0x4d183a,null));};exports[_0x3b9d('0x4d')]=function(_0x4dcacd,_0x1e837b){if(_0x4dcacd['body']['id']){delete _0x4dcacd[_0x3b9d('0x4e')]['id'];}if(_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2c')]){if(!_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2c')][_0x3b9d('0x4f')]){_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2c')][_0x3b9d('0x50')]=null;}}if(_0x4dcacd['body'][_0x3b9d('0x2e')]){if(!_0x4dcacd['body']['Smtp'][_0x3b9d('0x4f')]){_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2e')][_0x3b9d('0x50')]=null;}}return db[_0x3b9d('0x46')]['find']({'where':{'id':_0x4dcacd[_0x3b9d('0x4a')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x3b9d('0x2c')},{'model':db[_0x3b9d('0x2d')],'as':'Smtp'},{'model':db[_0x3b9d('0x2f')],'as':'mandatoryDispositionPause'}]})[_0x3b9d('0xf')](handleEntityNotFound(_0x1e837b,null))[_0x3b9d('0xf')](saveUpdates(_0x4dcacd[_0x3b9d('0x4e')],null))[_0x3b9d('0xf')](function(_0x388470){if(_0x388470&&_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2c')]){return db[_0x3b9d('0x2b')]['update'](_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2c')],{'where':{'MailAccountId':_0x388470['id']}})['then'](function(){return _0x388470;});}return _0x388470;})[_0x3b9d('0xf')](function(_0x32eba8){if(_0x32eba8&&_0x4dcacd['body'][_0x3b9d('0x2e')]){return db[_0x3b9d('0x2d')][_0x3b9d('0x4d')](_0x4dcacd[_0x3b9d('0x4e')][_0x3b9d('0x2e')],{'where':{'MailAccountId':_0x32eba8['id']}})[_0x3b9d('0xf')](function(){return _0x32eba8;});}return _0x32eba8;})[_0x3b9d('0xf')](respondWithResult(_0x1e837b,null))[_0x3b9d('0x1a')](handleError(_0x1e837b,null));};exports[_0x3b9d('0x51')]=function(_0x599996,_0x5ab677){return db['MailAccount'][_0x3b9d('0x51')]()[_0x3b9d('0xf')](respondWithResult(_0x5ab677,null))[_0x3b9d('0x1a')](handleError(_0x5ab677,null));};exports[_0x3b9d('0x52')]=function(_0x4392e6,_0x289f49){if(_0x4392e6[_0x3b9d('0x4e')]['id']){delete _0x4392e6[_0x3b9d('0x4e')]['id'];}return db['MailAccount'][_0x3b9d('0x4c')]({'where':{'id':_0x4392e6[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x289f49,null))[_0x3b9d('0xf')](function(_0x3b934e){if(_0x3b934e){_0x4392e6[_0x3b9d('0x4e')][_0x3b9d('0x53')]=_0x3b934e['id'];return db[_0x3b9d('0x54')]['create'](_0x4392e6[_0x3b9d('0x4e')]);}})[_0x3b9d('0xf')](respondWithResult(_0x289f49,null))[_0x3b9d('0x1a')](handleError(_0x289f49,null));};exports['getDispositions']=function(_0x57edf8,_0x4402eb){var _0x234add={'raw':![],'where':{}};var _0x3c325b={};var _0x4b2423={'count':0x0,'rows':[]};return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x57edf8[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x4402eb,null))[_0x3b9d('0xf')](function(_0x3f06e9){if(_0x3f06e9){_0x3c325b[_0x3b9d('0x34')]=_['keys'](db[_0x3b9d('0x54')][_0x3b9d('0x31')]);_0x3c325b[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x57edf8[_0x3b9d('0x35')]);_0x3c325b['filters']=_[_0x3b9d('0x38')](_0x3c325b['model'],_0x3c325b[_0x3b9d('0x35')]);_0x234add[_0x3b9d('0x39')]=_[_0x3b9d('0x38')](_0x3c325b[_0x3b9d('0x34')],qs['fields'](_0x57edf8['query'][_0x3b9d('0x3a')]));_0x234add[_0x3b9d('0x39')]=_0x234add[_0x3b9d('0x39')]['length']?_0x234add[_0x3b9d('0x39')]:_0x3c325b[_0x3b9d('0x34')];if(!_0x57edf8[_0x3b9d('0x35')][_0x3b9d('0x3c')]('nolimit')){_0x234add[_0x3b9d('0x1f')]=qs['limit'](_0x57edf8['query']['limit']);_0x234add[_0x3b9d('0x1e')]=qs['offset'](_0x57edf8[_0x3b9d('0x35')][_0x3b9d('0x1e')]);}_0x234add['order']=qs[_0x3b9d('0x3f')](_0x57edf8[_0x3b9d('0x35')][_0x3b9d('0x3f')]);_0x234add['where']=qs[_0x3b9d('0x37')](_['pick'](_0x57edf8[_0x3b9d('0x35')],_0x3c325b['filters']));_0x234add['where'][_0x3b9d('0x53')]=_0x3f06e9['id'];if(_0x57edf8[_0x3b9d('0x35')][_0x3b9d('0x56')]){_0x234add[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0x234add['where'],{'$or':_[_0x3b9d('0x43')](_0x234add['attributes'],function(_0x589009){var _0x2392ae={};_0x2392ae[_0x589009]={'$like':'%'+_0x57edf8[_0x3b9d('0x35')][_0x3b9d('0x56')]+'%'};return _0x2392ae;})});}_0x234add=_['merge']({},_0x234add,_0x57edf8['options']);return db['Disposition'][_0x3b9d('0x21')]({'where':_0x234add[_0x3b9d('0x40')]})[_0x3b9d('0xf')](function(_0x19519e){_0x4b2423[_0x3b9d('0x21')]=_0x19519e;if(_0x57edf8[_0x3b9d('0x35')]['includeAll']){_0x234add[_0x3b9d('0x4b')]=[{'all':!![]}];}return db[_0x3b9d('0x54')]['findAll'](_0x234add);})['then'](function(_0x21773b){_0x4b2423['rows']=_0x21773b;return _0x4b2423;});}})[_0x3b9d('0xf')](respondWithFilteredResult(_0x4402eb,_0x234add))[_0x3b9d('0x1a')](handleError(_0x4402eb,null));};exports[_0x3b9d('0x57')]=function(_0x51ff03,_0x34a856){return db[_0x3b9d('0x46')]['find']({'where':{'id':_0x51ff03['params']['id']}})['then'](handleEntityNotFound(_0x34a856,null))[_0x3b9d('0xf')](function(_0x49badd){if(_0x49badd){return _0x49badd[_0x3b9d('0x57')](_0x51ff03[_0x3b9d('0x35')][_0x3b9d('0x58')]);}})[_0x3b9d('0xf')](respondWithStatusCode(_0x34a856,null))[_0x3b9d('0x1a')](handleError(_0x34a856,null));};exports[_0x3b9d('0x59')]=function(_0x1b92d5,_0x4e85f3){if(_0x1b92d5[_0x3b9d('0x4e')]['id']){delete _0x1b92d5['body']['id'];}return db['MailAccount'][_0x3b9d('0x4c')]({'where':{'id':_0x1b92d5[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x4e85f3,null))[_0x3b9d('0xf')](function(_0x43d525){if(_0x43d525){_0x1b92d5['body']['MailAccountId']=_0x43d525['id'];return db[_0x3b9d('0x5a')]['create'](_0x1b92d5['body']);}})['then'](respondWithResult(_0x4e85f3,null))[_0x3b9d('0x1a')](handleError(_0x4e85f3,null));};exports[_0x3b9d('0x5b')]=function(_0x1f0049,_0x1f8978){var _0x39af43={'raw':![],'where':{}};var _0x92c41={};var _0x58c0d1={'count':0x0,'rows':[]};return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x1f0049['params']['id']}})['then'](handleEntityNotFound(_0x1f8978,null))[_0x3b9d('0xf')](function(_0x10c0b8){if(_0x10c0b8){_0x92c41[_0x3b9d('0x34')]=_[_0x3b9d('0x36')](db[_0x3b9d('0x5a')][_0x3b9d('0x31')]);_0x92c41[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x1f0049['query']);_0x92c41['filters']=_[_0x3b9d('0x38')](_0x92c41['model'],_0x92c41['query']);_0x39af43[_0x3b9d('0x39')]=_[_0x3b9d('0x38')](_0x92c41[_0x3b9d('0x34')],qs[_0x3b9d('0x3a')](_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0x39af43[_0x3b9d('0x39')]=_0x39af43[_0x3b9d('0x39')]['length']?_0x39af43[_0x3b9d('0x39')]:_0x92c41['model'];if(!_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x3c')](_0x3b9d('0x3d'))){_0x39af43[_0x3b9d('0x1f')]=qs[_0x3b9d('0x1f')](_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x1f')]);_0x39af43[_0x3b9d('0x1e')]=qs[_0x3b9d('0x1e')](_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x1e')]);}_0x39af43[_0x3b9d('0x3e')]=qs[_0x3b9d('0x3f')](_0x1f0049[_0x3b9d('0x35')]['sort']);_0x39af43['where']=qs['filters'](_[_0x3b9d('0x41')](_0x1f0049[_0x3b9d('0x35')],_0x92c41['filters']));_0x39af43['where'][_0x3b9d('0x53')]=_0x10c0b8['id'];if(_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x56')]){_0x39af43[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0x39af43[_0x3b9d('0x40')],{'$or':_[_0x3b9d('0x43')](_0x39af43[_0x3b9d('0x39')],function(_0xce4c0a){var _0x2fe63c={};_0x2fe63c[_0xce4c0a]={'$like':'%'+_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x56')]+'%'};return _0x2fe63c;})});}_0x39af43=_[_0x3b9d('0x42')]({},_0x39af43,_0x1f0049[_0x3b9d('0x45')]);return db[_0x3b9d('0x5a')][_0x3b9d('0x21')]({'where':_0x39af43[_0x3b9d('0x40')]})[_0x3b9d('0xf')](function(_0x2de825){_0x58c0d1[_0x3b9d('0x21')]=_0x2de825;if(_0x1f0049[_0x3b9d('0x35')][_0x3b9d('0x47')]){_0x39af43[_0x3b9d('0x4b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3b9d('0x48')](_0x39af43);})['then'](function(_0x432058){_0x58c0d1[_0x3b9d('0x5c')]=_0x432058;return _0x58c0d1;});}})['then'](respondWithFilteredResult(_0x1f8978,_0x39af43))[_0x3b9d('0x1a')](handleError(_0x1f8978,null));};exports[_0x3b9d('0x5d')]=function(_0x494d7f,_0x2fa8f7){return db[_0x3b9d('0x46')]['find']({'where':{'id':_0x494d7f['params']['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x2fa8f7,null))[_0x3b9d('0xf')](function(_0x22e70f){if(_0x22e70f){return _0x22e70f['removeAnswers'](_0x494d7f[_0x3b9d('0x35')][_0x3b9d('0x58')]);}})[_0x3b9d('0xf')](respondWithStatusCode(_0x2fa8f7,null))[_0x3b9d('0x1a')](handleError(_0x2fa8f7,null));};exports[_0x3b9d('0x5e')]=function(_0x196348,_0x5de4bb){var _0x1d23cd={'name':_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x2a')],'key':_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x33')],'provider':_0x196348[_0x3b9d('0x4e')]['provider']==='custom'?null:_0x196348[_0x3b9d('0x4e')]['provider'],'email':_0x196348[_0x3b9d('0x4e')]['email'],'ListId':_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x5f')],'active':!_[_0x3b9d('0x60')](_0x196348['body'][_0x3b9d('0x61')])?_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x61')]:!![],'description':_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x62')]||null,'Imap':{},'Smtp':{}};if(_0x1d23cd[_0x3b9d('0x63')]){_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x64')]=_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x64')]=_0x196348['body']['username'];_0x1d23cd['Imap'][_0x3b9d('0x65')]=_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x66')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x65')];if(_0x196348[_0x3b9d('0x4e')]['modernAuthentication']){_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x4f')]=_0x1d23cd[_0x3b9d('0x2e')]['modernAuthentication']=!![];_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x50')]=_0x1d23cd['Smtp'][_0x3b9d('0x50')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x50')];_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x65')]=_0x1d23cd[_0x3b9d('0x2e')]['pass']=null;}else{_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x50')]=_0x1d23cd['Smtp'][_0x3b9d('0x50')]=null;}_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x67')]=_0x1d23cd['Smtp'][_0x3b9d('0x67')]=null;_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x68')]=_0x1d23cd['Smtp'][_0x3b9d('0x68')]=null;_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x69')]=_0x1d23cd['Smtp'][_0x3b9d('0x69')]=null;}else{if(_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x6a')]){_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x64')]=_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x64')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x6b')];_0x1d23cd[_0x3b9d('0x2c')]['password']=_0x1d23cd['Smtp'][_0x3b9d('0x66')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x65')];}else{_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x6a')]=_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x6a')]=![];_0x1d23cd[_0x3b9d('0x2c')]['user']=_0x1d23cd['Smtp'][_0x3b9d('0x64')]=null;_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x65')]=_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x66')]=null;}_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x68')]=_0x196348['body'][_0x3b9d('0x2c')][_0x3b9d('0x68')];_0x1d23cd[_0x3b9d('0x2c')][_0x3b9d('0x69')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x2c')][_0x3b9d('0x69')];_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x68')]=_0x196348['body']['Smtp']['host'];_0x1d23cd[_0x3b9d('0x2e')][_0x3b9d('0x69')]=_0x196348[_0x3b9d('0x4e')][_0x3b9d('0x2e')][_0x3b9d('0x69')];}return db[_0x3b9d('0x46')]['create'](_0x1d23cd,{'include':[{'model':db['MailServerOut'],'as':_0x3b9d('0x2e')},{'model':db[_0x3b9d('0x2b')],'as':_0x3b9d('0x2c')}]})['then'](function(_0x1fc061){var _0x287e72=_0x196348['user'][_0x3b9d('0x25')]({'plain':!![]});if(!_0x287e72)throw new Error(_0x3b9d('0x6c'));if(_0x287e72['role']==='user'){var _0x4f4659=_0x1fc061[_0x3b9d('0x25')]({'plain':!![]});return db[_0x3b9d('0x6d')]['find']({'where':{'name':_0x3b9d('0x26'),'userProfileId':_0x287e72['userProfileId']},'raw':!![]})[_0x3b9d('0xf')](function(_0x2a6899){if(_0x2a6899&&_0x2a6899[_0x3b9d('0x6e')]===0x0){return db[_0x3b9d('0x27')]['create']({'name':_0x4f4659[_0x3b9d('0x2a')],'resourceId':_0x4f4659['id'],'type':_0x2a6899['name'],'sectionId':_0x2a6899['id']},{})[_0x3b9d('0xf')](function(){return _0x1fc061;});}else{return _0x1fc061;}})[_0x3b9d('0x1a')](function(_0x593799){logger['error'](_0x3b9d('0x6f'),_0x593799);throw _0x593799;});}return _0x1fc061;})[_0x3b9d('0xf')](respondWithResult(_0x5de4bb,0xc9))[_0x3b9d('0x1a')](handleError(_0x5de4bb,null));};exports[_0x3b9d('0x70')]=function(_0x378f21,_0x115637){return db['MailAccount'][_0x3b9d('0x55')]({'where':{'id':_0x378f21[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x115637,null))[_0x3b9d('0xf')](function(_0x12c87f){if(_0x12c87f){return _0x12c87f[_0x3b9d('0x70')]();}return null;})[_0x3b9d('0xf')](respondWithResult(_0x115637,null))['catch'](handleError(_0x115637,null));};exports[_0x3b9d('0x71')]=function(_0x5effbb,_0x3f5a06){if(_0x5effbb['body']['id']){delete _0x5effbb['body']['id'];}return db[_0x3b9d('0x46')][_0x3b9d('0x4c')]({'where':{'id':_0x5effbb[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x3f5a06,null))[_0x3b9d('0xf')](function(_0x87a2db){if(_0x87a2db){_0x5effbb[_0x3b9d('0x4e')]['MailAccountId']=_0x87a2db['id'];return db[_0x3b9d('0x2b')]['create'](_0x5effbb['body']);}})[_0x3b9d('0xf')](respondWithResult(_0x3f5a06,null))[_0x3b9d('0x1a')](handleError(_0x3f5a06,null));};exports[_0x3b9d('0x72')]=function(_0x7dbb17,_0x3aaf31){return db['MailAccount'][_0x3b9d('0x55')]({'where':{'id':_0x7dbb17[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x3aaf31,null))[_0x3b9d('0xf')](function(_0x452722){if(_0x452722){return _0x452722[_0x3b9d('0x73')](null);}return null;})[_0x3b9d('0xf')](respondWithStatusCode(_0x3aaf31,null))['catch'](handleError(_0x3aaf31,null));};exports['getSmtp']=function(_0x5fb907,_0x37a7d5){return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x5fb907[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x37a7d5,null))['then'](function(_0x5613c9){if(_0x5613c9){return _0x5613c9[_0x3b9d('0x74')]();}return null;})['then'](respondWithResult(_0x37a7d5,null))[_0x3b9d('0x1a')](handleError(_0x37a7d5,null));};exports['addSmtp']=function(_0x497b47,_0x541a4d){if(_0x497b47['body']['id']){delete _0x497b47['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x497b47[_0x3b9d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x541a4d,null))[_0x3b9d('0xf')](function(_0x2f765d){if(_0x2f765d){_0x497b47[_0x3b9d('0x4e')][_0x3b9d('0x53')]=_0x2f765d['id'];return db[_0x3b9d('0x2d')][_0x3b9d('0x5e')](_0x497b47[_0x3b9d('0x4e')]);}})['then'](respondWithResult(_0x541a4d,null))[_0x3b9d('0x1a')](handleError(_0x541a4d,null));};exports[_0x3b9d('0x75')]=function(_0x175e97,_0x231289){return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x175e97[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x231289,null))[_0x3b9d('0xf')](function(_0xf6d56b){if(_0xf6d56b){return _0xf6d56b[_0x3b9d('0x76')](null);}return null;})[_0x3b9d('0xf')](respondWithStatusCode(_0x231289,null))[_0x3b9d('0x1a')](handleError(_0x231289,null));};exports['addInteraction']=function(_0x230655,_0x4c416e){return db[_0x3b9d('0x77')][_0x3b9d('0x4c')]({'where':{'id':_0x230655[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x4c416e,null))['then'](function(_0x48ea8d){if(_0x48ea8d){return _0x48ea8d[_0x3b9d('0x78')](_0x230655[_0x3b9d('0x4e')][_0x3b9d('0x58')],_['omit'](_0x230655[_0x3b9d('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x4c416e,null))['catch'](handleError(_0x4c416e,null));};exports['getInteractions']=function(_0x5e177b,_0x188813){var _0x899f8e={'raw':![],'where':{}};var _0x544da7={};var _0x328d82={'count':0x0,'rows':[]};return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x5e177b[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x188813,null))[_0x3b9d('0xf')](function(_0x490234){if(_0x490234){_0x544da7[_0x3b9d('0x34')]=_['keys'](db[_0x3b9d('0x77')]['rawAttributes']);_0x544da7[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x5e177b[_0x3b9d('0x35')]);_0x544da7['filters']=_[_0x3b9d('0x38')](_0x544da7[_0x3b9d('0x34')],_0x544da7[_0x3b9d('0x35')]);_0x899f8e[_0x3b9d('0x39')]=_[_0x3b9d('0x38')](_0x544da7[_0x3b9d('0x34')],qs['fields'](_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0x899f8e[_0x3b9d('0x39')]=_0x899f8e[_0x3b9d('0x39')][_0x3b9d('0x3b')]?_0x899f8e[_0x3b9d('0x39')]:_0x544da7[_0x3b9d('0x34')];if(!_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x3c')]('nolimit')){_0x899f8e[_0x3b9d('0x1f')]=qs[_0x3b9d('0x1f')](_0x5e177b['query'][_0x3b9d('0x1f')]);_0x899f8e[_0x3b9d('0x1e')]=qs[_0x3b9d('0x1e')](_0x5e177b['query'][_0x3b9d('0x1e')]);}_0x899f8e[_0x3b9d('0x3e')]=qs[_0x3b9d('0x3f')](_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x3f')]);_0x899f8e[_0x3b9d('0x40')]=qs[_0x3b9d('0x37')](_['pick'](_0x5e177b[_0x3b9d('0x35')],_0x544da7[_0x3b9d('0x37')]));_0x899f8e[_0x3b9d('0x40')][_0x3b9d('0x53')]=_0x490234['id'];if(_0x5e177b[_0x3b9d('0x35')]['filter']){_0x899f8e['where']=_['merge'](_0x899f8e[_0x3b9d('0x40')],{'$or':_[_0x3b9d('0x43')](_0x899f8e[_0x3b9d('0x39')],function(_0x240be4){var _0x2bb29c={};_0x2bb29c[_0x240be4]={'$like':'%'+_0x5e177b['query']['filter']+'%'};return _0x2bb29c;})});}_0x899f8e=_[_0x3b9d('0x42')]({},_0x899f8e,_0x5e177b['options']);return db['MailInteraction'][_0x3b9d('0x21')]({'where':_0x899f8e[_0x3b9d('0x40')]})['then'](function(_0x3a6f96){_0x328d82[_0x3b9d('0x21')]=_0x3a6f96;if(_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x47')]){_0x899f8e['include']=[{'model':db[_0x3b9d('0x79')],'as':_0x3b9d('0x7a'),'required':![]},{'model':db[_0x3b9d('0x7b')],'as':'Owner','attributes':[_0x3b9d('0x2a'),_0x3b9d('0x7c'),_0x3b9d('0x7d')],'required':![]},{'model':db['Tag'],'as':_0x3b9d('0x7e'),'attributes':['id',_0x3b9d('0x2a'),'color'],'where':_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x7f')]?{'id':_0x5e177b[_0x3b9d('0x35')]['tag']}:undefined,'required':_0x5e177b[_0x3b9d('0x35')][_0x3b9d('0x7f')]?!![]:![]}];}return db[_0x3b9d('0x77')][_0x3b9d('0x48')](_0x899f8e);})[_0x3b9d('0xf')](function(_0x3acd67){_0x328d82['rows']=_0x3acd67;return _0x328d82;});}})['then'](respondWithFilteredResult(_0x188813,_0x899f8e))[_0x3b9d('0x1a')](handleError(_0x188813,null));};exports[_0x3b9d('0x80')]=function addApplications(_0x1c58a6,_0x34dc17){var _0x235bfd=_0x1c58a6['params']['id'];var _0x1ef3fc=_0x1c58a6[_0x3b9d('0x4e')];var _0x203a6f=0xc8;var _0x59288e=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x3b9d('0x81')][_0x3b9d('0x82')]['READ_COMMITTED']},function(_0x32ca25){return db[_0x3b9d('0x46')][_0x3b9d('0x55')]({'where':{'id':_0x235bfd},'transaction':_0x32ca25})[_0x3b9d('0xf')](function(_0x1ad090){if(_0x1ad090){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x235bfd},'transaction':_0x32ca25})['then'](function(){var _0xe9a48f=_[_0x3b9d('0x43')](_0x1ef3fc,function(_0x5812bb){_0x5812bb[_0x3b9d('0x53')]=_0x235bfd;return _0x5812bb;});return db['MailApplication'][_0x3b9d('0x83')](_0xe9a48f,{'transaction':_0x32ca25});});}else{_0x203a6f=0x194;_0x59288e=[];}});})[_0x3b9d('0xf')](function(){if(_0x203a6f!==0x194){return db[_0x3b9d('0x84')][_0x3b9d('0x85')]({'where':{'MailAccountId':_0x235bfd},'order':_0x3b9d('0x86')})[_0x3b9d('0xf')](function(_0x89f62a){_0x59288e=_0x89f62a;});}})[_0x3b9d('0x1a')](function(_0x499b6f){_0x203a6f=0x1f4;logger[_0x3b9d('0x17')](_0x499b6f[_0x3b9d('0x29')]);if(_0x499b6f[_0x3b9d('0x2a')]){delete _0x499b6f[_0x3b9d('0x2a')];}_0x59288e=_0x499b6f;})[_0x3b9d('0x87')](function(){if(_0x59288e===null){_0x34dc17[_0x3b9d('0x28')](_0x203a6f);}else{if(_0x203a6f===0x1f4){_0x34dc17['status'](_0x203a6f)['send'](_0x59288e);}else{_0x34dc17[_0x3b9d('0x1b')](_0x203a6f)[_0x3b9d('0x1d')](_0x59288e);}}});};exports['getApplications']=function(_0x157f14,_0x41cc73){var _0x13d313={};var _0x262e01={};var _0x5a3a87;var _0x237be1;return db[_0x3b9d('0x46')]['findOne']({'where':{'id':_0x157f14['params']['id']}})['then'](handleEntityNotFound(_0x41cc73,null))[_0x3b9d('0xf')](function(_0x3a2fe6){if(_0x3a2fe6){_0x5a3a87=_0x3a2fe6;_0x262e01[_0x3b9d('0x34')]=_[_0x3b9d('0x36')](db[_0x3b9d('0x84')][_0x3b9d('0x31')]);_0x262e01[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x157f14['query']);_0x262e01[_0x3b9d('0x37')]=_[_0x3b9d('0x38')](_0x262e01['model'],_0x262e01[_0x3b9d('0x35')]);_0x13d313['attributes']=_['intersection'](_0x262e01[_0x3b9d('0x34')],qs[_0x3b9d('0x3a')](_0x157f14[_0x3b9d('0x35')]['fields']));_0x13d313['attributes']=_0x13d313[_0x3b9d('0x39')][_0x3b9d('0x3b')]?_0x13d313[_0x3b9d('0x39')]:_0x262e01[_0x3b9d('0x34')];_0x13d313[_0x3b9d('0x3e')]=qs[_0x3b9d('0x3f')](_0x157f14[_0x3b9d('0x35')]['sort']);_0x13d313[_0x3b9d('0x40')]=qs[_0x3b9d('0x37')](_[_0x3b9d('0x41')](_0x157f14[_0x3b9d('0x35')],_0x262e01[_0x3b9d('0x37')]));if(_0x157f14[_0x3b9d('0x35')][_0x3b9d('0x56')]){_0x13d313['where']=_[_0x3b9d('0x42')](_0x13d313[_0x3b9d('0x40')],{'$or':_[_0x3b9d('0x43')](_0x13d313[_0x3b9d('0x39')],function(_0xd13b2c){var _0x5ed5ce={};_0x5ed5ce[_0xd13b2c]={'$like':'%'+_0x157f14[_0x3b9d('0x35')]['filter']+'%'};return _0x5ed5ce;})});}_0x13d313=_[_0x3b9d('0x42')]({},_0x13d313,_0x157f14[_0x3b9d('0x45')]);return _0x5a3a87['getApplications'](_0x13d313);}})[_0x3b9d('0xf')](function(_0x16b5af){if(_0x16b5af){_0x237be1=_0x16b5af['length'];if(!_0x157f14[_0x3b9d('0x35')]['hasOwnProperty'](_0x3b9d('0x3d'))){_0x13d313[_0x3b9d('0x1f')]=qs[_0x3b9d('0x1f')](_0x157f14['query']['limit']);_0x13d313[_0x3b9d('0x1e')]=qs['offset'](_0x157f14[_0x3b9d('0x35')][_0x3b9d('0x1e')]);}return _0x5a3a87[_0x3b9d('0x88')](_0x13d313);}})[_0x3b9d('0xf')](function(_0x134704){if(_0x134704){return _0x134704?{'count':_0x237be1,'rows':_0x134704}:null;}})[_0x3b9d('0xf')](respondWithResult(_0x41cc73,null))[_0x3b9d('0x1a')](handleError(_0x41cc73,null));};exports['getMessages']=function(_0x4e683f,_0x282950){var _0x4f0ced={'raw':!![],'where':{}};var _0x33dbb7={};var _0xf704b2={'count':0x0,'rows':[]};return db[_0x3b9d('0x46')]['findOne']({'where':{'id':_0x4e683f[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x282950,null))[_0x3b9d('0xf')](function(_0x57b134){if(_0x57b134){_0x33dbb7[_0x3b9d('0x34')]=_[_0x3b9d('0x36')](db[_0x3b9d('0x89')][_0x3b9d('0x31')]);_0x33dbb7[_0x3b9d('0x35')]=_['keys'](_0x4e683f[_0x3b9d('0x35')]);_0x33dbb7[_0x3b9d('0x37')]=_['intersection'](_0x33dbb7[_0x3b9d('0x34')],_0x33dbb7['query']);_0x4f0ced[_0x3b9d('0x39')]=_[_0x3b9d('0x38')](_0x33dbb7['model'],qs[_0x3b9d('0x3a')](_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0x4f0ced[_0x3b9d('0x39')]=_0x4f0ced['attributes'][_0x3b9d('0x3b')]?_0x4f0ced[_0x3b9d('0x39')]:_0x33dbb7[_0x3b9d('0x34')];if(!_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x3c')](_0x3b9d('0x3d'))){_0x4f0ced[_0x3b9d('0x1f')]=qs[_0x3b9d('0x1f')](_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x1f')]);_0x4f0ced['offset']=qs['offset'](_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x1e')]);}_0x4f0ced[_0x3b9d('0x3e')]=qs[_0x3b9d('0x3f')](_0x4e683f['query'][_0x3b9d('0x3f')]);_0x4f0ced[_0x3b9d('0x40')]=qs[_0x3b9d('0x37')](_[_0x3b9d('0x41')](_0x4e683f[_0x3b9d('0x35')],_0x33dbb7[_0x3b9d('0x37')]));_0x4f0ced[_0x3b9d('0x40')]['MailAccountId']=_0x57b134['id'];if(_0x4e683f[_0x3b9d('0x35')]['filter']){_0x4f0ced[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0x4f0ced[_0x3b9d('0x40')],{'$or':_[_0x3b9d('0x43')](_0x4f0ced[_0x3b9d('0x39')],function(_0x2e063f){var _0x15f4a2={};_0x15f4a2[_0x2e063f]={'$like':'%'+_0x4e683f['query'][_0x3b9d('0x56')]+'%'};return _0x15f4a2;})});}if(_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x8a')]){var _0x244e5b=_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x8a')]['split'](',');var _0x5786ce={};_0x5786ce[_0x244e5b[0x0]]={'$gte':moment(_0x244e5b[0x1])[_0x3b9d('0x8b')](_0x3b9d('0x8c'))};_0x4f0ced[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0x4f0ced['where'],_0x5786ce);}_0x4f0ced=_['merge']({},_0x4f0ced,_0x4e683f['options']);return db['MailMessage'][_0x3b9d('0x21')]({'where':_0x4f0ced['where']})[_0x3b9d('0xf')](function(_0x5766bb){_0xf704b2[_0x3b9d('0x21')]=_0x5766bb;if(_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x47')]){_0x4f0ced[_0x3b9d('0x4b')]=[{'all':!![]}];}return db[_0x3b9d('0x89')][_0x3b9d('0x48')](_0x4f0ced);})[_0x3b9d('0xf')](function(_0x487552){if(_0x4e683f[_0x3b9d('0x35')][_0x3b9d('0x8d')]===_0x3b9d('0x8e')){for(var _0x189398=0x0;_0x189398<_0x487552[_0x3b9d('0x3b')];_0x189398++){_0x487552[_0x189398][_0x3b9d('0x4e')]=juice(_0x487552[_0x189398][_0x3b9d('0x4e')]);}}_0xf704b2[_0x3b9d('0x5c')]=_0x487552;return _0xf704b2;});}})[_0x3b9d('0xf')](respondWithFilteredResult(_0x282950,_0x4f0ced))['catch'](handleError(_0x282950,null));};exports[_0x3b9d('0x8f')]=function(_0x3c60e2,_0x248133){var _0x4eee5a,_0x5c8efa={},_0x25eb0e;if(_0x3c60e2[_0x3b9d('0x4e')]['to']){_0x25eb0e=_0x3c60e2[_0x3b9d('0x4e')]['to'][_0x3b9d('0x90')](',')[0x0];}return db['MailAccount'][_0x3b9d('0x4c')]({'where':{'id':_0x3c60e2['params']['id']},'include':[{'model':db[_0x3b9d('0x91')],'as':'List','include':[{'model':db[_0x3b9d('0x79')],'as':'Contacts','where':{'email':_0x25eb0e},'limit':0x1,'order':[[_0x3b9d('0x92'),_0x3b9d('0x93')]]}]},{'model':db['MailServerOut'],'as':_0x3b9d('0x2e'),'raw':!![],'include':[{'model':db[_0x3b9d('0x94')],'as':_0x3b9d('0x94'),'raw':!![]}]}]})[_0x3b9d('0xf')](handleEntityNotFound(_0x248133,null))[_0x3b9d('0xf')](function(_0x596f98){if(!_0x596f98)return;_0x4eee5a=_0x596f98;if(!_0x596f98[_0x3b9d('0x2e')])throw new Error(_0x3b9d('0x95'));if(_[_0x3b9d('0x60')](_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0x96')])){_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0x96')]=util[_0x3b9d('0x8b')](_0x3b9d('0x97'),_0x596f98[_0x3b9d('0x2a')],_0x596f98[_0x3b9d('0x98')]||_0x596f98[_0x3b9d('0x2e')]['user']);}if(_0x3c60e2[_0x3b9d('0x4e')]['attachments']&&_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0x99')]['length']){for(var _0x139c0d=0x0;_0x139c0d<_0x3c60e2[_0x3b9d('0x4e')]['attachments'][_0x3b9d('0x3b')];_0x139c0d+=0x1){_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0x99')][_0x139c0d]={'filename':_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0x99')][_0x139c0d]['name'],'path':path[_0x3b9d('0x9a')](config[_0x3b9d('0x9b')],_0x3b9d('0x9c'),_0x3c60e2[_0x3b9d('0x4e')]['attachments'][_0x139c0d][_0x3b9d('0x9d')])};}}var _0x4d2479=_0x596f98['getSmtpOptions']();return respondWithRpcPromise(_0x3b9d('0x9e'),_0x3b9d('0x9f'),{'account':_0x4d2479,'message':_0x3c60e2[_0x3b9d('0x4e')]});})[_0x3b9d('0xf')](function(_0xfb36ea){if(!_0xfb36ea)return;_0x5c8efa=_0xfb36ea;if(!_0x4eee5a['List'])throw new Error(_0x3b9d('0xa0'));if(_0x4eee5a[_0x3b9d('0xa1')][_0x3b9d('0xa2')][_0x3b9d('0x3b')])return _0x4eee5a[_0x3b9d('0xa1')]['Contacts'][0x0];return db[_0x3b9d('0x79')]['create'](_[_0x3b9d('0x9')](_0x3c60e2[_0x3b9d('0x4e')],{'firstName':_0x3c60e2['body']['to'],'email':_0x3c60e2['body']['to'],'phone':_0x3c60e2['body']['to'],'ListId':_0x4eee5a['ListId']}));})['then'](function(_0x74b996){if(!_0x74b996)return;var _0x2f0747={'UserId':_0x3c60e2['user']['id'],'ContactId':_0x74b996['id'],'MailAccountId':_0x4eee5a['id'],'inReplyTo':_0x5c8efa[_0x3b9d('0xa3')],'to':_0x3c60e2[_0x3b9d('0x4e')]['from'],'cc':_0x3c60e2[_0x3b9d('0x4e')]['cc'],'subject':_0x3c60e2['body']['subject'],'attach':_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0xa4')],'firstMsgDirection':_0x3b9d('0xa5'),'lastMsgAt':moment()[_0x3b9d('0x8b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x3b9d('0xa5'),'Messages':[_['merge'](_0x3c60e2[_0x3b9d('0x4e')],{'messageId':_0x5c8efa[_0x3b9d('0xa3')],'sentAt':moment()[_0x3b9d('0x8b')](_0x3b9d('0x8c')),'read':!![],'MailAccountId':_0x4eee5a['id'],'UserId':_0x3c60e2[_0x3b9d('0x64')]['id'],'ContactId':_0x74b996['id']})]};if(_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0xa6')]){_0x2f0747=_['merge'](_0x2f0747,_0x3c60e2[_0x3b9d('0x4e')][_0x3b9d('0xa6')]);}return db[_0x3b9d('0x77')][_0x3b9d('0x5e')](_0x2f0747,{'include':[{'model':db[_0x3b9d('0x89')],'as':'Messages'}]});})[_0x3b9d('0xf')](respondWithResult(_0x248133,null))[_0x3b9d('0x1a')](handleError(_0x248133,null));};exports[_0x3b9d('0xa7')]=function(_0x18428b,_0x3c3839){return db[_0x3b9d('0x46')][_0x3b9d('0x4c')]({'where':{'id':_0x18428b[_0x3b9d('0x4a')]['id']},'include':[{'model':db[_0x3b9d('0x2d')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x3b9d('0xf')](handleEntityNotFound(_0x3c3839,null))[_0x3b9d('0xf')](function(_0x559049){if(!_0x559049[_0x3b9d('0x2e')])return;var _0x477466=_0x559049[_0x3b9d('0xa8')]();return respondWithRpcPromise(_0x3b9d('0xa9'),_0x3b9d('0xa7'),{'account':_0x477466});})['then'](respondWithResult(_0x3c3839,null))[_0x3b9d('0x1a')](handleError(_0x3c3839,null));};exports['destroy']=function(_0xa742da,_0x4ae79c){return db[_0x3b9d('0x46')][_0x3b9d('0x4c')]({'where':{'id':_0xa742da[_0x3b9d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ae79c,null))['then'](function(_0x2a3e48){if(_0x2a3e48&&_0x2a3e48['service']){throw new db[(_0x3b9d('0xaa'))][(_0x3b9d('0xab'))](_0x3b9d('0xac'));}return _0x2a3e48;})[_0x3b9d('0xf')](removeEntity(_0x4ae79c,null))[_0x3b9d('0x1a')](handleError(_0x4ae79c,null));};exports[_0x3b9d('0xad')]=function(_0x53fad9,_0x8c0e4e){return db[_0x3b9d('0x46')][_0x3b9d('0x4c')]({'where':{'id':_0x53fad9[_0x3b9d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x8c0e4e,null))[_0x3b9d('0xf')](function(_0xdfdbfc){if(_0xdfdbfc){return _0xdfdbfc[_0x3b9d('0xad')](_0x53fad9[_0x3b9d('0x4e')][_0x3b9d('0x58')],_['omit'](_0x53fad9[_0x3b9d('0x4e')],[_0x3b9d('0x58'),'id'])||{})[_0x3b9d('0xae')](function(_0x1b841e){for(var _0x191812=0x0;_0x191812<_0x53fad9[_0x3b9d('0x4e')][_0x3b9d('0x58')][_0x3b9d('0x3b')];_0x191812+=0x1){socket['emit'](_0x3b9d('0xaf'),{'UserId':Number(_0x53fad9[_0x3b9d('0x4e')][_0x3b9d('0x58')][_0x191812]),'MailAccountId':Number(_0x53fad9[_0x3b9d('0x4a')]['id'])});}return _0x1b841e;});}})[_0x3b9d('0xf')](respondWithResult(_0x8c0e4e,null))['catch'](handleError(_0x8c0e4e,null));};exports['removeAgents']=function(_0x20f22d,_0x34cd83){return db['MailAccount'][_0x3b9d('0x4c')]({'where':{'id':_0x20f22d[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x34cd83,null))[_0x3b9d('0xf')](function(_0x131602){if(_0x131602){return _0x131602[_0x3b9d('0xb0')](_0x20f22d[_0x3b9d('0x35')][_0x3b9d('0x58')])[_0x3b9d('0xf')](function(){if(_['isArray'](_0x20f22d['query'][_0x3b9d('0x58')])){for(var _0x722e3c=0x0;_0x722e3c<_0x20f22d[_0x3b9d('0x35')]['ids'][_0x3b9d('0x3b')];_0x722e3c+=0x1){socket[_0x3b9d('0xb1')](_0x3b9d('0xb2'),{'UserId':Number(_0x20f22d[_0x3b9d('0x35')][_0x3b9d('0x58')][_0x722e3c]),'MailAccountId':Number(_0x20f22d[_0x3b9d('0x4a')]['id'])});}}else{socket[_0x3b9d('0xb1')]('userMailAccount:remove',{'UserId':Number(_0x20f22d[_0x3b9d('0x35')][_0x3b9d('0x58')]),'MailAccountId':Number(_0x20f22d[_0x3b9d('0x4a')]['id'])});}});}})[_0x3b9d('0xf')](respondWithStatusCode(_0x34cd83,null))[_0x3b9d('0x1a')](handleError(_0x34cd83,null));};exports[_0x3b9d('0xb3')]=function(_0x11a561,_0x5c73a9){var _0x4bd1ea={};var _0xb53f66={};var _0x330ad8;var _0x3e2470;return db[_0x3b9d('0x46')]['findOne']({'where':{'id':_0x11a561[_0x3b9d('0x4a')]['id']}})[_0x3b9d('0xf')](handleEntityNotFound(_0x5c73a9,null))[_0x3b9d('0xf')](function(_0x360bb5){if(_0x360bb5){_0x330ad8=_0x360bb5;_0xb53f66[_0x3b9d('0x34')]=_[_0x3b9d('0x36')](db[_0x3b9d('0x7b')][_0x3b9d('0x31')]);_0xb53f66[_0x3b9d('0x35')]=_[_0x3b9d('0x36')](_0x11a561['query']);_0xb53f66[_0x3b9d('0x37')]=_[_0x3b9d('0x38')](_0xb53f66[_0x3b9d('0x34')],_0xb53f66[_0x3b9d('0x35')]);_0x4bd1ea[_0x3b9d('0x39')]=_[_0x3b9d('0x38')](_0xb53f66[_0x3b9d('0x34')],qs[_0x3b9d('0x3a')](_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x3a')]));_0x4bd1ea[_0x3b9d('0x39')]=_0x4bd1ea[_0x3b9d('0x39')]['length']?_0x4bd1ea[_0x3b9d('0x39')]:_0xb53f66[_0x3b9d('0x34')];_0x4bd1ea['order']=qs[_0x3b9d('0x3f')](_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x3f')]);_0x4bd1ea[_0x3b9d('0x40')]=qs[_0x3b9d('0x37')](_[_0x3b9d('0x41')](_0x11a561[_0x3b9d('0x35')],_0xb53f66[_0x3b9d('0x37')]));if(_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x56')]){_0x4bd1ea[_0x3b9d('0x40')]=_[_0x3b9d('0x42')](_0x4bd1ea[_0x3b9d('0x40')],{'$or':_['map'](_0x4bd1ea[_0x3b9d('0x39')],function(_0x28975a){var _0x230488={};_0x230488[_0x28975a]={'$like':'%'+_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x56')]+'%'};return _0x230488;})});}_0x4bd1ea=_[_0x3b9d('0x42')]({},_0x4bd1ea,_0x11a561[_0x3b9d('0x45')]);return _0x330ad8[_0x3b9d('0xb3')](_0x4bd1ea);}})[_0x3b9d('0xf')](function(_0x27099b){if(_0x27099b){_0x3e2470=_0x27099b['length'];if(!_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x3c')](_0x3b9d('0x3d'))){_0x4bd1ea[_0x3b9d('0x1f')]=qs[_0x3b9d('0x1f')](_0x11a561[_0x3b9d('0x35')][_0x3b9d('0x1f')]);_0x4bd1ea[_0x3b9d('0x1e')]=qs[_0x3b9d('0x1e')](_0x11a561[_0x3b9d('0x35')]['offset']);}return _0x330ad8[_0x3b9d('0xb3')](_0x4bd1ea);}})['then'](function(_0x109de9){if(_0x109de9){return _0x109de9?{'count':_0x3e2470,'rows':_0x109de9}:null;}})[_0x3b9d('0xf')](respondWithResult(_0x5c73a9,null))[_0x3b9d('0x1a')](handleError(_0x5c73a9,null));}; \ No newline at end of file +var _0xd953=['List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./mailAccount.socket','register','http','request','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','UserProfileResource','end','stack','name','send','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','Imap','rawAttributes','keys','find','body','modernAuthentication','Smtp','secure','CloudProviderId','addDisposition','Disposition','create','findOne','pick','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','provider','custom','ListId','isNil','active','description','user','username','password','pass','service','host','port','authentication','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','order','CmContact','Contact','User','internal','Tag','tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','true','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','sendMail'];(function(_0x3bec19,_0x2141df){var _0x4431b5=function(_0x51c836){while(--_0x51c836){_0x3bec19['push'](_0x3bec19['shift']());}};_0x4431b5(++_0x2141df);}(_0xd953,0x16c));var _0x3d95=function(_0x16bbaf,_0x2c1a63){_0x16bbaf=_0x16bbaf-0x0;var _0x5bff5f=_0xd953[_0x16bbaf];return _0x5bff5f;};'use strict';var moment=require(_0x3d95('0x0'));var BPromise=require(_0x3d95('0x1'));var util=require('util');var path=require(_0x3d95('0x2'));var _=require('lodash');var juice=require('juice');var Redis=require(_0x3d95('0x3'));var qs=require(_0x3d95('0x4'));var logger=require(_0x3d95('0x5'))(_0x3d95('0x6'));var config=require(_0x3d95('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3d95('0x8')](config[_0x3d95('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d95('0xa'))(new Redis(config[_0x3d95('0x9')]));require(_0x3d95('0xb'))[_0x3d95('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3d95('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x43a64f,_0x2e056f,_0x710173,_0x13085e){return new BPromise(function(_0x399cb5,_0x23f1d7){var _0x148b4f=_0x13085e||client;return _0x148b4f[_0x3d95('0xe')](_0x43a64f,_0x710173)['then'](function(_0x85e802){logger[_0x3d95('0xf')]('MailAccount,\x20%s,\x20%s',_0x2e056f,_0x3d95('0x10'));logger[_0x3d95('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2e056f,_0x3d95('0x10'),JSON[_0x3d95('0x12')](_0x85e802));if(_0x85e802[_0x3d95('0x13')]){if(_0x85e802[_0x3d95('0x13')][_0x3d95('0x14')]===0x1f4){logger[_0x3d95('0x13')](_0x3d95('0x15'),_0x2e056f,_0x85e802[_0x3d95('0x13')][_0x3d95('0x16')]);return _0x23f1d7(_0x85e802['error'][_0x3d95('0x16')]);}logger[_0x3d95('0x13')](_0x3d95('0x15'),_0x2e056f,_0x85e802['error'][_0x3d95('0x16')]);return _0x399cb5(_0x85e802[_0x3d95('0x13')]['message']);}else{logger['info'](_0x3d95('0x15'),_0x2e056f,'request\x20sent');_0x399cb5(_0x85e802[_0x3d95('0x17')]['message']);}})[_0x3d95('0x18')](function(_0x3ab075){logger['error'](_0x3d95('0x15'),_0x2e056f,_0x3ab075);_0x23f1d7(_0x3ab075);});});}function respondWithStatusCode(_0x127ceb,_0x16437c){_0x16437c=_0x16437c||0xcc;return function(_0x2fdecf){if(_0x2fdecf){return _0x127ceb[_0x3d95('0x19')](_0x16437c);}return _0x127ceb[_0x3d95('0x1a')](_0x16437c)['end']();};}function respondWithResult(_0x27e3f2,_0x176e56){_0x176e56=_0x176e56||0xc8;return function(_0x4a3356){if(_0x4a3356){return _0x27e3f2[_0x3d95('0x1a')](_0x176e56)[_0x3d95('0x1b')](_0x4a3356);}};}function respondWithFilteredResult(_0x43d5d3,_0x5e1ac6){return function(_0x570e25){if(_0x570e25){var _0xb9dd24=typeof _0x5e1ac6[_0x3d95('0x1c')]===_0x3d95('0x1d')&&typeof _0x5e1ac6[_0x3d95('0x1e')]===_0x3d95('0x1d');var _0x3d13c8=_0x570e25['count'];var _0x3fa813=_0xb9dd24?0x0:_0x5e1ac6[_0x3d95('0x1c')];var _0x1f6d0b=_0xb9dd24?_0x570e25[_0x3d95('0x1f')]:_0x5e1ac6[_0x3d95('0x1c')]+_0x5e1ac6[_0x3d95('0x1e')];var _0x394d28;if(_0x1f6d0b>=_0x3d13c8){_0x1f6d0b=_0x3d13c8;_0x394d28=0xc8;}else{_0x394d28=0xce;}_0x43d5d3[_0x3d95('0x1a')](_0x394d28);return _0x43d5d3[_0x3d95('0x20')]('Content-Range',_0x3fa813+'-'+_0x1f6d0b+'/'+_0x3d13c8)[_0x3d95('0x1b')](_0x570e25);}return null;};}function saveUpdates(_0x47a84e){return function(_0x265a97){if(_0x265a97){return _0x265a97[_0x3d95('0x21')](_0x47a84e)[_0x3d95('0x22')](function(_0x167126){return _0x167126;});}return null;};}function removeEntity(_0x389e5b){return function(_0x98c3df){if(_0x98c3df){return _0x98c3df[_0x3d95('0x23')]()['then'](function(){var _0x4001d1=_0x98c3df['get']({'plain':!![]});var _0x3a6535='MailAccounts';return db[_0x3d95('0x24')][_0x3d95('0x23')]({'where':{'type':_0x3a6535,'resourceId':_0x4001d1['id']}})[_0x3d95('0x22')](function(){return _0x98c3df;});})['then'](function(){_0x389e5b['status'](0xcc)[_0x3d95('0x25')]();});}};}function handleEntityNotFound(_0x35c62d){return function(_0xe99750){if(!_0xe99750){_0x35c62d[_0x3d95('0x19')](0x194);}return _0xe99750;};}function handleError(_0x35788b,_0x124f75){_0x124f75=_0x124f75||0x1f4;return function(_0x388226){logger[_0x3d95('0x13')](_0x388226[_0x3d95('0x26')]);if(_0x388226[_0x3d95('0x27')]){delete _0x388226['name'];}_0x35788b[_0x3d95('0x1a')](_0x124f75)[_0x3d95('0x28')](_0x388226);};}exports['index']=function(_0x5e4f68,_0x68855d){var _0x5bd0ad={'include':[{'model':db[_0x3d95('0x29')],'as':'Imap'},{'model':db[_0x3d95('0x2a')],'as':'Smtp'},{'model':db[_0x3d95('0x2b')],'as':_0x3d95('0x2c')}]},_0x519edf={},_0x2dd5c6={'count':0x0,'rows':[]};var _0x1cce0a=_[_0x3d95('0x2d')](db[_0x3d95('0x2e')]['rawAttributes'],function(_0x2ed9ff){return{'name':_0x2ed9ff[_0x3d95('0x2f')],'type':_0x2ed9ff[_0x3d95('0x30')][_0x3d95('0x31')]};});_0x519edf[_0x3d95('0x32')]=_[_0x3d95('0x2d')](_0x1cce0a,_0x3d95('0x27'));_0x519edf[_0x3d95('0x33')]=_['keys'](_0x5e4f68[_0x3d95('0x33')]);_0x519edf[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x519edf[_0x3d95('0x32')],_0x519edf[_0x3d95('0x33')]);_0x5bd0ad[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x519edf[_0x3d95('0x32')],qs['fields'](_0x5e4f68['query'][_0x3d95('0x37')]));_0x5bd0ad['attributes']=_0x5bd0ad[_0x3d95('0x36')][_0x3d95('0x38')]?_0x5bd0ad[_0x3d95('0x36')]:_0x519edf[_0x3d95('0x32')];if(!_0x5e4f68['query'][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x5bd0ad[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x5e4f68['query'][_0x3d95('0x1e')]);_0x5bd0ad['offset']=qs[_0x3d95('0x1c')](_0x5e4f68[_0x3d95('0x33')][_0x3d95('0x1c')]);}_0x5bd0ad['order']=qs[_0x3d95('0x3b')](_0x5e4f68[_0x3d95('0x33')]['sort']);_0x5bd0ad[_0x3d95('0x3c')]=qs['filters'](_['pick'](_0x5e4f68[_0x3d95('0x33')],_0x519edf['filters']),_0x1cce0a);if(_0x5e4f68[_0x3d95('0x33')]['filter']){_0x5bd0ad[_0x3d95('0x3c')]=_[_0x3d95('0x3d')](_0x5bd0ad[_0x3d95('0x3c')],{'$or':_[_0x3d95('0x2d')](_0x1cce0a,function(_0x372c9f){if(_0x372c9f[_0x3d95('0x30')]!==_0x3d95('0x3e')){var _0x5d193b={};_0x5d193b[_0x372c9f[_0x3d95('0x27')]]={'$like':'%'+_0x5e4f68['query'][_0x3d95('0x3f')]+'%'};return _0x5d193b;}})});}_0x5bd0ad=_['merge']({},_0x5bd0ad,_0x5e4f68[_0x3d95('0x40')]);var _0x319cf1={'where':_0x5bd0ad['where']};return db['MailAccount'][_0x3d95('0x1f')](_0x319cf1)['then'](function(_0x44dca7){_0x2dd5c6['count']=_0x44dca7;if(_0x5e4f68[_0x3d95('0x33')][_0x3d95('0x41')]){_0x5bd0ad[_0x3d95('0x42')]=[{'all':!![]}];}return db[_0x3d95('0x2e')][_0x3d95('0x43')](_0x5bd0ad);})[_0x3d95('0x22')](function(_0x5c201c){_0x2dd5c6[_0x3d95('0x44')]=_0x5c201c;return _0x2dd5c6;})[_0x3d95('0x22')](respondWithFilteredResult(_0x68855d,_0x5bd0ad))[_0x3d95('0x18')](handleError(_0x68855d,null));};exports['show']=function(_0x2d3a4e,_0x1ab1b9){var _0x1f4e90={'raw':![],'where':{'id':_0x2d3a4e[_0x3d95('0x45')]['id']},'include':[{'model':db[_0x3d95('0x29')],'as':_0x3d95('0x46')},{'model':db[_0x3d95('0x2a')],'as':'Smtp'},{'model':db[_0x3d95('0x2b')],'as':_0x3d95('0x2c')}]},_0x38d183={};_0x38d183[_0x3d95('0x32')]=_['keys'](db[_0x3d95('0x2e')][_0x3d95('0x47')]);_0x38d183[_0x3d95('0x33')]=_[_0x3d95('0x48')](_0x2d3a4e['query']);_0x38d183[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x38d183[_0x3d95('0x32')],_0x38d183[_0x3d95('0x33')]);_0x1f4e90[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x38d183[_0x3d95('0x32')],qs[_0x3d95('0x37')](_0x2d3a4e['query'][_0x3d95('0x37')]));_0x1f4e90[_0x3d95('0x36')]=_0x1f4e90[_0x3d95('0x36')][_0x3d95('0x38')]?_0x1f4e90[_0x3d95('0x36')]:_0x38d183[_0x3d95('0x32')];if(_0x2d3a4e[_0x3d95('0x33')]['includeAll']){_0x1f4e90[_0x3d95('0x42')]=[{'all':!![]}];}_0x1f4e90=_[_0x3d95('0x3d')]({},_0x1f4e90,_0x2d3a4e[_0x3d95('0x40')]);return db[_0x3d95('0x2e')][_0x3d95('0x49')](_0x1f4e90)['then'](handleEntityNotFound(_0x1ab1b9,null))[_0x3d95('0x22')](respondWithResult(_0x1ab1b9,null))[_0x3d95('0x18')](handleError(_0x1ab1b9,null));};exports['update']=function(_0x12f9bb,_0x4fe6b6){if(_0x12f9bb[_0x3d95('0x4a')]['id']){delete _0x12f9bb[_0x3d95('0x4a')]['id'];}if(_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x46')]){if(!_0x12f9bb['body'][_0x3d95('0x46')][_0x3d95('0x4b')]){_0x12f9bb[_0x3d95('0x4a')]['Imap']['CloudProviderId']=null;}}if(_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x4c')]){if(_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x4c')][_0x3d95('0x4b')]){_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x4c')][_0x3d95('0x4d')]=![];}else{_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x4c')][_0x3d95('0x4e')]=null;}}return db[_0x3d95('0x2e')][_0x3d95('0x49')]({'where':{'id':_0x12f9bb['params']['id']},'include':[{'model':db[_0x3d95('0x29')],'as':_0x3d95('0x46')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3d95('0x2b')],'as':_0x3d95('0x2c')}]})['then'](handleEntityNotFound(_0x4fe6b6,null))[_0x3d95('0x22')](saveUpdates(_0x12f9bb['body'],null))[_0x3d95('0x22')](function(_0x5a56f1){if(_0x5a56f1&&_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x46')]){return db[_0x3d95('0x29')][_0x3d95('0x21')](_0x12f9bb[_0x3d95('0x4a')][_0x3d95('0x46')],{'where':{'MailAccountId':_0x5a56f1['id']}})[_0x3d95('0x22')](function(){return _0x5a56f1;});}return _0x5a56f1;})['then'](function(_0x3615e4){if(_0x3615e4&&_0x12f9bb['body'][_0x3d95('0x4c')]){return db[_0x3d95('0x2a')][_0x3d95('0x21')](_0x12f9bb[_0x3d95('0x4a')]['Smtp'],{'where':{'MailAccountId':_0x3615e4['id']}})[_0x3d95('0x22')](function(){return _0x3615e4;});}return _0x3615e4;})[_0x3d95('0x22')](respondWithResult(_0x4fe6b6,null))[_0x3d95('0x18')](handleError(_0x4fe6b6,null));};exports['describe']=function(_0x1adaf2,_0x3c01c8){return db[_0x3d95('0x2e')]['describe']()[_0x3d95('0x22')](respondWithResult(_0x3c01c8,null))[_0x3d95('0x18')](handleError(_0x3c01c8,null));};exports[_0x3d95('0x4f')]=function(_0x83857,_0x3bdc2f){if(_0x83857['body']['id']){delete _0x83857[_0x3d95('0x4a')]['id'];}return db[_0x3d95('0x2e')][_0x3d95('0x49')]({'where':{'id':_0x83857[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x3bdc2f,null))[_0x3d95('0x22')](function(_0x3f4107){if(_0x3f4107){_0x83857['body']['MailAccountId']=_0x3f4107['id'];return db[_0x3d95('0x50')][_0x3d95('0x51')](_0x83857[_0x3d95('0x4a')]);}})[_0x3d95('0x22')](respondWithResult(_0x3bdc2f,null))[_0x3d95('0x18')](handleError(_0x3bdc2f,null));};exports['getDispositions']=function(_0x15819d,_0x5d492b){var _0x9ae4ef={'raw':![],'where':{}};var _0x33fcfd={};var _0x496847={'count':0x0,'rows':[]};return db['MailAccount'][_0x3d95('0x52')]({'where':{'id':_0x15819d['params']['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x5d492b,null))[_0x3d95('0x22')](function(_0x3a7e04){if(_0x3a7e04){_0x33fcfd[_0x3d95('0x32')]=_[_0x3d95('0x48')](db['Disposition']['rawAttributes']);_0x33fcfd[_0x3d95('0x33')]=_[_0x3d95('0x48')](_0x15819d['query']);_0x33fcfd[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x33fcfd[_0x3d95('0x32')],_0x33fcfd[_0x3d95('0x33')]);_0x9ae4ef['attributes']=_['intersection'](_0x33fcfd['model'],qs[_0x3d95('0x37')](_0x15819d['query'][_0x3d95('0x37')]));_0x9ae4ef['attributes']=_0x9ae4ef[_0x3d95('0x36')]['length']?_0x9ae4ef[_0x3d95('0x36')]:_0x33fcfd[_0x3d95('0x32')];if(!_0x15819d['query'][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x9ae4ef[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x15819d[_0x3d95('0x33')]['limit']);_0x9ae4ef['offset']=qs['offset'](_0x15819d[_0x3d95('0x33')][_0x3d95('0x1c')]);}_0x9ae4ef['order']=qs[_0x3d95('0x3b')](_0x15819d[_0x3d95('0x33')][_0x3d95('0x3b')]);_0x9ae4ef[_0x3d95('0x3c')]=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x15819d[_0x3d95('0x33')],_0x33fcfd['filters']));_0x9ae4ef['where'][_0x3d95('0x54')]=_0x3a7e04['id'];if(_0x15819d[_0x3d95('0x33')][_0x3d95('0x3f')]){_0x9ae4ef[_0x3d95('0x3c')]=_[_0x3d95('0x3d')](_0x9ae4ef[_0x3d95('0x3c')],{'$or':_[_0x3d95('0x2d')](_0x9ae4ef[_0x3d95('0x36')],function(_0x567848){var _0x5e921a={};_0x5e921a[_0x567848]={'$like':'%'+_0x15819d[_0x3d95('0x33')][_0x3d95('0x3f')]+'%'};return _0x5e921a;})});}_0x9ae4ef=_[_0x3d95('0x3d')]({},_0x9ae4ef,_0x15819d[_0x3d95('0x40')]);return db['Disposition'][_0x3d95('0x1f')]({'where':_0x9ae4ef[_0x3d95('0x3c')]})['then'](function(_0x484939){_0x496847[_0x3d95('0x1f')]=_0x484939;if(_0x15819d[_0x3d95('0x33')][_0x3d95('0x41')]){_0x9ae4ef[_0x3d95('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x3d95('0x43')](_0x9ae4ef);})[_0x3d95('0x22')](function(_0x203b15){_0x496847[_0x3d95('0x44')]=_0x203b15;return _0x496847;});}})[_0x3d95('0x22')](respondWithFilteredResult(_0x5d492b,_0x9ae4ef))[_0x3d95('0x18')](handleError(_0x5d492b,null));};exports[_0x3d95('0x55')]=function(_0x3bdf86,_0x3f6b5d){return db[_0x3d95('0x2e')]['find']({'where':{'id':_0x3bdf86['params']['id']}})['then'](handleEntityNotFound(_0x3f6b5d,null))['then'](function(_0x38246e){if(_0x38246e){return _0x38246e['removeDispositions'](_0x3bdf86[_0x3d95('0x33')][_0x3d95('0x56')]);}})['then'](respondWithStatusCode(_0x3f6b5d,null))['catch'](handleError(_0x3f6b5d,null));};exports[_0x3d95('0x57')]=function(_0x149acb,_0x33c450){if(_0x149acb[_0x3d95('0x4a')]['id']){delete _0x149acb['body']['id'];}return db['MailAccount'][_0x3d95('0x49')]({'where':{'id':_0x149acb[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x33c450,null))[_0x3d95('0x22')](function(_0x4361b0){if(_0x4361b0){_0x149acb['body'][_0x3d95('0x54')]=_0x4361b0['id'];return db[_0x3d95('0x58')][_0x3d95('0x51')](_0x149acb[_0x3d95('0x4a')]);}})[_0x3d95('0x22')](respondWithResult(_0x33c450,null))[_0x3d95('0x18')](handleError(_0x33c450,null));};exports['getAnswers']=function(_0x647db9,_0x1f2ca4){var _0x514ba2={'raw':![],'where':{}};var _0x27051f={};var _0x1e7fce={'count':0x0,'rows':[]};return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x647db9[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x1f2ca4,null))[_0x3d95('0x22')](function(_0xb9ae44){if(_0xb9ae44){_0x27051f[_0x3d95('0x32')]=_['keys'](db[_0x3d95('0x58')][_0x3d95('0x47')]);_0x27051f['query']=_['keys'](_0x647db9[_0x3d95('0x33')]);_0x27051f[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x27051f['model'],_0x27051f[_0x3d95('0x33')]);_0x514ba2['attributes']=_['intersection'](_0x27051f['model'],qs['fields'](_0x647db9['query'][_0x3d95('0x37')]));_0x514ba2[_0x3d95('0x36')]=_0x514ba2['attributes'][_0x3d95('0x38')]?_0x514ba2['attributes']:_0x27051f[_0x3d95('0x32')];if(!_0x647db9[_0x3d95('0x33')][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x514ba2[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x647db9[_0x3d95('0x33')][_0x3d95('0x1e')]);_0x514ba2[_0x3d95('0x1c')]=qs['offset'](_0x647db9[_0x3d95('0x33')][_0x3d95('0x1c')]);}_0x514ba2['order']=qs[_0x3d95('0x3b')](_0x647db9[_0x3d95('0x33')][_0x3d95('0x3b')]);_0x514ba2['where']=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x647db9['query'],_0x27051f['filters']));_0x514ba2[_0x3d95('0x3c')]['MailAccountId']=_0xb9ae44['id'];if(_0x647db9['query']['filter']){_0x514ba2['where']=_[_0x3d95('0x3d')](_0x514ba2[_0x3d95('0x3c')],{'$or':_[_0x3d95('0x2d')](_0x514ba2[_0x3d95('0x36')],function(_0x5deff6){var _0x175477={};_0x175477[_0x5deff6]={'$like':'%'+_0x647db9[_0x3d95('0x33')]['filter']+'%'};return _0x175477;})});}_0x514ba2=_[_0x3d95('0x3d')]({},_0x514ba2,_0x647db9[_0x3d95('0x40')]);return db['CannedAnswer']['count']({'where':_0x514ba2['where']})[_0x3d95('0x22')](function(_0x4f5bf4){_0x1e7fce[_0x3d95('0x1f')]=_0x4f5bf4;if(_0x647db9['query'][_0x3d95('0x41')]){_0x514ba2['include']=[{'all':!![]}];}return db[_0x3d95('0x58')][_0x3d95('0x43')](_0x514ba2);})['then'](function(_0x5bf968){_0x1e7fce[_0x3d95('0x44')]=_0x5bf968;return _0x1e7fce;});}})[_0x3d95('0x22')](respondWithFilteredResult(_0x1f2ca4,_0x514ba2))[_0x3d95('0x18')](handleError(_0x1f2ca4,null));};exports[_0x3d95('0x59')]=function(_0x11f904,_0x56b5e9){return db['MailAccount'][_0x3d95('0x49')]({'where':{'id':_0x11f904[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x56b5e9,null))[_0x3d95('0x22')](function(_0xb9fc97){if(_0xb9fc97){return _0xb9fc97['removeAnswers'](_0x11f904[_0x3d95('0x33')][_0x3d95('0x56')]);}})[_0x3d95('0x22')](respondWithStatusCode(_0x56b5e9,null))[_0x3d95('0x18')](handleError(_0x56b5e9,null));};exports[_0x3d95('0x51')]=function(_0x8431e0,_0x199d3b){var _0x2ebc6e={'name':_0x8431e0['body'][_0x3d95('0x27')],'key':_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x31')],'provider':_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x5a')]===_0x3d95('0x5b')?null:_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x5a')],'email':_0x8431e0[_0x3d95('0x4a')]['email'],'ListId':_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x5c')],'active':!_[_0x3d95('0x5d')](_0x8431e0['body'][_0x3d95('0x5e')])?_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x5e')]:!![],'description':_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x5f')]||null,'Imap':{},'Smtp':{}};if(_0x2ebc6e[_0x3d95('0x5a')]){_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x60')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x60')]=_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x61')];_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x62')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x63')]=_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x62')];if(_0x8431e0[_0x3d95('0x4a')]['modernAuthentication']){_0x2ebc6e['Imap'][_0x3d95('0x4b')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x4b')]=!![];_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x4e')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x4e')]=_0x8431e0[_0x3d95('0x4a')]['CloudProviderId'];_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x62')]=_0x2ebc6e[_0x3d95('0x4c')]['pass']=null;_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x4d')]=![];}else{_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x4e')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x4e')]=null;}_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x64')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x64')]=null;_0x2ebc6e['Imap'][_0x3d95('0x65')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x65')]=null;_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x66')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x66')]=null;}else{if(_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x67')]){_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x60')]=_0x2ebc6e['Smtp'][_0x3d95('0x60')]=_0x8431e0[_0x3d95('0x4a')]['username'];_0x2ebc6e[_0x3d95('0x46')]['password']=_0x2ebc6e['Smtp']['pass']=_0x8431e0[_0x3d95('0x4a')]['password'];}else{_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x67')]=_0x2ebc6e['Smtp']['authentication']=![];_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x60')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x60')]=null;_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x62')]=_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x63')]=null;}_0x2ebc6e[_0x3d95('0x46')][_0x3d95('0x65')]=_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x46')][_0x3d95('0x65')];_0x2ebc6e['Imap']['port']=_0x8431e0[_0x3d95('0x4a')]['Imap'][_0x3d95('0x66')];_0x2ebc6e[_0x3d95('0x4c')][_0x3d95('0x65')]=_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x4c')][_0x3d95('0x65')];_0x2ebc6e['Smtp'][_0x3d95('0x66')]=_0x8431e0[_0x3d95('0x4a')][_0x3d95('0x4c')][_0x3d95('0x66')];}return db[_0x3d95('0x2e')][_0x3d95('0x51')](_0x2ebc6e,{'include':[{'model':db[_0x3d95('0x2a')],'as':'Smtp'},{'model':db[_0x3d95('0x29')],'as':'Imap'}]})[_0x3d95('0x22')](function(_0x736d34){var _0x1e3067=_0x8431e0[_0x3d95('0x60')][_0x3d95('0x68')]({'plain':!![]});if(!_0x1e3067)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e3067[_0x3d95('0x69')]===_0x3d95('0x60')){var _0x2fc535=_0x736d34['get']({'plain':!![]});return db[_0x3d95('0x6a')][_0x3d95('0x49')]({'where':{'name':'MailAccounts','userProfileId':_0x1e3067['userProfileId']},'raw':!![]})[_0x3d95('0x22')](function(_0x30ce70){if(_0x30ce70&&_0x30ce70[_0x3d95('0x6b')]===0x0){return db[_0x3d95('0x24')][_0x3d95('0x51')]({'name':_0x2fc535[_0x3d95('0x27')],'resourceId':_0x2fc535['id'],'type':_0x30ce70[_0x3d95('0x27')],'sectionId':_0x30ce70['id']},{})[_0x3d95('0x22')](function(){return _0x736d34;});}else{return _0x736d34;}})[_0x3d95('0x18')](function(_0x531bf7){logger['error'](_0x3d95('0x6c'),_0x531bf7);throw _0x531bf7;});}return _0x736d34;})[_0x3d95('0x22')](respondWithResult(_0x199d3b,0xc9))[_0x3d95('0x18')](handleError(_0x199d3b,null));};exports[_0x3d95('0x6d')]=function(_0x3b778f,_0x206dcf){return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x3b778f['params']['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x206dcf,null))['then'](function(_0x594d31){if(_0x594d31){return _0x594d31[_0x3d95('0x6d')]();}return null;})[_0x3d95('0x22')](respondWithResult(_0x206dcf,null))[_0x3d95('0x18')](handleError(_0x206dcf,null));};exports[_0x3d95('0x6e')]=function(_0x21f957,_0x2eeabf){if(_0x21f957[_0x3d95('0x4a')]['id']){delete _0x21f957[_0x3d95('0x4a')]['id'];}return db[_0x3d95('0x2e')]['find']({'where':{'id':_0x21f957[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x2eeabf,null))[_0x3d95('0x22')](function(_0x52c528){if(_0x52c528){_0x21f957[_0x3d95('0x4a')][_0x3d95('0x54')]=_0x52c528['id'];return db[_0x3d95('0x29')]['create'](_0x21f957[_0x3d95('0x4a')]);}})['then'](respondWithResult(_0x2eeabf,null))['catch'](handleError(_0x2eeabf,null));};exports['removeImap']=function(_0x44131d,_0xaad38e){return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x44131d['params']['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0xaad38e,null))[_0x3d95('0x22')](function(_0x178eb7){if(_0x178eb7){return _0x178eb7[_0x3d95('0x6f')](null);}return null;})['then'](respondWithStatusCode(_0xaad38e,null))[_0x3d95('0x18')](handleError(_0xaad38e,null));};exports[_0x3d95('0x70')]=function(_0x1857b3,_0x56117f){return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x1857b3[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x56117f,null))[_0x3d95('0x22')](function(_0x4e15e0){if(_0x4e15e0){return _0x4e15e0[_0x3d95('0x70')]();}return null;})['then'](respondWithResult(_0x56117f,null))[_0x3d95('0x18')](handleError(_0x56117f,null));};exports[_0x3d95('0x71')]=function(_0x297ef1,_0x1ba98c){if(_0x297ef1['body']['id']){delete _0x297ef1[_0x3d95('0x4a')]['id'];}return db[_0x3d95('0x2e')][_0x3d95('0x49')]({'where':{'id':_0x297ef1[_0x3d95('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ba98c,null))[_0x3d95('0x22')](function(_0x4cbfd3){if(_0x4cbfd3){_0x297ef1[_0x3d95('0x4a')][_0x3d95('0x54')]=_0x4cbfd3['id'];return db['MailServerOut'][_0x3d95('0x51')](_0x297ef1[_0x3d95('0x4a')]);}})['then'](respondWithResult(_0x1ba98c,null))[_0x3d95('0x18')](handleError(_0x1ba98c,null));};exports[_0x3d95('0x72')]=function(_0x2cd8e8,_0x2df7e2){return db['MailAccount'][_0x3d95('0x52')]({'where':{'id':_0x2cd8e8['params']['id']}})['then'](handleEntityNotFound(_0x2df7e2,null))['then'](function(_0x353de9){if(_0x353de9){return _0x353de9[_0x3d95('0x73')](null);}return null;})[_0x3d95('0x22')](respondWithStatusCode(_0x2df7e2,null))['catch'](handleError(_0x2df7e2,null));};exports[_0x3d95('0x74')]=function(_0x3665f9,_0x2f0b3d){return db['MailInteraction'][_0x3d95('0x49')]({'where':{'id':_0x3665f9['params']['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x2f0b3d,null))[_0x3d95('0x22')](function(_0x140181){if(_0x140181){return _0x140181[_0x3d95('0x74')](_0x3665f9[_0x3d95('0x4a')][_0x3d95('0x56')],_[_0x3d95('0x75')](_0x3665f9[_0x3d95('0x4a')],['ids','id'])||{});}})[_0x3d95('0x22')](respondWithResult(_0x2f0b3d,null))[_0x3d95('0x18')](handleError(_0x2f0b3d,null));};exports[_0x3d95('0x76')]=function(_0x43cbdf,_0x4aefb1){var _0x31b140={'raw':![],'where':{}};var _0x15e08b={};var _0x12c3ac={'count':0x0,'rows':[]};return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x43cbdf[_0x3d95('0x45')]['id']}})['then'](handleEntityNotFound(_0x4aefb1,null))[_0x3d95('0x22')](function(_0x4ccaf0){if(_0x4ccaf0){_0x15e08b[_0x3d95('0x32')]=_['keys'](db[_0x3d95('0x77')][_0x3d95('0x47')]);_0x15e08b['query']=_[_0x3d95('0x48')](_0x43cbdf[_0x3d95('0x33')]);_0x15e08b[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x15e08b['model'],_0x15e08b[_0x3d95('0x33')]);_0x31b140[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x15e08b[_0x3d95('0x32')],qs[_0x3d95('0x37')](_0x43cbdf[_0x3d95('0x33')]['fields']));_0x31b140[_0x3d95('0x36')]=_0x31b140[_0x3d95('0x36')][_0x3d95('0x38')]?_0x31b140['attributes']:_0x15e08b[_0x3d95('0x32')];if(!_0x43cbdf['query'][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x31b140[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x1e')]);_0x31b140[_0x3d95('0x1c')]=qs[_0x3d95('0x1c')](_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x1c')]);}_0x31b140[_0x3d95('0x78')]=qs['sort'](_0x43cbdf['query'][_0x3d95('0x3b')]);_0x31b140[_0x3d95('0x3c')]=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x43cbdf[_0x3d95('0x33')],_0x15e08b[_0x3d95('0x34')]));_0x31b140[_0x3d95('0x3c')]['MailAccountId']=_0x4ccaf0['id'];if(_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x3f')]){_0x31b140['where']=_[_0x3d95('0x3d')](_0x31b140[_0x3d95('0x3c')],{'$or':_['map'](_0x31b140[_0x3d95('0x36')],function(_0x170267){var _0x26cd22={};_0x26cd22[_0x170267]={'$like':'%'+_0x43cbdf['query']['filter']+'%'};return _0x26cd22;})});}_0x31b140=_[_0x3d95('0x3d')]({},_0x31b140,_0x43cbdf[_0x3d95('0x40')]);return db[_0x3d95('0x77')][_0x3d95('0x1f')]({'where':_0x31b140[_0x3d95('0x3c')]})[_0x3d95('0x22')](function(_0x389007){_0x12c3ac[_0x3d95('0x1f')]=_0x389007;if(_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x41')]){_0x31b140[_0x3d95('0x42')]=[{'model':db[_0x3d95('0x79')],'as':_0x3d95('0x7a'),'required':![]},{'model':db[_0x3d95('0x7b')],'as':'Owner','attributes':[_0x3d95('0x27'),'fullname',_0x3d95('0x7c')],'required':![]},{'model':db[_0x3d95('0x7d')],'as':'Tags','attributes':['id','name','color'],'where':_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x7e')]?{'id':_0x43cbdf[_0x3d95('0x33')][_0x3d95('0x7e')]}:undefined,'required':_0x43cbdf['query']['tag']?!![]:![]}];}return db[_0x3d95('0x77')][_0x3d95('0x43')](_0x31b140);})[_0x3d95('0x22')](function(_0xc1859b){_0x12c3ac[_0x3d95('0x44')]=_0xc1859b;return _0x12c3ac;});}})[_0x3d95('0x22')](respondWithFilteredResult(_0x4aefb1,_0x31b140))[_0x3d95('0x18')](handleError(_0x4aefb1,null));};exports[_0x3d95('0x7f')]=function addApplications(_0x18acbc,_0x439ee8){var _0x3b3be4=_0x18acbc[_0x3d95('0x45')]['id'];var _0x1ced90=_0x18acbc[_0x3d95('0x4a')];var _0x28a317=0xc8;var _0x2071a8=null;return db[_0x3d95('0x80')]['transaction']({'isolationLevel':db['sequelize'][_0x3d95('0x81')]['ISOLATION_LEVELS'][_0x3d95('0x82')]},function(_0x398747){return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x3b3be4},'transaction':_0x398747})['then'](function(_0x45bdcd){if(_0x45bdcd){return db[_0x3d95('0x83')][_0x3d95('0x23')]({'where':{'MailAccountId':_0x3b3be4},'transaction':_0x398747})['then'](function(){var _0x21f6b3=_['map'](_0x1ced90,function(_0x186c6b){_0x186c6b[_0x3d95('0x54')]=_0x3b3be4;return _0x186c6b;});return db[_0x3d95('0x83')]['bulkCreate'](_0x21f6b3,{'transaction':_0x398747});});}else{_0x28a317=0x194;_0x2071a8=[];}});})[_0x3d95('0x22')](function(){if(_0x28a317!==0x194){return db[_0x3d95('0x83')][_0x3d95('0x84')]({'where':{'MailAccountId':_0x3b3be4},'order':_0x3d95('0x85')})[_0x3d95('0x22')](function(_0x418706){_0x2071a8=_0x418706;});}})[_0x3d95('0x18')](function(_0x6b5596){_0x28a317=0x1f4;logger[_0x3d95('0x13')](_0x6b5596[_0x3d95('0x26')]);if(_0x6b5596[_0x3d95('0x27')]){delete _0x6b5596['name'];}_0x2071a8=_0x6b5596;})[_0x3d95('0x86')](function(){if(_0x2071a8===null){_0x439ee8[_0x3d95('0x19')](_0x28a317);}else{if(_0x28a317===0x1f4){_0x439ee8[_0x3d95('0x1a')](_0x28a317)['send'](_0x2071a8);}else{_0x439ee8['status'](_0x28a317)[_0x3d95('0x1b')](_0x2071a8);}}});};exports['getApplications']=function(_0x2a5b01,_0x2ac680){var _0x29f670={};var _0x5494bf={};var _0x215317;var _0x3f00ed;return db[_0x3d95('0x2e')]['findOne']({'where':{'id':_0x2a5b01[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x2ac680,null))[_0x3d95('0x22')](function(_0x441aaf){if(_0x441aaf){_0x215317=_0x441aaf;_0x5494bf[_0x3d95('0x32')]=_[_0x3d95('0x48')](db['MailApplication'][_0x3d95('0x47')]);_0x5494bf[_0x3d95('0x33')]=_['keys'](_0x2a5b01[_0x3d95('0x33')]);_0x5494bf[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x5494bf[_0x3d95('0x32')],_0x5494bf[_0x3d95('0x33')]);_0x29f670['attributes']=_['intersection'](_0x5494bf[_0x3d95('0x32')],qs[_0x3d95('0x37')](_0x2a5b01['query'][_0x3d95('0x37')]));_0x29f670[_0x3d95('0x36')]=_0x29f670[_0x3d95('0x36')][_0x3d95('0x38')]?_0x29f670[_0x3d95('0x36')]:_0x5494bf[_0x3d95('0x32')];_0x29f670[_0x3d95('0x78')]=qs[_0x3d95('0x3b')](_0x2a5b01[_0x3d95('0x33')]['sort']);_0x29f670['where']=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x2a5b01[_0x3d95('0x33')],_0x5494bf[_0x3d95('0x34')]));if(_0x2a5b01['query']['filter']){_0x29f670[_0x3d95('0x3c')]=_[_0x3d95('0x3d')](_0x29f670[_0x3d95('0x3c')],{'$or':_['map'](_0x29f670['attributes'],function(_0x47de5e){var _0x177a8e={};_0x177a8e[_0x47de5e]={'$like':'%'+_0x2a5b01[_0x3d95('0x33')]['filter']+'%'};return _0x177a8e;})});}_0x29f670=_[_0x3d95('0x3d')]({},_0x29f670,_0x2a5b01['options']);return _0x215317[_0x3d95('0x87')](_0x29f670);}})[_0x3d95('0x22')](function(_0x22d8ef){if(_0x22d8ef){_0x3f00ed=_0x22d8ef[_0x3d95('0x38')];if(!_0x2a5b01[_0x3d95('0x33')][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x29f670[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x2a5b01[_0x3d95('0x33')][_0x3d95('0x1e')]);_0x29f670[_0x3d95('0x1c')]=qs[_0x3d95('0x1c')](_0x2a5b01['query']['offset']);}return _0x215317[_0x3d95('0x87')](_0x29f670);}})[_0x3d95('0x22')](function(_0x44d5f3){if(_0x44d5f3){return _0x44d5f3?{'count':_0x3f00ed,'rows':_0x44d5f3}:null;}})[_0x3d95('0x22')](respondWithResult(_0x2ac680,null))[_0x3d95('0x18')](handleError(_0x2ac680,null));};exports[_0x3d95('0x88')]=function(_0x13e66c,_0xe9eaf9){var _0x6294dd={'raw':!![],'where':{}};var _0x54142d={};var _0x391ea2={'count':0x0,'rows':[]};return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x13e66c[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0xe9eaf9,null))['then'](function(_0x4a1512){if(_0x4a1512){_0x54142d[_0x3d95('0x32')]=_[_0x3d95('0x48')](db[_0x3d95('0x89')]['rawAttributes']);_0x54142d[_0x3d95('0x33')]=_[_0x3d95('0x48')](_0x13e66c[_0x3d95('0x33')]);_0x54142d[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x54142d[_0x3d95('0x32')],_0x54142d[_0x3d95('0x33')]);_0x6294dd[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x54142d[_0x3d95('0x32')],qs[_0x3d95('0x37')](_0x13e66c[_0x3d95('0x33')]['fields']));_0x6294dd['attributes']=_0x6294dd['attributes'][_0x3d95('0x38')]?_0x6294dd['attributes']:_0x54142d[_0x3d95('0x32')];if(!_0x13e66c[_0x3d95('0x33')][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x6294dd['limit']=qs[_0x3d95('0x1e')](_0x13e66c[_0x3d95('0x33')][_0x3d95('0x1e')]);_0x6294dd[_0x3d95('0x1c')]=qs[_0x3d95('0x1c')](_0x13e66c['query'][_0x3d95('0x1c')]);}_0x6294dd[_0x3d95('0x78')]=qs[_0x3d95('0x3b')](_0x13e66c[_0x3d95('0x33')][_0x3d95('0x3b')]);_0x6294dd[_0x3d95('0x3c')]=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x13e66c[_0x3d95('0x33')],_0x54142d[_0x3d95('0x34')]));_0x6294dd[_0x3d95('0x3c')][_0x3d95('0x54')]=_0x4a1512['id'];if(_0x13e66c['query']['filter']){_0x6294dd['where']=_[_0x3d95('0x3d')](_0x6294dd['where'],{'$or':_[_0x3d95('0x2d')](_0x6294dd[_0x3d95('0x36')],function(_0x33a8c7){var _0xcb85a={};_0xcb85a[_0x33a8c7]={'$like':'%'+_0x13e66c[_0x3d95('0x33')]['filter']+'%'};return _0xcb85a;})});}if(_0x13e66c[_0x3d95('0x33')][_0x3d95('0x8a')]){var _0x438c5c=_0x13e66c[_0x3d95('0x33')][_0x3d95('0x8a')][_0x3d95('0x8b')](',');var _0x1ae3c9={};_0x1ae3c9[_0x438c5c[0x0]]={'$gte':moment(_0x438c5c[0x1])[_0x3d95('0x8c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6294dd['where']=_[_0x3d95('0x3d')](_0x6294dd[_0x3d95('0x3c')],_0x1ae3c9);}_0x6294dd=_[_0x3d95('0x3d')]({},_0x6294dd,_0x13e66c[_0x3d95('0x40')]);return db[_0x3d95('0x89')][_0x3d95('0x1f')]({'where':_0x6294dd['where']})[_0x3d95('0x22')](function(_0x397aa9){_0x391ea2[_0x3d95('0x1f')]=_0x397aa9;if(_0x13e66c['query']['includeAll']){_0x6294dd[_0x3d95('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0x3d95('0x43')](_0x6294dd);})['then'](function(_0x200e4f){if(_0x13e66c[_0x3d95('0x33')][_0x3d95('0x8d')]===_0x3d95('0x8e')){for(var _0x31d09c=0x0;_0x31d09c<_0x200e4f[_0x3d95('0x38')];_0x31d09c++){_0x200e4f[_0x31d09c]['body']=juice(_0x200e4f[_0x31d09c][_0x3d95('0x4a')]);}}_0x391ea2[_0x3d95('0x44')]=_0x200e4f;return _0x391ea2;});}})[_0x3d95('0x22')](respondWithFilteredResult(_0xe9eaf9,_0x6294dd))['catch'](handleError(_0xe9eaf9,null));};exports['send']=function(_0x4b3d32,_0x4641df){var _0x468608,_0xf9de9f={},_0x1069e3;if(_0x4b3d32[_0x3d95('0x4a')]['to']){_0x1069e3=_0x4b3d32[_0x3d95('0x4a')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x3d95('0x49')]({'where':{'id':_0x4b3d32['params']['id']},'include':[{'model':db['CmList'],'as':_0x3d95('0x8f'),'include':[{'model':db[_0x3d95('0x79')],'as':_0x3d95('0x90'),'where':{'email':_0x1069e3},'limit':0x1,'order':[[_0x3d95('0x91'),_0x3d95('0x92')]]}]},{'model':db[_0x3d95('0x2a')],'as':_0x3d95('0x4c'),'raw':!![],'include':[{'model':db[_0x3d95('0x93')],'as':_0x3d95('0x93'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x4641df,null))[_0x3d95('0x22')](function(_0x561141){if(!_0x561141)return;_0x468608=_0x561141;if(!_0x561141[_0x3d95('0x4c')])throw new Error(_0x3d95('0x94'));if(_[_0x3d95('0x5d')](_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x95')])){_0x4b3d32[_0x3d95('0x4a')]['from']=util['format'](_0x3d95('0x96'),_0x561141[_0x3d95('0x27')],_0x561141['email']||_0x561141['Smtp'][_0x3d95('0x60')]);}if(_0x4b3d32[_0x3d95('0x4a')]['attachments']&&_0x4b3d32['body']['attachments'][_0x3d95('0x38')]){for(var _0x219121=0x0;_0x219121<_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x97')][_0x3d95('0x38')];_0x219121+=0x1){_0x4b3d32['body'][_0x3d95('0x97')][_0x219121]={'filename':_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x97')][_0x219121][_0x3d95('0x27')],'path':path[_0x3d95('0x98')](config[_0x3d95('0x99')],_0x3d95('0x9a'),_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x97')][_0x219121][_0x3d95('0x9b')])};}}var _0x3d43a0=_0x561141[_0x3d95('0x9c')]();return respondWithRpcPromise('SendMail',_0x3d95('0x9d'),{'account':_0x3d43a0,'message':_0x4b3d32[_0x3d95('0x4a')]});})[_0x3d95('0x22')](function(_0x49f13a){if(!_0x49f13a)return;_0xf9de9f=_0x49f13a;if(!_0x468608[_0x3d95('0x8f')])throw new Error(_0x3d95('0x9e'));if(_0x468608[_0x3d95('0x8f')][_0x3d95('0x90')]['length'])return _0x468608[_0x3d95('0x8f')][_0x3d95('0x90')][0x0];return db[_0x3d95('0x79')][_0x3d95('0x51')](_[_0x3d95('0x8')](_0x4b3d32[_0x3d95('0x4a')],{'firstName':_0x4b3d32[_0x3d95('0x4a')]['to'],'email':_0x4b3d32[_0x3d95('0x4a')]['to'],'phone':_0x4b3d32[_0x3d95('0x4a')]['to'],'ListId':_0x468608[_0x3d95('0x5c')]}));})[_0x3d95('0x22')](function(_0xcf47bb){if(!_0xcf47bb)return;var _0x5e6e77={'UserId':_0x4b3d32[_0x3d95('0x60')]['id'],'ContactId':_0xcf47bb['id'],'MailAccountId':_0x468608['id'],'inReplyTo':_0xf9de9f['messageId'],'to':_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x95')],'cc':_0x4b3d32[_0x3d95('0x4a')]['cc'],'subject':_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0x9f')],'attach':_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0xa0')],'firstMsgDirection':_0x3d95('0xa1'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x3d95('0xa1'),'Messages':[_[_0x3d95('0x3d')](_0x4b3d32[_0x3d95('0x4a')],{'messageId':_0xf9de9f[_0x3d95('0xa2')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x468608['id'],'UserId':_0x4b3d32[_0x3d95('0x60')]['id'],'ContactId':_0xcf47bb['id']})]};if(_0x4b3d32[_0x3d95('0x4a')][_0x3d95('0xa3')]){_0x5e6e77=_[_0x3d95('0x3d')](_0x5e6e77,_0x4b3d32['body'][_0x3d95('0xa3')]);}return db[_0x3d95('0x77')][_0x3d95('0x51')](_0x5e6e77,{'include':[{'model':db['MailMessage'],'as':_0x3d95('0xa4')}]});})[_0x3d95('0x22')](respondWithResult(_0x4641df,null))[_0x3d95('0x18')](handleError(_0x4641df,null));};exports['verifySmtp']=function(_0x564a28,_0x169012){return db[_0x3d95('0x2e')][_0x3d95('0x49')]({'where':{'id':_0x564a28['params']['id']},'include':[{'model':db[_0x3d95('0x2a')],'as':_0x3d95('0x4c'),'raw':!![],'include':[{'model':db[_0x3d95('0x93')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x169012,null))['then'](function(_0x22ca74){if(!_0x22ca74[_0x3d95('0x4c')])return;var _0x4325da=_0x22ca74[_0x3d95('0x9c')]();return respondWithRpcPromise('VerifySmtp',_0x3d95('0xa5'),{'account':_0x4325da});})[_0x3d95('0x22')](respondWithResult(_0x169012,null))[_0x3d95('0x18')](handleError(_0x169012,null));};exports[_0x3d95('0x23')]=function(_0x32e699,_0x656620){return db[_0x3d95('0x2e')][_0x3d95('0x49')]({'where':{'id':_0x32e699[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x656620,null))[_0x3d95('0x22')](function(_0x3bbea3){if(_0x3bbea3&&_0x3bbea3[_0x3d95('0x64')]){throw new db[(_0x3d95('0xa6'))]['ValidationError'](_0x3d95('0xa7'));}return _0x3bbea3;})[_0x3d95('0x22')](removeEntity(_0x656620,null))[_0x3d95('0x18')](handleError(_0x656620,null));};exports[_0x3d95('0xa8')]=function(_0x3642b9,_0x489b56){return db['MailAccount'][_0x3d95('0x49')]({'where':{'id':_0x3642b9[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x489b56,null))[_0x3d95('0x22')](function(_0x17af56){if(_0x17af56){return _0x17af56[_0x3d95('0xa8')](_0x3642b9[_0x3d95('0x4a')][_0x3d95('0x56')],_[_0x3d95('0x75')](_0x3642b9['body'],[_0x3d95('0x56'),'id'])||{})['spread'](function(_0x22fc34){for(var _0x590c19=0x0;_0x590c19<_0x3642b9[_0x3d95('0x4a')][_0x3d95('0x56')]['length'];_0x590c19+=0x1){socket[_0x3d95('0xa9')]('userMailAccount:save',{'UserId':Number(_0x3642b9[_0x3d95('0x4a')][_0x3d95('0x56')][_0x590c19]),'MailAccountId':Number(_0x3642b9[_0x3d95('0x45')]['id'])});}return _0x22fc34;});}})[_0x3d95('0x22')](respondWithResult(_0x489b56,null))[_0x3d95('0x18')](handleError(_0x489b56,null));};exports[_0x3d95('0xaa')]=function(_0x4b3387,_0x58ba2e){return db['MailAccount'][_0x3d95('0x49')]({'where':{'id':_0x4b3387[_0x3d95('0x45')]['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x58ba2e,null))[_0x3d95('0x22')](function(_0x400216){if(_0x400216){return _0x400216[_0x3d95('0xaa')](_0x4b3387[_0x3d95('0x33')][_0x3d95('0x56')])[_0x3d95('0x22')](function(){if(_[_0x3d95('0xab')](_0x4b3387[_0x3d95('0x33')]['ids'])){for(var _0x83efa6=0x0;_0x83efa6<_0x4b3387['query']['ids'][_0x3d95('0x38')];_0x83efa6+=0x1){socket[_0x3d95('0xa9')](_0x3d95('0xac'),{'UserId':Number(_0x4b3387[_0x3d95('0x33')][_0x3d95('0x56')][_0x83efa6]),'MailAccountId':Number(_0x4b3387[_0x3d95('0x45')]['id'])});}}else{socket[_0x3d95('0xa9')](_0x3d95('0xac'),{'UserId':Number(_0x4b3387[_0x3d95('0x33')][_0x3d95('0x56')]),'MailAccountId':Number(_0x4b3387[_0x3d95('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x58ba2e,null))[_0x3d95('0x18')](handleError(_0x58ba2e,null));};exports[_0x3d95('0xad')]=function(_0x52e8ef,_0x76ab24){var _0x3f57f3={};var _0x5f5abe={};var _0x1c598a;var _0x539ba6;return db[_0x3d95('0x2e')][_0x3d95('0x52')]({'where':{'id':_0x52e8ef['params']['id']}})[_0x3d95('0x22')](handleEntityNotFound(_0x76ab24,null))[_0x3d95('0x22')](function(_0x27aef4){if(_0x27aef4){_0x1c598a=_0x27aef4;_0x5f5abe['model']=_[_0x3d95('0x48')](db['User'][_0x3d95('0x47')]);_0x5f5abe[_0x3d95('0x33')]=_[_0x3d95('0x48')](_0x52e8ef[_0x3d95('0x33')]);_0x5f5abe[_0x3d95('0x34')]=_[_0x3d95('0x35')](_0x5f5abe[_0x3d95('0x32')],_0x5f5abe[_0x3d95('0x33')]);_0x3f57f3[_0x3d95('0x36')]=_[_0x3d95('0x35')](_0x5f5abe[_0x3d95('0x32')],qs[_0x3d95('0x37')](_0x52e8ef['query'][_0x3d95('0x37')]));_0x3f57f3['attributes']=_0x3f57f3[_0x3d95('0x36')][_0x3d95('0x38')]?_0x3f57f3[_0x3d95('0x36')]:_0x5f5abe[_0x3d95('0x32')];_0x3f57f3['order']=qs[_0x3d95('0x3b')](_0x52e8ef[_0x3d95('0x33')][_0x3d95('0x3b')]);_0x3f57f3[_0x3d95('0x3c')]=qs[_0x3d95('0x34')](_[_0x3d95('0x53')](_0x52e8ef['query'],_0x5f5abe[_0x3d95('0x34')]));if(_0x52e8ef[_0x3d95('0x33')][_0x3d95('0x3f')]){_0x3f57f3[_0x3d95('0x3c')]=_[_0x3d95('0x3d')](_0x3f57f3[_0x3d95('0x3c')],{'$or':_[_0x3d95('0x2d')](_0x3f57f3[_0x3d95('0x36')],function(_0x362ae0){var _0x4d2020={};_0x4d2020[_0x362ae0]={'$like':'%'+_0x52e8ef[_0x3d95('0x33')][_0x3d95('0x3f')]+'%'};return _0x4d2020;})});}_0x3f57f3=_[_0x3d95('0x3d')]({},_0x3f57f3,_0x52e8ef['options']);return _0x1c598a[_0x3d95('0xad')](_0x3f57f3);}})[_0x3d95('0x22')](function(_0x30b8c2){if(_0x30b8c2){_0x539ba6=_0x30b8c2[_0x3d95('0x38')];if(!_0x52e8ef[_0x3d95('0x33')][_0x3d95('0x39')](_0x3d95('0x3a'))){_0x3f57f3[_0x3d95('0x1e')]=qs[_0x3d95('0x1e')](_0x52e8ef['query']['limit']);_0x3f57f3[_0x3d95('0x1c')]=qs['offset'](_0x52e8ef['query'][_0x3d95('0x1c')]);}return _0x1c598a['getAgents'](_0x3f57f3);}})[_0x3d95('0x22')](function(_0x222f4b){if(_0x222f4b){return _0x222f4b?{'count':_0x539ba6,'rows':_0x222f4b}:null;}})['then'](respondWithResult(_0x76ab24,null))[_0x3d95('0x18')](handleError(_0x76ab24,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b18aa03..0b06614 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 _0xb9c6=['emit','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x487b93,_0x330c64){var _0x1f6c3c=function(_0x4cfcfc){while(--_0x4cfcfc){_0x487b93['push'](_0x487b93['shift']());}};_0x1f6c3c(++_0x330c64);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x5a552d,_0x15e0fd){_0x5a552d=_0x5a552d-0x0;var _0x5b2639=_0xb9c6[_0x5a552d];return _0x5b2639;};'use strict';var EventEmitter=require(_0x6b9c('0x0'));var MailAccount=require(_0x6b9c('0x1'))['db'][_0x6b9c('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6b9c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b9c('0x4'),'afterDestroy':_0x6b9c('0x5')};function emitEvent(_0x47b15e){return function(_0x5aad5b,_0x576925,_0x121b4d){MailAccountEvents[_0x6b9c('0x6')](_0x47b15e+':'+_0x5aad5b['id'],_0x5aad5b);MailAccountEvents[_0x6b9c('0x6')](_0x47b15e,_0x5aad5b);_0x121b4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x6b9c('0x7')](e,emitEvent(event));}}module[_0x6b9c('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x3e4d=['MailAccount','remove','hasOwnProperty','hook','exports','events'];(function(_0x175761,_0x259080){var _0x3a7324=function(_0xfebf0e){while(--_0xfebf0e){_0x175761['push'](_0x175761['shift']());}};_0x3a7324(++_0x259080);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x1eba99,_0x50bc6f){_0x1eba99=_0x1eba99-0x0;var _0x889576=_0x3e4d[_0x1eba99];return _0x889576;};'use strict';var EventEmitter=require(_0xd3e4('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xd3e4('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd3e4('0x2')};function emitEvent(_0x177ec7){return function(_0x2c7be8,_0x5ea48b,_0xc5abea){MailAccountEvents['emit'](_0x177ec7+':'+_0x2c7be8['id'],_0x2c7be8);MailAccountEvents['emit'](_0x177ec7,_0x2c7be8);_0xc5abea(null);};}for(var e in events){if(events[_0xd3e4('0x3')](e)){var event=events[e];MailAccount[_0xd3e4('0x4')](e,emitEvent(event));}}module[_0xd3e4('0x5')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d470935..7093e74 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 _0xf8e9=['Smtp','port','secure','authentication','modernAuthentication','CloudProvider','OAuth2','user','data5','auth','pass','./mailAccount.attributes','define','provider','custom','service','host'];(function(_0x1b7330,_0x2ea8c1){var _0x4bdd4e=function(_0x1d7caf){while(--_0x1d7caf){_0x1b7330['push'](_0x1b7330['shift']());}};_0x4bdd4e(++_0x2ea8c1);}(_0xf8e9,0x13d));var _0x9f8e=function(_0x43133a,_0x29c235){_0x43133a=_0x43133a-0x0;var _0x2784d6=_0xf8e9[_0x43133a];return _0x2784d6;};'use strict';var attributes=require(_0x9f8e('0x0'));module['exports']=function(_0xb162e0){return _0xb162e0[_0x9f8e('0x1')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3332ef=this;var _0x1fe4cd={'id':_0x3332ef['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3332ef[_0x9f8e('0x2')]!==_0x9f8e('0x3')){_0x1fe4cd[_0x9f8e('0x4')]=_0x3332ef[_0x9f8e('0x2')];}else{_0x1fe4cd[_0x9f8e('0x5')]=_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0x5')];_0x1fe4cd[_0x9f8e('0x7')]=_0x3332ef['Smtp'][_0x9f8e('0x7')];_0x1fe4cd[_0x9f8e('0x8')]=_0x3332ef[_0x9f8e('0x6')]['secure'];}if(_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0x9')]){if(_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0xa')]){if(!_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x1fe4cd['auth']={'type':_0x9f8e('0xc'),'user':_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0xd')],'accessToken':_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0xb')][_0x9f8e('0xe')]};}else{_0x1fe4cd[_0x9f8e('0xf')]={'user':_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0xd')],'pass':_0x3332ef[_0x9f8e('0x6')][_0x9f8e('0x10')]};}}return _0x1fe4cd;}}});}; \ No newline at end of file +var _0x5d93=['pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','auth','user'];(function(_0x33508,_0x2d39aa){var _0x37106b=function(_0x33eaf2){while(--_0x33eaf2){_0x33508['push'](_0x33508['shift']());}};_0x37106b(++_0x2d39aa);}(_0x5d93,0xfd));var _0x35d9=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x5d93[_0x26462c];return _0x509a42;};'use strict';var attributes=require(_0x35d9('0x0'));module[_0x35d9('0x1')]=function(_0xf549c9){return _0xf549c9[_0x35d9('0x2')](_0x35d9('0x3'),attributes,{'tableName':_0x35d9('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x164a92=this;var _0x196ce3={'id':_0x164a92['id'],'tls':{'rejectUnauthorized':![]}};if(_0x164a92[_0x35d9('0x5')]!==_0x35d9('0x6')){_0x196ce3[_0x35d9('0x7')]=_0x164a92[_0x35d9('0x5')];}else{_0x196ce3[_0x35d9('0x8')]=_0x164a92['Smtp']['host'];_0x196ce3[_0x35d9('0x9')]=_0x164a92[_0x35d9('0xa')][_0x35d9('0x9')];_0x196ce3['secure']=_0x164a92[_0x35d9('0xa')][_0x35d9('0xb')];}if(_0x164a92['Smtp'][_0x35d9('0xc')]){if(_0x164a92[_0x35d9('0xa')][_0x35d9('0xd')]){if(!_0x164a92[_0x35d9('0xa')][_0x35d9('0xe')])throw new Error(_0x35d9('0xf'));_0x196ce3['auth']={'type':_0x35d9('0x10'),'user':_0x164a92['Smtp']['user'],'accessToken':_0x164a92[_0x35d9('0xa')][_0x35d9('0xe')][_0x35d9('0x11')]};}else{_0x196ce3[_0x35d9('0x12')]={'user':_0x164a92[_0x35d9('0xa')][_0x35d9('0x13')],'pass':_0x164a92[_0x35d9('0xa')][_0x35d9('0x14')]};}}return _0x196ce3;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index a139382..642c004 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 _0xb10b=['message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','include','map','model','debug','find','ShowMailAccount','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','getSmtpOptions','applications','list','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','MailMessage','originTo','originCc','bcc','originChannel','Email','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0xb10b,0x12a));var _0xbb10=function(_0x113e32,_0x5339f0){_0x113e32=_0x113e32-0x0;var _0x4ff939=_0xb10b[_0x113e32];return _0x4ff939;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var BPromise=require(_0xbb10('0x1'));var rs=require(_0xbb10('0x2'));var Redis=require(_0xbb10('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xbb10('0x4'))(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var jayson=require(_0xbb10('0x7'));var client=jayson[_0xbb10('0x8')][_0xbb10('0x9')]({'port':0x232c});config['redis']=_[_0xbb10('0xa')](config[_0xbb10('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb10('0xc'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xd'))[_0xbb10('0xe')](socket);function respondWithRpcPromise(_0x2353ef,_0x1ce33e,_0x229887){return new BPromise(function(_0xa3adc8,_0x5ab04a){return client['request'](_0x2353ef,_0x229887)[_0xbb10('0xf')](function(_0x118a74){logger[_0xbb10('0x10')]('MailAccount,\x20%s,\x20%s',_0x1ce33e,_0xbb10('0x11'));logger['debug'](_0xbb10('0x12'),_0x1ce33e,_0xbb10('0x11'),JSON[_0xbb10('0x13')](_0x118a74));if(_0x118a74[_0xbb10('0x14')]){if(_0x118a74[_0xbb10('0x14')][_0xbb10('0x15')]===0x1f4){logger['error'](_0xbb10('0x16'),_0x1ce33e,_0x118a74[_0xbb10('0x14')][_0xbb10('0x17')]);return _0x5ab04a(_0x118a74[_0xbb10('0x14')][_0xbb10('0x17')]);}logger[_0xbb10('0x14')](_0xbb10('0x16'),_0x1ce33e,_0x118a74[_0xbb10('0x14')][_0xbb10('0x17')]);return _0xa3adc8(_0x118a74[_0xbb10('0x14')]['message']);}else{logger[_0xbb10('0x10')](_0xbb10('0x16'),_0x1ce33e,_0xbb10('0x11'));_0xa3adc8(_0x118a74[_0xbb10('0x18')][_0xbb10('0x17')]);}})[_0xbb10('0x19')](function(_0x575cca){logger[_0xbb10('0x14')](_0xbb10('0x16'),_0x1ce33e,_0x575cca);_0x5ab04a(_0x575cca);});});}exports[_0xbb10('0x1a')]=function(_0x48b6e9){var _0x5ff0cf=this;return new Promise(function(_0x19f48d,_0x388fab){return db[_0xbb10('0x1b')][_0xbb10('0x1c')]({'raw':_0x48b6e9[_0xbb10('0x1d')]?_0x48b6e9['options'][_0xbb10('0x1e')]===undefined?!![]:![]:!![],'where':_0x48b6e9[_0xbb10('0x1d')]?_0x48b6e9['options']['where']||null:null,'attributes':_0x48b6e9[_0xbb10('0x1d')]?_0x48b6e9[_0xbb10('0x1d')][_0xbb10('0x1f')]||null:null,'limit':_0x48b6e9[_0xbb10('0x1d')]?_0x48b6e9[_0xbb10('0x1d')][_0xbb10('0x20')]||null:null,'include':_0x48b6e9[_0xbb10('0x1d')]?_0x48b6e9[_0xbb10('0x1d')][_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x48b6e9[_0xbb10('0x1d')][_0xbb10('0x21')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x537898[_0xbb10('0x21')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x23')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1f')],'include':_0x4e25ff[_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x4e25ff[_0xbb10('0x21')],function(_0x20d946){return{'model':db[_0x20d946[_0xbb10('0x23')]],'as':_0x20d946['as'],'attributes':_0x20d946['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xf')](function(_0x21ac54){logger[_0xbb10('0x10')](_0xbb10('0x1a'),_0x48b6e9);logger[_0xbb10('0x24')](_0xbb10('0x1a'),_0x48b6e9,JSON['stringify'](_0x21ac54));_0x19f48d(_0x21ac54);})[_0xbb10('0x19')](function(_0x4ee02e){logger[_0xbb10('0x14')]('GetMailAccount',_0x4ee02e[_0xbb10('0x17')],_0x48b6e9);_0x388fab(_0x5ff0cf[_0xbb10('0x14')](0x1f4,_0x4ee02e[_0xbb10('0x17')]));});});};exports['ShowMailAccount']=function(_0x518d47){var _0x4c3744=this;return new Promise(function(_0x34f65e,_0x4f590d){return db[_0xbb10('0x1b')][_0xbb10('0x25')]({'raw':_0x518d47[_0xbb10('0x1d')]?_0x518d47[_0xbb10('0x1d')][_0xbb10('0x1e')]===undefined?!![]:![]:!![],'where':_0x518d47[_0xbb10('0x1d')]?_0x518d47[_0xbb10('0x1d')]['where']||null:null,'attributes':_0x518d47[_0xbb10('0x1d')]?_0x518d47[_0xbb10('0x1d')][_0xbb10('0x1f')]||null:null,'include':_0x518d47[_0xbb10('0x1d')]?_0x518d47[_0xbb10('0x1d')][_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x518d47[_0xbb10('0x1d')][_0xbb10('0x21')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x23')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1f')],'include':_0x56943c[_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes'],'include':_0x111762[_0xbb10('0x21')]?_[_0xbb10('0x22')](_0x111762[_0xbb10('0x21')],function(_0x120d21){return{'model':db[_0x120d21[_0xbb10('0x23')]],'as':_0x120d21['as'],'attributes':_0x120d21[_0xbb10('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e5bbd){logger[_0xbb10('0x10')]('ShowMailAccount',_0x518d47);logger['debug']('ShowMailAccount',_0x518d47,JSON[_0xbb10('0x13')](_0x1e5bbd));_0x34f65e(_0x1e5bbd);})[_0xbb10('0x19')](function(_0x2b658a){logger['error'](_0xbb10('0x26'),_0x2b658a[_0xbb10('0x17')],_0x518d47);_0x4f590d(_0x4c3744[_0xbb10('0x14')](0x1f4,_0x2b658a['message']));});});};exports[_0xbb10('0x27')]=function(_0x12238a){var _0x1dcd38=this;return new Promise(function(_0x446f49,_0x4f1cdd){var _0xd238e9={'body':_0x12238a[_0xbb10('0x28')],'channel':'mail'};var _0xe2040f=_[_0xbb10('0x29')](_[_0xbb10('0x2a')](db[_0xbb10('0x2b')][_0xbb10('0x2c')]),[_0xbb10('0x2d'),'updatedAt',_0xbb10('0x2e'),_0xbb10('0x2f')]);var _0x3e7b4c=![];if(_0x12238a[_0xbb10('0x28')]['id']){delete _0x12238a['body']['id'];}if(_[_0xbb10('0x30')](_0x12238a[_0xbb10('0x28')][_0xbb10('0x31')])){return _0x4f1cdd(_0x1dcd38[_0xbb10('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xbb10('0x30')](_0x12238a[_0xbb10('0x28')]['body'])||_0x12238a['body'][_0xbb10('0x28')]===''){return _0x4f1cdd(_0x1dcd38['error'](0x1f4,_0xbb10('0x32')));}if(_[_0xbb10('0x30')](_0x12238a['body'][_0xbb10('0x33')])){return _0x4f1cdd(_0x1dcd38[_0xbb10('0x14')](0x1f4,_0xbb10('0x34')+_0xe2040f));}if(!_['includes'](_0xe2040f,_0x12238a[_0xbb10('0x28')][_0xbb10('0x33')])){return _0x4f1cdd(_0x1dcd38[_0xbb10('0x14')](0x1f4,_0xbb10('0x35')+_0xe2040f));}var _0x36e1fa={};_0x36e1fa[_0x12238a[_0xbb10('0x28')][_0xbb10('0x33')]]=_0x12238a[_0xbb10('0x28')][_0xbb10('0x31')];return db[_0xbb10('0x1b')][_0xbb10('0x25')]({'where':{'id':_0x12238a[_0xbb10('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0xbb10('0x37'),'include':[{'model':db[_0xbb10('0x2b')],'as':'Contacts','where':_0x36e1fa,'limit':0x1,'order':[[_0xbb10('0x38'),_0xbb10('0x39')]]}]},{'model':db[_0xbb10('0x3a')],'as':_0xbb10('0x3b')},{'model':db[_0xbb10('0x3c')],'as':_0xbb10('0x3d'),'include':[{'model':db[_0xbb10('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0xcb3354){if(_0xcb3354&&_0xcb3354[_0xbb10('0x37')]){var _0x2b12bd=_0xcb3354['get']({'plain':!![]});_0xd238e9['account']=_[_0xbb10('0x3f')](_0x2b12bd,[_0xbb10('0x3b'),_0xbb10('0x37')]);_0xd238e9[_0xbb10('0x36')][_0xbb10('0x40')]=_0xcb3354[_0xbb10('0x41')]();_0xd238e9[_0xbb10('0x42')]=_0x2b12bd[_0xbb10('0x3b')];_0xd238e9[_0xbb10('0x43')]=_0x2b12bd[_0xbb10('0x37')];_0xd238e9['applications']=_['orderBy'](_0xd238e9[_0xbb10('0x42')],[_0xbb10('0x44')],[_0xbb10('0x45')]);if(_0xd238e9[_0xbb10('0x36')]&&_0xd238e9[_0xbb10('0x36')][_0xbb10('0x46')]){_0xd238e9[_0xbb10('0x42')][_0xbb10('0x47')]({'id':0x0,'priority':_0xd238e9[_0xbb10('0x42')][_0xbb10('0x48')]+0x1,'app':_0xbb10('0x49'),'appdata':_0xbb10('0x46'),'interval':_0xbb10('0x4a')});}if(_0xd238e9[_0xbb10('0x36')][_0xbb10('0x3b')]){delete _0xd238e9['account'][_0xbb10('0x3b')];}if(_0xd238e9['account'][_0xbb10('0x37')]){delete _0xd238e9[_0xbb10('0x36')][_0xbb10('0x37')];}if(_0x2b12bd[_0xbb10('0x37')][_0xbb10('0x4b')][_0xbb10('0x48')]){return _0x2b12bd[_0xbb10('0x37')][_0xbb10('0x4b')][0x0];}var _0x180400=_[_0xbb10('0xa')](_0x12238a[_0xbb10('0x28')],{'firstName':_0x12238a[_0xbb10('0x28')][_0xbb10('0x31')],'ListId':_0x2b12bd[_0xbb10('0x2f')]});_0x180400[_0x12238a[_0xbb10('0x28')]['mapKey']]=_0x12238a[_0xbb10('0x28')][_0xbb10('0x31')];return db[_0xbb10('0x2b')][_0xbb10('0x4c')](_0x180400);}else{throw new Error(_0xbb10('0x4d'));}})[_0xbb10('0xf')](function(_0x4bedd0){_0xd238e9[_0xbb10('0x4e')]=_0x4bedd0;if(_0x4bedd0){if(!_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x4f')]){_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x4f')]=rs[_0xbb10('0x50')]()+'\x20'+_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x31')];}var _0x2a1ce1={'ContactId':_0x4bedd0['id'],'MailAccountId':_0x12238a[_0xbb10('0x36')]['id'],'inReplyTo':_0x12238a['body']['message'][_0xbb10('0x4f')],'to':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x31')],'cc':_0x12238a['body']['message']['cc'],'subject':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x51')],'attach':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x52')],'lastMsgAt':moment()[_0xbb10('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xbb10('0x54')][_0xbb10('0x25')]({'where':{'closed':![],'MailAccountId':_0x12238a['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0xbb10('0x4f')],'where':{'messageId':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')]['inReplyTo']}}]})['then'](function(_0x5846d1){if(_0x5846d1){return[_0x5846d1,![]];}return db[_0xbb10('0x54')][_0xbb10('0x4c')](_0x2a1ce1)[_0xbb10('0xf')](function(_0x4e9fbd){return[_0x4e9fbd,!![]];});});}else{throw new Error(_0xbb10('0x55'));}})[_0xbb10('0x56')](function(_0x5a6538,_0x4a560c){if(_0x5a6538){_0x3e7b4c=_0x4a560c;if(!_0x4a560c){return _0x5a6538[_0xbb10('0x57')]({'inReplyTo':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x4f')],'to':_0x12238a['body'][_0xbb10('0x17')][_0xbb10('0x31')],'cc':_0x12238a[_0xbb10('0x28')]['message']['cc'],'subject':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x51')],'attach':_0x5a6538['attach']?_0x5a6538[_0xbb10('0x52')]:_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x52')],'substatus':null,'substatusAt':moment()['format'](_0xbb10('0x58')),'lastMsgAt':moment()[_0xbb10('0x53')](_0xbb10('0x58')),'lastMsgDirection':'in'});}else{return _0x5a6538;}}})[_0xbb10('0xf')](function(_0x56b3a3){_0xd238e9[_0xbb10('0x59')]=_0x56b3a3[_0xbb10('0x5a')]({'plain':!![]});_0xd238e9[_0xbb10('0x59')][_0xbb10('0x5b')]=_0x3e7b4c;return db[_0xbb10('0x5c')][_0xbb10('0x4c')]({'body':_0x12238a[_0xbb10('0x28')]['body'],'MailAccountId':_0x12238a['account']['id'],'MailInteractionId':_0x56b3a3['id'],'direction':'in','ContactId':_0xd238e9['contact']['id'],'messageId':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x4f')],'from':_0x12238a['body']['message'][_0xbb10('0x31')],'to':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')]['to'],'cc':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')]['cc'],'subject':_0x12238a[_0xbb10('0x28')]['message'][_0xbb10('0x51')],'attach':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x52')],'Attachments':_0x12238a[_0xbb10('0x28')]['message']['attachments'],'originTo':_0x12238a['body'][_0xbb10('0x17')][_0xbb10('0x5d')],'originCc':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x5e')],'bcc':_0x12238a[_0xbb10('0x28')]['message'][_0xbb10('0x5f')],'ChatWebsiteId':_0x12238a['body']['message']['ChatWebsiteId']||null,'originChannel':_0x12238a[_0xbb10('0x28')][_0xbb10('0x17')][_0xbb10('0x60')]||_0xbb10('0x61'),'ChatOfflineMessageId':_0x12238a['body'][_0xbb10('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0xbb10('0x62')}]});})[_0xbb10('0xf')](function(_0x29529c){_0xd238e9[_0xbb10('0x17')]=_0x29529c;if(_0xd238e9[_0xbb10('0x59')]['UserId']){return db[_0xbb10('0x63')][_0xbb10('0x25')]({'attributes':['id',_0xbb10('0x64')],'where':{'id':_0xd238e9[_0xbb10('0x59')][_0xbb10('0x65')]}})[_0xbb10('0xf')](function(_0x174395){if(_0x174395){_0xd238e9['applications'][_0xbb10('0x66')]({'id':0x0,'priority':0x0,'app':_0xbb10('0x67'),'appdata':_0x174395[_0xbb10('0x64')]+','+(_0xd238e9[_0xbb10('0x36')][_0xbb10('0x68')]||0xa),'interval':_0xbb10('0x4a')});}return respondWithRpcPromise(_0xbb10('0x69'),_0xbb10('0x6a'),_0xd238e9);});}return respondWithRpcPromise('Start',_0xbb10('0x6a'),_0xd238e9);})[_0xbb10('0xf')](function(_0x145baf){_0x446f49(_0x145baf);})['catch'](function(_0x4ee101){_0x4f1cdd(_0x1dcd38['error'](0x1f4,_0x4ee101[_0xbb10('0x17')]));});});}; \ No newline at end of file +var _0x2542=['MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','priority','asc','push','length','*,*,*,*','Contacts','contact','messageId','generate','attach','format','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originCc','ChatWebsiteId','originChannel','Email','Attachment','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','map','include','model','ShowMailAccount','find','where','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','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','account','CmList','List','CmContact','DESC','MailApplication','Applications'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x2542,0x169));var _0x2254=function(_0x1e06a8,_0x24dd97){_0x1e06a8=_0x1e06a8-0x0;var _0x35ab1a=_0x2542[_0x1e06a8];return _0x35ab1a;};'use strict';var _=require(_0x2254('0x0'));var moment=require(_0x2254('0x1'));var BPromise=require(_0x2254('0x2'));var rs=require(_0x2254('0x3'));var Redis=require('ioredis');var db=require(_0x2254('0x4'))['db'];var logger=require('../../config/logger')(_0x2254('0x5'));var config=require(_0x2254('0x6'));var jayson=require(_0x2254('0x7'));var client=jayson[_0x2254('0x8')][_0x2254('0x9')]({'port':0x232c});config['redis']=_[_0x2254('0xa')](config[_0x2254('0xb')],{'host':_0x2254('0xc'),'port':0x18eb});var socket=require(_0x2254('0xd'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xe'))[_0x2254('0xf')](socket);function respondWithRpcPromise(_0xbf1c18,_0xb395da,_0x1ae415){return new BPromise(function(_0x38fb2b,_0x5b1ab9){return client[_0x2254('0x10')](_0xbf1c18,_0x1ae415)[_0x2254('0x11')](function(_0x506abe){logger[_0x2254('0x12')]('MailAccount,\x20%s,\x20%s',_0xb395da,'request\x20sent');logger[_0x2254('0x13')](_0x2254('0x14'),_0xb395da,_0x2254('0x15'),JSON[_0x2254('0x16')](_0x506abe));if(_0x506abe[_0x2254('0x17')]){if(_0x506abe[_0x2254('0x17')]['code']===0x1f4){logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe['error'][_0x2254('0x19')]);return _0x5b1ab9(_0x506abe[_0x2254('0x17')][_0x2254('0x19')]);}logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe[_0x2254('0x17')]['message']);return _0x38fb2b(_0x506abe[_0x2254('0x17')]['message']);}else{logger[_0x2254('0x12')](_0x2254('0x18'),_0xb395da,_0x2254('0x15'));_0x38fb2b(_0x506abe[_0x2254('0x1a')][_0x2254('0x19')]);}})[_0x2254('0x1b')](function(_0x497724){logger['error']('MailAccount,\x20%s,\x20%s',_0xb395da,_0x497724);_0x5b1ab9(_0x497724);});});}exports[_0x2254('0x1c')]=function(_0x3a79f8){var _0x3c3a98=this;return new Promise(function(_0x1f1163,_0x2801d9){return db[_0x2254('0x1d')]['findAll']({'raw':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a79f8['options']?_0x3a79f8['options']['where']||null:null,'attributes':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'limit':_0x3a79f8['options']?_0x3a79f8['options']['limit']||null:null,'include':_0x3a79f8['options']?_0x3a79f8['options']['include']?_[_0x2254('0x21')](_0x3a79f8[_0x2254('0x1e')][_0x2254('0x22')],function(_0x265467){return{'model':db[_0x265467[_0x2254('0x23')]],'as':_0x265467['as'],'attributes':_0x265467[_0x2254('0x20')],'include':_0x265467['include']?_['map'](_0x265467[_0x2254('0x22')],function(_0x4f6877){return{'model':db[_0x4f6877[_0x2254('0x23')]],'as':_0x4f6877['as'],'attributes':_0x4f6877[_0x2254('0x20')],'include':_0x4f6877[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4f6877[_0x2254('0x22')],function(_0x482688){return{'model':db[_0x482688[_0x2254('0x23')]],'as':_0x482688['as'],'attributes':_0x482688[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x37af8b){logger[_0x2254('0x12')](_0x2254('0x1c'),_0x3a79f8);logger[_0x2254('0x13')](_0x2254('0x1c'),_0x3a79f8,JSON[_0x2254('0x16')](_0x37af8b));_0x1f1163(_0x37af8b);})[_0x2254('0x1b')](function(_0x21c641){logger[_0x2254('0x17')](_0x2254('0x1c'),_0x21c641[_0x2254('0x19')],_0x3a79f8);_0x2801d9(_0x3c3a98[_0x2254('0x17')](0x1f4,_0x21c641[_0x2254('0x19')]));});});};exports[_0x2254('0x24')]=function(_0x291894){var _0x2f32f8=this;return new Promise(function(_0x4e3658,_0xe29526){return db[_0x2254('0x1d')][_0x2254('0x25')]({'raw':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x26')]||null:null,'attributes':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'include':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x22')]?_[_0x2254('0x21')](_0x291894[_0x2254('0x1e')]['include'],function(_0x4a2df0){return{'model':db[_0x4a2df0[_0x2254('0x23')]],'as':_0x4a2df0['as'],'attributes':_0x4a2df0['attributes'],'include':_0x4a2df0[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4a2df0[_0x2254('0x22')],function(_0x141ddc){return{'model':db[_0x141ddc[_0x2254('0x23')]],'as':_0x141ddc['as'],'attributes':_0x141ddc[_0x2254('0x20')],'include':_0x141ddc[_0x2254('0x22')]?_['map'](_0x141ddc[_0x2254('0x22')],function(_0x192e9f){return{'model':db[_0x192e9f[_0x2254('0x23')]],'as':_0x192e9f['as'],'attributes':_0x192e9f[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x3f6007){if(_0x291894[_0x2254('0x1e')][_0x2254('0x27')]===!![])_0x3f6007[_0x2254('0x28')](_0x2254('0x29'),_0x3f6007['getSmtpOptions']());logger[_0x2254('0x12')](_0x2254('0x24'),_0x291894);logger[_0x2254('0x13')](_0x2254('0x24'),_0x291894,JSON['stringify'](_0x3f6007));_0x4e3658(_0x3f6007);})[_0x2254('0x1b')](function(_0x160fec){logger[_0x2254('0x17')](_0x2254('0x24'),_0x160fec[_0x2254('0x19')],_0x291894);_0xe29526(_0x2f32f8[_0x2254('0x17')](0x1f4,_0x160fec[_0x2254('0x19')]));});});};exports[_0x2254('0x2a')]=function(_0x4db9a8){var _0x362ad1=this;return new Promise(function(_0x5c15d7,_0x1df9c3){var _0x19b580={'body':_0x4db9a8[_0x2254('0x2b')],'channel':_0x2254('0x2c')};var _0x460bb3=_[_0x2254('0x2d')](_[_0x2254('0x2e')](db['CmContact'][_0x2254('0x2f')]),[_0x2254('0x30'),_0x2254('0x31'),_0x2254('0x32'),_0x2254('0x33')]);var _0x57cda2=![];if(_0x4db9a8[_0x2254('0x2b')]['id']){delete _0x4db9a8[_0x2254('0x2b')]['id'];}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')])){return _0x1df9c3(_0x362ad1['error'](0x1f4,_0x2254('0x36')));}if(_['isNil'](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')])||_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')]===''){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x37')));}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x39')+_0x460bb3));}if(!_[_0x2254('0x3a')](_0x460bb3,_0x4db9a8[_0x2254('0x2b')]['mapKey'])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x3b')+_0x460bb3));}var _0x2c5609={};_0x2c5609[_0x4db9a8['body'][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x1d')][_0x2254('0x25')]({'where':{'id':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x3d')],'as':_0x2254('0x3e'),'include':[{'model':db[_0x2254('0x3f')],'as':'Contacts','where':_0x2c5609,'limit':0x1,'order':[[_0x2254('0x31'),_0x2254('0x40')]]}]},{'model':db[_0x2254('0x41')],'as':_0x2254('0x42')},{'model':db[_0x2254('0x43')],'as':_0x2254('0x44'),'include':[{'model':db[_0x2254('0x45')],'as':_0x2254('0x45')}]}]})[_0x2254('0x11')](function(_0xa103ea){if(_0xa103ea&&_0xa103ea['List']){var _0x36b977=_0xa103ea[_0x2254('0x46')]({'plain':!![]});_0x19b580['account']=_[_0x2254('0x47')](_0x36b977,[_0x2254('0x42'),_0x2254('0x3e')]);_0x19b580[_0x2254('0x3c')]['smtpOptions']=_0xa103ea[_0x2254('0x48')]();_0x19b580[_0x2254('0x49')]=_0x36b977['Applications'];_0x19b580[_0x2254('0x4a')]=_0x36b977[_0x2254('0x3e')];_0x19b580[_0x2254('0x49')]=_[_0x2254('0x4b')](_0x19b580['applications'],[_0x2254('0x4c')],[_0x2254('0x4d')]);if(_0x19b580[_0x2254('0x3c')]&&_0x19b580['account']['autoclose']){_0x19b580[_0x2254('0x49')][_0x2254('0x4e')]({'id':0x0,'priority':_0x19b580['applications'][_0x2254('0x4f')]+0x1,'app':'close','appdata':'autoclose','interval':_0x2254('0x50')});}if(_0x19b580[_0x2254('0x3c')][_0x2254('0x42')]){delete _0x19b580[_0x2254('0x3c')][_0x2254('0x42')];}if(_0x19b580['account']['List']){delete _0x19b580[_0x2254('0x3c')]['List'];}if(_0x36b977[_0x2254('0x3e')][_0x2254('0x51')][_0x2254('0x4f')]){return _0x36b977[_0x2254('0x3e')]['Contacts'][0x0];}var _0xd5fb20=_[_0x2254('0xa')](_0x4db9a8['body'],{'firstName':_0x4db9a8['body'][_0x2254('0x35')],'ListId':_0x36b977['ListId']});_0xd5fb20[_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x3f')]['create'](_0xd5fb20);}else{throw new Error('List\x20not\x20found');}})[_0x2254('0x11')](function(_0x5b1bd8){_0x19b580[_0x2254('0x52')]=_0x5b1bd8;if(_0x5b1bd8){if(!_0x4db9a8['body']['message']['messageId']){_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')]=rs[_0x2254('0x54')]()+'\x20'+_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')];}var _0x25137c={'ContactId':_0x5b1bd8['id'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')],'to':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'lastMsgAt':moment()[_0x2254('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x2254('0x25')]({'where':{'closed':![],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x57')],'as':_0x2254('0x58'),'attributes':[_0x2254('0x53')],'where':{'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x59')]}}]})[_0x2254('0x11')](function(_0x4a7d36){if(_0x4a7d36){return[_0x4a7d36,![]];}return db['MailInteraction'][_0x2254('0x5a')](_0x25137c)['then'](function(_0x294931){return[_0x294931,!![]];});});}else{throw new Error(_0x2254('0x5b'));}})['spread'](function(_0x3c091e,_0x1b154f){if(_0x3c091e){_0x57cda2=_0x1b154f;if(!_0x1b154f){return _0x3c091e['update']({'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['messageId'],'to':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8['body']['message']['cc'],'subject':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x5c')],'attach':_0x3c091e['attach']?_0x3c091e[_0x2254('0x55')]:_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'substatus':null,'substatusAt':moment()['format'](_0x2254('0x5d')),'lastMsgAt':moment()['format'](_0x2254('0x5d')),'lastMsgDirection':'in'});}else{return _0x3c091e;}}})[_0x2254('0x11')](function(_0x5ed07f){_0x19b580[_0x2254('0x5e')]=_0x5ed07f[_0x2254('0x46')]({'plain':!![]});_0x19b580['interaction'][_0x2254('0x5f')]=_0x57cda2;return db[_0x2254('0x57')][_0x2254('0x5a')]({'body':_0x4db9a8[_0x2254('0x2b')]['body'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'MailInteractionId':_0x5ed07f['id'],'direction':'in','ContactId':_0x19b580[_0x2254('0x52')]['id'],'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x53')],'from':_0x4db9a8['body'][_0x2254('0x19')]['from'],'to':_0x4db9a8[_0x2254('0x2b')]['message']['to'],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8['body'][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'Attachments':_0x4db9a8['body'][_0x2254('0x19')]['attachments'],'originTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['originTo'],'originCc':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x60')],'bcc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['bcc'],'ChatWebsiteId':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x61')]||null,'originChannel':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x62')]||_0x2254('0x63'),'ChatOfflineMessageId':_0x4db9a8['body'][_0x2254('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x2254('0x64')],'as':'Attachments'}]});})['then'](function(_0x4efb07){_0x19b580[_0x2254('0x19')]=_0x4efb07;if(_0x19b580['interaction'][_0x2254('0x65')]){return db[_0x2254('0x66')]['find']({'attributes':['id',_0x2254('0x67')],'where':{'id':_0x19b580[_0x2254('0x5e')][_0x2254('0x65')]}})[_0x2254('0x11')](function(_0x259e10){if(_0x259e10){_0x19b580[_0x2254('0x49')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x259e10[_0x2254('0x67')]+','+(_0x19b580[_0x2254('0x3c')][_0x2254('0x68')]||0xa),'interval':_0x2254('0x50')});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);})[_0x2254('0x11')](function(_0x39b95b){_0x5c15d7(_0x39b95b);})['catch'](function(_0x25eb17){_0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x25eb17['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 20dc903..7090c8a 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 _0x7543=['remove','update','emit','removeListener','register','length','save'];(function(_0x585219,_0x23ba0b){var _0x32c6fe=function(_0x463370){while(--_0x463370){_0x585219['push'](_0x585219['shift']());}};_0x32c6fe(++_0x23ba0b);}(_0x7543,0xca));var _0x3754=function(_0x56e9a1,_0x44c06c){_0x56e9a1=_0x56e9a1-0x0;var _0x46f0f9=_0x7543[_0x56e9a1];return _0x46f0f9;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3754('0x0'),_0x3754('0x1'),_0x3754('0x2')];function createListener(_0x41c08e,_0x34cba1){return function(_0x3af056){_0x34cba1[_0x3754('0x3')](_0x41c08e,_0x3af056);};}function removeListener(_0x276109,_0x3e5e4e){return function(){MailAccountEvents[_0x3754('0x4')](_0x276109,_0x3e5e4e);};}exports[_0x3754('0x5')]=function(_0x1e49a2){for(var _0x48c22f=0x0,_0x2304fb=events[_0x3754('0x6')];_0x48c22f<_0x2304fb;_0x48c22f++){var _0x11ef76=events[_0x48c22f];var _0x6852d5=createListener('mailAccount:'+_0x11ef76,_0x1e49a2);MailAccountEvents['on'](_0x11ef76,_0x6852d5);}}; \ No newline at end of file +var _0x7cc0=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x44e845,_0x17e1ba){var _0x1a1b94=function(_0x206f1c){while(--_0x206f1c){_0x44e845['push'](_0x44e845['shift']());}};_0x1a1b94(++_0x17e1ba);}(_0x7cc0,0x96));var _0x07cc=function(_0x369538,_0x64a48f){_0x369538=_0x369538-0x0;var _0x159686=_0x7cc0[_0x369538];return _0x159686;};'use strict';var MailAccountEvents=require(_0x07cc('0x0'));var events=[_0x07cc('0x1'),_0x07cc('0x2'),_0x07cc('0x3')];function createListener(_0x363d69,_0x2a9430){return function(_0x914198){_0x2a9430[_0x07cc('0x4')](_0x363d69,_0x914198);};}function removeListener(_0x5dd407,_0x5d9627){return function(){MailAccountEvents[_0x07cc('0x5')](_0x5dd407,_0x5d9627);};}exports[_0x07cc('0x6')]=function(_0x4b8b47){for(var _0x5a6b3d=0x0,_0x328f3b=events[_0x07cc('0x7')];_0x5a6b3d<_0x328f3b;_0x5a6b3d++){var _0x458c24=events[_0x5a6b3d];var _0x2508dd=createListener(_0x07cc('0x8')+_0x458c24,_0x4b8b47);MailAccountEvents['on'](_0x458c24,_0x2508dd);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 459d43f..889dac2 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 _0xc3a1=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update'];(function(_0x31d37c,_0x572b1f){var _0x25c904=function(_0x6358f0){while(--_0x6358f0){_0x31d37c['push'](_0x31d37c['shift']());}};_0x25c904(++_0x572b1f);}(_0xc3a1,0x1c3));var _0x1c3a=function(_0x240547,_0x20af7f){_0x240547=_0x240547-0x0;var _0x561d7d=_0xc3a1[_0x240547];return _0x561d7d;};'use strict';var multer=require('multer');var util=require(_0x1c3a('0x0'));var path=require(_0x1c3a('0x1'));var timeout=require(_0x1c3a('0x2'));var express=require(_0x1c3a('0x3'));var router=express[_0x1c3a('0x4')]();var fs_extra=require(_0x1c3a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1c3a('0x6'));var config=require('../../config/environment');var controller=require(_0x1c3a('0x7'));router[_0x1c3a('0x8')]('/:id',auth[_0x1c3a('0x9')](),controller[_0x1c3a('0xa')]);router[_0x1c3a('0xb')](_0x1c3a('0xc'),auth[_0x1c3a('0x9')](),controller[_0x1c3a('0xd')]);router['delete'](_0x1c3a('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x1c3a('0xe')]=router; \ No newline at end of file +var _0xebb9=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','delete','destroy','multer'];(function(_0x5c9380,_0x410fc9){var _0x5a259f=function(_0x536287){while(--_0x536287){_0x5c9380['push'](_0x5c9380['shift']());}};_0x5a259f(++_0x410fc9);}(_0xebb9,0xcf));var _0x9ebb=function(_0x47f331,_0x1f23bd){_0x47f331=_0x47f331-0x0;var _0x56db77=_0xebb9[_0x47f331];return _0x56db77;};'use strict';var multer=require(_0x9ebb('0x0'));var util=require(_0x9ebb('0x1'));var path=require(_0x9ebb('0x2'));var timeout=require(_0x9ebb('0x3'));var express=require(_0x9ebb('0x4'));var router=express[_0x9ebb('0x5')]();var fs_extra=require(_0x9ebb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9ebb('0x7'));var config=require(_0x9ebb('0x8'));var controller=require(_0x9ebb('0x9'));router['get'](_0x9ebb('0xa'),auth[_0x9ebb('0xb')](),controller[_0x9ebb('0xc')]);router[_0x9ebb('0xd')](_0x9ebb('0xa'),auth[_0x9ebb('0xb')](),controller['update']);router[_0x9ebb('0xe')](_0x9ebb('0xa'),auth[_0x9ebb('0xb')](),controller[_0x9ebb('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a29279f..e2f318d 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 _0x3388=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3388,0x126));var _0x8338=function(_0x239e73,_0x236bd4){_0x239e73=_0x239e73-0x0;var _0x22e419=_0x3388[_0x239e73];return _0x22e419;};'use strict';var Sequelize=require(_0x8338('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8338('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8338('0x2')],'allowNull':![],'defaultValue':_0x8338('0x3')},'appdata':{'type':Sequelize[_0x8338('0x4')]()},'description':{'type':Sequelize[_0x8338('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8338('0x5')}}; \ No newline at end of file +var _0x882e=['STRING','*,*,*,*','sequelize','INTEGER','noop'];(function(_0x49774e,_0xe81a02){var _0x2ad708=function(_0x1671a2){while(--_0x1671a2){_0x49774e['push'](_0x49774e['shift']());}};_0x2ad708(++_0xe81a02);}(_0x882e,0x1ab));var _0xe882=function(_0x48b690,_0x4f0c3e){_0x48b690=_0x48b690-0x0;var _0x382742=_0x882e[_0x48b690];return _0x382742;};'use strict';var Sequelize=require(_0xe882('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe882('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe882('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe882('0x3')]},'interval':{'type':Sequelize[_0xe882('0x3')],'defaultValue':_0xe882('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 8c960e5..ac45f6f 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x1612e9,_0x272ff8){var _0x5a39fd=function(_0x358eb9){while(--_0x358eb9){_0x1612e9['push'](_0x1612e9['shift']());}};_0x5a39fd(++_0x272ff8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3fd4e5,_0x525fd4){_0x3fd4e5=_0x3fd4e5-0x0;var _0x1b6b2d=_0x9bde[_0x3fd4e5];return _0x1b6b2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _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(_0x1ba697,_0x186781){var _0x433b23=function(_0xe5df67){while(--_0xe5df67){_0x1ba697['push'](_0x1ba697['shift']());}};_0x433b23(++_0x186781);}(_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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d5e5b4e..fec7097 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 _0xdb7d=['request-promise','path','rimraf','../../config/environment','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xdb7d,0xe5));var _0xddb7=function(_0x2f061f,_0xd744f2){_0x2f061f=_0x2f061f-0x0;var _0x24b187=_0xdb7d[_0x2f061f];return _0x24b187;};'use strict';var _=require(_0xddb7('0x0'));var util=require(_0xddb7('0x1'));var logger=require('../../config/logger')(_0xddb7('0x2'));var moment=require(_0xddb7('0x3'));var BPromise=require(_0xddb7('0x4'));var rp=require(_0xddb7('0x5'));var fs=require('fs');var path=require(_0xddb7('0x6'));var rimraf=require(_0xddb7('0x7'));var config=require(_0xddb7('0x8'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x94f9b5,_0x24e871){return _0x94f9b5['define'](_0xddb7('0x9'),attributes,{'tableName':_0xddb7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddb7('0xb'),'collate':_0xddb7('0xc')});}; \ No newline at end of file +var _0xb71a=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x4fdee1,_0x3f290c){var _0x87826e=function(_0x2cbeaa){while(--_0x2cbeaa){_0x4fdee1['push'](_0x4fdee1['shift']());}};_0x87826e(++_0x3f290c);}(_0xb71a,0x162));var _0xab71=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xb71a[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require(_0xab71('0x0'));var util=require('util');var logger=require(_0xab71('0x1'))(_0xab71('0x2'));var moment=require(_0xab71('0x3'));var BPromise=require('bluebird');var rp=require(_0xab71('0x4'));var fs=require('fs');var path=require(_0xab71('0x5'));var rimraf=require('rimraf');var config=require(_0xab71('0x6'));var attributes=require(_0xab71('0x7'));module[_0xab71('0x8')]=function(_0x48b096,_0x1353c7){return _0x48b096[_0xab71('0x9')](_0xab71('0xa'),attributes,{'tableName':_0xab71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab71('0xc'),'collate':_0xab71('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f1f7487..3a31a56 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 _0x41cb=['client','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x37f9ab,_0x35d0cf){var _0x5735e9=function(_0x640615){while(--_0x640615){_0x37f9ab['push'](_0x37f9ab['shift']());}};_0x5735e9(++_0x35d0cf);}(_0x41cb,0xf6));var _0xb41c=function(_0xc6d868,_0x550be5){_0xc6d868=_0xc6d868-0x0;var _0x195cd1=_0x41cb[_0xc6d868];return _0x195cd1;};'use strict';var _=require('lodash');var util=require(_0xb41c('0x0'));var moment=require(_0xb41c('0x1'));var BPromise=require(_0xb41c('0x2'));var rs=require(_0xb41c('0x3'));var fs=require('fs');var Redis=require(_0xb41c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb41c('0x5'));var logger=require(_0xb41c('0x6'))(_0xb41c('0x7'));var config=require(_0xb41c('0x8'));var jayson=require(_0xb41c('0x9'));var client=jayson[_0xb41c('0xa')][_0xb41c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290da0,_0x1e6711,_0x113a1d){return new BPromise(function(_0xe0554d,_0x518a28){return client[_0xb41c('0xc')](_0x290da0,_0x113a1d)[_0xb41c('0xd')](function(_0x50ddad){logger['info'](_0xb41c('0xe'),_0x1e6711,'request\x20sent');logger[_0xb41c('0xf')](_0xb41c('0x10'),_0x1e6711,_0xb41c('0x11'),JSON[_0xb41c('0x12')](_0x50ddad));if(_0x50ddad[_0xb41c('0x13')]){if(_0x50ddad[_0xb41c('0x13')][_0xb41c('0x14')]===0x1f4){logger[_0xb41c('0x13')]('MailApplication,\x20%s,\x20%s',_0x1e6711,_0x50ddad[_0xb41c('0x13')][_0xb41c('0x15')]);return _0x518a28(_0x50ddad[_0xb41c('0x13')][_0xb41c('0x15')]);}logger[_0xb41c('0x13')](_0xb41c('0xe'),_0x1e6711,_0x50ddad['error']['message']);return _0xe0554d(_0x50ddad['error'][_0xb41c('0x15')]);}else{logger[_0xb41c('0x16')](_0xb41c('0xe'),_0x1e6711,_0xb41c('0x11'));_0xe0554d(_0x50ddad[_0xb41c('0x17')][_0xb41c('0x15')]);}})['catch'](function(_0x3bb552){logger[_0xb41c('0x13')](_0xb41c('0xe'),_0x1e6711,_0x3bb552);_0x518a28(_0x3bb552);});});}exports[_0xb41c('0x18')]=function(_0x11d3ce){var _0x51a7b2=this;return new Promise(function(_0x14d62e,_0x570982){return db[_0xb41c('0x19')][_0xb41c('0x1a')](_0x11d3ce[_0xb41c('0x1b')],{'raw':_0x11d3ce[_0xb41c('0x1c')]?_0x11d3ce['options'][_0xb41c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d3ce[_0xb41c('0x1c')]?_0x11d3ce[_0xb41c('0x1c')]['where']||null:null,'attributes':_0x11d3ce[_0xb41c('0x1c')]?_0x11d3ce[_0xb41c('0x1c')][_0xb41c('0x1e')]||null:null,'limit':_0x11d3ce[_0xb41c('0x1c')]?_0x11d3ce[_0xb41c('0x1c')]['limit']||null:null})['then'](function(_0x1ed902){logger[_0xb41c('0x16')](_0xb41c('0x18'),_0x11d3ce);logger['debug']('UpdateMailApplication',_0x11d3ce,JSON['stringify'](_0x1ed902));_0x14d62e(_0x1ed902);})[_0xb41c('0x1f')](function(_0x1f6bda){logger[_0xb41c('0x13')](_0xb41c('0x18'),_0x1f6bda[_0xb41c('0x15')],_0x11d3ce);_0x570982(_0x51a7b2[_0xb41c('0x13')](0x1f4,_0x1f6bda[_0xb41c('0x15')]));});});}; \ No newline at end of file +var _0x4ca3=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','MailApplication','body','options','raw','where','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring'];(function(_0x260cda,_0x53f451){var _0x3cc073=function(_0x2b61ec){while(--_0x2b61ec){_0x260cda['push'](_0x260cda['shift']());}};_0x3cc073(++_0x53f451);}(_0x4ca3,0x150));var _0x34ca=function(_0x31efca,_0x4960ee){_0x31efca=_0x31efca-0x0;var _0x28990d=_0x4ca3[_0x31efca];return _0x28990d;};'use strict';var _=require(_0x34ca('0x0'));var util=require(_0x34ca('0x1'));var moment=require(_0x34ca('0x2'));var BPromise=require(_0x34ca('0x3'));var rs=require(_0x34ca('0x4'));var fs=require('fs');var Redis=require(_0x34ca('0x5'));var db=require(_0x34ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x34ca('0x7'));var config=require(_0x34ca('0x8'));var jayson=require(_0x34ca('0x9'));var client=jayson[_0x34ca('0xa')][_0x34ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f55e,_0x340f9d,_0x1434a8){return new BPromise(function(_0x1656ea,_0x1daf41){return client[_0x34ca('0xc')](_0x16f55e,_0x1434a8)[_0x34ca('0xd')](function(_0x2036c1){logger['info'](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));logger[_0x34ca('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x340f9d,_0x34ca('0xf'),JSON[_0x34ca('0x11')](_0x2036c1));if(_0x2036c1[_0x34ca('0x12')]){if(_0x2036c1[_0x34ca('0x12')][_0x34ca('0x13')]===0x1f4){logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')][_0x34ca('0x14')]);return _0x1daf41(_0x2036c1['error'][_0x34ca('0x14')]);}logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')]['message']);return _0x1656ea(_0x2036c1['error'][_0x34ca('0x14')]);}else{logger[_0x34ca('0x15')](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));_0x1656ea(_0x2036c1[_0x34ca('0x16')][_0x34ca('0x14')]);}})[_0x34ca('0x17')](function(_0x29c1b3){logger[_0x34ca('0x12')]('MailApplication,\x20%s,\x20%s',_0x340f9d,_0x29c1b3);_0x1daf41(_0x29c1b3);});});}exports['UpdateMailApplication']=function(_0x485dc0){var _0x298ef2=this;return new Promise(function(_0x22d566,_0x2466df){return db[_0x34ca('0x18')]['update'](_0x485dc0[_0x34ca('0x19')],{'raw':_0x485dc0[_0x34ca('0x1a')]?_0x485dc0['options'][_0x34ca('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485dc0[_0x34ca('0x1a')]?_0x485dc0[_0x34ca('0x1a')][_0x34ca('0x1c')]||null:null,'attributes':_0x485dc0['options']?_0x485dc0['options']['attributes']||null:null,'limit':_0x485dc0['options']?_0x485dc0[_0x34ca('0x1a')][_0x34ca('0x1d')]||null:null})[_0x34ca('0xd')](function(_0x3cb69a){logger[_0x34ca('0x15')](_0x34ca('0x1e'),_0x485dc0);logger[_0x34ca('0x10')]('UpdateMailApplication',_0x485dc0,JSON[_0x34ca('0x11')](_0x3cb69a));_0x22d566(_0x3cb69a);})[_0x34ca('0x17')](function(_0x59ebd1){logger[_0x34ca('0x12')](_0x34ca('0x1e'),_0x59ebd1[_0x34ca('0x14')],_0x485dc0);_0x2466df(_0x298ef2[_0x34ca('0x12')](0x1f4,_0x59ebd1[_0x34ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index b3e32c8..38b15bd 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 _0x1344=['mailinteraction:addtags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x1344,0x14d));var _0x4134=function(_0x4ded16,_0x23fcbf){_0x4ded16=_0x4ded16-0x0;var _0x4a525a=_0x1344[_0x4ded16];return _0x4a525a;};'use strict';var express=require(_0x4134('0x0'));var router=express[_0x4134('0x1')]();var auth=require(_0x4134('0x2'));var interaction=require(_0x4134('0x3'));var controller=require('./mailInteraction.controller');router[_0x4134('0x4')]('/',auth[_0x4134('0x5')](),controller[_0x4134('0x6')]);router['get'](_0x4134('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x4134('0x4')](_0x4134('0x8'),auth[_0x4134('0x5')](),controller['show']);router['get'](_0x4134('0x9'),auth[_0x4134('0x5')](),controller[_0x4134('0xa')]);router[_0x4134('0x4')]('/:id/download',auth[_0x4134('0x5')](),controller[_0x4134('0xb')]);router['post']('/',auth[_0x4134('0x5')](),controller[_0x4134('0xc')]);router[_0x4134('0xd')](_0x4134('0x9'),auth['isAuthenticated'](),controller[_0x4134('0xe')]);router[_0x4134('0xd')](_0x4134('0xf'),auth[_0x4134('0x5')](),interaction[_0x4134('0x10')](_0x4134('0x11'),_0x4134('0x12')),controller['addTags']);router[_0x4134('0x13')](_0x4134('0x8'),auth[_0x4134('0x5')](),interaction[_0x4134('0x10')](_0x4134('0x11'),_0x4134('0x14')),controller[_0x4134('0x15')]);router[_0x4134('0x16')]('/:id',auth[_0x4134('0x5')](),interaction['tracked']('mail',_0x4134('0x17')),controller[_0x4134('0x18')]);router[_0x4134('0x16')](_0x4134('0xf'),auth[_0x4134('0x5')](),controller[_0x4134('0x19')]);module[_0x4134('0x1a')]=router; \ No newline at end of file +var _0xb24e=['get','/describe','/:id','isAuthenticated','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x5bf840,_0x9fc2ab){var _0x4f4355=function(_0x5bef49){while(--_0x5bef49){_0x5bf840['push'](_0x5bf840['shift']());}};_0x4f4355(++_0x9fc2ab);}(_0xb24e,0x8c));var _0xeb24=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb24e[_0x2641f9];return _0x585741;};'use strict';var express=require('express');var router=express[_0xeb24('0x0')]();var auth=require(_0xeb24('0x1'));var interaction=require(_0xeb24('0x2'));var controller=require(_0xeb24('0x3'));router[_0xeb24('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb24('0x4')](_0xeb24('0x5'),auth['isAuthenticated'](),controller['describe']);router[_0xeb24('0x4')](_0xeb24('0x6'),auth[_0xeb24('0x7')](),controller['show']);router[_0xeb24('0x4')](_0xeb24('0x8'),auth[_0xeb24('0x7')](),controller[_0xeb24('0x9')]);router['get']('/:id/download',auth[_0xeb24('0x7')](),controller[_0xeb24('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xeb24('0xb')]);router[_0xeb24('0xc')]('/:id/messages',auth['isAuthenticated'](),controller[_0xeb24('0xd')]);router[_0xeb24('0xc')](_0xeb24('0xe'),auth['isAuthenticated'](),interaction[_0xeb24('0xf')](_0xeb24('0x10'),'mailinteraction:addtags'),controller['addTags']);router[_0xeb24('0x11')](_0xeb24('0x6'),auth[_0xeb24('0x7')](),interaction['tracked'](_0xeb24('0x10'),_0xeb24('0x12')),controller[_0xeb24('0x13')]);router[_0xeb24('0x14')](_0xeb24('0x6'),auth['isAuthenticated'](),interaction[_0xeb24('0xf')](_0xeb24('0x10'),_0xeb24('0x15')),controller[_0xeb24('0x16')]);router[_0xeb24('0x14')](_0xeb24('0xe'),auth[_0xeb24('0x7')](),controller[_0xeb24('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a859f4c..b092c2b 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 _0x1352=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out'];(function(_0x2074e3,_0x279dcc){var _0x1dd735=function(_0x2ad5f1){while(--_0x2ad5f1){_0x2074e3['push'](_0x2074e3['shift']());}};_0x1dd735(++_0x279dcc);}(_0x1352,0x17a));var _0x2135=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x1352[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x2135('0x0'));var iconv=require(_0x2135('0x1'));module[_0x2135('0x2')]={'closed':{'type':Sequelize[_0x2135('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2135('0x4')]},'disposition':{'type':Sequelize[_0x2135('0x5')]},'secondDisposition':{'type':Sequelize[_0x2135('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2135('0x5')]},'note':{'type':Sequelize[_0x2135('0x5')]},'inReplyTo':{'type':Sequelize[_0x2135('0x5')](0x1fe)},'to':{'type':Sequelize[_0x2135('0x5')]},'cc':{'type':Sequelize[_0x2135('0x6')](_0x2135('0x7'))},'subject':{'type':Sequelize[_0x2135('0x6')]()},'attach':{'type':Sequelize[_0x2135('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x2135('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x2135('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2135('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2135('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2135('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2135('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x34ab=['exports','BOOLEAN','STRING','long','TEXT','DATE','ENUM','sequelize','iconv'];(function(_0x259cf6,_0x2750ba){var _0x4e1ac4=function(_0x23c9e9){while(--_0x23c9e9){_0x259cf6['push'](_0x259cf6['shift']());}};_0x4e1ac4(++_0x2750ba);}(_0x34ab,0xf1));var _0xb34a=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x34ab[_0x47cfa0];return _0x386b1d;};'use strict';var Sequelize=require(_0xb34a('0x0'));var iconv=require(_0xb34a('0x1'));module[_0xb34a('0x2')]={'closed':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb34a('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb34a('0x4')]},'inReplyTo':{'type':Sequelize[_0xb34a('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb34a('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xb34a('0x5'))},'subject':{'type':Sequelize[_0xb34a('0x6')]()},'attach':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb34a('0x7')]},'substatus':{'type':Sequelize[_0xb34a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xb34a('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xb34a('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb34a('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xb34a('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb34a('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 be9d6af..f0ac02e 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 _0x4753=['show','params','MailInteraction','options','create','body','describe','addMessage','ids','omit','format','include','findAll','inlineCss','setTags','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','bcc','subject','createdAt','Messages','get','mkdirSync','each','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','eml-format','rimraf','zip-dir','bluebird','util','lodash','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','sendStatus','error','stack','name','send','fullname','TagIds','split','forEach','Tags','push','MailMessage','findOne','-id','then','lastMsgText','trimStart','plainBody','catch','waiting','talking','answered','unmanaged','UserId','closed','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','select','field','color','tools_tags','u.fullname','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','length','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','compact','MailAccountId','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows'];(function(_0x5bf147,_0x3fc58c){var _0x26230e=function(_0xa16692){while(--_0xa16692){_0x5bf147['push'](_0x5bf147['shift']());}};_0x26230e(++_0x3fc58c);}(_0x4753,0x1f4));var _0x3475=function(_0x5e7235,_0x86bdda){_0x5e7235=_0x5e7235-0x0;var _0x22a4d8=_0x4753[_0x5e7235];return _0x22a4d8;};'use strict';var emlformat=require(_0x3475('0x0'));var rimraf=require(_0x3475('0x1'));var zipdir=require(_0x3475('0x2'));var moment=require('moment');var BPromise=require(_0x3475('0x3'));var util=require(_0x3475('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x3475('0x5'));var squel=require('squel');var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x3475('0x6'));var logger=require(_0x3475('0x7'))('api');var config=require(_0x3475('0x8'));var db=require(_0x3475('0x9'))['db'];var htmlEntities=require(_0x3475('0xa'));config[_0x3475('0xb')]=_[_0x3475('0xc')](config[_0x3475('0xb')],{'host':_0x3475('0xd'),'port':0x18eb});var socket=require(_0x3475('0xe'))(new Redis(config[_0x3475('0xb')]));require(_0x3475('0xf'))['register'](socket);function respondWithStatusCode(_0x30f276,_0x2524d1){_0x2524d1=_0x2524d1||0xcc;return function(_0x32e7f4){if(_0x32e7f4){return _0x30f276['sendStatus'](_0x2524d1);}return _0x30f276[_0x3475('0x10')](_0x2524d1)[_0x3475('0x11')]();};}function respondWithResult(_0x49e0fa,_0x4510dc){_0x4510dc=_0x4510dc||0xc8;return function(_0x5a1f57){if(_0x5a1f57){return _0x49e0fa[_0x3475('0x10')](_0x4510dc)[_0x3475('0x12')](_0x5a1f57);}};}function respondWithFilteredResult(_0x1b9cfc,_0x4a4485){return function(_0x3fbdd5){if(_0x3fbdd5){var _0x36d593=typeof _0x4a4485[_0x3475('0x13')]===_0x3475('0x14')&&typeof _0x4a4485['limit']===_0x3475('0x14');var _0x56e77a=_0x3fbdd5['count'];var _0x3fd0d2=_0x36d593?0x0:_0x4a4485[_0x3475('0x13')];var _0x325fe5=_0x36d593?_0x3fbdd5[_0x3475('0x15')]:_0x4a4485[_0x3475('0x13')]+_0x4a4485['limit'];var _0x1e1cb0;if(_0x325fe5>=_0x56e77a){_0x325fe5=_0x56e77a;_0x1e1cb0=0xc8;}else{_0x1e1cb0=0xce;}_0x1b9cfc['status'](_0x1e1cb0);return _0x1b9cfc[_0x3475('0x16')](_0x3475('0x17'),_0x3fd0d2+'-'+_0x325fe5+'/'+_0x56e77a)[_0x3475('0x12')](_0x3fbdd5);}return null;};}function saveUpdates(_0x36a5b8){return function(_0x5983a8){if(_0x5983a8){return _0x5983a8[_0x3475('0x18')](_0x36a5b8)['then'](function(_0x3ab7a8){return _0x3ab7a8;});}return null;};}function removeEntity(_0x460c2a){return function(_0x2e53a9){if(_0x2e53a9){return _0x2e53a9[_0x3475('0x19')]()['then'](function(){_0x460c2a[_0x3475('0x10')](0xcc)[_0x3475('0x11')]();});}};}function handleEntityNotFound(_0x649ad){return function(_0x4e0221){if(!_0x4e0221){_0x649ad[_0x3475('0x1a')](0x194);}return _0x4e0221;};}function handleError(_0x381aea,_0x438992){_0x438992=_0x438992||0x1f4;return function(_0x38ea14){logger[_0x3475('0x1b')](_0x38ea14[_0x3475('0x1c')]);if(_0x38ea14[_0x3475('0x1d')]){delete _0x38ea14[_0x3475('0x1d')];}_0x381aea[_0x3475('0x10')](_0x438992)[_0x3475('0x1e')](_0x38ea14);};}function getInteractionUsers(_0x1d0e95,_0x1e8830){return new BPromise(function(_0x1c8ca6,_0x4ff2a1){try{if(_0x1e8830[_0x1d0e95['id']]){_0x1d0e95['Users']=_['map'](_0x1e8830[_0x1d0e95['id']],function(_0x552cc){return{'id':_0x552cc['id'],'fullname':_0x552cc[_0x3475('0x1f')]};});}}catch(_0x4ad783){_0x4ff2a1(_0x4ad783);}_0x1c8ca6(_0x1d0e95);});}function getInteractionTags(_0x1f3481,_0x3f4052){return new BPromise(function(_0x6a0197,_0x1203e7){try{if(_0x1f3481[_0x3475('0x20')]){_0x1f3481['Tags']=[];_0x1f3481['TagIds'][_0x3475('0x21')](',')[_0x3475('0x22')](function(_0x3e78a8){_0x1f3481[_0x3475('0x23')][_0x3475('0x24')](_0x3f4052[_0x3e78a8]);});}delete _0x1f3481[_0x3475('0x20')];}catch(_0x5e8cc3){_0x1203e7(_0x5e8cc3);}_0x6a0197(_0x1f3481);});}function getLastMessageText(_0xd07037){return new BPromise(function(_0x1b6ef3,_0x19943f){return db[_0x3475('0x25')][_0x3475('0x26')]({'where':{'$and':[{'MailInteractionId':_0xd07037['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x3475('0x27'),'raw':!![]})[_0x3475('0x28')](function(_0x18fd29){if(_0x18fd29&&_0x18fd29['plainBody']){_0xd07037[_0x3475('0x29')]=_[_0x3475('0x2a')](_0x18fd29[_0x3475('0x2b')]);}_0x1b6ef3(_0xd07037);})[_0x3475('0x2c')](function(_0x5a4774){_0x19943f(_0x5a4774);});});}function updateMailInteraction(_0x4362ad,_0xb4cc70,_0x580942,_0x7f22c3){return new BPromise(function(_0x3c6de4,_0x295c86){return getInteractionUsers(_0x4362ad,_0x580942)[_0x3475('0x28')](function(_0x1c01bf){return getInteractionTags(_0x1c01bf,_0xb4cc70);})[_0x3475('0x28')](function(_0x4d89dd){return getStateInteraction(_0x4d89dd);})[_0x3475('0x28')](function(_0x784ef8){if(_0x7f22c3){_0x3c6de4(getLastMessageText(_0x784ef8));}else{_0x3c6de4(_0x784ef8);}})[_0x3475('0x2c')](function(_0x501775){_0x295c86(_0x501775);});});}function getStateInteraction(_0x49d11d){return new BPromise(function(_0x229124){_0x49d11d[_0x3475('0x2d')]=0x0;_0x49d11d[_0x3475('0x2e')]=0x0;_0x49d11d[_0x3475('0x2f')]=0x0;_0x49d11d[_0x3475('0x30')]=0x0;_0x49d11d['total']=0x0;if(!_0x49d11d['closed']&&!_0x49d11d[_0x3475('0x31')]){_0x49d11d[_0x3475('0x2d')]+=0x1;}if(!_0x49d11d[_0x3475('0x32')]&&_0x49d11d[_0x3475('0x31')]){_0x49d11d['talking']+=0x1;if(_0x49d11d[_0x3475('0x2d')]){_0x49d11d[_0x3475('0x2d')]-=0x1;}}if(_0x49d11d[_0x3475('0x32')]&&_0x49d11d[_0x3475('0x31')]){_0x49d11d[_0x3475('0x2f')]+=0x1;if(_0x49d11d[_0x3475('0x2e')]){_0x49d11d[_0x3475('0x2e')]-=0x1;}}if(_0x49d11d[_0x3475('0x32')]&&!_0x49d11d[_0x3475('0x31')]){_0x49d11d[_0x3475('0x30')]+=0x1;if(_0x49d11d[_0x3475('0x2d')]){_0x49d11d['waiting']-=0x1;}}_0x49d11d['total']+=0x1;_0x229124(_0x49d11d);});}exports[_0x3475('0x33')]=function(_0x19760a,_0x3da549){var _0x1add5e={},_0x10dbdf={},_0x3c5495={'count':0x0,'rows':[]};var _0x2e6ad2=_[_0x3475('0x34')](db['MailInteraction'][_0x3475('0x35')],function(_0x378023){return{'name':_0x378023[_0x3475('0x36')],'type':_0x378023['type'][_0x3475('0x37')]};});_0x10dbdf[_0x3475('0x38')]=_[_0x3475('0x34')](_0x2e6ad2,_0x3475('0x1d'));_0x10dbdf['query']=_[_0x3475('0x39')](_0x19760a[_0x3475('0x3a')]);_0x10dbdf[_0x3475('0x3b')]=_['intersection'](_0x10dbdf[_0x3475('0x38')],_0x10dbdf['query']);_0x1add5e[_0x3475('0x3c')]=_[_0x3475('0x3d')](_0x10dbdf[_0x3475('0x38')],qs[_0x3475('0x3e')](_0x19760a[_0x3475('0x3a')]['fields']));_0x1add5e[_0x3475('0x3c')]=_0x1add5e['attributes']['length']?_0x1add5e[_0x3475('0x3c')]:_0x10dbdf[_0x3475('0x38')];if(!_0x19760a['query'][_0x3475('0x3f')](_0x3475('0x40'))){_0x1add5e[_0x3475('0x41')]=qs[_0x3475('0x41')](_0x19760a['query']['limit']);_0x1add5e[_0x3475('0x13')]=qs['offset'](_0x19760a['query']['offset']);}_0x1add5e[_0x3475('0x42')]=qs['sort'](_0x19760a[_0x3475('0x3a')][_0x3475('0x43')]);_0x1add5e[_0x3475('0x44')]=qs[_0x3475('0x3b')](_[_0x3475('0x45')](_0x19760a[_0x3475('0x3a')],_0x10dbdf['filters']),_0x2e6ad2);var _0x6c593b=[];var _0x5d1833=squel[_0x3475('0x46')]()[_0x3475('0x47')]('id')[_0x3475('0x47')](_0x3475('0x1d'))[_0x3475('0x47')](_0x3475('0x48'))['from'](_0x3475('0x49'));var _0x514cb1=squel[_0x3475('0x46')]()['field']('u.id')[_0x3475('0x47')](_0x3475('0x4a'))[_0x3475('0x47')]('ui.MailInteractionId')['from'](_0x3475('0x4b'),'ui')['left_join'](_0x3475('0x4c'),'u',_0x3475('0x4d'));var _0x42e5e6=squel[_0x3475('0x46')]()['from'](_0x3475('0x4e'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3475('0x4f')](_0x3475('0x4c'),'o',_0x3475('0x50'))['left_join'](_0x3475('0x51'),'a',_0x3475('0x52'))['left_join'](_0x3475('0x53'),'me',_0x3475('0x54'))[_0x3475('0x4f')](_0x3475('0x55'),'it',_0x3475('0x56'))['left_join'](_0x3475('0x49'),'t','t.id\x20=\x20it.TagId');var _0x10035d=squel[_0x3475('0x57')]();var _0x318b98=[];var _0x14e4a8=squel['expr']();var _0x9f0522;if(_0x19760a[_0x3475('0x3a')][_0x3475('0x58')]){_0x9f0522=as[_0x3475('0x59')](_0x19760a[_0x3475('0x3a')][_0x3475('0x58')]);var _0x270159=_0x9f0522['sqlOperator'];for(var _0x39941b=0x0;_0x39941b<_0x9f0522[_0x3475('0x5a')]['length'];_0x39941b++){var _0x2ec406=_0x9f0522[_0x3475('0x5a')][_0x39941b];var _0x573eab='i';var _0x114eef=_[_0x3475('0x5b')](_0x2e6ad2,['name',_0x2ec406[_0x3475('0x47')]]);if(!_0x114eef){switch(_0x2ec406[_0x3475('0x47')]){case _0x3475('0x5c'):if(_0x2ec406[_0x3475('0x5d')]==0x1){_0x42e5e6[_0x3475('0x5e')]('`'+_0x2ec406[_0x3475('0x47')]+_0x3475('0x5f'));}else{_0x42e5e6[_0x3475('0x5e')]('`'+_0x2ec406[_0x3475('0x47')]+_0x3475('0x60'));}break;case _0x3475('0x61'):if(_0x2ec406['operator']==='$substring'){if(_0x2ec406[_0x3475('0x5d')][_0x3475('0x21')]('\x20')[_0x3475('0x62')]>0x1){_0x10035d[_0x270159]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3475('0x63')](_0x2ec406[_0x3475('0x5d')]),null);}else{var _0x3cd513='%'+_0x2ec406[_0x3475('0x5d')]+'%';_0x10035d[_0x270159](_0x3475('0x64'),_0x3cd513,_0x3cd513,_0x3cd513);}}else{_0x114eef=_['find'](_0x2e6ad2,[_0x3475('0x1d'),_0x3475('0x65')]);_0x2ec406[_0x3475('0x47')]=_0x3475('0x65');_0x4bda43=as[_0x3475('0x66')](_0x573eab,_0x114eef[_0x3475('0x67')],_0x2ec406);_0x10035d[_0x270159](_0x4bda43[_0x3475('0x68')],_0x4bda43[_0x3475('0x5d')][_0x3475('0x69')],_0x4bda43['value'][_0x3475('0x11')]);}break;case _0x3475('0x6a'):var _0x36e6d4=_0x2ec406[_0x3475('0x5d')][_0x3475('0x21')](',')['map'](function(_0x32eecd){return Number(_0x32eecd);});_0x36e6d4['forEach'](function(_0x155923){_0x14e4a8['or'](_0x3475('0x6b'),'%,'+_0x155923+',%');});_0x318b98=_[_0x3475('0x6c')](_0x318b98,_0x36e6d4);break;case'User':if(_0x2ec406[_0x3475('0x6d')]===_0x3475('0x6e')){_0x10035d[_0x270159](_0x3475('0x6f'),'%'+_0x2ec406[_0x3475('0x5d')]+'%',null);}else{_0x114eef=_[_0x3475('0x5b')](_0x2e6ad2,[_0x3475('0x1d'),_0x3475('0x31')]);_0x2ec406[_0x3475('0x47')]='UserId';_0x4bda43=as['buildExpression'](_0x573eab,_0x114eef[_0x3475('0x67')],_0x2ec406);_0x10035d[_0x270159](_0x4bda43[_0x3475('0x68')],_0x4bda43['value'][_0x3475('0x69')],_0x4bda43['value'][_0x3475('0x11')]);}break;case _0x3475('0x2b'):_0x4bda43=as['buildExpression']('me',null,_0x2ec406);_0x10035d[_0x270159](_0x4bda43['text'],_0x4bda43['value']['start'],_0x4bda43['value']['end']);break;}}else{var _0x4bda43=as['buildExpression'](_0x573eab,_0x114eef[_0x3475('0x67')],_0x2ec406);_0x10035d[_0x270159](_0x4bda43['text'],_0x4bda43[_0x3475('0x5d')][_0x3475('0x69')],_0x4bda43[_0x3475('0x5d')][_0x3475('0x11')]);}}}else{var _0x4b1a4f=_(_0x19760a[_0x3475('0x3a')])[_0x3475('0x39')]()['map'](function(_0x23afde){return _['some'](_0x2e6ad2,[_0x3475('0x1d'),_0x23afde])?_0x23afde:undefined;})[_0x3475('0x70')]()[_0x3475('0x5d')]();if(!_['isEmpty'](_0x4b1a4f)){_0x4b1a4f[_0x3475('0x22')](function(_0x2ec78a){if(_0x2ec78a===_0x3475('0x71')){_0x42e5e6['where'](_0x3475('0x72'),[]['concat'](_0x19760a[_0x3475('0x3a')][_0x2ec78a]));}else if(_0x2ec78a==='createdAt'){var _0xdb9407=JSON[_0x3475('0x73')](_0x19760a[_0x3475('0x3a')][_0x2ec78a])[_0x3475('0x74')];var _0x3a1513=JSON['parse'](_0x19760a[_0x3475('0x3a')][_0x2ec78a])[_0x3475('0x75')];_0x42e5e6[_0x3475('0x44')](_0x3475('0x76'),_0xdb9407,_0x3a1513);}else{if(_0x19760a['query'][_0x2ec78a]===_0x3475('0x77')){_0x42e5e6[_0x3475('0x44')]('i.'+_0x2ec78a+_0x3475('0x78'));}else{_0x42e5e6[_0x3475('0x44')]('i.'+_0x2ec78a+_0x3475('0x79'),_0x19760a['query'][_0x2ec78a]);}}});}if(_0x19760a[_0x3475('0x3a')]['read']){if(_0x19760a[_0x3475('0x3a')]['read']==0x1){_0x42e5e6['having'](_0x3475('0x7a'));}else{_0x42e5e6[_0x3475('0x5e')](_0x3475('0x7b'));}}if(_0x19760a[_0x3475('0x3a')][_0x3475('0x7c')]){_0x318b98=_['isArray'](_0x19760a['query'][_0x3475('0x7c')])?_0x19760a[_0x3475('0x3a')][_0x3475('0x7c')]:new Array(_0x19760a[_0x3475('0x3a')]['tag']);_0x318b98['forEach'](function(_0x2dde51){_0x14e4a8['or'](_0x3475('0x6b'),'%,'+_0x2dde51+',%');});}if(_0x19760a['query'][_0x3475('0x7d')]){var _0x1ed305=_0x19760a['query']['filter'][_0x3475('0x7e')]('\x5c','\x5c\x5c')[_0x3475('0x7e')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1ed305)){_0x10035d['or']('i.id\x20LIKE\x20?',_0x1ed305+'%');}else if(qs[_0x3475('0x7f')](_0x1ed305)){_0x10035d['or']('c.email\x20LIKE\x20?',_0x1ed305+'%');}else{_0x10035d['or'](_0x3475('0x80'),qs[_0x3475('0x63')](_0x1ed305))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3475('0x63')](_0x1ed305));}}}_0x42e5e6[_0x3475('0x44')](_0x10035d);_0x42e5e6[_0x3475('0x81')](_0x3475('0x82'));var _0x1f4b58={'type':db[_0x3475('0x83')][_0x3475('0x84')][_0x3475('0x85')],'raw':!![]};var _0x3c3aa0=_0x42e5e6[_0x3475('0x86')]();_0x3c3aa0['field'](_0x3475('0x82'));_0x3c3aa0[_0x3475('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3475('0x5c'));if(_0x1add5e[_0x3475('0x42')]){_0x1add5e[_0x3475('0x42')][_0x3475('0x22')](function(_0xeec30a){var _0xa86db0=_0xeec30a[0x0]===_0x3475('0x87')?_0xeec30a[0x0]:'i.'+_0xeec30a[0x0];_0x42e5e6[_0x3475('0x42')](_0xa86db0,_0xeec30a[0x1]===_0x3475('0x88')?![]:!![]);});}if(!_[_0x3475('0x89')](_0x318b98)){_0x42e5e6[_0x3475('0x5e')](_0x14e4a8);_0x3c3aa0[_0x3475('0x44')](_0x3475('0x8a'),_0x318b98);}BPromise['resolve']()[_0x3475('0x28')](function(){if(!_0x9f0522){if(_0x19760a[_0x3475('0x3a')][_0x3475('0x71')])return;_0x3c3aa0[_0x3475('0x44')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x42e5e6['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x19760a[_0x3475('0x8b')][_0x3475('0x8c')]!==_0x3475('0x8d'))return;return _0x19760a[_0x3475('0x8b')][_0x3475('0x8e')]({'attributes':['id'],'raw':!![]})[_0x3475('0x28')](function(_0x409099){if(_[_0x3475('0x89')](_0x409099)){_0x3c3aa0[_0x3475('0x44')](_0x3475('0x8f'));_0x42e5e6[_0x3475('0x44')](_0x3475('0x8f'));}else{_0x3c3aa0[_0x3475('0x44')](_0x3475('0x72'),_['map'](_0x409099,'id'));_0x42e5e6[_0x3475('0x44')](_0x3475('0x72'),_['map'](_0x409099,'id'));}});})['then'](function(){if(_0x19760a['user'][_0x3475('0x8c')]==='agent'&&!_0x9f0522&&!_0x19760a[_0x3475('0x3a')][_0x3475('0x71')])return[];return db[_0x3475('0x90')][_0x3475('0x3a')](_0x3c3aa0[_0x3475('0x91')](),_0x1f4b58);})[_0x3475('0x28')](function(_0x30e30b){_0x3c5495[_0x3475('0x15')]=_0x30e30b[_0x3475('0x62')];if(_0x3c5495[_0x3475('0x15')]===0x0)return[];return db[_0x3475('0x90')]['query'](_0x5d1833['toString'](),_0x1f4b58)[_0x3475('0x28')](function(_0x336c19){_0x6c593b=_[_0x3475('0x92')](_0x336c19,'id');_0x1f4b58=_[_0x3475('0x93')](_0x1f4b58,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19760a[_0x3475('0x3a')][_0x3475('0x3e')]){_0x1add5e['attributes'][_0x3475('0x22')](function(_0x11c38d){_0x42e5e6['field']('i.'+_0x11c38d);});}else{_0x42e5e6[_0x3475('0x47')](_0x3475('0x94'),_0x3475('0x5c'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x95'),_0x3475('0x96'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x97'),_0x3475('0x98'));_0x42e5e6[_0x3475('0x47')]('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',_0x3475('0x87'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x82'));_0x42e5e6['field'](_0x3475('0x99'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x9a'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x9b'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x9c'));_0x42e5e6[_0x3475('0x47')]('i.attach');_0x42e5e6[_0x3475('0x47')](_0x3475('0x9d'));_0x42e5e6['field']('i.lastMsgDirection');_0x42e5e6[_0x3475('0x47')](_0x3475('0x9e'));_0x42e5e6[_0x3475('0x47')](_0x3475('0x9f'));_0x42e5e6[_0x3475('0x47')]('i.secondDisposition');_0x42e5e6[_0x3475('0x47')](_0x3475('0xa0'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa1'));_0x42e5e6['field'](_0x3475('0xa2'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa3'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa4'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa5'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa6'),_0x3475('0xa7'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xa8'),'Contact.lastName');_0x42e5e6[_0x3475('0x47')](_0x3475('0xa9'),_0x3475('0xaa'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xab'),_0x3475('0xac'));_0x42e5e6[_0x3475('0x47')]('c.mobile',_0x3475('0xad'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xae'),_0x3475('0xaf'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xb0'),_0x3475('0xb1'));_0x42e5e6[_0x3475('0x47')](_0x3475('0xb2'),_0x3475('0xb3'));_0x42e5e6['field'](_0x3475('0xb4'),_0x3475('0x20'));}if(_0x1add5e[_0x3475('0x41')])_0x42e5e6['limit'](_0x1add5e['limit']);if(_0x1add5e[_0x3475('0x13')])_0x42e5e6[_0x3475('0x13')](_0x1add5e['offset']);return db[_0x3475('0x90')][_0x3475('0x3a')](_0x42e5e6['toString'](),_0x1f4b58);})[_0x3475('0x28')](function(_0x528c3c){if(_0x528c3c['length']>0x0)_0x514cb1[_0x3475('0x44')](_0x3475('0xb5'),_[_0x3475('0x34')](_0x528c3c,'id'));return db[_0x3475('0x90')]['query'](_0x514cb1[_0x3475('0x91')](),_0x1f4b58)['then'](function(_0x10a313){var _0x1ca077=_[_0x3475('0xb6')](_0x10a313,'MailInteractionId');var _0x259f4d=[];return db[_0x3475('0xb7')][_0x3475('0x26')]({'attributes':[_0x3475('0xb8')],'raw':!![]})[_0x3475('0x28')](function(_0x274aa8){var _0x25e77d=_0x274aa8['enableEmailPreview'];_0x528c3c[_0x3475('0x22')](function(_0x2ca6c3){_0x259f4d[_0x3475('0x24')](updateMailInteraction(_0x2ca6c3,_0x6c593b,_0x1ca077,_0x25e77d));});return BPromise[_0x3475('0xb9')](_0x259f4d);});});});})[_0x3475('0x28')](function(_0x3cf4d4){_0x3c5495[_0x3475('0xba')]=_0x3cf4d4;return _0x3c5495;})[_0x3475('0x28')](respondWithFilteredResult(_0x3da549,_0x1add5e))[_0x3475('0x2c')](handleError(_0x3da549,null));};exports[_0x3475('0xbb')]=function(_0x1e6762,_0x76e9e1){var _0x4f9fba={'raw':![],'where':{'id':_0x1e6762[_0x3475('0xbc')]['id']}},_0x3761a6={};_0x3761a6[_0x3475('0x38')]=_['keys'](db[_0x3475('0xbd')][_0x3475('0x35')]);_0x3761a6[_0x3475('0x3a')]=_[_0x3475('0x39')](_0x1e6762[_0x3475('0x3a')]);_0x3761a6[_0x3475('0x3b')]=_[_0x3475('0x3d')](_0x3761a6[_0x3475('0x38')],_0x3761a6[_0x3475('0x3a')]);_0x4f9fba[_0x3475('0x3c')]=_['intersection'](_0x3761a6['model'],qs['fields'](_0x1e6762[_0x3475('0x3a')][_0x3475('0x3e')]));_0x4f9fba[_0x3475('0x3c')]=_0x4f9fba['attributes'][_0x3475('0x62')]?_0x4f9fba[_0x3475('0x3c')]:_0x3761a6[_0x3475('0x38')];if(_0x1e6762[_0x3475('0x3a')]['includeAll']){_0x4f9fba['include']=[{'all':!![]}];}_0x4f9fba=_[_0x3475('0x93')]({},_0x4f9fba,_0x1e6762[_0x3475('0xbe')]);return db[_0x3475('0xbd')]['find'](_0x4f9fba)[_0x3475('0x28')](handleEntityNotFound(_0x76e9e1,null))['then'](respondWithResult(_0x76e9e1,null))['catch'](handleError(_0x76e9e1,null));};exports[_0x3475('0xbf')]=function(_0x2fa427,_0x2529f2){return db[_0x3475('0xbd')]['create'](_0x2fa427[_0x3475('0xc0')],{})['then'](respondWithResult(_0x2529f2,0xc9))[_0x3475('0x2c')](handleError(_0x2529f2,null));};exports[_0x3475('0x18')]=function(_0x5d5273,_0x17825e){if(_0x5d5273[_0x3475('0xc0')]['id']){delete _0x5d5273[_0x3475('0xc0')]['id'];}return db[_0x3475('0xbd')]['find']({'where':{'id':_0x5d5273[_0x3475('0xbc')]['id']}})[_0x3475('0x28')](handleEntityNotFound(_0x17825e,null))[_0x3475('0x28')](saveUpdates(_0x5d5273[_0x3475('0xc0')],null))['then'](respondWithResult(_0x17825e,null))[_0x3475('0x2c')](handleError(_0x17825e,null));};exports[_0x3475('0x19')]=function(_0x420063,_0x5dbc49){return db[_0x3475('0xbd')]['find']({'where':{'id':_0x420063[_0x3475('0xbc')]['id']}})['then'](handleEntityNotFound(_0x5dbc49,null))['then'](removeEntity(_0x5dbc49,null))[_0x3475('0x2c')](handleError(_0x5dbc49,null));};exports['describe']=function(_0xd4dcf0,_0x2a50af){return db[_0x3475('0xbd')][_0x3475('0xc1')]()[_0x3475('0x28')](respondWithResult(_0x2a50af,null))[_0x3475('0x2c')](handleError(_0x2a50af,null));};exports[_0x3475('0xc2')]=function(_0x5d2582,_0xe2b020){return db[_0x3475('0x25')][_0x3475('0x5b')]({'where':{'id':_0x5d2582[_0x3475('0xbc')]['id']}})[_0x3475('0x28')](handleEntityNotFound(_0xe2b020,null))['then'](function(_0x559054){if(_0x559054){return _0x559054[_0x3475('0xc2')](_0x5d2582['body'][_0x3475('0xc3')],_[_0x3475('0xc4')](_0x5d2582['body'],['ids','id'])||{});}})['then'](respondWithResult(_0xe2b020,null))[_0x3475('0x2c')](handleError(_0xe2b020,null));};exports['getMessages']=function(_0x1b8a0b,_0x311802){var _0x21c864={'raw':![],'where':{}};var _0x484afe={};var _0x41dec8={'count':0x0,'rows':[]};return db[_0x3475('0xbd')][_0x3475('0x26')]({'where':{'id':_0x1b8a0b['params']['id']}})['then'](handleEntityNotFound(_0x311802,null))[_0x3475('0x28')](function(_0x32af1f){if(_0x32af1f){_0x484afe['model']=_['keys'](db['MailMessage'][_0x3475('0x35')]);_0x484afe[_0x3475('0x3a')]=_['keys'](_0x1b8a0b[_0x3475('0x3a')]);_0x484afe['filters']=_['intersection'](_0x484afe['model'],_0x484afe[_0x3475('0x3a')]);_0x21c864['attributes']=_[_0x3475('0x3d')](_0x484afe[_0x3475('0x38')],qs['fields'](_0x1b8a0b['query'][_0x3475('0x3e')]));_0x21c864['attributes']=_0x21c864[_0x3475('0x3c')][_0x3475('0x62')]?_0x21c864[_0x3475('0x3c')]:_0x484afe[_0x3475('0x38')];if(!_0x1b8a0b['query'][_0x3475('0x3f')](_0x3475('0x40'))){_0x21c864[_0x3475('0x41')]=qs[_0x3475('0x41')](_0x1b8a0b[_0x3475('0x3a')][_0x3475('0x41')]);_0x21c864[_0x3475('0x13')]=qs[_0x3475('0x13')](_0x1b8a0b[_0x3475('0x3a')][_0x3475('0x13')]);}_0x21c864[_0x3475('0x42')]=qs[_0x3475('0x43')](_0x1b8a0b[_0x3475('0x3a')][_0x3475('0x43')]);_0x21c864[_0x3475('0x44')]=qs[_0x3475('0x3b')](_[_0x3475('0x45')](_0x1b8a0b[_0x3475('0x3a')],_0x484afe[_0x3475('0x3b')]));_0x21c864[_0x3475('0x44')]['MailInteractionId']=_0x32af1f['id'];if(_0x1b8a0b['query'][_0x3475('0x7d')]){_0x21c864['where']=_[_0x3475('0x93')](_0x21c864[_0x3475('0x44')],{'$or':_[_0x3475('0x34')](_0x21c864[_0x3475('0x3c')],function(_0x1b2976){var _0x2015e7={};_0x2015e7[_0x1b2976]={'$like':'%'+_0x1b8a0b[_0x3475('0x3a')]['filter']+'%'};return _0x2015e7;})});}if(_0x1b8a0b['query']['$gte']){var _0xbc9932=_0x1b8a0b['query'][_0x3475('0x74')][_0x3475('0x21')](',');var _0x170ad3={};_0x170ad3[_0xbc9932[0x0]]={'$gte':moment(_0xbc9932[0x1])[_0x3475('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x21c864[_0x3475('0x44')]=_[_0x3475('0x93')](_0x21c864[_0x3475('0x44')],_0x170ad3);}_0x21c864=_[_0x3475('0x93')]({},_0x21c864,_0x1b8a0b[_0x3475('0xbe')]);return db[_0x3475('0x25')]['count']({'where':_0x21c864[_0x3475('0x44')]})[_0x3475('0x28')](function(_0x20b0ab){_0x41dec8[_0x3475('0x15')]=_0x20b0ab;if(_0x1b8a0b[_0x3475('0x3a')]['includeAll']){_0x21c864[_0x3475('0xc6')]=[{'all':!![]}];}return db[_0x3475('0x25')][_0x3475('0xc7')](_0x21c864);})[_0x3475('0x28')](function(_0x5eff44){if(_0x1b8a0b['query'][_0x3475('0xc8')]==='true'){for(var _0x2a3459=0x0;_0x2a3459<_0x5eff44['length'];_0x2a3459++){_0x5eff44[_0x2a3459][_0x3475('0xc0')]=juice(_0x5eff44[_0x2a3459][_0x3475('0xc0')]);}}_0x41dec8[_0x3475('0xba')]=_0x5eff44;return _0x41dec8;});}})[_0x3475('0x28')](respondWithFilteredResult(_0x311802,_0x21c864))[_0x3475('0x2c')](handleError(_0x311802,null));};exports['addTags']=function(_0x34049b,_0x59d7ed){return db['MailInteraction'][_0x3475('0x5b')]({'where':{'id':_0x34049b[_0x3475('0xbc')]['id']}})['then'](handleEntityNotFound(_0x59d7ed,null))[_0x3475('0x28')](function(_0x4eea8b){if(_0x4eea8b){return _0x4eea8b[_0x3475('0xc9')](_0x34049b[_0x3475('0xc0')][_0x3475('0xc3')],_[_0x3475('0xc4')](_0x34049b['body'],[_0x3475('0xc3'),'id'])||{})['spread'](function(){return db['Tag'][_0x3475('0xc7')]({'attributes':['id',_0x3475('0x1d'),_0x3475('0x48')],'where':{'id':_0x34049b[_0x3475('0xc0')]['ids']}});})['then'](function(_0x1b7f67){socket[_0x3475('0xca')](_0x3475('0xcb'),{'id':Number(_0x34049b[_0x3475('0xbc')]['id']),'tags':_0x1b7f67||[]});return{'id':Number(_0x34049b[_0x3475('0xbc')]['id']),'tags':_0x1b7f67||[]};});}})[_0x3475('0x28')](respondWithResult(_0x59d7ed,null))[_0x3475('0x2c')](handleError(_0x59d7ed,null));};exports[_0x3475('0xcc')]=function(_0x2a69e0,_0x267274){return db['MailInteraction'][_0x3475('0x5b')]({'where':{'id':_0x2a69e0[_0x3475('0xbc')]['id']}})[_0x3475('0x28')](handleEntityNotFound(_0x267274,null))[_0x3475('0x28')](function(_0x5cfd01){if(_0x5cfd01){return _0x5cfd01[_0x3475('0xcc')](_0x2a69e0['query']['ids']);}})[_0x3475('0x28')](respondWithStatusCode(_0x267274,null))[_0x3475('0x2c')](handleError(_0x267274,null));};exports[_0x3475('0xcd')]=function(_0x20733d,_0x355fa3){var _0x408fdb=moment()[_0x3475('0xce')]()[_0x3475('0x91')]();var _0x2596de=path[_0x3475('0xcf')](config[_0x3475('0xd0')],'server',_0x3475('0xd1'),_0x3475('0xd2'));var _0x2bd7b0=path[_0x3475('0xcf')](config['root'],'server',_0x3475('0xd1'),_0x3475('0xd3'));var _0x43b235=path['join'](_0x2596de,_0x408fdb);var _0x4d337b=util['format'](_0x3475('0xd4'),_0x20733d[_0x3475('0xbc')]['id'],_0x408fdb);var _0x4fc142=path[_0x3475('0xcf')](_0x2596de,_0x4d337b);var _0x13c729=[];if(_0x20733d['query'][_0x3475('0xd3')]){_0x13c729[_0x3475('0x24')]({'model':db[_0x3475('0xd5')],'as':_0x3475('0xd6'),'raw':!![]});}var _0x12b3f5=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x3475('0xc0'),'from','to','cc',_0x3475('0xd7'),_0x3475('0xd8'),_0x3475('0xd9')],'where':{'secret':![]},'order':qs[_0x3475('0x43')]('id'),'include':_0x13c729}];return db[_0x3475('0xbd')][_0x3475('0x5b')]({'where':{'id':_0x20733d[_0x3475('0xbc')]['id']},'include':_0x12b3f5})['then'](handleEntityNotFound(_0x355fa3,null))[_0x3475('0x28')](function(_0x1da635){if(_0x1da635&&_0x1da635[_0x3475('0xda')]){var _0x21208c=_0x1da635[_0x3475('0xdb')]({'plain':!![]});fs[_0x3475('0xdc')](_0x43b235);return BPromise[_0x3475('0xdd')](_0x21208c[_0x3475('0xda')],function(_0x1ab6ee,_0x475b3d){var _0xa15377={'from':_0x1ab6ee[_0x3475('0xde')],'to':_0x1ab6ee['to'],'subject':_0x1ab6ee[_0x3475('0xd8')],'html':htmlEntities[_0x3475('0xdf')](_0x1ab6ee[_0x3475('0xc0')]),'headers':{'Date':moment(_0x1ab6ee[_0x3475('0xd9')])[_0x3475('0xc5')](_0x3475('0xe0'))},'attachments':[]};if(_0x1ab6ee['cc']){_0xa15377[_0x3475('0xe1')]['Cc']=_0x1ab6ee['cc'];}if(_0x1ab6ee[_0x3475('0xd7')]){_0xa15377['headers']['Bcc']=_0x1ab6ee['bcc'];}return new BPromise(function(_0x38cd0e,_0x4a7c1b){if(_0x1ab6ee[_0x3475('0xd6')]){for(var _0x5d17f7=0x0;_0x5d17f7<_0x1ab6ee['Attachments']['length'];_0x5d17f7++){var _0x374bf6=_0x1ab6ee[_0x3475('0xd6')][_0x5d17f7];var _0x3650c6=path[_0x3475('0xcf')](_0x2bd7b0,_0x374bf6[_0x3475('0xe2')]);if(fs[_0x3475('0xe3')](_0x3650c6)){_0xa15377['attachments'][_0x3475('0x24')]({'name':_0x374bf6[_0x3475('0x1d')],'contentType':_0x374bf6['type'],'data':fs[_0x3475('0xe4')](_0x3650c6)});}}}emlformat['build'](_0xa15377,function(_0x2fdf31,_0x9d08f2){if(_0x2fdf31)return _0x4a7c1b(_0x2fdf31);fs['writeFileSync'](path[_0x3475('0xcf')](_0x43b235,util['format']('message%d.eml',_0x475b3d)),_0x9d08f2);return _0x38cd0e(_0x9d08f2);});});})[_0x3475('0x28')](function(){return new BPromise(function(_0x55795a,_0x5b97c1){zipdir(_0x43b235,{'saveTo':_0x4fc142},function(_0x343287,_0x5b79b7){if(_0x343287)return _0x5b97c1(_0x343287);return _0x55795a(_0x5b79b7);});})[_0x3475('0x28')](function(){return new BPromise(function(_0x3af6a5,_0x23315e){rimraf(_0x43b235,function(_0x1dbbe9){if(_0x1dbbe9)_0x23315e(_0x1dbbe9);return _0x3af6a5();});});})['then'](function(){return _0x355fa3['download'](_0x4fc142,_0x4d337b,function(_0x46f586){if(!_0x46f586)fs['unlinkSync'](_0x4fc142);});});});}else{return _0x355fa3[_0x3475('0x1a')](0xc8);}})[_0x3475('0x2c')](handleError(_0x355fa3,null));}; \ No newline at end of file +var _0xf417=['mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','sqlOperator','conditions','find','unreadMessages','having','Contact','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','start','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','SELECT','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','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','i.createdAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.MailAccountId','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','create','body','describe','addMessage','ids','getMessages','pick','format','options','findAll','inlineCss','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','join','root','tmp','files','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','headers','Bcc','existsSync','attachments','readFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','util','squel','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','set','Content-Range','update','destroy','then','stack','name','send','fullname','TagIds','Tags','push','MailMessage','findOne','plainBody','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total','closed','UserId','talking','index','map','MailInteraction','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users'];(function(_0x1aff57,_0x4aa7b6){var _0x4c35a5=function(_0x48f24b){while(--_0x48f24b){_0x1aff57['push'](_0x1aff57['shift']());}};_0x4c35a5(++_0x4aa7b6);}(_0xf417,0x8f));var _0x7f41=function(_0x109f48,_0x40847c){_0x109f48=_0x109f48-0x0;var _0x197fff=_0xf417[_0x109f48];return _0x197fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f41('0x0'));var zipdir=require(_0x7f41('0x1'));var moment=require(_0x7f41('0x2'));var BPromise=require('bluebird');var util=require(_0x7f41('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x7f41('0x4'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x7f41('0x5'))('api');var config=require(_0x7f41('0x6'));var db=require(_0x7f41('0x7'))['db'];var htmlEntities=require('html-entities');config[_0x7f41('0x8')]=_['defaults'](config[_0x7f41('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f41('0x9'))(new Redis(config[_0x7f41('0x8')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x48b265,_0x55810a){_0x55810a=_0x55810a||0xcc;return function(_0x4bc8ff){if(_0x4bc8ff){return _0x48b265[_0x7f41('0xa')](_0x55810a);}return _0x48b265[_0x7f41('0xb')](_0x55810a)[_0x7f41('0xc')]();};}function respondWithResult(_0x3407b2,_0x637b2d){_0x637b2d=_0x637b2d||0xc8;return function(_0x46dcfe){if(_0x46dcfe){return _0x3407b2[_0x7f41('0xb')](_0x637b2d)['json'](_0x46dcfe);}};}function respondWithFilteredResult(_0x513d36,_0x380ee0){return function(_0x4f5b74){if(_0x4f5b74){var _0x568eea=typeof _0x380ee0[_0x7f41('0xd')]===_0x7f41('0xe')&&typeof _0x380ee0[_0x7f41('0xf')]==='undefined';var _0x212b28=_0x4f5b74['count'];var _0x27c0f6=_0x568eea?0x0:_0x380ee0[_0x7f41('0xd')];var _0xe76241=_0x568eea?_0x4f5b74['count']:_0x380ee0[_0x7f41('0xd')]+_0x380ee0[_0x7f41('0xf')];var _0xdd9671;if(_0xe76241>=_0x212b28){_0xe76241=_0x212b28;_0xdd9671=0xc8;}else{_0xdd9671=0xce;}_0x513d36['status'](_0xdd9671);return _0x513d36[_0x7f41('0x10')](_0x7f41('0x11'),_0x27c0f6+'-'+_0xe76241+'/'+_0x212b28)['json'](_0x4f5b74);}return null;};}function saveUpdates(_0x98210f){return function(_0x473f41){if(_0x473f41){return _0x473f41[_0x7f41('0x12')](_0x98210f)['then'](function(_0x3f6b61){return _0x3f6b61;});}return null;};}function removeEntity(_0x58c86e){return function(_0x503239){if(_0x503239){return _0x503239[_0x7f41('0x13')]()[_0x7f41('0x14')](function(){_0x58c86e[_0x7f41('0xb')](0xcc)[_0x7f41('0xc')]();});}};}function handleEntityNotFound(_0x451efa){return function(_0x3af3f7){if(!_0x3af3f7){_0x451efa['sendStatus'](0x194);}return _0x3af3f7;};}function handleError(_0x5e568d,_0x3e8000){_0x3e8000=_0x3e8000||0x1f4;return function(_0x4c4d12){logger['error'](_0x4c4d12[_0x7f41('0x15')]);if(_0x4c4d12[_0x7f41('0x16')]){delete _0x4c4d12[_0x7f41('0x16')];}_0x5e568d[_0x7f41('0xb')](_0x3e8000)[_0x7f41('0x17')](_0x4c4d12);};}function getInteractionUsers(_0x43b936,_0x39d287){return new BPromise(function(_0x25c42d,_0x4cbee7){try{if(_0x39d287[_0x43b936['id']]){_0x43b936['Users']=_['map'](_0x39d287[_0x43b936['id']],function(_0x51e0f3){return{'id':_0x51e0f3['id'],'fullname':_0x51e0f3[_0x7f41('0x18')]};});}}catch(_0x183ac7){_0x4cbee7(_0x183ac7);}_0x25c42d(_0x43b936);});}function getInteractionTags(_0x55a32a,_0xd0b56c){return new BPromise(function(_0x3d52f7,_0x5b5610){try{if(_0x55a32a['TagIds']){_0x55a32a['Tags']=[];_0x55a32a[_0x7f41('0x19')]['split'](',')['forEach'](function(_0x501076){_0x55a32a[_0x7f41('0x1a')][_0x7f41('0x1b')](_0xd0b56c[_0x501076]);});}delete _0x55a32a['TagIds'];}catch(_0x2b93e4){_0x5b5610(_0x2b93e4);}_0x3d52f7(_0x55a32a);});}function getLastMessageText(_0x2f288e){return new BPromise(function(_0x48a1a5,_0x3be289){return db[_0x7f41('0x1c')][_0x7f41('0x1d')]({'where':{'$and':[{'MailInteractionId':_0x2f288e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x7f41('0x14')](function(_0x35c91b){if(_0x35c91b&&_0x35c91b[_0x7f41('0x1e')]){_0x2f288e[_0x7f41('0x1f')]=_[_0x7f41('0x20')](_0x35c91b[_0x7f41('0x1e')]);}_0x48a1a5(_0x2f288e);})['catch'](function(_0x1d61a4){_0x3be289(_0x1d61a4);});});}function updateMailInteraction(_0x156853,_0x212170,_0x483f69,_0x4b2332){return new BPromise(function(_0x58394d,_0xf1f9af){return getInteractionUsers(_0x156853,_0x483f69)[_0x7f41('0x14')](function(_0x42fc04){return getInteractionTags(_0x42fc04,_0x212170);})['then'](function(_0x1cb8f1){return getStateInteraction(_0x1cb8f1);})[_0x7f41('0x14')](function(_0x390358){if(_0x4b2332){_0x58394d(getLastMessageText(_0x390358));}else{_0x58394d(_0x390358);}})[_0x7f41('0x21')](function(_0x1a1445){_0xf1f9af(_0x1a1445);});});}function getStateInteraction(_0x354be6){return new BPromise(function(_0x303f1a){_0x354be6[_0x7f41('0x22')]=0x0;_0x354be6['talking']=0x0;_0x354be6[_0x7f41('0x23')]=0x0;_0x354be6[_0x7f41('0x24')]=0x0;_0x354be6[_0x7f41('0x25')]=0x0;if(!_0x354be6[_0x7f41('0x26')]&&!_0x354be6[_0x7f41('0x27')]){_0x354be6[_0x7f41('0x22')]+=0x1;}if(!_0x354be6[_0x7f41('0x26')]&&_0x354be6[_0x7f41('0x27')]){_0x354be6[_0x7f41('0x28')]+=0x1;if(_0x354be6[_0x7f41('0x22')]){_0x354be6[_0x7f41('0x22')]-=0x1;}}if(_0x354be6[_0x7f41('0x26')]&&_0x354be6['UserId']){_0x354be6[_0x7f41('0x23')]+=0x1;if(_0x354be6[_0x7f41('0x28')]){_0x354be6['talking']-=0x1;}}if(_0x354be6[_0x7f41('0x26')]&&!_0x354be6['UserId']){_0x354be6[_0x7f41('0x24')]+=0x1;if(_0x354be6[_0x7f41('0x22')]){_0x354be6[_0x7f41('0x22')]-=0x1;}}_0x354be6['total']+=0x1;_0x303f1a(_0x354be6);});}exports[_0x7f41('0x29')]=function(_0x18ed9a,_0x4a669f){var _0x5896d5={},_0x10da15={},_0x548023={'count':0x0,'rows':[]};var _0x3af652=_[_0x7f41('0x2a')](db[_0x7f41('0x2b')][_0x7f41('0x2c')],function(_0xbd86fd){return{'name':_0xbd86fd[_0x7f41('0x2d')],'type':_0xbd86fd[_0x7f41('0x2e')]['key']};});_0x10da15[_0x7f41('0x2f')]=_[_0x7f41('0x2a')](_0x3af652,_0x7f41('0x16'));_0x10da15[_0x7f41('0x30')]=_[_0x7f41('0x31')](_0x18ed9a[_0x7f41('0x30')]);_0x10da15['filters']=_[_0x7f41('0x32')](_0x10da15[_0x7f41('0x2f')],_0x10da15[_0x7f41('0x30')]);_0x5896d5[_0x7f41('0x33')]=_['intersection'](_0x10da15['model'],qs[_0x7f41('0x34')](_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x34')]));_0x5896d5['attributes']=_0x5896d5[_0x7f41('0x33')][_0x7f41('0x35')]?_0x5896d5['attributes']:_0x10da15[_0x7f41('0x2f')];if(!_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x36')](_0x7f41('0x37'))){_0x5896d5['limit']=qs[_0x7f41('0xf')](_0x18ed9a['query'][_0x7f41('0xf')]);_0x5896d5[_0x7f41('0xd')]=qs[_0x7f41('0xd')](_0x18ed9a[_0x7f41('0x30')]['offset']);}_0x5896d5[_0x7f41('0x38')]=qs[_0x7f41('0x39')](_0x18ed9a[_0x7f41('0x30')]['sort']);_0x5896d5[_0x7f41('0x3a')]=qs['filters'](_['pick'](_0x18ed9a[_0x7f41('0x30')],_0x10da15[_0x7f41('0x3b')]),_0x3af652);var _0x3197e8=[];var _0xdb06d=squel[_0x7f41('0x3c')]()[_0x7f41('0x3d')]('id')[_0x7f41('0x3d')](_0x7f41('0x16'))[_0x7f41('0x3d')](_0x7f41('0x3e'))[_0x7f41('0x3f')](_0x7f41('0x40'));var _0x4ab2ee=squel[_0x7f41('0x3c')]()[_0x7f41('0x3d')](_0x7f41('0x41'))[_0x7f41('0x3d')](_0x7f41('0x42'))[_0x7f41('0x3d')](_0x7f41('0x43'))[_0x7f41('0x3f')](_0x7f41('0x44'),'ui')['left_join'](_0x7f41('0x45'),'u','u.id\x20=\x20ui.UserId');var _0x49ae70=squel[_0x7f41('0x3c')]()[_0x7f41('0x3f')](_0x7f41('0x46'),'i')['left_join'](_0x7f41('0x47'),'c',_0x7f41('0x48'))[_0x7f41('0x49')](_0x7f41('0x45'),'o','o.id\x20=\x20i.UserId')[_0x7f41('0x49')]('mail_accounts','a',_0x7f41('0x4a'))[_0x7f41('0x49')]('mail_messages','me',_0x7f41('0x4b'))[_0x7f41('0x49')](_0x7f41('0x4c'),'it',_0x7f41('0x4d'))['left_join']('tools_tags','t',_0x7f41('0x4e'));var _0x45426d=squel['expr']();var _0x7bbdbe=[];var _0x2a1aa7=squel['expr']();var _0x746573;if(_0x18ed9a[_0x7f41('0x30')]['search']){_0x746573=as['parseSearch'](_0x18ed9a['query']['search']);var _0x91e6a4=_0x746573[_0x7f41('0x4f')];for(var _0x491534=0x0;_0x491534<_0x746573[_0x7f41('0x50')][_0x7f41('0x35')];_0x491534++){var _0xd102d9=_0x746573[_0x7f41('0x50')][_0x491534];var _0x65bfa4='i';var _0x4d62e7=_[_0x7f41('0x51')](_0x3af652,[_0x7f41('0x16'),_0xd102d9[_0x7f41('0x3d')]]);if(!_0x4d62e7){switch(_0xd102d9[_0x7f41('0x3d')]){case _0x7f41('0x52'):if(_0xd102d9['value']==0x1){_0x49ae70[_0x7f41('0x53')]('`'+_0xd102d9[_0x7f41('0x3d')]+'`\x20=\x200');}else{_0x49ae70['having']('`'+_0xd102d9[_0x7f41('0x3d')]+'`\x20>\x200');}break;case _0x7f41('0x54'):if(_0xd102d9[_0x7f41('0x55')]===_0x7f41('0x56')){if(_0xd102d9[_0x7f41('0x57')][_0x7f41('0x58')]('\x20')['length']>0x1){_0x45426d[_0x91e6a4]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7f41('0x59')](_0xd102d9[_0x7f41('0x57')]),null);}else{var _0x36915c='%'+_0xd102d9[_0x7f41('0x57')]+'%';_0x45426d[_0x91e6a4](_0x7f41('0x5a'),_0x36915c,_0x36915c,_0x36915c);}}else{_0x4d62e7=_[_0x7f41('0x51')](_0x3af652,['name',_0x7f41('0x5b')]);_0xd102d9[_0x7f41('0x3d')]='ContactId';_0x1e4c06=as[_0x7f41('0x5c')](_0x65bfa4,_0x4d62e7[_0x7f41('0x2e')],_0xd102d9);_0x45426d[_0x91e6a4](_0x1e4c06[_0x7f41('0x5d')],_0x1e4c06[_0x7f41('0x57')]['start'],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0xc')]);}break;case'Tag':var _0x4cdf43=_0xd102d9['value'][_0x7f41('0x58')](',')['map'](function(_0x2934f0){return Number(_0x2934f0);});_0x4cdf43[_0x7f41('0x5e')](function(_0x550d37){_0x2a1aa7['or'](_0x7f41('0x5f'),'%,'+_0x550d37+',%');});_0x7bbdbe=_['union'](_0x7bbdbe,_0x4cdf43);break;case'User':if(_0xd102d9[_0x7f41('0x55')]===_0x7f41('0x56')){_0x45426d[_0x91e6a4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xd102d9[_0x7f41('0x57')]+'%',null);}else{_0x4d62e7=_[_0x7f41('0x51')](_0x3af652,[_0x7f41('0x16'),'UserId']);_0xd102d9[_0x7f41('0x3d')]=_0x7f41('0x27');_0x1e4c06=as[_0x7f41('0x5c')](_0x65bfa4,_0x4d62e7[_0x7f41('0x2e')],_0xd102d9);_0x45426d[_0x91e6a4](_0x1e4c06[_0x7f41('0x5d')],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0x60')],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0xc')]);}break;case _0x7f41('0x1e'):_0x1e4c06=as[_0x7f41('0x5c')]('me',null,_0xd102d9);_0x45426d[_0x91e6a4](_0x1e4c06[_0x7f41('0x5d')],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0x60')],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0xc')]);break;}}else{var _0x1e4c06=as[_0x7f41('0x5c')](_0x65bfa4,_0x4d62e7['type'],_0xd102d9);_0x45426d[_0x91e6a4](_0x1e4c06[_0x7f41('0x5d')],_0x1e4c06['value']['start'],_0x1e4c06[_0x7f41('0x57')][_0x7f41('0xc')]);}}}else{var _0x4c4059=_(_0x18ed9a[_0x7f41('0x30')])[_0x7f41('0x31')]()[_0x7f41('0x2a')](function(_0x46c0b8){return _['some'](_0x3af652,[_0x7f41('0x16'),_0x46c0b8])?_0x46c0b8:undefined;})['compact']()['value']();if(!_[_0x7f41('0x61')](_0x4c4059)){_0x4c4059[_0x7f41('0x5e')](function(_0x3279d9){if(_0x3279d9===_0x7f41('0x62')){_0x49ae70[_0x7f41('0x3a')](_0x7f41('0x63'),[][_0x7f41('0x64')](_0x18ed9a['query'][_0x3279d9]));}else if(_0x3279d9==='createdAt'){var _0x2ecbeb=JSON[_0x7f41('0x65')](_0x18ed9a[_0x7f41('0x30')][_0x3279d9])[_0x7f41('0x66')];var _0x431fe6=JSON[_0x7f41('0x65')](_0x18ed9a[_0x7f41('0x30')][_0x3279d9])[_0x7f41('0x67')];_0x49ae70[_0x7f41('0x3a')](_0x7f41('0x68'),_0x2ecbeb,_0x431fe6);}else{if(_0x18ed9a['query'][_0x3279d9]==='null'){_0x49ae70[_0x7f41('0x3a')]('i.'+_0x3279d9+'\x20IS\x20NULL');}else{_0x49ae70[_0x7f41('0x3a')]('i.'+_0x3279d9+_0x7f41('0x69'),_0x18ed9a[_0x7f41('0x30')][_0x3279d9]);}}});}if(_0x18ed9a['query'][_0x7f41('0x6a')]){if(_0x18ed9a['query'][_0x7f41('0x6a')]==0x1){_0x49ae70['having'](_0x7f41('0x6b'));}else{_0x49ae70[_0x7f41('0x53')](_0x7f41('0x6c'));}}if(_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x6d')]){_0x7bbdbe=_['isArray'](_0x18ed9a[_0x7f41('0x30')]['tag'])?_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x6d')]:new Array(_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x6d')]);_0x7bbdbe[_0x7f41('0x5e')](function(_0x2d347d){_0x2a1aa7['or'](_0x7f41('0x5f'),'%,'+_0x2d347d+',%');});}if(_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x6e')]){var _0x3c1c85=_0x18ed9a[_0x7f41('0x30')]['filter'][_0x7f41('0x6f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7f41('0x70')](_0x3c1c85)){_0x45426d['or'](_0x7f41('0x71'),_0x3c1c85+'%');}else if(qs['isEmail'](_0x3c1c85)){_0x45426d['or'](_0x7f41('0x72'),_0x3c1c85+'%');}else{_0x45426d['or'](_0x7f41('0x73'),qs['getFullTextValue'](_0x3c1c85))['or'](_0x7f41('0x74'),qs[_0x7f41('0x59')](_0x3c1c85));}}}_0x49ae70[_0x7f41('0x3a')](_0x45426d);_0x49ae70['group'](_0x7f41('0x75'));var _0x269f2c={'type':db['Sequelize']['QueryTypes'][_0x7f41('0x76')],'raw':!![]};var _0x40fcf2=_0x49ae70['clone']();_0x40fcf2[_0x7f41('0x3d')](_0x7f41('0x75'));_0x40fcf2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7f41('0x52'));if(_0x5896d5[_0x7f41('0x38')]){_0x5896d5['order'][_0x7f41('0x5e')](function(_0x4e0060){var _0x2748d1=_0x4e0060[0x0]===_0x7f41('0x77')?_0x4e0060[0x0]:'i.'+_0x4e0060[0x0];_0x49ae70[_0x7f41('0x38')](_0x2748d1,_0x4e0060[0x1]===_0x7f41('0x78')?![]:!![]);});}if(!_[_0x7f41('0x61')](_0x7bbdbe)){_0x49ae70['having'](_0x2a1aa7);_0x40fcf2[_0x7f41('0x3a')](_0x7f41('0x79'),_0x7bbdbe);}BPromise[_0x7f41('0x7a')]()[_0x7f41('0x14')](function(){if(!_0x746573){if(_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x62')])return;_0x40fcf2[_0x7f41('0x3a')](_0x7f41('0x7b'));_0x49ae70['where'](_0x7f41('0x7b'));return;}if(_0x18ed9a[_0x7f41('0x7c')][_0x7f41('0x7d')]!==_0x7f41('0x7e'))return;return _0x18ed9a['user'][_0x7f41('0x7f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x267100){if(_[_0x7f41('0x61')](_0x267100)){_0x40fcf2[_0x7f41('0x3a')](_0x7f41('0x80'));_0x49ae70['where'](_0x7f41('0x80'));}else{_0x40fcf2['where'](_0x7f41('0x63'),_[_0x7f41('0x2a')](_0x267100,'id'));_0x49ae70[_0x7f41('0x3a')](_0x7f41('0x63'),_[_0x7f41('0x2a')](_0x267100,'id'));}});})[_0x7f41('0x14')](function(){if(_0x18ed9a['user'][_0x7f41('0x7d')]===_0x7f41('0x7e')&&!_0x746573&&!_0x18ed9a[_0x7f41('0x30')]['MailAccountId'])return[];return db[_0x7f41('0x81')]['query'](_0x40fcf2['toString'](),_0x269f2c);})[_0x7f41('0x14')](function(_0x2e5a88){_0x548023[_0x7f41('0x82')]=_0x2e5a88[_0x7f41('0x35')];if(_0x548023[_0x7f41('0x82')]===0x0)return[];return db['sequelize'][_0x7f41('0x30')](_0xdb06d[_0x7f41('0x83')](),_0x269f2c)[_0x7f41('0x14')](function(_0x533045){_0x3197e8=_[_0x7f41('0x84')](_0x533045,'id');_0x269f2c=_[_0x7f41('0x85')](_0x269f2c,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18ed9a[_0x7f41('0x30')][_0x7f41('0x34')]){_0x5896d5[_0x7f41('0x33')][_0x7f41('0x5e')](function(_0x41f3d8){_0x49ae70['field']('i.'+_0x41f3d8);});}else{_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x86'),'unreadMessages');_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x87'),_0x7f41('0x88'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x89'),_0x7f41('0x8a'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x8b'),'contactName');_0x49ae70['field'](_0x7f41('0x75'));_0x49ae70['field'](_0x7f41('0x8c'));_0x49ae70['field']('i.updatedAt');_0x49ae70['field']('i.closed');_0x49ae70[_0x7f41('0x3d')]('i.closedAt');_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x8d'));_0x49ae70['field'](_0x7f41('0x8e'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x8f'));_0x49ae70['field'](_0x7f41('0x90'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x91'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x92'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x93'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x94'));_0x49ae70[_0x7f41('0x3d')]('i.to');_0x49ae70['field']('i.ContactId');_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x95'));_0x49ae70[_0x7f41('0x3d')]('i.UserId');_0x49ae70[_0x7f41('0x3d')]('c.firstName','Contact.firstName');_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x96'),_0x7f41('0x97'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x98'),'Contact.email');_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x99'),_0x7f41('0x9a'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x9b'),_0x7f41('0x9c'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0x9d'),'Contact.fax');_0x49ae70['field'](_0x7f41('0x9e'),_0x7f41('0x9f'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0xa0'),_0x7f41('0xa1'));_0x49ae70[_0x7f41('0x3d')](_0x7f41('0xa2'),_0x7f41('0x19'));}if(_0x5896d5[_0x7f41('0xf')])_0x49ae70['limit'](_0x5896d5[_0x7f41('0xf')]);if(_0x5896d5[_0x7f41('0xd')])_0x49ae70[_0x7f41('0xd')](_0x5896d5[_0x7f41('0xd')]);return db[_0x7f41('0x81')][_0x7f41('0x30')](_0x49ae70[_0x7f41('0x83')](),_0x269f2c);})[_0x7f41('0x14')](function(_0x4b270d){if(_0x4b270d[_0x7f41('0x35')]>0x0)_0x4ab2ee['where']('ui.MailInteractionId\x20IN\x20?',_[_0x7f41('0x2a')](_0x4b270d,'id'));return db[_0x7f41('0x81')][_0x7f41('0x30')](_0x4ab2ee['toString'](),_0x269f2c)[_0x7f41('0x14')](function(_0x2d0e77){var _0x25be17=_[_0x7f41('0xa3')](_0x2d0e77,_0x7f41('0xa4'));var _0x34ec52=[];return db[_0x7f41('0xa5')]['findOne']({'attributes':[_0x7f41('0xa6')],'raw':!![]})['then'](function(_0x5e2d1a){var _0x127ef9=_0x5e2d1a[_0x7f41('0xa6')];_0x4b270d['forEach'](function(_0x260d9f){_0x34ec52[_0x7f41('0x1b')](updateMailInteraction(_0x260d9f,_0x3197e8,_0x25be17,_0x127ef9));});return BPromise[_0x7f41('0xa7')](_0x34ec52);});});});})[_0x7f41('0x14')](function(_0x2719cd){_0x548023[_0x7f41('0xa8')]=_0x2719cd;return _0x548023;})['then'](respondWithFilteredResult(_0x4a669f,_0x5896d5))[_0x7f41('0x21')](handleError(_0x4a669f,null));};exports[_0x7f41('0xa9')]=function(_0x25d472,_0x14784f){var _0x4046cd={'raw':![],'where':{'id':_0x25d472[_0x7f41('0xaa')]['id']}},_0x288657={};_0x288657[_0x7f41('0x2f')]=_[_0x7f41('0x31')](db[_0x7f41('0x2b')][_0x7f41('0x2c')]);_0x288657['query']=_[_0x7f41('0x31')](_0x25d472[_0x7f41('0x30')]);_0x288657['filters']=_['intersection'](_0x288657[_0x7f41('0x2f')],_0x288657[_0x7f41('0x30')]);_0x4046cd['attributes']=_['intersection'](_0x288657[_0x7f41('0x2f')],qs[_0x7f41('0x34')](_0x25d472[_0x7f41('0x30')][_0x7f41('0x34')]));_0x4046cd['attributes']=_0x4046cd[_0x7f41('0x33')][_0x7f41('0x35')]?_0x4046cd[_0x7f41('0x33')]:_0x288657[_0x7f41('0x2f')];if(_0x25d472['query'][_0x7f41('0xab')]){_0x4046cd['include']=[{'all':!![]}];}_0x4046cd=_[_0x7f41('0x85')]({},_0x4046cd,_0x25d472['options']);return db[_0x7f41('0x2b')]['find'](_0x4046cd)[_0x7f41('0x14')](handleEntityNotFound(_0x14784f,null))[_0x7f41('0x14')](respondWithResult(_0x14784f,null))[_0x7f41('0x21')](handleError(_0x14784f,null));};exports['create']=function(_0x58a431,_0x2c0467){return db[_0x7f41('0x2b')][_0x7f41('0xac')](_0x58a431[_0x7f41('0xad')],{})['then'](respondWithResult(_0x2c0467,0xc9))[_0x7f41('0x21')](handleError(_0x2c0467,null));};exports['update']=function(_0x4bec4b,_0x361a04){if(_0x4bec4b[_0x7f41('0xad')]['id']){delete _0x4bec4b[_0x7f41('0xad')]['id'];}return db[_0x7f41('0x2b')][_0x7f41('0x51')]({'where':{'id':_0x4bec4b[_0x7f41('0xaa')]['id']}})[_0x7f41('0x14')](handleEntityNotFound(_0x361a04,null))[_0x7f41('0x14')](saveUpdates(_0x4bec4b[_0x7f41('0xad')],null))[_0x7f41('0x14')](respondWithResult(_0x361a04,null))[_0x7f41('0x21')](handleError(_0x361a04,null));};exports[_0x7f41('0x13')]=function(_0x240cdb,_0x568801){return db[_0x7f41('0x2b')][_0x7f41('0x51')]({'where':{'id':_0x240cdb['params']['id']}})['then'](handleEntityNotFound(_0x568801,null))[_0x7f41('0x14')](removeEntity(_0x568801,null))[_0x7f41('0x21')](handleError(_0x568801,null));};exports[_0x7f41('0xae')]=function(_0x21b76a,_0x5be25e){return db['MailInteraction'][_0x7f41('0xae')]()[_0x7f41('0x14')](respondWithResult(_0x5be25e,null))[_0x7f41('0x21')](handleError(_0x5be25e,null));};exports[_0x7f41('0xaf')]=function(_0x18df0c,_0x3c50ad){return db[_0x7f41('0x1c')][_0x7f41('0x51')]({'where':{'id':_0x18df0c[_0x7f41('0xaa')]['id']}})['then'](handleEntityNotFound(_0x3c50ad,null))['then'](function(_0x3aff11){if(_0x3aff11){return _0x3aff11[_0x7f41('0xaf')](_0x18df0c[_0x7f41('0xad')][_0x7f41('0xb0')],_['omit'](_0x18df0c[_0x7f41('0xad')],['ids','id'])||{});}})[_0x7f41('0x14')](respondWithResult(_0x3c50ad,null))[_0x7f41('0x21')](handleError(_0x3c50ad,null));};exports[_0x7f41('0xb1')]=function(_0x43d20d,_0x10d55d){var _0x7ee0c2={'raw':![],'where':{}};var _0x42790d={};var _0x3e176b={'count':0x0,'rows':[]};return db[_0x7f41('0x2b')][_0x7f41('0x1d')]({'where':{'id':_0x43d20d[_0x7f41('0xaa')]['id']}})[_0x7f41('0x14')](handleEntityNotFound(_0x10d55d,null))['then'](function(_0x53345e){if(_0x53345e){_0x42790d[_0x7f41('0x2f')]=_[_0x7f41('0x31')](db[_0x7f41('0x1c')][_0x7f41('0x2c')]);_0x42790d[_0x7f41('0x30')]=_[_0x7f41('0x31')](_0x43d20d[_0x7f41('0x30')]);_0x42790d[_0x7f41('0x3b')]=_[_0x7f41('0x32')](_0x42790d[_0x7f41('0x2f')],_0x42790d[_0x7f41('0x30')]);_0x7ee0c2[_0x7f41('0x33')]=_[_0x7f41('0x32')](_0x42790d[_0x7f41('0x2f')],qs[_0x7f41('0x34')](_0x43d20d[_0x7f41('0x30')][_0x7f41('0x34')]));_0x7ee0c2[_0x7f41('0x33')]=_0x7ee0c2[_0x7f41('0x33')][_0x7f41('0x35')]?_0x7ee0c2[_0x7f41('0x33')]:_0x42790d[_0x7f41('0x2f')];if(!_0x43d20d[_0x7f41('0x30')]['hasOwnProperty'](_0x7f41('0x37'))){_0x7ee0c2[_0x7f41('0xf')]=qs[_0x7f41('0xf')](_0x43d20d[_0x7f41('0x30')][_0x7f41('0xf')]);_0x7ee0c2[_0x7f41('0xd')]=qs[_0x7f41('0xd')](_0x43d20d[_0x7f41('0x30')][_0x7f41('0xd')]);}_0x7ee0c2[_0x7f41('0x38')]=qs[_0x7f41('0x39')](_0x43d20d[_0x7f41('0x30')][_0x7f41('0x39')]);_0x7ee0c2[_0x7f41('0x3a')]=qs['filters'](_[_0x7f41('0xb2')](_0x43d20d[_0x7f41('0x30')],_0x42790d[_0x7f41('0x3b')]));_0x7ee0c2[_0x7f41('0x3a')][_0x7f41('0xa4')]=_0x53345e['id'];if(_0x43d20d[_0x7f41('0x30')]['filter']){_0x7ee0c2[_0x7f41('0x3a')]=_['merge'](_0x7ee0c2[_0x7f41('0x3a')],{'$or':_['map'](_0x7ee0c2[_0x7f41('0x33')],function(_0x4007fb){var _0x58c415={};_0x58c415[_0x4007fb]={'$like':'%'+_0x43d20d[_0x7f41('0x30')][_0x7f41('0x6e')]+'%'};return _0x58c415;})});}if(_0x43d20d['query'][_0x7f41('0x66')]){var _0x4a3792=_0x43d20d[_0x7f41('0x30')]['$gte']['split'](',');var _0x3619a2={};_0x3619a2[_0x4a3792[0x0]]={'$gte':moment(_0x4a3792[0x1])[_0x7f41('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7ee0c2['where']=_[_0x7f41('0x85')](_0x7ee0c2['where'],_0x3619a2);}_0x7ee0c2=_[_0x7f41('0x85')]({},_0x7ee0c2,_0x43d20d[_0x7f41('0xb4')]);return db[_0x7f41('0x1c')][_0x7f41('0x82')]({'where':_0x7ee0c2['where']})[_0x7f41('0x14')](function(_0xb70d27){_0x3e176b[_0x7f41('0x82')]=_0xb70d27;if(_0x43d20d[_0x7f41('0x30')][_0x7f41('0xab')]){_0x7ee0c2['include']=[{'all':!![]}];}return db[_0x7f41('0x1c')][_0x7f41('0xb5')](_0x7ee0c2);})[_0x7f41('0x14')](function(_0x1ad8cd){if(_0x43d20d[_0x7f41('0x30')][_0x7f41('0xb6')]==='true'){for(var _0x3a851f=0x0;_0x3a851f<_0x1ad8cd[_0x7f41('0x35')];_0x3a851f++){_0x1ad8cd[_0x3a851f][_0x7f41('0xad')]=juice(_0x1ad8cd[_0x3a851f][_0x7f41('0xad')]);}}_0x3e176b[_0x7f41('0xa8')]=_0x1ad8cd;return _0x3e176b;});}})[_0x7f41('0x14')](respondWithFilteredResult(_0x10d55d,_0x7ee0c2))['catch'](handleError(_0x10d55d,null));};exports[_0x7f41('0xb7')]=function(_0x351991,_0x50ef09){return db[_0x7f41('0x2b')][_0x7f41('0x51')]({'where':{'id':_0x351991['params']['id']}})[_0x7f41('0x14')](handleEntityNotFound(_0x50ef09,null))[_0x7f41('0x14')](function(_0xabcb4f){if(_0xabcb4f){return _0xabcb4f[_0x7f41('0xb8')](_0x351991[_0x7f41('0xad')][_0x7f41('0xb0')],_['omit'](_0x351991['body'],[_0x7f41('0xb0'),'id'])||{})[_0x7f41('0xb9')](function(){return db['Tag'][_0x7f41('0xb5')]({'attributes':['id',_0x7f41('0x16'),_0x7f41('0x3e')],'where':{'id':_0x351991[_0x7f41('0xad')][_0x7f41('0xb0')]}});})[_0x7f41('0x14')](function(_0x383f12){socket[_0x7f41('0xba')](_0x7f41('0xbb'),{'id':Number(_0x351991['params']['id']),'tags':_0x383f12||[]});return{'id':Number(_0x351991[_0x7f41('0xaa')]['id']),'tags':_0x383f12||[]};});}})['then'](respondWithResult(_0x50ef09,null))[_0x7f41('0x21')](handleError(_0x50ef09,null));};exports[_0x7f41('0xbc')]=function(_0x238e7a,_0x3140af){return db[_0x7f41('0x2b')]['find']({'where':{'id':_0x238e7a[_0x7f41('0xaa')]['id']}})['then'](handleEntityNotFound(_0x3140af,null))[_0x7f41('0x14')](function(_0x31c44e){if(_0x31c44e){return _0x31c44e['removeTags'](_0x238e7a[_0x7f41('0x30')][_0x7f41('0xb0')]);}})[_0x7f41('0x14')](respondWithStatusCode(_0x3140af,null))[_0x7f41('0x21')](handleError(_0x3140af,null));};exports['download']=function(_0x1fbd54,_0x3d2398){var _0x42f178=moment()[_0x7f41('0xbd')]()[_0x7f41('0x83')]();var _0x35a5c6=path[_0x7f41('0xbe')](config[_0x7f41('0xbf')],'server','files',_0x7f41('0xc0'));var _0x31631b=path['join'](config['root'],'server',_0x7f41('0xc1'),'attachments');var _0x5465ea=path['join'](_0x35a5c6,_0x42f178);var _0x491e40=util[_0x7f41('0xb3')](_0x7f41('0xc2'),_0x1fbd54[_0x7f41('0xaa')]['id'],_0x42f178);var _0x31b6b7=path[_0x7f41('0xbe')](_0x35a5c6,_0x491e40);var _0x19fbd7=[];if(_0x1fbd54[_0x7f41('0x30')]['attachments']){_0x19fbd7[_0x7f41('0x1b')]({'model':db[_0x7f41('0xc3')],'as':_0x7f41('0xc4'),'raw':!![]});}var _0x4856ba=[{'model':db[_0x7f41('0x1c')],'as':_0x7f41('0xc5'),'attributes':['id','body',_0x7f41('0x3f'),'to','cc',_0x7f41('0xc6'),_0x7f41('0xc7'),_0x7f41('0xc8')],'where':{'secret':![]},'order':qs[_0x7f41('0x39')]('id'),'include':_0x19fbd7}];return db[_0x7f41('0x2b')][_0x7f41('0x51')]({'where':{'id':_0x1fbd54['params']['id']},'include':_0x4856ba})[_0x7f41('0x14')](handleEntityNotFound(_0x3d2398,null))[_0x7f41('0x14')](function(_0x3273b9){if(_0x3273b9&&_0x3273b9[_0x7f41('0xc5')]){var _0xe35731=_0x3273b9[_0x7f41('0xc9')]({'plain':!![]});fs[_0x7f41('0xca')](_0x5465ea);return BPromise[_0x7f41('0xcb')](_0xe35731[_0x7f41('0xc5')],function(_0xaa9e26,_0x12f780){var _0x55337e={'from':_0xaa9e26[_0x7f41('0x3f')],'to':_0xaa9e26['to'],'subject':_0xaa9e26['subject'],'html':htmlEntities[_0x7f41('0xcc')](_0xaa9e26[_0x7f41('0xad')]),'headers':{'Date':moment(_0xaa9e26[_0x7f41('0xc8')])[_0x7f41('0xb3')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xaa9e26['cc']){_0x55337e[_0x7f41('0xcd')]['Cc']=_0xaa9e26['cc'];}if(_0xaa9e26[_0x7f41('0xc6')]){_0x55337e[_0x7f41('0xcd')][_0x7f41('0xce')]=_0xaa9e26[_0x7f41('0xc6')];}return new BPromise(function(_0x2aa025,_0x48b3a3){if(_0xaa9e26[_0x7f41('0xc4')]){for(var _0x50ea75=0x0;_0x50ea75<_0xaa9e26['Attachments'][_0x7f41('0x35')];_0x50ea75++){var _0x27a817=_0xaa9e26[_0x7f41('0xc4')][_0x50ea75];var _0x24dd93=path['join'](_0x31631b,_0x27a817['basename']);if(fs[_0x7f41('0xcf')](_0x24dd93)){_0x55337e[_0x7f41('0xd0')]['push']({'name':_0x27a817[_0x7f41('0x16')],'contentType':_0x27a817['type'],'data':fs[_0x7f41('0xd1')](_0x24dd93)});}}}emlformat['build'](_0x55337e,function(_0x3aca86,_0x435c67){if(_0x3aca86)return _0x48b3a3(_0x3aca86);fs['writeFileSync'](path[_0x7f41('0xbe')](_0x5465ea,util[_0x7f41('0xb3')](_0x7f41('0xd2'),_0x12f780)),_0x435c67);return _0x2aa025(_0x435c67);});});})[_0x7f41('0x14')](function(){return new BPromise(function(_0x52fc09,_0x2f60a9){zipdir(_0x5465ea,{'saveTo':_0x31b6b7},function(_0x37322c,_0x39cb50){if(_0x37322c)return _0x2f60a9(_0x37322c);return _0x52fc09(_0x39cb50);});})['then'](function(){return new BPromise(function(_0x354336,_0x5d96a1){rimraf(_0x5465ea,function(_0x5cc8a1){if(_0x5cc8a1)_0x5d96a1(_0x5cc8a1);return _0x354336();});});})[_0x7f41('0x14')](function(){return _0x3d2398[_0x7f41('0xd3')](_0x31b6b7,_0x491e40,function(_0x4761c0){if(!_0x4761c0)fs[_0x7f41('0xd4')](_0x31b6b7);});});});}else{return _0x3d2398[_0x7f41('0xa')](0xc8);}})[_0x7f41('0x21')](handleError(_0x3d2398,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 9c1be05..538878d 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 _0xec7a=['hook','exports','MailInteraction','../../mysqldb','setMaxListeners','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch'];(function(_0x2a891a,_0xcaf37c){var _0x335a16=function(_0xb4362b){while(--_0xb4362b){_0x2a891a['push'](_0x2a891a['shift']());}};_0x335a16(++_0xcaf37c);}(_0xec7a,0x64));var _0xaec7=function(_0x57ec1a,_0x2b7624){_0x57ec1a=_0x57ec1a-0x0;var _0x2159ad=_0xec7a[_0x57ec1a];return _0x2159ad;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xaec7('0x0')];var MailMessage=require(_0xaec7('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xaec7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaec7('0x3')};function emitEvent(_0x2e157d){return function(_0x1500d5,_0x526764,_0xed5000){_0x1500d5['getUsers']({'attributes':['id'],'raw':!![]})[_0xaec7('0x4')](function(_0x1b3ce0){_0x1500d5[_0xaec7('0x5')](_0xaec7('0x6'),_0x1b3ce0[_0xaec7('0x7')](function(_0x2e0bef){return{'id':_0x2e0bef['id']};}));return MailMessage[_0xaec7('0x8')]({'where':{'MailInteractionId':_0x1500d5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec7('0x4')](function(_0x2b8636){_0x1500d5[_0xaec7('0x5')](_0xaec7('0x9'),_0x2b8636['length']);MailInteractionEvents[_0xaec7('0xa')](_0x2e157d+':'+_0x1500d5['id'],_0x1500d5);MailInteractionEvents['emit'](_0x2e157d,_0x1500d5);_0xed5000(null);})[_0xaec7('0xb')](_0xed5000(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xaec7('0xc')](e,emitEvent(event));}}module[_0xaec7('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0x5019=['update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x5019,0x9d));var _0x9501=function(_0x18f50b,_0x5d0c22){_0x18f50b=_0x18f50b-0x0;var _0x28ce22=_0x5019[_0x18f50b];return _0x28ce22;};'use strict';var EventEmitter=require(_0x9501('0x0'));var MailInteraction=require(_0x9501('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x9501('0x1'))['db'][_0x9501('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9501('0x3')](0x0);var events={'afterCreate':_0x9501('0x4'),'afterUpdate':_0x9501('0x5'),'afterDestroy':_0x9501('0x6')};function emitEvent(_0x9062a8){return function(_0x1dcae5,_0x114dc7,_0x12690e){_0x1dcae5[_0x9501('0x7')]({'attributes':['id'],'raw':!![]})[_0x9501('0x8')](function(_0x2b75a0){_0x1dcae5[_0x9501('0x9')](_0x9501('0xa'),_0x2b75a0[_0x9501('0xb')](function(_0x4c4255){return{'id':_0x4c4255['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1dcae5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9501('0x8')](function(_0x402e32){_0x1dcae5[_0x9501('0x9')](_0x9501('0xc'),_0x402e32[_0x9501('0xd')]);MailInteractionEvents[_0x9501('0xe')](_0x9062a8+':'+_0x1dcae5['id'],_0x1dcae5);MailInteractionEvents[_0x9501('0xe')](_0x9062a8,_0x1dcae5);_0x12690e(null);})[_0x9501('0xf')](_0x12690e(null));};}for(var e in events){if(events[_0x9501('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9501('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e1f2b12..17b70e4 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 _0x2882=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','models','update','catch','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2882,0xe6));var _0x2288=function(_0x3cf54a,_0x118dd9){_0x3cf54a=_0x3cf54a-0x0;var _0x2368a8=_0x2882[_0x3cf54a];return _0x2368a8;};'use strict';var _=require(_0x2288('0x0'));var util=require(_0x2288('0x1'));var logger=require(_0x2288('0x2'))(_0x2288('0x3'));var moment=require(_0x2288('0x4'));var BPromise=require(_0x2288('0x5'));var rp=require(_0x2288('0x6'));var fs=require('fs');var path=require(_0x2288('0x7'));var rimraf=require(_0x2288('0x8'));var config=require(_0x2288('0x9'));var attributes=require(_0x2288('0xa'));module[_0x2288('0xb')]=function(_0x1ffaa2,_0x41a702){return _0x1ffaa2[_0x2288('0xc')](_0x2288('0xd'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2288('0xe'),'to'],'type':_0x2288('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b6919,_0x773be5,_0x217ab0){if(_0x3b6919[_0x2288('0x10')]){_0x3b6919[_0x2288('0x11')]=moment()[_0x2288('0x12')](_0x2288('0x13'));}if(_0x3b6919['closed']){_0x3b6919['closedAt']=moment()['format'](_0x2288('0x13'));}_0x217ab0(null,_0x773be5);},'beforeUpdate':function(_0x2bbb33,_0x2c4390,_0x7d73f2){if(_0x2bbb33[_0x2288('0x14')]('substatus')){_0x2bbb33[_0x2288('0x11')]=_0x2bbb33[_0x2288('0x10')]?moment()[_0x2288('0x12')](_0x2288('0x13')):null;}if(_0x2bbb33[_0x2288('0x14')](_0x2288('0x15'))){_0x2bbb33['closedAt']=moment()[_0x2288('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bbb33[_0x2288('0x10')]=null;_0x2bbb33['substatusAt']=null;}_0x7d73f2(null,_0x2bbb33);},'afterUpdate':function(_0x2bb12c,_0x425a2a,_0x575b41){var _0x402b7a=_0x1ffaa2[_0x2288('0x16')];var _0x425d52=_0x2bb12c['get']({'plain':!![]});if(_0x425d52[_0x2288('0x15')]){return _0x402b7a['MailMessage'][_0x2288('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x425d52['id']}})['then'](function(){_0x575b41();})[_0x2288('0x18')](function(_0x13b40e){_0x575b41(_0x13b40e);});}else{_0x575b41();}}},'charset':_0x2288('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9c2b=['MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','substatusAt','models','get','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailInteraction.attributes','exports','define'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x9c2b,0xf2));var _0xb9c2=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x9c2b[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xb9c2('0x0'));var util=require('util');var logger=require(_0xb9c2('0x1'))('api');var moment=require(_0xb9c2('0x2'));var BPromise=require(_0xb9c2('0x3'));var rp=require(_0xb9c2('0x4'));var fs=require('fs');var path=require(_0xb9c2('0x5'));var rimraf=require('rimraf');var config=require(_0xb9c2('0x6'));var attributes=require(_0xb9c2('0x7'));module[_0xb9c2('0x8')]=function(_0x2f4ddf,_0x4b5230){return _0x2f4ddf[_0xb9c2('0x9')](_0xb9c2('0xa'),attributes,{'tableName':_0xb9c2('0xb'),'paranoid':![],'indexes':[{'name':_0xb9c2('0xc'),'fields':[_0xb9c2('0xd'),'to'],'type':_0xb9c2('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x32ed6a,_0x4eafc5,_0x2e3991){if(_0x32ed6a['substatus']){_0x32ed6a['substatusAt']=moment()[_0xb9c2('0xf')](_0xb9c2('0x10'));}if(_0x32ed6a[_0xb9c2('0x11')]){_0x32ed6a[_0xb9c2('0x12')]=moment()['format'](_0xb9c2('0x10'));}_0x2e3991(null,_0x4eafc5);},'beforeUpdate':function(_0x2982a9,_0x316edd,_0xbae8a4){if(_0x2982a9[_0xb9c2('0x13')](_0xb9c2('0x14'))){_0x2982a9[_0xb9c2('0x15')]=_0x2982a9[_0xb9c2('0x14')]?moment()['format'](_0xb9c2('0x10')):null;}if(_0x2982a9['changed'](_0xb9c2('0x11'))){_0x2982a9['closedAt']=moment()[_0xb9c2('0xf')](_0xb9c2('0x10'));_0x2982a9['substatus']=null;_0x2982a9[_0xb9c2('0x15')]=null;}_0xbae8a4(null,_0x2982a9);},'afterUpdate':function(_0x111ff9,_0x3a78de,_0x5c5f59){var _0x16da60=_0x2f4ddf[_0xb9c2('0x16')];var _0x362e63=_0x111ff9[_0xb9c2('0x17')]({'plain':!![]});if(_0x362e63[_0xb9c2('0x11')]){return _0x16da60[_0xb9c2('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x362e63['id']}})[_0xb9c2('0x19')](function(){_0x5c5f59();})['catch'](function(_0x2a8e6c){_0x5c5f59(_0x2a8e6c);});}else{_0x5c5f59();}}},'charset':_0xb9c2('0x1a'),'collate':_0xb9c2('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 4638c4e..3e59e44 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 _0xa7ee=['debug','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes'];(function(_0x420974,_0x3ec965){var _0x1446fc=function(_0x39e253){while(--_0x39e253){_0x420974['push'](_0x420974['shift']());}};_0x1446fc(++_0x3ec965);}(_0xa7ee,0x167));var _0xea7e=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xa7ee[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0xea7e('0x0'));var util=require(_0xea7e('0x1'));var moment=require(_0xea7e('0x2'));var BPromise=require(_0xea7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea7e('0x4'));var db=require(_0xea7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea7e('0x6'))(_0xea7e('0x7'));var config=require(_0xea7e('0x8'));var jayson=require(_0xea7e('0x9'));var client=jayson[_0xea7e('0xa')][_0xea7e('0xb')]({'port':0x232a});config[_0xea7e('0xc')]=_[_0xea7e('0xd')](config[_0xea7e('0xc')],{'host':_0xea7e('0xe'),'port':0x18eb});var socket=require(_0xea7e('0xf'))(new Redis(config['redis']));require(_0xea7e('0x10'))[_0xea7e('0x11')](socket);function respondWithRpcPromise(_0x4ab5c5,_0x2ec47f,_0x2cb306){return new BPromise(function(_0x3ef42c,_0x52270e){return client[_0xea7e('0x12')](_0x4ab5c5,_0x2cb306)[_0xea7e('0x13')](function(_0x52ca49){logger[_0xea7e('0x14')]('MailInteraction,\x20%s,\x20%s',_0x2ec47f,'request\x20sent');logger['debug'](_0xea7e('0x15'),_0x2ec47f,_0xea7e('0x16'),JSON[_0xea7e('0x17')](_0x52ca49));if(_0x52ca49['error']){if(_0x52ca49[_0xea7e('0x18')][_0xea7e('0x19')]===0x1f4){logger[_0xea7e('0x18')](_0xea7e('0x1a'),_0x2ec47f,_0x52ca49[_0xea7e('0x18')][_0xea7e('0x1b')]);return _0x52270e(_0x52ca49[_0xea7e('0x18')]['message']);}logger[_0xea7e('0x18')](_0xea7e('0x1a'),_0x2ec47f,_0x52ca49[_0xea7e('0x18')]['message']);return _0x3ef42c(_0x52ca49[_0xea7e('0x18')]['message']);}else{logger[_0xea7e('0x14')](_0xea7e('0x1a'),_0x2ec47f,_0xea7e('0x16'));_0x3ef42c(_0x52ca49[_0xea7e('0x1c')][_0xea7e('0x1b')]);}})[_0xea7e('0x1d')](function(_0x380031){logger['error'](_0xea7e('0x1a'),_0x2ec47f,_0x380031);_0x52270e(_0x380031);});});}exports[_0xea7e('0x1e')]=function(_0x264af1){var _0x3a2eae=this;return new Promise(function(_0x1fff5c,_0x4ebdcf){return db[_0xea7e('0x1f')]['update'](_0x264af1[_0xea7e('0x20')],{'raw':_0x264af1['options']?_0x264af1[_0xea7e('0x21')][_0xea7e('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x264af1[_0xea7e('0x21')]?_0x264af1[_0xea7e('0x21')][_0xea7e('0x23')]||null:null,'attributes':_0x264af1[_0xea7e('0x21')]?_0x264af1[_0xea7e('0x21')][_0xea7e('0x24')]||null:null,'limit':_0x264af1[_0xea7e('0x21')]?_0x264af1[_0xea7e('0x21')]['limit']||null:null})['then'](function(_0x5ec56d){logger[_0xea7e('0x14')](_0xea7e('0x1e'),_0x264af1);logger[_0xea7e('0x25')]('UpdateMailInteraction',_0x264af1,JSON[_0xea7e('0x17')](_0x5ec56d));_0x1fff5c(_0x5ec56d);})[_0xea7e('0x1d')](function(_0x51a891){logger[_0xea7e('0x18')](_0xea7e('0x1e'),_0x51a891[_0xea7e('0x1b')],_0x264af1);_0x4ebdcf(_0x3a2eae[_0xea7e('0x18')](0x1f4,_0x51a891[_0xea7e('0x1b')]));});});};exports[_0xea7e('0x26')]=function(_0x19854c){return new Promise(function(_0x1fa08c,_0x47f109){return db[_0xea7e('0x1f')][_0xea7e('0x27')]({'where':_0x19854c[_0xea7e('0x21')]?_0x19854c['options'][_0xea7e('0x23')]||null:null})[_0xea7e('0x13')](function(_0xff3b5a){if(_0xff3b5a){return _0xff3b5a['addTags'](_0x19854c[_0xea7e('0x20')][_0xea7e('0x28')],_[_0xea7e('0x29')](_0x19854c[_0xea7e('0x20')],['ids','id'])||{});}})[_0xea7e('0x2a')](function(_0x6e2c29){logger[_0xea7e('0x14')](_0xea7e('0x2b'),_0x19854c);logger[_0xea7e('0x25')](_0xea7e('0x2b'),_0x19854c,JSON[_0xea7e('0x17')](_0x6e2c29));_0x1fa08c(_0x6e2c29);})[_0xea7e('0x1d')](function(_0x21aafb){logger[_0xea7e('0x18')](_0xea7e('0x2b'),_0x21aafb[_0xea7e('0x1b')],_0x19854c);_0x47f109(_this[_0xea7e('0x18')](0x1f4,_0x21aafb[_0xea7e('0x1b')]));});});}; \ No newline at end of file +var _0xfa12=['redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','body','options','attributes','limit','info','where','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x40cb0f,_0x13bb59){var _0x306f07=function(_0x2df08e){while(--_0x2df08e){_0x40cb0f['push'](_0x40cb0f['shift']());}};_0x306f07(++_0x13bb59);}(_0xfa12,0x1bd));var _0x2fa1=function(_0x408e7f,_0x2d8e6a){_0x408e7f=_0x408e7f-0x0;var _0xa9377d=_0xfa12[_0x408e7f];return _0xa9377d;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var moment=require(_0x2fa1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fa1('0x3'));var db=require(_0x2fa1('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2fa1('0x5'));var config=require(_0x2fa1('0x6'));var jayson=require(_0x2fa1('0x7'));var client=jayson['client'][_0x2fa1('0x8')]({'port':0x232a});config['redis']=_[_0x2fa1('0x9')](config[_0x2fa1('0xa')],{'host':_0x2fa1('0xb'),'port':0x18eb});var socket=require(_0x2fa1('0xc'))(new Redis(config[_0x2fa1('0xa')]));require(_0x2fa1('0xd'))['register'](socket);function respondWithRpcPromise(_0x23ef94,_0x1a8151,_0x122e9d){return new BPromise(function(_0x249bed,_0xa714a){return client[_0x2fa1('0xe')](_0x23ef94,_0x122e9d)[_0x2fa1('0xf')](function(_0x25cd00){logger['info'](_0x2fa1('0x10'),_0x1a8151,'request\x20sent');logger[_0x2fa1('0x11')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1a8151,_0x2fa1('0x12'),JSON[_0x2fa1('0x13')](_0x25cd00));if(_0x25cd00[_0x2fa1('0x14')]){if(_0x25cd00[_0x2fa1('0x14')][_0x2fa1('0x15')]===0x1f4){logger[_0x2fa1('0x14')]('MailInteraction,\x20%s,\x20%s',_0x1a8151,_0x25cd00[_0x2fa1('0x14')]['message']);return _0xa714a(_0x25cd00[_0x2fa1('0x14')][_0x2fa1('0x16')]);}logger['error'](_0x2fa1('0x10'),_0x1a8151,_0x25cd00[_0x2fa1('0x14')][_0x2fa1('0x16')]);return _0x249bed(_0x25cd00[_0x2fa1('0x14')][_0x2fa1('0x16')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x1a8151,_0x2fa1('0x12'));_0x249bed(_0x25cd00['result'][_0x2fa1('0x16')]);}})[_0x2fa1('0x17')](function(_0x270db4){logger['error'](_0x2fa1('0x10'),_0x1a8151,_0x270db4);_0xa714a(_0x270db4);});});}exports[_0x2fa1('0x18')]=function(_0x5656ca){var _0x1570db=this;return new Promise(function(_0x360644,_0x4c9fbf){return db[_0x2fa1('0x19')]['update'](_0x5656ca[_0x2fa1('0x1a')],{'raw':_0x5656ca['options']?_0x5656ca[_0x2fa1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5656ca['options']?_0x5656ca[_0x2fa1('0x1b')]['where']||null:null,'attributes':_0x5656ca[_0x2fa1('0x1b')]?_0x5656ca[_0x2fa1('0x1b')][_0x2fa1('0x1c')]||null:null,'limit':_0x5656ca[_0x2fa1('0x1b')]?_0x5656ca['options'][_0x2fa1('0x1d')]||null:null})[_0x2fa1('0xf')](function(_0x3e5147){logger[_0x2fa1('0x1e')](_0x2fa1('0x18'),_0x5656ca);logger['debug'](_0x2fa1('0x18'),_0x5656ca,JSON[_0x2fa1('0x13')](_0x3e5147));_0x360644(_0x3e5147);})[_0x2fa1('0x17')](function(_0x291fb2){logger[_0x2fa1('0x14')](_0x2fa1('0x18'),_0x291fb2[_0x2fa1('0x16')],_0x5656ca);_0x4c9fbf(_0x1570db[_0x2fa1('0x14')](0x1f4,_0x291fb2[_0x2fa1('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x38eae4){return new Promise(function(_0x4dd643,_0x2f4623){return db[_0x2fa1('0x19')]['find']({'where':_0x38eae4[_0x2fa1('0x1b')]?_0x38eae4[_0x2fa1('0x1b')][_0x2fa1('0x1f')]||null:null})['then'](function(_0x54dd41){if(_0x54dd41){return _0x54dd41['addTags'](_0x38eae4['body'][_0x2fa1('0x20')],_['omit'](_0x38eae4[_0x2fa1('0x1a')],[_0x2fa1('0x20'),'id'])||{});}})[_0x2fa1('0x21')](function(_0x426e6e){logger[_0x2fa1('0x1e')](_0x2fa1('0x22'),_0x38eae4);logger[_0x2fa1('0x11')](_0x2fa1('0x22'),_0x38eae4,JSON[_0x2fa1('0x13')](_0x426e6e));_0x4dd643(_0x426e6e);})[_0x2fa1('0x17')](function(_0x34f8e2){logger[_0x2fa1('0x14')](_0x2fa1('0x22'),_0x34f8e2[_0x2fa1('0x16')],_0x38eae4);_0x2f4623(_this[_0x2fa1('0x14')](0x1f4,_0x34f8e2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 02dc657..30445aa 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 _0x9308=['mailInteraction:','./mailInteraction.events','save','remove','emit','removeListener','register','length'];(function(_0x2a1121,_0x395bdc){var _0x1be044=function(_0x11e707){while(--_0x11e707){_0x2a1121['push'](_0x2a1121['shift']());}};_0x1be044(++_0x395bdc);}(_0x9308,0xc1));var _0x8930=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9308[_0xfae23b];return _0x200640;};'use strict';var MailInteractionEvents=require(_0x8930('0x0'));var events=[_0x8930('0x1'),_0x8930('0x2'),'update'];function createListener(_0x207337,_0x42d839){return function(_0x503616){_0x42d839[_0x8930('0x3')](_0x207337,_0x503616);};}function removeListener(_0x57269d,_0x270b03){return function(){MailInteractionEvents[_0x8930('0x4')](_0x57269d,_0x270b03);};}exports[_0x8930('0x5')]=function(_0x535ea5){for(var _0x2adf52=0x0,_0x225827=events[_0x8930('0x6')];_0x2adf52<_0x225827;_0x2adf52++){var _0x58a78d=events[_0x2adf52];var _0x2a4370=createListener(_0x8930('0x7')+_0x58a78d,_0x535ea5);MailInteractionEvents['on'](_0x58a78d,_0x2a4370);}}; \ No newline at end of file +var _0x8e4f=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x1905cc,_0x99e86f){var _0x15f952=function(_0x4471c0){while(--_0x4471c0){_0x1905cc['push'](_0x1905cc['shift']());}};_0x15f952(++_0x99e86f);}(_0x8e4f,0xfb));var _0xf8e4=function(_0xd9ac06,_0x5c76a8){_0xd9ac06=_0xd9ac06-0x0;var _0x1c57b7=_0x8e4f[_0xd9ac06];return _0x1c57b7;};'use strict';var MailInteractionEvents=require(_0xf8e4('0x0'));var events=['save',_0xf8e4('0x1'),'update'];function createListener(_0x6c63f3,_0xf4b08){return function(_0x2001c8){_0xf4b08[_0xf8e4('0x2')](_0x6c63f3,_0x2001c8);};}function removeListener(_0x29ca65,_0x3b2091){return function(){MailInteractionEvents[_0xf8e4('0x3')](_0x29ca65,_0x3b2091);};}exports[_0xf8e4('0x4')]=function(_0x552d2d){for(var _0x4d7733=0x0,_0x2d1e38=events[_0xf8e4('0x5')];_0x4d7733<_0x2d1e38;_0x4d7733++){var _0x50b624=events[_0x4d7733];var _0x1d12ce=createListener(_0xf8e4('0x6')+_0x50b624,_0x552d2d);MailInteractionEvents['on'](_0x50b624,_0x1d12ce);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c2331a5..3256bf2 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 _0x6bc9=['./mailMessage.controller','isAuthenticated','/describe','describe','get','/:id','show','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x217468,_0x202266){var _0x38b284=function(_0xe7f3ee){while(--_0xe7f3ee){_0x217468['push'](_0x217468['shift']());}};_0x38b284(++_0x202266);}(_0x6bc9,0x1c2));var _0x96bc=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x6bc9[_0x2a0738];return _0x159679;};'use strict';var multer=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var path=require('path');var timeout=require(_0x96bc('0x2'));var express=require(_0x96bc('0x3'));var router=express[_0x96bc('0x4')]();var fs_extra=require(_0x96bc('0x5'));var auth=require(_0x96bc('0x6'));var interaction=require(_0x96bc('0x7'));var config=require(_0x96bc('0x8'));var controller=require(_0x96bc('0x9'));router['get']('/',auth[_0x96bc('0xa')](),controller['index']);router['get'](_0x96bc('0xb'),auth['isAuthenticated'](),controller[_0x96bc('0xc')]);router[_0x96bc('0xd')](_0x96bc('0xe'),auth['isAuthenticated'](),controller[_0x96bc('0xf')]);router[_0x96bc('0xd')]('/:id/download',auth[_0x96bc('0xa')](),controller[_0x96bc('0x10')]);router[_0x96bc('0x11')]('/',auth[_0x96bc('0xa')](),interaction[_0x96bc('0x12')](_0x96bc('0x13'),_0x96bc('0x14')),controller[_0x96bc('0x15')]);router[_0x96bc('0x16')]('/:id',auth[_0x96bc('0xa')](),controller['update']);router[_0x96bc('0x16')](_0x96bc('0x17'),auth[_0x96bc('0xa')](),controller['accept']);router[_0x96bc('0x16')]('/:id/reject',auth[_0x96bc('0xa')](),controller[_0x96bc('0x18')]);router['delete']('/:id',auth[_0x96bc('0xa')](),controller[_0x96bc('0x19')]);module[_0x96bc('0x1a')]=router; \ No newline at end of file +var _0x515d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x515d,0x104));var _0xd515=function(_0x1f74c5,_0x3f920f){_0x1f74c5=_0x1f74c5-0x0;var _0x1d3e9e=_0x515d[_0x1f74c5];return _0x1d3e9e;};'use strict';var multer=require('multer');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var timeout=require(_0xd515('0x2'));var express=require(_0xd515('0x3'));var router=express[_0xd515('0x4')]();var fs_extra=require(_0xd515('0x5'));var auth=require(_0xd515('0x6'));var interaction=require(_0xd515('0x7'));var config=require('../../config/environment');var controller=require(_0xd515('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd515('0x9')]);router[_0xd515('0xa')](_0xd515('0xb'),auth[_0xd515('0xc')](),controller[_0xd515('0xd')]);router['get'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0xf')]);router[_0xd515('0xa')](_0xd515('0x10'),auth[_0xd515('0xc')](),controller['download']);router[_0xd515('0x11')]('/',auth[_0xd515('0xc')](),interaction[_0xd515('0x12')](_0xd515('0x13'),'mailmessage:create'),controller[_0xd515('0x14')]);router[_0xd515('0x15')](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x16')]);router[_0xd515('0x15')](_0xd515('0x17'),auth[_0xd515('0xc')](),controller[_0xd515('0x18')]);router[_0xd515('0x15')](_0xd515('0x19'),auth[_0xd515('0xc')](),controller[_0xd515('0x1a')]);router['delete'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x1b')]);module[_0xd515('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4519946..131d6db 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 _0x754c=['INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x754c,0x161));var _0xc754=function(_0x5180d9,_0x3cb483){_0x5180d9=_0x5180d9-0x0;var _0x1c95ee=_0x754c[_0x5180d9];return _0x1c95ee;};'use strict';var Sequelize=require(_0xc754('0x0'));var _=require(_0xc754('0x1'));module[_0xc754('0x2')]={'body':{'type':Sequelize[_0xc754('0x3')](_0xc754('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc754('0x3')](_0xc754('0x5'))},'read':{'type':Sequelize[_0xc754('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc754('0x7')]('in','out'),'defaultValue':_0xc754('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc754('0x9')](0x1fe)},'from':{'type':Sequelize[_0xc754('0x9')]},'to':{'type':Sequelize['TEXT'](_0xc754('0x4'))},'cc':{'type':Sequelize[_0xc754('0x3')]('long')},'bcc':{'type':Sequelize[_0xc754('0x3')](_0xc754('0x4'))},'subject':{'type':Sequelize[_0xc754('0x3')]},'sentAt':{'type':Sequelize[_0xc754('0xa')]},'attach':{'type':Sequelize[_0xc754('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc754('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xc754('0x3')](_0xc754('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xc754('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xc754('0xc'),_0xc754('0xd')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xc77d=['INTEGER','BOOLEAN','DATE','ENUM','Email','lodash','exports','TEXT','long','medium','out','STRING'];(function(_0x9b619a,_0x57a0e5){var _0x7c11b=function(_0x44874e){while(--_0x44874e){_0x9b619a['push'](_0x9b619a['shift']());}};_0x7c11b(++_0x57a0e5);}(_0xc77d,0x161));var _0xdc77=function(_0x13dbe4,_0x215885){_0x13dbe4=_0x13dbe4-0x0;var _0x5c41e7=_0xc77d[_0x13dbe4];return _0x5c41e7;};'use strict';var Sequelize=require('sequelize');var _=require(_0xdc77('0x0'));module[_0xdc77('0x1')]={'body':{'type':Sequelize[_0xdc77('0x2')](_0xdc77('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xdc77('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xdc77('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdc77('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xdc77('0x2')](_0xdc77('0x3'))},'cc':{'type':Sequelize[_0xdc77('0x2')](_0xdc77('0x3'))},'bcc':{'type':Sequelize[_0xdc77('0x2')](_0xdc77('0x3'))},'subject':{'type':Sequelize[_0xdc77('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xdc77('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xdc77('0x8')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xdc77('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xdc77('0x3'))},'originCc':{'type':Sequelize[_0xdc77('0x2')]('long')},'originChannel':{'type':Sequelize[_0xdc77('0xa')](_0xdc77('0xb'),'Chat'),'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 ad6a1e5..28501a1 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 _0x0bef=['decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','moment','bluebird','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','json','offset','undefined','count','limit','set','Content-Range','end','stack','name','status','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','intersection','include','update','body','find','params','destroy','describe','create','direction','out','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','mail','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','ContactId','internal','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachments','subject'];(function(_0x9195b7,_0x27d089){var _0x17182b=function(_0x5ece60){while(--_0x5ece60){_0x9195b7['push'](_0x9195b7['shift']());}};_0x17182b(++_0x27d089);}(_0x0bef,0xa8));var _0xf0be=function(_0x126c86,_0x37c9a0){_0x126c86=_0x126c86-0x0;var _0x36a46b=_0x0bef[_0x126c86];return _0x36a46b;};'use strict';var emlformat=require('eml-format');var moment=require(_0xf0be('0x0'));var BPromise=require(_0xf0be('0x1'));var util=require('util');var path=require(_0xf0be('0x2'));var fs=require('fs');var _=require(_0xf0be('0x3'));var Redis=require(_0xf0be('0x4'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xf0be('0x5'))(_0xf0be('0x6'));var interaction_log=require(_0xf0be('0x5'))(_0xf0be('0x7'));var config=require(_0xf0be('0x8'));var db=require(_0xf0be('0x9'))['db'];config[_0xf0be('0xa')]=_['defaults'](config[_0xf0be('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf0be('0xb'))(new Redis(config[_0xf0be('0xa')]));var htmlEntities=require(_0xf0be('0xc'));require(_0xf0be('0xd'))[_0xf0be('0xe')](socket);var jayson=require(_0xf0be('0xf'));var client=jayson[_0xf0be('0x10')][_0xf0be('0x11')]({'port':0x232c});var client9003=jayson['client'][_0xf0be('0x11')]({'port':0x232b});var client9002=jayson[_0xf0be('0x10')][_0xf0be('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x133178,_0x355c2a,_0x3c21fd,_0x4f8e5b){return new BPromise(function(_0x47bd45,_0x5db935){var _0x140772=_0x4f8e5b||client;return _0x140772[_0xf0be('0x12')](_0x133178,_0x3c21fd)[_0xf0be('0x13')](function(_0x74305c){logger[_0xf0be('0x14')](_0xf0be('0x15'),_0x355c2a,_0xf0be('0x16'));logger[_0xf0be('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x355c2a,'request\x20sent',JSON['stringify'](_0x74305c));if(_0x74305c[_0xf0be('0x18')]){if(_0x74305c[_0xf0be('0x18')][_0xf0be('0x19')]===0x1f4){logger[_0xf0be('0x18')](_0xf0be('0x15'),_0x355c2a,_0x74305c['error'][_0xf0be('0x1a')]);return _0x5db935(_0x74305c[_0xf0be('0x18')][_0xf0be('0x1a')]);}logger['error'](_0xf0be('0x15'),_0x355c2a,_0x74305c[_0xf0be('0x18')][_0xf0be('0x1a')]);return _0x47bd45(_0x74305c[_0xf0be('0x18')][_0xf0be('0x1a')]);}else{logger['info'](_0xf0be('0x15'),_0x355c2a,_0xf0be('0x16'));_0x47bd45(_0x74305c[_0xf0be('0x1b')][_0xf0be('0x1a')]);}})['catch'](function(_0x13bbe5){logger[_0xf0be('0x18')](_0xf0be('0x15'),_0x355c2a,_0x13bbe5);_0x5db935(_0x13bbe5);});});}function respondWithResult(_0x2290de,_0x8892af){_0x8892af=_0x8892af||0xc8;return function(_0x4306ec){if(_0x4306ec){return _0x2290de['status'](_0x8892af)[_0xf0be('0x1c')](_0x4306ec);}};}function respondWithFilteredResult(_0x891893,_0x22e4d6){return function(_0x2fd01e){if(_0x2fd01e){var _0x147c27=typeof _0x22e4d6[_0xf0be('0x1d')]===_0xf0be('0x1e')&&typeof _0x22e4d6['limit']==='undefined';var _0x166517=_0x2fd01e['count'];var _0xac49ab=_0x147c27?0x0:_0x22e4d6[_0xf0be('0x1d')];var _0x5c3ba6=_0x147c27?_0x2fd01e[_0xf0be('0x1f')]:_0x22e4d6['offset']+_0x22e4d6[_0xf0be('0x20')];var _0x559268;if(_0x5c3ba6>=_0x166517){_0x5c3ba6=_0x166517;_0x559268=0xc8;}else{_0x559268=0xce;}_0x891893['status'](_0x559268);return _0x891893[_0xf0be('0x21')](_0xf0be('0x22'),_0xac49ab+'-'+_0x5c3ba6+'/'+_0x166517)[_0xf0be('0x1c')](_0x2fd01e);}return null;};}function saveUpdates(_0xc8c473){return function(_0x3b501b){if(_0x3b501b){return _0x3b501b['update'](_0xc8c473)[_0xf0be('0x13')](function(_0x5cc16c){return _0x5cc16c;});}return null;};}function removeEntity(_0x39770d){return function(_0x197375){if(_0x197375){return _0x197375['destroy']()['then'](function(){_0x39770d['status'](0xcc)[_0xf0be('0x23')]();});}};}function handleEntityNotFound(_0x5e48ff){return function(_0x5c7652){if(!_0x5c7652){_0x5e48ff['sendStatus'](0x194);}return _0x5c7652;};}function handleError(_0x4e4bea,_0x589808){_0x589808=_0x589808||0x1f4;return function(_0x120b6){logger[_0xf0be('0x18')](_0x120b6[_0xf0be('0x24')]);if(_0x120b6[_0xf0be('0x25')]){delete _0x120b6[_0xf0be('0x25')];}_0x4e4bea[_0xf0be('0x26')](_0x589808)['send'](_0x120b6);};}exports['index']=function(_0x2a9d07,_0x1bb474){var _0x208bc4={},_0x309452={},_0x283ea0={'count':0x0,'rows':[]};var _0x4e4f2e=_[_0xf0be('0x27')](db[_0xf0be('0x28')][_0xf0be('0x29')],function(_0x178674){return{'name':_0x178674[_0xf0be('0x2a')],'type':_0x178674[_0xf0be('0x2b')][_0xf0be('0x2c')]};});_0x309452[_0xf0be('0x2d')]=_['map'](_0x4e4f2e,_0xf0be('0x25'));_0x309452[_0xf0be('0x2e')]=_[_0xf0be('0x2f')](_0x2a9d07[_0xf0be('0x2e')]);_0x309452[_0xf0be('0x30')]=_['intersection'](_0x309452[_0xf0be('0x2d')],_0x309452[_0xf0be('0x2e')]);_0x208bc4[_0xf0be('0x31')]=_['intersection'](_0x309452[_0xf0be('0x2d')],qs[_0xf0be('0x32')](_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x32')]));_0x208bc4[_0xf0be('0x31')]=_0x208bc4[_0xf0be('0x31')][_0xf0be('0x33')]?_0x208bc4['attributes']:_0x309452[_0xf0be('0x2d')];if(!_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x34')](_0xf0be('0x35'))){_0x208bc4['limit']=qs['limit'](_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x20')]);_0x208bc4['offset']=qs[_0xf0be('0x1d')](_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x1d')]);}_0x208bc4[_0xf0be('0x36')]=qs[_0xf0be('0x37')](_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x37')]);_0x208bc4[_0xf0be('0x38')]=qs['filters'](_['pick'](_0x2a9d07[_0xf0be('0x2e')],_0x309452[_0xf0be('0x30')]),_0x4e4f2e);if(_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x39')]){_0x208bc4[_0xf0be('0x38')]=_['merge'](_0x208bc4[_0xf0be('0x38')],{'$or':_[_0xf0be('0x27')](_0x4e4f2e,function(_0xe72482){if(_0xe72482[_0xf0be('0x2b')]!==_0xf0be('0x3a')){var _0xc00635={};_0xc00635[_0xe72482[_0xf0be('0x25')]]={'$like':'%'+_0x2a9d07['query']['filter']+'%'};return _0xc00635;}})});}_0x208bc4=_[_0xf0be('0x3b')]({},_0x208bc4,_0x2a9d07[_0xf0be('0x3c')]);var _0xa69cdc={'where':_0x208bc4[_0xf0be('0x38')]};return db[_0xf0be('0x28')][_0xf0be('0x1f')](_0xa69cdc)[_0xf0be('0x13')](function(_0x597e90){_0x283ea0[_0xf0be('0x1f')]=_0x597e90;if(_0x2a9d07[_0xf0be('0x2e')][_0xf0be('0x3d')]){_0x208bc4['include']=[{'all':!![]}];}return db[_0xf0be('0x28')][_0xf0be('0x3e')](_0x208bc4);})[_0xf0be('0x13')](function(_0x1af595){_0x283ea0['rows']=_0x1af595;return _0x283ea0;})[_0xf0be('0x13')](respondWithFilteredResult(_0x1bb474,_0x208bc4))[_0xf0be('0x3f')](handleError(_0x1bb474,null));};exports['show']=function(_0x53f41d,_0x22c027){var _0x1f1b6d={'raw':!![],'where':{'id':_0x53f41d['params']['id']}},_0x52c580={};_0x52c580[_0xf0be('0x2d')]=_[_0xf0be('0x2f')](db[_0xf0be('0x28')][_0xf0be('0x29')]);_0x52c580['query']=_[_0xf0be('0x2f')](_0x53f41d['query']);_0x52c580[_0xf0be('0x30')]=_[_0xf0be('0x40')](_0x52c580[_0xf0be('0x2d')],_0x52c580[_0xf0be('0x2e')]);_0x1f1b6d[_0xf0be('0x31')]=_['intersection'](_0x52c580['model'],qs[_0xf0be('0x32')](_0x53f41d[_0xf0be('0x2e')][_0xf0be('0x32')]));_0x1f1b6d['attributes']=_0x1f1b6d[_0xf0be('0x31')][_0xf0be('0x33')]?_0x1f1b6d[_0xf0be('0x31')]:_0x52c580[_0xf0be('0x2d')];if(_0x53f41d[_0xf0be('0x2e')][_0xf0be('0x3d')]){_0x1f1b6d[_0xf0be('0x41')]=[{'all':!![]}];}_0x1f1b6d=_[_0xf0be('0x3b')]({},_0x1f1b6d,_0x53f41d[_0xf0be('0x3c')]);return db[_0xf0be('0x28')]['find'](_0x1f1b6d)[_0xf0be('0x13')](handleEntityNotFound(_0x22c027,null))[_0xf0be('0x13')](respondWithResult(_0x22c027,null))['catch'](handleError(_0x22c027,null));};exports[_0xf0be('0x42')]=function(_0x1d42fe,_0x5a8aca){if(_0x1d42fe['body']['id']){delete _0x1d42fe[_0xf0be('0x43')]['id'];}return db[_0xf0be('0x28')][_0xf0be('0x44')]({'where':{'id':_0x1d42fe[_0xf0be('0x45')]['id']}})[_0xf0be('0x13')](handleEntityNotFound(_0x5a8aca,null))[_0xf0be('0x13')](saveUpdates(_0x1d42fe[_0xf0be('0x43')],null))[_0xf0be('0x13')](respondWithResult(_0x5a8aca,null))['catch'](handleError(_0x5a8aca,null));};exports[_0xf0be('0x46')]=function(_0x39f488,_0x1b5489){return db[_0xf0be('0x28')]['find']({'where':{'id':_0x39f488['params']['id']}})['then'](handleEntityNotFound(_0x1b5489,null))[_0xf0be('0x13')](removeEntity(_0x1b5489,null))['catch'](handleError(_0x1b5489,null));};exports[_0xf0be('0x47')]=function(_0x2c1e40,_0x2a3b3d){return db['MailMessage'][_0xf0be('0x47')]()[_0xf0be('0x13')](respondWithResult(_0x2a3b3d,null))[_0xf0be('0x3f')](handleError(_0x2a3b3d,null));};exports['create']=function(_0x39960c,_0x55e947){return db[_0xf0be('0x28')][_0xf0be('0x48')](_0x39960c[_0xf0be('0x43')])[_0xf0be('0x13')](function(_0x496d8e){if(_0x496d8e){if(_0x496d8e[_0xf0be('0x49')]===_0xf0be('0x4a')&&!_0x496d8e['secret']){var _0x516862,_0x30e60e,_0x3d8a0f;if(_0x39960c['body']['to']){_0x30e60e=_0x39960c[_0xf0be('0x43')]['to']['split'](',')[0x0];}return db[_0xf0be('0x4b')][_0xf0be('0x4c')]({'where':{'id':_0x496d8e[_0xf0be('0x4d')]},'include':[{'model':db[_0xf0be('0x4e')],'as':_0xf0be('0x4f'),'include':[{'model':db['CmContact'],'as':_0xf0be('0x50'),'where':{'email':_0x30e60e},'limit':0x1,'order':[[_0xf0be('0x51'),_0xf0be('0x52')]]}]},{'model':db[_0xf0be('0x53')],'as':_0xf0be('0x54'),'raw':!![],'include':[{'model':db[_0xf0be('0x55')],'as':_0xf0be('0x55'),'raw':!![]}]}]})[_0xf0be('0x13')](function(_0xdca327){_0x516862=_0xdca327;if(!_0x516862||!_0x516862[_0xf0be('0x54')])return;var _0x3d59c8=_0x516862[_0xf0be('0x56')]();if(_0x39960c[_0xf0be('0x43')][_0xf0be('0x57')]&&_0x39960c['body'][_0xf0be('0x57')][_0xf0be('0x33')]){for(var _0x25c735=0x0;_0x25c735<_0x39960c[_0xf0be('0x43')][_0xf0be('0x57')]['length'];_0x25c735+=0x1){_0x39960c['body'][_0xf0be('0x57')][_0x25c735]={'filename':_0x39960c[_0xf0be('0x43')]['attachments'][_0x25c735][_0xf0be('0x25')],'path':path[_0xf0be('0x58')](config[_0xf0be('0x59')],'server/files/attachments',_0x39960c[_0xf0be('0x43')][_0xf0be('0x57')][_0x25c735][_0xf0be('0x5a')])};}}_0x3d8a0f={'account':_0x3d59c8,'message':_0x39960c['body']};return;})['then'](function(){if(_0x516862['List']){if(_0x516862[_0xf0be('0x4f')][_0xf0be('0x50')][_0xf0be('0x33')]){return _0x516862['List']['Contacts'][0x0];}else{return db['CmContact'][_0xf0be('0x48')](_[_0xf0be('0x5b')](_0x39960c['body'],{'firstName':_0x39960c[_0xf0be('0x43')]['to'],'email':_0x39960c[_0xf0be('0x43')]['to'],'phone':_0x39960c['body']['to'],'ListId':_0x516862[_0xf0be('0x5c')]}));}}else{throw new Error(_0xf0be('0x5d'));}})[_0xf0be('0x13')](function(){if(_0x3d8a0f){return respondWithRpcPromise(_0xf0be('0x5e'),_0xf0be('0x5f'),_0x3d8a0f,client9003)[_0xf0be('0x13')](function(_0x33a1e9){return _0x496d8e[_0xf0be('0x42')]({'read':!![],'messageId':_0x33a1e9[_0xf0be('0x60')],'sentAt':moment()[_0xf0be('0x61')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xf0be('0x3f')](function(_0x3e5591){logger[_0xf0be('0x18')]('%s',JSON[_0xf0be('0x62')](_0x3e5591));return _0x496d8e;});}return _0x496d8e;});}return _0x496d8e;}})[_0xf0be('0x13')](respondWithResult(_0x55e947,0xc9))['catch'](handleError(_0x55e947,null));};exports['accept']=function(_0x2563b8,_0x418611){var _0x202165={'agent':{},'channel':_0xf0be('0x63')};if(_0x2563b8[_0xf0be('0x43')]['id']){delete _0x2563b8[_0xf0be('0x43')]['id'];}_0x2563b8[_0xf0be('0x43')]['read']=!![];_0x2563b8[_0xf0be('0x43')][_0xf0be('0x64')]=moment()[_0xf0be('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x2563b8[_0xf0be('0x43')][_0xf0be('0x65')]=_0x2563b8[_0xf0be('0x43')]['UserId']||_0x2563b8[_0xf0be('0x66')]['id'];_0x202165[_0xf0be('0x67')]['id']=_0x2563b8[_0xf0be('0x43')][_0xf0be('0x65')];return db[_0xf0be('0x28')][_0xf0be('0x44')]({'where':{'id':_0x2563b8[_0xf0be('0x45')]['id'],'UserId':null}})[_0xf0be('0x13')](handleEntityNotFound(_0x418611,null))[_0xf0be('0x13')](saveUpdates(_0x2563b8[_0xf0be('0x43')],null))[_0xf0be('0x13')](function(_0x275eb4){if(_0x275eb4){_0x202165[_0xf0be('0x1a')]=_0x275eb4[_0xf0be('0x68')]({'plain':!![]});return db[_0xf0be('0x69')][_0xf0be('0x44')]({'where':{'id':_0x275eb4[_0xf0be('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x418611,null))['then'](function(_0x14b395){if(_0x14b395){return _0x14b395[_0xf0be('0x42')]({'UserId':_0x2563b8['body']['UserId'],'read1stAt':_[_0xf0be('0x6b')](_0x14b395[_0xf0be('0x6c')])?moment()[_0xf0be('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf0be('0x13')](function(_0xbd2767){if(_0xbd2767){_0x202165[_0xf0be('0x6d')]=_0xbd2767[_0xf0be('0x68')]({'plain':!![]});interaction_log[_0xf0be('0x14')](_0xf0be('0x6e'),_0x2563b8['user']['id'],_0x2563b8[_0xf0be('0x66')][_0xf0be('0x25')],_0x2563b8[_0xf0be('0x66')]['role'],_0x202165[_0xf0be('0x6d')]['id'],_0x2563b8['body']?JSON[_0xf0be('0x62')](_0x2563b8[_0xf0be('0x43')]):_0xf0be('0x6f'));return respondWithRpcPromise(_0xf0be('0x70'),'acceptMessage',_0x202165);}return null;})['then'](function(_0x351589){var _0x1cb707=_0xf0be('0x71')+_0x351589['message']['ContactId'];return db[_0xf0be('0x72')][_0xf0be('0x2e')](_0x1cb707,{'type':db[_0xf0be('0x73')][_0xf0be('0x74')][_0xf0be('0x75')],'raw':!![]})[_0xf0be('0x13')](function(_0xcc4b5a){return _0xcc4b5a;});})[_0xf0be('0x13')](function(_0x2e1b48){if(_0x2e1b48){_0x202165[_0xf0be('0x1a')][_0xf0be('0x76')]=_0x2e1b48[0x0];if(!_0x2563b8['body'][_0xf0be('0x65')])return;return db[_0xf0be('0x77')]['find']({'where':{'id':_0x2563b8[_0xf0be('0x43')][_0xf0be('0x65')],'role':_0xf0be('0x67')},'attributes':['id',_0xf0be('0x25'),_0xf0be('0x78'),_0xf0be('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4a7395){if(!_0x4a7395)return null;_0x202165[_0xf0be('0x1a')][_0xf0be('0x67')]=_0x4a7395;return _0x202165;})['then'](function(_0x3c8963){if(_0x3c8963){if(_0x2563b8[_0xf0be('0x43')][_0xf0be('0x7a')]){_0x202165[_0xf0be('0x1a')][_0xf0be('0x7b')]=util[_0xf0be('0x61')](_0xf0be('0x7c'),_0x2563b8[_0xf0be('0x66')][_0xf0be('0x25')]);_0x202165[_0xf0be('0x1a')][_0xf0be('0x7d')]=_0x202165[_0xf0be('0x7d')];_0x202165['message'][_0xf0be('0x7e')]=_0x202165[_0xf0be('0x7d')];_0x202165['message'][_0xf0be('0x7f')]='accept';_0x202165[_0xf0be('0x1a')]['body']=htmlToText[_0xf0be('0x80')](_0x202165[_0xf0be('0x1a')][_0xf0be('0x43')]);return respondWithRpcPromise('EventManager',_0xf0be('0x81'),{'event':_0xf0be('0x82'),'message':_0x202165[_0xf0be('0x1a')]},client9002)[_0xf0be('0x13')](function(){return _0x202165;});}return _0x202165;}return null;})[_0xf0be('0x13')](respondWithResult(_0x418611,null))[_0xf0be('0x3f')](handleError(_0x418611,null));};exports[_0xf0be('0x83')]=function(_0x2235a3,_0x373a6d){var _0x35eaea={'agent':{},'channel':_0xf0be('0x63')};if(_0x2235a3[_0xf0be('0x43')]['id']){delete _0x2235a3[_0xf0be('0x43')]['id'];}_0x2235a3[_0xf0be('0x43')]['UserId']=_0x2235a3[_0xf0be('0x43')]['UserId']||_0x2235a3[_0xf0be('0x66')]['id'];_0x35eaea['agent']['id']=_0x2235a3[_0xf0be('0x43')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x2235a3[_0xf0be('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x373a6d,null))['then'](function(_0x48eb70){if(_0x48eb70){_0x35eaea[_0xf0be('0x1a')]=_0x48eb70[_0xf0be('0x68')]({'plain':!![]});return db[_0xf0be('0x69')][_0xf0be('0x44')]({'where':{'id':_0x48eb70['MailInteractionId']}});}return null;})[_0xf0be('0x13')](handleEntityNotFound(_0x373a6d,null))[_0xf0be('0x13')](function(_0x95092d){if(_0x95092d){_0x35eaea['interaction']=_0x95092d[_0xf0be('0x68')]({'plain':!![]});interaction_log[_0xf0be('0x14')](_0xf0be('0x84'),_0x2235a3['user']['id'],_0x2235a3[_0xf0be('0x66')][_0xf0be('0x25')],_0x2235a3[_0xf0be('0x66')][_0xf0be('0x85')],_0x35eaea[_0xf0be('0x6d')]['id'],_0x2235a3[_0xf0be('0x43')]?JSON[_0xf0be('0x62')](_0x2235a3[_0xf0be('0x43')]):_0xf0be('0x6f'));return respondWithRpcPromise('RejectMessage',_0xf0be('0x86'),_0x35eaea);}return null;})['then'](function(_0x514c00){var _0x5d22aa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x514c00[_0xf0be('0x1a')][_0xf0be('0x87')];return db['sequelize']['query'](_0x5d22aa,{'type':db[_0xf0be('0x73')]['QueryTypes'][_0xf0be('0x75')],'raw':!![]})['then'](function(_0x24faff){return _0x24faff;});})['then'](function(_0x4a880a){if(_0x4a880a){_0x35eaea[_0xf0be('0x1a')][_0xf0be('0x76')]=_0x4a880a[0x0];if(!_0x2235a3['body']['UserId'])return;return db['User'][_0xf0be('0x44')]({'where':{'id':_0x2235a3['body'][_0xf0be('0x65')],'role':'agent'},'attributes':['id','name',_0xf0be('0x78'),'email',_0xf0be('0x88')],'raw':!![]});}return null;})['then'](function(_0x4425e2){if(!_0x4425e2)return null;_0x35eaea[_0xf0be('0x1a')][_0xf0be('0x67')]=_0x4425e2;return _0x35eaea;})['then'](function(_0x47a6d2){if(_0x47a6d2){_0x47a6d2[_0xf0be('0x1a')][_0xf0be('0x7b')]=util[_0xf0be('0x61')](_0xf0be('0x7c'),_0x2235a3[_0xf0be('0x66')][_0xf0be('0x25')]);_0x47a6d2[_0xf0be('0x1a')][_0xf0be('0x7d')]=_0x35eaea[_0xf0be('0x7d')];_0x47a6d2[_0xf0be('0x1a')][_0xf0be('0x7e')]=_0x35eaea[_0xf0be('0x7d')];_0x47a6d2[_0xf0be('0x1a')][_0xf0be('0x7f')]='reject';_0x47a6d2[_0xf0be('0x1a')][_0xf0be('0x43')]=htmlToText[_0xf0be('0x80')](_0x35eaea[_0xf0be('0x1a')][_0xf0be('0x43')]);respondWithRpcPromise(_0xf0be('0x81'),'EventManager',{'event':_0xf0be('0x89'),'message':_0x47a6d2[_0xf0be('0x1a')]},client9002);return _0x35eaea;}return null;})[_0xf0be('0x13')](respondWithResult(_0x373a6d,null))[_0xf0be('0x3f')](handleError(_0x373a6d,null));};exports[_0xf0be('0x8a')]=function(_0x3268d3,_0x191041){var _0x13d77d=moment()[_0xf0be('0x8b')]()[_0xf0be('0x8c')]();var _0x34ba79=path[_0xf0be('0x58')](config[_0xf0be('0x59')],_0xf0be('0x8d'),_0xf0be('0x8e'),_0xf0be('0x8f'));var _0x174d94=path[_0xf0be('0x58')](config[_0xf0be('0x59')],_0xf0be('0x8d'),_0xf0be('0x8e'),_0xf0be('0x57'));var _0x49f8cb=util[_0xf0be('0x61')](_0xf0be('0x90'),_0x13d77d);return db[_0xf0be('0x28')][_0xf0be('0x44')]({'where':{'id':_0x3268d3['params']['id']},'attributes':['id',_0xf0be('0x43'),_0xf0be('0x91'),'to','cc',_0xf0be('0x92'),'subject',_0xf0be('0x93')],'include':_0x3268d3[_0xf0be('0x2e')]['attachments']?[{'model':db['Attachment'],'as':_0xf0be('0x94')}]:undefined})[_0xf0be('0x13')](handleEntityNotFound(_0x191041,null))[_0xf0be('0x13')](function(_0x22cf7b){if(_0x22cf7b){var _0x1e401f=_0x22cf7b;var _0x1e337e={'from':_0x1e401f[_0xf0be('0x91')],'to':_0x1e401f['to'],'subject':_0x1e401f[_0xf0be('0x95')],'html':htmlEntities[_0xf0be('0x96')](_0x1e401f[_0xf0be('0x43')]),'headers':{'Date':moment(_0x1e401f['createdAt'])['format'](_0xf0be('0x97'))},'attachments':[]};if(_0x22cf7b['cc']){_0x1e337e[_0xf0be('0x98')]['Cc']=_0x22cf7b['cc'];}if(_0x22cf7b[_0xf0be('0x92')]){_0x1e337e['headers'][_0xf0be('0x99')]=_0x22cf7b[_0xf0be('0x92')];}return new BPromise(function(_0x127e29,_0x4c2252){if(_0x22cf7b[_0xf0be('0x94')]){for(var _0xf5fc7a=0x0;_0xf5fc7a<_0x22cf7b[_0xf0be('0x94')]['length'];_0xf5fc7a++){var _0x1c0c4f=_0x22cf7b[_0xf0be('0x94')][_0xf5fc7a];var _0x136397=path[_0xf0be('0x58')](_0x174d94,_0x1c0c4f[_0xf0be('0x5a')]);if(fs[_0xf0be('0x9a')](_0x136397)){_0x1e337e[_0xf0be('0x57')][_0xf0be('0x9b')]({'name':_0x1c0c4f[_0xf0be('0x25')],'contentType':_0x1c0c4f[_0xf0be('0x2b')],'data':fs[_0xf0be('0x9c')](_0x136397)});}}}emlformat['build'](_0x1e337e,function(_0x2bd4fd,_0x338542){if(_0x2bd4fd)return _0x4c2252(_0x2bd4fd);fs[_0xf0be('0x9d')](path[_0xf0be('0x58')](_0x34ba79,_0x49f8cb),_0x338542);return _0x127e29(_0x338542);});});}})['then'](function(_0x3a8ceb){if(_0x3a8ceb){return _0x191041[_0xf0be('0x8a')](path[_0xf0be('0x58')](_0x34ba79,_0x49f8cb),_0x49f8cb,function(_0x33b7a7){if(!_0x33b7a7)fs[_0xf0be('0x9e')](path[_0xf0be('0x58')](_0x34ba79,_0x49f8cb));});}})[_0xf0be('0x3f')](handleError(_0x191041,null));}; \ No newline at end of file +var _0x1100=['event','accept','EventManager','acceptmessage','info','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','reject','fromString','rejectmessage','toString','join','root','files','tmp','message-%s.eml','from','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','existsSync','push','build','writeFileSync','download','unlinkSync','eml-format','moment','bluebird','util','lodash','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','name','send','index','map','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','MailMessage','includeAll','include','findAll','show','params','rawAttributes','length','body','find','describe','create','direction','out','secret','split','MailAccount','CmList','List','Contacts','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','basename','CmContact','ListId','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','mail','read','format','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel'];(function(_0x2f572e,_0x26bd75){var _0x41e439=function(_0x4ac53a){while(--_0x4ac53a){_0x2f572e['push'](_0x2f572e['shift']());}};_0x41e439(++_0x26bd75);}(_0x1100,0x150));var _0x0110=function(_0x56e19d,_0x52cf4c){_0x56e19d=_0x56e19d-0x0;var _0x1ec92c=_0x1100[_0x56e19d];return _0x1ec92c;};'use strict';var emlformat=require(_0x0110('0x0'));var moment=require(_0x0110('0x1'));var BPromise=require(_0x0110('0x2'));var util=require(_0x0110('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0110('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x0110('0x5'));var qs=require(_0x0110('0x6'));var logger=require(_0x0110('0x7'))('api');var interaction_log=require(_0x0110('0x7'))(_0x0110('0x8'));var config=require(_0x0110('0x9'));var db=require(_0x0110('0xa'))['db'];config[_0x0110('0xb')]=_[_0x0110('0xc')](config['redis'],{'host':_0x0110('0xd'),'port':0x18eb});var socket=require(_0x0110('0xe'))(new Redis(config[_0x0110('0xb')]));var htmlEntities=require('html-entities');require(_0x0110('0xf'))[_0x0110('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0110('0x11')][_0x0110('0x12')]({'port':0x232c});var client9003=jayson[_0x0110('0x11')]['http']({'port':0x232b});var client9002=jayson['client'][_0x0110('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x16484b,_0x5032b9,_0x592f80,_0x3fba5a){return new BPromise(function(_0x4fd51a,_0x551cc3){var _0x367108=_0x3fba5a||client;return _0x367108[_0x0110('0x13')](_0x16484b,_0x592f80)[_0x0110('0x14')](function(_0x2c7f7b){logger['info'](_0x0110('0x15'),_0x5032b9,_0x0110('0x16'));logger[_0x0110('0x17')](_0x0110('0x18'),_0x5032b9,'request\x20sent',JSON[_0x0110('0x19')](_0x2c7f7b));if(_0x2c7f7b['error']){if(_0x2c7f7b[_0x0110('0x1a')][_0x0110('0x1b')]===0x1f4){logger[_0x0110('0x1a')](_0x0110('0x15'),_0x5032b9,_0x2c7f7b['error'][_0x0110('0x1c')]);return _0x551cc3(_0x2c7f7b[_0x0110('0x1a')][_0x0110('0x1c')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x5032b9,_0x2c7f7b[_0x0110('0x1a')][_0x0110('0x1c')]);return _0x4fd51a(_0x2c7f7b[_0x0110('0x1a')][_0x0110('0x1c')]);}else{logger['info'](_0x0110('0x15'),_0x5032b9,_0x0110('0x16'));_0x4fd51a(_0x2c7f7b[_0x0110('0x1d')]['message']);}})[_0x0110('0x1e')](function(_0x1d5433){logger[_0x0110('0x1a')]('MailMessage,\x20%s,\x20%s',_0x5032b9,_0x1d5433);_0x551cc3(_0x1d5433);});});}function respondWithResult(_0x528229,_0x7dab3f){_0x7dab3f=_0x7dab3f||0xc8;return function(_0x5cacf4){if(_0x5cacf4){return _0x528229[_0x0110('0x1f')](_0x7dab3f)[_0x0110('0x20')](_0x5cacf4);}};}function respondWithFilteredResult(_0x2b3181,_0xbe4cbd){return function(_0x4f3d1f){if(_0x4f3d1f){var _0x1c6701=typeof _0xbe4cbd[_0x0110('0x21')]===_0x0110('0x22')&&typeof _0xbe4cbd[_0x0110('0x23')]==='undefined';var _0x3615bd=_0x4f3d1f[_0x0110('0x24')];var _0x2a80fc=_0x1c6701?0x0:_0xbe4cbd['offset'];var _0x2736c5=_0x1c6701?_0x4f3d1f[_0x0110('0x24')]:_0xbe4cbd[_0x0110('0x21')]+_0xbe4cbd['limit'];var _0x964d2;if(_0x2736c5>=_0x3615bd){_0x2736c5=_0x3615bd;_0x964d2=0xc8;}else{_0x964d2=0xce;}_0x2b3181[_0x0110('0x1f')](_0x964d2);return _0x2b3181[_0x0110('0x25')](_0x0110('0x26'),_0x2a80fc+'-'+_0x2736c5+'/'+_0x3615bd)['json'](_0x4f3d1f);}return null;};}function saveUpdates(_0x1cce3c){return function(_0x8a2ed){if(_0x8a2ed){return _0x8a2ed[_0x0110('0x27')](_0x1cce3c)[_0x0110('0x14')](function(_0x3dbbb1){return _0x3dbbb1;});}return null;};}function removeEntity(_0x407fff){return function(_0x12dc5d){if(_0x12dc5d){return _0x12dc5d[_0x0110('0x28')]()[_0x0110('0x14')](function(){_0x407fff[_0x0110('0x1f')](0xcc)[_0x0110('0x29')]();});}};}function handleEntityNotFound(_0x359cb2){return function(_0x16bf76){if(!_0x16bf76){_0x359cb2['sendStatus'](0x194);}return _0x16bf76;};}function handleError(_0x47c10f,_0x268749){_0x268749=_0x268749||0x1f4;return function(_0x3ff6fa){logger[_0x0110('0x1a')](_0x3ff6fa['stack']);if(_0x3ff6fa['name']){delete _0x3ff6fa[_0x0110('0x2a')];}_0x47c10f[_0x0110('0x1f')](_0x268749)[_0x0110('0x2b')](_0x3ff6fa);};}exports[_0x0110('0x2c')]=function(_0x49bf1a,_0x4014bc){var _0x291b16={},_0x48c945={},_0x543aa9={'count':0x0,'rows':[]};var _0x47e33a=_[_0x0110('0x2d')](db['MailMessage']['rawAttributes'],function(_0xdd880){return{'name':_0xdd880['fieldName'],'type':_0xdd880[_0x0110('0x2e')]['key']};});_0x48c945[_0x0110('0x2f')]=_[_0x0110('0x2d')](_0x47e33a,'name');_0x48c945[_0x0110('0x30')]=_[_0x0110('0x31')](_0x49bf1a['query']);_0x48c945[_0x0110('0x32')]=_[_0x0110('0x33')](_0x48c945[_0x0110('0x2f')],_0x48c945[_0x0110('0x30')]);_0x291b16[_0x0110('0x34')]=_[_0x0110('0x33')](_0x48c945[_0x0110('0x2f')],qs[_0x0110('0x35')](_0x49bf1a['query'][_0x0110('0x35')]));_0x291b16[_0x0110('0x34')]=_0x291b16[_0x0110('0x34')]['length']?_0x291b16[_0x0110('0x34')]:_0x48c945[_0x0110('0x2f')];if(!_0x49bf1a[_0x0110('0x30')][_0x0110('0x36')](_0x0110('0x37'))){_0x291b16['limit']=qs[_0x0110('0x23')](_0x49bf1a['query'][_0x0110('0x23')]);_0x291b16[_0x0110('0x21')]=qs[_0x0110('0x21')](_0x49bf1a[_0x0110('0x30')][_0x0110('0x21')]);}_0x291b16[_0x0110('0x38')]=qs[_0x0110('0x39')](_0x49bf1a[_0x0110('0x30')]['sort']);_0x291b16['where']=qs['filters'](_['pick'](_0x49bf1a[_0x0110('0x30')],_0x48c945[_0x0110('0x32')]),_0x47e33a);if(_0x49bf1a[_0x0110('0x30')][_0x0110('0x3a')]){_0x291b16[_0x0110('0x3b')]=_[_0x0110('0x3c')](_0x291b16[_0x0110('0x3b')],{'$or':_[_0x0110('0x2d')](_0x47e33a,function(_0x28f788){if(_0x28f788[_0x0110('0x2e')]!=='VIRTUAL'){var _0x4d073c={};_0x4d073c[_0x28f788['name']]={'$like':'%'+_0x49bf1a[_0x0110('0x30')][_0x0110('0x3a')]+'%'};return _0x4d073c;}})});}_0x291b16=_[_0x0110('0x3c')]({},_0x291b16,_0x49bf1a[_0x0110('0x3d')]);var _0x1caaf7={'where':_0x291b16[_0x0110('0x3b')]};return db[_0x0110('0x3e')]['count'](_0x1caaf7)['then'](function(_0x4663cc){_0x543aa9[_0x0110('0x24')]=_0x4663cc;if(_0x49bf1a[_0x0110('0x30')][_0x0110('0x3f')]){_0x291b16[_0x0110('0x40')]=[{'all':!![]}];}return db[_0x0110('0x3e')][_0x0110('0x41')](_0x291b16);})[_0x0110('0x14')](function(_0x2fdfb0){_0x543aa9['rows']=_0x2fdfb0;return _0x543aa9;})[_0x0110('0x14')](respondWithFilteredResult(_0x4014bc,_0x291b16))[_0x0110('0x1e')](handleError(_0x4014bc,null));};exports[_0x0110('0x42')]=function(_0x526c9a,_0x190b8a){var _0x3ab8b7={'raw':!![],'where':{'id':_0x526c9a[_0x0110('0x43')]['id']}},_0x275755={};_0x275755[_0x0110('0x2f')]=_[_0x0110('0x31')](db[_0x0110('0x3e')][_0x0110('0x44')]);_0x275755[_0x0110('0x30')]=_[_0x0110('0x31')](_0x526c9a['query']);_0x275755[_0x0110('0x32')]=_[_0x0110('0x33')](_0x275755[_0x0110('0x2f')],_0x275755[_0x0110('0x30')]);_0x3ab8b7[_0x0110('0x34')]=_[_0x0110('0x33')](_0x275755[_0x0110('0x2f')],qs[_0x0110('0x35')](_0x526c9a[_0x0110('0x30')]['fields']));_0x3ab8b7['attributes']=_0x3ab8b7[_0x0110('0x34')][_0x0110('0x45')]?_0x3ab8b7[_0x0110('0x34')]:_0x275755[_0x0110('0x2f')];if(_0x526c9a[_0x0110('0x30')][_0x0110('0x3f')]){_0x3ab8b7['include']=[{'all':!![]}];}_0x3ab8b7=_['merge']({},_0x3ab8b7,_0x526c9a[_0x0110('0x3d')]);return db['MailMessage']['find'](_0x3ab8b7)[_0x0110('0x14')](handleEntityNotFound(_0x190b8a,null))['then'](respondWithResult(_0x190b8a,null))[_0x0110('0x1e')](handleError(_0x190b8a,null));};exports[_0x0110('0x27')]=function(_0x24a2e2,_0x3276c2){if(_0x24a2e2['body']['id']){delete _0x24a2e2[_0x0110('0x46')]['id'];}return db[_0x0110('0x3e')]['find']({'where':{'id':_0x24a2e2['params']['id']}})['then'](handleEntityNotFound(_0x3276c2,null))[_0x0110('0x14')](saveUpdates(_0x24a2e2[_0x0110('0x46')],null))[_0x0110('0x14')](respondWithResult(_0x3276c2,null))['catch'](handleError(_0x3276c2,null));};exports[_0x0110('0x28')]=function(_0x1bfcae,_0x6fc7a1){return db[_0x0110('0x3e')][_0x0110('0x47')]({'where':{'id':_0x1bfcae['params']['id']}})['then'](handleEntityNotFound(_0x6fc7a1,null))[_0x0110('0x14')](removeEntity(_0x6fc7a1,null))[_0x0110('0x1e')](handleError(_0x6fc7a1,null));};exports['describe']=function(_0x213116,_0x110949){return db['MailMessage'][_0x0110('0x48')]()[_0x0110('0x14')](respondWithResult(_0x110949,null))[_0x0110('0x1e')](handleError(_0x110949,null));};exports[_0x0110('0x49')]=function(_0x4915ea,_0xe1d898){return db['MailMessage'][_0x0110('0x49')](_0x4915ea['body'])[_0x0110('0x14')](function(_0x5bde24){if(_0x5bde24){if(_0x5bde24[_0x0110('0x4a')]===_0x0110('0x4b')&&!_0x5bde24[_0x0110('0x4c')]){var _0x5d1180,_0x5b612b,_0x258f73;if(_0x4915ea[_0x0110('0x46')]['to']){_0x5b612b=_0x4915ea['body']['to'][_0x0110('0x4d')](',')[0x0];}return db[_0x0110('0x4e')]['findOne']({'where':{'id':_0x5bde24['MailAccountId']},'include':[{'model':db[_0x0110('0x4f')],'as':_0x0110('0x50'),'include':[{'model':db['CmContact'],'as':_0x0110('0x51'),'where':{'email':_0x5b612b},'limit':0x1,'order':[['updatedAt',_0x0110('0x52')]]}]},{'model':db['MailServerOut'],'as':_0x0110('0x53'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0110('0x54'),'raw':!![]}]}]})[_0x0110('0x14')](function(_0x2c8906){_0x5d1180=_0x2c8906;if(!_0x5d1180||!_0x5d1180[_0x0110('0x53')])return;var _0x31c291=_0x5d1180[_0x0110('0x55')]();if(_0x4915ea[_0x0110('0x46')][_0x0110('0x56')]&&_0x4915ea['body']['attachments'][_0x0110('0x45')]){for(var _0x38ea3d=0x0;_0x38ea3d<_0x4915ea['body'][_0x0110('0x56')][_0x0110('0x45')];_0x38ea3d+=0x1){_0x4915ea[_0x0110('0x46')][_0x0110('0x56')][_0x38ea3d]={'filename':_0x4915ea[_0x0110('0x46')][_0x0110('0x56')][_0x38ea3d][_0x0110('0x2a')],'path':path['join'](config['root'],'server/files/attachments',_0x4915ea[_0x0110('0x46')][_0x0110('0x56')][_0x38ea3d][_0x0110('0x57')])};}}_0x258f73={'account':_0x31c291,'message':_0x4915ea[_0x0110('0x46')]};return;})[_0x0110('0x14')](function(){if(_0x5d1180[_0x0110('0x50')]){if(_0x5d1180[_0x0110('0x50')][_0x0110('0x51')][_0x0110('0x45')]){return _0x5d1180[_0x0110('0x50')]['Contacts'][0x0];}else{return db[_0x0110('0x58')][_0x0110('0x49')](_['defaults'](_0x4915ea[_0x0110('0x46')],{'firstName':_0x4915ea[_0x0110('0x46')]['to'],'email':_0x4915ea[_0x0110('0x46')]['to'],'phone':_0x4915ea[_0x0110('0x46')]['to'],'ListId':_0x5d1180[_0x0110('0x59')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x0110('0x14')](function(){if(_0x258f73){return respondWithRpcPromise(_0x0110('0x5a'),_0x0110('0x5b'),_0x258f73,client9003)[_0x0110('0x14')](function(_0x28c40c){return _0x5bde24[_0x0110('0x27')]({'read':!![],'messageId':_0x28c40c['messageId'],'sentAt':moment()['format'](_0x0110('0x5c'))});})[_0x0110('0x1e')](function(_0x4421b0){logger[_0x0110('0x1a')]('%s',JSON[_0x0110('0x19')](_0x4421b0));return _0x5bde24;});}return _0x5bde24;});}return _0x5bde24;}})['then'](respondWithResult(_0xe1d898,0xc9))['catch'](handleError(_0xe1d898,null));};exports['accept']=function(_0x19fc1f,_0xf367cd){var _0x9ed2d1={'agent':{},'channel':_0x0110('0x5d')};if(_0x19fc1f[_0x0110('0x46')]['id']){delete _0x19fc1f[_0x0110('0x46')]['id'];}_0x19fc1f['body'][_0x0110('0x5e')]=!![];_0x19fc1f[_0x0110('0x46')]['readAt']=moment()[_0x0110('0x5f')](_0x0110('0x5c'));_0x19fc1f[_0x0110('0x46')][_0x0110('0x60')]=_0x19fc1f[_0x0110('0x46')][_0x0110('0x60')]||_0x19fc1f[_0x0110('0x61')]['id'];_0x9ed2d1[_0x0110('0x62')]['id']=_0x19fc1f['body'][_0x0110('0x60')];return db['MailMessage'][_0x0110('0x47')]({'where':{'id':_0x19fc1f['params']['id'],'UserId':null}})[_0x0110('0x14')](handleEntityNotFound(_0xf367cd,null))[_0x0110('0x14')](saveUpdates(_0x19fc1f[_0x0110('0x46')],null))['then'](function(_0xddff49){if(_0xddff49){_0x9ed2d1['message']=_0xddff49[_0x0110('0x63')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0xddff49[_0x0110('0x64')]}});}return null;})[_0x0110('0x14')](handleEntityNotFound(_0xf367cd,null))['then'](function(_0x3efe16){if(_0x3efe16){return _0x3efe16[_0x0110('0x27')]({'UserId':_0x19fc1f['body'][_0x0110('0x60')],'read1stAt':_[_0x0110('0x65')](_0x3efe16[_0x0110('0x66')])?moment()[_0x0110('0x5f')](_0x0110('0x5c')):undefined});}return null;})['then'](function(_0xf1f0e6){if(_0xf1f0e6){_0x9ed2d1[_0x0110('0x67')]=_0xf1f0e6['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19fc1f[_0x0110('0x61')]['id'],_0x19fc1f[_0x0110('0x61')]['name'],_0x19fc1f['user'][_0x0110('0x68')],_0x9ed2d1[_0x0110('0x67')]['id'],_0x19fc1f['body']?JSON['stringify'](_0x19fc1f[_0x0110('0x46')]):_0x0110('0x69'));return respondWithRpcPromise(_0x0110('0x6a'),'acceptMessage',_0x9ed2d1);}return null;})[_0x0110('0x14')](function(_0x13a8e8){var _0x4cc451=_0x0110('0x6b')+_0x13a8e8[_0x0110('0x1c')]['ContactId'];return db[_0x0110('0x6c')][_0x0110('0x30')](_0x4cc451,{'type':db[_0x0110('0x6d')][_0x0110('0x6e')][_0x0110('0x6f')],'raw':!![]})['then'](function(_0x9635e2){return _0x9635e2;});})[_0x0110('0x14')](function(_0x595a94){if(_0x595a94){_0x9ed2d1[_0x0110('0x1c')]['contact']=_0x595a94[0x0];if(!_0x19fc1f[_0x0110('0x46')]['UserId'])return;return db[_0x0110('0x70')][_0x0110('0x47')]({'where':{'id':_0x19fc1f[_0x0110('0x46')]['UserId'],'role':_0x0110('0x62')},'attributes':['id','name',_0x0110('0x71'),_0x0110('0x72'),_0x0110('0x73')],'raw':!![]});}return null;})[_0x0110('0x14')](function(_0x3a6c4d){if(!_0x3a6c4d)return null;_0x9ed2d1[_0x0110('0x1c')][_0x0110('0x62')]=_0x3a6c4d;return _0x9ed2d1;})['then'](function(_0x242398){if(_0x242398){if(_0x19fc1f[_0x0110('0x46')]['manual']){_0x9ed2d1['message'][_0x0110('0x74')]=util[_0x0110('0x5f')](_0x0110('0x75'),_0x19fc1f[_0x0110('0x61')][_0x0110('0x2a')]);_0x9ed2d1[_0x0110('0x1c')][_0x0110('0x76')]=_0x9ed2d1[_0x0110('0x76')];_0x9ed2d1[_0x0110('0x1c')][_0x0110('0x77')]=_0x9ed2d1[_0x0110('0x76')];_0x9ed2d1['message'][_0x0110('0x78')]=_0x0110('0x79');_0x9ed2d1[_0x0110('0x1c')][_0x0110('0x46')]=htmlToText['fromString'](_0x9ed2d1[_0x0110('0x1c')]['body']);return respondWithRpcPromise(_0x0110('0x7a'),_0x0110('0x7a'),{'event':_0x0110('0x7b'),'message':_0x9ed2d1[_0x0110('0x1c')]},client9002)['then'](function(){return _0x9ed2d1;});}return _0x9ed2d1;}return null;})[_0x0110('0x14')](respondWithResult(_0xf367cd,null))[_0x0110('0x1e')](handleError(_0xf367cd,null));};exports['reject']=function(_0x840278,_0x29ef58){var _0x14280f={'agent':{},'channel':_0x0110('0x5d')};if(_0x840278['body']['id']){delete _0x840278['body']['id'];}_0x840278['body'][_0x0110('0x60')]=_0x840278['body'][_0x0110('0x60')]||_0x840278[_0x0110('0x61')]['id'];_0x14280f[_0x0110('0x62')]['id']=_0x840278[_0x0110('0x46')][_0x0110('0x60')];return db[_0x0110('0x3e')][_0x0110('0x47')]({'where':{'id':_0x840278[_0x0110('0x43')]['id'],'UserId':null}})[_0x0110('0x14')](handleEntityNotFound(_0x29ef58,null))[_0x0110('0x14')](function(_0x370011){if(_0x370011){_0x14280f[_0x0110('0x1c')]=_0x370011[_0x0110('0x63')]({'plain':!![]});return db['MailInteraction'][_0x0110('0x47')]({'where':{'id':_0x370011[_0x0110('0x64')]}});}return null;})[_0x0110('0x14')](handleEntityNotFound(_0x29ef58,null))['then'](function(_0x35786f){if(_0x35786f){_0x14280f[_0x0110('0x67')]=_0x35786f[_0x0110('0x63')]({'plain':!![]});interaction_log[_0x0110('0x7c')](_0x0110('0x7d'),_0x840278[_0x0110('0x61')]['id'],_0x840278['user'][_0x0110('0x2a')],_0x840278[_0x0110('0x61')][_0x0110('0x68')],_0x14280f[_0x0110('0x67')]['id'],_0x840278[_0x0110('0x46')]?JSON[_0x0110('0x19')](_0x840278[_0x0110('0x46')]):'null');return respondWithRpcPromise(_0x0110('0x7e'),'rejectMessage',_0x14280f);}return null;})[_0x0110('0x14')](function(_0x5209ad){var _0x15d295=_0x0110('0x6b')+_0x5209ad['message'][_0x0110('0x7f')];return db[_0x0110('0x6c')][_0x0110('0x30')](_0x15d295,{'type':db[_0x0110('0x6d')][_0x0110('0x6e')][_0x0110('0x6f')],'raw':!![]})[_0x0110('0x14')](function(_0xf7ecd){return _0xf7ecd;});})[_0x0110('0x14')](function(_0x2f87ce){if(_0x2f87ce){_0x14280f[_0x0110('0x1c')]['contact']=_0x2f87ce[0x0];if(!_0x840278[_0x0110('0x46')]['UserId'])return;return db[_0x0110('0x70')][_0x0110('0x47')]({'where':{'id':_0x840278[_0x0110('0x46')][_0x0110('0x60')],'role':_0x0110('0x62')},'attributes':['id',_0x0110('0x2a'),_0x0110('0x71'),'email',_0x0110('0x73')],'raw':!![]});}return null;})['then'](function(_0x524ac7){if(!_0x524ac7)return null;_0x14280f[_0x0110('0x1c')][_0x0110('0x62')]=_0x524ac7;return _0x14280f;})[_0x0110('0x14')](function(_0x23f0af){if(_0x23f0af){_0x23f0af[_0x0110('0x1c')][_0x0110('0x74')]=util['format']('SIP/%s',_0x840278[_0x0110('0x61')][_0x0110('0x2a')]);_0x23f0af[_0x0110('0x1c')][_0x0110('0x76')]=_0x14280f['channel'];_0x23f0af[_0x0110('0x1c')]['motionChannel']=_0x14280f[_0x0110('0x76')];_0x23f0af[_0x0110('0x1c')][_0x0110('0x78')]=_0x0110('0x80');_0x23f0af[_0x0110('0x1c')][_0x0110('0x46')]=htmlToText[_0x0110('0x81')](_0x14280f['message']['body']);respondWithRpcPromise('EventManager',_0x0110('0x7a'),{'event':_0x0110('0x82'),'message':_0x23f0af[_0x0110('0x1c')]},client9002);return _0x14280f;}return null;})[_0x0110('0x14')](respondWithResult(_0x29ef58,null))[_0x0110('0x1e')](handleError(_0x29ef58,null));};exports['download']=function(_0x1592f6,_0x456bd0){var _0x5864dc=moment()['unix']()[_0x0110('0x83')]();var _0x2b1333=path[_0x0110('0x84')](config[_0x0110('0x85')],'server',_0x0110('0x86'),_0x0110('0x87'));var _0x25f932=path[_0x0110('0x84')](config[_0x0110('0x85')],'server','files',_0x0110('0x56'));var _0x10e1e5=util[_0x0110('0x5f')](_0x0110('0x88'),_0x5864dc);return db[_0x0110('0x3e')][_0x0110('0x47')]({'where':{'id':_0x1592f6[_0x0110('0x43')]['id']},'attributes':['id',_0x0110('0x46'),_0x0110('0x89'),'to','cc','bcc','subject',_0x0110('0x8a')],'include':_0x1592f6[_0x0110('0x30')]['attachments']?[{'model':db[_0x0110('0x8b')],'as':_0x0110('0x8c')}]:undefined})[_0x0110('0x14')](handleEntityNotFound(_0x456bd0,null))[_0x0110('0x14')](function(_0x1b3126){if(_0x1b3126){var _0x2b40fc=_0x1b3126;var _0x1cc0d4={'from':_0x2b40fc[_0x0110('0x89')],'to':_0x2b40fc['to'],'subject':_0x2b40fc[_0x0110('0x8d')],'html':htmlEntities[_0x0110('0x8e')](_0x2b40fc[_0x0110('0x46')]),'headers':{'Date':moment(_0x2b40fc[_0x0110('0x8a')])[_0x0110('0x5f')](_0x0110('0x8f'))},'attachments':[]};if(_0x1b3126['cc']){_0x1cc0d4['headers']['Cc']=_0x1b3126['cc'];}if(_0x1b3126[_0x0110('0x90')]){_0x1cc0d4['headers'][_0x0110('0x91')]=_0x1b3126[_0x0110('0x90')];}return new BPromise(function(_0x3679b4,_0x142350){if(_0x1b3126[_0x0110('0x8c')]){for(var _0xe0f63c=0x0;_0xe0f63c<_0x1b3126[_0x0110('0x8c')]['length'];_0xe0f63c++){var _0x2bfadf=_0x1b3126[_0x0110('0x8c')][_0xe0f63c];var _0x3224e1=path['join'](_0x25f932,_0x2bfadf[_0x0110('0x57')]);if(fs[_0x0110('0x92')](_0x3224e1)){_0x1cc0d4[_0x0110('0x56')][_0x0110('0x93')]({'name':_0x2bfadf[_0x0110('0x2a')],'contentType':_0x2bfadf[_0x0110('0x2e')],'data':fs['readFileSync'](_0x3224e1)});}}}emlformat[_0x0110('0x94')](_0x1cc0d4,function(_0x35cc67,_0x31eec6){if(_0x35cc67)return _0x142350(_0x35cc67);fs[_0x0110('0x95')](path['join'](_0x2b1333,_0x10e1e5),_0x31eec6);return _0x3679b4(_0x31eec6);});});}})[_0x0110('0x14')](function(_0x50d025){if(_0x50d025){return _0x456bd0[_0x0110('0x96')](path[_0x0110('0x84')](_0x2b1333,_0x10e1e5),_0x10e1e5,function(_0x39dfd7){if(!_0x39dfd7)fs[_0x0110('0x97')](path['join'](_0x2b1333,_0x10e1e5));});}})[_0x0110('0x1e')](handleError(_0x456bd0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 4d8129f..8d72735 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 _0xaffc=['events','MailMessage','remove','emit','hook'];(function(_0x22b254,_0x65fb18){var _0x10fdec=function(_0x7db39b){while(--_0x7db39b){_0x22b254['push'](_0x22b254['shift']());}};_0x10fdec(++_0x65fb18);}(_0xaffc,0x1ef));var _0xcaff=function(_0x2a20fe,_0x4e40e3){_0x2a20fe=_0x2a20fe-0x0;var _0x26335c=_0xaffc[_0x2a20fe];return _0x26335c;};'use strict';var EventEmitter=require(_0xcaff('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xcaff('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcaff('0x2')};function emitEvent(_0x2eac4a){return function(_0x5d78e9,_0x5ab67d,_0x56ae37){MailMessageEvents[_0xcaff('0x3')](_0x2eac4a+':'+_0x5d78e9['id'],_0x5d78e9);MailMessageEvents[_0xcaff('0x3')](_0x2eac4a,_0x5d78e9);_0x56ae37(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xcaff('0x4')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x9198=['events','../../mysqldb','MailMessage','update','remove','emit','hook'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x9198,0x15e));var _0x8919=function(_0x3023cc,_0x142de2){_0x3023cc=_0x3023cc-0x0;var _0x2f1998=_0x9198[_0x3023cc];return _0x2f1998;};'use strict';var EventEmitter=require(_0x8919('0x0'));var MailMessage=require(_0x8919('0x1'))['db'][_0x8919('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8919('0x3'),'afterDestroy':_0x8919('0x4')};function emitEvent(_0x5eb932){return function(_0x2445c9,_0x24eed7,_0x214b2e){MailMessageEvents[_0x8919('0x5')](_0x5eb932+':'+_0x2445c9['id'],_0x2445c9);MailMessageEvents[_0x8919('0x5')](_0x5eb932,_0x2445c9);_0x214b2e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x8919('0x6')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 487293b..eac4cb5 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 _0x7673=['then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','fromString','models','get','toLowerCase','out','secret','isNil','MailInteraction','findOne','MailInteractionId'];(function(_0x2c3242,_0x32c5ef){var _0x4c9f9a=function(_0x4c675f){while(--_0x4c675f){_0x2c3242['push'](_0x2c3242['shift']());}};_0x4c9f9a(++_0x32c5ef);}(_0x7673,0x152));var _0x3767=function(_0x1b81b9,_0x1d314a){_0x1b81b9=_0x1b81b9-0x0;var _0x27a94d=_0x7673[_0x1b81b9];return _0x27a94d;};'use strict';var _=require(_0x3767('0x0'));var util=require(_0x3767('0x1'));var logger=require('../../config/logger')(_0x3767('0x2'));var moment=require('moment');var BPromise=require(_0x3767('0x3'));var rp=require(_0x3767('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x3767('0x5'));var rimraf=require(_0x3767('0x6'));var config=require('../../config/environment');var attributes=require(_0x3767('0x7'));module[_0x3767('0x8')]=function(_0x157fa8,_0x26d1b0){return _0x157fa8[_0x3767('0x9')](_0x3767('0xa'),attributes,{'tableName':_0x3767('0xb'),'paranoid':![],'indexes':[{'name':_0x3767('0xc'),'fields':[_0x3767('0xc')]},{'name':'fti_mail_messages','fields':[_0x3767('0xd'),'subject'],'type':_0x3767('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46ea6e,_0x4a18f9,_0x5af7d3){if(_0x46ea6e['body']){_0x46ea6e[_0x3767('0xd')]=htmlToText[_0x3767('0xf')](_0x46ea6e['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5af7d3(null,_0x4a18f9);},'afterCreate':function(_0x25884b,_0x461439,_0x40b083){var _0x570619=_0x157fa8[_0x3767('0x10')];var _0x10c327=_0x25884b[_0x3767('0x11')]({'plain':!![]});if(_0x10c327['direction'][_0x3767('0x12')]()==='in'||_0x10c327['direction'][_0x3767('0x12')]()===_0x3767('0x13')&&!_0x10c327[_0x3767('0x14')]&&!_[_0x3767('0x15')](_0x10c327['UserId'])){_0x570619[_0x3767('0x16')][_0x3767('0x17')]({'where':{'id':_0x10c327[_0x3767('0x18')]}})[_0x3767('0x19')](function(_0x5dda19){if(_0x5dda19){_0x5dda19[_0x3767('0x1a')]({'lastMsgAt':_0x10c327[_0x3767('0x1b')],'lastMsgDirection':_0x10c327[_0x3767('0x1c')]['toLowerCase']()});}})[_0x3767('0x1d')](function(_0x4fced5){console[_0x3767('0x1e')](_0x4fced5);});}_0x40b083();}},'charset':_0x3767('0x1f'),'collate':_0x3767('0x20')});}; \ No newline at end of file +var _0xe9c5=['models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','body','fromString'];(function(_0x186263,_0x25840f){var _0x4afb3a=function(_0x55e976){while(--_0x55e976){_0x186263['push'](_0x186263['shift']());}};_0x4afb3a(++_0x25840f);}(_0xe9c5,0x113));var _0x5e9c=function(_0x1bde24,_0x2b79b1){_0x1bde24=_0x1bde24-0x0;var _0x44656d=_0xe9c5[_0x1bde24];return _0x44656d;};'use strict';var _=require(_0x5e9c('0x0'));var util=require('util');var logger=require(_0x5e9c('0x1'))(_0x5e9c('0x2'));var moment=require(_0x5e9c('0x3'));var BPromise=require(_0x5e9c('0x4'));var rp=require(_0x5e9c('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e9c('0x6'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x235ab5,_0x2e93aa){return _0x235ab5[_0x5e9c('0x7')](_0x5e9c('0x8'),attributes,{'tableName':_0x5e9c('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x5e9c('0xa')]},{'name':'fti_mail_messages','fields':[_0x5e9c('0xb'),'subject'],'type':_0x5e9c('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x43df22,_0x52ec3f,_0x5429f6){if(_0x43df22[_0x5e9c('0xd')]){_0x43df22[_0x5e9c('0xb')]=htmlToText[_0x5e9c('0xe')](_0x43df22[_0x5e9c('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5429f6(null,_0x52ec3f);},'afterCreate':function(_0xcf5e92,_0x4dd98f,_0x4cd778){var _0x40974c=_0x235ab5[_0x5e9c('0xf')];var _0x3541c3=_0xcf5e92[_0x5e9c('0x10')]({'plain':!![]});if(_0x3541c3['direction']['toLowerCase']()==='in'||_0x3541c3[_0x5e9c('0x11')][_0x5e9c('0x12')]()===_0x5e9c('0x13')&&!_0x3541c3[_0x5e9c('0x14')]&&!_[_0x5e9c('0x15')](_0x3541c3[_0x5e9c('0x16')])){_0x40974c['MailInteraction']['findOne']({'where':{'id':_0x3541c3[_0x5e9c('0x17')]}})['then'](function(_0x1193b2){if(_0x1193b2){_0x1193b2[_0x5e9c('0x18')]({'lastMsgAt':_0x3541c3[_0x5e9c('0x19')],'lastMsgDirection':_0x3541c3[_0x5e9c('0x11')][_0x5e9c('0x12')]()});}})[_0x5e9c('0x1a')](function(_0x35d1d9){console[_0x5e9c('0x1b')](_0x35d1d9);});}_0x4cd778();}},'charset':'utf8mb4','collate':_0x5e9c('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index afbdd3e..00e4955 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 _0x7880=['redis','defaults','localhost','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailMessage','create','body','options','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x277541,_0x4d8a9b){var _0x4b975b=function(_0x30b55b){while(--_0x30b55b){_0x277541['push'](_0x277541['shift']());}};_0x4b975b(++_0x4d8a9b);}(_0x7880,0x1f4));var _0x0788=function(_0x4c4cbf,_0x1e6e6){_0x4c4cbf=_0x4c4cbf-0x0;var _0xa65774=_0x7880[_0x4c4cbf];return _0xa65774;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});config[_0x0788('0xc')]=_[_0x0788('0xd')](config[_0x0788('0xc')],{'host':_0x0788('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0788('0xc')]));require('./mailMessage.socket')[_0x0788('0xf')](socket);function respondWithRpcPromise(_0x53b2f2,_0x433c26,_0x3c6d18){return new BPromise(function(_0x1f9ff6,_0xee8670){return client[_0x0788('0x10')](_0x53b2f2,_0x3c6d18)['then'](function(_0x1920b3){logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,_0x0788('0x13'));logger[_0x0788('0x14')](_0x0788('0x15'),_0x433c26,_0x0788('0x13'),JSON['stringify'](_0x1920b3));if(_0x1920b3[_0x0788('0x16')]){if(_0x1920b3[_0x0788('0x16')][_0x0788('0x17')]===0x1f4){logger[_0x0788('0x16')]('MailMessage,\x20%s,\x20%s',_0x433c26,_0x1920b3[_0x0788('0x16')]['message']);return _0xee8670(_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);}logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x1920b3[_0x0788('0x16')][_0x0788('0x18')]);return _0x1f9ff6(_0x1920b3['error']['message']);}else{logger[_0x0788('0x11')](_0x0788('0x12'),_0x433c26,'request\x20sent');_0x1f9ff6(_0x1920b3[_0x0788('0x19')][_0x0788('0x18')]);}})[_0x0788('0x1a')](function(_0x52c339){logger[_0x0788('0x16')](_0x0788('0x12'),_0x433c26,_0x52c339);_0xee8670(_0x52c339);});});}exports['CreateMailMessage']=function(_0x11ea01){var _0x5173d6=this;return new Promise(function(_0x7d0869,_0x48bc5f){return db[_0x0788('0x1b')][_0x0788('0x1c')](_0x11ea01[_0x0788('0x1d')],{'raw':_0x11ea01[_0x0788('0x1e')]?_0x11ea01[_0x0788('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2270d4){logger[_0x0788('0x11')](_0x0788('0x1f'),_0x11ea01);logger[_0x0788('0x14')]('CreateMailMessage',_0x11ea01,JSON['stringify'](_0x2270d4));_0x7d0869(_0x2270d4);})[_0x0788('0x1a')](function(_0x18cc33){logger[_0x0788('0x16')]('CreateMailMessage',_0x18cc33['message'],_0x11ea01);_0x48bc5f(_0x5173d6[_0x0788('0x16')](0x1f4,_0x18cc33[_0x0788('0x18')]));});});}; \ No newline at end of file +var _0xfef3=['raw','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','body','options'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0xfef3,0x118));var _0x3fef=function(_0x151002,_0x1c9af6){_0x151002=_0x151002-0x0;var _0x1a7a58=_0xfef3[_0x151002];return _0x1a7a58;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});config[_0x3fef('0x9')]=_[_0x3fef('0xa')](config[_0x3fef('0x9')],{'host':_0x3fef('0xb'),'port':0x18eb});var socket=require(_0x3fef('0xc'))(new Redis(config[_0x3fef('0x9')]));require(_0x3fef('0xd'))[_0x3fef('0xe')](socket);function respondWithRpcPromise(_0x307586,_0x67cdd8,_0x16252b){return new BPromise(function(_0x1a7ef7,_0x7cc5b){return client['request'](_0x307586,_0x16252b)[_0x3fef('0xf')](function(_0x3560d9){logger[_0x3fef('0x10')]('MailMessage,\x20%s,\x20%s',_0x67cdd8,_0x3fef('0x11'));logger['debug'](_0x3fef('0x12'),_0x67cdd8,_0x3fef('0x11'),JSON[_0x3fef('0x13')](_0x3560d9));if(_0x3560d9['error']){if(_0x3560d9[_0x3fef('0x14')]['code']===0x1f4){logger[_0x3fef('0x14')](_0x3fef('0x15'),_0x67cdd8,_0x3560d9['error'][_0x3fef('0x16')]);return _0x7cc5b(_0x3560d9[_0x3fef('0x14')][_0x3fef('0x16')]);}logger[_0x3fef('0x14')](_0x3fef('0x15'),_0x67cdd8,_0x3560d9[_0x3fef('0x14')]['message']);return _0x1a7ef7(_0x3560d9[_0x3fef('0x14')][_0x3fef('0x16')]);}else{logger[_0x3fef('0x10')](_0x3fef('0x15'),_0x67cdd8,_0x3fef('0x11'));_0x1a7ef7(_0x3560d9[_0x3fef('0x17')]['message']);}})[_0x3fef('0x18')](function(_0x3eb287){logger['error'](_0x3fef('0x15'),_0x67cdd8,_0x3eb287);_0x7cc5b(_0x3eb287);});});}exports[_0x3fef('0x19')]=function(_0x42e095){var _0x218f91=this;return new Promise(function(_0x245332,_0x2b5226){return db[_0x3fef('0x1a')][_0x3fef('0x1b')](_0x42e095[_0x3fef('0x1c')],{'raw':_0x42e095[_0x3fef('0x1d')]?_0x42e095[_0x3fef('0x1d')][_0x3fef('0x1e')]===undefined?!![]:![]:!![]})[_0x3fef('0xf')](function(_0x39a8ea){logger[_0x3fef('0x10')]('CreateMailMessage',_0x42e095);logger['debug']('CreateMailMessage',_0x42e095,JSON[_0x3fef('0x13')](_0x39a8ea));_0x245332(_0x39a8ea);})[_0x3fef('0x18')](function(_0xa16dc){logger['error'](_0x3fef('0x19'),_0xa16dc['message'],_0x42e095);_0x2b5226(_0x218f91[_0x3fef('0x14')](0x1f4,_0xa16dc[_0x3fef('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 7ee5cd4..45eaf30 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 _0x4862=['removeListener','length','./mailMessage.events','remove','update'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4862,0x129));var _0x2486=function(_0x401a4d,_0x4bb835){_0x401a4d=_0x401a4d-0x0;var _0x1faaff=_0x4862[_0x401a4d];return _0x1faaff;};'use strict';var MailMessageEvents=require(_0x2486('0x0'));var events=['save',_0x2486('0x1'),_0x2486('0x2')];function createListener(_0x29ca2e,_0x598e5e){return function(_0x37a398){_0x598e5e['emit'](_0x29ca2e,_0x37a398);};}function removeListener(_0x4de75c,_0x211669){return function(){MailMessageEvents[_0x2486('0x3')](_0x4de75c,_0x211669);};}exports['register']=function(_0x249414){for(var _0x571ca2=0x0,_0xc39ab1=events[_0x2486('0x4')];_0x571ca2<_0xc39ab1;_0x571ca2++){var _0x1eadb2=events[_0x571ca2];var _0x460bdf=createListener('mailMessage:'+_0x1eadb2,_0x249414);MailMessageEvents['on'](_0x1eadb2,_0x460bdf);}}; \ No newline at end of file +var _0xd21f=['length','mailMessage:','./mailMessage.events','save','remove','emit','register'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0xd21f,0x175));var _0xfd21=function(_0x2df413,_0x5303ae){_0x2df413=_0x2df413-0x0;var _0x1f5133=_0xd21f[_0x2df413];return _0x1f5133;};'use strict';var MailMessageEvents=require(_0xfd21('0x0'));var events=[_0xfd21('0x1'),_0xfd21('0x2'),'update'];function createListener(_0x19f891,_0x33c8e7){return function(_0x4df845){_0x33c8e7[_0xfd21('0x3')](_0x19f891,_0x4df845);};}function removeListener(_0x4e6d7d,_0xf3bf26){return function(){MailMessageEvents['removeListener'](_0x4e6d7d,_0xf3bf26);};}exports[_0xfd21('0x4')]=function(_0x3ecd51){for(var _0x45cec4=0x0,_0x3483a3=events[_0xfd21('0x5')];_0x45cec4<_0x3483a3;_0x45cec4++){var _0x2d57a9=events[_0x45cec4];var _0x27e47b=createListener(_0xfd21('0x6')+_0x2d57a9,_0x3ecd51);MailMessageEvents['on'](_0x2d57a9,_0x27e47b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b4ecb9f..508b787 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 _0x7596=['getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/:id','isAuthenticated','/:id/members'];(function(_0x1eced4,_0xc5070f){var _0x1a91e5=function(_0xcc3a6c){while(--_0xcc3a6c){_0x1eced4['push'](_0x1eced4['shift']());}};_0x1a91e5(++_0xc5070f);}(_0x7596,0x15f));var _0x6759=function(_0x1671c7,_0x36f775){_0x1671c7=_0x1671c7-0x0;var _0x160b76=_0x7596[_0x1671c7];return _0x160b76;};'use strict';var multer=require(_0x6759('0x0'));var util=require('util');var path=require(_0x6759('0x1'));var timeout=require(_0x6759('0x2'));var express=require(_0x6759('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6759('0x4'));var interaction=require(_0x6759('0x5'));var config=require(_0x6759('0x6'));var controller=require(_0x6759('0x7'));router[_0x6759('0x8')]('/',auth['isAuthenticated'](),controller[_0x6759('0x9')]);router[_0x6759('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6759('0x8')](_0x6759('0xa'),auth[_0x6759('0xb')](),controller['show']);router['get'](_0x6759('0xc'),auth['isAuthenticated'](),controller[_0x6759('0xd')]);router[_0x6759('0x8')](_0x6759('0xe'),auth[_0x6759('0xb')](),controller[_0x6759('0xf')]);router[_0x6759('0x8')]('/:id/users',auth[_0x6759('0xb')](),controller[_0x6759('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6759('0x11')](_0x6759('0xe'),auth[_0x6759('0xb')](),controller[_0x6759('0x12')]);router[_0x6759('0x11')](_0x6759('0x13'),auth['isAuthenticated'](),controller[_0x6759('0x14')]);router[_0x6759('0x15')](_0x6759('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x6759('0x16')](_0x6759('0xa'),auth[_0x6759('0xb')](),controller['destroy']);router['delete'](_0x6759('0xe'),auth[_0x6759('0xb')](),controller[_0x6759('0x17')]);router[_0x6759('0x16')](_0x6759('0x13'),auth['isAuthenticated'](),controller[_0x6759('0x18')]);module[_0x6759('0x19')]=router; \ No newline at end of file +var _0x05c4=['getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0xb5e13f,_0x144237){var _0x12df97=function(_0x193184){while(--_0x193184){_0xb5e13f['push'](_0xb5e13f['shift']());}};_0x12df97(++_0x144237);}(_0x05c4,0x1ca));var _0x405c=function(_0x11fb70,_0x20e8e2){_0x11fb70=_0x11fb70-0x0;var _0x27500b=_0x05c4[_0x11fb70];return _0x27500b;};'use strict';var multer=require(_0x405c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x405c('0x1'));var express=require(_0x405c('0x2'));var router=express[_0x405c('0x3')]();var fs_extra=require(_0x405c('0x4'));var auth=require(_0x405c('0x5'));var interaction=require(_0x405c('0x6'));var config=require(_0x405c('0x7'));var controller=require(_0x405c('0x8'));router[_0x405c('0x9')]('/',auth[_0x405c('0xa')](),controller['index']);router[_0x405c('0x9')](_0x405c('0xb'),auth[_0x405c('0xa')](),controller[_0x405c('0xc')]);router[_0x405c('0x9')](_0x405c('0xd'),auth[_0x405c('0xa')](),controller['show']);router['get'](_0x405c('0xe'),auth[_0x405c('0xa')](),controller['getMembers']);router[_0x405c('0x9')](_0x405c('0xf'),auth[_0x405c('0xa')](),controller[_0x405c('0x10')]);router[_0x405c('0x9')](_0x405c('0x11'),auth['isAuthenticated'](),controller[_0x405c('0x12')]);router[_0x405c('0x13')]('/',auth[_0x405c('0xa')](),controller[_0x405c('0x14')]);router[_0x405c('0x13')](_0x405c('0xf'),auth[_0x405c('0xa')](),controller['addTeams']);router[_0x405c('0x13')](_0x405c('0x11'),auth['isAuthenticated'](),controller[_0x405c('0x15')]);router[_0x405c('0x16')](_0x405c('0xd'),auth[_0x405c('0xa')](),controller[_0x405c('0x17')]);router['delete']('/:id',auth[_0x405c('0xa')](),controller[_0x405c('0x18')]);router[_0x405c('0x19')](_0x405c('0xf'),auth[_0x405c('0xa')](),controller['removeTeams']);router[_0x405c('0x19')]('/:id/users',auth[_0x405c('0xa')](),controller[_0x405c('0x1a')]);module[_0x405c('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 5b039b9..646489b 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 _0x448f=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x3e4516,_0x37dec7){var _0x1ca3d4=function(_0x388cd6){while(--_0x388cd6){_0x3e4516['push'](_0x3e4516['shift']());}};_0x1ca3d4(++_0x37dec7);}(_0x448f,0x66));var _0xf448=function(_0x27c25b,_0x1b78c3){_0x27c25b=_0x27c25b-0x0;var _0x240519=_0x448f[_0x27c25b];return _0x240519;};'use strict';var Sequelize=require(_0xf448('0x0'));module[_0xf448('0x1')]={'name':{'type':Sequelize[_0xf448('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf448('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf448('0x4')](_0xf448('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x70ea=['ENUM','rrmemory','roundrobin','STRING','name','INTEGER'];(function(_0x114dbf,_0x3dd101){var _0x5953c9=function(_0x39aeb0){while(--_0x39aeb0){_0x114dbf['push'](_0x114dbf['shift']());}};_0x5953c9(++_0x3dd101);}(_0x70ea,0x1d7));var _0xa70e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x70ea[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa70e('0x0')],'unique':_0xa70e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa70e('0x0')]},'timeout':{'type':Sequelize[_0xa70e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa70e('0x3')](_0xa70e('0x4'),'beepall',_0xa70e('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a98c575..8c4e73e 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 _0x8b30=['TeamId','includes','all','union','compact','value','transaction','isEmpty','userMailQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','MailQueueId','UserMailQueue','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','mailPause','getTeams','hasOwnProperty','addTeams','Team','Agents','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString'];(function(_0x235e52,_0x5293b0){var _0xa089f9=function(_0x5b2466){while(--_0x5b2466){_0x235e52['push'](_0x235e52['shift']());}};_0xa089f9(++_0x5293b0);}(_0x8b30,0x1c7));var _0x08b3=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x8b30[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0x08b3('0x0'));var rimraf=require(_0x08b3('0x1'));var zipdir=require(_0x08b3('0x2'));var jsonpatch=require(_0x08b3('0x3'));var rp=require(_0x08b3('0x4'));var moment=require(_0x08b3('0x5'));var BPromise=require(_0x08b3('0x6'));var Mustache=require(_0x08b3('0x7'));var util=require(_0x08b3('0x8'));var path=require(_0x08b3('0x9'));var sox=require(_0x08b3('0xa'));var csv=require(_0x08b3('0xb'));var ejs=require(_0x08b3('0xc'));var fs=require('fs');var fs_extra=require(_0x08b3('0xd'));var _=require('lodash');var squel=require(_0x08b3('0xe'));var crypto=require(_0x08b3('0xf'));var jsforce=require(_0x08b3('0x10'));var deskjs=require(_0x08b3('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x08b3('0x12'));var Redis=require(_0x08b3('0x13'));var authService=require(_0x08b3('0x14'));var qs=require(_0x08b3('0x15'));var as=require(_0x08b3('0x16'));var hardwareService=require(_0x08b3('0x17'));var logger=require(_0x08b3('0x18'))('api');var utils=require(_0x08b3('0x19'));var config=require(_0x08b3('0x1a'));var licenseUtil=require(_0x08b3('0x1b'));var db=require('../../mysqldb')['db'];config[_0x08b3('0x1c')]=_[_0x08b3('0x1d')](config[_0x08b3('0x1c')],{'host':_0x08b3('0x1e'),'port':0x18eb});var socket=require(_0x08b3('0x1f'))(new Redis(config[_0x08b3('0x1c')]));require('./mailQueue.socket')[_0x08b3('0x20')](socket);function respondWithStatusCode(_0x33789b,_0x383e85){_0x383e85=_0x383e85||0xcc;return function(_0x241a78){if(_0x241a78){return _0x33789b['sendStatus'](_0x383e85);}return _0x33789b['status'](_0x383e85)[_0x08b3('0x21')]();};}function respondWithResult(_0x757469,_0x15e4c7){_0x15e4c7=_0x15e4c7||0xc8;return function(_0xe12877){if(_0xe12877){return _0x757469[_0x08b3('0x22')](_0x15e4c7)[_0x08b3('0x23')](_0xe12877);}};}function respondWithFilteredResult(_0x46cd25,_0x2fe7cc){return function(_0x533ff0){if(_0x533ff0){var _0x2e7a56=typeof _0x2fe7cc[_0x08b3('0x24')]===_0x08b3('0x25')&&typeof _0x2fe7cc[_0x08b3('0x26')]===_0x08b3('0x25');var _0x3b3053=_0x533ff0[_0x08b3('0x27')];var _0x1ae857=_0x2e7a56?0x0:_0x2fe7cc[_0x08b3('0x24')];var _0x5c5704=_0x2e7a56?_0x533ff0[_0x08b3('0x27')]:_0x2fe7cc['offset']+_0x2fe7cc['limit'];var _0x41a850;if(_0x5c5704>=_0x3b3053){_0x5c5704=_0x3b3053;_0x41a850=0xc8;}else{_0x41a850=0xce;}_0x46cd25[_0x08b3('0x22')](_0x41a850);return _0x46cd25['set']('Content-Range',_0x1ae857+'-'+_0x5c5704+'/'+_0x3b3053)['json'](_0x533ff0);}return null;};}function patchUpdates(_0x464c23){return function(_0x2407b5){try{jsonpatch[_0x08b3('0x28')](_0x2407b5,_0x464c23,!![]);}catch(_0xa8e0fc){return BPromise[_0x08b3('0x29')](_0xa8e0fc);}return _0x2407b5[_0x08b3('0x2a')]();};}function saveUpdates(_0x155fd7,_0x15e584){return function(_0x33e94d){if(_0x33e94d){return _0x33e94d[_0x08b3('0x2b')](_0x155fd7)[_0x08b3('0x2c')](function(_0x1c11da){return _0x1c11da;});}return null;};}function removeEntity(_0x71718d,_0x13d9c5){return function(_0x73b6a){if(_0x73b6a){return _0x73b6a[_0x08b3('0x2d')]()[_0x08b3('0x2c')](function(){var _0x2db265=_0x73b6a[_0x08b3('0x2e')]({'plain':!![]});var _0x478cc2=_0x08b3('0x2f');return db[_0x08b3('0x30')][_0x08b3('0x2d')]({'where':{'type':_0x478cc2,'resourceId':_0x2db265['id']}})['then'](function(){return _0x73b6a;});})[_0x08b3('0x2c')](function(){_0x71718d[_0x08b3('0x22')](0xcc)[_0x08b3('0x21')]();});}};}function handleEntityNotFound(_0x360ed4,_0x5dc81a){return function(_0x21bd28){if(!_0x21bd28){_0x360ed4[_0x08b3('0x31')](0x194);}return _0x21bd28;};}function handleError(_0x331fc4,_0x43dc44){_0x43dc44=_0x43dc44||0x1f4;return function(_0x4e2732){logger[_0x08b3('0x32')](_0x4e2732[_0x08b3('0x33')]);if(_0x4e2732[_0x08b3('0x34')]){delete _0x4e2732['name'];}_0x331fc4['status'](_0x43dc44)[_0x08b3('0x35')](_0x4e2732);};}exports[_0x08b3('0x36')]=function(_0x408f9a,_0x5189d9){var _0x39941c={},_0x34f528={},_0x4bb25f={'count':0x0,'rows':[]};var _0x53d687=_[_0x08b3('0x37')](db['MailQueue'][_0x08b3('0x38')],function(_0x2624ed){return{'name':_0x2624ed[_0x08b3('0x39')],'type':_0x2624ed[_0x08b3('0x3a')][_0x08b3('0x3b')]};});_0x34f528[_0x08b3('0x3c')]=_[_0x08b3('0x37')](_0x53d687,_0x08b3('0x34'));_0x34f528[_0x08b3('0x3d')]=_['keys'](_0x408f9a['query']);_0x34f528[_0x08b3('0x3e')]=_[_0x08b3('0x3f')](_0x34f528[_0x08b3('0x3c')],_0x34f528[_0x08b3('0x3d')]);_0x39941c[_0x08b3('0x40')]=_[_0x08b3('0x3f')](_0x34f528[_0x08b3('0x3c')],qs['fields'](_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x41')]));_0x39941c[_0x08b3('0x40')]=_0x39941c[_0x08b3('0x40')][_0x08b3('0x42')]?_0x39941c[_0x08b3('0x40')]:_0x34f528[_0x08b3('0x3c')];if(!_0x408f9a[_0x08b3('0x3d')]['hasOwnProperty'](_0x08b3('0x43'))){_0x39941c[_0x08b3('0x26')]=qs['limit'](_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x26')]);_0x39941c['offset']=qs[_0x08b3('0x24')](_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x24')]);}_0x39941c[_0x08b3('0x44')]=qs[_0x08b3('0x45')](_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x45')]);_0x39941c[_0x08b3('0x46')]=qs['filters'](_[_0x08b3('0x47')](_0x408f9a[_0x08b3('0x3d')],_0x34f528[_0x08b3('0x3e')]),_0x53d687);if(_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x48')]){_0x39941c[_0x08b3('0x46')]=_[_0x08b3('0x49')](_0x39941c[_0x08b3('0x46')],{'$or':_[_0x08b3('0x37')](_0x53d687,function(_0x1350be){if(_0x1350be['type']!==_0x08b3('0x4a')){var _0x5c943c={};_0x5c943c[_0x1350be[_0x08b3('0x34')]]={'$like':'%'+_0x408f9a['query']['filter']+'%'};return _0x5c943c;}})});}_0x39941c=_[_0x08b3('0x49')]({},_0x39941c,_0x408f9a[_0x08b3('0x4b')]);var _0x1e10d9={'where':_0x39941c[_0x08b3('0x46')]};return db[_0x08b3('0x4c')][_0x08b3('0x27')](_0x1e10d9)[_0x08b3('0x2c')](function(_0x272af1){_0x4bb25f[_0x08b3('0x27')]=_0x272af1;if(_0x408f9a[_0x08b3('0x3d')][_0x08b3('0x4d')]){_0x39941c['include']=[{'all':!![]}];}return db[_0x08b3('0x4c')][_0x08b3('0x4e')](_0x39941c);})[_0x08b3('0x2c')](function(_0x2847fa){_0x4bb25f[_0x08b3('0x4f')]=_0x2847fa;return _0x4bb25f;})[_0x08b3('0x2c')](respondWithFilteredResult(_0x5189d9,_0x39941c))[_0x08b3('0x50')](handleError(_0x5189d9,null));};exports[_0x08b3('0x51')]=function(_0x187040,_0x16303e){var _0x2402ae={'raw':!![],'where':{'id':_0x187040[_0x08b3('0x52')]['id']}},_0x35a3fc={};_0x35a3fc[_0x08b3('0x3c')]=_[_0x08b3('0x53')](db[_0x08b3('0x4c')]['rawAttributes']);_0x35a3fc['query']=_[_0x08b3('0x53')](_0x187040[_0x08b3('0x3d')]);_0x35a3fc[_0x08b3('0x3e')]=_['intersection'](_0x35a3fc[_0x08b3('0x3c')],_0x35a3fc[_0x08b3('0x3d')]);_0x2402ae[_0x08b3('0x40')]=_[_0x08b3('0x3f')](_0x35a3fc[_0x08b3('0x3c')],qs[_0x08b3('0x41')](_0x187040[_0x08b3('0x3d')]['fields']));_0x2402ae['attributes']=_0x2402ae[_0x08b3('0x40')][_0x08b3('0x42')]?_0x2402ae[_0x08b3('0x40')]:_0x35a3fc[_0x08b3('0x3c')];if(_0x187040['query'][_0x08b3('0x4d')]){_0x2402ae[_0x08b3('0x54')]=[{'all':!![]}];}_0x2402ae=_[_0x08b3('0x49')]({},_0x2402ae,_0x187040[_0x08b3('0x4b')]);return db[_0x08b3('0x4c')][_0x08b3('0x55')](_0x2402ae)[_0x08b3('0x2c')](handleEntityNotFound(_0x16303e,null))[_0x08b3('0x2c')](respondWithResult(_0x16303e,null))[_0x08b3('0x50')](handleError(_0x16303e,null));};exports[_0x08b3('0x56')]=function(_0x4df33f,_0x463572){return db['MailQueue'][_0x08b3('0x56')](_0x4df33f[_0x08b3('0x57')],{})[_0x08b3('0x2c')](function(_0x41cecf){var _0x19cc34=_0x4df33f[_0x08b3('0x58')][_0x08b3('0x2e')]({'plain':!![]});if(!_0x19cc34)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19cc34[_0x08b3('0x59')]===_0x08b3('0x58')){var _0x253e6f=_0x41cecf['get']({'plain':!![]});var _0x1282c5=_0x08b3('0x2f');return db[_0x08b3('0x5a')][_0x08b3('0x55')]({'where':{'name':_0x1282c5,'userProfileId':_0x19cc34[_0x08b3('0x5b')]},'raw':!![]})[_0x08b3('0x2c')](function(_0x54044d){if(_0x54044d&&_0x54044d[_0x08b3('0x5c')]===0x0){return db[_0x08b3('0x30')][_0x08b3('0x56')]({'name':_0x253e6f[_0x08b3('0x34')],'resourceId':_0x253e6f['id'],'type':_0x54044d[_0x08b3('0x34')],'sectionId':_0x54044d['id']},{})['then'](function(){return _0x41cecf;});}else{return _0x41cecf;}})[_0x08b3('0x50')](function(_0x15d4cf){logger[_0x08b3('0x32')](_0x08b3('0x5d'),_0x15d4cf);throw _0x15d4cf;});}return _0x41cecf;})[_0x08b3('0x2c')](respondWithResult(_0x463572,0xc9))[_0x08b3('0x50')](handleError(_0x463572,null));};exports[_0x08b3('0x2b')]=function(_0x4582a9,_0x1e0929){if(_0x4582a9['body']['id']){delete _0x4582a9['body']['id'];}return db[_0x08b3('0x4c')][_0x08b3('0x55')]({'where':{'id':_0x4582a9[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x1e0929,null))[_0x08b3('0x2c')](saveUpdates(_0x4582a9[_0x08b3('0x57')],null))[_0x08b3('0x2c')](respondWithResult(_0x1e0929,null))[_0x08b3('0x50')](handleError(_0x1e0929,null));};exports[_0x08b3('0x2d')]=function(_0x6b847d,_0x47e85a){return db[_0x08b3('0x4c')][_0x08b3('0x55')]({'where':{'id':_0x6b847d[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x47e85a,null))[_0x08b3('0x2c')](removeEntity(_0x47e85a,null))[_0x08b3('0x50')](handleError(_0x47e85a,null));};exports['describe']=function(_0x2a3ae5,_0x3678d5){return db['MailQueue'][_0x08b3('0x5e')]()['then'](respondWithResult(_0x3678d5,null))[_0x08b3('0x50')](handleError(_0x3678d5,null));};exports[_0x08b3('0x5f')]=function(_0x1eccf5,_0x58fb3e,_0x226af1){var _0x3b53c8={'raw':!![],'where':{}},_0xed9581={},_0x9f68df;return db[_0x08b3('0x4c')][_0x08b3('0x60')]({'where':{'id':_0x1eccf5[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x58fb3e,null))[_0x08b3('0x2c')](function(_0xf40873){if(_0xf40873){_0x9f68df=_0xf40873[_0x08b3('0x2e')]({'plain':!![]});_0xed9581['model']=_[_0x08b3('0x53')](db['UserMailQueue']['rawAttributes']);_0xed9581[_0x08b3('0x3d')]=_['keys'](_0x1eccf5[_0x08b3('0x3d')]);_0xed9581['filters']=_['intersection'](_0xed9581[_0x08b3('0x3c')],_0xed9581[_0x08b3('0x3d')]);_0x3b53c8['attributes']=_[_0x08b3('0x3f')](_0xed9581[_0x08b3('0x3c')],qs[_0x08b3('0x41')](_0x1eccf5[_0x08b3('0x3d')][_0x08b3('0x41')]));_0x3b53c8[_0x08b3('0x40')]=_0x3b53c8[_0x08b3('0x40')][_0x08b3('0x42')]?_0x3b53c8['attributes']:_0xed9581['model'];if(!_0x1eccf5[_0x08b3('0x3d')]['hasOwnProperty'](_0x08b3('0x43'))){_0x3b53c8[_0x08b3('0x26')]=qs[_0x08b3('0x26')](_0x1eccf5[_0x08b3('0x3d')]['limit']);_0x3b53c8[_0x08b3('0x24')]=qs[_0x08b3('0x24')](_0x1eccf5['query'][_0x08b3('0x24')]);}_0x3b53c8['order']=qs[_0x08b3('0x45')](_0x1eccf5['query'][_0x08b3('0x45')]);_0x3b53c8[_0x08b3('0x46')]=qs[_0x08b3('0x3e')](_['pick'](_0x1eccf5[_0x08b3('0x3d')],_0xed9581[_0x08b3('0x3e')]));_0x3b53c8['where'][_0x08b3('0x61')]=_0xf40873['id'];if(_0x1eccf5[_0x08b3('0x3d')][_0x08b3('0x48')]){_0x3b53c8[_0x08b3('0x46')]=_[_0x08b3('0x49')](_0x3b53c8[_0x08b3('0x46')],{'$or':_[_0x08b3('0x37')](_0x3b53c8[_0x08b3('0x40')],function(_0x36c87b){var _0x28def8={};_0x28def8[_0x36c87b]={'$like':'%'+_0x1eccf5[_0x08b3('0x3d')][_0x08b3('0x48')]+'%'};return _0x28def8;})});}_0x3b53c8=_['merge']({},_0x3b53c8,_0x1eccf5[_0x08b3('0x4b')]);return db[_0x08b3('0x62')][_0x08b3('0x4e')](_0x3b53c8);}})[_0x08b3('0x2c')](function(_0x1999a5){if(_0x1999a5){return db[_0x08b3('0x63')]['findAndCountAll']({'where':{'id':_[_0x08b3('0x37')](_0x1999a5,_0x08b3('0x64')),'role':_0x08b3('0x65')},'attributes':['id',_0x08b3('0x34'),'mailPause',_0x08b3('0x66'),_0x08b3('0x67')]});}})[_0x08b3('0x2c')](function(_0x5f4922){if(_0x5f4922){return{'count':_0x5f4922[_0x08b3('0x27')],'rows':_['map'](_0x5f4922[_0x08b3('0x4f')],function(_0x5bb5bf){return{'membername':_0x5bb5bf[_0x08b3('0x34')],'UserId':_0x5bb5bf['id'],'queue_name':_0x9f68df['name'],'MailQueueId':_0x9f68df['id'],'interface':util['format'](_0x08b3('0x68'),_0x08b3('0x69'),_0x5bb5bf[_0x08b3('0x34')]),'penalty':0x0,'paused':_0x5bb5bf[_0x08b3('0x6a')],'createdAt':_0x5bb5bf[_0x08b3('0x67')],'updatedAt':_0x5bb5bf[_0x08b3('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x08b3('0x2c')](respondWithFilteredResult(_0x58fb3e,_0x3b53c8))[_0x08b3('0x50')](handleError(_0x58fb3e,null));};exports[_0x08b3('0x6b')]=function(_0x4d7453,_0x28fbb7,_0x1acab2){var _0x358bb5={};var _0x145289={};var _0x5e9933;var _0x1eb86a;return db[_0x08b3('0x4c')][_0x08b3('0x60')]({'where':{'id':_0x4d7453[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x28fbb7,null))['then'](function(_0xba5dbe){if(_0xba5dbe){_0x5e9933=_0xba5dbe;_0x145289[_0x08b3('0x3c')]=_[_0x08b3('0x53')](db['Team'][_0x08b3('0x38')]);_0x145289[_0x08b3('0x3d')]=_[_0x08b3('0x53')](_0x4d7453[_0x08b3('0x3d')]);_0x145289[_0x08b3('0x3e')]=_['intersection'](_0x145289[_0x08b3('0x3c')],_0x145289[_0x08b3('0x3d')]);_0x358bb5[_0x08b3('0x40')]=_[_0x08b3('0x3f')](_0x145289['model'],qs[_0x08b3('0x41')](_0x4d7453[_0x08b3('0x3d')][_0x08b3('0x41')]));_0x358bb5[_0x08b3('0x40')]=_0x358bb5[_0x08b3('0x40')][_0x08b3('0x42')]?_0x358bb5['attributes']:_0x145289[_0x08b3('0x3c')];_0x358bb5[_0x08b3('0x44')]=qs[_0x08b3('0x45')](_0x4d7453[_0x08b3('0x3d')][_0x08b3('0x45')]);_0x358bb5[_0x08b3('0x46')]=qs[_0x08b3('0x3e')](_[_0x08b3('0x47')](_0x4d7453[_0x08b3('0x3d')],_0x145289[_0x08b3('0x3e')]));if(_0x4d7453[_0x08b3('0x3d')]['filter']){_0x358bb5['where']=_[_0x08b3('0x49')](_0x358bb5[_0x08b3('0x46')],{'$or':_['map'](_0x358bb5[_0x08b3('0x40')],function(_0x38335b){var _0x29a553={};_0x29a553[_0x38335b]={'$like':'%'+_0x4d7453[_0x08b3('0x3d')][_0x08b3('0x48')]+'%'};return _0x29a553;})});}_0x358bb5=_[_0x08b3('0x49')]({},_0x358bb5,_0x4d7453[_0x08b3('0x4b')]);return _0x5e9933[_0x08b3('0x6b')](_0x358bb5);}})['then'](function(_0xe55d5d){if(_0xe55d5d){_0x1eb86a=_0xe55d5d[_0x08b3('0x42')];if(!_0x4d7453[_0x08b3('0x3d')][_0x08b3('0x6c')]('nolimit')){_0x358bb5[_0x08b3('0x26')]=qs[_0x08b3('0x26')](_0x4d7453[_0x08b3('0x3d')][_0x08b3('0x26')]);_0x358bb5[_0x08b3('0x24')]=qs[_0x08b3('0x24')](_0x4d7453['query'][_0x08b3('0x24')]);}return _0x5e9933[_0x08b3('0x6b')](_0x358bb5);}})['then'](function(_0x3fabdd){if(_0x3fabdd){return _0x3fabdd?{'count':_0x1eb86a,'rows':_0x3fabdd}:null;}})[_0x08b3('0x2c')](respondWithResult(_0x28fbb7,null))[_0x08b3('0x50')](handleError(_0x28fbb7,null));};exports[_0x08b3('0x6d')]=function(_0xeaf2e4,_0x6c7674,_0x1a80af){var _0x317fc3=_0xeaf2e4[_0x08b3('0x57')]['ids'];return db[_0x08b3('0x6e')][_0x08b3('0x4e')]({'where':{'id':_0x317fc3},'attributes':['id'],'include':[{'model':db[_0x08b3('0x63')],'as':_0x08b3('0x6f'),'attributes':['id',_0x08b3('0x34'),'online',_0x08b3('0x70'),_0x08b3('0x71')],'raw':!![]}]})[_0x08b3('0x2c')](function(_0x32a4e3){if(_0x32a4e3){var _0x59da3d=_[_0x08b3('0x72')](_0x32a4e3,function(_0x1db13d){var _0x519bd1=_0x1db13d[_0x08b3('0x2e')]({'plain':!![]});return _0x519bd1['Agents'];});return db[_0x08b3('0x4c')][_0x08b3('0x55')]({'where':{'id':_0xeaf2e4['params']['id']}})[_0x08b3('0x2c')](function(_0x5f1e7b){return db['sequelize']['transaction'](function(_0x544504){return _0x5f1e7b[_0x08b3('0x6d')](_0x317fc3,{'transaction':_0x544504})[_0x08b3('0x2c')](function(){return BPromise[_0x08b3('0x73')](_0x59da3d,function(_0x4de3ad){return db[_0x08b3('0x62')][_0x08b3('0x74')]({'where':{'UserId':_0x4de3ad['id'],'MailQueueId':_0xeaf2e4[_0x08b3('0x52')]['id']},'transaction':_0x544504});});})[_0x08b3('0x2c')](function(){_0x59da3d[_0x08b3('0x75')](function(_0x1fe17e){socket[_0x08b3('0x76')](_0x08b3('0x77'),{'UserId':_0x1fe17e['id'],'MailQueueId':_0x5f1e7b['id']});});});});});}})['then'](respondWithStatusCode(_0x6c7674,null))['catch'](handleError(_0x6c7674,null));};exports[_0x08b3('0x78')]=function(_0x1dd4ee,_0x4d3925,_0x5edf04){return db[_0x08b3('0x6e')]['findAll']({'where':{'id':_0x1dd4ee[_0x08b3('0x3d')][_0x08b3('0x79')]},'attributes':['id'],'include':[{'model':db[_0x08b3('0x63')],'as':_0x08b3('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x08b3('0x2c')](handleEntityNotFound(_0x4d3925,null))[_0x08b3('0x2c')](function(_0x3e1be6){var _0x2045c7=_['map'](_0x3e1be6,'id');var _0x23e3f9=[];var _0x5b3433=[];var _0x266c48=squel['select']();_0x266c48[_0x08b3('0x7a')]('tq.TeamId')[_0x08b3('0x7b')](_0x08b3('0x7c'),'tq')[_0x08b3('0x7d')](_0x08b3('0x7e'),'ut',_0x08b3('0x7f'))['where'](_0x08b3('0x80'),_0x1dd4ee[_0x08b3('0x52')]['id']);for(var _0x3ed493=0x0;_0x3ed493<_0x3e1be6[_0x08b3('0x42')];_0x3ed493+=0x1){let _0x132cc9=_0x3e1be6[_0x3ed493];for(var _0x125ed4=0x0;_0x125ed4<_0x132cc9[_0x08b3('0x6f')]['length'];_0x125ed4+=0x1){let _0x4c5fd0=_0x132cc9[_0x08b3('0x6f')][_0x125ed4];var _0xe1c996=_0x266c48[_0x08b3('0x81')]();_0xe1c996['where'](_0x08b3('0x82'),_0x4c5fd0['id']);_0x5b3433[_0x08b3('0x83')](db['sequelize'][_0x08b3('0x3d')](_0xe1c996[_0x08b3('0x84')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x08b3('0x2c')](function(_0x45081e){if(_0x45081e['length']===0x1){return _0x4c5fd0['id'];}else{var _0x304b58=_['every'](_[_0x08b3('0x37')](_0x45081e,_0x08b3('0x85')),function(_0x206d67){return _[_0x08b3('0x86')](_0x2045c7,_0x206d67);});if(_0x304b58){return _0x4c5fd0['id'];}}}));}}return BPromise[_0x08b3('0x87')](_0x5b3433)[_0x08b3('0x2c')](function(_0x245136){_0x23e3f9=_(_0x23e3f9)[_0x08b3('0x88')](_0x245136)[_0x08b3('0x89')]()[_0x08b3('0x8a')]();return db[_0x08b3('0x4c')][_0x08b3('0x55')]({'where':{'id':_0x1dd4ee[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](function(_0x1338f2){return db['sequelize'][_0x08b3('0x8b')](function(_0x8d6f52){return _0x1338f2['removeTeams'](_0x1dd4ee['query'][_0x08b3('0x79')],{'transaction':_0x8d6f52})[_0x08b3('0x2c')](function(){if(!_[_0x08b3('0x8c')](_0x23e3f9)){return _0x1338f2['removeAgents'](_0x23e3f9,{'transaction':_0x8d6f52});}})[_0x08b3('0x2c')](function(){_0x23e3f9[_0x08b3('0x75')](function(_0x227ea3){socket['emit'](_0x08b3('0x8d'),{'UserId':_0x227ea3,'MailQueueId':_0x1338f2['id']});});});});});});})[_0x08b3('0x2c')](respondWithStatusCode(_0x4d3925,null))[_0x08b3('0x50')](handleError(_0x4d3925,null));};exports['addAgents']=function(_0x1e62c6,_0x823b19,_0x3b3e2e){return db['MailQueue'][_0x08b3('0x55')]({'where':{'id':_0x1e62c6['params']['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x823b19,null))['then'](function(_0x2748ec){if(_0x2748ec){return _0x2748ec[_0x08b3('0x8e')](_0x1e62c6[_0x08b3('0x57')][_0x08b3('0x79')],_['omit'](_0x1e62c6[_0x08b3('0x57')],[_0x08b3('0x79'),'id'])||{})[_0x08b3('0x8f')](function(_0x50fc9e){for(var _0x456017=0x0;_0x456017<_0x1e62c6['body'][_0x08b3('0x79')]['length'];_0x456017+=0x1){socket[_0x08b3('0x76')]('userMailQueue:save',{'UserId':Number(_0x1e62c6['body'][_0x08b3('0x79')][_0x456017]),'MailQueueId':Number(_0x1e62c6['params']['id'])});}return _0x50fc9e;});}})[_0x08b3('0x2c')](respondWithResult(_0x823b19,null))[_0x08b3('0x50')](handleError(_0x823b19,null));};exports[_0x08b3('0x90')]=function(_0x22990a,_0x3c3741,_0x233951){return db['MailQueue'][_0x08b3('0x55')]({'where':{'id':_0x22990a[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x3c3741,null))[_0x08b3('0x2c')](function(_0x890d0){if(_0x890d0){return _0x890d0[_0x08b3('0x90')](_0x22990a[_0x08b3('0x3d')][_0x08b3('0x79')])[_0x08b3('0x2c')](function(){if(_[_0x08b3('0x91')](_0x22990a['query'][_0x08b3('0x79')])){for(var _0x4eb7b5=0x0;_0x4eb7b5<_0x22990a['query'][_0x08b3('0x79')][_0x08b3('0x42')];_0x4eb7b5+=0x1){socket[_0x08b3('0x76')](_0x08b3('0x8d'),{'UserId':Number(_0x22990a[_0x08b3('0x3d')][_0x08b3('0x79')][_0x4eb7b5]),'MailQueueId':Number(_0x22990a[_0x08b3('0x52')]['id'])});}}else{socket[_0x08b3('0x76')]('userMailQueue:remove',{'UserId':Number(_0x22990a[_0x08b3('0x3d')][_0x08b3('0x79')]),'MailQueueId':Number(_0x22990a[_0x08b3('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c3741,null))[_0x08b3('0x50')](handleError(_0x3c3741,null));};exports[_0x08b3('0x92')]=function(_0x57b225,_0x1f4de0,_0x1035f2){var _0x361309={};var _0x6ad0b7={};var _0x32181b;var _0x3f8dac;return db[_0x08b3('0x4c')][_0x08b3('0x60')]({'where':{'id':_0x57b225[_0x08b3('0x52')]['id']}})[_0x08b3('0x2c')](handleEntityNotFound(_0x1f4de0,null))[_0x08b3('0x2c')](function(_0x74b828){if(_0x74b828){_0x32181b=_0x74b828;_0x6ad0b7[_0x08b3('0x3c')]=_[_0x08b3('0x53')](db[_0x08b3('0x63')]['rawAttributes']);_0x6ad0b7['query']=_[_0x08b3('0x53')](_0x57b225[_0x08b3('0x3d')]);_0x6ad0b7[_0x08b3('0x3e')]=_[_0x08b3('0x3f')](_0x6ad0b7[_0x08b3('0x3c')],_0x6ad0b7[_0x08b3('0x3d')]);_0x361309[_0x08b3('0x40')]=_[_0x08b3('0x3f')](_0x6ad0b7['model'],qs[_0x08b3('0x41')](_0x57b225[_0x08b3('0x3d')][_0x08b3('0x41')]));_0x361309[_0x08b3('0x40')]=_0x361309[_0x08b3('0x40')][_0x08b3('0x42')]?_0x361309[_0x08b3('0x40')]:_0x6ad0b7['model'];_0x361309['order']=qs[_0x08b3('0x45')](_0x57b225[_0x08b3('0x3d')][_0x08b3('0x45')]);_0x361309[_0x08b3('0x46')]=qs[_0x08b3('0x3e')](_['pick'](_0x57b225[_0x08b3('0x3d')],_0x6ad0b7['filters']));if(_0x57b225[_0x08b3('0x3d')][_0x08b3('0x48')]){_0x361309['where']=_[_0x08b3('0x49')](_0x361309[_0x08b3('0x46')],{'$or':_[_0x08b3('0x37')](_0x361309[_0x08b3('0x40')],function(_0x6d0d8a){var _0xbb1d8a={};_0xbb1d8a[_0x6d0d8a]={'$like':'%'+_0x57b225['query'][_0x08b3('0x48')]+'%'};return _0xbb1d8a;})});}_0x361309=_[_0x08b3('0x49')]({},_0x361309,_0x57b225[_0x08b3('0x4b')]);return _0x32181b[_0x08b3('0x92')](_0x361309);}})[_0x08b3('0x2c')](function(_0x3fd9c0){if(_0x3fd9c0){_0x3f8dac=_0x3fd9c0['length'];if(!_0x57b225['query'][_0x08b3('0x6c')](_0x08b3('0x43'))){_0x361309[_0x08b3('0x26')]=qs['limit'](_0x57b225[_0x08b3('0x3d')][_0x08b3('0x26')]);_0x361309[_0x08b3('0x24')]=qs[_0x08b3('0x24')](_0x57b225[_0x08b3('0x3d')]['offset']);}return _0x32181b[_0x08b3('0x92')](_0x361309);}})['then'](function(_0x5c523e){if(_0x5c523e){return _0x5c523e?{'count':_0x3f8dac,'rows':_0x5c523e}:null;}})['then'](respondWithResult(_0x1f4de0,null))[_0x08b3('0x50')](handleError(_0x1f4de0,null));}; \ No newline at end of file +var _0xaac5=['removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','get','destroy','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','params','keys','find','catch','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','filter','User','findAndCountAll','mailPause','updatedAt','rows','%s/%s','createdAt','getTeams','Team','order','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','emit','userMailQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty'];(function(_0x1cac94,_0x434b70){var _0x1d1983=function(_0x5e95cc){while(--_0x5e95cc){_0x1cac94['push'](_0x1cac94['shift']());}};_0x1d1983(++_0x434b70);}(_0xaac5,0x1b5));var _0x5aac=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xaac5[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5aac('0x0'));var zipdir=require(_0x5aac('0x1'));var jsonpatch=require(_0x5aac('0x2'));var rp=require(_0x5aac('0x3'));var moment=require(_0x5aac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5aac('0x5'));var util=require(_0x5aac('0x6'));var path=require(_0x5aac('0x7'));var sox=require(_0x5aac('0x8'));var csv=require(_0x5aac('0x9'));var ejs=require(_0x5aac('0xa'));var fs=require('fs');var fs_extra=require(_0x5aac('0xb'));var _=require(_0x5aac('0xc'));var squel=require('squel');var crypto=require(_0x5aac('0xd'));var jsforce=require(_0x5aac('0xe'));var deskjs=require(_0x5aac('0xf'));var toCsv=require(_0x5aac('0x9'));var querystring=require(_0x5aac('0x10'));var Papa=require(_0x5aac('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5aac('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5aac('0x13'));var logger=require(_0x5aac('0x14'))(_0x5aac('0x15'));var utils=require(_0x5aac('0x16'));var config=require(_0x5aac('0x17'));var licenseUtil=require(_0x5aac('0x18'));var db=require(_0x5aac('0x19'))['db'];config[_0x5aac('0x1a')]=_['defaults'](config[_0x5aac('0x1a')],{'host':_0x5aac('0x1b'),'port':0x18eb});var socket=require(_0x5aac('0x1c'))(new Redis(config[_0x5aac('0x1a')]));require(_0x5aac('0x1d'))[_0x5aac('0x1e')](socket);function respondWithStatusCode(_0x3dbb24,_0x5090ff){_0x5090ff=_0x5090ff||0xcc;return function(_0x331734){if(_0x331734){return _0x3dbb24[_0x5aac('0x1f')](_0x5090ff);}return _0x3dbb24[_0x5aac('0x20')](_0x5090ff)[_0x5aac('0x21')]();};}function respondWithResult(_0x28c5f6,_0x348c45){_0x348c45=_0x348c45||0xc8;return function(_0x1b991d){if(_0x1b991d){return _0x28c5f6['status'](_0x348c45)[_0x5aac('0x22')](_0x1b991d);}};}function respondWithFilteredResult(_0x22991c,_0xbcdbdf){return function(_0xef5217){if(_0xef5217){var _0x992b1a=typeof _0xbcdbdf['offset']===_0x5aac('0x23')&&typeof _0xbcdbdf[_0x5aac('0x24')]===_0x5aac('0x23');var _0x253e7c=_0xef5217[_0x5aac('0x25')];var _0x3e96dd=_0x992b1a?0x0:_0xbcdbdf[_0x5aac('0x26')];var _0x4f617a=_0x992b1a?_0xef5217[_0x5aac('0x25')]:_0xbcdbdf[_0x5aac('0x26')]+_0xbcdbdf['limit'];var _0x760c37;if(_0x4f617a>=_0x253e7c){_0x4f617a=_0x253e7c;_0x760c37=0xc8;}else{_0x760c37=0xce;}_0x22991c[_0x5aac('0x20')](_0x760c37);return _0x22991c[_0x5aac('0x27')](_0x5aac('0x28'),_0x3e96dd+'-'+_0x4f617a+'/'+_0x253e7c)[_0x5aac('0x22')](_0xef5217);}return null;};}function patchUpdates(_0x366387){return function(_0x1a5fbd){try{jsonpatch[_0x5aac('0x29')](_0x1a5fbd,_0x366387,!![]);}catch(_0x270b96){return BPromise['reject'](_0x270b96);}return _0x1a5fbd['save']();};}function saveUpdates(_0x171b82,_0x1510b3){return function(_0x2e4ed3){if(_0x2e4ed3){return _0x2e4ed3[_0x5aac('0x2a')](_0x171b82)['then'](function(_0x525a76){return _0x525a76;});}return null;};}function removeEntity(_0x24b8f1,_0x230bc3){return function(_0xe62ac1){if(_0xe62ac1){return _0xe62ac1['destroy']()[_0x5aac('0x2b')](function(){var _0x485612=_0xe62ac1[_0x5aac('0x2c')]({'plain':!![]});var _0x5f3915='MailQueues';return db['UserProfileResource'][_0x5aac('0x2d')]({'where':{'type':_0x5f3915,'resourceId':_0x485612['id']}})[_0x5aac('0x2b')](function(){return _0xe62ac1;});})[_0x5aac('0x2b')](function(){_0x24b8f1[_0x5aac('0x20')](0xcc)[_0x5aac('0x21')]();});}};}function handleEntityNotFound(_0x180fef,_0x9171cc){return function(_0x52432e){if(!_0x52432e){_0x180fef[_0x5aac('0x1f')](0x194);}return _0x52432e;};}function handleError(_0x5d0c0e,_0x43eb03){_0x43eb03=_0x43eb03||0x1f4;return function(_0x40b14c){logger['error'](_0x40b14c[_0x5aac('0x2e')]);if(_0x40b14c[_0x5aac('0x2f')]){delete _0x40b14c[_0x5aac('0x2f')];}_0x5d0c0e[_0x5aac('0x20')](_0x43eb03)[_0x5aac('0x30')](_0x40b14c);};}exports[_0x5aac('0x31')]=function(_0x201d68,_0x165ed8){var _0xd4d85c={},_0x391db0={},_0x3993ee={'count':0x0,'rows':[]};var _0x3051e1=_['map'](db[_0x5aac('0x32')][_0x5aac('0x33')],function(_0x1ac35e){return{'name':_0x1ac35e[_0x5aac('0x34')],'type':_0x1ac35e[_0x5aac('0x35')][_0x5aac('0x36')]};});_0x391db0[_0x5aac('0x37')]=_[_0x5aac('0x38')](_0x3051e1,_0x5aac('0x2f'));_0x391db0[_0x5aac('0x39')]=_['keys'](_0x201d68['query']);_0x391db0[_0x5aac('0x3a')]=_['intersection'](_0x391db0[_0x5aac('0x37')],_0x391db0[_0x5aac('0x39')]);_0xd4d85c[_0x5aac('0x3b')]=_[_0x5aac('0x3c')](_0x391db0['model'],qs[_0x5aac('0x3d')](_0x201d68['query'][_0x5aac('0x3d')]));_0xd4d85c['attributes']=_0xd4d85c['attributes'][_0x5aac('0x3e')]?_0xd4d85c[_0x5aac('0x3b')]:_0x391db0[_0x5aac('0x37')];if(!_0x201d68[_0x5aac('0x39')][_0x5aac('0x3f')](_0x5aac('0x40'))){_0xd4d85c[_0x5aac('0x24')]=qs[_0x5aac('0x24')](_0x201d68['query']['limit']);_0xd4d85c[_0x5aac('0x26')]=qs[_0x5aac('0x26')](_0x201d68[_0x5aac('0x39')][_0x5aac('0x26')]);}_0xd4d85c['order']=qs[_0x5aac('0x41')](_0x201d68[_0x5aac('0x39')]['sort']);_0xd4d85c[_0x5aac('0x42')]=qs[_0x5aac('0x3a')](_['pick'](_0x201d68['query'],_0x391db0[_0x5aac('0x3a')]),_0x3051e1);if(_0x201d68[_0x5aac('0x39')]['filter']){_0xd4d85c['where']=_[_0x5aac('0x43')](_0xd4d85c['where'],{'$or':_[_0x5aac('0x38')](_0x3051e1,function(_0x50d0de){if(_0x50d0de[_0x5aac('0x35')]!==_0x5aac('0x44')){var _0x34ef65={};_0x34ef65[_0x50d0de[_0x5aac('0x2f')]]={'$like':'%'+_0x201d68[_0x5aac('0x39')]['filter']+'%'};return _0x34ef65;}})});}_0xd4d85c=_['merge']({},_0xd4d85c,_0x201d68[_0x5aac('0x45')]);var _0x2a5fc7={'where':_0xd4d85c[_0x5aac('0x42')]};return db['MailQueue'][_0x5aac('0x25')](_0x2a5fc7)['then'](function(_0x55dea2){_0x3993ee[_0x5aac('0x25')]=_0x55dea2;if(_0x201d68[_0x5aac('0x39')]['includeAll']){_0xd4d85c[_0x5aac('0x46')]=[{'all':!![]}];}return db[_0x5aac('0x32')][_0x5aac('0x47')](_0xd4d85c);})[_0x5aac('0x2b')](function(_0x19ace6){_0x3993ee['rows']=_0x19ace6;return _0x3993ee;})[_0x5aac('0x2b')](respondWithFilteredResult(_0x165ed8,_0xd4d85c))['catch'](handleError(_0x165ed8,null));};exports['show']=function(_0x1bde32,_0x5419a5){var _0x479482={'raw':!![],'where':{'id':_0x1bde32[_0x5aac('0x48')]['id']}},_0x829f04={};_0x829f04[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x32')][_0x5aac('0x33')]);_0x829f04[_0x5aac('0x39')]=_[_0x5aac('0x49')](_0x1bde32[_0x5aac('0x39')]);_0x829f04[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x829f04[_0x5aac('0x37')],_0x829f04[_0x5aac('0x39')]);_0x479482['attributes']=_[_0x5aac('0x3c')](_0x829f04['model'],qs['fields'](_0x1bde32[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x479482[_0x5aac('0x3b')]=_0x479482['attributes'][_0x5aac('0x3e')]?_0x479482[_0x5aac('0x3b')]:_0x829f04[_0x5aac('0x37')];if(_0x1bde32[_0x5aac('0x39')]['includeAll']){_0x479482[_0x5aac('0x46')]=[{'all':!![]}];}_0x479482=_['merge']({},_0x479482,_0x1bde32[_0x5aac('0x45')]);return db[_0x5aac('0x32')][_0x5aac('0x4a')](_0x479482)['then'](handleEntityNotFound(_0x5419a5,null))[_0x5aac('0x2b')](respondWithResult(_0x5419a5,null))[_0x5aac('0x4b')](handleError(_0x5419a5,null));};exports[_0x5aac('0x4c')]=function(_0x3abfe0,_0x5699d0){return db['MailQueue'][_0x5aac('0x4c')](_0x3abfe0[_0x5aac('0x4d')],{})['then'](function(_0x2e1456){var _0x148391=_0x3abfe0[_0x5aac('0x4e')]['get']({'plain':!![]});if(!_0x148391)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x148391[_0x5aac('0x4f')]==='user'){var _0x2c16d3=_0x2e1456[_0x5aac('0x2c')]({'plain':!![]});var _0x5ad188='MailQueues';return db[_0x5aac('0x50')][_0x5aac('0x4a')]({'where':{'name':_0x5ad188,'userProfileId':_0x148391[_0x5aac('0x51')]},'raw':!![]})[_0x5aac('0x2b')](function(_0x359247){if(_0x359247&&_0x359247['autoAssociation']===0x0){return db[_0x5aac('0x52')][_0x5aac('0x4c')]({'name':_0x2c16d3['name'],'resourceId':_0x2c16d3['id'],'type':_0x359247['name'],'sectionId':_0x359247['id']},{})[_0x5aac('0x2b')](function(){return _0x2e1456;});}else{return _0x2e1456;}})['catch'](function(_0x340c2f){logger[_0x5aac('0x53')](_0x5aac('0x54'),_0x340c2f);throw _0x340c2f;});}return _0x2e1456;})[_0x5aac('0x2b')](respondWithResult(_0x5699d0,0xc9))[_0x5aac('0x4b')](handleError(_0x5699d0,null));};exports[_0x5aac('0x2a')]=function(_0x43f8e0,_0x2e5824){if(_0x43f8e0[_0x5aac('0x4d')]['id']){delete _0x43f8e0[_0x5aac('0x4d')]['id'];}return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x43f8e0[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x2e5824,null))[_0x5aac('0x2b')](saveUpdates(_0x43f8e0[_0x5aac('0x4d')],null))[_0x5aac('0x2b')](respondWithResult(_0x2e5824,null))['catch'](handleError(_0x2e5824,null));};exports['destroy']=function(_0x136408,_0x31c7f7){return db['MailQueue']['find']({'where':{'id':_0x136408[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x31c7f7,null))['then'](removeEntity(_0x31c7f7,null))[_0x5aac('0x4b')](handleError(_0x31c7f7,null));};exports['describe']=function(_0x381800,_0x2383fa){return db[_0x5aac('0x32')][_0x5aac('0x55')]()[_0x5aac('0x2b')](respondWithResult(_0x2383fa,null))[_0x5aac('0x4b')](handleError(_0x2383fa,null));};exports[_0x5aac('0x56')]=function(_0x4659d2,_0x1f7b86,_0x220b0b){var _0x310445={'raw':!![],'where':{}},_0x36a426={},_0xa1bde3;return db['MailQueue'][_0x5aac('0x57')]({'where':{'id':_0x4659d2[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0x1f7b86,null))['then'](function(_0x5a0366){if(_0x5a0366){_0xa1bde3=_0x5a0366[_0x5aac('0x2c')]({'plain':!![]});_0x36a426[_0x5aac('0x37')]=_['keys'](db[_0x5aac('0x58')]['rawAttributes']);_0x36a426[_0x5aac('0x39')]=_['keys'](_0x4659d2[_0x5aac('0x39')]);_0x36a426[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x36a426[_0x5aac('0x37')],_0x36a426['query']);_0x310445[_0x5aac('0x3b')]=_[_0x5aac('0x3c')](_0x36a426[_0x5aac('0x37')],qs[_0x5aac('0x3d')](_0x4659d2['query'][_0x5aac('0x3d')]));_0x310445[_0x5aac('0x3b')]=_0x310445[_0x5aac('0x3b')][_0x5aac('0x3e')]?_0x310445[_0x5aac('0x3b')]:_0x36a426['model'];if(!_0x4659d2[_0x5aac('0x39')]['hasOwnProperty'](_0x5aac('0x40'))){_0x310445['limit']=qs['limit'](_0x4659d2[_0x5aac('0x39')][_0x5aac('0x24')]);_0x310445['offset']=qs['offset'](_0x4659d2[_0x5aac('0x39')][_0x5aac('0x26')]);}_0x310445['order']=qs['sort'](_0x4659d2['query'][_0x5aac('0x41')]);_0x310445['where']=qs['filters'](_[_0x5aac('0x59')](_0x4659d2[_0x5aac('0x39')],_0x36a426[_0x5aac('0x3a')]));_0x310445[_0x5aac('0x42')][_0x5aac('0x5a')]=_0x5a0366['id'];if(_0x4659d2[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x310445[_0x5aac('0x42')]=_[_0x5aac('0x43')](_0x310445['where'],{'$or':_['map'](_0x310445['attributes'],function(_0x42c18f){var _0x347eee={};_0x347eee[_0x42c18f]={'$like':'%'+_0x4659d2['query']['filter']+'%'};return _0x347eee;})});}_0x310445=_[_0x5aac('0x43')]({},_0x310445,_0x4659d2['options']);return db['UserMailQueue'][_0x5aac('0x47')](_0x310445);}})[_0x5aac('0x2b')](function(_0x991684){if(_0x991684){return db[_0x5aac('0x5c')][_0x5aac('0x5d')]({'where':{'id':_[_0x5aac('0x38')](_0x991684,'UserId'),'role':'agent'},'attributes':['id',_0x5aac('0x2f'),_0x5aac('0x5e'),_0x5aac('0x5f'),'createdAt']});}})[_0x5aac('0x2b')](function(_0x10ea25){if(_0x10ea25){return{'count':_0x10ea25[_0x5aac('0x25')],'rows':_['map'](_0x10ea25[_0x5aac('0x60')],function(_0x1e5cbb){return{'membername':_0x1e5cbb[_0x5aac('0x2f')],'UserId':_0x1e5cbb['id'],'queue_name':_0xa1bde3['name'],'MailQueueId':_0xa1bde3['id'],'interface':util['format'](_0x5aac('0x61'),'SIP',_0x1e5cbb[_0x5aac('0x2f')]),'penalty':0x0,'paused':_0x1e5cbb[_0x5aac('0x5e')],'createdAt':_0x1e5cbb[_0x5aac('0x62')],'updatedAt':_0x1e5cbb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5aac('0x2b')](respondWithFilteredResult(_0x1f7b86,_0x310445))[_0x5aac('0x4b')](handleError(_0x1f7b86,null));};exports[_0x5aac('0x63')]=function(_0x35db7f,_0xce6c04,_0x49a619){var _0x5d4662={};var _0x2d9ca1={};var _0x472aef;var _0x310c75;return db['MailQueue'][_0x5aac('0x57')]({'where':{'id':_0x35db7f[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](handleEntityNotFound(_0xce6c04,null))[_0x5aac('0x2b')](function(_0x1d9267){if(_0x1d9267){_0x472aef=_0x1d9267;_0x2d9ca1[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x64')][_0x5aac('0x33')]);_0x2d9ca1[_0x5aac('0x39')]=_[_0x5aac('0x49')](_0x35db7f['query']);_0x2d9ca1[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x2d9ca1['model'],_0x2d9ca1[_0x5aac('0x39')]);_0x5d4662[_0x5aac('0x3b')]=_['intersection'](_0x2d9ca1[_0x5aac('0x37')],qs[_0x5aac('0x3d')](_0x35db7f[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x5d4662[_0x5aac('0x3b')]=_0x5d4662['attributes'][_0x5aac('0x3e')]?_0x5d4662[_0x5aac('0x3b')]:_0x2d9ca1[_0x5aac('0x37')];_0x5d4662[_0x5aac('0x65')]=qs[_0x5aac('0x41')](_0x35db7f[_0x5aac('0x39')][_0x5aac('0x41')]);_0x5d4662[_0x5aac('0x42')]=qs['filters'](_['pick'](_0x35db7f[_0x5aac('0x39')],_0x2d9ca1[_0x5aac('0x3a')]));if(_0x35db7f[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x5d4662[_0x5aac('0x42')]=_['merge'](_0x5d4662['where'],{'$or':_[_0x5aac('0x38')](_0x5d4662[_0x5aac('0x3b')],function(_0x1cf04b){var _0x2d424f={};_0x2d424f[_0x1cf04b]={'$like':'%'+_0x35db7f[_0x5aac('0x39')][_0x5aac('0x5b')]+'%'};return _0x2d424f;})});}_0x5d4662=_[_0x5aac('0x43')]({},_0x5d4662,_0x35db7f[_0x5aac('0x45')]);return _0x472aef[_0x5aac('0x63')](_0x5d4662);}})[_0x5aac('0x2b')](function(_0x45a3fb){if(_0x45a3fb){_0x310c75=_0x45a3fb[_0x5aac('0x3e')];if(!_0x35db7f[_0x5aac('0x39')][_0x5aac('0x3f')](_0x5aac('0x40'))){_0x5d4662['limit']=qs[_0x5aac('0x24')](_0x35db7f['query'][_0x5aac('0x24')]);_0x5d4662['offset']=qs[_0x5aac('0x26')](_0x35db7f['query'][_0x5aac('0x26')]);}return _0x472aef[_0x5aac('0x63')](_0x5d4662);}})[_0x5aac('0x2b')](function(_0x7c58ec){if(_0x7c58ec){return _0x7c58ec?{'count':_0x310c75,'rows':_0x7c58ec}:null;}})[_0x5aac('0x2b')](respondWithResult(_0xce6c04,null))['catch'](handleError(_0xce6c04,null));};exports['addTeams']=function(_0x463c36,_0x22c61d,_0x343f02){var _0x269ae3=_0x463c36['body']['ids'];return db[_0x5aac('0x64')][_0x5aac('0x47')]({'where':{'id':_0x269ae3},'attributes':['id'],'include':[{'model':db[_0x5aac('0x5c')],'as':_0x5aac('0x66'),'attributes':['id',_0x5aac('0x2f'),_0x5aac('0x67'),_0x5aac('0x68'),_0x5aac('0x69')],'raw':!![]}]})[_0x5aac('0x2b')](function(_0x5cb1c0){if(_0x5cb1c0){var _0x435a2a=_[_0x5aac('0x6a')](_0x5cb1c0,function(_0x270b80){var _0x4989da=_0x270b80['get']({'plain':!![]});return _0x4989da[_0x5aac('0x66')];});return db['MailQueue']['find']({'where':{'id':_0x463c36[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](function(_0x5edd0d){return db[_0x5aac('0x6b')][_0x5aac('0x6c')](function(_0x5486f1){return _0x5edd0d[_0x5aac('0x6d')](_0x269ae3,{'transaction':_0x5486f1})[_0x5aac('0x2b')](function(){return BPromise['each'](_0x435a2a,function(_0xd9a3b2){return db[_0x5aac('0x58')]['findOrCreate']({'where':{'UserId':_0xd9a3b2['id'],'MailQueueId':_0x463c36[_0x5aac('0x48')]['id']},'transaction':_0x5486f1});});})[_0x5aac('0x2b')](function(){_0x435a2a['forEach'](function(_0x3e0491){socket[_0x5aac('0x6e')](_0x5aac('0x6f'),{'UserId':_0x3e0491['id'],'MailQueueId':_0x5edd0d['id']});});});});});}})[_0x5aac('0x2b')](respondWithStatusCode(_0x22c61d,null))['catch'](handleError(_0x22c61d,null));};exports[_0x5aac('0x70')]=function(_0x3460b5,_0xefb92a,_0x2bd302){return db[_0x5aac('0x64')][_0x5aac('0x47')]({'where':{'id':_0x3460b5[_0x5aac('0x39')][_0x5aac('0x71')]},'attributes':['id'],'include':[{'model':db[_0x5aac('0x5c')],'as':_0x5aac('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5aac('0x2b')](handleEntityNotFound(_0xefb92a,null))[_0x5aac('0x2b')](function(_0x47b8aa){var _0x321dda=_['map'](_0x47b8aa,'id');var _0x952088=[];var _0x3ed6d5=[];var _0x13114e=squel[_0x5aac('0x72')]();_0x13114e[_0x5aac('0x73')](_0x5aac('0x74'))[_0x5aac('0x75')](_0x5aac('0x76'),'tq')[_0x5aac('0x77')](_0x5aac('0x78'),'ut',_0x5aac('0x79'))[_0x5aac('0x42')](_0x5aac('0x7a'),_0x3460b5['params']['id']);for(var _0x460c35=0x0;_0x460c35<_0x47b8aa[_0x5aac('0x3e')];_0x460c35+=0x1){let _0x51c967=_0x47b8aa[_0x460c35];for(var _0x1d5b30=0x0;_0x1d5b30<_0x51c967[_0x5aac('0x66')][_0x5aac('0x3e')];_0x1d5b30+=0x1){let _0x1d12d2=_0x51c967[_0x5aac('0x66')][_0x1d5b30];var _0x9ebb9a=_0x13114e[_0x5aac('0x7b')]();_0x9ebb9a[_0x5aac('0x42')]('ut.UserId\x20=\x20?',_0x1d12d2['id']);_0x3ed6d5[_0x5aac('0x7c')](db[_0x5aac('0x6b')]['query'](_0x9ebb9a[_0x5aac('0x7d')](),{'type':db[_0x5aac('0x6b')][_0x5aac('0x7e')][_0x5aac('0x7f')]})[_0x5aac('0x2b')](function(_0x199ceb){if(_0x199ceb[_0x5aac('0x3e')]===0x1){return _0x1d12d2['id'];}else{var _0x3dbd42=_[_0x5aac('0x80')](_[_0x5aac('0x38')](_0x199ceb,'TeamId'),function(_0x7f9116){return _[_0x5aac('0x81')](_0x321dda,_0x7f9116);});if(_0x3dbd42){return _0x1d12d2['id'];}}}));}}return BPromise[_0x5aac('0x82')](_0x3ed6d5)[_0x5aac('0x2b')](function(_0x7c0f84){_0x952088=_(_0x952088)[_0x5aac('0x83')](_0x7c0f84)[_0x5aac('0x84')]()[_0x5aac('0x85')]();return db['MailQueue'][_0x5aac('0x4a')]({'where':{'id':_0x3460b5[_0x5aac('0x48')]['id']}})[_0x5aac('0x2b')](function(_0x576d90){return db[_0x5aac('0x6b')][_0x5aac('0x6c')](function(_0x2371a1){return _0x576d90[_0x5aac('0x70')](_0x3460b5[_0x5aac('0x39')]['ids'],{'transaction':_0x2371a1})[_0x5aac('0x2b')](function(){if(!_[_0x5aac('0x86')](_0x952088)){return _0x576d90[_0x5aac('0x87')](_0x952088,{'transaction':_0x2371a1});}})[_0x5aac('0x2b')](function(){_0x952088[_0x5aac('0x88')](function(_0x4f6ac1){socket[_0x5aac('0x6e')](_0x5aac('0x89'),{'UserId':_0x4f6ac1,'MailQueueId':_0x576d90['id']});});});});});});})['then'](respondWithStatusCode(_0xefb92a,null))[_0x5aac('0x4b')](handleError(_0xefb92a,null));};exports[_0x5aac('0x8a')]=function(_0x57ec82,_0x3b38b7,_0x2da0aa){return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x57ec82[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x3b38b7,null))[_0x5aac('0x2b')](function(_0x43b68e){if(_0x43b68e){return _0x43b68e[_0x5aac('0x8a')](_0x57ec82[_0x5aac('0x4d')][_0x5aac('0x71')],_[_0x5aac('0x8b')](_0x57ec82[_0x5aac('0x4d')],[_0x5aac('0x71'),'id'])||{})[_0x5aac('0x8c')](function(_0x577323){for(var _0x42aeee=0x0;_0x42aeee<_0x57ec82[_0x5aac('0x4d')][_0x5aac('0x71')]['length'];_0x42aeee+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x57ec82['body'][_0x5aac('0x71')][_0x42aeee]),'MailQueueId':Number(_0x57ec82['params']['id'])});}return _0x577323;});}})[_0x5aac('0x2b')](respondWithResult(_0x3b38b7,null))[_0x5aac('0x4b')](handleError(_0x3b38b7,null));};exports['removeAgents']=function(_0x334f42,_0x509f60,_0x18bf64){return db[_0x5aac('0x32')][_0x5aac('0x4a')]({'where':{'id':_0x334f42[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x509f60,null))[_0x5aac('0x2b')](function(_0x34d917){if(_0x34d917){return _0x34d917['removeAgents'](_0x334f42[_0x5aac('0x39')]['ids'])[_0x5aac('0x2b')](function(){if(_[_0x5aac('0x8d')](_0x334f42[_0x5aac('0x39')][_0x5aac('0x71')])){for(var _0x4d9ba4=0x0;_0x4d9ba4<_0x334f42[_0x5aac('0x39')]['ids']['length'];_0x4d9ba4+=0x1){socket[_0x5aac('0x6e')](_0x5aac('0x89'),{'UserId':Number(_0x334f42[_0x5aac('0x39')][_0x5aac('0x71')][_0x4d9ba4]),'MailQueueId':Number(_0x334f42[_0x5aac('0x48')]['id'])});}}else{socket['emit'](_0x5aac('0x89'),{'UserId':Number(_0x334f42[_0x5aac('0x39')]['ids']),'MailQueueId':Number(_0x334f42[_0x5aac('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x509f60,null))['catch'](handleError(_0x509f60,null));};exports[_0x5aac('0x8e')]=function(_0xa1d670,_0x522efc,_0x53a611){var _0x31bee4={};var _0x2678df={};var _0x2cbd04;var _0x352ae5;return db[_0x5aac('0x32')][_0x5aac('0x57')]({'where':{'id':_0xa1d670[_0x5aac('0x48')]['id']}})['then'](handleEntityNotFound(_0x522efc,null))[_0x5aac('0x2b')](function(_0xbcdb85){if(_0xbcdb85){_0x2cbd04=_0xbcdb85;_0x2678df[_0x5aac('0x37')]=_[_0x5aac('0x49')](db[_0x5aac('0x5c')][_0x5aac('0x33')]);_0x2678df['query']=_[_0x5aac('0x49')](_0xa1d670[_0x5aac('0x39')]);_0x2678df[_0x5aac('0x3a')]=_[_0x5aac('0x3c')](_0x2678df[_0x5aac('0x37')],_0x2678df[_0x5aac('0x39')]);_0x31bee4[_0x5aac('0x3b')]=_['intersection'](_0x2678df[_0x5aac('0x37')],qs['fields'](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x3d')]));_0x31bee4[_0x5aac('0x3b')]=_0x31bee4[_0x5aac('0x3b')][_0x5aac('0x3e')]?_0x31bee4[_0x5aac('0x3b')]:_0x2678df[_0x5aac('0x37')];_0x31bee4[_0x5aac('0x65')]=qs[_0x5aac('0x41')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x41')]);_0x31bee4[_0x5aac('0x42')]=qs[_0x5aac('0x3a')](_[_0x5aac('0x59')](_0xa1d670[_0x5aac('0x39')],_0x2678df['filters']));if(_0xa1d670[_0x5aac('0x39')][_0x5aac('0x5b')]){_0x31bee4[_0x5aac('0x42')]=_[_0x5aac('0x43')](_0x31bee4[_0x5aac('0x42')],{'$or':_['map'](_0x31bee4[_0x5aac('0x3b')],function(_0x4844ab){var _0x12aa7b={};_0x12aa7b[_0x4844ab]={'$like':'%'+_0xa1d670[_0x5aac('0x39')][_0x5aac('0x5b')]+'%'};return _0x12aa7b;})});}_0x31bee4=_['merge']({},_0x31bee4,_0xa1d670[_0x5aac('0x45')]);return _0x2cbd04['getAgents'](_0x31bee4);}})['then'](function(_0x232f3c){if(_0x232f3c){_0x352ae5=_0x232f3c['length'];if(!_0xa1d670[_0x5aac('0x39')]['hasOwnProperty'](_0x5aac('0x40'))){_0x31bee4['limit']=qs[_0x5aac('0x24')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x24')]);_0x31bee4[_0x5aac('0x26')]=qs[_0x5aac('0x26')](_0xa1d670[_0x5aac('0x39')][_0x5aac('0x26')]);}return _0x2cbd04[_0x5aac('0x8e')](_0x31bee4);}})[_0x5aac('0x2b')](function(_0x3064b0){if(_0x3064b0){return _0x3064b0?{'count':_0x352ae5,'rows':_0x3064b0}:null;}})[_0x5aac('0x2b')](respondWithResult(_0x522efc,null))[_0x5aac('0x4b')](handleError(_0x522efc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ef7ea28..00123c1 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 _0x9dd8=['setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x4cdd3a,_0x3d70fc){var _0x1b6da9=function(_0x50451c){while(--_0x50451c){_0x4cdd3a['push'](_0x4cdd3a['shift']());}};_0x1b6da9(++_0x3d70fc);}(_0x9dd8,0xb9));var _0x89dd=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x9dd8[_0x1a7846];return _0x48049;};'use strict';var EventEmitter=require(_0x89dd('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x89dd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x89dd('0x2')};function emitEvent(_0x165510){return function(_0x488369,_0xecc9f9,_0x499e90){MailQueueEvents[_0x89dd('0x3')](_0x165510+':'+_0x488369['id'],_0x488369);MailQueueEvents[_0x89dd('0x3')](_0x165510,_0x488369);_0x499e90(null);};}for(var e in events){if(events[_0x89dd('0x4')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x89dd('0x5')]=MailQueueEvents; \ No newline at end of file +var _0x2db9=['update','remove','emit','hook','events','../../mysqldb','MailQueue','save'];(function(_0x81e43f,_0x3c8607){var _0x324ca0=function(_0x40b075){while(--_0x40b075){_0x81e43f['push'](_0x81e43f['shift']());}};_0x324ca0(++_0x3c8607);}(_0x2db9,0x84));var _0x92db=function(_0x2a2749,_0xbd852a){_0x2a2749=_0x2a2749-0x0;var _0x5c1ea6=_0x2db9[_0x2a2749];return _0x5c1ea6;};'use strict';var EventEmitter=require(_0x92db('0x0'));var MailQueue=require(_0x92db('0x1'))['db'][_0x92db('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x92db('0x3'),'afterUpdate':_0x92db('0x4'),'afterDestroy':_0x92db('0x5')};function emitEvent(_0x35f6dc){return function(_0xde32b3,_0x5e89ca,_0x34a72d){MailQueueEvents[_0x92db('0x6')](_0x35f6dc+':'+_0xde32b3['id'],_0xde32b3);MailQueueEvents[_0x92db('0x6')](_0x35f6dc,_0xde32b3);_0x34a72d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x92db('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3a5fe58..32dad21 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 _0xc1e4=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xc1e4,0x14a));var _0x4c1e=function(_0x8838bb,_0x12c791){_0x8838bb=_0x8838bb-0x0;var _0x451aea=_0xc1e4[_0x8838bb];return _0x451aea;};'use strict';var _=require(_0x4c1e('0x0'));var util=require(_0x4c1e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4c1e('0x2'));var rp=require(_0x4c1e('0x3'));var fs=require('fs');var path=require(_0x4c1e('0x4'));var rimraf=require(_0x4c1e('0x5'));var config=require(_0x4c1e('0x6'));var attributes=require(_0x4c1e('0x7'));module[_0x4c1e('0x8')]=function(_0x1be384,_0x62fb68){return _0x1be384['define'](_0x4c1e('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8677=['./mailQueue.attributes','exports','MailQueue','mail_queues','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x2b12ab,_0x110dd3){var _0x184527=function(_0x5295fe){while(--_0x5295fe){_0x2b12ab['push'](_0x2b12ab['shift']());}};_0x184527(++_0x110dd3);}(_0x8677,0x79));var _0x7867=function(_0x4e7484,_0x4eb649){_0x4e7484=_0x4e7484-0x0;var _0x15b752=_0x8677[_0x4e7484];return _0x15b752;};'use strict';var _=require('lodash');var util=require(_0x7867('0x0'));var logger=require(_0x7867('0x1'))('api');var moment=require(_0x7867('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7867('0x3'));var config=require(_0x7867('0x4'));var attributes=require(_0x7867('0x5'));module[_0x7867('0x6')]=function(_0xde4ad0,_0x527832){return _0xde4ad0['define'](_0x7867('0x7'),attributes,{'tableName':_0x7867('0x8'),'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 7e1031f..7495148 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 _0x4c72=['error','code','message','result','options','raw','where','limit','include','map','model','attributes','GetMailQueue','ShowMailQueue','MailQueue','find','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x4c72,0x179));var _0x24c7=function(_0x5f2dea,_0x136d7f){_0x5f2dea=_0x5f2dea-0x0;var _0x3724f7=_0x4c72[_0x5f2dea];return _0x3724f7;};'use strict';var _=require(_0x24c7('0x0'));var util=require(_0x24c7('0x1'));var moment=require(_0x24c7('0x2'));var BPromise=require(_0x24c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24c7('0x4'))['db'];var utils=require(_0x24c7('0x5'));var logger=require(_0x24c7('0x6'))(_0x24c7('0x7'));var config=require(_0x24c7('0x8'));var jayson=require(_0x24c7('0x9'));var client=jayson['client'][_0x24c7('0xa')]({'port':0x232a});config['redis']=_[_0x24c7('0xb')](config['redis'],{'host':_0x24c7('0xc'),'port':0x18eb});var socket=require(_0x24c7('0xd'))(new Redis(config[_0x24c7('0xe')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x35e7d4,_0x21f971,_0x2926c5){return new BPromise(function(_0x4f6711,_0xa1d967){return client[_0x24c7('0xf')](_0x35e7d4,_0x2926c5)[_0x24c7('0x10')](function(_0x5edb33){logger[_0x24c7('0x11')](_0x24c7('0x12'),_0x21f971,_0x24c7('0x13'));logger[_0x24c7('0x14')](_0x24c7('0x15'),_0x21f971,_0x24c7('0x13'),JSON[_0x24c7('0x16')](_0x5edb33));if(_0x5edb33[_0x24c7('0x17')]){if(_0x5edb33['error'][_0x24c7('0x18')]===0x1f4){logger[_0x24c7('0x17')](_0x24c7('0x12'),_0x21f971,_0x5edb33[_0x24c7('0x17')][_0x24c7('0x19')]);return _0xa1d967(_0x5edb33[_0x24c7('0x17')][_0x24c7('0x19')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x21f971,_0x5edb33[_0x24c7('0x17')][_0x24c7('0x19')]);return _0x4f6711(_0x5edb33['error'][_0x24c7('0x19')]);}else{logger[_0x24c7('0x11')](_0x24c7('0x12'),_0x21f971,'request\x20sent');_0x4f6711(_0x5edb33[_0x24c7('0x1a')][_0x24c7('0x19')]);}})['catch'](function(_0x4b7194){logger[_0x24c7('0x17')](_0x24c7('0x12'),_0x21f971,_0x4b7194);_0xa1d967(_0x4b7194);});});}exports['GetMailQueue']=function(_0x21cec6){var _0x2fc667=this;return new Promise(function(_0x4f0903,_0x33ccf2){return db['MailQueue']['findAll']({'raw':_0x21cec6[_0x24c7('0x1b')]?_0x21cec6['options'][_0x24c7('0x1c')]===undefined?!![]:![]:!![],'where':_0x21cec6[_0x24c7('0x1b')]?_0x21cec6[_0x24c7('0x1b')][_0x24c7('0x1d')]||null:null,'attributes':_0x21cec6[_0x24c7('0x1b')]?_0x21cec6['options']['attributes']||null:null,'limit':_0x21cec6[_0x24c7('0x1b')]?_0x21cec6[_0x24c7('0x1b')][_0x24c7('0x1e')]||null:null,'include':_0x21cec6[_0x24c7('0x1b')]?_0x21cec6[_0x24c7('0x1b')][_0x24c7('0x1f')]?_[_0x24c7('0x20')](_0x21cec6[_0x24c7('0x1b')][_0x24c7('0x1f')],function(_0x309b06){return{'model':db[_0x309b06[_0x24c7('0x21')]],'as':_0x309b06['as'],'attributes':_0x309b06[_0x24c7('0x22')],'include':_0x309b06[_0x24c7('0x1f')]?_['map'](_0x309b06[_0x24c7('0x1f')],function(_0x5a58f4){return{'model':db[_0x5a58f4[_0x24c7('0x21')]],'as':_0x5a58f4['as'],'attributes':_0x5a58f4[_0x24c7('0x22')],'include':_0x5a58f4[_0x24c7('0x1f')]?_[_0x24c7('0x20')](_0x5a58f4[_0x24c7('0x1f')],function(_0x41d84e){return{'model':db[_0x41d84e[_0x24c7('0x21')]],'as':_0x41d84e['as'],'attributes':_0x41d84e[_0x24c7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x24c7('0x10')](function(_0x161f43){logger[_0x24c7('0x11')](_0x24c7('0x23'),_0x21cec6);logger[_0x24c7('0x14')]('GetMailQueue',_0x21cec6,JSON[_0x24c7('0x16')](_0x161f43));_0x4f0903(_0x161f43);})['catch'](function(_0x44d995){logger[_0x24c7('0x17')](_0x24c7('0x23'),_0x44d995[_0x24c7('0x19')],_0x21cec6);_0x33ccf2(_0x2fc667[_0x24c7('0x17')](0x1f4,_0x44d995[_0x24c7('0x19')]));});});};exports[_0x24c7('0x24')]=function(_0x274e18){var _0x4c25f1=this;return new Promise(function(_0x11c1fe,_0x4186dd){return db[_0x24c7('0x25')][_0x24c7('0x26')]({'raw':_0x274e18[_0x24c7('0x1b')]?_0x274e18[_0x24c7('0x1b')][_0x24c7('0x1c')]===undefined?!![]:![]:!![],'where':_0x274e18[_0x24c7('0x1b')]?_0x274e18[_0x24c7('0x1b')]['where']||null:null,'attributes':_0x274e18['options']?_0x274e18['options'][_0x24c7('0x22')]||null:null,'include':_0x274e18['options']?_0x274e18[_0x24c7('0x1b')][_0x24c7('0x1f')]?_[_0x24c7('0x20')](_0x274e18[_0x24c7('0x1b')][_0x24c7('0x1f')],function(_0x39128d){return{'model':db[_0x39128d[_0x24c7('0x21')]],'as':_0x39128d['as'],'attributes':_0x39128d['attributes'],'include':_0x39128d['include']?_[_0x24c7('0x20')](_0x39128d['include'],function(_0x416542){return{'model':db[_0x416542[_0x24c7('0x21')]],'as':_0x416542['as'],'attributes':_0x416542['attributes'],'include':_0x416542[_0x24c7('0x1f')]?_[_0x24c7('0x20')](_0x416542[_0x24c7('0x1f')],function(_0xd3ae8c){return{'model':db[_0xd3ae8c[_0x24c7('0x21')]],'as':_0xd3ae8c['as'],'attributes':_0xd3ae8c[_0x24c7('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c6af6){logger[_0x24c7('0x11')](_0x24c7('0x24'),_0x274e18);logger['debug'](_0x24c7('0x24'),_0x274e18,JSON['stringify'](_0x1c6af6));_0x11c1fe(_0x1c6af6);})[_0x24c7('0x27')](function(_0x364ec7){logger[_0x24c7('0x17')]('ShowMailQueue',_0x364ec7[_0x24c7('0x19')],_0x274e18);_0x4186dd(_0x4c25f1[_0x24c7('0x17')](0x1f4,_0x364ec7[_0x24c7('0x19')]));});});}; \ No newline at end of file +var _0x0dcf=['MailQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where','include','model','attributes','map','GetMailQueue','debug','ShowMailQueue','MailQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailQueue.socket','register','request','then','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x0dcf,0x179));var _0xf0dc=function(_0x270089,_0x131d8e){_0x270089=_0x270089-0x0;var _0x9dc1ff=_0x0dcf[_0x270089];return _0x9dc1ff;};'use strict';var _=require(_0xf0dc('0x0'));var util=require(_0xf0dc('0x1'));var moment=require(_0xf0dc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0dc('0x3'));var fs=require('fs');var Redis=require(_0xf0dc('0x4'));var db=require(_0xf0dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf0dc('0x6'));var jayson=require(_0xf0dc('0x7'));var client=jayson[_0xf0dc('0x8')][_0xf0dc('0x9')]({'port':0x232a});config['redis']=_[_0xf0dc('0xa')](config[_0xf0dc('0xb')],{'host':_0xf0dc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0dc('0xb')]));require(_0xf0dc('0xd'))[_0xf0dc('0xe')](socket);function respondWithRpcPromise(_0x214db1,_0x591df6,_0x2cb3c8){return new BPromise(function(_0x4a94ce,_0x4ea5cf){return client[_0xf0dc('0xf')](_0x214db1,_0x2cb3c8)[_0xf0dc('0x10')](function(_0x4abce2){logger[_0xf0dc('0x11')]('MailQueue,\x20%s,\x20%s',_0x591df6,_0xf0dc('0x12'));logger['debug'](_0xf0dc('0x13'),_0x591df6,_0xf0dc('0x12'),JSON[_0xf0dc('0x14')](_0x4abce2));if(_0x4abce2[_0xf0dc('0x15')]){if(_0x4abce2[_0xf0dc('0x15')][_0xf0dc('0x16')]===0x1f4){logger[_0xf0dc('0x15')](_0xf0dc('0x17'),_0x591df6,_0x4abce2[_0xf0dc('0x15')][_0xf0dc('0x18')]);return _0x4ea5cf(_0x4abce2[_0xf0dc('0x15')][_0xf0dc('0x18')]);}logger[_0xf0dc('0x15')]('MailQueue,\x20%s,\x20%s',_0x591df6,_0x4abce2[_0xf0dc('0x15')][_0xf0dc('0x18')]);return _0x4a94ce(_0x4abce2['error']['message']);}else{logger[_0xf0dc('0x11')](_0xf0dc('0x17'),_0x591df6,_0xf0dc('0x12'));_0x4a94ce(_0x4abce2[_0xf0dc('0x19')][_0xf0dc('0x18')]);}})[_0xf0dc('0x1a')](function(_0x7081bb){logger['error'](_0xf0dc('0x17'),_0x591df6,_0x7081bb);_0x4ea5cf(_0x7081bb);});});}exports['GetMailQueue']=function(_0x2cec9b){var _0x150e14=this;return new Promise(function(_0x1c7912,_0x2ff443){return db['MailQueue'][_0xf0dc('0x1b')]({'raw':_0x2cec9b[_0xf0dc('0x1c')]?_0x2cec9b[_0xf0dc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2cec9b[_0xf0dc('0x1c')]?_0x2cec9b['options'][_0xf0dc('0x1d')]||null:null,'attributes':_0x2cec9b[_0xf0dc('0x1c')]?_0x2cec9b[_0xf0dc('0x1c')]['attributes']||null:null,'limit':_0x2cec9b[_0xf0dc('0x1c')]?_0x2cec9b['options']['limit']||null:null,'include':_0x2cec9b[_0xf0dc('0x1c')]?_0x2cec9b[_0xf0dc('0x1c')][_0xf0dc('0x1e')]?_['map'](_0x2cec9b[_0xf0dc('0x1c')][_0xf0dc('0x1e')],function(_0x26cfe5){return{'model':db[_0x26cfe5[_0xf0dc('0x1f')]],'as':_0x26cfe5['as'],'attributes':_0x26cfe5[_0xf0dc('0x20')],'include':_0x26cfe5['include']?_[_0xf0dc('0x21')](_0x26cfe5[_0xf0dc('0x1e')],function(_0xc9342e){return{'model':db[_0xc9342e['model']],'as':_0xc9342e['as'],'attributes':_0xc9342e[_0xf0dc('0x20')],'include':_0xc9342e['include']?_[_0xf0dc('0x21')](_0xc9342e[_0xf0dc('0x1e')],function(_0x110ae7){return{'model':db[_0x110ae7[_0xf0dc('0x1f')]],'as':_0x110ae7['as'],'attributes':_0x110ae7[_0xf0dc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf0dc('0x10')](function(_0x17fe44){logger[_0xf0dc('0x11')](_0xf0dc('0x22'),_0x2cec9b);logger[_0xf0dc('0x23')](_0xf0dc('0x22'),_0x2cec9b,JSON[_0xf0dc('0x14')](_0x17fe44));_0x1c7912(_0x17fe44);})[_0xf0dc('0x1a')](function(_0xedc18b){logger['error'](_0xf0dc('0x22'),_0xedc18b[_0xf0dc('0x18')],_0x2cec9b);_0x2ff443(_0x150e14[_0xf0dc('0x15')](0x1f4,_0xedc18b[_0xf0dc('0x18')]));});});};exports[_0xf0dc('0x24')]=function(_0x4677e4){var _0x13117d=this;return new Promise(function(_0x872c8,_0xb44249){return db[_0xf0dc('0x25')][_0xf0dc('0x26')]({'raw':_0x4677e4[_0xf0dc('0x1c')]?_0x4677e4['options'][_0xf0dc('0x27')]===undefined?!![]:![]:!![],'where':_0x4677e4['options']?_0x4677e4[_0xf0dc('0x1c')]['where']||null:null,'attributes':_0x4677e4['options']?_0x4677e4['options'][_0xf0dc('0x20')]||null:null,'include':_0x4677e4[_0xf0dc('0x1c')]?_0x4677e4['options'][_0xf0dc('0x1e')]?_['map'](_0x4677e4['options'][_0xf0dc('0x1e')],function(_0x233c03){return{'model':db[_0x233c03[_0xf0dc('0x1f')]],'as':_0x233c03['as'],'attributes':_0x233c03[_0xf0dc('0x20')],'include':_0x233c03[_0xf0dc('0x1e')]?_['map'](_0x233c03[_0xf0dc('0x1e')],function(_0x57a01d){return{'model':db[_0x57a01d[_0xf0dc('0x1f')]],'as':_0x57a01d['as'],'attributes':_0x57a01d[_0xf0dc('0x20')],'include':_0x57a01d[_0xf0dc('0x1e')]?_['map'](_0x57a01d[_0xf0dc('0x1e')],function(_0x5e709b){return{'model':db[_0x5e709b[_0xf0dc('0x1f')]],'as':_0x5e709b['as'],'attributes':_0x5e709b[_0xf0dc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf0dc('0x10')](function(_0x7c4c13){logger[_0xf0dc('0x11')]('ShowMailQueue',_0x4677e4);logger['debug'](_0xf0dc('0x24'),_0x4677e4,JSON[_0xf0dc('0x14')](_0x7c4c13));_0x872c8(_0x7c4c13);})[_0xf0dc('0x1a')](function(_0x13f510){logger['error']('ShowMailQueue',_0x13f510['message'],_0x4677e4);_0xb44249(_0x13117d[_0xf0dc('0x15')](0x1f4,_0x13f510[_0xf0dc('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3fd3a6d..7fccb3b 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 _0x9cc0=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1c02c8,_0x37dbfc){var _0x1e5ff8=function(_0x609e92){while(--_0x609e92){_0x1c02c8['push'](_0x1c02c8['shift']());}};_0x1e5ff8(++_0x37dbfc);}(_0x9cc0,0x81));var _0x09cc=function(_0x4d120d,_0x55a2c9){_0x4d120d=_0x4d120d-0x0;var _0x12b156=_0x9cc0[_0x4d120d];return _0x12b156;};'use strict';var MailQueueEvents=require(_0x09cc('0x0'));var events=[_0x09cc('0x1'),_0x09cc('0x2'),_0x09cc('0x3')];function createListener(_0x35e952,_0x2264f8){return function(_0x1d9c3c){_0x2264f8[_0x09cc('0x4')](_0x35e952,_0x1d9c3c);};}function removeListener(_0x447bee,_0x521f79){return function(){MailQueueEvents[_0x09cc('0x5')](_0x447bee,_0x521f79);};}exports[_0x09cc('0x6')]=function(_0x16d6b9){for(var _0xc7fbd1=0x0,_0x58029e=events['length'];_0xc7fbd1<_0x58029e;_0xc7fbd1++){var _0x822d79=events[_0xc7fbd1];var _0x3b1135=createListener(_0x09cc('0x7')+_0x822d79,_0x16d6b9);MailQueueEvents['on'](_0x822d79,_0x3b1135);}}; \ No newline at end of file +var _0x5c3b=['save','remove','update','removeListener','length','mailQueue:','./mailQueue.events'];(function(_0x311df2,_0x5b6291){var _0x2d70d7=function(_0x11d81b){while(--_0x11d81b){_0x311df2['push'](_0x311df2['shift']());}};_0x2d70d7(++_0x5b6291);}(_0x5c3b,0x1d4));var _0xb5c3=function(_0x40ff3b,_0x238af7){_0x40ff3b=_0x40ff3b-0x0;var _0x3ccf4f=_0x5c3b[_0x40ff3b];return _0x3ccf4f;};'use strict';var MailQueueEvents=require(_0xb5c3('0x0'));var events=[_0xb5c3('0x1'),_0xb5c3('0x2'),_0xb5c3('0x3')];function createListener(_0x5bde94,_0x283dcd){return function(_0x5daa66){_0x283dcd['emit'](_0x5bde94,_0x5daa66);};}function removeListener(_0x10a46e,_0x10fcf5){return function(){MailQueueEvents[_0xb5c3('0x4')](_0x10a46e,_0x10fcf5);};}exports['register']=function(_0x26c1f8){for(var _0xacd5c2=0x0,_0x59367c=events[_0xb5c3('0x5')];_0xacd5c2<_0x59367c;_0xacd5c2++){var _0x14fdba=events[_0xacd5c2];var _0x33b44b=createListener(_0xb5c3('0x6')+_0x14fdba,_0x26c1f8);MailQueueEvents['on'](_0x14fdba,_0x33b44b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index c356f6f..542ae2a 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 _0x1ab6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x34eb20,_0x276d5a){var _0x42e34a=function(_0x1b33c9){while(--_0x1b33c9){_0x34eb20['push'](_0x34eb20['shift']());}};_0x42e34a(++_0x276d5a);}(_0x1ab6,0x186));var _0x61ab=function(_0x413fb1,_0x1e9e75){_0x413fb1=_0x413fb1-0x0;var _0x1e9371=_0x1ab6[_0x413fb1];return _0x1e9371;};'use strict';var multer=require(_0x61ab('0x0'));var util=require(_0x61ab('0x1'));var path=require(_0x61ab('0x2'));var timeout=require('connect-timeout');var express=require(_0x61ab('0x3'));var router=express[_0x61ab('0x4')]();var fs_extra=require(_0x61ab('0x5'));var auth=require(_0x61ab('0x6'));var interaction=require(_0x61ab('0x7'));var config=require(_0x61ab('0x8'));var controller=require(_0x61ab('0x9'));router[_0x61ab('0xa')]('/',auth['isAuthenticated'](),controller[_0x61ab('0xb')]);router['get'](_0x61ab('0xc'),auth[_0x61ab('0xd')](),controller[_0x61ab('0xe')]);router[_0x61ab('0xa')](_0x61ab('0xf'),auth[_0x61ab('0xd')](),controller[_0x61ab('0x10')]);router['post']('/',auth[_0x61ab('0xd')](),controller[_0x61ab('0x11')]);router[_0x61ab('0x12')](_0x61ab('0xf'),auth[_0x61ab('0xd')](),controller[_0x61ab('0x13')]);router[_0x61ab('0x14')]('/:id',auth[_0x61ab('0xd')](),controller[_0x61ab('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfbf4=['fs-extra','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xfbf4,0x86));var _0x4fbf=function(_0x4c921c,_0x562de9){_0x4c921c=_0x4c921c-0x0;var _0x5533dd=_0xfbf4[_0x4c921c];return _0x5533dd;};'use strict';var multer=require(_0x4fbf('0x0'));var util=require(_0x4fbf('0x1'));var path=require(_0x4fbf('0x2'));var timeout=require(_0x4fbf('0x3'));var express=require(_0x4fbf('0x4'));var router=express[_0x4fbf('0x5')]();var fs_extra=require(_0x4fbf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4fbf('0x7'));var config=require('../../config/environment');var controller=require(_0x4fbf('0x8'));router[_0x4fbf('0x9')]('/',auth[_0x4fbf('0xa')](),controller['index']);router['get'](_0x4fbf('0xb'),auth[_0x4fbf('0xa')](),controller[_0x4fbf('0xc')]);router[_0x4fbf('0x9')](_0x4fbf('0xd'),auth[_0x4fbf('0xa')](),controller[_0x4fbf('0xe')]);router[_0x4fbf('0xf')]('/',auth[_0x4fbf('0xa')](),controller[_0x4fbf('0x10')]);router['put'](_0x4fbf('0xd'),auth[_0x4fbf('0xa')](),controller['update']);router[_0x4fbf('0x11')](_0x4fbf('0xd'),auth['isAuthenticated'](),controller[_0x4fbf('0x12')]);module[_0x4fbf('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index a3a54c5..18ec02c 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 _0x455d=['DATE','exports','STRING'];(function(_0xfd084b,_0x26977e){var _0x375d60=function(_0xfec175){while(--_0xfec175){_0xfd084b['push'](_0xfd084b['shift']());}};_0x375d60(++_0x26977e);}(_0x455d,0x190));var _0xd455=function(_0x37b485,_0x199066){_0x37b485=_0x37b485-0x0;var _0x498e89=_0x455d[_0x37b485];return _0x498e89;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xd455('0x0')]={'uniqueid':{'type':Sequelize[_0xd455('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xd455('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd455('0x2')]},'acceptAt':{'type':Sequelize[_0xd455('0x2')]},'exitAt':{'type':Sequelize[_0xd455('0x2')]},'reason':{'type':Sequelize[_0xd455('0x1')]}}; \ No newline at end of file +var _0x4fde=['STRING','DATE','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4fde,0x104));var _0xe4fd=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x4fde[_0x5c14f6];return _0x4949b3;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe4fd('0x0')]={'uniqueid':{'type':Sequelize[_0xe4fd('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe4fd('0x1')]},'joinAt':{'type':Sequelize[_0xe4fd('0x2')]},'leaveAt':{'type':Sequelize[_0xe4fd('0x2')]},'acceptAt':{'type':Sequelize[_0xe4fd('0x2')]},'exitAt':{'type':Sequelize[_0xe4fd('0x2')]},'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 1e1c114..d218644 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 _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','MailQueueReport','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x51e62,_0x57fc9e){var _0x4f1b90=function(_0x186235){while(--_0x186235){_0x51e62['push'](_0x51e62['shift']());}};_0x4f1b90(++_0x57fc9e);}(_0x90b1,0x1bb));var _0x190b=function(_0x101152,_0x397ab0){_0x101152=_0x101152-0x0;var _0xe1c465=_0x90b1[_0x101152];return _0xe1c465;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('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(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['MailQueueReport'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['MailQueueReport'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file +var _0x32b6=['sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x440f91,_0x3e30ee){var _0x256606=function(_0x124efb){while(--_0x124efb){_0x440f91['push'](_0x440f91['shift']());}};_0x256606(++_0x3e30ee);}(_0x32b6,0x1d1));var _0x632b=function(_0xe734df,_0x391344){_0xe734df=_0xe734df-0x0;var _0xfb50c7=_0x32b6[_0xe734df];return _0xfb50c7;};'use strict';var emlformat=require(_0x632b('0x0'));var rimraf=require(_0x632b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x632b('0x2'));var rp=require(_0x632b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x632b('0x4'));var util=require(_0x632b('0x5'));var path=require(_0x632b('0x6'));var sox=require(_0x632b('0x7'));var csv=require(_0x632b('0x8'));var ejs=require(_0x632b('0x9'));var fs=require('fs');var fs_extra=require(_0x632b('0xa'));var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x8'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var licenseUtil=require(_0x632b('0x16'));var db=require(_0x632b('0x17'))['db'];function respondWithStatusCode(_0xe81378,_0x3d8bed){_0x3d8bed=_0x3d8bed||0xcc;return function(_0x22c182){if(_0x22c182){return _0xe81378['sendStatus'](_0x3d8bed);}return _0xe81378[_0x632b('0x18')](_0x3d8bed)[_0x632b('0x19')]();};}function respondWithResult(_0x9246a6,_0x5a97da){_0x5a97da=_0x5a97da||0xc8;return function(_0x721883){if(_0x721883){return _0x9246a6[_0x632b('0x18')](_0x5a97da)[_0x632b('0x1a')](_0x721883);}};}function respondWithFilteredResult(_0x17ff9b,_0x40d410){return function(_0x21cdd3){if(_0x21cdd3){var _0x4efe39=typeof _0x40d410[_0x632b('0x1b')]==='undefined'&&typeof _0x40d410['limit']===_0x632b('0x1c');var _0x5afa1e=_0x21cdd3[_0x632b('0x1d')];var _0x3bb27f=_0x4efe39?0x0:_0x40d410[_0x632b('0x1b')];var _0x51c894=_0x4efe39?_0x21cdd3[_0x632b('0x1d')]:_0x40d410[_0x632b('0x1b')]+_0x40d410[_0x632b('0x1e')];var _0x3683e4;if(_0x51c894>=_0x5afa1e){_0x51c894=_0x5afa1e;_0x3683e4=0xc8;}else{_0x3683e4=0xce;}_0x17ff9b['status'](_0x3683e4);return _0x17ff9b[_0x632b('0x1f')](_0x632b('0x20'),_0x3bb27f+'-'+_0x51c894+'/'+_0x5afa1e)['json'](_0x21cdd3);}return null;};}function patchUpdates(_0x116f62){return function(_0x50b930){try{jsonpatch['apply'](_0x50b930,_0x116f62,!![]);}catch(_0x1b1092){return BPromise['reject'](_0x1b1092);}return _0x50b930[_0x632b('0x21')]();};}function saveUpdates(_0x1c4530,_0x2a6833){return function(_0x540bfb){if(_0x540bfb){return _0x540bfb[_0x632b('0x22')](_0x1c4530)[_0x632b('0x23')](function(_0x59d83a){return _0x59d83a;});}return null;};}function removeEntity(_0x1db8f5,_0x379dc2){return function(_0x30ffb9){if(_0x30ffb9){return _0x30ffb9[_0x632b('0x24')]()[_0x632b('0x23')](function(){_0x1db8f5[_0x632b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7b20,_0x11fe61){return function(_0x4d3a70){if(!_0x4d3a70){_0x5e7b20[_0x632b('0x25')](0x194);}return _0x4d3a70;};}function handleError(_0x954fa0,_0x5d6855){_0x5d6855=_0x5d6855||0x1f4;return function(_0x273e89){logger[_0x632b('0x26')](_0x273e89[_0x632b('0x27')]);if(_0x273e89[_0x632b('0x28')]){delete _0x273e89[_0x632b('0x28')];}_0x954fa0[_0x632b('0x18')](_0x5d6855)[_0x632b('0x29')](_0x273e89);};}exports[_0x632b('0x2a')]=function(_0x33a625,_0x4f8410){var _0x1bb484={},_0x35348e={},_0x1819fa={'count':0x0,'rows':[]};var _0x3999aa=_[_0x632b('0x2b')](db[_0x632b('0x2c')][_0x632b('0x2d')],function(_0x417d62){return{'name':_0x417d62[_0x632b('0x2e')],'type':_0x417d62[_0x632b('0x2f')][_0x632b('0x30')]};});_0x35348e[_0x632b('0x31')]=_[_0x632b('0x2b')](_0x3999aa,_0x632b('0x28'));_0x35348e[_0x632b('0x32')]=_[_0x632b('0x33')](_0x33a625[_0x632b('0x32')]);_0x35348e[_0x632b('0x34')]=_[_0x632b('0x35')](_0x35348e[_0x632b('0x31')],_0x35348e['query']);_0x1bb484[_0x632b('0x36')]=_[_0x632b('0x35')](_0x35348e[_0x632b('0x31')],qs[_0x632b('0x37')](_0x33a625['query'][_0x632b('0x37')]));_0x1bb484['attributes']=_0x1bb484[_0x632b('0x36')][_0x632b('0x38')]?_0x1bb484['attributes']:_0x35348e[_0x632b('0x31')];if(!_0x33a625[_0x632b('0x32')][_0x632b('0x39')](_0x632b('0x3a'))){_0x1bb484[_0x632b('0x1e')]=qs[_0x632b('0x1e')](_0x33a625[_0x632b('0x32')][_0x632b('0x1e')]);_0x1bb484['offset']=qs['offset'](_0x33a625[_0x632b('0x32')][_0x632b('0x1b')]);}_0x1bb484[_0x632b('0x3b')]=qs[_0x632b('0x3c')](_0x33a625[_0x632b('0x32')][_0x632b('0x3c')]);_0x1bb484[_0x632b('0x3d')]=qs[_0x632b('0x34')](_['pick'](_0x33a625['query'],_0x35348e[_0x632b('0x34')]),_0x3999aa);if(_0x33a625['query'][_0x632b('0x3e')]){_0x1bb484[_0x632b('0x3d')]=_[_0x632b('0x3f')](_0x1bb484[_0x632b('0x3d')],{'$or':_[_0x632b('0x2b')](_0x3999aa,function(_0x38266c){if(_0x38266c[_0x632b('0x2f')]!==_0x632b('0x40')){var _0x2730c2={};_0x2730c2[_0x38266c[_0x632b('0x28')]]={'$like':'%'+_0x33a625[_0x632b('0x32')][_0x632b('0x3e')]+'%'};return _0x2730c2;}})});}_0x1bb484=_[_0x632b('0x3f')]({},_0x1bb484,_0x33a625[_0x632b('0x41')]);var _0x13beaa={'where':_0x1bb484[_0x632b('0x3d')]};return db[_0x632b('0x2c')]['count'](_0x13beaa)['then'](function(_0x58e3cc){_0x1819fa['count']=_0x58e3cc;if(_0x33a625['query'][_0x632b('0x42')]){_0x1bb484['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x1bb484);})[_0x632b('0x23')](function(_0x4490d4){_0x1819fa[_0x632b('0x43')]=_0x4490d4;return _0x1819fa;})[_0x632b('0x23')](respondWithFilteredResult(_0x4f8410,_0x1bb484))['catch'](handleError(_0x4f8410,null));};exports[_0x632b('0x44')]=function(_0x238297,_0x387fce){var _0x4dbe4b={'raw':!![],'where':{'id':_0x238297[_0x632b('0x45')]['id']}},_0x15bb30={};_0x15bb30[_0x632b('0x31')]=_[_0x632b('0x33')](db[_0x632b('0x2c')][_0x632b('0x2d')]);_0x15bb30['query']=_[_0x632b('0x33')](_0x238297[_0x632b('0x32')]);_0x15bb30[_0x632b('0x34')]=_[_0x632b('0x35')](_0x15bb30['model'],_0x15bb30['query']);_0x4dbe4b[_0x632b('0x36')]=_[_0x632b('0x35')](_0x15bb30[_0x632b('0x31')],qs[_0x632b('0x37')](_0x238297[_0x632b('0x32')][_0x632b('0x37')]));_0x4dbe4b['attributes']=_0x4dbe4b[_0x632b('0x36')][_0x632b('0x38')]?_0x4dbe4b[_0x632b('0x36')]:_0x15bb30[_0x632b('0x31')];if(_0x238297[_0x632b('0x32')][_0x632b('0x42')]){_0x4dbe4b[_0x632b('0x46')]=[{'all':!![]}];}_0x4dbe4b=_[_0x632b('0x3f')]({},_0x4dbe4b,_0x238297['options']);return db[_0x632b('0x2c')]['find'](_0x4dbe4b)[_0x632b('0x23')](handleEntityNotFound(_0x387fce,null))['then'](respondWithResult(_0x387fce,null))[_0x632b('0x47')](handleError(_0x387fce,null));};exports[_0x632b('0x48')]=function(_0x16dfc7,_0x2c4561){return db[_0x632b('0x2c')]['create'](_0x16dfc7[_0x632b('0x49')],{})[_0x632b('0x23')](respondWithResult(_0x2c4561,0xc9))[_0x632b('0x47')](handleError(_0x2c4561,null));};exports['update']=function(_0x253aec,_0x16eb80){if(_0x253aec[_0x632b('0x49')]['id']){delete _0x253aec[_0x632b('0x49')]['id'];}return db[_0x632b('0x2c')]['find']({'where':{'id':_0x253aec[_0x632b('0x45')]['id']}})['then'](handleEntityNotFound(_0x16eb80,null))[_0x632b('0x23')](saveUpdates(_0x253aec[_0x632b('0x49')],null))[_0x632b('0x23')](respondWithResult(_0x16eb80,null))[_0x632b('0x47')](handleError(_0x16eb80,null));};exports[_0x632b('0x24')]=function(_0x52785a,_0x4c9b4e){return db[_0x632b('0x2c')][_0x632b('0x4a')]({'where':{'id':_0x52785a[_0x632b('0x45')]['id']}})[_0x632b('0x23')](handleEntityNotFound(_0x4c9b4e,null))[_0x632b('0x23')](removeEntity(_0x4c9b4e,null))[_0x632b('0x47')](handleError(_0x4c9b4e,null));};exports['describe']=function(_0xda006b,_0x1d35b2){return db[_0x632b('0x2c')]['describe']()[_0x632b('0x23')](respondWithResult(_0x1d35b2,null))[_0x632b('0x47')](handleError(_0x1d35b2,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c9cc382..7d30bd7 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 _0x80ea=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue'];(function(_0x920b69,_0x24d1c8){var _0xeb2bea=function(_0x33fe00){while(--_0x33fe00){_0x920b69['push'](_0x920b69['shift']());}};_0xeb2bea(++_0x24d1c8);}(_0x80ea,0x1cf));var _0xa80e=function(_0x53e87d,_0xa1ad1f){_0x53e87d=_0x53e87d-0x0;var _0x1bb55d=_0x80ea[_0x53e87d];return _0x1bb55d;};'use strict';var _=require(_0xa80e('0x0'));var util=require(_0xa80e('0x1'));var logger=require(_0xa80e('0x2'))(_0xa80e('0x3'));var moment=require(_0xa80e('0x4'));var BPromise=require(_0xa80e('0x5'));var rp=require(_0xa80e('0x6'));var fs=require('fs');var path=require(_0xa80e('0x7'));var rimraf=require(_0xa80e('0x8'));var config=require(_0xa80e('0x9'));var attributes=require(_0xa80e('0xa'));module['exports']=function(_0x5a1c7f,_0x44985b){return _0x5a1c7f['define'](_0xa80e('0xb'),attributes,{'tableName':_0xa80e('0xc'),'paranoid':![],'indexes':[{'name':_0xa80e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb550=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define'];(function(_0x4c4b35,_0x4593ea){var _0x98cd3e=function(_0x52a924){while(--_0x52a924){_0x4c4b35['push'](_0x4c4b35['shift']());}};_0x98cd3e(++_0x4593ea);}(_0xb550,0x183));var _0x0b55=function(_0x41e290,_0x52ec90){_0x41e290=_0x41e290-0x0;var _0x1f4ffa=_0xb550[_0x41e290];return _0x1f4ffa;};'use strict';var _=require(_0x0b55('0x0'));var util=require(_0x0b55('0x1'));var logger=require('../../config/logger')(_0x0b55('0x2'));var moment=require('moment');var BPromise=require(_0x0b55('0x3'));var rp=require(_0x0b55('0x4'));var fs=require('fs');var path=require(_0x0b55('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0b55('0x6'));module[_0x0b55('0x7')]=function(_0x3b5007,_0x144baf){return _0x3b5007[_0x0b55('0x8')](_0x0b55('0x9'),attributes,{'tableName':_0x0b55('0xa'),'paranoid':![],'indexes':[{'name':_0x0b55('0xb'),'fields':[_0x0b55('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 7b37d85..490ca6d 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x328718,_0x26e2c2){var _0x2d8f14=function(_0x389f90){while(--_0x389f90){_0x328718['push'](_0x328718['shift']());}};_0x2d8f14(++_0x26e2c2);}(_0xdb28,0x106));var _0x8db2=function(_0x27027e,_0x46875b){_0x27027e=_0x27027e-0x0;var _0xed80ae=_0xdb28[_0x27027e];return _0xed80ae;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50a70d,_0x18169b){var _0x1d6346=function(_0x49c1cf){while(--_0x49c1cf){_0x50a70d['push'](_0x50a70d['shift']());}};_0x1d6346(++_0x18169b);}(_0x326f,0xd1));var _0xf326=function(_0x46bb05,_0x426833){_0x46bb05=_0x46bb05-0x0;var _0x33527c=_0x326f[_0x46bb05];return _0x33527c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 56afecf..392563f 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2b3b8e,_0x30949e){var _0x1ae282=function(_0x1673ef){while(--_0x1673ef){_0x2b3b8e['push'](_0x2b3b8e['shift']());}};_0x1ae282(++_0x30949e);}(_0xedd9,0xfc));var _0x9edd=function(_0x1595c1,_0x629d82){_0x1595c1=_0x1595c1-0x0;var _0x58bba3=_0xedd9[_0x1595c1];return _0x58bba3;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3bdee5,_0x2eed61){var _0x4ead64=function(_0x1d9873){while(--_0x1d9873){_0x3bdee5['push'](_0x3bdee5['shift']());}};_0x4ead64(++_0x2eed61);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcb91[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8b059f8..3a3bb60 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 _0x7c2c=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7c2c,0xaf));var _0xc7c2=function(_0x1e5e31,_0x5a0775){_0x1e5e31=_0x1e5e31-0x0;var _0x4a1750=_0x7c2c[_0x1e5e31];return _0x4a1750;};'use strict';var Sequelize=require(_0xc7c2('0x0'));module[_0xc7c2('0x1')]={'description':{'type':Sequelize[_0xc7c2('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xc7c2('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xc7c2('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xc7c2('0x4')]},'tls':{'type':Sequelize[_0xc7c2('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xc7c2('0x2')],'defaultValue':_0xc7c2('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc7c2('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc7c2('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc7c2('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa831=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xa831,0x138));var _0x1a83=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xa831[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require(_0x1a83('0x0'));module[_0x1a83('0x1')]={'description':{'type':Sequelize[_0x1a83('0x2')]},'host':{'type':Sequelize[_0x1a83('0x2')]},'authentication':{'type':Sequelize[_0x1a83('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1a83('0x2')]},'port':{'type':Sequelize[_0x1a83('0x4')]},'tls':{'type':Sequelize[_0x1a83('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1a83('0x2')],'defaultValue':_0x1a83('0x5')},'connTimeout':{'type':Sequelize[_0x1a83('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1a83('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1a83('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 6e1d961..318efb8 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 _0xbe1d=['path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','api','bluebird','request-promise'];(function(_0x1e1e07,_0xa99d3b){var _0x4e7455=function(_0x5d1846){while(--_0x5d1846){_0x1e1e07['push'](_0x1e1e07['shift']());}};_0x4e7455(++_0xa99d3b);}(_0xbe1d,0x10f));var _0xdbe1=function(_0x54d0b1,_0x1abf62){_0x54d0b1=_0x54d0b1-0x0;var _0x26a67c=_0xbe1d[_0x54d0b1];return _0x26a67c;};'use strict';var _=require(_0xdbe1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbe1('0x1'));var moment=require('moment');var BPromise=require(_0xdbe1('0x2'));var rp=require(_0xdbe1('0x3'));var fs=require('fs');var path=require(_0xdbe1('0x4'));var rimraf=require(_0xdbe1('0x5'));var config=require(_0xdbe1('0x6'));var attributes=require(_0xdbe1('0x7'));module[_0xdbe1('0x8')]=function(_0x5f2e86,_0x9f706b){return _0x5f2e86[_0xdbe1('0x9')](_0xdbe1('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x090f=['api','moment','path','rimraf','../../config/environment','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x1f9862,_0x1047d7){var _0x5c41b0=function(_0x4790a3){while(--_0x4790a3){_0x1f9862['push'](_0x1f9862['shift']());}};_0x5c41b0(++_0x1047d7);}(_0x090f,0x76));var _0xf090=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x090f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf090('0x0'));var util=require(_0xf090('0x1'));var logger=require(_0xf090('0x2'))(_0xf090('0x3'));var moment=require(_0xf090('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf090('0x5'));var rimraf=require(_0xf090('0x6'));var config=require(_0xf090('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x37fd4b,_0x14c238){return _0x37fd4b[_0xf090('0x8')](_0xf090('0x9'),attributes,{'tableName':_0xf090('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 50d8eee..5407178 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 _0xeec0=['client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','raw','options','where','limit','include','map','model','attributes','then','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0xeec0,0x177));var _0x0eec=function(_0x449e55,_0x53912a){_0x449e55=_0x449e55-0x0;var _0x5f5aa2=_0xeec0[_0x449e55];return _0x5f5aa2;};'use strict';var _=require(_0x0eec('0x0'));var util=require(_0x0eec('0x1'));var moment=require(_0x0eec('0x2'));var BPromise=require(_0x0eec('0x3'));var rs=require(_0x0eec('0x4'));var fs=require('fs');var Redis=require(_0x0eec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0eec('0x6'));var logger=require(_0x0eec('0x7'))(_0x0eec('0x8'));var config=require('../../config/environment');var jayson=require(_0x0eec('0x9'));var client=jayson[_0x0eec('0xa')][_0x0eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a85ec,_0x2c50ba,_0x583ac8){return new BPromise(function(_0x57f557,_0x1618eb){return client[_0x0eec('0xc')](_0x4a85ec,_0x583ac8)['then'](function(_0x149b87){logger[_0x0eec('0xd')](_0x0eec('0xe'),_0x2c50ba,_0x0eec('0xf'));logger['debug'](_0x0eec('0x10'),_0x2c50ba,_0x0eec('0xf'),JSON['stringify'](_0x149b87));if(_0x149b87[_0x0eec('0x11')]){if(_0x149b87[_0x0eec('0x11')][_0x0eec('0x12')]===0x1f4){logger[_0x0eec('0x11')](_0x0eec('0xe'),_0x2c50ba,_0x149b87['error']['message']);return _0x1618eb(_0x149b87[_0x0eec('0x11')][_0x0eec('0x13')]);}logger[_0x0eec('0x11')](_0x0eec('0xe'),_0x2c50ba,_0x149b87[_0x0eec('0x11')][_0x0eec('0x13')]);return _0x57f557(_0x149b87[_0x0eec('0x11')][_0x0eec('0x13')]);}else{logger[_0x0eec('0xd')](_0x0eec('0xe'),_0x2c50ba,_0x0eec('0xf'));_0x57f557(_0x149b87['result'][_0x0eec('0x13')]);}})[_0x0eec('0x14')](function(_0x249ed8){logger[_0x0eec('0x11')](_0x0eec('0xe'),_0x2c50ba,_0x249ed8);_0x1618eb(_0x249ed8);});});}exports[_0x0eec('0x15')]=function(_0x5658d4){var _0x772966=this;return new Promise(function(_0x5c0449,_0x523533){return db[_0x0eec('0x16')][_0x0eec('0x17')]({'raw':_0x5658d4['options']?_0x5658d4['options'][_0x0eec('0x18')]===undefined?!![]:![]:!![],'where':_0x5658d4[_0x0eec('0x19')]?_0x5658d4[_0x0eec('0x19')][_0x0eec('0x1a')]||null:null,'attributes':_0x5658d4[_0x0eec('0x19')]?_0x5658d4['options']['attributes']||null:null,'limit':_0x5658d4[_0x0eec('0x19')]?_0x5658d4[_0x0eec('0x19')][_0x0eec('0x1b')]||null:null,'include':_0x5658d4[_0x0eec('0x19')]?_0x5658d4[_0x0eec('0x19')][_0x0eec('0x1c')]?_[_0x0eec('0x1d')](_0x5658d4[_0x0eec('0x19')][_0x0eec('0x1c')],function(_0x1d9485){return{'model':db[_0x1d9485[_0x0eec('0x1e')]],'as':_0x1d9485['as'],'attributes':_0x1d9485['attributes'],'include':_0x1d9485[_0x0eec('0x1c')]?_[_0x0eec('0x1d')](_0x1d9485[_0x0eec('0x1c')],function(_0x327ad5){return{'model':db[_0x327ad5[_0x0eec('0x1e')]],'as':_0x327ad5['as'],'attributes':_0x327ad5[_0x0eec('0x1f')],'include':_0x327ad5['include']?_[_0x0eec('0x1d')](_0x327ad5[_0x0eec('0x1c')],function(_0x4664b3){return{'model':db[_0x4664b3[_0x0eec('0x1e')]],'as':_0x4664b3['as'],'attributes':_0x4664b3[_0x0eec('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0eec('0x20')](function(_0x100234){logger[_0x0eec('0xd')](_0x0eec('0x15'),_0x5658d4);logger[_0x0eec('0x21')](_0x0eec('0x15'),_0x5658d4,JSON[_0x0eec('0x22')](_0x100234));_0x5c0449(_0x100234);})['catch'](function(_0x24f873){logger[_0x0eec('0x11')](_0x0eec('0x15'),_0x24f873[_0x0eec('0x13')],_0x5658d4);_0x523533(_0x772966['error'](0x1f4,_0x24f873[_0x0eec('0x13')]));});});}; \ No newline at end of file +var _0xc99a=['http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn','MailServerIn','findAll','raw','options','where','limit','include','map','model','attributes','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc99a,0x7c));var _0xac99=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc99a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac99('0x0'));var util=require(_0xac99('0x1'));var moment=require(_0xac99('0x2'));var BPromise=require(_0xac99('0x3'));var rs=require(_0xac99('0x4'));var fs=require('fs');var Redis=require(_0xac99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xac99('0x6'));var logger=require(_0xac99('0x7'))(_0xac99('0x8'));var config=require(_0xac99('0x9'));var jayson=require(_0xac99('0xa'));var client=jayson[_0xac99('0xb')][_0xac99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4594ec,_0x2cb406,_0x1ae607){return new BPromise(function(_0x458f0b,_0x7335c8){return client['request'](_0x4594ec,_0x1ae607)[_0xac99('0xd')](function(_0x326bb5){logger['info'](_0xac99('0xe'),_0x2cb406,_0xac99('0xf'));logger[_0xac99('0x10')](_0xac99('0x11'),_0x2cb406,'request\x20sent',JSON[_0xac99('0x12')](_0x326bb5));if(_0x326bb5[_0xac99('0x13')]){if(_0x326bb5['error']['code']===0x1f4){logger['error'](_0xac99('0xe'),_0x2cb406,_0x326bb5['error'][_0xac99('0x14')]);return _0x7335c8(_0x326bb5[_0xac99('0x13')][_0xac99('0x14')]);}logger[_0xac99('0x13')](_0xac99('0xe'),_0x2cb406,_0x326bb5[_0xac99('0x13')]['message']);return _0x458f0b(_0x326bb5[_0xac99('0x13')]['message']);}else{logger['info'](_0xac99('0xe'),_0x2cb406,_0xac99('0xf'));_0x458f0b(_0x326bb5['result'][_0xac99('0x14')]);}})[_0xac99('0x15')](function(_0xe9f339){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2cb406,_0xe9f339);_0x7335c8(_0xe9f339);});});}exports[_0xac99('0x16')]=function(_0x2d5a20){var _0xa52fe2=this;return new Promise(function(_0x24b408,_0x400b29){return db[_0xac99('0x17')][_0xac99('0x18')]({'raw':_0x2d5a20['options']?_0x2d5a20['options'][_0xac99('0x19')]===undefined?!![]:![]:!![],'where':_0x2d5a20[_0xac99('0x1a')]?_0x2d5a20['options'][_0xac99('0x1b')]||null:null,'attributes':_0x2d5a20[_0xac99('0x1a')]?_0x2d5a20['options']['attributes']||null:null,'limit':_0x2d5a20[_0xac99('0x1a')]?_0x2d5a20[_0xac99('0x1a')][_0xac99('0x1c')]||null:null,'include':_0x2d5a20[_0xac99('0x1a')]?_0x2d5a20[_0xac99('0x1a')][_0xac99('0x1d')]?_[_0xac99('0x1e')](_0x2d5a20[_0xac99('0x1a')][_0xac99('0x1d')],function(_0x50866e){return{'model':db[_0x50866e[_0xac99('0x1f')]],'as':_0x50866e['as'],'attributes':_0x50866e[_0xac99('0x20')],'include':_0x50866e[_0xac99('0x1d')]?_[_0xac99('0x1e')](_0x50866e[_0xac99('0x1d')],function(_0x2d3b43){return{'model':db[_0x2d3b43['model']],'as':_0x2d3b43['as'],'attributes':_0x2d3b43[_0xac99('0x20')],'include':_0x2d3b43[_0xac99('0x1d')]?_[_0xac99('0x1e')](_0x2d3b43[_0xac99('0x1d')],function(_0x586fd3){return{'model':db[_0x586fd3[_0xac99('0x1f')]],'as':_0x586fd3['as'],'attributes':_0x586fd3['attributes']};}):[]};}):[]};}):[]:[]})[_0xac99('0xd')](function(_0x2423fc){logger[_0xac99('0x21')]('GetMailServerIn',_0x2d5a20);logger['debug'](_0xac99('0x16'),_0x2d5a20,JSON['stringify'](_0x2423fc));_0x24b408(_0x2423fc);})['catch'](function(_0xa4b35e){logger[_0xac99('0x13')]('GetMailServerIn',_0xa4b35e['message'],_0x2d5a20);_0x400b29(_0xa52fe2['error'](0x1f4,_0xa4b35e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0de717a..6173453 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7a54,0x106));var _0x47a5=function(_0x11619c,_0x530d37){_0x11619c=_0x11619c-0x0;var _0x150458=_0x7a54[_0x11619c];return _0x150458;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c92d3a4..e4d6101 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 _0xda3f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x4052c0,_0x4271ab){var _0x296f04=function(_0x5373fc){while(--_0x5373fc){_0x4052c0['push'](_0x4052c0['shift']());}};_0x296f04(++_0x4271ab);}(_0xda3f,0xec));var _0xfda3=function(_0x44f98b,_0x705a21){_0x44f98b=_0x44f98b-0x0;var _0x87a325=_0xda3f[_0x44f98b];return _0x87a325;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'description':{'type':Sequelize[_0xfda3('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfda3('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xfda3('0x1')]},'authentication':{'type':Sequelize[_0xfda3('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfff0=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x28caf6,_0x266569){var _0x1aa957=function(_0x46b59b){while(--_0x46b59b){_0x28caf6['push'](_0x28caf6['shift']());}};_0x1aa957(++_0x266569);}(_0xfff0,0x139));var _0x0fff=function(_0x19fb64,_0x46e436){_0x19fb64=_0x19fb64-0x0;var _0x4321f4=_0xfff0[_0x19fb64];return _0x4321f4;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'description':{'type':Sequelize[_0x0fff('0x1')]},'host':{'type':Sequelize[_0x0fff('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0fff('0x1')]},'port':{'type':Sequelize[_0x0fff('0x2')]},'secure':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 25f3dc1..1ced861 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 _0x8e02=['save','update','destroy','then','end','stack','name','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','rawAttributes','includeAll','options','find','create','body','catch','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','apply','reject'];(function(_0x54b458,_0x4da21b){var _0x18d704=function(_0x3ca278){while(--_0x3ca278){_0x54b458['push'](_0x54b458['shift']());}};_0x18d704(++_0x4da21b);}(_0x8e02,0x13e));var _0x28e0=function(_0x506b4b,_0x53ef7c){_0x506b4b=_0x506b4b-0x0;var _0x3dd016=_0x8e02[_0x506b4b];return _0x3dd016;};'use strict';var emlformat=require(_0x28e0('0x0'));var rimraf=require(_0x28e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28e0('0x2'));var rp=require(_0x28e0('0x3'));var moment=require('moment');var BPromise=require(_0x28e0('0x4'));var Mustache=require(_0x28e0('0x5'));var util=require(_0x28e0('0x6'));var path=require(_0x28e0('0x7'));var sox=require('sox');var csv=require(_0x28e0('0x8'));var ejs=require(_0x28e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x28e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x28e0('0xb'));var deskjs=require(_0x28e0('0xc'));var toCsv=require(_0x28e0('0x8'));var querystring=require(_0x28e0('0xd'));var Papa=require('papaparse');var Redis=require(_0x28e0('0xe'));var authService=require(_0x28e0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28e0('0x10'));var logger=require(_0x28e0('0x11'))(_0x28e0('0x12'));var utils=require(_0x28e0('0x13'));var config=require(_0x28e0('0x14'));var licenseUtil=require(_0x28e0('0x15'));var db=require(_0x28e0('0x16'))['db'];function respondWithStatusCode(_0x548f50,_0x44f353){_0x44f353=_0x44f353||0xcc;return function(_0x34dc2c){if(_0x34dc2c){return _0x548f50[_0x28e0('0x17')](_0x44f353);}return _0x548f50[_0x28e0('0x18')](_0x44f353)['end']();};}function respondWithResult(_0x4c0113,_0x4f5c4a){_0x4f5c4a=_0x4f5c4a||0xc8;return function(_0xe74684){if(_0xe74684){return _0x4c0113['status'](_0x4f5c4a)[_0x28e0('0x19')](_0xe74684);}};}function respondWithFilteredResult(_0x48aa6f,_0x23bb6d){return function(_0x3c8b6e){if(_0x3c8b6e){var _0x3635bc=typeof _0x23bb6d[_0x28e0('0x1a')]==='undefined'&&typeof _0x23bb6d['limit']==='undefined';var _0x52fe1e=_0x3c8b6e[_0x28e0('0x1b')];var _0x3702a8=_0x3635bc?0x0:_0x23bb6d[_0x28e0('0x1a')];var _0x32ba24=_0x3635bc?_0x3c8b6e[_0x28e0('0x1b')]:_0x23bb6d['offset']+_0x23bb6d['limit'];var _0x49ff42;if(_0x32ba24>=_0x52fe1e){_0x32ba24=_0x52fe1e;_0x49ff42=0xc8;}else{_0x49ff42=0xce;}_0x48aa6f[_0x28e0('0x18')](_0x49ff42);return _0x48aa6f[_0x28e0('0x1c')](_0x28e0('0x1d'),_0x3702a8+'-'+_0x32ba24+'/'+_0x52fe1e)['json'](_0x3c8b6e);}return null;};}function patchUpdates(_0x1c6071){return function(_0x2cfec4){try{jsonpatch[_0x28e0('0x1e')](_0x2cfec4,_0x1c6071,!![]);}catch(_0x3c121c){return BPromise[_0x28e0('0x1f')](_0x3c121c);}return _0x2cfec4[_0x28e0('0x20')]();};}function saveUpdates(_0x145545,_0x488410){return function(_0xacdc40){if(_0xacdc40){return _0xacdc40[_0x28e0('0x21')](_0x145545)['then'](function(_0x37e2eb){return _0x37e2eb;});}return null;};}function removeEntity(_0x3608b5,_0xd9a599){return function(_0x56b0e0){if(_0x56b0e0){return _0x56b0e0[_0x28e0('0x22')]()[_0x28e0('0x23')](function(){_0x3608b5[_0x28e0('0x18')](0xcc)[_0x28e0('0x24')]();});}};}function handleEntityNotFound(_0x423453,_0x41dc18){return function(_0x1bdc42){if(!_0x1bdc42){_0x423453[_0x28e0('0x17')](0x194);}return _0x1bdc42;};}function handleError(_0x59f63e,_0x4a741c){_0x4a741c=_0x4a741c||0x1f4;return function(_0x5e63ca){logger['error'](_0x5e63ca[_0x28e0('0x25')]);if(_0x5e63ca[_0x28e0('0x26')]){delete _0x5e63ca[_0x28e0('0x26')];}_0x59f63e[_0x28e0('0x18')](_0x4a741c)['send'](_0x5e63ca);};}exports['index']=function(_0x1937bb,_0x39b016){var _0xf460ea={},_0x339cb0={},_0x1eb92f={'count':0x0,'rows':[]};var _0x2ef557=_[_0x28e0('0x27')](db[_0x28e0('0x28')]['rawAttributes'],function(_0x264628){return{'name':_0x264628[_0x28e0('0x29')],'type':_0x264628[_0x28e0('0x2a')][_0x28e0('0x2b')]};});_0x339cb0[_0x28e0('0x2c')]=_[_0x28e0('0x27')](_0x2ef557,_0x28e0('0x26'));_0x339cb0[_0x28e0('0x2d')]=_[_0x28e0('0x2e')](_0x1937bb[_0x28e0('0x2d')]);_0x339cb0[_0x28e0('0x2f')]=_[_0x28e0('0x30')](_0x339cb0[_0x28e0('0x2c')],_0x339cb0['query']);_0xf460ea[_0x28e0('0x31')]=_['intersection'](_0x339cb0['model'],qs[_0x28e0('0x32')](_0x1937bb['query'][_0x28e0('0x32')]));_0xf460ea['attributes']=_0xf460ea['attributes'][_0x28e0('0x33')]?_0xf460ea['attributes']:_0x339cb0[_0x28e0('0x2c')];if(!_0x1937bb['query'][_0x28e0('0x34')]('nolimit')){_0xf460ea['limit']=qs[_0x28e0('0x35')](_0x1937bb[_0x28e0('0x2d')]['limit']);_0xf460ea[_0x28e0('0x1a')]=qs['offset'](_0x1937bb['query'][_0x28e0('0x1a')]);}_0xf460ea[_0x28e0('0x36')]=qs[_0x28e0('0x37')](_0x1937bb[_0x28e0('0x2d')][_0x28e0('0x37')]);_0xf460ea[_0x28e0('0x38')]=qs[_0x28e0('0x2f')](_['pick'](_0x1937bb[_0x28e0('0x2d')],_0x339cb0['filters']),_0x2ef557);if(_0x1937bb[_0x28e0('0x2d')][_0x28e0('0x39')]){_0xf460ea[_0x28e0('0x38')]=_[_0x28e0('0x3a')](_0xf460ea[_0x28e0('0x38')],{'$or':_[_0x28e0('0x27')](_0x2ef557,function(_0x9e4187){if(_0x9e4187[_0x28e0('0x2a')]!==_0x28e0('0x3b')){var _0x1a3ab4={};_0x1a3ab4[_0x9e4187[_0x28e0('0x26')]]={'$like':'%'+_0x1937bb[_0x28e0('0x2d')][_0x28e0('0x39')]+'%'};return _0x1a3ab4;}})});}_0xf460ea=_[_0x28e0('0x3a')]({},_0xf460ea,_0x1937bb['options']);var _0x24c892={'where':_0xf460ea[_0x28e0('0x38')]};return db['MailServerOut'][_0x28e0('0x1b')](_0x24c892)[_0x28e0('0x23')](function(_0x248fe2){_0x1eb92f[_0x28e0('0x1b')]=_0x248fe2;if(_0x1937bb[_0x28e0('0x2d')]['includeAll']){_0xf460ea['include']=[{'all':!![]}];}return db[_0x28e0('0x28')][_0x28e0('0x3c')](_0xf460ea);})['then'](function(_0x1ab9fa){_0x1eb92f[_0x28e0('0x3d')]=_0x1ab9fa;return _0x1eb92f;})[_0x28e0('0x23')](respondWithFilteredResult(_0x39b016,_0xf460ea))['catch'](handleError(_0x39b016,null));};exports['show']=function(_0x22396b,_0x27b24d){var _0x341775={'raw':!![],'where':{'id':_0x22396b['params']['id']}},_0x37f07d={};_0x37f07d[_0x28e0('0x2c')]=_[_0x28e0('0x2e')](db['MailServerOut'][_0x28e0('0x3e')]);_0x37f07d[_0x28e0('0x2d')]=_[_0x28e0('0x2e')](_0x22396b['query']);_0x37f07d[_0x28e0('0x2f')]=_[_0x28e0('0x30')](_0x37f07d['model'],_0x37f07d[_0x28e0('0x2d')]);_0x341775['attributes']=_[_0x28e0('0x30')](_0x37f07d[_0x28e0('0x2c')],qs[_0x28e0('0x32')](_0x22396b['query']['fields']));_0x341775[_0x28e0('0x31')]=_0x341775['attributes'][_0x28e0('0x33')]?_0x341775[_0x28e0('0x31')]:_0x37f07d[_0x28e0('0x2c')];if(_0x22396b['query'][_0x28e0('0x3f')]){_0x341775['include']=[{'all':!![]}];}_0x341775=_[_0x28e0('0x3a')]({},_0x341775,_0x22396b[_0x28e0('0x40')]);return db[_0x28e0('0x28')][_0x28e0('0x41')](_0x341775)['then'](handleEntityNotFound(_0x27b24d,null))['then'](respondWithResult(_0x27b24d,null))['catch'](handleError(_0x27b24d,null));};exports[_0x28e0('0x42')]=function(_0x48ebc9,_0x3ef3ef){return db['MailServerOut'][_0x28e0('0x42')](_0x48ebc9[_0x28e0('0x43')],{})['then'](respondWithResult(_0x3ef3ef,0xc9))[_0x28e0('0x44')](handleError(_0x3ef3ef,null));};exports['update']=function(_0x3015bb,_0x5b0437){if(_0x3015bb['body']['id']){delete _0x3015bb[_0x28e0('0x43')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x3015bb[_0x28e0('0x45')]['id']}})[_0x28e0('0x23')](handleEntityNotFound(_0x5b0437,null))[_0x28e0('0x23')](saveUpdates(_0x3015bb['body'],null))[_0x28e0('0x23')](respondWithResult(_0x5b0437,null))['catch'](handleError(_0x5b0437,null));};exports[_0x28e0('0x22')]=function(_0x163ef3,_0x2bc800){return db[_0x28e0('0x28')]['find']({'where':{'id':_0x163ef3['params']['id']}})[_0x28e0('0x23')](handleEntityNotFound(_0x2bc800,null))['then'](removeEntity(_0x2bc800,null))[_0x28e0('0x44')](handleError(_0x2bc800,null));}; \ No newline at end of file +var _0x734d=['merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','filters','filter','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x734d,0x131));var _0xd734=function(_0x1686d4,_0x107bc8){_0x1686d4=_0x1686d4-0x0;var _0x248dc8=_0x734d[_0x1686d4];return _0x248dc8;};'use strict';var emlformat=require(_0xd734('0x0'));var rimraf=require(_0xd734('0x1'));var zipdir=require(_0xd734('0x2'));var jsonpatch=require(_0xd734('0x3'));var rp=require(_0xd734('0x4'));var moment=require(_0xd734('0x5'));var BPromise=require(_0xd734('0x6'));var Mustache=require(_0xd734('0x7'));var util=require(_0xd734('0x8'));var path=require(_0xd734('0x9'));var sox=require(_0xd734('0xa'));var csv=require('to-csv');var ejs=require(_0xd734('0xb'));var fs=require('fs');var fs_extra=require(_0xd734('0xc'));var _=require('lodash');var squel=require(_0xd734('0xd'));var crypto=require(_0xd734('0xe'));var jsforce=require(_0xd734('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd734('0x10'));var querystring=require(_0xd734('0x11'));var Papa=require(_0xd734('0x12'));var Redis=require(_0xd734('0x13'));var authService=require(_0xd734('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd734('0x15'));var logger=require(_0xd734('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd734('0x17'));var licenseUtil=require(_0xd734('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fdaf1,_0x11ac4e){_0x11ac4e=_0x11ac4e||0xcc;return function(_0x2ae8a0){if(_0x2ae8a0){return _0x1fdaf1[_0xd734('0x19')](_0x11ac4e);}return _0x1fdaf1[_0xd734('0x1a')](_0x11ac4e)[_0xd734('0x1b')]();};}function respondWithResult(_0x3cb3a3,_0x2ab775){_0x2ab775=_0x2ab775||0xc8;return function(_0x18b156){if(_0x18b156){return _0x3cb3a3['status'](_0x2ab775)[_0xd734('0x1c')](_0x18b156);}};}function respondWithFilteredResult(_0x226aa2,_0x54403c){return function(_0x2c7b1b){if(_0x2c7b1b){var _0x17e866=typeof _0x54403c[_0xd734('0x1d')]==='undefined'&&typeof _0x54403c[_0xd734('0x1e')]==='undefined';var _0x23cda7=_0x2c7b1b[_0xd734('0x1f')];var _0x245628=_0x17e866?0x0:_0x54403c[_0xd734('0x1d')];var _0x3da23a=_0x17e866?_0x2c7b1b[_0xd734('0x1f')]:_0x54403c['offset']+_0x54403c['limit'];var _0x394e82;if(_0x3da23a>=_0x23cda7){_0x3da23a=_0x23cda7;_0x394e82=0xc8;}else{_0x394e82=0xce;}_0x226aa2[_0xd734('0x1a')](_0x394e82);return _0x226aa2[_0xd734('0x20')](_0xd734('0x21'),_0x245628+'-'+_0x3da23a+'/'+_0x23cda7)['json'](_0x2c7b1b);}return null;};}function patchUpdates(_0x2d088c){return function(_0x432a7c){try{jsonpatch[_0xd734('0x22')](_0x432a7c,_0x2d088c,!![]);}catch(_0x27079c){return BPromise[_0xd734('0x23')](_0x27079c);}return _0x432a7c['save']();};}function saveUpdates(_0x5e8afc,_0x3ac51e){return function(_0x294fbe){if(_0x294fbe){return _0x294fbe[_0xd734('0x24')](_0x5e8afc)[_0xd734('0x25')](function(_0x43ef35){return _0x43ef35;});}return null;};}function removeEntity(_0x5d4d2a,_0x484501){return function(_0x119749){if(_0x119749){return _0x119749['destroy']()[_0xd734('0x25')](function(){_0x5d4d2a['status'](0xcc)[_0xd734('0x1b')]();});}};}function handleEntityNotFound(_0x40bb43,_0xd387c3){return function(_0x19a819){if(!_0x19a819){_0x40bb43[_0xd734('0x19')](0x194);}return _0x19a819;};}function handleError(_0x4e14df,_0x1e56e7){_0x1e56e7=_0x1e56e7||0x1f4;return function(_0x4b06a3){logger[_0xd734('0x26')](_0x4b06a3[_0xd734('0x27')]);if(_0x4b06a3[_0xd734('0x28')]){delete _0x4b06a3[_0xd734('0x28')];}_0x4e14df[_0xd734('0x1a')](_0x1e56e7)[_0xd734('0x29')](_0x4b06a3);};}exports[_0xd734('0x2a')]=function(_0x9dc670,_0xeff2e6){var _0x4c5eac={},_0x28d36c={},_0x449376={'count':0x0,'rows':[]};var _0x1d5b56=_[_0xd734('0x2b')](db[_0xd734('0x2c')][_0xd734('0x2d')],function(_0x3aafee){return{'name':_0x3aafee['fieldName'],'type':_0x3aafee[_0xd734('0x2e')][_0xd734('0x2f')]};});_0x28d36c[_0xd734('0x30')]=_[_0xd734('0x2b')](_0x1d5b56,_0xd734('0x28'));_0x28d36c[_0xd734('0x31')]=_[_0xd734('0x32')](_0x9dc670[_0xd734('0x31')]);_0x28d36c['filters']=_[_0xd734('0x33')](_0x28d36c[_0xd734('0x30')],_0x28d36c[_0xd734('0x31')]);_0x4c5eac[_0xd734('0x34')]=_['intersection'](_0x28d36c['model'],qs[_0xd734('0x35')](_0x9dc670[_0xd734('0x31')]['fields']));_0x4c5eac[_0xd734('0x34')]=_0x4c5eac[_0xd734('0x34')][_0xd734('0x36')]?_0x4c5eac['attributes']:_0x28d36c[_0xd734('0x30')];if(!_0x9dc670[_0xd734('0x31')]['hasOwnProperty']('nolimit')){_0x4c5eac[_0xd734('0x1e')]=qs[_0xd734('0x1e')](_0x9dc670[_0xd734('0x31')][_0xd734('0x1e')]);_0x4c5eac[_0xd734('0x1d')]=qs[_0xd734('0x1d')](_0x9dc670[_0xd734('0x31')][_0xd734('0x1d')]);}_0x4c5eac[_0xd734('0x37')]=qs['sort'](_0x9dc670[_0xd734('0x31')][_0xd734('0x38')]);_0x4c5eac['where']=qs[_0xd734('0x39')](_['pick'](_0x9dc670[_0xd734('0x31')],_0x28d36c[_0xd734('0x39')]),_0x1d5b56);if(_0x9dc670[_0xd734('0x31')][_0xd734('0x3a')]){_0x4c5eac[_0xd734('0x3b')]=_[_0xd734('0x3c')](_0x4c5eac[_0xd734('0x3b')],{'$or':_[_0xd734('0x2b')](_0x1d5b56,function(_0x1f4249){if(_0x1f4249[_0xd734('0x2e')]!==_0xd734('0x3d')){var _0x3de71e={};_0x3de71e[_0x1f4249[_0xd734('0x28')]]={'$like':'%'+_0x9dc670[_0xd734('0x31')]['filter']+'%'};return _0x3de71e;}})});}_0x4c5eac=_['merge']({},_0x4c5eac,_0x9dc670['options']);var _0x431c78={'where':_0x4c5eac[_0xd734('0x3b')]};return db['MailServerOut'][_0xd734('0x1f')](_0x431c78)[_0xd734('0x25')](function(_0x5e43d3){_0x449376['count']=_0x5e43d3;if(_0x9dc670[_0xd734('0x31')][_0xd734('0x3e')]){_0x4c5eac['include']=[{'all':!![]}];}return db[_0xd734('0x2c')][_0xd734('0x3f')](_0x4c5eac);})[_0xd734('0x25')](function(_0x295f53){_0x449376['rows']=_0x295f53;return _0x449376;})[_0xd734('0x25')](respondWithFilteredResult(_0xeff2e6,_0x4c5eac))[_0xd734('0x40')](handleError(_0xeff2e6,null));};exports[_0xd734('0x41')]=function(_0x19c781,_0x4b8a7c){var _0x34b771={'raw':!![],'where':{'id':_0x19c781[_0xd734('0x42')]['id']}},_0x1e4551={};_0x1e4551[_0xd734('0x30')]=_[_0xd734('0x32')](db['MailServerOut']['rawAttributes']);_0x1e4551[_0xd734('0x31')]=_[_0xd734('0x32')](_0x19c781[_0xd734('0x31')]);_0x1e4551[_0xd734('0x39')]=_['intersection'](_0x1e4551[_0xd734('0x30')],_0x1e4551[_0xd734('0x31')]);_0x34b771[_0xd734('0x34')]=_[_0xd734('0x33')](_0x1e4551[_0xd734('0x30')],qs[_0xd734('0x35')](_0x19c781[_0xd734('0x31')][_0xd734('0x35')]));_0x34b771[_0xd734('0x34')]=_0x34b771[_0xd734('0x34')][_0xd734('0x36')]?_0x34b771[_0xd734('0x34')]:_0x1e4551[_0xd734('0x30')];if(_0x19c781[_0xd734('0x31')]['includeAll']){_0x34b771[_0xd734('0x43')]=[{'all':!![]}];}_0x34b771=_[_0xd734('0x3c')]({},_0x34b771,_0x19c781[_0xd734('0x44')]);return db[_0xd734('0x2c')]['find'](_0x34b771)[_0xd734('0x25')](handleEntityNotFound(_0x4b8a7c,null))[_0xd734('0x25')](respondWithResult(_0x4b8a7c,null))[_0xd734('0x40')](handleError(_0x4b8a7c,null));};exports[_0xd734('0x45')]=function(_0x1e9c1f,_0x59b556){return db['MailServerOut'][_0xd734('0x45')](_0x1e9c1f[_0xd734('0x46')],{})['then'](respondWithResult(_0x59b556,0xc9))[_0xd734('0x40')](handleError(_0x59b556,null));};exports[_0xd734('0x24')]=function(_0x2e820d,_0x1fc075){if(_0x2e820d[_0xd734('0x46')]['id']){delete _0x2e820d[_0xd734('0x46')]['id'];}return db[_0xd734('0x2c')][_0xd734('0x47')]({'where':{'id':_0x2e820d[_0xd734('0x42')]['id']}})[_0xd734('0x25')](handleEntityNotFound(_0x1fc075,null))[_0xd734('0x25')](saveUpdates(_0x2e820d[_0xd734('0x46')],null))['then'](respondWithResult(_0x1fc075,null))[_0xd734('0x40')](handleError(_0x1fc075,null));};exports[_0xd734('0x48')]=function(_0x175a34,_0x9bccf8){return db[_0xd734('0x2c')][_0xd734('0x47')]({'where':{'id':_0x175a34[_0xd734('0x42')]['id']}})[_0xd734('0x25')](handleEntityNotFound(_0x9bccf8,null))[_0xd734('0x25')](removeEntity(_0x9bccf8,null))[_0xd734('0x40')](handleError(_0x9bccf8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index b91243a..ca4ef65 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 _0x9a01=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./mailServerOut.attributes','exports','define'];(function(_0x2ab3aa,_0x3208fe){var _0x28d945=function(_0x38028b){while(--_0x38028b){_0x2ab3aa['push'](_0x2ab3aa['shift']());}};_0x28d945(++_0x3208fe);}(_0x9a01,0x8c));var _0x19a0=function(_0x4e7b6a,_0x234514){_0x4e7b6a=_0x4e7b6a-0x0;var _0x2994a9=_0x9a01[_0x4e7b6a];return _0x2994a9;};'use strict';var _=require(_0x19a0('0x0'));var util=require('util');var logger=require(_0x19a0('0x1'))(_0x19a0('0x2'));var moment=require(_0x19a0('0x3'));var BPromise=require('bluebird');var rp=require(_0x19a0('0x4'));var fs=require('fs');var path=require(_0x19a0('0x5'));var rimraf=require(_0x19a0('0x6'));var config=require('../../config/environment');var attributes=require(_0x19a0('0x7'));module[_0x19a0('0x8')]=function(_0x19f3bd,_0x498557){return _0x19f3bd[_0x19a0('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x933d=['define','MailServerOut','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x544b3f,_0x4d8b66){var _0x15787f=function(_0x12467e){while(--_0x12467e){_0x544b3f['push'](_0x544b3f['shift']());}};_0x15787f(++_0x4d8b66);}(_0x933d,0x1c5));var _0xd933=function(_0x35f85e,_0x500bcc){_0x35f85e=_0x35f85e-0x0;var _0x41e71a=_0x933d[_0x35f85e];return _0x41e71a;};'use strict';var _=require(_0xd933('0x0'));var util=require('util');var logger=require(_0xd933('0x1'))('api');var moment=require(_0xd933('0x2'));var BPromise=require(_0xd933('0x3'));var rp=require(_0xd933('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd933('0x5'));var config=require(_0xd933('0x6'));var attributes=require(_0xd933('0x7'));module[_0xd933('0x8')]=function(_0x3674b3,_0x2f4243){return _0x3674b3[_0xd933('0x9')](_0xd933('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 9cb4656..500439a 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x144632,_0x1e1547){var _0x502b63=function(_0x1198d0){while(--_0x1198d0){_0x144632['push'](_0x144632['shift']());}};_0x502b63(++_0x1e1547);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x4f4674,_0x4da90a){var _0x34ac13=function(_0x532d3c){while(--_0x532d3c){_0x4f4674['push'](_0x4f4674['shift']());}};_0x34ac13(++_0x4da90a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index deeeb8a..f516d57 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 _0xac8b=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x3f3053,_0x51df08){var _0x1e19e0=function(_0x2c835b){while(--_0x2c835b){_0x3f3053['push'](_0x3f3053['shift']());}};_0x1e19e0(++_0x51df08);}(_0xac8b,0x8e));var _0xbac8=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xac8b[_0x42f009];return _0x22a1e0;};'use strict';var multer=require(_0xbac8('0x0'));var util=require(_0xbac8('0x1'));var path=require(_0xbac8('0x2'));var timeout=require(_0xbac8('0x3'));var express=require(_0xbac8('0x4'));var router=express[_0xbac8('0x5')]();var fs_extra=require(_0xbac8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbac8('0x7'));var config=require(_0xbac8('0x8'));var controller=require('./mailSubstatus.controller');router[_0xbac8('0x9')]('/',auth['isAuthenticated'](),controller[_0xbac8('0xa')]);router['get']('/describe',auth[_0xbac8('0xb')](),controller[_0xbac8('0xc')]);router[_0xbac8('0x9')](_0xbac8('0xd'),auth[_0xbac8('0xb')](),controller[_0xbac8('0xe')]);router[_0xbac8('0xf')]('/',auth[_0xbac8('0xb')](),controller[_0xbac8('0x10')]);router[_0xbac8('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbac8('0x12')]);router[_0xbac8('0x13')](_0xbac8('0xd'),auth[_0xbac8('0xb')](),controller[_0xbac8('0x14')]);module[_0xbac8('0x15')]=router; \ No newline at end of file +var _0x27e1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3e4465,_0xadc29e){var _0xd48d07=function(_0x2960c2){while(--_0x2960c2){_0x3e4465['push'](_0x3e4465['shift']());}};_0xd48d07(++_0xadc29e);}(_0x27e1,0x13a));var _0x127e=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x27e1[_0x3b3cc6];return _0x1161e4;};'use strict';var multer=require(_0x127e('0x0'));var util=require('util');var path=require(_0x127e('0x1'));var timeout=require(_0x127e('0x2'));var express=require(_0x127e('0x3'));var router=express[_0x127e('0x4')]();var fs_extra=require(_0x127e('0x5'));var auth=require(_0x127e('0x6'));var interaction=require(_0x127e('0x7'));var config=require(_0x127e('0x8'));var controller=require(_0x127e('0x9'));router['get']('/',auth[_0x127e('0xa')](),controller[_0x127e('0xb')]);router[_0x127e('0xc')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x127e('0xd'),auth[_0x127e('0xa')](),controller[_0x127e('0xe')]);router[_0x127e('0xf')]('/',auth[_0x127e('0xa')](),controller[_0x127e('0x10')]);router[_0x127e('0x11')](_0x127e('0xd'),auth[_0x127e('0xa')](),controller[_0x127e('0x12')]);router['delete'](_0x127e('0xd'),auth[_0x127e('0xa')](),controller['destroy']);module[_0x127e('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index eb28220..df30580 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 _0x126e=['exports','STRING','name'];(function(_0x5431ad,_0x2c8593){var _0x2423ae=function(_0x274fca){while(--_0x274fca){_0x5431ad['push'](_0x5431ad['shift']());}};_0x2423ae(++_0x2c8593);}(_0x126e,0x108));var _0xe126=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x126e[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require('sequelize');module[_0xe126('0x0')]={'name':{'type':Sequelize[_0xe126('0x1')],'unique':_0xe126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe126('0x1')]}}; \ No newline at end of file +var _0x8085=['name','STRING','sequelize'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x8085,0x71));var _0x5808=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x8085[_0x53abe5];return _0xc1c37e;};'use strict';var Sequelize=require(_0x5808('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5808('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5808('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index f1e1891..c2dbc6c 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 _0x0908=['nolimit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','then','include','findAll','rows','show','params','fields','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','stack','name','send','index','map','MailSubstatus','fieldName','model','query','keys','intersection','attributes','length','hasOwnProperty'];(function(_0x335dc3,_0x349fe3){var _0x5ddcc6=function(_0x940123){while(--_0x940123){_0x335dc3['push'](_0x335dc3['shift']());}};_0x5ddcc6(++_0x349fe3);}(_0x0908,0x1a8));var _0x8090=function(_0x28a03a,_0x8d22d2){_0x28a03a=_0x28a03a-0x0;var _0x519921=_0x0908[_0x28a03a];return _0x519921;};'use strict';var emlformat=require(_0x8090('0x0'));var rimraf=require(_0x8090('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8090('0x2'));var rp=require(_0x8090('0x3'));var moment=require(_0x8090('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8090('0x5'));var util=require(_0x8090('0x6'));var path=require(_0x8090('0x7'));var sox=require(_0x8090('0x8'));var csv=require(_0x8090('0x9'));var ejs=require(_0x8090('0xa'));var fs=require('fs');var fs_extra=require(_0x8090('0xb'));var _=require(_0x8090('0xc'));var squel=require(_0x8090('0xd'));var crypto=require(_0x8090('0xe'));var jsforce=require(_0x8090('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8090('0x9'));var querystring=require(_0x8090('0x10'));var Papa=require(_0x8090('0x11'));var Redis=require(_0x8090('0x12'));var authService=require(_0x8090('0x13'));var qs=require(_0x8090('0x14'));var as=require(_0x8090('0x15'));var hardwareService=require(_0x8090('0x16'));var logger=require('../../config/logger')(_0x8090('0x17'));var utils=require(_0x8090('0x18'));var config=require(_0x8090('0x19'));var licenseUtil=require(_0x8090('0x1a'));var db=require(_0x8090('0x1b'))['db'];function respondWithStatusCode(_0x1c7761,_0x559b9f){_0x559b9f=_0x559b9f||0xcc;return function(_0x3221cd){if(_0x3221cd){return _0x1c7761[_0x8090('0x1c')](_0x559b9f);}return _0x1c7761['status'](_0x559b9f)[_0x8090('0x1d')]();};}function respondWithResult(_0x2eedbd,_0xf27147){_0xf27147=_0xf27147||0xc8;return function(_0x85b2f){if(_0x85b2f){return _0x2eedbd['status'](_0xf27147)[_0x8090('0x1e')](_0x85b2f);}};}function respondWithFilteredResult(_0x5e3074,_0x4e0a61){return function(_0x3cef11){if(_0x3cef11){var _0x131762=typeof _0x4e0a61[_0x8090('0x1f')]===_0x8090('0x20')&&typeof _0x4e0a61[_0x8090('0x21')]==='undefined';var _0x4d7f19=_0x3cef11['count'];var _0x10ea27=_0x131762?0x0:_0x4e0a61[_0x8090('0x1f')];var _0x177060=_0x131762?_0x3cef11[_0x8090('0x22')]:_0x4e0a61[_0x8090('0x1f')]+_0x4e0a61[_0x8090('0x21')];var _0xa2e014;if(_0x177060>=_0x4d7f19){_0x177060=_0x4d7f19;_0xa2e014=0xc8;}else{_0xa2e014=0xce;}_0x5e3074[_0x8090('0x23')](_0xa2e014);return _0x5e3074[_0x8090('0x24')]('Content-Range',_0x10ea27+'-'+_0x177060+'/'+_0x4d7f19)[_0x8090('0x1e')](_0x3cef11);}return null;};}function patchUpdates(_0x314867){return function(_0x15aa20){try{jsonpatch[_0x8090('0x25')](_0x15aa20,_0x314867,!![]);}catch(_0x39e4f4){return BPromise[_0x8090('0x26')](_0x39e4f4);}return _0x15aa20[_0x8090('0x27')]();};}function saveUpdates(_0x2f4d5d,_0x3b5cad){return function(_0x515515){if(_0x515515){return _0x515515[_0x8090('0x28')](_0x2f4d5d)['then'](function(_0x3a918e){return _0x3a918e;});}return null;};}function removeEntity(_0x385507,_0x3869bd){return function(_0x2fb0c9){if(_0x2fb0c9){return _0x2fb0c9[_0x8090('0x29')]()['then'](function(){_0x385507[_0x8090('0x23')](0xcc)[_0x8090('0x1d')]();});}};}function handleEntityNotFound(_0x287d4a,_0x279603){return function(_0x646d5d){if(!_0x646d5d){_0x287d4a[_0x8090('0x1c')](0x194);}return _0x646d5d;};}function handleError(_0xe28849,_0x343ae2){_0x343ae2=_0x343ae2||0x1f4;return function(_0x2dc1a0){logger['error'](_0x2dc1a0[_0x8090('0x2a')]);if(_0x2dc1a0[_0x8090('0x2b')]){delete _0x2dc1a0[_0x8090('0x2b')];}_0xe28849[_0x8090('0x23')](_0x343ae2)[_0x8090('0x2c')](_0x2dc1a0);};}exports[_0x8090('0x2d')]=function(_0x1679d2,_0x5ab018){var _0x5cf7d2={},_0x3bc624={},_0x3784eb={'count':0x0,'rows':[]};var _0xc4d2d0=_[_0x8090('0x2e')](db[_0x8090('0x2f')]['rawAttributes'],function(_0x33549c){return{'name':_0x33549c[_0x8090('0x30')],'type':_0x33549c['type']['key']};});_0x3bc624[_0x8090('0x31')]=_[_0x8090('0x2e')](_0xc4d2d0,_0x8090('0x2b'));_0x3bc624[_0x8090('0x32')]=_[_0x8090('0x33')](_0x1679d2[_0x8090('0x32')]);_0x3bc624['filters']=_[_0x8090('0x34')](_0x3bc624['model'],_0x3bc624['query']);_0x5cf7d2[_0x8090('0x35')]=_[_0x8090('0x34')](_0x3bc624[_0x8090('0x31')],qs['fields'](_0x1679d2[_0x8090('0x32')]['fields']));_0x5cf7d2[_0x8090('0x35')]=_0x5cf7d2[_0x8090('0x35')][_0x8090('0x36')]?_0x5cf7d2[_0x8090('0x35')]:_0x3bc624['model'];if(!_0x1679d2['query'][_0x8090('0x37')](_0x8090('0x38'))){_0x5cf7d2[_0x8090('0x21')]=qs[_0x8090('0x21')](_0x1679d2[_0x8090('0x32')]['limit']);_0x5cf7d2[_0x8090('0x1f')]=qs[_0x8090('0x1f')](_0x1679d2['query'][_0x8090('0x1f')]);}_0x5cf7d2[_0x8090('0x39')]=qs['sort'](_0x1679d2[_0x8090('0x32')][_0x8090('0x3a')]);_0x5cf7d2['where']=qs[_0x8090('0x3b')](_[_0x8090('0x3c')](_0x1679d2[_0x8090('0x32')],_0x3bc624[_0x8090('0x3b')]),_0xc4d2d0);if(_0x1679d2[_0x8090('0x32')][_0x8090('0x3d')]){_0x5cf7d2['where']=_[_0x8090('0x3e')](_0x5cf7d2[_0x8090('0x3f')],{'$or':_[_0x8090('0x2e')](_0xc4d2d0,function(_0x53436a){if(_0x53436a[_0x8090('0x40')]!==_0x8090('0x41')){var _0x2f0206={};_0x2f0206[_0x53436a['name']]={'$like':'%'+_0x1679d2[_0x8090('0x32')][_0x8090('0x3d')]+'%'};return _0x2f0206;}})});}_0x5cf7d2=_[_0x8090('0x3e')]({},_0x5cf7d2,_0x1679d2[_0x8090('0x42')]);var _0x6b67dc={'where':_0x5cf7d2['where']};return db[_0x8090('0x2f')][_0x8090('0x22')](_0x6b67dc)[_0x8090('0x43')](function(_0x2a5e56){_0x3784eb['count']=_0x2a5e56;if(_0x1679d2['query']['includeAll']){_0x5cf7d2[_0x8090('0x44')]=[{'all':!![]}];}return db[_0x8090('0x2f')][_0x8090('0x45')](_0x5cf7d2);})[_0x8090('0x43')](function(_0x36a4da){_0x3784eb[_0x8090('0x46')]=_0x36a4da;return _0x3784eb;})[_0x8090('0x43')](respondWithFilteredResult(_0x5ab018,_0x5cf7d2))['catch'](handleError(_0x5ab018,null));};exports[_0x8090('0x47')]=function(_0x18411a,_0x3a282f){var _0x175891={'raw':!![],'where':{'id':_0x18411a[_0x8090('0x48')]['id']}},_0x3ee9d8={};_0x3ee9d8[_0x8090('0x31')]=_[_0x8090('0x33')](db[_0x8090('0x2f')]['rawAttributes']);_0x3ee9d8[_0x8090('0x32')]=_['keys'](_0x18411a['query']);_0x3ee9d8[_0x8090('0x3b')]=_[_0x8090('0x34')](_0x3ee9d8[_0x8090('0x31')],_0x3ee9d8[_0x8090('0x32')]);_0x175891[_0x8090('0x35')]=_[_0x8090('0x34')](_0x3ee9d8[_0x8090('0x31')],qs[_0x8090('0x49')](_0x18411a['query'][_0x8090('0x49')]));_0x175891[_0x8090('0x35')]=_0x175891['attributes'][_0x8090('0x36')]?_0x175891[_0x8090('0x35')]:_0x3ee9d8[_0x8090('0x31')];if(_0x18411a[_0x8090('0x32')][_0x8090('0x4a')]){_0x175891[_0x8090('0x44')]=[{'all':!![]}];}_0x175891=_['merge']({},_0x175891,_0x18411a[_0x8090('0x42')]);return db[_0x8090('0x2f')][_0x8090('0x4b')](_0x175891)[_0x8090('0x43')](handleEntityNotFound(_0x3a282f,null))[_0x8090('0x43')](respondWithResult(_0x3a282f,null))[_0x8090('0x4c')](handleError(_0x3a282f,null));};exports[_0x8090('0x4d')]=function(_0x4d8467,_0x5e6ead){return db[_0x8090('0x2f')][_0x8090('0x4d')](_0x4d8467[_0x8090('0x4e')],{})['then'](respondWithResult(_0x5e6ead,0xc9))['catch'](handleError(_0x5e6ead,null));};exports[_0x8090('0x28')]=function(_0x276fe2,_0x3246e4){if(_0x276fe2[_0x8090('0x4e')]['id']){delete _0x276fe2[_0x8090('0x4e')]['id'];}return db[_0x8090('0x2f')][_0x8090('0x4b')]({'where':{'id':_0x276fe2[_0x8090('0x48')]['id']}})['then'](handleEntityNotFound(_0x3246e4,null))['then'](saveUpdates(_0x276fe2['body'],null))[_0x8090('0x43')](respondWithResult(_0x3246e4,null))[_0x8090('0x4c')](handleError(_0x3246e4,null));};exports['destroy']=function(_0x29e66c,_0x49385c){return db['MailSubstatus'][_0x8090('0x4b')]({'where':{'id':_0x29e66c[_0x8090('0x48')]['id']}})[_0x8090('0x43')](handleEntityNotFound(_0x49385c,null))['then'](removeEntity(_0x49385c,null))[_0x8090('0x4c')](handleError(_0x49385c,null));};exports[_0x8090('0x4f')]=function(_0x35c9a6,_0x1d454a){return db[_0x8090('0x2f')][_0x8090('0x4f')]()[_0x8090('0x43')](respondWithResult(_0x1d454a,null))[_0x8090('0x4c')](handleError(_0x1d454a,null));}; \ No newline at end of file +var _0x248b=['body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','length','options','find','catch','create'];(function(_0x4ff69a,_0x240ace){var _0x35b2c4=function(_0x4f5c5e){while(--_0x4f5c5e){_0x4ff69a['push'](_0x4ff69a['shift']());}};_0x35b2c4(++_0x240ace);}(_0x248b,0x9a));var _0xb248=function(_0x4e3b43,_0x447312){_0x4e3b43=_0x4e3b43-0x0;var _0x590f8c=_0x248b[_0x4e3b43];return _0x590f8c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb248('0x0'));var zipdir=require(_0xb248('0x1'));var jsonpatch=require(_0xb248('0x2'));var rp=require(_0xb248('0x3'));var moment=require('moment');var BPromise=require(_0xb248('0x4'));var Mustache=require(_0xb248('0x5'));var util=require(_0xb248('0x6'));var path=require(_0xb248('0x7'));var sox=require(_0xb248('0x8'));var csv=require('to-csv');var ejs=require(_0xb248('0x9'));var fs=require('fs');var fs_extra=require(_0xb248('0xa'));var _=require(_0xb248('0xb'));var squel=require(_0xb248('0xc'));var crypto=require('crypto');var jsforce=require(_0xb248('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb248('0xe'));var querystring=require(_0xb248('0xf'));var Papa=require('papaparse');var Redis=require(_0xb248('0x10'));var authService=require(_0xb248('0x11'));var qs=require(_0xb248('0x12'));var as=require(_0xb248('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb248('0x14'));var licenseUtil=require(_0xb248('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5341cb,_0x3be227){_0x3be227=_0x3be227||0xcc;return function(_0x1bd0aa){if(_0x1bd0aa){return _0x5341cb[_0xb248('0x16')](_0x3be227);}return _0x5341cb[_0xb248('0x17')](_0x3be227)[_0xb248('0x18')]();};}function respondWithResult(_0x55d46f,_0x3e6381){_0x3e6381=_0x3e6381||0xc8;return function(_0x339749){if(_0x339749){return _0x55d46f[_0xb248('0x17')](_0x3e6381)['json'](_0x339749);}};}function respondWithFilteredResult(_0x58ed90,_0x5b287b){return function(_0x16c4b1){if(_0x16c4b1){var _0x29b8ea=typeof _0x5b287b['offset']===_0xb248('0x19')&&typeof _0x5b287b['limit']===_0xb248('0x19');var _0x5e8d03=_0x16c4b1['count'];var _0x43c915=_0x29b8ea?0x0:_0x5b287b['offset'];var _0x215b54=_0x29b8ea?_0x16c4b1[_0xb248('0x1a')]:_0x5b287b[_0xb248('0x1b')]+_0x5b287b[_0xb248('0x1c')];var _0x313c74;if(_0x215b54>=_0x5e8d03){_0x215b54=_0x5e8d03;_0x313c74=0xc8;}else{_0x313c74=0xce;}_0x58ed90['status'](_0x313c74);return _0x58ed90[_0xb248('0x1d')](_0xb248('0x1e'),_0x43c915+'-'+_0x215b54+'/'+_0x5e8d03)[_0xb248('0x1f')](_0x16c4b1);}return null;};}function patchUpdates(_0x322730){return function(_0x1de90d){try{jsonpatch[_0xb248('0x20')](_0x1de90d,_0x322730,!![]);}catch(_0x189d59){return BPromise[_0xb248('0x21')](_0x189d59);}return _0x1de90d[_0xb248('0x22')]();};}function saveUpdates(_0x251383,_0x14c8c9){return function(_0x4920da){if(_0x4920da){return _0x4920da[_0xb248('0x23')](_0x251383)[_0xb248('0x24')](function(_0x5c8024){return _0x5c8024;});}return null;};}function removeEntity(_0x1873cf,_0x40a762){return function(_0x1c208f){if(_0x1c208f){return _0x1c208f['destroy']()[_0xb248('0x24')](function(){_0x1873cf[_0xb248('0x17')](0xcc)[_0xb248('0x18')]();});}};}function handleEntityNotFound(_0x291ba2,_0x42baba){return function(_0x3a2468){if(!_0x3a2468){_0x291ba2[_0xb248('0x16')](0x194);}return _0x3a2468;};}function handleError(_0x26e9d8,_0x21f22e){_0x21f22e=_0x21f22e||0x1f4;return function(_0x18cde4){logger[_0xb248('0x25')](_0x18cde4[_0xb248('0x26')]);if(_0x18cde4[_0xb248('0x27')]){delete _0x18cde4[_0xb248('0x27')];}_0x26e9d8['status'](_0x21f22e)[_0xb248('0x28')](_0x18cde4);};}exports[_0xb248('0x29')]=function(_0x366a58,_0x20913b){var _0x2b4c0f={},_0x1ccdcd={},_0x1b46b6={'count':0x0,'rows':[]};var _0x1126d5=_[_0xb248('0x2a')](db[_0xb248('0x2b')][_0xb248('0x2c')],function(_0x1d8099){return{'name':_0x1d8099[_0xb248('0x2d')],'type':_0x1d8099[_0xb248('0x2e')][_0xb248('0x2f')]};});_0x1ccdcd['model']=_[_0xb248('0x2a')](_0x1126d5,_0xb248('0x27'));_0x1ccdcd[_0xb248('0x30')]=_[_0xb248('0x31')](_0x366a58[_0xb248('0x30')]);_0x1ccdcd[_0xb248('0x32')]=_['intersection'](_0x1ccdcd['model'],_0x1ccdcd[_0xb248('0x30')]);_0x2b4c0f[_0xb248('0x33')]=_[_0xb248('0x34')](_0x1ccdcd['model'],qs['fields'](_0x366a58[_0xb248('0x30')][_0xb248('0x35')]));_0x2b4c0f[_0xb248('0x33')]=_0x2b4c0f[_0xb248('0x33')]['length']?_0x2b4c0f['attributes']:_0x1ccdcd[_0xb248('0x36')];if(!_0x366a58[_0xb248('0x30')][_0xb248('0x37')](_0xb248('0x38'))){_0x2b4c0f['limit']=qs[_0xb248('0x1c')](_0x366a58[_0xb248('0x30')]['limit']);_0x2b4c0f[_0xb248('0x1b')]=qs['offset'](_0x366a58[_0xb248('0x30')][_0xb248('0x1b')]);}_0x2b4c0f[_0xb248('0x39')]=qs[_0xb248('0x3a')](_0x366a58[_0xb248('0x30')][_0xb248('0x3a')]);_0x2b4c0f[_0xb248('0x3b')]=qs[_0xb248('0x32')](_[_0xb248('0x3c')](_0x366a58['query'],_0x1ccdcd[_0xb248('0x32')]),_0x1126d5);if(_0x366a58[_0xb248('0x30')]['filter']){_0x2b4c0f[_0xb248('0x3b')]=_[_0xb248('0x3d')](_0x2b4c0f[_0xb248('0x3b')],{'$or':_[_0xb248('0x2a')](_0x1126d5,function(_0x4486ef){if(_0x4486ef[_0xb248('0x2e')]!==_0xb248('0x3e')){var _0x5dbe38={};_0x5dbe38[_0x4486ef[_0xb248('0x27')]]={'$like':'%'+_0x366a58['query'][_0xb248('0x3f')]+'%'};return _0x5dbe38;}})});}_0x2b4c0f=_[_0xb248('0x3d')]({},_0x2b4c0f,_0x366a58['options']);var _0x234a07={'where':_0x2b4c0f[_0xb248('0x3b')]};return db['MailSubstatus'][_0xb248('0x1a')](_0x234a07)[_0xb248('0x24')](function(_0x283537){_0x1b46b6[_0xb248('0x1a')]=_0x283537;if(_0x366a58[_0xb248('0x30')][_0xb248('0x40')]){_0x2b4c0f[_0xb248('0x41')]=[{'all':!![]}];}return db[_0xb248('0x2b')]['findAll'](_0x2b4c0f);})[_0xb248('0x24')](function(_0x188682){_0x1b46b6[_0xb248('0x42')]=_0x188682;return _0x1b46b6;})[_0xb248('0x24')](respondWithFilteredResult(_0x20913b,_0x2b4c0f))['catch'](handleError(_0x20913b,null));};exports[_0xb248('0x43')]=function(_0x351624,_0x384a0f){var _0x2baa8a={'raw':!![],'where':{'id':_0x351624[_0xb248('0x44')]['id']}},_0x38a017={};_0x38a017[_0xb248('0x36')]=_[_0xb248('0x31')](db[_0xb248('0x2b')][_0xb248('0x2c')]);_0x38a017['query']=_[_0xb248('0x31')](_0x351624['query']);_0x38a017[_0xb248('0x32')]=_[_0xb248('0x34')](_0x38a017[_0xb248('0x36')],_0x38a017['query']);_0x2baa8a[_0xb248('0x33')]=_[_0xb248('0x34')](_0x38a017['model'],qs[_0xb248('0x35')](_0x351624[_0xb248('0x30')][_0xb248('0x35')]));_0x2baa8a['attributes']=_0x2baa8a['attributes'][_0xb248('0x45')]?_0x2baa8a[_0xb248('0x33')]:_0x38a017[_0xb248('0x36')];if(_0x351624[_0xb248('0x30')][_0xb248('0x40')]){_0x2baa8a[_0xb248('0x41')]=[{'all':!![]}];}_0x2baa8a=_['merge']({},_0x2baa8a,_0x351624[_0xb248('0x46')]);return db['MailSubstatus'][_0xb248('0x47')](_0x2baa8a)[_0xb248('0x24')](handleEntityNotFound(_0x384a0f,null))[_0xb248('0x24')](respondWithResult(_0x384a0f,null))[_0xb248('0x48')](handleError(_0x384a0f,null));};exports[_0xb248('0x49')]=function(_0x33cf16,_0x4babde){return db['MailSubstatus'][_0xb248('0x49')](_0x33cf16[_0xb248('0x4a')],{})[_0xb248('0x24')](respondWithResult(_0x4babde,0xc9))[_0xb248('0x48')](handleError(_0x4babde,null));};exports[_0xb248('0x23')]=function(_0x36959a,_0x473584){if(_0x36959a[_0xb248('0x4a')]['id']){delete _0x36959a[_0xb248('0x4a')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x36959a['params']['id']}})[_0xb248('0x24')](handleEntityNotFound(_0x473584,null))[_0xb248('0x24')](saveUpdates(_0x36959a[_0xb248('0x4a')],null))['then'](respondWithResult(_0x473584,null))[_0xb248('0x48')](handleError(_0x473584,null));};exports['destroy']=function(_0x79d4ca,_0x3d3044){return db[_0xb248('0x2b')][_0xb248('0x47')]({'where':{'id':_0x79d4ca[_0xb248('0x44')]['id']}})[_0xb248('0x24')](handleEntityNotFound(_0x3d3044,null))[_0xb248('0x24')](removeEntity(_0x3d3044,null))[_0xb248('0x48')](handleError(_0x3d3044,null));};exports[_0xb248('0x4b')]=function(_0x274900,_0x3d8b31){return db[_0xb248('0x2b')][_0xb248('0x4b')]()[_0xb248('0x24')](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d5567ad..fb753cd 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 _0x0001=['hook','exports','events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0x0001,0xd2));var _0x1000=function(_0x397ad5,_0x2e4ddd){_0x397ad5=_0x397ad5-0x0;var _0x162d3c=_0x0001[_0x397ad5];return _0x162d3c;};'use strict';var EventEmitter=require(_0x1000('0x0'));var MailSubstatus=require(_0x1000('0x1'))['db'][_0x1000('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x1000('0x3')};function emitEvent(_0xb1dd47){return function(_0x5378e2,_0x1797ce,_0x3328c7){MailSubstatusEvents[_0x1000('0x4')](_0xb1dd47+':'+_0x5378e2['id'],_0x5378e2);MailSubstatusEvents[_0x1000('0x4')](_0xb1dd47,_0x5378e2);_0x3328c7(null);};}for(var e in events){if(events[_0x1000('0x5')](e)){var event=events[e];MailSubstatus[_0x1000('0x6')](e,emitEvent(event));}}module[_0x1000('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x9e9b=['update','emit','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x2002a2,_0x3485d2){var _0x3115f9=function(_0x28dd6c){while(--_0x28dd6c){_0x2002a2['push'](_0x2002a2['shift']());}};_0x3115f9(++_0x3485d2);}(_0x9e9b,0xaa));var _0xb9e9=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x9e9b[_0xe51596];return _0x22c705;};'use strict';var EventEmitter=require(_0xb9e9('0x0'));var MailSubstatus=require(_0xb9e9('0x1'))['db'][_0xb9e9('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xb9e9('0x3')](0x0);var events={'afterUpdate':_0xb9e9('0x4')};function emitEvent(_0x362560){return function(_0x3e2c89,_0x4209a9,_0x3c77fd){MailSubstatusEvents[_0xb9e9('0x5')](_0x362560+':'+_0x3e2c89['id'],_0x3e2c89);MailSubstatusEvents[_0xb9e9('0x5')](_0x362560,_0x3e2c89);_0x3c77fd(null);};}for(var e in events){if(events['hasOwnProperty'](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 b0f74a0..1eb86f6 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 _0x213d=['name','then','catch','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x213d,0x1bc));var _0xd213=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x213d[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xd213('0x0'));module[_0xd213('0x1')]=function(_0x215fc7){var _0x4b0d2d=_0x215fc7['models'];return _0x215fc7['define'](_0xd213('0x2'),attributes,{'tableName':_0xd213('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x27a573,_0x457599,_0x354ef2){return _0x4b0d2d['Condition']['update']({'value':_0x27a573[_0xd213('0x4')]},{'where':{'field':'mailSubstatus','value':_0x27a573['_previousDataValues'][_0xd213('0x4')]}})[_0xd213('0x5')](function(){_0x354ef2();})[_0xd213('0x6')](function(_0xb7ced5){_0x354ef2(_0xb7ced5);});}}});}; \ No newline at end of file +var _0xbf5f=['exports','models','mail_substatuses','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes'];(function(_0x186667,_0x3afde7){var _0x1d13a8=function(_0x1f74b0){while(--_0x1f74b0){_0x186667['push'](_0x186667['shift']());}};_0x1d13a8(++_0x3afde7);}(_0xbf5f,0x19d));var _0xfbf5=function(_0x15b3df,_0x2c3d87){_0x15b3df=_0x15b3df-0x0;var _0x399e0c=_0xbf5f[_0x15b3df];return _0x399e0c;};'use strict';var attributes=require(_0xfbf5('0x0'));module[_0xfbf5('0x1')]=function(_0x4e2e1d){var _0x2013ad=_0x4e2e1d[_0xfbf5('0x2')];return _0x4e2e1d['define']('MailSubstatus',attributes,{'tableName':_0xfbf5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x449291,_0xcc053f,_0x516054){return _0x2013ad['Condition'][_0xfbf5('0x4')]({'value':_0x449291[_0xfbf5('0x5')]},{'where':{'field':_0xfbf5('0x6'),'value':_0x449291[_0xfbf5('0x7')][_0xfbf5('0x5')]}})[_0xfbf5('0x8')](function(){_0x516054();})['catch'](function(_0x545e20){_0x516054(_0x545e20);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 754458c..5fd3aec 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 _0xac60=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xac60,0x199));var _0x0ac6=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xac60[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0ac6('0x0'));var util=require(_0x0ac6('0x1'));var moment=require(_0x0ac6('0x2'));var BPromise=require(_0x0ac6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ac6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ac6('0x5'));var logger=require(_0x0ac6('0x6'))(_0x0ac6('0x7'));var config=require(_0x0ac6('0x8'));var jayson=require(_0x0ac6('0x9'));var client=jayson[_0x0ac6('0xa')][_0x0ac6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x407a9d,_0x24a3c0,_0x5470b0){return new BPromise(function(_0x43d1b4,_0x35b24b){return client[_0x0ac6('0xc')](_0x407a9d,_0x5470b0)[_0x0ac6('0xd')](function(_0x4d80f4){logger['info'](_0x0ac6('0xe'),_0x24a3c0,'request\x20sent');logger[_0x0ac6('0xf')](_0x0ac6('0x10'),_0x24a3c0,_0x0ac6('0x11'),JSON['stringify'](_0x4d80f4));if(_0x4d80f4[_0x0ac6('0x12')]){if(_0x4d80f4['error']['code']===0x1f4){logger[_0x0ac6('0x12')](_0x0ac6('0xe'),_0x24a3c0,_0x4d80f4[_0x0ac6('0x12')]['message']);return _0x35b24b(_0x4d80f4[_0x0ac6('0x12')][_0x0ac6('0x13')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x24a3c0,_0x4d80f4[_0x0ac6('0x12')][_0x0ac6('0x13')]);return _0x43d1b4(_0x4d80f4[_0x0ac6('0x12')][_0x0ac6('0x13')]);}else{logger[_0x0ac6('0x14')](_0x0ac6('0xe'),_0x24a3c0,_0x0ac6('0x11'));_0x43d1b4(_0x4d80f4[_0x0ac6('0x15')]['message']);}})[_0x0ac6('0x16')](function(_0x5c4d2c){logger[_0x0ac6('0x12')](_0x0ac6('0xe'),_0x24a3c0,_0x5c4d2c);_0x35b24b(_0x5c4d2c);});});} \ No newline at end of file +var _0xcda3=['error','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2442f1,_0x434776){var _0x30b208=function(_0x119103){while(--_0x119103){_0x2442f1['push'](_0x2442f1['shift']());}};_0x30b208(++_0x434776);}(_0xcda3,0xb2));var _0x3cda=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xcda3[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x3cda('0x0'));var util=require('util');var moment=require(_0x3cda('0x1'));var BPromise=require('bluebird');var rs=require(_0x3cda('0x2'));var fs=require('fs');var Redis=require(_0x3cda('0x3'));var db=require(_0x3cda('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cda('0x5'))(_0x3cda('0x6'));var config=require('../../config/environment');var jayson=require(_0x3cda('0x7'));var client=jayson['client'][_0x3cda('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3daddd,_0x37ced0,_0x30692b){return new BPromise(function(_0x1778be,_0x3a98b4){return client[_0x3cda('0x9')](_0x3daddd,_0x30692b)['then'](function(_0x33b654){logger['info'](_0x3cda('0xa'),_0x37ced0,'request\x20sent');logger[_0x3cda('0xb')](_0x3cda('0xc'),_0x37ced0,_0x3cda('0xd'),JSON['stringify'](_0x33b654));if(_0x33b654[_0x3cda('0xe')]){if(_0x33b654[_0x3cda('0xe')]['code']===0x1f4){logger['error'](_0x3cda('0xa'),_0x37ced0,_0x33b654[_0x3cda('0xe')][_0x3cda('0xf')]);return _0x3a98b4(_0x33b654[_0x3cda('0xe')][_0x3cda('0xf')]);}logger[_0x3cda('0xe')](_0x3cda('0xa'),_0x37ced0,_0x33b654[_0x3cda('0xe')][_0x3cda('0xf')]);return _0x1778be(_0x33b654['error'][_0x3cda('0xf')]);}else{logger['info'](_0x3cda('0xa'),_0x37ced0,'request\x20sent');_0x1778be(_0x33b654['result'][_0x3cda('0xf')]);}})['catch'](function(_0x50adfb){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x37ced0,_0x50adfb);_0x3a98b4(_0x50adfb);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index dc4a955..71a9ee1 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 _0xfb16=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x217777,_0x451ff6){var _0x4cfff1=function(_0x268d07){while(--_0x268d07){_0x217777['push'](_0x217777['shift']());}};_0x4cfff1(++_0x451ff6);}(_0xfb16,0xd4));var _0x6fb1=function(_0x342e61,_0x5d14f6){_0x342e61=_0x342e61-0x0;var _0x4fd286=_0xfb16[_0x342e61];return _0x4fd286;};'use strict';var multer=require(_0x6fb1('0x0'));var util=require('util');var path=require(_0x6fb1('0x1'));var timeout=require(_0x6fb1('0x2'));var express=require(_0x6fb1('0x3'));var router=express[_0x6fb1('0x4')]();var fs_extra=require(_0x6fb1('0x5'));var auth=require(_0x6fb1('0x6'));var interaction=require(_0x6fb1('0x7'));var config=require(_0x6fb1('0x8'));var controller=require(_0x6fb1('0x9'));router[_0x6fb1('0xa')]('/',auth[_0x6fb1('0xb')](),controller[_0x6fb1('0xc')]);router[_0x6fb1('0xa')](_0x6fb1('0xd'),auth[_0x6fb1('0xb')](),controller[_0x6fb1('0xe')]);router[_0x6fb1('0xa')](_0x6fb1('0xf'),auth['isAuthenticated'](),controller[_0x6fb1('0x10')]);router[_0x6fb1('0x11')]('/',auth[_0x6fb1('0xb')](),controller['create']);router[_0x6fb1('0x12')](_0x6fb1('0xf'),auth[_0x6fb1('0xb')](),controller['update']);router['delete'](_0x6fb1('0xf'),auth[_0x6fb1('0xb')](),controller[_0x6fb1('0x13')]);module[_0x6fb1('0x14')]=router; \ No newline at end of file +var _0xbcfa=['exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','destroy'];(function(_0x42cbcc,_0xc75c32){var _0x39af24=function(_0x579b33){while(--_0x579b33){_0x42cbcc['push'](_0x42cbcc['shift']());}};_0x39af24(++_0xc75c32);}(_0xbcfa,0x131));var _0xabcf=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xbcfa[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xabcf('0x0'));var util=require('util');var path=require(_0xabcf('0x1'));var timeout=require('connect-timeout');var express=require(_0xabcf('0x2'));var router=express['Router']();var fs_extra=require(_0xabcf('0x3'));var auth=require(_0xabcf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xabcf('0x5'));var controller=require('./mailTransferReport.controller');router[_0xabcf('0x6')]('/',auth[_0xabcf('0x7')](),controller['index']);router[_0xabcf('0x6')](_0xabcf('0x8'),auth[_0xabcf('0x7')](),controller['describe']);router['get'](_0xabcf('0x9'),auth[_0xabcf('0x7')](),controller[_0xabcf('0xa')]);router[_0xabcf('0xb')]('/',auth[_0xabcf('0x7')](),controller[_0xabcf('0xc')]);router[_0xabcf('0xd')](_0xabcf('0x9'),auth[_0xabcf('0x7')](),controller['update']);router['delete'](_0xabcf('0x9'),auth['isAuthenticated'](),controller[_0xabcf('0xe')]);module[_0xabcf('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index c1d60c0..faea97c 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5a511c,_0xf1975e){var _0x497b55=function(_0x4794f2){while(--_0x4794f2){_0x5a511c['push'](_0x5a511c['shift']());}};_0x497b55(++_0xf1975e);}(_0xedd9,0xfc));var _0x9edd=function(_0x53cedd,_0x1413c9){_0x53cedd=_0x53cedd-0x0;var _0xe52eb2=_0xedd9[_0x53cedd];return _0xe52eb2;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3b5f66,_0x1dbfc5){var _0x4aa1a8=function(_0x57c05c){while(--_0x57c05c){_0x3b5f66['push'](_0x3b5f66['shift']());}};_0x4aa1a8(++_0x1dbfc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5868a8a..97b323d 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 _0x734e=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','params','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x5b28e0,_0x67359){var _0x1bdcb1=function(_0x195148){while(--_0x195148){_0x5b28e0['push'](_0x5b28e0['shift']());}};_0x1bdcb1(++_0x67359);}(_0x734e,0x158));var _0xe734=function(_0x1acc01,_0x5cb80c){_0x1acc01=_0x1acc01-0x0;var _0x5603f1=_0x734e[_0x1acc01];return _0x5603f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe734('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe734('0x1'));var rp=require(_0xe734('0x2'));var moment=require(_0xe734('0x3'));var BPromise=require(_0xe734('0x4'));var Mustache=require(_0xe734('0x5'));var util=require(_0xe734('0x6'));var path=require(_0xe734('0x7'));var sox=require('sox');var csv=require(_0xe734('0x8'));var ejs=require(_0xe734('0x9'));var fs=require('fs');var fs_extra=require(_0xe734('0xa'));var _=require(_0xe734('0xb'));var squel=require(_0xe734('0xc'));var crypto=require(_0xe734('0xd'));var jsforce=require(_0xe734('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe734('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe734('0xf'));var authService=require(_0xe734('0x10'));var qs=require(_0xe734('0x11'));var as=require(_0xe734('0x12'));var hardwareService=require(_0xe734('0x13'));var logger=require(_0xe734('0x14'))(_0xe734('0x15'));var utils=require(_0xe734('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe734('0x17'));var db=require(_0xe734('0x18'))['db'];function respondWithStatusCode(_0x4198cc,_0x26d774){_0x26d774=_0x26d774||0xcc;return function(_0x20b23b){if(_0x20b23b){return _0x4198cc[_0xe734('0x19')](_0x26d774);}return _0x4198cc[_0xe734('0x1a')](_0x26d774)['end']();};}function respondWithResult(_0x4985c7,_0x3ee125){_0x3ee125=_0x3ee125||0xc8;return function(_0xf12cfd){if(_0xf12cfd){return _0x4985c7[_0xe734('0x1a')](_0x3ee125)[_0xe734('0x1b')](_0xf12cfd);}};}function respondWithFilteredResult(_0x1fe0a0,_0x578d06){return function(_0x1c9ec9){if(_0x1c9ec9){var _0x1427df=typeof _0x578d06['offset']==='undefined'&&typeof _0x578d06[_0xe734('0x1c')]===_0xe734('0x1d');var _0x2e0b3f=_0x1c9ec9[_0xe734('0x1e')];var _0x22d620=_0x1427df?0x0:_0x578d06[_0xe734('0x1f')];var _0x33822c=_0x1427df?_0x1c9ec9[_0xe734('0x1e')]:_0x578d06['offset']+_0x578d06[_0xe734('0x1c')];var _0x85e93f;if(_0x33822c>=_0x2e0b3f){_0x33822c=_0x2e0b3f;_0x85e93f=0xc8;}else{_0x85e93f=0xce;}_0x1fe0a0[_0xe734('0x1a')](_0x85e93f);return _0x1fe0a0[_0xe734('0x20')](_0xe734('0x21'),_0x22d620+'-'+_0x33822c+'/'+_0x2e0b3f)[_0xe734('0x1b')](_0x1c9ec9);}return null;};}function patchUpdates(_0xc9bfc2){return function(_0x57b45a){try{jsonpatch[_0xe734('0x22')](_0x57b45a,_0xc9bfc2,!![]);}catch(_0x691446){return BPromise[_0xe734('0x23')](_0x691446);}return _0x57b45a[_0xe734('0x24')]();};}function saveUpdates(_0x44097a,_0x73e2fc){return function(_0x11cb27){if(_0x11cb27){return _0x11cb27[_0xe734('0x25')](_0x44097a)['then'](function(_0x289009){return _0x289009;});}return null;};}function removeEntity(_0x1b74bf,_0x3e63cd){return function(_0x102dc9){if(_0x102dc9){return _0x102dc9[_0xe734('0x26')]()['then'](function(){_0x1b74bf[_0xe734('0x1a')](0xcc)[_0xe734('0x27')]();});}};}function handleEntityNotFound(_0x3b6c37,_0x154cfc){return function(_0x42c48c){if(!_0x42c48c){_0x3b6c37[_0xe734('0x19')](0x194);}return _0x42c48c;};}function handleError(_0x137409,_0x2cd584){_0x2cd584=_0x2cd584||0x1f4;return function(_0x1ae2c5){logger[_0xe734('0x28')](_0x1ae2c5[_0xe734('0x29')]);if(_0x1ae2c5[_0xe734('0x2a')]){delete _0x1ae2c5[_0xe734('0x2a')];}_0x137409[_0xe734('0x1a')](_0x2cd584)[_0xe734('0x2b')](_0x1ae2c5);};}exports[_0xe734('0x2c')]=function(_0x17390b,_0xd5ec8b){var _0x341b91={},_0x1ae35f={},_0x54a052={'count':0x0,'rows':[]};var _0x1e6c56=_[_0xe734('0x2d')](db[_0xe734('0x2e')][_0xe734('0x2f')],function(_0x58bb7a){return{'name':_0x58bb7a[_0xe734('0x30')],'type':_0x58bb7a[_0xe734('0x31')][_0xe734('0x32')]};});_0x1ae35f[_0xe734('0x33')]=_[_0xe734('0x2d')](_0x1e6c56,_0xe734('0x2a'));_0x1ae35f['query']=_[_0xe734('0x34')](_0x17390b[_0xe734('0x35')]);_0x1ae35f[_0xe734('0x36')]=_[_0xe734('0x37')](_0x1ae35f['model'],_0x1ae35f[_0xe734('0x35')]);_0x341b91[_0xe734('0x38')]=_['intersection'](_0x1ae35f[_0xe734('0x33')],qs[_0xe734('0x39')](_0x17390b[_0xe734('0x35')][_0xe734('0x39')]));_0x341b91[_0xe734('0x38')]=_0x341b91['attributes'][_0xe734('0x3a')]?_0x341b91[_0xe734('0x38')]:_0x1ae35f['model'];if(!_0x17390b[_0xe734('0x35')][_0xe734('0x3b')](_0xe734('0x3c'))){_0x341b91[_0xe734('0x1c')]=qs[_0xe734('0x1c')](_0x17390b[_0xe734('0x35')][_0xe734('0x1c')]);_0x341b91[_0xe734('0x1f')]=qs['offset'](_0x17390b[_0xe734('0x35')][_0xe734('0x1f')]);}_0x341b91[_0xe734('0x3d')]=qs['sort'](_0x17390b['query'][_0xe734('0x3e')]);_0x341b91[_0xe734('0x3f')]=qs[_0xe734('0x36')](_[_0xe734('0x40')](_0x17390b[_0xe734('0x35')],_0x1ae35f[_0xe734('0x36')]),_0x1e6c56);if(_0x17390b[_0xe734('0x35')][_0xe734('0x41')]){_0x341b91[_0xe734('0x3f')]=_[_0xe734('0x42')](_0x341b91['where'],{'$or':_['map'](_0x1e6c56,function(_0x194bee){if(_0x194bee[_0xe734('0x31')]!==_0xe734('0x43')){var _0x2f3685={};_0x2f3685[_0x194bee[_0xe734('0x2a')]]={'$like':'%'+_0x17390b[_0xe734('0x35')]['filter']+'%'};return _0x2f3685;}})});}_0x341b91=_[_0xe734('0x42')]({},_0x341b91,_0x17390b['options']);var _0x44b301={'where':_0x341b91[_0xe734('0x3f')]};return db[_0xe734('0x2e')][_0xe734('0x1e')](_0x44b301)[_0xe734('0x44')](function(_0x11346f){_0x54a052['count']=_0x11346f;if(_0x17390b['query'][_0xe734('0x45')]){_0x341b91[_0xe734('0x46')]=[{'all':!![]}];}return db[_0xe734('0x2e')]['findAll'](_0x341b91);})['then'](function(_0x5afd2a){_0x54a052[_0xe734('0x47')]=_0x5afd2a;return _0x54a052;})[_0xe734('0x44')](respondWithFilteredResult(_0xd5ec8b,_0x341b91))[_0xe734('0x48')](handleError(_0xd5ec8b,null));};exports[_0xe734('0x49')]=function(_0xaf1e1e,_0x563c44){var _0x5b6f90={'raw':!![],'where':{'id':_0xaf1e1e[_0xe734('0x4a')]['id']}},_0x5acf78={};_0x5acf78[_0xe734('0x33')]=_['keys'](db[_0xe734('0x2e')][_0xe734('0x2f')]);_0x5acf78[_0xe734('0x35')]=_[_0xe734('0x34')](_0xaf1e1e[_0xe734('0x35')]);_0x5acf78[_0xe734('0x36')]=_[_0xe734('0x37')](_0x5acf78[_0xe734('0x33')],_0x5acf78[_0xe734('0x35')]);_0x5b6f90[_0xe734('0x38')]=_[_0xe734('0x37')](_0x5acf78[_0xe734('0x33')],qs[_0xe734('0x39')](_0xaf1e1e[_0xe734('0x35')][_0xe734('0x39')]));_0x5b6f90[_0xe734('0x38')]=_0x5b6f90[_0xe734('0x38')][_0xe734('0x3a')]?_0x5b6f90[_0xe734('0x38')]:_0x5acf78[_0xe734('0x33')];if(_0xaf1e1e[_0xe734('0x35')][_0xe734('0x45')]){_0x5b6f90[_0xe734('0x46')]=[{'all':!![]}];}_0x5b6f90=_['merge']({},_0x5b6f90,_0xaf1e1e[_0xe734('0x4b')]);return db[_0xe734('0x2e')][_0xe734('0x4c')](_0x5b6f90)[_0xe734('0x44')](handleEntityNotFound(_0x563c44,null))[_0xe734('0x44')](respondWithResult(_0x563c44,null))['catch'](handleError(_0x563c44,null));};exports[_0xe734('0x4d')]=function(_0x284ccf,_0x2b61e6){return db['MailTransferReport']['create'](_0x284ccf[_0xe734('0x4e')],{})[_0xe734('0x44')](respondWithResult(_0x2b61e6,0xc9))['catch'](handleError(_0x2b61e6,null));};exports[_0xe734('0x25')]=function(_0x52469f,_0x1a211d){if(_0x52469f[_0xe734('0x4e')]['id']){delete _0x52469f[_0xe734('0x4e')]['id'];}return db['MailTransferReport'][_0xe734('0x4c')]({'where':{'id':_0x52469f[_0xe734('0x4a')]['id']}})[_0xe734('0x44')](handleEntityNotFound(_0x1a211d,null))[_0xe734('0x44')](saveUpdates(_0x52469f[_0xe734('0x4e')],null))[_0xe734('0x44')](respondWithResult(_0x1a211d,null))[_0xe734('0x48')](handleError(_0x1a211d,null));};exports['destroy']=function(_0xfbc815,_0x4c2159){return db[_0xe734('0x2e')][_0xe734('0x4c')]({'where':{'id':_0xfbc815[_0xe734('0x4a')]['id']}})[_0xe734('0x44')](handleEntityNotFound(_0x4c2159,null))[_0xe734('0x44')](removeEntity(_0x4c2159,null))[_0xe734('0x48')](handleError(_0x4c2159,null));};exports[_0xe734('0x4f')]=function(_0x46639e,_0x2aa0b8){return db['MailTransferReport']['describe']()[_0xe734('0x44')](respondWithResult(_0x2aa0b8,null))['catch'](handleError(_0x2aa0b8,null));}; \ No newline at end of file +var _0x5e70=['../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','end','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','include','params','keys','includeAll','options','catch','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x315c33,_0x2adc3c){var _0x237184=function(_0x1990a7){while(--_0x1990a7){_0x315c33['push'](_0x315c33['shift']());}};_0x237184(++_0x2adc3c);}(_0x5e70,0xf8));var _0x05e7=function(_0x5661b7,_0x83c8d0){_0x5661b7=_0x5661b7-0x0;var _0x202cb3=_0x5e70[_0x5661b7];return _0x202cb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05e7('0x0'));var zipdir=require(_0x05e7('0x1'));var jsonpatch=require(_0x05e7('0x2'));var rp=require(_0x05e7('0x3'));var moment=require(_0x05e7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x05e7('0x5'));var util=require(_0x05e7('0x6'));var path=require('path');var sox=require(_0x05e7('0x7'));var csv=require(_0x05e7('0x8'));var ejs=require(_0x05e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05e7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x05e7('0xb'));var deskjs=require(_0x05e7('0xc'));var toCsv=require(_0x05e7('0x8'));var querystring=require(_0x05e7('0xd'));var Papa=require('papaparse');var Redis=require(_0x05e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x05e7('0xf'));var as=require(_0x05e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05e7('0x11'))('api');var utils=require(_0x05e7('0x12'));var config=require(_0x05e7('0x13'));var licenseUtil=require(_0x05e7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa18f,_0x2d31f5){_0x2d31f5=_0x2d31f5||0xcc;return function(_0x153d62){if(_0x153d62){return _0xa18f[_0x05e7('0x15')](_0x2d31f5);}return _0xa18f['status'](_0x2d31f5)['end']();};}function respondWithResult(_0x282ab5,_0x165a1d){_0x165a1d=_0x165a1d||0xc8;return function(_0x2ac8a2){if(_0x2ac8a2){return _0x282ab5[_0x05e7('0x16')](_0x165a1d)[_0x05e7('0x17')](_0x2ac8a2);}};}function respondWithFilteredResult(_0x14a32b,_0x114a7e){return function(_0x5d3215){if(_0x5d3215){var _0x592643=typeof _0x114a7e[_0x05e7('0x18')]==='undefined'&&typeof _0x114a7e[_0x05e7('0x19')]===_0x05e7('0x1a');var _0x19d98c=_0x5d3215[_0x05e7('0x1b')];var _0x493045=_0x592643?0x0:_0x114a7e[_0x05e7('0x18')];var _0x3b111c=_0x592643?_0x5d3215[_0x05e7('0x1b')]:_0x114a7e[_0x05e7('0x18')]+_0x114a7e['limit'];var _0x332682;if(_0x3b111c>=_0x19d98c){_0x3b111c=_0x19d98c;_0x332682=0xc8;}else{_0x332682=0xce;}_0x14a32b[_0x05e7('0x16')](_0x332682);return _0x14a32b['set'](_0x05e7('0x1c'),_0x493045+'-'+_0x3b111c+'/'+_0x19d98c)[_0x05e7('0x17')](_0x5d3215);}return null;};}function patchUpdates(_0x15a612){return function(_0x290e8b){try{jsonpatch[_0x05e7('0x1d')](_0x290e8b,_0x15a612,!![]);}catch(_0x4fcd0a){return BPromise['reject'](_0x4fcd0a);}return _0x290e8b[_0x05e7('0x1e')]();};}function saveUpdates(_0x143020,_0x3c4b48){return function(_0x3f8e41){if(_0x3f8e41){return _0x3f8e41[_0x05e7('0x1f')](_0x143020)[_0x05e7('0x20')](function(_0x34d66c){return _0x34d66c;});}return null;};}function removeEntity(_0x121140,_0x3e1471){return function(_0x3726c1){if(_0x3726c1){return _0x3726c1['destroy']()[_0x05e7('0x20')](function(){_0x121140[_0x05e7('0x16')](0xcc)[_0x05e7('0x21')]();});}};}function handleEntityNotFound(_0x9cfe71,_0x106de5){return function(_0x4168f3){if(!_0x4168f3){_0x9cfe71[_0x05e7('0x15')](0x194);}return _0x4168f3;};}function handleError(_0x342d9f,_0x489cbb){_0x489cbb=_0x489cbb||0x1f4;return function(_0x305aaa){logger[_0x05e7('0x22')](_0x305aaa['stack']);if(_0x305aaa[_0x05e7('0x23')]){delete _0x305aaa['name'];}_0x342d9f[_0x05e7('0x16')](_0x489cbb)[_0x05e7('0x24')](_0x305aaa);};}exports[_0x05e7('0x25')]=function(_0x558e22,_0x5b01e1){var _0xa57f1={},_0x15ac54={},_0xc716fd={'count':0x0,'rows':[]};var _0x82305f=_[_0x05e7('0x26')](db[_0x05e7('0x27')][_0x05e7('0x28')],function(_0x9dca79){return{'name':_0x9dca79[_0x05e7('0x29')],'type':_0x9dca79[_0x05e7('0x2a')]['key']};});_0x15ac54[_0x05e7('0x2b')]=_[_0x05e7('0x26')](_0x82305f,_0x05e7('0x23'));_0x15ac54['query']=_['keys'](_0x558e22[_0x05e7('0x2c')]);_0x15ac54['filters']=_[_0x05e7('0x2d')](_0x15ac54[_0x05e7('0x2b')],_0x15ac54[_0x05e7('0x2c')]);_0xa57f1[_0x05e7('0x2e')]=_[_0x05e7('0x2d')](_0x15ac54[_0x05e7('0x2b')],qs[_0x05e7('0x2f')](_0x558e22[_0x05e7('0x2c')][_0x05e7('0x2f')]));_0xa57f1[_0x05e7('0x2e')]=_0xa57f1['attributes'][_0x05e7('0x30')]?_0xa57f1[_0x05e7('0x2e')]:_0x15ac54[_0x05e7('0x2b')];if(!_0x558e22['query']['hasOwnProperty'](_0x05e7('0x31'))){_0xa57f1[_0x05e7('0x19')]=qs[_0x05e7('0x19')](_0x558e22['query'][_0x05e7('0x19')]);_0xa57f1[_0x05e7('0x18')]=qs[_0x05e7('0x18')](_0x558e22[_0x05e7('0x2c')]['offset']);}_0xa57f1['order']=qs[_0x05e7('0x32')](_0x558e22['query']['sort']);_0xa57f1['where']=qs[_0x05e7('0x33')](_[_0x05e7('0x34')](_0x558e22[_0x05e7('0x2c')],_0x15ac54[_0x05e7('0x33')]),_0x82305f);if(_0x558e22[_0x05e7('0x2c')][_0x05e7('0x35')]){_0xa57f1['where']=_['merge'](_0xa57f1[_0x05e7('0x36')],{'$or':_['map'](_0x82305f,function(_0x7cc1fe){if(_0x7cc1fe[_0x05e7('0x2a')]!==_0x05e7('0x37')){var _0x50f669={};_0x50f669[_0x7cc1fe[_0x05e7('0x23')]]={'$like':'%'+_0x558e22[_0x05e7('0x2c')][_0x05e7('0x35')]+'%'};return _0x50f669;}})});}_0xa57f1=_[_0x05e7('0x38')]({},_0xa57f1,_0x558e22['options']);var _0x56155b={'where':_0xa57f1[_0x05e7('0x36')]};return db[_0x05e7('0x27')]['count'](_0x56155b)['then'](function(_0x10ff2d){_0xc716fd[_0x05e7('0x1b')]=_0x10ff2d;if(_0x558e22[_0x05e7('0x2c')]['includeAll']){_0xa57f1[_0x05e7('0x39')]=[{'all':!![]}];}return db[_0x05e7('0x27')]['findAll'](_0xa57f1);})['then'](function(_0x4de806){_0xc716fd['rows']=_0x4de806;return _0xc716fd;})[_0x05e7('0x20')](respondWithFilteredResult(_0x5b01e1,_0xa57f1))['catch'](handleError(_0x5b01e1,null));};exports['show']=function(_0x3a6819,_0x229737){var _0x45993e={'raw':!![],'where':{'id':_0x3a6819[_0x05e7('0x3a')]['id']}},_0x10934d={};_0x10934d['model']=_[_0x05e7('0x3b')](db[_0x05e7('0x27')]['rawAttributes']);_0x10934d[_0x05e7('0x2c')]=_[_0x05e7('0x3b')](_0x3a6819[_0x05e7('0x2c')]);_0x10934d[_0x05e7('0x33')]=_['intersection'](_0x10934d[_0x05e7('0x2b')],_0x10934d[_0x05e7('0x2c')]);_0x45993e['attributes']=_[_0x05e7('0x2d')](_0x10934d[_0x05e7('0x2b')],qs[_0x05e7('0x2f')](_0x3a6819['query'][_0x05e7('0x2f')]));_0x45993e[_0x05e7('0x2e')]=_0x45993e[_0x05e7('0x2e')][_0x05e7('0x30')]?_0x45993e[_0x05e7('0x2e')]:_0x10934d[_0x05e7('0x2b')];if(_0x3a6819[_0x05e7('0x2c')][_0x05e7('0x3c')]){_0x45993e['include']=[{'all':!![]}];}_0x45993e=_[_0x05e7('0x38')]({},_0x45993e,_0x3a6819[_0x05e7('0x3d')]);return db[_0x05e7('0x27')]['find'](_0x45993e)['then'](handleEntityNotFound(_0x229737,null))[_0x05e7('0x20')](respondWithResult(_0x229737,null))[_0x05e7('0x3e')](handleError(_0x229737,null));};exports[_0x05e7('0x3f')]=function(_0x2aab4e,_0x17bb60){return db[_0x05e7('0x27')][_0x05e7('0x3f')](_0x2aab4e['body'],{})[_0x05e7('0x20')](respondWithResult(_0x17bb60,0xc9))[_0x05e7('0x3e')](handleError(_0x17bb60,null));};exports[_0x05e7('0x1f')]=function(_0xeb409b,_0x1fa239){if(_0xeb409b[_0x05e7('0x40')]['id']){delete _0xeb409b[_0x05e7('0x40')]['id'];}return db[_0x05e7('0x27')][_0x05e7('0x41')]({'where':{'id':_0xeb409b[_0x05e7('0x3a')]['id']}})[_0x05e7('0x20')](handleEntityNotFound(_0x1fa239,null))[_0x05e7('0x20')](saveUpdates(_0xeb409b[_0x05e7('0x40')],null))[_0x05e7('0x20')](respondWithResult(_0x1fa239,null))[_0x05e7('0x3e')](handleError(_0x1fa239,null));};exports['destroy']=function(_0x2c586a,_0x262df7){return db['MailTransferReport'][_0x05e7('0x41')]({'where':{'id':_0x2c586a[_0x05e7('0x3a')]['id']}})[_0x05e7('0x20')](handleEntityNotFound(_0x262df7,null))[_0x05e7('0x20')](removeEntity(_0x262df7,null))['catch'](handleError(_0x262df7,null));};exports[_0x05e7('0x42')]=function(_0x49ff04,_0x3f3561){return db[_0x05e7('0x27')]['describe']()[_0x05e7('0x20')](respondWithResult(_0x3f3561,null))['catch'](handleError(_0x3f3561,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8fa8bc4..8a0a2cf 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 _0xa3d1=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0xbad110,_0x3bf3a7){var _0x5e94af=function(_0x46c9c2){while(--_0x46c9c2){_0xbad110['push'](_0xbad110['shift']());}};_0x5e94af(++_0x3bf3a7);}(_0xa3d1,0x126));var _0x1a3d=function(_0xaee481,_0x3dc091){_0xaee481=_0xaee481-0x0;var _0x54893a=_0xa3d1[_0xaee481];return _0x54893a;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var logger=require(_0x1a3d('0x2'))('api');var moment=require(_0x1a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a3d('0x4'));var fs=require('fs');var path=require(_0x1a3d('0x5'));var rimraf=require(_0x1a3d('0x6'));var config=require(_0x1a3d('0x7'));var attributes=require(_0x1a3d('0x8'));module[_0x1a3d('0x9')]=function(_0x3a4a57,_0x144a93){return _0x3a4a57['define'](_0x1a3d('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x1a3d('0xb'),'fields':[_0x1a3d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ca8=['define','MailTransferReport','report_mail_transfer','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ca8,0x123));var _0x89ca=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0x9ca8[_0x34b87f];return _0x449805;};'use strict';var _=require('lodash');var util=require(_0x89ca('0x0'));var logger=require('../../config/logger')(_0x89ca('0x1'));var moment=require(_0x89ca('0x2'));var BPromise=require(_0x89ca('0x3'));var rp=require(_0x89ca('0x4'));var fs=require('fs');var path=require(_0x89ca('0x5'));var rimraf=require('rimraf');var config=require(_0x89ca('0x6'));var attributes=require(_0x89ca('0x7'));module[_0x89ca('0x8')]=function(_0x1464be,_0x348f76){return _0x1464be[_0x89ca('0x9')](_0x89ca('0xa'),attributes,{'tableName':_0x89ca('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','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 3bd85f8..fba1b64 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 _0x6c22=['request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x5b94fd,_0x4d9684){var _0x4a64e4=function(_0xf752ec){while(--_0xf752ec){_0x5b94fd['push'](_0x5b94fd['shift']());}};_0x4a64e4(++_0x4d9684);}(_0x6c22,0x1bc));var _0x26c2=function(_0x3fb23b,_0x4ee81f){_0x3fb23b=_0x3fb23b-0x0;var _0xc01a25=_0x6c22[_0x3fb23b];return _0xc01a25;};'use strict';var _=require(_0x26c2('0x0'));var util=require(_0x26c2('0x1'));var moment=require(_0x26c2('0x2'));var BPromise=require(_0x26c2('0x3'));var rs=require(_0x26c2('0x4'));var fs=require('fs');var Redis=require(_0x26c2('0x5'));var db=require(_0x26c2('0x6'))['db'];var utils=require(_0x26c2('0x7'));var logger=require('../../config/logger')(_0x26c2('0x8'));var config=require(_0x26c2('0x9'));var jayson=require(_0x26c2('0xa'));var client=jayson[_0x26c2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174c64,_0x1e75aa,_0x14dd1c){return new BPromise(function(_0x125b6e,_0x31e86){return client[_0x26c2('0xc')](_0x174c64,_0x14dd1c)[_0x26c2('0xd')](function(_0x372bd6){logger[_0x26c2('0xe')](_0x26c2('0xf'),_0x1e75aa,_0x26c2('0x10'));logger['debug'](_0x26c2('0x11'),_0x1e75aa,_0x26c2('0x10'),JSON[_0x26c2('0x12')](_0x372bd6));if(_0x372bd6[_0x26c2('0x13')]){if(_0x372bd6[_0x26c2('0x13')][_0x26c2('0x14')]===0x1f4){logger[_0x26c2('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x1e75aa,_0x372bd6['error'][_0x26c2('0x15')]);return _0x31e86(_0x372bd6[_0x26c2('0x13')][_0x26c2('0x15')]);}logger['error'](_0x26c2('0xf'),_0x1e75aa,_0x372bd6[_0x26c2('0x13')][_0x26c2('0x15')]);return _0x125b6e(_0x372bd6[_0x26c2('0x13')][_0x26c2('0x15')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1e75aa,_0x26c2('0x10'));_0x125b6e(_0x372bd6['result']['message']);}})[_0x26c2('0x16')](function(_0x4cf088){logger[_0x26c2('0x13')](_0x26c2('0xf'),_0x1e75aa,_0x4cf088);_0x31e86(_0x4cf088);});});} \ No newline at end of file +var _0xc92b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result'];(function(_0x357951,_0x401c2f){var _0x4a648a=function(_0x32bde8){while(--_0x32bde8){_0x357951['push'](_0x357951['shift']());}};_0x4a648a(++_0x401c2f);}(_0xc92b,0x161));var _0xbc92=function(_0x2332b6,_0x2afec7){_0x2332b6=_0x2332b6-0x0;var _0x5bf3af=_0xc92b[_0x2332b6];return _0x5bf3af;};'use strict';var _=require(_0xbc92('0x0'));var util=require(_0xbc92('0x1'));var moment=require(_0xbc92('0x2'));var BPromise=require(_0xbc92('0x3'));var rs=require(_0xbc92('0x4'));var fs=require('fs');var Redis=require(_0xbc92('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc92('0x6'))(_0xbc92('0x7'));var config=require(_0xbc92('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc92('0x9')][_0xbc92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1158a0,_0xdb23d2,_0x4d071f){return new BPromise(function(_0x27835f,_0x198cb1){return client['request'](_0x1158a0,_0x4d071f)['then'](function(_0x1d4fef){logger[_0xbc92('0xb')]('MailTransferReport,\x20%s,\x20%s',_0xdb23d2,_0xbc92('0xc'));logger[_0xbc92('0xd')](_0xbc92('0xe'),_0xdb23d2,_0xbc92('0xc'),JSON[_0xbc92('0xf')](_0x1d4fef));if(_0x1d4fef[_0xbc92('0x10')]){if(_0x1d4fef[_0xbc92('0x10')][_0xbc92('0x11')]===0x1f4){logger['error'](_0xbc92('0x12'),_0xdb23d2,_0x1d4fef['error'][_0xbc92('0x13')]);return _0x198cb1(_0x1d4fef[_0xbc92('0x10')][_0xbc92('0x13')]);}logger[_0xbc92('0x10')](_0xbc92('0x12'),_0xdb23d2,_0x1d4fef['error']['message']);return _0x27835f(_0x1d4fef[_0xbc92('0x10')][_0xbc92('0x13')]);}else{logger[_0xbc92('0xb')](_0xbc92('0x12'),_0xdb23d2,_0xbc92('0xc'));_0x27835f(_0x1d4fef[_0xbc92('0x14')][_0xbc92('0x13')]);}})[_0xbc92('0x15')](function(_0x5ed41b){logger[_0xbc92('0x10')](_0xbc92('0x12'),_0xdb23d2,_0x5ed41b);_0x198cb1(_0x5ed41b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f4b1f80..7a46c06 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 _0xdaab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','util','path','express'];(function(_0xb1ccbe,_0x4ed22c){var _0x11033b=function(_0x27cf25){while(--_0x27cf25){_0xb1ccbe['push'](_0xb1ccbe['shift']());}};_0x11033b(++_0x4ed22c);}(_0xdaab,0x1dd));var _0xbdaa=function(_0x4a6cb7,_0x48a3d5){_0x4a6cb7=_0x4a6cb7-0x0;var _0x3cc689=_0xdaab[_0x4a6cb7];return _0x3cc689;};'use strict';var multer=require('multer');var util=require(_0xbdaa('0x0'));var path=require(_0xbdaa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbdaa('0x2'));var router=express['Router']();var fs_extra=require(_0xbdaa('0x3'));var auth=require(_0xbdaa('0x4'));var interaction=require(_0xbdaa('0x5'));var config=require(_0xbdaa('0x6'));var controller=require('./memberReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbdaa('0x7')]);router[_0xbdaa('0x8')](_0xbdaa('0x9'),auth[_0xbdaa('0xa')](),controller[_0xbdaa('0xb')]);router[_0xbdaa('0x8')]('/:id',auth[_0xbdaa('0xa')](),controller['show']);router[_0xbdaa('0xc')]('/',auth[_0xbdaa('0xa')](),controller[_0xbdaa('0xd')]);router[_0xbdaa('0xe')](_0xbdaa('0xf'),auth[_0xbdaa('0xa')](),controller[_0xbdaa('0x10')]);router[_0xbdaa('0x11')](_0xbdaa('0xf'),auth[_0xbdaa('0xa')](),controller[_0xbdaa('0x12')]);module[_0xbdaa('0x13')]=router; \ No newline at end of file +var _0x356c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x3efcd5,_0x4a8d63){var _0x1b3333=function(_0x29be93){while(--_0x29be93){_0x3efcd5['push'](_0x3efcd5['shift']());}};_0x1b3333(++_0x4a8d63);}(_0x356c,0x1e0));var _0xc356=function(_0x3f9b98,_0x263db4){_0x3f9b98=_0x3f9b98-0x0;var _0x1df6a2=_0x356c[_0x3f9b98];return _0x1df6a2;};'use strict';var multer=require(_0xc356('0x0'));var util=require('util');var path=require(_0xc356('0x1'));var timeout=require(_0xc356('0x2'));var express=require(_0xc356('0x3'));var router=express[_0xc356('0x4')]();var fs_extra=require(_0xc356('0x5'));var auth=require(_0xc356('0x6'));var interaction=require(_0xc356('0x7'));var config=require(_0xc356('0x8'));var controller=require(_0xc356('0x9'));router[_0xc356('0xa')]('/',auth['isAuthenticated'](),controller[_0xc356('0xb')]);router[_0xc356('0xa')](_0xc356('0xc'),auth['isAuthenticated'](),controller[_0xc356('0xd')]);router[_0xc356('0xa')](_0xc356('0xe'),auth[_0xc356('0xf')](),controller[_0xc356('0x10')]);router[_0xc356('0x11')]('/',auth[_0xc356('0xf')](),controller[_0xc356('0x12')]);router[_0xc356('0x13')](_0xc356('0xe'),auth[_0xc356('0xf')](),controller[_0xc356('0x14')]);router[_0xc356('0x15')](_0xc356('0xe'),auth[_0xc356('0xf')](),controller[_0xc356('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index fb9f76c..42dfbfc 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 _0x88ce=['exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x1d98a7,_0x3c9405){var _0x3d573f=function(_0x39e6ef){while(--_0x39e6ef){_0x1d98a7['push'](_0x1d98a7['shift']());}};_0x3d573f(++_0x3c9405);}(_0x88ce,0x1ee));var _0xe88c=function(_0xd06ea2,_0x4e0693){_0xd06ea2=_0xd06ea2-0x0;var _0x4ef9df=_0x88ce[_0xd06ea2];return _0x4ef9df;};'use strict';var Sequelize=require(_0xe88c('0x0'));var moment=require(_0xe88c('0x1'));module[_0xe88c('0x2')]={'channel':{'type':Sequelize[_0xe88c('0x3')]},'membername':{'type':Sequelize[_0xe88c('0x3')]},'interface':{'type':Sequelize[_0xe88c('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe88c('0x4')},'duration':{'type':Sequelize[_0xe88c('0x5')]},'enterAt':{'type':Sequelize[_0xe88c('0x6')]},'exitAt':{'type':Sequelize[_0xe88c('0x6')],'set':function(_0x31c048){var _0x50a4ab=moment(_0x31c048);var _0x56a677=moment(this[_0xe88c('0x7')](_0xe88c('0x8')));var _0x243c3c=_0x50a4ab['diff'](_0x56a677,_0xe88c('0x9'));this[_0xe88c('0xa')]('exitAt',_0x31c048);this[_0xe88c('0xa')](_0xe88c('0xb'),_0x243c3c>=0x0?_0x243c3c:null);}},'data1':{'type':Sequelize[_0xe88c('0x3')],'comment':_0xe88c('0xc')},'data2':{'type':Sequelize[_0xe88c('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xe88c('0x3')],'comment':_0xe88c('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0xe88c('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0xe88c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe88c('0x3')]}}; \ No newline at end of file +var _0x3c78=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','talk:[start]','talk:[queue]','sequelize'];(function(_0x381502,_0x4b48ec){var _0x32ef1f=function(_0x273a1f){while(--_0x273a1f){_0x381502['push'](_0x381502['shift']());}};_0x32ef1f(++_0x4b48ec);}(_0x3c78,0x8b));var _0x83c7=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0x3c78[_0x4bbe00];return _0x3999d2;};'use strict';var Sequelize=require(_0x83c7('0x0'));var moment=require(_0x83c7('0x1'));module[_0x83c7('0x2')]={'channel':{'type':Sequelize[_0x83c7('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x83c7('0x3')]},'type':{'type':Sequelize[_0x83c7('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x83c7('0x4')},'duration':{'type':Sequelize[_0x83c7('0x5')]},'enterAt':{'type':Sequelize[_0x83c7('0x6')]},'exitAt':{'type':Sequelize[_0x83c7('0x6')],'set':function(_0x2debb8){var _0x453858=moment(_0x2debb8);var _0x400ee0=moment(this[_0x83c7('0x7')](_0x83c7('0x8')));var _0x105641=_0x453858[_0x83c7('0x9')](_0x400ee0,'seconds');this[_0x83c7('0xa')](_0x83c7('0xb'),_0x2debb8);this[_0x83c7('0xa')]('duration',_0x105641>=0x0?_0x105641:null);}},'data1':{'type':Sequelize[_0x83c7('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x83c7('0x3')],'comment':_0x83c7('0xc')},'data3':{'type':Sequelize[_0x83c7('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x83c7('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x83c7('0x3')],'comment':_0x83c7('0xd')},'role':{'type':Sequelize[_0x83c7('0x3')]},'internal':{'type':Sequelize[_0x83c7('0x5')]},'uniqueid':{'type':Sequelize[_0x83c7('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 542b7ab..0feaa96 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(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xedd9,0xfc));var _0x9edd=function(_0x38b360,_0x4fd106){_0x38b360=_0x38b360-0x0;var _0x29932f=_0xedd9[_0x38b360];return _0x29932f;};'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(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x34e8,0x12c));var _0x834e=function(_0x5e769a,_0x4c46dd){_0x5e769a=_0x5e769a-0x0;var _0x21e22f=_0x34e8[_0x5e769a];return _0x21e22f;};'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 7361b99..3552183 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 _0xc765=['define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x37998b,_0x27ed44){var _0x2bc1ce=function(_0x5072ba){while(--_0x5072ba){_0x37998b['push'](_0x37998b['shift']());}};_0x2bc1ce(++_0x27ed44);}(_0xc765,0xf5));var _0x5c76=function(_0x2cfeff,_0x49afb3){_0x2cfeff=_0x2cfeff-0x0;var _0x325d72=_0xc765[_0x2cfeff];return _0x325d72;};'use strict';var _=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var logger=require(_0x5c76('0x2'))(_0x5c76('0x3'));var moment=require(_0x5c76('0x4'));var BPromise=require(_0x5c76('0x5'));var rp=require(_0x5c76('0x6'));var fs=require('fs');var path=require(_0x5c76('0x7'));var rimraf=require('rimraf');var config=require(_0x5c76('0x8'));var attributes=require(_0x5c76('0x9'));module[_0x5c76('0xa')]=function(_0x7ae090,_0x3a2123){return _0x7ae090[_0x5c76('0xb')](_0x5c76('0xc'),attributes,{'tableName':_0x5c76('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x5c76('0xe'),_0x5c76('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x612a=['path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','util','../../config/logger','api','moment','request-promise'];(function(_0x149d43,_0x259067){var _0x334f36=function(_0x1497e3){while(--_0x1497e3){_0x149d43['push'](_0x149d43['shift']());}};_0x334f36(++_0x259067);}(_0x612a,0xa4));var _0xa612=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x612a[_0x4c0622];return _0x1799d8;};'use strict';var _=require('lodash');var util=require(_0xa612('0x0'));var logger=require(_0xa612('0x1'))(_0xa612('0x2'));var moment=require(_0xa612('0x3'));var BPromise=require('bluebird');var rp=require(_0xa612('0x4'));var fs=require('fs');var path=require(_0xa612('0x5'));var rimraf=require(_0xa612('0x6'));var config=require(_0xa612('0x7'));var attributes=require(_0xa612('0x8'));module['exports']=function(_0x220137,_0x127f4a){return _0x220137[_0xa612('0x9')](_0xa612('0xa'),attributes,{'tableName':_0xa612('0xb'),'paranoid':![],'indexes':[{'name':_0xa612('0xc'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 44eb99e..b6ee847 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 _0x3c6c=['raw','where','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','MemberReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMemberReport','findAll','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x4db9a2,_0x28eeb2){_0x4db9a2=_0x4db9a2-0x0;var _0x15bd51=_0x3c6c[_0x4db9a2];return _0x15bd51;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var moment=require(_0xc3c6('0x1'));var BPromise=require(_0xc3c6('0x2'));var rs=require(_0xc3c6('0x3'));var fs=require('fs');var Redis=require(_0xc3c6('0x4'));var db=require(_0xc3c6('0x5'))['db'];var utils=require(_0xc3c6('0x6'));var logger=require(_0xc3c6('0x7'))(_0xc3c6('0x8'));var config=require('../../config/environment');var jayson=require(_0xc3c6('0x9'));var client=jayson['client'][_0xc3c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7ae6,_0x50cd05,_0x4aed87){return new BPromise(function(_0x5185c3,_0x4f39dd){return client[_0xc3c6('0xb')](_0x4d7ae6,_0x4aed87)[_0xc3c6('0xc')](function(_0x5bc1c1){logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));logger[_0xc3c6('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x50cd05,_0xc3c6('0xf'),JSON[_0xc3c6('0x11')](_0x5bc1c1));if(_0x5bc1c1[_0xc3c6('0x12')]){if(_0x5bc1c1['error']['code']===0x1f4){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x4f39dd(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x5185c3(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}else{logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));_0x5185c3(_0x5bc1c1[_0xc3c6('0x14')][_0xc3c6('0x13')]);}})[_0xc3c6('0x15')](function(_0x33920c){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x33920c);_0x4f39dd(_0x33920c);});});}exports[_0xc3c6('0x16')]=function(_0x26c9b0){var _0x11df9a=this;return new Promise(function(_0x3003e1,_0x470592){return db['MemberReport'][_0xc3c6('0x17')]({'raw':_0x26c9b0[_0xc3c6('0x18')]?_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x19')]===undefined?!![]:![]:!![],'where':_0x26c9b0[_0xc3c6('0x18')]?_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x1a')]||null:null,'attributes':_0x26c9b0[_0xc3c6('0x18')]?_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x1b')]||null:null,'limit':_0x26c9b0[_0xc3c6('0x18')]?_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x1c')]||null:null,'include':_0x26c9b0[_0xc3c6('0x18')]?_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x1d')]?_['map'](_0x26c9b0[_0xc3c6('0x18')][_0xc3c6('0x1d')],function(_0x2bced6){return{'model':db[_0x2bced6['model']],'as':_0x2bced6['as'],'attributes':_0x2bced6[_0xc3c6('0x1b')],'include':_0x2bced6[_0xc3c6('0x1d')]?_[_0xc3c6('0x1e')](_0x2bced6[_0xc3c6('0x1d')],function(_0x2bc9bf){return{'model':db[_0x2bc9bf[_0xc3c6('0x1f')]],'as':_0x2bc9bf['as'],'attributes':_0x2bc9bf[_0xc3c6('0x1b')],'include':_0x2bc9bf['include']?_[_0xc3c6('0x1e')](_0x2bc9bf[_0xc3c6('0x1d')],function(_0x4ca76f){return{'model':db[_0x4ca76f[_0xc3c6('0x1f')]],'as':_0x4ca76f['as'],'attributes':_0x4ca76f[_0xc3c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc3c6('0xc')](function(_0xdad009){logger[_0xc3c6('0xd')](_0xc3c6('0x16'),_0x26c9b0);logger[_0xc3c6('0x10')](_0xc3c6('0x16'),_0x26c9b0,JSON[_0xc3c6('0x11')](_0xdad009));_0x3003e1(_0xdad009);})['catch'](function(_0xb047b1){logger[_0xc3c6('0x12')](_0xc3c6('0x16'),_0xb047b1[_0xc3c6('0x13')],_0x26c9b0);_0x470592(_0x11df9a['error'](0x1f4,_0xb047b1[_0xc3c6('0x13')]));});});};exports[_0xc3c6('0x20')]=function(_0x223d34){var _0x75066f=this;return new Promise(function(_0x3189dd,_0x354797){return db['MemberReport'][_0xc3c6('0x21')](_0x223d34[_0xc3c6('0x22')],{'raw':_0x223d34[_0xc3c6('0x18')]?_0x223d34[_0xc3c6('0x18')][_0xc3c6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x34453d){logger[_0xc3c6('0xd')](_0xc3c6('0x20'),_0x223d34);logger[_0xc3c6('0x10')](_0xc3c6('0x20'),_0x223d34,JSON[_0xc3c6('0x11')](_0x34453d));_0x3189dd(_0x34453d);})[_0xc3c6('0x15')](function(_0x53b4c6){logger[_0xc3c6('0x12')]('CreateMemberReport',_0x53b4c6[_0xc3c6('0x13')],_0x223d34);_0x354797(_0x75066f[_0xc3c6('0x12')](0x1f4,_0x53b4c6[_0xc3c6('0x13')]));});});};exports[_0xc3c6('0x23')]=function(_0x1c96d0){var _0x1b8e52=this;return new Promise(function(_0x4ba1ae,_0x36562e){return db[_0xc3c6('0x24')]['update'](_0x1c96d0[_0xc3c6('0x22')],{'raw':_0x1c96d0[_0xc3c6('0x18')]?_0x1c96d0[_0xc3c6('0x18')][_0xc3c6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c96d0[_0xc3c6('0x18')]?_0x1c96d0[_0xc3c6('0x18')][_0xc3c6('0x1a')]||null:null,'attributes':_0x1c96d0['options']?_0x1c96d0['options'][_0xc3c6('0x1b')]||null:null,'limit':_0x1c96d0[_0xc3c6('0x18')]?_0x1c96d0[_0xc3c6('0x18')][_0xc3c6('0x1c')]||null:null})[_0xc3c6('0xc')](function(_0x5cbbe3){logger[_0xc3c6('0xd')](_0xc3c6('0x23'),_0x1c96d0);logger[_0xc3c6('0x10')](_0xc3c6('0x23'),_0x1c96d0,JSON[_0xc3c6('0x11')](_0x5cbbe3));_0x4ba1ae(_0x5cbbe3);})[_0xc3c6('0x15')](function(_0x2b69fd){logger[_0xc3c6('0x12')](_0xc3c6('0x23'),_0x2b69fd['message'],_0x1c96d0);_0x36562e(_0x1b8e52[_0xc3c6('0x12')](0x1f4,_0x2b69fd[_0xc3c6('0x13')]));});});}; \ No newline at end of file +var _0xdd68=['MemberReport','findAll','options','raw','where','attributes','map','include','model','CreateMemberReport','create','body','then','UpdateMemberReport','update','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport'];(function(_0x398de1,_0x4771fd){var _0x2a3527=function(_0x41a05){while(--_0x41a05){_0x398de1['push'](_0x398de1['shift']());}};_0x2a3527(++_0x4771fd);}(_0xdd68,0x196));var _0x8dd6=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xdd68[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var moment=require(_0x8dd6('0x1'));var BPromise=require(_0x8dd6('0x2'));var rs=require(_0x8dd6('0x3'));var fs=require('fs');var Redis=require(_0x8dd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dd6('0x5'));var logger=require(_0x8dd6('0x6'))('rpc');var config=require(_0x8dd6('0x7'));var jayson=require(_0x8dd6('0x8'));var client=jayson['client'][_0x8dd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c021f,_0x476bad,_0x51f78e){return new BPromise(function(_0x199f07,_0x35319b){return client[_0x8dd6('0xa')](_0x4c021f,_0x51f78e)['then'](function(_0x4323ac){logger[_0x8dd6('0xb')](_0x8dd6('0xc'),_0x476bad,_0x8dd6('0xd'));logger[_0x8dd6('0xe')](_0x8dd6('0xf'),_0x476bad,_0x8dd6('0xd'),JSON[_0x8dd6('0x10')](_0x4323ac));if(_0x4323ac[_0x8dd6('0x11')]){if(_0x4323ac[_0x8dd6('0x11')][_0x8dd6('0x12')]===0x1f4){logger[_0x8dd6('0x11')](_0x8dd6('0xc'),_0x476bad,_0x4323ac['error'][_0x8dd6('0x13')]);return _0x35319b(_0x4323ac[_0x8dd6('0x11')][_0x8dd6('0x13')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x476bad,_0x4323ac[_0x8dd6('0x11')]['message']);return _0x199f07(_0x4323ac['error'][_0x8dd6('0x13')]);}else{logger[_0x8dd6('0xb')](_0x8dd6('0xc'),_0x476bad,_0x8dd6('0xd'));_0x199f07(_0x4323ac[_0x8dd6('0x14')][_0x8dd6('0x13')]);}})[_0x8dd6('0x15')](function(_0x3e2fb5){logger[_0x8dd6('0x11')]('MemberReport,\x20%s,\x20%s',_0x476bad,_0x3e2fb5);_0x35319b(_0x3e2fb5);});});}exports[_0x8dd6('0x16')]=function(_0x1f910a){var _0x267d23=this;return new Promise(function(_0x168a30,_0x396b7a){return db[_0x8dd6('0x17')][_0x8dd6('0x18')]({'raw':_0x1f910a[_0x8dd6('0x19')]?_0x1f910a['options'][_0x8dd6('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f910a[_0x8dd6('0x19')]?_0x1f910a['options'][_0x8dd6('0x1b')]||null:null,'attributes':_0x1f910a[_0x8dd6('0x19')]?_0x1f910a[_0x8dd6('0x19')][_0x8dd6('0x1c')]||null:null,'limit':_0x1f910a['options']?_0x1f910a['options']['limit']||null:null,'include':_0x1f910a[_0x8dd6('0x19')]?_0x1f910a[_0x8dd6('0x19')]['include']?_[_0x8dd6('0x1d')](_0x1f910a[_0x8dd6('0x19')][_0x8dd6('0x1e')],function(_0x1485d4){return{'model':db[_0x1485d4[_0x8dd6('0x1f')]],'as':_0x1485d4['as'],'attributes':_0x1485d4['attributes'],'include':_0x1485d4[_0x8dd6('0x1e')]?_[_0x8dd6('0x1d')](_0x1485d4['include'],function(_0x50f513){return{'model':db[_0x50f513[_0x8dd6('0x1f')]],'as':_0x50f513['as'],'attributes':_0x50f513[_0x8dd6('0x1c')],'include':_0x50f513['include']?_[_0x8dd6('0x1d')](_0x50f513[_0x8dd6('0x1e')],function(_0x14cce1){return{'model':db[_0x14cce1[_0x8dd6('0x1f')]],'as':_0x14cce1['as'],'attributes':_0x14cce1[_0x8dd6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d855){logger[_0x8dd6('0xb')]('GetMemberReport',_0x1f910a);logger['debug'](_0x8dd6('0x16'),_0x1f910a,JSON[_0x8dd6('0x10')](_0x46d855));_0x168a30(_0x46d855);})[_0x8dd6('0x15')](function(_0x44c282){logger[_0x8dd6('0x11')](_0x8dd6('0x16'),_0x44c282[_0x8dd6('0x13')],_0x1f910a);_0x396b7a(_0x267d23[_0x8dd6('0x11')](0x1f4,_0x44c282[_0x8dd6('0x13')]));});});};exports[_0x8dd6('0x20')]=function(_0x15a0f6){var _0x3592d7=this;return new Promise(function(_0x1aff19,_0xbd6b8b){return db[_0x8dd6('0x17')][_0x8dd6('0x21')](_0x15a0f6[_0x8dd6('0x22')],{'raw':_0x15a0f6[_0x8dd6('0x19')]?_0x15a0f6[_0x8dd6('0x19')][_0x8dd6('0x1a')]===undefined?!![]:![]:!![]})[_0x8dd6('0x23')](function(_0x444582){logger['info'](_0x8dd6('0x20'),_0x15a0f6);logger[_0x8dd6('0xe')](_0x8dd6('0x20'),_0x15a0f6,JSON[_0x8dd6('0x10')](_0x444582));_0x1aff19(_0x444582);})['catch'](function(_0x30980c){logger['error']('CreateMemberReport',_0x30980c[_0x8dd6('0x13')],_0x15a0f6);_0xbd6b8b(_0x3592d7[_0x8dd6('0x11')](0x1f4,_0x30980c['message']));});});};exports[_0x8dd6('0x24')]=function(_0x21634a){var _0x18d49a=this;return new Promise(function(_0x1501e6,_0xf35096){return db['MemberReport'][_0x8dd6('0x25')](_0x21634a[_0x8dd6('0x22')],{'raw':_0x21634a[_0x8dd6('0x19')]?_0x21634a[_0x8dd6('0x19')][_0x8dd6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21634a[_0x8dd6('0x19')]?_0x21634a[_0x8dd6('0x19')]['where']||null:null,'attributes':_0x21634a[_0x8dd6('0x19')]?_0x21634a[_0x8dd6('0x19')][_0x8dd6('0x1c')]||null:null,'limit':_0x21634a[_0x8dd6('0x19')]?_0x21634a[_0x8dd6('0x19')][_0x8dd6('0x26')]||null:null})['then'](function(_0x2f9593){logger[_0x8dd6('0xb')](_0x8dd6('0x24'),_0x21634a);logger[_0x8dd6('0xe')](_0x8dd6('0x24'),_0x21634a,JSON[_0x8dd6('0x10')](_0x2f9593));_0x1501e6(_0x2f9593);})[_0x8dd6('0x15')](function(_0x4c8080){logger[_0x8dd6('0x11')](_0x8dd6('0x24'),_0x4c8080[_0x8dd6('0x13')],_0x21634a);_0xf35096(_0x18d49a['error'](0x1f4,_0x4c8080[_0x8dd6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 9a0ee22..37348ce 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 _0x3568=['../../config/environment','./migration.controller','index','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2e791b,_0x216426){var _0x391b9f=function(_0x3a2e96){while(--_0x3a2e96){_0x2e791b['push'](_0x2e791b['shift']());}};_0x391b9f(++_0x216426);}(_0x3568,0xc2));var _0x8356=function(_0x158906,_0x417b00){_0x158906=_0x158906-0x0;var _0xcb6c5f=_0x3568[_0x158906];return _0xcb6c5f;};'use strict';var multer=require(_0x8356('0x0'));var util=require(_0x8356('0x1'));var path=require('path');var timeout=require(_0x8356('0x2'));var express=require(_0x8356('0x3'));var router=express['Router']();var fs_extra=require(_0x8356('0x4'));var auth=require(_0x8356('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8356('0x6'));var controller=require(_0x8356('0x7'));router['get']('/',controller[_0x8356('0x8')]);module[_0x8356('0x9')]=router; \ No newline at end of file +var _0xe33c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','connect-timeout','express','Router'];(function(_0x5d9867,_0x5e9030){var _0x7d2118=function(_0x2e5149){while(--_0x2e5149){_0x5d9867['push'](_0x5d9867['shift']());}};_0x7d2118(++_0x5e9030);}(_0xe33c,0xbc));var _0xce33=function(_0x546136,_0x463a1f){_0x546136=_0x546136-0x0;var _0x20ad4e=_0xe33c[_0x546136];return _0x20ad4e;};'use strict';var multer=require('multer');var util=require(_0xce33('0x0'));var path=require('path');var timeout=require(_0xce33('0x1'));var express=require(_0xce33('0x2'));var router=express[_0xce33('0x3')]();var fs_extra=require(_0xce33('0x4'));var auth=require(_0xce33('0x5'));var interaction=require(_0xce33('0x6'));var config=require(_0xce33('0x7'));var controller=require(_0xce33('0x8'));router[_0xce33('0x9')]('/',controller[_0xce33('0xa')]);module[_0xce33('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index fab46c4..f850306 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 _0x5902=['sequelize','exports','STRING','version'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x5902,0x68));var _0x2590=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5902[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x2590('0x0'));module[_0x2590('0x1')]={'version':{'type':Sequelize[_0x2590('0x2')],'unique':_0x2590('0x3')}}; \ No newline at end of file +var _0xf688=['sequelize','exports','version'];(function(_0x44098b,_0x11a80a){var _0x89b454=function(_0x3b0f90){while(--_0x3b0f90){_0x44098b['push'](_0x44098b['shift']());}};_0x89b454(++_0x11a80a);}(_0xf688,0x1ce));var _0x8f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf688[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8f68('0x0'));module[_0x8f68('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x8f68('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 5559c86..a8b262d 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 _0xe279=['name','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack'];(function(_0x54f043,_0x5bb3bb){var _0x4839e4=function(_0x3f9336){while(--_0x3f9336){_0x54f043['push'](_0x54f043['shift']());}};_0x4839e4(++_0x5bb3bb);}(_0xe279,0xa5));var _0x9e27=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe279[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0x9e27('0x0'));var rimraf=require(_0x9e27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e27('0x2'));var moment=require(_0x9e27('0x3'));var BPromise=require(_0x9e27('0x4'));var Mustache=require('mustache');var util=require(_0x9e27('0x5'));var path=require(_0x9e27('0x6'));var sox=require('sox');var csv=require(_0x9e27('0x7'));var ejs=require(_0x9e27('0x8'));var fs=require('fs');var fs_extra=require(_0x9e27('0x9'));var _=require(_0x9e27('0xa'));var squel=require(_0x9e27('0xb'));var crypto=require(_0x9e27('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e27('0xd'));var Papa=require(_0x9e27('0xe'));var Redis=require(_0x9e27('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e27('0x10'));var as=require(_0x9e27('0x11'));var hardwareService=require(_0x9e27('0x12'));var logger=require(_0x9e27('0x13'))(_0x9e27('0x14'));var utils=require(_0x9e27('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e27('0x16'));var db=require(_0x9e27('0x17'))['db'];function respondWithStatusCode(_0x56e7f0,_0x36a2fa){_0x36a2fa=_0x36a2fa||0xcc;return function(_0x5d00fe){if(_0x5d00fe){return _0x56e7f0['sendStatus'](_0x36a2fa);}return _0x56e7f0[_0x9e27('0x18')](_0x36a2fa)['end']();};}function respondWithResult(_0xfd8131,_0xe7cf92){_0xe7cf92=_0xe7cf92||0xc8;return function(_0x2e74f6){if(_0x2e74f6){return _0xfd8131[_0x9e27('0x18')](_0xe7cf92)[_0x9e27('0x19')](_0x2e74f6);}};}function respondWithFilteredResult(_0x8fecc6,_0x41086e){return function(_0x34e744){if(_0x34e744){var _0x241296=typeof _0x41086e[_0x9e27('0x1a')]==='undefined'&&typeof _0x41086e['limit']===_0x9e27('0x1b');var _0x19230b=_0x34e744[_0x9e27('0x1c')];var _0x2e95ec=_0x241296?0x0:_0x41086e[_0x9e27('0x1a')];var _0x21079a=_0x241296?_0x34e744[_0x9e27('0x1c')]:_0x41086e[_0x9e27('0x1a')]+_0x41086e[_0x9e27('0x1d')];var _0xe1bd9f;if(_0x21079a>=_0x19230b){_0x21079a=_0x19230b;_0xe1bd9f=0xc8;}else{_0xe1bd9f=0xce;}_0x8fecc6[_0x9e27('0x18')](_0xe1bd9f);return _0x8fecc6['set'](_0x9e27('0x1e'),_0x2e95ec+'-'+_0x21079a+'/'+_0x19230b)['json'](_0x34e744);}return null;};}function patchUpdates(_0xb0a275){return function(_0x7bc162){try{jsonpatch['apply'](_0x7bc162,_0xb0a275,!![]);}catch(_0x4371d0){return BPromise[_0x9e27('0x1f')](_0x4371d0);}return _0x7bc162[_0x9e27('0x20')]();};}function saveUpdates(_0x3588dd,_0x1658f7){return function(_0x2bbe28){if(_0x2bbe28){return _0x2bbe28[_0x9e27('0x21')](_0x3588dd)[_0x9e27('0x22')](function(_0x58a52e){return _0x58a52e;});}return null;};}function removeEntity(_0x5de775,_0x5d9dc3){return function(_0x592965){if(_0x592965){return _0x592965[_0x9e27('0x23')]()[_0x9e27('0x22')](function(){_0x5de775[_0x9e27('0x18')](0xcc)[_0x9e27('0x24')]();});}};}function handleEntityNotFound(_0x3b89c2,_0x34420e){return function(_0xde1ca0){if(!_0xde1ca0){_0x3b89c2[_0x9e27('0x25')](0x194);}return _0xde1ca0;};}function handleError(_0x115b8c,_0x134fe6){_0x134fe6=_0x134fe6||0x1f4;return function(_0x563928){logger['error'](_0x563928[_0x9e27('0x26')]);if(_0x563928[_0x9e27('0x27')]){delete _0x563928['name'];}_0x115b8c[_0x9e27('0x18')](_0x134fe6)['send'](_0x563928);};}exports[_0x9e27('0x28')]=function(_0x319f03,_0x2c01d0){var _0x18f878={},_0x1b6b5d={},_0x1fcde4={'count':0x0,'rows':[]};var _0x4f9839=_[_0x9e27('0x29')](db[_0x9e27('0x2a')][_0x9e27('0x2b')],function(_0x3eac1b){return{'name':_0x3eac1b[_0x9e27('0x2c')],'type':_0x3eac1b[_0x9e27('0x2d')][_0x9e27('0x2e')]};});_0x1b6b5d['model']=_['map'](_0x4f9839,_0x9e27('0x27'));_0x1b6b5d[_0x9e27('0x2f')]=_[_0x9e27('0x30')](_0x319f03[_0x9e27('0x2f')]);_0x1b6b5d[_0x9e27('0x31')]=_[_0x9e27('0x32')](_0x1b6b5d['model'],_0x1b6b5d[_0x9e27('0x2f')]);_0x18f878[_0x9e27('0x33')]=_[_0x9e27('0x32')](_0x1b6b5d[_0x9e27('0x34')],qs[_0x9e27('0x35')](_0x319f03[_0x9e27('0x2f')][_0x9e27('0x35')]));_0x18f878[_0x9e27('0x33')]=_0x18f878[_0x9e27('0x33')][_0x9e27('0x36')]?_0x18f878[_0x9e27('0x33')]:_0x1b6b5d[_0x9e27('0x34')];if(!_0x319f03[_0x9e27('0x2f')][_0x9e27('0x37')](_0x9e27('0x38'))){_0x18f878['limit']=qs['limit'](_0x319f03[_0x9e27('0x2f')]['limit']);_0x18f878[_0x9e27('0x1a')]=qs[_0x9e27('0x1a')](_0x319f03[_0x9e27('0x2f')][_0x9e27('0x1a')]);}_0x18f878['order']=qs[_0x9e27('0x39')](_0x319f03[_0x9e27('0x2f')][_0x9e27('0x39')]);_0x18f878[_0x9e27('0x3a')]=qs[_0x9e27('0x31')](_[_0x9e27('0x3b')](_0x319f03['query'],_0x1b6b5d[_0x9e27('0x31')]),_0x4f9839);if(_0x319f03['query'][_0x9e27('0x3c')]){_0x18f878[_0x9e27('0x3a')]=_['merge'](_0x18f878[_0x9e27('0x3a')],{'$or':_['map'](_0x4f9839,function(_0x41f3e2){if(_0x41f3e2[_0x9e27('0x2d')]!=='VIRTUAL'){var _0x459920={};_0x459920[_0x41f3e2[_0x9e27('0x27')]]={'$like':'%'+_0x319f03[_0x9e27('0x2f')][_0x9e27('0x3c')]+'%'};return _0x459920;}})});}_0x18f878=_[_0x9e27('0x3d')]({},_0x18f878,_0x319f03[_0x9e27('0x3e')]);var _0x3566f4={'where':_0x18f878[_0x9e27('0x3a')]};return db['Migration']['count'](_0x3566f4)[_0x9e27('0x22')](function(_0x30f681){_0x1fcde4[_0x9e27('0x1c')]=_0x30f681;if(_0x319f03[_0x9e27('0x2f')][_0x9e27('0x3f')]){_0x18f878[_0x9e27('0x40')]=[{'all':!![]}];}return db[_0x9e27('0x2a')][_0x9e27('0x41')](_0x18f878);})['then'](function(_0x457773){_0x1fcde4[_0x9e27('0x42')]=_0x457773;return _0x1fcde4;})[_0x9e27('0x22')](respondWithFilteredResult(_0x2c01d0,_0x18f878))[_0x9e27('0x43')](handleError(_0x2c01d0,null));}; \ No newline at end of file +var _0xee12=['pick','filter','merge','options','include','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','reject','save','then','destroy','sendStatus','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where'];(function(_0x1c666a,_0x21e9fc){var _0x507f85=function(_0x5f1f4e){while(--_0x5f1f4e){_0x1c666a['push'](_0x1c666a['shift']());}};_0x507f85(++_0x21e9fc);}(_0xee12,0x86));var _0x2ee1=function(_0x168c6c,_0x1bfdac){_0x168c6c=_0x168c6c-0x0;var _0x4d8fea=_0xee12[_0x168c6c];return _0x4d8fea;};'use strict';var emlformat=require(_0x2ee1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ee1('0x1'));var jsonpatch=require(_0x2ee1('0x2'));var rp=require(_0x2ee1('0x3'));var moment=require(_0x2ee1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ee1('0x5'));var util=require(_0x2ee1('0x6'));var path=require(_0x2ee1('0x7'));var sox=require(_0x2ee1('0x8'));var csv=require(_0x2ee1('0x9'));var ejs=require(_0x2ee1('0xa'));var fs=require('fs');var fs_extra=require(_0x2ee1('0xb'));var _=require('lodash');var squel=require(_0x2ee1('0xc'));var crypto=require('crypto');var jsforce=require(_0x2ee1('0xd'));var deskjs=require(_0x2ee1('0xe'));var toCsv=require(_0x2ee1('0x9'));var querystring=require('querystring');var Papa=require(_0x2ee1('0xf'));var Redis=require('ioredis');var authService=require(_0x2ee1('0x10'));var qs=require(_0x2ee1('0x11'));var as=require(_0x2ee1('0x12'));var hardwareService=require(_0x2ee1('0x13'));var logger=require(_0x2ee1('0x14'))(_0x2ee1('0x15'));var utils=require('../../config/utils');var config=require(_0x2ee1('0x16'));var licenseUtil=require(_0x2ee1('0x17'));var db=require(_0x2ee1('0x18'))['db'];function respondWithStatusCode(_0x5d4fe2,_0x532ece){_0x532ece=_0x532ece||0xcc;return function(_0x2f4fba){if(_0x2f4fba){return _0x5d4fe2['sendStatus'](_0x532ece);}return _0x5d4fe2[_0x2ee1('0x19')](_0x532ece)[_0x2ee1('0x1a')]();};}function respondWithResult(_0x5c9370,_0x563504){_0x563504=_0x563504||0xc8;return function(_0x27854e){if(_0x27854e){return _0x5c9370[_0x2ee1('0x19')](_0x563504)['json'](_0x27854e);}};}function respondWithFilteredResult(_0x334957,_0x30d74b){return function(_0x2728c7){if(_0x2728c7){var _0x31198b=typeof _0x30d74b[_0x2ee1('0x1b')]===_0x2ee1('0x1c')&&typeof _0x30d74b['limit']===_0x2ee1('0x1c');var _0x2f2607=_0x2728c7['count'];var _0x57556b=_0x31198b?0x0:_0x30d74b[_0x2ee1('0x1b')];var _0x41ad5a=_0x31198b?_0x2728c7[_0x2ee1('0x1d')]:_0x30d74b[_0x2ee1('0x1b')]+_0x30d74b['limit'];var _0x280af7;if(_0x41ad5a>=_0x2f2607){_0x41ad5a=_0x2f2607;_0x280af7=0xc8;}else{_0x280af7=0xce;}_0x334957[_0x2ee1('0x19')](_0x280af7);return _0x334957[_0x2ee1('0x1e')]('Content-Range',_0x57556b+'-'+_0x41ad5a+'/'+_0x2f2607)['json'](_0x2728c7);}return null;};}function patchUpdates(_0x4cc1d8){return function(_0x5c7277){try{jsonpatch['apply'](_0x5c7277,_0x4cc1d8,!![]);}catch(_0x8ca07b){return BPromise[_0x2ee1('0x1f')](_0x8ca07b);}return _0x5c7277[_0x2ee1('0x20')]();};}function saveUpdates(_0x6cae96,_0x382d38){return function(_0x4dd05f){if(_0x4dd05f){return _0x4dd05f['update'](_0x6cae96)[_0x2ee1('0x21')](function(_0x5c90dc){return _0x5c90dc;});}return null;};}function removeEntity(_0x16d296,_0x396e20){return function(_0x35a000){if(_0x35a000){return _0x35a000[_0x2ee1('0x22')]()[_0x2ee1('0x21')](function(){_0x16d296[_0x2ee1('0x19')](0xcc)[_0x2ee1('0x1a')]();});}};}function handleEntityNotFound(_0x22a16d,_0x24560b){return function(_0x60be6d){if(!_0x60be6d){_0x22a16d[_0x2ee1('0x23')](0x194);}return _0x60be6d;};}function handleError(_0x2e593e,_0x19b64c){_0x19b64c=_0x19b64c||0x1f4;return function(_0x5ad351){logger['error'](_0x5ad351[_0x2ee1('0x24')]);if(_0x5ad351[_0x2ee1('0x25')]){delete _0x5ad351[_0x2ee1('0x25')];}_0x2e593e['status'](_0x19b64c)[_0x2ee1('0x26')](_0x5ad351);};}exports[_0x2ee1('0x27')]=function(_0x353adf,_0x5a458c){var _0x280808={},_0x4a4f5c={},_0x487b68={'count':0x0,'rows':[]};var _0x5d1320=_[_0x2ee1('0x28')](db[_0x2ee1('0x29')][_0x2ee1('0x2a')],function(_0x2ef874){return{'name':_0x2ef874[_0x2ee1('0x2b')],'type':_0x2ef874[_0x2ee1('0x2c')][_0x2ee1('0x2d')]};});_0x4a4f5c[_0x2ee1('0x2e')]=_[_0x2ee1('0x28')](_0x5d1320,_0x2ee1('0x25'));_0x4a4f5c[_0x2ee1('0x2f')]=_[_0x2ee1('0x30')](_0x353adf['query']);_0x4a4f5c[_0x2ee1('0x31')]=_[_0x2ee1('0x32')](_0x4a4f5c[_0x2ee1('0x2e')],_0x4a4f5c['query']);_0x280808[_0x2ee1('0x33')]=_[_0x2ee1('0x32')](_0x4a4f5c[_0x2ee1('0x2e')],qs[_0x2ee1('0x34')](_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x34')]));_0x280808['attributes']=_0x280808[_0x2ee1('0x33')]['length']?_0x280808['attributes']:_0x4a4f5c[_0x2ee1('0x2e')];if(!_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x35')](_0x2ee1('0x36'))){_0x280808[_0x2ee1('0x37')]=qs['limit'](_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x37')]);_0x280808['offset']=qs[_0x2ee1('0x1b')](_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x1b')]);}_0x280808['order']=qs[_0x2ee1('0x38')](_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x38')]);_0x280808[_0x2ee1('0x39')]=qs[_0x2ee1('0x31')](_[_0x2ee1('0x3a')](_0x353adf[_0x2ee1('0x2f')],_0x4a4f5c['filters']),_0x5d1320);if(_0x353adf[_0x2ee1('0x2f')][_0x2ee1('0x3b')]){_0x280808[_0x2ee1('0x39')]=_[_0x2ee1('0x3c')](_0x280808['where'],{'$or':_[_0x2ee1('0x28')](_0x5d1320,function(_0x26adf6){if(_0x26adf6[_0x2ee1('0x2c')]!=='VIRTUAL'){var _0x1ff374={};_0x1ff374[_0x26adf6[_0x2ee1('0x25')]]={'$like':'%'+_0x353adf['query']['filter']+'%'};return _0x1ff374;}})});}_0x280808=_[_0x2ee1('0x3c')]({},_0x280808,_0x353adf[_0x2ee1('0x3d')]);var _0x52df66={'where':_0x280808[_0x2ee1('0x39')]};return db[_0x2ee1('0x29')][_0x2ee1('0x1d')](_0x52df66)[_0x2ee1('0x21')](function(_0x192c3d){_0x487b68['count']=_0x192c3d;if(_0x353adf[_0x2ee1('0x2f')]['includeAll']){_0x280808[_0x2ee1('0x3e')]=[{'all':!![]}];}return db['Migration'][_0x2ee1('0x3f')](_0x280808);})['then'](function(_0x14c8b0){_0x487b68['rows']=_0x14c8b0;return _0x487b68;})[_0x2ee1('0x21')](respondWithFilteredResult(_0x5a458c,_0x280808))['catch'](handleError(_0x5a458c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a358026..db3c735 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 _0x5601=['path','rimraf','../../config/environment','./migration.attributes','exports','define','lodash','util','moment','bluebird'];(function(_0x4534e3,_0x129fc4){var _0x477e12=function(_0x40c25c){while(--_0x40c25c){_0x4534e3['push'](_0x4534e3['shift']());}};_0x477e12(++_0x129fc4);}(_0x5601,0xb0));var _0x1560=function(_0x1a49bf,_0x15b960){_0x1a49bf=_0x1a49bf-0x0;var _0x55c62d=_0x5601[_0x1a49bf];return _0x55c62d;};'use strict';var _=require(_0x1560('0x0'));var util=require(_0x1560('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1560('0x2'));var BPromise=require(_0x1560('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1560('0x4'));var rimraf=require(_0x1560('0x5'));var config=require(_0x1560('0x6'));var attributes=require(_0x1560('0x7'));module[_0x1560('0x8')]=function(_0x159a0a,_0x45a3f4){return _0x159a0a[_0x1560('0x9')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6280=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x11d10a,_0x30ca5c){var _0xeb719a=function(_0x5030e7){while(--_0x5030e7){_0x11d10a['push'](_0x11d10a['shift']());}};_0xeb719a(++_0x30ca5c);}(_0x6280,0xa5));var _0x0628=function(_0x2e3750,_0x55e4bc){_0x2e3750=_0x2e3750-0x0;var _0x5bf015=_0x6280[_0x2e3750];return _0x5bf015;};'use strict';var _=require(_0x0628('0x0'));var util=require(_0x0628('0x1'));var logger=require(_0x0628('0x2'))(_0x0628('0x3'));var moment=require(_0x0628('0x4'));var BPromise=require(_0x0628('0x5'));var rp=require(_0x0628('0x6'));var fs=require('fs');var path=require(_0x0628('0x7'));var rimraf=require(_0x0628('0x8'));var config=require(_0x0628('0x9'));var attributes=require(_0x0628('0xa'));module[_0x0628('0xb')]=function(_0x55973f,_0x18c8bf){return _0x55973f[_0x0628('0xc')](_0x0628('0xd'),attributes,{'tableName':_0x0628('0xe'),'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 004337b..6912760 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 _0xf089=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','Migration,\x20%s,\x20%s','message','util','moment','randomstring','ioredis'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xf089,0xba));var _0x9f08=function(_0x257527,_0x7808ed){_0x257527=_0x257527-0x0;var _0x51e37e=_0xf089[_0x257527];return _0x51e37e;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var moment=require(_0x9f08('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f08('0x2'));var fs=require('fs');var Redis=require(_0x9f08('0x3'));var db=require(_0x9f08('0x4'))['db'];var utils=require(_0x9f08('0x5'));var logger=require('../../config/logger')(_0x9f08('0x6'));var config=require(_0x9f08('0x7'));var jayson=require(_0x9f08('0x8'));var client=jayson[_0x9f08('0x9')][_0x9f08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39abe2,_0x5341c9,_0x9cfade){return new BPromise(function(_0x4b37fc,_0x39e238){return client['request'](_0x39abe2,_0x9cfade)[_0x9f08('0xb')](function(_0x286809){logger[_0x9f08('0xc')]('Migration,\x20%s,\x20%s',_0x5341c9,_0x9f08('0xd'));logger[_0x9f08('0xe')](_0x9f08('0xf'),_0x5341c9,'request\x20sent',JSON['stringify'](_0x286809));if(_0x286809[_0x9f08('0x10')]){if(_0x286809[_0x9f08('0x10')]['code']===0x1f4){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x39e238(_0x286809['error'][_0x9f08('0x12')]);}logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x4b37fc(_0x286809[_0x9f08('0x10')][_0x9f08('0x12')]);}else{logger[_0x9f08('0xc')](_0x9f08('0x11'),_0x5341c9,_0x9f08('0xd'));_0x4b37fc(_0x286809['result'][_0x9f08('0x12')]);}})['catch'](function(_0x5a562c){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x5a562c);_0x39e238(_0x5a562c);});});} \ No newline at end of file +var _0x3308=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4197d4,_0x2f0e58){var _0xaecb49=function(_0x51a4c1){while(--_0x51a4c1){_0x4197d4['push'](_0x4197d4['shift']());}};_0xaecb49(++_0x2f0e58);}(_0x3308,0x160));var _0x8330=function(_0x27c1f6,_0x41e2b9){_0x27c1f6=_0x27c1f6-0x0;var _0x267705=_0x3308[_0x27c1f6];return _0x267705;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var moment=require(_0x8330('0x2'));var BPromise=require(_0x8330('0x3'));var rs=require(_0x8330('0x4'));var fs=require('fs');var Redis=require(_0x8330('0x5'));var db=require(_0x8330('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8330('0x7'));var config=require('../../config/environment');var jayson=require(_0x8330('0x8'));var client=jayson[_0x8330('0x9')][_0x8330('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59c19e,_0x413cac,_0x1d5fd6){return new BPromise(function(_0x1244a7,_0x2dcc17){return client[_0x8330('0xb')](_0x59c19e,_0x1d5fd6)[_0x8330('0xc')](function(_0x4f917e){logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x413cac,'request\x20sent',JSON['stringify'](_0x4f917e));if(_0x4f917e['error']){if(_0x4f917e['error'][_0x8330('0x10')]===0x1f4){logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);return _0x2dcc17(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}logger['error'](_0x8330('0xe'),_0x413cac,_0x4f917e['error'][_0x8330('0x12')]);return _0x1244a7(_0x4f917e[_0x8330('0x11')][_0x8330('0x12')]);}else{logger[_0x8330('0xd')](_0x8330('0xe'),_0x413cac,_0x8330('0xf'));_0x1244a7(_0x4f917e[_0x8330('0x13')][_0x8330('0x12')]);}})[_0x8330('0x14')](function(_0x4d9662){logger[_0x8330('0x11')](_0x8330('0xe'),_0x413cac,_0x4d9662);_0x2dcc17(_0x4d9662);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index a30e2f1..0c689e1 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 _0x700c=['isAuthenticated','show','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x700c,0x127));var _0xc700=function(_0x7b7117,_0x5b098e){_0x7b7117=_0x7b7117-0x0;var _0x497323=_0x700c[_0x7b7117];return _0x497323;};'use strict';var multer=require('multer');var util=require(_0xc700('0x0'));var path=require(_0xc700('0x1'));var timeout=require(_0xc700('0x2'));var express=require(_0xc700('0x3'));var router=express[_0xc700('0x4')]();var fs_extra=require(_0xc700('0x5'));var auth=require(_0xc700('0x6'));var interaction=require(_0xc700('0x7'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0xc700('0x8')]('/',auth['isAuthenticated'](),controller[_0xc700('0x9')]);router[_0xc700('0x8')](_0xc700('0xa'),auth[_0xc700('0xb')](),controller[_0xc700('0xc')]);router['post']('/',auth[_0xc700('0xb')](),controller[_0xc700('0xd')]);router['put'](_0xc700('0xa'),auth[_0xc700('0xb')](),controller[_0xc700('0xe')]);router['delete'](_0xc700('0xa'),auth[_0xc700('0xb')](),controller[_0xc700('0xf')]);module[_0xc700('0x10')]=router; \ No newline at end of file +var _0x8814=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','connect-timeout'];(function(_0x5b64fa,_0x437290){var _0x4ebed4=function(_0x24d699){while(--_0x24d699){_0x5b64fa['push'](_0x5b64fa['shift']());}};_0x4ebed4(++_0x437290);}(_0x8814,0x1b8));var _0x4881=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x8814[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x4881('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4881('0x1'));var express=require('express');var router=express[_0x4881('0x2')]();var fs_extra=require(_0x4881('0x3'));var auth=require(_0x4881('0x4'));var interaction=require(_0x4881('0x5'));var config=require('../../config/environment');var controller=require(_0x4881('0x6'));router[_0x4881('0x7')]('/',auth[_0x4881('0x8')](),controller[_0x4881('0x9')]);router['get'](_0x4881('0xa'),auth['isAuthenticated'](),controller[_0x4881('0xb')]);router[_0x4881('0xc')]('/',auth[_0x4881('0x8')](),controller[_0x4881('0xd')]);router['put'](_0x4881('0xa'),auth[_0x4881('0x8')](),controller['update']);router[_0x4881('0xe')](_0x4881('0xa'),auth[_0x4881('0x8')](),controller[_0x4881('0xf')]);module[_0x4881('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c897eda..5027a0d 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 _0x4811=['exports','localnet','externip','stun','STRING'];(function(_0xf5eac2,_0xb4f2da){var _0xf81959=function(_0x189645){while(--_0x189645){_0xf5eac2['push'](_0xf5eac2['shift']());}};_0xf81959(++_0xb4f2da);}(_0x4811,0xe1));var _0x1481=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x4811[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require('sequelize');module[_0x1481('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1481('0x1'),_0x1481('0x2'),_0x1481('0x3'),'turn')},'value':{'type':Sequelize[_0x1481('0x4')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1481('0x4')]}}; \ No newline at end of file +var _0xbaaa=['sequelize','ENUM','localnet','externip','stun','turn','STRING'];(function(_0x2cde63,_0x54fd0e){var _0x1ced4d=function(_0x388a4c){while(--_0x388a4c){_0x2cde63['push'](_0x2cde63['shift']());}};_0x1ced4d(++_0x54fd0e);}(_0xbaaa,0x150));var _0xabaa=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xbaaa[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0xabaa('0x0'));module['exports']={'type':{'type':Sequelize[_0xabaa('0x1')](_0xabaa('0x2'),_0xabaa('0x3'),_0xabaa('0x4'),_0xabaa('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xabaa('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 2bbb5e8..493cf83 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 _0x6108=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','info','result','sendStatus','status','undefined','limit','count','offset','set','apply','save','update','destroy','end','stack','name','send','index','map','Network','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','find','catch','sequelize','transaction','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','create','toUpperCase','TURN','/etc/asterisk/turn_xcally.conf','toLowerCase','chan_sip.so','STUN','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','format','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/network.ejs','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xc73fa7,_0x464936){var _0x416880=function(_0xaf973e){while(--_0xaf973e){_0xc73fa7['push'](_0xc73fa7['shift']());}};_0x416880(++_0x464936);}(_0x6108,0xbc));var _0x8610=function(_0x1b71c5,_0x4fae33){_0x1b71c5=_0x1b71c5-0x0;var _0x256195=_0x6108[_0x1b71c5];return _0x256195;};'use strict';var emlformat=require(_0x8610('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8610('0x1'));var jsonpatch=require(_0x8610('0x2'));var rp=require(_0x8610('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8610('0x4'));var util=require(_0x8610('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8610('0x6'));var ejs=require(_0x8610('0x7'));var fs=require('fs');var fs_extra=require(_0x8610('0x8'));var _=require(_0x8610('0x9'));var squel=require('squel');var crypto=require(_0x8610('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8610('0xb'));var toCsv=require(_0x8610('0x6'));var querystring=require(_0x8610('0xc'));var Papa=require('papaparse');var Redis=require(_0x8610('0xd'));var authService=require(_0x8610('0xe'));var qs=require(_0x8610('0xf'));var as=require(_0x8610('0x10'));var hardwareService=require(_0x8610('0x11'));var logger=require(_0x8610('0x12'))('api');var utils=require(_0x8610('0x13'));var config=require(_0x8610('0x14'));var licenseUtil=require(_0x8610('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8610('0x16'));var client=jayson['client'][_0x8610('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x42e660,_0x413324,_0x277942,_0x3f5223){return new BPromise(function(_0x4eacbf,_0x49edbe){var _0x3ba11a=_0x3f5223||client;return _0x3ba11a[_0x8610('0x18')](_0x42e660,_0x277942)[_0x8610('0x19')](function(_0x5526b5){logger['info']('Network,\x20%s,\x20%s',_0x413324,_0x8610('0x1a'));logger[_0x8610('0x1b')](_0x8610('0x1c'),_0x413324,_0x8610('0x1a'),JSON['stringify'](_0x5526b5));if(_0x5526b5['error']){if(_0x5526b5[_0x8610('0x1d')]['code']===0x1f4){logger['error'](_0x8610('0x1e'),_0x413324,_0x5526b5['error']['message']);return _0x49edbe(_0x5526b5[_0x8610('0x1d')][_0x8610('0x1f')]);}logger['error'](_0x8610('0x1e'),_0x413324,_0x5526b5[_0x8610('0x1d')][_0x8610('0x1f')]);return _0x4eacbf(_0x5526b5[_0x8610('0x1d')][_0x8610('0x1f')]);}else{logger[_0x8610('0x20')](_0x8610('0x1e'),_0x413324,_0x8610('0x1a'));_0x4eacbf(_0x5526b5[_0x8610('0x21')][_0x8610('0x1f')]);}})['catch'](function(_0x71d01f){logger['error'](_0x8610('0x1e'),_0x413324,_0x71d01f);_0x49edbe(_0x71d01f);});});}function respondWithStatusCode(_0x2b8e7f,_0x8866a){_0x8866a=_0x8866a||0xcc;return function(_0x5103ad){if(_0x5103ad){return _0x2b8e7f[_0x8610('0x22')](_0x8866a);}return _0x2b8e7f['status'](_0x8866a)['end']();};}function respondWithResult(_0x4b3e6a,_0x5997da){_0x5997da=_0x5997da||0xc8;return function(_0x2e9cfd){if(_0x2e9cfd){return _0x4b3e6a[_0x8610('0x23')](_0x5997da)['json'](_0x2e9cfd);}};}function respondWithFilteredResult(_0x3cc4d2,_0x58daba){return function(_0xd97599){if(_0xd97599){var _0x2503bc=typeof _0x58daba['offset']===_0x8610('0x24')&&typeof _0x58daba[_0x8610('0x25')]===_0x8610('0x24');var _0x260fdc=_0xd97599[_0x8610('0x26')];var _0x3ad532=_0x2503bc?0x0:_0x58daba['offset'];var _0x42a104=_0x2503bc?_0xd97599[_0x8610('0x26')]:_0x58daba[_0x8610('0x27')]+_0x58daba['limit'];var _0x6fd01c;if(_0x42a104>=_0x260fdc){_0x42a104=_0x260fdc;_0x6fd01c=0xc8;}else{_0x6fd01c=0xce;}_0x3cc4d2['status'](_0x6fd01c);return _0x3cc4d2[_0x8610('0x28')]('Content-Range',_0x3ad532+'-'+_0x42a104+'/'+_0x260fdc)['json'](_0xd97599);}return null;};}function patchUpdates(_0x111256){return function(_0x1b4064){try{jsonpatch[_0x8610('0x29')](_0x1b4064,_0x111256,!![]);}catch(_0x53f7ac){return BPromise['reject'](_0x53f7ac);}return _0x1b4064[_0x8610('0x2a')]();};}function saveUpdates(_0x51e682,_0x1c4160){return function(_0x3a4a6b){if(_0x3a4a6b){return _0x3a4a6b[_0x8610('0x2b')](_0x51e682)[_0x8610('0x19')](function(_0x576a5a){return _0x576a5a;});}return null;};}function removeEntity(_0x2c228c,_0x3d8482){return function(_0x1bdfcd){if(_0x1bdfcd){return _0x1bdfcd[_0x8610('0x2c')]()[_0x8610('0x19')](function(){_0x2c228c[_0x8610('0x23')](0xcc)[_0x8610('0x2d')]();});}};}function handleEntityNotFound(_0x2d633e,_0x56601b){return function(_0x5cc619){if(!_0x5cc619){_0x2d633e[_0x8610('0x22')](0x194);}return _0x5cc619;};}function handleError(_0x1bf88a,_0x349c62){_0x349c62=_0x349c62||0x1f4;return function(_0x25949f){logger[_0x8610('0x1d')](_0x25949f[_0x8610('0x2e')]);if(_0x25949f[_0x8610('0x2f')]){delete _0x25949f[_0x8610('0x2f')];}_0x1bf88a[_0x8610('0x23')](_0x349c62)[_0x8610('0x30')](_0x25949f);};}exports[_0x8610('0x31')]=function(_0x5dc6dc,_0x32f264){var _0x573999={},_0x29fb41={},_0x566eaa={'count':0x0,'rows':[]};var _0x59b923=_[_0x8610('0x32')](db[_0x8610('0x33')][_0x8610('0x34')],function(_0x2233f3){return{'name':_0x2233f3[_0x8610('0x35')],'type':_0x2233f3['type']['key']};});_0x29fb41[_0x8610('0x36')]=_[_0x8610('0x32')](_0x59b923,_0x8610('0x2f'));_0x29fb41['query']=_['keys'](_0x5dc6dc[_0x8610('0x37')]);_0x29fb41[_0x8610('0x38')]=_[_0x8610('0x39')](_0x29fb41[_0x8610('0x36')],_0x29fb41[_0x8610('0x37')]);_0x573999[_0x8610('0x3a')]=_[_0x8610('0x39')](_0x29fb41[_0x8610('0x36')],qs[_0x8610('0x3b')](_0x5dc6dc[_0x8610('0x37')][_0x8610('0x3b')]));_0x573999['attributes']=_0x573999['attributes'][_0x8610('0x3c')]?_0x573999[_0x8610('0x3a')]:_0x29fb41[_0x8610('0x36')];if(!_0x5dc6dc['query']['hasOwnProperty'](_0x8610('0x3d'))){_0x573999[_0x8610('0x25')]=qs[_0x8610('0x25')](_0x5dc6dc[_0x8610('0x37')][_0x8610('0x25')]);_0x573999['offset']=qs[_0x8610('0x27')](_0x5dc6dc['query']['offset']);}_0x573999[_0x8610('0x3e')]=qs[_0x8610('0x3f')](_0x5dc6dc[_0x8610('0x37')][_0x8610('0x3f')]);_0x573999[_0x8610('0x40')]=qs[_0x8610('0x38')](_[_0x8610('0x41')](_0x5dc6dc[_0x8610('0x37')],_0x29fb41['filters']),_0x59b923);if(_0x5dc6dc[_0x8610('0x37')][_0x8610('0x42')]){_0x573999[_0x8610('0x40')]=_[_0x8610('0x43')](_0x573999['where'],{'$or':_[_0x8610('0x32')](_0x59b923,function(_0x59d9a5){if(_0x59d9a5[_0x8610('0x44')]!==_0x8610('0x45')){var _0x412824={};_0x412824[_0x59d9a5[_0x8610('0x2f')]]={'$like':'%'+_0x5dc6dc[_0x8610('0x37')][_0x8610('0x42')]+'%'};return _0x412824;}})});}_0x573999=_[_0x8610('0x43')]({},_0x573999,_0x5dc6dc[_0x8610('0x46')]);var _0x94bf23={'where':_0x573999[_0x8610('0x40')]};return db[_0x8610('0x33')]['count'](_0x94bf23)[_0x8610('0x19')](function(_0x3d9ce4){_0x566eaa[_0x8610('0x26')]=_0x3d9ce4;if(_0x5dc6dc['query'][_0x8610('0x47')]){_0x573999['include']=[{'all':!![]}];}return db[_0x8610('0x33')][_0x8610('0x48')](_0x573999);})[_0x8610('0x19')](function(_0x1d7241){_0x566eaa[_0x8610('0x49')]=_0x1d7241;return _0x566eaa;})[_0x8610('0x19')](respondWithFilteredResult(_0x32f264,_0x573999))['catch'](handleError(_0x32f264,null));};exports['show']=function(_0xc9abaf,_0x5d2544){var _0x5755e8={'raw':!![],'where':{'id':_0xc9abaf[_0x8610('0x4a')]['id']}},_0x536197={};_0x536197[_0x8610('0x36')]=_[_0x8610('0x4b')](db[_0x8610('0x33')]['rawAttributes']);_0x536197[_0x8610('0x37')]=_['keys'](_0xc9abaf['query']);_0x536197[_0x8610('0x38')]=_[_0x8610('0x39')](_0x536197[_0x8610('0x36')],_0x536197[_0x8610('0x37')]);_0x5755e8['attributes']=_['intersection'](_0x536197['model'],qs[_0x8610('0x3b')](_0xc9abaf[_0x8610('0x37')][_0x8610('0x3b')]));_0x5755e8[_0x8610('0x3a')]=_0x5755e8[_0x8610('0x3a')]['length']?_0x5755e8[_0x8610('0x3a')]:_0x536197[_0x8610('0x36')];if(_0xc9abaf[_0x8610('0x37')][_0x8610('0x47')]){_0x5755e8[_0x8610('0x4c')]=[{'all':!![]}];}_0x5755e8=_['merge']({},_0x5755e8,_0xc9abaf[_0x8610('0x46')]);return db[_0x8610('0x33')][_0x8610('0x4d')](_0x5755e8)[_0x8610('0x19')](handleEntityNotFound(_0x5d2544,null))['then'](respondWithResult(_0x5d2544,null))[_0x8610('0x4e')](handleError(_0x5d2544,null));};exports['create']=function(_0x18001c,_0x54058f,_0x52ed2f){var _0x4b9f68;return db[_0x8610('0x4f')][_0x8610('0x50')](function(_0x1b4789){return db[_0x8610('0x33')]['create'](_0x18001c[_0x8610('0x51')],{'raw':!![]})[_0x8610('0x19')](function(_0x21e506){_0x4b9f68=_0x21e506;return db[_0x8610('0x33')][_0x8610('0x48')]({'where':{'type':_0x18001c[_0x8610('0x51')][_0x8610('0x44')]},'raw':!![]});})['then'](function(_0x4a3015){if(_0x4b9f68['type']['toUpperCase']()=='STUN'){var _0x3e2138=fs[_0x8610('0x52')](path[_0x8610('0x53')](config[_0x8610('0x54')],_0x8610('0x55')),_0x8610('0x56'));var _0x30ef9f=ejs[_0x8610('0x57')](_0x3e2138,{'networks':_0x4a3015||[]});fs[_0x8610('0x58')]('/etc/asterisk/stun_xcally.conf',_0x30ef9f);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x5a'),{'module':'res_stun_monitor.so'});}else if(_0x4b9f68[_0x8610('0x44')][_0x8610('0x5b')]()==_0x8610('0x5c')){var _0xfca91d=fs[_0x8610('0x52')](path[_0x8610('0x53')](config[_0x8610('0x54')],'server/files/templates/turn_multiple.ejs'),_0x8610('0x56'));var _0x1a9cbd=ejs['render'](_0xfca91d,{'networks':_0x4a3015||[]});fs[_0x8610('0x58')](_0x8610('0x5d'),_0x1a9cbd);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x5a'),{'module':'res_stun_monitor.so'});}else{var _0xef55c7=fs[_0x8610('0x52')](path[_0x8610('0x53')](config['root'],'server/files/templates/network.ejs'),_0x8610('0x56'));var _0x105a36=ejs['render'](_0xef55c7,{'networks':_0x4a3015||[]});fs[_0x8610('0x58')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x18001c[_0x8610('0x51')][_0x8610('0x44')][_0x8610('0x5e')]()),_0x105a36);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x5a'),{'module':_0x8610('0x5f')});}return null;})[_0x8610('0x19')](function(){return _0x4b9f68;});})[_0x8610('0x19')](respondWithResult(_0x54058f,0xc9))[_0x8610('0x4e')](handleError(_0x54058f,null));};exports[_0x8610('0x2b')]=function(_0x245484,_0x52f082,_0x1ca674){var _0x5ae321;return db[_0x8610('0x4f')]['transaction'](function(_0x3c7d79){return db[_0x8610('0x33')][_0x8610('0x4d')]({'where':{'id':_0x245484[_0x8610('0x4a')]['id']}})[_0x8610('0x19')](handleEntityNotFound(_0x52f082,null))['then'](saveUpdates(_0x245484[_0x8610('0x51')],null))[_0x8610('0x19')](function(_0xa5d651){if(_0xa5d651){_0x5ae321=_0xa5d651;return db['Network']['findAll']({'where':{'type':_0x5ae321[_0x8610('0x44')]},'raw':!![]});}return null;})[_0x8610('0x19')](function(_0x47522d){if(_0x5ae321[_0x8610('0x44')]['toUpperCase']()==_0x8610('0x60')){var _0x1e0458=fs['readFileSync'](path[_0x8610('0x53')](config['root'],_0x8610('0x55')),'utf8');var _0x16ce97=ejs[_0x8610('0x57')](_0x1e0458,{'networks':_0x47522d||[]});fs[_0x8610('0x58')](_0x8610('0x61'),_0x16ce97);return respondWithRpcPromise('Reload',_0x8610('0x2b'),{'module':_0x8610('0x62')});}else if(_0x5ae321[_0x8610('0x44')][_0x8610('0x5b')]()==_0x8610('0x5c')){var _0x2a2599=fs[_0x8610('0x52')](path[_0x8610('0x53')](config['root'],_0x8610('0x63')),_0x8610('0x56'));var _0x459eee=ejs[_0x8610('0x57')](_0x2a2599,{'networks':_0x47522d||[]});fs['writeFileSync'](_0x8610('0x5d'),_0x459eee);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x2b'),{'module':_0x8610('0x62')});}else{var _0x1bc417=fs[_0x8610('0x52')](path[_0x8610('0x53')](config[_0x8610('0x54')],'server/files/templates/network.ejs'),_0x8610('0x56'));var _0x4b4663=ejs[_0x8610('0x57')](_0x1bc417,{'networks':_0x47522d||[]});fs[_0x8610('0x58')](util[_0x8610('0x64')](_0x8610('0x65'),_0x245484[_0x8610('0x51')][_0x8610('0x44')][_0x8610('0x5e')]()),_0x4b4663);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x2b'),{'module':_0x8610('0x5f')});}return null;})[_0x8610('0x19')](function(_0x3a66a9){if(_0x3a66a9){return _0x5ae321;}return null;});})[_0x8610('0x19')](respondWithResult(_0x52f082,null))['catch'](handleError(_0x52f082,null));};exports[_0x8610('0x2c')]=function(_0x15b1df,_0x5bd42e,_0x106024){var _0x552884;return db[_0x8610('0x33')]['find']({'where':{'id':_0x15b1df[_0x8610('0x4a')]['id']}})[_0x8610('0x19')](function(_0x49570a){_0x552884=_0x49570a;return _0x49570a;})[_0x8610('0x19')](handleEntityNotFound(_0x5bd42e,null))['then'](removeEntity(_0x5bd42e,null))[_0x8610('0x19')](function(){if(_0x552884){return db['Network']['findAll']({'where':{'type':_0x552884['type']},'raw':!![]});}})[_0x8610('0x19')](function(_0x2663b1){if(_0x552884[_0x8610('0x44')][_0x8610('0x5b')]()==_0x8610('0x60')){var _0x5bae3b=fs['readFileSync'](path[_0x8610('0x53')](config[_0x8610('0x54')],_0x8610('0x55')),_0x8610('0x56'));var _0x54fdda=ejs[_0x8610('0x57')](_0x5bae3b,{'networks':_0x2663b1||[]});fs[_0x8610('0x58')](_0x8610('0x61'),_0x54fdda);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x2c'),{'module':'res_stun_monitor.so'});}else if(_0x552884[_0x8610('0x44')][_0x8610('0x5b')]()=='TURN'){var _0x4ab387=fs[_0x8610('0x52')](path[_0x8610('0x53')](config['root'],_0x8610('0x63')),_0x8610('0x56'));var _0x300b24=ejs[_0x8610('0x57')](_0x4ab387,{'networks':_0x2663b1||[]});fs[_0x8610('0x58')]('/etc/asterisk/turn_xcally.conf',_0x300b24);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x2c'),{'module':_0x8610('0x62')});}else{var _0x48375c=fs[_0x8610('0x52')](path['join'](config[_0x8610('0x54')],_0x8610('0x66')),_0x8610('0x56'));var _0x1a56a9=ejs['render'](_0x48375c,{'networks':_0x2663b1||[]});fs[_0x8610('0x58')](util[_0x8610('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x15b1df[_0x8610('0x51')][_0x8610('0x44')][_0x8610('0x5e')]()),_0x1a56a9);return respondWithRpcPromise(_0x8610('0x59'),_0x8610('0x2c'),{'module':_0x8610('0x5f')});}return null;})[_0x8610('0x4e')](handleError(_0x5bd42e,null));}; \ No newline at end of file +var _0xf1c9=['index','map','Network','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','sequelize','transaction','create','body','STUN','readFileSync','root','render','res_stun_monitor.so','toUpperCase','join','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','TURN','chan_sip.so','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','request\x20sent','debug','stringify','code','Network,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','reject','update','then','name','send'];(function(_0x4e9b0d,_0x1ecade){var _0x3c0ba5=function(_0x13dea2){while(--_0x13dea2){_0x4e9b0d['push'](_0x4e9b0d['shift']());}};_0x3c0ba5(++_0x1ecade);}(_0xf1c9,0xa0));var _0x9f1c=function(_0x19fa57,_0x2f3706){_0x19fa57=_0x19fa57-0x0;var _0x1d8274=_0xf1c9[_0x19fa57];return _0x1d8274;};'use strict';var emlformat=require(_0x9f1c('0x0'));var rimraf=require(_0x9f1c('0x1'));var zipdir=require(_0x9f1c('0x2'));var jsonpatch=require(_0x9f1c('0x3'));var rp=require(_0x9f1c('0x4'));var moment=require(_0x9f1c('0x5'));var BPromise=require(_0x9f1c('0x6'));var Mustache=require(_0x9f1c('0x7'));var util=require(_0x9f1c('0x8'));var path=require(_0x9f1c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f1c('0xa'));var _=require('lodash');var squel=require(_0x9f1c('0xb'));var crypto=require(_0x9f1c('0xc'));var jsforce=require(_0x9f1c('0xd'));var deskjs=require(_0x9f1c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f1c('0xf'));var authService=require(_0x9f1c('0x10'));var qs=require(_0x9f1c('0x11'));var as=require(_0x9f1c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f1c('0x13'))(_0x9f1c('0x14'));var utils=require(_0x9f1c('0x15'));var config=require(_0x9f1c('0x16'));var licenseUtil=require(_0x9f1c('0x17'));var db=require(_0x9f1c('0x18'))['db'];var jayson=require(_0x9f1c('0x19'));var client=jayson[_0x9f1c('0x1a')][_0x9f1c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x21d63b,_0x145bd6,_0x5dedd2,_0x5b203b){return new BPromise(function(_0x11c04d,_0x192f62){var _0x1554bb=_0x5b203b||client;return _0x1554bb[_0x9f1c('0x1c')](_0x21d63b,_0x5dedd2)['then'](function(_0x429b4e){logger['info']('Network,\x20%s,\x20%s',_0x145bd6,_0x9f1c('0x1d'));logger[_0x9f1c('0x1e')]('Network,\x20%s,\x20%s,\x20%s',_0x145bd6,_0x9f1c('0x1d'),JSON[_0x9f1c('0x1f')](_0x429b4e));if(_0x429b4e['error']){if(_0x429b4e['error'][_0x9f1c('0x20')]===0x1f4){logger['error'](_0x9f1c('0x21'),_0x145bd6,_0x429b4e[_0x9f1c('0x22')]['message']);return _0x192f62(_0x429b4e[_0x9f1c('0x22')][_0x9f1c('0x23')]);}logger[_0x9f1c('0x22')](_0x9f1c('0x21'),_0x145bd6,_0x429b4e[_0x9f1c('0x22')]['message']);return _0x11c04d(_0x429b4e[_0x9f1c('0x22')][_0x9f1c('0x23')]);}else{logger[_0x9f1c('0x24')](_0x9f1c('0x21'),_0x145bd6,'request\x20sent');_0x11c04d(_0x429b4e['result'][_0x9f1c('0x23')]);}})[_0x9f1c('0x25')](function(_0x286feb){logger[_0x9f1c('0x22')](_0x9f1c('0x21'),_0x145bd6,_0x286feb);_0x192f62(_0x286feb);});});}function respondWithStatusCode(_0x15c584,_0x464f3d){_0x464f3d=_0x464f3d||0xcc;return function(_0x486771){if(_0x486771){return _0x15c584[_0x9f1c('0x26')](_0x464f3d);}return _0x15c584[_0x9f1c('0x27')](_0x464f3d)[_0x9f1c('0x28')]();};}function respondWithResult(_0x5a63ef,_0x5383f0){_0x5383f0=_0x5383f0||0xc8;return function(_0x452ccb){if(_0x452ccb){return _0x5a63ef[_0x9f1c('0x27')](_0x5383f0)['json'](_0x452ccb);}};}function respondWithFilteredResult(_0x905502,_0x198268){return function(_0x4987d4){if(_0x4987d4){var _0x358543=typeof _0x198268['offset']===_0x9f1c('0x29')&&typeof _0x198268['limit']===_0x9f1c('0x29');var _0x26c3c3=_0x4987d4[_0x9f1c('0x2a')];var _0x1a01e3=_0x358543?0x0:_0x198268['offset'];var _0x4d5d89=_0x358543?_0x4987d4[_0x9f1c('0x2a')]:_0x198268[_0x9f1c('0x2b')]+_0x198268[_0x9f1c('0x2c')];var _0x30da2a;if(_0x4d5d89>=_0x26c3c3){_0x4d5d89=_0x26c3c3;_0x30da2a=0xc8;}else{_0x30da2a=0xce;}_0x905502[_0x9f1c('0x27')](_0x30da2a);return _0x905502['set'](_0x9f1c('0x2d'),_0x1a01e3+'-'+_0x4d5d89+'/'+_0x26c3c3)[_0x9f1c('0x2e')](_0x4987d4);}return null;};}function patchUpdates(_0x5bcbf6){return function(_0x378f7b){try{jsonpatch['apply'](_0x378f7b,_0x5bcbf6,!![]);}catch(_0x139182){return BPromise[_0x9f1c('0x2f')](_0x139182);}return _0x378f7b['save']();};}function saveUpdates(_0x46d7d6,_0x3a3b01){return function(_0x129711){if(_0x129711){return _0x129711[_0x9f1c('0x30')](_0x46d7d6)['then'](function(_0x426826){return _0x426826;});}return null;};}function removeEntity(_0x4b6e6b,_0x148d42){return function(_0x5a5d92){if(_0x5a5d92){return _0x5a5d92['destroy']()[_0x9f1c('0x31')](function(){_0x4b6e6b[_0x9f1c('0x27')](0xcc)[_0x9f1c('0x28')]();});}};}function handleEntityNotFound(_0x118ca3,_0x6a5f98){return function(_0x28ebe0){if(!_0x28ebe0){_0x118ca3[_0x9f1c('0x26')](0x194);}return _0x28ebe0;};}function handleError(_0x580eae,_0x37c2a1){_0x37c2a1=_0x37c2a1||0x1f4;return function(_0x597b22){logger['error'](_0x597b22['stack']);if(_0x597b22['name']){delete _0x597b22[_0x9f1c('0x32')];}_0x580eae[_0x9f1c('0x27')](_0x37c2a1)[_0x9f1c('0x33')](_0x597b22);};}exports[_0x9f1c('0x34')]=function(_0x4d51e3,_0x13236a){var _0x1e5d0d={},_0xc42da2={},_0x1c3d68={'count':0x0,'rows':[]};var _0x1d7bc0=_[_0x9f1c('0x35')](db[_0x9f1c('0x36')][_0x9f1c('0x37')],function(_0x674a1f){return{'name':_0x674a1f[_0x9f1c('0x38')],'type':_0x674a1f[_0x9f1c('0x39')][_0x9f1c('0x3a')]};});_0xc42da2[_0x9f1c('0x3b')]=_[_0x9f1c('0x35')](_0x1d7bc0,_0x9f1c('0x32'));_0xc42da2['query']=_[_0x9f1c('0x3c')](_0x4d51e3[_0x9f1c('0x3d')]);_0xc42da2[_0x9f1c('0x3e')]=_[_0x9f1c('0x3f')](_0xc42da2[_0x9f1c('0x3b')],_0xc42da2[_0x9f1c('0x3d')]);_0x1e5d0d[_0x9f1c('0x40')]=_[_0x9f1c('0x3f')](_0xc42da2[_0x9f1c('0x3b')],qs[_0x9f1c('0x41')](_0x4d51e3[_0x9f1c('0x3d')]['fields']));_0x1e5d0d[_0x9f1c('0x40')]=_0x1e5d0d['attributes'][_0x9f1c('0x42')]?_0x1e5d0d[_0x9f1c('0x40')]:_0xc42da2['model'];if(!_0x4d51e3[_0x9f1c('0x3d')]['hasOwnProperty'](_0x9f1c('0x43'))){_0x1e5d0d['limit']=qs[_0x9f1c('0x2c')](_0x4d51e3['query']['limit']);_0x1e5d0d[_0x9f1c('0x2b')]=qs[_0x9f1c('0x2b')](_0x4d51e3[_0x9f1c('0x3d')][_0x9f1c('0x2b')]);}_0x1e5d0d['order']=qs['sort'](_0x4d51e3[_0x9f1c('0x3d')][_0x9f1c('0x44')]);_0x1e5d0d[_0x9f1c('0x45')]=qs[_0x9f1c('0x3e')](_[_0x9f1c('0x46')](_0x4d51e3['query'],_0xc42da2[_0x9f1c('0x3e')]),_0x1d7bc0);if(_0x4d51e3['query']['filter']){_0x1e5d0d[_0x9f1c('0x45')]=_[_0x9f1c('0x47')](_0x1e5d0d[_0x9f1c('0x45')],{'$or':_[_0x9f1c('0x35')](_0x1d7bc0,function(_0xe4c164){if(_0xe4c164[_0x9f1c('0x39')]!==_0x9f1c('0x48')){var _0x3a8352={};_0x3a8352[_0xe4c164[_0x9f1c('0x32')]]={'$like':'%'+_0x4d51e3['query'][_0x9f1c('0x49')]+'%'};return _0x3a8352;}})});}_0x1e5d0d=_[_0x9f1c('0x47')]({},_0x1e5d0d,_0x4d51e3[_0x9f1c('0x4a')]);var _0xd9ed11={'where':_0x1e5d0d['where']};return db['Network'][_0x9f1c('0x2a')](_0xd9ed11)['then'](function(_0x454e14){_0x1c3d68[_0x9f1c('0x2a')]=_0x454e14;if(_0x4d51e3['query'][_0x9f1c('0x4b')]){_0x1e5d0d[_0x9f1c('0x4c')]=[{'all':!![]}];}return db[_0x9f1c('0x36')][_0x9f1c('0x4d')](_0x1e5d0d);})[_0x9f1c('0x31')](function(_0x507cea){_0x1c3d68[_0x9f1c('0x4e')]=_0x507cea;return _0x1c3d68;})[_0x9f1c('0x31')](respondWithFilteredResult(_0x13236a,_0x1e5d0d))[_0x9f1c('0x25')](handleError(_0x13236a,null));};exports['show']=function(_0x7719e4,_0x12fbe1){var _0x2b0c9f={'raw':!![],'where':{'id':_0x7719e4[_0x9f1c('0x4f')]['id']}},_0xf13e96={};_0xf13e96[_0x9f1c('0x3b')]=_[_0x9f1c('0x3c')](db[_0x9f1c('0x36')][_0x9f1c('0x37')]);_0xf13e96[_0x9f1c('0x3d')]=_[_0x9f1c('0x3c')](_0x7719e4[_0x9f1c('0x3d')]);_0xf13e96[_0x9f1c('0x3e')]=_[_0x9f1c('0x3f')](_0xf13e96['model'],_0xf13e96[_0x9f1c('0x3d')]);_0x2b0c9f[_0x9f1c('0x40')]=_[_0x9f1c('0x3f')](_0xf13e96[_0x9f1c('0x3b')],qs[_0x9f1c('0x41')](_0x7719e4['query'][_0x9f1c('0x41')]));_0x2b0c9f[_0x9f1c('0x40')]=_0x2b0c9f[_0x9f1c('0x40')][_0x9f1c('0x42')]?_0x2b0c9f['attributes']:_0xf13e96[_0x9f1c('0x3b')];if(_0x7719e4[_0x9f1c('0x3d')]['includeAll']){_0x2b0c9f['include']=[{'all':!![]}];}_0x2b0c9f=_[_0x9f1c('0x47')]({},_0x2b0c9f,_0x7719e4[_0x9f1c('0x4a')]);return db['Network'][_0x9f1c('0x50')](_0x2b0c9f)[_0x9f1c('0x31')](handleEntityNotFound(_0x12fbe1,null))['then'](respondWithResult(_0x12fbe1,null))[_0x9f1c('0x25')](handleError(_0x12fbe1,null));};exports['create']=function(_0x3c4b1a,_0x289994,_0x5b8f4c){var _0x2538ea;return db[_0x9f1c('0x51')][_0x9f1c('0x52')](function(_0x37164c){return db[_0x9f1c('0x36')][_0x9f1c('0x53')](_0x3c4b1a[_0x9f1c('0x54')],{'raw':!![]})[_0x9f1c('0x31')](function(_0x1afecc){_0x2538ea=_0x1afecc;return db['Network'][_0x9f1c('0x4d')]({'where':{'type':_0x3c4b1a[_0x9f1c('0x54')][_0x9f1c('0x39')]},'raw':!![]});})[_0x9f1c('0x31')](function(_0x4cc2ba){if(_0x2538ea['type']['toUpperCase']()==_0x9f1c('0x55')){var _0x4f96ea=fs[_0x9f1c('0x56')](path['join'](config[_0x9f1c('0x57')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x4e98b=ejs[_0x9f1c('0x58')](_0x4f96ea,{'networks':_0x4cc2ba||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4e98b);return respondWithRpcPromise('Reload','create',{'module':_0x9f1c('0x59')});}else if(_0x2538ea[_0x9f1c('0x39')][_0x9f1c('0x5a')]()=='TURN'){var _0x272e80=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config[_0x9f1c('0x57')],_0x9f1c('0x5c')),_0x9f1c('0x5d'));var _0x2cf0b4=ejs['render'](_0x272e80,{'networks':_0x4cc2ba||[]});fs[_0x9f1c('0x5e')](_0x9f1c('0x5f'),_0x2cf0b4);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x53'),{'module':_0x9f1c('0x59')});}else{var _0x25b493=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config[_0x9f1c('0x57')],_0x9f1c('0x61')),_0x9f1c('0x5d'));var _0x1020d0=ejs['render'](_0x25b493,{'networks':_0x4cc2ba||[]});fs[_0x9f1c('0x5e')](util[_0x9f1c('0x62')](_0x9f1c('0x63'),_0x3c4b1a[_0x9f1c('0x54')][_0x9f1c('0x39')][_0x9f1c('0x64')]()),_0x1020d0);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x53'),{'module':'chan_sip.so'});}return null;})[_0x9f1c('0x31')](function(){return _0x2538ea;});})[_0x9f1c('0x31')](respondWithResult(_0x289994,0xc9))['catch'](handleError(_0x289994,null));};exports[_0x9f1c('0x30')]=function(_0x1f1860,_0x1ec1ca,_0x41c3cf){var _0x4bffba;return db[_0x9f1c('0x51')][_0x9f1c('0x52')](function(_0x2996e7){return db['Network']['find']({'where':{'id':_0x1f1860[_0x9f1c('0x4f')]['id']}})[_0x9f1c('0x31')](handleEntityNotFound(_0x1ec1ca,null))[_0x9f1c('0x31')](saveUpdates(_0x1f1860[_0x9f1c('0x54')],null))[_0x9f1c('0x31')](function(_0xcaa5d4){if(_0xcaa5d4){_0x4bffba=_0xcaa5d4;return db['Network'][_0x9f1c('0x4d')]({'where':{'type':_0x4bffba[_0x9f1c('0x39')]},'raw':!![]});}return null;})[_0x9f1c('0x31')](function(_0x3661dd){if(_0x4bffba[_0x9f1c('0x39')]['toUpperCase']()=='STUN'){var _0x359eb2=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config['root'],_0x9f1c('0x65')),'utf8');var _0x41c2c0=ejs[_0x9f1c('0x58')](_0x359eb2,{'networks':_0x3661dd||[]});fs['writeFileSync'](_0x9f1c('0x66'),_0x41c2c0);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x30'),{'module':_0x9f1c('0x59')});}else if(_0x4bffba[_0x9f1c('0x39')][_0x9f1c('0x5a')]()==_0x9f1c('0x67')){var _0x3f2437=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config[_0x9f1c('0x57')],_0x9f1c('0x5c')),_0x9f1c('0x5d'));var _0x1e4e79=ejs['render'](_0x3f2437,{'networks':_0x3661dd||[]});fs[_0x9f1c('0x5e')](_0x9f1c('0x5f'),_0x1e4e79);return respondWithRpcPromise(_0x9f1c('0x60'),'update',{'module':_0x9f1c('0x59')});}else{var _0x5d21c9=fs[_0x9f1c('0x56')](path['join'](config[_0x9f1c('0x57')],_0x9f1c('0x61')),'utf8');var _0x4e9aed=ejs[_0x9f1c('0x58')](_0x5d21c9,{'networks':_0x3661dd||[]});fs[_0x9f1c('0x5e')](util[_0x9f1c('0x62')](_0x9f1c('0x63'),_0x1f1860[_0x9f1c('0x54')]['type'][_0x9f1c('0x64')]()),_0x4e9aed);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x30'),{'module':_0x9f1c('0x68')});}return null;})['then'](function(_0x1f06ff){if(_0x1f06ff){return _0x4bffba;}return null;});})[_0x9f1c('0x31')](respondWithResult(_0x1ec1ca,null))[_0x9f1c('0x25')](handleError(_0x1ec1ca,null));};exports[_0x9f1c('0x69')]=function(_0x5ec27f,_0x53f477,_0x2b1f1d){var _0x51d92d;return db[_0x9f1c('0x36')]['find']({'where':{'id':_0x5ec27f['params']['id']}})[_0x9f1c('0x31')](function(_0x2a6eec){_0x51d92d=_0x2a6eec;return _0x2a6eec;})[_0x9f1c('0x31')](handleEntityNotFound(_0x53f477,null))[_0x9f1c('0x31')](removeEntity(_0x53f477,null))['then'](function(){if(_0x51d92d){return db[_0x9f1c('0x36')][_0x9f1c('0x4d')]({'where':{'type':_0x51d92d[_0x9f1c('0x39')]},'raw':!![]});}})[_0x9f1c('0x31')](function(_0x3b3d32){if(_0x51d92d['type'][_0x9f1c('0x5a')]()=='STUN'){var _0x3582e1=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config[_0x9f1c('0x57')],_0x9f1c('0x65')),_0x9f1c('0x5d'));var _0x4e30d8=ejs['render'](_0x3582e1,{'networks':_0x3b3d32||[]});fs[_0x9f1c('0x5e')](_0x9f1c('0x66'),_0x4e30d8);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x69'),{'module':_0x9f1c('0x59')});}else if(_0x51d92d[_0x9f1c('0x39')]['toUpperCase']()==_0x9f1c('0x67')){var _0x2eca87=fs[_0x9f1c('0x56')](path[_0x9f1c('0x5b')](config[_0x9f1c('0x57')],_0x9f1c('0x5c')),_0x9f1c('0x5d'));var _0x12c52f=ejs[_0x9f1c('0x58')](_0x2eca87,{'networks':_0x3b3d32||[]});fs[_0x9f1c('0x5e')](_0x9f1c('0x5f'),_0x12c52f);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x69'),{'module':_0x9f1c('0x59')});}else{var _0x3fb157=fs[_0x9f1c('0x56')](path['join'](config[_0x9f1c('0x57')],'server/files/templates/network.ejs'),_0x9f1c('0x5d'));var _0x2d1fb7=ejs['render'](_0x3fb157,{'networks':_0x3b3d32||[]});fs['writeFileSync'](util[_0x9f1c('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x5ec27f[_0x9f1c('0x54')][_0x9f1c('0x39')][_0x9f1c('0x64')]()),_0x2d1fb7);return respondWithRpcPromise(_0x9f1c('0x60'),_0x9f1c('0x69'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x53f477,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index a724840..82a57e1 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 _0x2e54=['bluebird','request-promise','path','rimraf','../../config/environment','exports','Network','lodash','api','moment'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0x2e54,0x1dd));var _0x42e5=function(_0x415ab3,_0x486b05){_0x415ab3=_0x415ab3-0x0;var _0x573807=_0x2e54[_0x415ab3];return _0x573807;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x42e5('0x1'));var moment=require(_0x42e5('0x2'));var BPromise=require(_0x42e5('0x3'));var rp=require(_0x42e5('0x4'));var fs=require('fs');var path=require(_0x42e5('0x5'));var rimraf=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var attributes=require('./network.attributes');module[_0x42e5('0x8')]=function(_0x455f48,_0x38cb1b){return _0x455f48['define'](_0x42e5('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7341=['bluebird','path','rimraf','../../config/environment','./network.attributes','exports','Network','network','../../config/logger','moment'];(function(_0x3bcdd1,_0x381a91){var _0x55071d=function(_0x4c7dab){while(--_0x4c7dab){_0x3bcdd1['push'](_0x3bcdd1['shift']());}};_0x55071d(++_0x381a91);}(_0x7341,0xe4));var _0x1734=function(_0x554d55,_0x13e000){_0x554d55=_0x554d55-0x0;var _0x4e78b6=_0x7341[_0x554d55];return _0x4e78b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1734('0x0'))('api');var moment=require(_0x1734('0x1'));var BPromise=require(_0x1734('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1734('0x3'));var rimraf=require(_0x1734('0x4'));var config=require(_0x1734('0x5'));var attributes=require(_0x1734('0x6'));module[_0x1734('0x7')]=function(_0x21efd9,_0x749d97){return _0x21efd9['define'](_0x1734('0x8'),attributes,{'tableName':_0x1734('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index d1da953..30589e3 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x392d2f,_0x4901cc){_0x392d2f=_0x392d2f-0x0;var _0x44ef87=_0x7a54[_0x392d2f];return _0x44ef87;};'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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xa202a3,_0x451dfc){_0xa202a3=_0xa202a3-0x0;var _0x55b3fb=_0x7a54[_0xa202a3];return _0x55b3fb;};'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 3df9b1f..fb8c080 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 _0xf4f4=['getApplications','/:id/interactions','getInteractions','getAgents','addDisposition','post','/:id/canned_answers','notify','addApplications','/:id/users','addAgents','/:id/send','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/applications'];(function(_0x2c34f9,_0x3c9896){var _0x3b1e39=function(_0x1ec963){while(--_0x1ec963){_0x2c34f9['push'](_0x2c34f9['shift']());}};_0x3b1e39(++_0x3c9896);}(_0xf4f4,0x140));var _0x4f4f=function(_0x591565,_0x5371f8){_0x591565=_0x591565-0x0;var _0x17666b=_0xf4f4[_0x591565];return _0x17666b;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require(_0x4f4f('0x2'));var timeout=require(_0x4f4f('0x3'));var express=require(_0x4f4f('0x4'));var router=express['Router']();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require(_0x4f4f('0x7'));var config=require(_0x4f4f('0x8'));var controller=require(_0x4f4f('0x9'));router[_0x4f4f('0xa')]('/',auth[_0x4f4f('0xb')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xa')](_0x4f4f('0xd'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xa')](_0x4f4f('0xf'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0xa')](_0x4f4f('0x11'),auth[_0x4f4f('0xb')](),controller['getDispositions']);router[_0x4f4f('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0xa')](_0x4f4f('0x13'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x14')]);router[_0x4f4f('0xa')](_0x4f4f('0x15'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x16')]);router[_0x4f4f('0xa')]('/:id/users',auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x17')]);router['post']('/',auth[_0x4f4f('0xb')](),controller['create']);router['post'](_0x4f4f('0x11'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x4f4f('0x1b')]);router[_0x4f4f('0x19')](_0x4f4f('0x13'),auth[_0x4f4f('0xb')](),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);router[_0x4f4f('0x19')](_0x4f4f('0x1f'),auth[_0x4f4f('0xb')](),controller['send']);router['put'](_0x4f4f('0xf'),auth[_0x4f4f('0xb')](),controller['update']);router[_0x4f4f('0x20')](_0x4f4f('0xf'),auth[_0x4f4f('0xb')](),controller['destroy']);router[_0x4f4f('0x20')]('/:id/dispositions',auth[_0x4f4f('0xb')](),controller['removeDispositions']);router[_0x4f4f('0x20')](_0x4f4f('0x1a'),auth[_0x4f4f('0xb')](),controller['removeAnswers']);router[_0x4f4f('0x20')]('/:id/users',auth[_0x4f4f('0xb')](),controller['removeAgents']);module[_0x4f4f('0x21')]=router; \ No newline at end of file +var _0x80bb=['getInteractions','getAgents','post','create','addAnswer','notify','/:id/users','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x5bec0a,_0x5bf812){var _0x2d17af=function(_0x588858){while(--_0x588858){_0x5bec0a['push'](_0x5bec0a['shift']());}};_0x2d17af(++_0x5bf812);}(_0x80bb,0x167));var _0xb80b=function(_0x16caae,_0x1461ae){_0x16caae=_0x16caae-0x0;var _0x3d2bab=_0x80bb[_0x16caae];return _0x3d2bab;};'use strict';var multer=require(_0xb80b('0x0'));var util=require('util');var path=require(_0xb80b('0x1'));var timeout=require(_0xb80b('0x2'));var express=require(_0xb80b('0x3'));var router=express[_0xb80b('0x4')]();var fs_extra=require(_0xb80b('0x5'));var auth=require(_0xb80b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb80b('0x7'));router[_0xb80b('0x8')]('/',auth[_0xb80b('0x9')](),controller['index']);router[_0xb80b('0x8')](_0xb80b('0xa'),auth[_0xb80b('0x9')](),controller[_0xb80b('0xb')]);router['get'](_0xb80b('0xc'),auth[_0xb80b('0x9')](),controller[_0xb80b('0xd')]);router[_0xb80b('0x8')](_0xb80b('0xe'),auth[_0xb80b('0x9')](),controller[_0xb80b('0xf')]);router[_0xb80b('0x8')](_0xb80b('0x10'),auth['isAuthenticated'](),controller[_0xb80b('0x11')]);router[_0xb80b('0x8')](_0xb80b('0x12'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x13')]);router['get'](_0xb80b('0x14'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x15')]);router['get']('/:id/users',auth[_0xb80b('0x9')](),controller[_0xb80b('0x16')]);router[_0xb80b('0x17')]('/',auth[_0xb80b('0x9')](),controller[_0xb80b('0x18')]);router[_0xb80b('0x17')]('/:id/dispositions',auth[_0xb80b('0x9')](),controller['addDisposition']);router[_0xb80b('0x17')](_0xb80b('0x10'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x19')]);router['post']('/:id/notify',controller[_0xb80b('0x1a')]);router[_0xb80b('0x17')](_0xb80b('0x12'),auth[_0xb80b('0x9')](),controller['addApplications']);router[_0xb80b('0x17')](_0xb80b('0x1b'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x1c')]);router['post'](_0xb80b('0x1d'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x1e')]);router[_0xb80b('0x1f')]('/:id',auth[_0xb80b('0x9')](),controller[_0xb80b('0x20')]);router[_0xb80b('0x21')](_0xb80b('0xc'),auth['isAuthenticated'](),controller[_0xb80b('0x22')]);router['delete'](_0xb80b('0xe'),auth[_0xb80b('0x9')](),controller[_0xb80b('0x23')]);router['delete']('/:id/canned_answers',auth[_0xb80b('0x9')](),controller[_0xb80b('0x24')]);router[_0xb80b('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xb80b('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0e85649..4b6d531 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 _0x0c35=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','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'];(function(_0x5d54a5,_0x1a889a){var _0x62b2e1=function(_0x113141){while(--_0x113141){_0x5d54a5['push'](_0x5d54a5['shift']());}};_0x62b2e1(++_0x1a889a);}(_0x0c35,0x6b));var _0x50c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c35[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x50c3('0x0'));var rs=require(_0x50c3('0x1'));module[_0x50c3('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x50c3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x50c3('0x4')]},'token':{'type':Sequelize[_0x50c3('0x4')],'defaultValue':function(){return rs[_0x50c3('0x5')]();}},'replyUri':{'type':Sequelize[_0x50c3('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x50c3('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x50c3('0x6')],'defaultValue':function(){return _0x50c3('0x7');}},'notificationSound':{'type':Sequelize[_0x50c3('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50c3('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x50c3('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x50c3('0x4')]},'queueTransfer':{'type':Sequelize[_0x50c3('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50c3('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x50c3('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50c3('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x50c3('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x50c3('0x8')],'defaultValue':![],'comment':_0x50c3('0xb'),'set':function(_0x5f29a4){if(!_0x5f29a4)this[_0x50c3('0xc')](_0x50c3('0xd'),null);this[_0x50c3('0xc')](_0x50c3('0xe'),_0x5f29a4);}}}; \ No newline at end of file +var _0x8859=['name','STRING','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports'];(function(_0x5e52cd,_0xb33897){var _0x5e367c=function(_0x25f65b){while(--_0x25f65b){_0x5e52cd['push'](_0x5e52cd['shift']());}};_0x5e367c(++_0xb33897);}(_0x8859,0x73));var _0x9885=function(_0x2f4226,_0x4719be){_0x2f4226=_0x2f4226-0x0;var _0x557c45=_0x8859[_0x2f4226];return _0x557c45;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9885('0x0'));module[_0x9885('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9885('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x9885('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9885('0x4')]();}},'replyUri':{'type':Sequelize[_0x9885('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9885('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9885('0x5')],'defaultValue':function(){return _0x9885('0x6');}},'notificationSound':{'type':Sequelize[_0x9885('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9885('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9885('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9885('0x3')]},'queueTransfer':{'type':Sequelize[_0x9885('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9885('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9885('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9885('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4e0125){if(!_0x4e0125)this[_0x9885('0xa')](_0x9885('0xb'),null);this[_0x9885('0xa')](_0x9885('0xc'),_0x4e0125);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index bf43ca5..dea7047 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 _0xeef7=['VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getDispositions','findOne','Disposition','order','pick','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','OpenchannelApplication','Applications','List','applications','list','orderBy','priority','asc','account','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','DESC','ListId','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','offset','undefined','limit','status','json','apply','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','merge'];(function(_0x155574,_0x4e0b0b){var _0x56b559=function(_0x1a4b1d){while(--_0x1a4b1d){_0x155574['push'](_0x155574['shift']());}};_0x56b559(++_0x4e0b0b);}(_0xeef7,0x1ed));var _0x7eef=function(_0x1c6f10,_0x5eed05){_0x1c6f10=_0x1c6f10-0x0;var _0x5a9683=_0xeef7[_0x1c6f10];return _0x5a9683;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7eef('0x0'));var zipdir=require(_0x7eef('0x1'));var jsonpatch=require(_0x7eef('0x2'));var rp=require(_0x7eef('0x3'));var moment=require(_0x7eef('0x4'));var BPromise=require(_0x7eef('0x5'));var Mustache=require(_0x7eef('0x6'));var util=require(_0x7eef('0x7'));var path=require('path');var sox=require(_0x7eef('0x8'));var csv=require(_0x7eef('0x9'));var ejs=require(_0x7eef('0xa'));var fs=require('fs');var fs_extra=require(_0x7eef('0xb'));var _=require(_0x7eef('0xc'));var squel=require(_0x7eef('0xd'));var crypto=require(_0x7eef('0xe'));var jsforce=require(_0x7eef('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7eef('0x9'));var querystring=require(_0x7eef('0x10'));var Papa=require(_0x7eef('0x11'));var Redis=require(_0x7eef('0x12'));var authService=require(_0x7eef('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7eef('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7eef('0x15'))(_0x7eef('0x16'));var utils=require(_0x7eef('0x17'));var config=require(_0x7eef('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7eef('0x19'))['db'];config[_0x7eef('0x1a')]=_[_0x7eef('0x1b')](config[_0x7eef('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7eef('0x1c'))(new Redis(config[_0x7eef('0x1a')]));require(_0x7eef('0x1d'))[_0x7eef('0x1e')](socket);var jayson=require(_0x7eef('0x1f'));var client=jayson[_0x7eef('0x20')][_0x7eef('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2333,_0x11dcd7,_0x16fa91,_0x20115f){return new BPromise(function(_0x1e887e,_0x24fab2){var _0x3e232e=_0x20115f||client;return _0x3e232e[_0x7eef('0x22')](_0x1a2333,_0x16fa91)[_0x7eef('0x23')](function(_0x52a202){logger[_0x7eef('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x11dcd7,_0x7eef('0x25'));logger[_0x7eef('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11dcd7,_0x7eef('0x25'),JSON['stringify'](_0x52a202));if(_0x52a202['error']){if(_0x52a202[_0x7eef('0x27')][_0x7eef('0x28')]===0x1f4){logger['error'](_0x7eef('0x29'),_0x11dcd7,_0x52a202[_0x7eef('0x27')]['message']);return _0x24fab2(_0x52a202[_0x7eef('0x27')][_0x7eef('0x2a')]);}logger[_0x7eef('0x27')](_0x7eef('0x29'),_0x11dcd7,_0x52a202[_0x7eef('0x27')][_0x7eef('0x2a')]);return _0x1e887e(_0x52a202[_0x7eef('0x27')][_0x7eef('0x2a')]);}else{logger['info'](_0x7eef('0x29'),_0x11dcd7,_0x7eef('0x25'));_0x1e887e(_0x52a202['result']['message']);}})[_0x7eef('0x2b')](function(_0x45555c){logger[_0x7eef('0x27')](_0x7eef('0x29'),_0x11dcd7,_0x45555c);_0x24fab2(_0x45555c);});});}function respondWithStatusCode(_0x3c3ccb,_0xc61803){_0xc61803=_0xc61803||0xcc;return function(_0x396f96){if(_0x396f96){return _0x3c3ccb[_0x7eef('0x2c')](_0xc61803);}return _0x3c3ccb['status'](_0xc61803)['end']();};}function respondWithResult(_0x1e5588,_0x58bf58){_0x58bf58=_0x58bf58||0xc8;return function(_0x1c9864){if(_0x1c9864){return _0x1e5588['status'](_0x58bf58)['json'](_0x1c9864);}};}function respondWithFilteredResult(_0x4b9985,_0x2a6c13){return function(_0x3b7b84){if(_0x3b7b84){var _0x5dbf5f=typeof _0x2a6c13[_0x7eef('0x2d')]==='undefined'&&typeof _0x2a6c13['limit']===_0x7eef('0x2e');var _0x5db96c=_0x3b7b84['count'];var _0x4bf7f4=_0x5dbf5f?0x0:_0x2a6c13['offset'];var _0x1af3e8=_0x5dbf5f?_0x3b7b84['count']:_0x2a6c13['offset']+_0x2a6c13[_0x7eef('0x2f')];var _0x4ef47e;if(_0x1af3e8>=_0x5db96c){_0x1af3e8=_0x5db96c;_0x4ef47e=0xc8;}else{_0x4ef47e=0xce;}_0x4b9985[_0x7eef('0x30')](_0x4ef47e);return _0x4b9985['set']('Content-Range',_0x4bf7f4+'-'+_0x1af3e8+'/'+_0x5db96c)[_0x7eef('0x31')](_0x3b7b84);}return null;};}function patchUpdates(_0xd190c){return function(_0x2368a6){try{jsonpatch[_0x7eef('0x32')](_0x2368a6,_0xd190c,!![]);}catch(_0x4af286){return BPromise['reject'](_0x4af286);}return _0x2368a6[_0x7eef('0x33')]();};}function saveUpdates(_0x4bedeb,_0x373aa0){return function(_0x2a3650){if(_0x2a3650){return _0x2a3650[_0x7eef('0x34')](_0x4bedeb)[_0x7eef('0x23')](function(_0x4a81db){return _0x4a81db;});}return null;};}function removeEntity(_0x2f54a0,_0x5b152e){return function(_0x5d7fbc){if(_0x5d7fbc){return _0x5d7fbc[_0x7eef('0x35')]()[_0x7eef('0x23')](function(){var _0x18f8e5=_0x5d7fbc[_0x7eef('0x36')]({'plain':!![]});var _0xfcc391=_0x7eef('0x37');return db[_0x7eef('0x38')]['destroy']({'where':{'type':_0xfcc391,'resourceId':_0x18f8e5['id']}})['then'](function(){return _0x5d7fbc;});})['then'](function(){_0x2f54a0[_0x7eef('0x30')](0xcc)[_0x7eef('0x39')]();});}};}function handleEntityNotFound(_0xecb65b,_0x4ee39b){return function(_0x57b555){if(!_0x57b555){_0xecb65b['sendStatus'](0x194);}return _0x57b555;};}function handleError(_0x1c79ba,_0x325c19){_0x325c19=_0x325c19||0x1f4;return function(_0x3d1a57){logger[_0x7eef('0x27')](_0x3d1a57[_0x7eef('0x3a')]);if(_0x3d1a57['name']){delete _0x3d1a57[_0x7eef('0x3b')];}_0x1c79ba[_0x7eef('0x30')](_0x325c19)[_0x7eef('0x3c')](_0x3d1a57);};}exports[_0x7eef('0x3d')]=function(_0x49a3be,_0xc3c4af){var _0x58848c={'include':[{'model':db['Pause'],'as':_0x7eef('0x3e')}]},_0x2abdc3={},_0x59a5d4={'count':0x0,'rows':[]};var _0x245b90=_[_0x7eef('0x3f')](db[_0x7eef('0x40')][_0x7eef('0x41')],function(_0x10a4ce){return{'name':_0x10a4ce['fieldName'],'type':_0x10a4ce[_0x7eef('0x42')][_0x7eef('0x43')]};});_0x2abdc3['model']=_[_0x7eef('0x3f')](_0x245b90,_0x7eef('0x3b'));_0x2abdc3[_0x7eef('0x44')]=_[_0x7eef('0x45')](_0x49a3be[_0x7eef('0x44')]);_0x2abdc3[_0x7eef('0x46')]=_[_0x7eef('0x47')](_0x2abdc3[_0x7eef('0x48')],_0x2abdc3['query']);_0x58848c['attributes']=_[_0x7eef('0x47')](_0x2abdc3[_0x7eef('0x48')],qs['fields'](_0x49a3be['query']['fields']));_0x58848c[_0x7eef('0x49')]=_0x58848c[_0x7eef('0x49')][_0x7eef('0x4a')]?_0x58848c[_0x7eef('0x49')]:_0x2abdc3['model'];if(!_0x49a3be[_0x7eef('0x44')][_0x7eef('0x4b')](_0x7eef('0x4c'))){_0x58848c['limit']=qs[_0x7eef('0x2f')](_0x49a3be[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x58848c[_0x7eef('0x2d')]=qs['offset'](_0x49a3be[_0x7eef('0x44')][_0x7eef('0x2d')]);}_0x58848c['order']=qs[_0x7eef('0x4d')](_0x49a3be['query']['sort']);_0x58848c[_0x7eef('0x4e')]=qs[_0x7eef('0x46')](_['pick'](_0x49a3be['query'],_0x2abdc3['filters']),_0x245b90);if(_0x49a3be[_0x7eef('0x44')]['filter']){_0x58848c[_0x7eef('0x4e')]=_[_0x7eef('0x4f')](_0x58848c[_0x7eef('0x4e')],{'$or':_[_0x7eef('0x3f')](_0x245b90,function(_0x36b0bb){if(_0x36b0bb[_0x7eef('0x42')]!==_0x7eef('0x50')){var _0x595895={};_0x595895[_0x36b0bb[_0x7eef('0x3b')]]={'$like':'%'+_0x49a3be[_0x7eef('0x44')][_0x7eef('0x51')]+'%'};return _0x595895;}})});}_0x58848c=_[_0x7eef('0x4f')]({},_0x58848c,_0x49a3be[_0x7eef('0x52')]);var _0x5a32ea={'where':_0x58848c[_0x7eef('0x4e')]};return db[_0x7eef('0x40')][_0x7eef('0x53')](_0x5a32ea)[_0x7eef('0x23')](function(_0x22ef58){_0x59a5d4['count']=_0x22ef58;if(_0x49a3be[_0x7eef('0x44')][_0x7eef('0x54')]){_0x58848c[_0x7eef('0x55')]=[{'all':!![]}];}return db[_0x7eef('0x40')][_0x7eef('0x56')](_0x58848c);})[_0x7eef('0x23')](function(_0x2e7725){_0x59a5d4[_0x7eef('0x57')]=_0x2e7725;return _0x59a5d4;})[_0x7eef('0x23')](respondWithFilteredResult(_0xc3c4af,_0x58848c))[_0x7eef('0x2b')](handleError(_0xc3c4af,null));};exports[_0x7eef('0x58')]=function(_0x13b3d9,_0x861c88){var _0x447cc6={'raw':![],'where':{'id':_0x13b3d9[_0x7eef('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x7eef('0x3e')}]},_0x109138={};_0x109138[_0x7eef('0x48')]=_[_0x7eef('0x45')](db['OpenchannelAccount'][_0x7eef('0x41')]);_0x109138['query']=_[_0x7eef('0x45')](_0x13b3d9[_0x7eef('0x44')]);_0x109138[_0x7eef('0x46')]=_['intersection'](_0x109138[_0x7eef('0x48')],_0x109138[_0x7eef('0x44')]);_0x447cc6[_0x7eef('0x49')]=_[_0x7eef('0x47')](_0x109138['model'],qs[_0x7eef('0x5a')](_0x13b3d9[_0x7eef('0x44')]['fields']));_0x447cc6[_0x7eef('0x49')]=_0x447cc6['attributes'][_0x7eef('0x4a')]?_0x447cc6[_0x7eef('0x49')]:_0x109138[_0x7eef('0x48')];if(_0x13b3d9[_0x7eef('0x44')][_0x7eef('0x54')]){_0x447cc6[_0x7eef('0x55')]=[{'all':!![]}];}_0x447cc6=_[_0x7eef('0x4f')]({},_0x447cc6,_0x13b3d9['options']);return db[_0x7eef('0x40')][_0x7eef('0x5b')](_0x447cc6)[_0x7eef('0x23')](handleEntityNotFound(_0x861c88,null))[_0x7eef('0x23')](respondWithResult(_0x861c88,null))[_0x7eef('0x2b')](handleError(_0x861c88,null));};exports[_0x7eef('0x5c')]=function(_0x3f465b,_0x496952){return db[_0x7eef('0x40')][_0x7eef('0x5c')](_0x3f465b['body'],{})['then'](function(_0x974d7a){var _0x2604a2=_0x3f465b[_0x7eef('0x5d')][_0x7eef('0x36')]({'plain':!![]});if(!_0x2604a2)throw new Error(_0x7eef('0x5e'));if(_0x2604a2['role']===_0x7eef('0x5d')){var _0x14129a=_0x974d7a['get']({'plain':!![]});var _0x4ceb53=_0x7eef('0x37');return db[_0x7eef('0x5f')][_0x7eef('0x5b')]({'where':{'name':_0x4ceb53,'userProfileId':_0x2604a2['userProfileId']},'raw':!![]})[_0x7eef('0x23')](function(_0xc203bf){if(_0xc203bf&&_0xc203bf['autoAssociation']===0x0){return db[_0x7eef('0x38')][_0x7eef('0x5c')]({'name':_0x14129a['name'],'resourceId':_0x14129a['id'],'type':_0xc203bf[_0x7eef('0x3b')],'sectionId':_0xc203bf['id']},{})[_0x7eef('0x23')](function(){return _0x974d7a;});}else{return _0x974d7a;}})[_0x7eef('0x2b')](function(_0x3a3a9d){logger[_0x7eef('0x27')](_0x7eef('0x60'),_0x3a3a9d);throw _0x3a3a9d;});}return _0x974d7a;})[_0x7eef('0x23')](respondWithResult(_0x496952,0xc9))[_0x7eef('0x2b')](handleError(_0x496952,null));};exports[_0x7eef('0x34')]=function(_0x1bd00e,_0x91fd8f){if(_0x1bd00e[_0x7eef('0x61')]['id']){delete _0x1bd00e[_0x7eef('0x61')]['id'];}return db[_0x7eef('0x40')][_0x7eef('0x5b')]({'where':{'id':_0x1bd00e['params']['id']},'include':[{'model':db['Pause'],'as':_0x7eef('0x3e')}]})[_0x7eef('0x23')](handleEntityNotFound(_0x91fd8f,null))[_0x7eef('0x23')](saveUpdates(_0x1bd00e[_0x7eef('0x61')],null))[_0x7eef('0x23')](respondWithResult(_0x91fd8f,null))[_0x7eef('0x2b')](handleError(_0x91fd8f,null));};exports[_0x7eef('0x35')]=function(_0xf19554,_0x5904fb){return db[_0x7eef('0x40')][_0x7eef('0x5b')]({'where':{'id':_0xf19554[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x5904fb,null))[_0x7eef('0x23')](removeEntity(_0x5904fb,null))['catch'](handleError(_0x5904fb,null));};exports['describe']=function(_0x164fc5,_0x1cac7c){return db[_0x7eef('0x40')]['describe']()[_0x7eef('0x23')](respondWithResult(_0x1cac7c,null))[_0x7eef('0x2b')](handleError(_0x1cac7c,null));};exports['addDisposition']=function(_0x40123e,_0x2e8f7a,_0x42d1b2){if(_0x40123e[_0x7eef('0x61')]['id']){delete _0x40123e['body']['id'];}return db[_0x7eef('0x40')]['find']({'where':{'id':_0x40123e[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x2e8f7a,null))['then'](function(_0x9491f7){if(_0x9491f7){_0x40123e[_0x7eef('0x61')]['OpenchannelAccountId']=_0x9491f7['id'];return db['Disposition'][_0x7eef('0x5c')](_0x40123e['body']);}})['then'](respondWithResult(_0x2e8f7a,null))[_0x7eef('0x2b')](handleError(_0x2e8f7a,null));};exports[_0x7eef('0x62')]=function(_0x4e85c5,_0x29b313,_0x1a26dd){var _0x2f1d78={'raw':![],'where':{}};var _0x428d16={};var _0xb40661={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7eef('0x63')]({'where':{'id':_0x4e85c5[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x29b313,null))[_0x7eef('0x23')](function(_0x2b8df5){if(_0x2b8df5){_0x428d16['model']=_[_0x7eef('0x45')](db[_0x7eef('0x64')]['rawAttributes']);_0x428d16['query']=_['keys'](_0x4e85c5['query']);_0x428d16['filters']=_[_0x7eef('0x47')](_0x428d16[_0x7eef('0x48')],_0x428d16['query']);_0x2f1d78['attributes']=_[_0x7eef('0x47')](_0x428d16[_0x7eef('0x48')],qs[_0x7eef('0x5a')](_0x4e85c5[_0x7eef('0x44')]['fields']));_0x2f1d78[_0x7eef('0x49')]=_0x2f1d78[_0x7eef('0x49')]['length']?_0x2f1d78[_0x7eef('0x49')]:_0x428d16['model'];if(!_0x4e85c5[_0x7eef('0x44')]['hasOwnProperty'](_0x7eef('0x4c'))){_0x2f1d78['limit']=qs['limit'](_0x4e85c5[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x2f1d78[_0x7eef('0x2d')]=qs[_0x7eef('0x2d')](_0x4e85c5[_0x7eef('0x44')][_0x7eef('0x2d')]);}_0x2f1d78[_0x7eef('0x65')]=qs[_0x7eef('0x4d')](_0x4e85c5['query']['sort']);_0x2f1d78[_0x7eef('0x4e')]=qs['filters'](_[_0x7eef('0x66')](_0x4e85c5['query'],_0x428d16['filters']));_0x2f1d78[_0x7eef('0x4e')][_0x7eef('0x67')]=_0x2b8df5['id'];if(_0x4e85c5[_0x7eef('0x44')][_0x7eef('0x51')]){_0x2f1d78[_0x7eef('0x4e')]=_[_0x7eef('0x4f')](_0x2f1d78['where'],{'$or':_[_0x7eef('0x3f')](_0x2f1d78['attributes'],function(_0x19910a){var _0x37fd18={};_0x37fd18[_0x19910a]={'$like':'%'+_0x4e85c5[_0x7eef('0x44')]['filter']+'%'};return _0x37fd18;})});}_0x2f1d78=_['merge']({},_0x2f1d78,_0x4e85c5['options']);return db[_0x7eef('0x64')][_0x7eef('0x53')]({'where':_0x2f1d78[_0x7eef('0x4e')]})[_0x7eef('0x23')](function(_0x517fd1){_0xb40661[_0x7eef('0x53')]=_0x517fd1;if(_0x4e85c5[_0x7eef('0x44')][_0x7eef('0x54')]){_0x2f1d78[_0x7eef('0x55')]=[{'all':!![]}];}return db[_0x7eef('0x64')][_0x7eef('0x56')](_0x2f1d78);})[_0x7eef('0x23')](function(_0x4f31ec){_0xb40661[_0x7eef('0x57')]=_0x4f31ec;return _0xb40661;});}})[_0x7eef('0x23')](respondWithFilteredResult(_0x29b313,_0x2f1d78))[_0x7eef('0x2b')](handleError(_0x29b313,null));};exports[_0x7eef('0x68')]=function(_0x3d1f25,_0x139f58,_0x17579b){return db[_0x7eef('0x40')][_0x7eef('0x5b')]({'where':{'id':_0x3d1f25[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x139f58,null))[_0x7eef('0x23')](function(_0x40225d){if(_0x40225d){return _0x40225d[_0x7eef('0x68')](_0x3d1f25[_0x7eef('0x44')][_0x7eef('0x69')]);}})[_0x7eef('0x23')](respondWithStatusCode(_0x139f58,null))[_0x7eef('0x2b')](handleError(_0x139f58,null));};exports[_0x7eef('0x6a')]=function(_0x138894,_0xb4e157,_0x21ecee){if(_0x138894[_0x7eef('0x61')]['id']){delete _0x138894[_0x7eef('0x61')]['id'];}return db['OpenchannelAccount'][_0x7eef('0x5b')]({'where':{'id':_0x138894[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0xb4e157,null))[_0x7eef('0x23')](function(_0x358a5e){if(_0x358a5e){_0x138894[_0x7eef('0x61')][_0x7eef('0x67')]=_0x358a5e['id'];return db[_0x7eef('0x6b')][_0x7eef('0x5c')](_0x138894['body']);}})[_0x7eef('0x23')](respondWithResult(_0xb4e157,null))[_0x7eef('0x2b')](handleError(_0xb4e157,null));};exports[_0x7eef('0x6c')]=function(_0x1e3a58,_0x596f84,_0x169699){var _0x33c6b8={'raw':![],'where':{}};var _0x586d3d={};var _0x4093be={'count':0x0,'rows':[]};return db[_0x7eef('0x40')][_0x7eef('0x63')]({'where':{'id':_0x1e3a58[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x596f84,null))[_0x7eef('0x23')](function(_0x570990){if(_0x570990){_0x586d3d['model']=_['keys'](db[_0x7eef('0x6b')][_0x7eef('0x41')]);_0x586d3d[_0x7eef('0x44')]=_[_0x7eef('0x45')](_0x1e3a58[_0x7eef('0x44')]);_0x586d3d[_0x7eef('0x46')]=_[_0x7eef('0x47')](_0x586d3d[_0x7eef('0x48')],_0x586d3d[_0x7eef('0x44')]);_0x33c6b8['attributes']=_[_0x7eef('0x47')](_0x586d3d[_0x7eef('0x48')],qs[_0x7eef('0x5a')](_0x1e3a58[_0x7eef('0x44')]['fields']));_0x33c6b8[_0x7eef('0x49')]=_0x33c6b8[_0x7eef('0x49')][_0x7eef('0x4a')]?_0x33c6b8[_0x7eef('0x49')]:_0x586d3d[_0x7eef('0x48')];if(!_0x1e3a58[_0x7eef('0x44')][_0x7eef('0x4b')]('nolimit')){_0x33c6b8[_0x7eef('0x2f')]=qs[_0x7eef('0x2f')](_0x1e3a58[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x33c6b8[_0x7eef('0x2d')]=qs['offset'](_0x1e3a58[_0x7eef('0x44')][_0x7eef('0x2d')]);}_0x33c6b8[_0x7eef('0x65')]=qs[_0x7eef('0x4d')](_0x1e3a58[_0x7eef('0x44')]['sort']);_0x33c6b8[_0x7eef('0x4e')]=qs[_0x7eef('0x46')](_[_0x7eef('0x66')](_0x1e3a58['query'],_0x586d3d['filters']));_0x33c6b8[_0x7eef('0x4e')]['OpenchannelAccountId']=_0x570990['id'];if(_0x1e3a58[_0x7eef('0x44')]['filter']){_0x33c6b8['where']=_['merge'](_0x33c6b8[_0x7eef('0x4e')],{'$or':_[_0x7eef('0x3f')](_0x33c6b8[_0x7eef('0x49')],function(_0x2f40e3){var _0x36c8bc={};_0x36c8bc[_0x2f40e3]={'$like':'%'+_0x1e3a58[_0x7eef('0x44')][_0x7eef('0x51')]+'%'};return _0x36c8bc;})});}_0x33c6b8=_[_0x7eef('0x4f')]({},_0x33c6b8,_0x1e3a58[_0x7eef('0x52')]);return db[_0x7eef('0x6b')]['count']({'where':_0x33c6b8['where']})[_0x7eef('0x23')](function(_0x54a3da){_0x4093be[_0x7eef('0x53')]=_0x54a3da;if(_0x1e3a58[_0x7eef('0x44')][_0x7eef('0x54')]){_0x33c6b8[_0x7eef('0x55')]=[{'all':!![]}];}return db[_0x7eef('0x6b')]['findAll'](_0x33c6b8);})[_0x7eef('0x23')](function(_0x35aaa6){_0x4093be[_0x7eef('0x57')]=_0x35aaa6;return _0x4093be;});}})[_0x7eef('0x23')](respondWithFilteredResult(_0x596f84,_0x33c6b8))[_0x7eef('0x2b')](handleError(_0x596f84,null));};exports[_0x7eef('0x6d')]=function(_0x5dbefc,_0x40da23,_0x290840){return db['OpenchannelAccount'][_0x7eef('0x5b')]({'where':{'id':_0x5dbefc['params']['id']}})['then'](handleEntityNotFound(_0x40da23,null))[_0x7eef('0x23')](function(_0x55725a){if(_0x55725a){return _0x55725a[_0x7eef('0x6d')](_0x5dbefc[_0x7eef('0x44')][_0x7eef('0x69')]);}})['then'](respondWithStatusCode(_0x40da23,null))['catch'](handleError(_0x40da23,null));};exports[_0x7eef('0x6e')]=function(_0x439a1f,_0x196f8a,_0x3f4066){var _0x50cf02={'body':_0x439a1f[_0x7eef('0x61')],'channel':_0x7eef('0x6f')};var _0x592f96=[];var _0x40de14=[];var _0x55607a={};var _0x5da82b=![];return db[_0x7eef('0x70')]['describe']()[_0x7eef('0x23')](function(_0x3997b5){if(!_0x3997b5){throw new db[(_0x7eef('0x71'))][(_0x7eef('0x72'))](_0x7eef('0x73'));}_0x592f96=_[_0x7eef('0x74')](_[_0x7eef('0x45')](_0x3997b5),['createdAt',_0x7eef('0x75')]);_0x40de14=_['difference'](_[_0x7eef('0x45')](_0x3997b5),[_0x7eef('0x76'),_0x7eef('0x75'),_0x7eef('0x77'),'ListId']);if(_0x439a1f[_0x7eef('0x61')]['id']){delete _0x439a1f[_0x7eef('0x61')]['id'];}if(_[_0x7eef('0x78')](_0x439a1f[_0x7eef('0x61')]['from'])){throw new db[(_0x7eef('0x71'))][(_0x7eef('0x72'))](_0x7eef('0x79'));}if(_[_0x7eef('0x78')](_0x439a1f[_0x7eef('0x61')][_0x7eef('0x61')])||_0x439a1f['body'][_0x7eef('0x61')]===''){throw new db[(_0x7eef('0x71'))][(_0x7eef('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x439a1f['body']['mapKey'])){throw new db[(_0x7eef('0x71'))]['ValidationError'](_0x7eef('0x7a')+_0x40de14);}if(!_[_0x7eef('0x7b')](_0x40de14,_0x439a1f[_0x7eef('0x61')][_0x7eef('0x7c')])){throw new db[(_0x7eef('0x71'))][(_0x7eef('0x72'))](_0x7eef('0x7d')+_0x40de14);}_0x55607a[_0x439a1f[_0x7eef('0x61')][_0x7eef('0x7c')]]=_0x439a1f['body'][_0x7eef('0x7e')];})[_0x7eef('0x23')](function(){return db[_0x7eef('0x40')]['find']({'where':{'id':_0x439a1f[_0x7eef('0x59')]['id']},'include':[{'model':db[_0x7eef('0x7f')],'as':'List','include':[{'model':db[_0x7eef('0x70')],'as':_0x7eef('0x80'),'where':_0x55607a,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x7eef('0x81')],'as':_0x7eef('0x82')}]});})['then'](handleEntityNotFound(_0x196f8a,null))[_0x7eef('0x23')](function(_0x5b9a27){if(_0x5b9a27&&_0x5b9a27[_0x7eef('0x83')]){_0x50cf02['account']=_0x5b9a27;_0x50cf02[_0x7eef('0x84')]=_0x5b9a27['Applications'];_0x50cf02[_0x7eef('0x85')]=_0x5b9a27[_0x7eef('0x83')];_0x50cf02[_0x7eef('0x84')]=_[_0x7eef('0x86')](_0x50cf02[_0x7eef('0x84')],[_0x7eef('0x87')],[_0x7eef('0x88')]);if(_0x50cf02[_0x7eef('0x89')][_0x7eef('0x82')]){delete _0x50cf02[_0x7eef('0x89')][_0x7eef('0x82')];}if(_0x50cf02['account'][_0x7eef('0x83')]&&_0x50cf02['account']['List'][_0x7eef('0x80')][_0x7eef('0x4a')]){return _0x50cf02[_0x7eef('0x89')]['List'][_0x7eef('0x80')][0x0];}var _0x10a058=_[_0x7eef('0x1b')](_0x439a1f[_0x7eef('0x61')],{'firstName':_0x439a1f[_0x7eef('0x61')][_0x7eef('0x7e')],'ListId':_0x5b9a27['ListId']});_0x10a058[_0x439a1f['body'][_0x7eef('0x7c')]]=_0x439a1f[_0x7eef('0x61')][_0x7eef('0x7e')];return db['CmContact'][_0x7eef('0x5c')](_0x10a058,{'fields':_0x592f96,'raw':!![]});}})[_0x7eef('0x23')](handleEntityNotFound(_0x196f8a,null))[_0x7eef('0x23')](function(_0x3af799){_0x50cf02['contact']=_0x3af799;if(_0x3af799){var _0x3d6741={'ContactId':_0x3af799['id'],'OpenchannelAccountId':_0x439a1f[_0x7eef('0x59')]['id'],'from':(_0x3af799[_0x7eef('0x8a')]||'')+'\x20'+(_0x3af799['lastName']||'')};var _0x15eed0={'OpenchannelAccountId':_0x439a1f[_0x7eef('0x59')]['id'],'closed':![]};if(_0x439a1f[_0x7eef('0x61')]['threadId']){_0x15eed0['threadId']=_0x439a1f['body'][_0x7eef('0x8b')];return db[_0x7eef('0x8c')][_0x7eef('0x5b')]({'where':_0x15eed0})[_0x7eef('0x23')](function(_0x3420f2){if(_0x3420f2){return[_0x3420f2,![]];}_0x3d6741[_0x7eef('0x8b')]=_0x439a1f[_0x7eef('0x61')]['threadId'];_0x3d6741[_0x7eef('0x8d')]=_0x439a1f['body']['externalUrl'];return db['OpenchannelInteraction'][_0x7eef('0x5c')](_0x3d6741)['then'](function(_0x12da71){return[_0x12da71,!![]];});});}else{_0x15eed0['threadId']=null;}_0x15eed0[_0x7eef('0x8e')]=_0x3af799['id'];return db['OpenchannelInteraction'][_0x7eef('0x5b')]({'where':_0x15eed0})['then'](function(_0x483bf1){if(_0x483bf1){return[_0x483bf1,![]];}return db[_0x7eef('0x8c')][_0x7eef('0x5c')](_0x3d6741)[_0x7eef('0x23')](function(_0x172e05){return[_0x172e05,!![]];});});}})[_0x7eef('0x8f')](function(_0x1c6a93,_0x358c5d){if(_0x1c6a93){_0x5da82b=_0x358c5d;if(!_0x358c5d){var _0x2eca09={'from':(_0x50cf02[_0x7eef('0x90')][_0x7eef('0x8a')]||'')+'\x20'+(_0x50cf02[_0x7eef('0x90')][_0x7eef('0x91')]||'')};if(_0x439a1f[_0x7eef('0x61')][_0x7eef('0x8b')]&&_0x439a1f[_0x7eef('0x61')]['messageId']&&_0x439a1f[_0x7eef('0x61')]['threadId']!=_0x439a1f[_0x7eef('0x61')][_0x7eef('0x92')]){_0x2eca09['threadId']=_0x439a1f[_0x7eef('0x61')]['messageId'];}return _0x1c6a93[_0x7eef('0x34')](_0x2eca09);}else{return _0x1c6a93;}}})[_0x7eef('0x23')](function(_0x63b84e){_0x50cf02[_0x7eef('0x93')]=_0x63b84e[_0x7eef('0x36')]({'plain':!![]});_0x50cf02[_0x7eef('0x93')][_0x7eef('0x94')]=_0x5da82b;if(_0x50cf02[_0x7eef('0x93')][_0x7eef('0x94')]){if(_0x50cf02[_0x7eef('0x89')][_0x7eef('0x95')]){_0x50cf02['applications']['push']({'id':0x0,'priority':_0x50cf02[_0x7eef('0x84')][_0x7eef('0x4a')]+0x1,'app':_0x7eef('0x96'),'appdata':_0x7eef('0x97'),'interval':_0x7eef('0x98')});}}return db[_0x7eef('0x99')][_0x7eef('0x5c')]({'body':_0x439a1f[_0x7eef('0x61')][_0x7eef('0x61')],'OpenchannelAccountId':_0x439a1f[_0x7eef('0x59')]['id'],'OpenchannelInteractionId':_0x63b84e['id'],'direction':'in','ContactId':_0x50cf02[_0x7eef('0x90')]['id'],'AttachmentId':_0x439a1f[_0x7eef('0x61')][_0x7eef('0x9a')]});})[_0x7eef('0x23')](function(_0x565918){_0x50cf02['message']=_0x565918;if(_0x50cf02[_0x7eef('0x93')][_0x7eef('0x9b')]){return db[_0x7eef('0x9c')][_0x7eef('0x5b')]({'attributes':['id','name'],'where':{'id':_0x50cf02[_0x7eef('0x93')]['UserId']}})[_0x7eef('0x23')](function(_0x2c128a){if(_0x2c128a){_0x50cf02[_0x7eef('0x84')][_0x7eef('0x9d')]({'id':0x0,'priority':0x0,'app':_0x7eef('0x9e'),'appdata':_0x2c128a[_0x7eef('0x3b')]+','+(_0x50cf02[_0x7eef('0x89')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x50cf02[_0x7eef('0x9f')]=![];}return respondWithRpcPromise(_0x7eef('0xa0'),_0x7eef('0xa1'),_0x50cf02);});}return respondWithRpcPromise(_0x7eef('0xa0'),_0x7eef('0xa1'),_0x50cf02);})[_0x7eef('0x23')](function(_0x1b1834){respondWithRpcPromise('EventManager',_0x7eef('0xa2'),{'event':'notify','message':_0x1b1834},client9002);return _0x1b1834;})['then'](respondWithResult(_0x196f8a,null))[_0x7eef('0x2b')](handleError(_0x196f8a,null));};exports[_0x7eef('0xa3')]=function(_0x596938,_0x15089b){var _0x4ddcf5=_0x596938[_0x7eef('0x59')]['id'];var _0x70c8f7=_0x596938[_0x7eef('0x61')];var _0x2acb56=0xc8;var _0x3ad685=null;return db['sequelize'][_0x7eef('0xa4')]({'isolationLevel':db[_0x7eef('0xa5')][_0x7eef('0xa6')][_0x7eef('0xa7')][_0x7eef('0xa8')]},function(_0x1ead7c){return db[_0x7eef('0x40')][_0x7eef('0x63')]({'where':{'id':_0x4ddcf5},'transaction':_0x1ead7c})[_0x7eef('0x23')](function(_0x1a9362){if(_0x1a9362){return db[_0x7eef('0x81')][_0x7eef('0x35')]({'where':{'OpenchannelAccountId':_0x4ddcf5},'transaction':_0x1ead7c})[_0x7eef('0x23')](function(){var _0x76f357=_[_0x7eef('0x3f')](_0x70c8f7,function(_0x241dc0){_0x241dc0[_0x7eef('0x67')]=_0x4ddcf5;return _0x241dc0;});return db[_0x7eef('0x81')][_0x7eef('0xa9')](_0x76f357,{'transaction':_0x1ead7c});});}else{_0x2acb56=0x194;_0x3ad685=[];}});})[_0x7eef('0x23')](function(){if(_0x2acb56!==0x194){return db['OpenchannelApplication'][_0x7eef('0xaa')]({'where':{'OpenchannelAccountId':_0x4ddcf5},'order':_0x7eef('0x87')})[_0x7eef('0x23')](function(_0x5713a0){_0x3ad685=_0x5713a0;});}})[_0x7eef('0x2b')](function(_0x4d88c2){_0x2acb56=0x1f4;logger['error'](_0x4d88c2[_0x7eef('0x3a')]);if(_0x4d88c2['name']){delete _0x4d88c2['name'];}_0x3ad685=_0x4d88c2;})[_0x7eef('0xab')](function(){if(_0x3ad685===null){_0x15089b['sendStatus'](_0x2acb56);}else{if(_0x2acb56===0x1f4){_0x15089b[_0x7eef('0x30')](_0x2acb56)[_0x7eef('0x3c')](_0x3ad685);}else{_0x15089b[_0x7eef('0x30')](_0x2acb56)[_0x7eef('0x31')](_0x3ad685);}}});};exports[_0x7eef('0xac')]=function(_0x2bfaa0,_0x4da011,_0x1d8372){var _0x2f1f2a={};var _0x37b9f5={};var _0x13adfe;var _0x367c87;return db['OpenchannelAccount'][_0x7eef('0x63')]({'where':{'id':_0x2bfaa0[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x4da011,null))[_0x7eef('0x23')](function(_0x469e75){if(_0x469e75){_0x13adfe=_0x469e75;_0x37b9f5['model']=_[_0x7eef('0x45')](db['OpenchannelApplication'][_0x7eef('0x41')]);_0x37b9f5[_0x7eef('0x44')]=_[_0x7eef('0x45')](_0x2bfaa0[_0x7eef('0x44')]);_0x37b9f5[_0x7eef('0x46')]=_[_0x7eef('0x47')](_0x37b9f5[_0x7eef('0x48')],_0x37b9f5['query']);_0x2f1f2a['attributes']=_[_0x7eef('0x47')](_0x37b9f5['model'],qs['fields'](_0x2bfaa0['query'][_0x7eef('0x5a')]));_0x2f1f2a[_0x7eef('0x49')]=_0x2f1f2a[_0x7eef('0x49')][_0x7eef('0x4a')]?_0x2f1f2a[_0x7eef('0x49')]:_0x37b9f5[_0x7eef('0x48')];_0x2f1f2a[_0x7eef('0x65')]=qs[_0x7eef('0x4d')](_0x2bfaa0[_0x7eef('0x44')]['sort']);_0x2f1f2a[_0x7eef('0x4e')]=qs[_0x7eef('0x46')](_['pick'](_0x2bfaa0['query'],_0x37b9f5[_0x7eef('0x46')]));if(_0x2bfaa0[_0x7eef('0x44')][_0x7eef('0x51')]){_0x2f1f2a['where']=_['merge'](_0x2f1f2a['where'],{'$or':_[_0x7eef('0x3f')](_0x2f1f2a[_0x7eef('0x49')],function(_0x3972e3){var _0x278b55={};_0x278b55[_0x3972e3]={'$like':'%'+_0x2bfaa0[_0x7eef('0x44')]['filter']+'%'};return _0x278b55;})});}_0x2f1f2a=_[_0x7eef('0x4f')]({},_0x2f1f2a,_0x2bfaa0['options']);return _0x13adfe[_0x7eef('0xac')](_0x2f1f2a);}})[_0x7eef('0x23')](function(_0x36d355){if(_0x36d355){_0x367c87=_0x36d355['length'];if(!_0x2bfaa0[_0x7eef('0x44')][_0x7eef('0x4b')](_0x7eef('0x4c'))){_0x2f1f2a['limit']=qs['limit'](_0x2bfaa0[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x2f1f2a[_0x7eef('0x2d')]=qs[_0x7eef('0x2d')](_0x2bfaa0[_0x7eef('0x44')][_0x7eef('0x2d')]);}return _0x13adfe[_0x7eef('0xac')](_0x2f1f2a);}})[_0x7eef('0x23')](function(_0x207d7e){if(_0x207d7e){return _0x207d7e?{'count':_0x367c87,'rows':_0x207d7e}:null;}})[_0x7eef('0x23')](respondWithResult(_0x4da011,null))[_0x7eef('0x2b')](handleError(_0x4da011,null));};exports[_0x7eef('0xad')]=function(_0x3a89ed,_0x1e4406,_0x325042){var _0x361794={'raw':![],'where':{}};var _0x153382={};var _0x2f3848={'count':0x0,'rows':[]};return db[_0x7eef('0x40')][_0x7eef('0x63')]({'where':{'id':_0x3a89ed[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x1e4406,null))[_0x7eef('0x23')](function(_0x5492bc){if(_0x5492bc){_0x153382['model']=_['keys'](db['OpenchannelInteraction'][_0x7eef('0x41')]);_0x153382[_0x7eef('0x44')]=_[_0x7eef('0x45')](_0x3a89ed[_0x7eef('0x44')]);_0x153382[_0x7eef('0x46')]=_[_0x7eef('0x47')](_0x153382[_0x7eef('0x48')],_0x153382[_0x7eef('0x44')]);_0x361794[_0x7eef('0x49')]=_[_0x7eef('0x47')](_0x153382['model'],qs[_0x7eef('0x5a')](_0x3a89ed[_0x7eef('0x44')][_0x7eef('0x5a')]));_0x361794[_0x7eef('0x49')]=_0x361794['attributes'][_0x7eef('0x4a')]?_0x361794[_0x7eef('0x49')]:_0x153382[_0x7eef('0x48')];if(!_0x3a89ed[_0x7eef('0x44')][_0x7eef('0x4b')](_0x7eef('0x4c'))){_0x361794[_0x7eef('0x2f')]=qs['limit'](_0x3a89ed[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x361794[_0x7eef('0x2d')]=qs['offset'](_0x3a89ed[_0x7eef('0x44')][_0x7eef('0x2d')]);}_0x361794[_0x7eef('0x65')]=qs[_0x7eef('0x4d')](_0x3a89ed['query'][_0x7eef('0x4d')]);_0x361794['where']=qs[_0x7eef('0x46')](_[_0x7eef('0x66')](_0x3a89ed[_0x7eef('0x44')],_0x153382[_0x7eef('0x46')]));_0x361794['where'][_0x7eef('0x67')]=_0x5492bc['id'];if(_0x3a89ed['query'][_0x7eef('0x51')]){_0x361794['where']=_[_0x7eef('0x4f')](_0x361794['where'],{'$or':_[_0x7eef('0x3f')](_0x361794[_0x7eef('0x49')],function(_0x1f4763){var _0x4394ba={};_0x4394ba[_0x1f4763]={'$like':'%'+_0x3a89ed[_0x7eef('0x44')][_0x7eef('0x51')]+'%'};return _0x4394ba;})});}_0x361794=_[_0x7eef('0x4f')]({},_0x361794,_0x3a89ed[_0x7eef('0x52')]);return db['OpenchannelInteraction'][_0x7eef('0x53')]({'where':_0x361794[_0x7eef('0x4e')]})[_0x7eef('0x23')](function(_0x20ce12){_0x2f3848['count']=_0x20ce12;if(_0x3a89ed[_0x7eef('0x44')]['includeAll']){_0x361794[_0x7eef('0x55')]=[{'model':db[_0x7eef('0x70')],'as':_0x7eef('0xae'),'required':![]},{'model':db[_0x7eef('0x9c')],'as':_0x7eef('0xaf'),'attributes':[_0x7eef('0x3b'),_0x7eef('0xb0'),_0x7eef('0xb1')],'required':![]},{'model':db['Tag'],'as':_0x7eef('0xb2'),'attributes':['id',_0x7eef('0x3b'),_0x7eef('0xb3')],'where':_0x3a89ed[_0x7eef('0x44')]['tag']?{'id':_0x3a89ed[_0x7eef('0x44')]['tag']}:undefined,'required':_0x3a89ed[_0x7eef('0x44')]['tag']?!![]:![]}];}return db[_0x7eef('0x8c')][_0x7eef('0x56')](_0x361794);})[_0x7eef('0x23')](function(_0x2eaa23){_0x2f3848[_0x7eef('0x57')]=_0x2eaa23;return _0x2f3848;});}})[_0x7eef('0x23')](respondWithFilteredResult(_0x1e4406,_0x361794))[_0x7eef('0x2b')](handleError(_0x1e4406,null));};exports['addAgents']=function(_0x4876ad,_0x428ca1,_0x110b74){return db[_0x7eef('0x40')]['find']({'where':{'id':_0x4876ad['params']['id']}})['then'](handleEntityNotFound(_0x428ca1,null))[_0x7eef('0x23')](function(_0x3eb978){if(_0x3eb978){return _0x3eb978[_0x7eef('0xb4')](_0x4876ad['body'][_0x7eef('0x69')],_[_0x7eef('0xb5')](_0x4876ad[_0x7eef('0x61')],[_0x7eef('0x69'),'id'])||{})['spread'](function(_0x4a8cfc){for(var _0x28397a=0x0;_0x28397a<_0x4876ad[_0x7eef('0x61')][_0x7eef('0x69')][_0x7eef('0x4a')];_0x28397a+=0x1){socket[_0x7eef('0xb6')]('userOpenchannelAccount:save',{'UserId':Number(_0x4876ad[_0x7eef('0x61')]['ids'][_0x28397a]),'OpenchannelAccountId':Number(_0x4876ad[_0x7eef('0x59')]['id'])});}return _0x4a8cfc;});}})[_0x7eef('0x23')](respondWithResult(_0x428ca1,null))[_0x7eef('0x2b')](handleError(_0x428ca1,null));};exports[_0x7eef('0xb7')]=function(_0xa5020d,_0x1b1a8c,_0x5d91c7){return db[_0x7eef('0x40')][_0x7eef('0x5b')]({'where':{'id':_0xa5020d[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x1b1a8c,null))[_0x7eef('0x23')](function(_0x516eb2){if(_0x516eb2){return _0x516eb2[_0x7eef('0xb7')](_0xa5020d[_0x7eef('0x44')][_0x7eef('0x69')])[_0x7eef('0x23')](function(){if(_['isArray'](_0xa5020d[_0x7eef('0x44')][_0x7eef('0x69')])){for(var _0x56e711=0x0;_0x56e711<_0xa5020d[_0x7eef('0x44')][_0x7eef('0x69')][_0x7eef('0x4a')];_0x56e711+=0x1){socket[_0x7eef('0xb6')](_0x7eef('0xb8'),{'UserId':Number(_0xa5020d[_0x7eef('0x44')][_0x7eef('0x69')][_0x56e711]),'OpenchannelAccountId':Number(_0xa5020d[_0x7eef('0x59')]['id'])});}}else{socket[_0x7eef('0xb6')](_0x7eef('0xb8'),{'UserId':Number(_0xa5020d['query'][_0x7eef('0x69')]),'OpenchannelAccountId':Number(_0xa5020d[_0x7eef('0x59')]['id'])});}});}})[_0x7eef('0x23')](respondWithStatusCode(_0x1b1a8c,null))[_0x7eef('0x2b')](handleError(_0x1b1a8c,null));};exports[_0x7eef('0xb9')]=function(_0xf289b7,_0x339c90,_0x18c126){var _0x5288b0={};var _0x57c949={};var _0x57d4ae;var _0x4d32d4;return db[_0x7eef('0x40')][_0x7eef('0x63')]({'where':{'id':_0xf289b7[_0x7eef('0x59')]['id']}})['then'](handleEntityNotFound(_0x339c90,null))[_0x7eef('0x23')](function(_0x410420){if(_0x410420){_0x57d4ae=_0x410420;_0x57c949['model']=_['keys'](db[_0x7eef('0x9c')][_0x7eef('0x41')]);_0x57c949[_0x7eef('0x44')]=_[_0x7eef('0x45')](_0xf289b7['query']);_0x57c949[_0x7eef('0x46')]=_['intersection'](_0x57c949[_0x7eef('0x48')],_0x57c949[_0x7eef('0x44')]);_0x5288b0['attributes']=_[_0x7eef('0x47')](_0x57c949['model'],qs[_0x7eef('0x5a')](_0xf289b7[_0x7eef('0x44')][_0x7eef('0x5a')]));_0x5288b0[_0x7eef('0x49')]=_0x5288b0[_0x7eef('0x49')][_0x7eef('0x4a')]?_0x5288b0[_0x7eef('0x49')]:_0x57c949[_0x7eef('0x48')];_0x5288b0[_0x7eef('0x65')]=qs[_0x7eef('0x4d')](_0xf289b7[_0x7eef('0x44')][_0x7eef('0x4d')]);_0x5288b0[_0x7eef('0x4e')]=qs[_0x7eef('0x46')](_[_0x7eef('0x66')](_0xf289b7[_0x7eef('0x44')],_0x57c949[_0x7eef('0x46')]));if(_0xf289b7[_0x7eef('0x44')]['filter']){_0x5288b0[_0x7eef('0x4e')]=_['merge'](_0x5288b0[_0x7eef('0x4e')],{'$or':_[_0x7eef('0x3f')](_0x5288b0[_0x7eef('0x49')],function(_0xa43c1f){var _0x2a1ad2={};_0x2a1ad2[_0xa43c1f]={'$like':'%'+_0xf289b7['query'][_0x7eef('0x51')]+'%'};return _0x2a1ad2;})});}_0x5288b0=_[_0x7eef('0x4f')]({},_0x5288b0,_0xf289b7[_0x7eef('0x52')]);return _0x57d4ae[_0x7eef('0xb9')](_0x5288b0);}})[_0x7eef('0x23')](function(_0x4d83aa){if(_0x4d83aa){_0x4d32d4=_0x4d83aa[_0x7eef('0x4a')];if(!_0xf289b7[_0x7eef('0x44')][_0x7eef('0x4b')](_0x7eef('0x4c'))){_0x5288b0[_0x7eef('0x2f')]=qs['limit'](_0xf289b7[_0x7eef('0x44')][_0x7eef('0x2f')]);_0x5288b0[_0x7eef('0x2d')]=qs[_0x7eef('0x2d')](_0xf289b7[_0x7eef('0x44')]['offset']);}return _0x57d4ae[_0x7eef('0xb9')](_0x5288b0);}})[_0x7eef('0x23')](function(_0x6fea4d){if(_0x6fea4d){return _0x6fea4d?{'count':_0x4d32d4,'rows':_0x6fea4d}:null;}})[_0x7eef('0x23')](respondWithResult(_0x339c90,null))['catch'](handleError(_0x339c90,null));};exports[_0x7eef('0x3c')]=function(_0x1b617a,_0x5c63a1,_0x2376e9){var _0x573fcd,_0x45ae68,_0x1a4cd0;if(_[_0x7eef('0x78')](_0x1b617a[_0x7eef('0x61')][_0x7eef('0x61')])||_0x1b617a['body'][_0x7eef('0x61')]===''){throw new db['Sequelize'][(_0x7eef('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7eef('0x78')](_0x1b617a[_0x7eef('0x61')]['to'])){}_0x573fcd=_0x1b617a[_0x7eef('0x61')]['to'];return db['OpenchannelAccount'][_0x7eef('0x63')]({'where':{'id':_0x1b617a[_0x7eef('0x59')]['id']}})[_0x7eef('0x23')](handleEntityNotFound(_0x5c63a1,null))[_0x7eef('0x23')](function(_0x120aa0){if(_0x120aa0){return db[_0x7eef('0x40')][_0x7eef('0x5b')]({'where':{'id':_0x120aa0['id']},'include':[{'model':db[_0x7eef('0x7f')],'as':_0x7eef('0x83'),'include':[{'model':db[_0x7eef('0x70')],'as':_0x7eef('0x80'),'where':{[_0x120aa0[_0x7eef('0x7c')]]:_0x573fcd},'limit':0x1,'order':[[_0x7eef('0x75'),_0x7eef('0xba')]]}]}]})['then'](handleEntityNotFound(_0x5c63a1,null))[_0x7eef('0x23')](function(_0x47bf18){if(_0x47bf18&&_0x47bf18[_0x7eef('0x83')]){_0x45ae68=_0x47bf18[_0x7eef('0x36')]({'plain':!![]});if(_0x45ae68[_0x7eef('0x83')]&&_0x45ae68[_0x7eef('0x83')]['Contacts']['length']){return _0x45ae68[_0x7eef('0x83')][_0x7eef('0x80')][0x0];}return db[_0x7eef('0x70')][_0x7eef('0x5c')](_[_0x7eef('0x1b')](_0x1b617a[_0x7eef('0x61')],{'firstName':_0x573fcd,[_0x47bf18[_0x7eef('0x7c')]]:_0x573fcd,'phone':_0x573fcd,'ListId':_0x45ae68[_0x7eef('0xbb')]}));}})[_0x7eef('0x23')](handleEntityNotFound(_0x5c63a1,null))[_0x7eef('0x23')](function(_0x138f41){if(_0x138f41){_0x1a4cd0=_0x138f41;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x1a4cd0['id'],'closed':![],'OpenchannelAccountId':_0x45ae68['id']}})['then'](function(_0x5ad747){if(_0x5ad747){return[_0x5ad747,![]];}return db[_0x7eef('0x8c')][_0x7eef('0x5c')]({'UserId':_0x1b617a['user']['id'],'ContactId':_0x1a4cd0['id'],'OpenchannelAccountId':_0x45ae68['id'],'lastMsgDirection':_0x7eef('0xbc'),'Messages':[_[_0x7eef('0x4f')](_0x1b617a[_0x7eef('0x61')],{'read':![],'body':_0x1b617a[_0x7eef('0x61')][_0x7eef('0x61')],'OpenchannelAccountId':_0x45ae68['id'],'UserId':_0x1b617a[_0x7eef('0x5d')]['id'],'ContactId':_0x1a4cd0['id']})]},{'include':[{'model':db[_0x7eef('0x99')],'as':'Messages'}]})[_0x7eef('0x23')](function(_0x58c94d){return[_0x58c94d,!![]];});});}})[_0x7eef('0x8f')](function(_0x41d251,_0x1499e7){if(_0x1499e7){return _0x41d251;}return db[_0x7eef('0x99')][_0x7eef('0x5c')](_[_0x7eef('0x4f')](_0x1b617a[_0x7eef('0x61')],{'read':![],'body':_0x1b617a[_0x7eef('0x61')][_0x7eef('0x61')],'OpenchannelAccountId':_0x45ae68['id'],'OpenchannelInteractionId':_0x41d251['id'],'UserId':_0x1b617a[_0x7eef('0x5d')]['id'],'ContactId':_0x1a4cd0['id']}))[_0x7eef('0x23')](function(_0x44f59a){_0x41d251[_0x7eef('0xbd')][_0x7eef('0xbe')]=[];_0x41d251['dataValues'][_0x7eef('0xbe')]['push'](_0x44f59a[_0x7eef('0xbd')]);return _0x41d251;});});}})[_0x7eef('0x23')](respondWithResult(_0x5c63a1,null))[_0x7eef('0x2b')](handleError(_0x5c63a1,null));}; \ No newline at end of file +var _0xe34e=['../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','find','OpenchannelAccountId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','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','OpenchannelApplication','Applications','List','applications','list','orderBy','priority','asc','account','defaults','CmContact','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','update','interaction','created','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','DESC','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x37b351,_0x18f664){var _0x56bfef=function(_0x48e19d){while(--_0x48e19d){_0x37b351['push'](_0x37b351['shift']());}};_0x56bfef(++_0x18f664);}(_0xe34e,0xa9));var _0xee34=function(_0x40ef00,_0x3ac5a0){_0x40ef00=_0x40ef00-0x0;var _0x35b5be=_0xe34e[_0x40ef00];return _0x35b5be;};'use strict';var emlformat=require(_0xee34('0x0'));var rimraf=require(_0xee34('0x1'));var zipdir=require(_0xee34('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee34('0x3'));var moment=require(_0xee34('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee34('0x5'));var util=require('util');var path=require(_0xee34('0x6'));var sox=require(_0xee34('0x7'));var csv=require('to-csv');var ejs=require(_0xee34('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee34('0x9'));var squel=require(_0xee34('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xee34('0xb'));var querystring=require(_0xee34('0xc'));var Papa=require(_0xee34('0xd'));var Redis=require(_0xee34('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xee34('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee34('0x10'));var logger=require(_0xee34('0x11'))(_0xee34('0x12'));var utils=require(_0xee34('0x13'));var config=require(_0xee34('0x14'));var licenseUtil=require(_0xee34('0x15'));var db=require(_0xee34('0x16'))['db'];config[_0xee34('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xee34('0x18'))(new Redis(config[_0xee34('0x17')]));require(_0xee34('0x19'))[_0xee34('0x1a')](socket);var jayson=require(_0xee34('0x1b'));var client=jayson[_0xee34('0x1c')][_0xee34('0x1d')]({'port':0x232c});var client9002=jayson[_0xee34('0x1c')][_0xee34('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x165863,_0x34051d,_0x1ccfa4,_0x56f04c){return new BPromise(function(_0x57f7c1,_0x19340d){var _0x47f5d5=_0x56f04c||client;return _0x47f5d5[_0xee34('0x1e')](_0x165863,_0x1ccfa4)[_0xee34('0x1f')](function(_0x265285){logger[_0xee34('0x20')](_0xee34('0x21'),_0x34051d,'request\x20sent');logger['debug'](_0xee34('0x22'),_0x34051d,_0xee34('0x23'),JSON['stringify'](_0x265285));if(_0x265285[_0xee34('0x24')]){if(_0x265285[_0xee34('0x24')][_0xee34('0x25')]===0x1f4){logger[_0xee34('0x24')](_0xee34('0x21'),_0x34051d,_0x265285['error'][_0xee34('0x26')]);return _0x19340d(_0x265285[_0xee34('0x24')][_0xee34('0x26')]);}logger[_0xee34('0x24')](_0xee34('0x21'),_0x34051d,_0x265285[_0xee34('0x24')][_0xee34('0x26')]);return _0x57f7c1(_0x265285['error'][_0xee34('0x26')]);}else{logger[_0xee34('0x20')](_0xee34('0x21'),_0x34051d,_0xee34('0x23'));_0x57f7c1(_0x265285[_0xee34('0x27')][_0xee34('0x26')]);}})[_0xee34('0x28')](function(_0x404833){logger[_0xee34('0x24')](_0xee34('0x21'),_0x34051d,_0x404833);_0x19340d(_0x404833);});});}function respondWithStatusCode(_0x5a6eeb,_0x256c26){_0x256c26=_0x256c26||0xcc;return function(_0x379304){if(_0x379304){return _0x5a6eeb[_0xee34('0x29')](_0x256c26);}return _0x5a6eeb[_0xee34('0x2a')](_0x256c26)[_0xee34('0x2b')]();};}function respondWithResult(_0x2c7f9d,_0x1f7f79){_0x1f7f79=_0x1f7f79||0xc8;return function(_0xfd53d9){if(_0xfd53d9){return _0x2c7f9d['status'](_0x1f7f79)[_0xee34('0x2c')](_0xfd53d9);}};}function respondWithFilteredResult(_0x5d20b7,_0x8d3432){return function(_0x59a623){if(_0x59a623){var _0x1288ec=typeof _0x8d3432[_0xee34('0x2d')]===_0xee34('0x2e')&&typeof _0x8d3432['limit']===_0xee34('0x2e');var _0x137892=_0x59a623[_0xee34('0x2f')];var _0x2d73e1=_0x1288ec?0x0:_0x8d3432[_0xee34('0x2d')];var _0x48d33d=_0x1288ec?_0x59a623[_0xee34('0x2f')]:_0x8d3432[_0xee34('0x2d')]+_0x8d3432[_0xee34('0x30')];var _0x593922;if(_0x48d33d>=_0x137892){_0x48d33d=_0x137892;_0x593922=0xc8;}else{_0x593922=0xce;}_0x5d20b7[_0xee34('0x2a')](_0x593922);return _0x5d20b7[_0xee34('0x31')](_0xee34('0x32'),_0x2d73e1+'-'+_0x48d33d+'/'+_0x137892)['json'](_0x59a623);}return null;};}function patchUpdates(_0x41a13b){return function(_0x21e4f5){try{jsonpatch['apply'](_0x21e4f5,_0x41a13b,!![]);}catch(_0x40b7b4){return BPromise[_0xee34('0x33')](_0x40b7b4);}return _0x21e4f5[_0xee34('0x34')]();};}function saveUpdates(_0x4ad43a,_0x2534c3){return function(_0x590356){if(_0x590356){return _0x590356['update'](_0x4ad43a)[_0xee34('0x1f')](function(_0x98959){return _0x98959;});}return null;};}function removeEntity(_0x42633d,_0x500c10){return function(_0x56cb98){if(_0x56cb98){return _0x56cb98[_0xee34('0x35')]()[_0xee34('0x1f')](function(){var _0x99e7e6=_0x56cb98[_0xee34('0x36')]({'plain':!![]});var _0x290653=_0xee34('0x37');return db[_0xee34('0x38')][_0xee34('0x35')]({'where':{'type':_0x290653,'resourceId':_0x99e7e6['id']}})[_0xee34('0x1f')](function(){return _0x56cb98;});})[_0xee34('0x1f')](function(){_0x42633d[_0xee34('0x2a')](0xcc)[_0xee34('0x2b')]();});}};}function handleEntityNotFound(_0x403a68,_0x1124cc){return function(_0x3b02e4){if(!_0x3b02e4){_0x403a68[_0xee34('0x29')](0x194);}return _0x3b02e4;};}function handleError(_0x4e30e0,_0x393699){_0x393699=_0x393699||0x1f4;return function(_0x260b32){logger[_0xee34('0x24')](_0x260b32['stack']);if(_0x260b32[_0xee34('0x39')]){delete _0x260b32[_0xee34('0x39')];}_0x4e30e0[_0xee34('0x2a')](_0x393699)[_0xee34('0x3a')](_0x260b32);};}exports[_0xee34('0x3b')]=function(_0x131ca2,_0x369ed5){var _0x504d1c={'include':[{'model':db['Pause'],'as':_0xee34('0x3c')}]},_0xd61015={},_0x3b9c80={'count':0x0,'rows':[]};var _0xc932dd=_[_0xee34('0x3d')](db[_0xee34('0x3e')][_0xee34('0x3f')],function(_0x3f5c8a){return{'name':_0x3f5c8a[_0xee34('0x40')],'type':_0x3f5c8a[_0xee34('0x41')][_0xee34('0x42')]};});_0xd61015[_0xee34('0x43')]=_[_0xee34('0x3d')](_0xc932dd,_0xee34('0x39'));_0xd61015[_0xee34('0x44')]=_[_0xee34('0x45')](_0x131ca2['query']);_0xd61015[_0xee34('0x46')]=_[_0xee34('0x47')](_0xd61015['model'],_0xd61015['query']);_0x504d1c[_0xee34('0x48')]=_['intersection'](_0xd61015[_0xee34('0x43')],qs[_0xee34('0x49')](_0x131ca2[_0xee34('0x44')][_0xee34('0x49')]));_0x504d1c[_0xee34('0x48')]=_0x504d1c['attributes'][_0xee34('0x4a')]?_0x504d1c[_0xee34('0x48')]:_0xd61015[_0xee34('0x43')];if(!_0x131ca2[_0xee34('0x44')][_0xee34('0x4b')](_0xee34('0x4c'))){_0x504d1c[_0xee34('0x30')]=qs[_0xee34('0x30')](_0x131ca2[_0xee34('0x44')]['limit']);_0x504d1c[_0xee34('0x2d')]=qs['offset'](_0x131ca2[_0xee34('0x44')]['offset']);}_0x504d1c['order']=qs[_0xee34('0x4d')](_0x131ca2[_0xee34('0x44')]['sort']);_0x504d1c['where']=qs[_0xee34('0x46')](_[_0xee34('0x4e')](_0x131ca2[_0xee34('0x44')],_0xd61015['filters']),_0xc932dd);if(_0x131ca2[_0xee34('0x44')][_0xee34('0x4f')]){_0x504d1c[_0xee34('0x50')]=_[_0xee34('0x51')](_0x504d1c[_0xee34('0x50')],{'$or':_[_0xee34('0x3d')](_0xc932dd,function(_0x3d18d8){if(_0x3d18d8[_0xee34('0x41')]!==_0xee34('0x52')){var _0x5a52e2={};_0x5a52e2[_0x3d18d8[_0xee34('0x39')]]={'$like':'%'+_0x131ca2[_0xee34('0x44')][_0xee34('0x4f')]+'%'};return _0x5a52e2;}})});}_0x504d1c=_[_0xee34('0x51')]({},_0x504d1c,_0x131ca2['options']);var _0x4ecbe9={'where':_0x504d1c[_0xee34('0x50')]};return db[_0xee34('0x3e')]['count'](_0x4ecbe9)[_0xee34('0x1f')](function(_0x472518){_0x3b9c80[_0xee34('0x2f')]=_0x472518;if(_0x131ca2[_0xee34('0x44')][_0xee34('0x53')]){_0x504d1c[_0xee34('0x54')]=[{'all':!![]}];}return db[_0xee34('0x3e')][_0xee34('0x55')](_0x504d1c);})[_0xee34('0x1f')](function(_0x4b15b4){_0x3b9c80[_0xee34('0x56')]=_0x4b15b4;return _0x3b9c80;})['then'](respondWithFilteredResult(_0x369ed5,_0x504d1c))[_0xee34('0x28')](handleError(_0x369ed5,null));};exports['show']=function(_0x472b69,_0x5b0005){var _0x5af869={'raw':![],'where':{'id':_0x472b69[_0xee34('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xee34('0x3c')}]},_0x562d26={};_0x562d26[_0xee34('0x43')]=_[_0xee34('0x45')](db[_0xee34('0x3e')][_0xee34('0x3f')]);_0x562d26[_0xee34('0x44')]=_[_0xee34('0x45')](_0x472b69[_0xee34('0x44')]);_0x562d26['filters']=_[_0xee34('0x47')](_0x562d26[_0xee34('0x43')],_0x562d26[_0xee34('0x44')]);_0x5af869[_0xee34('0x48')]=_[_0xee34('0x47')](_0x562d26[_0xee34('0x43')],qs[_0xee34('0x49')](_0x472b69[_0xee34('0x44')]['fields']));_0x5af869[_0xee34('0x48')]=_0x5af869['attributes'][_0xee34('0x4a')]?_0x5af869[_0xee34('0x48')]:_0x562d26[_0xee34('0x43')];if(_0x472b69['query'][_0xee34('0x53')]){_0x5af869[_0xee34('0x54')]=[{'all':!![]}];}_0x5af869=_[_0xee34('0x51')]({},_0x5af869,_0x472b69[_0xee34('0x58')]);return db[_0xee34('0x3e')]['find'](_0x5af869)[_0xee34('0x1f')](handleEntityNotFound(_0x5b0005,null))[_0xee34('0x1f')](respondWithResult(_0x5b0005,null))['catch'](handleError(_0x5b0005,null));};exports[_0xee34('0x59')]=function(_0x4d0633,_0x4936c1){return db['OpenchannelAccount']['create'](_0x4d0633[_0xee34('0x5a')],{})[_0xee34('0x1f')](function(_0x55ea78){var _0x487184=_0x4d0633[_0xee34('0x5b')][_0xee34('0x36')]({'plain':!![]});if(!_0x487184)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x487184[_0xee34('0x5c')]===_0xee34('0x5b')){var _0x2a28b1=_0x55ea78[_0xee34('0x36')]({'plain':!![]});var _0x272d40=_0xee34('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x272d40,'userProfileId':_0x487184[_0xee34('0x5d')]},'raw':!![]})['then'](function(_0x5cd52f){if(_0x5cd52f&&_0x5cd52f[_0xee34('0x5e')]===0x0){return db[_0xee34('0x38')][_0xee34('0x59')]({'name':_0x2a28b1['name'],'resourceId':_0x2a28b1['id'],'type':_0x5cd52f[_0xee34('0x39')],'sectionId':_0x5cd52f['id']},{})[_0xee34('0x1f')](function(){return _0x55ea78;});}else{return _0x55ea78;}})[_0xee34('0x28')](function(_0x5768b8){logger['error'](_0xee34('0x5f'),_0x5768b8);throw _0x5768b8;});}return _0x55ea78;})['then'](respondWithResult(_0x4936c1,0xc9))[_0xee34('0x28')](handleError(_0x4936c1,null));};exports['update']=function(_0x1a9a5d,_0x26f5b1){if(_0x1a9a5d[_0xee34('0x5a')]['id']){delete _0x1a9a5d[_0xee34('0x5a')]['id'];}return db[_0xee34('0x3e')]['find']({'where':{'id':_0x1a9a5d[_0xee34('0x57')]['id']},'include':[{'model':db[_0xee34('0x60')],'as':_0xee34('0x3c')}]})[_0xee34('0x1f')](handleEntityNotFound(_0x26f5b1,null))[_0xee34('0x1f')](saveUpdates(_0x1a9a5d[_0xee34('0x5a')],null))['then'](respondWithResult(_0x26f5b1,null))['catch'](handleError(_0x26f5b1,null));};exports[_0xee34('0x35')]=function(_0x57b158,_0x6e2123){return db[_0xee34('0x3e')]['find']({'where':{'id':_0x57b158[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x6e2123,null))['then'](removeEntity(_0x6e2123,null))[_0xee34('0x28')](handleError(_0x6e2123,null));};exports[_0xee34('0x61')]=function(_0x47af4b,_0xb9b437){return db[_0xee34('0x3e')][_0xee34('0x61')]()[_0xee34('0x1f')](respondWithResult(_0xb9b437,null))[_0xee34('0x28')](handleError(_0xb9b437,null));};exports[_0xee34('0x62')]=function(_0x3555d2,_0x30b094,_0x38e4d0){if(_0x3555d2[_0xee34('0x5a')]['id']){delete _0x3555d2[_0xee34('0x5a')]['id'];}return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x3555d2[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x30b094,null))[_0xee34('0x1f')](function(_0x40eab1){if(_0x40eab1){_0x3555d2[_0xee34('0x5a')][_0xee34('0x64')]=_0x40eab1['id'];return db[_0xee34('0x65')][_0xee34('0x59')](_0x3555d2[_0xee34('0x5a')]);}})[_0xee34('0x1f')](respondWithResult(_0x30b094,null))[_0xee34('0x28')](handleError(_0x30b094,null));};exports[_0xee34('0x66')]=function(_0x841ddb,_0x206942,_0xdc2dd3){var _0x56b7a2={'raw':![],'where':{}};var _0x566593={};var _0x535904={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xee34('0x67')]({'where':{'id':_0x841ddb['params']['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x206942,null))[_0xee34('0x1f')](function(_0x576ec2){if(_0x576ec2){_0x566593[_0xee34('0x43')]=_['keys'](db[_0xee34('0x65')]['rawAttributes']);_0x566593[_0xee34('0x44')]=_['keys'](_0x841ddb[_0xee34('0x44')]);_0x566593['filters']=_['intersection'](_0x566593[_0xee34('0x43')],_0x566593[_0xee34('0x44')]);_0x56b7a2['attributes']=_[_0xee34('0x47')](_0x566593[_0xee34('0x43')],qs[_0xee34('0x49')](_0x841ddb[_0xee34('0x44')]['fields']));_0x56b7a2['attributes']=_0x56b7a2['attributes']['length']?_0x56b7a2[_0xee34('0x48')]:_0x566593['model'];if(!_0x841ddb[_0xee34('0x44')][_0xee34('0x4b')](_0xee34('0x4c'))){_0x56b7a2[_0xee34('0x30')]=qs[_0xee34('0x30')](_0x841ddb[_0xee34('0x44')][_0xee34('0x30')]);_0x56b7a2['offset']=qs[_0xee34('0x2d')](_0x841ddb['query']['offset']);}_0x56b7a2[_0xee34('0x68')]=qs[_0xee34('0x4d')](_0x841ddb[_0xee34('0x44')][_0xee34('0x4d')]);_0x56b7a2[_0xee34('0x50')]=qs['filters'](_['pick'](_0x841ddb['query'],_0x566593[_0xee34('0x46')]));_0x56b7a2[_0xee34('0x50')][_0xee34('0x64')]=_0x576ec2['id'];if(_0x841ddb[_0xee34('0x44')][_0xee34('0x4f')]){_0x56b7a2[_0xee34('0x50')]=_[_0xee34('0x51')](_0x56b7a2['where'],{'$or':_[_0xee34('0x3d')](_0x56b7a2[_0xee34('0x48')],function(_0x5e58e6){var _0x178398={};_0x178398[_0x5e58e6]={'$like':'%'+_0x841ddb[_0xee34('0x44')]['filter']+'%'};return _0x178398;})});}_0x56b7a2=_[_0xee34('0x51')]({},_0x56b7a2,_0x841ddb[_0xee34('0x58')]);return db[_0xee34('0x65')]['count']({'where':_0x56b7a2[_0xee34('0x50')]})[_0xee34('0x1f')](function(_0x154a20){_0x535904['count']=_0x154a20;if(_0x841ddb[_0xee34('0x44')][_0xee34('0x53')]){_0x56b7a2[_0xee34('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x56b7a2);})[_0xee34('0x1f')](function(_0x235174){_0x535904[_0xee34('0x56')]=_0x235174;return _0x535904;});}})[_0xee34('0x1f')](respondWithFilteredResult(_0x206942,_0x56b7a2))[_0xee34('0x28')](handleError(_0x206942,null));};exports[_0xee34('0x69')]=function(_0x24c995,_0x4ce32f,_0x4024f2){return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x24c995[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ce32f,null))[_0xee34('0x1f')](function(_0x2fc558){if(_0x2fc558){return _0x2fc558['removeDispositions'](_0x24c995[_0xee34('0x44')]['ids']);}})[_0xee34('0x1f')](respondWithStatusCode(_0x4ce32f,null))[_0xee34('0x28')](handleError(_0x4ce32f,null));};exports[_0xee34('0x6a')]=function(_0x46a4e4,_0x329c96,_0xe98690){if(_0x46a4e4[_0xee34('0x5a')]['id']){delete _0x46a4e4['body']['id'];}return db['OpenchannelAccount'][_0xee34('0x63')]({'where':{'id':_0x46a4e4['params']['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x329c96,null))[_0xee34('0x1f')](function(_0x99a454){if(_0x99a454){_0x46a4e4[_0xee34('0x5a')][_0xee34('0x64')]=_0x99a454['id'];return db[_0xee34('0x6b')][_0xee34('0x59')](_0x46a4e4[_0xee34('0x5a')]);}})[_0xee34('0x1f')](respondWithResult(_0x329c96,null))[_0xee34('0x28')](handleError(_0x329c96,null));};exports[_0xee34('0x6c')]=function(_0x32283f,_0x2494d5,_0x1822a5){var _0x144b9d={'raw':![],'where':{}};var _0x3a7c7f={};var _0x593904={'count':0x0,'rows':[]};return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x32283f['params']['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x2494d5,null))['then'](function(_0x33f7f0){if(_0x33f7f0){_0x3a7c7f['model']=_['keys'](db[_0xee34('0x6b')][_0xee34('0x3f')]);_0x3a7c7f[_0xee34('0x44')]=_[_0xee34('0x45')](_0x32283f[_0xee34('0x44')]);_0x3a7c7f[_0xee34('0x46')]=_[_0xee34('0x47')](_0x3a7c7f[_0xee34('0x43')],_0x3a7c7f['query']);_0x144b9d['attributes']=_['intersection'](_0x3a7c7f[_0xee34('0x43')],qs[_0xee34('0x49')](_0x32283f[_0xee34('0x44')][_0xee34('0x49')]));_0x144b9d[_0xee34('0x48')]=_0x144b9d[_0xee34('0x48')][_0xee34('0x4a')]?_0x144b9d[_0xee34('0x48')]:_0x3a7c7f[_0xee34('0x43')];if(!_0x32283f[_0xee34('0x44')][_0xee34('0x4b')](_0xee34('0x4c'))){_0x144b9d[_0xee34('0x30')]=qs[_0xee34('0x30')](_0x32283f[_0xee34('0x44')][_0xee34('0x30')]);_0x144b9d[_0xee34('0x2d')]=qs[_0xee34('0x2d')](_0x32283f[_0xee34('0x44')]['offset']);}_0x144b9d[_0xee34('0x68')]=qs[_0xee34('0x4d')](_0x32283f[_0xee34('0x44')]['sort']);_0x144b9d['where']=qs[_0xee34('0x46')](_[_0xee34('0x4e')](_0x32283f[_0xee34('0x44')],_0x3a7c7f[_0xee34('0x46')]));_0x144b9d[_0xee34('0x50')][_0xee34('0x64')]=_0x33f7f0['id'];if(_0x32283f[_0xee34('0x44')][_0xee34('0x4f')]){_0x144b9d[_0xee34('0x50')]=_[_0xee34('0x51')](_0x144b9d[_0xee34('0x50')],{'$or':_[_0xee34('0x3d')](_0x144b9d[_0xee34('0x48')],function(_0x4de003){var _0x1df49a={};_0x1df49a[_0x4de003]={'$like':'%'+_0x32283f[_0xee34('0x44')][_0xee34('0x4f')]+'%'};return _0x1df49a;})});}_0x144b9d=_[_0xee34('0x51')]({},_0x144b9d,_0x32283f[_0xee34('0x58')]);return db[_0xee34('0x6b')][_0xee34('0x2f')]({'where':_0x144b9d[_0xee34('0x50')]})[_0xee34('0x1f')](function(_0x108a53){_0x593904[_0xee34('0x2f')]=_0x108a53;if(_0x32283f['query']['includeAll']){_0x144b9d['include']=[{'all':!![]}];}return db[_0xee34('0x6b')][_0xee34('0x55')](_0x144b9d);})[_0xee34('0x1f')](function(_0x354edf){_0x593904[_0xee34('0x56')]=_0x354edf;return _0x593904;});}})['then'](respondWithFilteredResult(_0x2494d5,_0x144b9d))[_0xee34('0x28')](handleError(_0x2494d5,null));};exports[_0xee34('0x6d')]=function(_0x25a01d,_0x304b29,_0x4337ab){return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x25a01d[_0xee34('0x57')]['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x304b29,null))[_0xee34('0x1f')](function(_0xb18a34){if(_0xb18a34){return _0xb18a34['removeAnswers'](_0x25a01d[_0xee34('0x44')][_0xee34('0x6e')]);}})[_0xee34('0x1f')](respondWithStatusCode(_0x304b29,null))['catch'](handleError(_0x304b29,null));};exports[_0xee34('0x6f')]=function(_0x1a9eb0,_0x2dbc7e,_0x1e73ac){var _0x49c971={'body':_0x1a9eb0['body'],'channel':_0xee34('0x70')};var _0x41f2e1=[];var _0x1404dc=[];var _0x2a3a5e={};var _0x2fade0=![];return db['CmContact'][_0xee34('0x61')]()[_0xee34('0x1f')](function(_0x328591){if(!_0x328591){throw new db[(_0xee34('0x71'))][(_0xee34('0x72'))]('no\x20available\x20attributes');}_0x41f2e1=_[_0xee34('0x73')](_['keys'](_0x328591),[_0xee34('0x74'),_0xee34('0x75')]);_0x1404dc=_[_0xee34('0x73')](_[_0xee34('0x45')](_0x328591),[_0xee34('0x74'),_0xee34('0x75'),_0xee34('0x76'),_0xee34('0x77')]);if(_0x1a9eb0[_0xee34('0x5a')]['id']){delete _0x1a9eb0['body']['id'];}if(_['isNil'](_0x1a9eb0['body'][_0xee34('0x78')])){throw new db[(_0xee34('0x71'))][(_0xee34('0x72'))](_0xee34('0x79'));}if(_[_0xee34('0x7a')](_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x5a')])||_0x1a9eb0['body'][_0xee34('0x5a')]===''){throw new db[(_0xee34('0x71'))][(_0xee34('0x72'))](_0xee34('0x7b'));}if(_[_0xee34('0x7a')](_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x7c')])){throw new db[(_0xee34('0x71'))]['ValidationError'](_0xee34('0x7d')+_0x1404dc);}if(!_['includes'](_0x1404dc,_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x7c')])){throw new db[(_0xee34('0x71'))][(_0xee34('0x72'))](_0xee34('0x7e')+_0x1404dc);}_0x2a3a5e[_0x1a9eb0['body'][_0xee34('0x7c')]]=_0x1a9eb0[_0xee34('0x5a')]['from'];})[_0xee34('0x1f')](function(){return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x1a9eb0[_0xee34('0x57')]['id']},'include':[{'model':db[_0xee34('0x7f')],'as':'List','include':[{'model':db['CmContact'],'as':_0xee34('0x80'),'where':_0x2a3a5e,'limit':0x1,'order':[[_0xee34('0x75'),'DESC']]}]},{'model':db[_0xee34('0x81')],'as':_0xee34('0x82')}]});})[_0xee34('0x1f')](handleEntityNotFound(_0x2dbc7e,null))[_0xee34('0x1f')](function(_0x5a9f73){if(_0x5a9f73&&_0x5a9f73[_0xee34('0x83')]){_0x49c971['account']=_0x5a9f73;_0x49c971[_0xee34('0x84')]=_0x5a9f73['Applications'];_0x49c971[_0xee34('0x85')]=_0x5a9f73[_0xee34('0x83')];_0x49c971[_0xee34('0x84')]=_[_0xee34('0x86')](_0x49c971[_0xee34('0x84')],[_0xee34('0x87')],[_0xee34('0x88')]);if(_0x49c971[_0xee34('0x89')][_0xee34('0x82')]){delete _0x49c971['account'][_0xee34('0x82')];}if(_0x49c971[_0xee34('0x89')][_0xee34('0x83')]&&_0x49c971['account'][_0xee34('0x83')][_0xee34('0x80')][_0xee34('0x4a')]){return _0x49c971[_0xee34('0x89')][_0xee34('0x83')][_0xee34('0x80')][0x0];}var _0x2f01d6=_[_0xee34('0x8a')](_0x1a9eb0['body'],{'firstName':_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x78')],'ListId':_0x5a9f73['ListId']});_0x2f01d6[_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x7c')]]=_0x1a9eb0[_0xee34('0x5a')]['from'];return db[_0xee34('0x8b')]['create'](_0x2f01d6,{'fields':_0x41f2e1,'raw':!![]});}})[_0xee34('0x1f')](handleEntityNotFound(_0x2dbc7e,null))[_0xee34('0x1f')](function(_0x46ca2b){_0x49c971[_0xee34('0x8c')]=_0x46ca2b;if(_0x46ca2b){var _0x562445={'ContactId':_0x46ca2b['id'],'OpenchannelAccountId':_0x1a9eb0[_0xee34('0x57')]['id'],'from':(_0x46ca2b[_0xee34('0x8d')]||'')+'\x20'+(_0x46ca2b[_0xee34('0x8e')]||'')};var _0x13568c={'OpenchannelAccountId':_0x1a9eb0['params']['id'],'closed':![]};if(_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x8f')]){_0x13568c[_0xee34('0x8f')]=_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x8f')];return db[_0xee34('0x90')][_0xee34('0x63')]({'where':_0x13568c})[_0xee34('0x1f')](function(_0x5490f3){if(_0x5490f3){return[_0x5490f3,![]];}_0x562445[_0xee34('0x8f')]=_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x8f')];_0x562445[_0xee34('0x91')]=_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x91')];return db['OpenchannelInteraction'][_0xee34('0x59')](_0x562445)['then'](function(_0x3cdcc8){return[_0x3cdcc8,!![]];});});}else{_0x13568c[_0xee34('0x8f')]=null;}_0x13568c[_0xee34('0x92')]=_0x46ca2b['id'];return db[_0xee34('0x90')][_0xee34('0x63')]({'where':_0x13568c})['then'](function(_0x205368){if(_0x205368){return[_0x205368,![]];}return db[_0xee34('0x90')]['create'](_0x562445)[_0xee34('0x1f')](function(_0x5c1456){return[_0x5c1456,!![]];});});}})[_0xee34('0x93')](function(_0x239401,_0x85b043){if(_0x239401){_0x2fade0=_0x85b043;if(!_0x85b043){var _0x20674a={'from':(_0x49c971['contact'][_0xee34('0x8d')]||'')+'\x20'+(_0x49c971[_0xee34('0x8c')][_0xee34('0x8e')]||'')};if(_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x8f')]&&_0x1a9eb0[_0xee34('0x5a')]['messageId']&&_0x1a9eb0[_0xee34('0x5a')]['threadId']!=_0x1a9eb0['body']['messageId']){_0x20674a[_0xee34('0x8f')]=_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x94')];}return _0x239401[_0xee34('0x95')](_0x20674a);}else{return _0x239401;}}})[_0xee34('0x1f')](function(_0x4569a1){_0x49c971[_0xee34('0x96')]=_0x4569a1[_0xee34('0x36')]({'plain':!![]});_0x49c971['interaction'][_0xee34('0x97')]=_0x2fade0;if(_0x49c971['interaction'][_0xee34('0x97')]){if(_0x49c971[_0xee34('0x89')]['autoclose']){_0x49c971['applications']['push']({'id':0x0,'priority':_0x49c971[_0xee34('0x84')][_0xee34('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xee34('0x98')});}}return db[_0xee34('0x99')][_0xee34('0x59')]({'body':_0x1a9eb0['body'][_0xee34('0x5a')],'OpenchannelAccountId':_0x1a9eb0[_0xee34('0x57')]['id'],'OpenchannelInteractionId':_0x4569a1['id'],'direction':'in','ContactId':_0x49c971[_0xee34('0x8c')]['id'],'AttachmentId':_0x1a9eb0[_0xee34('0x5a')][_0xee34('0x9a')]});})['then'](function(_0x4b3acb){_0x49c971[_0xee34('0x26')]=_0x4b3acb;if(_0x49c971[_0xee34('0x96')]['UserId']){return db['User'][_0xee34('0x63')]({'attributes':['id',_0xee34('0x39')],'where':{'id':_0x49c971['interaction'][_0xee34('0x9b')]}})[_0xee34('0x1f')](function(_0x5b77ef){if(_0x5b77ef){_0x49c971[_0xee34('0x84')][_0xee34('0x9c')]({'id':0x0,'priority':0x0,'app':_0xee34('0x9d'),'appdata':_0x5b77ef[_0xee34('0x39')]+','+(_0x49c971[_0xee34('0x89')][_0xee34('0x9e')]||0xa),'interval':_0xee34('0x98')});_0x49c971['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xee34('0x9f'),_0x49c971);});}return respondWithRpcPromise(_0xee34('0xa0'),_0xee34('0x9f'),_0x49c971);})[_0xee34('0x1f')](function(_0x2f4969){respondWithRpcPromise('EventManager',_0xee34('0xa1'),{'event':'notify','message':_0x2f4969},client9002);return _0x2f4969;})[_0xee34('0x1f')](respondWithResult(_0x2dbc7e,null))[_0xee34('0x28')](handleError(_0x2dbc7e,null));};exports[_0xee34('0xa2')]=function(_0x1a89bb,_0xe1ed8){var _0x597578=_0x1a89bb[_0xee34('0x57')]['id'];var _0x4676f7=_0x1a89bb[_0xee34('0x5a')];var _0x5066b7=0xc8;var _0x5c2dca=null;return db[_0xee34('0xa3')][_0xee34('0xa4')]({'isolationLevel':db[_0xee34('0xa3')]['Transaction']['ISOLATION_LEVELS'][_0xee34('0xa5')]},function(_0x25487f){return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x597578},'transaction':_0x25487f})['then'](function(_0x2dbbc9){if(_0x2dbbc9){return db[_0xee34('0x81')][_0xee34('0x35')]({'where':{'OpenchannelAccountId':_0x597578},'transaction':_0x25487f})[_0xee34('0x1f')](function(){var _0x201762=_[_0xee34('0x3d')](_0x4676f7,function(_0x38e7b1){_0x38e7b1['OpenchannelAccountId']=_0x597578;return _0x38e7b1;});return db[_0xee34('0x81')]['bulkCreate'](_0x201762,{'transaction':_0x25487f});});}else{_0x5066b7=0x194;_0x5c2dca=[];}});})[_0xee34('0x1f')](function(){if(_0x5066b7!==0x194){return db[_0xee34('0x81')][_0xee34('0xa6')]({'where':{'OpenchannelAccountId':_0x597578},'order':_0xee34('0x87')})[_0xee34('0x1f')](function(_0x5eba58){_0x5c2dca=_0x5eba58;});}})[_0xee34('0x28')](function(_0x3117a5){_0x5066b7=0x1f4;logger['error'](_0x3117a5[_0xee34('0xa7')]);if(_0x3117a5[_0xee34('0x39')]){delete _0x3117a5[_0xee34('0x39')];}_0x5c2dca=_0x3117a5;})[_0xee34('0xa8')](function(){if(_0x5c2dca===null){_0xe1ed8['sendStatus'](_0x5066b7);}else{if(_0x5066b7===0x1f4){_0xe1ed8[_0xee34('0x2a')](_0x5066b7)['send'](_0x5c2dca);}else{_0xe1ed8[_0xee34('0x2a')](_0x5066b7)[_0xee34('0x2c')](_0x5c2dca);}}});};exports[_0xee34('0xa9')]=function(_0x384fd7,_0x2f6953,_0x246df4){var _0x2f9155={};var _0x23bd34={};var _0x51e908;var _0x182ac3;return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x384fd7[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x2f6953,null))['then'](function(_0x5a2d73){if(_0x5a2d73){_0x51e908=_0x5a2d73;_0x23bd34['model']=_[_0xee34('0x45')](db[_0xee34('0x81')][_0xee34('0x3f')]);_0x23bd34[_0xee34('0x44')]=_[_0xee34('0x45')](_0x384fd7[_0xee34('0x44')]);_0x23bd34[_0xee34('0x46')]=_[_0xee34('0x47')](_0x23bd34[_0xee34('0x43')],_0x23bd34[_0xee34('0x44')]);_0x2f9155['attributes']=_[_0xee34('0x47')](_0x23bd34[_0xee34('0x43')],qs[_0xee34('0x49')](_0x384fd7[_0xee34('0x44')][_0xee34('0x49')]));_0x2f9155[_0xee34('0x48')]=_0x2f9155[_0xee34('0x48')][_0xee34('0x4a')]?_0x2f9155[_0xee34('0x48')]:_0x23bd34[_0xee34('0x43')];_0x2f9155[_0xee34('0x68')]=qs[_0xee34('0x4d')](_0x384fd7[_0xee34('0x44')][_0xee34('0x4d')]);_0x2f9155[_0xee34('0x50')]=qs[_0xee34('0x46')](_[_0xee34('0x4e')](_0x384fd7[_0xee34('0x44')],_0x23bd34[_0xee34('0x46')]));if(_0x384fd7['query'][_0xee34('0x4f')]){_0x2f9155[_0xee34('0x50')]=_['merge'](_0x2f9155[_0xee34('0x50')],{'$or':_['map'](_0x2f9155[_0xee34('0x48')],function(_0x14c70b){var _0x1600bb={};_0x1600bb[_0x14c70b]={'$like':'%'+_0x384fd7['query'][_0xee34('0x4f')]+'%'};return _0x1600bb;})});}_0x2f9155=_['merge']({},_0x2f9155,_0x384fd7[_0xee34('0x58')]);return _0x51e908[_0xee34('0xa9')](_0x2f9155);}})[_0xee34('0x1f')](function(_0x555707){if(_0x555707){_0x182ac3=_0x555707[_0xee34('0x4a')];if(!_0x384fd7[_0xee34('0x44')][_0xee34('0x4b')]('nolimit')){_0x2f9155[_0xee34('0x30')]=qs['limit'](_0x384fd7[_0xee34('0x44')]['limit']);_0x2f9155['offset']=qs['offset'](_0x384fd7[_0xee34('0x44')][_0xee34('0x2d')]);}return _0x51e908[_0xee34('0xa9')](_0x2f9155);}})[_0xee34('0x1f')](function(_0x15c9ff){if(_0x15c9ff){return _0x15c9ff?{'count':_0x182ac3,'rows':_0x15c9ff}:null;}})[_0xee34('0x1f')](respondWithResult(_0x2f6953,null))[_0xee34('0x28')](handleError(_0x2f6953,null));};exports['getInteractions']=function(_0x4fc019,_0x43b355,_0x1f10a0){var _0x5565e4={'raw':![],'where':{}};var _0x21c676={};var _0x2d8781={'count':0x0,'rows':[]};return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x4fc019[_0xee34('0x57')]['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x43b355,null))['then'](function(_0x46ef2c){if(_0x46ef2c){_0x21c676[_0xee34('0x43')]=_[_0xee34('0x45')](db['OpenchannelInteraction'][_0xee34('0x3f')]);_0x21c676[_0xee34('0x44')]=_[_0xee34('0x45')](_0x4fc019[_0xee34('0x44')]);_0x21c676[_0xee34('0x46')]=_[_0xee34('0x47')](_0x21c676[_0xee34('0x43')],_0x21c676[_0xee34('0x44')]);_0x5565e4['attributes']=_[_0xee34('0x47')](_0x21c676[_0xee34('0x43')],qs[_0xee34('0x49')](_0x4fc019[_0xee34('0x44')][_0xee34('0x49')]));_0x5565e4[_0xee34('0x48')]=_0x5565e4[_0xee34('0x48')][_0xee34('0x4a')]?_0x5565e4[_0xee34('0x48')]:_0x21c676[_0xee34('0x43')];if(!_0x4fc019[_0xee34('0x44')][_0xee34('0x4b')](_0xee34('0x4c'))){_0x5565e4[_0xee34('0x30')]=qs[_0xee34('0x30')](_0x4fc019[_0xee34('0x44')]['limit']);_0x5565e4[_0xee34('0x2d')]=qs[_0xee34('0x2d')](_0x4fc019[_0xee34('0x44')][_0xee34('0x2d')]);}_0x5565e4[_0xee34('0x68')]=qs[_0xee34('0x4d')](_0x4fc019[_0xee34('0x44')]['sort']);_0x5565e4[_0xee34('0x50')]=qs[_0xee34('0x46')](_['pick'](_0x4fc019[_0xee34('0x44')],_0x21c676['filters']));_0x5565e4[_0xee34('0x50')]['OpenchannelAccountId']=_0x46ef2c['id'];if(_0x4fc019[_0xee34('0x44')]['filter']){_0x5565e4[_0xee34('0x50')]=_[_0xee34('0x51')](_0x5565e4[_0xee34('0x50')],{'$or':_[_0xee34('0x3d')](_0x5565e4[_0xee34('0x48')],function(_0x4ffe14){var _0x5c5ebd={};_0x5c5ebd[_0x4ffe14]={'$like':'%'+_0x4fc019[_0xee34('0x44')][_0xee34('0x4f')]+'%'};return _0x5c5ebd;})});}_0x5565e4=_[_0xee34('0x51')]({},_0x5565e4,_0x4fc019[_0xee34('0x58')]);return db[_0xee34('0x90')][_0xee34('0x2f')]({'where':_0x5565e4[_0xee34('0x50')]})['then'](function(_0x14d29b){_0x2d8781['count']=_0x14d29b;if(_0x4fc019[_0xee34('0x44')]['includeAll']){_0x5565e4[_0xee34('0x54')]=[{'model':db[_0xee34('0x8b')],'as':_0xee34('0xaa'),'required':![]},{'model':db[_0xee34('0xab')],'as':_0xee34('0xac'),'attributes':['name',_0xee34('0xad'),_0xee34('0xae')],'required':![]},{'model':db[_0xee34('0xaf')],'as':_0xee34('0xb0'),'attributes':['id',_0xee34('0x39'),_0xee34('0xb1')],'where':_0x4fc019['query'][_0xee34('0xb2')]?{'id':_0x4fc019['query']['tag']}:undefined,'required':_0x4fc019[_0xee34('0x44')][_0xee34('0xb2')]?!![]:![]}];}return db[_0xee34('0x90')][_0xee34('0x55')](_0x5565e4);})[_0xee34('0x1f')](function(_0x5990c2){_0x2d8781[_0xee34('0x56')]=_0x5990c2;return _0x2d8781;});}})['then'](respondWithFilteredResult(_0x43b355,_0x5565e4))[_0xee34('0x28')](handleError(_0x43b355,null));};exports[_0xee34('0xb3')]=function(_0x4c0a32,_0x4b4808,_0x28ef5a){return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x4c0a32[_0xee34('0x57')]['id']}})[_0xee34('0x1f')](handleEntityNotFound(_0x4b4808,null))[_0xee34('0x1f')](function(_0x155c75){if(_0x155c75){return _0x155c75['addAgents'](_0x4c0a32[_0xee34('0x5a')][_0xee34('0x6e')],_[_0xee34('0xb4')](_0x4c0a32['body'],[_0xee34('0x6e'),'id'])||{})[_0xee34('0x93')](function(_0x116570){for(var _0x3b00e4=0x0;_0x3b00e4<_0x4c0a32[_0xee34('0x5a')]['ids']['length'];_0x3b00e4+=0x1){socket['emit'](_0xee34('0xb5'),{'UserId':Number(_0x4c0a32['body'][_0xee34('0x6e')][_0x3b00e4]),'OpenchannelAccountId':Number(_0x4c0a32[_0xee34('0x57')]['id'])});}return _0x116570;});}})['then'](respondWithResult(_0x4b4808,null))['catch'](handleError(_0x4b4808,null));};exports[_0xee34('0xb6')]=function(_0x34219e,_0x35eb52,_0x5be948){return db[_0xee34('0x3e')]['find']({'where':{'id':_0x34219e[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x35eb52,null))[_0xee34('0x1f')](function(_0x1e1440){if(_0x1e1440){return _0x1e1440[_0xee34('0xb6')](_0x34219e[_0xee34('0x44')][_0xee34('0x6e')])[_0xee34('0x1f')](function(){if(_[_0xee34('0xb7')](_0x34219e[_0xee34('0x44')][_0xee34('0x6e')])){for(var _0x3df905=0x0;_0x3df905<_0x34219e[_0xee34('0x44')]['ids'][_0xee34('0x4a')];_0x3df905+=0x1){socket[_0xee34('0xb8')](_0xee34('0xb9'),{'UserId':Number(_0x34219e['query']['ids'][_0x3df905]),'OpenchannelAccountId':Number(_0x34219e['params']['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x34219e[_0xee34('0x44')]['ids']),'OpenchannelAccountId':Number(_0x34219e[_0xee34('0x57')]['id'])});}});}})[_0xee34('0x1f')](respondWithStatusCode(_0x35eb52,null))[_0xee34('0x28')](handleError(_0x35eb52,null));};exports[_0xee34('0xba')]=function(_0x46aaec,_0x12cb72,_0x32f76a){var _0xd969b4={};var _0x950ca={};var _0x5889e1;var _0x5cbfe0;return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x46aaec[_0xee34('0x57')]['id']}})['then'](handleEntityNotFound(_0x12cb72,null))[_0xee34('0x1f')](function(_0x4c140e){if(_0x4c140e){_0x5889e1=_0x4c140e;_0x950ca[_0xee34('0x43')]=_[_0xee34('0x45')](db[_0xee34('0xab')][_0xee34('0x3f')]);_0x950ca[_0xee34('0x44')]=_[_0xee34('0x45')](_0x46aaec['query']);_0x950ca[_0xee34('0x46')]=_[_0xee34('0x47')](_0x950ca[_0xee34('0x43')],_0x950ca[_0xee34('0x44')]);_0xd969b4[_0xee34('0x48')]=_[_0xee34('0x47')](_0x950ca['model'],qs[_0xee34('0x49')](_0x46aaec[_0xee34('0x44')]['fields']));_0xd969b4[_0xee34('0x48')]=_0xd969b4['attributes']['length']?_0xd969b4[_0xee34('0x48')]:_0x950ca['model'];_0xd969b4[_0xee34('0x68')]=qs[_0xee34('0x4d')](_0x46aaec[_0xee34('0x44')]['sort']);_0xd969b4['where']=qs[_0xee34('0x46')](_['pick'](_0x46aaec['query'],_0x950ca[_0xee34('0x46')]));if(_0x46aaec[_0xee34('0x44')]['filter']){_0xd969b4['where']=_[_0xee34('0x51')](_0xd969b4['where'],{'$or':_[_0xee34('0x3d')](_0xd969b4['attributes'],function(_0x37d43f){var _0x239369={};_0x239369[_0x37d43f]={'$like':'%'+_0x46aaec[_0xee34('0x44')][_0xee34('0x4f')]+'%'};return _0x239369;})});}_0xd969b4=_[_0xee34('0x51')]({},_0xd969b4,_0x46aaec[_0xee34('0x58')]);return _0x5889e1[_0xee34('0xba')](_0xd969b4);}})[_0xee34('0x1f')](function(_0x1966be){if(_0x1966be){_0x5cbfe0=_0x1966be[_0xee34('0x4a')];if(!_0x46aaec[_0xee34('0x44')][_0xee34('0x4b')](_0xee34('0x4c'))){_0xd969b4[_0xee34('0x30')]=qs[_0xee34('0x30')](_0x46aaec['query'][_0xee34('0x30')]);_0xd969b4[_0xee34('0x2d')]=qs[_0xee34('0x2d')](_0x46aaec[_0xee34('0x44')][_0xee34('0x2d')]);}return _0x5889e1[_0xee34('0xba')](_0xd969b4);}})['then'](function(_0x274a4a){if(_0x274a4a){return _0x274a4a?{'count':_0x5cbfe0,'rows':_0x274a4a}:null;}})[_0xee34('0x1f')](respondWithResult(_0x12cb72,null))[_0xee34('0x28')](handleError(_0x12cb72,null));};exports[_0xee34('0x3a')]=function(_0x47ea04,_0x445ca2,_0x213b45){var _0x2d5cd1,_0x4597ae,_0x352504;if(_[_0xee34('0x7a')](_0x47ea04['body']['body'])||_0x47ea04['body'][_0xee34('0x5a')]===''){throw new db[(_0xee34('0x71'))][(_0xee34('0x72'))](_0xee34('0x7b'));}if(_['isNil'](_0x47ea04['body']['to'])){}_0x2d5cd1=_0x47ea04['body']['to'];return db[_0xee34('0x3e')][_0xee34('0x67')]({'where':{'id':_0x47ea04['params']['id']}})['then'](handleEntityNotFound(_0x445ca2,null))[_0xee34('0x1f')](function(_0x4ad199){if(_0x4ad199){return db[_0xee34('0x3e')][_0xee34('0x63')]({'where':{'id':_0x4ad199['id']},'include':[{'model':db[_0xee34('0x7f')],'as':_0xee34('0x83'),'include':[{'model':db['CmContact'],'as':_0xee34('0x80'),'where':{[_0x4ad199[_0xee34('0x7c')]]:_0x2d5cd1},'limit':0x1,'order':[['updatedAt',_0xee34('0xbb')]]}]}]})[_0xee34('0x1f')](handleEntityNotFound(_0x445ca2,null))['then'](function(_0x1d60ca){if(_0x1d60ca&&_0x1d60ca[_0xee34('0x83')]){_0x4597ae=_0x1d60ca[_0xee34('0x36')]({'plain':!![]});if(_0x4597ae[_0xee34('0x83')]&&_0x4597ae[_0xee34('0x83')]['Contacts'][_0xee34('0x4a')]){return _0x4597ae[_0xee34('0x83')]['Contacts'][0x0];}return db[_0xee34('0x8b')][_0xee34('0x59')](_[_0xee34('0x8a')](_0x47ea04[_0xee34('0x5a')],{'firstName':_0x2d5cd1,[_0x1d60ca[_0xee34('0x7c')]]:_0x2d5cd1,'phone':_0x2d5cd1,'ListId':_0x4597ae[_0xee34('0x77')]}));}})[_0xee34('0x1f')](handleEntityNotFound(_0x445ca2,null))[_0xee34('0x1f')](function(_0x380e00){if(_0x380e00){_0x352504=_0x380e00;return db[_0xee34('0x90')][_0xee34('0x63')]({'where':{'ContactId':_0x352504['id'],'closed':![],'OpenchannelAccountId':_0x4597ae['id']}})[_0xee34('0x1f')](function(_0x5b5abb){if(_0x5b5abb){return[_0x5b5abb,![]];}return db[_0xee34('0x90')][_0xee34('0x59')]({'UserId':_0x47ea04[_0xee34('0x5b')]['id'],'ContactId':_0x352504['id'],'OpenchannelAccountId':_0x4597ae['id'],'lastMsgDirection':'out','Messages':[_[_0xee34('0x51')](_0x47ea04['body'],{'read':![],'body':_0x47ea04[_0xee34('0x5a')][_0xee34('0x5a')],'OpenchannelAccountId':_0x4597ae['id'],'UserId':_0x47ea04[_0xee34('0x5b')]['id'],'ContactId':_0x352504['id']})]},{'include':[{'model':db[_0xee34('0x99')],'as':_0xee34('0xbc')}]})[_0xee34('0x1f')](function(_0x245208){return[_0x245208,!![]];});});}})[_0xee34('0x93')](function(_0xea33e7,_0x59f921){if(_0x59f921){return _0xea33e7;}return db['OpenchannelMessage'][_0xee34('0x59')](_['merge'](_0x47ea04[_0xee34('0x5a')],{'read':![],'body':_0x47ea04['body'][_0xee34('0x5a')],'OpenchannelAccountId':_0x4597ae['id'],'OpenchannelInteractionId':_0xea33e7['id'],'UserId':_0x47ea04[_0xee34('0x5b')]['id'],'ContactId':_0x352504['id']}))['then'](function(_0x356235){_0xea33e7[_0xee34('0xbd')][_0xee34('0xbc')]=[];_0xea33e7[_0xee34('0xbd')][_0xee34('0xbc')][_0xee34('0xbe')](_0x356235[_0xee34('0xbd')]);return _0xea33e7;});});}})[_0xee34('0x1f')](respondWithResult(_0x445ca2,null))[_0xee34('0x28')](handleError(_0x445ca2,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index de405ec..3f4f9a6 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 _0xe5b5=['hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x17dc95,_0x18e685){var _0x1fd5f3=function(_0x3f58ff){while(--_0x3f58ff){_0x17dc95['push'](_0x17dc95['shift']());}};_0x1fd5f3(++_0x18e685);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe5b5[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var OpenchannelAccount=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);OpenchannelAccountEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];OpenchannelAccount[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x0bb5,0x148));var _0x50bb=function(_0x4f61dd,_0x44c6a5){_0x4f61dd=_0x4f61dd-0x0;var _0x2b31f6=_0x0bb5[_0x4f61dd];return _0x2b31f6;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1e1f344..d660417 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(_0x46ed9f,_0x4e4f23){var _0x27d71e=function(_0x429835){while(--_0x429835){_0x46ed9f['push'](_0x46ed9f['shift']());}};_0x27d71e(++_0x4e4f23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x530ba3,_0x5b320e){var _0x534673=function(_0x5c46c4){while(--_0x5c46c4){_0x530ba3['push'](_0x530ba3['shift']());}};_0x534673(++_0x5b320e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 1955181..b270f36 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 _0x55f1=['socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost'];(function(_0xce57f9,_0xfa44e7){var _0x3d9ef3=function(_0x4eead1){while(--_0x4eead1){_0xce57f9['push'](_0xce57f9['shift']());}};_0x3d9ef3(++_0xfa44e7);}(_0x55f1,0x9b));var _0x155f=function(_0x4fe44d,_0x3c66fc){_0x4fe44d=_0x4fe44d-0x0;var _0x58d9b1=_0x55f1[_0x4fe44d];return _0x58d9b1;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});config[_0x155f('0xa')]=_[_0x155f('0xb')](config[_0x155f('0xa')],{'host':_0x155f('0xc'),'port':0x18eb});var socket=require(_0x155f('0xd'))(new Redis(config[_0x155f('0xa')]));require(_0x155f('0xe'))[_0x155f('0xf')](socket);function respondWithRpcPromise(_0x281c5a,_0x11c946,_0x39d85a){return new BPromise(function(_0x5b9e3b,_0x9fb9a){return client[_0x155f('0x10')](_0x281c5a,_0x39d85a)[_0x155f('0x11')](function(_0x3575d8){logger['info'](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));logger[_0x155f('0x14')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x11c946,'request\x20sent',JSON[_0x155f('0x15')](_0x3575d8));if(_0x3575d8[_0x155f('0x16')]){if(_0x3575d8[_0x155f('0x16')][_0x155f('0x17')]===0x1f4){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')]['message']);return _0x9fb9a(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}logger['error'](_0x155f('0x12'),_0x11c946,_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);return _0x5b9e3b(_0x3575d8[_0x155f('0x16')][_0x155f('0x18')]);}else{logger[_0x155f('0x19')](_0x155f('0x12'),_0x11c946,_0x155f('0x13'));_0x5b9e3b(_0x3575d8[_0x155f('0x1a')][_0x155f('0x18')]);}})[_0x155f('0x1b')](function(_0x3bdede){logger[_0x155f('0x16')](_0x155f('0x12'),_0x11c946,_0x3bdede);_0x9fb9a(_0x3bdede);});});} \ No newline at end of file +var _0xd523=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x80dea1,_0x51eaa0){var _0x3c9f74=function(_0x276688){while(--_0x276688){_0x80dea1['push'](_0x80dea1['shift']());}};_0x3c9f74(++_0x51eaa0);}(_0xd523,0x153));var _0x3d52=function(_0x160515,_0x233a55){_0x160515=_0x160515-0x0;var _0x27dfa1=_0xd523[_0x160515];return _0x27dfa1;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3d52('0xb')](config[_0x3d52('0xc')],{'host':_0x3d52('0xd'),'port':0x18eb});var socket=require(_0x3d52('0xe'))(new Redis(config[_0x3d52('0xc')]));require(_0x3d52('0xf'))[_0x3d52('0x10')](socket);function respondWithRpcPromise(_0x2d966e,_0x30ee09,_0x4a5a9a){return new BPromise(function(_0x46c2e6,_0x873de6){return client[_0x3d52('0x11')](_0x2d966e,_0x4a5a9a)[_0x3d52('0x12')](function(_0x2675d2){logger['info'](_0x3d52('0x13'),_0x30ee09,'request\x20sent');logger['debug'](_0x3d52('0x14'),_0x30ee09,_0x3d52('0x15'),JSON['stringify'](_0x2675d2));if(_0x2675d2['error']){if(_0x2675d2['error'][_0x3d52('0x16')]===0x1f4){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x873de6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x46c2e6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}else{logger[_0x3d52('0x19')](_0x3d52('0x13'),_0x30ee09,'request\x20sent');_0x46c2e6(_0x2675d2[_0x3d52('0x1a')][_0x3d52('0x18')]);}})[_0x3d52('0x1b')](function(_0x54a514){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x54a514);_0x873de6(_0x54a514);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 3240535..162b024 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 _0x6e16=['length','openchannelAccount:','remove','emit','register'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x6e16,0x1d3));var _0x66e1=function(_0x9d38b2,_0x30df2c){_0x9d38b2=_0x9d38b2-0x0;var _0x1735c6=_0x6e16[_0x9d38b2];return _0x1735c6;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x66e1('0x0'),'update'];function createListener(_0xac185,_0x4e3854){return function(_0x4f811b){_0x4e3854[_0x66e1('0x1')](_0xac185,_0x4f811b);};}function removeListener(_0x491345,_0x892e60){return function(){OpenchannelAccountEvents['removeListener'](_0x491345,_0x892e60);};}exports[_0x66e1('0x2')]=function(_0x204db8){for(var _0x3f95fa=0x0,_0x5d1175=events[_0x66e1('0x3')];_0x3f95fa<_0x5d1175;_0x3f95fa++){var _0x43b549=events[_0x3f95fa];var _0x257ecd=createListener(_0x66e1('0x4')+_0x43b549,_0x204db8);OpenchannelAccountEvents['on'](_0x43b549,_0x257ecd);}}; \ No newline at end of file +var _0x593e=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x2a1d99,_0x2da036){var _0x2d82a5=function(_0x524ca7){while(--_0x524ca7){_0x2a1d99['push'](_0x2a1d99['shift']());}};_0x2d82a5(++_0x2da036);}(_0x593e,0xcb));var _0xe593=function(_0x131bce,_0x44b2df){_0x131bce=_0x131bce-0x0;var _0x77091=_0x593e[_0x131bce];return _0x77091;};'use strict';var OpenchannelAccountEvents=require(_0xe593('0x0'));var events=[_0xe593('0x1'),_0xe593('0x2'),_0xe593('0x3')];function createListener(_0x43dabb,_0x184a6b){return function(_0x2c7c48){_0x184a6b[_0xe593('0x4')](_0x43dabb,_0x2c7c48);};}function removeListener(_0x550574,_0x8a87e8){return function(){OpenchannelAccountEvents[_0xe593('0x5')](_0x550574,_0x8a87e8);};}exports[_0xe593('0x6')]=function(_0x1e50d3){for(var _0x3b7082=0x0,_0x14cff3=events[_0xe593('0x7')];_0x3b7082<_0x14cff3;_0x3b7082++){var _0x307dad=events[_0x3b7082];var _0x169c08=createListener(_0xe593('0x8')+_0x307dad,_0x1e50d3);OpenchannelAccountEvents['on'](_0x307dad,_0x169c08);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ba18f51..c6e8109 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 _0x7908=['multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','delete','/:id','exports'];(function(_0x1d5029,_0x3b90dc){var _0x2d21e1=function(_0x230a1f){while(--_0x230a1f){_0x1d5029['push'](_0x1d5029['shift']());}};_0x2d21e1(++_0x3b90dc);}(_0x7908,0xd8));var _0x8790=function(_0x5905a9,_0x50331c){_0x5905a9=_0x5905a9-0x0;var _0x168ab5=_0x7908[_0x5905a9];return _0x168ab5;};'use strict';var multer=require(_0x8790('0x0'));var util=require('util');var path=require(_0x8790('0x1'));var timeout=require('connect-timeout');var express=require(_0x8790('0x2'));var router=express[_0x8790('0x3')]();var fs_extra=require(_0x8790('0x4'));var auth=require(_0x8790('0x5'));var interaction=require(_0x8790('0x6'));var config=require(_0x8790('0x7'));var controller=require('./openchannelApplication.controller');router[_0x8790('0x8')]('/',auth[_0x8790('0x9')](),controller[_0x8790('0xa')]);router['get']('/:id',auth[_0x8790('0x9')](),controller['show']);router[_0x8790('0xb')]('/',auth[_0x8790('0x9')](),controller[_0x8790('0xc')]);router[_0x8790('0xd')]('/:id',auth[_0x8790('0x9')](),controller[_0x8790('0xe')]);router[_0x8790('0xf')](_0x8790('0x10'),auth[_0x8790('0x9')](),controller['destroy']);module[_0x8790('0x11')]=router; \ No newline at end of file +var _0x5796=['put','update','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1b4c99,_0x5999cd){var _0x522e31=function(_0x4e08e3){while(--_0x4e08e3){_0x1b4c99['push'](_0x1b4c99['shift']());}};_0x522e31(++_0x5999cd);}(_0x5796,0x1f1));var _0x6579=function(_0x2877dd,_0x3f7153){_0x2877dd=_0x2877dd-0x0;var _0x5888b5=_0x5796[_0x2877dd];return _0x5888b5;};'use strict';var multer=require(_0x6579('0x0'));var util=require('util');var path=require(_0x6579('0x1'));var timeout=require(_0x6579('0x2'));var express=require('express');var router=express[_0x6579('0x3')]();var fs_extra=require(_0x6579('0x4'));var auth=require(_0x6579('0x5'));var interaction=require(_0x6579('0x6'));var config=require(_0x6579('0x7'));var controller=require(_0x6579('0x8'));router[_0x6579('0x9')]('/',auth[_0x6579('0xa')](),controller[_0x6579('0xb')]);router[_0x6579('0x9')](_0x6579('0xc'),auth[_0x6579('0xa')](),controller[_0x6579('0xd')]);router[_0x6579('0xe')]('/',auth['isAuthenticated'](),controller[_0x6579('0xf')]);router[_0x6579('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6579('0x11')]);router['delete'](_0x6579('0xc'),auth[_0x6579('0xa')](),controller[_0x6579('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index e5eb172..882e0b2 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 _0xf6dc=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x3b3edd,_0x32fd0a){var _0x284f03=function(_0x2e1e7a){while(--_0x2e1e7a){_0x3b3edd['push'](_0x3b3edd['shift']());}};_0x284f03(++_0x32fd0a);}(_0xf6dc,0x1bb));var _0xcf6d=function(_0x12e22b,_0x52f025){_0x12e22b=_0x12e22b-0x0;var _0x2a6eb8=_0xf6dc[_0x12e22b];return _0x2a6eb8;};'use strict';var Sequelize=require(_0xcf6d('0x0'));module[_0xcf6d('0x1')]={'priority':{'type':Sequelize[_0xcf6d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcf6d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xcf6d('0x4')]},'interval':{'type':Sequelize[_0xcf6d('0x4')],'defaultValue':_0xcf6d('0x5')}}; \ No newline at end of file +var _0x4883=['noop','TEXT','STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4883,0x166));var _0x3488=function(_0x8fc126,_0x299b51){_0x8fc126=_0x8fc126-0x0;var _0x14643a=_0x4883[_0x8fc126];return _0x14643a;};'use strict';var Sequelize=require(_0x3488('0x0'));module[_0x3488('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3488('0x2')},'appdata':{'type':Sequelize[_0x3488('0x3')]()},'description':{'type':Sequelize[_0x3488('0x4')]},'interval':{'type':Sequelize[_0x3488('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index a6dfbb2..612379e 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 _0x3f6b=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','include','rows','catch','show','params','includeAll','options','find','create','body','update','rimraf'];(function(_0x1f5d0e,_0x41e4c0){var _0x3240c3=function(_0x14be82){while(--_0x14be82){_0x1f5d0e['push'](_0x1f5d0e['shift']());}};_0x3240c3(++_0x41e4c0);}(_0x3f6b,0x8f));var _0xb3f6=function(_0x15b443,_0x3c5cfa){_0x15b443=_0x15b443-0x0;var _0x1fe008=_0x3f6b[_0x15b443];return _0x1fe008;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3f6('0x0'));var zipdir=require(_0xb3f6('0x1'));var jsonpatch=require(_0xb3f6('0x2'));var rp=require(_0xb3f6('0x3'));var moment=require(_0xb3f6('0x4'));var BPromise=require(_0xb3f6('0x5'));var Mustache=require(_0xb3f6('0x6'));var util=require(_0xb3f6('0x7'));var path=require(_0xb3f6('0x8'));var sox=require(_0xb3f6('0x9'));var csv=require(_0xb3f6('0xa'));var ejs=require(_0xb3f6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb3f6('0xc'));var jsforce=require(_0xb3f6('0xd'));var deskjs=require(_0xb3f6('0xe'));var toCsv=require(_0xb3f6('0xa'));var querystring=require(_0xb3f6('0xf'));var Papa=require(_0xb3f6('0x10'));var Redis=require(_0xb3f6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb3f6('0x12'));var as=require(_0xb3f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb3f6('0x14'));var config=require(_0xb3f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb3f6('0x16'))['db'];function respondWithStatusCode(_0x24bd15,_0x1428bf){_0x1428bf=_0x1428bf||0xcc;return function(_0x1d9071){if(_0x1d9071){return _0x24bd15[_0xb3f6('0x17')](_0x1428bf);}return _0x24bd15[_0xb3f6('0x18')](_0x1428bf)['end']();};}function respondWithResult(_0x45d524,_0x263f1d){_0x263f1d=_0x263f1d||0xc8;return function(_0xcb0b72){if(_0xcb0b72){return _0x45d524[_0xb3f6('0x18')](_0x263f1d)[_0xb3f6('0x19')](_0xcb0b72);}};}function respondWithFilteredResult(_0x5578bb,_0x124162){return function(_0x7d1908){if(_0x7d1908){var _0x4fa7bd=typeof _0x124162[_0xb3f6('0x1a')]===_0xb3f6('0x1b')&&typeof _0x124162[_0xb3f6('0x1c')]===_0xb3f6('0x1b');var _0x4da3ae=_0x7d1908[_0xb3f6('0x1d')];var _0x29384a=_0x4fa7bd?0x0:_0x124162[_0xb3f6('0x1a')];var _0x5f0bd6=_0x4fa7bd?_0x7d1908[_0xb3f6('0x1d')]:_0x124162[_0xb3f6('0x1a')]+_0x124162[_0xb3f6('0x1c')];var _0x7d903d;if(_0x5f0bd6>=_0x4da3ae){_0x5f0bd6=_0x4da3ae;_0x7d903d=0xc8;}else{_0x7d903d=0xce;}_0x5578bb[_0xb3f6('0x18')](_0x7d903d);return _0x5578bb[_0xb3f6('0x1e')](_0xb3f6('0x1f'),_0x29384a+'-'+_0x5f0bd6+'/'+_0x4da3ae)[_0xb3f6('0x19')](_0x7d1908);}return null;};}function patchUpdates(_0x4dbe78){return function(_0xa82f8d){try{jsonpatch[_0xb3f6('0x20')](_0xa82f8d,_0x4dbe78,!![]);}catch(_0x1fca48){return BPromise[_0xb3f6('0x21')](_0x1fca48);}return _0xa82f8d[_0xb3f6('0x22')]();};}function saveUpdates(_0x33989a,_0x1b0e28){return function(_0x2d4c38){if(_0x2d4c38){return _0x2d4c38['update'](_0x33989a)[_0xb3f6('0x23')](function(_0x268666){return _0x268666;});}return null;};}function removeEntity(_0x310b71,_0x4b3280){return function(_0x123412){if(_0x123412){return _0x123412[_0xb3f6('0x24')]()[_0xb3f6('0x23')](function(){_0x310b71['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f330d,_0x1866fa){return function(_0x342a90){if(!_0x342a90){_0x9f330d[_0xb3f6('0x17')](0x194);}return _0x342a90;};}function handleError(_0x2a519f,_0x340689){_0x340689=_0x340689||0x1f4;return function(_0x2a3279){logger['error'](_0x2a3279[_0xb3f6('0x25')]);if(_0x2a3279['name']){delete _0x2a3279[_0xb3f6('0x26')];}_0x2a519f[_0xb3f6('0x18')](_0x340689)[_0xb3f6('0x27')](_0x2a3279);};}exports['index']=function(_0x33110a,_0x443dbe){var _0x3cd144={},_0x16f653={},_0x31ba9d={'count':0x0,'rows':[]};var _0xc3bdd=_[_0xb3f6('0x28')](db[_0xb3f6('0x29')][_0xb3f6('0x2a')],function(_0x193f38){return{'name':_0x193f38[_0xb3f6('0x2b')],'type':_0x193f38[_0xb3f6('0x2c')][_0xb3f6('0x2d')]};});_0x16f653[_0xb3f6('0x2e')]=_[_0xb3f6('0x28')](_0xc3bdd,_0xb3f6('0x26'));_0x16f653[_0xb3f6('0x2f')]=_[_0xb3f6('0x30')](_0x33110a[_0xb3f6('0x2f')]);_0x16f653[_0xb3f6('0x31')]=_[_0xb3f6('0x32')](_0x16f653[_0xb3f6('0x2e')],_0x16f653[_0xb3f6('0x2f')]);_0x3cd144[_0xb3f6('0x33')]=_[_0xb3f6('0x32')](_0x16f653['model'],qs['fields'](_0x33110a[_0xb3f6('0x2f')][_0xb3f6('0x34')]));_0x3cd144[_0xb3f6('0x33')]=_0x3cd144[_0xb3f6('0x33')]['length']?_0x3cd144[_0xb3f6('0x33')]:_0x16f653[_0xb3f6('0x2e')];if(!_0x33110a['query'][_0xb3f6('0x35')](_0xb3f6('0x36'))){_0x3cd144[_0xb3f6('0x1c')]=qs['limit'](_0x33110a['query']['limit']);_0x3cd144[_0xb3f6('0x1a')]=qs[_0xb3f6('0x1a')](_0x33110a['query'][_0xb3f6('0x1a')]);}_0x3cd144[_0xb3f6('0x37')]=qs[_0xb3f6('0x38')](_0x33110a[_0xb3f6('0x2f')][_0xb3f6('0x38')]);_0x3cd144['where']=qs[_0xb3f6('0x31')](_['pick'](_0x33110a[_0xb3f6('0x2f')],_0x16f653[_0xb3f6('0x31')]),_0xc3bdd);if(_0x33110a['query'][_0xb3f6('0x39')]){_0x3cd144[_0xb3f6('0x3a')]=_['merge'](_0x3cd144['where'],{'$or':_[_0xb3f6('0x28')](_0xc3bdd,function(_0x270965){if(_0x270965[_0xb3f6('0x2c')]!==_0xb3f6('0x3b')){var _0x1679f0={};_0x1679f0[_0x270965['name']]={'$like':'%'+_0x33110a[_0xb3f6('0x2f')][_0xb3f6('0x39')]+'%'};return _0x1679f0;}})});}_0x3cd144=_[_0xb3f6('0x3c')]({},_0x3cd144,_0x33110a['options']);var _0x122484={'where':_0x3cd144['where']};return db[_0xb3f6('0x29')][_0xb3f6('0x1d')](_0x122484)[_0xb3f6('0x23')](function(_0x538f7a){_0x31ba9d[_0xb3f6('0x1d')]=_0x538f7a;if(_0x33110a[_0xb3f6('0x2f')]['includeAll']){_0x3cd144[_0xb3f6('0x3d')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x3cd144);})[_0xb3f6('0x23')](function(_0x2b3562){_0x31ba9d[_0xb3f6('0x3e')]=_0x2b3562;return _0x31ba9d;})[_0xb3f6('0x23')](respondWithFilteredResult(_0x443dbe,_0x3cd144))[_0xb3f6('0x3f')](handleError(_0x443dbe,null));};exports[_0xb3f6('0x40')]=function(_0x522498,_0x3e7514){var _0x44f5af={'raw':!![],'where':{'id':_0x522498[_0xb3f6('0x41')]['id']}},_0x587df2={};_0x587df2[_0xb3f6('0x2e')]=_['keys'](db['OpenchannelApplication'][_0xb3f6('0x2a')]);_0x587df2[_0xb3f6('0x2f')]=_[_0xb3f6('0x30')](_0x522498[_0xb3f6('0x2f')]);_0x587df2[_0xb3f6('0x31')]=_[_0xb3f6('0x32')](_0x587df2[_0xb3f6('0x2e')],_0x587df2[_0xb3f6('0x2f')]);_0x44f5af['attributes']=_[_0xb3f6('0x32')](_0x587df2[_0xb3f6('0x2e')],qs['fields'](_0x522498['query'][_0xb3f6('0x34')]));_0x44f5af[_0xb3f6('0x33')]=_0x44f5af['attributes']['length']?_0x44f5af[_0xb3f6('0x33')]:_0x587df2[_0xb3f6('0x2e')];if(_0x522498[_0xb3f6('0x2f')][_0xb3f6('0x42')]){_0x44f5af[_0xb3f6('0x3d')]=[{'all':!![]}];}_0x44f5af=_[_0xb3f6('0x3c')]({},_0x44f5af,_0x522498[_0xb3f6('0x43')]);return db[_0xb3f6('0x29')][_0xb3f6('0x44')](_0x44f5af)[_0xb3f6('0x23')](handleEntityNotFound(_0x3e7514,null))[_0xb3f6('0x23')](respondWithResult(_0x3e7514,null))[_0xb3f6('0x3f')](handleError(_0x3e7514,null));};exports[_0xb3f6('0x45')]=function(_0x2cca61,_0x16b072){return db[_0xb3f6('0x29')]['create'](_0x2cca61[_0xb3f6('0x46')],{})[_0xb3f6('0x23')](respondWithResult(_0x16b072,0xc9))[_0xb3f6('0x3f')](handleError(_0x16b072,null));};exports[_0xb3f6('0x47')]=function(_0x5e117d,_0x5c18ef){if(_0x5e117d['body']['id']){delete _0x5e117d[_0xb3f6('0x46')]['id'];}return db['OpenchannelApplication'][_0xb3f6('0x44')]({'where':{'id':_0x5e117d['params']['id']}})['then'](handleEntityNotFound(_0x5c18ef,null))[_0xb3f6('0x23')](saveUpdates(_0x5e117d[_0xb3f6('0x46')],null))[_0xb3f6('0x23')](respondWithResult(_0x5c18ef,null))[_0xb3f6('0x3f')](handleError(_0x5c18ef,null));};exports[_0xb3f6('0x24')]=function(_0x5de120,_0x30e308){return db[_0xb3f6('0x29')][_0xb3f6('0x44')]({'where':{'id':_0x5de120[_0xb3f6('0x41')]['id']}})[_0xb3f6('0x23')](handleEntityNotFound(_0x30e308,null))[_0xb3f6('0x23')](removeEntity(_0x30e308,null))[_0xb3f6('0x3f')](handleError(_0x30e308,null));}; \ No newline at end of file +var _0x3e74=['create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','OpenchannelApplication','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find'];(function(_0x26cdac,_0x569ff1){var _0x39d56e=function(_0x46b91a){while(--_0x46b91a){_0x26cdac['push'](_0x26cdac['shift']());}};_0x39d56e(++_0x569ff1);}(_0x3e74,0x1ca));var _0x43e7=function(_0x3c587d,_0x1b4853){_0x3c587d=_0x3c587d-0x0;var _0x726ea6=_0x3e74[_0x3c587d];return _0x726ea6;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43e7('0x3'));var moment=require(_0x43e7('0x4'));var BPromise=require(_0x43e7('0x5'));var Mustache=require(_0x43e7('0x6'));var util=require(_0x43e7('0x7'));var path=require(_0x43e7('0x8'));var sox=require(_0x43e7('0x9'));var csv=require(_0x43e7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43e7('0xb'));var _=require(_0x43e7('0xc'));var squel=require(_0x43e7('0xd'));var crypto=require(_0x43e7('0xe'));var jsforce=require(_0x43e7('0xf'));var deskjs=require(_0x43e7('0x10'));var toCsv=require(_0x43e7('0xa'));var querystring=require(_0x43e7('0x11'));var Papa=require('papaparse');var Redis=require(_0x43e7('0x12'));var authService=require(_0x43e7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x43e7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x15'))(_0x43e7('0x16'));var utils=require('../../config/utils');var config=require(_0x43e7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x550198,_0x4337f1){_0x4337f1=_0x4337f1||0xcc;return function(_0x2d9719){if(_0x2d9719){return _0x550198[_0x43e7('0x18')](_0x4337f1);}return _0x550198['status'](_0x4337f1)[_0x43e7('0x19')]();};}function respondWithResult(_0x512f73,_0x504f83){_0x504f83=_0x504f83||0xc8;return function(_0x3de638){if(_0x3de638){return _0x512f73[_0x43e7('0x1a')](_0x504f83)[_0x43e7('0x1b')](_0x3de638);}};}function respondWithFilteredResult(_0x5cab2d,_0x4fb6b3){return function(_0x43ca70){if(_0x43ca70){var _0x2995cb=typeof _0x4fb6b3['offset']===_0x43e7('0x1c')&&typeof _0x4fb6b3[_0x43e7('0x1d')]===_0x43e7('0x1c');var _0x813c8e=_0x43ca70[_0x43e7('0x1e')];var _0x172c04=_0x2995cb?0x0:_0x4fb6b3[_0x43e7('0x1f')];var _0x562fe6=_0x2995cb?_0x43ca70[_0x43e7('0x1e')]:_0x4fb6b3['offset']+_0x4fb6b3[_0x43e7('0x1d')];var _0x2a05b1;if(_0x562fe6>=_0x813c8e){_0x562fe6=_0x813c8e;_0x2a05b1=0xc8;}else{_0x2a05b1=0xce;}_0x5cab2d['status'](_0x2a05b1);return _0x5cab2d[_0x43e7('0x20')](_0x43e7('0x21'),_0x172c04+'-'+_0x562fe6+'/'+_0x813c8e)[_0x43e7('0x1b')](_0x43ca70);}return null;};}function patchUpdates(_0x588b1e){return function(_0x107576){try{jsonpatch[_0x43e7('0x22')](_0x107576,_0x588b1e,!![]);}catch(_0x21b891){return BPromise[_0x43e7('0x23')](_0x21b891);}return _0x107576[_0x43e7('0x24')]();};}function saveUpdates(_0x26f6ff,_0x1d440c){return function(_0x1f59c2){if(_0x1f59c2){return _0x1f59c2[_0x43e7('0x25')](_0x26f6ff)['then'](function(_0x57134c){return _0x57134c;});}return null;};}function removeEntity(_0x507002,_0x3970e9){return function(_0x3d9ef1){if(_0x3d9ef1){return _0x3d9ef1[_0x43e7('0x26')]()[_0x43e7('0x27')](function(){_0x507002['status'](0xcc)[_0x43e7('0x19')]();});}};}function handleEntityNotFound(_0x5ce725,_0x24af81){return function(_0x3ca0a2){if(!_0x3ca0a2){_0x5ce725['sendStatus'](0x194);}return _0x3ca0a2;};}function handleError(_0x2d4f89,_0x196684){_0x196684=_0x196684||0x1f4;return function(_0xf1dab){logger[_0x43e7('0x28')](_0xf1dab[_0x43e7('0x29')]);if(_0xf1dab[_0x43e7('0x2a')]){delete _0xf1dab['name'];}_0x2d4f89[_0x43e7('0x1a')](_0x196684)['send'](_0xf1dab);};}exports[_0x43e7('0x2b')]=function(_0x35a7c9,_0x591bef){var _0x30da81={},_0x546e0d={},_0xf69c38={'count':0x0,'rows':[]};var _0x58a28b=_['map'](db[_0x43e7('0x2c')][_0x43e7('0x2d')],function(_0x39f429){return{'name':_0x39f429[_0x43e7('0x2e')],'type':_0x39f429[_0x43e7('0x2f')]['key']};});_0x546e0d[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x58a28b,_0x43e7('0x2a'));_0x546e0d['query']=_['keys'](_0x35a7c9[_0x43e7('0x32')]);_0x546e0d[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x546e0d[_0x43e7('0x30')],_0x546e0d[_0x43e7('0x32')]);_0x30da81['attributes']=_[_0x43e7('0x34')](_0x546e0d[_0x43e7('0x30')],qs['fields'](_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x35')]));_0x30da81['attributes']=_0x30da81['attributes'][_0x43e7('0x36')]?_0x30da81[_0x43e7('0x37')]:_0x546e0d[_0x43e7('0x30')];if(!_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x38')](_0x43e7('0x39'))){_0x30da81['limit']=qs['limit'](_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x1d')]);_0x30da81[_0x43e7('0x1f')]=qs[_0x43e7('0x1f')](_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x1f')]);}_0x30da81[_0x43e7('0x3a')]=qs['sort'](_0x35a7c9['query'][_0x43e7('0x3b')]);_0x30da81[_0x43e7('0x3c')]=qs[_0x43e7('0x33')](_[_0x43e7('0x3d')](_0x35a7c9[_0x43e7('0x32')],_0x546e0d[_0x43e7('0x33')]),_0x58a28b);if(_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x3e')]){_0x30da81[_0x43e7('0x3c')]=_[_0x43e7('0x3f')](_0x30da81[_0x43e7('0x3c')],{'$or':_[_0x43e7('0x31')](_0x58a28b,function(_0x51cba1){if(_0x51cba1[_0x43e7('0x2f')]!==_0x43e7('0x40')){var _0x5a5cde={};_0x5a5cde[_0x51cba1['name']]={'$like':'%'+_0x35a7c9[_0x43e7('0x32')][_0x43e7('0x3e')]+'%'};return _0x5a5cde;}})});}_0x30da81=_[_0x43e7('0x3f')]({},_0x30da81,_0x35a7c9[_0x43e7('0x41')]);var _0x18a942={'where':_0x30da81[_0x43e7('0x3c')]};return db[_0x43e7('0x2c')]['count'](_0x18a942)['then'](function(_0x5b1223){_0xf69c38[_0x43e7('0x1e')]=_0x5b1223;if(_0x35a7c9['query'][_0x43e7('0x42')]){_0x30da81[_0x43e7('0x43')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x30da81);})[_0x43e7('0x27')](function(_0x13ca12){_0xf69c38[_0x43e7('0x44')]=_0x13ca12;return _0xf69c38;})[_0x43e7('0x27')](respondWithFilteredResult(_0x591bef,_0x30da81))[_0x43e7('0x45')](handleError(_0x591bef,null));};exports[_0x43e7('0x46')]=function(_0x2070a3,_0x11aa86){var _0x5032bc={'raw':!![],'where':{'id':_0x2070a3[_0x43e7('0x47')]['id']}},_0x51f130={};_0x51f130[_0x43e7('0x30')]=_[_0x43e7('0x48')](db[_0x43e7('0x2c')][_0x43e7('0x2d')]);_0x51f130[_0x43e7('0x32')]=_[_0x43e7('0x48')](_0x2070a3[_0x43e7('0x32')]);_0x51f130['filters']=_['intersection'](_0x51f130['model'],_0x51f130['query']);_0x5032bc['attributes']=_[_0x43e7('0x34')](_0x51f130[_0x43e7('0x30')],qs[_0x43e7('0x35')](_0x2070a3[_0x43e7('0x32')]['fields']));_0x5032bc[_0x43e7('0x37')]=_0x5032bc[_0x43e7('0x37')][_0x43e7('0x36')]?_0x5032bc['attributes']:_0x51f130[_0x43e7('0x30')];if(_0x2070a3['query'][_0x43e7('0x42')]){_0x5032bc[_0x43e7('0x43')]=[{'all':!![]}];}_0x5032bc=_['merge']({},_0x5032bc,_0x2070a3[_0x43e7('0x41')]);return db['OpenchannelApplication'][_0x43e7('0x49')](_0x5032bc)[_0x43e7('0x27')](handleEntityNotFound(_0x11aa86,null))[_0x43e7('0x27')](respondWithResult(_0x11aa86,null))['catch'](handleError(_0x11aa86,null));};exports[_0x43e7('0x4a')]=function(_0x26f42f,_0x4715f1){return db[_0x43e7('0x2c')]['create'](_0x26f42f[_0x43e7('0x4b')],{})[_0x43e7('0x27')](respondWithResult(_0x4715f1,0xc9))[_0x43e7('0x45')](handleError(_0x4715f1,null));};exports[_0x43e7('0x25')]=function(_0x1b91ed,_0x3b0fb1){if(_0x1b91ed[_0x43e7('0x4b')]['id']){delete _0x1b91ed[_0x43e7('0x4b')]['id'];}return db[_0x43e7('0x2c')]['find']({'where':{'id':_0x1b91ed['params']['id']}})['then'](handleEntityNotFound(_0x3b0fb1,null))[_0x43e7('0x27')](saveUpdates(_0x1b91ed[_0x43e7('0x4b')],null))[_0x43e7('0x27')](respondWithResult(_0x3b0fb1,null))[_0x43e7('0x45')](handleError(_0x3b0fb1,null));};exports[_0x43e7('0x26')]=function(_0x50f1f4,_0xf05ea6){return db[_0x43e7('0x2c')][_0x43e7('0x49')]({'where':{'id':_0x50f1f4['params']['id']}})[_0x43e7('0x27')](handleEntityNotFound(_0xf05ea6,null))[_0x43e7('0x27')](removeEntity(_0xf05ea6,null))['catch'](handleError(_0xf05ea6,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 13724fa..492b8f5 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 _0x06a6=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x06a6,0xc9));var _0x606a=function(_0x40f696,_0x4e9e1a){_0x40f696=_0x40f696-0x0;var _0x126fc6=_0x06a6[_0x40f696];return _0x126fc6;};'use strict';var _=require(_0x606a('0x0'));var util=require(_0x606a('0x1'));var logger=require(_0x606a('0x2'))(_0x606a('0x3'));var moment=require(_0x606a('0x4'));var BPromise=require('bluebird');var rp=require(_0x606a('0x5'));var fs=require('fs');var path=require(_0x606a('0x6'));var rimraf=require(_0x606a('0x7'));var config=require(_0x606a('0x8'));var attributes=require(_0x606a('0x9'));module[_0x606a('0xa')]=function(_0x1089aa,_0x419f7e){return _0x1089aa[_0x606a('0xb')](_0x606a('0xc'),attributes,{'tableName':_0x606a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x606a('0xe')});}; \ No newline at end of file +var _0xcd61=['rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise'];(function(_0x392e3e,_0x386f17){var _0xe331fa=function(_0x55e2b4){while(--_0x55e2b4){_0x392e3e['push'](_0x392e3e['shift']());}};_0xe331fa(++_0x386f17);}(_0xcd61,0x170));var _0x1cd6=function(_0x335ea9,_0x1e7ea8){_0x335ea9=_0x335ea9-0x0;var _0x18864c=_0xcd61[_0x335ea9];return _0x18864c;};'use strict';var _=require('lodash');var util=require(_0x1cd6('0x0'));var logger=require(_0x1cd6('0x1'))('api');var moment=require(_0x1cd6('0x2'));var BPromise=require('bluebird');var rp=require(_0x1cd6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1cd6('0x4'));var config=require(_0x1cd6('0x5'));var attributes=require(_0x1cd6('0x6'));module['exports']=function(_0x373662,_0x1ae205){return _0x373662[_0x1cd6('0x7')](_0x1cd6('0x8'),attributes,{'tableName':_0x1cd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1cd6('0xa'),'collate':_0x1cd6('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index da90960..d691f82 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 _0xf79c=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf79c,0xeb));var _0xcf79=function(_0x2335e6,_0x1bade8){_0x2335e6=_0x2335e6-0x0;var _0x370a50=_0xf79c[_0x2335e6];return _0x370a50;};'use strict';var _=require(_0xcf79('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf79('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf79('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf79('0x3'));var logger=require(_0xcf79('0x4'))(_0xcf79('0x5'));var config=require(_0xcf79('0x6'));var jayson=require(_0xcf79('0x7'));var client=jayson[_0xcf79('0x8')][_0xcf79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49280e,_0x52e07b,_0x12bfc2){return new BPromise(function(_0x3bc44a,_0x379b71){return client['request'](_0x49280e,_0x12bfc2)[_0xcf79('0xa')](function(_0x3bca00){logger[_0xcf79('0xb')](_0xcf79('0xc'),_0x52e07b,_0xcf79('0xd'));logger[_0xcf79('0xe')](_0xcf79('0xf'),_0x52e07b,_0xcf79('0xd'),JSON[_0xcf79('0x10')](_0x3bca00));if(_0x3bca00[_0xcf79('0x11')]){if(_0x3bca00[_0xcf79('0x11')][_0xcf79('0x12')]===0x1f4){logger[_0xcf79('0x11')](_0xcf79('0xc'),_0x52e07b,_0x3bca00[_0xcf79('0x11')][_0xcf79('0x13')]);return _0x379b71(_0x3bca00['error'][_0xcf79('0x13')]);}logger[_0xcf79('0x11')](_0xcf79('0xc'),_0x52e07b,_0x3bca00[_0xcf79('0x11')]['message']);return _0x3bc44a(_0x3bca00[_0xcf79('0x11')][_0xcf79('0x13')]);}else{logger[_0xcf79('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x52e07b,_0xcf79('0xd'));_0x3bc44a(_0x3bca00[_0xcf79('0x14')]['message']);}})['catch'](function(_0x43f37c){logger[_0xcf79('0x11')](_0xcf79('0xc'),_0x52e07b,_0x43f37c);_0x379b71(_0x43f37c);});});}exports[_0xcf79('0x15')]=function(_0x4cca2b){var _0x2371fc=this;return new Promise(function(_0x1b50a0,_0x26768d){return db[_0xcf79('0x16')][_0xcf79('0x17')](_0x4cca2b[_0xcf79('0x18')],{'raw':_0x4cca2b['options']?_0x4cca2b[_0xcf79('0x19')][_0xcf79('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cca2b['options']?_0x4cca2b[_0xcf79('0x19')][_0xcf79('0x1b')]||null:null,'attributes':_0x4cca2b['options']?_0x4cca2b['options'][_0xcf79('0x1c')]||null:null,'limit':_0x4cca2b[_0xcf79('0x19')]?_0x4cca2b[_0xcf79('0x19')][_0xcf79('0x1d')]||null:null})[_0xcf79('0xa')](function(_0x445a1f){logger[_0xcf79('0xb')](_0xcf79('0x15'),_0x4cca2b);logger['debug'](_0xcf79('0x15'),_0x4cca2b,JSON[_0xcf79('0x10')](_0x445a1f));_0x1b50a0(_0x445a1f);})[_0xcf79('0x1e')](function(_0x1a5813){logger[_0xcf79('0x11')](_0xcf79('0x15'),_0x1a5813[_0xcf79('0x13')],_0x4cca2b);_0x26768d(_0x2371fc[_0xcf79('0x11')](0x1f4,_0x1a5813['message']));});});}; \ No newline at end of file +var _0xf143=['debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','attributes','limit','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x3008b7,_0x461f37){var _0x3d6720=function(_0x3feae6){while(--_0x3feae6){_0x3008b7['push'](_0x3008b7['shift']());}};_0x3d6720(++_0x461f37);}(_0xf143,0x1b4));var _0x3f14=function(_0xa911e,_0x1a9f9a){_0xa911e=_0xa911e-0x0;var _0x28bd6f=_0xf143[_0xa911e];return _0x28bd6f;};'use strict';var _=require(_0x3f14('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3f14('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f14('0x2'))['db'];var utils=require(_0x3f14('0x3'));var logger=require(_0x3f14('0x4'))(_0x3f14('0x5'));var config=require(_0x3f14('0x6'));var jayson=require(_0x3f14('0x7'));var client=jayson[_0x3f14('0x8')][_0x3f14('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54c91e,_0x713f9c,_0x1f697c){return new BPromise(function(_0x415f84,_0x18d143){return client[_0x3f14('0xa')](_0x54c91e,_0x1f697c)[_0x3f14('0xb')](function(_0x583989){logger[_0x3f14('0xc')](_0x3f14('0xd'),_0x713f9c,'request\x20sent');logger[_0x3f14('0xe')](_0x3f14('0xf'),_0x713f9c,_0x3f14('0x10'),JSON[_0x3f14('0x11')](_0x583989));if(_0x583989[_0x3f14('0x12')]){if(_0x583989[_0x3f14('0x12')][_0x3f14('0x13')]===0x1f4){logger[_0x3f14('0x12')](_0x3f14('0xd'),_0x713f9c,_0x583989[_0x3f14('0x12')]['message']);return _0x18d143(_0x583989[_0x3f14('0x12')][_0x3f14('0x14')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x713f9c,_0x583989[_0x3f14('0x12')][_0x3f14('0x14')]);return _0x415f84(_0x583989['error']['message']);}else{logger[_0x3f14('0xc')](_0x3f14('0xd'),_0x713f9c,'request\x20sent');_0x415f84(_0x583989[_0x3f14('0x15')][_0x3f14('0x14')]);}})[_0x3f14('0x16')](function(_0x5b0bad){logger[_0x3f14('0x12')](_0x3f14('0xd'),_0x713f9c,_0x5b0bad);_0x18d143(_0x5b0bad);});});}exports[_0x3f14('0x17')]=function(_0x30082e){var _0xb7888f=this;return new Promise(function(_0x157f3e,_0x42538d){return db[_0x3f14('0x18')][_0x3f14('0x19')](_0x30082e['body'],{'raw':_0x30082e[_0x3f14('0x1a')]?_0x30082e[_0x3f14('0x1a')][_0x3f14('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30082e[_0x3f14('0x1a')]?_0x30082e[_0x3f14('0x1a')]['where']||null:null,'attributes':_0x30082e[_0x3f14('0x1a')]?_0x30082e['options'][_0x3f14('0x1c')]||null:null,'limit':_0x30082e['options']?_0x30082e['options'][_0x3f14('0x1d')]||null:null})[_0x3f14('0xb')](function(_0x4b74bc){logger[_0x3f14('0xc')](_0x3f14('0x17'),_0x30082e);logger[_0x3f14('0xe')](_0x3f14('0x17'),_0x30082e,JSON['stringify'](_0x4b74bc));_0x157f3e(_0x4b74bc);})[_0x3f14('0x16')](function(_0x13e019){logger['error'](_0x3f14('0x17'),_0x13e019[_0x3f14('0x14')],_0x30082e);_0x42538d(_0xb7888f['error'](0x1f4,_0x13e019[_0x3f14('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 50957ff..555143f 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 _0x9c22=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports'];(function(_0x3c5ca4,_0x3abbde){var _0x375f82=function(_0x291b8d){while(--_0x291b8d){_0x3c5ca4['push'](_0x3c5ca4['shift']());}};_0x375f82(++_0x3abbde);}(_0x9c22,0x117));var _0x29c2=function(_0x48d2f9,_0x2e4981){_0x48d2f9=_0x48d2f9-0x0;var _0x2d9527=_0x9c22[_0x48d2f9];return _0x2d9527;};'use strict';var multer=require(_0x29c2('0x0'));var util=require(_0x29c2('0x1'));var path=require(_0x29c2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x29c2('0x3'));var auth=require(_0x29c2('0x4'));var interaction=require(_0x29c2('0x5'));var config=require(_0x29c2('0x6'));var controller=require(_0x29c2('0x7'));router[_0x29c2('0x8')]('/',auth[_0x29c2('0x9')](),controller[_0x29c2('0xa')]);router[_0x29c2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x29c2('0xb')]);router[_0x29c2('0x8')]('/:id',auth[_0x29c2('0x9')](),controller['show']);router['get']('/:id/messages',auth[_0x29c2('0x9')](),controller['getMessages']);router[_0x29c2('0x8')](_0x29c2('0xc'),auth['isAuthenticated'](),controller[_0x29c2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x29c2('0xe')]);router[_0x29c2('0xf')](_0x29c2('0x10'),auth[_0x29c2('0x9')](),controller[_0x29c2('0x11')]);router['post'](_0x29c2('0x12'),auth[_0x29c2('0x9')](),interaction[_0x29c2('0x13')](_0x29c2('0x14'),_0x29c2('0x15')),controller[_0x29c2('0x16')]);router[_0x29c2('0x17')](_0x29c2('0x18'),auth[_0x29c2('0x9')](),interaction[_0x29c2('0x13')](_0x29c2('0x14'),_0x29c2('0x19')),controller['update']);router[_0x29c2('0x1a')](_0x29c2('0x18'),auth[_0x29c2('0x9')](),interaction['tracked'](_0x29c2('0x14'),_0x29c2('0x1b')),controller[_0x29c2('0x1c')]);router['delete']('/:id/tags',auth[_0x29c2('0x9')](),controller[_0x29c2('0x1d')]);module[_0x29c2('0x1e')]=router; \ No newline at end of file +var _0xb85f=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','describe','/:id','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','multer','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb85f,0x166));var _0xfb85=function(_0x4e5333,_0x3f8eb6){_0x4e5333=_0x4e5333-0x0;var _0x4f4e2e=_0xb85f[_0x4e5333];return _0x4f4e2e;};'use strict';var multer=require(_0xfb85('0x0'));var util=require(_0xfb85('0x1'));var path=require('path');var timeout=require(_0xfb85('0x2'));var express=require(_0xfb85('0x3'));var router=express[_0xfb85('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfb85('0x5'));var config=require(_0xfb85('0x6'));var controller=require(_0xfb85('0x7'));router['get']('/',auth[_0xfb85('0x8')](),controller[_0xfb85('0x9')]);router[_0xfb85('0xa')]('/describe',auth[_0xfb85('0x8')](),controller[_0xfb85('0xb')]);router[_0xfb85('0xa')](_0xfb85('0xc'),auth[_0xfb85('0x8')](),controller[_0xfb85('0xd')]);router['get']('/:id/messages',auth[_0xfb85('0x8')](),controller[_0xfb85('0xe')]);router[_0xfb85('0xa')](_0xfb85('0xf'),auth[_0xfb85('0x8')](),controller[_0xfb85('0x10')]);router[_0xfb85('0x11')]('/',auth[_0xfb85('0x8')](),controller['create']);router[_0xfb85('0x11')]('/:id/messages',auth[_0xfb85('0x8')](),controller[_0xfb85('0x12')]);router[_0xfb85('0x11')](_0xfb85('0x13'),auth[_0xfb85('0x8')](),interaction[_0xfb85('0x14')](_0xfb85('0x15'),_0xfb85('0x16')),controller[_0xfb85('0x17')]);router['put'](_0xfb85('0xc'),auth[_0xfb85('0x8')](),interaction[_0xfb85('0x14')](_0xfb85('0x15'),_0xfb85('0x18')),controller[_0xfb85('0x19')]);router['delete']('/:id',auth[_0xfb85('0x8')](),interaction['tracked'](_0xfb85('0x15'),_0xfb85('0x1a')),controller[_0xfb85('0x1b')]);router[_0xfb85('0x1c')]('/:id/tags',auth[_0xfb85('0x8')](),controller[_0xfb85('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 07ebcb9..bce7ec1 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 _0x14ee=['BOOLEAN','sequelize','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14ee,0x115));var _0xe14e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x14ee[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe14e('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe14e('0x1')]},'disposition':{'type':Sequelize[_0xe14e('0x2')]},'secondDisposition':{'type':Sequelize[_0xe14e('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe14e('0x2')]},'note':{'type':Sequelize[_0xe14e('0x2')]},'read1stAt':{'type':Sequelize[_0xe14e('0x1')]},'threadId':{'type':Sequelize[_0xe14e('0x2')]},'externalUrl':{'type':Sequelize[_0xe14e('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe14e('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xe14e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x43e7=['STRING','DATE','ENUM','sequelize','BOOLEAN'];(function(_0x4c8890,_0x34c779){var _0x2e7ed5=function(_0x6ba2c6){while(--_0x6ba2c6){_0x4c8890['push'](_0x4c8890['shift']());}};_0x2e7ed5(++_0x34c779);}(_0x43e7,0xda));var _0x743e=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0x43e7[_0x193e28];return _0x20ef59;};'use strict';var Sequelize=require(_0x743e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x743e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x743e('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x743e('0x3')]},'threadId':{'type':Sequelize[_0x743e('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x743e('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x743e('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 9d62b46..6bd6781 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 _0x5679=['renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','Users','map','fullname','TagIds','forEach','Tags','catch','waiting','unmanaged','total','closed','UserId','talking','answered','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','ui.OpenchannelInteractionId','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','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','split','ContactId','buildExpression','text','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','some','compact','isEmpty','OpenchannelAccountId','where','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','a.key','Account.key','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','include','merge','options','body','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','files','tmp','server','attachments','transcript-%d-%s.zip','push','User','CmContact','firstName','Attachment','Messages','createdAt','direction','secret','Owner','get','mkdirSync','Account','threadId','basename','existsSync','pipe','createWriteStream','System','lastName','out'];(function(_0x45cf76,_0x5789fa){var _0x57d6ce=function(_0x21bbf5){while(--_0x21bbf5){_0x45cf76['push'](_0x45cf76['shift']());}};_0x57d6ce(++_0x5789fa);}(_0x5679,0x1eb));var _0x9567=function(_0x11b382,_0x517d49){_0x11b382=_0x11b382-0x0;var _0x12f989=_0x5679[_0x11b382];return _0x12f989;};'use strict';var emlformat=require(_0x9567('0x0'));var rimraf=require(_0x9567('0x1'));var zipdir=require(_0x9567('0x2'));var jsonpatch=require(_0x9567('0x3'));var rp=require(_0x9567('0x4'));var moment=require(_0x9567('0x5'));var BPromise=require(_0x9567('0x6'));var Mustache=require('mustache');var util=require(_0x9567('0x7'));var path=require(_0x9567('0x8'));var sox=require(_0x9567('0x9'));var csv=require('to-csv');var ejs=require(_0x9567('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9567('0xb'));var squel=require(_0x9567('0xc'));var crypto=require(_0x9567('0xd'));var jsforce=require(_0x9567('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9567('0xf'));var querystring=require('querystring');var Papa=require(_0x9567('0x10'));var Redis=require(_0x9567('0x11'));var authService=require(_0x9567('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9567('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x9567('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x9567('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9567('0x16'));var db=require(_0x9567('0x17'))['db'];config[_0x9567('0x18')]=_[_0x9567('0x19')](config['redis'],{'host':_0x9567('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9567('0x18')]));require(_0x9567('0x1b'))[_0x9567('0x1c')](socket);function respondWithStatusCode(_0x17db04,_0x393f5d){_0x393f5d=_0x393f5d||0xcc;return function(_0x485be5){if(_0x485be5){return _0x17db04[_0x9567('0x1d')](_0x393f5d);}return _0x17db04[_0x9567('0x1e')](_0x393f5d)['end']();};}function respondWithResult(_0x2098c8,_0x414f4a){_0x414f4a=_0x414f4a||0xc8;return function(_0x51d9a9){if(_0x51d9a9){return _0x2098c8['status'](_0x414f4a)[_0x9567('0x1f')](_0x51d9a9);}};}function respondWithFilteredResult(_0x1c39a0,_0x27e18c){return function(_0x47a867){if(_0x47a867){var _0x43c0f8=typeof _0x27e18c[_0x9567('0x20')]===_0x9567('0x21')&&typeof _0x27e18c[_0x9567('0x22')]==='undefined';var _0x22e99d=_0x47a867[_0x9567('0x23')];var _0x4e875a=_0x43c0f8?0x0:_0x27e18c[_0x9567('0x20')];var _0x4466fd=_0x43c0f8?_0x47a867['count']:_0x27e18c[_0x9567('0x20')]+_0x27e18c[_0x9567('0x22')];var _0xe87541;if(_0x4466fd>=_0x22e99d){_0x4466fd=_0x22e99d;_0xe87541=0xc8;}else{_0xe87541=0xce;}_0x1c39a0['status'](_0xe87541);return _0x1c39a0[_0x9567('0x24')]('Content-Range',_0x4e875a+'-'+_0x4466fd+'/'+_0x22e99d)[_0x9567('0x1f')](_0x47a867);}return null;};}function patchUpdates(_0x11a45a){return function(_0x3824b0){try{jsonpatch[_0x9567('0x25')](_0x3824b0,_0x11a45a,!![]);}catch(_0xa5cfd3){return BPromise[_0x9567('0x26')](_0xa5cfd3);}return _0x3824b0[_0x9567('0x27')]();};}function saveUpdates(_0x361228,_0x784ede){return function(_0x1fe8a6){if(_0x1fe8a6){return _0x1fe8a6[_0x9567('0x28')](_0x361228)[_0x9567('0x29')](function(_0x2ce982){return _0x2ce982;});}return null;};}function removeEntity(_0x24b658,_0x126e67){return function(_0x50dc83){if(_0x50dc83){return _0x50dc83[_0x9567('0x2a')]()[_0x9567('0x29')](function(){_0x24b658[_0x9567('0x1e')](0xcc)[_0x9567('0x2b')]();});}};}function handleEntityNotFound(_0x7d2b14,_0x3b73ef){return function(_0x19ee92){if(!_0x19ee92){_0x7d2b14['sendStatus'](0x194);}return _0x19ee92;};}function handleError(_0x24f6e9,_0x4a7f05){_0x4a7f05=_0x4a7f05||0x1f4;return function(_0x2040cd){logger[_0x9567('0x2c')](_0x2040cd[_0x9567('0x2d')]);if(_0x2040cd[_0x9567('0x2e')]){delete _0x2040cd[_0x9567('0x2e')];}_0x24f6e9[_0x9567('0x1e')](_0x4a7f05)['send'](_0x2040cd);};}function getInteractionUsers(_0x2e3363,_0x1a1725){return new BPromise(function(_0x5bb90f,_0x5b178b){try{if(_0x1a1725[_0x2e3363['id']]){_0x2e3363[_0x9567('0x2f')]=_[_0x9567('0x30')](_0x1a1725[_0x2e3363['id']],function(_0x226a0f){return{'id':_0x226a0f['id'],'fullname':_0x226a0f[_0x9567('0x31')]};});}}catch(_0x58001b){_0x5b178b(_0x58001b);}_0x5bb90f(_0x2e3363);});}function getInteractionTags(_0x2ad68f,_0xa19e74){return new BPromise(function(_0x2ec67e,_0x5e231f){try{if(_0x2ad68f[_0x9567('0x32')]){_0x2ad68f['Tags']=[];_0x2ad68f['TagIds']['split'](',')[_0x9567('0x33')](function(_0x11c116){_0x2ad68f[_0x9567('0x34')]['push'](_0xa19e74[_0x11c116]);});}delete _0x2ad68f['TagIds'];}catch(_0x19c54f){_0x5e231f(_0x19c54f);}_0x2ec67e(_0x2ad68f);});}function updateOpenchannelInteraction(_0x2b5c3b,_0x317893,_0x3b30fb){return new BPromise(function(_0x522761,_0x54c67a){return getInteractionUsers(_0x2b5c3b,_0x3b30fb)[_0x9567('0x29')](function(_0x59e825){return getInteractionTags(_0x59e825,_0x317893);})[_0x9567('0x29')](function(_0x3a4548){return getStateInteraction(_0x3a4548);})['then'](function(_0x492879){_0x522761(_0x492879);})[_0x9567('0x35')](function(_0x3a327c){_0x54c67a(_0x3a327c);});});}function getStateInteraction(_0x31034c){return new BPromise(function(_0x19a9e4){_0x31034c[_0x9567('0x36')]=0x0;_0x31034c['talking']=0x0;_0x31034c['answered']=0x0;_0x31034c[_0x9567('0x37')]=0x0;_0x31034c[_0x9567('0x38')]=0x0;if(!_0x31034c[_0x9567('0x39')]&&!_0x31034c[_0x9567('0x3a')]){_0x31034c[_0x9567('0x36')]+=0x1;}if(!_0x31034c[_0x9567('0x39')]&&_0x31034c[_0x9567('0x3a')]){_0x31034c[_0x9567('0x3b')]+=0x1;if(_0x31034c[_0x9567('0x36')]){_0x31034c[_0x9567('0x36')]-=0x1;}}if(_0x31034c[_0x9567('0x39')]&&_0x31034c[_0x9567('0x3a')]){_0x31034c[_0x9567('0x3c')]+=0x1;if(_0x31034c[_0x9567('0x3b')]){_0x31034c[_0x9567('0x3b')]-=0x1;}}if(_0x31034c['closed']&&!_0x31034c[_0x9567('0x3a')]){_0x31034c[_0x9567('0x37')]+=0x1;if(_0x31034c[_0x9567('0x36')]){_0x31034c['waiting']-=0x1;}}_0x31034c[_0x9567('0x38')]+=0x1;_0x19a9e4(_0x31034c);});}exports[_0x9567('0x3d')]=function(_0x56455d,_0x78732){var _0x28aed6={},_0x48ebc4={},_0xd37e2e={'count':0x0,'rows':[]};var _0x5c8fb5=_[_0x9567('0x30')](db[_0x9567('0x3e')][_0x9567('0x3f')],function(_0x54020e){return{'name':_0x54020e[_0x9567('0x40')],'type':_0x54020e['type'][_0x9567('0x41')]};});_0x48ebc4[_0x9567('0x42')]=_[_0x9567('0x30')](_0x5c8fb5,'name');_0x48ebc4['query']=_[_0x9567('0x43')](_0x56455d[_0x9567('0x44')]);_0x48ebc4[_0x9567('0x45')]=_[_0x9567('0x46')](_0x48ebc4[_0x9567('0x42')],_0x48ebc4['query']);_0x28aed6[_0x9567('0x47')]=_[_0x9567('0x46')](_0x48ebc4[_0x9567('0x42')],qs[_0x9567('0x48')](_0x56455d[_0x9567('0x44')][_0x9567('0x48')]));_0x28aed6[_0x9567('0x47')]=_0x28aed6[_0x9567('0x47')]['length']?_0x28aed6[_0x9567('0x47')]:_0x48ebc4[_0x9567('0x42')];if(!_0x56455d[_0x9567('0x44')][_0x9567('0x49')](_0x9567('0x4a'))){_0x28aed6[_0x9567('0x22')]=qs[_0x9567('0x22')](_0x56455d[_0x9567('0x44')][_0x9567('0x22')]);_0x28aed6[_0x9567('0x20')]=qs[_0x9567('0x20')](_0x56455d[_0x9567('0x44')][_0x9567('0x20')]);}_0x28aed6[_0x9567('0x4b')]=qs[_0x9567('0x4c')](_0x56455d[_0x9567('0x44')][_0x9567('0x4c')]);_0x28aed6['where']=qs['filters'](_['pick'](_0x56455d[_0x9567('0x44')],_0x48ebc4[_0x9567('0x45')]),_0x5c8fb5);var _0x21b645=[];var _0x8ff89c=squel[_0x9567('0x4d')]()[_0x9567('0x4e')]('id')[_0x9567('0x4e')]('name')['field'](_0x9567('0x4f'))[_0x9567('0x50')](_0x9567('0x51'));var _0x794038=squel[_0x9567('0x4d')]()[_0x9567('0x4e')]('u.id')[_0x9567('0x4e')]('u.fullname')['field'](_0x9567('0x52'))['from']('user_has_openchannel_interactions','ui')[_0x9567('0x53')](_0x9567('0x54'),'u',_0x9567('0x55'));var _0x124489=squel[_0x9567('0x4d')]()[_0x9567('0x50')](_0x9567('0x56'),'i')[_0x9567('0x53')](_0x9567('0x57'),'c',_0x9567('0x58'))[_0x9567('0x53')]('users','o',_0x9567('0x59'))['left_join'](_0x9567('0x5a'),'a',_0x9567('0x5b'))[_0x9567('0x53')]('openchannel_messages','me',_0x9567('0x5c'))[_0x9567('0x53')]('openchannel_interaction_has_tags','it',_0x9567('0x5d'))[_0x9567('0x53')](_0x9567('0x51'),'t','t.id\x20=\x20it.TagId');var _0x11f294=squel[_0x9567('0x5e')]();var _0x41eebd=[];var _0x48127f=squel[_0x9567('0x5e')]();var _0x2991b3;if(_0x56455d[_0x9567('0x44')][_0x9567('0x5f')]){_0x2991b3=as[_0x9567('0x60')](_0x56455d[_0x9567('0x44')]['search']);var _0x33fe9b=_0x2991b3['sqlOperator'];for(var _0x5754a0=0x0;_0x5754a0<_0x2991b3[_0x9567('0x61')][_0x9567('0x62')];_0x5754a0++){var _0x571bf0=_0x2991b3[_0x9567('0x61')][_0x5754a0];var _0x44f6b8='i';var _0x5ad628=_[_0x9567('0x63')](_0x5c8fb5,[_0x9567('0x2e'),_0x571bf0[_0x9567('0x4e')]]);if(!_0x5ad628){switch(_0x571bf0[_0x9567('0x4e')]){case'unreadMessages':if(_0x571bf0['value']==0x1){_0x124489[_0x9567('0x64')]('`'+_0x571bf0[_0x9567('0x4e')]+_0x9567('0x65'));}else{_0x124489[_0x9567('0x64')]('`'+_0x571bf0['field']+_0x9567('0x66'));}break;case _0x9567('0x67'):if(_0x571bf0[_0x9567('0x68')]===_0x9567('0x69')){if(_0x571bf0[_0x9567('0x6a')][_0x9567('0x6b')]('\x20')['length']>0x1){_0x11f294[_0x33fe9b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x571bf0['value']),null);}else{var _0x4542d3='%'+_0x571bf0['value']+'%';_0x11f294[_0x33fe9b]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4542d3,_0x4542d3,_0x4542d3);}}else{_0x5ad628=_[_0x9567('0x63')](_0x5c8fb5,['name',_0x9567('0x6c')]);_0x571bf0[_0x9567('0x4e')]=_0x9567('0x6c');_0x51e302=as[_0x9567('0x6d')](_0x44f6b8,_0x5ad628['type'],_0x571bf0);_0x11f294[_0x33fe9b](_0x51e302[_0x9567('0x6e')],_0x51e302[_0x9567('0x6a')][_0x9567('0x6f')],_0x51e302['value'][_0x9567('0x2b')]);}break;case _0x9567('0x70'):var _0x2d709c=_0x571bf0['value'][_0x9567('0x6b')](',')[_0x9567('0x30')](function(_0x4bbef4){return Number(_0x4bbef4);});_0x2d709c[_0x9567('0x33')](function(_0x4f93b9){_0x48127f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f93b9+',%');});_0x41eebd=_[_0x9567('0x71')](_0x41eebd,_0x2d709c);break;case'User':if(_0x571bf0[_0x9567('0x68')]===_0x9567('0x69')){_0x11f294[_0x33fe9b](_0x9567('0x72'),'%'+_0x571bf0[_0x9567('0x6a')]+'%',null);}else{_0x5ad628=_[_0x9567('0x63')](_0x5c8fb5,[_0x9567('0x2e'),'UserId']);_0x571bf0[_0x9567('0x4e')]=_0x9567('0x3a');_0x51e302=as[_0x9567('0x6d')](_0x44f6b8,_0x5ad628[_0x9567('0x73')],_0x571bf0);_0x11f294[_0x33fe9b](_0x51e302[_0x9567('0x6e')],_0x51e302[_0x9567('0x6a')][_0x9567('0x6f')],_0x51e302['value'][_0x9567('0x2b')]);}break;case'body':_0x51e302=as['buildExpression']('me',null,_0x571bf0);_0x11f294[_0x33fe9b](_0x51e302['text'],_0x51e302['value']['start'],_0x51e302[_0x9567('0x6a')][_0x9567('0x2b')]);break;}}else{var _0x51e302=as['buildExpression'](_0x44f6b8,_0x5ad628[_0x9567('0x73')],_0x571bf0);_0x11f294[_0x33fe9b](_0x51e302[_0x9567('0x6e')],_0x51e302['value'][_0x9567('0x6f')],_0x51e302[_0x9567('0x6a')]['end']);}}}else{var _0x11eb66=_(_0x56455d[_0x9567('0x44')])['keys']()[_0x9567('0x30')](function(_0x344bc6){return _[_0x9567('0x74')](_0x5c8fb5,[_0x9567('0x2e'),_0x344bc6])?_0x344bc6:undefined;})[_0x9567('0x75')]()[_0x9567('0x6a')]();if(!_[_0x9567('0x76')](_0x11eb66)){_0x11eb66['forEach'](function(_0x2864e4){if(_0x2864e4===_0x9567('0x77')){_0x124489[_0x9567('0x78')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x9567('0x79')](_0x56455d[_0x9567('0x44')][_0x2864e4]));}else if(_0x2864e4==='createdAt'){var _0x2ba702=JSON[_0x9567('0x7a')](_0x56455d[_0x9567('0x44')][_0x2864e4])[_0x9567('0x7b')];var _0x19bab3=JSON[_0x9567('0x7a')](_0x56455d[_0x9567('0x44')][_0x2864e4])[_0x9567('0x7c')];_0x124489[_0x9567('0x78')](_0x9567('0x7d'),_0x2ba702,_0x19bab3);}else{if(_0x56455d[_0x9567('0x44')][_0x2864e4]===_0x9567('0x7e')){_0x124489[_0x9567('0x78')]('i.'+_0x2864e4+_0x9567('0x7f'));}else{_0x124489[_0x9567('0x78')]('i.'+_0x2864e4+_0x9567('0x80'),_0x56455d[_0x9567('0x44')][_0x2864e4]);}}});}if(_0x56455d[_0x9567('0x44')][_0x9567('0x81')]){if(_0x56455d[_0x9567('0x44')]['read']==0x1){_0x124489[_0x9567('0x64')](_0x9567('0x82'));}else{_0x124489[_0x9567('0x64')](_0x9567('0x83'));}}if(_0x56455d['query'][_0x9567('0x84')]){_0x41eebd=_[_0x9567('0x85')](_0x56455d['query']['tag'])?_0x56455d['query'][_0x9567('0x84')]:new Array(_0x56455d['query'][_0x9567('0x84')]);_0x41eebd[_0x9567('0x33')](function(_0x3ac9cf){_0x48127f['or'](_0x9567('0x86'),'%,'+_0x3ac9cf+',%');});}if(_0x56455d['query'][_0x9567('0x87')]){var _0x56d085=_0x56455d[_0x9567('0x44')][_0x9567('0x87')][_0x9567('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9567('0x89')](_0x56d085)){_0x11f294['or'](_0x9567('0x8a'),_0x56d085+'%');}else{_0x11f294['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9567('0x8b')](_0x56d085))['or'](_0x9567('0x8c'),_0x56d085+'%')['or'](_0x9567('0x8d'),_0x56d085+'%');}}}_0x124489[_0x9567('0x78')](_0x11f294);_0x124489[_0x9567('0x8e')](_0x9567('0x8f'));var _0xf834df={'type':db['Sequelize'][_0x9567('0x90')]['SELECT'],'raw':!![]};var _0x568e4a=_0x124489[_0x9567('0x91')]();_0x568e4a[_0x9567('0x4e')]('i.id');_0x568e4a[_0x9567('0x4e')](_0x9567('0x92'),_0x9567('0x93'));if(_0x28aed6[_0x9567('0x4b')]){_0x28aed6[_0x9567('0x4b')][_0x9567('0x33')](function(_0x311d60){var _0x12bac8=_0x311d60[0x0]==='contactName'?_0x311d60[0x0]:'i.'+_0x311d60[0x0];_0x124489[_0x9567('0x4b')](_0x12bac8,_0x311d60[0x1]===_0x9567('0x94')?![]:!![]);});}if(!_[_0x9567('0x76')](_0x41eebd)){_0x124489[_0x9567('0x64')](_0x48127f);_0x568e4a[_0x9567('0x78')](_0x9567('0x95'),_0x41eebd);}BPromise['resolve']()['then'](function(){if(!_0x2991b3){if(_0x56455d[_0x9567('0x44')][_0x9567('0x77')])return;_0x568e4a[_0x9567('0x78')](_0x9567('0x96'));_0x124489['where'](_0x9567('0x96'));return;}if(_0x56455d[_0x9567('0x97')][_0x9567('0x98')]!==_0x9567('0x99'))return;return _0x56455d[_0x9567('0x97')][_0x9567('0x9a')]({'attributes':['id'],'raw':!![]})[_0x9567('0x29')](function(_0x514c0c){if(_[_0x9567('0x76')](_0x514c0c)){_0x568e4a['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x124489[_0x9567('0x78')](_0x9567('0x9b'));}else{_0x568e4a[_0x9567('0x78')](_0x9567('0x9c'),_[_0x9567('0x30')](_0x514c0c,'id'));_0x124489[_0x9567('0x78')](_0x9567('0x9c'),_[_0x9567('0x30')](_0x514c0c,'id'));}});})['then'](function(){if(_0x56455d[_0x9567('0x97')][_0x9567('0x98')]==='agent'&&!_0x2991b3&&!_0x56455d['query']['OpenchannelAccountId'])return[];return db[_0x9567('0x9d')]['query'](_0x568e4a['toString'](),_0xf834df);})['then'](function(_0x747d6){_0xd37e2e[_0x9567('0x23')]=_0x747d6['length'];if(_0xd37e2e[_0x9567('0x23')]===0x0)return[];return db[_0x9567('0x9d')][_0x9567('0x44')](_0x8ff89c['toString'](),_0xf834df)['then'](function(_0x21c78e){_0x21b645=_['keyBy'](_0x21c78e,'id');_0xf834df=_['merge'](_0xf834df,{'model':db[_0x9567('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x56455d['query'][_0x9567('0x48')]){_0x28aed6[_0x9567('0x47')][_0x9567('0x33')](function(_0x1e2f80){_0x124489['field']('i.'+_0x1e2f80);});}else{_0x124489['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x124489[_0x9567('0x4e')](_0x9567('0x9e'),_0x9567('0x9f'));_0x124489[_0x9567('0x4e')]('a.mandatoryDisposition',_0x9567('0xa0'));_0x124489[_0x9567('0x4e')](_0x9567('0xa1'),'contactName');_0x124489[_0x9567('0x4e')](_0x9567('0xa2'));_0x124489[_0x9567('0x4e')]('c.firstName',_0x9567('0xa3'));_0x124489[_0x9567('0x4e')](_0x9567('0xa4'),_0x9567('0xa5'));_0x124489[_0x9567('0x4e')](_0x9567('0xa6'),_0x9567('0xa7'));_0x124489['field'](_0x9567('0xa8'),'Contact.phone');_0x124489[_0x9567('0x4e')]('c.mobile',_0x9567('0xa9'));_0x124489[_0x9567('0x4e')](_0x9567('0xaa'),_0x9567('0xab'));_0x124489[_0x9567('0x4e')](_0x9567('0xac'),'Owner.fullname');_0x124489[_0x9567('0x4e')](_0x9567('0xad'),_0x9567('0xae'));_0x124489[_0x9567('0x4e')](_0x9567('0xaf'),_0x9567('0x32'));}if(_0x28aed6['limit'])_0x124489[_0x9567('0x22')](_0x28aed6[_0x9567('0x22')]);if(_0x28aed6[_0x9567('0x20')])_0x124489[_0x9567('0x20')](_0x28aed6[_0x9567('0x20')]);return db['sequelize'][_0x9567('0x44')](_0x124489[_0x9567('0xb0')](),_0xf834df);})[_0x9567('0x29')](function(_0x51d02e){if(_0x51d02e[_0x9567('0x62')]>0x0)_0x794038[_0x9567('0x78')](_0x9567('0xb1'),_['map'](_0x51d02e,'id'));return db['sequelize'][_0x9567('0x44')](_0x794038[_0x9567('0xb0')](),_0xf834df)['then'](function(_0x23c7f0){var _0xa4f57=_[_0x9567('0xb2')](_0x23c7f0,_0x9567('0xb3'));var _0x160889=[];_0x51d02e[_0x9567('0x33')](function(_0x302031){_0x160889['push'](updateOpenchannelInteraction(_0x302031,_0x21b645,_0xa4f57));});return BPromise[_0x9567('0xb4')](_0x160889);});});})['then'](function(_0x2d32ba){_0xd37e2e[_0x9567('0xb5')]=_0x2d32ba;return _0xd37e2e;})[_0x9567('0x29')](respondWithFilteredResult(_0x78732,_0x28aed6))[_0x9567('0x35')](handleError(_0x78732,null));};exports[_0x9567('0xb6')]=function(_0x9be454,_0x12c163){var _0x4f8f08={};if(_0x9be454[_0x9567('0x44')]['type']&&_0x9be454[_0x9567('0x44')]['type']===_0x9567('0x50')){_0x4f8f08['from']=_0x9be454[_0x9567('0xb7')]['id'];}else{_0x4f8f08['id']=_0x9be454['params']['id'];}var _0x1856e1={'raw':![],'where':_0x4f8f08},_0x14223e={};_0x14223e[_0x9567('0x42')]=_[_0x9567('0x43')](db[_0x9567('0x3e')][_0x9567('0x3f')]);_0x14223e[_0x9567('0x44')]=_['keys'](_0x9be454['query']);_0x14223e[_0x9567('0x45')]=_[_0x9567('0x46')](_0x14223e[_0x9567('0x42')],_0x14223e[_0x9567('0x44')]);_0x1856e1[_0x9567('0x47')]=_[_0x9567('0x46')](_0x14223e[_0x9567('0x42')],qs['fields'](_0x9be454[_0x9567('0x44')]['fields']));_0x1856e1['attributes']=_0x1856e1[_0x9567('0x47')][_0x9567('0x62')]?_0x1856e1[_0x9567('0x47')]:_0x14223e['model'];if(_0x9be454[_0x9567('0x44')]['includeAll']){_0x1856e1[_0x9567('0xb8')]=[{'all':!![]}];}_0x1856e1=_[_0x9567('0xb9')]({},_0x1856e1,_0x9be454[_0x9567('0xba')]);return db[_0x9567('0x3e')]['find'](_0x1856e1)[_0x9567('0x29')](handleEntityNotFound(_0x12c163,null))['then'](respondWithResult(_0x12c163,null))['catch'](handleError(_0x12c163,null));};exports['create']=function(_0x28bd16,_0x58b31b){return db[_0x9567('0x3e')]['create'](_0x28bd16['body'],{})[_0x9567('0x29')](respondWithResult(_0x58b31b,0xc9))[_0x9567('0x35')](handleError(_0x58b31b,null));};exports[_0x9567('0x28')]=function(_0x543d2e,_0x2b1ebc){if(_0x543d2e['body']['id']){delete _0x543d2e[_0x9567('0xbb')]['id'];}return db[_0x9567('0x3e')][_0x9567('0x63')]({'where':{'id':_0x543d2e[_0x9567('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2b1ebc,null))[_0x9567('0x29')](saveUpdates(_0x543d2e[_0x9567('0xbb')],null))['then'](respondWithResult(_0x2b1ebc,null))[_0x9567('0x35')](handleError(_0x2b1ebc,null));};exports['destroy']=function(_0x5733ca,_0xd215a9){return db[_0x9567('0x3e')]['find']({'where':{'id':_0x5733ca[_0x9567('0xb7')]['id']}})[_0x9567('0x29')](handleEntityNotFound(_0xd215a9,null))[_0x9567('0x29')](removeEntity(_0xd215a9,null))[_0x9567('0x35')](handleError(_0xd215a9,null));};exports[_0x9567('0xbc')]=function(_0x538a1d,_0x47d4f5){return db[_0x9567('0x3e')]['describe']()['then'](respondWithResult(_0x47d4f5,null))['catch'](handleError(_0x47d4f5,null));};exports['addMessage']=function(_0x4767b9,_0xe16cc3,_0x1db046){return db[_0x9567('0xbd')][_0x9567('0x63')]({'where':{'id':_0x4767b9[_0x9567('0xb7')]['id']}})[_0x9567('0x29')](handleEntityNotFound(_0xe16cc3,null))[_0x9567('0x29')](function(_0x256175){if(_0x256175){return _0x256175[_0x9567('0xbe')](_0x4767b9[_0x9567('0xbb')][_0x9567('0xbf')],_[_0x9567('0xc0')](_0x4767b9[_0x9567('0xbb')],['ids','id'])||{});}})[_0x9567('0x29')](respondWithResult(_0xe16cc3,null))[_0x9567('0x35')](handleError(_0xe16cc3,null));};exports[_0x9567('0xc1')]=function(_0x4a88ba,_0xaecac2,_0x267b2c){var _0x440d7a={'raw':![],'where':{}};var _0xb17fc3={};var _0x49aa2a={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x9567('0xc2')]({'where':{'id':_0x4a88ba[_0x9567('0xb7')]['id']}})[_0x9567('0x29')](handleEntityNotFound(_0xaecac2,null))[_0x9567('0x29')](function(_0x516b60){if(_0x516b60){_0xb17fc3['model']=_[_0x9567('0x43')](db[_0x9567('0xbd')]['rawAttributes']);_0xb17fc3[_0x9567('0x44')]=_[_0x9567('0x43')](_0x4a88ba[_0x9567('0x44')]);_0xb17fc3[_0x9567('0x45')]=_['intersection'](_0xb17fc3[_0x9567('0x42')],_0xb17fc3[_0x9567('0x44')]);_0x440d7a[_0x9567('0x47')]=_[_0x9567('0x46')](_0xb17fc3['model'],qs[_0x9567('0x48')](_0x4a88ba['query'][_0x9567('0x48')]));_0x440d7a[_0x9567('0x47')]=_0x440d7a[_0x9567('0x47')][_0x9567('0x62')]?_0x440d7a[_0x9567('0x47')]:_0xb17fc3[_0x9567('0x42')];if(!_0x4a88ba[_0x9567('0x44')][_0x9567('0x49')]('nolimit')){_0x440d7a['limit']=qs[_0x9567('0x22')](_0x4a88ba[_0x9567('0x44')]['limit']);_0x440d7a[_0x9567('0x20')]=qs[_0x9567('0x20')](_0x4a88ba[_0x9567('0x44')][_0x9567('0x20')]);}_0x440d7a[_0x9567('0x4b')]=qs[_0x9567('0x4c')](_0x4a88ba[_0x9567('0x44')][_0x9567('0x4c')]);_0x440d7a[_0x9567('0x78')]=qs['filters'](_['pick'](_0x4a88ba[_0x9567('0x44')],_0xb17fc3[_0x9567('0x45')]));_0x440d7a[_0x9567('0x78')][_0x9567('0xb3')]=_0x516b60['id'];if(_0x4a88ba[_0x9567('0x44')]['filter']){_0x440d7a['where']=_[_0x9567('0xb9')](_0x440d7a[_0x9567('0x78')],{'$or':_['map'](_0x440d7a[_0x9567('0x47')],function(_0x566c7e){var _0x230e2f={};_0x230e2f[_0x566c7e]={'$like':'%'+_0x4a88ba[_0x9567('0x44')][_0x9567('0x87')]+'%'};return _0x230e2f;})});}if(_0x4a88ba[_0x9567('0x44')]['$gte']){var _0x297e21=_0x4a88ba[_0x9567('0x44')][_0x9567('0x7b')][_0x9567('0x6b')](',');var _0x2e6874={};_0x2e6874[_0x297e21[0x0]]={'$gte':moment(_0x297e21[0x1])[_0x9567('0xc3')](_0x9567('0xc4'))};_0x440d7a[_0x9567('0x78')]=_[_0x9567('0xb9')](_0x440d7a[_0x9567('0x78')],_0x2e6874);}_0x440d7a=_['merge']({},_0x440d7a,_0x4a88ba[_0x9567('0xba')]);return db[_0x9567('0xbd')][_0x9567('0x23')]({'where':_0x440d7a['where']})['then'](function(_0x4e322b){_0x49aa2a[_0x9567('0x23')]=_0x4e322b;if(_0x4a88ba[_0x9567('0x44')][_0x9567('0xc5')]){_0x440d7a[_0x9567('0xb8')]=[{'all':!![]}];}return db[_0x9567('0xbd')][_0x9567('0xc6')](_0x440d7a);})[_0x9567('0x29')](function(_0x944d51){_0x49aa2a[_0x9567('0xb5')]=_0x944d51;return _0x49aa2a;});}})[_0x9567('0x29')](respondWithFilteredResult(_0xaecac2,_0x440d7a))['catch'](handleError(_0xaecac2,null));};exports['addTags']=function(_0x344a06,_0x3489a7,_0x51b6ac){return db['OpenchannelInteraction'][_0x9567('0x63')]({'where':{'id':_0x344a06[_0x9567('0xb7')]['id']}})[_0x9567('0x29')](handleEntityNotFound(_0x3489a7,null))[_0x9567('0x29')](function(_0x16e9ae){if(_0x16e9ae){return _0x16e9ae[_0x9567('0xc7')](_0x344a06[_0x9567('0xbb')][_0x9567('0xbf')],_[_0x9567('0xc0')](_0x344a06[_0x9567('0xbb')],['ids','id'])||{})[_0x9567('0xc8')](function(){return db[_0x9567('0x70')]['findAll']({'attributes':['id',_0x9567('0x2e'),_0x9567('0x4f')],'where':{'id':_0x344a06[_0x9567('0xbb')][_0x9567('0xbf')]}});})[_0x9567('0x29')](function(_0x269e19){socket[_0x9567('0xc9')](_0x9567('0xca'),{'id':Number(_0x344a06['params']['id']),'tags':_0x269e19||[]});return{'id':Number(_0x344a06[_0x9567('0xb7')]['id']),'tags':_0x269e19||[]};});}})[_0x9567('0x29')](respondWithResult(_0x3489a7,null))[_0x9567('0x35')](handleError(_0x3489a7,null));};exports[_0x9567('0xcb')]=function(_0x179845,_0x3c029c,_0x2e3020){return db[_0x9567('0x3e')]['find']({'where':{'id':_0x179845[_0x9567('0xb7')]['id']}})[_0x9567('0x29')](handleEntityNotFound(_0x3c029c,null))[_0x9567('0x29')](function(_0xbc0801){if(_0xbc0801){return _0xbc0801[_0x9567('0xcb')](_0x179845[_0x9567('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x3c029c,null))['catch'](handleError(_0x3c029c,null));};exports[_0x9567('0xcc')]=function(_0x3e8d60,_0x380794){var _0xb9cef2=moment()['unix']()['toString']();var _0x1f0730=path[_0x9567('0xcd')](config['root'],'server',_0x9567('0xce'),_0x9567('0xcf'));var _0x4adac8=path[_0x9567('0xcd')](config['root'],_0x9567('0xd0'),_0x9567('0xce'),_0x9567('0xd1'));var _0x5f1554=path[_0x9567('0xcd')](_0x1f0730,_0xb9cef2);var _0x19c47b=util[_0x9567('0xc3')](_0x9567('0xd2'),_0x3e8d60[_0x9567('0xb7')]['id'],_0xb9cef2);var _0xb469b8=path[_0x9567('0xcd')](_0x1f0730,_0x19c47b);var _0xb0d5ee=[];_0xb0d5ee[_0x9567('0xd3')]({'model':db['User'],'as':_0x9567('0xd4'),'attributes':['id','fullname'],'raw':!![]});_0xb0d5ee['push']({'model':db[_0x9567('0xd5')],'as':_0x9567('0x67'),'attributes':['id',_0x9567('0xd6'),'lastName'],'raw':!![]});if(_0x3e8d60['query'][_0x9567('0xd1')]){_0xb0d5ee['push']({'model':db[_0x9567('0xd7')],'as':_0x9567('0xd7'),'raw':!![]});}var _0x59728d=[{'model':db[_0x9567('0xbd')],'as':_0x9567('0xd8'),'attributes':['id',_0x9567('0xbb'),_0x9567('0xd9'),_0x9567('0xda'),_0x9567('0xdb'),'read'],'include':_0xb0d5ee}];_0x59728d[_0x9567('0xd3')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x59728d[_0x9567('0xd3')]({'model':db[_0x9567('0xd4')],'as':_0x9567('0xdc'),'attributes':['id','fullname']});return db[_0x9567('0x3e')][_0x9567('0x63')]({'where':{'id':_0x3e8d60[_0x9567('0xb7')]['id']},'include':_0x59728d})['then'](handleEntityNotFound(_0x380794,null))[_0x9567('0x29')](function(_0x32730e){if(_0x32730e){var _0x24da44=_0x32730e[_0x9567('0xdd')]({'plain':!![]});fs[_0x9567('0xde')](_0x5f1554);var _0x3fe89c={'channel':'Openchannel','account':_0x24da44[_0x9567('0xdf')][_0x9567('0x2e')],'agent':_0x24da44[_0x9567('0xdc')]?_0x24da44['Owner'][_0x9567('0x31')]:'N.A.','createdAt':moment(_0x24da44[_0x9567('0xd9')])[_0x9567('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9567('0xb0')](),'closedAt':_0x24da44[_0x9567('0x39')]?moment(_0x24da44['closedAt'])[_0x9567('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9567('0xb0')]():'','disposition':_0x24da44['disposition'],'visibility':_0x24da44[_0x9567('0xe0')]?'Public':'Private','messages':_(_0x24da44['Messages'])['filter']({'secret':![]})['map'](function(_0x59c45c){if(_0x59c45c['Attachment']){var _0x49e7bc=path[_0x9567('0xcd')](_0x4adac8,_0x59c45c[_0x9567('0xd7')][_0x9567('0xe1')]);if(fs[_0x9567('0xe2')](_0x49e7bc)){fs['createReadStream'](_0x49e7bc)[_0x9567('0xe3')](fs[_0x9567('0xe4')](path[_0x9567('0xcd')](_0x5f1554,_0x59c45c[_0x9567('0xd7')]['basename'])));}}return{'date':moment(_0x59c45c['createdAt'])[_0x9567('0xc3')](_0x9567('0xc4'))[_0x9567('0xb0')](),'sender':_0x59c45c[_0x9567('0xda')]==='out'?_0x59c45c[_0x9567('0xd4')]?_0x59c45c[_0x9567('0xd4')][_0x9567('0x31')]:_0x9567('0xe5'):_0x59c45c[_0x9567('0x67')][_0x9567('0xd6')]+(_0x59c45c[_0x9567('0x67')][_0x9567('0xe6')]?'\x20'+_0x59c45c[_0x9567('0x67')]['lastName']:''),'body':_0x59c45c[_0x9567('0xd7')]?_0x59c45c[_0x9567('0xd7')][_0x9567('0xe1')]:_0x59c45c['body'],'direction':_0x59c45c[_0x9567('0xda')]===_0x9567('0xe7')?'A':'C','secret':_0x59c45c['secret'],'read':_0x59c45c[_0x9567('0x81')],'attachment':_0x59c45c['Attachment']};})['value']()};return ejs[_0x9567('0xe8')](path['join'](config[_0x9567('0xe9')],_0x9567('0xd0'),_0x9567('0xea'),_0x9567('0xeb')),{'interaction':_0x3fe89c})[_0x9567('0x29')](function(_0x38d64a){var _0x433298=path['join'](_0x5f1554,_0x9567('0xec')+_0x24da44['id']+'-'+_0xb9cef2+_0x9567('0xed'));var _0x49834b={'path':_0x433298,'channel':_0x9567('0xee'),'interactionId':_0x24da44['id']};return pdf['createPdfFromHTML'](_0x38d64a,_0x49834b);})['then'](function(){return new BPromise(function(_0x541cc9,_0x5517d3){zipdir(_0x5f1554,{'saveTo':_0xb469b8},function(_0x2b4790,_0x2d7f3d){if(_0x2b4790)return _0x5517d3(_0x2b4790);return _0x541cc9(_0x2d7f3d);});})[_0x9567('0x29')](function(){return new BPromise(function(_0x34665b,_0x2b2a76){rimraf(_0x5f1554,function(_0x2d0aab){if(_0x2d0aab)_0x2b2a76(_0x2d0aab);return _0x34665b();});});})['then'](function(){return _0x380794[_0x9567('0xcc')](_0xb469b8,_0x19c47b,function(_0x4f9847){if(_0x4f9847){console[_0x9567('0xef')]('err',_0x4f9847);}else{fs[_0x9567('0xf0')](_0xb469b8);}});});});}else{return _0x380794[_0x9567('0x1d')](0xc8);}})[_0x9567('0x35')](handleError(_0x380794,null));}; \ No newline at end of file +var _0x6afc=['name','Users','map','fullname','TagIds','Tags','forEach','catch','talking','answered','unmanaged','closed','UserId','waiting','total','rawAttributes','fieldName','model','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','field','color','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','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','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','operator','$substring','value','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','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','body','buildExpression','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','unreadMessages','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','push','rows','show','params','OpenchannelInteraction','keys','intersection','includeAll','options','create','describe','addMessage','ids','omit','OpenchannelMessage','format','include','findAll','setTags','spread','emit','removeTags','download','unix','server','join','root','attachments','transcript-%d-%s.zip','Contact','firstName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','error'];(function(_0xf8e45b,_0x336e08){var _0xb38c41=function(_0x51f9d8){while(--_0x51f9d8){_0xf8e45b['push'](_0xf8e45b['shift']());}};_0xb38c41(++_0x336e08);}(_0x6afc,0xc1));var _0xc6af=function(_0x5eb460,_0x3db92f){_0x5eb460=_0x5eb460-0x0;var _0x42ad1c=_0x6afc[_0x5eb460];return _0x42ad1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6af('0x0'));var zipdir=require(_0xc6af('0x1'));var jsonpatch=require(_0xc6af('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc6af('0x3'));var Mustache=require('mustache');var util=require(_0xc6af('0x4'));var path=require(_0xc6af('0x5'));var sox=require('sox');var csv=require(_0xc6af('0x6'));var ejs=require(_0xc6af('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc6af('0x8'));var crypto=require('crypto');var jsforce=require(_0xc6af('0x9'));var deskjs=require(_0xc6af('0xa'));var toCsv=require(_0xc6af('0x6'));var querystring=require(_0xc6af('0xb'));var Papa=require(_0xc6af('0xc'));var Redis=require('ioredis');var authService=require(_0xc6af('0xd'));var qs=require(_0xc6af('0xe'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xc6af('0xf'));var hardwareService=require(_0xc6af('0x10'));var logger=require(_0xc6af('0x11'))(_0xc6af('0x12'));var utils=require(_0xc6af('0x13'));var config=require(_0xc6af('0x14'));var licenseUtil=require(_0xc6af('0x15'));var db=require('../../mysqldb')['db'];config[_0xc6af('0x16')]=_[_0xc6af('0x17')](config['redis'],{'host':_0xc6af('0x18'),'port':0x18eb});var socket=require(_0xc6af('0x19'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xc6af('0x1a')](socket);function respondWithStatusCode(_0x57ac2c,_0x12f791){_0x12f791=_0x12f791||0xcc;return function(_0x3dcb0e){if(_0x3dcb0e){return _0x57ac2c[_0xc6af('0x1b')](_0x12f791);}return _0x57ac2c[_0xc6af('0x1c')](_0x12f791)[_0xc6af('0x1d')]();};}function respondWithResult(_0x567681,_0x3ea7ff){_0x3ea7ff=_0x3ea7ff||0xc8;return function(_0x17a3d2){if(_0x17a3d2){return _0x567681[_0xc6af('0x1c')](_0x3ea7ff)['json'](_0x17a3d2);}};}function respondWithFilteredResult(_0x3b2f51,_0x4ef091){return function(_0x5ba262){if(_0x5ba262){var _0x111193=typeof _0x4ef091['offset']===_0xc6af('0x1e')&&typeof _0x4ef091[_0xc6af('0x1f')]===_0xc6af('0x1e');var _0xde7ea2=_0x5ba262[_0xc6af('0x20')];var _0x4965bb=_0x111193?0x0:_0x4ef091[_0xc6af('0x21')];var _0x72d2ec=_0x111193?_0x5ba262[_0xc6af('0x20')]:_0x4ef091['offset']+_0x4ef091['limit'];var _0x5bacad;if(_0x72d2ec>=_0xde7ea2){_0x72d2ec=_0xde7ea2;_0x5bacad=0xc8;}else{_0x5bacad=0xce;}_0x3b2f51[_0xc6af('0x1c')](_0x5bacad);return _0x3b2f51[_0xc6af('0x22')](_0xc6af('0x23'),_0x4965bb+'-'+_0x72d2ec+'/'+_0xde7ea2)[_0xc6af('0x24')](_0x5ba262);}return null;};}function patchUpdates(_0x1be0b8){return function(_0x277bda){try{jsonpatch[_0xc6af('0x25')](_0x277bda,_0x1be0b8,!![]);}catch(_0x2f9bfa){return BPromise[_0xc6af('0x26')](_0x2f9bfa);}return _0x277bda['save']();};}function saveUpdates(_0x484a60,_0x4fc52e){return function(_0x3befaa){if(_0x3befaa){return _0x3befaa[_0xc6af('0x27')](_0x484a60)[_0xc6af('0x28')](function(_0x4961f2){return _0x4961f2;});}return null;};}function removeEntity(_0x35f520,_0x32323a){return function(_0x24ffb7){if(_0x24ffb7){return _0x24ffb7['destroy']()['then'](function(){_0x35f520[_0xc6af('0x1c')](0xcc)[_0xc6af('0x1d')]();});}};}function handleEntityNotFound(_0x3e309a,_0x442034){return function(_0x1048d3){if(!_0x1048d3){_0x3e309a[_0xc6af('0x1b')](0x194);}return _0x1048d3;};}function handleError(_0x49f788,_0x37864e){_0x37864e=_0x37864e||0x1f4;return function(_0x3e3425){logger[_0xc6af('0x29')](_0x3e3425['stack']);if(_0x3e3425[_0xc6af('0x2a')]){delete _0x3e3425['name'];}_0x49f788['status'](_0x37864e)['send'](_0x3e3425);};}function getInteractionUsers(_0x3bfcc0,_0x2b6f6b){return new BPromise(function(_0x39052f,_0x33e7b2){try{if(_0x2b6f6b[_0x3bfcc0['id']]){_0x3bfcc0[_0xc6af('0x2b')]=_[_0xc6af('0x2c')](_0x2b6f6b[_0x3bfcc0['id']],function(_0x914b4d){return{'id':_0x914b4d['id'],'fullname':_0x914b4d[_0xc6af('0x2d')]};});}}catch(_0x48fd96){_0x33e7b2(_0x48fd96);}_0x39052f(_0x3bfcc0);});}function getInteractionTags(_0x2fdc05,_0x1bee8f){return new BPromise(function(_0x370db5,_0x3df4b0){try{if(_0x2fdc05[_0xc6af('0x2e')]){_0x2fdc05[_0xc6af('0x2f')]=[];_0x2fdc05['TagIds']['split'](',')[_0xc6af('0x30')](function(_0x3af591){_0x2fdc05[_0xc6af('0x2f')]['push'](_0x1bee8f[_0x3af591]);});}delete _0x2fdc05['TagIds'];}catch(_0x3b76d0){_0x3df4b0(_0x3b76d0);}_0x370db5(_0x2fdc05);});}function updateOpenchannelInteraction(_0x106726,_0x106611,_0x2ccd8f){return new BPromise(function(_0x33c765,_0x3fd57e){return getInteractionUsers(_0x106726,_0x2ccd8f)[_0xc6af('0x28')](function(_0x362d45){return getInteractionTags(_0x362d45,_0x106611);})['then'](function(_0x1dbf46){return getStateInteraction(_0x1dbf46);})[_0xc6af('0x28')](function(_0xa9f744){_0x33c765(_0xa9f744);})[_0xc6af('0x31')](function(_0x171893){_0x3fd57e(_0x171893);});});}function getStateInteraction(_0x3870b8){return new BPromise(function(_0x4b8e54){_0x3870b8['waiting']=0x0;_0x3870b8[_0xc6af('0x32')]=0x0;_0x3870b8[_0xc6af('0x33')]=0x0;_0x3870b8[_0xc6af('0x34')]=0x0;_0x3870b8['total']=0x0;if(!_0x3870b8[_0xc6af('0x35')]&&!_0x3870b8[_0xc6af('0x36')]){_0x3870b8[_0xc6af('0x37')]+=0x1;}if(!_0x3870b8[_0xc6af('0x35')]&&_0x3870b8['UserId']){_0x3870b8[_0xc6af('0x32')]+=0x1;if(_0x3870b8[_0xc6af('0x37')]){_0x3870b8[_0xc6af('0x37')]-=0x1;}}if(_0x3870b8['closed']&&_0x3870b8['UserId']){_0x3870b8[_0xc6af('0x33')]+=0x1;if(_0x3870b8[_0xc6af('0x32')]){_0x3870b8[_0xc6af('0x32')]-=0x1;}}if(_0x3870b8[_0xc6af('0x35')]&&!_0x3870b8['UserId']){_0x3870b8[_0xc6af('0x34')]+=0x1;if(_0x3870b8[_0xc6af('0x37')]){_0x3870b8[_0xc6af('0x37')]-=0x1;}}_0x3870b8[_0xc6af('0x38')]+=0x1;_0x4b8e54(_0x3870b8);});}exports['index']=function(_0x44edec,_0x1ffadc){var _0x3a247c={},_0x16dbd7={},_0x3e4bcd={'count':0x0,'rows':[]};var _0x2d9986=_[_0xc6af('0x2c')](db['OpenchannelInteraction'][_0xc6af('0x39')],function(_0x2003ba){return{'name':_0x2003ba[_0xc6af('0x3a')],'type':_0x2003ba['type']['key']};});_0x16dbd7[_0xc6af('0x3b')]=_[_0xc6af('0x2c')](_0x2d9986,_0xc6af('0x2a'));_0x16dbd7['query']=_['keys'](_0x44edec['query']);_0x16dbd7['filters']=_['intersection'](_0x16dbd7[_0xc6af('0x3b')],_0x16dbd7[_0xc6af('0x3c')]);_0x3a247c['attributes']=_['intersection'](_0x16dbd7[_0xc6af('0x3b')],qs['fields'](_0x44edec['query'][_0xc6af('0x3d')]));_0x3a247c[_0xc6af('0x3e')]=_0x3a247c['attributes'][_0xc6af('0x3f')]?_0x3a247c['attributes']:_0x16dbd7[_0xc6af('0x3b')];if(!_0x44edec['query'][_0xc6af('0x40')](_0xc6af('0x41'))){_0x3a247c['limit']=qs[_0xc6af('0x1f')](_0x44edec[_0xc6af('0x3c')][_0xc6af('0x1f')]);_0x3a247c[_0xc6af('0x21')]=qs[_0xc6af('0x21')](_0x44edec['query']['offset']);}_0x3a247c['order']=qs['sort'](_0x44edec[_0xc6af('0x3c')][_0xc6af('0x42')]);_0x3a247c[_0xc6af('0x43')]=qs[_0xc6af('0x44')](_[_0xc6af('0x45')](_0x44edec[_0xc6af('0x3c')],_0x16dbd7[_0xc6af('0x44')]),_0x2d9986);var _0x152d6c=[];var _0x459365=squel['select']()[_0xc6af('0x46')]('id')['field'](_0xc6af('0x2a'))[_0xc6af('0x46')](_0xc6af('0x47'))[_0xc6af('0x48')](_0xc6af('0x49'));var _0x15f87f=squel[_0xc6af('0x4a')]()[_0xc6af('0x46')]('u.id')[_0xc6af('0x46')](_0xc6af('0x4b'))[_0xc6af('0x46')](_0xc6af('0x4c'))[_0xc6af('0x48')](_0xc6af('0x4d'),'ui')[_0xc6af('0x4e')]('users','u',_0xc6af('0x4f'));var _0x70b40b=squel[_0xc6af('0x4a')]()[_0xc6af('0x48')](_0xc6af('0x50'),'i')[_0xc6af('0x4e')](_0xc6af('0x51'),'c',_0xc6af('0x52'))[_0xc6af('0x4e')]('users','o',_0xc6af('0x53'))[_0xc6af('0x4e')](_0xc6af('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xc6af('0x4e')](_0xc6af('0x55'),'me',_0xc6af('0x56'))['left_join']('openchannel_interaction_has_tags','it',_0xc6af('0x57'))[_0xc6af('0x4e')](_0xc6af('0x49'),'t','t.id\x20=\x20it.TagId');var _0x3da77b=squel[_0xc6af('0x58')]();var _0x99db9c=[];var _0x2d944a=squel[_0xc6af('0x58')]();var _0x4b4a66;if(_0x44edec['query'][_0xc6af('0x59')]){_0x4b4a66=as[_0xc6af('0x5a')](_0x44edec['query'][_0xc6af('0x59')]);var _0x42be8f=_0x4b4a66[_0xc6af('0x5b')];for(var _0x42a9b5=0x0;_0x42a9b5<_0x4b4a66[_0xc6af('0x5c')][_0xc6af('0x3f')];_0x42a9b5++){var _0x485a7d=_0x4b4a66[_0xc6af('0x5c')][_0x42a9b5];var _0x31ca0b='i';var _0x391e46=_[_0xc6af('0x5d')](_0x2d9986,[_0xc6af('0x2a'),_0x485a7d[_0xc6af('0x46')]]);if(!_0x391e46){switch(_0x485a7d['field']){case'unreadMessages':if(_0x485a7d['value']==0x1){_0x70b40b[_0xc6af('0x5e')]('`'+_0x485a7d[_0xc6af('0x46')]+_0xc6af('0x5f'));}else{_0x70b40b[_0xc6af('0x5e')]('`'+_0x485a7d[_0xc6af('0x46')]+'`\x20>\x200');}break;case'Contact':if(_0x485a7d[_0xc6af('0x60')]===_0xc6af('0x61')){if(_0x485a7d[_0xc6af('0x62')][_0xc6af('0x63')]('\x20')[_0xc6af('0x3f')]>0x1){_0x3da77b[_0x42be8f](_0xc6af('0x64'),qs[_0xc6af('0x65')](_0x485a7d[_0xc6af('0x62')]),null);}else{var _0x3c7e62='%'+_0x485a7d[_0xc6af('0x62')]+'%';_0x3da77b[_0x42be8f](_0xc6af('0x66'),_0x3c7e62,_0x3c7e62,_0x3c7e62);}}else{_0x391e46=_['find'](_0x2d9986,['name',_0xc6af('0x67')]);_0x485a7d[_0xc6af('0x46')]=_0xc6af('0x67');_0xbace77=as['buildExpression'](_0x31ca0b,_0x391e46['type'],_0x485a7d);_0x3da77b[_0x42be8f](_0xbace77[_0xc6af('0x68')],_0xbace77['value'][_0xc6af('0x69')],_0xbace77[_0xc6af('0x62')]['end']);}break;case _0xc6af('0x6a'):var _0x4752bc=_0x485a7d[_0xc6af('0x62')]['split'](',')[_0xc6af('0x2c')](function(_0x3230d9){return Number(_0x3230d9);});_0x4752bc[_0xc6af('0x30')](function(_0x5aaf87){_0x2d944a['or'](_0xc6af('0x6b'),'%,'+_0x5aaf87+',%');});_0x99db9c=_[_0xc6af('0x6c')](_0x99db9c,_0x4752bc);break;case _0xc6af('0x6d'):if(_0x485a7d[_0xc6af('0x60')]===_0xc6af('0x61')){_0x3da77b[_0x42be8f](_0xc6af('0x6e'),'%'+_0x485a7d[_0xc6af('0x62')]+'%',null);}else{_0x391e46=_[_0xc6af('0x5d')](_0x2d9986,['name',_0xc6af('0x36')]);_0x485a7d['field']=_0xc6af('0x36');_0xbace77=as['buildExpression'](_0x31ca0b,_0x391e46[_0xc6af('0x6f')],_0x485a7d);_0x3da77b[_0x42be8f](_0xbace77['text'],_0xbace77[_0xc6af('0x62')]['start'],_0xbace77['value'][_0xc6af('0x1d')]);}break;case _0xc6af('0x70'):_0xbace77=as[_0xc6af('0x71')]('me',null,_0x485a7d);_0x3da77b[_0x42be8f](_0xbace77[_0xc6af('0x68')],_0xbace77['value']['start'],_0xbace77[_0xc6af('0x62')][_0xc6af('0x1d')]);break;}}else{var _0xbace77=as[_0xc6af('0x71')](_0x31ca0b,_0x391e46[_0xc6af('0x6f')],_0x485a7d);_0x3da77b[_0x42be8f](_0xbace77['text'],_0xbace77['value'][_0xc6af('0x69')],_0xbace77[_0xc6af('0x62')][_0xc6af('0x1d')]);}}}else{var _0x1fa529=_(_0x44edec['query'])['keys']()[_0xc6af('0x2c')](function(_0x1a63be){return _[_0xc6af('0x72')](_0x2d9986,['name',_0x1a63be])?_0x1a63be:undefined;})[_0xc6af('0x73')]()['value']();if(!_[_0xc6af('0x74')](_0x1fa529)){_0x1fa529[_0xc6af('0x30')](function(_0x5d144e){if(_0x5d144e===_0xc6af('0x75')){_0x70b40b[_0xc6af('0x43')](_0xc6af('0x76'),[]['concat'](_0x44edec['query'][_0x5d144e]));}else if(_0x5d144e===_0xc6af('0x77')){var _0xf05c87=JSON[_0xc6af('0x78')](_0x44edec[_0xc6af('0x3c')][_0x5d144e])[_0xc6af('0x79')];var _0x2e9b55=JSON[_0xc6af('0x78')](_0x44edec['query'][_0x5d144e])['$lte'];_0x70b40b[_0xc6af('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xf05c87,_0x2e9b55);}else{if(_0x44edec[_0xc6af('0x3c')][_0x5d144e]===_0xc6af('0x7a')){_0x70b40b[_0xc6af('0x43')]('i.'+_0x5d144e+'\x20IS\x20NULL');}else{_0x70b40b[_0xc6af('0x43')]('i.'+_0x5d144e+_0xc6af('0x7b'),_0x44edec['query'][_0x5d144e]);}}});}if(_0x44edec[_0xc6af('0x3c')]['read']){if(_0x44edec[_0xc6af('0x3c')][_0xc6af('0x7c')]==0x1){_0x70b40b[_0xc6af('0x5e')](_0xc6af('0x7d'));}else{_0x70b40b['having'](_0xc6af('0x7e'));}}if(_0x44edec['query'][_0xc6af('0x7f')]){_0x99db9c=_['isArray'](_0x44edec[_0xc6af('0x3c')]['tag'])?_0x44edec[_0xc6af('0x3c')][_0xc6af('0x7f')]:new Array(_0x44edec[_0xc6af('0x3c')][_0xc6af('0x7f')]);_0x99db9c[_0xc6af('0x30')](function(_0x492145){_0x2d944a['or'](_0xc6af('0x6b'),'%,'+_0x492145+',%');});}if(_0x44edec['query'][_0xc6af('0x80')]){var _0x232f0e=_0x44edec[_0xc6af('0x3c')]['filter'][_0xc6af('0x81')]('\x5c','\x5c\x5c')[_0xc6af('0x81')](/'/g,'\x27\x27');if(qs[_0xc6af('0x82')](_0x232f0e)){_0x3da77b['or']('i.id\x20LIKE\x20?',_0x232f0e+'%');}else{_0x3da77b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x232f0e))['or'](_0xc6af('0x83'),_0x232f0e+'%')['or'](_0xc6af('0x84'),_0x232f0e+'%');}}}_0x70b40b[_0xc6af('0x43')](_0x3da77b);_0x70b40b[_0xc6af('0x85')](_0xc6af('0x86'));var _0x249569={'type':db[_0xc6af('0x87')]['QueryTypes'][_0xc6af('0x88')],'raw':!![]};var _0x39a02e=_0x70b40b[_0xc6af('0x89')]();_0x39a02e[_0xc6af('0x46')](_0xc6af('0x86'));_0x39a02e['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc6af('0x8a'));if(_0x3a247c['order']){_0x3a247c[_0xc6af('0x8b')][_0xc6af('0x30')](function(_0x25d710){var _0x4e49d3=_0x25d710[0x0]===_0xc6af('0x8c')?_0x25d710[0x0]:'i.'+_0x25d710[0x0];_0x70b40b[_0xc6af('0x8b')](_0x4e49d3,_0x25d710[0x1]===_0xc6af('0x8d')?![]:!![]);});}if(!_[_0xc6af('0x74')](_0x99db9c)){_0x70b40b['having'](_0x2d944a);_0x39a02e[_0xc6af('0x43')]('t.id\x20IN\x20?',_0x99db9c);}BPromise[_0xc6af('0x8e')]()[_0xc6af('0x28')](function(){if(!_0x4b4a66){if(_0x44edec['query'][_0xc6af('0x75')])return;_0x39a02e[_0xc6af('0x43')](_0xc6af('0x8f'));_0x70b40b[_0xc6af('0x43')](_0xc6af('0x8f'));return;}if(_0x44edec['user']['role']!=='agent')return;return _0x44edec[_0xc6af('0x90')][_0xc6af('0x91')]({'attributes':['id'],'raw':!![]})[_0xc6af('0x28')](function(_0x822a1){if(_['isEmpty'](_0x822a1)){_0x39a02e['where'](_0xc6af('0x92'));_0x70b40b[_0xc6af('0x43')](_0xc6af('0x92'));}else{_0x39a02e[_0xc6af('0x43')](_0xc6af('0x76'),_['map'](_0x822a1,'id'));_0x70b40b[_0xc6af('0x43')](_0xc6af('0x76'),_[_0xc6af('0x2c')](_0x822a1,'id'));}});})[_0xc6af('0x28')](function(){if(_0x44edec[_0xc6af('0x90')][_0xc6af('0x93')]==='agent'&&!_0x4b4a66&&!_0x44edec[_0xc6af('0x3c')][_0xc6af('0x75')])return[];return db[_0xc6af('0x94')][_0xc6af('0x3c')](_0x39a02e[_0xc6af('0x95')](),_0x249569);})[_0xc6af('0x28')](function(_0x3fb17c){_0x3e4bcd['count']=_0x3fb17c['length'];if(_0x3e4bcd['count']===0x0)return[];return db[_0xc6af('0x94')][_0xc6af('0x3c')](_0x459365['toString'](),_0x249569)[_0xc6af('0x28')](function(_0x4b78b5){_0x152d6c=_[_0xc6af('0x96')](_0x4b78b5,'id');_0x249569=_[_0xc6af('0x97')](_0x249569,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44edec[_0xc6af('0x3c')]['fields']){_0x3a247c[_0xc6af('0x3e')]['forEach'](function(_0x174ee7){_0x70b40b[_0xc6af('0x46')]('i.'+_0x174ee7);});}else{_0x70b40b[_0xc6af('0x46')](_0xc6af('0x98'),_0xc6af('0x8a'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0x99'),_0xc6af('0x9a'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0x9b'),'Account.mandatoryDisposition');_0x70b40b[_0xc6af('0x46')](_0xc6af('0x9c'),_0xc6af('0x8c'));_0x70b40b[_0xc6af('0x46')]('i.*');_0x70b40b['field'](_0xc6af('0x9d'),_0xc6af('0x9e'));_0x70b40b['field'](_0xc6af('0x9f'),'Contact.lastName');_0x70b40b['field'](_0xc6af('0xa0'),_0xc6af('0xa1'));_0x70b40b['field'](_0xc6af('0xa2'),_0xc6af('0xa3'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0xa4'),'Contact.mobile');_0x70b40b[_0xc6af('0x46')](_0xc6af('0xa5'),_0xc6af('0xa6'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0xa7'),_0xc6af('0xa8'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0xa9'),_0xc6af('0xaa'));_0x70b40b[_0xc6af('0x46')](_0xc6af('0xab'),_0xc6af('0x2e'));}if(_0x3a247c[_0xc6af('0x1f')])_0x70b40b['limit'](_0x3a247c['limit']);if(_0x3a247c[_0xc6af('0x21')])_0x70b40b[_0xc6af('0x21')](_0x3a247c['offset']);return db[_0xc6af('0x94')][_0xc6af('0x3c')](_0x70b40b[_0xc6af('0x95')](),_0x249569);})[_0xc6af('0x28')](function(_0x366b51){if(_0x366b51[_0xc6af('0x3f')]>0x0)_0x15f87f[_0xc6af('0x43')](_0xc6af('0xac'),_[_0xc6af('0x2c')](_0x366b51,'id'));return db[_0xc6af('0x94')][_0xc6af('0x3c')](_0x15f87f['toString'](),_0x249569)[_0xc6af('0x28')](function(_0x74267c){var _0xec4daa=_['groupBy'](_0x74267c,_0xc6af('0xad'));var _0xe9e422=[];_0x366b51['forEach'](function(_0x639a22){_0xe9e422[_0xc6af('0xae')](updateOpenchannelInteraction(_0x639a22,_0x152d6c,_0xec4daa));});return BPromise['all'](_0xe9e422);});});})[_0xc6af('0x28')](function(_0x20886e){_0x3e4bcd[_0xc6af('0xaf')]=_0x20886e;return _0x3e4bcd;})[_0xc6af('0x28')](respondWithFilteredResult(_0x1ffadc,_0x3a247c))[_0xc6af('0x31')](handleError(_0x1ffadc,null));};exports[_0xc6af('0xb0')]=function(_0x55b25f,_0x2ccb04){var _0x4b0552={};if(_0x55b25f[_0xc6af('0x3c')][_0xc6af('0x6f')]&&_0x55b25f[_0xc6af('0x3c')][_0xc6af('0x6f')]===_0xc6af('0x48')){_0x4b0552['from']=_0x55b25f[_0xc6af('0xb1')]['id'];}else{_0x4b0552['id']=_0x55b25f[_0xc6af('0xb1')]['id'];}var _0xf1ac5f={'raw':![],'where':_0x4b0552},_0x9f40d2={};_0x9f40d2['model']=_['keys'](db[_0xc6af('0xb2')][_0xc6af('0x39')]);_0x9f40d2[_0xc6af('0x3c')]=_[_0xc6af('0xb3')](_0x55b25f[_0xc6af('0x3c')]);_0x9f40d2['filters']=_['intersection'](_0x9f40d2[_0xc6af('0x3b')],_0x9f40d2['query']);_0xf1ac5f[_0xc6af('0x3e')]=_[_0xc6af('0xb4')](_0x9f40d2[_0xc6af('0x3b')],qs[_0xc6af('0x3d')](_0x55b25f[_0xc6af('0x3c')][_0xc6af('0x3d')]));_0xf1ac5f['attributes']=_0xf1ac5f['attributes'][_0xc6af('0x3f')]?_0xf1ac5f[_0xc6af('0x3e')]:_0x9f40d2[_0xc6af('0x3b')];if(_0x55b25f[_0xc6af('0x3c')][_0xc6af('0xb5')]){_0xf1ac5f['include']=[{'all':!![]}];}_0xf1ac5f=_[_0xc6af('0x97')]({},_0xf1ac5f,_0x55b25f[_0xc6af('0xb6')]);return db[_0xc6af('0xb2')][_0xc6af('0x5d')](_0xf1ac5f)[_0xc6af('0x28')](handleEntityNotFound(_0x2ccb04,null))[_0xc6af('0x28')](respondWithResult(_0x2ccb04,null))[_0xc6af('0x31')](handleError(_0x2ccb04,null));};exports['create']=function(_0x23b57f,_0x1d61e6){return db[_0xc6af('0xb2')][_0xc6af('0xb7')](_0x23b57f[_0xc6af('0x70')],{})['then'](respondWithResult(_0x1d61e6,0xc9))[_0xc6af('0x31')](handleError(_0x1d61e6,null));};exports[_0xc6af('0x27')]=function(_0x24563f,_0xecebb){if(_0x24563f[_0xc6af('0x70')]['id']){delete _0x24563f[_0xc6af('0x70')]['id'];}return db['OpenchannelInteraction'][_0xc6af('0x5d')]({'where':{'id':_0x24563f['params']['id']}})['then'](handleEntityNotFound(_0xecebb,null))[_0xc6af('0x28')](saveUpdates(_0x24563f[_0xc6af('0x70')],null))[_0xc6af('0x28')](respondWithResult(_0xecebb,null))[_0xc6af('0x31')](handleError(_0xecebb,null));};exports['destroy']=function(_0x5dbe73,_0x480d69){return db[_0xc6af('0xb2')][_0xc6af('0x5d')]({'where':{'id':_0x5dbe73[_0xc6af('0xb1')]['id']}})[_0xc6af('0x28')](handleEntityNotFound(_0x480d69,null))['then'](removeEntity(_0x480d69,null))[_0xc6af('0x31')](handleError(_0x480d69,null));};exports[_0xc6af('0xb8')]=function(_0x4426cc,_0x396105){return db['OpenchannelInteraction'][_0xc6af('0xb8')]()[_0xc6af('0x28')](respondWithResult(_0x396105,null))['catch'](handleError(_0x396105,null));};exports['addMessage']=function(_0x260c3c,_0x511d8d,_0x959d57){return db['OpenchannelMessage'][_0xc6af('0x5d')]({'where':{'id':_0x260c3c[_0xc6af('0xb1')]['id']}})['then'](handleEntityNotFound(_0x511d8d,null))['then'](function(_0xb14e4f){if(_0xb14e4f){return _0xb14e4f[_0xc6af('0xb9')](_0x260c3c['body'][_0xc6af('0xba')],_[_0xc6af('0xbb')](_0x260c3c['body'],[_0xc6af('0xba'),'id'])||{});}})['then'](respondWithResult(_0x511d8d,null))['catch'](handleError(_0x511d8d,null));};exports['getMessages']=function(_0x112abb,_0x15a450,_0x466d86){var _0x265b6b={'raw':![],'where':{}};var _0x576eb8={};var _0x2f42d9={'count':0x0,'rows':[]};return db[_0xc6af('0xb2')]['findOne']({'where':{'id':_0x112abb[_0xc6af('0xb1')]['id']}})[_0xc6af('0x28')](handleEntityNotFound(_0x15a450,null))[_0xc6af('0x28')](function(_0x7184a4){if(_0x7184a4){_0x576eb8[_0xc6af('0x3b')]=_[_0xc6af('0xb3')](db[_0xc6af('0xbc')]['rawAttributes']);_0x576eb8[_0xc6af('0x3c')]=_[_0xc6af('0xb3')](_0x112abb[_0xc6af('0x3c')]);_0x576eb8[_0xc6af('0x44')]=_[_0xc6af('0xb4')](_0x576eb8[_0xc6af('0x3b')],_0x576eb8['query']);_0x265b6b[_0xc6af('0x3e')]=_[_0xc6af('0xb4')](_0x576eb8['model'],qs[_0xc6af('0x3d')](_0x112abb[_0xc6af('0x3c')][_0xc6af('0x3d')]));_0x265b6b[_0xc6af('0x3e')]=_0x265b6b[_0xc6af('0x3e')][_0xc6af('0x3f')]?_0x265b6b[_0xc6af('0x3e')]:_0x576eb8['model'];if(!_0x112abb[_0xc6af('0x3c')][_0xc6af('0x40')](_0xc6af('0x41'))){_0x265b6b[_0xc6af('0x1f')]=qs[_0xc6af('0x1f')](_0x112abb['query']['limit']);_0x265b6b['offset']=qs[_0xc6af('0x21')](_0x112abb[_0xc6af('0x3c')][_0xc6af('0x21')]);}_0x265b6b['order']=qs[_0xc6af('0x42')](_0x112abb['query'][_0xc6af('0x42')]);_0x265b6b[_0xc6af('0x43')]=qs[_0xc6af('0x44')](_['pick'](_0x112abb['query'],_0x576eb8[_0xc6af('0x44')]));_0x265b6b['where'][_0xc6af('0xad')]=_0x7184a4['id'];if(_0x112abb[_0xc6af('0x3c')][_0xc6af('0x80')]){_0x265b6b['where']=_[_0xc6af('0x97')](_0x265b6b[_0xc6af('0x43')],{'$or':_[_0xc6af('0x2c')](_0x265b6b[_0xc6af('0x3e')],function(_0x5f4308){var _0x4063d8={};_0x4063d8[_0x5f4308]={'$like':'%'+_0x112abb[_0xc6af('0x3c')][_0xc6af('0x80')]+'%'};return _0x4063d8;})});}if(_0x112abb[_0xc6af('0x3c')]['$gte']){var _0x537074=_0x112abb['query'][_0xc6af('0x79')][_0xc6af('0x63')](',');var _0x469990={};_0x469990[_0x537074[0x0]]={'$gte':moment(_0x537074[0x1])[_0xc6af('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')};_0x265b6b[_0xc6af('0x43')]=_['merge'](_0x265b6b[_0xc6af('0x43')],_0x469990);}_0x265b6b=_[_0xc6af('0x97')]({},_0x265b6b,_0x112abb['options']);return db[_0xc6af('0xbc')]['count']({'where':_0x265b6b[_0xc6af('0x43')]})[_0xc6af('0x28')](function(_0x4f5015){_0x2f42d9[_0xc6af('0x20')]=_0x4f5015;if(_0x112abb['query'][_0xc6af('0xb5')]){_0x265b6b[_0xc6af('0xbe')]=[{'all':!![]}];}return db[_0xc6af('0xbc')][_0xc6af('0xbf')](_0x265b6b);})['then'](function(_0x191dcd){_0x2f42d9[_0xc6af('0xaf')]=_0x191dcd;return _0x2f42d9;});}})[_0xc6af('0x28')](respondWithFilteredResult(_0x15a450,_0x265b6b))['catch'](handleError(_0x15a450,null));};exports['addTags']=function(_0x2e39cb,_0x4a5a28,_0x2fcb36){return db[_0xc6af('0xb2')]['find']({'where':{'id':_0x2e39cb[_0xc6af('0xb1')]['id']}})[_0xc6af('0x28')](handleEntityNotFound(_0x4a5a28,null))[_0xc6af('0x28')](function(_0x519681){if(_0x519681){return _0x519681[_0xc6af('0xc0')](_0x2e39cb[_0xc6af('0x70')][_0xc6af('0xba')],_[_0xc6af('0xbb')](_0x2e39cb['body'],[_0xc6af('0xba'),'id'])||{})[_0xc6af('0xc1')](function(){return db[_0xc6af('0x6a')][_0xc6af('0xbf')]({'attributes':['id',_0xc6af('0x2a'),'color'],'where':{'id':_0x2e39cb[_0xc6af('0x70')][_0xc6af('0xba')]}});})[_0xc6af('0x28')](function(_0xa8f8f7){socket[_0xc6af('0xc2')]('openchannelInteractionTags:save',{'id':Number(_0x2e39cb[_0xc6af('0xb1')]['id']),'tags':_0xa8f8f7||[]});return{'id':Number(_0x2e39cb[_0xc6af('0xb1')]['id']),'tags':_0xa8f8f7||[]};});}})['then'](respondWithResult(_0x4a5a28,null))[_0xc6af('0x31')](handleError(_0x4a5a28,null));};exports[_0xc6af('0xc3')]=function(_0x2acaa8,_0x297d43,_0x3dab8a){return db['OpenchannelInteraction'][_0xc6af('0x5d')]({'where':{'id':_0x2acaa8[_0xc6af('0xb1')]['id']}})['then'](handleEntityNotFound(_0x297d43,null))[_0xc6af('0x28')](function(_0x385ba9){if(_0x385ba9){return _0x385ba9['removeTags'](_0x2acaa8[_0xc6af('0x3c')][_0xc6af('0xba')]);}})[_0xc6af('0x28')](respondWithStatusCode(_0x297d43,null))[_0xc6af('0x31')](handleError(_0x297d43,null));};exports[_0xc6af('0xc4')]=function(_0x492fe5,_0x4e95dc){var _0x46adf5=moment()[_0xc6af('0xc5')]()[_0xc6af('0x95')]();var _0x125f00=path['join'](config['root'],_0xc6af('0xc6'),'files','tmp');var _0x23e16a=path[_0xc6af('0xc7')](config[_0xc6af('0xc8')],_0xc6af('0xc6'),'files',_0xc6af('0xc9'));var _0x2153fc=path['join'](_0x125f00,_0x46adf5);var _0x1ef49a=util[_0xc6af('0xbd')](_0xc6af('0xca'),_0x492fe5[_0xc6af('0xb1')]['id'],_0x46adf5);var _0x223383=path[_0xc6af('0xc7')](_0x125f00,_0x1ef49a);var _0x53d967=[];_0x53d967[_0xc6af('0xae')]({'model':db['User'],'as':'User','attributes':['id',_0xc6af('0x2d')],'raw':!![]});_0x53d967[_0xc6af('0xae')]({'model':db['CmContact'],'as':_0xc6af('0xcb'),'attributes':['id',_0xc6af('0xcc'),'lastName'],'raw':!![]});if(_0x492fe5[_0xc6af('0x3c')][_0xc6af('0xc9')]){_0x53d967['push']({'model':db[_0xc6af('0xcd')],'as':_0xc6af('0xcd'),'raw':!![]});}var _0x47633b=[{'model':db['OpenchannelMessage'],'as':_0xc6af('0xce'),'attributes':['id',_0xc6af('0x70'),_0xc6af('0x77'),_0xc6af('0xcf'),_0xc6af('0xd0'),_0xc6af('0x7c')],'include':_0x53d967}];_0x47633b['push']({'model':db[_0xc6af('0xd1')],'as':_0xc6af('0xd2'),'attributes':['id','name']});_0x47633b[_0xc6af('0xae')]({'model':db[_0xc6af('0x6d')],'as':_0xc6af('0xd3'),'attributes':['id',_0xc6af('0x2d')]});return db['OpenchannelInteraction'][_0xc6af('0x5d')]({'where':{'id':_0x492fe5[_0xc6af('0xb1')]['id']},'include':_0x47633b})[_0xc6af('0x28')](handleEntityNotFound(_0x4e95dc,null))[_0xc6af('0x28')](function(_0x1e9a93){if(_0x1e9a93){var _0x26e158=_0x1e9a93['get']({'plain':!![]});fs[_0xc6af('0xd4')](_0x2153fc);var _0x1f278d={'channel':'Openchannel','account':_0x26e158['Account'][_0xc6af('0x2a')],'agent':_0x26e158['Owner']?_0x26e158[_0xc6af('0xd3')][_0xc6af('0x2d')]:'N.A.','createdAt':moment(_0x26e158[_0xc6af('0x77')])[_0xc6af('0xbd')](_0xc6af('0xd5'))['toString'](),'closedAt':_0x26e158[_0xc6af('0x35')]?moment(_0x26e158[_0xc6af('0xd6')])[_0xc6af('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc6af('0x95')]():'','disposition':_0x26e158[_0xc6af('0xd7')],'visibility':_0x26e158[_0xc6af('0xd8')]?_0xc6af('0xd9'):_0xc6af('0xda'),'messages':_(_0x26e158['Messages'])[_0xc6af('0x80')]({'secret':![]})[_0xc6af('0x2c')](function(_0x53172c){if(_0x53172c['Attachment']){var _0x2074e=path[_0xc6af('0xc7')](_0x23e16a,_0x53172c['Attachment'][_0xc6af('0xdb')]);if(fs[_0xc6af('0xdc')](_0x2074e)){fs[_0xc6af('0xdd')](_0x2074e)['pipe'](fs[_0xc6af('0xde')](path[_0xc6af('0xc7')](_0x2153fc,_0x53172c[_0xc6af('0xcd')][_0xc6af('0xdb')])));}}return{'date':moment(_0x53172c[_0xc6af('0x77')])[_0xc6af('0xbd')](_0xc6af('0xd5'))[_0xc6af('0x95')](),'sender':_0x53172c['direction']===_0xc6af('0xdf')?_0x53172c[_0xc6af('0x6d')]?_0x53172c[_0xc6af('0x6d')][_0xc6af('0x2d')]:_0xc6af('0xe0'):_0x53172c[_0xc6af('0xcb')][_0xc6af('0xcc')]+(_0x53172c[_0xc6af('0xcb')]['lastName']?'\x20'+_0x53172c[_0xc6af('0xcb')][_0xc6af('0xe1')]:''),'body':_0x53172c['Attachment']?_0x53172c[_0xc6af('0xcd')]['basename']:_0x53172c['body'],'direction':_0x53172c['direction']===_0xc6af('0xdf')?'A':'C','secret':_0x53172c[_0xc6af('0xd0')],'read':_0x53172c[_0xc6af('0x7c')],'attachment':_0x53172c[_0xc6af('0xcd')]};})[_0xc6af('0x62')]()};return ejs[_0xc6af('0xe2')](path[_0xc6af('0xc7')](config[_0xc6af('0xc8')],_0xc6af('0xc6'),_0xc6af('0xe3'),_0xc6af('0xe4')),{'interaction':_0x1f278d})[_0xc6af('0x28')](function(_0x3d1ee4){var _0x3df2b5=path[_0xc6af('0xc7')](_0x2153fc,_0xc6af('0xe5')+_0x26e158['id']+'-'+_0x46adf5+_0xc6af('0xe6'));var _0x7108f={'path':_0x3df2b5,'channel':_0xc6af('0xe7'),'interactionId':_0x26e158['id']};return pdf[_0xc6af('0xe8')](_0x3d1ee4,_0x7108f);})[_0xc6af('0x28')](function(){return new BPromise(function(_0x51c3ee,_0xf3d25f){zipdir(_0x2153fc,{'saveTo':_0x223383},function(_0x40e8fb,_0x4eb440){if(_0x40e8fb)return _0xf3d25f(_0x40e8fb);return _0x51c3ee(_0x4eb440);});})[_0xc6af('0x28')](function(){return new BPromise(function(_0x2b9c84,_0x11827c){rimraf(_0x2153fc,function(_0x302e76){if(_0x302e76)_0x11827c(_0x302e76);return _0x2b9c84();});});})[_0xc6af('0x28')](function(){return _0x4e95dc[_0xc6af('0xc4')](_0x223383,_0x1ef49a,function(_0x562836){if(_0x562836){console['log'](_0xc6af('0xe9'),_0x562836);}else{fs[_0xc6af('0xea')](_0x223383);}});});});}else{return _0x4e95dc[_0xc6af('0x1b')](0xc8);}})[_0xc6af('0x31')](handleError(_0x4e95dc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 00ac161..a52db1c 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 _0x38f1=['findAll','length','emit','catch','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','update','getUsers','then','setDataValue','Users'];(function(_0x4dd0a7,_0xb4399f){var _0x487e9b=function(_0x355738){while(--_0x355738){_0x4dd0a7['push'](_0x4dd0a7['shift']());}};_0x487e9b(++_0xb4399f);}(_0x38f1,0xae));var _0x138f=function(_0x23516c,_0x16ea34){_0x23516c=_0x23516c-0x0;var _0x591310=_0x38f1[_0x23516c];return _0x591310;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x138f('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x138f('0x0'))['db'][_0x138f('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x138f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x138f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b78b9){return function(_0x2f0838,_0x4b6762,_0x236dca){_0x2f0838[_0x138f('0x4')]({'attributes':['id'],'raw':!![]})[_0x138f('0x5')](function(_0x4b4c2c){_0x2f0838[_0x138f('0x6')](_0x138f('0x7'),_0x4b4c2c['map'](function(_0x1cd972){return{'id':_0x1cd972['id']};}));return OpenchannelMessage[_0x138f('0x8')]({'where':{'OpenchannelInteractionId':_0x2f0838['id'],'direction':'in','read':![]},'raw':!![]});})[_0x138f('0x5')](function(_0x1aa5bd){_0x2f0838[_0x138f('0x6')]('unreadMessages',_0x1aa5bd[_0x138f('0x9')]);OpenchannelInteractionEvents['emit'](_0x2b78b9+':'+_0x2f0838['id'],_0x2f0838);OpenchannelInteractionEvents[_0x138f('0xa')](_0x2b78b9,_0x2f0838);_0x236dca(null);})[_0x138f('0xb')](_0x236dca(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x138f('0xc')](e,emitEvent(event));}}module[_0x138f('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x64f9=['findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map'];(function(_0x26e782,_0x2f9b47){var _0x823b67=function(_0x9ba8fd){while(--_0x9ba8fd){_0x26e782['push'](_0x26e782['shift']());}};_0x823b67(++_0x2f9b47);}(_0x64f9,0x16e));var _0x964f=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x64f9[_0x33c9f8];return _0x2d7004;};'use strict';var EventEmitter=require(_0x964f('0x0'));var OpenchannelInteraction=require(_0x964f('0x1'))['db'][_0x964f('0x2')];var OpenchannelMessage=require(_0x964f('0x1'))['db'][_0x964f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x964f('0x4')](0x0);var events={'afterCreate':_0x964f('0x5'),'afterUpdate':_0x964f('0x6'),'afterDestroy':_0x964f('0x7')};function emitEvent(_0x149449){return function(_0x4dc1ef,_0x344977,_0x7a1c2a){_0x4dc1ef[_0x964f('0x8')]({'attributes':['id'],'raw':!![]})[_0x964f('0x9')](function(_0x804b3a){_0x4dc1ef['setDataValue'](_0x964f('0xa'),_0x804b3a[_0x964f('0xb')](function(_0x37032b){return{'id':_0x37032b['id']};}));return OpenchannelMessage[_0x964f('0xc')]({'where':{'OpenchannelInteractionId':_0x4dc1ef['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51fb77){_0x4dc1ef[_0x964f('0xd')](_0x964f('0xe'),_0x51fb77['length']);OpenchannelInteractionEvents[_0x964f('0xf')](_0x149449+':'+_0x4dc1ef['id'],_0x4dc1ef);OpenchannelInteractionEvents[_0x964f('0xf')](_0x149449,_0x4dc1ef);_0x7a1c2a(null);})[_0x964f('0x10')](_0x7a1c2a(null));};}for(var e in events){if(events[_0x964f('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index fe7b0fc..35835b5 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 _0x8ead=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format'];(function(_0x36e9df,_0x3749ff){var _0x3ddf0d=function(_0x51b462){while(--_0x51b462){_0x36e9df['push'](_0x36e9df['shift']());}};_0x3ddf0d(++_0x3749ff);}(_0x8ead,0x133));var _0xd8ea=function(_0x4342a4,_0x5c38d7){_0x4342a4=_0x4342a4-0x0;var _0x48fce6=_0x8ead[_0x4342a4];return _0x48fce6;};'use strict';var _=require(_0xd8ea('0x0'));var util=require('util');var logger=require(_0xd8ea('0x1'))(_0xd8ea('0x2'));var moment=require(_0xd8ea('0x3'));var BPromise=require(_0xd8ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8ea('0x5'));var config=require(_0xd8ea('0x6'));var attributes=require(_0xd8ea('0x7'));module[_0xd8ea('0x8')]=function(_0x348514,_0xa05dd){return _0x348514[_0xd8ea('0x9')](_0xd8ea('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8ea('0xb'),'collate':_0xd8ea('0xc'),'hooks':{'beforeUpdate':function(_0x15a65b,_0x21cf1d,_0x4c8098){if(_0x15a65b['changed'](_0xd8ea('0xd'))){_0x15a65b[_0xd8ea('0xe')]=moment()[_0xd8ea('0xf')](_0xd8ea('0x10'));}_0x4c8098(null,_0x15a65b);}}});}; \ No newline at end of file +var _0x5855=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x5855,0xc9));var _0x5585=function(_0x157298,_0x2f1dd2){_0x157298=_0x157298-0x0;var _0x43368c=_0x5855[_0x157298];return _0x43368c;};'use strict';var _=require(_0x5585('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5585('0x1'));var moment=require(_0x5585('0x2'));var BPromise=require(_0x5585('0x3'));var rp=require(_0x5585('0x4'));var fs=require('fs');var path=require(_0x5585('0x5'));var rimraf=require(_0x5585('0x6'));var config=require(_0x5585('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x5585('0x8')]=function(_0x5cf18d,_0x308d61){return _0x5cf18d[_0x5585('0x9')](_0x5585('0xa'),attributes,{'tableName':_0x5585('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5585('0xc'),'collate':_0x5585('0xd'),'hooks':{'beforeUpdate':function(_0x54baa3,_0x294ef9,_0x405af7){if(_0x54baa3['changed'](_0x5585('0xe'))){_0x54baa3['closedAt']=moment()[_0x5585('0xf')](_0x5585('0x10'));}_0x405af7(null,_0x54baa3);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 521306a..bf14810 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 _0xa9b2=['AddTags','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','info','debug'];(function(_0x383f4b,_0x5218d2){var _0xef69b4=function(_0x4f43e2){while(--_0x4f43e2){_0x383f4b['push'](_0x383f4b['shift']());}};_0xef69b4(++_0x5218d2);}(_0xa9b2,0xeb));var _0x2a9b=function(_0x2986fb,_0x9482a0){_0x2986fb=_0x2986fb-0x0;var _0xb3c156=_0xa9b2[_0x2986fb];return _0xb3c156;};'use strict';var _=require('lodash');var util=require(_0x2a9b('0x0'));var moment=require('moment');var BPromise=require(_0x2a9b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a9b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a9b('0x3'));var logger=require(_0x2a9b('0x4'))(_0x2a9b('0x5'));var config=require(_0x2a9b('0x6'));var jayson=require(_0x2a9b('0x7'));var client=jayson[_0x2a9b('0x8')]['http']({'port':0x232a});config[_0x2a9b('0x9')]=_[_0x2a9b('0xa')](config[_0x2a9b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2a9b('0xb'))[_0x2a9b('0xc')](socket);function respondWithRpcPromise(_0x247756,_0x590fd6,_0x4b3434){return new BPromise(function(_0x31ce44,_0x4145cc){return client[_0x2a9b('0xd')](_0x247756,_0x4b3434)[_0x2a9b('0xe')](function(_0x472fb7){logger['info'](_0x2a9b('0xf'),_0x590fd6,_0x2a9b('0x10'));logger['debug'](_0x2a9b('0x11'),_0x590fd6,_0x2a9b('0x10'),JSON[_0x2a9b('0x12')](_0x472fb7));if(_0x472fb7[_0x2a9b('0x13')]){if(_0x472fb7[_0x2a9b('0x13')][_0x2a9b('0x14')]===0x1f4){logger[_0x2a9b('0x13')](_0x2a9b('0xf'),_0x590fd6,_0x472fb7[_0x2a9b('0x13')]['message']);return _0x4145cc(_0x472fb7[_0x2a9b('0x13')][_0x2a9b('0x15')]);}logger[_0x2a9b('0x13')](_0x2a9b('0xf'),_0x590fd6,_0x472fb7[_0x2a9b('0x13')][_0x2a9b('0x15')]);return _0x31ce44(_0x472fb7[_0x2a9b('0x13')][_0x2a9b('0x15')]);}else{logger['info'](_0x2a9b('0xf'),_0x590fd6,'request\x20sent');_0x31ce44(_0x472fb7[_0x2a9b('0x16')][_0x2a9b('0x15')]);}})[_0x2a9b('0x17')](function(_0x28a47c){logger[_0x2a9b('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x590fd6,_0x28a47c);_0x4145cc(_0x28a47c);});});}exports['UpdateOpenchannelInteraction']=function(_0x96750e){var _0x31a87a=this;return new Promise(function(_0x50d026,_0x5d5c02){return db[_0x2a9b('0x18')][_0x2a9b('0x19')](_0x96750e[_0x2a9b('0x1a')],{'raw':_0x96750e['options']?_0x96750e[_0x2a9b('0x1b')][_0x2a9b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96750e['options']?_0x96750e[_0x2a9b('0x1b')]['where']||null:null,'attributes':_0x96750e['options']?_0x96750e[_0x2a9b('0x1b')]['attributes']||null:null,'limit':_0x96750e[_0x2a9b('0x1b')]?_0x96750e[_0x2a9b('0x1b')][_0x2a9b('0x1d')]||null:null})[_0x2a9b('0xe')](function(_0x44b2af){logger['info']('UpdateOpenchannelInteraction',_0x96750e);logger['debug'](_0x2a9b('0x1e'),_0x96750e,JSON[_0x2a9b('0x12')](_0x44b2af));_0x50d026(_0x44b2af);})[_0x2a9b('0x17')](function(_0x170cdd){logger[_0x2a9b('0x13')](_0x2a9b('0x1e'),_0x170cdd[_0x2a9b('0x15')],_0x96750e);_0x5d5c02(_0x31a87a['error'](0x1f4,_0x170cdd[_0x2a9b('0x15')]));});});};exports[_0x2a9b('0x1f')]=function(_0x5c7d17){return new Promise(function(_0x2f73f5,_0x1bf97f){return db[_0x2a9b('0x18')]['find']({'where':_0x5c7d17[_0x2a9b('0x1b')]?_0x5c7d17[_0x2a9b('0x1b')]['where']||null:null})[_0x2a9b('0xe')](function(_0x1bec19){if(_0x1bec19){return _0x1bec19[_0x2a9b('0x20')](_0x5c7d17[_0x2a9b('0x1a')][_0x2a9b('0x21')],_[_0x2a9b('0x22')](_0x5c7d17['body'],[_0x2a9b('0x21'),'id'])||{});}})[_0x2a9b('0x23')](function(_0x2d4ef6){logger[_0x2a9b('0x24')]('AddTags',_0x5c7d17);logger[_0x2a9b('0x25')]('AddTags',_0x5c7d17,JSON[_0x2a9b('0x12')](_0x2d4ef6));_0x2f73f5(_0x2d4ef6);})[_0x2a9b('0x17')](function(_0x58ad5e){logger[_0x2a9b('0x13')](_0x2a9b('0x26'),_0x58ad5e['message'],_0x5c7d17);_0x1bf97f(_this[_0x2a9b('0x13')](0x1f4,_0x58ad5e['message']));});});}; \ No newline at end of file +var _0x012d=['find','where','then','addTags','ids','omit','spread','AddTags','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','result','message','catch','OpenchannelInteraction','update','body','options','raw','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x514eba,_0x263620){var _0x1599b4=function(_0x5e8898){while(--_0x5e8898){_0x514eba['push'](_0x514eba['shift']());}};_0x1599b4(++_0x263620);}(_0x012d,0x18e));var _0xd012=function(_0x3e1958,_0x47d6e5){_0x3e1958=_0x3e1958-0x0;var _0x3c72f5=_0x012d[_0x3e1958];return _0x3c72f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd012('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd012('0x1'))['db'];var utils=require(_0xd012('0x2'));var logger=require('../../config/logger')(_0xd012('0x3'));var config=require('../../config/environment');var jayson=require(_0xd012('0x4'));var client=jayson[_0xd012('0x5')][_0xd012('0x6')]({'port':0x232a});config[_0xd012('0x7')]=_['defaults'](config[_0xd012('0x7')],{'host':_0xd012('0x8'),'port':0x18eb});var socket=require(_0xd012('0x9'))(new Redis(config[_0xd012('0x7')]));require('./openchannelInteraction.socket')[_0xd012('0xa')](socket);function respondWithRpcPromise(_0x260066,_0x1d3f6e,_0x4870fa){return new BPromise(function(_0x1085e2,_0x1e32b2){return client[_0xd012('0xb')](_0x260066,_0x4870fa)['then'](function(_0x55f8d5){logger[_0xd012('0xc')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d3f6e,'request\x20sent');logger[_0xd012('0xd')](_0xd012('0xe'),_0x1d3f6e,_0xd012('0xf'),JSON[_0xd012('0x10')](_0x55f8d5));if(_0x55f8d5[_0xd012('0x11')]){if(_0x55f8d5[_0xd012('0x11')]['code']===0x1f4){logger[_0xd012('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d3f6e,_0x55f8d5[_0xd012('0x11')]['message']);return _0x1e32b2(_0x55f8d5[_0xd012('0x11')]['message']);}logger[_0xd012('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d3f6e,_0x55f8d5[_0xd012('0x11')]['message']);return _0x1085e2(_0x55f8d5['error']['message']);}else{logger[_0xd012('0xc')](_0xd012('0x12'),_0x1d3f6e,_0xd012('0xf'));_0x1085e2(_0x55f8d5[_0xd012('0x13')][_0xd012('0x14')]);}})[_0xd012('0x15')](function(_0x450906){logger['error'](_0xd012('0x12'),_0x1d3f6e,_0x450906);_0x1e32b2(_0x450906);});});}exports['UpdateOpenchannelInteraction']=function(_0x5c82af){var _0x233727=this;return new Promise(function(_0x48b7fa,_0x306c30){return db[_0xd012('0x16')][_0xd012('0x17')](_0x5c82af[_0xd012('0x18')],{'raw':_0x5c82af[_0xd012('0x19')]?_0x5c82af[_0xd012('0x19')][_0xd012('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c82af['options']?_0x5c82af[_0xd012('0x19')]['where']||null:null,'attributes':_0x5c82af[_0xd012('0x19')]?_0x5c82af[_0xd012('0x19')][_0xd012('0x1b')]||null:null,'limit':_0x5c82af['options']?_0x5c82af[_0xd012('0x19')][_0xd012('0x1c')]||null:null})['then'](function(_0x22f56b){logger[_0xd012('0xc')](_0xd012('0x1d'),_0x5c82af);logger['debug'](_0xd012('0x1d'),_0x5c82af,JSON[_0xd012('0x10')](_0x22f56b));_0x48b7fa(_0x22f56b);})['catch'](function(_0x268930){logger[_0xd012('0x11')]('UpdateOpenchannelInteraction',_0x268930['message'],_0x5c82af);_0x306c30(_0x233727[_0xd012('0x11')](0x1f4,_0x268930[_0xd012('0x14')]));});});};exports[_0xd012('0x1e')]=function(_0x504c85){return new Promise(function(_0x3bee73,_0x59981a){return db[_0xd012('0x16')][_0xd012('0x1f')]({'where':_0x504c85['options']?_0x504c85[_0xd012('0x19')][_0xd012('0x20')]||null:null})[_0xd012('0x21')](function(_0xd6e501){if(_0xd6e501){return _0xd6e501[_0xd012('0x22')](_0x504c85[_0xd012('0x18')][_0xd012('0x23')],_[_0xd012('0x24')](_0x504c85['body'],['ids','id'])||{});}})[_0xd012('0x25')](function(_0x2bc0cd){logger[_0xd012('0xc')](_0xd012('0x26'),_0x504c85);logger[_0xd012('0xd')](_0xd012('0x26'),_0x504c85,JSON[_0xd012('0x10')](_0x2bc0cd));_0x3bee73(_0x2bc0cd);})[_0xd012('0x15')](function(_0xe4be5b){logger[_0xd012('0x11')](_0xd012('0x26'),_0xe4be5b['message'],_0x504c85);_0x59981a(_this[_0xd012('0x11')](0x1f4,_0xe4be5b[_0xd012('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b2bf7ef..139abe4 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 _0xc245=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','register'];(function(_0xfe179b,_0x3c1ac5){var _0x4ac023=function(_0x322612){while(--_0x322612){_0xfe179b['push'](_0xfe179b['shift']());}};_0x4ac023(++_0x3c1ac5);}(_0xc245,0x1c2));var _0x5c24=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc245[_0x57b54c];return _0x59cc19;};'use strict';var OpenchannelInteractionEvents=require(_0x5c24('0x0'));var events=[_0x5c24('0x1'),_0x5c24('0x2'),_0x5c24('0x3')];function createListener(_0x259f9c,_0x2cd8d2){return function(_0x601d27){_0x2cd8d2[_0x5c24('0x4')](_0x259f9c,_0x601d27);};}function removeListener(_0x5ac022,_0x578cf2){return function(){OpenchannelInteractionEvents['removeListener'](_0x5ac022,_0x578cf2);};}exports[_0x5c24('0x5')]=function(_0x364d6f){for(var _0x2d2862=0x0,_0x48a46c=events[_0x5c24('0x6')];_0x2d2862<_0x48a46c;_0x2d2862++){var _0x130fd2=events[_0x2d2862];var _0xe198ee=createListener(_0x5c24('0x7')+_0x130fd2,_0x364d6f);OpenchannelInteractionEvents['on'](_0x130fd2,_0xe198ee);}}; \ No newline at end of file +var _0x8792=['openchannelInteraction:','save','update','emit','register','length'];(function(_0x3215bf,_0x2919a8){var _0x3c2a5c=function(_0x2db83a){while(--_0x2db83a){_0x3215bf['push'](_0x3215bf['shift']());}};_0x3c2a5c(++_0x2919a8);}(_0x8792,0x127));var _0x2879=function(_0x1d9b9c,_0x4d7dc1){_0x1d9b9c=_0x1d9b9c-0x0;var _0x20ccf7=_0x8792[_0x1d9b9c];return _0x20ccf7;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2879('0x0'),'remove',_0x2879('0x1')];function createListener(_0x95cfd6,_0x2eebba){return function(_0x438a68){_0x2eebba[_0x2879('0x2')](_0x95cfd6,_0x438a68);};}function removeListener(_0xb3c81f,_0x242f40){return function(){OpenchannelInteractionEvents['removeListener'](_0xb3c81f,_0x242f40);};}exports[_0x2879('0x3')]=function(_0x4069ad){for(var _0x2d4780=0x0,_0x67db0e=events[_0x2879('0x4')];_0x2d4780<_0x67db0e;_0x2d4780++){var _0x158818=events[_0x2d4780];var _0x2d171b=createListener(_0x2879('0x5')+_0x158818,_0x4069ad);OpenchannelInteractionEvents['on'](_0x158818,_0x2d171b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3890fbf..3ed17de 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x3728f1,_0x12a4f9){var _0x6c515b=function(_0x2310ef){while(--_0x2310ef){_0x3728f1['push'](_0x3728f1['shift']());}};_0x6c515b(++_0x12a4f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +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(_0x456d88,_0x125741){var _0x1201d8=function(_0x275c06){while(--_0x275c06){_0x456d88['push'](_0x456d88['shift']());}};_0x1201d8(++_0x125741);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2b64bba..8f58331 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 _0x73a1=['medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x4b6a01,_0x386039){var _0xc374a3=function(_0x49791b){while(--_0x49791b){_0x4b6a01['push'](_0x4b6a01['shift']());}};_0xc374a3(++_0x386039);}(_0x73a1,0x161));var _0x173a=function(_0x1aa3fe,_0x27c5fa){_0x1aa3fe=_0x1aa3fe-0x0;var _0x163cee=_0x73a1[_0x1aa3fe];return _0x163cee;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x173a('0x0')](_0x173a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x173a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x173a('0x3')]('in',_0x173a('0x4')),'defaultValue':_0x173a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x173a('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x173a('0x0')]}}; \ No newline at end of file +var _0x18f3=['DATE','STRING','exports','TEXT','medium','ENUM','out'];(function(_0x40956a,_0x43c2b9){var _0x8fa936=function(_0x11bcd1){while(--_0x11bcd1){_0x40956a['push'](_0x40956a['shift']());}};_0x8fa936(++_0x43c2b9);}(_0x18f3,0x19f));var _0x318f=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x18f3[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require('sequelize');module[_0x318f('0x0')]={'body':{'type':Sequelize[_0x318f('0x1')](_0x318f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x318f('0x3')]('in','out'),'defaultValue':_0x318f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x318f('0x5')]},'providerName':{'type':Sequelize[_0x318f('0x6')]},'providerResponse':{'type':Sequelize[_0x318f('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 54b9494..64e368f 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 _0x2168=['./openchannelMessage.socket','register','client','http','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','OpenchannelMessage','find','create','body','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','User','interface','rejectmessage','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x4c5bf2,_0x4a775f){var _0x1a2fbc=function(_0x2124c1){while(--_0x2124c1){_0x4c5bf2['push'](_0x4c5bf2['shift']());}};_0x1a2fbc(++_0x4a775f);}(_0x2168,0x6a));var _0x8216=function(_0x398f53,_0x264570){_0x398f53=_0x398f53-0x0;var _0xa451fa=_0x2168[_0x398f53];return _0xa451fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8216('0x0'));var zipdir=require(_0x8216('0x1'));var jsonpatch=require(_0x8216('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8216('0x3'));var Mustache=require(_0x8216('0x4'));var util=require('util');var path=require(_0x8216('0x5'));var sox=require(_0x8216('0x6'));var csv=require(_0x8216('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8216('0x8'));var _=require('lodash');var squel=require(_0x8216('0x9'));var crypto=require(_0x8216('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8216('0xb'));var toCsv=require(_0x8216('0x7'));var querystring=require('querystring');var Papa=require(_0x8216('0xc'));var Redis=require(_0x8216('0xd'));var authService=require(_0x8216('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8216('0xf'));var hardwareService=require(_0x8216('0x10'));var logger=require(_0x8216('0x11'))('api');var utils=require(_0x8216('0x12'));var config=require(_0x8216('0x13'));var licenseUtil=require(_0x8216('0x14'));var db=require('../../mysqldb')['db'];config[_0x8216('0x15')]=_[_0x8216('0x16')](config['redis'],{'host':_0x8216('0x17'),'port':0x18eb});var socket=require(_0x8216('0x18'))(new Redis(config[_0x8216('0x15')]));require(_0x8216('0x19'))[_0x8216('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8216('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8216('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1e940a,_0x1b543a,_0x57c8e5,_0xdcba77){return new BPromise(function(_0x4e96ba,_0xfb3928){var _0x420812=_0xdcba77||client;return _0x420812['request'](_0x1e940a,_0x57c8e5)['then'](function(_0x4069f3){logger[_0x8216('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x1b543a,_0x8216('0x1e'));logger['debug'](_0x8216('0x1f'),_0x1b543a,_0x8216('0x1e'),JSON['stringify'](_0x4069f3));if(_0x4069f3[_0x8216('0x20')]){if(_0x4069f3[_0x8216('0x20')]['code']===0x1f4){logger[_0x8216('0x20')](_0x8216('0x21'),_0x1b543a,_0x4069f3['error'][_0x8216('0x22')]);return _0xfb3928(_0x4069f3['error'][_0x8216('0x22')]);}logger[_0x8216('0x20')](_0x8216('0x21'),_0x1b543a,_0x4069f3[_0x8216('0x20')][_0x8216('0x22')]);return _0x4e96ba(_0x4069f3['error'][_0x8216('0x22')]);}else{logger[_0x8216('0x1d')](_0x8216('0x21'),_0x1b543a,_0x8216('0x1e'));_0x4e96ba(_0x4069f3[_0x8216('0x23')]['message']);}})['catch'](function(_0x2aab0b){logger[_0x8216('0x20')](_0x8216('0x21'),_0x1b543a,_0x2aab0b);_0xfb3928(_0x2aab0b);});});}function respondWithStatusCode(_0x38e88e,_0x21d317){_0x21d317=_0x21d317||0xcc;return function(_0x4b9810){if(_0x4b9810){return _0x38e88e[_0x8216('0x24')](_0x21d317);}return _0x38e88e[_0x8216('0x25')](_0x21d317)['end']();};}function respondWithResult(_0x43c8b8,_0x3f8504){_0x3f8504=_0x3f8504||0xc8;return function(_0x1c8512){if(_0x1c8512){return _0x43c8b8[_0x8216('0x25')](_0x3f8504)[_0x8216('0x26')](_0x1c8512);}};}function respondWithFilteredResult(_0x5d8325,_0x4ea217){return function(_0x853cc1){if(_0x853cc1){var _0x20b5d0=typeof _0x4ea217['offset']==='undefined'&&typeof _0x4ea217[_0x8216('0x27')]===_0x8216('0x28');var _0x62909d=_0x853cc1[_0x8216('0x29')];var _0x880fd8=_0x20b5d0?0x0:_0x4ea217[_0x8216('0x2a')];var _0x33bc44=_0x20b5d0?_0x853cc1['count']:_0x4ea217[_0x8216('0x2a')]+_0x4ea217[_0x8216('0x27')];var _0x5d83d8;if(_0x33bc44>=_0x62909d){_0x33bc44=_0x62909d;_0x5d83d8=0xc8;}else{_0x5d83d8=0xce;}_0x5d8325[_0x8216('0x25')](_0x5d83d8);return _0x5d8325[_0x8216('0x2b')](_0x8216('0x2c'),_0x880fd8+'-'+_0x33bc44+'/'+_0x62909d)[_0x8216('0x26')](_0x853cc1);}return null;};}function patchUpdates(_0x1ec85d){return function(_0x2fb416){try{jsonpatch[_0x8216('0x2d')](_0x2fb416,_0x1ec85d,!![]);}catch(_0x5ca01d){return BPromise[_0x8216('0x2e')](_0x5ca01d);}return _0x2fb416[_0x8216('0x2f')]();};}function saveUpdates(_0x3cc178,_0x4fab0e){return function(_0x3d7e64){if(_0x3d7e64){return _0x3d7e64[_0x8216('0x30')](_0x3cc178)[_0x8216('0x31')](function(_0x353edc){return _0x353edc;});}return null;};}function removeEntity(_0x1d7f6e,_0x154345){return function(_0x2b912d){if(_0x2b912d){return _0x2b912d[_0x8216('0x32')]()[_0x8216('0x31')](function(){_0x1d7f6e[_0x8216('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8eeea4,_0x429e39){return function(_0x32cb8b){if(!_0x32cb8b){_0x8eeea4[_0x8216('0x24')](0x194);}return _0x32cb8b;};}function handleError(_0x35f7e4,_0x1c725d){_0x1c725d=_0x1c725d||0x1f4;return function(_0x65afd9){logger['error'](_0x65afd9[_0x8216('0x33')]);if(_0x65afd9[_0x8216('0x34')]){delete _0x65afd9['name'];}_0x35f7e4[_0x8216('0x25')](_0x1c725d)[_0x8216('0x35')](_0x65afd9);};}exports['index']=function(_0x4c4d40,_0x5dae5f){var _0x3ff46e={},_0xe4ded5={},_0x3692de={'count':0x0,'rows':[]};var _0x1ec406=_[_0x8216('0x36')](db['OpenchannelMessage'][_0x8216('0x37')],function(_0xedc2f1){return{'name':_0xedc2f1['fieldName'],'type':_0xedc2f1[_0x8216('0x38')][_0x8216('0x39')]};});_0xe4ded5[_0x8216('0x3a')]=_[_0x8216('0x36')](_0x1ec406,'name');_0xe4ded5[_0x8216('0x3b')]=_[_0x8216('0x3c')](_0x4c4d40['query']);_0xe4ded5[_0x8216('0x3d')]=_['intersection'](_0xe4ded5[_0x8216('0x3a')],_0xe4ded5[_0x8216('0x3b')]);_0x3ff46e[_0x8216('0x3e')]=_[_0x8216('0x3f')](_0xe4ded5[_0x8216('0x3a')],qs[_0x8216('0x40')](_0x4c4d40[_0x8216('0x3b')][_0x8216('0x40')]));_0x3ff46e[_0x8216('0x3e')]=_0x3ff46e['attributes'][_0x8216('0x41')]?_0x3ff46e['attributes']:_0xe4ded5[_0x8216('0x3a')];if(!_0x4c4d40['query'][_0x8216('0x42')](_0x8216('0x43'))){_0x3ff46e[_0x8216('0x27')]=qs[_0x8216('0x27')](_0x4c4d40[_0x8216('0x3b')][_0x8216('0x27')]);_0x3ff46e[_0x8216('0x2a')]=qs[_0x8216('0x2a')](_0x4c4d40['query']['offset']);}_0x3ff46e[_0x8216('0x44')]=qs['sort'](_0x4c4d40[_0x8216('0x3b')][_0x8216('0x45')]);_0x3ff46e[_0x8216('0x46')]=qs[_0x8216('0x3d')](_[_0x8216('0x47')](_0x4c4d40['query'],_0xe4ded5[_0x8216('0x3d')]),_0x1ec406);if(_0x4c4d40['query'][_0x8216('0x48')]){_0x3ff46e[_0x8216('0x46')]=_[_0x8216('0x49')](_0x3ff46e['where'],{'$or':_['map'](_0x1ec406,function(_0xd0ede2){if(_0xd0ede2['type']!==_0x8216('0x4a')){var _0x3c7444={};_0x3c7444[_0xd0ede2[_0x8216('0x34')]]={'$like':'%'+_0x4c4d40['query'][_0x8216('0x48')]+'%'};return _0x3c7444;}})});}_0x3ff46e=_[_0x8216('0x49')]({},_0x3ff46e,_0x4c4d40[_0x8216('0x4b')]);var _0x4921d3={'where':_0x3ff46e[_0x8216('0x46')]};return db['OpenchannelMessage'][_0x8216('0x29')](_0x4921d3)[_0x8216('0x31')](function(_0x15a57c){_0x3692de['count']=_0x15a57c;if(_0x4c4d40['query'][_0x8216('0x4c')]){_0x3ff46e['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3ff46e);})[_0x8216('0x31')](function(_0x23127c){_0x3692de[_0x8216('0x4d')]=_0x23127c;return _0x3692de;})[_0x8216('0x31')](respondWithFilteredResult(_0x5dae5f,_0x3ff46e))[_0x8216('0x4e')](handleError(_0x5dae5f,null));};exports[_0x8216('0x4f')]=function(_0x41a540,_0x5cddf0){var _0x844c25={'raw':!![],'where':{'id':_0x41a540[_0x8216('0x50')]['id']}},_0x294d3d={};_0x294d3d['model']=_[_0x8216('0x3c')](db[_0x8216('0x51')][_0x8216('0x37')]);_0x294d3d[_0x8216('0x3b')]=_[_0x8216('0x3c')](_0x41a540[_0x8216('0x3b')]);_0x294d3d[_0x8216('0x3d')]=_['intersection'](_0x294d3d[_0x8216('0x3a')],_0x294d3d[_0x8216('0x3b')]);_0x844c25[_0x8216('0x3e')]=_[_0x8216('0x3f')](_0x294d3d[_0x8216('0x3a')],qs[_0x8216('0x40')](_0x41a540[_0x8216('0x3b')][_0x8216('0x40')]));_0x844c25[_0x8216('0x3e')]=_0x844c25[_0x8216('0x3e')][_0x8216('0x41')]?_0x844c25['attributes']:_0x294d3d[_0x8216('0x3a')];if(_0x41a540[_0x8216('0x3b')]['includeAll']){_0x844c25['include']=[{'all':!![]}];}_0x844c25=_[_0x8216('0x49')]({},_0x844c25,_0x41a540['options']);return db[_0x8216('0x51')][_0x8216('0x52')](_0x844c25)[_0x8216('0x31')](handleEntityNotFound(_0x5cddf0,null))[_0x8216('0x31')](respondWithResult(_0x5cddf0,null))[_0x8216('0x4e')](handleError(_0x5cddf0,null));};exports[_0x8216('0x53')]=function(_0x558dcd,_0x151ba3){return db['OpenchannelMessage'][_0x8216('0x53')](_0x558dcd['body'],{})[_0x8216('0x31')](respondWithResult(_0x151ba3,0xc9))[_0x8216('0x4e')](handleError(_0x151ba3,null));};exports[_0x8216('0x30')]=function(_0x566c77,_0x4f12ef){if(_0x566c77['body']['id']){delete _0x566c77[_0x8216('0x54')]['id'];}return db[_0x8216('0x51')][_0x8216('0x52')]({'where':{'id':_0x566c77[_0x8216('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f12ef,null))[_0x8216('0x31')](saveUpdates(_0x566c77[_0x8216('0x54')],null))['then'](respondWithResult(_0x4f12ef,null))[_0x8216('0x4e')](handleError(_0x4f12ef,null));};exports[_0x8216('0x32')]=function(_0x400536,_0x1033c2){return db[_0x8216('0x51')][_0x8216('0x52')]({'where':{'id':_0x400536[_0x8216('0x50')]['id']}})[_0x8216('0x31')](handleEntityNotFound(_0x1033c2,null))[_0x8216('0x31')](removeEntity(_0x1033c2,null))[_0x8216('0x4e')](handleError(_0x1033c2,null));};exports[_0x8216('0x55')]=function(_0x7f4d6c,_0x148633){return db[_0x8216('0x51')][_0x8216('0x55')]()[_0x8216('0x31')](respondWithResult(_0x148633,null))['catch'](handleError(_0x148633,null));};var interaction_log=require(_0x8216('0x11'))('openchannel-interactions');exports[_0x8216('0x56')]=function(_0x2ee783,_0xefe3c2,_0x549051){var _0x2bcff2={'agent':{},'channel':_0x8216('0x57')};if(_0x2ee783[_0x8216('0x54')]['id']){delete _0x2ee783[_0x8216('0x54')]['id'];}_0x2ee783['body'][_0x8216('0x58')]=!![];_0x2ee783[_0x8216('0x54')][_0x8216('0x59')]=moment()[_0x8216('0x5a')](_0x8216('0x5b'));_0x2ee783['body'][_0x8216('0x5c')]=_0x2ee783[_0x8216('0x54')][_0x8216('0x5c')]||_0x2ee783['user']['id'];_0x2bcff2[_0x8216('0x5d')]['id']=_0x2ee783[_0x8216('0x54')][_0x8216('0x5c')];return db[_0x8216('0x51')][_0x8216('0x52')]({'where':{'id':_0x2ee783[_0x8216('0x50')]['id'],'UserId':null}})[_0x8216('0x31')](handleEntityNotFound(_0xefe3c2,null))['then'](saveUpdates(_0x2ee783[_0x8216('0x54')],null))[_0x8216('0x31')](function(_0x23300c){if(_0x23300c){_0x2bcff2[_0x8216('0x22')]=_0x23300c['get']({'plain':!![]});return db[_0x8216('0x5e')][_0x8216('0x52')]({'where':{'id':_0x23300c[_0x8216('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0xefe3c2,null))[_0x8216('0x31')](function(_0x583d46){if(_0x583d46){return _0x583d46[_0x8216('0x30')]({'UserId':_0x2ee783['body'][_0x8216('0x5c')],'read1stAt':_[_0x8216('0x60')](_0x583d46[_0x8216('0x61')])?moment()['format'](_0x8216('0x5b')):undefined});}return null;})[_0x8216('0x31')](function(_0x146259){if(_0x146259){_0x2bcff2['interaction']=_0x146259[_0x8216('0x62')]({'plain':!![]});interaction_log['info'](_0x8216('0x63'),_0x2ee783[_0x8216('0x64')]['id'],_0x2ee783[_0x8216('0x64')][_0x8216('0x34')],_0x2ee783[_0x8216('0x64')][_0x8216('0x65')],_0x2bcff2[_0x8216('0x66')]['id'],_0x2ee783['body']?JSON[_0x8216('0x67')](_0x2ee783[_0x8216('0x54')]):'null');return respondWithRpcPromise(_0x8216('0x68'),_0x8216('0x69'),_0x2bcff2);}return null;})[_0x8216('0x31')](function(_0x34a2e5){var _0xbf0490=_0x8216('0x6a')+_0x34a2e5[_0x8216('0x22')][_0x8216('0x6b')];return db['sequelize'][_0x8216('0x3b')](_0xbf0490,{'type':db[_0x8216('0x6c')][_0x8216('0x6d')][_0x8216('0x6e')],'raw':!![]})[_0x8216('0x31')](function(_0x39d27f){return _0x39d27f;});})['then'](function(_0x14d780){if(_0x14d780){_0x2bcff2['message']['contact']=_0x14d780[0x0];if(!_0x2ee783[_0x8216('0x54')]['UserId'])return;return db['User'][_0x8216('0x52')]({'where':{'id':_0x2ee783[_0x8216('0x54')][_0x8216('0x5c')],'role':_0x8216('0x5d')},'attributes':['id',_0x8216('0x34'),_0x8216('0x6f'),_0x8216('0x70'),_0x8216('0x71')],'raw':!![]});}return null;})[_0x8216('0x31')](function(_0x5ed69b){if(!_0x5ed69b)return null;_0x2bcff2[_0x8216('0x22')]['agent']=_0x5ed69b;return _0x2bcff2;})[_0x8216('0x31')](function(_0x16e990){if(_0x16e990){if(_0x2ee783[_0x8216('0x54')][_0x8216('0x72')]){_0x2bcff2['message']['interface']=util['format'](_0x8216('0x73'),_0x2ee783[_0x8216('0x64')]['name']);_0x2bcff2['message'][_0x8216('0x74')]=_0x2bcff2[_0x8216('0x74')];_0x2bcff2['message'][_0x8216('0x75')]=_0x2bcff2['channel'];_0x2bcff2[_0x8216('0x22')][_0x8216('0x76')]=_0x8216('0x56');return respondWithRpcPromise(_0x8216('0x77'),_0x8216('0x77'),{'event':_0x8216('0x78'),'message':_0x2bcff2[_0x8216('0x22')]},client9002)[_0x8216('0x31')](function(){return _0x2bcff2;});}return _0x2bcff2;}return null;})[_0x8216('0x31')](respondWithResult(_0xefe3c2,null))[_0x8216('0x4e')](handleError(_0xefe3c2,null));};var interaction_log=require(_0x8216('0x11'))(_0x8216('0x79'));exports[_0x8216('0x2e')]=function(_0x1a8475,_0x47e70f,_0x8b7ad3){var _0x52e4e4={'agent':{},'channel':_0x8216('0x57')};if(_0x1a8475[_0x8216('0x54')]['id']){delete _0x1a8475['body']['id'];}_0x1a8475[_0x8216('0x54')][_0x8216('0x5c')]=_0x1a8475[_0x8216('0x54')]['UserId']||_0x1a8475['user']['id'];_0x52e4e4[_0x8216('0x5d')]['id']=_0x1a8475[_0x8216('0x54')][_0x8216('0x5c')];return db['OpenchannelMessage'][_0x8216('0x52')]({'where':{'id':_0x1a8475[_0x8216('0x50')]['id'],'UserId':null}})[_0x8216('0x31')](handleEntityNotFound(_0x47e70f,null))['then'](function(_0xf22561){if(_0xf22561){_0x52e4e4[_0x8216('0x22')]=_0xf22561[_0x8216('0x62')]({'plain':!![]});return db[_0x8216('0x5e')][_0x8216('0x52')]({'where':{'id':_0xf22561[_0x8216('0x5f')]}});}return null;})[_0x8216('0x31')](handleEntityNotFound(_0x47e70f,null))[_0x8216('0x31')](function(_0x1b121c){if(_0x1b121c){_0x52e4e4['interaction']=_0x1b121c[_0x8216('0x62')]({'plain':!![]});interaction_log[_0x8216('0x1d')](_0x8216('0x7a'),_0x1a8475['user']['id'],_0x1a8475[_0x8216('0x64')][_0x8216('0x34')],_0x1a8475[_0x8216('0x64')][_0x8216('0x65')],_0x52e4e4['interaction']['id'],_0x1a8475[_0x8216('0x54')]?JSON[_0x8216('0x67')](_0x1a8475[_0x8216('0x54')]):_0x8216('0x7b'));return respondWithRpcPromise(_0x8216('0x7c'),_0x8216('0x7d'),_0x52e4e4);}return null;})['then'](function(_0x4297c0){var _0x21369e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4297c0[_0x8216('0x22')][_0x8216('0x6b')];return db[_0x8216('0x7e')]['query'](_0x21369e,{'type':db[_0x8216('0x6c')][_0x8216('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5ba73e){return _0x5ba73e;});})['then'](function(_0x40892a){if(_0x40892a){_0x52e4e4[_0x8216('0x22')][_0x8216('0x7f')]=_0x40892a[0x0];if(!_0x1a8475[_0x8216('0x54')][_0x8216('0x5c')])return;return db[_0x8216('0x80')][_0x8216('0x52')]({'where':{'id':_0x1a8475['body'][_0x8216('0x5c')],'role':'agent'},'attributes':['id','name',_0x8216('0x6f'),'email',_0x8216('0x71')],'raw':!![]});}return null;})['then'](function(_0x38b175){if(!_0x38b175)return null;_0x52e4e4['message'][_0x8216('0x5d')]=_0x38b175;return _0x52e4e4;})[_0x8216('0x31')](function(_0x38e311){if(_0x38e311){_0x38e311[_0x8216('0x22')][_0x8216('0x81')]=util['format'](_0x8216('0x73'),_0x1a8475[_0x8216('0x64')]['name']);_0x38e311['message']['channel']=_0x52e4e4[_0x8216('0x74')];_0x38e311[_0x8216('0x22')]['motionChannel']=_0x52e4e4['channel'];_0x38e311[_0x8216('0x22')]['event']=_0x8216('0x2e');respondWithRpcPromise(_0x8216('0x77'),'EventManager',{'event':_0x8216('0x82'),'message':_0x38e311[_0x8216('0x22')]},client9002);return _0x52e4e4;}return null;})[_0x8216('0x31')](respondWithResult(_0x47e70f,null))[_0x8216('0x4e')](handleError(_0x47e70f,null));}; \ No newline at end of file +var _0x9a72=['motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','email','rejectmessage','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','end','sendStatus','stack','name','send','index','OpenchannelMessage','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteractionId','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel'];(function(_0x1a6995,_0xe28a03){var _0x50cd4f=function(_0x305983){while(--_0x305983){_0x1a6995['push'](_0x1a6995['shift']());}};_0x50cd4f(++_0xe28a03);}(_0x9a72,0x8e));var _0x29a7=function(_0x2c0ee0,_0x13268e){_0x2c0ee0=_0x2c0ee0-0x0;var _0xe5a129=_0x9a72[_0x2c0ee0];return _0xe5a129;};'use strict';var emlformat=require(_0x29a7('0x0'));var rimraf=require(_0x29a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29a7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x29a7('0x3'));var Mustache=require(_0x29a7('0x4'));var util=require(_0x29a7('0x5'));var path=require(_0x29a7('0x6'));var sox=require('sox');var csv=require(_0x29a7('0x7'));var ejs=require(_0x29a7('0x8'));var fs=require('fs');var fs_extra=require(_0x29a7('0x9'));var _=require(_0x29a7('0xa'));var squel=require(_0x29a7('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x29a7('0xc'));var toCsv=require(_0x29a7('0x7'));var querystring=require(_0x29a7('0xd'));var Papa=require(_0x29a7('0xe'));var Redis=require(_0x29a7('0xf'));var authService=require(_0x29a7('0x10'));var qs=require(_0x29a7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29a7('0x12'))(_0x29a7('0x13'));var utils=require(_0x29a7('0x14'));var config=require(_0x29a7('0x15'));var licenseUtil=require(_0x29a7('0x16'));var db=require(_0x29a7('0x17'))['db'];config[_0x29a7('0x18')]=_['defaults'](config[_0x29a7('0x18')],{'host':_0x29a7('0x19'),'port':0x18eb});var socket=require(_0x29a7('0x1a'))(new Redis(config[_0x29a7('0x18')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x29a7('0x1b'));var client=jayson[_0x29a7('0x1c')][_0x29a7('0x1d')]({'port':0x232c});var client9002=jayson[_0x29a7('0x1c')][_0x29a7('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4d7c43,_0x2636f5,_0x5b43b9,_0x2110fa){return new BPromise(function(_0x228fe1,_0x14b9c9){var _0x40805b=_0x2110fa||client;return _0x40805b[_0x29a7('0x1e')](_0x4d7c43,_0x5b43b9)[_0x29a7('0x1f')](function(_0x4c0b97){logger[_0x29a7('0x20')](_0x29a7('0x21'),_0x2636f5,_0x29a7('0x22'));logger[_0x29a7('0x23')](_0x29a7('0x24'),_0x2636f5,_0x29a7('0x22'),JSON['stringify'](_0x4c0b97));if(_0x4c0b97[_0x29a7('0x25')]){if(_0x4c0b97[_0x29a7('0x25')][_0x29a7('0x26')]===0x1f4){logger[_0x29a7('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x2636f5,_0x4c0b97[_0x29a7('0x25')]['message']);return _0x14b9c9(_0x4c0b97[_0x29a7('0x25')][_0x29a7('0x27')]);}logger[_0x29a7('0x25')](_0x29a7('0x21'),_0x2636f5,_0x4c0b97[_0x29a7('0x25')][_0x29a7('0x27')]);return _0x228fe1(_0x4c0b97[_0x29a7('0x25')][_0x29a7('0x27')]);}else{logger['info'](_0x29a7('0x21'),_0x2636f5,_0x29a7('0x22'));_0x228fe1(_0x4c0b97[_0x29a7('0x28')][_0x29a7('0x27')]);}})[_0x29a7('0x29')](function(_0x47f8c0){logger[_0x29a7('0x25')](_0x29a7('0x21'),_0x2636f5,_0x47f8c0);_0x14b9c9(_0x47f8c0);});});}function respondWithStatusCode(_0x1116bf,_0xa849c7){_0xa849c7=_0xa849c7||0xcc;return function(_0x5028c2){if(_0x5028c2){return _0x1116bf['sendStatus'](_0xa849c7);}return _0x1116bf['status'](_0xa849c7)['end']();};}function respondWithResult(_0x263a78,_0x1a5a27){_0x1a5a27=_0x1a5a27||0xc8;return function(_0x4204e1){if(_0x4204e1){return _0x263a78[_0x29a7('0x2a')](_0x1a5a27)['json'](_0x4204e1);}};}function respondWithFilteredResult(_0x31dddb,_0x2f84a7){return function(_0x308e3d){if(_0x308e3d){var _0x3e0d47=typeof _0x2f84a7[_0x29a7('0x2b')]===_0x29a7('0x2c')&&typeof _0x2f84a7[_0x29a7('0x2d')]===_0x29a7('0x2c');var _0x1d3bc5=_0x308e3d[_0x29a7('0x2e')];var _0x5b52d5=_0x3e0d47?0x0:_0x2f84a7[_0x29a7('0x2b')];var _0x572f3f=_0x3e0d47?_0x308e3d[_0x29a7('0x2e')]:_0x2f84a7[_0x29a7('0x2b')]+_0x2f84a7['limit'];var _0xe9a62b;if(_0x572f3f>=_0x1d3bc5){_0x572f3f=_0x1d3bc5;_0xe9a62b=0xc8;}else{_0xe9a62b=0xce;}_0x31dddb['status'](_0xe9a62b);return _0x31dddb['set'](_0x29a7('0x2f'),_0x5b52d5+'-'+_0x572f3f+'/'+_0x1d3bc5)[_0x29a7('0x30')](_0x308e3d);}return null;};}function patchUpdates(_0x1036c7){return function(_0x12067c){try{jsonpatch['apply'](_0x12067c,_0x1036c7,!![]);}catch(_0x20ae74){return BPromise[_0x29a7('0x31')](_0x20ae74);}return _0x12067c[_0x29a7('0x32')]();};}function saveUpdates(_0x1cdcff,_0x37d986){return function(_0x348af1){if(_0x348af1){return _0x348af1['update'](_0x1cdcff)[_0x29a7('0x1f')](function(_0x2ec70e){return _0x2ec70e;});}return null;};}function removeEntity(_0x40233e,_0x3f7718){return function(_0x1560f0){if(_0x1560f0){return _0x1560f0[_0x29a7('0x33')]()[_0x29a7('0x1f')](function(){_0x40233e[_0x29a7('0x2a')](0xcc)[_0x29a7('0x34')]();});}};}function handleEntityNotFound(_0xc03682,_0x2383d1){return function(_0x2b203d){if(!_0x2b203d){_0xc03682[_0x29a7('0x35')](0x194);}return _0x2b203d;};}function handleError(_0x33c945,_0x30d2cb){_0x30d2cb=_0x30d2cb||0x1f4;return function(_0x7d8af7){logger[_0x29a7('0x25')](_0x7d8af7[_0x29a7('0x36')]);if(_0x7d8af7[_0x29a7('0x37')]){delete _0x7d8af7[_0x29a7('0x37')];}_0x33c945['status'](_0x30d2cb)[_0x29a7('0x38')](_0x7d8af7);};}exports[_0x29a7('0x39')]=function(_0x1de36b,_0x197d57){var _0xa44e98={},_0x12db0b={},_0x4f2870={'count':0x0,'rows':[]};var _0x1e23bf=_['map'](db[_0x29a7('0x3a')][_0x29a7('0x3b')],function(_0x4abf40){return{'name':_0x4abf40['fieldName'],'type':_0x4abf40[_0x29a7('0x3c')]['key']};});_0x12db0b[_0x29a7('0x3d')]=_[_0x29a7('0x3e')](_0x1e23bf,_0x29a7('0x37'));_0x12db0b[_0x29a7('0x3f')]=_[_0x29a7('0x40')](_0x1de36b[_0x29a7('0x3f')]);_0x12db0b[_0x29a7('0x41')]=_['intersection'](_0x12db0b[_0x29a7('0x3d')],_0x12db0b[_0x29a7('0x3f')]);_0xa44e98[_0x29a7('0x42')]=_[_0x29a7('0x43')](_0x12db0b['model'],qs['fields'](_0x1de36b['query'][_0x29a7('0x44')]));_0xa44e98['attributes']=_0xa44e98[_0x29a7('0x42')]['length']?_0xa44e98['attributes']:_0x12db0b[_0x29a7('0x3d')];if(!_0x1de36b[_0x29a7('0x3f')][_0x29a7('0x45')](_0x29a7('0x46'))){_0xa44e98[_0x29a7('0x2d')]=qs[_0x29a7('0x2d')](_0x1de36b[_0x29a7('0x3f')][_0x29a7('0x2d')]);_0xa44e98['offset']=qs[_0x29a7('0x2b')](_0x1de36b[_0x29a7('0x3f')][_0x29a7('0x2b')]);}_0xa44e98[_0x29a7('0x47')]=qs[_0x29a7('0x48')](_0x1de36b[_0x29a7('0x3f')]['sort']);_0xa44e98['where']=qs[_0x29a7('0x41')](_[_0x29a7('0x49')](_0x1de36b[_0x29a7('0x3f')],_0x12db0b['filters']),_0x1e23bf);if(_0x1de36b[_0x29a7('0x3f')][_0x29a7('0x4a')]){_0xa44e98[_0x29a7('0x4b')]=_[_0x29a7('0x4c')](_0xa44e98[_0x29a7('0x4b')],{'$or':_[_0x29a7('0x3e')](_0x1e23bf,function(_0x2cf6db){if(_0x2cf6db[_0x29a7('0x3c')]!==_0x29a7('0x4d')){var _0x4b6aa6={};_0x4b6aa6[_0x2cf6db[_0x29a7('0x37')]]={'$like':'%'+_0x1de36b['query'][_0x29a7('0x4a')]+'%'};return _0x4b6aa6;}})});}_0xa44e98=_[_0x29a7('0x4c')]({},_0xa44e98,_0x1de36b[_0x29a7('0x4e')]);var _0x5d7f2f={'where':_0xa44e98[_0x29a7('0x4b')]};return db[_0x29a7('0x3a')][_0x29a7('0x2e')](_0x5d7f2f)['then'](function(_0x1aa374){_0x4f2870['count']=_0x1aa374;if(_0x1de36b['query']['includeAll']){_0xa44e98['include']=[{'all':!![]}];}return db[_0x29a7('0x3a')][_0x29a7('0x4f')](_0xa44e98);})[_0x29a7('0x1f')](function(_0x520767){_0x4f2870[_0x29a7('0x50')]=_0x520767;return _0x4f2870;})[_0x29a7('0x1f')](respondWithFilteredResult(_0x197d57,_0xa44e98))[_0x29a7('0x29')](handleError(_0x197d57,null));};exports['show']=function(_0x2e04c5,_0x2a336e){var _0x12943c={'raw':!![],'where':{'id':_0x2e04c5[_0x29a7('0x51')]['id']}},_0x56d035={};_0x56d035[_0x29a7('0x3d')]=_['keys'](db['OpenchannelMessage'][_0x29a7('0x3b')]);_0x56d035[_0x29a7('0x3f')]=_[_0x29a7('0x40')](_0x2e04c5[_0x29a7('0x3f')]);_0x56d035[_0x29a7('0x41')]=_[_0x29a7('0x43')](_0x56d035[_0x29a7('0x3d')],_0x56d035['query']);_0x12943c[_0x29a7('0x42')]=_[_0x29a7('0x43')](_0x56d035['model'],qs[_0x29a7('0x44')](_0x2e04c5['query'][_0x29a7('0x44')]));_0x12943c[_0x29a7('0x42')]=_0x12943c[_0x29a7('0x42')]['length']?_0x12943c[_0x29a7('0x42')]:_0x56d035[_0x29a7('0x3d')];if(_0x2e04c5[_0x29a7('0x3f')][_0x29a7('0x52')]){_0x12943c['include']=[{'all':!![]}];}_0x12943c=_[_0x29a7('0x4c')]({},_0x12943c,_0x2e04c5[_0x29a7('0x4e')]);return db[_0x29a7('0x3a')][_0x29a7('0x53')](_0x12943c)[_0x29a7('0x1f')](handleEntityNotFound(_0x2a336e,null))[_0x29a7('0x1f')](respondWithResult(_0x2a336e,null))[_0x29a7('0x29')](handleError(_0x2a336e,null));};exports[_0x29a7('0x54')]=function(_0x3fc18f,_0x429c12){return db[_0x29a7('0x3a')]['create'](_0x3fc18f[_0x29a7('0x55')],{})[_0x29a7('0x1f')](respondWithResult(_0x429c12,0xc9))[_0x29a7('0x29')](handleError(_0x429c12,null));};exports['update']=function(_0x6638f8,_0x2c0f22){if(_0x6638f8[_0x29a7('0x55')]['id']){delete _0x6638f8[_0x29a7('0x55')]['id'];}return db[_0x29a7('0x3a')][_0x29a7('0x53')]({'where':{'id':_0x6638f8[_0x29a7('0x51')]['id']}})[_0x29a7('0x1f')](handleEntityNotFound(_0x2c0f22,null))[_0x29a7('0x1f')](saveUpdates(_0x6638f8['body'],null))[_0x29a7('0x1f')](respondWithResult(_0x2c0f22,null))[_0x29a7('0x29')](handleError(_0x2c0f22,null));};exports[_0x29a7('0x33')]=function(_0x401011,_0x3ebbb5){return db[_0x29a7('0x3a')]['find']({'where':{'id':_0x401011[_0x29a7('0x51')]['id']}})[_0x29a7('0x1f')](handleEntityNotFound(_0x3ebbb5,null))[_0x29a7('0x1f')](removeEntity(_0x3ebbb5,null))[_0x29a7('0x29')](handleError(_0x3ebbb5,null));};exports[_0x29a7('0x56')]=function(_0x7456c4,_0x213117){return db[_0x29a7('0x3a')][_0x29a7('0x56')]()[_0x29a7('0x1f')](respondWithResult(_0x213117,null))['catch'](handleError(_0x213117,null));};var interaction_log=require('../../config/logger')(_0x29a7('0x57'));exports[_0x29a7('0x58')]=function(_0x5272b5,_0x3a926e,_0x1f8e02){var _0x4a3000={'agent':{},'channel':_0x29a7('0x59')};if(_0x5272b5['body']['id']){delete _0x5272b5[_0x29a7('0x55')]['id'];}_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5a')]=!![];_0x5272b5['body'][_0x29a7('0x5b')]=moment()[_0x29a7('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')]=_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')]||_0x5272b5[_0x29a7('0x5e')]['id'];_0x4a3000[_0x29a7('0x5f')]['id']=_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')];return db[_0x29a7('0x3a')][_0x29a7('0x53')]({'where':{'id':_0x5272b5['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a926e,null))[_0x29a7('0x1f')](saveUpdates(_0x5272b5[_0x29a7('0x55')],null))['then'](function(_0x4015ae){if(_0x4015ae){_0x4a3000[_0x29a7('0x27')]=_0x4015ae[_0x29a7('0x60')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x4015ae[_0x29a7('0x61')]}});}return null;})[_0x29a7('0x1f')](handleEntityNotFound(_0x3a926e,null))[_0x29a7('0x1f')](function(_0x4ad1b0){if(_0x4ad1b0){return _0x4ad1b0[_0x29a7('0x62')]({'UserId':_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')],'read1stAt':_[_0x29a7('0x63')](_0x4ad1b0[_0x29a7('0x64')])?moment()['format'](_0x29a7('0x65')):undefined});}return null;})[_0x29a7('0x1f')](function(_0xc8e67){if(_0xc8e67){_0x4a3000['interaction']=_0xc8e67[_0x29a7('0x60')]({'plain':!![]});interaction_log[_0x29a7('0x20')](_0x29a7('0x66'),_0x5272b5[_0x29a7('0x5e')]['id'],_0x5272b5['user'][_0x29a7('0x37')],_0x5272b5['user'][_0x29a7('0x67')],_0x4a3000[_0x29a7('0x68')]['id'],_0x5272b5[_0x29a7('0x55')]?JSON['stringify'](_0x5272b5[_0x29a7('0x55')]):_0x29a7('0x69'));return respondWithRpcPromise(_0x29a7('0x6a'),_0x29a7('0x6b'),_0x4a3000);}return null;})[_0x29a7('0x1f')](function(_0x2ce965){var _0x201f38=_0x29a7('0x6c')+_0x2ce965[_0x29a7('0x27')][_0x29a7('0x6d')];return db[_0x29a7('0x6e')]['query'](_0x201f38,{'type':db['Sequelize']['QueryTypes'][_0x29a7('0x6f')],'raw':!![]})[_0x29a7('0x1f')](function(_0x1d1b21){return _0x1d1b21;});})[_0x29a7('0x1f')](function(_0x29b0fa){if(_0x29b0fa){_0x4a3000[_0x29a7('0x27')][_0x29a7('0x70')]=_0x29b0fa[0x0];if(!_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')])return;return db[_0x29a7('0x71')][_0x29a7('0x53')]({'where':{'id':_0x5272b5[_0x29a7('0x55')][_0x29a7('0x5d')],'role':'agent'},'attributes':['id','name',_0x29a7('0x72'),'email',_0x29a7('0x73')],'raw':!![]});}return null;})[_0x29a7('0x1f')](function(_0x4a15ae){if(!_0x4a15ae)return null;_0x4a3000['message'][_0x29a7('0x5f')]=_0x4a15ae;return _0x4a3000;})[_0x29a7('0x1f')](function(_0x2ca088){if(_0x2ca088){if(_0x5272b5[_0x29a7('0x55')][_0x29a7('0x74')]){_0x4a3000['message'][_0x29a7('0x75')]=util[_0x29a7('0x5c')](_0x29a7('0x76'),_0x5272b5[_0x29a7('0x5e')]['name']);_0x4a3000['message'][_0x29a7('0x77')]=_0x4a3000['channel'];_0x4a3000[_0x29a7('0x27')][_0x29a7('0x78')]=_0x4a3000[_0x29a7('0x77')];_0x4a3000[_0x29a7('0x27')][_0x29a7('0x79')]=_0x29a7('0x58');return respondWithRpcPromise(_0x29a7('0x7a'),_0x29a7('0x7a'),{'event':_0x29a7('0x7b'),'message':_0x4a3000[_0x29a7('0x27')]},client9002)[_0x29a7('0x1f')](function(){return _0x4a3000;});}return _0x4a3000;}return null;})[_0x29a7('0x1f')](respondWithResult(_0x3a926e,null))[_0x29a7('0x29')](handleError(_0x3a926e,null));};var interaction_log=require(_0x29a7('0x12'))(_0x29a7('0x57'));exports['reject']=function(_0x9da80d,_0x508f39,_0x363e48){var _0x2d5196={'agent':{},'channel':_0x29a7('0x59')};if(_0x9da80d['body']['id']){delete _0x9da80d[_0x29a7('0x55')]['id'];}_0x9da80d['body'][_0x29a7('0x5d')]=_0x9da80d['body'][_0x29a7('0x5d')]||_0x9da80d[_0x29a7('0x5e')]['id'];_0x2d5196[_0x29a7('0x5f')]['id']=_0x9da80d['body'][_0x29a7('0x5d')];return db['OpenchannelMessage'][_0x29a7('0x53')]({'where':{'id':_0x9da80d[_0x29a7('0x51')]['id'],'UserId':null}})[_0x29a7('0x1f')](handleEntityNotFound(_0x508f39,null))[_0x29a7('0x1f')](function(_0x5eba53){if(_0x5eba53){_0x2d5196[_0x29a7('0x27')]=_0x5eba53[_0x29a7('0x60')]({'plain':!![]});return db[_0x29a7('0x7c')]['find']({'where':{'id':_0x5eba53[_0x29a7('0x61')]}});}return null;})[_0x29a7('0x1f')](handleEntityNotFound(_0x508f39,null))[_0x29a7('0x1f')](function(_0x2afd57){if(_0x2afd57){_0x2d5196['interaction']=_0x2afd57[_0x29a7('0x60')]({'plain':!![]});interaction_log['info'](_0x29a7('0x7d'),_0x9da80d[_0x29a7('0x5e')]['id'],_0x9da80d[_0x29a7('0x5e')]['name'],_0x9da80d[_0x29a7('0x5e')]['role'],_0x2d5196[_0x29a7('0x68')]['id'],_0x9da80d['body']?JSON[_0x29a7('0x7e')](_0x9da80d[_0x29a7('0x55')]):_0x29a7('0x69'));return respondWithRpcPromise(_0x29a7('0x7f'),_0x29a7('0x80'),_0x2d5196);}return null;})['then'](function(_0x545a90){var _0x29de8f=_0x29a7('0x6c')+_0x545a90[_0x29a7('0x27')][_0x29a7('0x6d')];return db[_0x29a7('0x6e')]['query'](_0x29de8f,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x29a7('0x1f')](function(_0x2dabfd){return _0x2dabfd;});})[_0x29a7('0x1f')](function(_0x33a31d){if(_0x33a31d){_0x2d5196['message']['contact']=_0x33a31d[0x0];if(!_0x9da80d[_0x29a7('0x55')][_0x29a7('0x5d')])return;return db[_0x29a7('0x71')][_0x29a7('0x53')]({'where':{'id':_0x9da80d[_0x29a7('0x55')]['UserId'],'role':_0x29a7('0x5f')},'attributes':['id','name',_0x29a7('0x72'),_0x29a7('0x81'),_0x29a7('0x73')],'raw':!![]});}return null;})[_0x29a7('0x1f')](function(_0x106583){if(!_0x106583)return null;_0x2d5196['message'][_0x29a7('0x5f')]=_0x106583;return _0x2d5196;})[_0x29a7('0x1f')](function(_0xb0adec){if(_0xb0adec){_0xb0adec['message'][_0x29a7('0x75')]=util[_0x29a7('0x5c')]('SIP/%s',_0x9da80d[_0x29a7('0x5e')]['name']);_0xb0adec['message']['channel']=_0x2d5196[_0x29a7('0x77')];_0xb0adec[_0x29a7('0x27')][_0x29a7('0x78')]=_0x2d5196['channel'];_0xb0adec['message'][_0x29a7('0x79')]=_0x29a7('0x31');respondWithRpcPromise('EventManager',_0x29a7('0x7a'),{'event':_0x29a7('0x82'),'message':_0xb0adec['message']},client9002);return _0x2d5196;}return null;})[_0x29a7('0x1f')](respondWithResult(_0x508f39,null))['catch'](handleError(_0x508f39,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index db84508..22cd182 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 _0xe83d=['update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x23e5fd,_0x2c6da6){var _0xab592b=function(_0x75559a){while(--_0x75559a){_0x23e5fd['push'](_0x23e5fd['shift']());}};_0xab592b(++_0x2c6da6);}(_0xe83d,0x1ac));var _0xde83=function(_0x3b0fcd,_0x2c6ea5){_0x3b0fcd=_0x3b0fcd-0x0;var _0x534db1=_0xe83d[_0x3b0fcd];return _0x534db1;};'use strict';var EventEmitter=require(_0xde83('0x0'));var OpenchannelMessage=require(_0xde83('0x1'))['db'][_0xde83('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xde83('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde83('0x4'),'afterDestroy':_0xde83('0x5')};function emitEvent(_0x142862){return function(_0x22ad90,_0x3d7a8e,_0x16f3de){OpenchannelMessageEvents['emit'](_0x142862+':'+_0x22ad90['id'],_0x22ad90);OpenchannelMessageEvents[_0xde83('0x6')](_0x142862,_0x22ad90);_0x16f3de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xde83('0x7')](e,emitEvent(event));}}module[_0xde83('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x2945=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x568814,_0x36a57e){var _0x20f195=function(_0x540283){while(--_0x540283){_0x568814['push'](_0x568814['shift']());}};_0x20f195(++_0x36a57e);}(_0x2945,0x6e));var _0x5294=function(_0x4cecb1,_0x245385){_0x4cecb1=_0x4cecb1-0x0;var _0x3b08ae=_0x2945[_0x4cecb1];return _0x3b08ae;};'use strict';var EventEmitter=require(_0x5294('0x0'));var OpenchannelMessage=require(_0x5294('0x1'))['db'][_0x5294('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5294('0x3')](0x0);var events={'afterCreate':_0x5294('0x4'),'afterUpdate':_0x5294('0x5'),'afterDestroy':_0x5294('0x6')};function emitEvent(_0x4df73c){return function(_0x5b42fb,_0x9451f9,_0x5dd7ef){OpenchannelMessageEvents['emit'](_0x4df73c+':'+_0x5b42fb['id'],_0x5b42fb);OpenchannelMessageEvents[_0x5294('0x7')](_0x4df73c,_0x5b42fb);_0x5dd7ef(null);};}for(var e in events){if(events[_0x5294('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x5294('0x9')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index f7b5a7a..b4da4ff 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 _0xef0f=['POST','method','GET','body','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','Contact'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xef0f,0x168));var _0xfef0=function(_0x3ed254,_0x1cdd52){_0x3ed254=_0x3ed254-0x0;var _0x46f3f1=_0xef0f[_0x3ed254];return _0x46f3f1;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xfef0('0xb'),'fields':['body'],'type':_0xfef0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x100e3a,_0x3a81cc,_0x2d42dc){var _0x334e74=_0x2697df[_0xfef0('0xd')];var _0xc177db=_0x100e3a[_0xfef0('0xe')]({'plain':!![]});if(_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()==='in'||_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]&&!_['isNil'](_0xc177db[_0xfef0('0x13')])){_0x334e74[_0xfef0('0x14')][_0xfef0('0x15')]({'where':{'id':_0xc177db[_0xfef0('0x16')]}})[_0xfef0('0x17')](function(_0x45599a){if(_0x45599a){_0x45599a[_0xfef0('0x18')]({'lastMsgAt':_0xc177db['createdAt'],'lastMsgDirection':_0xc177db[_0xfef0('0xf')]['toLowerCase']()});}})['catch'](function(_0x5acdd0){console[_0xfef0('0x19')](_0x5acdd0);});}if(_0xc177db[_0xfef0('0xf')]===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]){var _0x2a96d9;_0x334e74[_0xfef0('0x1a')][_0xfef0('0x1b')]()[_0xfef0('0x17')](function(_0x581459){return _0x334e74[_0xfef0('0x1c')][_0xfef0('0x1d')]({'where':{'id':_0xc177db[_0xfef0('0x1e')]},'include':[{'model':_0x334e74[_0xfef0('0x14')],'as':_0xfef0('0x1f'),'where':{'id':_0xc177db['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x334e74[_0xfef0('0x1a')],'as':'Contact','attributes':_[_0xfef0('0x20')](_0x581459)}]}]});})[_0xfef0('0x17')](function(_0x28dee1){_0x2a96d9=_0x28dee1['get']({'plain':!![]});if(_0x2a96d9&&_0x2a96d9[_0xfef0('0x21')]){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0xc177db['id'],_0x2a96d9['replyUri']));if(_0x2a96d9[_0xfef0('0x1f')]&&_0x2a96d9['Interactions'][_0xfef0('0x24')]){_0xc177db[_0xfef0('0x25')]=_[_0xfef0('0x26')](_0x2a96d9[_0xfef0('0x1f')][0x0],_0xfef0('0x27'));_0xc177db[_0xfef0('0x27')]=_0x2a96d9['Interactions'][0x0]['Contact'];}var _0x3a81cc={'method':_0xfef0('0x28'),'uri':encodeURI(_0x2a96d9[_0xfef0('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3a81cc[_0xfef0('0x29')]){case _0xfef0('0x2a'):_0x3a81cc['qs']=_0xc177db;break;case _0xfef0('0x28'):_0x3a81cc[_0xfef0('0x2b')]=_0xc177db;break;}return rp(_0x3a81cc)[_0xfef0('0x17')](function(_0x391279){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util[_0xfef0('0x2c')](_0xfef0('0x2d'),_0xc177db['id'],_0x2a96d9[_0xfef0('0x21')]));if(_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]&&_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]!=_0xc177db[_0xfef0('0x25')][_0xfef0('0x2e')]){return _0x334e74[_0xfef0('0x14')]['update']({'threadId':_0x391279[_0xfef0('0x2b')]['threadId']},{'logging':!![],'where':{'id':_0xc177db['Interaction']['id']}});}else{return;}})[_0xfef0('0x17')](function(){return _0x100e3a[_0xfef0('0x18')]({'read':!![]});})['catch'](function(_0x4bbdba){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xfef0('0x2f')](_0x4bbdba,{'showHidden':![],'depth':null}));_0x2d42dc();});}else{_0x2d42dc();}})[_0xfef0('0x30')](function(){_0x2d42dc();});}else{_0x2d42dc();}}},'charset':_0xfef0('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf7b4=['OpenchannelInteractionId','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','out','secret','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions'];(function(_0xafa8e5,_0x2aae15){var _0x41ceb6=function(_0x170ba5){while(--_0x170ba5){_0xafa8e5['push'](_0xafa8e5['shift']());}};_0x41ceb6(++_0x2aae15);}(_0xf7b4,0x152));var _0x4f7b=function(_0xb12d99,_0x98950c){_0xb12d99=_0xb12d99-0x0;var _0x421c5b=_0xf7b4[_0xb12d99];return _0x421c5b;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[{'name':_0x4f7b('0xb'),'fields':[_0x4f7b('0xc')],'type':_0x4f7b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c714d,_0x433563,_0x1016e0){var _0x479208=_0x2637f0[_0x4f7b('0xe')];var _0x3a3d6c=_0x5c714d[_0x4f7b('0xf')]({'plain':!![]});if(_0x3a3d6c[_0x4f7b('0x10')][_0x4f7b('0x11')]()==='in'||_0x3a3d6c['direction'][_0x4f7b('0x11')]()==='out'&&!_0x3a3d6c['secret']&&!_[_0x4f7b('0x12')](_0x3a3d6c[_0x4f7b('0x13')])){_0x479208[_0x4f7b('0x14')][_0x4f7b('0x15')]({'where':{'id':_0x3a3d6c['OpenchannelInteractionId']}})[_0x4f7b('0x16')](function(_0x368091){if(_0x368091){_0x368091[_0x4f7b('0x17')]({'lastMsgAt':_0x3a3d6c[_0x4f7b('0x18')],'lastMsgDirection':_0x3a3d6c[_0x4f7b('0x10')][_0x4f7b('0x11')]()});}})[_0x4f7b('0x19')](function(_0x2437cc){console[_0x4f7b('0x1a')](_0x2437cc);});}if(_0x3a3d6c[_0x4f7b('0x10')]===_0x4f7b('0x1b')&&!_0x3a3d6c[_0x4f7b('0x1c')]){var _0x50a161;_0x479208[_0x4f7b('0x1d')]['describe']()['then'](function(_0x24e5cf){return _0x479208[_0x4f7b('0x1e')]['find']({'where':{'id':_0x3a3d6c[_0x4f7b('0x1f')]},'include':[{'model':_0x479208[_0x4f7b('0x14')],'as':_0x4f7b('0x20'),'where':{'id':_0x3a3d6c[_0x4f7b('0x21')]},'limit':0x1,'include':[{'model':_0x479208['CmContact'],'as':_0x4f7b('0x22'),'attributes':_['keys'](_0x24e5cf)}]}]});})[_0x4f7b('0x16')](function(_0x12374b){_0x50a161=_0x12374b[_0x4f7b('0xf')]({'plain':!![]});if(_0x50a161&&_0x50a161[_0x4f7b('0x23')]){logger[_0x4f7b('0x24')](_0x4f7b('0x25'),_0x4f7b('0x26'),util[_0x4f7b('0x27')](_0x4f7b('0x28'),_0x3a3d6c['id'],_0x50a161['replyUri']));if(_0x50a161[_0x4f7b('0x20')]&&_0x50a161[_0x4f7b('0x20')][_0x4f7b('0x29')]){_0x3a3d6c['Interaction']=_[_0x4f7b('0x2a')](_0x50a161[_0x4f7b('0x20')][0x0],'Contact');_0x3a3d6c[_0x4f7b('0x22')]=_0x50a161['Interactions'][0x0][_0x4f7b('0x22')];}var _0x433563={'method':_0x4f7b('0x2b'),'uri':encodeURI(_0x50a161[_0x4f7b('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x433563[_0x4f7b('0x2c')]){case _0x4f7b('0x2d'):_0x433563['qs']=_0x3a3d6c;break;case _0x4f7b('0x2b'):_0x433563[_0x4f7b('0xc')]=_0x3a3d6c;break;}return rp(_0x433563)['then'](function(_0x6c9626){logger[_0x4f7b('0x24')](_0x4f7b('0x25'),'afterCreate',util[_0x4f7b('0x27')](_0x4f7b('0x2e'),_0x3a3d6c['id'],_0x50a161[_0x4f7b('0x23')]));if(_0x6c9626[_0x4f7b('0xc')][_0x4f7b('0x2f')]&&_0x6c9626['body'][_0x4f7b('0x2f')]!=_0x3a3d6c[_0x4f7b('0x30')][_0x4f7b('0x2f')]){return _0x479208['OpenchannelInteraction'][_0x4f7b('0x17')]({'threadId':_0x6c9626['body']['threadId']},{'logging':!![],'where':{'id':_0x3a3d6c[_0x4f7b('0x30')]['id']}});}else{return;}})['then'](function(){return _0x5c714d[_0x4f7b('0x17')]({'read':!![]});})[_0x4f7b('0x19')](function(_0x22f489){logger[_0x4f7b('0x1a')](_0x4f7b('0x25'),_0x4f7b('0x26'),util[_0x4f7b('0x31')](_0x22f489,{'showHidden':![],'depth':null}));_0x1016e0();});}else{_0x1016e0();}})[_0x4f7b('0x32')](function(){_0x1016e0();});}else{_0x1016e0();}}},'charset':_0x4f7b('0x33'),'collate':_0x4f7b('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index aa743ea..fcc4601 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x265fa2,_0x284aaf){var _0x3e7e41=function(_0x45b5cf){while(--_0x45b5cf){_0x265fa2['push'](_0x265fa2['shift']());}};_0x3e7e41(++_0x284aaf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11bc77,_0x5e4b18){_0x11bc77=_0x11bc77-0x0;var _0xa06cbf=_0x5f2f[_0x11bc77];return _0xa06cbf;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x443ba4,_0x108a3b){var _0x5208e2=function(_0x3e79e3){while(--_0x3e79e3){_0x443ba4['push'](_0x443ba4['shift']());}};_0x5208e2(++_0x108a3b);}(_0x2ef3,0xba));var _0x32ef=function(_0x381725,_0x5088f1){_0x381725=_0x381725-0x0;var _0x5bf1ac=_0x2ef3[_0x381725];return _0x5bf1ac;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 559eed6..1de9089 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 _0x0bec=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit'];(function(_0x3d01e4,_0x41546e){var _0x440197=function(_0x229ab7){while(--_0x229ab7){_0x3d01e4['push'](_0x3d01e4['shift']());}};_0x440197(++_0x41546e);}(_0x0bec,0x173));var _0xc0be=function(_0x3e1d58,_0x2d3de0){_0x3e1d58=_0x3e1d58-0x0;var _0x14802b=_0x0bec[_0x3e1d58];return _0x14802b;};'use strict';var OpenchannelMessageEvents=require(_0xc0be('0x0'));var events=[_0xc0be('0x1'),_0xc0be('0x2'),_0xc0be('0x3')];function createListener(_0x15d179,_0x7dcc3b){return function(_0x231709){_0x7dcc3b[_0xc0be('0x4')](_0x15d179,_0x231709);};}function removeListener(_0x566223,_0x4f6eb4){return function(){OpenchannelMessageEvents[_0xc0be('0x5')](_0x566223,_0x4f6eb4);};}exports['register']=function(_0x59c5e4){for(var _0x3a6cef=0x0,_0x2a8c0e=events[_0xc0be('0x6')];_0x3a6cef<_0x2a8c0e;_0x3a6cef++){var _0x72efc1=events[_0x3a6cef];var _0x1ec806=createListener(_0xc0be('0x7')+_0x72efc1,_0x59c5e4);OpenchannelMessageEvents['on'](_0x72efc1,_0x1ec806);}}; \ No newline at end of file +var _0x3f7d=['removeListener','register','length','./openchannelMessage.events','save','remove','emit'];(function(_0x3fbbd0,_0x269a1f){var _0x135c98=function(_0x19cda4){while(--_0x19cda4){_0x3fbbd0['push'](_0x3fbbd0['shift']());}};_0x135c98(++_0x269a1f);}(_0x3f7d,0x18b));var _0xd3f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f7d[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelMessageEvents=require(_0xd3f7('0x0'));var events=[_0xd3f7('0x1'),_0xd3f7('0x2'),'update'];function createListener(_0x2264c0,_0x570927){return function(_0x477d2f){_0x570927[_0xd3f7('0x3')](_0x2264c0,_0x477d2f);};}function removeListener(_0x412e4e,_0x34306d){return function(){OpenchannelMessageEvents[_0xd3f7('0x4')](_0x412e4e,_0x34306d);};}exports[_0xd3f7('0x5')]=function(_0x455841){for(var _0x2122f9=0x0,_0x32438c=events[_0xd3f7('0x6')];_0x2122f9<_0x32438c;_0x2122f9++){var _0x26e439=events[_0x2122f9];var _0x1b6009=createListener('openchannelMessage:'+_0x26e439,_0x455841);OpenchannelMessageEvents['on'](_0x26e439,_0x1b6009);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a007fca..25050d4 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 _0x8c5e=['get','isAuthenticated','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller'];(function(_0x5c9c41,_0x10e953){var _0x1ced02=function(_0x52aef9){while(--_0x52aef9){_0x5c9c41['push'](_0x5c9c41['shift']());}};_0x1ced02(++_0x10e953);}(_0x8c5e,0xb6));var _0xe8c5=function(_0x1c120e,_0x7ec399){_0x1c120e=_0x1c120e-0x0;var _0x3d5bb5=_0x8c5e[_0x1c120e];return _0x3d5bb5;};'use strict';var multer=require('multer');var util=require(_0xe8c5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe8c5('0x1'));var router=express[_0xe8c5('0x2')]();var fs_extra=require(_0xe8c5('0x3'));var auth=require(_0xe8c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe8c5('0x5'));var controller=require(_0xe8c5('0x6'));router[_0xe8c5('0x7')]('/',auth[_0xe8c5('0x8')](),controller['index']);router[_0xe8c5('0x7')](_0xe8c5('0x9'),auth[_0xe8c5('0x8')](),controller[_0xe8c5('0xa')]);router[_0xe8c5('0x7')](_0xe8c5('0xb'),auth['isAuthenticated'](),controller[_0xe8c5('0xc')]);router[_0xe8c5('0x7')]('/:id/members',auth[_0xe8c5('0x8')](),controller[_0xe8c5('0xd')]);router[_0xe8c5('0x7')]('/:id/teams',auth[_0xe8c5('0x8')](),controller[_0xe8c5('0xe')]);router[_0xe8c5('0x7')](_0xe8c5('0xf'),auth[_0xe8c5('0x8')](),controller['getAgents']);router[_0xe8c5('0x10')]('/',auth[_0xe8c5('0x8')](),controller[_0xe8c5('0x11')]);router[_0xe8c5('0x10')](_0xe8c5('0x12'),auth[_0xe8c5('0x8')](),controller[_0xe8c5('0x13')]);router[_0xe8c5('0x10')](_0xe8c5('0xf'),auth[_0xe8c5('0x8')](),controller['addAgents']);router[_0xe8c5('0x14')](_0xe8c5('0xb'),auth[_0xe8c5('0x8')](),controller[_0xe8c5('0x15')]);router[_0xe8c5('0x16')](_0xe8c5('0xb'),auth[_0xe8c5('0x8')](),controller[_0xe8c5('0x17')]);router['delete'](_0xe8c5('0x12'),auth['isAuthenticated'](),controller[_0xe8c5('0x18')]);router[_0xe8c5('0x16')](_0xe8c5('0xf'),auth[_0xe8c5('0x8')](),controller[_0xe8c5('0x19')]);module[_0xe8c5('0x1a')]=router; \ No newline at end of file +var _0x9b1c=['describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x9b1c,0xe7));var _0xc9b1=function(_0x18a6d4,_0x4378dc){_0x18a6d4=_0x18a6d4-0x0;var _0x59a605=_0x9b1c[_0x18a6d4];return _0x59a605;};'use strict';var multer=require(_0xc9b1('0x0'));var util=require(_0xc9b1('0x1'));var path=require('path');var timeout=require(_0xc9b1('0x2'));var express=require('express');var router=express[_0xc9b1('0x3')]();var fs_extra=require(_0xc9b1('0x4'));var auth=require(_0xc9b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b1('0x6'));var controller=require(_0xc9b1('0x7'));router[_0xc9b1('0x8')]('/',auth[_0xc9b1('0x9')](),controller[_0xc9b1('0xa')]);router[_0xc9b1('0x8')](_0xc9b1('0xb'),auth[_0xc9b1('0x9')](),controller[_0xc9b1('0xc')]);router['get'](_0xc9b1('0xd'),auth[_0xc9b1('0x9')](),controller[_0xc9b1('0xe')]);router[_0xc9b1('0x8')](_0xc9b1('0xf'),auth[_0xc9b1('0x9')](),controller['getMembers']);router[_0xc9b1('0x8')](_0xc9b1('0x10'),auth[_0xc9b1('0x9')](),controller[_0xc9b1('0x11')]);router[_0xc9b1('0x8')](_0xc9b1('0x12'),auth[_0xc9b1('0x9')](),controller[_0xc9b1('0x13')]);router[_0xc9b1('0x14')]('/',auth[_0xc9b1('0x9')](),controller[_0xc9b1('0x15')]);router['post'](_0xc9b1('0x10'),auth['isAuthenticated'](),controller[_0xc9b1('0x16')]);router[_0xc9b1('0x14')](_0xc9b1('0x12'),auth['isAuthenticated'](),controller[_0xc9b1('0x17')]);router[_0xc9b1('0x18')]('/:id',auth[_0xc9b1('0x9')](),controller['update']);router[_0xc9b1('0x19')]('/:id',auth[_0xc9b1('0x9')](),controller['destroy']);router[_0xc9b1('0x19')](_0xc9b1('0x10'),auth[_0xc9b1('0x9')](),controller['removeTeams']);router[_0xc9b1('0x19')](_0xc9b1('0x12'),auth['isAuthenticated'](),controller[_0xc9b1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2d055b1..c92e55a 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 _0x33b3=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x2df413,_0x5303ae){var _0x1f5133=function(_0xb2347c){while(--_0xb2347c){_0x2df413['push'](_0x2df413['shift']());}};_0x1f5133(++_0x5303ae);}(_0x33b3,0xbb));var _0x333b=function(_0x500396,_0x4fe4ea){_0x500396=_0x500396-0x0;var _0x28093b=_0x33b3[_0x500396];return _0x28093b;};'use strict';var Sequelize=require(_0x333b('0x0'));module[_0x333b('0x1')]={'name':{'type':Sequelize[_0x333b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x333b('0x2')]},'timeout':{'type':Sequelize[_0x333b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x333b('0x4')](_0x333b('0x5'),_0x333b('0x6'),_0x333b('0x7'))}}; \ No newline at end of file +var _0xdd23=['STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x360f03,_0x349238){var _0xc0390=function(_0x59bcfc){while(--_0x59bcfc){_0x360f03['push'](_0x360f03['shift']());}};_0xc0390(++_0x349238);}(_0xdd23,0x186));var _0x3dd2=function(_0x44c73d,_0x486a49){_0x44c73d=_0x44c73d-0x0;var _0xe2b045=_0xdd23[_0x44c73d];return _0xe2b045;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3dd2('0x0')],'unique':_0x3dd2('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3dd2('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3dd2('0x2')](_0x3dd2('0x3'),_0x3dd2('0x4'),_0x3dd2('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 89e00e7..bf3062e 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 _0x11be=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','OpenchannelQueue','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','openchannelPause','createdAt','format','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','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','redis','defaults','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields'];(function(_0x5925f5,_0x7f29a7){var _0x3f87c6=function(_0x37b8d0){while(--_0x37b8d0){_0x5925f5['push'](_0x5925f5['shift']());}};_0x3f87c6(++_0x7f29a7);}(_0x11be,0xde));var _0xe11b=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0x11be[_0x2353fe];return _0x4d43f6;};'use strict';var emlformat=require(_0xe11b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe11b('0x1'));var jsonpatch=require(_0xe11b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe11b('0x3'));var Mustache=require(_0xe11b('0x4'));var util=require('util');var path=require(_0xe11b('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe11b('0x6'));var _=require(_0xe11b('0x7'));var squel=require(_0xe11b('0x8'));var crypto=require(_0xe11b('0x9'));var jsforce=require(_0xe11b('0xa'));var deskjs=require(_0xe11b('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe11b('0xc'));var Papa=require(_0xe11b('0xd'));var Redis=require(_0xe11b('0xe'));var authService=require(_0xe11b('0xf'));var qs=require(_0xe11b('0x10'));var as=require(_0xe11b('0x11'));var hardwareService=require(_0xe11b('0x12'));var logger=require(_0xe11b('0x13'))(_0xe11b('0x14'));var utils=require(_0xe11b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe11b('0x16'));var db=require(_0xe11b('0x17'))['db'];config[_0xe11b('0x18')]=_[_0xe11b('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe11b('0x18')]));require(_0xe11b('0x1a'))[_0xe11b('0x1b')](socket);function respondWithStatusCode(_0x5602f1,_0x4bb426){_0x4bb426=_0x4bb426||0xcc;return function(_0x5bdd21){if(_0x5bdd21){return _0x5602f1[_0xe11b('0x1c')](_0x4bb426);}return _0x5602f1[_0xe11b('0x1d')](_0x4bb426)[_0xe11b('0x1e')]();};}function respondWithResult(_0x46224f,_0x2cddd8){_0x2cddd8=_0x2cddd8||0xc8;return function(_0x3652ec){if(_0x3652ec){return _0x46224f[_0xe11b('0x1d')](_0x2cddd8)[_0xe11b('0x1f')](_0x3652ec);}};}function respondWithFilteredResult(_0x2d358a,_0x237f37){return function(_0x4643ea){if(_0x4643ea){var _0x457444=typeof _0x237f37[_0xe11b('0x20')]===_0xe11b('0x21')&&typeof _0x237f37[_0xe11b('0x22')]==='undefined';var _0x354f15=_0x4643ea[_0xe11b('0x23')];var _0x1f455c=_0x457444?0x0:_0x237f37[_0xe11b('0x20')];var _0x53f685=_0x457444?_0x4643ea[_0xe11b('0x23')]:_0x237f37[_0xe11b('0x20')]+_0x237f37[_0xe11b('0x22')];var _0x4cd907;if(_0x53f685>=_0x354f15){_0x53f685=_0x354f15;_0x4cd907=0xc8;}else{_0x4cd907=0xce;}_0x2d358a['status'](_0x4cd907);return _0x2d358a[_0xe11b('0x24')](_0xe11b('0x25'),_0x1f455c+'-'+_0x53f685+'/'+_0x354f15)['json'](_0x4643ea);}return null;};}function patchUpdates(_0x230870){return function(_0x327036){try{jsonpatch[_0xe11b('0x26')](_0x327036,_0x230870,!![]);}catch(_0x2d1f2d){return BPromise[_0xe11b('0x27')](_0x2d1f2d);}return _0x327036[_0xe11b('0x28')]();};}function saveUpdates(_0x3f9a09,_0xd7ff7b){return function(_0x2b3658){if(_0x2b3658){return _0x2b3658['update'](_0x3f9a09)[_0xe11b('0x29')](function(_0x907a27){return _0x907a27;});}return null;};}function removeEntity(_0x529af0,_0x49d2a3){return function(_0x51e861){if(_0x51e861){return _0x51e861[_0xe11b('0x2a')]()[_0xe11b('0x29')](function(){var _0x6cea95=_0x51e861[_0xe11b('0x2b')]({'plain':!![]});var _0x4c23a4=_0xe11b('0x2c');return db[_0xe11b('0x2d')]['destroy']({'where':{'type':_0x4c23a4,'resourceId':_0x6cea95['id']}})['then'](function(){return _0x51e861;});})[_0xe11b('0x29')](function(){_0x529af0['status'](0xcc)[_0xe11b('0x1e')]();});}};}function handleEntityNotFound(_0x570b42,_0x2930b5){return function(_0x437512){if(!_0x437512){_0x570b42[_0xe11b('0x1c')](0x194);}return _0x437512;};}function handleError(_0x5911ca,_0x43e107){_0x43e107=_0x43e107||0x1f4;return function(_0x5b1371){logger['error'](_0x5b1371[_0xe11b('0x2e')]);if(_0x5b1371[_0xe11b('0x2f')]){delete _0x5b1371['name'];}_0x5911ca[_0xe11b('0x1d')](_0x43e107)[_0xe11b('0x30')](_0x5b1371);};}exports[_0xe11b('0x31')]=function(_0x24e869,_0x160514){var _0xd213b0={},_0x28a254={},_0x5e5cb8={'count':0x0,'rows':[]};var _0x21b3ad=_[_0xe11b('0x32')](db['OpenchannelQueue'][_0xe11b('0x33')],function(_0x554adc){return{'name':_0x554adc[_0xe11b('0x34')],'type':_0x554adc[_0xe11b('0x35')][_0xe11b('0x36')]};});_0x28a254['model']=_['map'](_0x21b3ad,'name');_0x28a254['query']=_[_0xe11b('0x37')](_0x24e869[_0xe11b('0x38')]);_0x28a254[_0xe11b('0x39')]=_['intersection'](_0x28a254[_0xe11b('0x3a')],_0x28a254[_0xe11b('0x38')]);_0xd213b0[_0xe11b('0x3b')]=_[_0xe11b('0x3c')](_0x28a254[_0xe11b('0x3a')],qs[_0xe11b('0x3d')](_0x24e869[_0xe11b('0x38')][_0xe11b('0x3d')]));_0xd213b0[_0xe11b('0x3b')]=_0xd213b0['attributes'][_0xe11b('0x3e')]?_0xd213b0[_0xe11b('0x3b')]:_0x28a254[_0xe11b('0x3a')];if(!_0x24e869['query'][_0xe11b('0x3f')](_0xe11b('0x40'))){_0xd213b0[_0xe11b('0x22')]=qs['limit'](_0x24e869['query'][_0xe11b('0x22')]);_0xd213b0[_0xe11b('0x20')]=qs['offset'](_0x24e869['query'][_0xe11b('0x20')]);}_0xd213b0[_0xe11b('0x41')]=qs['sort'](_0x24e869[_0xe11b('0x38')][_0xe11b('0x42')]);_0xd213b0[_0xe11b('0x43')]=qs['filters'](_[_0xe11b('0x44')](_0x24e869[_0xe11b('0x38')],_0x28a254[_0xe11b('0x39')]),_0x21b3ad);if(_0x24e869[_0xe11b('0x38')][_0xe11b('0x45')]){_0xd213b0['where']=_['merge'](_0xd213b0[_0xe11b('0x43')],{'$or':_[_0xe11b('0x32')](_0x21b3ad,function(_0x2abded){if(_0x2abded[_0xe11b('0x35')]!==_0xe11b('0x46')){var _0x42083f={};_0x42083f[_0x2abded['name']]={'$like':'%'+_0x24e869['query']['filter']+'%'};return _0x42083f;}})});}_0xd213b0=_[_0xe11b('0x47')]({},_0xd213b0,_0x24e869[_0xe11b('0x48')]);var _0x59a48a={'where':_0xd213b0[_0xe11b('0x43')]};return db['OpenchannelQueue']['count'](_0x59a48a)['then'](function(_0x403a06){_0x5e5cb8['count']=_0x403a06;if(_0x24e869['query'][_0xe11b('0x49')]){_0xd213b0['include']=[{'all':!![]}];}return db[_0xe11b('0x4a')][_0xe11b('0x4b')](_0xd213b0);})[_0xe11b('0x29')](function(_0x4e9393){_0x5e5cb8[_0xe11b('0x4c')]=_0x4e9393;return _0x5e5cb8;})[_0xe11b('0x29')](respondWithFilteredResult(_0x160514,_0xd213b0))[_0xe11b('0x4d')](handleError(_0x160514,null));};exports[_0xe11b('0x4e')]=function(_0x3c2e2c,_0x477714){var _0x2a9118={'raw':!![],'where':{'id':_0x3c2e2c[_0xe11b('0x4f')]['id']}},_0x4fdec5={};_0x4fdec5[_0xe11b('0x3a')]=_[_0xe11b('0x37')](db[_0xe11b('0x4a')]['rawAttributes']);_0x4fdec5[_0xe11b('0x38')]=_['keys'](_0x3c2e2c['query']);_0x4fdec5['filters']=_[_0xe11b('0x3c')](_0x4fdec5[_0xe11b('0x3a')],_0x4fdec5[_0xe11b('0x38')]);_0x2a9118[_0xe11b('0x3b')]=_[_0xe11b('0x3c')](_0x4fdec5[_0xe11b('0x3a')],qs[_0xe11b('0x3d')](_0x3c2e2c[_0xe11b('0x38')]['fields']));_0x2a9118['attributes']=_0x2a9118['attributes'][_0xe11b('0x3e')]?_0x2a9118['attributes']:_0x4fdec5['model'];if(_0x3c2e2c['query']['includeAll']){_0x2a9118['include']=[{'all':!![]}];}_0x2a9118=_['merge']({},_0x2a9118,_0x3c2e2c[_0xe11b('0x48')]);return db[_0xe11b('0x4a')]['find'](_0x2a9118)[_0xe11b('0x29')](handleEntityNotFound(_0x477714,null))[_0xe11b('0x29')](respondWithResult(_0x477714,null))['catch'](handleError(_0x477714,null));};exports[_0xe11b('0x50')]=function(_0x2ad87e,_0x4ab949){return db[_0xe11b('0x4a')][_0xe11b('0x50')](_0x2ad87e[_0xe11b('0x51')],{})[_0xe11b('0x29')](function(_0x8aca39){var _0x35d09c=_0x2ad87e[_0xe11b('0x52')][_0xe11b('0x2b')]({'plain':!![]});if(!_0x35d09c)throw new Error(_0xe11b('0x53'));if(_0x35d09c['role']===_0xe11b('0x52')){var _0xd8ad3b=_0x8aca39[_0xe11b('0x2b')]({'plain':!![]});var _0x24454a=_0xe11b('0x2c');return db[_0xe11b('0x54')][_0xe11b('0x55')]({'where':{'name':_0x24454a,'userProfileId':_0x35d09c[_0xe11b('0x56')]},'raw':!![]})[_0xe11b('0x29')](function(_0x1f64c1){if(_0x1f64c1&&_0x1f64c1['autoAssociation']===0x0){return db[_0xe11b('0x2d')]['create']({'name':_0xd8ad3b[_0xe11b('0x2f')],'resourceId':_0xd8ad3b['id'],'type':_0x1f64c1[_0xe11b('0x2f')],'sectionId':_0x1f64c1['id']},{})[_0xe11b('0x29')](function(){return _0x8aca39;});}else{return _0x8aca39;}})[_0xe11b('0x4d')](function(_0xf272f4){logger[_0xe11b('0x57')](_0xe11b('0x58'),_0xf272f4);throw _0xf272f4;});}return _0x8aca39;})[_0xe11b('0x29')](respondWithResult(_0x4ab949,0xc9))[_0xe11b('0x4d')](handleError(_0x4ab949,null));};exports[_0xe11b('0x59')]=function(_0x469ee6,_0x284422){if(_0x469ee6['body']['id']){delete _0x469ee6['body']['id'];}return db[_0xe11b('0x4a')]['find']({'where':{'id':_0x469ee6[_0xe11b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x284422,null))[_0xe11b('0x29')](saveUpdates(_0x469ee6['body'],null))[_0xe11b('0x29')](respondWithResult(_0x284422,null))[_0xe11b('0x4d')](handleError(_0x284422,null));};exports[_0xe11b('0x2a')]=function(_0xc3be88,_0x1c2641){return db[_0xe11b('0x4a')][_0xe11b('0x55')]({'where':{'id':_0xc3be88['params']['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x1c2641,null))[_0xe11b('0x29')](removeEntity(_0x1c2641,null))[_0xe11b('0x4d')](handleError(_0x1c2641,null));};exports[_0xe11b('0x5a')]=function(_0x1be8c8,_0x295aad){return db['OpenchannelQueue'][_0xe11b('0x5a')]()[_0xe11b('0x29')](respondWithResult(_0x295aad,null))[_0xe11b('0x4d')](handleError(_0x295aad,null));};exports[_0xe11b('0x5b')]=function(_0x5a78e1,_0x25b6cf,_0x4af36d){var _0x5a8fa4={'raw':!![],'where':{}},_0x271d74={},_0x545851;return db[_0xe11b('0x4a')][_0xe11b('0x5c')]({'where':{'id':_0x5a78e1[_0xe11b('0x4f')]['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x25b6cf,null))['then'](function(_0x456e48){if(_0x456e48){_0x545851=_0x456e48['get']({'plain':!![]});_0x271d74['model']=_[_0xe11b('0x37')](db[_0xe11b('0x5d')][_0xe11b('0x33')]);_0x271d74[_0xe11b('0x38')]=_['keys'](_0x5a78e1[_0xe11b('0x38')]);_0x271d74[_0xe11b('0x39')]=_[_0xe11b('0x3c')](_0x271d74[_0xe11b('0x3a')],_0x271d74[_0xe11b('0x38')]);_0x5a8fa4[_0xe11b('0x3b')]=_['intersection'](_0x271d74[_0xe11b('0x3a')],qs[_0xe11b('0x3d')](_0x5a78e1['query'][_0xe11b('0x3d')]));_0x5a8fa4[_0xe11b('0x3b')]=_0x5a8fa4[_0xe11b('0x3b')][_0xe11b('0x3e')]?_0x5a8fa4[_0xe11b('0x3b')]:_0x271d74[_0xe11b('0x3a')];if(!_0x5a78e1[_0xe11b('0x38')][_0xe11b('0x3f')](_0xe11b('0x40'))){_0x5a8fa4[_0xe11b('0x22')]=qs[_0xe11b('0x22')](_0x5a78e1[_0xe11b('0x38')][_0xe11b('0x22')]);_0x5a8fa4[_0xe11b('0x20')]=qs[_0xe11b('0x20')](_0x5a78e1['query'][_0xe11b('0x20')]);}_0x5a8fa4[_0xe11b('0x41')]=qs[_0xe11b('0x42')](_0x5a78e1[_0xe11b('0x38')][_0xe11b('0x42')]);_0x5a8fa4[_0xe11b('0x43')]=qs['filters'](_['pick'](_0x5a78e1[_0xe11b('0x38')],_0x271d74['filters']));_0x5a8fa4['where'][_0xe11b('0x5e')]=_0x456e48['id'];if(_0x5a78e1[_0xe11b('0x38')][_0xe11b('0x45')]){_0x5a8fa4[_0xe11b('0x43')]=_['merge'](_0x5a8fa4[_0xe11b('0x43')],{'$or':_[_0xe11b('0x32')](_0x5a8fa4[_0xe11b('0x3b')],function(_0x3ca502){var _0x27712c={};_0x27712c[_0x3ca502]={'$like':'%'+_0x5a78e1[_0xe11b('0x38')][_0xe11b('0x45')]+'%'};return _0x27712c;})});}_0x5a8fa4=_['merge']({},_0x5a8fa4,_0x5a78e1['options']);return db[_0xe11b('0x5d')][_0xe11b('0x4b')](_0x5a8fa4);}})[_0xe11b('0x29')](function(_0x168e9a){if(_0x168e9a){return db[_0xe11b('0x5f')][_0xe11b('0x60')]({'where':{'id':_[_0xe11b('0x32')](_0x168e9a,'UserId'),'role':'agent'},'attributes':['id',_0xe11b('0x2f'),_0xe11b('0x61'),'updatedAt',_0xe11b('0x62')]});}})[_0xe11b('0x29')](function(_0xce99e2){if(_0xce99e2){return{'count':_0xce99e2[_0xe11b('0x23')],'rows':_[_0xe11b('0x32')](_0xce99e2['rows'],function(_0x2bd4ce){return{'membername':_0x2bd4ce[_0xe11b('0x2f')],'UserId':_0x2bd4ce['id'],'queue_name':_0x545851[_0xe11b('0x2f')],'OpenchannelQueueId':_0x545851['id'],'interface':util[_0xe11b('0x63')]('%s/%s',_0xe11b('0x64'),_0x2bd4ce[_0xe11b('0x2f')]),'penalty':0x0,'paused':_0x2bd4ce[_0xe11b('0x61')],'createdAt':_0x2bd4ce[_0xe11b('0x62')],'updatedAt':_0x2bd4ce[_0xe11b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe11b('0x29')](respondWithFilteredResult(_0x25b6cf,_0x5a8fa4))[_0xe11b('0x4d')](handleError(_0x25b6cf,null));};exports[_0xe11b('0x66')]=function(_0x2745e6,_0x3190fe,_0x220648){var _0x49fb00={};var _0xe0fa1c={};var _0x78fa79;var _0x3ea238;return db[_0xe11b('0x4a')][_0xe11b('0x5c')]({'where':{'id':_0x2745e6['params']['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x3190fe,null))['then'](function(_0x5d3e0d){if(_0x5d3e0d){_0x78fa79=_0x5d3e0d;_0xe0fa1c[_0xe11b('0x3a')]=_['keys'](db[_0xe11b('0x67')]['rawAttributes']);_0xe0fa1c[_0xe11b('0x38')]=_[_0xe11b('0x37')](_0x2745e6[_0xe11b('0x38')]);_0xe0fa1c[_0xe11b('0x39')]=_[_0xe11b('0x3c')](_0xe0fa1c['model'],_0xe0fa1c[_0xe11b('0x38')]);_0x49fb00['attributes']=_[_0xe11b('0x3c')](_0xe0fa1c[_0xe11b('0x3a')],qs[_0xe11b('0x3d')](_0x2745e6['query'][_0xe11b('0x3d')]));_0x49fb00['attributes']=_0x49fb00[_0xe11b('0x3b')]['length']?_0x49fb00[_0xe11b('0x3b')]:_0xe0fa1c['model'];_0x49fb00['order']=qs[_0xe11b('0x42')](_0x2745e6['query'][_0xe11b('0x42')]);_0x49fb00['where']=qs[_0xe11b('0x39')](_[_0xe11b('0x44')](_0x2745e6['query'],_0xe0fa1c['filters']));if(_0x2745e6[_0xe11b('0x38')][_0xe11b('0x45')]){_0x49fb00[_0xe11b('0x43')]=_[_0xe11b('0x47')](_0x49fb00[_0xe11b('0x43')],{'$or':_['map'](_0x49fb00[_0xe11b('0x3b')],function(_0x48abb8){var _0x8688e0={};_0x8688e0[_0x48abb8]={'$like':'%'+_0x2745e6[_0xe11b('0x38')][_0xe11b('0x45')]+'%'};return _0x8688e0;})});}_0x49fb00=_[_0xe11b('0x47')]({},_0x49fb00,_0x2745e6[_0xe11b('0x48')]);return _0x78fa79[_0xe11b('0x66')](_0x49fb00);}})[_0xe11b('0x29')](function(_0x527547){if(_0x527547){_0x3ea238=_0x527547[_0xe11b('0x3e')];if(!_0x2745e6[_0xe11b('0x38')][_0xe11b('0x3f')](_0xe11b('0x40'))){_0x49fb00[_0xe11b('0x22')]=qs[_0xe11b('0x22')](_0x2745e6[_0xe11b('0x38')][_0xe11b('0x22')]);_0x49fb00['offset']=qs['offset'](_0x2745e6['query'][_0xe11b('0x20')]);}return _0x78fa79['getTeams'](_0x49fb00);}})[_0xe11b('0x29')](function(_0x321793){if(_0x321793){return _0x321793?{'count':_0x3ea238,'rows':_0x321793}:null;}})[_0xe11b('0x29')](respondWithResult(_0x3190fe,null))['catch'](handleError(_0x3190fe,null));};exports['addTeams']=function(_0x438eae,_0x11cc76,_0x10abbe){var _0x1d9dbc=_0x438eae[_0xe11b('0x51')][_0xe11b('0x68')];return db[_0xe11b('0x67')][_0xe11b('0x4b')]({'where':{'id':_0x1d9dbc},'attributes':['id'],'include':[{'model':db[_0xe11b('0x5f')],'as':_0xe11b('0x69'),'attributes':['id','name',_0xe11b('0x6a'),_0xe11b('0x6b'),_0xe11b('0x6c')],'raw':!![]}]})[_0xe11b('0x29')](function(_0x4122ce){if(_0x4122ce){var _0x5302f0=_['flatMap'](_0x4122ce,function(_0x4b761a){var _0x1cf00b=_0x4b761a[_0xe11b('0x2b')]({'plain':!![]});return _0x1cf00b[_0xe11b('0x69')];});return db[_0xe11b('0x4a')][_0xe11b('0x55')]({'where':{'id':_0x438eae['params']['id']}})[_0xe11b('0x29')](function(_0x43ce70){return db[_0xe11b('0x6d')][_0xe11b('0x6e')](function(_0x4172f6){return _0x43ce70['addTeams'](_0x1d9dbc,{'transaction':_0x4172f6})['then'](function(){return BPromise[_0xe11b('0x6f')](_0x5302f0,function(_0x2ea496){return db[_0xe11b('0x5d')][_0xe11b('0x70')]({'where':{'UserId':_0x2ea496['id'],'OpenchannelQueueId':_0x438eae['params']['id']},'transaction':_0x4172f6});});})[_0xe11b('0x29')](function(){_0x5302f0[_0xe11b('0x71')](function(_0x205607){socket[_0xe11b('0x72')]('userOpenchannelQueue:save',{'UserId':_0x205607['id'],'OpenchannelQueueId':_0x43ce70['id']});});});});});}})[_0xe11b('0x29')](respondWithStatusCode(_0x11cc76,null))[_0xe11b('0x4d')](handleError(_0x11cc76,null));};exports[_0xe11b('0x73')]=function(_0x54219a,_0xf01de3,_0x120204){return db[_0xe11b('0x67')][_0xe11b('0x4b')]({'where':{'id':_0x54219a[_0xe11b('0x38')][_0xe11b('0x68')]},'attributes':['id'],'include':[{'model':db[_0xe11b('0x5f')],'as':_0xe11b('0x69'),'attributes':['id'],'raw':!![]}]})[_0xe11b('0x29')](handleEntityNotFound(_0xf01de3,null))[_0xe11b('0x29')](function(_0x235bd4){var _0x4ea9eb=_[_0xe11b('0x32')](_0x235bd4,'id');var _0x569ded=[];var _0x40338e=[];var _0x964e72=squel[_0xe11b('0x74')]();_0x964e72[_0xe11b('0x75')](_0xe11b('0x76'))[_0xe11b('0x77')]('team_has_openchannel_queues','tq')[_0xe11b('0x78')]('user_has_teams','ut',_0xe11b('0x79'))[_0xe11b('0x43')](_0xe11b('0x7a'),_0x54219a[_0xe11b('0x4f')]['id']);for(var _0x308b0a=0x0;_0x308b0a<_0x235bd4[_0xe11b('0x3e')];_0x308b0a+=0x1){let _0x416754=_0x235bd4[_0x308b0a];for(var _0x6fcec3=0x0;_0x6fcec3<_0x416754[_0xe11b('0x69')][_0xe11b('0x3e')];_0x6fcec3+=0x1){let _0x5000a9=_0x416754[_0xe11b('0x69')][_0x6fcec3];var _0x38a773=_0x964e72['clone']();_0x38a773['where'](_0xe11b('0x7b'),_0x5000a9['id']);_0x40338e[_0xe11b('0x7c')](db[_0xe11b('0x6d')][_0xe11b('0x38')](_0x38a773[_0xe11b('0x7d')](),{'type':db[_0xe11b('0x6d')][_0xe11b('0x7e')][_0xe11b('0x7f')]})[_0xe11b('0x29')](function(_0x54ea37){if(_0x54ea37[_0xe11b('0x3e')]===0x1){return _0x5000a9['id'];}else{var _0x1cafab=_[_0xe11b('0x80')](_[_0xe11b('0x32')](_0x54ea37,_0xe11b('0x81')),function(_0x59d356){return _[_0xe11b('0x82')](_0x4ea9eb,_0x59d356);});if(_0x1cafab){return _0x5000a9['id'];}}}));}}return BPromise[_0xe11b('0x83')](_0x40338e)[_0xe11b('0x29')](function(_0x30dab6){_0x569ded=_(_0x569ded)['union'](_0x30dab6)[_0xe11b('0x84')]()[_0xe11b('0x85')]();return db[_0xe11b('0x4a')][_0xe11b('0x55')]({'where':{'id':_0x54219a[_0xe11b('0x4f')]['id']}})[_0xe11b('0x29')](function(_0x269fd7){return db[_0xe11b('0x6d')][_0xe11b('0x6e')](function(_0x5402ce){return _0x269fd7[_0xe11b('0x73')](_0x54219a['query'][_0xe11b('0x68')],{'transaction':_0x5402ce})[_0xe11b('0x29')](function(){if(!_[_0xe11b('0x86')](_0x569ded)){return _0x269fd7['removeAgents'](_0x569ded,{'transaction':_0x5402ce});}})[_0xe11b('0x29')](function(){_0x569ded[_0xe11b('0x71')](function(_0x286589){socket[_0xe11b('0x72')](_0xe11b('0x87'),{'UserId':_0x286589,'OpenchannelQueueId':_0x269fd7['id']});});});});});});})[_0xe11b('0x29')](respondWithStatusCode(_0xf01de3,null))['catch'](handleError(_0xf01de3,null));};exports[_0xe11b('0x88')]=function(_0x39e9c1,_0x44641d,_0x1a8acf){return db[_0xe11b('0x4a')][_0xe11b('0x55')]({'where':{'id':_0x39e9c1['params']['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x44641d,null))['then'](function(_0x15c314){if(_0x15c314){return _0x15c314[_0xe11b('0x88')](_0x39e9c1['body'][_0xe11b('0x68')],_['omit'](_0x39e9c1[_0xe11b('0x51')],[_0xe11b('0x68'),'id'])||{})[_0xe11b('0x89')](function(_0x554b5){for(var _0x5b4901=0x0;_0x5b4901<_0x39e9c1[_0xe11b('0x51')][_0xe11b('0x68')]['length'];_0x5b4901+=0x1){socket[_0xe11b('0x72')](_0xe11b('0x8a'),{'UserId':Number(_0x39e9c1['body'][_0xe11b('0x68')][_0x5b4901]),'OpenchannelQueueId':Number(_0x39e9c1[_0xe11b('0x4f')]['id'])});}return _0x554b5;});}})['then'](respondWithResult(_0x44641d,null))[_0xe11b('0x4d')](handleError(_0x44641d,null));};exports['removeAgents']=function(_0x3790e6,_0x1c383c,_0x389b11){return db[_0xe11b('0x4a')]['find']({'where':{'id':_0x3790e6[_0xe11b('0x4f')]['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x1c383c,null))[_0xe11b('0x29')](function(_0x4dda96){if(_0x4dda96){return _0x4dda96[_0xe11b('0x8b')](_0x3790e6[_0xe11b('0x38')][_0xe11b('0x68')])[_0xe11b('0x29')](function(){if(_[_0xe11b('0x8c')](_0x3790e6[_0xe11b('0x38')][_0xe11b('0x68')])){for(var _0x443cf6=0x0;_0x443cf6<_0x3790e6[_0xe11b('0x38')][_0xe11b('0x68')][_0xe11b('0x3e')];_0x443cf6+=0x1){socket['emit'](_0xe11b('0x87'),{'UserId':Number(_0x3790e6['query'][_0xe11b('0x68')][_0x443cf6]),'OpenchannelQueueId':Number(_0x3790e6['params']['id'])});}}else{socket['emit'](_0xe11b('0x87'),{'UserId':Number(_0x3790e6['query'][_0xe11b('0x68')]),'OpenchannelQueueId':Number(_0x3790e6[_0xe11b('0x4f')]['id'])});}});}})[_0xe11b('0x29')](respondWithStatusCode(_0x1c383c,null))[_0xe11b('0x4d')](handleError(_0x1c383c,null));};exports[_0xe11b('0x8d')]=function(_0x13b19d,_0x325152,_0x4ec727){var _0x278580={};var _0x56fa8b={};var _0x1cb784;var _0xce2292;return db[_0xe11b('0x4a')]['findOne']({'where':{'id':_0x13b19d[_0xe11b('0x4f')]['id']}})[_0xe11b('0x29')](handleEntityNotFound(_0x325152,null))[_0xe11b('0x29')](function(_0x175bdb){if(_0x175bdb){_0x1cb784=_0x175bdb;_0x56fa8b[_0xe11b('0x3a')]=_[_0xe11b('0x37')](db[_0xe11b('0x5f')][_0xe11b('0x33')]);_0x56fa8b[_0xe11b('0x38')]=_['keys'](_0x13b19d[_0xe11b('0x38')]);_0x56fa8b[_0xe11b('0x39')]=_[_0xe11b('0x3c')](_0x56fa8b[_0xe11b('0x3a')],_0x56fa8b[_0xe11b('0x38')]);_0x278580[_0xe11b('0x3b')]=_[_0xe11b('0x3c')](_0x56fa8b['model'],qs[_0xe11b('0x3d')](_0x13b19d[_0xe11b('0x38')]['fields']));_0x278580['attributes']=_0x278580[_0xe11b('0x3b')][_0xe11b('0x3e')]?_0x278580['attributes']:_0x56fa8b[_0xe11b('0x3a')];_0x278580[_0xe11b('0x41')]=qs[_0xe11b('0x42')](_0x13b19d[_0xe11b('0x38')][_0xe11b('0x42')]);_0x278580['where']=qs[_0xe11b('0x39')](_[_0xe11b('0x44')](_0x13b19d['query'],_0x56fa8b[_0xe11b('0x39')]));if(_0x13b19d[_0xe11b('0x38')][_0xe11b('0x45')]){_0x278580[_0xe11b('0x43')]=_[_0xe11b('0x47')](_0x278580[_0xe11b('0x43')],{'$or':_['map'](_0x278580['attributes'],function(_0xd91cf1){var _0x4e22db={};_0x4e22db[_0xd91cf1]={'$like':'%'+_0x13b19d[_0xe11b('0x38')][_0xe11b('0x45')]+'%'};return _0x4e22db;})});}_0x278580=_[_0xe11b('0x47')]({},_0x278580,_0x13b19d['options']);return _0x1cb784[_0xe11b('0x8d')](_0x278580);}})[_0xe11b('0x29')](function(_0x791aaf){if(_0x791aaf){_0xce2292=_0x791aaf[_0xe11b('0x3e')];if(!_0x13b19d[_0xe11b('0x38')][_0xe11b('0x3f')](_0xe11b('0x40'))){_0x278580[_0xe11b('0x22')]=qs[_0xe11b('0x22')](_0x13b19d['query']['limit']);_0x278580['offset']=qs[_0xe11b('0x20')](_0x13b19d[_0xe11b('0x38')][_0xe11b('0x20')]);}return _0x1cb784['getAgents'](_0x278580);}})['then'](function(_0x3bafce){if(_0x3bafce){return _0x3bafce?{'count':_0xce2292,'rows':_0x3bafce}:null;}})[_0xe11b('0x29')](respondWithResult(_0x325152,null))['catch'](handleError(_0x325152,null));}; \ No newline at end of file +var _0x2ae7=['attributes','length','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','show','params','includeAll','find','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','Team','select','team_has_openchannel_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','save','update','destroy','then','get','UserProfileResource','end','error','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','name','query','keys','filters','model','intersection','fields'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0x2ae7,0xd6));var _0x72ae=function(_0x3398f7,_0x3d6fb4){_0x3398f7=_0x3398f7-0x0;var _0x52ecb9=_0x2ae7[_0x3398f7];return _0x52ecb9;};'use strict';var emlformat=require(_0x72ae('0x0'));var rimraf=require(_0x72ae('0x1'));var zipdir=require(_0x72ae('0x2'));var jsonpatch=require(_0x72ae('0x3'));var rp=require(_0x72ae('0x4'));var moment=require(_0x72ae('0x5'));var BPromise=require(_0x72ae('0x6'));var Mustache=require('mustache');var util=require(_0x72ae('0x7'));var path=require('path');var sox=require(_0x72ae('0x8'));var csv=require(_0x72ae('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72ae('0xa'));var _=require(_0x72ae('0xb'));var squel=require(_0x72ae('0xc'));var crypto=require(_0x72ae('0xd'));var jsforce=require(_0x72ae('0xe'));var deskjs=require(_0x72ae('0xf'));var toCsv=require(_0x72ae('0x9'));var querystring=require(_0x72ae('0x10'));var Papa=require(_0x72ae('0x11'));var Redis=require(_0x72ae('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x72ae('0x13'));var as=require(_0x72ae('0x14'));var hardwareService=require(_0x72ae('0x15'));var logger=require(_0x72ae('0x16'))('api');var utils=require(_0x72ae('0x17'));var config=require(_0x72ae('0x18'));var licenseUtil=require(_0x72ae('0x19'));var db=require(_0x72ae('0x1a'))['db'];config[_0x72ae('0x1b')]=_[_0x72ae('0x1c')](config[_0x72ae('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x72ae('0x1d'))(new Redis(config[_0x72ae('0x1b')]));require(_0x72ae('0x1e'))[_0x72ae('0x1f')](socket);function respondWithStatusCode(_0xe71a41,_0xacac80){_0xacac80=_0xacac80||0xcc;return function(_0x1b610d){if(_0x1b610d){return _0xe71a41[_0x72ae('0x20')](_0xacac80);}return _0xe71a41[_0x72ae('0x21')](_0xacac80)['end']();};}function respondWithResult(_0x1af936,_0x59a251){_0x59a251=_0x59a251||0xc8;return function(_0x3a9a88){if(_0x3a9a88){return _0x1af936[_0x72ae('0x21')](_0x59a251)[_0x72ae('0x22')](_0x3a9a88);}};}function respondWithFilteredResult(_0x2403ae,_0x2fa175){return function(_0x38ee78){if(_0x38ee78){var _0x488b49=typeof _0x2fa175[_0x72ae('0x23')]===_0x72ae('0x24')&&typeof _0x2fa175[_0x72ae('0x25')]==='undefined';var _0xc8ffd5=_0x38ee78[_0x72ae('0x26')];var _0x4779d5=_0x488b49?0x0:_0x2fa175[_0x72ae('0x23')];var _0x28b2b1=_0x488b49?_0x38ee78[_0x72ae('0x26')]:_0x2fa175[_0x72ae('0x23')]+_0x2fa175['limit'];var _0x484d24;if(_0x28b2b1>=_0xc8ffd5){_0x28b2b1=_0xc8ffd5;_0x484d24=0xc8;}else{_0x484d24=0xce;}_0x2403ae['status'](_0x484d24);return _0x2403ae[_0x72ae('0x27')]('Content-Range',_0x4779d5+'-'+_0x28b2b1+'/'+_0xc8ffd5)[_0x72ae('0x22')](_0x38ee78);}return null;};}function patchUpdates(_0x26e733){return function(_0xea94a6){try{jsonpatch['apply'](_0xea94a6,_0x26e733,!![]);}catch(_0xdcd9d2){return BPromise['reject'](_0xdcd9d2);}return _0xea94a6[_0x72ae('0x28')]();};}function saveUpdates(_0x33cecf,_0x240a37){return function(_0xfa5e4b){if(_0xfa5e4b){return _0xfa5e4b[_0x72ae('0x29')](_0x33cecf)['then'](function(_0x4f3f58){return _0x4f3f58;});}return null;};}function removeEntity(_0x54ac9e,_0x1b3b48){return function(_0x2e1d23){if(_0x2e1d23){return _0x2e1d23[_0x72ae('0x2a')]()[_0x72ae('0x2b')](function(){var _0x55fc4e=_0x2e1d23[_0x72ae('0x2c')]({'plain':!![]});var _0x4a8e9='OpenchannelQueues';return db[_0x72ae('0x2d')]['destroy']({'where':{'type':_0x4a8e9,'resourceId':_0x55fc4e['id']}})['then'](function(){return _0x2e1d23;});})[_0x72ae('0x2b')](function(){_0x54ac9e['status'](0xcc)[_0x72ae('0x2e')]();});}};}function handleEntityNotFound(_0x3fc9ec,_0x2a13ba){return function(_0x3cdf61){if(!_0x3cdf61){_0x3fc9ec['sendStatus'](0x194);}return _0x3cdf61;};}function handleError(_0x5bf3a2,_0x2237ac){_0x2237ac=_0x2237ac||0x1f4;return function(_0x9dd790){logger[_0x72ae('0x2f')](_0x9dd790['stack']);if(_0x9dd790['name']){delete _0x9dd790['name'];}_0x5bf3a2[_0x72ae('0x21')](_0x2237ac)[_0x72ae('0x30')](_0x9dd790);};}exports[_0x72ae('0x31')]=function(_0x433003,_0x6338b5){var _0x5e9fb5={},_0x44d3ef={},_0x3c3ec9={'count':0x0,'rows':[]};var _0x5467bb=_[_0x72ae('0x32')](db[_0x72ae('0x33')][_0x72ae('0x34')],function(_0x1892af){return{'name':_0x1892af[_0x72ae('0x35')],'type':_0x1892af[_0x72ae('0x36')]['key']};});_0x44d3ef['model']=_[_0x72ae('0x32')](_0x5467bb,_0x72ae('0x37'));_0x44d3ef[_0x72ae('0x38')]=_[_0x72ae('0x39')](_0x433003[_0x72ae('0x38')]);_0x44d3ef[_0x72ae('0x3a')]=_['intersection'](_0x44d3ef[_0x72ae('0x3b')],_0x44d3ef['query']);_0x5e9fb5['attributes']=_[_0x72ae('0x3c')](_0x44d3ef[_0x72ae('0x3b')],qs[_0x72ae('0x3d')](_0x433003[_0x72ae('0x38')][_0x72ae('0x3d')]));_0x5e9fb5[_0x72ae('0x3e')]=_0x5e9fb5['attributes'][_0x72ae('0x3f')]?_0x5e9fb5[_0x72ae('0x3e')]:_0x44d3ef[_0x72ae('0x3b')];if(!_0x433003[_0x72ae('0x38')]['hasOwnProperty'](_0x72ae('0x40'))){_0x5e9fb5['limit']=qs[_0x72ae('0x25')](_0x433003['query'][_0x72ae('0x25')]);_0x5e9fb5[_0x72ae('0x23')]=qs[_0x72ae('0x23')](_0x433003[_0x72ae('0x38')][_0x72ae('0x23')]);}_0x5e9fb5[_0x72ae('0x41')]=qs[_0x72ae('0x42')](_0x433003[_0x72ae('0x38')][_0x72ae('0x42')]);_0x5e9fb5['where']=qs[_0x72ae('0x3a')](_[_0x72ae('0x43')](_0x433003[_0x72ae('0x38')],_0x44d3ef[_0x72ae('0x3a')]),_0x5467bb);if(_0x433003[_0x72ae('0x38')][_0x72ae('0x44')]){_0x5e9fb5[_0x72ae('0x45')]=_[_0x72ae('0x46')](_0x5e9fb5[_0x72ae('0x45')],{'$or':_[_0x72ae('0x32')](_0x5467bb,function(_0x3216dc){if(_0x3216dc[_0x72ae('0x36')]!=='VIRTUAL'){var _0x665bea={};_0x665bea[_0x3216dc[_0x72ae('0x37')]]={'$like':'%'+_0x433003[_0x72ae('0x38')]['filter']+'%'};return _0x665bea;}})});}_0x5e9fb5=_[_0x72ae('0x46')]({},_0x5e9fb5,_0x433003[_0x72ae('0x47')]);var _0x5c4732={'where':_0x5e9fb5[_0x72ae('0x45')]};return db['OpenchannelQueue']['count'](_0x5c4732)[_0x72ae('0x2b')](function(_0x446074){_0x3c3ec9[_0x72ae('0x26')]=_0x446074;if(_0x433003[_0x72ae('0x38')]['includeAll']){_0x5e9fb5[_0x72ae('0x48')]=[{'all':!![]}];}return db[_0x72ae('0x33')][_0x72ae('0x49')](_0x5e9fb5);})['then'](function(_0x239a1a){_0x3c3ec9['rows']=_0x239a1a;return _0x3c3ec9;})[_0x72ae('0x2b')](respondWithFilteredResult(_0x6338b5,_0x5e9fb5))['catch'](handleError(_0x6338b5,null));};exports[_0x72ae('0x4a')]=function(_0x108378,_0x5ebb9e){var _0x255538={'raw':!![],'where':{'id':_0x108378[_0x72ae('0x4b')]['id']}},_0x1df1ba={};_0x1df1ba[_0x72ae('0x3b')]=_['keys'](db[_0x72ae('0x33')][_0x72ae('0x34')]);_0x1df1ba['query']=_['keys'](_0x108378[_0x72ae('0x38')]);_0x1df1ba['filters']=_[_0x72ae('0x3c')](_0x1df1ba['model'],_0x1df1ba[_0x72ae('0x38')]);_0x255538[_0x72ae('0x3e')]=_[_0x72ae('0x3c')](_0x1df1ba['model'],qs[_0x72ae('0x3d')](_0x108378[_0x72ae('0x38')][_0x72ae('0x3d')]));_0x255538[_0x72ae('0x3e')]=_0x255538['attributes'][_0x72ae('0x3f')]?_0x255538[_0x72ae('0x3e')]:_0x1df1ba[_0x72ae('0x3b')];if(_0x108378[_0x72ae('0x38')][_0x72ae('0x4c')]){_0x255538[_0x72ae('0x48')]=[{'all':!![]}];}_0x255538=_['merge']({},_0x255538,_0x108378[_0x72ae('0x47')]);return db[_0x72ae('0x33')][_0x72ae('0x4d')](_0x255538)[_0x72ae('0x2b')](handleEntityNotFound(_0x5ebb9e,null))[_0x72ae('0x2b')](respondWithResult(_0x5ebb9e,null))[_0x72ae('0x4e')](handleError(_0x5ebb9e,null));};exports[_0x72ae('0x4f')]=function(_0x654a24,_0xe513d){return db[_0x72ae('0x33')][_0x72ae('0x4f')](_0x654a24[_0x72ae('0x50')],{})[_0x72ae('0x2b')](function(_0x597a21){var _0x2f8dcd=_0x654a24['user'][_0x72ae('0x2c')]({'plain':!![]});if(!_0x2f8dcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8dcd[_0x72ae('0x51')]===_0x72ae('0x52')){var _0x121ba7=_0x597a21['get']({'plain':!![]});var _0x53caf6='OpenchannelQueues';return db[_0x72ae('0x53')][_0x72ae('0x4d')]({'where':{'name':_0x53caf6,'userProfileId':_0x2f8dcd[_0x72ae('0x54')]},'raw':!![]})[_0x72ae('0x2b')](function(_0x5dae91){if(_0x5dae91&&_0x5dae91[_0x72ae('0x55')]===0x0){return db['UserProfileResource'][_0x72ae('0x4f')]({'name':_0x121ba7['name'],'resourceId':_0x121ba7['id'],'type':_0x5dae91[_0x72ae('0x37')],'sectionId':_0x5dae91['id']},{})[_0x72ae('0x2b')](function(){return _0x597a21;});}else{return _0x597a21;}})['catch'](function(_0x3dcd50){logger[_0x72ae('0x2f')](_0x72ae('0x56'),_0x3dcd50);throw _0x3dcd50;});}return _0x597a21;})[_0x72ae('0x2b')](respondWithResult(_0xe513d,0xc9))[_0x72ae('0x4e')](handleError(_0xe513d,null));};exports[_0x72ae('0x29')]=function(_0x4691ca,_0x1b9aa2){if(_0x4691ca[_0x72ae('0x50')]['id']){delete _0x4691ca[_0x72ae('0x50')]['id'];}return db[_0x72ae('0x33')][_0x72ae('0x4d')]({'where':{'id':_0x4691ca[_0x72ae('0x4b')]['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0x1b9aa2,null))[_0x72ae('0x2b')](saveUpdates(_0x4691ca[_0x72ae('0x50')],null))[_0x72ae('0x2b')](respondWithResult(_0x1b9aa2,null))[_0x72ae('0x4e')](handleError(_0x1b9aa2,null));};exports[_0x72ae('0x2a')]=function(_0x4ce982,_0x5d01e6){return db[_0x72ae('0x33')][_0x72ae('0x4d')]({'where':{'id':_0x4ce982[_0x72ae('0x4b')]['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0x5d01e6,null))[_0x72ae('0x2b')](removeEntity(_0x5d01e6,null))[_0x72ae('0x4e')](handleError(_0x5d01e6,null));};exports[_0x72ae('0x57')]=function(_0x12b461,_0x14ef29){return db[_0x72ae('0x33')][_0x72ae('0x57')]()[_0x72ae('0x2b')](respondWithResult(_0x14ef29,null))[_0x72ae('0x4e')](handleError(_0x14ef29,null));};exports['getMembers']=function(_0x45ee8d,_0x53c56e,_0x368b2f){var _0x5950cc={'raw':!![],'where':{}},_0x5c9f53={},_0x16dba9;return db[_0x72ae('0x33')][_0x72ae('0x58')]({'where':{'id':_0x45ee8d[_0x72ae('0x4b')]['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0x53c56e,null))['then'](function(_0x2ecbfa){if(_0x2ecbfa){_0x16dba9=_0x2ecbfa[_0x72ae('0x2c')]({'plain':!![]});_0x5c9f53[_0x72ae('0x3b')]=_[_0x72ae('0x39')](db[_0x72ae('0x59')]['rawAttributes']);_0x5c9f53['query']=_[_0x72ae('0x39')](_0x45ee8d[_0x72ae('0x38')]);_0x5c9f53[_0x72ae('0x3a')]=_[_0x72ae('0x3c')](_0x5c9f53['model'],_0x5c9f53[_0x72ae('0x38')]);_0x5950cc[_0x72ae('0x3e')]=_[_0x72ae('0x3c')](_0x5c9f53['model'],qs[_0x72ae('0x3d')](_0x45ee8d['query'][_0x72ae('0x3d')]));_0x5950cc['attributes']=_0x5950cc[_0x72ae('0x3e')]['length']?_0x5950cc['attributes']:_0x5c9f53[_0x72ae('0x3b')];if(!_0x45ee8d[_0x72ae('0x38')][_0x72ae('0x5a')](_0x72ae('0x40'))){_0x5950cc[_0x72ae('0x25')]=qs[_0x72ae('0x25')](_0x45ee8d[_0x72ae('0x38')]['limit']);_0x5950cc[_0x72ae('0x23')]=qs['offset'](_0x45ee8d['query']['offset']);}_0x5950cc[_0x72ae('0x41')]=qs[_0x72ae('0x42')](_0x45ee8d[_0x72ae('0x38')][_0x72ae('0x42')]);_0x5950cc['where']=qs[_0x72ae('0x3a')](_['pick'](_0x45ee8d[_0x72ae('0x38')],_0x5c9f53[_0x72ae('0x3a')]));_0x5950cc[_0x72ae('0x45')][_0x72ae('0x5b')]=_0x2ecbfa['id'];if(_0x45ee8d[_0x72ae('0x38')][_0x72ae('0x44')]){_0x5950cc[_0x72ae('0x45')]=_[_0x72ae('0x46')](_0x5950cc[_0x72ae('0x45')],{'$or':_[_0x72ae('0x32')](_0x5950cc[_0x72ae('0x3e')],function(_0x1400bc){var _0x446bcd={};_0x446bcd[_0x1400bc]={'$like':'%'+_0x45ee8d['query']['filter']+'%'};return _0x446bcd;})});}_0x5950cc=_[_0x72ae('0x46')]({},_0x5950cc,_0x45ee8d['options']);return db['UserOpenchannelQueue'][_0x72ae('0x49')](_0x5950cc);}})[_0x72ae('0x2b')](function(_0x3539c2){if(_0x3539c2){return db[_0x72ae('0x5c')][_0x72ae('0x5d')]({'where':{'id':_[_0x72ae('0x32')](_0x3539c2,_0x72ae('0x5e')),'role':'agent'},'attributes':['id',_0x72ae('0x37'),_0x72ae('0x5f'),_0x72ae('0x60'),_0x72ae('0x61')]});}})[_0x72ae('0x2b')](function(_0x4d8287){if(_0x4d8287){return{'count':_0x4d8287['count'],'rows':_[_0x72ae('0x32')](_0x4d8287[_0x72ae('0x62')],function(_0x1bc12a){return{'membername':_0x1bc12a[_0x72ae('0x37')],'UserId':_0x1bc12a['id'],'queue_name':_0x16dba9[_0x72ae('0x37')],'OpenchannelQueueId':_0x16dba9['id'],'interface':util['format'](_0x72ae('0x63'),_0x72ae('0x64'),_0x1bc12a[_0x72ae('0x37')]),'penalty':0x0,'paused':_0x1bc12a[_0x72ae('0x5f')],'createdAt':_0x1bc12a['createdAt'],'updatedAt':_0x1bc12a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x72ae('0x2b')](respondWithFilteredResult(_0x53c56e,_0x5950cc))[_0x72ae('0x4e')](handleError(_0x53c56e,null));};exports['getTeams']=function(_0xd78db9,_0x372fed,_0x704818){var _0x1a2b33={};var _0x593be7={};var _0x6be465;var _0x58c77c;return db[_0x72ae('0x33')][_0x72ae('0x58')]({'where':{'id':_0xd78db9['params']['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0x372fed,null))[_0x72ae('0x2b')](function(_0x386a25){if(_0x386a25){_0x6be465=_0x386a25;_0x593be7['model']=_['keys'](db['Team'][_0x72ae('0x34')]);_0x593be7[_0x72ae('0x38')]=_[_0x72ae('0x39')](_0xd78db9[_0x72ae('0x38')]);_0x593be7[_0x72ae('0x3a')]=_[_0x72ae('0x3c')](_0x593be7[_0x72ae('0x3b')],_0x593be7['query']);_0x1a2b33['attributes']=_['intersection'](_0x593be7[_0x72ae('0x3b')],qs[_0x72ae('0x3d')](_0xd78db9[_0x72ae('0x38')][_0x72ae('0x3d')]));_0x1a2b33[_0x72ae('0x3e')]=_0x1a2b33[_0x72ae('0x3e')][_0x72ae('0x3f')]?_0x1a2b33[_0x72ae('0x3e')]:_0x593be7['model'];_0x1a2b33[_0x72ae('0x41')]=qs[_0x72ae('0x42')](_0xd78db9['query']['sort']);_0x1a2b33[_0x72ae('0x45')]=qs[_0x72ae('0x3a')](_[_0x72ae('0x43')](_0xd78db9['query'],_0x593be7['filters']));if(_0xd78db9[_0x72ae('0x38')][_0x72ae('0x44')]){_0x1a2b33[_0x72ae('0x45')]=_['merge'](_0x1a2b33[_0x72ae('0x45')],{'$or':_[_0x72ae('0x32')](_0x1a2b33[_0x72ae('0x3e')],function(_0x5e616d){var _0x495205={};_0x495205[_0x5e616d]={'$like':'%'+_0xd78db9['query'][_0x72ae('0x44')]+'%'};return _0x495205;})});}_0x1a2b33=_[_0x72ae('0x46')]({},_0x1a2b33,_0xd78db9[_0x72ae('0x47')]);return _0x6be465[_0x72ae('0x65')](_0x1a2b33);}})[_0x72ae('0x2b')](function(_0x1f8573){if(_0x1f8573){_0x58c77c=_0x1f8573[_0x72ae('0x3f')];if(!_0xd78db9[_0x72ae('0x38')][_0x72ae('0x5a')](_0x72ae('0x40'))){_0x1a2b33[_0x72ae('0x25')]=qs[_0x72ae('0x25')](_0xd78db9[_0x72ae('0x38')][_0x72ae('0x25')]);_0x1a2b33[_0x72ae('0x23')]=qs[_0x72ae('0x23')](_0xd78db9[_0x72ae('0x38')][_0x72ae('0x23')]);}return _0x6be465[_0x72ae('0x65')](_0x1a2b33);}})[_0x72ae('0x2b')](function(_0x48b564){if(_0x48b564){return _0x48b564?{'count':_0x58c77c,'rows':_0x48b564}:null;}})[_0x72ae('0x2b')](respondWithResult(_0x372fed,null))[_0x72ae('0x4e')](handleError(_0x372fed,null));};exports[_0x72ae('0x66')]=function(_0x55f20d,_0x1dade8,_0x4e45e2){var _0x4b18f6=_0x55f20d[_0x72ae('0x50')][_0x72ae('0x67')];return db['Team']['findAll']({'where':{'id':_0x4b18f6},'attributes':['id'],'include':[{'model':db[_0x72ae('0x5c')],'as':_0x72ae('0x68'),'attributes':['id',_0x72ae('0x37'),_0x72ae('0x69'),_0x72ae('0x6a'),_0x72ae('0x6b')],'raw':!![]}]})[_0x72ae('0x2b')](function(_0x17a48f){if(_0x17a48f){var _0x34357e=_[_0x72ae('0x6c')](_0x17a48f,function(_0x4e7f91){var _0x166cdd=_0x4e7f91['get']({'plain':!![]});return _0x166cdd[_0x72ae('0x68')];});return db['OpenchannelQueue'][_0x72ae('0x4d')]({'where':{'id':_0x55f20d[_0x72ae('0x4b')]['id']}})[_0x72ae('0x2b')](function(_0xe14a19){return db[_0x72ae('0x6d')]['transaction'](function(_0x21f763){return _0xe14a19[_0x72ae('0x66')](_0x4b18f6,{'transaction':_0x21f763})[_0x72ae('0x2b')](function(){return BPromise[_0x72ae('0x6e')](_0x34357e,function(_0x4bc507){return db[_0x72ae('0x59')][_0x72ae('0x6f')]({'where':{'UserId':_0x4bc507['id'],'OpenchannelQueueId':_0x55f20d[_0x72ae('0x4b')]['id']},'transaction':_0x21f763});});})[_0x72ae('0x2b')](function(){_0x34357e['forEach'](function(_0x126376){socket[_0x72ae('0x70')](_0x72ae('0x71'),{'UserId':_0x126376['id'],'OpenchannelQueueId':_0xe14a19['id']});});});});});}})['then'](respondWithStatusCode(_0x1dade8,null))[_0x72ae('0x4e')](handleError(_0x1dade8,null));};exports[_0x72ae('0x72')]=function(_0x4cdf0e,_0x72abc5,_0xc88b07){return db[_0x72ae('0x73')][_0x72ae('0x49')]({'where':{'id':_0x4cdf0e['query'][_0x72ae('0x67')]},'attributes':['id'],'include':[{'model':db[_0x72ae('0x5c')],'as':_0x72ae('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x72abc5,null))['then'](function(_0x393005){var _0x52473f=_[_0x72ae('0x32')](_0x393005,'id');var _0x1b5bb1=[];var _0x491cf3=[];var _0x5c6638=squel[_0x72ae('0x74')]();_0x5c6638['field']('tq.TeamId')['from'](_0x72ae('0x75'),'tq')['join'](_0x72ae('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x72ae('0x45')]('OpenchannelQueueId\x20=\x20?',_0x4cdf0e[_0x72ae('0x4b')]['id']);for(var _0xbe76ef=0x0;_0xbe76ef<_0x393005[_0x72ae('0x3f')];_0xbe76ef+=0x1){let _0x3df83d=_0x393005[_0xbe76ef];for(var _0x53e578=0x0;_0x53e578<_0x3df83d[_0x72ae('0x68')][_0x72ae('0x3f')];_0x53e578+=0x1){let _0x3151e3=_0x3df83d['Agents'][_0x53e578];var _0x388c25=_0x5c6638[_0x72ae('0x77')]();_0x388c25[_0x72ae('0x45')](_0x72ae('0x78'),_0x3151e3['id']);_0x491cf3[_0x72ae('0x79')](db[_0x72ae('0x6d')][_0x72ae('0x38')](_0x388c25[_0x72ae('0x7a')](),{'type':db[_0x72ae('0x6d')][_0x72ae('0x7b')][_0x72ae('0x7c')]})[_0x72ae('0x2b')](function(_0x19b84e){if(_0x19b84e[_0x72ae('0x3f')]===0x1){return _0x3151e3['id'];}else{var _0xedabf3=_['every'](_[_0x72ae('0x32')](_0x19b84e,_0x72ae('0x7d')),function(_0x4b6e56){return _[_0x72ae('0x7e')](_0x52473f,_0x4b6e56);});if(_0xedabf3){return _0x3151e3['id'];}}}));}}return BPromise[_0x72ae('0x7f')](_0x491cf3)[_0x72ae('0x2b')](function(_0x31b143){_0x1b5bb1=_(_0x1b5bb1)[_0x72ae('0x80')](_0x31b143)[_0x72ae('0x81')]()['value']();return db[_0x72ae('0x33')]['find']({'where':{'id':_0x4cdf0e[_0x72ae('0x4b')]['id']}})['then'](function(_0x36c635){return db['sequelize'][_0x72ae('0x82')](function(_0x542aa4){return _0x36c635['removeTeams'](_0x4cdf0e[_0x72ae('0x38')][_0x72ae('0x67')],{'transaction':_0x542aa4})[_0x72ae('0x2b')](function(){if(!_[_0x72ae('0x83')](_0x1b5bb1)){return _0x36c635['removeAgents'](_0x1b5bb1,{'transaction':_0x542aa4});}})['then'](function(){_0x1b5bb1['forEach'](function(_0xf3ea4e){socket[_0x72ae('0x70')](_0x72ae('0x84'),{'UserId':_0xf3ea4e,'OpenchannelQueueId':_0x36c635['id']});});});});});});})[_0x72ae('0x2b')](respondWithStatusCode(_0x72abc5,null))[_0x72ae('0x4e')](handleError(_0x72abc5,null));};exports['addAgents']=function(_0x1d021e,_0xab7450,_0x3120b0){return db[_0x72ae('0x33')][_0x72ae('0x4d')]({'where':{'id':_0x1d021e[_0x72ae('0x4b')]['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0xab7450,null))[_0x72ae('0x2b')](function(_0x11e3dd){if(_0x11e3dd){return _0x11e3dd[_0x72ae('0x85')](_0x1d021e['body'][_0x72ae('0x67')],_[_0x72ae('0x86')](_0x1d021e[_0x72ae('0x50')],['ids','id'])||{})[_0x72ae('0x87')](function(_0x3fd76b){for(var _0x5ea232=0x0;_0x5ea232<_0x1d021e[_0x72ae('0x50')][_0x72ae('0x67')][_0x72ae('0x3f')];_0x5ea232+=0x1){socket[_0x72ae('0x70')](_0x72ae('0x71'),{'UserId':Number(_0x1d021e[_0x72ae('0x50')]['ids'][_0x5ea232]),'OpenchannelQueueId':Number(_0x1d021e[_0x72ae('0x4b')]['id'])});}return _0x3fd76b;});}})[_0x72ae('0x2b')](respondWithResult(_0xab7450,null))[_0x72ae('0x4e')](handleError(_0xab7450,null));};exports[_0x72ae('0x88')]=function(_0x5b567f,_0xec8179,_0x51ab11){return db['OpenchannelQueue'][_0x72ae('0x4d')]({'where':{'id':_0x5b567f['params']['id']}})[_0x72ae('0x2b')](handleEntityNotFound(_0xec8179,null))[_0x72ae('0x2b')](function(_0x3f52b3){if(_0x3f52b3){return _0x3f52b3[_0x72ae('0x88')](_0x5b567f['query'][_0x72ae('0x67')])['then'](function(){if(_['isArray'](_0x5b567f[_0x72ae('0x38')][_0x72ae('0x67')])){for(var _0x322abc=0x0;_0x322abc<_0x5b567f[_0x72ae('0x38')][_0x72ae('0x67')][_0x72ae('0x3f')];_0x322abc+=0x1){socket[_0x72ae('0x70')](_0x72ae('0x84'),{'UserId':Number(_0x5b567f[_0x72ae('0x38')][_0x72ae('0x67')][_0x322abc]),'OpenchannelQueueId':Number(_0x5b567f[_0x72ae('0x4b')]['id'])});}}else{socket[_0x72ae('0x70')](_0x72ae('0x84'),{'UserId':Number(_0x5b567f[_0x72ae('0x38')][_0x72ae('0x67')]),'OpenchannelQueueId':Number(_0x5b567f[_0x72ae('0x4b')]['id'])});}});}})[_0x72ae('0x2b')](respondWithStatusCode(_0xec8179,null))[_0x72ae('0x4e')](handleError(_0xec8179,null));};exports['getAgents']=function(_0x42df4e,_0x1fe6ce,_0x344e66){var _0x4cc217={};var _0x3ef44d={};var _0x4a7115;var _0x3aac2e;return db[_0x72ae('0x33')]['findOne']({'where':{'id':_0x42df4e[_0x72ae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1fe6ce,null))['then'](function(_0x583cb6){if(_0x583cb6){_0x4a7115=_0x583cb6;_0x3ef44d[_0x72ae('0x3b')]=_['keys'](db[_0x72ae('0x5c')][_0x72ae('0x34')]);_0x3ef44d[_0x72ae('0x38')]=_['keys'](_0x42df4e[_0x72ae('0x38')]);_0x3ef44d[_0x72ae('0x3a')]=_[_0x72ae('0x3c')](_0x3ef44d[_0x72ae('0x3b')],_0x3ef44d['query']);_0x4cc217['attributes']=_['intersection'](_0x3ef44d['model'],qs[_0x72ae('0x3d')](_0x42df4e[_0x72ae('0x38')][_0x72ae('0x3d')]));_0x4cc217['attributes']=_0x4cc217['attributes'][_0x72ae('0x3f')]?_0x4cc217[_0x72ae('0x3e')]:_0x3ef44d[_0x72ae('0x3b')];_0x4cc217[_0x72ae('0x41')]=qs[_0x72ae('0x42')](_0x42df4e[_0x72ae('0x38')][_0x72ae('0x42')]);_0x4cc217[_0x72ae('0x45')]=qs[_0x72ae('0x3a')](_[_0x72ae('0x43')](_0x42df4e['query'],_0x3ef44d[_0x72ae('0x3a')]));if(_0x42df4e['query'][_0x72ae('0x44')]){_0x4cc217[_0x72ae('0x45')]=_[_0x72ae('0x46')](_0x4cc217[_0x72ae('0x45')],{'$or':_[_0x72ae('0x32')](_0x4cc217[_0x72ae('0x3e')],function(_0x244d98){var _0x367cf1={};_0x367cf1[_0x244d98]={'$like':'%'+_0x42df4e[_0x72ae('0x38')][_0x72ae('0x44')]+'%'};return _0x367cf1;})});}_0x4cc217=_['merge']({},_0x4cc217,_0x42df4e['options']);return _0x4a7115[_0x72ae('0x89')](_0x4cc217);}})[_0x72ae('0x2b')](function(_0x172d2d){if(_0x172d2d){_0x3aac2e=_0x172d2d[_0x72ae('0x3f')];if(!_0x42df4e[_0x72ae('0x38')][_0x72ae('0x5a')]('nolimit')){_0x4cc217[_0x72ae('0x25')]=qs['limit'](_0x42df4e[_0x72ae('0x38')][_0x72ae('0x25')]);_0x4cc217[_0x72ae('0x23')]=qs[_0x72ae('0x23')](_0x42df4e[_0x72ae('0x38')][_0x72ae('0x23')]);}return _0x4a7115[_0x72ae('0x89')](_0x4cc217);}})[_0x72ae('0x2b')](function(_0x5355ac){if(_0x5355ac){return _0x5355ac?{'count':_0x3aac2e,'rows':_0x5355ac}:null;}})[_0x72ae('0x2b')](respondWithResult(_0x1fe6ce,null))[_0x72ae('0x4e')](handleError(_0x1fe6ce,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8cb3938..bd57bc4 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 _0xfb44=['remove','emit','hasOwnProperty','hook','exports','OpenchannelQueue','update'];(function(_0x27b246,_0x41885a){var _0x4ae881=function(_0x15b228){while(--_0x15b228){_0x27b246['push'](_0x27b246['shift']());}};_0x4ae881(++_0x41885a);}(_0xfb44,0x101));var _0x4fb4=function(_0x2e1d3a,_0xe29a0b){_0x2e1d3a=_0x2e1d3a-0x0;var _0xcefa9a=_0xfb44[_0x2e1d3a];return _0xcefa9a;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x4fb4('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4fb4('0x1'),'afterDestroy':_0x4fb4('0x2')};function emitEvent(_0x4290e2){return function(_0x479f9d,_0x1d3142,_0x1e6266){OpenchannelQueueEvents[_0x4fb4('0x3')](_0x4290e2+':'+_0x479f9d['id'],_0x479f9d);OpenchannelQueueEvents[_0x4fb4('0x3')](_0x4290e2,_0x479f9d);_0x1e6266(null);};}for(var e in events){if(events[_0x4fb4('0x4')](e)){var event=events[e];OpenchannelQueue[_0x4fb4('0x5')](e,emitEvent(event));}}module[_0x4fb4('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc695=['emit','hook','exports','events','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc695,0x163));var _0x5c69=function(_0x4207a6,_0x3a3110){_0x4207a6=_0x4207a6-0x0;var _0x42b37a=_0xc695[_0x4207a6];return _0x42b37a;};'use strict';var EventEmitter=require(_0x5c69('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x5c69('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5c69('0x2')](0x0);var events={'afterCreate':_0x5c69('0x3'),'afterUpdate':_0x5c69('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a1d3f){return function(_0x3daea9,_0x12f3bd,_0x5040cc){OpenchannelQueueEvents[_0x5c69('0x5')](_0x3a1d3f+':'+_0x3daea9['id'],_0x3daea9);OpenchannelQueueEvents['emit'](_0x3a1d3f,_0x3daea9);_0x5040cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x5c69('0x6')](e,emitEvent(event));}}module[_0x5c69('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index cc0c88a..ed966e1 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 _0x17ee=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','moment'];(function(_0x447e7f,_0x2fc8e9){var _0x1c9e69=function(_0x59820e){while(--_0x59820e){_0x447e7f['push'](_0x447e7f['shift']());}};_0x1c9e69(++_0x2fc8e9);}(_0x17ee,0x1b6));var _0xe17e=function(_0x457e25,_0x15dd63){_0x457e25=_0x457e25-0x0;var _0x2ba3b7=_0x17ee[_0x457e25];return _0x2ba3b7;};'use strict';var _=require(_0xe17e('0x0'));var util=require(_0xe17e('0x1'));var logger=require(_0xe17e('0x2'))('api');var moment=require(_0xe17e('0x3'));var BPromise=require(_0xe17e('0x4'));var rp=require(_0xe17e('0x5'));var fs=require('fs');var path=require(_0xe17e('0x6'));var rimraf=require(_0xe17e('0x7'));var config=require(_0xe17e('0x8'));var attributes=require(_0xe17e('0x9'));module[_0xe17e('0xa')]=function(_0x43779d,_0x46b44d){return _0x43779d[_0xe17e('0xb')]('OpenchannelQueue',attributes,{'tableName':_0xe17e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcff=['./openchannelQueue.attributes','define','lodash','util','moment','bluebird','../../config/environment'];(function(_0x5c49f4,_0x2fa313){var _0x293c9d=function(_0x475b4e){while(--_0x475b4e){_0x5c49f4['push'](_0x5c49f4['shift']());}};_0x293c9d(++_0x2fa313);}(_0xdcff,0x175));var _0xfdcf=function(_0x4e3739,_0x11251d){_0x4e3739=_0x4e3739-0x0;var _0x39ebc4=_0xdcff[_0x4e3739];return _0x39ebc4;};'use strict';var _=require(_0xfdcf('0x0'));var util=require(_0xfdcf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfdcf('0x2'));var BPromise=require(_0xfdcf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfdcf('0x4'));var attributes=require(_0xfdcf('0x5'));module['exports']=function(_0x187755,_0x467ed7){return _0x187755[_0xfdcf('0x6')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index d8bdff7..57f0216 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 _0xaf96=['http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xaf96,0x15d));var _0x6af9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6af9('0x0'));var util=require(_0x6af9('0x1'));var moment=require(_0x6af9('0x2'));var BPromise=require(_0x6af9('0x3'));var rs=require(_0x6af9('0x4'));var fs=require('fs');var Redis=require(_0x6af9('0x5'));var db=require(_0x6af9('0x6'))['db'];var utils=require(_0x6af9('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6af9('0x8'));var jayson=require(_0x6af9('0x9'));var client=jayson[_0x6af9('0xa')][_0x6af9('0xb')]({'port':0x232a});config['redis']=_[_0x6af9('0xc')](config[_0x6af9('0xd')],{'host':_0x6af9('0xe'),'port':0x18eb});var socket=require(_0x6af9('0xf'))(new Redis(config[_0x6af9('0xd')]));require(_0x6af9('0x10'))['register'](socket);function respondWithRpcPromise(_0x345f8e,_0x563344,_0x553666){return new BPromise(function(_0x1e7a98,_0x2d064d){return client[_0x6af9('0x11')](_0x345f8e,_0x553666)[_0x6af9('0x12')](function(_0x3af056){logger[_0x6af9('0x13')](_0x6af9('0x14'),_0x563344,_0x6af9('0x15'));logger[_0x6af9('0x16')](_0x6af9('0x17'),_0x563344,_0x6af9('0x15'),JSON[_0x6af9('0x18')](_0x3af056));if(_0x3af056[_0x6af9('0x19')]){if(_0x3af056[_0x6af9('0x19')]['code']===0x1f4){logger[_0x6af9('0x19')](_0x6af9('0x14'),_0x563344,_0x3af056['error'][_0x6af9('0x1a')]);return _0x2d064d(_0x3af056[_0x6af9('0x19')][_0x6af9('0x1a')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x563344,_0x3af056[_0x6af9('0x19')][_0x6af9('0x1a')]);return _0x1e7a98(_0x3af056[_0x6af9('0x19')][_0x6af9('0x1a')]);}else{logger[_0x6af9('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x563344,_0x6af9('0x15'));_0x1e7a98(_0x3af056['result']['message']);}})[_0x6af9('0x1b')](function(_0x2980ea){logger['error'](_0x6af9('0x14'),_0x563344,_0x2980ea);_0x2d064d(_0x2980ea);});});}exports['GetOpenchannelQueue']=function(_0xfbff49){var _0x165786=this;return new Promise(function(_0x1f3811,_0x105fa4){return db[_0x6af9('0x1c')][_0x6af9('0x1d')]({'raw':_0xfbff49['options']?_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x1f')]===undefined?!![]:![]:!![],'where':_0xfbff49['options']?_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x20')]||null:null,'attributes':_0xfbff49[_0x6af9('0x1e')]?_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x21')]||null:null,'limit':_0xfbff49[_0x6af9('0x1e')]?_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x22')]||null:null,'include':_0xfbff49[_0x6af9('0x1e')]?_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x23')]?_[_0x6af9('0x24')](_0xfbff49[_0x6af9('0x1e')][_0x6af9('0x23')],function(_0x27a8f1){return{'model':db[_0x27a8f1[_0x6af9('0x25')]],'as':_0x27a8f1['as'],'attributes':_0x27a8f1[_0x6af9('0x21')],'include':_0x27a8f1[_0x6af9('0x23')]?_[_0x6af9('0x24')](_0x27a8f1[_0x6af9('0x23')],function(_0x59979d){return{'model':db[_0x59979d[_0x6af9('0x25')]],'as':_0x59979d['as'],'attributes':_0x59979d[_0x6af9('0x21')],'include':_0x59979d[_0x6af9('0x23')]?_[_0x6af9('0x24')](_0x59979d['include'],function(_0x3436c2){return{'model':db[_0x3436c2['model']],'as':_0x3436c2['as'],'attributes':_0x3436c2[_0x6af9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6af9('0x12')](function(_0x554f22){logger[_0x6af9('0x13')](_0x6af9('0x26'),_0xfbff49);logger[_0x6af9('0x16')](_0x6af9('0x26'),_0xfbff49,JSON[_0x6af9('0x18')](_0x554f22));_0x1f3811(_0x554f22);})[_0x6af9('0x1b')](function(_0x43067f){logger[_0x6af9('0x19')]('GetOpenchannelQueue',_0x43067f[_0x6af9('0x1a')],_0xfbff49);_0x105fa4(_0x165786[_0x6af9('0x19')](0x1f4,_0x43067f[_0x6af9('0x1a')]));});});};exports[_0x6af9('0x27')]=function(_0x182fe5){var _0x54dcbd=this;return new Promise(function(_0x2ef598,_0x5009ac){return db[_0x6af9('0x1c')]['find']({'raw':_0x182fe5['options']?_0x182fe5[_0x6af9('0x1e')][_0x6af9('0x1f')]===undefined?!![]:![]:!![],'where':_0x182fe5[_0x6af9('0x1e')]?_0x182fe5[_0x6af9('0x1e')]['where']||null:null,'attributes':_0x182fe5['options']?_0x182fe5[_0x6af9('0x1e')][_0x6af9('0x21')]||null:null,'include':_0x182fe5[_0x6af9('0x1e')]?_0x182fe5['options'][_0x6af9('0x23')]?_['map'](_0x182fe5['options'][_0x6af9('0x23')],function(_0x20fe75){return{'model':db[_0x20fe75[_0x6af9('0x25')]],'as':_0x20fe75['as'],'attributes':_0x20fe75[_0x6af9('0x21')],'include':_0x20fe75['include']?_[_0x6af9('0x24')](_0x20fe75[_0x6af9('0x23')],function(_0x47bfb4){return{'model':db[_0x47bfb4[_0x6af9('0x25')]],'as':_0x47bfb4['as'],'attributes':_0x47bfb4[_0x6af9('0x21')],'include':_0x47bfb4['include']?_['map'](_0x47bfb4[_0x6af9('0x23')],function(_0x4e2726){return{'model':db[_0x4e2726[_0x6af9('0x25')]],'as':_0x4e2726['as'],'attributes':_0x4e2726[_0x6af9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6af9('0x12')](function(_0x106d29){logger[_0x6af9('0x13')](_0x6af9('0x27'),_0x182fe5);logger['debug']('ShowOpenchannelQueue',_0x182fe5,JSON[_0x6af9('0x18')](_0x106d29));_0x2ef598(_0x106d29);})[_0x6af9('0x1b')](function(_0x3e2d40){logger['error']('ShowOpenchannelQueue',_0x3e2d40[_0x6af9('0x1a')],_0x182fe5);_0x5009ac(_0x54dcbd[_0x6af9('0x19')](0x1f4,_0x3e2d40[_0x6af9('0x1a')]));});});}; \ No newline at end of file +var _0x828f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','ioredis'];(function(_0x37b31d,_0x44e47b){var _0x52773c=function(_0x35d0b2){while(--_0x35d0b2){_0x37b31d['push'](_0x37b31d['shift']());}};_0x52773c(++_0x44e47b);}(_0x828f,0x14b));var _0xf828=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x828f[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xf828('0x0'));var util=require(_0xf828('0x1'));var moment=require(_0xf828('0x2'));var BPromise=require('bluebird');var rs=require(_0xf828('0x3'));var fs=require('fs');var Redis=require(_0xf828('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf828('0x5'));var logger=require(_0xf828('0x6'))(_0xf828('0x7'));var config=require(_0xf828('0x8'));var jayson=require(_0xf828('0x9'));var client=jayson[_0xf828('0xa')][_0xf828('0xb')]({'port':0x232a});config[_0xf828('0xc')]=_[_0xf828('0xd')](config[_0xf828('0xc')],{'host':_0xf828('0xe'),'port':0x18eb});var socket=require(_0xf828('0xf'))(new Redis(config['redis']));require(_0xf828('0x10'))[_0xf828('0x11')](socket);function respondWithRpcPromise(_0x2d1b56,_0x21c7a9,_0x4ebd4c){return new BPromise(function(_0x419884,_0x5f3357){return client[_0xf828('0x12')](_0x2d1b56,_0x4ebd4c)[_0xf828('0x13')](function(_0x1438bb){logger[_0xf828('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x21c7a9,_0xf828('0x15'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x21c7a9,_0xf828('0x15'),JSON[_0xf828('0x16')](_0x1438bb));if(_0x1438bb[_0xf828('0x17')]){if(_0x1438bb[_0xf828('0x17')][_0xf828('0x18')]===0x1f4){logger[_0xf828('0x17')](_0xf828('0x19'),_0x21c7a9,_0x1438bb['error']['message']);return _0x5f3357(_0x1438bb[_0xf828('0x17')]['message']);}logger[_0xf828('0x17')](_0xf828('0x19'),_0x21c7a9,_0x1438bb['error'][_0xf828('0x1a')]);return _0x419884(_0x1438bb['error']['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x21c7a9,_0xf828('0x15'));_0x419884(_0x1438bb[_0xf828('0x1b')]['message']);}})[_0xf828('0x1c')](function(_0x2ca2a3){logger['error'](_0xf828('0x19'),_0x21c7a9,_0x2ca2a3);_0x5f3357(_0x2ca2a3);});});}exports['GetOpenchannelQueue']=function(_0x32ef90){var _0x1952b9=this;return new Promise(function(_0x767a06,_0x5d30e5){return db[_0xf828('0x1d')]['findAll']({'raw':_0x32ef90['options']?_0x32ef90[_0xf828('0x1e')][_0xf828('0x1f')]===undefined?!![]:![]:!![],'where':_0x32ef90[_0xf828('0x1e')]?_0x32ef90[_0xf828('0x1e')][_0xf828('0x20')]||null:null,'attributes':_0x32ef90[_0xf828('0x1e')]?_0x32ef90[_0xf828('0x1e')][_0xf828('0x21')]||null:null,'limit':_0x32ef90[_0xf828('0x1e')]?_0x32ef90[_0xf828('0x1e')][_0xf828('0x22')]||null:null,'include':_0x32ef90['options']?_0x32ef90[_0xf828('0x1e')][_0xf828('0x23')]?_[_0xf828('0x24')](_0x32ef90[_0xf828('0x1e')][_0xf828('0x23')],function(_0x1b1cd9){return{'model':db[_0x1b1cd9[_0xf828('0x25')]],'as':_0x1b1cd9['as'],'attributes':_0x1b1cd9[_0xf828('0x21')],'include':_0x1b1cd9[_0xf828('0x23')]?_[_0xf828('0x24')](_0x1b1cd9['include'],function(_0x1c849c){return{'model':db[_0x1c849c[_0xf828('0x25')]],'as':_0x1c849c['as'],'attributes':_0x1c849c[_0xf828('0x21')],'include':_0x1c849c[_0xf828('0x23')]?_['map'](_0x1c849c[_0xf828('0x23')],function(_0x33177c){return{'model':db[_0x33177c[_0xf828('0x25')]],'as':_0x33177c['as'],'attributes':_0x33177c[_0xf828('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e7e00){logger[_0xf828('0x14')](_0xf828('0x26'),_0x32ef90);logger[_0xf828('0x27')](_0xf828('0x26'),_0x32ef90,JSON[_0xf828('0x16')](_0x2e7e00));_0x767a06(_0x2e7e00);})[_0xf828('0x1c')](function(_0x2b443a){logger[_0xf828('0x17')]('GetOpenchannelQueue',_0x2b443a['message'],_0x32ef90);_0x5d30e5(_0x1952b9[_0xf828('0x17')](0x1f4,_0x2b443a[_0xf828('0x1a')]));});});};exports[_0xf828('0x28')]=function(_0x149d06){var _0x47d589=this;return new Promise(function(_0x520129,_0x31cc08){return db[_0xf828('0x1d')][_0xf828('0x29')]({'raw':_0x149d06[_0xf828('0x1e')]?_0x149d06[_0xf828('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x149d06[_0xf828('0x1e')]?_0x149d06[_0xf828('0x1e')][_0xf828('0x20')]||null:null,'attributes':_0x149d06[_0xf828('0x1e')]?_0x149d06['options'][_0xf828('0x21')]||null:null,'include':_0x149d06[_0xf828('0x1e')]?_0x149d06[_0xf828('0x1e')][_0xf828('0x23')]?_[_0xf828('0x24')](_0x149d06[_0xf828('0x1e')][_0xf828('0x23')],function(_0x59c47d){return{'model':db[_0x59c47d[_0xf828('0x25')]],'as':_0x59c47d['as'],'attributes':_0x59c47d['attributes'],'include':_0x59c47d[_0xf828('0x23')]?_[_0xf828('0x24')](_0x59c47d[_0xf828('0x23')],function(_0x36fa2e){return{'model':db[_0x36fa2e[_0xf828('0x25')]],'as':_0x36fa2e['as'],'attributes':_0x36fa2e[_0xf828('0x21')],'include':_0x36fa2e[_0xf828('0x23')]?_[_0xf828('0x24')](_0x36fa2e[_0xf828('0x23')],function(_0x3504c7){return{'model':db[_0x3504c7[_0xf828('0x25')]],'as':_0x3504c7['as'],'attributes':_0x3504c7['attributes']};}):[]};}):[]};}):[]:[]})[_0xf828('0x13')](function(_0x35f49f){logger[_0xf828('0x14')]('ShowOpenchannelQueue',_0x149d06);logger[_0xf828('0x27')](_0xf828('0x28'),_0x149d06,JSON[_0xf828('0x16')](_0x35f49f));_0x520129(_0x35f49f);})[_0xf828('0x1c')](function(_0x427621){logger[_0xf828('0x17')](_0xf828('0x28'),_0x427621[_0xf828('0x1a')],_0x149d06);_0x31cc08(_0x47d589[_0xf828('0x17')](0x1f4,_0x427621[_0xf828('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 51be1fc..e9e6470 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 _0x51b5=['length','openchannelQueue:','./openchannelQueue.events','remove','emit','removeListener','register'];(function(_0x2f50ab,_0x4dfe90){var _0x1e9b19=function(_0x4c4ab3){while(--_0x4c4ab3){_0x2f50ab['push'](_0x2f50ab['shift']());}};_0x1e9b19(++_0x4dfe90);}(_0x51b5,0x18a));var _0x551b=function(_0x593b0c,_0xb0c83b){_0x593b0c=_0x593b0c-0x0;var _0x110a19=_0x51b5[_0x593b0c];return _0x110a19;};'use strict';var OpenchannelQueueEvents=require(_0x551b('0x0'));var events=['save',_0x551b('0x1'),'update'];function createListener(_0x23b1e0,_0x4cd9c3){return function(_0x5b9f22){_0x4cd9c3[_0x551b('0x2')](_0x23b1e0,_0x5b9f22);};}function removeListener(_0x184ed4,_0x41a64c){return function(){OpenchannelQueueEvents[_0x551b('0x3')](_0x184ed4,_0x41a64c);};}exports[_0x551b('0x4')]=function(_0x243298){for(var _0x54d588=0x0,_0x1d44a6=events[_0x551b('0x5')];_0x54d588<_0x1d44a6;_0x54d588++){var _0x31724c=events[_0x54d588];var _0x30456f=createListener(_0x551b('0x6')+_0x31724c,_0x243298);OpenchannelQueueEvents['on'](_0x31724c,_0x30456f);}}; \ No newline at end of file +var _0xdaa3=['removeListener','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x540208,_0x3f038a){var _0x2bc062=function(_0x45a13f){while(--_0x45a13f){_0x540208['push'](_0x540208['shift']());}};_0x2bc062(++_0x3f038a);}(_0xdaa3,0x1d0));var _0x3daa=function(_0x318c48,_0x346c5c){_0x318c48=_0x318c48-0x0;var _0x379c48=_0xdaa3[_0x318c48];return _0x379c48;};'use strict';var OpenchannelQueueEvents=require(_0x3daa('0x0'));var events=[_0x3daa('0x1'),_0x3daa('0x2'),_0x3daa('0x3')];function createListener(_0xa0d205,_0x2e8708){return function(_0x4abce5){_0x2e8708[_0x3daa('0x4')](_0xa0d205,_0x4abce5);};}function removeListener(_0x3797f7,_0x260d5e){return function(){OpenchannelQueueEvents[_0x3daa('0x5')](_0x3797f7,_0x260d5e);};}exports['register']=function(_0x153fef){for(var _0x2ba265=0x0,_0x14363d=events['length'];_0x2ba265<_0x14363d;_0x2ba265++){var _0x53a118=events[_0x2ba265];var _0x263539=createListener(_0x3daa('0x6')+_0x53a118,_0x153fef);OpenchannelQueueEvents['on'](_0x53a118,_0x263539);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2a8b23d..5a47c66 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 _0x5a65=['../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x5a65,0x175));var _0x55a6=function(_0x27c3a3,_0x3c96a0){_0x27c3a3=_0x27c3a3-0x0;var _0x2925f1=_0x5a65[_0x27c3a3];return _0x2925f1;};'use strict';var multer=require(_0x55a6('0x0'));var util=require(_0x55a6('0x1'));var path=require(_0x55a6('0x2'));var timeout=require(_0x55a6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x55a6('0x4'));var auth=require(_0x55a6('0x5'));var interaction=require(_0x55a6('0x6'));var config=require(_0x55a6('0x7'));var controller=require(_0x55a6('0x8'));router['get']('/',auth[_0x55a6('0x9')](),controller[_0x55a6('0xa')]);router[_0x55a6('0xb')](_0x55a6('0xc'),auth[_0x55a6('0x9')](),controller[_0x55a6('0xd')]);router[_0x55a6('0xb')](_0x55a6('0xe'),auth[_0x55a6('0x9')](),controller[_0x55a6('0xf')]);router[_0x55a6('0x10')]('/',auth[_0x55a6('0x9')](),controller['create']);router['put'](_0x55a6('0xe'),auth[_0x55a6('0x9')](),controller['update']);router[_0x55a6('0x11')]('/:id',auth[_0x55a6('0x9')](),controller[_0x55a6('0x12')]);module[_0x55a6('0x13')]=router; \ No newline at end of file +var _0xc7ae=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','express'];(function(_0x307541,_0x5c4aa8){var _0x7a409c=function(_0x7c21a2){while(--_0x7c21a2){_0x307541['push'](_0x307541['shift']());}};_0x7a409c(++_0x5c4aa8);}(_0xc7ae,0x95));var _0xec7a=function(_0x72ae2d,_0x368d70){_0x72ae2d=_0x72ae2d-0x0;var _0x1a353c=_0xc7ae[_0x72ae2d];return _0x1a353c;};'use strict';var multer=require(_0xec7a('0x0'));var util=require(_0xec7a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xec7a('0x2'));var router=express[_0xec7a('0x3')]();var fs_extra=require(_0xec7a('0x4'));var auth=require(_0xec7a('0x5'));var interaction=require(_0xec7a('0x6'));var config=require('../../config/environment');var controller=require(_0xec7a('0x7'));router[_0xec7a('0x8')]('/',auth[_0xec7a('0x9')](),controller[_0xec7a('0xa')]);router[_0xec7a('0x8')](_0xec7a('0xb'),auth['isAuthenticated'](),controller[_0xec7a('0xc')]);router[_0xec7a('0x8')](_0xec7a('0xd'),auth['isAuthenticated'](),controller[_0xec7a('0xe')]);router['post']('/',auth[_0xec7a('0x9')](),controller[_0xec7a('0xf')]);router['put'](_0xec7a('0xd'),auth[_0xec7a('0x9')](),controller[_0xec7a('0x10')]);router[_0xec7a('0x11')](_0xec7a('0xd'),auth[_0xec7a('0x9')](),controller[_0xec7a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 4738eb8..d9f6f48 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 _0x12b6=['sequelize','exports','STRING','DATE','moment'];(function(_0x20f7db,_0x20f85e){var _0x4d4568=function(_0x897c7f){while(--_0x897c7f){_0x20f7db['push'](_0x20f7db['shift']());}};_0x4d4568(++_0x20f85e);}(_0x12b6,0x1e4));var _0x612b=function(_0x4265ae,_0x27629a){_0x4265ae=_0x4265ae-0x0;var _0x20d559=_0x12b6[_0x4265ae];return _0x20d559;};'use strict';var moment=require(_0x612b('0x0'));var Sequelize=require(_0x612b('0x1'));module[_0x612b('0x2')]={'uniqueid':{'type':Sequelize[_0x612b('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x612b('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x612b('0x4')]},'exitAt':{'type':Sequelize[_0x612b('0x4')]},'reason':{'type':Sequelize[_0x612b('0x3')]}}; \ No newline at end of file +var _0x3c9a=['DATE','moment','sequelize','exports','STRING'];(function(_0x563e34,_0x454c62){var _0x93907f=function(_0x15dcbc){while(--_0x15dcbc){_0x563e34['push'](_0x563e34['shift']());}};_0x93907f(++_0x454c62);}(_0x3c9a,0x13c));var _0xa3c9=function(_0x7e2729,_0x3fc557){_0x7e2729=_0x7e2729-0x0;var _0x578cb4=_0x3c9a[_0x7e2729];return _0x578cb4;};'use strict';var moment=require(_0xa3c9('0x0'));var Sequelize=require(_0xa3c9('0x1'));module[_0xa3c9('0x2')]={'uniqueid':{'type':Sequelize[_0xa3c9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa3c9('0x3')]},'joinAt':{'type':Sequelize[_0xa3c9('0x4')]},'leaveAt':{'type':Sequelize[_0xa3c9('0x4')]},'acceptAt':{'type':Sequelize[_0xa3c9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa3c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index d1fd8c4..7641614 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 _0x8236=['Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','include','findAll','rows','catch','show','filters','length','includeAll','find','create','body','params','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0x4c08f4,_0x573532){var _0x4327e8=function(_0x1f11e4){while(--_0x1f11e4){_0x4c08f4['push'](_0x4c08f4['shift']());}};_0x4327e8(++_0x573532);}(_0x8236,0x166));var _0x6823=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8236[_0xbf8ebe];return _0x1e25e8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6823('0x0'));var rp=require(_0x6823('0x1'));var moment=require(_0x6823('0x2'));var BPromise=require(_0x6823('0x3'));var Mustache=require(_0x6823('0x4'));var util=require(_0x6823('0x5'));var path=require(_0x6823('0x6'));var sox=require(_0x6823('0x7'));var csv=require('to-csv');var ejs=require(_0x6823('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6823('0x9'));var squel=require(_0x6823('0xa'));var crypto=require(_0x6823('0xb'));var jsforce=require(_0x6823('0xc'));var deskjs=require(_0x6823('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6823('0xe'));var Papa=require(_0x6823('0xf'));var Redis=require(_0x6823('0x10'));var authService=require(_0x6823('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6823('0x12'));var hardwareService=require(_0x6823('0x13'));var logger=require(_0x6823('0x14'))(_0x6823('0x15'));var utils=require(_0x6823('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6823('0x17'));var db=require(_0x6823('0x18'))['db'];function respondWithStatusCode(_0x3ae799,_0xee6e14){_0xee6e14=_0xee6e14||0xcc;return function(_0x5d32f6){if(_0x5d32f6){return _0x3ae799['sendStatus'](_0xee6e14);}return _0x3ae799[_0x6823('0x19')](_0xee6e14)['end']();};}function respondWithResult(_0x3ea1ae,_0xabe397){_0xabe397=_0xabe397||0xc8;return function(_0x5400f1){if(_0x5400f1){return _0x3ea1ae[_0x6823('0x19')](_0xabe397)[_0x6823('0x1a')](_0x5400f1);}};}function respondWithFilteredResult(_0x4d3b2d,_0x3ad368){return function(_0x13e0c6){if(_0x13e0c6){var _0x248ddb=typeof _0x3ad368[_0x6823('0x1b')]===_0x6823('0x1c')&&typeof _0x3ad368[_0x6823('0x1d')]===_0x6823('0x1c');var _0x2ea11f=_0x13e0c6[_0x6823('0x1e')];var _0x20743e=_0x248ddb?0x0:_0x3ad368[_0x6823('0x1b')];var _0x305f71=_0x248ddb?_0x13e0c6[_0x6823('0x1e')]:_0x3ad368[_0x6823('0x1b')]+_0x3ad368[_0x6823('0x1d')];var _0x13eae8;if(_0x305f71>=_0x2ea11f){_0x305f71=_0x2ea11f;_0x13eae8=0xc8;}else{_0x13eae8=0xce;}_0x4d3b2d[_0x6823('0x19')](_0x13eae8);return _0x4d3b2d[_0x6823('0x1f')](_0x6823('0x20'),_0x20743e+'-'+_0x305f71+'/'+_0x2ea11f)[_0x6823('0x1a')](_0x13e0c6);}return null;};}function patchUpdates(_0x5c9bf3){return function(_0x26ca80){try{jsonpatch[_0x6823('0x21')](_0x26ca80,_0x5c9bf3,!![]);}catch(_0x29e547){return BPromise[_0x6823('0x22')](_0x29e547);}return _0x26ca80[_0x6823('0x23')]();};}function saveUpdates(_0x3c1f5e,_0x37ef13){return function(_0x325fe7){if(_0x325fe7){return _0x325fe7[_0x6823('0x24')](_0x3c1f5e)['then'](function(_0x3847ff){return _0x3847ff;});}return null;};}function removeEntity(_0x57990d,_0x3229eb){return function(_0x3254c0){if(_0x3254c0){return _0x3254c0[_0x6823('0x25')]()[_0x6823('0x26')](function(){_0x57990d[_0x6823('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5e23,_0x14b35e){return function(_0x25f282){if(!_0x25f282){_0x2b5e23[_0x6823('0x27')](0x194);}return _0x25f282;};}function handleError(_0xd9f28a,_0x6506bc){_0x6506bc=_0x6506bc||0x1f4;return function(_0x5e2d7d){logger[_0x6823('0x28')](_0x5e2d7d['stack']);if(_0x5e2d7d[_0x6823('0x29')]){delete _0x5e2d7d[_0x6823('0x29')];}_0xd9f28a[_0x6823('0x19')](_0x6506bc)[_0x6823('0x2a')](_0x5e2d7d);};}exports[_0x6823('0x2b')]=function(_0x2005c3,_0x58d28b){var _0x333631={},_0x3a1319={},_0x533b6c={'count':0x0,'rows':[]};var _0x5c1482=_[_0x6823('0x2c')](db['OpenchannelQueueReport'][_0x6823('0x2d')],function(_0x2fccbc){return{'name':_0x2fccbc[_0x6823('0x2e')],'type':_0x2fccbc[_0x6823('0x2f')][_0x6823('0x30')]};});_0x3a1319[_0x6823('0x31')]=_['map'](_0x5c1482,'name');_0x3a1319[_0x6823('0x32')]=_[_0x6823('0x33')](_0x2005c3[_0x6823('0x32')]);_0x3a1319['filters']=_['intersection'](_0x3a1319[_0x6823('0x31')],_0x3a1319[_0x6823('0x32')]);_0x333631['attributes']=_[_0x6823('0x34')](_0x3a1319[_0x6823('0x31')],qs[_0x6823('0x35')](_0x2005c3[_0x6823('0x32')][_0x6823('0x35')]));_0x333631[_0x6823('0x36')]=_0x333631[_0x6823('0x36')]['length']?_0x333631[_0x6823('0x36')]:_0x3a1319['model'];if(!_0x2005c3[_0x6823('0x32')][_0x6823('0x37')]('nolimit')){_0x333631[_0x6823('0x1d')]=qs[_0x6823('0x1d')](_0x2005c3[_0x6823('0x32')][_0x6823('0x1d')]);_0x333631[_0x6823('0x1b')]=qs['offset'](_0x2005c3[_0x6823('0x32')][_0x6823('0x1b')]);}_0x333631[_0x6823('0x38')]=qs[_0x6823('0x39')](_0x2005c3['query'][_0x6823('0x39')]);_0x333631[_0x6823('0x3a')]=qs['filters'](_[_0x6823('0x3b')](_0x2005c3[_0x6823('0x32')],_0x3a1319['filters']),_0x5c1482);if(_0x2005c3[_0x6823('0x32')][_0x6823('0x3c')]){_0x333631[_0x6823('0x3a')]=_[_0x6823('0x3d')](_0x333631['where'],{'$or':_['map'](_0x5c1482,function(_0x554ba2){if(_0x554ba2[_0x6823('0x2f')]!==_0x6823('0x3e')){var _0x4e3cef={};_0x4e3cef[_0x554ba2[_0x6823('0x29')]]={'$like':'%'+_0x2005c3[_0x6823('0x32')][_0x6823('0x3c')]+'%'};return _0x4e3cef;}})});}_0x333631=_[_0x6823('0x3d')]({},_0x333631,_0x2005c3[_0x6823('0x3f')]);var _0x4fb905={'where':_0x333631['where']};return db[_0x6823('0x40')][_0x6823('0x1e')](_0x4fb905)['then'](function(_0x1b163d){_0x533b6c[_0x6823('0x1e')]=_0x1b163d;if(_0x2005c3[_0x6823('0x32')]['includeAll']){_0x333631[_0x6823('0x41')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x6823('0x42')](_0x333631);})[_0x6823('0x26')](function(_0x1d9671){_0x533b6c[_0x6823('0x43')]=_0x1d9671;return _0x533b6c;})[_0x6823('0x26')](respondWithFilteredResult(_0x58d28b,_0x333631))[_0x6823('0x44')](handleError(_0x58d28b,null));};exports[_0x6823('0x45')]=function(_0x274dff,_0x105a6e){var _0x1a2c2e={'raw':!![],'where':{'id':_0x274dff['params']['id']}},_0x4fb4e8={};_0x4fb4e8[_0x6823('0x31')]=_[_0x6823('0x33')](db[_0x6823('0x40')][_0x6823('0x2d')]);_0x4fb4e8[_0x6823('0x32')]=_['keys'](_0x274dff[_0x6823('0x32')]);_0x4fb4e8[_0x6823('0x46')]=_['intersection'](_0x4fb4e8[_0x6823('0x31')],_0x4fb4e8[_0x6823('0x32')]);_0x1a2c2e['attributes']=_['intersection'](_0x4fb4e8[_0x6823('0x31')],qs['fields'](_0x274dff[_0x6823('0x32')][_0x6823('0x35')]));_0x1a2c2e[_0x6823('0x36')]=_0x1a2c2e['attributes'][_0x6823('0x47')]?_0x1a2c2e['attributes']:_0x4fb4e8[_0x6823('0x31')];if(_0x274dff[_0x6823('0x32')][_0x6823('0x48')]){_0x1a2c2e[_0x6823('0x41')]=[{'all':!![]}];}_0x1a2c2e=_['merge']({},_0x1a2c2e,_0x274dff['options']);return db[_0x6823('0x40')][_0x6823('0x49')](_0x1a2c2e)[_0x6823('0x26')](handleEntityNotFound(_0x105a6e,null))['then'](respondWithResult(_0x105a6e,null))[_0x6823('0x44')](handleError(_0x105a6e,null));};exports[_0x6823('0x4a')]=function(_0x5e637c,_0x2e68f7){return db[_0x6823('0x40')][_0x6823('0x4a')](_0x5e637c[_0x6823('0x4b')],{})['then'](respondWithResult(_0x2e68f7,0xc9))[_0x6823('0x44')](handleError(_0x2e68f7,null));};exports[_0x6823('0x24')]=function(_0x28457a,_0x5bcf80){if(_0x28457a[_0x6823('0x4b')]['id']){delete _0x28457a[_0x6823('0x4b')]['id'];}return db[_0x6823('0x40')]['find']({'where':{'id':_0x28457a[_0x6823('0x4c')]['id']}})[_0x6823('0x26')](handleEntityNotFound(_0x5bcf80,null))['then'](saveUpdates(_0x28457a['body'],null))[_0x6823('0x26')](respondWithResult(_0x5bcf80,null))['catch'](handleError(_0x5bcf80,null));};exports['destroy']=function(_0x3e9038,_0x1bb528){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x3e9038[_0x6823('0x4c')]['id']}})[_0x6823('0x26')](handleEntityNotFound(_0x1bb528,null))[_0x6823('0x26')](removeEntity(_0x1bb528,null))['catch'](handleError(_0x1bb528,null));};exports[_0x6823('0x4d')]=function(_0x1aa7ba,_0x5eec57){return db[_0x6823('0x40')][_0x6823('0x4d')]()[_0x6823('0x26')](respondWithResult(_0x5eec57,null))[_0x6823('0x44')](handleError(_0x5eec57,null));}; \ No newline at end of file +var _0x559e=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','fields','includeAll','create','body','catch','find','params','describe','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3c49fa,_0x3307f5){var _0x3f48d9=function(_0x89d632){while(--_0x89d632){_0x3c49fa['push'](_0x3c49fa['shift']());}};_0x3f48d9(++_0x3307f5);}(_0x559e,0x82));var _0xe559=function(_0x1d4310,_0x262fd3){_0x1d4310=_0x1d4310-0x0;var _0x49c606=_0x559e[_0x1d4310];return _0x49c606;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe559('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe559('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xe559('0x2'));var util=require(_0xe559('0x3'));var path=require(_0xe559('0x4'));var sox=require(_0xe559('0x5'));var csv=require(_0xe559('0x6'));var ejs=require(_0xe559('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe559('0x8'));var squel=require(_0xe559('0x9'));var crypto=require(_0xe559('0xa'));var jsforce=require(_0xe559('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe559('0xc'));var authService=require(_0xe559('0xd'));var qs=require(_0xe559('0xe'));var as=require(_0xe559('0xf'));var hardwareService=require(_0xe559('0x10'));var logger=require(_0xe559('0x11'))(_0xe559('0x12'));var utils=require(_0xe559('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe559('0x14'));var db=require(_0xe559('0x15'))['db'];function respondWithStatusCode(_0x2682a8,_0xe2ed60){_0xe2ed60=_0xe2ed60||0xcc;return function(_0x25808e){if(_0x25808e){return _0x2682a8[_0xe559('0x16')](_0xe2ed60);}return _0x2682a8[_0xe559('0x17')](_0xe2ed60)[_0xe559('0x18')]();};}function respondWithResult(_0x5d7ee5,_0x1d49b0){_0x1d49b0=_0x1d49b0||0xc8;return function(_0x3ce49b){if(_0x3ce49b){return _0x5d7ee5[_0xe559('0x17')](_0x1d49b0)['json'](_0x3ce49b);}};}function respondWithFilteredResult(_0x50f550,_0x4cbf7d){return function(_0x393526){if(_0x393526){var _0x1764ee=typeof _0x4cbf7d['offset']==='undefined'&&typeof _0x4cbf7d[_0xe559('0x19')]==='undefined';var _0x231198=_0x393526[_0xe559('0x1a')];var _0x3f37cf=_0x1764ee?0x0:_0x4cbf7d[_0xe559('0x1b')];var _0x5aef32=_0x1764ee?_0x393526[_0xe559('0x1a')]:_0x4cbf7d[_0xe559('0x1b')]+_0x4cbf7d[_0xe559('0x19')];var _0xa0ac94;if(_0x5aef32>=_0x231198){_0x5aef32=_0x231198;_0xa0ac94=0xc8;}else{_0xa0ac94=0xce;}_0x50f550[_0xe559('0x17')](_0xa0ac94);return _0x50f550['set']('Content-Range',_0x3f37cf+'-'+_0x5aef32+'/'+_0x231198)[_0xe559('0x1c')](_0x393526);}return null;};}function patchUpdates(_0x4bac09){return function(_0x240812){try{jsonpatch[_0xe559('0x1d')](_0x240812,_0x4bac09,!![]);}catch(_0x387381){return BPromise[_0xe559('0x1e')](_0x387381);}return _0x240812[_0xe559('0x1f')]();};}function saveUpdates(_0x4b0a76,_0x193e87){return function(_0x5e9e71){if(_0x5e9e71){return _0x5e9e71[_0xe559('0x20')](_0x4b0a76)[_0xe559('0x21')](function(_0x745cfc){return _0x745cfc;});}return null;};}function removeEntity(_0x3417d4,_0x56e843){return function(_0x4c650e){if(_0x4c650e){return _0x4c650e[_0xe559('0x22')]()[_0xe559('0x21')](function(){_0x3417d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb663f6,_0x18ff81){return function(_0x2420bb){if(!_0x2420bb){_0xb663f6['sendStatus'](0x194);}return _0x2420bb;};}function handleError(_0x2234ce,_0x3db549){_0x3db549=_0x3db549||0x1f4;return function(_0x1825d2){logger[_0xe559('0x23')](_0x1825d2[_0xe559('0x24')]);if(_0x1825d2[_0xe559('0x25')]){delete _0x1825d2['name'];}_0x2234ce[_0xe559('0x17')](_0x3db549)[_0xe559('0x26')](_0x1825d2);};}exports['index']=function(_0x3accdd,_0x3938b7){var _0xd25e25={},_0x262af7={},_0xe5232a={'count':0x0,'rows':[]};var _0x3bb7f6=_[_0xe559('0x27')](db[_0xe559('0x28')][_0xe559('0x29')],function(_0x3948e4){return{'name':_0x3948e4[_0xe559('0x2a')],'type':_0x3948e4[_0xe559('0x2b')][_0xe559('0x2c')]};});_0x262af7[_0xe559('0x2d')]=_[_0xe559('0x27')](_0x3bb7f6,_0xe559('0x25'));_0x262af7[_0xe559('0x2e')]=_[_0xe559('0x2f')](_0x3accdd[_0xe559('0x2e')]);_0x262af7['filters']=_[_0xe559('0x30')](_0x262af7[_0xe559('0x2d')],_0x262af7['query']);_0xd25e25[_0xe559('0x31')]=_[_0xe559('0x30')](_0x262af7[_0xe559('0x2d')],qs['fields'](_0x3accdd[_0xe559('0x2e')]['fields']));_0xd25e25[_0xe559('0x31')]=_0xd25e25[_0xe559('0x31')][_0xe559('0x32')]?_0xd25e25['attributes']:_0x262af7['model'];if(!_0x3accdd['query'][_0xe559('0x33')](_0xe559('0x34'))){_0xd25e25[_0xe559('0x19')]=qs['limit'](_0x3accdd[_0xe559('0x2e')][_0xe559('0x19')]);_0xd25e25[_0xe559('0x1b')]=qs[_0xe559('0x1b')](_0x3accdd[_0xe559('0x2e')][_0xe559('0x1b')]);}_0xd25e25[_0xe559('0x35')]=qs[_0xe559('0x36')](_0x3accdd['query'][_0xe559('0x36')]);_0xd25e25[_0xe559('0x37')]=qs[_0xe559('0x38')](_[_0xe559('0x39')](_0x3accdd[_0xe559('0x2e')],_0x262af7[_0xe559('0x38')]),_0x3bb7f6);if(_0x3accdd[_0xe559('0x2e')]['filter']){_0xd25e25['where']=_[_0xe559('0x3a')](_0xd25e25[_0xe559('0x37')],{'$or':_['map'](_0x3bb7f6,function(_0x3cfc2d){if(_0x3cfc2d['type']!==_0xe559('0x3b')){var _0x3d2dd3={};_0x3d2dd3[_0x3cfc2d[_0xe559('0x25')]]={'$like':'%'+_0x3accdd[_0xe559('0x2e')][_0xe559('0x3c')]+'%'};return _0x3d2dd3;}})});}_0xd25e25=_[_0xe559('0x3a')]({},_0xd25e25,_0x3accdd[_0xe559('0x3d')]);var _0x3cd0f0={'where':_0xd25e25['where']};return db[_0xe559('0x28')]['count'](_0x3cd0f0)[_0xe559('0x21')](function(_0x32af7d){_0xe5232a[_0xe559('0x1a')]=_0x32af7d;if(_0x3accdd[_0xe559('0x2e')]['includeAll']){_0xd25e25[_0xe559('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xe559('0x3f')](_0xd25e25);})['then'](function(_0x1605c7){_0xe5232a[_0xe559('0x40')]=_0x1605c7;return _0xe5232a;})[_0xe559('0x21')](respondWithFilteredResult(_0x3938b7,_0xd25e25))['catch'](handleError(_0x3938b7,null));};exports[_0xe559('0x41')]=function(_0x191f7a,_0x258c66){var _0x2b7c80={'raw':!![],'where':{'id':_0x191f7a['params']['id']}},_0x42320a={};_0x42320a[_0xe559('0x2d')]=_[_0xe559('0x2f')](db['OpenchannelQueueReport'][_0xe559('0x29')]);_0x42320a[_0xe559('0x2e')]=_[_0xe559('0x2f')](_0x191f7a[_0xe559('0x2e')]);_0x42320a[_0xe559('0x38')]=_['intersection'](_0x42320a[_0xe559('0x2d')],_0x42320a[_0xe559('0x2e')]);_0x2b7c80['attributes']=_[_0xe559('0x30')](_0x42320a[_0xe559('0x2d')],qs[_0xe559('0x42')](_0x191f7a[_0xe559('0x2e')][_0xe559('0x42')]));_0x2b7c80[_0xe559('0x31')]=_0x2b7c80[_0xe559('0x31')][_0xe559('0x32')]?_0x2b7c80[_0xe559('0x31')]:_0x42320a[_0xe559('0x2d')];if(_0x191f7a[_0xe559('0x2e')][_0xe559('0x43')]){_0x2b7c80[_0xe559('0x3e')]=[{'all':!![]}];}_0x2b7c80=_['merge']({},_0x2b7c80,_0x191f7a[_0xe559('0x3d')]);return db[_0xe559('0x28')]['find'](_0x2b7c80)['then'](handleEntityNotFound(_0x258c66,null))[_0xe559('0x21')](respondWithResult(_0x258c66,null))['catch'](handleError(_0x258c66,null));};exports[_0xe559('0x44')]=function(_0x4deab2,_0x2b66f3){return db['OpenchannelQueueReport'][_0xe559('0x44')](_0x4deab2[_0xe559('0x45')],{})[_0xe559('0x21')](respondWithResult(_0x2b66f3,0xc9))[_0xe559('0x46')](handleError(_0x2b66f3,null));};exports['update']=function(_0x505577,_0x423c65){if(_0x505577[_0xe559('0x45')]['id']){delete _0x505577[_0xe559('0x45')]['id'];}return db[_0xe559('0x28')][_0xe559('0x47')]({'where':{'id':_0x505577[_0xe559('0x48')]['id']}})['then'](handleEntityNotFound(_0x423c65,null))[_0xe559('0x21')](saveUpdates(_0x505577['body'],null))[_0xe559('0x21')](respondWithResult(_0x423c65,null))['catch'](handleError(_0x423c65,null));};exports[_0xe559('0x22')]=function(_0x2255c7,_0x2f0c87){return db[_0xe559('0x28')][_0xe559('0x47')]({'where':{'id':_0x2255c7['params']['id']}})[_0xe559('0x21')](handleEntityNotFound(_0x2f0c87,null))['then'](removeEntity(_0x2f0c87,null))[_0xe559('0x46')](handleError(_0x2f0c87,null));};exports[_0xe559('0x49')]=function(_0x37d70e,_0x156b63){return db['OpenchannelQueueReport'][_0xe559('0x49')]()['then'](respondWithResult(_0x156b63,null))['catch'](handleError(_0x156b63,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index bb77d27..3647394 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x27f82d,_0x434476){var _0x4f964f=function(_0x351ba5){while(--_0x351ba5){_0x27f82d['push'](_0x27f82d['shift']());}};_0x4f964f(++_0x434476);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'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 +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x38642c,_0x45a9b6){var _0x1d7856=function(_0x26b92d){while(--_0x26b92d){_0x38642c['push'](_0x38642c['shift']());}};_0x1d7856(++_0x45a9b6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x5fc3[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 2607e49..050ae0d 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 _0x4f7b=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','raw','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','options'];(function(_0x6e1c8c,_0x53bce2){var _0x50185c=function(_0x11b621){while(--_0x11b621){_0x6e1c8c['push'](_0x6e1c8c['shift']());}};_0x50185c(++_0x53bce2);}(_0x4f7b,0x13e));var _0xb4f7=function(_0xc09475,_0x25ebed){_0xc09475=_0xc09475-0x0;var _0x38c57f=_0x4f7b[_0xc09475];return _0x38c57f;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}exports['CreateOpenchannelQueueReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')](_0x53b135[_0xb4f7('0x19')],{'raw':_0x53b135['options']?_0x53b135['options'][_0xb4f7('0x1a')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x5cc40e){logger[_0xb4f7('0xd')](_0xb4f7('0x1b'),_0x53b135);logger[_0xb4f7('0x1c')](_0xb4f7('0x1b'),_0x53b135,JSON['stringify'](_0x5cc40e));_0x22e273(_0x5cc40e);})[_0xb4f7('0x16')](function(_0x56bac5){logger[_0xb4f7('0x12')](_0xb4f7('0x1b'),_0x56bac5[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7[_0xb4f7('0x12')](0x1f4,_0x56bac5[_0xb4f7('0x14')]));});});};exports[_0xb4f7('0x1d')]=function(_0x493d81){var _0x1fe0cf=this;return new Promise(function(_0x291166,_0x19e549){return db[_0xb4f7('0x17')][_0xb4f7('0x1e')](_0x493d81[_0xb4f7('0x19')],{'raw':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493d81[_0xb4f7('0x1f')]?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x20')]||null:null,'attributes':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x21')]||null:null,'limit':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x22')]||null:null})[_0xb4f7('0xc')](function(_0x35582a){logger['info'](_0xb4f7('0x1d'),_0x493d81);logger[_0xb4f7('0x1c')](_0xb4f7('0x1d'),_0x493d81,JSON[_0xb4f7('0x11')](_0x35582a));_0x291166(_0x35582a);})['catch'](function(_0x4ea802){logger[_0xb4f7('0x12')]('UpdateOpenchannelQueueReport',_0x4ea802[_0xb4f7('0x14')],_0x493d81);_0x19e549(_0x1fe0cf[_0xb4f7('0x12')](0x1f4,_0x4ea802['message']));});});}; \ No newline at end of file +var _0x7382=['error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x38b673,_0x196974){var _0x19b493=function(_0x266676){while(--_0x266676){_0x38b673['push'](_0x38b673['shift']());}};_0x19b493(++_0x196974);}(_0x7382,0x111));var _0x2738=function(_0xa27585,_0x30ca64){_0xa27585=_0xa27585-0x0;var _0xbedcec=_0x7382[_0xa27585];return _0xbedcec;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2738('0x1'));var logger=require(_0x2738('0x2'))(_0x2738('0x3'));var config=require(_0x2738('0x4'));var jayson=require(_0x2738('0x5'));var client=jayson['client'][_0x2738('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2bc38a,_0xd74b07,_0x523aef){return new BPromise(function(_0x4235e7,_0x487d14){return client[_0x2738('0x7')](_0x2bc38a,_0x523aef)['then'](function(_0x476864){logger[_0x2738('0x8')](_0x2738('0x9'),_0xd74b07,'request\x20sent');logger[_0x2738('0xa')](_0x2738('0xb'),_0xd74b07,_0x2738('0xc'),JSON['stringify'](_0x476864));if(_0x476864['error']){if(_0x476864[_0x2738('0xd')][_0x2738('0xe')]===0x1f4){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')][_0x2738('0xf')]);return _0x487d14(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x476864[_0x2738('0xd')]['message']);return _0x4235e7(_0x476864[_0x2738('0xd')][_0x2738('0xf')]);}else{logger['info'](_0x2738('0x9'),_0xd74b07,'request\x20sent');_0x4235e7(_0x476864[_0x2738('0x10')]['message']);}})[_0x2738('0x11')](function(_0x568065){logger[_0x2738('0xd')](_0x2738('0x9'),_0xd74b07,_0x568065);_0x487d14(_0x568065);});});}exports[_0x2738('0x12')]=function(_0x3c6810){var _0x1d0aca=this;return new Promise(function(_0x1e0f57,_0x42685a){return db[_0x2738('0x13')]['create'](_0x3c6810[_0x2738('0x14')],{'raw':_0x3c6810['options']?_0x3c6810[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5a1d61){logger[_0x2738('0x8')](_0x2738('0x12'),_0x3c6810);logger[_0x2738('0xa')](_0x2738('0x12'),_0x3c6810,JSON[_0x2738('0x17')](_0x5a1d61));_0x1e0f57(_0x5a1d61);})[_0x2738('0x11')](function(_0x18e1d8){logger[_0x2738('0xd')](_0x2738('0x12'),_0x18e1d8[_0x2738('0xf')],_0x3c6810);_0x42685a(_0x1d0aca[_0x2738('0xd')](0x1f4,_0x18e1d8['message']));});});};exports[_0x2738('0x18')]=function(_0x537c5f){var _0x51ee19=this;return new Promise(function(_0x3e3b2d,_0x2d8c5b){return db[_0x2738('0x13')][_0x2738('0x19')](_0x537c5f[_0x2738('0x14')],{'raw':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')][_0x2738('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537c5f['options']?_0x537c5f[_0x2738('0x15')]['where']||null:null,'attributes':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['attributes']||null:null,'limit':_0x537c5f[_0x2738('0x15')]?_0x537c5f[_0x2738('0x15')]['limit']||null:null})['then'](function(_0x4fad4c){logger['info'](_0x2738('0x18'),_0x537c5f);logger[_0x2738('0xa')](_0x2738('0x18'),_0x537c5f,JSON[_0x2738('0x17')](_0x4fad4c));_0x3e3b2d(_0x4fad4c);})[_0x2738('0x11')](function(_0x2b317c){logger['error'](_0x2738('0x18'),_0x2b317c[_0x2738('0xf')],_0x537c5f);_0x2d8c5b(_0x51ee19[_0x2738('0xd')](0x1f4,_0x2b317c[_0x2738('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index a931404..29da6cc 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 _0x4dc9=['/:id','show','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4dc9,0x13e));var _0x94dc=function(_0x26a7a6,_0x1cd0f4){_0x26a7a6=_0x26a7a6-0x0;var _0x27397a=_0x4dc9[_0x26a7a6];return _0x27397a;};'use strict';var multer=require(_0x94dc('0x0'));var util=require(_0x94dc('0x1'));var path=require(_0x94dc('0x2'));var timeout=require(_0x94dc('0x3'));var express=require('express');var router=express[_0x94dc('0x4')]();var fs_extra=require(_0x94dc('0x5'));var auth=require(_0x94dc('0x6'));var interaction=require(_0x94dc('0x7'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x94dc('0x8')](),controller[_0x94dc('0x9')]);router[_0x94dc('0xa')](_0x94dc('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x94dc('0xa')](_0x94dc('0xc'),auth[_0x94dc('0x8')](),controller[_0x94dc('0xd')]);router['post']('/',auth[_0x94dc('0x8')](),controller['create']);router['put'](_0x94dc('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x94dc('0xe')]('/:id',auth[_0x94dc('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4eaf=['show','create','put','/:id','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x4d0190,_0x470828){var _0x3da539=function(_0x456347){while(--_0x456347){_0x4d0190['push'](_0x4d0190['shift']());}};_0x3da539(++_0x470828);}(_0x4eaf,0x96));var _0xf4ea=function(_0x54a6c2,_0x2e0c29){_0x54a6c2=_0x54a6c2-0x0;var _0x513e1c=_0x4eaf[_0x54a6c2];return _0x513e1c;};'use strict';var multer=require(_0xf4ea('0x0'));var util=require(_0xf4ea('0x1'));var path=require('path');var timeout=require(_0xf4ea('0x2'));var express=require(_0xf4ea('0x3'));var router=express['Router']();var fs_extra=require(_0xf4ea('0x4'));var auth=require(_0xf4ea('0x5'));var interaction=require(_0xf4ea('0x6'));var config=require(_0xf4ea('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xf4ea('0x8')]('/',auth['isAuthenticated'](),controller[_0xf4ea('0x9')]);router[_0xf4ea('0x8')](_0xf4ea('0xa'),auth[_0xf4ea('0xb')](),controller['describe']);router[_0xf4ea('0x8')]('/:id',auth[_0xf4ea('0xb')](),controller[_0xf4ea('0xc')]);router['post']('/',auth[_0xf4ea('0xb')](),controller[_0xf4ea('0xd')]);router[_0xf4ea('0xe')](_0xf4ea('0xf'),auth['isAuthenticated'](),controller[_0xf4ea('0x10')]);router['delete'](_0xf4ea('0xf'),auth[_0xf4ea('0xb')](),controller[_0xf4ea('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b0dda42..ddea579 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xf045a0,_0x45c554){var _0x318cb2=function(_0x17543f){while(--_0x17543f){_0xf045a0['push'](_0xf045a0['shift']());}};_0x318cb2(++_0x45c554);}(_0xedd9,0xfc));var _0x9edd=function(_0x1e7572,_0x2187d0){_0x1e7572=_0x1e7572-0x0;var _0x118895=_0xedd9[_0x1e7572];return _0x118895;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1fd2b1,_0x4075ae){var _0x183a87=function(_0x466aba){while(--_0x466aba){_0x1fd2b1['push'](_0x1fd2b1['shift']());}};_0x183a87(++_0x4075ae);}(_0xedd9,0xfc));var _0x9edd=function(_0x569de1,_0x2d740a){_0x569de1=_0x569de1-0x0;var _0x2395e8=_0xedd9[_0x569de1];return _0x2395e8;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 37ce78a..774c5d2 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 _0xd472=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','set','apply','reject','then','destroy','sendStatus','error','stack','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','model','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xd472,0x1e9));var _0x2d47=function(_0x4e7a25,_0x57bd5d){_0x4e7a25=_0x4e7a25-0x0;var _0xd604d2=_0xd472[_0x4e7a25];return _0xd604d2;};'use strict';var emlformat=require(_0x2d47('0x0'));var rimraf=require(_0x2d47('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2d47('0x2'));var moment=require(_0x2d47('0x3'));var BPromise=require(_0x2d47('0x4'));var Mustache=require(_0x2d47('0x5'));var util=require('util');var path=require(_0x2d47('0x6'));var sox=require(_0x2d47('0x7'));var csv=require(_0x2d47('0x8'));var ejs=require(_0x2d47('0x9'));var fs=require('fs');var fs_extra=require(_0x2d47('0xa'));var _=require(_0x2d47('0xb'));var squel=require('squel');var crypto=require(_0x2d47('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d47('0xd'));var Redis=require(_0x2d47('0xe'));var authService=require(_0x2d47('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2d47('0x10'));var hardwareService=require(_0x2d47('0x11'));var logger=require(_0x2d47('0x12'))(_0x2d47('0x13'));var utils=require(_0x2d47('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d47('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45f076,_0x13cd0d){_0x13cd0d=_0x13cd0d||0xcc;return function(_0x59bb34){if(_0x59bb34){return _0x45f076['sendStatus'](_0x13cd0d);}return _0x45f076[_0x2d47('0x16')](_0x13cd0d)[_0x2d47('0x17')]();};}function respondWithResult(_0x47ed74,_0x37216e){_0x37216e=_0x37216e||0xc8;return function(_0x9020a2){if(_0x9020a2){return _0x47ed74[_0x2d47('0x16')](_0x37216e)[_0x2d47('0x18')](_0x9020a2);}};}function respondWithFilteredResult(_0x4f0be1,_0x186127){return function(_0x5e4416){if(_0x5e4416){var _0x246815=typeof _0x186127[_0x2d47('0x19')]===_0x2d47('0x1a')&&typeof _0x186127['limit']==='undefined';var _0x14d0a6=_0x5e4416[_0x2d47('0x1b')];var _0x1955d0=_0x246815?0x0:_0x186127['offset'];var _0x4ae303=_0x246815?_0x5e4416[_0x2d47('0x1b')]:_0x186127[_0x2d47('0x19')]+_0x186127['limit'];var _0x9c670c;if(_0x4ae303>=_0x14d0a6){_0x4ae303=_0x14d0a6;_0x9c670c=0xc8;}else{_0x9c670c=0xce;}_0x4f0be1[_0x2d47('0x16')](_0x9c670c);return _0x4f0be1[_0x2d47('0x1c')]('Content-Range',_0x1955d0+'-'+_0x4ae303+'/'+_0x14d0a6)['json'](_0x5e4416);}return null;};}function patchUpdates(_0x18e582){return function(_0x324eae){try{jsonpatch[_0x2d47('0x1d')](_0x324eae,_0x18e582,!![]);}catch(_0x30a7a6){return BPromise[_0x2d47('0x1e')](_0x30a7a6);}return _0x324eae['save']();};}function saveUpdates(_0x576076,_0x4b0629){return function(_0x26424f){if(_0x26424f){return _0x26424f['update'](_0x576076)[_0x2d47('0x1f')](function(_0x54e8b7){return _0x54e8b7;});}return null;};}function removeEntity(_0x1f782c,_0x3cd195){return function(_0x239a88){if(_0x239a88){return _0x239a88[_0x2d47('0x20')]()['then'](function(){_0x1f782c[_0x2d47('0x16')](0xcc)[_0x2d47('0x17')]();});}};}function handleEntityNotFound(_0x35da56,_0xfe2526){return function(_0x15a6a5){if(!_0x15a6a5){_0x35da56[_0x2d47('0x21')](0x194);}return _0x15a6a5;};}function handleError(_0x5e6a0c,_0x1a416e){_0x1a416e=_0x1a416e||0x1f4;return function(_0x4385bc){logger[_0x2d47('0x22')](_0x4385bc[_0x2d47('0x23')]);if(_0x4385bc['name']){delete _0x4385bc['name'];}_0x5e6a0c[_0x2d47('0x16')](_0x1a416e)[_0x2d47('0x24')](_0x4385bc);};}exports[_0x2d47('0x25')]=function(_0x3e670b,_0x348c3a){var _0x3744f5={},_0x250658={},_0x11d5b7={'count':0x0,'rows':[]};var _0x3760b2=_[_0x2d47('0x26')](db[_0x2d47('0x27')][_0x2d47('0x28')],function(_0x465cd3){return{'name':_0x465cd3[_0x2d47('0x29')],'type':_0x465cd3['type']['key']};});_0x250658[_0x2d47('0x2a')]=_['map'](_0x3760b2,_0x2d47('0x2b'));_0x250658[_0x2d47('0x2c')]=_[_0x2d47('0x2d')](_0x3e670b[_0x2d47('0x2c')]);_0x250658[_0x2d47('0x2e')]=_['intersection'](_0x250658[_0x2d47('0x2a')],_0x250658[_0x2d47('0x2c')]);_0x3744f5[_0x2d47('0x2f')]=_[_0x2d47('0x30')](_0x250658[_0x2d47('0x2a')],qs['fields'](_0x3e670b['query']['fields']));_0x3744f5[_0x2d47('0x2f')]=_0x3744f5[_0x2d47('0x2f')][_0x2d47('0x31')]?_0x3744f5['attributes']:_0x250658['model'];if(!_0x3e670b['query'][_0x2d47('0x32')](_0x2d47('0x33'))){_0x3744f5[_0x2d47('0x34')]=qs['limit'](_0x3e670b[_0x2d47('0x2c')]['limit']);_0x3744f5[_0x2d47('0x19')]=qs[_0x2d47('0x19')](_0x3e670b['query'][_0x2d47('0x19')]);}_0x3744f5['order']=qs['sort'](_0x3e670b[_0x2d47('0x2c')]['sort']);_0x3744f5['where']=qs[_0x2d47('0x2e')](_[_0x2d47('0x35')](_0x3e670b['query'],_0x250658['filters']),_0x3760b2);if(_0x3e670b[_0x2d47('0x2c')]['filter']){_0x3744f5[_0x2d47('0x36')]=_[_0x2d47('0x37')](_0x3744f5[_0x2d47('0x36')],{'$or':_[_0x2d47('0x26')](_0x3760b2,function(_0xac76ce){if(_0xac76ce[_0x2d47('0x38')]!==_0x2d47('0x39')){var _0x176df4={};_0x176df4[_0xac76ce[_0x2d47('0x2b')]]={'$like':'%'+_0x3e670b[_0x2d47('0x2c')]['filter']+'%'};return _0x176df4;}})});}_0x3744f5=_['merge']({},_0x3744f5,_0x3e670b[_0x2d47('0x3a')]);var _0x30ac6e={'where':_0x3744f5[_0x2d47('0x36')]};return db[_0x2d47('0x27')][_0x2d47('0x1b')](_0x30ac6e)[_0x2d47('0x1f')](function(_0x12bbe2){_0x11d5b7['count']=_0x12bbe2;if(_0x3e670b['query'][_0x2d47('0x3b')]){_0x3744f5[_0x2d47('0x3c')]=[{'all':!![]}];}return db[_0x2d47('0x27')][_0x2d47('0x3d')](_0x3744f5);})[_0x2d47('0x1f')](function(_0x277055){_0x11d5b7[_0x2d47('0x3e')]=_0x277055;return _0x11d5b7;})[_0x2d47('0x1f')](respondWithFilteredResult(_0x348c3a,_0x3744f5))[_0x2d47('0x3f')](handleError(_0x348c3a,null));};exports[_0x2d47('0x40')]=function(_0x4a42ed,_0x3475df){var _0xee6017={'raw':!![],'where':{'id':_0x4a42ed[_0x2d47('0x41')]['id']}},_0x359f66={};_0x359f66['model']=_[_0x2d47('0x2d')](db[_0x2d47('0x27')][_0x2d47('0x28')]);_0x359f66[_0x2d47('0x2c')]=_[_0x2d47('0x2d')](_0x4a42ed[_0x2d47('0x2c')]);_0x359f66['filters']=_[_0x2d47('0x30')](_0x359f66[_0x2d47('0x2a')],_0x359f66[_0x2d47('0x2c')]);_0xee6017[_0x2d47('0x2f')]=_[_0x2d47('0x30')](_0x359f66['model'],qs[_0x2d47('0x42')](_0x4a42ed[_0x2d47('0x2c')][_0x2d47('0x42')]));_0xee6017[_0x2d47('0x2f')]=_0xee6017[_0x2d47('0x2f')][_0x2d47('0x31')]?_0xee6017[_0x2d47('0x2f')]:_0x359f66[_0x2d47('0x2a')];if(_0x4a42ed['query'][_0x2d47('0x3b')]){_0xee6017[_0x2d47('0x3c')]=[{'all':!![]}];}_0xee6017=_['merge']({},_0xee6017,_0x4a42ed[_0x2d47('0x3a')]);return db[_0x2d47('0x27')][_0x2d47('0x43')](_0xee6017)[_0x2d47('0x1f')](handleEntityNotFound(_0x3475df,null))[_0x2d47('0x1f')](respondWithResult(_0x3475df,null))[_0x2d47('0x3f')](handleError(_0x3475df,null));};exports[_0x2d47('0x44')]=function(_0x153dde,_0x2e63d3){return db[_0x2d47('0x27')]['create'](_0x153dde[_0x2d47('0x45')],{})[_0x2d47('0x1f')](respondWithResult(_0x2e63d3,0xc9))[_0x2d47('0x3f')](handleError(_0x2e63d3,null));};exports[_0x2d47('0x46')]=function(_0x698a5c,_0x101185){if(_0x698a5c[_0x2d47('0x45')]['id']){delete _0x698a5c[_0x2d47('0x45')]['id'];}return db[_0x2d47('0x27')][_0x2d47('0x43')]({'where':{'id':_0x698a5c['params']['id']}})[_0x2d47('0x1f')](handleEntityNotFound(_0x101185,null))[_0x2d47('0x1f')](saveUpdates(_0x698a5c[_0x2d47('0x45')],null))[_0x2d47('0x1f')](respondWithResult(_0x101185,null))[_0x2d47('0x3f')](handleError(_0x101185,null));};exports[_0x2d47('0x20')]=function(_0x3eba32,_0x8e7f7e){return db[_0x2d47('0x27')][_0x2d47('0x43')]({'where':{'id':_0x3eba32['params']['id']}})['then'](handleEntityNotFound(_0x8e7f7e,null))[_0x2d47('0x1f')](removeEntity(_0x8e7f7e,null))[_0x2d47('0x3f')](handleError(_0x8e7f7e,null));};exports[_0x2d47('0x47')]=function(_0x4a043c,_0x52fcae){return db[_0x2d47('0x27')][_0x2d47('0x47')]()[_0x2d47('0x1f')](respondWithResult(_0x52fcae,null))[_0x2d47('0x3f')](handleError(_0x52fcae,null));}; \ No newline at end of file +var _0x0cb8=['describe','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','OpenchannelTransferReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy'];(function(_0x4c40b4,_0x221ce8){var _0x4c0810=function(_0x348623){while(--_0x348623){_0x4c40b4['push'](_0x4c40b4['shift']());}};_0x4c0810(++_0x221ce8);}(_0x0cb8,0x9b));var _0x80cb=function(_0x3aba7e,_0x18b386){_0x3aba7e=_0x3aba7e-0x0;var _0x39ebcc=_0x0cb8[_0x3aba7e];return _0x39ebcc;};'use strict';var emlformat=require(_0x80cb('0x0'));var rimraf=require(_0x80cb('0x1'));var zipdir=require(_0x80cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x80cb('0x3'));var Mustache=require('mustache');var util=require(_0x80cb('0x4'));var path=require(_0x80cb('0x5'));var sox=require(_0x80cb('0x6'));var csv=require(_0x80cb('0x7'));var ejs=require(_0x80cb('0x8'));var fs=require('fs');var fs_extra=require(_0x80cb('0x9'));var _=require(_0x80cb('0xa'));var squel=require('squel');var crypto=require(_0x80cb('0xb'));var jsforce=require(_0x80cb('0xc'));var deskjs=require(_0x80cb('0xd'));var toCsv=require(_0x80cb('0x7'));var querystring=require(_0x80cb('0xe'));var Papa=require('papaparse');var Redis=require(_0x80cb('0xf'));var authService=require(_0x80cb('0x10'));var qs=require(_0x80cb('0x11'));var as=require(_0x80cb('0x12'));var hardwareService=require(_0x80cb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x80cb('0x14'));var config=require(_0x80cb('0x15'));var licenseUtil=require(_0x80cb('0x16'));var db=require(_0x80cb('0x17'))['db'];function respondWithStatusCode(_0x4efee8,_0x320d33){_0x320d33=_0x320d33||0xcc;return function(_0x3be0eb){if(_0x3be0eb){return _0x4efee8[_0x80cb('0x18')](_0x320d33);}return _0x4efee8[_0x80cb('0x19')](_0x320d33)[_0x80cb('0x1a')]();};}function respondWithResult(_0x231123,_0x3aede2){_0x3aede2=_0x3aede2||0xc8;return function(_0x12fde7){if(_0x12fde7){return _0x231123[_0x80cb('0x19')](_0x3aede2)[_0x80cb('0x1b')](_0x12fde7);}};}function respondWithFilteredResult(_0x478c05,_0x5c4811){return function(_0x31805a){if(_0x31805a){var _0x593d61=typeof _0x5c4811[_0x80cb('0x1c')]===_0x80cb('0x1d')&&typeof _0x5c4811[_0x80cb('0x1e')]===_0x80cb('0x1d');var _0x189e0b=_0x31805a[_0x80cb('0x1f')];var _0x448959=_0x593d61?0x0:_0x5c4811[_0x80cb('0x1c')];var _0x49dd50=_0x593d61?_0x31805a[_0x80cb('0x1f')]:_0x5c4811[_0x80cb('0x1c')]+_0x5c4811[_0x80cb('0x1e')];var _0x34688b;if(_0x49dd50>=_0x189e0b){_0x49dd50=_0x189e0b;_0x34688b=0xc8;}else{_0x34688b=0xce;}_0x478c05['status'](_0x34688b);return _0x478c05[_0x80cb('0x20')](_0x80cb('0x21'),_0x448959+'-'+_0x49dd50+'/'+_0x189e0b)[_0x80cb('0x1b')](_0x31805a);}return null;};}function patchUpdates(_0x45b54d){return function(_0x51a4fc){try{jsonpatch[_0x80cb('0x22')](_0x51a4fc,_0x45b54d,!![]);}catch(_0x418b22){return BPromise[_0x80cb('0x23')](_0x418b22);}return _0x51a4fc[_0x80cb('0x24')]();};}function saveUpdates(_0x3927e9,_0x4cac7b){return function(_0x413137){if(_0x413137){return _0x413137[_0x80cb('0x25')](_0x3927e9)[_0x80cb('0x26')](function(_0x556b1d){return _0x556b1d;});}return null;};}function removeEntity(_0x231b8d,_0x3e8f9d){return function(_0x4287c6){if(_0x4287c6){return _0x4287c6['destroy']()[_0x80cb('0x26')](function(){_0x231b8d[_0x80cb('0x19')](0xcc)[_0x80cb('0x1a')]();});}};}function handleEntityNotFound(_0x19db6f,_0x439f2c){return function(_0x28bb88){if(!_0x28bb88){_0x19db6f[_0x80cb('0x18')](0x194);}return _0x28bb88;};}function handleError(_0x1c8925,_0x417c2c){_0x417c2c=_0x417c2c||0x1f4;return function(_0x1af7e1){logger['error'](_0x1af7e1[_0x80cb('0x27')]);if(_0x1af7e1[_0x80cb('0x28')]){delete _0x1af7e1[_0x80cb('0x28')];}_0x1c8925[_0x80cb('0x19')](_0x417c2c)[_0x80cb('0x29')](_0x1af7e1);};}exports[_0x80cb('0x2a')]=function(_0x3f6287,_0x483ab0){var _0x557922={},_0x36a96d={},_0x403f20={'count':0x0,'rows':[]};var _0x598508=_[_0x80cb('0x2b')](db['OpenchannelTransferReport'][_0x80cb('0x2c')],function(_0x398b7f){return{'name':_0x398b7f[_0x80cb('0x2d')],'type':_0x398b7f[_0x80cb('0x2e')][_0x80cb('0x2f')]};});_0x36a96d[_0x80cb('0x30')]=_[_0x80cb('0x2b')](_0x598508,_0x80cb('0x28'));_0x36a96d['query']=_[_0x80cb('0x31')](_0x3f6287['query']);_0x36a96d[_0x80cb('0x32')]=_[_0x80cb('0x33')](_0x36a96d[_0x80cb('0x30')],_0x36a96d[_0x80cb('0x34')]);_0x557922[_0x80cb('0x35')]=_['intersection'](_0x36a96d[_0x80cb('0x30')],qs[_0x80cb('0x36')](_0x3f6287[_0x80cb('0x34')][_0x80cb('0x36')]));_0x557922[_0x80cb('0x35')]=_0x557922[_0x80cb('0x35')][_0x80cb('0x37')]?_0x557922[_0x80cb('0x35')]:_0x36a96d['model'];if(!_0x3f6287[_0x80cb('0x34')][_0x80cb('0x38')](_0x80cb('0x39'))){_0x557922[_0x80cb('0x1e')]=qs[_0x80cb('0x1e')](_0x3f6287['query'][_0x80cb('0x1e')]);_0x557922[_0x80cb('0x1c')]=qs[_0x80cb('0x1c')](_0x3f6287[_0x80cb('0x34')][_0x80cb('0x1c')]);}_0x557922['order']=qs[_0x80cb('0x3a')](_0x3f6287[_0x80cb('0x34')][_0x80cb('0x3a')]);_0x557922[_0x80cb('0x3b')]=qs[_0x80cb('0x32')](_['pick'](_0x3f6287[_0x80cb('0x34')],_0x36a96d[_0x80cb('0x32')]),_0x598508);if(_0x3f6287[_0x80cb('0x34')][_0x80cb('0x3c')]){_0x557922['where']=_['merge'](_0x557922['where'],{'$or':_[_0x80cb('0x2b')](_0x598508,function(_0x1309bd){if(_0x1309bd[_0x80cb('0x2e')]!==_0x80cb('0x3d')){var _0x1c3b62={};_0x1c3b62[_0x1309bd[_0x80cb('0x28')]]={'$like':'%'+_0x3f6287[_0x80cb('0x34')]['filter']+'%'};return _0x1c3b62;}})});}_0x557922=_[_0x80cb('0x3e')]({},_0x557922,_0x3f6287[_0x80cb('0x3f')]);var _0x2eec62={'where':_0x557922['where']};return db[_0x80cb('0x40')][_0x80cb('0x1f')](_0x2eec62)['then'](function(_0x366880){_0x403f20[_0x80cb('0x1f')]=_0x366880;if(_0x3f6287['query'][_0x80cb('0x41')]){_0x557922['include']=[{'all':!![]}];}return db[_0x80cb('0x40')][_0x80cb('0x42')](_0x557922);})['then'](function(_0x52feb2){_0x403f20[_0x80cb('0x43')]=_0x52feb2;return _0x403f20;})[_0x80cb('0x26')](respondWithFilteredResult(_0x483ab0,_0x557922))[_0x80cb('0x44')](handleError(_0x483ab0,null));};exports[_0x80cb('0x45')]=function(_0x158a76,_0x5cbe73){var _0x51f656={'raw':!![],'where':{'id':_0x158a76[_0x80cb('0x46')]['id']}},_0x393f25={};_0x393f25[_0x80cb('0x30')]=_[_0x80cb('0x31')](db[_0x80cb('0x40')]['rawAttributes']);_0x393f25['query']=_[_0x80cb('0x31')](_0x158a76['query']);_0x393f25[_0x80cb('0x32')]=_[_0x80cb('0x33')](_0x393f25['model'],_0x393f25[_0x80cb('0x34')]);_0x51f656[_0x80cb('0x35')]=_['intersection'](_0x393f25['model'],qs['fields'](_0x158a76[_0x80cb('0x34')][_0x80cb('0x36')]));_0x51f656['attributes']=_0x51f656['attributes'][_0x80cb('0x37')]?_0x51f656['attributes']:_0x393f25['model'];if(_0x158a76[_0x80cb('0x34')]['includeAll']){_0x51f656[_0x80cb('0x47')]=[{'all':!![]}];}_0x51f656=_[_0x80cb('0x3e')]({},_0x51f656,_0x158a76[_0x80cb('0x3f')]);return db['OpenchannelTransferReport'][_0x80cb('0x48')](_0x51f656)[_0x80cb('0x26')](handleEntityNotFound(_0x5cbe73,null))['then'](respondWithResult(_0x5cbe73,null))[_0x80cb('0x44')](handleError(_0x5cbe73,null));};exports[_0x80cb('0x49')]=function(_0x1c3a81,_0xada8d5){return db[_0x80cb('0x40')][_0x80cb('0x49')](_0x1c3a81[_0x80cb('0x4a')],{})[_0x80cb('0x26')](respondWithResult(_0xada8d5,0xc9))['catch'](handleError(_0xada8d5,null));};exports[_0x80cb('0x25')]=function(_0x75ca31,_0x50b4fb){if(_0x75ca31['body']['id']){delete _0x75ca31[_0x80cb('0x4a')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x75ca31[_0x80cb('0x46')]['id']}})[_0x80cb('0x26')](handleEntityNotFound(_0x50b4fb,null))['then'](saveUpdates(_0x75ca31[_0x80cb('0x4a')],null))[_0x80cb('0x26')](respondWithResult(_0x50b4fb,null))[_0x80cb('0x44')](handleError(_0x50b4fb,null));};exports[_0x80cb('0x4b')]=function(_0x3decef,_0x5c35c5){return db['OpenchannelTransferReport'][_0x80cb('0x48')]({'where':{'id':_0x3decef[_0x80cb('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c35c5,null))[_0x80cb('0x26')](removeEntity(_0x5c35c5,null))[_0x80cb('0x44')](handleError(_0x5c35c5,null));};exports[_0x80cb('0x4c')]=function(_0x579b7e,_0x20ede3){return db[_0x80cb('0x40')][_0x80cb('0x4c')]()['then'](respondWithResult(_0x20ede3,null))[_0x80cb('0x44')](handleError(_0x20ede3,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f5dae71..61d01e7 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 _0x6d83=['lodash','util','moment','request-promise','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x34a686,_0x402659){var _0x10c51c=function(_0x1998b1){while(--_0x1998b1){_0x34a686['push'](_0x34a686['shift']());}};_0x10c51c(++_0x402659);}(_0x6d83,0x18c));var _0x36d8=function(_0x325199,_0x333f43){_0x325199=_0x325199-0x0;var _0x408b81=_0x6d83[_0x325199];return _0x408b81;};'use strict';var _=require(_0x36d8('0x0'));var util=require(_0x36d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x36d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x36d8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36d8('0x4'));var config=require('../../config/environment');var attributes=require(_0x36d8('0x5'));module[_0x36d8('0x6')]=function(_0x45b037,_0x2b1c06){return _0x45b037[_0x36d8('0x7')](_0x36d8('0x8'),attributes,{'tableName':_0x36d8('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x36d8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb995=['../../config/environment','define','OpenchannelTransferReport','report_openchannel_transfer','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x1b905d,_0xab52f){var _0x199300=function(_0x237b80){while(--_0x237b80){_0x1b905d['push'](_0x1b905d['shift']());}};_0x199300(++_0xab52f);}(_0xb995,0xcc));var _0x5b99=function(_0x2fe364,_0x37da58){_0x2fe364=_0x2fe364-0x0;var _0x40b49c=_0xb995[_0x2fe364];return _0x40b49c;};'use strict';var _=require('lodash');var util=require(_0x5b99('0x0'));var logger=require(_0x5b99('0x1'))(_0x5b99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b99('0x3'));var fs=require('fs');var path=require(_0x5b99('0x4'));var rimraf=require(_0x5b99('0x5'));var config=require(_0x5b99('0x6'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x40fde0,_0x234bb9){return _0x40fde0[_0x5b99('0x7')](_0x5b99('0x8'),attributes,{'tableName':_0x5b99('0x9'),'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 6ab559f..78ab74f 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 _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39a1ff,_0xb953e9){var _0x5ef27f=function(_0x51f5f8){while(--_0x51f5f8){_0x39a1ff['push'](_0x39a1ff['shift']());}};_0x5ef27f(++_0xb953e9);}(_0x0309,0x165));var _0x9030=function(_0x230397,_0x48aa3c){_0x230397=_0x230397-0x0;var _0x1ae9f9=_0x0309[_0x230397];return _0x1ae9f9;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});} \ No newline at end of file +var _0xc492=['jayson/promise','http','request','then','info','request\x20sent','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc'];(function(_0x5695da,_0x4399fc){var _0xdca67c=function(_0x143ae3){while(--_0x143ae3){_0x5695da['push'](_0x5695da['shift']());}};_0xdca67c(++_0x4399fc);}(_0xc492,0xd7));var _0x2c49=function(_0x5c84ef,_0x3b36cc){_0x5c84ef=_0x5c84ef-0x0;var _0x39cc4c=_0xc492[_0x5c84ef];return _0x39cc4c;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var moment=require(_0x2c49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c49('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2c49('0x4'))(_0x2c49('0x5'));var config=require('../../config/environment');var jayson=require(_0x2c49('0x6'));var client=jayson['client'][_0x2c49('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9c10f7,_0x4c76dd,_0xe7b4cb){return new BPromise(function(_0x17f596,_0x26f8c1){return client[_0x2c49('0x8')](_0x9c10f7,_0xe7b4cb)[_0x2c49('0x9')](function(_0x5684e5){logger[_0x2c49('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c76dd,'request\x20sent');logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4c76dd,_0x2c49('0xb'),JSON['stringify'](_0x5684e5));if(_0x5684e5[_0x2c49('0xc')]){if(_0x5684e5[_0x2c49('0xc')]['code']===0x1f4){logger[_0x2c49('0xc')](_0x2c49('0xd'),_0x4c76dd,_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);return _0x26f8c1(_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);}logger['error'](_0x2c49('0xd'),_0x4c76dd,_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);return _0x17f596(_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);}else{logger['info'](_0x2c49('0xd'),_0x4c76dd,_0x2c49('0xb'));_0x17f596(_0x5684e5[_0x2c49('0xf')][_0x2c49('0xe')]);}})[_0x2c49('0x10')](function(_0x88e972){logger[_0x2c49('0xc')](_0x2c49('0xd'),_0x4c76dd,_0x88e972);_0x26f8c1(_0x88e972);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0e3daab..4851e36 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 _0x78db=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x974954,_0x32d46d){var _0x35c77c=function(_0x1e8574){while(--_0x1e8574){_0x974954['push'](_0x974954['shift']());}};_0x35c77c(++_0x32d46d);}(_0x78db,0xcc));var _0xb78d=function(_0x52bcbd,_0x8dcc55){_0x52bcbd=_0x52bcbd-0x0;var _0x2c4072=_0x78db[_0x52bcbd];return _0x2c4072;};'use strict';var multer=require(_0xb78d('0x0'));var util=require(_0xb78d('0x1'));var path=require(_0xb78d('0x2'));var timeout=require(_0xb78d('0x3'));var express=require(_0xb78d('0x4'));var router=express[_0xb78d('0x5')]();var fs_extra=require(_0xb78d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb78d('0x7'));var config=require(_0xb78d('0x8'));var controller=require('./pause.controller');router[_0xb78d('0x9')]('/',auth['isAuthenticated'](),controller[_0xb78d('0xa')]);router[_0xb78d('0x9')](_0xb78d('0xb'),auth[_0xb78d('0xc')](),controller[_0xb78d('0xd')]);router[_0xb78d('0xe')]('/',auth[_0xb78d('0xc')](),controller['create']);router[_0xb78d('0xf')](_0xb78d('0xb'),auth[_0xb78d('0xc')](),controller[_0xb78d('0x10')]);router[_0xb78d('0x11')](_0xb78d('0xb'),auth[_0xb78d('0xc')](),controller[_0xb78d('0x12')]);module[_0xb78d('0x13')]=router; \ No newline at end of file +var _0xce27=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','util'];(function(_0x53b687,_0x2463da){var _0x410274=function(_0x2de413){while(--_0x2de413){_0x53b687['push'](_0x53b687['shift']());}};_0x410274(++_0x2463da);}(_0xce27,0x1af));var _0x7ce2=function(_0x11d389,_0x50a243){_0x11d389=_0x11d389-0x0;var _0x10a71a=_0xce27[_0x11d389];return _0x10a71a;};'use strict';var multer=require('multer');var util=require(_0x7ce2('0x0'));var path=require(_0x7ce2('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ce2('0x2'));var router=express[_0x7ce2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7ce2('0x4'));var interaction=require(_0x7ce2('0x5'));var config=require(_0x7ce2('0x6'));var controller=require(_0x7ce2('0x7'));router[_0x7ce2('0x8')]('/',auth[_0x7ce2('0x9')](),controller['index']);router[_0x7ce2('0x8')](_0x7ce2('0xa'),auth[_0x7ce2('0x9')](),controller[_0x7ce2('0xb')]);router[_0x7ce2('0xc')]('/',auth[_0x7ce2('0x9')](),controller[_0x7ce2('0xd')]);router['put'](_0x7ce2('0xa'),auth[_0x7ce2('0x9')](),controller[_0x7ce2('0xe')]);router[_0x7ce2('0xf')]('/:id',auth[_0x7ce2('0x9')](),controller[_0x7ce2('0x10')]);module[_0x7ce2('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 56d0827..2c83ab3 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 _0xbac3=['STRING','name','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbac3,0x122));var _0x3bac=function(_0x1fe5f5,_0x171ac6){_0x1fe5f5=_0x1fe5f5-0x0;var _0x4b6d9d=_0xbac3[_0x1fe5f5];return _0x4b6d9d;};'use strict';var Sequelize=require(_0x3bac('0x0'));module[_0x3bac('0x1')]={'name':{'type':Sequelize[_0x3bac('0x2')],'unique':_0x3bac('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf9af=['sequelize','STRING','name'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xf9af,0x171));var _0xff9a=function(_0x78f155,_0x45d9f2){_0x78f155=_0x78f155-0x0;var _0xfeebe4=_0xf9af[_0x78f155];return _0xfeebe4;};'use strict';var Sequelize=require(_0xff9a('0x0'));module['exports']={'name':{'type':Sequelize[_0xff9a('0x1')],'unique':_0xff9a('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index daf91c6..377ef25 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 _0x1960=['catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','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','set','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','Pause','includeAll','findAll','rows'];(function(_0x35e975,_0x552679){var _0x5a7d7b=function(_0x475a1b){while(--_0x475a1b){_0x35e975['push'](_0x35e975['shift']());}};_0x5a7d7b(++_0x552679);}(_0x1960,0x1ac));var _0x0196=function(_0x8a8893,_0x1d0554){_0x8a8893=_0x8a8893-0x0;var _0x40790e=_0x1960[_0x8a8893];return _0x40790e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0196('0x0'));var zipdir=require(_0x0196('0x1'));var jsonpatch=require(_0x0196('0x2'));var rp=require(_0x0196('0x3'));var moment=require('moment');var BPromise=require(_0x0196('0x4'));var Mustache=require(_0x0196('0x5'));var util=require(_0x0196('0x6'));var path=require(_0x0196('0x7'));var sox=require('sox');var csv=require(_0x0196('0x8'));var ejs=require(_0x0196('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0196('0xa'));var squel=require(_0x0196('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0196('0x8'));var querystring=require(_0x0196('0xc'));var Papa=require(_0x0196('0xd'));var Redis=require('ioredis');var authService=require(_0x0196('0xe'));var qs=require(_0x0196('0xf'));var as=require(_0x0196('0x10'));var hardwareService=require(_0x0196('0x11'));var logger=require(_0x0196('0x12'))(_0x0196('0x13'));var utils=require(_0x0196('0x14'));var config=require(_0x0196('0x15'));var licenseUtil=require(_0x0196('0x16'));var db=require(_0x0196('0x17'))['db'];function respondWithStatusCode(_0x5c2877,_0x1cbbe3){_0x1cbbe3=_0x1cbbe3||0xcc;return function(_0x2c2a56){if(_0x2c2a56){return _0x5c2877[_0x0196('0x18')](_0x1cbbe3);}return _0x5c2877[_0x0196('0x19')](_0x1cbbe3)[_0x0196('0x1a')]();};}function respondWithResult(_0x1b8f1b,_0xe4b78f){_0xe4b78f=_0xe4b78f||0xc8;return function(_0x2db071){if(_0x2db071){return _0x1b8f1b[_0x0196('0x19')](_0xe4b78f)[_0x0196('0x1b')](_0x2db071);}};}function respondWithFilteredResult(_0x49c37e,_0x59c1cc){return function(_0x15945a){if(_0x15945a){var _0xff5c9f=typeof _0x59c1cc['offset']==='undefined'&&typeof _0x59c1cc[_0x0196('0x1c')]===_0x0196('0x1d');var _0x1566eb=_0x15945a[_0x0196('0x1e')];var _0x7ba70=_0xff5c9f?0x0:_0x59c1cc['offset'];var _0x4ddd7c=_0xff5c9f?_0x15945a['count']:_0x59c1cc['offset']+_0x59c1cc[_0x0196('0x1c')];var _0xe9d326;if(_0x4ddd7c>=_0x1566eb){_0x4ddd7c=_0x1566eb;_0xe9d326=0xc8;}else{_0xe9d326=0xce;}_0x49c37e[_0x0196('0x19')](_0xe9d326);return _0x49c37e[_0x0196('0x1f')]('Content-Range',_0x7ba70+'-'+_0x4ddd7c+'/'+_0x1566eb)[_0x0196('0x1b')](_0x15945a);}return null;};}function patchUpdates(_0x21cfc2){return function(_0x40924f){try{jsonpatch['apply'](_0x40924f,_0x21cfc2,!![]);}catch(_0x2ca989){return BPromise[_0x0196('0x20')](_0x2ca989);}return _0x40924f[_0x0196('0x21')]();};}function saveUpdates(_0x72158b,_0x30e1a3){return function(_0x534688){if(_0x534688){return _0x534688[_0x0196('0x22')](_0x72158b)[_0x0196('0x23')](function(_0x521d4d){return _0x521d4d;});}return null;};}function removeEntity(_0x22d4b0,_0x79e0a0){return function(_0x3ae949){if(_0x3ae949){return _0x3ae949[_0x0196('0x24')]()['then'](function(){var _0x3335e7=_0x3ae949[_0x0196('0x25')]({'plain':!![]});var _0x1985a4=_0x0196('0x26');return db[_0x0196('0x27')]['destroy']({'where':{'type':_0x1985a4,'resourceId':_0x3335e7['id']}})['then'](function(){return _0x3ae949;});})[_0x0196('0x23')](function(){_0x22d4b0[_0x0196('0x19')](0xcc)[_0x0196('0x1a')]();});}};}function handleEntityNotFound(_0x516678,_0x138e23){return function(_0xf3fcc8){if(!_0xf3fcc8){_0x516678['sendStatus'](0x194);}return _0xf3fcc8;};}function handleError(_0x280d50,_0x142b45){_0x142b45=_0x142b45||0x1f4;return function(_0x1fdd64){logger[_0x0196('0x28')](_0x1fdd64[_0x0196('0x29')]);if(_0x1fdd64[_0x0196('0x2a')]){delete _0x1fdd64[_0x0196('0x2a')];}_0x280d50['status'](_0x142b45)[_0x0196('0x2b')](_0x1fdd64);};}exports[_0x0196('0x2c')]=function(_0x2dae68,_0x59fc2a){var _0x454b1d={},_0x2a4a17={},_0x5a53b0={'count':0x0,'rows':[]};var _0x31dbee=_[_0x0196('0x2d')](db['Pause'][_0x0196('0x2e')],function(_0x235e7f){return{'name':_0x235e7f[_0x0196('0x2f')],'type':_0x235e7f[_0x0196('0x30')][_0x0196('0x31')]};});_0x2a4a17[_0x0196('0x32')]=_[_0x0196('0x2d')](_0x31dbee,_0x0196('0x2a'));_0x2a4a17[_0x0196('0x33')]=_[_0x0196('0x34')](_0x2dae68[_0x0196('0x33')]);_0x2a4a17[_0x0196('0x35')]=_['intersection'](_0x2a4a17[_0x0196('0x32')],_0x2a4a17['query']);_0x454b1d[_0x0196('0x36')]=_[_0x0196('0x37')](_0x2a4a17[_0x0196('0x32')],qs[_0x0196('0x38')](_0x2dae68[_0x0196('0x33')][_0x0196('0x38')]));_0x454b1d[_0x0196('0x36')]=_0x454b1d[_0x0196('0x36')][_0x0196('0x39')]?_0x454b1d[_0x0196('0x36')]:_0x2a4a17['model'];if(!_0x2dae68[_0x0196('0x33')][_0x0196('0x3a')]('nolimit')){_0x454b1d[_0x0196('0x1c')]=qs[_0x0196('0x1c')](_0x2dae68[_0x0196('0x33')][_0x0196('0x1c')]);_0x454b1d['offset']=qs['offset'](_0x2dae68[_0x0196('0x33')]['offset']);}_0x454b1d['order']=qs[_0x0196('0x3b')](_0x2dae68[_0x0196('0x33')][_0x0196('0x3b')]);_0x454b1d['where']=qs['filters'](_[_0x0196('0x3c')](_0x2dae68[_0x0196('0x33')],_0x2a4a17['filters']),_0x31dbee);if(_0x2dae68['query'][_0x0196('0x3d')]){_0x454b1d[_0x0196('0x3e')]=_['merge'](_0x454b1d[_0x0196('0x3e')],{'$or':_[_0x0196('0x2d')](_0x31dbee,function(_0x4c73dd){if(_0x4c73dd['type']!==_0x0196('0x3f')){var _0x1cfc3c={};_0x1cfc3c[_0x4c73dd[_0x0196('0x2a')]]={'$like':'%'+_0x2dae68[_0x0196('0x33')]['filter']+'%'};return _0x1cfc3c;}})});}_0x454b1d=_[_0x0196('0x40')]({},_0x454b1d,_0x2dae68[_0x0196('0x41')]);var _0x25b4bb={'where':_0x454b1d['where']};return db[_0x0196('0x42')][_0x0196('0x1e')](_0x25b4bb)[_0x0196('0x23')](function(_0x2b500d){_0x5a53b0[_0x0196('0x1e')]=_0x2b500d;if(_0x2dae68[_0x0196('0x33')][_0x0196('0x43')]){_0x454b1d['include']=[{'all':!![]}];}return db['Pause'][_0x0196('0x44')](_0x454b1d);})['then'](function(_0x231d90){_0x5a53b0[_0x0196('0x45')]=_0x231d90;return _0x5a53b0;})[_0x0196('0x23')](respondWithFilteredResult(_0x59fc2a,_0x454b1d))[_0x0196('0x46')](handleError(_0x59fc2a,null));};exports[_0x0196('0x47')]=function(_0x12d51f,_0x50113a){var _0x42b9d1={'raw':!![],'where':{'id':_0x12d51f[_0x0196('0x48')]['id']}},_0x466808={};_0x466808[_0x0196('0x32')]=_[_0x0196('0x34')](db[_0x0196('0x42')][_0x0196('0x2e')]);_0x466808[_0x0196('0x33')]=_['keys'](_0x12d51f['query']);_0x466808['filters']=_['intersection'](_0x466808[_0x0196('0x32')],_0x466808[_0x0196('0x33')]);_0x42b9d1[_0x0196('0x36')]=_['intersection'](_0x466808[_0x0196('0x32')],qs['fields'](_0x12d51f[_0x0196('0x33')]['fields']));_0x42b9d1[_0x0196('0x36')]=_0x42b9d1['attributes'][_0x0196('0x39')]?_0x42b9d1[_0x0196('0x36')]:_0x466808['model'];if(_0x12d51f[_0x0196('0x33')]['includeAll']){_0x42b9d1[_0x0196('0x49')]=[{'all':!![]}];}_0x42b9d1=_[_0x0196('0x40')]({},_0x42b9d1,_0x12d51f[_0x0196('0x41')]);return db[_0x0196('0x42')][_0x0196('0x4a')](_0x42b9d1)[_0x0196('0x23')](handleEntityNotFound(_0x50113a,null))['then'](respondWithResult(_0x50113a,null))[_0x0196('0x46')](handleError(_0x50113a,null));};exports[_0x0196('0x4b')]=function(_0x3f8f17,_0x3d3e68){return db['Pause'][_0x0196('0x4b')](_0x3f8f17['body'],{})[_0x0196('0x23')](function(_0x137013){var _0x4031ef=_0x3f8f17[_0x0196('0x4c')]['get']({'plain':!![]});if(!_0x4031ef)throw new Error(_0x0196('0x4d'));if(_0x4031ef[_0x0196('0x4e')]===_0x0196('0x4c')){var _0x4d3ac6=_0x137013[_0x0196('0x25')]({'plain':!![]});var _0x139753=_0x0196('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x139753,'userProfileId':_0x4031ef[_0x0196('0x4f')]},'raw':!![]})[_0x0196('0x23')](function(_0x2ff21e){if(_0x2ff21e&&_0x2ff21e[_0x0196('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d3ac6[_0x0196('0x2a')],'resourceId':_0x4d3ac6['id'],'type':_0x2ff21e[_0x0196('0x2a')],'sectionId':_0x2ff21e['id']},{})['then'](function(){return _0x137013;});}else{return _0x137013;}})['catch'](function(_0x2eeadd){logger[_0x0196('0x28')](_0x0196('0x51'),_0x2eeadd);throw _0x2eeadd;});}return _0x137013;})[_0x0196('0x23')](respondWithResult(_0x3d3e68,0xc9))[_0x0196('0x46')](handleError(_0x3d3e68,null));};exports[_0x0196('0x22')]=function(_0x367487,_0x4568c1){if(_0x367487[_0x0196('0x52')]['id']){delete _0x367487[_0x0196('0x52')]['id'];}return db[_0x0196('0x42')][_0x0196('0x4a')]({'where':{'id':_0x367487[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x4568c1,null))[_0x0196('0x23')](saveUpdates(_0x367487[_0x0196('0x52')],null))[_0x0196('0x23')](respondWithResult(_0x4568c1,null))[_0x0196('0x46')](handleError(_0x4568c1,null));};exports['destroy']=function(_0x9df453,_0x22abde){return db['Pause']['find']({'where':{'id':_0x9df453[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x22abde,null))[_0x0196('0x23')](removeEntity(_0x22abde,null))['catch'](handleError(_0x22abde,null));}; \ No newline at end of file +var _0x5f48=['../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','get','UserProfileResource','destroy','then','error','stack','name','send','index','map','Pause','fieldName','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','merge','type','filter','options','includeAll','include','catch','show','params','keys','rawAttributes','create','body','role','user','Pauses','userProfileId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f48,0x1c5));var _0x85f4=function(_0x5d0060,_0x44d247){_0x5d0060=_0x5d0060-0x0;var _0x17be24=_0x5f48[_0x5d0060];return _0x17be24;};'use strict';var emlformat=require(_0x85f4('0x0'));var rimraf=require(_0x85f4('0x1'));var zipdir=require(_0x85f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85f4('0x3'));var moment=require(_0x85f4('0x4'));var BPromise=require(_0x85f4('0x5'));var Mustache=require(_0x85f4('0x6'));var util=require(_0x85f4('0x7'));var path=require(_0x85f4('0x8'));var sox=require(_0x85f4('0x9'));var csv=require(_0x85f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85f4('0xb'));var _=require(_0x85f4('0xc'));var squel=require('squel');var crypto=require(_0x85f4('0xd'));var jsforce=require(_0x85f4('0xe'));var deskjs=require(_0x85f4('0xf'));var toCsv=require(_0x85f4('0xa'));var querystring=require('querystring');var Papa=require(_0x85f4('0x10'));var Redis=require(_0x85f4('0x11'));var authService=require(_0x85f4('0x12'));var qs=require(_0x85f4('0x13'));var as=require(_0x85f4('0x14'));var hardwareService=require(_0x85f4('0x15'));var logger=require(_0x85f4('0x16'))(_0x85f4('0x17'));var utils=require(_0x85f4('0x18'));var config=require(_0x85f4('0x19'));var licenseUtil=require(_0x85f4('0x1a'));var db=require(_0x85f4('0x1b'))['db'];function respondWithStatusCode(_0x319876,_0x24ec8a){_0x24ec8a=_0x24ec8a||0xcc;return function(_0x352ac9){if(_0x352ac9){return _0x319876[_0x85f4('0x1c')](_0x24ec8a);}return _0x319876[_0x85f4('0x1d')](_0x24ec8a)[_0x85f4('0x1e')]();};}function respondWithResult(_0x23b5ee,_0x1fcb66){_0x1fcb66=_0x1fcb66||0xc8;return function(_0x1f3967){if(_0x1f3967){return _0x23b5ee[_0x85f4('0x1d')](_0x1fcb66)[_0x85f4('0x1f')](_0x1f3967);}};}function respondWithFilteredResult(_0x52c2eb,_0x2c53f7){return function(_0x268530){if(_0x268530){var _0x50e209=typeof _0x2c53f7['offset']===_0x85f4('0x20')&&typeof _0x2c53f7['limit']===_0x85f4('0x20');var _0x4caaa2=_0x268530[_0x85f4('0x21')];var _0x25ddd7=_0x50e209?0x0:_0x2c53f7[_0x85f4('0x22')];var _0x1583c9=_0x50e209?_0x268530[_0x85f4('0x21')]:_0x2c53f7[_0x85f4('0x22')]+_0x2c53f7['limit'];var _0x554dd0;if(_0x1583c9>=_0x4caaa2){_0x1583c9=_0x4caaa2;_0x554dd0=0xc8;}else{_0x554dd0=0xce;}_0x52c2eb[_0x85f4('0x1d')](_0x554dd0);return _0x52c2eb[_0x85f4('0x23')]('Content-Range',_0x25ddd7+'-'+_0x1583c9+'/'+_0x4caaa2)[_0x85f4('0x1f')](_0x268530);}return null;};}function patchUpdates(_0x48217a){return function(_0x41e4e7){try{jsonpatch[_0x85f4('0x24')](_0x41e4e7,_0x48217a,!![]);}catch(_0xd709e1){return BPromise[_0x85f4('0x25')](_0xd709e1);}return _0x41e4e7[_0x85f4('0x26')]();};}function saveUpdates(_0x4ed958,_0x1a5049){return function(_0x590ff1){if(_0x590ff1){return _0x590ff1[_0x85f4('0x27')](_0x4ed958)['then'](function(_0x485e80){return _0x485e80;});}return null;};}function removeEntity(_0x5b885b,_0xbb9b89){return function(_0x3e86bd){if(_0x3e86bd){return _0x3e86bd['destroy']()['then'](function(){var _0x3a1d42=_0x3e86bd[_0x85f4('0x28')]({'plain':!![]});var _0x5c4f99='Pauses';return db[_0x85f4('0x29')][_0x85f4('0x2a')]({'where':{'type':_0x5c4f99,'resourceId':_0x3a1d42['id']}})[_0x85f4('0x2b')](function(){return _0x3e86bd;});})[_0x85f4('0x2b')](function(){_0x5b885b[_0x85f4('0x1d')](0xcc)[_0x85f4('0x1e')]();});}};}function handleEntityNotFound(_0x1141d8,_0x522e92){return function(_0x3a2d85){if(!_0x3a2d85){_0x1141d8[_0x85f4('0x1c')](0x194);}return _0x3a2d85;};}function handleError(_0x30e143,_0x5c54f6){_0x5c54f6=_0x5c54f6||0x1f4;return function(_0x5dee0a){logger[_0x85f4('0x2c')](_0x5dee0a[_0x85f4('0x2d')]);if(_0x5dee0a['name']){delete _0x5dee0a[_0x85f4('0x2e')];}_0x30e143['status'](_0x5c54f6)[_0x85f4('0x2f')](_0x5dee0a);};}exports[_0x85f4('0x30')]=function(_0x16ab1f,_0x2fdee4){var _0x66ebfd={},_0x5dfd6d={},_0x5d56e7={'count':0x0,'rows':[]};var _0x1deb94=_[_0x85f4('0x31')](db[_0x85f4('0x32')]['rawAttributes'],function(_0x27ba16){return{'name':_0x27ba16[_0x85f4('0x33')],'type':_0x27ba16['type']['key']};});_0x5dfd6d['model']=_[_0x85f4('0x31')](_0x1deb94,'name');_0x5dfd6d[_0x85f4('0x34')]=_['keys'](_0x16ab1f[_0x85f4('0x34')]);_0x5dfd6d[_0x85f4('0x35')]=_[_0x85f4('0x36')](_0x5dfd6d[_0x85f4('0x37')],_0x5dfd6d[_0x85f4('0x34')]);_0x66ebfd[_0x85f4('0x38')]=_[_0x85f4('0x36')](_0x5dfd6d[_0x85f4('0x37')],qs[_0x85f4('0x39')](_0x16ab1f[_0x85f4('0x34')][_0x85f4('0x39')]));_0x66ebfd[_0x85f4('0x38')]=_0x66ebfd[_0x85f4('0x38')][_0x85f4('0x3a')]?_0x66ebfd[_0x85f4('0x38')]:_0x5dfd6d[_0x85f4('0x37')];if(!_0x16ab1f[_0x85f4('0x34')]['hasOwnProperty']('nolimit')){_0x66ebfd['limit']=qs['limit'](_0x16ab1f['query'][_0x85f4('0x3b')]);_0x66ebfd[_0x85f4('0x22')]=qs['offset'](_0x16ab1f[_0x85f4('0x34')]['offset']);}_0x66ebfd[_0x85f4('0x3c')]=qs[_0x85f4('0x3d')](_0x16ab1f[_0x85f4('0x34')][_0x85f4('0x3d')]);_0x66ebfd[_0x85f4('0x3e')]=qs[_0x85f4('0x35')](_['pick'](_0x16ab1f[_0x85f4('0x34')],_0x5dfd6d[_0x85f4('0x35')]),_0x1deb94);if(_0x16ab1f[_0x85f4('0x34')]['filter']){_0x66ebfd[_0x85f4('0x3e')]=_[_0x85f4('0x3f')](_0x66ebfd[_0x85f4('0x3e')],{'$or':_[_0x85f4('0x31')](_0x1deb94,function(_0x358f24){if(_0x358f24[_0x85f4('0x40')]!=='VIRTUAL'){var _0x163250={};_0x163250[_0x358f24[_0x85f4('0x2e')]]={'$like':'%'+_0x16ab1f['query'][_0x85f4('0x41')]+'%'};return _0x163250;}})});}_0x66ebfd=_[_0x85f4('0x3f')]({},_0x66ebfd,_0x16ab1f[_0x85f4('0x42')]);var _0x37ffee={'where':_0x66ebfd[_0x85f4('0x3e')]};return db[_0x85f4('0x32')]['count'](_0x37ffee)[_0x85f4('0x2b')](function(_0xcd649d){_0x5d56e7['count']=_0xcd649d;if(_0x16ab1f['query'][_0x85f4('0x43')]){_0x66ebfd[_0x85f4('0x44')]=[{'all':!![]}];}return db[_0x85f4('0x32')]['findAll'](_0x66ebfd);})['then'](function(_0x18ebee){_0x5d56e7['rows']=_0x18ebee;return _0x5d56e7;})['then'](respondWithFilteredResult(_0x2fdee4,_0x66ebfd))[_0x85f4('0x45')](handleError(_0x2fdee4,null));};exports[_0x85f4('0x46')]=function(_0x66cacf,_0xd6b46a){var _0x48119d={'raw':!![],'where':{'id':_0x66cacf[_0x85f4('0x47')]['id']}},_0x35f8ba={};_0x35f8ba[_0x85f4('0x37')]=_[_0x85f4('0x48')](db[_0x85f4('0x32')][_0x85f4('0x49')]);_0x35f8ba[_0x85f4('0x34')]=_['keys'](_0x66cacf['query']);_0x35f8ba[_0x85f4('0x35')]=_[_0x85f4('0x36')](_0x35f8ba[_0x85f4('0x37')],_0x35f8ba[_0x85f4('0x34')]);_0x48119d['attributes']=_[_0x85f4('0x36')](_0x35f8ba[_0x85f4('0x37')],qs[_0x85f4('0x39')](_0x66cacf[_0x85f4('0x34')][_0x85f4('0x39')]));_0x48119d['attributes']=_0x48119d['attributes'][_0x85f4('0x3a')]?_0x48119d[_0x85f4('0x38')]:_0x35f8ba[_0x85f4('0x37')];if(_0x66cacf[_0x85f4('0x34')][_0x85f4('0x43')]){_0x48119d[_0x85f4('0x44')]=[{'all':!![]}];}_0x48119d=_[_0x85f4('0x3f')]({},_0x48119d,_0x66cacf[_0x85f4('0x42')]);return db[_0x85f4('0x32')]['find'](_0x48119d)['then'](handleEntityNotFound(_0xd6b46a,null))[_0x85f4('0x2b')](respondWithResult(_0xd6b46a,null))[_0x85f4('0x45')](handleError(_0xd6b46a,null));};exports[_0x85f4('0x4a')]=function(_0x144343,_0x5f4dbf){return db[_0x85f4('0x32')][_0x85f4('0x4a')](_0x144343[_0x85f4('0x4b')],{})[_0x85f4('0x2b')](function(_0x5501b5){var _0x5c02a4=_0x144343['user'][_0x85f4('0x28')]({'plain':!![]});if(!_0x5c02a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c02a4[_0x85f4('0x4c')]===_0x85f4('0x4d')){var _0x12b827=_0x5501b5[_0x85f4('0x28')]({'plain':!![]});var _0x369c1e=_0x85f4('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x369c1e,'userProfileId':_0x5c02a4[_0x85f4('0x4f')]},'raw':!![]})[_0x85f4('0x2b')](function(_0x28a95c){if(_0x28a95c&&_0x28a95c['autoAssociation']===0x0){return db['UserProfileResource'][_0x85f4('0x4a')]({'name':_0x12b827[_0x85f4('0x2e')],'resourceId':_0x12b827['id'],'type':_0x28a95c[_0x85f4('0x2e')],'sectionId':_0x28a95c['id']},{})['then'](function(){return _0x5501b5;});}else{return _0x5501b5;}})[_0x85f4('0x45')](function(_0x323394){logger[_0x85f4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x323394);throw _0x323394;});}return _0x5501b5;})[_0x85f4('0x2b')](respondWithResult(_0x5f4dbf,0xc9))['catch'](handleError(_0x5f4dbf,null));};exports[_0x85f4('0x27')]=function(_0x35499c,_0x57b03d){if(_0x35499c[_0x85f4('0x4b')]['id']){delete _0x35499c[_0x85f4('0x4b')]['id'];}return db['Pause']['find']({'where':{'id':_0x35499c[_0x85f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x57b03d,null))[_0x85f4('0x2b')](saveUpdates(_0x35499c[_0x85f4('0x4b')],null))[_0x85f4('0x2b')](respondWithResult(_0x57b03d,null))['catch'](handleError(_0x57b03d,null));};exports[_0x85f4('0x2a')]=function(_0x43c529,_0x2fefaf){return db['Pause']['find']({'where':{'id':_0x43c529[_0x85f4('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fefaf,null))[_0x85f4('0x2b')](removeEntity(_0x2fefaf,null))['catch'](handleError(_0x2fefaf,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 7ac9bd4..d5b6b5f 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x5a7d91,_0x429bfc){var _0x2e94bd=function(_0x496b11){while(--_0x496b11){_0x5a7d91['push'](_0x5a7d91['shift']());}};_0x2e94bd(++_0x429bfc);}(_0x814b,0x1a2));var _0xb814=function(_0x38616d,_0x22fbe5){_0x38616d=_0x38616d-0x0;var _0x505626=_0x814b[_0x38616d];return _0x505626;};'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 +var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x3d0be4,_0x349f7e){var _0x287405=function(_0x2e39f1){while(--_0x2e39f1){_0x3d0be4['push'](_0x3d0be4['shift']());}};_0x287405(++_0x349f7e);}(_0xf494,0x1c6));var _0x4f49=function(_0x24afde,_0x4ceff2){_0x24afde=_0x24afde-0x0;var _0x22c69b=_0xf494[_0x24afde];return _0x22c69b;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',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 51badec..3db95e4 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x409ac7,_0x52978c){var _0xe4d96a=function(_0x265fbc){while(--_0x265fbc){_0x409ac7['push'](_0x409ac7['shift']());}};_0xe4d96a(++_0x52978c);}(_0x7a54,0x106));var _0x47a5=function(_0x5b55ca,_0x590bfa){_0x5b55ca=_0x5b55ca-0x0;var _0x1e42f7=_0x7a54[_0x5b55ca];return _0x1e42f7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x208ba9,_0x36b23f){var _0x335560=function(_0xec3e46){while(--_0xec3e46){_0x208ba9['push'](_0x208ba9['shift']());}};_0x335560(++_0x36b23f);}(_0xb10b,0x12a));var _0xbb10=function(_0x18b000,_0x513c1b){_0x18b000=_0x18b000-0x0;var _0xfb7686=_0xb10b[_0x18b000];return _0xfb7686;};'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 aac426a..e4ce8dc 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 _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0xb26201,_0x31c0a4){var _0x15d202=function(_0x16a448){while(--_0x16a448){_0xb26201['push'](_0xb26201['shift']());}};_0x15d202(++_0x31c0a4);}(_0x5c12,0x188));var _0x25c1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x5c12[_0x3070dc];return _0x431489;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router; \ No newline at end of file +var _0x0ba7=['../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','diskStorage','server/files/plugins','originalname','format','basename','extname','now','post','single','file','upload','webhookPost','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3b3fbf,_0x3162d0){var _0x12f896=function(_0x41db8f){while(--_0x41db8f){_0x3b3fbf['push'](_0x3b3fbf['shift']());}};_0x12f896(++_0x3162d0);}(_0x0ba7,0x16d));var _0x70ba=function(_0x2861fa,_0x19a3be){_0x2861fa=_0x2861fa-0x0;var _0x5720a0=_0x0ba7[_0x2861fa];return _0x5720a0;};'use strict';var multer=require(_0x70ba('0x0'));var util=require('util');var path=require(_0x70ba('0x1'));var timeout=require(_0x70ba('0x2'));var express=require(_0x70ba('0x3'));var router=express[_0x70ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x70ba('0x5'));var interaction=require(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var controller=require(_0x70ba('0x8'));router[_0x70ba('0x9')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xb')]);router[_0x70ba('0x9')](_0x70ba('0xc'),controller[_0x70ba('0xd')]);router[_0x70ba('0x9')](_0x70ba('0xe'),auth[_0x70ba('0xa')](),controller[_0x70ba('0xf')]);router[_0x70ba('0x9')]('/:id/download',auth[_0x70ba('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x70ba('0x10')]({'destination':function(_0x258604,_0xfc4de3,_0x3cf8ab){_0x3cf8ab(null,path['join'](config['root'],_0x70ba('0x11')));},'filename':function(_0x4a2c2e,_0xd6580e,_0x5e94c7){_0xd6580e[_0x70ba('0x12')]=_0xd6580e[_0x70ba('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e94c7(null,util[_0x70ba('0x13')]('%s-%s%s',path[_0x70ba('0x14')](_0xd6580e[_0x70ba('0x12')],path[_0x70ba('0x15')](_0xd6580e[_0x70ba('0x12')])),Date[_0x70ba('0x16')](),path[_0x70ba('0x15')](_0xd6580e[_0x70ba('0x12')])));}})});router[_0x70ba('0x17')]('/',upload[_0x70ba('0x18')](_0x70ba('0x19')),controller[_0x70ba('0x1a')]);router[_0x70ba('0x17')](_0x70ba('0xc'),controller[_0x70ba('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70ba('0x1c')]);router[_0x70ba('0x1d')](_0x70ba('0xe'),auth[_0x70ba('0xa')](),controller[_0x70ba('0x1d')]);module[_0x70ba('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4698498..5dccf86 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 _0x651f=['ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','sequelize','exports','STRING'];(function(_0x14691c,_0xe1c878){var _0xbec98=function(_0x100b9e){while(--_0x100b9e){_0x14691c['push'](_0x14691c['shift']());}};_0xbec98(++_0xe1c878);}(_0x651f,0x159));var _0xf651=function(_0x57b04d,_0x1fcb43){_0x57b04d=_0x57b04d-0x0;var _0x4452a7=_0x651f[_0x57b04d];return _0x4452a7;};'use strict';var Sequelize=require(_0xf651('0x0'));module[_0xf651('0x1')]={'name':{'type':Sequelize[_0xf651('0x2')]},'type':{'type':Sequelize[_0xf651('0x3')](_0xf651('0x4'),_0xf651('0x5'))},'description':{'type':Sequelize[_0xf651('0x6')]},'version':{'type':Sequelize[_0xf651('0x6')]},'path':{'type':Sequelize[_0xf651('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xf651('0x7')],'defaultValue':0x0,'comment':_0xf651('0x8')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0xf651('0x9'),_0xf651('0xa'),_0xf651('0xb')),'defaultValue':_0xf651('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xf651('0x2')]},'adminUrl':{'type':Sequelize[_0xf651('0x2')]},'agentUrl':{'type':Sequelize[_0xf651('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf651('0x2')]}}; \ No newline at end of file +var _0x3653=['adminOnly','agentOnly','always','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3653,0x9d));var _0x3365=function(_0x7291bb,_0x51dc64){_0x7291bb=_0x7291bb-0x0;var _0x5bf225=_0x3653[_0x7291bb];return _0x5bf225;};'use strict';var Sequelize=require('sequelize');module[_0x3365('0x0')]={'name':{'type':Sequelize[_0x3365('0x1')]},'type':{'type':Sequelize[_0x3365('0x2')](_0x3365('0x3'),_0x3365('0x4'))},'description':{'type':Sequelize[_0x3365('0x5')]},'version':{'type':Sequelize[_0x3365('0x5')]},'path':{'type':Sequelize[_0x3365('0x1')],'comment':_0x3365('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3365('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x3365('0x8'),_0x3365('0x9'),_0x3365('0xa'),'never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x3365('0x1')]},'adminUrl':{'type':Sequelize[_0x3365('0x1')]},'agentUrl':{'type':Sequelize[_0x3365('0x1')]},'scriptName':{'type':Sequelize[_0x3365('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a158a38..b1227b3 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 _0xa82c=['filters','pick','merge','VIRTUAL','filter','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','path','join','server/files/plugins','format','%s.zip','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','basename','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','extname','root','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','scriptName','scriptPath','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','download','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa82c,0x1be));var _0xca82=function(_0x119485,_0x4c964d){_0x119485=_0x119485-0x0;var _0x4a1fab=_0xa82c[_0x119485];return _0x4a1fab;};'use strict';var emlformat=require(_0xca82('0x0'));var rimraf=require(_0xca82('0x1'));var zipdir=require(_0xca82('0x2'));var jsonpatch=require(_0xca82('0x3'));var rp=require(_0xca82('0x4'));var moment=require(_0xca82('0x5'));var BPromise=require(_0xca82('0x6'));var Mustache=require(_0xca82('0x7'));var util=require(_0xca82('0x8'));var path=require('path');var sox=require(_0xca82('0x9'));var csv=require('to-csv');var ejs=require(_0xca82('0xa'));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(_0xca82('0xb'));var toCsv=require('to-csv');var querystring=require(_0xca82('0xc'));var Papa=require(_0xca82('0xd'));var extract=require(_0xca82('0xe'));var rimraf=require(_0xca82('0x1'));var archiver=require('archiver');var Redis=require(_0xca82('0xf'));var authService=require(_0xca82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xca82('0x11'));var hardwareService=require(_0xca82('0x12'));var logger=require(_0xca82('0x13'))('api');var utils=require(_0xca82('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xca82('0x15'));var db=require(_0xca82('0x16'))['db'];config[_0xca82('0x17')]=_[_0xca82('0x18')](config[_0xca82('0x17')],{'host':_0xca82('0x19'),'port':0x18eb});var socket=require(_0xca82('0x1a'))(new Redis(config[_0xca82('0x17')]));require('./plugin.socket')[_0xca82('0x1b')](socket);function respondWithStatusCode(_0x3ecf7f,_0xc6c4c4){_0xc6c4c4=_0xc6c4c4||0xcc;return function(_0x34f10e){if(_0x34f10e){return _0x3ecf7f[_0xca82('0x1c')](_0xc6c4c4);}return _0x3ecf7f[_0xca82('0x1d')](_0xc6c4c4)['end']();};}function respondWithResult(_0x4d737b,_0x76aa84){_0x76aa84=_0x76aa84||0xc8;return function(_0x36428b){if(_0x36428b){return _0x4d737b[_0xca82('0x1d')](_0x76aa84)[_0xca82('0x1e')](_0x36428b);}};}function respondWithFilteredResult(_0x82f589,_0x41795b){return function(_0x49caef){if(_0x49caef){var _0x13abfd=typeof _0x41795b[_0xca82('0x1f')]==='undefined'&&typeof _0x41795b[_0xca82('0x20')]===_0xca82('0x21');var _0x14dbf1=_0x49caef[_0xca82('0x22')];var _0xebc61f=_0x13abfd?0x0:_0x41795b[_0xca82('0x1f')];var _0x5499a3=_0x13abfd?_0x49caef[_0xca82('0x22')]:_0x41795b[_0xca82('0x1f')]+_0x41795b[_0xca82('0x20')];var _0x3f0db0;if(_0x5499a3>=_0x14dbf1){_0x5499a3=_0x14dbf1;_0x3f0db0=0xc8;}else{_0x3f0db0=0xce;}_0x82f589['status'](_0x3f0db0);return _0x82f589[_0xca82('0x23')](_0xca82('0x24'),_0xebc61f+'-'+_0x5499a3+'/'+_0x14dbf1)[_0xca82('0x1e')](_0x49caef);}return null;};}function patchUpdates(_0x579c69){return function(_0x5a72a0){try{jsonpatch[_0xca82('0x25')](_0x5a72a0,_0x579c69,!![]);}catch(_0x4e7391){return BPromise['reject'](_0x4e7391);}return _0x5a72a0[_0xca82('0x26')]();};}function saveUpdates(_0x51e906,_0x3eb714){return function(_0x5b827a){if(_0x5b827a){return _0x5b827a[_0xca82('0x27')](_0x51e906)[_0xca82('0x28')](function(_0x3ae959){return _0x3ae959;});}return null;};}function removeEntity(_0x59b32f,_0x5819ad){return function(_0x26c20b){if(_0x26c20b){return _0x26c20b[_0xca82('0x29')]()['then'](function(){var _0x5bdebd=_0x26c20b[_0xca82('0x2a')]({'plain':!![]});var _0x403c04=_0xca82('0x2b');return db[_0xca82('0x2c')][_0xca82('0x29')]({'where':{'type':_0x403c04,'resourceId':_0x5bdebd['id']}})['then'](function(){return _0x26c20b;});})[_0xca82('0x28')](function(){_0x59b32f[_0xca82('0x1d')](0xcc)[_0xca82('0x2d')]();});}};}function handleEntityNotFound(_0x249670,_0x38145e){return function(_0x232364){if(!_0x232364){_0x249670[_0xca82('0x1c')](0x194);}return _0x232364;};}function handleError(_0x28a3e3,_0x3938ae){_0x3938ae=_0x3938ae||0x1f4;return function(_0x4b1e80){logger[_0xca82('0x2e')](_0x4b1e80[_0xca82('0x2f')]);if(_0x4b1e80['name']){delete _0x4b1e80[_0xca82('0x30')];}_0x28a3e3[_0xca82('0x1d')](_0x3938ae)[_0xca82('0x31')](_0x4b1e80);};}exports[_0xca82('0x32')]=function(_0x197ffb,_0x330b51){var _0x363d1a={},_0x4dfede={},_0x5f2f88={'count':0x0,'rows':[]};var _0x5affc5=_['map'](db['Plugin'][_0xca82('0x33')],function(_0x3b96c2){return{'name':_0x3b96c2[_0xca82('0x34')],'type':_0x3b96c2[_0xca82('0x35')][_0xca82('0x36')]};});_0x4dfede[_0xca82('0x37')]=_[_0xca82('0x38')](_0x5affc5,'name');_0x4dfede[_0xca82('0x39')]=_[_0xca82('0x3a')](_0x197ffb[_0xca82('0x39')]);_0x4dfede['filters']=_[_0xca82('0x3b')](_0x4dfede[_0xca82('0x37')],_0x4dfede[_0xca82('0x39')]);_0x363d1a['attributes']=_[_0xca82('0x3b')](_0x4dfede['model'],qs[_0xca82('0x3c')](_0x197ffb[_0xca82('0x39')][_0xca82('0x3c')]));_0x363d1a[_0xca82('0x3d')]=_0x363d1a[_0xca82('0x3d')][_0xca82('0x3e')]?_0x363d1a[_0xca82('0x3d')]:_0x4dfede['model'];if(!_0x197ffb[_0xca82('0x39')]['hasOwnProperty'](_0xca82('0x3f'))){_0x363d1a[_0xca82('0x20')]=qs[_0xca82('0x20')](_0x197ffb[_0xca82('0x39')][_0xca82('0x20')]);_0x363d1a[_0xca82('0x1f')]=qs['offset'](_0x197ffb[_0xca82('0x39')][_0xca82('0x1f')]);}_0x363d1a[_0xca82('0x40')]=qs[_0xca82('0x41')](_0x197ffb[_0xca82('0x39')][_0xca82('0x41')]);_0x363d1a[_0xca82('0x42')]=qs[_0xca82('0x43')](_[_0xca82('0x44')](_0x197ffb[_0xca82('0x39')],_0x4dfede[_0xca82('0x43')]),_0x5affc5);if(_0x197ffb[_0xca82('0x39')]['filter']){_0x363d1a['where']=_[_0xca82('0x45')](_0x363d1a['where'],{'$or':_[_0xca82('0x38')](_0x5affc5,function(_0x588a7a){if(_0x588a7a[_0xca82('0x35')]!==_0xca82('0x46')){var _0x75836c={};_0x75836c[_0x588a7a['name']]={'$like':'%'+_0x197ffb[_0xca82('0x39')][_0xca82('0x47')]+'%'};return _0x75836c;}})});}_0x363d1a=_[_0xca82('0x45')]({},_0x363d1a,_0x197ffb[_0xca82('0x48')]);var _0x28961f={'where':_0x363d1a['where']};return db[_0xca82('0x49')][_0xca82('0x22')](_0x28961f)[_0xca82('0x28')](function(_0xe89d96){_0x5f2f88['count']=_0xe89d96;if(_0x197ffb[_0xca82('0x39')][_0xca82('0x4a')]){_0x363d1a[_0xca82('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0xca82('0x4c')](_0x363d1a);})['then'](function(_0x1a261e){_0x5f2f88[_0xca82('0x4d')]=_0x1a261e;return _0x5f2f88;})[_0xca82('0x28')](respondWithFilteredResult(_0x330b51,_0x363d1a))[_0xca82('0x4e')](handleError(_0x330b51,null));};exports[_0xca82('0x4f')]=function(_0x311c1b,_0x31851d){var _0x86e10d={'raw':!![],'where':{'id':_0x311c1b[_0xca82('0x50')]['id']}},_0x3e8e66={};_0x3e8e66[_0xca82('0x37')]=_[_0xca82('0x3a')](db[_0xca82('0x49')][_0xca82('0x33')]);_0x3e8e66[_0xca82('0x39')]=_['keys'](_0x311c1b[_0xca82('0x39')]);_0x3e8e66[_0xca82('0x43')]=_['intersection'](_0x3e8e66[_0xca82('0x37')],_0x3e8e66[_0xca82('0x39')]);_0x86e10d[_0xca82('0x3d')]=_[_0xca82('0x3b')](_0x3e8e66[_0xca82('0x37')],qs[_0xca82('0x3c')](_0x311c1b['query'][_0xca82('0x3c')]));_0x86e10d[_0xca82('0x3d')]=_0x86e10d[_0xca82('0x3d')][_0xca82('0x3e')]?_0x86e10d[_0xca82('0x3d')]:_0x3e8e66[_0xca82('0x37')];if(_0x311c1b[_0xca82('0x39')][_0xca82('0x4a')]){_0x86e10d[_0xca82('0x4b')]=[{'all':!![]}];}_0x86e10d=_[_0xca82('0x45')]({},_0x86e10d,_0x311c1b[_0xca82('0x48')]);return db[_0xca82('0x49')]['find'](_0x86e10d)[_0xca82('0x28')](handleEntityNotFound(_0x31851d,null))[_0xca82('0x28')](respondWithResult(_0x31851d,null))[_0xca82('0x4e')](handleError(_0x31851d,null));};exports['download']=function(_0x3106be,_0x2efa3c,_0x3caa3d){return db[_0xca82('0x49')][_0xca82('0x51')]({'where':{'id':_0x3106be[_0xca82('0x50')]['id']},'attributes':[_0xca82('0x30'),_0xca82('0x52')],'raw':!![]})[_0xca82('0x28')](handleEntityNotFound(_0x2efa3c,null))[_0xca82('0x28')](function(_0x5cd0be){if(_0x5cd0be){var _0x330ad6=path[_0xca82('0x53')](config['root'],_0xca82('0x54'),util[_0xca82('0x55')](_0xca82('0x56'),path['basename'](_0x5cd0be[_0xca82('0x52')])));var _0x24063a=fs['createWriteStream'](_0x330ad6);var _0x28def4=archiver(_0xca82('0x57'),{'zlib':{'level':0x9}});_0x28def4['on'](_0xca82('0x58'),function(_0x82324e){if(_0x82324e[_0xca82('0x59')]===_0xca82('0x5a')){logger[_0xca82('0x2e')](_0x82324e);}else{throw new db['Sequelize'][(_0xca82('0x5b'))](_0xca82('0x5c'));}});_0x28def4['on'](_0xca82('0x2e'),function(_0x3b86d9){throw new db[(_0xca82('0x5d'))][(_0xca82('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x28def4[_0xca82('0x5e')](_0x24063a);_0x28def4[_0xca82('0x5f')](_0xca82('0x60'),{'cwd':path['join'](config['root'],_0xca82('0x54'),path[_0xca82('0x61')](_0x5cd0be['path'])),'ignore':[path[_0xca82('0x53')](path[_0xca82('0x62')](_0x5cd0be['path']),_0xca82('0x63')),path[_0xca82('0x53')](path[_0xca82('0x62')](_0x5cd0be[_0xca82('0x52')]),'attachments/**/*')],'nodir':!![]})[_0xca82('0x64')]();_0x24063a['on']('close',function(){if(!fs[_0xca82('0x65')](_0x330ad6)){throw new db[(_0xca82('0x5d'))][(_0xca82('0x5b'))](_0xca82('0x66'));}return _0x2efa3c['download'](_0x330ad6,util[_0xca82('0x55')](_0xca82('0x56'),path[_0xca82('0x62')](_0x5cd0be[_0xca82('0x52')])),function(_0x56200c){if(_0x56200c){throw new db[(_0xca82('0x5d'))]['Error'](_0xca82('0x67'));}fs['unlinkSync'](_0x330ad6);logger[_0xca82('0x68')](_0xca82('0x69'));logger[_0xca82('0x68')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x2efa3c,null));};exports[_0xca82('0x6a')]=function(_0x173294,_0xbb999,_0x33f8ab){var _0x37dcb9=path['basename'](_0x173294[_0xca82('0x6b')][_0xca82('0x6c')],path[_0xca82('0x6d')](_0x173294[_0xca82('0x6b')][_0xca82('0x6c')]));var _0x5da378=path['join'](config[_0xca82('0x6e')],'server/files/plugins',_0x173294[_0xca82('0x6b')][_0xca82('0x6c')]);var _0x108ba0=path['join'](config[_0xca82('0x6e')],_0xca82('0x54'),_0x37dcb9);logger[_0xca82('0x68')](_0xca82('0x6f'),_0x5da378);logger[_0xca82('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x108ba0);try{fs[_0xca82('0x70')](_0x5da378,parseInt(_0xca82('0x71'),0x8));extract(_0x5da378,{'dir':_0x108ba0},function(_0x13c49b){if(_0x13c49b){logger[_0xca82('0x2e')](_0x13c49b);handleError(_0x13c49b,!![]);};var _0x354cd0=fs[_0xca82('0x72')](_0x108ba0);if(_0x354cd0[_0xca82('0x3e')]>0x1){removeReferences(_0x5da378,_0x108ba0);logger[_0xca82('0x2e')](_0xca82('0x73'));return _0x33f8ab(new Error(_0xca82('0x73')));}var _0x2cb83b=fs[_0xca82('0x74')](path[_0xca82('0x53')](_0x108ba0,_0x354cd0[0x0]));if(_0x2cb83b[_0xca82('0x75')]()){removeReferences(_0x5da378,_0x108ba0);logger[_0xca82('0x2e')](_0xca82('0x73'));return _0x33f8ab(new Error('Invalid\x20plugin\x20structure'));}if(_0x2cb83b[_0xca82('0x76')]()){var _0x20f255=fs[_0xca82('0x72')](path[_0xca82('0x53')](_0x108ba0,_0x354cd0[0x0]));if(_0x20f255[_0xca82('0x3e')]===0x0){removeReferences(_0x5da378,_0x108ba0);logger[_0xca82('0x2e')](_0xca82('0x73'));return _0x33f8ab(new Error(_0xca82('0x73')));}var _0x171874=_0x20f255[_0xca82('0x77')](function(_0xd565ca){return _0xd565ca===_0xca82('0x78');});if(!_0x171874){return _0x33f8ab(new Error(_0xca82('0x79')));}var _0x3e35d2=fs[_0xca82('0x7a')](path['join'](_0x108ba0,_0x354cd0[0x0],_0xca82('0x78')));var _0x5757f8=JSON['parse'](_0x3e35d2);if(_0xca82('0x21')==typeof _0x5757f8[_0xca82('0x30')]){return _0x33f8ab(new Error(_0xca82('0x7b')));}if('undefined'==typeof _0x5757f8[_0xca82('0x35')]){return _0x33f8ab(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xca82('0x21')==typeof _0x5757f8[_0xca82('0x7c')]){return _0x33f8ab(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x5757f8['parameters']){return _0x33f8ab(new Error(_0xca82('0x7d')));}if(_0x5757f8['type']===_0xca82('0x7e')){if('undefined'==typeof _0x5757f8[_0xca82('0x7f')]['views']){return _0x33f8ab(new Error(_0xca82('0x80')));}if('undefined'==typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')][_0xca82('0x82')]&&_0xca82('0x21')==typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['agent']){return _0x33f8ab(new Error(_0xca82('0x83')));}}else if(_0x5757f8[_0xca82('0x35')]===_0xca82('0x84')){if(_0xca82('0x21')==typeof _0x5757f8[_0xca82('0x7f')]['scriptName']){return _0x33f8ab(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xca82('0x21')==typeof _0x5757f8[_0xca82('0x7f')]['scriptPath']){return _0x33f8ab(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x33f8ab(new Error(_0xca82('0x85')));}var _0x384b79=_0x5757f8[_0xca82('0x30')];var _0x146f9c=_0x5757f8[_0xca82('0x86')];var _0x4f68df=_0x5757f8[_0xca82('0x35')];var _0x24519f=_0x5757f8['sidebar']?_0x5757f8[_0xca82('0x87')]:_0xca82('0x88');var _0x1f2700=_0x5757f8[_0xca82('0x89')]?_0x5757f8[_0xca82('0x89')]:_0xca82('0x8a');var _0xfc0adb='';var _0x32a307='';var _0x5d9d65='';var _0x39c2c8='';var _0x52fe3d=_0x5757f8[_0xca82('0x7c')];if(_0x4f68df==='html'){if('undefined'!=typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['admin']){var _0x47b97a=_0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x47b97a)){_0xfc0adb=path[_0xca82('0x53')](_0xca82('0x8b'),_0x37dcb9,_0x354cd0[0x0],_0x47b97a);}else{_0xfc0adb=_0x47b97a;}}else{logger[_0xca82('0x68')](_0xca82('0x8c'));}if(_0xca82('0x21')!=typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')][_0xca82('0x8d')]){var _0x8892dc=_0x5757f8['parameters']['views'][_0xca82('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xca82('0x8e')](_0x8892dc)){_0x32a307=path[_0xca82('0x53')](_0xca82('0x8b'),_0x37dcb9,_0x354cd0[0x0],_0x8892dc);}else{_0x32a307=_0x8892dc;}}else{logger[_0xca82('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4f68df===_0xca82('0x84')){_0x5d9d65=_0x5757f8[_0xca82('0x7f')][_0xca82('0x8f')];_0x39c2c8=_0x5757f8['parameters'][_0xca82('0x90')];if(_0xca82('0x21')!=typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]){if(_0xca82('0x21')!=typeof _0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['admin']){var _0x47b97a=_0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x47b97a)){_0xfc0adb=path[_0xca82('0x53')]('plugins',_0x37dcb9,_0x354cd0[0x0],_0x47b97a);}else{_0xfc0adb=_0x47b97a;}}if(_0xca82('0x21')!=typeof _0x5757f8['parameters']['views'][_0xca82('0x8d')]){var _0x8892dc=_0x5757f8[_0xca82('0x7f')][_0xca82('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x8892dc)){_0x32a307=path[_0xca82('0x53')](_0xca82('0x8b'),_0x37dcb9,_0x354cd0[0x0],_0x8892dc);}else{_0x32a307=_0x8892dc;}}}}var _0x2ce9b7={'name':_0x384b79,'description':_0x146f9c,'path':path[_0xca82('0x53')](_0x37dcb9,_0x354cd0[0x0]),'type':_0x4f68df,'sidebar':_0x24519f,'icon':_0x1f2700,'adminUrl':_0xfc0adb,'agentUrl':_0x32a307,'scriptName':_0x5d9d65,'scriptPath':_0x39c2c8,'version':_0x52fe3d};removeReferences(_0x5da378,null);return db['Plugin']['create'](_0x2ce9b7)[_0xca82('0x28')](function(_0x52c86b){var _0x487f97={'role':_0x173294[_0xca82('0x91')]['role'],'userProfileId':_0x173294['body'][_0xca82('0x92')]};if(!_0x487f97)throw new Error(_0xca82('0x93'));if(_0x487f97['role']===_0xca82('0x94')){var _0x310106=_0x52c86b[_0xca82('0x2a')]({'plain':!![]});return db[_0xca82('0x95')]['find']({'where':{'name':_0xca82('0x2b'),'userProfileId':_0x487f97[_0xca82('0x92')]},'raw':!![]})[_0xca82('0x28')](function(_0x430ca1){if(_0x430ca1&&_0x430ca1[_0xca82('0x96')]===0x0){return db[_0xca82('0x2c')][_0xca82('0x97')]({'name':_0x310106[_0xca82('0x30')],'resourceId':_0x310106['id'],'type':_0x430ca1[_0xca82('0x30')],'sectionId':_0x430ca1['id']},{})['then'](function(){return _0x52c86b;});}else{return _0x52c86b;}})[_0xca82('0x4e')](function(_0x1a787b){logger[_0xca82('0x2e')](_0xca82('0x98'),_0x1a787b);throw _0x1a787b;});}return _0x52c86b;})[_0xca82('0x28')](respondWithResult(_0xbb999,null))[_0xca82('0x4e')](handleError(_0xbb999,null));}});}catch(_0x4bb6d8){_0xbb999['status'](0x1f4)[_0xca82('0x31')](_0x4bb6d8);}};function removeReferences(_0x532321,_0x440e76){try{if(_0x532321){fs['unlinkSync'](_0x532321);logger[_0xca82('0x68')](_0xca82('0x99'));}if(_0x440e76){rimraf(_0x440e76,function(){});logger['info'](_0xca82('0x9a'));}}catch(_0x282e8f){logger[_0xca82('0x2e')](_0x282e8f);}}exports[_0xca82('0x27')]=function(_0x1d2f3b,_0x55e297,_0x8832a3){return db[_0xca82('0x49')][_0xca82('0x51')]({'where':{'id':_0x1d2f3b[_0xca82('0x50')]['id']}})[_0xca82('0x28')](handleEntityNotFound(_0x55e297,null))['then'](saveUpdates(_0x1d2f3b[_0xca82('0x91')],null))[_0xca82('0x28')](respondWithResult(_0x55e297,null))['catch'](handleError(_0x55e297,null));};exports['delete']=function(_0x419563,_0x1b1fb4,_0x1e1e01){return db['Plugin']['find']({'where':{'id':_0x419563[_0xca82('0x50')]['id']}})['then'](function(_0x40a191){if(_0x40a191){return _0x40a191[_0xca82('0x29')]();}})[_0xca82('0x28')](function(_0x33d989){rimraf(path[_0xca82('0x53')](config[_0xca82('0x6e')],_0xca82('0x54'),path[_0xca82('0x61')](_0x33d989['path'])),function(){});return _0x33d989;})[_0xca82('0x28')](handleEntityNotFound(_0x1b1fb4,null))['then'](respondWithStatusCode(_0x1b1fb4,null))[_0xca82('0x4e')](handleError(_0x1b1fb4,null));};exports[_0xca82('0x9b')]=function(_0x5a11e3,_0x1ee879,_0x5d8591){return BPromise[_0xca82('0x9c')]()[_0xca82('0x28')](function(){if(!_0x5a11e3['query'][_0xca82('0x52')]){throw new Error(_0xca82('0x9d'));}if(!_0x5a11e3[_0xca82('0x39')][_0xca82('0x9e')]){throw new Error(_0xca82('0x9f'));}var _0x2904cb=_0x5a11e3[_0xca82('0x39')]['hostname']?_0x5a11e3[_0xca82('0x39')][_0xca82('0xa0')]+':'+_0x5a11e3[_0xca82('0x39')][_0xca82('0x9e')]:_0xca82('0xa1')+_0x5a11e3['query'][_0xca82('0x9e')];var _0x1d2394=_0x5a11e3['query']['json']?_0x5a11e3[_0xca82('0x39')]['json']:!![];var _0xb82bc2=_0x5a11e3[_0xca82('0x39')][_0xca82('0xa2')]?_0x5a11e3['query'][_0xca82('0xa2')]:null;var _0x5ec7fd={'method':_0x5a11e3[_0xca82('0xa3')],'uri':util['format'](_0xca82('0xa4'),_0x2904cb,_0x5a11e3['query'][_0xca82('0x52')]),'json':_0x1d2394,'resolveWithFullResponse':!![],'encoding':_0xb82bc2,'qs':_0x5a11e3[_0xca82('0x39')]};if(_0x5a11e3[_0xca82('0xa5')]){_0x5ec7fd[_0xca82('0xa5')]=_0x5a11e3['headers'];if(_0x5ec7fd[_0xca82('0xa5')][_0xca82('0xa6')]){delete _0x5ec7fd['headers'][_0xca82('0xa6')];}}if(_0x5ec7fd[_0xca82('0xa5')][_0xca82('0xa7')]){delete _0x5ec7fd['headers'][_0xca82('0xa7')];}return rp(_0x5ec7fd);})['then'](function(_0x478b5d){if(_0x478b5d){_0x1ee879['set'](_0x478b5d[_0xca82('0xa5')]);logger[_0xca82('0x68')](_0x478b5d[_0xca82('0x91')]);if(_['endsWith'](_0x5a11e3[_0xca82('0x39')][_0xca82('0x52')],_0xca82('0xa8'))&&_0x478b5d[_0xca82('0xa9')]==0x1f4){return _0x1ee879[_0xca82('0x1c')](_0x478b5d[_0xca82('0xa9')]);}else{return _0x1ee879['status'](_0x478b5d[_0xca82('0xa9')])['send'](_0x478b5d['body']);}}else{return _0x1ee879[_0xca82('0x1c')](0xc8);}})[_0xca82('0x4e')](handleError(_0x1ee879,null));};exports[_0xca82('0xaa')]=function(_0x2f5946,_0x2c580d,_0xcb06b0){return BPromise[_0xca82('0x9c')]()['then'](function(){if(!_0x2f5946[_0xca82('0x39')]['path']){throw new Error(_0xca82('0x9d'));}if(!_0x2f5946[_0xca82('0x39')][_0xca82('0x9e')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x40a268=_0x2f5946[_0xca82('0x39')][_0xca82('0xa0')]?_0x2f5946[_0xca82('0x39')][_0xca82('0xa0')]+':'+_0x2f5946[_0xca82('0x39')][_0xca82('0x9e')]:_0xca82('0xa1')+_0x2f5946['query'][_0xca82('0x9e')];var _0x3fbf65=_0x2f5946[_0xca82('0x39')][_0xca82('0x1e')]?_0x2f5946['query'][_0xca82('0x1e')]:!![];var _0x12db75=_0x2f5946['query'][_0xca82('0xa2')]?_0x2f5946[_0xca82('0x39')]['encoding']:null;var _0x39811b={'method':_0x2f5946[_0xca82('0xa3')],'uri':util['format']('%s%s',_0x40a268,_0x2f5946[_0xca82('0x39')]['path']),'json':_0x3fbf65,'resolveWithFullResponse':!![],'encoding':_0x12db75,'body':_0x2f5946[_0xca82('0x91')]};if(_0x2f5946[_0xca82('0xa5')]){_0x39811b[_0xca82('0xa5')]=_0x2f5946[_0xca82('0xa5')];if(_0x39811b[_0xca82('0xa5')][_0xca82('0xa6')]){delete _0x39811b[_0xca82('0xa5')][_0xca82('0xa6')];}}if(_0x39811b[_0xca82('0xa5')][_0xca82('0xa7')]){delete _0x39811b['headers'][_0xca82('0xa7')];}return rp(_0x39811b);})['then'](function(_0x36d401){if(_0x36d401){_0x2c580d[_0xca82('0x23')](_0x36d401[_0xca82('0xa5')]);logger[_0xca82('0x68')](_0x36d401[_0xca82('0x91')]);return _0x2c580d['status'](_0x36d401['statusCode'])[_0xca82('0x31')](_0x36d401['body']);}else{return _0x2c580d[_0xca82('0x1c')](0xc8);}})['catch'](handleError(_0x2c580d,null));}; \ No newline at end of file +var _0x5a41=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','catch','show','params','keys','options','find','download','join','root','server/files/plugins','format','createWriteStream','zip','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','node_modules/**/*','basename','attachments/**/*','finalize','existsSync','Error','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','upload','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','scriptName','scriptPath','description','sidebar','always','icon','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','destroy','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','hostname','method','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query'];(function(_0x16e8d5,_0x44029a){var _0x10658a=function(_0x127dee){while(--_0x127dee){_0x16e8d5['push'](_0x16e8d5['shift']());}};_0x10658a(++_0x44029a);}(_0x5a41,0x68));var _0x15a4=function(_0x396b44,_0x53777a){_0x396b44=_0x396b44-0x0;var _0x170b96=_0x5a41[_0x396b44];return _0x170b96;};'use strict';var emlformat=require(_0x15a4('0x0'));var rimraf=require(_0x15a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15a4('0x2'));var BPromise=require(_0x15a4('0x3'));var Mustache=require('mustache');var util=require(_0x15a4('0x4'));var path=require(_0x15a4('0x5'));var sox=require(_0x15a4('0x6'));var csv=require(_0x15a4('0x7'));var ejs=require(_0x15a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15a4('0x9'));var squel=require(_0x15a4('0xa'));var crypto=require('crypto');var jsforce=require(_0x15a4('0xb'));var deskjs=require(_0x15a4('0xc'));var toCsv=require(_0x15a4('0x7'));var querystring=require(_0x15a4('0xd'));var Papa=require(_0x15a4('0xe'));var extract=require(_0x15a4('0xf'));var rimraf=require(_0x15a4('0x1'));var archiver=require('archiver');var Redis=require(_0x15a4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x15a4('0x11'))(_0x15a4('0x12'));var utils=require(_0x15a4('0x13'));var config=require(_0x15a4('0x14'));var licenseUtil=require(_0x15a4('0x15'));var db=require(_0x15a4('0x16'))['db'];config['redis']=_[_0x15a4('0x17')](config[_0x15a4('0x18')],{'host':_0x15a4('0x19'),'port':0x18eb});var socket=require(_0x15a4('0x1a'))(new Redis(config[_0x15a4('0x18')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x251e00,_0x3bfe31){_0x3bfe31=_0x3bfe31||0xcc;return function(_0x53594a){if(_0x53594a){return _0x251e00[_0x15a4('0x1b')](_0x3bfe31);}return _0x251e00[_0x15a4('0x1c')](_0x3bfe31)[_0x15a4('0x1d')]();};}function respondWithResult(_0x1744ce,_0x5409da){_0x5409da=_0x5409da||0xc8;return function(_0x29613b){if(_0x29613b){return _0x1744ce['status'](_0x5409da)[_0x15a4('0x1e')](_0x29613b);}};}function respondWithFilteredResult(_0x5510b6,_0x14cb93){return function(_0x14f059){if(_0x14f059){var _0x585652=typeof _0x14cb93[_0x15a4('0x1f')]===_0x15a4('0x20')&&typeof _0x14cb93[_0x15a4('0x21')]===_0x15a4('0x20');var _0x343ddb=_0x14f059['count'];var _0x6cbd72=_0x585652?0x0:_0x14cb93[_0x15a4('0x1f')];var _0x277158=_0x585652?_0x14f059[_0x15a4('0x22')]:_0x14cb93['offset']+_0x14cb93[_0x15a4('0x21')];var _0x78bb51;if(_0x277158>=_0x343ddb){_0x277158=_0x343ddb;_0x78bb51=0xc8;}else{_0x78bb51=0xce;}_0x5510b6[_0x15a4('0x1c')](_0x78bb51);return _0x5510b6[_0x15a4('0x23')]('Content-Range',_0x6cbd72+'-'+_0x277158+'/'+_0x343ddb)[_0x15a4('0x1e')](_0x14f059);}return null;};}function patchUpdates(_0xd2adcb){return function(_0x5b42bb){try{jsonpatch[_0x15a4('0x24')](_0x5b42bb,_0xd2adcb,!![]);}catch(_0x1704b2){return BPromise['reject'](_0x1704b2);}return _0x5b42bb[_0x15a4('0x25')]();};}function saveUpdates(_0x4df5a3,_0x1d1b8b){return function(_0x33338e){if(_0x33338e){return _0x33338e['update'](_0x4df5a3)[_0x15a4('0x26')](function(_0x4b250a){return _0x4b250a;});}return null;};}function removeEntity(_0x3243f2,_0x4d6eea){return function(_0x224f21){if(_0x224f21){return _0x224f21['destroy']()[_0x15a4('0x26')](function(){var _0x2d7464=_0x224f21[_0x15a4('0x27')]({'plain':!![]});var _0x453f9c=_0x15a4('0x28');return db[_0x15a4('0x29')]['destroy']({'where':{'type':_0x453f9c,'resourceId':_0x2d7464['id']}})[_0x15a4('0x26')](function(){return _0x224f21;});})[_0x15a4('0x26')](function(){_0x3243f2[_0x15a4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382850,_0x3dfaa3){return function(_0x4e5c33){if(!_0x4e5c33){_0x382850[_0x15a4('0x1b')](0x194);}return _0x4e5c33;};}function handleError(_0x9fd35f,_0x1255df){_0x1255df=_0x1255df||0x1f4;return function(_0x450cc9){logger[_0x15a4('0x2a')](_0x450cc9[_0x15a4('0x2b')]);if(_0x450cc9[_0x15a4('0x2c')]){delete _0x450cc9['name'];}_0x9fd35f['status'](_0x1255df)[_0x15a4('0x2d')](_0x450cc9);};}exports[_0x15a4('0x2e')]=function(_0x5cb7d5,_0x5a4588){var _0x4b343f={},_0x3dae08={},_0x5051ce={'count':0x0,'rows':[]};var _0x6b0713=_[_0x15a4('0x2f')](db[_0x15a4('0x30')][_0x15a4('0x31')],function(_0x1cac6a){return{'name':_0x1cac6a[_0x15a4('0x32')],'type':_0x1cac6a[_0x15a4('0x33')][_0x15a4('0x34')]};});_0x3dae08[_0x15a4('0x35')]=_[_0x15a4('0x2f')](_0x6b0713,'name');_0x3dae08[_0x15a4('0x36')]=_['keys'](_0x5cb7d5[_0x15a4('0x36')]);_0x3dae08['filters']=_[_0x15a4('0x37')](_0x3dae08[_0x15a4('0x35')],_0x3dae08[_0x15a4('0x36')]);_0x4b343f['attributes']=_[_0x15a4('0x37')](_0x3dae08[_0x15a4('0x35')],qs[_0x15a4('0x38')](_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x38')]));_0x4b343f['attributes']=_0x4b343f[_0x15a4('0x39')][_0x15a4('0x3a')]?_0x4b343f[_0x15a4('0x39')]:_0x3dae08[_0x15a4('0x35')];if(!_0x5cb7d5['query'][_0x15a4('0x3b')]('nolimit')){_0x4b343f['limit']=qs[_0x15a4('0x21')](_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x21')]);_0x4b343f[_0x15a4('0x1f')]=qs[_0x15a4('0x1f')](_0x5cb7d5[_0x15a4('0x36')]['offset']);}_0x4b343f[_0x15a4('0x3c')]=qs[_0x15a4('0x3d')](_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x3d')]);_0x4b343f[_0x15a4('0x3e')]=qs[_0x15a4('0x3f')](_[_0x15a4('0x40')](_0x5cb7d5[_0x15a4('0x36')],_0x3dae08[_0x15a4('0x3f')]),_0x6b0713);if(_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x41')]){_0x4b343f[_0x15a4('0x3e')]=_['merge'](_0x4b343f[_0x15a4('0x3e')],{'$or':_[_0x15a4('0x2f')](_0x6b0713,function(_0x3146ef){if(_0x3146ef[_0x15a4('0x33')]!=='VIRTUAL'){var _0x16dbb8={};_0x16dbb8[_0x3146ef[_0x15a4('0x2c')]]={'$like':'%'+_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x41')]+'%'};return _0x16dbb8;}})});}_0x4b343f=_[_0x15a4('0x42')]({},_0x4b343f,_0x5cb7d5['options']);var _0x36e239={'where':_0x4b343f[_0x15a4('0x3e')]};return db[_0x15a4('0x30')][_0x15a4('0x22')](_0x36e239)['then'](function(_0x4cb8fe){_0x5051ce[_0x15a4('0x22')]=_0x4cb8fe;if(_0x5cb7d5[_0x15a4('0x36')][_0x15a4('0x43')]){_0x4b343f[_0x15a4('0x44')]=[{'all':!![]}];}return db[_0x15a4('0x30')]['findAll'](_0x4b343f);})['then'](function(_0x5ae0a){_0x5051ce['rows']=_0x5ae0a;return _0x5051ce;})['then'](respondWithFilteredResult(_0x5a4588,_0x4b343f))[_0x15a4('0x45')](handleError(_0x5a4588,null));};exports[_0x15a4('0x46')]=function(_0x3f5586,_0x455d2e){var _0x13dda3={'raw':!![],'where':{'id':_0x3f5586[_0x15a4('0x47')]['id']}},_0x15931b={};_0x15931b['model']=_[_0x15a4('0x48')](db[_0x15a4('0x30')][_0x15a4('0x31')]);_0x15931b['query']=_[_0x15a4('0x48')](_0x3f5586[_0x15a4('0x36')]);_0x15931b[_0x15a4('0x3f')]=_['intersection'](_0x15931b[_0x15a4('0x35')],_0x15931b[_0x15a4('0x36')]);_0x13dda3['attributes']=_[_0x15a4('0x37')](_0x15931b[_0x15a4('0x35')],qs[_0x15a4('0x38')](_0x3f5586[_0x15a4('0x36')][_0x15a4('0x38')]));_0x13dda3[_0x15a4('0x39')]=_0x13dda3['attributes']['length']?_0x13dda3['attributes']:_0x15931b['model'];if(_0x3f5586[_0x15a4('0x36')]['includeAll']){_0x13dda3[_0x15a4('0x44')]=[{'all':!![]}];}_0x13dda3=_[_0x15a4('0x42')]({},_0x13dda3,_0x3f5586[_0x15a4('0x49')]);return db[_0x15a4('0x30')][_0x15a4('0x4a')](_0x13dda3)['then'](handleEntityNotFound(_0x455d2e,null))[_0x15a4('0x26')](respondWithResult(_0x455d2e,null))[_0x15a4('0x45')](handleError(_0x455d2e,null));};exports[_0x15a4('0x4b')]=function(_0x47ab1a,_0x23a427,_0x5f4f5a){return db[_0x15a4('0x30')][_0x15a4('0x4a')]({'where':{'id':_0x47ab1a['params']['id']},'attributes':[_0x15a4('0x2c'),_0x15a4('0x5')],'raw':!![]})[_0x15a4('0x26')](handleEntityNotFound(_0x23a427,null))[_0x15a4('0x26')](function(_0x3bced6){if(_0x3bced6){var _0xc7bc93=path[_0x15a4('0x4c')](config[_0x15a4('0x4d')],_0x15a4('0x4e'),util[_0x15a4('0x4f')]('%s.zip',path['basename'](_0x3bced6[_0x15a4('0x5')])));var _0x5068e7=fs[_0x15a4('0x50')](_0xc7bc93);var _0x48970b=archiver(_0x15a4('0x51'),{'zlib':{'level':0x9}});_0x48970b['on']('warning',function(_0x362b07){if(_0x362b07[_0x15a4('0x52')]===_0x15a4('0x53')){logger[_0x15a4('0x2a')](_0x362b07);}else{throw new db['Sequelize']['Error'](_0x15a4('0x54'));}});_0x48970b['on'](_0x15a4('0x2a'),function(_0x42bb10){throw new db[(_0x15a4('0x55'))]['Error'](_0x15a4('0x54'));});_0x48970b[_0x15a4('0x56')](_0x5068e7);_0x48970b[_0x15a4('0x57')]('**/*',{'cwd':path[_0x15a4('0x4c')](config['root'],_0x15a4('0x4e'),path[_0x15a4('0x58')](_0x3bced6[_0x15a4('0x5')])),'ignore':[path[_0x15a4('0x4c')](path['basename'](_0x3bced6[_0x15a4('0x5')]),_0x15a4('0x59')),path[_0x15a4('0x4c')](path[_0x15a4('0x5a')](_0x3bced6[_0x15a4('0x5')]),_0x15a4('0x5b'))],'nodir':!![]})[_0x15a4('0x5c')]();_0x5068e7['on']('close',function(){if(!fs[_0x15a4('0x5d')](_0xc7bc93)){throw new db[(_0x15a4('0x55'))][(_0x15a4('0x5e'))](_0x15a4('0x5f'));}return _0x23a427[_0x15a4('0x4b')](_0xc7bc93,util[_0x15a4('0x4f')](_0x15a4('0x60'),path['basename'](_0x3bced6[_0x15a4('0x5')])),function(_0x99007f){if(_0x99007f){throw new db['Sequelize'][(_0x15a4('0x5e'))](_0x15a4('0x61'));}fs[_0x15a4('0x62')](_0xc7bc93);logger['info'](_0x15a4('0x63'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x15a4('0x45')](handleError(_0x23a427,null));};exports[_0x15a4('0x64')]=function(_0x234860,_0x45af75,_0x1a9ca4){var _0x51dbb9=path[_0x15a4('0x5a')](_0x234860[_0x15a4('0x65')][_0x15a4('0x66')],path[_0x15a4('0x67')](_0x234860['file'][_0x15a4('0x66')]));var _0x3b0551=path[_0x15a4('0x4c')](config[_0x15a4('0x4d')],'server/files/plugins',_0x234860[_0x15a4('0x65')][_0x15a4('0x66')]);var _0x3d9ff1=path[_0x15a4('0x4c')](config[_0x15a4('0x4d')],_0x15a4('0x4e'),_0x51dbb9);logger[_0x15a4('0x68')](_0x15a4('0x69'),_0x3b0551);logger[_0x15a4('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x3d9ff1);try{fs[_0x15a4('0x6a')](_0x3b0551,parseInt('0777',0x8));extract(_0x3b0551,{'dir':_0x3d9ff1},function(_0x103080){if(_0x103080){logger[_0x15a4('0x2a')](_0x103080);handleError(_0x103080,!![]);};var _0x11c670=fs[_0x15a4('0x6b')](_0x3d9ff1);if(_0x11c670[_0x15a4('0x3a')]>0x1){removeReferences(_0x3b0551,_0x3d9ff1);logger[_0x15a4('0x2a')]('Invalid\x20plugin\x20structure');return _0x1a9ca4(new Error(_0x15a4('0x6c')));}var _0x3986b8=fs[_0x15a4('0x6d')](path[_0x15a4('0x4c')](_0x3d9ff1,_0x11c670[0x0]));if(_0x3986b8[_0x15a4('0x6e')]()){removeReferences(_0x3b0551,_0x3d9ff1);logger[_0x15a4('0x2a')](_0x15a4('0x6c'));return _0x1a9ca4(new Error(_0x15a4('0x6c')));}if(_0x3986b8[_0x15a4('0x6f')]()){var _0x29a264=fs[_0x15a4('0x6b')](path[_0x15a4('0x4c')](_0x3d9ff1,_0x11c670[0x0]));if(_0x29a264['length']===0x0){removeReferences(_0x3b0551,_0x3d9ff1);logger[_0x15a4('0x2a')](_0x15a4('0x6c'));return _0x1a9ca4(new Error(_0x15a4('0x6c')));}var _0xe37339=_0x29a264['some'](function(_0x30ae32){return _0x30ae32===_0x15a4('0x70');});if(!_0xe37339){return _0x1a9ca4(new Error(_0x15a4('0x71')));}var _0x2e90db=fs[_0x15a4('0x72')](path[_0x15a4('0x4c')](_0x3d9ff1,_0x11c670[0x0],'manifest.json'));var _0x45bae2=JSON[_0x15a4('0x73')](_0x2e90db);if(_0x15a4('0x20')==typeof _0x45bae2[_0x15a4('0x2c')]){return _0x1a9ca4(new Error(_0x15a4('0x74')));}if('undefined'==typeof _0x45bae2[_0x15a4('0x33')]){return _0x1a9ca4(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x15a4('0x20')==typeof _0x45bae2[_0x15a4('0x75')]){return _0x1a9ca4(new Error(_0x15a4('0x76')));}if('undefined'==typeof _0x45bae2[_0x15a4('0x77')]){return _0x1a9ca4(new Error(_0x15a4('0x78')));}if(_0x45bae2['type']===_0x15a4('0x79')){if('undefined'==typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')]){return _0x1a9ca4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x15a4('0x20')==typeof _0x45bae2[_0x15a4('0x77')]['views'][_0x15a4('0x7b')]&&_0x15a4('0x20')==typeof _0x45bae2[_0x15a4('0x77')]['views']['agent']){return _0x1a9ca4(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x45bae2[_0x15a4('0x33')]==='script'){if('undefined'==typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7c')]){return _0x1a9ca4(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x15a4('0x20')==typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7d')]){return _0x1a9ca4(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x1a9ca4(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x199c02=_0x45bae2[_0x15a4('0x2c')];var _0x35433b=_0x45bae2[_0x15a4('0x7e')];var _0x1f6b52=_0x45bae2[_0x15a4('0x33')];var _0x23534d=_0x45bae2[_0x15a4('0x7f')]?_0x45bae2[_0x15a4('0x7f')]:_0x15a4('0x80');var _0x51b931=_0x45bae2[_0x15a4('0x81')]?_0x45bae2[_0x15a4('0x81')]:'icon-apps';var _0x25dad6='';var _0x355942='';var _0x206fae='';var _0x28541e='';var _0xf5617d=_0x45bae2[_0x15a4('0x75')];if(_0x1f6b52===_0x15a4('0x79')){if(_0x15a4('0x20')!=typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')]['admin']){var _0xcc3758=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')][_0x15a4('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0x15a4('0x82')](_0xcc3758)){_0x25dad6=path[_0x15a4('0x4c')]('plugins',_0x51dbb9,_0x11c670[0x0],_0xcc3758);}else{_0x25dad6=_0xcc3758;}}else{logger[_0x15a4('0x68')](_0x15a4('0x83'));}if(_0x15a4('0x20')!=typeof _0x45bae2['parameters']['views'][_0x15a4('0x84')]){var _0x16ad09=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')][_0x15a4('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x15a4('0x82')](_0x16ad09)){_0x355942=path['join'](_0x15a4('0x85'),_0x51dbb9,_0x11c670[0x0],_0x16ad09);}else{_0x355942=_0x16ad09;}}else{logger[_0x15a4('0x68')](_0x15a4('0x86'));}}else if(_0x1f6b52==='script'){_0x206fae=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7c')];_0x28541e=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7d')];if(_0x15a4('0x20')!=typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')]){if(_0x15a4('0x20')!=typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')][_0x15a4('0x7b')]){var _0xcc3758=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x15a4('0x82')](_0xcc3758)){_0x25dad6=path['join'](_0x15a4('0x85'),_0x51dbb9,_0x11c670[0x0],_0xcc3758);}else{_0x25dad6=_0xcc3758;}}if(_0x15a4('0x20')!=typeof _0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')][_0x15a4('0x84')]){var _0x16ad09=_0x45bae2[_0x15a4('0x77')][_0x15a4('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x15a4('0x82')](_0x16ad09)){_0x355942=path['join'](_0x15a4('0x85'),_0x51dbb9,_0x11c670[0x0],_0x16ad09);}else{_0x355942=_0x16ad09;}}}}var _0x5e3e94={'name':_0x199c02,'description':_0x35433b,'path':path[_0x15a4('0x4c')](_0x51dbb9,_0x11c670[0x0]),'type':_0x1f6b52,'sidebar':_0x23534d,'icon':_0x51b931,'adminUrl':_0x25dad6,'agentUrl':_0x355942,'scriptName':_0x206fae,'scriptPath':_0x28541e,'version':_0xf5617d};removeReferences(_0x3b0551,null);return db[_0x15a4('0x30')][_0x15a4('0x87')](_0x5e3e94)[_0x15a4('0x26')](function(_0x3a8b84){var _0x3b89b9={'role':_0x234860[_0x15a4('0x88')][_0x15a4('0x89')],'userProfileId':_0x234860[_0x15a4('0x88')][_0x15a4('0x8a')]};if(!_0x3b89b9)throw new Error(_0x15a4('0x8b'));if(_0x3b89b9[_0x15a4('0x89')]==='user'){var _0x43f3dc=_0x3a8b84['get']({'plain':!![]});return db[_0x15a4('0x8c')][_0x15a4('0x4a')]({'where':{'name':'Plugins','userProfileId':_0x3b89b9[_0x15a4('0x8a')]},'raw':!![]})[_0x15a4('0x26')](function(_0x4f73dc){if(_0x4f73dc&&_0x4f73dc['autoAssociation']===0x0){return db[_0x15a4('0x29')][_0x15a4('0x87')]({'name':_0x43f3dc['name'],'resourceId':_0x43f3dc['id'],'type':_0x4f73dc[_0x15a4('0x2c')],'sectionId':_0x4f73dc['id']},{})[_0x15a4('0x26')](function(){return _0x3a8b84;});}else{return _0x3a8b84;}})['catch'](function(_0x4ba6a7){logger[_0x15a4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba6a7);throw _0x4ba6a7;});}return _0x3a8b84;})[_0x15a4('0x26')](respondWithResult(_0x45af75,null))[_0x15a4('0x45')](handleError(_0x45af75,null));}});}catch(_0xe92558){_0x45af75['status'](0x1f4)[_0x15a4('0x2d')](_0xe92558);}};function removeReferences(_0x308da1,_0xb92ad7){try{if(_0x308da1){fs[_0x15a4('0x62')](_0x308da1);logger['info'](_0x15a4('0x8d'));}if(_0xb92ad7){rimraf(_0xb92ad7,function(){});logger[_0x15a4('0x68')](_0x15a4('0x8e'));}}catch(_0x46110d){logger[_0x15a4('0x2a')](_0x46110d);}}exports[_0x15a4('0x8f')]=function(_0x54f51b,_0x4cd3c1,_0xda2095){return db[_0x15a4('0x30')][_0x15a4('0x4a')]({'where':{'id':_0x54f51b[_0x15a4('0x47')]['id']}})[_0x15a4('0x26')](handleEntityNotFound(_0x4cd3c1,null))[_0x15a4('0x26')](saveUpdates(_0x54f51b[_0x15a4('0x88')],null))[_0x15a4('0x26')](respondWithResult(_0x4cd3c1,null))[_0x15a4('0x45')](handleError(_0x4cd3c1,null));};exports['delete']=function(_0x10b79d,_0x4dcd49,_0x4895c8){return db[_0x15a4('0x30')][_0x15a4('0x4a')]({'where':{'id':_0x10b79d['params']['id']}})[_0x15a4('0x26')](function(_0x4c29a7){if(_0x4c29a7){return _0x4c29a7[_0x15a4('0x90')]();}})['then'](function(_0x43c4ef){rimraf(path[_0x15a4('0x4c')](config[_0x15a4('0x4d')],_0x15a4('0x4e'),path[_0x15a4('0x58')](_0x43c4ef[_0x15a4('0x5')])),function(){});return _0x43c4ef;})['then'](handleEntityNotFound(_0x4dcd49,null))['then'](respondWithStatusCode(_0x4dcd49,null))[_0x15a4('0x45')](handleError(_0x4dcd49,null));};exports[_0x15a4('0x91')]=function(_0x3a099a,_0x59c712,_0x50c014){return BPromise[_0x15a4('0x92')]()[_0x15a4('0x26')](function(){if(!_0x3a099a[_0x15a4('0x36')][_0x15a4('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3a099a[_0x15a4('0x36')]['port']){throw new Error(_0x15a4('0x93'));}var _0x12e2da=_0x3a099a[_0x15a4('0x36')]['hostname']?_0x3a099a[_0x15a4('0x36')]['hostname']+':'+_0x3a099a[_0x15a4('0x36')][_0x15a4('0x94')]:_0x15a4('0x95')+_0x3a099a[_0x15a4('0x36')][_0x15a4('0x94')];var _0x4c3c44=_0x3a099a[_0x15a4('0x36')][_0x15a4('0x1e')]?_0x3a099a[_0x15a4('0x36')]['json']:!![];var _0x2469c5=_0x3a099a['query']['encoding']?_0x3a099a[_0x15a4('0x36')][_0x15a4('0x96')]:null;var _0x34a34c={'method':_0x3a099a['method'],'uri':util[_0x15a4('0x4f')](_0x15a4('0x97'),_0x12e2da,_0x3a099a[_0x15a4('0x36')][_0x15a4('0x5')]),'json':_0x4c3c44,'resolveWithFullResponse':!![],'encoding':_0x2469c5,'qs':_0x3a099a[_0x15a4('0x36')]};if(_0x3a099a[_0x15a4('0x98')]){_0x34a34c['headers']=_0x3a099a[_0x15a4('0x98')];if(_0x34a34c[_0x15a4('0x98')][_0x15a4('0x99')]){delete _0x34a34c[_0x15a4('0x98')]['content-length'];}}if(_0x34a34c[_0x15a4('0x98')][_0x15a4('0x9a')]){delete _0x34a34c[_0x15a4('0x98')][_0x15a4('0x9a')];}return rp(_0x34a34c);})['then'](function(_0x1c6018){if(_0x1c6018){_0x59c712['set'](_0x1c6018[_0x15a4('0x98')]);logger[_0x15a4('0x68')](_0x1c6018['body']);if(_['endsWith'](_0x3a099a[_0x15a4('0x36')][_0x15a4('0x5')],_0x15a4('0x4b'))&&_0x1c6018['statusCode']==0x1f4){return _0x59c712['sendStatus'](_0x1c6018[_0x15a4('0x9b')]);}else{return _0x59c712[_0x15a4('0x1c')](_0x1c6018[_0x15a4('0x9b')])[_0x15a4('0x2d')](_0x1c6018['body']);}}else{return _0x59c712[_0x15a4('0x1b')](0xc8);}})[_0x15a4('0x45')](handleError(_0x59c712,null));};exports[_0x15a4('0x9c')]=function(_0x54e931,_0x3aa764,_0x2325f9){return BPromise[_0x15a4('0x92')]()['then'](function(){if(!_0x54e931[_0x15a4('0x36')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x54e931[_0x15a4('0x36')][_0x15a4('0x94')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x112ed3=_0x54e931['query'][_0x15a4('0x9d')]?_0x54e931['query'][_0x15a4('0x9d')]+':'+_0x54e931[_0x15a4('0x36')][_0x15a4('0x94')]:_0x15a4('0x95')+_0x54e931[_0x15a4('0x36')][_0x15a4('0x94')];var _0x32649f=_0x54e931[_0x15a4('0x36')][_0x15a4('0x1e')]?_0x54e931[_0x15a4('0x36')][_0x15a4('0x1e')]:!![];var _0xee4166=_0x54e931[_0x15a4('0x36')][_0x15a4('0x96')]?_0x54e931[_0x15a4('0x36')][_0x15a4('0x96')]:null;var _0x1c319a={'method':_0x54e931[_0x15a4('0x9e')],'uri':util['format']('%s%s',_0x112ed3,_0x54e931[_0x15a4('0x36')][_0x15a4('0x5')]),'json':_0x32649f,'resolveWithFullResponse':!![],'encoding':_0xee4166,'body':_0x54e931[_0x15a4('0x88')]};if(_0x54e931['headers']){_0x1c319a[_0x15a4('0x98')]=_0x54e931[_0x15a4('0x98')];if(_0x1c319a[_0x15a4('0x98')][_0x15a4('0x99')]){delete _0x1c319a['headers'][_0x15a4('0x99')];}}if(_0x1c319a[_0x15a4('0x98')]['content-type']){delete _0x1c319a[_0x15a4('0x98')][_0x15a4('0x9a')];}return rp(_0x1c319a);})['then'](function(_0x21a968){if(_0x21a968){_0x3aa764[_0x15a4('0x23')](_0x21a968[_0x15a4('0x98')]);logger[_0x15a4('0x68')](_0x21a968['body']);return _0x3aa764[_0x15a4('0x1c')](_0x21a968[_0x15a4('0x9b')])[_0x15a4('0x2d')](_0x21a968[_0x15a4('0x88')]);}else{return _0x3aa764[_0x15a4('0x1b')](0xc8);}})[_0x15a4('0x45')](handleError(_0x3aa764,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1db835d..a45ab4f 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 _0xab3f=['save','update','remove','emit','hook','exports','events','Plugin','setMaxListeners'];(function(_0x44cb5d,_0x97f385){var _0x175c40=function(_0x2c1e34){while(--_0x2c1e34){_0x44cb5d['push'](_0x44cb5d['shift']());}};_0x175c40(++_0x97f385);}(_0xab3f,0x72));var _0xfab3=function(_0x9ef61e,_0x2837d9){_0x9ef61e=_0x9ef61e-0x0;var _0x1fc375=_0xab3f[_0x9ef61e];return _0x1fc375;};'use strict';var EventEmitter=require(_0xfab3('0x0'));var Plugin=require('../../mysqldb')['db'][_0xfab3('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xfab3('0x2')](0x0);var events={'afterCreate':_0xfab3('0x3'),'afterUpdate':_0xfab3('0x4'),'afterDestroy':_0xfab3('0x5')};function emitEvent(_0x12c3ab){return function(_0x394308,_0x4387f8,_0x3e2de2){PluginEvents[_0xfab3('0x6')](_0x12c3ab+':'+_0x394308['id'],_0x394308);PluginEvents[_0xfab3('0x6')](_0x12c3ab,_0x394308);_0x3e2de2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xfab3('0x7')](e,emitEvent(event));}}module[_0xfab3('0x8')]=PluginEvents; \ No newline at end of file +var _0x4873=['emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save'];(function(_0x253dad,_0x3bfafa){var _0x6c42df=function(_0x32fd1c){while(--_0x32fd1c){_0x253dad['push'](_0x253dad['shift']());}};_0x6c42df(++_0x3bfafa);}(_0x4873,0x1df));var _0x3487=function(_0x2cd393,_0x59d2e4){_0x2cd393=_0x2cd393-0x0;var _0x436095=_0x4873[_0x2cd393];return _0x436095;};'use strict';var EventEmitter=require(_0x3487('0x0'));var Plugin=require(_0x3487('0x1'))['db'][_0x3487('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3487('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24ca51){return function(_0xbc64e7,_0x54ff70,_0x1d6d6c){PluginEvents[_0x3487('0x4')](_0x24ca51+':'+_0xbc64e7['id'],_0xbc64e7);PluginEvents[_0x3487('0x4')](_0x24ca51,_0xbc64e7);_0x1d6d6c(null);};}for(var e in events){if(events[_0x3487('0x5')](e)){var event=events[e];Plugin[_0x3487('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 5094b5a..128a8b9 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 _0xe50a=['request-promise','path','rimraf','./plugin.attributes','define','plugins','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xe50a,0x1c2));var _0xae50=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xe50a[_0x26bf51];return _0x503415;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var logger=require(_0xae50('0x2'))(_0xae50('0x3'));var moment=require(_0xae50('0x4'));var BPromise=require(_0xae50('0x5'));var rp=require(_0xae50('0x6'));var fs=require('fs');var path=require(_0xae50('0x7'));var rimraf=require(_0xae50('0x8'));var config=require('../../config/environment');var attributes=require(_0xae50('0x9'));module['exports']=function(_0x4d83bf,_0x50fb89){return _0x4d83bf[_0xae50('0xa')]('Plugin',attributes,{'tableName':_0xae50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa801=['bluebird','path','rimraf','../../config/environment','define','Plugin','plugins','util','../../config/logger','api'];(function(_0x394480,_0x38ae49){var _0x4ae927=function(_0x1854ec){while(--_0x1854ec){_0x394480['push'](_0x394480['shift']());}};_0x4ae927(++_0x38ae49);}(_0xa801,0xc5));var _0x1a80=function(_0x431ccf,_0xbc5f8e){_0x431ccf=_0x431ccf-0x0;var _0x137494=_0xa801[_0x431ccf];return _0x137494;};'use strict';var _=require('lodash');var util=require(_0x1a80('0x0'));var logger=require(_0x1a80('0x1'))(_0x1a80('0x2'));var moment=require('moment');var BPromise=require(_0x1a80('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a80('0x4'));var rimraf=require(_0x1a80('0x5'));var config=require(_0x1a80('0x6'));var attributes=require('./plugin.attributes');module['exports']=function(_0x4596a8,_0x44518a){return _0x4596a8[_0x1a80('0x7')](_0x1a80('0x8'),attributes,{'tableName':_0x1a80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 765839f..a258e07 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 _0x0276=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','CreatePlugin','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','localhost','redis','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0276,0x157));var _0x6027=function(_0x1aeb39,_0x2e8404){_0x1aeb39=_0x1aeb39-0x0;var _0x439790=_0x0276[_0x1aeb39];return _0x439790;};'use strict';var _=require(_0x6027('0x0'));var util=require(_0x6027('0x1'));var moment=require(_0x6027('0x2'));var BPromise=require('bluebird');var rs=require(_0x6027('0x3'));var fs=require('fs');var Redis=require(_0x6027('0x4'));var db=require(_0x6027('0x5'))['db'];var utils=require(_0x6027('0x6'));var logger=require(_0x6027('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6027('0x8'));var client=jayson[_0x6027('0x9')][_0x6027('0xa')]({'port':0x232a});config['redis']=_[_0x6027('0xb')](config['redis'],{'host':_0x6027('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6027('0xd')]));require(_0x6027('0xe'))[_0x6027('0xf')](socket);function respondWithRpcPromise(_0x3c5f69,_0x2f79a0,_0xd105ac){return new BPromise(function(_0x3890eb,_0x4f5316){return client['request'](_0x3c5f69,_0xd105ac)[_0x6027('0x10')](function(_0x2f108d){logger[_0x6027('0x11')](_0x6027('0x12'),_0x2f79a0,_0x6027('0x13'));logger[_0x6027('0x14')](_0x6027('0x15'),_0x2f79a0,_0x6027('0x13'),JSON[_0x6027('0x16')](_0x2f108d));if(_0x2f108d['error']){if(_0x2f108d[_0x6027('0x17')][_0x6027('0x18')]===0x1f4){logger[_0x6027('0x17')](_0x6027('0x12'),_0x2f79a0,_0x2f108d[_0x6027('0x17')][_0x6027('0x19')]);return _0x4f5316(_0x2f108d[_0x6027('0x17')]['message']);}logger[_0x6027('0x17')](_0x6027('0x12'),_0x2f79a0,_0x2f108d[_0x6027('0x17')][_0x6027('0x19')]);return _0x3890eb(_0x2f108d['error']['message']);}else{logger['info'](_0x6027('0x12'),_0x2f79a0,_0x6027('0x13'));_0x3890eb(_0x2f108d[_0x6027('0x1a')][_0x6027('0x19')]);}})[_0x6027('0x1b')](function(_0x20df03){logger[_0x6027('0x17')](_0x6027('0x12'),_0x2f79a0,_0x20df03);_0x4f5316(_0x20df03);});});}exports['CreatePlugin']=function(_0x4475ba){var _0x3efdfe=this;return new Promise(function(_0x35c03f,_0x238321){return db[_0x6027('0x1c')][_0x6027('0x1d')](_0x4475ba[_0x6027('0x1e')],{'raw':_0x4475ba[_0x6027('0x1f')]?_0x4475ba[_0x6027('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x6027('0x10')](function(_0x4a64fc){logger[_0x6027('0x11')](_0x6027('0x20'),_0x4475ba);logger[_0x6027('0x14')](_0x6027('0x20'),_0x4475ba,JSON[_0x6027('0x16')](_0x4a64fc));_0x35c03f(_0x4a64fc);})[_0x6027('0x1b')](function(_0x5e903c){logger[_0x6027('0x17')]('CreatePlugin',_0x5e903c[_0x6027('0x19')],_0x4475ba);_0x238321(_0x3efdfe[_0x6027('0x17')](0x1f4,_0x5e903c[_0x6027('0x19')]));});});}; \ No newline at end of file +var _0x0ad2=['then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','CreatePlugin','Plugin','options'];(function(_0x32be62,_0x22e6fd){var _0x1a37e9=function(_0x35a9c1){while(--_0x35a9c1){_0x32be62['push'](_0x32be62['shift']());}};_0x1a37e9(++_0x22e6fd);}(_0x0ad2,0xa1));var _0x20ad=function(_0x4a328d,_0x4c62d6){_0x4a328d=_0x4a328d-0x0;var _0x4410d9=_0x0ad2[_0x4a328d];return _0x4410d9;};'use strict';var _=require(_0x20ad('0x0'));var util=require(_0x20ad('0x1'));var moment=require(_0x20ad('0x2'));var BPromise=require(_0x20ad('0x3'));var rs=require(_0x20ad('0x4'));var fs=require('fs');var Redis=require(_0x20ad('0x5'));var db=require(_0x20ad('0x6'))['db'];var utils=require(_0x20ad('0x7'));var logger=require(_0x20ad('0x8'))(_0x20ad('0x9'));var config=require(_0x20ad('0xa'));var jayson=require(_0x20ad('0xb'));var client=jayson[_0x20ad('0xc')][_0x20ad('0xd')]({'port':0x232a});config[_0x20ad('0xe')]=_[_0x20ad('0xf')](config[_0x20ad('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x20ad('0x10'))(new Redis(config[_0x20ad('0xe')]));require('./plugin.socket')[_0x20ad('0x11')](socket);function respondWithRpcPromise(_0x6273e,_0x1eb7c2,_0x1333cd){return new BPromise(function(_0x24db4c,_0xe529a3){return client[_0x20ad('0x12')](_0x6273e,_0x1333cd)['then'](function(_0x20590a){logger[_0x20ad('0x13')](_0x20ad('0x14'),_0x1eb7c2,'request\x20sent');logger[_0x20ad('0x15')](_0x20ad('0x16'),_0x1eb7c2,'request\x20sent',JSON[_0x20ad('0x17')](_0x20590a));if(_0x20590a[_0x20ad('0x18')]){if(_0x20590a[_0x20ad('0x18')]['code']===0x1f4){logger[_0x20ad('0x18')](_0x20ad('0x14'),_0x1eb7c2,_0x20590a[_0x20ad('0x18')][_0x20ad('0x19')]);return _0xe529a3(_0x20590a[_0x20ad('0x18')][_0x20ad('0x19')]);}logger[_0x20ad('0x18')](_0x20ad('0x14'),_0x1eb7c2,_0x20590a['error'][_0x20ad('0x19')]);return _0x24db4c(_0x20590a['error']['message']);}else{logger[_0x20ad('0x13')]('Plugin,\x20%s,\x20%s',_0x1eb7c2,_0x20ad('0x1a'));_0x24db4c(_0x20590a['result'][_0x20ad('0x19')]);}})[_0x20ad('0x1b')](function(_0x46779c){logger[_0x20ad('0x18')]('Plugin,\x20%s,\x20%s',_0x1eb7c2,_0x46779c);_0xe529a3(_0x46779c);});});}exports[_0x20ad('0x1c')]=function(_0x9e7089){var _0x5eaa97=this;return new Promise(function(_0x453e0b,_0x2aa458){return db[_0x20ad('0x1d')]['create'](_0x9e7089['body'],{'raw':_0x9e7089['options']?_0x9e7089[_0x20ad('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x20ad('0x1f')](function(_0xf897f8){logger[_0x20ad('0x13')](_0x20ad('0x1c'),_0x9e7089);logger[_0x20ad('0x15')](_0x20ad('0x1c'),_0x9e7089,JSON[_0x20ad('0x17')](_0xf897f8));_0x453e0b(_0xf897f8);})[_0x20ad('0x1b')](function(_0x11966a){logger[_0x20ad('0x18')]('CreatePlugin',_0x11966a['message'],_0x9e7089);_0x2aa458(_0x5eaa97['error'](0x1f4,_0x11966a[_0x20ad('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 795a26d..e3297a1 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 _0x82b1=['register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x4eece9,_0xda1918){var _0x211477=function(_0x62cfd3){while(--_0x62cfd3){_0x4eece9['push'](_0x4eece9['shift']());}};_0x211477(++_0xda1918);}(_0x82b1,0x175));var _0x182b=function(_0x1281e0,_0x1d420b){_0x1281e0=_0x1281e0-0x0;var _0x3ef3b4=_0x82b1[_0x1281e0];return _0x3ef3b4;};'use strict';var PluginEvents=require(_0x182b('0x0'));var events=[_0x182b('0x1'),_0x182b('0x2'),_0x182b('0x3')];function createListener(_0x5d63b0,_0x183074){return function(_0x7d1a09){_0x183074[_0x182b('0x4')](_0x5d63b0,_0x7d1a09);};}function removeListener(_0x377ead,_0x367bbf){return function(){PluginEvents['removeListener'](_0x377ead,_0x367bbf);};}exports[_0x182b('0x5')]=function(_0x4df25e){for(var _0x382dd3=0x0,_0x187fc3=events['length'];_0x382dd3<_0x187fc3;_0x382dd3++){var _0x47138e=events[_0x382dd3];var _0xe77c71=createListener(_0x182b('0x6')+_0x47138e,_0x4df25e);PluginEvents['on'](_0x47138e,_0xe77c71);}}; \ No newline at end of file +var _0x48e6=['plugin:','./plugin.events','remove','update','emit','length'];(function(_0x31c351,_0x2c7bc1){var _0x1a1c6d=function(_0x24ac6d){while(--_0x24ac6d){_0x31c351['push'](_0x31c351['shift']());}};_0x1a1c6d(++_0x2c7bc1);}(_0x48e6,0x97));var _0x648e=function(_0x7b4990,_0x1ea69b){_0x7b4990=_0x7b4990-0x0;var _0x126273=_0x48e6[_0x7b4990];return _0x126273;};'use strict';var PluginEvents=require(_0x648e('0x0'));var events=['save',_0x648e('0x1'),_0x648e('0x2')];function createListener(_0x56d3e5,_0x287003){return function(_0x4f41ec){_0x287003[_0x648e('0x3')](_0x56d3e5,_0x4f41ec);};}function removeListener(_0x41a618,_0x1b9c1a){return function(){PluginEvents['removeListener'](_0x41a618,_0x1b9c1a);};}exports['register']=function(_0xf821b3){for(var _0x264170=0x0,_0x3c2a80=events[_0x648e('0x4')];_0x264170<_0x3c2a80;_0x264170++){var _0x499f1a=events[_0x264170];var _0x5c89cf=createListener(_0x648e('0x5')+_0x499f1a,_0xf821b3);PluginEvents['on'](_0x499f1a,_0x5c89cf);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7ae09bf..44da412 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(_0x1c77e4,_0x1d5ed8){var _0x17014d=function(_0xf48d06){while(--_0xf48d06){_0x1c77e4['push'](_0x1c77e4['shift']());}};_0x17014d(++_0x1d5ed8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x1a2e14,_0x5ed2ab){var _0x7b8c94=function(_0x16c66a){while(--_0x16c66a){_0x1a2e14['push'](_0x1a2e14['shift']());}};_0x7b8c94(++_0x5ed2ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 50aafa1..cf25e61 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 _0x9b9b=['Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','name','npm\x20install','info','error','index','list','reject','express','motion2','length','then','show','describe','params','catch','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','send','update','restart','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b9b,0x114));var _0xb9b9=function(_0x14540b,_0x85d32d){_0x14540b=_0x14540b-0x0;var _0x394822=_0x9b9b[_0x14540b];return _0x394822;};'use strict';var _=require('lodash');var pm2=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xb9b9('0x1'));var exec=require(_0xb9b9('0x2'))[_0xb9b9('0x3')];var BPromise=require(_0xb9b9('0x4'));function handleEntityNotFound(_0x1d6ab6,_0x43c8ff){return function(_0x23b016){if(!_0x23b016){_0x1d6ab6[_0xb9b9('0x5')](0x194);;}return _0x23b016;};}function respondWithResult(_0x79dd,_0x3d1a95){_0x3d1a95=_0x3d1a95||0xc8;return function(_0x85eec){if(_0x85eec){return _0x79dd[_0xb9b9('0x6')](_0x3d1a95)[_0xb9b9('0x7')](_0x85eec);}return null;};}function handleError(_0x297cb6,_0x222cba){_0x222cba=_0x222cba||0x1f4;return function(_0x319bb8){logger['error'](_0x319bb8['stack']);if(_0x319bb8[_0xb9b9('0x8')]){delete _0x319bb8[_0xb9b9('0x8')];}_0x297cb6[_0xb9b9('0x6')](_0x222cba)['send'](_0x319bb8);};}function execChildProcess(){return new BPromise(function(_0x3949d0,_0x3b6bb9){exec(_0xb9b9('0x9'),function(_0x4d8856,_0x3430a6,_0x277d86){logger[_0xb9b9('0xa')](_0x3430a6);logger[_0xb9b9('0xa')](_0x277d86);if(_0x4d8856){logger[_0xb9b9('0xb')](_0x4d8856);return _0x3b6bb9(_0x4d8856);}return _0x3949d0(_0x3430a6);});});}exports[_0xb9b9('0xc')]=function(_0x5bd18c,_0x539449){return pm2[_0xb9b9('0xd')]()['then'](function(_0xe78d58){if(_0xe78d58){var _0x50e5d6=_[_0xb9b9('0xe')](_0xe78d58,function(_0x23bac9){return _0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0xf')||_0x23bac9[_0xb9b9('0x8')]===_0xb9b9('0x10');});return{'rows':_0x50e5d6,'count':_0x50e5d6[_0xb9b9('0x11')]};}return null;})[_0xb9b9('0x12')](respondWithResult(_0x539449,null))['catch'](handleError(_0x539449,null));};exports[_0xb9b9('0x13')]=function(_0x48d9ae,_0x403a5b){return pm2[_0xb9b9('0x14')](_0x48d9ae[_0xb9b9('0x15')]['id'])[_0xb9b9('0x12')](respondWithResult(_0x403a5b,null))['then'](handleEntityNotFound(_0x403a5b,null))[_0xb9b9('0x16')](handleError(_0x403a5b,null));};exports[_0xb9b9('0x17')]=function(_0x398f3d,_0xb01198){if(_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')]&&_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]){var _0xb16391=path[_0xb9b9('0x1a')](__dirname,_0xb9b9('0x1b'),_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x19')]);var _0x4e33a0=process[_0xb9b9('0x1c')]();process[_0xb9b9('0x1d')](path[_0xb9b9('0x1e')](_0xb16391));return execChildProcess()['then'](function(_0x9898bc){process[_0xb9b9('0x1d')](_0x4e33a0);return pm2['start']({'name':_0x398f3d[_0xb9b9('0x18')][_0xb9b9('0x8')],'script':_0xb16391});})[_0xb9b9('0x12')](function(_0x40b801){pm2[_0xb9b9('0x1f')]();return _0x40b801[0x0];})['then'](respondWithResult(_0xb01198,0xc9))['catch'](handleError(_0xb01198,null));}else{return _0xb01198[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xb9b9('0x21')]=function(_0x134ed6,_0x20ffc1){if(_0x134ed6[_0xb9b9('0x18')]['id']){delete _0x134ed6[_0xb9b9('0x18')]['id'];}var _0x54bf18={'online':_0xb9b9('0x22'),'stopped':'stop'};if(_0x54bf18[_0xb9b9('0x23')](_0x134ed6[_0xb9b9('0x18')]['status'])){return pm2[_0x54bf18[_0x134ed6[_0xb9b9('0x18')][_0xb9b9('0x6')]]](_0x134ed6[_0xb9b9('0x15')]['id'])['then'](respondWithResult(_0x20ffc1,0xc8))[_0xb9b9('0x16')](handleError(_0x20ffc1,null));}else{return _0x20ffc1[_0xb9b9('0x6')](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x24')});}};exports['destroy']=function(_0xc40dda,_0xdbc1f1){if(_0xc40dda['body']['id']){delete _0xc40dda[_0xb9b9('0x18')]['id'];}if(_0xc40dda[_0xb9b9('0x15')]['id']){return pm2[_0xb9b9('0x25')](_0xc40dda[_0xb9b9('0x15')]['id'])['then'](function(_0xd66ace){pm2[_0xb9b9('0x1f')]();return _0xd66ace[0x0];})[_0xb9b9('0x12')](respondWithResult(_0xdbc1f1,null))[_0xb9b9('0x16')](handleError(_0xdbc1f1,null));}else{return _0xdbc1f1['status'](0x1f4)[_0xb9b9('0x20')]({'message':_0xb9b9('0x26')});}}; \ No newline at end of file +var _0x34e5=['info','error','list','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','dirname','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','name','npm\x20install'];(function(_0x4bf8b6,_0x2baec7){var _0x4e7375=function(_0xf80783){while(--_0xf80783){_0x4bf8b6['push'](_0x4bf8b6['shift']());}};_0x4e7375(++_0x2baec7);}(_0x34e5,0x172));var _0x534e=function(_0x50edf6,_0x284340){_0x50edf6=_0x50edf6-0x0;var _0x47bbfb=_0x34e5[_0x50edf6];return _0x47bbfb;};'use strict';var _=require('lodash');var pm2=require(_0x534e('0x0'));var logger=require('../../config/logger')(_0x534e('0x1'));var path=require(_0x534e('0x2'));var exec=require(_0x534e('0x3'))[_0x534e('0x4')];var BPromise=require(_0x534e('0x5'));function handleEntityNotFound(_0x50b790,_0x11a158){return function(_0x3d8287){if(!_0x3d8287){_0x50b790[_0x534e('0x6')](0x194);;}return _0x3d8287;};}function respondWithResult(_0x117f0c,_0x436a92){_0x436a92=_0x436a92||0xc8;return function(_0x2d0370){if(_0x2d0370){return _0x117f0c[_0x534e('0x7')](_0x436a92)['json'](_0x2d0370);}return null;};}function handleError(_0x24d562,_0x929597){_0x929597=_0x929597||0x1f4;return function(_0xa836bb){logger['error'](_0xa836bb['stack']);if(_0xa836bb[_0x534e('0x8')]){delete _0xa836bb['name'];}_0x24d562[_0x534e('0x7')](_0x929597)['send'](_0xa836bb);};}function execChildProcess(){return new BPromise(function(_0xb30dd6,_0x310b6d){exec(_0x534e('0x9'),function(_0x529726,_0x1b7a5a,_0x229352){logger[_0x534e('0xa')](_0x1b7a5a);logger[_0x534e('0xa')](_0x229352);if(_0x529726){logger[_0x534e('0xb')](_0x529726);return _0x310b6d(_0x529726);}return _0xb30dd6(_0x1b7a5a);});});}exports['index']=function(_0x31d764,_0x23c11c){return pm2[_0x534e('0xc')]()[_0x534e('0xd')](function(_0x359565){if(_0x359565){var _0x478027=_[_0x534e('0xe')](_0x359565,function(_0x17c068){return _0x17c068[_0x534e('0x8')]==='express'||_0x17c068[_0x534e('0x8')]===_0x534e('0xf');});return{'rows':_0x478027,'count':_0x478027['length']};}return null;})['then'](respondWithResult(_0x23c11c,null))[_0x534e('0x10')](handleError(_0x23c11c,null));};exports[_0x534e('0x11')]=function(_0x9297b6,_0x16ad40){return pm2[_0x534e('0x12')](_0x9297b6[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x16ad40,null))['then'](handleEntityNotFound(_0x16ad40,null))[_0x534e('0x10')](handleError(_0x16ad40,null));};exports[_0x534e('0x14')]=function(_0x466d74,_0x1bef0a){if(_0x466d74[_0x534e('0x15')]['name']&&_0x466d74[_0x534e('0x15')][_0x534e('0x16')]){var _0x5f9ae9=path[_0x534e('0x17')](__dirname,_0x534e('0x18'),_0x466d74[_0x534e('0x15')][_0x534e('0x16')]);var _0x85188b=process[_0x534e('0x19')]();process['chdir'](path[_0x534e('0x1a')](_0x5f9ae9));return execChildProcess()[_0x534e('0xd')](function(_0x39466c){process[_0x534e('0x1b')](_0x85188b);return pm2[_0x534e('0x1c')]({'name':_0x466d74[_0x534e('0x15')][_0x534e('0x8')],'script':_0x5f9ae9});})[_0x534e('0xd')](function(_0x53a6ef){pm2[_0x534e('0x1d')]();return _0x53a6ef[0x0];})['then'](respondWithResult(_0x1bef0a,0xc9))[_0x534e('0x10')](handleError(_0x1bef0a,null));}else{return _0x1bef0a[_0x534e('0x7')](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x1f')});}};exports[_0x534e('0x20')]=function(_0x57b216,_0x743974){if(_0x57b216[_0x534e('0x15')]['id']){delete _0x57b216['body']['id'];}var _0x4bd073={'online':_0x534e('0x21'),'stopped':'stop'};if(_0x4bd073[_0x534e('0x22')](_0x57b216[_0x534e('0x15')][_0x534e('0x7')])){return pm2[_0x4bd073[_0x57b216[_0x534e('0x15')][_0x534e('0x7')]]](_0x57b216[_0x534e('0x13')]['id'])[_0x534e('0xd')](respondWithResult(_0x743974,0xc8))['catch'](handleError(_0x743974,null));}else{return _0x743974['status'](0x1f4)[_0x534e('0x1e')]({'message':_0x534e('0x23')});}};exports[_0x534e('0x24')]=function(_0x2f1c49,_0x423502){if(_0x2f1c49[_0x534e('0x15')]['id']){delete _0x2f1c49[_0x534e('0x15')]['id'];}if(_0x2f1c49[_0x534e('0x13')]['id']){return pm2[_0x534e('0x25')](_0x2f1c49[_0x534e('0x13')]['id'])[_0x534e('0xd')](function(_0x1d6fb1){pm2['dump']();return _0x1d6fb1[0x0];})[_0x534e('0xd')](respondWithResult(_0x423502,null))[_0x534e('0x10')](handleError(_0x423502,null));}else{return _0x423502['status'](0x1f4)[_0x534e('0x1e')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d18d989..431da5a 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 _0x695f=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getQueues','express','Router'];(function(_0x13ec2b,_0x40b664){var _0x1fb3f4=function(_0x3e91e9){while(--_0x3e91e9){_0x13ec2b['push'](_0x13ec2b['shift']());}};_0x1fb3f4(++_0x40b664);}(_0x695f,0xb6));var _0xf695=function(_0x27693c,_0x1bdbc7){_0x27693c=_0x27693c-0x0;var _0x55366f=_0x695f[_0x27693c];return _0x55366f;};'use strict';var express=require(_0xf695('0x0'));var router=express[_0xf695('0x1')]();var auth=require(_0xf695('0x2'));var controller=require(_0xf695('0x3'));router[_0xf695('0x4')](_0xf695('0x5'),auth[_0xf695('0x6')](),controller['getAgents']);router[_0xf695('0x4')]('/queues',auth['isAuthenticated'](),controller[_0xf695('0x7')]);module['exports']=router; \ No newline at end of file +var _0x87b5=['isAuthenticated','getQueues','exports','Router','../../components/auth/service','get','/agents','getAgents','/queues'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x87b5,0xc9));var _0x587b=function(_0x4c9d53,_0x4f837f){_0x4c9d53=_0x4c9d53-0x0;var _0x4a4194=_0x87b5[_0x4c9d53];return _0x4a4194;};'use strict';var express=require('express');var router=express[_0x587b('0x0')]();var auth=require(_0x587b('0x1'));var controller=require('./realtime.controller');router[_0x587b('0x2')](_0x587b('0x3'),auth['isAuthenticated'](),controller[_0x587b('0x4')]);router[_0x587b('0x2')](_0x587b('0x5'),auth[_0x587b('0x6')](),controller[_0x587b('0x7')]);module[_0x587b('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index da84a43..b543b56 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 _0x1cb9=['mailStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','type','key','query','role','getOptions','raw','user','agent','nolimit','sort','UserProfile','getResources','rows','pick','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','sms','openchannel','fax','toLowerCase','Invalid\x20channel','channel','userProfileId','outbound','QueueCampaigns','findAndCountAll','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','client','http','offset','limit','count','status','set','Content-Range','error','stack','name','then','result','Agents','catch','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','available','waiting','talking','paused','voice','push','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','pTalking','find','merge','length','some','connectedlinenum','toString','busy','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','agents','User','Pause','QueueId','idle','unknown','unavailable','ringing','chatPause','mailPause','whatsappPause','every','filter','voicePause','chatStatus','mailStatus','smsStatus','whatsappStatus','pause','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','internal','address','openchannelPause','smsPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatus','faxStatus'];(function(_0x1f9d51,_0x3d7473){var _0x331e64=function(_0x2b2690){while(--_0x2b2690){_0x1f9d51['push'](_0x1f9d51['shift']());}};_0x331e64(++_0x3d7473);}(_0x1cb9,0x14e));var _0x91cb=function(_0x63335b,_0x4efc59){_0x63335b=_0x63335b-0x0;var _0x48c8e4=_0x1cb9[_0x63335b];return _0x48c8e4;};'use strict';var util=require(_0x91cb('0x0'));var _=require('lodash');var jayson=require(_0x91cb('0x1'));var qs=require(_0x91cb('0x2'));var logger=require(_0x91cb('0x3'))(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x91cb('0x5')][_0x91cb('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x91cb('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x3640f9,_0x186dc3){return function(_0x28543e){if(_0x28543e){var _0x3b9d98=typeof _0x186dc3[_0x91cb('0x7')]==='undefined'&&typeof _0x186dc3[_0x91cb('0x8')]==='undefined';var _0x2fdfce=_0x28543e['count'];var _0xa43e7a=_0x3b9d98?0x0:_0x186dc3[_0x91cb('0x7')];var _0x45317f=_0x3b9d98?_0x28543e[_0x91cb('0x9')]:_0x186dc3[_0x91cb('0x7')]+_0x186dc3[_0x91cb('0x8')];var _0x21a0a5;if(_0x45317f>=_0x2fdfce){_0x45317f=_0x2fdfce;_0x21a0a5=0xc8;}else{_0x21a0a5=0xce;}_0x3640f9[_0x91cb('0xa')](_0x21a0a5);return _0x3640f9[_0x91cb('0xb')](_0x91cb('0xc'),_0xa43e7a+'-'+_0x45317f+'/'+_0x2fdfce)['json'](_0x28543e);}return null;};}function handleError(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0x1f4;return function(_0x4ba2f2){logger[_0x91cb('0xd')](_0x4ba2f2[_0x91cb('0xe')]);if(_0x4ba2f2[_0x91cb('0xf')]){delete _0x4ba2f2[_0x91cb('0xf')];}_0x3c1f56['status'](_0x366f09)['send'](_0x4ba2f2);};}function getRealtimeAgents(){return new Promise(function(_0x4aae25,_0x3d22b7){return amiClient['request']('Agents',{})[_0x91cb('0x10')](function(_0xc3629e){if(_0xc3629e[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x238f11=_0xc3629e[_0x91cb('0x11')];return routingClient['request'](_0x91cb('0x12'),{})[_0x91cb('0x10')](function(_0x1cd34b){if(_0x1cd34b[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3fba4f=_0x1cd34b[_0x91cb('0x11')];return _0x4aae25(_['merge']({},_0x238f11,_0x3fba4f));});})[_0x91cb('0x13')](function(_0x4c9fb2){_0x3d22b7(_0x4c9fb2);});});}function getRealtimeQueues(_0x55042a,_0x281ff3){return new Promise(function(_0x160ded,_0x56e409){var _0x51a1d5=_0x281ff3==='voice'?amiClient:routingClient;return _0x51a1d5[_0x91cb('0x14')](_[_0x91cb('0x15')](_0x281ff3)+_0x91cb('0x16'),_0x55042a)[_0x91cb('0x10')](function(_0x5c6a15){if(_0x5c6a15[_0x91cb('0xd')])throw new Error(util[_0x91cb('0x17')](_0x91cb('0x18'),_0x281ff3));return _0x160ded(_0x5c6a15['result']);})[_0x91cb('0x13')](function(_0x1a7a54){_0x56e409(_0x1a7a54);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2447e7,_0x422d14){return amiClient[_0x91cb('0x14')](_0x91cb('0x19'),{})[_0x91cb('0x10')](function(_0x423c4f){if(_0x423c4f[_0x91cb('0xd')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x2447e7(_0x423c4f['result']);})[_0x91cb('0x13')](function(_0x554350){_0x422d14(_0x554350);});});}function initializeQueues(_0x1c67d2,_0x34d372,_0x318031,_0x5595c5){var _0x9b26a6=['loggedIn',_0x91cb('0x1a'),_0x91cb('0x1b'),_0x91cb('0x1c'),_0x91cb('0x1d')];if(_0x318031===_0x91cb('0x1e')&&_0x5595c5==='outbound'){_0x9b26a6[_0x91cb('0x1f')]('pTalking',_0x91cb('0x20'),_0x91cb('0x21'),_0x91cb('0x22'),'dialMethod',_0x91cb('0x23'),_0x91cb('0x24'),_0x91cb('0x25'),_0x91cb('0x26'),_0x91cb('0x27'),_0x91cb('0x28'),_0x91cb('0x29'),_0x91cb('0x2a'),_0x91cb('0x2b'),'dialPredictiveIntervalMinThreshold',_0x91cb('0x2c'),_0x91cb('0x2d'),_0x91cb('0x2e'),_0x91cb('0x2f'),_0x91cb('0x30'),'predictiveIntervalAvgHoldtime',_0x91cb('0x31'));}return _0x1c67d2[_0x91cb('0x32')](function(_0x2e317c){var _0x46db02=_0x2e317c[_0x91cb('0x33')]({'plain':!![]});_0x46db02['agents']=[];_0x46db02[_0x91cb('0x1d')]=0x0;_0x46db02['loggedInDb']=0x0;_0x46db02['loggedIn']=0x0;_0x46db02['available']=0x0;_0x46db02[_0x91cb('0x1b')]=0x0;if(_0x318031==='voice'){_0x46db02[_0x91cb('0x1c')]=0x0;_0x46db02['busy']=0x0;if(_0x5595c5==='outbound'){_0x46db02[_0x91cb('0x34')]=0x0;_0x46db02[_0x91cb('0x20')]=0x0;}}var _0x1deabb=_[_0x91cb('0x35')](_0x34d372,['id',_0x46db02['id']]);if(_0x1deabb)_[_0x91cb('0x36')](_0x46db02,_['pick'](_0x1deabb,_0x9b26a6));return _0x46db02;});}function updateAgentVoiceStatus(_0x8beb3a,_0x3ddc0b,_0x13a5ea){var _0x8496a3=_['filter'](_0x13a5ea,['queue',_0x3ddc0b[_0x91cb('0xf')]]);if(_0x8496a3[_0x91cb('0x37')]===0x0)return _0x8beb3a['busy']=!![];if(_[_0x91cb('0x38')](_0x8496a3,[_0x91cb('0x39'),_0x8beb3a['internal'][_0x91cb('0x3a')]()]))return _0x8beb3a[_0x91cb('0x1c')]=!![];if(!_0x8beb3a['talking'])return _0x8beb3a[_0x91cb('0x3b')]=!![];}function getVoiceQueueAgents(_0x545687,_0x4117db,_0xabe6a3,_0x9de25d){var _0x279ad5=_[_0x91cb('0x35')](_0x4117db,['id',_0x545687['id']]);if(!_0x279ad5)return _0x545687;return _0x279ad5[_0x91cb('0x3c')]({'raw':!![]})['then'](function(_0xa90111){for(var _0x425fa4=0x0;_0x425fa4<_0xa90111['length'];_0x425fa4++){var _0x312581=_['find'](_0xabe6a3,['id',_0xa90111[_0x425fa4][_0x91cb('0x3d')]]);if(!_0x312581){_0x312581={'id':_0xa90111[_0x425fa4][_0x91cb('0x3d')],'name':_0xa90111[_0x425fa4][_0x91cb('0x3d')],'accountcode':'','online':![]};}var _0x174794={'id':_0x312581['id'],'name':_0x312581['name'],'internal':_0x312581[_0x91cb('0x3e')],'online':Boolean(_0x312581[_0x91cb('0x3f')]),'paused':Boolean(_0xa90111[_0x425fa4][_0x91cb('0x1d')])};if(_0x312581[_0x91cb('0x40')]===_0x91cb('0x1c'))updateAgentVoiceStatus(_0x174794,_0x545687,_0x9de25d);if(_0x174794[_0x91cb('0x3f')])_0x545687[_0x91cb('0x41')]++;if(_0x174794[_0x91cb('0x3b')])_0x545687[_0x91cb('0x3b')]++;if(_0x174794[_0x91cb('0x1d')]&&!_0x174794['busy']&&!_0x174794[_0x91cb('0x1c')])_0x545687['paused']++;_0x545687[_0x91cb('0x42')]['push'](_0x174794);}return _0x545687;});}function getQueueAgents(_0x335879,_0x52e82c,_0x138f48){var _0x477131=_0x91cb('0x43')+_[_0x91cb('0x15')](_0x138f48)+'Queue';var _0x2cdb61=_0x138f48+_0x91cb('0x44');return db[_0x477131]['findAll']({'where':{[_[_0x91cb('0x15')](_0x138f48)+_0x91cb('0x45')]:_0x335879['id']},'raw':!![]})[_0x91cb('0x10')](function(_0x32517d){for(var _0x267efb=0x0;_0x267efb<_0x32517d[_0x91cb('0x37')];_0x267efb++){var _0x17d319=_[_0x91cb('0x35')](_0x52e82c,['id',_0x32517d[_0x267efb][_0x91cb('0x3d')]]);if(!_0x17d319){_0x17d319={'id':_0x32517d[_0x267efb]['UserId'],'name':_0x32517d[_0x267efb][_0x91cb('0x3d')],'online':![],['pauseField']:![]};}var _0x3e20d1={'id':_0x17d319['id'],'name':_0x17d319[_0x91cb('0xf')],'online':Boolean(_0x17d319[_0x91cb('0x3f')]),'paused':Boolean(_0x17d319[_0x2cdb61])};if(_0x3e20d1[_0x91cb('0x3f')])_0x335879[_0x91cb('0x41')]++;_0x335879[_0x91cb('0x42')][_0x91cb('0x1f')](_0x3e20d1);}return _0x335879;});}function isIdle(_0x4830d3){return _0x4830d3===_0x91cb('0x46')||_0x4830d3===_0x91cb('0x47')||_0x4830d3===_0x91cb('0x48')||_0x4830d3===_0x91cb('0x49')||_['isNil'](_0x4830d3);}function isAgentPaused(_0x9dae06,_0x1aa461){var _0x4fad1b=[_0x9dae06[_0x91cb('0x4a')],_0x9dae06['faxPause'],_0x9dae06[_0x91cb('0x4b')],_0x9dae06['openchannelPause'],_0x9dae06['smsPause'],_0x9dae06['voicePause'],_0x9dae06[_0x91cb('0x4c')]];if(!_0x1aa461)return _[_0x91cb('0x4d')](_0x4fad1b);var _0x3d62c4=_[_0x91cb('0x4e')](_0x4fad1b);return _0x3d62c4[_0x91cb('0x37')]>0x0&&_0x3d62c4['length']<_0x4fad1b['length']?!![]:![];}function isAgentIdle(_0x1d26b8){if(_0x1d26b8[_0x91cb('0x40')]!==_0x91cb('0x46')&&_0x1d26b8[_0x91cb('0x4f')]){_0x1d26b8['voiceStatus']='pause';return![];}return _['every']([_0x1d26b8[_0x91cb('0x50')],_0x1d26b8['faxStatus'],_0x1d26b8[_0x91cb('0x51')],_0x1d26b8['openchannelStatus'],_0x1d26b8[_0x91cb('0x52')],_0x1d26b8[_0x91cb('0x40')],_0x1d26b8[_0x91cb('0x53')]],isIdle);}function getAgentStatus(_0x649976){var _0x1884bc=_0x91cb('0x47');if(isAgentPaused(_0x649976))_0x1884bc=_0x91cb('0x54');else if(isAgentPaused(_0x649976,!![]))_0x1884bc=_0x91cb('0x55');else if(isAgentIdle(_0x649976))_0x1884bc=_0x91cb('0x46');else _0x1884bc=_0x91cb('0x3b');return _0x1884bc;}exports[_0x91cb('0x56')]=function(_0x5752ed,_0x1e445a){var _0x1fa45a={'count':0x0,'rows':[]},_0x4d7a34={},_0x3f719b,_0x32fb40,_0x4bab7d=[_0x91cb('0x57'),_0x91cb('0x3f'),_0x91cb('0x58'),_0x91cb('0x59'),_0x91cb('0x5a'),_0x91cb('0x59'),_0x91cb('0x5b'),_0x91cb('0x5c'),_0x91cb('0x4a'),_0x91cb('0x5d'),'mailPause',_0x91cb('0x5e'),'whatsappPause',_0x91cb('0x5f'),'voicePause',_0x91cb('0x60'),_0x91cb('0x61'),_0x91cb('0x62'),'smsCapacity',_0x91cb('0x63'),_0x91cb('0x64'),'chatCurrentCapacity',_0x91cb('0x65'),_0x91cb('0x66'),_0x91cb('0x67'),_0x91cb('0x68'),'faxCurrentCapacity',_0x91cb('0x50'),_0x91cb('0x69'),_0x91cb('0x51'),_0x91cb('0x52'),'whatsappStatus',_0x91cb('0x6a'),_0x91cb('0x40'),'chatStatusTime','openchannelStatusTime',_0x91cb('0x6b'),'smsStatusTime',_0x91cb('0x6c'),_0x91cb('0x6d'),'voiceStatusTime','queue',_0x91cb('0x6e'),'screenrecording',_0x91cb('0x6f'),_0x91cb('0x70'),_0x91cb('0x71')],_0x2f5311=['chatPause',_0x91cb('0x5d'),'mailPause',_0x91cb('0x5e'),_0x91cb('0x4c'),_0x91cb('0x5f'),_0x91cb('0x4f'),'online'];Promise[_0x91cb('0x72')]()[_0x91cb('0x10')](function(){var _0x1c8179=_[_0x91cb('0x32')](db[_0x91cb('0x43')][_0x91cb('0x73')],function(_0x14114d){return{'name':_0x14114d[_0x91cb('0x74')],'type':_0x14114d[_0x91cb('0x75')][_0x91cb('0x76')]};});_0x5752ed[_0x91cb('0x77')][_0x91cb('0x78')]='agent';_0x5752ed[_0x91cb('0x77')][_0x91cb('0x3f')]=!![];_0x4d7a34=qs[_0x91cb('0x79')](_0x1c8179,_0x5752ed);_0x4d7a34[_0x91cb('0x7a')]=!![];if(_0x5752ed[_0x91cb('0x7b')][_0x91cb('0x78')]===_0x91cb('0x7b')){var _0x47bd4d={'params':{'id':_0x5752ed[_0x91cb('0x7b')]['userProfileId']},'query':{'section':_0x91cb('0x12'),'role':_0x91cb('0x7c'),'online':!![],'nolimit':_0x5752ed[_0x91cb('0x77')][_0x91cb('0x7d')],'sort':_0x5752ed['query'][_0x91cb('0x7e')],'filter':_0x5752ed[_0x91cb('0x77')][_0x91cb('0x4e')],'raw':!![]}};return db[_0x91cb('0x7f')][_0x91cb('0x80')](_0x47bd4d);}return db[_0x91cb('0x43')]['findAndCountAll'](_0x4d7a34);})[_0x91cb('0x10')](function(_0x28bfe5){_0x1fa45a[_0x91cb('0x9')]=_0x28bfe5[_0x91cb('0x9')];_0x3f719b=_0x28bfe5[_0x91cb('0x81')];return getRealtimeAgents();})[_0x91cb('0x10')](function(_0x18b812){_0x32fb40=_0x18b812[_0x91cb('0x81')];return _0x3f719b[_0x91cb('0x32')](function(_0x457f81){var _0x1347df=_[_0x91cb('0x35')](_0x32fb40,['id',_0x457f81['id']]);if(_0x1347df)_[_0x91cb('0x36')](_0x457f81,_[_0x91cb('0x82')](_[_0x91cb('0x83')](_0x1347df,_0x2f5311),_0x4bab7d));_0x457f81[_0x91cb('0x84')]=getAgentStatus(_0x457f81);return _0x457f81;});})[_0x91cb('0x10')](function(_0x4866aa){if(_0x5752ed[_0x91cb('0x77')][_0x91cb('0x85')]){var _0x4b639d=_[_0x91cb('0x4e')](_0x4866aa,[_0x91cb('0x84'),_0x5752ed[_0x91cb('0x77')]['globalStatusFilter']]);if(_0x5752ed[_0x91cb('0x77')][_0x91cb('0x86')]){_0x4b639d=_['filter'](_0x4b639d,['pauseType',_0x5752ed[_0x91cb('0x77')]['pauseTypeFilter']]);}}_0x1fa45a[_0x91cb('0x81')]=_0x4b639d||_0x4866aa;return _0x1fa45a;})[_0x91cb('0x10')](respondWithFilteredResult(_0x1e445a,_0x4d7a34))['catch'](handleError(_0x1e445a,null));};exports[_0x91cb('0x87')]=function(_0x4ad2ea,_0x2c44ca){var _0x73febc=['mail','chat',_0x91cb('0x88'),_0x91cb('0x89'),_0x91cb('0x8a'),'whatsapp',_0x91cb('0x1e')];var _0x23a458={'count':0x0,'rows':[]},_0x98fb94={},_0x127b93,_0x570f6b,_0x440209,_0x4ee1e3,_0x342587;Promise[_0x91cb('0x72')]()[_0x91cb('0x10')](function(){if(_0x4ad2ea[_0x91cb('0x77')]['channel']){if(!_['includes'](_0x73febc,_0x4ad2ea[_0x91cb('0x77')]['channel'][_0x91cb('0x8b')]()))throw new Error(_0x91cb('0x8c'));_0x127b93=_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x8d')][_0x91cb('0x8b')]();}var _0x46874e=_[_0x91cb('0x15')](_0x127b93)+'Queue';var _0xcf93d0=_[_0x91cb('0x32')](db[_0x46874e]['rawAttributes'],function(_0x10ec48){return{'name':_0x10ec48['fieldName'],'type':_0x10ec48[_0x91cb('0x75')][_0x91cb('0x76')]};});_0x98fb94=qs[_0x91cb('0x79')](_0xcf93d0,_0x4ad2ea);if(_0x4ad2ea[_0x91cb('0x7b')][_0x91cb('0x78')]===_0x91cb('0x7b')){var _0x1459c4={'params':{'id':_0x4ad2ea[_0x91cb('0x7b')][_0x91cb('0x8e')]},'query':{'section':_0x127b93===_0x91cb('0x1e')&&_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x75')]===_0x91cb('0x8f')?_0x91cb('0x90'):_[_0x91cb('0x15')](_0x127b93)+_0x91cb('0x16'),'type':_0x4ad2ea['query'][_0x91cb('0x75')],'nolimit':!![],'sort':'name','filter':_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x4e')]}};return db[_0x91cb('0x7f')][_0x91cb('0x80')](_0x1459c4);}return db[_0x46874e][_0x91cb('0x91')](_0x98fb94);})[_0x91cb('0x10')](function(_0x324bdb){_0x23a458[_0x91cb('0x9')]=_0x324bdb['count'];_0x570f6b=_0x324bdb[_0x91cb('0x81')];return getRealtimeQueues(_0x4ad2ea,_0x127b93);})[_0x91cb('0x10')](function(_0x59defe){_0x4ee1e3=_0x59defe['rows'];return getRealtimeAgents();})[_0x91cb('0x10')](function(_0x4dfa8b){_0x440209=_0x4dfa8b['rows'];if(_0x127b93!=_0x91cb('0x1e'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x3cb938){_0x342587=_0x3cb938?_0x3cb938['rows']:[];return initializeQueues(_0x570f6b,_0x4ee1e3,_0x127b93,_0x4ad2ea[_0x91cb('0x77')][_0x91cb('0x75')]);})[_0x91cb('0x10')](function(_0x443c01){var _0x4e899c=_0x443c01[_0x91cb('0x32')](function(_0x1b5137){if(_0x127b93===_0x91cb('0x1e'))return getVoiceQueueAgents(_0x1b5137,_0x570f6b,_0x440209,_0x342587);else return getQueueAgents(_0x1b5137,_0x440209,_0x127b93);});return Promise[_0x91cb('0x92')](_0x4e899c);})[_0x91cb('0x10')](function(_0x22f871){_0x23a458[_0x91cb('0x81')]=_0x22f871;return _0x23a458;})[_0x91cb('0x10')](respondWithFilteredResult(_0x2c44ca,_0x98fb94))[_0x91cb('0x13')](handleError(_0x2c44ca,null));}; \ No newline at end of file +var _0x46ed=['smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','fieldName','key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','UserProfile','getResources','rows','omit','globalStatus','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','channel','includes','Invalid\x20channel','QueueCampaigns','Queues','type','findAndCountAll','all','util','lodash','../../components/parsers/qs','../../config/logger','api','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','talking','find','pick','filter','queue','name','length','some','connectedlinenum','internal','toString','busy','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','idle','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','faxPause','chatCapacity','mailCapacity'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x46ed,0x168));var _0xd46e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46ed[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xd46e('0x0'));var _=require(_0xd46e('0x1'));var jayson=require('jayson/promise');var qs=require(_0xd46e('0x2'));var logger=require(_0xd46e('0x3'))(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xd46e('0x5')][_0xd46e('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xd46e('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x1926d9,_0x160bcf){return function(_0x25cf78){if(_0x25cf78){var _0x45e680=typeof _0x160bcf[_0xd46e('0x7')]===_0xd46e('0x8')&&typeof _0x160bcf[_0xd46e('0x9')]===_0xd46e('0x8');var _0x19e4f4=_0x25cf78[_0xd46e('0xa')];var _0x59c88d=_0x45e680?0x0:_0x160bcf[_0xd46e('0x7')];var _0x81235b=_0x45e680?_0x25cf78['count']:_0x160bcf[_0xd46e('0x7')]+_0x160bcf[_0xd46e('0x9')];var _0x3a4397;if(_0x81235b>=_0x19e4f4){_0x81235b=_0x19e4f4;_0x3a4397=0xc8;}else{_0x3a4397=0xce;}_0x1926d9[_0xd46e('0xb')](_0x3a4397);return _0x1926d9[_0xd46e('0xc')](_0xd46e('0xd'),_0x59c88d+'-'+_0x81235b+'/'+_0x19e4f4)['json'](_0x25cf78);}return null;};}function handleError(_0x24c54b,_0x5bc1da){_0x5bc1da=_0x5bc1da||0x1f4;return function(_0x48550b){logger[_0xd46e('0xe')](_0x48550b[_0xd46e('0xf')]);if(_0x48550b['name']){delete _0x48550b['name'];}_0x24c54b[_0xd46e('0xb')](_0x5bc1da)[_0xd46e('0x10')](_0x48550b);};}function getRealtimeAgents(){return new Promise(function(_0x1e9aae,_0x3fdf88){return amiClient['request'](_0xd46e('0x11'),{})[_0xd46e('0x12')](function(_0x417402){if(_0x417402[_0xd46e('0xe')])throw new Error(_0xd46e('0x13'));var _0x47fa8f=_0x417402[_0xd46e('0x14')];return routingClient[_0xd46e('0x15')](_0xd46e('0x11'),{})['then'](function(_0x5ddd04){if(_0x5ddd04[_0xd46e('0xe')])throw new Error(_0xd46e('0x16'));var _0x488690=_0x5ddd04['result'];return _0x1e9aae(_[_0xd46e('0x17')]({},_0x47fa8f,_0x488690));});})[_0xd46e('0x18')](function(_0x362885){_0x3fdf88(_0x362885);});});}function getRealtimeQueues(_0x2273c5,_0x409010){return new Promise(function(_0x312d6f,_0x3b5fa4){var _0x327b7e=_0x409010===_0xd46e('0x19')?amiClient:routingClient;return _0x327b7e[_0xd46e('0x15')](_[_0xd46e('0x1a')](_0x409010)+'Queues',_0x2273c5)[_0xd46e('0x12')](function(_0x1c83fa){if(_0x1c83fa[_0xd46e('0xe')])throw new Error(util[_0xd46e('0x1b')](_0xd46e('0x1c'),_0x409010));return _0x312d6f(_0x1c83fa[_0xd46e('0x14')]);})[_0xd46e('0x18')](function(_0x8a1be){_0x3b5fa4(_0x8a1be);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x62dea5,_0x4cf899){return amiClient[_0xd46e('0x15')]('VoiceQueuesChannels',{})['then'](function(_0x371054){if(_0x371054[_0xd46e('0xe')])throw new Error(_0xd46e('0x1d'));return _0x62dea5(_0x371054[_0xd46e('0x14')]);})[_0xd46e('0x18')](function(_0x180851){_0x4cf899(_0x180851);});});}function initializeQueues(_0x1740d1,_0x4dab6a,_0x45d789,_0x3c301a){var _0xddbce9=[_0xd46e('0x1e'),_0xd46e('0x1f'),_0xd46e('0x20'),'talking',_0xd46e('0x21')];if(_0x45d789===_0xd46e('0x19')&&_0x3c301a===_0xd46e('0x22')){_0xddbce9[_0xd46e('0x23')](_0xd46e('0x24'),_0xd46e('0x25'),_0xd46e('0x26'),_0xd46e('0x27'),_0xd46e('0x28'),_0xd46e('0x29'),_0xd46e('0x2a'),_0xd46e('0x2b'),_0xd46e('0x2c'),'erlangCallToSecond',_0xd46e('0x2d'),_0xd46e('0x2e'),_0xd46e('0x2f'),_0xd46e('0x30'),'dialPredictiveIntervalMinThreshold',_0xd46e('0x31'),_0xd46e('0x32'),'predictiveIntervalAnsweredCalls',_0xd46e('0x33'),_0xd46e('0x34'),'predictiveIntervalAvgHoldtime',_0xd46e('0x35'));}return _0x1740d1[_0xd46e('0x36')](function(_0x1016e2){var _0x4b5e50=_0x1016e2['get']({'plain':!![]});_0x4b5e50[_0xd46e('0x37')]=[];_0x4b5e50[_0xd46e('0x21')]=0x0;_0x4b5e50[_0xd46e('0x38')]=0x0;_0x4b5e50[_0xd46e('0x1e')]=0x0;_0x4b5e50[_0xd46e('0x1f')]=0x0;_0x4b5e50[_0xd46e('0x20')]=0x0;if(_0x45d789===_0xd46e('0x19')){_0x4b5e50[_0xd46e('0x39')]=0x0;_0x4b5e50['busy']=0x0;if(_0x3c301a===_0xd46e('0x22')){_0x4b5e50[_0xd46e('0x24')]=0x0;_0x4b5e50[_0xd46e('0x25')]=0x0;}}var _0x83aec1=_[_0xd46e('0x3a')](_0x4dab6a,['id',_0x4b5e50['id']]);if(_0x83aec1)_[_0xd46e('0x17')](_0x4b5e50,_[_0xd46e('0x3b')](_0x83aec1,_0xddbce9));return _0x4b5e50;});}function updateAgentVoiceStatus(_0x5158e6,_0x163dd0,_0x357212){var _0x59bf31=_[_0xd46e('0x3c')](_0x357212,[_0xd46e('0x3d'),_0x163dd0[_0xd46e('0x3e')]]);if(_0x59bf31[_0xd46e('0x3f')]===0x0)return _0x5158e6['busy']=!![];if(_[_0xd46e('0x40')](_0x59bf31,[_0xd46e('0x41'),_0x5158e6[_0xd46e('0x42')][_0xd46e('0x43')]()]))return _0x5158e6[_0xd46e('0x39')]=!![];if(!_0x5158e6[_0xd46e('0x39')])return _0x5158e6[_0xd46e('0x44')]=!![];}function getVoiceQueueAgents(_0x411318,_0x56e8d2,_0x232e6f,_0x40aa87){var _0xc83ea1=_[_0xd46e('0x3a')](_0x56e8d2,['id',_0x411318['id']]);if(!_0xc83ea1)return _0x411318;return _0xc83ea1[_0xd46e('0x45')]({'raw':!![]})['then'](function(_0x964c66){for(var _0x53e680=0x0;_0x53e680<_0x964c66['length'];_0x53e680++){var _0x4c325f=_['find'](_0x232e6f,['id',_0x964c66[_0x53e680][_0xd46e('0x46')]]);if(!_0x4c325f){_0x4c325f={'id':_0x964c66[_0x53e680]['UserId'],'name':_0x964c66[_0x53e680][_0xd46e('0x46')],'accountcode':'','online':![]};}var _0x40720e={'id':_0x4c325f['id'],'name':_0x4c325f['name'],'internal':_0x4c325f[_0xd46e('0x47')],'online':Boolean(_0x4c325f[_0xd46e('0x48')]),'paused':Boolean(_0x964c66[_0x53e680][_0xd46e('0x21')])};if(_0x4c325f[_0xd46e('0x49')]===_0xd46e('0x39'))updateAgentVoiceStatus(_0x40720e,_0x411318,_0x40aa87);if(_0x40720e[_0xd46e('0x48')])_0x411318[_0xd46e('0x38')]++;if(_0x40720e[_0xd46e('0x44')])_0x411318[_0xd46e('0x44')]++;if(_0x40720e[_0xd46e('0x21')]&&!_0x40720e[_0xd46e('0x44')]&&!_0x40720e['talking'])_0x411318['paused']++;_0x411318['agents'][_0xd46e('0x23')](_0x40720e);}return _0x411318;});}function getQueueAgents(_0x4e1d94,_0x168d35,_0x272f5f){var _0x3fdf67=_0xd46e('0x4a')+_[_0xd46e('0x1a')](_0x272f5f)+_0xd46e('0x4b');var _0x20b238=_0x272f5f+_0xd46e('0x4c');return db[_0x3fdf67]['findAll']({'where':{[_[_0xd46e('0x1a')](_0x272f5f)+'QueueId']:_0x4e1d94['id']},'raw':!![]})[_0xd46e('0x12')](function(_0x196e51){for(var _0x41a983=0x0;_0x41a983<_0x196e51[_0xd46e('0x3f')];_0x41a983++){var _0x45e53a=_['find'](_0x168d35,['id',_0x196e51[_0x41a983][_0xd46e('0x46')]]);if(!_0x45e53a){_0x45e53a={'id':_0x196e51[_0x41a983][_0xd46e('0x46')],'name':_0x196e51[_0x41a983][_0xd46e('0x46')],'online':![],['pauseField']:![]};}var _0xac268d={'id':_0x45e53a['id'],'name':_0x45e53a[_0xd46e('0x3e')],'online':Boolean(_0x45e53a['online']),'paused':Boolean(_0x45e53a[_0x20b238])};if(_0xac268d[_0xd46e('0x48')])_0x4e1d94[_0xd46e('0x38')]++;_0x4e1d94[_0xd46e('0x37')][_0xd46e('0x23')](_0xac268d);}return _0x4e1d94;});}function isIdle(_0x324b0e){return _0x324b0e==='idle'||_0x324b0e===_0xd46e('0x4d')||_0x324b0e===_0xd46e('0x4e')||_0x324b0e===_0xd46e('0x4f')||_[_0xd46e('0x50')](_0x324b0e);}function isAgentPaused(_0x17a0c7,_0x3ed12f){var _0x433204=[_0x17a0c7[_0xd46e('0x51')],_0x17a0c7['faxPause'],_0x17a0c7[_0xd46e('0x52')],_0x17a0c7[_0xd46e('0x53')],_0x17a0c7[_0xd46e('0x54')],_0x17a0c7[_0xd46e('0x55')],_0x17a0c7[_0xd46e('0x56')]];if(!_0x3ed12f)return _['every'](_0x433204);var _0x4ae314=_[_0xd46e('0x3c')](_0x433204);return _0x4ae314[_0xd46e('0x3f')]>0x0&&_0x4ae314[_0xd46e('0x3f')]<_0x433204['length']?!![]:![];}function isAgentIdle(_0x479711){if(_0x479711[_0xd46e('0x49')]!==_0xd46e('0x57')&&_0x479711['voicePause']){_0x479711[_0xd46e('0x49')]=_0xd46e('0x58');return![];}return _[_0xd46e('0x59')]([_0x479711[_0xd46e('0x5a')],_0x479711[_0xd46e('0x5b')],_0x479711[_0xd46e('0x5c')],_0x479711[_0xd46e('0x5d')],_0x479711[_0xd46e('0x5e')],_0x479711['voiceStatus'],_0x479711[_0xd46e('0x5f')]],isIdle);}function getAgentStatus(_0x259a1d){var _0x1c7f92=_0xd46e('0x4d');if(isAgentPaused(_0x259a1d))_0x1c7f92='pause';else if(isAgentPaused(_0x259a1d,!![]))_0x1c7f92='*pause';else if(isAgentIdle(_0x259a1d))_0x1c7f92=_0xd46e('0x57');else _0x1c7f92='busy';return _0x1c7f92;}exports[_0xd46e('0x60')]=function(_0x2af20b,_0x393cb9){var _0x31f7eb={'count':0x0,'rows':[]},_0x5a7870={},_0x38dfa7,_0x492329,_0x2afb57=[_0xd46e('0x61'),'online',_0xd46e('0x62'),_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x63'),_0xd46e('0x42'),_0xd46e('0x65'),_0xd46e('0x51'),_0xd46e('0x53'),_0xd46e('0x52'),_0xd46e('0x54'),_0xd46e('0x56'),_0xd46e('0x66'),_0xd46e('0x55'),_0xd46e('0x67'),'openchannelCapacity',_0xd46e('0x68'),_0xd46e('0x69'),_0xd46e('0x6a'),_0xd46e('0x6b'),'chatCurrentCapacity',_0xd46e('0x6c'),_0xd46e('0x6d'),_0xd46e('0x6e'),_0xd46e('0x6f'),'faxCurrentCapacity',_0xd46e('0x5a'),_0xd46e('0x5d'),'mailStatus','smsStatus',_0xd46e('0x5f'),_0xd46e('0x5b'),_0xd46e('0x49'),'chatStatusTime','openchannelStatusTime',_0xd46e('0x70'),_0xd46e('0x71'),_0xd46e('0x72'),_0xd46e('0x73'),_0xd46e('0x74'),_0xd46e('0x3d'),_0xd46e('0x75'),_0xd46e('0x76'),_0xd46e('0x77'),_0xd46e('0x78'),_0xd46e('0x79')],_0x354739=[_0xd46e('0x51'),_0xd46e('0x53'),_0xd46e('0x52'),_0xd46e('0x54'),_0xd46e('0x56'),'faxPause',_0xd46e('0x55'),_0xd46e('0x48')];Promise[_0xd46e('0x7a')]()['then'](function(){var _0x41b97c=_[_0xd46e('0x36')](db['User'][_0xd46e('0x7b')],function(_0x2c86fe){return{'name':_0x2c86fe[_0xd46e('0x7c')],'type':_0x2c86fe['type'][_0xd46e('0x7d')]};});_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x7f')]='agent';_0x2af20b[_0xd46e('0x7e')]['online']=!![];_0x5a7870=qs[_0xd46e('0x80')](_0x41b97c,_0x2af20b);_0x5a7870[_0xd46e('0x81')]=!![];if(_0x2af20b[_0xd46e('0x82')]['role']===_0xd46e('0x82')){var _0x3edadc={'params':{'id':_0x2af20b[_0xd46e('0x82')][_0xd46e('0x83')]},'query':{'section':_0xd46e('0x11'),'role':_0xd46e('0x84'),'online':!![],'nolimit':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x85')],'sort':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x86')],'filter':_0x2af20b[_0xd46e('0x7e')][_0xd46e('0x3c')],'raw':!![]}};return db[_0xd46e('0x87')][_0xd46e('0x88')](_0x3edadc);}return db['User']['findAndCountAll'](_0x5a7870);})[_0xd46e('0x12')](function(_0x3e0ed5){_0x31f7eb[_0xd46e('0xa')]=_0x3e0ed5[_0xd46e('0xa')];_0x38dfa7=_0x3e0ed5[_0xd46e('0x89')];return getRealtimeAgents();})['then'](function(_0x1ed069){_0x492329=_0x1ed069[_0xd46e('0x89')];return _0x38dfa7[_0xd46e('0x36')](function(_0x7fa262){var _0x539db2=_[_0xd46e('0x3a')](_0x492329,['id',_0x7fa262['id']]);if(_0x539db2)_[_0xd46e('0x17')](_0x7fa262,_['pick'](_[_0xd46e('0x8a')](_0x539db2,_0x354739),_0x2afb57));_0x7fa262[_0xd46e('0x8b')]=getAgentStatus(_0x7fa262);return _0x7fa262;});})['then'](function(_0x38e4f8){if(_0x2af20b[_0xd46e('0x7e')]['globalStatusFilter']){var _0x44ba36=_['filter'](_0x38e4f8,[_0xd46e('0x8b'),_0x2af20b[_0xd46e('0x7e')]['globalStatusFilter']]);if(_0x2af20b['query'][_0xd46e('0x8c')]){_0x44ba36=_[_0xd46e('0x3c')](_0x44ba36,[_0xd46e('0x64'),_0x2af20b[_0xd46e('0x7e')]['pauseTypeFilter']]);}}_0x31f7eb[_0xd46e('0x89')]=_0x44ba36||_0x38e4f8;return _0x31f7eb;})[_0xd46e('0x12')](respondWithFilteredResult(_0x393cb9,_0x5a7870))['catch'](handleError(_0x393cb9,null));};exports[_0xd46e('0x8d')]=function(_0x2a2c4f,_0x2d2af0){var _0x1d8e42=[_0xd46e('0x8e'),_0xd46e('0x8f'),_0xd46e('0x90'),_0xd46e('0x91'),_0xd46e('0x92'),'whatsapp',_0xd46e('0x19')];var _0x1c1bae={'count':0x0,'rows':[]},_0x5ce170={},_0x39fe4d,_0x3ba83f,_0x1a28c1,_0x323044,_0x36fb44;Promise[_0xd46e('0x7a')]()['then'](function(){if(_0x2a2c4f['query'][_0xd46e('0x93')]){if(!_[_0xd46e('0x94')](_0x1d8e42,_0x2a2c4f['query']['channel']['toLowerCase']()))throw new Error(_0xd46e('0x95'));_0x39fe4d=_0x2a2c4f[_0xd46e('0x7e')][_0xd46e('0x93')]['toLowerCase']();}var _0x1b3cd8=_[_0xd46e('0x1a')](_0x39fe4d)+_0xd46e('0x4b');var _0x5186c9=_['map'](db[_0x1b3cd8]['rawAttributes'],function(_0x5c0740){return{'name':_0x5c0740[_0xd46e('0x7c')],'type':_0x5c0740['type'][_0xd46e('0x7d')]};});_0x5ce170=qs['getOptions'](_0x5186c9,_0x2a2c4f);if(_0x2a2c4f['user'][_0xd46e('0x7f')]===_0xd46e('0x82')){var _0x3df2c2={'params':{'id':_0x2a2c4f[_0xd46e('0x82')][_0xd46e('0x83')]},'query':{'section':_0x39fe4d===_0xd46e('0x19')&&_0x2a2c4f['query']['type']===_0xd46e('0x22')?_0xd46e('0x96'):_[_0xd46e('0x1a')](_0x39fe4d)+_0xd46e('0x97'),'type':_0x2a2c4f['query'][_0xd46e('0x98')],'nolimit':!![],'sort':_0xd46e('0x3e'),'filter':_0x2a2c4f['query'][_0xd46e('0x3c')]}};return db['UserProfile'][_0xd46e('0x88')](_0x3df2c2);}return db[_0x1b3cd8][_0xd46e('0x99')](_0x5ce170);})['then'](function(_0x59fb83){_0x1c1bae[_0xd46e('0xa')]=_0x59fb83[_0xd46e('0xa')];_0x3ba83f=_0x59fb83[_0xd46e('0x89')];return getRealtimeQueues(_0x2a2c4f,_0x39fe4d);})['then'](function(_0x24230c){_0x323044=_0x24230c[_0xd46e('0x89')];return getRealtimeAgents();})[_0xd46e('0x12')](function(_0x36edb9){_0x1a28c1=_0x36edb9[_0xd46e('0x89')];if(_0x39fe4d!=_0xd46e('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xd46e('0x12')](function(_0x14b07a){_0x36fb44=_0x14b07a?_0x14b07a[_0xd46e('0x89')]:[];return initializeQueues(_0x3ba83f,_0x323044,_0x39fe4d,_0x2a2c4f[_0xd46e('0x7e')][_0xd46e('0x98')]);})[_0xd46e('0x12')](function(_0x3c476d){var _0x1b2a6d=_0x3c476d[_0xd46e('0x36')](function(_0x1aa930){if(_0x39fe4d===_0xd46e('0x19'))return getVoiceQueueAgents(_0x1aa930,_0x3ba83f,_0x1a28c1,_0x36fb44);else return getQueueAgents(_0x1aa930,_0x1a28c1,_0x39fe4d);});return Promise[_0xd46e('0x9a')](_0x1b2a6d);})['then'](function(_0x3c9713){_0x1c1bae['rows']=_0x3c9713;return _0x1c1bae;})[_0xd46e('0x12')](respondWithFilteredResult(_0x2d2af0,_0x5ce170))[_0xd46e('0x18')](handleError(_0x2d2af0,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 18bc41c..c621762 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x51942a,_0x3bd294){var _0x2ad705=function(_0x111eaf){while(--_0x111eaf){_0x51942a['push'](_0x51942a['shift']());}};_0x2ad705(++_0x3bd294);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x571c3b,_0x2c6850){var _0x546b8e=function(_0x595bb8){while(--_0x595bb8){_0x571c3b['push'](_0x571c3b['shift']());}};_0x546b8e(++_0x2c6850);}(_0x70e0,0x17b));var _0x070e=function(_0x11490c,_0x19788b){_0x11490c=_0x11490c-0x0;var _0x4e5f1=_0x70e0[_0x11490c];return _0x4e5f1;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 88679d4..05d64b1 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 _0xa280=['INTEGER','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa280,0xc4));var _0x0a28=function(_0x1e2bda,_0x432fdf){_0x1e2bda=_0x1e2bda-0x0;var _0x5b7278=_0xa280[_0x1e2bda];return _0x5b7278;};'use strict';var Sequelize=require(_0x0a28('0x0'));module[_0x0a28('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0a28('0x2')]},'scheduledat':{'type':Sequelize[_0x0a28('0x3')]},'uniqueid':{'type':Sequelize[_0x0a28('0x2')]},'starttime':{'type':Sequelize[_0x0a28('0x3')]},'responsetime':{'type':Sequelize[_0x0a28('0x3')]},'ringtime':{'type':Sequelize[_0x0a28('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0a28('0x2')]},'campaigntype':{'type':Sequelize[_0x0a28('0x2')]},'membername':{'type':Sequelize[_0x0a28('0x2')]}}; \ No newline at end of file +var _0x3ca4=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x4e85ec,_0x2913b6){var _0x1c1ab3=function(_0x2c55b6){while(--_0x2c55b6){_0x4e85ec['push'](_0x4e85ec['shift']());}};_0x1c1ab3(++_0x2913b6);}(_0x3ca4,0x17d));var _0x43ca=function(_0x574e93,_0x539da0){_0x574e93=_0x574e93-0x0;var _0x3028a7=_0x3ca4[_0x574e93];return _0x3028a7;};'use strict';var Sequelize=require(_0x43ca('0x0'));module[_0x43ca('0x1')]={'state':{'type':Sequelize[_0x43ca('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x43ca('0x3')]},'starttime':{'type':Sequelize[_0x43ca('0x4')]},'responsetime':{'type':Sequelize[_0x43ca('0x4')]},'ringtime':{'type':Sequelize[_0x43ca('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x43ca('0x3')]},'campaigntype':{'type':Sequelize[_0x43ca('0x3')]},'membername':{'type':Sequelize[_0x43ca('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 56efe56..ac4484c 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 _0x1829=['rimraf','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','api','moment','request-promise'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x1829,0x159));var _0x9182=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1829[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x9182('0x0'));var util=require(_0x9182('0x1'));var logger=require('../../config/logger')(_0x9182('0x2'));var moment=require(_0x9182('0x3'));var BPromise=require('bluebird');var rp=require(_0x9182('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9182('0x5'));var config=require('../../config/environment');var attributes=require(_0x9182('0x6'));module[_0x9182('0x7')]=function(_0x4c31d0,_0xef1f35){return _0x4c31d0[_0x9182('0x8')]('ReportAgentPreview',attributes,{'tableName':_0x9182('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabf4=['../../config/logger','api','request-promise','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x3384ae,_0x1568e4){var _0x2223ec=function(_0x5ccae5){while(--_0x5ccae5){_0x3384ae['push'](_0x3384ae['shift']());}};_0x2223ec(++_0x1568e4);}(_0xabf4,0xbc));var _0x4abf=function(_0x4cf31f,_0x285ba6){_0x4cf31f=_0x4cf31f-0x0;var _0x5a2de3=_0xabf4[_0x4cf31f];return _0x5a2de3;};'use strict';var _=require(_0x4abf('0x0'));var util=require(_0x4abf('0x1'));var logger=require(_0x4abf('0x2'))(_0x4abf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4abf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4abf('0x5'));var attributes=require(_0x4abf('0x6'));module[_0x4abf('0x7')]=function(_0x1e846f,_0x51d845){return _0x1e846f['define'](_0x4abf('0x8'),attributes,{'tableName':_0x4abf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index df02bc3..0078104 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 _0x9547=['http','request','then','info','request\x20sent','debug','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x11ea11,_0x2fb490){var _0x568fd5=function(_0x337642){while(--_0x337642){_0x11ea11['push'](_0x11ea11['shift']());}};_0x568fd5(++_0x2fb490);}(_0x9547,0xd9));var _0x7954=function(_0xa57abd,_0xd091a1){_0xa57abd=_0xa57abd-0x0;var _0x160009=_0x9547[_0xa57abd];return _0x160009;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7954('0x0'));var BPromise=require(_0x7954('0x1'));var rs=require(_0x7954('0x2'));var fs=require('fs');var Redis=require(_0x7954('0x3'));var db=require(_0x7954('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7954('0x5'))(_0x7954('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7954('0x7')][_0x7954('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe9080b,_0x2daa56,_0x3effaa){return new BPromise(function(_0x333275,_0x27f9a7){return client[_0x7954('0x9')](_0xe9080b,_0x3effaa)[_0x7954('0xa')](function(_0x515248){logger[_0x7954('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x2daa56,_0x7954('0xc'));logger[_0x7954('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x2daa56,_0x7954('0xc'),JSON['stringify'](_0x515248));if(_0x515248[_0x7954('0xe')]){if(_0x515248['error'][_0x7954('0xf')]===0x1f4){logger[_0x7954('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x2daa56,_0x515248['error'][_0x7954('0x10')]);return _0x27f9a7(_0x515248[_0x7954('0xe')][_0x7954('0x10')]);}logger['error'](_0x7954('0x11'),_0x2daa56,_0x515248[_0x7954('0xe')][_0x7954('0x10')]);return _0x333275(_0x515248['error'][_0x7954('0x10')]);}else{logger[_0x7954('0xb')](_0x7954('0x11'),_0x2daa56,_0x7954('0xc'));_0x333275(_0x515248[_0x7954('0x12')]['message']);}})[_0x7954('0x13')](function(_0xebf8ff){logger[_0x7954('0xe')](_0x7954('0x11'),_0x2daa56,_0xebf8ff);_0x27f9a7(_0xebf8ff);});});}exports[_0x7954('0x14')]=function(_0x4173ff){var _0x4ea9ba=this;return new Promise(function(_0x4353bb,_0x215124){return db[_0x7954('0x15')][_0x7954('0x16')](_0x4173ff['body'],{'raw':_0x4173ff[_0x7954('0x17')]?_0x4173ff[_0x7954('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7954('0xa')](function(_0x262aec){logger[_0x7954('0xb')](_0x7954('0x14'),_0x4173ff);logger['debug'](_0x7954('0x14'),_0x4173ff,JSON[_0x7954('0x18')](_0x262aec));_0x4353bb(_0x262aec);})[_0x7954('0x13')](function(_0x28e42e){logger['error'](_0x7954('0x14'),_0x28e42e[_0x7954('0x10')],_0x4173ff);_0x215124(_0x4ea9ba[_0x7954('0xe')](0x1f4,_0x28e42e[_0x7954('0x10')]));});});}; \ No newline at end of file +var _0x6422=['create','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateReportAgentPreview'];(function(_0x545e77,_0x2629bc){var _0x4c8784=function(_0x4e55a0){while(--_0x4e55a0){_0x545e77['push'](_0x545e77['shift']());}};_0x4c8784(++_0x2629bc);}(_0x6422,0x1ea));var _0x2642=function(_0xf872db,_0x497522){_0xf872db=_0xf872db-0x0;var _0x1fdfe6=_0x6422[_0xf872db];return _0x1fdfe6;};'use strict';var _=require(_0x2642('0x0'));var util=require(_0x2642('0x1'));var moment=require('moment');var BPromise=require(_0x2642('0x2'));var rs=require(_0x2642('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2642('0x4'))['db'];var utils=require(_0x2642('0x5'));var logger=require(_0x2642('0x6'))(_0x2642('0x7'));var config=require(_0x2642('0x8'));var jayson=require(_0x2642('0x9'));var client=jayson[_0x2642('0xa')][_0x2642('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cb2ca,_0x195452,_0x4f2439){return new BPromise(function(_0x4cac2e,_0x2f30c4){return client['request'](_0x4cb2ca,_0x4f2439)[_0x2642('0xc')](function(_0x217d6d){logger[_0x2642('0xd')](_0x2642('0xe'),_0x195452,_0x2642('0xf'));logger[_0x2642('0x10')](_0x2642('0x11'),_0x195452,_0x2642('0xf'),JSON[_0x2642('0x12')](_0x217d6d));if(_0x217d6d['error']){if(_0x217d6d[_0x2642('0x13')]['code']===0x1f4){logger[_0x2642('0x13')](_0x2642('0xe'),_0x195452,_0x217d6d[_0x2642('0x13')][_0x2642('0x14')]);return _0x2f30c4(_0x217d6d[_0x2642('0x13')][_0x2642('0x14')]);}logger[_0x2642('0x13')](_0x2642('0xe'),_0x195452,_0x217d6d[_0x2642('0x13')]['message']);return _0x4cac2e(_0x217d6d['error'][_0x2642('0x14')]);}else{logger[_0x2642('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x195452,_0x2642('0xf'));_0x4cac2e(_0x217d6d['result']['message']);}})[_0x2642('0x15')](function(_0x10b306){logger[_0x2642('0x13')](_0x2642('0xe'),_0x195452,_0x10b306);_0x2f30c4(_0x10b306);});});}exports[_0x2642('0x16')]=function(_0x1ba006){var _0x225164=this;return new Promise(function(_0x2bb863,_0x25852f){return db['ReportAgentPreview'][_0x2642('0x17')](_0x1ba006[_0x2642('0x18')],{'raw':_0x1ba006[_0x2642('0x19')]?_0x1ba006[_0x2642('0x19')][_0x2642('0x1a')]===undefined?!![]:![]:!![]})[_0x2642('0xc')](function(_0x5a50fb){logger[_0x2642('0xd')](_0x2642('0x16'),_0x1ba006);logger[_0x2642('0x10')](_0x2642('0x16'),_0x1ba006,JSON[_0x2642('0x12')](_0x5a50fb));_0x2bb863(_0x5a50fb);})[_0x2642('0x15')](function(_0x2cbd0d){logger['error'](_0x2642('0x16'),_0x2cbd0d['message'],_0x1ba006);_0x25852f(_0x225164[_0x2642('0x13')](0x1f4,_0x2cbd0d[_0x2642('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0bc69e8..e624a9f 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 _0x13ac=['/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','smsQueues','whatsappQueues','/fax/queues','faxQueues','/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','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues'];(function(_0x3c86b4,_0x431782){var _0x268334=function(_0x77a2cc){while(--_0x77a2cc){_0x3c86b4['push'](_0x3c86b4['shift']());}};_0x268334(++_0x431782);}(_0x13ac,0xfa));var _0xc13a=function(_0x3e12ef,_0x4350f0){_0x3e12ef=_0x3e12ef-0x0;var _0x1f895f=_0x13ac[_0x3e12ef];return _0x1f895f;};'use strict';var multer=require(_0xc13a('0x0'));var util=require(_0xc13a('0x1'));var path=require('path');var express=require(_0xc13a('0x2'));var router=express[_0xc13a('0x3')]();var auth=require(_0xc13a('0x4'));var controller=require(_0xc13a('0x5'));router[_0xc13a('0x6')]('/voice/channels',auth[_0xc13a('0x7')](),controller[_0xc13a('0x8')]);router[_0xc13a('0x6')](_0xc13a('0x9'),auth[_0xc13a('0x7')](),controller[_0xc13a('0xa')]);router[_0xc13a('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xc13a('0x7')](),controller[_0xc13a('0xb')]);router[_0xc13a('0x6')](_0xc13a('0xc'),auth[_0xc13a('0x7')](),controller[_0xc13a('0xd')]);router[_0xc13a('0x6')](_0xc13a('0xe'),auth[_0xc13a('0x7')](),controller[_0xc13a('0xf')]);router[_0xc13a('0x6')](_0xc13a('0x10'),auth['isAuthenticated'](),controller[_0xc13a('0x11')]);router[_0xc13a('0x6')]('/mail/accounts',auth[_0xc13a('0x7')](),controller[_0xc13a('0x12')]);router[_0xc13a('0x6')]('/openchannel/queues',auth[_0xc13a('0x7')](),controller['openchannelQueues']);router[_0xc13a('0x6')]('/sms/queues',auth[_0xc13a('0x7')](),controller[_0xc13a('0x13')]);router[_0xc13a('0x6')]('/whatsapp/queues',auth[_0xc13a('0x7')](),controller[_0xc13a('0x14')]);router[_0xc13a('0x6')](_0xc13a('0x15'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x16')]);router[_0xc13a('0x6')](_0xc13a('0x17'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x18')]);router[_0xc13a('0x6')](_0xc13a('0x19'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x1a')]);router[_0xc13a('0x6')](_0xc13a('0x1b'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x1c')]);router[_0xc13a('0x6')](_0xc13a('0x1d'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x1e')]);router[_0xc13a('0x6')](_0xc13a('0x1f'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x20')]);router[_0xc13a('0x6')](_0xc13a('0x21'),auth[_0xc13a('0x7')](),controller['showVoiceQueues']);router['put'](_0xc13a('0x21'),auth['isAuthenticated'](),controller[_0xc13a('0x22')]);router['get'](_0xc13a('0x23'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x24')]);router[_0xc13a('0x6')]('/outbound/channels',auth[_0xc13a('0x7')](),controller['outboundChannels']);router[_0xc13a('0x6')](_0xc13a('0x25'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x26')]);router['put'](_0xc13a('0x27'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x28')]);router[_0xc13a('0x6')](_0xc13a('0x29'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x2a')]);router[_0xc13a('0x6')](_0xc13a('0x2b'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x2c')]);router[_0xc13a('0x6')]('/campaigns',auth[_0xc13a('0x7')](),controller[_0xc13a('0x2d')]);router[_0xc13a('0x6')]('/fax/accounts',auth[_0xc13a('0x7')](),controller['faxAccounts']);router['get'](_0xc13a('0x2e'),auth['isAuthenticated'](),controller[_0xc13a('0x2f')]);router[_0xc13a('0x6')]('/mail/queues/waitinginteractions',auth[_0xc13a('0x7')](),controller[_0xc13a('0x30')]);router[_0xc13a('0x6')](_0xc13a('0x31'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x32')]);router[_0xc13a('0x6')](_0xc13a('0x33'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x34')]);router[_0xc13a('0x6')](_0xc13a('0x35'),auth['isAuthenticated'](),controller[_0xc13a('0x36')]);router[_0xc13a('0x6')](_0xc13a('0x37'),auth[_0xc13a('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0xc13a('0x6')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xc13a('0x38')]);router[_0xc13a('0x39')](_0xc13a('0x3a'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x3b')]('mail'));router[_0xc13a('0x6')](_0xc13a('0x3c'),auth['isAuthenticated'](),controller[_0xc13a('0x3d')]);router['post'](_0xc13a('0x3e'),auth[_0xc13a('0x7')](),controller['queueNotify'](_0xc13a('0x3f')));router[_0xc13a('0x6')]('/chat/queues/:id',auth[_0xc13a('0x7')](),controller[_0xc13a('0x40')]);router[_0xc13a('0x39')](_0xc13a('0x41'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x3b')]('fax'));router[_0xc13a('0x6')]('/fax/queues/:id',auth[_0xc13a('0x7')](),controller[_0xc13a('0x42')]);router['post'](_0xc13a('0x43'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x3b')](_0xc13a('0x44')));router[_0xc13a('0x6')]('/openchannel/queues/:id',auth[_0xc13a('0x7')](),controller[_0xc13a('0x45')]);router[_0xc13a('0x39')](_0xc13a('0x46'),auth['isAuthenticated'](),controller[_0xc13a('0x3b')](_0xc13a('0x47')));router[_0xc13a('0x39')](_0xc13a('0x48'),auth[_0xc13a('0x7')](),controller['queueNotify'](_0xc13a('0x49')));router['get'](_0xc13a('0x4a'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x4b')]);router[_0xc13a('0x6')](_0xc13a('0x4c'),auth[_0xc13a('0x7')](),controller[_0xc13a('0x4d')]);router['post'](_0xc13a('0x4e'),auth[_0xc13a('0x7')](),controller['agentNotify']);module[_0xc13a('0x4f')]=router; \ No newline at end of file +var _0xac1e=['/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues'];(function(_0x3f596c,_0x3d4f0d){var _0x524da3=function(_0x2381df){while(--_0x2381df){_0x3f596c['push'](_0x3f596c['shift']());}};_0x524da3(++_0x3d4f0d);}(_0xac1e,0x143));var _0xeac1=function(_0x11d1dc,_0x1d7dd1){_0x11d1dc=_0x11d1dc-0x0;var _0x4a2e50=_0xac1e[_0x11d1dc];return _0x4a2e50;};'use strict';var multer=require(_0xeac1('0x0'));var util=require(_0xeac1('0x1'));var path=require(_0xeac1('0x2'));var express=require(_0xeac1('0x3'));var router=express[_0xeac1('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xeac1('0x5'));router['get'](_0xeac1('0x6'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x8')]);router[_0xeac1('0x9')](_0xeac1('0xa'),auth[_0xeac1('0x7')](),controller['voiceChannelMixMonitor']);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xeac1('0x7')](),controller[_0xeac1('0xb')]);router[_0xeac1('0x9')](_0xeac1('0xc'),auth[_0xeac1('0x7')](),controller[_0xeac1('0xd')]);router[_0xeac1('0x9')](_0xeac1('0xe'),auth[_0xeac1('0x7')](),controller['chatQueues']);router['get'](_0xeac1('0xf'),auth['isAuthenticated'](),controller['mailQueues']);router[_0xeac1('0x9')]('/mail/accounts',auth[_0xeac1('0x7')](),controller['mailAccounts']);router['get']('/openchannel/queues',auth['isAuthenticated'](),controller[_0xeac1('0x10')]);router[_0xeac1('0x9')](_0xeac1('0x11'),auth[_0xeac1('0x7')](),controller['smsQueues']);router[_0xeac1('0x9')](_0xeac1('0x12'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x13')]);router[_0xeac1('0x9')](_0xeac1('0x14'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x15')]);router['get'](_0xeac1('0x16'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x17')]);router[_0xeac1('0x9')](_0xeac1('0x18'),auth['isAuthenticated'](),controller[_0xeac1('0x19')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xeac1('0x1a')]);router[_0xeac1('0x9')](_0xeac1('0x1b'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x1c')]);router[_0xeac1('0x9')](_0xeac1('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xeac1('0x9')]('/voice/queues/:id',auth[_0xeac1('0x7')](),controller[_0xeac1('0x1e')]);router['put'](_0xeac1('0x1f'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x20')]);router['get'](_0xeac1('0x21'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x22')]);router[_0xeac1('0x9')]('/outbound/channels',auth[_0xeac1('0x7')](),controller[_0xeac1('0x23')]);router[_0xeac1('0x9')]('/agents',auth[_0xeac1('0x7')](),controller[_0xeac1('0x24')]);router['put'](_0xeac1('0x25'),auth[_0xeac1('0x7')](),controller['agentCapacity']);router[_0xeac1('0x9')](_0xeac1('0x26'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x27')]);router[_0xeac1('0x9')](_0xeac1('0x28'),auth[_0xeac1('0x7')](),controller['trunks']);router[_0xeac1('0x9')](_0xeac1('0x29'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x2a')]);router[_0xeac1('0x9')](_0xeac1('0x2b'),auth[_0xeac1('0x7')](),controller['faxAccounts']);router[_0xeac1('0x9')](_0xeac1('0x2c'),auth['isAuthenticated'](),controller[_0xeac1('0x2d')]);router[_0xeac1('0x9')](_0xeac1('0x2e'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x2f')]);router[_0xeac1('0x9')]('/openchannel/queues/waitinginteractions',auth[_0xeac1('0x7')](),controller[_0xeac1('0x30')]);router['get'](_0xeac1('0x31'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x32')]);router[_0xeac1('0x9')](_0xeac1('0x33'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x34')]);router[_0xeac1('0x9')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xeac1('0x35')]);router['get'](_0xeac1('0x36'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x37')]);router[_0xeac1('0x38')](_0xeac1('0x39'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x3a')](_0xeac1('0x3b')));router[_0xeac1('0x9')](_0xeac1('0x3c'),auth[_0xeac1('0x7')](),controller['showMailQueues']);router[_0xeac1('0x38')](_0xeac1('0x3d'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x3a')](_0xeac1('0x3e')));router[_0xeac1('0x9')](_0xeac1('0x3f'),auth[_0xeac1('0x7')](),controller['showChatQueues']);router['post'](_0xeac1('0x40'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x3a')](_0xeac1('0x41')));router[_0xeac1('0x9')](_0xeac1('0x42'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x43')]);router[_0xeac1('0x38')](_0xeac1('0x44'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x3a')](_0xeac1('0x45')));router['get'](_0xeac1('0x46'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x47')]);router[_0xeac1('0x38')](_0xeac1('0x48'),auth['isAuthenticated'](),controller['queueNotify'](_0xeac1('0x49')));router[_0xeac1('0x38')](_0xeac1('0x4a'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x3a')]('whatsapp'));router[_0xeac1('0x9')]('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xeac1('0x9')](_0xeac1('0x4b'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0xeac1('0x38')](_0xeac1('0x4c'),auth[_0xeac1('0x7')](),controller[_0xeac1('0x4d')]);module[_0xeac1('0x4e')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 21a2fb8..82bc8d5 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 _0x1cb9=['query','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','findOrCreate','agent','AgentCapacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','map','value','filter','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','findOne','\x20Queue\x20not\x20found','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','bluebird','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','then','error','code','message','result','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','merge'];(function(_0x449216,_0x33b40f){var _0x23443c=function(_0x42be42){while(--_0x42be42){_0x449216['push'](_0x449216['shift']());}};_0x23443c(++_0x33b40f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2905dd,_0x1a93c5){_0x2905dd=_0x2905dd-0x0;var _0x438692=_0x1cb9[_0x2905dd];return _0x438692;};'use strict';var BPromise=require(_0x91cb('0x0'));var moment=require('moment');var _=require(_0x91cb('0x1'));var util=require(_0x91cb('0x2'));var db=require(_0x91cb('0x3'))['db'];var logger=require(_0x91cb('0x4'))('api');var jayson=require(_0x91cb('0x5'));var amiClient=jayson[_0x91cb('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0x91cb('0x6')][_0x91cb('0x7')]({'port':0x232b});var routingClient=jayson[_0x91cb('0x6')][_0x91cb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){var _0x2fdfce=_0x4c1f56?_0x4c1f56:amiClient;return _0x2fdfce['request'](_0x3b9d98,_0x8f8a3b)[_0x91cb('0x8')](function(_0x317df0){if(_0x317df0[_0x91cb('0x9')]){if(_0x317df0[_0x91cb('0x9')][_0x91cb('0xa')]===0x1f4){return _0x5bda2f(_0x317df0[_0x91cb('0x9')][_0x91cb('0xb')]);}return _0x15c517(_0x317df0[_0x91cb('0x9')][_0x91cb('0xb')]);}else{_0x15c517(_0x317df0[_0x91cb('0xc')]);}})['catch'](function(_0x3c1f56){_0x5bda2f(_0x3c1f56);});});}function respondWithResult(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xc8;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0xd')](_0x4ba2f2)[_0x91cb('0xe')](_0x20e6e0);}return _0x366f09[_0x91cb('0xf')](0x194);};}function handleError(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0x1f4;return function(_0x4aae25){logger[_0x91cb('0x9')](_0x4aae25['stack']);if(_0x4aae25['name']){delete _0x4aae25[_0x91cb('0x10')];}_0x4a7d45[_0x91cb('0xd')](_0x4cc6ef)[_0x91cb('0x11')](_0x4aae25);};}function findById(_0x5ea796){return function(_0x238f11){if(!_[_0x91cb('0x12')](_0x5ea796)&&!_['isNil'](_0x238f11)&&!_[_0x91cb('0x12')](_0x238f11[_0x91cb('0x13')])){return _[_0x91cb('0x14')](_0x238f11[_0x91cb('0x13')],function(_0x5cc1c3){return _0x5cc1c3['id']==_0x5ea796;});}return null;};}exports[_0x91cb('0x15')]=function(_0x7dcf60,_0x4ca8e8){return respondWithRpcPromise(_0x91cb('0x16'),_0x7dcf60['query'])['then'](respondWithResult(_0x4ca8e8,null))[_0x91cb('0x17')](handleError(_0x4ca8e8,null));};exports[_0x91cb('0x18')]=function(_0x56e409,_0x51a1d5){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x91cb('0x19')](_0x56e409[_0x91cb('0x1a')],_0x56e409[_0x91cb('0x1b')]))[_0x91cb('0x8')](respondWithResult(_0x51a1d5,null))['catch'](handleError(_0x51a1d5,null));};exports[_0x91cb('0x1c')]=function(_0x43881c,_0x1fa837){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x91cb('0x19')](_0x43881c[_0x91cb('0x1a')],_0x43881c[_0x91cb('0x1b')]))[_0x91cb('0x8')](respondWithResult(_0x1fa837,null))[_0x91cb('0x17')](handleError(_0x1fa837,null));};exports[_0x91cb('0x1d')]=function(_0x414e60,_0x423c4f){return respondWithRpcPromise(_0x91cb('0x1e'),_0x414e60['query'])['then'](respondWithResult(_0x423c4f,null))[_0x91cb('0x17')](handleError(_0x423c4f,null));};exports['showVoiceQueues']=function(_0x1c67d2,_0x34d372){return respondWithRpcPromise(_0x91cb('0x1e'),_0x1c67d2['query'])[_0x91cb('0x8')](findById(_0x1c67d2['params']['id']))[_0x91cb('0x8')](respondWithResult(_0x34d372,null))[_0x91cb('0x17')](handleError(_0x34d372,null));};exports[_0x91cb('0x1f')]=function(_0x2fb473,_0x468908){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x91cb('0x19')](_0x2fb473['body'],_0x2fb473[_0x91cb('0x1b')]))[_0x91cb('0x8')](respondWithResult(_0x468908,null))[_0x91cb('0x17')](handleError(_0x468908,null));};exports['voiceQueuesPreview']=function(_0x775c25,_0x146e1f){return respondWithRpcPromise(_0x91cb('0x20'),_[_0x91cb('0x19')](_0x775c25[_0x91cb('0x1a')],_0x775c25[_0x91cb('0x1b')]))[_0x91cb('0x8')](respondWithResult(_0x146e1f,null))[_0x91cb('0x17')](handleError(_0x146e1f,null));};exports[_0x91cb('0x21')]=function(_0x5e6ed3,_0x2ccf6e){return respondWithRpcPromise(_0x91cb('0x22'),_0x5e6ed3[_0x91cb('0x1a')])[_0x91cb('0x8')](respondWithResult(_0x2ccf6e,null))[_0x91cb('0x17')](handleError(_0x2ccf6e,null));};exports['voiceQueuesChannel']=function(_0x2409d3,_0x74b443){return respondWithRpcPromise(_0x91cb('0x23'),_[_0x91cb('0x19')](_0x2409d3[_0x91cb('0x1a')],_0x2409d3['params']))[_0x91cb('0x8')](respondWithResult(_0x74b443,null))['catch'](handleError(_0x74b443,null));};exports['voiceQueuesChannelHangup']=function(_0x479968,_0x2011fc){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x91cb('0x19')](_0x479968['query'],_0x479968['params']))[_0x91cb('0x8')](respondWithResult(_0x2011fc,null))[_0x91cb('0x17')](handleError(_0x2011fc,null));};exports[_0x91cb('0x24')]=function(_0x14319b,_0x2d8fb9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x91cb('0x19')](_0x14319b[_0x91cb('0x1a')],_0x14319b[_0x91cb('0x1b')]))[_0x91cb('0x8')](respondWithResult(_0x2d8fb9,null))['catch'](handleError(_0x2d8fb9,null));};exports['outbound']=function(_0x1eed21,_0x135bf1){return respondWithRpcPromise('Outbound',_0x1eed21[_0x91cb('0x1a')])[_0x91cb('0x8')](respondWithResult(_0x135bf1,null))['catch'](handleError(_0x135bf1,null));};exports[_0x91cb('0x25')]=function(_0xddc409,_0x5f456c){return respondWithRpcPromise(_0x91cb('0x26'),_0xddc409['query'])[_0x91cb('0x8')](respondWithResult(_0x5f456c,null))[_0x91cb('0x17')](handleError(_0x5f456c,null));};exports[_0x91cb('0x27')]=function(_0x279ad5,_0x51d0ea){var _0x20bf50;return respondWithRpcPromise('Agents',_0x279ad5[_0x91cb('0x1a')])[_0x91cb('0x8')](function(_0x4e5b4b){_0x20bf50=_0x4e5b4b;return respondWithRpcPromise(_0x91cb('0x28'),_0x279ad5['query'],routingClient);})[_0x91cb('0x8')](function(_0x2eac87){return _[_0x91cb('0x19')]({},_0x2eac87,_0x20bf50);})[_0x91cb('0x8')](respondWithResult(_0x51d0ea,null))['catch'](handleError(_0x51d0ea,null));};exports[_0x91cb('0x29')]=function(_0x5af0e6,_0x2cf27e){if(_0x5af0e6[_0x91cb('0x2a')]&&_0x5af0e6[_0x91cb('0x2a')][_0x91cb('0x2b')]&&_0x5af0e6[_0x91cb('0x2c')]&&_0x5af0e6[_0x91cb('0x2c')][_0x91cb('0x10')]){for(var _0x3cc4c1 in _0x5af0e6['body'][_0x91cb('0x2b')]){if(_0x5af0e6['body'][_0x91cb('0x2b')]['hasOwnProperty'](_0x3cc4c1)){db[_0x91cb('0x2d')]['findAll']({'where':{'channel':_0x3cc4c1,'membername':_0x5af0e6[_0x91cb('0x2c')][_0x91cb('0x10')],'type':_0x91cb('0x2e'),'exitAt':null,'uniqueid':_0x5af0e6[_0x91cb('0x2a')]['interaction'][_0x3cc4c1]&&_0x5af0e6[_0x91cb('0x2a')][_0x91cb('0x2b')][_0x3cc4c1]['length']?{'$notIn':_0x5af0e6[_0x91cb('0x2a')][_0x91cb('0x2b')][_0x3cc4c1]}:{'$ne':null}}})[_0x91cb('0x8')](function(_0x32517d){var _0x267efb=moment()[_0x91cb('0x2f')](_0x91cb('0x30'));for(var _0x29d5a1=0x0,_0x396b81=_0x32517d['length'];_0x29d5a1<_0x396b81;_0x29d5a1+=0x1){_0x32517d[_0x29d5a1][_0x91cb('0x31')]({'exitAt':_0x267efb});}});for(var _0x3e20d1=0x0;_0x3e20d1<_0x5af0e6[_0x91cb('0x2a')][_0x91cb('0x2b')][_0x3cc4c1][_0x91cb('0x32')];_0x3e20d1+=0x1){db[_0x91cb('0x2d')][_0x91cb('0x33')]({'where':{'channel':_0x3cc4c1,'membername':_0x5af0e6[_0x91cb('0x2c')]['name'],'type':_0x91cb('0x2e'),'uniqueid':_0x5af0e6[_0x91cb('0x2a')][_0x91cb('0x2b')][_0x3cc4c1][_0x3e20d1],'exitAt':null},'defaults':{'channel':_0x3cc4c1,'membername':_0x5af0e6[_0x91cb('0x2c')]['name'],'interface':_[_0x91cb('0x12')](_0x5af0e6[_0x91cb('0x2c')]['interface'])?util[_0x91cb('0x2f')]('SIP/%s',_0x5af0e6[_0x91cb('0x2c')]['name']):_0x5af0e6['user']['interface'],'type':_0x91cb('0x2e'),'enterAt':moment()[_0x91cb('0x2f')](_0x91cb('0x30')),'role':_0x91cb('0x34'),'internal':_0x5af0e6[_0x91cb('0x2c')]['internal'],'uniqueid':_0x5af0e6['body'][_0x91cb('0x2b')][_0x3cc4c1][_0x3e20d1]}});}}}}return respondWithRpcPromise(_0x91cb('0x35'),{'id':_0x5af0e6[_0x91cb('0x1b')]['id'],'capacity':_0x5af0e6[_0x91cb('0x2a')]['capacity']},routingClient)['then'](respondWithResult(_0x2cf27e,null))['catch'](handleError(_0x2cf27e,null));};exports[_0x91cb('0x36')]=function(_0x490417,_0x3f22a1){return respondWithRpcPromise('Telephones',_0x490417[_0x91cb('0x1a')])[_0x91cb('0x8')](respondWithResult(_0x3f22a1,null))[_0x91cb('0x17')](handleError(_0x3f22a1,null));};exports[_0x91cb('0x37')]=function(_0x1884bc,_0x362532){return respondWithRpcPromise(_0x91cb('0x38'),_0x1884bc[_0x91cb('0x1a')])[_0x91cb('0x8')](respondWithResult(_0x362532,null))[_0x91cb('0x17')](handleError(_0x362532,null));};exports[_0x91cb('0x39')]=function(_0x5752ed,_0x1e445a){return respondWithRpcPromise(_0x91cb('0x3a'),_0x5752ed['query'])[_0x91cb('0x8')](respondWithResult(_0x1e445a,null))[_0x91cb('0x17')](handleError(_0x1e445a,null));};exports['chatQueues']=function(_0x2f5311,_0x166eeb){return respondWithRpcPromise(_0x91cb('0x3b'),_0x2f5311[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x166eeb,null))[_0x91cb('0x17')](handleError(_0x166eeb,null));};exports[_0x91cb('0x3c')]=function(_0x274fff,_0x3320bd){return respondWithRpcPromise(_0x91cb('0x3b'),_0x274fff[_0x91cb('0x1a')],routingClient)['then'](findById(_0x274fff[_0x91cb('0x1b')]['id']))['then'](respondWithResult(_0x3320bd,null))[_0x91cb('0x17')](handleError(_0x3320bd,null));};exports['mailQueues']=function(_0x3dfff9,_0x1b2fec){return respondWithRpcPromise(_0x91cb('0x3d'),_0x3dfff9['query'],routingClient)[_0x91cb('0x8')](respondWithResult(_0x1b2fec,null))[_0x91cb('0x17')](handleError(_0x1b2fec,null));};exports['showMailQueues']=function(_0xef4754,_0x102025){return respondWithRpcPromise(_0x91cb('0x3d'),_0xef4754[_0x91cb('0x1a')],routingClient)['then'](findById(_0xef4754[_0x91cb('0x1b')]['id']))[_0x91cb('0x8')](respondWithResult(_0x102025,null))[_0x91cb('0x17')](handleError(_0x102025,null));};exports[_0x91cb('0x3e')]=function(_0x55a0e3,_0x11025a){return respondWithRpcPromise(_0x91cb('0x3f'),_0x55a0e3['query'],mailClient)['then'](respondWithResult(_0x11025a,null))[_0x91cb('0x17')](handleError(_0x11025a,null));};exports['openchannelQueues']=function(_0x1180ac,_0x1237fd){return respondWithRpcPromise('OpenchannelQueues',_0x1180ac['query'],routingClient)[_0x91cb('0x8')](respondWithResult(_0x1237fd,null))['catch'](handleError(_0x1237fd,null));};exports[_0x91cb('0x40')]=function(_0x961ebf,_0x33de58){return respondWithRpcPromise('OpenchannelQueues',_0x961ebf[_0x91cb('0x1a')],routingClient)['then'](findById(_0x961ebf[_0x91cb('0x1b')]['id']))[_0x91cb('0x8')](respondWithResult(_0x33de58,null))[_0x91cb('0x17')](handleError(_0x33de58,null));};exports[_0x91cb('0x41')]=function(_0x483172,_0xb37f8e){return respondWithRpcPromise(_0x91cb('0x42'),_0x483172[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0xb37f8e,null))[_0x91cb('0x17')](handleError(_0xb37f8e,null));};exports[_0x91cb('0x43')]=function(_0x14114d,_0x2785f9){return respondWithRpcPromise(_0x91cb('0x42'),_0x14114d[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](findById(_0x14114d[_0x91cb('0x1b')]['id']))['then'](respondWithResult(_0x2785f9,null))[_0x91cb('0x17')](handleError(_0x2785f9,null));};exports[_0x91cb('0x44')]=function(_0x474682,_0x51ab8a){return respondWithRpcPromise(_0x91cb('0x45'),_0x474682[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x51ab8a,null))['catch'](handleError(_0x51ab8a,null));};exports[_0x91cb('0x46')]=function(_0x5a3c7d,_0x4484d6){return respondWithRpcPromise(_0x91cb('0x45'),_0x5a3c7d[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](findById(_0x5a3c7d['params']['id']))[_0x91cb('0x8')](respondWithResult(_0x4484d6,null))[_0x91cb('0x17')](handleError(_0x4484d6,null));};exports[_0x91cb('0x47')]=function(_0x404b50,_0x1bb16f){return respondWithRpcPromise(_0x91cb('0x48'),_0x404b50['query'],routingClient)[_0x91cb('0x8')](respondWithResult(_0x1bb16f,null))[_0x91cb('0x17')](handleError(_0x1bb16f,null));};exports[_0x91cb('0x49')]=function(_0x1f0ba2,_0x891569){return respondWithRpcPromise(_0x91cb('0x48'),_0x1f0ba2[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](findById(_0x1f0ba2[_0x91cb('0x1b')]['id']))[_0x91cb('0x8')](respondWithResult(_0x891569,null))[_0x91cb('0x17')](handleError(_0x891569,null));};exports[_0x91cb('0x4a')]=function(_0xda123b,_0x3eead5){return respondWithRpcPromise(_0x91cb('0x4b'),_0xda123b[_0x91cb('0x1a')])[_0x91cb('0x8')](respondWithResult(_0x3eead5,null))['catch'](handleError(_0x3eead5,null));};exports[_0x91cb('0x4c')]=function(_0x1455cd,_0x4b639d){return respondWithRpcPromise(_0x91cb('0x4d'),_0x1455cd[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x4b639d,null))['catch'](handleError(_0x4b639d,null));};exports[_0x91cb('0x4e')]=function(_0x6ecba8,_0x5cd31c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x6ecba8[_0x91cb('0x1a')],routingClient)['then'](respondWithResult(_0x5cd31c,null))[_0x91cb('0x17')](handleError(_0x5cd31c,null));};exports[_0x91cb('0x4f')]=function(_0x4e11e3,_0x43a8b1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4e11e3[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x43a8b1,null))['catch'](handleError(_0x43a8b1,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x16a21f,_0x43be3e){return respondWithRpcPromise(_0x91cb('0x50'),_0x16a21f['query'],routingClient)[_0x91cb('0x8')](function(_0x23a458){if(_0x16a21f[_0x91cb('0x1a')][_0x91cb('0x51')]!==undefined){var _0x570f6b=_(_0x23a458[_0x91cb('0x13')])['filter']([_0x16a21f[_0x91cb('0x1a')][_0x91cb('0x51')],_0x16a21f[_0x91cb('0x1b')]['id']])[_0x91cb('0x52')]('queue_id')['uniq']()[_0x91cb('0x53')]();return _0x23a458['rows'][_0x91cb('0x54')](function(_0x3dc6f9){return _0x570f6b[_0x91cb('0x55')](_0x3dc6f9[_0x91cb('0x56')])>-0x1;});}else{return _0x23a458[_0x91cb('0x13')][_0x91cb('0x54')](function(_0x12d3d1){return _0x12d3d1['queue_id']===parseInt(_0x16a21f[_0x91cb('0x1b')]['id']);});}})[_0x91cb('0x8')](respondWithResult(_0x43be3e,null))['catch'](handleError(_0x43be3e,null));};exports[_0x91cb('0x57')]=function(_0x4d5862,_0x35525c){return respondWithRpcPromise(_0x91cb('0x58'),_0x4d5862[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x35525c,null))[_0x91cb('0x17')](handleError(_0x35525c,null));};exports[_0x91cb('0x59')]=function(_0x1459c4,_0x30259d){return respondWithRpcPromise(_0x91cb('0x5a'),_0x1459c4[_0x91cb('0x1a')],routingClient)[_0x91cb('0x8')](respondWithResult(_0x30259d,null))[_0x91cb('0x17')](handleError(_0x30259d,null));};exports[_0x91cb('0x5b')]=function(_0x14882d,_0x22ba54){return respondWithRpcPromise(_0x91cb('0x5c'),_0x14882d['query'],routingClient)[_0x91cb('0x8')](respondWithResult(_0x22ba54,null))['catch'](handleError(_0x22ba54,null));};exports[_0x91cb('0x5d')]=function(_0x123d72){return function(_0x13f358,_0x422928){var _0x319289,_0x1fa3c7;var _0x324bdb=_[_0x91cb('0x5e')](_0x123d72);var _0x569df1=_0x123d72===_0x91cb('0x5f')?_0x91cb('0x60'):'Account';return db[_0x324bdb+'Queue'][_0x91cb('0x61')]({'raw':!![],'where':{'id':_0x13f358['params']['id']}})['then'](function(_0x95f2de){if(_['isNil'](_0x95f2de)){throw new Error(_0x324bdb+_0x91cb('0x62'));}_0x319289=_0x95f2de;return db[_0x324bdb+'Message'][_0x91cb('0x61')]({'where':{'id':_0x13f358[_0x91cb('0x2a')][_0x91cb('0x63')]},'include':[{'model':db[_0x324bdb+_0x91cb('0x64')],'as':'Interaction'},{'model':db[_0x324bdb+_0x569df1],'as':_0x91cb('0x65')}]});})[_0x91cb('0x8')](function(_0x42d07b){if(_[_0x91cb('0x12')](_0x42d07b)){throw new Error(_0x324bdb+_0x91cb('0x66'));}_0x1fa3c7=_0x42d07b;return _0x42d07b[_0x91cb('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x91cb('0x8')](function(){var _0x3cf8c5={'uniqueid':_0x123d72+'.'+_0x1fa3c7['id']+'.'+_0x1fa3c7[_0x91cb('0x64')]['id'],'FromUserId':_0x13f358[_0x91cb('0x2c')]['id'],'type':_0x91cb('0x68')};_0x3cf8c5[_0x324bdb+_0x91cb('0x69')]=_0x1fa3c7['id'];_0x3cf8c5[_0x324bdb+_0x91cb('0x6a')]=_0x1fa3c7[_0x91cb('0x64')]['id'];_0x3cf8c5[_0x91cb('0x6b')+_0x324bdb+_0x569df1+'Id']=_0x1fa3c7[_0x91cb('0x65')]['id'];_0x3cf8c5['To'+_0x324bdb+_0x91cb('0x6c')]=_0x319289['id'];return db[_0x324bdb+_0x91cb('0x6d')][_0x91cb('0x6e')](_0x3cf8c5);})[_0x91cb('0x8')](function(){return respondWithRpcPromise(_0x91cb('0x6f'),{'channel':_0x123d72,'interaction':_0x1fa3c7[_0x91cb('0x64')],'message':_0x1fa3c7,'account':_0x1fa3c7[_0x91cb('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x91cb('0x68'),'appdata':_0x319289[_0x91cb('0x10')]+','+(_0x1fa3c7['Account'][_0x91cb('0x70')]||0x12c),'interval':_0x91cb('0x71')}]},routingClient);})[_0x91cb('0x8')](respondWithResult(_0x422928,null))[_0x91cb('0x17')](handleError(_0x422928,null));};};exports[_0x91cb('0x72')]=function(_0x650ac9,_0x404457){var _0xa9de8b,_0x3bf154;if(_[_0x91cb('0x12')](_0x650ac9[_0x91cb('0x2a')]['channel'])){throw new Error(_0x91cb('0x73'));}var _0x4c459a=_0x650ac9['body'][_0x91cb('0x74')];var _0x265ffb=_[_0x91cb('0x5e')](_0x4c459a);var _0x446738=_0x4c459a===_0x91cb('0x5f')?_0x91cb('0x60'):_0x91cb('0x65');return db[_0x91cb('0x75')][_0x91cb('0x61')]({'raw':!![],'where':{'id':_0x650ac9[_0x91cb('0x1b')]['id'],'role':'agent'}})[_0x91cb('0x8')](function(_0xb784d5){if(_['isNil'](_0xb784d5)){throw new Error(_0x91cb('0x76'));}_0xa9de8b=_0xb784d5;return db[_0x265ffb+_0x91cb('0x77')]['findOne']({'where':{'id':_0x650ac9[_0x91cb('0x2a')][_0x91cb('0x63')]},'include':[{'model':db[_0x265ffb+_0x91cb('0x64')],'as':_0x91cb('0x64')},{'model':db[_0x265ffb+_0x446738],'as':_0x91cb('0x65')}]});})[_0x91cb('0x8')](function(_0x65c551){if(_[_0x91cb('0x12')](_0x65c551)){throw new Error(_0x265ffb+_0x91cb('0x66'));}_0x3bf154=_0x65c551;return _0x65c551[_0x91cb('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x91cb('0x8')](function(){var _0x378cd0={'uniqueid':_0x4c459a+'.'+_0x3bf154['id']+'.'+_0x3bf154['Interaction']['id'],'FromUserId':_0x650ac9['user']['id'],'type':_0x91cb('0x68'),'ToUserId':_0xa9de8b['id']};_0x378cd0[_0x265ffb+_0x91cb('0x69')]=_0x3bf154['id'];_0x378cd0[_0x265ffb+_0x91cb('0x6a')]=_0x3bf154[_0x91cb('0x64')]['id'];_0x378cd0[_0x91cb('0x6b')+_0x265ffb+_0x446738+'Id']=_0x3bf154[_0x91cb('0x65')]['id'];return db[_0x265ffb+_0x91cb('0x6d')]['create'](_0x378cd0);})[_0x91cb('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x4c459a,'interaction':_0x3bf154[_0x91cb('0x64')],'message':_0x3bf154,'account':_0x3bf154[_0x91cb('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x91cb('0x34'),'appdata':_0xa9de8b[_0x91cb('0x10')]+','+(_0x3bf154[_0x91cb('0x65')]['agentTransferTimeout']||0x12c),'interval':_0x91cb('0x71')}]},routingClient);})[_0x91cb('0x8')](respondWithResult(_0x404457,null))[_0x91cb('0x17')](handleError(_0x404457,null));}; \ No newline at end of file +var _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed1f,0x6a));var _0xfed1=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xed1f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 432ef65..4e494ff 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 _0x00b7=['delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','run','post','put','update'];(function(_0x5d90ff,_0xe1e7ab){var _0x50995c=function(_0x562a5d){while(--_0x562a5d){_0x5d90ff['push'](_0x5d90ff['shift']());}};_0x50995c(++_0xe1e7ab);}(_0x00b7,0xbf));var _0x700b=function(_0x39313b,_0x573802){_0x39313b=_0x39313b-0x0;var _0x45791b=_0x00b7[_0x39313b];return _0x45791b;};'use strict';var multer=require(_0x700b('0x0'));var util=require(_0x700b('0x1'));var path=require(_0x700b('0x2'));var timeout=require(_0x700b('0x3'));var express=require(_0x700b('0x4'));var router=express['Router']();var fs_extra=require(_0x700b('0x5'));var auth=require(_0x700b('0x6'));var interaction=require(_0x700b('0x7'));var config=require(_0x700b('0x8'));var controller=require(_0x700b('0x9'));router[_0x700b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x700b('0xa')](_0x700b('0xb'),auth[_0x700b('0xc')](),controller[_0x700b('0xd')]);router[_0x700b('0xa')]('/:id/run',auth[_0x700b('0xc')](),controller[_0x700b('0xe')]);router[_0x700b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x700b('0x10')](_0x700b('0xb'),auth[_0x700b('0xc')](),controller[_0x700b('0x11')]);router[_0x700b('0x12')]('/:id',auth[_0x700b('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2414=['./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4f26ce,_0x40c07a){var _0xe34723=function(_0x1a87d6){while(--_0x1a87d6){_0x4f26ce['push'](_0x4f26ce['shift']());}};_0xe34723(++_0x40c07a);}(_0x2414,0x8b));var _0x4241=function(_0x26e7c2,_0x569eab){_0x26e7c2=_0x26e7c2-0x0;var _0x2da461=_0x2414[_0x26e7c2];return _0x2da461;};'use strict';var multer=require(_0x4241('0x0'));var util=require(_0x4241('0x1'));var path=require(_0x4241('0x2'));var timeout=require('connect-timeout');var express=require(_0x4241('0x3'));var router=express['Router']();var fs_extra=require(_0x4241('0x4'));var auth=require(_0x4241('0x5'));var interaction=require(_0x4241('0x6'));var config=require(_0x4241('0x7'));var controller=require(_0x4241('0x8'));router[_0x4241('0x9')]('/',auth[_0x4241('0xa')](),controller[_0x4241('0xb')]);router[_0x4241('0x9')](_0x4241('0xc'),auth['isAuthenticated'](),controller[_0x4241('0xd')]);router[_0x4241('0x9')](_0x4241('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x4241('0xf')]('/',auth[_0x4241('0xa')](),controller['create']);router[_0x4241('0x10')](_0x4241('0xc'),auth[_0x4241('0xa')](),controller[_0x4241('0x11')]);router[_0x4241('0x12')]('/:id',auth[_0x4241('0xa')](),controller[_0x4241('0x13')]);module[_0x4241('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index dbb374c..29f9369 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 _0x9cfd=['years','quarters','months','weeks','minutes','days','ENUM','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x2cba09,_0x23ee85){var _0x10d084=function(_0x11d2e4){while(--_0x11d2e4){_0x2cba09['push'](_0x2cba09['shift']());}};_0x10d084(++_0x23ee85);}(_0x9cfd,0xb8));var _0xd9cf=function(_0x85d1fa,_0x479283){_0x85d1fa=_0x85d1fa-0x0;var _0x1c2be8=_0x9cfd[_0x85d1fa];return _0x1c2be8;};'use strict';var Sequelize=require(_0xd9cf('0x0'));module[_0xd9cf('0x1')]={'name':{'type':Sequelize[_0xd9cf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd9cf('0x2')]},'active':{'type':Sequelize[_0xd9cf('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd9cf('0x2')],'allowNull':![],'defaultValue':_0xd9cf('0x4')},'startAt':{'type':Sequelize[_0xd9cf('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd9cf('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xd9cf('0x6'),_0xd9cf('0x7'),_0xd9cf('0x8'),_0xd9cf('0x9'),'days','hours',_0xd9cf('0xa')),'allowNull':![],'defaultValue':_0xd9cf('0xb')},'output':{'type':Sequelize[_0xd9cf('0xc')]('csv',_0xd9cf('0xd'),_0xd9cf('0xe')),'allowNull':![],'defaultValue':_0xd9cf('0xf')},'type':{'type':Sequelize[_0xd9cf('0xc')](_0xd9cf('0x10'),_0xd9cf('0x11')),'allowNull':![],'defaultValue':_0xd9cf('0x10')},'sendMail':{'type':Sequelize[_0xd9cf('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd9cf('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd9cf('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xd9cf('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8705=['custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks','days','hours','minutes','ENUM','csv','pdf','xlsx'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8705,0x132));var _0x5870=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8705[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x5870('0x0'));module[_0x5870('0x1')]={'name':{'type':Sequelize[_0x5870('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5870('0x2')]},'active':{'type':Sequelize[_0x5870('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5870('0x2')],'allowNull':![],'defaultValue':_0x5870('0x4')},'startAt':{'type':Sequelize[_0x5870('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5870('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x5870('0x7'),'quarters',_0x5870('0x8'),_0x5870('0x9'),_0x5870('0xa'),_0x5870('0xb'),_0x5870('0xc')),'allowNull':![],'defaultValue':_0x5870('0xa')},'output':{'type':Sequelize[_0x5870('0xd')](_0x5870('0xe'),_0x5870('0xf'),_0x5870('0x10')),'allowNull':![],'defaultValue':_0x5870('0xe')},'type':{'type':Sequelize[_0x5870('0xd')](_0x5870('0x11'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5870('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x5870('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x5870('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 5845772..ef11e4a 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 _0xb218=['params','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show'];(function(_0x5499ab,_0x4c1128){var _0x344478=function(_0x5d767e){while(--_0x5d767e){_0x5499ab['push'](_0x5499ab['shift']());}};_0x344478(++_0x4c1128);}(_0xb218,0x169));var _0x8b21=function(_0x8871dd,_0x1ccd88){_0x8871dd=_0x8871dd-0x0;var _0x30319e=_0xb218[_0x8871dd];return _0x30319e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b21('0x0'));var jsonpatch=require(_0x8b21('0x1'));var rp=require(_0x8b21('0x2'));var moment=require(_0x8b21('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8b21('0x4'));var util=require(_0x8b21('0x5'));var path=require(_0x8b21('0x6'));var sox=require(_0x8b21('0x7'));var csv=require(_0x8b21('0x8'));var ejs=require(_0x8b21('0x9'));var fs=require('fs');var fs_extra=require(_0x8b21('0xa'));var _=require(_0x8b21('0xb'));var squel=require('squel');var crypto=require(_0x8b21('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8b21('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b21('0xe'));var Redis=require(_0x8b21('0xf'));var authService=require(_0x8b21('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8b21('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b21('0x12'))(_0x8b21('0x13'));var utils=require(_0x8b21('0x14'));var config=require(_0x8b21('0x15'));var licenseUtil=require(_0x8b21('0x16'));var db=require(_0x8b21('0x17'))['db'];function respondWithStatusCode(_0x4f8501,_0x2e3542){_0x2e3542=_0x2e3542||0xcc;return function(_0x4bf241){if(_0x4bf241){return _0x4f8501[_0x8b21('0x18')](_0x2e3542);}return _0x4f8501['status'](_0x2e3542)[_0x8b21('0x19')]();};}function respondWithResult(_0x506803,_0xb52fc9){_0xb52fc9=_0xb52fc9||0xc8;return function(_0x570d94){if(_0x570d94){return _0x506803[_0x8b21('0x1a')](_0xb52fc9)[_0x8b21('0x1b')](_0x570d94);}};}function respondWithFilteredResult(_0xb0b98d,_0x549233){return function(_0x443534){if(_0x443534){var _0x1c1ed4=typeof _0x549233[_0x8b21('0x1c')]===_0x8b21('0x1d')&&typeof _0x549233[_0x8b21('0x1e')]===_0x8b21('0x1d');var _0x4c17c3=_0x443534['count'];var _0x2cd50c=_0x1c1ed4?0x0:_0x549233[_0x8b21('0x1c')];var _0x28cc17=_0x1c1ed4?_0x443534['count']:_0x549233['offset']+_0x549233['limit'];var _0x590603;if(_0x28cc17>=_0x4c17c3){_0x28cc17=_0x4c17c3;_0x590603=0xc8;}else{_0x590603=0xce;}_0xb0b98d['status'](_0x590603);return _0xb0b98d['set'](_0x8b21('0x1f'),_0x2cd50c+'-'+_0x28cc17+'/'+_0x4c17c3)[_0x8b21('0x1b')](_0x443534);}return null;};}function patchUpdates(_0x243372){return function(_0x362b69){try{jsonpatch[_0x8b21('0x20')](_0x362b69,_0x243372,!![]);}catch(_0x430528){return BPromise[_0x8b21('0x21')](_0x430528);}return _0x362b69[_0x8b21('0x22')]();};}function saveUpdates(_0x1b5eec,_0x366105){return function(_0x1ce581){if(_0x1ce581){return _0x1ce581['update'](_0x1b5eec)[_0x8b21('0x23')](function(_0x434400){return _0x434400;});}return null;};}function removeEntity(_0x2b9f54,_0x23d29f){return function(_0xdc41ba){if(_0xdc41ba){return _0xdc41ba[_0x8b21('0x24')]()[_0x8b21('0x23')](function(){var _0x4e103e=_0xdc41ba[_0x8b21('0x25')]({'plain':!![]});var _0x3264dd=_0x8b21('0x26');return db[_0x8b21('0x27')][_0x8b21('0x24')]({'where':{'type':_0x3264dd,'resourceId':_0x4e103e['id']}})[_0x8b21('0x23')](function(){return _0xdc41ba;});})['then'](function(){_0x2b9f54['status'](0xcc)[_0x8b21('0x19')]();});}};}function handleEntityNotFound(_0x1e0276,_0x5a469b){return function(_0x1b826c){if(!_0x1b826c){_0x1e0276[_0x8b21('0x18')](0x194);}return _0x1b826c;};}function handleError(_0x416693,_0x38fb58){_0x38fb58=_0x38fb58||0x1f4;return function(_0x456793){logger['error'](_0x456793[_0x8b21('0x28')]);if(_0x456793[_0x8b21('0x29')]){delete _0x456793[_0x8b21('0x29')];}_0x416693[_0x8b21('0x1a')](_0x38fb58)[_0x8b21('0x2a')](_0x456793);};}exports[_0x8b21('0x2b')]=function(_0x4f52ea,_0x42fe51){var _0x204dac={},_0x193d94={},_0x2d6f9f={'count':0x0,'rows':[]};var _0x68b8b8=_[_0x8b21('0x2c')](db[_0x8b21('0x2d')][_0x8b21('0x2e')],function(_0x34a8c3){return{'name':_0x34a8c3[_0x8b21('0x2f')],'type':_0x34a8c3[_0x8b21('0x30')][_0x8b21('0x31')]};});_0x193d94['model']=_[_0x8b21('0x2c')](_0x68b8b8,'name');_0x193d94[_0x8b21('0x32')]=_[_0x8b21('0x33')](_0x4f52ea[_0x8b21('0x32')]);_0x193d94[_0x8b21('0x34')]=_[_0x8b21('0x35')](_0x193d94[_0x8b21('0x36')],_0x193d94[_0x8b21('0x32')]);_0x204dac['attributes']=_['intersection'](_0x193d94[_0x8b21('0x36')],qs[_0x8b21('0x37')](_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x37')]));_0x204dac[_0x8b21('0x38')]=_0x204dac['attributes'][_0x8b21('0x39')]?_0x204dac[_0x8b21('0x38')]:_0x193d94[_0x8b21('0x36')];if(!_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x3a')](_0x8b21('0x3b'))){_0x204dac[_0x8b21('0x1e')]=qs[_0x8b21('0x1e')](_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x1e')]);_0x204dac[_0x8b21('0x1c')]=qs['offset'](_0x4f52ea[_0x8b21('0x32')]['offset']);}_0x204dac[_0x8b21('0x3c')]=qs[_0x8b21('0x3d')](_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x3d')]);_0x204dac['where']=qs[_0x8b21('0x34')](_[_0x8b21('0x3e')](_0x4f52ea[_0x8b21('0x32')],_0x193d94['filters']),_0x68b8b8);if(_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x3f')]){_0x204dac[_0x8b21('0x40')]=_[_0x8b21('0x41')](_0x204dac[_0x8b21('0x40')],{'$or':_[_0x8b21('0x2c')](_0x68b8b8,function(_0x451974){if(_0x451974['type']!==_0x8b21('0x42')){var _0x4ef001={};_0x4ef001[_0x451974[_0x8b21('0x29')]]={'$like':'%'+_0x4f52ea[_0x8b21('0x32')][_0x8b21('0x3f')]+'%'};return _0x4ef001;}})});}_0x204dac=_[_0x8b21('0x41')]({},_0x204dac,_0x4f52ea[_0x8b21('0x43')]);var _0x38c1b4={'where':_0x204dac[_0x8b21('0x40')]};return db[_0x8b21('0x2d')]['count'](_0x38c1b4)[_0x8b21('0x23')](function(_0x4c8894){_0x2d6f9f[_0x8b21('0x44')]=_0x4c8894;if(_0x4f52ea['query'][_0x8b21('0x45')]){_0x204dac[_0x8b21('0x46')]=[{'all':!![]}];}return db[_0x8b21('0x2d')]['findAll'](_0x204dac);})[_0x8b21('0x23')](function(_0x8a227e){_0x2d6f9f[_0x8b21('0x47')]=_0x8a227e;return _0x2d6f9f;})[_0x8b21('0x23')](respondWithFilteredResult(_0x42fe51,_0x204dac))[_0x8b21('0x48')](handleError(_0x42fe51,null));};exports[_0x8b21('0x49')]=function(_0x13adfb,_0x5a12be){var _0x6098db={'raw':![],'where':{'id':_0x13adfb[_0x8b21('0x4a')]['id']}},_0x45f9ea={};_0x45f9ea[_0x8b21('0x36')]=_[_0x8b21('0x33')](db[_0x8b21('0x2d')][_0x8b21('0x2e')]);_0x45f9ea[_0x8b21('0x32')]=_['keys'](_0x13adfb['query']);_0x45f9ea['filters']=_[_0x8b21('0x35')](_0x45f9ea[_0x8b21('0x36')],_0x45f9ea['query']);_0x6098db[_0x8b21('0x38')]=_[_0x8b21('0x35')](_0x45f9ea[_0x8b21('0x36')],qs[_0x8b21('0x37')](_0x13adfb[_0x8b21('0x32')][_0x8b21('0x37')]));_0x6098db[_0x8b21('0x38')]=_0x6098db[_0x8b21('0x38')]['length']?_0x6098db[_0x8b21('0x38')]:_0x45f9ea[_0x8b21('0x36')];if(_0x13adfb['query'][_0x8b21('0x45')]){_0x6098db['include']=[{'all':!![]}];}_0x6098db=_[_0x8b21('0x41')]({},_0x6098db,_0x13adfb[_0x8b21('0x43')]);return db['Schedule'][_0x8b21('0x4b')](_0x6098db)[_0x8b21('0x23')](handleEntityNotFound(_0x5a12be,null))[_0x8b21('0x23')](respondWithResult(_0x5a12be,null))[_0x8b21('0x48')](handleError(_0x5a12be,null));};exports[_0x8b21('0x4c')]=function(_0x3f3f0d,_0x467e57){return db['Schedule'][_0x8b21('0x4c')](_0x3f3f0d[_0x8b21('0x4d')],{})[_0x8b21('0x23')](function(_0x606d0e){var _0x1ec264=_0x3f3f0d[_0x8b21('0x4e')]['get']({'plain':!![]});if(!_0x1ec264)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ec264[_0x8b21('0x4f')]===_0x8b21('0x4e')){var _0xfea55f=_0x606d0e[_0x8b21('0x25')]({'plain':!![]});var _0x2acca3='Scheduler';return db[_0x8b21('0x50')]['find']({'where':{'name':_0x2acca3,'userProfileId':_0x1ec264[_0x8b21('0x51')]},'raw':!![]})['then'](function(_0x4bdf16){if(_0x4bdf16&&_0x4bdf16['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xfea55f[_0x8b21('0x29')],'resourceId':_0xfea55f['id'],'type':_0x4bdf16[_0x8b21('0x29')],'sectionId':_0x4bdf16['id']},{})['then'](function(){return _0x606d0e;});}else{return _0x606d0e;}})[_0x8b21('0x48')](function(_0x1b9bcf){logger[_0x8b21('0x52')](_0x8b21('0x53'),_0x1b9bcf);throw _0x1b9bcf;});}return _0x606d0e;})[_0x8b21('0x23')](respondWithResult(_0x467e57,0xc9))[_0x8b21('0x48')](handleError(_0x467e57,null));};exports[_0x8b21('0x54')]=function(_0x23f87a,_0xb7c98a){if(_0x23f87a[_0x8b21('0x4d')]['id']){delete _0x23f87a[_0x8b21('0x4d')]['id'];}return db[_0x8b21('0x2d')][_0x8b21('0x4b')]({'where':{'id':_0x23f87a['params']['id']}})[_0x8b21('0x23')](handleEntityNotFound(_0xb7c98a,null))['then'](saveUpdates(_0x23f87a[_0x8b21('0x4d')],null))[_0x8b21('0x23')](respondWithResult(_0xb7c98a,null))[_0x8b21('0x48')](handleError(_0xb7c98a,null));};exports[_0x8b21('0x24')]=function(_0xfdb7dc,_0x12a100){return db[_0x8b21('0x2d')][_0x8b21('0x4b')]({'where':{'id':_0xfdb7dc[_0x8b21('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12a100,null))[_0x8b21('0x23')](removeEntity(_0x12a100,null))[_0x8b21('0x48')](handleError(_0x12a100,null));};exports[_0x8b21('0x55')]=function(_0x39938e,_0x492e29,_0x5db430){var _0x58d298=require(_0x8b21('0x56'));return db[_0x8b21('0x2d')][_0x8b21('0x4b')]({'where':{'id':_0x39938e[_0x8b21('0x4a')]['id']},'raw':!![]})[_0x8b21('0x23')](handleEntityNotFound(_0x492e29,null))[_0x8b21('0x23')](function(){_0x58d298[_0x8b21('0x55')](_0x39938e[_0x8b21('0x4a')]['id']);})[_0x8b21('0x23')](respondWithStatusCode(_0x492e29,null))[_0x8b21('0x48')](handleError(_0x492e29,null));}; \ No newline at end of file +var _0x618c=['params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','pick','where','filter','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x589ece,_0x1e84ed){var _0x13cd92=function(_0x1d0a1e){while(--_0x1d0a1e){_0x589ece['push'](_0x589ece['shift']());}};_0x13cd92(++_0x1e84ed);}(_0x618c,0x1f2));var _0xc618=function(_0x406da3,_0x323295){_0x406da3=_0x406da3-0x0;var _0x16bd38=_0x618c[_0x406da3];return _0x16bd38;};'use strict';var emlformat=require(_0xc618('0x0'));var rimraf=require(_0xc618('0x1'));var zipdir=require(_0xc618('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc618('0x3'));var moment=require(_0xc618('0x4'));var BPromise=require(_0xc618('0x5'));var Mustache=require(_0xc618('0x6'));var util=require('util');var path=require(_0xc618('0x7'));var sox=require(_0xc618('0x8'));var csv=require(_0xc618('0x9'));var ejs=require(_0xc618('0xa'));var fs=require('fs');var fs_extra=require(_0xc618('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc618('0xc'));var jsforce=require(_0xc618('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc618('0x9'));var querystring=require(_0xc618('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc618('0xf'));var as=require(_0xc618('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc618('0x11'));var utils=require(_0xc618('0x12'));var config=require(_0xc618('0x13'));var licenseUtil=require(_0xc618('0x14'));var db=require(_0xc618('0x15'))['db'];function respondWithStatusCode(_0x37d594,_0x50dfe5){_0x50dfe5=_0x50dfe5||0xcc;return function(_0xf7323b){if(_0xf7323b){return _0x37d594['sendStatus'](_0x50dfe5);}return _0x37d594[_0xc618('0x16')](_0x50dfe5)[_0xc618('0x17')]();};}function respondWithResult(_0x458845,_0x1b0247){_0x1b0247=_0x1b0247||0xc8;return function(_0x4f1abe){if(_0x4f1abe){return _0x458845[_0xc618('0x16')](_0x1b0247)[_0xc618('0x18')](_0x4f1abe);}};}function respondWithFilteredResult(_0x38a9c6,_0x49548e){return function(_0x50516a){if(_0x50516a){var _0x292810=typeof _0x49548e[_0xc618('0x19')]==='undefined'&&typeof _0x49548e['limit']===_0xc618('0x1a');var _0x3feb04=_0x50516a[_0xc618('0x1b')];var _0xee154a=_0x292810?0x0:_0x49548e['offset'];var _0x51af15=_0x292810?_0x50516a[_0xc618('0x1b')]:_0x49548e[_0xc618('0x19')]+_0x49548e[_0xc618('0x1c')];var _0x5d01e8;if(_0x51af15>=_0x3feb04){_0x51af15=_0x3feb04;_0x5d01e8=0xc8;}else{_0x5d01e8=0xce;}_0x38a9c6[_0xc618('0x16')](_0x5d01e8);return _0x38a9c6[_0xc618('0x1d')](_0xc618('0x1e'),_0xee154a+'-'+_0x51af15+'/'+_0x3feb04)[_0xc618('0x18')](_0x50516a);}return null;};}function patchUpdates(_0xedfd09){return function(_0x472eb9){try{jsonpatch['apply'](_0x472eb9,_0xedfd09,!![]);}catch(_0x3e23a0){return BPromise[_0xc618('0x1f')](_0x3e23a0);}return _0x472eb9[_0xc618('0x20')]();};}function saveUpdates(_0x37c08a,_0x481449){return function(_0x3d3237){if(_0x3d3237){return _0x3d3237[_0xc618('0x21')](_0x37c08a)['then'](function(_0x563ddd){return _0x563ddd;});}return null;};}function removeEntity(_0x57a31a,_0x596cb5){return function(_0x3cc989){if(_0x3cc989){return _0x3cc989[_0xc618('0x22')]()[_0xc618('0x23')](function(){var _0x5bf550=_0x3cc989[_0xc618('0x24')]({'plain':!![]});var _0x3afe47=_0xc618('0x25');return db[_0xc618('0x26')]['destroy']({'where':{'type':_0x3afe47,'resourceId':_0x5bf550['id']}})['then'](function(){return _0x3cc989;});})[_0xc618('0x23')](function(){_0x57a31a[_0xc618('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdd5fb5,_0x256823){return function(_0x3ebcf7){if(!_0x3ebcf7){_0xdd5fb5['sendStatus'](0x194);}return _0x3ebcf7;};}function handleError(_0x356b88,_0x2ce392){_0x2ce392=_0x2ce392||0x1f4;return function(_0x5eadca){logger['error'](_0x5eadca[_0xc618('0x27')]);if(_0x5eadca[_0xc618('0x28')]){delete _0x5eadca['name'];}_0x356b88[_0xc618('0x16')](_0x2ce392)[_0xc618('0x29')](_0x5eadca);};}exports[_0xc618('0x2a')]=function(_0x4fc2b7,_0x1077c1){var _0x3b6aba={},_0x48b8dd={},_0x5e36b4={'count':0x0,'rows':[]};var _0x2fa4ec=_['map'](db[_0xc618('0x2b')][_0xc618('0x2c')],function(_0x127e07){return{'name':_0x127e07[_0xc618('0x2d')],'type':_0x127e07[_0xc618('0x2e')][_0xc618('0x2f')]};});_0x48b8dd[_0xc618('0x30')]=_[_0xc618('0x31')](_0x2fa4ec,_0xc618('0x28'));_0x48b8dd[_0xc618('0x32')]=_['keys'](_0x4fc2b7[_0xc618('0x32')]);_0x48b8dd[_0xc618('0x33')]=_[_0xc618('0x34')](_0x48b8dd[_0xc618('0x30')],_0x48b8dd['query']);_0x3b6aba[_0xc618('0x35')]=_[_0xc618('0x34')](_0x48b8dd['model'],qs[_0xc618('0x36')](_0x4fc2b7['query'][_0xc618('0x36')]));_0x3b6aba[_0xc618('0x35')]=_0x3b6aba[_0xc618('0x35')][_0xc618('0x37')]?_0x3b6aba[_0xc618('0x35')]:_0x48b8dd[_0xc618('0x30')];if(!_0x4fc2b7['query']['hasOwnProperty'](_0xc618('0x38'))){_0x3b6aba['limit']=qs['limit'](_0x4fc2b7[_0xc618('0x32')][_0xc618('0x1c')]);_0x3b6aba[_0xc618('0x19')]=qs[_0xc618('0x19')](_0x4fc2b7[_0xc618('0x32')]['offset']);}_0x3b6aba[_0xc618('0x39')]=qs['sort'](_0x4fc2b7[_0xc618('0x32')]['sort']);_0x3b6aba['where']=qs['filters'](_[_0xc618('0x3a')](_0x4fc2b7[_0xc618('0x32')],_0x48b8dd[_0xc618('0x33')]),_0x2fa4ec);if(_0x4fc2b7[_0xc618('0x32')]['filter']){_0x3b6aba[_0xc618('0x3b')]=_['merge'](_0x3b6aba['where'],{'$or':_['map'](_0x2fa4ec,function(_0x2deca3){if(_0x2deca3[_0xc618('0x2e')]!=='VIRTUAL'){var _0x3e2f4d={};_0x3e2f4d[_0x2deca3[_0xc618('0x28')]]={'$like':'%'+_0x4fc2b7[_0xc618('0x32')][_0xc618('0x3c')]+'%'};return _0x3e2f4d;}})});}_0x3b6aba=_[_0xc618('0x3d')]({},_0x3b6aba,_0x4fc2b7[_0xc618('0x3e')]);var _0x1955eb={'where':_0x3b6aba[_0xc618('0x3b')]};return db[_0xc618('0x2b')][_0xc618('0x1b')](_0x1955eb)[_0xc618('0x23')](function(_0x5d54c2){_0x5e36b4[_0xc618('0x1b')]=_0x5d54c2;if(_0x4fc2b7[_0xc618('0x32')][_0xc618('0x3f')]){_0x3b6aba[_0xc618('0x40')]=[{'all':!![]}];}return db[_0xc618('0x2b')][_0xc618('0x41')](_0x3b6aba);})[_0xc618('0x23')](function(_0x1fb305){_0x5e36b4[_0xc618('0x42')]=_0x1fb305;return _0x5e36b4;})[_0xc618('0x23')](respondWithFilteredResult(_0x1077c1,_0x3b6aba))[_0xc618('0x43')](handleError(_0x1077c1,null));};exports[_0xc618('0x44')]=function(_0xdf30f9,_0x57f1cf){var _0x41e5e3={'raw':![],'where':{'id':_0xdf30f9[_0xc618('0x45')]['id']}},_0x19bb44={};_0x19bb44[_0xc618('0x30')]=_['keys'](db[_0xc618('0x2b')]['rawAttributes']);_0x19bb44[_0xc618('0x32')]=_[_0xc618('0x46')](_0xdf30f9['query']);_0x19bb44[_0xc618('0x33')]=_[_0xc618('0x34')](_0x19bb44['model'],_0x19bb44[_0xc618('0x32')]);_0x41e5e3['attributes']=_[_0xc618('0x34')](_0x19bb44[_0xc618('0x30')],qs[_0xc618('0x36')](_0xdf30f9[_0xc618('0x32')][_0xc618('0x36')]));_0x41e5e3[_0xc618('0x35')]=_0x41e5e3[_0xc618('0x35')]['length']?_0x41e5e3[_0xc618('0x35')]:_0x19bb44['model'];if(_0xdf30f9[_0xc618('0x32')][_0xc618('0x3f')]){_0x41e5e3[_0xc618('0x40')]=[{'all':!![]}];}_0x41e5e3=_['merge']({},_0x41e5e3,_0xdf30f9[_0xc618('0x3e')]);return db['Schedule'][_0xc618('0x47')](_0x41e5e3)[_0xc618('0x23')](handleEntityNotFound(_0x57f1cf,null))[_0xc618('0x23')](respondWithResult(_0x57f1cf,null))['catch'](handleError(_0x57f1cf,null));};exports[_0xc618('0x48')]=function(_0xee2400,_0x502d1c){return db[_0xc618('0x2b')][_0xc618('0x48')](_0xee2400[_0xc618('0x49')],{})['then'](function(_0x3e9a82){var _0x4f1a64=_0xee2400[_0xc618('0x4a')][_0xc618('0x24')]({'plain':!![]});if(!_0x4f1a64)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f1a64['role']==='user'){var _0x434d0c=_0x3e9a82[_0xc618('0x24')]({'plain':!![]});var _0xb903a8='Scheduler';return db[_0xc618('0x4b')][_0xc618('0x47')]({'where':{'name':_0xb903a8,'userProfileId':_0x4f1a64[_0xc618('0x4c')]},'raw':!![]})[_0xc618('0x23')](function(_0xbac547){if(_0xbac547&&_0xbac547[_0xc618('0x4d')]===0x0){return db[_0xc618('0x26')][_0xc618('0x48')]({'name':_0x434d0c[_0xc618('0x28')],'resourceId':_0x434d0c['id'],'type':_0xbac547['name'],'sectionId':_0xbac547['id']},{})['then'](function(){return _0x3e9a82;});}else{return _0x3e9a82;}})[_0xc618('0x43')](function(_0x316bb3){logger['error'](_0xc618('0x4e'),_0x316bb3);throw _0x316bb3;});}return _0x3e9a82;})['then'](respondWithResult(_0x502d1c,0xc9))[_0xc618('0x43')](handleError(_0x502d1c,null));};exports[_0xc618('0x21')]=function(_0x175629,_0x59a314){if(_0x175629[_0xc618('0x49')]['id']){delete _0x175629['body']['id'];}return db[_0xc618('0x2b')]['find']({'where':{'id':_0x175629[_0xc618('0x45')]['id']}})[_0xc618('0x23')](handleEntityNotFound(_0x59a314,null))['then'](saveUpdates(_0x175629[_0xc618('0x49')],null))[_0xc618('0x23')](respondWithResult(_0x59a314,null))[_0xc618('0x43')](handleError(_0x59a314,null));};exports['destroy']=function(_0x26bc47,_0x8fd35){return db['Schedule'][_0xc618('0x47')]({'where':{'id':_0x26bc47['params']['id']}})[_0xc618('0x23')](handleEntityNotFound(_0x8fd35,null))['then'](removeEntity(_0x8fd35,null))[_0xc618('0x43')](handleError(_0x8fd35,null));};exports[_0xc618('0x4f')]=function(_0x56f053,_0x55a37b,_0x5716e1){var _0x146469=require(_0xc618('0x50'));return db[_0xc618('0x2b')]['find']({'where':{'id':_0x56f053[_0xc618('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x55a37b,null))[_0xc618('0x23')](function(){_0x146469[_0xc618('0x4f')](_0x56f053[_0xc618('0x45')]['id']);})[_0xc618('0x23')](respondWithStatusCode(_0x55a37b,null))['catch'](handleError(_0x55a37b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 09c14de..3da3d2e 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 _0xa0de=['rimraf','../../config/environment','./schedule.attributes','exports','Schedule','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4c3533,_0x378f98){var _0x4a60cc=function(_0x199a0d){while(--_0x199a0d){_0x4c3533['push'](_0x4c3533['shift']());}};_0x4a60cc(++_0x378f98);}(_0xa0de,0x89));var _0xea0d=function(_0x167147,_0x20a159){_0x167147=_0x167147-0x0;var _0x39c6c0=_0xa0de[_0x167147];return _0x39c6c0;};'use strict';var _=require(_0xea0d('0x0'));var util=require(_0xea0d('0x1'));var logger=require(_0xea0d('0x2'))('api');var moment=require(_0xea0d('0x3'));var BPromise=require(_0xea0d('0x4'));var rp=require(_0xea0d('0x5'));var fs=require('fs');var path=require(_0xea0d('0x6'));var rimraf=require(_0xea0d('0x7'));var config=require(_0xea0d('0x8'));var attributes=require(_0xea0d('0x9'));module[_0xea0d('0xa')]=function(_0xd729a3,_0x1e9513){return _0xd729a3['define'](_0xea0d('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c4e=['request-promise','./schedule.attributes','exports','Schedule','tools_schedules','util','../../config/logger','api','moment'];(function(_0xe7295b,_0x526aa6){var _0x14f83e=function(_0x1e0f72){while(--_0x1e0f72){_0xe7295b['push'](_0xe7295b['shift']());}};_0x14f83e(++_0x526aa6);}(_0x4c4e,0x1f4));var _0xe4c4=function(_0x509b8e,_0x73dbe9){_0x509b8e=_0x509b8e-0x0;var _0x2194ed=_0x4c4e[_0x509b8e];return _0x2194ed;};'use strict';var _=require('lodash');var util=require(_0xe4c4('0x0'));var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe4c4('0x5'));module[_0xe4c4('0x6')]=function(_0x2ee8f0,_0x2edf69){return _0x2ee8f0['define'](_0xe4c4('0x7'),attributes,{'tableName':_0xe4c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8ed2d5c..7036944 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 _0x2658=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x2658,0x1a9));var _0x8265=function(_0x549ffa,_0x4011d9){_0x549ffa=_0x549ffa-0x0;var _0x378324=_0x2658[_0x549ffa];return _0x378324;};'use strict';var _=require(_0x8265('0x0'));var util=require('util');var moment=require(_0x8265('0x1'));var BPromise=require(_0x8265('0x2'));var rs=require(_0x8265('0x3'));var fs=require('fs');var Redis=require(_0x8265('0x4'));var db=require(_0x8265('0x5'))['db'];var utils=require(_0x8265('0x6'));var logger=require(_0x8265('0x7'))(_0x8265('0x8'));var config=require(_0x8265('0x9'));var jayson=require(_0x8265('0xa'));var client=jayson[_0x8265('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2adc8b,_0x5963f2,_0x5a04e8){return new BPromise(function(_0x2c4ad7,_0x2c9df4){return client[_0x8265('0xc')](_0x2adc8b,_0x5a04e8)[_0x8265('0xd')](function(_0x1f9671){logger[_0x8265('0xe')](_0x8265('0xf'),_0x5963f2,_0x8265('0x10'));logger[_0x8265('0x11')](_0x8265('0x12'),_0x5963f2,_0x8265('0x10'),JSON[_0x8265('0x13')](_0x1f9671));if(_0x1f9671[_0x8265('0x14')]){if(_0x1f9671[_0x8265('0x14')][_0x8265('0x15')]===0x1f4){logger[_0x8265('0x14')](_0x8265('0xf'),_0x5963f2,_0x1f9671[_0x8265('0x14')][_0x8265('0x16')]);return _0x2c9df4(_0x1f9671[_0x8265('0x14')][_0x8265('0x16')]);}logger[_0x8265('0x14')]('Schedule,\x20%s,\x20%s',_0x5963f2,_0x1f9671[_0x8265('0x14')][_0x8265('0x16')]);return _0x2c4ad7(_0x1f9671[_0x8265('0x14')]['message']);}else{logger[_0x8265('0xe')](_0x8265('0xf'),_0x5963f2,_0x8265('0x10'));_0x2c4ad7(_0x1f9671[_0x8265('0x17')][_0x8265('0x16')]);}})['catch'](function(_0x1d7547){logger[_0x8265('0x14')](_0x8265('0xf'),_0x5963f2,_0x1d7547);_0x2c9df4(_0x1d7547);});});} \ No newline at end of file +var _0x0cba=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x0cba,0x7d));var _0xa0cb=function(_0x41c88c,_0x381f8d){_0x41c88c=_0x41c88c-0x0;var _0x2c97ea=_0x0cba[_0x41c88c];return _0x2c97ea;};'use strict';var _=require(_0xa0cb('0x0'));var util=require(_0xa0cb('0x1'));var moment=require(_0xa0cb('0x2'));var BPromise=require(_0xa0cb('0x3'));var rs=require(_0xa0cb('0x4'));var fs=require('fs');var Redis=require(_0xa0cb('0x5'));var db=require(_0xa0cb('0x6'))['db'];var utils=require(_0xa0cb('0x7'));var logger=require(_0xa0cb('0x8'))(_0xa0cb('0x9'));var config=require(_0xa0cb('0xa'));var jayson=require(_0xa0cb('0xb'));var client=jayson[_0xa0cb('0xc')][_0xa0cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x243a0c,_0x3113b5,_0x2ca14c){return new BPromise(function(_0x5ed97b,_0x2b919e){return client[_0xa0cb('0xe')](_0x243a0c,_0x2ca14c)['then'](function(_0x3ef991){logger[_0xa0cb('0xf')](_0xa0cb('0x10'),_0x3113b5,_0xa0cb('0x11'));logger[_0xa0cb('0x12')](_0xa0cb('0x13'),_0x3113b5,_0xa0cb('0x11'),JSON['stringify'](_0x3ef991));if(_0x3ef991[_0xa0cb('0x14')]){if(_0x3ef991[_0xa0cb('0x14')][_0xa0cb('0x15')]===0x1f4){logger[_0xa0cb('0x14')](_0xa0cb('0x10'),_0x3113b5,_0x3ef991[_0xa0cb('0x14')]['message']);return _0x2b919e(_0x3ef991['error']['message']);}logger[_0xa0cb('0x14')](_0xa0cb('0x10'),_0x3113b5,_0x3ef991['error'][_0xa0cb('0x16')]);return _0x5ed97b(_0x3ef991[_0xa0cb('0x14')][_0xa0cb('0x16')]);}else{logger[_0xa0cb('0xf')](_0xa0cb('0x10'),_0x3113b5,'request\x20sent');_0x5ed97b(_0x3ef991[_0xa0cb('0x17')][_0xa0cb('0x16')]);}})[_0xa0cb('0x18')](function(_0x90776e){logger[_0xa0cb('0x14')](_0xa0cb('0x10'),_0x3113b5,_0x90776e);_0x2b919e(_0x90776e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 38dcc5c..e4487f3 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 _0x363f=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x228d70,_0x44ff20){var _0x34c41=function(_0xa4af96){while(--_0xa4af96){_0x228d70['push'](_0x228d70['shift']());}};_0x34c41(++_0x44ff20);}(_0x363f,0x179));var _0xf363=function(_0x201990,_0x1cfbc8){_0x201990=_0x201990-0x0;var _0x3490d5=_0x363f[_0x201990];return _0x3490d5;};'use strict';var multer=require(_0xf363('0x0'));var util=require(_0xf363('0x1'));var path=require(_0xf363('0x2'));var timeout=require('connect-timeout');var express=require(_0xf363('0x3'));var router=express[_0xf363('0x4')]();var fs_extra=require(_0xf363('0x5'));var auth=require(_0xf363('0x6'));var interaction=require(_0xf363('0x7'));var config=require(_0xf363('0x8'));var controller=require('./screenRecording.controller');router[_0xf363('0x9')]('/',auth[_0xf363('0xa')](),controller['index']);router[_0xf363('0x9')](_0xf363('0xb'),auth['isAuthenticated'](),controller[_0xf363('0xc')]);router[_0xf363('0x9')](_0xf363('0xd'),auth['isAuthenticated'](),controller[_0xf363('0xe')]);router[_0xf363('0x9')](_0xf363('0xf'),auth[_0xf363('0xa')](),controller[_0xf363('0x10')]);router[_0xf363('0x11')]('/',auth['isAuthenticated'](),controller[_0xf363('0x12')]);router[_0xf363('0x13')](_0xf363('0xd'),auth['isAuthenticated'](),controller[_0xf363('0x14')]);router[_0xf363('0x15')](_0xf363('0xd'),auth[_0xf363('0xa')](),controller[_0xf363('0x16')]);module[_0xf363('0x17')]=router; \ No newline at end of file +var _0x8a02=['get','isAuthenticated','index','/describe','describe','/:id','download','post','create','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./screenRecording.controller'];(function(_0x6b8b85,_0x1d7841){var _0x436cad=function(_0x8d40bc){while(--_0x8d40bc){_0x6b8b85['push'](_0x6b8b85['shift']());}};_0x436cad(++_0x1d7841);}(_0x8a02,0x9b));var _0x28a0=function(_0x504a94,_0x55eb08){_0x504a94=_0x504a94-0x0;var _0x388833=_0x8a02[_0x504a94];return _0x388833;};'use strict';var multer=require(_0x28a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x28a0('0x1'));var express=require(_0x28a0('0x2'));var router=express[_0x28a0('0x3')]();var fs_extra=require(_0x28a0('0x4'));var auth=require(_0x28a0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x28a0('0x6'));router[_0x28a0('0x7')]('/',auth[_0x28a0('0x8')](),controller[_0x28a0('0x9')]);router[_0x28a0('0x7')](_0x28a0('0xa'),auth[_0x28a0('0x8')](),controller[_0x28a0('0xb')]);router[_0x28a0('0x7')](_0x28a0('0xc'),auth[_0x28a0('0x8')](),controller['show']);router[_0x28a0('0x7')]('/:id/download',auth[_0x28a0('0x8')](),controller[_0x28a0('0xd')]);router[_0x28a0('0xe')]('/',auth['isAuthenticated'](),controller[_0x28a0('0xf')]);router['put'](_0x28a0('0xc'),auth[_0x28a0('0x8')](),controller[_0x28a0('0x10')]);router['delete'](_0x28a0('0xc'),auth['isAuthenticated'](),controller[_0x28a0('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index c1d36d3..8501809 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 _0x5bc1=['createdAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','DATE','toString'];(function(_0x2cacc8,_0x2efb89){var _0xce30fc=function(_0x9cd784){while(--_0x9cd784){_0x2cacc8['push'](_0x2cacc8['shift']());}};_0xce30fc(++_0x2efb89);}(_0x5bc1,0xb5));var _0x15bc=function(_0x245772,_0x2c0818){_0x245772=_0x245772-0x0;var _0x1a1c3b=_0x5bc1[_0x245772];return _0x1a1c3b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x15bc('0x0'));var path=require(_0x15bc('0x1'));var config=require(_0x15bc('0x2'));module[_0x15bc('0x3')]={'format':{'type':Sequelize[_0x15bc('0x4')],'get':function(){return this[_0x15bc('0x5')]('value')?path['extname'](this[_0x15bc('0x5')](_0x15bc('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x15bc('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x15bc('0x7')],'set':function(_0x483c6d){var _0x344121=_0x483c6d[_0x15bc('0x8')](/\\/g,'/');this[_0x15bc('0x9')](_0x15bc('0x6'),_0x344121);}},'rating':{'type':Sequelize[_0x15bc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x15bc('0xa')],'set':function(_0x2bc60a){this[_0x15bc('0x9')](_0x15bc('0xb'),moment()[_0x15bc('0xc')](_0x2bc60a,'ms'));this['setDataValue'](_0x15bc('0xd'),moment());this[_0x15bc('0x9')](_0x15bc('0xe'),_0x2bc60a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xb')))[_0x15bc('0xf')](_0x15bc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0xd')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'createdAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')](_0x15bc('0x13')))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}},'updatedAt':{'type':Sequelize[_0x15bc('0x11')],'get':function(){return moment(this[_0x15bc('0x5')]('updatedAt'))[_0x15bc('0xf')](_0x15bc('0x10'))[_0x15bc('0x12')]();}}}; \ No newline at end of file +var _0x1ab1=['setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','toString','format','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','../../config/environment','value','getDataValue','STRING','replace'];(function(_0x5ad589,_0x40bc56){var _0x2c235d=function(_0x214f55){while(--_0x214f55){_0x5ad589['push'](_0x5ad589['shift']());}};_0x2c235d(++_0x40bc56);}(_0x1ab1,0x12c));var _0x11ab=function(_0x5cf6b1,_0x1b8d83){_0x5cf6b1=_0x5cf6b1-0x0;var _0x324c59=_0x1ab1[_0x5cf6b1];return _0x324c59;};'use strict';var Sequelize=require(_0x11ab('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x11ab('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x11ab('0x2'))?path['extname'](this[_0x11ab('0x3')](_0x11ab('0x2'))):undefined;}},'interactionid':{'type':Sequelize[_0x11ab('0x4')]},'channel':{'type':Sequelize[_0x11ab('0x4')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3eaf8b){var _0xaf0223=_0x3eaf8b[_0x11ab('0x5')](/\\/g,'/');this[_0x11ab('0x6')](_0x11ab('0x2'),_0xaf0223);}},'rating':{'type':Sequelize[_0x11ab('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x1abc4e){this['setDataValue'](_0x11ab('0x8'),moment()[_0x11ab('0x9')](_0x1abc4e,'ms'));this[_0x11ab('0x6')](_0x11ab('0xa'),moment());this['setDataValue'](_0x11ab('0xb'),_0x1abc4e);}},'startedAt':{'type':Sequelize[_0x11ab('0xc')],'get':function(){return moment(this[_0x11ab('0x3')](_0x11ab('0x8')))['format']('MM-DD-YYYY\x20HH:mm')[_0x11ab('0xd')]();}},'closedAt':{'type':Sequelize[_0x11ab('0xc')],'get':function(){return moment(this[_0x11ab('0x3')](_0x11ab('0xa')))[_0x11ab('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x11ab('0xd')]();}},'createdAt':{'type':Sequelize[_0x11ab('0xc')],'get':function(){return moment(this[_0x11ab('0x3')](_0x11ab('0xf')))['format'](_0x11ab('0x10'))[_0x11ab('0xd')]();}},'updatedAt':{'type':Sequelize[_0x11ab('0xc')],'get':function(){return moment(this[_0x11ab('0x3')](_0x11ab('0x11')))[_0x11ab('0xe')](_0x11ab('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ca1113f..2415d6a 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 _0xee14=['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','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0xe41cb8,_0x79d5e8){var _0x579ec1=function(_0x1a19c5){while(--_0x1a19c5){_0xe41cb8['push'](_0xe41cb8['shift']());}};_0x579ec1(++_0x79d5e8);}(_0xee14,0x13a));var _0x4ee1=function(_0x222e34,_0x1c3062){_0x222e34=_0x222e34-0x0;var _0x1a16c8=_0xee14[_0x222e34];return _0x1a16c8;};'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['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file +var _0x3e74=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','catch','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','decryptFile','secrets','server/files/screen_recordings','Sequelize','ValidationError','filename','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','existsSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox'];(function(_0x37e9aa,_0x2f948e){var _0x5df03a=function(_0x349dec){while(--_0x349dec){_0x37e9aa['push'](_0x37e9aa['shift']());}};_0x5df03a(++_0x2f948e);}(_0x3e74,0x175));var _0x43e7=function(_0x16a8a4,_0x13f7da){_0x16a8a4=_0x16a8a4-0x0;var _0x278097=_0x3e74[_0x16a8a4];return _0x278097;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_[_0x43e7('0x27')](_0x50f9f5,'name'),[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0xb1fc63[_0x43e7('0x30')]);_0x4690a6[_0x43e7('0x32')]=_['intersection'](_0x4690a6[_0x43e7('0x2d')],_0x4690a6[_0x43e7('0x30')]);_0x33a1a5[_0x43e7('0x33')]=_[_0x43e7('0x34')](_0x4690a6['model'],qs['fields'](_0xb1fc63['query'][_0x43e7('0x35')]));_0x33a1a5[_0x43e7('0x33')]=_0x33a1a5[_0x43e7('0x33')][_0x43e7('0x36')]?_0x33a1a5[_0x43e7('0x33')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63['query']['hasOwnProperty']('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5[_0x43e7('0x19')]=qs['offset'](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x19')]);}_0x33a1a5[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x38')]);_0x33a1a5[_0x43e7('0x39')]=qs['filters'](_['pick'](_0xb1fc63['query'],_0x4690a6[_0x43e7('0x32')]),_0x50f9f5);if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x39')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x39')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x2ffd43){if(_0x2ffd43['type']!==_0x43e7('0x3c')){var _0x2b0ffe={};_0x2b0ffe[_0x2ffd43['name']]={'$like':'%'+_0xb1fc63[_0x43e7('0x30')]['filter']+'%'};return _0x2b0ffe;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63[_0x43e7('0x3d')]);var _0x1c6f45={'where':_0x33a1a5[_0x43e7('0x39')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x1c6f45)['then'](function(_0x574a93){_0x45b675[_0x43e7('0x1a')]=_0x574a93;if(_0xb1fc63[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x33a1a5[_0x43e7('0x3f')]=[{'all':!![]}];}return db[_0x43e7('0x28')]['findAll'](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4227c4){_0x45b675['rows']=_0x4227c4;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x40')]=function(_0x504101,_0x3d81ae){var _0x3b4235={'raw':![],'where':{'id':_0x504101[_0x43e7('0x41')]['id']}},_0x3a5807={};_0x3a5807['model']=_['keys'](db[_0x43e7('0x28')][_0x43e7('0x29')]);_0x3a5807[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x504101['query']);_0x3a5807['filters']=_['intersection'](_0x3a5807[_0x43e7('0x2d')],_0x3a5807['query']);_0x3b4235[_0x43e7('0x33')]=_['intersection'](_0x3a5807['model'],qs[_0x43e7('0x35')](_0x504101['query'][_0x43e7('0x35')]));_0x3b4235[_0x43e7('0x33')]=_0x3b4235[_0x43e7('0x33')][_0x43e7('0x36')]?_0x3b4235['attributes']:_0x3a5807[_0x43e7('0x2d')];if(_0x504101[_0x43e7('0x30')][_0x43e7('0x3e')]){_0x3b4235[_0x43e7('0x3f')]=[{'all':!![]}];}_0x3b4235=_[_0x43e7('0x3b')]({},_0x3b4235,_0x504101[_0x43e7('0x3d')]);return db['ScreenRecording']['find'](_0x3b4235)[_0x43e7('0x21')](handleEntityNotFound(_0x3d81ae,null))[_0x43e7('0x21')](respondWithResult(_0x3d81ae,null))[_0x43e7('0x42')](handleError(_0x3d81ae,null));};exports['create']=function(_0x5c1c18,_0x56489b){return db[_0x43e7('0x28')][_0x43e7('0x43')](_0x5c1c18['body'],{})[_0x43e7('0x21')](respondWithResult(_0x56489b,0xc9))[_0x43e7('0x42')](handleError(_0x56489b,null));};exports[_0x43e7('0x20')]=function(_0x560329,_0x593155){if(_0x560329['body']['id']){delete _0x560329['body']['id'];}delete _0x560329[_0x43e7('0x44')][_0x43e7('0x45')];delete _0x560329['body'][_0x43e7('0x46')];delete _0x560329[_0x43e7('0x44')][_0x43e7('0x47')];delete _0x560329[_0x43e7('0x44')]['value'];return db[_0x43e7('0x28')]['find']({'where':{'id':_0x560329['params']['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x593155,null))[_0x43e7('0x21')](saveUpdates(_0x560329[_0x43e7('0x44')],null))[_0x43e7('0x21')](respondWithResult(_0x593155,null))[_0x43e7('0x42')](handleError(_0x593155,null));};exports[_0x43e7('0x48')]=function(_0x1cd87c,_0x256ddd){return db[_0x43e7('0x28')][_0x43e7('0x48')]()['then'](respondWithResult(_0x256ddd,null))[_0x43e7('0x42')](handleError(_0x256ddd,null));};exports[_0x43e7('0x49')]=function(_0x499c03,_0x39e3ca,_0x4e6f6d){var _0x35b799=require(_0x43e7('0x4a'));var _0x34e2ec=![];var _0x1f561f={};if(_0x499c03[_0x43e7('0x30')]['type']&&_0x499c03['query'][_0x43e7('0x2b')]===_0x43e7('0x4b')){_0x1f561f[_0x43e7('0x4b')]=_0x499c03[_0x43e7('0x41')]['id'];}else{_0x1f561f['id']=_0x499c03[_0x43e7('0x41')]['id'];}return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':_0x1f561f,'attributes':['id',_0x43e7('0x4d')],'raw':!![]})[_0x43e7('0x21')](handleEntityNotFound(_0x39e3ca,null))[_0x43e7('0x21')](function(_0x312306){if(_0x312306){var _0x4ace49=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],'server/files/screen_recordings',_0x312306[_0x43e7('0x4d')]);var _0x220bf2=util[_0x43e7('0x2f')]('%s.cypher',_0x4ace49);if(fs['existsSync'](_0x220bf2)){_0x34e2ec=!![];return _0x35b799[_0x43e7('0x50')](_0x220bf2,_0x4ace49,config[_0x43e7('0x51')]['recording'])[_0x43e7('0x21')](function(){return _0x312306;});}return _0x312306;}})['then'](function(_0x49a6ce){if(_0x49a6ce){var _0x1fa3f6=path[_0x43e7('0x4e')](config[_0x43e7('0x4f')],_0x43e7('0x52'),_0x49a6ce[_0x43e7('0x4d')]);if(!fs['existsSync'](_0x1fa3f6)){throw new db[(_0x43e7('0x53'))][(_0x43e7('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x49a6ce[_0x43e7('0x55')]){return _0x39e3ca[_0x43e7('0x49')](_0x1fa3f6,_0x49a6ce[_0x43e7('0x55')]+path['extname'](_0x1fa3f6),function(){if(_0x34e2ec){fs['unlink'](_0x1fa3f6);}});}else{return _0x39e3ca['download'](_0x1fa3f6,function(_0x2ada55){if(_0x34e2ec){fs[_0x43e7('0x56')](_0x1fa3f6);}});}}})[_0x43e7('0x42')](function(_0x3a6404){if(_0x3a6404['message']==='ScreenRecording\x20not\x20found'){_0x39e3ca[_0x43e7('0x1b')](0x194)[_0x43e7('0x25')](_0x43e7('0x57'));}else{return handleError(_0x39e3ca,null);}});};exports[_0x43e7('0x22')]=function(_0x5ea0db,_0x4438c0){return db[_0x43e7('0x28')][_0x43e7('0x4c')]({'where':{'id':_0x5ea0db[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](function(_0xd41e79){if(_[_0x43e7('0x58')](_0xd41e79)){throw new ReferenceError(_0x43e7('0x59'));}return _0xd41e79;})[_0x43e7('0x21')](function(_0x381208){var _0x252f00=path['join'](config['root'],_0x43e7('0x52'),_0x381208['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x252f00);if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs['existsSync'](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}_0x252f00=_0x252f00+_0x43e7('0x5d');if(!_[_0x43e7('0x58')](_0x381208[_0x43e7('0x4d')])&&fs[_0x43e7('0x5e')](_0x252f00)){logger[_0x43e7('0x5a')](_0x43e7('0x5b')+_0x252f00+_0x43e7('0x5c'));fs['unlinkSync'](_0x252f00);}return _0x381208;})[_0x43e7('0x21')](function(_0x40d0c0){if(!_0x40d0c0)throw new InternalError();return _0x40d0c0[_0x43e7('0x22')]();})['then'](function(){_0x4438c0['status'](0xcc)[_0x43e7('0x15')]();})['catch'](handleError(_0x4438c0,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ad0f071..f1b3a48 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 _0x74ce=['request-promise','rimraf','./screenRecording.attributes','exports','define','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird'];(function(_0x52acd3,_0x5cf75c){var _0x102b9d=function(_0x408601){while(--_0x408601){_0x52acd3['push'](_0x52acd3['shift']());}};_0x102b9d(++_0x5cf75c);}(_0x74ce,0x1e7));var _0xe74c=function(_0x2ba2db,_0x3779fc){_0x2ba2db=_0x2ba2db-0x0;var _0x5eb644=_0x74ce[_0x2ba2db];return _0x5eb644;};'use strict';var _=require('lodash');var util=require(_0xe74c('0x0'));var logger=require(_0xe74c('0x1'))(_0xe74c('0x2'));var moment=require(_0xe74c('0x3'));var BPromise=require(_0xe74c('0x4'));var rp=require(_0xe74c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe74c('0x6'));var config=require('../../config/environment');var attributes=require(_0xe74c('0x7'));module[_0xe74c('0x8')]=function(_0x3ed12d,_0x381bf5){return _0x3ed12d[_0xe74c('0x9')]('ScreenRecording',attributes,{'tableName':_0xe74c('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xe74c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7a8=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','define'];(function(_0xa9b0c4,_0x9629fe){var _0x3f1e06=function(_0x5df93c){while(--_0x5df93c){_0xa9b0c4['push'](_0xa9b0c4['shift']());}};_0x3f1e06(++_0x9629fe);}(_0xa7a8,0x12c));var _0x8a7a=function(_0x95b387,_0x2347ea){_0x95b387=_0x95b387-0x0;var _0xc4f8a2=_0xa7a8[_0x95b387];return _0xc4f8a2;};'use strict';var _=require(_0x8a7a('0x0'));var util=require(_0x8a7a('0x1'));var logger=require(_0x8a7a('0x2'))(_0x8a7a('0x3'));var moment=require(_0x8a7a('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a7a('0x6'));var config=require('../../config/environment');var attributes=require('./screenRecording.attributes');module['exports']=function(_0x472946,_0x176253){return _0x472946[_0x8a7a('0x7')](_0x8a7a('0x8'),attributes,{'tableName':_0x8a7a('0x9'),'paranoid':![],'indexes':[{'name':_0x8a7a('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index e59f042..b295ffd 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 _0x31bb=['http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x54675f,_0x5d2c19){var _0x302c74=function(_0x2bfc1c){while(--_0x2bfc1c){_0x54675f['push'](_0x54675f['shift']());}};_0x302c74(++_0x5d2c19);}(_0x31bb,0x121));var _0xb31b=function(_0x11c15b,_0x48aa13){_0x11c15b=_0x11c15b-0x0;var _0x124402=_0x31bb[_0x11c15b];return _0x124402;};'use strict';var _=require(_0xb31b('0x0'));var util=require(_0xb31b('0x1'));var moment=require(_0xb31b('0x2'));var BPromise=require(_0xb31b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb31b('0x4'));var db=require(_0xb31b('0x5'))['db'];var utils=require(_0xb31b('0x6'));var logger=require(_0xb31b('0x7'))(_0xb31b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb31b('0x9')][_0xb31b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x235bc6,_0x2b5654,_0x47eca4){return new BPromise(function(_0x49ec1c,_0x336918){return client[_0xb31b('0xb')](_0x235bc6,_0x47eca4)[_0xb31b('0xc')](function(_0x16be21){logger[_0xb31b('0xd')](_0xb31b('0xe'),_0x2b5654,'request\x20sent');logger[_0xb31b('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2b5654,_0xb31b('0x10'),JSON[_0xb31b('0x11')](_0x16be21));if(_0x16be21[_0xb31b('0x12')]){if(_0x16be21['error'][_0xb31b('0x13')]===0x1f4){logger[_0xb31b('0x12')](_0xb31b('0xe'),_0x2b5654,_0x16be21[_0xb31b('0x12')][_0xb31b('0x14')]);return _0x336918(_0x16be21[_0xb31b('0x12')][_0xb31b('0x14')]);}logger[_0xb31b('0x12')](_0xb31b('0xe'),_0x2b5654,_0x16be21[_0xb31b('0x12')][_0xb31b('0x14')]);return _0x49ec1c(_0x16be21['error']['message']);}else{logger[_0xb31b('0xd')](_0xb31b('0xe'),_0x2b5654,'request\x20sent');_0x49ec1c(_0x16be21[_0xb31b('0x15')][_0xb31b('0x14')]);}})[_0xb31b('0x16')](function(_0xae82ba){logger[_0xb31b('0x12')](_0xb31b('0xe'),_0x2b5654,_0xae82ba);_0x336918(_0xae82ba);});});} \ No newline at end of file +var _0x2c5c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ScreenRecording,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x155119,_0x237bd4){var _0x5cc2a8=function(_0x533863){while(--_0x533863){_0x155119['push'](_0x155119['shift']());}};_0x5cc2a8(++_0x237bd4);}(_0x2c5c,0x1cc));var _0xc2c5=function(_0x29788b,_0x47376d){_0x29788b=_0x29788b-0x0;var _0xb490e9=_0x2c5c[_0x29788b];return _0xb490e9;};'use strict';var _=require(_0xc2c5('0x0'));var util=require(_0xc2c5('0x1'));var moment=require(_0xc2c5('0x2'));var BPromise=require(_0xc2c5('0x3'));var rs=require(_0xc2c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2c5('0x5'))['db'];var utils=require(_0xc2c5('0x6'));var logger=require(_0xc2c5('0x7'))(_0xc2c5('0x8'));var config=require(_0xc2c5('0x9'));var jayson=require(_0xc2c5('0xa'));var client=jayson['client'][_0xc2c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x225ca7,_0x38a478,_0x3acfea){return new BPromise(function(_0x374cad,_0x264a92){return client[_0xc2c5('0xc')](_0x225ca7,_0x3acfea)['then'](function(_0x13c399){logger[_0xc2c5('0xd')](_0xc2c5('0xe'),_0x38a478,'request\x20sent');logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x38a478,'request\x20sent',JSON[_0xc2c5('0xf')](_0x13c399));if(_0x13c399[_0xc2c5('0x10')]){if(_0x13c399['error'][_0xc2c5('0x11')]===0x1f4){logger[_0xc2c5('0x10')](_0xc2c5('0xe'),_0x38a478,_0x13c399[_0xc2c5('0x10')][_0xc2c5('0x12')]);return _0x264a92(_0x13c399[_0xc2c5('0x10')][_0xc2c5('0x12')]);}logger[_0xc2c5('0x10')](_0xc2c5('0xe'),_0x38a478,_0x13c399['error'][_0xc2c5('0x12')]);return _0x374cad(_0x13c399[_0xc2c5('0x10')][_0xc2c5('0x12')]);}else{logger[_0xc2c5('0xd')](_0xc2c5('0xe'),_0x38a478,_0xc2c5('0x13'));_0x374cad(_0x13c399[_0xc2c5('0x14')]['message']);}})[_0xc2c5('0x15')](function(_0x5d5ee3){logger[_0xc2c5('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x38a478,_0x5d5ee3);_0x264a92(_0x5d5ee3);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 0ae0b83..8d0b479 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 _0x3eb2=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','index','get','getDate','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname','post','single','file','addLogo','root','server/files/images/logos/','logologin','addLogoLogin','preferred','addPreferred','addFavicon','put','exports'];(function(_0x34dd7d,_0x292398){var _0x2cd95b=function(_0x24e7d8){while(--_0x24e7d8){_0x34dd7d['push'](_0x34dd7d['shift']());}};_0x2cd95b(++_0x292398);}(_0x3eb2,0x171));var _0x23eb=function(_0x38154f,_0xf0d239){_0x38154f=_0x38154f-0x0;var _0x9e29fe=_0x3eb2[_0x38154f];return _0x9e29fe;};'use strict';var multer=require(_0x23eb('0x0'));var util=require('util');var path=require(_0x23eb('0x1'));var timeout=require(_0x23eb('0x2'));var express=require('express');var router=express[_0x23eb('0x3')]();var fs_extra=require(_0x23eb('0x4'));var auth=require(_0x23eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x23eb('0x6'));var controller=require(_0x23eb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x23eb('0x8')]);router[_0x23eb('0x9')]('/now',controller[_0x23eb('0xa')]);router[_0x23eb('0x9')](_0x23eb('0xb'),controller[_0x23eb('0xc')]);router[_0x23eb('0x9')]('/:id/logo',controller[_0x23eb('0xd')]);router[_0x23eb('0x9')](_0x23eb('0xe'),controller[_0x23eb('0xf')]);router[_0x23eb('0x9')](_0x23eb('0x10'),controller[_0x23eb('0x11')]);router['get'](_0x23eb('0x12'),controller['getPreferred']);router[_0x23eb('0x9')](_0x23eb('0x13'),controller[_0x23eb('0x14')]);var upload=multer({'storage':multer[_0x23eb('0x15')]({'destination':function(_0x148766,_0x1ff20a,_0x5c7e6f){_0x5c7e6f(null,path[_0x23eb('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1a5fa4,_0x532fca,_0x1ff22f){_0x1ff22f(null,util[_0x23eb('0x17')](_0x23eb('0x18'),_0x23eb('0x19'),path[_0x23eb('0x1a')](_0x532fca[_0x23eb('0x1b')])));}})});router[_0x23eb('0x1c')]('/:id/logo',upload[_0x23eb('0x1d')](_0x23eb('0x1e')),controller[_0x23eb('0x1f')]);var upload=multer({'storage':multer[_0x23eb('0x15')]({'destination':function(_0x1bf7ea,_0x3e98b1,_0x3fed28){_0x3fed28(null,path[_0x23eb('0x16')](config[_0x23eb('0x20')],_0x23eb('0x21')));},'filename':function(_0x344d05,_0x8baf2a,_0x1c7e67){_0x1c7e67(null,util[_0x23eb('0x17')](_0x23eb('0x18'),_0x23eb('0x22'),path[_0x23eb('0x1a')](_0x8baf2a[_0x23eb('0x1b')])));}})});router['post'](_0x23eb('0xe'),upload[_0x23eb('0x1d')]('file'),controller[_0x23eb('0x23')]);var upload=multer({'storage':multer[_0x23eb('0x15')]({'destination':function(_0xa61281,_0x3c7d3a,_0x45debc){_0x45debc(null,path[_0x23eb('0x16')](config[_0x23eb('0x20')],_0x23eb('0x21')));},'filename':function(_0x188db4,_0x497606,_0xd1913d){_0xd1913d(null,util['format']('%s%s',_0x23eb('0x24'),path[_0x23eb('0x1a')](_0x497606[_0x23eb('0x1b')])));}})});router[_0x23eb('0x1c')](_0x23eb('0x12'),upload[_0x23eb('0x1d')](_0x23eb('0x1e')),controller[_0x23eb('0x25')]);var upload=multer({'storage':multer[_0x23eb('0x15')]({'destination':function(_0x5c094b,_0x50d80a,_0x5df825){_0x5df825(null,path[_0x23eb('0x16')](config[_0x23eb('0x20')],_0x23eb('0x21')));},'filename':function(_0x5be538,_0x2ab505,_0x3a0969){_0x3a0969(null,util[_0x23eb('0x17')](_0x23eb('0x18'),'favicon',path[_0x23eb('0x1a')](_0x2ab505[_0x23eb('0x1b')])));}})});router[_0x23eb('0x1c')](_0x23eb('0x13'),upload[_0x23eb('0x1d')](_0x23eb('0x1e')),controller[_0x23eb('0x26')]);router[_0x23eb('0x27')](_0x23eb('0xb'),auth['isAuthenticated'](),controller['update']);module[_0x23eb('0x28')]=router; \ No newline at end of file +var _0x33e8=['getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname','post','addLogo','root','logologin','single','file','addLogoLogin','server/files/images/logos/','addPreferred','favicon','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon'];(function(_0x510ebb,_0x60a4c9){var _0x490fe7=function(_0x420e95){while(--_0x420e95){_0x510ebb['push'](_0x510ebb['shift']());}};_0x490fe7(++_0x60a4c9);}(_0x33e8,0x116));var _0x833e=function(_0x5919ba,_0x49758d){_0x5919ba=_0x5919ba-0x0;var _0x4d7f1b=_0x33e8[_0x5919ba];return _0x4d7f1b;};'use strict';var multer=require('multer');var util=require(_0x833e('0x0'));var path=require('path');var timeout=require(_0x833e('0x1'));var express=require(_0x833e('0x2'));var router=express[_0x833e('0x3')]();var fs_extra=require(_0x833e('0x4'));var auth=require(_0x833e('0x5'));var interaction=require(_0x833e('0x6'));var config=require('../../config/environment');var controller=require(_0x833e('0x7'));router[_0x833e('0x8')]('/',auth[_0x833e('0x9')](),controller[_0x833e('0xa')]);router[_0x833e('0x8')]('/now',controller[_0x833e('0xb')]);router[_0x833e('0x8')](_0x833e('0xc'),controller[_0x833e('0xd')]);router['get'](_0x833e('0xe'),controller[_0x833e('0xf')]);router[_0x833e('0x8')](_0x833e('0x10'),controller[_0x833e('0x11')]);router[_0x833e('0x8')](_0x833e('0x12'),controller[_0x833e('0x13')]);router['get'](_0x833e('0x14'),controller[_0x833e('0x15')]);router[_0x833e('0x8')](_0x833e('0x16'),controller[_0x833e('0x17')]);var upload=multer({'storage':multer[_0x833e('0x18')]({'destination':function(_0x3a2468,_0x15543a,_0x179edc){_0x179edc(null,path[_0x833e('0x19')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1efb8d,_0x3b2f03,_0x474ef4){_0x474ef4(null,util[_0x833e('0x1a')](_0x833e('0x1b'),_0x833e('0x1c'),path[_0x833e('0x1d')](_0x3b2f03[_0x833e('0x1e')])));}})});router[_0x833e('0x1f')](_0x833e('0xe'),upload['single']('file'),controller[_0x833e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56f0b1,_0x2facae,_0x1e0ada){_0x1e0ada(null,path[_0x833e('0x19')](config[_0x833e('0x21')],'server/files/images/logos/'));},'filename':function(_0x10ad1a,_0xd4adb4,_0x1fd620){_0x1fd620(null,util[_0x833e('0x1a')](_0x833e('0x1b'),_0x833e('0x22'),path[_0x833e('0x1d')](_0xd4adb4[_0x833e('0x1e')])));}})});router[_0x833e('0x1f')]('/:id/logo_login',upload[_0x833e('0x23')](_0x833e('0x24')),controller[_0x833e('0x25')]);var upload=multer({'storage':multer[_0x833e('0x18')]({'destination':function(_0x158b04,_0x30c04b,_0x433c57){_0x433c57(null,path['join'](config['root'],_0x833e('0x26')));},'filename':function(_0x54808b,_0x15e0a2,_0x5bf884){_0x5bf884(null,util[_0x833e('0x1a')](_0x833e('0x1b'),'preferred',path[_0x833e('0x1d')](_0x15e0a2[_0x833e('0x1e')])));}})});router[_0x833e('0x1f')]('/:id/preferred',upload[_0x833e('0x23')]('file'),controller[_0x833e('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16f4b0,_0x34b804,_0xf0b795){_0xf0b795(null,path[_0x833e('0x19')](config[_0x833e('0x21')],_0x833e('0x26')));},'filename':function(_0x38c78f,_0x1393f2,_0x4e4409){_0x4e4409(null,util[_0x833e('0x1a')]('%s%s',_0x833e('0x28'),path[_0x833e('0x1d')](_0x1393f2['originalname'])));}})});router[_0x833e('0x1f')](_0x833e('0x16'),upload[_0x833e('0x23')](_0x833e('0x24')),controller['addFavicon']);router[_0x833e('0x29')]('/:id',auth[_0x833e('0x9')](),controller['update']);module[_0x833e('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d7efba3..5b0e4ab 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 _0xaf9f=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x1108ce,_0x588fd9){var _0x2b13cf=function(_0x283d87){while(--_0x283d87){_0x1108ce['push'](_0x1108ce['shift']());}};_0x2b13cf(++_0x588fd9);}(_0xaf9f,0x1b4));var _0xfaf9=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xaf9f[_0x261522];return _0x98a25a;};'use strict';var Sequelize=require(_0xfaf9('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xfaf9('0x1')](0xb),'unique':_0xfaf9('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xfaf9('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xfaf9('0x3')],'defaultValue':_0xfaf9('0x4')},'logo':{'type':Sequelize[_0xfaf9('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xfaf9('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xfaf9('0x3')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xfaf9('0x3')]},'turnpassword':{'type':Sequelize[_0xfaf9('0x3')]},'pageTitle':{'type':Sequelize[_0xfaf9('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xfaf9('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xfaf9('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xfaf9('0x7')},'chatTimeout':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xfaf9('0x3')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xfaf9('0x3')]},'defaultFavicon':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xfaf9('0x1')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xfaf9('0x1')]},'sentimentRegion':{'type':Sequelize[_0xfaf9('0x3')]},'language':{'type':Sequelize[_0xfaf9('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xfaf9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xfaf9('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xfaf9('0x1')](0x2)[_0xfaf9('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xfaf9('0x1')](0x2)[_0xfaf9('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xfaf9('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xfaf9('0x1')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa547=['STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','exports','min_internal','min_mailbox','INTEGER'];(function(_0x256455,_0x386945){var _0x4b3825=function(_0x1699ea){while(--_0x1699ea){_0x256455['push'](_0x256455['shift']());}};_0x4b3825(++_0x386945);}(_0xa547,0xb0));var _0x7a54=function(_0x4e1442,_0x3d7ce7){_0x4e1442=_0x4e1442-0x0;var _0x43c962=_0xa547[_0x4e1442];return _0x43c962;};'use strict';var Sequelize=require('sequelize');module[_0x7a54('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x7a54('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x7a54('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x7a54('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7a54('0x4')],'defaultValue':_0x7a54('0x5')},'logo':{'type':Sequelize[_0x7a54('0x4')]},'defaultLogo':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7a54('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x7a54('0x4')]},'turnusername':{'type':Sequelize[_0x7a54('0x4')]},'turnpassword':{'type':Sequelize[_0x7a54('0x4')]},'pageTitle':{'type':Sequelize[_0x7a54('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7a54('0x4')],'defaultValue':_0x7a54('0x7')},'enableEmailPreview':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x7a54('0x4')],'defaultValue':_0x7a54('0x8')},'chatTimeout':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7a54('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x7a54('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x7a54('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x7a54('0x3')]},'sentimentRegion':{'type':Sequelize[_0x7a54('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x7a54('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x7a54('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x7a54('0x3')](0x2)[_0x7a54('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x7a54('0x3')](0x2)[_0x7a54('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x7a54('0x3')](0x2)[_0x7a54('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x7a54('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x7a54('0x3')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index f0da88f..3af7a17 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 _0x6ede=['limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','Setting','fieldName','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','findAll','params','rawAttributes','length','includeAll','options','body','find','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','getLogoLogin','default_loginLogo.svg','\x20not\x20found','securePassword','addPreferred','default_preferred.png','custom','download','addFavicon','../../config/license/util','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x6ede,0x140));var _0xe6ed=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x6ede[_0x74892f];return _0x10ee61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6ed('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6ed('0x1'));var rp=require(_0xe6ed('0x2'));var moment=require(_0xe6ed('0x3'));var BPromise=require(_0xe6ed('0x4'));var Mustache=require(_0xe6ed('0x5'));var util=require(_0xe6ed('0x6'));var path=require(_0xe6ed('0x7'));var sox=require('sox');var csv=require(_0xe6ed('0x8'));var ejs=require(_0xe6ed('0x9'));var fs=require('fs');var fs_extra=require(_0xe6ed('0xa'));var _=require(_0xe6ed('0xb'));var squel=require(_0xe6ed('0xc'));var crypto=require(_0xe6ed('0xd'));var jsforce=require(_0xe6ed('0xe'));var deskjs=require(_0xe6ed('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6ed('0x10'));var authService=require(_0xe6ed('0x11'));var qs=require(_0xe6ed('0x12'));var as=require(_0xe6ed('0x13'));var hardwareService=require(_0xe6ed('0x14'));var logger=require(_0xe6ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe6ed('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6ed('0x17'))['db'];var jayson=require(_0xe6ed('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f74ed,_0x438894,_0x5a143a,_0x47cbc8){return new BPromise(function(_0x3022e7,_0x2c82db){var _0x778106=_0x47cbc8||client;return _0x778106[_0xe6ed('0x19')](_0x4f74ed,_0x5a143a)[_0xe6ed('0x1a')](function(_0x1ef166){logger[_0xe6ed('0x1b')](_0xe6ed('0x1c'),_0x438894,_0xe6ed('0x1d'));logger[_0xe6ed('0x1e')](_0xe6ed('0x1f'),_0x438894,_0xe6ed('0x1d'),JSON[_0xe6ed('0x20')](_0x1ef166));if(_0x1ef166['error']){if(_0x1ef166[_0xe6ed('0x21')]['code']===0x1f4){logger[_0xe6ed('0x21')]('Setting,\x20%s,\x20%s',_0x438894,_0x1ef166['error'][_0xe6ed('0x22')]);return _0x2c82db(_0x1ef166[_0xe6ed('0x21')][_0xe6ed('0x22')]);}logger[_0xe6ed('0x21')]('Setting,\x20%s,\x20%s',_0x438894,_0x1ef166[_0xe6ed('0x21')]['message']);return _0x3022e7(_0x1ef166[_0xe6ed('0x21')]['message']);}else{logger[_0xe6ed('0x1b')]('Setting,\x20%s,\x20%s',_0x438894,'request\x20sent');_0x3022e7(_0x1ef166[_0xe6ed('0x23')][_0xe6ed('0x22')]);}})[_0xe6ed('0x24')](function(_0x1344dc){logger['error'](_0xe6ed('0x1c'),_0x438894,_0x1344dc);_0x2c82db(_0x1344dc);});});}function respondWithStatusCode(_0x24a019,_0x5cb139){_0x5cb139=_0x5cb139||0xcc;return function(_0x11546f){if(_0x11546f){return _0x24a019[_0xe6ed('0x25')](_0x5cb139);}return _0x24a019['status'](_0x5cb139)['end']();};}function respondWithResult(_0x1315ea,_0x1c9ac4){_0x1c9ac4=_0x1c9ac4||0xc8;return function(_0x3f4bfd){if(_0x3f4bfd){return _0x1315ea[_0xe6ed('0x26')](_0x1c9ac4)[_0xe6ed('0x27')](_0x3f4bfd);}};}function respondWithFilteredResult(_0x43c547,_0x19064c){return function(_0x136068){if(_0x136068){var _0x13dbe8=typeof _0x19064c[_0xe6ed('0x28')]===_0xe6ed('0x29')&&typeof _0x19064c['limit']===_0xe6ed('0x29');var _0x144257=_0x136068[_0xe6ed('0x2a')];var _0x58238e=_0x13dbe8?0x0:_0x19064c[_0xe6ed('0x28')];var _0x339795=_0x13dbe8?_0x136068[_0xe6ed('0x2a')]:_0x19064c[_0xe6ed('0x28')]+_0x19064c[_0xe6ed('0x2b')];var _0x1c881d;if(_0x339795>=_0x144257){_0x339795=_0x144257;_0x1c881d=0xc8;}else{_0x1c881d=0xce;}_0x43c547[_0xe6ed('0x26')](_0x1c881d);return _0x43c547[_0xe6ed('0x2c')](_0xe6ed('0x2d'),_0x58238e+'-'+_0x339795+'/'+_0x144257)['json'](_0x136068);}return null;};}function patchUpdates(_0x185b6e){return function(_0x524ded){try{jsonpatch[_0xe6ed('0x2e')](_0x524ded,_0x185b6e,!![]);}catch(_0x5445fe){return BPromise['reject'](_0x5445fe);}return _0x524ded[_0xe6ed('0x2f')]();};}function saveUpdates(_0x2314b0,_0x332fb5){return function(_0x77e8c5){if(_0x77e8c5){return _0x77e8c5[_0xe6ed('0x30')](_0x2314b0)[_0xe6ed('0x1a')](function(_0x34ed72){return _0x34ed72;});}return null;};}function removeEntity(_0x430318,_0x1a3abe){return function(_0x71c99c){if(_0x71c99c){return _0x71c99c[_0xe6ed('0x31')]()[_0xe6ed('0x1a')](function(){_0x430318[_0xe6ed('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d7c36,_0x23015a){return function(_0x32f1ae){if(!_0x32f1ae){_0x3d7c36[_0xe6ed('0x25')](0x194);}return _0x32f1ae;};}function handleError(_0x230fca,_0x47dd68){_0x47dd68=_0x47dd68||0x1f4;return function(_0x3d93fe){logger[_0xe6ed('0x21')](_0x3d93fe[_0xe6ed('0x32')]);if(_0x3d93fe[_0xe6ed('0x33')]){delete _0x3d93fe[_0xe6ed('0x33')];}_0x230fca['status'](_0x47dd68)[_0xe6ed('0x34')](_0x3d93fe);};}exports[_0xe6ed('0x35')]=function(_0x50df4b,_0x111853){var _0x5fddef={},_0x411c8b={},_0x3d4a9b={'count':0x0,'rows':[]};var _0x8386e4=_[_0xe6ed('0x36')](db[_0xe6ed('0x37')]['rawAttributes'],function(_0x317a1d){return{'name':_0x317a1d[_0xe6ed('0x38')],'type':_0x317a1d['type']['key']};});_0x411c8b['model']=_[_0xe6ed('0x36')](_0x8386e4,_0xe6ed('0x33'));_0x411c8b['query']=_[_0xe6ed('0x39')](_0x50df4b[_0xe6ed('0x3a')]);_0x411c8b[_0xe6ed('0x3b')]=_[_0xe6ed('0x3c')](_0x411c8b[_0xe6ed('0x3d')],_0x411c8b['query']);_0x5fddef[_0xe6ed('0x3e')]=_[_0xe6ed('0x3c')](_0x411c8b[_0xe6ed('0x3d')],qs[_0xe6ed('0x3f')](_0x50df4b[_0xe6ed('0x3a')]['fields']));_0x5fddef['attributes']=_0x5fddef[_0xe6ed('0x3e')]['length']?_0x5fddef[_0xe6ed('0x3e')]:_0x411c8b[_0xe6ed('0x3d')];if(!_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x40')](_0xe6ed('0x41'))){_0x5fddef['limit']=qs[_0xe6ed('0x2b')](_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x2b')]);_0x5fddef[_0xe6ed('0x28')]=qs[_0xe6ed('0x28')](_0x50df4b['query'][_0xe6ed('0x28')]);}_0x5fddef['order']=qs[_0xe6ed('0x42')](_0x50df4b['query']['sort']);_0x5fddef[_0xe6ed('0x43')]=qs[_0xe6ed('0x3b')](_[_0xe6ed('0x44')](_0x50df4b[_0xe6ed('0x3a')],_0x411c8b['filters']),_0x8386e4);if(_0x50df4b['query'][_0xe6ed('0x45')]){_0x5fddef['where']=_[_0xe6ed('0x46')](_0x5fddef['where'],{'$or':_[_0xe6ed('0x36')](_0x8386e4,function(_0x53ce95){if(_0x53ce95[_0xe6ed('0x47')]!==_0xe6ed('0x48')){var _0x5d5529={};_0x5d5529[_0x53ce95[_0xe6ed('0x33')]]={'$like':'%'+_0x50df4b[_0xe6ed('0x3a')][_0xe6ed('0x45')]+'%'};return _0x5d5529;}})});}_0x5fddef=_[_0xe6ed('0x46')]({},_0x5fddef,_0x50df4b['options']);var _0x5a417d={'where':_0x5fddef[_0xe6ed('0x43')]};return db[_0xe6ed('0x37')]['count'](_0x5a417d)[_0xe6ed('0x1a')](function(_0x44583e){_0x3d4a9b['count']=_0x44583e;if(_0x50df4b[_0xe6ed('0x3a')]['includeAll']){_0x5fddef['include']=[{'all':!![]}];}return db['Setting'][_0xe6ed('0x49')](_0x5fddef);})[_0xe6ed('0x1a')](function(_0x39e1ea){_0x3d4a9b['rows']=_0x39e1ea;return _0x3d4a9b;})[_0xe6ed('0x1a')](respondWithFilteredResult(_0x111853,_0x5fddef))[_0xe6ed('0x24')](handleError(_0x111853,null));};exports['show']=function(_0xc0844e,_0x18122b){var _0x3ac16c={'raw':![],'where':{'id':_0xc0844e[_0xe6ed('0x4a')]['id']}},_0x5624d2={};_0x5624d2[_0xe6ed('0x3d')]=_[_0xe6ed('0x39')](db[_0xe6ed('0x37')][_0xe6ed('0x4b')]);_0x5624d2['query']=_[_0xe6ed('0x39')](_0xc0844e[_0xe6ed('0x3a')]);_0x5624d2[_0xe6ed('0x3b')]=_['intersection'](_0x5624d2['model'],_0x5624d2[_0xe6ed('0x3a')]);_0x3ac16c[_0xe6ed('0x3e')]=_[_0xe6ed('0x3c')](_0x5624d2[_0xe6ed('0x3d')],qs['fields'](_0xc0844e[_0xe6ed('0x3a')][_0xe6ed('0x3f')]));_0x3ac16c[_0xe6ed('0x3e')]=_0x3ac16c[_0xe6ed('0x3e')][_0xe6ed('0x4c')]?_0x3ac16c['attributes']:_0x5624d2[_0xe6ed('0x3d')];if(_0xc0844e['query'][_0xe6ed('0x4d')]){_0x3ac16c['include']=[{'all':!![]}];}_0x3ac16c=_[_0xe6ed('0x46')]({},_0x3ac16c,_0xc0844e[_0xe6ed('0x4e')]);return db[_0xe6ed('0x37')]['find'](_0x3ac16c)['then'](handleEntityNotFound(_0x18122b,null))[_0xe6ed('0x1a')](respondWithResult(_0x18122b,null))[_0xe6ed('0x24')](handleError(_0x18122b,null));};exports['update']=function(_0x4e1384,_0x4ff932){if(_0x4e1384[_0xe6ed('0x4f')]['id']){delete _0x4e1384[_0xe6ed('0x4f')]['id'];}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x4e1384[_0xe6ed('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ff932,null))['then'](saveUpdates(_0x4e1384[_0xe6ed('0x4f')],null))['then'](respondWithResult(_0x4ff932,null))[_0xe6ed('0x24')](handleError(_0x4ff932,null));};exports[_0xe6ed('0x51')]=function(_0x3c7e42,_0x3bc47a,_0x2370e6){if(_0x3c7e42[_0xe6ed('0x52')]&&_0x3c7e42[_0xe6ed('0x52')]['filename']){_0x3c7e42[_0xe6ed('0x4f')][_0xe6ed('0x53')]=_0x3c7e42[_0xe6ed('0x52')][_0xe6ed('0x54')];}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x3c7e42[_0xe6ed('0x4a')]['id']}})[_0xe6ed('0x1a')](handleEntityNotFound(_0x3bc47a,null))[_0xe6ed('0x1a')](saveUpdates(_0x3c7e42[_0xe6ed('0x4f')],null))['then'](respondWithResult(_0x3bc47a,null))[_0xe6ed('0x24')](handleError(_0x3bc47a,null));};exports[_0xe6ed('0x55')]=function(_0x178df8,_0xd45d57,_0xbb088a){if(_0x178df8['file']&&_0x178df8[_0xe6ed('0x52')][_0xe6ed('0x54')]){_0x178df8[_0xe6ed('0x4f')][_0xe6ed('0x56')]=_0x178df8[_0xe6ed('0x52')][_0xe6ed('0x54')];}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x178df8[_0xe6ed('0x4a')]['id']}})[_0xe6ed('0x1a')](handleEntityNotFound(_0xd45d57,null))[_0xe6ed('0x1a')](saveUpdates(_0x178df8[_0xe6ed('0x4f')],null))['then'](respondWithResult(_0xd45d57,null))[_0xe6ed('0x24')](handleError(_0xd45d57,null));};var utilLicense=require('../../config/license/util');exports[_0xe6ed('0x57')]=function(_0x2af41c,_0x1d2e4f,_0x474e5d){var _0x5249f0=_0xe6ed('0x58');var _0x47d6df={'custom':![]};return utilLicense[_0xe6ed('0x59')]()[_0xe6ed('0x1a')](function(_0x43d527){if(_0x43d527){_0x47d6df=_0x43d527;}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x2af41c[_0xe6ed('0x4a')]['id']},'attributes':[_0xe6ed('0x53'),_0xe6ed('0x56'),_0xe6ed('0x5a'),_0xe6ed('0x5b'),_0xe6ed('0x5c'),_0xe6ed('0x5d'),_0xe6ed('0x5e'),_0xe6ed('0x5f')],'raw':!![]});})[_0xe6ed('0x1a')](handleEntityNotFound(_0x1d2e4f,null))['then'](function(_0x3202d6){if(_0x3202d6){var _0x4849e5=_0x3202d6[_0xe6ed('0x53')]&&fs[_0xe6ed('0x60')](path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x5249f0,_[_0xe6ed('0x63')](_0x3202d6['logo'])))?path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x5249f0,_[_0xe6ed('0x63')](_0x3202d6[_0xe6ed('0x53')])):path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x5249f0,_[_0xe6ed('0x63')](_0xe6ed('0x64')));var _0x335451=_0xe6ed('0x65')+_[_0xe6ed('0x66')](_0xe6ed('0x53'));if(_0x3202d6[_0x335451]||!_0x47d6df['custom']){_0x4849e5=path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x5249f0,_[_0xe6ed('0x63')](_0xe6ed('0x64')));}if(!fs['existsSync'](_0x4849e5)){throw new db[(_0xe6ed('0x67'))][(_0xe6ed('0x68'))](_[_0xe6ed('0x66')](_0xe6ed('0x53'))+'\x20not\x20found');}return _0x1d2e4f['download'](_0x4849e5);}})[_0xe6ed('0x24')](handleError(_0x1d2e4f,null));};var utilLicense=require('../../config/license/util');exports[_0xe6ed('0x69')]=function(_0x2e12f4,_0x26c593,_0x44eaed){var _0x3dc5ab=_0xe6ed('0x58');var _0x228e89={'custom':![]};return utilLicense[_0xe6ed('0x59')]()[_0xe6ed('0x1a')](function(_0x1fcd93){if(_0x1fcd93){_0x228e89=_0x1fcd93;}return db['Setting'][_0xe6ed('0x50')]({'where':{'id':_0x2e12f4[_0xe6ed('0x4a')]['id']},'attributes':[_0xe6ed('0x53'),'loginLogo','preferred',_0xe6ed('0x5b'),_0xe6ed('0x5c'),_0xe6ed('0x5d'),_0xe6ed('0x5e'),_0xe6ed('0x5f')],'raw':!![]});})[_0xe6ed('0x1a')](handleEntityNotFound(_0x26c593,null))['then'](function(_0x5d02dc){if(_0x5d02dc){var _0x2d730d=_0x5d02dc[_0xe6ed('0x56')]&&fs[_0xe6ed('0x60')](path['join'](config[_0xe6ed('0x62')],_0x3dc5ab,_['toLower'](_0x5d02dc[_0xe6ed('0x56')])))?path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x3dc5ab,_['toLower'](_0x5d02dc[_0xe6ed('0x56')])):path[_0xe6ed('0x61')](config['root'],_0x3dc5ab,_[_0xe6ed('0x63')](_0xe6ed('0x6a')));var _0x3a02d9=_0xe6ed('0x65')+_[_0xe6ed('0x66')](_0xe6ed('0x56'));if(_0x5d02dc[_0x3a02d9]||!_0x228e89['custom']){_0x2d730d=path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x3dc5ab,_['toLower'](_0xe6ed('0x6a')));}if(!fs[_0xe6ed('0x60')](_0x2d730d)){throw new db[(_0xe6ed('0x67'))][(_0xe6ed('0x68'))](_[_0xe6ed('0x66')](_0xe6ed('0x56'))+_0xe6ed('0x6b'));}return _0x26c593['download'](_0x2d730d);}})[_0xe6ed('0x24')](handleError(_0x26c593,null));};exports['gdpr']=function(_0x5a93fa,_0x3f9747){return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x5a93fa['params']['id']},'attributes':[_0xe6ed('0x6c')]})[_0xe6ed('0x1a')](respondWithResult(_0x3f9747,null))['catch'](handleError(_0x3f9747,null));};exports[_0xe6ed('0x6d')]=function(_0x3371cd,_0x5f7c9f,_0xb1cd9c){if(_0x3371cd['file']&&_0x3371cd[_0xe6ed('0x52')]['filename']){_0x3371cd[_0xe6ed('0x4f')][_0xe6ed('0x5a')]=_0x3371cd[_0xe6ed('0x52')][_0xe6ed('0x54')];}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x3371cd['params']['id']}})[_0xe6ed('0x1a')](handleEntityNotFound(_0x5f7c9f,null))['then'](saveUpdates(_0x3371cd[_0xe6ed('0x4f')],null))['then'](respondWithResult(_0x5f7c9f,null))[_0xe6ed('0x24')](handleError(_0x5f7c9f,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x49740a,_0x1d5850,_0x50e902){var _0x1da3b0='server/files/images/logos';var _0x1eb902={'custom':![]};return utilLicense[_0xe6ed('0x59')]()[_0xe6ed('0x1a')](function(_0x1747cc){if(_0x1747cc){_0x1eb902=_0x1747cc;}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x49740a['params']['id']},'attributes':[_0xe6ed('0x53'),_0xe6ed('0x56'),_0xe6ed('0x5a'),_0xe6ed('0x5b'),_0xe6ed('0x5c'),'defaultLoginLogo',_0xe6ed('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x1d5850,null))[_0xe6ed('0x1a')](function(_0x40ab10){if(_0x40ab10){var _0x46e484=_0x40ab10[_0xe6ed('0x5a')]&&fs[_0xe6ed('0x60')](path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x1da3b0,_['toLower'](_0x40ab10[_0xe6ed('0x5a')])))?path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x1da3b0,_[_0xe6ed('0x63')](_0x40ab10[_0xe6ed('0x5a')])):path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x1da3b0,_[_0xe6ed('0x63')](_0xe6ed('0x6e')));var _0x2db1e6=_0xe6ed('0x65')+_['upperFirst']('preferred');if(_0x40ab10[_0x2db1e6]||!_0x1eb902[_0xe6ed('0x6f')]||!_0x1eb902[_0xe6ed('0x5a')]){_0x46e484=path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x1da3b0,_['toLower'](_0xe6ed('0x6e')));}if(!fs[_0xe6ed('0x60')](_0x46e484)){throw new db['Sequelize']['ValidationError'](_[_0xe6ed('0x66')](_0xe6ed('0x5a'))+_0xe6ed('0x6b'));}return _0x1d5850[_0xe6ed('0x70')](_0x46e484);}})[_0xe6ed('0x24')](handleError(_0x1d5850,null));};exports[_0xe6ed('0x71')]=function(_0x46b082,_0x2ec46d,_0x21d5f2){if(_0x46b082['file']&&_0x46b082['file'][_0xe6ed('0x54')]){_0x46b082[_0xe6ed('0x4f')][_0xe6ed('0x5b')]=_0x46b082[_0xe6ed('0x52')][_0xe6ed('0x54')];}return db['Setting']['find']({'where':{'id':_0x46b082[_0xe6ed('0x4a')]['id']}})[_0xe6ed('0x1a')](handleEntityNotFound(_0x2ec46d,null))['then'](saveUpdates(_0x46b082[_0xe6ed('0x4f')],null))[_0xe6ed('0x1a')](respondWithResult(_0x2ec46d,null))['catch'](handleError(_0x2ec46d,null));};var utilLicense=require(_0xe6ed('0x72'));exports[_0xe6ed('0x73')]=function(_0x1b3620,_0x4d50df,_0x5567e6){var _0x3f0abd=_0xe6ed('0x58');var _0xfc0ae2={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xcd43de){if(_0xcd43de){_0xfc0ae2=_0xcd43de;}return db[_0xe6ed('0x37')][_0xe6ed('0x50')]({'where':{'id':_0x1b3620[_0xe6ed('0x4a')]['id']},'attributes':[_0xe6ed('0x53'),_0xe6ed('0x56'),'preferred',_0xe6ed('0x5b'),_0xe6ed('0x5c'),'defaultLoginLogo','defaultPreferred',_0xe6ed('0x5f')],'raw':!![]});})[_0xe6ed('0x1a')](handleEntityNotFound(_0x4d50df,null))['then'](function(_0x196a59){if(_0x196a59){var _0x26c8b4=_0x196a59[_0xe6ed('0x5b')]&&fs[_0xe6ed('0x60')](path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x3f0abd,_[_0xe6ed('0x63')](_0x196a59[_0xe6ed('0x5b')])))?path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x3f0abd,_[_0xe6ed('0x63')](_0x196a59[_0xe6ed('0x5b')])):path[_0xe6ed('0x61')](config['root'],_0x3f0abd,_[_0xe6ed('0x63')](_0xe6ed('0x74')));var _0x165b32=_0xe6ed('0x65')+_[_0xe6ed('0x66')](_0xe6ed('0x5b'));if(_0x196a59[_0x165b32]||!_0xfc0ae2[_0xe6ed('0x6f')]){_0x26c8b4=path[_0xe6ed('0x61')](config[_0xe6ed('0x62')],_0x3f0abd,_[_0xe6ed('0x63')](_0xe6ed('0x74')));}if(!fs[_0xe6ed('0x60')](_0x26c8b4)){throw new db['Sequelize'][(_0xe6ed('0x68'))](_[_0xe6ed('0x66')]('favicon')+_0xe6ed('0x6b'));}return _0x4d50df[_0xe6ed('0x70')](_0x26c8b4);}})[_0xe6ed('0x24')](handleError(_0x4d50df,null));};exports[_0xe6ed('0x75')]=function(_0x14cf9a,_0x2d80ee){var _0x3dcb46={'offset':moment()[_0xe6ed('0x76')]()};_0x3dcb46['now']=moment()[_0xe6ed('0x76')](_0x3dcb46[_0xe6ed('0x28')])[_0xe6ed('0x77')](_0xe6ed('0x78'));return _0x2d80ee[_0xe6ed('0x26')](0xc8)['send'](_0x3dcb46);}; \ No newline at end of file +var _0x4a5a=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','destroy','stack','name','index','Setting','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','rawAttributes','length','include','find','update','body','addLogo','file','filename','params','addLogoLogin','loginLogo','../../config/license/util','getLicense','logo','favicon','defaultLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','default_loginLogo.svg','default','existsSync','Sequelize','ValidationError','gdpr','addPreferred','getPreferred','defaultLoginLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x38e138,_0x5d08ea){var _0x604149=function(_0xd865bb){while(--_0xd865bb){_0x38e138['push'](_0x38e138['shift']());}};_0x604149(++_0x5d08ea);}(_0x4a5a,0x6e));var _0xa4a5=function(_0x3ca597,_0x42741a){_0x3ca597=_0x3ca597-0x0;var _0x4bd23f=_0x4a5a[_0x3ca597];return _0x4bd23f;};'use strict';var emlformat=require(_0xa4a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4a5('0x1'));var jsonpatch=require(_0xa4a5('0x2'));var rp=require(_0xa4a5('0x3'));var moment=require('moment');var BPromise=require(_0xa4a5('0x4'));var Mustache=require(_0xa4a5('0x5'));var util=require(_0xa4a5('0x6'));var path=require(_0xa4a5('0x7'));var sox=require(_0xa4a5('0x8'));var csv=require(_0xa4a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4a5('0xa'));var squel=require('squel');var crypto=require(_0xa4a5('0xb'));var jsforce=require(_0xa4a5('0xc'));var deskjs=require(_0xa4a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa4a5('0xe'));var Papa=require('papaparse');var Redis=require(_0xa4a5('0xf'));var authService=require(_0xa4a5('0x10'));var qs=require(_0xa4a5('0x11'));var as=require(_0xa4a5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa4a5('0x13'));var utils=require(_0xa4a5('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa4a5('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x3fcd97,_0x26f221,_0x5467ab,_0x5278be){return new BPromise(function(_0x5f444a,_0x4b2ab6){var _0xb5a29d=_0x5278be||client;return _0xb5a29d[_0xa4a5('0x16')](_0x3fcd97,_0x5467ab)[_0xa4a5('0x17')](function(_0x1f321e){logger['info'](_0xa4a5('0x18'),_0x26f221,_0xa4a5('0x19'));logger[_0xa4a5('0x1a')](_0xa4a5('0x1b'),_0x26f221,_0xa4a5('0x19'),JSON[_0xa4a5('0x1c')](_0x1f321e));if(_0x1f321e[_0xa4a5('0x1d')]){if(_0x1f321e[_0xa4a5('0x1d')][_0xa4a5('0x1e')]===0x1f4){logger[_0xa4a5('0x1d')]('Setting,\x20%s,\x20%s',_0x26f221,_0x1f321e[_0xa4a5('0x1d')]['message']);return _0x4b2ab6(_0x1f321e[_0xa4a5('0x1d')][_0xa4a5('0x1f')]);}logger[_0xa4a5('0x1d')](_0xa4a5('0x18'),_0x26f221,_0x1f321e[_0xa4a5('0x1d')]['message']);return _0x5f444a(_0x1f321e[_0xa4a5('0x1d')]['message']);}else{logger['info'](_0xa4a5('0x18'),_0x26f221,_0xa4a5('0x19'));_0x5f444a(_0x1f321e[_0xa4a5('0x20')][_0xa4a5('0x1f')]);}})[_0xa4a5('0x21')](function(_0x32bf00){logger[_0xa4a5('0x1d')](_0xa4a5('0x18'),_0x26f221,_0x32bf00);_0x4b2ab6(_0x32bf00);});});}function respondWithStatusCode(_0x570381,_0xf6e0bf){_0xf6e0bf=_0xf6e0bf||0xcc;return function(_0x18b4ee){if(_0x18b4ee){return _0x570381[_0xa4a5('0x22')](_0xf6e0bf);}return _0x570381[_0xa4a5('0x23')](_0xf6e0bf)[_0xa4a5('0x24')]();};}function respondWithResult(_0x2c48c8,_0xf0d9bd){_0xf0d9bd=_0xf0d9bd||0xc8;return function(_0x364cf5){if(_0x364cf5){return _0x2c48c8['status'](_0xf0d9bd)[_0xa4a5('0x25')](_0x364cf5);}};}function respondWithFilteredResult(_0x337292,_0xbcb7a3){return function(_0x57a526){if(_0x57a526){var _0x4f5663=typeof _0xbcb7a3['offset']==='undefined'&&typeof _0xbcb7a3['limit']===_0xa4a5('0x26');var _0x10bd8c=_0x57a526[_0xa4a5('0x27')];var _0xdcbc5e=_0x4f5663?0x0:_0xbcb7a3[_0xa4a5('0x28')];var _0x5bb174=_0x4f5663?_0x57a526[_0xa4a5('0x27')]:_0xbcb7a3[_0xa4a5('0x28')]+_0xbcb7a3['limit'];var _0x52bb2e;if(_0x5bb174>=_0x10bd8c){_0x5bb174=_0x10bd8c;_0x52bb2e=0xc8;}else{_0x52bb2e=0xce;}_0x337292[_0xa4a5('0x23')](_0x52bb2e);return _0x337292[_0xa4a5('0x29')](_0xa4a5('0x2a'),_0xdcbc5e+'-'+_0x5bb174+'/'+_0x10bd8c)['json'](_0x57a526);}return null;};}function patchUpdates(_0xe2bd){return function(_0x4a5d4b){try{jsonpatch['apply'](_0x4a5d4b,_0xe2bd,!![]);}catch(_0x4e6699){return BPromise[_0xa4a5('0x2b')](_0x4e6699);}return _0x4a5d4b[_0xa4a5('0x2c')]();};}function saveUpdates(_0x5d09b9,_0x2063ba){return function(_0x23bc1f){if(_0x23bc1f){return _0x23bc1f['update'](_0x5d09b9)['then'](function(_0x5bb308){return _0x5bb308;});}return null;};}function removeEntity(_0x3e5e73,_0x4e40a5){return function(_0x4ea22a){if(_0x4ea22a){return _0x4ea22a[_0xa4a5('0x2d')]()[_0xa4a5('0x17')](function(){_0x3e5e73[_0xa4a5('0x23')](0xcc)[_0xa4a5('0x24')]();});}};}function handleEntityNotFound(_0x583204,_0x685729){return function(_0x1e641f){if(!_0x1e641f){_0x583204[_0xa4a5('0x22')](0x194);}return _0x1e641f;};}function handleError(_0x120669,_0x15fbe6){_0x15fbe6=_0x15fbe6||0x1f4;return function(_0x5dc33f){logger[_0xa4a5('0x1d')](_0x5dc33f[_0xa4a5('0x2e')]);if(_0x5dc33f[_0xa4a5('0x2f')]){delete _0x5dc33f[_0xa4a5('0x2f')];}_0x120669['status'](_0x15fbe6)['send'](_0x5dc33f);};}exports[_0xa4a5('0x30')]=function(_0x5b9f74,_0x5b23b4){var _0x340252={},_0x1e1900={},_0x19484d={'count':0x0,'rows':[]};var _0x31888a=_['map'](db[_0xa4a5('0x31')]['rawAttributes'],function(_0x5901bd){return{'name':_0x5901bd[_0xa4a5('0x32')],'type':_0x5901bd[_0xa4a5('0x33')][_0xa4a5('0x34')]};});_0x1e1900[_0xa4a5('0x35')]=_[_0xa4a5('0x36')](_0x31888a,_0xa4a5('0x2f'));_0x1e1900['query']=_[_0xa4a5('0x37')](_0x5b9f74[_0xa4a5('0x38')]);_0x1e1900[_0xa4a5('0x39')]=_[_0xa4a5('0x3a')](_0x1e1900['model'],_0x1e1900[_0xa4a5('0x38')]);_0x340252[_0xa4a5('0x3b')]=_['intersection'](_0x1e1900['model'],qs[_0xa4a5('0x3c')](_0x5b9f74['query'][_0xa4a5('0x3c')]));_0x340252[_0xa4a5('0x3b')]=_0x340252[_0xa4a5('0x3b')]['length']?_0x340252[_0xa4a5('0x3b')]:_0x1e1900['model'];if(!_0x5b9f74[_0xa4a5('0x38')][_0xa4a5('0x3d')](_0xa4a5('0x3e'))){_0x340252[_0xa4a5('0x3f')]=qs[_0xa4a5('0x3f')](_0x5b9f74[_0xa4a5('0x38')][_0xa4a5('0x3f')]);_0x340252[_0xa4a5('0x28')]=qs['offset'](_0x5b9f74[_0xa4a5('0x38')][_0xa4a5('0x28')]);}_0x340252[_0xa4a5('0x40')]=qs[_0xa4a5('0x41')](_0x5b9f74[_0xa4a5('0x38')][_0xa4a5('0x41')]);_0x340252[_0xa4a5('0x42')]=qs[_0xa4a5('0x39')](_['pick'](_0x5b9f74[_0xa4a5('0x38')],_0x1e1900['filters']),_0x31888a);if(_0x5b9f74['query'][_0xa4a5('0x43')]){_0x340252[_0xa4a5('0x42')]=_['merge'](_0x340252[_0xa4a5('0x42')],{'$or':_['map'](_0x31888a,function(_0x35eabe){if(_0x35eabe['type']!==_0xa4a5('0x44')){var _0x46a7c8={};_0x46a7c8[_0x35eabe[_0xa4a5('0x2f')]]={'$like':'%'+_0x5b9f74[_0xa4a5('0x38')]['filter']+'%'};return _0x46a7c8;}})});}_0x340252=_[_0xa4a5('0x45')]({},_0x340252,_0x5b9f74[_0xa4a5('0x46')]);var _0x52bc00={'where':_0x340252[_0xa4a5('0x42')]};return db[_0xa4a5('0x31')][_0xa4a5('0x27')](_0x52bc00)['then'](function(_0x5896e5){_0x19484d[_0xa4a5('0x27')]=_0x5896e5;if(_0x5b9f74[_0xa4a5('0x38')]['includeAll']){_0x340252['include']=[{'all':!![]}];}return db[_0xa4a5('0x31')][_0xa4a5('0x47')](_0x340252);})['then'](function(_0x544a57){_0x19484d[_0xa4a5('0x48')]=_0x544a57;return _0x19484d;})['then'](respondWithFilteredResult(_0x5b23b4,_0x340252))[_0xa4a5('0x21')](handleError(_0x5b23b4,null));};exports['show']=function(_0x1a1842,_0x17d5ab){var _0x296b88={'raw':![],'where':{'id':_0x1a1842['params']['id']}},_0x4bc1a0={};_0x4bc1a0[_0xa4a5('0x35')]=_['keys'](db[_0xa4a5('0x31')][_0xa4a5('0x49')]);_0x4bc1a0['query']=_['keys'](_0x1a1842[_0xa4a5('0x38')]);_0x4bc1a0[_0xa4a5('0x39')]=_['intersection'](_0x4bc1a0[_0xa4a5('0x35')],_0x4bc1a0['query']);_0x296b88['attributes']=_['intersection'](_0x4bc1a0[_0xa4a5('0x35')],qs[_0xa4a5('0x3c')](_0x1a1842[_0xa4a5('0x38')][_0xa4a5('0x3c')]));_0x296b88[_0xa4a5('0x3b')]=_0x296b88[_0xa4a5('0x3b')][_0xa4a5('0x4a')]?_0x296b88[_0xa4a5('0x3b')]:_0x4bc1a0[_0xa4a5('0x35')];if(_0x1a1842['query']['includeAll']){_0x296b88[_0xa4a5('0x4b')]=[{'all':!![]}];}_0x296b88=_[_0xa4a5('0x45')]({},_0x296b88,_0x1a1842[_0xa4a5('0x46')]);return db[_0xa4a5('0x31')][_0xa4a5('0x4c')](_0x296b88)[_0xa4a5('0x17')](handleEntityNotFound(_0x17d5ab,null))['then'](respondWithResult(_0x17d5ab,null))['catch'](handleError(_0x17d5ab,null));};exports[_0xa4a5('0x4d')]=function(_0x834211,_0x4dedc8){if(_0x834211[_0xa4a5('0x4e')]['id']){delete _0x834211['body']['id'];}return db[_0xa4a5('0x31')][_0xa4a5('0x4c')]({'where':{'id':_0x834211['params']['id']}})[_0xa4a5('0x17')](handleEntityNotFound(_0x4dedc8,null))['then'](saveUpdates(_0x834211[_0xa4a5('0x4e')],null))['then'](respondWithResult(_0x4dedc8,null))['catch'](handleError(_0x4dedc8,null));};exports[_0xa4a5('0x4f')]=function(_0x52b3bd,_0x16cf4f,_0x5ef343){if(_0x52b3bd['file']&&_0x52b3bd[_0xa4a5('0x50')][_0xa4a5('0x51')]){_0x52b3bd['body']['logo']=_0x52b3bd[_0xa4a5('0x50')]['filename'];}return db[_0xa4a5('0x31')]['find']({'where':{'id':_0x52b3bd[_0xa4a5('0x52')]['id']}})[_0xa4a5('0x17')](handleEntityNotFound(_0x16cf4f,null))[_0xa4a5('0x17')](saveUpdates(_0x52b3bd[_0xa4a5('0x4e')],null))['then'](respondWithResult(_0x16cf4f,null))[_0xa4a5('0x21')](handleError(_0x16cf4f,null));};exports[_0xa4a5('0x53')]=function(_0x206680,_0x19f9d7,_0x3b96bf){if(_0x206680[_0xa4a5('0x50')]&&_0x206680[_0xa4a5('0x50')]['filename']){_0x206680[_0xa4a5('0x4e')][_0xa4a5('0x54')]=_0x206680[_0xa4a5('0x50')][_0xa4a5('0x51')];}return db[_0xa4a5('0x31')]['find']({'where':{'id':_0x206680[_0xa4a5('0x52')]['id']}})[_0xa4a5('0x17')](handleEntityNotFound(_0x19f9d7,null))[_0xa4a5('0x17')](saveUpdates(_0x206680[_0xa4a5('0x4e')],null))[_0xa4a5('0x17')](respondWithResult(_0x19f9d7,null))[_0xa4a5('0x21')](handleError(_0x19f9d7,null));};var utilLicense=require(_0xa4a5('0x55'));exports['getLogo']=function(_0x1b9869,_0x41bc28,_0x5945a6){var _0x218c21='server/files/images/logos';var _0x1fb9db={'custom':![]};return utilLicense[_0xa4a5('0x56')]()[_0xa4a5('0x17')](function(_0x303315){if(_0x303315){_0x1fb9db=_0x303315;}return db['Setting'][_0xa4a5('0x4c')]({'where':{'id':_0x1b9869['params']['id']},'attributes':[_0xa4a5('0x57'),_0xa4a5('0x54'),'preferred',_0xa4a5('0x58'),_0xa4a5('0x59'),'defaultLoginLogo',_0xa4a5('0x5a'),_0xa4a5('0x5b')],'raw':!![]});})[_0xa4a5('0x17')](handleEntityNotFound(_0x41bc28,null))[_0xa4a5('0x17')](function(_0x56e8cb){if(_0x56e8cb){var _0x23fd6e=_0x56e8cb[_0xa4a5('0x57')]&&fs['existsSync'](path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x218c21,_['toLower'](_0x56e8cb[_0xa4a5('0x57')])))?path['join'](config[_0xa4a5('0x5d')],_0x218c21,_['toLower'](_0x56e8cb[_0xa4a5('0x57')])):path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x218c21,_[_0xa4a5('0x5e')](_0xa4a5('0x5f')));var _0x3273a3='default'+_[_0xa4a5('0x60')](_0xa4a5('0x57'));if(_0x56e8cb[_0x3273a3]||!_0x1fb9db[_0xa4a5('0x61')]){_0x23fd6e=path['join'](config['root'],_0x218c21,_[_0xa4a5('0x5e')](_0xa4a5('0x5f')));}if(!fs['existsSync'](_0x23fd6e)){throw new db['Sequelize']['ValidationError'](_[_0xa4a5('0x60')](_0xa4a5('0x57'))+_0xa4a5('0x62'));}return _0x41bc28[_0xa4a5('0x63')](_0x23fd6e);}})['catch'](handleError(_0x41bc28,null));};var utilLicense=require(_0xa4a5('0x55'));exports[_0xa4a5('0x64')]=function(_0x3525e0,_0x2eb2aa,_0x445398){var _0x2e0afb=_0xa4a5('0x65');var _0x5b4fd9={'custom':![]};return utilLicense[_0xa4a5('0x56')]()[_0xa4a5('0x17')](function(_0x8d99df){if(_0x8d99df){_0x5b4fd9=_0x8d99df;}return db[_0xa4a5('0x31')][_0xa4a5('0x4c')]({'where':{'id':_0x3525e0['params']['id']},'attributes':[_0xa4a5('0x57'),_0xa4a5('0x54'),_0xa4a5('0x66'),_0xa4a5('0x58'),_0xa4a5('0x59'),'defaultLoginLogo',_0xa4a5('0x5a'),_0xa4a5('0x5b')],'raw':!![]});})[_0xa4a5('0x17')](handleEntityNotFound(_0x2eb2aa,null))['then'](function(_0x24b092){if(_0x24b092){var _0x9a220f=_0x24b092[_0xa4a5('0x54')]&&fs['existsSync'](path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x2e0afb,_[_0xa4a5('0x5e')](_0x24b092[_0xa4a5('0x54')])))?path['join'](config[_0xa4a5('0x5d')],_0x2e0afb,_[_0xa4a5('0x5e')](_0x24b092[_0xa4a5('0x54')])):path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x2e0afb,_[_0xa4a5('0x5e')](_0xa4a5('0x67')));var _0x297006=_0xa4a5('0x68')+_['upperFirst']('loginLogo');if(_0x24b092[_0x297006]||!_0x5b4fd9['custom']){_0x9a220f=path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x2e0afb,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xa4a5('0x69')](_0x9a220f)){throw new db[(_0xa4a5('0x6a'))][(_0xa4a5('0x6b'))](_['upperFirst']('loginLogo')+_0xa4a5('0x62'));}return _0x2eb2aa[_0xa4a5('0x63')](_0x9a220f);}})[_0xa4a5('0x21')](handleError(_0x2eb2aa,null));};exports[_0xa4a5('0x6c')]=function(_0x212480,_0x8551c){return db['Setting'][_0xa4a5('0x4c')]({'where':{'id':_0x212480[_0xa4a5('0x52')]['id']},'attributes':['securePassword']})[_0xa4a5('0x17')](respondWithResult(_0x8551c,null))['catch'](handleError(_0x8551c,null));};exports[_0xa4a5('0x6d')]=function(_0x1f454e,_0x14a9cd,_0x213db7){if(_0x1f454e[_0xa4a5('0x50')]&&_0x1f454e[_0xa4a5('0x50')][_0xa4a5('0x51')]){_0x1f454e[_0xa4a5('0x4e')][_0xa4a5('0x66')]=_0x1f454e['file']['filename'];}return db[_0xa4a5('0x31')][_0xa4a5('0x4c')]({'where':{'id':_0x1f454e['params']['id']}})[_0xa4a5('0x17')](handleEntityNotFound(_0x14a9cd,null))[_0xa4a5('0x17')](saveUpdates(_0x1f454e['body'],null))[_0xa4a5('0x17')](respondWithResult(_0x14a9cd,null))[_0xa4a5('0x21')](handleError(_0x14a9cd,null));};var utilLicense=require(_0xa4a5('0x55'));exports[_0xa4a5('0x6e')]=function(_0x1ab453,_0x57899a,_0x3dd058){var _0xcc699a=_0xa4a5('0x65');var _0x3e3dbe={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x115ff3){if(_0x115ff3){_0x3e3dbe=_0x115ff3;}return db[_0xa4a5('0x31')][_0xa4a5('0x4c')]({'where':{'id':_0x1ab453['params']['id']},'attributes':[_0xa4a5('0x57'),_0xa4a5('0x54'),_0xa4a5('0x66'),_0xa4a5('0x58'),_0xa4a5('0x59'),_0xa4a5('0x6f'),_0xa4a5('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xa4a5('0x17')](handleEntityNotFound(_0x57899a,null))[_0xa4a5('0x17')](function(_0x228ba9){if(_0x228ba9){var _0x29a5f9=_0x228ba9[_0xa4a5('0x66')]&&fs[_0xa4a5('0x69')](path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0xcc699a,_[_0xa4a5('0x5e')](_0x228ba9[_0xa4a5('0x66')])))?path['join'](config['root'],_0xcc699a,_[_0xa4a5('0x5e')](_0x228ba9[_0xa4a5('0x66')])):path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0xcc699a,_[_0xa4a5('0x5e')](_0xa4a5('0x70')));var _0xeb1cb9='default'+_[_0xa4a5('0x60')]('preferred');if(_0x228ba9[_0xeb1cb9]||!_0x3e3dbe['custom']||!_0x3e3dbe[_0xa4a5('0x66')]){_0x29a5f9=path[_0xa4a5('0x5c')](config['root'],_0xcc699a,_['toLower'](_0xa4a5('0x70')));}if(!fs[_0xa4a5('0x69')](_0x29a5f9)){throw new db[(_0xa4a5('0x6a'))][(_0xa4a5('0x6b'))](_[_0xa4a5('0x60')]('preferred')+_0xa4a5('0x62'));}return _0x57899a[_0xa4a5('0x63')](_0x29a5f9);}})[_0xa4a5('0x21')](handleError(_0x57899a,null));};exports[_0xa4a5('0x71')]=function(_0x3ca0d1,_0x1c4619,_0xe3aa1b){if(_0x3ca0d1[_0xa4a5('0x50')]&&_0x3ca0d1[_0xa4a5('0x50')][_0xa4a5('0x51')]){_0x3ca0d1['body'][_0xa4a5('0x58')]=_0x3ca0d1['file'][_0xa4a5('0x51')];}return db[_0xa4a5('0x31')][_0xa4a5('0x4c')]({'where':{'id':_0x3ca0d1[_0xa4a5('0x52')]['id']}})[_0xa4a5('0x17')](handleEntityNotFound(_0x1c4619,null))['then'](saveUpdates(_0x3ca0d1['body'],null))[_0xa4a5('0x17')](respondWithResult(_0x1c4619,null))['catch'](handleError(_0x1c4619,null));};var utilLicense=require(_0xa4a5('0x55'));exports[_0xa4a5('0x72')]=function(_0x5b059c,_0x30387c,_0x21c7ce){var _0x3bb499='server/files/images/logos';var _0x19245c={'custom':![]};return utilLicense[_0xa4a5('0x56')]()[_0xa4a5('0x17')](function(_0x2f3c83){if(_0x2f3c83){_0x19245c=_0x2f3c83;}return db['Setting'][_0xa4a5('0x4c')]({'where':{'id':_0x5b059c[_0xa4a5('0x52')]['id']},'attributes':[_0xa4a5('0x57'),'loginLogo',_0xa4a5('0x66'),_0xa4a5('0x58'),'defaultLogo',_0xa4a5('0x6f'),'defaultPreferred',_0xa4a5('0x5b')],'raw':!![]});})[_0xa4a5('0x17')](handleEntityNotFound(_0x30387c,null))[_0xa4a5('0x17')](function(_0x8821f6){if(_0x8821f6){var _0x1e1bbd=_0x8821f6[_0xa4a5('0x58')]&&fs[_0xa4a5('0x69')](path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x3bb499,_[_0xa4a5('0x5e')](_0x8821f6[_0xa4a5('0x58')])))?path['join'](config[_0xa4a5('0x5d')],_0x3bb499,_['toLower'](_0x8821f6[_0xa4a5('0x58')])):path['join'](config['root'],_0x3bb499,_[_0xa4a5('0x5e')](_0xa4a5('0x73')));var _0x1ffa83=_0xa4a5('0x68')+_[_0xa4a5('0x60')]('favicon');if(_0x8821f6[_0x1ffa83]||!_0x19245c[_0xa4a5('0x61')]){_0x1e1bbd=path[_0xa4a5('0x5c')](config[_0xa4a5('0x5d')],_0x3bb499,_[_0xa4a5('0x5e')]('default_favicon.ico'));}if(!fs[_0xa4a5('0x69')](_0x1e1bbd)){throw new db[(_0xa4a5('0x6a'))]['ValidationError'](_['upperFirst'](_0xa4a5('0x58'))+'\x20not\x20found');}return _0x30387c[_0xa4a5('0x63')](_0x1e1bbd);}})[_0xa4a5('0x21')](handleError(_0x30387c,null));};exports[_0xa4a5('0x74')]=function(_0x5183e1,_0x3ea880){var _0x4bea40={'offset':moment()[_0xa4a5('0x75')]()};_0x4bea40[_0xa4a5('0x76')]=moment()[_0xa4a5('0x75')](_0x4bea40[_0xa4a5('0x28')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x3ea880[_0xa4a5('0x23')](0xc8)[_0xa4a5('0x77')](_0x4bea40);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d63891b..6941f8b 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(_0x1ce919,_0x1bbb96){var _0x34ec94=function(_0x3f7a6f){while(--_0x3f7a6f){_0x1ce919['push'](_0x1ce919['shift']());}};_0x34ec94(++_0x1bbb96);}(_0x008c,0x188));var _0xc008=function(_0x22e690,_0x5f570e){_0x22e690=_0x22e690-0x0;var _0x2b515f=_0x008c[_0x22e690];return _0x2b515f;};'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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4397c3,_0x58fff0){var _0x5e73f8=function(_0x45ef37){while(--_0x45ef37){_0x4397c3['push'](_0x4397c3['shift']());}};_0x5e73f8(++_0x58fff0);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a694e,_0x3e4264){_0x4a694e=_0x4a694e-0x0;var _0x23b0ab=_0xedd9[_0x4a694e];return _0x23b0ab;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 986df82..3337f67 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 _0xa7cf=['http','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowSetting','Setting','find','options','where','attributes','include','model','map','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x56ae16,_0x4ae602){var _0x5465c3=function(_0x491587){while(--_0x491587){_0x56ae16['push'](_0x56ae16['shift']());}};_0x5465c3(++_0x4ae602);}(_0xa7cf,0x1c6));var _0xfa7c=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xa7cf[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var moment=require(_0xfa7c('0x2'));var BPromise=require(_0xfa7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa7c('0x5'));var logger=require(_0xfa7c('0x6'))(_0xfa7c('0x7'));var config=require(_0xfa7c('0x8'));var jayson=require(_0xfa7c('0x9'));var client=jayson[_0xfa7c('0xa')][_0xfa7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf840f7,_0x1112d1,_0x52044a){return new BPromise(function(_0x2970ce,_0x350b0b){return client['request'](_0xf840f7,_0x52044a)['then'](function(_0x1a137f){logger['info'](_0xfa7c('0xc'),_0x1112d1,_0xfa7c('0xd'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x1112d1,_0xfa7c('0xd'),JSON[_0xfa7c('0xe')](_0x1a137f));if(_0x1a137f['error']){if(_0x1a137f[_0xfa7c('0xf')][_0xfa7c('0x10')]===0x1f4){logger[_0xfa7c('0xf')](_0xfa7c('0xc'),_0x1112d1,_0x1a137f[_0xfa7c('0xf')][_0xfa7c('0x11')]);return _0x350b0b(_0x1a137f[_0xfa7c('0xf')][_0xfa7c('0x11')]);}logger[_0xfa7c('0xf')]('Setting,\x20%s,\x20%s',_0x1112d1,_0x1a137f[_0xfa7c('0xf')][_0xfa7c('0x11')]);return _0x2970ce(_0x1a137f[_0xfa7c('0xf')]['message']);}else{logger[_0xfa7c('0x12')](_0xfa7c('0xc'),_0x1112d1,'request\x20sent');_0x2970ce(_0x1a137f[_0xfa7c('0x13')][_0xfa7c('0x11')]);}})[_0xfa7c('0x14')](function(_0x580969){logger[_0xfa7c('0xf')](_0xfa7c('0xc'),_0x1112d1,_0x580969);_0x350b0b(_0x580969);});});}exports[_0xfa7c('0x15')]=function(_0x1c9167){var _0x549e72=this;return new Promise(function(_0xe03e47,_0xce99e8){return db[_0xfa7c('0x16')][_0xfa7c('0x17')]({'raw':_0x1c9167[_0xfa7c('0x18')]?_0x1c9167['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c9167[_0xfa7c('0x18')]?_0x1c9167['options'][_0xfa7c('0x19')]||null:null,'attributes':_0x1c9167[_0xfa7c('0x18')]?_0x1c9167[_0xfa7c('0x18')][_0xfa7c('0x1a')]||null:null,'include':_0x1c9167[_0xfa7c('0x18')]?_0x1c9167[_0xfa7c('0x18')][_0xfa7c('0x1b')]?_['map'](_0x1c9167[_0xfa7c('0x18')][_0xfa7c('0x1b')],function(_0x2a9c94){return{'model':db[_0x2a9c94[_0xfa7c('0x1c')]],'as':_0x2a9c94['as'],'attributes':_0x2a9c94[_0xfa7c('0x1a')],'include':_0x2a9c94[_0xfa7c('0x1b')]?_[_0xfa7c('0x1d')](_0x2a9c94[_0xfa7c('0x1b')],function(_0xb8f6cc){return{'model':db[_0xb8f6cc[_0xfa7c('0x1c')]],'as':_0xb8f6cc['as'],'attributes':_0xb8f6cc[_0xfa7c('0x1a')],'include':_0xb8f6cc[_0xfa7c('0x1b')]?_[_0xfa7c('0x1d')](_0xb8f6cc['include'],function(_0x164ee3){return{'model':db[_0x164ee3['model']],'as':_0x164ee3['as'],'attributes':_0x164ee3[_0xfa7c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa7c('0x1e')](function(_0x151454){logger['info'](_0xfa7c('0x15'),_0x1c9167);logger['debug']('ShowSetting',_0x1c9167,JSON[_0xfa7c('0xe')](_0x151454));_0xe03e47(_0x151454);})['catch'](function(_0x48b796){logger[_0xfa7c('0xf')](_0xfa7c('0x15'),_0x48b796[_0xfa7c('0x11')],_0x1c9167);_0xce99e8(_0x549e72[_0xfa7c('0xf')](0x1f4,_0x48b796[_0xfa7c('0x11')]));});});}; \ No newline at end of file +var _0x064e=['http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0x064e,0x1d6));var _0xe064=function(_0x3ce2d4,_0x13a7cd){_0x3ce2d4=_0x3ce2d4-0x0;var _0x3de4b9=_0x064e[_0x3ce2d4];return _0x3de4b9;};'use strict';var _=require(_0xe064('0x0'));var util=require(_0xe064('0x1'));var moment=require(_0xe064('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe064('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe064('0x4'));var logger=require(_0xe064('0x5'))(_0xe064('0x6'));var config=require(_0xe064('0x7'));var jayson=require(_0xe064('0x8'));var client=jayson[_0xe064('0x9')][_0xe064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x344c1e,_0x4bd5d6,_0x362557){return new BPromise(function(_0x5d7e25,_0x5f2f22){return client[_0xe064('0xb')](_0x344c1e,_0x362557)[_0xe064('0xc')](function(_0x4254d8){logger[_0xe064('0xd')](_0xe064('0xe'),_0x4bd5d6,'request\x20sent');logger[_0xe064('0xf')](_0xe064('0x10'),_0x4bd5d6,_0xe064('0x11'),JSON[_0xe064('0x12')](_0x4254d8));if(_0x4254d8[_0xe064('0x13')]){if(_0x4254d8[_0xe064('0x13')][_0xe064('0x14')]===0x1f4){logger[_0xe064('0x13')](_0xe064('0xe'),_0x4bd5d6,_0x4254d8['error'][_0xe064('0x15')]);return _0x5f2f22(_0x4254d8[_0xe064('0x13')][_0xe064('0x15')]);}logger['error'](_0xe064('0xe'),_0x4bd5d6,_0x4254d8['error']['message']);return _0x5d7e25(_0x4254d8[_0xe064('0x13')][_0xe064('0x15')]);}else{logger['info'](_0xe064('0xe'),_0x4bd5d6,_0xe064('0x11'));_0x5d7e25(_0x4254d8[_0xe064('0x16')]['message']);}})[_0xe064('0x17')](function(_0x3bd087){logger[_0xe064('0x13')](_0xe064('0xe'),_0x4bd5d6,_0x3bd087);_0x5f2f22(_0x3bd087);});});}exports[_0xe064('0x18')]=function(_0x416d0c){var _0x2d84ef=this;return new Promise(function(_0x2ba09a,_0x1f37c2){return db[_0xe064('0x19')]['find']({'raw':_0x416d0c[_0xe064('0x1a')]?_0x416d0c[_0xe064('0x1a')][_0xe064('0x1b')]===undefined?!![]:![]:!![],'where':_0x416d0c[_0xe064('0x1a')]?_0x416d0c['options']['where']||null:null,'attributes':_0x416d0c['options']?_0x416d0c['options'][_0xe064('0x1c')]||null:null,'include':_0x416d0c['options']?_0x416d0c[_0xe064('0x1a')][_0xe064('0x1d')]?_[_0xe064('0x1e')](_0x416d0c[_0xe064('0x1a')][_0xe064('0x1d')],function(_0x41f984){return{'model':db[_0x41f984[_0xe064('0x1f')]],'as':_0x41f984['as'],'attributes':_0x41f984['attributes'],'include':_0x41f984[_0xe064('0x1d')]?_[_0xe064('0x1e')](_0x41f984[_0xe064('0x1d')],function(_0x39d9ad){return{'model':db[_0x39d9ad[_0xe064('0x1f')]],'as':_0x39d9ad['as'],'attributes':_0x39d9ad[_0xe064('0x1c')],'include':_0x39d9ad[_0xe064('0x1d')]?_[_0xe064('0x1e')](_0x39d9ad[_0xe064('0x1d')],function(_0xd55bdc){return{'model':db[_0xd55bdc[_0xe064('0x1f')]],'as':_0xd55bdc['as'],'attributes':_0xd55bdc['attributes']};}):[]};}):[]};}):[]:[]})[_0xe064('0xc')](function(_0x293fdf){logger[_0xe064('0xd')]('ShowSetting',_0x416d0c);logger['debug'](_0xe064('0x18'),_0x416d0c,JSON[_0xe064('0x12')](_0x293fdf));_0x2ba09a(_0x293fdf);})[_0xe064('0x17')](function(_0x4d2b6d){logger[_0xe064('0x13')]('ShowSetting',_0x4d2b6d[_0xe064('0x15')],_0x416d0c);_0x1f37c2(_0x2d84ef[_0xe064('0x13')](0x1f4,_0x4d2b6d[_0xe064('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d43af5e..c21d82f 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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7217,0x19e));var _0x7721=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7217[_0x6131cd];return _0x47e916;};'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['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x1395ef,_0x5eb589){var _0x42da3a=function(_0x3b0d5a){while(--_0x3b0d5a){_0x1395ef['push'](_0x1395ef['shift']());}};_0x42da3a(++_0x5eb589);}(_0xabce,0x103));var _0xeabc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xabce[_0x311c35];return _0x5cc50c;};'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('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index be8594d..4487903 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 _0xa38d=['ENUM','skebby','connectel','clicksend','clickatell','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','name','STRING','generate'];(function(_0x5df0d8,_0x47cb63){var _0x3c64fe=function(_0x5e19bb){while(--_0x5e19bb){_0x5df0d8['push'](_0x5df0d8['shift']());}};_0x3c64fe(++_0x47cb63);}(_0xa38d,0x13e));var _0xda38=function(_0x598d84,_0x19f182){_0x598d84=_0x598d84-0x0;var _0x18423e=_0xa38d[_0x598d84];return _0x18423e;};'use strict';var Sequelize=require(_0xda38('0x0'));var rs=require('randomstring');module[_0xda38('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xda38('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xda38('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xda38('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xda38('0x3')],'defaultValue':function(){return rs[_0xda38('0x4')]();}},'phone':{'type':Sequelize[_0xda38('0x3')]},'type':{'type':Sequelize[_0xda38('0x5')]('twilio',_0xda38('0x6'),_0xda38('0x7'),_0xda38('0x8'),'plivo',_0xda38('0x9'),'bandwidth','csc',_0xda38('0xa'),'intelepeer')},'accountSid':{'type':Sequelize[_0xda38('0x3')]},'authId':{'type':Sequelize[_0xda38('0x3')]},'authToken':{'type':Sequelize[_0xda38('0x3')]},'smsMethod':{'type':Sequelize[_0xda38('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xda38('0x3')]},'password':{'type':Sequelize[_0xda38('0x3')]},'apiKey':{'type':Sequelize[_0xda38('0x3')]},'applicationId':{'type':Sequelize[_0xda38('0x3')]},'accountId':{'type':Sequelize[_0xda38('0x3')]},'senderString':{'type':Sequelize[_0xda38('0x3')]},'deliveryReport':{'type':Sequelize[_0xda38('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xda38('0x3')]},'notificationTemplate':{'type':Sequelize[_0xda38('0xc')],'defaultValue':function(){return _0xda38('0xd');}},'notificationSound':{'type':Sequelize[_0xda38('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xda38('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xda38('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xda38('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xda38('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xda38('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xda38('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xda38('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xda38('0xe')],'comment':_0xda38('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xda38('0x10'),'set':function(_0x445ae7){if(!_0x445ae7)this[_0xda38('0x11')](_0xda38('0x12'),null);this[_0xda38('0x11')]('mandatoryDisposition',_0x445ae7);}}}; \ No newline at end of file +var _0x0189=['clickatell','bandwidth','csc','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','skebby','connectel','plivo'];(function(_0x34f456,_0x271849){var _0x589f55=function(_0x32e03d){while(--_0x32e03d){_0x34f456['push'](_0x34f456['shift']());}};_0x589f55(++_0x271849);}(_0x0189,0x141));var _0x9018=function(_0x2d7ebf,_0x27722e){_0x2d7ebf=_0x2d7ebf-0x0;var _0x72b7fb=_0x0189[_0x2d7ebf];return _0x72b7fb;};'use strict';var Sequelize=require(_0x9018('0x0'));var rs=require('randomstring');module[_0x9018('0x1')]={'name':{'type':Sequelize[_0x9018('0x2')],'unique':_0x9018('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9018('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x9018('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x9018('0x2')],'defaultValue':function(){return rs[_0x9018('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x9018('0x5'),_0x9018('0x6'),_0x9018('0x7'),'clicksend',_0x9018('0x8'),_0x9018('0x9'),_0x9018('0xa'),_0x9018('0xb'),'infobip',_0x9018('0xc'))},'accountSid':{'type':Sequelize[_0x9018('0x2')]},'authId':{'type':Sequelize[_0x9018('0x2')]},'authToken':{'type':Sequelize[_0x9018('0x2')]},'smsMethod':{'type':Sequelize[_0x9018('0xd')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9018('0x2')]},'password':{'type':Sequelize[_0x9018('0x2')]},'apiKey':{'type':Sequelize[_0x9018('0x2')]},'applicationId':{'type':Sequelize[_0x9018('0x2')]},'accountId':{'type':Sequelize[_0x9018('0x2')]},'senderString':{'type':Sequelize[_0x9018('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x9018('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9018('0xe')],'defaultValue':function(){return _0x9018('0xf');}},'notificationSound':{'type':Sequelize[_0x9018('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9018('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9018('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9018('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9018('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9018('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9018('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9018('0x10')],'defaultValue':![],'comment':_0x9018('0x12'),'set':function(_0x1f71de){if(!_0x1f71de)this[_0x9018('0x13')](_0x9018('0x14'),null);this['setDataValue'](_0x9018('0x15'),_0x1f71de);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index c887d6f..2725c4c 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 _0x9b14=['User','unshift','agent','startRouting','Start','Content-Type','\x0a','sequelize','transaction','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','DESC','List','out','Messages','dataValues','push','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','message-delivered','received\x20delivery\x20report\x20from','state','addAgents','omit','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','http','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','destroy','get','SmsAccounts','stack','name','send','Pause','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Disposition','getDispositions','findOne','nolimit','pick','SmsAccountId','removeDispositions','addAnswer','CannedAnswer','map','removeAnswers','ids','notify','sms','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','Body','MessageSid','skebby','text','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','SmsInteraction','interaction','autoclose','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId'];(function(_0x280f00,_0x332f60){var _0x4619ae=function(_0x14eaf9){while(--_0x14eaf9){_0x280f00['push'](_0x280f00['shift']());}};_0x4619ae(++_0x332f60);}(_0x9b14,0x1e8));var _0x49b1=function(_0x49e533,_0x5daa8a){_0x49e533=_0x49e533-0x0;var _0x17769d=_0x9b14[_0x49e533];return _0x17769d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49b1('0x0'));var jsonpatch=require(_0x49b1('0x1'));var rp=require('request-promise');var moment=require(_0x49b1('0x2'));var BPromise=require(_0x49b1('0x3'));var Mustache=require(_0x49b1('0x4'));var util=require(_0x49b1('0x5'));var path=require(_0x49b1('0x6'));var sox=require(_0x49b1('0x7'));var csv=require(_0x49b1('0x8'));var ejs=require(_0x49b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49b1('0xa'));var crypto=require(_0x49b1('0xb'));var jsforce=require(_0x49b1('0xc'));var deskjs=require(_0x49b1('0xd'));var toCsv=require(_0x49b1('0x8'));var querystring=require(_0x49b1('0xe'));var Papa=require(_0x49b1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49b1('0x10'));var logger=require('../../config/logger')(_0x49b1('0x11'));var utils=require(_0x49b1('0x12'));var config=require(_0x49b1('0x13'));var licenseUtil=require(_0x49b1('0x14'));var db=require('../../mysqldb')['db'];config[_0x49b1('0x15')]=_[_0x49b1('0x16')](config[_0x49b1('0x15')],{'host':_0x49b1('0x17'),'port':0x18eb});var socket=require(_0x49b1('0x18'))(new Redis(config[_0x49b1('0x15')]));require(_0x49b1('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x49b1('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x188e6d,_0x284fed,_0x54f703,_0x1b00b8){return new BPromise(function(_0x2042fe,_0x486d73){var _0x52e86a=_0x1b00b8||client;return _0x52e86a['request'](_0x188e6d,_0x54f703)[_0x49b1('0x1b')](function(_0x1e99e0){logger[_0x49b1('0x1c')](_0x49b1('0x1d'),_0x284fed,'request\x20sent');logger[_0x49b1('0x1e')](_0x49b1('0x1f'),_0x284fed,_0x49b1('0x20'),JSON['stringify'](_0x1e99e0));if(_0x1e99e0[_0x49b1('0x21')]){if(_0x1e99e0[_0x49b1('0x21')][_0x49b1('0x22')]===0x1f4){logger[_0x49b1('0x21')](_0x49b1('0x1d'),_0x284fed,_0x1e99e0[_0x49b1('0x21')][_0x49b1('0x23')]);return _0x486d73(_0x1e99e0['error'][_0x49b1('0x23')]);}logger[_0x49b1('0x21')](_0x49b1('0x1d'),_0x284fed,_0x1e99e0['error'][_0x49b1('0x23')]);return _0x2042fe(_0x1e99e0[_0x49b1('0x21')][_0x49b1('0x23')]);}else{logger[_0x49b1('0x1c')]('SmsAccount,\x20%s,\x20%s',_0x284fed,_0x49b1('0x20'));_0x2042fe(_0x1e99e0['result'][_0x49b1('0x23')]);}})['catch'](function(_0x4228de){logger['error']('SmsAccount,\x20%s,\x20%s',_0x284fed,_0x4228de);_0x486d73(_0x4228de);});});}function respondWithStatusCode(_0x2caaae,_0xbfd7d1){_0xbfd7d1=_0xbfd7d1||0xcc;return function(_0x2b5928){if(_0x2b5928){return _0x2caaae[_0x49b1('0x24')](_0xbfd7d1);}return _0x2caaae[_0x49b1('0x25')](_0xbfd7d1)[_0x49b1('0x26')]();};}function respondWithResult(_0x334c7b,_0x17d6af){_0x17d6af=_0x17d6af||0xc8;return function(_0x368019){if(_0x368019){return _0x334c7b[_0x49b1('0x25')](_0x17d6af)[_0x49b1('0x27')](_0x368019);}};}function respondWithFilteredResult(_0x745b83,_0x4b2559){return function(_0x3a3ee5){if(_0x3a3ee5){var _0x3dd24e=typeof _0x4b2559['offset']===_0x49b1('0x28')&&typeof _0x4b2559['limit']===_0x49b1('0x28');var _0x188c7e=_0x3a3ee5[_0x49b1('0x29')];var _0x21d254=_0x3dd24e?0x0:_0x4b2559[_0x49b1('0x2a')];var _0x3bd3ba=_0x3dd24e?_0x3a3ee5[_0x49b1('0x29')]:_0x4b2559[_0x49b1('0x2a')]+_0x4b2559[_0x49b1('0x2b')];var _0x11da2a;if(_0x3bd3ba>=_0x188c7e){_0x3bd3ba=_0x188c7e;_0x11da2a=0xc8;}else{_0x11da2a=0xce;}_0x745b83[_0x49b1('0x25')](_0x11da2a);return _0x745b83[_0x49b1('0x2c')](_0x49b1('0x2d'),_0x21d254+'-'+_0x3bd3ba+'/'+_0x188c7e)[_0x49b1('0x27')](_0x3a3ee5);}return null;};}function patchUpdates(_0x36ede3){return function(_0x19106e){try{jsonpatch['apply'](_0x19106e,_0x36ede3,!![]);}catch(_0x504983){return BPromise['reject'](_0x504983);}return _0x19106e[_0x49b1('0x2e')]();};}function saveUpdates(_0x3e13db,_0x27945b){return function(_0x3faeec){if(_0x3faeec){return _0x3faeec[_0x49b1('0x2f')](_0x3e13db)[_0x49b1('0x1b')](function(_0x47d795){return _0x47d795;});}return null;};}function removeEntity(_0x5efc2b,_0x2202c2){return function(_0xbd521){if(_0xbd521){return _0xbd521[_0x49b1('0x30')]()[_0x49b1('0x1b')](function(){var _0x4dd032=_0xbd521[_0x49b1('0x31')]({'plain':!![]});var _0x178979=_0x49b1('0x32');return db['UserProfileResource'][_0x49b1('0x30')]({'where':{'type':_0x178979,'resourceId':_0x4dd032['id']}})[_0x49b1('0x1b')](function(){return _0xbd521;});})['then'](function(){_0x5efc2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bcd83,_0x261397){return function(_0xa63e46){if(!_0xa63e46){_0x5bcd83[_0x49b1('0x24')](0x194);}return _0xa63e46;};}function handleError(_0x5b8223,_0x3a6016){_0x3a6016=_0x3a6016||0x1f4;return function(_0x23ddc){logger['error'](_0x23ddc[_0x49b1('0x33')]);if(_0x23ddc['name']){delete _0x23ddc[_0x49b1('0x34')];}_0x5b8223[_0x49b1('0x25')](_0x3a6016)[_0x49b1('0x35')](_0x23ddc);};}exports['index']=function(_0x17a756,_0x203810){var _0x73f153={'include':[{'model':db[_0x49b1('0x36')],'as':'mandatoryDispositionPause'}]},_0x140861={},_0x2dec94={'count':0x0,'rows':[]};var _0x51b41d=_['map'](db[_0x49b1('0x37')][_0x49b1('0x38')],function(_0x53461d){return{'name':_0x53461d[_0x49b1('0x39')],'type':_0x53461d[_0x49b1('0x3a')][_0x49b1('0x3b')]};});_0x140861[_0x49b1('0x3c')]=_['map'](_0x51b41d,_0x49b1('0x34'));_0x140861[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x17a756[_0x49b1('0x3d')]);_0x140861[_0x49b1('0x3f')]=_['intersection'](_0x140861[_0x49b1('0x3c')],_0x140861[_0x49b1('0x3d')]);_0x73f153[_0x49b1('0x40')]=_['intersection'](_0x140861[_0x49b1('0x3c')],qs[_0x49b1('0x41')](_0x17a756['query'][_0x49b1('0x41')]));_0x73f153[_0x49b1('0x40')]=_0x73f153['attributes'][_0x49b1('0x42')]?_0x73f153[_0x49b1('0x40')]:_0x140861['model'];if(!_0x17a756[_0x49b1('0x3d')][_0x49b1('0x43')]('nolimit')){_0x73f153[_0x49b1('0x2b')]=qs['limit'](_0x17a756[_0x49b1('0x3d')][_0x49b1('0x2b')]);_0x73f153[_0x49b1('0x2a')]=qs[_0x49b1('0x2a')](_0x17a756[_0x49b1('0x3d')]['offset']);}_0x73f153[_0x49b1('0x44')]=qs['sort'](_0x17a756[_0x49b1('0x3d')][_0x49b1('0x45')]);_0x73f153[_0x49b1('0x46')]=qs[_0x49b1('0x3f')](_['pick'](_0x17a756[_0x49b1('0x3d')],_0x140861['filters']),_0x51b41d);if(_0x17a756[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x73f153[_0x49b1('0x46')]=_[_0x49b1('0x48')](_0x73f153['where'],{'$or':_['map'](_0x51b41d,function(_0x25acd9){if(_0x25acd9[_0x49b1('0x3a')]!==_0x49b1('0x49')){var _0xc207a2={};_0xc207a2[_0x25acd9[_0x49b1('0x34')]]={'$like':'%'+_0x17a756[_0x49b1('0x3d')]['filter']+'%'};return _0xc207a2;}})});}_0x73f153=_[_0x49b1('0x48')]({},_0x73f153,_0x17a756[_0x49b1('0x4a')]);var _0x2d8f1c={'where':_0x73f153['where']};return db[_0x49b1('0x37')]['count'](_0x2d8f1c)['then'](function(_0x1e5ec0){_0x2dec94[_0x49b1('0x29')]=_0x1e5ec0;if(_0x17a756[_0x49b1('0x3d')][_0x49b1('0x4b')]){_0x73f153[_0x49b1('0x4c')]=[{'all':!![]}];}return db['SmsAccount'][_0x49b1('0x4d')](_0x73f153);})[_0x49b1('0x1b')](function(_0x279f78){_0x2dec94[_0x49b1('0x4e')]=_0x279f78;return _0x2dec94;})[_0x49b1('0x1b')](respondWithFilteredResult(_0x203810,_0x73f153))[_0x49b1('0x4f')](handleError(_0x203810,null));};exports[_0x49b1('0x50')]=function(_0x1e3418,_0x541d90){var _0x18dd83={'raw':![],'where':{'id':_0x1e3418[_0x49b1('0x51')]['id']},'include':[{'model':db[_0x49b1('0x36')],'as':_0x49b1('0x52')}]},_0x55daea={};_0x55daea[_0x49b1('0x3c')]=_[_0x49b1('0x3e')](db[_0x49b1('0x37')][_0x49b1('0x38')]);_0x55daea[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x1e3418['query']);_0x55daea[_0x49b1('0x3f')]=_[_0x49b1('0x53')](_0x55daea[_0x49b1('0x3c')],_0x55daea['query']);_0x18dd83[_0x49b1('0x40')]=_[_0x49b1('0x53')](_0x55daea[_0x49b1('0x3c')],qs[_0x49b1('0x41')](_0x1e3418['query'][_0x49b1('0x41')]));_0x18dd83[_0x49b1('0x40')]=_0x18dd83[_0x49b1('0x40')]['length']?_0x18dd83[_0x49b1('0x40')]:_0x55daea[_0x49b1('0x3c')];if(_0x1e3418[_0x49b1('0x3d')][_0x49b1('0x4b')]){_0x18dd83[_0x49b1('0x4c')]=[{'all':!![]}];}_0x18dd83=_[_0x49b1('0x48')]({},_0x18dd83,_0x1e3418[_0x49b1('0x4a')]);return db['SmsAccount']['find'](_0x18dd83)[_0x49b1('0x1b')](handleEntityNotFound(_0x541d90,null))[_0x49b1('0x1b')](respondWithResult(_0x541d90,null))[_0x49b1('0x4f')](handleError(_0x541d90,null));};exports[_0x49b1('0x54')]=function(_0x1bf13b,_0x317c43){return db[_0x49b1('0x37')]['create'](_0x1bf13b[_0x49b1('0x55')],{})[_0x49b1('0x1b')](function(_0x4c8cb2){var _0x357a9f=_0x1bf13b['user']['get']({'plain':!![]});if(!_0x357a9f)throw new Error(_0x49b1('0x56'));if(_0x357a9f[_0x49b1('0x57')]===_0x49b1('0x58')){var _0x1c0f16=_0x4c8cb2[_0x49b1('0x31')]({'plain':!![]});var _0x168b8b=_0x49b1('0x32');return db[_0x49b1('0x59')][_0x49b1('0x5a')]({'where':{'name':_0x168b8b,'userProfileId':_0x357a9f[_0x49b1('0x5b')]},'raw':!![]})['then'](function(_0x5a4346){if(_0x5a4346&&_0x5a4346[_0x49b1('0x5c')]===0x0){return db[_0x49b1('0x5d')]['create']({'name':_0x1c0f16[_0x49b1('0x34')],'resourceId':_0x1c0f16['id'],'type':_0x5a4346[_0x49b1('0x34')],'sectionId':_0x5a4346['id']},{})[_0x49b1('0x1b')](function(){return _0x4c8cb2;});}else{return _0x4c8cb2;}})[_0x49b1('0x4f')](function(_0x5db606){logger[_0x49b1('0x21')](_0x49b1('0x5e'),_0x5db606);throw _0x5db606;});}return _0x4c8cb2;})[_0x49b1('0x1b')](respondWithResult(_0x317c43,0xc9))[_0x49b1('0x4f')](handleError(_0x317c43,null));};exports[_0x49b1('0x2f')]=function(_0x1d97e7,_0x45ff8d){if(_0x1d97e7[_0x49b1('0x55')]['id']){delete _0x1d97e7[_0x49b1('0x55')]['id'];}return db[_0x49b1('0x37')][_0x49b1('0x5a')]({'where':{'id':_0x1d97e7[_0x49b1('0x51')]['id']},'include':[{'model':db[_0x49b1('0x36')],'as':'mandatoryDispositionPause'}]})[_0x49b1('0x1b')](handleEntityNotFound(_0x45ff8d,null))['then'](saveUpdates(_0x1d97e7[_0x49b1('0x55')],null))[_0x49b1('0x1b')](respondWithResult(_0x45ff8d,null))[_0x49b1('0x4f')](handleError(_0x45ff8d,null));};exports[_0x49b1('0x30')]=function(_0x22ba7f,_0x41e9f7){return db['SmsAccount']['find']({'where':{'id':_0x22ba7f[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x41e9f7,null))[_0x49b1('0x1b')](removeEntity(_0x41e9f7,null))[_0x49b1('0x4f')](handleError(_0x41e9f7,null));};exports['describe']=function(_0x3e9f77,_0x2b81a0){return db['SmsAccount']['describe']()[_0x49b1('0x1b')](respondWithResult(_0x2b81a0,null))[_0x49b1('0x4f')](handleError(_0x2b81a0,null));};exports['addDisposition']=function(_0x6e9249,_0x10ca0e,_0x4cf354){if(_0x6e9249['body']['id']){delete _0x6e9249['body']['id'];}return db[_0x49b1('0x37')]['find']({'where':{'id':_0x6e9249[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x10ca0e,null))[_0x49b1('0x1b')](function(_0x4f7c11){if(_0x4f7c11){_0x6e9249['body']['SmsAccountId']=_0x4f7c11['id'];return db[_0x49b1('0x5f')][_0x49b1('0x54')](_0x6e9249[_0x49b1('0x55')]);}})[_0x49b1('0x1b')](respondWithResult(_0x10ca0e,null))[_0x49b1('0x4f')](handleError(_0x10ca0e,null));};exports[_0x49b1('0x60')]=function(_0x5ed96c,_0x5c90a8,_0x12ea15){var _0x5b8fb8={'raw':![],'where':{}};var _0x38bde6={};var _0x51ceb4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x49b1('0x61')]({'where':{'id':_0x5ed96c[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x5c90a8,null))[_0x49b1('0x1b')](function(_0x58c407){if(_0x58c407){_0x38bde6[_0x49b1('0x3c')]=_[_0x49b1('0x3e')](db[_0x49b1('0x5f')][_0x49b1('0x38')]);_0x38bde6[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x5ed96c[_0x49b1('0x3d')]);_0x38bde6[_0x49b1('0x3f')]=_['intersection'](_0x38bde6[_0x49b1('0x3c')],_0x38bde6[_0x49b1('0x3d')]);_0x5b8fb8[_0x49b1('0x40')]=_[_0x49b1('0x53')](_0x38bde6[_0x49b1('0x3c')],qs['fields'](_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x41')]));_0x5b8fb8[_0x49b1('0x40')]=_0x5b8fb8[_0x49b1('0x40')]['length']?_0x5b8fb8[_0x49b1('0x40')]:_0x38bde6[_0x49b1('0x3c')];if(!_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x43')](_0x49b1('0x62'))){_0x5b8fb8[_0x49b1('0x2b')]=qs['limit'](_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x2b')]);_0x5b8fb8['offset']=qs[_0x49b1('0x2a')](_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x2a')]);}_0x5b8fb8[_0x49b1('0x44')]=qs['sort'](_0x5ed96c[_0x49b1('0x3d')]['sort']);_0x5b8fb8[_0x49b1('0x46')]=qs[_0x49b1('0x3f')](_[_0x49b1('0x63')](_0x5ed96c['query'],_0x38bde6[_0x49b1('0x3f')]));_0x5b8fb8[_0x49b1('0x46')][_0x49b1('0x64')]=_0x58c407['id'];if(_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x5b8fb8[_0x49b1('0x46')]=_[_0x49b1('0x48')](_0x5b8fb8[_0x49b1('0x46')],{'$or':_['map'](_0x5b8fb8[_0x49b1('0x40')],function(_0x1cc37d){var _0x420ab1={};_0x420ab1[_0x1cc37d]={'$like':'%'+_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x47')]+'%'};return _0x420ab1;})});}_0x5b8fb8=_[_0x49b1('0x48')]({},_0x5b8fb8,_0x5ed96c['options']);return db[_0x49b1('0x5f')][_0x49b1('0x29')]({'where':_0x5b8fb8[_0x49b1('0x46')]})[_0x49b1('0x1b')](function(_0x25aad1){_0x51ceb4[_0x49b1('0x29')]=_0x25aad1;if(_0x5ed96c[_0x49b1('0x3d')][_0x49b1('0x4b')]){_0x5b8fb8[_0x49b1('0x4c')]=[{'all':!![]}];}return db[_0x49b1('0x5f')][_0x49b1('0x4d')](_0x5b8fb8);})[_0x49b1('0x1b')](function(_0x284450){_0x51ceb4[_0x49b1('0x4e')]=_0x284450;return _0x51ceb4;});}})[_0x49b1('0x1b')](respondWithFilteredResult(_0x5c90a8,_0x5b8fb8))[_0x49b1('0x4f')](handleError(_0x5c90a8,null));};exports[_0x49b1('0x65')]=function(_0x51c16e,_0x10eb14,_0x1bbdd9){return db['SmsAccount']['find']({'where':{'id':_0x51c16e['params']['id']}})['then'](handleEntityNotFound(_0x10eb14,null))[_0x49b1('0x1b')](function(_0x144f97){if(_0x144f97){return _0x144f97[_0x49b1('0x65')](_0x51c16e[_0x49b1('0x3d')]['ids']);}})[_0x49b1('0x1b')](respondWithStatusCode(_0x10eb14,null))['catch'](handleError(_0x10eb14,null));};exports[_0x49b1('0x66')]=function(_0x56ed44,_0x1987a7,_0x1df0f1){if(_0x56ed44[_0x49b1('0x55')]['id']){delete _0x56ed44[_0x49b1('0x55')]['id'];}return db[_0x49b1('0x37')][_0x49b1('0x5a')]({'where':{'id':_0x56ed44[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x1987a7,null))['then'](function(_0x403dd7){if(_0x403dd7){_0x56ed44[_0x49b1('0x55')][_0x49b1('0x64')]=_0x403dd7['id'];return db[_0x49b1('0x67')][_0x49b1('0x54')](_0x56ed44['body']);}})['then'](respondWithResult(_0x1987a7,null))[_0x49b1('0x4f')](handleError(_0x1987a7,null));};exports['getAnswers']=function(_0x49ed87,_0x129c8d,_0x1cb4a9){var _0x280d44={'raw':![],'where':{}};var _0x35dbf8={};var _0x4e599c={'count':0x0,'rows':[]};return db[_0x49b1('0x37')]['findOne']({'where':{'id':_0x49ed87['params']['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x129c8d,null))['then'](function(_0x1cfd0b){if(_0x1cfd0b){_0x35dbf8['model']=_[_0x49b1('0x3e')](db[_0x49b1('0x67')][_0x49b1('0x38')]);_0x35dbf8['query']=_[_0x49b1('0x3e')](_0x49ed87[_0x49b1('0x3d')]);_0x35dbf8[_0x49b1('0x3f')]=_[_0x49b1('0x53')](_0x35dbf8[_0x49b1('0x3c')],_0x35dbf8[_0x49b1('0x3d')]);_0x280d44[_0x49b1('0x40')]=_[_0x49b1('0x53')](_0x35dbf8[_0x49b1('0x3c')],qs[_0x49b1('0x41')](_0x49ed87['query']['fields']));_0x280d44['attributes']=_0x280d44[_0x49b1('0x40')]['length']?_0x280d44[_0x49b1('0x40')]:_0x35dbf8[_0x49b1('0x3c')];if(!_0x49ed87[_0x49b1('0x3d')]['hasOwnProperty'](_0x49b1('0x62'))){_0x280d44[_0x49b1('0x2b')]=qs[_0x49b1('0x2b')](_0x49ed87[_0x49b1('0x3d')]['limit']);_0x280d44[_0x49b1('0x2a')]=qs['offset'](_0x49ed87[_0x49b1('0x3d')][_0x49b1('0x2a')]);}_0x280d44['order']=qs[_0x49b1('0x45')](_0x49ed87[_0x49b1('0x3d')][_0x49b1('0x45')]);_0x280d44[_0x49b1('0x46')]=qs['filters'](_[_0x49b1('0x63')](_0x49ed87[_0x49b1('0x3d')],_0x35dbf8[_0x49b1('0x3f')]));_0x280d44[_0x49b1('0x46')][_0x49b1('0x64')]=_0x1cfd0b['id'];if(_0x49ed87[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x280d44[_0x49b1('0x46')]=_['merge'](_0x280d44[_0x49b1('0x46')],{'$or':_[_0x49b1('0x68')](_0x280d44[_0x49b1('0x40')],function(_0x2fba39){var _0x3fecf3={};_0x3fecf3[_0x2fba39]={'$like':'%'+_0x49ed87[_0x49b1('0x3d')][_0x49b1('0x47')]+'%'};return _0x3fecf3;})});}_0x280d44=_[_0x49b1('0x48')]({},_0x280d44,_0x49ed87[_0x49b1('0x4a')]);return db['CannedAnswer'][_0x49b1('0x29')]({'where':_0x280d44['where']})['then'](function(_0x2da18f){_0x4e599c[_0x49b1('0x29')]=_0x2da18f;if(_0x49ed87[_0x49b1('0x3d')][_0x49b1('0x4b')]){_0x280d44['include']=[{'all':!![]}];}return db[_0x49b1('0x67')][_0x49b1('0x4d')](_0x280d44);})[_0x49b1('0x1b')](function(_0x3995fa){_0x4e599c[_0x49b1('0x4e')]=_0x3995fa;return _0x4e599c;});}})[_0x49b1('0x1b')](respondWithFilteredResult(_0x129c8d,_0x280d44))[_0x49b1('0x4f')](handleError(_0x129c8d,null));};exports[_0x49b1('0x69')]=function(_0x46536d,_0x37a6d3,_0x5e0e9b){return db[_0x49b1('0x37')][_0x49b1('0x5a')]({'where':{'id':_0x46536d['params']['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x37a6d3,null))[_0x49b1('0x1b')](function(_0x467481){if(_0x467481){return _0x467481[_0x49b1('0x69')](_0x46536d[_0x49b1('0x3d')][_0x49b1('0x6a')]);}})[_0x49b1('0x1b')](respondWithStatusCode(_0x37a6d3,null))[_0x49b1('0x4f')](handleError(_0x37a6d3,null));};exports[_0x49b1('0x6b')]=function(_0x2d14b8,_0x190ad8,_0x2a9bb4){var _0x2dba0d={'channel':_0x49b1('0x6c')};var _0x3bb146=[];var _0x4888a9=[];var _0x3b1120={};return db['SmsAccount'][_0x49b1('0x5a')]({'where':{'id':_0x2d14b8[_0x49b1('0x51')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x49b1('0x6d')}]})[_0x49b1('0x1b')](handleEntityNotFound(_0x190ad8,null))[_0x49b1('0x1b')](function(_0x1d7414){_0x2dba0d['account']=_0x1d7414;_0x2dba0d[_0x49b1('0x6e')]=_[_0x49b1('0x6f')](_0x1d7414['Applications'],[_0x49b1('0x70')],[_0x49b1('0x71')]);if(_0x2dba0d[_0x49b1('0x72')]['Applications']){delete _0x2dba0d['account'][_0x49b1('0x6d')];}return db[_0x49b1('0x73')]['describe']();})[_0x49b1('0x1b')](function(_0x3743fb){if(!_0x3743fb){throw new db[(_0x49b1('0x74'))][(_0x49b1('0x75'))](_0x49b1('0x76'));}_0x3bb146=_[_0x49b1('0x77')](_[_0x49b1('0x3e')](_0x3743fb),['createdAt',_0x49b1('0x78')]);_0x4888a9=_[_0x49b1('0x77')](_[_0x49b1('0x3e')](_0x3743fb),[_0x49b1('0x79'),_0x49b1('0x78'),'CompanyId',_0x49b1('0x7a')]);_0x2dba0d['body']={'mapKey':_0x49b1('0x7b')};if(_0x2dba0d[_0x49b1('0x72')][_0x49b1('0x3a')]){switch(_0x2dba0d['account'][_0x49b1('0x3a')]){case _0x49b1('0x7c'):_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')]=_0x2d14b8[_0x49b1('0x55')]['From'];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x7e')];_0x2dba0d['body']['messageId']=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x7f')];break;case _0x49b1('0x80'):_0x2dba0d['body'][_0x49b1('0x7d')]='+'+_0x2d14b8[_0x49b1('0x55')]['sender'];_0x2dba0d[_0x49b1('0x55')]['body']=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x81')];break;case'connectel':_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x7d')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')]['message'];break;case _0x49b1('0x82'):_0x2dba0d['body'][_0x49b1('0x7d')]=_0x2d14b8['body'][_0x49b1('0x7d')];_0x2dba0d['body'][_0x49b1('0x55')]=_0x2d14b8['body'][_0x49b1('0x55')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x83')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x84')];break;case _0x49b1('0x85'):_0x2dba0d['body'][_0x49b1('0x7d')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x86')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x87')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x83')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x88')];break;case _0x49b1('0x89'):_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')]='+'+_0x2d14b8['body'][_0x49b1('0x8a')][0x0][_0x49b1('0x7d')];_0x2dba0d['body'][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x8a')][0x0][_0x49b1('0x81')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x83')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x8a')][0x0]['messageId'];break;case _0x49b1('0x8b'):_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x8c')];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x8d')]['message'];break;case _0x49b1('0x8e'):_0x2dba0d[_0x49b1('0x55')]['from']=_0x2d14b8[_0x49b1('0x55')]['fromNumber'];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x81')];_0x2dba0d['body']['messageId']=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x8f')];break;case _0x49b1('0x90'):_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x83')]=_0x2d14b8[_0x49b1('0x55')][0x0][_0x49b1('0x23')]['id'];_0x2dba0d['body'][_0x49b1('0x7d')]=_0x2d14b8['body'][0x0][_0x49b1('0x23')][_0x49b1('0x7d')];_0x2dba0d['body']['body']=_0x2d14b8[_0x49b1('0x55')][0x0]['message']['text'];break;case'intelepeer':_0x2dba0d['body']['from']=_0x2d14b8[_0x49b1('0x55')][_0x49b1('0x7d')];_0x2dba0d['body'][_0x49b1('0x55')]=_0x2d14b8[_0x49b1('0x55')]['message'];_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x83')]=_0x2d14b8[_0x49b1('0x55')]['refid'];break;}}if(_0x2dba0d['body']['id']){delete _0x2dba0d[_0x49b1('0x55')]['id'];}if(_[_0x49b1('0x91')](_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')])){throw new db[(_0x49b1('0x74'))][(_0x49b1('0x75'))](_0x49b1('0x92'));}if(_[_0x49b1('0x91')](_0x2dba0d['body']['body'])||_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x55')]===''){throw new db['Sequelize'][(_0x49b1('0x75'))](_0x49b1('0x93'));}if(_['isNil'](_0x2dba0d['body'][_0x49b1('0x94')])){throw new db[(_0x49b1('0x74'))][(_0x49b1('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4888a9);}if(!_[_0x49b1('0x95')](_0x4888a9,_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x94')])){throw new db[(_0x49b1('0x74'))]['ValidationError'](_0x49b1('0x96')+_0x4888a9);}_0x3b1120[_0x2dba0d[_0x49b1('0x55')]['mapKey']]=_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')];return db[_0x49b1('0x97')]['find']({'where':{'id':_0x2dba0d[_0x49b1('0x72')]['ListId']},'include':[{'model':db[_0x49b1('0x73')],'as':_0x49b1('0x98'),'where':_0x3b1120,'limit':0x1,'order':[[_0x49b1('0x78'),'DESC']]}]});})['then'](handleEntityNotFound(_0x190ad8,null))[_0x49b1('0x1b')](function(_0x48430e){if(_0x48430e){_0x2dba0d[_0x49b1('0x99')]=_['omit'](_0x48430e,[_0x49b1('0x98')]);if(_0x48430e[_0x49b1('0x98')][_0x49b1('0x42')]){return _0x48430e['Contacts'][0x0];}var _0x4547cb=_[_0x49b1('0x16')](_0x2dba0d[_0x49b1('0x55')],{'firstName':_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')],'ListId':_0x48430e['id']});_0x4547cb[_0x2dba0d['body'][_0x49b1('0x94')]]=_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')];return db['CmContact'][_0x49b1('0x54')](_0x4547cb,{'fields':_0x3bb146,'raw':!![]});}})[_0x49b1('0x1b')](handleEntityNotFound(_0x190ad8,null))['then'](function(_0xf982ea){if(_0xf982ea){_0x2dba0d[_0x49b1('0x9a')]=_0xf982ea;var _0x1f27db={'ContactId':_0xf982ea['id'],'phone':_0x2dba0d[_0x49b1('0x55')][_0x49b1('0x7d')],'SmsAccountId':_0x2d14b8[_0x49b1('0x51')]['id']};var _0x128e9e={'ContactId':_0xf982ea['id'],'SmsAccountId':_0x2d14b8[_0x49b1('0x51')]['id'],'closed':![]};return db['SmsInteraction'][_0x49b1('0x5a')]({'where':_0x128e9e})[_0x49b1('0x1b')](function(_0xce0b71){if(_0xce0b71){return[_0xce0b71,![]];}return db[_0x49b1('0x9b')][_0x49b1('0x54')](_0x1f27db)[_0x49b1('0x1b')](function(_0x6e3a97){return[_0x6e3a97,!![]];});});}})['spread'](function(_0x5ac718,_0x141b2e){_0x2dba0d[_0x49b1('0x9c')]=_0x5ac718['get']({'plain':!![]});_0x2dba0d[_0x49b1('0x9c')]['created']=![];if(_0x141b2e){if(_0x2dba0d[_0x49b1('0x72')][_0x49b1('0x9d')]){_0x2dba0d['applications']['push']({'id':0x0,'priority':_0x2dba0d[_0x49b1('0x6e')][_0x49b1('0x42')]+0x1,'app':_0x49b1('0x9e'),'appdata':_0x49b1('0x9f'),'interval':_0x49b1('0xa0')});}_0x2dba0d[_0x49b1('0x9c')][_0x49b1('0xa1')]=!![];}return db[_0x49b1('0xa2')][_0x49b1('0x54')]({'phone':_0x2dba0d['body'][_0x49b1('0x7d')],'messageId':_0x2dba0d['body']['messageId'],'body':_0x2dba0d['body']['body'],'SmsAccountId':_0x2d14b8[_0x49b1('0x51')]['id'],'SmsInteractionId':_0x5ac718['id'],'direction':'in','ContactId':_0x5ac718[_0x49b1('0xa3')],'AttachmentId':_0x2dba0d['body'][_0x49b1('0xa4')]});})[_0x49b1('0x1b')](function(_0x42d1e1){_0x2dba0d[_0x49b1('0x23')]=_0x42d1e1;if(_0x2dba0d[_0x49b1('0x9c')][_0x49b1('0xa5')]){return db[_0x49b1('0xa6')][_0x49b1('0x5a')]({'attributes':['id','name'],'where':{'id':_0x2dba0d[_0x49b1('0x9c')]['UserId']}})['then'](function(_0x2799a7){if(_0x2799a7){_0x2dba0d[_0x49b1('0x6e')][_0x49b1('0xa7')]({'id':0x0,'priority':0x0,'app':_0x49b1('0xa8'),'appdata':_0x2799a7[_0x49b1('0x34')]+','+(_0x2dba0d[_0x49b1('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x49b1('0xa0')});}return respondWithRpcPromise('Start',_0x49b1('0xa9'),_0x2dba0d);});}return respondWithRpcPromise(_0x49b1('0xaa'),'startRouting',_0x2dba0d);})[_0x49b1('0x1b')](function(_0x35e648){if(_0x35e648){var _0x3cb3dc=0xc8;var _0xbcd337='receiveMessage';logger[_0x49b1('0x1c')](_0x49b1('0x1f'),_0xbcd337,_0x3cb3dc,'entity\x20found');logger[_0x49b1('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xbcd337,_0x3cb3dc,'entity\x20found',JSON['stringify'](_0x35e648));if(_0x2dba0d[_0x49b1('0x72')]['type']===_0x49b1('0x7c')){return _0x190ad8[_0x49b1('0x25')](_0x3cb3dc)['set'](_0x49b1('0xab'),'text/xml')[_0x49b1('0x35')](_0x49b1('0xac'));}else{return _0x190ad8['status'](_0x3cb3dc)[_0x49b1('0x27')](_0x35e648);}}})[_0x49b1('0x4f')](handleError(_0x190ad8,null));};exports['addApplications']=function(_0x43260a,_0x220086){var _0x55de85=_0x43260a['params']['id'];var _0x2543f7=_0x43260a[_0x49b1('0x55')];var _0x24e8cc=0xc8;var _0x529545=null;return db[_0x49b1('0xad')][_0x49b1('0xae')]({'isolationLevel':db['sequelize'][_0x49b1('0xaf')][_0x49b1('0xb0')]['READ_COMMITTED']},function(_0x10a9b5){return db[_0x49b1('0x37')][_0x49b1('0x61')]({'where':{'id':_0x55de85},'transaction':_0x10a9b5})[_0x49b1('0x1b')](function(_0x512a43){if(_0x512a43){return db[_0x49b1('0xb1')][_0x49b1('0x30')]({'where':{'SmsAccountId':_0x55de85},'transaction':_0x10a9b5})[_0x49b1('0x1b')](function(){var _0x110340=_[_0x49b1('0x68')](_0x2543f7,function(_0x2b8fac){_0x2b8fac[_0x49b1('0x64')]=_0x55de85;return _0x2b8fac;});return db[_0x49b1('0xb1')][_0x49b1('0xb2')](_0x110340,{'transaction':_0x10a9b5});});}else{_0x24e8cc=0x194;_0x529545=[];}});})[_0x49b1('0x1b')](function(){if(_0x24e8cc!==0x194){return db[_0x49b1('0xb1')]['findAndCountAll']({'where':{'SmsAccountId':_0x55de85},'order':_0x49b1('0x70')})[_0x49b1('0x1b')](function(_0x2f3870){_0x529545=_0x2f3870;});}})[_0x49b1('0x4f')](function(_0xbc118d){_0x24e8cc=0x1f4;logger[_0x49b1('0x21')](_0xbc118d[_0x49b1('0x33')]);if(_0xbc118d[_0x49b1('0x34')]){delete _0xbc118d['name'];}_0x529545=_0xbc118d;})[_0x49b1('0xb3')](function(){if(_0x529545===null){_0x220086[_0x49b1('0x24')](_0x24e8cc);}else{if(_0x24e8cc===0x1f4){_0x220086[_0x49b1('0x25')](_0x24e8cc)[_0x49b1('0x35')](_0x529545);}else{_0x220086[_0x49b1('0x25')](_0x24e8cc)[_0x49b1('0x27')](_0x529545);}}});};exports[_0x49b1('0xb4')]=function(_0x194fc3,_0x435c5b,_0x5816c7){var _0x24b66f={};var _0x2ead6f={};var _0x361eae;var _0x145d23;return db[_0x49b1('0x37')][_0x49b1('0x61')]({'where':{'id':_0x194fc3[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x435c5b,null))[_0x49b1('0x1b')](function(_0x318535){if(_0x318535){_0x361eae=_0x318535;_0x2ead6f['model']=_[_0x49b1('0x3e')](db['SmsApplication'][_0x49b1('0x38')]);_0x2ead6f[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x194fc3[_0x49b1('0x3d')]);_0x2ead6f[_0x49b1('0x3f')]=_[_0x49b1('0x53')](_0x2ead6f[_0x49b1('0x3c')],_0x2ead6f[_0x49b1('0x3d')]);_0x24b66f[_0x49b1('0x40')]=_[_0x49b1('0x53')](_0x2ead6f[_0x49b1('0x3c')],qs[_0x49b1('0x41')](_0x194fc3[_0x49b1('0x3d')]['fields']));_0x24b66f[_0x49b1('0x40')]=_0x24b66f[_0x49b1('0x40')][_0x49b1('0x42')]?_0x24b66f[_0x49b1('0x40')]:_0x2ead6f[_0x49b1('0x3c')];_0x24b66f[_0x49b1('0x44')]=qs['sort'](_0x194fc3[_0x49b1('0x3d')]['sort']);_0x24b66f['where']=qs[_0x49b1('0x3f')](_[_0x49b1('0x63')](_0x194fc3[_0x49b1('0x3d')],_0x2ead6f[_0x49b1('0x3f')]));if(_0x194fc3[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x24b66f[_0x49b1('0x46')]=_[_0x49b1('0x48')](_0x24b66f[_0x49b1('0x46')],{'$or':_[_0x49b1('0x68')](_0x24b66f[_0x49b1('0x40')],function(_0x4f117f){var _0x54f1f5={};_0x54f1f5[_0x4f117f]={'$like':'%'+_0x194fc3[_0x49b1('0x3d')][_0x49b1('0x47')]+'%'};return _0x54f1f5;})});}_0x24b66f=_['merge']({},_0x24b66f,_0x194fc3[_0x49b1('0x4a')]);return _0x361eae[_0x49b1('0xb4')](_0x24b66f);}})[_0x49b1('0x1b')](function(_0x17b183){if(_0x17b183){_0x145d23=_0x17b183['length'];if(!_0x194fc3[_0x49b1('0x3d')][_0x49b1('0x43')](_0x49b1('0x62'))){_0x24b66f[_0x49b1('0x2b')]=qs['limit'](_0x194fc3[_0x49b1('0x3d')][_0x49b1('0x2b')]);_0x24b66f['offset']=qs[_0x49b1('0x2a')](_0x194fc3[_0x49b1('0x3d')][_0x49b1('0x2a')]);}return _0x361eae[_0x49b1('0xb4')](_0x24b66f);}})[_0x49b1('0x1b')](function(_0x564ab2){if(_0x564ab2){return _0x564ab2?{'count':_0x145d23,'rows':_0x564ab2}:null;}})[_0x49b1('0x1b')](respondWithResult(_0x435c5b,null))[_0x49b1('0x4f')](handleError(_0x435c5b,null));};exports[_0x49b1('0xb5')]=function(_0x4de37f,_0x73086b,_0x28c766){var _0x276dad={'raw':![],'where':{}};var _0x4da96c={};var _0x22c703={'count':0x0,'rows':[]};return db[_0x49b1('0x37')][_0x49b1('0x61')]({'where':{'id':_0x4de37f[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x73086b,null))[_0x49b1('0x1b')](function(_0x4cda33){if(_0x4cda33){_0x4da96c['model']=_[_0x49b1('0x3e')](db['SmsInteraction'][_0x49b1('0x38')]);_0x4da96c[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x4de37f[_0x49b1('0x3d')]);_0x4da96c['filters']=_['intersection'](_0x4da96c[_0x49b1('0x3c')],_0x4da96c['query']);_0x276dad['attributes']=_[_0x49b1('0x53')](_0x4da96c[_0x49b1('0x3c')],qs[_0x49b1('0x41')](_0x4de37f[_0x49b1('0x3d')]['fields']));_0x276dad['attributes']=_0x276dad[_0x49b1('0x40')]['length']?_0x276dad[_0x49b1('0x40')]:_0x4da96c['model'];if(!_0x4de37f['query'][_0x49b1('0x43')]('nolimit')){_0x276dad[_0x49b1('0x2b')]=qs[_0x49b1('0x2b')](_0x4de37f[_0x49b1('0x3d')][_0x49b1('0x2b')]);_0x276dad['offset']=qs[_0x49b1('0x2a')](_0x4de37f[_0x49b1('0x3d')][_0x49b1('0x2a')]);}_0x276dad[_0x49b1('0x44')]=qs[_0x49b1('0x45')](_0x4de37f['query'][_0x49b1('0x45')]);_0x276dad['where']=qs['filters'](_[_0x49b1('0x63')](_0x4de37f['query'],_0x4da96c[_0x49b1('0x3f')]));_0x276dad[_0x49b1('0x46')]['SmsAccountId']=_0x4cda33['id'];if(_0x4de37f[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x276dad[_0x49b1('0x46')]=_['merge'](_0x276dad['where'],{'$or':_[_0x49b1('0x68')](_0x276dad[_0x49b1('0x40')],function(_0x44e7c6){var _0x257321={};_0x257321[_0x44e7c6]={'$like':'%'+_0x4de37f[_0x49b1('0x3d')]['filter']+'%'};return _0x257321;})});}_0x276dad=_[_0x49b1('0x48')]({},_0x276dad,_0x4de37f[_0x49b1('0x4a')]);return db[_0x49b1('0x9b')][_0x49b1('0x29')]({'where':_0x276dad['where']})[_0x49b1('0x1b')](function(_0x1e25af){_0x22c703[_0x49b1('0x29')]=_0x1e25af;if(_0x4de37f['query'][_0x49b1('0x4b')]){_0x276dad[_0x49b1('0x4c')]=[{'model':db[_0x49b1('0x73')],'as':_0x49b1('0xb6'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x49b1('0xb7'),_0x49b1('0xb8')],'required':![]},{'model':db[_0x49b1('0xb9')],'as':_0x49b1('0xba'),'attributes':['id',_0x49b1('0x34'),_0x49b1('0xbb')],'where':_0x4de37f['query'][_0x49b1('0xbc')]?{'id':_0x4de37f[_0x49b1('0x3d')]['tag']}:undefined,'required':_0x4de37f[_0x49b1('0x3d')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x49b1('0x4d')](_0x276dad);})[_0x49b1('0x1b')](function(_0x18a33c){_0x22c703[_0x49b1('0x4e')]=_0x18a33c;return _0x22c703;});}})[_0x49b1('0x1b')](respondWithFilteredResult(_0x73086b,_0x276dad))[_0x49b1('0x4f')](handleError(_0x73086b,null));};exports[_0x49b1('0x35')]=function(_0x341585,_0x3441e5,_0x1018b5){var _0x554dc1,_0x309167,_0x512235;if(_[_0x49b1('0x91')](_0x341585[_0x49b1('0x55')]['body'])||_0x341585[_0x49b1('0x55')][_0x49b1('0x55')]===''){throw new db[(_0x49b1('0x74'))][(_0x49b1('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x49b1('0x91')](_0x341585[_0x49b1('0x55')]['to'])){throw new db[(_0x49b1('0x74'))][(_0x49b1('0x75'))]('to\x20is\x20mandatory');}_0x554dc1=_0x341585[_0x49b1('0x55')]['to'];return db[_0x49b1('0x37')]['find']({'where':{'id':_0x341585[_0x49b1('0x51')]['id']},'include':[{'model':db[_0x49b1('0x97')],'as':'List','include':[{'model':db[_0x49b1('0x73')],'as':_0x49b1('0x98'),'where':{'mobile':_0x554dc1},'limit':0x1,'order':[[_0x49b1('0x78'),_0x49b1('0xbd')]]}]}]})['then'](handleEntityNotFound(_0x3441e5,null))['then'](function(_0x451f40){if(_0x451f40&&_0x451f40[_0x49b1('0xbe')]){_0x309167=_0x451f40[_0x49b1('0x31')]({'plain':!![]});if(_0x309167['List']&&_0x309167[_0x49b1('0xbe')][_0x49b1('0x98')][_0x49b1('0x42')]){return _0x309167[_0x49b1('0xbe')][_0x49b1('0x98')][0x0];}return db[_0x49b1('0x73')]['create'](_[_0x49b1('0x16')](_0x341585[_0x49b1('0x55')],{'firstName':_0x554dc1,'mobile':_0x554dc1,'phone':_0x554dc1,'ListId':_0x309167[_0x49b1('0x7a')]}));}})[_0x49b1('0x1b')](handleEntityNotFound(_0x3441e5,null))[_0x49b1('0x1b')](function(_0x18dd89){if(_0x18dd89){_0x512235=_0x18dd89;return db[_0x49b1('0x9b')][_0x49b1('0x5a')]({'where':{'ContactId':_0x512235['id'],'closed':![],'SmsAccountId':_0x309167['id']}})[_0x49b1('0x1b')](function(_0x27fb6d){if(_0x27fb6d){return[_0x27fb6d,![]];}return db[_0x49b1('0x9b')]['create']({'UserId':_0x341585[_0x49b1('0x58')]['id'],'ContactId':_0x512235['id'],'SmsAccountId':_0x309167['id'],'phone':_0x554dc1,'firstMsgDirection':_0x49b1('0xbf'),'Messages':[_['merge'](_0x341585[_0x49b1('0x55')],{'read':![],'body':_0x341585['body'][_0x49b1('0x55')],'phone':_0x554dc1,'SmsAccountId':_0x309167['id'],'UserId':_0x341585['user']['id'],'ContactId':_0x512235['id']})]},{'include':[{'model':db[_0x49b1('0xa2')],'as':_0x49b1('0xc0')}]})['then'](function(_0xcd7b85){return[_0xcd7b85,!![]];});});}})['spread'](function(_0x1ea644,_0x4689f2){if(_0x4689f2){return _0x1ea644;}return db[_0x49b1('0xa2')][_0x49b1('0x54')](_[_0x49b1('0x48')](_0x341585[_0x49b1('0x55')],{'read':![],'body':_0x341585[_0x49b1('0x55')][_0x49b1('0x55')],'phone':_0x554dc1,'SmsAccountId':_0x309167['id'],'SmsInteractionId':_0x1ea644['id'],'UserId':_0x341585[_0x49b1('0x58')]['id'],'ContactId':_0x512235['id']}))[_0x49b1('0x1b')](function(_0xbc7e32){_0x1ea644[_0x49b1('0xc1')][_0x49b1('0xc0')]=[];_0x1ea644[_0x49b1('0xc1')][_0x49b1('0xc0')][_0x49b1('0xc2')](_0xbc7e32[_0x49b1('0xc1')]);return _0x1ea644;});})[_0x49b1('0x1b')](respondWithResult(_0x3441e5,null))['catch'](handleError(_0x3441e5,null));};exports[_0x49b1('0x25')]=function(_0x3325b1,_0x4f491b,_0x1f903d){if(_0x3325b1[_0x49b1('0x55')]['id']){delete _0x3325b1[_0x49b1('0x55')]['id'];}var _0x3db982,_0x175028,_0xfc4485;return db[_0x49b1('0x37')]['find']({'where':{'id':_0x3325b1[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x4f491b,null))[_0x49b1('0x1b')](function(_0xf67583){if(_0xf67583){_0xfc4485=_0xf67583;logger[_0x49b1('0x1e')](_0x49b1('0x1f'),_0x49b1('0x25'),'received\x20delivery\x20report\x20from',_0xf67583[_0x49b1('0x3a')],util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));switch(_0xf67583[_0x49b1('0x3a')]){case'skebby':if(_0x3325b1[_0x49b1('0x55')][_0x49b1('0xc4')]&&_0x3325b1[_0x49b1('0x55')][_0x49b1('0x25')]){_0x175028=_0x3325b1[_0x49b1('0x55')][_0x49b1('0x25')];return db[_0x49b1('0xa2')]['find']({'where':{'messageId':_0x3325b1[_0x49b1('0x55')][_0x49b1('0xc4')]}});}break;case _0x49b1('0xc5'):if(_0x3325b1['body'][_0x49b1('0xc6')]&&_0x3325b1[_0x49b1('0x55')][_0x49b1('0xc7')]){_0x175028=_0x3325b1[_0x49b1('0x55')][_0x49b1('0xc7')];return db[_0x49b1('0xa2')][_0x49b1('0x5a')]({'where':{'messageId':_0x3325b1['body'][_0x49b1('0xc6')]}});}break;case _0x49b1('0x82'):if(_0x3325b1[_0x49b1('0x55')][_0x49b1('0x84')]&&_0x3325b1[_0x49b1('0x55')][_0x49b1('0xc8')]){_0x175028=_0x3325b1[_0x49b1('0x55')]['status_code'];return db[_0x49b1('0xa2')]['find']({'where':{'messageId':_0x3325b1[_0x49b1('0x55')][_0x49b1('0x84')]}});}break;case _0x49b1('0x89'):var _0x9867de=_0x3325b1[_0x49b1('0x55')][_0x49b1('0x8a')][0x0];if(_0x9867de[_0x49b1('0x83')]&&_0x9867de['status'][_0x49b1('0xc9')]===_0x49b1('0xca')){_0x175028=_0x9867de[_0x49b1('0x25')][_0x49b1('0xc9')];return db[_0x49b1('0xa2')]['find']({'where':{'messageId':_0x9867de[_0x49b1('0x83')]}});}break;case'clickatell':if(_0x3325b1[_0x49b1('0x55')]['messageId']&&_0x3325b1['body']['status']){_0x175028=_0x3325b1[_0x49b1('0x55')]['status'];return db[_0x49b1('0xa2')]['find']({'where':{'messageId':_0x3325b1[_0x49b1('0x55')][_0x49b1('0x83')]}});}break;case _0x49b1('0x90'):if(_0x3325b1[_0x49b1('0x55')][0x0][_0x49b1('0x23')]['id']){_0x175028=_0x3325b1[_0x49b1('0x55')][0x0][_0x49b1('0x3a')];return db['SmsMessage'][_0x49b1('0x5a')]({'where':{'messageId':_0x3325b1['body'][0x0]['message']['id']}});}break;case _0x49b1('0xcb'):if(_0x3325b1[_0x49b1('0x55')][_0x49b1('0xcc')]&&_0x3325b1[_0x49b1('0x55')]['status']){_0x175028=_0x3325b1[_0x49b1('0x55')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x3325b1[_0x49b1('0x55')][_0x49b1('0xcc')]}});}break;}}})[_0x49b1('0x1b')](handleEntityNotFound(_0x4f491b,null))[_0x49b1('0x1b')](function(_0x5e2c2e){if(_0x5e2c2e){_0x3db982=_0x5e2c2e;switch(_0xfc4485[_0x49b1('0x3a')]){case _0x49b1('0x80'):if(_0x175028===_0x49b1('0xca')){return _0x3db982['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x49b1('0x25'),_0x49b1('0x80'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49b1('0xc5'):if(_0x175028==='1'){return _0x3db982['update']({'read':!![]});}else{logger['error'](_0x49b1('0x1f'),'status',_0x49b1('0x80'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49b1('0x82'):if(!_0x3325b1[_0x49b1('0x55')][_0x49b1('0xcd')]&&_0x175028>=0xc8&&_0x175028<=0xce){return _0x3db982['update']({'read':!![]});}else{logger['error'](_0x49b1('0x1f'),_0x49b1('0x25'),_0x49b1('0x82'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49b1('0x89'):var _0xaeb721=_0x3325b1[_0x49b1('0x55')][_0x49b1('0x8a')][0x0];if(_0xaeb721[_0x49b1('0x25')][_0x49b1('0xc9')]===_0x49b1('0xca')){return _0x3db982[_0x49b1('0x2f')]({'read':!![]});}else{logger[_0x49b1('0x21')](_0x49b1('0x1f'),_0x49b1('0x25'),_0x49b1('0x89'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x175028=='DELIVERED_TO_GATEWAY'||_0x175028=='RECEIVED_BY_RECIPIENT'){return _0x3db982[_0x49b1('0x2f')]({'read':!![]});}else{logger[_0x49b1('0x21')](_0x49b1('0x1f'),_0x49b1('0x25'),_0x49b1('0x8e'),util['inspect'](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49b1('0x90'):if(_0x175028==_0x49b1('0xce')){return _0x3db982[_0x49b1('0x2f')]({'read':!![]});}else{logger[_0x49b1('0x21')](_0x49b1('0x1f'),_0x49b1('0x25'),_0x49b1('0x90'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49b1('0xcb'):if(_0x175028==='DELIVRD'||_0x175028==='ACCEPTD'){return _0x3db982['update']({'read':!![]});}else{logger[_0x49b1('0x21')](_0x49b1('0x1f'),'status',_0x49b1('0xcb'),util[_0x49b1('0xc3')](_0x3325b1[_0x49b1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x3db982;}})['then'](respondWithResult(_0x4f491b,null))[_0x49b1('0x4f')](handleError(_0x4f491b,null));};exports['statusGet']=function(_0x1b7361,_0x502af4,_0x207a7b){var _0x2752ae,_0x89adae,_0x3001ca;return db[_0x49b1('0x37')][_0x49b1('0x5a')]({'where':{'id':_0x1b7361[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x502af4,null))[_0x49b1('0x1b')](function(_0x12092e){if(_0x12092e){_0x3001ca=_0x12092e;logger[_0x49b1('0x1e')](_0x49b1('0x1f'),_0x49b1('0x25'),_0x49b1('0xcf'),_0x12092e['type'],util[_0x49b1('0xc3')](_0x1b7361[_0x49b1('0x3d')],{'showHidden':![],'depth':null}));switch(_0x12092e['type']){case'csc':if(_0x1b7361[_0x49b1('0x3d')]['message-id']&&_0x1b7361[_0x49b1('0x3d')][_0x49b1('0xd0')]){_0x89adae=_0x1b7361[_0x49b1('0x3d')]['state'];return db[_0x49b1('0xa2')][_0x49b1('0x5a')]({'where':{'messageId':_0x1b7361[_0x49b1('0x3d')]['message-id']}});}break;}}})[_0x49b1('0x1b')](handleEntityNotFound(_0x502af4,null))[_0x49b1('0x1b')](function(_0x51a8a7){if(_0x51a8a7){_0x2752ae=_0x51a8a7;switch(_0x3001ca[_0x49b1('0x3a')]){case'csc':if(_0x89adae==='2'||_0x89adae==='6'){return _0x2752ae['update']({'read':!![]});}else{logger[_0x49b1('0x21')](_0x49b1('0x1f'),_0x49b1('0x25'),'csc',util[_0x49b1('0xc3')](_0x1b7361[_0x49b1('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x2752ae;}})[_0x49b1('0x1b')](respondWithResult(_0x502af4,null))['catch'](handleError(_0x502af4,null));};exports[_0x49b1('0xd1')]=function(_0x1706ea,_0x2b5b87,_0x2e4f95){return db[_0x49b1('0x37')][_0x49b1('0x5a')]({'where':{'id':_0x1706ea['params']['id']}})['then'](handleEntityNotFound(_0x2b5b87,null))[_0x49b1('0x1b')](function(_0x89ffb8){if(_0x89ffb8){return _0x89ffb8[_0x49b1('0xd1')](_0x1706ea[_0x49b1('0x55')][_0x49b1('0x6a')],_[_0x49b1('0xd2')](_0x1706ea['body'],[_0x49b1('0x6a'),'id'])||{})[_0x49b1('0xd3')](function(_0x42cd52){for(var _0x4b7086=0x0;_0x4b7086<_0x1706ea[_0x49b1('0x55')][_0x49b1('0x6a')][_0x49b1('0x42')];_0x4b7086+=0x1){socket[_0x49b1('0xd4')](_0x49b1('0xd5'),{'UserId':Number(_0x1706ea['body']['ids'][_0x4b7086]),'SmsAccountId':Number(_0x1706ea[_0x49b1('0x51')]['id'])});}return _0x42cd52;});}})[_0x49b1('0x1b')](respondWithResult(_0x2b5b87,null))[_0x49b1('0x4f')](handleError(_0x2b5b87,null));};exports[_0x49b1('0xd6')]=function(_0x4902f1,_0x391153,_0x170c5f){return db[_0x49b1('0x37')]['find']({'where':{'id':_0x4902f1['params']['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x391153,null))['then'](function(_0x585e57){if(_0x585e57){return _0x585e57[_0x49b1('0xd6')](_0x4902f1['query']['ids'])[_0x49b1('0x1b')](function(){if(_[_0x49b1('0xd7')](_0x4902f1['query'][_0x49b1('0x6a')])){for(var _0x5798bd=0x0;_0x5798bd<_0x4902f1[_0x49b1('0x3d')]['ids']['length'];_0x5798bd+=0x1){socket[_0x49b1('0xd4')]('userSmsAccount:remove',{'UserId':Number(_0x4902f1['query'][_0x49b1('0x6a')][_0x5798bd]),'SmsAccountId':Number(_0x4902f1[_0x49b1('0x51')]['id'])});}}else{socket[_0x49b1('0xd4')](_0x49b1('0xd8'),{'UserId':Number(_0x4902f1['query'][_0x49b1('0x6a')]),'SmsAccountId':Number(_0x4902f1['params']['id'])});}});}})[_0x49b1('0x1b')](respondWithStatusCode(_0x391153,null))['catch'](handleError(_0x391153,null));};exports[_0x49b1('0xd9')]=function(_0x554d65,_0x203825,_0x1a092d){var _0x53f19d={};var _0x2b9b9b={};var _0x20d547;var _0x5ee8cf;return db[_0x49b1('0x37')][_0x49b1('0x61')]({'where':{'id':_0x554d65[_0x49b1('0x51')]['id']}})[_0x49b1('0x1b')](handleEntityNotFound(_0x203825,null))[_0x49b1('0x1b')](function(_0x29bfed){if(_0x29bfed){_0x20d547=_0x29bfed;_0x2b9b9b[_0x49b1('0x3c')]=_['keys'](db[_0x49b1('0xa6')][_0x49b1('0x38')]);_0x2b9b9b[_0x49b1('0x3d')]=_[_0x49b1('0x3e')](_0x554d65[_0x49b1('0x3d')]);_0x2b9b9b[_0x49b1('0x3f')]=_[_0x49b1('0x53')](_0x2b9b9b[_0x49b1('0x3c')],_0x2b9b9b[_0x49b1('0x3d')]);_0x53f19d[_0x49b1('0x40')]=_[_0x49b1('0x53')](_0x2b9b9b['model'],qs[_0x49b1('0x41')](_0x554d65['query']['fields']));_0x53f19d[_0x49b1('0x40')]=_0x53f19d[_0x49b1('0x40')][_0x49b1('0x42')]?_0x53f19d[_0x49b1('0x40')]:_0x2b9b9b[_0x49b1('0x3c')];_0x53f19d['order']=qs[_0x49b1('0x45')](_0x554d65[_0x49b1('0x3d')][_0x49b1('0x45')]);_0x53f19d[_0x49b1('0x46')]=qs[_0x49b1('0x3f')](_[_0x49b1('0x63')](_0x554d65[_0x49b1('0x3d')],_0x2b9b9b[_0x49b1('0x3f')]));if(_0x554d65[_0x49b1('0x3d')][_0x49b1('0x47')]){_0x53f19d[_0x49b1('0x46')]=_[_0x49b1('0x48')](_0x53f19d['where'],{'$or':_[_0x49b1('0x68')](_0x53f19d[_0x49b1('0x40')],function(_0x5ef359){var _0x3db761={};_0x3db761[_0x5ef359]={'$like':'%'+_0x554d65[_0x49b1('0x3d')][_0x49b1('0x47')]+'%'};return _0x3db761;})});}_0x53f19d=_[_0x49b1('0x48')]({},_0x53f19d,_0x554d65[_0x49b1('0x4a')]);return _0x20d547[_0x49b1('0xd9')](_0x53f19d);}})['then'](function(_0x38ad02){if(_0x38ad02){_0x5ee8cf=_0x38ad02[_0x49b1('0x42')];if(!_0x554d65[_0x49b1('0x3d')][_0x49b1('0x43')]('nolimit')){_0x53f19d[_0x49b1('0x2b')]=qs[_0x49b1('0x2b')](_0x554d65[_0x49b1('0x3d')][_0x49b1('0x2b')]);_0x53f19d[_0x49b1('0x2a')]=qs[_0x49b1('0x2a')](_0x554d65[_0x49b1('0x3d')][_0x49b1('0x2a')]);}return _0x20d547[_0x49b1('0xd9')](_0x53f19d);}})[_0x49b1('0x1b')](function(_0x5a3e13){if(_0x5a3e13){return _0x5a3e13?{'count':_0x5ee8cf,'rows':_0x5a3e13}:null;}})[_0x49b1('0x1b')](respondWithResult(_0x203825,null))[_0x49b1('0x4f')](handleError(_0x203825,null));}; \ No newline at end of file +var _0x1eb0=['destroy','get','then','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SmsAccount','includeAll','include','findAll','rows','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify','sms','SmsApplication','Applications','account','priority','asc','CmContact','Sequelize','ValidationError','updatedAt','difference','createdAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','intelepeer','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','omit','defaults','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','agent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','transaction','sequelize','READ_COMMITTED','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','inspect','requestid','statusInt','status_code','DELIVERED','groupName','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1eb0,0x192));var _0x01eb=function(_0x374ce3,_0x5336a2){_0x374ce3=_0x374ce3-0x0;var _0x4ca91a=_0x1eb0[_0x374ce3];return _0x4ca91a;};'use strict';var emlformat=require(_0x01eb('0x0'));var rimraf=require(_0x01eb('0x1'));var zipdir=require(_0x01eb('0x2'));var jsonpatch=require(_0x01eb('0x3'));var rp=require(_0x01eb('0x4'));var moment=require(_0x01eb('0x5'));var BPromise=require(_0x01eb('0x6'));var Mustache=require(_0x01eb('0x7'));var util=require(_0x01eb('0x8'));var path=require(_0x01eb('0x9'));var sox=require(_0x01eb('0xa'));var csv=require(_0x01eb('0xb'));var ejs=require(_0x01eb('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x01eb('0xd'));var crypto=require(_0x01eb('0xe'));var jsforce=require(_0x01eb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x01eb('0xb'));var querystring=require(_0x01eb('0x10'));var Papa=require(_0x01eb('0x11'));var Redis=require(_0x01eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x01eb('0x13'));var as=require(_0x01eb('0x14'));var hardwareService=require(_0x01eb('0x15'));var logger=require(_0x01eb('0x16'))(_0x01eb('0x17'));var utils=require(_0x01eb('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x01eb('0x19'));var db=require(_0x01eb('0x1a'))['db'];config[_0x01eb('0x1b')]=_['defaults'](config[_0x01eb('0x1b')],{'host':_0x01eb('0x1c'),'port':0x18eb});var socket=require(_0x01eb('0x1d'))(new Redis(config[_0x01eb('0x1b')]));require(_0x01eb('0x1e'))[_0x01eb('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x01eb('0x20')][_0x01eb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x181e54,_0x431503,_0x55522d,_0x3f710f){return new BPromise(function(_0x587512,_0x2c7be8){var _0x54b0fb=_0x3f710f||client;return _0x54b0fb['request'](_0x181e54,_0x55522d)['then'](function(_0x24a432){logger['info'](_0x01eb('0x22'),_0x431503,'request\x20sent');logger[_0x01eb('0x23')](_0x01eb('0x24'),_0x431503,_0x01eb('0x25'),JSON[_0x01eb('0x26')](_0x24a432));if(_0x24a432[_0x01eb('0x27')]){if(_0x24a432['error'][_0x01eb('0x28')]===0x1f4){logger[_0x01eb('0x27')](_0x01eb('0x22'),_0x431503,_0x24a432['error'][_0x01eb('0x29')]);return _0x2c7be8(_0x24a432['error'][_0x01eb('0x29')]);}logger[_0x01eb('0x27')](_0x01eb('0x22'),_0x431503,_0x24a432[_0x01eb('0x27')]['message']);return _0x587512(_0x24a432[_0x01eb('0x27')][_0x01eb('0x29')]);}else{logger['info'](_0x01eb('0x22'),_0x431503,'request\x20sent');_0x587512(_0x24a432[_0x01eb('0x2a')][_0x01eb('0x29')]);}})[_0x01eb('0x2b')](function(_0x5ae60a){logger[_0x01eb('0x27')](_0x01eb('0x22'),_0x431503,_0x5ae60a);_0x2c7be8(_0x5ae60a);});});}function respondWithStatusCode(_0x45129f,_0x1764c5){_0x1764c5=_0x1764c5||0xcc;return function(_0x486c32){if(_0x486c32){return _0x45129f['sendStatus'](_0x1764c5);}return _0x45129f[_0x01eb('0x2c')](_0x1764c5)[_0x01eb('0x2d')]();};}function respondWithResult(_0x2fe27b,_0x11d0ce){_0x11d0ce=_0x11d0ce||0xc8;return function(_0x180595){if(_0x180595){return _0x2fe27b[_0x01eb('0x2c')](_0x11d0ce)[_0x01eb('0x2e')](_0x180595);}};}function respondWithFilteredResult(_0x47099d,_0x2f354c){return function(_0x38fb7d){if(_0x38fb7d){var _0x4f41e1=typeof _0x2f354c[_0x01eb('0x2f')]==='undefined'&&typeof _0x2f354c[_0x01eb('0x30')]==='undefined';var _0x46e9a6=_0x38fb7d[_0x01eb('0x31')];var _0x12d94a=_0x4f41e1?0x0:_0x2f354c[_0x01eb('0x2f')];var _0x259374=_0x4f41e1?_0x38fb7d[_0x01eb('0x31')]:_0x2f354c['offset']+_0x2f354c[_0x01eb('0x30')];var _0x380a30;if(_0x259374>=_0x46e9a6){_0x259374=_0x46e9a6;_0x380a30=0xc8;}else{_0x380a30=0xce;}_0x47099d[_0x01eb('0x2c')](_0x380a30);return _0x47099d[_0x01eb('0x32')](_0x01eb('0x33'),_0x12d94a+'-'+_0x259374+'/'+_0x46e9a6)[_0x01eb('0x2e')](_0x38fb7d);}return null;};}function patchUpdates(_0x31218e){return function(_0x40c683){try{jsonpatch[_0x01eb('0x34')](_0x40c683,_0x31218e,!![]);}catch(_0x5a47d3){return BPromise[_0x01eb('0x35')](_0x5a47d3);}return _0x40c683[_0x01eb('0x36')]();};}function saveUpdates(_0x415e75,_0x460753){return function(_0x27d986){if(_0x27d986){return _0x27d986[_0x01eb('0x37')](_0x415e75)['then'](function(_0x452be7){return _0x452be7;});}return null;};}function removeEntity(_0x277b2c,_0xad28ba){return function(_0xbc73e6){if(_0xbc73e6){return _0xbc73e6[_0x01eb('0x38')]()['then'](function(){var _0x463515=_0xbc73e6[_0x01eb('0x39')]({'plain':!![]});var _0x3d7e76='SmsAccounts';return db['UserProfileResource'][_0x01eb('0x38')]({'where':{'type':_0x3d7e76,'resourceId':_0x463515['id']}})[_0x01eb('0x3a')](function(){return _0xbc73e6;});})[_0x01eb('0x3a')](function(){_0x277b2c[_0x01eb('0x2c')](0xcc)[_0x01eb('0x2d')]();});}};}function handleEntityNotFound(_0x5ab925,_0xca9d80){return function(_0x5c3e35){if(!_0x5c3e35){_0x5ab925[_0x01eb('0x3b')](0x194);}return _0x5c3e35;};}function handleError(_0x318e0,_0x3377e3){_0x3377e3=_0x3377e3||0x1f4;return function(_0x81250c){logger[_0x01eb('0x27')](_0x81250c[_0x01eb('0x3c')]);if(_0x81250c['name']){delete _0x81250c[_0x01eb('0x3d')];}_0x318e0[_0x01eb('0x2c')](_0x3377e3)[_0x01eb('0x3e')](_0x81250c);};}exports[_0x01eb('0x3f')]=function(_0x45fb2a,_0x31a918){var _0x3e1a62={'include':[{'model':db[_0x01eb('0x40')],'as':_0x01eb('0x41')}]},_0x10a0c6={},_0x15e239={'count':0x0,'rows':[]};var _0x574be2=_[_0x01eb('0x42')](db['SmsAccount'][_0x01eb('0x43')],function(_0x47f768){return{'name':_0x47f768[_0x01eb('0x44')],'type':_0x47f768[_0x01eb('0x45')][_0x01eb('0x46')]};});_0x10a0c6['model']=_[_0x01eb('0x42')](_0x574be2,_0x01eb('0x3d'));_0x10a0c6[_0x01eb('0x47')]=_['keys'](_0x45fb2a[_0x01eb('0x47')]);_0x10a0c6[_0x01eb('0x48')]=_[_0x01eb('0x49')](_0x10a0c6[_0x01eb('0x4a')],_0x10a0c6[_0x01eb('0x47')]);_0x3e1a62[_0x01eb('0x4b')]=_['intersection'](_0x10a0c6[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x4c')]));_0x3e1a62['attributes']=_0x3e1a62[_0x01eb('0x4b')]['length']?_0x3e1a62['attributes']:_0x10a0c6[_0x01eb('0x4a')];if(!_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x4d')](_0x01eb('0x4e'))){_0x3e1a62[_0x01eb('0x30')]=qs[_0x01eb('0x30')](_0x45fb2a['query'][_0x01eb('0x30')]);_0x3e1a62[_0x01eb('0x2f')]=qs[_0x01eb('0x2f')](_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x2f')]);}_0x3e1a62[_0x01eb('0x4f')]=qs['sort'](_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x50')]);_0x3e1a62['where']=qs[_0x01eb('0x48')](_['pick'](_0x45fb2a['query'],_0x10a0c6[_0x01eb('0x48')]),_0x574be2);if(_0x45fb2a[_0x01eb('0x47')]['filter']){_0x3e1a62[_0x01eb('0x51')]=_[_0x01eb('0x52')](_0x3e1a62['where'],{'$or':_[_0x01eb('0x42')](_0x574be2,function(_0x2c8bb2){if(_0x2c8bb2[_0x01eb('0x45')]!==_0x01eb('0x53')){var _0xb7b26b={};_0xb7b26b[_0x2c8bb2['name']]={'$like':'%'+_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x54')]+'%'};return _0xb7b26b;}})});}_0x3e1a62=_['merge']({},_0x3e1a62,_0x45fb2a[_0x01eb('0x55')]);var _0x495103={'where':_0x3e1a62['where']};return db[_0x01eb('0x56')][_0x01eb('0x31')](_0x495103)[_0x01eb('0x3a')](function(_0x5a3271){_0x15e239[_0x01eb('0x31')]=_0x5a3271;if(_0x45fb2a[_0x01eb('0x47')][_0x01eb('0x57')]){_0x3e1a62[_0x01eb('0x58')]=[{'all':!![]}];}return db['SmsAccount'][_0x01eb('0x59')](_0x3e1a62);})[_0x01eb('0x3a')](function(_0x19ddec){_0x15e239[_0x01eb('0x5a')]=_0x19ddec;return _0x15e239;})[_0x01eb('0x3a')](respondWithFilteredResult(_0x31a918,_0x3e1a62))[_0x01eb('0x2b')](handleError(_0x31a918,null));};exports['show']=function(_0x1234cb,_0x254539){var _0xd34ca6={'raw':![],'where':{'id':_0x1234cb[_0x01eb('0x5b')]['id']},'include':[{'model':db[_0x01eb('0x40')],'as':_0x01eb('0x41')}]},_0x351322={};_0x351322['model']=_['keys'](db['SmsAccount'][_0x01eb('0x43')]);_0x351322[_0x01eb('0x47')]=_[_0x01eb('0x5c')](_0x1234cb[_0x01eb('0x47')]);_0x351322['filters']=_[_0x01eb('0x49')](_0x351322[_0x01eb('0x4a')],_0x351322[_0x01eb('0x47')]);_0xd34ca6[_0x01eb('0x4b')]=_[_0x01eb('0x49')](_0x351322[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x1234cb[_0x01eb('0x47')][_0x01eb('0x4c')]));_0xd34ca6[_0x01eb('0x4b')]=_0xd34ca6[_0x01eb('0x4b')][_0x01eb('0x5d')]?_0xd34ca6[_0x01eb('0x4b')]:_0x351322[_0x01eb('0x4a')];if(_0x1234cb[_0x01eb('0x47')]['includeAll']){_0xd34ca6[_0x01eb('0x58')]=[{'all':!![]}];}_0xd34ca6=_['merge']({},_0xd34ca6,_0x1234cb[_0x01eb('0x55')]);return db[_0x01eb('0x56')][_0x01eb('0x5e')](_0xd34ca6)[_0x01eb('0x3a')](handleEntityNotFound(_0x254539,null))[_0x01eb('0x3a')](respondWithResult(_0x254539,null))[_0x01eb('0x2b')](handleError(_0x254539,null));};exports['create']=function(_0x350df7,_0x4bb78c){return db[_0x01eb('0x56')][_0x01eb('0x5f')](_0x350df7[_0x01eb('0x60')],{})[_0x01eb('0x3a')](function(_0xc722b7){var _0x10e2ac=_0x350df7[_0x01eb('0x61')][_0x01eb('0x39')]({'plain':!![]});if(!_0x10e2ac)throw new Error(_0x01eb('0x62'));if(_0x10e2ac['role']==='user'){var _0x322fa3=_0xc722b7['get']({'plain':!![]});var _0x3b03bd=_0x01eb('0x63');return db[_0x01eb('0x64')][_0x01eb('0x5e')]({'where':{'name':_0x3b03bd,'userProfileId':_0x10e2ac[_0x01eb('0x65')]},'raw':!![]})['then'](function(_0x2bbbc2){if(_0x2bbbc2&&_0x2bbbc2[_0x01eb('0x66')]===0x0){return db['UserProfileResource'][_0x01eb('0x5f')]({'name':_0x322fa3['name'],'resourceId':_0x322fa3['id'],'type':_0x2bbbc2['name'],'sectionId':_0x2bbbc2['id']},{})['then'](function(){return _0xc722b7;});}else{return _0xc722b7;}})[_0x01eb('0x2b')](function(_0x454029){logger[_0x01eb('0x27')](_0x01eb('0x67'),_0x454029);throw _0x454029;});}return _0xc722b7;})['then'](respondWithResult(_0x4bb78c,0xc9))[_0x01eb('0x2b')](handleError(_0x4bb78c,null));};exports['update']=function(_0x59505b,_0x3c1629){if(_0x59505b[_0x01eb('0x60')]['id']){delete _0x59505b[_0x01eb('0x60')]['id'];}return db[_0x01eb('0x56')]['find']({'where':{'id':_0x59505b['params']['id']},'include':[{'model':db[_0x01eb('0x40')],'as':_0x01eb('0x41')}]})[_0x01eb('0x3a')](handleEntityNotFound(_0x3c1629,null))[_0x01eb('0x3a')](saveUpdates(_0x59505b[_0x01eb('0x60')],null))[_0x01eb('0x3a')](respondWithResult(_0x3c1629,null))['catch'](handleError(_0x3c1629,null));};exports[_0x01eb('0x38')]=function(_0x4cb0a2,_0xc356c4){return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x4cb0a2[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0xc356c4,null))[_0x01eb('0x3a')](removeEntity(_0xc356c4,null))[_0x01eb('0x2b')](handleError(_0xc356c4,null));};exports[_0x01eb('0x68')]=function(_0x113641,_0xf8b8e5){return db[_0x01eb('0x56')][_0x01eb('0x68')]()['then'](respondWithResult(_0xf8b8e5,null))[_0x01eb('0x2b')](handleError(_0xf8b8e5,null));};exports[_0x01eb('0x69')]=function(_0x5c3a5d,_0x30f62f,_0x15c792){if(_0x5c3a5d[_0x01eb('0x60')]['id']){delete _0x5c3a5d['body']['id'];}return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x5c3a5d[_0x01eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x30f62f,null))['then'](function(_0x5d883e){if(_0x5d883e){_0x5c3a5d[_0x01eb('0x60')][_0x01eb('0x6a')]=_0x5d883e['id'];return db['Disposition'][_0x01eb('0x5f')](_0x5c3a5d[_0x01eb('0x60')]);}})[_0x01eb('0x3a')](respondWithResult(_0x30f62f,null))[_0x01eb('0x2b')](handleError(_0x30f62f,null));};exports[_0x01eb('0x6b')]=function(_0x1cf2b9,_0x18a8b5,_0x17d919){var _0x4dd1e7={'raw':![],'where':{}};var _0x372800={};var _0x196bc3={'count':0x0,'rows':[]};return db['SmsAccount'][_0x01eb('0x6c')]({'where':{'id':_0x1cf2b9['params']['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x18a8b5,null))[_0x01eb('0x3a')](function(_0x102347){if(_0x102347){_0x372800[_0x01eb('0x4a')]=_[_0x01eb('0x5c')](db[_0x01eb('0x6d')][_0x01eb('0x43')]);_0x372800[_0x01eb('0x47')]=_[_0x01eb('0x5c')](_0x1cf2b9['query']);_0x372800[_0x01eb('0x48')]=_[_0x01eb('0x49')](_0x372800[_0x01eb('0x4a')],_0x372800[_0x01eb('0x47')]);_0x4dd1e7[_0x01eb('0x4b')]=_[_0x01eb('0x49')](_0x372800[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x4c')]));_0x4dd1e7['attributes']=_0x4dd1e7['attributes'][_0x01eb('0x5d')]?_0x4dd1e7['attributes']:_0x372800[_0x01eb('0x4a')];if(!_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x4d')](_0x01eb('0x4e'))){_0x4dd1e7[_0x01eb('0x30')]=qs[_0x01eb('0x30')](_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x30')]);_0x4dd1e7[_0x01eb('0x2f')]=qs[_0x01eb('0x2f')](_0x1cf2b9['query'][_0x01eb('0x2f')]);}_0x4dd1e7[_0x01eb('0x4f')]=qs[_0x01eb('0x50')](_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x50')]);_0x4dd1e7[_0x01eb('0x51')]=qs[_0x01eb('0x48')](_['pick'](_0x1cf2b9['query'],_0x372800[_0x01eb('0x48')]));_0x4dd1e7[_0x01eb('0x51')]['SmsAccountId']=_0x102347['id'];if(_0x1cf2b9[_0x01eb('0x47')]['filter']){_0x4dd1e7[_0x01eb('0x51')]=_['merge'](_0x4dd1e7[_0x01eb('0x51')],{'$or':_[_0x01eb('0x42')](_0x4dd1e7[_0x01eb('0x4b')],function(_0x1db13f){var _0x5c153a={};_0x5c153a[_0x1db13f]={'$like':'%'+_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x54')]+'%'};return _0x5c153a;})});}_0x4dd1e7=_[_0x01eb('0x52')]({},_0x4dd1e7,_0x1cf2b9['options']);return db[_0x01eb('0x6d')][_0x01eb('0x31')]({'where':_0x4dd1e7[_0x01eb('0x51')]})[_0x01eb('0x3a')](function(_0x3abbb5){_0x196bc3['count']=_0x3abbb5;if(_0x1cf2b9[_0x01eb('0x47')][_0x01eb('0x57')]){_0x4dd1e7[_0x01eb('0x58')]=[{'all':!![]}];}return db[_0x01eb('0x6d')]['findAll'](_0x4dd1e7);})[_0x01eb('0x3a')](function(_0x5a87c8){_0x196bc3[_0x01eb('0x5a')]=_0x5a87c8;return _0x196bc3;});}})[_0x01eb('0x3a')](respondWithFilteredResult(_0x18a8b5,_0x4dd1e7))['catch'](handleError(_0x18a8b5,null));};exports['removeDispositions']=function(_0x243288,_0x1b9358,_0x51fbc1){return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x243288[_0x01eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1b9358,null))['then'](function(_0x8bba24){if(_0x8bba24){return _0x8bba24[_0x01eb('0x6e')](_0x243288[_0x01eb('0x47')]['ids']);}})[_0x01eb('0x3a')](respondWithStatusCode(_0x1b9358,null))['catch'](handleError(_0x1b9358,null));};exports[_0x01eb('0x6f')]=function(_0x374be2,_0x2d9bac,_0xd9994f){if(_0x374be2[_0x01eb('0x60')]['id']){delete _0x374be2[_0x01eb('0x60')]['id'];}return db['SmsAccount'][_0x01eb('0x5e')]({'where':{'id':_0x374be2[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x2d9bac,null))[_0x01eb('0x3a')](function(_0x454d4f){if(_0x454d4f){_0x374be2[_0x01eb('0x60')]['SmsAccountId']=_0x454d4f['id'];return db[_0x01eb('0x70')]['create'](_0x374be2[_0x01eb('0x60')]);}})[_0x01eb('0x3a')](respondWithResult(_0x2d9bac,null))[_0x01eb('0x2b')](handleError(_0x2d9bac,null));};exports[_0x01eb('0x71')]=function(_0x5255aa,_0x42dd19,_0xea47c1){var _0x547c31={'raw':![],'where':{}};var _0x32fb3e={};var _0x1589d1={'count':0x0,'rows':[]};return db[_0x01eb('0x56')][_0x01eb('0x6c')]({'where':{'id':_0x5255aa[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x42dd19,null))[_0x01eb('0x3a')](function(_0x4ea1dd){if(_0x4ea1dd){_0x32fb3e[_0x01eb('0x4a')]=_['keys'](db[_0x01eb('0x70')][_0x01eb('0x43')]);_0x32fb3e[_0x01eb('0x47')]=_[_0x01eb('0x5c')](_0x5255aa[_0x01eb('0x47')]);_0x32fb3e[_0x01eb('0x48')]=_[_0x01eb('0x49')](_0x32fb3e[_0x01eb('0x4a')],_0x32fb3e[_0x01eb('0x47')]);_0x547c31['attributes']=_[_0x01eb('0x49')](_0x32fb3e[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x5255aa[_0x01eb('0x47')][_0x01eb('0x4c')]));_0x547c31['attributes']=_0x547c31[_0x01eb('0x4b')]['length']?_0x547c31[_0x01eb('0x4b')]:_0x32fb3e['model'];if(!_0x5255aa[_0x01eb('0x47')][_0x01eb('0x4d')](_0x01eb('0x4e'))){_0x547c31[_0x01eb('0x30')]=qs['limit'](_0x5255aa[_0x01eb('0x47')]['limit']);_0x547c31['offset']=qs['offset'](_0x5255aa[_0x01eb('0x47')]['offset']);}_0x547c31[_0x01eb('0x4f')]=qs[_0x01eb('0x50')](_0x5255aa[_0x01eb('0x47')][_0x01eb('0x50')]);_0x547c31['where']=qs[_0x01eb('0x48')](_[_0x01eb('0x72')](_0x5255aa[_0x01eb('0x47')],_0x32fb3e[_0x01eb('0x48')]));_0x547c31[_0x01eb('0x51')]['SmsAccountId']=_0x4ea1dd['id'];if(_0x5255aa['query']['filter']){_0x547c31[_0x01eb('0x51')]=_[_0x01eb('0x52')](_0x547c31[_0x01eb('0x51')],{'$or':_[_0x01eb('0x42')](_0x547c31['attributes'],function(_0x58fe10){var _0x5fac07={};_0x5fac07[_0x58fe10]={'$like':'%'+_0x5255aa[_0x01eb('0x47')][_0x01eb('0x54')]+'%'};return _0x5fac07;})});}_0x547c31=_[_0x01eb('0x52')]({},_0x547c31,_0x5255aa[_0x01eb('0x55')]);return db[_0x01eb('0x70')][_0x01eb('0x31')]({'where':_0x547c31['where']})[_0x01eb('0x3a')](function(_0x46d08f){_0x1589d1['count']=_0x46d08f;if(_0x5255aa[_0x01eb('0x47')][_0x01eb('0x57')]){_0x547c31['include']=[{'all':!![]}];}return db[_0x01eb('0x70')][_0x01eb('0x59')](_0x547c31);})[_0x01eb('0x3a')](function(_0x26df18){_0x1589d1[_0x01eb('0x5a')]=_0x26df18;return _0x1589d1;});}})[_0x01eb('0x3a')](respondWithFilteredResult(_0x42dd19,_0x547c31))[_0x01eb('0x2b')](handleError(_0x42dd19,null));};exports['removeAnswers']=function(_0x4f759d,_0x12d7e8,_0x248695){return db['SmsAccount'][_0x01eb('0x5e')]({'where':{'id':_0x4f759d['params']['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x12d7e8,null))[_0x01eb('0x3a')](function(_0x5e02a7){if(_0x5e02a7){return _0x5e02a7[_0x01eb('0x73')](_0x4f759d[_0x01eb('0x47')]['ids']);}})[_0x01eb('0x3a')](respondWithStatusCode(_0x12d7e8,null))[_0x01eb('0x2b')](handleError(_0x12d7e8,null));};exports[_0x01eb('0x74')]=function(_0x21742b,_0x37d311,_0x5a6f1c){var _0x34c32e={'channel':_0x01eb('0x75')};var _0x44f6c9=[];var _0x5e74bd=[];var _0x4cd938={};return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x21742b[_0x01eb('0x5b')]['id']},'include':[{'model':db[_0x01eb('0x76')],'as':_0x01eb('0x77')}]})[_0x01eb('0x3a')](handleEntityNotFound(_0x37d311,null))[_0x01eb('0x3a')](function(_0x291b6e){_0x34c32e[_0x01eb('0x78')]=_0x291b6e;_0x34c32e['applications']=_['orderBy'](_0x291b6e[_0x01eb('0x77')],[_0x01eb('0x79')],[_0x01eb('0x7a')]);if(_0x34c32e[_0x01eb('0x78')][_0x01eb('0x77')]){delete _0x34c32e[_0x01eb('0x78')][_0x01eb('0x77')];}return db[_0x01eb('0x7b')][_0x01eb('0x68')]();})['then'](function(_0x1baa70){if(!_0x1baa70){throw new db[(_0x01eb('0x7c'))][(_0x01eb('0x7d'))]('no\x20available\x20attributes');}_0x44f6c9=_['difference'](_['keys'](_0x1baa70),['createdAt',_0x01eb('0x7e')]);_0x5e74bd=_[_0x01eb('0x7f')](_[_0x01eb('0x5c')](_0x1baa70),[_0x01eb('0x80'),_0x01eb('0x7e'),_0x01eb('0x81'),'ListId']);_0x34c32e[_0x01eb('0x60')]={'mapKey':_0x01eb('0x82')};if(_0x34c32e[_0x01eb('0x78')][_0x01eb('0x45')]){switch(_0x34c32e[_0x01eb('0x78')][_0x01eb('0x45')]){case _0x01eb('0x83'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x85')];_0x34c32e['body'][_0x01eb('0x60')]=_0x21742b['body'][_0x01eb('0x86')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x87')]=_0x21742b['body'][_0x01eb('0x88')];break;case _0x01eb('0x89'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]='+'+_0x21742b['body'][_0x01eb('0x8a')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b['body'][_0x01eb('0x8b')];break;case _0x01eb('0x8c'):_0x34c32e['body'][_0x01eb('0x84')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x84')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x29')];break;case _0x01eb('0x8d'):_0x34c32e['body'][_0x01eb('0x84')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x84')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')]['body'];_0x34c32e['body'][_0x01eb('0x87')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x8e')];break;case _0x01eb('0x8f'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]=_0x21742b['body'][_0x01eb('0x85')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')]['Text'];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x87')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x90')];break;case _0x01eb('0x91'):_0x34c32e['body']['from']='+'+_0x21742b[_0x01eb('0x60')][_0x01eb('0x92')][0x0][_0x01eb('0x84')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x92')][0x0]['text'];_0x34c32e['body'][_0x01eb('0x87')]=_0x21742b[_0x01eb('0x60')]['results'][0x0]['messageId'];break;case _0x01eb('0x93'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]=_0x21742b['body'][_0x01eb('0x94')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x95')][_0x01eb('0x29')];break;case _0x01eb('0x96'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]=_0x21742b[_0x01eb('0x60')]['fromNumber'];_0x34c32e[_0x01eb('0x60')]['body']=_0x21742b[_0x01eb('0x60')][_0x01eb('0x8b')];_0x34c32e['body'][_0x01eb('0x87')]=_0x21742b['body']['replyMessageId'];break;case _0x01eb('0x97'):_0x34c32e[_0x01eb('0x60')][_0x01eb('0x87')]=_0x21742b[_0x01eb('0x60')][0x0][_0x01eb('0x29')]['id'];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')]=_0x21742b[_0x01eb('0x60')][0x0][_0x01eb('0x29')][_0x01eb('0x84')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')][0x0][_0x01eb('0x29')][_0x01eb('0x8b')];break;case _0x01eb('0x98'):_0x34c32e['body']['from']=_0x21742b[_0x01eb('0x60')][_0x01eb('0x84')];_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')]=_0x21742b[_0x01eb('0x60')][_0x01eb('0x29')];_0x34c32e['body']['messageId']=_0x21742b[_0x01eb('0x60')]['refid'];break;}}if(_0x34c32e['body']['id']){delete _0x34c32e[_0x01eb('0x60')]['id'];}if(_[_0x01eb('0x99')](_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')])){throw new db[(_0x01eb('0x7c'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x34c32e['body'][_0x01eb('0x60')])||_0x34c32e['body'][_0x01eb('0x60')]===''){throw new db[(_0x01eb('0x7c'))][(_0x01eb('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x01eb('0x99')](_0x34c32e['body'][_0x01eb('0x9a')])){throw new db[(_0x01eb('0x7c'))][(_0x01eb('0x7d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e74bd);}if(!_['includes'](_0x5e74bd,_0x34c32e['body'][_0x01eb('0x9a')])){throw new db[(_0x01eb('0x7c'))][(_0x01eb('0x7d'))](_0x01eb('0x9b')+_0x5e74bd);}_0x4cd938[_0x34c32e[_0x01eb('0x60')][_0x01eb('0x9a')]]=_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')];return db['CmList'][_0x01eb('0x5e')]({'where':{'id':_0x34c32e[_0x01eb('0x78')][_0x01eb('0x9c')]},'include':[{'model':db[_0x01eb('0x7b')],'as':_0x01eb('0x9d'),'where':_0x4cd938,'limit':0x1,'order':[['updatedAt',_0x01eb('0x9e')]]}]});})[_0x01eb('0x3a')](handleEntityNotFound(_0x37d311,null))[_0x01eb('0x3a')](function(_0x8a6c6f){if(_0x8a6c6f){_0x34c32e['list']=_[_0x01eb('0x9f')](_0x8a6c6f,[_0x01eb('0x9d')]);if(_0x8a6c6f[_0x01eb('0x9d')]['length']){return _0x8a6c6f[_0x01eb('0x9d')][0x0];}var _0x5345eb=_[_0x01eb('0xa0')](_0x34c32e[_0x01eb('0x60')],{'firstName':_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')],'ListId':_0x8a6c6f['id']});_0x5345eb[_0x34c32e[_0x01eb('0x60')]['mapKey']]=_0x34c32e['body'][_0x01eb('0x84')];return db[_0x01eb('0x7b')][_0x01eb('0x5f')](_0x5345eb,{'fields':_0x44f6c9,'raw':!![]});}})['then'](handleEntityNotFound(_0x37d311,null))[_0x01eb('0x3a')](function(_0x368da6){if(_0x368da6){_0x34c32e['contact']=_0x368da6;var _0x5dd94a={'ContactId':_0x368da6['id'],'phone':_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')],'SmsAccountId':_0x21742b[_0x01eb('0x5b')]['id']};var _0x5e6f09={'ContactId':_0x368da6['id'],'SmsAccountId':_0x21742b[_0x01eb('0x5b')]['id'],'closed':![]};return db[_0x01eb('0xa1')][_0x01eb('0x5e')]({'where':_0x5e6f09})[_0x01eb('0x3a')](function(_0x1c50ca){if(_0x1c50ca){return[_0x1c50ca,![]];}return db[_0x01eb('0xa1')][_0x01eb('0x5f')](_0x5dd94a)[_0x01eb('0x3a')](function(_0x2b14eb){return[_0x2b14eb,!![]];});});}})[_0x01eb('0xa2')](function(_0x11dbac,_0xbcd43b){_0x34c32e['interaction']=_0x11dbac['get']({'plain':!![]});_0x34c32e[_0x01eb('0xa3')][_0x01eb('0xa4')]=![];if(_0xbcd43b){if(_0x34c32e[_0x01eb('0x78')][_0x01eb('0xa5')]){_0x34c32e[_0x01eb('0xa6')][_0x01eb('0xa7')]({'id':0x0,'priority':_0x34c32e[_0x01eb('0xa6')][_0x01eb('0x5d')]+0x1,'app':_0x01eb('0xa8'),'appdata':_0x01eb('0xa9'),'interval':_0x01eb('0xaa')});}_0x34c32e[_0x01eb('0xa3')][_0x01eb('0xa4')]=!![];}return db[_0x01eb('0xab')]['create']({'phone':_0x34c32e[_0x01eb('0x60')][_0x01eb('0x84')],'messageId':_0x34c32e[_0x01eb('0x60')][_0x01eb('0x87')],'body':_0x34c32e[_0x01eb('0x60')][_0x01eb('0x60')],'SmsAccountId':_0x21742b[_0x01eb('0x5b')]['id'],'SmsInteractionId':_0x11dbac['id'],'direction':'in','ContactId':_0x11dbac['ContactId'],'AttachmentId':_0x34c32e['body'][_0x01eb('0xac')]});})['then'](function(_0x3e83ea){_0x34c32e[_0x01eb('0x29')]=_0x3e83ea;if(_0x34c32e[_0x01eb('0xa3')]['UserId']){return db[_0x01eb('0xad')]['find']({'attributes':['id',_0x01eb('0x3d')],'where':{'id':_0x34c32e['interaction'][_0x01eb('0xae')]}})['then'](function(_0x55cf3b){if(_0x55cf3b){_0x34c32e[_0x01eb('0xa6')][_0x01eb('0xaf')]({'id':0x0,'priority':0x0,'app':_0x01eb('0xb0'),'appdata':_0x55cf3b[_0x01eb('0x3d')]+','+(_0x34c32e['account']['waitForTheAssignedAgent']||0xa),'interval':_0x01eb('0xaa')});}return respondWithRpcPromise('Start',_0x01eb('0xb1'),_0x34c32e);});}return respondWithRpcPromise(_0x01eb('0xb2'),'startRouting',_0x34c32e);})['then'](function(_0xeb982a){if(_0xeb982a){var _0xfa48e5=0xc8;var _0xe5931d=_0x01eb('0xb3');logger['info'](_0x01eb('0x24'),_0xe5931d,_0xfa48e5,_0x01eb('0xb4'));logger['debug'](_0x01eb('0xb5'),_0xe5931d,_0xfa48e5,_0x01eb('0xb4'),JSON[_0x01eb('0x26')](_0xeb982a));if(_0x34c32e['account']['type']==='twilio'){return _0x37d311[_0x01eb('0x2c')](_0xfa48e5)[_0x01eb('0x32')](_0x01eb('0xb6'),_0x01eb('0xb7'))[_0x01eb('0x3e')](_0x01eb('0xb8'));}else{return _0x37d311[_0x01eb('0x2c')](_0xfa48e5)[_0x01eb('0x2e')](_0xeb982a);}}})[_0x01eb('0x2b')](handleError(_0x37d311,null));};exports[_0x01eb('0xb9')]=function(_0x1d287b,_0x3401cb){var _0x4a84f3=_0x1d287b[_0x01eb('0x5b')]['id'];var _0x335a14=_0x1d287b['body'];var _0x3baa3f=0xc8;var _0x31314c=null;return db['sequelize'][_0x01eb('0xba')]({'isolationLevel':db[_0x01eb('0xbb')]['Transaction']['ISOLATION_LEVELS'][_0x01eb('0xbc')]},function(_0x4af4f0){return db[_0x01eb('0x56')][_0x01eb('0x6c')]({'where':{'id':_0x4a84f3},'transaction':_0x4af4f0})[_0x01eb('0x3a')](function(_0x1b29c5){if(_0x1b29c5){return db[_0x01eb('0x76')][_0x01eb('0x38')]({'where':{'SmsAccountId':_0x4a84f3},'transaction':_0x4af4f0})[_0x01eb('0x3a')](function(){var _0x2c714f=_[_0x01eb('0x42')](_0x335a14,function(_0x398dc0){_0x398dc0[_0x01eb('0x6a')]=_0x4a84f3;return _0x398dc0;});return db['SmsApplication']['bulkCreate'](_0x2c714f,{'transaction':_0x4af4f0});});}else{_0x3baa3f=0x194;_0x31314c=[];}});})[_0x01eb('0x3a')](function(){if(_0x3baa3f!==0x194){return db[_0x01eb('0x76')]['findAndCountAll']({'where':{'SmsAccountId':_0x4a84f3},'order':'priority'})[_0x01eb('0x3a')](function(_0x5accae){_0x31314c=_0x5accae;});}})[_0x01eb('0x2b')](function(_0x5b8e2f){_0x3baa3f=0x1f4;logger[_0x01eb('0x27')](_0x5b8e2f[_0x01eb('0x3c')]);if(_0x5b8e2f['name']){delete _0x5b8e2f[_0x01eb('0x3d')];}_0x31314c=_0x5b8e2f;})[_0x01eb('0xbd')](function(){if(_0x31314c===null){_0x3401cb[_0x01eb('0x3b')](_0x3baa3f);}else{if(_0x3baa3f===0x1f4){_0x3401cb['status'](_0x3baa3f)[_0x01eb('0x3e')](_0x31314c);}else{_0x3401cb['status'](_0x3baa3f)[_0x01eb('0x2e')](_0x31314c);}}});};exports[_0x01eb('0xbe')]=function(_0x151b22,_0x5d9fcd,_0x370b69){var _0x186a34={};var _0x5b8b9f={};var _0x4860e3;var _0x3008ac;return db['SmsAccount']['findOne']({'where':{'id':_0x151b22[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x5d9fcd,null))[_0x01eb('0x3a')](function(_0x172b7e){if(_0x172b7e){_0x4860e3=_0x172b7e;_0x5b8b9f[_0x01eb('0x4a')]=_[_0x01eb('0x5c')](db[_0x01eb('0x76')][_0x01eb('0x43')]);_0x5b8b9f['query']=_['keys'](_0x151b22[_0x01eb('0x47')]);_0x5b8b9f[_0x01eb('0x48')]=_[_0x01eb('0x49')](_0x5b8b9f[_0x01eb('0x4a')],_0x5b8b9f[_0x01eb('0x47')]);_0x186a34[_0x01eb('0x4b')]=_['intersection'](_0x5b8b9f[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x151b22[_0x01eb('0x47')]['fields']));_0x186a34[_0x01eb('0x4b')]=_0x186a34[_0x01eb('0x4b')][_0x01eb('0x5d')]?_0x186a34[_0x01eb('0x4b')]:_0x5b8b9f[_0x01eb('0x4a')];_0x186a34[_0x01eb('0x4f')]=qs[_0x01eb('0x50')](_0x151b22[_0x01eb('0x47')]['sort']);_0x186a34[_0x01eb('0x51')]=qs[_0x01eb('0x48')](_['pick'](_0x151b22['query'],_0x5b8b9f['filters']));if(_0x151b22[_0x01eb('0x47')][_0x01eb('0x54')]){_0x186a34['where']=_['merge'](_0x186a34[_0x01eb('0x51')],{'$or':_[_0x01eb('0x42')](_0x186a34[_0x01eb('0x4b')],function(_0xd1fa){var _0x1a3a1d={};_0x1a3a1d[_0xd1fa]={'$like':'%'+_0x151b22[_0x01eb('0x47')]['filter']+'%'};return _0x1a3a1d;})});}_0x186a34=_['merge']({},_0x186a34,_0x151b22[_0x01eb('0x55')]);return _0x4860e3[_0x01eb('0xbe')](_0x186a34);}})[_0x01eb('0x3a')](function(_0x171213){if(_0x171213){_0x3008ac=_0x171213[_0x01eb('0x5d')];if(!_0x151b22[_0x01eb('0x47')]['hasOwnProperty'](_0x01eb('0x4e'))){_0x186a34[_0x01eb('0x30')]=qs['limit'](_0x151b22['query'][_0x01eb('0x30')]);_0x186a34[_0x01eb('0x2f')]=qs[_0x01eb('0x2f')](_0x151b22[_0x01eb('0x47')]['offset']);}return _0x4860e3[_0x01eb('0xbe')](_0x186a34);}})[_0x01eb('0x3a')](function(_0x3b2219){if(_0x3b2219){return _0x3b2219?{'count':_0x3008ac,'rows':_0x3b2219}:null;}})[_0x01eb('0x3a')](respondWithResult(_0x5d9fcd,null))['catch'](handleError(_0x5d9fcd,null));};exports[_0x01eb('0xbf')]=function(_0x5907a8,_0x2d63fd,_0xdecd2c){var _0x1faaba={'raw':![],'where':{}};var _0x4e6dda={};var _0x181c92={'count':0x0,'rows':[]};return db[_0x01eb('0x56')][_0x01eb('0x6c')]({'where':{'id':_0x5907a8['params']['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x2d63fd,null))[_0x01eb('0x3a')](function(_0x1e0f8b){if(_0x1e0f8b){_0x4e6dda['model']=_['keys'](db[_0x01eb('0xa1')]['rawAttributes']);_0x4e6dda[_0x01eb('0x47')]=_['keys'](_0x5907a8[_0x01eb('0x47')]);_0x4e6dda[_0x01eb('0x48')]=_[_0x01eb('0x49')](_0x4e6dda[_0x01eb('0x4a')],_0x4e6dda[_0x01eb('0x47')]);_0x1faaba['attributes']=_[_0x01eb('0x49')](_0x4e6dda[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x5907a8[_0x01eb('0x47')][_0x01eb('0x4c')]));_0x1faaba['attributes']=_0x1faaba[_0x01eb('0x4b')]['length']?_0x1faaba['attributes']:_0x4e6dda[_0x01eb('0x4a')];if(!_0x5907a8[_0x01eb('0x47')][_0x01eb('0x4d')](_0x01eb('0x4e'))){_0x1faaba[_0x01eb('0x30')]=qs[_0x01eb('0x30')](_0x5907a8[_0x01eb('0x47')]['limit']);_0x1faaba['offset']=qs[_0x01eb('0x2f')](_0x5907a8['query'][_0x01eb('0x2f')]);}_0x1faaba['order']=qs[_0x01eb('0x50')](_0x5907a8[_0x01eb('0x47')][_0x01eb('0x50')]);_0x1faaba['where']=qs['filters'](_[_0x01eb('0x72')](_0x5907a8['query'],_0x4e6dda[_0x01eb('0x48')]));_0x1faaba[_0x01eb('0x51')][_0x01eb('0x6a')]=_0x1e0f8b['id'];if(_0x5907a8['query'][_0x01eb('0x54')]){_0x1faaba[_0x01eb('0x51')]=_['merge'](_0x1faaba['where'],{'$or':_['map'](_0x1faaba[_0x01eb('0x4b')],function(_0x5ae3d3){var _0x4482f0={};_0x4482f0[_0x5ae3d3]={'$like':'%'+_0x5907a8['query']['filter']+'%'};return _0x4482f0;})});}_0x1faaba=_[_0x01eb('0x52')]({},_0x1faaba,_0x5907a8[_0x01eb('0x55')]);return db[_0x01eb('0xa1')][_0x01eb('0x31')]({'where':_0x1faaba['where']})[_0x01eb('0x3a')](function(_0x1cb762){_0x181c92['count']=_0x1cb762;if(_0x5907a8['query']['includeAll']){_0x1faaba[_0x01eb('0x58')]=[{'model':db[_0x01eb('0x7b')],'as':_0x01eb('0xc0'),'required':![]},{'model':db[_0x01eb('0xad')],'as':_0x01eb('0xc1'),'attributes':[_0x01eb('0x3d'),_0x01eb('0xc2'),'internal'],'required':![]},{'model':db[_0x01eb('0xc3')],'as':_0x01eb('0xc4'),'attributes':['id',_0x01eb('0x3d'),'color'],'where':_0x5907a8[_0x01eb('0x47')]['tag']?{'id':_0x5907a8['query']['tag']}:undefined,'required':_0x5907a8[_0x01eb('0x47')][_0x01eb('0xc5')]?!![]:![]}];}return db[_0x01eb('0xa1')][_0x01eb('0x59')](_0x1faaba);})[_0x01eb('0x3a')](function(_0xab3cae){_0x181c92[_0x01eb('0x5a')]=_0xab3cae;return _0x181c92;});}})[_0x01eb('0x3a')](respondWithFilteredResult(_0x2d63fd,_0x1faaba))['catch'](handleError(_0x2d63fd,null));};exports[_0x01eb('0x3e')]=function(_0x57cca7,_0x4fee8f,_0x53c4f4){var _0x5ddd12,_0x1d5b15,_0x316847;if(_[_0x01eb('0x99')](_0x57cca7[_0x01eb('0x60')][_0x01eb('0x60')])||_0x57cca7[_0x01eb('0x60')][_0x01eb('0x60')]===''){throw new db['Sequelize'][(_0x01eb('0x7d'))](_0x01eb('0xc6'));}if(_[_0x01eb('0x99')](_0x57cca7[_0x01eb('0x60')]['to'])){throw new db['Sequelize'][(_0x01eb('0x7d'))](_0x01eb('0xc7'));}_0x5ddd12=_0x57cca7[_0x01eb('0x60')]['to'];return db['SmsAccount'][_0x01eb('0x5e')]({'where':{'id':_0x57cca7[_0x01eb('0x5b')]['id']},'include':[{'model':db[_0x01eb('0xc8')],'as':_0x01eb('0xc9'),'include':[{'model':db['CmContact'],'as':_0x01eb('0x9d'),'where':{'mobile':_0x5ddd12},'limit':0x1,'order':[[_0x01eb('0x7e'),_0x01eb('0x9e')]]}]}]})[_0x01eb('0x3a')](handleEntityNotFound(_0x4fee8f,null))[_0x01eb('0x3a')](function(_0x2bc7b2){if(_0x2bc7b2&&_0x2bc7b2[_0x01eb('0xc9')]){_0x1d5b15=_0x2bc7b2['get']({'plain':!![]});if(_0x1d5b15[_0x01eb('0xc9')]&&_0x1d5b15[_0x01eb('0xc9')][_0x01eb('0x9d')]['length']){return _0x1d5b15[_0x01eb('0xc9')][_0x01eb('0x9d')][0x0];}return db[_0x01eb('0x7b')]['create'](_[_0x01eb('0xa0')](_0x57cca7[_0x01eb('0x60')],{'firstName':_0x5ddd12,'mobile':_0x5ddd12,'phone':_0x5ddd12,'ListId':_0x1d5b15[_0x01eb('0x9c')]}));}})[_0x01eb('0x3a')](handleEntityNotFound(_0x4fee8f,null))[_0x01eb('0x3a')](function(_0x1185dc){if(_0x1185dc){_0x316847=_0x1185dc;return db['SmsInteraction'][_0x01eb('0x5e')]({'where':{'ContactId':_0x316847['id'],'closed':![],'SmsAccountId':_0x1d5b15['id']}})[_0x01eb('0x3a')](function(_0x44a19d){if(_0x44a19d){return[_0x44a19d,![]];}return db[_0x01eb('0xa1')][_0x01eb('0x5f')]({'UserId':_0x57cca7[_0x01eb('0x61')]['id'],'ContactId':_0x316847['id'],'SmsAccountId':_0x1d5b15['id'],'phone':_0x5ddd12,'firstMsgDirection':_0x01eb('0xca'),'Messages':[_[_0x01eb('0x52')](_0x57cca7['body'],{'read':![],'body':_0x57cca7[_0x01eb('0x60')][_0x01eb('0x60')],'phone':_0x5ddd12,'SmsAccountId':_0x1d5b15['id'],'UserId':_0x57cca7[_0x01eb('0x61')]['id'],'ContactId':_0x316847['id']})]},{'include':[{'model':db[_0x01eb('0xab')],'as':_0x01eb('0xcb')}]})[_0x01eb('0x3a')](function(_0x398fd2){return[_0x398fd2,!![]];});});}})['spread'](function(_0x434ad5,_0x12275f){if(_0x12275f){return _0x434ad5;}return db[_0x01eb('0xab')][_0x01eb('0x5f')](_[_0x01eb('0x52')](_0x57cca7['body'],{'read':![],'body':_0x57cca7[_0x01eb('0x60')][_0x01eb('0x60')],'phone':_0x5ddd12,'SmsAccountId':_0x1d5b15['id'],'SmsInteractionId':_0x434ad5['id'],'UserId':_0x57cca7[_0x01eb('0x61')]['id'],'ContactId':_0x316847['id']}))[_0x01eb('0x3a')](function(_0x49336a){_0x434ad5['dataValues'][_0x01eb('0xcb')]=[];_0x434ad5['dataValues'][_0x01eb('0xcb')][_0x01eb('0xa7')](_0x49336a[_0x01eb('0xcc')]);return _0x434ad5;});})[_0x01eb('0x3a')](respondWithResult(_0x4fee8f,null))[_0x01eb('0x2b')](handleError(_0x4fee8f,null));};exports[_0x01eb('0x2c')]=function(_0x18abe4,_0x2a2ae5,_0x554a65){if(_0x18abe4[_0x01eb('0x60')]['id']){delete _0x18abe4[_0x01eb('0x60')]['id'];}var _0x4e44e6,_0x4e779c,_0x45a526;return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x18abe4[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x2a2ae5,null))[_0x01eb('0x3a')](function(_0x3f7a7d){if(_0x3f7a7d){_0x45a526=_0x3f7a7d;logger[_0x01eb('0x23')](_0x01eb('0x24'),_0x01eb('0x2c'),'received\x20delivery\x20report\x20from',_0x3f7a7d['type'],util[_0x01eb('0xcd')](_0x18abe4[_0x01eb('0x60')],{'showHidden':![],'depth':null}));switch(_0x3f7a7d[_0x01eb('0x45')]){case _0x01eb('0x89'):if(_0x18abe4[_0x01eb('0x60')]['skebby_dispatch_id']&&_0x18abe4['body'][_0x01eb('0x2c')]){_0x4e779c=_0x18abe4[_0x01eb('0x60')][_0x01eb('0x2c')];return db[_0x01eb('0xab')]['find']({'where':{'messageId':_0x18abe4[_0x01eb('0x60')]['skebby_dispatch_id']}});}break;case _0x01eb('0x8c'):if(_0x18abe4[_0x01eb('0x60')][_0x01eb('0xce')]&&_0x18abe4[_0x01eb('0x60')][_0x01eb('0xcf')]){_0x4e779c=_0x18abe4['body'][_0x01eb('0xcf')];return db[_0x01eb('0xab')][_0x01eb('0x5e')]({'where':{'messageId':_0x18abe4['body'][_0x01eb('0xce')]}});}break;case _0x01eb('0x8d'):if(_0x18abe4[_0x01eb('0x60')]['message_id']&&_0x18abe4[_0x01eb('0x60')][_0x01eb('0xd0')]){_0x4e779c=_0x18abe4[_0x01eb('0x60')][_0x01eb('0xd0')];return db[_0x01eb('0xab')]['find']({'where':{'messageId':_0x18abe4[_0x01eb('0x60')]['message_id']}});}break;case'infobip':var _0x42fb14=_0x18abe4[_0x01eb('0x60')][_0x01eb('0x92')][0x0];if(_0x42fb14[_0x01eb('0x87')]&&_0x42fb14['status']['groupName']===_0x01eb('0xd1')){_0x4e779c=_0x42fb14['status'][_0x01eb('0xd2')];return db[_0x01eb('0xab')][_0x01eb('0x5e')]({'where':{'messageId':_0x42fb14[_0x01eb('0x87')]}});}break;case _0x01eb('0x96'):if(_0x18abe4[_0x01eb('0x60')][_0x01eb('0x87')]&&_0x18abe4[_0x01eb('0x60')][_0x01eb('0x2c')]){_0x4e779c=_0x18abe4[_0x01eb('0x60')][_0x01eb('0x2c')];return db[_0x01eb('0xab')][_0x01eb('0x5e')]({'where':{'messageId':_0x18abe4['body'][_0x01eb('0x87')]}});}break;case _0x01eb('0x97'):if(_0x18abe4['body'][0x0][_0x01eb('0x29')]['id']){_0x4e779c=_0x18abe4[_0x01eb('0x60')][0x0][_0x01eb('0x45')];return db['SmsMessage'][_0x01eb('0x5e')]({'where':{'messageId':_0x18abe4[_0x01eb('0x60')][0x0][_0x01eb('0x29')]['id']}});}break;case _0x01eb('0x98'):if(_0x18abe4[_0x01eb('0x60')][_0x01eb('0xd3')]&&_0x18abe4[_0x01eb('0x60')]['status']){_0x4e779c=_0x18abe4[_0x01eb('0x60')][_0x01eb('0x2c')];return db[_0x01eb('0xab')][_0x01eb('0x5e')]({'where':{'messageId':_0x18abe4['body'][_0x01eb('0xd3')]}});}break;}}})[_0x01eb('0x3a')](handleEntityNotFound(_0x2a2ae5,null))[_0x01eb('0x3a')](function(_0x489369){if(_0x489369){_0x4e44e6=_0x489369;switch(_0x45a526['type']){case _0x01eb('0x89'):if(_0x4e779c===_0x01eb('0xd1')){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')](_0x01eb('0x24'),_0x01eb('0x2c'),_0x01eb('0x89'),util[_0x01eb('0xcd')](_0x18abe4[_0x01eb('0x60')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x4e779c==='1'){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')](_0x01eb('0x24'),_0x01eb('0x2c'),'skebby',util[_0x01eb('0xcd')](_0x18abe4[_0x01eb('0x60')],{'showHidden':![],'depth':null}));}break;case _0x01eb('0x8d'):if(!_0x18abe4['body'][_0x01eb('0xd4')]&&_0x4e779c>=0xc8&&_0x4e779c<=0xce){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x01eb('0x2c'),_0x01eb('0x8d'),util['inspect'](_0x18abe4['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x71ce0e=_0x18abe4[_0x01eb('0x60')][_0x01eb('0x92')][0x0];if(_0x71ce0e['status']['groupName']==='DELIVERED'){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x01eb('0x2c'),'infobip',util[_0x01eb('0xcd')](_0x18abe4[_0x01eb('0x60')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4e779c==_0x01eb('0xd5')||_0x4e779c==_0x01eb('0xd6')){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x01eb('0x2c'),'clickatell',util[_0x01eb('0xcd')](_0x18abe4[_0x01eb('0x60')],{'showHidden':![],'depth':null}));}break;case _0x01eb('0x97'):if(_0x4e779c==_0x01eb('0xd7')){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')](_0x01eb('0x24'),_0x01eb('0x2c'),_0x01eb('0x97'),util['inspect'](_0x18abe4['body'],{'showHidden':![],'depth':null}));}break;case _0x01eb('0x98'):if(_0x4e779c===_0x01eb('0xd8')||_0x4e779c===_0x01eb('0xd9')){return _0x4e44e6[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x01eb('0x2c'),_0x01eb('0x98'),util['inspect'](_0x18abe4['body'],{'showHidden':![],'depth':null}));}break;}return _0x4e44e6;}})[_0x01eb('0x3a')](respondWithResult(_0x2a2ae5,null))[_0x01eb('0x2b')](handleError(_0x2a2ae5,null));};exports[_0x01eb('0xda')]=function(_0x1bbd06,_0x5a1da9,_0x1e17b3){var _0x2f263a,_0x23a834,_0x43ea9f;return db['SmsAccount'][_0x01eb('0x5e')]({'where':{'id':_0x1bbd06[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x5a1da9,null))[_0x01eb('0x3a')](function(_0x37c889){if(_0x37c889){_0x43ea9f=_0x37c889;logger[_0x01eb('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x01eb('0x2c'),_0x01eb('0xdb'),_0x37c889[_0x01eb('0x45')],util['inspect'](_0x1bbd06[_0x01eb('0x47')],{'showHidden':![],'depth':null}));switch(_0x37c889[_0x01eb('0x45')]){case _0x01eb('0x93'):if(_0x1bbd06[_0x01eb('0x47')][_0x01eb('0xdc')]&&_0x1bbd06[_0x01eb('0x47')][_0x01eb('0xdd')]){_0x23a834=_0x1bbd06[_0x01eb('0x47')]['state'];return db[_0x01eb('0xab')][_0x01eb('0x5e')]({'where':{'messageId':_0x1bbd06['query'][_0x01eb('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x5a1da9,null))[_0x01eb('0x3a')](function(_0x3dc99e){if(_0x3dc99e){_0x2f263a=_0x3dc99e;switch(_0x43ea9f['type']){case _0x01eb('0x93'):if(_0x23a834==='2'||_0x23a834==='6'){return _0x2f263a[_0x01eb('0x37')]({'read':!![]});}else{logger[_0x01eb('0x27')](_0x01eb('0x24'),_0x01eb('0x2c'),'csc',util[_0x01eb('0xcd')](_0x1bbd06[_0x01eb('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x2f263a;}})[_0x01eb('0x3a')](respondWithResult(_0x5a1da9,null))[_0x01eb('0x2b')](handleError(_0x5a1da9,null));};exports['addAgents']=function(_0xe86a6c,_0x5f365d,_0x54385f){return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0xe86a6c[_0x01eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5f365d,null))[_0x01eb('0x3a')](function(_0x6b9834){if(_0x6b9834){return _0x6b9834[_0x01eb('0xde')](_0xe86a6c[_0x01eb('0x60')][_0x01eb('0xdf')],_[_0x01eb('0x9f')](_0xe86a6c[_0x01eb('0x60')],['ids','id'])||{})['spread'](function(_0x41c226){for(var _0x40ac67=0x0;_0x40ac67<_0xe86a6c[_0x01eb('0x60')][_0x01eb('0xdf')]['length'];_0x40ac67+=0x1){socket[_0x01eb('0xe0')](_0x01eb('0xe1'),{'UserId':Number(_0xe86a6c[_0x01eb('0x60')]['ids'][_0x40ac67]),'SmsAccountId':Number(_0xe86a6c['params']['id'])});}return _0x41c226;});}})[_0x01eb('0x3a')](respondWithResult(_0x5f365d,null))[_0x01eb('0x2b')](handleError(_0x5f365d,null));};exports['removeAgents']=function(_0x53fa58,_0x495df7,_0x110c6c){return db[_0x01eb('0x56')][_0x01eb('0x5e')]({'where':{'id':_0x53fa58[_0x01eb('0x5b')]['id']}})[_0x01eb('0x3a')](handleEntityNotFound(_0x495df7,null))[_0x01eb('0x3a')](function(_0x58b892){if(_0x58b892){return _0x58b892[_0x01eb('0xe2')](_0x53fa58[_0x01eb('0x47')][_0x01eb('0xdf')])['then'](function(){if(_[_0x01eb('0xe3')](_0x53fa58['query'][_0x01eb('0xdf')])){for(var _0x309ff1=0x0;_0x309ff1<_0x53fa58[_0x01eb('0x47')][_0x01eb('0xdf')][_0x01eb('0x5d')];_0x309ff1+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x53fa58[_0x01eb('0x47')][_0x01eb('0xdf')][_0x309ff1]),'SmsAccountId':Number(_0x53fa58[_0x01eb('0x5b')]['id'])});}}else{socket[_0x01eb('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x53fa58[_0x01eb('0x47')][_0x01eb('0xdf')]),'SmsAccountId':Number(_0x53fa58[_0x01eb('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x495df7,null))[_0x01eb('0x2b')](handleError(_0x495df7,null));};exports[_0x01eb('0xe4')]=function(_0x14cf91,_0x1c5a22,_0x2e856e){var _0x59abdc={};var _0x2d5857={};var _0x35ec99;var _0x309919;return db[_0x01eb('0x56')][_0x01eb('0x6c')]({'where':{'id':_0x14cf91[_0x01eb('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1c5a22,null))[_0x01eb('0x3a')](function(_0x30b6d0){if(_0x30b6d0){_0x35ec99=_0x30b6d0;_0x2d5857['model']=_[_0x01eb('0x5c')](db[_0x01eb('0xad')][_0x01eb('0x43')]);_0x2d5857[_0x01eb('0x47')]=_[_0x01eb('0x5c')](_0x14cf91['query']);_0x2d5857[_0x01eb('0x48')]=_['intersection'](_0x2d5857[_0x01eb('0x4a')],_0x2d5857['query']);_0x59abdc[_0x01eb('0x4b')]=_[_0x01eb('0x49')](_0x2d5857[_0x01eb('0x4a')],qs[_0x01eb('0x4c')](_0x14cf91[_0x01eb('0x47')][_0x01eb('0x4c')]));_0x59abdc['attributes']=_0x59abdc[_0x01eb('0x4b')]['length']?_0x59abdc[_0x01eb('0x4b')]:_0x2d5857[_0x01eb('0x4a')];_0x59abdc[_0x01eb('0x4f')]=qs[_0x01eb('0x50')](_0x14cf91[_0x01eb('0x47')]['sort']);_0x59abdc[_0x01eb('0x51')]=qs[_0x01eb('0x48')](_['pick'](_0x14cf91[_0x01eb('0x47')],_0x2d5857[_0x01eb('0x48')]));if(_0x14cf91[_0x01eb('0x47')]['filter']){_0x59abdc[_0x01eb('0x51')]=_[_0x01eb('0x52')](_0x59abdc['where'],{'$or':_[_0x01eb('0x42')](_0x59abdc[_0x01eb('0x4b')],function(_0x2d5c56){var _0x507014={};_0x507014[_0x2d5c56]={'$like':'%'+_0x14cf91['query'][_0x01eb('0x54')]+'%'};return _0x507014;})});}_0x59abdc=_[_0x01eb('0x52')]({},_0x59abdc,_0x14cf91[_0x01eb('0x55')]);return _0x35ec99[_0x01eb('0xe4')](_0x59abdc);}})[_0x01eb('0x3a')](function(_0x38f682){if(_0x38f682){_0x309919=_0x38f682['length'];if(!_0x14cf91['query']['hasOwnProperty'](_0x01eb('0x4e'))){_0x59abdc['limit']=qs['limit'](_0x14cf91[_0x01eb('0x47')][_0x01eb('0x30')]);_0x59abdc['offset']=qs[_0x01eb('0x2f')](_0x14cf91[_0x01eb('0x47')][_0x01eb('0x2f')]);}return _0x35ec99[_0x01eb('0xe4')](_0x59abdc);}})[_0x01eb('0x3a')](function(_0x43f23e){if(_0x43f23e){return _0x43f23e?{'count':_0x309919,'rows':_0x43f23e}:null;}})[_0x01eb('0x3a')](respondWithResult(_0x1c5a22,null))[_0x01eb('0x2b')](handleError(_0x1c5a22,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 7246e41..75d8ef8 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 _0x7da0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x443bdf,_0x2dea9c){var _0x2d1684=function(_0x3b361c){while(--_0x3b361c){_0x443bdf['push'](_0x443bdf['shift']());}};_0x2d1684(++_0x2dea9c);}(_0x7da0,0x9a));var _0x07da=function(_0x47ae9a,_0x11e77e){_0x47ae9a=_0x47ae9a-0x0;var _0x3820e4=_0x7da0[_0x47ae9a];return _0x3820e4;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x07da('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x07da('0x1'),'afterDestroy':_0x07da('0x2')};function emitEvent(_0x4e63c7){return function(_0x7c90ee,_0x59163f,_0x265dc7){SmsAccountEvents['emit'](_0x4e63c7+':'+_0x7c90ee['id'],_0x7c90ee);SmsAccountEvents[_0x07da('0x3')](_0x4e63c7,_0x7c90ee);_0x265dc7(null);};}for(var e in events){if(events[_0x07da('0x4')](e)){var event=events[e];SmsAccount[_0x07da('0x5')](e,emitEvent(event));}}module[_0x07da('0x6')]=SmsAccountEvents; \ No newline at end of file +var _0x0983=['hook','exports','events','SmsAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x433ab5,_0x16e711){var _0x315911=function(_0x2d24a2){while(--_0x2d24a2){_0x433ab5['push'](_0x433ab5['shift']());}};_0x315911(++_0x16e711);}(_0x0983,0x16a));var _0x3098=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0983[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x3098('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x3098('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3098('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3098('0x3'),'afterDestroy':'remove'};function emitEvent(_0x146ad4){return function(_0x1490d9,_0x3ae967,_0x3ed8cc){SmsAccountEvents[_0x3098('0x4')](_0x146ad4+':'+_0x1490d9['id'],_0x1490d9);SmsAccountEvents['emit'](_0x146ad4,_0x1490d9);_0x3ed8cc(null);};}for(var e in events){if(events[_0x3098('0x5')](e)){var event=events[e];SmsAccount[_0x3098('0x6')](e,emitEvent(event));}}module[_0x3098('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 5b2bb42..1d9062b 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 _0xadb1=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','rimraf','./smsAccount.attributes','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xadb1,0x1bb));var _0x1adb=function(_0x1ed016,_0x1102c7){_0x1ed016=_0x1ed016-0x0;var _0x507d36=_0xadb1[_0x1ed016];return _0x507d36;};'use strict';var _=require(_0x1adb('0x0'));var util=require(_0x1adb('0x1'));var logger=require(_0x1adb('0x2'))(_0x1adb('0x3'));var moment=require(_0x1adb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1adb('0x5'));var config=require('../../config/environment');var attributes=require(_0x1adb('0x6'));module[_0x1adb('0x7')]=function(_0x182ef9,_0x5f1209){return _0x182ef9[_0x1adb('0x8')](_0x1adb('0x9'),attributes,{'tableName':_0x1adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd27c=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','api','moment'];(function(_0xd8a3c1,_0x5780bd){var _0x28cad0=function(_0x51850f){while(--_0x51850f){_0xd8a3c1['push'](_0xd8a3c1['shift']());}};_0x28cad0(++_0x5780bd);}(_0xd27c,0x1e8));var _0xcd27=function(_0x411069,_0x16ae05){_0x411069=_0x411069-0x0;var _0x68c645=_0xd27c[_0x411069];return _0x68c645;};'use strict';var _=require(_0xcd27('0x0'));var util=require(_0xcd27('0x1'));var logger=require('../../config/logger')(_0xcd27('0x2'));var moment=require(_0xcd27('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd27('0x4'));var fs=require('fs');var path=require(_0xcd27('0x5'));var rimraf=require(_0xcd27('0x6'));var config=require(_0xcd27('0x7'));var attributes=require(_0xcd27('0x8'));module['exports']=function(_0x42911e,_0x3f8fef){return _0x42911e[_0xcd27('0x9')](_0xcd27('0xa'),attributes,{'tableName':_0xcd27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 4e27b17..060e1db 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 _0x6923=['socket.io-emitter','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x13169c,_0x2c2300){var _0x1cc09e=function(_0x4c6dbe){while(--_0x4c6dbe){_0x13169c['push'](_0x13169c['shift']());}};_0x1cc09e(++_0x2c2300);}(_0x6923,0xcb));var _0x3692=function(_0x4336df,_0x3a0320){_0x4336df=_0x4336df-0x0;var _0x5c2607=_0x6923[_0x4336df];return _0x5c2607;};'use strict';var _=require(_0x3692('0x0'));var util=require('util');var moment=require(_0x3692('0x1'));var BPromise=require(_0x3692('0x2'));var rs=require(_0x3692('0x3'));var fs=require('fs');var Redis=require(_0x3692('0x4'));var db=require(_0x3692('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3692('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3692('0x7'));var client=jayson[_0x3692('0x8')][_0x3692('0x9')]({'port':0x232a});config[_0x3692('0xa')]=_[_0x3692('0xb')](config['redis'],{'host':_0x3692('0xc'),'port':0x18eb});var socket=require(_0x3692('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x31eec5,_0x30414d,_0x451a19){return new BPromise(function(_0x4a3822,_0x15c156){return client[_0x3692('0xe')](_0x31eec5,_0x451a19)[_0x3692('0xf')](function(_0x28cb48){logger['info']('SmsAccount,\x20%s,\x20%s',_0x30414d,_0x3692('0x10'));logger[_0x3692('0x11')](_0x3692('0x12'),_0x30414d,_0x3692('0x10'),JSON[_0x3692('0x13')](_0x28cb48));if(_0x28cb48['error']){if(_0x28cb48[_0x3692('0x14')][_0x3692('0x15')]===0x1f4){logger[_0x3692('0x14')](_0x3692('0x16'),_0x30414d,_0x28cb48['error']['message']);return _0x15c156(_0x28cb48[_0x3692('0x14')][_0x3692('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x30414d,_0x28cb48[_0x3692('0x14')][_0x3692('0x17')]);return _0x4a3822(_0x28cb48['error'][_0x3692('0x17')]);}else{logger[_0x3692('0x18')](_0x3692('0x16'),_0x30414d,_0x3692('0x10'));_0x4a3822(_0x28cb48[_0x3692('0x19')]['message']);}})['catch'](function(_0x383ef7){logger['error'](_0x3692('0x16'),_0x30414d,_0x383ef7);_0x15c156(_0x383ef7);});});}exports[_0x3692('0x1a')]=function(_0x329156){var _0x5959bc=this;return new Promise(function(_0x49a297,_0x2b35ce){return db['SmsAccount'][_0x3692('0x1b')]({'raw':_0x329156[_0x3692('0x1c')]?_0x329156['options'][_0x3692('0x1d')]===undefined?!![]:![]:!![],'where':_0x329156[_0x3692('0x1c')]?_0x329156[_0x3692('0x1c')][_0x3692('0x1e')]||null:null,'attributes':_0x329156[_0x3692('0x1c')]?_0x329156['options'][_0x3692('0x1f')]||null:null,'include':_0x329156['options']?_0x329156['options'][_0x3692('0x20')]?_[_0x3692('0x21')](_0x329156[_0x3692('0x1c')]['include'],function(_0x20fa40){return{'model':db[_0x20fa40[_0x3692('0x22')]],'as':_0x20fa40['as'],'attributes':_0x20fa40[_0x3692('0x1f')],'include':_0x20fa40['include']?_[_0x3692('0x21')](_0x20fa40['include'],function(_0x59c87d){return{'model':db[_0x59c87d[_0x3692('0x22')]],'as':_0x59c87d['as'],'attributes':_0x59c87d[_0x3692('0x1f')],'include':_0x59c87d[_0x3692('0x20')]?_[_0x3692('0x21')](_0x59c87d['include'],function(_0x3c5825){return{'model':db[_0x3c5825[_0x3692('0x22')]],'as':_0x3c5825['as'],'attributes':_0x3c5825[_0x3692('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3692('0xf')](function(_0x7dd4c8){logger['info']('ShowSmsAccount',_0x329156);logger[_0x3692('0x11')](_0x3692('0x1a'),_0x329156,JSON['stringify'](_0x7dd4c8));_0x49a297(_0x7dd4c8);})[_0x3692('0x23')](function(_0x4725bf){logger['error'](_0x3692('0x1a'),_0x4725bf[_0x3692('0x17')],_0x329156);_0x2b35ce(_0x5959bc[_0x3692('0x14')](0x1f4,_0x4725bf[_0x3692('0x17')]));});});}; \ No newline at end of file +var _0x1334=['map','model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','raw','where','include'];(function(_0x279918,_0x50c942){var _0x43db3e=function(_0x4fe927){while(--_0x4fe927){_0x279918['push'](_0x279918['shift']());}};_0x43db3e(++_0x50c942);}(_0x1334,0xa0));var _0x4133=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x1334[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x4133('0x0'));var util=require(_0x4133('0x1'));var moment=require(_0x4133('0x2'));var BPromise=require(_0x4133('0x3'));var rs=require(_0x4133('0x4'));var fs=require('fs');var Redis=require(_0x4133('0x5'));var db=require(_0x4133('0x6'))['db'];var utils=require(_0x4133('0x7'));var logger=require(_0x4133('0x8'))('rpc');var config=require(_0x4133('0x9'));var jayson=require(_0x4133('0xa'));var client=jayson[_0x4133('0xb')][_0x4133('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4133('0xd')],{'host':_0x4133('0xe'),'port':0x18eb});var socket=require(_0x4133('0xf'))(new Redis(config[_0x4133('0xd')]));require(_0x4133('0x10'))['register'](socket);function respondWithRpcPromise(_0x3cfbcc,_0x3ecdfb,_0x4b7fa0){return new BPromise(function(_0xa5c5bd,_0x265e52){return client[_0x4133('0x11')](_0x3cfbcc,_0x4b7fa0)['then'](function(_0x38d0d5){logger[_0x4133('0x12')](_0x4133('0x13'),_0x3ecdfb,_0x4133('0x14'));logger[_0x4133('0x15')](_0x4133('0x16'),_0x3ecdfb,_0x4133('0x14'),JSON[_0x4133('0x17')](_0x38d0d5));if(_0x38d0d5[_0x4133('0x18')]){if(_0x38d0d5['error'][_0x4133('0x19')]===0x1f4){logger[_0x4133('0x18')](_0x4133('0x13'),_0x3ecdfb,_0x38d0d5[_0x4133('0x18')][_0x4133('0x1a')]);return _0x265e52(_0x38d0d5[_0x4133('0x18')][_0x4133('0x1a')]);}logger[_0x4133('0x18')]('SmsAccount,\x20%s,\x20%s',_0x3ecdfb,_0x38d0d5['error']['message']);return _0xa5c5bd(_0x38d0d5[_0x4133('0x18')][_0x4133('0x1a')]);}else{logger[_0x4133('0x12')]('SmsAccount,\x20%s,\x20%s',_0x3ecdfb,_0x4133('0x14'));_0xa5c5bd(_0x38d0d5[_0x4133('0x1b')][_0x4133('0x1a')]);}})[_0x4133('0x1c')](function(_0x4ea119){logger[_0x4133('0x18')](_0x4133('0x13'),_0x3ecdfb,_0x4ea119);_0x265e52(_0x4ea119);});});}exports[_0x4133('0x1d')]=function(_0x59a788){var _0x16faae=this;return new Promise(function(_0x1ae6e4,_0x5de86e){return db['SmsAccount'][_0x4133('0x1e')]({'raw':_0x59a788[_0x4133('0x1f')]?_0x59a788[_0x4133('0x1f')][_0x4133('0x20')]===undefined?!![]:![]:!![],'where':_0x59a788[_0x4133('0x1f')]?_0x59a788['options'][_0x4133('0x21')]||null:null,'attributes':_0x59a788[_0x4133('0x1f')]?_0x59a788[_0x4133('0x1f')]['attributes']||null:null,'include':_0x59a788[_0x4133('0x1f')]?_0x59a788[_0x4133('0x1f')][_0x4133('0x22')]?_[_0x4133('0x23')](_0x59a788[_0x4133('0x1f')][_0x4133('0x22')],function(_0x555d24){return{'model':db[_0x555d24[_0x4133('0x24')]],'as':_0x555d24['as'],'attributes':_0x555d24[_0x4133('0x25')],'include':_0x555d24[_0x4133('0x22')]?_[_0x4133('0x23')](_0x555d24[_0x4133('0x22')],function(_0x3c10d2){return{'model':db[_0x3c10d2[_0x4133('0x24')]],'as':_0x3c10d2['as'],'attributes':_0x3c10d2['attributes'],'include':_0x3c10d2[_0x4133('0x22')]?_[_0x4133('0x23')](_0x3c10d2[_0x4133('0x22')],function(_0x1c5407){return{'model':db[_0x1c5407[_0x4133('0x24')]],'as':_0x1c5407['as'],'attributes':_0x1c5407[_0x4133('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4133('0x26')](function(_0x3ff28f){logger[_0x4133('0x12')](_0x4133('0x1d'),_0x59a788);logger['debug'](_0x4133('0x1d'),_0x59a788,JSON['stringify'](_0x3ff28f));_0x1ae6e4(_0x3ff28f);})['catch'](function(_0x2d31e5){logger[_0x4133('0x18')](_0x4133('0x1d'),_0x2d31e5[_0x4133('0x1a')],_0x59a788);_0x5de86e(_0x16faae[_0x4133('0x18')](0x1f4,_0x2d31e5[_0x4133('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8644325..0169015 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 b3fd88e..76f4981 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a8bca,_0x675137){var _0x5a2703=function(_0xfd4bf8){while(--_0xfd4bf8){_0x5a8bca['push'](_0x5a8bca['shift']());}};_0x5a2703(++_0x675137);}(_0x34e8,0x12c));var _0x834e=function(_0x12aae6,_0x1b878a){_0x12aae6=_0x12aae6-0x0;var _0x47acf9=_0x34e8[_0x12aae6];return _0x47acf9;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x1b9edd,_0x66b166){var _0x4907c4=function(_0x538091){while(--_0x538091){_0x1b9edd['push'](_0x1b9edd['shift']());}};_0x4907c4(++_0x66b166);}(_0x3e74,0x175));var _0x43e7=function(_0x2b60d1,_0x2cd09b){_0x2b60d1=_0x2b60d1-0x0;var _0x175aaa=_0x3e74[_0x2b60d1];return _0x175aaa;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ffc1c86..3c9468e 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 _0x6251=['STRING','*,*,*,*','sequelize','noop','TEXT'];(function(_0x4692df,_0x274c73){var _0x581e45=function(_0x17ba15){while(--_0x17ba15){_0x4692df['push'](_0x4692df['shift']());}};_0x581e45(++_0x274c73);}(_0x6251,0xde));var _0x1625=function(_0x56260c,_0x3594bc){_0x56260c=_0x56260c-0x0;var _0x3293b9=_0x6251[_0x56260c];return _0x3293b9;};'use strict';var Sequelize=require(_0x1625('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1625('0x1')},'appdata':{'type':Sequelize[_0x1625('0x2')]()},'description':{'type':Sequelize[_0x1625('0x3')]},'interval':{'type':Sequelize[_0x1625('0x3')],'defaultValue':_0x1625('0x4')}}; \ No newline at end of file +var _0xb9cd=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x523253,_0x3088fb){var _0x465889=function(_0x4c4c54){while(--_0x4c4c54){_0x523253['push'](_0x523253['shift']());}};_0x465889(++_0x3088fb);}(_0xb9cd,0x1e6));var _0xdb9c=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0xb9cd[_0x99868f];return _0x27a71b;};'use strict';var Sequelize=require(_0xdb9c('0x0'));module[_0xdb9c('0x1')]={'priority':{'type':Sequelize[_0xdb9c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdb9c('0x3')],'allowNull':![],'defaultValue':_0xdb9c('0x4')},'appdata':{'type':Sequelize[_0xdb9c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xdb9c('0x3')],'defaultValue':_0xdb9c('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9a5d50e..3912634 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 _0xcdf4=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','SmsApplication','includeAll','rows','show','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x20bedd,_0x39694b){var _0x3041f3=function(_0x1f53ee){while(--_0x1f53ee){_0x20bedd['push'](_0x20bedd['shift']());}};_0x3041f3(++_0x39694b);}(_0xcdf4,0x1b9));var _0x4cdf=function(_0x164b98,_0xe91fad){_0x164b98=_0x164b98-0x0;var _0x53e8f8=_0xcdf4[_0x164b98];return _0x53e8f8;};'use strict';var emlformat=require(_0x4cdf('0x0'));var rimraf=require(_0x4cdf('0x1'));var zipdir=require(_0x4cdf('0x2'));var jsonpatch=require(_0x4cdf('0x3'));var rp=require('request-promise');var moment=require(_0x4cdf('0x4'));var BPromise=require(_0x4cdf('0x5'));var Mustache=require(_0x4cdf('0x6'));var util=require(_0x4cdf('0x7'));var path=require(_0x4cdf('0x8'));var sox=require('sox');var csv=require(_0x4cdf('0x9'));var ejs=require(_0x4cdf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cdf('0xb'));var squel=require(_0x4cdf('0xc'));var crypto=require(_0x4cdf('0xd'));var jsforce=require(_0x4cdf('0xe'));var deskjs=require(_0x4cdf('0xf'));var toCsv=require(_0x4cdf('0x9'));var querystring=require(_0x4cdf('0x10'));var Papa=require(_0x4cdf('0x11'));var Redis=require(_0x4cdf('0x12'));var authService=require(_0x4cdf('0x13'));var qs=require(_0x4cdf('0x14'));var as=require(_0x4cdf('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cdf('0x16'))(_0x4cdf('0x17'));var utils=require(_0x4cdf('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4cdf('0x19'));var db=require(_0x4cdf('0x1a'))['db'];function respondWithStatusCode(_0x5088a6,_0x1674c7){_0x1674c7=_0x1674c7||0xcc;return function(_0x492a62){if(_0x492a62){return _0x5088a6[_0x4cdf('0x1b')](_0x1674c7);}return _0x5088a6['status'](_0x1674c7)['end']();};}function respondWithResult(_0x55e003,_0x5f0a12){_0x5f0a12=_0x5f0a12||0xc8;return function(_0x2daab8){if(_0x2daab8){return _0x55e003[_0x4cdf('0x1c')](_0x5f0a12)[_0x4cdf('0x1d')](_0x2daab8);}};}function respondWithFilteredResult(_0x2f7d29,_0x28ba89){return function(_0x563c8c){if(_0x563c8c){var _0x1c1e46=typeof _0x28ba89[_0x4cdf('0x1e')]===_0x4cdf('0x1f')&&typeof _0x28ba89[_0x4cdf('0x20')]===_0x4cdf('0x1f');var _0x58a6ae=_0x563c8c['count'];var _0x28c62c=_0x1c1e46?0x0:_0x28ba89['offset'];var _0xb21263=_0x1c1e46?_0x563c8c[_0x4cdf('0x21')]:_0x28ba89['offset']+_0x28ba89[_0x4cdf('0x20')];var _0x376eae;if(_0xb21263>=_0x58a6ae){_0xb21263=_0x58a6ae;_0x376eae=0xc8;}else{_0x376eae=0xce;}_0x2f7d29['status'](_0x376eae);return _0x2f7d29[_0x4cdf('0x22')](_0x4cdf('0x23'),_0x28c62c+'-'+_0xb21263+'/'+_0x58a6ae)['json'](_0x563c8c);}return null;};}function patchUpdates(_0xfe15a9){return function(_0x517e18){try{jsonpatch[_0x4cdf('0x24')](_0x517e18,_0xfe15a9,!![]);}catch(_0x47cb50){return BPromise[_0x4cdf('0x25')](_0x47cb50);}return _0x517e18[_0x4cdf('0x26')]();};}function saveUpdates(_0x56e2d8,_0x464b11){return function(_0x17eaeb){if(_0x17eaeb){return _0x17eaeb[_0x4cdf('0x27')](_0x56e2d8)[_0x4cdf('0x28')](function(_0x140fc3){return _0x140fc3;});}return null;};}function removeEntity(_0x238d8d,_0x32b8a0){return function(_0x26801d){if(_0x26801d){return _0x26801d[_0x4cdf('0x29')]()['then'](function(){_0x238d8d['status'](0xcc)[_0x4cdf('0x2a')]();});}};}function handleEntityNotFound(_0x9c1384,_0x5085cd){return function(_0x20a0a8){if(!_0x20a0a8){_0x9c1384[_0x4cdf('0x1b')](0x194);}return _0x20a0a8;};}function handleError(_0x974618,_0x101de4){_0x101de4=_0x101de4||0x1f4;return function(_0x2de4ed){logger[_0x4cdf('0x2b')](_0x2de4ed[_0x4cdf('0x2c')]);if(_0x2de4ed[_0x4cdf('0x2d')]){delete _0x2de4ed[_0x4cdf('0x2d')];}_0x974618[_0x4cdf('0x1c')](_0x101de4)[_0x4cdf('0x2e')](_0x2de4ed);};}exports[_0x4cdf('0x2f')]=function(_0x149849,_0x30e3d9){var _0x3289a5={},_0x2c538b={},_0xce246a={'count':0x0,'rows':[]};var _0x5e2a0d=_[_0x4cdf('0x30')](db['SmsApplication'][_0x4cdf('0x31')],function(_0x5241fa){return{'name':_0x5241fa[_0x4cdf('0x32')],'type':_0x5241fa[_0x4cdf('0x33')][_0x4cdf('0x34')]};});_0x2c538b[_0x4cdf('0x35')]=_[_0x4cdf('0x30')](_0x5e2a0d,_0x4cdf('0x2d'));_0x2c538b[_0x4cdf('0x36')]=_[_0x4cdf('0x37')](_0x149849[_0x4cdf('0x36')]);_0x2c538b['filters']=_[_0x4cdf('0x38')](_0x2c538b[_0x4cdf('0x35')],_0x2c538b[_0x4cdf('0x36')]);_0x3289a5[_0x4cdf('0x39')]=_[_0x4cdf('0x38')](_0x2c538b[_0x4cdf('0x35')],qs[_0x4cdf('0x3a')](_0x149849[_0x4cdf('0x36')][_0x4cdf('0x3a')]));_0x3289a5[_0x4cdf('0x39')]=_0x3289a5[_0x4cdf('0x39')][_0x4cdf('0x3b')]?_0x3289a5['attributes']:_0x2c538b[_0x4cdf('0x35')];if(!_0x149849[_0x4cdf('0x36')][_0x4cdf('0x3c')](_0x4cdf('0x3d'))){_0x3289a5[_0x4cdf('0x20')]=qs[_0x4cdf('0x20')](_0x149849[_0x4cdf('0x36')]['limit']);_0x3289a5[_0x4cdf('0x1e')]=qs[_0x4cdf('0x1e')](_0x149849[_0x4cdf('0x36')][_0x4cdf('0x1e')]);}_0x3289a5['order']=qs[_0x4cdf('0x3e')](_0x149849[_0x4cdf('0x36')]['sort']);_0x3289a5[_0x4cdf('0x3f')]=qs[_0x4cdf('0x40')](_['pick'](_0x149849[_0x4cdf('0x36')],_0x2c538b['filters']),_0x5e2a0d);if(_0x149849[_0x4cdf('0x36')][_0x4cdf('0x41')]){_0x3289a5[_0x4cdf('0x3f')]=_[_0x4cdf('0x42')](_0x3289a5[_0x4cdf('0x3f')],{'$or':_[_0x4cdf('0x30')](_0x5e2a0d,function(_0x2adc21){if(_0x2adc21[_0x4cdf('0x33')]!=='VIRTUAL'){var _0x59f17c={};_0x59f17c[_0x2adc21[_0x4cdf('0x2d')]]={'$like':'%'+_0x149849[_0x4cdf('0x36')][_0x4cdf('0x41')]+'%'};return _0x59f17c;}})});}_0x3289a5=_[_0x4cdf('0x42')]({},_0x3289a5,_0x149849['options']);var _0x58ac44={'where':_0x3289a5['where']};return db[_0x4cdf('0x43')][_0x4cdf('0x21')](_0x58ac44)[_0x4cdf('0x28')](function(_0x3e1932){_0xce246a['count']=_0x3e1932;if(_0x149849[_0x4cdf('0x36')][_0x4cdf('0x44')]){_0x3289a5['include']=[{'all':!![]}];}return db[_0x4cdf('0x43')]['findAll'](_0x3289a5);})['then'](function(_0x1c345a){_0xce246a[_0x4cdf('0x45')]=_0x1c345a;return _0xce246a;})[_0x4cdf('0x28')](respondWithFilteredResult(_0x30e3d9,_0x3289a5))['catch'](handleError(_0x30e3d9,null));};exports[_0x4cdf('0x46')]=function(_0x4661a8,_0x5251fc){var _0x44ab63={'raw':!![],'where':{'id':_0x4661a8['params']['id']}},_0x3d73d1={};_0x3d73d1['model']=_[_0x4cdf('0x37')](db[_0x4cdf('0x43')]['rawAttributes']);_0x3d73d1[_0x4cdf('0x36')]=_[_0x4cdf('0x37')](_0x4661a8['query']);_0x3d73d1[_0x4cdf('0x40')]=_['intersection'](_0x3d73d1[_0x4cdf('0x35')],_0x3d73d1[_0x4cdf('0x36')]);_0x44ab63[_0x4cdf('0x39')]=_[_0x4cdf('0x38')](_0x3d73d1[_0x4cdf('0x35')],qs['fields'](_0x4661a8[_0x4cdf('0x36')][_0x4cdf('0x3a')]));_0x44ab63[_0x4cdf('0x39')]=_0x44ab63[_0x4cdf('0x39')]['length']?_0x44ab63['attributes']:_0x3d73d1[_0x4cdf('0x35')];if(_0x4661a8['query'][_0x4cdf('0x44')]){_0x44ab63[_0x4cdf('0x47')]=[{'all':!![]}];}_0x44ab63=_[_0x4cdf('0x42')]({},_0x44ab63,_0x4661a8['options']);return db['SmsApplication'][_0x4cdf('0x48')](_0x44ab63)['then'](handleEntityNotFound(_0x5251fc,null))[_0x4cdf('0x28')](respondWithResult(_0x5251fc,null))[_0x4cdf('0x49')](handleError(_0x5251fc,null));};exports['create']=function(_0x410d39,_0x5306da){return db['SmsApplication'][_0x4cdf('0x4a')](_0x410d39[_0x4cdf('0x4b')],{})[_0x4cdf('0x28')](respondWithResult(_0x5306da,0xc9))[_0x4cdf('0x49')](handleError(_0x5306da,null));};exports[_0x4cdf('0x27')]=function(_0x53ea7c,_0x3c7eb4){if(_0x53ea7c[_0x4cdf('0x4b')]['id']){delete _0x53ea7c['body']['id'];}return db[_0x4cdf('0x43')]['find']({'where':{'id':_0x53ea7c[_0x4cdf('0x4c')]['id']}})[_0x4cdf('0x28')](handleEntityNotFound(_0x3c7eb4,null))['then'](saveUpdates(_0x53ea7c[_0x4cdf('0x4b')],null))['then'](respondWithResult(_0x3c7eb4,null))[_0x4cdf('0x49')](handleError(_0x3c7eb4,null));};exports[_0x4cdf('0x29')]=function(_0x45ea97,_0x1ab073){return db[_0x4cdf('0x43')][_0x4cdf('0x48')]({'where':{'id':_0x45ea97[_0x4cdf('0x4c')]['id']}})[_0x4cdf('0x28')](handleEntityNotFound(_0x1ab073,null))[_0x4cdf('0x28')](removeEntity(_0x1ab073,null))[_0x4cdf('0x49')](handleError(_0x1ab073,null));}; \ No newline at end of file +var _0x368e=['model','query','filters','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','SmsApplication','intersection','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x368e,0x192));var _0xe368=function(_0x5addf7,_0x50785e){_0x5addf7=_0x5addf7-0x0;var _0xb0746a=_0x368e[_0x5addf7];return _0xb0746a;};'use strict';var emlformat=require(_0xe368('0x0'));var rimraf=require(_0xe368('0x1'));var zipdir=require(_0xe368('0x2'));var jsonpatch=require(_0xe368('0x3'));var rp=require(_0xe368('0x4'));var moment=require(_0xe368('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe368('0x6'));var path=require(_0xe368('0x7'));var sox=require(_0xe368('0x8'));var csv=require(_0xe368('0x9'));var ejs=require(_0xe368('0xa'));var fs=require('fs');var fs_extra=require(_0xe368('0xb'));var _=require('lodash');var squel=require(_0xe368('0xc'));var crypto=require(_0xe368('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe368('0x9'));var querystring=require(_0xe368('0xe'));var Papa=require(_0xe368('0xf'));var Redis=require('ioredis');var authService=require(_0xe368('0x10'));var qs=require(_0xe368('0x11'));var as=require(_0xe368('0x12'));var hardwareService=require(_0xe368('0x13'));var logger=require(_0xe368('0x14'))(_0xe368('0x15'));var utils=require(_0xe368('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe368('0x17'));var db=require(_0xe368('0x18'))['db'];function respondWithStatusCode(_0x4d6b95,_0x381642){_0x381642=_0x381642||0xcc;return function(_0x13c707){if(_0x13c707){return _0x4d6b95[_0xe368('0x19')](_0x381642);}return _0x4d6b95[_0xe368('0x1a')](_0x381642)[_0xe368('0x1b')]();};}function respondWithResult(_0x44a062,_0x44f65e){_0x44f65e=_0x44f65e||0xc8;return function(_0x87e1d0){if(_0x87e1d0){return _0x44a062[_0xe368('0x1a')](_0x44f65e)[_0xe368('0x1c')](_0x87e1d0);}};}function respondWithFilteredResult(_0x30f589,_0x342d40){return function(_0x2b5845){if(_0x2b5845){var _0x2018e4=typeof _0x342d40[_0xe368('0x1d')]===_0xe368('0x1e')&&typeof _0x342d40[_0xe368('0x1f')]===_0xe368('0x1e');var _0x52d7f1=_0x2b5845[_0xe368('0x20')];var _0x357859=_0x2018e4?0x0:_0x342d40[_0xe368('0x1d')];var _0x98a8ec=_0x2018e4?_0x2b5845[_0xe368('0x20')]:_0x342d40[_0xe368('0x1d')]+_0x342d40[_0xe368('0x1f')];var _0x1a1052;if(_0x98a8ec>=_0x52d7f1){_0x98a8ec=_0x52d7f1;_0x1a1052=0xc8;}else{_0x1a1052=0xce;}_0x30f589[_0xe368('0x1a')](_0x1a1052);return _0x30f589['set']('Content-Range',_0x357859+'-'+_0x98a8ec+'/'+_0x52d7f1)['json'](_0x2b5845);}return null;};}function patchUpdates(_0x317671){return function(_0x2290f0){try{jsonpatch[_0xe368('0x21')](_0x2290f0,_0x317671,!![]);}catch(_0x37d8c3){return BPromise[_0xe368('0x22')](_0x37d8c3);}return _0x2290f0[_0xe368('0x23')]();};}function saveUpdates(_0x3f9433,_0x215a39){return function(_0x18f7ce){if(_0x18f7ce){return _0x18f7ce[_0xe368('0x24')](_0x3f9433)[_0xe368('0x25')](function(_0x53c7b9){return _0x53c7b9;});}return null;};}function removeEntity(_0x360d48,_0x254db7){return function(_0x7da9be){if(_0x7da9be){return _0x7da9be[_0xe368('0x26')]()[_0xe368('0x25')](function(){_0x360d48[_0xe368('0x1a')](0xcc)[_0xe368('0x1b')]();});}};}function handleEntityNotFound(_0x336f9e,_0x31e4b6){return function(_0x210b4c){if(!_0x210b4c){_0x336f9e['sendStatus'](0x194);}return _0x210b4c;};}function handleError(_0x21a3a7,_0x205a6b){_0x205a6b=_0x205a6b||0x1f4;return function(_0x2ce87f){logger['error'](_0x2ce87f[_0xe368('0x27')]);if(_0x2ce87f[_0xe368('0x28')]){delete _0x2ce87f['name'];}_0x21a3a7['status'](_0x205a6b)[_0xe368('0x29')](_0x2ce87f);};}exports[_0xe368('0x2a')]=function(_0x224b4d,_0x592554){var _0x284330={},_0x3fdfc5={},_0x4ed83e={'count':0x0,'rows':[]};var _0x5f6faa=_[_0xe368('0x2b')](db['SmsApplication'][_0xe368('0x2c')],function(_0x386083){return{'name':_0x386083[_0xe368('0x2d')],'type':_0x386083[_0xe368('0x2e')][_0xe368('0x2f')]};});_0x3fdfc5[_0xe368('0x30')]=_[_0xe368('0x2b')](_0x5f6faa,'name');_0x3fdfc5[_0xe368('0x31')]=_['keys'](_0x224b4d['query']);_0x3fdfc5[_0xe368('0x32')]=_['intersection'](_0x3fdfc5[_0xe368('0x30')],_0x3fdfc5['query']);_0x284330[_0xe368('0x33')]=_['intersection'](_0x3fdfc5[_0xe368('0x30')],qs[_0xe368('0x34')](_0x224b4d['query'][_0xe368('0x34')]));_0x284330['attributes']=_0x284330['attributes']['length']?_0x284330[_0xe368('0x33')]:_0x3fdfc5['model'];if(!_0x224b4d[_0xe368('0x31')]['hasOwnProperty'](_0xe368('0x35'))){_0x284330['limit']=qs['limit'](_0x224b4d[_0xe368('0x31')][_0xe368('0x1f')]);_0x284330[_0xe368('0x1d')]=qs[_0xe368('0x1d')](_0x224b4d[_0xe368('0x31')][_0xe368('0x1d')]);}_0x284330[_0xe368('0x36')]=qs[_0xe368('0x37')](_0x224b4d['query']['sort']);_0x284330[_0xe368('0x38')]=qs[_0xe368('0x32')](_['pick'](_0x224b4d['query'],_0x3fdfc5[_0xe368('0x32')]),_0x5f6faa);if(_0x224b4d[_0xe368('0x31')]['filter']){_0x284330[_0xe368('0x38')]=_[_0xe368('0x39')](_0x284330['where'],{'$or':_[_0xe368('0x2b')](_0x5f6faa,function(_0x3c6088){if(_0x3c6088[_0xe368('0x2e')]!==_0xe368('0x3a')){var _0x53de48={};_0x53de48[_0x3c6088[_0xe368('0x28')]]={'$like':'%'+_0x224b4d[_0xe368('0x31')][_0xe368('0x3b')]+'%'};return _0x53de48;}})});}_0x284330=_[_0xe368('0x39')]({},_0x284330,_0x224b4d[_0xe368('0x3c')]);var _0x247f6f={'where':_0x284330[_0xe368('0x38')]};return db['SmsApplication'][_0xe368('0x20')](_0x247f6f)[_0xe368('0x25')](function(_0x3fc659){_0x4ed83e[_0xe368('0x20')]=_0x3fc659;if(_0x224b4d['query']['includeAll']){_0x284330[_0xe368('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0xe368('0x3e')](_0x284330);})['then'](function(_0xdb9991){_0x4ed83e[_0xe368('0x3f')]=_0xdb9991;return _0x4ed83e;})['then'](respondWithFilteredResult(_0x592554,_0x284330))['catch'](handleError(_0x592554,null));};exports[_0xe368('0x40')]=function(_0x1e9cf1,_0x413a78){var _0x15787e={'raw':!![],'where':{'id':_0x1e9cf1[_0xe368('0x41')]['id']}},_0x54c699={};_0x54c699[_0xe368('0x30')]=_[_0xe368('0x42')](db[_0xe368('0x43')][_0xe368('0x2c')]);_0x54c699['query']=_[_0xe368('0x42')](_0x1e9cf1[_0xe368('0x31')]);_0x54c699[_0xe368('0x32')]=_[_0xe368('0x44')](_0x54c699[_0xe368('0x30')],_0x54c699[_0xe368('0x31')]);_0x15787e['attributes']=_[_0xe368('0x44')](_0x54c699[_0xe368('0x30')],qs[_0xe368('0x34')](_0x1e9cf1[_0xe368('0x31')]['fields']));_0x15787e[_0xe368('0x33')]=_0x15787e[_0xe368('0x33')][_0xe368('0x45')]?_0x15787e[_0xe368('0x33')]:_0x54c699['model'];if(_0x1e9cf1[_0xe368('0x31')][_0xe368('0x46')]){_0x15787e[_0xe368('0x3d')]=[{'all':!![]}];}_0x15787e=_[_0xe368('0x39')]({},_0x15787e,_0x1e9cf1[_0xe368('0x3c')]);return db[_0xe368('0x43')][_0xe368('0x47')](_0x15787e)[_0xe368('0x25')](handleEntityNotFound(_0x413a78,null))[_0xe368('0x25')](respondWithResult(_0x413a78,null))[_0xe368('0x48')](handleError(_0x413a78,null));};exports[_0xe368('0x49')]=function(_0x8bdbb1,_0x3d6043){return db['SmsApplication']['create'](_0x8bdbb1[_0xe368('0x4a')],{})[_0xe368('0x25')](respondWithResult(_0x3d6043,0xc9))[_0xe368('0x48')](handleError(_0x3d6043,null));};exports[_0xe368('0x24')]=function(_0x369706,_0x49042a){if(_0x369706[_0xe368('0x4a')]['id']){delete _0x369706['body']['id'];}return db[_0xe368('0x43')]['find']({'where':{'id':_0x369706[_0xe368('0x41')]['id']}})[_0xe368('0x25')](handleEntityNotFound(_0x49042a,null))['then'](saveUpdates(_0x369706[_0xe368('0x4a')],null))['then'](respondWithResult(_0x49042a,null))[_0xe368('0x48')](handleError(_0x49042a,null));};exports[_0xe368('0x26')]=function(_0xcf7fc0,_0x580b63){return db[_0xe368('0x43')][_0xe368('0x47')]({'where':{'id':_0xcf7fc0[_0xe368('0x41')]['id']}})[_0xe368('0x25')](handleEntityNotFound(_0x580b63,null))[_0xe368('0x25')](removeEntity(_0x580b63,null))[_0xe368('0x48')](handleError(_0x580b63,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index df7be6c..c9b9b37 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 _0x2fac=['exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x2fac,0x1a5));var _0xc2fa=function(_0x2e5f47,_0x5c6f40){_0x2e5f47=_0x2e5f47-0x0;var _0x4b9b30=_0x2fac[_0x2e5f47];return _0x4b9b30;};'use strict';var _=require(_0xc2fa('0x0'));var util=require(_0xc2fa('0x1'));var logger=require(_0xc2fa('0x2'))(_0xc2fa('0x3'));var moment=require(_0xc2fa('0x4'));var BPromise=require(_0xc2fa('0x5'));var rp=require(_0xc2fa('0x6'));var fs=require('fs');var path=require(_0xc2fa('0x7'));var rimraf=require(_0xc2fa('0x8'));var config=require(_0xc2fa('0x9'));var attributes=require(_0xc2fa('0xa'));module[_0xc2fa('0xb')]=function(_0x356c25,_0x39d0c3){return _0x356c25[_0xc2fa('0xc')](_0xc2fa('0xd'),attributes,{'tableName':_0xc2fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc2fa('0xf')});}; \ No newline at end of file +var _0x1305=['exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes'];(function(_0x164e0f,_0x211c83){var _0xaf4e4b=function(_0x3bacf9){while(--_0x3bacf9){_0x164e0f['push'](_0x164e0f['shift']());}};_0xaf4e4b(++_0x211c83);}(_0x1305,0x17c));var _0x5130=function(_0x14ecb8,_0x22589d){_0x14ecb8=_0x14ecb8-0x0;var _0x1329b9=_0x1305[_0x14ecb8];return _0x1329b9;};'use strict';var _=require(_0x5130('0x0'));var util=require(_0x5130('0x1'));var logger=require(_0x5130('0x2'))(_0x5130('0x3'));var moment=require(_0x5130('0x4'));var BPromise=require(_0x5130('0x5'));var rp=require(_0x5130('0x6'));var fs=require('fs');var path=require(_0x5130('0x7'));var rimraf=require('rimraf');var config=require(_0x5130('0x8'));var attributes=require(_0x5130('0x9'));module[_0x5130('0xa')]=function(_0x3a6b1f,_0x1f0031){return _0x3a6b1f[_0x5130('0xb')](_0x5130('0xc'),attributes,{'tableName':_0x5130('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5130('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6412a1c..fbadaeb 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 _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0xa456,0x142));var _0x6a45=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xa456[_0x45783c];return _0x1161da;};'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']('SmsApplication,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('SmsApplication,\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 +var _0x40ac=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','request\x20sent','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x40ac,0x1de));var _0xc40a=function(_0x4ab560,_0x5e8fe2){_0x4ab560=_0x4ab560-0x0;var _0xfe1853=_0x40ac[_0x4ab560];return _0xfe1853;};'use strict';var _=require(_0xc40a('0x0'));var util=require('util');var moment=require(_0xc40a('0x1'));var BPromise=require(_0xc40a('0x2'));var rs=require(_0xc40a('0x3'));var fs=require('fs');var Redis=require(_0xc40a('0x4'));var db=require(_0xc40a('0x5'))['db'];var utils=require(_0xc40a('0x6'));var logger=require(_0xc40a('0x7'))('rpc');var config=require(_0xc40a('0x8'));var jayson=require(_0xc40a('0x9'));var client=jayson[_0xc40a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b77c,_0x3f323e,_0x28b55d){return new BPromise(function(_0x5bb1e8,_0xecfe01){return client[_0xc40a('0xb')](_0x59b77c,_0x28b55d)[_0xc40a('0xc')](function(_0x35e0c6){logger['info']('SmsApplication,\x20%s,\x20%s',_0x3f323e,'request\x20sent');logger[_0xc40a('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3f323e,_0xc40a('0xe'),JSON['stringify'](_0x35e0c6));if(_0x35e0c6['error']){if(_0x35e0c6[_0xc40a('0xf')][_0xc40a('0x10')]===0x1f4){logger[_0xc40a('0xf')](_0xc40a('0x11'),_0x3f323e,_0x35e0c6[_0xc40a('0xf')][_0xc40a('0x12')]);return _0xecfe01(_0x35e0c6[_0xc40a('0xf')][_0xc40a('0x12')]);}logger['error'](_0xc40a('0x11'),_0x3f323e,_0x35e0c6[_0xc40a('0xf')]['message']);return _0x5bb1e8(_0x35e0c6[_0xc40a('0xf')]['message']);}else{logger[_0xc40a('0x13')](_0xc40a('0x11'),_0x3f323e,_0xc40a('0xe'));_0x5bb1e8(_0x35e0c6[_0xc40a('0x14')][_0xc40a('0x12')]);}})['catch'](function(_0x3d1502){logger[_0xc40a('0xf')](_0xc40a('0x11'),_0x3f323e,_0x3d1502);_0xecfe01(_0x3d1502);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 1326de9..5d8fa8d 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 _0x4483=['isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4483,0x1a3));var _0x3448=function(_0x358cd7,_0x2b1d6e){_0x358cd7=_0x358cd7-0x0;var _0x34c4c0=_0x4483[_0x358cd7];return _0x34c4c0;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3448('0x13')](_0x3448('0xf'),auth['isAuthenticated'](),controller[_0x3448('0x14')]);router[_0x3448('0x13')](_0x3448('0x15'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),'smsinteraction:addtags'),controller[_0x3448('0x18')]);router[_0x3448('0x19')](_0x3448('0x1a'),auth['isAuthenticated'](),interaction[_0x3448('0x16')](_0x3448('0x17'),_0x3448('0x1b')),controller[_0x3448('0x1c')]);router[_0x3448('0x1d')](_0x3448('0x1a'),auth[_0x3448('0xa')](),interaction[_0x3448('0x16')]('sms',_0x3448('0x1e')),controller['destroy']);router['delete']('/:id/tags',auth[_0x3448('0xa')](),controller[_0x3448('0x1f')]);module[_0x3448('0x20')]=router; \ No newline at end of file +var _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x34b7,0x196));var _0x734b=function(_0x12c511,_0x2102cc){_0x12c511=_0x12c511-0x0;var _0x208ba2=_0x34b7[_0x12c511];return _0x208ba2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4a0feb0..25ddc7f 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 _0x43fd=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x310766,_0x225f39){var _0x4db545=function(_0x386323){while(--_0x386323){_0x310766['push'](_0x310766['shift']());}};_0x4db545(++_0x225f39);}(_0x43fd,0x1ec));var _0xd43f=function(_0x593a56,_0x414a16){_0x593a56=_0x593a56-0x0;var _0x102320=_0x43fd[_0x593a56];return _0x102320;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd43f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd43f('0x1')]},'disposition':{'type':Sequelize[_0xd43f('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd43f('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd43f('0x2')]},'read1stAt':{'type':Sequelize[_0xd43f('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xd43f('0x3')]('in',_0xd43f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd43f('0x3')]('in',_0xd43f('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd43f('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x102b=['out','ENUM','moment','BOOLEAN','DATE','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x102b,0x1be));var _0xb102=function(_0x4c2d63,_0x4fcf91){_0x4c2d63=_0x4c2d63-0x0;var _0x33b9fa=_0x102b[_0x4c2d63];return _0x33b9fa;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb102('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb102('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb102('0x2')]},'disposition':{'type':Sequelize[_0xb102('0x3')]},'secondDisposition':{'type':Sequelize[_0xb102('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb102('0x3')]},'note':{'type':Sequelize[_0xb102('0x3')]},'phone':{'type':Sequelize[_0xb102('0x3')]},'read1stAt':{'type':Sequelize[_0xb102('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb102('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb102('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xb102('0x5')]('in',_0xb102('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb102('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 642f4e4..afd1a2a 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 _0x5e16=['secret','renderFile','root','downloadInteraction.ejs','.pdf','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','defaults','localhost','./smsInteraction.socket','register','status','json','undefined','count','offset','limit','reject','save','update','then','end','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','split','push','catch','waiting','answered','unmanaged','total','UserId','closed','talking','index','SmsInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','select','field','color','u.id','u.fullname','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','`\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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','forEach','SmsAccountId','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','role','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','show','includeAll','include','options','create','params','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','nolimit','pick','format','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','unix','server','tmp','join','files','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','Owner','get','mkdirSync','Sms','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','out','System'];(function(_0x59b03e,_0x39defa){var _0xcda858=function(_0x35fb6a){while(--_0x35fb6a){_0x59b03e['push'](_0x59b03e['shift']());}};_0xcda858(++_0x39defa);}(_0x5e16,0xf7));var _0x65e1=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0x5e16[_0x427217];return _0x5b28fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65e1('0x0'));var zipdir=require(_0x65e1('0x1'));var jsonpatch=require(_0x65e1('0x2'));var rp=require(_0x65e1('0x3'));var moment=require(_0x65e1('0x4'));var BPromise=require(_0x65e1('0x5'));var Mustache=require(_0x65e1('0x6'));var util=require(_0x65e1('0x7'));var path=require(_0x65e1('0x8'));var sox=require(_0x65e1('0x9'));var csv=require(_0x65e1('0xa'));var ejs=require(_0x65e1('0xb'));var fs=require('fs');var fs_extra=require(_0x65e1('0xc'));var _=require(_0x65e1('0xd'));var squel=require(_0x65e1('0xe'));var crypto=require('crypto');var jsforce=require(_0x65e1('0xf'));var deskjs=require(_0x65e1('0x10'));var toCsv=require(_0x65e1('0xa'));var querystring=require(_0x65e1('0x11'));var Papa=require(_0x65e1('0x12'));var Redis=require(_0x65e1('0x13'));var authService=require(_0x65e1('0x14'));var qs=require(_0x65e1('0x15'));var as=require(_0x65e1('0x16'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x65e1('0x17'));var config=require(_0x65e1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x65e1('0x19')]=_[_0x65e1('0x1a')](config[_0x65e1('0x19')],{'host':_0x65e1('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x65e1('0x1c'))[_0x65e1('0x1d')](socket);function respondWithStatusCode(_0x5457eb,_0x1e48fb){_0x1e48fb=_0x1e48fb||0xcc;return function(_0x2b8b93){if(_0x2b8b93){return _0x5457eb['sendStatus'](_0x1e48fb);}return _0x5457eb['status'](_0x1e48fb)['end']();};}function respondWithResult(_0x2eb228,_0xf43c22){_0xf43c22=_0xf43c22||0xc8;return function(_0x383c73){if(_0x383c73){return _0x2eb228[_0x65e1('0x1e')](_0xf43c22)[_0x65e1('0x1f')](_0x383c73);}};}function respondWithFilteredResult(_0x6e8920,_0x3934de){return function(_0x522fed){if(_0x522fed){var _0x3c2ace=typeof _0x3934de['offset']===_0x65e1('0x20')&&typeof _0x3934de['limit']===_0x65e1('0x20');var _0x5134af=_0x522fed[_0x65e1('0x21')];var _0x3041fc=_0x3c2ace?0x0:_0x3934de[_0x65e1('0x22')];var _0x448ed9=_0x3c2ace?_0x522fed['count']:_0x3934de[_0x65e1('0x22')]+_0x3934de[_0x65e1('0x23')];var _0x3f497b;if(_0x448ed9>=_0x5134af){_0x448ed9=_0x5134af;_0x3f497b=0xc8;}else{_0x3f497b=0xce;}_0x6e8920['status'](_0x3f497b);return _0x6e8920['set']('Content-Range',_0x3041fc+'-'+_0x448ed9+'/'+_0x5134af)['json'](_0x522fed);}return null;};}function patchUpdates(_0x3f81d1){return function(_0x372112){try{jsonpatch['apply'](_0x372112,_0x3f81d1,!![]);}catch(_0x600ff5){return BPromise[_0x65e1('0x24')](_0x600ff5);}return _0x372112[_0x65e1('0x25')]();};}function saveUpdates(_0x6361dc,_0x5037c9){return function(_0x535f28){if(_0x535f28){return _0x535f28[_0x65e1('0x26')](_0x6361dc)[_0x65e1('0x27')](function(_0x33cf54){return _0x33cf54;});}return null;};}function removeEntity(_0x28fe8f,_0x2b636b){return function(_0x3b117d){if(_0x3b117d){return _0x3b117d['destroy']()[_0x65e1('0x27')](function(){_0x28fe8f[_0x65e1('0x1e')](0xcc)[_0x65e1('0x28')]();});}};}function handleEntityNotFound(_0x1eaa63,_0x3fd72f){return function(_0x10ba35){if(!_0x10ba35){_0x1eaa63[_0x65e1('0x29')](0x194);}return _0x10ba35;};}function handleError(_0x58cd3f,_0x482b26){_0x482b26=_0x482b26||0x1f4;return function(_0x3d0468){logger[_0x65e1('0x2a')](_0x3d0468[_0x65e1('0x2b')]);if(_0x3d0468[_0x65e1('0x2c')]){delete _0x3d0468['name'];}_0x58cd3f[_0x65e1('0x1e')](_0x482b26)[_0x65e1('0x2d')](_0x3d0468);};}function getInteractionUsers(_0x5a907f,_0x5b1f0c){return new BPromise(function(_0x30ed4d,_0x1fbee0){try{if(_0x5b1f0c[_0x5a907f['id']]){_0x5a907f[_0x65e1('0x2e')]=_['map'](_0x5b1f0c[_0x5a907f['id']],function(_0x57da7d){return{'id':_0x57da7d['id'],'fullname':_0x57da7d[_0x65e1('0x2f')]};});}}catch(_0x5611f9){_0x1fbee0(_0x5611f9);}_0x30ed4d(_0x5a907f);});}function getInteractionTags(_0x14cc38,_0x3771b1){return new BPromise(function(_0x5104ef,_0x491f55){try{if(_0x14cc38[_0x65e1('0x30')]){_0x14cc38[_0x65e1('0x31')]=[];_0x14cc38[_0x65e1('0x30')][_0x65e1('0x32')](',')['forEach'](function(_0x1fbdbf){_0x14cc38[_0x65e1('0x31')][_0x65e1('0x33')](_0x3771b1[_0x1fbdbf]);});}delete _0x14cc38[_0x65e1('0x30')];}catch(_0x5af90a){_0x491f55(_0x5af90a);}_0x5104ef(_0x14cc38);});}function updateSmsInteraction(_0x14fdf9,_0x2ab0bb,_0x234ef5){return new BPromise(function(_0x380cbb,_0x1168ab){return getInteractionUsers(_0x14fdf9,_0x234ef5)[_0x65e1('0x27')](function(_0xae19f2){return getInteractionTags(_0xae19f2,_0x2ab0bb);})[_0x65e1('0x27')](function(_0x3c0b4f){return getStateInteraction(_0x3c0b4f);})[_0x65e1('0x27')](function(_0x41a35d){_0x380cbb(_0x41a35d);})[_0x65e1('0x34')](function(_0x2c799f){_0x1168ab(_0x2c799f);});});}function getStateInteraction(_0x85520){return new BPromise(function(_0x531942){_0x85520[_0x65e1('0x35')]=0x0;_0x85520['talking']=0x0;_0x85520[_0x65e1('0x36')]=0x0;_0x85520[_0x65e1('0x37')]=0x0;_0x85520[_0x65e1('0x38')]=0x0;if(!_0x85520['closed']&&!_0x85520[_0x65e1('0x39')]){_0x85520['waiting']+=0x1;}if(!_0x85520[_0x65e1('0x3a')]&&_0x85520[_0x65e1('0x39')]){_0x85520[_0x65e1('0x3b')]+=0x1;if(_0x85520[_0x65e1('0x35')]){_0x85520[_0x65e1('0x35')]-=0x1;}}if(_0x85520['closed']&&_0x85520[_0x65e1('0x39')]){_0x85520[_0x65e1('0x36')]+=0x1;if(_0x85520['talking']){_0x85520[_0x65e1('0x3b')]-=0x1;}}if(_0x85520['closed']&&!_0x85520[_0x65e1('0x39')]){_0x85520[_0x65e1('0x37')]+=0x1;if(_0x85520[_0x65e1('0x35')]){_0x85520['waiting']-=0x1;}}_0x85520[_0x65e1('0x38')]+=0x1;_0x531942(_0x85520);});}exports[_0x65e1('0x3c')]=function(_0x3edf3a,_0x36e3f8){var _0x3347ca={},_0x3cd381={},_0xbbd84f={'count':0x0,'rows':[]};var _0x254ce6=_['map'](db[_0x65e1('0x3d')][_0x65e1('0x3e')],function(_0x13e489){return{'name':_0x13e489[_0x65e1('0x3f')],'type':_0x13e489[_0x65e1('0x40')][_0x65e1('0x41')]};});_0x3cd381[_0x65e1('0x42')]=_[_0x65e1('0x43')](_0x254ce6,'name');_0x3cd381[_0x65e1('0x44')]=_[_0x65e1('0x45')](_0x3edf3a[_0x65e1('0x44')]);_0x3cd381[_0x65e1('0x46')]=_[_0x65e1('0x47')](_0x3cd381[_0x65e1('0x42')],_0x3cd381['query']);_0x3347ca['attributes']=_[_0x65e1('0x47')](_0x3cd381['model'],qs[_0x65e1('0x48')](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x48')]));_0x3347ca['attributes']=_0x3347ca[_0x65e1('0x49')][_0x65e1('0x4a')]?_0x3347ca[_0x65e1('0x49')]:_0x3cd381[_0x65e1('0x42')];if(!_0x3edf3a['query'][_0x65e1('0x4b')]('nolimit')){_0x3347ca['limit']=qs['limit'](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x23')]);_0x3347ca[_0x65e1('0x22')]=qs[_0x65e1('0x22')](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x22')]);}_0x3347ca[_0x65e1('0x4c')]=qs[_0x65e1('0x4d')](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x4d')]);_0x3347ca[_0x65e1('0x4e')]=qs[_0x65e1('0x46')](_['pick'](_0x3edf3a[_0x65e1('0x44')],_0x3cd381[_0x65e1('0x46')]),_0x254ce6);var _0x1014cd=[];var _0x9e119f=squel[_0x65e1('0x4f')]()[_0x65e1('0x50')]('id')[_0x65e1('0x50')](_0x65e1('0x2c'))['field'](_0x65e1('0x51'))['from']('tools_tags');var _0x4bdf56=squel[_0x65e1('0x4f')]()['field'](_0x65e1('0x52'))[_0x65e1('0x50')](_0x65e1('0x53'))[_0x65e1('0x50')]('ui.SmsInteractionId')[_0x65e1('0x54')](_0x65e1('0x55'),'ui')[_0x65e1('0x56')]('users','u',_0x65e1('0x57'));var _0x4840cc=squel[_0x65e1('0x4f')]()[_0x65e1('0x54')](_0x65e1('0x58'),'i')['left_join']('cm_contacts','c',_0x65e1('0x59'))[_0x65e1('0x56')]('users','o','o.id\x20=\x20i.UserId')[_0x65e1('0x56')]('sms_accounts','a',_0x65e1('0x5a'))['left_join'](_0x65e1('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x65e1('0x56')](_0x65e1('0x5c'),'it',_0x65e1('0x5d'))['left_join'](_0x65e1('0x5e'),'t',_0x65e1('0x5f'));var _0x1df2eb=squel[_0x65e1('0x60')]();var _0x38c123=[];var _0xcb5388=squel[_0x65e1('0x60')]();var _0xf51ab8;if(_0x3edf3a[_0x65e1('0x44')]['search']){_0xf51ab8=as[_0x65e1('0x61')](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x62')]);var _0x563ee7=_0xf51ab8['sqlOperator'];for(var _0x8bad5b=0x0;_0x8bad5b<_0xf51ab8['conditions'][_0x65e1('0x4a')];_0x8bad5b++){var _0x2f1e9d=_0xf51ab8[_0x65e1('0x63')][_0x8bad5b];var _0x13ec79='i';var _0x397271=_[_0x65e1('0x64')](_0x254ce6,['name',_0x2f1e9d[_0x65e1('0x50')]]);if(!_0x397271){switch(_0x2f1e9d['field']){case _0x65e1('0x65'):if(_0x2f1e9d[_0x65e1('0x66')]==0x1){_0x4840cc['having']('`'+_0x2f1e9d[_0x65e1('0x50')]+_0x65e1('0x67'));}else{_0x4840cc['having']('`'+_0x2f1e9d['field']+_0x65e1('0x68'));}break;case _0x65e1('0x69'):if(_0x2f1e9d[_0x65e1('0x6a')]===_0x65e1('0x6b')){if(_0x2f1e9d[_0x65e1('0x66')][_0x65e1('0x32')]('\x20')[_0x65e1('0x4a')]>0x1){_0x1df2eb[_0x563ee7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x65e1('0x6c')](_0x2f1e9d[_0x65e1('0x66')]),null);}else{var _0x2881ca='%'+_0x2f1e9d[_0x65e1('0x66')]+'%';_0x1df2eb[_0x563ee7](_0x65e1('0x6d'),_0x2881ca,_0x2881ca,_0x2881ca);}}else{_0x397271=_['find'](_0x254ce6,['name',_0x65e1('0x6e')]);_0x2f1e9d['field']=_0x65e1('0x6e');_0x446682=as[_0x65e1('0x6f')](_0x13ec79,_0x397271[_0x65e1('0x40')],_0x2f1e9d);_0x1df2eb[_0x563ee7](_0x446682[_0x65e1('0x70')],_0x446682[_0x65e1('0x66')][_0x65e1('0x71')],_0x446682['value'][_0x65e1('0x28')]);}break;case _0x65e1('0x72'):var _0x5e9ee1=_0x2f1e9d[_0x65e1('0x66')]['split'](',')[_0x65e1('0x43')](function(_0x2d846a){return Number(_0x2d846a);});_0x5e9ee1['forEach'](function(_0x8d8023){_0xcb5388['or'](_0x65e1('0x73'),'%,'+_0x8d8023+',%');});_0x38c123=_[_0x65e1('0x74')](_0x38c123,_0x5e9ee1);break;case _0x65e1('0x75'):if(_0x2f1e9d['operator']==='$substring'){_0x1df2eb[_0x563ee7](_0x65e1('0x76'),'%'+_0x2f1e9d[_0x65e1('0x66')]+'%',null);}else{_0x397271=_[_0x65e1('0x64')](_0x254ce6,[_0x65e1('0x2c'),_0x65e1('0x39')]);_0x2f1e9d['field']=_0x65e1('0x39');_0x446682=as[_0x65e1('0x6f')](_0x13ec79,_0x397271[_0x65e1('0x40')],_0x2f1e9d);_0x1df2eb[_0x563ee7](_0x446682[_0x65e1('0x70')],_0x446682[_0x65e1('0x66')][_0x65e1('0x71')],_0x446682[_0x65e1('0x66')][_0x65e1('0x28')]);}break;case _0x65e1('0x77'):_0x446682=as[_0x65e1('0x6f')]('me',null,_0x2f1e9d);_0x1df2eb[_0x563ee7](_0x446682[_0x65e1('0x70')],_0x446682[_0x65e1('0x66')][_0x65e1('0x71')],_0x446682[_0x65e1('0x66')]['end']);break;}}else{var _0x446682=as['buildExpression'](_0x13ec79,_0x397271[_0x65e1('0x40')],_0x2f1e9d);_0x1df2eb[_0x563ee7](_0x446682['text'],_0x446682[_0x65e1('0x66')]['start'],_0x446682[_0x65e1('0x66')][_0x65e1('0x28')]);}}}else{var _0x1d7772=_(_0x3edf3a[_0x65e1('0x44')])[_0x65e1('0x45')]()[_0x65e1('0x43')](function(_0x363ec8){return _[_0x65e1('0x78')](_0x254ce6,['name',_0x363ec8])?_0x363ec8:undefined;})[_0x65e1('0x79')]()[_0x65e1('0x66')]();if(!_[_0x65e1('0x7a')](_0x1d7772)){_0x1d7772[_0x65e1('0x7b')](function(_0x5445f2){if(_0x5445f2===_0x65e1('0x7c')){_0x4840cc[_0x65e1('0x4e')]('i.SmsAccountId\x20IN\x20?',[][_0x65e1('0x7d')](_0x3edf3a['query'][_0x5445f2]));}else if(_0x5445f2==='createdAt'){var _0x285cc8=JSON[_0x65e1('0x7e')](_0x3edf3a[_0x65e1('0x44')][_0x5445f2])[_0x65e1('0x7f')];var _0x50dd98=JSON[_0x65e1('0x7e')](_0x3edf3a['query'][_0x5445f2])['$lte'];_0x4840cc[_0x65e1('0x4e')](_0x65e1('0x80'),_0x285cc8,_0x50dd98);}else{if(_0x3edf3a[_0x65e1('0x44')][_0x5445f2]==='null'){_0x4840cc[_0x65e1('0x4e')]('i.'+_0x5445f2+_0x65e1('0x81'));}else{_0x4840cc[_0x65e1('0x4e')]('i.'+_0x5445f2+_0x65e1('0x82'),_0x3edf3a[_0x65e1('0x44')][_0x5445f2]);}}});}if(_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x83')]){if(_0x3edf3a[_0x65e1('0x44')]['read']==0x1){_0x4840cc[_0x65e1('0x84')](_0x65e1('0x85'));}else{_0x4840cc[_0x65e1('0x84')](_0x65e1('0x86'));}}if(_0x3edf3a['query'][_0x65e1('0x87')]){_0x38c123=_[_0x65e1('0x88')](_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x87')])?_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x87')]:new Array(_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x87')]);_0x38c123[_0x65e1('0x7b')](function(_0xadf587){_0xcb5388['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xadf587+',%');});}if(_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x89')]){var _0x41ac45=_0x3edf3a[_0x65e1('0x44')][_0x65e1('0x89')][_0x65e1('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x65e1('0x8b')](_0x41ac45)){_0x1df2eb['or'](_0x65e1('0x8c'),_0x41ac45+'%')['or'](_0x65e1('0x8d'),_0x41ac45+'%');}else{_0x1df2eb['or'](_0x65e1('0x8e'),qs['getFullTextValue'](_0x41ac45))['or'](_0x65e1('0x8f'),_0x41ac45+'%');}}}_0x4840cc[_0x65e1('0x4e')](_0x1df2eb);_0x4840cc[_0x65e1('0x90')](_0x65e1('0x91'));var _0x56bd94={'type':db[_0x65e1('0x92')][_0x65e1('0x93')][_0x65e1('0x94')],'raw':!![]};var _0x2712fd=_0x4840cc[_0x65e1('0x95')]();_0x2712fd[_0x65e1('0x50')]('i.id');_0x2712fd[_0x65e1('0x50')](_0x65e1('0x96'),_0x65e1('0x65'));if(_0x3347ca[_0x65e1('0x4c')]){_0x3347ca[_0x65e1('0x4c')][_0x65e1('0x7b')](function(_0x2f0b16){var _0x38b584=_0x2f0b16[0x0]===_0x65e1('0x97')?_0x2f0b16[0x0]:'i.'+_0x2f0b16[0x0];_0x4840cc[_0x65e1('0x4c')](_0x38b584,_0x2f0b16[0x1]==='DESC'?![]:!![]);});}if(!_[_0x65e1('0x7a')](_0x38c123)){_0x4840cc[_0x65e1('0x84')](_0xcb5388);_0x2712fd['where'](_0x65e1('0x98'),_0x38c123);}BPromise[_0x65e1('0x99')]()[_0x65e1('0x27')](function(){if(!_0xf51ab8){if(_0x3edf3a[_0x65e1('0x44')]['SmsAccountId'])return;_0x2712fd[_0x65e1('0x4e')](_0x65e1('0x9a'));_0x4840cc['where'](_0x65e1('0x9a'));return;}if(_0x3edf3a[_0x65e1('0x9b')]['role']!==_0x65e1('0x9c'))return;return _0x3edf3a['user'][_0x65e1('0x9d')]({'attributes':['id'],'raw':!![]})[_0x65e1('0x27')](function(_0x98a1e0){if(_[_0x65e1('0x7a')](_0x98a1e0)){_0x2712fd[_0x65e1('0x4e')](_0x65e1('0x9e'));_0x4840cc['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x2712fd[_0x65e1('0x4e')](_0x65e1('0x9f'),_[_0x65e1('0x43')](_0x98a1e0,'id'));_0x4840cc[_0x65e1('0x4e')]('i.SmsAccountId\x20IN\x20?',_[_0x65e1('0x43')](_0x98a1e0,'id'));}});})['then'](function(){if(_0x3edf3a[_0x65e1('0x9b')][_0x65e1('0xa0')]===_0x65e1('0x9c')&&!_0xf51ab8&&!_0x3edf3a['query'][_0x65e1('0x7c')])return[];return db[_0x65e1('0xa1')]['query'](_0x2712fd[_0x65e1('0xa2')](),_0x56bd94);})[_0x65e1('0x27')](function(_0x4f948f){_0xbbd84f[_0x65e1('0x21')]=_0x4f948f[_0x65e1('0x4a')];if(_0xbbd84f[_0x65e1('0x21')]===0x0)return[];return db['sequelize'][_0x65e1('0x44')](_0x9e119f[_0x65e1('0xa2')](),_0x56bd94)[_0x65e1('0x27')](function(_0x33cc8e){_0x1014cd=_['keyBy'](_0x33cc8e,'id');_0x56bd94=_[_0x65e1('0xa3')](_0x56bd94,{'model':db[_0x65e1('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3edf3a[_0x65e1('0x44')]['fields']){_0x3347ca[_0x65e1('0x49')]['forEach'](function(_0x30547d){_0x4840cc[_0x65e1('0x50')]('i.'+_0x30547d);});}else{_0x4840cc[_0x65e1('0x50')](_0x65e1('0x96'),'unreadMessages');_0x4840cc[_0x65e1('0x50')](_0x65e1('0xa4'),_0x65e1('0xa5'));_0x4840cc[_0x65e1('0x50')](_0x65e1('0xa6'),_0x65e1('0xa7'));_0x4840cc['field']('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',_0x65e1('0x97'));_0x4840cc['field'](_0x65e1('0xa8'));_0x4840cc[_0x65e1('0x50')](_0x65e1('0xa9'),_0x65e1('0xaa'));_0x4840cc[_0x65e1('0x50')](_0x65e1('0xab'),_0x65e1('0xac'));_0x4840cc[_0x65e1('0x50')]('c.email',_0x65e1('0xad'));_0x4840cc[_0x65e1('0x50')]('c.phone','Contact.phone');_0x4840cc[_0x65e1('0x50')](_0x65e1('0xae'),_0x65e1('0xaf'));_0x4840cc[_0x65e1('0x50')](_0x65e1('0xb0'),_0x65e1('0xb1'));_0x4840cc[_0x65e1('0x50')](_0x65e1('0xb2'),'Owner.fullname');_0x4840cc[_0x65e1('0x50')](_0x65e1('0xb3'),_0x65e1('0xb4'));_0x4840cc['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3347ca['limit'])_0x4840cc[_0x65e1('0x23')](_0x3347ca[_0x65e1('0x23')]);if(_0x3347ca[_0x65e1('0x22')])_0x4840cc['offset'](_0x3347ca['offset']);return db[_0x65e1('0xa1')]['query'](_0x4840cc[_0x65e1('0xa2')](),_0x56bd94);})['then'](function(_0x4eba35){if(_0x4eba35['length']>0x0)_0x4bdf56[_0x65e1('0x4e')](_0x65e1('0xb5'),_[_0x65e1('0x43')](_0x4eba35,'id'));return db[_0x65e1('0xa1')][_0x65e1('0x44')](_0x4bdf56['toString'](),_0x56bd94)['then'](function(_0x1a7663){var _0x4d1eba=_[_0x65e1('0xb6')](_0x1a7663,_0x65e1('0xb7'));var _0x11292b=[];_0x4eba35[_0x65e1('0x7b')](function(_0x47137e){_0x11292b[_0x65e1('0x33')](updateSmsInteraction(_0x47137e,_0x1014cd,_0x4d1eba));});return BPromise['all'](_0x11292b);});});})['then'](function(_0x415250){_0xbbd84f[_0x65e1('0xb8')]=_0x415250;return _0xbbd84f;})['then'](respondWithFilteredResult(_0x36e3f8,_0x3347ca))['catch'](handleError(_0x36e3f8,null));};exports[_0x65e1('0xb9')]=function(_0x5024c4,_0x4c00d2){var _0xf7ddf7={'raw':![],'where':{'id':_0x5024c4['params']['id']}},_0xc76822={};_0xc76822[_0x65e1('0x42')]=_[_0x65e1('0x45')](db[_0x65e1('0x3d')][_0x65e1('0x3e')]);_0xc76822[_0x65e1('0x44')]=_[_0x65e1('0x45')](_0x5024c4[_0x65e1('0x44')]);_0xc76822[_0x65e1('0x46')]=_[_0x65e1('0x47')](_0xc76822[_0x65e1('0x42')],_0xc76822[_0x65e1('0x44')]);_0xf7ddf7[_0x65e1('0x49')]=_[_0x65e1('0x47')](_0xc76822[_0x65e1('0x42')],qs[_0x65e1('0x48')](_0x5024c4[_0x65e1('0x44')][_0x65e1('0x48')]));_0xf7ddf7['attributes']=_0xf7ddf7[_0x65e1('0x49')][_0x65e1('0x4a')]?_0xf7ddf7['attributes']:_0xc76822[_0x65e1('0x42')];if(_0x5024c4[_0x65e1('0x44')][_0x65e1('0xba')]){_0xf7ddf7[_0x65e1('0xbb')]=[{'all':!![]}];}_0xf7ddf7=_[_0x65e1('0xa3')]({},_0xf7ddf7,_0x5024c4[_0x65e1('0xbc')]);return db[_0x65e1('0x3d')][_0x65e1('0x64')](_0xf7ddf7)[_0x65e1('0x27')](handleEntityNotFound(_0x4c00d2,null))[_0x65e1('0x27')](respondWithResult(_0x4c00d2,null))[_0x65e1('0x34')](handleError(_0x4c00d2,null));};exports[_0x65e1('0xbd')]=function(_0x47bb2a,_0xcccb91){return db[_0x65e1('0x3d')][_0x65e1('0xbd')](_0x47bb2a[_0x65e1('0x77')],{})[_0x65e1('0x27')](respondWithResult(_0xcccb91,0xc9))[_0x65e1('0x34')](handleError(_0xcccb91,null));};exports[_0x65e1('0x26')]=function(_0x2359a0,_0x5b82df){if(_0x2359a0[_0x65e1('0x77')]['id']){delete _0x2359a0['body']['id'];}return db[_0x65e1('0x3d')][_0x65e1('0x64')]({'where':{'id':_0x2359a0[_0x65e1('0xbe')]['id']}})[_0x65e1('0x27')](handleEntityNotFound(_0x5b82df,null))[_0x65e1('0x27')](saveUpdates(_0x2359a0[_0x65e1('0x77')],null))[_0x65e1('0x27')](respondWithResult(_0x5b82df,null))[_0x65e1('0x34')](handleError(_0x5b82df,null));};exports[_0x65e1('0xbf')]=function(_0x42460,_0x477927){return db[_0x65e1('0x3d')][_0x65e1('0x64')]({'where':{'id':_0x42460[_0x65e1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x477927,null))[_0x65e1('0x27')](removeEntity(_0x477927,null))[_0x65e1('0x34')](handleError(_0x477927,null));};exports[_0x65e1('0xc0')]=function(_0x479e5a,_0x31ae2b){return db[_0x65e1('0x3d')][_0x65e1('0xc0')]()[_0x65e1('0x27')](respondWithResult(_0x31ae2b,null))[_0x65e1('0x34')](handleError(_0x31ae2b,null));};exports[_0x65e1('0xc1')]=function(_0x3a4693,_0xfadea6,_0x575bfb){return db[_0x65e1('0xc2')]['find']({'where':{'id':_0x3a4693['params']['id']}})[_0x65e1('0x27')](handleEntityNotFound(_0xfadea6,null))[_0x65e1('0x27')](function(_0x4cdeee){if(_0x4cdeee){return _0x4cdeee[_0x65e1('0xc1')](_0x3a4693[_0x65e1('0x77')][_0x65e1('0xc3')],_[_0x65e1('0xc4')](_0x3a4693['body'],[_0x65e1('0xc3'),'id'])||{});}})[_0x65e1('0x27')](respondWithResult(_0xfadea6,null))[_0x65e1('0x34')](handleError(_0xfadea6,null));};exports[_0x65e1('0xc5')]=function(_0x4861ee,_0x2a0c7c,_0x560b99){var _0x5b7ec5={'raw':![],'where':{}};var _0x4c8719={};var _0x35b7d8={'count':0x0,'rows':[]};return db[_0x65e1('0x3d')][_0x65e1('0xc6')]({'where':{'id':_0x4861ee[_0x65e1('0xbe')]['id']}})[_0x65e1('0x27')](handleEntityNotFound(_0x2a0c7c,null))['then'](function(_0x3aaaa3){if(_0x3aaaa3){_0x4c8719[_0x65e1('0x42')]=_[_0x65e1('0x45')](db[_0x65e1('0xc2')]['rawAttributes']);_0x4c8719[_0x65e1('0x44')]=_[_0x65e1('0x45')](_0x4861ee[_0x65e1('0x44')]);_0x4c8719[_0x65e1('0x46')]=_[_0x65e1('0x47')](_0x4c8719['model'],_0x4c8719[_0x65e1('0x44')]);_0x5b7ec5[_0x65e1('0x49')]=_[_0x65e1('0x47')](_0x4c8719[_0x65e1('0x42')],qs[_0x65e1('0x48')](_0x4861ee[_0x65e1('0x44')][_0x65e1('0x48')]));_0x5b7ec5['attributes']=_0x5b7ec5['attributes'][_0x65e1('0x4a')]?_0x5b7ec5['attributes']:_0x4c8719['model'];if(!_0x4861ee[_0x65e1('0x44')][_0x65e1('0x4b')](_0x65e1('0xc7'))){_0x5b7ec5[_0x65e1('0x23')]=qs[_0x65e1('0x23')](_0x4861ee['query'][_0x65e1('0x23')]);_0x5b7ec5[_0x65e1('0x22')]=qs[_0x65e1('0x22')](_0x4861ee[_0x65e1('0x44')][_0x65e1('0x22')]);}_0x5b7ec5[_0x65e1('0x4c')]=qs[_0x65e1('0x4d')](_0x4861ee[_0x65e1('0x44')]['sort']);_0x5b7ec5[_0x65e1('0x4e')]=qs['filters'](_[_0x65e1('0xc8')](_0x4861ee[_0x65e1('0x44')],_0x4c8719['filters']));_0x5b7ec5['where'][_0x65e1('0xb7')]=_0x3aaaa3['id'];if(_0x4861ee[_0x65e1('0x44')][_0x65e1('0x89')]){_0x5b7ec5[_0x65e1('0x4e')]=_['merge'](_0x5b7ec5[_0x65e1('0x4e')],{'$or':_['map'](_0x5b7ec5['attributes'],function(_0x2936ea){var _0x179d8e={};_0x179d8e[_0x2936ea]={'$like':'%'+_0x4861ee['query'][_0x65e1('0x89')]+'%'};return _0x179d8e;})});}if(_0x4861ee[_0x65e1('0x44')]['$gte']){var _0x521b41=_0x4861ee['query'][_0x65e1('0x7f')][_0x65e1('0x32')](',');var _0xfc0c42={};_0xfc0c42[_0x521b41[0x0]]={'$gte':moment(_0x521b41[0x1])[_0x65e1('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b7ec5[_0x65e1('0x4e')]=_[_0x65e1('0xa3')](_0x5b7ec5['where'],_0xfc0c42);}_0x5b7ec5=_[_0x65e1('0xa3')]({},_0x5b7ec5,_0x4861ee[_0x65e1('0xbc')]);return db[_0x65e1('0xc2')][_0x65e1('0x21')]({'where':_0x5b7ec5[_0x65e1('0x4e')]})[_0x65e1('0x27')](function(_0x4d949f){_0x35b7d8[_0x65e1('0x21')]=_0x4d949f;if(_0x4861ee['query'][_0x65e1('0xba')]){_0x5b7ec5[_0x65e1('0xbb')]=[{'all':!![]}];}return db[_0x65e1('0xc2')][_0x65e1('0xca')](_0x5b7ec5);})[_0x65e1('0x27')](function(_0xbe2112){_0x35b7d8['rows']=_0xbe2112;return _0x35b7d8;});}})[_0x65e1('0x27')](respondWithFilteredResult(_0x2a0c7c,_0x5b7ec5))[_0x65e1('0x34')](handleError(_0x2a0c7c,null));};exports[_0x65e1('0xcb')]=function(_0x200474,_0x51a687,_0x2715b0){return db['SmsInteraction']['find']({'where':{'id':_0x200474[_0x65e1('0xbe')]['id']}})[_0x65e1('0x27')](handleEntityNotFound(_0x51a687,null))[_0x65e1('0x27')](function(_0xe60e0a){if(_0xe60e0a){return _0xe60e0a[_0x65e1('0xcc')](_0x200474['body'][_0x65e1('0xc3')],_[_0x65e1('0xc4')](_0x200474[_0x65e1('0x77')],['ids','id'])||{})[_0x65e1('0xcd')](function(){return db[_0x65e1('0x72')][_0x65e1('0xca')]({'attributes':['id',_0x65e1('0x2c'),_0x65e1('0x51')],'where':{'id':_0x200474[_0x65e1('0x77')][_0x65e1('0xc3')]}});})['then'](function(_0x3b98be){socket[_0x65e1('0xce')](_0x65e1('0xcf'),{'id':Number(_0x200474[_0x65e1('0xbe')]['id']),'tags':_0x3b98be||[]});return{'id':Number(_0x200474['params']['id']),'tags':_0x3b98be||[]};});}})['then'](respondWithResult(_0x51a687,null))[_0x65e1('0x34')](handleError(_0x51a687,null));};exports[_0x65e1('0xd0')]=function(_0x2216f3,_0x1d02a2,_0x5a20e3){return db[_0x65e1('0x3d')][_0x65e1('0x64')]({'where':{'id':_0x2216f3[_0x65e1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1d02a2,null))[_0x65e1('0x27')](function(_0x276842){if(_0x276842){return _0x276842['removeTags'](_0x2216f3[_0x65e1('0x44')][_0x65e1('0xc3')]);}})[_0x65e1('0x27')](respondWithStatusCode(_0x1d02a2,null))[_0x65e1('0x34')](handleError(_0x1d02a2,null));};exports['download']=function(_0x590a37,_0x5781c3){var _0x2f1664=moment()[_0x65e1('0xd1')]()['toString']();var _0x49cd05=path['join'](config['root'],_0x65e1('0xd2'),'files',_0x65e1('0xd3'));var _0x501f32=path[_0x65e1('0xd4')](config['root'],_0x65e1('0xd2'),_0x65e1('0xd5'),'attachments');var _0x52ed7b=path[_0x65e1('0xd4')](_0x49cd05,_0x2f1664);var _0x3b9635=util['format'](_0x65e1('0xd6'),_0x590a37['params']['id'],_0x2f1664);var _0x49cda1=path[_0x65e1('0xd4')](_0x49cd05,_0x3b9635);var _0x344c61=[];_0x344c61[_0x65e1('0x33')]({'model':db[_0x65e1('0x75')],'as':_0x65e1('0x75'),'attributes':['id',_0x65e1('0x2f')],'raw':!![]});_0x344c61['push']({'model':db['CmContact'],'as':_0x65e1('0x69'),'attributes':['id',_0x65e1('0xd7'),_0x65e1('0xd8')],'raw':!![]});var _0x2b1b04=[{'model':db[_0x65e1('0xc2')],'as':'Messages','attributes':['id','body',_0x65e1('0xd9'),_0x65e1('0xda'),'secret',_0x65e1('0x83')],'include':_0x344c61}];_0x2b1b04[_0x65e1('0x33')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x65e1('0x2c')]});_0x2b1b04[_0x65e1('0x33')]({'model':db[_0x65e1('0x75')],'as':_0x65e1('0xdb'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x65e1('0x64')]({'where':{'id':_0x590a37[_0x65e1('0xbe')]['id']},'include':_0x2b1b04})['then'](handleEntityNotFound(_0x5781c3,null))['then'](function(_0xd10f8c){if(_0xd10f8c){var _0x10360b=_0xd10f8c[_0x65e1('0xdc')]({'plain':!![]});fs[_0x65e1('0xdd')](_0x52ed7b);var _0x26a7d6={'channel':_0x65e1('0xde'),'account':_0x10360b[_0x65e1('0xdf')][_0x65e1('0x2c')],'agent':_0x10360b[_0x65e1('0xdb')]?_0x10360b[_0x65e1('0xdb')][_0x65e1('0x2f')]:_0x65e1('0xe0'),'createdAt':moment(_0x10360b[_0x65e1('0xd9')])[_0x65e1('0xc9')](_0x65e1('0xe1'))[_0x65e1('0xa2')](),'closedAt':_0x10360b[_0x65e1('0x3a')]?moment(_0x10360b[_0x65e1('0xe2')])[_0x65e1('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x65e1('0xa2')]():'','disposition':_0x10360b['disposition'],'messages':_(_0x10360b['Messages'])['filter']({'secret':![]})[_0x65e1('0x43')](function(_0x21af1b){return{'date':moment(_0x21af1b[_0x65e1('0xd9')])[_0x65e1('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x65e1('0xa2')](),'sender':_0x21af1b[_0x65e1('0xda')]===_0x65e1('0xe3')?_0x21af1b['User']?_0x21af1b[_0x65e1('0x75')][_0x65e1('0x2f')]:_0x65e1('0xe4'):_0x21af1b[_0x65e1('0x69')][_0x65e1('0xd7')]+(_0x21af1b[_0x65e1('0x69')][_0x65e1('0xd8')]?'\x20'+_0x21af1b[_0x65e1('0x69')][_0x65e1('0xd8')]:''),'body':_0x21af1b[_0x65e1('0x77')],'direction':_0x21af1b[_0x65e1('0xda')]===_0x65e1('0xe3')?'A':'C','secret':_0x21af1b[_0x65e1('0xe5')],'read':_0x21af1b['read']};})[_0x65e1('0x66')]()};return ejs[_0x65e1('0xe6')](path[_0x65e1('0xd4')](config[_0x65e1('0xe7')],'server','views',_0x65e1('0xe8')),{'interaction':_0x26a7d6})[_0x65e1('0x27')](function(_0x450ab3){var _0x1a95e6=path['join'](_0x52ed7b,'transcript-'+_0x10360b['id']+'-'+_0x2f1664+_0x65e1('0xe9'));var _0x2cbab6={'path':_0x1a95e6,'channel':_0x65e1('0xde'),'interactionId':_0x10360b['id']};return pdf['createPdfFromHTML'](_0x450ab3,_0x2cbab6);})[_0x65e1('0x27')](function(){return new BPromise(function(_0x283297,_0x3ccbf0){zipdir(_0x52ed7b,{'saveTo':_0x49cda1},function(_0x3b24c0,_0x2b3d51){if(_0x3b24c0)return _0x3ccbf0(_0x3b24c0);return _0x283297(_0x2b3d51);});})['then'](function(){return new BPromise(function(_0x675509,_0x53beb7){rimraf(_0x52ed7b,function(_0x42341d){if(_0x42341d)_0x53beb7(_0x42341d);return _0x675509();});});})[_0x65e1('0x27')](function(){return _0x5781c3[_0x65e1('0xea')](_0x49cda1,_0x3b9635,function(_0x47d19c){if(_0x47d19c){console[_0x65e1('0xeb')](_0x65e1('0xec'),_0x47d19c);}else{fs[_0x65e1('0xed')](_0x49cda1);}});});});}else{return _0x5781c3['sendStatus'](0xc8);}})[_0x65e1('0x34')](handleError(_0x5781c3,null));}; \ No newline at end of file +var _0xe4e0=['having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','show','params','includeAll','merge','options','create','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','disposition','out','direction','renderFile','views','transcript-','.pdf','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','map','fullname','TagIds','Tags','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','index','SmsInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','select','field','color','from','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','conditions','find','unreadMessages','value','`\x20>\x200','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e0,0x6c));var _0x0e4e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe4e0[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require(_0x0e4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e4e('0x1'));var rp=require(_0x0e4e('0x2'));var moment=require(_0x0e4e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e4e('0x4'));var path=require(_0x0e4e('0x5'));var sox=require(_0x0e4e('0x6'));var csv=require(_0x0e4e('0x7'));var ejs=require(_0x0e4e('0x8'));var fs=require('fs');var fs_extra=require(_0x0e4e('0x9'));var _=require('lodash');var squel=require(_0x0e4e('0xa'));var crypto=require(_0x0e4e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0e4e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0e4e('0xd'));var Papa=require('papaparse');var Redis=require(_0x0e4e('0xe'));var authService=require(_0x0e4e('0xf'));var qs=require(_0x0e4e('0x10'));var as=require(_0x0e4e('0x11'));var pdf=require(_0x0e4e('0x12'));var hardwareService=require(_0x0e4e('0x13'));var logger=require(_0x0e4e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0e4e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e4e('0x16'))['db'];config[_0x0e4e('0x17')]=_[_0x0e4e('0x18')](config[_0x0e4e('0x17')],{'host':_0x0e4e('0x19'),'port':0x18eb});var socket=require(_0x0e4e('0x1a'))(new Redis(config[_0x0e4e('0x17')]));require(_0x0e4e('0x1b'))[_0x0e4e('0x1c')](socket);function respondWithStatusCode(_0x56f0d8,_0x375bbf){_0x375bbf=_0x375bbf||0xcc;return function(_0x13682c){if(_0x13682c){return _0x56f0d8[_0x0e4e('0x1d')](_0x375bbf);}return _0x56f0d8[_0x0e4e('0x1e')](_0x375bbf)[_0x0e4e('0x1f')]();};}function respondWithResult(_0x433e70,_0x4c134a){_0x4c134a=_0x4c134a||0xc8;return function(_0x236086){if(_0x236086){return _0x433e70[_0x0e4e('0x1e')](_0x4c134a)[_0x0e4e('0x20')](_0x236086);}};}function respondWithFilteredResult(_0x5eebbf,_0x1f5acc){return function(_0x13edc8){if(_0x13edc8){var _0x13555f=typeof _0x1f5acc[_0x0e4e('0x21')]===_0x0e4e('0x22')&&typeof _0x1f5acc[_0x0e4e('0x23')]===_0x0e4e('0x22');var _0x47c59e=_0x13edc8[_0x0e4e('0x24')];var _0x15433f=_0x13555f?0x0:_0x1f5acc[_0x0e4e('0x21')];var _0x5151fb=_0x13555f?_0x13edc8['count']:_0x1f5acc['offset']+_0x1f5acc['limit'];var _0x4c098a;if(_0x5151fb>=_0x47c59e){_0x5151fb=_0x47c59e;_0x4c098a=0xc8;}else{_0x4c098a=0xce;}_0x5eebbf[_0x0e4e('0x1e')](_0x4c098a);return _0x5eebbf[_0x0e4e('0x25')](_0x0e4e('0x26'),_0x15433f+'-'+_0x5151fb+'/'+_0x47c59e)[_0x0e4e('0x20')](_0x13edc8);}return null;};}function patchUpdates(_0x47ec4c){return function(_0x43d16a){try{jsonpatch[_0x0e4e('0x27')](_0x43d16a,_0x47ec4c,!![]);}catch(_0x54b1dc){return BPromise['reject'](_0x54b1dc);}return _0x43d16a['save']();};}function saveUpdates(_0x4ef152,_0x1efb3e){return function(_0xee48db){if(_0xee48db){return _0xee48db[_0x0e4e('0x28')](_0x4ef152)[_0x0e4e('0x29')](function(_0x2d3bc0){return _0x2d3bc0;});}return null;};}function removeEntity(_0x4dbbd4,_0x33e54d){return function(_0x54202b){if(_0x54202b){return _0x54202b['destroy']()['then'](function(){_0x4dbbd4[_0x0e4e('0x1e')](0xcc)[_0x0e4e('0x1f')]();});}};}function handleEntityNotFound(_0x43f98d,_0x409495){return function(_0x118880){if(!_0x118880){_0x43f98d[_0x0e4e('0x1d')](0x194);}return _0x118880;};}function handleError(_0x46fa8b,_0x43db27){_0x43db27=_0x43db27||0x1f4;return function(_0x527431){logger[_0x0e4e('0x2a')](_0x527431[_0x0e4e('0x2b')]);if(_0x527431[_0x0e4e('0x2c')]){delete _0x527431[_0x0e4e('0x2c')];}_0x46fa8b[_0x0e4e('0x1e')](_0x43db27)[_0x0e4e('0x2d')](_0x527431);};}function getInteractionUsers(_0x227606,_0x198371){return new BPromise(function(_0x301d3a,_0x4a3dad){try{if(_0x198371[_0x227606['id']]){_0x227606['Users']=_[_0x0e4e('0x2e')](_0x198371[_0x227606['id']],function(_0x5dfa30){return{'id':_0x5dfa30['id'],'fullname':_0x5dfa30[_0x0e4e('0x2f')]};});}}catch(_0x2b9ba8){_0x4a3dad(_0x2b9ba8);}_0x301d3a(_0x227606);});}function getInteractionTags(_0x23bb43,_0x2c6d27){return new BPromise(function(_0xb10c48,_0x3b779c){try{if(_0x23bb43[_0x0e4e('0x30')]){_0x23bb43[_0x0e4e('0x31')]=[];_0x23bb43[_0x0e4e('0x30')]['split'](',')[_0x0e4e('0x32')](function(_0x21c8c3){_0x23bb43[_0x0e4e('0x31')][_0x0e4e('0x33')](_0x2c6d27[_0x21c8c3]);});}delete _0x23bb43[_0x0e4e('0x30')];}catch(_0x1446bd){_0x3b779c(_0x1446bd);}_0xb10c48(_0x23bb43);});}function updateSmsInteraction(_0x459ed3,_0x207b2a,_0x40b4fe){return new BPromise(function(_0x2c1fbd,_0x4f5bf4){return getInteractionUsers(_0x459ed3,_0x40b4fe)[_0x0e4e('0x29')](function(_0x5e4427){return getInteractionTags(_0x5e4427,_0x207b2a);})[_0x0e4e('0x29')](function(_0x4e4676){return getStateInteraction(_0x4e4676);})[_0x0e4e('0x29')](function(_0x6d3d1b){_0x2c1fbd(_0x6d3d1b);})[_0x0e4e('0x34')](function(_0x493396){_0x4f5bf4(_0x493396);});});}function getStateInteraction(_0x1d71c8){return new BPromise(function(_0x338914){_0x1d71c8[_0x0e4e('0x35')]=0x0;_0x1d71c8[_0x0e4e('0x36')]=0x0;_0x1d71c8['answered']=0x0;_0x1d71c8[_0x0e4e('0x37')]=0x0;_0x1d71c8[_0x0e4e('0x38')]=0x0;if(!_0x1d71c8[_0x0e4e('0x39')]&&!_0x1d71c8[_0x0e4e('0x3a')]){_0x1d71c8[_0x0e4e('0x35')]+=0x1;}if(!_0x1d71c8[_0x0e4e('0x39')]&&_0x1d71c8['UserId']){_0x1d71c8['talking']+=0x1;if(_0x1d71c8[_0x0e4e('0x35')]){_0x1d71c8[_0x0e4e('0x35')]-=0x1;}}if(_0x1d71c8[_0x0e4e('0x39')]&&_0x1d71c8[_0x0e4e('0x3a')]){_0x1d71c8[_0x0e4e('0x3b')]+=0x1;if(_0x1d71c8[_0x0e4e('0x36')]){_0x1d71c8[_0x0e4e('0x36')]-=0x1;}}if(_0x1d71c8['closed']&&!_0x1d71c8[_0x0e4e('0x3a')]){_0x1d71c8[_0x0e4e('0x37')]+=0x1;if(_0x1d71c8[_0x0e4e('0x35')]){_0x1d71c8['waiting']-=0x1;}}_0x1d71c8[_0x0e4e('0x38')]+=0x1;_0x338914(_0x1d71c8);});}exports[_0x0e4e('0x3c')]=function(_0x587152,_0x40fd94){var _0x155cf5={},_0x109580={},_0x48aa54={'count':0x0,'rows':[]};var _0x1b3d4a=_[_0x0e4e('0x2e')](db[_0x0e4e('0x3d')][_0x0e4e('0x3e')],function(_0x3338d2){return{'name':_0x3338d2[_0x0e4e('0x3f')],'type':_0x3338d2['type'][_0x0e4e('0x40')]};});_0x109580[_0x0e4e('0x41')]=_['map'](_0x1b3d4a,_0x0e4e('0x2c'));_0x109580[_0x0e4e('0x42')]=_[_0x0e4e('0x43')](_0x587152[_0x0e4e('0x42')]);_0x109580[_0x0e4e('0x44')]=_['intersection'](_0x109580[_0x0e4e('0x41')],_0x109580[_0x0e4e('0x42')]);_0x155cf5[_0x0e4e('0x45')]=_[_0x0e4e('0x46')](_0x109580[_0x0e4e('0x41')],qs[_0x0e4e('0x47')](_0x587152[_0x0e4e('0x42')][_0x0e4e('0x47')]));_0x155cf5[_0x0e4e('0x45')]=_0x155cf5['attributes'][_0x0e4e('0x48')]?_0x155cf5['attributes']:_0x109580['model'];if(!_0x587152[_0x0e4e('0x42')]['hasOwnProperty'](_0x0e4e('0x49'))){_0x155cf5['limit']=qs[_0x0e4e('0x23')](_0x587152[_0x0e4e('0x42')][_0x0e4e('0x23')]);_0x155cf5['offset']=qs[_0x0e4e('0x21')](_0x587152['query'][_0x0e4e('0x21')]);}_0x155cf5['order']=qs[_0x0e4e('0x4a')](_0x587152['query'][_0x0e4e('0x4a')]);_0x155cf5[_0x0e4e('0x4b')]=qs[_0x0e4e('0x44')](_[_0x0e4e('0x4c')](_0x587152[_0x0e4e('0x42')],_0x109580[_0x0e4e('0x44')]),_0x1b3d4a);var _0x144ee5=[];var _0x116461=squel[_0x0e4e('0x4d')]()[_0x0e4e('0x4e')]('id')[_0x0e4e('0x4e')]('name')[_0x0e4e('0x4e')](_0x0e4e('0x4f'))[_0x0e4e('0x50')]('tools_tags');var _0x1e7e0a=squel[_0x0e4e('0x4d')]()['field']('u.id')[_0x0e4e('0x4e')](_0x0e4e('0x51'))[_0x0e4e('0x4e')](_0x0e4e('0x52'))['from'](_0x0e4e('0x53'),'ui')[_0x0e4e('0x54')](_0x0e4e('0x55'),'u',_0x0e4e('0x56'));var _0x3acaa1=squel[_0x0e4e('0x4d')]()['from']('sms_interactions','i')[_0x0e4e('0x54')](_0x0e4e('0x57'),'c',_0x0e4e('0x58'))['left_join'](_0x0e4e('0x55'),'o',_0x0e4e('0x59'))[_0x0e4e('0x54')](_0x0e4e('0x5a'),'a','a.id\x20=\x20i.SmsAccountId')[_0x0e4e('0x54')](_0x0e4e('0x5b'),'me',_0x0e4e('0x5c'))[_0x0e4e('0x54')](_0x0e4e('0x5d'),'it',_0x0e4e('0x5e'))[_0x0e4e('0x54')](_0x0e4e('0x5f'),'t','t.id\x20=\x20it.TagId');var _0x16f664=squel['expr']();var _0x16eb07=[];var _0x285ed2=squel[_0x0e4e('0x60')]();var _0x16808c;if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x61')]){_0x16808c=as['parseSearch'](_0x587152['query']['search']);var _0x513b54=_0x16808c['sqlOperator'];for(var _0x4777c1=0x0;_0x4777c1<_0x16808c[_0x0e4e('0x62')][_0x0e4e('0x48')];_0x4777c1++){var _0x3da0b1=_0x16808c[_0x0e4e('0x62')][_0x4777c1];var _0x39119a='i';var _0x4fef2a=_[_0x0e4e('0x63')](_0x1b3d4a,[_0x0e4e('0x2c'),_0x3da0b1[_0x0e4e('0x4e')]]);if(!_0x4fef2a){switch(_0x3da0b1[_0x0e4e('0x4e')]){case _0x0e4e('0x64'):if(_0x3da0b1[_0x0e4e('0x65')]==0x1){_0x3acaa1['having']('`'+_0x3da0b1[_0x0e4e('0x4e')]+'`\x20=\x200');}else{_0x3acaa1['having']('`'+_0x3da0b1[_0x0e4e('0x4e')]+_0x0e4e('0x66'));}break;case'Contact':if(_0x3da0b1[_0x0e4e('0x67')]===_0x0e4e('0x68')){if(_0x3da0b1[_0x0e4e('0x65')][_0x0e4e('0x69')]('\x20')[_0x0e4e('0x48')]>0x1){_0x16f664[_0x513b54]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0e4e('0x6a')](_0x3da0b1['value']),null);}else{var _0x2e6457='%'+_0x3da0b1[_0x0e4e('0x65')]+'%';_0x16f664[_0x513b54](_0x0e4e('0x6b'),_0x2e6457,_0x2e6457,_0x2e6457);}}else{_0x4fef2a=_[_0x0e4e('0x63')](_0x1b3d4a,[_0x0e4e('0x2c'),_0x0e4e('0x6c')]);_0x3da0b1[_0x0e4e('0x4e')]='ContactId';_0x1f7c5d=as[_0x0e4e('0x6d')](_0x39119a,_0x4fef2a[_0x0e4e('0x6e')],_0x3da0b1);_0x16f664[_0x513b54](_0x1f7c5d[_0x0e4e('0x6f')],_0x1f7c5d[_0x0e4e('0x65')][_0x0e4e('0x70')],_0x1f7c5d[_0x0e4e('0x65')]['end']);}break;case _0x0e4e('0x71'):var _0x471612=_0x3da0b1[_0x0e4e('0x65')][_0x0e4e('0x69')](',')[_0x0e4e('0x2e')](function(_0x40cc72){return Number(_0x40cc72);});_0x471612['forEach'](function(_0x3e3c68){_0x285ed2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3e3c68+',%');});_0x16eb07=_['union'](_0x16eb07,_0x471612);break;case _0x0e4e('0x72'):if(_0x3da0b1[_0x0e4e('0x67')]==='$substring'){_0x16f664[_0x513b54](_0x0e4e('0x73'),'%'+_0x3da0b1['value']+'%',null);}else{_0x4fef2a=_[_0x0e4e('0x63')](_0x1b3d4a,[_0x0e4e('0x2c'),_0x0e4e('0x3a')]);_0x3da0b1['field']=_0x0e4e('0x3a');_0x1f7c5d=as[_0x0e4e('0x6d')](_0x39119a,_0x4fef2a[_0x0e4e('0x6e')],_0x3da0b1);_0x16f664[_0x513b54](_0x1f7c5d[_0x0e4e('0x6f')],_0x1f7c5d['value'][_0x0e4e('0x70')],_0x1f7c5d[_0x0e4e('0x65')][_0x0e4e('0x1f')]);}break;case _0x0e4e('0x74'):_0x1f7c5d=as[_0x0e4e('0x6d')]('me',null,_0x3da0b1);_0x16f664[_0x513b54](_0x1f7c5d[_0x0e4e('0x6f')],_0x1f7c5d[_0x0e4e('0x65')][_0x0e4e('0x70')],_0x1f7c5d[_0x0e4e('0x65')]['end']);break;}}else{var _0x1f7c5d=as[_0x0e4e('0x6d')](_0x39119a,_0x4fef2a[_0x0e4e('0x6e')],_0x3da0b1);_0x16f664[_0x513b54](_0x1f7c5d[_0x0e4e('0x6f')],_0x1f7c5d[_0x0e4e('0x65')][_0x0e4e('0x70')],_0x1f7c5d[_0x0e4e('0x65')][_0x0e4e('0x1f')]);}}}else{var _0x1a9cdb=_(_0x587152[_0x0e4e('0x42')])[_0x0e4e('0x43')]()[_0x0e4e('0x2e')](function(_0x4e78a5){return _[_0x0e4e('0x75')](_0x1b3d4a,[_0x0e4e('0x2c'),_0x4e78a5])?_0x4e78a5:undefined;})[_0x0e4e('0x76')]()[_0x0e4e('0x65')]();if(!_[_0x0e4e('0x77')](_0x1a9cdb)){_0x1a9cdb[_0x0e4e('0x32')](function(_0x197b7a){if(_0x197b7a===_0x0e4e('0x78')){_0x3acaa1['where'](_0x0e4e('0x79'),[][_0x0e4e('0x7a')](_0x587152[_0x0e4e('0x42')][_0x197b7a]));}else if(_0x197b7a===_0x0e4e('0x7b')){var _0x432abc=JSON['parse'](_0x587152['query'][_0x197b7a])[_0x0e4e('0x7c')];var _0x54893a=JSON[_0x0e4e('0x7d')](_0x587152[_0x0e4e('0x42')][_0x197b7a])['$lte'];_0x3acaa1[_0x0e4e('0x4b')](_0x0e4e('0x7e'),_0x432abc,_0x54893a);}else{if(_0x587152[_0x0e4e('0x42')][_0x197b7a]===_0x0e4e('0x7f')){_0x3acaa1[_0x0e4e('0x4b')]('i.'+_0x197b7a+_0x0e4e('0x80'));}else{_0x3acaa1[_0x0e4e('0x4b')]('i.'+_0x197b7a+'\x20=\x20?',_0x587152[_0x0e4e('0x42')][_0x197b7a]);}}});}if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x81')]){if(_0x587152['query'][_0x0e4e('0x81')]==0x1){_0x3acaa1[_0x0e4e('0x82')](_0x0e4e('0x83'));}else{_0x3acaa1[_0x0e4e('0x82')](_0x0e4e('0x84'));}}if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x85')]){_0x16eb07=_[_0x0e4e('0x86')](_0x587152[_0x0e4e('0x42')][_0x0e4e('0x85')])?_0x587152[_0x0e4e('0x42')]['tag']:new Array(_0x587152['query'][_0x0e4e('0x85')]);_0x16eb07['forEach'](function(_0x23c26c){_0x285ed2['or'](_0x0e4e('0x87'),'%,'+_0x23c26c+',%');});}if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x88')]){var _0xb95fb8=_0x587152[_0x0e4e('0x42')][_0x0e4e('0x88')][_0x0e4e('0x89')]('\x5c','\x5c\x5c')[_0x0e4e('0x89')](/'/g,'\x27\x27');if(qs[_0x0e4e('0x8a')](_0xb95fb8)){_0x16f664['or']('i.id\x20LIKE\x20?',_0xb95fb8+'%')['or'](_0x0e4e('0x8b'),_0xb95fb8+'%');}else{_0x16f664['or'](_0x0e4e('0x8c'),qs['getFullTextValue'](_0xb95fb8))['or'](_0x0e4e('0x8d'),_0xb95fb8+'%');}}}_0x3acaa1[_0x0e4e('0x4b')](_0x16f664);_0x3acaa1['group']('i.id');var _0x404499={'type':db['Sequelize'][_0x0e4e('0x8e')]['SELECT'],'raw':!![]};var _0x27aaa7=_0x3acaa1[_0x0e4e('0x8f')]();_0x27aaa7[_0x0e4e('0x4e')](_0x0e4e('0x90'));_0x27aaa7[_0x0e4e('0x4e')](_0x0e4e('0x91'),'unreadMessages');if(_0x155cf5['order']){_0x155cf5[_0x0e4e('0x92')][_0x0e4e('0x32')](function(_0x580ddb){var _0x4b9376=_0x580ddb[0x0]==='contactName'?_0x580ddb[0x0]:'i.'+_0x580ddb[0x0];_0x3acaa1['order'](_0x4b9376,_0x580ddb[0x1]===_0x0e4e('0x93')?![]:!![]);});}if(!_[_0x0e4e('0x77')](_0x16eb07)){_0x3acaa1['having'](_0x285ed2);_0x27aaa7['where'](_0x0e4e('0x94'),_0x16eb07);}BPromise[_0x0e4e('0x95')]()[_0x0e4e('0x29')](function(){if(!_0x16808c){if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x78')])return;_0x27aaa7[_0x0e4e('0x4b')](_0x0e4e('0x96'));_0x3acaa1[_0x0e4e('0x4b')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x587152[_0x0e4e('0x97')][_0x0e4e('0x98')]!==_0x0e4e('0x99'))return;return _0x587152[_0x0e4e('0x97')][_0x0e4e('0x9a')]({'attributes':['id'],'raw':!![]})[_0x0e4e('0x29')](function(_0x16aa2b){if(_['isEmpty'](_0x16aa2b)){_0x27aaa7[_0x0e4e('0x4b')](_0x0e4e('0x9b'));_0x3acaa1[_0x0e4e('0x4b')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x27aaa7[_0x0e4e('0x4b')](_0x0e4e('0x79'),_[_0x0e4e('0x2e')](_0x16aa2b,'id'));_0x3acaa1['where'](_0x0e4e('0x79'),_[_0x0e4e('0x2e')](_0x16aa2b,'id'));}});})[_0x0e4e('0x29')](function(){if(_0x587152[_0x0e4e('0x97')][_0x0e4e('0x98')]==='agent'&&!_0x16808c&&!_0x587152[_0x0e4e('0x42')][_0x0e4e('0x78')])return[];return db[_0x0e4e('0x9c')]['query'](_0x27aaa7[_0x0e4e('0x9d')](),_0x404499);})[_0x0e4e('0x29')](function(_0xb3faf3){_0x48aa54[_0x0e4e('0x24')]=_0xb3faf3['length'];if(_0x48aa54[_0x0e4e('0x24')]===0x0)return[];return db['sequelize']['query'](_0x116461[_0x0e4e('0x9d')](),_0x404499)[_0x0e4e('0x29')](function(_0x570d23){_0x144ee5=_[_0x0e4e('0x9e')](_0x570d23,'id');_0x404499=_['merge'](_0x404499,{'model':db[_0x0e4e('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x587152[_0x0e4e('0x42')][_0x0e4e('0x47')]){_0x155cf5[_0x0e4e('0x45')][_0x0e4e('0x32')](function(_0x4494a3){_0x3acaa1[_0x0e4e('0x4e')]('i.'+_0x4494a3);});}else{_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0x91'),_0x0e4e('0x64'));_0x3acaa1['field'](_0x0e4e('0x9f'),_0x0e4e('0xa0'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa1'),_0x0e4e('0xa2'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa3'),'contactName');_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa4'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa5'),_0x0e4e('0xa6'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa7'),_0x0e4e('0xa8'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xa9'),_0x0e4e('0xaa'));_0x3acaa1[_0x0e4e('0x4e')]('c.phone',_0x0e4e('0xab'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xac'),_0x0e4e('0xad'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xae'),_0x0e4e('0xaf'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xb0'),'Owner.fullname');_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xb1'),_0x0e4e('0xb2'));_0x3acaa1[_0x0e4e('0x4e')](_0x0e4e('0xb3'),_0x0e4e('0x30'));}if(_0x155cf5[_0x0e4e('0x23')])_0x3acaa1['limit'](_0x155cf5[_0x0e4e('0x23')]);if(_0x155cf5['offset'])_0x3acaa1[_0x0e4e('0x21')](_0x155cf5[_0x0e4e('0x21')]);return db[_0x0e4e('0x9c')][_0x0e4e('0x42')](_0x3acaa1[_0x0e4e('0x9d')](),_0x404499);})['then'](function(_0x24bbcd){if(_0x24bbcd[_0x0e4e('0x48')]>0x0)_0x1e7e0a[_0x0e4e('0x4b')]('ui.SmsInteractionId\x20IN\x20?',_[_0x0e4e('0x2e')](_0x24bbcd,'id'));return db[_0x0e4e('0x9c')][_0x0e4e('0x42')](_0x1e7e0a[_0x0e4e('0x9d')](),_0x404499)[_0x0e4e('0x29')](function(_0x8967f7){var _0x572193=_[_0x0e4e('0xb4')](_0x8967f7,'SmsInteractionId');var _0x973c23=[];_0x24bbcd[_0x0e4e('0x32')](function(_0x9f536b){_0x973c23[_0x0e4e('0x33')](updateSmsInteraction(_0x9f536b,_0x144ee5,_0x572193));});return BPromise[_0x0e4e('0xb5')](_0x973c23);});});})[_0x0e4e('0x29')](function(_0x2c3b8b){_0x48aa54[_0x0e4e('0xb6')]=_0x2c3b8b;return _0x48aa54;})[_0x0e4e('0x29')](respondWithFilteredResult(_0x40fd94,_0x155cf5))[_0x0e4e('0x34')](handleError(_0x40fd94,null));};exports[_0x0e4e('0xb7')]=function(_0x184251,_0x5a25f5){var _0x37e8ec={'raw':![],'where':{'id':_0x184251[_0x0e4e('0xb8')]['id']}},_0x3a9c23={};_0x3a9c23[_0x0e4e('0x41')]=_[_0x0e4e('0x43')](db['SmsInteraction'][_0x0e4e('0x3e')]);_0x3a9c23[_0x0e4e('0x42')]=_[_0x0e4e('0x43')](_0x184251[_0x0e4e('0x42')]);_0x3a9c23[_0x0e4e('0x44')]=_[_0x0e4e('0x46')](_0x3a9c23[_0x0e4e('0x41')],_0x3a9c23[_0x0e4e('0x42')]);_0x37e8ec[_0x0e4e('0x45')]=_[_0x0e4e('0x46')](_0x3a9c23[_0x0e4e('0x41')],qs['fields'](_0x184251[_0x0e4e('0x42')][_0x0e4e('0x47')]));_0x37e8ec[_0x0e4e('0x45')]=_0x37e8ec[_0x0e4e('0x45')][_0x0e4e('0x48')]?_0x37e8ec[_0x0e4e('0x45')]:_0x3a9c23[_0x0e4e('0x41')];if(_0x184251[_0x0e4e('0x42')][_0x0e4e('0xb9')]){_0x37e8ec['include']=[{'all':!![]}];}_0x37e8ec=_[_0x0e4e('0xba')]({},_0x37e8ec,_0x184251[_0x0e4e('0xbb')]);return db['SmsInteraction'][_0x0e4e('0x63')](_0x37e8ec)[_0x0e4e('0x29')](handleEntityNotFound(_0x5a25f5,null))[_0x0e4e('0x29')](respondWithResult(_0x5a25f5,null))[_0x0e4e('0x34')](handleError(_0x5a25f5,null));};exports[_0x0e4e('0xbc')]=function(_0x106401,_0x43fa50){return db[_0x0e4e('0x3d')][_0x0e4e('0xbc')](_0x106401[_0x0e4e('0x74')],{})['then'](respondWithResult(_0x43fa50,0xc9))['catch'](handleError(_0x43fa50,null));};exports['update']=function(_0x5d26de,_0x4b89d4){if(_0x5d26de[_0x0e4e('0x74')]['id']){delete _0x5d26de[_0x0e4e('0x74')]['id'];}return db[_0x0e4e('0x3d')][_0x0e4e('0x63')]({'where':{'id':_0x5d26de['params']['id']}})[_0x0e4e('0x29')](handleEntityNotFound(_0x4b89d4,null))[_0x0e4e('0x29')](saveUpdates(_0x5d26de[_0x0e4e('0x74')],null))[_0x0e4e('0x29')](respondWithResult(_0x4b89d4,null))[_0x0e4e('0x34')](handleError(_0x4b89d4,null));};exports[_0x0e4e('0xbd')]=function(_0x480471,_0x42fd58){return db[_0x0e4e('0x3d')][_0x0e4e('0x63')]({'where':{'id':_0x480471[_0x0e4e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x42fd58,null))[_0x0e4e('0x29')](removeEntity(_0x42fd58,null))[_0x0e4e('0x34')](handleError(_0x42fd58,null));};exports[_0x0e4e('0xbe')]=function(_0x80132f,_0x196e37){return db[_0x0e4e('0x3d')][_0x0e4e('0xbe')]()[_0x0e4e('0x29')](respondWithResult(_0x196e37,null))[_0x0e4e('0x34')](handleError(_0x196e37,null));};exports[_0x0e4e('0xbf')]=function(_0x2e5b71,_0x13dedf,_0x4b0ca8){return db[_0x0e4e('0xc0')][_0x0e4e('0x63')]({'where':{'id':_0x2e5b71[_0x0e4e('0xb8')]['id']}})[_0x0e4e('0x29')](handleEntityNotFound(_0x13dedf,null))[_0x0e4e('0x29')](function(_0x1dc969){if(_0x1dc969){return _0x1dc969[_0x0e4e('0xbf')](_0x2e5b71['body'][_0x0e4e('0xc1')],_['omit'](_0x2e5b71[_0x0e4e('0x74')],['ids','id'])||{});}})[_0x0e4e('0x29')](respondWithResult(_0x13dedf,null))['catch'](handleError(_0x13dedf,null));};exports[_0x0e4e('0xc2')]=function(_0x470026,_0x148b6e,_0x5d76ab){var _0x284aa0={'raw':![],'where':{}};var _0x3caba6={};var _0x834271={'count':0x0,'rows':[]};return db[_0x0e4e('0x3d')][_0x0e4e('0xc3')]({'where':{'id':_0x470026[_0x0e4e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x148b6e,null))[_0x0e4e('0x29')](function(_0x463a5a){if(_0x463a5a){_0x3caba6[_0x0e4e('0x41')]=_[_0x0e4e('0x43')](db[_0x0e4e('0xc0')][_0x0e4e('0x3e')]);_0x3caba6['query']=_[_0x0e4e('0x43')](_0x470026['query']);_0x3caba6[_0x0e4e('0x44')]=_['intersection'](_0x3caba6['model'],_0x3caba6['query']);_0x284aa0[_0x0e4e('0x45')]=_[_0x0e4e('0x46')](_0x3caba6[_0x0e4e('0x41')],qs['fields'](_0x470026[_0x0e4e('0x42')][_0x0e4e('0x47')]));_0x284aa0[_0x0e4e('0x45')]=_0x284aa0[_0x0e4e('0x45')][_0x0e4e('0x48')]?_0x284aa0[_0x0e4e('0x45')]:_0x3caba6[_0x0e4e('0x41')];if(!_0x470026[_0x0e4e('0x42')]['hasOwnProperty'](_0x0e4e('0x49'))){_0x284aa0[_0x0e4e('0x23')]=qs['limit'](_0x470026['query']['limit']);_0x284aa0['offset']=qs['offset'](_0x470026[_0x0e4e('0x42')][_0x0e4e('0x21')]);}_0x284aa0[_0x0e4e('0x92')]=qs[_0x0e4e('0x4a')](_0x470026[_0x0e4e('0x42')][_0x0e4e('0x4a')]);_0x284aa0[_0x0e4e('0x4b')]=qs['filters'](_[_0x0e4e('0x4c')](_0x470026['query'],_0x3caba6[_0x0e4e('0x44')]));_0x284aa0[_0x0e4e('0x4b')]['SmsInteractionId']=_0x463a5a['id'];if(_0x470026[_0x0e4e('0x42')][_0x0e4e('0x88')]){_0x284aa0['where']=_[_0x0e4e('0xba')](_0x284aa0[_0x0e4e('0x4b')],{'$or':_[_0x0e4e('0x2e')](_0x284aa0[_0x0e4e('0x45')],function(_0x25c975){var _0x2a37c6={};_0x2a37c6[_0x25c975]={'$like':'%'+_0x470026['query'][_0x0e4e('0x88')]+'%'};return _0x2a37c6;})});}if(_0x470026[_0x0e4e('0x42')][_0x0e4e('0x7c')]){var _0x45c962=_0x470026[_0x0e4e('0x42')][_0x0e4e('0x7c')]['split'](',');var _0x34082d={};_0x34082d[_0x45c962[0x0]]={'$gte':moment(_0x45c962[0x1])[_0x0e4e('0xc4')](_0x0e4e('0xc5'))};_0x284aa0[_0x0e4e('0x4b')]=_[_0x0e4e('0xba')](_0x284aa0[_0x0e4e('0x4b')],_0x34082d);}_0x284aa0=_['merge']({},_0x284aa0,_0x470026[_0x0e4e('0xbb')]);return db[_0x0e4e('0xc0')][_0x0e4e('0x24')]({'where':_0x284aa0[_0x0e4e('0x4b')]})[_0x0e4e('0x29')](function(_0x4ae851){_0x834271[_0x0e4e('0x24')]=_0x4ae851;if(_0x470026['query']['includeAll']){_0x284aa0[_0x0e4e('0xc6')]=[{'all':!![]}];}return db[_0x0e4e('0xc0')][_0x0e4e('0xc7')](_0x284aa0);})['then'](function(_0x306565){_0x834271[_0x0e4e('0xb6')]=_0x306565;return _0x834271;});}})[_0x0e4e('0x29')](respondWithFilteredResult(_0x148b6e,_0x284aa0))['catch'](handleError(_0x148b6e,null));};exports[_0x0e4e('0xc8')]=function(_0x20c6e0,_0x44a569,_0x1975c2){return db['SmsInteraction'][_0x0e4e('0x63')]({'where':{'id':_0x20c6e0[_0x0e4e('0xb8')]['id']}})[_0x0e4e('0x29')](handleEntityNotFound(_0x44a569,null))[_0x0e4e('0x29')](function(_0x4363ba){if(_0x4363ba){return _0x4363ba[_0x0e4e('0xc9')](_0x20c6e0[_0x0e4e('0x74')]['ids'],_['omit'](_0x20c6e0[_0x0e4e('0x74')],[_0x0e4e('0xc1'),'id'])||{})[_0x0e4e('0xca')](function(){return db[_0x0e4e('0x71')][_0x0e4e('0xc7')]({'attributes':['id',_0x0e4e('0x2c'),'color'],'where':{'id':_0x20c6e0[_0x0e4e('0x74')][_0x0e4e('0xc1')]}});})[_0x0e4e('0x29')](function(_0x3ec305){socket[_0x0e4e('0xcb')](_0x0e4e('0xcc'),{'id':Number(_0x20c6e0[_0x0e4e('0xb8')]['id']),'tags':_0x3ec305||[]});return{'id':Number(_0x20c6e0[_0x0e4e('0xb8')]['id']),'tags':_0x3ec305||[]};});}})[_0x0e4e('0x29')](respondWithResult(_0x44a569,null))[_0x0e4e('0x34')](handleError(_0x44a569,null));};exports[_0x0e4e('0xcd')]=function(_0x2aab00,_0xcb9ee8,_0xdbf780){return db['SmsInteraction'][_0x0e4e('0x63')]({'where':{'id':_0x2aab00[_0x0e4e('0xb8')]['id']}})['then'](handleEntityNotFound(_0xcb9ee8,null))[_0x0e4e('0x29')](function(_0x5c587f){if(_0x5c587f){return _0x5c587f[_0x0e4e('0xcd')](_0x2aab00[_0x0e4e('0x42')]['ids']);}})[_0x0e4e('0x29')](respondWithStatusCode(_0xcb9ee8,null))['catch'](handleError(_0xcb9ee8,null));};exports[_0x0e4e('0xce')]=function(_0x4eed80,_0x51c49b){var _0x32f441=moment()[_0x0e4e('0xcf')]()[_0x0e4e('0x9d')]();var _0x44df89=path['join'](config[_0x0e4e('0xd0')],_0x0e4e('0xd1'),_0x0e4e('0xd2'),_0x0e4e('0xd3'));var _0x45b67a=path[_0x0e4e('0xd4')](config[_0x0e4e('0xd0')],'server',_0x0e4e('0xd2'),_0x0e4e('0xd5'));var _0x2de86b=path[_0x0e4e('0xd4')](_0x44df89,_0x32f441);var _0x53f357=util['format'](_0x0e4e('0xd6'),_0x4eed80['params']['id'],_0x32f441);var _0x223b3d=path['join'](_0x44df89,_0x53f357);var _0x4eeac8=[];_0x4eeac8['push']({'model':db[_0x0e4e('0x72')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4eeac8[_0x0e4e('0x33')]({'model':db[_0x0e4e('0xd7')],'as':_0x0e4e('0xd8'),'attributes':['id',_0x0e4e('0xd9'),_0x0e4e('0xda')],'raw':!![]});var _0x1b8168=[{'model':db[_0x0e4e('0xc0')],'as':_0x0e4e('0xdb'),'attributes':['id',_0x0e4e('0x74'),_0x0e4e('0x7b'),'direction',_0x0e4e('0xdc'),_0x0e4e('0x81')],'include':_0x4eeac8}];_0x1b8168[_0x0e4e('0x33')]({'model':db[_0x0e4e('0xdd')],'as':_0x0e4e('0xde'),'attributes':['id',_0x0e4e('0x2c')]});_0x1b8168['push']({'model':db[_0x0e4e('0x72')],'as':_0x0e4e('0xdf'),'attributes':['id','fullname']});return db[_0x0e4e('0x3d')][_0x0e4e('0x63')]({'where':{'id':_0x4eed80[_0x0e4e('0xb8')]['id']},'include':_0x1b8168})[_0x0e4e('0x29')](handleEntityNotFound(_0x51c49b,null))[_0x0e4e('0x29')](function(_0x3ba4a0){if(_0x3ba4a0){var _0x35e6c6=_0x3ba4a0[_0x0e4e('0xe0')]({'plain':!![]});fs[_0x0e4e('0xe1')](_0x2de86b);var _0x8c529b={'channel':_0x0e4e('0xe2'),'account':_0x35e6c6['Account'][_0x0e4e('0x2c')],'agent':_0x35e6c6[_0x0e4e('0xdf')]?_0x35e6c6[_0x0e4e('0xdf')][_0x0e4e('0x2f')]:'N.A.','createdAt':moment(_0x35e6c6[_0x0e4e('0x7b')])[_0x0e4e('0xc4')](_0x0e4e('0xc5'))['toString'](),'closedAt':_0x35e6c6['closed']?moment(_0x35e6c6[_0x0e4e('0xe3')])[_0x0e4e('0xc4')](_0x0e4e('0xc5'))['toString']():'','disposition':_0x35e6c6[_0x0e4e('0xe4')],'messages':_(_0x35e6c6[_0x0e4e('0xdb')])['filter']({'secret':![]})[_0x0e4e('0x2e')](function(_0x366e14){return{'date':moment(_0x366e14['createdAt'])[_0x0e4e('0xc4')](_0x0e4e('0xc5'))[_0x0e4e('0x9d')](),'sender':_0x366e14['direction']===_0x0e4e('0xe5')?_0x366e14[_0x0e4e('0x72')]?_0x366e14[_0x0e4e('0x72')]['fullname']:'System':_0x366e14[_0x0e4e('0xd8')][_0x0e4e('0xd9')]+(_0x366e14[_0x0e4e('0xd8')][_0x0e4e('0xda')]?'\x20'+_0x366e14[_0x0e4e('0xd8')][_0x0e4e('0xda')]:''),'body':_0x366e14[_0x0e4e('0x74')],'direction':_0x366e14[_0x0e4e('0xe6')]===_0x0e4e('0xe5')?'A':'C','secret':_0x366e14[_0x0e4e('0xdc')],'read':_0x366e14[_0x0e4e('0x81')]};})[_0x0e4e('0x65')]()};return ejs[_0x0e4e('0xe7')](path['join'](config[_0x0e4e('0xd0')],'server',_0x0e4e('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x8c529b})[_0x0e4e('0x29')](function(_0x36ef65){var _0x520230=path['join'](_0x2de86b,_0x0e4e('0xe9')+_0x35e6c6['id']+'-'+_0x32f441+_0x0e4e('0xea'));var _0x3fd54d={'path':_0x520230,'channel':_0x0e4e('0xe2'),'interactionId':_0x35e6c6['id']};return pdf['createPdfFromHTML'](_0x36ef65,_0x3fd54d);})[_0x0e4e('0x29')](function(){return new BPromise(function(_0x35b58f,_0x157aa2){zipdir(_0x2de86b,{'saveTo':_0x223b3d},function(_0x3d982f,_0x5894b0){if(_0x3d982f)return _0x157aa2(_0x3d982f);return _0x35b58f(_0x5894b0);});})[_0x0e4e('0x29')](function(){return new BPromise(function(_0x2f9b40,_0x396f66){rimraf(_0x2de86b,function(_0x59b698){if(_0x59b698)_0x396f66(_0x59b698);return _0x2f9b40();});});})['then'](function(){return _0x51c49b[_0x0e4e('0xce')](_0x223b3d,_0x53f357,function(_0xef445a){if(_0xef445a){console[_0x0e4e('0xeb')](_0x0e4e('0xec'),_0xef445a);}else{fs[_0x0e4e('0xed')](_0x223b3d);}});});});}else{return _0x51c49b[_0x0e4e('0x1d')](0xc8);}})['catch'](handleError(_0x51c49b,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 142f64d..f929cc1 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 _0xb574=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','SmsMessage','save','update','remove','getUsers','map','findAll','then'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xb574,0x106));var _0x4b57=function(_0x4e51f0,_0x43c7a5){_0x4e51f0=_0x4e51f0-0x0;var _0x36cd3c=_0xb574[_0x4e51f0];return _0x36cd3c;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var SmsInteraction=require(_0x4b57('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4b57('0x1'))['db'][_0x4b57('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b57('0x3'),'afterUpdate':_0x4b57('0x4'),'afterDestroy':_0x4b57('0x5')};function emitEvent(_0x919851){return function(_0xe2ae86,_0x4a3efa,_0x4eb019){_0xe2ae86[_0x4b57('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x585d86){_0xe2ae86['setDataValue']('Users',_0x585d86[_0x4b57('0x7')](function(_0x2bf397){return{'id':_0x2bf397['id']};}));return SmsMessage[_0x4b57('0x8')]({'where':{'SmsInteractionId':_0xe2ae86['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b57('0x9')](function(_0xce47ad){_0xe2ae86[_0x4b57('0xa')](_0x4b57('0xb'),_0xce47ad[_0x4b57('0xc')]);SmsInteractionEvents['emit'](_0x919851+':'+_0xe2ae86['id'],_0xe2ae86);SmsInteractionEvents[_0x4b57('0xd')](_0x919851,_0xe2ae86);_0x4eb019(null);})[_0x4b57('0xe')](_0x4eb019(null));};}for(var e in events){if(events[_0x4b57('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x14a0=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','setDataValue','Users','findAll','length','emit','catch'];(function(_0x185018,_0x244994){var _0x2ae95b=function(_0x3e60fd){while(--_0x3e60fd){_0x185018['push'](_0x185018['shift']());}};_0x2ae95b(++_0x244994);}(_0x14a0,0x8e));var _0x014a=function(_0x2fe78c,_0x458be9){_0x2fe78c=_0x2fe78c-0x0;var _0x3f18bc=_0x14a0[_0x2fe78c];return _0x3f18bc;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x014a('0x0'))['db'][_0x014a('0x1')];var SmsMessage=require(_0x014a('0x0'))['db'][_0x014a('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x014a('0x3')](0x0);var events={'afterCreate':_0x014a('0x4'),'afterUpdate':_0x014a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57a522){return function(_0x1730a5,_0x12e8da,_0x38a22c){_0x1730a5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x11b8ce){_0x1730a5[_0x014a('0x6')](_0x014a('0x7'),_0x11b8ce['map'](function(_0x5d3d7f){return{'id':_0x5d3d7f['id']};}));return SmsMessage[_0x014a('0x8')]({'where':{'SmsInteractionId':_0x1730a5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x490ea2){_0x1730a5['setDataValue']('unreadMessages',_0x490ea2[_0x014a('0x9')]);SmsInteractionEvents['emit'](_0x57a522+':'+_0x1730a5['id'],_0x1730a5);SmsInteractionEvents[_0x014a('0xa')](_0x57a522,_0x1730a5);_0x38a22c(null);})[_0x014a('0xb')](_0x38a22c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x014a('0xc')](e,emitEvent(event));}}module[_0x014a('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b8957da..1782b5a 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 _0xc949=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','rimraf','./smsInteraction.attributes','define','closed'];(function(_0x652303,_0x1170be){var _0x22998d=function(_0x50bc8b){while(--_0x50bc8b){_0x652303['push'](_0x652303['shift']());}};_0x22998d(++_0x1170be);}(_0xc949,0x1a5));var _0x9c94=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc949[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x9c94('0x0'));var util=require(_0x9c94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c94('0x2'));var BPromise=require(_0x9c94('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c94('0x4'));var config=require('../../config/environment');var attributes=require(_0x9c94('0x5'));module['exports']=function(_0x430467,_0x56e5f0){return _0x430467[_0x9c94('0x6')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x104596,_0xdcf6b8,_0x3091cf){if(_0x104596['changed'](_0x9c94('0x7'))){_0x104596[_0x9c94('0x8')]=moment()[_0x9c94('0x9')](_0x9c94('0xa'));}_0x3091cf(null,_0x104596);}}});}; \ No newline at end of file +var _0x8052=['changed','closed','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions'];(function(_0x527ea2,_0x5dd6b0){var _0x40f3c4=function(_0x1ade90){while(--_0x1ade90){_0x527ea2['push'](_0x527ea2['shift']());}};_0x40f3c4(++_0x5dd6b0);}(_0x8052,0x113));var _0x2805=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x8052[_0xd27ded];return _0x5ef850;};'use strict';var _=require(_0x2805('0x0'));var util=require(_0x2805('0x1'));var logger=require(_0x2805('0x2'))(_0x2805('0x3'));var moment=require(_0x2805('0x4'));var BPromise=require('bluebird');var rp=require(_0x2805('0x5'));var fs=require('fs');var path=require(_0x2805('0x6'));var rimraf=require(_0x2805('0x7'));var config=require(_0x2805('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x2805('0x9')]=function(_0x297f5f,_0x3cb472){return _0x297f5f[_0x2805('0xa')](_0x2805('0xb'),attributes,{'tableName':_0x2805('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13ced0,_0x26a6e0,_0x151dfa){if(_0x13ced0[_0x2805('0xd')](_0x2805('0xe'))){_0x13ced0['closedAt']=moment()[_0x2805('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x151dfa(null,_0x13ced0);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d083319..81fd82a 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 _0x79d0=['update','body','options','raw','attributes','limit','debug','catch','AddTagsToSmsInteraction','where','addTags','ids','omit','spread','AddTags','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','register','request','then','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','UpdateSmsInteraction','SmsInteraction'];(function(_0x4233d4,_0x1bafaa){var _0xc5440b=function(_0x369cc1){while(--_0x369cc1){_0x4233d4['push'](_0x4233d4['shift']());}};_0xc5440b(++_0x1bafaa);}(_0x79d0,0x1de));var _0x079d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x79d0[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x079d('0x0'));var util=require('util');var moment=require(_0x079d('0x1'));var BPromise=require(_0x079d('0x2'));var rs=require(_0x079d('0x3'));var fs=require('fs');var Redis=require(_0x079d('0x4'));var db=require(_0x079d('0x5'))['db'];var utils=require(_0x079d('0x6'));var logger=require(_0x079d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x079d('0x8'));var client=jayson[_0x079d('0x9')][_0x079d('0xa')]({'port':0x232a});config[_0x079d('0xb')]=_[_0x079d('0xc')](config['redis'],{'host':_0x079d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x079d('0xe')](socket);function respondWithRpcPromise(_0x166ed0,_0x366f86,_0x1255d5){return new BPromise(function(_0x3a4cce,_0x2984a7){return client[_0x079d('0xf')](_0x166ed0,_0x1255d5)[_0x079d('0x10')](function(_0xb15beb){logger['info'](_0x079d('0x11'),_0x366f86,'request\x20sent');logger['debug'](_0x079d('0x12'),_0x366f86,_0x079d('0x13'),JSON['stringify'](_0xb15beb));if(_0xb15beb['error']){if(_0xb15beb[_0x079d('0x14')]['code']===0x1f4){logger[_0x079d('0x14')](_0x079d('0x11'),_0x366f86,_0xb15beb[_0x079d('0x14')]['message']);return _0x2984a7(_0xb15beb['error'][_0x079d('0x15')]);}logger[_0x079d('0x14')](_0x079d('0x11'),_0x366f86,_0xb15beb['error'][_0x079d('0x15')]);return _0x3a4cce(_0xb15beb[_0x079d('0x14')][_0x079d('0x15')]);}else{logger[_0x079d('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x366f86,'request\x20sent');_0x3a4cce(_0xb15beb[_0x079d('0x17')][_0x079d('0x15')]);}})['catch'](function(_0xc2f94){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x366f86,_0xc2f94);_0x2984a7(_0xc2f94);});});}exports[_0x079d('0x18')]=function(_0x2c6411){var _0x522562=this;return new Promise(function(_0x5037f1,_0x187b5b){return db[_0x079d('0x19')][_0x079d('0x1a')](_0x2c6411[_0x079d('0x1b')],{'raw':_0x2c6411['options']?_0x2c6411[_0x079d('0x1c')][_0x079d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c6411[_0x079d('0x1c')]?_0x2c6411[_0x079d('0x1c')]['where']||null:null,'attributes':_0x2c6411[_0x079d('0x1c')]?_0x2c6411[_0x079d('0x1c')][_0x079d('0x1e')]||null:null,'limit':_0x2c6411[_0x079d('0x1c')]?_0x2c6411['options'][_0x079d('0x1f')]||null:null})['then'](function(_0x973b4c){logger['info'](_0x079d('0x18'),_0x2c6411);logger[_0x079d('0x20')](_0x079d('0x18'),_0x2c6411,JSON['stringify'](_0x973b4c));_0x5037f1(_0x973b4c);})[_0x079d('0x21')](function(_0x46b407){logger[_0x079d('0x14')](_0x079d('0x18'),_0x46b407[_0x079d('0x15')],_0x2c6411);_0x187b5b(_0x522562['error'](0x1f4,_0x46b407[_0x079d('0x15')]));});});};exports[_0x079d('0x22')]=function(_0x3451ce){return new Promise(function(_0x440267,_0x180f26){return db['SmsInteraction']['find']({'where':_0x3451ce[_0x079d('0x1c')]?_0x3451ce[_0x079d('0x1c')][_0x079d('0x23')]||null:null})[_0x079d('0x10')](function(_0x4bc1d4){if(_0x4bc1d4){return _0x4bc1d4[_0x079d('0x24')](_0x3451ce[_0x079d('0x1b')][_0x079d('0x25')],_[_0x079d('0x26')](_0x3451ce[_0x079d('0x1b')],[_0x079d('0x25'),'id'])||{});}})[_0x079d('0x27')](function(_0x156bdc){logger['info']('AddTags',_0x3451ce);logger[_0x079d('0x20')](_0x079d('0x28'),_0x3451ce,JSON[_0x079d('0x29')](_0x156bdc));_0x440267(_0x156bdc);})[_0x079d('0x21')](function(_0xd1d931){logger[_0x079d('0x14')](_0x079d('0x28'),_0xd1d931[_0x079d('0x15')],_0x3451ce);_0x180f26(_this[_0x079d('0x14')](0x1f4,_0xd1d931['message']));});});}; \ No newline at end of file +var _0x2407=['defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x55ccdf,_0x495a9b){var _0x25fd51=function(_0xd9abd3){while(--_0xd9abd3){_0x55ccdf['push'](_0x55ccdf['shift']());}};_0x25fd51(++_0x495a9b);}(_0x2407,0x16e));var _0x7240=function(_0x225c0c,_0x5071b1){_0x225c0c=_0x225c0c-0x0;var _0x7d45e6=_0x2407[_0x225c0c];return _0x7d45e6;};'use strict';var _=require(_0x7240('0x0'));var util=require(_0x7240('0x1'));var moment=require(_0x7240('0x2'));var BPromise=require(_0x7240('0x3'));var rs=require(_0x7240('0x4'));var fs=require('fs');var Redis=require(_0x7240('0x5'));var db=require(_0x7240('0x6'))['db'];var utils=require(_0x7240('0x7'));var logger=require(_0x7240('0x8'))(_0x7240('0x9'));var config=require(_0x7240('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7240('0xb')]['http']({'port':0x232a});config['redis']=_[_0x7240('0xc')](config['redis'],{'host':_0x7240('0xd'),'port':0x18eb});var socket=require(_0x7240('0xe'))(new Redis(config['redis']));require(_0x7240('0xf'))[_0x7240('0x10')](socket);function respondWithRpcPromise(_0x370519,_0x2201b,_0x3fa8ea){return new BPromise(function(_0x5c0ae5,_0x4a867b){return client['request'](_0x370519,_0x3fa8ea)[_0x7240('0x11')](function(_0x5e2696){logger['info'](_0x7240('0x12'),_0x2201b,_0x7240('0x13'));logger[_0x7240('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2201b,'request\x20sent',JSON[_0x7240('0x15')](_0x5e2696));if(_0x5e2696[_0x7240('0x16')]){if(_0x5e2696[_0x7240('0x16')][_0x7240('0x17')]===0x1f4){logger[_0x7240('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2201b,_0x5e2696[_0x7240('0x16')]['message']);return _0x4a867b(_0x5e2696['error'][_0x7240('0x18')]);}logger['error'](_0x7240('0x12'),_0x2201b,_0x5e2696[_0x7240('0x16')][_0x7240('0x18')]);return _0x5c0ae5(_0x5e2696[_0x7240('0x16')][_0x7240('0x18')]);}else{logger[_0x7240('0x19')](_0x7240('0x12'),_0x2201b,'request\x20sent');_0x5c0ae5(_0x5e2696[_0x7240('0x1a')]['message']);}})[_0x7240('0x1b')](function(_0x510466){logger['error'](_0x7240('0x12'),_0x2201b,_0x510466);_0x4a867b(_0x510466);});});}exports['UpdateSmsInteraction']=function(_0x3547f7){var _0x33aba5=this;return new Promise(function(_0x129e0e,_0x3ebd7c){return db[_0x7240('0x1c')][_0x7240('0x1d')](_0x3547f7[_0x7240('0x1e')],{'raw':_0x3547f7['options']?_0x3547f7[_0x7240('0x1f')][_0x7240('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3547f7['options']?_0x3547f7['options'][_0x7240('0x21')]||null:null,'attributes':_0x3547f7[_0x7240('0x1f')]?_0x3547f7[_0x7240('0x1f')][_0x7240('0x22')]||null:null,'limit':_0x3547f7[_0x7240('0x1f')]?_0x3547f7['options'][_0x7240('0x23')]||null:null})[_0x7240('0x11')](function(_0x346442){logger[_0x7240('0x19')](_0x7240('0x24'),_0x3547f7);logger[_0x7240('0x14')](_0x7240('0x24'),_0x3547f7,JSON[_0x7240('0x15')](_0x346442));_0x129e0e(_0x346442);})[_0x7240('0x1b')](function(_0x9ad41a){logger[_0x7240('0x16')](_0x7240('0x24'),_0x9ad41a[_0x7240('0x18')],_0x3547f7);_0x3ebd7c(_0x33aba5[_0x7240('0x16')](0x1f4,_0x9ad41a[_0x7240('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x1ac9e4){return new Promise(function(_0x11e7cb,_0x56dec8){return db[_0x7240('0x1c')][_0x7240('0x25')]({'where':_0x1ac9e4['options']?_0x1ac9e4[_0x7240('0x1f')][_0x7240('0x21')]||null:null})['then'](function(_0x28533f){if(_0x28533f){return _0x28533f[_0x7240('0x26')](_0x1ac9e4['body'][_0x7240('0x27')],_['omit'](_0x1ac9e4[_0x7240('0x1e')],['ids','id'])||{});}})[_0x7240('0x28')](function(_0x543f9a){logger[_0x7240('0x19')]('AddTags',_0x1ac9e4);logger['debug'](_0x7240('0x29'),_0x1ac9e4,JSON[_0x7240('0x15')](_0x543f9a));_0x11e7cb(_0x543f9a);})[_0x7240('0x1b')](function(_0x97229c){logger['error'](_0x7240('0x29'),_0x97229c[_0x7240('0x18')],_0x1ac9e4);_0x56dec8(_this[_0x7240('0x16')](0x1f4,_0x97229c[_0x7240('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a172d6c..5d9ad94 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 _0xbc48=['length','smsInteraction:','./smsInteraction.events','save','remove','update','removeListener','register'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbc48,0x102));var _0x8bc4=function(_0x5f3057,_0x4b72da){_0x5f3057=_0x5f3057-0x0;var _0x3f985d=_0xbc48[_0x5f3057];return _0x3f985d;};'use strict';var SmsInteractionEvents=require(_0x8bc4('0x0'));var events=[_0x8bc4('0x1'),_0x8bc4('0x2'),_0x8bc4('0x3')];function createListener(_0x40f460,_0x456d1b){return function(_0x4d2a57){_0x456d1b['emit'](_0x40f460,_0x4d2a57);};}function removeListener(_0xc0574b,_0x4fad1d){return function(){SmsInteractionEvents[_0x8bc4('0x4')](_0xc0574b,_0x4fad1d);};}exports[_0x8bc4('0x5')]=function(_0x48f992){for(var _0x4a7923=0x0,_0x23dbd2=events[_0x8bc4('0x6')];_0x4a7923<_0x23dbd2;_0x4a7923++){var _0x58d776=events[_0x4a7923];var _0x19ce87=createListener(_0x8bc4('0x7')+_0x58d776,_0x48f992);SmsInteractionEvents['on'](_0x58d776,_0x19ce87);}}; \ No newline at end of file +var _0x400d=['update','emit','removeListener','length','./smsInteraction.events','save'];(function(_0x45b28f,_0x572cd0){var _0xe8b18b=function(_0x4a464f){while(--_0x4a464f){_0x45b28f['push'](_0x45b28f['shift']());}};_0xe8b18b(++_0x572cd0);}(_0x400d,0x14e));var _0xd400=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x400d[_0x5179a5];return _0x15c8ce;};'use strict';var SmsInteractionEvents=require(_0xd400('0x0'));var events=[_0xd400('0x1'),'remove',_0xd400('0x2')];function createListener(_0x3ef701,_0x22ea64){return function(_0x2adf6a){_0x22ea64[_0xd400('0x3')](_0x3ef701,_0x2adf6a);};}function removeListener(_0x41683c,_0x235c7f){return function(){SmsInteractionEvents[_0xd400('0x4')](_0x41683c,_0x235c7f);};}exports['register']=function(_0x1573a2){for(var _0x5ea00d=0x0,_0x26626d=events[_0xd400('0x5')];_0x5ea00d<_0x26626d;_0x5ea00d++){var _0x5bf9ef=events[_0x5ea00d];var _0x76b758=createListener('smsInteraction:'+_0x5bf9ef,_0x1573a2);SmsInteractionEvents['on'](_0x5bf9ef,_0x76b758);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ec7b24a..952f0da 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 _0x2ebe=['tracked','sms','smsmessage:create','create','status','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0xee8d40,_0x48f91d){var _0x6b2606=function(_0x4d707c){while(--_0x4d707c){_0xee8d40['push'](_0xee8d40['shift']());}};_0x6b2606(++_0x48f91d);}(_0x2ebe,0x125));var _0xe2eb=function(_0x565459,_0x1c2242){_0x565459=_0x565459-0x0;var _0xfbb8e3=_0x2ebe[_0x565459];return _0xfbb8e3;};'use strict';var multer=require(_0xe2eb('0x0'));var util=require(_0xe2eb('0x1'));var path=require(_0xe2eb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe2eb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe2eb('0x4'));var interaction=require(_0xe2eb('0x5'));var config=require(_0xe2eb('0x6'));var controller=require(_0xe2eb('0x7'));router[_0xe2eb('0x8')]('/',auth[_0xe2eb('0x9')](),controller[_0xe2eb('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe2eb('0xb')]);router[_0xe2eb('0x8')](_0xe2eb('0xc'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0xd')]);router[_0xe2eb('0xe')]('/',auth[_0xe2eb('0x9')](),interaction[_0xe2eb('0xf')](_0xe2eb('0x10'),_0xe2eb('0x11')),controller[_0xe2eb('0x12')]);router[_0xe2eb('0xe')]('/:id/status',controller[_0xe2eb('0x13')]);router['put'](_0xe2eb('0xc'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x14')]);router['put'](_0xe2eb('0x15'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x16')]);router[_0xe2eb('0x17')](_0xe2eb('0x18'),auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x19')]);router[_0xe2eb('0x1a')]('/:id',auth[_0xe2eb('0x9')](),controller[_0xe2eb('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x96f0=['delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','post','smsmessage:create','/:id/status','put','update','/:id/accept','accept','reject'];(function(_0x4a94d0,_0x374e5d){var _0x50128a=function(_0x595a2c){while(--_0x595a2c){_0x4a94d0['push'](_0x4a94d0['shift']());}};_0x50128a(++_0x374e5d);}(_0x96f0,0x13b));var _0x096f=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x96f0[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x096f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x096f('0x1'));var router=express[_0x096f('0x2')]();var fs_extra=require(_0x096f('0x3'));var auth=require(_0x096f('0x4'));var interaction=require(_0x096f('0x5'));var config=require(_0x096f('0x6'));var controller=require(_0x096f('0x7'));router[_0x096f('0x8')]('/',auth[_0x096f('0x9')](),controller[_0x096f('0xa')]);router[_0x096f('0x8')](_0x096f('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x096f('0xc'),auth[_0x096f('0x9')](),controller['show']);router[_0x096f('0xd')]('/',auth[_0x096f('0x9')](),interaction['tracked']('sms',_0x096f('0xe')),controller['create']);router[_0x096f('0xd')](_0x096f('0xf'),controller['status']);router[_0x096f('0x10')](_0x096f('0xc'),auth[_0x096f('0x9')](),controller[_0x096f('0x11')]);router[_0x096f('0x10')](_0x096f('0x12'),auth['isAuthenticated'](),controller[_0x096f('0x13')]);router['put']('/:id/reject',auth[_0x096f('0x9')](),controller[_0x096f('0x14')]);router[_0x096f('0x15')](_0x096f('0xc'),auth['isAuthenticated'](),controller[_0x096f('0x16')]);module[_0x096f('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index b884448..2f7e39e 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 _0xbc6b=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xbc6b[_0x46428c];return _0x16a677;};'use strict';var Sequelize=require(_0xbbc6('0x0'));module[_0xbbc6('0x1')]={'body':{'type':Sequelize[_0xbbc6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbbc6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbc6('0x4')]('in',_0xbbc6('0x5')),'defaultValue':_0xbbc6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xbbc6('0x6')]},'readAt':{'type':Sequelize[_0xbbc6('0x7')]},'secret':{'type':Sequelize[_0xbbc6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbbc6('0x6')]},'providerResponse':{'type':Sequelize[_0xbbc6('0x2')]}}; \ No newline at end of file +var _0xec47=['ENUM','out','STRING','TEXT','sequelize','medium','BOOLEAN'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xec47,0x170));var _0x7ec4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xec47[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0x7ec4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7ec4('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7ec4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7ec4('0x3')]('in',_0x7ec4('0x4')),'defaultValue':_0x7ec4('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7ec4('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7ec4('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7ec4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 154e3f9..5cd5483 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 _0x6606=['json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','name','send','index','map','SmsMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','find','create','body','update','params','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','UserId','user','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','User','agent','email','manual','interface','channel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','QueryTypes','SELECT','fullname','SIP/%s','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','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','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','message','SmsMessage,\x20%s,\x20%s','catch','sendStatus','end'];(function(_0x3e1ece,_0x321203){var _0x7be675=function(_0x5480b2){while(--_0x5480b2){_0x3e1ece['push'](_0x3e1ece['shift']());}};_0x7be675(++_0x321203);}(_0x6606,0x6a));var _0x6660=function(_0x4649ca,_0x45c299){_0x4649ca=_0x4649ca-0x0;var _0x71f7cc=_0x6606[_0x4649ca];return _0x71f7cc;};'use strict';var emlformat=require(_0x6660('0x0'));var rimraf=require(_0x6660('0x1'));var zipdir=require(_0x6660('0x2'));var jsonpatch=require(_0x6660('0x3'));var rp=require(_0x6660('0x4'));var moment=require(_0x6660('0x5'));var BPromise=require(_0x6660('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6660('0x7'));var sox=require('sox');var csv=require(_0x6660('0x8'));var ejs=require(_0x6660('0x9'));var fs=require('fs');var fs_extra=require(_0x6660('0xa'));var _=require(_0x6660('0xb'));var squel=require('squel');var crypto=require(_0x6660('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6660('0x8'));var querystring=require(_0x6660('0xd'));var Papa=require(_0x6660('0xe'));var Redis=require(_0x6660('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6660('0x10'));var logger=require('../../config/logger')(_0x6660('0x11'));var utils=require(_0x6660('0x12'));var config=require(_0x6660('0x13'));var licenseUtil=require(_0x6660('0x14'));var db=require('../../mysqldb')['db'];config[_0x6660('0x15')]=_['defaults'](config[_0x6660('0x15')],{'host':_0x6660('0x16'),'port':0x18eb});var socket=require(_0x6660('0x17'))(new Redis(config[_0x6660('0x15')]));require(_0x6660('0x18'))['register'](socket);var jayson=require(_0x6660('0x19'));var client=jayson[_0x6660('0x1a')][_0x6660('0x1b')]({'port':0x232c});var client9002=jayson[_0x6660('0x1a')][_0x6660('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x116a22,_0x414abc,_0x34551e,_0x531d78){return new BPromise(function(_0x41d891,_0x125bba){var _0x85bc01=_0x531d78||client;return _0x85bc01[_0x6660('0x1c')](_0x116a22,_0x34551e)[_0x6660('0x1d')](function(_0x1bf802){logger[_0x6660('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x414abc,_0x6660('0x1f'));logger[_0x6660('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x414abc,'request\x20sent',JSON['stringify'](_0x1bf802));if(_0x1bf802[_0x6660('0x21')]){if(_0x1bf802['error']['code']===0x1f4){logger[_0x6660('0x21')]('SmsMessage,\x20%s,\x20%s',_0x414abc,_0x1bf802['error'][_0x6660('0x22')]);return _0x125bba(_0x1bf802[_0x6660('0x21')][_0x6660('0x22')]);}logger[_0x6660('0x21')](_0x6660('0x23'),_0x414abc,_0x1bf802[_0x6660('0x21')]['message']);return _0x41d891(_0x1bf802[_0x6660('0x21')][_0x6660('0x22')]);}else{logger[_0x6660('0x1e')](_0x6660('0x23'),_0x414abc,_0x6660('0x1f'));_0x41d891(_0x1bf802['result'][_0x6660('0x22')]);}})[_0x6660('0x24')](function(_0x323a4a){logger['error']('SmsMessage,\x20%s,\x20%s',_0x414abc,_0x323a4a);_0x125bba(_0x323a4a);});});}function respondWithStatusCode(_0x520f8f,_0x53736c){_0x53736c=_0x53736c||0xcc;return function(_0x5b8c3b){if(_0x5b8c3b){return _0x520f8f[_0x6660('0x25')](_0x53736c);}return _0x520f8f['status'](_0x53736c)[_0x6660('0x26')]();};}function respondWithResult(_0x5c8b81,_0x141b6d){_0x141b6d=_0x141b6d||0xc8;return function(_0x29ece6){if(_0x29ece6){return _0x5c8b81['status'](_0x141b6d)[_0x6660('0x27')](_0x29ece6);}};}function respondWithFilteredResult(_0x25be51,_0x4b782c){return function(_0xbd7375){if(_0xbd7375){var _0x58a20f=typeof _0x4b782c[_0x6660('0x28')]===_0x6660('0x29')&&typeof _0x4b782c[_0x6660('0x2a')]===_0x6660('0x29');var _0x5662ea=_0xbd7375[_0x6660('0x2b')];var _0x34f9d3=_0x58a20f?0x0:_0x4b782c[_0x6660('0x28')];var _0x1c27da=_0x58a20f?_0xbd7375[_0x6660('0x2b')]:_0x4b782c[_0x6660('0x28')]+_0x4b782c[_0x6660('0x2a')];var _0x19e756;if(_0x1c27da>=_0x5662ea){_0x1c27da=_0x5662ea;_0x19e756=0xc8;}else{_0x19e756=0xce;}_0x25be51[_0x6660('0x2c')](_0x19e756);return _0x25be51[_0x6660('0x2d')](_0x6660('0x2e'),_0x34f9d3+'-'+_0x1c27da+'/'+_0x5662ea)[_0x6660('0x27')](_0xbd7375);}return null;};}function patchUpdates(_0x33b3e2){return function(_0x432828){try{jsonpatch[_0x6660('0x2f')](_0x432828,_0x33b3e2,!![]);}catch(_0x22f8f8){return BPromise[_0x6660('0x30')](_0x22f8f8);}return _0x432828[_0x6660('0x31')]();};}function saveUpdates(_0x44cb5c,_0x3c8761){return function(_0x1864b2){if(_0x1864b2){return _0x1864b2['update'](_0x44cb5c)[_0x6660('0x1d')](function(_0x2c0c63){return _0x2c0c63;});}return null;};}function removeEntity(_0xfc404c,_0x17fef1){return function(_0x4568eb){if(_0x4568eb){return _0x4568eb[_0x6660('0x32')]()['then'](function(){_0xfc404c['status'](0xcc)[_0x6660('0x26')]();});}};}function handleEntityNotFound(_0x147bb8,_0x39f0c3){return function(_0x46fa86){if(!_0x46fa86){_0x147bb8[_0x6660('0x25')](0x194);}return _0x46fa86;};}function handleError(_0x2fc96f,_0x1f745b){_0x1f745b=_0x1f745b||0x1f4;return function(_0x3c050a){logger[_0x6660('0x21')](_0x3c050a['stack']);if(_0x3c050a[_0x6660('0x33')]){delete _0x3c050a[_0x6660('0x33')];}_0x2fc96f[_0x6660('0x2c')](_0x1f745b)[_0x6660('0x34')](_0x3c050a);};}exports[_0x6660('0x35')]=function(_0x47fd1,_0x4a42a0){var _0x352af5={},_0x1d0b97={},_0x1723c1={'count':0x0,'rows':[]};var _0x5dc5c5=_[_0x6660('0x36')](db[_0x6660('0x37')]['rawAttributes'],function(_0x489f13){return{'name':_0x489f13[_0x6660('0x38')],'type':_0x489f13[_0x6660('0x39')][_0x6660('0x3a')]};});_0x1d0b97[_0x6660('0x3b')]=_['map'](_0x5dc5c5,_0x6660('0x33'));_0x1d0b97[_0x6660('0x3c')]=_[_0x6660('0x3d')](_0x47fd1[_0x6660('0x3c')]);_0x1d0b97[_0x6660('0x3e')]=_[_0x6660('0x3f')](_0x1d0b97[_0x6660('0x3b')],_0x1d0b97[_0x6660('0x3c')]);_0x352af5[_0x6660('0x40')]=_[_0x6660('0x3f')](_0x1d0b97[_0x6660('0x3b')],qs[_0x6660('0x41')](_0x47fd1[_0x6660('0x3c')][_0x6660('0x41')]));_0x352af5[_0x6660('0x40')]=_0x352af5[_0x6660('0x40')][_0x6660('0x42')]?_0x352af5['attributes']:_0x1d0b97['model'];if(!_0x47fd1[_0x6660('0x3c')][_0x6660('0x43')](_0x6660('0x44'))){_0x352af5[_0x6660('0x2a')]=qs['limit'](_0x47fd1['query'][_0x6660('0x2a')]);_0x352af5[_0x6660('0x28')]=qs[_0x6660('0x28')](_0x47fd1[_0x6660('0x3c')][_0x6660('0x28')]);}_0x352af5['order']=qs[_0x6660('0x45')](_0x47fd1[_0x6660('0x3c')][_0x6660('0x45')]);_0x352af5['where']=qs[_0x6660('0x3e')](_[_0x6660('0x46')](_0x47fd1[_0x6660('0x3c')],_0x1d0b97[_0x6660('0x3e')]),_0x5dc5c5);if(_0x47fd1[_0x6660('0x3c')][_0x6660('0x47')]){_0x352af5[_0x6660('0x48')]=_[_0x6660('0x49')](_0x352af5[_0x6660('0x48')],{'$or':_['map'](_0x5dc5c5,function(_0x3d812f){if(_0x3d812f[_0x6660('0x39')]!==_0x6660('0x4a')){var _0x39c722={};_0x39c722[_0x3d812f[_0x6660('0x33')]]={'$like':'%'+_0x47fd1[_0x6660('0x3c')]['filter']+'%'};return _0x39c722;}})});}_0x352af5=_[_0x6660('0x49')]({},_0x352af5,_0x47fd1[_0x6660('0x4b')]);var _0x2e3ee5={'where':_0x352af5['where']};return db[_0x6660('0x37')][_0x6660('0x2b')](_0x2e3ee5)[_0x6660('0x1d')](function(_0x12f894){_0x1723c1[_0x6660('0x2b')]=_0x12f894;if(_0x47fd1['query'][_0x6660('0x4c')]){_0x352af5[_0x6660('0x4d')]=[{'all':!![]}];}return db[_0x6660('0x37')][_0x6660('0x4e')](_0x352af5);})[_0x6660('0x1d')](function(_0x1849fb){_0x1723c1[_0x6660('0x4f')]=_0x1849fb;return _0x1723c1;})[_0x6660('0x1d')](respondWithFilteredResult(_0x4a42a0,_0x352af5))[_0x6660('0x24')](handleError(_0x4a42a0,null));};exports['show']=function(_0x4d1abe,_0x3c7813){var _0x1d79fb={'raw':!![],'where':{'id':_0x4d1abe['params']['id']}},_0x208268={};_0x208268[_0x6660('0x3b')]=_[_0x6660('0x3d')](db[_0x6660('0x37')][_0x6660('0x50')]);_0x208268[_0x6660('0x3c')]=_[_0x6660('0x3d')](_0x4d1abe['query']);_0x208268[_0x6660('0x3e')]=_[_0x6660('0x3f')](_0x208268['model'],_0x208268[_0x6660('0x3c')]);_0x1d79fb[_0x6660('0x40')]=_[_0x6660('0x3f')](_0x208268['model'],qs[_0x6660('0x41')](_0x4d1abe['query']['fields']));_0x1d79fb[_0x6660('0x40')]=_0x1d79fb[_0x6660('0x40')][_0x6660('0x42')]?_0x1d79fb[_0x6660('0x40')]:_0x208268[_0x6660('0x3b')];if(_0x4d1abe[_0x6660('0x3c')]['includeAll']){_0x1d79fb['include']=[{'all':!![]}];}_0x1d79fb=_[_0x6660('0x49')]({},_0x1d79fb,_0x4d1abe['options']);return db['SmsMessage'][_0x6660('0x51')](_0x1d79fb)[_0x6660('0x1d')](handleEntityNotFound(_0x3c7813,null))[_0x6660('0x1d')](respondWithResult(_0x3c7813,null))['catch'](handleError(_0x3c7813,null));};exports['create']=function(_0x4ae38a,_0x5d270a){return db['SmsMessage'][_0x6660('0x52')](_0x4ae38a[_0x6660('0x53')],{})[_0x6660('0x1d')](respondWithResult(_0x5d270a,0xc9))[_0x6660('0x24')](handleError(_0x5d270a,null));};exports[_0x6660('0x54')]=function(_0x3b7c17,_0x2df982){if(_0x3b7c17[_0x6660('0x53')]['id']){delete _0x3b7c17['body']['id'];}return db[_0x6660('0x37')][_0x6660('0x51')]({'where':{'id':_0x3b7c17['params']['id']}})['then'](handleEntityNotFound(_0x2df982,null))[_0x6660('0x1d')](saveUpdates(_0x3b7c17[_0x6660('0x53')],null))[_0x6660('0x1d')](respondWithResult(_0x2df982,null))[_0x6660('0x24')](handleError(_0x2df982,null));};exports[_0x6660('0x32')]=function(_0x5377f5,_0xf1d80a){return db['SmsMessage'][_0x6660('0x51')]({'where':{'id':_0x5377f5[_0x6660('0x55')]['id']}})[_0x6660('0x1d')](handleEntityNotFound(_0xf1d80a,null))[_0x6660('0x1d')](removeEntity(_0xf1d80a,null))[_0x6660('0x24')](handleError(_0xf1d80a,null));};exports[_0x6660('0x56')]=function(_0x31f962,_0x140ac1){return db[_0x6660('0x37')][_0x6660('0x56')]()[_0x6660('0x1d')](respondWithResult(_0x140ac1,null))[_0x6660('0x24')](handleError(_0x140ac1,null));};var interaction_log=require(_0x6660('0x57'))(_0x6660('0x58'));exports[_0x6660('0x59')]=function(_0x2667dd,_0x4d323e,_0x5cfedf){var _0x36c6d3={'agent':{},'channel':_0x6660('0x5a')};if(_0x2667dd[_0x6660('0x53')]['id']){delete _0x2667dd[_0x6660('0x53')]['id'];}_0x2667dd['body'][_0x6660('0x5b')]=!![];_0x2667dd[_0x6660('0x53')][_0x6660('0x5c')]=moment()[_0x6660('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2667dd[_0x6660('0x53')][_0x6660('0x5e')]=_0x2667dd['body'][_0x6660('0x5e')]||_0x2667dd[_0x6660('0x5f')]['id'];_0x36c6d3['agent']['id']=_0x2667dd['body']['UserId'];return db[_0x6660('0x37')][_0x6660('0x51')]({'where':{'id':_0x2667dd['params']['id'],'UserId':null}})[_0x6660('0x1d')](handleEntityNotFound(_0x4d323e,null))[_0x6660('0x1d')](saveUpdates(_0x2667dd[_0x6660('0x53')],null))[_0x6660('0x1d')](function(_0x1186d3){if(_0x1186d3){_0x36c6d3[_0x6660('0x22')]=_0x1186d3['get']({'plain':!![]});return db['SmsInteraction'][_0x6660('0x51')]({'where':{'id':_0x1186d3[_0x6660('0x60')]}});}return null;})[_0x6660('0x1d')](handleEntityNotFound(_0x4d323e,null))[_0x6660('0x1d')](function(_0x53d3a1){if(_0x53d3a1){return _0x53d3a1[_0x6660('0x54')]({'UserId':_0x2667dd[_0x6660('0x53')]['UserId'],'read1stAt':_[_0x6660('0x61')](_0x53d3a1['read1stAt'])?moment()[_0x6660('0x5d')](_0x6660('0x62')):undefined});}return null;})[_0x6660('0x1d')](function(_0x2b6fa0){if(_0x2b6fa0){_0x36c6d3[_0x6660('0x63')]=_0x2b6fa0['get']({'plain':!![]});interaction_log['info'](_0x6660('0x64'),_0x2667dd[_0x6660('0x5f')]['id'],_0x2667dd[_0x6660('0x5f')]['name'],_0x2667dd['user'][_0x6660('0x65')],_0x36c6d3[_0x6660('0x63')]['id'],_0x2667dd['body']?JSON[_0x6660('0x66')](_0x2667dd[_0x6660('0x53')]):_0x6660('0x67'));return respondWithRpcPromise(_0x6660('0x68'),_0x6660('0x69'),_0x36c6d3);}return null;})[_0x6660('0x1d')](function(_0x1f54df){var _0x122462=_0x6660('0x6a')+_0x1f54df[_0x6660('0x22')]['ContactId'];return db[_0x6660('0x6b')][_0x6660('0x3c')](_0x122462,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x6660('0x1d')](function(_0x945c1a){return _0x945c1a;});})['then'](function(_0x2ffbe6){if(_0x2ffbe6){_0x36c6d3[_0x6660('0x22')][_0x6660('0x6c')]=_0x2ffbe6[0x0];if(!_0x2667dd['body'][_0x6660('0x5e')])return;return db[_0x6660('0x6d')][_0x6660('0x51')]({'where':{'id':_0x2667dd[_0x6660('0x53')]['UserId'],'role':_0x6660('0x6e')},'attributes':['id',_0x6660('0x33'),'fullname',_0x6660('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1565d3){if(!_0x1565d3)return null;_0x36c6d3[_0x6660('0x22')]['agent']=_0x1565d3;return _0x36c6d3;})[_0x6660('0x1d')](function(_0x2bb49c){if(_0x2bb49c){if(_0x2667dd[_0x6660('0x53')][_0x6660('0x70')]){_0x36c6d3[_0x6660('0x22')][_0x6660('0x71')]=util[_0x6660('0x5d')]('SIP/%s',_0x2667dd[_0x6660('0x5f')][_0x6660('0x33')]);_0x36c6d3[_0x6660('0x22')][_0x6660('0x72')]=_0x36c6d3[_0x6660('0x72')];_0x36c6d3['message']['motionChannel']=_0x36c6d3[_0x6660('0x72')];_0x36c6d3['message'][_0x6660('0x73')]='accept';return respondWithRpcPromise(_0x6660('0x74'),_0x6660('0x74'),{'event':_0x6660('0x75'),'message':_0x36c6d3[_0x6660('0x22')]},client9002)[_0x6660('0x1d')](function(){return _0x36c6d3;});}return _0x36c6d3;}return null;})[_0x6660('0x1d')](respondWithResult(_0x4d323e,null))[_0x6660('0x24')](handleError(_0x4d323e,null));};var interaction_log=require(_0x6660('0x57'))(_0x6660('0x58'));exports[_0x6660('0x30')]=function(_0x9b4c08,_0x5bf4f4,_0x164edf){var _0x56d8cf={'agent':{},'channel':'sms'};if(_0x9b4c08['body']['id']){delete _0x9b4c08[_0x6660('0x53')]['id'];}_0x9b4c08[_0x6660('0x53')][_0x6660('0x5e')]=_0x9b4c08[_0x6660('0x53')]['UserId']||_0x9b4c08[_0x6660('0x5f')]['id'];_0x56d8cf['agent']['id']=_0x9b4c08[_0x6660('0x53')][_0x6660('0x5e')];return db[_0x6660('0x37')]['find']({'where':{'id':_0x9b4c08[_0x6660('0x55')]['id'],'UserId':null}})[_0x6660('0x1d')](handleEntityNotFound(_0x5bf4f4,null))['then'](function(_0x29715d){if(_0x29715d){_0x56d8cf[_0x6660('0x22')]=_0x29715d[_0x6660('0x76')]({'plain':!![]});return db['SmsInteraction'][_0x6660('0x51')]({'where':{'id':_0x29715d['SmsInteractionId']}});}return null;})[_0x6660('0x1d')](handleEntityNotFound(_0x5bf4f4,null))[_0x6660('0x1d')](function(_0x3076a4){if(_0x3076a4){_0x56d8cf[_0x6660('0x63')]=_0x3076a4[_0x6660('0x76')]({'plain':!![]});interaction_log[_0x6660('0x1e')](_0x6660('0x77'),_0x9b4c08['user']['id'],_0x9b4c08['user'][_0x6660('0x33')],_0x9b4c08['user']['role'],_0x56d8cf[_0x6660('0x63')]['id'],_0x9b4c08[_0x6660('0x53')]?JSON[_0x6660('0x66')](_0x9b4c08[_0x6660('0x53')]):_0x6660('0x67'));return respondWithRpcPromise('RejectMessage',_0x6660('0x78'),_0x56d8cf);}return null;})[_0x6660('0x1d')](function(_0x1a3b82){var _0xbf675='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a3b82['message'][_0x6660('0x79')];return db[_0x6660('0x6b')][_0x6660('0x3c')](_0xbf675,{'type':db['Sequelize'][_0x6660('0x7a')][_0x6660('0x7b')],'raw':!![]})[_0x6660('0x1d')](function(_0x38d6a9){return _0x38d6a9;});})[_0x6660('0x1d')](function(_0x430ec2){if(_0x430ec2){_0x56d8cf['message'][_0x6660('0x6c')]=_0x430ec2[0x0];if(!_0x9b4c08['body'][_0x6660('0x5e')])return;return db[_0x6660('0x6d')][_0x6660('0x51')]({'where':{'id':_0x9b4c08['body'][_0x6660('0x5e')],'role':'agent'},'attributes':['id',_0x6660('0x33'),_0x6660('0x7c'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x419035){if(!_0x419035)return null;_0x56d8cf[_0x6660('0x22')][_0x6660('0x6e')]=_0x419035;return _0x56d8cf;})[_0x6660('0x1d')](function(_0x3a992e){if(_0x3a992e){_0x3a992e[_0x6660('0x22')][_0x6660('0x71')]=util[_0x6660('0x5d')](_0x6660('0x7d'),_0x9b4c08[_0x6660('0x5f')][_0x6660('0x33')]);_0x3a992e[_0x6660('0x22')][_0x6660('0x72')]=_0x56d8cf[_0x6660('0x72')];_0x3a992e[_0x6660('0x22')]['motionChannel']=_0x56d8cf[_0x6660('0x72')];_0x3a992e[_0x6660('0x22')][_0x6660('0x73')]=_0x6660('0x30');respondWithRpcPromise(_0x6660('0x74'),_0x6660('0x74'),{'event':_0x6660('0x7e'),'message':_0x3a992e[_0x6660('0x22')]},client9002);return _0x56d8cf;}return null;})[_0x6660('0x1d')](respondWithResult(_0x5bf4f4,null))[_0x6660('0x24')](handleError(_0x5bf4f4,null));};exports[_0x6660('0x2c')]=function(_0x3b59b8,_0x168a08,_0x325bf3){if(_0x3b59b8[_0x6660('0x53')]['id']){delete _0x3b59b8['body']['id'];}var _0x15c059;return db[_0x6660('0x37')][_0x6660('0x51')]({'where':{'id':_0x3b59b8[_0x6660('0x55')]['id']}})[_0x6660('0x1d')](handleEntityNotFound(_0x168a08,null))['then'](function(_0x4a4433){if(_0x4a4433){_0x15c059=_0x4a4433;return db[_0x6660('0x7f')][_0x6660('0x51')]({'where':{'id':_0x4a4433['SmsAccountId']}});}})[_0x6660('0x1d')](handleEntityNotFound(_0x168a08,null))['then'](function(_0x57248a){if(_0x57248a){logger[_0x6660('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6660('0x2c'),_0x6660('0x80'),_0x57248a[_0x6660('0x39')],util['inspect'](_0x3b59b8[_0x6660('0x53')],{'showHidden':![],'depth':null}));switch(_0x57248a[_0x6660('0x39')]){case _0x6660('0x81'):if(_0x3b59b8['body'][_0x6660('0x82')]&&_0x3b59b8[_0x6660('0x53')][_0x6660('0x82')]===_0x15c059[_0x6660('0x83')]){return _0x15c059[_0x6660('0x54')]({'read':!![]});}else{logger[_0x6660('0x21')](_0x6660('0x84'),_0x6660('0x2c'),'twilio',util[_0x6660('0x85')](_0x3b59b8[_0x6660('0x53')],{'showHidden':![],'depth':null}));}break;case _0x6660('0x86'):if(_0x3b59b8['body']['MessageUUID']&&_0x3b59b8[_0x6660('0x53')][_0x6660('0x87')]===_0x15c059[_0x6660('0x83')]&&_[_0x6660('0x88')]([_0x6660('0x89'),_0x6660('0x8a')],_0x3b59b8[_0x6660('0x53')][_0x6660('0x8b')])>=0x0){return _0x15c059['update']({'read':!![]});}else{logger[_0x6660('0x21')](_0x6660('0x84'),_0x6660('0x2c'),_0x6660('0x8c'),util[_0x6660('0x85')](_0x3b59b8['body'],{'showHidden':![],'depth':null}));}break;case _0x6660('0x8d'):var _0x1335e8=_0x3b59b8[_0x6660('0x53')][_0x6660('0x8e')][0x0];if(_0x1335e8[_0x6660('0x2c')][_0x6660('0x8f')]===_0x6660('0x90')){return _0x15c059[_0x6660('0x54')]({'read':!![]});}else{logger['error'](_0x6660('0x84'),'status',_0x6660('0x8d'),util[_0x6660('0x85')](_0x3b59b8['body'],{'showHidden':![],'depth':null}));}break;}return _0x15c059;}})['then'](respondWithResult(_0x168a08,null))[_0x6660('0x24')](handleError(_0x168a08,null));}; \ No newline at end of file +var _0x29b6=['fields','length','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','rawAttributes','keys','includeAll','create','body','find','params','destroy','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','SELECT','contact','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','delivered','Status','infobip','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./smsMessage.socket','register','client','http','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','index','map','SmsMessage','fieldName','key','model','query','filters','intersection'];(function(_0x4c7ca9,_0x378fc5){var _0x2ba07e=function(_0x48f357){while(--_0x48f357){_0x4c7ca9['push'](_0x4c7ca9['shift']());}};_0x2ba07e(++_0x378fc5);}(_0x29b6,0x17e));var _0x629b=function(_0x4aa1f6,_0x16495f){_0x4aa1f6=_0x4aa1f6-0x0;var _0x4abc07=_0x29b6[_0x4aa1f6];return _0x4abc07;};'use strict';var emlformat=require(_0x629b('0x0'));var rimraf=require(_0x629b('0x1'));var zipdir=require(_0x629b('0x2'));var jsonpatch=require(_0x629b('0x3'));var rp=require(_0x629b('0x4'));var moment=require(_0x629b('0x5'));var BPromise=require(_0x629b('0x6'));var Mustache=require(_0x629b('0x7'));var util=require(_0x629b('0x8'));var path=require(_0x629b('0x9'));var sox=require('sox');var csv=require(_0x629b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x629b('0xb'));var _=require(_0x629b('0xc'));var squel=require(_0x629b('0xd'));var crypto=require(_0x629b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x629b('0xf'));var toCsv=require(_0x629b('0xa'));var querystring=require('querystring');var Papa=require(_0x629b('0x10'));var Redis=require(_0x629b('0x11'));var authService=require(_0x629b('0x12'));var qs=require(_0x629b('0x13'));var as=require(_0x629b('0x14'));var hardwareService=require(_0x629b('0x15'));var logger=require(_0x629b('0x16'))(_0x629b('0x17'));var utils=require(_0x629b('0x18'));var config=require(_0x629b('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x629b('0x1a')]=_[_0x629b('0x1b')](config[_0x629b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x629b('0x1c'))(new Redis(config[_0x629b('0x1a')]));require(_0x629b('0x1d'))[_0x629b('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x629b('0x1f')][_0x629b('0x20')]({'port':0x232c});var client9002=jayson[_0x629b('0x1f')][_0x629b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2c1f4f,_0x4ba9ae,_0x2a4d96,_0x4b0cfb){return new BPromise(function(_0x151b93,_0x2b0a74){var _0x204bb4=_0x4b0cfb||client;return _0x204bb4['request'](_0x2c1f4f,_0x2a4d96)[_0x629b('0x21')](function(_0x58f5a8){logger[_0x629b('0x22')]('SmsMessage,\x20%s,\x20%s',_0x4ba9ae,_0x629b('0x23'));logger['debug'](_0x629b('0x24'),_0x4ba9ae,_0x629b('0x23'),JSON[_0x629b('0x25')](_0x58f5a8));if(_0x58f5a8['error']){if(_0x58f5a8[_0x629b('0x26')]['code']===0x1f4){logger[_0x629b('0x26')](_0x629b('0x27'),_0x4ba9ae,_0x58f5a8[_0x629b('0x26')][_0x629b('0x28')]);return _0x2b0a74(_0x58f5a8['error'][_0x629b('0x28')]);}logger['error'](_0x629b('0x27'),_0x4ba9ae,_0x58f5a8[_0x629b('0x26')][_0x629b('0x28')]);return _0x151b93(_0x58f5a8['error'][_0x629b('0x28')]);}else{logger[_0x629b('0x22')](_0x629b('0x27'),_0x4ba9ae,_0x629b('0x23'));_0x151b93(_0x58f5a8[_0x629b('0x29')][_0x629b('0x28')]);}})[_0x629b('0x2a')](function(_0x547b3c){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4ba9ae,_0x547b3c);_0x2b0a74(_0x547b3c);});});}function respondWithStatusCode(_0x58b320,_0x3e1e25){_0x3e1e25=_0x3e1e25||0xcc;return function(_0x31c0b3){if(_0x31c0b3){return _0x58b320[_0x629b('0x2b')](_0x3e1e25);}return _0x58b320[_0x629b('0x2c')](_0x3e1e25)[_0x629b('0x2d')]();};}function respondWithResult(_0x40ae3c,_0x4c1f21){_0x4c1f21=_0x4c1f21||0xc8;return function(_0x43bc04){if(_0x43bc04){return _0x40ae3c[_0x629b('0x2c')](_0x4c1f21)[_0x629b('0x2e')](_0x43bc04);}};}function respondWithFilteredResult(_0x12d5fc,_0x12cc51){return function(_0x16c365){if(_0x16c365){var _0x3ef549=typeof _0x12cc51[_0x629b('0x2f')]==='undefined'&&typeof _0x12cc51['limit']===_0x629b('0x30');var _0x2fb97d=_0x16c365['count'];var _0x1628cb=_0x3ef549?0x0:_0x12cc51['offset'];var _0x86ee7c=_0x3ef549?_0x16c365[_0x629b('0x31')]:_0x12cc51['offset']+_0x12cc51[_0x629b('0x32')];var _0x16d968;if(_0x86ee7c>=_0x2fb97d){_0x86ee7c=_0x2fb97d;_0x16d968=0xc8;}else{_0x16d968=0xce;}_0x12d5fc[_0x629b('0x2c')](_0x16d968);return _0x12d5fc[_0x629b('0x33')](_0x629b('0x34'),_0x1628cb+'-'+_0x86ee7c+'/'+_0x2fb97d)[_0x629b('0x2e')](_0x16c365);}return null;};}function patchUpdates(_0x5550bd){return function(_0x269c0a){try{jsonpatch[_0x629b('0x35')](_0x269c0a,_0x5550bd,!![]);}catch(_0x2b21a3){return BPromise[_0x629b('0x36')](_0x2b21a3);}return _0x269c0a[_0x629b('0x37')]();};}function saveUpdates(_0x3c75cb,_0x198729){return function(_0x1f4cf6){if(_0x1f4cf6){return _0x1f4cf6[_0x629b('0x38')](_0x3c75cb)[_0x629b('0x21')](function(_0x229c50){return _0x229c50;});}return null;};}function removeEntity(_0x1dcc06,_0x2f8b21){return function(_0x4f2e44){if(_0x4f2e44){return _0x4f2e44['destroy']()[_0x629b('0x21')](function(){_0x1dcc06[_0x629b('0x2c')](0xcc)[_0x629b('0x2d')]();});}};}function handleEntityNotFound(_0x25ee68,_0x564590){return function(_0x311e82){if(!_0x311e82){_0x25ee68[_0x629b('0x2b')](0x194);}return _0x311e82;};}function handleError(_0x15ce4c,_0x46f403){_0x46f403=_0x46f403||0x1f4;return function(_0x4c1a34){logger[_0x629b('0x26')](_0x4c1a34[_0x629b('0x39')]);if(_0x4c1a34[_0x629b('0x3a')]){delete _0x4c1a34[_0x629b('0x3a')];}_0x15ce4c[_0x629b('0x2c')](_0x46f403)['send'](_0x4c1a34);};}exports[_0x629b('0x3b')]=function(_0x4024c7,_0x20c488){var _0x37daad={},_0x3b8100={},_0x36f47e={'count':0x0,'rows':[]};var _0x384783=_[_0x629b('0x3c')](db[_0x629b('0x3d')]['rawAttributes'],function(_0x3b2506){return{'name':_0x3b2506[_0x629b('0x3e')],'type':_0x3b2506['type'][_0x629b('0x3f')]};});_0x3b8100[_0x629b('0x40')]=_[_0x629b('0x3c')](_0x384783,_0x629b('0x3a'));_0x3b8100['query']=_['keys'](_0x4024c7[_0x629b('0x41')]);_0x3b8100[_0x629b('0x42')]=_[_0x629b('0x43')](_0x3b8100[_0x629b('0x40')],_0x3b8100[_0x629b('0x41')]);_0x37daad['attributes']=_[_0x629b('0x43')](_0x3b8100[_0x629b('0x40')],qs[_0x629b('0x44')](_0x4024c7[_0x629b('0x41')][_0x629b('0x44')]));_0x37daad['attributes']=_0x37daad['attributes'][_0x629b('0x45')]?_0x37daad[_0x629b('0x46')]:_0x3b8100[_0x629b('0x40')];if(!_0x4024c7[_0x629b('0x41')][_0x629b('0x47')](_0x629b('0x48'))){_0x37daad[_0x629b('0x32')]=qs[_0x629b('0x32')](_0x4024c7['query'][_0x629b('0x32')]);_0x37daad[_0x629b('0x2f')]=qs[_0x629b('0x2f')](_0x4024c7[_0x629b('0x41')][_0x629b('0x2f')]);}_0x37daad['order']=qs['sort'](_0x4024c7[_0x629b('0x41')][_0x629b('0x49')]);_0x37daad[_0x629b('0x4a')]=qs[_0x629b('0x42')](_['pick'](_0x4024c7[_0x629b('0x41')],_0x3b8100['filters']),_0x384783);if(_0x4024c7[_0x629b('0x41')][_0x629b('0x4b')]){_0x37daad['where']=_[_0x629b('0x4c')](_0x37daad[_0x629b('0x4a')],{'$or':_[_0x629b('0x3c')](_0x384783,function(_0x309665){if(_0x309665[_0x629b('0x4d')]!==_0x629b('0x4e')){var _0x4f8a5b={};_0x4f8a5b[_0x309665['name']]={'$like':'%'+_0x4024c7[_0x629b('0x41')][_0x629b('0x4b')]+'%'};return _0x4f8a5b;}})});}_0x37daad=_[_0x629b('0x4c')]({},_0x37daad,_0x4024c7[_0x629b('0x4f')]);var _0x23df71={'where':_0x37daad[_0x629b('0x4a')]};return db[_0x629b('0x3d')]['count'](_0x23df71)['then'](function(_0x4143fe){_0x36f47e['count']=_0x4143fe;if(_0x4024c7[_0x629b('0x41')]['includeAll']){_0x37daad[_0x629b('0x50')]=[{'all':!![]}];}return db[_0x629b('0x3d')][_0x629b('0x51')](_0x37daad);})[_0x629b('0x21')](function(_0x1422dd){_0x36f47e[_0x629b('0x52')]=_0x1422dd;return _0x36f47e;})[_0x629b('0x21')](respondWithFilteredResult(_0x20c488,_0x37daad))[_0x629b('0x2a')](handleError(_0x20c488,null));};exports['show']=function(_0x12cf74,_0x581da4){var _0x34d1bd={'raw':!![],'where':{'id':_0x12cf74['params']['id']}},_0x1ceb2a={};_0x1ceb2a[_0x629b('0x40')]=_['keys'](db['SmsMessage'][_0x629b('0x53')]);_0x1ceb2a[_0x629b('0x41')]=_[_0x629b('0x54')](_0x12cf74[_0x629b('0x41')]);_0x1ceb2a['filters']=_[_0x629b('0x43')](_0x1ceb2a[_0x629b('0x40')],_0x1ceb2a['query']);_0x34d1bd[_0x629b('0x46')]=_[_0x629b('0x43')](_0x1ceb2a[_0x629b('0x40')],qs['fields'](_0x12cf74[_0x629b('0x41')][_0x629b('0x44')]));_0x34d1bd[_0x629b('0x46')]=_0x34d1bd[_0x629b('0x46')][_0x629b('0x45')]?_0x34d1bd['attributes']:_0x1ceb2a['model'];if(_0x12cf74[_0x629b('0x41')][_0x629b('0x55')]){_0x34d1bd[_0x629b('0x50')]=[{'all':!![]}];}_0x34d1bd=_[_0x629b('0x4c')]({},_0x34d1bd,_0x12cf74[_0x629b('0x4f')]);return db[_0x629b('0x3d')]['find'](_0x34d1bd)['then'](handleEntityNotFound(_0x581da4,null))[_0x629b('0x21')](respondWithResult(_0x581da4,null))[_0x629b('0x2a')](handleError(_0x581da4,null));};exports[_0x629b('0x56')]=function(_0x3f819e,_0x264c6f){return db[_0x629b('0x3d')]['create'](_0x3f819e['body'],{})[_0x629b('0x21')](respondWithResult(_0x264c6f,0xc9))[_0x629b('0x2a')](handleError(_0x264c6f,null));};exports['update']=function(_0x4a71c0,_0xc1f151){if(_0x4a71c0[_0x629b('0x57')]['id']){delete _0x4a71c0[_0x629b('0x57')]['id'];}return db[_0x629b('0x3d')][_0x629b('0x58')]({'where':{'id':_0x4a71c0[_0x629b('0x59')]['id']}})['then'](handleEntityNotFound(_0xc1f151,null))[_0x629b('0x21')](saveUpdates(_0x4a71c0[_0x629b('0x57')],null))[_0x629b('0x21')](respondWithResult(_0xc1f151,null))['catch'](handleError(_0xc1f151,null));};exports[_0x629b('0x5a')]=function(_0x26cf93,_0x21bdf8){return db['SmsMessage']['find']({'where':{'id':_0x26cf93[_0x629b('0x59')]['id']}})[_0x629b('0x21')](handleEntityNotFound(_0x21bdf8,null))[_0x629b('0x21')](removeEntity(_0x21bdf8,null))['catch'](handleError(_0x21bdf8,null));};exports[_0x629b('0x5b')]=function(_0x228710,_0x137ed5){return db[_0x629b('0x3d')][_0x629b('0x5b')]()[_0x629b('0x21')](respondWithResult(_0x137ed5,null))['catch'](handleError(_0x137ed5,null));};var interaction_log=require(_0x629b('0x16'))(_0x629b('0x5c'));exports[_0x629b('0x5d')]=function(_0x169f2f,_0x25d9e9,_0x5ea044){var _0x528d33={'agent':{},'channel':'sms'};if(_0x169f2f[_0x629b('0x57')]['id']){delete _0x169f2f[_0x629b('0x57')]['id'];}_0x169f2f[_0x629b('0x57')][_0x629b('0x5e')]=!![];_0x169f2f[_0x629b('0x57')][_0x629b('0x5f')]=moment()[_0x629b('0x60')](_0x629b('0x61'));_0x169f2f[_0x629b('0x57')][_0x629b('0x62')]=_0x169f2f[_0x629b('0x57')][_0x629b('0x62')]||_0x169f2f[_0x629b('0x63')]['id'];_0x528d33['agent']['id']=_0x169f2f[_0x629b('0x57')]['UserId'];return db[_0x629b('0x3d')]['find']({'where':{'id':_0x169f2f['params']['id'],'UserId':null}})[_0x629b('0x21')](handleEntityNotFound(_0x25d9e9,null))['then'](saveUpdates(_0x169f2f['body'],null))['then'](function(_0x5c56e6){if(_0x5c56e6){_0x528d33[_0x629b('0x28')]=_0x5c56e6[_0x629b('0x64')]({'plain':!![]});return db[_0x629b('0x65')][_0x629b('0x58')]({'where':{'id':_0x5c56e6[_0x629b('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x25d9e9,null))[_0x629b('0x21')](function(_0x2532d5){if(_0x2532d5){return _0x2532d5[_0x629b('0x38')]({'UserId':_0x169f2f['body']['UserId'],'read1stAt':_[_0x629b('0x67')](_0x2532d5[_0x629b('0x68')])?moment()[_0x629b('0x60')](_0x629b('0x61')):undefined});}return null;})[_0x629b('0x21')](function(_0x150a8c){if(_0x150a8c){_0x528d33[_0x629b('0x69')]=_0x150a8c[_0x629b('0x64')]({'plain':!![]});interaction_log[_0x629b('0x22')](_0x629b('0x6a'),_0x169f2f[_0x629b('0x63')]['id'],_0x169f2f['user']['name'],_0x169f2f['user'][_0x629b('0x6b')],_0x528d33[_0x629b('0x69')]['id'],_0x169f2f[_0x629b('0x57')]?JSON[_0x629b('0x25')](_0x169f2f[_0x629b('0x57')]):_0x629b('0x6c'));return respondWithRpcPromise(_0x629b('0x6d'),_0x629b('0x6e'),_0x528d33);}return null;})[_0x629b('0x21')](function(_0x1ef3ef){var _0x1fa5c6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ef3ef[_0x629b('0x28')]['ContactId'];return db[_0x629b('0x6f')]['query'](_0x1fa5c6,{'type':db[_0x629b('0x70')][_0x629b('0x71')]['SELECT'],'raw':!![]})[_0x629b('0x21')](function(_0x5a1f6c){return _0x5a1f6c;});})[_0x629b('0x21')](function(_0x2576ac){if(_0x2576ac){_0x528d33[_0x629b('0x28')]['contact']=_0x2576ac[0x0];if(!_0x169f2f[_0x629b('0x57')][_0x629b('0x62')])return;return db[_0x629b('0x72')][_0x629b('0x58')]({'where':{'id':_0x169f2f[_0x629b('0x57')]['UserId'],'role':_0x629b('0x73')},'attributes':['id',_0x629b('0x3a'),_0x629b('0x74'),_0x629b('0x75'),_0x629b('0x76')],'raw':!![]});}return null;})[_0x629b('0x21')](function(_0x477c5a){if(!_0x477c5a)return null;_0x528d33[_0x629b('0x28')][_0x629b('0x73')]=_0x477c5a;return _0x528d33;})[_0x629b('0x21')](function(_0x3045df){if(_0x3045df){if(_0x169f2f[_0x629b('0x57')][_0x629b('0x77')]){_0x528d33[_0x629b('0x28')]['interface']=util[_0x629b('0x60')](_0x629b('0x78'),_0x169f2f['user']['name']);_0x528d33[_0x629b('0x28')][_0x629b('0x79')]=_0x528d33[_0x629b('0x79')];_0x528d33['message']['motionChannel']=_0x528d33[_0x629b('0x79')];_0x528d33[_0x629b('0x28')][_0x629b('0x7a')]=_0x629b('0x5d');return respondWithRpcPromise(_0x629b('0x7b'),_0x629b('0x7b'),{'event':_0x629b('0x7c'),'message':_0x528d33[_0x629b('0x28')]},client9002)[_0x629b('0x21')](function(){return _0x528d33;});}return _0x528d33;}return null;})['then'](respondWithResult(_0x25d9e9,null))['catch'](handleError(_0x25d9e9,null));};var interaction_log=require(_0x629b('0x16'))('sms-interactions');exports[_0x629b('0x36')]=function(_0x120632,_0x37acc8,_0x15f072){var _0x523fc4={'agent':{},'channel':_0x629b('0x7d')};if(_0x120632[_0x629b('0x57')]['id']){delete _0x120632[_0x629b('0x57')]['id'];}_0x120632[_0x629b('0x57')][_0x629b('0x62')]=_0x120632[_0x629b('0x57')][_0x629b('0x62')]||_0x120632[_0x629b('0x63')]['id'];_0x523fc4[_0x629b('0x73')]['id']=_0x120632[_0x629b('0x57')][_0x629b('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x120632[_0x629b('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37acc8,null))[_0x629b('0x21')](function(_0x557aa0){if(_0x557aa0){_0x523fc4['message']=_0x557aa0[_0x629b('0x64')]({'plain':!![]});return db[_0x629b('0x65')][_0x629b('0x58')]({'where':{'id':_0x557aa0[_0x629b('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x37acc8,null))[_0x629b('0x21')](function(_0x48e31e){if(_0x48e31e){_0x523fc4['interaction']=_0x48e31e['get']({'plain':!![]});interaction_log[_0x629b('0x22')](_0x629b('0x7e'),_0x120632[_0x629b('0x63')]['id'],_0x120632[_0x629b('0x63')][_0x629b('0x3a')],_0x120632['user'][_0x629b('0x6b')],_0x523fc4[_0x629b('0x69')]['id'],_0x120632[_0x629b('0x57')]?JSON[_0x629b('0x25')](_0x120632['body']):'null');return respondWithRpcPromise(_0x629b('0x7f'),_0x629b('0x80'),_0x523fc4);}return null;})[_0x629b('0x21')](function(_0x4f51cb){var _0x14585f=_0x629b('0x81')+_0x4f51cb['message'][_0x629b('0x82')];return db['sequelize'][_0x629b('0x41')](_0x14585f,{'type':db[_0x629b('0x70')][_0x629b('0x71')][_0x629b('0x83')],'raw':!![]})[_0x629b('0x21')](function(_0x1f5496){return _0x1f5496;});})[_0x629b('0x21')](function(_0x429485){if(_0x429485){_0x523fc4[_0x629b('0x28')][_0x629b('0x84')]=_0x429485[0x0];if(!_0x120632['body'][_0x629b('0x62')])return;return db[_0x629b('0x72')][_0x629b('0x58')]({'where':{'id':_0x120632[_0x629b('0x57')][_0x629b('0x62')],'role':_0x629b('0x73')},'attributes':['id',_0x629b('0x3a'),_0x629b('0x74'),_0x629b('0x75'),'internal'],'raw':!![]});}return null;})[_0x629b('0x21')](function(_0x14cf48){if(!_0x14cf48)return null;_0x523fc4[_0x629b('0x28')][_0x629b('0x73')]=_0x14cf48;return _0x523fc4;})['then'](function(_0x4e4339){if(_0x4e4339){_0x4e4339['message'][_0x629b('0x85')]=util[_0x629b('0x60')]('SIP/%s',_0x120632[_0x629b('0x63')][_0x629b('0x3a')]);_0x4e4339[_0x629b('0x28')][_0x629b('0x79')]=_0x523fc4[_0x629b('0x79')];_0x4e4339[_0x629b('0x28')][_0x629b('0x86')]=_0x523fc4['channel'];_0x4e4339[_0x629b('0x28')][_0x629b('0x7a')]=_0x629b('0x36');respondWithRpcPromise(_0x629b('0x7b'),'EventManager',{'event':_0x629b('0x87'),'message':_0x4e4339[_0x629b('0x28')]},client9002);return _0x523fc4;}return null;})[_0x629b('0x21')](respondWithResult(_0x37acc8,null))['catch'](handleError(_0x37acc8,null));};exports['status']=function(_0x1c1948,_0x410fa8,_0x3f8bc0){if(_0x1c1948[_0x629b('0x57')]['id']){delete _0x1c1948[_0x629b('0x57')]['id'];}var _0x4dfe08;return db[_0x629b('0x3d')][_0x629b('0x58')]({'where':{'id':_0x1c1948[_0x629b('0x59')]['id']}})['then'](handleEntityNotFound(_0x410fa8,null))[_0x629b('0x21')](function(_0x28f494){if(_0x28f494){_0x4dfe08=_0x28f494;return db[_0x629b('0x88')][_0x629b('0x58')]({'where':{'id':_0x28f494[_0x629b('0x89')]}});}})[_0x629b('0x21')](handleEntityNotFound(_0x410fa8,null))['then'](function(_0x5d0cdd){if(_0x5d0cdd){logger['debug'](_0x629b('0x24'),_0x629b('0x2c'),_0x629b('0x8a'),_0x5d0cdd[_0x629b('0x4d')],util[_0x629b('0x8b')](_0x1c1948[_0x629b('0x57')],{'showHidden':![],'depth':null}));switch(_0x5d0cdd['type']){case _0x629b('0x8c'):if(_0x1c1948[_0x629b('0x57')][_0x629b('0x8d')]&&_0x1c1948[_0x629b('0x57')][_0x629b('0x8d')]===_0x4dfe08[_0x629b('0x8e')]){return _0x4dfe08['update']({'read':!![]});}else{logger[_0x629b('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x629b('0x2c'),_0x629b('0x8c'),util['inspect'](_0x1c1948['body'],{'showHidden':![],'depth':null}));}break;case _0x629b('0x8f'):if(_0x1c1948[_0x629b('0x57')][_0x629b('0x90')]&&_0x1c1948[_0x629b('0x57')][_0x629b('0x90')]===_0x4dfe08[_0x629b('0x8e')]&&_[_0x629b('0x91')](['sent',_0x629b('0x92')],_0x1c1948[_0x629b('0x57')][_0x629b('0x93')])>=0x0){return _0x4dfe08[_0x629b('0x38')]({'read':!![]});}else{logger[_0x629b('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x629b('0x2c'),'plivio',util[_0x629b('0x8b')](_0x1c1948[_0x629b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x629b('0x94'):var _0x1a1007=_0x1c1948[_0x629b('0x57')]['results'][0x0];if(_0x1a1007[_0x629b('0x2c')]['groupName']===_0x629b('0x95')){return _0x4dfe08['update']({'read':!![]});}else{logger[_0x629b('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x629b('0x2c'),'infobip',util[_0x629b('0x8b')](_0x1c1948[_0x629b('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4dfe08;}})[_0x629b('0x21')](respondWithResult(_0x410fa8,null))['catch'](handleError(_0x410fa8,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1f1ab01..9d5b6e5 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 _0xaefe=['hasOwnProperty','hook','../../mysqldb','SmsMessage','setMaxListeners','remove','emit'];(function(_0x36b8da,_0x4162ce){var _0x4c95d5=function(_0x47c093){while(--_0x47c093){_0x36b8da['push'](_0x36b8da['shift']());}};_0x4c95d5(++_0x4162ce);}(_0xaefe,0x113));var _0xeaef=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xaefe[_0x3c8e9a];return _0x2d4c57;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xeaef('0x0'))['db'][_0xeaef('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeaef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xeaef('0x3')};function emitEvent(_0x4758ab){return function(_0x1dc9fb,_0x2766fb,_0x4e3159){SmsMessageEvents[_0xeaef('0x4')](_0x4758ab+':'+_0x1dc9fb['id'],_0x1dc9fb);SmsMessageEvents[_0xeaef('0x4')](_0x4758ab,_0x1dc9fb);_0x4e3159(null);};}for(var e in events){if(events[_0xeaef('0x5')](e)){var event=events[e];SmsMessage[_0xeaef('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xb9ae=['SmsMessage','save','update','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x463a68,_0x2509e1){var _0x22d4ca=function(_0x23921c){while(--_0x23921c){_0x463a68['push'](_0x463a68['shift']());}};_0x22d4ca(++_0x2509e1);}(_0xb9ae,0x91));var _0xeb9a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb9ae[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xeb9a('0x0'));var SmsMessage=require(_0xeb9a('0x1'))['db'][_0xeb9a('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb9a('0x3'),'afterUpdate':_0xeb9a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x264876){return function(_0x1b58f5,_0xbf8862,_0x5a451f){SmsMessageEvents['emit'](_0x264876+':'+_0x1b58f5['id'],_0x1b58f5);SmsMessageEvents['emit'](_0x264876,_0x1b58f5);_0x5a451f(null);};}for(var e in events){if(events[_0xeb9a('0x5')](e)){var event=events[e];SmsMessage[_0xeb9a('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 a1c000b..13588af 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 _0xd372=['format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','timestamp','keys','createHash','md5','digest','hex','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/status?token=','token','sid','update','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','read','skebby','connectel','senderString','authToken','https://smsapi.connectel.se/api/v2/send/','clicksend','xCALLY\x20Motion'];(function(_0x523577,_0x465598){var _0x522e1e=function(_0x163650){while(--_0x163650){_0x523577['push'](_0x523577['shift']());}};_0x522e1e(++_0x465598);}(_0xd372,0x12b));var _0x2d37=function(_0x2e104a,_0x162311){_0x2e104a=_0x2e104a-0x0;var _0x343fc8=_0xd372[_0x2e104a];return _0x343fc8;};'use strict';var _=require(_0x2d37('0x0'));var util=require(_0x2d37('0x1'));var logger=require(_0x2d37('0x2'))(_0x2d37('0x3'));var moment=require(_0x2d37('0x4'));var BPromise=require(_0x2d37('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d37('0x6'));var rimraf=require(_0x2d37('0x7'));var config=require(_0x2d37('0x8'));var attributes=require('./smsMessage.attributes');module[_0x2d37('0x9')]=function(_0x177e42,_0x1dc5bf){return _0x177e42[_0x2d37('0xa')](_0x2d37('0xb'),attributes,{'tableName':_0x2d37('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2d37('0xd')]},{'name':_0x2d37('0xe'),'fields':[_0x2d37('0xf')],'type':_0x2d37('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x191bec,_0x42f1bb,_0xa0363){var _0x566e2a=_0x177e42[_0x2d37('0x11')];var _0x23f0ee=_0x191bec['get']({'plain':!![]});if(_0x23f0ee[_0x2d37('0x12')][_0x2d37('0x13')]()==='in'||_0x23f0ee[_0x2d37('0x12')][_0x2d37('0x13')]()===_0x2d37('0x14')&&!_0x23f0ee['secret']&&!_[_0x2d37('0x15')](_0x23f0ee[_0x2d37('0x16')])&&!_[_0x2d37('0x15')](_0x23f0ee[_0x2d37('0x17')])){_0x566e2a[_0x2d37('0x18')][_0x2d37('0x19')]({'where':{'id':_0x23f0ee[_0x2d37('0x17')]}})[_0x2d37('0x1a')](function(_0x449378){if(_0x449378){_0x449378['update']({'lastMsgAt':_0x23f0ee[_0x2d37('0x1b')],'lastMsgDirection':_0x23f0ee[_0x2d37('0x12')][_0x2d37('0x13')]()});}})[_0x2d37('0x1c')](function(_0x50c886){console[_0x2d37('0x1d')](_0x50c886);});}if(_0x23f0ee[_0x2d37('0x12')]===_0x2d37('0x14')&&!_0x23f0ee[_0x2d37('0x1e')]){var _0x49733c;_0x566e2a[_0x2d37('0x1f')][_0x2d37('0x20')]({'where':{'id':_0x23f0ee[_0x2d37('0x21')]},'raw':!![]})['then'](function(_0x944b77){_0x49733c=_0x944b77;if(_0x49733c&&_0x49733c[_0x2d37('0x22')]){switch(_0x49733c[_0x2d37('0x22')]){case _0x2d37('0x23'):var _0x2e0420=require('twilio');if(_0x49733c[_0x2d37('0x24')]&&_0x49733c['authToken']&&_0x49733c[_0x2d37('0x25')]){var _0xbf3817=new _0x2e0420(_0x49733c[_0x2d37('0x24')],_0x49733c['authToken']);_0xbf3817[_0x2d37('0x26')][_0x2d37('0x27')]({'body':_0x23f0ee[_0x2d37('0xf')],'to':_0x23f0ee[_0x2d37('0x25')],'from':_0x49733c[_0x2d37('0x25')],'statusCallback':_0x49733c[_0x2d37('0x28')]+'/api/sms/messages/'+_0x23f0ee['id']+_0x2d37('0x29')+_0x49733c[_0x2d37('0x2a')]})['then'](function(_0x2c220f){if(_0x2c220f[_0x2d37('0x2b')]){return _0x191bec[_0x2d37('0x2c')]({'messageId':_0x2c220f[_0x2d37('0x2b')]});}})[_0x2d37('0x1c')](function(_0x460fa3){logger[_0x2d37('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d37('0x2d'),_0x2d37('0x23'),util[_0x2d37('0x2e')](_0x460fa3,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x23'),_0x2d37('0x30'));}break;case'skebby':var _0x4b3fc7=_0x2d37('0x31');if(_0x49733c[_0x2d37('0x32')]&&_0x49733c[_0x2d37('0x33')]){var _0xc4336e={'recipient':[_0x23f0ee['phone']],'message':_0x23f0ee[_0x2d37('0xf')],'message_type':_0x49733c['smsMethod']};if(_0x49733c[_0x2d37('0x34')]&&_0x49733c[_0x2d37('0x34')]!=='SI'){_0xc4336e[_0x2d37('0x35')]=_0x49733c[_0x2d37('0x25')];}var _0x2f1c9f={'url':_0x4b3fc7+'login?username='+_0x49733c['username']+_0x2d37('0x36')+_0x49733c[_0x2d37('0x33')],'method':_0x2d37('0x37')};rp(_0x2f1c9f)['then'](function(_0x5c50ec){var _0xc0e6db=_0x5c50ec['split'](';');var _0xa0b8bd={'user_key':_0xc0e6db[0x0],'session_key':_0xc0e6db[0x1]};_0x2f1c9f={'url':_0x4b3fc7+_0x2d37('0x38'),'method':_0x2d37('0x39'),'headers':{'user_key':_0xa0b8bd[_0x2d37('0x3a')],'Session_key':_0xa0b8bd[_0x2d37('0x3b')]},'json':!![],'body':_0xc4336e};return rp(_0x2f1c9f);})['then'](function(_0x19c699){if(_0x19c699[_0x2d37('0x3c')]>=0x1){var _0x46b11e={'messageId':_0x19c699['internal_order_id']};if(_0x49733c[_0x2d37('0x34')]!=='GP'||!_0x49733c[_0x2d37('0x3d')]){_0x46b11e[_0x2d37('0x3e')]=!![];}return _0x191bec[_0x2d37('0x2c')](_0x46b11e);}else{return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x3f'),util[_0x2d37('0x2e')](_0x19c699,{'showHidden':![],'depth':null}));}})[_0x2d37('0x1c')](function(_0x2990fa){return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x3f'),util[_0x2d37('0x2e')](_0x2990fa,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2d37('0x3f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2d37('0x40'):if(_0x49733c['authToken']){var _0x237146={'recipient':_0x23f0ee[_0x2d37('0x25')],'message':_0x23f0ee[_0x2d37('0xf')],'sender':_0x49733c[_0x2d37('0x41')]||_0x49733c[_0x2d37('0x25')],'authorization':_0x49733c[_0x2d37('0x42')]};var _0x42f1bb={'method':_0x2d37('0x39'),'uri':_0x2d37('0x43'),'body':_0x237146,'json':!![]};rp(_0x42f1bb)[_0x2d37('0x1a')](function(_0x31ecba){var _0x1e0384={'messageId':_0x31ecba['requestid']};if(!_0x49733c[_0x2d37('0x3d')]){_0x1e0384['read']=!![];}return _0x191bec[_0x2d37('0x2c')](_0x1e0384);})[_0x2d37('0x1c')](function(_0x4f3c09){logger[_0x2d37('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d37('0x2d'),_0x2d37('0x40'),util[_0x2d37('0x2e')](_0x4f3c09,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x40'),'Missing\x20parameters:\x20authToken');}break;case _0x2d37('0x44'):if(_0x49733c[_0x2d37('0x32')]&&_0x49733c[_0x2d37('0x33')]){var _0x237146={'messages':[{'source':_0x2d37('0x45'),'to':_0x23f0ee[_0x2d37('0x25')],'body':_0x23f0ee['body'],'from':_0x49733c[_0x2d37('0x41')]||_0x49733c[_0x2d37('0x25')]}]};var _0x32ea91=util[_0x2d37('0x46')](_0x2d37('0x47'),_0x49733c[_0x2d37('0x32')],_0x49733c[_0x2d37('0x33')]);var _0x42f1bb={'method':'POST','uri':_0x2d37('0x48'),'body':_0x237146,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x32ea91)[_0x2d37('0x49')](_0x2d37('0x4a')))},'json':!![]};rp(_0x42f1bb)[_0x2d37('0x1a')](function(_0x188751){if(_0x188751[_0x2d37('0x4b')]>=0xc8&&_0x188751[_0x2d37('0x4b')]<=0xce){if(_0x188751['data']&&_0x188751[_0x2d37('0x4c')][_0x2d37('0x4d')]>0x0){var _0xe21554=_['head'](_0x188751['data'][_0x2d37('0x26')]);var _0x35caa7={'messageId':_0xe21554['message_id']};if(!_0x49733c['deliveryReport']){_0x35caa7[_0x2d37('0x3e')]=!![];}return _0x191bec[_0x2d37('0x2c')](_0x35caa7);}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x4e'),util[_0x2d37('0x2e')](_0x188751,{'showHidden':![],'depth':null}));}}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x4e'),util['inspect'](_0x188751,{'showHidden':![],'depth':null}));}})['catch'](function(_0x69f554){logger[_0x2d37('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d37('0x2d'),_0x2d37('0x4e'),util[_0x2d37('0x2e')](_0x69f554,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x49733c[_0x2d37('0x4f')]&&_0x49733c['authToken']){var _0x237146={'dst':_0x23f0ee['phone'],'text':_0x23f0ee['body'],'src':_0x49733c[_0x2d37('0x41')]||_0x49733c[_0x2d37('0x25')],'url':_0x49733c['remote']+'/api/sms/messages/'+_0x23f0ee['id']+_0x2d37('0x29')+_0x49733c[_0x2d37('0x2a')]};var _0x32ea91=util[_0x2d37('0x46')](_0x2d37('0x47'),_0x49733c[_0x2d37('0x4f')],_0x49733c[_0x2d37('0x42')]);var _0x42f1bb={'method':_0x2d37('0x39'),'uri':util[_0x2d37('0x46')](_0x2d37('0x50'),_0x49733c[_0x2d37('0x4f')]),'body':_0x237146,'headers':{'Authorization':util[_0x2d37('0x46')](_0x2d37('0x51'),new Buffer(_0x32ea91)[_0x2d37('0x49')](_0x2d37('0x4a')))},'json':!![]};rp(_0x42f1bb)[_0x2d37('0x1a')](function(_0x9e73c2){var _0x3e59e6={'messageId':_0x9e73c2[_0x2d37('0x52')][0x0]};return _0x191bec[_0x2d37('0x2c')](_0x3e59e6);})[_0x2d37('0x1c')](function(_0x1bc8f7){logger['error'](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x53'),util[_0x2d37('0x2e')](_0x1bc8f7,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x53'),_0x2d37('0x54'));}break;case _0x2d37('0x55'):if(_0x49733c['username']&&_0x49733c[_0x2d37('0x33')]){if(_0x49733c[_0x2d37('0x56')]){var _0x209e6d={'method':_0x2d37('0x39'),'uri':_0x49733c[_0x2d37('0x56')]+_0x2d37('0x57'),'body':{'username':_0x49733c[_0x2d37('0x32')],'password':_0x49733c[_0x2d37('0x33')]},'json':!![]};return rp(_0x209e6d)[_0x2d37('0x1a')](function(_0x149ae3){var _0x3b1b9e={'method':_0x2d37('0x39'),'uri':_0x49733c[_0x2d37('0x56')]+_0x2d37('0x58'),'body':{'messages':[{'from':_0x49733c[_0x2d37('0x25')],'destinations':[{'to':_0x23f0ee[_0x2d37('0x25')]}],'text':_0x23f0ee[_0x2d37('0xf')],'notifyUrl':_0x49733c[_0x2d37('0x28')]+_0x2d37('0x59')+_0x23f0ee['id']+_0x2d37('0x29')+_0x49733c[_0x2d37('0x2a')],'notifyContentType':_0x2d37('0x5a'),'callbackData':_0x49733c[_0x2d37('0x25')]+';'+_0x23f0ee[_0x2d37('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x149ae3[_0x2d37('0x2a')]},'json':!![]};return rp(_0x3b1b9e)[_0x2d37('0x1a')](function(_0x5cf364){if(_0x5cf364[_0x2d37('0x26')]){var _0x268649={'messageId':_0x5cf364[_0x2d37('0x26')][0x0][_0x2d37('0xd')]};if(!_0x49733c['deliveryReport']){_0x268649[_0x2d37('0x3e')]=!![];}return _0x191bec[_0x2d37('0x2c')](_0x268649);}else{return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x55'),util['inspect'](_0x5cf364,{'showHidden':![],'depth':null}));}});})[_0x2d37('0x1c')](function(_0x2e7ef8){return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),'infobip',util['inspect'](_0x2e7ef8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d37('0x2d'),_0x2d37('0x55'),_0x2d37('0x5b'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2d37('0x55'),_0x2d37('0x5c'));}break;case _0x2d37('0x5d'):var _0x1b395c=require(_0x2d37('0x5e'));if(_0x49733c[_0x2d37('0x5f')]){var _0x16ea12={};_0x16ea12['login']=_0x49733c[_0x2d37('0x32')];_0x16ea12['phone']=_0x23f0ee['phone'];_0x16ea12[_0x2d37('0x35')]=_0x49733c[_0x2d37('0x25')];_0x16ea12['text']=_0x23f0ee['body'];_0x16ea12[_0x2d37('0x60')]=+new Date();var _0x527399='';var _0x2cd833='';var _0x534ec8=Object[_0x2d37('0x61')](_0x16ea12);_0x534ec8['sort']();for(var _0x79ec8f=0x0;_0x79ec8f<_0x534ec8['length'];_0x79ec8f++){if(_0x527399!=''){_0x527399+='&';}_0x527399+=_0x534ec8[_0x79ec8f]+'='+encodeURIComponent(_0x16ea12[_0x534ec8[_0x79ec8f]]);_0x2cd833+=_0x16ea12[_0x534ec8[_0x79ec8f]];}_0x2cd833+=_0x49733c[_0x2d37('0x5f')];_0x2cd833=_0x1b395c[_0x2d37('0x62')](_0x2d37('0x63'))[_0x2d37('0x2c')](_0x2cd833)[_0x2d37('0x64')](_0x2d37('0x65'));if(_0x527399!==''){_0x527399+='&';}_0x527399+='signature='+_0x2cd833;var _0x2f1c9f={'method':_0x2d37('0x37'),'uri':_0x49733c['baseUrl']+_0x2d37('0x66')+_0x527399,'json':!![]};return rp(_0x2f1c9f)[_0x2d37('0x1a')](function(_0x1e33b0){var _0x34cbfb=Object[_0x2d37('0x61')](_0x1e33b0);if(_0x1e33b0[_0x34cbfb[0x0]][_0x2d37('0x1d')]&&parseInt(_0x1e33b0[_0x34cbfb[0x0]]['error'])===0x0){var _0x2b71af={'messageId':_0x1e33b0[_0x34cbfb[0x0]]['id_sms']};if(!_0x49733c[_0x2d37('0x3d')]){_0x2b71af[_0x2d37('0x3e')]=!![];}return _0x191bec['update'](_0x2b71af);}else{return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x5d'),util[_0x2d37('0x2e')](_0x1e33b0['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x240610){return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),'csc',util[_0x2d37('0x2e')](_0x240610,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x5d'),'Missing\x20parameters:\x20apiKey');}break;case _0x2d37('0x67'):if(_0x49733c['apiKey']){var _0x37cee3={'method':_0x2d37('0x39'),'uri':_0x2d37('0x68'),'headers':{'Authorization':_0x49733c['apiKey']},'body':{'content':_0x23f0ee[_0x2d37('0xf')],'to':[_0x23f0ee[_0x2d37('0x25')]],'from':_0x49733c[_0x2d37('0x25')],'binary':![],'clientMessageId':_0x2d37('0x69'),'charset':_0x2d37('0x6a')},'json':!![]};rp(_0x37cee3)[_0x2d37('0x1a')](function(_0x18591b){if(!_0x18591b[_0x2d37('0x1d')]){var _0x3aa34e={'messageId':_0x18591b['messages'][0x0]['apiMessageId']};if(!_0x49733c['deliveryReport']){_0x3aa34e[_0x2d37('0x3e')]=!![];}return _0x191bec[_0x2d37('0x2c')](_0x3aa34e);}else{return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x67'),util['inspect'](_0x18591b['error'],{'showHidden':![],'depth':null}));}})[_0x2d37('0x1c')](function(_0x4c5e17){return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x67'),util[_0x2d37('0x2e')](_0x4c5e17,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d37('0x2d'),_0x2d37('0x67'),_0x2d37('0x6b'));}break;case _0x2d37('0x6c'):if(_0x49733c['username']&&_0x49733c[_0x2d37('0x33')]){var _0x32ea91=util[_0x2d37('0x46')](_0x2d37('0x47'),_0x49733c[_0x2d37('0x32')],_0x49733c['password']);var _0x42f1bb={'method':_0x2d37('0x39'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x49733c[_0x2d37('0x6d')]+_0x2d37('0x6e'),'body':{'to':[_0x23f0ee[_0x2d37('0x25')]],'text':_0x23f0ee[_0x2d37('0xf')],'from':_0x49733c['phone'],'applicationId':_0x49733c[_0x2d37('0x6f')]},'headers':{'Authorization':util['format'](_0x2d37('0x51'),new Buffer(_0x32ea91)[_0x2d37('0x49')](_0x2d37('0x4a')))},'json':!![]};rp(_0x42f1bb)['then'](function(_0x1f82a3){if(_0x1f82a3['id']){var _0x514123={'messageId':_0x1f82a3['id']};return _0x191bec[_0x2d37('0x2c')](_0x514123);}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x6c'),util[_0x2d37('0x2e')](_0x1f82a3,{'showHidden':![],'depth':null}));}})[_0x2d37('0x1c')](function(_0x38591a){logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x6c'),util[_0x2d37('0x2e')](_0x38591a,{'showHidden':![],'depth':null}));});}else{logger[_0x2d37('0x1d')](_0x2d37('0x2f'),'afterCreate',_0x2d37('0x6c'),_0x2d37('0x5c'));}break;case _0x2d37('0x70'):if(_0x49733c[_0x2d37('0x5f')]){var _0x124da6={};var _0x2f1c9f={'method':_0x2d37('0x39'),'uri':_0x2d37('0x71'),'headers':{'Authorization':_0x2d37('0x72')+_0x49733c[_0x2d37('0x5f')],'Content-Type':_0x2d37('0x5a')},'body':{'from':_0x49733c[_0x2d37('0x25')],'to':_0x23f0ee[_0x2d37('0x25')],'text':_0x23f0ee[_0x2d37('0xf')]},'json':!![]};return rp(_0x2f1c9f)['then'](function(_0x136a4f){if(_0x136a4f[_0x2d37('0x73')]==0xca){_0x124da6[_0x2d37('0x74')]=_0x136a4f;var _0xa3203c={'method':_0x2d37('0x39'),'uri':_0x2d37('0x75'),'headers':{'Authorization':_0x2d37('0x72')+_0x49733c[_0x2d37('0x5f')],'Content-Type':_0x2d37('0x5a')},'body':{'refid':_0x124da6[_0x2d37('0x74')][_0x2d37('0x76')]},'json':!![]};return rp(_0xa3203c)['then'](function(_0x3a66e3){_0x124da6['status']=_0x3a66e3;var _0x17fd0f={'messageId':_0x124da6[_0x2d37('0x74')][_0x2d37('0x76')],'read':!![]};return _0x191bec[_0x2d37('0x2c')](_0x17fd0f);});}else{return logger[_0x2d37('0x1d')](_0x2d37('0x2f'),_0x2d37('0x2d'),'intelepeer',util[_0x2d37('0x2e')](_0x136a4f,{'showHidden':![],'depth':null}));}})[_0x2d37('0x1c')](function(_0x3af547){return logger['error'](_0x2d37('0x2f'),_0x2d37('0x2d'),'intelepeer',util[_0x2d37('0x2e')](_0x3af547,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x2d37('0x2f'),_0x2d37('0x2d'),_0x2d37('0x70'),_0x2d37('0x77'));}break;}}})[_0x2d37('0x78')](function(){_0xa0363();});}else{_0xa0363();}}},'charset':_0x2d37('0x79'),'collate':_0x2d37('0x7a')});}; \ No newline at end of file +var _0xb403=['/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','login?username=','username','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','http_code','data','queued_count','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','token','IBSSO\x20','messages','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','keys','sort','createHash','md5','digest','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','refid','status','message','intelepeer','Token\x20not\x20received','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote'];(function(_0xeeaea0,_0x5a85f2){var _0x5c1bc9=function(_0x22c37b){while(--_0x22c37b){_0xeeaea0['push'](_0xeeaea0['shift']());}};_0x5c1bc9(++_0x5a85f2);}(_0xb403,0xcc));var _0x3b40=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0xb403[_0x27d958];return _0x53e63e;};'use strict';var _=require('lodash');var util=require(_0x3b40('0x0'));var logger=require(_0x3b40('0x1'))(_0x3b40('0x2'));var moment=require(_0x3b40('0x3'));var BPromise=require(_0x3b40('0x4'));var rp=require(_0x3b40('0x5'));var fs=require('fs');var path=require(_0x3b40('0x6'));var rimraf=require('rimraf');var config=require(_0x3b40('0x7'));var attributes=require(_0x3b40('0x8'));module[_0x3b40('0x9')]=function(_0x4d4e50,_0x1591fb){return _0x4d4e50['define'](_0x3b40('0xa'),attributes,{'tableName':_0x3b40('0xb'),'paranoid':![],'indexes':[{'name':_0x3b40('0xc'),'fields':[_0x3b40('0xc')]},{'name':_0x3b40('0xd'),'fields':[_0x3b40('0xe')],'type':_0x3b40('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24847e,_0x1e2663,_0x54bfc6){var _0x106302=_0x4d4e50[_0x3b40('0x10')];var _0xe43e73=_0x24847e[_0x3b40('0x11')]({'plain':!![]});if(_0xe43e73['direction'][_0x3b40('0x12')]()==='in'||_0xe43e73[_0x3b40('0x13')][_0x3b40('0x12')]()===_0x3b40('0x14')&&!_0xe43e73['secret']&&!_[_0x3b40('0x15')](_0xe43e73[_0x3b40('0x16')])&&!_[_0x3b40('0x15')](_0xe43e73['SmsInteractionId'])){_0x106302[_0x3b40('0x17')]['findOne']({'where':{'id':_0xe43e73[_0x3b40('0x18')]}})['then'](function(_0x336822){if(_0x336822){_0x336822[_0x3b40('0x19')]({'lastMsgAt':_0xe43e73[_0x3b40('0x1a')],'lastMsgDirection':_0xe43e73[_0x3b40('0x13')]['toLowerCase']()});}})[_0x3b40('0x1b')](function(_0x3cb7de){console['error'](_0x3cb7de);});}if(_0xe43e73[_0x3b40('0x13')]===_0x3b40('0x14')&&!_0xe43e73[_0x3b40('0x1c')]){var _0x151019;_0x106302[_0x3b40('0x1d')][_0x3b40('0x1e')]({'where':{'id':_0xe43e73[_0x3b40('0x1f')]},'raw':!![]})[_0x3b40('0x20')](function(_0x144ad8){_0x151019=_0x144ad8;if(_0x151019&&_0x151019[_0x3b40('0x21')]){switch(_0x151019['type']){case _0x3b40('0x22'):var _0x575590=require(_0x3b40('0x22'));if(_0x151019[_0x3b40('0x23')]&&_0x151019['authToken']&&_0x151019[_0x3b40('0x24')]){var _0x1f22fc=new _0x575590(_0x151019[_0x3b40('0x23')],_0x151019[_0x3b40('0x25')]);_0x1f22fc['messages'][_0x3b40('0x26')]({'body':_0xe43e73['body'],'to':_0xe43e73['phone'],'from':_0x151019[_0x3b40('0x24')],'statusCallback':_0x151019[_0x3b40('0x27')]+_0x3b40('0x28')+_0xe43e73['id']+_0x3b40('0x29')+_0x151019['token']})[_0x3b40('0x20')](function(_0x1e7db4){if(_0x1e7db4[_0x3b40('0x2a')]){return _0x24847e[_0x3b40('0x19')]({'messageId':_0x1e7db4[_0x3b40('0x2a')]});}})[_0x3b40('0x1b')](function(_0x2691f4){logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate','twilio',util[_0x3b40('0x2d')](_0x2691f4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x22'),_0x3b40('0x2f'));}break;case _0x3b40('0x30'):var _0x10fba6=_0x3b40('0x31');if(_0x151019['username']&&_0x151019['password']){var _0x44a856={'recipient':[_0xe43e73[_0x3b40('0x24')]],'message':_0xe43e73[_0x3b40('0xe')],'message_type':_0x151019[_0x3b40('0x32')]};if(_0x151019[_0x3b40('0x32')]&&_0x151019['smsMethod']!=='SI'){_0x44a856['sender']=_0x151019[_0x3b40('0x24')];}var _0x58dc7d={'url':_0x10fba6+_0x3b40('0x33')+_0x151019[_0x3b40('0x34')]+'&password='+_0x151019['password'],'method':_0x3b40('0x35')};rp(_0x58dc7d)[_0x3b40('0x20')](function(_0x2e3ad9){var _0x5658ed=_0x2e3ad9['split'](';');var _0x35f9ee={'user_key':_0x5658ed[0x0],'session_key':_0x5658ed[0x1]};_0x58dc7d={'url':_0x10fba6+_0x3b40('0x36'),'method':_0x3b40('0x37'),'headers':{'user_key':_0x35f9ee[_0x3b40('0x38')],'Session_key':_0x35f9ee[_0x3b40('0x39')]},'json':!![],'body':_0x44a856};return rp(_0x58dc7d);})[_0x3b40('0x20')](function(_0x1d43d2){if(_0x1d43d2[_0x3b40('0x3a')]>=0x1){var _0x845a42={'messageId':_0x1d43d2[_0x3b40('0x3b')]};if(_0x151019['smsMethod']!=='GP'||!_0x151019[_0x3b40('0x3c')]){_0x845a42[_0x3b40('0x3d')]=!![];}return _0x24847e[_0x3b40('0x19')](_0x845a42);}else{return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x30'),util[_0x3b40('0x2d')](_0x1d43d2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x45b2d6){return logger['error'](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x30'),util[_0x3b40('0x2d')](_0x45b2d6,{'showHidden':![],'depth':null}));});}else{logger[_0x3b40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3b40('0x2e'),_0x3b40('0x30'),_0x3b40('0x3e'));}break;case _0x3b40('0x3f'):if(_0x151019[_0x3b40('0x25')]){var _0x10c3cb={'recipient':_0xe43e73['phone'],'message':_0xe43e73[_0x3b40('0xe')],'sender':_0x151019[_0x3b40('0x40')]||_0x151019['phone'],'authorization':_0x151019[_0x3b40('0x25')]};var _0x1e2663={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x10c3cb,'json':!![]};rp(_0x1e2663)['then'](function(_0x3acac9){var _0xd982c9={'messageId':_0x3acac9['requestid']};if(!_0x151019[_0x3b40('0x3c')]){_0xd982c9[_0x3b40('0x3d')]=!![];}return _0x24847e[_0x3b40('0x19')](_0xd982c9);})[_0x3b40('0x1b')](function(_0x555c30){logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate',_0x3b40('0x3f'),util[_0x3b40('0x2d')](_0x555c30,{'showHidden':![],'depth':null}));});}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate','connectel',_0x3b40('0x41'));}break;case _0x3b40('0x42'):if(_0x151019['username']&&_0x151019[_0x3b40('0x43')]){var _0x10c3cb={'messages':[{'source':_0x3b40('0x44'),'to':_0xe43e73[_0x3b40('0x24')],'body':_0xe43e73['body'],'from':_0x151019[_0x3b40('0x40')]||_0x151019['phone']}]};var _0x487ec2=util['format'](_0x3b40('0x45'),_0x151019[_0x3b40('0x34')],_0x151019[_0x3b40('0x43')]);var _0x1e2663={'method':_0x3b40('0x37'),'uri':_0x3b40('0x46'),'body':_0x10c3cb,'headers':{'Authorization':util[_0x3b40('0x47')](_0x3b40('0x48'),new Buffer(_0x487ec2)['toString']('base64'))},'json':!![]};rp(_0x1e2663)[_0x3b40('0x20')](function(_0x1bc9b2){if(_0x1bc9b2[_0x3b40('0x49')]>=0xc8&&_0x1bc9b2[_0x3b40('0x49')]<=0xce){if(_0x1bc9b2[_0x3b40('0x4a')]&&_0x1bc9b2[_0x3b40('0x4a')][_0x3b40('0x4b')]>0x0){var _0x14ca2d=_['head'](_0x1bc9b2[_0x3b40('0x4a')]['messages']);var _0x3672d2={'messageId':_0x14ca2d['message_id']};if(!_0x151019[_0x3b40('0x3c')]){_0x3672d2[_0x3b40('0x3d')]=!![];}return _0x24847e['update'](_0x3672d2);}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate',_0x3b40('0x4c'),util[_0x3b40('0x2d')](_0x1bc9b2,{'showHidden':![],'depth':null}));}}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),'clickSend',util[_0x3b40('0x2d')](_0x1bc9b2,{'showHidden':![],'depth':null}));}})[_0x3b40('0x1b')](function(_0x3b337e){logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x4c'),util[_0x3b40('0x2d')](_0x3b337e,{'showHidden':![],'depth':null}));});}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x4c'),_0x3b40('0x3e'));}break;case'plivo':if(_0x151019[_0x3b40('0x4d')]&&_0x151019[_0x3b40('0x25')]){var _0x10c3cb={'dst':_0xe43e73[_0x3b40('0x24')],'text':_0xe43e73[_0x3b40('0xe')],'src':_0x151019[_0x3b40('0x40')]||_0x151019[_0x3b40('0x24')],'url':_0x151019[_0x3b40('0x27')]+_0x3b40('0x28')+_0xe43e73['id']+_0x3b40('0x29')+_0x151019['token']};var _0x487ec2=util[_0x3b40('0x47')]('%s:%s',_0x151019[_0x3b40('0x4d')],_0x151019[_0x3b40('0x25')]);var _0x1e2663={'method':_0x3b40('0x37'),'uri':util[_0x3b40('0x47')](_0x3b40('0x4e'),_0x151019[_0x3b40('0x4d')]),'body':_0x10c3cb,'headers':{'Authorization':util[_0x3b40('0x47')]('Basic\x20%s',new Buffer(_0x487ec2)[_0x3b40('0x4f')](_0x3b40('0x50')))},'json':!![]};rp(_0x1e2663)[_0x3b40('0x20')](function(_0x4e16d0){var _0x958ae0={'messageId':_0x4e16d0['message_uuid'][0x0]};return _0x24847e[_0x3b40('0x19')](_0x958ae0);})[_0x3b40('0x1b')](function(_0x181a21){logger[_0x3b40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3b40('0x2e'),_0x3b40('0x51'),util['inspect'](_0x181a21,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3b40('0x51'),_0x3b40('0x52'));}break;case'infobip':if(_0x151019[_0x3b40('0x34')]&&_0x151019[_0x3b40('0x43')]){if(_0x151019[_0x3b40('0x53')]){var _0xc172f5={'method':_0x3b40('0x37'),'uri':_0x151019[_0x3b40('0x53')]+_0x3b40('0x54'),'body':{'username':_0x151019[_0x3b40('0x34')],'password':_0x151019[_0x3b40('0x43')]},'json':!![]};return rp(_0xc172f5)[_0x3b40('0x20')](function(_0x184596){var _0x34d8c0={'method':_0x3b40('0x37'),'uri':_0x151019[_0x3b40('0x53')]+_0x3b40('0x55'),'body':{'messages':[{'from':_0x151019[_0x3b40('0x24')],'destinations':[{'to':_0xe43e73['phone']}],'text':_0xe43e73[_0x3b40('0xe')],'notifyUrl':_0x151019[_0x3b40('0x27')]+_0x3b40('0x28')+_0xe43e73['id']+_0x3b40('0x29')+_0x151019[_0x3b40('0x56')],'notifyContentType':'application/json','callbackData':_0x151019['phone']+';'+_0xe43e73[_0x3b40('0xe')]}]},'headers':{'Authorization':_0x3b40('0x57')+_0x184596[_0x3b40('0x56')]},'json':!![]};return rp(_0x34d8c0)[_0x3b40('0x20')](function(_0x116d32){if(_0x116d32[_0x3b40('0x58')]){var _0x4965b6={'messageId':_0x116d32[_0x3b40('0x58')][0x0]['messageId']};if(!_0x151019['deliveryReport']){_0x4965b6[_0x3b40('0x3d')]=!![];}return _0x24847e[_0x3b40('0x19')](_0x4965b6);}else{return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x59'),util[_0x3b40('0x2d')](_0x116d32,{'showHidden':![],'depth':null}));}});})[_0x3b40('0x1b')](function(_0xf57d6d){return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x59'),util['inspect'](_0xf57d6d,{'showHidden':![],'depth':null}));});}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate','infobip',_0x3b40('0x5a'));}}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate',_0x3b40('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3b40('0x5b'):var _0x4abcf9=require(_0x3b40('0x5c'));if(_0x151019[_0x3b40('0x5d')]){var _0x48350e={};_0x48350e['login']=_0x151019['username'];_0x48350e['phone']=_0xe43e73['phone'];_0x48350e['sender']=_0x151019[_0x3b40('0x24')];_0x48350e[_0x3b40('0x5e')]=_0xe43e73[_0x3b40('0xe')];_0x48350e['timestamp']=+new Date();var _0x32b28e='';var _0x7f6bff='';var _0x2a7421=Object[_0x3b40('0x5f')](_0x48350e);_0x2a7421[_0x3b40('0x60')]();for(var _0x26725e=0x0;_0x26725e<_0x2a7421['length'];_0x26725e++){if(_0x32b28e!=''){_0x32b28e+='&';}_0x32b28e+=_0x2a7421[_0x26725e]+'='+encodeURIComponent(_0x48350e[_0x2a7421[_0x26725e]]);_0x7f6bff+=_0x48350e[_0x2a7421[_0x26725e]];}_0x7f6bff+=_0x151019[_0x3b40('0x5d')];_0x7f6bff=_0x4abcf9[_0x3b40('0x61')](_0x3b40('0x62'))[_0x3b40('0x19')](_0x7f6bff)[_0x3b40('0x63')]('hex');if(_0x32b28e!==''){_0x32b28e+='&';}_0x32b28e+=_0x3b40('0x64')+_0x7f6bff;var _0x58dc7d={'method':_0x3b40('0x35'),'uri':_0x151019[_0x3b40('0x53')]+_0x3b40('0x65')+_0x32b28e,'json':!![]};return rp(_0x58dc7d)[_0x3b40('0x20')](function(_0x605d27){var _0xb016=Object[_0x3b40('0x5f')](_0x605d27);if(_0x605d27[_0xb016[0x0]][_0x3b40('0x2b')]&&parseInt(_0x605d27[_0xb016[0x0]][_0x3b40('0x2b')])===0x0){var _0x10b32e={'messageId':_0x605d27[_0xb016[0x0]][_0x3b40('0x66')]};if(!_0x151019[_0x3b40('0x3c')]){_0x10b32e[_0x3b40('0x3d')]=!![];}return _0x24847e[_0x3b40('0x19')](_0x10b32e);}else{return logger[_0x3b40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3b40('0x2e'),_0x3b40('0x5b'),util[_0x3b40('0x2d')](_0x605d27[_0x3b40('0x2b')],{'showHidden':![],'depth':null}));}})[_0x3b40('0x1b')](function(_0x5d7dc4){return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate',_0x3b40('0x5b'),util[_0x3b40('0x2d')](_0x5d7dc4,{'showHidden':![],'depth':null}));});}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x3b40('0x67'):if(_0x151019['apiKey']){var _0x42c0f0={'method':_0x3b40('0x37'),'uri':_0x3b40('0x68'),'headers':{'Authorization':_0x151019[_0x3b40('0x5d')]},'body':{'content':_0xe43e73[_0x3b40('0xe')],'to':[_0xe43e73[_0x3b40('0x24')]],'from':_0x151019['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x3b40('0x69')},'json':!![]};rp(_0x42c0f0)['then'](function(_0x5e6e65){if(!_0x5e6e65[_0x3b40('0x2b')]){var _0x13e3e2={'messageId':_0x5e6e65[_0x3b40('0x58')][0x0][_0x3b40('0x6a')]};if(!_0x151019[_0x3b40('0x3c')]){_0x13e3e2[_0x3b40('0x3d')]=!![];}return _0x24847e['update'](_0x13e3e2);}else{return logger['error'](_0x3b40('0x2c'),'afterCreate','clickatell',util[_0x3b40('0x2d')](_0x5e6e65[_0x3b40('0x2b')],{'showHidden':![],'depth':null}));}})[_0x3b40('0x1b')](function(_0x575c59){return logger[_0x3b40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3b40('0x2e'),_0x3b40('0x67'),util[_0x3b40('0x2d')](_0x575c59,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x67'),_0x3b40('0x6b'));}break;case _0x3b40('0x6c'):if(_0x151019[_0x3b40('0x34')]&&_0x151019[_0x3b40('0x43')]){var _0x487ec2=util[_0x3b40('0x47')]('%s:%s',_0x151019['username'],_0x151019['password']);var _0x1e2663={'method':_0x3b40('0x37'),'uri':_0x3b40('0x6d')+_0x151019['accountId']+_0x3b40('0x6e'),'body':{'to':[_0xe43e73['phone']],'text':_0xe43e73[_0x3b40('0xe')],'from':_0x151019[_0x3b40('0x24')],'applicationId':_0x151019[_0x3b40('0x6f')]},'headers':{'Authorization':util[_0x3b40('0x47')](_0x3b40('0x48'),new Buffer(_0x487ec2)[_0x3b40('0x4f')](_0x3b40('0x50')))},'json':!![]};rp(_0x1e2663)[_0x3b40('0x20')](function(_0x5ca525){if(_0x5ca525['id']){var _0x5ce3b9={'messageId':_0x5ca525['id']};return _0x24847e[_0x3b40('0x19')](_0x5ce3b9);}else{logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x6c'),util[_0x3b40('0x2d')](_0x5ca525,{'showHidden':![],'depth':null}));}})[_0x3b40('0x1b')](function(_0x3cabc3){logger[_0x3b40('0x2b')](_0x3b40('0x2c'),'afterCreate',_0x3b40('0x6c'),util['inspect'](_0x3cabc3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x6c'),_0x3b40('0x3e'));}break;case'intelepeer':if(_0x151019[_0x3b40('0x5d')]){var _0x422824={};var _0x58dc7d={'method':'POST','uri':_0x3b40('0x70'),'headers':{'Authorization':_0x3b40('0x71')+_0x151019[_0x3b40('0x5d')],'Content-Type':_0x3b40('0x72')},'body':{'from':_0x151019[_0x3b40('0x24')],'to':_0xe43e73[_0x3b40('0x24')],'text':_0xe43e73[_0x3b40('0xe')]},'json':!![]};return rp(_0x58dc7d)[_0x3b40('0x20')](function(_0x27a8da){if(_0x27a8da[_0x3b40('0x73')]==0xca){_0x422824['message']=_0x27a8da;var _0x40870b={'method':_0x3b40('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x151019[_0x3b40('0x5d')],'Content-Type':_0x3b40('0x72')},'body':{'refid':_0x422824['message'][_0x3b40('0x74')]},'json':!![]};return rp(_0x40870b)[_0x3b40('0x20')](function(_0x1091ab){_0x422824[_0x3b40('0x75')]=_0x1091ab;var _0x4706bd={'messageId':_0x422824[_0x3b40('0x76')][_0x3b40('0x74')],'read':!![]};return _0x24847e[_0x3b40('0x19')](_0x4706bd);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3b40('0x2e'),_0x3b40('0x77'),util[_0x3b40('0x2d')](_0x27a8da,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5b4816){return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x77'),util[_0x3b40('0x2d')](_0x5b4816,{'showHidden':![],'depth':null}));});}else{return logger[_0x3b40('0x2b')](_0x3b40('0x2c'),_0x3b40('0x2e'),_0x3b40('0x77'),_0x3b40('0x78'));}break;}}})['finally'](function(){_0x54bfc6();});}else{_0x54bfc6();}}},'charset':_0x3b40('0x79'),'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 7960050..afe4e40 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 _0x249c=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','debug','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e8097,_0x4a6af4){var _0xadc1f2=function(_0x2c41d4){while(--_0x2c41d4){_0x1e8097['push'](_0x1e8097['shift']());}};_0xadc1f2(++_0x4a6af4);}(_0x249c,0xe8));var _0xc249=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x249c[_0x3de873];return _0x380b8c;};'use strict';var _=require('lodash');var util=require(_0xc249('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc249('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc249('0x2'))['db'];var utils=require(_0xc249('0x3'));var logger=require('../../config/logger')(_0xc249('0x4'));var config=require(_0xc249('0x5'));var jayson=require(_0xc249('0x6'));var client=jayson[_0xc249('0x7')][_0xc249('0x8')]({'port':0x232a});config[_0xc249('0x9')]=_[_0xc249('0xa')](config[_0xc249('0x9')],{'host':_0xc249('0xb'),'port':0x18eb});var socket=require(_0xc249('0xc'))(new Redis(config['redis']));require(_0xc249('0xd'))[_0xc249('0xe')](socket);function respondWithRpcPromise(_0x5e7833,_0x3f32c0,_0x4438b3){return new BPromise(function(_0x53dff8,_0x1fa468){return client['request'](_0x5e7833,_0x4438b3)['then'](function(_0x2db3c6){logger['info'](_0xc249('0xf'),_0x3f32c0,_0xc249('0x10'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3f32c0,_0xc249('0x10'),JSON[_0xc249('0x11')](_0x2db3c6));if(_0x2db3c6[_0xc249('0x12')]){if(_0x2db3c6[_0xc249('0x12')][_0xc249('0x13')]===0x1f4){logger[_0xc249('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3f32c0,_0x2db3c6[_0xc249('0x12')][_0xc249('0x14')]);return _0x1fa468(_0x2db3c6['error'][_0xc249('0x14')]);}logger['error'](_0xc249('0xf'),_0x3f32c0,_0x2db3c6['error'][_0xc249('0x14')]);return _0x53dff8(_0x2db3c6['error']['message']);}else{logger[_0xc249('0x15')](_0xc249('0xf'),_0x3f32c0,_0xc249('0x10'));_0x53dff8(_0x2db3c6[_0xc249('0x16')]['message']);}})[_0xc249('0x17')](function(_0x450b45){logger[_0xc249('0x12')](_0xc249('0xf'),_0x3f32c0,_0x450b45);_0x1fa468(_0x450b45);});});}exports[_0xc249('0x18')]=function(_0x3118a8){var _0x398f47=this;return new Promise(function(_0x134884,_0x52b6d2){return db[_0xc249('0x19')][_0xc249('0x1a')](_0x3118a8['body'],{'raw':_0x3118a8[_0xc249('0x1b')]?_0x3118a8[_0xc249('0x1b')][_0xc249('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x29f5cb){logger['info'](_0xc249('0x18'),_0x3118a8);logger[_0xc249('0x1d')](_0xc249('0x18'),_0x3118a8,JSON[_0xc249('0x11')](_0x29f5cb));_0x134884(_0x29f5cb);})['catch'](function(_0x3f837d){logger[_0xc249('0x12')](_0xc249('0x18'),_0x3f837d[_0xc249('0x14')],_0x3118a8);_0x52b6d2(_0x398f47[_0xc249('0x12')](0x1f4,_0x3f837d[_0xc249('0x14')]));});});}; \ No newline at end of file +var _0x9ef0=['options','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','create'];(function(_0x156006,_0x591a15){var _0x18237f=function(_0x58d1db){while(--_0x58d1db){_0x156006['push'](_0x156006['shift']());}};_0x18237f(++_0x591a15);}(_0x9ef0,0xda));var _0x09ef=function(_0x3f1ab4,_0x3752a7){_0x3f1ab4=_0x3f1ab4-0x0;var _0x3c2565=_0x9ef0[_0x3f1ab4];return _0x3c2565;};'use strict';var _=require('lodash');var util=require(_0x09ef('0x0'));var moment=require(_0x09ef('0x1'));var BPromise=require(_0x09ef('0x2'));var rs=require(_0x09ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09ef('0x4'))['db'];var utils=require(_0x09ef('0x5'));var logger=require('../../config/logger')(_0x09ef('0x6'));var config=require(_0x09ef('0x7'));var jayson=require(_0x09ef('0x8'));var client=jayson[_0x09ef('0x9')][_0x09ef('0xa')]({'port':0x232a});config[_0x09ef('0xb')]=_[_0x09ef('0xc')](config[_0x09ef('0xb')],{'host':_0x09ef('0xd'),'port':0x18eb});var socket=require(_0x09ef('0xe'))(new Redis(config[_0x09ef('0xb')]));require(_0x09ef('0xf'))[_0x09ef('0x10')](socket);function respondWithRpcPromise(_0x588942,_0x3ae77a,_0x16365a){return new BPromise(function(_0x55329d,_0x13b965){return client[_0x09ef('0x11')](_0x588942,_0x16365a)[_0x09ef('0x12')](function(_0x435a68){logger[_0x09ef('0x13')](_0x09ef('0x14'),_0x3ae77a,_0x09ef('0x15'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3ae77a,'request\x20sent',JSON[_0x09ef('0x16')](_0x435a68));if(_0x435a68[_0x09ef('0x17')]){if(_0x435a68['error']['code']===0x1f4){logger[_0x09ef('0x17')](_0x09ef('0x14'),_0x3ae77a,_0x435a68['error']['message']);return _0x13b965(_0x435a68[_0x09ef('0x17')][_0x09ef('0x18')]);}logger[_0x09ef('0x17')](_0x09ef('0x14'),_0x3ae77a,_0x435a68['error']['message']);return _0x55329d(_0x435a68[_0x09ef('0x17')]['message']);}else{logger[_0x09ef('0x13')]('SmsMessage,\x20%s,\x20%s',_0x3ae77a,_0x09ef('0x15'));_0x55329d(_0x435a68[_0x09ef('0x19')][_0x09ef('0x18')]);}})[_0x09ef('0x1a')](function(_0x107a1a){logger['error'](_0x09ef('0x14'),_0x3ae77a,_0x107a1a);_0x13b965(_0x107a1a);});});}exports[_0x09ef('0x1b')]=function(_0x416514){var _0x18e6b7=this;return new Promise(function(_0x38a2b3,_0x2e142a){return db[_0x09ef('0x1c')][_0x09ef('0x1d')](_0x416514['body'],{'raw':_0x416514[_0x09ef('0x1e')]?_0x416514[_0x09ef('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x09ef('0x12')](function(_0x29b0e7){logger[_0x09ef('0x13')](_0x09ef('0x1b'),_0x416514);logger['debug'](_0x09ef('0x1b'),_0x416514,JSON[_0x09ef('0x16')](_0x29b0e7));_0x38a2b3(_0x29b0e7);})[_0x09ef('0x1a')](function(_0x267b24){logger[_0x09ef('0x17')](_0x09ef('0x1b'),_0x267b24[_0x09ef('0x18')],_0x416514);_0x2e142a(_0x18e6b7[_0x09ef('0x17')](0x1f4,_0x267b24[_0x09ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 38966c7..2e7e89d 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 _0xa520=['update','emit','removeListener','register','length','./smsMessage.events','save','remove'];(function(_0x25d494,_0x93e50){var _0x26be99=function(_0x12c0e9){while(--_0x12c0e9){_0x25d494['push'](_0x25d494['shift']());}};_0x26be99(++_0x93e50);}(_0xa520,0x125));var _0x0a52=function(_0x1bc10c,_0x4b5d84){_0x1bc10c=_0x1bc10c-0x0;var _0x502203=_0xa520[_0x1bc10c];return _0x502203;};'use strict';var SmsMessageEvents=require(_0x0a52('0x0'));var events=[_0x0a52('0x1'),_0x0a52('0x2'),_0x0a52('0x3')];function createListener(_0x1e4099,_0x5e032f){return function(_0x49a6a6){_0x5e032f[_0x0a52('0x4')](_0x1e4099,_0x49a6a6);};}function removeListener(_0x11a7fc,_0xe94dc8){return function(){SmsMessageEvents[_0x0a52('0x5')](_0x11a7fc,_0xe94dc8);};}exports[_0x0a52('0x6')]=function(_0x50026e){for(var _0x4e8ac5=0x0,_0x2a4b60=events[_0x0a52('0x7')];_0x4e8ac5<_0x2a4b60;_0x4e8ac5++){var _0x511b8c=events[_0x4e8ac5];var _0x417ae0=createListener('smsMessage:'+_0x511b8c,_0x50026e);SmsMessageEvents['on'](_0x511b8c,_0x417ae0);}}; \ No newline at end of file +var _0xab69=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xab69,0x75));var _0x9ab6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xab69[_0x2c91e9];return _0x13f0ff;};'use strict';var SmsMessageEvents=require(_0x9ab6('0x0'));var events=[_0x9ab6('0x1'),_0x9ab6('0x2'),'update'];function createListener(_0x3d6911,_0x4726ba){return function(_0x3303c5){_0x4726ba[_0x9ab6('0x3')](_0x3d6911,_0x3303c5);};}function removeListener(_0x5b2448,_0x164d1b){return function(){SmsMessageEvents[_0x9ab6('0x4')](_0x5b2448,_0x164d1b);};}exports[_0x9ab6('0x5')]=function(_0x3e1547){for(var _0x1c2cc7=0x0,_0x3f16d5=events[_0x9ab6('0x6')];_0x1c2cc7<_0x3f16d5;_0x1c2cc7++){var _0x184e58=events[_0x1c2cc7];var _0x4e7bc0=createListener(_0x9ab6('0x7')+_0x184e58,_0x3e1547);SmsMessageEvents['on'](_0x184e58,_0x4e7bc0);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 3a06b05..5b68586 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 _0x1528=['Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','show','/:id/members','/:id/teams','getTeams','getAgents','post','addAgents','put','/:id','update','destroy','delete','removeTeams','/:id/users','multer','path','connect-timeout','express'];(function(_0x188cc7,_0xf28746){var _0x54c1a8=function(_0x5bcd24){while(--_0x5bcd24){_0x188cc7['push'](_0x188cc7['shift']());}};_0x54c1a8(++_0xf28746);}(_0x1528,0x128));var _0x8152=function(_0x51e0f9,_0x1c6826){_0x51e0f9=_0x51e0f9-0x0;var _0x1001c0=_0x1528[_0x51e0f9];return _0x1001c0;};'use strict';var multer=require(_0x8152('0x0'));var util=require('util');var path=require(_0x8152('0x1'));var timeout=require(_0x8152('0x2'));var express=require(_0x8152('0x3'));var router=express[_0x8152('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8152('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8152('0x6'));var controller=require(_0x8152('0x7'));router[_0x8152('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8152('0x8')](_0x8152('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x8152('0xa')](),controller[_0x8152('0xb')]);router[_0x8152('0x8')](_0x8152('0xc'),auth[_0x8152('0xa')](),controller['getMembers']);router[_0x8152('0x8')](_0x8152('0xd'),auth['isAuthenticated'](),controller[_0x8152('0xe')]);router[_0x8152('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x8152('0xf')]);router[_0x8152('0x10')]('/',auth[_0x8152('0xa')](),controller['create']);router['post'](_0x8152('0xd'),auth[_0x8152('0xa')](),controller['addTeams']);router[_0x8152('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0x8152('0x11')]);router[_0x8152('0x12')](_0x8152('0x13'),auth[_0x8152('0xa')](),controller[_0x8152('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8152('0x15')]);router[_0x8152('0x16')]('/:id/teams',auth[_0x8152('0xa')](),controller[_0x8152('0x17')]);router['delete'](_0x8152('0x18'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xf92f=['/:id/users','put','/:id','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id/teams','getTeams','getAgents','create','post','addTeams'];(function(_0x25c1b6,_0x15e7ee){var _0x252d58=function(_0xfb970d){while(--_0xfb970d){_0x25c1b6['push'](_0x25c1b6['shift']());}};_0x252d58(++_0x15e7ee);}(_0xf92f,0x6a));var _0xff92=function(_0x37c1d4,_0x4d142c){_0x37c1d4=_0x37c1d4-0x0;var _0x1bb9b4=_0xf92f[_0x37c1d4];return _0x1bb9b4;};'use strict';var multer=require(_0xff92('0x0'));var util=require(_0xff92('0x1'));var path=require(_0xff92('0x2'));var timeout=require(_0xff92('0x3'));var express=require(_0xff92('0x4'));var router=express[_0xff92('0x5')]();var fs_extra=require(_0xff92('0x6'));var auth=require(_0xff92('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xff92('0x8'));var controller=require(_0xff92('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xff92('0xa')]('/describe',auth[_0xff92('0xb')](),controller[_0xff92('0xc')]);router[_0xff92('0xa')]('/:id',auth[_0xff92('0xb')](),controller['show']);router['get']('/:id/members',auth[_0xff92('0xb')](),controller['getMembers']);router[_0xff92('0xa')](_0xff92('0xd'),auth[_0xff92('0xb')](),controller[_0xff92('0xe')]);router[_0xff92('0xa')]('/:id/users',auth[_0xff92('0xb')](),controller[_0xff92('0xf')]);router['post']('/',auth[_0xff92('0xb')](),controller[_0xff92('0x10')]);router[_0xff92('0x11')](_0xff92('0xd'),auth[_0xff92('0xb')](),controller[_0xff92('0x12')]);router['post'](_0xff92('0x13'),auth[_0xff92('0xb')](),controller['addAgents']);router[_0xff92('0x14')](_0xff92('0x15'),auth[_0xff92('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xff92('0x16')](_0xff92('0xd'),auth[_0xff92('0xb')](),controller[_0xff92('0x17')]);router[_0xff92('0x16')](_0xff92('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xff92('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d714d26..38751de 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 _0xb8e1=['rrmemory','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x3b87e8,_0x1ef38e){var _0x49c031=function(_0x1704a7){while(--_0x1704a7){_0x3b87e8['push'](_0x3b87e8['shift']());}};_0x49c031(++_0x1ef38e);}(_0xb8e1,0x159));var _0x1b8e=function(_0x19da65,_0x4c94c6){_0x19da65=_0x19da65-0x0;var _0xf17e38=_0xb8e1[_0x19da65];return _0xf17e38;};'use strict';var Sequelize=require(_0x1b8e('0x0'));module[_0x1b8e('0x1')]={'name':{'type':Sequelize[_0x1b8e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1b8e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b8e('0x4')](_0x1b8e('0x5'),'beepall',_0x1b8e('0x6'))}}; \ No newline at end of file +var _0x7f4f=['name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x35cf09,_0x5e86eb){var _0x3063f8=function(_0x55187a){while(--_0x55187a){_0x35cf09['push'](_0x35cf09['shift']());}};_0x3063f8(++_0x5e86eb);}(_0x7f4f,0xfd));var _0xf7f4=function(_0x1967dc,_0x2b8fbe){_0x1967dc=_0x1967dc-0x0;var _0x220571=_0x7f4f[_0x1967dc];return _0x220571;};'use strict';var Sequelize=require(_0xf7f4('0x0'));module[_0xf7f4('0x1')]={'name':{'type':Sequelize[_0xf7f4('0x2')],'unique':_0xf7f4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf7f4('0x2')]},'timeout':{'type':Sequelize[_0xf7f4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf7f4('0x5'),_0xf7f4('0x6'),_0xf7f4('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 1658d50..0d60a40 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 _0xa486=['sendStatus','status','end','json','offset','undefined','count','limit','set','reject','get','SmsQueues','UserProfileResource','then','stack','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','name','merge','options','includeAll','show','keys','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','params','destroy','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','SIP','smsPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','findOrCreate','forEach','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','union','removeTeams','removeAgents','emit','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa486,0x17d));var _0x6a48=function(_0x49c2f0,_0x3e0104){_0x49c2f0=_0x49c2f0-0x0;var _0x179020=_0xa486[_0x49c2f0];return _0x179020;};'use strict';var emlformat=require(_0x6a48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a48('0x2'));var moment=require('moment');var BPromise=require(_0x6a48('0x3'));var Mustache=require(_0x6a48('0x4'));var util=require(_0x6a48('0x5'));var path=require(_0x6a48('0x6'));var sox=require(_0x6a48('0x7'));var csv=require(_0x6a48('0x8'));var ejs=require(_0x6a48('0x9'));var fs=require('fs');var fs_extra=require(_0x6a48('0xa'));var _=require(_0x6a48('0xb'));var squel=require(_0x6a48('0xc'));var crypto=require(_0x6a48('0xd'));var jsforce=require(_0x6a48('0xe'));var deskjs=require(_0x6a48('0xf'));var toCsv=require(_0x6a48('0x8'));var querystring=require(_0x6a48('0x10'));var Papa=require(_0x6a48('0x11'));var Redis=require('ioredis');var authService=require(_0x6a48('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a48('0x13'));var hardwareService=require(_0x6a48('0x14'));var logger=require(_0x6a48('0x15'))(_0x6a48('0x16'));var utils=require(_0x6a48('0x17'));var config=require(_0x6a48('0x18'));var licenseUtil=require(_0x6a48('0x19'));var db=require(_0x6a48('0x1a'))['db'];config[_0x6a48('0x1b')]=_[_0x6a48('0x1c')](config[_0x6a48('0x1b')],{'host':_0x6a48('0x1d'),'port':0x18eb});var socket=require(_0x6a48('0x1e'))(new Redis(config[_0x6a48('0x1b')]));require(_0x6a48('0x1f'))[_0x6a48('0x20')](socket);function respondWithStatusCode(_0xcbcb4b,_0x4ab8c6){_0x4ab8c6=_0x4ab8c6||0xcc;return function(_0x180319){if(_0x180319){return _0xcbcb4b[_0x6a48('0x21')](_0x4ab8c6);}return _0xcbcb4b[_0x6a48('0x22')](_0x4ab8c6)[_0x6a48('0x23')]();};}function respondWithResult(_0x231930,_0xaf303c){_0xaf303c=_0xaf303c||0xc8;return function(_0xad96d0){if(_0xad96d0){return _0x231930[_0x6a48('0x22')](_0xaf303c)[_0x6a48('0x24')](_0xad96d0);}};}function respondWithFilteredResult(_0x20cab5,_0x506bd2){return function(_0xab0913){if(_0xab0913){var _0x23a1fe=typeof _0x506bd2[_0x6a48('0x25')]===_0x6a48('0x26')&&typeof _0x506bd2['limit']===_0x6a48('0x26');var _0x43a80d=_0xab0913[_0x6a48('0x27')];var _0x4a252e=_0x23a1fe?0x0:_0x506bd2[_0x6a48('0x25')];var _0x6a0206=_0x23a1fe?_0xab0913[_0x6a48('0x27')]:_0x506bd2['offset']+_0x506bd2[_0x6a48('0x28')];var _0x24c549;if(_0x6a0206>=_0x43a80d){_0x6a0206=_0x43a80d;_0x24c549=0xc8;}else{_0x24c549=0xce;}_0x20cab5[_0x6a48('0x22')](_0x24c549);return _0x20cab5[_0x6a48('0x29')]('Content-Range',_0x4a252e+'-'+_0x6a0206+'/'+_0x43a80d)[_0x6a48('0x24')](_0xab0913);}return null;};}function patchUpdates(_0x230220){return function(_0x59b031){try{jsonpatch['apply'](_0x59b031,_0x230220,!![]);}catch(_0x11b488){return BPromise[_0x6a48('0x2a')](_0x11b488);}return _0x59b031['save']();};}function saveUpdates(_0x2eae9f,_0x4846bf){return function(_0x508432){if(_0x508432){return _0x508432['update'](_0x2eae9f)['then'](function(_0x2a14d5){return _0x2a14d5;});}return null;};}function removeEntity(_0x5eeef8,_0x19594c){return function(_0x52de7c){if(_0x52de7c){return _0x52de7c['destroy']()['then'](function(){var _0x5d62a6=_0x52de7c[_0x6a48('0x2b')]({'plain':!![]});var _0x29cfd2=_0x6a48('0x2c');return db[_0x6a48('0x2d')]['destroy']({'where':{'type':_0x29cfd2,'resourceId':_0x5d62a6['id']}})[_0x6a48('0x2e')](function(){return _0x52de7c;});})[_0x6a48('0x2e')](function(){_0x5eeef8[_0x6a48('0x22')](0xcc)[_0x6a48('0x23')]();});}};}function handleEntityNotFound(_0x5188e8,_0x57522a){return function(_0x39f2ee){if(!_0x39f2ee){_0x5188e8[_0x6a48('0x21')](0x194);}return _0x39f2ee;};}function handleError(_0x4168f2,_0x38e417){_0x38e417=_0x38e417||0x1f4;return function(_0x437622){logger['error'](_0x437622[_0x6a48('0x2f')]);if(_0x437622['name']){delete _0x437622['name'];}_0x4168f2[_0x6a48('0x22')](_0x38e417)[_0x6a48('0x30')](_0x437622);};}exports[_0x6a48('0x31')]=function(_0xd53693,_0x24aa89){var _0x81fa3c={},_0x346ebc={},_0xcd6f39={'count':0x0,'rows':[]};var _0x1372ef=_[_0x6a48('0x32')](db[_0x6a48('0x33')][_0x6a48('0x34')],function(_0x5aa79c){return{'name':_0x5aa79c[_0x6a48('0x35')],'type':_0x5aa79c[_0x6a48('0x36')][_0x6a48('0x37')]};});_0x346ebc['model']=_[_0x6a48('0x32')](_0x1372ef,'name');_0x346ebc[_0x6a48('0x38')]=_['keys'](_0xd53693[_0x6a48('0x38')]);_0x346ebc[_0x6a48('0x39')]=_[_0x6a48('0x3a')](_0x346ebc['model'],_0x346ebc[_0x6a48('0x38')]);_0x81fa3c[_0x6a48('0x3b')]=_['intersection'](_0x346ebc['model'],qs[_0x6a48('0x3c')](_0xd53693[_0x6a48('0x38')][_0x6a48('0x3c')]));_0x81fa3c[_0x6a48('0x3b')]=_0x81fa3c[_0x6a48('0x3b')][_0x6a48('0x3d')]?_0x81fa3c[_0x6a48('0x3b')]:_0x346ebc[_0x6a48('0x3e')];if(!_0xd53693['query'][_0x6a48('0x3f')](_0x6a48('0x40'))){_0x81fa3c[_0x6a48('0x28')]=qs[_0x6a48('0x28')](_0xd53693[_0x6a48('0x38')][_0x6a48('0x28')]);_0x81fa3c[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0xd53693[_0x6a48('0x38')][_0x6a48('0x25')]);}_0x81fa3c[_0x6a48('0x41')]=qs[_0x6a48('0x42')](_0xd53693[_0x6a48('0x38')][_0x6a48('0x42')]);_0x81fa3c['where']=qs[_0x6a48('0x39')](_[_0x6a48('0x43')](_0xd53693['query'],_0x346ebc[_0x6a48('0x39')]),_0x1372ef);if(_0xd53693[_0x6a48('0x38')][_0x6a48('0x44')]){_0x81fa3c[_0x6a48('0x45')]=_['merge'](_0x81fa3c[_0x6a48('0x45')],{'$or':_[_0x6a48('0x32')](_0x1372ef,function(_0x2190bb){if(_0x2190bb[_0x6a48('0x36')]!==_0x6a48('0x46')){var _0xd4e2b0={};_0xd4e2b0[_0x2190bb[_0x6a48('0x47')]]={'$like':'%'+_0xd53693['query']['filter']+'%'};return _0xd4e2b0;}})});}_0x81fa3c=_[_0x6a48('0x48')]({},_0x81fa3c,_0xd53693[_0x6a48('0x49')]);var _0x484e45={'where':_0x81fa3c[_0x6a48('0x45')]};return db[_0x6a48('0x33')]['count'](_0x484e45)[_0x6a48('0x2e')](function(_0x2abea4){_0xcd6f39[_0x6a48('0x27')]=_0x2abea4;if(_0xd53693[_0x6a48('0x38')][_0x6a48('0x4a')]){_0x81fa3c['include']=[{'all':!![]}];}return db[_0x6a48('0x33')]['findAll'](_0x81fa3c);})['then'](function(_0x1af9e8){_0xcd6f39['rows']=_0x1af9e8;return _0xcd6f39;})[_0x6a48('0x2e')](respondWithFilteredResult(_0x24aa89,_0x81fa3c))['catch'](handleError(_0x24aa89,null));};exports[_0x6a48('0x4b')]=function(_0xab4236,_0xd37fc6){var _0x4eddc7={'raw':!![],'where':{'id':_0xab4236['params']['id']}},_0x1b1b27={};_0x1b1b27['model']=_['keys'](db[_0x6a48('0x33')]['rawAttributes']);_0x1b1b27[_0x6a48('0x38')]=_[_0x6a48('0x4c')](_0xab4236[_0x6a48('0x38')]);_0x1b1b27[_0x6a48('0x39')]=_['intersection'](_0x1b1b27[_0x6a48('0x3e')],_0x1b1b27['query']);_0x4eddc7[_0x6a48('0x3b')]=_[_0x6a48('0x3a')](_0x1b1b27['model'],qs['fields'](_0xab4236[_0x6a48('0x38')][_0x6a48('0x3c')]));_0x4eddc7['attributes']=_0x4eddc7[_0x6a48('0x3b')][_0x6a48('0x3d')]?_0x4eddc7[_0x6a48('0x3b')]:_0x1b1b27[_0x6a48('0x3e')];if(_0xab4236[_0x6a48('0x38')][_0x6a48('0x4a')]){_0x4eddc7[_0x6a48('0x4d')]=[{'all':!![]}];}_0x4eddc7=_['merge']({},_0x4eddc7,_0xab4236[_0x6a48('0x49')]);return db[_0x6a48('0x33')]['find'](_0x4eddc7)[_0x6a48('0x2e')](handleEntityNotFound(_0xd37fc6,null))[_0x6a48('0x2e')](respondWithResult(_0xd37fc6,null))[_0x6a48('0x4e')](handleError(_0xd37fc6,null));};exports[_0x6a48('0x4f')]=function(_0x375358,_0x58b400){return db[_0x6a48('0x33')][_0x6a48('0x4f')](_0x375358[_0x6a48('0x50')],{})[_0x6a48('0x2e')](function(_0x1243bc){var _0x56cddc=_0x375358['user'][_0x6a48('0x2b')]({'plain':!![]});if(!_0x56cddc)throw new Error(_0x6a48('0x51'));if(_0x56cddc[_0x6a48('0x52')]==='user'){var _0x62856f=_0x1243bc['get']({'plain':!![]});var _0x28a57f=_0x6a48('0x2c');return db['UserProfileSection'][_0x6a48('0x53')]({'where':{'name':_0x28a57f,'userProfileId':_0x56cddc[_0x6a48('0x54')]},'raw':!![]})[_0x6a48('0x2e')](function(_0x2cfd79){if(_0x2cfd79&&_0x2cfd79[_0x6a48('0x55')]===0x0){return db[_0x6a48('0x2d')][_0x6a48('0x4f')]({'name':_0x62856f['name'],'resourceId':_0x62856f['id'],'type':_0x2cfd79[_0x6a48('0x47')],'sectionId':_0x2cfd79['id']},{})[_0x6a48('0x2e')](function(){return _0x1243bc;});}else{return _0x1243bc;}})['catch'](function(_0x5751ce){logger[_0x6a48('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5751ce);throw _0x5751ce;});}return _0x1243bc;})['then'](respondWithResult(_0x58b400,0xc9))[_0x6a48('0x4e')](handleError(_0x58b400,null));};exports['update']=function(_0x3efac2,_0x3099e2){if(_0x3efac2[_0x6a48('0x50')]['id']){delete _0x3efac2['body']['id'];}return db[_0x6a48('0x33')][_0x6a48('0x53')]({'where':{'id':_0x3efac2[_0x6a48('0x57')]['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x3099e2,null))[_0x6a48('0x2e')](saveUpdates(_0x3efac2[_0x6a48('0x50')],null))['then'](respondWithResult(_0x3099e2,null))[_0x6a48('0x4e')](handleError(_0x3099e2,null));};exports[_0x6a48('0x58')]=function(_0x2e3a0b,_0x55c643){return db[_0x6a48('0x33')]['find']({'where':{'id':_0x2e3a0b['params']['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x55c643,null))[_0x6a48('0x2e')](removeEntity(_0x55c643,null))[_0x6a48('0x4e')](handleError(_0x55c643,null));};exports['describe']=function(_0x4ca7c4,_0x3f6ed5){return db[_0x6a48('0x33')][_0x6a48('0x59')]()['then'](respondWithResult(_0x3f6ed5,null))[_0x6a48('0x4e')](handleError(_0x3f6ed5,null));};exports[_0x6a48('0x5a')]=function(_0x47cb9a,_0x476ef6,_0x4a0baa){var _0x4314ac={'raw':!![],'where':{}},_0x70b605={},_0x276f1e;return db[_0x6a48('0x33')][_0x6a48('0x5b')]({'where':{'id':_0x47cb9a[_0x6a48('0x57')]['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x476ef6,null))['then'](function(_0xcede73){if(_0xcede73){_0x276f1e=_0xcede73[_0x6a48('0x2b')]({'plain':!![]});_0x70b605[_0x6a48('0x3e')]=_[_0x6a48('0x4c')](db[_0x6a48('0x5c')][_0x6a48('0x34')]);_0x70b605[_0x6a48('0x38')]=_[_0x6a48('0x4c')](_0x47cb9a[_0x6a48('0x38')]);_0x70b605[_0x6a48('0x39')]=_[_0x6a48('0x3a')](_0x70b605['model'],_0x70b605[_0x6a48('0x38')]);_0x4314ac[_0x6a48('0x3b')]=_[_0x6a48('0x3a')](_0x70b605[_0x6a48('0x3e')],qs[_0x6a48('0x3c')](_0x47cb9a[_0x6a48('0x38')]['fields']));_0x4314ac['attributes']=_0x4314ac['attributes'][_0x6a48('0x3d')]?_0x4314ac[_0x6a48('0x3b')]:_0x70b605[_0x6a48('0x3e')];if(!_0x47cb9a[_0x6a48('0x38')]['hasOwnProperty'](_0x6a48('0x40'))){_0x4314ac['limit']=qs[_0x6a48('0x28')](_0x47cb9a[_0x6a48('0x38')][_0x6a48('0x28')]);_0x4314ac[_0x6a48('0x25')]=qs['offset'](_0x47cb9a[_0x6a48('0x38')][_0x6a48('0x25')]);}_0x4314ac[_0x6a48('0x41')]=qs[_0x6a48('0x42')](_0x47cb9a[_0x6a48('0x38')][_0x6a48('0x42')]);_0x4314ac[_0x6a48('0x45')]=qs[_0x6a48('0x39')](_[_0x6a48('0x43')](_0x47cb9a[_0x6a48('0x38')],_0x70b605[_0x6a48('0x39')]));_0x4314ac[_0x6a48('0x45')][_0x6a48('0x5d')]=_0xcede73['id'];if(_0x47cb9a[_0x6a48('0x38')][_0x6a48('0x44')]){_0x4314ac[_0x6a48('0x45')]=_[_0x6a48('0x48')](_0x4314ac[_0x6a48('0x45')],{'$or':_[_0x6a48('0x32')](_0x4314ac[_0x6a48('0x3b')],function(_0x36b8ad){var _0x1c5cdb={};_0x1c5cdb[_0x36b8ad]={'$like':'%'+_0x47cb9a[_0x6a48('0x38')][_0x6a48('0x44')]+'%'};return _0x1c5cdb;})});}_0x4314ac=_['merge']({},_0x4314ac,_0x47cb9a[_0x6a48('0x49')]);return db['UserSmsQueue'][_0x6a48('0x5e')](_0x4314ac);}})[_0x6a48('0x2e')](function(_0x5c1d99){if(_0x5c1d99){return db[_0x6a48('0x5f')][_0x6a48('0x60')]({'where':{'id':_['map'](_0x5c1d99,_0x6a48('0x61')),'role':'agent'},'attributes':['id',_0x6a48('0x47'),'smsPause',_0x6a48('0x62'),_0x6a48('0x63')]});}})[_0x6a48('0x2e')](function(_0x4e4219){if(_0x4e4219){return{'count':_0x4e4219[_0x6a48('0x27')],'rows':_[_0x6a48('0x32')](_0x4e4219['rows'],function(_0x535fde){return{'membername':_0x535fde[_0x6a48('0x47')],'UserId':_0x535fde['id'],'queue_name':_0x276f1e['name'],'SmsQueueId':_0x276f1e['id'],'interface':util['format']('%s/%s',_0x6a48('0x64'),_0x535fde[_0x6a48('0x47')]),'penalty':0x0,'paused':_0x535fde[_0x6a48('0x65')],'createdAt':_0x535fde[_0x6a48('0x63')],'updatedAt':_0x535fde[_0x6a48('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x476ef6,_0x4314ac))[_0x6a48('0x4e')](handleError(_0x476ef6,null));};exports[_0x6a48('0x66')]=function(_0x81ab7a,_0x4745f7,_0x26f3c6){var _0x3c7fc5={};var _0x42b2ac={};var _0x232a9c;var _0x1cd1d2;return db['SmsQueue'][_0x6a48('0x5b')]({'where':{'id':_0x81ab7a[_0x6a48('0x57')]['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x4745f7,null))[_0x6a48('0x2e')](function(_0x533a67){if(_0x533a67){_0x232a9c=_0x533a67;_0x42b2ac[_0x6a48('0x3e')]=_[_0x6a48('0x4c')](db[_0x6a48('0x67')][_0x6a48('0x34')]);_0x42b2ac['query']=_[_0x6a48('0x4c')](_0x81ab7a['query']);_0x42b2ac[_0x6a48('0x39')]=_[_0x6a48('0x3a')](_0x42b2ac['model'],_0x42b2ac[_0x6a48('0x38')]);_0x3c7fc5[_0x6a48('0x3b')]=_[_0x6a48('0x3a')](_0x42b2ac['model'],qs[_0x6a48('0x3c')](_0x81ab7a[_0x6a48('0x38')][_0x6a48('0x3c')]));_0x3c7fc5[_0x6a48('0x3b')]=_0x3c7fc5[_0x6a48('0x3b')][_0x6a48('0x3d')]?_0x3c7fc5[_0x6a48('0x3b')]:_0x42b2ac[_0x6a48('0x3e')];_0x3c7fc5[_0x6a48('0x41')]=qs['sort'](_0x81ab7a[_0x6a48('0x38')][_0x6a48('0x42')]);_0x3c7fc5['where']=qs[_0x6a48('0x39')](_['pick'](_0x81ab7a[_0x6a48('0x38')],_0x42b2ac[_0x6a48('0x39')]));if(_0x81ab7a[_0x6a48('0x38')][_0x6a48('0x44')]){_0x3c7fc5[_0x6a48('0x45')]=_[_0x6a48('0x48')](_0x3c7fc5[_0x6a48('0x45')],{'$or':_[_0x6a48('0x32')](_0x3c7fc5[_0x6a48('0x3b')],function(_0x18580e){var _0x4dda0c={};_0x4dda0c[_0x18580e]={'$like':'%'+_0x81ab7a[_0x6a48('0x38')][_0x6a48('0x44')]+'%'};return _0x4dda0c;})});}_0x3c7fc5=_[_0x6a48('0x48')]({},_0x3c7fc5,_0x81ab7a[_0x6a48('0x49')]);return _0x232a9c[_0x6a48('0x66')](_0x3c7fc5);}})[_0x6a48('0x2e')](function(_0x1dffa4){if(_0x1dffa4){_0x1cd1d2=_0x1dffa4['length'];if(!_0x81ab7a['query'][_0x6a48('0x3f')](_0x6a48('0x40'))){_0x3c7fc5['limit']=qs['limit'](_0x81ab7a[_0x6a48('0x38')][_0x6a48('0x28')]);_0x3c7fc5[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x81ab7a[_0x6a48('0x38')]['offset']);}return _0x232a9c[_0x6a48('0x66')](_0x3c7fc5);}})['then'](function(_0x127f69){if(_0x127f69){return _0x127f69?{'count':_0x1cd1d2,'rows':_0x127f69}:null;}})[_0x6a48('0x2e')](respondWithResult(_0x4745f7,null))[_0x6a48('0x4e')](handleError(_0x4745f7,null));};exports[_0x6a48('0x68')]=function(_0x16f273,_0x6ba2d9,_0x3a3eee){var _0x590adc=_0x16f273[_0x6a48('0x50')][_0x6a48('0x69')];return db[_0x6a48('0x67')]['findAll']({'where':{'id':_0x590adc},'attributes':['id'],'include':[{'model':db[_0x6a48('0x5f')],'as':_0x6a48('0x6a'),'attributes':['id',_0x6a48('0x47'),_0x6a48('0x6b'),_0x6a48('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0x2028b8){if(_0x2028b8){var _0x5ba0db=_[_0x6a48('0x6d')](_0x2028b8,function(_0x3cc28a){var _0x356c7a=_0x3cc28a[_0x6a48('0x2b')]({'plain':!![]});return _0x356c7a[_0x6a48('0x6a')];});return db['SmsQueue']['find']({'where':{'id':_0x16f273[_0x6a48('0x57')]['id']}})['then'](function(_0x35ebb3){return db['sequelize'][_0x6a48('0x6e')](function(_0x3d8496){return _0x35ebb3[_0x6a48('0x68')](_0x590adc,{'transaction':_0x3d8496})[_0x6a48('0x2e')](function(){return BPromise['each'](_0x5ba0db,function(_0x13a19f){return db[_0x6a48('0x5c')][_0x6a48('0x6f')]({'where':{'UserId':_0x13a19f['id'],'SmsQueueId':_0x16f273['params']['id']},'transaction':_0x3d8496});});})[_0x6a48('0x2e')](function(){_0x5ba0db[_0x6a48('0x70')](function(_0x57042b){socket['emit'](_0x6a48('0x71'),{'UserId':_0x57042b['id'],'SmsQueueId':_0x35ebb3['id']});});});});});}})[_0x6a48('0x2e')](respondWithStatusCode(_0x6ba2d9,null))['catch'](handleError(_0x6ba2d9,null));};exports['removeTeams']=function(_0x1c1e2f,_0x5c2206,_0x15b678){return db[_0x6a48('0x67')][_0x6a48('0x5e')]({'where':{'id':_0x1c1e2f[_0x6a48('0x38')][_0x6a48('0x69')]},'attributes':['id'],'include':[{'model':db[_0x6a48('0x5f')],'as':_0x6a48('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x6a48('0x2e')](handleEntityNotFound(_0x5c2206,null))[_0x6a48('0x2e')](function(_0x4e9211){var _0x593302=_[_0x6a48('0x32')](_0x4e9211,'id');var _0x49d4db=[];var _0x3d890d=[];var _0x23cedd=squel[_0x6a48('0x72')]();_0x23cedd[_0x6a48('0x73')](_0x6a48('0x74'))[_0x6a48('0x75')](_0x6a48('0x76'),'tq')[_0x6a48('0x77')]('user_has_teams','ut',_0x6a48('0x78'))[_0x6a48('0x45')](_0x6a48('0x79'),_0x1c1e2f[_0x6a48('0x57')]['id']);for(var _0x4e58f0=0x0;_0x4e58f0<_0x4e9211[_0x6a48('0x3d')];_0x4e58f0+=0x1){let _0x413e4c=_0x4e9211[_0x4e58f0];for(var _0x829ab0=0x0;_0x829ab0<_0x413e4c[_0x6a48('0x6a')][_0x6a48('0x3d')];_0x829ab0+=0x1){let _0x5346ea=_0x413e4c[_0x6a48('0x6a')][_0x829ab0];var _0x24a2ae=_0x23cedd['clone']();_0x24a2ae[_0x6a48('0x45')](_0x6a48('0x7a'),_0x5346ea['id']);_0x3d890d[_0x6a48('0x7b')](db[_0x6a48('0x7c')][_0x6a48('0x38')](_0x24a2ae[_0x6a48('0x7d')](),{'type':db[_0x6a48('0x7c')]['QueryTypes'][_0x6a48('0x7e')]})[_0x6a48('0x2e')](function(_0x42000e){if(_0x42000e[_0x6a48('0x3d')]===0x1){return _0x5346ea['id'];}else{var _0x54e984=_[_0x6a48('0x7f')](_[_0x6a48('0x32')](_0x42000e,_0x6a48('0x80')),function(_0x23174a){return _['includes'](_0x593302,_0x23174a);});if(_0x54e984){return _0x5346ea['id'];}}}));}}return BPromise['all'](_0x3d890d)[_0x6a48('0x2e')](function(_0x2a731d){_0x49d4db=_(_0x49d4db)[_0x6a48('0x81')](_0x2a731d)['compact']()['value']();return db[_0x6a48('0x33')][_0x6a48('0x53')]({'where':{'id':_0x1c1e2f[_0x6a48('0x57')]['id']}})['then'](function(_0x330a5d){return db['sequelize'][_0x6a48('0x6e')](function(_0x6b9737){return _0x330a5d[_0x6a48('0x82')](_0x1c1e2f['query'][_0x6a48('0x69')],{'transaction':_0x6b9737})['then'](function(){if(!_['isEmpty'](_0x49d4db)){return _0x330a5d[_0x6a48('0x83')](_0x49d4db,{'transaction':_0x6b9737});}})['then'](function(){_0x49d4db[_0x6a48('0x70')](function(_0x2335c8){socket[_0x6a48('0x84')](_0x6a48('0x85'),{'UserId':_0x2335c8,'SmsQueueId':_0x330a5d['id']});});});});});});})[_0x6a48('0x2e')](respondWithStatusCode(_0x5c2206,null))[_0x6a48('0x4e')](handleError(_0x5c2206,null));};exports[_0x6a48('0x86')]=function(_0x348615,_0x4c3eac,_0x5b0137){return db[_0x6a48('0x33')][_0x6a48('0x53')]({'where':{'id':_0x348615[_0x6a48('0x57')]['id']}})['then'](handleEntityNotFound(_0x4c3eac,null))[_0x6a48('0x2e')](function(_0xd408bc){if(_0xd408bc){return _0xd408bc[_0x6a48('0x86')](_0x348615[_0x6a48('0x50')]['ids'],_['omit'](_0x348615[_0x6a48('0x50')],['ids','id'])||{})[_0x6a48('0x87')](function(_0x1094d3){for(var _0x3204cf=0x0;_0x3204cf<_0x348615[_0x6a48('0x50')][_0x6a48('0x69')]['length'];_0x3204cf+=0x1){socket[_0x6a48('0x84')](_0x6a48('0x71'),{'UserId':Number(_0x348615[_0x6a48('0x50')][_0x6a48('0x69')][_0x3204cf]),'SmsQueueId':Number(_0x348615['params']['id'])});}return _0x1094d3;});}})[_0x6a48('0x2e')](respondWithResult(_0x4c3eac,null))[_0x6a48('0x4e')](handleError(_0x4c3eac,null));};exports[_0x6a48('0x83')]=function(_0x27635a,_0x570ce9,_0x37b697){return db[_0x6a48('0x33')][_0x6a48('0x53')]({'where':{'id':_0x27635a[_0x6a48('0x57')]['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x570ce9,null))['then'](function(_0x420085){if(_0x420085){return _0x420085['removeAgents'](_0x27635a['query'][_0x6a48('0x69')])[_0x6a48('0x2e')](function(){if(_[_0x6a48('0x88')](_0x27635a[_0x6a48('0x38')]['ids'])){for(var _0x208b3d=0x0;_0x208b3d<_0x27635a[_0x6a48('0x38')][_0x6a48('0x69')]['length'];_0x208b3d+=0x1){socket[_0x6a48('0x84')](_0x6a48('0x85'),{'UserId':Number(_0x27635a['query'][_0x6a48('0x69')][_0x208b3d]),'SmsQueueId':Number(_0x27635a[_0x6a48('0x57')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x27635a['query'][_0x6a48('0x69')]),'SmsQueueId':Number(_0x27635a[_0x6a48('0x57')]['id'])});}});}})[_0x6a48('0x2e')](respondWithStatusCode(_0x570ce9,null))[_0x6a48('0x4e')](handleError(_0x570ce9,null));};exports[_0x6a48('0x89')]=function(_0x2606b5,_0x5412c8,_0x32088f){var _0x4f4a17={};var _0x253ddb={};var _0x35888b;var _0x247964;return db[_0x6a48('0x33')][_0x6a48('0x5b')]({'where':{'id':_0x2606b5[_0x6a48('0x57')]['id']}})[_0x6a48('0x2e')](handleEntityNotFound(_0x5412c8,null))['then'](function(_0x4b494d){if(_0x4b494d){_0x35888b=_0x4b494d;_0x253ddb[_0x6a48('0x3e')]=_['keys'](db[_0x6a48('0x5f')][_0x6a48('0x34')]);_0x253ddb[_0x6a48('0x38')]=_[_0x6a48('0x4c')](_0x2606b5[_0x6a48('0x38')]);_0x253ddb[_0x6a48('0x39')]=_[_0x6a48('0x3a')](_0x253ddb['model'],_0x253ddb[_0x6a48('0x38')]);_0x4f4a17[_0x6a48('0x3b')]=_[_0x6a48('0x3a')](_0x253ddb['model'],qs['fields'](_0x2606b5['query'][_0x6a48('0x3c')]));_0x4f4a17[_0x6a48('0x3b')]=_0x4f4a17[_0x6a48('0x3b')][_0x6a48('0x3d')]?_0x4f4a17['attributes']:_0x253ddb[_0x6a48('0x3e')];_0x4f4a17['order']=qs[_0x6a48('0x42')](_0x2606b5[_0x6a48('0x38')][_0x6a48('0x42')]);_0x4f4a17[_0x6a48('0x45')]=qs[_0x6a48('0x39')](_[_0x6a48('0x43')](_0x2606b5[_0x6a48('0x38')],_0x253ddb[_0x6a48('0x39')]));if(_0x2606b5[_0x6a48('0x38')][_0x6a48('0x44')]){_0x4f4a17[_0x6a48('0x45')]=_[_0x6a48('0x48')](_0x4f4a17[_0x6a48('0x45')],{'$or':_[_0x6a48('0x32')](_0x4f4a17['attributes'],function(_0x381649){var _0x210401={};_0x210401[_0x381649]={'$like':'%'+_0x2606b5['query'][_0x6a48('0x44')]+'%'};return _0x210401;})});}_0x4f4a17=_[_0x6a48('0x48')]({},_0x4f4a17,_0x2606b5[_0x6a48('0x49')]);return _0x35888b[_0x6a48('0x89')](_0x4f4a17);}})[_0x6a48('0x2e')](function(_0xcdc9b4){if(_0xcdc9b4){_0x247964=_0xcdc9b4[_0x6a48('0x3d')];if(!_0x2606b5[_0x6a48('0x38')][_0x6a48('0x3f')](_0x6a48('0x40'))){_0x4f4a17[_0x6a48('0x28')]=qs[_0x6a48('0x28')](_0x2606b5[_0x6a48('0x38')]['limit']);_0x4f4a17[_0x6a48('0x25')]=qs[_0x6a48('0x25')](_0x2606b5['query'][_0x6a48('0x25')]);}return _0x35888b['getAgents'](_0x4f4a17);}})[_0x6a48('0x2e')](function(_0x1b6111){if(_0x1b6111){return _0x1b6111?{'count':_0x247964,'rows':_0x1b6111}:null;}})[_0x6a48('0x2e')](respondWithResult(_0x5412c8,null))['catch'](handleError(_0x5412c8,null));}; \ No newline at end of file +var _0x0344=['smsPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','SmsQueues','UserProfileResource','stack','name','send','index','map','SmsQueue','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','error','describe','getMembers','findOne','UserSmsQueue','order','pick','SmsQueueId','User','findAndCountAll','UserId','agent'];(function(_0x360e5c,_0x1d60de){var _0x3629ea=function(_0x3f12b6){while(--_0x3f12b6){_0x360e5c['push'](_0x360e5c['shift']());}};_0x3629ea(++_0x1d60de);}(_0x0344,0x14b));var _0x4034=function(_0x5909d9,_0x51c8fe){_0x5909d9=_0x5909d9-0x0;var _0x4697cb=_0x0344[_0x5909d9];return _0x4697cb;};'use strict';var emlformat=require(_0x4034('0x0'));var rimraf=require(_0x4034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4034('0x2'));var rp=require(_0x4034('0x3'));var moment=require(_0x4034('0x4'));var BPromise=require(_0x4034('0x5'));var Mustache=require('mustache');var util=require(_0x4034('0x6'));var path=require('path');var sox=require(_0x4034('0x7'));var csv=require(_0x4034('0x8'));var ejs=require(_0x4034('0x9'));var fs=require('fs');var fs_extra=require(_0x4034('0xa'));var _=require(_0x4034('0xb'));var squel=require(_0x4034('0xc'));var crypto=require('crypto');var jsforce=require(_0x4034('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4034('0x8'));var querystring=require(_0x4034('0xe'));var Papa=require(_0x4034('0xf'));var Redis=require(_0x4034('0x10'));var authService=require(_0x4034('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4034('0x12'));var hardwareService=require(_0x4034('0x13'));var logger=require(_0x4034('0x14'))(_0x4034('0x15'));var utils=require(_0x4034('0x16'));var config=require(_0x4034('0x17'));var licenseUtil=require(_0x4034('0x18'));var db=require(_0x4034('0x19'))['db'];config[_0x4034('0x1a')]=_[_0x4034('0x1b')](config[_0x4034('0x1a')],{'host':_0x4034('0x1c'),'port':0x18eb});var socket=require(_0x4034('0x1d'))(new Redis(config[_0x4034('0x1a')]));require(_0x4034('0x1e'))[_0x4034('0x1f')](socket);function respondWithStatusCode(_0xd0d7c5,_0x24262e){_0x24262e=_0x24262e||0xcc;return function(_0x2ba558){if(_0x2ba558){return _0xd0d7c5[_0x4034('0x20')](_0x24262e);}return _0xd0d7c5['status'](_0x24262e)['end']();};}function respondWithResult(_0x1feeb2,_0xdc75b4){_0xdc75b4=_0xdc75b4||0xc8;return function(_0x152ece){if(_0x152ece){return _0x1feeb2[_0x4034('0x21')](_0xdc75b4)['json'](_0x152ece);}};}function respondWithFilteredResult(_0x18e70d,_0x1f1517){return function(_0x9b479b){if(_0x9b479b){var _0x35d057=typeof _0x1f1517['offset']===_0x4034('0x22')&&typeof _0x1f1517[_0x4034('0x23')]===_0x4034('0x22');var _0x546c63=_0x9b479b['count'];var _0x1164ad=_0x35d057?0x0:_0x1f1517[_0x4034('0x24')];var _0xc59ed8=_0x35d057?_0x9b479b[_0x4034('0x25')]:_0x1f1517[_0x4034('0x24')]+_0x1f1517[_0x4034('0x23')];var _0x3e2d14;if(_0xc59ed8>=_0x546c63){_0xc59ed8=_0x546c63;_0x3e2d14=0xc8;}else{_0x3e2d14=0xce;}_0x18e70d[_0x4034('0x21')](_0x3e2d14);return _0x18e70d[_0x4034('0x26')](_0x4034('0x27'),_0x1164ad+'-'+_0xc59ed8+'/'+_0x546c63)[_0x4034('0x28')](_0x9b479b);}return null;};}function patchUpdates(_0x2cd6f5){return function(_0xdb4ae8){try{jsonpatch[_0x4034('0x29')](_0xdb4ae8,_0x2cd6f5,!![]);}catch(_0x53c85a){return BPromise[_0x4034('0x2a')](_0x53c85a);}return _0xdb4ae8['save']();};}function saveUpdates(_0x56f72b,_0x10c83e){return function(_0x101812){if(_0x101812){return _0x101812[_0x4034('0x2b')](_0x56f72b)[_0x4034('0x2c')](function(_0x19dcf7){return _0x19dcf7;});}return null;};}function removeEntity(_0x49b7e6,_0xba421a){return function(_0x599b31){if(_0x599b31){return _0x599b31[_0x4034('0x2d')]()[_0x4034('0x2c')](function(){var _0x1f23b1=_0x599b31['get']({'plain':!![]});var _0x136cc9=_0x4034('0x2e');return db[_0x4034('0x2f')]['destroy']({'where':{'type':_0x136cc9,'resourceId':_0x1f23b1['id']}})[_0x4034('0x2c')](function(){return _0x599b31;});})[_0x4034('0x2c')](function(){_0x49b7e6[_0x4034('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ba21,_0x35edc5){return function(_0x174a8c){if(!_0x174a8c){_0x55ba21[_0x4034('0x20')](0x194);}return _0x174a8c;};}function handleError(_0x5e3902,_0x3fa1df){_0x3fa1df=_0x3fa1df||0x1f4;return function(_0x239191){logger['error'](_0x239191[_0x4034('0x30')]);if(_0x239191[_0x4034('0x31')]){delete _0x239191[_0x4034('0x31')];}_0x5e3902[_0x4034('0x21')](_0x3fa1df)[_0x4034('0x32')](_0x239191);};}exports[_0x4034('0x33')]=function(_0x55336b,_0x19d09e){var _0x37dc31={},_0x3eb6c6={},_0x599da3={'count':0x0,'rows':[]};var _0x59b2fe=_[_0x4034('0x34')](db[_0x4034('0x35')]['rawAttributes'],function(_0x224215){return{'name':_0x224215[_0x4034('0x36')],'type':_0x224215[_0x4034('0x37')]['key']};});_0x3eb6c6[_0x4034('0x38')]=_[_0x4034('0x34')](_0x59b2fe,_0x4034('0x31'));_0x3eb6c6['query']=_[_0x4034('0x39')](_0x55336b['query']);_0x3eb6c6[_0x4034('0x3a')]=_[_0x4034('0x3b')](_0x3eb6c6[_0x4034('0x38')],_0x3eb6c6[_0x4034('0x3c')]);_0x37dc31[_0x4034('0x3d')]=_[_0x4034('0x3b')](_0x3eb6c6[_0x4034('0x38')],qs['fields'](_0x55336b['query'][_0x4034('0x3e')]));_0x37dc31[_0x4034('0x3d')]=_0x37dc31[_0x4034('0x3d')][_0x4034('0x3f')]?_0x37dc31[_0x4034('0x3d')]:_0x3eb6c6[_0x4034('0x38')];if(!_0x55336b[_0x4034('0x3c')][_0x4034('0x40')](_0x4034('0x41'))){_0x37dc31[_0x4034('0x23')]=qs[_0x4034('0x23')](_0x55336b[_0x4034('0x3c')][_0x4034('0x23')]);_0x37dc31['offset']=qs['offset'](_0x55336b['query'][_0x4034('0x24')]);}_0x37dc31['order']=qs[_0x4034('0x42')](_0x55336b[_0x4034('0x3c')][_0x4034('0x42')]);_0x37dc31[_0x4034('0x43')]=qs[_0x4034('0x3a')](_['pick'](_0x55336b[_0x4034('0x3c')],_0x3eb6c6[_0x4034('0x3a')]),_0x59b2fe);if(_0x55336b[_0x4034('0x3c')][_0x4034('0x44')]){_0x37dc31[_0x4034('0x43')]=_[_0x4034('0x45')](_0x37dc31[_0x4034('0x43')],{'$or':_[_0x4034('0x34')](_0x59b2fe,function(_0x20b319){if(_0x20b319[_0x4034('0x37')]!==_0x4034('0x46')){var _0x27f75a={};_0x27f75a[_0x20b319[_0x4034('0x31')]]={'$like':'%'+_0x55336b[_0x4034('0x3c')][_0x4034('0x44')]+'%'};return _0x27f75a;}})});}_0x37dc31=_['merge']({},_0x37dc31,_0x55336b[_0x4034('0x47')]);var _0x4f404b={'where':_0x37dc31[_0x4034('0x43')]};return db[_0x4034('0x35')][_0x4034('0x25')](_0x4f404b)['then'](function(_0x3e17ec){_0x599da3[_0x4034('0x25')]=_0x3e17ec;if(_0x55336b['query'][_0x4034('0x48')]){_0x37dc31[_0x4034('0x49')]=[{'all':!![]}];}return db[_0x4034('0x35')][_0x4034('0x4a')](_0x37dc31);})[_0x4034('0x2c')](function(_0xa59bb1){_0x599da3['rows']=_0xa59bb1;return _0x599da3;})[_0x4034('0x2c')](respondWithFilteredResult(_0x19d09e,_0x37dc31))[_0x4034('0x4b')](handleError(_0x19d09e,null));};exports[_0x4034('0x4c')]=function(_0x1ade2e,_0x32b90){var _0x42c776={'raw':!![],'where':{'id':_0x1ade2e[_0x4034('0x4d')]['id']}},_0x15bd97={};_0x15bd97[_0x4034('0x38')]=_[_0x4034('0x39')](db[_0x4034('0x35')][_0x4034('0x4e')]);_0x15bd97[_0x4034('0x3c')]=_[_0x4034('0x39')](_0x1ade2e[_0x4034('0x3c')]);_0x15bd97['filters']=_[_0x4034('0x3b')](_0x15bd97[_0x4034('0x38')],_0x15bd97[_0x4034('0x3c')]);_0x42c776[_0x4034('0x3d')]=_[_0x4034('0x3b')](_0x15bd97[_0x4034('0x38')],qs[_0x4034('0x3e')](_0x1ade2e['query'][_0x4034('0x3e')]));_0x42c776[_0x4034('0x3d')]=_0x42c776[_0x4034('0x3d')]['length']?_0x42c776[_0x4034('0x3d')]:_0x15bd97[_0x4034('0x38')];if(_0x1ade2e[_0x4034('0x3c')]['includeAll']){_0x42c776['include']=[{'all':!![]}];}_0x42c776=_[_0x4034('0x45')]({},_0x42c776,_0x1ade2e['options']);return db['SmsQueue']['find'](_0x42c776)[_0x4034('0x2c')](handleEntityNotFound(_0x32b90,null))[_0x4034('0x2c')](respondWithResult(_0x32b90,null))[_0x4034('0x4b')](handleError(_0x32b90,null));};exports[_0x4034('0x4f')]=function(_0x3a59a8,_0x34ce2b){return db[_0x4034('0x35')][_0x4034('0x4f')](_0x3a59a8[_0x4034('0x50')],{})[_0x4034('0x2c')](function(_0x568a15){var _0x3e8706=_0x3a59a8[_0x4034('0x51')]['get']({'plain':!![]});if(!_0x3e8706)throw new Error(_0x4034('0x52'));if(_0x3e8706['role']===_0x4034('0x51')){var _0x537079=_0x568a15[_0x4034('0x53')]({'plain':!![]});var _0x4124c3='SmsQueues';return db[_0x4034('0x54')][_0x4034('0x55')]({'where':{'name':_0x4124c3,'userProfileId':_0x3e8706['userProfileId']},'raw':!![]})[_0x4034('0x2c')](function(_0x4e50b0){if(_0x4e50b0&&_0x4e50b0['autoAssociation']===0x0){return db[_0x4034('0x2f')]['create']({'name':_0x537079[_0x4034('0x31')],'resourceId':_0x537079['id'],'type':_0x4e50b0[_0x4034('0x31')],'sectionId':_0x4e50b0['id']},{})[_0x4034('0x2c')](function(){return _0x568a15;});}else{return _0x568a15;}})[_0x4034('0x4b')](function(_0x521dea){logger[_0x4034('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x521dea);throw _0x521dea;});}return _0x568a15;})[_0x4034('0x2c')](respondWithResult(_0x34ce2b,0xc9))[_0x4034('0x4b')](handleError(_0x34ce2b,null));};exports[_0x4034('0x2b')]=function(_0x1a5062,_0x309319){if(_0x1a5062['body']['id']){delete _0x1a5062[_0x4034('0x50')]['id'];}return db[_0x4034('0x35')][_0x4034('0x55')]({'where':{'id':_0x1a5062[_0x4034('0x4d')]['id']}})[_0x4034('0x2c')](handleEntityNotFound(_0x309319,null))[_0x4034('0x2c')](saveUpdates(_0x1a5062['body'],null))[_0x4034('0x2c')](respondWithResult(_0x309319,null))['catch'](handleError(_0x309319,null));};exports[_0x4034('0x2d')]=function(_0x4810f2,_0x2963dd){return db[_0x4034('0x35')][_0x4034('0x55')]({'where':{'id':_0x4810f2[_0x4034('0x4d')]['id']}})[_0x4034('0x2c')](handleEntityNotFound(_0x2963dd,null))[_0x4034('0x2c')](removeEntity(_0x2963dd,null))['catch'](handleError(_0x2963dd,null));};exports['describe']=function(_0x4cae0e,_0x5a3995){return db[_0x4034('0x35')][_0x4034('0x57')]()['then'](respondWithResult(_0x5a3995,null))[_0x4034('0x4b')](handleError(_0x5a3995,null));};exports[_0x4034('0x58')]=function(_0x246fee,_0x1f66ae,_0x2e738b){var _0x231c38={'raw':!![],'where':{}},_0x1cc3de={},_0x45f36e;return db[_0x4034('0x35')][_0x4034('0x59')]({'where':{'id':_0x246fee[_0x4034('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f66ae,null))[_0x4034('0x2c')](function(_0x49b217){if(_0x49b217){_0x45f36e=_0x49b217[_0x4034('0x53')]({'plain':!![]});_0x1cc3de[_0x4034('0x38')]=_[_0x4034('0x39')](db[_0x4034('0x5a')]['rawAttributes']);_0x1cc3de['query']=_[_0x4034('0x39')](_0x246fee[_0x4034('0x3c')]);_0x1cc3de[_0x4034('0x3a')]=_[_0x4034('0x3b')](_0x1cc3de[_0x4034('0x38')],_0x1cc3de['query']);_0x231c38[_0x4034('0x3d')]=_[_0x4034('0x3b')](_0x1cc3de[_0x4034('0x38')],qs[_0x4034('0x3e')](_0x246fee['query'][_0x4034('0x3e')]));_0x231c38['attributes']=_0x231c38['attributes'][_0x4034('0x3f')]?_0x231c38[_0x4034('0x3d')]:_0x1cc3de[_0x4034('0x38')];if(!_0x246fee[_0x4034('0x3c')][_0x4034('0x40')](_0x4034('0x41'))){_0x231c38['limit']=qs[_0x4034('0x23')](_0x246fee[_0x4034('0x3c')][_0x4034('0x23')]);_0x231c38[_0x4034('0x24')]=qs[_0x4034('0x24')](_0x246fee[_0x4034('0x3c')]['offset']);}_0x231c38[_0x4034('0x5b')]=qs[_0x4034('0x42')](_0x246fee[_0x4034('0x3c')][_0x4034('0x42')]);_0x231c38[_0x4034('0x43')]=qs[_0x4034('0x3a')](_[_0x4034('0x5c')](_0x246fee[_0x4034('0x3c')],_0x1cc3de['filters']));_0x231c38[_0x4034('0x43')][_0x4034('0x5d')]=_0x49b217['id'];if(_0x246fee['query'][_0x4034('0x44')]){_0x231c38[_0x4034('0x43')]=_['merge'](_0x231c38[_0x4034('0x43')],{'$or':_[_0x4034('0x34')](_0x231c38[_0x4034('0x3d')],function(_0xe59843){var _0x493b7a={};_0x493b7a[_0xe59843]={'$like':'%'+_0x246fee[_0x4034('0x3c')][_0x4034('0x44')]+'%'};return _0x493b7a;})});}_0x231c38=_[_0x4034('0x45')]({},_0x231c38,_0x246fee[_0x4034('0x47')]);return db[_0x4034('0x5a')][_0x4034('0x4a')](_0x231c38);}})[_0x4034('0x2c')](function(_0x58279c){if(_0x58279c){return db[_0x4034('0x5e')][_0x4034('0x5f')]({'where':{'id':_[_0x4034('0x34')](_0x58279c,_0x4034('0x60')),'role':_0x4034('0x61')},'attributes':['id','name',_0x4034('0x62'),_0x4034('0x63'),_0x4034('0x64')]});}})[_0x4034('0x2c')](function(_0x44ae6d){if(_0x44ae6d){return{'count':_0x44ae6d[_0x4034('0x25')],'rows':_[_0x4034('0x34')](_0x44ae6d['rows'],function(_0x5b63e9){return{'membername':_0x5b63e9[_0x4034('0x31')],'UserId':_0x5b63e9['id'],'queue_name':_0x45f36e[_0x4034('0x31')],'SmsQueueId':_0x45f36e['id'],'interface':util[_0x4034('0x65')]('%s/%s',_0x4034('0x66'),_0x5b63e9[_0x4034('0x31')]),'penalty':0x0,'paused':_0x5b63e9[_0x4034('0x62')],'createdAt':_0x5b63e9[_0x4034('0x64')],'updatedAt':_0x5b63e9[_0x4034('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4034('0x2c')](respondWithFilteredResult(_0x1f66ae,_0x231c38))[_0x4034('0x4b')](handleError(_0x1f66ae,null));};exports[_0x4034('0x67')]=function(_0x54d887,_0x162d19,_0x4e87f9){var _0xba6ee6={};var _0x3261c6={};var _0xcfe333;var _0x90a43d;return db['SmsQueue']['findOne']({'where':{'id':_0x54d887['params']['id']}})[_0x4034('0x2c')](handleEntityNotFound(_0x162d19,null))['then'](function(_0xe77dcf){if(_0xe77dcf){_0xcfe333=_0xe77dcf;_0x3261c6[_0x4034('0x38')]=_[_0x4034('0x39')](db['Team'][_0x4034('0x4e')]);_0x3261c6[_0x4034('0x3c')]=_[_0x4034('0x39')](_0x54d887[_0x4034('0x3c')]);_0x3261c6[_0x4034('0x3a')]=_[_0x4034('0x3b')](_0x3261c6[_0x4034('0x38')],_0x3261c6[_0x4034('0x3c')]);_0xba6ee6[_0x4034('0x3d')]=_[_0x4034('0x3b')](_0x3261c6[_0x4034('0x38')],qs[_0x4034('0x3e')](_0x54d887[_0x4034('0x3c')][_0x4034('0x3e')]));_0xba6ee6[_0x4034('0x3d')]=_0xba6ee6['attributes'][_0x4034('0x3f')]?_0xba6ee6['attributes']:_0x3261c6['model'];_0xba6ee6[_0x4034('0x5b')]=qs[_0x4034('0x42')](_0x54d887[_0x4034('0x3c')][_0x4034('0x42')]);_0xba6ee6['where']=qs['filters'](_[_0x4034('0x5c')](_0x54d887['query'],_0x3261c6[_0x4034('0x3a')]));if(_0x54d887[_0x4034('0x3c')][_0x4034('0x44')]){_0xba6ee6[_0x4034('0x43')]=_['merge'](_0xba6ee6[_0x4034('0x43')],{'$or':_['map'](_0xba6ee6['attributes'],function(_0x33c739){var _0xe91081={};_0xe91081[_0x33c739]={'$like':'%'+_0x54d887[_0x4034('0x3c')]['filter']+'%'};return _0xe91081;})});}_0xba6ee6=_['merge']({},_0xba6ee6,_0x54d887[_0x4034('0x47')]);return _0xcfe333[_0x4034('0x67')](_0xba6ee6);}})['then'](function(_0xb5cf2b){if(_0xb5cf2b){_0x90a43d=_0xb5cf2b[_0x4034('0x3f')];if(!_0x54d887[_0x4034('0x3c')][_0x4034('0x40')](_0x4034('0x41'))){_0xba6ee6[_0x4034('0x23')]=qs[_0x4034('0x23')](_0x54d887[_0x4034('0x3c')][_0x4034('0x23')]);_0xba6ee6[_0x4034('0x24')]=qs['offset'](_0x54d887['query'][_0x4034('0x24')]);}return _0xcfe333[_0x4034('0x67')](_0xba6ee6);}})[_0x4034('0x2c')](function(_0x5e2926){if(_0x5e2926){return _0x5e2926?{'count':_0x90a43d,'rows':_0x5e2926}:null;}})[_0x4034('0x2c')](respondWithResult(_0x162d19,null))['catch'](handleError(_0x162d19,null));};exports[_0x4034('0x68')]=function(_0x30fd03,_0x28f560,_0x42770d){var _0x4c18c5=_0x30fd03[_0x4034('0x50')][_0x4034('0x69')];return db['Team']['findAll']({'where':{'id':_0x4c18c5},'attributes':['id'],'include':[{'model':db[_0x4034('0x5e')],'as':_0x4034('0x6a'),'attributes':['id',_0x4034('0x31'),_0x4034('0x6b'),'voicePause',_0x4034('0x6c')],'raw':!![]}]})[_0x4034('0x2c')](function(_0x5aceba){if(_0x5aceba){var _0x562518=_[_0x4034('0x6d')](_0x5aceba,function(_0x9b9d74){var _0x3cfcb3=_0x9b9d74['get']({'plain':!![]});return _0x3cfcb3[_0x4034('0x6a')];});return db[_0x4034('0x35')][_0x4034('0x55')]({'where':{'id':_0x30fd03[_0x4034('0x4d')]['id']}})[_0x4034('0x2c')](function(_0x4d2793){return db[_0x4034('0x6e')][_0x4034('0x6f')](function(_0x2044a5){return _0x4d2793[_0x4034('0x68')](_0x4c18c5,{'transaction':_0x2044a5})[_0x4034('0x2c')](function(){return BPromise[_0x4034('0x70')](_0x562518,function(_0x43b8c2){return db[_0x4034('0x5a')][_0x4034('0x71')]({'where':{'UserId':_0x43b8c2['id'],'SmsQueueId':_0x30fd03[_0x4034('0x4d')]['id']},'transaction':_0x2044a5});});})['then'](function(){_0x562518[_0x4034('0x72')](function(_0x395598){socket[_0x4034('0x73')](_0x4034('0x74'),{'UserId':_0x395598['id'],'SmsQueueId':_0x4d2793['id']});});});});});}})[_0x4034('0x2c')](respondWithStatusCode(_0x28f560,null))[_0x4034('0x4b')](handleError(_0x28f560,null));};exports[_0x4034('0x75')]=function(_0x506efe,_0x2f9c68,_0x4e22ec){return db[_0x4034('0x76')][_0x4034('0x4a')]({'where':{'id':_0x506efe[_0x4034('0x3c')][_0x4034('0x69')]},'attributes':['id'],'include':[{'model':db[_0x4034('0x5e')],'as':_0x4034('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x4034('0x2c')](handleEntityNotFound(_0x2f9c68,null))[_0x4034('0x2c')](function(_0x298acb){var _0x283014=_[_0x4034('0x34')](_0x298acb,'id');var _0x27a8a3=[];var _0x2d47e9=[];var _0x2d5f07=squel[_0x4034('0x77')]();_0x2d5f07['field'](_0x4034('0x78'))[_0x4034('0x79')](_0x4034('0x7a'),'tq')[_0x4034('0x7b')]('user_has_teams','ut',_0x4034('0x7c'))[_0x4034('0x43')](_0x4034('0x7d'),_0x506efe[_0x4034('0x4d')]['id']);for(var _0x54d075=0x0;_0x54d075<_0x298acb[_0x4034('0x3f')];_0x54d075+=0x1){let _0x312097=_0x298acb[_0x54d075];for(var _0x15ec4f=0x0;_0x15ec4f<_0x312097['Agents']['length'];_0x15ec4f+=0x1){let _0x49023b=_0x312097['Agents'][_0x15ec4f];var _0x5c9742=_0x2d5f07[_0x4034('0x7e')]();_0x5c9742[_0x4034('0x43')](_0x4034('0x7f'),_0x49023b['id']);_0x2d47e9[_0x4034('0x80')](db['sequelize']['query'](_0x5c9742['toString'](),{'type':db[_0x4034('0x6e')]['QueryTypes'][_0x4034('0x81')]})[_0x4034('0x2c')](function(_0x52f3c8){if(_0x52f3c8[_0x4034('0x3f')]===0x1){return _0x49023b['id'];}else{var _0x2ebf9d=_[_0x4034('0x82')](_[_0x4034('0x34')](_0x52f3c8,_0x4034('0x83')),function(_0x21aff4){return _[_0x4034('0x84')](_0x283014,_0x21aff4);});if(_0x2ebf9d){return _0x49023b['id'];}}}));}}return BPromise[_0x4034('0x85')](_0x2d47e9)['then'](function(_0x26d55e){_0x27a8a3=_(_0x27a8a3)[_0x4034('0x86')](_0x26d55e)['compact']()[_0x4034('0x87')]();return db[_0x4034('0x35')][_0x4034('0x55')]({'where':{'id':_0x506efe[_0x4034('0x4d')]['id']}})[_0x4034('0x2c')](function(_0x3560c2){return db[_0x4034('0x6e')]['transaction'](function(_0xa16b24){return _0x3560c2[_0x4034('0x75')](_0x506efe[_0x4034('0x3c')][_0x4034('0x69')],{'transaction':_0xa16b24})[_0x4034('0x2c')](function(){if(!_[_0x4034('0x88')](_0x27a8a3)){return _0x3560c2[_0x4034('0x89')](_0x27a8a3,{'transaction':_0xa16b24});}})[_0x4034('0x2c')](function(){_0x27a8a3[_0x4034('0x72')](function(_0x7b0528){socket[_0x4034('0x73')](_0x4034('0x8a'),{'UserId':_0x7b0528,'SmsQueueId':_0x3560c2['id']});});});});});});})[_0x4034('0x2c')](respondWithStatusCode(_0x2f9c68,null))[_0x4034('0x4b')](handleError(_0x2f9c68,null));};exports[_0x4034('0x8b')]=function(_0x31145a,_0x4841fc,_0x1921e0){return db['SmsQueue']['find']({'where':{'id':_0x31145a['params']['id']}})[_0x4034('0x2c')](handleEntityNotFound(_0x4841fc,null))['then'](function(_0x3f617a){if(_0x3f617a){return _0x3f617a[_0x4034('0x8b')](_0x31145a['body'][_0x4034('0x69')],_['omit'](_0x31145a[_0x4034('0x50')],[_0x4034('0x69'),'id'])||{})[_0x4034('0x8c')](function(_0x4ed19c){for(var _0x59aca2=0x0;_0x59aca2<_0x31145a[_0x4034('0x50')][_0x4034('0x69')]['length'];_0x59aca2+=0x1){socket[_0x4034('0x73')](_0x4034('0x74'),{'UserId':Number(_0x31145a[_0x4034('0x50')]['ids'][_0x59aca2]),'SmsQueueId':Number(_0x31145a['params']['id'])});}return _0x4ed19c;});}})['then'](respondWithResult(_0x4841fc,null))['catch'](handleError(_0x4841fc,null));};exports['removeAgents']=function(_0x47adf8,_0x3166b7,_0x44a682){return db[_0x4034('0x35')][_0x4034('0x55')]({'where':{'id':_0x47adf8['params']['id']}})['then'](handleEntityNotFound(_0x3166b7,null))[_0x4034('0x2c')](function(_0x116519){if(_0x116519){return _0x116519['removeAgents'](_0x47adf8['query'][_0x4034('0x69')])[_0x4034('0x2c')](function(){if(_[_0x4034('0x8d')](_0x47adf8[_0x4034('0x3c')][_0x4034('0x69')])){for(var _0x3ce787=0x0;_0x3ce787<_0x47adf8[_0x4034('0x3c')]['ids'][_0x4034('0x3f')];_0x3ce787+=0x1){socket[_0x4034('0x73')](_0x4034('0x8a'),{'UserId':Number(_0x47adf8[_0x4034('0x3c')][_0x4034('0x69')][_0x3ce787]),'SmsQueueId':Number(_0x47adf8[_0x4034('0x4d')]['id'])});}}else{socket[_0x4034('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x47adf8['query'][_0x4034('0x69')]),'SmsQueueId':Number(_0x47adf8[_0x4034('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x3166b7,null))[_0x4034('0x4b')](handleError(_0x3166b7,null));};exports[_0x4034('0x8e')]=function(_0x409516,_0x35a36d,_0x361447){var _0x11afe0={};var _0x440ca9={};var _0x9c00d9;var _0x4439e8;return db[_0x4034('0x35')][_0x4034('0x59')]({'where':{'id':_0x409516[_0x4034('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35a36d,null))[_0x4034('0x2c')](function(_0x51754c){if(_0x51754c){_0x9c00d9=_0x51754c;_0x440ca9[_0x4034('0x38')]=_['keys'](db[_0x4034('0x5e')]['rawAttributes']);_0x440ca9[_0x4034('0x3c')]=_[_0x4034('0x39')](_0x409516['query']);_0x440ca9[_0x4034('0x3a')]=_[_0x4034('0x3b')](_0x440ca9[_0x4034('0x38')],_0x440ca9[_0x4034('0x3c')]);_0x11afe0[_0x4034('0x3d')]=_['intersection'](_0x440ca9[_0x4034('0x38')],qs['fields'](_0x409516[_0x4034('0x3c')][_0x4034('0x3e')]));_0x11afe0[_0x4034('0x3d')]=_0x11afe0[_0x4034('0x3d')][_0x4034('0x3f')]?_0x11afe0[_0x4034('0x3d')]:_0x440ca9[_0x4034('0x38')];_0x11afe0['order']=qs['sort'](_0x409516[_0x4034('0x3c')]['sort']);_0x11afe0[_0x4034('0x43')]=qs[_0x4034('0x3a')](_[_0x4034('0x5c')](_0x409516[_0x4034('0x3c')],_0x440ca9[_0x4034('0x3a')]));if(_0x409516[_0x4034('0x3c')]['filter']){_0x11afe0[_0x4034('0x43')]=_[_0x4034('0x45')](_0x11afe0[_0x4034('0x43')],{'$or':_[_0x4034('0x34')](_0x11afe0[_0x4034('0x3d')],function(_0x585c0c){var _0xed1687={};_0xed1687[_0x585c0c]={'$like':'%'+_0x409516['query'][_0x4034('0x44')]+'%'};return _0xed1687;})});}_0x11afe0=_[_0x4034('0x45')]({},_0x11afe0,_0x409516[_0x4034('0x47')]);return _0x9c00d9['getAgents'](_0x11afe0);}})[_0x4034('0x2c')](function(_0x444de6){if(_0x444de6){_0x4439e8=_0x444de6[_0x4034('0x3f')];if(!_0x409516[_0x4034('0x3c')][_0x4034('0x40')]('nolimit')){_0x11afe0[_0x4034('0x23')]=qs[_0x4034('0x23')](_0x409516[_0x4034('0x3c')][_0x4034('0x23')]);_0x11afe0['offset']=qs[_0x4034('0x24')](_0x409516[_0x4034('0x3c')][_0x4034('0x24')]);}return _0x9c00d9[_0x4034('0x8e')](_0x11afe0);}})['then'](function(_0x168dff){if(_0x168dff){return _0x168dff?{'count':_0x4439e8,'rows':_0x168dff}:null;}})['then'](respondWithResult(_0x35a36d,null))[_0x4034('0x4b')](handleError(_0x35a36d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 3f63ce5..cf36385 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 _0x2efd=['hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x248eaa,_0x381bb6){var _0x5be70f=function(_0x2458c0){while(--_0x2458c0){_0x248eaa['push'](_0x248eaa['shift']());}};_0x5be70f(++_0x381bb6);}(_0x2efd,0xcb));var _0xd2ef=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2efd[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xd2ef('0x0'))['db'][_0xd2ef('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd2ef('0x2')](0x0);var events={'afterCreate':_0xd2ef('0x3'),'afterUpdate':_0xd2ef('0x4'),'afterDestroy':_0xd2ef('0x5')};function emitEvent(_0x2f288d){return function(_0x5bfffe,_0xb045b2,_0xd2d43e){SmsQueueEvents[_0xd2ef('0x6')](_0x2f288d+':'+_0x5bfffe['id'],_0x5bfffe);SmsQueueEvents['emit'](_0x2f288d,_0x5bfffe);_0xd2d43e(null);};}for(var e in events){if(events[_0xd2ef('0x7')](e)){var event=events[e];SmsQueue[_0xd2ef('0x8')](e,emitEvent(event));}}module[_0xd2ef('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x50ad=['exports','events','remove','emit','hasOwnProperty'];(function(_0x227351,_0x58e0b3){var _0x2c958d=function(_0x4a677e){while(--_0x4a677e){_0x227351['push'](_0x227351['shift']());}};_0x2c958d(++_0x58e0b3);}(_0x50ad,0xfb));var _0xd50a=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0x50ad[_0x24b477];return _0x4041a6;};'use strict';var EventEmitter=require(_0xd50a('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd50a('0x1')};function emitEvent(_0x486bad){return function(_0x1ffd54,_0x292537,_0x81a136){SmsQueueEvents[_0xd50a('0x2')](_0x486bad+':'+_0x1ffd54['id'],_0x1ffd54);SmsQueueEvents['emit'](_0x486bad,_0x1ffd54);_0x81a136(null);};}for(var e in events){if(events[_0xd50a('0x3')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd50a('0x4')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1204cba..785103b 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 _0xca86=['exports','define','SmsQueue','sms_queues','lodash','api','moment','request-promise','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0xca86,0x1a6));var _0x6ca8=function(_0x4d051b,_0x1c31d2){_0x4d051b=_0x4d051b-0x0;var _0x12e0ca=_0xca86[_0x4d051b];return _0x12e0ca;};'use strict';var _=require(_0x6ca8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ca8('0x1'));var moment=require(_0x6ca8('0x2'));var BPromise=require('bluebird');var rp=require(_0x6ca8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ca8('0x4'));var config=require(_0x6ca8('0x5'));var attributes=require(_0x6ca8('0x6'));module[_0x6ca8('0x7')]=function(_0x8a1d5e,_0x586899){return _0x8a1d5e[_0x6ca8('0x8')](_0x6ca8('0x9'),attributes,{'tableName':_0x6ca8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed6=['bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger','moment'];(function(_0x1b903c,_0x3e369c){var _0x41b5ed=function(_0x12ee24){while(--_0x12ee24){_0x1b903c['push'](_0x1b903c['shift']());}};_0x41b5ed(++_0x3e369c);}(_0x8ed6,0x97));var _0x68ed=function(_0xe548e9,_0x552a2b){_0xe548e9=_0xe548e9-0x0;var _0x25c58d=_0x8ed6[_0xe548e9];return _0x25c58d;};'use strict';var _=require(_0x68ed('0x0'));var util=require('util');var logger=require(_0x68ed('0x1'))('api');var moment=require(_0x68ed('0x2'));var BPromise=require(_0x68ed('0x3'));var rp=require(_0x68ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ed('0x5'));var config=require(_0x68ed('0x6'));var attributes=require(_0x68ed('0x7'));module[_0x68ed('0x8')]=function(_0xad7d6d,_0x463c8b){return _0xad7d6d['define'](_0x68ed('0x9'),attributes,{'tableName':_0x68ed('0xa'),'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 d4c4238..5a87977 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 _0xd1f1=['debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSmsQueue','SmsQueue','options','raw','where','limit','map','include','model','attributes','then','find','ShowSmsQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xb49f68,_0x3b2899){var _0x503f83=function(_0x332838){while(--_0x332838){_0xb49f68['push'](_0xb49f68['shift']());}};_0x503f83(++_0x3b2899);}(_0xd1f1,0xab));var _0x1d1f=function(_0x366e75,_0x533d1d){_0x366e75=_0x366e75-0x0;var _0x3b167b=_0xd1f1[_0x366e75];return _0x3b167b;};'use strict';var _=require(_0x1d1f('0x0'));var util=require('util');var moment=require(_0x1d1f('0x1'));var BPromise=require(_0x1d1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d1f('0x3'));var db=require(_0x1d1f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d1f('0x5'))('rpc');var config=require(_0x1d1f('0x6'));var jayson=require(_0x1d1f('0x7'));var client=jayson[_0x1d1f('0x8')][_0x1d1f('0x9')]({'port':0x232a});config[_0x1d1f('0xa')]=_[_0x1d1f('0xb')](config[_0x1d1f('0xa')],{'host':_0x1d1f('0xc'),'port':0x18eb});var socket=require(_0x1d1f('0xd'))(new Redis(config[_0x1d1f('0xa')]));require(_0x1d1f('0xe'))['register'](socket);function respondWithRpcPromise(_0x194cff,_0x38d4b4,_0x268ea9){return new BPromise(function(_0x265b7c,_0x49d6a1){return client[_0x1d1f('0xf')](_0x194cff,_0x268ea9)['then'](function(_0x3f4a5e){logger[_0x1d1f('0x10')](_0x1d1f('0x11'),_0x38d4b4,_0x1d1f('0x12'));logger[_0x1d1f('0x13')](_0x1d1f('0x14'),_0x38d4b4,_0x1d1f('0x12'),JSON[_0x1d1f('0x15')](_0x3f4a5e));if(_0x3f4a5e[_0x1d1f('0x16')]){if(_0x3f4a5e[_0x1d1f('0x16')]['code']===0x1f4){logger[_0x1d1f('0x16')](_0x1d1f('0x11'),_0x38d4b4,_0x3f4a5e[_0x1d1f('0x16')]['message']);return _0x49d6a1(_0x3f4a5e[_0x1d1f('0x16')]['message']);}logger[_0x1d1f('0x16')](_0x1d1f('0x11'),_0x38d4b4,_0x3f4a5e[_0x1d1f('0x16')][_0x1d1f('0x17')]);return _0x265b7c(_0x3f4a5e[_0x1d1f('0x16')][_0x1d1f('0x17')]);}else{logger[_0x1d1f('0x10')](_0x1d1f('0x11'),_0x38d4b4,_0x1d1f('0x12'));_0x265b7c(_0x3f4a5e['result'][_0x1d1f('0x17')]);}})[_0x1d1f('0x18')](function(_0x210b4d){logger[_0x1d1f('0x16')](_0x1d1f('0x11'),_0x38d4b4,_0x210b4d);_0x49d6a1(_0x210b4d);});});}exports[_0x1d1f('0x19')]=function(_0xcf8e14){var _0x401c7a=this;return new Promise(function(_0x40b8b5,_0x5dccee){return db[_0x1d1f('0x1a')]['findAll']({'raw':_0xcf8e14[_0x1d1f('0x1b')]?_0xcf8e14['options'][_0x1d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0xcf8e14[_0x1d1f('0x1b')]?_0xcf8e14[_0x1d1f('0x1b')][_0x1d1f('0x1d')]||null:null,'attributes':_0xcf8e14['options']?_0xcf8e14[_0x1d1f('0x1b')]['attributes']||null:null,'limit':_0xcf8e14['options']?_0xcf8e14[_0x1d1f('0x1b')][_0x1d1f('0x1e')]||null:null,'include':_0xcf8e14[_0x1d1f('0x1b')]?_0xcf8e14[_0x1d1f('0x1b')]['include']?_[_0x1d1f('0x1f')](_0xcf8e14['options'][_0x1d1f('0x20')],function(_0x5927b8){return{'model':db[_0x5927b8[_0x1d1f('0x21')]],'as':_0x5927b8['as'],'attributes':_0x5927b8[_0x1d1f('0x22')],'include':_0x5927b8[_0x1d1f('0x20')]?_['map'](_0x5927b8[_0x1d1f('0x20')],function(_0x5455aa){return{'model':db[_0x5455aa[_0x1d1f('0x21')]],'as':_0x5455aa['as'],'attributes':_0x5455aa[_0x1d1f('0x22')],'include':_0x5455aa[_0x1d1f('0x20')]?_[_0x1d1f('0x1f')](_0x5455aa['include'],function(_0x14ffaa){return{'model':db[_0x14ffaa[_0x1d1f('0x21')]],'as':_0x14ffaa['as'],'attributes':_0x14ffaa['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x23')](function(_0xb2fcf6){logger['info']('GetSmsQueue',_0xcf8e14);logger['debug']('GetSmsQueue',_0xcf8e14,JSON[_0x1d1f('0x15')](_0xb2fcf6));_0x40b8b5(_0xb2fcf6);})[_0x1d1f('0x18')](function(_0x4d7d5c){logger[_0x1d1f('0x16')](_0x1d1f('0x19'),_0x4d7d5c[_0x1d1f('0x17')],_0xcf8e14);_0x5dccee(_0x401c7a[_0x1d1f('0x16')](0x1f4,_0x4d7d5c[_0x1d1f('0x17')]));});});};exports['ShowSmsQueue']=function(_0x49d6a3){var _0x3829bd=this;return new Promise(function(_0x3f7237,_0x7c2ef6){return db['SmsQueue'][_0x1d1f('0x24')]({'raw':_0x49d6a3['options']?_0x49d6a3['options'][_0x1d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x49d6a3[_0x1d1f('0x1b')]?_0x49d6a3[_0x1d1f('0x1b')][_0x1d1f('0x1d')]||null:null,'attributes':_0x49d6a3['options']?_0x49d6a3['options'][_0x1d1f('0x22')]||null:null,'include':_0x49d6a3[_0x1d1f('0x1b')]?_0x49d6a3[_0x1d1f('0x1b')][_0x1d1f('0x20')]?_[_0x1d1f('0x1f')](_0x49d6a3['options'][_0x1d1f('0x20')],function(_0x1f22d3){return{'model':db[_0x1f22d3[_0x1d1f('0x21')]],'as':_0x1f22d3['as'],'attributes':_0x1f22d3[_0x1d1f('0x22')],'include':_0x1f22d3['include']?_[_0x1d1f('0x1f')](_0x1f22d3[_0x1d1f('0x20')],function(_0x250d1d){return{'model':db[_0x250d1d[_0x1d1f('0x21')]],'as':_0x250d1d['as'],'attributes':_0x250d1d['attributes'],'include':_0x250d1d[_0x1d1f('0x20')]?_[_0x1d1f('0x1f')](_0x250d1d[_0x1d1f('0x20')],function(_0x269cb1){return{'model':db[_0x269cb1['model']],'as':_0x269cb1['as'],'attributes':_0x269cb1[_0x1d1f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1d1f('0x23')](function(_0x23dbb2){logger[_0x1d1f('0x10')](_0x1d1f('0x25'),_0x49d6a3);logger['debug'](_0x1d1f('0x25'),_0x49d6a3,JSON[_0x1d1f('0x15')](_0x23dbb2));_0x3f7237(_0x23dbb2);})[_0x1d1f('0x18')](function(_0x1e2f2b){logger[_0x1d1f('0x16')](_0x1d1f('0x25'),_0x1e2f2b[_0x1d1f('0x17')],_0x49d6a3);_0x7c2ef6(_0x3829bd[_0x1d1f('0x16')](0x1f4,_0x1e2f2b['message']));});});}; \ No newline at end of file +var _0x1221=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','include','map','model','attributes','ShowSmsQueue','lodash'];(function(_0x4d0d97,_0xf4be3a){var _0x5310ff=function(_0x365f91){while(--_0x365f91){_0x4d0d97['push'](_0x4d0d97['shift']());}};_0x5310ff(++_0xf4be3a);}(_0x1221,0x1e0));var _0x1122=function(_0x265f30,_0x33e263){_0x265f30=_0x265f30-0x0;var _0x30a9bd=_0x1221[_0x265f30];return _0x30a9bd;};'use strict';var _=require(_0x1122('0x0'));var util=require(_0x1122('0x1'));var moment=require(_0x1122('0x2'));var BPromise=require(_0x1122('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1122('0x4'));var db=require(_0x1122('0x5'))['db'];var utils=require(_0x1122('0x6'));var logger=require(_0x1122('0x7'))(_0x1122('0x8'));var config=require(_0x1122('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1122('0xa')]['http']({'port':0x232a});config['redis']=_[_0x1122('0xb')](config[_0x1122('0xc')],{'host':_0x1122('0xd'),'port':0x18eb});var socket=require(_0x1122('0xe'))(new Redis(config[_0x1122('0xc')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2a16a4,_0x23d61f,_0x34ec47){return new BPromise(function(_0x3ce8cf,_0x3bc949){return client['request'](_0x2a16a4,_0x34ec47)[_0x1122('0xf')](function(_0xb341eb){logger['info'](_0x1122('0x10'),_0x23d61f,'request\x20sent');logger[_0x1122('0x11')](_0x1122('0x12'),_0x23d61f,_0x1122('0x13'),JSON[_0x1122('0x14')](_0xb341eb));if(_0xb341eb[_0x1122('0x15')]){if(_0xb341eb[_0x1122('0x15')][_0x1122('0x16')]===0x1f4){logger[_0x1122('0x15')](_0x1122('0x10'),_0x23d61f,_0xb341eb[_0x1122('0x15')][_0x1122('0x17')]);return _0x3bc949(_0xb341eb[_0x1122('0x15')][_0x1122('0x17')]);}logger[_0x1122('0x15')](_0x1122('0x10'),_0x23d61f,_0xb341eb[_0x1122('0x15')][_0x1122('0x17')]);return _0x3ce8cf(_0xb341eb[_0x1122('0x15')][_0x1122('0x17')]);}else{logger[_0x1122('0x18')](_0x1122('0x10'),_0x23d61f,'request\x20sent');_0x3ce8cf(_0xb341eb['result'][_0x1122('0x17')]);}})[_0x1122('0x19')](function(_0x1bad7a){logger['error'](_0x1122('0x10'),_0x23d61f,_0x1bad7a);_0x3bc949(_0x1bad7a);});});}exports[_0x1122('0x1a')]=function(_0x407fda){var _0x1732ae=this;return new Promise(function(_0x4b4f05,_0x41b16a){return db[_0x1122('0x1b')][_0x1122('0x1c')]({'raw':_0x407fda[_0x1122('0x1d')]?_0x407fda[_0x1122('0x1d')][_0x1122('0x1e')]===undefined?!![]:![]:!![],'where':_0x407fda[_0x1122('0x1d')]?_0x407fda[_0x1122('0x1d')][_0x1122('0x1f')]||null:null,'attributes':_0x407fda[_0x1122('0x1d')]?_0x407fda[_0x1122('0x1d')]['attributes']||null:null,'limit':_0x407fda[_0x1122('0x1d')]?_0x407fda[_0x1122('0x1d')]['limit']||null:null,'include':_0x407fda['options']?_0x407fda[_0x1122('0x1d')][_0x1122('0x20')]?_[_0x1122('0x21')](_0x407fda['options'][_0x1122('0x20')],function(_0x1c6402){return{'model':db[_0x1c6402[_0x1122('0x22')]],'as':_0x1c6402['as'],'attributes':_0x1c6402[_0x1122('0x23')],'include':_0x1c6402['include']?_[_0x1122('0x21')](_0x1c6402[_0x1122('0x20')],function(_0x2048ef){return{'model':db[_0x2048ef[_0x1122('0x22')]],'as':_0x2048ef['as'],'attributes':_0x2048ef['attributes'],'include':_0x2048ef[_0x1122('0x20')]?_['map'](_0x2048ef[_0x1122('0x20')],function(_0x53d817){return{'model':db[_0x53d817[_0x1122('0x22')]],'as':_0x53d817['as'],'attributes':_0x53d817['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x211552){logger[_0x1122('0x18')](_0x1122('0x1a'),_0x407fda);logger[_0x1122('0x11')](_0x1122('0x1a'),_0x407fda,JSON[_0x1122('0x14')](_0x211552));_0x4b4f05(_0x211552);})[_0x1122('0x19')](function(_0x4d6d10){logger[_0x1122('0x15')](_0x1122('0x1a'),_0x4d6d10[_0x1122('0x17')],_0x407fda);_0x41b16a(_0x1732ae[_0x1122('0x15')](0x1f4,_0x4d6d10['message']));});});};exports[_0x1122('0x24')]=function(_0x22b087){var _0x1dfe20=this;return new Promise(function(_0x18bfa4,_0x59ef74){return db[_0x1122('0x1b')]['find']({'raw':_0x22b087[_0x1122('0x1d')]?_0x22b087['options']['raw']===undefined?!![]:![]:!![],'where':_0x22b087[_0x1122('0x1d')]?_0x22b087['options'][_0x1122('0x1f')]||null:null,'attributes':_0x22b087[_0x1122('0x1d')]?_0x22b087[_0x1122('0x1d')][_0x1122('0x23')]||null:null,'include':_0x22b087[_0x1122('0x1d')]?_0x22b087[_0x1122('0x1d')][_0x1122('0x20')]?_['map'](_0x22b087['options'][_0x1122('0x20')],function(_0x253493){return{'model':db[_0x253493[_0x1122('0x22')]],'as':_0x253493['as'],'attributes':_0x253493['attributes'],'include':_0x253493[_0x1122('0x20')]?_[_0x1122('0x21')](_0x253493[_0x1122('0x20')],function(_0x9dbff4){return{'model':db[_0x9dbff4[_0x1122('0x22')]],'as':_0x9dbff4['as'],'attributes':_0x9dbff4[_0x1122('0x23')],'include':_0x9dbff4[_0x1122('0x20')]?_['map'](_0x9dbff4[_0x1122('0x20')],function(_0x11a424){return{'model':db[_0x11a424[_0x1122('0x22')]],'as':_0x11a424['as'],'attributes':_0x11a424[_0x1122('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1122('0xf')](function(_0x1698cb){logger[_0x1122('0x18')](_0x1122('0x24'),_0x22b087);logger[_0x1122('0x11')]('ShowSmsQueue',_0x22b087,JSON[_0x1122('0x14')](_0x1698cb));_0x18bfa4(_0x1698cb);})[_0x1122('0x19')](function(_0x54aae5){logger[_0x1122('0x15')](_0x1122('0x24'),_0x54aae5[_0x1122('0x17')],_0x22b087);_0x59ef74(_0x1dfe20['error'](0x1f4,_0x54aae5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 35320ba..2ace23b 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 _0x7e2e=['length','smsQueue:','save','remove','update','emit','register'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x7e2e,0xb1));var _0xe7e2=function(_0x186798,_0x6e997c){_0x186798=_0x186798-0x0;var _0x5b46ea=_0x7e2e[_0x186798];return _0x5b46ea;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe7e2('0x0'),_0xe7e2('0x1'),_0xe7e2('0x2')];function createListener(_0x1e3f28,_0x40b031){return function(_0x14cefd){_0x40b031[_0xe7e2('0x3')](_0x1e3f28,_0x14cefd);};}function removeListener(_0x3bcd67,_0x53dc33){return function(){SmsQueueEvents['removeListener'](_0x3bcd67,_0x53dc33);};}exports[_0xe7e2('0x4')]=function(_0x265a58){for(var _0x5e7385=0x0,_0x3cf6ae=events[_0xe7e2('0x5')];_0x5e7385<_0x3cf6ae;_0x5e7385++){var _0x1731ab=events[_0x5e7385];var _0x27d70=createListener(_0xe7e2('0x6')+_0x1731ab,_0x265a58);SmsQueueEvents['on'](_0x1731ab,_0x27d70);}}; \ No newline at end of file +var _0xaf68=['smsQueue:','./smsQueue.events','save','remove','update','removeListener','register','length'];(function(_0x44d0ee,_0x1a50d8){var _0x4424fc=function(_0x284f25){while(--_0x284f25){_0x44d0ee['push'](_0x44d0ee['shift']());}};_0x4424fc(++_0x1a50d8);}(_0xaf68,0x151));var _0x8af6=function(_0x5500f4,_0x28837c){_0x5500f4=_0x5500f4-0x0;var _0x4bfda4=_0xaf68[_0x5500f4];return _0x4bfda4;};'use strict';var SmsQueueEvents=require(_0x8af6('0x0'));var events=[_0x8af6('0x1'),_0x8af6('0x2'),_0x8af6('0x3')];function createListener(_0x55bec3,_0x61193d){return function(_0x10b9f3){_0x61193d['emit'](_0x55bec3,_0x10b9f3);};}function removeListener(_0x27e08b,_0x2f013c){return function(){SmsQueueEvents[_0x8af6('0x4')](_0x27e08b,_0x2f013c);};}exports[_0x8af6('0x5')]=function(_0x55eadf){for(var _0x49a595=0x0,_0x3e54f6=events[_0x8af6('0x6')];_0x49a595<_0x3e54f6;_0x49a595++){var _0x54e074=events[_0x49a595];var _0x20d5f9=createListener(_0x8af6('0x7')+_0x54e074,_0x55eadf);SmsQueueEvents['on'](_0x54e074,_0x20d5f9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ac57432..5f50d21 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 _0x3cd2=['/:id','show','post','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x13c052,_0x25c434){var _0x11de4f=function(_0x455187){while(--_0x455187){_0x13c052['push'](_0x13c052['shift']());}};_0x11de4f(++_0x25c434);}(_0x3cd2,0x115));var _0x23cd=function(_0x2c8ddf,_0x2eb7ac){_0x2c8ddf=_0x2c8ddf-0x0;var _0x5f0f03=_0x3cd2[_0x2c8ddf];return _0x5f0f03;};'use strict';var multer=require(_0x23cd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x23cd('0x1'));var router=express[_0x23cd('0x2')]();var fs_extra=require(_0x23cd('0x3'));var auth=require(_0x23cd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23cd('0x5'));var controller=require(_0x23cd('0x6'));router['get']('/',auth[_0x23cd('0x7')](),controller['index']);router[_0x23cd('0x8')](_0x23cd('0x9'),auth['isAuthenticated'](),controller[_0x23cd('0xa')]);router[_0x23cd('0x8')](_0x23cd('0xb'),auth['isAuthenticated'](),controller[_0x23cd('0xc')]);router[_0x23cd('0xd')]('/',auth[_0x23cd('0x7')](),controller['create']);router[_0x23cd('0xe')]('/:id',auth[_0x23cd('0x7')](),controller['update']);router[_0x23cd('0xf')](_0x23cd('0xb'),auth[_0x23cd('0x7')](),controller[_0x23cd('0x10')]);module[_0x23cd('0x11')]=router; \ No newline at end of file +var _0xceee=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','create','update','/:id','destroy','exports'];(function(_0x53a456,_0x1c3d73){var _0x19bf77=function(_0x252263){while(--_0x252263){_0x53a456['push'](_0x53a456['shift']());}};_0x19bf77(++_0x1c3d73);}(_0xceee,0xbb));var _0xecee=function(_0x1a5d02,_0x240865){_0x1a5d02=_0x1a5d02-0x0;var _0x1d3c69=_0xceee[_0x1a5d02];return _0x1d3c69;};'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('./smsQueueReport.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['post']('/',auth[_0xecee('0x9')](),controller[_0xecee('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xecee('0xd')]);router['delete'](_0xecee('0xe'),auth['isAuthenticated'](),controller[_0xecee('0xf')]);module[_0xecee('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7ccc53e..9c1d476 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 _0x01e3=['moment','sequelize','exports','STRING','DATE'];(function(_0x4194d1,_0x151f26){var _0x580f65=function(_0x2c3422){while(--_0x2c3422){_0x4194d1['push'](_0x4194d1['shift']());}};_0x580f65(++_0x151f26);}(_0x01e3,0x122));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x301e('0x0'));var Sequelize=require(_0x301e('0x1'));module[_0x301e('0x2')]={'uniqueid':{'type':Sequelize[_0x301e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x301e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x301e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x301e('0x3')]}}; \ No newline at end of file +var _0x6316=['STRING','DATE','moment'];(function(_0x52b674,_0x4186bc){var _0x19a812=function(_0x1fab03){while(--_0x1fab03){_0x52b674['push'](_0x52b674['shift']());}};_0x19a812(++_0x4186bc);}(_0x6316,0x1d6));var _0x6631=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6316[_0x432682];return _0x463d05;};'use strict';var moment=require(_0x6631('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6631('0x1')]},'joinAt':{'type':Sequelize[_0x6631('0x2')]},'leaveAt':{'type':Sequelize[_0x6631('0x2')]},'acceptAt':{'type':Sequelize[_0x6631('0x2')]},'exitAt':{'type':Sequelize[_0x6631('0x2')]},'reason':{'type':Sequelize[_0x6631('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2d40084..658d7d1 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 _0x72db=['set','apply','reject','save','then','destroy','end','error','stack','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count'];(function(_0x467347,_0x42b8d5){var _0xb070e0=function(_0x3841a1){while(--_0x3841a1){_0x467347['push'](_0x467347['shift']());}};_0xb070e0(++_0x42b8d5);}(_0x72db,0x1ea));var _0xb72d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x72db[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb72d('0x0'));var zipdir=require(_0xb72d('0x1'));var jsonpatch=require(_0xb72d('0x2'));var rp=require(_0xb72d('0x3'));var moment=require(_0xb72d('0x4'));var BPromise=require(_0xb72d('0x5'));var Mustache=require(_0xb72d('0x6'));var util=require('util');var path=require(_0xb72d('0x7'));var sox=require('sox');var csv=require(_0xb72d('0x8'));var ejs=require(_0xb72d('0x9'));var fs=require('fs');var fs_extra=require(_0xb72d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb72d('0xb'));var jsforce=require(_0xb72d('0xc'));var deskjs=require(_0xb72d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb72d('0xe'));var Redis=require('ioredis');var authService=require(_0xb72d('0xf'));var qs=require(_0xb72d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb72d('0x11'));var logger=require(_0xb72d('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb72d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb72d('0x14'))['db'];function respondWithStatusCode(_0x478e05,_0x486347){_0x486347=_0x486347||0xcc;return function(_0x139172){if(_0x139172){return _0x478e05[_0xb72d('0x15')](_0x486347);}return _0x478e05[_0xb72d('0x16')](_0x486347)['end']();};}function respondWithResult(_0x4a0788,_0x1006de){_0x1006de=_0x1006de||0xc8;return function(_0x4195c6){if(_0x4195c6){return _0x4a0788['status'](_0x1006de)[_0xb72d('0x17')](_0x4195c6);}};}function respondWithFilteredResult(_0x264521,_0x16a040){return function(_0x3cee45){if(_0x3cee45){var _0x1ae243=typeof _0x16a040[_0xb72d('0x18')]==='undefined'&&typeof _0x16a040[_0xb72d('0x19')]===_0xb72d('0x1a');var _0x109b90=_0x3cee45[_0xb72d('0x1b')];var _0x3d8137=_0x1ae243?0x0:_0x16a040[_0xb72d('0x18')];var _0x1ea5ef=_0x1ae243?_0x3cee45[_0xb72d('0x1b')]:_0x16a040[_0xb72d('0x18')]+_0x16a040[_0xb72d('0x19')];var _0x1ea247;if(_0x1ea5ef>=_0x109b90){_0x1ea5ef=_0x109b90;_0x1ea247=0xc8;}else{_0x1ea247=0xce;}_0x264521[_0xb72d('0x16')](_0x1ea247);return _0x264521[_0xb72d('0x1c')]('Content-Range',_0x3d8137+'-'+_0x1ea5ef+'/'+_0x109b90)[_0xb72d('0x17')](_0x3cee45);}return null;};}function patchUpdates(_0x44dbd2){return function(_0x139040){try{jsonpatch[_0xb72d('0x1d')](_0x139040,_0x44dbd2,!![]);}catch(_0x4db985){return BPromise[_0xb72d('0x1e')](_0x4db985);}return _0x139040[_0xb72d('0x1f')]();};}function saveUpdates(_0x552a23,_0xe3705d){return function(_0x3d4c25){if(_0x3d4c25){return _0x3d4c25['update'](_0x552a23)[_0xb72d('0x20')](function(_0xe5d905){return _0xe5d905;});}return null;};}function removeEntity(_0x134848,_0x299f12){return function(_0x1559ea){if(_0x1559ea){return _0x1559ea[_0xb72d('0x21')]()[_0xb72d('0x20')](function(){_0x134848['status'](0xcc)[_0xb72d('0x22')]();});}};}function handleEntityNotFound(_0x292609,_0x43cf8b){return function(_0x4c4cc0){if(!_0x4c4cc0){_0x292609[_0xb72d('0x15')](0x194);}return _0x4c4cc0;};}function handleError(_0x207b98,_0x4ec70f){_0x4ec70f=_0x4ec70f||0x1f4;return function(_0x1f986b){logger[_0xb72d('0x23')](_0x1f986b[_0xb72d('0x24')]);if(_0x1f986b['name']){delete _0x1f986b['name'];}_0x207b98[_0xb72d('0x16')](_0x4ec70f)[_0xb72d('0x25')](_0x1f986b);};}exports[_0xb72d('0x26')]=function(_0x3a5c77,_0x26558b){var _0x5bf74a={},_0x2c2485={},_0x274ad0={'count':0x0,'rows':[]};var _0x5bbfa1=_[_0xb72d('0x27')](db[_0xb72d('0x28')][_0xb72d('0x29')],function(_0x160acb){return{'name':_0x160acb[_0xb72d('0x2a')],'type':_0x160acb[_0xb72d('0x2b')][_0xb72d('0x2c')]};});_0x2c2485[_0xb72d('0x2d')]=_['map'](_0x5bbfa1,'name');_0x2c2485[_0xb72d('0x2e')]=_['keys'](_0x3a5c77['query']);_0x2c2485[_0xb72d('0x2f')]=_['intersection'](_0x2c2485[_0xb72d('0x2d')],_0x2c2485[_0xb72d('0x2e')]);_0x5bf74a['attributes']=_[_0xb72d('0x30')](_0x2c2485[_0xb72d('0x2d')],qs['fields'](_0x3a5c77['query'][_0xb72d('0x31')]));_0x5bf74a[_0xb72d('0x32')]=_0x5bf74a[_0xb72d('0x32')][_0xb72d('0x33')]?_0x5bf74a[_0xb72d('0x32')]:_0x2c2485['model'];if(!_0x3a5c77[_0xb72d('0x2e')][_0xb72d('0x34')]('nolimit')){_0x5bf74a[_0xb72d('0x19')]=qs[_0xb72d('0x19')](_0x3a5c77[_0xb72d('0x2e')][_0xb72d('0x19')]);_0x5bf74a[_0xb72d('0x18')]=qs['offset'](_0x3a5c77['query'][_0xb72d('0x18')]);}_0x5bf74a[_0xb72d('0x35')]=qs[_0xb72d('0x36')](_0x3a5c77[_0xb72d('0x2e')]['sort']);_0x5bf74a['where']=qs[_0xb72d('0x2f')](_[_0xb72d('0x37')](_0x3a5c77[_0xb72d('0x2e')],_0x2c2485['filters']),_0x5bbfa1);if(_0x3a5c77[_0xb72d('0x2e')][_0xb72d('0x38')]){_0x5bf74a[_0xb72d('0x39')]=_[_0xb72d('0x3a')](_0x5bf74a[_0xb72d('0x39')],{'$or':_[_0xb72d('0x27')](_0x5bbfa1,function(_0x19d7e0){if(_0x19d7e0[_0xb72d('0x2b')]!==_0xb72d('0x3b')){var _0x150e3c={};_0x150e3c[_0x19d7e0[_0xb72d('0x3c')]]={'$like':'%'+_0x3a5c77[_0xb72d('0x2e')][_0xb72d('0x38')]+'%'};return _0x150e3c;}})});}_0x5bf74a=_[_0xb72d('0x3a')]({},_0x5bf74a,_0x3a5c77['options']);var _0x3bca16={'where':_0x5bf74a['where']};return db[_0xb72d('0x28')][_0xb72d('0x1b')](_0x3bca16)[_0xb72d('0x20')](function(_0x5e8958){_0x274ad0[_0xb72d('0x1b')]=_0x5e8958;if(_0x3a5c77['query'][_0xb72d('0x3d')]){_0x5bf74a[_0xb72d('0x3e')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb72d('0x3f')](_0x5bf74a);})[_0xb72d('0x20')](function(_0x3ed331){_0x274ad0[_0xb72d('0x40')]=_0x3ed331;return _0x274ad0;})[_0xb72d('0x20')](respondWithFilteredResult(_0x26558b,_0x5bf74a))[_0xb72d('0x41')](handleError(_0x26558b,null));};exports[_0xb72d('0x42')]=function(_0x3076d5,_0x286c70){var _0x365f87={'raw':!![],'where':{'id':_0x3076d5[_0xb72d('0x43')]['id']}},_0x1b7977={};_0x1b7977['model']=_['keys'](db[_0xb72d('0x28')][_0xb72d('0x29')]);_0x1b7977['query']=_['keys'](_0x3076d5[_0xb72d('0x2e')]);_0x1b7977[_0xb72d('0x2f')]=_[_0xb72d('0x30')](_0x1b7977[_0xb72d('0x2d')],_0x1b7977[_0xb72d('0x2e')]);_0x365f87['attributes']=_[_0xb72d('0x30')](_0x1b7977[_0xb72d('0x2d')],qs[_0xb72d('0x31')](_0x3076d5[_0xb72d('0x2e')]['fields']));_0x365f87[_0xb72d('0x32')]=_0x365f87[_0xb72d('0x32')][_0xb72d('0x33')]?_0x365f87[_0xb72d('0x32')]:_0x1b7977['model'];if(_0x3076d5[_0xb72d('0x2e')]['includeAll']){_0x365f87[_0xb72d('0x3e')]=[{'all':!![]}];}_0x365f87=_[_0xb72d('0x3a')]({},_0x365f87,_0x3076d5[_0xb72d('0x44')]);return db[_0xb72d('0x28')][_0xb72d('0x45')](_0x365f87)[_0xb72d('0x20')](handleEntityNotFound(_0x286c70,null))[_0xb72d('0x20')](respondWithResult(_0x286c70,null))[_0xb72d('0x41')](handleError(_0x286c70,null));};exports[_0xb72d('0x46')]=function(_0x43671f,_0x3b703a){return db[_0xb72d('0x28')][_0xb72d('0x46')](_0x43671f[_0xb72d('0x47')],{})['then'](respondWithResult(_0x3b703a,0xc9))['catch'](handleError(_0x3b703a,null));};exports[_0xb72d('0x48')]=function(_0x4a4c6b,_0x410468){if(_0x4a4c6b[_0xb72d('0x47')]['id']){delete _0x4a4c6b[_0xb72d('0x47')]['id'];}return db['SmsQueueReport'][_0xb72d('0x45')]({'where':{'id':_0x4a4c6b[_0xb72d('0x43')]['id']}})[_0xb72d('0x20')](handleEntityNotFound(_0x410468,null))[_0xb72d('0x20')](saveUpdates(_0x4a4c6b['body'],null))['then'](respondWithResult(_0x410468,null))[_0xb72d('0x41')](handleError(_0x410468,null));};exports[_0xb72d('0x21')]=function(_0x4af1c5,_0x510785){return db[_0xb72d('0x28')]['find']({'where':{'id':_0x4af1c5[_0xb72d('0x43')]['id']}})[_0xb72d('0x20')](handleEntityNotFound(_0x510785,null))['then'](removeEntity(_0x510785,null))['catch'](handleError(_0x510785,null));};exports[_0xb72d('0x49')]=function(_0x48f142,_0x5ae906){return db['SmsQueueReport'][_0xb72d('0x49')]()[_0xb72d('0x20')](respondWithResult(_0x5ae906,null))[_0xb72d('0x41')](handleError(_0x5ae906,null));}; \ No newline at end of file +var _0xbcb0=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','SmsQueueReport','rows','then','catch','show','params','rawAttributes','include','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','sendStatus','error','name','send','map','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x4aec32,_0x3f8e0e){var _0xefb8ba=function(_0x295e57){while(--_0x295e57){_0x4aec32['push'](_0x4aec32['shift']());}};_0xefb8ba(++_0x3f8e0e);}(_0xbcb0,0x1a5));var _0x0bcb=function(_0x1c420e,_0x15ead7){_0x1c420e=_0x1c420e-0x0;var _0x1930e6=_0xbcb0[_0x1c420e];return _0x1930e6;};'use strict';var emlformat=require(_0x0bcb('0x0'));var rimraf=require(_0x0bcb('0x1'));var zipdir=require(_0x0bcb('0x2'));var jsonpatch=require(_0x0bcb('0x3'));var rp=require(_0x0bcb('0x4'));var moment=require('moment');var BPromise=require(_0x0bcb('0x5'));var Mustache=require(_0x0bcb('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0bcb('0x7'));var csv=require(_0x0bcb('0x8'));var ejs=require(_0x0bcb('0x9'));var fs=require('fs');var fs_extra=require(_0x0bcb('0xa'));var _=require('lodash');var squel=require(_0x0bcb('0xb'));var crypto=require(_0x0bcb('0xc'));var jsforce=require(_0x0bcb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bcb('0x8'));var querystring=require(_0x0bcb('0xe'));var Papa=require(_0x0bcb('0xf'));var Redis=require(_0x0bcb('0x10'));var authService=require(_0x0bcb('0x11'));var qs=require(_0x0bcb('0x12'));var as=require(_0x0bcb('0x13'));var hardwareService=require(_0x0bcb('0x14'));var logger=require(_0x0bcb('0x15'))(_0x0bcb('0x16'));var utils=require(_0x0bcb('0x17'));var config=require(_0x0bcb('0x18'));var licenseUtil=require(_0x0bcb('0x19'));var db=require(_0x0bcb('0x1a'))['db'];function respondWithStatusCode(_0x275996,_0x54438c){_0x54438c=_0x54438c||0xcc;return function(_0x33b0b5){if(_0x33b0b5){return _0x275996['sendStatus'](_0x54438c);}return _0x275996['status'](_0x54438c)[_0x0bcb('0x1b')]();};}function respondWithResult(_0x4a0672,_0xef775c){_0xef775c=_0xef775c||0xc8;return function(_0x31991c){if(_0x31991c){return _0x4a0672['status'](_0xef775c)[_0x0bcb('0x1c')](_0x31991c);}};}function respondWithFilteredResult(_0x5df4af,_0x2f5c81){return function(_0x490ddc){if(_0x490ddc){var _0x6d23b1=typeof _0x2f5c81[_0x0bcb('0x1d')]===_0x0bcb('0x1e')&&typeof _0x2f5c81[_0x0bcb('0x1f')]===_0x0bcb('0x1e');var _0x35e879=_0x490ddc[_0x0bcb('0x20')];var _0x1d4b27=_0x6d23b1?0x0:_0x2f5c81[_0x0bcb('0x1d')];var _0x34f81c=_0x6d23b1?_0x490ddc[_0x0bcb('0x20')]:_0x2f5c81[_0x0bcb('0x1d')]+_0x2f5c81['limit'];var _0x2bc0c3;if(_0x34f81c>=_0x35e879){_0x34f81c=_0x35e879;_0x2bc0c3=0xc8;}else{_0x2bc0c3=0xce;}_0x5df4af[_0x0bcb('0x21')](_0x2bc0c3);return _0x5df4af[_0x0bcb('0x22')](_0x0bcb('0x23'),_0x1d4b27+'-'+_0x34f81c+'/'+_0x35e879)[_0x0bcb('0x1c')](_0x490ddc);}return null;};}function patchUpdates(_0x2c4e9b){return function(_0x434f3a){try{jsonpatch[_0x0bcb('0x24')](_0x434f3a,_0x2c4e9b,!![]);}catch(_0x31a9dd){return BPromise[_0x0bcb('0x25')](_0x31a9dd);}return _0x434f3a[_0x0bcb('0x26')]();};}function saveUpdates(_0x4b681d,_0x400e9d){return function(_0x570630){if(_0x570630){return _0x570630['update'](_0x4b681d)['then'](function(_0x4d0a1f){return _0x4d0a1f;});}return null;};}function removeEntity(_0x43fec2,_0x224314){return function(_0x5e5bad){if(_0x5e5bad){return _0x5e5bad[_0x0bcb('0x27')]()['then'](function(){_0x43fec2[_0x0bcb('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x573aed,_0x18741b){return function(_0x50e106){if(!_0x50e106){_0x573aed[_0x0bcb('0x28')](0x194);}return _0x50e106;};}function handleError(_0x7db9ee,_0x51ade5){_0x51ade5=_0x51ade5||0x1f4;return function(_0x2bbf4b){logger[_0x0bcb('0x29')](_0x2bbf4b['stack']);if(_0x2bbf4b[_0x0bcb('0x2a')]){delete _0x2bbf4b['name'];}_0x7db9ee[_0x0bcb('0x21')](_0x51ade5)[_0x0bcb('0x2b')](_0x2bbf4b);};}exports['index']=function(_0x122425,_0x2e9f94){var _0x5628e3={},_0x2d991c={},_0x461a85={'count':0x0,'rows':[]};var _0x49e086=_[_0x0bcb('0x2c')](db['SmsQueueReport']['rawAttributes'],function(_0x25fe77){return{'name':_0x25fe77[_0x0bcb('0x2d')],'type':_0x25fe77[_0x0bcb('0x2e')][_0x0bcb('0x2f')]};});_0x2d991c[_0x0bcb('0x30')]=_['map'](_0x49e086,_0x0bcb('0x2a'));_0x2d991c[_0x0bcb('0x31')]=_[_0x0bcb('0x32')](_0x122425[_0x0bcb('0x31')]);_0x2d991c[_0x0bcb('0x33')]=_['intersection'](_0x2d991c[_0x0bcb('0x30')],_0x2d991c['query']);_0x5628e3[_0x0bcb('0x34')]=_[_0x0bcb('0x35')](_0x2d991c[_0x0bcb('0x30')],qs[_0x0bcb('0x36')](_0x122425[_0x0bcb('0x31')][_0x0bcb('0x36')]));_0x5628e3[_0x0bcb('0x34')]=_0x5628e3[_0x0bcb('0x34')][_0x0bcb('0x37')]?_0x5628e3['attributes']:_0x2d991c[_0x0bcb('0x30')];if(!_0x122425[_0x0bcb('0x31')][_0x0bcb('0x38')](_0x0bcb('0x39'))){_0x5628e3[_0x0bcb('0x1f')]=qs[_0x0bcb('0x1f')](_0x122425[_0x0bcb('0x31')]['limit']);_0x5628e3[_0x0bcb('0x1d')]=qs['offset'](_0x122425['query'][_0x0bcb('0x1d')]);}_0x5628e3[_0x0bcb('0x3a')]=qs[_0x0bcb('0x3b')](_0x122425['query']['sort']);_0x5628e3[_0x0bcb('0x3c')]=qs['filters'](_[_0x0bcb('0x3d')](_0x122425[_0x0bcb('0x31')],_0x2d991c[_0x0bcb('0x33')]),_0x49e086);if(_0x122425[_0x0bcb('0x31')]['filter']){_0x5628e3['where']=_['merge'](_0x5628e3[_0x0bcb('0x3c')],{'$or':_['map'](_0x49e086,function(_0x41c32d){if(_0x41c32d[_0x0bcb('0x2e')]!==_0x0bcb('0x3e')){var _0x4532f7={};_0x4532f7[_0x41c32d['name']]={'$like':'%'+_0x122425['query']['filter']+'%'};return _0x4532f7;}})});}_0x5628e3=_[_0x0bcb('0x3f')]({},_0x5628e3,_0x122425[_0x0bcb('0x40')]);var _0x1a9a5d={'where':_0x5628e3[_0x0bcb('0x3c')]};return db['SmsQueueReport'][_0x0bcb('0x20')](_0x1a9a5d)['then'](function(_0x5b6b58){_0x461a85[_0x0bcb('0x20')]=_0x5b6b58;if(_0x122425[_0x0bcb('0x31')][_0x0bcb('0x41')]){_0x5628e3['include']=[{'all':!![]}];}return db[_0x0bcb('0x42')]['findAll'](_0x5628e3);})['then'](function(_0xcdcf65){_0x461a85[_0x0bcb('0x43')]=_0xcdcf65;return _0x461a85;})[_0x0bcb('0x44')](respondWithFilteredResult(_0x2e9f94,_0x5628e3))[_0x0bcb('0x45')](handleError(_0x2e9f94,null));};exports[_0x0bcb('0x46')]=function(_0x17db3f,_0x2e9d28){var _0x2b28eb={'raw':!![],'where':{'id':_0x17db3f[_0x0bcb('0x47')]['id']}},_0x556d25={};_0x556d25[_0x0bcb('0x30')]=_[_0x0bcb('0x32')](db[_0x0bcb('0x42')][_0x0bcb('0x48')]);_0x556d25[_0x0bcb('0x31')]=_['keys'](_0x17db3f[_0x0bcb('0x31')]);_0x556d25['filters']=_[_0x0bcb('0x35')](_0x556d25[_0x0bcb('0x30')],_0x556d25[_0x0bcb('0x31')]);_0x2b28eb[_0x0bcb('0x34')]=_[_0x0bcb('0x35')](_0x556d25[_0x0bcb('0x30')],qs[_0x0bcb('0x36')](_0x17db3f['query'][_0x0bcb('0x36')]));_0x2b28eb[_0x0bcb('0x34')]=_0x2b28eb[_0x0bcb('0x34')][_0x0bcb('0x37')]?_0x2b28eb[_0x0bcb('0x34')]:_0x556d25['model'];if(_0x17db3f[_0x0bcb('0x31')][_0x0bcb('0x41')]){_0x2b28eb[_0x0bcb('0x49')]=[{'all':!![]}];}_0x2b28eb=_[_0x0bcb('0x3f')]({},_0x2b28eb,_0x17db3f[_0x0bcb('0x40')]);return db[_0x0bcb('0x42')]['find'](_0x2b28eb)[_0x0bcb('0x44')](handleEntityNotFound(_0x2e9d28,null))['then'](respondWithResult(_0x2e9d28,null))[_0x0bcb('0x45')](handleError(_0x2e9d28,null));};exports[_0x0bcb('0x4a')]=function(_0x5cd85f,_0x22d16a){return db[_0x0bcb('0x42')][_0x0bcb('0x4a')](_0x5cd85f['body'],{})[_0x0bcb('0x44')](respondWithResult(_0x22d16a,0xc9))[_0x0bcb('0x45')](handleError(_0x22d16a,null));};exports[_0x0bcb('0x4b')]=function(_0x5f0a34,_0x5b550d){if(_0x5f0a34[_0x0bcb('0x4c')]['id']){delete _0x5f0a34[_0x0bcb('0x4c')]['id'];}return db['SmsQueueReport'][_0x0bcb('0x4d')]({'where':{'id':_0x5f0a34[_0x0bcb('0x47')]['id']}})[_0x0bcb('0x44')](handleEntityNotFound(_0x5b550d,null))[_0x0bcb('0x44')](saveUpdates(_0x5f0a34[_0x0bcb('0x4c')],null))[_0x0bcb('0x44')](respondWithResult(_0x5b550d,null))[_0x0bcb('0x45')](handleError(_0x5b550d,null));};exports[_0x0bcb('0x27')]=function(_0x24b4f1,_0xea505d){return db[_0x0bcb('0x42')][_0x0bcb('0x4d')]({'where':{'id':_0x24b4f1[_0x0bcb('0x47')]['id']}})['then'](handleEntityNotFound(_0xea505d,null))['then'](removeEntity(_0xea505d,null))[_0x0bcb('0x45')](handleError(_0xea505d,null));};exports[_0x0bcb('0x4e')]=function(_0x3b33b1,_0x10deeb){return db['SmsQueueReport'][_0x0bcb('0x4e')]()[_0x0bcb('0x44')](respondWithResult(_0x10deeb,null))[_0x0bcb('0x45')](handleError(_0x10deeb,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index dbfeec1..14bd859 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(_0x4ac61a,_0x5e7e88){var _0x5e703e=function(_0x184e6d){while(--_0x184e6d){_0x4ac61a['push'](_0x4ac61a['shift']());}};_0x5e703e(++_0x5e7e88);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3ddabf,_0x2a634f){var _0x27184c=function(_0x26248e){while(--_0x26248e){_0x3ddabf['push'](_0x3ddabf['shift']());}};_0x27184c(++_0x2a634f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb7e7[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index e830bf5..5dadcfa 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 _0xd6b2=['raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsQueueReport','create','body','options'];(function(_0x2adfb1,_0x406e6e){var _0xa52d45=function(_0x2de16c){while(--_0x2de16c){_0x2adfb1['push'](_0x2adfb1['shift']());}};_0xa52d45(++_0x406e6e);}(_0xd6b2,0x116));var _0x2d6b=function(_0x5a2d18,_0x5b72c9){_0x5a2d18=_0x5a2d18-0x0;var _0x5e057f=_0xd6b2[_0x5a2d18];return _0x5e057f;};'use strict';var _=require(_0x2d6b('0x0'));var util=require(_0x2d6b('0x1'));var moment=require(_0x2d6b('0x2'));var BPromise=require(_0x2d6b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d6b('0x4'));var db=require(_0x2d6b('0x5'))['db'];var utils=require(_0x2d6b('0x6'));var logger=require(_0x2d6b('0x7'))(_0x2d6b('0x8'));var config=require(_0x2d6b('0x9'));var jayson=require(_0x2d6b('0xa'));var client=jayson['client'][_0x2d6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4363ed,_0x59a953,_0x51d3fa){return new BPromise(function(_0x4cb1e6,_0x49eba1){return client[_0x2d6b('0xc')](_0x4363ed,_0x51d3fa)[_0x2d6b('0xd')](function(_0x17bbca){logger[_0x2d6b('0xe')](_0x2d6b('0xf'),_0x59a953,_0x2d6b('0x10'));logger[_0x2d6b('0x11')](_0x2d6b('0x12'),_0x59a953,'request\x20sent',JSON[_0x2d6b('0x13')](_0x17bbca));if(_0x17bbca['error']){if(_0x17bbca[_0x2d6b('0x14')]['code']===0x1f4){logger[_0x2d6b('0x14')](_0x2d6b('0xf'),_0x59a953,_0x17bbca[_0x2d6b('0x14')]['message']);return _0x49eba1(_0x17bbca[_0x2d6b('0x14')]['message']);}logger[_0x2d6b('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x59a953,_0x17bbca[_0x2d6b('0x14')][_0x2d6b('0x15')]);return _0x4cb1e6(_0x17bbca[_0x2d6b('0x14')][_0x2d6b('0x15')]);}else{logger['info'](_0x2d6b('0xf'),_0x59a953,'request\x20sent');_0x4cb1e6(_0x17bbca[_0x2d6b('0x16')][_0x2d6b('0x15')]);}})[_0x2d6b('0x17')](function(_0x208c1c){logger[_0x2d6b('0x14')](_0x2d6b('0xf'),_0x59a953,_0x208c1c);_0x49eba1(_0x208c1c);});});}exports['CreateSmsQueueReport']=function(_0x1ad97d){var _0x436bf7=this;return new Promise(function(_0x2ff8ad,_0x3f4155){return db[_0x2d6b('0x18')][_0x2d6b('0x19')](_0x1ad97d[_0x2d6b('0x1a')],{'raw':_0x1ad97d['options']?_0x1ad97d[_0x2d6b('0x1b')][_0x2d6b('0x1c')]===undefined?!![]:![]:!![]})[_0x2d6b('0xd')](function(_0x3f947c){logger['info'](_0x2d6b('0x1d'),_0x1ad97d);logger['debug']('CreateSmsQueueReport',_0x1ad97d,JSON[_0x2d6b('0x13')](_0x3f947c));_0x2ff8ad(_0x3f947c);})['catch'](function(_0x254cb8){logger[_0x2d6b('0x14')]('CreateSmsQueueReport',_0x254cb8[_0x2d6b('0x15')],_0x1ad97d);_0x3f4155(_0x436bf7['error'](0x1f4,_0x254cb8['message']));});});};exports[_0x2d6b('0x1e')]=function(_0x18b5bc){var _0x47a5e1=this;return new Promise(function(_0x3aa54d,_0x212c55){return db[_0x2d6b('0x18')][_0x2d6b('0x1f')](_0x18b5bc[_0x2d6b('0x1a')],{'raw':_0x18b5bc['options']?_0x18b5bc[_0x2d6b('0x1b')][_0x2d6b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b5bc['options']?_0x18b5bc[_0x2d6b('0x1b')][_0x2d6b('0x20')]||null:null,'attributes':_0x18b5bc['options']?_0x18b5bc[_0x2d6b('0x1b')]['attributes']||null:null,'limit':_0x18b5bc[_0x2d6b('0x1b')]?_0x18b5bc[_0x2d6b('0x1b')][_0x2d6b('0x21')]||null:null})[_0x2d6b('0xd')](function(_0x241f63){logger['info'](_0x2d6b('0x1e'),_0x18b5bc);logger[_0x2d6b('0x11')]('UpdateSmsQueueReport',_0x18b5bc,JSON[_0x2d6b('0x13')](_0x241f63));_0x3aa54d(_0x241f63);})[_0x2d6b('0x17')](function(_0x57447d){logger[_0x2d6b('0x14')](_0x2d6b('0x1e'),_0x57447d['message'],_0x18b5bc);_0x212c55(_0x47a5e1[_0x2d6b('0x14')](0x1f4,_0x57447d[_0x2d6b('0x15')]));});});}; \ No newline at end of file +var _0x8d23=['CreateSmsQueueReport','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes','limit','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','create','body','options','raw','then'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x8d23,0x8b));var _0x38d2=function(_0x580b92,_0xbe72a6){_0x580b92=_0x580b92-0x0;var _0x25d964=_0x8d23[_0x580b92];return _0x25d964;};'use strict';var _=require(_0x38d2('0x0'));var util=require('util');var moment=require(_0x38d2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38d2('0x2'));var db=require(_0x38d2('0x3'))['db'];var utils=require(_0x38d2('0x4'));var logger=require(_0x38d2('0x5'))(_0x38d2('0x6'));var config=require(_0x38d2('0x7'));var jayson=require(_0x38d2('0x8'));var client=jayson[_0x38d2('0x9')][_0x38d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1461ce,_0x542f30,_0x942087){return new BPromise(function(_0x55b0af,_0x509e19){return client[_0x38d2('0xb')](_0x1461ce,_0x942087)['then'](function(_0x2f4705){logger[_0x38d2('0xc')](_0x38d2('0xd'),_0x542f30,_0x38d2('0xe'));logger[_0x38d2('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x542f30,'request\x20sent',JSON[_0x38d2('0x10')](_0x2f4705));if(_0x2f4705['error']){if(_0x2f4705[_0x38d2('0x11')][_0x38d2('0x12')]===0x1f4){logger[_0x38d2('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x542f30,_0x2f4705['error']['message']);return _0x509e19(_0x2f4705[_0x38d2('0x11')]['message']);}logger[_0x38d2('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x542f30,_0x2f4705[_0x38d2('0x11')][_0x38d2('0x13')]);return _0x55b0af(_0x2f4705[_0x38d2('0x11')]['message']);}else{logger[_0x38d2('0xc')](_0x38d2('0xd'),_0x542f30,_0x38d2('0xe'));_0x55b0af(_0x2f4705['result']['message']);}})[_0x38d2('0x14')](function(_0x4849ab){logger[_0x38d2('0x11')](_0x38d2('0xd'),_0x542f30,_0x4849ab);_0x509e19(_0x4849ab);});});}exports['CreateSmsQueueReport']=function(_0x16626){var _0x470f93=this;return new Promise(function(_0x862c3,_0x320475){return db['SmsQueueReport'][_0x38d2('0x15')](_0x16626[_0x38d2('0x16')],{'raw':_0x16626['options']?_0x16626[_0x38d2('0x17')][_0x38d2('0x18')]===undefined?!![]:![]:!![]})[_0x38d2('0x19')](function(_0x4ce166){logger[_0x38d2('0xc')](_0x38d2('0x1a'),_0x16626);logger[_0x38d2('0xf')](_0x38d2('0x1a'),_0x16626,JSON[_0x38d2('0x10')](_0x4ce166));_0x862c3(_0x4ce166);})[_0x38d2('0x14')](function(_0x174563){logger['error']('CreateSmsQueueReport',_0x174563[_0x38d2('0x13')],_0x16626);_0x320475(_0x470f93[_0x38d2('0x11')](0x1f4,_0x174563[_0x38d2('0x13')]));});});};exports[_0x38d2('0x1b')]=function(_0x41fbf0){var _0x374280=this;return new Promise(function(_0xab882a,_0x101f00){return db[_0x38d2('0x1c')][_0x38d2('0x1d')](_0x41fbf0[_0x38d2('0x16')],{'raw':_0x41fbf0[_0x38d2('0x17')]?_0x41fbf0['options'][_0x38d2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41fbf0['options']?_0x41fbf0[_0x38d2('0x17')][_0x38d2('0x1e')]||null:null,'attributes':_0x41fbf0['options']?_0x41fbf0[_0x38d2('0x17')][_0x38d2('0x1f')]||null:null,'limit':_0x41fbf0[_0x38d2('0x17')]?_0x41fbf0[_0x38d2('0x17')][_0x38d2('0x20')]||null:null})[_0x38d2('0x19')](function(_0x1aefc0){logger[_0x38d2('0xc')](_0x38d2('0x1b'),_0x41fbf0);logger[_0x38d2('0xf')](_0x38d2('0x1b'),_0x41fbf0,JSON[_0x38d2('0x10')](_0x1aefc0));_0xab882a(_0x1aefc0);})[_0x38d2('0x14')](function(_0x2f9533){logger[_0x38d2('0x11')]('UpdateSmsQueueReport',_0x2f9533[_0x38d2('0x13')],_0x41fbf0);_0x101f00(_0x374280[_0x38d2('0x11')](0x1f4,_0x2f9533[_0x38d2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 2515373..97ddb4a 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 _0xe198=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe198,0x6f));var _0x8e19=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe198[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var fs_extra=require(_0x8e19('0x4'));var auth=require(_0x8e19('0x5'));var interaction=require(_0x8e19('0x6'));var config=require('../../config/environment');var controller=require(_0x8e19('0x7'));router[_0x8e19('0x8')]('/',auth[_0x8e19('0x9')](),controller[_0x8e19('0xa')]);router[_0x8e19('0x8')](_0x8e19('0xb'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xc')]);router[_0x8e19('0x8')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller[_0x8e19('0xe')]);router[_0x8e19('0xf')]('/',auth['isAuthenticated'](),controller[_0x8e19('0x10')]);router[_0x8e19('0x11')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller[_0x8e19('0x12')]);router[_0x8e19('0x13')](_0x8e19('0xd'),auth[_0x8e19('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4006=['path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4006,0x1c7));var _0x6400=function(_0x30942e,_0x5ef683){_0x30942e=_0x30942e-0x0;var _0x4fe670=_0x4006[_0x30942e];return _0x4fe670;};'use strict';var multer=require('multer');var util=require(_0x6400('0x0'));var path=require(_0x6400('0x1'));var timeout=require(_0x6400('0x2'));var express=require(_0x6400('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6400('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6400('0x5'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x6400('0x6')](),controller['index']);router[_0x6400('0x7')](_0x6400('0x8'),auth[_0x6400('0x6')](),controller[_0x6400('0x9')]);router['get'](_0x6400('0xa'),auth[_0x6400('0x6')](),controller[_0x6400('0xb')]);router[_0x6400('0xc')]('/',auth[_0x6400('0x6')](),controller[_0x6400('0xd')]);router[_0x6400('0xe')](_0x6400('0xa'),auth[_0x6400('0x6')](),controller[_0x6400('0xf')]);router[_0x6400('0x10')]('/:id',auth[_0x6400('0x6')](),controller[_0x6400('0x11')]);module[_0x6400('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 3eba117..bda59f0 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4177b8,_0xc83423){_0x4177b8=_0x4177b8-0x0;var _0x2fbf2e=_0x9bde[_0x4177b8];return _0x2fbf2e;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x59df82,_0x4cf8f9){var _0x163c1c=function(_0x1976ea){while(--_0x1976ea){_0x59df82['push'](_0x59df82['shift']());}};_0x163c1c(++_0x4cf8f9);}(_0xedd9,0xfc));var _0x9edd=function(_0x12564a,_0x286a8b){_0x12564a=_0x12564a-0x0;var _0x3d1678=_0xedd9[_0x12564a];return _0x3d1678;};'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 0c19441..81d853d 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 _0xecba=['destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','sendStatus','stack','name','index','SmsTransferReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','find','catch','create','body','params'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xecba,0x94));var _0xaecb=function(_0x2ff505,_0x451e0f){_0x2ff505=_0x2ff505-0x0;var _0x2013ac=_0xecba[_0x2ff505];return _0x2013ac;};'use strict';var emlformat=require(_0xaecb('0x0'));var rimraf=require(_0xaecb('0x1'));var zipdir=require(_0xaecb('0x2'));var jsonpatch=require(_0xaecb('0x3'));var rp=require('request-promise');var moment=require(_0xaecb('0x4'));var BPromise=require(_0xaecb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xaecb('0x6'));var csv=require('to-csv');var ejs=require(_0xaecb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaecb('0x8'));var squel=require(_0xaecb('0x9'));var crypto=require(_0xaecb('0xa'));var jsforce=require(_0xaecb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaecb('0xc'));var querystring=require(_0xaecb('0xd'));var Papa=require('papaparse');var Redis=require(_0xaecb('0xe'));var authService=require(_0xaecb('0xf'));var qs=require(_0xaecb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaecb('0x11'));var logger=require(_0xaecb('0x12'))(_0xaecb('0x13'));var utils=require(_0xaecb('0x14'));var config=require(_0xaecb('0x15'));var licenseUtil=require(_0xaecb('0x16'));var db=require(_0xaecb('0x17'))['db'];function respondWithStatusCode(_0xb17710,_0x4f4506){_0x4f4506=_0x4f4506||0xcc;return function(_0x1da7d0){if(_0x1da7d0){return _0xb17710['sendStatus'](_0x4f4506);}return _0xb17710[_0xaecb('0x18')](_0x4f4506)[_0xaecb('0x19')]();};}function respondWithResult(_0x51d7f7,_0x390463){_0x390463=_0x390463||0xc8;return function(_0x109b06){if(_0x109b06){return _0x51d7f7[_0xaecb('0x18')](_0x390463)[_0xaecb('0x1a')](_0x109b06);}};}function respondWithFilteredResult(_0x4c03ee,_0x190d8e){return function(_0x2b55ca){if(_0x2b55ca){var _0x9ff69b=typeof _0x190d8e['offset']==='undefined'&&typeof _0x190d8e[_0xaecb('0x1b')]===_0xaecb('0x1c');var _0xe91a81=_0x2b55ca[_0xaecb('0x1d')];var _0x3bcd19=_0x9ff69b?0x0:_0x190d8e['offset'];var _0x1cd008=_0x9ff69b?_0x2b55ca['count']:_0x190d8e[_0xaecb('0x1e')]+_0x190d8e[_0xaecb('0x1b')];var _0x46f535;if(_0x1cd008>=_0xe91a81){_0x1cd008=_0xe91a81;_0x46f535=0xc8;}else{_0x46f535=0xce;}_0x4c03ee['status'](_0x46f535);return _0x4c03ee[_0xaecb('0x1f')](_0xaecb('0x20'),_0x3bcd19+'-'+_0x1cd008+'/'+_0xe91a81)['json'](_0x2b55ca);}return null;};}function patchUpdates(_0x409f20){return function(_0x5ee9cb){try{jsonpatch[_0xaecb('0x21')](_0x5ee9cb,_0x409f20,!![]);}catch(_0x350d20){return BPromise['reject'](_0x350d20);}return _0x5ee9cb[_0xaecb('0x22')]();};}function saveUpdates(_0x176f59,_0x2ea3aa){return function(_0x16404b){if(_0x16404b){return _0x16404b[_0xaecb('0x23')](_0x176f59)[_0xaecb('0x24')](function(_0x5d8a50){return _0x5d8a50;});}return null;};}function removeEntity(_0x4f8e53,_0x25f510){return function(_0x103c79){if(_0x103c79){return _0x103c79['destroy']()['then'](function(){_0x4f8e53['status'](0xcc)[_0xaecb('0x19')]();});}};}function handleEntityNotFound(_0x12b102,_0x4d44b4){return function(_0x20f293){if(!_0x20f293){_0x12b102[_0xaecb('0x25')](0x194);}return _0x20f293;};}function handleError(_0x184502,_0x5e75f7){_0x5e75f7=_0x5e75f7||0x1f4;return function(_0x53a411){logger['error'](_0x53a411[_0xaecb('0x26')]);if(_0x53a411[_0xaecb('0x27')]){delete _0x53a411[_0xaecb('0x27')];}_0x184502['status'](_0x5e75f7)['send'](_0x53a411);};}exports[_0xaecb('0x28')]=function(_0x21c412,_0x15a2d0){var _0x53b465={},_0x1133cb={},_0x224e69={'count':0x0,'rows':[]};var _0x40abe3=_['map'](db[_0xaecb('0x29')][_0xaecb('0x2a')],function(_0x15bc23){return{'name':_0x15bc23[_0xaecb('0x2b')],'type':_0x15bc23['type'][_0xaecb('0x2c')]};});_0x1133cb['model']=_[_0xaecb('0x2d')](_0x40abe3,_0xaecb('0x27'));_0x1133cb['query']=_[_0xaecb('0x2e')](_0x21c412[_0xaecb('0x2f')]);_0x1133cb[_0xaecb('0x30')]=_[_0xaecb('0x31')](_0x1133cb[_0xaecb('0x32')],_0x1133cb[_0xaecb('0x2f')]);_0x53b465['attributes']=_['intersection'](_0x1133cb[_0xaecb('0x32')],qs[_0xaecb('0x33')](_0x21c412[_0xaecb('0x2f')]['fields']));_0x53b465[_0xaecb('0x34')]=_0x53b465[_0xaecb('0x34')][_0xaecb('0x35')]?_0x53b465[_0xaecb('0x34')]:_0x1133cb[_0xaecb('0x32')];if(!_0x21c412[_0xaecb('0x2f')][_0xaecb('0x36')]('nolimit')){_0x53b465[_0xaecb('0x1b')]=qs[_0xaecb('0x1b')](_0x21c412[_0xaecb('0x2f')][_0xaecb('0x1b')]);_0x53b465[_0xaecb('0x1e')]=qs[_0xaecb('0x1e')](_0x21c412[_0xaecb('0x2f')]['offset']);}_0x53b465[_0xaecb('0x37')]=qs[_0xaecb('0x38')](_0x21c412['query'][_0xaecb('0x38')]);_0x53b465[_0xaecb('0x39')]=qs[_0xaecb('0x30')](_['pick'](_0x21c412[_0xaecb('0x2f')],_0x1133cb[_0xaecb('0x30')]),_0x40abe3);if(_0x21c412[_0xaecb('0x2f')][_0xaecb('0x3a')]){_0x53b465['where']=_[_0xaecb('0x3b')](_0x53b465[_0xaecb('0x39')],{'$or':_[_0xaecb('0x2d')](_0x40abe3,function(_0x3ffb46){if(_0x3ffb46[_0xaecb('0x3c')]!=='VIRTUAL'){var _0x5d2e23={};_0x5d2e23[_0x3ffb46[_0xaecb('0x27')]]={'$like':'%'+_0x21c412[_0xaecb('0x2f')][_0xaecb('0x3a')]+'%'};return _0x5d2e23;}})});}_0x53b465=_[_0xaecb('0x3b')]({},_0x53b465,_0x21c412[_0xaecb('0x3d')]);var _0x1656cc={'where':_0x53b465['where']};return db[_0xaecb('0x29')][_0xaecb('0x1d')](_0x1656cc)[_0xaecb('0x24')](function(_0x57671d){_0x224e69['count']=_0x57671d;if(_0x21c412[_0xaecb('0x2f')][_0xaecb('0x3e')]){_0x53b465[_0xaecb('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xaecb('0x40')](_0x53b465);})['then'](function(_0x159d12){_0x224e69[_0xaecb('0x41')]=_0x159d12;return _0x224e69;})['then'](respondWithFilteredResult(_0x15a2d0,_0x53b465))['catch'](handleError(_0x15a2d0,null));};exports['show']=function(_0x24650c,_0x1ef012){var _0x477fb6={'raw':!![],'where':{'id':_0x24650c['params']['id']}},_0x37d564={};_0x37d564[_0xaecb('0x32')]=_[_0xaecb('0x2e')](db['SmsTransferReport'][_0xaecb('0x2a')]);_0x37d564[_0xaecb('0x2f')]=_[_0xaecb('0x2e')](_0x24650c[_0xaecb('0x2f')]);_0x37d564[_0xaecb('0x30')]=_[_0xaecb('0x31')](_0x37d564[_0xaecb('0x32')],_0x37d564[_0xaecb('0x2f')]);_0x477fb6[_0xaecb('0x34')]=_[_0xaecb('0x31')](_0x37d564[_0xaecb('0x32')],qs['fields'](_0x24650c[_0xaecb('0x2f')]['fields']));_0x477fb6['attributes']=_0x477fb6['attributes'][_0xaecb('0x35')]?_0x477fb6[_0xaecb('0x34')]:_0x37d564[_0xaecb('0x32')];if(_0x24650c['query']['includeAll']){_0x477fb6[_0xaecb('0x3f')]=[{'all':!![]}];}_0x477fb6=_[_0xaecb('0x3b')]({},_0x477fb6,_0x24650c[_0xaecb('0x3d')]);return db[_0xaecb('0x29')][_0xaecb('0x42')](_0x477fb6)[_0xaecb('0x24')](handleEntityNotFound(_0x1ef012,null))[_0xaecb('0x24')](respondWithResult(_0x1ef012,null))[_0xaecb('0x43')](handleError(_0x1ef012,null));};exports[_0xaecb('0x44')]=function(_0x19642c,_0x1cf426){return db['SmsTransferReport'][_0xaecb('0x44')](_0x19642c[_0xaecb('0x45')],{})[_0xaecb('0x24')](respondWithResult(_0x1cf426,0xc9))[_0xaecb('0x43')](handleError(_0x1cf426,null));};exports[_0xaecb('0x23')]=function(_0x39d6ad,_0x5141f3){if(_0x39d6ad[_0xaecb('0x45')]['id']){delete _0x39d6ad[_0xaecb('0x45')]['id'];}return db[_0xaecb('0x29')][_0xaecb('0x42')]({'where':{'id':_0x39d6ad[_0xaecb('0x46')]['id']}})[_0xaecb('0x24')](handleEntityNotFound(_0x5141f3,null))[_0xaecb('0x24')](saveUpdates(_0x39d6ad[_0xaecb('0x45')],null))['then'](respondWithResult(_0x5141f3,null))[_0xaecb('0x43')](handleError(_0x5141f3,null));};exports[_0xaecb('0x47')]=function(_0x352868,_0x576ffc){return db[_0xaecb('0x29')][_0xaecb('0x42')]({'where':{'id':_0x352868[_0xaecb('0x46')]['id']}})['then'](handleEntityNotFound(_0x576ffc,null))[_0xaecb('0x24')](removeEntity(_0x576ffc,null))[_0xaecb('0x43')](handleError(_0x576ffc,null));};exports['describe']=function(_0x40e829,_0x4bdb0f){return db['SmsTransferReport'][_0xaecb('0x48')]()['then'](respondWithResult(_0x4bdb0f,null))[_0xaecb('0x43')](handleError(_0x4bdb0f,null));}; \ No newline at end of file +var _0x7b8d=['create','describe','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','rows','catch','show','params','options','find'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x7b8d,0x126));var _0xd7b8=function(_0x44afca,_0x58d28b){_0x44afca=_0x44afca-0x0;var _0x380bc4=_0x7b8d[_0x44afca];return _0x380bc4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd7b8('0x0'));var jsonpatch=require(_0xd7b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd7b8('0x2'));var Mustache=require(_0xd7b8('0x3'));var util=require(_0xd7b8('0x4'));var path=require(_0xd7b8('0x5'));var sox=require(_0xd7b8('0x6'));var csv=require(_0xd7b8('0x7'));var ejs=require(_0xd7b8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7b8('0x9'));var squel=require(_0xd7b8('0xa'));var crypto=require(_0xd7b8('0xb'));var jsforce=require(_0xd7b8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd7b8('0x7'));var querystring=require(_0xd7b8('0xd'));var Papa=require(_0xd7b8('0xe'));var Redis=require('ioredis');var authService=require(_0xd7b8('0xf'));var qs=require(_0xd7b8('0x10'));var as=require(_0xd7b8('0x11'));var hardwareService=require(_0xd7b8('0x12'));var logger=require(_0xd7b8('0x13'))(_0xd7b8('0x14'));var utils=require(_0xd7b8('0x15'));var config=require(_0xd7b8('0x16'));var licenseUtil=require(_0xd7b8('0x17'));var db=require(_0xd7b8('0x18'))['db'];function respondWithStatusCode(_0x444ca5,_0x1a0bfc){_0x1a0bfc=_0x1a0bfc||0xcc;return function(_0x1d6fc2){if(_0x1d6fc2){return _0x444ca5[_0xd7b8('0x19')](_0x1a0bfc);}return _0x444ca5[_0xd7b8('0x1a')](_0x1a0bfc)['end']();};}function respondWithResult(_0x19c7d7,_0x2e7ba9){_0x2e7ba9=_0x2e7ba9||0xc8;return function(_0x45fe91){if(_0x45fe91){return _0x19c7d7[_0xd7b8('0x1a')](_0x2e7ba9)[_0xd7b8('0x1b')](_0x45fe91);}};}function respondWithFilteredResult(_0x25a9a9,_0x2aad6f){return function(_0x29aca4){if(_0x29aca4){var _0x131ff7=typeof _0x2aad6f[_0xd7b8('0x1c')]===_0xd7b8('0x1d')&&typeof _0x2aad6f[_0xd7b8('0x1e')]===_0xd7b8('0x1d');var _0x351e1c=_0x29aca4[_0xd7b8('0x1f')];var _0x227190=_0x131ff7?0x0:_0x2aad6f[_0xd7b8('0x1c')];var _0x48bd8b=_0x131ff7?_0x29aca4[_0xd7b8('0x1f')]:_0x2aad6f[_0xd7b8('0x1c')]+_0x2aad6f['limit'];var _0x5d2028;if(_0x48bd8b>=_0x351e1c){_0x48bd8b=_0x351e1c;_0x5d2028=0xc8;}else{_0x5d2028=0xce;}_0x25a9a9[_0xd7b8('0x1a')](_0x5d2028);return _0x25a9a9[_0xd7b8('0x20')](_0xd7b8('0x21'),_0x227190+'-'+_0x48bd8b+'/'+_0x351e1c)[_0xd7b8('0x1b')](_0x29aca4);}return null;};}function patchUpdates(_0x2599e8){return function(_0x33ebb3){try{jsonpatch['apply'](_0x33ebb3,_0x2599e8,!![]);}catch(_0x328154){return BPromise[_0xd7b8('0x22')](_0x328154);}return _0x33ebb3[_0xd7b8('0x23')]();};}function saveUpdates(_0x5a88d0,_0x58023f){return function(_0x9b995b){if(_0x9b995b){return _0x9b995b[_0xd7b8('0x24')](_0x5a88d0)[_0xd7b8('0x25')](function(_0x5326d0){return _0x5326d0;});}return null;};}function removeEntity(_0x32d99e,_0x5c72e9){return function(_0x1d3015){if(_0x1d3015){return _0x1d3015[_0xd7b8('0x26')]()[_0xd7b8('0x25')](function(){_0x32d99e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1abbab,_0x214dba){return function(_0x39e61c){if(!_0x39e61c){_0x1abbab[_0xd7b8('0x19')](0x194);}return _0x39e61c;};}function handleError(_0x52567f,_0x557bf0){_0x557bf0=_0x557bf0||0x1f4;return function(_0x8b37d9){logger['error'](_0x8b37d9[_0xd7b8('0x27')]);if(_0x8b37d9[_0xd7b8('0x28')]){delete _0x8b37d9[_0xd7b8('0x28')];}_0x52567f['status'](_0x557bf0)[_0xd7b8('0x29')](_0x8b37d9);};}exports['index']=function(_0x11f913,_0x44cb47){var _0x126d18={},_0xe81a={},_0x5dc4fe={'count':0x0,'rows':[]};var _0x16e057=_['map'](db[_0xd7b8('0x2a')][_0xd7b8('0x2b')],function(_0x9d5414){return{'name':_0x9d5414[_0xd7b8('0x2c')],'type':_0x9d5414[_0xd7b8('0x2d')]['key']};});_0xe81a[_0xd7b8('0x2e')]=_['map'](_0x16e057,'name');_0xe81a[_0xd7b8('0x2f')]=_[_0xd7b8('0x30')](_0x11f913['query']);_0xe81a[_0xd7b8('0x31')]=_[_0xd7b8('0x32')](_0xe81a['model'],_0xe81a['query']);_0x126d18[_0xd7b8('0x33')]=_[_0xd7b8('0x32')](_0xe81a[_0xd7b8('0x2e')],qs['fields'](_0x11f913['query'][_0xd7b8('0x34')]));_0x126d18[_0xd7b8('0x33')]=_0x126d18[_0xd7b8('0x33')][_0xd7b8('0x35')]?_0x126d18[_0xd7b8('0x33')]:_0xe81a['model'];if(!_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x36')](_0xd7b8('0x37'))){_0x126d18[_0xd7b8('0x1e')]=qs[_0xd7b8('0x1e')](_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x1e')]);_0x126d18[_0xd7b8('0x1c')]=qs[_0xd7b8('0x1c')](_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x1c')]);}_0x126d18[_0xd7b8('0x38')]=qs[_0xd7b8('0x39')](_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x39')]);_0x126d18[_0xd7b8('0x3a')]=qs[_0xd7b8('0x31')](_[_0xd7b8('0x3b')](_0x11f913['query'],_0xe81a[_0xd7b8('0x31')]),_0x16e057);if(_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x3c')]){_0x126d18[_0xd7b8('0x3a')]=_['merge'](_0x126d18[_0xd7b8('0x3a')],{'$or':_[_0xd7b8('0x3d')](_0x16e057,function(_0x578277){if(_0x578277[_0xd7b8('0x2d')]!==_0xd7b8('0x3e')){var _0x191c21={};_0x191c21[_0x578277[_0xd7b8('0x28')]]={'$like':'%'+_0x11f913[_0xd7b8('0x2f')]['filter']+'%'};return _0x191c21;}})});}_0x126d18=_['merge']({},_0x126d18,_0x11f913['options']);var _0x37cefd={'where':_0x126d18['where']};return db['SmsTransferReport'][_0xd7b8('0x1f')](_0x37cefd)['then'](function(_0x3a7f90){_0x5dc4fe[_0xd7b8('0x1f')]=_0x3a7f90;if(_0x11f913[_0xd7b8('0x2f')][_0xd7b8('0x3f')]){_0x126d18[_0xd7b8('0x40')]=[{'all':!![]}];}return db[_0xd7b8('0x2a')]['findAll'](_0x126d18);})[_0xd7b8('0x25')](function(_0x3afa4e){_0x5dc4fe[_0xd7b8('0x41')]=_0x3afa4e;return _0x5dc4fe;})[_0xd7b8('0x25')](respondWithFilteredResult(_0x44cb47,_0x126d18))[_0xd7b8('0x42')](handleError(_0x44cb47,null));};exports[_0xd7b8('0x43')]=function(_0x764478,_0x125c3f){var _0x174970={'raw':!![],'where':{'id':_0x764478[_0xd7b8('0x44')]['id']}},_0x21fbbc={};_0x21fbbc[_0xd7b8('0x2e')]=_[_0xd7b8('0x30')](db['SmsTransferReport']['rawAttributes']);_0x21fbbc['query']=_['keys'](_0x764478[_0xd7b8('0x2f')]);_0x21fbbc[_0xd7b8('0x31')]=_[_0xd7b8('0x32')](_0x21fbbc['model'],_0x21fbbc[_0xd7b8('0x2f')]);_0x174970[_0xd7b8('0x33')]=_[_0xd7b8('0x32')](_0x21fbbc[_0xd7b8('0x2e')],qs[_0xd7b8('0x34')](_0x764478[_0xd7b8('0x2f')]['fields']));_0x174970[_0xd7b8('0x33')]=_0x174970[_0xd7b8('0x33')]['length']?_0x174970[_0xd7b8('0x33')]:_0x21fbbc[_0xd7b8('0x2e')];if(_0x764478['query']['includeAll']){_0x174970[_0xd7b8('0x40')]=[{'all':!![]}];}_0x174970=_['merge']({},_0x174970,_0x764478[_0xd7b8('0x45')]);return db[_0xd7b8('0x2a')][_0xd7b8('0x46')](_0x174970)['then'](handleEntityNotFound(_0x125c3f,null))[_0xd7b8('0x25')](respondWithResult(_0x125c3f,null))[_0xd7b8('0x42')](handleError(_0x125c3f,null));};exports[_0xd7b8('0x47')]=function(_0x1e12af,_0xca9939){return db[_0xd7b8('0x2a')][_0xd7b8('0x47')](_0x1e12af['body'],{})['then'](respondWithResult(_0xca9939,0xc9))['catch'](handleError(_0xca9939,null));};exports[_0xd7b8('0x24')]=function(_0x236e76,_0x3dfec5){if(_0x236e76['body']['id']){delete _0x236e76['body']['id'];}return db[_0xd7b8('0x2a')]['find']({'where':{'id':_0x236e76['params']['id']}})['then'](handleEntityNotFound(_0x3dfec5,null))[_0xd7b8('0x25')](saveUpdates(_0x236e76['body'],null))[_0xd7b8('0x25')](respondWithResult(_0x3dfec5,null))[_0xd7b8('0x42')](handleError(_0x3dfec5,null));};exports[_0xd7b8('0x26')]=function(_0x2b23a6,_0x2c7480){return db['SmsTransferReport'][_0xd7b8('0x46')]({'where':{'id':_0x2b23a6[_0xd7b8('0x44')]['id']}})[_0xd7b8('0x25')](handleEntityNotFound(_0x2c7480,null))['then'](removeEntity(_0x2c7480,null))[_0xd7b8('0x42')](handleError(_0x2c7480,null));};exports[_0xd7b8('0x48')]=function(_0x4a71ef,_0x5dddce){return db['SmsTransferReport'][_0xd7b8('0x48')]()['then'](respondWithResult(_0x5dddce,null))[_0xd7b8('0x42')](handleError(_0x5dddce,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6939ae6..8796e38 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 _0xa952=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid'];(function(_0x21dea0,_0xa7bb96){var _0x40b721=function(_0x23e59a){while(--_0x23e59a){_0x21dea0['push'](_0x21dea0['shift']());}};_0x40b721(++_0xa7bb96);}(_0xa952,0x1b2));var _0x2a95=function(_0x31bd16,_0x494d75){_0x31bd16=_0x31bd16-0x0;var _0xe24a51=_0xa952[_0x31bd16];return _0xe24a51;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var logger=require(_0x2a95('0x2'))(_0x2a95('0x3'));var moment=require(_0x2a95('0x4'));var BPromise=require(_0x2a95('0x5'));var rp=require(_0x2a95('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a95('0x7'));var config=require(_0x2a95('0x8'));var attributes=require(_0x2a95('0x9'));module[_0x2a95('0xa')]=function(_0x53c54f,_0x153806){return _0x53c54f[_0x2a95('0xb')](_0x2a95('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x2a95('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x01e8=['lodash','util','../../config/logger','moment','request-promise','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid'];(function(_0x2412ea,_0x11a2d1){var _0xdb290a=function(_0xb980fb){while(--_0xb980fb){_0x2412ea['push'](_0x2412ea['shift']());}};_0xdb290a(++_0x11a2d1);}(_0x01e8,0x6e));var _0x801e=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x01e8[_0x1c156e];return _0x58fc22;};'use strict';var _=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var logger=require(_0x801e('0x2'))('api');var moment=require(_0x801e('0x3'));var BPromise=require('bluebird');var rp=require(_0x801e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x801e('0x5'));var config=require('../../config/environment');var attributes=require(_0x801e('0x6'));module[_0x801e('0x7')]=function(_0x4994df,_0x2d4898){return _0x4994df[_0x801e('0x8')](_0x801e('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x801e('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 3c6e786..82a7caa 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 _0x394e=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ac8c2,_0x2e68a2){var _0x4942b8=function(_0xad1b5b){while(--_0xad1b5b){_0x1ac8c2['push'](_0x1ac8c2['shift']());}};_0x4942b8(++_0x2e68a2);}(_0x394e,0x88));var _0xe394=function(_0x2de9c0,_0x2ae1f2){_0x2de9c0=_0x2de9c0-0x0;var _0x1c4daa=_0x394e[_0x2de9c0];return _0x1c4daa;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var moment=require('moment');var BPromise=require(_0xe394('0x2'));var rs=require(_0xe394('0x3'));var fs=require('fs');var Redis=require(_0xe394('0x4'));var db=require(_0xe394('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe394('0x6'))(_0xe394('0x7'));var config=require(_0xe394('0x8'));var jayson=require(_0xe394('0x9'));var client=jayson[_0xe394('0xa')][_0xe394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x337bff,_0x169910,_0xad826e){return new BPromise(function(_0x267d68,_0x1220a2){return client['request'](_0x337bff,_0xad826e)['then'](function(_0x5962d2){logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,_0xe394('0xe'));logger[_0xe394('0xf')](_0xe394('0x10'),_0x169910,_0xe394('0xe'),JSON[_0xe394('0x11')](_0x5962d2));if(_0x5962d2[_0xe394('0x12')]){if(_0x5962d2[_0xe394('0x12')][_0xe394('0x13')]===0x1f4){logger[_0xe394('0x12')](_0xe394('0xd'),_0x169910,_0x5962d2['error']['message']);return _0x1220a2(_0x5962d2['error'][_0xe394('0x14')]);}logger[_0xe394('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x169910,_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);return _0x267d68(_0x5962d2[_0xe394('0x12')][_0xe394('0x14')]);}else{logger[_0xe394('0xc')](_0xe394('0xd'),_0x169910,'request\x20sent');_0x267d68(_0x5962d2['result'][_0xe394('0x14')]);}})[_0xe394('0x15')](function(_0x3f11e7){logger[_0xe394('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x169910,_0x3f11e7);_0x1220a2(_0x3f11e7);});});} \ No newline at end of file +var _0x1b94=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util'];(function(_0x8a2e9d,_0xa7a01c){var _0xf64cdd=function(_0x491bd2){while(--_0x491bd2){_0x8a2e9d['push'](_0x8a2e9d['shift']());}};_0xf64cdd(++_0xa7a01c);}(_0x1b94,0x1f2));var _0x41b9=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x1b94[_0x616290];return _0x453879;};'use strict';var _=require(_0x41b9('0x0'));var util=require(_0x41b9('0x1'));var moment=require(_0x41b9('0x2'));var BPromise=require(_0x41b9('0x3'));var rs=require(_0x41b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41b9('0x5'))['db'];var utils=require(_0x41b9('0x6'));var logger=require(_0x41b9('0x7'))('rpc');var config=require(_0x41b9('0x8'));var jayson=require(_0x41b9('0x9'));var client=jayson[_0x41b9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x310fd8,_0x3e9325,_0x2a0eed){return new BPromise(function(_0x37b187,_0x1cb1d6){return client['request'](_0x310fd8,_0x2a0eed)[_0x41b9('0xb')](function(_0x23d89b){logger['info'](_0x41b9('0xc'),_0x3e9325,_0x41b9('0xd'));logger['debug'](_0x41b9('0xe'),_0x3e9325,_0x41b9('0xd'),JSON['stringify'](_0x23d89b));if(_0x23d89b[_0x41b9('0xf')]){if(_0x23d89b['error'][_0x41b9('0x10')]===0x1f4){logger['error'](_0x41b9('0xc'),_0x3e9325,_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);return _0x1cb1d6(_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);}logger['error'](_0x41b9('0xc'),_0x3e9325,_0x23d89b[_0x41b9('0xf')]['message']);return _0x37b187(_0x23d89b[_0x41b9('0xf')][_0x41b9('0x11')]);}else{logger[_0x41b9('0x12')](_0x41b9('0xc'),_0x3e9325,'request\x20sent');_0x37b187(_0x23d89b['result']['message']);}})[_0x41b9('0x13')](function(_0x432cd7){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x3e9325,_0x432cd7);_0x1cb1d6(_0x432cd7);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 993e0ae..b2e5ca7 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 _0xab0f=['replace','format','basename','now','extname','single','create','put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','originalname'];(function(_0x114180,_0x48a3c2){var _0x932c84=function(_0x5174e2){while(--_0x5174e2){_0x114180['push'](_0x114180['shift']());}};_0x932c84(++_0x48a3c2);}(_0xab0f,0x7e));var _0xfab0=function(_0x375d33,_0x326f0b){_0x375d33=_0x375d33-0x0;var _0x3ca04a=_0xab0f[_0x375d33];return _0x3ca04a;};'use strict';var multer=require(_0xfab0('0x0'));var util=require(_0xfab0('0x1'));var path=require('path');var timeout=require(_0xfab0('0x2'));var express=require(_0xfab0('0x3'));var router=express[_0xfab0('0x4')]();var fs_extra=require(_0xfab0('0x5'));var auth=require(_0xfab0('0x6'));var interaction=require(_0xfab0('0x7'));var config=require(_0xfab0('0x8'));var controller=require('./sound.controller');router[_0xfab0('0x9')]('/',auth[_0xfab0('0xa')](),controller['index']);router['get'](_0xfab0('0xb'),auth['isAuthenticated'](),controller[_0xfab0('0xc')]);router[_0xfab0('0x9')](_0xfab0('0xd'),auth['isAuthenticated'](),controller[_0xfab0('0xe')]);var upload=multer({'storage':multer[_0xfab0('0xf')]({'destination':function(_0x347d39,_0x2e063c,_0x116a31){_0x116a31(null,path[_0xfab0('0x10')](config[_0xfab0('0x11')],'server/files/sounds/original/'));},'filename':function(_0x48c84a,_0x1624ee,_0xade9c7){_0x1624ee[_0xfab0('0x12')]=_0x1624ee[_0xfab0('0x12')][_0xfab0('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xade9c7(null,util[_0xfab0('0x14')]('%s-%s%s',path[_0xfab0('0x15')](_0x1624ee[_0xfab0('0x12')],path['extname'](_0x1624ee[_0xfab0('0x12')])),Date[_0xfab0('0x16')](),path[_0xfab0('0x17')](_0x1624ee['originalname'])));}})});router['post']('/',upload[_0xfab0('0x18')]('file'),controller[_0xfab0('0x19')]);router[_0xfab0('0x1a')](_0xfab0('0xb'),auth[_0xfab0('0xa')](),controller['update']);router[_0xfab0('0x1b')]('/:id',auth[_0xfab0('0xa')](),controller[_0xfab0('0x1b')]);module[_0xfab0('0x1c')]=router; \ No newline at end of file +var _0xa0eb=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','index','get','/:id','isAuthenticated','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','format','%s-%s%s','now','post','file','create','put','update','delete'];(function(_0x3d61c6,_0x4571e6){var _0x47e0df=function(_0x25adfd){while(--_0x25adfd){_0x3d61c6['push'](_0x3d61c6['shift']());}};_0x47e0df(++_0x4571e6);}(_0xa0eb,0x1b3));var _0xba0e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa0eb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xba0e('0x0'));var util=require(_0xba0e('0x1'));var path=require(_0xba0e('0x2'));var timeout=require(_0xba0e('0x3'));var express=require(_0xba0e('0x4'));var router=express[_0xba0e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba0e('0x6'));var interaction=require(_0xba0e('0x7'));var config=require(_0xba0e('0x8'));var controller=require(_0xba0e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xba0e('0xa')]);router[_0xba0e('0xb')](_0xba0e('0xc'),auth[_0xba0e('0xd')](),controller['show']);router['get'](_0xba0e('0xe'),auth[_0xba0e('0xd')](),controller[_0xba0e('0xf')]);var upload=multer({'storage':multer[_0xba0e('0x10')]({'destination':function(_0x3dc0e1,_0x29bf49,_0x2ba4a4){_0x2ba4a4(null,path['join'](config[_0xba0e('0x11')],_0xba0e('0x12')));},'filename':function(_0x22d5ed,_0x517713,_0x2c0088){_0x517713[_0xba0e('0x13')]=_0x517713[_0xba0e('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2c0088(null,util[_0xba0e('0x14')](_0xba0e('0x15'),path['basename'](_0x517713['originalname'],path['extname'](_0x517713[_0xba0e('0x13')])),Date[_0xba0e('0x16')](),path['extname'](_0x517713[_0xba0e('0x13')])));}})});router[_0xba0e('0x17')]('/',upload['single'](_0xba0e('0x18')),controller[_0xba0e('0x19')]);router[_0xba0e('0x1a')](_0xba0e('0xc'),auth[_0xba0e('0xd')](),controller[_0xba0e('0x1b')]);router[_0xba0e('0x1c')](_0xba0e('0xc'),auth[_0xba0e('0xd')](),controller[_0xba0e('0x1c')]);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 893c3f0..67b58e0 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 _0x39c6=['sequelize','STRING','FLOAT','INTEGER'];(function(_0x5be67d,_0x22bc72){var _0x455675=function(_0x159b66){while(--_0x159b66){_0x5be67d['push'](_0x5be67d['shift']());}};_0x455675(++_0x22bc72);}(_0x39c6,0x1c0));var _0x639c=function(_0x84ade9,_0x2c0fdf){_0x84ade9=_0x84ade9-0x0;var _0xdb6bc0=_0x39c6[_0x84ade9];return _0xdb6bc0;};'use strict';var Sequelize=require(_0x639c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x639c('0x1')]},'display_name':{'type':Sequelize[_0x639c('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x639c('0x1')]},'original_format':{'type':Sequelize[_0x639c('0x1')]},'original_duration':{'type':Sequelize[_0x639c('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x639c('0x3')]},'converted_format':{'type':Sequelize[_0x639c('0x1')]},'converted_duration':{'type':Sequelize[_0x639c('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x639c('0x3')]}}; \ No newline at end of file +var _0x9282=['BIGINT','exports','name','STRING','FLOAT','INTEGER'];(function(_0x4499cf,_0xe955f6){var _0x350713=function(_0xb7fedb){while(--_0xb7fedb){_0x4499cf['push'](_0x4499cf['shift']());}};_0x350713(++_0xe955f6);}(_0x9282,0x1f3));var _0x2928=function(_0x127ed7,_0x18c2c5){_0x127ed7=_0x127ed7-0x0;var _0x17c7bb=_0x9282[_0x127ed7];return _0x17c7bb;};'use strict';var Sequelize=require('sequelize');module[_0x2928('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2928('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2928('0x2')]},'display_name':{'type':Sequelize[_0x2928('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x2928('0x2')]},'original_duration':{'type':Sequelize[_0x2928('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x2928('0x4')]},'original_bitRate':{'type':Sequelize[_0x2928('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x2928('0x2')]},'converted_duration':{'type':Sequelize[_0x2928('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x2928('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x2928('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 7d1a9bc..9c4d3f0 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 _0x9ea6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','UserProfileResource','update','description','delete','original_format','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','Sounds','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','join','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','sampleRate','body','role','userProfileId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9ea6,0x103));var _0x69ea=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9ea6[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x69ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69ea('0x1'));var jsonpatch=require(_0x69ea('0x2'));var rp=require(_0x69ea('0x3'));var moment=require(_0x69ea('0x4'));var BPromise=require(_0x69ea('0x5'));var Mustache=require(_0x69ea('0x6'));var util=require(_0x69ea('0x7'));var path=require(_0x69ea('0x8'));var sox=require(_0x69ea('0x9'));var csv=require(_0x69ea('0xa'));var ejs=require(_0x69ea('0xb'));var fs=require('fs');var fs_extra=require(_0x69ea('0xc'));var _=require(_0x69ea('0xd'));var squel=require(_0x69ea('0xe'));var crypto=require(_0x69ea('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x69ea('0x10'));var toCsv=require(_0x69ea('0xa'));var querystring=require('querystring');var Papa=require(_0x69ea('0x11'));var Redis=require(_0x69ea('0x12'));var authService=require(_0x69ea('0x13'));var qs=require(_0x69ea('0x14'));var as=require(_0x69ea('0x15'));var hardwareService=require(_0x69ea('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x69ea('0x17'));var config=require(_0x69ea('0x18'));var licenseUtil=require(_0x69ea('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x234328,_0x32f65e){_0x32f65e=_0x32f65e||0xcc;return function(_0x7b7760){if(_0x7b7760){return _0x234328[_0x69ea('0x1a')](_0x32f65e);}return _0x234328[_0x69ea('0x1b')](_0x32f65e)[_0x69ea('0x1c')]();};}function respondWithResult(_0x41aa5a,_0x3492d7){_0x3492d7=_0x3492d7||0xc8;return function(_0x38bd5a){if(_0x38bd5a){return _0x41aa5a[_0x69ea('0x1b')](_0x3492d7)[_0x69ea('0x1d')](_0x38bd5a);}};}function respondWithFilteredResult(_0x309e1c,_0x1bcc45){return function(_0x2770b8){if(_0x2770b8){var _0xb214ca=typeof _0x1bcc45[_0x69ea('0x1e')]===_0x69ea('0x1f')&&typeof _0x1bcc45[_0x69ea('0x20')]===_0x69ea('0x1f');var _0x506f05=_0x2770b8[_0x69ea('0x21')];var _0x3fd6c1=_0xb214ca?0x0:_0x1bcc45[_0x69ea('0x1e')];var _0xc6959c=_0xb214ca?_0x2770b8[_0x69ea('0x21')]:_0x1bcc45[_0x69ea('0x1e')]+_0x1bcc45[_0x69ea('0x20')];var _0x7274ef;if(_0xc6959c>=_0x506f05){_0xc6959c=_0x506f05;_0x7274ef=0xc8;}else{_0x7274ef=0xce;}_0x309e1c['status'](_0x7274ef);return _0x309e1c[_0x69ea('0x22')]('Content-Range',_0x3fd6c1+'-'+_0xc6959c+'/'+_0x506f05)['json'](_0x2770b8);}return null;};}function patchUpdates(_0x374c42){return function(_0x588af7){try{jsonpatch[_0x69ea('0x23')](_0x588af7,_0x374c42,!![]);}catch(_0x1e1a33){return BPromise[_0x69ea('0x24')](_0x1e1a33);}return _0x588af7['save']();};}function saveUpdates(_0x31eaba,_0x21bf65){return function(_0x3cc577){if(_0x3cc577){return _0x3cc577['update'](_0x31eaba)['then'](function(_0x5bedb3){return _0x5bedb3;});}return null;};}function removeEntity(_0x4e85ca,_0x4ad30b){return function(_0x7f734a){if(_0x7f734a){return _0x7f734a[_0x69ea('0x25')]()[_0x69ea('0x26')](function(){var _0x40bb21=_0x7f734a['get']({'plain':!![]});var _0x1c2d65=_0x69ea('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c2d65,'resourceId':_0x40bb21['id']}})['then'](function(){return _0x7f734a;});})['then'](function(){_0x4e85ca[_0x69ea('0x1b')](0xcc)[_0x69ea('0x1c')]();});}};}function handleEntityNotFound(_0x3deefc,_0x14d9ad){return function(_0x4843df){if(!_0x4843df){_0x3deefc['sendStatus'](0x194);}return _0x4843df;};}function handleError(_0x129c97,_0x2f2b85){_0x2f2b85=_0x2f2b85||0x1f4;return function(_0x2bfd36){logger[_0x69ea('0x28')](_0x2bfd36[_0x69ea('0x29')]);if(_0x2bfd36['name']){delete _0x2bfd36[_0x69ea('0x2a')];}_0x129c97[_0x69ea('0x1b')](_0x2f2b85)[_0x69ea('0x2b')](_0x2bfd36);};}exports[_0x69ea('0x2c')]=function(_0x4ae3bd,_0x4e248c){var _0x115fa5={},_0x4c1b3f={},_0xf08df8={'count':0x0,'rows':[]};var _0x30be2e=_[_0x69ea('0x2d')](db[_0x69ea('0x2e')][_0x69ea('0x2f')],function(_0x130ba0){return{'name':_0x130ba0[_0x69ea('0x30')],'type':_0x130ba0[_0x69ea('0x31')][_0x69ea('0x32')]};});_0x4c1b3f[_0x69ea('0x33')]=_[_0x69ea('0x2d')](_0x30be2e,_0x69ea('0x2a'));_0x4c1b3f[_0x69ea('0x34')]=_['keys'](_0x4ae3bd['query']);_0x4c1b3f[_0x69ea('0x35')]=_[_0x69ea('0x36')](_0x4c1b3f[_0x69ea('0x33')],_0x4c1b3f[_0x69ea('0x34')]);_0x115fa5[_0x69ea('0x37')]=_[_0x69ea('0x36')](_0x4c1b3f[_0x69ea('0x33')],qs[_0x69ea('0x38')](_0x4ae3bd['query']['fields']));_0x115fa5['attributes']=_0x115fa5[_0x69ea('0x37')]['length']?_0x115fa5['attributes']:_0x4c1b3f[_0x69ea('0x33')];if(!_0x4ae3bd[_0x69ea('0x34')]['hasOwnProperty'](_0x69ea('0x39'))){_0x115fa5[_0x69ea('0x20')]=qs[_0x69ea('0x20')](_0x4ae3bd['query']['limit']);_0x115fa5[_0x69ea('0x1e')]=qs[_0x69ea('0x1e')](_0x4ae3bd['query']['offset']);}_0x115fa5[_0x69ea('0x3a')]=qs[_0x69ea('0x3b')](_0x4ae3bd[_0x69ea('0x34')][_0x69ea('0x3b')]);_0x115fa5[_0x69ea('0x3c')]=qs['filters'](_[_0x69ea('0x3d')](_0x4ae3bd[_0x69ea('0x34')],_0x4c1b3f[_0x69ea('0x35')]),_0x30be2e);if(_0x4ae3bd[_0x69ea('0x34')][_0x69ea('0x3e')]){_0x115fa5[_0x69ea('0x3c')]=_[_0x69ea('0x3f')](_0x115fa5[_0x69ea('0x3c')],{'$or':_[_0x69ea('0x2d')](_0x30be2e,function(_0x306d5b){if(_0x306d5b[_0x69ea('0x31')]!=='VIRTUAL'){var _0x37036a={};_0x37036a[_0x306d5b[_0x69ea('0x2a')]]={'$like':'%'+_0x4ae3bd[_0x69ea('0x34')]['filter']+'%'};return _0x37036a;}})});}_0x115fa5=_[_0x69ea('0x3f')]({},_0x115fa5,_0x4ae3bd[_0x69ea('0x40')]);var _0x2d2f80={'where':_0x115fa5[_0x69ea('0x3c')]};return db[_0x69ea('0x2e')][_0x69ea('0x21')](_0x2d2f80)[_0x69ea('0x26')](function(_0x31fc19){_0xf08df8[_0x69ea('0x21')]=_0x31fc19;if(_0x4ae3bd[_0x69ea('0x34')][_0x69ea('0x41')]){_0x115fa5['include']=[{'all':!![]}];}return db[_0x69ea('0x2e')][_0x69ea('0x42')](_0x115fa5);})[_0x69ea('0x26')](function(_0x4af9fd){_0xf08df8[_0x69ea('0x43')]=_0x4af9fd;return _0xf08df8;})[_0x69ea('0x26')](respondWithFilteredResult(_0x4e248c,_0x115fa5))[_0x69ea('0x44')](handleError(_0x4e248c,null));};exports[_0x69ea('0x45')]=function(_0x5c1d8b,_0x67933f){var _0xdf1542={'raw':!![],'where':{'id':_0x5c1d8b[_0x69ea('0x46')]['id']}},_0x54c104={};_0x54c104[_0x69ea('0x33')]=_[_0x69ea('0x47')](db[_0x69ea('0x2e')]['rawAttributes']);_0x54c104[_0x69ea('0x34')]=_[_0x69ea('0x47')](_0x5c1d8b['query']);_0x54c104[_0x69ea('0x35')]=_[_0x69ea('0x36')](_0x54c104[_0x69ea('0x33')],_0x54c104['query']);_0xdf1542['attributes']=_[_0x69ea('0x36')](_0x54c104[_0x69ea('0x33')],qs[_0x69ea('0x38')](_0x5c1d8b[_0x69ea('0x34')][_0x69ea('0x38')]));_0xdf1542[_0x69ea('0x37')]=_0xdf1542[_0x69ea('0x37')]['length']?_0xdf1542[_0x69ea('0x37')]:_0x54c104[_0x69ea('0x33')];if(_0x5c1d8b[_0x69ea('0x34')][_0x69ea('0x41')]){_0xdf1542['include']=[{'all':!![]}];}_0xdf1542=_[_0x69ea('0x3f')]({},_0xdf1542,_0x5c1d8b[_0x69ea('0x40')]);return db[_0x69ea('0x2e')][_0x69ea('0x48')](_0xdf1542)[_0x69ea('0x26')](handleEntityNotFound(_0x67933f,null))['then'](respondWithResult(_0x67933f,null))['catch'](handleError(_0x67933f,null));};exports[_0x69ea('0x49')]=function(_0xa9d5e7,_0x1f6949,_0x17a2fe){return db['Sound'][_0x69ea('0x48')]({'where':{'id':_0xa9d5e7[_0x69ea('0x46')]['id']},'attributes':[_0x69ea('0x2a'),_0x69ea('0x4a'),_0x69ea('0x4b')],'raw':!![]})[_0x69ea('0x26')](handleEntityNotFound(_0x1f6949,null))['then'](function(_0x330d64){if(_0x330d64){if(!fs[_0x69ea('0x4c')](path['join'](config[_0x69ea('0x4d')],_0x69ea('0x4e'),_0x330d64[_0x69ea('0x4a')]+'.'+_0x330d64['converted_format']))){throw new db[(_0x69ea('0x4f'))][(_0x69ea('0x50'))]('Sound\x20not\x20found');}return _0x1f6949[_0x69ea('0x49')](path['join'](config['root'],_0x69ea('0x4e'),util[_0x69ea('0x51')]('%s.%s',_0x330d64[_0x69ea('0x4a')],_0x330d64[_0x69ea('0x4b')])),util[_0x69ea('0x51')](_0x69ea('0x52'),_0x330d64[_0x69ea('0x2a')],_0x330d64[_0x69ea('0x4b')]));}return null;})[_0x69ea('0x44')](handleError(_0x1f6949,null));};exports[_0x69ea('0x53')]=function(_0x301bc1,_0x476e54,_0xfb14f4){var _0x1f4112={'name':path['basename'](_0x301bc1[_0x69ea('0x54')][_0x69ea('0x55')],path[_0x69ea('0x56')](_0x301bc1[_0x69ea('0x54')]['originalname'])),'save_name':path[_0x69ea('0x57')](_0x301bc1[_0x69ea('0x54')][_0x69ea('0x58')],path['extname'](_0x301bc1['file'][_0x69ea('0x58')])),'original_format':path[_0x69ea('0x56')](_0x301bc1[_0x69ea('0x54')][_0x69ea('0x55')])[_0x69ea('0x59')](0x1),'converted_format':_0x69ea('0x5a')};var _0x25c442=path['join'](config['root'],_0x69ea('0x5b'),_0x301bc1['file'][_0x69ea('0x58')]);var _0x2627d0=path[_0x69ea('0x5c')](config[_0x69ea('0x4d')],_0x69ea('0x4e'),util[_0x69ea('0x51')](_0x69ea('0x52'),path[_0x69ea('0x57')](_0x301bc1[_0x69ea('0x54')][_0x69ea('0x58')],path[_0x69ea('0x56')](_0x301bc1[_0x69ea('0x54')][_0x69ea('0x58')])),_0x1f4112[_0x69ea('0x4b')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x25c442);logger[_0x69ea('0x5d')](_0x69ea('0x5e'),_0x2627d0);try{fs[_0x69ea('0x5f')](_0x25c442,parseInt(_0x69ea('0x60'),0x8));var _0x397d5a=sox[_0x69ea('0x61')](_0x25c442,_0x2627d0,{'sampleRate':0x1f40,'format':_0x69ea('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x397d5a['on'](_0x69ea('0x28'),function(_0x4d8406){fs[_0x69ea('0x62')](_0x25c442);_0x476e54['status'](0x1f4)['send'](_0x4d8406);});_0x397d5a['on'](_0x69ea('0x63'),function(_0x4f06f9){_0x1f4112[_0x69ea('0x64')]=isNaN(_0x4f06f9['duration'])?null:_0x4f06f9['duration']*0x3e8;_0x1f4112['original_sampleCount']=isNaN(_0x4f06f9[_0x69ea('0x65')])?null:_0x4f06f9[_0x69ea('0x65')];_0x1f4112[_0x69ea('0x66')]=isNaN(_0x4f06f9[_0x69ea('0x67')])?null:_0x4f06f9['channelCount'];_0x1f4112[_0x69ea('0x68')]=isNaN(_0x4f06f9[_0x69ea('0x69')])?null:_0x4f06f9[_0x69ea('0x69')];_0x1f4112[_0x69ea('0x6a')]=isNaN(_0x4f06f9['sampleRate'])?null:_0x4f06f9['sampleRate'];});_0x397d5a['on'](_0x69ea('0x6b'),function(_0x2655ed){_0x1f4112[_0x69ea('0x6c')]=isNaN(_0x2655ed[_0x69ea('0x6d')])?null:_0x2655ed[_0x69ea('0x6d')]*0x3e8;_0x1f4112[_0x69ea('0x6e')]=isNaN(_0x2655ed[_0x69ea('0x65')])?null:_0x2655ed[_0x69ea('0x65')];_0x1f4112[_0x69ea('0x6f')]=isNaN(_0x2655ed[_0x69ea('0x67')])?null:_0x2655ed[_0x69ea('0x67')];_0x1f4112['converted_bitRate']=isNaN(_0x2655ed['bitRate'])?null:_0x2655ed['bitRate'];_0x1f4112['converted_sampleRate']=isNaN(_0x2655ed[_0x69ea('0x70')])?null:_0x2655ed[_0x69ea('0x70')];});_0x397d5a['on'](_0x69ea('0x1c'),function(){fs['chmodSync'](_0x2627d0,parseInt('0777',0x8));return db[_0x69ea('0x2e')][_0x69ea('0x53')](_0x1f4112)['then'](function(_0x3c7ccb){var _0x2bb021={'role':_0x301bc1[_0x69ea('0x71')][_0x69ea('0x72')],'userProfileId':_0x301bc1[_0x69ea('0x71')][_0x69ea('0x73')]};if(!_0x2bb021)throw new Error(_0x69ea('0x74'));if(_0x2bb021[_0x69ea('0x72')]===_0x69ea('0x75')){var _0xa6ae9=_0x3c7ccb[_0x69ea('0x76')]({'plain':!![]});return db[_0x69ea('0x77')][_0x69ea('0x48')]({'where':{'name':_0x69ea('0x27'),'userProfileId':_0x2bb021[_0x69ea('0x73')]},'raw':!![]})[_0x69ea('0x26')](function(_0x141fbc){if(_0x141fbc&&_0x141fbc['autoAssociation']===0x0){return db[_0x69ea('0x78')][_0x69ea('0x53')]({'name':_0xa6ae9['name'],'resourceId':_0xa6ae9['id'],'type':_0x141fbc[_0x69ea('0x2a')],'sectionId':_0x141fbc['id']},{})[_0x69ea('0x26')](function(){return _0x3c7ccb;});}else{return _0x3c7ccb;}})['catch'](function(_0x52b29e){logger[_0x69ea('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52b29e);throw _0x52b29e;});}return _0x3c7ccb;})['then'](respondWithResult(_0x476e54,null))['catch'](handleError(_0x476e54,null));});_0x397d5a['start']();}catch(_0x571e44){_0x476e54[_0x69ea('0x1b')](0x1f4)[_0x69ea('0x2b')](_0x571e44);}};exports[_0x69ea('0x79')]=function(_0x67beb1,_0x2e46d0,_0x290289){return db['Sound'][_0x69ea('0x48')]({'where':{'id':_0x67beb1['params']['id']}})[_0x69ea('0x26')](handleEntityNotFound(_0x2e46d0,null))[_0x69ea('0x26')](saveUpdates(_[_0x69ea('0x3d')](_0x67beb1[_0x69ea('0x71')],[_0x69ea('0x2a'),_0x69ea('0x7a')]),null))[_0x69ea('0x26')](respondWithResult(_0x2e46d0,null))[_0x69ea('0x44')](handleError(_0x2e46d0,null));};exports[_0x69ea('0x7b')]=function(_0x3f5b7f,_0x436c68,_0xe5ebc8){return db[_0x69ea('0x2e')]['find']({'where':{'id':_0x3f5b7f['params']['id']}})[_0x69ea('0x26')](function(_0x23a459){if(_0x23a459){return _0x23a459['destroy']();}})[_0x69ea('0x26')](function(_0x556613){var _0x3977e9=path[_0x69ea('0x5c')](config[_0x69ea('0x4d')],_0x69ea('0x5b'),util[_0x69ea('0x51')](_0x69ea('0x52'),_0x556613[_0x69ea('0x4a')],_0x556613[_0x69ea('0x7c')]));var _0x1bfc08=path[_0x69ea('0x5c')](config['root'],_0x69ea('0x4e'),util[_0x69ea('0x51')]('%s.%s',_0x556613[_0x69ea('0x4a')],_0x556613['converted_format']));fs['unlinkSync'](_0x3977e9);fs['unlinkSync'](_0x1bfc08);return _0x556613;})[_0x69ea('0x26')](function(_0x31198c){if(_0x31198c){return _0x436c68[_0x69ea('0x1b')](0xcc)[_0x69ea('0x1c')]();}})['then'](handleEntityNotFound(_0x436c68,null))[_0x69ea('0x44')](handleError(_0x436c68,null));}; \ No newline at end of file +var _0xda7d=['includeAll','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','info','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','duration','converted_sampleCount','converted_channelCount','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','zip-dir','fast-json-patch','request-promise','bluebird','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Sounds','error','stack','name','send','map','Sound','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','include','findAll','rows','catch','show','params','keys'];(function(_0x23426d,_0x2575cd){var _0x4f98dc=function(_0xadeb08){while(--_0xadeb08){_0x23426d['push'](_0x23426d['shift']());}};_0x4f98dc(++_0x2575cd);}(_0xda7d,0xaf));var _0xdda7=function(_0x34efa6,_0x343fe2){_0x34efa6=_0x34efa6-0x0;var _0x469490=_0xda7d[_0x34efa6];return _0x469490;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdda7('0x0'));var jsonpatch=require(_0xdda7('0x1'));var rp=require(_0xdda7('0x2'));var moment=require('moment');var BPromise=require(_0xdda7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdda7('0x4'));var sox=require(_0xdda7('0x5'));var csv=require(_0xdda7('0x6'));var ejs=require(_0xdda7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdda7('0x8'));var squel=require(_0xdda7('0x9'));var crypto=require(_0xdda7('0xa'));var jsforce=require(_0xdda7('0xb'));var deskjs=require(_0xdda7('0xc'));var toCsv=require(_0xdda7('0x6'));var querystring=require(_0xdda7('0xd'));var Papa=require(_0xdda7('0xe'));var Redis=require(_0xdda7('0xf'));var authService=require(_0xdda7('0x10'));var qs=require(_0xdda7('0x11'));var as=require(_0xdda7('0x12'));var hardwareService=require(_0xdda7('0x13'));var logger=require(_0xdda7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdda7('0x15'));var licenseUtil=require(_0xdda7('0x16'));var db=require(_0xdda7('0x17'))['db'];function respondWithStatusCode(_0x523990,_0x35fd6d){_0x35fd6d=_0x35fd6d||0xcc;return function(_0x28975b){if(_0x28975b){return _0x523990[_0xdda7('0x18')](_0x35fd6d);}return _0x523990[_0xdda7('0x19')](_0x35fd6d)[_0xdda7('0x1a')]();};}function respondWithResult(_0x1db7bd,_0x4793ab){_0x4793ab=_0x4793ab||0xc8;return function(_0x361fd8){if(_0x361fd8){return _0x1db7bd['status'](_0x4793ab)[_0xdda7('0x1b')](_0x361fd8);}};}function respondWithFilteredResult(_0x2d4635,_0x28e605){return function(_0x1f7e2c){if(_0x1f7e2c){var _0x342932=typeof _0x28e605[_0xdda7('0x1c')]===_0xdda7('0x1d')&&typeof _0x28e605[_0xdda7('0x1e')]===_0xdda7('0x1d');var _0xa7c703=_0x1f7e2c[_0xdda7('0x1f')];var _0x4e9690=_0x342932?0x0:_0x28e605[_0xdda7('0x1c')];var _0x19762c=_0x342932?_0x1f7e2c[_0xdda7('0x1f')]:_0x28e605[_0xdda7('0x1c')]+_0x28e605[_0xdda7('0x1e')];var _0x44d936;if(_0x19762c>=_0xa7c703){_0x19762c=_0xa7c703;_0x44d936=0xc8;}else{_0x44d936=0xce;}_0x2d4635[_0xdda7('0x19')](_0x44d936);return _0x2d4635[_0xdda7('0x20')](_0xdda7('0x21'),_0x4e9690+'-'+_0x19762c+'/'+_0xa7c703)['json'](_0x1f7e2c);}return null;};}function patchUpdates(_0x3f8f3f){return function(_0x4c273d){try{jsonpatch[_0xdda7('0x22')](_0x4c273d,_0x3f8f3f,!![]);}catch(_0x4fdfc9){return BPromise['reject'](_0x4fdfc9);}return _0x4c273d['save']();};}function saveUpdates(_0x2f1e28,_0x4bbe87){return function(_0x254de5){if(_0x254de5){return _0x254de5[_0xdda7('0x23')](_0x2f1e28)[_0xdda7('0x24')](function(_0x3b3065){return _0x3b3065;});}return null;};}function removeEntity(_0x2840e0,_0x47ff79){return function(_0x62a49e){if(_0x62a49e){return _0x62a49e[_0xdda7('0x25')]()['then'](function(){var _0x4dca59=_0x62a49e[_0xdda7('0x26')]({'plain':!![]});var _0x152456=_0xdda7('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x152456,'resourceId':_0x4dca59['id']}})[_0xdda7('0x24')](function(){return _0x62a49e;});})[_0xdda7('0x24')](function(){_0x2840e0[_0xdda7('0x19')](0xcc)[_0xdda7('0x1a')]();});}};}function handleEntityNotFound(_0x31965c,_0x2b73e8){return function(_0x45afbe){if(!_0x45afbe){_0x31965c['sendStatus'](0x194);}return _0x45afbe;};}function handleError(_0x467c5c,_0x3099e1){_0x3099e1=_0x3099e1||0x1f4;return function(_0xc5d1d4){logger[_0xdda7('0x28')](_0xc5d1d4[_0xdda7('0x29')]);if(_0xc5d1d4['name']){delete _0xc5d1d4[_0xdda7('0x2a')];}_0x467c5c[_0xdda7('0x19')](_0x3099e1)[_0xdda7('0x2b')](_0xc5d1d4);};}exports['index']=function(_0x3a9383,_0x7d41fb){var _0x54afeb={},_0x32153a={},_0x1c5ac0={'count':0x0,'rows':[]};var _0x2d0dda=_[_0xdda7('0x2c')](db[_0xdda7('0x2d')][_0xdda7('0x2e')],function(_0x3fd84e){return{'name':_0x3fd84e['fieldName'],'type':_0x3fd84e[_0xdda7('0x2f')]['key']};});_0x32153a[_0xdda7('0x30')]=_[_0xdda7('0x2c')](_0x2d0dda,_0xdda7('0x2a'));_0x32153a[_0xdda7('0x31')]=_['keys'](_0x3a9383[_0xdda7('0x31')]);_0x32153a[_0xdda7('0x32')]=_['intersection'](_0x32153a['model'],_0x32153a[_0xdda7('0x31')]);_0x54afeb[_0xdda7('0x33')]=_[_0xdda7('0x34')](_0x32153a[_0xdda7('0x30')],qs['fields'](_0x3a9383[_0xdda7('0x31')][_0xdda7('0x35')]));_0x54afeb['attributes']=_0x54afeb[_0xdda7('0x33')][_0xdda7('0x36')]?_0x54afeb[_0xdda7('0x33')]:_0x32153a[_0xdda7('0x30')];if(!_0x3a9383[_0xdda7('0x31')][_0xdda7('0x37')](_0xdda7('0x38'))){_0x54afeb[_0xdda7('0x1e')]=qs[_0xdda7('0x1e')](_0x3a9383['query']['limit']);_0x54afeb[_0xdda7('0x1c')]=qs[_0xdda7('0x1c')](_0x3a9383[_0xdda7('0x31')][_0xdda7('0x1c')]);}_0x54afeb[_0xdda7('0x39')]=qs[_0xdda7('0x3a')](_0x3a9383[_0xdda7('0x31')][_0xdda7('0x3a')]);_0x54afeb[_0xdda7('0x3b')]=qs[_0xdda7('0x32')](_['pick'](_0x3a9383[_0xdda7('0x31')],_0x32153a[_0xdda7('0x32')]),_0x2d0dda);if(_0x3a9383[_0xdda7('0x31')]['filter']){_0x54afeb[_0xdda7('0x3b')]=_[_0xdda7('0x3c')](_0x54afeb['where'],{'$or':_[_0xdda7('0x2c')](_0x2d0dda,function(_0x3c58ea){if(_0x3c58ea[_0xdda7('0x2f')]!=='VIRTUAL'){var _0x1fe9b0={};_0x1fe9b0[_0x3c58ea[_0xdda7('0x2a')]]={'$like':'%'+_0x3a9383[_0xdda7('0x31')]['filter']+'%'};return _0x1fe9b0;}})});}_0x54afeb=_[_0xdda7('0x3c')]({},_0x54afeb,_0x3a9383[_0xdda7('0x3d')]);var _0x17515f={'where':_0x54afeb['where']};return db[_0xdda7('0x2d')]['count'](_0x17515f)['then'](function(_0x2d57ab){_0x1c5ac0[_0xdda7('0x1f')]=_0x2d57ab;if(_0x3a9383[_0xdda7('0x31')]['includeAll']){_0x54afeb[_0xdda7('0x3e')]=[{'all':!![]}];}return db[_0xdda7('0x2d')][_0xdda7('0x3f')](_0x54afeb);})[_0xdda7('0x24')](function(_0x293d45){_0x1c5ac0[_0xdda7('0x40')]=_0x293d45;return _0x1c5ac0;})[_0xdda7('0x24')](respondWithFilteredResult(_0x7d41fb,_0x54afeb))[_0xdda7('0x41')](handleError(_0x7d41fb,null));};exports[_0xdda7('0x42')]=function(_0x3f5295,_0x13b5c3){var _0x220116={'raw':!![],'where':{'id':_0x3f5295[_0xdda7('0x43')]['id']}},_0x451334={};_0x451334[_0xdda7('0x30')]=_[_0xdda7('0x44')](db[_0xdda7('0x2d')][_0xdda7('0x2e')]);_0x451334[_0xdda7('0x31')]=_['keys'](_0x3f5295[_0xdda7('0x31')]);_0x451334[_0xdda7('0x32')]=_[_0xdda7('0x34')](_0x451334[_0xdda7('0x30')],_0x451334[_0xdda7('0x31')]);_0x220116[_0xdda7('0x33')]=_[_0xdda7('0x34')](_0x451334[_0xdda7('0x30')],qs[_0xdda7('0x35')](_0x3f5295['query'][_0xdda7('0x35')]));_0x220116[_0xdda7('0x33')]=_0x220116['attributes'][_0xdda7('0x36')]?_0x220116[_0xdda7('0x33')]:_0x451334[_0xdda7('0x30')];if(_0x3f5295[_0xdda7('0x31')][_0xdda7('0x45')]){_0x220116[_0xdda7('0x3e')]=[{'all':!![]}];}_0x220116=_[_0xdda7('0x3c')]({},_0x220116,_0x3f5295[_0xdda7('0x3d')]);return db['Sound'][_0xdda7('0x46')](_0x220116)[_0xdda7('0x24')](handleEntityNotFound(_0x13b5c3,null))['then'](respondWithResult(_0x13b5c3,null))[_0xdda7('0x41')](handleError(_0x13b5c3,null));};exports[_0xdda7('0x47')]=function(_0x46f0aa,_0x188acc,_0x27ce33){return db[_0xdda7('0x2d')][_0xdda7('0x46')]({'where':{'id':_0x46f0aa[_0xdda7('0x43')]['id']},'attributes':[_0xdda7('0x2a'),_0xdda7('0x48'),_0xdda7('0x49')],'raw':!![]})[_0xdda7('0x24')](handleEntityNotFound(_0x188acc,null))[_0xdda7('0x24')](function(_0x162b17){if(_0x162b17){if(!fs['existsSync'](path[_0xdda7('0x4a')](config[_0xdda7('0x4b')],_0xdda7('0x4c'),_0x162b17['save_name']+'.'+_0x162b17[_0xdda7('0x49')]))){throw new db[(_0xdda7('0x4d'))][(_0xdda7('0x4e'))](_0xdda7('0x4f'));}return _0x188acc[_0xdda7('0x47')](path[_0xdda7('0x4a')](config[_0xdda7('0x4b')],_0xdda7('0x4c'),util['format'](_0xdda7('0x50'),_0x162b17[_0xdda7('0x48')],_0x162b17[_0xdda7('0x49')])),util[_0xdda7('0x51')](_0xdda7('0x50'),_0x162b17[_0xdda7('0x2a')],_0x162b17[_0xdda7('0x49')]));}return null;})[_0xdda7('0x41')](handleError(_0x188acc,null));};exports[_0xdda7('0x52')]=function(_0x24f308,_0x37ffcf,_0xb23dc){var _0x159b85={'name':path[_0xdda7('0x53')](_0x24f308[_0xdda7('0x54')][_0xdda7('0x55')],path['extname'](_0x24f308['file'][_0xdda7('0x55')])),'save_name':path['basename'](_0x24f308[_0xdda7('0x54')]['filename'],path['extname'](_0x24f308['file'][_0xdda7('0x56')])),'original_format':path[_0xdda7('0x57')](_0x24f308['file'][_0xdda7('0x55')])[_0xdda7('0x58')](0x1),'converted_format':'wav'};var _0x234dff=path[_0xdda7('0x4a')](config[_0xdda7('0x4b')],_0xdda7('0x59'),_0x24f308[_0xdda7('0x54')][_0xdda7('0x56')]);var _0x539ec6=path[_0xdda7('0x4a')](config[_0xdda7('0x4b')],_0xdda7('0x4c'),util[_0xdda7('0x51')](_0xdda7('0x50'),path[_0xdda7('0x53')](_0x24f308[_0xdda7('0x54')][_0xdda7('0x56')],path[_0xdda7('0x57')](_0x24f308[_0xdda7('0x54')][_0xdda7('0x56')])),_0x159b85[_0xdda7('0x49')]));logger[_0xdda7('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x234dff);logger[_0xdda7('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0x539ec6);try{fs[_0xdda7('0x5b')](_0x234dff,parseInt(_0xdda7('0x5c'),0x8));var _0x5c077c=sox[_0xdda7('0x5d')](_0x234dff,_0x539ec6,{'sampleRate':0x1f40,'format':_0xdda7('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5c077c['on']('error',function(_0x2d44d2){fs[_0xdda7('0x5f')](_0x234dff);_0x37ffcf['status'](0x1f4)[_0xdda7('0x2b')](_0x2d44d2);});_0x5c077c['on'](_0xdda7('0x60'),function(_0x396918){_0x159b85[_0xdda7('0x61')]=isNaN(_0x396918['duration'])?null:_0x396918['duration']*0x3e8;_0x159b85['original_sampleCount']=isNaN(_0x396918[_0xdda7('0x62')])?null:_0x396918[_0xdda7('0x62')];_0x159b85['original_channelCount']=isNaN(_0x396918[_0xdda7('0x63')])?null:_0x396918['channelCount'];_0x159b85[_0xdda7('0x64')]=isNaN(_0x396918[_0xdda7('0x65')])?null:_0x396918[_0xdda7('0x65')];_0x159b85[_0xdda7('0x66')]=isNaN(_0x396918[_0xdda7('0x67')])?null:_0x396918[_0xdda7('0x67')];});_0x5c077c['on']('dest',function(_0x46b748){_0x159b85[_0xdda7('0x68')]=isNaN(_0x46b748[_0xdda7('0x69')])?null:_0x46b748[_0xdda7('0x69')]*0x3e8;_0x159b85[_0xdda7('0x6a')]=isNaN(_0x46b748[_0xdda7('0x62')])?null:_0x46b748[_0xdda7('0x62')];_0x159b85[_0xdda7('0x6b')]=isNaN(_0x46b748[_0xdda7('0x63')])?null:_0x46b748[_0xdda7('0x63')];_0x159b85['converted_bitRate']=isNaN(_0x46b748[_0xdda7('0x65')])?null:_0x46b748[_0xdda7('0x65')];_0x159b85['converted_sampleRate']=isNaN(_0x46b748[_0xdda7('0x67')])?null:_0x46b748['sampleRate'];});_0x5c077c['on'](_0xdda7('0x1a'),function(){fs['chmodSync'](_0x539ec6,parseInt('0777',0x8));return db[_0xdda7('0x2d')]['create'](_0x159b85)[_0xdda7('0x24')](function(_0x1fc7a3){var _0x4d507e={'role':_0x24f308[_0xdda7('0x6c')][_0xdda7('0x6d')],'userProfileId':_0x24f308[_0xdda7('0x6c')][_0xdda7('0x6e')]};if(!_0x4d507e)throw new Error(_0xdda7('0x6f'));if(_0x4d507e[_0xdda7('0x6d')]===_0xdda7('0x70')){var _0x3f11be=_0x1fc7a3[_0xdda7('0x26')]({'plain':!![]});return db[_0xdda7('0x71')][_0xdda7('0x46')]({'where':{'name':'Sounds','userProfileId':_0x4d507e[_0xdda7('0x6e')]},'raw':!![]})[_0xdda7('0x24')](function(_0x44c65b){if(_0x44c65b&&_0x44c65b[_0xdda7('0x72')]===0x0){return db[_0xdda7('0x73')][_0xdda7('0x52')]({'name':_0x3f11be['name'],'resourceId':_0x3f11be['id'],'type':_0x44c65b[_0xdda7('0x2a')],'sectionId':_0x44c65b['id']},{})['then'](function(){return _0x1fc7a3;});}else{return _0x1fc7a3;}})[_0xdda7('0x41')](function(_0x32aa90){logger[_0xdda7('0x28')](_0xdda7('0x74'),_0x32aa90);throw _0x32aa90;});}return _0x1fc7a3;})[_0xdda7('0x24')](respondWithResult(_0x37ffcf,null))['catch'](handleError(_0x37ffcf,null));});_0x5c077c[_0xdda7('0x75')]();}catch(_0x180770){_0x37ffcf[_0xdda7('0x19')](0x1f4)['send'](_0x180770);}};exports['update']=function(_0x45a154,_0x2e0861,_0x2d5b4e){return db[_0xdda7('0x2d')][_0xdda7('0x46')]({'where':{'id':_0x45a154[_0xdda7('0x43')]['id']}})[_0xdda7('0x24')](handleEntityNotFound(_0x2e0861,null))[_0xdda7('0x24')](saveUpdates(_[_0xdda7('0x76')](_0x45a154[_0xdda7('0x6c')],['name',_0xdda7('0x77')]),null))['then'](respondWithResult(_0x2e0861,null))[_0xdda7('0x41')](handleError(_0x2e0861,null));};exports[_0xdda7('0x78')]=function(_0x2304c3,_0x35ce51,_0x4a013c){return db[_0xdda7('0x2d')]['find']({'where':{'id':_0x2304c3[_0xdda7('0x43')]['id']}})[_0xdda7('0x24')](function(_0x184c32){if(_0x184c32){return _0x184c32[_0xdda7('0x25')]();}})['then'](function(_0x365b87){var _0x1989cf=path[_0xdda7('0x4a')](config[_0xdda7('0x4b')],_0xdda7('0x59'),util['format'](_0xdda7('0x50'),_0x365b87[_0xdda7('0x48')],_0x365b87[_0xdda7('0x79')]));var _0x2b2f08=path['join'](config['root'],_0xdda7('0x4c'),util[_0xdda7('0x51')](_0xdda7('0x50'),_0x365b87[_0xdda7('0x48')],_0x365b87['converted_format']));fs['unlinkSync'](_0x1989cf);fs[_0xdda7('0x5f')](_0x2b2f08);return _0x365b87;})[_0xdda7('0x24')](function(_0x33c6c1){if(_0x33c6c1){return _0x35ce51[_0xdda7('0x19')](0xcc)[_0xdda7('0x1a')]();}})['then'](handleEntityNotFound(_0x35ce51,null))[_0xdda7('0x41')](handleError(_0x35ce51,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 603f197..33698df 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 _0x322b=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Sound','tools_sounds','util','../../config/logger','api','moment'];(function(_0x1258fc,_0x31f45c){var _0x5138d8=function(_0x1c3046){while(--_0x1c3046){_0x1258fc['push'](_0x1258fc['shift']());}};_0x5138d8(++_0x31f45c);}(_0x322b,0x104));var _0xb322=function(_0x3e7b34,_0x58f43c){_0x3e7b34=_0x3e7b34-0x0;var _0xceb31f=_0x322b[_0x3e7b34];return _0xceb31f;};'use strict';var _=require('lodash');var util=require(_0xb322('0x0'));var logger=require(_0xb322('0x1'))(_0xb322('0x2'));var moment=require(_0xb322('0x3'));var BPromise=require(_0xb322('0x4'));var rp=require(_0xb322('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb322('0x6'));var config=require(_0xb322('0x7'));var attributes=require('./sound.attributes');module[_0xb322('0x8')]=function(_0x5717d9,_0x4a7c81){return _0x5717d9[_0xb322('0x9')](_0xb322('0xa'),attributes,{'tableName':_0xb322('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6614=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds'];(function(_0x4283c0,_0xc694d5){var _0x6b47ab=function(_0x4a8f0){while(--_0x4a8f0){_0x4283c0['push'](_0x4283c0['shift']());}};_0x6b47ab(++_0xc694d5);}(_0x6614,0x174));var _0x4661=function(_0x20952d,_0x4eddd5){_0x20952d=_0x20952d-0x0;var _0x3b24d5=_0x6614[_0x20952d];return _0x3b24d5;};'use strict';var _=require(_0x4661('0x0'));var util=require(_0x4661('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4661('0x2'));var BPromise=require(_0x4661('0x3'));var rp=require(_0x4661('0x4'));var fs=require('fs');var path=require(_0x4661('0x5'));var rimraf=require(_0x4661('0x6'));var config=require(_0x4661('0x7'));var attributes=require(_0x4661('0x8'));module[_0x4661('0x9')]=function(_0xa17801,_0x488bfa){return _0xa17801[_0x4661('0xa')]('Sound',attributes,{'tableName':_0x4661('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 905fd19..046e755 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 _0x2d34=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','then','debug','util'];(function(_0x1dd53f,_0x3126cb){var _0x418c84=function(_0x2cd28e){while(--_0x2cd28e){_0x1dd53f['push'](_0x1dd53f['shift']());}};_0x418c84(++_0x3126cb);}(_0x2d34,0x197));var _0x42d3=function(_0x4d9134,_0x315f9a){_0x4d9134=_0x4d9134-0x0;var _0x1d8628=_0x2d34[_0x4d9134];return _0x1d8628;};'use strict';var _=require('lodash');var util=require(_0x42d3('0x0'));var moment=require(_0x42d3('0x1'));var BPromise=require(_0x42d3('0x2'));var rs=require(_0x42d3('0x3'));var fs=require('fs');var Redis=require(_0x42d3('0x4'));var db=require(_0x42d3('0x5'))['db'];var utils=require(_0x42d3('0x6'));var logger=require(_0x42d3('0x7'))(_0x42d3('0x8'));var config=require(_0x42d3('0x9'));var jayson=require(_0x42d3('0xa'));var client=jayson[_0x42d3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x507255,_0x4ca66d,_0x437c0e){return new BPromise(function(_0x6ee382,_0x52cff6){return client[_0x42d3('0xc')](_0x507255,_0x437c0e)['then'](function(_0x470fc2){logger[_0x42d3('0xd')](_0x42d3('0xe'),_0x4ca66d,_0x42d3('0xf'));logger['debug'](_0x42d3('0x10'),_0x4ca66d,_0x42d3('0xf'),JSON[_0x42d3('0x11')](_0x470fc2));if(_0x470fc2['error']){if(_0x470fc2[_0x42d3('0x12')][_0x42d3('0x13')]===0x1f4){logger[_0x42d3('0x12')](_0x42d3('0xe'),_0x4ca66d,_0x470fc2[_0x42d3('0x12')][_0x42d3('0x14')]);return _0x52cff6(_0x470fc2['error']['message']);}logger[_0x42d3('0x12')](_0x42d3('0xe'),_0x4ca66d,_0x470fc2['error'][_0x42d3('0x14')]);return _0x6ee382(_0x470fc2[_0x42d3('0x12')][_0x42d3('0x14')]);}else{logger[_0x42d3('0xd')](_0x42d3('0xe'),_0x4ca66d,_0x42d3('0xf'));_0x6ee382(_0x470fc2[_0x42d3('0x15')]['message']);}})[_0x42d3('0x16')](function(_0x512f37){logger['error']('Sound,\x20%s,\x20%s',_0x4ca66d,_0x512f37);_0x52cff6(_0x512f37);});});}exports[_0x42d3('0x17')]=function(_0x272bce){var _0x3fe4f8=this;return new Promise(function(_0x2310c9,_0x3b1a7b){return db[_0x42d3('0x18')][_0x42d3('0x19')]({'raw':_0x272bce[_0x42d3('0x1a')]?_0x272bce[_0x42d3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x272bce[_0x42d3('0x1a')]?_0x272bce[_0x42d3('0x1a')][_0x42d3('0x1b')]||null:null,'attributes':_0x272bce['options']?_0x272bce[_0x42d3('0x1a')][_0x42d3('0x1c')]||null:null,'include':_0x272bce[_0x42d3('0x1a')]?_0x272bce[_0x42d3('0x1a')][_0x42d3('0x1d')]?_[_0x42d3('0x1e')](_0x272bce[_0x42d3('0x1a')][_0x42d3('0x1d')],function(_0x47a098){return{'model':db[_0x47a098['model']],'as':_0x47a098['as'],'attributes':_0x47a098['attributes'],'include':_0x47a098[_0x42d3('0x1d')]?_[_0x42d3('0x1e')](_0x47a098[_0x42d3('0x1d')],function(_0x3de5fa){return{'model':db[_0x3de5fa['model']],'as':_0x3de5fa['as'],'attributes':_0x3de5fa['attributes'],'include':_0x3de5fa[_0x42d3('0x1d')]?_['map'](_0x3de5fa[_0x42d3('0x1d')],function(_0x19d321){return{'model':db[_0x19d321[_0x42d3('0x1f')]],'as':_0x19d321['as'],'attributes':_0x19d321[_0x42d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x42d3('0x20')](function(_0x28024a){logger[_0x42d3('0xd')]('ShowSound',_0x272bce);logger[_0x42d3('0x21')](_0x42d3('0x17'),_0x272bce,JSON[_0x42d3('0x11')](_0x28024a));_0x2310c9(_0x28024a);})[_0x42d3('0x16')](function(_0x5ce577){logger['error'](_0x42d3('0x17'),_0x5ce577[_0x42d3('0x14')],_0x272bce);_0x3b1a7b(_0x3fe4f8[_0x42d3('0x12')](0x1f4,_0x5ce577[_0x42d3('0x14')]));});});}; \ No newline at end of file +var _0x4da2=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSound','Sound','options','raw','attributes','map','include','model','catch','lodash','bluebird'];(function(_0x125425,_0x4b6bab){var _0xd04dc4=function(_0x37fc01){while(--_0x37fc01){_0x125425['push'](_0x125425['shift']());}};_0xd04dc4(++_0x4b6bab);}(_0x4da2,0xc9));var _0x24da=function(_0x153519,_0x2900de){_0x153519=_0x153519-0x0;var _0x2e1b73=_0x4da2[_0x153519];return _0x2e1b73;};'use strict';var _=require(_0x24da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x24da('0x1'));var rs=require(_0x24da('0x2'));var fs=require('fs');var Redis=require(_0x24da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24da('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x24da('0x5'));var jayson=require(_0x24da('0x6'));var client=jayson[_0x24da('0x7')][_0x24da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b190a,_0x1d2a12,_0x3d2980){return new BPromise(function(_0x4425c0,_0x549c44){return client['request'](_0x4b190a,_0x3d2980)[_0x24da('0x9')](function(_0x2d33d7){logger[_0x24da('0xa')](_0x24da('0xb'),_0x1d2a12,'request\x20sent');logger[_0x24da('0xc')](_0x24da('0xd'),_0x1d2a12,_0x24da('0xe'),JSON[_0x24da('0xf')](_0x2d33d7));if(_0x2d33d7[_0x24da('0x10')]){if(_0x2d33d7[_0x24da('0x10')][_0x24da('0x11')]===0x1f4){logger[_0x24da('0x10')]('Sound,\x20%s,\x20%s',_0x1d2a12,_0x2d33d7[_0x24da('0x10')]['message']);return _0x549c44(_0x2d33d7[_0x24da('0x10')][_0x24da('0x12')]);}logger['error'](_0x24da('0xb'),_0x1d2a12,_0x2d33d7[_0x24da('0x10')][_0x24da('0x12')]);return _0x4425c0(_0x2d33d7['error'][_0x24da('0x12')]);}else{logger[_0x24da('0xa')](_0x24da('0xb'),_0x1d2a12,_0x24da('0xe'));_0x4425c0(_0x2d33d7[_0x24da('0x13')][_0x24da('0x12')]);}})['catch'](function(_0x45e90d){logger['error']('Sound,\x20%s,\x20%s',_0x1d2a12,_0x45e90d);_0x549c44(_0x45e90d);});});}exports[_0x24da('0x14')]=function(_0xcb9a60){var _0x4a15ac=this;return new Promise(function(_0x38609b,_0x48cccc){return db[_0x24da('0x15')]['find']({'raw':_0xcb9a60[_0x24da('0x16')]?_0xcb9a60[_0x24da('0x16')][_0x24da('0x17')]===undefined?!![]:![]:!![],'where':_0xcb9a60[_0x24da('0x16')]?_0xcb9a60[_0x24da('0x16')]['where']||null:null,'attributes':_0xcb9a60[_0x24da('0x16')]?_0xcb9a60['options'][_0x24da('0x18')]||null:null,'include':_0xcb9a60[_0x24da('0x16')]?_0xcb9a60[_0x24da('0x16')]['include']?_[_0x24da('0x19')](_0xcb9a60['options'][_0x24da('0x1a')],function(_0x471993){return{'model':db[_0x471993[_0x24da('0x1b')]],'as':_0x471993['as'],'attributes':_0x471993[_0x24da('0x18')],'include':_0x471993[_0x24da('0x1a')]?_[_0x24da('0x19')](_0x471993[_0x24da('0x1a')],function(_0x1165c8){return{'model':db[_0x1165c8[_0x24da('0x1b')]],'as':_0x1165c8['as'],'attributes':_0x1165c8[_0x24da('0x18')],'include':_0x1165c8[_0x24da('0x1a')]?_[_0x24da('0x19')](_0x1165c8['include'],function(_0x480547){return{'model':db[_0x480547[_0x24da('0x1b')]],'as':_0x480547['as'],'attributes':_0x480547['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17d6e8){logger['info'](_0x24da('0x14'),_0xcb9a60);logger[_0x24da('0xc')]('ShowSound',_0xcb9a60,JSON[_0x24da('0xf')](_0x17d6e8));_0x38609b(_0x17d6e8);})[_0x24da('0x1c')](function(_0x10637d){logger['error'](_0x24da('0x14'),_0x10637d[_0x24da('0x12')],_0xcb9a60);_0x48cccc(_0x4a15ac['error'](0x1f4,_0x10637d[_0x24da('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 7e026ca..825b02b 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18d181,_0x27e7ca){var _0x3d4374=function(_0x5630c5){while(--_0x5630c5){_0x18d181['push'](_0x18d181['shift']());}};_0x3d4374(++_0x27e7ca);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0xb10b[_0x4f7b43];return _0x2fcdf3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x1dd15c,_0x119f10){var _0x10807e=function(_0x51bd3f){while(--_0x51bd3f){_0x1dd15c['push'](_0x1dd15c['shift']());}};_0x10807e(++_0x119f10);}(_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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e29b773..95dc7fa 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 _0x76be=['TEXT','out','STRING','sequelize'];(function(_0x297cf0,_0x61297d){var _0x3dadd1=function(_0x30d61d){while(--_0x30d61d){_0x297cf0['push'](_0x297cf0['shift']());}};_0x3dadd1(++_0x61297d);}(_0x76be,0xbf));var _0xe76b=function(_0xdf6241,_0x16d87c){_0xdf6241=_0xdf6241-0x0;var _0x93720=_0x76be[_0xdf6241];return _0x93720;};'use strict';var Sequelize=require(_0xe76b('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xe76b('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe76b('0x2')),'defaultValue':_0xe76b('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe76b('0x3')]},'providerResponse':{'type':Sequelize[_0xe76b('0x1')]}}; \ No newline at end of file +var _0xf881=['TEXT','STRING','out'];(function(_0x5ad8d4,_0x12357c){var _0x6a7715=function(_0x59be0f){while(--_0x59be0f){_0x5ad8d4['push'](_0x5ad8d4['shift']());}};_0x6a7715(++_0x12357c);}(_0xf881,0x12a));var _0x1f88=function(_0x3482a8,_0x1472e7){_0x3482a8=_0x3482a8-0x0;var _0x5c0db6=_0xf881[_0x3482a8];return _0x5c0db6;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x1f88('0x0')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1f88('0x1'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1f88('0x0')]},'providerResponse':{'type':Sequelize[_0x1f88('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c4fbaf4..c3acad9 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 _0xc130=['lodash','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2fe768,_0x144767){var _0x101337=function(_0x548f90){while(--_0x548f90){_0x2fe768['push'](_0x2fe768['shift']());}};_0x101337(++_0x144767);}(_0xc130,0x170));var _0x0c13=function(_0xf3e813,_0x374b3c){_0xf3e813=_0xf3e813-0x0;var _0x4825bc=_0xc130[_0xf3e813];return _0x4825bc;};'use strict';var emlformat=require(_0x0c13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c13('0x1'));var jsonpatch=require(_0x0c13('0x2'));var rp=require('request-promise');var moment=require(_0x0c13('0x3'));var BPromise=require(_0x0c13('0x4'));var Mustache=require(_0x0c13('0x5'));var util=require(_0x0c13('0x6'));var path=require(_0x0c13('0x7'));var sox=require(_0x0c13('0x8'));var csv=require(_0x0c13('0x9'));var ejs=require(_0x0c13('0xa'));var fs=require('fs');var fs_extra=require(_0x0c13('0xb'));var _=require(_0x0c13('0xc'));var squel=require('squel');var crypto=require(_0x0c13('0xd'));var jsforce=require(_0x0c13('0xe'));var deskjs=require(_0x0c13('0xf'));var toCsv=require(_0x0c13('0x9'));var querystring=require(_0x0c13('0x10'));var Papa=require('papaparse');var Redis=require(_0x0c13('0x11'));var authService=require(_0x0c13('0x12'));var qs=require(_0x0c13('0x13'));var as=require(_0x0c13('0x14'));var hardwareService=require(_0x0c13('0x15'));var logger=require(_0x0c13('0x16'))(_0x0c13('0x17'));var utils=require(_0x0c13('0x18'));var config=require(_0x0c13('0x19'));var licenseUtil=require(_0x0c13('0x1a'));var db=require(_0x0c13('0x1b'))['db'];function respondWithStatusCode(_0x6ede08,_0x2bd7a2){_0x2bd7a2=_0x2bd7a2||0xcc;return function(_0x3f298a){if(_0x3f298a){return _0x6ede08['sendStatus'](_0x2bd7a2);}return _0x6ede08[_0x0c13('0x1c')](_0x2bd7a2)[_0x0c13('0x1d')]();};}function respondWithResult(_0x112107,_0x3dbff4){_0x3dbff4=_0x3dbff4||0xc8;return function(_0x1e8bea){if(_0x1e8bea){return _0x112107[_0x0c13('0x1c')](_0x3dbff4)[_0x0c13('0x1e')](_0x1e8bea);}};}function respondWithFilteredResult(_0x4fa851,_0x2a8930){return function(_0x5bc799){if(_0x5bc799){var _0xfb9b01=typeof _0x2a8930[_0x0c13('0x1f')]===_0x0c13('0x20')&&typeof _0x2a8930['limit']===_0x0c13('0x20');var _0x12daec=_0x5bc799[_0x0c13('0x21')];var _0x245384=_0xfb9b01?0x0:_0x2a8930[_0x0c13('0x1f')];var _0x47fb0a=_0xfb9b01?_0x5bc799['count']:_0x2a8930[_0x0c13('0x1f')]+_0x2a8930[_0x0c13('0x22')];var _0x2edd0f;if(_0x47fb0a>=_0x12daec){_0x47fb0a=_0x12daec;_0x2edd0f=0xc8;}else{_0x2edd0f=0xce;}_0x4fa851[_0x0c13('0x1c')](_0x2edd0f);return _0x4fa851[_0x0c13('0x23')](_0x0c13('0x24'),_0x245384+'-'+_0x47fb0a+'/'+_0x12daec)['json'](_0x5bc799);}return null;};}function patchUpdates(_0x407cc0){return function(_0x55467d){try{jsonpatch[_0x0c13('0x25')](_0x55467d,_0x407cc0,!![]);}catch(_0xe1670c){return BPromise['reject'](_0xe1670c);}return _0x55467d[_0x0c13('0x26')]();};}function saveUpdates(_0x2be050,_0x213891){return function(_0x28a786){if(_0x28a786){return _0x28a786[_0x0c13('0x27')](_0x2be050)[_0x0c13('0x28')](function(_0x49078a){return _0x49078a;});}return null;};}function removeEntity(_0x15bc40,_0x56ede5){return function(_0x1c9ee1){if(_0x1c9ee1){return _0x1c9ee1[_0x0c13('0x29')]()[_0x0c13('0x28')](function(){_0x15bc40[_0x0c13('0x1c')](0xcc)[_0x0c13('0x1d')]();});}};}function handleEntityNotFound(_0x426026,_0x936e2d){return function(_0x1b2b4e){if(!_0x1b2b4e){_0x426026['sendStatus'](0x194);}return _0x1b2b4e;};}function handleError(_0x2fc0af,_0x516b57){_0x516b57=_0x516b57||0x1f4;return function(_0x43e169){logger['error'](_0x43e169['stack']);if(_0x43e169['name']){delete _0x43e169[_0x0c13('0x2a')];}_0x2fc0af[_0x0c13('0x1c')](_0x516b57)[_0x0c13('0x2b')](_0x43e169);};}exports[_0x0c13('0x2c')]=function(_0x38a965,_0x58c1a7){var _0x31a4c7={},_0x1476f4={},_0x5dac22={'count':0x0,'rows':[]};var _0x3dedb6=_['map'](db['SquareMessage']['rawAttributes'],function(_0x2dadd3){return{'name':_0x2dadd3['fieldName'],'type':_0x2dadd3[_0x0c13('0x2d')][_0x0c13('0x2e')]};});_0x1476f4[_0x0c13('0x2f')]=_[_0x0c13('0x30')](_0x3dedb6,_0x0c13('0x2a'));_0x1476f4[_0x0c13('0x31')]=_[_0x0c13('0x32')](_0x38a965['query']);_0x1476f4[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x1476f4[_0x0c13('0x2f')],_0x1476f4[_0x0c13('0x31')]);_0x31a4c7[_0x0c13('0x35')]=_[_0x0c13('0x34')](_0x1476f4[_0x0c13('0x2f')],qs[_0x0c13('0x36')](_0x38a965['query']['fields']));_0x31a4c7[_0x0c13('0x35')]=_0x31a4c7[_0x0c13('0x35')]['length']?_0x31a4c7[_0x0c13('0x35')]:_0x1476f4['model'];if(!_0x38a965['query']['hasOwnProperty'](_0x0c13('0x37'))){_0x31a4c7[_0x0c13('0x22')]=qs[_0x0c13('0x22')](_0x38a965['query'][_0x0c13('0x22')]);_0x31a4c7[_0x0c13('0x1f')]=qs[_0x0c13('0x1f')](_0x38a965[_0x0c13('0x31')][_0x0c13('0x1f')]);}_0x31a4c7[_0x0c13('0x38')]=qs[_0x0c13('0x39')](_0x38a965[_0x0c13('0x31')]['sort']);_0x31a4c7[_0x0c13('0x3a')]=qs[_0x0c13('0x33')](_[_0x0c13('0x3b')](_0x38a965[_0x0c13('0x31')],_0x1476f4[_0x0c13('0x33')]),_0x3dedb6);if(_0x38a965[_0x0c13('0x31')][_0x0c13('0x3c')]){_0x31a4c7[_0x0c13('0x3a')]=_[_0x0c13('0x3d')](_0x31a4c7[_0x0c13('0x3a')],{'$or':_[_0x0c13('0x30')](_0x3dedb6,function(_0x575b8b){if(_0x575b8b[_0x0c13('0x2d')]!==_0x0c13('0x3e')){var _0x139311={};_0x139311[_0x575b8b[_0x0c13('0x2a')]]={'$like':'%'+_0x38a965[_0x0c13('0x31')][_0x0c13('0x3c')]+'%'};return _0x139311;}})});}_0x31a4c7=_[_0x0c13('0x3d')]({},_0x31a4c7,_0x38a965[_0x0c13('0x3f')]);var _0x37fc98={'where':_0x31a4c7[_0x0c13('0x3a')]};return db[_0x0c13('0x40')][_0x0c13('0x21')](_0x37fc98)[_0x0c13('0x28')](function(_0x4ad7e5){_0x5dac22[_0x0c13('0x21')]=_0x4ad7e5;if(_0x38a965[_0x0c13('0x31')][_0x0c13('0x41')]){_0x31a4c7[_0x0c13('0x42')]=[{'all':!![]}];}return db[_0x0c13('0x40')][_0x0c13('0x43')](_0x31a4c7);})['then'](function(_0x2ab6fd){_0x5dac22[_0x0c13('0x44')]=_0x2ab6fd;return _0x5dac22;})[_0x0c13('0x28')](respondWithFilteredResult(_0x58c1a7,_0x31a4c7))['catch'](handleError(_0x58c1a7,null));};exports['show']=function(_0x425dbb,_0x2e036f){var _0x2999ee={'raw':!![],'where':{'id':_0x425dbb[_0x0c13('0x45')]['id']}},_0x2f51f6={};_0x2f51f6[_0x0c13('0x2f')]=_[_0x0c13('0x32')](db[_0x0c13('0x40')][_0x0c13('0x46')]);_0x2f51f6[_0x0c13('0x31')]=_[_0x0c13('0x32')](_0x425dbb[_0x0c13('0x31')]);_0x2f51f6[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x2f51f6[_0x0c13('0x2f')],_0x2f51f6[_0x0c13('0x31')]);_0x2999ee[_0x0c13('0x35')]=_['intersection'](_0x2f51f6[_0x0c13('0x2f')],qs[_0x0c13('0x36')](_0x425dbb['query'][_0x0c13('0x36')]));_0x2999ee['attributes']=_0x2999ee['attributes'][_0x0c13('0x47')]?_0x2999ee[_0x0c13('0x35')]:_0x2f51f6[_0x0c13('0x2f')];if(_0x425dbb[_0x0c13('0x31')]['includeAll']){_0x2999ee[_0x0c13('0x42')]=[{'all':!![]}];}_0x2999ee=_['merge']({},_0x2999ee,_0x425dbb[_0x0c13('0x3f')]);return db['SquareMessage'][_0x0c13('0x48')](_0x2999ee)[_0x0c13('0x28')](handleEntityNotFound(_0x2e036f,null))[_0x0c13('0x28')](respondWithResult(_0x2e036f,null))[_0x0c13('0x49')](handleError(_0x2e036f,null));};exports[_0x0c13('0x4a')]=function(_0x4aefbd,_0x2a6d89){return db[_0x0c13('0x40')][_0x0c13('0x4a')](_0x4aefbd[_0x0c13('0x4b')],{})[_0x0c13('0x28')](respondWithResult(_0x2a6d89,0xc9))[_0x0c13('0x49')](handleError(_0x2a6d89,null));};exports[_0x0c13('0x27')]=function(_0x24f2fb,_0x118b00){if(_0x24f2fb[_0x0c13('0x4b')]['id']){delete _0x24f2fb[_0x0c13('0x4b')]['id'];}return db[_0x0c13('0x40')][_0x0c13('0x48')]({'where':{'id':_0x24f2fb[_0x0c13('0x45')]['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x118b00,null))[_0x0c13('0x28')](saveUpdates(_0x24f2fb[_0x0c13('0x4b')],null))[_0x0c13('0x28')](respondWithResult(_0x118b00,null))['catch'](handleError(_0x118b00,null));};exports[_0x0c13('0x29')]=function(_0x687dc8,_0x482c3a){return db[_0x0c13('0x40')][_0x0c13('0x48')]({'where':{'id':_0x687dc8['params']['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x482c3a,null))[_0x0c13('0x28')](removeEntity(_0x482c3a,null))[_0x0c13('0x49')](handleError(_0x482c3a,null));}; \ No newline at end of file +var _0x6075=['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','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','type','key','query','intersection','model','attributes','fields','length','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6075,0x8a));var _0x5607=function(_0x4f6195,_0x2b5d26){_0x4f6195=_0x4f6195-0x0;var _0x5b981b=_0x6075[_0x4f6195];return _0x5b981b;};'use strict';var emlformat=require(_0x5607('0x0'));var rimraf=require(_0x5607('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5607('0x2'));var rp=require(_0x5607('0x3'));var moment=require(_0x5607('0x4'));var BPromise=require(_0x5607('0x5'));var Mustache=require(_0x5607('0x6'));var util=require('util');var path=require(_0x5607('0x7'));var sox=require(_0x5607('0x8'));var csv=require(_0x5607('0x9'));var ejs=require(_0x5607('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5607('0xb'));var squel=require(_0x5607('0xc'));var crypto=require(_0x5607('0xd'));var jsforce=require(_0x5607('0xe'));var deskjs=require(_0x5607('0xf'));var toCsv=require(_0x5607('0x9'));var querystring=require(_0x5607('0x10'));var Papa=require('papaparse');var Redis=require(_0x5607('0x11'));var authService=require(_0x5607('0x12'));var qs=require(_0x5607('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5607('0x14'));var logger=require(_0x5607('0x15'))(_0x5607('0x16'));var utils=require(_0x5607('0x17'));var config=require(_0x5607('0x18'));var licenseUtil=require(_0x5607('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44872b,_0xb6c49e){_0xb6c49e=_0xb6c49e||0xcc;return function(_0x494892){if(_0x494892){return _0x44872b[_0x5607('0x1a')](_0xb6c49e);}return _0x44872b[_0x5607('0x1b')](_0xb6c49e)[_0x5607('0x1c')]();};}function respondWithResult(_0x11b1c5,_0x554789){_0x554789=_0x554789||0xc8;return function(_0x130e16){if(_0x130e16){return _0x11b1c5[_0x5607('0x1b')](_0x554789)[_0x5607('0x1d')](_0x130e16);}};}function respondWithFilteredResult(_0x19527e,_0x205560){return function(_0x32beb4){if(_0x32beb4){var _0x17fd47=typeof _0x205560['offset']==='undefined'&&typeof _0x205560[_0x5607('0x1e')]===_0x5607('0x1f');var _0x652fca=_0x32beb4[_0x5607('0x20')];var _0x1f440e=_0x17fd47?0x0:_0x205560[_0x5607('0x21')];var _0x29a44c=_0x17fd47?_0x32beb4[_0x5607('0x20')]:_0x205560[_0x5607('0x21')]+_0x205560[_0x5607('0x1e')];var _0xfbf0a5;if(_0x29a44c>=_0x652fca){_0x29a44c=_0x652fca;_0xfbf0a5=0xc8;}else{_0xfbf0a5=0xce;}_0x19527e[_0x5607('0x1b')](_0xfbf0a5);return _0x19527e['set'](_0x5607('0x22'),_0x1f440e+'-'+_0x29a44c+'/'+_0x652fca)[_0x5607('0x1d')](_0x32beb4);}return null;};}function patchUpdates(_0x3e1cae){return function(_0x2718a4){try{jsonpatch[_0x5607('0x23')](_0x2718a4,_0x3e1cae,!![]);}catch(_0x4a815f){return BPromise[_0x5607('0x24')](_0x4a815f);}return _0x2718a4[_0x5607('0x25')]();};}function saveUpdates(_0x15a25a,_0x17e265){return function(_0xa15b9d){if(_0xa15b9d){return _0xa15b9d[_0x5607('0x26')](_0x15a25a)[_0x5607('0x27')](function(_0x52c835){return _0x52c835;});}return null;};}function removeEntity(_0x468dcb,_0x195622){return function(_0x162b52){if(_0x162b52){return _0x162b52[_0x5607('0x28')]()[_0x5607('0x27')](function(){_0x468dcb[_0x5607('0x1b')](0xcc)[_0x5607('0x1c')]();});}};}function handleEntityNotFound(_0x5785b6,_0x276fc4){return function(_0x51065a){if(!_0x51065a){_0x5785b6[_0x5607('0x1a')](0x194);}return _0x51065a;};}function handleError(_0x4ee2c9,_0x1a52ff){_0x1a52ff=_0x1a52ff||0x1f4;return function(_0x20a228){logger[_0x5607('0x29')](_0x20a228[_0x5607('0x2a')]);if(_0x20a228[_0x5607('0x2b')]){delete _0x20a228['name'];}_0x4ee2c9[_0x5607('0x1b')](_0x1a52ff)['send'](_0x20a228);};}exports[_0x5607('0x2c')]=function(_0x23fa77,_0x3bf55c){var _0x3967d7={},_0x2d20c6={},_0x1f15f9={'count':0x0,'rows':[]};var _0x5d8e04=_[_0x5607('0x2d')](db[_0x5607('0x2e')][_0x5607('0x2f')],function(_0x17920c){return{'name':_0x17920c['fieldName'],'type':_0x17920c[_0x5607('0x30')][_0x5607('0x31')]};});_0x2d20c6['model']=_[_0x5607('0x2d')](_0x5d8e04,'name');_0x2d20c6[_0x5607('0x32')]=_['keys'](_0x23fa77['query']);_0x2d20c6['filters']=_[_0x5607('0x33')](_0x2d20c6[_0x5607('0x34')],_0x2d20c6[_0x5607('0x32')]);_0x3967d7[_0x5607('0x35')]=_[_0x5607('0x33')](_0x2d20c6[_0x5607('0x34')],qs[_0x5607('0x36')](_0x23fa77['query']['fields']));_0x3967d7[_0x5607('0x35')]=_0x3967d7[_0x5607('0x35')][_0x5607('0x37')]?_0x3967d7['attributes']:_0x2d20c6[_0x5607('0x34')];if(!_0x23fa77[_0x5607('0x32')]['hasOwnProperty']('nolimit')){_0x3967d7[_0x5607('0x1e')]=qs[_0x5607('0x1e')](_0x23fa77[_0x5607('0x32')]['limit']);_0x3967d7[_0x5607('0x21')]=qs[_0x5607('0x21')](_0x23fa77['query']['offset']);}_0x3967d7[_0x5607('0x38')]=qs['sort'](_0x23fa77[_0x5607('0x32')]['sort']);_0x3967d7[_0x5607('0x39')]=qs['filters'](_[_0x5607('0x3a')](_0x23fa77[_0x5607('0x32')],_0x2d20c6[_0x5607('0x3b')]),_0x5d8e04);if(_0x23fa77['query'][_0x5607('0x3c')]){_0x3967d7['where']=_[_0x5607('0x3d')](_0x3967d7[_0x5607('0x39')],{'$or':_[_0x5607('0x2d')](_0x5d8e04,function(_0x14cd36){if(_0x14cd36[_0x5607('0x30')]!==_0x5607('0x3e')){var _0x3dbf26={};_0x3dbf26[_0x14cd36['name']]={'$like':'%'+_0x23fa77['query'][_0x5607('0x3c')]+'%'};return _0x3dbf26;}})});}_0x3967d7=_[_0x5607('0x3d')]({},_0x3967d7,_0x23fa77[_0x5607('0x3f')]);var _0x1e1bca={'where':_0x3967d7[_0x5607('0x39')]};return db[_0x5607('0x2e')]['count'](_0x1e1bca)[_0x5607('0x27')](function(_0x5ca121){_0x1f15f9[_0x5607('0x20')]=_0x5ca121;if(_0x23fa77[_0x5607('0x32')][_0x5607('0x40')]){_0x3967d7[_0x5607('0x41')]=[{'all':!![]}];}return db[_0x5607('0x2e')][_0x5607('0x42')](_0x3967d7);})[_0x5607('0x27')](function(_0x307e73){_0x1f15f9[_0x5607('0x43')]=_0x307e73;return _0x1f15f9;})[_0x5607('0x27')](respondWithFilteredResult(_0x3bf55c,_0x3967d7))[_0x5607('0x44')](handleError(_0x3bf55c,null));};exports[_0x5607('0x45')]=function(_0x23dd8e,_0xd3e2ee){var _0x59ebf4={'raw':!![],'where':{'id':_0x23dd8e[_0x5607('0x46')]['id']}},_0xfd1d13={};_0xfd1d13[_0x5607('0x34')]=_[_0x5607('0x47')](db[_0x5607('0x2e')][_0x5607('0x2f')]);_0xfd1d13['query']=_['keys'](_0x23dd8e[_0x5607('0x32')]);_0xfd1d13[_0x5607('0x3b')]=_['intersection'](_0xfd1d13[_0x5607('0x34')],_0xfd1d13['query']);_0x59ebf4['attributes']=_[_0x5607('0x33')](_0xfd1d13[_0x5607('0x34')],qs[_0x5607('0x36')](_0x23dd8e[_0x5607('0x32')]['fields']));_0x59ebf4[_0x5607('0x35')]=_0x59ebf4[_0x5607('0x35')]['length']?_0x59ebf4[_0x5607('0x35')]:_0xfd1d13[_0x5607('0x34')];if(_0x23dd8e['query']['includeAll']){_0x59ebf4[_0x5607('0x41')]=[{'all':!![]}];}_0x59ebf4=_[_0x5607('0x3d')]({},_0x59ebf4,_0x23dd8e[_0x5607('0x3f')]);return db[_0x5607('0x2e')][_0x5607('0x48')](_0x59ebf4)[_0x5607('0x27')](handleEntityNotFound(_0xd3e2ee,null))[_0x5607('0x27')](respondWithResult(_0xd3e2ee,null))[_0x5607('0x44')](handleError(_0xd3e2ee,null));};exports[_0x5607('0x49')]=function(_0x3f0d95,_0x33f842){return db[_0x5607('0x2e')][_0x5607('0x49')](_0x3f0d95['body'],{})[_0x5607('0x27')](respondWithResult(_0x33f842,0xc9))[_0x5607('0x44')](handleError(_0x33f842,null));};exports[_0x5607('0x26')]=function(_0x4b204f,_0x20fab2){if(_0x4b204f[_0x5607('0x4a')]['id']){delete _0x4b204f['body']['id'];}return db[_0x5607('0x2e')][_0x5607('0x48')]({'where':{'id':_0x4b204f['params']['id']}})['then'](handleEntityNotFound(_0x20fab2,null))[_0x5607('0x27')](saveUpdates(_0x4b204f[_0x5607('0x4a')],null))['then'](respondWithResult(_0x20fab2,null))[_0x5607('0x44')](handleError(_0x20fab2,null));};exports['destroy']=function(_0x598b1a,_0x4b4d4e){return db[_0x5607('0x2e')][_0x5607('0x48')]({'where':{'id':_0x598b1a[_0x5607('0x46')]['id']}})[_0x5607('0x27')](handleEntityNotFound(_0x4b4d4e,null))[_0x5607('0x27')](removeEntity(_0x4b4d4e,null))['catch'](handleError(_0x4b4d4e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2183ecd..78d827f 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 _0x3891=['square_messages','lodash','util','api','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define'];(function(_0x3f9649,_0x2a7fa2){var _0x33b6d4=function(_0x1636e9){while(--_0x1636e9){_0x3f9649['push'](_0x3f9649['shift']());}};_0x33b6d4(++_0x2a7fa2);}(_0x3891,0x109));var _0x1389=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3891[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x1389('0x0'));var util=require(_0x1389('0x1'));var logger=require('../../config/logger')(_0x1389('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1389('0x3'));var fs=require('fs');var path=require(_0x1389('0x4'));var rimraf=require(_0x1389('0x5'));var config=require(_0x1389('0x6'));var attributes=require(_0x1389('0x7'));module[_0x1389('0x8')]=function(_0xc50944,_0x55e46e){return _0xc50944[_0x1389('0x9')]('SquareMessage',attributes,{'tableName':_0x1389('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf2a=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareMessage.attributes','exports','define','SquareMessage','lodash'];(function(_0x4d5721,_0x51a33d){var _0x88a224=function(_0x2b2609){while(--_0x2b2609){_0x4d5721['push'](_0x4d5721['shift']());}};_0x88a224(++_0x51a33d);}(_0xbf2a,0xb3));var _0xabf2=function(_0x428d55,_0x4e5e47){_0x428d55=_0x428d55-0x0;var _0x4ba5fc=_0xbf2a[_0x428d55];return _0x4ba5fc;};'use strict';var _=require(_0xabf2('0x0'));var util=require(_0xabf2('0x1'));var logger=require(_0xabf2('0x2'))(_0xabf2('0x3'));var moment=require(_0xabf2('0x4'));var BPromise=require(_0xabf2('0x5'));var rp=require(_0xabf2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabf2('0x7'));var config=require('../../config/environment');var attributes=require(_0xabf2('0x8'));module[_0xabf2('0x9')]=function(_0x1da61d,_0x33ee26){return _0x1da61d[_0xabf2('0xa')](_0xabf2('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 7f4b372..afe19b2 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 _0x1f1a=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateSquareMessage','SquareMessage','create','options','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x13216c,_0x6617d6){var _0xee8ab9=function(_0x25ff2){while(--_0x25ff2){_0x13216c['push'](_0x13216c['shift']());}};_0xee8ab9(++_0x6617d6);}(_0x1f1a,0x140));var _0xa1f1=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x1f1a[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0xa1f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa1f1('0x1'));var rs=require(_0xa1f1('0x2'));var fs=require('fs');var Redis=require(_0xa1f1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa1f1('0x4'))('rpc');var config=require(_0xa1f1('0x5'));var jayson=require(_0xa1f1('0x6'));var client=jayson[_0xa1f1('0x7')][_0xa1f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e7957,_0x43e0c8,_0x38e824){return new BPromise(function(_0x102dd5,_0x313ff6){return client['request'](_0x4e7957,_0x38e824)[_0xa1f1('0x9')](function(_0x410a73){logger[_0xa1f1('0xa')](_0xa1f1('0xb'),_0x43e0c8,_0xa1f1('0xc'));logger[_0xa1f1('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x43e0c8,'request\x20sent',JSON[_0xa1f1('0xe')](_0x410a73));if(_0x410a73[_0xa1f1('0xf')]){if(_0x410a73[_0xa1f1('0xf')]['code']===0x1f4){logger['error'](_0xa1f1('0xb'),_0x43e0c8,_0x410a73[_0xa1f1('0xf')]['message']);return _0x313ff6(_0x410a73[_0xa1f1('0xf')][_0xa1f1('0x10')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x43e0c8,_0x410a73[_0xa1f1('0xf')][_0xa1f1('0x10')]);return _0x102dd5(_0x410a73[_0xa1f1('0xf')][_0xa1f1('0x10')]);}else{logger['info'](_0xa1f1('0xb'),_0x43e0c8,_0xa1f1('0xc'));_0x102dd5(_0x410a73['result'][_0xa1f1('0x10')]);}})[_0xa1f1('0x11')](function(_0x157cb1){logger[_0xa1f1('0xf')](_0xa1f1('0xb'),_0x43e0c8,_0x157cb1);_0x313ff6(_0x157cb1);});});}exports[_0xa1f1('0x12')]=function(_0x136d59){var _0x33b2f0=this;return new Promise(function(_0x4d6c11,_0x1cd3e8){return db[_0xa1f1('0x13')][_0xa1f1('0x14')](_0x136d59['body'],{'raw':_0x136d59['options']?_0x136d59[_0xa1f1('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xa1f1('0x9')](function(_0x11d8c1){logger[_0xa1f1('0xa')](_0xa1f1('0x12'),_0x136d59);logger[_0xa1f1('0xd')](_0xa1f1('0x12'),_0x136d59,JSON['stringify'](_0x11d8c1));_0x4d6c11(_0x11d8c1);})[_0xa1f1('0x11')](function(_0x174ebe){logger[_0xa1f1('0xf')](_0xa1f1('0x12'),_0x174ebe[_0xa1f1('0x10')],_0x136d59);_0x1cd3e8(_0x33b2f0[_0xa1f1('0xf')](0x1f4,_0x174ebe[_0xa1f1('0x10')]));});});}; \ No newline at end of file +var _0x1753=['SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1753,0x8b));var _0x3175=function(_0x5722a4,_0x3410c6){_0x5722a4=_0x5722a4-0x0;var _0x431ce4=_0x1753[_0x5722a4];return _0x431ce4;};'use strict';var _=require(_0x3175('0x0'));var util=require(_0x3175('0x1'));var moment=require(_0x3175('0x2'));var BPromise=require(_0x3175('0x3'));var rs=require(_0x3175('0x4'));var fs=require('fs');var Redis=require(_0x3175('0x5'));var db=require(_0x3175('0x6'))['db'];var utils=require(_0x3175('0x7'));var logger=require(_0x3175('0x8'))('rpc');var config=require(_0x3175('0x9'));var jayson=require(_0x3175('0xa'));var client=jayson[_0x3175('0xb')][_0x3175('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x414c69,_0x4abcb5,_0x5d1c51){return new BPromise(function(_0x412a93,_0x58f5c8){return client[_0x3175('0xd')](_0x414c69,_0x5d1c51)[_0x3175('0xe')](function(_0x442d2a){logger[_0x3175('0xf')](_0x3175('0x10'),_0x4abcb5,_0x3175('0x11'));logger['debug'](_0x3175('0x12'),_0x4abcb5,_0x3175('0x11'),JSON[_0x3175('0x13')](_0x442d2a));if(_0x442d2a['error']){if(_0x442d2a[_0x3175('0x14')][_0x3175('0x15')]===0x1f4){logger[_0x3175('0x14')](_0x3175('0x10'),_0x4abcb5,_0x442d2a[_0x3175('0x14')][_0x3175('0x16')]);return _0x58f5c8(_0x442d2a[_0x3175('0x14')]['message']);}logger[_0x3175('0x14')](_0x3175('0x10'),_0x4abcb5,_0x442d2a[_0x3175('0x14')][_0x3175('0x16')]);return _0x412a93(_0x442d2a[_0x3175('0x14')][_0x3175('0x16')]);}else{logger['info'](_0x3175('0x10'),_0x4abcb5,_0x3175('0x11'));_0x412a93(_0x442d2a[_0x3175('0x17')][_0x3175('0x16')]);}})[_0x3175('0x18')](function(_0x54ae1f){logger[_0x3175('0x14')]('SquareMessage,\x20%s,\x20%s',_0x4abcb5,_0x54ae1f);_0x58f5c8(_0x54ae1f);});});}exports[_0x3175('0x19')]=function(_0x1f484a){var _0x3bd61c=this;return new Promise(function(_0x1239cb,_0x245457){return db[_0x3175('0x1a')]['create'](_0x1f484a[_0x3175('0x1b')],{'raw':_0x1f484a[_0x3175('0x1c')]?_0x1f484a[_0x3175('0x1c')][_0x3175('0x1d')]===undefined?!![]:![]:!![]})[_0x3175('0xe')](function(_0x40e247){logger[_0x3175('0xf')](_0x3175('0x19'),_0x1f484a);logger[_0x3175('0x1e')](_0x3175('0x19'),_0x1f484a,JSON[_0x3175('0x13')](_0x40e247));_0x1239cb(_0x40e247);})[_0x3175('0x18')](function(_0x28e7b4){logger[_0x3175('0x14')](_0x3175('0x19'),_0x28e7b4[_0x3175('0x16')],_0x1f484a);_0x245457(_0x3bd61c[_0x3175('0x14')](0x1f4,_0x28e7b4['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index ed4bd5b..7cccd21 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 _0x56c8=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','show','/:id/test','test','post','create','put','/:id','destroy'];(function(_0x21c1ee,_0x547d6e){var _0x507f31=function(_0x373f28){while(--_0x373f28){_0x21c1ee['push'](_0x21c1ee['shift']());}};_0x507f31(++_0x547d6e);}(_0x56c8,0x1e6));var _0x856c=function(_0x5f434a,_0x5baad2){_0x5f434a=_0x5f434a-0x0;var _0x431215=_0x56c8[_0x5f434a];return _0x431215;};'use strict';var multer=require(_0x856c('0x0'));var util=require('util');var path=require(_0x856c('0x1'));var timeout=require(_0x856c('0x2'));var express=require('express');var router=express[_0x856c('0x3')]();var fs_extra=require(_0x856c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x856c('0x5'));var config=require(_0x856c('0x6'));var controller=require(_0x856c('0x7'));router[_0x856c('0x8')]('/',auth[_0x856c('0x9')](),controller['index']);router[_0x856c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x856c('0xa')]);router[_0x856c('0x8')](_0x856c('0xb'),auth[_0x856c('0x9')](),timeout('15s'),controller[_0x856c('0xc')]);router[_0x856c('0xd')]('/',auth['isAuthenticated'](),controller[_0x856c('0xe')]);router[_0x856c('0xf')](_0x856c('0x10'),auth[_0x856c('0x9')](),controller['update']);router['delete'](_0x856c('0x10'),auth[_0x856c('0x9')](),controller[_0x856c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x49de=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','post'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0x49de,0xf4));var _0xe49d=function(_0x466186,_0x2276fb){_0x466186=_0x466186-0x0;var _0x1ee9af=_0x49de[_0x466186];return _0x1ee9af;};'use strict';var multer=require(_0xe49d('0x0'));var util=require(_0xe49d('0x1'));var path=require(_0xe49d('0x2'));var timeout=require(_0xe49d('0x3'));var express=require(_0xe49d('0x4'));var router=express['Router']();var fs_extra=require(_0xe49d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe49d('0x6'));var controller=require(_0xe49d('0x7'));router[_0xe49d('0x8')]('/',auth[_0xe49d('0x9')](),controller[_0xe49d('0xa')]);router[_0xe49d('0x8')](_0xe49d('0xb'),auth[_0xe49d('0x9')](),controller[_0xe49d('0xc')]);router[_0xe49d('0x8')](_0xe49d('0xd'),auth[_0xe49d('0x9')](),timeout(_0xe49d('0xe')),controller['test']);router[_0xe49d('0xf')]('/',auth[_0xe49d('0x9')](),controller['create']);router[_0xe49d('0x10')](_0xe49d('0xb'),auth[_0xe49d('0x9')](),controller['update']);router[_0xe49d('0x11')](_0xe49d('0xb'),auth['isAuthenticated'](),controller[_0xe49d('0x12')]);module[_0xe49d('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index fdf955e..784755c 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 _0x18c9=['STRING','name','sequelize','exports'];(function(_0x59b535,_0x27f8b5){var _0x23a505=function(_0x43aadb){while(--_0x43aadb){_0x59b535['push'](_0x59b535['shift']());}};_0x23a505(++_0x27f8b5);}(_0x18c9,0x1ba));var _0x918c=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x18c9[_0x490be3];return _0x3f5140;};'use strict';var Sequelize=require(_0x918c('0x0'));module[_0x918c('0x1')]={'name':{'type':Sequelize[_0x918c('0x2')],'unique':_0x918c('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x918c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x67e0=['STRING','sequelize','exports'];(function(_0x5a1c1b,_0x3e9004){var _0x48b509=function(_0x3d26fb){while(--_0x3d26fb){_0x5a1c1b['push'](_0x5a1c1b['shift']());}};_0x48b509(++_0x3e9004);}(_0x67e0,0x139));var _0x067e=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0x67e0[_0x239786];return _0x3f15e2;};'use strict';var Sequelize=require(_0x067e('0x0'));module[_0x067e('0x1')]={'name':{'type':Sequelize[_0x067e('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x067e('0x2')]},'description':{'type':Sequelize[_0x067e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b8e8335..296421a 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 _0x3934=['SquareOdbc','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','end','stack','name','send','index','map'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x3934,0x18c));var _0x4393=function(_0x55e659,_0x233aa4){_0x55e659=_0x55e659-0x0;var _0xca08c7=_0x3934[_0x55e659];return _0xca08c7;};'use strict';var emlformat=require(_0x4393('0x0'));var rimraf=require(_0x4393('0x1'));var zipdir=require(_0x4393('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4393('0x3'));var moment=require(_0x4393('0x4'));var BPromise=require(_0x4393('0x5'));var Mustache=require(_0x4393('0x6'));var util=require(_0x4393('0x7'));var path=require(_0x4393('0x8'));var sox=require('sox');var csv=require(_0x4393('0x9'));var ejs=require(_0x4393('0xa'));var fs=require('fs');var fs_extra=require(_0x4393('0xb'));var _=require(_0x4393('0xc'));var squel=require(_0x4393('0xd'));var crypto=require(_0x4393('0xe'));var jsforce=require(_0x4393('0xf'));var deskjs=require(_0x4393('0x10'));var toCsv=require(_0x4393('0x9'));var querystring=require(_0x4393('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4393('0x12'));var qs=require(_0x4393('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4393('0x14'));var logger=require(_0x4393('0x15'))(_0x4393('0x16'));var utils=require(_0x4393('0x17'));var config=require(_0x4393('0x18'));var licenseUtil=require(_0x4393('0x19'));var db=require(_0x4393('0x1a'))['db'];function respondWithStatusCode(_0x4c99ce,_0x53cc5e){_0x53cc5e=_0x53cc5e||0xcc;return function(_0x19f225){if(_0x19f225){return _0x4c99ce[_0x4393('0x1b')](_0x53cc5e);}return _0x4c99ce[_0x4393('0x1c')](_0x53cc5e)['end']();};}function respondWithResult(_0xc9e6cc,_0x363500){_0x363500=_0x363500||0xc8;return function(_0x54732f){if(_0x54732f){return _0xc9e6cc[_0x4393('0x1c')](_0x363500)[_0x4393('0x1d')](_0x54732f);}};}function respondWithFilteredResult(_0x2df36a,_0x3275a0){return function(_0x147098){if(_0x147098){var _0x400839=typeof _0x3275a0[_0x4393('0x1e')]==='undefined'&&typeof _0x3275a0[_0x4393('0x1f')]===_0x4393('0x20');var _0x3521a4=_0x147098[_0x4393('0x21')];var _0x5eb836=_0x400839?0x0:_0x3275a0['offset'];var _0x4ed59a=_0x400839?_0x147098[_0x4393('0x21')]:_0x3275a0[_0x4393('0x1e')]+_0x3275a0[_0x4393('0x1f')];var _0x2a7e80;if(_0x4ed59a>=_0x3521a4){_0x4ed59a=_0x3521a4;_0x2a7e80=0xc8;}else{_0x2a7e80=0xce;}_0x2df36a[_0x4393('0x1c')](_0x2a7e80);return _0x2df36a[_0x4393('0x22')](_0x4393('0x23'),_0x5eb836+'-'+_0x4ed59a+'/'+_0x3521a4)[_0x4393('0x1d')](_0x147098);}return null;};}function patchUpdates(_0x4cad02){return function(_0x24b057){try{jsonpatch[_0x4393('0x24')](_0x24b057,_0x4cad02,!![]);}catch(_0x22ec31){return BPromise['reject'](_0x22ec31);}return _0x24b057[_0x4393('0x25')]();};}function saveUpdates(_0x18a727,_0x37c7d8){return function(_0x232e18){if(_0x232e18){return _0x232e18['update'](_0x18a727)[_0x4393('0x26')](function(_0x6aa51f){return _0x6aa51f;});}return null;};}function removeEntity(_0x34985a,_0x582694){return function(_0x1d53da){if(_0x1d53da){return _0x1d53da[_0x4393('0x27')]()[_0x4393('0x26')](function(){var _0x2c28b4=_0x1d53da[_0x4393('0x28')]({'plain':!![]});var _0x595aac=_0x4393('0x29');return db[_0x4393('0x2a')]['destroy']({'where':{'type':_0x595aac,'resourceId':_0x2c28b4['id']}})[_0x4393('0x26')](function(){return _0x1d53da;});})['then'](function(){_0x34985a['status'](0xcc)[_0x4393('0x2b')]();});}};}function handleEntityNotFound(_0x265915,_0x92dab1){return function(_0x4b529d){if(!_0x4b529d){_0x265915[_0x4393('0x1b')](0x194);}return _0x4b529d;};}function handleError(_0x36e300,_0x64e291){_0x64e291=_0x64e291||0x1f4;return function(_0x45b32d){logger['error'](_0x45b32d[_0x4393('0x2c')]);if(_0x45b32d[_0x4393('0x2d')]){delete _0x45b32d['name'];}_0x36e300[_0x4393('0x1c')](_0x64e291)[_0x4393('0x2e')](_0x45b32d);};}exports[_0x4393('0x2f')]=function(_0x1c5af7,_0x10f9c5){var _0xeb80c3={},_0x1433b2={},_0x5e701d={'count':0x0,'rows':[]};var _0x30b52d=_[_0x4393('0x30')](db[_0x4393('0x31')][_0x4393('0x32')],function(_0x1d2f7f){return{'name':_0x1d2f7f[_0x4393('0x33')],'type':_0x1d2f7f[_0x4393('0x34')][_0x4393('0x35')]};});_0x1433b2['model']=_[_0x4393('0x30')](_0x30b52d,_0x4393('0x2d'));_0x1433b2[_0x4393('0x36')]=_['keys'](_0x1c5af7[_0x4393('0x36')]);_0x1433b2[_0x4393('0x37')]=_['intersection'](_0x1433b2[_0x4393('0x38')],_0x1433b2['query']);_0xeb80c3[_0x4393('0x39')]=_[_0x4393('0x3a')](_0x1433b2[_0x4393('0x38')],qs[_0x4393('0x3b')](_0x1c5af7[_0x4393('0x36')]['fields']));_0xeb80c3[_0x4393('0x39')]=_0xeb80c3[_0x4393('0x39')][_0x4393('0x3c')]?_0xeb80c3[_0x4393('0x39')]:_0x1433b2[_0x4393('0x38')];if(!_0x1c5af7['query']['hasOwnProperty'](_0x4393('0x3d'))){_0xeb80c3[_0x4393('0x1f')]=qs['limit'](_0x1c5af7[_0x4393('0x36')]['limit']);_0xeb80c3['offset']=qs[_0x4393('0x1e')](_0x1c5af7[_0x4393('0x36')]['offset']);}_0xeb80c3['order']=qs[_0x4393('0x3e')](_0x1c5af7[_0x4393('0x36')]['sort']);_0xeb80c3[_0x4393('0x3f')]=qs[_0x4393('0x37')](_[_0x4393('0x40')](_0x1c5af7[_0x4393('0x36')],_0x1433b2[_0x4393('0x37')]),_0x30b52d);if(_0x1c5af7[_0x4393('0x36')]['filter']){_0xeb80c3[_0x4393('0x3f')]=_['merge'](_0xeb80c3[_0x4393('0x3f')],{'$or':_[_0x4393('0x30')](_0x30b52d,function(_0x18e5a9){if(_0x18e5a9['type']!==_0x4393('0x41')){var _0x542723={};_0x542723[_0x18e5a9[_0x4393('0x2d')]]={'$like':'%'+_0x1c5af7['query'][_0x4393('0x42')]+'%'};return _0x542723;}})});}_0xeb80c3=_['merge']({},_0xeb80c3,_0x1c5af7[_0x4393('0x43')]);var _0x344826={'where':_0xeb80c3[_0x4393('0x3f')]};return db[_0x4393('0x31')][_0x4393('0x21')](_0x344826)[_0x4393('0x26')](function(_0x1d5de0){_0x5e701d[_0x4393('0x21')]=_0x1d5de0;if(_0x1c5af7[_0x4393('0x36')][_0x4393('0x44')]){_0xeb80c3[_0x4393('0x45')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0xeb80c3);})[_0x4393('0x26')](function(_0x1acfaf){_0x5e701d[_0x4393('0x46')]=_0x1acfaf;return _0x5e701d;})[_0x4393('0x26')](respondWithFilteredResult(_0x10f9c5,_0xeb80c3))[_0x4393('0x47')](handleError(_0x10f9c5,null));};exports[_0x4393('0x48')]=function(_0x2b3696,_0x5b9b5e){var _0x4fa397={'raw':!![],'where':{'id':_0x2b3696[_0x4393('0x49')]['id']}},_0x29ce5d={};_0x29ce5d[_0x4393('0x38')]=_['keys'](db[_0x4393('0x31')][_0x4393('0x32')]);_0x29ce5d[_0x4393('0x36')]=_[_0x4393('0x4a')](_0x2b3696[_0x4393('0x36')]);_0x29ce5d['filters']=_[_0x4393('0x3a')](_0x29ce5d['model'],_0x29ce5d[_0x4393('0x36')]);_0x4fa397[_0x4393('0x39')]=_['intersection'](_0x29ce5d['model'],qs[_0x4393('0x3b')](_0x2b3696[_0x4393('0x36')][_0x4393('0x3b')]));_0x4fa397[_0x4393('0x39')]=_0x4fa397[_0x4393('0x39')][_0x4393('0x3c')]?_0x4fa397[_0x4393('0x39')]:_0x29ce5d[_0x4393('0x38')];if(_0x2b3696['query'][_0x4393('0x44')]){_0x4fa397[_0x4393('0x45')]=[{'all':!![]}];}_0x4fa397=_[_0x4393('0x4b')]({},_0x4fa397,_0x2b3696['options']);return db['SquareOdbc'][_0x4393('0x4c')](_0x4fa397)[_0x4393('0x26')](handleEntityNotFound(_0x5b9b5e,null))[_0x4393('0x26')](respondWithResult(_0x5b9b5e,null))[_0x4393('0x47')](handleError(_0x5b9b5e,null));};exports[_0x4393('0x4d')]=function(_0x397582,_0x327da9){return db[_0x4393('0x31')][_0x4393('0x4d')](_0x397582[_0x4393('0x4e')],{})['then'](function(_0x5946f0){var _0x2cd1a4=_0x397582['user'][_0x4393('0x28')]({'plain':!![]});if(!_0x2cd1a4)throw new Error(_0x4393('0x4f'));if(_0x2cd1a4[_0x4393('0x50')]===_0x4393('0x51')){var _0x1f54ee=_0x5946f0[_0x4393('0x28')]({'plain':!![]});var _0x50007b=_0x4393('0x29');return db[_0x4393('0x52')][_0x4393('0x4c')]({'where':{'name':_0x50007b,'userProfileId':_0x2cd1a4['userProfileId']},'raw':!![]})[_0x4393('0x26')](function(_0x2b41cf){if(_0x2b41cf&&_0x2b41cf[_0x4393('0x53')]===0x0){return db[_0x4393('0x2a')][_0x4393('0x4d')]({'name':_0x1f54ee[_0x4393('0x2d')],'resourceId':_0x1f54ee['id'],'type':_0x2b41cf[_0x4393('0x2d')],'sectionId':_0x2b41cf['id']},{})[_0x4393('0x26')](function(){return _0x5946f0;});}else{return _0x5946f0;}})[_0x4393('0x47')](function(_0x3c8e64){logger['error'](_0x4393('0x54'),_0x3c8e64);throw _0x3c8e64;});}return _0x5946f0;})[_0x4393('0x26')](respondWithResult(_0x327da9,0xc9))['catch'](handleError(_0x327da9,null));};exports[_0x4393('0x55')]=function(_0x1e38d2,_0x309083){if(_0x1e38d2[_0x4393('0x4e')]['id']){delete _0x1e38d2[_0x4393('0x4e')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x1e38d2[_0x4393('0x49')]['id']}})['then'](handleEntityNotFound(_0x309083,null))['then'](saveUpdates(_0x1e38d2[_0x4393('0x4e')],null))[_0x4393('0x26')](respondWithResult(_0x309083,null))[_0x4393('0x47')](handleError(_0x309083,null));};exports[_0x4393('0x27')]=function(_0x3a614a,_0x584eda){return db[_0x4393('0x31')][_0x4393('0x4c')]({'where':{'id':_0x3a614a['params']['id']}})[_0x4393('0x26')](handleEntityNotFound(_0x584eda,null))[_0x4393('0x26')](removeEntity(_0x584eda,null))[_0x4393('0x47')](handleError(_0x584eda,null));};exports['test']=function(_0xacb871,_0x28fb97,_0x5f6e5a){var _0x447015;return db[_0x4393('0x31')]['find']({'where':{'id':_0xacb871['params']['id']},'attributes':['id',_0x4393('0x56')]})[_0x4393('0x26')](handleEntityNotFound(_0x28fb97,null))[_0x4393('0x26')](function(_0x31cc71){if(_0x31cc71){var _0x4d7808=require(_0x4393('0x57'))();_0x4d7808['openSync'](_0x31cc71[_0x4393('0x56')]);_0x4d7808[_0x4393('0x58')]();return _0x31cc71;}})[_0x4393('0x26')](respondWithResult(_0x28fb97,null))[_0x4393('0x47')](handleError(_0x28fb97,null));}; \ No newline at end of file +var _0x8eb0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','ODBC','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','key','map','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','include','findAll','rows','show','merge','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','params','test','dsn','odbc','openSync','closeSync','rimraf'];(function(_0x1bfdb1,_0x132a27){var _0x2f15e9=function(_0x43f810){while(--_0x43f810){_0x1bfdb1['push'](_0x1bfdb1['shift']());}};_0x2f15e9(++_0x132a27);}(_0x8eb0,0x1bc));var _0x08eb=function(_0x2486be,_0x5d7dd2){_0x2486be=_0x2486be-0x0;var _0x24042b=_0x8eb0[_0x2486be];return _0x24042b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08eb('0x0'));var zipdir=require(_0x08eb('0x1'));var jsonpatch=require(_0x08eb('0x2'));var rp=require(_0x08eb('0x3'));var moment=require(_0x08eb('0x4'));var BPromise=require(_0x08eb('0x5'));var Mustache=require(_0x08eb('0x6'));var util=require(_0x08eb('0x7'));var path=require(_0x08eb('0x8'));var sox=require(_0x08eb('0x9'));var csv=require(_0x08eb('0xa'));var ejs=require(_0x08eb('0xb'));var fs=require('fs');var fs_extra=require(_0x08eb('0xc'));var _=require('lodash');var squel=require(_0x08eb('0xd'));var crypto=require(_0x08eb('0xe'));var jsforce=require(_0x08eb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08eb('0x10'));var Papa=require(_0x08eb('0x11'));var Redis=require(_0x08eb('0x12'));var authService=require(_0x08eb('0x13'));var qs=require(_0x08eb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08eb('0x15'));var logger=require(_0x08eb('0x16'))(_0x08eb('0x17'));var utils=require('../../config/utils');var config=require(_0x08eb('0x18'));var licenseUtil=require(_0x08eb('0x19'));var db=require(_0x08eb('0x1a'))['db'];function respondWithStatusCode(_0x327d67,_0x31d7e5){_0x31d7e5=_0x31d7e5||0xcc;return function(_0x53f19b){if(_0x53f19b){return _0x327d67[_0x08eb('0x1b')](_0x31d7e5);}return _0x327d67[_0x08eb('0x1c')](_0x31d7e5)[_0x08eb('0x1d')]();};}function respondWithResult(_0x37f374,_0x111812){_0x111812=_0x111812||0xc8;return function(_0x43a2ea){if(_0x43a2ea){return _0x37f374['status'](_0x111812)[_0x08eb('0x1e')](_0x43a2ea);}};}function respondWithFilteredResult(_0x2546bb,_0x214ada){return function(_0x43e5cc){if(_0x43e5cc){var _0x499825=typeof _0x214ada['offset']==='undefined'&&typeof _0x214ada[_0x08eb('0x1f')]===_0x08eb('0x20');var _0x2df2a6=_0x43e5cc[_0x08eb('0x21')];var _0x4c3c32=_0x499825?0x0:_0x214ada[_0x08eb('0x22')];var _0x1a66b1=_0x499825?_0x43e5cc['count']:_0x214ada[_0x08eb('0x22')]+_0x214ada[_0x08eb('0x1f')];var _0x2e5f16;if(_0x1a66b1>=_0x2df2a6){_0x1a66b1=_0x2df2a6;_0x2e5f16=0xc8;}else{_0x2e5f16=0xce;}_0x2546bb[_0x08eb('0x1c')](_0x2e5f16);return _0x2546bb[_0x08eb('0x23')](_0x08eb('0x24'),_0x4c3c32+'-'+_0x1a66b1+'/'+_0x2df2a6)[_0x08eb('0x1e')](_0x43e5cc);}return null;};}function patchUpdates(_0x509b56){return function(_0x1679c9){try{jsonpatch[_0x08eb('0x25')](_0x1679c9,_0x509b56,!![]);}catch(_0x36b807){return BPromise[_0x08eb('0x26')](_0x36b807);}return _0x1679c9['save']();};}function saveUpdates(_0x3044a5,_0x26a7b5){return function(_0x158c9a){if(_0x158c9a){return _0x158c9a[_0x08eb('0x27')](_0x3044a5)[_0x08eb('0x28')](function(_0x1eb4b9){return _0x1eb4b9;});}return null;};}function removeEntity(_0x20178d,_0x1ffb51){return function(_0x20865f){if(_0x20865f){return _0x20865f[_0x08eb('0x29')]()[_0x08eb('0x28')](function(){var _0x465e02=_0x20865f[_0x08eb('0x2a')]({'plain':!![]});var _0x282c7c=_0x08eb('0x2b');return db['UserProfileResource'][_0x08eb('0x29')]({'where':{'type':_0x282c7c,'resourceId':_0x465e02['id']}})[_0x08eb('0x28')](function(){return _0x20865f;});})[_0x08eb('0x28')](function(){_0x20178d[_0x08eb('0x1c')](0xcc)[_0x08eb('0x1d')]();});}};}function handleEntityNotFound(_0x1e761c,_0x4eed20){return function(_0x58c60a){if(!_0x58c60a){_0x1e761c['sendStatus'](0x194);}return _0x58c60a;};}function handleError(_0x4346e9,_0x2f2671){_0x2f2671=_0x2f2671||0x1f4;return function(_0x5cef1b){logger['error'](_0x5cef1b[_0x08eb('0x2c')]);if(_0x5cef1b['name']){delete _0x5cef1b[_0x08eb('0x2d')];}_0x4346e9[_0x08eb('0x1c')](_0x2f2671)[_0x08eb('0x2e')](_0x5cef1b);};}exports['index']=function(_0x4f5e2b,_0x595fee){var _0x2fa7b6={},_0x350eb1={},_0x44836c={'count':0x0,'rows':[]};var _0x2cffc1=_['map'](db[_0x08eb('0x2f')][_0x08eb('0x30')],function(_0x1220b5){return{'name':_0x1220b5[_0x08eb('0x31')],'type':_0x1220b5[_0x08eb('0x32')][_0x08eb('0x33')]};});_0x350eb1['model']=_[_0x08eb('0x34')](_0x2cffc1,_0x08eb('0x2d'));_0x350eb1['query']=_[_0x08eb('0x35')](_0x4f5e2b[_0x08eb('0x36')]);_0x350eb1[_0x08eb('0x37')]=_['intersection'](_0x350eb1[_0x08eb('0x38')],_0x350eb1[_0x08eb('0x36')]);_0x2fa7b6['attributes']=_[_0x08eb('0x39')](_0x350eb1[_0x08eb('0x38')],qs[_0x08eb('0x3a')](_0x4f5e2b['query']['fields']));_0x2fa7b6[_0x08eb('0x3b')]=_0x2fa7b6[_0x08eb('0x3b')][_0x08eb('0x3c')]?_0x2fa7b6[_0x08eb('0x3b')]:_0x350eb1[_0x08eb('0x38')];if(!_0x4f5e2b[_0x08eb('0x36')][_0x08eb('0x3d')]('nolimit')){_0x2fa7b6['limit']=qs[_0x08eb('0x1f')](_0x4f5e2b[_0x08eb('0x36')]['limit']);_0x2fa7b6['offset']=qs[_0x08eb('0x22')](_0x4f5e2b[_0x08eb('0x36')][_0x08eb('0x22')]);}_0x2fa7b6['order']=qs['sort'](_0x4f5e2b['query'][_0x08eb('0x3e')]);_0x2fa7b6[_0x08eb('0x3f')]=qs[_0x08eb('0x37')](_['pick'](_0x4f5e2b['query'],_0x350eb1[_0x08eb('0x37')]),_0x2cffc1);if(_0x4f5e2b[_0x08eb('0x36')][_0x08eb('0x40')]){_0x2fa7b6[_0x08eb('0x3f')]=_['merge'](_0x2fa7b6[_0x08eb('0x3f')],{'$or':_[_0x08eb('0x34')](_0x2cffc1,function(_0x39096e){if(_0x39096e[_0x08eb('0x32')]!==_0x08eb('0x41')){var _0x552721={};_0x552721[_0x39096e[_0x08eb('0x2d')]]={'$like':'%'+_0x4f5e2b[_0x08eb('0x36')][_0x08eb('0x40')]+'%'};return _0x552721;}})});}_0x2fa7b6=_['merge']({},_0x2fa7b6,_0x4f5e2b['options']);var _0x39bc53={'where':_0x2fa7b6[_0x08eb('0x3f')]};return db[_0x08eb('0x2f')]['count'](_0x39bc53)[_0x08eb('0x28')](function(_0x1e4aec){_0x44836c[_0x08eb('0x21')]=_0x1e4aec;if(_0x4f5e2b[_0x08eb('0x36')]['includeAll']){_0x2fa7b6[_0x08eb('0x42')]=[{'all':!![]}];}return db[_0x08eb('0x2f')][_0x08eb('0x43')](_0x2fa7b6);})[_0x08eb('0x28')](function(_0x2ab8c3){_0x44836c[_0x08eb('0x44')]=_0x2ab8c3;return _0x44836c;})[_0x08eb('0x28')](respondWithFilteredResult(_0x595fee,_0x2fa7b6))['catch'](handleError(_0x595fee,null));};exports[_0x08eb('0x45')]=function(_0x22d5a3,_0x2c6e2d){var _0x254c82={'raw':!![],'where':{'id':_0x22d5a3['params']['id']}},_0xa44bd8={};_0xa44bd8[_0x08eb('0x38')]=_[_0x08eb('0x35')](db['SquareOdbc'][_0x08eb('0x30')]);_0xa44bd8[_0x08eb('0x36')]=_['keys'](_0x22d5a3[_0x08eb('0x36')]);_0xa44bd8[_0x08eb('0x37')]=_['intersection'](_0xa44bd8[_0x08eb('0x38')],_0xa44bd8['query']);_0x254c82[_0x08eb('0x3b')]=_[_0x08eb('0x39')](_0xa44bd8[_0x08eb('0x38')],qs['fields'](_0x22d5a3['query'][_0x08eb('0x3a')]));_0x254c82['attributes']=_0x254c82[_0x08eb('0x3b')][_0x08eb('0x3c')]?_0x254c82['attributes']:_0xa44bd8[_0x08eb('0x38')];if(_0x22d5a3[_0x08eb('0x36')]['includeAll']){_0x254c82['include']=[{'all':!![]}];}_0x254c82=_[_0x08eb('0x46')]({},_0x254c82,_0x22d5a3[_0x08eb('0x47')]);return db['SquareOdbc'][_0x08eb('0x48')](_0x254c82)[_0x08eb('0x28')](handleEntityNotFound(_0x2c6e2d,null))['then'](respondWithResult(_0x2c6e2d,null))[_0x08eb('0x49')](handleError(_0x2c6e2d,null));};exports['create']=function(_0x105a65,_0x1b1bd2){return db[_0x08eb('0x2f')][_0x08eb('0x4a')](_0x105a65['body'],{})['then'](function(_0x4372fc){var _0x38a29f=_0x105a65['user'][_0x08eb('0x2a')]({'plain':!![]});if(!_0x38a29f)throw new Error(_0x08eb('0x4b'));if(_0x38a29f[_0x08eb('0x4c')]===_0x08eb('0x4d')){var _0x3e310a=_0x4372fc['get']({'plain':!![]});var _0x4790ba=_0x08eb('0x2b');return db[_0x08eb('0x4e')][_0x08eb('0x48')]({'where':{'name':_0x4790ba,'userProfileId':_0x38a29f[_0x08eb('0x4f')]},'raw':!![]})[_0x08eb('0x28')](function(_0x1189d8){if(_0x1189d8&&_0x1189d8[_0x08eb('0x50')]===0x0){return db[_0x08eb('0x51')][_0x08eb('0x4a')]({'name':_0x3e310a[_0x08eb('0x2d')],'resourceId':_0x3e310a['id'],'type':_0x1189d8[_0x08eb('0x2d')],'sectionId':_0x1189d8['id']},{})['then'](function(){return _0x4372fc;});}else{return _0x4372fc;}})[_0x08eb('0x49')](function(_0x22d359){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22d359);throw _0x22d359;});}return _0x4372fc;})[_0x08eb('0x28')](respondWithResult(_0x1b1bd2,0xc9))['catch'](handleError(_0x1b1bd2,null));};exports[_0x08eb('0x27')]=function(_0x594142,_0x2e1838){if(_0x594142[_0x08eb('0x52')]['id']){delete _0x594142[_0x08eb('0x52')]['id'];}return db[_0x08eb('0x2f')][_0x08eb('0x48')]({'where':{'id':_0x594142[_0x08eb('0x53')]['id']}})[_0x08eb('0x28')](handleEntityNotFound(_0x2e1838,null))['then'](saveUpdates(_0x594142['body'],null))[_0x08eb('0x28')](respondWithResult(_0x2e1838,null))[_0x08eb('0x49')](handleError(_0x2e1838,null));};exports[_0x08eb('0x29')]=function(_0x58b6ec,_0x438bf5){return db[_0x08eb('0x2f')][_0x08eb('0x48')]({'where':{'id':_0x58b6ec[_0x08eb('0x53')]['id']}})[_0x08eb('0x28')](handleEntityNotFound(_0x438bf5,null))[_0x08eb('0x28')](removeEntity(_0x438bf5,null))[_0x08eb('0x49')](handleError(_0x438bf5,null));};exports[_0x08eb('0x54')]=function(_0x161839,_0x466f91,_0x4c09ee){var _0x16bb29;return db[_0x08eb('0x2f')][_0x08eb('0x48')]({'where':{'id':_0x161839[_0x08eb('0x53')]['id']},'attributes':['id',_0x08eb('0x55')]})['then'](handleEntityNotFound(_0x466f91,null))[_0x08eb('0x28')](function(_0x90294f){if(_0x90294f){var _0x511fe9=require(_0x08eb('0x56'))();_0x511fe9[_0x08eb('0x57')](_0x90294f[_0x08eb('0x55')]);_0x511fe9[_0x08eb('0x58')]();return _0x90294f;}})['then'](respondWithResult(_0x466f91,null))[_0x08eb('0x49')](handleError(_0x466f91,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0a3d1fb..00dd8e6 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 _0x8289=['define','SquareOdbc','square_odbc','lodash','../../config/logger','moment','bluebird','path','rimraf','./squareOdbc.attributes','exports'];(function(_0x4cc828,_0x53403e){var _0x233e7e=function(_0x34589d){while(--_0x34589d){_0x4cc828['push'](_0x4cc828['shift']());}};_0x233e7e(++_0x53403e);}(_0x8289,0x1bb));var _0x9828=function(_0x630c98,_0x515c64){_0x630c98=_0x630c98-0x0;var _0x8ce66f=_0x8289[_0x630c98];return _0x8ce66f;};'use strict';var _=require(_0x9828('0x0'));var util=require('util');var logger=require(_0x9828('0x1'))('api');var moment=require(_0x9828('0x2'));var BPromise=require(_0x9828('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9828('0x4'));var rimraf=require(_0x9828('0x5'));var config=require('../../config/environment');var attributes=require(_0x9828('0x6'));module[_0x9828('0x7')]=function(_0x6b71cb,_0x53b41c){return _0x6b71cb[_0x9828('0x8')](_0x9828('0x9'),attributes,{'tableName':_0x9828('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6765=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','square_odbc','lodash'];(function(_0x2104a9,_0x2a3d5c){var _0x391bea=function(_0x90742c){while(--_0x90742c){_0x2104a9['push'](_0x2104a9['shift']());}};_0x391bea(++_0x2a3d5c);}(_0x6765,0x10d));var _0x5676=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x6765[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x5676('0x0'));var util=require(_0x5676('0x1'));var logger=require(_0x5676('0x2'))(_0x5676('0x3'));var moment=require('moment');var BPromise=require(_0x5676('0x4'));var rp=require(_0x5676('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5676('0x6'));var config=require(_0x5676('0x7'));var attributes=require(_0x5676('0x8'));module['exports']=function(_0x849350,_0x1a72fa){return _0x849350['define']('SquareOdbc',attributes,{'tableName':_0x5676('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index e8bff38..3974056 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 _0xa96d=['stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','request\x20sent','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','lodash','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xa96d,0x17c));var _0xda96=function(_0x241207,_0x39a50c){_0x241207=_0x241207-0x0;var _0x26f4ce=_0xa96d[_0x241207];return _0x26f4ce;};'use strict';var _=require(_0xda96('0x0'));var util=require('util');var moment=require(_0xda96('0x1'));var BPromise=require('bluebird');var rs=require(_0xda96('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xda96('0x3'));var logger=require('../../config/logger')(_0xda96('0x4'));var config=require('../../config/environment');var jayson=require(_0xda96('0x5'));var client=jayson[_0xda96('0x6')][_0xda96('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e2de9,_0x38178d,_0x23814f){return new BPromise(function(_0x312d01,_0x17885c){return client[_0xda96('0x8')](_0x1e2de9,_0x23814f)[_0xda96('0x9')](function(_0x2e23c2){logger[_0xda96('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x38178d,'request\x20sent');logger['debug'](_0xda96('0xb'),_0x38178d,'request\x20sent',JSON[_0xda96('0xc')](_0x2e23c2));if(_0x2e23c2[_0xda96('0xd')]){if(_0x2e23c2[_0xda96('0xd')][_0xda96('0xe')]===0x1f4){logger['error'](_0xda96('0xf'),_0x38178d,_0x2e23c2['error'][_0xda96('0x10')]);return _0x17885c(_0x2e23c2[_0xda96('0xd')]['message']);}logger[_0xda96('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x38178d,_0x2e23c2[_0xda96('0xd')][_0xda96('0x10')]);return _0x312d01(_0x2e23c2[_0xda96('0xd')][_0xda96('0x10')]);}else{logger[_0xda96('0xa')](_0xda96('0xf'),_0x38178d,_0xda96('0x11'));_0x312d01(_0x2e23c2['result'][_0xda96('0x10')]);}})['catch'](function(_0x89eefc){logger['error'](_0xda96('0xf'),_0x38178d,_0x89eefc);_0x17885c(_0x89eefc);});});}exports[_0xda96('0x12')]=function(_0x3de6aa){var _0x2bc6db=this;return new Promise(function(_0x499930,_0x33daed){return db[_0xda96('0x13')][_0xda96('0x14')]({'raw':_0x3de6aa['options']?_0x3de6aa[_0xda96('0x15')][_0xda96('0x16')]===undefined?!![]:![]:!![],'where':_0x3de6aa[_0xda96('0x15')]?_0x3de6aa[_0xda96('0x15')][_0xda96('0x17')]||null:null,'attributes':_0x3de6aa['options']?_0x3de6aa[_0xda96('0x15')][_0xda96('0x18')]||null:null,'include':_0x3de6aa[_0xda96('0x15')]?_0x3de6aa[_0xda96('0x15')]['include']?_[_0xda96('0x19')](_0x3de6aa[_0xda96('0x15')][_0xda96('0x1a')],function(_0x2b4032){return{'model':db[_0x2b4032['model']],'as':_0x2b4032['as'],'attributes':_0x2b4032['attributes'],'include':_0x2b4032['include']?_[_0xda96('0x19')](_0x2b4032[_0xda96('0x1a')],function(_0x4ebac2){return{'model':db[_0x4ebac2[_0xda96('0x1b')]],'as':_0x4ebac2['as'],'attributes':_0x4ebac2[_0xda96('0x18')],'include':_0x4ebac2[_0xda96('0x1a')]?_[_0xda96('0x19')](_0x4ebac2[_0xda96('0x1a')],function(_0xf225f){return{'model':db[_0xf225f[_0xda96('0x1b')]],'as':_0xf225f['as'],'attributes':_0xf225f['attributes']};}):[]};}):[]};}):[]:[]})[_0xda96('0x9')](function(_0x50d3eb){logger[_0xda96('0xa')](_0xda96('0x12'),_0x3de6aa);logger['debug'](_0xda96('0x12'),_0x3de6aa,JSON[_0xda96('0xc')](_0x50d3eb));_0x499930(_0x50d3eb);})['catch'](function(_0x41b456){logger['error'](_0xda96('0x12'),_0x41b456[_0xda96('0x10')],_0x3de6aa);_0x33daed(_0x2bc6db['error'](0x1f4,_0x41b456[_0xda96('0x10')]));});});}; \ No newline at end of file +var _0x5a5f=['request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareOdbc','options','where','include','map','model','attributes','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1e24ce,_0x3d22ba){var _0x4b91af=function(_0xafbe36){while(--_0xafbe36){_0x1e24ce['push'](_0x1e24ce['shift']());}};_0x4b91af(++_0x3d22ba);}(_0x5a5f,0x1a1));var _0xf5a5=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0x5a5f[_0x1b2422];return _0x376573;};'use strict';var _=require(_0xf5a5('0x0'));var util=require(_0xf5a5('0x1'));var moment=require(_0xf5a5('0x2'));var BPromise=require(_0xf5a5('0x3'));var rs=require(_0xf5a5('0x4'));var fs=require('fs');var Redis=require(_0xf5a5('0x5'));var db=require(_0xf5a5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5a5('0x7'))('rpc');var config=require(_0xf5a5('0x8'));var jayson=require(_0xf5a5('0x9'));var client=jayson[_0xf5a5('0xa')][_0xf5a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd5a91,_0x3e0823,_0x1c5ebb){return new BPromise(function(_0x1535de,_0x4ff3b8){return client[_0xf5a5('0xc')](_0xd5a91,_0x1c5ebb)[_0xf5a5('0xd')](function(_0x4810c0){logger['info'](_0xf5a5('0xe'),_0x3e0823,_0xf5a5('0xf'));logger[_0xf5a5('0x10')](_0xf5a5('0x11'),_0x3e0823,'request\x20sent',JSON[_0xf5a5('0x12')](_0x4810c0));if(_0x4810c0['error']){if(_0x4810c0[_0xf5a5('0x13')][_0xf5a5('0x14')]===0x1f4){logger[_0xf5a5('0x13')](_0xf5a5('0xe'),_0x3e0823,_0x4810c0['error'][_0xf5a5('0x15')]);return _0x4ff3b8(_0x4810c0[_0xf5a5('0x13')][_0xf5a5('0x15')]);}logger[_0xf5a5('0x13')](_0xf5a5('0xe'),_0x3e0823,_0x4810c0[_0xf5a5('0x13')][_0xf5a5('0x15')]);return _0x1535de(_0x4810c0['error'][_0xf5a5('0x15')]);}else{logger[_0xf5a5('0x16')](_0xf5a5('0xe'),_0x3e0823,'request\x20sent');_0x1535de(_0x4810c0[_0xf5a5('0x17')][_0xf5a5('0x15')]);}})[_0xf5a5('0x18')](function(_0x119e8f){logger['error'](_0xf5a5('0xe'),_0x3e0823,_0x119e8f);_0x4ff3b8(_0x119e8f);});});}exports['ShowSquareOdbc']=function(_0x10baab){var _0x30c133=this;return new Promise(function(_0x30bea9,_0x30fd34){return db[_0xf5a5('0x19')]['find']({'raw':_0x10baab['options']?_0x10baab[_0xf5a5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x10baab[_0xf5a5('0x1a')]?_0x10baab[_0xf5a5('0x1a')][_0xf5a5('0x1b')]||null:null,'attributes':_0x10baab[_0xf5a5('0x1a')]?_0x10baab[_0xf5a5('0x1a')]['attributes']||null:null,'include':_0x10baab['options']?_0x10baab[_0xf5a5('0x1a')][_0xf5a5('0x1c')]?_[_0xf5a5('0x1d')](_0x10baab[_0xf5a5('0x1a')][_0xf5a5('0x1c')],function(_0x5d0eae){return{'model':db[_0x5d0eae[_0xf5a5('0x1e')]],'as':_0x5d0eae['as'],'attributes':_0x5d0eae[_0xf5a5('0x1f')],'include':_0x5d0eae[_0xf5a5('0x1c')]?_['map'](_0x5d0eae['include'],function(_0xfd843d){return{'model':db[_0xfd843d['model']],'as':_0xfd843d['as'],'attributes':_0xfd843d[_0xf5a5('0x1f')],'include':_0xfd843d[_0xf5a5('0x1c')]?_[_0xf5a5('0x1d')](_0xfd843d[_0xf5a5('0x1c')],function(_0x26b6e3){return{'model':db[_0x26b6e3['model']],'as':_0x26b6e3['as'],'attributes':_0x26b6e3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1131ca){logger[_0xf5a5('0x16')](_0xf5a5('0x20'),_0x10baab);logger['debug'](_0xf5a5('0x20'),_0x10baab,JSON['stringify'](_0x1131ca));_0x30bea9(_0x1131ca);})[_0xf5a5('0x18')](function(_0x57b4c0){logger[_0xf5a5('0x13')]('ShowSquareOdbc',_0x57b4c0[_0xf5a5('0x15')],_0x10baab);_0x30fd34(_0x30c133['error'](0x1f4,_0x57b4c0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 05670d4..ac48831 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 _0x8893=['show','/:id/users','getUsers','post','create','addUsers','put','delete','/:id','destroy','removeUsers','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x8893,0x1ae));var _0x3889=function(_0x3241a3,_0x3b91ab){_0x3241a3=_0x3241a3-0x0;var _0x230e35=_0x8893[_0x3241a3];return _0x230e35;};'use strict';var multer=require('multer');var util=require(_0x3889('0x0'));var path=require(_0x3889('0x1'));var timeout=require(_0x3889('0x2'));var express=require('express');var router=express[_0x3889('0x3')]();var fs_extra=require(_0x3889('0x4'));var auth=require(_0x3889('0x5'));var interaction=require(_0x3889('0x6'));var config=require('../../config/environment');var controller=require(_0x3889('0x7'));router[_0x3889('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3889('0x8')]('/:id',auth[_0x3889('0x9')](),controller[_0x3889('0xa')]);router[_0x3889('0x8')](_0x3889('0xb'),auth['isAuthenticated'](),controller[_0x3889('0xc')]);router[_0x3889('0xd')]('/',auth['isAuthenticated'](),controller[_0x3889('0xe')]);router['post'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0xf')]);router[_0x3889('0x10')]('/:id',auth[_0x3889('0x9')](),controller['update']);router[_0x3889('0x11')](_0x3889('0x12'),auth[_0x3889('0x9')](),controller[_0x3889('0x13')]);router['delete'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0x14')]);module[_0x3889('0x15')]=router; \ No newline at end of file +var _0x0e3b=['addUsers','put','/:id','update','delete','removeUsers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/users','getUsers','create','post'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0e3b,0x125));var _0xb0e3=function(_0x266703,_0x120c3b){_0x266703=_0x266703-0x0;var _0x37d275=_0x0e3b[_0x266703];return _0x37d275;};'use strict';var multer=require(_0xb0e3('0x0'));var util=require(_0xb0e3('0x1'));var path=require(_0xb0e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0e3('0x3'));var router=express[_0xb0e3('0x4')]();var fs_extra=require(_0xb0e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb0e3('0x6'));var config=require(_0xb0e3('0x7'));var controller=require('./squareProject.controller');router[_0xb0e3('0x8')]('/',auth[_0xb0e3('0x9')](),controller[_0xb0e3('0xa')]);router[_0xb0e3('0x8')]('/:id',auth[_0xb0e3('0x9')](),controller['show']);router[_0xb0e3('0x8')](_0xb0e3('0xb'),auth[_0xb0e3('0x9')](),controller[_0xb0e3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0e3('0xd')]);router[_0xb0e3('0xe')](_0xb0e3('0xb'),auth[_0xb0e3('0x9')](),controller[_0xb0e3('0xf')]);router[_0xb0e3('0x10')](_0xb0e3('0x11'),auth[_0xb0e3('0x9')](),controller[_0xb0e3('0x12')]);router[_0xb0e3('0x13')](_0xb0e3('0x11'),auth['isAuthenticated'](),controller['destroy']);router[_0xb0e3('0x13')](_0xb0e3('0xb'),auth['isAuthenticated'](),controller[_0xb0e3('0x14')]);module[_0xb0e3('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 124fadd..df6c91e 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 _0x27a0=['STRING','name','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long','production','DATE','exports'];(function(_0x2979ce,_0x4b8d29){var _0x1a38ec=function(_0x549e80){while(--_0x549e80){_0x2979ce['push'](_0x2979ce['shift']());}};_0x1a38ec(++_0x4b8d29);}(_0x27a0,0xbf));var _0x027a=function(_0x19eed7,_0x13ed26){_0x19eed7=_0x19eed7-0x0;var _0x17be03=_0x27a0[_0x19eed7];return _0x17be03;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x027a('0x1')]},'notes':{'type':Sequelize[_0x027a('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x027a('0x4')](_0x027a('0x5'))[_0x027a('0x6')](_0x027a('0x7'));}}},'production':{'type':Sequelize[_0x027a('0x8')](_0x027a('0x9')),'get':function(){if(this['getDataValue'](_0x027a('0xa'))){return this[_0x027a('0x4')](_0x027a('0xa'))['toString'](_0x027a('0x7'));}}},'savedAt':{'type':Sequelize[_0x027a('0xb')]},'publishedAt':{'type':Sequelize[_0x027a('0xb')]}}; \ No newline at end of file +var _0x38fc=['TEXT','BLOB','long','getDataValue','toString','production','utf8','DATE','sequelize','exports','STRING','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x38fc,0x8c));var _0xc38f=function(_0x1eb5a4,_0x332379){_0x1eb5a4=_0x1eb5a4-0x0;var _0x2e2fd3=_0x38fc[_0x1eb5a4];return _0x2e2fd3;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'name':{'type':Sequelize[_0xc38f('0x2')],'unique':_0xc38f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc38f('0x2')]},'notes':{'type':Sequelize[_0xc38f('0x4')]},'preproduction':{'type':Sequelize[_0xc38f('0x5')](_0xc38f('0x6')),'get':function(){if(this[_0xc38f('0x7')]('preproduction')){return this[_0xc38f('0x7')]('preproduction')[_0xc38f('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xc38f('0x5')](_0xc38f('0x6')),'get':function(){if(this[_0xc38f('0x7')](_0xc38f('0x9'))){return this[_0xc38f('0x7')](_0xc38f('0x9'))[_0xc38f('0x8')](_0xc38f('0xa'));}}},'savedAt':{'type':Sequelize[_0xc38f('0xb')]},'publishedAt':{'type':Sequelize[_0xc38f('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c1b5743..ff6a20b 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 _0x8256=['error','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','keys','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','save','update','destroy','get','SquareProjects','UserProfileResource','then'];(function(_0x3c5a32,_0x161d13){var _0x3f35d0=function(_0x262976){while(--_0x262976){_0x3c5a32['push'](_0x3c5a32['shift']());}};_0x3f35d0(++_0x161d13);}(_0x8256,0x1b3));var _0x6825=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8256[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x6825('0x0'));var rimraf=require(_0x6825('0x1'));var zipdir=require(_0x6825('0x2'));var jsonpatch=require(_0x6825('0x3'));var rp=require(_0x6825('0x4'));var moment=require(_0x6825('0x5'));var BPromise=require(_0x6825('0x6'));var Mustache=require(_0x6825('0x7'));var util=require('util');var path=require(_0x6825('0x8'));var sox=require(_0x6825('0x9'));var csv=require(_0x6825('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6825('0xb'));var squel=require('squel');var crypto=require(_0x6825('0xc'));var jsforce=require(_0x6825('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6825('0xa'));var querystring=require('querystring');var Papa=require(_0x6825('0xe'));var Redis=require(_0x6825('0xf'));var authService=require(_0x6825('0x10'));var qs=require(_0x6825('0x11'));var as=require(_0x6825('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6825('0x13'))('api');var utils=require(_0x6825('0x14'));var config=require(_0x6825('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6825('0x16'))['db'];config[_0x6825('0x17')]=_[_0x6825('0x18')](config[_0x6825('0x17')],{'host':_0x6825('0x19'),'port':0x18eb});var socket=require(_0x6825('0x1a'))(new Redis(config[_0x6825('0x17')]));require('./squareProject.socket')[_0x6825('0x1b')](socket);function respondWithStatusCode(_0xdc9479,_0x5e5794){_0x5e5794=_0x5e5794||0xcc;return function(_0x48fa05){if(_0x48fa05){return _0xdc9479[_0x6825('0x1c')](_0x5e5794);}return _0xdc9479['status'](_0x5e5794)[_0x6825('0x1d')]();};}function respondWithResult(_0x43b875,_0x1c2401){_0x1c2401=_0x1c2401||0xc8;return function(_0x2594b4){if(_0x2594b4){return _0x43b875['status'](_0x1c2401)[_0x6825('0x1e')](_0x2594b4);}};}function respondWithFilteredResult(_0x10c360,_0x4899a0){return function(_0x6934ff){if(_0x6934ff){var _0x54bcb4=typeof _0x4899a0[_0x6825('0x1f')]===_0x6825('0x20')&&typeof _0x4899a0['limit']===_0x6825('0x20');var _0x1c0c37=_0x6934ff[_0x6825('0x21')];var _0x59a31c=_0x54bcb4?0x0:_0x4899a0[_0x6825('0x1f')];var _0x514632=_0x54bcb4?_0x6934ff[_0x6825('0x21')]:_0x4899a0[_0x6825('0x1f')]+_0x4899a0[_0x6825('0x22')];var _0x5eb2fa;if(_0x514632>=_0x1c0c37){_0x514632=_0x1c0c37;_0x5eb2fa=0xc8;}else{_0x5eb2fa=0xce;}_0x10c360[_0x6825('0x23')](_0x5eb2fa);return _0x10c360[_0x6825('0x24')]('Content-Range',_0x59a31c+'-'+_0x514632+'/'+_0x1c0c37)['json'](_0x6934ff);}return null;};}function patchUpdates(_0x1f90df){return function(_0x2a028a){try{jsonpatch[_0x6825('0x25')](_0x2a028a,_0x1f90df,!![]);}catch(_0x22eff9){return BPromise['reject'](_0x22eff9);}return _0x2a028a[_0x6825('0x26')]();};}function saveUpdates(_0x42e26e,_0x5e184f){return function(_0x5c6816){if(_0x5c6816){return _0x5c6816[_0x6825('0x27')](_0x42e26e)['then'](function(_0x272b19){return _0x272b19;});}return null;};}function removeEntity(_0x4a9a8d,_0x27160c){return function(_0x24056e){if(_0x24056e){return _0x24056e[_0x6825('0x28')]()['then'](function(){var _0x1dee6b=_0x24056e[_0x6825('0x29')]({'plain':!![]});var _0xbc9836=_0x6825('0x2a');return db[_0x6825('0x2b')][_0x6825('0x28')]({'where':{'type':_0xbc9836,'resourceId':_0x1dee6b['id']}})[_0x6825('0x2c')](function(){return _0x24056e;});})['then'](function(){_0x4a9a8d[_0x6825('0x23')](0xcc)[_0x6825('0x1d')]();});}};}function handleEntityNotFound(_0x10ed08,_0x59110e){return function(_0x34e2f8){if(!_0x34e2f8){_0x10ed08[_0x6825('0x1c')](0x194);}return _0x34e2f8;};}function handleError(_0x28ee2d,_0x1527ac){_0x1527ac=_0x1527ac||0x1f4;return function(_0x4ef90c){logger[_0x6825('0x2d')](_0x4ef90c['stack']);if(_0x4ef90c[_0x6825('0x2e')]){delete _0x4ef90c[_0x6825('0x2e')];}_0x28ee2d[_0x6825('0x23')](_0x1527ac)[_0x6825('0x2f')](_0x4ef90c);};}exports[_0x6825('0x30')]=function(_0xf9aa10,_0x53c5e3){var _0x3f208e={},_0x251570={},_0x335008={'count':0x0,'rows':[]};var _0x4524c4=_[_0x6825('0x31')](db[_0x6825('0x32')][_0x6825('0x33')],function(_0x25c5b0){return{'name':_0x25c5b0[_0x6825('0x34')],'type':_0x25c5b0[_0x6825('0x35')][_0x6825('0x36')]};});_0x251570[_0x6825('0x37')]=_[_0x6825('0x31')](_0x4524c4,'name');_0x251570[_0x6825('0x38')]=_['keys'](_0xf9aa10['query']);_0x251570[_0x6825('0x39')]=_[_0x6825('0x3a')](_0x251570['model'],_0x251570['query']);_0x3f208e[_0x6825('0x3b')]=_[_0x6825('0x3a')](_0x251570['model'],qs['fields'](_0xf9aa10[_0x6825('0x38')][_0x6825('0x3c')]));_0x3f208e[_0x6825('0x3b')]=_0x3f208e[_0x6825('0x3b')][_0x6825('0x3d')]?_0x3f208e[_0x6825('0x3b')]:_0x251570[_0x6825('0x37')];if(!_0xf9aa10[_0x6825('0x38')][_0x6825('0x3e')](_0x6825('0x3f'))){_0x3f208e['limit']=qs[_0x6825('0x22')](_0xf9aa10['query'][_0x6825('0x22')]);_0x3f208e[_0x6825('0x1f')]=qs[_0x6825('0x1f')](_0xf9aa10[_0x6825('0x38')]['offset']);}_0x3f208e['order']=qs[_0x6825('0x40')](_0xf9aa10[_0x6825('0x38')][_0x6825('0x40')]);_0x3f208e[_0x6825('0x41')]=qs[_0x6825('0x39')](_[_0x6825('0x42')](_0xf9aa10[_0x6825('0x38')],_0x251570['filters']),_0x4524c4);if(_0xf9aa10[_0x6825('0x38')][_0x6825('0x43')]){_0x3f208e[_0x6825('0x41')]=_['merge'](_0x3f208e[_0x6825('0x41')],{'$or':_[_0x6825('0x31')](_0x4524c4,function(_0x2b88bc){if(_0x2b88bc[_0x6825('0x35')]!==_0x6825('0x44')){var _0x42f028={};_0x42f028[_0x2b88bc[_0x6825('0x2e')]]={'$like':'%'+_0xf9aa10[_0x6825('0x38')][_0x6825('0x43')]+'%'};return _0x42f028;}})});}_0x3f208e=_[_0x6825('0x45')]({},_0x3f208e,_0xf9aa10['options']);var _0x138bd={'where':_0x3f208e[_0x6825('0x41')]};return db[_0x6825('0x32')][_0x6825('0x21')](_0x138bd)[_0x6825('0x2c')](function(_0x231aec){_0x335008[_0x6825('0x21')]=_0x231aec;if(_0xf9aa10['query']['includeAll']){_0x3f208e['include']=[{'all':!![]}];}return db[_0x6825('0x32')][_0x6825('0x46')](_0x3f208e);})['then'](function(_0xf8395d){_0x335008[_0x6825('0x47')]=_0xf8395d;return _0x335008;})['then'](respondWithFilteredResult(_0x53c5e3,_0x3f208e))[_0x6825('0x48')](handleError(_0x53c5e3,null));};exports[_0x6825('0x49')]=function(_0x42068d,_0x35f723){var _0x19bff2={'raw':![],'where':{'id':_0x42068d[_0x6825('0x4a')]['id']}},_0x2802b1={};_0x2802b1[_0x6825('0x37')]=_[_0x6825('0x4b')](db[_0x6825('0x32')][_0x6825('0x33')]);_0x2802b1[_0x6825('0x38')]=_[_0x6825('0x4b')](_0x42068d[_0x6825('0x38')]);_0x2802b1[_0x6825('0x39')]=_[_0x6825('0x3a')](_0x2802b1['model'],_0x2802b1[_0x6825('0x38')]);_0x19bff2[_0x6825('0x3b')]=_['intersection'](_0x2802b1[_0x6825('0x37')],qs[_0x6825('0x3c')](_0x42068d[_0x6825('0x38')]['fields']));_0x19bff2[_0x6825('0x3b')]=_0x19bff2[_0x6825('0x3b')]['length']?_0x19bff2['attributes']:_0x2802b1['model'];if(_0x42068d[_0x6825('0x38')][_0x6825('0x4c')]){_0x19bff2[_0x6825('0x4d')]=[{'all':!![]}];}_0x19bff2=_[_0x6825('0x45')]({},_0x19bff2,_0x42068d[_0x6825('0x4e')]);return db[_0x6825('0x32')][_0x6825('0x4f')](_0x19bff2)[_0x6825('0x2c')](handleEntityNotFound(_0x35f723,null))[_0x6825('0x2c')](respondWithResult(_0x35f723,null))[_0x6825('0x48')](handleError(_0x35f723,null));};exports['create']=function(_0x174363,_0x508fd1){return db[_0x6825('0x32')][_0x6825('0x50')](_0x174363[_0x6825('0x51')],{})[_0x6825('0x2c')](function(_0x2e5e04){var _0x166f7d=_0x174363['user']['get']({'plain':!![]});if(!_0x166f7d)throw new Error(_0x6825('0x52'));if(_0x166f7d[_0x6825('0x53')]===_0x6825('0x54')){var _0x21527a=_0x2e5e04[_0x6825('0x29')]({'plain':!![]});var _0x50f822=_0x6825('0x2a');return db[_0x6825('0x55')][_0x6825('0x4f')]({'where':{'name':_0x50f822,'userProfileId':_0x166f7d[_0x6825('0x56')]},'raw':!![]})[_0x6825('0x2c')](function(_0x50c564){if(_0x50c564&&_0x50c564[_0x6825('0x57')]===0x0){return db[_0x6825('0x2b')][_0x6825('0x50')]({'name':_0x21527a[_0x6825('0x2e')],'resourceId':_0x21527a['id'],'type':_0x50c564['name'],'sectionId':_0x50c564['id']},{})['then'](function(){return _0x2e5e04;});}else{return _0x2e5e04;}})[_0x6825('0x48')](function(_0x5912af){logger[_0x6825('0x2d')](_0x6825('0x58'),_0x5912af);throw _0x5912af;});}return _0x2e5e04;})[_0x6825('0x2c')](respondWithResult(_0x508fd1,0xc9))[_0x6825('0x48')](handleError(_0x508fd1,null));};exports['update']=function(_0x4eed2a,_0x25787f){if(_0x4eed2a['body']['id']){delete _0x4eed2a[_0x6825('0x51')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x4eed2a['params']['id']}})[_0x6825('0x2c')](handleEntityNotFound(_0x25787f,null))[_0x6825('0x2c')](saveUpdates(_0x4eed2a[_0x6825('0x51')],null))[_0x6825('0x2c')](respondWithResult(_0x25787f,null))['catch'](handleError(_0x25787f,null));};exports[_0x6825('0x28')]=function(_0x47d413,_0x58e466){return db['SquareProject'][_0x6825('0x4f')]({'where':{'id':_0x47d413['params']['id']}})['then'](handleEntityNotFound(_0x58e466,null))[_0x6825('0x2c')](removeEntity(_0x58e466,null))[_0x6825('0x48')](handleError(_0x58e466,null));};exports['addUsers']=function(_0x2fe7af,_0x2925e4,_0x3810da){return db['SquareProject']['find']({'where':{'id':_0x2fe7af[_0x6825('0x4a')]['id']}})[_0x6825('0x2c')](handleEntityNotFound(_0x2925e4,null))[_0x6825('0x2c')](function(_0x5043b6){if(_0x5043b6){return _0x5043b6['addUsers'](_0x2fe7af['body'][_0x6825('0x59')],_[_0x6825('0x5a')](_0x2fe7af[_0x6825('0x51')],[_0x6825('0x59'),'id'])||{});}})[_0x6825('0x2c')](respondWithResult(_0x2925e4,null))[_0x6825('0x48')](handleError(_0x2925e4,null));};exports[_0x6825('0x5b')]=function(_0x315cd0,_0x1d2e4e,_0x2118fd){return db[_0x6825('0x32')][_0x6825('0x4f')]({'where':{'id':_0x315cd0[_0x6825('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1d2e4e,null))[_0x6825('0x2c')](function(_0x49c83f){if(_0x49c83f){return _0x49c83f[_0x6825('0x5b')](_0x315cd0[_0x6825('0x38')][_0x6825('0x59')])[_0x6825('0x2c')](function(){if(_[_0x6825('0x5c')](_0x315cd0[_0x6825('0x38')]['ids'])){for(var _0x24adea=0x0;_0x24adea<_0x315cd0[_0x6825('0x38')]['ids'][_0x6825('0x3d')];_0x24adea+=0x1){socket[_0x6825('0x5d')](_0x6825('0x5e'),{'UserId':Number(_0x315cd0[_0x6825('0x38')][_0x6825('0x59')][_0x24adea]),'SquareProjectId':Number(_0x315cd0[_0x6825('0x4a')]['id'])});}}else{socket['emit'](_0x6825('0x5e'),{'UserId':Number(_0x315cd0[_0x6825('0x38')][_0x6825('0x59')]),'SquareProjectId':Number(_0x315cd0[_0x6825('0x4a')]['id'])});}});}})[_0x6825('0x2c')](respondWithStatusCode(_0x1d2e4e,null))[_0x6825('0x48')](handleError(_0x1d2e4e,null));};exports[_0x6825('0x5f')]=function(_0x55206d,_0x417a10,_0x25af28){var _0x4fbe82={};var _0x46fc57={};var _0x14333e;var _0xe1f96d;return db['SquareProject']['findOne']({'where':{'id':_0x55206d[_0x6825('0x4a')]['id']}})[_0x6825('0x2c')](handleEntityNotFound(_0x417a10,null))[_0x6825('0x2c')](function(_0x4356f9){if(_0x4356f9){_0x14333e=_0x4356f9;_0x46fc57['model']=_['keys'](db['User'][_0x6825('0x33')]);_0x46fc57[_0x6825('0x38')]=_['keys'](_0x55206d[_0x6825('0x38')]);_0x46fc57['filters']=_[_0x6825('0x3a')](_0x46fc57['model'],_0x46fc57[_0x6825('0x38')]);_0x4fbe82[_0x6825('0x3b')]=_[_0x6825('0x3a')](_0x46fc57[_0x6825('0x37')],qs['fields'](_0x55206d[_0x6825('0x38')][_0x6825('0x3c')]));_0x4fbe82[_0x6825('0x3b')]=_0x4fbe82[_0x6825('0x3b')][_0x6825('0x3d')]?_0x4fbe82[_0x6825('0x3b')]:_0x46fc57[_0x6825('0x37')];_0x4fbe82['order']=qs['sort'](_0x55206d[_0x6825('0x38')][_0x6825('0x40')]);_0x4fbe82[_0x6825('0x41')]=qs[_0x6825('0x39')](_[_0x6825('0x42')](_0x55206d[_0x6825('0x38')],_0x46fc57[_0x6825('0x39')]));if(_0x55206d[_0x6825('0x38')]['filter']){_0x4fbe82[_0x6825('0x41')]=_['merge'](_0x4fbe82[_0x6825('0x41')],{'$or':_[_0x6825('0x31')](_0x4fbe82[_0x6825('0x3b')],function(_0x303c40){var _0x403401={};_0x403401[_0x303c40]={'$like':'%'+_0x55206d[_0x6825('0x38')][_0x6825('0x43')]+'%'};return _0x403401;})});}_0x4fbe82=_[_0x6825('0x45')]({},_0x4fbe82,_0x55206d[_0x6825('0x4e')]);return _0x14333e[_0x6825('0x5f')](_0x4fbe82);}})[_0x6825('0x2c')](function(_0x51463d){if(_0x51463d){_0xe1f96d=_0x51463d[_0x6825('0x3d')];if(!_0x55206d['query']['hasOwnProperty']('nolimit')){_0x4fbe82['limit']=qs[_0x6825('0x22')](_0x55206d[_0x6825('0x38')][_0x6825('0x22')]);_0x4fbe82[_0x6825('0x1f')]=qs[_0x6825('0x1f')](_0x55206d[_0x6825('0x38')][_0x6825('0x1f')]);}return _0x14333e[_0x6825('0x5f')](_0x4fbe82);}})[_0x6825('0x2c')](function(_0x59ba91){if(_0x59ba91){return _0x59ba91?{'count':_0xe1f96d,'rows':_0x59ba91}:null;}})[_0x6825('0x2c')](respondWithResult(_0x417a10,null))[_0x6825('0x48')](handleError(_0x417a10,null));}; \ No newline at end of file +var _0x68d8=['end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','SquareProjects','UserProfileResource'];(function(_0x10eb7b,_0x66ceaf){var _0x15655c=function(_0x1672d3){while(--_0x1672d3){_0x10eb7b['push'](_0x10eb7b['shift']());}};_0x15655c(++_0x66ceaf);}(_0x68d8,0x165));var _0x868d=function(_0x383024,_0x2a23bd){_0x383024=_0x383024-0x0;var _0x4da816=_0x68d8[_0x383024];return _0x4da816;};'use strict';var emlformat=require(_0x868d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x868d('0x1'));var jsonpatch=require(_0x868d('0x2'));var rp=require(_0x868d('0x3'));var moment=require(_0x868d('0x4'));var BPromise=require(_0x868d('0x5'));var Mustache=require(_0x868d('0x6'));var util=require('util');var path=require(_0x868d('0x7'));var sox=require(_0x868d('0x8'));var csv=require(_0x868d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x868d('0xa'));var _=require(_0x868d('0xb'));var squel=require('squel');var crypto=require(_0x868d('0xc'));var jsforce=require(_0x868d('0xd'));var deskjs=require(_0x868d('0xe'));var toCsv=require(_0x868d('0x9'));var querystring=require(_0x868d('0xf'));var Papa=require('papaparse');var Redis=require(_0x868d('0x10'));var authService=require(_0x868d('0x11'));var qs=require(_0x868d('0x12'));var as=require(_0x868d('0x13'));var hardwareService=require(_0x868d('0x14'));var logger=require(_0x868d('0x15'))('api');var utils=require(_0x868d('0x16'));var config=require(_0x868d('0x17'));var licenseUtil=require(_0x868d('0x18'));var db=require('../../mysqldb')['db'];config[_0x868d('0x19')]=_[_0x868d('0x1a')](config[_0x868d('0x19')],{'host':_0x868d('0x1b'),'port':0x18eb});var socket=require(_0x868d('0x1c'))(new Redis(config[_0x868d('0x19')]));require(_0x868d('0x1d'))[_0x868d('0x1e')](socket);function respondWithStatusCode(_0x9d5763,_0x457878){_0x457878=_0x457878||0xcc;return function(_0x4091e8){if(_0x4091e8){return _0x9d5763[_0x868d('0x1f')](_0x457878);}return _0x9d5763['status'](_0x457878)['end']();};}function respondWithResult(_0x5d142a,_0x4dc489){_0x4dc489=_0x4dc489||0xc8;return function(_0x514eda){if(_0x514eda){return _0x5d142a[_0x868d('0x20')](_0x4dc489)[_0x868d('0x21')](_0x514eda);}};}function respondWithFilteredResult(_0x196368,_0x23ca2b){return function(_0x13cf00){if(_0x13cf00){var _0x3a989b=typeof _0x23ca2b[_0x868d('0x22')]==='undefined'&&typeof _0x23ca2b[_0x868d('0x23')]===_0x868d('0x24');var _0x525808=_0x13cf00[_0x868d('0x25')];var _0x28bc75=_0x3a989b?0x0:_0x23ca2b[_0x868d('0x22')];var _0x564b23=_0x3a989b?_0x13cf00[_0x868d('0x25')]:_0x23ca2b['offset']+_0x23ca2b['limit'];var _0x595c8b;if(_0x564b23>=_0x525808){_0x564b23=_0x525808;_0x595c8b=0xc8;}else{_0x595c8b=0xce;}_0x196368['status'](_0x595c8b);return _0x196368[_0x868d('0x26')](_0x868d('0x27'),_0x28bc75+'-'+_0x564b23+'/'+_0x525808)[_0x868d('0x21')](_0x13cf00);}return null;};}function patchUpdates(_0x331418){return function(_0x49de51){try{jsonpatch['apply'](_0x49de51,_0x331418,!![]);}catch(_0x1025aa){return BPromise['reject'](_0x1025aa);}return _0x49de51[_0x868d('0x28')]();};}function saveUpdates(_0x18cf10,_0x2215f2){return function(_0x2ac46a){if(_0x2ac46a){return _0x2ac46a[_0x868d('0x29')](_0x18cf10)[_0x868d('0x2a')](function(_0x1df419){return _0x1df419;});}return null;};}function removeEntity(_0x2771bc,_0xd82607){return function(_0x1c58ab){if(_0x1c58ab){return _0x1c58ab[_0x868d('0x2b')]()[_0x868d('0x2a')](function(){var _0x128a1e=_0x1c58ab[_0x868d('0x2c')]({'plain':!![]});var _0x1d06d5=_0x868d('0x2d');return db[_0x868d('0x2e')]['destroy']({'where':{'type':_0x1d06d5,'resourceId':_0x128a1e['id']}})[_0x868d('0x2a')](function(){return _0x1c58ab;});})[_0x868d('0x2a')](function(){_0x2771bc[_0x868d('0x20')](0xcc)[_0x868d('0x2f')]();});}};}function handleEntityNotFound(_0x599cdd,_0xce9f45){return function(_0x3830ec){if(!_0x3830ec){_0x599cdd[_0x868d('0x1f')](0x194);}return _0x3830ec;};}function handleError(_0xaa2b58,_0x50d397){_0x50d397=_0x50d397||0x1f4;return function(_0x2666c0){logger[_0x868d('0x30')](_0x2666c0[_0x868d('0x31')]);if(_0x2666c0['name']){delete _0x2666c0[_0x868d('0x32')];}_0xaa2b58[_0x868d('0x20')](_0x50d397)[_0x868d('0x33')](_0x2666c0);};}exports[_0x868d('0x34')]=function(_0x51331a,_0xd93c1){var _0x62618c={},_0x5b47fc={},_0x4a7422={'count':0x0,'rows':[]};var _0x47f04f=_[_0x868d('0x35')](db[_0x868d('0x36')][_0x868d('0x37')],function(_0x2466a9){return{'name':_0x2466a9[_0x868d('0x38')],'type':_0x2466a9['type'][_0x868d('0x39')]};});_0x5b47fc['model']=_[_0x868d('0x35')](_0x47f04f,_0x868d('0x32'));_0x5b47fc[_0x868d('0x3a')]=_[_0x868d('0x3b')](_0x51331a[_0x868d('0x3a')]);_0x5b47fc[_0x868d('0x3c')]=_[_0x868d('0x3d')](_0x5b47fc['model'],_0x5b47fc[_0x868d('0x3a')]);_0x62618c[_0x868d('0x3e')]=_[_0x868d('0x3d')](_0x5b47fc[_0x868d('0x3f')],qs[_0x868d('0x40')](_0x51331a['query'][_0x868d('0x40')]));_0x62618c[_0x868d('0x3e')]=_0x62618c['attributes'][_0x868d('0x41')]?_0x62618c[_0x868d('0x3e')]:_0x5b47fc[_0x868d('0x3f')];if(!_0x51331a[_0x868d('0x3a')][_0x868d('0x42')]('nolimit')){_0x62618c[_0x868d('0x23')]=qs[_0x868d('0x23')](_0x51331a['query'][_0x868d('0x23')]);_0x62618c[_0x868d('0x22')]=qs[_0x868d('0x22')](_0x51331a['query']['offset']);}_0x62618c[_0x868d('0x43')]=qs[_0x868d('0x44')](_0x51331a[_0x868d('0x3a')][_0x868d('0x44')]);_0x62618c[_0x868d('0x45')]=qs[_0x868d('0x3c')](_[_0x868d('0x46')](_0x51331a[_0x868d('0x3a')],_0x5b47fc[_0x868d('0x3c')]),_0x47f04f);if(_0x51331a['query'][_0x868d('0x47')]){_0x62618c['where']=_[_0x868d('0x48')](_0x62618c[_0x868d('0x45')],{'$or':_[_0x868d('0x35')](_0x47f04f,function(_0x4a6acc){if(_0x4a6acc[_0x868d('0x49')]!==_0x868d('0x4a')){var _0x241208={};_0x241208[_0x4a6acc[_0x868d('0x32')]]={'$like':'%'+_0x51331a[_0x868d('0x3a')][_0x868d('0x47')]+'%'};return _0x241208;}})});}_0x62618c=_[_0x868d('0x48')]({},_0x62618c,_0x51331a[_0x868d('0x4b')]);var _0x64eefa={'where':_0x62618c[_0x868d('0x45')]};return db[_0x868d('0x36')][_0x868d('0x25')](_0x64eefa)[_0x868d('0x2a')](function(_0x508217){_0x4a7422[_0x868d('0x25')]=_0x508217;if(_0x51331a['query'][_0x868d('0x4c')]){_0x62618c[_0x868d('0x4d')]=[{'all':!![]}];}return db['SquareProject'][_0x868d('0x4e')](_0x62618c);})[_0x868d('0x2a')](function(_0x5e5970){_0x4a7422[_0x868d('0x4f')]=_0x5e5970;return _0x4a7422;})[_0x868d('0x2a')](respondWithFilteredResult(_0xd93c1,_0x62618c))['catch'](handleError(_0xd93c1,null));};exports['show']=function(_0x4e7736,_0x9ba9f9){var _0x1b92be={'raw':![],'where':{'id':_0x4e7736[_0x868d('0x50')]['id']}},_0x4a8519={};_0x4a8519['model']=_[_0x868d('0x3b')](db['SquareProject'][_0x868d('0x37')]);_0x4a8519[_0x868d('0x3a')]=_['keys'](_0x4e7736[_0x868d('0x3a')]);_0x4a8519[_0x868d('0x3c')]=_[_0x868d('0x3d')](_0x4a8519[_0x868d('0x3f')],_0x4a8519[_0x868d('0x3a')]);_0x1b92be[_0x868d('0x3e')]=_[_0x868d('0x3d')](_0x4a8519[_0x868d('0x3f')],qs[_0x868d('0x40')](_0x4e7736[_0x868d('0x3a')][_0x868d('0x40')]));_0x1b92be['attributes']=_0x1b92be[_0x868d('0x3e')]['length']?_0x1b92be['attributes']:_0x4a8519[_0x868d('0x3f')];if(_0x4e7736[_0x868d('0x3a')][_0x868d('0x4c')]){_0x1b92be['include']=[{'all':!![]}];}_0x1b92be=_[_0x868d('0x48')]({},_0x1b92be,_0x4e7736['options']);return db[_0x868d('0x36')]['find'](_0x1b92be)[_0x868d('0x2a')](handleEntityNotFound(_0x9ba9f9,null))[_0x868d('0x2a')](respondWithResult(_0x9ba9f9,null))[_0x868d('0x51')](handleError(_0x9ba9f9,null));};exports[_0x868d('0x52')]=function(_0x1b4705,_0x5f0380){return db[_0x868d('0x36')][_0x868d('0x52')](_0x1b4705[_0x868d('0x53')],{})[_0x868d('0x2a')](function(_0x40f7f3){var _0x4ca6a7=_0x1b4705['user'][_0x868d('0x2c')]({'plain':!![]});if(!_0x4ca6a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ca6a7[_0x868d('0x54')]===_0x868d('0x55')){var _0x52fa9a=_0x40f7f3[_0x868d('0x2c')]({'plain':!![]});var _0x2e05c7=_0x868d('0x2d');return db[_0x868d('0x56')]['find']({'where':{'name':_0x2e05c7,'userProfileId':_0x4ca6a7[_0x868d('0x57')]},'raw':!![]})[_0x868d('0x2a')](function(_0x1b02a8){if(_0x1b02a8&&_0x1b02a8[_0x868d('0x58')]===0x0){return db[_0x868d('0x2e')][_0x868d('0x52')]({'name':_0x52fa9a[_0x868d('0x32')],'resourceId':_0x52fa9a['id'],'type':_0x1b02a8['name'],'sectionId':_0x1b02a8['id']},{})[_0x868d('0x2a')](function(){return _0x40f7f3;});}else{return _0x40f7f3;}})['catch'](function(_0x1f15c1){logger[_0x868d('0x30')](_0x868d('0x59'),_0x1f15c1);throw _0x1f15c1;});}return _0x40f7f3;})[_0x868d('0x2a')](respondWithResult(_0x5f0380,0xc9))[_0x868d('0x51')](handleError(_0x5f0380,null));};exports[_0x868d('0x29')]=function(_0x56e9bf,_0x17d4a9){if(_0x56e9bf[_0x868d('0x53')]['id']){delete _0x56e9bf['body']['id'];}return db['SquareProject'][_0x868d('0x5a')]({'where':{'id':_0x56e9bf[_0x868d('0x50')]['id']}})['then'](handleEntityNotFound(_0x17d4a9,null))[_0x868d('0x2a')](saveUpdates(_0x56e9bf[_0x868d('0x53')],null))[_0x868d('0x2a')](respondWithResult(_0x17d4a9,null))[_0x868d('0x51')](handleError(_0x17d4a9,null));};exports['destroy']=function(_0x3a34c3,_0x3220ea){return db[_0x868d('0x36')]['find']({'where':{'id':_0x3a34c3['params']['id']}})[_0x868d('0x2a')](handleEntityNotFound(_0x3220ea,null))[_0x868d('0x2a')](removeEntity(_0x3220ea,null))[_0x868d('0x51')](handleError(_0x3220ea,null));};exports['addUsers']=function(_0x3789c8,_0x421ddf,_0xe16492){return db[_0x868d('0x36')][_0x868d('0x5a')]({'where':{'id':_0x3789c8[_0x868d('0x50')]['id']}})[_0x868d('0x2a')](handleEntityNotFound(_0x421ddf,null))['then'](function(_0x12b104){if(_0x12b104){return _0x12b104[_0x868d('0x5b')](_0x3789c8[_0x868d('0x53')][_0x868d('0x5c')],_[_0x868d('0x5d')](_0x3789c8[_0x868d('0x53')],[_0x868d('0x5c'),'id'])||{});}})[_0x868d('0x2a')](respondWithResult(_0x421ddf,null))['catch'](handleError(_0x421ddf,null));};exports['removeUsers']=function(_0x3d3037,_0x3cc803,_0x3c6a9f){return db[_0x868d('0x36')][_0x868d('0x5a')]({'where':{'id':_0x3d3037['params']['id']}})[_0x868d('0x2a')](handleEntityNotFound(_0x3cc803,null))[_0x868d('0x2a')](function(_0x50c3d9){if(_0x50c3d9){return _0x50c3d9[_0x868d('0x5e')](_0x3d3037[_0x868d('0x3a')]['ids'])[_0x868d('0x2a')](function(){if(_[_0x868d('0x5f')](_0x3d3037['query'][_0x868d('0x5c')])){for(var _0x10c4e0=0x0;_0x10c4e0<_0x3d3037[_0x868d('0x3a')]['ids'][_0x868d('0x41')];_0x10c4e0+=0x1){socket['emit'](_0x868d('0x60'),{'UserId':Number(_0x3d3037[_0x868d('0x3a')][_0x868d('0x5c')][_0x10c4e0]),'SquareProjectId':Number(_0x3d3037[_0x868d('0x50')]['id'])});}}else{socket[_0x868d('0x61')](_0x868d('0x60'),{'UserId':Number(_0x3d3037['query'][_0x868d('0x5c')]),'SquareProjectId':Number(_0x3d3037['params']['id'])});}});}})[_0x868d('0x2a')](respondWithStatusCode(_0x3cc803,null))['catch'](handleError(_0x3cc803,null));};exports[_0x868d('0x62')]=function(_0x181a16,_0x596679,_0x356990){var _0x4fb3b4={};var _0x2ec3f0={};var _0x4ad00d;var _0x2e134a;return db['SquareProject'][_0x868d('0x63')]({'where':{'id':_0x181a16[_0x868d('0x50')]['id']}})['then'](handleEntityNotFound(_0x596679,null))['then'](function(_0x47999a){if(_0x47999a){_0x4ad00d=_0x47999a;_0x2ec3f0[_0x868d('0x3f')]=_[_0x868d('0x3b')](db['User']['rawAttributes']);_0x2ec3f0[_0x868d('0x3a')]=_['keys'](_0x181a16[_0x868d('0x3a')]);_0x2ec3f0[_0x868d('0x3c')]=_[_0x868d('0x3d')](_0x2ec3f0[_0x868d('0x3f')],_0x2ec3f0[_0x868d('0x3a')]);_0x4fb3b4['attributes']=_[_0x868d('0x3d')](_0x2ec3f0[_0x868d('0x3f')],qs[_0x868d('0x40')](_0x181a16[_0x868d('0x3a')][_0x868d('0x40')]));_0x4fb3b4[_0x868d('0x3e')]=_0x4fb3b4[_0x868d('0x3e')][_0x868d('0x41')]?_0x4fb3b4[_0x868d('0x3e')]:_0x2ec3f0[_0x868d('0x3f')];_0x4fb3b4[_0x868d('0x43')]=qs[_0x868d('0x44')](_0x181a16[_0x868d('0x3a')]['sort']);_0x4fb3b4['where']=qs[_0x868d('0x3c')](_['pick'](_0x181a16[_0x868d('0x3a')],_0x2ec3f0['filters']));if(_0x181a16[_0x868d('0x3a')]['filter']){_0x4fb3b4['where']=_['merge'](_0x4fb3b4['where'],{'$or':_[_0x868d('0x35')](_0x4fb3b4[_0x868d('0x3e')],function(_0x13e46f){var _0x34b983={};_0x34b983[_0x13e46f]={'$like':'%'+_0x181a16[_0x868d('0x3a')][_0x868d('0x47')]+'%'};return _0x34b983;})});}_0x4fb3b4=_[_0x868d('0x48')]({},_0x4fb3b4,_0x181a16[_0x868d('0x4b')]);return _0x4ad00d[_0x868d('0x62')](_0x4fb3b4);}})['then'](function(_0x557599){if(_0x557599){_0x2e134a=_0x557599[_0x868d('0x41')];if(!_0x181a16[_0x868d('0x3a')][_0x868d('0x42')](_0x868d('0x64'))){_0x4fb3b4[_0x868d('0x23')]=qs[_0x868d('0x23')](_0x181a16[_0x868d('0x3a')][_0x868d('0x23')]);_0x4fb3b4[_0x868d('0x22')]=qs[_0x868d('0x22')](_0x181a16[_0x868d('0x3a')][_0x868d('0x22')]);}return _0x4ad00d[_0x868d('0x62')](_0x4fb3b4);}})[_0x868d('0x2a')](function(_0x470a60){if(_0x470a60){return _0x470a60?{'count':_0x2e134a,'rows':_0x470a60}:null;}})[_0x868d('0x2a')](respondWithResult(_0x596679,null))[_0x868d('0x51')](handleError(_0x596679,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1fa5374..342e4ce 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 _0xe97c=['events','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe97c,0xf3));var _0xce97=function(_0x48b938,_0x5f25ea){_0x48b938=_0x48b938-0x0;var _0x1be762=_0xe97c[_0x48b938];return _0x1be762;};'use strict';var EventEmitter=require(_0xce97('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xce97('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xce97('0x2')](0x0);var events={'afterCreate':_0xce97('0x3'),'afterUpdate':_0xce97('0x4'),'afterDestroy':_0xce97('0x5')};function emitEvent(_0x23a85f){return function(_0x2ab626,_0x5db404,_0xccd889){SquareProjectEvents[_0xce97('0x6')](_0x23a85f+':'+_0x2ab626['id'],_0x2ab626);SquareProjectEvents[_0xce97('0x6')](_0x23a85f,_0x2ab626);_0xccd889(null);};}for(var e in events){if(events[_0xce97('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xce97('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xcaf8=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x29a1bb,_0x52859d){var _0x19f85e=function(_0x1b1000){while(--_0x1b1000){_0x29a1bb['push'](_0x29a1bb['shift']());}};_0x19f85e(++_0x52859d);}(_0xcaf8,0x122));var _0x8caf=function(_0x5055d5,_0x30564c){_0x5055d5=_0x5055d5-0x0;var _0x25230e=_0xcaf8[_0x5055d5];return _0x25230e;};'use strict';var EventEmitter=require(_0x8caf('0x0'));var SquareProject=require(_0x8caf('0x1'))['db'][_0x8caf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8caf('0x3')](0x0);var events={'afterCreate':_0x8caf('0x4'),'afterUpdate':_0x8caf('0x5'),'afterDestroy':_0x8caf('0x6')};function emitEvent(_0x2bd15e){return function(_0x30cda3,_0x2964f6,_0x526468){SquareProjectEvents[_0x8caf('0x7')](_0x2bd15e+':'+_0x30cda3['id'],_0x30cda3);SquareProjectEvents['emit'](_0x2bd15e,_0x30cda3);_0x526468(null);};}for(var e in events){if(events[_0x8caf('0x8')](e)){var event=events[e];SquareProject[_0x8caf('0x9')](e,emitEvent(event));}}module[_0x8caf('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 05931f8..5dcffb1 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 _0x6b29=['../../config/environment','exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5ca259,_0x145448){var _0x30d5d8=function(_0x3a0a32){while(--_0x3a0a32){_0x5ca259['push'](_0x5ca259['shift']());}};_0x30d5d8(++_0x145448);}(_0x6b29,0xd6));var _0x96b2=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x6b29[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require('lodash');var util=require(_0x96b2('0x0'));var logger=require(_0x96b2('0x1'))(_0x96b2('0x2'));var moment=require(_0x96b2('0x3'));var BPromise=require(_0x96b2('0x4'));var rp=require(_0x96b2('0x5'));var fs=require('fs');var path=require(_0x96b2('0x6'));var rimraf=require('rimraf');var config=require(_0x96b2('0x7'));var attributes=require('./squareProject.attributes');module[_0x96b2('0x8')]=function(_0x59c9ad,_0xb9954f){return _0x59c9ad[_0x96b2('0x9')]('SquareProject',attributes,{'tableName':_0x96b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x377db0,_0x1d4275,_0x2fd05f){if(_0x377db0[_0x96b2('0xb')](_0x96b2('0xc'))){_0x377db0[_0x96b2('0xd')]=moment()[_0x96b2('0xe')](_0x96b2('0xf'));}if(_0x377db0[_0x96b2('0xb')](_0x96b2('0x10'))){_0x377db0['publishedAt']=moment()[_0x96b2('0xe')](_0x96b2('0xf'));}_0x2fd05f(null,_0x377db0);}}});}; \ No newline at end of file +var _0x8005=['production','publishedAt','lodash','api','moment','bluebird','path','rimraf','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed'];(function(_0x1bf52b,_0x11be2b){var _0x2cb2b2=function(_0x489022){while(--_0x489022){_0x1bf52b['push'](_0x1bf52b['shift']());}};_0x2cb2b2(++_0x11be2b);}(_0x8005,0x112));var _0x5800=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x8005[_0x2bda14];return _0xb5dd49;};'use strict';var _=require(_0x5800('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5800('0x1'));var moment=require(_0x5800('0x2'));var BPromise=require(_0x5800('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5800('0x4'));var rimraf=require(_0x5800('0x5'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x5800('0x6')]=function(_0x562a46,_0x2725b3){return _0x562a46[_0x5800('0x7')](_0x5800('0x8'),attributes,{'tableName':_0x5800('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d6383,_0x1fa5cc,_0x38bcaa){if(_0x3d6383['changed'](_0x5800('0xa'))){_0x3d6383[_0x5800('0xb')]=moment()[_0x5800('0xc')](_0x5800('0xd'));}if(_0x3d6383[_0x5800('0xe')](_0x5800('0xf'))){_0x3d6383[_0x5800('0x10')]=moment()[_0x5800('0xc')](_0x5800('0xd'));}_0x38bcaa(null,_0x3d6383);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 49bd2a7..e0ff3f4 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 _0xad52=['result','catch','ShowSquareProject','find','options','attributes','map','include','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xad52,0x72));var _0x2ad5=function(_0x140f92,_0x533825){_0x140f92=_0x140f92-0x0;var _0x3f918d=_0xad52[_0x140f92];return _0x3f918d;};'use strict';var _=require(_0x2ad5('0x0'));var util=require('util');var moment=require(_0x2ad5('0x1'));var BPromise=require(_0x2ad5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ad5('0x3'));var db=require(_0x2ad5('0x4'))['db'];var utils=require(_0x2ad5('0x5'));var logger=require(_0x2ad5('0x6'))('rpc');var config=require(_0x2ad5('0x7'));var jayson=require(_0x2ad5('0x8'));var client=jayson[_0x2ad5('0x9')][_0x2ad5('0xa')]({'port':0x232a});config['redis']=_[_0x2ad5('0xb')](config[_0x2ad5('0xc')],{'host':_0x2ad5('0xd'),'port':0x18eb});var socket=require(_0x2ad5('0xe'))(new Redis(config['redis']));require(_0x2ad5('0xf'))[_0x2ad5('0x10')](socket);function respondWithRpcPromise(_0x34b179,_0x513d7b,_0x40aeab){return new BPromise(function(_0x53aa09,_0x419468){return client['request'](_0x34b179,_0x40aeab)[_0x2ad5('0x11')](function(_0x192c1d){logger[_0x2ad5('0x12')](_0x2ad5('0x13'),_0x513d7b,_0x2ad5('0x14'));logger['debug'](_0x2ad5('0x15'),_0x513d7b,_0x2ad5('0x14'),JSON[_0x2ad5('0x16')](_0x192c1d));if(_0x192c1d[_0x2ad5('0x17')]){if(_0x192c1d[_0x2ad5('0x17')][_0x2ad5('0x18')]===0x1f4){logger[_0x2ad5('0x17')](_0x2ad5('0x13'),_0x513d7b,_0x192c1d[_0x2ad5('0x17')][_0x2ad5('0x19')]);return _0x419468(_0x192c1d[_0x2ad5('0x17')][_0x2ad5('0x19')]);}logger['error'](_0x2ad5('0x13'),_0x513d7b,_0x192c1d[_0x2ad5('0x17')]['message']);return _0x53aa09(_0x192c1d[_0x2ad5('0x17')][_0x2ad5('0x19')]);}else{logger['info'](_0x2ad5('0x13'),_0x513d7b,'request\x20sent');_0x53aa09(_0x192c1d[_0x2ad5('0x1a')][_0x2ad5('0x19')]);}})[_0x2ad5('0x1b')](function(_0x143ed8){logger[_0x2ad5('0x17')](_0x2ad5('0x13'),_0x513d7b,_0x143ed8);_0x419468(_0x143ed8);});});}exports[_0x2ad5('0x1c')]=function(_0xd26fcf){var _0x5d01a9=this;return new Promise(function(_0x12d430,_0x1ec68e){return db['SquareProject'][_0x2ad5('0x1d')]({'raw':_0xd26fcf[_0x2ad5('0x1e')]?_0xd26fcf[_0x2ad5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xd26fcf[_0x2ad5('0x1e')]?_0xd26fcf[_0x2ad5('0x1e')]['where']||null:null,'attributes':_0xd26fcf[_0x2ad5('0x1e')]?_0xd26fcf[_0x2ad5('0x1e')][_0x2ad5('0x1f')]||null:null,'include':_0xd26fcf[_0x2ad5('0x1e')]?_0xd26fcf['options']['include']?_[_0x2ad5('0x20')](_0xd26fcf[_0x2ad5('0x1e')][_0x2ad5('0x21')],function(_0x12e4c0){return{'model':db[_0x12e4c0[_0x2ad5('0x22')]],'as':_0x12e4c0['as'],'attributes':_0x12e4c0['attributes'],'include':_0x12e4c0[_0x2ad5('0x21')]?_['map'](_0x12e4c0[_0x2ad5('0x21')],function(_0x232f2c){return{'model':db[_0x232f2c['model']],'as':_0x232f2c['as'],'attributes':_0x232f2c[_0x2ad5('0x1f')],'include':_0x232f2c['include']?_[_0x2ad5('0x20')](_0x232f2c[_0x2ad5('0x21')],function(_0x5f0d00){return{'model':db[_0x5f0d00[_0x2ad5('0x22')]],'as':_0x5f0d00['as'],'attributes':_0x5f0d00[_0x2ad5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2ad5('0x11')](function(_0x32ffb7){logger['info'](_0x2ad5('0x1c'),_0xd26fcf);logger['debug'](_0x2ad5('0x1c'),_0xd26fcf,JSON[_0x2ad5('0x16')](_0x32ffb7));_0x12d430(_0x32ffb7);})['catch'](function(_0x2b1ea9){logger[_0x2ad5('0x17')](_0x2ad5('0x1c'),_0x2b1ea9[_0x2ad5('0x19')],_0xd26fcf);_0x1ec68e(_0x5d01a9[_0x2ad5('0x17')](0x1f4,_0x2b1ea9[_0x2ad5('0x19')]));});});}; \ No newline at end of file +var _0xed9a=['map','include','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSquareProject','SquareProject','find','options','attributes'];(function(_0x5e5e0d,_0x20402e){var _0x32485d=function(_0x24eb1e){while(--_0x24eb1e){_0x5e5e0d['push'](_0x5e5e0d['shift']());}};_0x32485d(++_0x20402e);}(_0xed9a,0xb4));var _0xaed9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xed9a[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xaed9('0x0'));var util=require(_0xaed9('0x1'));var moment=require(_0xaed9('0x2'));var BPromise=require(_0xaed9('0x3'));var rs=require(_0xaed9('0x4'));var fs=require('fs');var Redis=require(_0xaed9('0x5'));var db=require(_0xaed9('0x6'))['db'];var utils=require(_0xaed9('0x7'));var logger=require(_0xaed9('0x8'))('rpc');var config=require(_0xaed9('0x9'));var jayson=require(_0xaed9('0xa'));var client=jayson[_0xaed9('0xb')]['http']({'port':0x232a});config[_0xaed9('0xc')]=_[_0xaed9('0xd')](config[_0xaed9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaed9('0xc')]));require(_0xaed9('0xe'))['register'](socket);function respondWithRpcPromise(_0x946cde,_0x49c577,_0x227569){return new BPromise(function(_0x74ba22,_0x10cdfe){return client[_0xaed9('0xf')](_0x946cde,_0x227569)['then'](function(_0x698e16){logger[_0xaed9('0x10')](_0xaed9('0x11'),_0x49c577,'request\x20sent');logger['debug'](_0xaed9('0x12'),_0x49c577,_0xaed9('0x13'),JSON[_0xaed9('0x14')](_0x698e16));if(_0x698e16['error']){if(_0x698e16[_0xaed9('0x15')]['code']===0x1f4){logger[_0xaed9('0x15')](_0xaed9('0x11'),_0x49c577,_0x698e16['error'][_0xaed9('0x16')]);return _0x10cdfe(_0x698e16[_0xaed9('0x15')]['message']);}logger['error'](_0xaed9('0x11'),_0x49c577,_0x698e16['error']['message']);return _0x74ba22(_0x698e16[_0xaed9('0x15')][_0xaed9('0x16')]);}else{logger[_0xaed9('0x10')]('SquareProject,\x20%s,\x20%s',_0x49c577,_0xaed9('0x13'));_0x74ba22(_0x698e16[_0xaed9('0x17')]['message']);}})[_0xaed9('0x18')](function(_0x13763c){logger['error'](_0xaed9('0x11'),_0x49c577,_0x13763c);_0x10cdfe(_0x13763c);});});}exports[_0xaed9('0x19')]=function(_0x26044d){var _0x39524e=this;return new Promise(function(_0x56e451,_0xa08ea8){return db[_0xaed9('0x1a')][_0xaed9('0x1b')]({'raw':_0x26044d[_0xaed9('0x1c')]?_0x26044d[_0xaed9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x26044d[_0xaed9('0x1c')]?_0x26044d[_0xaed9('0x1c')]['where']||null:null,'attributes':_0x26044d[_0xaed9('0x1c')]?_0x26044d[_0xaed9('0x1c')][_0xaed9('0x1d')]||null:null,'include':_0x26044d[_0xaed9('0x1c')]?_0x26044d['options']['include']?_[_0xaed9('0x1e')](_0x26044d[_0xaed9('0x1c')][_0xaed9('0x1f')],function(_0x29deef){return{'model':db[_0x29deef[_0xaed9('0x20')]],'as':_0x29deef['as'],'attributes':_0x29deef[_0xaed9('0x1d')],'include':_0x29deef['include']?_[_0xaed9('0x1e')](_0x29deef['include'],function(_0x3dab76){return{'model':db[_0x3dab76['model']],'as':_0x3dab76['as'],'attributes':_0x3dab76[_0xaed9('0x1d')],'include':_0x3dab76[_0xaed9('0x1f')]?_[_0xaed9('0x1e')](_0x3dab76['include'],function(_0x562406){return{'model':db[_0x562406[_0xaed9('0x20')]],'as':_0x562406['as'],'attributes':_0x562406['attributes']};}):[]};}):[]};}):[]:[]})[_0xaed9('0x21')](function(_0x5acf8b){logger['info'](_0xaed9('0x19'),_0x26044d);logger[_0xaed9('0x22')](_0xaed9('0x19'),_0x26044d,JSON[_0xaed9('0x14')](_0x5acf8b));_0x56e451(_0x5acf8b);})[_0xaed9('0x18')](function(_0x570396){logger['error'](_0xaed9('0x19'),_0x570396[_0xaed9('0x16')],_0x26044d);_0xa08ea8(_0x39524e['error'](0x1f4,_0x570396[_0xaed9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 479a7d7..fe158b9 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 _0xdf42=['register','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0x520d8d,_0x236ee2){var _0x2ebe1=function(_0x4edf73){while(--_0x4edf73){_0x520d8d['push'](_0x520d8d['shift']());}};_0x2ebe1(++_0x236ee2);}(_0xdf42,0x182));var _0x2df4=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xdf42[_0x341e0f];return _0x59555a;};'use strict';var SquareProjectEvents=require(_0x2df4('0x0'));var events=[_0x2df4('0x1'),_0x2df4('0x2'),_0x2df4('0x3')];function createListener(_0x3d8e87,_0x3bf72f){return function(_0x2dfe92){_0x3bf72f[_0x2df4('0x4')](_0x3d8e87,_0x2dfe92);};}function removeListener(_0xe1f2b8,_0x29acb8){return function(){SquareProjectEvents[_0x2df4('0x5')](_0xe1f2b8,_0x29acb8);};}exports[_0x2df4('0x6')]=function(_0x2719f6){for(var _0x14d8c7=0x0,_0x17b88f=events['length'];_0x14d8c7<_0x17b88f;_0x14d8c7++){var _0xf23779=events[_0x14d8c7];var _0x1cfff0=createListener(_0x2df4('0x7')+_0xf23779,_0x2719f6);SquareProjectEvents['on'](_0xf23779,_0x1cfff0);}}; \ No newline at end of file +var _0xf38e=['removeListener','length','save','remove','update'];(function(_0x2234fa,_0xfc8ae8){var _0xeb0629=function(_0x21d728){while(--_0x21d728){_0x2234fa['push'](_0x2234fa['shift']());}};_0xeb0629(++_0xfc8ae8);}(_0xf38e,0xed));var _0xef38=function(_0x114975,_0x2d1b2c){_0x114975=_0x114975-0x0;var _0x4cdaa5=_0xf38e[_0x114975];return _0x4cdaa5;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xef38('0x0'),_0xef38('0x1'),_0xef38('0x2')];function createListener(_0x54b8e9,_0x264e2b){return function(_0x1f92e0){_0x264e2b['emit'](_0x54b8e9,_0x1f92e0);};}function removeListener(_0x3baae8,_0x531bc4){return function(){SquareProjectEvents[_0xef38('0x3')](_0x3baae8,_0x531bc4);};}exports['register']=function(_0x14ecfc){for(var _0x3feb1e=0x0,_0x577e49=events[_0xef38('0x4')];_0x3feb1e<_0x577e49;_0x3feb1e++){var _0x1b5eb4=events[_0x3feb1e];var _0x39b615=createListener('squareProject:'+_0x1b5eb4,_0x14ecfc);SquareProjectEvents['on'](_0x1b5eb4,_0x39b615);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 3ab14c3..b8a8a59 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 _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x289f16,_0x441291){var _0x114eb9=function(_0x3f911b){while(--_0x3f911b){_0x289f16['push'](_0x289f16['shift']());}};_0x114eb9(++_0x441291);}(_0xe14b,0x93));var _0xbe14=function(_0xf6fae2,_0x51c235){_0xf6fae2=_0xf6fae2-0x0;var _0x186341=_0xe14b[_0xf6fae2];return _0x186341;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x14b059,_0x122c7a){var _0x2d41bd=function(_0x189e07){while(--_0x189e07){_0x14b059['push'](_0x14b059['shift']());}};_0x2d41bd(++_0x122c7a);}(_0x5fab,0x177));var _0xb5fa=function(_0x136a01,_0x3e0f10){_0x136a01=_0x136a01-0x0;var _0x39ccee=_0x5fab[_0x136a01];return _0x39ccee;};'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('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f9975c0..74c025a 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 _0xee14=['VIRTUAL','getDataValue','savePath','substring','STRING'];(function(_0x50312d,_0x1d1cc2){var _0x2376ad=function(_0x4b9c17){while(--_0x4b9c17){_0x50312d['push'](_0x50312d['shift']());}};_0x2376ad(++_0x1d1cc2);}(_0xee14,0x13a));var _0x4ee1=function(_0x1ad6c6,_0x482b7b){_0x1ad6c6=_0x1ad6c6-0x0;var _0x9dcb73=_0xee14[_0x1ad6c6];return _0x9dcb73;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4ee1('0x0')]},'callerid':{'type':Sequelize[_0x4ee1('0x0')]},'calleridname':{'type':Sequelize[_0x4ee1('0x0')]},'context':{'type':Sequelize[_0x4ee1('0x0')]},'extension':{'type':Sequelize[_0x4ee1('0x0')]},'priority':{'type':Sequelize[_0x4ee1('0x0')]},'accountcode':{'type':Sequelize[_0x4ee1('0x0')]},'dnid':{'type':Sequelize[_0x4ee1('0x0')]},'projectName':{'type':Sequelize[_0x4ee1('0x0')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4ee1('0x0')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x4ee1('0x1')],'get':function(){var _0x3a45a3='';var _0x187656=this[_0x4ee1('0x2')](_0x4ee1('0x3'));if(_0x187656){_0x3a45a3=_0x187656[_0x4ee1('0x4')](_0x187656['lastIndexOf']('.'));}return _0x3a45a3;}}}; \ No newline at end of file +var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x1818f4,_0x4464d2){var _0xb4fa7c=function(_0x5ba35e){while(--_0x5ba35e){_0x1818f4['push'](_0x1818f4['shift']());}};_0xb4fa7c(++_0x4464d2);}(_0x032e,0x124));var _0xe032=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x032e[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 76bb531..27f8e4b 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 _0x1ae2=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','SquareRecording','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','map','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','../../components/encryptor','uniqueid','filename','savePath','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1ad901,_0x308bcc){var _0x36d37d=function(_0x32318e){while(--_0x32318e){_0x1ad901['push'](_0x1ad901['shift']());}};_0x36d37d(++_0x308bcc);}(_0x1ae2,0xb8));var _0x21ae=function(_0x236548,_0x5d0bcd){_0x236548=_0x236548-0x0;var _0x2d6c82=_0x1ae2[_0x236548];return _0x2d6c82;};'use strict';var emlformat=require(_0x21ae('0x0'));var rimraf=require(_0x21ae('0x1'));var zipdir=require(_0x21ae('0x2'));var jsonpatch=require(_0x21ae('0x3'));var rp=require(_0x21ae('0x4'));var moment=require('moment');var BPromise=require(_0x21ae('0x5'));var Mustache=require('mustache');var util=require(_0x21ae('0x6'));var path=require(_0x21ae('0x7'));var sox=require(_0x21ae('0x8'));var csv=require(_0x21ae('0x9'));var ejs=require(_0x21ae('0xa'));var fs=require('fs');var fs_extra=require(_0x21ae('0xb'));var _=require(_0x21ae('0xc'));var squel=require(_0x21ae('0xd'));var crypto=require(_0x21ae('0xe'));var jsforce=require(_0x21ae('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x21ae('0x9'));var querystring=require(_0x21ae('0x10'));var Papa=require(_0x21ae('0x11'));var Redis=require(_0x21ae('0x12'));var authService=require(_0x21ae('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x21ae('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x21ae('0x15'));var utils=require(_0x21ae('0x16'));var config=require(_0x21ae('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ffa81,_0x16a908){_0x16a908=_0x16a908||0xcc;return function(_0xbf83eb){if(_0xbf83eb){return _0x2ffa81['sendStatus'](_0x16a908);}return _0x2ffa81['status'](_0x16a908)[_0x21ae('0x18')]();};}function respondWithResult(_0x794521,_0x46cb79){_0x46cb79=_0x46cb79||0xc8;return function(_0x624c08){if(_0x624c08){return _0x794521[_0x21ae('0x19')](_0x46cb79)[_0x21ae('0x1a')](_0x624c08);}};}function respondWithFilteredResult(_0x266bb1,_0x39d5db){return function(_0x239922){if(_0x239922){var _0x4aba65=typeof _0x39d5db[_0x21ae('0x1b')]===_0x21ae('0x1c')&&typeof _0x39d5db[_0x21ae('0x1d')]===_0x21ae('0x1c');var _0xe0657f=_0x239922[_0x21ae('0x1e')];var _0x571824=_0x4aba65?0x0:_0x39d5db['offset'];var _0x15ec84=_0x4aba65?_0x239922[_0x21ae('0x1e')]:_0x39d5db[_0x21ae('0x1b')]+_0x39d5db[_0x21ae('0x1d')];var _0x1acaaf;if(_0x15ec84>=_0xe0657f){_0x15ec84=_0xe0657f;_0x1acaaf=0xc8;}else{_0x1acaaf=0xce;}_0x266bb1['status'](_0x1acaaf);return _0x266bb1[_0x21ae('0x1f')]('Content-Range',_0x571824+'-'+_0x15ec84+'/'+_0xe0657f)[_0x21ae('0x1a')](_0x239922);}return null;};}function patchUpdates(_0x5ad8ca){return function(_0x5c224f){try{jsonpatch[_0x21ae('0x20')](_0x5c224f,_0x5ad8ca,!![]);}catch(_0x122648){return BPromise['reject'](_0x122648);}return _0x5c224f[_0x21ae('0x21')]();};}function saveUpdates(_0x5e13c1,_0x4a6c0c){return function(_0x33a081){if(_0x33a081){return _0x33a081[_0x21ae('0x22')](_0x5e13c1)[_0x21ae('0x23')](function(_0x212b1a){return _0x212b1a;});}return null;};}function removeEntity(_0x5285cf,_0x8c6b25){return function(_0x2630ed){if(_0x2630ed){return _0x2630ed[_0x21ae('0x24')]()[_0x21ae('0x23')](function(){_0x5285cf[_0x21ae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57cb20,_0x198f13){return function(_0x47dcbb){if(!_0x47dcbb){_0x57cb20[_0x21ae('0x25')](0x194);}return _0x47dcbb;};}function handleError(_0xdea95b,_0x4ef16a){_0x4ef16a=_0x4ef16a||0x1f4;return function(_0x169b4b){logger[_0x21ae('0x26')](_0x169b4b[_0x21ae('0x27')]);if(_0x169b4b['name']){delete _0x169b4b[_0x21ae('0x28')];}_0xdea95b[_0x21ae('0x19')](_0x4ef16a)[_0x21ae('0x29')](_0x169b4b);};}exports[_0x21ae('0x2a')]=function(_0x50dde8,_0x20f3b1){var _0x4bd79b={},_0x41e3b1={},_0x1c02dd={'count':0x0,'rows':[]};var _0x10d937=_['map'](db[_0x21ae('0x2b')]['rawAttributes'],function(_0x533563){return{'name':_0x533563[_0x21ae('0x2c')],'type':_0x533563[_0x21ae('0x2d')][_0x21ae('0x2e')]};});_0x41e3b1[_0x21ae('0x2f')]=_['map'](_0x10d937,_0x21ae('0x28'));_0x41e3b1[_0x21ae('0x30')]=_['keys'](_0x50dde8[_0x21ae('0x30')]);_0x41e3b1['filters']=_['intersection'](_0x41e3b1[_0x21ae('0x2f')],_0x41e3b1['query']);_0x4bd79b[_0x21ae('0x31')]=_['intersection'](_0x41e3b1[_0x21ae('0x2f')],qs[_0x21ae('0x32')](_0x50dde8[_0x21ae('0x30')]['fields']));_0x4bd79b[_0x21ae('0x31')]=_0x4bd79b[_0x21ae('0x31')][_0x21ae('0x33')]?_0x4bd79b[_0x21ae('0x31')]:_0x41e3b1[_0x21ae('0x2f')];if(!_0x50dde8['query'][_0x21ae('0x34')](_0x21ae('0x35'))){_0x4bd79b[_0x21ae('0x1d')]=qs[_0x21ae('0x1d')](_0x50dde8['query'][_0x21ae('0x1d')]);_0x4bd79b[_0x21ae('0x1b')]=qs[_0x21ae('0x1b')](_0x50dde8['query'][_0x21ae('0x1b')]);}_0x4bd79b[_0x21ae('0x36')]=qs[_0x21ae('0x37')](_0x50dde8[_0x21ae('0x30')][_0x21ae('0x37')]);_0x4bd79b['where']=qs[_0x21ae('0x38')](_[_0x21ae('0x39')](_0x50dde8[_0x21ae('0x30')],_0x41e3b1[_0x21ae('0x38')]),_0x10d937);if(_0x50dde8['query']['filter']){_0x4bd79b[_0x21ae('0x3a')]=_['merge'](_0x4bd79b[_0x21ae('0x3a')],{'$or':_[_0x21ae('0x3b')](_0x10d937,function(_0x2888ef){if(_0x2888ef[_0x21ae('0x2d')]!==_0x21ae('0x3c')){var _0x24dc07={};_0x24dc07[_0x2888ef[_0x21ae('0x28')]]={'$like':'%'+_0x50dde8[_0x21ae('0x30')][_0x21ae('0x3d')]+'%'};return _0x24dc07;}})});}_0x4bd79b=_[_0x21ae('0x3e')]({},_0x4bd79b,_0x50dde8[_0x21ae('0x3f')]);var _0xaef4e0={'where':_0x4bd79b[_0x21ae('0x3a')]};return db['SquareRecording'][_0x21ae('0x1e')](_0xaef4e0)[_0x21ae('0x23')](function(_0x389fa9){_0x1c02dd[_0x21ae('0x1e')]=_0x389fa9;if(_0x50dde8['query']['includeAll']){_0x4bd79b[_0x21ae('0x40')]=[{'all':!![]}];}return db[_0x21ae('0x2b')][_0x21ae('0x41')](_0x4bd79b);})[_0x21ae('0x23')](function(_0x25fffe){_0x1c02dd[_0x21ae('0x42')]=_0x25fffe;return _0x1c02dd;})['then'](respondWithFilteredResult(_0x20f3b1,_0x4bd79b))[_0x21ae('0x43')](handleError(_0x20f3b1,null));};exports[_0x21ae('0x44')]=function(_0x8ebf58,_0x5303e1){var _0x296a1e={'raw':!![],'where':{'id':_0x8ebf58[_0x21ae('0x45')]['id']}},_0x45d840={};_0x45d840['model']=_[_0x21ae('0x46')](db[_0x21ae('0x2b')]['rawAttributes']);_0x45d840['query']=_[_0x21ae('0x46')](_0x8ebf58[_0x21ae('0x30')]);_0x45d840[_0x21ae('0x38')]=_[_0x21ae('0x47')](_0x45d840[_0x21ae('0x2f')],_0x45d840['query']);_0x296a1e[_0x21ae('0x31')]=_[_0x21ae('0x47')](_0x45d840[_0x21ae('0x2f')],qs[_0x21ae('0x32')](_0x8ebf58[_0x21ae('0x30')][_0x21ae('0x32')]));_0x296a1e[_0x21ae('0x31')]=_0x296a1e['attributes'][_0x21ae('0x33')]?_0x296a1e[_0x21ae('0x31')]:_0x45d840['model'];if(_0x8ebf58[_0x21ae('0x30')][_0x21ae('0x48')]){_0x296a1e['include']=[{'all':!![]}];}_0x296a1e=_[_0x21ae('0x3e')]({},_0x296a1e,_0x8ebf58['options']);return db[_0x21ae('0x2b')][_0x21ae('0x49')](_0x296a1e)[_0x21ae('0x23')](handleEntityNotFound(_0x5303e1,null))[_0x21ae('0x23')](respondWithResult(_0x5303e1,null))[_0x21ae('0x43')](handleError(_0x5303e1,null));};exports[_0x21ae('0x4a')]=function(_0x3465a8,_0x1c1ade){return db[_0x21ae('0x2b')][_0x21ae('0x4a')](_0x3465a8[_0x21ae('0x4b')],{})[_0x21ae('0x23')](respondWithResult(_0x1c1ade,0xc9))[_0x21ae('0x43')](handleError(_0x1c1ade,null));};exports[_0x21ae('0x22')]=function(_0x33ea40,_0x2d7a62){if(_0x33ea40['body']['id']){delete _0x33ea40[_0x21ae('0x4b')]['id'];}return db[_0x21ae('0x2b')][_0x21ae('0x49')]({'where':{'id':_0x33ea40[_0x21ae('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d7a62,null))[_0x21ae('0x23')](saveUpdates(_0x33ea40[_0x21ae('0x4b')],null))[_0x21ae('0x23')](respondWithResult(_0x2d7a62,null))[_0x21ae('0x43')](handleError(_0x2d7a62,null));};exports['download']=function(_0x11b450,_0x3439a9,_0x3a805e){var _0xebe9b7=require(_0x21ae('0x4c'));var _0x2b5044=![];var _0x272897={};if(_0x11b450[_0x21ae('0x30')][_0x21ae('0x2d')]&&_0x11b450[_0x21ae('0x30')][_0x21ae('0x2d')]===_0x21ae('0x4d')){_0x272897[_0x21ae('0x4d')]=_0x11b450[_0x21ae('0x45')]['id'];}else{_0x272897['id']=_0x11b450['params']['id'];}return db[_0x21ae('0x2b')][_0x21ae('0x49')]({'where':_0x272897,'attributes':['id','savePath',_0x21ae('0x4e')],'raw':!![]})[_0x21ae('0x23')](handleEntityNotFound(_0x3439a9,null))[_0x21ae('0x23')](function(_0x44c6cb){if(_0x44c6cb){var _0x54f2ba=_0x44c6cb[_0x21ae('0x4f')];var _0x4f8aca=util['format']('%s.cypher',_0x54f2ba);if(fs[_0x21ae('0x50')](_0x4f8aca)){_0x2b5044=!![];return _0xebe9b7[_0x21ae('0x51')](_0x4f8aca,_0x54f2ba,config[_0x21ae('0x52')][_0x21ae('0x53')])[_0x21ae('0x23')](function(){return _0x44c6cb;});}return _0x44c6cb;}})[_0x21ae('0x23')](function(_0x82afc1){if(_0x82afc1){var _0x28c1a0=_0x82afc1['savePath'];if(!fs[_0x21ae('0x50')](_0x28c1a0)){throw new db['Sequelize'][(_0x21ae('0x54'))](_0x21ae('0x55'));}if(_0x82afc1[_0x21ae('0x4e')]){return _0x3439a9[_0x21ae('0x56')](_0x28c1a0,_0x82afc1['filename']+path[_0x21ae('0x57')](_0x28c1a0),function(){if(_0x2b5044){fs[_0x21ae('0x58')](_0x28c1a0);}});}else{return _0x3439a9[_0x21ae('0x56')](_0x28c1a0,function(_0x1e90ec){if(_0x2b5044){fs[_0x21ae('0x58')](_0x28c1a0);}});}}})['catch'](function(_0x1604a3){if(_0x1604a3[_0x21ae('0x59')]===_0x21ae('0x55')){_0x3439a9[_0x21ae('0x19')](0x194)[_0x21ae('0x29')](_0x21ae('0x5a'));}else{return handleError(_0x3439a9,null);}});};exports[_0x21ae('0x24')]=function(_0x17cd4a,_0x415252){return db[_0x21ae('0x2b')][_0x21ae('0x49')]({'where':{'id':_0x17cd4a[_0x21ae('0x45')]['id']}})['then'](function(_0x5e74d4){if(_[_0x21ae('0x5b')](_0x5e74d4)){throw new ReferenceError(_0x21ae('0x5c'));}return _0x5e74d4;})[_0x21ae('0x23')](function(_0x1c5e54){var _0x144fe6=_0x1c5e54[_0x21ae('0x4f')];logger[_0x21ae('0x5d')](_0x21ae('0x5e'),_0x144fe6);if(!_[_0x21ae('0x5b')](_0x1c5e54[_0x21ae('0x4f')])&&fs[_0x21ae('0x50')](_0x144fe6)){logger[_0x21ae('0x5d')](_0x21ae('0x5f')+_0x144fe6+_0x21ae('0x60'));fs[_0x21ae('0x61')](_0x144fe6);}_0x144fe6=_0x144fe6+_0x21ae('0x62');if(!_['isNil'](_0x1c5e54[_0x21ae('0x4f')])&&fs['existsSync'](_0x144fe6)){logger[_0x21ae('0x5d')](_0x21ae('0x5f')+_0x144fe6+_0x21ae('0x60'));fs[_0x21ae('0x61')](_0x144fe6);}return _0x1c5e54;})[_0x21ae('0x23')](function(_0x1cef82){if(!_0x1cef82)throw new InternalError();return _0x1cef82[_0x21ae('0x24')]();})[_0x21ae('0x23')](function(){_0x415252[_0x21ae('0x19')](0xcc)[_0x21ae('0x18')]();})[_0x21ae('0x43')](handleError(_0x415252,null));}; \ No newline at end of file +var _0xe9ce=['fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','catch','show','params','keys','length','includeAll','find','create','body','download','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','SquareRecording','rawAttributes','type','model','map','query','intersection','attributes'];(function(_0x3a14e1,_0x423ef6){var _0x85f749=function(_0x11b1fa){while(--_0x11b1fa){_0x3a14e1['push'](_0x3a14e1['shift']());}};_0x85f749(++_0x423ef6);}(_0xe9ce,0x1b9));var _0xee9c=function(_0x1d0fa6,_0x1a81d9){_0x1d0fa6=_0x1d0fa6-0x0;var _0x73b952=_0xe9ce[_0x1d0fa6];return _0x73b952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee9c('0x0'));var zipdir=require(_0xee9c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee9c('0x2'));var moment=require('moment');var BPromise=require(_0xee9c('0x3'));var Mustache=require('mustache');var util=require(_0xee9c('0x4'));var path=require(_0xee9c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee9c('0x6'));var fs=require('fs');var fs_extra=require(_0xee9c('0x7'));var _=require(_0xee9c('0x8'));var squel=require(_0xee9c('0x9'));var crypto=require(_0xee9c('0xa'));var jsforce=require(_0xee9c('0xb'));var deskjs=require(_0xee9c('0xc'));var toCsv=require(_0xee9c('0xd'));var querystring=require(_0xee9c('0xe'));var Papa=require(_0xee9c('0xf'));var Redis=require(_0xee9c('0x10'));var authService=require(_0xee9c('0x11'));var qs=require(_0xee9c('0x12'));var as=require(_0xee9c('0x13'));var hardwareService=require(_0xee9c('0x14'));var logger=require(_0xee9c('0x15'))(_0xee9c('0x16'));var utils=require(_0xee9c('0x17'));var config=require(_0xee9c('0x18'));var licenseUtil=require(_0xee9c('0x19'));var db=require(_0xee9c('0x1a'))['db'];function respondWithStatusCode(_0x49cd85,_0x48a53e){_0x48a53e=_0x48a53e||0xcc;return function(_0x19252b){if(_0x19252b){return _0x49cd85['sendStatus'](_0x48a53e);}return _0x49cd85[_0xee9c('0x1b')](_0x48a53e)['end']();};}function respondWithResult(_0x4c5278,_0x2f0322){_0x2f0322=_0x2f0322||0xc8;return function(_0x1eb5f2){if(_0x1eb5f2){return _0x4c5278[_0xee9c('0x1b')](_0x2f0322)[_0xee9c('0x1c')](_0x1eb5f2);}};}function respondWithFilteredResult(_0x4d38a3,_0x34a572){return function(_0x21072f){if(_0x21072f){var _0x13658c=typeof _0x34a572[_0xee9c('0x1d')]===_0xee9c('0x1e')&&typeof _0x34a572[_0xee9c('0x1f')]===_0xee9c('0x1e');var _0x1f1566=_0x21072f[_0xee9c('0x20')];var _0xe3a8a3=_0x13658c?0x0:_0x34a572[_0xee9c('0x1d')];var _0x4ac0e3=_0x13658c?_0x21072f['count']:_0x34a572[_0xee9c('0x1d')]+_0x34a572[_0xee9c('0x1f')];var _0x146335;if(_0x4ac0e3>=_0x1f1566){_0x4ac0e3=_0x1f1566;_0x146335=0xc8;}else{_0x146335=0xce;}_0x4d38a3[_0xee9c('0x1b')](_0x146335);return _0x4d38a3['set'](_0xee9c('0x21'),_0xe3a8a3+'-'+_0x4ac0e3+'/'+_0x1f1566)[_0xee9c('0x1c')](_0x21072f);}return null;};}function patchUpdates(_0x2060f5){return function(_0xa34083){try{jsonpatch[_0xee9c('0x22')](_0xa34083,_0x2060f5,!![]);}catch(_0xcbcfa3){return BPromise[_0xee9c('0x23')](_0xcbcfa3);}return _0xa34083[_0xee9c('0x24')]();};}function saveUpdates(_0x509441,_0x1cfdd2){return function(_0x406cff){if(_0x406cff){return _0x406cff[_0xee9c('0x25')](_0x509441)[_0xee9c('0x26')](function(_0x3f64ef){return _0x3f64ef;});}return null;};}function removeEntity(_0x5a0e20,_0x4ad4fd){return function(_0x5e1eeb){if(_0x5e1eeb){return _0x5e1eeb[_0xee9c('0x27')]()[_0xee9c('0x26')](function(){_0x5a0e20[_0xee9c('0x1b')](0xcc)[_0xee9c('0x28')]();});}};}function handleEntityNotFound(_0x49d968,_0x417559){return function(_0x54c632){if(!_0x54c632){_0x49d968[_0xee9c('0x29')](0x194);}return _0x54c632;};}function handleError(_0x38813c,_0x3ed09a){_0x3ed09a=_0x3ed09a||0x1f4;return function(_0x10b097){logger[_0xee9c('0x2a')](_0x10b097['stack']);if(_0x10b097[_0xee9c('0x2b')]){delete _0x10b097[_0xee9c('0x2b')];}_0x38813c['status'](_0x3ed09a)[_0xee9c('0x2c')](_0x10b097);};}exports[_0xee9c('0x2d')]=function(_0x321b4d,_0x4e6579){var _0x2c9df1={},_0x22604b={},_0x5d9148={'count':0x0,'rows':[]};var _0x18ea91=_['map'](db[_0xee9c('0x2e')][_0xee9c('0x2f')],function(_0x42fb58){return{'name':_0x42fb58['fieldName'],'type':_0x42fb58[_0xee9c('0x30')]['key']};});_0x22604b[_0xee9c('0x31')]=_[_0xee9c('0x32')](_0x18ea91,_0xee9c('0x2b'));_0x22604b['query']=_['keys'](_0x321b4d[_0xee9c('0x33')]);_0x22604b['filters']=_[_0xee9c('0x34')](_0x22604b['model'],_0x22604b[_0xee9c('0x33')]);_0x2c9df1[_0xee9c('0x35')]=_[_0xee9c('0x34')](_0x22604b[_0xee9c('0x31')],qs[_0xee9c('0x36')](_0x321b4d[_0xee9c('0x33')][_0xee9c('0x36')]));_0x2c9df1[_0xee9c('0x35')]=_0x2c9df1[_0xee9c('0x35')]['length']?_0x2c9df1[_0xee9c('0x35')]:_0x22604b[_0xee9c('0x31')];if(!_0x321b4d[_0xee9c('0x33')][_0xee9c('0x37')](_0xee9c('0x38'))){_0x2c9df1[_0xee9c('0x1f')]=qs[_0xee9c('0x1f')](_0x321b4d[_0xee9c('0x33')]['limit']);_0x2c9df1[_0xee9c('0x1d')]=qs[_0xee9c('0x1d')](_0x321b4d['query']['offset']);}_0x2c9df1[_0xee9c('0x39')]=qs[_0xee9c('0x3a')](_0x321b4d[_0xee9c('0x33')][_0xee9c('0x3a')]);_0x2c9df1[_0xee9c('0x3b')]=qs[_0xee9c('0x3c')](_[_0xee9c('0x3d')](_0x321b4d[_0xee9c('0x33')],_0x22604b[_0xee9c('0x3c')]),_0x18ea91);if(_0x321b4d[_0xee9c('0x33')][_0xee9c('0x3e')]){_0x2c9df1[_0xee9c('0x3b')]=_[_0xee9c('0x3f')](_0x2c9df1['where'],{'$or':_[_0xee9c('0x32')](_0x18ea91,function(_0x4dc612){if(_0x4dc612[_0xee9c('0x30')]!==_0xee9c('0x40')){var _0x55e043={};_0x55e043[_0x4dc612[_0xee9c('0x2b')]]={'$like':'%'+_0x321b4d[_0xee9c('0x33')][_0xee9c('0x3e')]+'%'};return _0x55e043;}})});}_0x2c9df1=_[_0xee9c('0x3f')]({},_0x2c9df1,_0x321b4d['options']);var _0x49c652={'where':_0x2c9df1[_0xee9c('0x3b')]};return db['SquareRecording']['count'](_0x49c652)[_0xee9c('0x26')](function(_0xffa56b){_0x5d9148['count']=_0xffa56b;if(_0x321b4d[_0xee9c('0x33')]['includeAll']){_0x2c9df1[_0xee9c('0x41')]=[{'all':!![]}];}return db[_0xee9c('0x2e')]['findAll'](_0x2c9df1);})[_0xee9c('0x26')](function(_0x53dac5){_0x5d9148['rows']=_0x53dac5;return _0x5d9148;})[_0xee9c('0x26')](respondWithFilteredResult(_0x4e6579,_0x2c9df1))[_0xee9c('0x42')](handleError(_0x4e6579,null));};exports[_0xee9c('0x43')]=function(_0x5bc926,_0x57e147){var _0x7d01f8={'raw':!![],'where':{'id':_0x5bc926[_0xee9c('0x44')]['id']}},_0x1f28d4={};_0x1f28d4['model']=_[_0xee9c('0x45')](db[_0xee9c('0x2e')][_0xee9c('0x2f')]);_0x1f28d4[_0xee9c('0x33')]=_[_0xee9c('0x45')](_0x5bc926[_0xee9c('0x33')]);_0x1f28d4[_0xee9c('0x3c')]=_[_0xee9c('0x34')](_0x1f28d4[_0xee9c('0x31')],_0x1f28d4[_0xee9c('0x33')]);_0x7d01f8[_0xee9c('0x35')]=_[_0xee9c('0x34')](_0x1f28d4[_0xee9c('0x31')],qs[_0xee9c('0x36')](_0x5bc926[_0xee9c('0x33')][_0xee9c('0x36')]));_0x7d01f8[_0xee9c('0x35')]=_0x7d01f8[_0xee9c('0x35')][_0xee9c('0x46')]?_0x7d01f8[_0xee9c('0x35')]:_0x1f28d4[_0xee9c('0x31')];if(_0x5bc926[_0xee9c('0x33')][_0xee9c('0x47')]){_0x7d01f8[_0xee9c('0x41')]=[{'all':!![]}];}_0x7d01f8=_[_0xee9c('0x3f')]({},_0x7d01f8,_0x5bc926['options']);return db['SquareRecording'][_0xee9c('0x48')](_0x7d01f8)[_0xee9c('0x26')](handleEntityNotFound(_0x57e147,null))[_0xee9c('0x26')](respondWithResult(_0x57e147,null))[_0xee9c('0x42')](handleError(_0x57e147,null));};exports['create']=function(_0x49dc98,_0x1c0aae){return db[_0xee9c('0x2e')][_0xee9c('0x49')](_0x49dc98['body'],{})[_0xee9c('0x26')](respondWithResult(_0x1c0aae,0xc9))[_0xee9c('0x42')](handleError(_0x1c0aae,null));};exports['update']=function(_0x445c92,_0x381adc){if(_0x445c92[_0xee9c('0x4a')]['id']){delete _0x445c92[_0xee9c('0x4a')]['id'];}return db[_0xee9c('0x2e')][_0xee9c('0x48')]({'where':{'id':_0x445c92[_0xee9c('0x44')]['id']}})['then'](handleEntityNotFound(_0x381adc,null))[_0xee9c('0x26')](saveUpdates(_0x445c92[_0xee9c('0x4a')],null))[_0xee9c('0x26')](respondWithResult(_0x381adc,null))[_0xee9c('0x42')](handleError(_0x381adc,null));};exports[_0xee9c('0x4b')]=function(_0x517cef,_0x12925d,_0x190e16){var _0x33ed01=require('../../components/encryptor');var _0x4cdfd1=![];var _0xa3b375={};if(_0x517cef[_0xee9c('0x33')][_0xee9c('0x30')]&&_0x517cef[_0xee9c('0x33')]['type']==='uniqueid'){_0xa3b375['uniqueid']=_0x517cef[_0xee9c('0x44')]['id'];}else{_0xa3b375['id']=_0x517cef['params']['id'];}return db[_0xee9c('0x2e')]['find']({'where':_0xa3b375,'attributes':['id',_0xee9c('0x4c'),_0xee9c('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x12925d,null))[_0xee9c('0x26')](function(_0x30e63c){if(_0x30e63c){var _0x4bdcb2=_0x30e63c[_0xee9c('0x4c')];var _0x463a0d=util[_0xee9c('0x4e')](_0xee9c('0x4f'),_0x4bdcb2);if(fs['existsSync'](_0x463a0d)){_0x4cdfd1=!![];return _0x33ed01[_0xee9c('0x50')](_0x463a0d,_0x4bdcb2,config[_0xee9c('0x51')][_0xee9c('0x52')])[_0xee9c('0x26')](function(){return _0x30e63c;});}return _0x30e63c;}})['then'](function(_0x473d2b){if(_0x473d2b){var _0x54cfeb=_0x473d2b[_0xee9c('0x4c')];if(!fs[_0xee9c('0x53')](_0x54cfeb)){throw new db[(_0xee9c('0x54'))][(_0xee9c('0x55'))]('SquareRecording\x20not\x20found');}if(_0x473d2b['filename']){return _0x12925d['download'](_0x54cfeb,_0x473d2b['filename']+path[_0xee9c('0x56')](_0x54cfeb),function(){if(_0x4cdfd1){fs[_0xee9c('0x57')](_0x54cfeb);}});}else{return _0x12925d[_0xee9c('0x4b')](_0x54cfeb,function(_0x142595){if(_0x4cdfd1){fs[_0xee9c('0x57')](_0x54cfeb);}});}}})[_0xee9c('0x42')](function(_0x3176e6){if(_0x3176e6[_0xee9c('0x58')]===_0xee9c('0x59')){_0x12925d['status'](0x194)[_0xee9c('0x2c')](_0xee9c('0x5a'));}else{return handleError(_0x12925d,null);}});};exports[_0xee9c('0x27')]=function(_0x43d5e4,_0x30f25b){return db[_0xee9c('0x2e')][_0xee9c('0x48')]({'where':{'id':_0x43d5e4[_0xee9c('0x44')]['id']}})[_0xee9c('0x26')](function(_0x4d024d){if(_[_0xee9c('0x5b')](_0x4d024d)){throw new ReferenceError(_0xee9c('0x5c'));}return _0x4d024d;})[_0xee9c('0x26')](function(_0x2d2231){var _0x483bfb=_0x2d2231[_0xee9c('0x4c')];logger[_0xee9c('0x5d')](_0xee9c('0x5e'),_0x483bfb);if(!_[_0xee9c('0x5b')](_0x2d2231[_0xee9c('0x4c')])&&fs[_0xee9c('0x53')](_0x483bfb)){logger[_0xee9c('0x5d')]('File:\x20\x22'+_0x483bfb+_0xee9c('0x5f'));fs[_0xee9c('0x60')](_0x483bfb);}_0x483bfb=_0x483bfb+_0xee9c('0x61');if(!_[_0xee9c('0x5b')](_0x2d2231[_0xee9c('0x4c')])&&fs[_0xee9c('0x53')](_0x483bfb)){logger[_0xee9c('0x5d')](_0xee9c('0x62')+_0x483bfb+_0xee9c('0x5f'));fs[_0xee9c('0x60')](_0x483bfb);}return _0x2d2231;})['then'](function(_0x5a9640){if(!_0x5a9640)throw new InternalError();return _0x5a9640['destroy']();})[_0xee9c('0x26')](function(){_0x30f25b[_0xee9c('0x1b')](0xcc)['end']();})[_0xee9c('0x42')](handleError(_0x30f25b,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 4629ebf..04faa5f 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 _0xd9fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','square_recordings','lodash','util','../../config/logger'];(function(_0x54547d,_0x24d51f){var _0x333c1d=function(_0x4deeae){while(--_0x4deeae){_0x54547d['push'](_0x54547d['shift']());}};_0x333c1d(++_0x24d51f);}(_0xd9fb,0x189));var _0xbd9f=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xd9fb[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var logger=require(_0xbd9f('0x2'))(_0xbd9f('0x3'));var moment=require(_0xbd9f('0x4'));var BPromise=require(_0xbd9f('0x5'));var rp=require(_0xbd9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./squareRecording.attributes');module[_0xbd9f('0x9')]=function(_0x5b6052,_0x2e7eea){return _0x5b6052[_0xbd9f('0xa')]('SquareRecording',attributes,{'tableName':_0xbd9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f35=['SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','define'];(function(_0x4df822,_0x24e3de){var _0x213d53=function(_0x464065){while(--_0x464065){_0x4df822['push'](_0x4df822['shift']());}};_0x213d53(++_0x24e3de);}(_0x3f35,0x1ae));var _0x53f3=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x3f35[_0x4e4f0e];return _0x1a7219;};'use strict';var _=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var logger=require(_0x53f3('0x2'))(_0x53f3('0x3'));var moment=require(_0x53f3('0x4'));var BPromise=require(_0x53f3('0x5'));var rp=require(_0x53f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f3('0x7'));var config=require('../../config/environment');var attributes=require(_0x53f3('0x8'));module['exports']=function(_0x1b84bf,_0x325130){return _0x1b84bf[_0x53f3('0x9')](_0x53f3('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 4acd7a3..d6bc7c1 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 _0x88e8=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','options','then','debug','moment','bluebird'];(function(_0x1e8f8e,_0x4d974e){var _0x4ed7ba=function(_0x5d275d){while(--_0x5d275d){_0x1e8f8e['push'](_0x1e8f8e['shift']());}};_0x4ed7ba(++_0x4d974e);}(_0x88e8,0x16e));var _0x888e=function(_0x227bfa,_0x51bedc){_0x227bfa=_0x227bfa-0x0;var _0x331aba=_0x88e8[_0x227bfa];return _0x331aba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x888e('0x0'));var BPromise=require(_0x888e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x888e('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x888e('0x3'))(_0x888e('0x4'));var config=require(_0x888e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x888e('0x6')][_0x888e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x515052,_0x4a14ef,_0x4c47b1){return new BPromise(function(_0x52b058,_0x3be31f){return client['request'](_0x515052,_0x4c47b1)['then'](function(_0x54a857){logger[_0x888e('0x8')](_0x888e('0x9'),_0x4a14ef,_0x888e('0xa'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4a14ef,_0x888e('0xa'),JSON[_0x888e('0xb')](_0x54a857));if(_0x54a857[_0x888e('0xc')]){if(_0x54a857[_0x888e('0xc')][_0x888e('0xd')]===0x1f4){logger[_0x888e('0xc')]('SquareRecording,\x20%s,\x20%s',_0x4a14ef,_0x54a857[_0x888e('0xc')][_0x888e('0xe')]);return _0x3be31f(_0x54a857['error'][_0x888e('0xe')]);}logger[_0x888e('0xc')](_0x888e('0x9'),_0x4a14ef,_0x54a857[_0x888e('0xc')][_0x888e('0xe')]);return _0x52b058(_0x54a857[_0x888e('0xc')]['message']);}else{logger[_0x888e('0x8')](_0x888e('0x9'),_0x4a14ef,'request\x20sent');_0x52b058(_0x54a857[_0x888e('0xf')]['message']);}})[_0x888e('0x10')](function(_0x840fc1){logger[_0x888e('0xc')]('SquareRecording,\x20%s,\x20%s',_0x4a14ef,_0x840fc1);_0x3be31f(_0x840fc1);});});}exports[_0x888e('0x11')]=function(_0x19dbc0){var _0x58a28e=this;return new Promise(function(_0xfa3b4a,_0x753960){return db[_0x888e('0x12')]['create'](_0x19dbc0[_0x888e('0x13')],{'raw':_0x19dbc0[_0x888e('0x14')]?_0x19dbc0[_0x888e('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x888e('0x15')](function(_0x3997b0){logger[_0x888e('0x8')]('CreateSquareRecording',_0x19dbc0);logger[_0x888e('0x16')](_0x888e('0x11'),_0x19dbc0,JSON['stringify'](_0x3997b0));_0xfa3b4a(_0x3997b0);})[_0x888e('0x10')](function(_0x4f90f9){logger[_0x888e('0xc')](_0x888e('0x11'),_0x4f90f9[_0x888e('0xe')],_0x19dbc0);_0x753960(_0x58a28e[_0x888e('0xc')](0x1f4,_0x4f90f9[_0x888e('0xe')]));});});}; \ No newline at end of file +var _0x90aa=['raw','stringify','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','body','options'];(function(_0xe8425b,_0x58ce2c){var _0x1a6c78=function(_0x294a84){while(--_0x294a84){_0xe8425b['push'](_0xe8425b['shift']());}};_0x1a6c78(++_0x58ce2c);}(_0x90aa,0x152));var _0xa90a=function(_0x5c4cf7,_0x1319b4){_0x5c4cf7=_0x5c4cf7-0x0;var _0x3ffedb=_0x90aa[_0x5c4cf7];return _0x3ffedb;};'use strict';var _=require('lodash');var util=require(_0xa90a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa90a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa90a('0x2'))['db'];var utils=require(_0xa90a('0x3'));var logger=require(_0xa90a('0x4'))(_0xa90a('0x5'));var config=require(_0xa90a('0x6'));var jayson=require(_0xa90a('0x7'));var client=jayson['client'][_0xa90a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x140f2a,_0x22513a,_0xf21d13){return new BPromise(function(_0x1bcee8,_0x46e259){return client['request'](_0x140f2a,_0xf21d13)[_0xa90a('0x9')](function(_0x4a1174){logger[_0xa90a('0xa')]('SquareRecording,\x20%s,\x20%s',_0x22513a,_0xa90a('0xb'));logger[_0xa90a('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x22513a,'request\x20sent',JSON['stringify'](_0x4a1174));if(_0x4a1174['error']){if(_0x4a1174[_0xa90a('0xd')]['code']===0x1f4){logger[_0xa90a('0xd')](_0xa90a('0xe'),_0x22513a,_0x4a1174[_0xa90a('0xd')][_0xa90a('0xf')]);return _0x46e259(_0x4a1174[_0xa90a('0xd')]['message']);}logger[_0xa90a('0xd')](_0xa90a('0xe'),_0x22513a,_0x4a1174[_0xa90a('0xd')][_0xa90a('0xf')]);return _0x1bcee8(_0x4a1174[_0xa90a('0xd')][_0xa90a('0xf')]);}else{logger[_0xa90a('0xa')](_0xa90a('0xe'),_0x22513a,'request\x20sent');_0x1bcee8(_0x4a1174[_0xa90a('0x10')][_0xa90a('0xf')]);}})[_0xa90a('0x11')](function(_0x4b0f68){logger[_0xa90a('0xd')](_0xa90a('0xe'),_0x22513a,_0x4b0f68);_0x46e259(_0x4b0f68);});});}exports[_0xa90a('0x12')]=function(_0x1a5665){var _0x4c4c1c=this;return new Promise(function(_0x532985,_0x1df546){return db[_0xa90a('0x13')]['create'](_0x1a5665[_0xa90a('0x14')],{'raw':_0x1a5665[_0xa90a('0x15')]?_0x1a5665[_0xa90a('0x15')][_0xa90a('0x16')]===undefined?!![]:![]:!![]})[_0xa90a('0x9')](function(_0x27c9da){logger[_0xa90a('0xa')](_0xa90a('0x12'),_0x1a5665);logger[_0xa90a('0xc')](_0xa90a('0x12'),_0x1a5665,JSON[_0xa90a('0x17')](_0x27c9da));_0x532985(_0x27c9da);})[_0xa90a('0x11')](function(_0xe4fea5){logger[_0xa90a('0xd')](_0xa90a('0x12'),_0xe4fea5['message'],_0x1a5665);_0x1df546(_0x4c4c1c[_0xa90a('0xd')](0x1f4,_0xe4fea5[_0xa90a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index eff0879..6b98d28 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1fdcb6,_0xc8986e){var _0xda3086=function(_0x43b044){while(--_0x43b044){_0x1fdcb6['push'](_0x1fdcb6['shift']());}};_0xda3086(++_0xc8986e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0x54e631,_0x3b8396){var _0x3c6b6a=function(_0x48cea6){while(--_0x48cea6){_0x54e631['push'](_0x54e631['shift']());}};_0x3c6b6a(++_0x3b8396);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index be3c7a8..ff03a0a 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 _0x30aa=['STRING','DATE','BOOLEAN','exports'];(function(_0x41dcab,_0x35e42d){var _0x24d1c8=function(_0x27987c){while(--_0x27987c){_0x41dcab['push'](_0x41dcab['shift']());}};_0x24d1c8(++_0x35e42d);}(_0x30aa,0x17b));var _0xa30a=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x30aa[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require('sequelize');module[_0xa30a('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xa30a('0x1')]},'request':{'type':Sequelize[_0xa30a('0x1')]},'channel':{'type':Sequelize[_0xa30a('0x1')]},'language':{'type':Sequelize[_0xa30a('0x1')]},'type':{'type':Sequelize[_0xa30a('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa30a('0x1')]},'calleridname':{'type':Sequelize[_0xa30a('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa30a('0x1')]},'callington':{'type':Sequelize[_0xa30a('0x1')]},'callingtns':{'type':Sequelize[_0xa30a('0x1')]},'dnid':{'type':Sequelize[_0xa30a('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa30a('0x1')]},'extension':{'type':Sequelize[_0xa30a('0x1')]},'priority':{'type':Sequelize[_0xa30a('0x1')]},'enhanced':{'type':Sequelize[_0xa30a('0x1')]},'accountcode':{'type':Sequelize[_0xa30a('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xa30a('0x1')]},'joinAt':{'type':Sequelize[_0xa30a('0x2')]},'leaveAt':{'type':Sequelize[_0xa30a('0x2')]},'bot':{'type':Sequelize[_0xa30a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xccc3=['sequelize','exports','STRING','DATE'];(function(_0x779cdb,_0x189bd2){var _0x4e31ec=function(_0x515414){while(--_0x515414){_0x779cdb['push'](_0x779cdb['shift']());}};_0x4e31ec(++_0x189bd2);}(_0xccc3,0x128));var _0x3ccc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xccc3[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x3ccc('0x0'));module[_0x3ccc('0x1')]={'network':{'type':Sequelize[_0x3ccc('0x2')]},'network_script':{'type':Sequelize[_0x3ccc('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3ccc('0x2')]},'language':{'type':Sequelize[_0x3ccc('0x2')]},'type':{'type':Sequelize[_0x3ccc('0x2')]},'uniqueid':{'type':Sequelize[_0x3ccc('0x2')]},'version':{'type':Sequelize[_0x3ccc('0x2')]},'callerid':{'type':Sequelize[_0x3ccc('0x2')]},'calleridname':{'type':Sequelize[_0x3ccc('0x2')]},'callingpres':{'type':Sequelize[_0x3ccc('0x2')]},'callingani2':{'type':Sequelize[_0x3ccc('0x2')]},'callington':{'type':Sequelize[_0x3ccc('0x2')]},'callingtns':{'type':Sequelize[_0x3ccc('0x2')]},'dnid':{'type':Sequelize[_0x3ccc('0x2')]},'rdnis':{'type':Sequelize[_0x3ccc('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3ccc('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x3ccc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x3ccc('0x2')]},'project_name':{'type':Sequelize[_0x3ccc('0x2')]},'joinAt':{'type':Sequelize[_0x3ccc('0x3')]},'leaveAt':{'type':Sequelize[_0x3ccc('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 84440c6..d62abe5 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 _0x6b22=['index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send'];(function(_0x54801d,_0x1baea4){var _0x1ef8a5=function(_0x481c4b){while(--_0x481c4b){_0x54801d['push'](_0x54801d['shift']());}};_0x1ef8a5(++_0x1baea4);}(_0x6b22,0x1eb));var _0x26b2=function(_0x806c7f,_0x5cc0b2){_0x806c7f=_0x806c7f-0x0;var _0x29f346=_0x6b22[_0x806c7f];return _0x29f346;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26b2('0x0'));var zipdir=require(_0x26b2('0x1'));var jsonpatch=require(_0x26b2('0x2'));var rp=require(_0x26b2('0x3'));var moment=require('moment');var BPromise=require(_0x26b2('0x4'));var Mustache=require(_0x26b2('0x5'));var util=require('util');var path=require(_0x26b2('0x6'));var sox=require(_0x26b2('0x7'));var csv=require(_0x26b2('0x8'));var ejs=require(_0x26b2('0x9'));var fs=require('fs');var fs_extra=require(_0x26b2('0xa'));var _=require(_0x26b2('0xb'));var squel=require(_0x26b2('0xc'));var crypto=require(_0x26b2('0xd'));var jsforce=require(_0x26b2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x26b2('0x8'));var querystring=require(_0x26b2('0xf'));var Papa=require(_0x26b2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x26b2('0x11'));var as=require(_0x26b2('0x12'));var hardwareService=require(_0x26b2('0x13'));var logger=require(_0x26b2('0x14'))(_0x26b2('0x15'));var utils=require(_0x26b2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26b2('0x17'))['db'];function respondWithStatusCode(_0x33e481,_0x32e62a){_0x32e62a=_0x32e62a||0xcc;return function(_0x3c8676){if(_0x3c8676){return _0x33e481['sendStatus'](_0x32e62a);}return _0x33e481[_0x26b2('0x18')](_0x32e62a)[_0x26b2('0x19')]();};}function respondWithResult(_0x9dc7a6,_0x757408){_0x757408=_0x757408||0xc8;return function(_0xa3e496){if(_0xa3e496){return _0x9dc7a6[_0x26b2('0x18')](_0x757408)[_0x26b2('0x1a')](_0xa3e496);}};}function respondWithFilteredResult(_0x2628fc,_0x20a032){return function(_0xdb48b2){if(_0xdb48b2){var _0x24d22b=typeof _0x20a032[_0x26b2('0x1b')]===_0x26b2('0x1c')&&typeof _0x20a032['limit']===_0x26b2('0x1c');var _0x106bc5=_0xdb48b2['count'];var _0x26c8ea=_0x24d22b?0x0:_0x20a032[_0x26b2('0x1b')];var _0x3d94b2=_0x24d22b?_0xdb48b2[_0x26b2('0x1d')]:_0x20a032[_0x26b2('0x1b')]+_0x20a032[_0x26b2('0x1e')];var _0x5646f8;if(_0x3d94b2>=_0x106bc5){_0x3d94b2=_0x106bc5;_0x5646f8=0xc8;}else{_0x5646f8=0xce;}_0x2628fc['status'](_0x5646f8);return _0x2628fc['set'](_0x26b2('0x1f'),_0x26c8ea+'-'+_0x3d94b2+'/'+_0x106bc5)[_0x26b2('0x1a')](_0xdb48b2);}return null;};}function patchUpdates(_0x16149c){return function(_0x38d2a6){try{jsonpatch['apply'](_0x38d2a6,_0x16149c,!![]);}catch(_0x1ec557){return BPromise[_0x26b2('0x20')](_0x1ec557);}return _0x38d2a6[_0x26b2('0x21')]();};}function saveUpdates(_0x5449f2,_0x287f25){return function(_0x37fc50){if(_0x37fc50){return _0x37fc50[_0x26b2('0x22')](_0x5449f2)[_0x26b2('0x23')](function(_0x5137c5){return _0x5137c5;});}return null;};}function removeEntity(_0x311e47,_0x4b6a9f){return function(_0x495965){if(_0x495965){return _0x495965[_0x26b2('0x24')]()[_0x26b2('0x23')](function(){_0x311e47[_0x26b2('0x18')](0xcc)[_0x26b2('0x19')]();});}};}function handleEntityNotFound(_0x1c3fe1,_0x3f12c0){return function(_0xb429ca){if(!_0xb429ca){_0x1c3fe1[_0x26b2('0x25')](0x194);}return _0xb429ca;};}function handleError(_0x40177d,_0x1c4a5a){_0x1c4a5a=_0x1c4a5a||0x1f4;return function(_0x1230ea){logger['error'](_0x1230ea[_0x26b2('0x26')]);if(_0x1230ea[_0x26b2('0x27')]){delete _0x1230ea['name'];}_0x40177d[_0x26b2('0x18')](_0x1c4a5a)[_0x26b2('0x28')](_0x1230ea);};}exports[_0x26b2('0x29')]=function(_0x2b610f,_0x1c9c69){var _0x13f542={},_0x245416={},_0x41f7d5={'count':0x0,'rows':[]};var _0x50c502=_[_0x26b2('0x2a')](db['SquareReport'][_0x26b2('0x2b')],function(_0x3d987f){return{'name':_0x3d987f[_0x26b2('0x2c')],'type':_0x3d987f[_0x26b2('0x2d')][_0x26b2('0x2e')]};});_0x245416['model']=_[_0x26b2('0x2a')](_0x50c502,_0x26b2('0x27'));_0x245416[_0x26b2('0x2f')]=_['keys'](_0x2b610f[_0x26b2('0x2f')]);_0x245416['filters']=_[_0x26b2('0x30')](_0x245416['model'],_0x245416[_0x26b2('0x2f')]);_0x13f542[_0x26b2('0x31')]=_[_0x26b2('0x30')](_0x245416[_0x26b2('0x32')],qs[_0x26b2('0x33')](_0x2b610f['query']['fields']));_0x13f542['attributes']=_0x13f542[_0x26b2('0x31')][_0x26b2('0x34')]?_0x13f542[_0x26b2('0x31')]:_0x245416['model'];if(!_0x2b610f[_0x26b2('0x2f')]['hasOwnProperty'](_0x26b2('0x35'))){_0x13f542[_0x26b2('0x1e')]=qs[_0x26b2('0x1e')](_0x2b610f[_0x26b2('0x2f')]['limit']);_0x13f542[_0x26b2('0x1b')]=qs[_0x26b2('0x1b')](_0x2b610f['query'][_0x26b2('0x1b')]);}_0x13f542[_0x26b2('0x36')]=qs['sort'](_0x2b610f[_0x26b2('0x2f')][_0x26b2('0x37')]);_0x13f542[_0x26b2('0x38')]=qs[_0x26b2('0x39')](_[_0x26b2('0x3a')](_0x2b610f[_0x26b2('0x2f')],_0x245416[_0x26b2('0x39')]),_0x50c502);if(_0x2b610f[_0x26b2('0x2f')][_0x26b2('0x3b')]){_0x13f542[_0x26b2('0x38')]=_[_0x26b2('0x3c')](_0x13f542['where'],{'$or':_[_0x26b2('0x2a')](_0x50c502,function(_0xb18355){if(_0xb18355['type']!==_0x26b2('0x3d')){var _0x519654={};_0x519654[_0xb18355[_0x26b2('0x27')]]={'$like':'%'+_0x2b610f[_0x26b2('0x2f')]['filter']+'%'};return _0x519654;}})});}_0x13f542=_['merge']({},_0x13f542,_0x2b610f[_0x26b2('0x3e')]);var _0x260a1f={'where':_0x13f542[_0x26b2('0x38')]};return db[_0x26b2('0x3f')][_0x26b2('0x1d')](_0x260a1f)['then'](function(_0x519dbd){_0x41f7d5[_0x26b2('0x1d')]=_0x519dbd;if(_0x2b610f[_0x26b2('0x2f')][_0x26b2('0x40')]){_0x13f542[_0x26b2('0x41')]=[{'all':!![]}];}return db[_0x26b2('0x3f')][_0x26b2('0x42')](_0x13f542);})[_0x26b2('0x23')](function(_0x3b1f06){_0x41f7d5[_0x26b2('0x43')]=_0x3b1f06;return _0x41f7d5;})[_0x26b2('0x23')](respondWithFilteredResult(_0x1c9c69,_0x13f542))['catch'](handleError(_0x1c9c69,null));};exports[_0x26b2('0x44')]=function(_0x51c6ba,_0x32d89b){var _0x5d542d={'raw':!![],'where':{'id':_0x51c6ba[_0x26b2('0x45')]['id']}},_0x451167={};_0x451167['model']=_[_0x26b2('0x46')](db[_0x26b2('0x3f')][_0x26b2('0x2b')]);_0x451167[_0x26b2('0x2f')]=_['keys'](_0x51c6ba[_0x26b2('0x2f')]);_0x451167[_0x26b2('0x39')]=_[_0x26b2('0x30')](_0x451167[_0x26b2('0x32')],_0x451167[_0x26b2('0x2f')]);_0x5d542d[_0x26b2('0x31')]=_[_0x26b2('0x30')](_0x451167[_0x26b2('0x32')],qs[_0x26b2('0x33')](_0x51c6ba[_0x26b2('0x2f')]['fields']));_0x5d542d[_0x26b2('0x31')]=_0x5d542d[_0x26b2('0x31')][_0x26b2('0x34')]?_0x5d542d[_0x26b2('0x31')]:_0x451167[_0x26b2('0x32')];if(_0x51c6ba[_0x26b2('0x2f')][_0x26b2('0x40')]){_0x5d542d[_0x26b2('0x41')]=[{'all':!![]}];}_0x5d542d=_[_0x26b2('0x3c')]({},_0x5d542d,_0x51c6ba[_0x26b2('0x3e')]);return db[_0x26b2('0x3f')][_0x26b2('0x47')](_0x5d542d)[_0x26b2('0x23')](handleEntityNotFound(_0x32d89b,null))[_0x26b2('0x23')](respondWithResult(_0x32d89b,null))[_0x26b2('0x48')](handleError(_0x32d89b,null));};exports[_0x26b2('0x49')]=function(_0x59ec7a,_0x507bb3){return db['SquareReport']['create'](_0x59ec7a[_0x26b2('0x4a')],{})['then'](respondWithResult(_0x507bb3,0xc9))[_0x26b2('0x48')](handleError(_0x507bb3,null));};exports[_0x26b2('0x22')]=function(_0x4e656e,_0x4d0153){if(_0x4e656e[_0x26b2('0x4a')]['id']){delete _0x4e656e['body']['id'];}return db['SquareReport'][_0x26b2('0x47')]({'where':{'id':_0x4e656e[_0x26b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d0153,null))[_0x26b2('0x23')](saveUpdates(_0x4e656e[_0x26b2('0x4a')],null))[_0x26b2('0x23')](respondWithResult(_0x4d0153,null))[_0x26b2('0x48')](handleError(_0x4d0153,null));};exports[_0x26b2('0x24')]=function(_0x2aa55b,_0x58d557){return db['SquareReport'][_0x26b2('0x47')]({'where':{'id':_0x2aa55b[_0x26b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x58d557,null))[_0x26b2('0x23')](removeEntity(_0x58d557,null))[_0x26b2('0x48')](handleError(_0x58d557,null));};exports['describe']=function(_0x3a68c7,_0xf1239f){return db[_0x26b2('0x3f')][_0x26b2('0x4b')]()[_0x26b2('0x23')](respondWithResult(_0xf1239f,null))[_0x26b2('0x48')](handleError(_0xf1239f,null));}; \ No newline at end of file +var _0xdd02=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SquareReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status'];(function(_0x414cbe,_0x16a463){var _0x2793fe=function(_0x3a75f6){while(--_0x3a75f6){_0x414cbe['push'](_0x414cbe['shift']());}};_0x2793fe(++_0x16a463);}(_0xdd02,0x159));var _0x2dd0=function(_0x27b0ac,_0x2aa438){_0x27b0ac=_0x27b0ac-0x0;var _0xc6f49c=_0xdd02[_0x27b0ac];return _0xc6f49c;};'use strict';var emlformat=require(_0x2dd0('0x0'));var rimraf=require(_0x2dd0('0x1'));var zipdir=require(_0x2dd0('0x2'));var jsonpatch=require(_0x2dd0('0x3'));var rp=require(_0x2dd0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2dd0('0x5'));var util=require(_0x2dd0('0x6'));var path=require(_0x2dd0('0x7'));var sox=require(_0x2dd0('0x8'));var csv=require(_0x2dd0('0x9'));var ejs=require(_0x2dd0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2dd0('0xb'));var squel=require('squel');var crypto=require(_0x2dd0('0xc'));var jsforce=require(_0x2dd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2dd0('0x9'));var querystring=require(_0x2dd0('0xe'));var Papa=require(_0x2dd0('0xf'));var Redis=require('ioredis');var authService=require(_0x2dd0('0x10'));var qs=require(_0x2dd0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dd0('0x12'));var logger=require(_0x2dd0('0x13'))(_0x2dd0('0x14'));var utils=require(_0x2dd0('0x15'));var config=require(_0x2dd0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x110da9,_0x1a5bde){_0x1a5bde=_0x1a5bde||0xcc;return function(_0x4bd995){if(_0x4bd995){return _0x110da9['sendStatus'](_0x1a5bde);}return _0x110da9['status'](_0x1a5bde)[_0x2dd0('0x17')]();};}function respondWithResult(_0x245597,_0x2eb0d4){_0x2eb0d4=_0x2eb0d4||0xc8;return function(_0x278da4){if(_0x278da4){return _0x245597[_0x2dd0('0x18')](_0x2eb0d4)[_0x2dd0('0x19')](_0x278da4);}};}function respondWithFilteredResult(_0x505c95,_0x51e924){return function(_0x55e625){if(_0x55e625){var _0x8e5be1=typeof _0x51e924[_0x2dd0('0x1a')]===_0x2dd0('0x1b')&&typeof _0x51e924['limit']==='undefined';var _0x1d7124=_0x55e625[_0x2dd0('0x1c')];var _0x516468=_0x8e5be1?0x0:_0x51e924[_0x2dd0('0x1a')];var _0x5b5584=_0x8e5be1?_0x55e625[_0x2dd0('0x1c')]:_0x51e924['offset']+_0x51e924[_0x2dd0('0x1d')];var _0x318db4;if(_0x5b5584>=_0x1d7124){_0x5b5584=_0x1d7124;_0x318db4=0xc8;}else{_0x318db4=0xce;}_0x505c95['status'](_0x318db4);return _0x505c95[_0x2dd0('0x1e')](_0x2dd0('0x1f'),_0x516468+'-'+_0x5b5584+'/'+_0x1d7124)[_0x2dd0('0x19')](_0x55e625);}return null;};}function patchUpdates(_0x1f4bfc){return function(_0x10553a){try{jsonpatch[_0x2dd0('0x20')](_0x10553a,_0x1f4bfc,!![]);}catch(_0x34e060){return BPromise[_0x2dd0('0x21')](_0x34e060);}return _0x10553a[_0x2dd0('0x22')]();};}function saveUpdates(_0x164268,_0x587832){return function(_0x25f285){if(_0x25f285){return _0x25f285[_0x2dd0('0x23')](_0x164268)[_0x2dd0('0x24')](function(_0x545be8){return _0x545be8;});}return null;};}function removeEntity(_0x44d0cc,_0x121e3c){return function(_0x5b8936){if(_0x5b8936){return _0x5b8936[_0x2dd0('0x25')]()[_0x2dd0('0x24')](function(){_0x44d0cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x555068,_0x2bc624){return function(_0x43fea2){if(!_0x43fea2){_0x555068[_0x2dd0('0x26')](0x194);}return _0x43fea2;};}function handleError(_0x281251,_0x3f871d){_0x3f871d=_0x3f871d||0x1f4;return function(_0x3117c4){logger[_0x2dd0('0x27')](_0x3117c4[_0x2dd0('0x28')]);if(_0x3117c4[_0x2dd0('0x29')]){delete _0x3117c4[_0x2dd0('0x29')];}_0x281251[_0x2dd0('0x18')](_0x3f871d)[_0x2dd0('0x2a')](_0x3117c4);};}exports[_0x2dd0('0x2b')]=function(_0x59c7d4,_0x535d28){var _0x173d1f={},_0x29fab4={},_0x64378e={'count':0x0,'rows':[]};var _0x49665f=_['map'](db[_0x2dd0('0x2c')][_0x2dd0('0x2d')],function(_0x35a268){return{'name':_0x35a268['fieldName'],'type':_0x35a268[_0x2dd0('0x2e')][_0x2dd0('0x2f')]};});_0x29fab4[_0x2dd0('0x30')]=_[_0x2dd0('0x31')](_0x49665f,_0x2dd0('0x29'));_0x29fab4['query']=_[_0x2dd0('0x32')](_0x59c7d4[_0x2dd0('0x33')]);_0x29fab4[_0x2dd0('0x34')]=_[_0x2dd0('0x35')](_0x29fab4[_0x2dd0('0x30')],_0x29fab4[_0x2dd0('0x33')]);_0x173d1f['attributes']=_[_0x2dd0('0x35')](_0x29fab4[_0x2dd0('0x30')],qs[_0x2dd0('0x36')](_0x59c7d4[_0x2dd0('0x33')][_0x2dd0('0x36')]));_0x173d1f[_0x2dd0('0x37')]=_0x173d1f[_0x2dd0('0x37')][_0x2dd0('0x38')]?_0x173d1f[_0x2dd0('0x37')]:_0x29fab4[_0x2dd0('0x30')];if(!_0x59c7d4['query'][_0x2dd0('0x39')](_0x2dd0('0x3a'))){_0x173d1f[_0x2dd0('0x1d')]=qs['limit'](_0x59c7d4[_0x2dd0('0x33')][_0x2dd0('0x1d')]);_0x173d1f[_0x2dd0('0x1a')]=qs[_0x2dd0('0x1a')](_0x59c7d4['query'][_0x2dd0('0x1a')]);}_0x173d1f[_0x2dd0('0x3b')]=qs['sort'](_0x59c7d4['query'][_0x2dd0('0x3c')]);_0x173d1f[_0x2dd0('0x3d')]=qs[_0x2dd0('0x34')](_['pick'](_0x59c7d4['query'],_0x29fab4['filters']),_0x49665f);if(_0x59c7d4[_0x2dd0('0x33')][_0x2dd0('0x3e')]){_0x173d1f[_0x2dd0('0x3d')]=_[_0x2dd0('0x3f')](_0x173d1f[_0x2dd0('0x3d')],{'$or':_[_0x2dd0('0x31')](_0x49665f,function(_0x1e01eb){if(_0x1e01eb['type']!==_0x2dd0('0x40')){var _0x2a115c={};_0x2a115c[_0x1e01eb[_0x2dd0('0x29')]]={'$like':'%'+_0x59c7d4[_0x2dd0('0x33')][_0x2dd0('0x3e')]+'%'};return _0x2a115c;}})});}_0x173d1f=_[_0x2dd0('0x3f')]({},_0x173d1f,_0x59c7d4[_0x2dd0('0x41')]);var _0x1844c1={'where':_0x173d1f[_0x2dd0('0x3d')]};return db[_0x2dd0('0x2c')][_0x2dd0('0x1c')](_0x1844c1)[_0x2dd0('0x24')](function(_0x2a51b8){_0x64378e['count']=_0x2a51b8;if(_0x59c7d4[_0x2dd0('0x33')]['includeAll']){_0x173d1f[_0x2dd0('0x42')]=[{'all':!![]}];}return db['SquareReport'][_0x2dd0('0x43')](_0x173d1f);})['then'](function(_0xe7c614){_0x64378e['rows']=_0xe7c614;return _0x64378e;})[_0x2dd0('0x24')](respondWithFilteredResult(_0x535d28,_0x173d1f))[_0x2dd0('0x44')](handleError(_0x535d28,null));};exports['show']=function(_0x27b665,_0x26fa62){var _0x263181={'raw':!![],'where':{'id':_0x27b665[_0x2dd0('0x45')]['id']}},_0x5bf437={};_0x5bf437['model']=_[_0x2dd0('0x32')](db[_0x2dd0('0x2c')]['rawAttributes']);_0x5bf437[_0x2dd0('0x33')]=_[_0x2dd0('0x32')](_0x27b665[_0x2dd0('0x33')]);_0x5bf437[_0x2dd0('0x34')]=_[_0x2dd0('0x35')](_0x5bf437[_0x2dd0('0x30')],_0x5bf437[_0x2dd0('0x33')]);_0x263181['attributes']=_[_0x2dd0('0x35')](_0x5bf437[_0x2dd0('0x30')],qs[_0x2dd0('0x36')](_0x27b665[_0x2dd0('0x33')]['fields']));_0x263181['attributes']=_0x263181[_0x2dd0('0x37')][_0x2dd0('0x38')]?_0x263181[_0x2dd0('0x37')]:_0x5bf437['model'];if(_0x27b665[_0x2dd0('0x33')]['includeAll']){_0x263181[_0x2dd0('0x42')]=[{'all':!![]}];}_0x263181=_['merge']({},_0x263181,_0x27b665[_0x2dd0('0x41')]);return db[_0x2dd0('0x2c')][_0x2dd0('0x46')](_0x263181)[_0x2dd0('0x24')](handleEntityNotFound(_0x26fa62,null))[_0x2dd0('0x24')](respondWithResult(_0x26fa62,null))[_0x2dd0('0x44')](handleError(_0x26fa62,null));};exports[_0x2dd0('0x47')]=function(_0x2df648,_0x2ab91f){return db[_0x2dd0('0x2c')][_0x2dd0('0x47')](_0x2df648[_0x2dd0('0x48')],{})[_0x2dd0('0x24')](respondWithResult(_0x2ab91f,0xc9))[_0x2dd0('0x44')](handleError(_0x2ab91f,null));};exports['update']=function(_0x139d53,_0x75d45d){if(_0x139d53['body']['id']){delete _0x139d53[_0x2dd0('0x48')]['id'];}return db['SquareReport'][_0x2dd0('0x46')]({'where':{'id':_0x139d53[_0x2dd0('0x45')]['id']}})[_0x2dd0('0x24')](handleEntityNotFound(_0x75d45d,null))[_0x2dd0('0x24')](saveUpdates(_0x139d53['body'],null))[_0x2dd0('0x24')](respondWithResult(_0x75d45d,null))['catch'](handleError(_0x75d45d,null));};exports[_0x2dd0('0x25')]=function(_0x36c1d0,_0x4a300b){return db[_0x2dd0('0x2c')]['find']({'where':{'id':_0x36c1d0[_0x2dd0('0x45')]['id']}})[_0x2dd0('0x24')](handleEntityNotFound(_0x4a300b,null))[_0x2dd0('0x24')](removeEntity(_0x4a300b,null))[_0x2dd0('0x44')](handleError(_0x4a300b,null));};exports[_0x2dd0('0x49')]=function(_0x35fe33,_0x9fe61){return db[_0x2dd0('0x2c')][_0x2dd0('0x49')]()[_0x2dd0('0x24')](respondWithResult(_0x9fe61,null))['catch'](handleError(_0x9fe61,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 63e9498..f7c715a 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 _0xfa5c=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2d6c26,_0x3f7a58){var _0x730030=function(_0x28d7e6){while(--_0x28d7e6){_0x2d6c26['push'](_0x2d6c26['shift']());}};_0x730030(++_0x3f7a58);}(_0xfa5c,0x71));var _0xcfa5=function(_0x194f8c,_0x3faf0d){_0x194f8c=_0x194f8c-0x0;var _0x32e3c9=_0xfa5c[_0x194f8c];return _0x32e3c9;};'use strict';var _=require(_0xcfa5('0x0'));var util=require(_0xcfa5('0x1'));var logger=require(_0xcfa5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcfa5('0x3'));var rp=require(_0xcfa5('0x4'));var fs=require('fs');var path=require(_0xcfa5('0x5'));var rimraf=require(_0xcfa5('0x6'));var config=require('../../config/environment');var attributes=require(_0xcfa5('0x7'));module[_0xcfa5('0x8')]=function(_0x576359,_0x2fa61){return _0x576359[_0xcfa5('0x9')](_0xcfa5('0xa'),attributes,{'tableName':_0xcfa5('0xb'),'paranoid':![],'indexes':[{'name':_0xcfa5('0xc'),'fields':[_0xcfa5('0xd'),_0xcfa5('0xe')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x319d=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x3dacb4,_0x4bcb89){var _0x2433db=function(_0x2e610e){while(--_0x2e610e){_0x3dacb4['push'](_0x3dacb4['shift']());}};_0x2433db(++_0x4bcb89);}(_0x319d,0x168));var _0xd319=function(_0x56aa6c,_0x360d1c){_0x56aa6c=_0x56aa6c-0x0;var _0x580b72=_0x319d[_0x56aa6c];return _0x580b72;};'use strict';var _=require('lodash');var util=require(_0xd319('0x0'));var logger=require(_0xd319('0x1'))(_0xd319('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd319('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd319('0x4'));var config=require(_0xd319('0x5'));var attributes=require('./squareReport.attributes');module['exports']=function(_0xc68c58,_0x2fdf17){return _0xc68c58['define'](_0xd319('0x6'),attributes,{'tableName':_0xd319('0x7'),'paranoid':![],'indexes':[{'name':_0xd319('0x8'),'fields':[_0xd319('0x9'),_0xd319('0xa')]},{'name':_0xd319('0xb'),'fields':[_0xd319('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 5df59f1..c4b0611 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 _0xd83c=['http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options','raw','debug','UpdateSquareReport','update','where','attributes','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd83c,0x197));var _0xcd83=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xd83c[_0x249d99];return _0x5bfb05;};'use strict';var _=require('lodash');var util=require(_0xcd83('0x0'));var moment=require('moment');var BPromise=require(_0xcd83('0x1'));var rs=require(_0xcd83('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd83('0x3'))['db'];var utils=require(_0xcd83('0x4'));var logger=require(_0xcd83('0x5'))(_0xcd83('0x6'));var config=require(_0xcd83('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd83('0x8')][_0xcd83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa51914,_0x2dc8e4,_0x2fe261){return new BPromise(function(_0x412ffb,_0x706b62){return client['request'](_0xa51914,_0x2fe261)[_0xcd83('0xa')](function(_0x7e4a07){logger[_0xcd83('0xb')](_0xcd83('0xc'),_0x2dc8e4,_0xcd83('0xd'));logger['debug'](_0xcd83('0xe'),_0x2dc8e4,_0xcd83('0xd'),JSON[_0xcd83('0xf')](_0x7e4a07));if(_0x7e4a07[_0xcd83('0x10')]){if(_0x7e4a07[_0xcd83('0x10')][_0xcd83('0x11')]===0x1f4){logger['error'](_0xcd83('0xc'),_0x2dc8e4,_0x7e4a07['error'][_0xcd83('0x12')]);return _0x706b62(_0x7e4a07[_0xcd83('0x10')][_0xcd83('0x12')]);}logger[_0xcd83('0x10')]('SquareReport,\x20%s,\x20%s',_0x2dc8e4,_0x7e4a07['error'][_0xcd83('0x12')]);return _0x412ffb(_0x7e4a07[_0xcd83('0x10')][_0xcd83('0x12')]);}else{logger[_0xcd83('0xb')](_0xcd83('0xc'),_0x2dc8e4,_0xcd83('0xd'));_0x412ffb(_0x7e4a07['result'][_0xcd83('0x12')]);}})[_0xcd83('0x13')](function(_0xef8880){logger['error'](_0xcd83('0xc'),_0x2dc8e4,_0xef8880);_0x706b62(_0xef8880);});});}exports[_0xcd83('0x14')]=function(_0x4b8f3d){var _0x4d8db5=this;return new Promise(function(_0x2c0c33,_0x22c4a3){return db[_0xcd83('0x15')][_0xcd83('0x16')](_0x4b8f3d[_0xcd83('0x17')],{'raw':_0x4b8f3d[_0xcd83('0x18')]?_0x4b8f3d[_0xcd83('0x18')][_0xcd83('0x19')]===undefined?!![]:![]:!![]})[_0xcd83('0xa')](function(_0x10494e){logger['info']('CreateSquareReport',_0x4b8f3d);logger[_0xcd83('0x1a')](_0xcd83('0x14'),_0x4b8f3d,JSON[_0xcd83('0xf')](_0x10494e));_0x2c0c33(_0x10494e);})[_0xcd83('0x13')](function(_0x202159){logger[_0xcd83('0x10')](_0xcd83('0x14'),_0x202159[_0xcd83('0x12')],_0x4b8f3d);_0x22c4a3(_0x4d8db5[_0xcd83('0x10')](0x1f4,_0x202159[_0xcd83('0x12')]));});});};exports[_0xcd83('0x1b')]=function(_0x95cd88){var _0x50d55d=this;return new Promise(function(_0x120aff,_0x16f304){return db[_0xcd83('0x15')][_0xcd83('0x1c')](_0x95cd88['body'],{'raw':_0x95cd88[_0xcd83('0x18')]?_0x95cd88[_0xcd83('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x95cd88[_0xcd83('0x18')]?_0x95cd88[_0xcd83('0x18')][_0xcd83('0x1d')]||null:null,'attributes':_0x95cd88[_0xcd83('0x18')]?_0x95cd88['options'][_0xcd83('0x1e')]||null:null,'limit':_0x95cd88[_0xcd83('0x18')]?_0x95cd88[_0xcd83('0x18')][_0xcd83('0x1f')]||null:null})[_0xcd83('0xa')](function(_0x1e125c){logger[_0xcd83('0xb')](_0xcd83('0x1b'),_0x95cd88);logger[_0xcd83('0x1a')](_0xcd83('0x1b'),_0x95cd88,JSON[_0xcd83('0xf')](_0x1e125c));_0x120aff(_0x1e125c);})['catch'](function(_0x6b12e3){logger[_0xcd83('0x10')]('UpdateSquareReport',_0x6b12e3[_0xcd83('0x12')],_0x95cd88);_0x16f304(_0x50d55d[_0xcd83('0x10')](0x1f4,_0x6b12e3[_0xcd83('0x12')]));});});}; \ No newline at end of file +var _0xd4e4=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','body','options','raw','then','debug','catch','UpdateSquareReport','update','where','attributes','limit','lodash','moment','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd4e4,0x173));var _0x4d4e=function(_0x3209c6,_0x3b0519){_0x3209c6=_0x3209c6-0x0;var _0xb39dcc=_0xd4e4[_0x3209c6];return _0xb39dcc;};'use strict';var _=require(_0x4d4e('0x0'));var util=require('util');var moment=require(_0x4d4e('0x1'));var BPromise=require(_0x4d4e('0x2'));var rs=require(_0x4d4e('0x3'));var fs=require('fs');var Redis=require(_0x4d4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d4e('0x5'));var logger=require(_0x4d4e('0x6'))(_0x4d4e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d4e('0x8'));var client=jayson[_0x4d4e('0x9')][_0x4d4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb9bb3,_0x32a2f9,_0x3b3109){return new BPromise(function(_0x5340d4,_0x3bc362){return client[_0x4d4e('0xb')](_0xcb9bb3,_0x3b3109)['then'](function(_0x2616d6){logger[_0x4d4e('0xc')](_0x4d4e('0xd'),_0x32a2f9,_0x4d4e('0xe'));logger['debug'](_0x4d4e('0xf'),_0x32a2f9,_0x4d4e('0xe'),JSON[_0x4d4e('0x10')](_0x2616d6));if(_0x2616d6[_0x4d4e('0x11')]){if(_0x2616d6[_0x4d4e('0x11')][_0x4d4e('0x12')]===0x1f4){logger['error'](_0x4d4e('0xd'),_0x32a2f9,_0x2616d6['error'][_0x4d4e('0x13')]);return _0x3bc362(_0x2616d6[_0x4d4e('0x11')][_0x4d4e('0x13')]);}logger[_0x4d4e('0x11')](_0x4d4e('0xd'),_0x32a2f9,_0x2616d6[_0x4d4e('0x11')][_0x4d4e('0x13')]);return _0x5340d4(_0x2616d6[_0x4d4e('0x11')][_0x4d4e('0x13')]);}else{logger[_0x4d4e('0xc')](_0x4d4e('0xd'),_0x32a2f9,_0x4d4e('0xe'));_0x5340d4(_0x2616d6[_0x4d4e('0x14')][_0x4d4e('0x13')]);}})['catch'](function(_0x12e293){logger['error'](_0x4d4e('0xd'),_0x32a2f9,_0x12e293);_0x3bc362(_0x12e293);});});}exports[_0x4d4e('0x15')]=function(_0x56f793){var _0xc2104c=this;return new Promise(function(_0x19316e,_0x3a8e5f){return db[_0x4d4e('0x16')]['create'](_0x56f793[_0x4d4e('0x17')],{'raw':_0x56f793[_0x4d4e('0x18')]?_0x56f793[_0x4d4e('0x18')][_0x4d4e('0x19')]===undefined?!![]:![]:!![]})[_0x4d4e('0x1a')](function(_0x53689a){logger[_0x4d4e('0xc')]('CreateSquareReport',_0x56f793);logger[_0x4d4e('0x1b')](_0x4d4e('0x15'),_0x56f793,JSON[_0x4d4e('0x10')](_0x53689a));_0x19316e(_0x53689a);})[_0x4d4e('0x1c')](function(_0x5500a2){logger[_0x4d4e('0x11')](_0x4d4e('0x15'),_0x5500a2['message'],_0x56f793);_0x3a8e5f(_0xc2104c[_0x4d4e('0x11')](0x1f4,_0x5500a2[_0x4d4e('0x13')]));});});};exports[_0x4d4e('0x1d')]=function(_0x4ed38b){var _0x32d68b=this;return new Promise(function(_0x53ca6a,_0x4a4bd4){return db[_0x4d4e('0x16')][_0x4d4e('0x1e')](_0x4ed38b['body'],{'raw':_0x4ed38b[_0x4d4e('0x18')]?_0x4ed38b[_0x4d4e('0x18')][_0x4d4e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed38b[_0x4d4e('0x18')]?_0x4ed38b[_0x4d4e('0x18')][_0x4d4e('0x1f')]||null:null,'attributes':_0x4ed38b[_0x4d4e('0x18')]?_0x4ed38b[_0x4d4e('0x18')][_0x4d4e('0x20')]||null:null,'limit':_0x4ed38b[_0x4d4e('0x18')]?_0x4ed38b[_0x4d4e('0x18')][_0x4d4e('0x21')]||null:null})['then'](function(_0xe6d399){logger[_0x4d4e('0xc')]('UpdateSquareReport',_0x4ed38b);logger[_0x4d4e('0x1b')]('UpdateSquareReport',_0x4ed38b,JSON['stringify'](_0xe6d399));_0x53ca6a(_0xe6d399);})['catch'](function(_0x372ddf){logger[_0x4d4e('0x11')](_0x4d4e('0x1d'),_0x372ddf[_0x4d4e('0x13')],_0x4ed38b);_0x4a4bd4(_0x32d68b['error'](0x1f4,_0x372ddf[_0x4d4e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index c2778b0..ccac2fd 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 _0x6722=['update','delete','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x6722,0x18e));var _0x2672=function(_0x44bbd1,_0x53627e){_0x44bbd1=_0x44bbd1-0x0;var _0x15e716=_0x6722[_0x44bbd1];return _0x15e716;};'use strict';var multer=require(_0x2672('0x0'));var util=require(_0x2672('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2672('0x2')]();var fs_extra=require(_0x2672('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2672('0x4'));var config=require(_0x2672('0x5'));var controller=require(_0x2672('0x6'));router[_0x2672('0x7')]('/',auth[_0x2672('0x8')](),controller['index']);router[_0x2672('0x7')](_0x2672('0x9'),auth['isAuthenticated'](),controller[_0x2672('0xa')]);router[_0x2672('0x7')](_0x2672('0xb'),auth[_0x2672('0x8')](),controller[_0x2672('0xc')]);router[_0x2672('0xd')]('/',auth[_0x2672('0x8')](),controller[_0x2672('0xe')]);router[_0x2672('0xf')]('/:id',auth[_0x2672('0x8')](),controller[_0x2672('0x10')]);router[_0x2672('0x11')]('/:id',auth[_0x2672('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3841=['./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3841,0x82));var _0x1384=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x3841[_0x2125f0];return _0x12d6eb;};'use strict';var multer=require(_0x1384('0x0'));var util=require('util');var path=require(_0x1384('0x1'));var timeout=require(_0x1384('0x2'));var express=require(_0x1384('0x3'));var router=express['Router']();var fs_extra=require(_0x1384('0x4'));var auth=require(_0x1384('0x5'));var interaction=require(_0x1384('0x6'));var config=require(_0x1384('0x7'));var controller=require(_0x1384('0x8'));router[_0x1384('0x9')]('/',auth[_0x1384('0xa')](),controller[_0x1384('0xb')]);router['get'](_0x1384('0xc'),auth['isAuthenticated'](),controller[_0x1384('0xd')]);router[_0x1384('0x9')](_0x1384('0xe'),auth[_0x1384('0xa')](),controller[_0x1384('0xf')]);router[_0x1384('0x10')]('/',auth[_0x1384('0xa')](),controller[_0x1384('0x11')]);router[_0x1384('0x12')](_0x1384('0xe'),auth[_0x1384('0xa')](),controller[_0x1384('0x13')]);router[_0x1384('0x14')](_0x1384('0xe'),auth[_0x1384('0xa')](),controller[_0x1384('0x15')]);module[_0x1384('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2ad024e..5a34785 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 _0xeccc=['exports','STRING','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeccc,0x147));var _0xcecc=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xeccc[_0x568a61];return _0x334c3b;};'use strict';var Sequelize=require('sequelize');module[_0xcecc('0x0')]={'uniqueid':{'type':Sequelize[_0xcecc('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xcecc('0x2')]},'project_name':{'type':Sequelize[_0xcecc('0x1')]},'callerid':{'type':Sequelize[_0xcecc('0x1')]}}; \ No newline at end of file +var _0x00de=['sequelize','exports','STRING'];(function(_0x1b3f63,_0x5578c9){var _0x39005d=function(_0x3b99ff){while(--_0x3b99ff){_0x1b3f63['push'](_0x1b3f63['shift']());}};_0x39005d(++_0x5578c9);}(_0x00de,0x1c2));var _0xe00d=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x00de[_0x10dfdf];return _0x4d857d;};'use strict';var Sequelize=require(_0xe00d('0x0'));module[_0xe00d('0x1')]={'uniqueid':{'type':Sequelize[_0xe00d('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe00d('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3401e3a..389f8bb 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 _0x24ee=['rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','keys','rawAttributes','catch','create','body','find','params','describe','eml-format'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x24ee,0x1af));var _0xe24e=function(_0x3a2295,_0x3064c9){_0x3a2295=_0x3a2295-0x0;var _0x569710=_0x24ee[_0x3a2295];return _0x569710;};'use strict';var emlformat=require(_0xe24e('0x0'));var rimraf=require(_0xe24e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe24e('0x2'));var moment=require('moment');var BPromise=require(_0xe24e('0x3'));var Mustache=require(_0xe24e('0x4'));var util=require(_0xe24e('0x5'));var path=require(_0xe24e('0x6'));var sox=require(_0xe24e('0x7'));var csv=require(_0xe24e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe24e('0x9'));var _=require('lodash');var squel=require(_0xe24e('0xa'));var crypto=require('crypto');var jsforce=require(_0xe24e('0xb'));var deskjs=require(_0xe24e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe24e('0xd'));var Redis=require(_0xe24e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe24e('0xf'));var logger=require(_0xe24e('0x10'))('api');var utils=require(_0xe24e('0x11'));var config=require(_0xe24e('0x12'));var licenseUtil=require(_0xe24e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51bea5,_0x4605ad){_0x4605ad=_0x4605ad||0xcc;return function(_0x383c94){if(_0x383c94){return _0x51bea5['sendStatus'](_0x4605ad);}return _0x51bea5[_0xe24e('0x14')](_0x4605ad)[_0xe24e('0x15')]();};}function respondWithResult(_0x15a387,_0x4c6d10){_0x4c6d10=_0x4c6d10||0xc8;return function(_0x4e66b9){if(_0x4e66b9){return _0x15a387['status'](_0x4c6d10)[_0xe24e('0x16')](_0x4e66b9);}};}function respondWithFilteredResult(_0x314acd,_0x12f47b){return function(_0x1424c9){if(_0x1424c9){var _0x2cb79e=typeof _0x12f47b[_0xe24e('0x17')]===_0xe24e('0x18')&&typeof _0x12f47b[_0xe24e('0x19')]==='undefined';var _0x5cbf07=_0x1424c9['count'];var _0x56da9a=_0x2cb79e?0x0:_0x12f47b[_0xe24e('0x17')];var _0x26e51f=_0x2cb79e?_0x1424c9['count']:_0x12f47b[_0xe24e('0x17')]+_0x12f47b[_0xe24e('0x19')];var _0xddaaed;if(_0x26e51f>=_0x5cbf07){_0x26e51f=_0x5cbf07;_0xddaaed=0xc8;}else{_0xddaaed=0xce;}_0x314acd[_0xe24e('0x14')](_0xddaaed);return _0x314acd[_0xe24e('0x1a')](_0xe24e('0x1b'),_0x56da9a+'-'+_0x26e51f+'/'+_0x5cbf07)['json'](_0x1424c9);}return null;};}function patchUpdates(_0x3e5be6){return function(_0x7e9bf3){try{jsonpatch[_0xe24e('0x1c')](_0x7e9bf3,_0x3e5be6,!![]);}catch(_0x7924c1){return BPromise[_0xe24e('0x1d')](_0x7924c1);}return _0x7e9bf3[_0xe24e('0x1e')]();};}function saveUpdates(_0x2b0716,_0xff6369){return function(_0x180b7c){if(_0x180b7c){return _0x180b7c[_0xe24e('0x1f')](_0x2b0716)['then'](function(_0x49c058){return _0x49c058;});}return null;};}function removeEntity(_0x3c4709,_0xf4bea6){return function(_0x4dcd07){if(_0x4dcd07){return _0x4dcd07[_0xe24e('0x20')]()[_0xe24e('0x21')](function(){_0x3c4709[_0xe24e('0x14')](0xcc)[_0xe24e('0x15')]();});}};}function handleEntityNotFound(_0x33560d,_0x25600b){return function(_0x2fc1b9){if(!_0x2fc1b9){_0x33560d[_0xe24e('0x22')](0x194);}return _0x2fc1b9;};}function handleError(_0x3be7bd,_0x3cbac3){_0x3cbac3=_0x3cbac3||0x1f4;return function(_0x2d6baa){logger['error'](_0x2d6baa[_0xe24e('0x23')]);if(_0x2d6baa[_0xe24e('0x24')]){delete _0x2d6baa[_0xe24e('0x24')];}_0x3be7bd['status'](_0x3cbac3)[_0xe24e('0x25')](_0x2d6baa);};}exports[_0xe24e('0x26')]=function(_0x16962b,_0x97b599){var _0xee6c6b={},_0x16e758={},_0x34bd55={'count':0x0,'rows':[]};var _0x105992=_[_0xe24e('0x27')](db[_0xe24e('0x28')]['rawAttributes'],function(_0x4fdc07){return{'name':_0x4fdc07[_0xe24e('0x29')],'type':_0x4fdc07[_0xe24e('0x2a')][_0xe24e('0x2b')]};});_0x16e758[_0xe24e('0x2c')]=_[_0xe24e('0x27')](_0x105992,_0xe24e('0x24'));_0x16e758[_0xe24e('0x2d')]=_['keys'](_0x16962b[_0xe24e('0x2d')]);_0x16e758[_0xe24e('0x2e')]=_[_0xe24e('0x2f')](_0x16e758[_0xe24e('0x2c')],_0x16e758[_0xe24e('0x2d')]);_0xee6c6b[_0xe24e('0x30')]=_['intersection'](_0x16e758[_0xe24e('0x2c')],qs[_0xe24e('0x31')](_0x16962b[_0xe24e('0x2d')]['fields']));_0xee6c6b['attributes']=_0xee6c6b['attributes'][_0xe24e('0x32')]?_0xee6c6b[_0xe24e('0x30')]:_0x16e758[_0xe24e('0x2c')];if(!_0x16962b[_0xe24e('0x2d')]['hasOwnProperty']('nolimit')){_0xee6c6b['limit']=qs[_0xe24e('0x19')](_0x16962b[_0xe24e('0x2d')][_0xe24e('0x19')]);_0xee6c6b[_0xe24e('0x17')]=qs[_0xe24e('0x17')](_0x16962b['query']['offset']);}_0xee6c6b[_0xe24e('0x33')]=qs[_0xe24e('0x34')](_0x16962b[_0xe24e('0x2d')][_0xe24e('0x34')]);_0xee6c6b[_0xe24e('0x35')]=qs[_0xe24e('0x2e')](_[_0xe24e('0x36')](_0x16962b['query'],_0x16e758[_0xe24e('0x2e')]),_0x105992);if(_0x16962b[_0xe24e('0x2d')][_0xe24e('0x37')]){_0xee6c6b['where']=_[_0xe24e('0x38')](_0xee6c6b[_0xe24e('0x35')],{'$or':_['map'](_0x105992,function(_0x5b0039){if(_0x5b0039[_0xe24e('0x2a')]!==_0xe24e('0x39')){var _0x1d4115={};_0x1d4115[_0x5b0039[_0xe24e('0x24')]]={'$like':'%'+_0x16962b[_0xe24e('0x2d')]['filter']+'%'};return _0x1d4115;}})});}_0xee6c6b=_[_0xe24e('0x38')]({},_0xee6c6b,_0x16962b[_0xe24e('0x3a')]);var _0x6c0bf2={'where':_0xee6c6b[_0xe24e('0x35')]};return db[_0xe24e('0x28')][_0xe24e('0x3b')](_0x6c0bf2)[_0xe24e('0x21')](function(_0x1c1f86){_0x34bd55['count']=_0x1c1f86;if(_0x16962b['query'][_0xe24e('0x3c')]){_0xee6c6b[_0xe24e('0x3d')]=[{'all':!![]}];}return db[_0xe24e('0x28')][_0xe24e('0x3e')](_0xee6c6b);})[_0xe24e('0x21')](function(_0x456236){_0x34bd55['rows']=_0x456236;return _0x34bd55;})[_0xe24e('0x21')](respondWithFilteredResult(_0x97b599,_0xee6c6b))['catch'](handleError(_0x97b599,null));};exports[_0xe24e('0x3f')]=function(_0x39f257,_0x29dddc){var _0x93cdc={'raw':!![],'where':{'id':_0x39f257['params']['id']}},_0x534dba={};_0x534dba['model']=_[_0xe24e('0x40')](db[_0xe24e('0x28')][_0xe24e('0x41')]);_0x534dba[_0xe24e('0x2d')]=_[_0xe24e('0x40')](_0x39f257[_0xe24e('0x2d')]);_0x534dba[_0xe24e('0x2e')]=_[_0xe24e('0x2f')](_0x534dba[_0xe24e('0x2c')],_0x534dba[_0xe24e('0x2d')]);_0x93cdc[_0xe24e('0x30')]=_[_0xe24e('0x2f')](_0x534dba[_0xe24e('0x2c')],qs[_0xe24e('0x31')](_0x39f257['query'][_0xe24e('0x31')]));_0x93cdc['attributes']=_0x93cdc[_0xe24e('0x30')][_0xe24e('0x32')]?_0x93cdc[_0xe24e('0x30')]:_0x534dba['model'];if(_0x39f257['query']['includeAll']){_0x93cdc[_0xe24e('0x3d')]=[{'all':!![]}];}_0x93cdc=_['merge']({},_0x93cdc,_0x39f257[_0xe24e('0x3a')]);return db[_0xe24e('0x28')]['find'](_0x93cdc)[_0xe24e('0x21')](handleEntityNotFound(_0x29dddc,null))[_0xe24e('0x21')](respondWithResult(_0x29dddc,null))[_0xe24e('0x42')](handleError(_0x29dddc,null));};exports[_0xe24e('0x43')]=function(_0x3f3a27,_0x2e9a49){return db[_0xe24e('0x28')][_0xe24e('0x43')](_0x3f3a27[_0xe24e('0x44')],{})[_0xe24e('0x21')](respondWithResult(_0x2e9a49,0xc9))['catch'](handleError(_0x2e9a49,null));};exports['update']=function(_0x1e00b4,_0x5515c6){if(_0x1e00b4[_0xe24e('0x44')]['id']){delete _0x1e00b4[_0xe24e('0x44')]['id'];}return db[_0xe24e('0x28')][_0xe24e('0x45')]({'where':{'id':_0x1e00b4[_0xe24e('0x46')]['id']}})[_0xe24e('0x21')](handleEntityNotFound(_0x5515c6,null))[_0xe24e('0x21')](saveUpdates(_0x1e00b4[_0xe24e('0x44')],null))['then'](respondWithResult(_0x5515c6,null))['catch'](handleError(_0x5515c6,null));};exports['destroy']=function(_0x92d77f,_0x53c358){return db[_0xe24e('0x28')][_0xe24e('0x45')]({'where':{'id':_0x92d77f['params']['id']}})[_0xe24e('0x21')](handleEntityNotFound(_0x53c358,null))[_0xe24e('0x21')](removeEntity(_0x53c358,null))[_0xe24e('0x42')](handleError(_0x53c358,null));};exports[_0xe24e('0x47')]=function(_0xc7b689,_0x1aa8df){return db[_0xe24e('0x28')][_0xe24e('0x47')]()['then'](respondWithResult(_0x1aa8df,null))[_0xe24e('0x42')](handleError(_0x1aa8df,null));}; \ No newline at end of file +var _0x104c=['name','send','index','map','SquareDetailsReport','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','update','body','find','destroy','describe','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error'];(function(_0x2d981b,_0x1e00dc){var _0x9aa4fd=function(_0x7939b){while(--_0x7939b){_0x2d981b['push'](_0x2d981b['shift']());}};_0x9aa4fd(++_0x1e00dc);}(_0x104c,0x14d));var _0xc104=function(_0x274ae7,_0xe88de2){_0x274ae7=_0x274ae7-0x0;var _0x2ead35=_0x104c[_0x274ae7];return _0x2ead35;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc104('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc104('0x1'));var moment=require('moment');var BPromise=require(_0xc104('0x2'));var Mustache=require(_0xc104('0x3'));var util=require(_0xc104('0x4'));var path=require(_0xc104('0x5'));var sox=require(_0xc104('0x6'));var csv=require(_0xc104('0x7'));var ejs=require(_0xc104('0x8'));var fs=require('fs');var fs_extra=require(_0xc104('0x9'));var _=require(_0xc104('0xa'));var squel=require(_0xc104('0xb'));var crypto=require(_0xc104('0xc'));var jsforce=require(_0xc104('0xd'));var deskjs=require(_0xc104('0xe'));var toCsv=require(_0xc104('0x7'));var querystring=require(_0xc104('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc104('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc104('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc104('0x12'))(_0xc104('0x13'));var utils=require(_0xc104('0x14'));var config=require(_0xc104('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x65773b,_0x15ae1a){_0x15ae1a=_0x15ae1a||0xcc;return function(_0xfbd98c){if(_0xfbd98c){return _0x65773b[_0xc104('0x16')](_0x15ae1a);}return _0x65773b['status'](_0x15ae1a)[_0xc104('0x17')]();};}function respondWithResult(_0x339c0c,_0x1cb495){_0x1cb495=_0x1cb495||0xc8;return function(_0x3cf14a){if(_0x3cf14a){return _0x339c0c[_0xc104('0x18')](_0x1cb495)[_0xc104('0x19')](_0x3cf14a);}};}function respondWithFilteredResult(_0x4a6c23,_0x36f559){return function(_0x55d598){if(_0x55d598){var _0x38c055=typeof _0x36f559[_0xc104('0x1a')]===_0xc104('0x1b')&&typeof _0x36f559['limit']===_0xc104('0x1b');var _0x4db1a1=_0x55d598[_0xc104('0x1c')];var _0x425f8f=_0x38c055?0x0:_0x36f559[_0xc104('0x1a')];var _0x51aea5=_0x38c055?_0x55d598[_0xc104('0x1c')]:_0x36f559['offset']+_0x36f559[_0xc104('0x1d')];var _0x1b117d;if(_0x51aea5>=_0x4db1a1){_0x51aea5=_0x4db1a1;_0x1b117d=0xc8;}else{_0x1b117d=0xce;}_0x4a6c23[_0xc104('0x18')](_0x1b117d);return _0x4a6c23[_0xc104('0x1e')](_0xc104('0x1f'),_0x425f8f+'-'+_0x51aea5+'/'+_0x4db1a1)[_0xc104('0x19')](_0x55d598);}return null;};}function patchUpdates(_0x451fd5){return function(_0x6a2a7b){try{jsonpatch[_0xc104('0x20')](_0x6a2a7b,_0x451fd5,!![]);}catch(_0x4b4003){return BPromise[_0xc104('0x21')](_0x4b4003);}return _0x6a2a7b[_0xc104('0x22')]();};}function saveUpdates(_0x39682d,_0x29e264){return function(_0x4fcfb6){if(_0x4fcfb6){return _0x4fcfb6['update'](_0x39682d)[_0xc104('0x23')](function(_0x392633){return _0x392633;});}return null;};}function removeEntity(_0x28c450,_0x48b171){return function(_0x332b86){if(_0x332b86){return _0x332b86['destroy']()[_0xc104('0x23')](function(){_0x28c450[_0xc104('0x18')](0xcc)[_0xc104('0x17')]();});}};}function handleEntityNotFound(_0x428476,_0x426a14){return function(_0x17883b){if(!_0x17883b){_0x428476['sendStatus'](0x194);}return _0x17883b;};}function handleError(_0x41990f,_0x5faa4e){_0x5faa4e=_0x5faa4e||0x1f4;return function(_0x47b426){logger[_0xc104('0x24')](_0x47b426['stack']);if(_0x47b426[_0xc104('0x25')]){delete _0x47b426['name'];}_0x41990f['status'](_0x5faa4e)[_0xc104('0x26')](_0x47b426);};}exports[_0xc104('0x27')]=function(_0x49a627,_0x423054){var _0x414e2a={},_0x371bef={},_0x379ddc={'count':0x0,'rows':[]};var _0x220c2c=_[_0xc104('0x28')](db[_0xc104('0x29')][_0xc104('0x2a')],function(_0x46942b){return{'name':_0x46942b['fieldName'],'type':_0x46942b[_0xc104('0x2b')][_0xc104('0x2c')]};});_0x371bef['model']=_[_0xc104('0x28')](_0x220c2c,'name');_0x371bef[_0xc104('0x2d')]=_[_0xc104('0x2e')](_0x49a627[_0xc104('0x2d')]);_0x371bef['filters']=_[_0xc104('0x2f')](_0x371bef[_0xc104('0x30')],_0x371bef[_0xc104('0x2d')]);_0x414e2a['attributes']=_[_0xc104('0x2f')](_0x371bef['model'],qs[_0xc104('0x31')](_0x49a627[_0xc104('0x2d')][_0xc104('0x31')]));_0x414e2a[_0xc104('0x32')]=_0x414e2a[_0xc104('0x32')][_0xc104('0x33')]?_0x414e2a[_0xc104('0x32')]:_0x371bef[_0xc104('0x30')];if(!_0x49a627[_0xc104('0x2d')]['hasOwnProperty'](_0xc104('0x34'))){_0x414e2a[_0xc104('0x1d')]=qs[_0xc104('0x1d')](_0x49a627[_0xc104('0x2d')][_0xc104('0x1d')]);_0x414e2a[_0xc104('0x1a')]=qs[_0xc104('0x1a')](_0x49a627[_0xc104('0x2d')][_0xc104('0x1a')]);}_0x414e2a[_0xc104('0x35')]=qs[_0xc104('0x36')](_0x49a627[_0xc104('0x2d')]['sort']);_0x414e2a[_0xc104('0x37')]=qs[_0xc104('0x38')](_[_0xc104('0x39')](_0x49a627[_0xc104('0x2d')],_0x371bef[_0xc104('0x38')]),_0x220c2c);if(_0x49a627[_0xc104('0x2d')][_0xc104('0x3a')]){_0x414e2a[_0xc104('0x37')]=_[_0xc104('0x3b')](_0x414e2a[_0xc104('0x37')],{'$or':_[_0xc104('0x28')](_0x220c2c,function(_0x197e25){if(_0x197e25[_0xc104('0x2b')]!==_0xc104('0x3c')){var _0x1e06db={};_0x1e06db[_0x197e25['name']]={'$like':'%'+_0x49a627[_0xc104('0x2d')][_0xc104('0x3a')]+'%'};return _0x1e06db;}})});}_0x414e2a=_[_0xc104('0x3b')]({},_0x414e2a,_0x49a627[_0xc104('0x3d')]);var _0x4074ef={'where':_0x414e2a['where']};return db[_0xc104('0x29')][_0xc104('0x1c')](_0x4074ef)[_0xc104('0x23')](function(_0x5d6bb0){_0x379ddc[_0xc104('0x1c')]=_0x5d6bb0;if(_0x49a627[_0xc104('0x2d')][_0xc104('0x3e')]){_0x414e2a[_0xc104('0x3f')]=[{'all':!![]}];}return db[_0xc104('0x29')][_0xc104('0x40')](_0x414e2a);})[_0xc104('0x23')](function(_0x5893ad){_0x379ddc[_0xc104('0x41')]=_0x5893ad;return _0x379ddc;})[_0xc104('0x23')](respondWithFilteredResult(_0x423054,_0x414e2a))[_0xc104('0x42')](handleError(_0x423054,null));};exports['show']=function(_0x446c73,_0x25d95c){var _0xc9f4c1={'raw':!![],'where':{'id':_0x446c73[_0xc104('0x43')]['id']}},_0x3dd11f={};_0x3dd11f['model']=_['keys'](db[_0xc104('0x29')][_0xc104('0x2a')]);_0x3dd11f[_0xc104('0x2d')]=_[_0xc104('0x2e')](_0x446c73[_0xc104('0x2d')]);_0x3dd11f['filters']=_[_0xc104('0x2f')](_0x3dd11f[_0xc104('0x30')],_0x3dd11f[_0xc104('0x2d')]);_0xc9f4c1['attributes']=_['intersection'](_0x3dd11f[_0xc104('0x30')],qs[_0xc104('0x31')](_0x446c73['query']['fields']));_0xc9f4c1[_0xc104('0x32')]=_0xc9f4c1[_0xc104('0x32')][_0xc104('0x33')]?_0xc9f4c1[_0xc104('0x32')]:_0x3dd11f[_0xc104('0x30')];if(_0x446c73[_0xc104('0x2d')][_0xc104('0x3e')]){_0xc9f4c1[_0xc104('0x3f')]=[{'all':!![]}];}_0xc9f4c1=_['merge']({},_0xc9f4c1,_0x446c73[_0xc104('0x3d')]);return db['SquareDetailsReport']['find'](_0xc9f4c1)[_0xc104('0x23')](handleEntityNotFound(_0x25d95c,null))[_0xc104('0x23')](respondWithResult(_0x25d95c,null))[_0xc104('0x42')](handleError(_0x25d95c,null));};exports[_0xc104('0x44')]=function(_0x49e0f1,_0x321717){return db[_0xc104('0x29')]['create'](_0x49e0f1['body'],{})[_0xc104('0x23')](respondWithResult(_0x321717,0xc9))[_0xc104('0x42')](handleError(_0x321717,null));};exports[_0xc104('0x45')]=function(_0xa13b1,_0x281ed9){if(_0xa13b1[_0xc104('0x46')]['id']){delete _0xa13b1['body']['id'];}return db[_0xc104('0x29')][_0xc104('0x47')]({'where':{'id':_0xa13b1[_0xc104('0x43')]['id']}})[_0xc104('0x23')](handleEntityNotFound(_0x281ed9,null))[_0xc104('0x23')](saveUpdates(_0xa13b1[_0xc104('0x46')],null))['then'](respondWithResult(_0x281ed9,null))[_0xc104('0x42')](handleError(_0x281ed9,null));};exports[_0xc104('0x48')]=function(_0x290805,_0x3ef672){return db[_0xc104('0x29')][_0xc104('0x47')]({'where':{'id':_0x290805[_0xc104('0x43')]['id']}})['then'](handleEntityNotFound(_0x3ef672,null))[_0xc104('0x23')](removeEntity(_0x3ef672,null))[_0xc104('0x42')](handleError(_0x3ef672,null));};exports[_0xc104('0x49')]=function(_0x1a8b34,_0x1ceb89){return db[_0xc104('0x29')][_0xc104('0x49')]()['then'](respondWithResult(_0x1ceb89,null))[_0xc104('0x42')](handleError(_0x1ceb89,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index d6e7e2e..8c7bcdf 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 _0xd40f=['exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareReportDetail.attributes'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xd40f,0xdc));var _0xfd40=function(_0x231a42,_0x39f4db){_0x231a42=_0x231a42-0x0;var _0x3c2a56=_0xd40f[_0x231a42];return _0x3c2a56;};'use strict';var _=require('lodash');var util=require(_0xfd40('0x0'));var logger=require(_0xfd40('0x1'))(_0xfd40('0x2'));var moment=require(_0xfd40('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd40('0x4'));var fs=require('fs');var path=require(_0xfd40('0x5'));var rimraf=require(_0xfd40('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd40('0x7'));module[_0xfd40('0x8')]=function(_0x3f5800,_0x53a88){return _0x3f5800[_0xfd40('0x9')](_0xfd40('0xa'),attributes,{'tableName':_0xfd40('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb98=['api','request-promise','path','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x819be0,_0x484b20){var _0x3ef50f=function(_0xdd72c9){while(--_0xdd72c9){_0x819be0['push'](_0x819be0['shift']());}};_0x3ef50f(++_0x484b20);}(_0xfb98,0x1cb));var _0x8fb9=function(_0x35020f,_0x537aaf){_0x35020f=_0x35020f-0x0;var _0x38f017=_0xfb98[_0x35020f];return _0x38f017;};'use strict';var _=require(_0x8fb9('0x0'));var util=require(_0x8fb9('0x1'));var logger=require(_0x8fb9('0x2'))(_0x8fb9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fb9('0x4'));var fs=require('fs');var path=require(_0x8fb9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8fb9('0x6'));module[_0x8fb9('0x7')]=function(_0x14258f,_0x546c6b){return _0x14258f[_0x8fb9('0x8')](_0x8fb9('0x9'),attributes,{'tableName':_0x8fb9('0xa'),'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 eaa4ae5..eb42978 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 _0x8f4c=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x154750,_0x184b0b){var _0x4e61cd=function(_0x5eaa58){while(--_0x5eaa58){_0x154750['push'](_0x154750['shift']());}};_0x4e61cd(++_0x184b0b);}(_0x8f4c,0x113));var _0xc8f4=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0x8f4c[_0x562ec5];return _0x279c8c;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));var BPromise=require(_0xc8f4('0x3'));var rs=require(_0xc8f4('0x4'));var fs=require('fs');var Redis=require(_0xc8f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8f4('0x6'));var logger=require(_0xc8f4('0x7'))(_0xc8f4('0x8'));var config=require('../../config/environment');var jayson=require(_0xc8f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x520063,_0x373506,_0x48c39d){return new BPromise(function(_0x3ea9a2,_0x3a9ab1){return client[_0xc8f4('0xa')](_0x520063,_0x48c39d)[_0xc8f4('0xb')](function(_0x34f05f){logger['info'](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));logger[_0xc8f4('0xe')](_0xc8f4('0xf'),_0x373506,'request\x20sent',JSON[_0xc8f4('0x10')](_0x34f05f));if(_0x34f05f['error']){if(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x12')]===0x1f4){logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')]['message']);return _0x3a9ab1(_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);}logger[_0xc8f4('0x11')](_0xc8f4('0xc'),_0x373506,_0x34f05f[_0xc8f4('0x11')][_0xc8f4('0x13')]);return _0x3ea9a2(_0x34f05f['error'][_0xc8f4('0x13')]);}else{logger[_0xc8f4('0x14')](_0xc8f4('0xc'),_0x373506,_0xc8f4('0xd'));_0x3ea9a2(_0x34f05f[_0xc8f4('0x15')]['message']);}})[_0xc8f4('0x16')](function(_0x4d2b77){logger['error'](_0xc8f4('0xc'),_0x373506,_0x4d2b77);_0x3a9ab1(_0x4d2b77);});});}exports[_0xc8f4('0x17')]=function(_0x108076){var _0x7bb973=this;return new Promise(function(_0x4763c1,_0x374761){return db[_0xc8f4('0x18')][_0xc8f4('0x19')](_0x108076[_0xc8f4('0x1a')],{'raw':_0x108076[_0xc8f4('0x1b')]?_0x108076[_0xc8f4('0x1b')][_0xc8f4('0x1c')]===undefined?!![]:![]:!![]})[_0xc8f4('0xb')](function(_0x5f3264){logger[_0xc8f4('0x14')](_0xc8f4('0x17'),_0x108076);logger[_0xc8f4('0xe')](_0xc8f4('0x17'),_0x108076,JSON[_0xc8f4('0x10')](_0x5f3264));_0x4763c1(_0x5f3264);})[_0xc8f4('0x16')](function(_0xaeee7d){logger[_0xc8f4('0x11')]('CreateSquareDetailsReport',_0xaeee7d[_0xc8f4('0x13')],_0x108076);_0x374761(_0x7bb973[_0xc8f4('0x11')](0x1f4,_0xaeee7d[_0xc8f4('0x13')]));});});}; \ No newline at end of file +var _0x94d2=['stringify','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x94d2,0x1cd));var _0x294d=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x94d2[_0x1ebe90];return _0x447c82;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e023f,_0x5c3d7c,_0x2cf111){return new BPromise(function(_0x6653fc,_0x1cd249){return client[_0x294d('0xa')](_0x5e023f,_0x2cf111)[_0x294d('0xb')](function(_0x49923f){logger[_0x294d('0xc')](_0x294d('0xd'),_0x5c3d7c,'request\x20sent');logger[_0x294d('0xe')](_0x294d('0xf'),_0x5c3d7c,'request\x20sent',JSON['stringify'](_0x49923f));if(_0x49923f[_0x294d('0x10')]){if(_0x49923f[_0x294d('0x10')][_0x294d('0x11')]===0x1f4){logger['error'](_0x294d('0xd'),_0x5c3d7c,_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);return _0x1cd249(_0x49923f[_0x294d('0x10')]['message']);}logger[_0x294d('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x5c3d7c,_0x49923f['error'][_0x294d('0x12')]);return _0x6653fc(_0x49923f[_0x294d('0x10')][_0x294d('0x12')]);}else{logger[_0x294d('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x5c3d7c,_0x294d('0x13'));_0x6653fc(_0x49923f['result']['message']);}})['catch'](function(_0x4f2436){logger[_0x294d('0x10')](_0x294d('0xd'),_0x5c3d7c,_0x4f2436);_0x1cd249(_0x4f2436);});});}exports[_0x294d('0x14')]=function(_0x46d9c5){var _0x17156c=this;return new Promise(function(_0x26563e,_0x199a1a){return db[_0x294d('0x15')]['create'](_0x46d9c5[_0x294d('0x16')],{'raw':_0x46d9c5[_0x294d('0x17')]?_0x46d9c5['options'][_0x294d('0x18')]===undefined?!![]:![]:!![]})[_0x294d('0xb')](function(_0x429da3){logger[_0x294d('0xc')](_0x294d('0x14'),_0x46d9c5);logger[_0x294d('0xe')](_0x294d('0x14'),_0x46d9c5,JSON[_0x294d('0x19')](_0x429da3));_0x26563e(_0x429da3);})[_0x294d('0x1a')](function(_0x11df11){logger[_0x294d('0x10')](_0x294d('0x14'),_0x11df11[_0x294d('0x12')],_0x46d9c5);_0x199a1a(_0x17156c[_0x294d('0x10')](0x1f4,_0x11df11[_0x294d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 699cab9..fb3eb5e 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 _0x9fab=['exports','express','../../components/auth/service','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x23cedf,_0x5e84e9){var _0x5788d1=function(_0x43500d){while(--_0x43500d){_0x23cedf['push'](_0x23cedf['shift']());}};_0x5788d1(++_0x5e84e9);}(_0x9fab,0xe9));var _0xb9fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fab[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xb9fa('0x0'));var router=express['Router']();var auth=require(_0xb9fa('0x1'));var controller=require(_0xb9fa('0x2'));router[_0xb9fa('0x3')]('/',auth[_0xb9fa('0x4')](),controller['index']);router['get'](_0xb9fa('0x5'),auth[_0xb9fa('0x4')](),controller[_0xb9fa('0x6')]);module[_0xb9fa('0x7')]=router; \ No newline at end of file +var _0xe5a0=['express','Router','./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports'];(function(_0x472ee7,_0x302242){var _0x6aa3f3=function(_0x43beda){while(--_0x43beda){_0x472ee7['push'](_0x472ee7['shift']());}};_0x6aa3f3(++_0x302242);}(_0xe5a0,0x1a8));var _0x0e5a=function(_0x1632f5,_0x30b47c){_0x1632f5=_0x1632f5-0x0;var _0x3f6692=_0xe5a0[_0x1632f5];return _0x3f6692;};'use strict';var express=require(_0x0e5a('0x0'));var router=express[_0x0e5a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0e5a('0x2'));router[_0x0e5a('0x3')]('/',auth[_0x0e5a('0x4')](),controller['index']);router[_0x0e5a('0x3')](_0x0e5a('0x5'),auth[_0x0e5a('0x4')](),controller[_0x0e5a('0x6')]);module[_0x0e5a('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 06826e1..c52ac96 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 _0x7f8f=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','index','getAllData','then','json','components/import/cm','format','params','pid','length','indexOf'];(function(_0x1781d9,_0x479026){var _0x50c607=function(_0x1302e1){while(--_0x1302e1){_0x1781d9['push'](_0x1781d9['shift']());}};_0x50c607(++_0x479026);}(_0x7f8f,0x1e0));var _0xf7f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f8f[_0x321bb2];return _0x9c12ed;};'use strict';var info=require(_0xf7f8('0x0'));var exec=require(_0xf7f8('0x1'))[_0xf7f8('0x2')];var logger=require('../../config/logger')('api');var util=require(_0xf7f8('0x3'));var BPromise=require(_0xf7f8('0x4'));var _=require(_0xf7f8('0x5'));function handleError(_0x1cc34a,_0x4eb757,_0x337a2d){_0x4eb757=_0x4eb757||0x1f4;return function(_0x5c57f1){logger[_0xf7f8('0x6')](_0xf7f8('0x7'),_0x337a2d,_0x4eb757,util['inspect'](_0x5c57f1,{'showHidden':![],'depth':null}));delete _0x5c57f1[_0xf7f8('0x8')];_0x1cc34a[_0xf7f8('0x9')](_0x4eb757)['send'](_0x5c57f1);};}exports[_0xf7f8('0xa')]=function(_0x23424a,_0x59f749){return info[_0xf7f8('0xb')]()[_0xf7f8('0xc')](function(_0x555c2c){return _0x59f749[_0xf7f8('0x9')](0xc8)[_0xf7f8('0xd')](_0x555c2c);})['catch'](function(_0x5746ac){return _0x59f749[_0xf7f8('0x9')](0x1f4)[_0xf7f8('0xd')](_0x5746ac);});};exports['killProcess']=function(_0x10be50,_0x5015da){var _0x155d9d=[_0xf7f8('0xe')];return new BPromise(function(_0x162979,_0x3906c2){return exec(util[_0xf7f8('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x10be50[_0xf7f8('0x10')][_0xf7f8('0x11')]),function(_0x4bb13a,_0x3ee1ab,_0xf634a5){if(_0x4bb13a){return _0x3906c2(_0x4bb13a);}return _0x162979(_0x3ee1ab);});})[_0xf7f8('0xc')](function(_0x1ab70b){var _0x49c0f3=![];var _0x308f2a=_0x1ab70b['split'](/\n/);for(var _0x4f8812=0x0,_0x1ca352=_0x155d9d[_0xf7f8('0x12')];_0x4f8812<_0x1ca352,_0x49c0f3===![];_0x4f8812+=0x1){if(_0x1ab70b[_0xf7f8('0x13')](_0x155d9d[_0x4f8812])>=0x0){_0x49c0f3=!![];}}if(!_0x49c0f3){throw new Error(util[_0xf7f8('0xf')](_0xf7f8('0x14'),_0x10be50[_0xf7f8('0x10')][_0xf7f8('0x11')]));}process[_0xf7f8('0x15')](_0x10be50[_0xf7f8('0x10')][_0xf7f8('0x11')],_0xf7f8('0x16'));return _0x5015da[_0xf7f8('0x9')](0xc8)[_0xf7f8('0xd')]({'message':util[_0xf7f8('0xf')](_0xf7f8('0x17'),_0x10be50[_0xf7f8('0x10')][_0xf7f8('0x11')])});})[_0xf7f8('0x18')](handleError(_0x5015da,null,'killProcess'));}; \ No newline at end of file +var _0x292c=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','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!','kill','SIGINT','pid','systeminformation','exec','../../config/logger','api','util','bluebird'];(function(_0x3bcc08,_0x16681b){var _0x23fdd5=function(_0x13c27d){while(--_0x13c27d){_0x3bcc08['push'](_0x3bcc08['shift']());}};_0x23fdd5(++_0x16681b);}(_0x292c,0x66));var _0xc292=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x292c[_0x37a7c6];return _0x539905;};'use strict';var info=require(_0xc292('0x0'));var exec=require('child_process')[_0xc292('0x1')];var logger=require(_0xc292('0x2'))(_0xc292('0x3'));var util=require(_0xc292('0x4'));var BPromise=require(_0xc292('0x5'));var _=require('lodash');function handleError(_0x1f14f9,_0x536154,_0x516f54){_0x536154=_0x536154||0x1f4;return function(_0x23c98f){logger[_0xc292('0x6')](_0xc292('0x7'),_0x516f54,_0x536154,util[_0xc292('0x8')](_0x23c98f,{'showHidden':![],'depth':null}));delete _0x23c98f[_0xc292('0x9')];_0x1f14f9[_0xc292('0xa')](_0x536154)[_0xc292('0xb')](_0x23c98f);};}exports[_0xc292('0xc')]=function(_0x162e17,_0x43fd69){return info['getAllData']()[_0xc292('0xd')](function(_0x659c9a){return _0x43fd69[_0xc292('0xa')](0xc8)[_0xc292('0xe')](_0x659c9a);})[_0xc292('0xf')](function(_0x51fff4){return _0x43fd69[_0xc292('0xa')](0x1f4)[_0xc292('0xe')](_0x51fff4);});};exports[_0xc292('0x10')]=function(_0xee5033,_0x1c6488){var _0x3ead77=['components/import/cm'];return new BPromise(function(_0x891862,_0x3e12ad){return exec(util[_0xc292('0x11')](_0xc292('0x12'),_0xee5033[_0xc292('0x13')]['pid']),function(_0x56417e,_0x402c9b,_0x3d03b6){if(_0x56417e){return _0x3e12ad(_0x56417e);}return _0x891862(_0x402c9b);});})['then'](function(_0x290138){var _0x53a23e=![];var _0x5e765a=_0x290138[_0xc292('0x14')](/\n/);for(var _0x5bde28=0x0,_0x156747=_0x3ead77[_0xc292('0x15')];_0x5bde28<_0x156747,_0x53a23e===![];_0x5bde28+=0x1){if(_0x290138[_0xc292('0x16')](_0x3ead77[_0x5bde28])>=0x0){_0x53a23e=!![];}}if(!_0x53a23e){throw new Error(util['format'](_0xc292('0x17'),_0xee5033['params']['pid']));}process[_0xc292('0x18')](_0xee5033[_0xc292('0x13')]['pid'],_0xc292('0x19'));return _0x1c6488[_0xc292('0xa')](0xc8)[_0xc292('0xe')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xee5033[_0xc292('0x13')][_0xc292('0x1a')])});})[_0xc292('0xf')](handleError(_0x1c6488,null,_0xc292('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 9307856..b2a5637 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 _0x1945=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','post','create','put','delete','destroy','exports'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x1945,0xfc));var _0x5194=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x1945[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x5194('0x0'));var util=require(_0x5194('0x1'));var path=require(_0x5194('0x2'));var timeout=require(_0x5194('0x3'));var express=require('express');var router=express[_0x5194('0x4')]();var fs_extra=require(_0x5194('0x5'));var auth=require(_0x5194('0x6'));var interaction=require(_0x5194('0x7'));var config=require(_0x5194('0x8'));var controller=require(_0x5194('0x9'));router[_0x5194('0xa')]('/',auth[_0x5194('0xb')](),controller['index']);router[_0x5194('0xa')]('/:id',auth[_0x5194('0xb')](),controller['show']);router[_0x5194('0xc')]('/',auth[_0x5194('0xb')](),controller[_0x5194('0xd')]);router[_0x5194('0xe')]('/:id',auth[_0x5194('0xb')](),controller['update']);router[_0x5194('0xf')]('/:id',auth[_0x5194('0xb')](),controller[_0x5194('0x10')]);module[_0x5194('0x11')]=router; \ No newline at end of file +var _0x06fb=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x59cc48,_0x4df265){var _0x1ebc97=function(_0x473b8a){while(--_0x473b8a){_0x59cc48['push'](_0x59cc48['shift']());}};_0x1ebc97(++_0x4df265);}(_0x06fb,0x1ad));var _0xb06f=function(_0x18f1e6,_0x521510){_0x18f1e6=_0x18f1e6-0x0;var _0x5dcd46=_0x06fb[_0x18f1e6];return _0x5dcd46;};'use strict';var multer=require(_0xb06f('0x0'));var util=require(_0xb06f('0x1'));var path=require(_0xb06f('0x2'));var timeout=require(_0xb06f('0x3'));var express=require(_0xb06f('0x4'));var router=express[_0xb06f('0x5')]();var fs_extra=require(_0xb06f('0x6'));var auth=require(_0xb06f('0x7'));var interaction=require(_0xb06f('0x8'));var config=require(_0xb06f('0x9'));var controller=require('./tag.controller');router[_0xb06f('0xa')]('/',auth[_0xb06f('0xb')](),controller[_0xb06f('0xc')]);router['get'](_0xb06f('0xd'),auth[_0xb06f('0xb')](),controller['show']);router[_0xb06f('0xe')]('/',auth[_0xb06f('0xb')](),controller[_0xb06f('0xf')]);router[_0xb06f('0x10')](_0xb06f('0xd'),auth[_0xb06f('0xb')](),controller[_0xb06f('0x11')]);router['delete'](_0xb06f('0xd'),auth[_0xb06f('0xb')](),controller[_0xb06f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 39e970a..c70243e 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 _0xc94f=['#0091EA','sequelize','STRING','name'];(function(_0x3adeed,_0x27a8df){var _0x5b98e2=function(_0x36672f){while(--_0x36672f){_0x3adeed['push'](_0x3adeed['shift']());}};_0x5b98e2(++_0x27a8df);}(_0xc94f,0xcd));var _0xfc94=function(_0x310d83,_0x31d73c){_0x310d83=_0x310d83-0x0;var _0x544377=_0xc94f[_0x310d83];return _0x544377;};'use strict';var Sequelize=require(_0xfc94('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc94('0x1')],'unique':_0xfc94('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xfc94('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6629=['STRING','#0091EA','sequelize','name'];(function(_0x25129a,_0x5496fb){var _0x8e07bd=function(_0x111b0b){while(--_0x111b0b){_0x25129a['push'](_0x25129a['shift']());}};_0x8e07bd(++_0x5496fb);}(_0x6629,0x1c2));var _0x9662=function(_0x5672b3,_0x2889bf){_0x5672b3=_0x5672b3-0x0;var _0x169888=_0x6629[_0x5672b3];return _0x169888;};'use strict';var Sequelize=require(_0x9662('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9662('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x9662('0x2')],'defaultValue':_0x9662('0x3')},'description':{'type':Sequelize[_0x9662('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index fb361f0..f346136 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 _0x5712=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','save','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','user','get','role','userProfileId','autoAssociation','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x119ec0,_0x206327){var _0x56f82b=function(_0x3db649){while(--_0x3db649){_0x119ec0['push'](_0x119ec0['shift']());}};_0x56f82b(++_0x206327);}(_0x5712,0x140));var _0x2571=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5712[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x2571('0x0'));var rimraf=require(_0x2571('0x1'));var zipdir=require(_0x2571('0x2'));var jsonpatch=require(_0x2571('0x3'));var rp=require(_0x2571('0x4'));var moment=require(_0x2571('0x5'));var BPromise=require(_0x2571('0x6'));var Mustache=require(_0x2571('0x7'));var util=require(_0x2571('0x8'));var path=require(_0x2571('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2571('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2571('0xb'));var squel=require(_0x2571('0xc'));var crypto=require(_0x2571('0xd'));var jsforce=require(_0x2571('0xe'));var deskjs=require(_0x2571('0xf'));var toCsv=require(_0x2571('0x10'));var querystring=require('querystring');var Papa=require(_0x2571('0x11'));var Redis=require('ioredis');var authService=require(_0x2571('0x12'));var qs=require(_0x2571('0x13'));var as=require(_0x2571('0x14'));var hardwareService=require(_0x2571('0x15'));var logger=require(_0x2571('0x16'))(_0x2571('0x17'));var utils=require(_0x2571('0x18'));var config=require(_0x2571('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d3ed,_0x1ab846){_0x1ab846=_0x1ab846||0xcc;return function(_0x10823d){if(_0x10823d){return _0x33d3ed[_0x2571('0x1a')](_0x1ab846);}return _0x33d3ed[_0x2571('0x1b')](_0x1ab846)[_0x2571('0x1c')]();};}function respondWithResult(_0x241129,_0x130ab1){_0x130ab1=_0x130ab1||0xc8;return function(_0xdf8c3a){if(_0xdf8c3a){return _0x241129[_0x2571('0x1b')](_0x130ab1)[_0x2571('0x1d')](_0xdf8c3a);}};}function respondWithFilteredResult(_0x3c1a08,_0x5b0392){return function(_0x30b0f2){if(_0x30b0f2){var _0x47b5e9=typeof _0x5b0392['offset']==='undefined'&&typeof _0x5b0392['limit']===_0x2571('0x1e');var _0x371ae2=_0x30b0f2[_0x2571('0x1f')];var _0x75af2a=_0x47b5e9?0x0:_0x5b0392['offset'];var _0x7707=_0x47b5e9?_0x30b0f2[_0x2571('0x1f')]:_0x5b0392['offset']+_0x5b0392[_0x2571('0x20')];var _0x7303ad;if(_0x7707>=_0x371ae2){_0x7707=_0x371ae2;_0x7303ad=0xc8;}else{_0x7303ad=0xce;}_0x3c1a08[_0x2571('0x1b')](_0x7303ad);return _0x3c1a08[_0x2571('0x21')](_0x2571('0x22'),_0x75af2a+'-'+_0x7707+'/'+_0x371ae2)['json'](_0x30b0f2);}return null;};}function patchUpdates(_0x52da27){return function(_0x5fe030){try{jsonpatch[_0x2571('0x23')](_0x5fe030,_0x52da27,!![]);}catch(_0x58f6aa){return BPromise['reject'](_0x58f6aa);}return _0x5fe030[_0x2571('0x24')]();};}function saveUpdates(_0x2e7d89,_0x2218fb){return function(_0xb6dfa6){if(_0xb6dfa6){return _0xb6dfa6['update'](_0x2e7d89)[_0x2571('0x25')](function(_0x55ec06){return _0x55ec06;});}return null;};}function removeEntity(_0x1ec23c,_0x4316b1){return function(_0x5d6778){if(_0x5d6778){return _0x5d6778[_0x2571('0x26')]()[_0x2571('0x25')](function(){var _0x22cdb8=_0x5d6778['get']({'plain':!![]});var _0x5d455d=_0x2571('0x27');return db[_0x2571('0x28')][_0x2571('0x26')]({'where':{'type':_0x5d455d,'resourceId':_0x22cdb8['id']}})[_0x2571('0x25')](function(){return _0x5d6778;});})[_0x2571('0x25')](function(){_0x1ec23c[_0x2571('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6ccc,_0x1ceb21){return function(_0x426615){if(!_0x426615){_0x4f6ccc[_0x2571('0x1a')](0x194);}return _0x426615;};}function handleError(_0x2ce206,_0x26757a){_0x26757a=_0x26757a||0x1f4;return function(_0x165aa8){logger[_0x2571('0x29')](_0x165aa8[_0x2571('0x2a')]);if(_0x165aa8[_0x2571('0x2b')]){delete _0x165aa8[_0x2571('0x2b')];}_0x2ce206['status'](_0x26757a)[_0x2571('0x2c')](_0x165aa8);};}exports[_0x2571('0x2d')]=function(_0x26af3c,_0x441e7d){var _0x1bf5d1={},_0x2902cb={},_0x5bc2e7={'count':0x0,'rows':[]};var _0x4c4911=_[_0x2571('0x2e')](db[_0x2571('0x2f')][_0x2571('0x30')],function(_0x2b6416){return{'name':_0x2b6416['fieldName'],'type':_0x2b6416[_0x2571('0x31')][_0x2571('0x32')]};});_0x2902cb['model']=_['map'](_0x4c4911,_0x2571('0x2b'));_0x2902cb[_0x2571('0x33')]=_[_0x2571('0x34')](_0x26af3c['query']);_0x2902cb[_0x2571('0x35')]=_[_0x2571('0x36')](_0x2902cb['model'],_0x2902cb[_0x2571('0x33')]);_0x1bf5d1['attributes']=_[_0x2571('0x36')](_0x2902cb[_0x2571('0x37')],qs[_0x2571('0x38')](_0x26af3c['query']['fields']));_0x1bf5d1[_0x2571('0x39')]=_0x1bf5d1['attributes'][_0x2571('0x3a')]?_0x1bf5d1[_0x2571('0x39')]:_0x2902cb[_0x2571('0x37')];if(!_0x26af3c[_0x2571('0x33')]['hasOwnProperty'](_0x2571('0x3b'))){_0x1bf5d1[_0x2571('0x20')]=qs['limit'](_0x26af3c[_0x2571('0x33')][_0x2571('0x20')]);_0x1bf5d1['offset']=qs[_0x2571('0x3c')](_0x26af3c[_0x2571('0x33')][_0x2571('0x3c')]);}_0x1bf5d1[_0x2571('0x3d')]=qs[_0x2571('0x3e')](_0x26af3c[_0x2571('0x33')][_0x2571('0x3e')]);_0x1bf5d1[_0x2571('0x3f')]=qs[_0x2571('0x35')](_[_0x2571('0x40')](_0x26af3c[_0x2571('0x33')],_0x2902cb[_0x2571('0x35')]),_0x4c4911);if(_0x26af3c[_0x2571('0x33')][_0x2571('0x41')]){_0x1bf5d1['where']=_[_0x2571('0x42')](_0x1bf5d1[_0x2571('0x3f')],{'$or':_[_0x2571('0x2e')](_0x4c4911,function(_0x440752){if(_0x440752[_0x2571('0x31')]!==_0x2571('0x43')){var _0x35deff={};_0x35deff[_0x440752['name']]={'$like':'%'+_0x26af3c[_0x2571('0x33')][_0x2571('0x41')]+'%'};return _0x35deff;}})});}_0x1bf5d1=_[_0x2571('0x42')]({},_0x1bf5d1,_0x26af3c['options']);var _0x5fe079={'where':_0x1bf5d1[_0x2571('0x3f')]};return db[_0x2571('0x2f')]['count'](_0x5fe079)[_0x2571('0x25')](function(_0x1c6ccd){_0x5bc2e7[_0x2571('0x1f')]=_0x1c6ccd;if(_0x26af3c[_0x2571('0x33')][_0x2571('0x44')]){_0x1bf5d1[_0x2571('0x45')]=[{'all':!![]}];}return db[_0x2571('0x2f')][_0x2571('0x46')](_0x1bf5d1);})[_0x2571('0x25')](function(_0x5d2734){_0x5bc2e7[_0x2571('0x47')]=_0x5d2734;return _0x5bc2e7;})[_0x2571('0x25')](respondWithFilteredResult(_0x441e7d,_0x1bf5d1))[_0x2571('0x48')](handleError(_0x441e7d,null));};exports[_0x2571('0x49')]=function(_0x2411d9,_0x1e6f2c){var _0x391c01={'raw':!![],'where':{'id':_0x2411d9['params']['id']}},_0x2d024c={};_0x2d024c['model']=_['keys'](db['Tag']['rawAttributes']);_0x2d024c['query']=_[_0x2571('0x34')](_0x2411d9[_0x2571('0x33')]);_0x2d024c['filters']=_[_0x2571('0x36')](_0x2d024c[_0x2571('0x37')],_0x2d024c[_0x2571('0x33')]);_0x391c01[_0x2571('0x39')]=_[_0x2571('0x36')](_0x2d024c['model'],qs['fields'](_0x2411d9['query'][_0x2571('0x38')]));_0x391c01[_0x2571('0x39')]=_0x391c01[_0x2571('0x39')][_0x2571('0x3a')]?_0x391c01[_0x2571('0x39')]:_0x2d024c[_0x2571('0x37')];if(_0x2411d9[_0x2571('0x33')]['includeAll']){_0x391c01[_0x2571('0x45')]=[{'all':!![]}];}_0x391c01=_[_0x2571('0x42')]({},_0x391c01,_0x2411d9[_0x2571('0x4a')]);return db['Tag'][_0x2571('0x4b')](_0x391c01)[_0x2571('0x25')](handleEntityNotFound(_0x1e6f2c,null))[_0x2571('0x25')](respondWithResult(_0x1e6f2c,null))[_0x2571('0x48')](handleError(_0x1e6f2c,null));};exports['create']=function(_0x18291c,_0x245edb){return db[_0x2571('0x2f')][_0x2571('0x4c')](_0x18291c['body'],{})[_0x2571('0x25')](function(_0xef8f21){var _0x10d956=_0x18291c[_0x2571('0x4d')][_0x2571('0x4e')]({'plain':!![]});if(!_0x10d956)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10d956[_0x2571('0x4f')]===_0x2571('0x4d')){var _0x20302b=_0xef8f21[_0x2571('0x4e')]({'plain':!![]});var _0x6a55ff=_0x2571('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x6a55ff,'userProfileId':_0x10d956[_0x2571('0x50')]},'raw':!![]})['then'](function(_0x47ff18){if(_0x47ff18&&_0x47ff18[_0x2571('0x51')]===0x0){return db[_0x2571('0x28')][_0x2571('0x4c')]({'name':_0x20302b[_0x2571('0x2b')],'resourceId':_0x20302b['id'],'type':_0x47ff18[_0x2571('0x2b')],'sectionId':_0x47ff18['id']},{})[_0x2571('0x25')](function(){return _0xef8f21;});}else{return _0xef8f21;}})[_0x2571('0x48')](function(_0x3c890a){logger[_0x2571('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c890a);throw _0x3c890a;});}return _0xef8f21;})[_0x2571('0x25')](respondWithResult(_0x245edb,0xc9))[_0x2571('0x48')](handleError(_0x245edb,null));};exports[_0x2571('0x52')]=function(_0x495c45,_0x3823c9){if(_0x495c45['body']['id']){delete _0x495c45[_0x2571('0x53')]['id'];}return db[_0x2571('0x2f')][_0x2571('0x4b')]({'where':{'id':_0x495c45['params']['id']}})['then'](handleEntityNotFound(_0x3823c9,null))['then'](saveUpdates(_0x495c45['body'],null))[_0x2571('0x25')](respondWithResult(_0x3823c9,null))[_0x2571('0x48')](handleError(_0x3823c9,null));};exports[_0x2571('0x26')]=function(_0x3ce2b9,_0x333b91){return db[_0x2571('0x2f')][_0x2571('0x4b')]({'where':{'id':_0x3ce2b9[_0x2571('0x54')]['id']}})[_0x2571('0x25')](handleEntityNotFound(_0x333b91,null))[_0x2571('0x25')](removeEntity(_0x333b91,null))[_0x2571('0x48')](handleError(_0x333b91,null));}; \ No newline at end of file +var _0xe812=['userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','then','get','Tags','UserProfileResource','destroy','name','send','index','Tag','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe812,0x1f2));var _0x2e81=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe812[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2e81('0x0'));var zipdir=require(_0x2e81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e81('0x2'));var BPromise=require(_0x2e81('0x3'));var Mustache=require('mustache');var util=require(_0x2e81('0x4'));var path=require(_0x2e81('0x5'));var sox=require('sox');var csv=require(_0x2e81('0x6'));var ejs=require(_0x2e81('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e81('0x8'));var squel=require(_0x2e81('0x9'));var crypto=require(_0x2e81('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2e81('0xb'));var toCsv=require(_0x2e81('0x6'));var querystring=require(_0x2e81('0xc'));var Papa=require(_0x2e81('0xd'));var Redis=require('ioredis');var authService=require(_0x2e81('0xe'));var qs=require(_0x2e81('0xf'));var as=require(_0x2e81('0x10'));var hardwareService=require(_0x2e81('0x11'));var logger=require(_0x2e81('0x12'))(_0x2e81('0x13'));var utils=require(_0x2e81('0x14'));var config=require(_0x2e81('0x15'));var licenseUtil=require(_0x2e81('0x16'));var db=require(_0x2e81('0x17'))['db'];function respondWithStatusCode(_0x4284f3,_0x5c58a2){_0x5c58a2=_0x5c58a2||0xcc;return function(_0x30a730){if(_0x30a730){return _0x4284f3[_0x2e81('0x18')](_0x5c58a2);}return _0x4284f3['status'](_0x5c58a2)[_0x2e81('0x19')]();};}function respondWithResult(_0x5598a9,_0x2a4411){_0x2a4411=_0x2a4411||0xc8;return function(_0x2b24f0){if(_0x2b24f0){return _0x5598a9[_0x2e81('0x1a')](_0x2a4411)[_0x2e81('0x1b')](_0x2b24f0);}};}function respondWithFilteredResult(_0x1bb937,_0x3a8c05){return function(_0x53da62){if(_0x53da62){var _0xc4d315=typeof _0x3a8c05[_0x2e81('0x1c')]==='undefined'&&typeof _0x3a8c05[_0x2e81('0x1d')]==='undefined';var _0x2cc0c6=_0x53da62[_0x2e81('0x1e')];var _0x4c1b11=_0xc4d315?0x0:_0x3a8c05[_0x2e81('0x1c')];var _0x2bb9b6=_0xc4d315?_0x53da62[_0x2e81('0x1e')]:_0x3a8c05[_0x2e81('0x1c')]+_0x3a8c05[_0x2e81('0x1d')];var _0x1f20bf;if(_0x2bb9b6>=_0x2cc0c6){_0x2bb9b6=_0x2cc0c6;_0x1f20bf=0xc8;}else{_0x1f20bf=0xce;}_0x1bb937[_0x2e81('0x1a')](_0x1f20bf);return _0x1bb937[_0x2e81('0x1f')](_0x2e81('0x20'),_0x4c1b11+'-'+_0x2bb9b6+'/'+_0x2cc0c6)[_0x2e81('0x1b')](_0x53da62);}return null;};}function patchUpdates(_0x524694){return function(_0x10b77e){try{jsonpatch[_0x2e81('0x21')](_0x10b77e,_0x524694,!![]);}catch(_0x9ddf6b){return BPromise[_0x2e81('0x22')](_0x9ddf6b);}return _0x10b77e[_0x2e81('0x23')]();};}function saveUpdates(_0x386721,_0x18b9be){return function(_0x39ffa8){if(_0x39ffa8){return _0x39ffa8['update'](_0x386721)[_0x2e81('0x24')](function(_0x49e9f1){return _0x49e9f1;});}return null;};}function removeEntity(_0x2d50af,_0x4fe130){return function(_0x1d09cb){if(_0x1d09cb){return _0x1d09cb['destroy']()['then'](function(){var _0x123d3d=_0x1d09cb[_0x2e81('0x25')]({'plain':!![]});var _0x4a75ff=_0x2e81('0x26');return db[_0x2e81('0x27')][_0x2e81('0x28')]({'where':{'type':_0x4a75ff,'resourceId':_0x123d3d['id']}})[_0x2e81('0x24')](function(){return _0x1d09cb;});})[_0x2e81('0x24')](function(){_0x2d50af[_0x2e81('0x1a')](0xcc)[_0x2e81('0x19')]();});}};}function handleEntityNotFound(_0x4669aa,_0x1b34db){return function(_0x1bf5a6){if(!_0x1bf5a6){_0x4669aa[_0x2e81('0x18')](0x194);}return _0x1bf5a6;};}function handleError(_0xc0720f,_0x8edf9c){_0x8edf9c=_0x8edf9c||0x1f4;return function(_0x3ec91d){logger['error'](_0x3ec91d['stack']);if(_0x3ec91d[_0x2e81('0x29')]){delete _0x3ec91d[_0x2e81('0x29')];}_0xc0720f[_0x2e81('0x1a')](_0x8edf9c)[_0x2e81('0x2a')](_0x3ec91d);};}exports[_0x2e81('0x2b')]=function(_0x2a78bb,_0x243b20){var _0x13612b={},_0x26ec2a={},_0x1c37d1={'count':0x0,'rows':[]};var _0x392c5b=_['map'](db[_0x2e81('0x2c')][_0x2e81('0x2d')],function(_0x1d0437){return{'name':_0x1d0437[_0x2e81('0x2e')],'type':_0x1d0437[_0x2e81('0x2f')][_0x2e81('0x30')]};});_0x26ec2a[_0x2e81('0x31')]=_[_0x2e81('0x32')](_0x392c5b,_0x2e81('0x29'));_0x26ec2a[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2a78bb[_0x2e81('0x33')]);_0x26ec2a[_0x2e81('0x35')]=_[_0x2e81('0x36')](_0x26ec2a[_0x2e81('0x31')],_0x26ec2a[_0x2e81('0x33')]);_0x13612b[_0x2e81('0x37')]=_['intersection'](_0x26ec2a[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2a78bb['query'][_0x2e81('0x38')]));_0x13612b[_0x2e81('0x37')]=_0x13612b['attributes'][_0x2e81('0x39')]?_0x13612b[_0x2e81('0x37')]:_0x26ec2a[_0x2e81('0x31')];if(!_0x2a78bb['query'][_0x2e81('0x3a')](_0x2e81('0x3b'))){_0x13612b[_0x2e81('0x1d')]=qs[_0x2e81('0x1d')](_0x2a78bb[_0x2e81('0x33')]['limit']);_0x13612b['offset']=qs['offset'](_0x2a78bb['query'][_0x2e81('0x1c')]);}_0x13612b['order']=qs['sort'](_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3c')]);_0x13612b[_0x2e81('0x3d')]=qs['filters'](_[_0x2e81('0x3e')](_0x2a78bb[_0x2e81('0x33')],_0x26ec2a[_0x2e81('0x35')]),_0x392c5b);if(_0x2a78bb[_0x2e81('0x33')][_0x2e81('0x3f')]){_0x13612b['where']=_['merge'](_0x13612b[_0x2e81('0x3d')],{'$or':_[_0x2e81('0x32')](_0x392c5b,function(_0x35d1c0){if(_0x35d1c0['type']!==_0x2e81('0x40')){var _0x44d10c={};_0x44d10c[_0x35d1c0[_0x2e81('0x29')]]={'$like':'%'+_0x2a78bb['query'][_0x2e81('0x3f')]+'%'};return _0x44d10c;}})});}_0x13612b=_[_0x2e81('0x41')]({},_0x13612b,_0x2a78bb[_0x2e81('0x42')]);var _0x10e240={'where':_0x13612b[_0x2e81('0x3d')]};return db[_0x2e81('0x2c')][_0x2e81('0x1e')](_0x10e240)[_0x2e81('0x24')](function(_0x5508f0){_0x1c37d1['count']=_0x5508f0;if(_0x2a78bb[_0x2e81('0x33')]['includeAll']){_0x13612b[_0x2e81('0x43')]=[{'all':!![]}];}return db[_0x2e81('0x2c')][_0x2e81('0x44')](_0x13612b);})[_0x2e81('0x24')](function(_0x3c5fbb){_0x1c37d1[_0x2e81('0x45')]=_0x3c5fbb;return _0x1c37d1;})['then'](respondWithFilteredResult(_0x243b20,_0x13612b))['catch'](handleError(_0x243b20,null));};exports[_0x2e81('0x46')]=function(_0x2bc2a7,_0x1a8233){var _0x53bb7c={'raw':!![],'where':{'id':_0x2bc2a7[_0x2e81('0x47')]['id']}},_0x4499b7={};_0x4499b7['model']=_[_0x2e81('0x34')](db['Tag'][_0x2e81('0x2d')]);_0x4499b7[_0x2e81('0x33')]=_[_0x2e81('0x34')](_0x2bc2a7[_0x2e81('0x33')]);_0x4499b7['filters']=_[_0x2e81('0x36')](_0x4499b7['model'],_0x4499b7[_0x2e81('0x33')]);_0x53bb7c[_0x2e81('0x37')]=_['intersection'](_0x4499b7[_0x2e81('0x31')],qs[_0x2e81('0x38')](_0x2bc2a7[_0x2e81('0x33')][_0x2e81('0x38')]));_0x53bb7c[_0x2e81('0x37')]=_0x53bb7c[_0x2e81('0x37')][_0x2e81('0x39')]?_0x53bb7c['attributes']:_0x4499b7[_0x2e81('0x31')];if(_0x2bc2a7['query']['includeAll']){_0x53bb7c[_0x2e81('0x43')]=[{'all':!![]}];}_0x53bb7c=_['merge']({},_0x53bb7c,_0x2bc2a7['options']);return db[_0x2e81('0x2c')][_0x2e81('0x48')](_0x53bb7c)[_0x2e81('0x24')](handleEntityNotFound(_0x1a8233,null))['then'](respondWithResult(_0x1a8233,null))['catch'](handleError(_0x1a8233,null));};exports[_0x2e81('0x49')]=function(_0x1dd4d7,_0x16ed11){return db[_0x2e81('0x2c')]['create'](_0x1dd4d7['body'],{})[_0x2e81('0x24')](function(_0x4056e8){var _0x5631b6=_0x1dd4d7['user'][_0x2e81('0x25')]({'plain':!![]});if(!_0x5631b6)throw new Error(_0x2e81('0x4a'));if(_0x5631b6['role']===_0x2e81('0x4b')){var _0x33a4d7=_0x4056e8[_0x2e81('0x25')]({'plain':!![]});var _0x3402b3=_0x2e81('0x26');return db['UserProfileSection'][_0x2e81('0x48')]({'where':{'name':_0x3402b3,'userProfileId':_0x5631b6[_0x2e81('0x4c')]},'raw':!![]})[_0x2e81('0x24')](function(_0xb4decd){if(_0xb4decd&&_0xb4decd['autoAssociation']===0x0){return db['UserProfileResource'][_0x2e81('0x49')]({'name':_0x33a4d7[_0x2e81('0x29')],'resourceId':_0x33a4d7['id'],'type':_0xb4decd[_0x2e81('0x29')],'sectionId':_0xb4decd['id']},{})[_0x2e81('0x24')](function(){return _0x4056e8;});}else{return _0x4056e8;}})[_0x2e81('0x4d')](function(_0x482888){logger[_0x2e81('0x4e')](_0x2e81('0x4f'),_0x482888);throw _0x482888;});}return _0x4056e8;})[_0x2e81('0x24')](respondWithResult(_0x16ed11,0xc9))[_0x2e81('0x4d')](handleError(_0x16ed11,null));};exports[_0x2e81('0x50')]=function(_0x4aa5e5,_0x44db7f){if(_0x4aa5e5[_0x2e81('0x51')]['id']){delete _0x4aa5e5['body']['id'];}return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x4aa5e5['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x44db7f,null))[_0x2e81('0x24')](saveUpdates(_0x4aa5e5[_0x2e81('0x51')],null))[_0x2e81('0x24')](respondWithResult(_0x44db7f,null))[_0x2e81('0x4d')](handleError(_0x44db7f,null));};exports[_0x2e81('0x28')]=function(_0x18beeb,_0x1570c1){return db['Tag'][_0x2e81('0x48')]({'where':{'id':_0x18beeb['params']['id']}})[_0x2e81('0x24')](handleEntityNotFound(_0x1570c1,null))[_0x2e81('0x24')](removeEntity(_0x1570c1,null))['catch'](handleError(_0x1570c1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 379e2d5..fdf0d26 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 _0xbaaf=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2af341,_0x492d40){var _0x2ca333=function(_0x259a1d){while(--_0x259a1d){_0x2af341['push'](_0x2af341['shift']());}};_0x2ca333(++_0x492d40);}(_0xbaaf,0x1a8));var _0xfbaa=function(_0x1a6e89,_0x191f27){_0x1a6e89=_0x1a6e89-0x0;var _0x4b9d9c=_0xbaaf[_0x1a6e89];return _0x4b9d9c;};'use strict';var _=require(_0xfbaa('0x0'));var util=require(_0xfbaa('0x1'));var logger=require(_0xfbaa('0x2'))(_0xfbaa('0x3'));var moment=require(_0xfbaa('0x4'));var BPromise=require(_0xfbaa('0x5'));var rp=require(_0xfbaa('0x6'));var fs=require('fs');var path=require(_0xfbaa('0x7'));var rimraf=require(_0xfbaa('0x8'));var config=require(_0xfbaa('0x9'));var attributes=require('./tag.attributes');module[_0xfbaa('0xa')]=function(_0x1ed796,_0x10dd1c){return _0x1ed796[_0xfbaa('0xb')](_0xfbaa('0xc'),attributes,{'tableName':_0xfbaa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63c9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./tag.attributes','exports','define','tools_tags'];(function(_0x36585c,_0x359307){var _0x43b082=function(_0x256615){while(--_0x256615){_0x36585c['push'](_0x36585c['shift']());}};_0x43b082(++_0x359307);}(_0x63c9,0x140));var _0x963c=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x63c9[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x963c('0x0'))(_0x963c('0x1'));var moment=require(_0x963c('0x2'));var BPromise=require(_0x963c('0x3'));var rp=require(_0x963c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x963c('0x5'));var config=require('../../config/environment');var attributes=require(_0x963c('0x6'));module[_0x963c('0x7')]=function(_0x2c2ebe,_0x3e5757){return _0x2c2ebe[_0x963c('0x8')]('Tag',attributes,{'tableName':_0x963c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 5dc60f4..dd05534 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 _0x4fef=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x5c2f94,_0xe9c5ec){var _0x52ded1=function(_0x108b75){while(--_0x108b75){_0x5c2f94['push'](_0x5c2f94['shift']());}};_0x52ded1(++_0xe9c5ec);}(_0x4fef,0x10f));var _0xf4fe=function(_0x5756af,_0x11a76a){_0x5756af=_0x5756af-0x0;var _0x507ced=_0x4fef[_0x5756af];return _0x507ced;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});} \ No newline at end of file +var _0x26c2=['message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5bc202,_0x314535){var _0x253744=function(_0x66339c){while(--_0x66339c){_0x5bc202['push'](_0x5bc202['shift']());}};_0x253744(++_0x314535);}(_0x26c2,0x130));var _0x226c=function(_0x635a5b,_0x21c348){_0x635a5b=_0x635a5b-0x0;var _0x4eab61=_0x26c2[_0x635a5b];return _0x4eab61;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('Tag,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('Tag,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 6112de6..bdc7b85 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 5793e13..80fcdac 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 _0xb10b=['name','sequelize','STRING'];(function(_0x3c4a4e,_0x2b45e1){var _0x3e5982=function(_0x33159f){while(--_0x33159f){_0x3c4a4e['push'](_0x3c4a4e['shift']());}};_0x3e5982(++_0x2b45e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0xb10b[_0x21d0d7];return _0x5e725b;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 87c03d7..2c35654 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 _0xb068=['ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','through','QueueId','TeamVoiceQueue','penalty','Queue','findOrCreate','emit','Queue:save','User','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','TeamVoicePrefix','removeAgents','isArray','Fax','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','then','name','send','index','map','Team','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','destroy','MailQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queues','add','capitalize'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xb068,0x152));var _0x8b06=function(_0x34a09c,_0x3af48c){_0x34a09c=_0x34a09c-0x0;var _0x551668=_0xb068[_0x34a09c];return _0x551668;};'use strict';var emlformat=require(_0x8b06('0x0'));var rimraf=require(_0x8b06('0x1'));var zipdir=require(_0x8b06('0x2'));var jsonpatch=require(_0x8b06('0x3'));var rp=require(_0x8b06('0x4'));var moment=require(_0x8b06('0x5'));var BPromise=require(_0x8b06('0x6'));var Mustache=require(_0x8b06('0x7'));var util=require(_0x8b06('0x8'));var path=require(_0x8b06('0x9'));var sox=require(_0x8b06('0xa'));var csv=require(_0x8b06('0xb'));var ejs=require(_0x8b06('0xc'));var fs=require('fs');var fs_extra=require(_0x8b06('0xd'));var _=require(_0x8b06('0xe'));var squel=require(_0x8b06('0xf'));var crypto=require(_0x8b06('0x10'));var jsforce=require(_0x8b06('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8b06('0x12'));var authService=require(_0x8b06('0x13'));var qs=require(_0x8b06('0x14'));var as=require(_0x8b06('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b06('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8b06('0x17'))['db'];config[_0x8b06('0x18')]=_[_0x8b06('0x19')](config['redis'],{'host':_0x8b06('0x1a'),'port':0x18eb});var socket=require(_0x8b06('0x1b'))(new Redis(config[_0x8b06('0x18')]));require('./team.socket')[_0x8b06('0x1c')](socket);function respondWithStatusCode(_0x12e073,_0x2f05a3){_0x2f05a3=_0x2f05a3||0xcc;return function(_0x301850){if(_0x301850){return _0x12e073[_0x8b06('0x1d')](_0x2f05a3);}return _0x12e073['status'](_0x2f05a3)[_0x8b06('0x1e')]();};}function respondWithResult(_0x684b89,_0x817e3e){_0x817e3e=_0x817e3e||0xc8;return function(_0x43bca4){if(_0x43bca4){return _0x684b89[_0x8b06('0x1f')](_0x817e3e)['json'](_0x43bca4);}};}function respondWithFilteredResult(_0x12635a,_0xf4e630){return function(_0x13f91e){if(_0x13f91e){var _0x304385=typeof _0xf4e630[_0x8b06('0x20')]===_0x8b06('0x21')&&typeof _0xf4e630['limit']===_0x8b06('0x21');var _0x2054cf=_0x13f91e['count'];var _0x1ec349=_0x304385?0x0:_0xf4e630[_0x8b06('0x20')];var _0x5e4282=_0x304385?_0x13f91e[_0x8b06('0x22')]:_0xf4e630[_0x8b06('0x20')]+_0xf4e630[_0x8b06('0x23')];var _0x5d4e49;if(_0x5e4282>=_0x2054cf){_0x5e4282=_0x2054cf;_0x5d4e49=0xc8;}else{_0x5d4e49=0xce;}_0x12635a['status'](_0x5d4e49);return _0x12635a[_0x8b06('0x24')](_0x8b06('0x25'),_0x1ec349+'-'+_0x5e4282+'/'+_0x2054cf)[_0x8b06('0x26')](_0x13f91e);}return null;};}function patchUpdates(_0x1b5b04){return function(_0x3c3d0c){try{jsonpatch['apply'](_0x3c3d0c,_0x1b5b04,!![]);}catch(_0x2ecc7c){return BPromise['reject'](_0x2ecc7c);}return _0x3c3d0c[_0x8b06('0x27')]();};}function saveUpdates(_0xba6b43,_0x20e6bb){return function(_0x2228b8){if(_0x2228b8){return _0x2228b8['update'](_0xba6b43)[_0x8b06('0x28')](function(_0x1a85a0){return _0x1a85a0;});}return null;};}function handleEntityNotFound(_0x3e659d,_0x98023){return function(_0x4eee79){if(!_0x4eee79){_0x3e659d[_0x8b06('0x1d')](0x194);}return _0x4eee79;};}function handleError(_0x19f10d,_0x44a448){_0x44a448=_0x44a448||0x1f4;return function(_0x230344){logger['error'](_0x230344['stack']);if(_0x230344[_0x8b06('0x29')]){delete _0x230344[_0x8b06('0x29')];}_0x19f10d[_0x8b06('0x1f')](_0x44a448)[_0x8b06('0x2a')](_0x230344);};}exports[_0x8b06('0x2b')]=function(_0x234ea9,_0xd2bf60){var _0x26fbc1={},_0x49cb38={},_0x2a5526={'count':0x0,'rows':[]};var _0x40fbbe=_[_0x8b06('0x2c')](db[_0x8b06('0x2d')]['rawAttributes'],function(_0x1f7771){return{'name':_0x1f7771['fieldName'],'type':_0x1f7771[_0x8b06('0x2e')][_0x8b06('0x2f')]};});_0x49cb38['model']=_[_0x8b06('0x2c')](_0x40fbbe,_0x8b06('0x29'));_0x49cb38[_0x8b06('0x30')]=_['keys'](_0x234ea9[_0x8b06('0x30')]);_0x49cb38[_0x8b06('0x31')]=_[_0x8b06('0x32')](_0x49cb38[_0x8b06('0x33')],_0x49cb38[_0x8b06('0x30')]);_0x26fbc1[_0x8b06('0x34')]=_[_0x8b06('0x32')](_0x49cb38[_0x8b06('0x33')],qs['fields'](_0x234ea9[_0x8b06('0x30')][_0x8b06('0x35')]));_0x26fbc1[_0x8b06('0x34')]=_0x26fbc1['attributes']['length']?_0x26fbc1[_0x8b06('0x34')]:_0x49cb38[_0x8b06('0x33')];if(!_0x234ea9[_0x8b06('0x30')][_0x8b06('0x36')](_0x8b06('0x37'))){_0x26fbc1[_0x8b06('0x23')]=qs[_0x8b06('0x23')](_0x234ea9[_0x8b06('0x30')][_0x8b06('0x23')]);_0x26fbc1[_0x8b06('0x20')]=qs[_0x8b06('0x20')](_0x234ea9['query']['offset']);}_0x26fbc1[_0x8b06('0x38')]=qs[_0x8b06('0x39')](_0x234ea9[_0x8b06('0x30')][_0x8b06('0x39')]);_0x26fbc1[_0x8b06('0x3a')]=qs[_0x8b06('0x31')](_[_0x8b06('0x3b')](_0x234ea9[_0x8b06('0x30')],_0x49cb38[_0x8b06('0x31')]),_0x40fbbe);if(_0x234ea9['query'][_0x8b06('0x3c')]){_0x26fbc1[_0x8b06('0x3a')]=_['merge'](_0x26fbc1[_0x8b06('0x3a')],{'$or':_[_0x8b06('0x2c')](_0x40fbbe,function(_0x36b97b){if(_0x36b97b['type']!==_0x8b06('0x3d')){var _0x4ea574={};_0x4ea574[_0x36b97b[_0x8b06('0x29')]]={'$like':'%'+_0x234ea9[_0x8b06('0x30')][_0x8b06('0x3c')]+'%'};return _0x4ea574;}})});}_0x26fbc1=_[_0x8b06('0x3e')]({},_0x26fbc1,_0x234ea9[_0x8b06('0x3f')]);var _0x58a34d={'where':_0x26fbc1[_0x8b06('0x3a')]};return db[_0x8b06('0x2d')][_0x8b06('0x22')](_0x58a34d)['then'](function(_0x4a813f){_0x2a5526[_0x8b06('0x22')]=_0x4a813f;if(_0x234ea9[_0x8b06('0x30')][_0x8b06('0x40')]){_0x26fbc1['include']=[{'all':!![]}];}return db[_0x8b06('0x2d')][_0x8b06('0x41')](_0x26fbc1);})[_0x8b06('0x28')](function(_0x2c964c){_0x2a5526[_0x8b06('0x42')]=_0x2c964c;return _0x2a5526;})[_0x8b06('0x28')](respondWithFilteredResult(_0xd2bf60,_0x26fbc1))[_0x8b06('0x43')](handleError(_0xd2bf60,null));};exports[_0x8b06('0x44')]=function(_0x599eb1,_0x42e0d2){var _0x495062={'raw':![],'where':{'id':_0x599eb1[_0x8b06('0x45')]['id']}},_0x360b91={};_0x360b91[_0x8b06('0x33')]=_[_0x8b06('0x46')](db['Team'][_0x8b06('0x47')]);_0x360b91[_0x8b06('0x30')]=_[_0x8b06('0x46')](_0x599eb1['query']);_0x360b91[_0x8b06('0x31')]=_[_0x8b06('0x32')](_0x360b91['model'],_0x360b91[_0x8b06('0x30')]);_0x495062['attributes']=_[_0x8b06('0x32')](_0x360b91[_0x8b06('0x33')],qs[_0x8b06('0x35')](_0x599eb1[_0x8b06('0x30')][_0x8b06('0x35')]));_0x495062[_0x8b06('0x34')]=_0x495062['attributes'][_0x8b06('0x48')]?_0x495062[_0x8b06('0x34')]:_0x360b91[_0x8b06('0x33')];if(_0x599eb1[_0x8b06('0x30')][_0x8b06('0x40')]){_0x495062[_0x8b06('0x49')]=[{'all':!![]}];}_0x495062=_[_0x8b06('0x3e')]({},_0x495062,_0x599eb1[_0x8b06('0x3f')]);return db[_0x8b06('0x2d')][_0x8b06('0x4a')](_0x495062)[_0x8b06('0x28')](handleEntityNotFound(_0x42e0d2,null))[_0x8b06('0x28')](respondWithResult(_0x42e0d2,null))[_0x8b06('0x43')](handleError(_0x42e0d2,null));};exports['create']=function(_0x6b8426,_0x10e80c){return db[_0x8b06('0x2d')]['create'](_0x6b8426[_0x8b06('0x4b')],{})['then'](function(_0x4e9977){var _0x3e938a=_0x6b8426[_0x8b06('0x4c')][_0x8b06('0x4d')]({'plain':!![]});if(!_0x3e938a)throw new Error(_0x8b06('0x4e'));if(_0x3e938a['role']==='user'){var _0x3b1d23=_0x4e9977[_0x8b06('0x4d')]({'plain':!![]});var _0x4db66b=_0x8b06('0x4f');return db['UserProfileSection'][_0x8b06('0x4a')]({'where':{'name':_0x4db66b,'userProfileId':_0x3e938a['userProfileId']},'raw':!![]})[_0x8b06('0x28')](function(_0x25fc05){if(_0x25fc05&&_0x25fc05[_0x8b06('0x50')]===0x0){return db[_0x8b06('0x51')][_0x8b06('0x52')]({'name':_0x3b1d23[_0x8b06('0x29')],'resourceId':_0x3b1d23['id'],'type':_0x25fc05[_0x8b06('0x29')],'sectionId':_0x25fc05['id']},{})[_0x8b06('0x28')](function(){return _0x4e9977;});}else{return _0x4e9977;}})[_0x8b06('0x43')](function(_0x228c69){logger[_0x8b06('0x53')](_0x8b06('0x54'),_0x228c69);throw _0x228c69;});}return _0x4e9977;})[_0x8b06('0x28')](respondWithResult(_0x10e80c,0xc9))['catch'](handleError(_0x10e80c,null));};exports[_0x8b06('0x55')]=function(_0x292b76,_0x28b53f){if(_0x292b76[_0x8b06('0x4b')]['id']){delete _0x292b76[_0x8b06('0x4b')]['id'];}return db['Team'][_0x8b06('0x4a')]({'where':{'id':_0x292b76[_0x8b06('0x45')]['id']}})[_0x8b06('0x28')](handleEntityNotFound(_0x28b53f,null))[_0x8b06('0x28')](saveUpdates(_0x292b76['body'],null))['then'](respondWithResult(_0x28b53f,null))[_0x8b06('0x43')](handleError(_0x28b53f,null));};exports['destroy']=function(_0x3f8f58,_0x33444c){var _0x54e6bc=_0x3f8f58['params']['id'];var _0x3467f5=[];return db[_0x8b06('0x56')][_0x8b06('0x57')](function(_0x395dd9){var _0x4332e8=_0x8b06('0x58')+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x4332e8,{'type':db['Sequelize'][_0x8b06('0x59')][_0x8b06('0x5a')],'raw':!![],'transaction':_0x395dd9})['then'](function(_0x4c0d99){_0x3467f5=_['map'](_0x4c0d99,function(_0x4baa0d){return Number(_0x4baa0d['UserId']);});})[_0x8b06('0x28')](function(){var _0x21ae9a=_0x8b06('0x5b')+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x21ae9a,{'type':db[_0x8b06('0x5c')][_0x8b06('0x59')]['SELECT'],'raw':!![],'transaction':_0x395dd9});})[_0x8b06('0x28')](function(_0x101d94){var _0x5c686a=_[_0x8b06('0x2c')](_0x101d94,function(_0x6bd1f7){return Number(_0x6bd1f7[_0x8b06('0x5d')]);});return db[_0x8b06('0x5e')][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'VoiceQueueId':{'$in':_0x5c686a}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){var _0xe3faab='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54e6bc;return db[_0x8b06('0x56')]['query'](_0xe3faab,{'type':db[_0x8b06('0x5c')][_0x8b06('0x59')][_0x8b06('0x5a')],'raw':!![],'transaction':_0x395dd9});})[_0x8b06('0x28')](function(_0x596423){var _0x50f650=_['map'](_0x596423,function(_0x5cf055){return Number(_0x5cf055[_0x8b06('0x60')]);});return db['UserMailQueue'][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'MailQueueId':{'$in':_0x50f650}},'transaction':_0x395dd9});})['then'](function(){var _0x32798e='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x32798e,{'type':db['Sequelize'][_0x8b06('0x59')]['SELECT'],'raw':!![],'transaction':_0x395dd9});})[_0x8b06('0x28')](function(_0x1f4d3b){var _0x5fba87=_[_0x8b06('0x2c')](_0x1f4d3b,function(_0x115ec0){return Number(_0x115ec0['SmsQueueId']);});return db[_0x8b06('0x61')][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'SmsQueueId':{'$in':_0x5fba87}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){var _0x4b94e6=_0x8b06('0x62')+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x4b94e6,{'type':db['Sequelize']['QueryTypes'][_0x8b06('0x5a')],'raw':!![],'transaction':_0x395dd9});})['then'](function(_0x3efbbf){var _0x2512dc=_['map'](_0x3efbbf,function(_0x200c07){return Number(_0x200c07['ChatQueueId']);});return db[_0x8b06('0x63')][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'ChatQueueId':{'$in':_0x2512dc}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){var _0x503d84=_0x8b06('0x64')+_0x54e6bc;return db['sequelize'][_0x8b06('0x30')](_0x503d84,{'type':db[_0x8b06('0x5c')][_0x8b06('0x59')][_0x8b06('0x5a')],'raw':!![],'transaction':_0x395dd9});})['then'](function(_0x4ebe64){var _0x424fa6=_[_0x8b06('0x2c')](_0x4ebe64,function(_0x2717ce){return Number(_0x2717ce[_0x8b06('0x65')]);});return db['UserFaxQueue'][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'FaxQueueId':{'$in':_0x424fa6}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){var _0x86e458=_0x8b06('0x66')+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x86e458,{'type':db[_0x8b06('0x5c')][_0x8b06('0x59')]['SELECT'],'raw':!![],'transaction':_0x395dd9});})[_0x8b06('0x28')](function(_0x2fcda5){var _0x528725=_['map'](_0x2fcda5,function(_0x39d77f){return Number(_0x39d77f[_0x8b06('0x67')]);});return db['UserOpenchannelQueue'][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'OpenchannelQueueId':{'$in':_0x528725}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){var _0x36cab7=_0x8b06('0x68')+_0x54e6bc;return db[_0x8b06('0x56')][_0x8b06('0x30')](_0x36cab7,{'type':db[_0x8b06('0x5c')][_0x8b06('0x59')][_0x8b06('0x5a')],'raw':!![],'transaction':_0x395dd9});})['then'](function(_0xc1731f){var _0x4c3257=_['map'](_0xc1731f,function(_0x510a31){return Number(_0x510a31['WhatsappQueueId']);});return db[_0x8b06('0x69')][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'WhatsappQueueId':{'$in':_0x4c3257}},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){return db['TeamVoicePrefix'][_0x8b06('0x4a')]({'where':{'TeamId':_0x54e6bc}});})[_0x8b06('0x28')](function(_0x2a69dc){if(_0x2a69dc===null){return;}return db[_0x8b06('0x6a')][_0x8b06('0x5f')]({'where':{'UserId':{'$in':_0x3467f5},'VoicePrefixId':_0x2a69dc[_0x8b06('0x6b')]},'transaction':_0x395dd9});})[_0x8b06('0x28')](function(){return db[_0x8b06('0x2d')][_0x8b06('0x5f')]({'where':{'id':_0x54e6bc},'cascade':!![],'transaction':_0x395dd9});})[_0x8b06('0x28')](function(_0x585fae){if(_0x585fae===0x0){_0x33444c['sendStatus'](0x194);}else{return db['UserProfileResource'][_0x8b06('0x5f')]({'where':{'type':_0x8b06('0x4f'),'resourceId':_0x54e6bc},'cascade':!![],'transaction':_0x395dd9})['then'](function(){_0x33444c[_0x8b06('0x1f')](0xcc)[_0x8b06('0x1e')]();});}})['catch'](function(_0xe0a755){_0x33444c['status'](0x1f4)[_0x8b06('0x2a')](_0xe0a755);});});};exports[_0x8b06('0x6c')]=function(_0x1c37cc,_0x220f12,_0xeaff13){return db['Team'][_0x8b06('0x6d')]({'where':{'id':_0x1c37cc[_0x8b06('0x45')]['id']}})[_0x8b06('0x28')](handleEntityNotFound(_0x220f12,null))[_0x8b06('0x28')](function(_0x1c65ac){if(!_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x6e')]||!utils[_0x8b06('0x6f')](_0x1c37cc['query']['channel'])){throw new db[(_0x8b06('0x5c'))][(_0x8b06('0x70'))](_0x8b06('0x71'));}var _0x5d54c1={};var _0x123db6={};_0x123db6[_0x8b06('0x33')]=_[_0x8b06('0x46')](db[_['capitalize'](_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x6e')][_0x8b06('0x72')]())+'Queue'][_0x8b06('0x47')]);_0x123db6[_0x8b06('0x30')]=_[_0x8b06('0x46')](_0x1c37cc[_0x8b06('0x30')]);_0x123db6['filters']=_[_0x8b06('0x32')](_0x123db6[_0x8b06('0x33')],_0x123db6[_0x8b06('0x30')]);_0x5d54c1[_0x8b06('0x34')]=_[_0x8b06('0x32')](_0x123db6['model'],qs['fields'](_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x35')]));_0x5d54c1[_0x8b06('0x34')]=_0x5d54c1['attributes'][_0x8b06('0x48')]?_0x5d54c1['attributes']:_0x123db6[_0x8b06('0x33')];_0x5d54c1[_0x8b06('0x23')]=qs[_0x8b06('0x23')](_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x23')]);_0x5d54c1[_0x8b06('0x20')]=qs[_0x8b06('0x20')](_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x20')]);_0x5d54c1[_0x8b06('0x38')]=qs[_0x8b06('0x39')](_0x1c37cc[_0x8b06('0x30')][_0x8b06('0x39')]);_0x5d54c1[_0x8b06('0x3a')]=qs[_0x8b06('0x31')](_['pick'](_0x1c37cc[_0x8b06('0x30')],_0x123db6['filters']));_0x5d54c1=_[_0x8b06('0x3e')]({},_0x5d54c1,_0x1c37cc[_0x8b06('0x3f')]);return _0x1c65ac['get'+_['capitalize'](_0x1c37cc[_0x8b06('0x30')]['channel']['toLowerCase']())+_0x8b06('0x73')](_0x5d54c1);})[_0x8b06('0x28')](respondWithResult(_0x220f12,null))['catch'](handleError(_0x220f12,null));};exports['addQueues']=function(_0x1908f7,_0x22e898,_0x303e58){return db['Team'][_0x8b06('0x6d')]({'where':{'id':_0x1908f7[_0x8b06('0x45')]['id']}})[_0x8b06('0x28')](function(_0x4946ca){if(_0x4946ca){if(!_0x1908f7[_0x8b06('0x4b')]['channel']||!utils[_0x8b06('0x6f')](_0x1908f7[_0x8b06('0x4b')][_0x8b06('0x6e')])){throw new db[(_0x8b06('0x5c'))][(_0x8b06('0x70'))](_0x8b06('0x71'));}return _0x4946ca[_0x8b06('0x74')+_[_0x8b06('0x75')](_0x1908f7[_0x8b06('0x4b')][_0x8b06('0x6e')][_0x8b06('0x72')]())+_0x8b06('0x73')](_0x1908f7['body'][_0x8b06('0x76')]);}return null;})['then'](handleEntityNotFound(_0x22e898,null))[_0x8b06('0x28')](respondWithStatusCode(_0x22e898,null))[_0x8b06('0x43')](handleError(_0x22e898,null));};exports[_0x8b06('0x77')]=function(_0x44f086,_0x26fc5a,_0x2b9529){return db['Team'][_0x8b06('0x6d')]({'where':{'id':_0x44f086['params']['id']}})[_0x8b06('0x28')](function(_0x183cc1){if(_0x183cc1){if(!_0x44f086['query'][_0x8b06('0x6e')]||!utils[_0x8b06('0x6f')](_0x44f086['query'][_0x8b06('0x6e')])){throw new db['Sequelize'][(_0x8b06('0x70'))]('Unknown\x20channel');}return _0x183cc1[_0x8b06('0x78')+_[_0x8b06('0x75')](_0x44f086['query'][_0x8b06('0x6e')][_0x8b06('0x72')]())+_0x8b06('0x73')](_0x44f086[_0x8b06('0x30')]['ids']);}return null;})[_0x8b06('0x28')](handleEntityNotFound(_0x26fc5a,null))[_0x8b06('0x28')](respondWithStatusCode(_0x26fc5a,null))[_0x8b06('0x43')](handleError(_0x26fc5a,null));};exports[_0x8b06('0x79')]=function(_0x2db42b,_0x3c3962){var _0x2a0589=_['isArray'](_0x2db42b[_0x8b06('0x4b')][_0x8b06('0x76')])?_0x2db42b[_0x8b06('0x4b')][_0x8b06('0x76')]:[_0x2db42b[_0x8b06('0x4b')][_0x8b06('0x76')]];var _0x38eb44=_0x2db42b[_0x8b06('0x45')]['id'];return db[_0x8b06('0x2d')]['find']({'where':{'id':_0x38eb44}})[_0x8b06('0x28')](handleEntityNotFound(_0x3c3962,null))[_0x8b06('0x28')](function(_0x689733){if(_0x689733){var _0xe1f489=[_0x8b06('0x7a'),_0x8b06('0x7b'),_0x8b06('0x7c'),_0x8b06('0x7d'),'Fax',_0x8b06('0x7e'),'Whatsapp'];return db[_0x8b06('0x56')]['transaction'](function(_0x371c05){var _0xbb3f0d=_[_0x8b06('0x2c')](_0xe1f489,function(_0x209caa){var _0xdafe9={'attributes':['id',_0x8b06('0x29')]};if(_0x209caa===_0x8b06('0x7a')){_0xdafe9[_0x8b06('0x7f')]={'attributes':['penalty']};}return _0x689733[_0x8b06('0x4d')+_0x209caa+_0x8b06('0x73')](_0xdafe9)[_0x8b06('0x28')](function(_0x24263a){var _0xa6aa6a=_[_0x8b06('0x2c')](_0x24263a,function(_0x505f2f){var _0x5f27d2=_[_0x8b06('0x2c')](_0x2a0589,function(_0x4f504c){var _0x2c1708={'where':{'UserId':_0x4f504c,[_0x209caa+_0x8b06('0x80')]:_0x505f2f['id']},'transaction':_0x371c05};if(_0x209caa===_0x8b06('0x7a')){_0x2c1708[_0x8b06('0x19')]={'penalty':_0x505f2f[_0x8b06('0x81')][_0x8b06('0x82')]};}return db['User'+_0x209caa+_0x8b06('0x83')][_0x8b06('0x84')](_0x2c1708)[_0x8b06('0x28')](function(){socket[_0x8b06('0x85')]('user'+_0x209caa+_0x8b06('0x86'),{'UserId':_0x4f504c,[_0x209caa+_0x8b06('0x80')]:_0x505f2f['id']});if(_0x209caa!==_0x8b06('0x7a')){return;}return db[_0x8b06('0x87')][_0x8b06('0x41')]({'where':{'id':_0x2a0589,'online':0x1},'attributes':['id',_0x8b06('0x29'),_0x8b06('0x88'),_0x8b06('0x89'),_0x8b06('0x8a')],'raw':!![]})[_0x8b06('0x28')](function(_0x52f7d0){var _0x2067af=_[_0x8b06('0x2c')](_0x52f7d0,function(_0x59dddd){return db['UserVoiceQueueRt'][_0x8b06('0x8b')]({'membername':_0x59dddd['name'],'UserId':_0x59dddd['id'],'queue_name':_0x505f2f[_0x8b06('0x29')],'VoiceQueueId':_0x505f2f['id'],'interface':_[_0x8b06('0x8c')](_0x59dddd['interface'])?util[_0x8b06('0x8d')](_0x8b06('0x8e'),_0x59dddd[_0x8b06('0x29')]):_0x59dddd[_0x8b06('0x8a')],'paused':_0x59dddd[_0x8b06('0x89')]||![],'penalty':_0x505f2f[_0x8b06('0x81')][_0x8b06('0x82')]},{'transaction':_0x371c05});});return Promise[_0x8b06('0x8f')](_0x2067af);});});});return Promise[_0x8b06('0x8f')](_0x5f27d2);});return Promise[_0x8b06('0x8f')](_0xa6aa6a);})[_0x8b06('0x28')](function(){return db[_0x8b06('0x90')][_0x8b06('0x6d')]({'where':{'teamId':_0x38eb44}})[_0x8b06('0x28')](function(_0x60eacf){if(_0x60eacf){var _0x55cfbd=_[_0x8b06('0x2c')](_0x2a0589,function(_0x2f3367){db[_0x8b06('0x6a')][_0x8b06('0x8b')]({'UserId':_0x2f3367,'VoicePrefixId':_0x60eacf[_0x8b06('0x6b')]});});return Promise[_0x8b06('0x8f')](_0x55cfbd);}});});});return Promise[_0x8b06('0x8f')](_0xbb3f0d)[_0x8b06('0x28')](function(){return _0x689733[_0x8b06('0x79')](_0x2a0589,{'transaction':_0x371c05})['spread'](function(_0x319e75){return _0x319e75;});});});}})['then'](respondWithResult(_0x3c3962,null))[_0x8b06('0x43')](handleError(_0x3c3962,null));};exports[_0x8b06('0x91')]=function(_0x539e9d,_0x580466){var _0x16e714=_[_0x8b06('0x92')](_0x539e9d[_0x8b06('0x30')][_0x8b06('0x76')])?_0x539e9d[_0x8b06('0x30')]['ids']:[_0x539e9d[_0x8b06('0x30')][_0x8b06('0x76')]];var _0x55d1b3=_0x539e9d[_0x8b06('0x45')]['id'];return db[_0x8b06('0x2d')][_0x8b06('0x4a')]({'where':{'id':_0x55d1b3}})['then'](handleEntityNotFound(_0x580466,null))[_0x8b06('0x28')](function(_0x1251f3){if(_0x1251f3){var _0xdb7097=[_0x8b06('0x7a'),_0x8b06('0x7b'),_0x8b06('0x7c'),_0x8b06('0x7d'),_0x8b06('0x93'),'Openchannel',_0x8b06('0x94')];return db['sequelize']['transaction'](function(_0x456ff8){var _0x43639f=_[_0x8b06('0x2c')](_0xdb7097,function(_0x4c57dd){var _0x567400={'attributes':['id',_0x8b06('0x29')]};return _0x1251f3['get'+_0x4c57dd+_0x8b06('0x73')](_0x567400)[_0x8b06('0x28')](function(_0x2bd9f8){var _0x54f0ee=_['map'](_0x2bd9f8,function(_0x227b29){return _0x227b29['removeAgents'](_0x16e714,{'transaction':_0x456ff8})[_0x8b06('0x28')](function(){var _0x466fe3=_[_0x8b06('0x2c')](_0x16e714,function(_0x444445){socket['emit'](_0x8b06('0x4c')+_0x4c57dd+_0x8b06('0x95'),{'UserId':Number(_0x444445),[_0x4c57dd+_0x8b06('0x80')]:_0x227b29['id']});if(_0x4c57dd!=='Voice'){return;}return db[_0x8b06('0x96')][_0x8b06('0x5f')]({'where':{'VoiceQueueId':_0x227b29['id'],'UserId':_0x444445},'transaction':_0x456ff8});});return Promise[_0x8b06('0x8f')](_0x466fe3);});});return Promise[_0x8b06('0x8f')](_0x54f0ee);});});return Promise[_0x8b06('0x8f')](_0x43639f)['then'](function(){return _0x1251f3[_0x8b06('0x91')](_0x16e714,{'transaction':_0x456ff8});})['then'](function(){return db[_0x8b06('0x90')][_0x8b06('0x6d')]({'where':{'teamId':_0x55d1b3}})['then'](function(_0x490166){if(_0x490166){var _0x1bef80=_[_0x8b06('0x2c')](_0x16e714,function(_0x396d65){db['UserVoicePrefix'][_0x8b06('0x5f')]({'where':{'UserId':_0x396d65,'VoicePrefixId':_0x490166[_0x8b06('0x6b')]}});});return Promise[_0x8b06('0x8f')](_0x1bef80);}});});});}})['then'](respondWithStatusCode(_0x580466,null))[_0x8b06('0x43')](handleError(_0x580466,null));};exports[_0x8b06('0x97')]=function(_0x125a48,_0x5a67f2,_0x19fb1f){var _0xb09da4={};var _0x35990f={};var _0x32746f;var _0x188898;return db['Team']['findOne']({'where':{'id':_0x125a48[_0x8b06('0x45')]['id']}})[_0x8b06('0x28')](handleEntityNotFound(_0x5a67f2,null))['then'](function(_0x329761){if(_0x329761){_0x32746f=_0x329761;_0x35990f[_0x8b06('0x33')]=_[_0x8b06('0x46')](db[_0x8b06('0x87')][_0x8b06('0x47')]);_0x35990f[_0x8b06('0x30')]=_[_0x8b06('0x46')](_0x125a48['query']);_0x35990f[_0x8b06('0x31')]=_['intersection'](_0x35990f['model'],_0x35990f[_0x8b06('0x30')]);_0xb09da4[_0x8b06('0x34')]=_[_0x8b06('0x32')](_0x35990f[_0x8b06('0x33')],qs[_0x8b06('0x35')](_0x125a48['query'][_0x8b06('0x35')]));_0xb09da4[_0x8b06('0x34')]=_0xb09da4[_0x8b06('0x34')]['length']?_0xb09da4[_0x8b06('0x34')]:_0x35990f[_0x8b06('0x33')];_0xb09da4[_0x8b06('0x38')]=qs[_0x8b06('0x39')](_0x125a48['query'][_0x8b06('0x39')]);_0xb09da4[_0x8b06('0x3a')]=qs[_0x8b06('0x31')](_[_0x8b06('0x3b')](_0x125a48[_0x8b06('0x30')],_0x35990f[_0x8b06('0x31')]));if(_0x125a48[_0x8b06('0x30')][_0x8b06('0x3c')]){_0xb09da4[_0x8b06('0x3a')]=_[_0x8b06('0x3e')](_0xb09da4['where'],{'$or':_['map'](_0xb09da4[_0x8b06('0x34')],function(_0x5f21fb){var _0x1aacb5={};_0x1aacb5[_0x5f21fb]={'$like':'%'+_0x125a48[_0x8b06('0x30')][_0x8b06('0x3c')]+'%'};return _0x1aacb5;})});}_0xb09da4=_['merge']({},_0xb09da4,_0x125a48['options']);return _0x32746f['getAgents'](_0xb09da4);}})['then'](function(_0x5c3e00){if(_0x5c3e00){_0x188898=_0x5c3e00[_0x8b06('0x48')];if(!_0x125a48[_0x8b06('0x30')][_0x8b06('0x36')](_0x8b06('0x37'))){_0xb09da4[_0x8b06('0x23')]=qs[_0x8b06('0x23')](_0x125a48[_0x8b06('0x30')][_0x8b06('0x23')]);_0xb09da4['offset']=qs[_0x8b06('0x20')](_0x125a48[_0x8b06('0x30')][_0x8b06('0x20')]);}return _0x32746f[_0x8b06('0x97')](_0xb09da4);}})[_0x8b06('0x28')](function(_0x30f94a){if(_0x30f94a){return _0x30f94a?{'count':_0x188898,'rows':_0x30f94a}:null;}})[_0x8b06('0x28')](respondWithResult(_0x5a67f2,null))[_0x8b06('0x43')](handleError(_0x5a67f2,null));}; \ No newline at end of file +var _0xdcd8=['limit','count','offset','set','json','apply','reject','save','error','stack','name','send','map','Team','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','destroy','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isValidChannel','channel','Unknown\x20channel','toLowerCase','capitalize','addQueues','ValidationError','add','Queues','removeQueues','findOne','ids','isArray','Voice','Chat','Mail','Sms','Fax','Whatsapp','transaction','penalty','QueueId','TeamVoiceQueue','Queue:save','User','findAll','interface','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','all','addAgents','removeAgents','Openchannel','emit','Queue:remove','hasOwnProperty','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','end','status','undefined'];(function(_0x27c3b8,_0x49fd2e){var _0x56da31=function(_0x317fbc){while(--_0x317fbc){_0x27c3b8['push'](_0x27c3b8['shift']());}};_0x56da31(++_0x49fd2e);}(_0xdcd8,0x1a8));var _0x8dcd=function(_0x1c1509,_0x2dfa81){_0x1c1509=_0x1c1509-0x0;var _0xf11b7=_0xdcd8[_0x1c1509];return _0xf11b7;};'use strict';var emlformat=require(_0x8dcd('0x0'));var rimraf=require(_0x8dcd('0x1'));var zipdir=require(_0x8dcd('0x2'));var jsonpatch=require(_0x8dcd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8dcd('0x4'));var sox=require(_0x8dcd('0x5'));var csv=require(_0x8dcd('0x6'));var ejs=require(_0x8dcd('0x7'));var fs=require('fs');var fs_extra=require(_0x8dcd('0x8'));var _=require(_0x8dcd('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8dcd('0xa'));var deskjs=require(_0x8dcd('0xb'));var toCsv=require(_0x8dcd('0x6'));var querystring=require(_0x8dcd('0xc'));var Papa=require(_0x8dcd('0xd'));var Redis=require(_0x8dcd('0xe'));var authService=require(_0x8dcd('0xf'));var qs=require(_0x8dcd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8dcd('0x11'));var logger=require(_0x8dcd('0x12'))(_0x8dcd('0x13'));var utils=require(_0x8dcd('0x14'));var config=require(_0x8dcd('0x15'));var licenseUtil=require(_0x8dcd('0x16'));var db=require(_0x8dcd('0x17'))['db'];config['redis']=_[_0x8dcd('0x18')](config[_0x8dcd('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dcd('0x1a'))(new Redis(config[_0x8dcd('0x19')]));require('./team.socket')[_0x8dcd('0x1b')](socket);function respondWithStatusCode(_0x101eb8,_0x891dcb){_0x891dcb=_0x891dcb||0xcc;return function(_0x460beb){if(_0x460beb){return _0x101eb8[_0x8dcd('0x1c')](_0x891dcb);}return _0x101eb8['status'](_0x891dcb)[_0x8dcd('0x1d')]();};}function respondWithResult(_0x3408a8,_0x88bfdd){_0x88bfdd=_0x88bfdd||0xc8;return function(_0x355aa2){if(_0x355aa2){return _0x3408a8[_0x8dcd('0x1e')](_0x88bfdd)['json'](_0x355aa2);}};}function respondWithFilteredResult(_0x2591c4,_0x4caa93){return function(_0x1ce355){if(_0x1ce355){var _0x445bcb=typeof _0x4caa93['offset']===_0x8dcd('0x1f')&&typeof _0x4caa93[_0x8dcd('0x20')]===_0x8dcd('0x1f');var _0x2002ae=_0x1ce355[_0x8dcd('0x21')];var _0x1340b1=_0x445bcb?0x0:_0x4caa93[_0x8dcd('0x22')];var _0x40467e=_0x445bcb?_0x1ce355[_0x8dcd('0x21')]:_0x4caa93[_0x8dcd('0x22')]+_0x4caa93['limit'];var _0x37f7d9;if(_0x40467e>=_0x2002ae){_0x40467e=_0x2002ae;_0x37f7d9=0xc8;}else{_0x37f7d9=0xce;}_0x2591c4['status'](_0x37f7d9);return _0x2591c4[_0x8dcd('0x23')]('Content-Range',_0x1340b1+'-'+_0x40467e+'/'+_0x2002ae)[_0x8dcd('0x24')](_0x1ce355);}return null;};}function patchUpdates(_0x248411){return function(_0x18dfe4){try{jsonpatch[_0x8dcd('0x25')](_0x18dfe4,_0x248411,!![]);}catch(_0x3a79c8){return BPromise[_0x8dcd('0x26')](_0x3a79c8);}return _0x18dfe4[_0x8dcd('0x27')]();};}function saveUpdates(_0x146862,_0x17bcd8){return function(_0x26e929){if(_0x26e929){return _0x26e929['update'](_0x146862)['then'](function(_0x5bd240){return _0x5bd240;});}return null;};}function handleEntityNotFound(_0x970c76,_0x5a57ba){return function(_0x11cc66){if(!_0x11cc66){_0x970c76[_0x8dcd('0x1c')](0x194);}return _0x11cc66;};}function handleError(_0x3c022e,_0x4d88e2){_0x4d88e2=_0x4d88e2||0x1f4;return function(_0x170619){logger[_0x8dcd('0x28')](_0x170619[_0x8dcd('0x29')]);if(_0x170619[_0x8dcd('0x2a')]){delete _0x170619['name'];}_0x3c022e[_0x8dcd('0x1e')](_0x4d88e2)[_0x8dcd('0x2b')](_0x170619);};}exports['index']=function(_0x2aec55,_0x592dcd){var _0x2db10b={},_0x31bd27={},_0x287ea5={'count':0x0,'rows':[]};var _0x256774=_[_0x8dcd('0x2c')](db[_0x8dcd('0x2d')]['rawAttributes'],function(_0x21c052){return{'name':_0x21c052[_0x8dcd('0x2e')],'type':_0x21c052['type'][_0x8dcd('0x2f')]};});_0x31bd27[_0x8dcd('0x30')]=_['map'](_0x256774,'name');_0x31bd27['query']=_[_0x8dcd('0x31')](_0x2aec55[_0x8dcd('0x32')]);_0x31bd27['filters']=_[_0x8dcd('0x33')](_0x31bd27[_0x8dcd('0x30')],_0x31bd27[_0x8dcd('0x32')]);_0x2db10b[_0x8dcd('0x34')]=_[_0x8dcd('0x33')](_0x31bd27[_0x8dcd('0x30')],qs['fields'](_0x2aec55['query'][_0x8dcd('0x35')]));_0x2db10b[_0x8dcd('0x34')]=_0x2db10b[_0x8dcd('0x34')]['length']?_0x2db10b['attributes']:_0x31bd27[_0x8dcd('0x30')];if(!_0x2aec55['query']['hasOwnProperty'](_0x8dcd('0x36'))){_0x2db10b[_0x8dcd('0x20')]=qs[_0x8dcd('0x20')](_0x2aec55[_0x8dcd('0x32')][_0x8dcd('0x20')]);_0x2db10b[_0x8dcd('0x22')]=qs[_0x8dcd('0x22')](_0x2aec55[_0x8dcd('0x32')]['offset']);}_0x2db10b[_0x8dcd('0x37')]=qs['sort'](_0x2aec55[_0x8dcd('0x32')][_0x8dcd('0x38')]);_0x2db10b[_0x8dcd('0x39')]=qs[_0x8dcd('0x3a')](_[_0x8dcd('0x3b')](_0x2aec55[_0x8dcd('0x32')],_0x31bd27[_0x8dcd('0x3a')]),_0x256774);if(_0x2aec55[_0x8dcd('0x32')][_0x8dcd('0x3c')]){_0x2db10b[_0x8dcd('0x39')]=_[_0x8dcd('0x3d')](_0x2db10b['where'],{'$or':_[_0x8dcd('0x2c')](_0x256774,function(_0x337cf0){if(_0x337cf0['type']!==_0x8dcd('0x3e')){var _0x4c63e4={};_0x4c63e4[_0x337cf0[_0x8dcd('0x2a')]]={'$like':'%'+_0x2aec55[_0x8dcd('0x32')]['filter']+'%'};return _0x4c63e4;}})});}_0x2db10b=_[_0x8dcd('0x3d')]({},_0x2db10b,_0x2aec55[_0x8dcd('0x3f')]);var _0x5efcd0={'where':_0x2db10b['where']};return db[_0x8dcd('0x2d')]['count'](_0x5efcd0)[_0x8dcd('0x40')](function(_0x485777){_0x287ea5[_0x8dcd('0x21')]=_0x485777;if(_0x2aec55[_0x8dcd('0x32')][_0x8dcd('0x41')]){_0x2db10b[_0x8dcd('0x42')]=[{'all':!![]}];}return db[_0x8dcd('0x2d')]['findAll'](_0x2db10b);})['then'](function(_0x2c9b06){_0x287ea5[_0x8dcd('0x43')]=_0x2c9b06;return _0x287ea5;})['then'](respondWithFilteredResult(_0x592dcd,_0x2db10b))[_0x8dcd('0x44')](handleError(_0x592dcd,null));};exports[_0x8dcd('0x45')]=function(_0x3755b4,_0x48fa75){var _0x7b4e04={'raw':![],'where':{'id':_0x3755b4[_0x8dcd('0x46')]['id']}},_0x20b480={};_0x20b480[_0x8dcd('0x30')]=_[_0x8dcd('0x31')](db['Team'][_0x8dcd('0x47')]);_0x20b480[_0x8dcd('0x32')]=_[_0x8dcd('0x31')](_0x3755b4[_0x8dcd('0x32')]);_0x20b480[_0x8dcd('0x3a')]=_['intersection'](_0x20b480[_0x8dcd('0x30')],_0x20b480[_0x8dcd('0x32')]);_0x7b4e04[_0x8dcd('0x34')]=_[_0x8dcd('0x33')](_0x20b480[_0x8dcd('0x30')],qs[_0x8dcd('0x35')](_0x3755b4[_0x8dcd('0x32')][_0x8dcd('0x35')]));_0x7b4e04['attributes']=_0x7b4e04[_0x8dcd('0x34')][_0x8dcd('0x48')]?_0x7b4e04[_0x8dcd('0x34')]:_0x20b480['model'];if(_0x3755b4[_0x8dcd('0x32')]['includeAll']){_0x7b4e04[_0x8dcd('0x42')]=[{'all':!![]}];}_0x7b4e04=_[_0x8dcd('0x3d')]({},_0x7b4e04,_0x3755b4[_0x8dcd('0x3f')]);return db['Team']['find'](_0x7b4e04)[_0x8dcd('0x40')](handleEntityNotFound(_0x48fa75,null))[_0x8dcd('0x40')](respondWithResult(_0x48fa75,null))[_0x8dcd('0x44')](handleError(_0x48fa75,null));};exports[_0x8dcd('0x49')]=function(_0x4e6cd4,_0x525d6f){return db[_0x8dcd('0x2d')][_0x8dcd('0x49')](_0x4e6cd4[_0x8dcd('0x4a')],{})['then'](function(_0x8e7dd7){var _0x34d507=_0x4e6cd4[_0x8dcd('0x4b')][_0x8dcd('0x4c')]({'plain':!![]});if(!_0x34d507)throw new Error(_0x8dcd('0x4d'));if(_0x34d507['role']===_0x8dcd('0x4b')){var _0x1de1b1=_0x8e7dd7[_0x8dcd('0x4c')]({'plain':!![]});var _0x499592=_0x8dcd('0x4e');return db[_0x8dcd('0x4f')][_0x8dcd('0x50')]({'where':{'name':_0x499592,'userProfileId':_0x34d507[_0x8dcd('0x51')]},'raw':!![]})[_0x8dcd('0x40')](function(_0x18ba9b){if(_0x18ba9b&&_0x18ba9b[_0x8dcd('0x52')]===0x0){return db[_0x8dcd('0x53')][_0x8dcd('0x49')]({'name':_0x1de1b1['name'],'resourceId':_0x1de1b1['id'],'type':_0x18ba9b[_0x8dcd('0x2a')],'sectionId':_0x18ba9b['id']},{})['then'](function(){return _0x8e7dd7;});}else{return _0x8e7dd7;}})[_0x8dcd('0x44')](function(_0x373d41){logger[_0x8dcd('0x28')](_0x8dcd('0x54'),_0x373d41);throw _0x373d41;});}return _0x8e7dd7;})['then'](respondWithResult(_0x525d6f,0xc9))['catch'](handleError(_0x525d6f,null));};exports[_0x8dcd('0x55')]=function(_0x53c2f2,_0x33fc3a){if(_0x53c2f2[_0x8dcd('0x4a')]['id']){delete _0x53c2f2['body']['id'];}return db['Team'][_0x8dcd('0x50')]({'where':{'id':_0x53c2f2[_0x8dcd('0x46')]['id']}})['then'](handleEntityNotFound(_0x33fc3a,null))[_0x8dcd('0x40')](saveUpdates(_0x53c2f2[_0x8dcd('0x4a')],null))['then'](respondWithResult(_0x33fc3a,null))[_0x8dcd('0x44')](handleError(_0x33fc3a,null));};exports['destroy']=function(_0x5d4c15,_0x223496){var _0x506226=_0x5d4c15[_0x8dcd('0x46')]['id'];var _0x37c6a6=[];return db['sequelize']['transaction'](function(_0x4d3f1e){var _0x20e48e=_0x8dcd('0x56')+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x20e48e,{'type':db[_0x8dcd('0x58')][_0x8dcd('0x59')]['SELECT'],'raw':!![],'transaction':_0x4d3f1e})[_0x8dcd('0x40')](function(_0x5e88b5){_0x37c6a6=_['map'](_0x5e88b5,function(_0x2bc1c1){return Number(_0x2bc1c1['UserId']);});})[_0x8dcd('0x40')](function(){var _0x5d6349='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x5d6349,{'type':db['Sequelize'][_0x8dcd('0x59')][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x14687d){var _0x44268e=_['map'](_0x14687d,function(_0x1fc574){return Number(_0x1fc574[_0x8dcd('0x5b')]);});return db[_0x8dcd('0x5c')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'VoiceQueueId':{'$in':_0x44268e}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){var _0x5ec3d3='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x5ec3d3,{'type':db[_0x8dcd('0x58')]['QueryTypes'][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x721799){var _0x165f1f=_['map'](_0x721799,function(_0x50b730){return Number(_0x50b730[_0x8dcd('0x5e')]);});return db[_0x8dcd('0x5f')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'MailQueueId':{'$in':_0x165f1f}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){var _0x4abeec=_0x8dcd('0x60')+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x4abeec,{'type':db['Sequelize'][_0x8dcd('0x59')][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0xbf595){var _0x3924e4=_[_0x8dcd('0x2c')](_0xbf595,function(_0x5cad78){return Number(_0x5cad78[_0x8dcd('0x61')]);});return db[_0x8dcd('0x62')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'SmsQueueId':{'$in':_0x3924e4}},'transaction':_0x4d3f1e});})['then'](function(){var _0x5bd12a=_0x8dcd('0x63')+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x5bd12a,{'type':db['Sequelize'][_0x8dcd('0x59')][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0xe06975){var _0x224814=_['map'](_0xe06975,function(_0x35fb76){return Number(_0x35fb76['ChatQueueId']);});return db[_0x8dcd('0x64')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'ChatQueueId':{'$in':_0x224814}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){var _0x3565ce=_0x8dcd('0x65')+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0x3565ce,{'type':db['Sequelize']['QueryTypes'][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x28f3ae){var _0x32414d=_[_0x8dcd('0x2c')](_0x28f3ae,function(_0x1bd77f){return Number(_0x1bd77f[_0x8dcd('0x66')]);});return db[_0x8dcd('0x67')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'FaxQueueId':{'$in':_0x32414d}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){var _0x38372a=_0x8dcd('0x68')+_0x506226;return db['sequelize']['query'](_0x38372a,{'type':db['Sequelize']['QueryTypes'][_0x8dcd('0x5a')],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x4ad6ca){var _0x56ec96=_[_0x8dcd('0x2c')](_0x4ad6ca,function(_0x2a0d34){return Number(_0x2a0d34[_0x8dcd('0x69')]);});return db[_0x8dcd('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x37c6a6},'OpenchannelQueueId':{'$in':_0x56ec96}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){var _0xa3f418=_0x8dcd('0x6b')+_0x506226;return db[_0x8dcd('0x57')][_0x8dcd('0x32')](_0xa3f418,{'type':db['Sequelize'][_0x8dcd('0x59')]['SELECT'],'raw':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x3131c2){var _0x38cdee=_[_0x8dcd('0x2c')](_0x3131c2,function(_0x596065){return Number(_0x596065['WhatsappQueueId']);});return db[_0x8dcd('0x6c')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'WhatsappQueueId':{'$in':_0x38cdee}},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){return db[_0x8dcd('0x6d')]['find']({'where':{'TeamId':_0x506226}});})[_0x8dcd('0x40')](function(_0x4a5a14){if(_0x4a5a14===null){return;}return db[_0x8dcd('0x6e')][_0x8dcd('0x5d')]({'where':{'UserId':{'$in':_0x37c6a6},'VoicePrefixId':_0x4a5a14[_0x8dcd('0x6f')]},'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(){return db['Team'][_0x8dcd('0x5d')]({'where':{'id':_0x506226},'cascade':!![],'transaction':_0x4d3f1e});})[_0x8dcd('0x40')](function(_0x1075e1){if(_0x1075e1===0x0){_0x223496[_0x8dcd('0x1c')](0x194);}else{return db[_0x8dcd('0x53')]['destroy']({'where':{'type':'Teams','resourceId':_0x506226},'cascade':!![],'transaction':_0x4d3f1e})[_0x8dcd('0x40')](function(){_0x223496[_0x8dcd('0x1e')](0xcc)['end']();});}})[_0x8dcd('0x44')](function(_0x583460){_0x223496['status'](0x1f4)[_0x8dcd('0x2b')](_0x583460);});});};exports['getQueues']=function(_0x1d3778,_0x5ebd7d,_0x5d65e1){return db[_0x8dcd('0x2d')]['findOne']({'where':{'id':_0x1d3778['params']['id']}})[_0x8dcd('0x40')](handleEntityNotFound(_0x5ebd7d,null))['then'](function(_0xac06d3){if(!_0x1d3778['query']['channel']||!utils[_0x8dcd('0x70')](_0x1d3778[_0x8dcd('0x32')][_0x8dcd('0x71')])){throw new db['Sequelize']['ValidationError'](_0x8dcd('0x72'));}var _0x537651={};var _0x25eb3b={};_0x25eb3b[_0x8dcd('0x30')]=_[_0x8dcd('0x31')](db[_['capitalize'](_0x1d3778[_0x8dcd('0x32')]['channel'][_0x8dcd('0x73')]())+'Queue'][_0x8dcd('0x47')]);_0x25eb3b[_0x8dcd('0x32')]=_['keys'](_0x1d3778[_0x8dcd('0x32')]);_0x25eb3b[_0x8dcd('0x3a')]=_[_0x8dcd('0x33')](_0x25eb3b[_0x8dcd('0x30')],_0x25eb3b[_0x8dcd('0x32')]);_0x537651[_0x8dcd('0x34')]=_[_0x8dcd('0x33')](_0x25eb3b['model'],qs[_0x8dcd('0x35')](_0x1d3778[_0x8dcd('0x32')][_0x8dcd('0x35')]));_0x537651[_0x8dcd('0x34')]=_0x537651['attributes'][_0x8dcd('0x48')]?_0x537651['attributes']:_0x25eb3b[_0x8dcd('0x30')];_0x537651[_0x8dcd('0x20')]=qs[_0x8dcd('0x20')](_0x1d3778[_0x8dcd('0x32')][_0x8dcd('0x20')]);_0x537651[_0x8dcd('0x22')]=qs[_0x8dcd('0x22')](_0x1d3778[_0x8dcd('0x32')][_0x8dcd('0x22')]);_0x537651['order']=qs[_0x8dcd('0x38')](_0x1d3778[_0x8dcd('0x32')][_0x8dcd('0x38')]);_0x537651['where']=qs[_0x8dcd('0x3a')](_[_0x8dcd('0x3b')](_0x1d3778['query'],_0x25eb3b[_0x8dcd('0x3a')]));_0x537651=_[_0x8dcd('0x3d')]({},_0x537651,_0x1d3778[_0x8dcd('0x3f')]);return _0xac06d3[_0x8dcd('0x4c')+_[_0x8dcd('0x74')](_0x1d3778['query'][_0x8dcd('0x71')]['toLowerCase']())+'Queues'](_0x537651);})[_0x8dcd('0x40')](respondWithResult(_0x5ebd7d,null))[_0x8dcd('0x44')](handleError(_0x5ebd7d,null));};exports[_0x8dcd('0x75')]=function(_0x572bf5,_0x57a3db,_0x5438f1){return db[_0x8dcd('0x2d')]['findOne']({'where':{'id':_0x572bf5['params']['id']}})[_0x8dcd('0x40')](function(_0x5459b3){if(_0x5459b3){if(!_0x572bf5['body'][_0x8dcd('0x71')]||!utils['isValidChannel'](_0x572bf5['body']['channel'])){throw new db[(_0x8dcd('0x58'))][(_0x8dcd('0x76'))](_0x8dcd('0x72'));}return _0x5459b3[_0x8dcd('0x77')+_[_0x8dcd('0x74')](_0x572bf5[_0x8dcd('0x4a')][_0x8dcd('0x71')][_0x8dcd('0x73')]())+_0x8dcd('0x78')](_0x572bf5[_0x8dcd('0x4a')]['ids']);}return null;})[_0x8dcd('0x40')](handleEntityNotFound(_0x57a3db,null))['then'](respondWithStatusCode(_0x57a3db,null))[_0x8dcd('0x44')](handleError(_0x57a3db,null));};exports[_0x8dcd('0x79')]=function(_0x40a530,_0x122484,_0x5b295b){return db[_0x8dcd('0x2d')][_0x8dcd('0x7a')]({'where':{'id':_0x40a530[_0x8dcd('0x46')]['id']}})[_0x8dcd('0x40')](function(_0x22145e){if(_0x22145e){if(!_0x40a530[_0x8dcd('0x32')][_0x8dcd('0x71')]||!utils['isValidChannel'](_0x40a530[_0x8dcd('0x32')][_0x8dcd('0x71')])){throw new db[(_0x8dcd('0x58'))][(_0x8dcd('0x76'))](_0x8dcd('0x72'));}return _0x22145e['remove'+_[_0x8dcd('0x74')](_0x40a530['query']['channel']['toLowerCase']())+_0x8dcd('0x78')](_0x40a530['query'][_0x8dcd('0x7b')]);}return null;})[_0x8dcd('0x40')](handleEntityNotFound(_0x122484,null))['then'](respondWithStatusCode(_0x122484,null))['catch'](handleError(_0x122484,null));};exports['addAgents']=function(_0x4c2c7f,_0x2f3bed){var _0x3b6b35=_[_0x8dcd('0x7c')](_0x4c2c7f[_0x8dcd('0x4a')][_0x8dcd('0x7b')])?_0x4c2c7f[_0x8dcd('0x4a')][_0x8dcd('0x7b')]:[_0x4c2c7f[_0x8dcd('0x4a')][_0x8dcd('0x7b')]];var _0x2daf3e=_0x4c2c7f[_0x8dcd('0x46')]['id'];return db[_0x8dcd('0x2d')][_0x8dcd('0x50')]({'where':{'id':_0x2daf3e}})[_0x8dcd('0x40')](handleEntityNotFound(_0x2f3bed,null))['then'](function(_0x4f2d35){if(_0x4f2d35){var _0x578788=[_0x8dcd('0x7d'),_0x8dcd('0x7e'),_0x8dcd('0x7f'),_0x8dcd('0x80'),_0x8dcd('0x81'),'Openchannel',_0x8dcd('0x82')];return db['sequelize'][_0x8dcd('0x83')](function(_0x18fd16){var _0x41b8a3=_[_0x8dcd('0x2c')](_0x578788,function(_0x6b3615){var _0x3c34ef={'attributes':['id',_0x8dcd('0x2a')]};if(_0x6b3615===_0x8dcd('0x7d')){_0x3c34ef['through']={'attributes':[_0x8dcd('0x84')]};}return _0x4f2d35[_0x8dcd('0x4c')+_0x6b3615+'Queues'](_0x3c34ef)[_0x8dcd('0x40')](function(_0xb64f43){var _0x34ec37=_[_0x8dcd('0x2c')](_0xb64f43,function(_0x31226b){var _0x137830=_[_0x8dcd('0x2c')](_0x3b6b35,function(_0x5d4529){var _0xe1d63e={'where':{'UserId':_0x5d4529,[_0x6b3615+_0x8dcd('0x85')]:_0x31226b['id']},'transaction':_0x18fd16};if(_0x6b3615==='Voice'){_0xe1d63e[_0x8dcd('0x18')]={'penalty':_0x31226b[_0x8dcd('0x86')][_0x8dcd('0x84')]};}return db['User'+_0x6b3615+'Queue']['findOrCreate'](_0xe1d63e)[_0x8dcd('0x40')](function(){socket['emit'](_0x8dcd('0x4b')+_0x6b3615+_0x8dcd('0x87'),{'UserId':_0x5d4529,[_0x6b3615+_0x8dcd('0x85')]:_0x31226b['id']});if(_0x6b3615!==_0x8dcd('0x7d')){return;}return db[_0x8dcd('0x88')][_0x8dcd('0x89')]({'where':{'id':_0x3b6b35,'online':0x1},'attributes':['id','name','online','voicePause',_0x8dcd('0x8a')],'raw':!![]})['then'](function(_0x108da6){var _0x1056a1=_['map'](_0x108da6,function(_0x275fd9){return db[_0x8dcd('0x8b')]['upsert']({'membername':_0x275fd9[_0x8dcd('0x2a')],'UserId':_0x275fd9['id'],'queue_name':_0x31226b[_0x8dcd('0x2a')],'VoiceQueueId':_0x31226b['id'],'interface':_[_0x8dcd('0x8c')](_0x275fd9['interface'])?util[_0x8dcd('0x8d')](_0x8dcd('0x8e'),_0x275fd9[_0x8dcd('0x2a')]):_0x275fd9['interface'],'paused':_0x275fd9[_0x8dcd('0x8f')]||![],'penalty':_0x31226b['TeamVoiceQueue'][_0x8dcd('0x84')]},{'transaction':_0x18fd16});});return Promise[_0x8dcd('0x90')](_0x1056a1);});});});return Promise[_0x8dcd('0x90')](_0x137830);});return Promise[_0x8dcd('0x90')](_0x34ec37);})['then'](function(){return db['TeamVoicePrefix'][_0x8dcd('0x7a')]({'where':{'teamId':_0x2daf3e}})['then'](function(_0x4a19fd){if(_0x4a19fd){var _0x16be8e=_[_0x8dcd('0x2c')](_0x3b6b35,function(_0x2e9171){db[_0x8dcd('0x6e')]['upsert']({'UserId':_0x2e9171,'VoicePrefixId':_0x4a19fd[_0x8dcd('0x6f')]});});return Promise[_0x8dcd('0x90')](_0x16be8e);}});});});return Promise[_0x8dcd('0x90')](_0x41b8a3)['then'](function(){return _0x4f2d35[_0x8dcd('0x91')](_0x3b6b35,{'transaction':_0x18fd16})['spread'](function(_0x5539f9){return _0x5539f9;});});});}})['then'](respondWithResult(_0x2f3bed,null))[_0x8dcd('0x44')](handleError(_0x2f3bed,null));};exports[_0x8dcd('0x92')]=function(_0x24b4c1,_0x4fffc9){var _0x5cc0c1=_['isArray'](_0x24b4c1[_0x8dcd('0x32')][_0x8dcd('0x7b')])?_0x24b4c1[_0x8dcd('0x32')][_0x8dcd('0x7b')]:[_0x24b4c1['query'][_0x8dcd('0x7b')]];var _0x2d2fb8=_0x24b4c1[_0x8dcd('0x46')]['id'];return db['Team'][_0x8dcd('0x50')]({'where':{'id':_0x2d2fb8}})[_0x8dcd('0x40')](handleEntityNotFound(_0x4fffc9,null))[_0x8dcd('0x40')](function(_0x1bedfc){if(_0x1bedfc){var _0x52b269=['Voice',_0x8dcd('0x7e'),_0x8dcd('0x7f'),_0x8dcd('0x80'),_0x8dcd('0x81'),_0x8dcd('0x93'),_0x8dcd('0x82')];return db['sequelize']['transaction'](function(_0x373347){var _0x114f08=_['map'](_0x52b269,function(_0xcda6){var _0x4fc416={'attributes':['id','name']};return _0x1bedfc[_0x8dcd('0x4c')+_0xcda6+_0x8dcd('0x78')](_0x4fc416)[_0x8dcd('0x40')](function(_0x4b8c6b){var _0xfbd169=_['map'](_0x4b8c6b,function(_0xc6ae6f){return _0xc6ae6f[_0x8dcd('0x92')](_0x5cc0c1,{'transaction':_0x373347})['then'](function(){var _0x1921c2=_[_0x8dcd('0x2c')](_0x5cc0c1,function(_0x15af44){socket[_0x8dcd('0x94')]('user'+_0xcda6+_0x8dcd('0x95'),{'UserId':Number(_0x15af44),[_0xcda6+'QueueId']:_0xc6ae6f['id']});if(_0xcda6!==_0x8dcd('0x7d')){return;}return db[_0x8dcd('0x8b')]['destroy']({'where':{'VoiceQueueId':_0xc6ae6f['id'],'UserId':_0x15af44},'transaction':_0x373347});});return Promise[_0x8dcd('0x90')](_0x1921c2);});});return Promise[_0x8dcd('0x90')](_0xfbd169);});});return Promise['all'](_0x114f08)['then'](function(){return _0x1bedfc[_0x8dcd('0x92')](_0x5cc0c1,{'transaction':_0x373347});})[_0x8dcd('0x40')](function(){return db[_0x8dcd('0x6d')][_0x8dcd('0x7a')]({'where':{'teamId':_0x2d2fb8}})['then'](function(_0x535760){if(_0x535760){var _0x121a45=_[_0x8dcd('0x2c')](_0x5cc0c1,function(_0x5dff19){db['UserVoicePrefix'][_0x8dcd('0x5d')]({'where':{'UserId':_0x5dff19,'VoicePrefixId':_0x535760['VoicePrefixId']}});});return Promise[_0x8dcd('0x90')](_0x121a45);}});});});}})[_0x8dcd('0x40')](respondWithStatusCode(_0x4fffc9,null))[_0x8dcd('0x44')](handleError(_0x4fffc9,null));};exports['getAgents']=function(_0x1b6d65,_0x46956f,_0x421439){var _0x31c8fe={};var _0x3aa1f5={};var _0x42223d;var _0x40a6bc;return db['Team'][_0x8dcd('0x7a')]({'where':{'id':_0x1b6d65[_0x8dcd('0x46')]['id']}})[_0x8dcd('0x40')](handleEntityNotFound(_0x46956f,null))[_0x8dcd('0x40')](function(_0x1da569){if(_0x1da569){_0x42223d=_0x1da569;_0x3aa1f5[_0x8dcd('0x30')]=_[_0x8dcd('0x31')](db[_0x8dcd('0x88')][_0x8dcd('0x47')]);_0x3aa1f5[_0x8dcd('0x32')]=_[_0x8dcd('0x31')](_0x1b6d65[_0x8dcd('0x32')]);_0x3aa1f5[_0x8dcd('0x3a')]=_[_0x8dcd('0x33')](_0x3aa1f5[_0x8dcd('0x30')],_0x3aa1f5[_0x8dcd('0x32')]);_0x31c8fe[_0x8dcd('0x34')]=_[_0x8dcd('0x33')](_0x3aa1f5[_0x8dcd('0x30')],qs['fields'](_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x35')]));_0x31c8fe[_0x8dcd('0x34')]=_0x31c8fe[_0x8dcd('0x34')][_0x8dcd('0x48')]?_0x31c8fe['attributes']:_0x3aa1f5[_0x8dcd('0x30')];_0x31c8fe[_0x8dcd('0x37')]=qs[_0x8dcd('0x38')](_0x1b6d65[_0x8dcd('0x32')]['sort']);_0x31c8fe[_0x8dcd('0x39')]=qs[_0x8dcd('0x3a')](_[_0x8dcd('0x3b')](_0x1b6d65[_0x8dcd('0x32')],_0x3aa1f5[_0x8dcd('0x3a')]));if(_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x3c')]){_0x31c8fe[_0x8dcd('0x39')]=_[_0x8dcd('0x3d')](_0x31c8fe['where'],{'$or':_[_0x8dcd('0x2c')](_0x31c8fe[_0x8dcd('0x34')],function(_0x3fd774){var _0xf17390={};_0xf17390[_0x3fd774]={'$like':'%'+_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x3c')]+'%'};return _0xf17390;})});}_0x31c8fe=_[_0x8dcd('0x3d')]({},_0x31c8fe,_0x1b6d65[_0x8dcd('0x3f')]);return _0x42223d['getAgents'](_0x31c8fe);}})[_0x8dcd('0x40')](function(_0x2a8c06){if(_0x2a8c06){_0x40a6bc=_0x2a8c06[_0x8dcd('0x48')];if(!_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x96')]('nolimit')){_0x31c8fe[_0x8dcd('0x20')]=qs[_0x8dcd('0x20')](_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x20')]);_0x31c8fe[_0x8dcd('0x22')]=qs['offset'](_0x1b6d65[_0x8dcd('0x32')][_0x8dcd('0x22')]);}return _0x42223d[_0x8dcd('0x97')](_0x31c8fe);}})[_0x8dcd('0x40')](function(_0x21e830){if(_0x21e830){return _0x21e830?{'count':_0x40a6bc,'rows':_0x21e830}:null;}})[_0x8dcd('0x40')](respondWithResult(_0x46956f,null))['catch'](handleError(_0x46956f,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 3127112..ec544b9 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 _0x9959=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2083ba,_0x135f8b){var _0x205dc3=function(_0x580ebd){while(--_0x580ebd){_0x2083ba['push'](_0x2083ba['shift']());}};_0x205dc3(++_0x135f8b);}(_0x9959,0x91));var _0x9995=function(_0x45b1a5,_0x1b9fef){_0x45b1a5=_0x45b1a5-0x0;var _0x1335e0=_0x9959[_0x45b1a5];return _0x1335e0;};'use strict';var EventEmitter=require(_0x9995('0x0'));var Team=require(_0x9995('0x1'))['db'][_0x9995('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9995('0x3')](0x0);var events={'afterCreate':_0x9995('0x4'),'afterUpdate':_0x9995('0x5'),'afterDestroy':_0x9995('0x6')};function emitEvent(_0x46e5f9){return function(_0x262829,_0x242a6a,_0x3aa4c1){TeamEvents[_0x9995('0x7')](_0x46e5f9+':'+_0x262829['id'],_0x262829);TeamEvents[_0x9995('0x7')](_0x46e5f9,_0x262829);_0x3aa4c1(null);};}for(var e in events){if(events[_0x9995('0x8')](e)){var event=events[e];Team[_0x9995('0x9')](e,emitEvent(event));}}module[_0x9995('0xa')]=TeamEvents; \ No newline at end of file +var _0xcb61=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','Team','save'];(function(_0xb5e64,_0x2f9dfe){var _0x5c6e07=function(_0x13d88e){while(--_0x13d88e){_0xb5e64['push'](_0xb5e64['shift']());}};_0x5c6e07(++_0x2f9dfe);}(_0xcb61,0x16d));var _0x1cb6=function(_0x3c1aa8,_0x8b693a){_0x3c1aa8=_0x3c1aa8-0x0;var _0x4f76e3=_0xcb61[_0x3c1aa8];return _0x4f76e3;};'use strict';var EventEmitter=require('events');var Team=require(_0x1cb6('0x0'))['db'][_0x1cb6('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1cb6('0x2'),'afterUpdate':_0x1cb6('0x3'),'afterDestroy':_0x1cb6('0x4')};function emitEvent(_0x87f6e9){return function(_0x559c36,_0x39ce84,_0x41e703){TeamEvents[_0x1cb6('0x5')](_0x87f6e9+':'+_0x559c36['id'],_0x559c36);TeamEvents['emit'](_0x87f6e9,_0x559c36);_0x41e703(null);};}for(var e in events){if(events[_0x1cb6('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x1cb6('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5efb2ba..7be703f 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 _0xb260=['lodash','util','../../config/logger','api','moment','../../config/environment','./team.attributes','exports','define','Team','teams'];(function(_0x289c9f,_0x5b8e19){var _0x29d99a=function(_0x4effcf){while(--_0x4effcf){_0x289c9f['push'](_0x289c9f['shift']());}};_0x29d99a(++_0x5b8e19);}(_0xb260,0x1b8));var _0x0b26=function(_0x424200,_0x30607e){_0x424200=_0x424200-0x0;var _0xc25c73=_0xb260[_0x424200];return _0xc25c73;};'use strict';var _=require(_0x0b26('0x0'));var util=require(_0x0b26('0x1'));var logger=require(_0x0b26('0x2'))(_0x0b26('0x3'));var moment=require(_0x0b26('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0b26('0x5'));var attributes=require(_0x0b26('0x6'));module[_0x0b26('0x7')]=function(_0x5d22fc,_0x356219){return _0x5d22fc[_0x0b26('0x8')](_0x0b26('0x9'),attributes,{'tableName':_0x0b26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc87f=['moment','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','util','../../config/logger','api'];(function(_0x3a424f,_0x25026d){var _0x13f4d2=function(_0x54cec7){while(--_0x54cec7){_0x3a424f['push'](_0x3a424f['shift']());}};_0x13f4d2(++_0x25026d);}(_0xc87f,0xf3));var _0xfc87=function(_0x23cc9e,_0x42e7db){_0x23cc9e=_0x23cc9e-0x0;var _0xb93712=_0xc87f[_0x23cc9e];return _0xb93712;};'use strict';var _=require(_0xfc87('0x0'));var util=require(_0xfc87('0x1'));var logger=require(_0xfc87('0x2'))(_0xfc87('0x3'));var moment=require(_0xfc87('0x4'));var BPromise=require(_0xfc87('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc87('0x6'));var rimraf=require(_0xfc87('0x7'));var config=require(_0xfc87('0x8'));var attributes=require(_0xfc87('0x9'));module[_0xfc87('0xa')]=function(_0x3c1481,_0x15cb73){return _0x3c1481['define'](_0xfc87('0xb'),attributes,{'tableName':_0xfc87('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 bcfd35e..7144812 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 _0xc74e=['socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x35faf2,_0x56a899){var _0x113601=function(_0x386004){while(--_0x386004){_0x35faf2['push'](_0x35faf2['shift']());}};_0x113601(++_0x56a899);}(_0xc74e,0x1cf));var _0xec74=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc74e[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xec74('0x0'));var BPromise=require('bluebird');var rs=require(_0xec74('0x1'));var fs=require('fs');var Redis=require(_0xec74('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec74('0x3'));var logger=require(_0xec74('0x4'))(_0xec74('0x5'));var config=require(_0xec74('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xec74('0x7')][_0xec74('0x8')]({'port':0x232a});config[_0xec74('0x9')]=_[_0xec74('0xa')](config[_0xec74('0x9')],{'host':_0xec74('0xb'),'port':0x18eb});var socket=require(_0xec74('0xc'))(new Redis(config['redis']));require(_0xec74('0xd'))[_0xec74('0xe')](socket);function respondWithRpcPromise(_0x2c9cbc,_0x5b5805,_0x336435){return new BPromise(function(_0x548d19,_0x1127f9){return client[_0xec74('0xf')](_0x2c9cbc,_0x336435)['then'](function(_0x2c478e){logger[_0xec74('0x10')](_0xec74('0x11'),_0x5b5805,_0xec74('0x12'));logger[_0xec74('0x13')](_0xec74('0x14'),_0x5b5805,_0xec74('0x12'),JSON[_0xec74('0x15')](_0x2c478e));if(_0x2c478e[_0xec74('0x16')]){if(_0x2c478e[_0xec74('0x16')]['code']===0x1f4){logger[_0xec74('0x16')](_0xec74('0x11'),_0x5b5805,_0x2c478e[_0xec74('0x16')][_0xec74('0x17')]);return _0x1127f9(_0x2c478e[_0xec74('0x16')][_0xec74('0x17')]);}logger['error'](_0xec74('0x11'),_0x5b5805,_0x2c478e[_0xec74('0x16')][_0xec74('0x17')]);return _0x548d19(_0x2c478e[_0xec74('0x16')][_0xec74('0x17')]);}else{logger[_0xec74('0x10')]('Team,\x20%s,\x20%s',_0x5b5805,_0xec74('0x12'));_0x548d19(_0x2c478e['result']['message']);}})[_0xec74('0x18')](function(_0x34d43d){logger[_0xec74('0x16')](_0xec74('0x11'),_0x5b5805,_0x34d43d);_0x1127f9(_0x34d43d);});});} \ No newline at end of file +var _0xdf82=['./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x2243a1,_0x34b228){var _0x47d17d=function(_0x51d220){while(--_0x51d220){_0x2243a1['push'](_0x2243a1['shift']());}};_0x47d17d(++_0x34b228);}(_0xdf82,0x182));var _0x2df8=function(_0x4ab7f0,_0xf96672){_0x4ab7f0=_0x4ab7f0-0x0;var _0x2cc302=_0xdf82[_0x4ab7f0];return _0x2cc302;};'use strict';var _=require(_0x2df8('0x0'));var util=require(_0x2df8('0x1'));var moment=require('moment');var BPromise=require(_0x2df8('0x2'));var rs=require(_0x2df8('0x3'));var fs=require('fs');var Redis=require(_0x2df8('0x4'));var db=require(_0x2df8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2df8('0x6'));var config=require(_0x2df8('0x7'));var jayson=require(_0x2df8('0x8'));var client=jayson[_0x2df8('0x9')]['http']({'port':0x232a});config[_0x2df8('0xa')]=_[_0x2df8('0xb')](config['redis'],{'host':_0x2df8('0xc'),'port':0x18eb});var socket=require(_0x2df8('0xd'))(new Redis(config[_0x2df8('0xa')]));require(_0x2df8('0xe'))['register'](socket);function respondWithRpcPromise(_0x22db80,_0x440fad,_0x30aa10){return new BPromise(function(_0x49c9fc,_0x43a31a){return client[_0x2df8('0xf')](_0x22db80,_0x30aa10)[_0x2df8('0x10')](function(_0x1e52d6){logger[_0x2df8('0x11')](_0x2df8('0x12'),_0x440fad,_0x2df8('0x13'));logger['debug'](_0x2df8('0x14'),_0x440fad,_0x2df8('0x13'),JSON[_0x2df8('0x15')](_0x1e52d6));if(_0x1e52d6[_0x2df8('0x16')]){if(_0x1e52d6['error'][_0x2df8('0x17')]===0x1f4){logger[_0x2df8('0x16')](_0x2df8('0x12'),_0x440fad,_0x1e52d6['error'][_0x2df8('0x18')]);return _0x43a31a(_0x1e52d6[_0x2df8('0x16')]['message']);}logger['error'](_0x2df8('0x12'),_0x440fad,_0x1e52d6['error'][_0x2df8('0x18')]);return _0x49c9fc(_0x1e52d6[_0x2df8('0x16')][_0x2df8('0x18')]);}else{logger['info'](_0x2df8('0x12'),_0x440fad,_0x2df8('0x13'));_0x49c9fc(_0x1e52d6['result'][_0x2df8('0x18')]);}})['catch'](function(_0x2a49fb){logger[_0x2df8('0x16')](_0x2df8('0x12'),_0x440fad,_0x2a49fb);_0x43a31a(_0x2a49fb);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2af3513..d29a41d 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 _0xb1db=['removeListener','team:','update','emit'];(function(_0x594ace,_0x2f1be4){var _0x694bef=function(_0x321189){while(--_0x321189){_0x594ace['push'](_0x594ace['shift']());}};_0x694bef(++_0x2f1be4);}(_0xb1db,0x1be));var _0xbb1d=function(_0x3da312,_0x391ccd){_0x3da312=_0x3da312-0x0;var _0x28fb08=_0xb1db[_0x3da312];return _0x28fb08;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0xbb1d('0x0')];function createListener(_0x34985d,_0x162832){return function(_0x2470bd){_0x162832[_0xbb1d('0x1')](_0x34985d,_0x2470bd);};}function removeListener(_0x286e92,_0x2242c6){return function(){TeamEvents[_0xbb1d('0x2')](_0x286e92,_0x2242c6);};}exports['register']=function(_0x593669){for(var _0x5a0543=0x0,_0x217f31=events['length'];_0x5a0543<_0x217f31;_0x5a0543++){var _0x2e8562=events[_0x5a0543];var _0x5f1f0e=createListener(_0xbb1d('0x3')+_0x2e8562,_0x593669);TeamEvents['on'](_0x2e8562,_0x5f1f0e);}}; \ No newline at end of file +var _0x809a=['./team.events','save','remove','update','removeListener','team:'];(function(_0x37fce7,_0x37086f){var _0x5511b2=function(_0x2dfc56){while(--_0x2dfc56){_0x37fce7['push'](_0x37fce7['shift']());}};_0x5511b2(++_0x37086f);}(_0x809a,0x186));var _0xa809=function(_0x2480f1,_0x17f69d){_0x2480f1=_0x2480f1-0x0;var _0x1e4275=_0x809a[_0x2480f1];return _0x1e4275;};'use strict';var TeamEvents=require(_0xa809('0x0'));var events=[_0xa809('0x1'),_0xa809('0x2'),_0xa809('0x3')];function createListener(_0x162892,_0x4a33df){return function(_0x5ed68f){_0x4a33df['emit'](_0x162892,_0x5ed68f);};}function removeListener(_0x571022,_0x548fb6){return function(){TeamEvents[_0xa809('0x4')](_0x571022,_0x548fb6);};}exports['register']=function(_0x2c6237){for(var _0x4a161d=0x0,_0x1920ea=events['length'];_0x4a161d<_0x1920ea;_0x4a161d++){var _0x1458fe=events[_0x4a161d];var _0x4f1545=createListener(_0xa809('0x5')+_0x1458fe,_0x2c6237);TeamEvents['on'](_0x1458fe,_0x4f1545);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 50e8a7b..c1d113c 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 _0xab02=['exports','INTEGER','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xab02,0xc5));var _0x2ab0=function(_0x1960b1,_0x2c0ed8){_0x1960b1=_0x1960b1-0x0;var _0x51347b=_0xab02[_0x1960b1];return _0x51347b;};'use strict';var Sequelize=require(_0x2ab0('0x0'));module[_0x2ab0('0x1')]={'TeamId':{'type':Sequelize[_0x2ab0('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x2ab0('0x2')]}}; \ No newline at end of file +var _0xd86f=['sequelize','exports','INTEGER'];(function(_0xdcbbb,_0x39b964){var _0x19bb4e=function(_0x4952b7){while(--_0x4952b7){_0xdcbbb['push'](_0xdcbbb['shift']());}};_0x19bb4e(++_0x39b964);}(_0xd86f,0xf6));var _0xfd86=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xd86f[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require(_0xfd86('0x0'));module[_0xfd86('0x1')]={'TeamId':{'type':Sequelize[_0xfd86('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xfd86('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 7b74bec..48c9be7 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 _0x220b=['api','moment','request-promise','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger'];(function(_0x4d2740,_0x209b23){var _0x3c3a27=function(_0x3146c0){while(--_0x3146c0){_0x4d2740['push'](_0x4d2740['shift']());}};_0x3c3a27(++_0x209b23);}(_0x220b,0x1a2));var _0xb220=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x220b[_0x55ef8b];return _0x359c84;};'use strict';var _=require('lodash');var util=require(_0xb220('0x0'));var logger=require(_0xb220('0x1'))(_0xb220('0x2'));var moment=require(_0xb220('0x3'));var BPromise=require('bluebird');var rp=require(_0xb220('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb220('0x5'));var config=require('../../config/environment');var attributes=require(_0xb220('0x6'));module[_0xb220('0x7')]=function(_0x1d2be4,_0x366a4d){return _0x1d2be4['define'](_0xb220('0x8'),attributes,{'tableName':_0xb220('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5088=['../../config/environment','exports','define','team_has_voice_prefixes','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x588b9e,_0x511d23){var _0x20ce11=function(_0x359659){while(--_0x359659){_0x588b9e['push'](_0x588b9e['shift']());}};_0x20ce11(++_0x511d23);}(_0x5088,0xa9));var _0x8508=function(_0x3e10c0,_0x385bdc){_0x3e10c0=_0x3e10c0-0x0;var _0x2fb415=_0x5088[_0x3e10c0];return _0x2fb415;};'use strict';var _=require('lodash');var util=require(_0x8508('0x0'));var logger=require(_0x8508('0x1'))(_0x8508('0x2'));var moment=require(_0x8508('0x3'));var BPromise=require('bluebird');var rp=require(_0x8508('0x4'));var fs=require('fs');var path=require(_0x8508('0x5'));var rimraf=require(_0x8508('0x6'));var config=require(_0x8508('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x8508('0x8')]=function(_0x52d892,_0x42e60c){return _0x52d892[_0x8508('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0x8508('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a9e644d..e16bb40 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e51d0,_0x4fc72b){var _0x14879c=function(_0x14f994){while(--_0x14f994){_0x5e51d0['push'](_0x5e51d0['shift']());}};_0x14879c(++_0x4fc72b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1f774e,_0x3e64d7){var _0x3d284e=function(_0x1a23d7){while(--_0x1a23d7){_0x1f774e['push'](_0x1f774e['shift']());}};_0x3d284e(++_0x3e64d7);}(_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 9fc0798..087f6ab 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 _0x11a6=['sequelize'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x11a6,0x1c7));var _0x611a=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0x11a6[_0x3f578f];return _0x32c754;};'use strict';var Sequelize=require(_0x611a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdb0b=['exports'];(function(_0xb17b59,_0xe2aa96){var _0x4b909e=function(_0xdbe892){while(--_0xdbe892){_0xb17b59['push'](_0xb17b59['shift']());}};_0x4b909e(++_0xe2aa96);}(_0xdb0b,0xae));var _0xbdb0=function(_0x371694,_0x4b18ef){_0x371694=_0x371694-0x0;var _0x21cef2=_0xdb0b[_0x371694];return _0x21cef2;};'use strict';var Sequelize=require('sequelize');module[_0xbdb0('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 0c40752..50d0787 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 _0xb205=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./teamVoiceQueue.attributes','define','team_has_voice_queues'];(function(_0x24ff39,_0x4a3356){var _0xa9fa10=function(_0x17b9ce){while(--_0x17b9ce){_0x24ff39['push'](_0x24ff39['shift']());}};_0xa9fa10(++_0x4a3356);}(_0xb205,0xf0));var _0x5b20=function(_0x5b0373,_0x16fd49){_0x5b0373=_0x5b0373-0x0;var _0x4e219d=_0xb205[_0x5b0373];return _0x4e219d;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var logger=require(_0x5b20('0x2'))(_0x5b20('0x3'));var moment=require(_0x5b20('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b20('0x5'));var rimraf=require('rimraf');var config=require(_0x5b20('0x6'));var attributes=require(_0x5b20('0x7'));module['exports']=function(_0x3206cd,_0x29d926){return _0x3206cd[_0x5b20('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0x5b20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b75=['request-promise','path','./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4c974e,_0x513d9e){var _0x31327b=function(_0x5db97c){while(--_0x5db97c){_0x4c974e['push'](_0x4c974e['shift']());}};_0x31327b(++_0x513d9e);}(_0x3b75,0x144));var _0x53b7=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0x3b75[_0x51639a];return _0x3abae4;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var logger=require(_0x53b7('0x2'))(_0x53b7('0x3'));var moment=require(_0x53b7('0x4'));var BPromise=require(_0x53b7('0x5'));var rp=require(_0x53b7('0x6'));var fs=require('fs');var path=require(_0x53b7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x53b7('0x8'));module[_0x53b7('0x9')]=function(_0x3bfde3,_0x46f651){return _0x3bfde3['define']('TeamVoiceQueue',attributes,{'tableName':_0x53b7('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 ebb2c3f..12e571f 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 _0x8c4a=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','TeamVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x482ddd,_0x3e1bd2){var _0x5c4a0f=function(_0x5c54f2){while(--_0x5c54f2){_0x482ddd['push'](_0x482ddd['shift']());}};_0x5c4a0f(++_0x3e1bd2);}(_0x8c4a,0xb0));var _0xa8c4=function(_0x118801,_0x4e1118){_0x118801=_0x118801-0x0;var _0x28e8d9=_0x8c4a[_0x118801];return _0x28e8d9;};'use strict';var _=require(_0xa8c4('0x0'));var util=require(_0xa8c4('0x1'));var moment=require('moment');var BPromise=require(_0xa8c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8c4('0x3'));var db=require(_0xa8c4('0x4'))['db'];var utils=require(_0xa8c4('0x5'));var logger=require(_0xa8c4('0x6'))(_0xa8c4('0x7'));var config=require(_0xa8c4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa8c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x690746,_0x2d17a0,_0x1d007d){return new BPromise(function(_0x5623f4,_0x20d72f){return client['request'](_0x690746,_0x1d007d)[_0xa8c4('0xa')](function(_0x564984){logger['info'](_0xa8c4('0xb'),_0x2d17a0,'request\x20sent');logger[_0xa8c4('0xc')](_0xa8c4('0xd'),_0x2d17a0,_0xa8c4('0xe'),JSON[_0xa8c4('0xf')](_0x564984));if(_0x564984[_0xa8c4('0x10')]){if(_0x564984[_0xa8c4('0x10')]['code']===0x1f4){logger[_0xa8c4('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2d17a0,_0x564984['error'][_0xa8c4('0x11')]);return _0x20d72f(_0x564984[_0xa8c4('0x10')][_0xa8c4('0x11')]);}logger[_0xa8c4('0x10')](_0xa8c4('0xb'),_0x2d17a0,_0x564984[_0xa8c4('0x10')][_0xa8c4('0x11')]);return _0x5623f4(_0x564984[_0xa8c4('0x10')][_0xa8c4('0x11')]);}else{logger[_0xa8c4('0x12')](_0xa8c4('0xb'),_0x2d17a0,_0xa8c4('0xe'));_0x5623f4(_0x564984[_0xa8c4('0x13')][_0xa8c4('0x11')]);}})[_0xa8c4('0x14')](function(_0x4efa9d){logger[_0xa8c4('0x10')](_0xa8c4('0xb'),_0x2d17a0,_0x4efa9d);_0x20d72f(_0x4efa9d);});});} \ No newline at end of file +var _0x8113=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x4b4ecd,_0x1c05f0){var _0x281ded=function(_0x55009d){while(--_0x55009d){_0x4b4ecd['push'](_0x4b4ecd['shift']());}};_0x281ded(++_0x1c05f0);}(_0x8113,0x1df));var _0x3811=function(_0x9656bf,_0x39a88d){_0x9656bf=_0x9656bf-0x0;var _0xd1900d=_0x8113[_0x9656bf];return _0xd1900d;};'use strict';var _=require(_0x3811('0x0'));var util=require(_0x3811('0x1'));var moment=require('moment');var BPromise=require(_0x3811('0x2'));var rs=require(_0x3811('0x3'));var fs=require('fs');var Redis=require(_0x3811('0x4'));var db=require(_0x3811('0x5'))['db'];var utils=require(_0x3811('0x6'));var logger=require(_0x3811('0x7'))(_0x3811('0x8'));var config=require(_0x3811('0x9'));var jayson=require(_0x3811('0xa'));var client=jayson[_0x3811('0xb')][_0x3811('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45b4d8,_0x3fe7a6,_0x477642){return new BPromise(function(_0x35c892,_0x4af73a){return client[_0x3811('0xd')](_0x45b4d8,_0x477642)[_0x3811('0xe')](function(_0x410b68){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3fe7a6,_0x3811('0xf'));logger[_0x3811('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3fe7a6,'request\x20sent',JSON[_0x3811('0x11')](_0x410b68));if(_0x410b68[_0x3811('0x12')]){if(_0x410b68['error']['code']===0x1f4){logger['error'](_0x3811('0x13'),_0x3fe7a6,_0x410b68[_0x3811('0x12')][_0x3811('0x14')]);return _0x4af73a(_0x410b68[_0x3811('0x12')][_0x3811('0x14')]);}logger[_0x3811('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3fe7a6,_0x410b68[_0x3811('0x12')][_0x3811('0x14')]);return _0x35c892(_0x410b68['error'][_0x3811('0x14')]);}else{logger[_0x3811('0x15')](_0x3811('0x13'),_0x3fe7a6,_0x3811('0xf'));_0x35c892(_0x410b68['result'][_0x3811('0x14')]);}})[_0x3811('0x16')](function(_0x243de7){logger['error'](_0x3811('0x13'),_0x3fe7a6,_0x243de7);_0x4af73a(_0x243de7);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f285efa..3a65236 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 _0x7669=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','destroy','multer','util','path','express','Router'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7669,0xe5));var _0x9766=function(_0x357e2f,_0x4c1b0b){_0x357e2f=_0x357e2f-0x0;var _0x835443=_0x7669[_0x357e2f];return _0x835443;};'use strict';var multer=require(_0x9766('0x0'));var util=require(_0x9766('0x1'));var path=require(_0x9766('0x2'));var timeout=require('connect-timeout');var express=require(_0x9766('0x3'));var router=express[_0x9766('0x4')]();var fs_extra=require(_0x9766('0x5'));var auth=require(_0x9766('0x6'));var interaction=require(_0x9766('0x7'));var config=require(_0x9766('0x8'));var controller=require('./template.controller');router[_0x9766('0x9')]('/',auth[_0x9766('0xa')](),controller[_0x9766('0xb')]);router[_0x9766('0x9')]('/:id',auth[_0x9766('0xa')](),controller[_0x9766('0xc')]);router[_0x9766('0xd')]('/',auth[_0x9766('0xa')](),controller[_0x9766('0xe')]);router['put'](_0x9766('0xf'),auth['isAuthenticated'](),controller[_0x9766('0x10')]);router['delete'](_0x9766('0xf'),auth['isAuthenticated'](),controller[_0x9766('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf0f4=['/:id','show','create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf0f4,0x182));var _0x4f0f=function(_0x36eb34,_0x2b1c8a){_0x36eb34=_0x36eb34-0x0;var _0x23e480=_0xf0f4[_0x36eb34];return _0x23e480;};'use strict';var multer=require('multer');var util=require(_0x4f0f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f0f('0x1'));var router=express[_0x4f0f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4f0f('0x3'));var interaction=require(_0x4f0f('0x4'));var config=require(_0x4f0f('0x5'));var controller=require(_0x4f0f('0x6'));router[_0x4f0f('0x7')]('/',auth[_0x4f0f('0x8')](),controller[_0x4f0f('0x9')]);router['get'](_0x4f0f('0xa'),auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xb')]);router['post']('/',auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xc')]);router[_0x4f0f('0xd')](_0x4f0f('0xa'),auth[_0x4f0f('0x8')](),controller[_0x4f0f('0xe')]);router[_0x4f0f('0xf')](_0x4f0f('0xa'),auth['isAuthenticated'](),controller[_0x4f0f('0x10')]);module[_0x4f0f('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 3f6d9b4..d6274f4 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 _0x6095=['exports','STRING','TEXT','sequelize'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x6095,0x1c3));var _0x5609=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6095[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0x5609('0x0'));module[_0x5609('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5609('0x2')]},'html':{'type':Sequelize[_0x5609('0x3')]}}; \ No newline at end of file +var _0x7244=['exports','STRING','sequelize'];(function(_0x3a2a74,_0x3b4775){var _0x5a2c55=function(_0x5f4d10){while(--_0x5f4d10){_0x3a2a74['push'](_0x3a2a74['shift']());}};_0x5a2c55(++_0x3b4775);}(_0x7244,0x95));var _0x4724=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x7244[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x4724('0x0'));module[_0x4724('0x1')]={'name':{'type':Sequelize[_0x4724('0x2')]},'description':{'type':Sequelize[_0x4724('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 6312dcf..756e39e 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 _0x9208=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','map','options','includeAll','include','findAll','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Templates','stack','name','send','Template','rawAttributes','fieldName','type'];(function(_0x459fb6,_0x55ca2c){var _0x4dc060=function(_0x1f27ab){while(--_0x1f27ab){_0x459fb6['push'](_0x459fb6['shift']());}};_0x4dc060(++_0x55ca2c);}(_0x9208,0x6c));var _0x8920=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9208[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8920('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8920('0x1'));var moment=require(_0x8920('0x2'));var BPromise=require(_0x8920('0x3'));var Mustache=require(_0x8920('0x4'));var util=require('util');var path=require(_0x8920('0x5'));var sox=require(_0x8920('0x6'));var csv=require(_0x8920('0x7'));var ejs=require(_0x8920('0x8'));var fs=require('fs');var fs_extra=require(_0x8920('0x9'));var _=require(_0x8920('0xa'));var squel=require(_0x8920('0xb'));var crypto=require(_0x8920('0xc'));var jsforce=require(_0x8920('0xd'));var deskjs=require(_0x8920('0xe'));var toCsv=require(_0x8920('0x7'));var querystring=require(_0x8920('0xf'));var Papa=require(_0x8920('0x10'));var Redis=require(_0x8920('0x11'));var authService=require(_0x8920('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8920('0x13'));var logger=require('../../config/logger')(_0x8920('0x14'));var utils=require(_0x8920('0x15'));var config=require(_0x8920('0x16'));var licenseUtil=require(_0x8920('0x17'));var db=require(_0x8920('0x18'))['db'];function respondWithStatusCode(_0x979796,_0x425e24){_0x425e24=_0x425e24||0xcc;return function(_0x376431){if(_0x376431){return _0x979796[_0x8920('0x19')](_0x425e24);}return _0x979796[_0x8920('0x1a')](_0x425e24)[_0x8920('0x1b')]();};}function respondWithResult(_0x4ce178,_0x3758e3){_0x3758e3=_0x3758e3||0xc8;return function(_0x19a092){if(_0x19a092){return _0x4ce178[_0x8920('0x1a')](_0x3758e3)[_0x8920('0x1c')](_0x19a092);}};}function respondWithFilteredResult(_0x144696,_0x116b54){return function(_0x9b03bf){if(_0x9b03bf){var _0x12f56e=typeof _0x116b54[_0x8920('0x1d')]===_0x8920('0x1e')&&typeof _0x116b54[_0x8920('0x1f')]===_0x8920('0x1e');var _0x4d40ac=_0x9b03bf[_0x8920('0x20')];var _0x1b2cf1=_0x12f56e?0x0:_0x116b54['offset'];var _0x207213=_0x12f56e?_0x9b03bf['count']:_0x116b54['offset']+_0x116b54[_0x8920('0x1f')];var _0x28c5f3;if(_0x207213>=_0x4d40ac){_0x207213=_0x4d40ac;_0x28c5f3=0xc8;}else{_0x28c5f3=0xce;}_0x144696[_0x8920('0x1a')](_0x28c5f3);return _0x144696['set'](_0x8920('0x21'),_0x1b2cf1+'-'+_0x207213+'/'+_0x4d40ac)[_0x8920('0x1c')](_0x9b03bf);}return null;};}function patchUpdates(_0x5b0ba2){return function(_0x425304){try{jsonpatch[_0x8920('0x22')](_0x425304,_0x5b0ba2,!![]);}catch(_0x109000){return BPromise[_0x8920('0x23')](_0x109000);}return _0x425304['save']();};}function saveUpdates(_0x28c27d,_0x397e1d){return function(_0x316c54){if(_0x316c54){return _0x316c54[_0x8920('0x24')](_0x28c27d)[_0x8920('0x25')](function(_0x28d073){return _0x28d073;});}return null;};}function removeEntity(_0x123241,_0x31d053){return function(_0x3742d3){if(_0x3742d3){return _0x3742d3[_0x8920('0x26')]()[_0x8920('0x25')](function(){var _0x5ef00c=_0x3742d3[_0x8920('0x27')]({'plain':!![]});var _0x2d745c=_0x8920('0x28');return db['UserProfileResource'][_0x8920('0x26')]({'where':{'type':_0x2d745c,'resourceId':_0x5ef00c['id']}})['then'](function(){return _0x3742d3;});})['then'](function(){_0x123241['status'](0xcc)[_0x8920('0x1b')]();});}};}function handleEntityNotFound(_0x381226,_0x522e0b){return function(_0x5f1137){if(!_0x5f1137){_0x381226['sendStatus'](0x194);}return _0x5f1137;};}function handleError(_0x2e3f78,_0x4e9624){_0x4e9624=_0x4e9624||0x1f4;return function(_0x3fe5d){logger['error'](_0x3fe5d[_0x8920('0x29')]);if(_0x3fe5d['name']){delete _0x3fe5d[_0x8920('0x2a')];}_0x2e3f78[_0x8920('0x1a')](_0x4e9624)[_0x8920('0x2b')](_0x3fe5d);};}exports['index']=function(_0x146b9d,_0x119268){var _0x32d5d7={},_0x3cc522={},_0x47fa07={'count':0x0,'rows':[]};var _0x48df48=_['map'](db[_0x8920('0x2c')][_0x8920('0x2d')],function(_0x197078){return{'name':_0x197078[_0x8920('0x2e')],'type':_0x197078[_0x8920('0x2f')][_0x8920('0x30')]};});_0x3cc522[_0x8920('0x31')]=_['map'](_0x48df48,_0x8920('0x2a'));_0x3cc522[_0x8920('0x32')]=_[_0x8920('0x33')](_0x146b9d[_0x8920('0x32')]);_0x3cc522['filters']=_[_0x8920('0x34')](_0x3cc522[_0x8920('0x31')],_0x3cc522[_0x8920('0x32')]);_0x32d5d7[_0x8920('0x35')]=_['intersection'](_0x3cc522[_0x8920('0x31')],qs[_0x8920('0x36')](_0x146b9d[_0x8920('0x32')]['fields']));_0x32d5d7['attributes']=_0x32d5d7[_0x8920('0x35')][_0x8920('0x37')]?_0x32d5d7[_0x8920('0x35')]:_0x3cc522['model'];if(!_0x146b9d[_0x8920('0x32')][_0x8920('0x38')]('nolimit')){_0x32d5d7[_0x8920('0x1f')]=qs[_0x8920('0x1f')](_0x146b9d['query'][_0x8920('0x1f')]);_0x32d5d7[_0x8920('0x1d')]=qs[_0x8920('0x1d')](_0x146b9d['query'][_0x8920('0x1d')]);}_0x32d5d7['order']=qs[_0x8920('0x39')](_0x146b9d[_0x8920('0x32')][_0x8920('0x39')]);_0x32d5d7[_0x8920('0x3a')]=qs['filters'](_['pick'](_0x146b9d[_0x8920('0x32')],_0x3cc522[_0x8920('0x3b')]),_0x48df48);if(_0x146b9d[_0x8920('0x32')][_0x8920('0x3c')]){_0x32d5d7[_0x8920('0x3a')]=_[_0x8920('0x3d')](_0x32d5d7[_0x8920('0x3a')],{'$or':_[_0x8920('0x3e')](_0x48df48,function(_0x10d150){if(_0x10d150[_0x8920('0x2f')]!=='VIRTUAL'){var _0x5f284e={};_0x5f284e[_0x10d150[_0x8920('0x2a')]]={'$like':'%'+_0x146b9d[_0x8920('0x32')][_0x8920('0x3c')]+'%'};return _0x5f284e;}})});}_0x32d5d7=_[_0x8920('0x3d')]({},_0x32d5d7,_0x146b9d[_0x8920('0x3f')]);var _0x2255e5={'where':_0x32d5d7[_0x8920('0x3a')]};return db['Template'][_0x8920('0x20')](_0x2255e5)[_0x8920('0x25')](function(_0x3541be){_0x47fa07['count']=_0x3541be;if(_0x146b9d[_0x8920('0x32')][_0x8920('0x40')]){_0x32d5d7[_0x8920('0x41')]=[{'all':!![]}];}return db[_0x8920('0x2c')][_0x8920('0x42')](_0x32d5d7);})[_0x8920('0x25')](function(_0x406c23){_0x47fa07['rows']=_0x406c23;return _0x47fa07;})[_0x8920('0x25')](respondWithFilteredResult(_0x119268,_0x32d5d7))[_0x8920('0x43')](handleError(_0x119268,null));};exports[_0x8920('0x44')]=function(_0x219510,_0x1e4118){var _0x2ca967={'raw':!![],'where':{'id':_0x219510[_0x8920('0x45')]['id']}},_0x396d2f={};_0x396d2f[_0x8920('0x31')]=_[_0x8920('0x33')](db[_0x8920('0x2c')][_0x8920('0x2d')]);_0x396d2f[_0x8920('0x32')]=_[_0x8920('0x33')](_0x219510['query']);_0x396d2f[_0x8920('0x3b')]=_[_0x8920('0x34')](_0x396d2f['model'],_0x396d2f[_0x8920('0x32')]);_0x2ca967[_0x8920('0x35')]=_[_0x8920('0x34')](_0x396d2f[_0x8920('0x31')],qs[_0x8920('0x36')](_0x219510[_0x8920('0x32')]['fields']));_0x2ca967['attributes']=_0x2ca967[_0x8920('0x35')][_0x8920('0x37')]?_0x2ca967[_0x8920('0x35')]:_0x396d2f[_0x8920('0x31')];if(_0x219510['query'][_0x8920('0x40')]){_0x2ca967['include']=[{'all':!![]}];}_0x2ca967=_[_0x8920('0x3d')]({},_0x2ca967,_0x219510[_0x8920('0x3f')]);return db['Template'][_0x8920('0x46')](_0x2ca967)[_0x8920('0x25')](handleEntityNotFound(_0x1e4118,null))[_0x8920('0x25')](respondWithResult(_0x1e4118,null))[_0x8920('0x43')](handleError(_0x1e4118,null));};exports[_0x8920('0x47')]=function(_0x3e22b,_0x2c5bbc){return db[_0x8920('0x2c')]['create'](_0x3e22b[_0x8920('0x48')],{})[_0x8920('0x25')](function(_0x2b393e){var _0x69dd50=_0x3e22b[_0x8920('0x49')][_0x8920('0x27')]({'plain':!![]});if(!_0x69dd50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x69dd50['role']==='user'){var _0x2e634d=_0x2b393e[_0x8920('0x27')]({'plain':!![]});var _0xe3b815=_0x8920('0x28');return db[_0x8920('0x4a')]['find']({'where':{'name':_0xe3b815,'userProfileId':_0x69dd50[_0x8920('0x4b')]},'raw':!![]})[_0x8920('0x25')](function(_0x449919){if(_0x449919&&_0x449919['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2e634d[_0x8920('0x2a')],'resourceId':_0x2e634d['id'],'type':_0x449919['name'],'sectionId':_0x449919['id']},{})['then'](function(){return _0x2b393e;});}else{return _0x2b393e;}})['catch'](function(_0x4c3b40){logger[_0x8920('0x4c')](_0x8920('0x4d'),_0x4c3b40);throw _0x4c3b40;});}return _0x2b393e;})['then'](respondWithResult(_0x2c5bbc,0xc9))[_0x8920('0x43')](handleError(_0x2c5bbc,null));};exports[_0x8920('0x24')]=function(_0x20cb93,_0x3daefe){if(_0x20cb93[_0x8920('0x48')]['id']){delete _0x20cb93['body']['id'];}return db[_0x8920('0x2c')][_0x8920('0x46')]({'where':{'id':_0x20cb93[_0x8920('0x45')]['id']}})[_0x8920('0x25')](handleEntityNotFound(_0x3daefe,null))[_0x8920('0x25')](saveUpdates(_0x20cb93[_0x8920('0x48')],null))[_0x8920('0x25')](respondWithResult(_0x3daefe,null))[_0x8920('0x43')](handleError(_0x3daefe,null));};exports[_0x8920('0x26')]=function(_0x1ba238,_0x2f70cc){return db[_0x8920('0x2c')][_0x8920('0x46')]({'where':{'id':_0x1ba238[_0x8920('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f70cc,null))[_0x8920('0x25')](removeEntity(_0x2f70cc,null))[_0x8920('0x43')](handleError(_0x2f70cc,null));}; \ No newline at end of file +var _0xc476=['get','error','stack','name','send','Template','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy'];(function(_0xbcb6,_0x8e00a9){var _0x58899b=function(_0x35e0c4){while(--_0x35e0c4){_0xbcb6['push'](_0xbcb6['shift']());}};_0x58899b(++_0x8e00a9);}(_0xc476,0xc6));var _0x6c47=function(_0x3f3b4c,_0x4b490e){_0x3f3b4c=_0x3f3b4c-0x0;var _0x49dee8=_0xc476[_0x3f3b4c];return _0x49dee8;};'use strict';var emlformat=require(_0x6c47('0x0'));var rimraf=require(_0x6c47('0x1'));var zipdir=require(_0x6c47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c47('0x3'));var moment=require(_0x6c47('0x4'));var BPromise=require(_0x6c47('0x5'));var Mustache=require('mustache');var util=require(_0x6c47('0x6'));var path=require(_0x6c47('0x7'));var sox=require(_0x6c47('0x8'));var csv=require(_0x6c47('0x9'));var ejs=require(_0x6c47('0xa'));var fs=require('fs');var fs_extra=require(_0x6c47('0xb'));var _=require('lodash');var squel=require(_0x6c47('0xc'));var crypto=require('crypto');var jsforce=require(_0x6c47('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6c47('0x9'));var querystring=require(_0x6c47('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c47('0xf'));var qs=require(_0x6c47('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c47('0x11'));var logger=require('../../config/logger')(_0x6c47('0x12'));var utils=require('../../config/utils');var config=require(_0x6c47('0x13'));var licenseUtil=require(_0x6c47('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f88b2,_0x376c4c){_0x376c4c=_0x376c4c||0xcc;return function(_0x238152){if(_0x238152){return _0x1f88b2[_0x6c47('0x15')](_0x376c4c);}return _0x1f88b2[_0x6c47('0x16')](_0x376c4c)['end']();};}function respondWithResult(_0x4ba05a,_0x196478){_0x196478=_0x196478||0xc8;return function(_0x9d3a4c){if(_0x9d3a4c){return _0x4ba05a[_0x6c47('0x16')](_0x196478)[_0x6c47('0x17')](_0x9d3a4c);}};}function respondWithFilteredResult(_0x2b7bc7,_0x5c1daa){return function(_0x56a08c){if(_0x56a08c){var _0x133db4=typeof _0x5c1daa['offset']==='undefined'&&typeof _0x5c1daa['limit']===_0x6c47('0x18');var _0x3c1fa7=_0x56a08c[_0x6c47('0x19')];var _0x28566e=_0x133db4?0x0:_0x5c1daa['offset'];var _0xd48488=_0x133db4?_0x56a08c['count']:_0x5c1daa[_0x6c47('0x1a')]+_0x5c1daa[_0x6c47('0x1b')];var _0x354b24;if(_0xd48488>=_0x3c1fa7){_0xd48488=_0x3c1fa7;_0x354b24=0xc8;}else{_0x354b24=0xce;}_0x2b7bc7['status'](_0x354b24);return _0x2b7bc7[_0x6c47('0x1c')]('Content-Range',_0x28566e+'-'+_0xd48488+'/'+_0x3c1fa7)[_0x6c47('0x17')](_0x56a08c);}return null;};}function patchUpdates(_0x4e27c4){return function(_0x2ba443){try{jsonpatch[_0x6c47('0x1d')](_0x2ba443,_0x4e27c4,!![]);}catch(_0x3d4758){return BPromise['reject'](_0x3d4758);}return _0x2ba443['save']();};}function saveUpdates(_0x549a6c,_0x2a7aa6){return function(_0x5849a6){if(_0x5849a6){return _0x5849a6[_0x6c47('0x1e')](_0x549a6c)[_0x6c47('0x1f')](function(_0x237b32){return _0x237b32;});}return null;};}function removeEntity(_0x130c7a,_0x467572){return function(_0x549883){if(_0x549883){return _0x549883[_0x6c47('0x20')]()[_0x6c47('0x1f')](function(){var _0x441bb4=_0x549883[_0x6c47('0x21')]({'plain':!![]});var _0x43cc09='Templates';return db['UserProfileResource']['destroy']({'where':{'type':_0x43cc09,'resourceId':_0x441bb4['id']}})[_0x6c47('0x1f')](function(){return _0x549883;});})[_0x6c47('0x1f')](function(){_0x130c7a[_0x6c47('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15bca0,_0x7c45b9){return function(_0x3ccef6){if(!_0x3ccef6){_0x15bca0['sendStatus'](0x194);}return _0x3ccef6;};}function handleError(_0x5c8ee9,_0x2de437){_0x2de437=_0x2de437||0x1f4;return function(_0x5cca5a){logger[_0x6c47('0x22')](_0x5cca5a[_0x6c47('0x23')]);if(_0x5cca5a[_0x6c47('0x24')]){delete _0x5cca5a['name'];}_0x5c8ee9[_0x6c47('0x16')](_0x2de437)[_0x6c47('0x25')](_0x5cca5a);};}exports['index']=function(_0x1cfa89,_0xd7471d){var _0xf9da23={},_0x1718e1={},_0x401b26={'count':0x0,'rows':[]};var _0x49030c=_['map'](db[_0x6c47('0x26')]['rawAttributes'],function(_0x42bc2a){return{'name':_0x42bc2a[_0x6c47('0x27')],'type':_0x42bc2a[_0x6c47('0x28')][_0x6c47('0x29')]};});_0x1718e1[_0x6c47('0x2a')]=_[_0x6c47('0x2b')](_0x49030c,_0x6c47('0x24'));_0x1718e1[_0x6c47('0x2c')]=_[_0x6c47('0x2d')](_0x1cfa89[_0x6c47('0x2c')]);_0x1718e1[_0x6c47('0x2e')]=_[_0x6c47('0x2f')](_0x1718e1['model'],_0x1718e1['query']);_0xf9da23[_0x6c47('0x30')]=_[_0x6c47('0x2f')](_0x1718e1[_0x6c47('0x2a')],qs['fields'](_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x31')]));_0xf9da23[_0x6c47('0x30')]=_0xf9da23[_0x6c47('0x30')][_0x6c47('0x32')]?_0xf9da23['attributes']:_0x1718e1['model'];if(!_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x33')](_0x6c47('0x34'))){_0xf9da23[_0x6c47('0x1b')]=qs['limit'](_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x1b')]);_0xf9da23[_0x6c47('0x1a')]=qs[_0x6c47('0x1a')](_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x1a')]);}_0xf9da23[_0x6c47('0x35')]=qs[_0x6c47('0x36')](_0x1cfa89['query'][_0x6c47('0x36')]);_0xf9da23[_0x6c47('0x37')]=qs[_0x6c47('0x2e')](_[_0x6c47('0x38')](_0x1cfa89[_0x6c47('0x2c')],_0x1718e1[_0x6c47('0x2e')]),_0x49030c);if(_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x39')]){_0xf9da23[_0x6c47('0x37')]=_[_0x6c47('0x3a')](_0xf9da23['where'],{'$or':_[_0x6c47('0x2b')](_0x49030c,function(_0x10cce5){if(_0x10cce5[_0x6c47('0x28')]!==_0x6c47('0x3b')){var _0x3a7886={};_0x3a7886[_0x10cce5['name']]={'$like':'%'+_0x1cfa89[_0x6c47('0x2c')][_0x6c47('0x39')]+'%'};return _0x3a7886;}})});}_0xf9da23=_[_0x6c47('0x3a')]({},_0xf9da23,_0x1cfa89['options']);var _0x469f85={'where':_0xf9da23[_0x6c47('0x37')]};return db[_0x6c47('0x26')][_0x6c47('0x19')](_0x469f85)[_0x6c47('0x1f')](function(_0x50fd56){_0x401b26[_0x6c47('0x19')]=_0x50fd56;if(_0x1cfa89[_0x6c47('0x2c')]['includeAll']){_0xf9da23['include']=[{'all':!![]}];}return db[_0x6c47('0x26')][_0x6c47('0x3c')](_0xf9da23);})[_0x6c47('0x1f')](function(_0x51c17b){_0x401b26[_0x6c47('0x3d')]=_0x51c17b;return _0x401b26;})[_0x6c47('0x1f')](respondWithFilteredResult(_0xd7471d,_0xf9da23))[_0x6c47('0x3e')](handleError(_0xd7471d,null));};exports[_0x6c47('0x3f')]=function(_0x4b80e7,_0x567f4c){var _0x49b257={'raw':!![],'where':{'id':_0x4b80e7[_0x6c47('0x40')]['id']}},_0x318724={};_0x318724[_0x6c47('0x2a')]=_[_0x6c47('0x2d')](db[_0x6c47('0x26')][_0x6c47('0x41')]);_0x318724[_0x6c47('0x2c')]=_[_0x6c47('0x2d')](_0x4b80e7['query']);_0x318724[_0x6c47('0x2e')]=_[_0x6c47('0x2f')](_0x318724[_0x6c47('0x2a')],_0x318724[_0x6c47('0x2c')]);_0x49b257[_0x6c47('0x30')]=_[_0x6c47('0x2f')](_0x318724[_0x6c47('0x2a')],qs[_0x6c47('0x31')](_0x4b80e7[_0x6c47('0x2c')][_0x6c47('0x31')]));_0x49b257[_0x6c47('0x30')]=_0x49b257[_0x6c47('0x30')]['length']?_0x49b257['attributes']:_0x318724[_0x6c47('0x2a')];if(_0x4b80e7[_0x6c47('0x2c')][_0x6c47('0x42')]){_0x49b257[_0x6c47('0x43')]=[{'all':!![]}];}_0x49b257=_['merge']({},_0x49b257,_0x4b80e7[_0x6c47('0x44')]);return db['Template'][_0x6c47('0x45')](_0x49b257)[_0x6c47('0x1f')](handleEntityNotFound(_0x567f4c,null))[_0x6c47('0x1f')](respondWithResult(_0x567f4c,null))['catch'](handleError(_0x567f4c,null));};exports[_0x6c47('0x46')]=function(_0x41defe,_0x4f6890){return db[_0x6c47('0x26')][_0x6c47('0x46')](_0x41defe['body'],{})[_0x6c47('0x1f')](function(_0x54e936){var _0x43feac=_0x41defe[_0x6c47('0x47')][_0x6c47('0x21')]({'plain':!![]});if(!_0x43feac)throw new Error(_0x6c47('0x48'));if(_0x43feac[_0x6c47('0x49')]===_0x6c47('0x47')){var _0x4a80db=_0x54e936['get']({'plain':!![]});var _0x4061f1=_0x6c47('0x4a');return db[_0x6c47('0x4b')]['find']({'where':{'name':_0x4061f1,'userProfileId':_0x43feac['userProfileId']},'raw':!![]})[_0x6c47('0x1f')](function(_0x3917ff){if(_0x3917ff&&_0x3917ff['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4a80db['name'],'resourceId':_0x4a80db['id'],'type':_0x3917ff[_0x6c47('0x24')],'sectionId':_0x3917ff['id']},{})[_0x6c47('0x1f')](function(){return _0x54e936;});}else{return _0x54e936;}})['catch'](function(_0x5e53cb){logger[_0x6c47('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e53cb);throw _0x5e53cb;});}return _0x54e936;})[_0x6c47('0x1f')](respondWithResult(_0x4f6890,0xc9))[_0x6c47('0x3e')](handleError(_0x4f6890,null));};exports[_0x6c47('0x1e')]=function(_0x18e05f,_0x25a18b){if(_0x18e05f[_0x6c47('0x4c')]['id']){delete _0x18e05f[_0x6c47('0x4c')]['id'];}return db[_0x6c47('0x26')][_0x6c47('0x45')]({'where':{'id':_0x18e05f[_0x6c47('0x40')]['id']}})['then'](handleEntityNotFound(_0x25a18b,null))[_0x6c47('0x1f')](saveUpdates(_0x18e05f[_0x6c47('0x4c')],null))[_0x6c47('0x1f')](respondWithResult(_0x25a18b,null))[_0x6c47('0x3e')](handleError(_0x25a18b,null));};exports[_0x6c47('0x20')]=function(_0x4bb8ee,_0x403ed6){return db[_0x6c47('0x26')][_0x6c47('0x45')]({'where':{'id':_0x4bb8ee[_0x6c47('0x40')]['id']}})['then'](handleEntityNotFound(_0x403ed6,null))[_0x6c47('0x1f')](removeEntity(_0x403ed6,null))[_0x6c47('0x3e')](handleError(_0x403ed6,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 4405526..7ae1507 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 _0xadce=['bluebird','request-promise','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','moment'];(function(_0x2c2f44,_0x5b56da){var _0x137c4c=function(_0x36cc77){while(--_0x36cc77){_0x2c2f44['push'](_0x2c2f44['shift']());}};_0x137c4c(++_0x5b56da);}(_0xadce,0x101));var _0xeadc=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xadce[_0x1bc0ae];return _0x501104;};'use strict';var _=require(_0xeadc('0x0'));var util=require(_0xeadc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeadc('0x2'));var BPromise=require(_0xeadc('0x3'));var rp=require(_0xeadc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeadc('0x5'));var attributes=require(_0xeadc('0x6'));module['exports']=function(_0x135613,_0x322d7f){return _0x135613[_0xeadc('0x7')](_0xeadc('0x8'),attributes,{'tableName':_0xeadc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae70=['./template.attributes','Template','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae70,0x1b2));var _0x0ae7=function(_0x157e75,_0x450eaa){_0x157e75=_0x157e75-0x0;var _0xe0d4fb=_0xae70[_0x157e75];return _0xe0d4fb;};'use strict';var _=require('lodash');var util=require(_0x0ae7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0ae7('0x1'));var BPromise=require(_0x0ae7('0x2'));var rp=require(_0x0ae7('0x3'));var fs=require('fs');var path=require(_0x0ae7('0x4'));var rimraf=require(_0x0ae7('0x5'));var config=require(_0x0ae7('0x6'));var attributes=require(_0x0ae7('0x7'));module['exports']=function(_0x3a94f7,_0x3c117d){return _0x3a94f7['define'](_0x0ae7('0x8'),attributes,{'tableName':'tools_templates','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 f00f5bf..e713082 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 _0x34b0=['include','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','map','model','attributes'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x34b0,0x195));var _0x034b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x034b('0x0'));var moment=require(_0x034b('0x1'));var BPromise=require('bluebird');var rs=require(_0x034b('0x2'));var fs=require('fs');var Redis=require(_0x034b('0x3'));var db=require(_0x034b('0x4'))['db'];var utils=require(_0x034b('0x5'));var logger=require(_0x034b('0x6'))(_0x034b('0x7'));var config=require('../../config/environment');var jayson=require(_0x034b('0x8'));var client=jayson[_0x034b('0x9')][_0x034b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b789d,_0x310d77,_0xbf5d1b){return new BPromise(function(_0x43822d,_0x53a967){return client[_0x034b('0xb')](_0x2b789d,_0xbf5d1b)['then'](function(_0x564cd5){logger[_0x034b('0xc')](_0x034b('0xd'),_0x310d77,_0x034b('0xe'));logger[_0x034b('0xf')](_0x034b('0x10'),_0x310d77,_0x034b('0xe'),JSON[_0x034b('0x11')](_0x564cd5));if(_0x564cd5[_0x034b('0x12')]){if(_0x564cd5[_0x034b('0x12')]['code']===0x1f4){logger[_0x034b('0x12')](_0x034b('0xd'),_0x310d77,_0x564cd5[_0x034b('0x12')][_0x034b('0x13')]);return _0x53a967(_0x564cd5[_0x034b('0x12')]['message']);}logger[_0x034b('0x12')](_0x034b('0xd'),_0x310d77,_0x564cd5[_0x034b('0x12')][_0x034b('0x13')]);return _0x43822d(_0x564cd5['error'][_0x034b('0x13')]);}else{logger['info'](_0x034b('0xd'),_0x310d77,_0x034b('0xe'));_0x43822d(_0x564cd5[_0x034b('0x14')][_0x034b('0x13')]);}})[_0x034b('0x15')](function(_0x3615e3){logger[_0x034b('0x12')](_0x034b('0xd'),_0x310d77,_0x3615e3);_0x53a967(_0x3615e3);});});}exports[_0x034b('0x16')]=function(_0x5df547){var _0x351400=this;return new Promise(function(_0x56e5c1,_0x2e35d8){return db[_0x034b('0x17')][_0x034b('0x18')]({'raw':_0x5df547[_0x034b('0x19')]?_0x5df547[_0x034b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5df547[_0x034b('0x19')]?_0x5df547[_0x034b('0x19')]['where']||null:null,'attributes':_0x5df547[_0x034b('0x19')]?_0x5df547[_0x034b('0x19')]['attributes']||null:null,'limit':_0x5df547[_0x034b('0x19')]?_0x5df547[_0x034b('0x19')]['limit']||null:null,'include':_0x5df547[_0x034b('0x19')]?_0x5df547['options']['include']?_[_0x034b('0x1a')](_0x5df547[_0x034b('0x19')]['include'],function(_0x5343d8){return{'model':db[_0x5343d8[_0x034b('0x1b')]],'as':_0x5343d8['as'],'attributes':_0x5343d8[_0x034b('0x1c')],'include':_0x5343d8[_0x034b('0x1d')]?_[_0x034b('0x1a')](_0x5343d8[_0x034b('0x1d')],function(_0x3598dc){return{'model':db[_0x3598dc[_0x034b('0x1b')]],'as':_0x3598dc['as'],'attributes':_0x3598dc[_0x034b('0x1c')],'include':_0x3598dc[_0x034b('0x1d')]?_[_0x034b('0x1a')](_0x3598dc[_0x034b('0x1d')],function(_0x574bfc){return{'model':db[_0x574bfc['model']],'as':_0x574bfc['as'],'attributes':_0x574bfc[_0x034b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x034b('0x1e')](function(_0x4d0ff1){logger[_0x034b('0xc')](_0x034b('0x16'),_0x5df547);logger[_0x034b('0xf')](_0x034b('0x16'),_0x5df547,JSON[_0x034b('0x11')](_0x4d0ff1));_0x56e5c1(_0x4d0ff1);})['catch'](function(_0x86eacc){logger[_0x034b('0x12')](_0x034b('0x16'),_0x86eacc[_0x034b('0x13')],_0x5df547);_0x2e35d8(_0x351400[_0x034b('0x12')](0x1f4,_0x86eacc[_0x034b('0x13')]));});});}; \ No newline at end of file +var _0x7e33=['../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','where','attributes','include','map','model','then','GetTemplate','debug','lodash','util','randomstring','ioredis','../../mysqldb','rpc'];(function(_0xf0cfed,_0x942746){var _0x2bb34d=function(_0x39ab4e){while(--_0x39ab4e){_0xf0cfed['push'](_0xf0cfed['shift']());}};_0x2bb34d(++_0x942746);}(_0x7e33,0x7a));var _0x37e3=function(_0x4eaf21,_0x5c61a5){_0x4eaf21=_0x4eaf21-0x0;var _0x55b47=_0x7e33[_0x4eaf21];return _0x55b47;};'use strict';var _=require(_0x37e3('0x0'));var util=require(_0x37e3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x37e3('0x2'));var fs=require('fs');var Redis=require(_0x37e3('0x3'));var db=require(_0x37e3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x37e3('0x5'));var config=require(_0x37e3('0x6'));var jayson=require(_0x37e3('0x7'));var client=jayson[_0x37e3('0x8')][_0x37e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6b3e,_0x3c0945,_0xbea86f){return new BPromise(function(_0x11b5ca,_0x174376){return client[_0x37e3('0xa')](_0x5e6b3e,_0xbea86f)['then'](function(_0x4aace7){logger[_0x37e3('0xb')](_0x37e3('0xc'),_0x3c0945,_0x37e3('0xd'));logger['debug'](_0x37e3('0xe'),_0x3c0945,_0x37e3('0xd'),JSON[_0x37e3('0xf')](_0x4aace7));if(_0x4aace7[_0x37e3('0x10')]){if(_0x4aace7['error'][_0x37e3('0x11')]===0x1f4){logger[_0x37e3('0x10')](_0x37e3('0xc'),_0x3c0945,_0x4aace7[_0x37e3('0x10')]['message']);return _0x174376(_0x4aace7[_0x37e3('0x10')][_0x37e3('0x12')]);}logger[_0x37e3('0x10')]('Template,\x20%s,\x20%s',_0x3c0945,_0x4aace7[_0x37e3('0x10')][_0x37e3('0x12')]);return _0x11b5ca(_0x4aace7[_0x37e3('0x10')][_0x37e3('0x12')]);}else{logger[_0x37e3('0xb')]('Template,\x20%s,\x20%s',_0x3c0945,_0x37e3('0xd'));_0x11b5ca(_0x4aace7[_0x37e3('0x13')][_0x37e3('0x12')]);}})[_0x37e3('0x14')](function(_0x2d13ea){logger[_0x37e3('0x10')]('Template,\x20%s,\x20%s',_0x3c0945,_0x2d13ea);_0x174376(_0x2d13ea);});});}exports['GetTemplate']=function(_0x3df375){var _0xdac4a=this;return new Promise(function(_0x59124b,_0x43f54b){return db[_0x37e3('0x15')][_0x37e3('0x16')]({'raw':_0x3df375[_0x37e3('0x17')]?_0x3df375[_0x37e3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3df375['options']?_0x3df375[_0x37e3('0x17')][_0x37e3('0x18')]||null:null,'attributes':_0x3df375[_0x37e3('0x17')]?_0x3df375['options'][_0x37e3('0x19')]||null:null,'limit':_0x3df375[_0x37e3('0x17')]?_0x3df375[_0x37e3('0x17')]['limit']||null:null,'include':_0x3df375['options']?_0x3df375['options'][_0x37e3('0x1a')]?_[_0x37e3('0x1b')](_0x3df375[_0x37e3('0x17')]['include'],function(_0x17665b){return{'model':db[_0x17665b['model']],'as':_0x17665b['as'],'attributes':_0x17665b['attributes'],'include':_0x17665b['include']?_['map'](_0x17665b[_0x37e3('0x1a')],function(_0x3f3ad3){return{'model':db[_0x3f3ad3['model']],'as':_0x3f3ad3['as'],'attributes':_0x3f3ad3[_0x37e3('0x19')],'include':_0x3f3ad3[_0x37e3('0x1a')]?_[_0x37e3('0x1b')](_0x3f3ad3['include'],function(_0x3c1ef3){return{'model':db[_0x3c1ef3[_0x37e3('0x1c')]],'as':_0x3c1ef3['as'],'attributes':_0x3c1ef3[_0x37e3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x37e3('0x1d')](function(_0x28af26){logger[_0x37e3('0xb')](_0x37e3('0x1e'),_0x3df375);logger[_0x37e3('0x1f')](_0x37e3('0x1e'),_0x3df375,JSON[_0x37e3('0xf')](_0x28af26));_0x59124b(_0x28af26);})[_0x37e3('0x14')](function(_0x6187e1){logger[_0x37e3('0x10')](_0x37e3('0x1e'),_0x6187e1['message'],_0x3df375);_0x43f54b(_0xdac4a['error'](0x1f4,_0x6187e1['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8a26d4b..dc35076 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 _0x1394=['show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3f690a,_0x18e2b4){var _0x21b869=function(_0x1fcb83){while(--_0x1fcb83){_0x3f690a['push'](_0x3f690a['shift']());}};_0x21b869(++_0x18e2b4);}(_0x1394,0xb3));var _0x4139=function(_0x27c619,_0x44ea27){_0x27c619=_0x27c619-0x0;var _0x595e39=_0x1394[_0x27c619];return _0x595e39;};'use strict';var multer=require(_0x4139('0x0'));var util=require(_0x4139('0x1'));var path=require(_0x4139('0x2'));var timeout=require('connect-timeout');var express=require(_0x4139('0x3'));var router=express['Router']();var fs_extra=require(_0x4139('0x4'));var auth=require(_0x4139('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4139('0x6'));var controller=require('./trigger.controller');router[_0x4139('0x7')]('/',auth[_0x4139('0x8')](),controller[_0x4139('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4139('0xa')]);router[_0x4139('0x7')](_0x4139('0xb'),auth[_0x4139('0x8')](),controller[_0x4139('0xc')]);router[_0x4139('0x7')](_0x4139('0xd'),auth[_0x4139('0x8')](),controller['getAnyConditions']);router[_0x4139('0x7')](_0x4139('0xe'),auth[_0x4139('0x8')](),controller[_0x4139('0xf')]);router[_0x4139('0x10')]('/',auth[_0x4139('0x8')](),controller[_0x4139('0x11')]);router['post']('/:id/all_conditions',auth[_0x4139('0x8')](),controller[_0x4139('0x12')]);router[_0x4139('0x10')](_0x4139('0xd'),auth['isAuthenticated'](),controller[_0x4139('0x13')]);router[_0x4139('0x10')](_0x4139('0xe'),auth['isAuthenticated'](),controller[_0x4139('0x14')]);router[_0x4139('0x15')](_0x4139('0x16'),auth['isAuthenticated'](),controller[_0x4139('0x17')]);router[_0x4139('0x18')](_0x4139('0x16'),auth[_0x4139('0x8')](),controller[_0x4139('0x19')]);module[_0x4139('0x1a')]=router; \ No newline at end of file +var _0x6bfa=['../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x391291,_0x83e4ce){var _0x45debd=function(_0x41d750){while(--_0x41d750){_0x391291['push'](_0x391291['shift']());}};_0x45debd(++_0x83e4ce);}(_0x6bfa,0x101));var _0xa6bf=function(_0x3fd61b,_0x13687a){_0x3fd61b=_0x3fd61b-0x0;var _0x1f615d=_0x6bfa[_0x3fd61b];return _0x1f615d;};'use strict';var multer=require(_0xa6bf('0x0'));var util=require(_0xa6bf('0x1'));var path=require(_0xa6bf('0x2'));var timeout=require(_0xa6bf('0x3'));var express=require(_0xa6bf('0x4'));var router=express['Router']();var fs_extra=require(_0xa6bf('0x5'));var auth=require(_0xa6bf('0x6'));var interaction=require(_0xa6bf('0x7'));var config=require(_0xa6bf('0x8'));var controller=require(_0xa6bf('0x9'));router[_0xa6bf('0xa')]('/',auth[_0xa6bf('0xb')](),controller[_0xa6bf('0xc')]);router[_0xa6bf('0xa')](_0xa6bf('0xd'),auth[_0xa6bf('0xb')](),controller[_0xa6bf('0xe')]);router['get']('/:id/all_conditions',auth[_0xa6bf('0xb')](),controller['getAllConditions']);router[_0xa6bf('0xa')]('/:id/any_conditions',auth[_0xa6bf('0xb')](),controller['getAnyConditions']);router[_0xa6bf('0xa')]('/:id/actions',auth[_0xa6bf('0xb')](),controller['getActions']);router[_0xa6bf('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/all_conditions',auth[_0xa6bf('0xb')](),controller[_0xa6bf('0x10')]);router[_0xa6bf('0xf')]('/:id/any_conditions',auth[_0xa6bf('0xb')](),controller[_0xa6bf('0x11')]);router[_0xa6bf('0xf')]('/:id/actions',auth[_0xa6bf('0xb')](),controller[_0xa6bf('0x12')]);router[_0xa6bf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xa6bf('0x14')]);router[_0xa6bf('0x15')](_0xa6bf('0xd'),auth[_0xa6bf('0xb')](),controller[_0xa6bf('0x16')]);module[_0xa6bf('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 4903c48..9d55467 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 _0xc858=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2d5cd2,_0x52b0b6){var _0x1a9906=function(_0x164321){while(--_0x164321){_0x2d5cd2['push'](_0x2d5cd2['shift']());}};_0x1a9906(++_0x52b0b6);}(_0xc858,0x6e));var _0x8c85=function(_0x1569fc,_0x115095){_0x1569fc=_0x1569fc-0x0;var _0x277783=_0xc858[_0x1569fc];return _0x277783;};'use strict';var Sequelize=require(_0x8c85('0x0'));module[_0x8c85('0x1')]={'name':{'type':Sequelize[_0x8c85('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c85('0x2')]},'status':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7572=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b3017,_0x531959){var _0xd8fd8d=function(_0x537d8f){while(--_0x537d8f){_0x3b3017['push'](_0x3b3017['shift']());}};_0xd8fd8d(++_0x531959);}(_0x7572,0x1e3));var _0x2757=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x7572[_0x51ec61];return _0x223200;};'use strict';var Sequelize=require(_0x2757('0x0'));module[_0x2757('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2757('0x2')]},'description':{'type':Sequelize[_0x2757('0x2')]},'status':{'type':Sequelize[_0x2757('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 3e15b7c..fe1e0e1 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 _0x15d4=['model','query','keys','filters','intersection','fields','attributes','order','where','filter','merge','VIRTUAL','includeAll','include','rows','show','params','length','options','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','sort','pick','nolimit','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions','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','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','Triggers','UserProfileResource','error','stack','name','index','map','Trigger','rawAttributes','fieldName','type','key'];(function(_0x2daef6,_0xcac228){var _0x62d030=function(_0x26a7d6){while(--_0x26a7d6){_0x2daef6['push'](_0x2daef6['shift']());}};_0x62d030(++_0xcac228);}(_0x15d4,0x8c));var _0x415d=function(_0x16236f,_0xfaf791){_0x16236f=_0x16236f-0x0;var _0x359de4=_0x15d4[_0x16236f];return _0x359de4;};'use strict';var emlformat=require(_0x415d('0x0'));var rimraf=require(_0x415d('0x1'));var zipdir=require(_0x415d('0x2'));var jsonpatch=require(_0x415d('0x3'));var rp=require('request-promise');var moment=require(_0x415d('0x4'));var BPromise=require(_0x415d('0x5'));var Mustache=require(_0x415d('0x6'));var util=require(_0x415d('0x7'));var path=require(_0x415d('0x8'));var sox=require(_0x415d('0x9'));var csv=require(_0x415d('0xa'));var ejs=require(_0x415d('0xb'));var fs=require('fs');var fs_extra=require(_0x415d('0xc'));var _=require(_0x415d('0xd'));var squel=require(_0x415d('0xe'));var crypto=require(_0x415d('0xf'));var jsforce=require(_0x415d('0x10'));var deskjs=require(_0x415d('0x11'));var toCsv=require(_0x415d('0xa'));var querystring=require(_0x415d('0x12'));var Papa=require(_0x415d('0x13'));var Redis=require(_0x415d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x415d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x415d('0x16'));var logger=require('../../config/logger')(_0x415d('0x17'));var utils=require(_0x415d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x415d('0x19'));var db=require(_0x415d('0x1a'))['db'];function respondWithStatusCode(_0x346036,_0x453b2c){_0x453b2c=_0x453b2c||0xcc;return function(_0x3f1f58){if(_0x3f1f58){return _0x346036[_0x415d('0x1b')](_0x453b2c);}return _0x346036[_0x415d('0x1c')](_0x453b2c)[_0x415d('0x1d')]();};}function respondWithResult(_0x1b547e,_0x4ad6ab){_0x4ad6ab=_0x4ad6ab||0xc8;return function(_0x21b83f){if(_0x21b83f){return _0x1b547e[_0x415d('0x1c')](_0x4ad6ab)[_0x415d('0x1e')](_0x21b83f);}};}function respondWithFilteredResult(_0x230370,_0x122d55){return function(_0x74ce6a){if(_0x74ce6a){var _0x466f7d=typeof _0x122d55['offset']===_0x415d('0x1f')&&typeof _0x122d55[_0x415d('0x20')]===_0x415d('0x1f');var _0x10f4a2=_0x74ce6a['count'];var _0x8cfda1=_0x466f7d?0x0:_0x122d55[_0x415d('0x21')];var _0xb77dcb=_0x466f7d?_0x74ce6a[_0x415d('0x22')]:_0x122d55[_0x415d('0x21')]+_0x122d55['limit'];var _0x24fae4;if(_0xb77dcb>=_0x10f4a2){_0xb77dcb=_0x10f4a2;_0x24fae4=0xc8;}else{_0x24fae4=0xce;}_0x230370[_0x415d('0x1c')](_0x24fae4);return _0x230370[_0x415d('0x23')](_0x415d('0x24'),_0x8cfda1+'-'+_0xb77dcb+'/'+_0x10f4a2)[_0x415d('0x1e')](_0x74ce6a);}return null;};}function patchUpdates(_0x485de3){return function(_0x3fa472){try{jsonpatch[_0x415d('0x25')](_0x3fa472,_0x485de3,!![]);}catch(_0x198b17){return BPromise[_0x415d('0x26')](_0x198b17);}return _0x3fa472['save']();};}function saveUpdates(_0x56f4ce,_0x2ba90e){return function(_0x1ee350){if(_0x1ee350){return _0x1ee350[_0x415d('0x27')](_0x56f4ce)[_0x415d('0x28')](function(_0x1763fc){return _0x1763fc;});}return null;};}function removeEntity(_0x5f32ea,_0x47c1ba){return function(_0x42c690){if(_0x42c690){return _0x42c690[_0x415d('0x29')]()[_0x415d('0x28')](function(){var _0x161623=_0x42c690['get']({'plain':!![]});var _0x48c497=_0x415d('0x2a');return db[_0x415d('0x2b')]['destroy']({'where':{'type':_0x48c497,'resourceId':_0x161623['id']}})[_0x415d('0x28')](function(){return _0x42c690;});})[_0x415d('0x28')](function(){_0x5f32ea[_0x415d('0x1c')](0xcc)[_0x415d('0x1d')]();});}};}function handleEntityNotFound(_0x116bda,_0x2cf726){return function(_0x242f66){if(!_0x242f66){_0x116bda[_0x415d('0x1b')](0x194);}return _0x242f66;};}function handleError(_0x3aa00b,_0x5f275d){_0x5f275d=_0x5f275d||0x1f4;return function(_0x2f0eb8){logger[_0x415d('0x2c')](_0x2f0eb8[_0x415d('0x2d')]);if(_0x2f0eb8[_0x415d('0x2e')]){delete _0x2f0eb8['name'];}_0x3aa00b[_0x415d('0x1c')](_0x5f275d)['send'](_0x2f0eb8);};}exports[_0x415d('0x2f')]=function(_0x57acf7,_0xcc2e67){var _0xfabd4e={},_0x2a8451={},_0x44618b={'count':0x0,'rows':[]};var _0x376876=_[_0x415d('0x30')](db[_0x415d('0x31')][_0x415d('0x32')],function(_0xba0db){return{'name':_0xba0db[_0x415d('0x33')],'type':_0xba0db[_0x415d('0x34')][_0x415d('0x35')]};});_0x2a8451[_0x415d('0x36')]=_[_0x415d('0x30')](_0x376876,_0x415d('0x2e'));_0x2a8451[_0x415d('0x37')]=_[_0x415d('0x38')](_0x57acf7[_0x415d('0x37')]);_0x2a8451[_0x415d('0x39')]=_[_0x415d('0x3a')](_0x2a8451[_0x415d('0x36')],_0x2a8451['query']);_0xfabd4e['attributes']=_[_0x415d('0x3a')](_0x2a8451[_0x415d('0x36')],qs[_0x415d('0x3b')](_0x57acf7[_0x415d('0x37')][_0x415d('0x3b')]));_0xfabd4e[_0x415d('0x3c')]=_0xfabd4e[_0x415d('0x3c')]['length']?_0xfabd4e[_0x415d('0x3c')]:_0x2a8451[_0x415d('0x36')];if(!_0x57acf7[_0x415d('0x37')]['hasOwnProperty']('nolimit')){_0xfabd4e[_0x415d('0x20')]=qs[_0x415d('0x20')](_0x57acf7[_0x415d('0x37')][_0x415d('0x20')]);_0xfabd4e['offset']=qs[_0x415d('0x21')](_0x57acf7[_0x415d('0x37')][_0x415d('0x21')]);}_0xfabd4e[_0x415d('0x3d')]=qs['sort'](_0x57acf7[_0x415d('0x37')]['sort']);_0xfabd4e[_0x415d('0x3e')]=qs[_0x415d('0x39')](_['pick'](_0x57acf7[_0x415d('0x37')],_0x2a8451['filters']),_0x376876);if(_0x57acf7[_0x415d('0x37')][_0x415d('0x3f')]){_0xfabd4e[_0x415d('0x3e')]=_[_0x415d('0x40')](_0xfabd4e[_0x415d('0x3e')],{'$or':_[_0x415d('0x30')](_0x376876,function(_0x21f659){if(_0x21f659[_0x415d('0x34')]!==_0x415d('0x41')){var _0x3cd6e8={};_0x3cd6e8[_0x21f659[_0x415d('0x2e')]]={'$like':'%'+_0x57acf7[_0x415d('0x37')][_0x415d('0x3f')]+'%'};return _0x3cd6e8;}})});}_0xfabd4e=_[_0x415d('0x40')]({},_0xfabd4e,_0x57acf7['options']);var _0x3da6c0={'where':_0xfabd4e[_0x415d('0x3e')]};return db[_0x415d('0x31')][_0x415d('0x22')](_0x3da6c0)['then'](function(_0x53ca84){_0x44618b[_0x415d('0x22')]=_0x53ca84;if(_0x57acf7[_0x415d('0x37')][_0x415d('0x42')]){_0xfabd4e[_0x415d('0x43')]=[{'all':!![]}];}return db[_0x415d('0x31')]['findAll'](_0xfabd4e);})['then'](function(_0x5b2f53){_0x44618b[_0x415d('0x44')]=_0x5b2f53;return _0x44618b;})['then'](respondWithFilteredResult(_0xcc2e67,_0xfabd4e))['catch'](handleError(_0xcc2e67,null));};exports[_0x415d('0x45')]=function(_0x4650ed,_0x4affee){var _0x11a12b={'raw':![],'where':{'id':_0x4650ed[_0x415d('0x46')]['id']}},_0x4ea5f3={};_0x4ea5f3[_0x415d('0x36')]=_[_0x415d('0x38')](db['Trigger'][_0x415d('0x32')]);_0x4ea5f3['query']=_['keys'](_0x4650ed[_0x415d('0x37')]);_0x4ea5f3['filters']=_['intersection'](_0x4ea5f3[_0x415d('0x36')],_0x4ea5f3[_0x415d('0x37')]);_0x11a12b[_0x415d('0x3c')]=_['intersection'](_0x4ea5f3[_0x415d('0x36')],qs[_0x415d('0x3b')](_0x4650ed[_0x415d('0x37')]['fields']));_0x11a12b[_0x415d('0x3c')]=_0x11a12b[_0x415d('0x3c')][_0x415d('0x47')]?_0x11a12b['attributes']:_0x4ea5f3[_0x415d('0x36')];if(_0x4650ed[_0x415d('0x37')][_0x415d('0x42')]){_0x11a12b[_0x415d('0x43')]=[{'all':!![]}];}_0x11a12b=_['merge']({},_0x11a12b,_0x4650ed[_0x415d('0x48')]);return db[_0x415d('0x31')][_0x415d('0x49')](_0x11a12b)[_0x415d('0x28')](handleEntityNotFound(_0x4affee,null))[_0x415d('0x28')](respondWithResult(_0x4affee,null))[_0x415d('0x4a')](handleError(_0x4affee,null));};exports[_0x415d('0x4b')]=function(_0x41e257,_0x45d221){return db['Trigger'][_0x415d('0x4b')](_0x41e257[_0x415d('0x4c')],{})[_0x415d('0x28')](function(_0x460356){var _0x180839=_0x41e257['user'][_0x415d('0x4d')]({'plain':!![]});if(!_0x180839)throw new Error(_0x415d('0x4e'));if(_0x180839['role']==='user'){var _0x321206=_0x460356['get']({'plain':!![]});var _0x5e8d41=_0x415d('0x2a');return db[_0x415d('0x4f')]['find']({'where':{'name':_0x5e8d41,'userProfileId':_0x180839[_0x415d('0x50')]},'raw':!![]})[_0x415d('0x28')](function(_0x236a74){if(_0x236a74&&_0x236a74[_0x415d('0x51')]===0x0){return db[_0x415d('0x2b')]['create']({'name':_0x321206[_0x415d('0x2e')],'resourceId':_0x321206['id'],'type':_0x236a74[_0x415d('0x2e')],'sectionId':_0x236a74['id']},{})[_0x415d('0x28')](function(){return _0x460356;});}else{return _0x460356;}})[_0x415d('0x4a')](function(_0xbfefd9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbfefd9);throw _0xbfefd9;});}return _0x460356;})[_0x415d('0x28')](respondWithResult(_0x45d221,0xc9))[_0x415d('0x4a')](handleError(_0x45d221,null));};exports['update']=function(_0x141fca,_0x11d013){if(_0x141fca[_0x415d('0x4c')]['id']){delete _0x141fca[_0x415d('0x4c')]['id'];}return db[_0x415d('0x31')]['find']({'where':{'id':_0x141fca[_0x415d('0x46')]['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x11d013,null))[_0x415d('0x28')](saveUpdates(_0x141fca[_0x415d('0x4c')],null))['then'](respondWithResult(_0x11d013,null))[_0x415d('0x4a')](handleError(_0x11d013,null));};exports[_0x415d('0x29')]=function(_0x23d78c,_0x4cd797){return db['Trigger'][_0x415d('0x49')]({'where':{'id':_0x23d78c[_0x415d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4cd797,null))[_0x415d('0x28')](removeEntity(_0x4cd797,null))[_0x415d('0x4a')](handleError(_0x4cd797,null));};exports[_0x415d('0x52')]=function(_0x48958c,_0x28fd5f,_0x5587e1){if(_0x48958c['body']['id']){delete _0x48958c[_0x415d('0x4c')]['id'];}return db[_0x415d('0x31')][_0x415d('0x49')]({'where':{'id':_0x48958c['params']['id']}})['then'](handleEntityNotFound(_0x28fd5f,null))['then'](function(_0x27e1f9){if(_0x27e1f9){_0x48958c['body'][_0x415d('0x53')]=_0x27e1f9['id'];return db[_0x415d('0x54')][_0x415d('0x4b')](_0x48958c[_0x415d('0x4c')]);}})[_0x415d('0x28')](respondWithResult(_0x28fd5f,null))[_0x415d('0x4a')](handleError(_0x28fd5f,null));};exports['addAnyCondition']=function(_0x565698,_0x33260c,_0x4b846d){if(_0x565698[_0x415d('0x4c')]['id']){delete _0x565698['body']['id'];}return db['Trigger'][_0x415d('0x49')]({'where':{'id':_0x565698[_0x415d('0x46')]['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x33260c,null))[_0x415d('0x28')](function(_0x5e2275){if(_0x5e2275){_0x565698[_0x415d('0x4c')][_0x415d('0x55')]=_0x5e2275['id'];return db['Condition'][_0x415d('0x4b')](_0x565698[_0x415d('0x4c')]);}})[_0x415d('0x28')](respondWithResult(_0x33260c,null))['catch'](handleError(_0x33260c,null));};exports[_0x415d('0x56')]=function(_0x18f5ec,_0x43262d,_0x3f1544){var _0xb8d265={};var _0x3d4b24={};var _0x2adf5b;var _0x120211;return db[_0x415d('0x31')][_0x415d('0x57')]({'where':{'id':_0x18f5ec['params']['id']}})['then'](handleEntityNotFound(_0x43262d,null))[_0x415d('0x28')](function(_0x6593bb){if(_0x6593bb){_0x2adf5b=_0x6593bb;_0x3d4b24[_0x415d('0x36')]=_['keys'](db[_0x415d('0x54')][_0x415d('0x32')]);_0x3d4b24['query']=_[_0x415d('0x38')](_0x18f5ec[_0x415d('0x37')]);_0x3d4b24[_0x415d('0x39')]=_[_0x415d('0x3a')](_0x3d4b24['model'],_0x3d4b24[_0x415d('0x37')]);_0xb8d265[_0x415d('0x3c')]=_[_0x415d('0x3a')](_0x3d4b24[_0x415d('0x36')],qs[_0x415d('0x3b')](_0x18f5ec[_0x415d('0x37')][_0x415d('0x3b')]));_0xb8d265[_0x415d('0x3c')]=_0xb8d265[_0x415d('0x3c')][_0x415d('0x47')]?_0xb8d265[_0x415d('0x3c')]:_0x3d4b24[_0x415d('0x36')];_0xb8d265['order']=qs[_0x415d('0x58')](_0x18f5ec[_0x415d('0x37')][_0x415d('0x58')]);_0xb8d265[_0x415d('0x3e')]=qs['filters'](_[_0x415d('0x59')](_0x18f5ec[_0x415d('0x37')],_0x3d4b24['filters']));if(_0x18f5ec['query']['filter']){_0xb8d265['where']=_['merge'](_0xb8d265[_0x415d('0x3e')],{'$or':_[_0x415d('0x30')](_0xb8d265['attributes'],function(_0x303bf7){var _0x2f80cc={};_0x2f80cc[_0x303bf7]={'$like':'%'+_0x18f5ec['query'][_0x415d('0x3f')]+'%'};return _0x2f80cc;})});}_0xb8d265=_[_0x415d('0x40')]({},_0xb8d265,_0x18f5ec[_0x415d('0x48')]);return _0x2adf5b['getAllConditions'](_0xb8d265);}})[_0x415d('0x28')](function(_0x23c5bf){if(_0x23c5bf){_0x120211=_0x23c5bf['length'];if(!_0x18f5ec[_0x415d('0x37')]['hasOwnProperty'](_0x415d('0x5a'))){_0xb8d265[_0x415d('0x20')]=qs['limit'](_0x18f5ec['query']['limit']);_0xb8d265['offset']=qs[_0x415d('0x21')](_0x18f5ec[_0x415d('0x37')]['offset']);}return _0x2adf5b[_0x415d('0x56')](_0xb8d265);}})[_0x415d('0x28')](function(_0x115833){if(_0x115833){return _0x115833?{'count':_0x120211,'rows':_0x115833}:null;}})[_0x415d('0x28')](respondWithResult(_0x43262d,null))[_0x415d('0x4a')](handleError(_0x43262d,null));};exports[_0x415d('0x5b')]=function(_0x47e74d,_0x524bf4,_0x23c9a2){var _0x3019f1={};var _0x2d804b={};var _0x922d69;var _0x3068ec;return db[_0x415d('0x31')][_0x415d('0x57')]({'where':{'id':_0x47e74d[_0x415d('0x46')]['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x524bf4,null))['then'](function(_0x48aa21){if(_0x48aa21){_0x922d69=_0x48aa21;_0x2d804b[_0x415d('0x36')]=_[_0x415d('0x38')](db[_0x415d('0x54')][_0x415d('0x32')]);_0x2d804b[_0x415d('0x37')]=_[_0x415d('0x38')](_0x47e74d[_0x415d('0x37')]);_0x2d804b[_0x415d('0x39')]=_[_0x415d('0x3a')](_0x2d804b[_0x415d('0x36')],_0x2d804b[_0x415d('0x37')]);_0x3019f1[_0x415d('0x3c')]=_[_0x415d('0x3a')](_0x2d804b[_0x415d('0x36')],qs['fields'](_0x47e74d[_0x415d('0x37')][_0x415d('0x3b')]));_0x3019f1[_0x415d('0x3c')]=_0x3019f1[_0x415d('0x3c')]['length']?_0x3019f1[_0x415d('0x3c')]:_0x2d804b[_0x415d('0x36')];_0x3019f1[_0x415d('0x3d')]=qs[_0x415d('0x58')](_0x47e74d['query'][_0x415d('0x58')]);_0x3019f1[_0x415d('0x3e')]=qs[_0x415d('0x39')](_[_0x415d('0x59')](_0x47e74d[_0x415d('0x37')],_0x2d804b[_0x415d('0x39')]));if(_0x47e74d[_0x415d('0x37')][_0x415d('0x3f')]){_0x3019f1[_0x415d('0x3e')]=_[_0x415d('0x40')](_0x3019f1['where'],{'$or':_[_0x415d('0x30')](_0x3019f1[_0x415d('0x3c')],function(_0x144249){var _0x2a806d={};_0x2a806d[_0x144249]={'$like':'%'+_0x47e74d[_0x415d('0x37')][_0x415d('0x3f')]+'%'};return _0x2a806d;})});}_0x3019f1=_['merge']({},_0x3019f1,_0x47e74d[_0x415d('0x48')]);return _0x922d69[_0x415d('0x5b')](_0x3019f1);}})[_0x415d('0x28')](function(_0x569a57){if(_0x569a57){_0x3068ec=_0x569a57['length'];if(!_0x47e74d[_0x415d('0x37')][_0x415d('0x5c')](_0x415d('0x5a'))){_0x3019f1['limit']=qs[_0x415d('0x20')](_0x47e74d[_0x415d('0x37')]['limit']);_0x3019f1['offset']=qs['offset'](_0x47e74d[_0x415d('0x37')][_0x415d('0x21')]);}return _0x922d69[_0x415d('0x5b')](_0x3019f1);}})['then'](function(_0x20b272){if(_0x20b272){return _0x20b272?{'count':_0x3068ec,'rows':_0x20b272}:null;}})[_0x415d('0x28')](respondWithResult(_0x524bf4,null))[_0x415d('0x4a')](handleError(_0x524bf4,null));};exports[_0x415d('0x5d')]=function(_0x4b0d7e,_0x52a8da,_0xc1b579){if(_0x4b0d7e['body']['id']){delete _0x4b0d7e[_0x415d('0x4c')]['id'];}return db[_0x415d('0x31')][_0x415d('0x49')]({'where':{'id':_0x4b0d7e['params']['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x52a8da,null))[_0x415d('0x28')](function(_0xb1efbb){if(_0xb1efbb){_0x4b0d7e[_0x415d('0x4c')][_0x415d('0x5e')]=_0xb1efbb['id'];return db[_0x415d('0x5f')][_0x415d('0x4b')](_0x4b0d7e[_0x415d('0x4c')]);}})[_0x415d('0x28')](respondWithResult(_0x52a8da,null))[_0x415d('0x4a')](handleError(_0x52a8da,null));};exports[_0x415d('0x60')]=function(_0x743caf,_0x30632e,_0x3f612f){var _0x2f0325={};var _0x2a57c5={};var _0xebfad;var _0xf391fc;return db[_0x415d('0x31')]['findOne']({'where':{'id':_0x743caf['params']['id']}})[_0x415d('0x28')](handleEntityNotFound(_0x30632e,null))[_0x415d('0x28')](function(_0x2491f1){if(_0x2491f1){_0xebfad=_0x2491f1;_0x2a57c5[_0x415d('0x36')]=_['keys'](db[_0x415d('0x5f')]['rawAttributes']);_0x2a57c5[_0x415d('0x37')]=_[_0x415d('0x38')](_0x743caf[_0x415d('0x37')]);_0x2a57c5[_0x415d('0x39')]=_[_0x415d('0x3a')](_0x2a57c5['model'],_0x2a57c5[_0x415d('0x37')]);_0x2f0325[_0x415d('0x3c')]=_['intersection'](_0x2a57c5[_0x415d('0x36')],qs[_0x415d('0x3b')](_0x743caf[_0x415d('0x37')]['fields']));_0x2f0325[_0x415d('0x3c')]=_0x2f0325['attributes']['length']?_0x2f0325[_0x415d('0x3c')]:_0x2a57c5[_0x415d('0x36')];_0x2f0325[_0x415d('0x3d')]=qs[_0x415d('0x58')](_0x743caf['query'][_0x415d('0x58')]);_0x2f0325[_0x415d('0x3e')]=qs['filters'](_[_0x415d('0x59')](_0x743caf['query'],_0x2a57c5[_0x415d('0x39')]));if(_0x743caf['query']['filter']){_0x2f0325['where']=_['merge'](_0x2f0325[_0x415d('0x3e')],{'$or':_['map'](_0x2f0325[_0x415d('0x3c')],function(_0x3b34e0){var _0x1731a5={};_0x1731a5[_0x3b34e0]={'$like':'%'+_0x743caf[_0x415d('0x37')][_0x415d('0x3f')]+'%'};return _0x1731a5;})});}_0x2f0325=_[_0x415d('0x40')]({},_0x2f0325,_0x743caf['options']);return _0xebfad[_0x415d('0x60')](_0x2f0325);}})[_0x415d('0x28')](function(_0x2eaddc){if(_0x2eaddc){_0xf391fc=_0x2eaddc[_0x415d('0x47')];if(!_0x743caf['query'][_0x415d('0x5c')]('nolimit')){_0x2f0325['limit']=qs[_0x415d('0x20')](_0x743caf[_0x415d('0x37')][_0x415d('0x20')]);_0x2f0325[_0x415d('0x21')]=qs[_0x415d('0x21')](_0x743caf[_0x415d('0x37')][_0x415d('0x21')]);}return _0xebfad[_0x415d('0x60')](_0x2f0325);}})[_0x415d('0x28')](function(_0x52359b){if(_0x52359b){return _0x52359b?{'count':_0xf391fc,'rows':_0x52359b}:null;}})['then'](respondWithResult(_0x30632e,null))[_0x415d('0x4a')](handleError(_0x30632e,null));}; \ No newline at end of file +var _0x2e04=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','get','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addAllCondition','Condition','findOne','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x5b5e5c,_0x25e041){var _0x29acb0=function(_0x1b5f88){while(--_0x1b5f88){_0x5b5e5c['push'](_0x5b5e5c['shift']());}};_0x29acb0(++_0x25e041);}(_0x2e04,0x147));var _0x42e0=function(_0x17fe38,_0xb75e00){_0x17fe38=_0x17fe38-0x0;var _0x3886b=_0x2e04[_0x17fe38];return _0x3886b;};'use strict';var emlformat=require(_0x42e0('0x0'));var rimraf=require(_0x42e0('0x1'));var zipdir=require(_0x42e0('0x2'));var jsonpatch=require(_0x42e0('0x3'));var rp=require('request-promise');var moment=require(_0x42e0('0x4'));var BPromise=require(_0x42e0('0x5'));var Mustache=require(_0x42e0('0x6'));var util=require(_0x42e0('0x7'));var path=require('path');var sox=require(_0x42e0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x42e0('0x9'));var _=require(_0x42e0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x42e0('0xb'));var deskjs=require(_0x42e0('0xc'));var toCsv=require(_0x42e0('0xd'));var querystring=require(_0x42e0('0xe'));var Papa=require(_0x42e0('0xf'));var Redis=require(_0x42e0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x42e0('0x11'));var as=require(_0x42e0('0x12'));var hardwareService=require(_0x42e0('0x13'));var logger=require(_0x42e0('0x14'))(_0x42e0('0x15'));var utils=require('../../config/utils');var config=require(_0x42e0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b9a0d,_0x1f2535){_0x1f2535=_0x1f2535||0xcc;return function(_0x567321){if(_0x567321){return _0x1b9a0d[_0x42e0('0x17')](_0x1f2535);}return _0x1b9a0d[_0x42e0('0x18')](_0x1f2535)[_0x42e0('0x19')]();};}function respondWithResult(_0x5846ef,_0x39009e){_0x39009e=_0x39009e||0xc8;return function(_0x163ec4){if(_0x163ec4){return _0x5846ef[_0x42e0('0x18')](_0x39009e)['json'](_0x163ec4);}};}function respondWithFilteredResult(_0x413dd6,_0x249d98){return function(_0x32a1b0){if(_0x32a1b0){var _0x297948=typeof _0x249d98[_0x42e0('0x1a')]===_0x42e0('0x1b')&&typeof _0x249d98[_0x42e0('0x1c')]===_0x42e0('0x1b');var _0x1407a0=_0x32a1b0['count'];var _0x2414b2=_0x297948?0x0:_0x249d98['offset'];var _0x52c990=_0x297948?_0x32a1b0[_0x42e0('0x1d')]:_0x249d98[_0x42e0('0x1a')]+_0x249d98[_0x42e0('0x1c')];var _0x2a9814;if(_0x52c990>=_0x1407a0){_0x52c990=_0x1407a0;_0x2a9814=0xc8;}else{_0x2a9814=0xce;}_0x413dd6['status'](_0x2a9814);return _0x413dd6['set'](_0x42e0('0x1e'),_0x2414b2+'-'+_0x52c990+'/'+_0x1407a0)[_0x42e0('0x1f')](_0x32a1b0);}return null;};}function patchUpdates(_0x5466bc){return function(_0x367aa7){try{jsonpatch['apply'](_0x367aa7,_0x5466bc,!![]);}catch(_0xd8e565){return BPromise[_0x42e0('0x20')](_0xd8e565);}return _0x367aa7['save']();};}function saveUpdates(_0x5eceec,_0x4044f1){return function(_0x23e2be){if(_0x23e2be){return _0x23e2be[_0x42e0('0x21')](_0x5eceec)[_0x42e0('0x22')](function(_0x12618e){return _0x12618e;});}return null;};}function removeEntity(_0x13704f,_0x24a036){return function(_0x13eb3a){if(_0x13eb3a){return _0x13eb3a[_0x42e0('0x23')]()[_0x42e0('0x22')](function(){var _0x3eaa3d=_0x13eb3a[_0x42e0('0x24')]({'plain':!![]});var _0x20b4b6='Triggers';return db['UserProfileResource'][_0x42e0('0x23')]({'where':{'type':_0x20b4b6,'resourceId':_0x3eaa3d['id']}})[_0x42e0('0x22')](function(){return _0x13eb3a;});})[_0x42e0('0x22')](function(){_0x13704f[_0x42e0('0x18')](0xcc)[_0x42e0('0x19')]();});}};}function handleEntityNotFound(_0x5cbea1,_0x1837a6){return function(_0x41eacc){if(!_0x41eacc){_0x5cbea1['sendStatus'](0x194);}return _0x41eacc;};}function handleError(_0x15f119,_0x368b10){_0x368b10=_0x368b10||0x1f4;return function(_0x485914){logger['error'](_0x485914[_0x42e0('0x25')]);if(_0x485914[_0x42e0('0x26')]){delete _0x485914['name'];}_0x15f119[_0x42e0('0x18')](_0x368b10)[_0x42e0('0x27')](_0x485914);};}exports[_0x42e0('0x28')]=function(_0x458e39,_0x20c542){var _0x2e1d61={},_0x84bb77={},_0x2d06a9={'count':0x0,'rows':[]};var _0x284cbc=_[_0x42e0('0x29')](db['Trigger'][_0x42e0('0x2a')],function(_0x2c5118){return{'name':_0x2c5118[_0x42e0('0x2b')],'type':_0x2c5118[_0x42e0('0x2c')]['key']};});_0x84bb77['model']=_[_0x42e0('0x29')](_0x284cbc,_0x42e0('0x26'));_0x84bb77['query']=_[_0x42e0('0x2d')](_0x458e39[_0x42e0('0x2e')]);_0x84bb77['filters']=_['intersection'](_0x84bb77['model'],_0x84bb77['query']);_0x2e1d61['attributes']=_[_0x42e0('0x2f')](_0x84bb77[_0x42e0('0x30')],qs['fields'](_0x458e39[_0x42e0('0x2e')][_0x42e0('0x31')]));_0x2e1d61['attributes']=_0x2e1d61[_0x42e0('0x32')][_0x42e0('0x33')]?_0x2e1d61[_0x42e0('0x32')]:_0x84bb77[_0x42e0('0x30')];if(!_0x458e39['query'][_0x42e0('0x34')]('nolimit')){_0x2e1d61['limit']=qs[_0x42e0('0x1c')](_0x458e39[_0x42e0('0x2e')][_0x42e0('0x1c')]);_0x2e1d61[_0x42e0('0x1a')]=qs[_0x42e0('0x1a')](_0x458e39['query']['offset']);}_0x2e1d61['order']=qs['sort'](_0x458e39['query'][_0x42e0('0x35')]);_0x2e1d61[_0x42e0('0x36')]=qs['filters'](_[_0x42e0('0x37')](_0x458e39[_0x42e0('0x2e')],_0x84bb77[_0x42e0('0x38')]),_0x284cbc);if(_0x458e39['query'][_0x42e0('0x39')]){_0x2e1d61[_0x42e0('0x36')]=_[_0x42e0('0x3a')](_0x2e1d61[_0x42e0('0x36')],{'$or':_['map'](_0x284cbc,function(_0x2c17c3){if(_0x2c17c3[_0x42e0('0x2c')]!==_0x42e0('0x3b')){var _0x3eae88={};_0x3eae88[_0x2c17c3['name']]={'$like':'%'+_0x458e39[_0x42e0('0x2e')][_0x42e0('0x39')]+'%'};return _0x3eae88;}})});}_0x2e1d61=_[_0x42e0('0x3a')]({},_0x2e1d61,_0x458e39[_0x42e0('0x3c')]);var _0x290227={'where':_0x2e1d61[_0x42e0('0x36')]};return db[_0x42e0('0x3d')][_0x42e0('0x1d')](_0x290227)[_0x42e0('0x22')](function(_0x18bfee){_0x2d06a9[_0x42e0('0x1d')]=_0x18bfee;if(_0x458e39[_0x42e0('0x2e')][_0x42e0('0x3e')]){_0x2e1d61[_0x42e0('0x3f')]=[{'all':!![]}];}return db['Trigger'][_0x42e0('0x40')](_0x2e1d61);})['then'](function(_0x37f78b){_0x2d06a9[_0x42e0('0x41')]=_0x37f78b;return _0x2d06a9;})['then'](respondWithFilteredResult(_0x20c542,_0x2e1d61))[_0x42e0('0x42')](handleError(_0x20c542,null));};exports['show']=function(_0x2aafdb,_0x353590){var _0x5ec88a={'raw':![],'where':{'id':_0x2aafdb['params']['id']}},_0x426003={};_0x426003['model']=_[_0x42e0('0x2d')](db[_0x42e0('0x3d')][_0x42e0('0x2a')]);_0x426003[_0x42e0('0x2e')]=_['keys'](_0x2aafdb[_0x42e0('0x2e')]);_0x426003[_0x42e0('0x38')]=_[_0x42e0('0x2f')](_0x426003[_0x42e0('0x30')],_0x426003[_0x42e0('0x2e')]);_0x5ec88a[_0x42e0('0x32')]=_['intersection'](_0x426003[_0x42e0('0x30')],qs[_0x42e0('0x31')](_0x2aafdb['query'][_0x42e0('0x31')]));_0x5ec88a[_0x42e0('0x32')]=_0x5ec88a[_0x42e0('0x32')][_0x42e0('0x33')]?_0x5ec88a[_0x42e0('0x32')]:_0x426003[_0x42e0('0x30')];if(_0x2aafdb['query'][_0x42e0('0x3e')]){_0x5ec88a['include']=[{'all':!![]}];}_0x5ec88a=_['merge']({},_0x5ec88a,_0x2aafdb[_0x42e0('0x3c')]);return db[_0x42e0('0x3d')][_0x42e0('0x43')](_0x5ec88a)[_0x42e0('0x22')](handleEntityNotFound(_0x353590,null))[_0x42e0('0x22')](respondWithResult(_0x353590,null))[_0x42e0('0x42')](handleError(_0x353590,null));};exports[_0x42e0('0x44')]=function(_0x15aef1,_0x277618){return db['Trigger'][_0x42e0('0x44')](_0x15aef1['body'],{})[_0x42e0('0x22')](function(_0x43ddd7){var _0x5eadd0=_0x15aef1[_0x42e0('0x45')][_0x42e0('0x24')]({'plain':!![]});if(!_0x5eadd0)throw new Error(_0x42e0('0x46'));if(_0x5eadd0['role']==='user'){var _0xbd839b=_0x43ddd7[_0x42e0('0x24')]({'plain':!![]});var _0x514c1f='Triggers';return db['UserProfileSection'][_0x42e0('0x43')]({'where':{'name':_0x514c1f,'userProfileId':_0x5eadd0['userProfileId']},'raw':!![]})[_0x42e0('0x22')](function(_0x373762){if(_0x373762&&_0x373762['autoAssociation']===0x0){return db[_0x42e0('0x47')][_0x42e0('0x44')]({'name':_0xbd839b['name'],'resourceId':_0xbd839b['id'],'type':_0x373762[_0x42e0('0x26')],'sectionId':_0x373762['id']},{})[_0x42e0('0x22')](function(){return _0x43ddd7;});}else{return _0x43ddd7;}})[_0x42e0('0x42')](function(_0x2459b5){logger['error'](_0x42e0('0x48'),_0x2459b5);throw _0x2459b5;});}return _0x43ddd7;})[_0x42e0('0x22')](respondWithResult(_0x277618,0xc9))['catch'](handleError(_0x277618,null));};exports[_0x42e0('0x21')]=function(_0x443212,_0x3fea14){if(_0x443212['body']['id']){delete _0x443212[_0x42e0('0x49')]['id'];}return db[_0x42e0('0x3d')][_0x42e0('0x43')]({'where':{'id':_0x443212[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x3fea14,null))[_0x42e0('0x22')](saveUpdates(_0x443212[_0x42e0('0x49')],null))[_0x42e0('0x22')](respondWithResult(_0x3fea14,null))[_0x42e0('0x42')](handleError(_0x3fea14,null));};exports[_0x42e0('0x23')]=function(_0x468510,_0x5f5011){return db[_0x42e0('0x3d')][_0x42e0('0x43')]({'where':{'id':_0x468510[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x5f5011,null))[_0x42e0('0x22')](removeEntity(_0x5f5011,null))['catch'](handleError(_0x5f5011,null));};exports[_0x42e0('0x4b')]=function(_0x428f67,_0x2522c2,_0x18ec6c){if(_0x428f67[_0x42e0('0x49')]['id']){delete _0x428f67[_0x42e0('0x49')]['id'];}return db[_0x42e0('0x3d')]['find']({'where':{'id':_0x428f67[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x2522c2,null))['then'](function(_0x18de05){if(_0x18de05){_0x428f67[_0x42e0('0x49')]['TriggerAllId']=_0x18de05['id'];return db[_0x42e0('0x4c')]['create'](_0x428f67[_0x42e0('0x49')]);}})['then'](respondWithResult(_0x2522c2,null))[_0x42e0('0x42')](handleError(_0x2522c2,null));};exports['addAnyCondition']=function(_0x5f41a9,_0x19d1ab,_0x2d6e07){if(_0x5f41a9['body']['id']){delete _0x5f41a9[_0x42e0('0x49')]['id'];}return db[_0x42e0('0x3d')]['find']({'where':{'id':_0x5f41a9[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x19d1ab,null))[_0x42e0('0x22')](function(_0x44b14d){if(_0x44b14d){_0x5f41a9[_0x42e0('0x49')]['TriggerAnyId']=_0x44b14d['id'];return db[_0x42e0('0x4c')][_0x42e0('0x44')](_0x5f41a9[_0x42e0('0x49')]);}})[_0x42e0('0x22')](respondWithResult(_0x19d1ab,null))[_0x42e0('0x42')](handleError(_0x19d1ab,null));};exports['getAllConditions']=function(_0x1057a6,_0x2489fb,_0x26a5b9){var _0x569c8b={};var _0x4438fd={};var _0x5400d8;var _0x417d00;return db[_0x42e0('0x3d')][_0x42e0('0x4d')]({'where':{'id':_0x1057a6['params']['id']}})['then'](handleEntityNotFound(_0x2489fb,null))[_0x42e0('0x22')](function(_0x50dbbd){if(_0x50dbbd){_0x5400d8=_0x50dbbd;_0x4438fd[_0x42e0('0x30')]=_['keys'](db[_0x42e0('0x4c')][_0x42e0('0x2a')]);_0x4438fd['query']=_[_0x42e0('0x2d')](_0x1057a6[_0x42e0('0x2e')]);_0x4438fd[_0x42e0('0x38')]=_[_0x42e0('0x2f')](_0x4438fd[_0x42e0('0x30')],_0x4438fd['query']);_0x569c8b[_0x42e0('0x32')]=_[_0x42e0('0x2f')](_0x4438fd[_0x42e0('0x30')],qs[_0x42e0('0x31')](_0x1057a6[_0x42e0('0x2e')][_0x42e0('0x31')]));_0x569c8b['attributes']=_0x569c8b[_0x42e0('0x32')][_0x42e0('0x33')]?_0x569c8b[_0x42e0('0x32')]:_0x4438fd[_0x42e0('0x30')];_0x569c8b['order']=qs['sort'](_0x1057a6[_0x42e0('0x2e')]['sort']);_0x569c8b['where']=qs[_0x42e0('0x38')](_[_0x42e0('0x37')](_0x1057a6[_0x42e0('0x2e')],_0x4438fd['filters']));if(_0x1057a6[_0x42e0('0x2e')][_0x42e0('0x39')]){_0x569c8b['where']=_[_0x42e0('0x3a')](_0x569c8b[_0x42e0('0x36')],{'$or':_['map'](_0x569c8b[_0x42e0('0x32')],function(_0x4ec220){var _0xf7a905={};_0xf7a905[_0x4ec220]={'$like':'%'+_0x1057a6['query'][_0x42e0('0x39')]+'%'};return _0xf7a905;})});}_0x569c8b=_[_0x42e0('0x3a')]({},_0x569c8b,_0x1057a6[_0x42e0('0x3c')]);return _0x5400d8['getAllConditions'](_0x569c8b);}})[_0x42e0('0x22')](function(_0x1debe8){if(_0x1debe8){_0x417d00=_0x1debe8['length'];if(!_0x1057a6[_0x42e0('0x2e')][_0x42e0('0x34')]('nolimit')){_0x569c8b[_0x42e0('0x1c')]=qs[_0x42e0('0x1c')](_0x1057a6[_0x42e0('0x2e')][_0x42e0('0x1c')]);_0x569c8b[_0x42e0('0x1a')]=qs['offset'](_0x1057a6['query']['offset']);}return _0x5400d8[_0x42e0('0x4e')](_0x569c8b);}})[_0x42e0('0x22')](function(_0x2893c8){if(_0x2893c8){return _0x2893c8?{'count':_0x417d00,'rows':_0x2893c8}:null;}})[_0x42e0('0x22')](respondWithResult(_0x2489fb,null))[_0x42e0('0x42')](handleError(_0x2489fb,null));};exports['getAnyConditions']=function(_0x10c0d3,_0x48d5f5,_0x1ffc1f){var _0xd6e0a6={};var _0x1151d4={};var _0xd28860;var _0x422852;return db[_0x42e0('0x3d')][_0x42e0('0x4d')]({'where':{'id':_0x10c0d3[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x48d5f5,null))[_0x42e0('0x22')](function(_0x4be62a){if(_0x4be62a){_0xd28860=_0x4be62a;_0x1151d4['model']=_[_0x42e0('0x2d')](db[_0x42e0('0x4c')][_0x42e0('0x2a')]);_0x1151d4[_0x42e0('0x2e')]=_['keys'](_0x10c0d3[_0x42e0('0x2e')]);_0x1151d4[_0x42e0('0x38')]=_['intersection'](_0x1151d4[_0x42e0('0x30')],_0x1151d4[_0x42e0('0x2e')]);_0xd6e0a6[_0x42e0('0x32')]=_[_0x42e0('0x2f')](_0x1151d4[_0x42e0('0x30')],qs[_0x42e0('0x31')](_0x10c0d3['query']['fields']));_0xd6e0a6[_0x42e0('0x32')]=_0xd6e0a6[_0x42e0('0x32')][_0x42e0('0x33')]?_0xd6e0a6[_0x42e0('0x32')]:_0x1151d4['model'];_0xd6e0a6['order']=qs['sort'](_0x10c0d3['query'][_0x42e0('0x35')]);_0xd6e0a6[_0x42e0('0x36')]=qs[_0x42e0('0x38')](_[_0x42e0('0x37')](_0x10c0d3[_0x42e0('0x2e')],_0x1151d4[_0x42e0('0x38')]));if(_0x10c0d3[_0x42e0('0x2e')]['filter']){_0xd6e0a6['where']=_[_0x42e0('0x3a')](_0xd6e0a6['where'],{'$or':_[_0x42e0('0x29')](_0xd6e0a6[_0x42e0('0x32')],function(_0x2eacf3){var _0x593841={};_0x593841[_0x2eacf3]={'$like':'%'+_0x10c0d3['query'][_0x42e0('0x39')]+'%'};return _0x593841;})});}_0xd6e0a6=_[_0x42e0('0x3a')]({},_0xd6e0a6,_0x10c0d3['options']);return _0xd28860[_0x42e0('0x4f')](_0xd6e0a6);}})[_0x42e0('0x22')](function(_0xb7aad9){if(_0xb7aad9){_0x422852=_0xb7aad9[_0x42e0('0x33')];if(!_0x10c0d3[_0x42e0('0x2e')][_0x42e0('0x34')]('nolimit')){_0xd6e0a6['limit']=qs[_0x42e0('0x1c')](_0x10c0d3['query']['limit']);_0xd6e0a6[_0x42e0('0x1a')]=qs['offset'](_0x10c0d3[_0x42e0('0x2e')]['offset']);}return _0xd28860[_0x42e0('0x4f')](_0xd6e0a6);}})[_0x42e0('0x22')](function(_0x3300b4){if(_0x3300b4){return _0x3300b4?{'count':_0x422852,'rows':_0x3300b4}:null;}})[_0x42e0('0x22')](respondWithResult(_0x48d5f5,null))[_0x42e0('0x42')](handleError(_0x48d5f5,null));};exports[_0x42e0('0x50')]=function(_0x1d8c95,_0x15d921,_0x4ef9d9){if(_0x1d8c95['body']['id']){delete _0x1d8c95[_0x42e0('0x49')]['id'];}return db[_0x42e0('0x3d')]['find']({'where':{'id':_0x1d8c95[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x15d921,null))[_0x42e0('0x22')](function(_0x184371){if(_0x184371){_0x1d8c95[_0x42e0('0x49')][_0x42e0('0x51')]=_0x184371['id'];return db[_0x42e0('0x52')][_0x42e0('0x44')](_0x1d8c95[_0x42e0('0x49')]);}})[_0x42e0('0x22')](respondWithResult(_0x15d921,null))[_0x42e0('0x42')](handleError(_0x15d921,null));};exports[_0x42e0('0x53')]=function(_0x4925d2,_0x79f760,_0x3d0b30){var _0x401670={};var _0x327cfd={};var _0xcc7000;var _0x109af4;return db['Trigger'][_0x42e0('0x4d')]({'where':{'id':_0x4925d2[_0x42e0('0x4a')]['id']}})[_0x42e0('0x22')](handleEntityNotFound(_0x79f760,null))['then'](function(_0x18a2c3){if(_0x18a2c3){_0xcc7000=_0x18a2c3;_0x327cfd['model']=_[_0x42e0('0x2d')](db[_0x42e0('0x52')][_0x42e0('0x2a')]);_0x327cfd[_0x42e0('0x2e')]=_[_0x42e0('0x2d')](_0x4925d2[_0x42e0('0x2e')]);_0x327cfd['filters']=_['intersection'](_0x327cfd[_0x42e0('0x30')],_0x327cfd[_0x42e0('0x2e')]);_0x401670['attributes']=_[_0x42e0('0x2f')](_0x327cfd[_0x42e0('0x30')],qs['fields'](_0x4925d2[_0x42e0('0x2e')][_0x42e0('0x31')]));_0x401670[_0x42e0('0x32')]=_0x401670[_0x42e0('0x32')][_0x42e0('0x33')]?_0x401670[_0x42e0('0x32')]:_0x327cfd[_0x42e0('0x30')];_0x401670[_0x42e0('0x54')]=qs['sort'](_0x4925d2[_0x42e0('0x2e')][_0x42e0('0x35')]);_0x401670[_0x42e0('0x36')]=qs['filters'](_[_0x42e0('0x37')](_0x4925d2[_0x42e0('0x2e')],_0x327cfd[_0x42e0('0x38')]));if(_0x4925d2[_0x42e0('0x2e')][_0x42e0('0x39')]){_0x401670['where']=_[_0x42e0('0x3a')](_0x401670[_0x42e0('0x36')],{'$or':_[_0x42e0('0x29')](_0x401670[_0x42e0('0x32')],function(_0x580270){var _0x4e4856={};_0x4e4856[_0x580270]={'$like':'%'+_0x4925d2[_0x42e0('0x2e')]['filter']+'%'};return _0x4e4856;})});}_0x401670=_[_0x42e0('0x3a')]({},_0x401670,_0x4925d2[_0x42e0('0x3c')]);return _0xcc7000[_0x42e0('0x53')](_0x401670);}})[_0x42e0('0x22')](function(_0x511632){if(_0x511632){_0x109af4=_0x511632[_0x42e0('0x33')];if(!_0x4925d2[_0x42e0('0x2e')]['hasOwnProperty'](_0x42e0('0x55'))){_0x401670[_0x42e0('0x1c')]=qs[_0x42e0('0x1c')](_0x4925d2[_0x42e0('0x2e')][_0x42e0('0x1c')]);_0x401670[_0x42e0('0x1a')]=qs[_0x42e0('0x1a')](_0x4925d2[_0x42e0('0x2e')][_0x42e0('0x1a')]);}return _0xcc7000[_0x42e0('0x53')](_0x401670);}})[_0x42e0('0x22')](function(_0xa72396){if(_0xa72396){return _0xa72396?{'count':_0x109af4,'rows':_0xa72396}:null;}})[_0x42e0('0x22')](respondWithResult(_0x79f760,null))[_0x42e0('0x42')](handleError(_0x79f760,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0d90065..dc87c07 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 _0x956a=['request-promise','path','rimraf','exports','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird'];(function(_0x22136d,_0x4c9f22){var _0x49397d=function(_0x354b01){while(--_0x354b01){_0x22136d['push'](_0x22136d['shift']());}};_0x49397d(++_0x4c9f22);}(_0x956a,0xb6));var _0xa956=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x956a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa956('0x0'));var logger=require(_0xa956('0x1'))(_0xa956('0x2'));var moment=require(_0xa956('0x3'));var BPromise=require(_0xa956('0x4'));var rp=require(_0xa956('0x5'));var fs=require('fs');var path=require(_0xa956('0x6'));var rimraf=require(_0xa956('0x7'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0xa956('0x8')]=function(_0x2b9675,_0x2ce2c8){return _0x2b9675['define'](_0xa956('0x9'),attributes,{'tableName':_0xa956('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b67=['path','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5bad8d,_0x2ff6aa){var _0x321911=function(_0x231063){while(--_0x231063){_0x5bad8d['push'](_0x5bad8d['shift']());}};_0x321911(++_0x2ff6aa);}(_0x9b67,0xf6));var _0x79b6=function(_0x1b2a29,_0xd683b3){_0x1b2a29=_0x1b2a29-0x0;var _0xa06492=_0x9b67[_0x1b2a29];return _0xa06492;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));module[_0x79b6('0x8')]=function(_0x258103,_0xec367e){return _0x258103[_0x79b6('0x9')](_0x79b6('0xa'),attributes,{'tableName':_0x79b6('0xb'),'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 f8dd9c9..8c5f44e 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 _0xab67=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','lodash','util','moment','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xab67,0x1f4));var _0x7ab6=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0xab67[_0x214d54];return _0x44ca46;};'use strict';var _=require(_0x7ab6('0x0'));var util=require(_0x7ab6('0x1'));var moment=require(_0x7ab6('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ab6('0x3'));var fs=require('fs');var Redis=require(_0x7ab6('0x4'));var db=require(_0x7ab6('0x5'))['db'];var utils=require(_0x7ab6('0x6'));var logger=require(_0x7ab6('0x7'))(_0x7ab6('0x8'));var config=require(_0x7ab6('0x9'));var jayson=require(_0x7ab6('0xa'));var client=jayson[_0x7ab6('0xb')][_0x7ab6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x327de2,_0x4541c9,_0x4eab16){return new BPromise(function(_0x4eb032,_0x56137b){return client['request'](_0x327de2,_0x4eab16)[_0x7ab6('0xd')](function(_0x525da8){logger['info'](_0x7ab6('0xe'),_0x4541c9,'request\x20sent');logger[_0x7ab6('0xf')](_0x7ab6('0x10'),_0x4541c9,_0x7ab6('0x11'),JSON[_0x7ab6('0x12')](_0x525da8));if(_0x525da8[_0x7ab6('0x13')]){if(_0x525da8[_0x7ab6('0x13')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x4541c9,_0x525da8[_0x7ab6('0x13')][_0x7ab6('0x14')]);return _0x56137b(_0x525da8[_0x7ab6('0x13')][_0x7ab6('0x14')]);}logger[_0x7ab6('0x13')]('Trigger,\x20%s,\x20%s',_0x4541c9,_0x525da8[_0x7ab6('0x13')][_0x7ab6('0x14')]);return _0x4eb032(_0x525da8['error'][_0x7ab6('0x14')]);}else{logger[_0x7ab6('0x15')](_0x7ab6('0xe'),_0x4541c9,_0x7ab6('0x11'));_0x4eb032(_0x525da8[_0x7ab6('0x16')][_0x7ab6('0x14')]);}})[_0x7ab6('0x17')](function(_0x26328e){logger[_0x7ab6('0x13')](_0x7ab6('0xe'),_0x4541c9,_0x26328e);_0x56137b(_0x26328e);});});}exports['GetTrigger']=function(_0x4efb7f){var _0x199d3c=this;return new Promise(function(_0x244980,_0x29146e){return db[_0x7ab6('0x18')][_0x7ab6('0x19')]({'raw':_0x4efb7f[_0x7ab6('0x1a')]?_0x4efb7f[_0x7ab6('0x1a')][_0x7ab6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4efb7f[_0x7ab6('0x1a')]?_0x4efb7f[_0x7ab6('0x1a')][_0x7ab6('0x1c')]||null:null,'attributes':_0x4efb7f['options']?_0x4efb7f[_0x7ab6('0x1a')][_0x7ab6('0x1d')]||null:null,'limit':_0x4efb7f[_0x7ab6('0x1a')]?_0x4efb7f['options'][_0x7ab6('0x1e')]||null:null,'include':_0x4efb7f[_0x7ab6('0x1a')]?_0x4efb7f['options'][_0x7ab6('0x1f')]?_[_0x7ab6('0x20')](_0x4efb7f[_0x7ab6('0x1a')][_0x7ab6('0x1f')],function(_0x35f3b6){return{'model':db[_0x35f3b6['model']],'as':_0x35f3b6['as'],'attributes':_0x35f3b6[_0x7ab6('0x1d')],'include':_0x35f3b6[_0x7ab6('0x1f')]?_[_0x7ab6('0x20')](_0x35f3b6['include'],function(_0x5dc2c7){return{'model':db[_0x5dc2c7[_0x7ab6('0x21')]],'as':_0x5dc2c7['as'],'attributes':_0x5dc2c7['attributes'],'include':_0x5dc2c7[_0x7ab6('0x1f')]?_[_0x7ab6('0x20')](_0x5dc2c7[_0x7ab6('0x1f')],function(_0x2fc5a8){return{'model':db[_0x2fc5a8[_0x7ab6('0x21')]],'as':_0x2fc5a8['as'],'attributes':_0x2fc5a8[_0x7ab6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7ab6('0xd')](function(_0x41e682){logger[_0x7ab6('0x15')](_0x7ab6('0x22'),_0x4efb7f);logger[_0x7ab6('0xf')](_0x7ab6('0x22'),_0x4efb7f,JSON['stringify'](_0x41e682));_0x244980(_0x41e682);})['catch'](function(_0x518e2c){logger['error'](_0x7ab6('0x22'),_0x518e2c[_0x7ab6('0x14')],_0x4efb7f);_0x29146e(_0x199d3c['error'](0x1f4,_0x518e2c[_0x7ab6('0x14')]));});});};exports[_0x7ab6('0x23')]=function(_0x4a306f){var _0xcb467e=this;return new Promise(function(_0x262345,_0x2ce9d4){return db[_0x7ab6('0x18')]['find']({'raw':_0x4a306f[_0x7ab6('0x1a')]?_0x4a306f['options'][_0x7ab6('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a306f['options']?_0x4a306f[_0x7ab6('0x1a')]['where']||null:null,'attributes':_0x4a306f[_0x7ab6('0x1a')]?_0x4a306f[_0x7ab6('0x1a')][_0x7ab6('0x1d')]||null:null,'include':_0x4a306f[_0x7ab6('0x1a')]?_0x4a306f[_0x7ab6('0x1a')][_0x7ab6('0x1f')]?_[_0x7ab6('0x20')](_0x4a306f[_0x7ab6('0x1a')][_0x7ab6('0x1f')],function(_0x22af90){return{'model':db[_0x22af90[_0x7ab6('0x21')]],'as':_0x22af90['as'],'attributes':_0x22af90['attributes'],'include':_0x22af90['include']?_[_0x7ab6('0x20')](_0x22af90[_0x7ab6('0x1f')],function(_0x41ad74){return{'model':db[_0x41ad74[_0x7ab6('0x21')]],'as':_0x41ad74['as'],'attributes':_0x41ad74[_0x7ab6('0x1d')],'include':_0x41ad74['include']?_['map'](_0x41ad74[_0x7ab6('0x1f')],function(_0x136464){return{'model':db[_0x136464[_0x7ab6('0x21')]],'as':_0x136464['as'],'attributes':_0x136464[_0x7ab6('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7ab6('0xd')](function(_0x279f75){logger[_0x7ab6('0x15')](_0x7ab6('0x23'),_0x4a306f);logger[_0x7ab6('0xf')]('ShowTrigger',_0x4a306f,JSON[_0x7ab6('0x12')](_0x279f75));_0x262345(_0x279f75);})[_0x7ab6('0x17')](function(_0x5b7640){logger['error'](_0x7ab6('0x23'),_0x5b7640[_0x7ab6('0x14')],_0x4a306f);_0x2ce9d4(_0xcb467e[_0x7ab6('0x13')](0x1f4,_0x5b7640[_0x7ab6('0x14')]));});});}; \ No newline at end of file +var _0x00c1=['where','attributes','limit','map','include','model','ShowTrigger','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','options','raw'];(function(_0x59012e,_0x54c78f){var _0x4f6ab5=function(_0x3958bd){while(--_0x3958bd){_0x59012e['push'](_0x59012e['shift']());}};_0x4f6ab5(++_0x54c78f);}(_0x00c1,0x128));var _0x100c=function(_0x570de5,_0x41a2d5){_0x570de5=_0x570de5-0x0;var _0x3dce05=_0x00c1[_0x570de5];return _0x3dce05;};'use strict';var _=require(_0x100c('0x0'));var util=require('util');var moment=require(_0x100c('0x1'));var BPromise=require(_0x100c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x100c('0x3'));var db=require(_0x100c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x100c('0x5'))(_0x100c('0x6'));var config=require(_0x100c('0x7'));var jayson=require(_0x100c('0x8'));var client=jayson[_0x100c('0x9')][_0x100c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16a00a,_0x43f8e4,_0x64e985){return new BPromise(function(_0x1f72d0,_0x1e4842){return client[_0x100c('0xb')](_0x16a00a,_0x64e985)[_0x100c('0xc')](function(_0x4516f0){logger[_0x100c('0xd')](_0x100c('0xe'),_0x43f8e4,_0x100c('0xf'));logger[_0x100c('0x10')](_0x100c('0x11'),_0x43f8e4,_0x100c('0xf'),JSON[_0x100c('0x12')](_0x4516f0));if(_0x4516f0[_0x100c('0x13')]){if(_0x4516f0['error'][_0x100c('0x14')]===0x1f4){logger['error'](_0x100c('0xe'),_0x43f8e4,_0x4516f0[_0x100c('0x13')]['message']);return _0x1e4842(_0x4516f0['error']['message']);}logger[_0x100c('0x13')](_0x100c('0xe'),_0x43f8e4,_0x4516f0[_0x100c('0x13')][_0x100c('0x15')]);return _0x1f72d0(_0x4516f0[_0x100c('0x13')][_0x100c('0x15')]);}else{logger[_0x100c('0xd')](_0x100c('0xe'),_0x43f8e4,_0x100c('0xf'));_0x1f72d0(_0x4516f0[_0x100c('0x16')][_0x100c('0x15')]);}})[_0x100c('0x17')](function(_0x4955e1){logger[_0x100c('0x13')](_0x100c('0xe'),_0x43f8e4,_0x4955e1);_0x1e4842(_0x4955e1);});});}exports[_0x100c('0x18')]=function(_0x4aac03){var _0xb0015a=this;return new Promise(function(_0x2bfc9b,_0x44b01e){return db[_0x100c('0x19')]['findAll']({'raw':_0x4aac03[_0x100c('0x1a')]?_0x4aac03['options'][_0x100c('0x1b')]===undefined?!![]:![]:!![],'where':_0x4aac03[_0x100c('0x1a')]?_0x4aac03[_0x100c('0x1a')][_0x100c('0x1c')]||null:null,'attributes':_0x4aac03[_0x100c('0x1a')]?_0x4aac03[_0x100c('0x1a')][_0x100c('0x1d')]||null:null,'limit':_0x4aac03[_0x100c('0x1a')]?_0x4aac03[_0x100c('0x1a')][_0x100c('0x1e')]||null:null,'include':_0x4aac03[_0x100c('0x1a')]?_0x4aac03['options']['include']?_[_0x100c('0x1f')](_0x4aac03['options'][_0x100c('0x20')],function(_0x479ea9){return{'model':db[_0x479ea9[_0x100c('0x21')]],'as':_0x479ea9['as'],'attributes':_0x479ea9[_0x100c('0x1d')],'include':_0x479ea9['include']?_[_0x100c('0x1f')](_0x479ea9[_0x100c('0x20')],function(_0x541e59){return{'model':db[_0x541e59[_0x100c('0x21')]],'as':_0x541e59['as'],'attributes':_0x541e59[_0x100c('0x1d')],'include':_0x541e59[_0x100c('0x20')]?_[_0x100c('0x1f')](_0x541e59[_0x100c('0x20')],function(_0x5dee07){return{'model':db[_0x5dee07[_0x100c('0x21')]],'as':_0x5dee07['as'],'attributes':_0x5dee07[_0x100c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x100c('0xc')](function(_0x557a15){logger[_0x100c('0xd')](_0x100c('0x18'),_0x4aac03);logger[_0x100c('0x10')]('GetTrigger',_0x4aac03,JSON['stringify'](_0x557a15));_0x2bfc9b(_0x557a15);})[_0x100c('0x17')](function(_0x39eb95){logger[_0x100c('0x13')](_0x100c('0x18'),_0x39eb95[_0x100c('0x15')],_0x4aac03);_0x44b01e(_0xb0015a[_0x100c('0x13')](0x1f4,_0x39eb95[_0x100c('0x15')]));});});};exports[_0x100c('0x22')]=function(_0x513f87){var _0x3d19b5=this;return new Promise(function(_0x20da09,_0x1ddd10){return db['Trigger'][_0x100c('0x23')]({'raw':_0x513f87[_0x100c('0x1a')]?_0x513f87[_0x100c('0x1a')][_0x100c('0x1b')]===undefined?!![]:![]:!![],'where':_0x513f87['options']?_0x513f87['options']['where']||null:null,'attributes':_0x513f87[_0x100c('0x1a')]?_0x513f87[_0x100c('0x1a')][_0x100c('0x1d')]||null:null,'include':_0x513f87[_0x100c('0x1a')]?_0x513f87['options'][_0x100c('0x20')]?_['map'](_0x513f87[_0x100c('0x1a')][_0x100c('0x20')],function(_0x17a714){return{'model':db[_0x17a714[_0x100c('0x21')]],'as':_0x17a714['as'],'attributes':_0x17a714[_0x100c('0x1d')],'include':_0x17a714[_0x100c('0x20')]?_[_0x100c('0x1f')](_0x17a714[_0x100c('0x20')],function(_0x4f1a01){return{'model':db[_0x4f1a01[_0x100c('0x21')]],'as':_0x4f1a01['as'],'attributes':_0x4f1a01['attributes'],'include':_0x4f1a01['include']?_[_0x100c('0x1f')](_0x4f1a01['include'],function(_0x4daeed){return{'model':db[_0x4daeed[_0x100c('0x21')]],'as':_0x4daeed['as'],'attributes':_0x4daeed['attributes']};}):[]};}):[]};}):[]:[]})[_0x100c('0xc')](function(_0x1cc2b3){logger[_0x100c('0xd')]('ShowTrigger',_0x513f87);logger[_0x100c('0x10')](_0x100c('0x22'),_0x513f87,JSON[_0x100c('0x12')](_0x1cc2b3));_0x20da09(_0x1cc2b3);})[_0x100c('0x17')](function(_0x268d51){logger[_0x100c('0x13')](_0x100c('0x22'),_0x268d51['message'],_0x513f87);_0x1ddd10(_0x3d19b5[_0x100c('0x13')](0x1f4,_0x268d51[_0x100c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index fd64092..aac97ee 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 _0xab97=['index','/:id','show','post','clone','isAuthenticated','create','put','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./trunk.controller','get'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0xab97,0x190));var _0x7ab9=function(_0x5efde4,_0x131166){_0x5efde4=_0x5efde4-0x0;var _0x1e5abd=_0xab97[_0x5efde4];return _0x1e5abd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7ab9('0x0'));var timeout=require(_0x7ab9('0x1'));var express=require(_0x7ab9('0x2'));var router=express[_0x7ab9('0x3')]();var fs_extra=require(_0x7ab9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7ab9('0x5'));var config=require('../../config/environment');var controller=require(_0x7ab9('0x6'));router[_0x7ab9('0x7')]('/',auth['isAuthenticated'](),controller[_0x7ab9('0x8')]);router[_0x7ab9('0x7')](_0x7ab9('0x9'),auth['isAuthenticated'](),controller[_0x7ab9('0xa')]);router[_0x7ab9('0xb')]('/:id/clone',auth['isAuthenticated'](),controller[_0x7ab9('0xc')]);router[_0x7ab9('0xb')]('/',auth[_0x7ab9('0xd')](),controller[_0x7ab9('0xe')]);router[_0x7ab9('0xf')](_0x7ab9('0x9'),auth[_0x7ab9('0xd')](),controller['update']);router['delete'](_0x7ab9('0x9'),auth[_0x7ab9('0xd')](),controller[_0x7ab9('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcce7=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','index','get','/:id','show','post','isAuthenticated','clone','create','put','delete','destroy','exports'];(function(_0x4d8f83,_0x129522){var _0x132f03=function(_0x230c7c){while(--_0x230c7c){_0x4d8f83['push'](_0x4d8f83['shift']());}};_0x132f03(++_0x129522);}(_0xcce7,0x18f));var _0x7cce=function(_0x321e88,_0xfc4b5){_0x321e88=_0x321e88-0x0;var _0x4194c9=_0xcce7[_0x321e88];return _0x4194c9;};'use strict';var multer=require(_0x7cce('0x0'));var util=require(_0x7cce('0x1'));var path=require(_0x7cce('0x2'));var timeout=require(_0x7cce('0x3'));var express=require('express');var router=express[_0x7cce('0x4')]();var fs_extra=require(_0x7cce('0x5'));var auth=require(_0x7cce('0x6'));var interaction=require(_0x7cce('0x7'));var config=require('../../config/environment');var controller=require(_0x7cce('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7cce('0x9')]);router[_0x7cce('0xa')](_0x7cce('0xb'),auth['isAuthenticated'](),controller[_0x7cce('0xc')]);router[_0x7cce('0xd')]('/:id/clone',auth[_0x7cce('0xe')](),controller[_0x7cce('0xf')]);router['post']('/',auth[_0x7cce('0xe')](),controller[_0x7cce('0x10')]);router[_0x7cce('0x11')](_0x7cce('0xb'),auth[_0x7cce('0xe')](),controller['update']);router[_0x7cce('0x12')](_0x7cce('0xb'),auth[_0x7cce('0xe')](),controller[_0x7cce('0x13')]);module[_0x7cce('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 27fc4a6..b11c307 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 _0x6594=['always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','setDataValue','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER'];(function(_0xb4ebea,_0x55e3ab){var _0x95e734=function(_0x6a6150){while(--_0x6a6150){_0xb4ebea['push'](_0xb4ebea['shift']());}};_0x95e734(++_0x55e3ab);}(_0x6594,0x17b));var _0x4659=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0x6594[_0x53fe97];return _0x5c49a2;};'use strict';var Sequelize=require(_0x4659('0x0'));module[_0x4659('0x1')]={'name':{'type':Sequelize[_0x4659('0x2')],'allowNull':![],'unique':_0x4659('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0x4659('0x5')},'context':{'type':Sequelize[_0x4659('0x2')],'allowNull':![],'defaultValue':_0x4659('0x6')},'callingpres':{'type':Sequelize[_0x4659('0x4')]('ALLOWED_NOT_SCREENED',_0x4659('0x7'),_0x4659('0x8'),_0x4659('0x9'),_0x4659('0xa'),_0x4659('0xb'),'PROHIB_FAILED_SCREEN',_0x4659('0xc'))},'deny':{'type':Sequelize[_0x4659('0x2')]},'permit':{'type':Sequelize[_0x4659('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4659('0x2')]},'remotesecret':{'type':Sequelize[_0x4659('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x17b469){this['setDataValue'](_0x4659('0xd'),_0x17b469?_0x17b469[_0x4659('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x4659('0xd'))?this[_0x4659('0xf')](_0x4659('0xd'))[_0x4659('0x10')](','):null;},'comment':_0x4659('0x11')},'dtmfmode':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x12'),_0x4659('0x13'),_0x4659('0x14'),_0x4659('0x15'),_0x4659('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no',_0x4659('0x18'),'update',_0x4659('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x4659('0x2')]},'nat':{'type':Sequelize[_0x4659('0x2')],'defaultValue':'force_rport,comedia','set':function(_0xfc77bd){this[_0x4659('0x1a')](_0x4659('0x1b'),_0xfc77bd?_0xfc77bd['join'](','):null);},'get':function(){return this['getDataValue'](_0x4659('0x1b'))?this[_0x4659('0xf')](_0x4659('0x1b'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4659('0x2')]},'namedcallgroup':{'type':Sequelize[_0x4659('0x2')]},'pickupgroup':{'type':Sequelize[_0x4659('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4659('0x2')]},'language':{'type':Sequelize[_0x4659('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4659('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4659('0x2')],'defaultValue':_0x4659('0x1c')},'allow':{'type':Sequelize[_0x4659('0x2')],'allowNull':![],'defaultValue':_0x4659('0x1d'),'set':function(_0xa3c8cc){this[_0x4659('0x1a')]('allow',_0xa3c8cc?_0xa3c8cc[_0x4659('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4659('0xf')](_0x4659('0x1e'))?this[_0x4659('0xf')](_0x4659('0x1e'))[_0x4659('0x10')](';'):null;},'comment':_0x4659('0x1f')},'autoframing':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'insecure':{'type':Sequelize[_0x4659('0x2')],'defaultValue':_0x4659('0x20'),'set':function(_0xca7acb){this[_0x4659('0x1a')](_0x4659('0x21'),_0xca7acb?_0xca7acb[_0x4659('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x4659('0x21'))?this[_0x4659('0xf')](_0x4659('0x21'))['split'](','):null;},'comment':_0x4659('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no',_0x4659('0x23'))},'promiscredir':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'accountcode':{'type':Sequelize[_0x4659('0x24')](0xb)},'setvar':{'type':Sequelize[_0x4659('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4659('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no'),'defaultValue':_0x4659('0x17')},'busylevel':{'type':Sequelize[_0x4659('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x4659('0x2')]},'template':{'type':Sequelize[_0x4659('0x2')]},'videosupport':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no',_0x4659('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4659('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no')},'mailbox':{'type':Sequelize[_0x4659('0x2')]},'session_timers':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x26'),_0x4659('0x27'),_0x4659('0x28'))},'session_expires':{'type':Sequelize[_0x4659('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x29'),_0x4659('0x2a')),'defaultValue':_0x4659('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x4659('0x2')]},'fromdomain':{'type':Sequelize[_0x4659('0x2')]},'fromuser':{'type':Sequelize[_0x4659('0x2')]},'port':{'type':Sequelize[_0x4659('0x24')](0x5)},'qualify':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no'),'defaultValue':_0x4659('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4659('0x2')]},'defaultuser':{'type':Sequelize[_0x4659('0x2')]},'rtptimeout':{'type':Sequelize[_0x4659('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4659('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4659('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4659('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4659('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x4659('0x2')]},'contactdeny':{'type':Sequelize[_0x4659('0x2')]},'contactacl':{'type':Sequelize[_0x4659('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4659('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4659('0x2')]},'maxforwards':{'type':Sequelize[_0x4659('0x24')](0xb)},'encryption':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no')},'force_avp':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'icesupport':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x4659('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no',_0x4659('0x2b'),_0x4659('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x4659('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4659('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4659('0x2')]},'dtlscipher':{'type':Sequelize[_0x4659('0x2')]},'dtlscafile':{'type':Sequelize[_0x4659('0x2')]},'dtlscapath':{'type':Sequelize[_0x4659('0x2')]},'dtlssetup':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x2d'),_0x4659('0x2e'),_0x4659('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4659('0x2')]},'usereqphone':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x4659('0x2')]},'call_limit':{'type':Sequelize[_0x4659('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no')},'vmexten':{'type':Sequelize[_0x4659('0x2')]},'mohinterpret':{'type':Sequelize[_0x4659('0x2')]},'mohsuggest':{'type':Sequelize[_0x4659('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4659('0x2')]},'host':{'type':Sequelize[_0x4659('0x2')],'defaultValue':_0x4659('0x30')},'canreinvite':{'type':Sequelize[_0x4659('0x4')](_0x4659('0x17'),'no','nonat',_0x4659('0x31'),_0x4659('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4659('0x2')]},'otherFields':{'type':Sequelize[_0x4659('0x2')]},'active':{'type':Sequelize[_0x4659('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4659('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xd46f=['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','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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','originate','uac','uas','pai','fingerprint','active','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0xd46f,0x136));var _0xfd46=function(_0x40c5fb,_0x3af269){_0x40c5fb=_0x40c5fb-0x0;var _0x341acb=_0xd46f[_0x40c5fb];return _0x341acb;};'use strict';var Sequelize=require(_0xfd46('0x0'));module[_0xfd46('0x1')]={'name':{'type':Sequelize[_0xfd46('0x2')],'allowNull':![],'unique':_0xfd46('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x5'),_0xfd46('0x6'),_0xfd46('0x7')),'allowNull':![],'defaultValue':_0xfd46('0x5')},'context':{'type':Sequelize[_0xfd46('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x8'),_0xfd46('0x9'),_0xfd46('0xa'),_0xfd46('0xb'),_0xfd46('0xc'),_0xfd46('0xd'),_0xfd46('0xe'),_0xfd46('0xf'))},'deny':{'type':Sequelize[_0xfd46('0x2')]},'permit':{'type':Sequelize[_0xfd46('0x2')]},'secret':{'type':Sequelize[_0xfd46('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xfd46('0x2')]},'transport':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':'udp','set':function(_0x1fb315){this[_0xfd46('0x10')](_0xfd46('0x11'),_0x1fb315?_0x1fb315[_0xfd46('0x12')](','):null);},'get':function(){return this[_0xfd46('0x13')]('transport')?this['getDataValue']('transport')[_0xfd46('0x14')](','):null;},'comment':_0xfd46('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0xfd46('0x16'),_0xfd46('0x17'),_0xfd46('0x18'),_0xfd46('0x19'),'auto'),'defaultValue':_0xfd46('0x16')},'directmedia':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no',_0xfd46('0x1b'),_0xfd46('0x1c'),_0xfd46('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfd46('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':_0xfd46('0x1e'),'set':function(_0x194ff1){this[_0xfd46('0x10')](_0xfd46('0x1f'),_0x194ff1?_0x194ff1[_0xfd46('0x12')](','):null);},'get':function(){return this[_0xfd46('0x13')]('nat')?this[_0xfd46('0x13')](_0xfd46('0x1f'))[_0xfd46('0x14')](','):null;},'comment':_0xfd46('0x20')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xfd46('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xfd46('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfd46('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':_0xfd46('0x21')},'allow':{'type':Sequelize[_0xfd46('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x8ad3e4){this[_0xfd46('0x10')](_0xfd46('0x22'),_0x8ad3e4?_0x8ad3e4[_0xfd46('0x12')](';'):_0xfd46('0x23'));},'get':function(){return this[_0xfd46('0x13')](_0xfd46('0x22'))?this[_0xfd46('0x13')](_0xfd46('0x22'))[_0xfd46('0x14')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'insecure':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':_0xfd46('0x24'),'set':function(_0xbd240){this[_0xfd46('0x10')](_0xfd46('0x25'),_0xbd240?_0xbd240[_0xfd46('0x12')](','):null);},'get':function(){return this[_0xfd46('0x13')](_0xfd46('0x25'))?this[_0xfd46('0x13')](_0xfd46('0x25'))[_0xfd46('0x14')](','):null;},'comment':_0xfd46('0x26')},'trustrpid':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no',_0xfd46('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xfd46('0x28')](0xb)},'setvar':{'type':Sequelize[_0xfd46('0x2')]},'callerid':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':_0xfd46('0x29')},'amaflags':{'type':Sequelize[_0xfd46('0x2')]},'callcounter':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no'),'defaultValue':_0xfd46('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xfd46('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xfd46('0x2')]},'template':{'type':Sequelize[_0xfd46('0x2')]},'videosupport':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no',_0xfd46('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfd46('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xfd46('0x4')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xfd46('0x2b'),_0xfd46('0x2c'),_0xfd46('0x2d'))},'session_expires':{'type':Sequelize[_0xfd46('0x28')](0xb)},'session_minse':{'type':Sequelize[_0xfd46('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x2e'),_0xfd46('0x2f')),'defaultValue':_0xfd46('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0xfd46('0x2')]},'regexten':{'type':Sequelize[_0xfd46('0x2')]},'fromdomain':{'type':Sequelize[_0xfd46('0x2')]},'fromuser':{'type':Sequelize[_0xfd46('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xfd46('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xfd46('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xfd46('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no',_0xfd46('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xfd46('0x2')]},'timert1':{'type':Sequelize[_0xfd46('0x28')](0xb)},'timerb':{'type':Sequelize[_0xfd46('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xfd46('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xfd46('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xfd46('0x2')]},'use_q850_reason':{'type':Sequelize[_0xfd46('0x2')]},'maxforwards':{'type':Sequelize[_0xfd46('0x28')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xfd46('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xfd46('0x1a'),'no',_0xfd46('0x31'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xfd46('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xfd46('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xfd46('0x2')]},'dtlscapath':{'type':Sequelize[_0xfd46('0x2')]},'dtlssetup':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x32'),'passive',_0xfd46('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfd46('0x2')]},'usereqphone':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd46('0x2')]},'recordofffeature':{'type':Sequelize[_0xfd46('0x2')]},'call_limit':{'type':Sequelize[_0xfd46('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xfd46('0x2')]},'mohinterpret':{'type':Sequelize[_0xfd46('0x2')]},'mohsuggest':{'type':Sequelize[_0xfd46('0x2')]},'parkinglot':{'type':Sequelize[_0xfd46('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':_0xfd46('0x34')},'canreinvite':{'type':Sequelize[_0xfd46('0x4')](_0xfd46('0x1a'),'no','nonat',_0xfd46('0x1c'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xfd46('0x2')]},'otherFields':{'type':Sequelize[_0xfd46('0x2')]},'active':{'type':Sequelize[_0xfd46('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xfd46('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 39356d5..981f613 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 _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x84ab,0x12f));var _0xb84a=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x84ab[_0x1ba43c];return _0x2f60eb;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0xe5b3,0x133));var _0x3e5b=function(_0x469bff,_0x2aad22){_0x469bff=_0x469bff-0x0;var _0x47bff2=_0xe5b3[_0x469bff];return _0x47bff2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0929d54..7d72f69 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 _0x0c8c=['Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x3231b6,_0x1b492a){var _0x18b738=function(_0x25e9df){while(--_0x25e9df){_0x3231b6['push'](_0x3231b6['shift']());}};_0x18b738(++_0x1b492a);}(_0x0c8c,0x1b4));var _0xc0c8=function(_0x50c813,_0x45b260){_0x50c813=_0x50c813-0x0;var _0x1515ad=_0x0c8c[_0x50c813];return _0x1515ad;};'use strict';var _=require(_0xc0c8('0x0'));var util=require(_0xc0c8('0x1'));var logger=require(_0xc0c8('0x2'))(_0xc0c8('0x3'));var moment=require(_0xc0c8('0x4'));var BPromise=require(_0xc0c8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0c8('0x6'));var rimraf=require(_0xc0c8('0x7'));var config=require(_0xc0c8('0x8'));var attributes=require(_0xc0c8('0x9'));module[_0xc0c8('0xa')]=function(_0x427ab5,_0x4efaa1){return _0x427ab5[_0xc0c8('0xb')](_0xc0c8('0xc'),attributes,{'tableName':_0xc0c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f4a=['../../config/logger','moment','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4f4a,0x1ac));var _0xa4f4=function(_0x319df2,_0x4085fb){_0x319df2=_0x319df2-0x0;var _0x41f9df=_0x4f4a[_0x319df2];return _0x41f9df;};'use strict';var _=require(_0xa4f4('0x0'));var util=require('util');var logger=require(_0xa4f4('0x1'))('api');var moment=require(_0xa4f4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4f4('0x3'));var rimraf=require(_0xa4f4('0x4'));var config=require(_0xa4f4('0x5'));var attributes=require(_0xa4f4('0x6'));module[_0xa4f4('0x7')]=function(_0x271911,_0x3e4cae){return _0x271911[_0xa4f4('0x8')](_0xa4f4('0x9'),attributes,{'tableName':_0xa4f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index baa5172..83feb94 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 _0x9684=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','info','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','model','map','attributes','stringify','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis'];(function(_0x19f56c,_0x485369){var _0x3ddd21=function(_0x143496){while(--_0x143496){_0x19f56c['push'](_0x19f56c['shift']());}};_0x3ddd21(++_0x485369);}(_0x9684,0xf0));var _0x4968=function(_0x336c2c,_0x19b2cc){_0x336c2c=_0x336c2c-0x0;var _0x304a77=_0x9684[_0x336c2c];return _0x304a77;};'use strict';var _=require('lodash');var util=require(_0x4968('0x0'));var moment=require(_0x4968('0x1'));var BPromise=require(_0x4968('0x2'));var rs=require(_0x4968('0x3'));var fs=require('fs');var Redis=require(_0x4968('0x4'));var db=require(_0x4968('0x5'))['db'];var utils=require(_0x4968('0x6'));var logger=require(_0x4968('0x7'))(_0x4968('0x8'));var config=require(_0x4968('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4968('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24660e,_0x4038ef,_0x3f85de){return new BPromise(function(_0x38d888,_0x432f23){return client['request'](_0x24660e,_0x3f85de)[_0x4968('0xb')](function(_0x32fc38){logger['info']('Trunk,\x20%s,\x20%s',_0x4038ef,_0x4968('0xc'));logger[_0x4968('0xd')](_0x4968('0xe'),_0x4038ef,_0x4968('0xc'),JSON['stringify'](_0x32fc38));if(_0x32fc38[_0x4968('0xf')]){if(_0x32fc38[_0x4968('0xf')][_0x4968('0x10')]===0x1f4){logger[_0x4968('0xf')](_0x4968('0x11'),_0x4038ef,_0x32fc38['error']['message']);return _0x432f23(_0x32fc38[_0x4968('0xf')][_0x4968('0x12')]);}logger['error'](_0x4968('0x11'),_0x4038ef,_0x32fc38[_0x4968('0xf')]['message']);return _0x38d888(_0x32fc38[_0x4968('0xf')][_0x4968('0x12')]);}else{logger[_0x4968('0x13')]('Trunk,\x20%s,\x20%s',_0x4038ef,'request\x20sent');_0x38d888(_0x32fc38['result'][_0x4968('0x12')]);}})[_0x4968('0x14')](function(_0x328a6f){logger[_0x4968('0xf')](_0x4968('0x11'),_0x4038ef,_0x328a6f);_0x432f23(_0x328a6f);});});}exports[_0x4968('0x15')]=function(_0x51afa9){var _0x5b12db=this;return new Promise(function(_0x435af1,_0x4b0cac){return db[_0x4968('0x16')][_0x4968('0x17')]({'raw':_0x51afa9[_0x4968('0x18')]?_0x51afa9[_0x4968('0x18')][_0x4968('0x19')]===undefined?!![]:![]:!![],'where':_0x51afa9[_0x4968('0x18')]?_0x51afa9[_0x4968('0x18')][_0x4968('0x1a')]||null:null,'attributes':_0x51afa9['options']?_0x51afa9['options']['attributes']||null:null,'limit':_0x51afa9[_0x4968('0x18')]?_0x51afa9[_0x4968('0x18')][_0x4968('0x1b')]||null:null,'include':_0x51afa9[_0x4968('0x18')]?_0x51afa9[_0x4968('0x18')][_0x4968('0x1c')]?_['map'](_0x51afa9['options']['include'],function(_0x47e4ff){return{'model':db[_0x47e4ff[_0x4968('0x1d')]],'as':_0x47e4ff['as'],'attributes':_0x47e4ff['attributes'],'include':_0x47e4ff['include']?_[_0x4968('0x1e')](_0x47e4ff[_0x4968('0x1c')],function(_0x20dcd8){return{'model':db[_0x20dcd8[_0x4968('0x1d')]],'as':_0x20dcd8['as'],'attributes':_0x20dcd8[_0x4968('0x1f')],'include':_0x20dcd8['include']?_['map'](_0x20dcd8['include'],function(_0x4cf23d){return{'model':db[_0x4cf23d[_0x4968('0x1d')]],'as':_0x4cf23d['as'],'attributes':_0x4cf23d[_0x4968('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4968('0xb')](function(_0x56059a){logger[_0x4968('0x13')](_0x4968('0x15'),_0x51afa9);logger[_0x4968('0xd')](_0x4968('0x15'),_0x51afa9,JSON[_0x4968('0x20')](_0x56059a));_0x435af1(_0x56059a);})['catch'](function(_0x566c73){logger['error'](_0x4968('0x15'),_0x566c73[_0x4968('0x12')],_0x51afa9);_0x4b0cac(_0x5b12db[_0x4968('0xf')](0x1f4,_0x566c73[_0x4968('0x12')]));});});};exports[_0x4968('0x21')]=function(_0x56490d){var _0x253497=this;return new Promise(function(_0x1d963a,_0x3479ae){return db[_0x4968('0x16')][_0x4968('0x22')]({'raw':_0x56490d[_0x4968('0x18')]?_0x56490d[_0x4968('0x18')][_0x4968('0x19')]===undefined?!![]:![]:!![],'where':_0x56490d[_0x4968('0x18')]?_0x56490d[_0x4968('0x18')][_0x4968('0x1a')]||null:null,'attributes':_0x56490d[_0x4968('0x18')]?_0x56490d[_0x4968('0x18')][_0x4968('0x1f')]||null:null,'include':_0x56490d[_0x4968('0x18')]?_0x56490d[_0x4968('0x18')][_0x4968('0x1c')]?_['map'](_0x56490d[_0x4968('0x18')][_0x4968('0x1c')],function(_0x2c96d2){return{'model':db[_0x2c96d2[_0x4968('0x1d')]],'as':_0x2c96d2['as'],'attributes':_0x2c96d2['attributes'],'include':_0x2c96d2[_0x4968('0x1c')]?_[_0x4968('0x1e')](_0x2c96d2[_0x4968('0x1c')],function(_0x56dd6c){return{'model':db[_0x56dd6c[_0x4968('0x1d')]],'as':_0x56dd6c['as'],'attributes':_0x56dd6c['attributes'],'include':_0x56dd6c['include']?_[_0x4968('0x1e')](_0x56dd6c[_0x4968('0x1c')],function(_0x1b4a8d){return{'model':db[_0x1b4a8d['model']],'as':_0x1b4a8d['as'],'attributes':_0x1b4a8d[_0x4968('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4968('0xb')](function(_0x49732b){logger[_0x4968('0x13')](_0x4968('0x21'),_0x56490d);logger['debug'](_0x4968('0x21'),_0x56490d,JSON[_0x4968('0x20')](_0x49732b));_0x1d963a(_0x49732b);})[_0x4968('0x14')](function(_0x9ca05a){logger[_0x4968('0xf')]('ShowTrunk',_0x9ca05a[_0x4968('0x12')],_0x56490d);_0x3479ae(_0x253497[_0x4968('0xf')](0x1f4,_0x9ca05a[_0x4968('0x12')]));});});}; \ No newline at end of file +var _0x8a63=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trunk','findAll','raw','options','where','attributes','include','map','model','GetTrunk','find','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5ccfa9,_0x415e4d){var _0x228ced=function(_0x57750a){while(--_0x57750a){_0x5ccfa9['push'](_0x5ccfa9['shift']());}};_0x228ced(++_0x415e4d);}(_0x8a63,0x1dd));var _0x38a6=function(_0x52d18d,_0x2bdf0d){_0x52d18d=_0x52d18d-0x0;var _0x3fada0=_0x8a63[_0x52d18d];return _0x3fada0;};'use strict';var _=require(_0x38a6('0x0'));var util=require('util');var moment=require(_0x38a6('0x1'));var BPromise=require(_0x38a6('0x2'));var rs=require(_0x38a6('0x3'));var fs=require('fs');var Redis=require(_0x38a6('0x4'));var db=require(_0x38a6('0x5'))['db'];var utils=require(_0x38a6('0x6'));var logger=require('../../config/logger')(_0x38a6('0x7'));var config=require(_0x38a6('0x8'));var jayson=require(_0x38a6('0x9'));var client=jayson[_0x38a6('0xa')][_0x38a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x226537,_0x2d4664,_0x55152d){return new BPromise(function(_0x2e8d68,_0x487237){return client['request'](_0x226537,_0x55152d)[_0x38a6('0xc')](function(_0x3f9083){logger[_0x38a6('0xd')](_0x38a6('0xe'),_0x2d4664,_0x38a6('0xf'));logger[_0x38a6('0x10')](_0x38a6('0x11'),_0x2d4664,_0x38a6('0xf'),JSON[_0x38a6('0x12')](_0x3f9083));if(_0x3f9083[_0x38a6('0x13')]){if(_0x3f9083[_0x38a6('0x13')][_0x38a6('0x14')]===0x1f4){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083[_0x38a6('0x13')][_0x38a6('0x15')]);return _0x487237(_0x3f9083['error'][_0x38a6('0x15')]);}logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x3f9083['error'][_0x38a6('0x15')]);return _0x2e8d68(_0x3f9083['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x2d4664,_0x38a6('0xf'));_0x2e8d68(_0x3f9083['result'][_0x38a6('0x15')]);}})[_0x38a6('0x16')](function(_0x22b8c9){logger[_0x38a6('0x13')](_0x38a6('0xe'),_0x2d4664,_0x22b8c9);_0x487237(_0x22b8c9);});});}exports['GetTrunk']=function(_0x4f130d){var _0x17aba6=this;return new Promise(function(_0x33e7d0,_0x458ae7){return db[_0x38a6('0x17')][_0x38a6('0x18')]({'raw':_0x4f130d['options']?_0x4f130d['options'][_0x38a6('0x19')]===undefined?!![]:![]:!![],'where':_0x4f130d['options']?_0x4f130d[_0x38a6('0x1a')][_0x38a6('0x1b')]||null:null,'attributes':_0x4f130d['options']?_0x4f130d[_0x38a6('0x1a')][_0x38a6('0x1c')]||null:null,'limit':_0x4f130d['options']?_0x4f130d[_0x38a6('0x1a')]['limit']||null:null,'include':_0x4f130d[_0x38a6('0x1a')]?_0x4f130d[_0x38a6('0x1a')][_0x38a6('0x1d')]?_['map'](_0x4f130d[_0x38a6('0x1a')][_0x38a6('0x1d')],function(_0x37a320){return{'model':db[_0x37a320['model']],'as':_0x37a320['as'],'attributes':_0x37a320['attributes'],'include':_0x37a320['include']?_[_0x38a6('0x1e')](_0x37a320['include'],function(_0x299769){return{'model':db[_0x299769[_0x38a6('0x1f')]],'as':_0x299769['as'],'attributes':_0x299769[_0x38a6('0x1c')],'include':_0x299769[_0x38a6('0x1d')]?_[_0x38a6('0x1e')](_0x299769[_0x38a6('0x1d')],function(_0x534ce3){return{'model':db[_0x534ce3[_0x38a6('0x1f')]],'as':_0x534ce3['as'],'attributes':_0x534ce3[_0x38a6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x38a6('0xc')](function(_0x205bed){logger['info']('GetTrunk',_0x4f130d);logger[_0x38a6('0x10')]('GetTrunk',_0x4f130d,JSON[_0x38a6('0x12')](_0x205bed));_0x33e7d0(_0x205bed);})[_0x38a6('0x16')](function(_0x2cb6d1){logger[_0x38a6('0x13')](_0x38a6('0x20'),_0x2cb6d1[_0x38a6('0x15')],_0x4f130d);_0x458ae7(_0x17aba6[_0x38a6('0x13')](0x1f4,_0x2cb6d1[_0x38a6('0x15')]));});});};exports['ShowTrunk']=function(_0x217384){var _0xa91210=this;return new Promise(function(_0x1c4535,_0x34cd72){return db[_0x38a6('0x17')][_0x38a6('0x21')]({'raw':_0x217384['options']?_0x217384[_0x38a6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x217384[_0x38a6('0x1a')]?_0x217384[_0x38a6('0x1a')][_0x38a6('0x1b')]||null:null,'attributes':_0x217384[_0x38a6('0x1a')]?_0x217384[_0x38a6('0x1a')][_0x38a6('0x1c')]||null:null,'include':_0x217384[_0x38a6('0x1a')]?_0x217384[_0x38a6('0x1a')]['include']?_[_0x38a6('0x1e')](_0x217384[_0x38a6('0x1a')][_0x38a6('0x1d')],function(_0x54dc9a){return{'model':db[_0x54dc9a[_0x38a6('0x1f')]],'as':_0x54dc9a['as'],'attributes':_0x54dc9a['attributes'],'include':_0x54dc9a[_0x38a6('0x1d')]?_[_0x38a6('0x1e')](_0x54dc9a[_0x38a6('0x1d')],function(_0x25c8de){return{'model':db[_0x25c8de[_0x38a6('0x1f')]],'as':_0x25c8de['as'],'attributes':_0x25c8de['attributes'],'include':_0x25c8de[_0x38a6('0x1d')]?_[_0x38a6('0x1e')](_0x25c8de[_0x38a6('0x1d')],function(_0x14f3df){return{'model':db[_0x14f3df['model']],'as':_0x14f3df['as'],'attributes':_0x14f3df[_0x38a6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x38a6('0xc')](function(_0x24f414){logger[_0x38a6('0xd')]('ShowTrunk',_0x217384);logger[_0x38a6('0x10')](_0x38a6('0x22'),_0x217384,JSON[_0x38a6('0x12')](_0x24f414));_0x1c4535(_0x24f414);})[_0x38a6('0x16')](function(_0x4d9c60){logger['error']('ShowTrunk',_0x4d9c60[_0x38a6('0x15')],_0x217384);_0x34cd72(_0xa91210[_0x38a6('0x13')](0x1f4,_0x4d9c60[_0x38a6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 9575c6d..2d57cd5 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1229=['express','Router','./user-setting.controller','/:id','update','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1229,0x6c));var _0x9122=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1229[_0x46698a];return _0x356db0;};'use strict';var express=require(_0x9122('0x0'));var router=express[_0x9122('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9122('0x2'));router['put'](_0x9122('0x3'),auth['isAuthenticated'](),controller[_0x9122('0x4')]);module[_0x9122('0x5')]=router; \ No newline at end of file +var _0x7d65=['/:id','isAuthenticated','update','express','Router','./user-setting.controller','put'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x7d65,0x11b));var _0x57d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d65[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x57d6('0x0'));var router=express[_0x57d6('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x57d6('0x2'));router[_0x57d6('0x3')](_0x57d6('0x4'),auth[_0x57d6('0x5')](),controller[_0x57d6('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 5ae9bf4..9cd5c33 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5df=['debug','exports','ENUM','BOOLEAN','TEXT','INTEGER','sequelize','error','info'];(function(_0x5f463b,_0x1adab6){var _0x42912c=function(_0x37346f){while(--_0x37346f){_0x5f463b['push'](_0x5f463b['shift']());}};_0x42912c(++_0x1adab6);}(_0xa5df,0xf0));var _0xfa5d=function(_0x145e77,_0xdfd15c){_0x145e77=_0x145e77-0x0;var _0x4660de=_0xa5df[_0x145e77];return _0x4660de;};'use strict';var Sequelize=require(_0xfa5d('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xfa5d('0x1'),'warning',_0xfa5d('0x2'),_0xfa5d('0x3')];module[_0xfa5d('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xfa5d('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xfa5d('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xfa5d('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xfa5d('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xfa5d('0x8')],'unique':'UserId'}}; \ No newline at end of file +var _0x2843=['ENUM','BOOLEAN','TEXT','DATE','UserId','error','info','debug'];(function(_0x379b2d,_0x2d74ee){var _0x2e4b3d=function(_0x2023b2){while(--_0x2023b2){_0x379b2d['push'](_0x379b2d['shift']());}};_0x2e4b3d(++_0x2d74ee);}(_0x2843,0x195));var _0x3284=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x2843[_0x408e38];return _0x426b0e;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x3284('0x0'),'warning',_0x3284('0x1'),_0x3284('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x3284('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3284('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x3284('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x3284('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3284('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x3284('0x7')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 36c3475..bb7936d 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e35=['body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','then','stack','name','status','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find'];(function(_0x2a2d4c,_0x421c0b){var _0x281be4=function(_0x4d8ea9){while(--_0x4d8ea9){_0x2a2d4c['push'](_0x2a2d4c['shift']());}};_0x281be4(++_0x421c0b);}(_0x2e35,0x1d0));var _0x52e3=function(_0x1ecae,_0x541fd8){_0x1ecae=_0x1ecae-0x0;var _0x177cf7=_0x2e35[_0x1ecae];return _0x177cf7;};'use strict';var _=require(_0x52e3('0x0'));var Redis=require(_0x52e3('0x1'));var logger=require(_0x52e3('0x2'))('api');var config=require(_0x52e3('0x3'));var db=require(_0x52e3('0x4'))['db'];var socket=require(_0x52e3('0x5'))(new Redis(config[_0x52e3('0x6')]));require('./user-setting.socket')[_0x52e3('0x7')](socket);config[_0x52e3('0x6')]=_[_0x52e3('0x8')](config[_0x52e3('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x483b93,_0x507a6c){_0x507a6c=_0x507a6c||0xc8;return function(_0x21ae13){if(_0x21ae13){return _0x483b93['status'](_0x507a6c)['json'](_0x21ae13);}};}function saveUpdates(_0x1367de){return function(_0x2fcd20){if(_0x2fcd20){return _0x2fcd20['update'](_0x1367de)[_0x52e3('0x9')](function(_0x1153c4){return _0x1153c4;});}return null;};}function handleEntityNotFound(_0x542097){return function(_0x440fe5){if(!_0x440fe5){_0x542097['sendStatus'](0x194);}return _0x440fe5;};}function handleError(_0x343960,_0x10f70f){_0x10f70f=_0x10f70f||0x1f4;return function(_0x16492c){logger['error'](_0x16492c[_0x52e3('0xa')]);if(_0x16492c[_0x52e3('0xb')]){delete _0x16492c['name'];}_0x343960[_0x52e3('0xc')](_0x10f70f)['send'](_0x16492c);};}exports['update']=function(_0x58dcdd,_0x478ff9){if(_0x58dcdd['user'][_0x52e3('0xd')]!==_0x52e3('0xe'))throw new Error(_0x52e3('0xf'));if(isNaN(Number(_0x58dcdd[_0x52e3('0x10')]['id'])))throw new Error(_0x52e3('0x11'));return db[_0x52e3('0x12')][_0x52e3('0x13')]({'where':{'id':_0x58dcdd[_0x52e3('0x10')]['id']}})[_0x52e3('0x9')](handleEntityNotFound(_0x478ff9,null))[_0x52e3('0x9')](saveUpdates(_0x58dcdd[_0x52e3('0x14')],null))['then'](respondWithResult(_0x478ff9,null))[_0x52e3('0x15')](handleError(_0x478ff9,null));}; \ No newline at end of file +var _0xd58c=['json','update','then','sendStatus','error','name','send','user','role','admin','Invalid\x20user\x20setting\x20id','UserSetting','find','body','lodash','ioredis','../../config/logger','../../config/environment','socket.io-emitter','./user-setting.socket','register','redis','defaults','status'];(function(_0x3deb7b,_0x5c4502){var _0x474d5a=function(_0x59cb1d){while(--_0x59cb1d){_0x3deb7b['push'](_0x3deb7b['shift']());}};_0x474d5a(++_0x5c4502);}(_0xd58c,0xb6));var _0xcd58=function(_0x1a194a,_0x3233dc){_0x1a194a=_0x1a194a-0x0;var _0x1da730=_0xd58c[_0x1a194a];return _0x1da730;};'use strict';var _=require(_0xcd58('0x0'));var Redis=require(_0xcd58('0x1'));var logger=require(_0xcd58('0x2'))('api');var config=require(_0xcd58('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0xcd58('0x4'))(new Redis(config['redis']));require(_0xcd58('0x5'))[_0xcd58('0x6')](socket);config[_0xcd58('0x7')]=_[_0xcd58('0x8')](config[_0xcd58('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x546187,_0x3f2c97){_0x3f2c97=_0x3f2c97||0xc8;return function(_0x31bf4e){if(_0x31bf4e){return _0x546187[_0xcd58('0x9')](_0x3f2c97)[_0xcd58('0xa')](_0x31bf4e);}};}function saveUpdates(_0x37a864){return function(_0x491d5b){if(_0x491d5b){return _0x491d5b[_0xcd58('0xb')](_0x37a864)[_0xcd58('0xc')](function(_0x5694e1){return _0x5694e1;});}return null;};}function handleEntityNotFound(_0x1e6f95){return function(_0x573b78){if(!_0x573b78){_0x1e6f95[_0xcd58('0xd')](0x194);}return _0x573b78;};}function handleError(_0x440776,_0x440cf1){_0x440cf1=_0x440cf1||0x1f4;return function(_0x4f95e9){logger[_0xcd58('0xe')](_0x4f95e9['stack']);if(_0x4f95e9[_0xcd58('0xf')]){delete _0x4f95e9['name'];}_0x440776[_0xcd58('0x9')](_0x440cf1)[_0xcd58('0x10')](_0x4f95e9);};}exports[_0xcd58('0xb')]=function(_0x17b93f,_0x37561b){if(_0x17b93f[_0xcd58('0x11')][_0xcd58('0x12')]!==_0xcd58('0x13'))throw new Error('Unauthorized');if(isNaN(Number(_0x17b93f['params']['id'])))throw new Error(_0xcd58('0x14'));return db[_0xcd58('0x15')][_0xcd58('0x16')]({'where':{'id':_0x17b93f['params']['id']}})['then'](handleEntityNotFound(_0x37561b,null))[_0xcd58('0xc')](saveUpdates(_0x17b93f[_0xcd58('0x17')],null))[_0xcd58('0xc')](respondWithResult(_0x37561b,null))['catch'](handleError(_0x37561b,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 0904cd6..7cb4632 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa784=['update','emit','exports','../../mysqldb','setMaxListeners','save'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xa784,0xf3));var _0x4a78=function(_0x369a70,_0x501041){_0x369a70=_0x369a70-0x0;var _0x1f6d6c=_0xa784[_0x369a70];return _0x1f6d6c;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4a78('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x4a78('0x1')](0x0);var events={'afterCreate':_0x4a78('0x2'),'afterUpdate':_0x4a78('0x3'),'afterDestroy':'remove'};function emitEvent(_0x240336){return function(_0x573222,_0x28effb,_0x548484){UserSettingEvents[_0x4a78('0x4')](_0x240336+':'+_0x573222['id'],_0x573222);UserSettingEvents[_0x4a78('0x4')](_0x240336,_0x573222);_0x548484(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x4a78('0x5')]=UserSettingEvents; \ No newline at end of file +var _0xfa97=['emit','hasOwnProperty','hook','events','UserSetting','setMaxListeners','save','update','remove'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xfa97,0x150));var _0x7fa9=function(_0x403ccb,_0xb0e0e4){_0x403ccb=_0x403ccb-0x0;var _0x90bbbc=_0xfa97[_0x403ccb];return _0x90bbbc;};'use strict';var EventEmitter=require(_0x7fa9('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x7fa9('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x7fa9('0x2')](0x0);var events={'afterCreate':_0x7fa9('0x3'),'afterUpdate':_0x7fa9('0x4'),'afterDestroy':_0x7fa9('0x5')};function emitEvent(_0x1ce017){return function(_0x5f2b37,_0x4e34ce,_0x18e394){UserSettingEvents[_0x7fa9('0x6')](_0x1ce017+':'+_0x5f2b37['id'],_0x5f2b37);UserSettingEvents[_0x7fa9('0x6')](_0x1ce017,_0x5f2b37);_0x18e394(null);};}for(var e in events){if(events[_0x7fa9('0x7')](e)){var event=events[e];UserSetting[_0x7fa9('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 475cb4d..a6b5b6f 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc75=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x1704c0,_0x1f6b71){var _0x1e8efd=function(_0x19bf78){while(--_0x19bf78){_0x1704c0['push'](_0x1704c0['shift']());}};_0x1e8efd(++_0x1f6b71);}(_0xfc75,0xe1));var _0x5fc7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfc75[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0x5fc7('0x0'));module[_0x5fc7('0x1')]=function(_0x3d2426){return _0x3d2426[_0x5fc7('0x2')](_0x5fc7('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55314c){if(!_0x55314c[_0x5fc7('0x4')])_0x55314c['clientSideLoggingEnabledSince']=null;else if(_0x55314c[_0x5fc7('0x5')]===null)_0x55314c[_0x5fc7('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x5eb8=['clientSideLoggingEnabledSince','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0x470d05,_0x1a2a2d){var _0x58b293=function(_0x18042f){while(--_0x18042f){_0x470d05['push'](_0x470d05['shift']());}};_0x58b293(++_0x1a2a2d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x237bf7,_0xb851fc){_0x237bf7=_0x237bf7-0x0;var _0x5928ba=_0x5eb8[_0x237bf7];return _0x5928ba;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x16de3e){return _0x16de3e[_0x85eb('0x0')](_0x85eb('0x1'),attributes,{'tableName':_0x85eb('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7e3c0){if(!_0x7e3c0[_0x85eb('0x3')])_0x7e3c0[_0x85eb('0x4')]=null;else if(_0x7e3c0[_0x85eb('0x4')]===null)_0x7e3c0[_0x85eb('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 8d35b93..c86003a 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf3b=['update','emit','user-setting:update','user-setting:update:user-','length','user-setting:','./user-setting.events','save','remove'];(function(_0x355082,_0x2ef631){var _0x4517d6=function(_0x58455e){while(--_0x58455e){_0x355082['push'](_0x355082['shift']());}};_0x4517d6(++_0x2ef631);}(_0xaf3b,0x1bf));var _0xbaf3=function(_0x1a6fb1,_0x2b8f37){_0x1a6fb1=_0x1a6fb1-0x0;var _0x351db3=_0xaf3b[_0x1a6fb1];return _0x351db3;};'use strict';var UserSettingEvents=require(_0xbaf3('0x0'));var events=[_0xbaf3('0x1'),_0xbaf3('0x2'),_0xbaf3('0x3')];function createListener(_0x23c66b,_0x202873){return function(_0x536952){_0x202873[_0xbaf3('0x4')](_0x23c66b,_0x536952);if(_0x23c66b===_0xbaf3('0x5')){_0x202873[_0xbaf3('0x4')](_0xbaf3('0x6')+_0x536952['UserId'],_0x536952);}};}exports['register']=function(_0x418b48){for(var _0x363ee7=0x0,_0x5aa0ea=events[_0xbaf3('0x7')];_0x363ee7<_0x5aa0ea;_0x363ee7++){var _0x483a97=events[_0x363ee7];var _0x1fa829=createListener(_0xbaf3('0x8')+_0x483a97,_0x418b48);UserSettingEvents['on'](_0x483a97,_0x1fa829);}}; \ No newline at end of file +var _0x02bc=['emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove'];(function(_0xb94781,_0xa2314b){var _0x3e1881=function(_0x57c689){while(--_0x57c689){_0xb94781['push'](_0xb94781['shift']());}};_0x3e1881(++_0xa2314b);}(_0x02bc,0x1d3));var _0xc02b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x02bc[_0x19e35c];return _0x3e1fe8;};'use strict';var UserSettingEvents=require(_0xc02b('0x0'));var events=[_0xc02b('0x1'),_0xc02b('0x2'),'update'];function createListener(_0x2f4410,_0xd21453){return function(_0x85d43){_0xd21453[_0xc02b('0x3')](_0x2f4410,_0x85d43);if(_0x2f4410===_0xc02b('0x4')){_0xd21453[_0xc02b('0x3')](_0xc02b('0x5')+_0x85d43[_0xc02b('0x6')],_0x85d43);}};}exports[_0xc02b('0x7')]=function(_0xd93798){for(var _0x2c096c=0x0,_0x1acfce=events[_0xc02b('0x8')];_0x2c096c<_0x1acfce;_0x2c096c++){var _0x400076=events[_0x2c096c];var _0x18f0cd=createListener(_0xc02b('0x9')+_0x400076,_0xd93798);UserSettingEvents['on'](_0x400076,_0x18f0cd);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e571f07..2695710 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 _0x576a=['getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','addQueues','diskStorage','join','root','format','now','single','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','describe','/whoami','whoami','isAuthenticated','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes'];(function(_0x1fa426,_0x585510){var _0x5ed63b=function(_0x5c34d3){while(--_0x5c34d3){_0x1fa426['push'](_0x1fa426['shift']());}};_0x5ed63b(++_0x585510);}(_0x576a,0x18d));var _0xa576=function(_0x49a070,_0x25b49e){_0x49a070=_0x49a070-0x0;var _0x5dd661=_0x576a[_0x49a070];return _0x5dd661;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa576('0x0'));var express=require('express');var router=express[_0xa576('0x1')]();var fs_extra=require(_0xa576('0x2'));var auth=require(_0xa576('0x3'));var interaction=require(_0xa576('0x4'));var config=require(_0xa576('0x5'));var controller=require(_0xa576('0x6'));router[_0xa576('0x7')]('/',auth['isAuthenticated'](),controller[_0xa576('0x8')]);router[_0xa576('0x7')](_0xa576('0x9'),auth['isAuthenticated'](),controller[_0xa576('0xa')]);router[_0xa576('0x7')](_0xa576('0xb'),auth['isAuthenticated'](),controller[_0xa576('0xc')]);router[_0xa576('0x7')]('/presence',auth[_0xa576('0xd')](),controller[_0xa576('0xe')]);router[_0xa576('0x7')](_0xa576('0xf'),auth[_0xa576('0xd')](),controller[_0xa576('0x10')]);router[_0xa576('0x7')](_0xa576('0x11'),controller[_0xa576('0x12')]);router[_0xa576('0x7')](_0xa576('0x13'),auth['isAuthenticated'](),controller[_0xa576('0x14')]);router['get'](_0xa576('0x15'),auth[_0xa576('0xd')](),controller[_0xa576('0x16')]);router[_0xa576('0x7')](_0xa576('0x17'),auth[_0xa576('0xd')](),controller[_0xa576('0x18')]);router['get'](_0xa576('0x19'),auth[_0xa576('0xd')](),controller[_0xa576('0x1a')]);router['get'](_0xa576('0x1b'),auth['isAuthenticated'](),controller[_0xa576('0x1c')]);router['get'](_0xa576('0x1d'),auth[_0xa576('0xd')](),controller[_0xa576('0x1e')]);router[_0xa576('0x7')](_0xa576('0x1f'),auth[_0xa576('0xd')](),controller['getScreenRecordings']);router[_0xa576('0x7')](_0xa576('0x20'),auth[_0xa576('0xd')](),controller[_0xa576('0x21')]);router[_0xa576('0x7')](_0xa576('0x22'),auth[_0xa576('0xd')](),controller['getOpenchannelInteractions']);router[_0xa576('0x7')]('/:id/mail/interactions',auth[_0xa576('0xd')](),controller[_0xa576('0x23')]);router[_0xa576('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0xa576('0x7')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0xa576('0xd')](),controller['getWhatsappInteractions']);router['get'](_0xa576('0x24'),auth['isAuthenticated'](),controller[_0xa576('0x25')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xa576('0x26')]);router[_0xa576('0x7')](_0xa576('0x27'),auth['isAuthenticated'](),controller[_0xa576('0x28')]);router[_0xa576('0x7')](_0xa576('0x29'),auth[_0xa576('0xd')](),controller[_0xa576('0x2a')]);router[_0xa576('0x7')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xa576('0x2b')]);router['get'](_0xa576('0x2c'),auth[_0xa576('0xd')](),controller[_0xa576('0x2d')]);router[_0xa576('0x7')](_0xa576('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xa576('0x7')](_0xa576('0x2f'),auth['isAuthenticated'](),controller[_0xa576('0x30')]);router[_0xa576('0x7')](_0xa576('0x31'),auth[_0xa576('0xd')](),controller[_0xa576('0x32')]);router[_0xa576('0x7')]('/:id/whatsapp_accounts',auth[_0xa576('0xd')](),controller[_0xa576('0x33')]);router['get']('/:id/square_projects',auth[_0xa576('0xd')](),controller['getSquareProjects']);router[_0xa576('0x7')]('/:id/scheduled_calls',auth[_0xa576('0xd')](),controller[_0xa576('0x34')]);router[_0xa576('0x7')](_0xa576('0x35'),auth[_0xa576('0xd')](),controller[_0xa576('0x36')]);router[_0xa576('0x37')](_0xa576('0x15'),auth[_0xa576('0xd')](),controller['addContacts']);router['post']('/',auth[_0xa576('0xd')](),controller[_0xa576('0x38')]);router[_0xa576('0x37')]('/create_many',auth[_0xa576('0xd')](),controller[_0xa576('0x39')]);router[_0xa576('0x37')](_0xa576('0x17'),auth['isAuthenticated'](),controller[_0xa576('0x3a')]);var upload=multer({'storage':multer[_0xa576('0x3b')]({'destination':function(_0x46aa79,_0x38f312,_0x263cb5){_0x263cb5(null,path[_0xa576('0x3c')](config[_0xa576('0x3d')],'server/files/images/'));},'filename':function(_0x1e31c7,_0x5e9302,_0x453c6f){_0x453c6f(null,util[_0xa576('0x3e')]('%s-%s',Date[_0xa576('0x3f')](),_0x5e9302['originalname']));}})});router[_0xa576('0x37')](_0xa576('0x11'),upload[_0xa576('0x40')]('file'),controller['addAvatar']);router[_0xa576('0x37')](_0xa576('0x41'),auth['isAuthenticated'](),controller[_0xa576('0x42')]);router['post'](_0xa576('0x43'),auth[_0xa576('0xd')](),controller[_0xa576('0x44')]);router['post'](_0xa576('0x45'),auth['isAuthenticated'](),controller[_0xa576('0x46')]);router[_0xa576('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xa576('0x47')]);router[_0xa576('0x37')](_0xa576('0x24'),auth[_0xa576('0xd')](),controller['addTeams']);router[_0xa576('0x37')](_0xa576('0x48'),auth['isAuthenticated'](),controller[_0xa576('0x49')]);router[_0xa576('0x37')](_0xa576('0x4a'),auth[_0xa576('0xd')](),controller[_0xa576('0x4b')]);router[_0xa576('0x37')](_0xa576('0x4c'),auth[_0xa576('0xd')](),controller[_0xa576('0x4d')]);router['post'](_0xa576('0x4e'),auth['isAuthenticated'](),controller[_0xa576('0x4f')]);router['post'](_0xa576('0x50'),auth[_0xa576('0xd')](),controller[_0xa576('0x51')]);router['post']('/:id/whatsapp_interactions',auth[_0xa576('0xd')](),controller['addWhatsappInteractions']);router[_0xa576('0x37')]('/:id/fax_accounts',auth[_0xa576('0xd')](),controller[_0xa576('0x52')]);router['post']('/:id/mail_accounts',auth[_0xa576('0xd')](),controller['addMailAccounts']);router[_0xa576('0x37')](_0xa576('0x2e'),auth['isAuthenticated'](),controller[_0xa576('0x53')]);router[_0xa576('0x37')](_0xa576('0x2f'),auth[_0xa576('0xd')](),controller[_0xa576('0x54')]);router['post'](_0xa576('0x31'),auth[_0xa576('0xd')](),controller[_0xa576('0x55')]);router[_0xa576('0x37')](_0xa576('0x56'),auth['isAuthenticated'](),controller[_0xa576('0x57')]);router['post'](_0xa576('0x58'),auth[_0xa576('0xd')](),controller[_0xa576('0x59')]);router['post'](_0xa576('0x35'),auth[_0xa576('0xd')](),controller[_0xa576('0x5a')]);router[_0xa576('0x5b')](_0xa576('0xf'),auth[_0xa576('0xd')](),controller[_0xa576('0x5c')]);router[_0xa576('0x5b')]('/:id/password',auth['isAuthenticated'](),controller[_0xa576('0x5d')]);router['delete']('/:id/queues',auth[_0xa576('0xd')](),controller[_0xa576('0x5e')]);router[_0xa576('0x5f')]('/:id/teams',auth[_0xa576('0xd')](),controller[_0xa576('0x60')]);router[_0xa576('0x5f')](_0xa576('0xf'),auth['isAuthenticated'](),controller[_0xa576('0x61')]);router[_0xa576('0x5f')](_0xa576('0x48'),auth[_0xa576('0xd')](),controller[_0xa576('0x62')]);router[_0xa576('0x5f')]('/:id/mail_interactions',auth[_0xa576('0xd')](),controller[_0xa576('0x63')]);router[_0xa576('0x5f')]('/:id/fax_interactions',auth[_0xa576('0xd')](),controller['removeFaxInteractions']);router[_0xa576('0x5f')](_0xa576('0x4e'),auth[_0xa576('0xd')](),controller[_0xa576('0x64')]);router['delete']('/:id/openchannel_interactions',auth[_0xa576('0xd')](),controller[_0xa576('0x65')]);router['delete']('/:id/whatsapp_interactions',auth[_0xa576('0xd')](),controller[_0xa576('0x66')]);router[_0xa576('0x5f')](_0xa576('0x67'),auth[_0xa576('0xd')](),controller[_0xa576('0x68')]);router[_0xa576('0x5f')](_0xa576('0x2c'),auth[_0xa576('0xd')](),controller['removeMailAccounts']);router[_0xa576('0x5f')](_0xa576('0x2e'),auth[_0xa576('0xd')](),controller[_0xa576('0x69')]);router[_0xa576('0x5f')](_0xa576('0x2f'),auth['isAuthenticated'](),controller[_0xa576('0x6a')]);router[_0xa576('0x5f')](_0xa576('0x31'),auth[_0xa576('0xd')](),controller[_0xa576('0x6b')]);router[_0xa576('0x5f')](_0xa576('0x56'),auth[_0xa576('0xd')](),controller[_0xa576('0x6c')]);router['delete'](_0xa576('0x58'),auth[_0xa576('0xd')](),controller['removeSquareProjects']);router[_0xa576('0x5f')](_0xa576('0x35'),auth[_0xa576('0xd')](),controller['removeApiKey']);module[_0xa576('0x6d')]=router; \ No newline at end of file +var _0x22d1=['getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','/:id/api_key','addContacts','create','post','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','createApiKey','put','update','/:id/password','changePassword','delete','destroy','removeChatInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','whoami','/presence'];(function(_0x5a4670,_0x26110d){var _0x332b26=function(_0xaf9f30){while(--_0xaf9f30){_0x5a4670['push'](_0x5a4670['shift']());}};_0x332b26(++_0x26110d);}(_0x22d1,0x65));var _0x122d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x22d1[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x122d('0x0'));var util=require(_0x122d('0x1'));var path=require(_0x122d('0x2'));var timeout=require('connect-timeout');var express=require(_0x122d('0x3'));var router=express[_0x122d('0x4')]();var fs_extra=require(_0x122d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x122d('0x6'));var config=require(_0x122d('0x7'));var controller=require(_0x122d('0x8'));router[_0x122d('0x9')]('/',auth['isAuthenticated'](),controller[_0x122d('0xa')]);router[_0x122d('0x9')](_0x122d('0xb'),auth[_0x122d('0xc')](),controller[_0x122d('0xd')]);router[_0x122d('0x9')]('/whoami',auth[_0x122d('0xc')](),controller[_0x122d('0xe')]);router[_0x122d('0x9')](_0x122d('0xf'),auth[_0x122d('0xc')](),controller[_0x122d('0x10')]);router[_0x122d('0x9')](_0x122d('0x11'),auth[_0x122d('0xc')](),controller[_0x122d('0x12')]);router['get'](_0x122d('0x13'),controller[_0x122d('0x14')]);router[_0x122d('0x9')](_0x122d('0x15'),auth[_0x122d('0xc')](),controller['getOpenTabs']);router[_0x122d('0x9')](_0x122d('0x16'),auth[_0x122d('0xc')](),controller[_0x122d('0x17')]);router[_0x122d('0x9')](_0x122d('0x18'),auth[_0x122d('0xc')](),controller[_0x122d('0x19')]);router['get'](_0x122d('0x1a'),auth[_0x122d('0xc')](),controller[_0x122d('0x1b')]);router[_0x122d('0x9')](_0x122d('0x1c'),auth['isAuthenticated'](),controller[_0x122d('0x1d')]);router[_0x122d('0x9')]('/:id/recordings',auth[_0x122d('0xc')](),controller[_0x122d('0x1e')]);router['get'](_0x122d('0x1f'),auth[_0x122d('0xc')](),controller['getScreenRecordings']);router[_0x122d('0x9')](_0x122d('0x20'),auth['isAuthenticated'](),controller[_0x122d('0x21')]);router['get'](_0x122d('0x22'),auth[_0x122d('0xc')](),controller[_0x122d('0x23')]);router['get']('/:id/mail/interactions',auth[_0x122d('0xc')](),controller[_0x122d('0x24')]);router['get'](_0x122d('0x25'),auth[_0x122d('0xc')](),controller['getSmsInteractions']);router[_0x122d('0x9')](_0x122d('0x26'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x122d('0x9')](_0x122d('0x27'),auth[_0x122d('0xc')](),controller[_0x122d('0x28')]);router[_0x122d('0x9')](_0x122d('0x29'),auth[_0x122d('0xc')](),controller[_0x122d('0x2a')]);router[_0x122d('0x9')]('/:id/lists',auth['isAuthenticated'](),controller[_0x122d('0x2b')]);router[_0x122d('0x9')](_0x122d('0x2c'),auth[_0x122d('0xc')](),controller[_0x122d('0x2d')]);router[_0x122d('0x9')](_0x122d('0x2e'),auth[_0x122d('0xc')](),controller[_0x122d('0x2f')]);router['get']('/:id/fax_accounts',auth[_0x122d('0xc')](),controller[_0x122d('0x30')]);router[_0x122d('0x9')](_0x122d('0x31'),auth['isAuthenticated'](),controller['getMailAccounts']);router['get'](_0x122d('0x32'),auth[_0x122d('0xc')](),controller[_0x122d('0x33')]);router[_0x122d('0x9')](_0x122d('0x34'),auth[_0x122d('0xc')](),controller['getSmsAccounts']);router[_0x122d('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x122d('0x35')]);router[_0x122d('0x9')]('/:id/whatsapp_accounts',auth[_0x122d('0xc')](),controller[_0x122d('0x36')]);router[_0x122d('0x9')](_0x122d('0x37'),auth[_0x122d('0xc')](),controller['getSquareProjects']);router[_0x122d('0x9')](_0x122d('0x38'),auth[_0x122d('0xc')](),controller['getScheduledCalls']);router['get'](_0x122d('0x39'),auth[_0x122d('0xc')](),controller['getApiKey']);router['post'](_0x122d('0x16'),auth[_0x122d('0xc')](),controller[_0x122d('0x3a')]);router['post']('/',auth['isAuthenticated'](),controller[_0x122d('0x3b')]);router[_0x122d('0x3c')]('/create_many',auth[_0x122d('0xc')](),controller[_0x122d('0x3d')]);router[_0x122d('0x3c')]('/:id/queues',auth[_0x122d('0xc')](),controller[_0x122d('0x3e')]);var upload=multer({'storage':multer[_0x122d('0x3f')]({'destination':function(_0xfb0981,_0x5a73d9,_0x29db49){_0x29db49(null,path[_0x122d('0x40')](config[_0x122d('0x41')],_0x122d('0x42')));},'filename':function(_0x11e51c,_0x4a73e0,_0x450d18){_0x450d18(null,util['format'](_0x122d('0x43'),Date[_0x122d('0x44')](),_0x4a73e0[_0x122d('0x45')]));}})});router['post'](_0x122d('0x13'),upload[_0x122d('0x46')](_0x122d('0x47')),controller[_0x122d('0x48')]);router[_0x122d('0x3c')](_0x122d('0x49'),auth[_0x122d('0xc')](),controller['login']);router[_0x122d('0x3c')](_0x122d('0x4a'),auth[_0x122d('0xc')](),controller[_0x122d('0x4b')]);router[_0x122d('0x3c')](_0x122d('0x4c'),auth['isAuthenticated'](),controller[_0x122d('0x4d')]);router['post'](_0x122d('0x4e'),auth['isAuthenticated'](),controller[_0x122d('0x4f')]);router['post'](_0x122d('0x29'),auth[_0x122d('0xc')](),controller['addTeams']);router[_0x122d('0x3c')](_0x122d('0x50'),auth[_0x122d('0xc')](),controller[_0x122d('0x51')]);router['post'](_0x122d('0x52'),auth[_0x122d('0xc')](),controller[_0x122d('0x53')]);router[_0x122d('0x3c')](_0x122d('0x54'),auth['isAuthenticated'](),controller[_0x122d('0x55')]);router['post'](_0x122d('0x56'),auth[_0x122d('0xc')](),controller[_0x122d('0x57')]);router[_0x122d('0x3c')](_0x122d('0x58'),auth[_0x122d('0xc')](),controller[_0x122d('0x59')]);router['post'](_0x122d('0x5a'),auth[_0x122d('0xc')](),controller[_0x122d('0x5b')]);router[_0x122d('0x3c')](_0x122d('0x5c'),auth[_0x122d('0xc')](),controller[_0x122d('0x5d')]);router[_0x122d('0x3c')](_0x122d('0x31'),auth[_0x122d('0xc')](),controller[_0x122d('0x5e')]);router[_0x122d('0x3c')](_0x122d('0x32'),auth[_0x122d('0xc')](),controller[_0x122d('0x5f')]);router['post'](_0x122d('0x34'),auth[_0x122d('0xc')](),controller[_0x122d('0x60')]);router['post'](_0x122d('0x61'),auth[_0x122d('0xc')](),controller[_0x122d('0x62')]);router['post'](_0x122d('0x63'),auth[_0x122d('0xc')](),controller['addWhatsappAccounts']);router[_0x122d('0x3c')]('/:id/square_projects',auth[_0x122d('0xc')](),controller['addSquareProjects']);router[_0x122d('0x3c')](_0x122d('0x39'),auth[_0x122d('0xc')](),controller[_0x122d('0x64')]);router[_0x122d('0x65')](_0x122d('0x11'),auth['isAuthenticated'](),controller[_0x122d('0x66')]);router[_0x122d('0x65')](_0x122d('0x67'),auth[_0x122d('0xc')](),controller[_0x122d('0x68')]);router[_0x122d('0x69')](_0x122d('0x18'),auth[_0x122d('0xc')](),controller['removeQueues']);router[_0x122d('0x69')](_0x122d('0x29'),auth[_0x122d('0xc')](),controller['removeTeams']);router[_0x122d('0x69')]('/:id',auth[_0x122d('0xc')](),controller[_0x122d('0x6a')]);router[_0x122d('0x69')](_0x122d('0x50'),auth[_0x122d('0xc')](),controller[_0x122d('0x6b')]);router[_0x122d('0x69')](_0x122d('0x52'),auth[_0x122d('0xc')](),controller['removeMailInteractions']);router[_0x122d('0x69')](_0x122d('0x54'),auth[_0x122d('0xc')](),controller['removeFaxInteractions']);router[_0x122d('0x69')](_0x122d('0x56'),auth[_0x122d('0xc')](),controller[_0x122d('0x6c')]);router[_0x122d('0x69')](_0x122d('0x58'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x122d('0x69')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x122d('0x69')]('/:id/fax_accounts',auth[_0x122d('0xc')](),controller[_0x122d('0x6d')]);router['delete'](_0x122d('0x31'),auth[_0x122d('0xc')](),controller[_0x122d('0x6e')]);router['delete'](_0x122d('0x32'),auth[_0x122d('0xc')](),controller[_0x122d('0x6f')]);router[_0x122d('0x69')](_0x122d('0x34'),auth[_0x122d('0xc')](),controller[_0x122d('0x70')]);router['delete']('/:id/chat_websites',auth[_0x122d('0xc')](),controller[_0x122d('0x71')]);router['delete'](_0x122d('0x63'),auth['isAuthenticated'](),controller[_0x122d('0x72')]);router[_0x122d('0x69')](_0x122d('0x37'),auth[_0x122d('0xc')](),controller['removeSquareProjects']);router[_0x122d('0x69')](_0x122d('0x39'),auth[_0x122d('0xc')](),controller[_0x122d('0x73')]);module[_0x122d('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index f3c5f87..88a8743 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 _0x7a9e=['\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','split','all','allow','join','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','TEXT','get','isArray','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','rtcp_mux','wss','encryption','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','email','ENUM','admin','telephone','local','INTEGER','internal','accountcode'];(function(_0x53080e,_0x252127){var _0x1a0c14=function(_0x4f2236){while(--_0x4f2236){_0x53080e['push'](_0x53080e['shift']());}};_0x1a0c14(++_0x252127);}(_0x7a9e,0x162));var _0xe7a9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7a9e[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xe7a9('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module[_0xe7a9('0x1')]={'name':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':![],'unique':_0xe7a9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x51271f){this[_0xe7a9('0x4')](_0xe7a9('0x3'),_0x51271f);this[_0xe7a9('0x4')](_0xe7a9('0x5'),_0x51271f);},'comment':_0xe7a9('0x6')},'fullname':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':![],'set':function(_0x3280af){this['setDataValue'](_0xe7a9('0x7'),_0x3280af);this[_0xe7a9('0x4')](_0xe7a9('0x8'),util[_0xe7a9('0x9')]('\x22%s\x22\x20<%s>',_0x3280af,this['getDataValue']('internal')));}},'alias':{'type':Sequelize[_0xe7a9('0x2')]},'email':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':![],'unique':_0xe7a9('0xa'),'validate':{'isEmail':!![]},'set':function(_0x5b553a){if(_0x5b553a){this[_0xe7a9('0x4')]('email',_0x5b553a['toLowerCase']());}}},'role':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0xc'),'user','agent',_0xe7a9('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xe7a9('0x2')],'defaultValue':_0xe7a9('0xe')},'internal':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25d577){this[_0xe7a9('0x4')](_0xe7a9('0x10'),_0x25d577);this[_0xe7a9('0x4')](_0xe7a9('0x11'),_0x25d577);this[_0xe7a9('0x4')](_0xe7a9('0x8'),util[_0xe7a9('0x9')](_0xe7a9('0x12'),this[_0xe7a9('0x13')](_0xe7a9('0x7')),_0x25d577));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe7a9('0x2')]},'mobile':{'type':Sequelize[_0xe7a9('0x2')]},'address':{'type':Sequelize[_0xe7a9('0x2')]},'zipcode':{'type':Sequelize[_0xe7a9('0x2')]},'userpic':{'type':Sequelize[_0xe7a9('0x2')]},'city':{'type':Sequelize[_0xe7a9('0x2')]},'country':{'type':Sequelize[_0xe7a9('0x2')]},'online':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xe7a9('0x15')},'lastPauseAt':{'type':Sequelize[_0xe7a9('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe7a9('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe7a9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![],'defaultValue':_0xe7a9('0x17')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xe7a9('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xe7a9('0x18'),_0xe7a9('0x19'),_0xe7a9('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x1b'),_0xe7a9('0x1c'),_0xe7a9('0x1d'),_0xe7a9('0x1e'),_0xe7a9('0x1f'),_0xe7a9('0x20'),'PROHIB_FAILED_SCREEN',_0xe7a9('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![],'defaultValue':_0xe7a9('0x22'),'set':function(_0x155d5d){this[_0xe7a9('0x4')]('transport',_0x155d5d?_0x155d5d['join'](','):null);},'get':function(){return this['getDataValue'](_0xe7a9('0x23'))?this[_0xe7a9('0x13')](_0xe7a9('0x23'))['split'](','):null;},'comment':_0xe7a9('0x24')},'dtmfmode':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x25'),_0xe7a9('0x26'),_0xe7a9('0x27'),_0xe7a9('0x28'),_0xe7a9('0x29')),'allowNull':!![],'defaultValue':_0xe7a9('0x25')},'directmedia':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no',_0xe7a9('0x2b'),_0xe7a9('0x2c'),_0xe7a9('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x355ce5){this[_0xe7a9('0x4')]('nat',_0x355ce5?_0x355ce5['join'](','):null);},'get':function(){return this[_0xe7a9('0x13')](_0xe7a9('0x2e'))?this[_0xe7a9('0x13')]('nat')[_0xe7a9('0x2f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xe7a9('0x2')]},'namedcallgroup':{'type':Sequelize[_0xe7a9('0x2')]},'pickupgroup':{'type':Sequelize[_0xe7a9('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xe7a9('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe7a9('0x2')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe7a9('0x30')},'allow':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x814503){this[_0xe7a9('0x4')](_0xe7a9('0x31'),_0x814503?_0x814503[_0xe7a9('0x32')](';'):_0xe7a9('0x33'));},'get':function(){return this[_0xe7a9('0x13')](_0xe7a9('0x31'))?this[_0xe7a9('0x13')](_0xe7a9('0x31'))[_0xe7a9('0x2f')](';'):null;},'comment':_0xe7a9('0x34')},'autoframing':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![],'set':function(_0x2a5561){this[_0xe7a9('0x4')](_0xe7a9('0x35'),_0x2a5561?_0x2a5561['join'](','):null);},'get':function(){return this[_0xe7a9('0x13')](_0xe7a9('0x35'))?this[_0xe7a9('0x13')](_0xe7a9('0x35'))[_0xe7a9('0x2f')](','):null;},'comment':_0xe7a9('0x36')},'trustrpid':{'type':Sequelize['ENUM'](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no',_0xe7a9('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe7a9('0xb')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xe7a9('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no',_0xe7a9('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xe7a9('0x39'),_0xe7a9('0x3a'),_0xe7a9('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xe7a9('0x3c'),_0xe7a9('0x3d')),'allowNull':!![],'defaultValue':_0xe7a9('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xe7a9('0x2a')},'keepalive':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no',_0xe7a9('0x3e'),_0xe7a9('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x40'),_0xe7a9('0x41'),_0xe7a9('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xe7a9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xe7a9('0xb')](_0xe7a9('0x2a'),'no',_0xe7a9('0x2b'),_0xe7a9('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe7a9('0x2')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xe7a9('0x43')]},'showWebBar':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0,'set':function(_0xe7af9c){this['setDataValue']('showWebBar',_0xe7af9c);var _0x50e1a4=this[_0xe7a9('0x44')]({'plain':!![]});switch(_0xe7af9c){case 0x0:case 0x1:var _0x572782=_0x50e1a4['transport']?_[_0xe7a9('0x45')](_0x50e1a4['transport'])?_0x50e1a4[_0xe7a9('0x23')][_0xe7a9('0x32')]():_0x50e1a4['transport']:'udp';if(_0x572782==='wss'){_0x572782=_0xe7a9('0x22');}this[_0xe7a9('0x4')]('transport',_0x572782);this[_0xe7a9('0x4')]('encryption','no');this[_0xe7a9('0x4')](_0xe7a9('0x46'),null);this[_0xe7a9('0x4')](_0xe7a9('0x47'),null);this[_0xe7a9('0x4')](_0xe7a9('0x48'),null);this[_0xe7a9('0x4')](_0xe7a9('0x49'),null);this['setDataValue'](_0xe7a9('0x4a'),null);this[_0xe7a9('0x4')]('dtlssetup',null);this[_0xe7a9('0x4')](_0xe7a9('0x4b'),null);this[_0xe7a9('0x4')]('dtlsprivatekey',null);this['setDataValue'](_0xe7a9('0x4c'),'no');break;case 0x2:this[_0xe7a9('0x4')](_0xe7a9('0x23'),_0xe7a9('0x4d'));this['setDataValue'](_0xe7a9('0x4e'),_0xe7a9('0x2a'));this[_0xe7a9('0x4')](_0xe7a9('0x46'),_0xe7a9('0x2a'));this[_0xe7a9('0x4')](_0xe7a9('0x47'),'yes');this[_0xe7a9('0x4')](_0xe7a9('0x48'),_0xe7a9('0x2a'));this[_0xe7a9('0x4')]('dtlsenable',_0xe7a9('0x2a'));this[_0xe7a9('0x4')](_0xe7a9('0x4a'),'no');this[_0xe7a9('0x4')]('dtlssetup',_0xe7a9('0x42'));this[_0xe7a9('0x4')](_0xe7a9('0x4b'),_0x50e1a4[_0xe7a9('0x4b')]||_0xe7a9('0x4f'));this[_0xe7a9('0x4')](_0xe7a9('0x50'),_0x50e1a4['dtlsprivatekey']||_0xe7a9('0x51'));this[_0xe7a9('0x4')](_0xe7a9('0x4c'),_0xe7a9('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xe7a9('0x43')],'set':function(_0x1057c6){this[_0xe7a9('0x4')](_0xe7a9('0x52'),_0x1057c6?_0x1057c6[_0xe7a9('0x32')](','):[]);},'get':function(){return this[_0xe7a9('0x13')](_0xe7a9('0x52'))?_[_0xe7a9('0x53')](this[_0xe7a9('0x13')](_0xe7a9('0x52'))[_0xe7a9('0x2f')](','),function(_0x1aeaf3){return parseInt(_0x1aeaf3,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xe7a9('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe7a9('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xe7a9('0x54')],'get':function(){return this[_0xe7a9('0x13')](_0xe7a9('0x55'))?this[_0xe7a9('0x13')](_0xe7a9('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe7a9('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![],'set':function(_0x17e840){if(typeof _0x17e840===_0xe7a9('0x56')){var _0x233f53=_0x17e840==='1'?!![]:_0x17e840==='0'?![]:_0x17e840===_0xe7a9('0x57')?!![]:_0x17e840===_0xe7a9('0x58')?![]:![];this[_0xe7a9('0x4')](_0xe7a9('0x59'),_0x233f53);}else{this[_0xe7a9('0x4')](_0xe7a9('0x59'),_0x17e840);}}},'blocked':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![],'set':function(_0x1d71e0){this[_0xe7a9('0x4')](_0xe7a9('0x5a'),_0x1d71e0);if(_0x1d71e0===!![]){this[_0xe7a9('0x4')](_0xe7a9('0x5b'),moment());this[_0xe7a9('0x4')]('loginAttempts',0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xe7a9('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xe7a9('0xf')](0x5)[_0xe7a9('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xe7a9('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x278a=['ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','transport','join','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]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','dtlsenable','dtlssetup','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','STRING','email','toLowerCase','user','agent','telephone','local','INTEGER','BOOLEAN','DATE','dynamic'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x278a,0xfd));var _0xa278=function(_0x593145,_0x3e1a04){_0x593145=_0x593145-0x0;var _0x43d926=_0x278a[_0x593145];return _0x43d926;};'use strict';var Sequelize=require(_0xa278('0x0'));var moment=require(_0xa278('0x1'));var util=require(_0xa278('0x2'));var _=require(_0xa278('0x3'));module[_0xa278('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa278('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5e238a){this['setDataValue'](_0xa278('0x5'),_0x5e238a);this[_0xa278('0x6')](_0xa278('0x7'),_0x5e238a);},'comment':_0xa278('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3fb6dd){this[_0xa278('0x6')](_0xa278('0x9'),_0x3fb6dd);this[_0xa278('0x6')](_0xa278('0xa'),util[_0xa278('0xb')](_0xa278('0xc'),_0x3fb6dd,this[_0xa278('0xd')](_0xa278('0xe'))));}},'alias':{'type':Sequelize[_0xa278('0xf')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa278('0x10'),'validate':{'isEmail':!![]},'set':function(_0x1fad3d){if(_0x1fad3d){this['setDataValue'](_0xa278('0x10'),_0x1fad3d[_0xa278('0x11')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xa278('0x12'),_0xa278('0x13'),_0xa278('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0xa278('0xf')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa278('0xf')],'defaultValue':_0xa278('0x15')},'internal':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':![],'unique':_0xa278('0xe'),'set':function(_0x12e182){this['setDataValue'](_0xa278('0xe'),_0x12e182);this[_0xa278('0x6')]('accountcode',_0x12e182);this[_0xa278('0x6')](_0xa278('0xa'),util[_0xa278('0xb')](_0xa278('0xc'),this[_0xa278('0xd')](_0xa278('0x9')),_0x12e182));}},'salt':{'type':Sequelize[_0xa278('0xf')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xa278('0xf')]},'zipcode':{'type':Sequelize[_0xa278('0xf')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa278('0xf')]},'online':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa278('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa278('0xf')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xa278('0x18')]},'chatCapacity':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa278('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa278('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x1b'),'user',_0xa278('0x1c')),'allowNull':!![],'defaultValue':_0xa278('0x1b')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa278('0x1d')},'callingpres':{'type':Sequelize[_0xa278('0x1a')]('ALLOWED_NOT_SCREENED',_0xa278('0x1e'),_0xa278('0x1f'),_0xa278('0x20'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xa278('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![],'defaultValue':_0xa278('0x22'),'set':function(_0xfed800){this[_0xa278('0x6')](_0xa278('0x23'),_0xfed800?_0xfed800[_0xa278('0x24')](','):null);},'get':function(){return this[_0xa278('0xd')](_0xa278('0x23'))?this['getDataValue'](_0xa278('0x23'))[_0xa278('0x25')](','):null;},'comment':_0xa278('0x26')},'dtmfmode':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x27'),_0xa278('0x28'),'shortinfo',_0xa278('0x29'),_0xa278('0x2a')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xa278('0x2b'),'no',_0xa278('0x2c'),_0xa278('0x2d'),_0xa278('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa278('0x2f'),'set':function(_0x41fefc){this[_0xa278('0x6')](_0xa278('0x30'),_0x41fefc?_0x41fefc[_0xa278('0x24')](','):null);},'get':function(){return this['getDataValue'](_0xa278('0x30'))?this[_0xa278('0xd')](_0xa278('0x30'))[_0xa278('0x25')](','):null;},'comment':_0xa278('0x31')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xa278('0xf')]},'pickupgroup':{'type':Sequelize[_0xa278('0xf')]},'namedpickupgroup':{'type':Sequelize[_0xa278('0xf')]},'language':{'type':Sequelize[_0xa278('0xf')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa278('0xf')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa278('0xf')],'allowNull':![],'defaultValue':_0xa278('0x32'),'set':function(_0xef83ae){this[_0xa278('0x6')](_0xa278('0x33'),_0xef83ae?_0xef83ae[_0xa278('0x24')](';'):_0xa278('0x32'));},'get':function(){return this[_0xa278('0xd')]('allow')?this[_0xa278('0xd')](_0xa278('0x33'))['split'](';'):null;},'comment':_0xa278('0x34')},'autoframing':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x45fc05){this[_0xa278('0x6')](_0xa278('0x35'),_0x45fc05?_0x45fc05['join'](','):null);},'get':function(){return this[_0xa278('0xd')](_0xa278('0x35'))?this['getDataValue'](_0xa278('0x35'))[_0xa278('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xa278('0x2b'),'no',_0xa278('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![],'defaultValue':_0xa278('0x37')},'amaflags':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa278('0x1a')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no',_0xa278('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa278('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x39'),_0xa278('0x3a'),_0xa278('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa278('0x1a')]('uac',_0xa278('0x3c')),'allowNull':!![],'defaultValue':_0xa278('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0xa278('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa278('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no',_0xa278('0x3d'),_0xa278('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x3f'),_0xa278('0x40'),_0xa278('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa278('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no',_0xa278('0x2c'),_0xa278('0x2d'),_0xa278('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa278('0xf')]},'resetPasswordExpires':{'type':Sequelize[_0xa278('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa278('0x43')]},'showWebBar':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0,'set':function(_0xa3f48e){this[_0xa278('0x6')]('showWebBar',_0xa3f48e);var _0x22f124=this[_0xa278('0x44')]({'plain':!![]});switch(_0xa3f48e){case 0x0:case 0x1:var _0x116b45=_0x22f124['transport']?_[_0xa278('0x45')](_0x22f124[_0xa278('0x23')])?_0x22f124['transport'][_0xa278('0x24')]():_0x22f124[_0xa278('0x23')]:_0xa278('0x22');if(_0x116b45==='wss'){_0x116b45=_0xa278('0x22');}this['setDataValue'](_0xa278('0x23'),_0x116b45);this[_0xa278('0x6')](_0xa278('0x46'),'no');this[_0xa278('0x6')](_0xa278('0x47'),null);this[_0xa278('0x6')](_0xa278('0x48'),null);this[_0xa278('0x6')](_0xa278('0x49'),null);this[_0xa278('0x6')]('dtlsenable',null);this[_0xa278('0x6')](_0xa278('0x4a'),null);this[_0xa278('0x6')]('dtlssetup',null);this[_0xa278('0x6')](_0xa278('0x4b'),null);this[_0xa278('0x6')](_0xa278('0x4c'),null);this['setDataValue'](_0xa278('0x4d'),'no');break;case 0x2:this['setDataValue'](_0xa278('0x23'),_0xa278('0x4e'));this[_0xa278('0x6')]('encryption',_0xa278('0x2b'));this[_0xa278('0x6')]('avpf',_0xa278('0x2b'));this['setDataValue'](_0xa278('0x48'),'yes');this[_0xa278('0x6')](_0xa278('0x49'),'yes');this[_0xa278('0x6')](_0xa278('0x4f'),'yes');this['setDataValue']('dtlsverify','no');this[_0xa278('0x6')](_0xa278('0x50'),_0xa278('0x41'));this[_0xa278('0x6')](_0xa278('0x4b'),_0x22f124['dtlscertfile']||_0xa278('0x51'));this[_0xa278('0x6')](_0xa278('0x4c'),_0x22f124['dtlsprivatekey']||_0xa278('0x52'));this[_0xa278('0x6')](_0xa278('0x4d'),_0xa278('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xa278('0x43')],'set':function(_0x4af163){this['setDataValue']('permissions',_0x4af163?_0x4af163[_0xa278('0x24')](','):[]);},'get':function(){return this[_0xa278('0xd')]('permissions')?_[_0xa278('0x53')](this['getDataValue'](_0xa278('0x54'))[_0xa278('0x25')](','),function(_0x230f14){return parseInt(_0x230f14,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa278('0xf')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa278('0x1a')](_0xa278('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa278('0xf')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa278('0xd')](_0xa278('0x55'))?this[_0xa278('0xd')](_0xa278('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa278('0xf')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa278('0xf')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![],'set':function(_0x358ade){if(typeof _0x358ade==='string'){var _0x174954=_0x358ade==='1'?!![]:_0x358ade==='0'?![]:_0x358ade===_0xa278('0x56')?!![]:_0x358ade===_0xa278('0x57')?![]:![];this[_0xa278('0x6')](_0xa278('0x58'),_0x174954);}else{this[_0xa278('0x6')](_0xa278('0x58'),_0x358ade);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x408b4d){this[_0xa278('0x6')](_0xa278('0x59'),_0x408b4d);if(_0x408b4d===!![]){this['setDataValue'](_0xa278('0x5a'),moment());this[_0xa278('0x6')](_0xa278('0x5b'),0x0);}else{this[_0xa278('0x6')](_0xa278('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0xa278('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa278('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa278('0x16')](0x5)[_0xa278('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa278('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa278('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 8fb00d6..35c8c66 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 _0x3060=['102','113','110','104','105','106','107','108','114','115','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','create','VoiceMail','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','all','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','voicePause','interface','isValidChannel','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','voice','VoiceQueue','get','format','SIP/%s','each','UserVoiceQueueRt','removeQueues','channel','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','order','sort','pick','hasOwnProperty','includeAll','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','login','mobile','loginInPause','intrf','user:%s','x-forwarded-for','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','MemberReport','forEach','pause','updateAttributes','DEFAULT\x20PAUSE','mailPause','faxPause','whatsapppause','pauseType','QueuePause','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','flatten','addAgent','getDataValue','UserVoicePrefix','removeTeams','Mail','Fax','removeAgent','TeamVoicePrefix','VoicePrefixId','CmList','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$or','$gt','$gte','$lte','$ne','$not','$between','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','firstName','lastName','Contact','dialActive','CmHopper','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','inbound','queues','lower','col','toString','desc','asc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','role','Users','user','Agents','agent','Telephones','telephone','filter','map','value','find','name','UserProfileResource','sendStatus','send','User','rawAttributes','fieldName','type','key','includes','password','salt','getOptions','where','query','include','userSetting','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','sms','dataValues','mail','openchannel','whatsapp','show','params','model','differenceBy','keys','filters','intersection','fields','true','merge','options','fax','body','describe','addContacts','ids','omit','internal','Setting','securePassword','max','min_internal','isNil','sequelize','QueryTypes','SELECT','from','mailbox','fullname','email','permissions','101'];(function(_0x4c6505,_0x456af0){var _0x418c8c=function(_0xecb7ca){while(--_0xecb7ca){_0x4c6505['push'](_0x4c6505['shift']());}};_0x418c8c(++_0x456af0);}(_0x3060,0x125));var _0x0306=function(_0x29e398,_0x890225){_0x29e398=_0x29e398-0x0;var _0xd799e2=_0x3060[_0x29e398];return _0xd799e2;};'use strict';var moment=require('moment');var BPromise=require(_0x0306('0x0'));var util=require(_0x0306('0x1'));var path=require(_0x0306('0x2'));var fs=require('fs');var _=require(_0x0306('0x3'));var squel=require(_0x0306('0x4'));var jayson=require(_0x0306('0x5'));var Redis=require(_0x0306('0x6'));var authService=require(_0x0306('0x7'));var qs=require(_0x0306('0x8'));var logger=require(_0x0306('0x9'))(_0x0306('0xa'));var utils=require(_0x0306('0xb'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0306('0xc'))['db'];var socket=require(_0x0306('0xd'))(new Redis(config[_0x0306('0xe')]));require(_0x0306('0xf'))[_0x0306('0x10')](socket);config[_0x0306('0xe')]=_[_0x0306('0x11')](config['redis'],{'host':_0x0306('0x12'),'port':0x18eb});var client=jayson[_0x0306('0x13')][_0x0306('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x35133c,_0x45f64d,_0x45d893,_0x55ce25){return new BPromise(function(_0x219973,_0x1a059f){var _0x2c14ae=_0x55ce25||client;return _0x2c14ae[_0x0306('0x15')](_0x35133c,_0x45d893)['then'](function(_0x23a4d2){logger[_0x0306('0x16')](_0x0306('0x17'),_0x45f64d,_0x0306('0x18'));logger['debug'](_0x0306('0x19'),_0x45f64d,'request\x20sent',JSON[_0x0306('0x1a')](_0x23a4d2));if(_0x23a4d2[_0x0306('0x1b')]){if(_0x23a4d2['error'][_0x0306('0x1c')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x45f64d,_0x23a4d2[_0x0306('0x1b')][_0x0306('0x1d')]);return _0x1a059f(_0x23a4d2['error']['message']);}logger['error'](_0x0306('0x17'),_0x45f64d,_0x23a4d2[_0x0306('0x1b')][_0x0306('0x1d')]);return _0x219973(_0x23a4d2[_0x0306('0x1b')]['message']);}else{logger['info']('User,\x20%s,\x20%s',_0x45f64d,'request\x20sent');_0x219973(_0x23a4d2[_0x0306('0x1e')][_0x0306('0x1d')]);}})[_0x0306('0x1f')](function(_0x1bf1c1){logger[_0x0306('0x1b')](_0x0306('0x17'),_0x45f64d,_0x1bf1c1);_0x1a059f(_0x1bf1c1);});});}function respondWithStatusCode(_0x4d2017,_0x525b25){_0x525b25=_0x525b25||0xcc;return function(_0x42df76){if(_0x42df76){return _0x4d2017['sendStatus'](_0x525b25);}return _0x4d2017[_0x0306('0x20')](_0x525b25)[_0x0306('0x21')]();};}function respondWithResult(_0x462d64,_0x4ef188){_0x4ef188=_0x4ef188||0xc8;return function(_0x229277){if(_0x229277){return _0x462d64[_0x0306('0x20')](_0x4ef188)[_0x0306('0x22')](_0x229277);}};}function respondWithFilteredResult(_0x37d910,_0x1790fa){return function(_0x2c8df7){if(_0x2c8df7){var _0x106af7=typeof _0x1790fa[_0x0306('0x23')]===_0x0306('0x24')&&typeof _0x1790fa[_0x0306('0x25')]===_0x0306('0x24');var _0x1a8554=_0x2c8df7[_0x0306('0x26')];var _0x1eaf3c=_0x106af7?0x0:_0x1790fa['offset'];var _0x4b9d04=_0x106af7?_0x2c8df7[_0x0306('0x26')]:_0x1790fa['offset']+_0x1790fa[_0x0306('0x25')];var _0x2e5ba4;if(_0x4b9d04>=_0x1a8554){_0x4b9d04=_0x1a8554;_0x2e5ba4=0xc8;}else{_0x2e5ba4=0xce;}_0x37d910[_0x0306('0x20')](_0x2e5ba4);return _0x37d910[_0x0306('0x27')](_0x0306('0x28'),_0x1eaf3c+'-'+_0x4b9d04+'/'+_0x1a8554)['json'](_0x2c8df7);}return null;};}function saveUpdates(_0x1be0f1){return function(_0x46d247){if(_0x46d247){return _0x46d247[_0x0306('0x29')](_0x1be0f1)[_0x0306('0x2a')](function(_0x5aa6f7){return _0x5aa6f7;});}return null;};}function removeEntity(_0x155c61){return function(_0xe7146e){if(_0xe7146e){return _0xe7146e[_0x0306('0x2b')]()[_0x0306('0x2a')](function(){var _0x912ac5=_0xe7146e['get']({'plain':!![]});if(_0x912ac5[_0x0306('0x2c')]==='admin')return;var _0xebda3e=[{'name':_0x0306('0x2d'),'value':_0x0306('0x2e'),'ignore':!![]},{'name':_0x0306('0x2f'),'value':_0x0306('0x30'),'ignore':![]},{'name':_0x0306('0x31'),'value':_0x0306('0x32'),'ignore':![]}];var _0x19bfb6=_(_0xebda3e)[_0x0306('0x33')]('ignore')[_0x0306('0x34')](_0x0306('0x35'))[_0x0306('0x35')]();if(_['includes'](_0x19bfb6,_0x912ac5[_0x0306('0x2c')])){return;}var _0x5bac49=_[_0x0306('0x36')](_0xebda3e,['value',_0x912ac5[_0x0306('0x2c')]])[_0x0306('0x37')];return db[_0x0306('0x38')][_0x0306('0x2b')]({'where':{'type':_0x5bac49,'resourceId':_0x912ac5['id']}})['then'](function(){return _0xe7146e;});})['then'](function(){_0x155c61[_0x0306('0x20')](0xcc)[_0x0306('0x21')]();});}};}function handleEntityNotFound(_0x1eef17){return function(_0x57d692){if(!_0x57d692){_0x1eef17[_0x0306('0x39')](0x194);}return _0x57d692;};}function handleError(_0x479fd6,_0x303d3f){_0x303d3f=_0x303d3f||0x1f4;return function(_0x1ff98b){logger[_0x0306('0x1b')](_0x1ff98b['stack']);if(_0x1ff98b[_0x0306('0x37')]){delete _0x1ff98b['name'];}_0x479fd6[_0x0306('0x20')](_0x303d3f)[_0x0306('0x3a')](_0x1ff98b);};}exports['index']=function(_0x1dbfd8,_0x1dfb81){var _0x419c86={},_0xe666ba={'count':0x0,'rows':[]};var _0x4e4af1=_(db[_0x0306('0x3b')][_0x0306('0x3c')])['map'](function(_0x56b401){return{'name':_0x56b401[_0x0306('0x3d')],'type':_0x56b401[_0x0306('0x3e')][_0x0306('0x3f')]};})[_0x0306('0x33')](function(_0x148079){return!_[_0x0306('0x40')]([_0x0306('0x41'),_0x0306('0x42')],_0x148079['name']);})['value']();_0x419c86=qs[_0x0306('0x43')](_0x4e4af1,_0x1dbfd8);var _0x457699={'where':_0x419c86[_0x0306('0x44')]};return db['User'][_0x0306('0x26')](_0x457699)[_0x0306('0x2a')](function(_0x21c72b){_0xe666ba[_0x0306('0x26')]=_0x21c72b;if(_0x1dbfd8[_0x0306('0x45')]['includeAll']){_0x419c86[_0x0306('0x46')]=[{'all':!![]}];}if(_0x1dbfd8[_0x0306('0x45')][_0x0306('0x47')]==='true'){_0x419c86[_0x0306('0x46')]=[{'model':db[_0x0306('0x48')],'as':_0x0306('0x47')}];}if(!_[_0x0306('0x40')](_0x419c86['attributes'],'id')){_0x419c86[_0x0306('0x49')][_0x0306('0x4a')]('id');}return db[_0x0306('0x3b')][_0x0306('0x4b')](_0x419c86);})[_0x0306('0x2a')](function(_0x30c319){_0xe666ba[_0x0306('0x4c')]=_0x30c319;if(_0x1dbfd8['query'][_0x0306('0x4d')]==='true'){var _0x52faf1=[];for(var _0x392d33=0x0;_0x392d33<_0xe666ba[_0x0306('0x4c')][_0x0306('0x4e')];_0x392d33++){_0x52faf1['push'](get_open_tabs(_0x0306('0x4f'),_0xe666ba['rows'][_0x392d33]['dataValues']));_0x52faf1[_0x0306('0x4a')](get_open_tabs(_0x0306('0x50'),_0xe666ba[_0x0306('0x4c')][_0x392d33][_0x0306('0x51')]));_0x52faf1['push'](get_open_tabs('fax',_0xe666ba[_0x0306('0x4c')][_0x392d33][_0x0306('0x51')]));_0x52faf1[_0x0306('0x4a')](get_open_tabs(_0x0306('0x52'),_0xe666ba['rows'][_0x392d33][_0x0306('0x51')]));_0x52faf1[_0x0306('0x4a')](get_open_tabs(_0x0306('0x53'),_0xe666ba[_0x0306('0x4c')][_0x392d33]['dataValues']));_0x52faf1['push'](get_open_tabs(_0x0306('0x54'),_0xe666ba[_0x0306('0x4c')][_0x392d33]['dataValues']));}return BPromise['all'](_0x52faf1)[_0x0306('0x2a')](function(){return _0xe666ba;});}else{return _0xe666ba;}})[_0x0306('0x2a')](respondWithFilteredResult(_0x1dfb81,_0x419c86))[_0x0306('0x1f')](handleError(_0x1dfb81,null));};exports[_0x0306('0x55')]=function(_0x3adca6,_0xc38679){var _0x5c9a42={'raw':![],'where':{'id':_0x3adca6[_0x0306('0x56')]['id']}},_0x25fd3f={};_0x25fd3f[_0x0306('0x57')]=_[_0x0306('0x58')](_['keys'](db[_0x0306('0x3b')][_0x0306('0x3c')]),['password',_0x0306('0x42')]);_0x25fd3f['query']=_[_0x0306('0x59')](_0x3adca6[_0x0306('0x45')]);_0x25fd3f[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x25fd3f[_0x0306('0x57')],_0x25fd3f[_0x0306('0x45')]);_0x5c9a42[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x25fd3f[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x3adca6[_0x0306('0x45')]['fields']));_0x5c9a42['attributes']=_0x5c9a42[_0x0306('0x49')][_0x0306('0x4e')]?_0x5c9a42[_0x0306('0x49')]:_0x25fd3f[_0x0306('0x57')];if(_0x3adca6[_0x0306('0x45')]['includeAll']){_0x5c9a42[_0x0306('0x46')]=[{'all':!![]}];}if(_0x3adca6['query'][_0x0306('0x47')]===_0x0306('0x5d')){_0x5c9a42[_0x0306('0x46')]=[{'model':db[_0x0306('0x48')],'as':_0x0306('0x47')}];}_0x5c9a42=_[_0x0306('0x5e')]({},_0x5c9a42,_0x3adca6[_0x0306('0x5f')]);if(!_['includes'](_0x5c9a42[_0x0306('0x49')],'id')){_0x5c9a42[_0x0306('0x49')][_0x0306('0x4a')]('id');}return db[_0x0306('0x3b')]['find'](_0x5c9a42)[_0x0306('0x2a')](handleEntityNotFound(_0xc38679,null))['then'](function(_0x1a483e){var _0x294b82=[];values=_0x1a483e;if(_0x3adca6['query']['openTabs']===_0x0306('0x5d')){_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x4f'),_0x1a483e[_0x0306('0x51')]));_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x50'),_0x1a483e[_0x0306('0x51')]));_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x53'),_0x1a483e[_0x0306('0x51')]));_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x54'),_0x1a483e['dataValues']));_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x60'),_0x1a483e[_0x0306('0x51')]));_0x294b82[_0x0306('0x4a')](get_open_tabs(_0x0306('0x52'),_0x1a483e[_0x0306('0x51')]));return BPromise['all'](_0x294b82);}else{return values;}})[_0x0306('0x2a')](function(){return values;})[_0x0306('0x2a')](respondWithResult(_0xc38679,null))['catch'](handleError(_0xc38679,null));};exports[_0x0306('0x29')]=function(_0xb948bb,_0x22f983){if(_0xb948bb['body']['id']){delete _0xb948bb[_0x0306('0x61')]['id'];}delete _0xb948bb['body'][_0x0306('0x2c')];return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0xb948bb[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x22f983,null))[_0x0306('0x2a')](saveUpdates(_0xb948bb[_0x0306('0x61')],null))[_0x0306('0x2a')](respondWithResult(_0x22f983,null))['catch'](handleError(_0x22f983,null));};exports[_0x0306('0x62')]=function(_0xbdd295,_0x1ad318){return db[_0x0306('0x3b')]['describe']()[_0x0306('0x2a')](respondWithResult(_0x1ad318,null))[_0x0306('0x1f')](handleError(_0x1ad318,null));};exports[_0x0306('0x63')]=function(_0x1d031,_0x578ae9){return db['User'][_0x0306('0x36')]({'where':{'id':_0x1d031[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x578ae9,null))[_0x0306('0x2a')](function(_0x5f409f){if(_0x5f409f){return _0x5f409f['addContacts'](_0x1d031[_0x0306('0x61')][_0x0306('0x64')],_[_0x0306('0x65')](_0x1d031[_0x0306('0x61')],[_0x0306('0x64'),'id'])||{});}})[_0x0306('0x2a')](respondWithResult(_0x578ae9,null))[_0x0306('0x1f')](handleError(_0x578ae9,null));};function validateUser(_0x2ef046){return new BPromise(function(_0x36cf83,_0x2960e9){if(_0x2ef046[_0x0306('0x66')])return _0x36cf83(_0x2ef046);return db[_0x0306('0x67')]['findById'](0x1)['then'](function(_0x45a4e4){if(_0x45a4e4[_0x0306('0x68')])authService['validatePasswordPattern'](_0x2ef046[_0x0306('0x41')]);db['User'][_0x0306('0x69')]('internal')['then'](function(_0x496f65){if(_['isNil'](_0x496f65)){_0x2ef046[_0x0306('0x66')]=_0x45a4e4[_0x0306('0x6a')]||0x1;return;}if(_[_0x0306('0x6b')](_0x45a4e4[_0x0306('0x6a')])||_0x45a4e4[_0x0306('0x6a')]===_0x496f65){_0x2ef046[_0x0306('0x66')]=_0x496f65+0x1;return;}if(_0x45a4e4['min_internal']>_0x496f65){_0x2ef046[_0x0306('0x66')]=_0x45a4e4['min_internal'];return;}return db[_0x0306('0x6c')][_0x0306('0x45')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x0306('0x6c')][_0x0306('0x6d')][_0x0306('0x6e')]})[_0x0306('0x2a')](function(_0x33946d){if(_0x33946d&&_0x33946d[_0x0306('0x4e')]){for(var _0x4661c0=0x0,_0xd6925a=_0x33946d[_0x0306('0x4e')];_0x4661c0<_0xd6925a&&_[_0x0306('0x6b')](_0x2ef046[_0x0306('0x66')]);_0x4661c0++){if(_0x45a4e4[_0x0306('0x6a')]<=_0x33946d[_0x4661c0][_0x0306('0x6f')]){_0x2ef046['internal']=_0x33946d[_0x4661c0]['from'];}else if(_0x45a4e4[_0x0306('0x6a')]>_0x33946d[_0x4661c0][_0x0306('0x6f')]&&_0x45a4e4[_0x0306('0x6a')]<=_0x33946d[_0x4661c0]['to']){_0x2ef046[_0x0306('0x66')]=_0x45a4e4[_0x0306('0x6a')];}}}if(_[_0x0306('0x6b')](_0x2ef046[_0x0306('0x66')])){_0x2ef046['internal']=_0x496f65+0x1;}return _0x36cf83(_0x2ef046);});});})[_0x0306('0x1f')](function(_0x39c469){_0x2960e9(_0x39c469);});});}function updateUser(_0x61036d){return new BPromise(function(_0x3d2763,_0x425c17){try{if(_0x61036d['voicemail']){_0x61036d[_0x0306('0x70')]=_0x61036d[_0x0306('0x66')];_0x61036d['VoiceMail']={'mailbox':_0x61036d[_0x0306('0x66')],'password':_0x61036d[_0x0306('0x41')],'fullname':_0x61036d[_0x0306('0x71')],'email':_0x61036d[_0x0306('0x72')]};}if(_0x61036d[_0x0306('0x2c')]===_0x0306('0x30')){if(!_0x61036d[_0x0306('0x73')])_0x61036d[_0x0306('0x73')]=[_0x0306('0x74'),_0x0306('0x75'),'103',_0x0306('0x76'),_0x0306('0x77'),_0x0306('0x78'),_0x0306('0x79'),_0x0306('0x7a'),_0x0306('0x7b'),_0x0306('0x7c'),'109','100','111',_0x0306('0x7d'),_0x0306('0x7e')];}_0x3d2763(_0x61036d);}catch(_0x4ad227){_0x425c17(_0x4ad227);}});}exports['create']=function(_0x3dbf92,_0x873c1){if(_0x3dbf92[_0x0306('0x2e')][_0x0306('0x2c')]===_0x0306('0x30'))throw new Error(_0x0306('0x7f'));if(_0x3dbf92[_0x0306('0x61')]['role']===_0x0306('0x2e')&&_0x3dbf92['user'][_0x0306('0x2c')]!==_0x0306('0x80')){throw new Error(_0x0306('0x81'));}if(_0x3dbf92[_0x0306('0x61')]['role']===_0x0306('0x80')&&_0x3dbf92[_0x0306('0x2e')][_0x0306('0x2c')]!==_0x0306('0x80')){throw new Error(_0x0306('0x82'));}return licenseUtil['checkUserLimits']([_0x3dbf92[_0x0306('0x61')]])[_0x0306('0x2a')](function(){return validateUser(_0x3dbf92['body']);})['then'](function(_0x3931b3){return updateUser(_0x3931b3)[_0x0306('0x2a')](function(_0x3e049e){if(_0x3e049e['role']===_0x0306('0x80')){_0x3e049e[_0x0306('0x83')]=_0x3dbf92[_0x0306('0x2e')][_0x0306('0x83')];delete _0x3e049e['userProfileId'];}return _0x3e049e;});})[_0x0306('0x2a')](function(_0x30dfaa){return db[_0x0306('0x3b')][_0x0306('0x84')](_0x30dfaa,{'include':[{'model':db['VoiceMail'],'as':_0x0306('0x85')}]});})[_0x0306('0x2a')](function(_0x3c47f1){if(_0x3dbf92[_0x0306('0x61')][_0x0306('0x2c')]==='user')return _0x3c47f1;if(_0x3dbf92[_0x0306('0x2e')][_0x0306('0x2c')]!=='user')return _0x3c47f1;return db[_0x0306('0x86')][_0x0306('0x36')]({'where':{'name':_0x3c47f1[_0x0306('0x2c')]===_0x0306('0x30')?'Agents':_0x0306('0x31'),'userProfileId':_0x3dbf92['user'][_0x0306('0x87')]},'raw':!![]})['then'](function(_0x2c7ef5){if(!_0x2c7ef5||_0x2c7ef5['autoAssociation']!=0x0)return _0x3c47f1;return db[_0x0306('0x38')][_0x0306('0x84')]({'name':_0x3c47f1[_0x0306('0x37')],'resourceId':_0x3c47f1['id'],'type':_0x2c7ef5[_0x0306('0x37')],'sectionId':_0x2c7ef5['id']},{})[_0x0306('0x2a')](function(){return _0x3c47f1;});})[_0x0306('0x1f')](function(_0x26f983){logger['error'](_0x0306('0x88'),_0x26f983);throw _0x26f983;});})[_0x0306('0x2a')](respondWithResult(_0x873c1,0xc9))[_0x0306('0x1f')](handleError(_0x873c1,null));};exports[_0x0306('0x89')]=function(_0x514609,_0x1a710f){var _0x19c150=_0x514609[_0x0306('0x61')];var _0x461500=[];if(_0x514609[_0x0306('0x2e')][_0x0306('0x2c')]==='agent')throw new Error(_0x0306('0x7f'));if(_[_0x0306('0x8a')](_0x19c150,[_0x0306('0x2c'),_0x0306('0x2e')])&&_0x514609['user'][_0x0306('0x2c')]!=='admin'){throw new Error(_0x0306('0x81'));}if(_[_0x0306('0x8a')](_0x19c150,[_0x0306('0x2c'),_0x0306('0x80')])&&_0x514609[_0x0306('0x2e')][_0x0306('0x2c')]!==_0x0306('0x80')){throw new Error(_0x0306('0x8b'));}return licenseUtil[_0x0306('0x8c')](_0x19c150)[_0x0306('0x2a')](function(){return validateUser(_0x19c150[0x0]);})[_0x0306('0x2a')](function(){for(var _0x589001=0x1;_0x589001<_0x19c150[_0x0306('0x4e')];_0x589001++){var _0x11becf=_0x19c150[_0x589001-0x1]['internal'];if(!_0x19c150[_0x589001][_0x0306('0x66')])_0x19c150[_0x589001][_0x0306('0x66')]=_0x11becf+0x1;_0x461500[_0x0306('0x4a')](validateUser(_0x19c150[_0x589001]));}return BPromise[_0x0306('0x8d')](_0x461500);})[_0x0306('0x2a')](function(){_0x461500=[];for(var _0x4c028b=0x0;_0x4c028b<_0x19c150['length'];_0x4c028b++){_0x461500[_0x0306('0x4a')](updateUser(_0x19c150[_0x4c028b]));}return BPromise[_0x0306('0x8d')](_0x461500);})['then'](function(){return BPromise['each'](_0x19c150,function(_0x3d59b3){return db[_0x0306('0x3b')][_0x0306('0x84')](_0x3d59b3,{'include':[{'model':db[_0x0306('0x85')],'as':'VoiceMail'}]})[_0x0306('0x2a')](function(_0x17a3d3){_0x3d59b3['id']=_0x17a3d3['id'];return _0x3d59b3;});});})[_0x0306('0x2a')](function(_0x55f59b){if(_0x514609[_0x0306('0x61')]['role']===_0x0306('0x2e'))return _0x55f59b;if(_0x514609['user'][_0x0306('0x2c')]!==_0x0306('0x2e'))return _0x55f59b;var _0x5939a=_[_0x0306('0x8a')](_0x55f59b,function(_0x30841a){return _0x30841a[_0x0306('0x2c')]===_0x0306('0x30')||_0x30841a[_0x0306('0x2c')]===_0x0306('0x32');});if(!_0x5939a)return _0x55f59b;return db['UserProfileSection'][_0x0306('0x4b')]({'where':{'name':{'$or':[_0x0306('0x2f'),_0x0306('0x31')]},'userProfileId':_0x514609['user']['userProfileId']},'raw':!![]})[_0x0306('0x2a')](function(_0x175dd5){if(_[_0x0306('0x8e')](_0x175dd5)||!_[_0x0306('0x8a')](_0x175dd5,[_0x0306('0x8f'),0x0]))return _0x55f59b;_0x461500=[];var _0x1bfd26=_(_0x175dd5)[_0x0306('0x34')](function(_0xab396a){if(_0xab396a[_0x0306('0x8f')]===0x1)return;return _0xab396a[_0x0306('0x37')]===_0x0306('0x2f')?'agent':'telephone';})[_0x0306('0x90')]()[_0x0306('0x35')]();for(var _0x2da2ef=0x0;_0x2da2ef<_0x55f59b['length'];_0x2da2ef++){if(!_[_0x0306('0x40')](_0x1bfd26,_0x55f59b[_0x2da2ef][_0x0306('0x2c')]))return;var _0x31d718=_0x55f59b[_0x2da2ef][_0x0306('0x2c')]===_0x0306('0x30')?_0x0306('0x2f'):_0x0306('0x31');_0x461500[_0x0306('0x4a')](db[_0x0306('0x38')]['create']({'name':_0x55f59b[_0x2da2ef]['name'],'resourceId':_0x55f59b[_0x2da2ef]['id'],'type':_0x31d718,'sectionId':_[_0x0306('0x36')](_0x175dd5,[_0x0306('0x37'),_0x31d718])['id']},{}));}return BPromise[_0x0306('0x8d')](_0x461500);});})[_0x0306('0x2a')](respondWithResult(_0x1a710f,0xc9))['catch'](handleError(_0x1a710f,null));};exports[_0x0306('0x91')]=function(_0x2607c1,_0xf1a2cc){if(_0x2607c1[_0x0306('0x61')]['id']){delete _0x2607c1[_0x0306('0x61')]['id'];}return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0x2607c1['params']['id']}})[_0x0306('0x2a')](function(_0x3a06d6){if(!_0x3a06d6)return null;if(_0x3a06d6['id']===_0x2607c1['user']['id']){if(!_0x2607c1['body'][_0x0306('0x92')]||!_0x2607c1[_0x0306('0x61')][_0x0306('0x93')]){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0x96'));}if(!_0x3a06d6[_0x0306('0x97')](_0x2607c1[_0x0306('0x61')][_0x0306('0x92')])){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0x98'));}if(_0x2607c1[_0x0306('0x61')][_0x0306('0x92')]===_0x2607c1[_0x0306('0x61')][_0x0306('0x93')]){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2607c1[_0x0306('0x2e')][_0x0306('0x2c')]===_0x0306('0x80')){if(!_0x2607c1[_0x0306('0x61')]['newPassword']){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0x99'));}}else if(_0x2607c1[_0x0306('0x2e')][_0x0306('0x2c')]===_0x0306('0x2e')){if(!_0x2607c1[_0x0306('0x61')]['newPassword']){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0x99'));}if(_0x3a06d6['role']!==_0x0306('0x30')){throw new db['Sequelize'][(_0x0306('0x95'))](_0x0306('0x7f'));}}else{throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0x7f'));}return _0x3a06d6;})[_0x0306('0x2a')](handleEntityNotFound(_0xf1a2cc,null))[_0x0306('0x2a')](function(_0x3eea0e){return db[_0x0306('0x67')][_0x0306('0x9a')]({'attributes':['id',_0x0306('0x68'),_0x0306('0x9b'),_0x0306('0x9c')]})[_0x0306('0x2a')](function(_0x1a052b){if(_0x1a052b[_0x0306('0x68')])authService[_0x0306('0x9d')](_0x2607c1[_0x0306('0x61')]['newPassword']);if(!_0x1a052b[_0x0306('0x9b')]||!_0x3eea0e[_0x0306('0x9e')])return _0x3eea0e;authService[_0x0306('0x9f')](_0x2607c1['body']['newPassword'],_0x3eea0e[_0x0306('0x9e')],_0x1a052b['passwordHistoryLimit']);return _0x3eea0e;})['then'](saveUpdates({'password':_0x2607c1[_0x0306('0x61')]['newPassword'],'passwordResetAt':_0x2607c1[_0x0306('0x2e')]['id']==_0x2607c1[_0x0306('0x56')]['id']?moment():null,'previousPasswords':authService[_0x0306('0xa0')](_0x2607c1[_0x0306('0x61')][_0x0306('0x93')],_0x3eea0e[_0x0306('0x9e')])},null));})[_0x0306('0x2a')](respondWithResult(_0xf1a2cc,null))[_0x0306('0x1f')](handleError(_0xf1a2cc,null));};exports[_0x0306('0xa1')]=function(_0x1b4222,_0x915830){var _0x107788=_0x1b4222['body']['channel'];return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0x1b4222[_0x0306('0x56')]['id']},'attributes':['id',_0x0306('0x37'),_0x0306('0x2c'),_0x0306('0xa2'),'loginInPause',_0x0306('0xa3'),_0x0306('0xa4')]})[_0x0306('0x2a')](handleEntityNotFound(_0x915830,null))[_0x0306('0x2a')](function(_0x31f7a0){if(_0x31f7a0){if(!utils[_0x0306('0xa5')](_0x107788)){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('Unknown\x20channel');}return _0x31f7a0['add'+_['capitalize'](_0x107788[_0x0306('0xa6')]())+_0x0306('0xa7')](_0x1b4222[_0x0306('0x61')][_0x0306('0x64')],{'penalty':_0x1b4222[_0x0306('0x61')][_0x0306('0xa8')]||0x0})[_0x0306('0xa9')](function(_0x1eeee6){for(var _0x5c205b=0x0;_0x5c205b<_0x1b4222['body'][_0x0306('0x64')][_0x0306('0x4e')];_0x5c205b+=0x1){var _0x5932d1={'UserId':Number(_0x1b4222[_0x0306('0x56')]['id'])};_0x5932d1[_[_0x0306('0xaa')](_0x107788[_0x0306('0xa6')]())+_0x0306('0xab')]=Number(_0x1b4222[_0x0306('0x61')][_0x0306('0x64')][_0x5c205b]);socket[_0x0306('0xac')]('user'+_['capitalize'](_0x107788[_0x0306('0xa6')]())+'Queue:save',_0x5932d1);}return _0x1eeee6;})[_0x0306('0x2a')](function(){if(_0x107788===_0x0306('0xad')){return db[_0x0306('0xae')][_0x0306('0x4b')]({'where':{'id':_0x1b4222[_0x0306('0x61')][_0x0306('0x64')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x0306('0x2a')](function(_0x244f8d){var _0xf3a00=_0x31f7a0[_0x0306('0xaf')]({'plain':!![]});var _0x101615=[];if(_0x107788===_0x0306('0xad')&&_0xf3a00['role']===_0x0306('0x30')&&_0xf3a00[_0x0306('0xa2')]){for(var _0x5a7f21=0x0;_0x5a7f21<_0x244f8d[_0x0306('0x4e')];_0x5a7f21+=0x1){_0x101615['push']({'membername':_0xf3a00[_0x0306('0x37')],'UserId':_0xf3a00['id'],'queue_name':_0x244f8d[_0x5a7f21][_0x0306('0x37')],'VoiceQueueId':_0x244f8d[_0x5a7f21]['id'],'interface':_[_0x0306('0x6b')](_0xf3a00[_0x0306('0xa4')])?util[_0x0306('0xb0')](_0x0306('0xb1'),_0xf3a00[_0x0306('0x37')]):_0xf3a00[_0x0306('0xa4')],'paused':_0xf3a00[_0x0306('0xa3')]||![],'penalty':_0x1b4222['body'][_0x0306('0xa8')]||0x0});}return BPromise[_0x0306('0xb2')](_0x101615,function(_0x188bf9){return db[_0x0306('0xb3')]['upsert'](_0x188bf9);});}return _0x31f7a0;});}})['then'](respondWithStatusCode(_0x915830,null))['catch'](handleError(_0x915830,null));};exports[_0x0306('0xb4')]=function(_0xdac37b,_0x4251d6){var _0x25380d,_0x2b32a3;return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0xdac37b[_0x0306('0x56')]['id']},'attributes':['id',_0x0306('0x37'),'role']})[_0x0306('0x2a')](handleEntityNotFound(_0x4251d6,null))[_0x0306('0x2a')](function(_0x54d59c){if(_0x54d59c){_0x25380d=_0x54d59c;if(!_0xdac37b[_0x0306('0x45')][_0x0306('0xb5')]||!utils[_0x0306('0xa5')](_0xdac37b[_0x0306('0x45')][_0x0306('0xb5')])){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('Unknown\x20channel');}return _0x54d59c['remove'+_[_0x0306('0xaa')](_0xdac37b['query'][_0x0306('0xb5')][_0x0306('0xa6')]())+_0x0306('0xa7')](_0xdac37b['query'][_0x0306('0x64')]);}})['then'](function(_0xef87d3){if(_[_0x0306('0xb6')](_0xdac37b['query']['ids'])){for(var _0xfc474b=0x0;_0xfc474b<_0xdac37b[_0x0306('0x45')][_0x0306('0x64')][_0x0306('0x4e')];_0xfc474b+=0x1){_0x2b32a3={'UserId':Number(_0xdac37b[_0x0306('0x56')]['id'])};_0x2b32a3[_[_0x0306('0xaa')](_0xdac37b[_0x0306('0x45')]['channel'][_0x0306('0xa6')]())+'QueueId']=Number(_0xdac37b[_0x0306('0x45')][_0x0306('0x64')][_0xfc474b]);socket[_0x0306('0xac')](_0x0306('0x2e')+_[_0x0306('0xaa')](_0xdac37b[_0x0306('0x45')][_0x0306('0xb5')]['toLowerCase']())+_0x0306('0xb7'),_0x2b32a3);}}else{_0x2b32a3={'UserId':Number(_0xdac37b[_0x0306('0x56')]['id'])};_0x2b32a3[_[_0x0306('0xaa')](_0xdac37b[_0x0306('0x45')][_0x0306('0xb5')][_0x0306('0xa6')]())+_0x0306('0xab')]=Number(_0xdac37b[_0x0306('0x45')][_0x0306('0x64')]);socket[_0x0306('0xac')]('user'+_[_0x0306('0xaa')](_0xdac37b['query']['channel']['toLowerCase']())+_0x0306('0xb7'),_0x2b32a3);}return _0xef87d3;})[_0x0306('0x2a')](function(){if(_0xdac37b[_0x0306('0x45')][_0x0306('0xb5')]==='voice'){return db[_0x0306('0xb3')][_0x0306('0x2b')]({'where':{'UserId':_0xdac37b[_0x0306('0x56')]['id'],'VoiceQueueId':_0xdac37b[_0x0306('0x45')][_0x0306('0x64')]},'individualHooks':!![]})[_0x0306('0x2a')](function(){return _0x25380d;});}return _0x25380d;})[_0x0306('0x2a')](respondWithStatusCode(_0x4251d6,null))['catch'](handleError(_0x4251d6,null));};exports[_0x0306('0xb8')]=function(_0x2d8851,_0x3ecb60){_0x2d8851['body'][_0x0306('0xb9')]=_0x2d8851[_0x0306('0xba')]['filename'];return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0x2d8851[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x3ecb60,null))['then'](saveUpdates(_0x2d8851[_0x0306('0x61')],null))[_0x0306('0x2a')](respondWithResult(_0x3ecb60,null))[_0x0306('0x1f')](handleError(_0x3ecb60,null));};exports[_0x0306('0xbb')]=function(_0x48fb19,_0x49933f){var _0x37bf42=path[_0x0306('0xbc')](config['root'],_0x0306('0xbd'));return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0x48fb19['params']['id']},'attributes':['id',_0x0306('0xb9')],'raw':!![]})[_0x0306('0x2a')](handleEntityNotFound(_0x49933f,null))[_0x0306('0x2a')](function(_0x54a217){if(_0x54a217){if(_[_0x0306('0x6b')](_0x54a217[_0x0306('0xb9')])){return _0x49933f['download'](_0x37bf42);}else{if(!fs[_0x0306('0xbe')](path['join'](config['root'],_0x0306('0xbf'),_0x54a217[_0x0306('0xb9')]))){return _0x49933f[_0x0306('0xc0')](_0x37bf42);}return _0x49933f[_0x0306('0xc0')](path[_0x0306('0xbc')](config['root'],_0x0306('0xbf'),_0x54a217[_0x0306('0xb9')]));}}})[_0x0306('0x1f')](handleError(_0x49933f,null));};exports[_0x0306('0xc1')]=function(_0x271e1f,_0x142e47){return db['User'][_0x0306('0x36')]({'where':{'id':_0x271e1f[_0x0306('0x56')]['id']},'attributes':['id']})[_0x0306('0x2a')](handleEntityNotFound(_0x142e47,null))['then'](function(_0x302faa){var _0x2d6199=[];values=_0x302faa[_0x0306('0x51')];_0x2d6199['push'](get_open_tabs(_0x0306('0x4f'),_0x302faa[_0x0306('0x51')]));_0x2d6199[_0x0306('0x4a')](get_open_tabs(_0x0306('0x50'),_0x302faa['dataValues']));_0x2d6199[_0x0306('0x4a')](get_open_tabs(_0x0306('0x53'),_0x302faa[_0x0306('0x51')]));_0x2d6199[_0x0306('0x4a')](get_open_tabs(_0x0306('0x54'),_0x302faa['dataValues']));_0x2d6199[_0x0306('0x4a')](get_open_tabs('fax',_0x302faa['dataValues']));_0x2d6199[_0x0306('0x4a')](get_open_tabs(_0x0306('0x52'),_0x302faa[_0x0306('0x51')]));return BPromise['all'](_0x2d6199);})[_0x0306('0x2a')](function(_0x38a566){if(_0x38a566){var _0xf44f29=_[_0x0306('0x34')](values[_0x0306('0xc2')],function(_0x56d968){return{'channel':_0x0306('0xc3'),'id':_0x56d968['id'],'createdAt':_0x56d968[_0x0306('0xc4')]};});var _0x469e2c=_['map'](values[_0x0306('0xc5')],function(_0x1d89fb){return{'channel':_0x0306('0xc6'),'id':_0x1d89fb['id'],'createdAt':_0x1d89fb[_0x0306('0xc4')]};});var _0x3edaf9=_['map'](values[_0x0306('0xc7')],function(_0x532b5b){return{'channel':_0x0306('0xc8'),'id':_0x532b5b['id'],'createdAt':_0x532b5b[_0x0306('0xc4')]};});var _0x54f593=_['map'](values[_0x0306('0xc9')],function(_0x77f5e2){return{'channel':_0x0306('0xca'),'id':_0x77f5e2['id'],'createdAt':_0x77f5e2[_0x0306('0xc4')]};});var _0x1d92a=_[_0x0306('0x34')](values[_0x0306('0xcb')],function(_0x1ad532){return{'channel':_0x0306('0xcc'),'id':_0x1ad532['id'],'createdAt':_0x1ad532[_0x0306('0xc4')]};});var _0x55f6e0=_[_0x0306('0x34')](values[_0x0306('0xcd')],function(_0x254886){return{'channel':_0x0306('0xce'),'id':_0x254886['id'],'createdAt':_0x254886[_0x0306('0xc4')]};});var _0xb83155=_['concat'](_0xf44f29,_0x469e2c,_0x3edaf9,_0x54f593,_0x1d92a,_0x55f6e0);var _0x57a7df={'count':_0xb83155[_0x0306('0x4e')],'rows':_0xb83155};return _0x57a7df;}else return null;})[_0x0306('0x2a')](respondWithResult(_0x142e47,null))[_0x0306('0x1f')](handleError(_0x142e47,null));};exports[_0x0306('0xcf')]=function(_0x6a4a35,_0x482a8d){var _0x46047d={};var _0x3c169b={};var _0x339fb4;var _0x6635c3;return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x6a4a35['params']['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x482a8d,null))[_0x0306('0x2a')](function(_0x443da2){if(_0x443da2){_0x339fb4=_0x443da2;_0x3c169b[_0x0306('0x57')]=_[_0x0306('0x59')](db['CmContact']['rawAttributes']);_0x3c169b[_0x0306('0x45')]=_[_0x0306('0x59')](_0x6a4a35[_0x0306('0x45')]);_0x3c169b[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x3c169b[_0x0306('0x57')],_0x3c169b['query']);_0x46047d[_0x0306('0x49')]=_['intersection'](_0x3c169b[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x6a4a35[_0x0306('0x45')][_0x0306('0x5c')]));_0x46047d[_0x0306('0x49')]=_0x46047d[_0x0306('0x49')][_0x0306('0x4e')]?_0x46047d[_0x0306('0x49')]:_0x3c169b[_0x0306('0x57')];_0x46047d[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x6a4a35[_0x0306('0x45')][_0x0306('0xd1')]);_0x46047d[_0x0306('0x44')]=qs['filters'](_[_0x0306('0xd2')](_0x6a4a35['query'],_0x3c169b['filters']));if(_0x6a4a35[_0x0306('0x45')][_0x0306('0x33')]){_0x46047d[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x46047d[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x46047d[_0x0306('0x49')],function(_0x30efc2){var _0x1a2e8b={};_0x1a2e8b[_0x30efc2]={'$like':'%'+_0x6a4a35['query'][_0x0306('0x33')]+'%'};return _0x1a2e8b;})});}_0x46047d=_[_0x0306('0x5e')]({},_0x46047d,_0x6a4a35[_0x0306('0x5f')]);return _0x339fb4[_0x0306('0xcf')](_0x46047d);}})['then'](function(_0x4f4a13){if(_0x4f4a13){_0x6635c3=_0x4f4a13['length'];if(_0x6a4a35[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xd4'))){_0x46047d[_0x0306('0x46')]=[{'model':db['CmList'],'as':_0x0306('0xd5'),'required':![]},{'model':db[_0x0306('0xd6')],'as':_0x0306('0xd7'),'attributes':['id',_0x0306('0x37'),_0x0306('0xd8')],'where':_0x6a4a35[_0x0306('0x45')][_0x0306('0xd9')]?{'id':_0x6a4a35[_0x0306('0x45')][_0x0306('0xd9')]}:undefined,'required':_0x6a4a35['query'][_0x0306('0xd9')]?!![]:![]}];}if(!_0x6a4a35[_0x0306('0x45')]['hasOwnProperty'](_0x0306('0xda'))){_0x46047d[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x6a4a35[_0x0306('0x45')][_0x0306('0x25')]);_0x46047d['offset']=qs['offset'](_0x6a4a35['query'][_0x0306('0x23')]);}return _0x339fb4[_0x0306('0xcf')](_0x46047d);}})[_0x0306('0x2a')](function(_0x2ee680){if(_0x2ee680){return _0x2ee680?{'count':_0x6635c3,'rows':_0x2ee680}:null;}})[_0x0306('0x2a')](respondWithResult(_0x482a8d,null))[_0x0306('0x1f')](handleError(_0x482a8d,null));};exports[_0x0306('0xdb')]=function(_0xbfc309,_0x155646){var _0x5e4de6;var _0x2c56cb={};var _0x385470;return db['User']['findOne']({'where':{'id':_0xbfc309[_0x0306('0x56')]['id']},'attributes':['id',_0x0306('0x37'),'role']})[_0x0306('0x2a')](handleEntityNotFound(_0x155646,null))[_0x0306('0x2a')](function(_0x252aa8){if(!utils[_0x0306('0xa5')](_0xbfc309[_0x0306('0x45')][_0x0306('0xb5')])){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('Unknown\x20channel');}_0x5e4de6=_0x252aa8;var _0x199c04={};_0x199c04[_0x0306('0x57')]=_['keys'](db[_[_0x0306('0xaa')](_0xbfc309[_0x0306('0x45')][_0x0306('0xb5')])+'Queue'][_0x0306('0x3c')]);_0x199c04[_0x0306('0x45')]=_[_0x0306('0x59')](_0xbfc309[_0x0306('0x45')]);_0x199c04[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x199c04[_0x0306('0x57')],_0x199c04[_0x0306('0x45')]);_0x2c56cb[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x199c04['model'],qs[_0x0306('0x5c')](_0xbfc309[_0x0306('0x45')][_0x0306('0x5c')]));_0x2c56cb[_0x0306('0x49')]=_0x2c56cb['attributes']['length']?_0x2c56cb[_0x0306('0x49')]:_0x199c04[_0x0306('0x57')];_0x2c56cb[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0xbfc309['query'][_0x0306('0xd1')]);_0x2c56cb[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0xbfc309[_0x0306('0x45')],_0x199c04[_0x0306('0x5a')]));if(_0xbfc309[_0x0306('0x45')][_0x0306('0x33')]){_0x2c56cb['where']=_[_0x0306('0x5e')](_0x2c56cb[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x2c56cb['attributes'],function(_0x2d1acf){var _0x43d2f5={};_0x43d2f5[_0x2d1acf]={'$like':'%'+_0xbfc309[_0x0306('0x45')][_0x0306('0x33')]+'%'};return _0x43d2f5;})});}_0x2c56cb=_[_0x0306('0x5e')]({},_0x2c56cb,_0xbfc309[_0x0306('0x5f')]);switch(_0x5e4de6[_0x0306('0x2c')]){case'admin':return db[_[_0x0306('0xaa')](_0xbfc309['query'][_0x0306('0xb5')])+_0x0306('0xdc')][_0x0306('0x4b')](_0x2c56cb);case _0x0306('0x2e'):case _0x0306('0x30'):return _0x5e4de6['get'+_[_0x0306('0xaa')](_0xbfc309['query'][_0x0306('0xb5')])+_0x0306('0xa7')](_0x2c56cb);default:throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('Unknown\x20role');}})[_0x0306('0x2a')](function(_0x3fb58a){_0x385470=_0x3fb58a[_0x0306('0x4e')];if(!_0xbfc309['query'][_0x0306('0xd3')](_0x0306('0xda'))){_0x2c56cb[_0x0306('0x25')]=qs[_0x0306('0x25')](_0xbfc309[_0x0306('0x45')][_0x0306('0x25')]);_0x2c56cb[_0x0306('0x23')]=qs[_0x0306('0x23')](_0xbfc309[_0x0306('0x45')][_0x0306('0x23')]);}switch(_0x5e4de6[_0x0306('0x2c')]){case _0x0306('0x80'):return db[_['capitalize'](_0xbfc309[_0x0306('0x45')][_0x0306('0xb5')])+_0x0306('0xdc')][_0x0306('0x4b')](_0x2c56cb);case _0x0306('0x2e'):case _0x0306('0x30'):return _0x5e4de6['get'+_[_0x0306('0xaa')](_0xbfc309[_0x0306('0x45')][_0x0306('0xb5')])+_0x0306('0xa7')](_0x2c56cb);}})[_0x0306('0x2a')](function(_0x534aef){return{'count':_0x385470,'rows':_0x534aef};})[_0x0306('0x2a')](respondWithResult(_0x155646,null))['catch'](handleError(_0x155646,null));};exports[_0x0306('0xdd')]=function(_0x1b5f98,_0x490aa9){var _0x361284={};var _0x2701b6={};var _0x793c7c;var _0x69bcec;return db[_0x0306('0x3b')]['findOne']({'where':{'id':_0x1b5f98[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x490aa9,null))[_0x0306('0x2a')](function(_0x5dbaab){if(_0x5dbaab){_0x793c7c=_0x5dbaab;_0x2701b6[_0x0306('0x57')]=_['keys'](db['UserVoiceQueueRt'][_0x0306('0x3c')]);_0x2701b6['query']=_[_0x0306('0x59')](_0x1b5f98[_0x0306('0x45')]);_0x2701b6[_0x0306('0x5a')]=_['intersection'](_0x2701b6[_0x0306('0x57')],_0x2701b6[_0x0306('0x45')]);_0x361284['attributes']=_[_0x0306('0x5b')](_0x2701b6[_0x0306('0x57')],qs['fields'](_0x1b5f98['query']['fields']));_0x361284[_0x0306('0x49')]=_0x361284[_0x0306('0x49')][_0x0306('0x4e')]?_0x361284['attributes']:_0x2701b6[_0x0306('0x57')];_0x361284[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x1b5f98[_0x0306('0x45')][_0x0306('0xd1')]);_0x361284['where']=qs[_0x0306('0x5a')](_['pick'](_0x1b5f98['query'],_0x2701b6[_0x0306('0x5a')]));if(_0x1b5f98[_0x0306('0x45')]['filter']){_0x361284[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x361284['where'],{'$or':_[_0x0306('0x34')](_0x361284[_0x0306('0x49')],function(_0x37bdf7){var _0x128e5e={};_0x128e5e[_0x37bdf7]={'$like':'%'+_0x1b5f98[_0x0306('0x45')]['filter']+'%'};return _0x128e5e;})});}_0x361284=_[_0x0306('0x5e')]({},_0x361284,_0x1b5f98[_0x0306('0x5f')]);return _0x793c7c[_0x0306('0xdd')](_0x361284);}})[_0x0306('0x2a')](function(_0x513008){if(_0x513008){_0x69bcec=_0x513008['length'];if(!_0x1b5f98[_0x0306('0x45')][_0x0306('0xd3')]('nolimit')){_0x361284[_0x0306('0x25')]=qs['limit'](_0x1b5f98[_0x0306('0x45')][_0x0306('0x25')]);_0x361284[_0x0306('0x23')]=qs['offset'](_0x1b5f98[_0x0306('0x45')][_0x0306('0x23')]);}return _0x793c7c[_0x0306('0xdd')](_0x361284);}})[_0x0306('0x2a')](function(_0x576fdd){if(_0x576fdd){return _0x576fdd?{'count':_0x69bcec,'rows':_0x576fdd}:null;}})[_0x0306('0x2a')](respondWithResult(_0x490aa9,null))[_0x0306('0x1f')](handleError(_0x490aa9,null));};exports['getGroups']=function(_0x498d4d,_0x1f9130){var _0x2bb683={};var _0x17815d={};var _0x457def;var _0x5e720a;return db[_0x0306('0x3b')]['findOne']({'where':{'id':_0x498d4d[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x1f9130,null))[_0x0306('0x2a')](function(_0x41bd06){if(_0x41bd06){_0x457def=_0x41bd06;_0x17815d[_0x0306('0x57')]=_['keys'](db[_0x0306('0xde')][_0x0306('0x3c')]);_0x17815d[_0x0306('0x45')]=_[_0x0306('0x59')](_0x498d4d[_0x0306('0x45')]);_0x17815d[_0x0306('0x5a')]=_['intersection'](_0x17815d[_0x0306('0x57')],_0x17815d['query']);_0x2bb683[_0x0306('0x49')]=_['intersection'](_0x17815d[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x498d4d[_0x0306('0x45')][_0x0306('0x5c')]));_0x2bb683[_0x0306('0x49')]=_0x2bb683[_0x0306('0x49')]['length']?_0x2bb683[_0x0306('0x49')]:_0x17815d[_0x0306('0x57')];_0x2bb683['order']=qs[_0x0306('0xd1')](_0x498d4d['query']['sort']);_0x2bb683[_0x0306('0x44')]=qs[_0x0306('0x5a')](_['pick'](_0x498d4d[_0x0306('0x45')],_0x17815d['filters']));if(_0x498d4d[_0x0306('0x45')][_0x0306('0x33')]){_0x2bb683['where']=_[_0x0306('0x5e')](_0x2bb683[_0x0306('0x44')],{'$or':_['map'](_0x2bb683[_0x0306('0x49')],function(_0x3bbb15){var _0x4982c0={};_0x4982c0[_0x3bbb15]={'$like':'%'+_0x498d4d['query'][_0x0306('0x33')]+'%'};return _0x4982c0;})});}_0x2bb683=_[_0x0306('0x5e')]({},_0x2bb683,_0x498d4d[_0x0306('0x5f')]);return _0x457def['getGroups'](_0x2bb683);}})[_0x0306('0x2a')](function(_0x5737c5){if(_0x5737c5){_0x5e720a=_0x5737c5['length'];if(!_0x498d4d['query'][_0x0306('0xd3')](_0x0306('0xda'))){_0x2bb683['limit']=qs['limit'](_0x498d4d[_0x0306('0x45')][_0x0306('0x25')]);_0x2bb683[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x498d4d[_0x0306('0x45')][_0x0306('0x23')]);}return _0x457def['getGroups'](_0x2bb683);}})[_0x0306('0x2a')](function(_0x4cc6ef){if(_0x4cc6ef){return _0x4cc6ef?{'count':_0x5e720a,'rows':_0x4cc6ef}:null;}})['then'](respondWithResult(_0x1f9130,null))[_0x0306('0x1f')](handleError(_0x1f9130,null));};exports[_0x0306('0xdf')]=function(_0x5a03cb,_0x3ccdca){var _0x162765={'raw':!![],'where':{}};var _0x206715={};var _0x682873={'count':0x0,'rows':[]};return db[_0x0306('0x3b')]['findOne']({'where':{'id':_0x5a03cb[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x3ccdca,null))[_0x0306('0x2a')](function(_0x43f497){if(_0x43f497){_0x206715[_0x0306('0x57')]=_['keys'](db[_0x0306('0xe0')][_0x0306('0x3c')]);_0x206715[_0x0306('0x45')]=_[_0x0306('0x59')](_0x5a03cb['query']);_0x206715[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x206715[_0x0306('0x57')],_0x206715[_0x0306('0x45')]);_0x162765['attributes']=_[_0x0306('0x5b')](_0x206715[_0x0306('0x57')],qs['fields'](_0x5a03cb[_0x0306('0x45')][_0x0306('0x5c')]));_0x162765[_0x0306('0x49')]=_0x162765[_0x0306('0x49')]['length']?_0x162765[_0x0306('0x49')]:_0x206715[_0x0306('0x57')];if(!_0x5a03cb[_0x0306('0x45')]['hasOwnProperty']('nolimit')){_0x162765[_0x0306('0x25')]=qs['limit'](_0x5a03cb['query']['limit']);_0x162765[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x5a03cb[_0x0306('0x45')][_0x0306('0x23')]);}_0x162765[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x5a03cb[_0x0306('0x45')][_0x0306('0xd1')]);_0x162765[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x5a03cb[_0x0306('0x45')],_0x206715['filters']));_0x162765[_0x0306('0x44')]['UserId']=_0x43f497['id'];if(_0x5a03cb[_0x0306('0x45')][_0x0306('0x33')]){_0x162765['where']=_[_0x0306('0x5e')](_0x162765[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x162765[_0x0306('0x49')],function(_0x536ba2){var _0x66d10a={};_0x66d10a[_0x536ba2]={'$like':'%'+_0x5a03cb[_0x0306('0x45')][_0x0306('0x33')]+'%'};return _0x66d10a;})});}_0x162765=_[_0x0306('0x5e')]({},_0x162765,_0x5a03cb[_0x0306('0x5f')]);return db['VoiceRecording']['count']({'where':_0x162765['where']})[_0x0306('0x2a')](function(_0x4a0c4f){_0x682873[_0x0306('0x26')]=_0x4a0c4f;if(_0x5a03cb[_0x0306('0x45')][_0x0306('0xd4')]){_0x162765[_0x0306('0x46')]=[{'all':!![]}];}return db[_0x0306('0xe0')][_0x0306('0x4b')](_0x162765);})[_0x0306('0x2a')](function(_0x28113e){_0x682873[_0x0306('0x4c')]=_0x28113e;return _0x682873;});}})[_0x0306('0x2a')](respondWithFilteredResult(_0x3ccdca,_0x162765))[_0x0306('0x1f')](handleError(_0x3ccdca,null));};exports[_0x0306('0xe1')]=function(_0x2651b4,_0x4b2075){var _0x46aaaa={'raw':!![],'where':{}};var _0x49166b={};var _0x3c113d={'count':0x0,'rows':[]};return db[_0x0306('0x3b')]['findOne']({'where':{'id':_0x2651b4[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x4b2075,null))[_0x0306('0x2a')](function(_0x39b815){if(_0x39b815){_0x49166b[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0xe2')][_0x0306('0x3c')]);_0x49166b['query']=_[_0x0306('0x59')](_0x2651b4['query']);_0x49166b[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x49166b['model'],_0x49166b[_0x0306('0x45')]);_0x46aaaa['attributes']=_[_0x0306('0x5b')](_0x49166b[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x2651b4[_0x0306('0x45')][_0x0306('0x5c')]));_0x46aaaa['attributes']=_0x46aaaa[_0x0306('0x49')]['length']?_0x46aaaa[_0x0306('0x49')]:_0x49166b[_0x0306('0x57')];if(!_0x2651b4['query'][_0x0306('0xd3')](_0x0306('0xda'))){_0x46aaaa[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x2651b4[_0x0306('0x45')][_0x0306('0x25')]);_0x46aaaa[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x2651b4[_0x0306('0x45')][_0x0306('0x23')]);}_0x46aaaa[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x2651b4['query'][_0x0306('0xd1')]);_0x46aaaa[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x2651b4[_0x0306('0x45')],_0x49166b['filters']));_0x46aaaa[_0x0306('0x44')][_0x0306('0xe3')]=_0x39b815['id'];if(_0x2651b4[_0x0306('0x45')]['filter']){_0x46aaaa[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x46aaaa[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x46aaaa['attributes'],function(_0x55ef29){var _0x399a76={};_0x399a76[_0x55ef29]={'$like':'%'+_0x2651b4[_0x0306('0x45')][_0x0306('0x33')]+'%'};return _0x399a76;})});}_0x46aaaa=_[_0x0306('0x5e')]({},_0x46aaaa,_0x2651b4[_0x0306('0x5f')]);return db[_0x0306('0xe2')][_0x0306('0x26')]({'where':_0x46aaaa[_0x0306('0x44')]})[_0x0306('0x2a')](function(_0x3ecebd){_0x3c113d[_0x0306('0x26')]=_0x3ecebd;if(_0x2651b4[_0x0306('0x45')][_0x0306('0xd4')]){_0x46aaaa[_0x0306('0x46')]=[{'all':!![]}];}return db[_0x0306('0xe2')][_0x0306('0x4b')](_0x46aaaa);})[_0x0306('0x2a')](function(_0x3a658c){_0x3c113d[_0x0306('0x4c')]=_0x3a658c;return _0x3c113d;});}})['then'](respondWithFilteredResult(_0x4b2075,_0x46aaaa))[_0x0306('0x1f')](handleError(_0x4b2075,null));};exports['getChatInteractions']=function(_0xa6254,_0x23c8c0){var _0x363f16={};var _0xddb274={};var _0xcfd74e;var _0x2bf9b3;return db['User'][_0x0306('0x9a')]({'where':{'id':_0xa6254[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x23c8c0,null))['then'](function(_0xb7ec41){if(_0xb7ec41){_0xcfd74e=_0xb7ec41;_0xddb274[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0xe4')]['rawAttributes']);_0xddb274['query']=_[_0x0306('0x59')](_0xa6254[_0x0306('0x45')]);_0xddb274[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0xddb274[_0x0306('0x57')],_0xddb274[_0x0306('0x45')]);_0x363f16[_0x0306('0x49')]=_[_0x0306('0x5b')](_0xddb274[_0x0306('0x57')],qs[_0x0306('0x5c')](_0xa6254['query'][_0x0306('0x5c')]));_0x363f16[_0x0306('0x49')]=_0x363f16[_0x0306('0x49')][_0x0306('0x4e')]?_0x363f16[_0x0306('0x49')]:_0xddb274[_0x0306('0x57')];_0x363f16[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0xa6254['query']['sort']);_0x363f16[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0xa6254['query'],_0xddb274[_0x0306('0x5a')]));if(_0xa6254[_0x0306('0x45')][_0x0306('0x33')]){_0x363f16['where']=_['merge'](_0x363f16[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x363f16[_0x0306('0x49')],function(_0x437a6f){var _0x3a6f33={};_0x3a6f33[_0x437a6f]={'$like':'%'+_0xa6254[_0x0306('0x45')][_0x0306('0x33')]+'%'};return _0x3a6f33;})});}_0x363f16=_['merge']({},_0x363f16,_0xa6254[_0x0306('0x5f')]);return _0xcfd74e[_0x0306('0xe5')](_0x363f16);}})[_0x0306('0x2a')](function(_0x522dd4){if(_0x522dd4){_0x2bf9b3=_0x522dd4['length'];if(!_0xa6254[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xda'))){_0x363f16['limit']=qs['limit'](_0xa6254['query'][_0x0306('0x25')]);_0x363f16['offset']=qs[_0x0306('0x23')](_0xa6254['query'][_0x0306('0x23')]);}return _0xcfd74e['getChatInteractions'](_0x363f16);}})[_0x0306('0x2a')](function(_0x5cd051){if(_0x5cd051){return _0x5cd051?{'count':_0x2bf9b3,'rows':_0x5cd051}:null;}})[_0x0306('0x2a')](respondWithResult(_0x23c8c0,null))['catch'](handleError(_0x23c8c0,null));};exports[_0x0306('0xe6')]=function(_0x47f2e1,_0xd4a75){var _0x4a2057={};var _0x36e6e5={};var _0x55ae81;var _0x15cde9;return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x47f2e1[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0xd4a75,null))[_0x0306('0x2a')](function(_0x43668e){if(_0x43668e){_0x55ae81=_0x43668e;_0x36e6e5[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0xe7')][_0x0306('0x3c')]);_0x36e6e5[_0x0306('0x45')]=_[_0x0306('0x59')](_0x47f2e1[_0x0306('0x45')]);_0x36e6e5['filters']=_[_0x0306('0x5b')](_0x36e6e5[_0x0306('0x57')],_0x36e6e5[_0x0306('0x45')]);_0x4a2057[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x36e6e5[_0x0306('0x57')],qs['fields'](_0x47f2e1[_0x0306('0x45')][_0x0306('0x5c')]));_0x4a2057[_0x0306('0x49')]=_0x4a2057[_0x0306('0x49')][_0x0306('0x4e')]?_0x4a2057[_0x0306('0x49')]:_0x36e6e5[_0x0306('0x57')];_0x4a2057['order']=qs[_0x0306('0xd1')](_0x47f2e1[_0x0306('0x45')][_0x0306('0xd1')]);_0x4a2057[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x47f2e1[_0x0306('0x45')],_0x36e6e5[_0x0306('0x5a')]));if(_0x47f2e1[_0x0306('0x45')]['filter']){_0x4a2057[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x4a2057[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x4a2057[_0x0306('0x49')],function(_0x19bc8c){var _0x165b88={};_0x165b88[_0x19bc8c]={'$like':'%'+_0x47f2e1[_0x0306('0x45')]['filter']+'%'};return _0x165b88;})});}_0x4a2057=_[_0x0306('0x5e')]({},_0x4a2057,_0x47f2e1[_0x0306('0x5f')]);return _0x55ae81[_0x0306('0xe6')](_0x4a2057);}})['then'](function(_0x215e1c){if(_0x215e1c){_0x15cde9=_0x215e1c['length'];if(!_0x47f2e1[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xda'))){_0x4a2057[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x47f2e1[_0x0306('0x45')][_0x0306('0x25')]);_0x4a2057['offset']=qs[_0x0306('0x23')](_0x47f2e1[_0x0306('0x45')]['offset']);}return _0x55ae81[_0x0306('0xe6')](_0x4a2057);}})[_0x0306('0x2a')](function(_0x249c52){if(_0x249c52){return _0x249c52?{'count':_0x15cde9,'rows':_0x249c52}:null;}})[_0x0306('0x2a')](respondWithResult(_0xd4a75,null))[_0x0306('0x1f')](handleError(_0xd4a75,null));};exports[_0x0306('0xe8')]=function(_0x256ecd,_0x4eb87e){var _0x41db3e={'raw':!![],'where':{}};var _0x31d551={};var _0x3b4bd5={'count':0x0,'rows':[]};return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x256ecd[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x4eb87e,null))[_0x0306('0x2a')](function(_0x1fab28){if(_0x1fab28){_0x31d551[_0x0306('0x57')]=_['keys'](db[_0x0306('0xe9')][_0x0306('0x3c')]);_0x31d551['query']=_['keys'](_0x256ecd[_0x0306('0x45')]);_0x31d551[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x31d551[_0x0306('0x57')],_0x31d551['query']);_0x41db3e[_0x0306('0x49')]=_['intersection'](_0x31d551['model'],qs['fields'](_0x256ecd[_0x0306('0x45')][_0x0306('0x5c')]));_0x41db3e[_0x0306('0x49')]=_0x41db3e[_0x0306('0x49')]['length']?_0x41db3e[_0x0306('0x49')]:_0x31d551[_0x0306('0x57')];if(!_0x256ecd[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xda'))){_0x41db3e[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x256ecd[_0x0306('0x45')][_0x0306('0x25')]);_0x41db3e[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x256ecd[_0x0306('0x45')][_0x0306('0x23')]);}_0x41db3e[_0x0306('0xd0')]=qs['sort'](_0x256ecd[_0x0306('0x45')][_0x0306('0xd1')]);_0x41db3e[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x256ecd[_0x0306('0x45')],_0x31d551[_0x0306('0x5a')]));_0x41db3e['where'][_0x0306('0xe3')]=_0x1fab28['id'];if(_0x256ecd['query'][_0x0306('0x33')]){_0x41db3e[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x41db3e['where'],{'$or':_[_0x0306('0x34')](_0x41db3e['attributes'],function(_0x54afec){var _0x383ccf={};_0x383ccf[_0x54afec]={'$like':'%'+_0x256ecd['query']['filter']+'%'};return _0x383ccf;})});}_0x41db3e=_['merge']({},_0x41db3e,_0x256ecd[_0x0306('0x5f')]);return db['MailInteraction'][_0x0306('0x26')]({'where':_0x41db3e[_0x0306('0x44')]})['then'](function(_0xd738e3){_0x3b4bd5[_0x0306('0x26')]=_0xd738e3;if(_0x256ecd['query'][_0x0306('0xd4')]){_0x41db3e[_0x0306('0x46')]=[{'all':!![]}];}return db[_0x0306('0xe9')]['findAll'](_0x41db3e);})[_0x0306('0x2a')](function(_0x5a4621){_0x3b4bd5['rows']=_0x5a4621;return _0x3b4bd5;});}})[_0x0306('0x2a')](respondWithFilteredResult(_0x4eb87e,_0x41db3e))[_0x0306('0x1f')](handleError(_0x4eb87e,null));};exports[_0x0306('0xea')]=function(_0x5554a5,_0x2f5d81){var _0x197425={};var _0x544f35={};var _0x579823;var _0x4515a2;return db['User'][_0x0306('0x9a')]({'where':{'id':_0x5554a5[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x2f5d81,null))['then'](function(_0x56a23d){if(_0x56a23d){_0x579823=_0x56a23d;_0x544f35['model']=_[_0x0306('0x59')](db[_0x0306('0xeb')][_0x0306('0x3c')]);_0x544f35[_0x0306('0x45')]=_[_0x0306('0x59')](_0x5554a5['query']);_0x544f35[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x544f35[_0x0306('0x57')],_0x544f35['query']);_0x197425['attributes']=_[_0x0306('0x5b')](_0x544f35[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x5554a5[_0x0306('0x45')][_0x0306('0x5c')]));_0x197425[_0x0306('0x49')]=_0x197425[_0x0306('0x49')][_0x0306('0x4e')]?_0x197425[_0x0306('0x49')]:_0x544f35['model'];_0x197425[_0x0306('0xd0')]=qs['sort'](_0x5554a5[_0x0306('0x45')][_0x0306('0xd1')]);_0x197425[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x5554a5[_0x0306('0x45')],_0x544f35[_0x0306('0x5a')]));if(_0x5554a5[_0x0306('0x45')]['filter']){_0x197425[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x197425[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x197425[_0x0306('0x49')],function(_0x5b4e57){var _0x2fc8d9={};_0x2fc8d9[_0x5b4e57]={'$like':'%'+_0x5554a5['query'][_0x0306('0x33')]+'%'};return _0x2fc8d9;})});}_0x197425=_['merge']({},_0x197425,_0x5554a5[_0x0306('0x5f')]);return _0x579823['getSmsInteractions'](_0x197425);}})[_0x0306('0x2a')](function(_0x209cfb){if(_0x209cfb){_0x4515a2=_0x209cfb[_0x0306('0x4e')];if(!_0x5554a5[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xda'))){_0x197425[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x5554a5['query'][_0x0306('0x25')]);_0x197425[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x5554a5[_0x0306('0x45')][_0x0306('0x23')]);}return _0x579823[_0x0306('0xea')](_0x197425);}})[_0x0306('0x2a')](function(_0x59fedb){if(_0x59fedb){return _0x59fedb?{'count':_0x4515a2,'rows':_0x59fedb}:null;}})[_0x0306('0x2a')](respondWithResult(_0x2f5d81,null))['catch'](handleError(_0x2f5d81,null));};exports['getFaxInteractions']=function(_0x14d361,_0x2c70c6){var _0x28c6a4={};var _0x105091={};var _0x4ec440;var _0x325848;return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x14d361[_0x0306('0x56')]['id']}})['then'](handleEntityNotFound(_0x2c70c6,null))[_0x0306('0x2a')](function(_0x39a560){if(_0x39a560){_0x4ec440=_0x39a560;_0x105091[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0xec')]['rawAttributes']);_0x105091[_0x0306('0x45')]=_[_0x0306('0x59')](_0x14d361[_0x0306('0x45')]);_0x105091[_0x0306('0x5a')]=_['intersection'](_0x105091[_0x0306('0x57')],_0x105091[_0x0306('0x45')]);_0x28c6a4[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x105091['model'],qs['fields'](_0x14d361[_0x0306('0x45')][_0x0306('0x5c')]));_0x28c6a4[_0x0306('0x49')]=_0x28c6a4[_0x0306('0x49')][_0x0306('0x4e')]?_0x28c6a4['attributes']:_0x105091[_0x0306('0x57')];_0x28c6a4['order']=qs['sort'](_0x14d361[_0x0306('0x45')][_0x0306('0xd1')]);_0x28c6a4[_0x0306('0x44')]=qs[_0x0306('0x5a')](_['pick'](_0x14d361[_0x0306('0x45')],_0x105091[_0x0306('0x5a')]));if(_0x14d361['query'][_0x0306('0x33')]){_0x28c6a4['where']=_[_0x0306('0x5e')](_0x28c6a4[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x28c6a4[_0x0306('0x49')],function(_0x29f84a){var _0x134217={};_0x134217[_0x29f84a]={'$like':'%'+_0x14d361[_0x0306('0x45')][_0x0306('0x33')]+'%'};return _0x134217;})});}_0x28c6a4=_[_0x0306('0x5e')]({},_0x28c6a4,_0x14d361['options']);return _0x4ec440[_0x0306('0xed')](_0x28c6a4);}})[_0x0306('0x2a')](function(_0x528a1c){if(_0x528a1c){_0x325848=_0x528a1c[_0x0306('0x4e')];if(!_0x14d361[_0x0306('0x45')]['hasOwnProperty'](_0x0306('0xda'))){_0x28c6a4[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x14d361[_0x0306('0x45')][_0x0306('0x25')]);_0x28c6a4[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x14d361[_0x0306('0x45')]['offset']);}return _0x4ec440[_0x0306('0xed')](_0x28c6a4);}})[_0x0306('0x2a')](function(_0x219c72){if(_0x219c72){return _0x219c72?{'count':_0x325848,'rows':_0x219c72}:null;}})[_0x0306('0x2a')](respondWithResult(_0x2c70c6,null))[_0x0306('0x1f')](handleError(_0x2c70c6,null));};exports[_0x0306('0xee')]=function(_0x1c90fc,_0x17cc71){var _0x464ab5={};var _0x5473fb={};var _0x45e84a;var _0x1e4e18;return db['User'][_0x0306('0x9a')]({'where':{'id':_0x1c90fc[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x17cc71,null))['then'](function(_0x547cb3){if(_0x547cb3){_0x45e84a=_0x547cb3;_0x5473fb['model']=_[_0x0306('0x59')](db['WhatsappInteraction']['rawAttributes']);_0x5473fb[_0x0306('0x45')]=_['keys'](_0x1c90fc['query']);_0x5473fb[_0x0306('0x5a')]=_['intersection'](_0x5473fb['model'],_0x5473fb[_0x0306('0x45')]);_0x464ab5[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x5473fb[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x1c90fc['query'][_0x0306('0x5c')]));_0x464ab5[_0x0306('0x49')]=_0x464ab5[_0x0306('0x49')][_0x0306('0x4e')]?_0x464ab5[_0x0306('0x49')]:_0x5473fb[_0x0306('0x57')];_0x464ab5[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x1c90fc[_0x0306('0x45')][_0x0306('0xd1')]);_0x464ab5['where']=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x1c90fc[_0x0306('0x45')],_0x5473fb[_0x0306('0x5a')]));if(_0x1c90fc['query'][_0x0306('0x33')]){_0x464ab5[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x464ab5[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x464ab5[_0x0306('0x49')],function(_0x5bc2d1){var _0x1a3d78={};_0x1a3d78[_0x5bc2d1]={'$like':'%'+_0x1c90fc[_0x0306('0x45')]['filter']+'%'};return _0x1a3d78;})});}_0x464ab5=_['merge']({},_0x464ab5,_0x1c90fc[_0x0306('0x5f')]);return _0x45e84a[_0x0306('0xee')](_0x464ab5);}})[_0x0306('0x2a')](function(_0x2b0130){if(_0x2b0130){_0x1e4e18=_0x2b0130[_0x0306('0x4e')];if(!_0x1c90fc[_0x0306('0x45')]['hasOwnProperty'](_0x0306('0xda'))){_0x464ab5[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x1c90fc[_0x0306('0x45')][_0x0306('0x25')]);_0x464ab5['offset']=qs[_0x0306('0x23')](_0x1c90fc['query'][_0x0306('0x23')]);}return _0x45e84a[_0x0306('0xee')](_0x464ab5);}})[_0x0306('0x2a')](function(_0x3dbe9b){if(_0x3dbe9b){return _0x3dbe9b?{'count':_0x1e4e18,'rows':_0x3dbe9b}:null;}})['then'](respondWithResult(_0x17cc71,null))[_0x0306('0x1f')](handleError(_0x17cc71,null));};exports[_0x0306('0xef')]=function(_0x286627,_0x207379,_0xada3f9){var _0x2e810a;var _0x424058;var _0x24a444;var _0x3e51b8=!_[_0x0306('0x6b')](_0x286627[_0x0306('0x56')]['id'])?_0x286627[_0x0306('0x56')]['id']:!_['isNil'](_0x286627[_0x0306('0x2e')]['id'])?_0x286627['user']['id']:null;return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0x3e51b8,'role':{'$or':[_0x0306('0x80'),_0x0306('0x2e'),_0x0306('0x30')]}},'attributes':['id',_0x0306('0x37'),'phone',_0x0306('0xf0'),_0x0306('0x2c'),'internal',_0x0306('0xf1')]})[_0x0306('0x2a')](function(_0x50e5c1){if(_0x50e5c1){if(_0x50e5c1[_0x0306('0x2c')]===_0x0306('0x30')){_0x2e810a=_0x50e5c1;if(_0x286627[_0x0306('0x61')][_0x0306('0xa4')]){_0x24a444=util['format']('LOCAL/%s@from-sip/n',_0x2e810a[_0x286627[_0x0306('0x61')][_0x0306('0xa4')]]);}else if(_0x286627['body'][_0x0306('0xf2')]){_0x24a444=util[_0x0306('0xb0')](_0x0306('0xb1'),_0x286627['body'][_0x0306('0xf2')]);}else{_0x24a444=util['format'](_0x0306('0xb1'),_0x2e810a[_0x0306('0x37')]);}socket['to'](util[_0x0306('0xb0')](_0x0306('0xf3'),_0x2e810a[_0x0306('0x37')]))[_0x0306('0xac')]('user:forcelogout',{'user':{'id':_0x2e810a['id'],'name':_0x2e810a['name']},'ip':_0x286627['headers'][_0x0306('0xf4')]||_0x286627['connection'][_0x0306('0xf5')]||_0x286627[_0x0306('0xf6')][_0x0306('0xf5')]||_0x286627['connection']['socket']['remoteAddress']});return db[_0x0306('0xb3')]['destroy']({'where':{'membername':_0x2e810a['name']},'individualHooks':!![]});}}else{throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))](_0x0306('0xf7'));}})[_0x0306('0x2a')](function(){if(_0x2e810a){return _0x2e810a[_0x0306('0xf8')]({'raw':!![]});}})['then'](function(_0x42f113){if(_0x2e810a){var _0x48301c=[];if(_0x42f113){_0x424058=_0x42f113;if(_0x424058[_0x0306('0x4e')]){for(var _0x398a9a=0x0;_0x398a9a<_0x424058[_0x0306('0x4e')];_0x398a9a++){_0x48301c[_0x0306('0x4a')]({'membername':_0x2e810a[_0x0306('0x37')],'UserId':_0x2e810a['id'],'queue_name':_0x424058[_0x398a9a]['name'],'VoiceQueueId':_0x424058[_0x398a9a]['id'],'interface':_0x24a444,'paused':_0x2e810a[_0x0306('0xf1')]||![],'penalty':_0x424058[_0x398a9a][_0x0306('0xf9')]||0x0});}return BPromise[_0x0306('0xb2')](_0x48301c,function(_0x554dcf){return db[_0x0306('0xb3')][_0x0306('0xfa')](_0x554dcf);});}}}})['then'](function(){if(_0x2e810a){return db['MemberReport'][_0x0306('0x4b')]({'where':{'membername':_0x2e810a['name'],'exitAt':null}});}})['then'](function(_0x477758){if(_0x2e810a){var _0x38448=[];_0x477758['forEach'](function(_0x302ca4){_0x38448['push'](_0x302ca4[_0x0306('0x29')]({'exitAt':moment()[_0x0306('0xb0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0306('0x8d')](_0x38448);}})['then'](function(){if(_0x2e810a){var _0x5edd87=[];var _0x145741=[];var _0x2cabcc=utils[_0x0306('0xfb')]();var _0x4700f6={'membername':_0x2e810a[_0x0306('0x37')],'interface':_0x24a444,'enterAt':moment()['format'](_0x0306('0xfc')),'role':_0x2e810a[_0x0306('0x2c')],'internal':_0x2e810a[_0x0306('0x66')]};_0x2cabcc['forEach'](function(_0x541383){_0x5edd87[_0x0306('0x4a')](_[_0x0306('0x5e')]({'channel':_0x541383,'type':_0x0306('0xfd'),'data1':_0x286627[_0x0306('0x61')][_0x0306('0xfe')],'data2':_0x24a444},_0x4700f6));if(_0x2e810a['loginInPause']){_0x145741['push'](_[_0x0306('0x5e')]({'channel':_0x541383,'type':_0x0306('0xff'),'data1':_0x0306('0x100')},_0x4700f6));}});return db['MemberReport'][_0x0306('0x89')](_0x5edd87['concat'](_0x145741),{'individualHooks':!![]});}})[_0x0306('0x2a')](function(){if(_0x2e810a){return _0x2e810a[_0x0306('0x29')]({'online':!![],'lastLoginAt':moment()[_0x0306('0xb0')](_0x0306('0xfc')),'voicePause':_0x2e810a[_0x0306('0xf1')]||![],'mailPause':_0x2e810a[_0x0306('0xf1')]||![],'chatPause':_0x2e810a[_0x0306('0xf1')]||![],'faxPause':_0x2e810a[_0x0306('0xf1')]||![],'smsPause':_0x2e810a[_0x0306('0xf1')]||![],'openchannelPause':_0x2e810a['loginInPause']||![],'whatsappPause':_0x2e810a[_0x0306('0xf1')]||![],'pauseType':_0x2e810a[_0x0306('0xf1')]?'LOGININPAUSE':null,'interface':_0x24a444,'lastPauseAt':moment()[_0x0306('0xb0')](_0x0306('0xfc'))});}})[_0x0306('0x2a')](function(_0x3b6956){if(_0x286627[_0x0306('0x101')]){return _0xada3f9();}else{return BPromise[_0x0306('0x102')](_0x3b6956)[_0x0306('0x2a')](respondWithResult(_0x207379,null));}})['catch'](handleError(_0x207379,null));};exports[_0x0306('0x103')]=function(_0x33c7e4,_0x4cf85b){var _0x1acc35;return db['User'][_0x0306('0x36')]({'where':{'id':_0x33c7e4[_0x0306('0x56')]['id'],'role':_0x0306('0x30')},'attributes':['id',_0x0306('0x37'),_0x0306('0x2c')]})['then'](handleEntityNotFound(_0x4cf85b,null))[_0x0306('0x2a')](function(_0x3e9c3c){if(_0x3e9c3c){_0x1acc35=_0x3e9c3c;return db[_0x0306('0xb3')][_0x0306('0x2b')]({'where':{'membername':_0x1acc35[_0x0306('0x37')]},'individualHooks':!![]});}})[_0x0306('0x2a')](function(){return db[_0x0306('0x104')][_0x0306('0x4b')]({'where':{'membername':_0x1acc35[_0x0306('0x37')],'exitAt':null}});})['then'](function(_0x3da06c){var _0x24c521=[];_0x3da06c[_0x0306('0x105')](function(_0x4a2a67){_0x24c521['push'](_0x4a2a67[_0x0306('0x29')]({'exitAt':moment()[_0x0306('0xb0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x24c521);})[_0x0306('0x2a')](function(){return _0x1acc35['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0306('0x2a')](respondWithResult(_0x4cf85b,null))[_0x0306('0x1f')](handleError(_0x4cf85b,null));};exports['pause']=function(_0x23a922,_0x2cb227){var _0x4bc1ba;return db[_0x0306('0xb3')][_0x0306('0x29')]({'paused':0x1},{'where':{'UserId':_0x23a922['params']['id']},'individualHooks':!![]})[_0x0306('0x2a')](function(){return db['User'][_0x0306('0x36')]({'where':{'id':_0x23a922[_0x0306('0x56')]['id'],'role':_0x0306('0x30')},'attributes':['id',_0x0306('0x37'),_0x0306('0x2c'),'internal',_0x0306('0xa4')]});})['then'](handleEntityNotFound(_0x2cb227,null))['then'](function(_0x3baab3){if(_0x3baab3){_0x4bc1ba=_0x3baab3;return respondWithRpcPromise('QueuePause',_0x0306('0x106'),{'id':_0x4bc1ba['id'],'name':_0x4bc1ba[_0x0306('0x37')],'pause':!![]});}})['then'](function(){if(_0x4bc1ba){return db[_0x0306('0x104')][_0x0306('0x4b')]({'where':{'membername':_0x4bc1ba['name'],'type':_0x0306('0xff'),'exitAt':null}});}})[_0x0306('0x2a')](function(_0x5cea77){if(_0x5cea77['length']){var _0x36633a=moment()[_0x0306('0xb0')](_0x0306('0xfc'));for(var _0x2353c5=0x0,_0x475106=_0x5cea77[_0x0306('0x4e')];_0x2353c5<_0x475106;_0x2353c5++){_0x5cea77[_0x2353c5][_0x0306('0x107')]({'exitAt':_0x36633a});}}})['then'](function(){var _0x43e7dc=[];var _0x37d804=utils['getChannels']();_0x37d804[_0x0306('0x105')](function(_0x23eadc){_0x43e7dc['push']({'channel':_0x23eadc,'membername':_0x4bc1ba[_0x0306('0x37')],'interface':_['isNil'](_0x4bc1ba['interface'])?util['format'](_0x0306('0xb1'),_0x4bc1ba[_0x0306('0x37')]):_0x4bc1ba[_0x0306('0xa4')],'type':_0x0306('0xff'),'enterAt':moment()[_0x0306('0xb0')](_0x0306('0xfc')),'data1':_0x23a922[_0x0306('0x61')][_0x0306('0x3e')]||_0x0306('0x108'),'role':_0x4bc1ba['role'],'internal':_0x4bc1ba[_0x0306('0x66')]});});return db['MemberReport']['bulkCreate'](_0x43e7dc,{'individualHooks':!![]});})['then'](function(){return _0x4bc1ba[_0x0306('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x23a922[_0x0306('0x61')][_0x0306('0x3e')]||_0x0306('0x108'),'lastPauseAt':moment()[_0x0306('0xb0')](_0x0306('0xfc'))});})[_0x0306('0x2a')](respondWithResult(_0x2cb227,null))[_0x0306('0x1f')](handleError(_0x2cb227,null));};exports['unpause']=function(_0xc1afed,_0x12a85e){var _0x46d323;return db[_0x0306('0x3b')][_0x0306('0x36')]({'where':{'id':_0xc1afed[_0x0306('0x56')]['id']},'attributes':['id',_0x0306('0x37'),_0x0306('0x2c'),_0x0306('0xa3'),_0x0306('0x109'),'chatPause',_0x0306('0x10a'),'openchannelPause','smsPause',_0x0306('0x10b'),_0x0306('0x10c'),'lastPauseAt']})[_0x0306('0x2a')](handleEntityNotFound(_0x12a85e,null))[_0x0306('0x2a')](function(_0x332ea9){if(_0x332ea9){_0x46d323=_0x332ea9;if(_0xc1afed[_0x0306('0x61')][_0x0306('0xb5')]&&!utils[_0x0306('0xa5')](_0xc1afed[_0x0306('0x61')][_0x0306('0xb5')])){throw new db[(_0x0306('0x94'))][(_0x0306('0x95'))]('Unknown\x20channel');}switch(_0xc1afed[_0x0306('0x61')][_0x0306('0xb5')]){case _0x0306('0xad'):return respondWithRpcPromise(_0x0306('0x10d'),_0x0306('0x10e'),{'id':_0x46d323['id'],'name':_0x46d323[_0x0306('0x37')],'pause':![]})[_0x0306('0x2a')](function(){return db['UserVoiceQueueRt'][_0x0306('0x29')]({'paused':0x0},{'where':{'UserId':_0x46d323['id']},'individualHooks':!![]});})['then'](function(){return db[_0x0306('0x104')][_0x0306('0x36')]({'where':{'channel':_0xc1afed['body']['channel'],'membername':_0x46d323['name'],'type':'PAUSE','exitAt':null}});})[_0x0306('0x2a')](function(_0x5ba483){if(_0x5ba483){return _0x5ba483['update']({'exitAt':moment()[_0x0306('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0306('0x10f')},{'individualHooks':!![]});}return null;})[_0x0306('0x2a')](function(){return _0x46d323[_0x0306('0x29')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0x0306('0x50'):case _0x0306('0x54'):case _0x0306('0x53'):return db[_0x0306('0x104')][_0x0306('0x36')]({'where':{'channel':_0xc1afed[_0x0306('0x61')]['channel'],'membername':_0x46d323[_0x0306('0x37')],'type':'PAUSE','exitAt':null}})[_0x0306('0x2a')](function(_0x2c0094){if(_0x2c0094){return _0x2c0094[_0x0306('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0306('0x10f')},{'individualHooks':!![]});}return null;})[_0x0306('0x2a')](function(){var _0x89e860={};_[_0x0306('0x27')](_0x89e860,util[_0x0306('0xb0')](_0x0306('0x110'),_0xc1afed[_0x0306('0x61')][_0x0306('0xb5')],_0x0306('0x111')),![]);return _0x46d323[_0x0306('0x29')](_0x89e860);});default:return respondWithRpcPromise(_0x0306('0x10d'),_0x0306('0x10e'),{'id':_0x46d323['id'],'name':_0x46d323['name'],'pause':![]})[_0x0306('0x2a')](function(){return db[_0x0306('0xb3')][_0x0306('0x29')]({'paused':0x0},{'where':{'UserId':_0x46d323['id']}});})[_0x0306('0x2a')](function(){return db[_0x0306('0x104')][_0x0306('0x4b')]({'where':{'membername':_0x46d323[_0x0306('0x37')],'type':_0x0306('0xff'),'exitAt':null}});})[_0x0306('0x2a')](function(_0xe464e3){var _0x372889=[];_0xe464e3[_0x0306('0x105')](function(_0x5d460d){_0x372889['push'](_0x5d460d[_0x0306('0x29')]({'exitAt':moment()[_0x0306('0xb0')](_0x0306('0xfc')),'data2':_0x0306('0x10f')}));});return BPromise[_0x0306('0x8d')](_0x372889);})['then'](function(){return _0x46d323[_0x0306('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x0306('0x2a')](respondWithResult(_0x12a85e,null))[_0x0306('0x1f')](handleError(_0x12a85e,null));};exports[_0x0306('0x112')]=function(_0x271c38,_0x3407f1){var _0x3b6642={};var _0x2a58aa={};var _0xd7404d;var _0x1b5070;return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x271c38['params']['id']}})['then'](handleEntityNotFound(_0x3407f1,null))['then'](function(_0x3f9ac3){if(_0x3f9ac3){_0xd7404d=_0x3f9ac3;_0x2a58aa['model']=_[_0x0306('0x59')](db[_0x0306('0x113')][_0x0306('0x3c')]);_0x2a58aa[_0x0306('0x45')]=_['keys'](_0x271c38['query']);_0x2a58aa[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x2a58aa['model'],_0x2a58aa[_0x0306('0x45')]);_0x3b6642['attributes']=_[_0x0306('0x5b')](_0x2a58aa[_0x0306('0x57')],qs['fields'](_0x271c38[_0x0306('0x45')]['fields']));_0x3b6642[_0x0306('0x49')]=_0x3b6642[_0x0306('0x49')][_0x0306('0x4e')]?_0x3b6642[_0x0306('0x49')]:_0x2a58aa['model'];_0x3b6642[_0x0306('0xd0')]=qs['sort'](_0x271c38[_0x0306('0x45')]['sort']);_0x3b6642[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x271c38['query'],_0x2a58aa[_0x0306('0x5a')]));if(_0x271c38[_0x0306('0x45')][_0x0306('0x33')]){_0x3b6642[_0x0306('0x44')]=_['merge'](_0x3b6642[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x3b6642[_0x0306('0x49')],function(_0x45cd87){var _0x4de001={};_0x4de001[_0x45cd87]={'$like':'%'+_0x271c38[_0x0306('0x45')]['filter']+'%'};return _0x4de001;})});}_0x3b6642=_[_0x0306('0x5e')]({},_0x3b6642,_0x271c38['options']);return _0xd7404d[_0x0306('0x112')](_0x3b6642);}})[_0x0306('0x2a')](function(_0x2cafdd){if(_0x2cafdd){_0x1b5070=_0x2cafdd[_0x0306('0x4e')];if(!_0x271c38[_0x0306('0x45')][_0x0306('0xd3')](_0x0306('0xda'))){_0x3b6642[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x271c38[_0x0306('0x45')]['limit']);_0x3b6642['offset']=qs[_0x0306('0x23')](_0x271c38[_0x0306('0x45')]['offset']);}return _0xd7404d[_0x0306('0x112')](_0x3b6642);}})[_0x0306('0x2a')](function(_0x2eb9f6){if(_0x2eb9f6){return _0x2eb9f6?{'count':_0x1b5070,'rows':_0x2eb9f6}:null;}})[_0x0306('0x2a')](respondWithResult(_0x3407f1,null))[_0x0306('0x1f')](handleError(_0x3407f1,null));};exports[_0x0306('0x114')]=function(_0x1e9fe6,_0x3fc492){return db['User'][_0x0306('0x36')]({'where':{'id':_0x1e9fe6[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x3fc492,null))[_0x0306('0x2a')](function(_0x2c9e81){if(_0x2c9e81){var _0x57129b=_0x2c9e81['get']({'plain':!![]});return _0x2c9e81[_0x0306('0x114')](_0x1e9fe6[_0x0306('0x61')][_0x0306('0x64')],_['omit'](_0x1e9fe6['body'],[_0x0306('0x64'),'id'])||{})[_0x0306('0x2a')](function(){for(var _0x20ca6c=0x0;_0x20ca6c<_0x1e9fe6[_0x0306('0x61')][_0x0306('0x64')][_0x0306('0x4e')];_0x20ca6c++){var _0x1649d2=[];var _0x1306a7={};db[_0x0306('0x113')][_0x0306('0x9a')]({'where':{'id':_0x1e9fe6['body'][_0x0306('0x64')][_0x20ca6c]}})['then'](function(_0xddf211){_0x1306a7=_0xddf211['dataValues'];_0x1649d2['push'](_0xddf211['getVoiceQueues']()[_0x0306('0x2a')](function(_0x3c18b4){for(var _0x5f24c0=0x0;_0x5f24c0<_0x3c18b4[_0x0306('0x4e')];_0x5f24c0++){_0x3c18b4[_0x5f24c0][_0x0306('0x115')](_0x0306('0xb5'),_0x0306('0x116'));}return _0x3c18b4;}));_0x1649d2[_0x0306('0x4a')](_0xddf211[_0x0306('0x117')]()['then'](function(_0xa6cc0){for(var _0x6bc546=0x0;_0x6bc546<_0xa6cc0[_0x0306('0x4e')];_0x6bc546++){_0xa6cc0[_0x6bc546][_0x0306('0x115')](_0x0306('0xb5'),'Chat');}return _0xa6cc0;}));_0x1649d2[_0x0306('0x4a')](_0xddf211['getMailQueues']()[_0x0306('0x2a')](function(_0x146206){for(var _0x345edd=0x0;_0x345edd<_0x146206['length'];_0x345edd++){_0x146206[_0x345edd]['setDataValue']('channel','Mail');}return _0x146206;}));_0x1649d2[_0x0306('0x4a')](_0xddf211[_0x0306('0x118')]()['then'](function(_0x11f2e8){for(var _0xd41e2c=0x0;_0xd41e2c<_0x11f2e8[_0x0306('0x4e')];_0xd41e2c++){_0x11f2e8[_0xd41e2c][_0x0306('0x115')]('channel',_0x0306('0x119'));}return _0x11f2e8;}));_0x1649d2[_0x0306('0x4a')](_0xddf211[_0x0306('0x11a')]()['then'](function(_0x3b7296){for(var _0x311c86=0x0;_0x311c86<_0x3b7296['length'];_0x311c86++){_0x3b7296[_0x311c86]['setDataValue']('channel',_0x0306('0x11b'));}return _0x3b7296;}));_0x1649d2[_0x0306('0x4a')](_0xddf211[_0x0306('0x11c')]()[_0x0306('0x2a')](function(_0x13e03a){for(var _0x1420a9=0x0;_0x1420a9<_0x13e03a[_0x0306('0x4e')];_0x1420a9++){_0x13e03a[_0x1420a9][_0x0306('0x115')]('channel','Fax');}return _0x13e03a;}));_0x1649d2[_0x0306('0x4a')](_0xddf211[_0x0306('0x11d')]()[_0x0306('0x2a')](function(_0xdd63b3){for(var _0x3eb472=0x0;_0x3eb472<_0xdd63b3[_0x0306('0x4e')];_0x3eb472++){_0xdd63b3[_0x3eb472][_0x0306('0x115')](_0x0306('0xb5'),_0x0306('0x11e'));}return _0xdd63b3;}));return BPromise[_0x0306('0x8d')](_0x1649d2);})[_0x0306('0x2a')](function(_0x45f562){var _0x51a60c=_[_0x0306('0x11f')](_0x45f562);_0x1649d2=[];return db[_0x0306('0x6c')]['transaction'](function(_0x581352){for(var _0x315a9a=0x0;_0x315a9a<_0x51a60c[_0x0306('0x4e')];_0x315a9a++){_0x1649d2[_0x0306('0x4a')](_0x51a60c[_0x315a9a][_0x0306('0x120')](_0x57129b['id']),{'transaction':_0x581352});}return BPromise[_0x0306('0x8d')](_0x1649d2)['then'](function(){if(_0x57129b[_0x0306('0xa2')]){return BPromise[_0x0306('0xb2')](_[_0x0306('0x33')](_0x51a60c,function(_0x4770d6){return _0x4770d6[_0x0306('0x121')](_0x0306('0xb5'))===_0x0306('0x116');}),function(_0x2b4ca3){return db[_0x0306('0xb3')][_0x0306('0xfa')]({'membername':_0x57129b[_0x0306('0x37')],'UserId':_0x57129b['id'],'queue_name':_0x2b4ca3[_0x0306('0x37')],'VoiceQueueId':_0x2b4ca3['id'],'interface':_['isNil'](_0x57129b[_0x0306('0xa4')])?util[_0x0306('0xb0')]('SIP/%s',_0x57129b[_0x0306('0x37')]):_0x57129b[_0x0306('0xa4')],'paused':_0x57129b[_0x0306('0xa3')]||![],'penalty':_0x57129b[_0x0306('0xa8')]},{'transaction':_0x581352});});}else{return;}})['then'](function(){for(var _0xad205=0x0;_0xad205<_0x51a60c[_0x0306('0x4e')];_0xad205++){var _0x161cb4=_0x51a60c[_0xad205][_0x0306('0x121')]('channel');var _0x2470be=_0x161cb4+'QueueId';socket[_0x0306('0xac')](_0x0306('0x2e')+_0x161cb4+'Queue:save',{'UserId':_0x57129b['id'],['queueField']:_0x51a60c[_0xad205]['id']});}});});})[_0x0306('0x2a')](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1306a7['id']}})[_0x0306('0x2a')](function(_0x4fbc9b){if(_0x4fbc9b){db[_0x0306('0x122')][_0x0306('0x84')]({'UserId':_0x1e9fe6[_0x0306('0x56')]['id'],'VoicePrefixId':_0x4fbc9b['VoicePrefixId']});}});});}});}})[_0x0306('0x2a')](respondWithStatusCode(_0x3fc492,null))[_0x0306('0x1f')](handleError(_0x3fc492,null));};exports[_0x0306('0x123')]=function(_0x2e4c8e,_0x440adb){return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x2e4c8e[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x440adb,null))['then'](function(_0x4e8d3d){if(_0x4e8d3d){var _0x46f54f=_0x4e8d3d[_0x0306('0xaf')]({'plain':!![]});var _0x36cd2a=_0x2e4c8e[_0x0306('0x45')]['ids'];return _0x4e8d3d[_0x0306('0x123')](_0x36cd2a)[_0x0306('0x2a')](function(){for(var _0x528e02=0x0;_0x528e02<_0x36cd2a[_0x0306('0x4e')];_0x528e02++){var _0x68f603=[];var _0x58c06e={};db[_0x0306('0x113')][_0x0306('0x9a')]({'where':{'id':_0x36cd2a[_0x528e02]}})[_0x0306('0x2a')](function(_0x5ebec1){_0x58c06e=_0x5ebec1[_0x0306('0x51')];_0x68f603['push'](_0x5ebec1[_0x0306('0xf8')]()['then'](function(_0x119583){for(var _0x57295b=0x0;_0x57295b<_0x119583[_0x0306('0x4e')];_0x57295b++){_0x119583[_0x57295b][_0x0306('0x115')]('channel',_0x0306('0x116'));}return _0x119583;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1[_0x0306('0x117')]()[_0x0306('0x2a')](function(_0x5c9e79){for(var _0xd74729=0x0;_0xd74729<_0x5c9e79[_0x0306('0x4e')];_0xd74729++){_0x5c9e79[_0xd74729][_0x0306('0x115')]('channel','Chat');}return _0x5c9e79;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1['getMailQueues']()[_0x0306('0x2a')](function(_0x36ffae){for(var _0xc377ff=0x0;_0xc377ff<_0x36ffae[_0x0306('0x4e')];_0xc377ff++){_0x36ffae[_0xc377ff][_0x0306('0x115')]('channel',_0x0306('0x124'));}return _0x36ffae;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1[_0x0306('0x118')]()[_0x0306('0x2a')](function(_0x23d82e){for(var _0x11628c=0x0;_0x11628c<_0x23d82e[_0x0306('0x4e')];_0x11628c++){_0x23d82e[_0x11628c][_0x0306('0x115')](_0x0306('0xb5'),_0x0306('0x119'));}return _0x23d82e;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1[_0x0306('0x11a')]()['then'](function(_0x5ef781){for(var _0x88fdb9=0x0;_0x88fdb9<_0x5ef781[_0x0306('0x4e')];_0x88fdb9++){_0x5ef781[_0x88fdb9][_0x0306('0x115')](_0x0306('0xb5'),_0x0306('0x11b'));}return _0x5ef781;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1[_0x0306('0x11c')]()['then'](function(_0x5de37c){for(var _0x8af651=0x0;_0x8af651<_0x5de37c[_0x0306('0x4e')];_0x8af651++){_0x5de37c[_0x8af651][_0x0306('0x115')]('channel',_0x0306('0x125'));}return _0x5de37c;}));_0x68f603[_0x0306('0x4a')](_0x5ebec1[_0x0306('0x11d')]()[_0x0306('0x2a')](function(_0x51b13b){for(var _0x4fc8c9=0x0;_0x4fc8c9<_0x51b13b[_0x0306('0x4e')];_0x4fc8c9++){_0x51b13b[_0x4fc8c9]['setDataValue'](_0x0306('0xb5'),_0x0306('0x11e'));}return _0x51b13b;}));return BPromise[_0x0306('0x8d')](_0x68f603);})[_0x0306('0x2a')](function(_0x34a94a){var _0x54108e=_[_0x0306('0x11f')](_0x34a94a);_0x68f603=[];return db[_0x0306('0x6c')]['transaction'](function(_0x21b529){for(var _0x53339b=0x0;_0x53339b<_0x54108e[_0x0306('0x4e')];_0x53339b++){_0x68f603[_0x0306('0x4a')](_0x54108e[_0x53339b][_0x0306('0x126')](_0x46f54f['id']),{'transaction':_0x21b529});}return BPromise[_0x0306('0x8d')](_0x68f603)[_0x0306('0x2a')](function(){if(_0x46f54f['online']){return BPromise[_0x0306('0xb2')](_[_0x0306('0x33')](_0x54108e,function(_0x2857de){return _0x2857de['getDataValue'](_0x0306('0xb5'))==='Voice';}),function(_0x2b7379){return db['UserVoiceQueueRt'][_0x0306('0x2b')]({'where':{'VoiceQueueId':_0x2b7379['id'],'UserId':_0x46f54f['id']},'transaction':_0x21b529});});}else{return;}})[_0x0306('0x2a')](function(){db[_0x0306('0x127')]['findOne']({'where':{'teamId':_0x58c06e['id']}})[_0x0306('0x2a')](function(_0xbef176){if(_0xbef176){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x46f54f['id'],'VoicePrefixId':_0xbef176[_0x0306('0x51')][_0x0306('0x128')]}});}});})[_0x0306('0x2a')](function(){for(var _0x37d54e=0x0;_0x37d54e<_0x54108e[_0x0306('0x4e')];_0x37d54e++){var _0x4d0fc0=_0x54108e[_0x37d54e][_0x0306('0x121')](_0x0306('0xb5'));var _0x1173c7=_0x4d0fc0+_0x0306('0xab');socket['emit'](_0x0306('0x2e')+_0x4d0fc0+_0x0306('0xb7'),{'UserId':_0x46f54f['id'],['queueField']:_0x54108e[_0x37d54e]['id']});}});});});}});}})[_0x0306('0x2a')](respondWithStatusCode(_0x440adb,null))[_0x0306('0x1f')](handleError(_0x440adb,null));};exports['getLists']=function(_0x5bf6ad,_0x445bb5){var _0x2abfa3={};var _0x4c6a8b={};var _0x290c78;var _0xb7497c;return db[_0x0306('0x3b')]['findOne']({'where':{'id':_0x5bf6ad[_0x0306('0x56')]['id']}})[_0x0306('0x2a')](handleEntityNotFound(_0x445bb5,null))['then'](function(_0x3f9966){if(_0x3f9966){_0x290c78=_0x3f9966;_0x4c6a8b[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0x129')]['rawAttributes']);_0x4c6a8b[_0x0306('0x45')]=_[_0x0306('0x59')](_0x5bf6ad[_0x0306('0x45')]);_0x4c6a8b[_0x0306('0x5a')]=_['intersection'](_0x4c6a8b[_0x0306('0x57')],_0x4c6a8b[_0x0306('0x45')]);_0x2abfa3[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x4c6a8b[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x5bf6ad['query'][_0x0306('0x5c')]));_0x2abfa3[_0x0306('0x49')]=_0x2abfa3[_0x0306('0x49')][_0x0306('0x4e')]?_0x2abfa3[_0x0306('0x49')]:_0x4c6a8b['model'];_0x2abfa3['order']=qs[_0x0306('0xd1')](_0x5bf6ad[_0x0306('0x45')][_0x0306('0xd1')]);_0x2abfa3['where']=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x5bf6ad[_0x0306('0x45')],_0x4c6a8b[_0x0306('0x5a')]));if(_0x5bf6ad[_0x0306('0x45')][_0x0306('0x33')]){_0x2abfa3['where']=_[_0x0306('0x5e')](_0x2abfa3[_0x0306('0x44')],{'$or':_[_0x0306('0x34')](_0x2abfa3[_0x0306('0x49')],function(_0x38ee6a){var _0x33ea76={};_0x33ea76[_0x38ee6a]={'$like':'%'+_0x5bf6ad['query'][_0x0306('0x33')]+'%'};return _0x33ea76;})});}_0x2abfa3=_[_0x0306('0x5e')]({},_0x2abfa3,_0x5bf6ad[_0x0306('0x5f')]);return _0x290c78['getLists'](_0x2abfa3);}})['then'](function(_0x546623){if(_0x546623){_0xb7497c=_0x546623[_0x0306('0x4e')];if(!_0x5bf6ad[_0x0306('0x45')]['hasOwnProperty']('nolimit')){_0x2abfa3[_0x0306('0x25')]=qs[_0x0306('0x25')](_0x5bf6ad['query'][_0x0306('0x25')]);_0x2abfa3[_0x0306('0x23')]=qs[_0x0306('0x23')](_0x5bf6ad[_0x0306('0x45')][_0x0306('0x23')]);}return _0x290c78[_0x0306('0x12a')](_0x2abfa3);}})[_0x0306('0x2a')](function(_0x5b5bd9){if(_0x5b5bd9){return _0x5b5bd9?{'count':_0xb7497c,'rows':_0x5b5bd9}:null;}})[_0x0306('0x2a')](respondWithResult(_0x445bb5,null))[_0x0306('0x1f')](handleError(_0x445bb5,null));};exports[_0x0306('0x12b')]=function(_0x33309c,_0x28ebcd){var _0x3c7a6e={};var _0x56cdb2={};var _0x388490;return db[_0x0306('0x3b')][_0x0306('0x9a')]({'where':{'id':_0x33309c['params']['id']}})['then'](handleEntityNotFound(_0x28ebcd,null))[_0x0306('0x2a')](function(_0xf83f09){if(_0xf83f09){_0x388490=_0xf83f09;_0x56cdb2[_0x0306('0x57')]=_[_0x0306('0x59')](db[_0x0306('0x3b')]['rawAttributes']);_0x56cdb2[_0x0306('0x45')]=_[_0x0306('0x59')](_0x33309c['query']);_0x56cdb2[_0x0306('0x5a')]=_[_0x0306('0x5b')](_0x56cdb2[_0x0306('0x57')],_0x56cdb2[_0x0306('0x45')]);_0x3c7a6e[_0x0306('0x49')]=_[_0x0306('0x5b')](_0x56cdb2[_0x0306('0x57')],qs[_0x0306('0x5c')](_0x33309c[_0x0306('0x45')][_0x0306('0x5c')]));_0x3c7a6e[_0x0306('0x49')]=_0x3c7a6e[_0x0306('0x49')][_0x0306('0x4e')]?_0x3c7a6e[_0x0306('0x49')]:_0x56cdb2[_0x0306('0x57')];_0x3c7a6e[_0x0306('0xd0')]=qs[_0x0306('0xd1')](_0x33309c[_0x0306('0x45')][_0x0306('0xd1')]);_0x3c7a6e[_0x0306('0x44')]=qs[_0x0306('0x5a')](_[_0x0306('0xd2')](_0x33309c[_0x0306('0x45')],_0x56cdb2[_0x0306('0x5a')]));if(_0x33309c['query'][_0x0306('0x33')]){_0x3c7a6e[_0x0306('0x44')]=_[_0x0306('0x5e')](_0x3c7a6e['where'],{'$or':_['map'](_0x3c7a6e[_0x0306('0x49')],function(_0x57da39){var _0x5a13e2={};_0x5a13e2[_0x57da39]={'$like':'%'+_0x33309c['query'][_0x0306('0x33')]+'%'};return _0x5a13e2;})});}_0x3c7a6e[_0x0306('0x57')]=db[_0x0306('0x3b')];_0x3c7a6e['as']=_0x0306('0x2f');_0x3c7a6e=_[_0x0306('0x5e')]({},_0x3c7a6e,_0x33309c['options']);return _0x388490[_0x0306('0xf8')]({'include':[_0x3c7a6e]});}})[_0x0306('0x2a')](function(_0xca0172){if(_0xca0172){var _0xdd9ae={},_0x488320=[];for(var _0x3169b3=0x0;_0x3169b3<_0xca0172['length'];_0x3169b3+=0x1){for(var _0x4e0b28=0x0,_0x21e9b2;_0x4e0b28<_0xca0172[_0x3169b3][_0x0306('0x2f')][_0x0306('0x4e')];_0x4e0b28+=0x1){_0x21e9b2=_0xca0172[_0x3169b3][_0x0306('0x2f')][_0x4e0b28][_0x0306('0xaf')]({'plain':!![]});_0xdd9ae[_0x21e9b2['id']]=_0x21e9b2;}}_0xdd9ae=_[_0x0306('0x12c')](_0xdd9ae);for(var _0x3fff75=qs[_0x0306('0x23')](_0x33309c[_0x0306('0x45')][_0x0306('0x23')]);_0x3fff75<_0xdd9ae[_0x0306('0x4e')]&&_0x488320[_0x0306('0x4e')]=_0xd5dc65){_0x22d969=_0xd5dc65;_0x61b7c1=0xc8;}else{_0x61b7c1=0xce;}_0x4d3d54[_0x231e('0x1c')](_0x61b7c1);return _0x4d3d54['set'](_0x231e('0x23'),_0x3a7a6e+'-'+_0x22d969+'/'+_0xd5dc65)['json'](_0x37c0de);}return null;};}function saveUpdates(_0x256722){return function(_0x1e1054){if(_0x1e1054){return _0x1e1054['update'](_0x256722)[_0x231e('0x10')](function(_0x1908d1){return _0x1908d1;});}return null;};}function removeEntity(_0x2bb1bb){return function(_0x5b8dbb){if(_0x5b8dbb){return _0x5b8dbb[_0x231e('0x24')]()[_0x231e('0x10')](function(){var _0x97895=_0x5b8dbb['get']({'plain':!![]});if(_0x97895['role']===_0x231e('0x25'))return;var _0x5145b2=[{'name':_0x231e('0x26'),'value':_0x231e('0x27'),'ignore':!![]},{'name':'Agents','value':_0x231e('0x28'),'ignore':![]},{'name':'Telephones','value':_0x231e('0x29'),'ignore':![]}];var _0x3538f7=_(_0x5145b2)['filter'](_0x231e('0x2a'))[_0x231e('0x2b')](_0x231e('0x2c'))[_0x231e('0x2c')]();if(_['includes'](_0x3538f7,_0x97895[_0x231e('0x2d')])){return;}var _0x813e3e=_['find'](_0x5145b2,[_0x231e('0x2c'),_0x97895[_0x231e('0x2d')]])[_0x231e('0x2e')];return db[_0x231e('0x2f')][_0x231e('0x24')]({'where':{'type':_0x813e3e,'resourceId':_0x97895['id']}})[_0x231e('0x10')](function(){return _0x5b8dbb;});})['then'](function(){_0x2bb1bb[_0x231e('0x1c')](0xcc)[_0x231e('0x1d')]();});}};}function handleEntityNotFound(_0xc11eac){return function(_0x237349){if(!_0x237349){_0xc11eac[_0x231e('0x1b')](0x194);}return _0x237349;};}function handleError(_0x213db1,_0x2b944e){_0x2b944e=_0x2b944e||0x1f4;return function(_0x3d4947){logger[_0x231e('0x17')](_0x3d4947[_0x231e('0x30')]);if(_0x3d4947[_0x231e('0x2e')]){delete _0x3d4947[_0x231e('0x2e')];}_0x213db1[_0x231e('0x1c')](_0x2b944e)[_0x231e('0x31')](_0x3d4947);};}exports[_0x231e('0x32')]=function(_0x47c972,_0x1ef8ee){var _0x3f1ffc={},_0x2719c1={'count':0x0,'rows':[]};var _0x2778cf=_(db[_0x231e('0x33')][_0x231e('0x34')])['map'](function(_0xd27ceb){return{'name':_0xd27ceb[_0x231e('0x35')],'type':_0xd27ceb[_0x231e('0x36')][_0x231e('0x37')]};})[_0x231e('0x38')](function(_0x34b535){return!_[_0x231e('0x39')]([_0x231e('0x3a'),'salt'],_0x34b535['name']);})[_0x231e('0x2c')]();_0x3f1ffc=qs['getOptions'](_0x2778cf,_0x47c972);var _0x51b27f={'where':_0x3f1ffc[_0x231e('0x3b')]};return db[_0x231e('0x33')]['count'](_0x51b27f)[_0x231e('0x10')](function(_0x45d8f0){_0x2719c1[_0x231e('0x22')]=_0x45d8f0;if(_0x47c972[_0x231e('0x3c')][_0x231e('0x3d')]){_0x3f1ffc[_0x231e('0x3e')]=[{'all':!![]}];}if(_0x47c972[_0x231e('0x3c')][_0x231e('0x3f')]===_0x231e('0x40')){_0x3f1ffc['include']=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x231e('0x39')](_0x3f1ffc[_0x231e('0x41')],'id')){_0x3f1ffc[_0x231e('0x41')][_0x231e('0x42')]('id');}return db[_0x231e('0x33')][_0x231e('0x43')](_0x3f1ffc);})[_0x231e('0x10')](function(_0x227f47){_0x2719c1[_0x231e('0x44')]=_0x227f47;if(_0x47c972[_0x231e('0x3c')]['openTabs']===_0x231e('0x40')){var _0x433c96=[];for(var _0x2cd2e4=0x0;_0x2cd2e4<_0x2719c1[_0x231e('0x44')]['length'];_0x2cd2e4++){_0x433c96[_0x231e('0x42')](get_open_tabs('chat',_0x2719c1['rows'][_0x2cd2e4][_0x231e('0x45')]));_0x433c96[_0x231e('0x42')](get_open_tabs(_0x231e('0x46'),_0x2719c1[_0x231e('0x44')][_0x2cd2e4][_0x231e('0x45')]));_0x433c96['push'](get_open_tabs(_0x231e('0x47'),_0x2719c1[_0x231e('0x44')][_0x2cd2e4]['dataValues']));_0x433c96[_0x231e('0x42')](get_open_tabs(_0x231e('0x48'),_0x2719c1[_0x231e('0x44')][_0x2cd2e4][_0x231e('0x45')]));_0x433c96[_0x231e('0x42')](get_open_tabs('openchannel',_0x2719c1[_0x231e('0x44')][_0x2cd2e4][_0x231e('0x45')]));_0x433c96[_0x231e('0x42')](get_open_tabs(_0x231e('0x49'),_0x2719c1['rows'][_0x2cd2e4]['dataValues']));}return BPromise['all'](_0x433c96)['then'](function(){return _0x2719c1;});}else{return _0x2719c1;}})[_0x231e('0x10')](respondWithFilteredResult(_0x1ef8ee,_0x3f1ffc))[_0x231e('0x1a')](handleError(_0x1ef8ee,null));};exports[_0x231e('0x4a')]=function(_0x348c54,_0x1e1537){var _0x433ab2={'raw':![],'where':{'id':_0x348c54[_0x231e('0x4b')]['id']}},_0x88cc21={};_0x88cc21[_0x231e('0x4c')]=_[_0x231e('0x4d')](_[_0x231e('0x4e')](db['User'][_0x231e('0x34')]),['password',_0x231e('0x4f')]);_0x88cc21[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x348c54['query']);_0x88cc21[_0x231e('0x50')]=_['intersection'](_0x88cc21[_0x231e('0x4c')],_0x88cc21[_0x231e('0x3c')]);_0x433ab2[_0x231e('0x41')]=_[_0x231e('0x51')](_0x88cc21['model'],qs[_0x231e('0x52')](_0x348c54[_0x231e('0x3c')][_0x231e('0x52')]));_0x433ab2[_0x231e('0x41')]=_0x433ab2['attributes'][_0x231e('0x53')]?_0x433ab2[_0x231e('0x41')]:_0x88cc21[_0x231e('0x4c')];if(_0x348c54[_0x231e('0x3c')][_0x231e('0x3d')]){_0x433ab2[_0x231e('0x3e')]=[{'all':!![]}];}if(_0x348c54[_0x231e('0x3c')][_0x231e('0x3f')]==='true'){_0x433ab2[_0x231e('0x3e')]=[{'model':db[_0x231e('0x54')],'as':_0x231e('0x3f')}];}_0x433ab2=_['merge']({},_0x433ab2,_0x348c54[_0x231e('0x55')]);if(!_[_0x231e('0x39')](_0x433ab2[_0x231e('0x41')],'id')){_0x433ab2[_0x231e('0x41')][_0x231e('0x42')]('id');}return db[_0x231e('0x33')][_0x231e('0x56')](_0x433ab2)['then'](handleEntityNotFound(_0x1e1537,null))['then'](function(_0xd96afd){var _0x10557f=[];values=_0xd96afd;if(_0x348c54[_0x231e('0x3c')][_0x231e('0x57')]==='true'){_0x10557f[_0x231e('0x42')](get_open_tabs(_0x231e('0x58'),_0xd96afd[_0x231e('0x45')]));_0x10557f['push'](get_open_tabs('sms',_0xd96afd[_0x231e('0x45')]));_0x10557f[_0x231e('0x42')](get_open_tabs(_0x231e('0x59'),_0xd96afd[_0x231e('0x45')]));_0x10557f[_0x231e('0x42')](get_open_tabs(_0x231e('0x49'),_0xd96afd[_0x231e('0x45')]));_0x10557f[_0x231e('0x42')](get_open_tabs(_0x231e('0x47'),_0xd96afd[_0x231e('0x45')]));_0x10557f[_0x231e('0x42')](get_open_tabs(_0x231e('0x48'),_0xd96afd[_0x231e('0x45')]));return BPromise[_0x231e('0x5a')](_0x10557f);}else{return values;}})['then'](function(){return values;})[_0x231e('0x10')](respondWithResult(_0x1e1537,null))[_0x231e('0x1a')](handleError(_0x1e1537,null));};exports[_0x231e('0x5b')]=function(_0x104ec8,_0x43459c){if(_0x104ec8[_0x231e('0x5c')]['id']){delete _0x104ec8[_0x231e('0x5c')]['id'];}delete _0x104ec8[_0x231e('0x5c')][_0x231e('0x2d')];return db['User']['find']({'where':{'id':_0x104ec8[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43459c,null))[_0x231e('0x10')](saveUpdates(_0x104ec8[_0x231e('0x5c')],null))['then'](respondWithResult(_0x43459c,null))[_0x231e('0x1a')](handleError(_0x43459c,null));};exports[_0x231e('0x5d')]=function(_0x21c905,_0xfe14d9){return db[_0x231e('0x33')][_0x231e('0x5d')]()[_0x231e('0x10')](respondWithResult(_0xfe14d9,null))['catch'](handleError(_0xfe14d9,null));};exports[_0x231e('0x5e')]=function(_0x848d0b,_0x59c29c){return db[_0x231e('0x33')][_0x231e('0x56')]({'where':{'id':_0x848d0b[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x59c29c,null))[_0x231e('0x10')](function(_0x58019d){if(_0x58019d){return _0x58019d[_0x231e('0x5e')](_0x848d0b['body'][_0x231e('0x5f')],_[_0x231e('0x60')](_0x848d0b[_0x231e('0x5c')],[_0x231e('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x59c29c,null))['catch'](handleError(_0x59c29c,null));};function validateUser(_0x3111bf){return new BPromise(function(_0xa6fff,_0xd85db2){if(_0x3111bf[_0x231e('0x61')])return _0xa6fff(_0x3111bf);return db['Setting'][_0x231e('0x62')](0x1)[_0x231e('0x10')](function(_0x24a127){if(_0x24a127[_0x231e('0x63')])authService[_0x231e('0x64')](_0x3111bf[_0x231e('0x3a')]);db[_0x231e('0x33')][_0x231e('0x65')](_0x231e('0x61'))[_0x231e('0x10')](function(_0xb29247){if(_['isNil'](_0xb29247)){_0x3111bf[_0x231e('0x61')]=_0x24a127[_0x231e('0x66')]||0x1;return;}if(_[_0x231e('0x67')](_0x24a127[_0x231e('0x66')])||_0x24a127[_0x231e('0x66')]===_0xb29247){_0x3111bf['internal']=_0xb29247+0x1;return;}if(_0x24a127[_0x231e('0x66')]>_0xb29247){_0x3111bf[_0x231e('0x61')]=_0x24a127[_0x231e('0x66')];return;}return db[_0x231e('0x68')][_0x231e('0x3c')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x231e('0x68')][_0x231e('0x69')][_0x231e('0x6a')]})[_0x231e('0x10')](function(_0x102b84){if(_0x102b84&&_0x102b84[_0x231e('0x53')]){for(var _0x4562d2=0x0,_0x99db40=_0x102b84['length'];_0x4562d2<_0x99db40&&_[_0x231e('0x67')](_0x3111bf['internal']);_0x4562d2++){if(_0x24a127['min_internal']<=_0x102b84[_0x4562d2]['from']){_0x3111bf[_0x231e('0x61')]=_0x102b84[_0x4562d2]['from'];}else if(_0x24a127[_0x231e('0x66')]>_0x102b84[_0x4562d2][_0x231e('0x6b')]&&_0x24a127['min_internal']<=_0x102b84[_0x4562d2]['to']){_0x3111bf[_0x231e('0x61')]=_0x24a127[_0x231e('0x66')];}}}if(_['isNil'](_0x3111bf[_0x231e('0x61')])){_0x3111bf[_0x231e('0x61')]=_0xb29247+0x1;}return _0xa6fff(_0x3111bf);});});})[_0x231e('0x1a')](function(_0x3f53e1){_0xd85db2(_0x3f53e1);});});}function updateUser(_0x57d934){return new BPromise(function(_0x410e2f,_0x4aa484){try{if(_0x57d934[_0x231e('0x6c')]){_0x57d934[_0x231e('0x6d')]=_0x57d934['internal'];_0x57d934['VoiceMail']={'mailbox':_0x57d934[_0x231e('0x61')],'password':_0x57d934['password'],'fullname':_0x57d934[_0x231e('0x6e')],'email':_0x57d934[_0x231e('0x6f')]};}if(_0x57d934[_0x231e('0x2d')]===_0x231e('0x28')){if(!_0x57d934['permissions'])_0x57d934['permissions']=[_0x231e('0x70'),_0x231e('0x71'),_0x231e('0x72'),_0x231e('0x73'),_0x231e('0x74'),_0x231e('0x75'),_0x231e('0x76'),'106',_0x231e('0x77'),_0x231e('0x78'),_0x231e('0x79'),_0x231e('0x7a'),_0x231e('0x7b'),_0x231e('0x7c'),_0x231e('0x7d')];}_0x410e2f(_0x57d934);}catch(_0x4555a1){_0x4aa484(_0x4555a1);}});}exports[_0x231e('0x7e')]=function(_0x51ad05,_0x2638e1){if(_0x51ad05[_0x231e('0x27')][_0x231e('0x2d')]==='agent')throw new Error(_0x231e('0x7f'));if(_0x51ad05[_0x231e('0x5c')][_0x231e('0x2d')]===_0x231e('0x27')&&_0x51ad05[_0x231e('0x27')]['role']!=='admin'){throw new Error(_0x231e('0x80'));}if(_0x51ad05['body'][_0x231e('0x2d')]===_0x231e('0x25')&&_0x51ad05[_0x231e('0x27')][_0x231e('0x2d')]!=='admin'){throw new Error(_0x231e('0x81'));}return licenseUtil[_0x231e('0x82')]([_0x51ad05[_0x231e('0x5c')]])[_0x231e('0x10')](function(){return validateUser(_0x51ad05[_0x231e('0x5c')]);})['then'](function(_0xf9dc08){return updateUser(_0xf9dc08)['then'](function(_0xb822e2){if(_0xb822e2[_0x231e('0x2d')]===_0x231e('0x25')){_0xb822e2[_0x231e('0x83')]=_0x51ad05[_0x231e('0x27')]['settingsEnabled'];delete _0xb822e2[_0x231e('0x84')];}return _0xb822e2;});})[_0x231e('0x10')](function(_0x279320){return db['User'][_0x231e('0x7e')](_0x279320,{'include':[{'model':db[_0x231e('0x85')],'as':_0x231e('0x85')}]});})[_0x231e('0x10')](function(_0xa52e34){if(_0x51ad05[_0x231e('0x5c')][_0x231e('0x2d')]===_0x231e('0x27'))return _0xa52e34;if(_0x51ad05['user']['role']!==_0x231e('0x27'))return _0xa52e34;return db['UserProfileSection'][_0x231e('0x56')]({'where':{'name':_0xa52e34['role']===_0x231e('0x28')?_0x231e('0x86'):_0x231e('0x87'),'userProfileId':_0x51ad05[_0x231e('0x27')][_0x231e('0x84')]},'raw':!![]})[_0x231e('0x10')](function(_0x4f213c){if(!_0x4f213c||_0x4f213c[_0x231e('0x88')]!=0x0)return _0xa52e34;return db[_0x231e('0x2f')][_0x231e('0x7e')]({'name':_0xa52e34[_0x231e('0x2e')],'resourceId':_0xa52e34['id'],'type':_0x4f213c[_0x231e('0x2e')],'sectionId':_0x4f213c['id']},{})['then'](function(){return _0xa52e34;});})[_0x231e('0x1a')](function(_0x2dd59b){logger['error'](_0x231e('0x89'),_0x2dd59b);throw _0x2dd59b;});})[_0x231e('0x10')](respondWithResult(_0x2638e1,0xc9))['catch'](handleError(_0x2638e1,null));};exports[_0x231e('0x8a')]=function(_0x467631,_0x342a8a){var _0x29a63f=_0x467631['body'];var _0x2b685e=[];if(_0x467631[_0x231e('0x27')][_0x231e('0x2d')]==='agent')throw new Error(_0x231e('0x7f'));if(_[_0x231e('0x8b')](_0x29a63f,['role',_0x231e('0x27')])&&_0x467631[_0x231e('0x27')]['role']!==_0x231e('0x25')){throw new Error(_0x231e('0x80'));}if(_[_0x231e('0x8b')](_0x29a63f,[_0x231e('0x2d'),'admin'])&&_0x467631[_0x231e('0x27')]['role']!==_0x231e('0x25')){throw new Error(_0x231e('0x8c'));}return licenseUtil[_0x231e('0x82')](_0x29a63f)[_0x231e('0x10')](function(){return validateUser(_0x29a63f[0x0]);})[_0x231e('0x10')](function(){for(var _0x576d89=0x1;_0x576d89<_0x29a63f[_0x231e('0x53')];_0x576d89++){var _0x495038=_0x29a63f[_0x576d89-0x1][_0x231e('0x61')];if(!_0x29a63f[_0x576d89][_0x231e('0x61')])_0x29a63f[_0x576d89][_0x231e('0x61')]=_0x495038+0x1;_0x2b685e[_0x231e('0x42')](validateUser(_0x29a63f[_0x576d89]));}return BPromise[_0x231e('0x5a')](_0x2b685e);})[_0x231e('0x10')](function(){_0x2b685e=[];for(var _0x5512ad=0x0;_0x5512ad<_0x29a63f[_0x231e('0x53')];_0x5512ad++){_0x2b685e[_0x231e('0x42')](updateUser(_0x29a63f[_0x5512ad]));}return BPromise[_0x231e('0x5a')](_0x2b685e);})[_0x231e('0x10')](function(){return BPromise[_0x231e('0x8d')](_0x29a63f,function(_0x15420d){return db[_0x231e('0x33')][_0x231e('0x7e')](_0x15420d,{'include':[{'model':db['VoiceMail'],'as':_0x231e('0x85')}]})[_0x231e('0x10')](function(_0x17349f){_0x15420d['id']=_0x17349f['id'];return _0x15420d;});});})[_0x231e('0x10')](function(_0x46ea19){if(_0x467631['body'][_0x231e('0x2d')]===_0x231e('0x27'))return _0x46ea19;if(_0x467631[_0x231e('0x27')][_0x231e('0x2d')]!==_0x231e('0x27'))return _0x46ea19;var _0x392b5c=_[_0x231e('0x8b')](_0x46ea19,function(_0x3766a8){return _0x3766a8[_0x231e('0x2d')]===_0x231e('0x28')||_0x3766a8[_0x231e('0x2d')]===_0x231e('0x29');});if(!_0x392b5c)return _0x46ea19;return db['UserProfileSection'][_0x231e('0x43')]({'where':{'name':{'$or':[_0x231e('0x86'),_0x231e('0x87')]},'userProfileId':_0x467631[_0x231e('0x27')]['userProfileId']},'raw':!![]})[_0x231e('0x10')](function(_0x5be092){if(_['isEmpty'](_0x5be092)||!_['some'](_0x5be092,['autoAssociation',0x0]))return _0x46ea19;_0x2b685e=[];var _0x347963=_(_0x5be092)['map'](function(_0x24802){if(_0x24802['autoAssociation']===0x1)return;return _0x24802[_0x231e('0x2e')]===_0x231e('0x86')?_0x231e('0x28'):_0x231e('0x29');})[_0x231e('0x8e')]()[_0x231e('0x2c')]();for(var _0x41e495=0x0;_0x41e495<_0x46ea19['length'];_0x41e495++){if(!_['includes'](_0x347963,_0x46ea19[_0x41e495][_0x231e('0x2d')]))return;var _0x2aad38=_0x46ea19[_0x41e495][_0x231e('0x2d')]===_0x231e('0x28')?_0x231e('0x86'):_0x231e('0x87');_0x2b685e[_0x231e('0x42')](db['UserProfileResource'][_0x231e('0x7e')]({'name':_0x46ea19[_0x41e495][_0x231e('0x2e')],'resourceId':_0x46ea19[_0x41e495]['id'],'type':_0x2aad38,'sectionId':_[_0x231e('0x56')](_0x5be092,[_0x231e('0x2e'),_0x2aad38])['id']},{}));}return BPromise[_0x231e('0x5a')](_0x2b685e);});})[_0x231e('0x10')](respondWithResult(_0x342a8a,0xc9))[_0x231e('0x1a')](handleError(_0x342a8a,null));};exports[_0x231e('0x8f')]=function(_0xbc2f8c,_0x35961f){if(_0xbc2f8c[_0x231e('0x5c')]['id']){delete _0xbc2f8c['body']['id'];}return db['User']['find']({'where':{'id':_0xbc2f8c[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](function(_0x548212){if(!_0x548212)return null;if(_0x548212['id']===_0xbc2f8c[_0x231e('0x27')]['id']){if(!_0xbc2f8c['body'][_0x231e('0x90')]||!_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x91')]){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0x94'));}if(!_0x548212[_0x231e('0x95')](_0xbc2f8c['body']['oldPassword'])){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0x96'));}if(_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x90')]===_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x91')]){throw new db[(_0x231e('0x92'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xbc2f8c[_0x231e('0x27')][_0x231e('0x2d')]===_0x231e('0x25')){if(!_0xbc2f8c['body'][_0x231e('0x91')]){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0x97'));}}else if(_0xbc2f8c[_0x231e('0x27')][_0x231e('0x2d')]==='user'){if(!_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x91')]){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0x97'));}if(_0x548212[_0x231e('0x2d')]!=='agent'){throw new db[(_0x231e('0x92'))]['ValidationError'](_0x231e('0x7f'));}}else{throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0x7f'));}return _0x548212;})[_0x231e('0x10')](handleEntityNotFound(_0x35961f,null))[_0x231e('0x10')](function(_0x128aaf){return db[_0x231e('0x98')][_0x231e('0x99')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x231e('0x9a')]})[_0x231e('0x10')](function(_0x473419){if(_0x473419[_0x231e('0x63')])authService[_0x231e('0x64')](_0xbc2f8c[_0x231e('0x5c')]['newPassword']);if(!_0x473419[_0x231e('0x9b')]||!_0x128aaf[_0x231e('0x9c')])return _0x128aaf;authService[_0x231e('0x9d')](_0xbc2f8c[_0x231e('0x5c')]['newPassword'],_0x128aaf[_0x231e('0x9c')],_0x473419['passwordHistoryLimit']);return _0x128aaf;})[_0x231e('0x10')](saveUpdates({'password':_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x91')],'passwordResetAt':_0xbc2f8c['user']['id']==_0xbc2f8c[_0x231e('0x4b')]['id']?moment():null,'previousPasswords':authService[_0x231e('0x9e')](_0xbc2f8c[_0x231e('0x5c')][_0x231e('0x91')],_0x128aaf[_0x231e('0x9c')])},null));})[_0x231e('0x10')](respondWithResult(_0x35961f,null))['catch'](handleError(_0x35961f,null));};exports[_0x231e('0x9f')]=function(_0x548a0c,_0x186e26){var _0xec3ebf=_0x548a0c[_0x231e('0x5c')][_0x231e('0xa0')];return db['User']['find']({'where':{'id':_0x548a0c[_0x231e('0x4b')]['id']},'attributes':['id',_0x231e('0x2e'),'role',_0x231e('0xa1'),'loginInPause',_0x231e('0xa2'),_0x231e('0xa3')]})[_0x231e('0x10')](handleEntityNotFound(_0x186e26,null))[_0x231e('0x10')](function(_0x4ec9f6){if(_0x4ec9f6){if(!utils[_0x231e('0xa4')](_0xec3ebf)){throw new db['Sequelize'][(_0x231e('0x93'))](_0x231e('0xa5'));}return _0x4ec9f6[_0x231e('0xa6')+_['capitalize'](_0xec3ebf[_0x231e('0xa7')]())+_0x231e('0xa8')](_0x548a0c[_0x231e('0x5c')][_0x231e('0x5f')],{'penalty':_0x548a0c['body'][_0x231e('0xa9')]||0x0})[_0x231e('0xaa')](function(_0x228cbb){for(var _0x363ae9=0x0;_0x363ae9<_0x548a0c['body'][_0x231e('0x5f')][_0x231e('0x53')];_0x363ae9+=0x1){var _0x9c74b8={'UserId':Number(_0x548a0c[_0x231e('0x4b')]['id'])};_0x9c74b8[_[_0x231e('0xab')](_0xec3ebf['toLowerCase']())+_0x231e('0xac')]=Number(_0x548a0c[_0x231e('0x5c')][_0x231e('0x5f')][_0x363ae9]);socket[_0x231e('0xad')](_0x231e('0x27')+_[_0x231e('0xab')](_0xec3ebf[_0x231e('0xa7')]())+_0x231e('0xae'),_0x9c74b8);}return _0x228cbb;})['then'](function(){if(_0xec3ebf==='voice'){return db[_0x231e('0xaf')]['findAll']({'where':{'id':_0x548a0c['body'][_0x231e('0x5f')]||[]},'raw':!![],'attributes':['id',_0x231e('0x2e')]});}})[_0x231e('0x10')](function(_0x4f54c2){var _0x431ac3=_0x4ec9f6[_0x231e('0xb0')]({'plain':!![]});var _0x245265=[];if(_0xec3ebf===_0x231e('0xb1')&&_0x431ac3[_0x231e('0x2d')]===_0x231e('0x28')&&_0x431ac3[_0x231e('0xa1')]){for(var _0x237b4e=0x0;_0x237b4e<_0x4f54c2['length'];_0x237b4e+=0x1){_0x245265[_0x231e('0x42')]({'membername':_0x431ac3[_0x231e('0x2e')],'UserId':_0x431ac3['id'],'queue_name':_0x4f54c2[_0x237b4e]['name'],'VoiceQueueId':_0x4f54c2[_0x237b4e]['id'],'interface':_[_0x231e('0x67')](_0x431ac3['interface'])?util[_0x231e('0xb2')](_0x231e('0xb3'),_0x431ac3['name']):_0x431ac3[_0x231e('0xa3')],'paused':_0x431ac3['voicePause']||![],'penalty':_0x548a0c[_0x231e('0x5c')][_0x231e('0xa9')]||0x0});}return BPromise[_0x231e('0x8d')](_0x245265,function(_0x334a4d){return db['UserVoiceQueueRt'][_0x231e('0xb4')](_0x334a4d);});}return _0x4ec9f6;});}})[_0x231e('0x10')](respondWithStatusCode(_0x186e26,null))[_0x231e('0x1a')](handleError(_0x186e26,null));};exports[_0x231e('0xb5')]=function(_0x671e97,_0x512125){var _0x117748,_0x5f9220;return db[_0x231e('0x33')]['find']({'where':{'id':_0x671e97[_0x231e('0x4b')]['id']},'attributes':['id','name',_0x231e('0x2d')]})[_0x231e('0x10')](handleEntityNotFound(_0x512125,null))[_0x231e('0x10')](function(_0x42eebe){if(_0x42eebe){_0x117748=_0x42eebe;if(!_0x671e97[_0x231e('0x3c')][_0x231e('0xa0')]||!utils[_0x231e('0xa4')](_0x671e97[_0x231e('0x3c')][_0x231e('0xa0')])){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0xa5'));}return _0x42eebe[_0x231e('0xb6')+_[_0x231e('0xab')](_0x671e97[_0x231e('0x3c')][_0x231e('0xa0')][_0x231e('0xa7')]())+_0x231e('0xa8')](_0x671e97[_0x231e('0x3c')][_0x231e('0x5f')]);}})[_0x231e('0x10')](function(_0x18df67){if(_['isArray'](_0x671e97[_0x231e('0x3c')][_0x231e('0x5f')])){for(var _0x4652a5=0x0;_0x4652a5<_0x671e97['query']['ids'][_0x231e('0x53')];_0x4652a5+=0x1){_0x5f9220={'UserId':Number(_0x671e97[_0x231e('0x4b')]['id'])};_0x5f9220[_['capitalize'](_0x671e97[_0x231e('0x3c')][_0x231e('0xa0')]['toLowerCase']())+_0x231e('0xac')]=Number(_0x671e97[_0x231e('0x3c')]['ids'][_0x4652a5]);socket[_0x231e('0xad')](_0x231e('0x27')+_[_0x231e('0xab')](_0x671e97[_0x231e('0x3c')]['channel'][_0x231e('0xa7')]())+_0x231e('0xb7'),_0x5f9220);}}else{_0x5f9220={'UserId':Number(_0x671e97[_0x231e('0x4b')]['id'])};_0x5f9220[_[_0x231e('0xab')](_0x671e97[_0x231e('0x3c')]['channel']['toLowerCase']())+_0x231e('0xac')]=Number(_0x671e97['query'][_0x231e('0x5f')]);socket[_0x231e('0xad')](_0x231e('0x27')+_[_0x231e('0xab')](_0x671e97[_0x231e('0x3c')][_0x231e('0xa0')][_0x231e('0xa7')]())+'Queue:remove',_0x5f9220);}return _0x18df67;})[_0x231e('0x10')](function(){if(_0x671e97[_0x231e('0x3c')]['channel']===_0x231e('0xb1')){return db[_0x231e('0xb8')][_0x231e('0x24')]({'where':{'UserId':_0x671e97['params']['id'],'VoiceQueueId':_0x671e97[_0x231e('0x3c')][_0x231e('0x5f')]},'individualHooks':!![]})[_0x231e('0x10')](function(){return _0x117748;});}return _0x117748;})[_0x231e('0x10')](respondWithStatusCode(_0x512125,null))[_0x231e('0x1a')](handleError(_0x512125,null));};exports[_0x231e('0xb9')]=function(_0xa7afc3,_0x427d24){_0xa7afc3[_0x231e('0x5c')][_0x231e('0xba')]=_0xa7afc3['file'][_0x231e('0xbb')];return db[_0x231e('0x33')][_0x231e('0x56')]({'where':{'id':_0xa7afc3[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x427d24,null))[_0x231e('0x10')](saveUpdates(_0xa7afc3[_0x231e('0x5c')],null))[_0x231e('0x10')](respondWithResult(_0x427d24,null))[_0x231e('0x1a')](handleError(_0x427d24,null));};exports['getAvatar']=function(_0x34acaf,_0x527946){var _0x111425=path[_0x231e('0xbc')](config[_0x231e('0xbd')],_0x231e('0xbe'));return db[_0x231e('0x33')]['find']({'where':{'id':_0x34acaf[_0x231e('0x4b')]['id']},'attributes':['id',_0x231e('0xba')],'raw':!![]})[_0x231e('0x10')](handleEntityNotFound(_0x527946,null))[_0x231e('0x10')](function(_0x2b88eb){if(_0x2b88eb){if(_[_0x231e('0x67')](_0x2b88eb[_0x231e('0xba')])){return _0x527946['download'](_0x111425);}else{if(!fs['existsSync'](path[_0x231e('0xbc')](config[_0x231e('0xbd')],_0x231e('0xbf'),_0x2b88eb['userpic']))){return _0x527946[_0x231e('0xc0')](_0x111425);}return _0x527946['download'](path['join'](config[_0x231e('0xbd')],_0x231e('0xbf'),_0x2b88eb[_0x231e('0xba')]));}}})['catch'](handleError(_0x527946,null));};exports[_0x231e('0xc1')]=function(_0x1e8db9,_0x3984b4){return db[_0x231e('0x33')][_0x231e('0x56')]({'where':{'id':_0x1e8db9[_0x231e('0x4b')]['id']},'attributes':['id']})[_0x231e('0x10')](handleEntityNotFound(_0x3984b4,null))[_0x231e('0x10')](function(_0x4150cd){var _0x5f2964=[];values=_0x4150cd[_0x231e('0x45')];_0x5f2964[_0x231e('0x42')](get_open_tabs(_0x231e('0x58'),_0x4150cd['dataValues']));_0x5f2964[_0x231e('0x42')](get_open_tabs(_0x231e('0x46'),_0x4150cd['dataValues']));_0x5f2964[_0x231e('0x42')](get_open_tabs(_0x231e('0x59'),_0x4150cd[_0x231e('0x45')]));_0x5f2964[_0x231e('0x42')](get_open_tabs(_0x231e('0x49'),_0x4150cd['dataValues']));_0x5f2964[_0x231e('0x42')](get_open_tabs('fax',_0x4150cd[_0x231e('0x45')]));_0x5f2964[_0x231e('0x42')](get_open_tabs(_0x231e('0x48'),_0x4150cd['dataValues']));return BPromise[_0x231e('0x5a')](_0x5f2964);})[_0x231e('0x10')](function(_0xe45431){if(_0xe45431){var _0x4c8472=_[_0x231e('0x2b')](values[_0x231e('0xc2')],function(_0xe9a614){return{'channel':_0x231e('0xc3'),'id':_0xe9a614['id'],'createdAt':_0xe9a614['createdAt']};});var _0x393014=_['map'](values[_0x231e('0xc4')],function(_0x1b4d7c){return{'channel':_0x231e('0xc5'),'id':_0x1b4d7c['id'],'createdAt':_0x1b4d7c[_0x231e('0xc6')]};});var _0x1a9175=_[_0x231e('0x2b')](values['OpenchannelOpenTabs'],function(_0x3cc91c){return{'channel':_0x231e('0xc7'),'id':_0x3cc91c['id'],'createdAt':_0x3cc91c[_0x231e('0xc6')]};});var _0xa5f97f=_[_0x231e('0x2b')](values[_0x231e('0xc8')],function(_0x3fdba5){return{'channel':_0x231e('0xc9'),'id':_0x3fdba5['id'],'createdAt':_0x3fdba5[_0x231e('0xc6')]};});var _0xa04743=_[_0x231e('0x2b')](values['SmsOpenTabs'],function(_0xa4c70a){return{'channel':'SMS','id':_0xa4c70a['id'],'createdAt':_0xa4c70a[_0x231e('0xc6')]};});var _0x5b4d3b=_[_0x231e('0x2b')](values['WhatsappOpenTabs'],function(_0x1e3e3a){return{'channel':_0x231e('0xca'),'id':_0x1e3e3a['id'],'createdAt':_0x1e3e3a[_0x231e('0xc6')]};});var _0x16e34a=_[_0x231e('0xcb')](_0x4c8472,_0x393014,_0x1a9175,_0xa5f97f,_0xa04743,_0x5b4d3b);var _0x4093d3={'count':_0x16e34a['length'],'rows':_0x16e34a};return _0x4093d3;}else return null;})[_0x231e('0x10')](respondWithResult(_0x3984b4,null))[_0x231e('0x1a')](handleError(_0x3984b4,null));};exports[_0x231e('0xcc')]=function(_0x2c9641,_0xe6fd27){var _0x38597c={};var _0x39cf3c={};var _0x38dcf7;var _0x5004d6;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x2c9641[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0xe6fd27,null))['then'](function(_0x1f0321){if(_0x1f0321){_0x38dcf7=_0x1f0321;_0x39cf3c['model']=_[_0x231e('0x4e')](db[_0x231e('0xcd')][_0x231e('0x34')]);_0x39cf3c['query']=_[_0x231e('0x4e')](_0x2c9641[_0x231e('0x3c')]);_0x39cf3c['filters']=_[_0x231e('0x51')](_0x39cf3c[_0x231e('0x4c')],_0x39cf3c[_0x231e('0x3c')]);_0x38597c['attributes']=_['intersection'](_0x39cf3c[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x2c9641['query'][_0x231e('0x52')]));_0x38597c['attributes']=_0x38597c['attributes']['length']?_0x38597c[_0x231e('0x41')]:_0x39cf3c[_0x231e('0x4c')];_0x38597c[_0x231e('0xce')]=qs[_0x231e('0xcf')](_0x2c9641[_0x231e('0x3c')][_0x231e('0xcf')]);_0x38597c[_0x231e('0x3b')]=qs[_0x231e('0x50')](_['pick'](_0x2c9641[_0x231e('0x3c')],_0x39cf3c['filters']));if(_0x2c9641[_0x231e('0x3c')][_0x231e('0x38')]){_0x38597c[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x38597c['where'],{'$or':_[_0x231e('0x2b')](_0x38597c[_0x231e('0x41')],function(_0x4317d3){var _0x31b376={};_0x31b376[_0x4317d3]={'$like':'%'+_0x2c9641[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x31b376;})});}_0x38597c=_[_0x231e('0xd0')]({},_0x38597c,_0x2c9641['options']);return _0x38dcf7['getContacts'](_0x38597c);}})[_0x231e('0x10')](function(_0x2467c1){if(_0x2467c1){_0x5004d6=_0x2467c1[_0x231e('0x53')];if(_0x2c9641[_0x231e('0x3c')][_0x231e('0xd1')]('includeAll')){_0x38597c['include']=[{'model':db['CmList'],'as':_0x231e('0xd2'),'required':![]},{'model':db[_0x231e('0xd3')],'as':'Tags','attributes':['id',_0x231e('0x2e'),_0x231e('0xd4')],'where':_0x2c9641[_0x231e('0x3c')][_0x231e('0xd5')]?{'id':_0x2c9641['query'][_0x231e('0xd5')]}:undefined,'required':_0x2c9641[_0x231e('0x3c')][_0x231e('0xd5')]?!![]:![]}];}if(!_0x2c9641[_0x231e('0x3c')][_0x231e('0xd1')]('nolimit')){_0x38597c[_0x231e('0x21')]=qs[_0x231e('0x21')](_0x2c9641[_0x231e('0x3c')][_0x231e('0x21')]);_0x38597c[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x2c9641[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x38dcf7[_0x231e('0xcc')](_0x38597c);}})[_0x231e('0x10')](function(_0x274884){if(_0x274884){return _0x274884?{'count':_0x5004d6,'rows':_0x274884}:null;}})['then'](respondWithResult(_0xe6fd27,null))[_0x231e('0x1a')](handleError(_0xe6fd27,null));};exports['getQueues']=function(_0x1c8fd9,_0x574dab){var _0x4e7b63;var _0x27980d={};var _0x1ffa4f;return db[_0x231e('0x33')]['findOne']({'where':{'id':_0x1c8fd9[_0x231e('0x4b')]['id']},'attributes':['id',_0x231e('0x2e'),_0x231e('0x2d')]})[_0x231e('0x10')](handleEntityNotFound(_0x574dab,null))[_0x231e('0x10')](function(_0x1f66de){if(!utils[_0x231e('0xa4')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xa0')])){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0xa5'));}_0x4e7b63=_0x1f66de;var _0x79873c={};_0x79873c[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_[_0x231e('0xab')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xa0')])+'Queue'][_0x231e('0x34')]);_0x79873c[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x1c8fd9[_0x231e('0x3c')]);_0x79873c[_0x231e('0x50')]=_[_0x231e('0x51')](_0x79873c['model'],_0x79873c[_0x231e('0x3c')]);_0x27980d[_0x231e('0x41')]=_['intersection'](_0x79873c[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x1c8fd9['query']['fields']));_0x27980d[_0x231e('0x41')]=_0x27980d[_0x231e('0x41')][_0x231e('0x53')]?_0x27980d[_0x231e('0x41')]:_0x79873c[_0x231e('0x4c')];_0x27980d['order']=qs[_0x231e('0xcf')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xcf')]);_0x27980d[_0x231e('0x3b')]=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x1c8fd9[_0x231e('0x3c')],_0x79873c[_0x231e('0x50')]));if(_0x1c8fd9[_0x231e('0x3c')][_0x231e('0x38')]){_0x27980d['where']=_['merge'](_0x27980d['where'],{'$or':_[_0x231e('0x2b')](_0x27980d[_0x231e('0x41')],function(_0x45117e){var _0x4fd931={};_0x4fd931[_0x45117e]={'$like':'%'+_0x1c8fd9[_0x231e('0x3c')]['filter']+'%'};return _0x4fd931;})});}_0x27980d=_[_0x231e('0xd0')]({},_0x27980d,_0x1c8fd9[_0x231e('0x55')]);switch(_0x4e7b63[_0x231e('0x2d')]){case'admin':return db[_[_0x231e('0xab')](_0x1c8fd9[_0x231e('0x3c')]['channel'])+'Queue'][_0x231e('0x43')](_0x27980d);case _0x231e('0x27'):case _0x231e('0x28'):return _0x4e7b63[_0x231e('0xb0')+_['capitalize'](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xa0')])+_0x231e('0xa8')](_0x27980d);default:throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))]('Unknown\x20role');}})[_0x231e('0x10')](function(_0x2de23c){_0x1ffa4f=_0x2de23c['length'];if(!_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xd1')]('nolimit')){_0x27980d['limit']=qs['limit'](_0x1c8fd9[_0x231e('0x3c')]['limit']);_0x27980d[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0x1f')]);}switch(_0x4e7b63[_0x231e('0x2d')]){case _0x231e('0x25'):return db[_[_0x231e('0xab')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xa0')])+_0x231e('0xd7')][_0x231e('0x43')](_0x27980d);case _0x231e('0x27'):case _0x231e('0x28'):return _0x4e7b63['get'+_[_0x231e('0xab')](_0x1c8fd9[_0x231e('0x3c')][_0x231e('0xa0')])+'Queues'](_0x27980d);}})['then'](function(_0x2497df){return{'count':_0x1ffa4f,'rows':_0x2497df};})[_0x231e('0x10')](respondWithResult(_0x574dab,null))[_0x231e('0x1a')](handleError(_0x574dab,null));};exports[_0x231e('0xd8')]=function(_0x147350,_0x293a21){var _0x895a8e={};var _0x2b4b85={};var _0x3bfafb;var _0x1cd89c;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x147350['params']['id']}})['then'](handleEntityNotFound(_0x293a21,null))['then'](function(_0x16d9e0){if(_0x16d9e0){_0x3bfafb=_0x16d9e0;_0x2b4b85[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0xb8')][_0x231e('0x34')]);_0x2b4b85['query']=_[_0x231e('0x4e')](_0x147350[_0x231e('0x3c')]);_0x2b4b85[_0x231e('0x50')]=_[_0x231e('0x51')](_0x2b4b85[_0x231e('0x4c')],_0x2b4b85[_0x231e('0x3c')]);_0x895a8e['attributes']=_[_0x231e('0x51')](_0x2b4b85[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x147350['query'][_0x231e('0x52')]));_0x895a8e[_0x231e('0x41')]=_0x895a8e[_0x231e('0x41')]['length']?_0x895a8e[_0x231e('0x41')]:_0x2b4b85[_0x231e('0x4c')];_0x895a8e[_0x231e('0xce')]=qs[_0x231e('0xcf')](_0x147350['query'][_0x231e('0xcf')]);_0x895a8e['where']=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x147350[_0x231e('0x3c')],_0x2b4b85[_0x231e('0x50')]));if(_0x147350['query']['filter']){_0x895a8e[_0x231e('0x3b')]=_['merge'](_0x895a8e['where'],{'$or':_[_0x231e('0x2b')](_0x895a8e['attributes'],function(_0x7ddc61){var _0x71e39e={};_0x71e39e[_0x7ddc61]={'$like':'%'+_0x147350[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x71e39e;})});}_0x895a8e=_[_0x231e('0xd0')]({},_0x895a8e,_0x147350[_0x231e('0x55')]);return _0x3bfafb[_0x231e('0xd8')](_0x895a8e);}})[_0x231e('0x10')](function(_0x29a837){if(_0x29a837){_0x1cd89c=_0x29a837['length'];if(!_0x147350['query'][_0x231e('0xd1')](_0x231e('0xd9'))){_0x895a8e[_0x231e('0x21')]=qs['limit'](_0x147350['query'][_0x231e('0x21')]);_0x895a8e[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x147350[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x3bfafb['getVoiceQueuesRt'](_0x895a8e);}})[_0x231e('0x10')](function(_0x1410ff){if(_0x1410ff){return _0x1410ff?{'count':_0x1cd89c,'rows':_0x1410ff}:null;}})[_0x231e('0x10')](respondWithResult(_0x293a21,null))[_0x231e('0x1a')](handleError(_0x293a21,null));};exports[_0x231e('0xda')]=function(_0x28c4fa,_0xcdca8d){var _0x4b20b2={};var _0xb338b3={};var _0x59552a;var _0x480f61;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x28c4fa['params']['id']}})[_0x231e('0x10')](handleEntityNotFound(_0xcdca8d,null))[_0x231e('0x10')](function(_0x22f999){if(_0x22f999){_0x59552a=_0x22f999;_0xb338b3[_0x231e('0x4c')]=_['keys'](db[_0x231e('0xdb')][_0x231e('0x34')]);_0xb338b3[_0x231e('0x3c')]=_['keys'](_0x28c4fa[_0x231e('0x3c')]);_0xb338b3[_0x231e('0x50')]=_['intersection'](_0xb338b3['model'],_0xb338b3[_0x231e('0x3c')]);_0x4b20b2[_0x231e('0x41')]=_['intersection'](_0xb338b3[_0x231e('0x4c')],qs['fields'](_0x28c4fa[_0x231e('0x3c')][_0x231e('0x52')]));_0x4b20b2[_0x231e('0x41')]=_0x4b20b2[_0x231e('0x41')]['length']?_0x4b20b2[_0x231e('0x41')]:_0xb338b3['model'];_0x4b20b2[_0x231e('0xce')]=qs['sort'](_0x28c4fa[_0x231e('0x3c')][_0x231e('0xcf')]);_0x4b20b2['where']=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x28c4fa[_0x231e('0x3c')],_0xb338b3[_0x231e('0x50')]));if(_0x28c4fa['query'][_0x231e('0x38')]){_0x4b20b2[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x4b20b2[_0x231e('0x3b')],{'$or':_['map'](_0x4b20b2['attributes'],function(_0x3cf5a5){var _0x993a43={};_0x993a43[_0x3cf5a5]={'$like':'%'+_0x28c4fa['query'][_0x231e('0x38')]+'%'};return _0x993a43;})});}_0x4b20b2=_[_0x231e('0xd0')]({},_0x4b20b2,_0x28c4fa[_0x231e('0x55')]);return _0x59552a['getGroups'](_0x4b20b2);}})[_0x231e('0x10')](function(_0x48bcde){if(_0x48bcde){_0x480f61=_0x48bcde[_0x231e('0x53')];if(!_0x28c4fa[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x4b20b2['limit']=qs[_0x231e('0x21')](_0x28c4fa[_0x231e('0x3c')][_0x231e('0x21')]);_0x4b20b2[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x28c4fa['query'][_0x231e('0x1f')]);}return _0x59552a[_0x231e('0xda')](_0x4b20b2);}})[_0x231e('0x10')](function(_0x5136b7){if(_0x5136b7){return _0x5136b7?{'count':_0x480f61,'rows':_0x5136b7}:null;}})[_0x231e('0x10')](respondWithResult(_0xcdca8d,null))[_0x231e('0x1a')](handleError(_0xcdca8d,null));};exports[_0x231e('0xdc')]=function(_0x41d5ca,_0x464e2e){var _0x4e55f8={'raw':!![],'where':{}};var _0x55eae2={};var _0x221914={'count':0x0,'rows':[]};return db['User'][_0x231e('0x99')]({'where':{'id':_0x41d5ca[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x464e2e,null))[_0x231e('0x10')](function(_0x53ae15){if(_0x53ae15){_0x55eae2[_0x231e('0x4c')]=_['keys'](db[_0x231e('0xdd')][_0x231e('0x34')]);_0x55eae2[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x41d5ca['query']);_0x55eae2['filters']=_[_0x231e('0x51')](_0x55eae2[_0x231e('0x4c')],_0x55eae2[_0x231e('0x3c')]);_0x4e55f8['attributes']=_[_0x231e('0x51')](_0x55eae2[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x41d5ca['query'][_0x231e('0x52')]));_0x4e55f8[_0x231e('0x41')]=_0x4e55f8['attributes']['length']?_0x4e55f8[_0x231e('0x41')]:_0x55eae2['model'];if(!_0x41d5ca[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x4e55f8['limit']=qs[_0x231e('0x21')](_0x41d5ca['query'][_0x231e('0x21')]);_0x4e55f8[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x41d5ca[_0x231e('0x3c')][_0x231e('0x1f')]);}_0x4e55f8['order']=qs[_0x231e('0xcf')](_0x41d5ca[_0x231e('0x3c')][_0x231e('0xcf')]);_0x4e55f8[_0x231e('0x3b')]=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x41d5ca[_0x231e('0x3c')],_0x55eae2[_0x231e('0x50')]));_0x4e55f8[_0x231e('0x3b')][_0x231e('0xde')]=_0x53ae15['id'];if(_0x41d5ca['query']['filter']){_0x4e55f8[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x4e55f8[_0x231e('0x3b')],{'$or':_['map'](_0x4e55f8['attributes'],function(_0x3837a2){var _0x503a1b={};_0x503a1b[_0x3837a2]={'$like':'%'+_0x41d5ca['query']['filter']+'%'};return _0x503a1b;})});}_0x4e55f8=_[_0x231e('0xd0')]({},_0x4e55f8,_0x41d5ca[_0x231e('0x55')]);return db[_0x231e('0xdd')][_0x231e('0x22')]({'where':_0x4e55f8[_0x231e('0x3b')]})[_0x231e('0x10')](function(_0x2803f4){_0x221914['count']=_0x2803f4;if(_0x41d5ca[_0x231e('0x3c')][_0x231e('0x3d')]){_0x4e55f8[_0x231e('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0x231e('0x43')](_0x4e55f8);})[_0x231e('0x10')](function(_0x11a801){_0x221914['rows']=_0x11a801;return _0x221914;});}})[_0x231e('0x10')](respondWithFilteredResult(_0x464e2e,_0x4e55f8))[_0x231e('0x1a')](handleError(_0x464e2e,null));};exports[_0x231e('0xdf')]=function(_0x23caf9,_0x4e96c2){var _0x53a07d={'raw':!![],'where':{}};var _0x288cf5={};var _0x3ad022={'count':0x0,'rows':[]};return db['User'][_0x231e('0x99')]({'where':{'id':_0x23caf9[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x4e96c2,null))[_0x231e('0x10')](function(_0x495294){if(_0x495294){_0x288cf5['model']=_[_0x231e('0x4e')](db[_0x231e('0xe0')][_0x231e('0x34')]);_0x288cf5[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x23caf9[_0x231e('0x3c')]);_0x288cf5[_0x231e('0x50')]=_['intersection'](_0x288cf5[_0x231e('0x4c')],_0x288cf5[_0x231e('0x3c')]);_0x53a07d[_0x231e('0x41')]=_[_0x231e('0x51')](_0x288cf5[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x23caf9['query'][_0x231e('0x52')]));_0x53a07d[_0x231e('0x41')]=_0x53a07d[_0x231e('0x41')][_0x231e('0x53')]?_0x53a07d[_0x231e('0x41')]:_0x288cf5['model'];if(!_0x23caf9[_0x231e('0x3c')][_0x231e('0xd1')]('nolimit')){_0x53a07d['limit']=qs[_0x231e('0x21')](_0x23caf9[_0x231e('0x3c')][_0x231e('0x21')]);_0x53a07d[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x23caf9[_0x231e('0x3c')][_0x231e('0x1f')]);}_0x53a07d[_0x231e('0xce')]=qs[_0x231e('0xcf')](_0x23caf9[_0x231e('0x3c')][_0x231e('0xcf')]);_0x53a07d['where']=qs[_0x231e('0x50')](_['pick'](_0x23caf9[_0x231e('0x3c')],_0x288cf5[_0x231e('0x50')]));_0x53a07d['where'][_0x231e('0xde')]=_0x495294['id'];if(_0x23caf9[_0x231e('0x3c')][_0x231e('0x38')]){_0x53a07d[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x53a07d[_0x231e('0x3b')],{'$or':_['map'](_0x53a07d[_0x231e('0x41')],function(_0x2549c5){var _0x551da1={};_0x551da1[_0x2549c5]={'$like':'%'+_0x23caf9['query'][_0x231e('0x38')]+'%'};return _0x551da1;})});}_0x53a07d=_['merge']({},_0x53a07d,_0x23caf9['options']);return db[_0x231e('0xe0')][_0x231e('0x22')]({'where':_0x53a07d[_0x231e('0x3b')]})['then'](function(_0x5229c5){_0x3ad022[_0x231e('0x22')]=_0x5229c5;if(_0x23caf9[_0x231e('0x3c')][_0x231e('0x3d')]){_0x53a07d[_0x231e('0x3e')]=[{'all':!![]}];}return db['ScreenRecording'][_0x231e('0x43')](_0x53a07d);})['then'](function(_0x596499){_0x3ad022['rows']=_0x596499;return _0x3ad022;});}})[_0x231e('0x10')](respondWithFilteredResult(_0x4e96c2,_0x53a07d))[_0x231e('0x1a')](handleError(_0x4e96c2,null));};exports[_0x231e('0xe1')]=function(_0x5e178d,_0x45f573){var _0x13913a={};var _0x49fb0d={};var _0x31ea11;var _0x28569c;return db['User'][_0x231e('0x99')]({'where':{'id':_0x5e178d[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x45f573,null))['then'](function(_0x5d0617){if(_0x5d0617){_0x31ea11=_0x5d0617;_0x49fb0d[_0x231e('0x4c')]=_['keys'](db[_0x231e('0xe2')][_0x231e('0x34')]);_0x49fb0d[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x5e178d[_0x231e('0x3c')]);_0x49fb0d[_0x231e('0x50')]=_['intersection'](_0x49fb0d[_0x231e('0x4c')],_0x49fb0d[_0x231e('0x3c')]);_0x13913a['attributes']=_[_0x231e('0x51')](_0x49fb0d['model'],qs['fields'](_0x5e178d[_0x231e('0x3c')][_0x231e('0x52')]));_0x13913a[_0x231e('0x41')]=_0x13913a[_0x231e('0x41')][_0x231e('0x53')]?_0x13913a[_0x231e('0x41')]:_0x49fb0d['model'];_0x13913a['order']=qs[_0x231e('0xcf')](_0x5e178d[_0x231e('0x3c')][_0x231e('0xcf')]);_0x13913a[_0x231e('0x3b')]=qs['filters'](_['pick'](_0x5e178d[_0x231e('0x3c')],_0x49fb0d['filters']));if(_0x5e178d['query'][_0x231e('0x38')]){_0x13913a[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x13913a[_0x231e('0x3b')],{'$or':_['map'](_0x13913a[_0x231e('0x41')],function(_0x4c4dcf){var _0x12aa05={};_0x12aa05[_0x4c4dcf]={'$like':'%'+_0x5e178d[_0x231e('0x3c')]['filter']+'%'};return _0x12aa05;})});}_0x13913a=_['merge']({},_0x13913a,_0x5e178d[_0x231e('0x55')]);return _0x31ea11[_0x231e('0xe1')](_0x13913a);}})['then'](function(_0x40d8a6){if(_0x40d8a6){_0x28569c=_0x40d8a6[_0x231e('0x53')];if(!_0x5e178d[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x13913a[_0x231e('0x21')]=qs[_0x231e('0x21')](_0x5e178d[_0x231e('0x3c')]['limit']);_0x13913a['offset']=qs[_0x231e('0x1f')](_0x5e178d[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x31ea11[_0x231e('0xe1')](_0x13913a);}})[_0x231e('0x10')](function(_0x3663f6){if(_0x3663f6){return _0x3663f6?{'count':_0x28569c,'rows':_0x3663f6}:null;}})[_0x231e('0x10')](respondWithResult(_0x45f573,null))[_0x231e('0x1a')](handleError(_0x45f573,null));};exports['getOpenchannelInteractions']=function(_0xc5aa43,_0x3a5e7a){var _0x219d1e={};var _0x89c04={};var _0x2a63ac;var _0x365593;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0xc5aa43['params']['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x3a5e7a,null))[_0x231e('0x10')](function(_0x11f8b2){if(_0x11f8b2){_0x2a63ac=_0x11f8b2;_0x89c04[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0xe3')]['rawAttributes']);_0x89c04[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0xc5aa43[_0x231e('0x3c')]);_0x89c04[_0x231e('0x50')]=_[_0x231e('0x51')](_0x89c04[_0x231e('0x4c')],_0x89c04[_0x231e('0x3c')]);_0x219d1e[_0x231e('0x41')]=_[_0x231e('0x51')](_0x89c04[_0x231e('0x4c')],qs[_0x231e('0x52')](_0xc5aa43['query']['fields']));_0x219d1e[_0x231e('0x41')]=_0x219d1e[_0x231e('0x41')][_0x231e('0x53')]?_0x219d1e[_0x231e('0x41')]:_0x89c04[_0x231e('0x4c')];_0x219d1e['order']=qs[_0x231e('0xcf')](_0xc5aa43[_0x231e('0x3c')][_0x231e('0xcf')]);_0x219d1e[_0x231e('0x3b')]=qs['filters'](_['pick'](_0xc5aa43[_0x231e('0x3c')],_0x89c04[_0x231e('0x50')]));if(_0xc5aa43[_0x231e('0x3c')][_0x231e('0x38')]){_0x219d1e[_0x231e('0x3b')]=_['merge'](_0x219d1e[_0x231e('0x3b')],{'$or':_[_0x231e('0x2b')](_0x219d1e[_0x231e('0x41')],function(_0x418037){var _0x299a72={};_0x299a72[_0x418037]={'$like':'%'+_0xc5aa43[_0x231e('0x3c')]['filter']+'%'};return _0x299a72;})});}_0x219d1e=_[_0x231e('0xd0')]({},_0x219d1e,_0xc5aa43[_0x231e('0x55')]);return _0x2a63ac['getOpenchannelInteractions'](_0x219d1e);}})[_0x231e('0x10')](function(_0xb13a8b){if(_0xb13a8b){_0x365593=_0xb13a8b[_0x231e('0x53')];if(!_0xc5aa43[_0x231e('0x3c')][_0x231e('0xd1')]('nolimit')){_0x219d1e[_0x231e('0x21')]=qs[_0x231e('0x21')](_0xc5aa43[_0x231e('0x3c')]['limit']);_0x219d1e[_0x231e('0x1f')]=qs['offset'](_0xc5aa43[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x2a63ac['getOpenchannelInteractions'](_0x219d1e);}})[_0x231e('0x10')](function(_0x55b679){if(_0x55b679){return _0x55b679?{'count':_0x365593,'rows':_0x55b679}:null;}})[_0x231e('0x10')](respondWithResult(_0x3a5e7a,null))[_0x231e('0x1a')](handleError(_0x3a5e7a,null));};exports['getMailInteractions']=function(_0x3625a7,_0x4fd150){var _0x37c7f6={'raw':!![],'where':{}};var _0x3119ad={};var _0x36fd62={'count':0x0,'rows':[]};return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x3625a7[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fd150,null))[_0x231e('0x10')](function(_0x3363d7){if(_0x3363d7){_0x3119ad['model']=_[_0x231e('0x4e')](db[_0x231e('0xe4')]['rawAttributes']);_0x3119ad[_0x231e('0x3c')]=_['keys'](_0x3625a7[_0x231e('0x3c')]);_0x3119ad['filters']=_[_0x231e('0x51')](_0x3119ad['model'],_0x3119ad['query']);_0x37c7f6[_0x231e('0x41')]=_[_0x231e('0x51')](_0x3119ad[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x3625a7[_0x231e('0x3c')]['fields']));_0x37c7f6[_0x231e('0x41')]=_0x37c7f6[_0x231e('0x41')][_0x231e('0x53')]?_0x37c7f6['attributes']:_0x3119ad[_0x231e('0x4c')];if(!_0x3625a7[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x37c7f6['limit']=qs[_0x231e('0x21')](_0x3625a7['query'][_0x231e('0x21')]);_0x37c7f6['offset']=qs[_0x231e('0x1f')](_0x3625a7[_0x231e('0x3c')][_0x231e('0x1f')]);}_0x37c7f6[_0x231e('0xce')]=qs[_0x231e('0xcf')](_0x3625a7[_0x231e('0x3c')][_0x231e('0xcf')]);_0x37c7f6[_0x231e('0x3b')]=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x3625a7['query'],_0x3119ad['filters']));_0x37c7f6[_0x231e('0x3b')]['UserId']=_0x3363d7['id'];if(_0x3625a7[_0x231e('0x3c')]['filter']){_0x37c7f6[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x37c7f6[_0x231e('0x3b')],{'$or':_['map'](_0x37c7f6['attributes'],function(_0x4f8f8d){var _0x1900af={};_0x1900af[_0x4f8f8d]={'$like':'%'+_0x3625a7[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x1900af;})});}_0x37c7f6=_['merge']({},_0x37c7f6,_0x3625a7[_0x231e('0x55')]);return db[_0x231e('0xe4')]['count']({'where':_0x37c7f6[_0x231e('0x3b')]})['then'](function(_0x4b3a34){_0x36fd62['count']=_0x4b3a34;if(_0x3625a7['query'][_0x231e('0x3d')]){_0x37c7f6[_0x231e('0x3e')]=[{'all':!![]}];}return db[_0x231e('0xe4')][_0x231e('0x43')](_0x37c7f6);})[_0x231e('0x10')](function(_0x49078b){_0x36fd62['rows']=_0x49078b;return _0x36fd62;});}})['then'](respondWithFilteredResult(_0x4fd150,_0x37c7f6))[_0x231e('0x1a')](handleError(_0x4fd150,null));};exports['getSmsInteractions']=function(_0xca040b,_0x3d6b93){var _0x33ce95={};var _0x4d4a6d={};var _0x27fcd7;var _0x372bce;return db[_0x231e('0x33')]['findOne']({'where':{'id':_0xca040b['params']['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x3d6b93,null))[_0x231e('0x10')](function(_0x3637d5){if(_0x3637d5){_0x27fcd7=_0x3637d5;_0x4d4a6d[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0xe5')][_0x231e('0x34')]);_0x4d4a6d[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0xca040b[_0x231e('0x3c')]);_0x4d4a6d[_0x231e('0x50')]=_[_0x231e('0x51')](_0x4d4a6d[_0x231e('0x4c')],_0x4d4a6d[_0x231e('0x3c')]);_0x33ce95[_0x231e('0x41')]=_[_0x231e('0x51')](_0x4d4a6d[_0x231e('0x4c')],qs['fields'](_0xca040b[_0x231e('0x3c')][_0x231e('0x52')]));_0x33ce95[_0x231e('0x41')]=_0x33ce95['attributes']['length']?_0x33ce95[_0x231e('0x41')]:_0x4d4a6d[_0x231e('0x4c')];_0x33ce95['order']=qs[_0x231e('0xcf')](_0xca040b[_0x231e('0x3c')][_0x231e('0xcf')]);_0x33ce95[_0x231e('0x3b')]=qs[_0x231e('0x50')](_['pick'](_0xca040b['query'],_0x4d4a6d[_0x231e('0x50')]));if(_0xca040b['query']['filter']){_0x33ce95['where']=_[_0x231e('0xd0')](_0x33ce95[_0x231e('0x3b')],{'$or':_['map'](_0x33ce95[_0x231e('0x41')],function(_0x1f4290){var _0x2402ab={};_0x2402ab[_0x1f4290]={'$like':'%'+_0xca040b['query'][_0x231e('0x38')]+'%'};return _0x2402ab;})});}_0x33ce95=_[_0x231e('0xd0')]({},_0x33ce95,_0xca040b['options']);return _0x27fcd7[_0x231e('0xe6')](_0x33ce95);}})[_0x231e('0x10')](function(_0x267ea9){if(_0x267ea9){_0x372bce=_0x267ea9[_0x231e('0x53')];if(!_0xca040b[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x33ce95[_0x231e('0x21')]=qs['limit'](_0xca040b[_0x231e('0x3c')]['limit']);_0x33ce95[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0xca040b[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x27fcd7['getSmsInteractions'](_0x33ce95);}})['then'](function(_0xa81d1b){if(_0xa81d1b){return _0xa81d1b?{'count':_0x372bce,'rows':_0xa81d1b}:null;}})[_0x231e('0x10')](respondWithResult(_0x3d6b93,null))['catch'](handleError(_0x3d6b93,null));};exports[_0x231e('0xe7')]=function(_0x1c2366,_0x470a71){var _0x439761={};var _0x45907a={};var _0x1de6a0;var _0x29d17b;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x1c2366[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x470a71,null))[_0x231e('0x10')](function(_0x154f33){if(_0x154f33){_0x1de6a0=_0x154f33;_0x45907a[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0xe8')]['rawAttributes']);_0x45907a['query']=_[_0x231e('0x4e')](_0x1c2366[_0x231e('0x3c')]);_0x45907a['filters']=_['intersection'](_0x45907a[_0x231e('0x4c')],_0x45907a[_0x231e('0x3c')]);_0x439761[_0x231e('0x41')]=_[_0x231e('0x51')](_0x45907a['model'],qs[_0x231e('0x52')](_0x1c2366[_0x231e('0x3c')][_0x231e('0x52')]));_0x439761[_0x231e('0x41')]=_0x439761['attributes'][_0x231e('0x53')]?_0x439761[_0x231e('0x41')]:_0x45907a[_0x231e('0x4c')];_0x439761['order']=qs['sort'](_0x1c2366[_0x231e('0x3c')][_0x231e('0xcf')]);_0x439761[_0x231e('0x3b')]=qs['filters'](_['pick'](_0x1c2366['query'],_0x45907a[_0x231e('0x50')]));if(_0x1c2366[_0x231e('0x3c')][_0x231e('0x38')]){_0x439761[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x439761[_0x231e('0x3b')],{'$or':_['map'](_0x439761[_0x231e('0x41')],function(_0x14b41f){var _0x2c9f8a={};_0x2c9f8a[_0x14b41f]={'$like':'%'+_0x1c2366[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x2c9f8a;})});}_0x439761=_[_0x231e('0xd0')]({},_0x439761,_0x1c2366[_0x231e('0x55')]);return _0x1de6a0['getFaxInteractions'](_0x439761);}})[_0x231e('0x10')](function(_0x4598c8){if(_0x4598c8){_0x29d17b=_0x4598c8[_0x231e('0x53')];if(!_0x1c2366[_0x231e('0x3c')][_0x231e('0xd1')](_0x231e('0xd9'))){_0x439761['limit']=qs['limit'](_0x1c2366[_0x231e('0x3c')][_0x231e('0x21')]);_0x439761[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x1c2366[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x1de6a0[_0x231e('0xe7')](_0x439761);}})[_0x231e('0x10')](function(_0x53c9e5){if(_0x53c9e5){return _0x53c9e5?{'count':_0x29d17b,'rows':_0x53c9e5}:null;}})['then'](respondWithResult(_0x470a71,null))[_0x231e('0x1a')](handleError(_0x470a71,null));};exports[_0x231e('0xe9')]=function(_0x4e2ea2,_0xbd5f5c){var _0xc79145={};var _0x352f5f={};var _0x50ad60;var _0x3b6766;return db['User'][_0x231e('0x99')]({'where':{'id':_0x4e2ea2['params']['id']}})['then'](handleEntityNotFound(_0xbd5f5c,null))[_0x231e('0x10')](function(_0x305dfc){if(_0x305dfc){_0x50ad60=_0x305dfc;_0x352f5f[_0x231e('0x4c')]=_['keys'](db['WhatsappInteraction'][_0x231e('0x34')]);_0x352f5f[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0x4e2ea2[_0x231e('0x3c')]);_0x352f5f[_0x231e('0x50')]=_['intersection'](_0x352f5f[_0x231e('0x4c')],_0x352f5f[_0x231e('0x3c')]);_0xc79145['attributes']=_[_0x231e('0x51')](_0x352f5f[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x4e2ea2[_0x231e('0x3c')][_0x231e('0x52')]));_0xc79145[_0x231e('0x41')]=_0xc79145[_0x231e('0x41')][_0x231e('0x53')]?_0xc79145['attributes']:_0x352f5f[_0x231e('0x4c')];_0xc79145[_0x231e('0xce')]=qs['sort'](_0x4e2ea2['query']['sort']);_0xc79145['where']=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x4e2ea2[_0x231e('0x3c')],_0x352f5f[_0x231e('0x50')]));if(_0x4e2ea2[_0x231e('0x3c')][_0x231e('0x38')]){_0xc79145['where']=_[_0x231e('0xd0')](_0xc79145['where'],{'$or':_[_0x231e('0x2b')](_0xc79145[_0x231e('0x41')],function(_0x4f6373){var _0x1ba5e7={};_0x1ba5e7[_0x4f6373]={'$like':'%'+_0x4e2ea2[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x1ba5e7;})});}_0xc79145=_[_0x231e('0xd0')]({},_0xc79145,_0x4e2ea2[_0x231e('0x55')]);return _0x50ad60[_0x231e('0xe9')](_0xc79145);}})[_0x231e('0x10')](function(_0x5b99a6){if(_0x5b99a6){_0x3b6766=_0x5b99a6['length'];if(!_0x4e2ea2['query'][_0x231e('0xd1')](_0x231e('0xd9'))){_0xc79145[_0x231e('0x21')]=qs[_0x231e('0x21')](_0x4e2ea2[_0x231e('0x3c')][_0x231e('0x21')]);_0xc79145[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0x4e2ea2[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x50ad60[_0x231e('0xe9')](_0xc79145);}})[_0x231e('0x10')](function(_0x5e1573){if(_0x5e1573){return _0x5e1573?{'count':_0x3b6766,'rows':_0x5e1573}:null;}})[_0x231e('0x10')](respondWithResult(_0xbd5f5c,null))[_0x231e('0x1a')](handleError(_0xbd5f5c,null));};exports[_0x231e('0xea')]=function(_0x42b9ea,_0x3311f1,_0x3be262){var _0x29dd60;var _0x55c015;var _0x32504a;var _0x5f93f1=!_[_0x231e('0x67')](_0x42b9ea[_0x231e('0x4b')]['id'])?_0x42b9ea[_0x231e('0x4b')]['id']:!_[_0x231e('0x67')](_0x42b9ea['user']['id'])?_0x42b9ea[_0x231e('0x27')]['id']:null;return db['User']['find']({'where':{'id':_0x5f93f1,'role':{'$or':[_0x231e('0x25'),_0x231e('0x27'),_0x231e('0x28')]}},'attributes':['id','name','phone','mobile',_0x231e('0x2d'),_0x231e('0x61'),_0x231e('0xeb')]})['then'](function(_0x3c2960){if(_0x3c2960){if(_0x3c2960['role']==='agent'){_0x29dd60=_0x3c2960;if(_0x42b9ea[_0x231e('0x5c')][_0x231e('0xa3')]){_0x32504a=util[_0x231e('0xb2')](_0x231e('0xec'),_0x29dd60[_0x42b9ea[_0x231e('0x5c')][_0x231e('0xa3')]]);}else if(_0x42b9ea[_0x231e('0x5c')][_0x231e('0xed')]){_0x32504a=util[_0x231e('0xb2')](_0x231e('0xb3'),_0x42b9ea[_0x231e('0x5c')][_0x231e('0xed')]);}else{_0x32504a=util['format']('SIP/%s',_0x29dd60['name']);}socket['to'](util[_0x231e('0xb2')](_0x231e('0xee'),_0x29dd60[_0x231e('0x2e')]))['emit'](_0x231e('0xef'),{'user':{'id':_0x29dd60['id'],'name':_0x29dd60[_0x231e('0x2e')]},'ip':_0x42b9ea[_0x231e('0xf0')]['x-forwarded-for']||_0x42b9ea[_0x231e('0xf1')][_0x231e('0xf2')]||_0x42b9ea['socket'][_0x231e('0xf2')]||_0x42b9ea[_0x231e('0xf1')][_0x231e('0xf3')]['remoteAddress']});return db[_0x231e('0xb8')][_0x231e('0x24')]({'where':{'membername':_0x29dd60[_0x231e('0x2e')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x231e('0x93'))](_0x231e('0xf4'));}})[_0x231e('0x10')](function(){if(_0x29dd60){return _0x29dd60[_0x231e('0xf5')]({'raw':!![]});}})[_0x231e('0x10')](function(_0x340319){if(_0x29dd60){var _0x2e512a=[];if(_0x340319){_0x55c015=_0x340319;if(_0x55c015[_0x231e('0x53')]){for(var _0x47e750=0x0;_0x47e750<_0x55c015[_0x231e('0x53')];_0x47e750++){_0x2e512a[_0x231e('0x42')]({'membername':_0x29dd60[_0x231e('0x2e')],'UserId':_0x29dd60['id'],'queue_name':_0x55c015[_0x47e750]['name'],'VoiceQueueId':_0x55c015[_0x47e750]['id'],'interface':_0x32504a,'paused':_0x29dd60[_0x231e('0xeb')]||![],'penalty':_0x55c015[_0x47e750][_0x231e('0xf6')]||0x0});}return BPromise[_0x231e('0x8d')](_0x2e512a,function(_0xaee0f2){return db[_0x231e('0xb8')][_0x231e('0xb4')](_0xaee0f2);});}}}})[_0x231e('0x10')](function(){if(_0x29dd60){return db[_0x231e('0xf7')][_0x231e('0x43')]({'where':{'membername':_0x29dd60[_0x231e('0x2e')],'exitAt':null}});}})['then'](function(_0x18fb3e){if(_0x29dd60){var _0x463f9e=[];_0x18fb3e[_0x231e('0xf8')](function(_0x3ce4d1){_0x463f9e[_0x231e('0x42')](_0x3ce4d1[_0x231e('0x5b')]({'exitAt':moment()[_0x231e('0xb2')](_0x231e('0xf9'))}));});return BPromise[_0x231e('0x5a')](_0x463f9e);}})['then'](function(){if(_0x29dd60){var _0x4876a6=[];var _0x1aac93=[];var _0x4bfd4b=utils[_0x231e('0xfa')]();var _0x3c1e8a={'membername':_0x29dd60[_0x231e('0x2e')],'interface':_0x32504a,'enterAt':moment()[_0x231e('0xb2')](_0x231e('0xf9')),'role':_0x29dd60[_0x231e('0x2d')],'internal':_0x29dd60['internal']};_0x4bfd4b['forEach'](function(_0x303f57){_0x4876a6['push'](_['merge']({'channel':_0x303f57,'type':'LOGIN','data1':_0x42b9ea['body'][_0x231e('0xfb')],'data2':_0x32504a},_0x3c1e8a));if(_0x29dd60[_0x231e('0xeb')]){_0x1aac93['push'](_[_0x231e('0xd0')]({'channel':_0x303f57,'type':'PAUSE','data1':_0x231e('0xfc')},_0x3c1e8a));}});return db[_0x231e('0xf7')][_0x231e('0x8a')](_0x4876a6[_0x231e('0xcb')](_0x1aac93),{'individualHooks':!![]});}})['then'](function(){if(_0x29dd60){return _0x29dd60[_0x231e('0x5b')]({'online':!![],'lastLoginAt':moment()[_0x231e('0xb2')](_0x231e('0xf9')),'voicePause':_0x29dd60[_0x231e('0xeb')]||![],'mailPause':_0x29dd60[_0x231e('0xeb')]||![],'chatPause':_0x29dd60[_0x231e('0xeb')]||![],'faxPause':_0x29dd60[_0x231e('0xeb')]||![],'smsPause':_0x29dd60[_0x231e('0xeb')]||![],'openchannelPause':_0x29dd60[_0x231e('0xeb')]||![],'whatsappPause':_0x29dd60[_0x231e('0xeb')]||![],'pauseType':_0x29dd60[_0x231e('0xeb')]?_0x231e('0xfc'):null,'interface':_0x32504a,'lastPauseAt':moment()[_0x231e('0xb2')](_0x231e('0xf9'))});}})[_0x231e('0x10')](function(_0x2dd356){if(_0x42b9ea['isMiddleware']){return _0x3be262();}else{return BPromise['resolve'](_0x2dd356)[_0x231e('0x10')](respondWithResult(_0x3311f1,null));}})[_0x231e('0x1a')](handleError(_0x3311f1,null));};exports['logout']=function(_0x5668f7,_0x5524d0){var _0x5a8dce;return db['User'][_0x231e('0x56')]({'where':{'id':_0x5668f7[_0x231e('0x4b')]['id'],'role':_0x231e('0x28')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x5524d0,null))[_0x231e('0x10')](function(_0x3a1480){if(_0x3a1480){_0x5a8dce=_0x3a1480;return db[_0x231e('0xb8')][_0x231e('0x24')]({'where':{'membername':_0x5a8dce[_0x231e('0x2e')]},'individualHooks':!![]});}})[_0x231e('0x10')](function(){return db[_0x231e('0xf7')][_0x231e('0x43')]({'where':{'membername':_0x5a8dce[_0x231e('0x2e')],'exitAt':null}});})[_0x231e('0x10')](function(_0x5bea64){var _0x4af905=[];_0x5bea64['forEach'](function(_0x30277c){_0x4af905[_0x231e('0x42')](_0x30277c[_0x231e('0x5b')]({'exitAt':moment()[_0x231e('0xb2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x4af905);})['then'](function(){return _0x5a8dce[_0x231e('0x5b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x231e('0x10')](respondWithResult(_0x5524d0,null))['catch'](handleError(_0x5524d0,null));};exports['pause']=function(_0x15097c,_0xe34afb){var _0x5bcfff;return db[_0x231e('0xb8')][_0x231e('0x5b')]({'paused':0x1},{'where':{'UserId':_0x15097c[_0x231e('0x4b')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x231e('0x33')][_0x231e('0x56')]({'where':{'id':_0x15097c[_0x231e('0x4b')]['id'],'role':_0x231e('0x28')},'attributes':['id',_0x231e('0x2e'),'role',_0x231e('0x61'),_0x231e('0xa3')]});})['then'](handleEntityNotFound(_0xe34afb,null))[_0x231e('0x10')](function(_0x4263ad){if(_0x4263ad){_0x5bcfff=_0x4263ad;return respondWithRpcPromise('QueuePause',_0x231e('0xfd'),{'id':_0x5bcfff['id'],'name':_0x5bcfff[_0x231e('0x2e')],'pause':!![]});}})[_0x231e('0x10')](function(){if(_0x5bcfff){return db['MemberReport']['findAll']({'where':{'membername':_0x5bcfff[_0x231e('0x2e')],'type':'PAUSE','exitAt':null}});}})[_0x231e('0x10')](function(_0x78b874){if(_0x78b874[_0x231e('0x53')]){var _0x27304b=moment()['format'](_0x231e('0xf9'));for(var _0x583e64=0x0,_0x2c910f=_0x78b874[_0x231e('0x53')];_0x583e64<_0x2c910f;_0x583e64++){_0x78b874[_0x583e64][_0x231e('0xfe')]({'exitAt':_0x27304b});}}})[_0x231e('0x10')](function(){var _0x383a16=[];var _0x2d33d9=utils['getChannels']();_0x2d33d9[_0x231e('0xf8')](function(_0x3d5448){_0x383a16[_0x231e('0x42')]({'channel':_0x3d5448,'membername':_0x5bcfff[_0x231e('0x2e')],'interface':_[_0x231e('0x67')](_0x5bcfff[_0x231e('0xa3')])?util[_0x231e('0xb2')](_0x231e('0xb3'),_0x5bcfff[_0x231e('0x2e')]):_0x5bcfff[_0x231e('0xa3')],'type':_0x231e('0xff'),'enterAt':moment()['format'](_0x231e('0xf9')),'data1':_0x15097c[_0x231e('0x5c')][_0x231e('0x36')]||'DEFAULT\x20PAUSE','role':_0x5bcfff[_0x231e('0x2d')],'internal':_0x5bcfff[_0x231e('0x61')]});});return db[_0x231e('0xf7')]['bulkCreate'](_0x383a16,{'individualHooks':!![]});})['then'](function(){return _0x5bcfff[_0x231e('0x5b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x15097c[_0x231e('0x5c')][_0x231e('0x36')]||_0x231e('0x100'),'lastPauseAt':moment()['format'](_0x231e('0xf9'))});})[_0x231e('0x10')](respondWithResult(_0xe34afb,null))[_0x231e('0x1a')](handleError(_0xe34afb,null));};exports['unpause']=function(_0x32d314,_0x123530){var _0x1f94a9;return db[_0x231e('0x33')]['find']({'where':{'id':_0x32d314[_0x231e('0x4b')]['id']},'attributes':['id','name',_0x231e('0x2d'),_0x231e('0xa2'),_0x231e('0x101'),_0x231e('0x102'),_0x231e('0x103'),_0x231e('0x104'),_0x231e('0x105'),_0x231e('0x106'),_0x231e('0x107'),'lastPauseAt']})[_0x231e('0x10')](handleEntityNotFound(_0x123530,null))['then'](function(_0x311cc6){if(_0x311cc6){_0x1f94a9=_0x311cc6;if(_0x32d314['body']['channel']&&!utils['isValidChannel'](_0x32d314[_0x231e('0x5c')][_0x231e('0xa0')])){throw new db[(_0x231e('0x92'))][(_0x231e('0x93'))](_0x231e('0xa5'));}switch(_0x32d314[_0x231e('0x5c')]['channel']){case'voice':return respondWithRpcPromise(_0x231e('0x108'),_0x231e('0x109'),{'id':_0x1f94a9['id'],'name':_0x1f94a9[_0x231e('0x2e')],'pause':![]})[_0x231e('0x10')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x1f94a9['id']},'individualHooks':!![]});})[_0x231e('0x10')](function(){return db[_0x231e('0xf7')][_0x231e('0x56')]({'where':{'channel':_0x32d314[_0x231e('0x5c')]['channel'],'membername':_0x1f94a9[_0x231e('0x2e')],'type':'PAUSE','exitAt':null}});})[_0x231e('0x10')](function(_0x4a18e7){if(_0x4a18e7){return _0x4a18e7[_0x231e('0x5b')]({'exitAt':moment()[_0x231e('0xb2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x1f94a9[_0x231e('0x5b')]({'voicePause':![]});});case _0x231e('0x48'):case _0x231e('0x58'):case _0x231e('0x47'):case _0x231e('0x46'):case _0x231e('0x49'):case _0x231e('0x59'):return db[_0x231e('0xf7')][_0x231e('0x56')]({'where':{'channel':_0x32d314[_0x231e('0x5c')][_0x231e('0xa0')],'membername':_0x1f94a9[_0x231e('0x2e')],'type':_0x231e('0xff'),'exitAt':null}})[_0x231e('0x10')](function(_0x119022){if(_0x119022){return _0x119022[_0x231e('0x5b')]({'exitAt':moment()['format'](_0x231e('0xf9')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x231e('0x10')](function(){var _0x13697d={};_[_0x231e('0x10a')](_0x13697d,util[_0x231e('0xb2')](_0x231e('0x10b'),_0x32d314[_0x231e('0x5c')][_0x231e('0xa0')],_0x231e('0x10c')),![]);return _0x1f94a9[_0x231e('0x5b')](_0x13697d);});default:return respondWithRpcPromise('QueuePause',_0x231e('0x109'),{'id':_0x1f94a9['id'],'name':_0x1f94a9[_0x231e('0x2e')],'pause':![]})[_0x231e('0x10')](function(){return db[_0x231e('0xb8')][_0x231e('0x5b')]({'paused':0x0},{'where':{'UserId':_0x1f94a9['id']}});})[_0x231e('0x10')](function(){return db[_0x231e('0xf7')][_0x231e('0x43')]({'where':{'membername':_0x1f94a9[_0x231e('0x2e')],'type':_0x231e('0xff'),'exitAt':null}});})['then'](function(_0x5d211a){var _0x546937=[];_0x5d211a[_0x231e('0xf8')](function(_0x29e4d6){_0x546937[_0x231e('0x42')](_0x29e4d6['update']({'exitAt':moment()['format'](_0x231e('0xf9')),'data2':'manual'}));});return BPromise[_0x231e('0x5a')](_0x546937);})[_0x231e('0x10')](function(){return _0x1f94a9['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x123530,null))[_0x231e('0x1a')](handleError(_0x123530,null));};exports['getTeams']=function(_0x57f709,_0x4b201b){var _0x503ce0={};var _0x81ec19={};var _0x139dce;var _0x51b665;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0x57f709['params']['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x4b201b,null))[_0x231e('0x10')](function(_0x5c0a33){if(_0x5c0a33){_0x139dce=_0x5c0a33;_0x81ec19[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0x10d')][_0x231e('0x34')]);_0x81ec19['query']=_['keys'](_0x57f709[_0x231e('0x3c')]);_0x81ec19[_0x231e('0x50')]=_[_0x231e('0x51')](_0x81ec19[_0x231e('0x4c')],_0x81ec19[_0x231e('0x3c')]);_0x503ce0['attributes']=_[_0x231e('0x51')](_0x81ec19[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x57f709[_0x231e('0x3c')][_0x231e('0x52')]));_0x503ce0[_0x231e('0x41')]=_0x503ce0['attributes'][_0x231e('0x53')]?_0x503ce0[_0x231e('0x41')]:_0x81ec19['model'];_0x503ce0[_0x231e('0xce')]=qs[_0x231e('0xcf')](_0x57f709['query']['sort']);_0x503ce0[_0x231e('0x3b')]=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0x57f709[_0x231e('0x3c')],_0x81ec19[_0x231e('0x50')]));if(_0x57f709[_0x231e('0x3c')][_0x231e('0x38')]){_0x503ce0[_0x231e('0x3b')]=_['merge'](_0x503ce0[_0x231e('0x3b')],{'$or':_[_0x231e('0x2b')](_0x503ce0[_0x231e('0x41')],function(_0x59eac9){var _0x46d64b={};_0x46d64b[_0x59eac9]={'$like':'%'+_0x57f709[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x46d64b;})});}_0x503ce0=_['merge']({},_0x503ce0,_0x57f709[_0x231e('0x55')]);return _0x139dce[_0x231e('0x10e')](_0x503ce0);}})[_0x231e('0x10')](function(_0x122b02){if(_0x122b02){_0x51b665=_0x122b02[_0x231e('0x53')];if(!_0x57f709['query'][_0x231e('0xd1')](_0x231e('0xd9'))){_0x503ce0['limit']=qs[_0x231e('0x21')](_0x57f709[_0x231e('0x3c')][_0x231e('0x21')]);_0x503ce0[_0x231e('0x1f')]=qs['offset'](_0x57f709[_0x231e('0x3c')][_0x231e('0x1f')]);}return _0x139dce['getTeams'](_0x503ce0);}})['then'](function(_0x2f87dd){if(_0x2f87dd){return _0x2f87dd?{'count':_0x51b665,'rows':_0x2f87dd}:null;}})[_0x231e('0x10')](respondWithResult(_0x4b201b,null))[_0x231e('0x1a')](handleError(_0x4b201b,null));};exports['addTeams']=function(_0x16b3cb,_0x7181aa){return db['User'][_0x231e('0x56')]({'where':{'id':_0x16b3cb[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x7181aa,null))[_0x231e('0x10')](function(_0xd5300b){if(_0xd5300b){var _0x5b9e0a=_0xd5300b[_0x231e('0xb0')]({'plain':!![]});return _0xd5300b[_0x231e('0x10f')](_0x16b3cb[_0x231e('0x5c')]['ids'],_[_0x231e('0x60')](_0x16b3cb[_0x231e('0x5c')],[_0x231e('0x5f'),'id'])||{})['then'](function(){for(var _0x5a1ed0=0x0;_0x5a1ed0<_0x16b3cb[_0x231e('0x5c')][_0x231e('0x5f')][_0x231e('0x53')];_0x5a1ed0++){var _0x32bf1e=[];var _0x1e6af6={};db[_0x231e('0x10d')][_0x231e('0x99')]({'where':{'id':_0x16b3cb['body']['ids'][_0x5a1ed0]}})['then'](function(_0x39a780){_0x1e6af6=_0x39a780['dataValues'];_0x32bf1e[_0x231e('0x42')](_0x39a780[_0x231e('0xf5')]()[_0x231e('0x10')](function(_0x2efecf){for(var _0x31261b=0x0;_0x31261b<_0x2efecf[_0x231e('0x53')];_0x31261b++){_0x2efecf[_0x31261b][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x111'));}return _0x2efecf;}));_0x32bf1e[_0x231e('0x42')](_0x39a780[_0x231e('0x112')]()['then'](function(_0xafa40a){for(var _0x4a1f9c=0x0;_0x4a1f9c<_0xafa40a[_0x231e('0x53')];_0x4a1f9c++){_0xafa40a[_0x4a1f9c][_0x231e('0x110')]('channel',_0x231e('0x113'));}return _0xafa40a;}));_0x32bf1e['push'](_0x39a780[_0x231e('0x114')]()[_0x231e('0x10')](function(_0x39539d){for(var _0x4493d4=0x0;_0x4493d4<_0x39539d[_0x231e('0x53')];_0x4493d4++){_0x39539d[_0x4493d4][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x115'));}return _0x39539d;}));_0x32bf1e[_0x231e('0x42')](_0x39a780[_0x231e('0x116')]()[_0x231e('0x10')](function(_0x3c5c1e){for(var _0x2f7858=0x0;_0x2f7858<_0x3c5c1e[_0x231e('0x53')];_0x2f7858++){_0x3c5c1e[_0x2f7858][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x117'));}return _0x3c5c1e;}));_0x32bf1e[_0x231e('0x42')](_0x39a780[_0x231e('0x118')]()[_0x231e('0x10')](function(_0x181969){for(var _0x17ee1b=0x0;_0x17ee1b<_0x181969[_0x231e('0x53')];_0x17ee1b++){_0x181969[_0x17ee1b][_0x231e('0x110')](_0x231e('0xa0'),'Whatsapp');}return _0x181969;}));_0x32bf1e[_0x231e('0x42')](_0x39a780[_0x231e('0x119')]()[_0x231e('0x10')](function(_0x3b599f){for(var _0x528f19=0x0;_0x528f19<_0x3b599f[_0x231e('0x53')];_0x528f19++){_0x3b599f[_0x528f19][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x11a'));}return _0x3b599f;}));_0x32bf1e['push'](_0x39a780[_0x231e('0x11b')]()[_0x231e('0x10')](function(_0x21b447){for(var _0x1e8a03=0x0;_0x1e8a03<_0x21b447[_0x231e('0x53')];_0x1e8a03++){_0x21b447[_0x1e8a03][_0x231e('0x110')](_0x231e('0xa0'),'Openchannel');}return _0x21b447;}));return BPromise[_0x231e('0x5a')](_0x32bf1e);})['then'](function(_0x3ae27e){var _0x13b14c=_[_0x231e('0x11c')](_0x3ae27e);_0x32bf1e=[];return db[_0x231e('0x68')][_0x231e('0x11d')](function(_0x3fedbe){for(var _0x58ca00=0x0;_0x58ca00<_0x13b14c['length'];_0x58ca00++){_0x32bf1e[_0x231e('0x42')](_0x13b14c[_0x58ca00][_0x231e('0x11e')](_0x5b9e0a['id']),{'transaction':_0x3fedbe});}return BPromise[_0x231e('0x5a')](_0x32bf1e)[_0x231e('0x10')](function(){if(_0x5b9e0a[_0x231e('0xa1')]){return BPromise[_0x231e('0x8d')](_[_0x231e('0x38')](_0x13b14c,function(_0x11a231){return _0x11a231[_0x231e('0x11f')](_0x231e('0xa0'))==='Voice';}),function(_0x2b058e){return db[_0x231e('0xb8')][_0x231e('0xb4')]({'membername':_0x5b9e0a[_0x231e('0x2e')],'UserId':_0x5b9e0a['id'],'queue_name':_0x2b058e[_0x231e('0x2e')],'VoiceQueueId':_0x2b058e['id'],'interface':_[_0x231e('0x67')](_0x5b9e0a['interface'])?util['format'](_0x231e('0xb3'),_0x5b9e0a[_0x231e('0x2e')]):_0x5b9e0a[_0x231e('0xa3')],'paused':_0x5b9e0a[_0x231e('0xa2')]||![],'penalty':_0x5b9e0a['penalty']},{'transaction':_0x3fedbe});});}else{return;}})[_0x231e('0x10')](function(){for(var _0x16d8e2=0x0;_0x16d8e2<_0x13b14c[_0x231e('0x53')];_0x16d8e2++){var _0x85a612=_0x13b14c[_0x16d8e2][_0x231e('0x11f')](_0x231e('0xa0'));var _0x3fa7bd=_0x85a612+'QueueId';socket[_0x231e('0xad')](_0x231e('0x27')+_0x85a612+_0x231e('0xae'),{'UserId':_0x5b9e0a['id'],['queueField']:_0x13b14c[_0x16d8e2]['id']});}});});})[_0x231e('0x10')](function(){db[_0x231e('0x120')][_0x231e('0x99')]({'where':{'teamId':_0x1e6af6['id']}})[_0x231e('0x10')](function(_0x42aa46){if(_0x42aa46){db[_0x231e('0x121')][_0x231e('0x7e')]({'UserId':_0x16b3cb[_0x231e('0x4b')]['id'],'VoicePrefixId':_0x42aa46['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x7181aa,null))['catch'](handleError(_0x7181aa,null));};exports[_0x231e('0x122')]=function(_0x5cf58c,_0x59c8ef){return db['User']['findOne']({'where':{'id':_0x5cf58c[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x59c8ef,null))[_0x231e('0x10')](function(_0x534e2d){if(_0x534e2d){var _0x534a5f=_0x534e2d[_0x231e('0xb0')]({'plain':!![]});var _0x162b63=_0x5cf58c['query'][_0x231e('0x5f')];return _0x534e2d[_0x231e('0x122')](_0x162b63)[_0x231e('0x10')](function(){for(var _0x4f797f=0x0;_0x4f797f<_0x162b63[_0x231e('0x53')];_0x4f797f++){var _0x117f03=[];var _0x1b45c5={};db['Team'][_0x231e('0x99')]({'where':{'id':_0x162b63[_0x4f797f]}})[_0x231e('0x10')](function(_0x12eb52){_0x1b45c5=_0x12eb52['dataValues'];_0x117f03[_0x231e('0x42')](_0x12eb52['getVoiceQueues']()['then'](function(_0x5364d4){for(var _0x2350e4=0x0;_0x2350e4<_0x5364d4[_0x231e('0x53')];_0x2350e4++){_0x5364d4[_0x2350e4][_0x231e('0x110')]('channel','Voice');}return _0x5364d4;}));_0x117f03[_0x231e('0x42')](_0x12eb52[_0x231e('0x112')]()[_0x231e('0x10')](function(_0x5762ca){for(var _0x4c2f26=0x0;_0x4c2f26<_0x5762ca[_0x231e('0x53')];_0x4c2f26++){_0x5762ca[_0x4c2f26][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x113'));}return _0x5762ca;}));_0x117f03[_0x231e('0x42')](_0x12eb52['getMailQueues']()[_0x231e('0x10')](function(_0x1fdf3c){for(var _0x381cdf=0x0;_0x381cdf<_0x1fdf3c[_0x231e('0x53')];_0x381cdf++){_0x1fdf3c[_0x381cdf]['setDataValue'](_0x231e('0xa0'),_0x231e('0x115'));}return _0x1fdf3c;}));_0x117f03[_0x231e('0x42')](_0x12eb52[_0x231e('0x116')]()[_0x231e('0x10')](function(_0x4c18f6){for(var _0x397b66=0x0;_0x397b66<_0x4c18f6['length'];_0x397b66++){_0x4c18f6[_0x397b66][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x117'));}return _0x4c18f6;}));_0x117f03[_0x231e('0x42')](_0x12eb52[_0x231e('0x118')]()[_0x231e('0x10')](function(_0x2c26bf){for(var _0x2cd5b9=0x0;_0x2cd5b9<_0x2c26bf[_0x231e('0x53')];_0x2cd5b9++){_0x2c26bf[_0x2cd5b9][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x123'));}return _0x2c26bf;}));_0x117f03[_0x231e('0x42')](_0x12eb52[_0x231e('0x119')]()[_0x231e('0x10')](function(_0x91a2c5){for(var _0x23cf77=0x0;_0x23cf77<_0x91a2c5[_0x231e('0x53')];_0x23cf77++){_0x91a2c5[_0x23cf77][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x11a'));}return _0x91a2c5;}));_0x117f03['push'](_0x12eb52[_0x231e('0x11b')]()[_0x231e('0x10')](function(_0x123e72){for(var _0x4c0f06=0x0;_0x4c0f06<_0x123e72[_0x231e('0x53')];_0x4c0f06++){_0x123e72[_0x4c0f06][_0x231e('0x110')](_0x231e('0xa0'),_0x231e('0x124'));}return _0x123e72;}));return BPromise[_0x231e('0x5a')](_0x117f03);})['then'](function(_0x549d8c){var _0x3c4f16=_['flatten'](_0x549d8c);_0x117f03=[];return db[_0x231e('0x68')][_0x231e('0x11d')](function(_0x5de2ac){for(var _0x572f9e=0x0;_0x572f9e<_0x3c4f16[_0x231e('0x53')];_0x572f9e++){_0x117f03[_0x231e('0x42')](_0x3c4f16[_0x572f9e][_0x231e('0x125')](_0x534a5f['id']),{'transaction':_0x5de2ac});}return BPromise[_0x231e('0x5a')](_0x117f03)['then'](function(){if(_0x534a5f['online']){return BPromise['each'](_['filter'](_0x3c4f16,function(_0x3e664e){return _0x3e664e[_0x231e('0x11f')](_0x231e('0xa0'))===_0x231e('0x111');}),function(_0x45f292){return db[_0x231e('0xb8')][_0x231e('0x24')]({'where':{'VoiceQueueId':_0x45f292['id'],'UserId':_0x534a5f['id']},'transaction':_0x5de2ac});});}else{return;}})['then'](function(){db[_0x231e('0x120')][_0x231e('0x99')]({'where':{'teamId':_0x1b45c5['id']}})['then'](function(_0x438448){if(_0x438448){return db[_0x231e('0x121')][_0x231e('0x24')]({'where':{'UserId':_0x534a5f['id'],'VoicePrefixId':_0x438448[_0x231e('0x45')]['VoicePrefixId']}});}});})[_0x231e('0x10')](function(){for(var _0x227115=0x0;_0x227115<_0x3c4f16['length'];_0x227115++){var _0x2262ee=_0x3c4f16[_0x227115][_0x231e('0x11f')](_0x231e('0xa0'));var _0x532f4d=_0x2262ee+_0x231e('0xac');socket[_0x231e('0xad')](_0x231e('0x27')+_0x2262ee+_0x231e('0xb7'),{'UserId':_0x534a5f['id'],['queueField']:_0x3c4f16[_0x227115]['id']});}});});});}});}})[_0x231e('0x10')](respondWithStatusCode(_0x59c8ef,null))[_0x231e('0x1a')](handleError(_0x59c8ef,null));};exports[_0x231e('0x126')]=function(_0xa147bc,_0x1ef62f){var _0x402acc={};var _0x53025f={};var _0xf9db34;var _0x1b75ac;return db[_0x231e('0x33')][_0x231e('0x99')]({'where':{'id':_0xa147bc[_0x231e('0x4b')]['id']}})[_0x231e('0x10')](handleEntityNotFound(_0x1ef62f,null))[_0x231e('0x10')](function(_0x4aac69){if(_0x4aac69){_0xf9db34=_0x4aac69;_0x53025f[_0x231e('0x4c')]=_[_0x231e('0x4e')](db[_0x231e('0x127')]['rawAttributes']);_0x53025f[_0x231e('0x3c')]=_[_0x231e('0x4e')](_0xa147bc[_0x231e('0x3c')]);_0x53025f[_0x231e('0x50')]=_[_0x231e('0x51')](_0x53025f['model'],_0x53025f[_0x231e('0x3c')]);_0x402acc['attributes']=_[_0x231e('0x51')](_0x53025f[_0x231e('0x4c')],qs[_0x231e('0x52')](_0xa147bc[_0x231e('0x3c')]['fields']));_0x402acc[_0x231e('0x41')]=_0x402acc['attributes'][_0x231e('0x53')]?_0x402acc[_0x231e('0x41')]:_0x53025f[_0x231e('0x4c')];_0x402acc[_0x231e('0xce')]=qs['sort'](_0xa147bc[_0x231e('0x3c')][_0x231e('0xcf')]);_0x402acc[_0x231e('0x3b')]=qs[_0x231e('0x50')](_[_0x231e('0xd6')](_0xa147bc[_0x231e('0x3c')],_0x53025f[_0x231e('0x50')]));if(_0xa147bc['query'][_0x231e('0x38')]){_0x402acc[_0x231e('0x3b')]=_['merge'](_0x402acc[_0x231e('0x3b')],{'$or':_[_0x231e('0x2b')](_0x402acc['attributes'],function(_0xed0de8){var _0x207594={};_0x207594[_0xed0de8]={'$like':'%'+_0xa147bc['query']['filter']+'%'};return _0x207594;})});}_0x402acc=_[_0x231e('0xd0')]({},_0x402acc,_0xa147bc[_0x231e('0x55')]);return _0xf9db34[_0x231e('0x126')](_0x402acc);}})[_0x231e('0x10')](function(_0x475c4a){if(_0x475c4a){_0x1b75ac=_0x475c4a['length'];if(!_0xa147bc['query'][_0x231e('0xd1')](_0x231e('0xd9'))){_0x402acc[_0x231e('0x21')]=qs['limit'](_0xa147bc[_0x231e('0x3c')][_0x231e('0x21')]);_0x402acc[_0x231e('0x1f')]=qs[_0x231e('0x1f')](_0xa147bc[_0x231e('0x3c')]['offset']);}return _0xf9db34['getLists'](_0x402acc);}})[_0x231e('0x10')](function(_0x117263){if(_0x117263){return _0x117263?{'count':_0x1b75ac,'rows':_0x117263}:null;}})[_0x231e('0x10')](respondWithResult(_0x1ef62f,null))['catch'](handleError(_0x1ef62f,null));};exports[_0x231e('0x128')]=function(_0x3757f0,_0x37ff8a){var _0x319718={};var _0x14adf6={};var _0x166619;return db[_0x231e('0x33')]['findOne']({'where':{'id':_0x3757f0[_0x231e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37ff8a,null))['then'](function(_0x2510b2){if(_0x2510b2){_0x166619=_0x2510b2;_0x14adf6['model']=_[_0x231e('0x4e')](db['User'][_0x231e('0x34')]);_0x14adf6['query']=_[_0x231e('0x4e')](_0x3757f0[_0x231e('0x3c')]);_0x14adf6[_0x231e('0x50')]=_[_0x231e('0x51')](_0x14adf6[_0x231e('0x4c')],_0x14adf6[_0x231e('0x3c')]);_0x319718['attributes']=_[_0x231e('0x51')](_0x14adf6[_0x231e('0x4c')],qs[_0x231e('0x52')](_0x3757f0[_0x231e('0x3c')][_0x231e('0x52')]));_0x319718[_0x231e('0x41')]=_0x319718[_0x231e('0x41')][_0x231e('0x53')]?_0x319718[_0x231e('0x41')]:_0x14adf6[_0x231e('0x4c')];_0x319718['order']=qs[_0x231e('0xcf')](_0x3757f0[_0x231e('0x3c')]['sort']);_0x319718['where']=qs['filters'](_[_0x231e('0xd6')](_0x3757f0[_0x231e('0x3c')],_0x14adf6[_0x231e('0x50')]));if(_0x3757f0['query'][_0x231e('0x38')]){_0x319718[_0x231e('0x3b')]=_[_0x231e('0xd0')](_0x319718[_0x231e('0x3b')],{'$or':_[_0x231e('0x2b')](_0x319718['attributes'],function(_0x3f153f){var _0x205ab6={};_0x205ab6[_0x3f153f]={'$like':'%'+_0x3757f0[_0x231e('0x3c')][_0x231e('0x38')]+'%'};return _0x205ab6;})});}_0x319718[_0x231e('0x4c')]=db[_0x231e('0x33')];_0x319718['as']='Agents';_0x319718=_['merge']({},_0x319718,_0x3757f0[_0x231e('0x55')]);return _0x166619['getVoiceQueues']({'include':[_0x319718]});}})['then'](function(_0x3d3a2e){if(_0x3d3a2e){var _0xbff556={},_0x273446=[];for(var _0x1b2dde=0x0;_0x1b2dde<_0x3d3a2e[_0x231e('0x53')];_0x1b2dde+=0x1){for(var _0x489a37=0x0,_0x1ccce5;_0x489a37<_0x3d3a2e[_0x1b2dde][_0x231e('0x86')]['length'];_0x489a37+=0x1){_0x1ccce5=_0x3d3a2e[_0x1b2dde][_0x231e('0x86')][_0x489a37][_0x231e('0xb0')]({'plain':!![]});_0xbff556[_0x1ccce5['id']]=_0x1ccce5;}}_0xbff556=_[_0x231e('0x129')](_0xbff556);for(var _0x39990c=qs[_0x231e('0x1f')](_0x3757f0[_0x231e('0x3c')][_0x231e('0x1f')]);_0x39990c<_0xbff556[_0x231e('0x53')]&&_0x273446[_0x231e('0x53')]=_0x4e8a45[_0x1784('0x50')]){throw new Error(_0x1784('0x51'));}})['then'](function(){if(_0x59a96c){return db[_0x1784('0x2a')][_0x1784('0x49')]({'where':{'membername':_0x59a96c[_0x1784('0x26')]},'individualHooks':!![]});}})[_0x1784('0xd')](function(){if(_0x59a96c){return _0x59a96c['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x4d8dee){if(_0x59a96c){if(_0x4d8dee){var _0x30b60b=[];_0x9e26ed=_0x4d8dee;if(_0x9e26ed[_0x1784('0x2c')]){for(var _0x1ac3fd=0x0;_0x1ac3fd<_0x9e26ed[_0x1784('0x2c')];_0x1ac3fd++){_0x30b60b[_0x1784('0x31')](db['UserVoiceQueueRt'][_0x1784('0x52')]({'membername':_0x59a96c[_0x1784('0x26')],'UserId':_0x59a96c['id'],'queue_name':_0x9e26ed[_0x1ac3fd]['name'],'VoiceQueueId':_0x9e26ed[_0x1ac3fd]['id'],'interface':_0x8b12b4,'paused':_0x59a96c[_0x1784('0x4c')]||![],'penalty':_0x9e26ed[_0x1ac3fd][_0x1784('0x53')]||0x0}));}return BPromise[_0x1784('0x48')](_0x30b60b);}}}})['then'](function(){if(_0x59a96c){return db[_0x1784('0x36')][_0x1784('0x1b')]({'where':{'membername':_0x59a96c[_0x1784('0x26')],'exitAt':null}});}})['then'](function(_0x2adedd){if(_0x59a96c){if(_0x2adedd&&_0x2adedd[_0x1784('0x2c')]){var _0x234455=[];_0x2adedd[_0x1784('0x47')](function(_0x835a8f){_0x234455[_0x1784('0x31')](_0x835a8f[_0x1784('0x38')]({'exitAt':moment()['format'](_0x1784('0x2e'))}));});return BPromise[_0x1784('0x48')](_0x234455);}}})[_0x1784('0xd')](function(_0x2c4813){if(_0x59a96c){var _0x5cc1a6=[];var _0x9b6831=[];var _0x37feaf=utils[_0x1784('0x30')]();var _0x31aae9={'membername':_0x59a96c[_0x1784('0x26')],'interface':_0x8b12b4,'enterAt':moment()['format'](_0x1784('0x2e')),'role':_0x59a96c[_0x1784('0x27')],'internal':_0x59a96c[_0x1784('0x28')]};_0x37feaf[_0x1784('0x47')](function(_0x4139f7){_0x5cc1a6['push'](_[_0x1784('0x54')]({'channel':_0x4139f7,'type':_0x1784('0x55'),'data1':_0x1784('0x56'),'data2':_0x8b12b4},_0x31aae9));if(_0x59a96c['loginInPause']){_0x9b6831['push'](_[_0x1784('0x54')]({'channel':_0x4139f7,'type':_0x1784('0x2b'),'data1':_0x1784('0x57')},_0x31aae9));}});return db[_0x1784('0x36')][_0x1784('0x37')](_0x5cc1a6['concat'](_0x9b6831),{'individualHooks':!![]});}})[_0x1784('0xd')](function(){if(_0x59a96c){return _0x59a96c[_0x1784('0x38')]({'online':!![],'lastLoginAt':moment()[_0x1784('0x2d')](_0x1784('0x2e')),'voicePause':_0x59a96c[_0x1784('0x4c')]||![],'mailPause':_0x59a96c[_0x1784('0x4c')]||![],'chatPause':_0x59a96c['loginInPause']||![],'faxPause':_0x59a96c['loginInPause']||![],'smsPause':_0x59a96c[_0x1784('0x4c')]||![],'openchannelPause':_0x59a96c['loginInPause']||![],'pauseType':_0x59a96c[_0x1784('0x4c')]?_0x1784('0x57'):null,'lastPauseAt':moment()[_0x1784('0x2d')](_0x1784('0x2e')),'interface':_0x8b12b4});}})[_0x1784('0xd')](function(_0x50e123){_0x20ea74(_0x50e123);})[_0x1784('0x18')](function(_0x9b4001){_0xdfcbd5(_0x12c032[_0x1784('0x14')](0x1f4,_0x9b4001[_0x1784('0x16')]));});});}; \ No newline at end of file +var _0x55b3=['include','map','model','ShowUser','PauseUser','name','internal','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','forEach','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','update','UnpauseUser','channel','isValidChannel','Unknown\x20channel','UserVoiceQueueRt','find','system','chat','fax','sms','whatsapp','set','Pause','all','LogoutUser','findOne','destroy','length','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','concat','LOGININPAUSE','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./user.socket','register','then','debug','stringify','error','code','message','info','User,\x20%s,\x20%s','request\x20sent','result','catch','GetUser','User','findAll','options','where','attributes','limit'];(function(_0x5f053c,_0xc989b7){var _0x5928a9=function(_0x45920a){while(--_0x45920a){_0x5f053c['push'](_0x5f053c['shift']());}};_0x5928a9(++_0xc989b7);}(_0x55b3,0x13f));var _0x355b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x55b3[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x355b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x355b('0x1'));var rs=require(_0x355b('0x2'));var fs=require('fs');var Redis=require(_0x355b('0x3'));var db=require(_0x355b('0x4'))['db'];var utils=require(_0x355b('0x5'));var logger=require(_0x355b('0x6'))('rpc');var config=require(_0x355b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x355b('0x8')][_0x355b('0x9')]({'port':0x232a});config[_0x355b('0xa')]=_['defaults'](config[_0x355b('0xa')],{'host':_0x355b('0xb'),'port':0x18eb});var socket=require(_0x355b('0xc'))(new Redis(config[_0x355b('0xa')]));require(_0x355b('0xd'))[_0x355b('0xe')](socket);function respondWithRpcPromise(_0x34f518,_0xc19d10,_0x54862d){return new BPromise(function(_0x162e0e,_0x345606){return client['request'](_0x34f518,_0x54862d)[_0x355b('0xf')](function(_0x3ca6a5){logger['info']('User,\x20%s,\x20%s',_0xc19d10,'request\x20sent');logger[_0x355b('0x10')]('User,\x20%s,\x20%s,\x20%s',_0xc19d10,'request\x20sent',JSON[_0x355b('0x11')](_0x3ca6a5));if(_0x3ca6a5[_0x355b('0x12')]){if(_0x3ca6a5[_0x355b('0x12')][_0x355b('0x13')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0xc19d10,_0x3ca6a5[_0x355b('0x12')][_0x355b('0x14')]);return _0x345606(_0x3ca6a5['error']['message']);}logger[_0x355b('0x12')]('User,\x20%s,\x20%s',_0xc19d10,_0x3ca6a5['error'][_0x355b('0x14')]);return _0x162e0e(_0x3ca6a5[_0x355b('0x12')][_0x355b('0x14')]);}else{logger[_0x355b('0x15')](_0x355b('0x16'),_0xc19d10,_0x355b('0x17'));_0x162e0e(_0x3ca6a5[_0x355b('0x18')][_0x355b('0x14')]);}})[_0x355b('0x19')](function(_0x2270d5){logger[_0x355b('0x12')]('User,\x20%s,\x20%s',_0xc19d10,_0x2270d5);_0x345606(_0x2270d5);});});}exports[_0x355b('0x1a')]=function(_0x3b864c){var _0x10442e=this;return new Promise(function(_0x5ab767,_0x136888){return db[_0x355b('0x1b')][_0x355b('0x1c')]({'raw':_0x3b864c[_0x355b('0x1d')]?_0x3b864c[_0x355b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3b864c[_0x355b('0x1d')]?_0x3b864c[_0x355b('0x1d')][_0x355b('0x1e')]||null:null,'attributes':_0x3b864c[_0x355b('0x1d')]?_0x3b864c[_0x355b('0x1d')][_0x355b('0x1f')]||null:null,'limit':_0x3b864c[_0x355b('0x1d')]?_0x3b864c[_0x355b('0x1d')][_0x355b('0x20')]||null:null,'include':_0x3b864c['options']?_0x3b864c['options'][_0x355b('0x21')]?_[_0x355b('0x22')](_0x3b864c[_0x355b('0x1d')][_0x355b('0x21')],function(_0x6d4324){return{'model':db[_0x6d4324[_0x355b('0x23')]],'as':_0x6d4324['as'],'attributes':_0x6d4324[_0x355b('0x1f')],'include':_0x6d4324[_0x355b('0x21')]?_[_0x355b('0x22')](_0x6d4324[_0x355b('0x21')],function(_0x127724){return{'model':db[_0x127724[_0x355b('0x23')]],'as':_0x127724['as'],'attributes':_0x127724[_0x355b('0x1f')],'include':_0x127724[_0x355b('0x21')]?_[_0x355b('0x22')](_0x127724[_0x355b('0x21')],function(_0x1c0ab6){return{'model':db[_0x1c0ab6[_0x355b('0x23')]],'as':_0x1c0ab6['as'],'attributes':_0x1c0ab6[_0x355b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x355b('0xf')](function(_0x124d28){logger[_0x355b('0x15')](_0x355b('0x1a'),_0x3b864c);logger[_0x355b('0x10')]('GetUser',_0x3b864c,JSON[_0x355b('0x11')](_0x124d28));_0x5ab767(_0x124d28);})['catch'](function(_0x1c36e7){logger['error'](_0x355b('0x1a'),_0x1c36e7[_0x355b('0x14')],_0x3b864c);_0x136888(_0x10442e[_0x355b('0x12')](0x1f4,_0x1c36e7[_0x355b('0x14')]));});});};exports[_0x355b('0x24')]=function(_0x4ab7f7){var _0x19a335=this;return new Promise(function(_0x2e17e9,_0x41cf2){return db[_0x355b('0x1b')]['find']({'raw':_0x4ab7f7[_0x355b('0x1d')]?_0x4ab7f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ab7f7[_0x355b('0x1d')]?_0x4ab7f7['options'][_0x355b('0x1e')]||null:null,'attributes':_0x4ab7f7[_0x355b('0x1d')]?_0x4ab7f7['options'][_0x355b('0x1f')]||null:null,'include':_0x4ab7f7[_0x355b('0x1d')]?_0x4ab7f7[_0x355b('0x1d')][_0x355b('0x21')]?_[_0x355b('0x22')](_0x4ab7f7['options'][_0x355b('0x21')],function(_0x468a7b){return{'model':db[_0x468a7b[_0x355b('0x23')]],'as':_0x468a7b['as'],'attributes':_0x468a7b['attributes'],'include':_0x468a7b[_0x355b('0x21')]?_[_0x355b('0x22')](_0x468a7b[_0x355b('0x21')],function(_0x5a6c80){return{'model':db[_0x5a6c80[_0x355b('0x23')]],'as':_0x5a6c80['as'],'attributes':_0x5a6c80[_0x355b('0x1f')],'include':_0x5a6c80[_0x355b('0x21')]?_[_0x355b('0x22')](_0x5a6c80['include'],function(_0x270e98){return{'model':db[_0x270e98['model']],'as':_0x270e98['as'],'attributes':_0x270e98['attributes']};}):[]};}):[]};}):[]:[]})[_0x355b('0xf')](function(_0x10871e){logger[_0x355b('0x15')](_0x355b('0x24'),_0x4ab7f7);logger[_0x355b('0x10')](_0x355b('0x24'),_0x4ab7f7,JSON[_0x355b('0x11')](_0x10871e));_0x2e17e9(_0x10871e);})['catch'](function(_0x25438d){logger[_0x355b('0x12')](_0x355b('0x24'),_0x25438d[_0x355b('0x14')],_0x4ab7f7);_0x41cf2(_0x19a335[_0x355b('0x12')](0x1f4,_0x25438d['message']));});});};exports[_0x355b('0x25')]=function(_0x99e7cb){var _0x31e338=this;return new Promise(function(_0x517687,_0x43af98){var _0x4458b0;return db['User']['find']({'where':_0x99e7cb['options'][_0x355b('0x1e')]||{},'attributes':['id',_0x355b('0x26'),'role',_0x355b('0x27'),'interface']})[_0x355b('0xf')](function(_0x5e3d7d){if(_0x5e3d7d){_0x4458b0=_0x5e3d7d;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x4458b0['id']},'individualHooks':!![]});}})[_0x355b('0xf')](function(){if(_0x4458b0){return db[_0x355b('0x28')][_0x355b('0x1c')]({'where':{'membername':_0x4458b0['name'],'type':_0x355b('0x29'),'exitAt':null}});}})[_0x355b('0xf')](function(_0x3fff57){if(_0x4458b0){if(_0x3fff57&&_0x3fff57['length']){var _0x4257e0=moment()[_0x355b('0x2a')](_0x355b('0x2b'));for(var _0x432735=0x0,_0x4847ed=_0x3fff57['length'];_0x432735<_0x4847ed;_0x432735++){_0x3fff57[_0x432735]['updateAttributes']({'exitAt':_0x4257e0});}}}})['then'](function(){if(_0x4458b0){var _0x539cc9=[];var _0x1a0853=utils['getChannels']();_0x1a0853[_0x355b('0x2c')](function(_0x480f0e){_0x539cc9[_0x355b('0x2d')]({'channel':_0x480f0e,'membername':_0x4458b0[_0x355b('0x26')],'interface':_[_0x355b('0x2e')](_0x4458b0[_0x355b('0x2f')])?util[_0x355b('0x2a')](_0x355b('0x30'),_0x4458b0[_0x355b('0x26')]):_0x4458b0[_0x355b('0x2f')],'type':'PAUSE','enterAt':moment()[_0x355b('0x2a')](_0x355b('0x2b')),'data1':_0x99e7cb[_0x355b('0x31')][_0x355b('0x32')]||_0x355b('0x33'),'role':_0x4458b0['role'],'internal':_0x4458b0[_0x355b('0x27')],'uniqueid':_0x99e7cb[_0x355b('0x31')]['uniqueid']||null});});return db[_0x355b('0x28')][_0x355b('0x34')](_0x539cc9,{'individualHooks':!![]});}})['then'](function(){if(_0x4458b0){return _0x4458b0[_0x355b('0x35')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x99e7cb[_0x355b('0x31')][_0x355b('0x32')]||_0x355b('0x33'),'lastPauseAt':moment()[_0x355b('0x2a')](_0x355b('0x2b'))});}})[_0x355b('0xf')](function(_0x3aedfc){_0x517687(_0x3aedfc);})[_0x355b('0x19')](function(_0x4127d6){_0x43af98(_0x31e338['error'](0x1f4,_0x4127d6[_0x355b('0x14')]));});});};exports[_0x355b('0x36')]=function(_0x227eaa){var _0xc111df=this;return new Promise(function(_0x20f537,_0x77f803){var _0x21d974;return db[_0x355b('0x1b')]['findOne']({'where':_0x227eaa[_0x355b('0x1d')][_0x355b('0x1e')]||{},'attributes':['id',_0x355b('0x26')]})[_0x355b('0xf')](function(_0x10ce83){if(_0x10ce83){_0x21d974=_0x10ce83;if(_0x227eaa[_0x355b('0x31')][_0x355b('0x37')]&&!utils[_0x355b('0x38')](_0x227eaa[_0x355b('0x31')][_0x355b('0x37')])){throw new Error(_0x355b('0x39'));}switch(_0x227eaa[_0x355b('0x31')][_0x355b('0x37')]){case'voice':return db[_0x355b('0x3a')][_0x355b('0x35')]({'paused':0x0},{'where':{'UserId':_0x21d974['id']}})[_0x355b('0xf')](function(){return db[_0x355b('0x28')][_0x355b('0x3b')]({'where':{'channel':_0x227eaa[_0x355b('0x31')][_0x355b('0x37')],'membername':_0x21d974[_0x355b('0x26')],'type':_0x355b('0x29'),'exitAt':null}});})[_0x355b('0xf')](function(_0x191a7a){if(_0x191a7a){return _0x191a7a[_0x355b('0x35')]({'exitAt':moment()[_0x355b('0x2a')](_0x355b('0x2b')),'data2':_0x355b('0x3c')},{'individualHooks':!![]});}return null;})[_0x355b('0xf')](function(){return _0x21d974['update']({'voicePause':![]});});case'mail':case _0x355b('0x3d'):case _0x355b('0x3e'):case _0x355b('0x3f'):case'openchannel':case _0x355b('0x40'):return db[_0x355b('0x28')]['find']({'where':{'channel':_0x227eaa[_0x355b('0x31')][_0x355b('0x37')],'membername':_0x21d974[_0x355b('0x26')],'type':_0x355b('0x29'),'exitAt':null}})[_0x355b('0xf')](function(_0x4e7a47){return _0x4e7a47[_0x355b('0x35')]({'exitAt':moment()[_0x355b('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x355b('0x3c')},{'individualHooks':!![]});})[_0x355b('0xf')](function(){var _0x538db1={};_[_0x355b('0x41')](_0x538db1,util[_0x355b('0x2a')]('%s%s',_0x227eaa[_0x355b('0x31')][_0x355b('0x37')],_0x355b('0x42')),![]);return _0x21d974[_0x355b('0x35')](_0x538db1);});default:return db[_0x355b('0x3a')][_0x355b('0x35')]({'paused':0x0},{'where':{'UserId':_0x21d974['id']}})['then'](function(){return db[_0x355b('0x28')]['findAll']({'where':{'membername':_0x21d974[_0x355b('0x26')],'type':_0x355b('0x29'),'exitAt':null}});})[_0x355b('0xf')](function(_0x168af8){var _0x7cf3eb=[];_0x168af8['forEach'](function(_0x4d18c5){_0x7cf3eb[_0x355b('0x2d')](_0x4d18c5[_0x355b('0x35')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x355b('0x3c')}));});return BPromise[_0x355b('0x43')](_0x7cf3eb);})[_0x355b('0xf')](function(){return _0x21d974[_0x355b('0x35')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x355b('0xf')](function(_0x49de7e){_0x20f537(_0x49de7e);})[_0x355b('0x19')](function(_0x42901b){_0x77f803(_0xc111df[_0x355b('0x12')](0x1f4,_0x42901b[_0x355b('0x14')]));});});};exports[_0x355b('0x44')]=function(_0x530032){var _0x491587=this;return new Promise(function(_0x339bd0,_0x5c5ba8){var _0x5a0b66;return db[_0x355b('0x1b')][_0x355b('0x45')]({'where':_0x530032[_0x355b('0x1d')]['where']||{},'attributes':['id',_0x355b('0x26')]})[_0x355b('0xf')](function(_0x505a74){if(_0x505a74){_0x5a0b66=_0x505a74;return db[_0x355b('0x3a')][_0x355b('0x46')]({'where':{'membername':_0x5a0b66[_0x355b('0x26')]},'individualHooks':!![]});}})[_0x355b('0xf')](function(){if(_0x5a0b66){return db[_0x355b('0x28')][_0x355b('0x1c')]({'where':{'membername':_0x5a0b66[_0x355b('0x26')],'exitAt':null}});}})[_0x355b('0xf')](function(_0x280ea2){if(_0x5a0b66){if(_0x280ea2&&_0x280ea2[_0x355b('0x47')]){var _0x39bc05=[];_0x280ea2['forEach'](function(_0x31438e){_0x39bc05[_0x355b('0x2d')](_0x31438e['update']({'exitAt':moment()[_0x355b('0x2a')](_0x355b('0x2b'))}));});return BPromise[_0x355b('0x43')](_0x39bc05);}}})['then'](function(){if(_0x5a0b66){return _0x5a0b66[_0x355b('0x35')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x458aa7){_0x339bd0(_0x458aa7);})['catch'](function(_0x296882){_0x5c5ba8(_0x491587[_0x355b('0x12')](0x1f4,_0x296882['message']));});});};exports[_0x355b('0x48')]=function(_0x15e54c){var _0x1f531f=this;return new Promise(function(_0x556fe1,_0x453a47){var _0x423900;var _0x168ee3;var _0x5207a6;var _0x44cee0;return db[_0x355b('0x1b')][_0x355b('0x45')]({'where':_0x15e54c[_0x355b('0x1d')]['where']||{},'attributes':['id',_0x355b('0x26'),'role',_0x355b('0x49'),_0x355b('0x4a'),_0x355b('0x27'),_0x355b('0x4b'),_0x355b('0x2f')]})[_0x355b('0xf')](function(_0x1b6858){if(_0x1b6858){_0x423900=_0x1b6858;_0x44cee0=_0x15e54c[_0x355b('0x31')][_0x355b('0x2f')]?_0x15e54c[_0x355b('0x31')][_0x355b('0x2f')]:util[_0x355b('0x2a')]('SIP/%s',_0x423900[_0x355b('0x26')]);return db[_0x355b('0x1b')][_0x355b('0x4c')]({'where':{'role':_0x355b('0x4d'),'online':!![],'id':{'$ne':_0x423900['id']}}});}})[_0x355b('0xf')](function(_0x542458){if(_0x542458){_0x5207a6=_0x542458;return require('../../config/license/util')[_0x355b('0x4e')]();}})['then'](function(_0x11de1a){if(_0x11de1a&&_0x11de1a[_0x355b('0x4f')]&&_0x5207a6>=_0x11de1a['agents']){throw new Error(_0x355b('0x50'));}})[_0x355b('0xf')](function(){if(_0x423900){return db[_0x355b('0x3a')][_0x355b('0x46')]({'where':{'membername':_0x423900[_0x355b('0x26')]},'individualHooks':!![]});}})[_0x355b('0xf')](function(){if(_0x423900){return _0x423900['getVoiceQueues']({'raw':!![]});}})[_0x355b('0xf')](function(_0x31c386){if(_0x423900){if(_0x31c386){var _0x566640=[];_0x168ee3=_0x31c386;if(_0x168ee3[_0x355b('0x47')]){for(var _0x1aae62=0x0;_0x1aae62<_0x168ee3[_0x355b('0x47')];_0x1aae62++){_0x566640[_0x355b('0x2d')](db['UserVoiceQueueRt'][_0x355b('0x51')]({'membername':_0x423900[_0x355b('0x26')],'UserId':_0x423900['id'],'queue_name':_0x168ee3[_0x1aae62]['name'],'VoiceQueueId':_0x168ee3[_0x1aae62]['id'],'interface':_0x44cee0,'paused':_0x423900['loginInPause']||![],'penalty':_0x168ee3[_0x1aae62][_0x355b('0x52')]||0x0}));}return BPromise[_0x355b('0x43')](_0x566640);}}}})[_0x355b('0xf')](function(){if(_0x423900){return db['MemberReport']['findAll']({'where':{'membername':_0x423900[_0x355b('0x26')],'exitAt':null}});}})[_0x355b('0xf')](function(_0x362f4c){if(_0x423900){if(_0x362f4c&&_0x362f4c[_0x355b('0x47')]){var _0x3c7c5c=[];_0x362f4c['forEach'](function(_0x426ec4){_0x3c7c5c['push'](_0x426ec4[_0x355b('0x35')]({'exitAt':moment()[_0x355b('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x355b('0x43')](_0x3c7c5c);}}})[_0x355b('0xf')](function(_0x4b5e30){if(_0x423900){var _0x2be801=[];var _0x536e31=[];var _0x4c7a79=utils[_0x355b('0x53')]();var _0x4af451={'membername':_0x423900['name'],'interface':_0x44cee0,'enterAt':moment()[_0x355b('0x2a')](_0x355b('0x2b')),'role':_0x423900['role'],'internal':_0x423900[_0x355b('0x27')]};_0x4c7a79['forEach'](function(_0x228ce1){_0x2be801[_0x355b('0x2d')](_[_0x355b('0x54')]({'channel':_0x228ce1,'type':_0x355b('0x55'),'data1':'callysquare','data2':_0x44cee0},_0x4af451));if(_0x423900[_0x355b('0x4b')]){_0x536e31['push'](_['merge']({'channel':_0x228ce1,'type':_0x355b('0x29'),'data1':'LOGININPAUSE'},_0x4af451));}});return db['MemberReport'][_0x355b('0x34')](_0x2be801[_0x355b('0x56')](_0x536e31),{'individualHooks':!![]});}})['then'](function(){if(_0x423900){return _0x423900[_0x355b('0x35')]({'online':!![],'lastLoginAt':moment()[_0x355b('0x2a')](_0x355b('0x2b')),'voicePause':_0x423900[_0x355b('0x4b')]||![],'mailPause':_0x423900[_0x355b('0x4b')]||![],'chatPause':_0x423900[_0x355b('0x4b')]||![],'faxPause':_0x423900[_0x355b('0x4b')]||![],'smsPause':_0x423900[_0x355b('0x4b')]||![],'openchannelPause':_0x423900[_0x355b('0x4b')]||![],'pauseType':_0x423900[_0x355b('0x4b')]?_0x355b('0x57'):null,'lastPauseAt':moment()['format'](_0x355b('0x2b')),'interface':_0x44cee0});}})[_0x355b('0xf')](function(_0x4e8f9e){_0x556fe1(_0x4e8f9e);})[_0x355b('0x19')](function(_0x183809){_0x453a47(_0x1f531f[_0x355b('0x12')](0x1f4,_0x183809['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index b6a19d0..f500c99 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 _0xd7f9=['update','removeListener','register','length','./user.events'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0xd7f9,0x126));var _0x9d7f=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0xd7f9[_0x5756f8];return _0x3bb749;};'use strict';var UserEvents=require(_0x9d7f('0x0'));var events=['save','remove',_0x9d7f('0x1')];function createListener(_0x589714,_0x214afb){return function(_0x26f5b6){_0x214afb['emit'](_0x589714,_0x26f5b6);};}function removeListener(_0x40ca99,_0x253625){return function(){UserEvents[_0x9d7f('0x2')](_0x40ca99,_0x253625);};}exports[_0x9d7f('0x3')]=function(_0x43ee2a){for(var _0x15eb60=0x0,_0x289b34=events[_0x9d7f('0x4')];_0x15eb60<_0x289b34;_0x15eb60++){var _0xc7855=events[_0x15eb60];var _0x2ccf05=createListener('user:'+_0xc7855,_0x43ee2a);UserEvents['on'](_0xc7855,_0x2ccf05);}}; \ No newline at end of file +var _0x9afe=['length','user:','./user.events','save','removeListener'];(function(_0x1b3521,_0x1b4d61){var _0x2f2e97=function(_0x47fc9b){while(--_0x47fc9b){_0x1b3521['push'](_0x1b3521['shift']());}};_0x2f2e97(++_0x1b4d61);}(_0x9afe,0x1ab));var _0xe9af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9afe[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0xe9af('0x0'));var events=[_0xe9af('0x1'),'remove','update'];function createListener(_0x4b592d,_0x8d2dc0){return function(_0x5382c3){_0x8d2dc0['emit'](_0x4b592d,_0x5382c3);};}function removeListener(_0x506344,_0x426e9f){return function(){UserEvents[_0xe9af('0x2')](_0x506344,_0x426e9f);};}exports['register']=function(_0x74e37f){for(var _0x4c1cec=0x0,_0x22b848=events[_0xe9af('0x3')];_0x4c1cec<_0x22b848;_0x4c1cec++){var _0x18b814=events[_0x4c1cec];var _0x461766=createListener(_0xe9af('0x4')+_0x18b814,_0x74e37f);UserEvents['on'](_0x18b814,_0x461766);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 84c07dc..90109cf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1bac40,_0x40e428){var _0x3a1a70=function(_0x5459c0){while(--_0x5459c0){_0x1bac40['push'](_0x1bac40['shift']());}};_0x3a1a70(++_0x40e428);}(_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(_0x1535e7,_0xa643a3){var _0x1fe0cf=function(_0x5cf6d6){while(--_0x5cf6d6){_0x1535e7['push'](_0x1535e7['shift']());}};_0x1fe0cf(++_0xa643a3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xcb91[_0x16539a];return _0x200796;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 3bf3073..8d437d1 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 _0x0845=['sequelize'];(function(_0xf0ab39,_0x546c7d){var _0x597c68=function(_0x4629a1){while(--_0x4629a1){_0xf0ab39['push'](_0xf0ab39['shift']());}};_0x597c68(++_0x546c7d);}(_0x0845,0x125));var _0x5084=function(_0x2f5072,_0x11d0cd){_0x2f5072=_0x2f5072-0x0;var _0x28d2c8=_0x0845[_0x2f5072];return _0x28d2c8;};'use strict';var Sequelize=require(_0x5084('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3677=['sequelize','exports','INTEGER'];(function(_0x5dd72c,_0x50557f){var _0x5bffce=function(_0x5b3e78){while(--_0x5b3e78){_0x5dd72c['push'](_0x5dd72c['shift']());}};_0x5bffce(++_0x50557f);}(_0x3677,0x1e9));var _0x7367=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0x3677[_0x1c6551];return _0x3f7434;};'use strict';var Sequelize=require(_0x7367('0x0'));module[_0x7367('0x1')]={'penalty':{'type':Sequelize[_0x7367('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 e6f2741..498b63b 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 _0x1cb7=['request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2cebd0,_0x35feda){var _0x19a770=function(_0x397c16){while(--_0x397c16){_0x2cebd0['push'](_0x2cebd0['shift']());}};_0x19a770(++_0x35feda);}(_0x1cb7,0xb1));var _0x71cb=function(_0x3f2da9,_0x2b422d){_0x3f2da9=_0x3f2da9-0x0;var _0x25c139=_0x1cb7[_0x3f2da9];return _0x25c139;};'use strict';var _=require(_0x71cb('0x0'));var util=require('util');var logger=require(_0x71cb('0x1'))(_0x71cb('0x2'));var moment=require(_0x71cb('0x3'));var BPromise=require(_0x71cb('0x4'));var rp=require(_0x71cb('0x5'));var fs=require('fs');var path=require(_0x71cb('0x6'));var rimraf=require(_0x71cb('0x7'));var config=require(_0x71cb('0x8'));var attributes=require(_0x71cb('0x9'));module[_0x71cb('0xa')]=function(_0x40db58,_0x5433ab){return _0x40db58[_0x71cb('0xb')](_0x71cb('0xc'),attributes,{'tableName':_0x71cb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30d6=['moment','bluebird','request-promise','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0x30d6,0x15d));var _0x630d=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x30d6[_0x4b2cc6];return _0x3e0b08;};'use strict';var _=require(_0x630d('0x0'));var util=require('util');var logger=require(_0x630d('0x1'))(_0x630d('0x2'));var moment=require(_0x630d('0x3'));var BPromise=require(_0x630d('0x4'));var rp=require(_0x630d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x630d('0x6'));module[_0x630d('0x7')]=function(_0x45d3a5,_0x1164f6){return _0x45d3a5[_0x630d('0x8')](_0x630d('0x9'),attributes,{'tableName':_0x630d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index eac4659..0dd897b 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 _0x317a=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2c74e5,_0x2f9a66){var _0x3ea53c=function(_0x5bf845){while(--_0x5bf845){_0x2c74e5['push'](_0x2c74e5['shift']());}};_0x3ea53c(++_0x2f9a66);}(_0x317a,0x12a));var _0xa317=function(_0x3818a1,_0x31bc14){_0x3818a1=_0x3818a1-0x0;var _0x465793=_0x317a[_0x3818a1];return _0x465793;};'use strict';var _=require('lodash');var util=require(_0xa317('0x0'));var moment=require(_0xa317('0x1'));var BPromise=require(_0xa317('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa317('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa317('0x4'))('rpc');var config=require(_0xa317('0x5'));var jayson=require(_0xa317('0x6'));var client=jayson[_0xa317('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x249869,_0x1978df,_0x583433){return new BPromise(function(_0x3a867e,_0x4bc390){return client[_0xa317('0x8')](_0x249869,_0x583433)[_0xa317('0x9')](function(_0x2ae5f0){logger[_0xa317('0xa')](_0xa317('0xb'),_0x1978df,_0xa317('0xc'));logger[_0xa317('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1978df,'request\x20sent',JSON['stringify'](_0x2ae5f0));if(_0x2ae5f0[_0xa317('0xe')]){if(_0x2ae5f0['error'][_0xa317('0xf')]===0x1f4){logger[_0xa317('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x1978df,_0x2ae5f0[_0xa317('0xe')][_0xa317('0x10')]);return _0x4bc390(_0x2ae5f0['error']['message']);}logger[_0xa317('0xe')](_0xa317('0xb'),_0x1978df,_0x2ae5f0[_0xa317('0xe')][_0xa317('0x10')]);return _0x3a867e(_0x2ae5f0[_0xa317('0xe')][_0xa317('0x10')]);}else{logger[_0xa317('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x1978df,'request\x20sent');_0x3a867e(_0x2ae5f0['result']['message']);}})[_0xa317('0x11')](function(_0x39f51f){logger[_0xa317('0xe')](_0xa317('0xb'),_0x1978df,_0x39f51f);_0x4bc390(_0x39f51f);});});} \ No newline at end of file +var _0xe03d=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s'];(function(_0x4cf0cb,_0x5db361){var _0x3bc850=function(_0x214abf){while(--_0x214abf){_0x4cf0cb['push'](_0x4cf0cb['shift']());}};_0x3bc850(++_0x5db361);}(_0xe03d,0x1e3));var _0xde03=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xe03d[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xde03('0x0'));var util=require(_0xde03('0x1'));var moment=require(_0xde03('0x2'));var BPromise=require(_0xde03('0x3'));var rs=require(_0xde03('0x4'));var fs=require('fs');var Redis=require(_0xde03('0x5'));var db=require(_0xde03('0x6'))['db'];var utils=require(_0xde03('0x7'));var logger=require('../../config/logger')(_0xde03('0x8'));var config=require(_0xde03('0x9'));var jayson=require(_0xde03('0xa'));var client=jayson['client'][_0xde03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x593f4f,_0xe47e82,_0x1e45cd){return new BPromise(function(_0x1bebb5,_0x2646ac){return client[_0xde03('0xc')](_0x593f4f,_0x1e45cd)[_0xde03('0xd')](function(_0x4b028e){logger['info']('UserChatQueue,\x20%s,\x20%s',_0xe47e82,_0xde03('0xe'));logger[_0xde03('0xf')](_0xde03('0x10'),_0xe47e82,_0xde03('0xe'),JSON[_0xde03('0x11')](_0x4b028e));if(_0x4b028e[_0xde03('0x12')]){if(_0x4b028e['error'][_0xde03('0x13')]===0x1f4){logger['error'](_0xde03('0x14'),_0xe47e82,_0x4b028e[_0xde03('0x12')]['message']);return _0x2646ac(_0x4b028e[_0xde03('0x12')]['message']);}logger[_0xde03('0x12')](_0xde03('0x14'),_0xe47e82,_0x4b028e[_0xde03('0x12')][_0xde03('0x15')]);return _0x1bebb5(_0x4b028e[_0xde03('0x12')][_0xde03('0x15')]);}else{logger[_0xde03('0x16')]('UserChatQueue,\x20%s,\x20%s',_0xe47e82,_0xde03('0xe'));_0x1bebb5(_0x4b028e[_0xde03('0x17')][_0xde03('0x15')]);}})['catch'](function(_0x8cf7c2){logger[_0xde03('0x12')]('UserChatQueue,\x20%s,\x20%s',_0xe47e82,_0x8cf7c2);_0x2646ac(_0x8cf7c2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index edc8afe..2db98b4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3e8df5,_0x2f8452){var _0x5ea8eb=function(_0x4843f2){while(--_0x4843f2){_0x3e8df5['push'](_0x3e8df5['shift']());}};_0x5ea8eb(++_0x2f8452);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0xcb91[_0x4996d5];return _0x4793f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2fc8b9,_0x2843cb){var _0x599fbe=function(_0x45ba2a){while(--_0x45ba2a){_0x2fc8b9['push'](_0x2fc8b9['shift']());}};_0x599fbe(++_0x2843cb);}(_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 e1d6746..1b10691 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 _0xaf4e=['exports','INTEGER','STRING','sequelize'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xaf4e,0x137));var _0xeaf4=function(_0x293e60,_0x4f287c){_0x293e60=_0x293e60-0x0;var _0x2600f7=_0xaf4e[_0x293e60];return _0x2600f7;};'use strict';var Sequelize=require(_0xeaf4('0x0'));module[_0xeaf4('0x1')]={'penalty':{'type':Sequelize[_0xeaf4('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xeaf4('0x3')]}}; \ No newline at end of file +var _0x2349=['exports','INTEGER','STRING','sequelize'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2349,0x12b));var _0x9234=function(_0x2c25c7,_0x57f2d7){_0x2c25c7=_0x2c25c7-0x0;var _0x1e51bd=_0x2349[_0x2c25c7];return _0x1e51bd;};'use strict';var Sequelize=require(_0x9234('0x0'));module[_0x9234('0x1')]={'penalty':{'type':Sequelize[_0x9234('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9234('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9234('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8e3ca1d..85ea68a 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 _0x4179=['../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','api','moment','request-promise','rimraf'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4179,0xe1));var _0x9417=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x4179[_0x223461];return _0x4dbe0a;};'use strict';var _=require(_0x9417('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9417('0x1'));var moment=require(_0x9417('0x2'));var BPromise=require('bluebird');var rp=require(_0x9417('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9417('0x4'));var config=require(_0x9417('0x5'));var attributes=require(_0x9417('0x6'));module['exports']=function(_0x1518ae,_0x4f2605){return _0x1518ae[_0x9417('0x7')](_0x9417('0x8'),attributes,{'tableName':_0x9417('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24a4=['api','moment','path','rimraf','../../config/environment','exports','define','UserFaxQueue','../../config/logger'];(function(_0x5d4db2,_0x39b9f9){var _0x20a09a=function(_0x339a66){while(--_0x339a66){_0x5d4db2['push'](_0x5d4db2['shift']());}};_0x20a09a(++_0x39b9f9);}(_0x24a4,0x116));var _0x424a=function(_0x20c3d9,_0x4fa7ad){_0x20c3d9=_0x20c3d9-0x0;var _0x58b6bb=_0x24a4[_0x20c3d9];return _0x58b6bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x424a('0x0'))(_0x424a('0x1'));var moment=require(_0x424a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x424a('0x3'));var rimraf=require(_0x424a('0x4'));var config=require(_0x424a('0x5'));var attributes=require('./userFaxQueue.attributes');module[_0x424a('0x6')]=function(_0xdfe098,_0x1a86fa){return _0xdfe098[_0x424a('0x7')](_0x424a('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 461acd5..5a9aa3f 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 _0x93e8=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x93e8,0x14b));var _0x893e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x93e8[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x893e('0x0'));var util=require('util');var moment=require(_0x893e('0x1'));var BPromise=require(_0x893e('0x2'));var rs=require(_0x893e('0x3'));var fs=require('fs');var Redis=require(_0x893e('0x4'));var db=require(_0x893e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x893e('0x6'))(_0x893e('0x7'));var config=require(_0x893e('0x8'));var jayson=require(_0x893e('0x9'));var client=jayson[_0x893e('0xa')][_0x893e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf8be90,_0x5bdc5b,_0x24365b){return new BPromise(function(_0x546bc0,_0x133535){return client[_0x893e('0xc')](_0xf8be90,_0x24365b)[_0x893e('0xd')](function(_0x47597f){logger[_0x893e('0xe')](_0x893e('0xf'),_0x5bdc5b,_0x893e('0x10'));logger[_0x893e('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5bdc5b,_0x893e('0x10'),JSON['stringify'](_0x47597f));if(_0x47597f[_0x893e('0x12')]){if(_0x47597f['error'][_0x893e('0x13')]===0x1f4){logger[_0x893e('0x12')](_0x893e('0xf'),_0x5bdc5b,_0x47597f[_0x893e('0x12')][_0x893e('0x14')]);return _0x133535(_0x47597f[_0x893e('0x12')]['message']);}logger[_0x893e('0x12')](_0x893e('0xf'),_0x5bdc5b,_0x47597f[_0x893e('0x12')]['message']);return _0x546bc0(_0x47597f[_0x893e('0x12')][_0x893e('0x14')]);}else{logger['info'](_0x893e('0xf'),_0x5bdc5b,_0x893e('0x10'));_0x546bc0(_0x47597f[_0x893e('0x15')][_0x893e('0x14')]);}})[_0x893e('0x16')](function(_0x4d9456){logger[_0x893e('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x5bdc5b,_0x4d9456);_0x133535(_0x4d9456);});});} \ No newline at end of file +var _0xbef4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x7a92ce,_0x2fca06){var _0x1cec26=function(_0x4f27e9){while(--_0x4f27e9){_0x7a92ce['push'](_0x7a92ce['shift']());}};_0x1cec26(++_0x2fca06);}(_0xbef4,0x119));var _0x4bef=function(_0x3d0366,_0x50211a){_0x3d0366=_0x3d0366-0x0;var _0x5ce75e=_0xbef4[_0x3d0366];return _0x5ce75e;};'use strict';var _=require('lodash');var util=require(_0x4bef('0x0'));var moment=require(_0x4bef('0x1'));var BPromise=require(_0x4bef('0x2'));var rs=require(_0x4bef('0x3'));var fs=require('fs');var Redis=require(_0x4bef('0x4'));var db=require(_0x4bef('0x5'))['db'];var utils=require(_0x4bef('0x6'));var logger=require(_0x4bef('0x7'))(_0x4bef('0x8'));var config=require(_0x4bef('0x9'));var jayson=require(_0x4bef('0xa'));var client=jayson[_0x4bef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335d9c,_0x37a9d6,_0x126557){return new BPromise(function(_0x4178c9,_0x4d8ba5){return client[_0x4bef('0xc')](_0x335d9c,_0x126557)[_0x4bef('0xd')](function(_0x2e2f28){logger[_0x4bef('0xe')](_0x4bef('0xf'),_0x37a9d6,'request\x20sent');logger['debug'](_0x4bef('0x10'),_0x37a9d6,_0x4bef('0x11'),JSON['stringify'](_0x2e2f28));if(_0x2e2f28[_0x4bef('0x12')]){if(_0x2e2f28['error'][_0x4bef('0x13')]===0x1f4){logger[_0x4bef('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x37a9d6,_0x2e2f28[_0x4bef('0x12')][_0x4bef('0x14')]);return _0x4d8ba5(_0x2e2f28[_0x4bef('0x12')][_0x4bef('0x14')]);}logger[_0x4bef('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x37a9d6,_0x2e2f28['error'][_0x4bef('0x14')]);return _0x4178c9(_0x2e2f28['error'][_0x4bef('0x14')]);}else{logger[_0x4bef('0xe')](_0x4bef('0xf'),_0x37a9d6,_0x4bef('0x11'));_0x4178c9(_0x2e2f28['result'][_0x4bef('0x14')]);}})[_0x4bef('0x15')](function(_0x54ae4b){logger[_0x4bef('0x12')](_0x4bef('0xf'),_0x37a9d6,_0x54ae4b);_0x4d8ba5(_0x54ae4b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7897f6f..980984d 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2b45e1,_0x278cc1){var _0x442a3e=function(_0x27713f){while(--_0x27713f){_0x2b45e1['push'](_0x2b45e1['shift']());}};_0x442a3e(++_0x278cc1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xcb91[_0x193e28];return _0x20ef59;};'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(_0x12012d,_0x46e1f6){var _0x2ccaf1=function(_0x3a9488){while(--_0x3a9488){_0x12012d['push'](_0x12012d['shift']());}};_0x2ccaf1(++_0x46e1f6);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 97d0e79..026ba84 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 _0xa67a=['sequelize','exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa67a,0x114));var _0xaa67=function(_0x59b761,_0x141390){_0x59b761=_0x59b761-0x0;var _0x55d8dd=_0xa67a[_0x59b761];return _0x55d8dd;};'use strict';var Sequelize=require(_0xaa67('0x0'));module[_0xaa67('0x1')]={'penalty':{'type':Sequelize[_0xaa67('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x58dc=['INTEGER','exports'];(function(_0x241e94,_0x1d4f63){var _0x1f0263=function(_0x4f97ba){while(--_0x4f97ba){_0x241e94['push'](_0x241e94['shift']());}};_0x1f0263(++_0x1d4f63);}(_0x58dc,0xf1));var _0xc58d=function(_0xe8a3b0,_0x54208f){_0xe8a3b0=_0xe8a3b0-0x0;var _0x21694c=_0x58dc[_0xe8a3b0];return _0x21694c;};'use strict';var Sequelize=require('sequelize');module[_0xc58d('0x0')]={'penalty':{'type':Sequelize[_0xc58d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bb494ef..8591132 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 _0x59b8=['user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define'];(function(_0x5228d1,_0x196b1f){var _0x246048=function(_0x4ca1d4){while(--_0x4ca1d4){_0x5228d1['push'](_0x5228d1['shift']());}};_0x246048(++_0x196b1f);}(_0x59b8,0x114));var _0x859b=function(_0x23229c,_0x12085c){_0x23229c=_0x23229c-0x0;var _0x52b83d=_0x59b8[_0x23229c];return _0x52b83d;};'use strict';var _=require(_0x859b('0x0'));var util=require(_0x859b('0x1'));var logger=require('../../config/logger')(_0x859b('0x2'));var moment=require(_0x859b('0x3'));var BPromise=require(_0x859b('0x4'));var rp=require(_0x859b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x859b('0x6'));var config=require(_0x859b('0x7'));var attributes=require(_0x859b('0x8'));module['exports']=function(_0x38de64,_0x3bc199){return _0x38de64[_0x859b('0x9')]('UserMailQueue',attributes,{'tableName':_0x859b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a11=['./userMailQueue.attributes','exports','UserMailQueue','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x22ee06,_0x39981f){var _0x1d455c=function(_0x2e25e7){while(--_0x2e25e7){_0x22ee06['push'](_0x22ee06['shift']());}};_0x1d455c(++_0x39981f);}(_0x8a11,0x1a5));var _0x18a1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8a11[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x18a1('0x0'));var util=require(_0x18a1('0x1'));var logger=require('../../config/logger')(_0x18a1('0x2'));var moment=require(_0x18a1('0x3'));var BPromise=require(_0x18a1('0x4'));var rp=require(_0x18a1('0x5'));var fs=require('fs');var path=require(_0x18a1('0x6'));var rimraf=require(_0x18a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x18a1('0x8'));module[_0x18a1('0x9')]=function(_0x5bae49,_0xe903f1){return _0x5bae49['define'](_0x18a1('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 07f70db..7251740 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x295304,_0x239e32){var _0x126d70=function(_0x3f8a7c){while(--_0x3f8a7c){_0x295304['push'](_0x295304['shift']());}};_0x126d70(++_0x239e32);}(_0x55ca,0x126));var _0xa55c=function(_0x569b53,_0x3279f6){_0x569b53=_0x569b53-0x0;var _0x467e46=_0x55ca[_0x569b53];return _0x467e46;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x1f98e4,_0x48bb7d){var _0x2838e1=function(_0x63b00f){while(--_0x63b00f){_0x1f98e4['push'](_0x1f98e4['shift']());}};_0x2838e1(++_0x48bb7d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0xf3cd[_0x3fcc20];return _0x15d3ce;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index eb85303..18df7c3 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 _0x20a6=['../../config/environment','post','isAuthenticated','exports','connect-timeout','../../components/auth/service'];(function(_0x4489b6,_0x47c466){var _0x13a4bb=function(_0x25092f){while(--_0x25092f){_0x4489b6['push'](_0x4489b6['shift']());}};_0x13a4bb(++_0x47c466);}(_0x20a6,0x1de));var _0x620a=function(_0x1cfc09,_0x1fa839){_0x1cfc09=_0x1cfc09-0x0;var _0x20b858=_0x20a6[_0x1cfc09];return _0x20b858;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x620a('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x620a('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x620a('0x2'));var controller=require('./userNotification.controller');router[_0x620a('0x3')]('/',auth[_0x620a('0x4')](),controller['sendUserNotification']);module[_0x620a('0x5')]=router; \ No newline at end of file +var _0x1279=['exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification'];(function(_0x31e735,_0xe94abb){var _0x1cd969=function(_0x27ba9c){while(--_0x27ba9c){_0x31e735['push'](_0x31e735['shift']());}};_0x1cd969(++_0xe94abb);}(_0x1279,0x169));var _0x9127=function(_0x1c7959,_0x36ea79){_0x1c7959=_0x1c7959-0x0;var _0x4a1edd=_0x1279[_0x1c7959];return _0x4a1edd;};'use strict';var multer=require(_0x9127('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9127('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9127('0x2'));var interaction=require(_0x9127('0x3'));var config=require(_0x9127('0x4'));var controller=require('./userNotification.controller');router[_0x9127('0x5')]('/',auth[_0x9127('0x6')](),controller[_0x9127('0x7')]);module[_0x9127('0x8')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4dafecf..ff18083 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 _0x50c5=['exports','STRING','TEXT','BOOLEAN','sequelize'];(function(_0x174c00,_0x433e81){var _0x458483=function(_0x11d713){while(--_0x11d713){_0x174c00['push'](_0x174c00['shift']());}};_0x458483(++_0x433e81);}(_0x50c5,0x13a));var _0x550c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50c5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x550c('0x0'));module[_0x550c('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x550c('0x2')]},'recipientsId':{'type':Sequelize[_0x550c('0x3')]},'recipientsDescription':{'type':Sequelize[_0x550c('0x2')]},'beep':{'type':Sequelize[_0x550c('0x4')]}}; \ No newline at end of file +var _0x40d8=['TEXT','sequelize'];(function(_0x5c60fa,_0x1d369d){var _0x3c70a5=function(_0x1dbd67){while(--_0x1dbd67){_0x5c60fa['push'](_0x5c60fa['shift']());}};_0x3c70a5(++_0x1d369d);}(_0x40d8,0x1a5));var _0x840d=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x40d8[_0x154192];return _0x3c2792;};'use strict';var Sequelize=require(_0x840d('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x840d('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 561836c..0aeb06d 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 _0xe425=['mustache','util','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','model','toLowerCase','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','includes','queue','replace','Queue','push','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x56b51f,_0xf20620){var _0x1cb1e4=function(_0x5b247c){while(--_0x5b247c){_0x56b51f['push'](_0x56b51f['shift']());}};_0x1cb1e4(++_0xf20620);}(_0xe425,0x123));var _0x5e42=function(_0x53a9cb,_0x1d7a73){_0x53a9cb=_0x53a9cb-0x0;var _0x4fc163=_0xe425[_0x53a9cb];return _0x4fc163;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e42('0x0'));var zipdir=require(_0x5e42('0x1'));var jsonpatch=require(_0x5e42('0x2'));var rp=require(_0x5e42('0x3'));var moment=require(_0x5e42('0x4'));var BPromise=require(_0x5e42('0x5'));var Mustache=require(_0x5e42('0x6'));var util=require(_0x5e42('0x7'));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(_0x5e42('0x8'));var _=require(_0x5e42('0x9'));var squel=require('squel');var crypto=require(_0x5e42('0xa'));var jsforce=require(_0x5e42('0xb'));var deskjs=require(_0x5e42('0xc'));var toCsv=require(_0x5e42('0xd'));var querystring=require(_0x5e42('0xe'));var Papa=require(_0x5e42('0xf'));var Redis=require(_0x5e42('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5e42('0x11'));var hardwareService=require(_0x5e42('0x12'));var logger=require('../../config/logger')(_0x5e42('0x13'));var utils=require(_0x5e42('0x14'));var config=require(_0x5e42('0x15'));var licenseUtil=require(_0x5e42('0x16'));var db=require(_0x5e42('0x17'))['db'];config[_0x5e42('0x18')]=_['defaults'](config[_0x5e42('0x18')],{'host':_0x5e42('0x19'),'port':0x18eb});var socket=require(_0x5e42('0x1a'))(new Redis(config[_0x5e42('0x18')]));require(_0x5e42('0x1b'))[_0x5e42('0x1c')](socket);function respondWithStatusCode(_0x314088,_0x1cb96e){_0x1cb96e=_0x1cb96e||0xcc;return function(_0x31bb2d){if(_0x31bb2d){return _0x314088['sendStatus'](_0x1cb96e);}return _0x314088['status'](_0x1cb96e)[_0x5e42('0x1d')]();};}function respondWithResult(_0x48b9e3,_0x19a6df){_0x19a6df=_0x19a6df||0xc8;return function(_0x3a9e74){if(_0x3a9e74){return _0x48b9e3[_0x5e42('0x1e')](_0x19a6df)[_0x5e42('0x1f')](_0x3a9e74);}};}function respondWithFilteredResult(_0x33e534,_0x2d4e2){return function(_0x1a1e39){if(_0x1a1e39){var _0x34009c=typeof _0x2d4e2[_0x5e42('0x20')]===_0x5e42('0x21')&&typeof _0x2d4e2[_0x5e42('0x22')]===_0x5e42('0x21');var _0x122ad0=_0x1a1e39[_0x5e42('0x23')];var _0x779d0f=_0x34009c?0x0:_0x2d4e2[_0x5e42('0x20')];var _0x344465=_0x34009c?_0x1a1e39[_0x5e42('0x23')]:_0x2d4e2[_0x5e42('0x20')]+_0x2d4e2[_0x5e42('0x22')];var _0x4ef3f5;if(_0x344465>=_0x122ad0){_0x344465=_0x122ad0;_0x4ef3f5=0xc8;}else{_0x4ef3f5=0xce;}_0x33e534[_0x5e42('0x1e')](_0x4ef3f5);return _0x33e534[_0x5e42('0x24')](_0x5e42('0x25'),_0x779d0f+'-'+_0x344465+'/'+_0x122ad0)['json'](_0x1a1e39);}return null;};}function patchUpdates(_0x816fef){return function(_0x498d28){try{jsonpatch[_0x5e42('0x26')](_0x498d28,_0x816fef,!![]);}catch(_0x36df39){return BPromise[_0x5e42('0x27')](_0x36df39);}return _0x498d28['save']();};}function saveUpdates(_0x5bdfc0,_0x24a79c){return function(_0x50cbfc){if(_0x50cbfc){return _0x50cbfc[_0x5e42('0x28')](_0x5bdfc0)[_0x5e42('0x29')](function(_0x135f90){return _0x135f90;});}return null;};}function removeEntity(_0x19352e,_0x4d18e3){return function(_0x17dfd3){if(_0x17dfd3){return _0x17dfd3[_0x5e42('0x2a')]()[_0x5e42('0x29')](function(){_0x19352e['status'](0xcc)[_0x5e42('0x1d')]();});}};}function handleEntityNotFound(_0x385c0a,_0xed8a8f){return function(_0x17847c){if(!_0x17847c){_0x385c0a['sendStatus'](0x194);}return _0x17847c;};}function handleError(_0xf94e18,_0x4e203c){_0x4e203c=_0x4e203c||0x1f4;return function(_0x38b856){logger[_0x5e42('0x2b')](_0x38b856['stack']);if(_0x38b856[_0x5e42('0x2c')]){delete _0x38b856[_0x5e42('0x2c')];}_0xf94e18[_0x5e42('0x1e')](_0x4e203c)['send'](_0x38b856);};}exports[_0x5e42('0x2d')]=function(_0x5788a8,_0x3ec81c,_0x44c1b1){if(!_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x2f')](_0x5e42('0x30'))&&!_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x2f')]('TemplateId')){throw new db[(_0x5e42('0x31'))][(_0x5e42('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x5788a8[_0x5e42('0x2e')]['hasOwnProperty'](_0x5e42('0x33'))&&!_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x2f')](_0x5e42('0x34'))){throw new db[(_0x5e42('0x31'))][(_0x5e42('0x32'))](_0x5e42('0x35'));}if(!_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x2f')](_0x5e42('0x36'))){throw new db[(_0x5e42('0x31'))][(_0x5e42('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2ca1dd=JSON['parse'](_0x5788a8[_0x5e42('0x2e')]['recipients']);}catch(_0x1e0c3f){logger['error'](_0x1e0c3f);throw new db[(_0x5e42('0x31'))][(_0x5e42('0x32'))](_0x5e42('0x37'));}var _0xec5131=[_0x5e42('0x38'),_0x5e42('0x39'),_0x5e42('0x3a'),_0x5e42('0x3b'),_0x5e42('0x3c'),'voicequeue',_0x5e42('0x3d'),_0x5e42('0x3e'),_0x5e42('0x3f')];if(_[_0x5e42('0x40')](_0x2ca1dd,function(_0x28770f){return!_['includes'](_0xec5131,_0x28770f[_0x5e42('0x41')][_0x5e42('0x42')]());})){throw new db[(_0x5e42('0x31'))][(_0x5e42('0x32'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5bc705={};_0x5bc705[_0x5e42('0x43')]=_0x5788a8['body'][_0x5e42('0x2f')](_0x5e42('0x43'))?_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x43')]:_0x5788a8[_0x5e42('0x3f')]['fullname'];_0x5bc705[_0x5e42('0x44')]=_[_0x5e42('0x45')](_0x5788a8[_0x5e42('0x2e')]['recipientsDescription'])?null:_0x5788a8['body'][_0x5e42('0x44')];_0x5bc705[_0x5e42('0x46')]=_0x5788a8[_0x5e42('0x2e')][_0x5e42('0x46')]||![];_0x5bc705[_0x5e42('0x47')]=_0x5788a8['user']['id'];return getContent(_0x5788a8[_0x5e42('0x2e')])['then'](function(_0x3f33ce){_0x5bc705['body']=_0x3f33ce;return getRecipients(_0x2ca1dd);})[_0x5e42('0x29')](function(_0x43b245){_0x5bc705[_0x5e42('0x48')]=_[_0x5e42('0x49')](_0x43b245)[_0x5e42('0x4a')](',');return db[_0x5e42('0x4b')][_0x5e42('0x4c')](function(_0xcd5a47){return db[_0x5e42('0x4d')]['create'](_0x5bc705,{'raw':!![],'transaction':_0xcd5a47})['then'](function(_0x372bee){var _0x15e4f9={'sender':_0x5bc705[_0x5e42('0x43')],'description':_0x5bc705[_0x5e42('0x44')],'content':_0x5bc705[_0x5e42('0x2e')],'beep':_0x5bc705[_0x5e42('0x46')]};_0x43b245[_0x5e42('0x4e')](function(_0xef9542){_0x15e4f9[_0x5e42('0x4f')]=_0xef9542;socket[_0x5e42('0x50')](_0x5e42('0x51'),_0x15e4f9);});return _0x372bee;});});})['then'](respondWithResult(_0x3ec81c,0xc9))['catch'](handleError(_0x3ec81c,null));};function getContent(_0x5c25b3){return new BPromise(function(_0x509489,_0x4b6f98){if(_0x5c25b3[_0x5e42('0x30')]){_0x509489(_0x5c25b3[_0x5e42('0x30')]);return;}return db[_0x5e42('0x52')][_0x5e42('0x53')]({'attributes':[_0x5e42('0x54')],'where':{'id':_0x5c25b3[_0x5e42('0x33')]},'raw':!![]})[_0x5e42('0x29')](function(_0x425434){if(!_0x425434)throw new db[(_0x5e42('0x31'))]['ValidationError'](_0x5e42('0x55'));var _0x138dcd=Mustache[_0x5e42('0x56')](_0x425434[_0x5e42('0x54')],_0x5c25b3[_0x5e42('0x34')]);_0x509489(_0x138dcd);})[_0x5e42('0x57')](function(_0x5eb626){_0x4b6f98(_0x5eb626);});});}function getRecipients(_0x3e6114){return new BPromise(function(_0x272a95,_0x3c4400){var _0x2b39e0=[];var _0x45ef58=[];_0x3e6114[_0x5e42('0x4e')](function(_0xe0b3cc){var _0x33146b=_[_0x5e42('0x58')](_0xe0b3cc[_0x5e42('0x41')]['toLowerCase']());if(_0x33146b===_0x5e42('0x59')){_0x2b39e0=_[_0x5e42('0x5a')](_0x2b39e0,_0xe0b3cc[_0x5e42('0x5b')]);}else{if(_[_0x5e42('0x5c')](_0x33146b,_0x5e42('0x5d')))_0x33146b=_0x33146b[_0x5e42('0x5e')](_0x5e42('0x5d'),_0x5e42('0x5f'));_0xe0b3cc['ids'][_0x5e42('0x4e')](function(_0x450173){_0x45ef58[_0x5e42('0x60')](getAgents(_0x33146b,_0x450173));});}});return BPromise['all'](_0x45ef58)[_0x5e42('0x29')](function(_0x251959){_0x2b39e0=_[_0x5e42('0x5a')](_0x2b39e0,_['flatten'](_0x251959));_0x272a95(_0x2b39e0);})[_0x5e42('0x57')](function(_0x5866a1){_0x3c4400(_0x5866a1);});});}function getAgents(_0x486f54,_0x515e4b){return new BPromise(function(_0x178acb,_0x1d7343){return db[_0x486f54]['findOne']({'where':{'id':_0x515e4b}})[_0x5e42('0x29')](function(_0x2507fe){return _0x2507fe[_0x5e42('0x61')]({'attributes':['id'],'raw':!![]})['then'](function(_0x570da2){var _0x25cab1=_[_0x5e42('0x62')](_0x570da2,'id');_0x178acb(_0x25cab1);});})[_0x5e42('0x57')](function(_0xad3c0f){_0x1d7343(_0xad3c0f);});});} \ No newline at end of file +var _0x86f0=['recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','render','html','startCase','User','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','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','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','isEmpty'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x86f0,0x1a3));var _0x086f=function(_0x664895,_0xa51de0){_0x664895=_0x664895-0x0;var _0x44381f=_0x86f0[_0x664895];return _0x44381f;};'use strict';var emlformat=require(_0x086f('0x0'));var rimraf=require(_0x086f('0x1'));var zipdir=require(_0x086f('0x2'));var jsonpatch=require(_0x086f('0x3'));var rp=require(_0x086f('0x4'));var moment=require(_0x086f('0x5'));var BPromise=require(_0x086f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x086f('0x7'));var sox=require(_0x086f('0x8'));var csv=require(_0x086f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x086f('0xa'));var _=require(_0x086f('0xb'));var squel=require('squel');var crypto=require(_0x086f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x086f('0xd'));var toCsv=require(_0x086f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x086f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x086f('0xf'));var as=require(_0x086f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x086f('0x11'))(_0x086f('0x12'));var utils=require(_0x086f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x086f('0x14'));var db=require(_0x086f('0x15'))['db'];config[_0x086f('0x16')]=_[_0x086f('0x17')](config['redis'],{'host':_0x086f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x086f('0x16')]));require(_0x086f('0x19'))['register'](socket);function respondWithStatusCode(_0x409c52,_0x4b4ebd){_0x4b4ebd=_0x4b4ebd||0xcc;return function(_0x262ee5){if(_0x262ee5){return _0x409c52['sendStatus'](_0x4b4ebd);}return _0x409c52['status'](_0x4b4ebd)[_0x086f('0x1a')]();};}function respondWithResult(_0x523b81,_0x5ac1e6){_0x5ac1e6=_0x5ac1e6||0xc8;return function(_0x2c80a6){if(_0x2c80a6){return _0x523b81[_0x086f('0x1b')](_0x5ac1e6)[_0x086f('0x1c')](_0x2c80a6);}};}function respondWithFilteredResult(_0x94d89,_0x2992fd){return function(_0x33cca9){if(_0x33cca9){var _0xb8fb29=typeof _0x2992fd[_0x086f('0x1d')]===_0x086f('0x1e')&&typeof _0x2992fd[_0x086f('0x1f')]===_0x086f('0x1e');var _0x10fbfc=_0x33cca9['count'];var _0x46180d=_0xb8fb29?0x0:_0x2992fd['offset'];var _0x34c9d1=_0xb8fb29?_0x33cca9[_0x086f('0x20')]:_0x2992fd[_0x086f('0x1d')]+_0x2992fd[_0x086f('0x1f')];var _0x5f33bc;if(_0x34c9d1>=_0x10fbfc){_0x34c9d1=_0x10fbfc;_0x5f33bc=0xc8;}else{_0x5f33bc=0xce;}_0x94d89[_0x086f('0x1b')](_0x5f33bc);return _0x94d89[_0x086f('0x21')](_0x086f('0x22'),_0x46180d+'-'+_0x34c9d1+'/'+_0x10fbfc)['json'](_0x33cca9);}return null;};}function patchUpdates(_0x3f858b){return function(_0x4dfdf3){try{jsonpatch[_0x086f('0x23')](_0x4dfdf3,_0x3f858b,!![]);}catch(_0x64c77c){return BPromise['reject'](_0x64c77c);}return _0x4dfdf3[_0x086f('0x24')]();};}function saveUpdates(_0x57694a,_0x1bc83f){return function(_0x36c812){if(_0x36c812){return _0x36c812[_0x086f('0x25')](_0x57694a)['then'](function(_0x1f9aef){return _0x1f9aef;});}return null;};}function removeEntity(_0x462017,_0xd9f0c9){return function(_0x5b486c){if(_0x5b486c){return _0x5b486c[_0x086f('0x26')]()[_0x086f('0x27')](function(){_0x462017[_0x086f('0x1b')](0xcc)[_0x086f('0x1a')]();});}};}function handleEntityNotFound(_0x2255ee,_0x357911){return function(_0x3196e8){if(!_0x3196e8){_0x2255ee[_0x086f('0x28')](0x194);}return _0x3196e8;};}function handleError(_0x41e585,_0x559ee9){_0x559ee9=_0x559ee9||0x1f4;return function(_0x48feb7){logger['error'](_0x48feb7[_0x086f('0x29')]);if(_0x48feb7[_0x086f('0x2a')]){delete _0x48feb7[_0x086f('0x2a')];}_0x41e585[_0x086f('0x1b')](_0x559ee9)[_0x086f('0x2b')](_0x48feb7);};}exports['sendUserNotification']=function(_0x32b6c7,_0x130860,_0x15da30){if(!_0x32b6c7[_0x086f('0x2c')][_0x086f('0x2d')](_0x086f('0x2e'))&&!_0x32b6c7[_0x086f('0x2c')]['hasOwnProperty'](_0x086f('0x2f'))){throw new db[(_0x086f('0x30'))][(_0x086f('0x31'))](_0x086f('0x32'));}else{if(_0x32b6c7[_0x086f('0x2c')]['hasOwnProperty'](_0x086f('0x2f'))&&!_0x32b6c7[_0x086f('0x2c')][_0x086f('0x2d')](_0x086f('0x33'))){throw new db[(_0x086f('0x30'))][(_0x086f('0x31'))](_0x086f('0x34'));}if(!_0x32b6c7['body'][_0x086f('0x2d')]('recipients')){throw new db['Sequelize'][(_0x086f('0x31'))](_0x086f('0x35'));}else{try{var _0x48b7f2=JSON[_0x086f('0x36')](_0x32b6c7[_0x086f('0x2c')][_0x086f('0x37')]);}catch(_0x254b9a){logger[_0x086f('0x38')](_0x254b9a);throw new db[(_0x086f('0x30'))][(_0x086f('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x482890=[_0x086f('0x39'),_0x086f('0x3a'),'mailqueue',_0x086f('0x3b'),_0x086f('0x3c'),_0x086f('0x3d'),_0x086f('0x3e'),_0x086f('0x3f'),_0x086f('0x40')];if(_[_0x086f('0x41')](_0x48b7f2,function(_0xf21661){return!_[_0x086f('0x42')](_0x482890,_0xf21661[_0x086f('0x43')][_0x086f('0x44')]());})){throw new db['Sequelize']['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4e1298={};_0x4e1298['senderName']=_0x32b6c7[_0x086f('0x2c')][_0x086f('0x2d')](_0x086f('0x45'))?_0x32b6c7[_0x086f('0x2c')][_0x086f('0x45')]:_0x32b6c7[_0x086f('0x40')]['fullname'];_0x4e1298['recipientsDescription']=_[_0x086f('0x46')](_0x32b6c7[_0x086f('0x2c')][_0x086f('0x47')])?null:_0x32b6c7['body'][_0x086f('0x47')];_0x4e1298[_0x086f('0x48')]=_0x32b6c7[_0x086f('0x2c')][_0x086f('0x48')]||![];_0x4e1298[_0x086f('0x49')]=_0x32b6c7['user']['id'];return getContent(_0x32b6c7['body'])[_0x086f('0x27')](function(_0x2829e3){_0x4e1298[_0x086f('0x2c')]=_0x2829e3;return getRecipients(_0x48b7f2);})[_0x086f('0x27')](function(_0x1211d2){_0x4e1298[_0x086f('0x4a')]=_[_0x086f('0x4b')](_0x1211d2)['join'](',');return db[_0x086f('0x4c')]['transaction'](function(_0x304e92){return db[_0x086f('0x4d')][_0x086f('0x4e')](_0x4e1298,{'raw':!![],'transaction':_0x304e92})['then'](function(_0x2d6039){var _0x16564b={'sender':_0x4e1298['senderName'],'description':_0x4e1298['recipientsDescription'],'content':_0x4e1298[_0x086f('0x2c')],'beep':_0x4e1298['beep']};_0x1211d2[_0x086f('0x4f')](function(_0xc46c62){_0x16564b[_0x086f('0x50')]=_0xc46c62;socket['emit'](_0x086f('0x51'),_0x16564b);});return _0x2d6039;});});})[_0x086f('0x27')](respondWithResult(_0x130860,0xc9))[_0x086f('0x52')](handleError(_0x130860,null));};function getContent(_0x4eb64a){return new BPromise(function(_0x4575bb,_0x18d15){if(_0x4eb64a[_0x086f('0x2e')]){_0x4575bb(_0x4eb64a[_0x086f('0x2e')]);return;}return db[_0x086f('0x53')][_0x086f('0x54')]({'attributes':['html'],'where':{'id':_0x4eb64a[_0x086f('0x2f')]},'raw':!![]})[_0x086f('0x27')](function(_0x192ff7){if(!_0x192ff7)throw new db['Sequelize'][(_0x086f('0x31'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x90334=Mustache[_0x086f('0x55')](_0x192ff7[_0x086f('0x56')],_0x4eb64a[_0x086f('0x33')]);_0x4575bb(_0x90334);})['catch'](function(_0x448b86){_0x18d15(_0x448b86);});});}function getRecipients(_0x49ceb2){return new BPromise(function(_0x3cb8d7,_0x19b162){var _0x45560c=[];var _0x36001c=[];_0x49ceb2['forEach'](function(_0x25f4b0){var _0x389d5b=_[_0x086f('0x57')](_0x25f4b0[_0x086f('0x43')][_0x086f('0x44')]());if(_0x389d5b===_0x086f('0x58')){_0x45560c=_[_0x086f('0x59')](_0x45560c,_0x25f4b0[_0x086f('0x5a')]);}else{if(_[_0x086f('0x42')](_0x389d5b,_0x086f('0x5b')))_0x389d5b=_0x389d5b[_0x086f('0x5c')](_0x086f('0x5b'),_0x086f('0x5d'));_0x25f4b0['ids']['forEach'](function(_0x38c381){_0x36001c[_0x086f('0x5e')](getAgents(_0x389d5b,_0x38c381));});}});return BPromise[_0x086f('0x5f')](_0x36001c)['then'](function(_0x56c58b){_0x45560c=_[_0x086f('0x59')](_0x45560c,_['flatten'](_0x56c58b));_0x3cb8d7(_0x45560c);})[_0x086f('0x52')](function(_0x592e62){_0x19b162(_0x592e62);});});}function getAgents(_0x1b4272,_0x3161d9){return new BPromise(function(_0x5bc65c,_0x3de7dc){return db[_0x1b4272][_0x086f('0x54')]({'where':{'id':_0x3161d9}})['then'](function(_0x301726){return _0x301726[_0x086f('0x60')]({'attributes':['id'],'raw':!![]})[_0x086f('0x27')](function(_0x107715){var _0x1a6eb7=_[_0x086f('0x61')](_0x107715,'id');_0x5bc65c(_0x1a6eb7);});})[_0x086f('0x52')](function(_0x57efe9){_0x3de7dc(_0x57efe9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 98ed683..4c3bca0 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 _0x2751=['remove','emit','UserNotification','setMaxListeners','update'];(function(_0x30f68d,_0x12cb44){var _0x4ac6bf=function(_0x15da9c){while(--_0x15da9c){_0x30f68d['push'](_0x30f68d['shift']());}};_0x4ac6bf(++_0x12cb44);}(_0x2751,0xb6));var _0x1275=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2751[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0x1275('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1275('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1275('0x2'),'afterDestroy':_0x1275('0x3')};function emitEvent(_0x17d747){return function(_0x32b5f1,_0x20227e,_0xbe37d2){UserNotificationEvents[_0x1275('0x4')](_0x17d747+':'+_0x32b5f1['id'],_0x32b5f1);UserNotificationEvents[_0x1275('0x4')](_0x17d747,_0x32b5f1);_0xbe37d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xfef7=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','save','update'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xfef7,0x1cc));var _0x7fef=function(_0x2b010c,_0x2a7bc5){_0x2b010c=_0x2b010c-0x0;var _0x36470e=_0xfef7[_0x2b010c];return _0x36470e;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x7fef('0x0'))['db'][_0x7fef('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7fef('0x2'),'afterUpdate':_0x7fef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1c6360){return function(_0x3484c7,_0x2c7dab,_0x5dc6e2){UserNotificationEvents['emit'](_0x1c6360+':'+_0x3484c7['id'],_0x3484c7);UserNotificationEvents[_0x7fef('0x4')](_0x1c6360,_0x3484c7);_0x5dc6e2(null);};}for(var e in events){if(events[_0x7fef('0x5')](e)){var event=events[e];UserNotification[_0x7fef('0x6')](e,emitEvent(event));}}module[_0x7fef('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 810ece7..660bb5e 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 _0x4fa1=['userNotifications','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./userNotification.attributes','define','UserNotification'];(function(_0x372047,_0x7f5c2b){var _0x44f282=function(_0x5a3d1c){while(--_0x5a3d1c){_0x372047['push'](_0x372047['shift']());}};_0x44f282(++_0x7f5c2b);}(_0x4fa1,0xb1));var _0x14fa=function(_0x1febca,_0x52926d){_0x1febca=_0x1febca-0x0;var _0x10d120=_0x4fa1[_0x1febca];return _0x10d120;};'use strict';var _=require(_0x14fa('0x0'));var util=require(_0x14fa('0x1'));var logger=require(_0x14fa('0x2'))(_0x14fa('0x3'));var moment=require('moment');var BPromise=require(_0x14fa('0x4'));var rp=require(_0x14fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14fa('0x6'));var config=require('../../config/environment');var attributes=require(_0x14fa('0x7'));module['exports']=function(_0x3b1ce4,_0x36608a){return _0x3b1ce4[_0x14fa('0x8')](_0x14fa('0x9'),attributes,{'tableName':_0x14fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4784=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./userNotification.attributes','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x28e188,_0x2630f3){var _0x463ecc=function(_0x2f0e79){while(--_0x2f0e79){_0x28e188['push'](_0x28e188['shift']());}};_0x463ecc(++_0x2630f3);}(_0x4784,0x14f));var _0x4478=function(_0x431110,_0x520a59){_0x431110=_0x431110-0x0;var _0x4b4ccf=_0x4784[_0x431110];return _0x4b4ccf;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var logger=require(_0x4478('0x2'))('api');var moment=require(_0x4478('0x3'));var BPromise=require(_0x4478('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4478('0x5'));var config=require(_0x4478('0x6'));var attributes=require(_0x4478('0x7'));module['exports']=function(_0x5757a8,_0x59e92e){return _0x5757a8[_0x4478('0x8')]('UserNotification',attributes,{'tableName':_0x4478('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4478('0xa'),'collate':_0x4478('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index a9a2417..e6c7266 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 _0x6804=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1ccdf4,_0x3fb494){var _0x448045=function(_0x4b722f){while(--_0x4b722f){_0x1ccdf4['push'](_0x1ccdf4['shift']());}};_0x448045(++_0x3fb494);}(_0x6804,0x192));var _0x4680=function(_0x34256d,_0x21ed7e){_0x34256d=_0x34256d-0x0;var _0x4a85c8=_0x6804[_0x34256d];return _0x4a85c8;};'use strict';var _=require(_0x4680('0x0'));var util=require(_0x4680('0x1'));var moment=require('moment');var BPromise=require(_0x4680('0x2'));var rs=require(_0x4680('0x3'));var fs=require('fs');var Redis=require(_0x4680('0x4'));var db=require(_0x4680('0x5'))['db'];var utils=require(_0x4680('0x6'));var logger=require(_0x4680('0x7'))(_0x4680('0x8'));var config=require(_0x4680('0x9'));var jayson=require(_0x4680('0xa'));var client=jayson[_0x4680('0xb')][_0x4680('0xc')]({'port':0x232a});config[_0x4680('0xd')]=_[_0x4680('0xe')](config[_0x4680('0xd')],{'host':_0x4680('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4680('0xd')]));require(_0x4680('0x10'))[_0x4680('0x11')](socket);function respondWithRpcPromise(_0x4fc1d8,_0x5750d0,_0x253989){return new BPromise(function(_0x361df1,_0x45387d){return client[_0x4680('0x12')](_0x4fc1d8,_0x253989)[_0x4680('0x13')](function(_0x5397e1){logger[_0x4680('0x14')](_0x4680('0x15'),_0x5750d0,_0x4680('0x16'));logger[_0x4680('0x17')](_0x4680('0x18'),_0x5750d0,_0x4680('0x16'),JSON[_0x4680('0x19')](_0x5397e1));if(_0x5397e1[_0x4680('0x1a')]){if(_0x5397e1[_0x4680('0x1a')][_0x4680('0x1b')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x5750d0,_0x5397e1[_0x4680('0x1a')][_0x4680('0x1c')]);return _0x45387d(_0x5397e1['error'][_0x4680('0x1c')]);}logger[_0x4680('0x1a')]('UserNotification,\x20%s,\x20%s',_0x5750d0,_0x5397e1[_0x4680('0x1a')][_0x4680('0x1c')]);return _0x361df1(_0x5397e1['error'][_0x4680('0x1c')]);}else{logger[_0x4680('0x14')]('UserNotification,\x20%s,\x20%s',_0x5750d0,'request\x20sent');_0x361df1(_0x5397e1[_0x4680('0x1d')][_0x4680('0x1c')]);}})[_0x4680('0x1e')](function(_0x47810e){logger[_0x4680('0x1a')](_0x4680('0x15'),_0x5750d0,_0x47810e);_0x45387d(_0x47810e);});});} \ No newline at end of file +var _0xd706=['message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x569ce3,_0x2324ff){var _0x3c01f5=function(_0xf58546){while(--_0xf58546){_0x569ce3['push'](_0x569ce3['shift']());}};_0x3c01f5(++_0x2324ff);}(_0xd706,0x16d));var _0x6d70=function(_0x334dc8,_0x434cd9){_0x334dc8=_0x334dc8-0x0;var _0x3d5a15=_0xd706[_0x334dc8];return _0x3d5a15;};'use strict';var _=require('lodash');var util=require(_0x6d70('0x0'));var moment=require(_0x6d70('0x1'));var BPromise=require(_0x6d70('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d70('0x3'));var db=require(_0x6d70('0x4'))['db'];var utils=require(_0x6d70('0x5'));var logger=require(_0x6d70('0x6'))(_0x6d70('0x7'));var config=require(_0x6d70('0x8'));var jayson=require(_0x6d70('0x9'));var client=jayson[_0x6d70('0xa')][_0x6d70('0xb')]({'port':0x232a});config[_0x6d70('0xc')]=_['defaults'](config[_0x6d70('0xc')],{'host':_0x6d70('0xd'),'port':0x18eb});var socket=require(_0x6d70('0xe'))(new Redis(config[_0x6d70('0xc')]));require(_0x6d70('0xf'))[_0x6d70('0x10')](socket);function respondWithRpcPromise(_0x21c888,_0x423d57,_0x31e86f){return new BPromise(function(_0x393a70,_0x3afb35){return client[_0x6d70('0x11')](_0x21c888,_0x31e86f)[_0x6d70('0x12')](function(_0x5261f3){logger[_0x6d70('0x13')](_0x6d70('0x14'),_0x423d57,_0x6d70('0x15'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x423d57,_0x6d70('0x15'),JSON[_0x6d70('0x16')](_0x5261f3));if(_0x5261f3[_0x6d70('0x17')]){if(_0x5261f3[_0x6d70('0x17')][_0x6d70('0x18')]===0x1f4){logger[_0x6d70('0x17')]('UserNotification,\x20%s,\x20%s',_0x423d57,_0x5261f3['error']['message']);return _0x3afb35(_0x5261f3[_0x6d70('0x17')][_0x6d70('0x19')]);}logger[_0x6d70('0x17')](_0x6d70('0x14'),_0x423d57,_0x5261f3[_0x6d70('0x17')][_0x6d70('0x19')]);return _0x393a70(_0x5261f3[_0x6d70('0x17')][_0x6d70('0x19')]);}else{logger[_0x6d70('0x13')]('UserNotification,\x20%s,\x20%s',_0x423d57,_0x6d70('0x15'));_0x393a70(_0x5261f3['result'][_0x6d70('0x19')]);}})['catch'](function(_0x430d35){logger['error']('UserNotification,\x20%s,\x20%s',_0x423d57,_0x430d35);_0x3afb35(_0x430d35);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 59c1c8c..27d6ae4 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 _0x0978=['removeListener','register','userNotification:','./userNotification.events','save','remove','update'];(function(_0x2ae78f,_0x599052){var _0x28674c=function(_0x42d5b4){while(--_0x42d5b4){_0x2ae78f['push'](_0x2ae78f['shift']());}};_0x28674c(++_0x599052);}(_0x0978,0x1a7));var _0x8097=function(_0x420acf,_0x5adfdf){_0x420acf=_0x420acf-0x0;var _0x6e3f56=_0x0978[_0x420acf];return _0x6e3f56;};'use strict';var UserNotificationEvents=require(_0x8097('0x0'));var events=[_0x8097('0x1'),_0x8097('0x2'),_0x8097('0x3')];function createListener(_0x20d1b7,_0x1c2c56){return function(_0x10fe1b){_0x1c2c56['emit'](_0x20d1b7,_0x10fe1b);};}function removeListener(_0xdeb247,_0x31f69f){return function(){UserNotificationEvents[_0x8097('0x4')](_0xdeb247,_0x31f69f);};}exports[_0x8097('0x5')]=function(_0x24a610){for(var _0x1fd69f=0x0,_0x553596=events['length'];_0x1fd69f<_0x553596;_0x1fd69f++){var _0xdf6779=events[_0x1fd69f];var _0x357b88=createListener(_0x8097('0x6')+_0xdf6779,_0x24a610);UserNotificationEvents['on'](_0xdf6779,_0x357b88);}}; \ No newline at end of file +var _0x0ca0=['length','./userNotification.events','save','remove','emit'];(function(_0xcd45fe,_0x2f8c3a){var _0x55ff31=function(_0x3c6dc2){while(--_0x3c6dc2){_0xcd45fe['push'](_0xcd45fe['shift']());}};_0x55ff31(++_0x2f8c3a);}(_0x0ca0,0xf1));var _0x00ca=function(_0x344c31,_0x60d141){_0x344c31=_0x344c31-0x0;var _0x3da7b5=_0x0ca0[_0x344c31];return _0x3da7b5;};'use strict';var UserNotificationEvents=require(_0x00ca('0x0'));var events=[_0x00ca('0x1'),_0x00ca('0x2'),'update'];function createListener(_0x58dae9,_0xfa3e43){return function(_0x450721){_0xfa3e43[_0x00ca('0x3')](_0x58dae9,_0x450721);};}function removeListener(_0x2d0bfa,_0x4a1d0a){return function(){UserNotificationEvents['removeListener'](_0x2d0bfa,_0x4a1d0a);};}exports['register']=function(_0x4b0145){for(var _0x1599d7=0x0,_0x2d7f0c=events[_0x00ca('0x4')];_0x1599d7<_0x2d7f0c;_0x1599d7++){var _0x4ae78e=events[_0x1599d7];var _0x3f0199=createListener('userNotification:'+_0x4ae78e,_0x4b0145);UserNotificationEvents['on'](_0x4ae78e,_0x3f0199);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4608981..afdcf3c 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1c4f4a,_0x1b254c){var _0x1e6a1b=function(_0x169c0b){while(--_0x169c0b){_0x1c4f4a['push'](_0x1c4f4a['shift']());}};_0x1e6a1b(++_0x1b254c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2a1c1c,_0x2c664e){var _0xbf4766=function(_0x1b951e){while(--_0x1b951e){_0x2a1c1c['push'](_0x2a1c1c['shift']());}};_0xbf4766(++_0x2c664e);}(_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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d74b8ba..5a08a8d 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 _0xe86b=['INTEGER','sequelize','exports'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0xe86b,0x1c9));var _0xbe86=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe86b[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xbe86('0x0'));module[_0xbe86('0x1')]={'penalty':{'type':Sequelize[_0xbe86('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x805b=['exports','INTEGER','sequelize'];(function(_0x2b77ec,_0x1e9650){var _0x56bbb4=function(_0x216134){while(--_0x216134){_0x2b77ec['push'](_0x2b77ec['shift']());}};_0x56bbb4(++_0x1e9650);}(_0x805b,0xad));var _0xb805=function(_0x31fc0c,_0x3705f7){_0x31fc0c=_0x31fc0c-0x0;var _0x6b0214=_0x805b[_0x31fc0c];return _0x6b0214;};'use strict';var Sequelize=require(_0xb805('0x0'));module[_0xb805('0x1')]={'penalty':{'type':Sequelize[_0xb805('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index eac53bf..3ce34f9 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 _0x32ce=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x32ce,0x81));var _0xe32c=function(_0x542941,_0x2143e2){_0x542941=_0x542941-0x0;var _0xfdf71c=_0x32ce[_0x542941];return _0xfdf71c;};'use strict';var _=require(_0xe32c('0x0'));var util=require(_0xe32c('0x1'));var logger=require(_0xe32c('0x2'))(_0xe32c('0x3'));var moment=require('moment');var BPromise=require(_0xe32c('0x4'));var rp=require(_0xe32c('0x5'));var fs=require('fs');var path=require(_0xe32c('0x6'));var rimraf=require(_0xe32c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe32c('0x8'));module[_0xe32c('0x9')]=function(_0x541dfc,_0x123562){return _0x541dfc[_0xe32c('0xa')](_0xe32c('0xb'),attributes,{'tableName':_0xe32c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x60ce=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x26eb7f,_0x15f735){var _0x5a166b=function(_0x242da0){while(--_0x242da0){_0x26eb7f['push'](_0x26eb7f['shift']());}};_0x5a166b(++_0x15f735);}(_0x60ce,0x17c));var _0xe60c=function(_0x2c3aab,_0x1dd5fe){_0x2c3aab=_0x2c3aab-0x0;var _0x591a13=_0x60ce[_0x2c3aab];return _0x591a13;};'use strict';var _=require(_0xe60c('0x0'));var util=require(_0xe60c('0x1'));var logger=require(_0xe60c('0x2'))(_0xe60c('0x3'));var moment=require(_0xe60c('0x4'));var BPromise=require(_0xe60c('0x5'));var rp=require(_0xe60c('0x6'));var fs=require('fs');var path=require(_0xe60c('0x7'));var rimraf=require('rimraf');var config=require(_0xe60c('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xe60c('0x9')]=function(_0x1bc93e,_0x7d3336){return _0x1bc93e[_0xe60c('0xa')](_0xe60c('0xb'),attributes,{'tableName':_0xe60c('0xc'),'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 e5e503f..d321931 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 _0x3ccd=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x27536b,_0x4ba663){var _0x4f9506=function(_0x3031bc){while(--_0x3031bc){_0x27536b['push'](_0x27536b['shift']());}};_0x4f9506(++_0x4ba663);}(_0x3ccd,0x1cc));var _0xd3cc=function(_0x502f2d,_0x2b02c9){_0x502f2d=_0x502f2d-0x0;var _0x49dc26=_0x3ccd[_0x502f2d];return _0x49dc26;};'use strict';var _=require(_0xd3cc('0x0'));var util=require(_0xd3cc('0x1'));var moment=require(_0xd3cc('0x2'));var BPromise=require(_0xd3cc('0x3'));var rs=require(_0xd3cc('0x4'));var fs=require('fs');var Redis=require(_0xd3cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3cc('0x6'))(_0xd3cc('0x7'));var config=require(_0xd3cc('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5997cf,_0x35d642,_0x22b454){return new BPromise(function(_0x4ebe8d,_0x520670){return client[_0xd3cc('0x9')](_0x5997cf,_0x22b454)[_0xd3cc('0xa')](function(_0x585818){logger[_0xd3cc('0xb')](_0xd3cc('0xc'),_0x35d642,'request\x20sent');logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x35d642,_0xd3cc('0xd'),JSON[_0xd3cc('0xe')](_0x585818));if(_0x585818[_0xd3cc('0xf')]){if(_0x585818[_0xd3cc('0xf')][_0xd3cc('0x10')]===0x1f4){logger[_0xd3cc('0xf')](_0xd3cc('0xc'),_0x35d642,_0x585818['error'][_0xd3cc('0x11')]);return _0x520670(_0x585818[_0xd3cc('0xf')][_0xd3cc('0x11')]);}logger[_0xd3cc('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x35d642,_0x585818[_0xd3cc('0xf')]['message']);return _0x4ebe8d(_0x585818[_0xd3cc('0xf')][_0xd3cc('0x11')]);}else{logger[_0xd3cc('0xb')](_0xd3cc('0xc'),_0x35d642,_0xd3cc('0xd'));_0x4ebe8d(_0x585818[_0xd3cc('0x12')][_0xd3cc('0x11')]);}})[_0xd3cc('0x13')](function(_0xf01bbc){logger[_0xd3cc('0xf')](_0xd3cc('0xc'),_0x35d642,_0xf01bbc);_0x520670(_0xf01bbc);});});} \ No newline at end of file +var _0xd6b6=['message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd6b6,0x143));var _0x6d6b=function(_0x3d25e3,_0x44b0b7){_0x3d25e3=_0x3d25e3-0x0;var _0x1d1669=_0xd6b6[_0x3d25e3];return _0x1d1669;};'use strict';var _=require('lodash');var util=require(_0x6d6b('0x0'));var moment=require('moment');var BPromise=require(_0x6d6b('0x1'));var rs=require(_0x6d6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d6b('0x3'))['db'];var utils=require(_0x6d6b('0x4'));var logger=require(_0x6d6b('0x5'))('rpc');var config=require(_0x6d6b('0x6'));var jayson=require(_0x6d6b('0x7'));var client=jayson[_0x6d6b('0x8')][_0x6d6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b8ae3,_0x631c91,_0x19ad76){return new BPromise(function(_0x552715,_0x1a287d){return client[_0x6d6b('0xa')](_0x1b8ae3,_0x19ad76)[_0x6d6b('0xb')](function(_0x1daff6){logger['info'](_0x6d6b('0xc'),_0x631c91,'request\x20sent');logger['debug'](_0x6d6b('0xd'),_0x631c91,_0x6d6b('0xe'),JSON['stringify'](_0x1daff6));if(_0x1daff6[_0x6d6b('0xf')]){if(_0x1daff6[_0x6d6b('0xf')][_0x6d6b('0x10')]===0x1f4){logger[_0x6d6b('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x631c91,_0x1daff6[_0x6d6b('0xf')][_0x6d6b('0x11')]);return _0x1a287d(_0x1daff6[_0x6d6b('0xf')][_0x6d6b('0x11')]);}logger[_0x6d6b('0xf')](_0x6d6b('0xc'),_0x631c91,_0x1daff6[_0x6d6b('0xf')]['message']);return _0x552715(_0x1daff6[_0x6d6b('0xf')][_0x6d6b('0x11')]);}else{logger['info'](_0x6d6b('0xc'),_0x631c91,'request\x20sent');_0x552715(_0x1daff6[_0x6d6b('0x12')][_0x6d6b('0x11')]);}})[_0x6d6b('0x13')](function(_0x54a745){logger['error'](_0x6d6b('0xc'),_0x631c91,_0x54a745);_0x1a287d(_0x54a745);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8f16561..cb59928 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 _0xfc7f=['fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','describe','show','getSections','/:id/resources','getResources','post','/:id/clone','/:id/sections','addSections','addResources','/:id','update','delete','removeSections','removeResources','exports','util','express'];(function(_0x539fa4,_0x1ff26b){var _0x448794=function(_0xea52fa){while(--_0xea52fa){_0x539fa4['push'](_0x539fa4['shift']());}};_0x448794(++_0x1ff26b);}(_0xfc7f,0xf8));var _0xffc7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfc7f[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xffc7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xffc7('0x1'));var router=express['Router']();var fs_extra=require(_0xffc7('0x2'));var auth=require(_0xffc7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xffc7('0x4'));var controller=require(_0xffc7('0x5'));router[_0xffc7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xffc7('0x6')](_0xffc7('0x7'),auth[_0xffc7('0x8')](),controller[_0xffc7('0x9')]);router[_0xffc7('0x6')]('/:id',auth[_0xffc7('0x8')](),controller[_0xffc7('0xa')]);router[_0xffc7('0x6')]('/:id/sections',auth[_0xffc7('0x8')](),controller[_0xffc7('0xb')]);router[_0xffc7('0x6')](_0xffc7('0xc'),auth['isAuthenticated'](),controller[_0xffc7('0xd')]);router[_0xffc7('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xffc7('0xf'),auth[_0xffc7('0x8')](),controller['clone']);router[_0xffc7('0xe')](_0xffc7('0x10'),auth['isAuthenticated'](),controller[_0xffc7('0x11')]);router[_0xffc7('0xe')]('/:id/resources',auth['isAuthenticated'](),controller[_0xffc7('0x12')]);router['put'](_0xffc7('0x13'),auth[_0xffc7('0x8')](),controller[_0xffc7('0x14')]);router[_0xffc7('0x15')](_0xffc7('0x13'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0xffc7('0x16')]);router[_0xffc7('0x15')](_0xffc7('0xc'),auth[_0xffc7('0x8')](),controller[_0xffc7('0x17')]);module[_0xffc7('0x18')]=router; \ No newline at end of file +var _0x0fe1=['/:id/resources','getResources','post','create','clone','addSections','update','destroy','delete','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','getSections'];(function(_0x19ba83,_0xcfe491){var _0x5e1ec3=function(_0x6506b1){while(--_0x6506b1){_0x19ba83['push'](_0x19ba83['shift']());}};_0x5e1ec3(++_0xcfe491);}(_0x0fe1,0x19f));var _0x10fe=function(_0x3bda64,_0xbcdc32){_0x3bda64=_0x3bda64-0x0;var _0x184d63=_0x0fe1[_0x3bda64];return _0x184d63;};'use strict';var multer=require(_0x10fe('0x0'));var util=require(_0x10fe('0x1'));var path=require(_0x10fe('0x2'));var timeout=require(_0x10fe('0x3'));var express=require(_0x10fe('0x4'));var router=express[_0x10fe('0x5')]();var fs_extra=require(_0x10fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x10fe('0x7'));var config=require(_0x10fe('0x8'));var controller=require('./userProfile.controller');router[_0x10fe('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x10fe('0x9')](_0x10fe('0xa'),auth[_0x10fe('0xb')](),controller[_0x10fe('0xc')]);router[_0x10fe('0x9')](_0x10fe('0xd'),auth[_0x10fe('0xb')](),controller[_0x10fe('0xe')]);router['get'](_0x10fe('0xf'),auth['isAuthenticated'](),controller[_0x10fe('0x10')]);router['get'](_0x10fe('0x11'),auth['isAuthenticated'](),controller[_0x10fe('0x12')]);router[_0x10fe('0x13')]('/',auth[_0x10fe('0xb')](),controller[_0x10fe('0x14')]);router['post']('/:id/clone',auth[_0x10fe('0xb')](),controller[_0x10fe('0x15')]);router['post'](_0x10fe('0xf'),auth['isAuthenticated'](),controller[_0x10fe('0x16')]);router[_0x10fe('0x13')](_0x10fe('0x11'),auth[_0x10fe('0xb')](),controller['addResources']);router['put'](_0x10fe('0xd'),auth['isAuthenticated'](),controller[_0x10fe('0x17')]);router['delete'](_0x10fe('0xd'),auth[_0x10fe('0xb')](),controller[_0x10fe('0x18')]);router[_0x10fe('0x19')](_0x10fe('0xf'),auth[_0x10fe('0xb')](),controller['removeSections']);router['delete'](_0x10fe('0x11'),auth[_0x10fe('0xb')](),controller[_0x10fe('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 4c02cf2..2438581 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 _0x9be0=['crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x43d55b,_0x114d79){var _0x5e55c3=function(_0x1544b9){while(--_0x1544b9){_0x43d55b['push'](_0x43d55b['shift']());}};_0x5e55c3(++_0x114d79);}(_0x9be0,0x16d));var _0x09be=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9be0[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x09be('0x0'));module[_0x09be('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x09be('0x2')],'set':function(_0x4f9b00){this[_0x09be('0x3')](_0x09be('0x4'),_0x4f9b00?_0x4f9b00[_0x09be('0x5')](''):[]);},'get':function(){return this[_0x09be('0x6')]('crudPermissions')?this[_0x09be('0x6')](_0x09be('0x4'))[_0x09be('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x09be('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x09be('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x09be('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x09be('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x09be('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x09be('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2522=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x114928,_0x28316a){var _0x5b87a5=function(_0x4a2e17){while(--_0x4a2e17){_0x114928['push'](_0x114928['shift']());}};_0x5b87a5(++_0x28316a);}(_0x2522,0x1b0));var _0x2252=function(_0x296287,_0x329a90){_0x296287=_0x296287-0x0;var _0x5c8515=_0x2522[_0x296287];return _0x5c8515;};'use strict';var Sequelize=require(_0x2252('0x0'));module[_0x2252('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x2252('0x2')],'set':function(_0x46a876){this[_0x2252('0x3')](_0x2252('0x4'),_0x46a876?_0x46a876[_0x2252('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x2252('0x4'))?this[_0x2252('0x6')](_0x2252('0x4'))[_0x2252('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x2252('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x2252('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x2252('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x2252('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2252('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x2252('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2252('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index dcb21f2..28afdd9 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 _0x6db4=['findAll','rows','catch','show','params','find','create','body','clone','omit','updatedAt','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','UserProfileSection','push','removeSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','then','destroy','error','stack','name','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include'];(function(_0x1b844a,_0x2c3126){var _0x55883=function(_0xb3928b){while(--_0xb3928b){_0x1b844a['push'](_0x1b844a['shift']());}};_0x55883(++_0x2c3126);}(_0x6db4,0x111));var _0x46db=function(_0x53de2f,_0xfd4891){_0x53de2f=_0x53de2f-0x0;var _0x15a2fb=_0x6db4[_0x53de2f];return _0x15a2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46db('0x0'));var zipdir=require(_0x46db('0x1'));var jsonpatch=require(_0x46db('0x2'));var rp=require(_0x46db('0x3'));var moment=require(_0x46db('0x4'));var BPromise=require(_0x46db('0x5'));var Mustache=require('mustache');var util=require(_0x46db('0x6'));var path=require(_0x46db('0x7'));var sox=require(_0x46db('0x8'));var csv=require(_0x46db('0x9'));var ejs=require(_0x46db('0xa'));var fs=require('fs');var fs_extra=require(_0x46db('0xb'));var _=require(_0x46db('0xc'));var squel=require('squel');var crypto=require(_0x46db('0xd'));var jsforce=require(_0x46db('0xe'));var deskjs=require(_0x46db('0xf'));var toCsv=require(_0x46db('0x9'));var querystring=require(_0x46db('0x10'));var Papa=require(_0x46db('0x11'));var Redis=require(_0x46db('0x12'));var authService=require(_0x46db('0x13'));var qs=require(_0x46db('0x14'));var as=require(_0x46db('0x15'));var hardwareService=require(_0x46db('0x16'));var logger=require(_0x46db('0x17'))('api');var utils=require(_0x46db('0x18'));var config=require(_0x46db('0x19'));var licenseUtil=require(_0x46db('0x1a'));var db=require(_0x46db('0x1b'))['db'];config[_0x46db('0x1c')]=_[_0x46db('0x1d')](config[_0x46db('0x1c')],{'host':_0x46db('0x1e'),'port':0x18eb});var socket=require(_0x46db('0x1f'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x417caf,_0xed8db9){_0xed8db9=_0xed8db9||0xcc;return function(_0x5c982c){if(_0x5c982c){return _0x417caf[_0x46db('0x20')](_0xed8db9);}return _0x417caf['status'](_0xed8db9)[_0x46db('0x21')]();};}function respondWithResult(_0x5dccf9,_0x12976b){_0x12976b=_0x12976b||0xc8;return function(_0x41a0bc){if(_0x41a0bc){return _0x5dccf9['status'](_0x12976b)[_0x46db('0x22')](_0x41a0bc);}};}function respondWithFilteredResult(_0x1e6b13,_0x422c86){return function(_0x32c5ef){if(_0x32c5ef){var _0x1e24e6=typeof _0x422c86[_0x46db('0x23')]===_0x46db('0x24')&&typeof _0x422c86[_0x46db('0x25')]==='undefined';var _0x27cfcf=_0x32c5ef[_0x46db('0x26')];var _0x1e0beb=_0x1e24e6?0x0:_0x422c86['offset'];var _0x521b93=_0x1e24e6?_0x32c5ef['count']:_0x422c86['offset']+_0x422c86[_0x46db('0x25')];var _0x270f8d;if(_0x521b93>=_0x27cfcf){_0x521b93=_0x27cfcf;_0x270f8d=0xc8;}else{_0x270f8d=0xce;}_0x1e6b13[_0x46db('0x27')](_0x270f8d);return _0x1e6b13['set']('Content-Range',_0x1e0beb+'-'+_0x521b93+'/'+_0x27cfcf)[_0x46db('0x22')](_0x32c5ef);}return null;};}function patchUpdates(_0x3601e4){return function(_0x1156c4){try{jsonpatch[_0x46db('0x28')](_0x1156c4,_0x3601e4,!![]);}catch(_0x443651){return BPromise[_0x46db('0x29')](_0x443651);}return _0x1156c4[_0x46db('0x2a')]();};}function saveUpdates(_0x3a50dd,_0x4708df){return function(_0x7bcdf5){if(_0x7bcdf5){return _0x7bcdf5['update'](_0x3a50dd)[_0x46db('0x2b')](function(_0x149e66){return _0x149e66;});}return null;};}function removeEntity(_0x1e7acc,_0x408b9f){return function(_0x448aff){if(_0x448aff){return _0x448aff[_0x46db('0x2c')]()['then'](function(){_0x1e7acc[_0x46db('0x27')](0xcc)[_0x46db('0x21')]();});}};}function handleEntityNotFound(_0x1a3855,_0x4e9bf5){return function(_0x131d75){if(!_0x131d75){_0x1a3855[_0x46db('0x20')](0x194);}return _0x131d75;};}function handleError(_0x346b0c,_0xb9f5e3){_0xb9f5e3=_0xb9f5e3||0x1f4;return function(_0x367195){logger[_0x46db('0x2d')](_0x367195[_0x46db('0x2e')]);if(_0x367195[_0x46db('0x2f')]){delete _0x367195[_0x46db('0x2f')];}_0x346b0c[_0x46db('0x27')](_0xb9f5e3)['send'](_0x367195);};}exports[_0x46db('0x30')]=function(_0x1d5f86,_0x531ef2){var _0xd92990={},_0xd836d4={},_0x2fd094={'count':0x0,'rows':[]};var _0x401cea=_[_0x46db('0x31')](db[_0x46db('0x32')][_0x46db('0x33')],function(_0x45604c){return{'name':_0x45604c[_0x46db('0x34')],'type':_0x45604c[_0x46db('0x35')][_0x46db('0x36')]};});_0xd836d4[_0x46db('0x37')]=_['map'](_0x401cea,'name');_0xd836d4[_0x46db('0x38')]=_[_0x46db('0x39')](_0x1d5f86[_0x46db('0x38')]);_0xd836d4['filters']=_[_0x46db('0x3a')](_0xd836d4[_0x46db('0x37')],_0xd836d4['query']);_0xd92990[_0x46db('0x3b')]=_[_0x46db('0x3a')](_0xd836d4[_0x46db('0x37')],qs[_0x46db('0x3c')](_0x1d5f86[_0x46db('0x38')]['fields']));_0xd92990['attributes']=_0xd92990[_0x46db('0x3b')][_0x46db('0x3d')]?_0xd92990[_0x46db('0x3b')]:_0xd836d4[_0x46db('0x37')];if(!_0x1d5f86[_0x46db('0x38')]['hasOwnProperty'](_0x46db('0x3e'))){_0xd92990[_0x46db('0x25')]=qs[_0x46db('0x25')](_0x1d5f86['query']['limit']);_0xd92990[_0x46db('0x23')]=qs[_0x46db('0x23')](_0x1d5f86[_0x46db('0x38')][_0x46db('0x23')]);}_0xd92990[_0x46db('0x3f')]=qs[_0x46db('0x40')](_0x1d5f86['query']['sort']);_0xd92990[_0x46db('0x41')]=qs[_0x46db('0x42')](_['pick'](_0x1d5f86[_0x46db('0x38')],_0xd836d4['filters']),_0x401cea);if(_0x1d5f86[_0x46db('0x38')]['filter']){_0xd92990[_0x46db('0x41')]=_[_0x46db('0x43')](_0xd92990[_0x46db('0x41')],{'$or':_[_0x46db('0x31')](_0x401cea,function(_0x4a6894){if(_0x4a6894['type']!=='VIRTUAL'){var _0x208ff5={};_0x208ff5[_0x4a6894[_0x46db('0x2f')]]={'$like':'%'+_0x1d5f86[_0x46db('0x38')][_0x46db('0x44')]+'%'};return _0x208ff5;}})});}_0xd92990=_['merge']({},_0xd92990,_0x1d5f86[_0x46db('0x45')]);var _0x265050={'where':_0xd92990[_0x46db('0x41')]};return db[_0x46db('0x32')][_0x46db('0x26')](_0x265050)[_0x46db('0x2b')](function(_0x3f31e1){_0x2fd094[_0x46db('0x26')]=_0x3f31e1;if(_0x1d5f86[_0x46db('0x38')][_0x46db('0x46')]){_0xd92990[_0x46db('0x47')]=[{'all':!![]}];}return db[_0x46db('0x32')][_0x46db('0x48')](_0xd92990);})[_0x46db('0x2b')](function(_0x1e9cde){_0x2fd094[_0x46db('0x49')]=_0x1e9cde;return _0x2fd094;})['then'](respondWithFilteredResult(_0x531ef2,_0xd92990))[_0x46db('0x4a')](handleError(_0x531ef2,null));};exports[_0x46db('0x4b')]=function(_0x1042b0,_0x3d479f){var _0x28141d={'raw':![],'where':{'id':_0x1042b0[_0x46db('0x4c')]['id']}},_0x53d253={};_0x53d253[_0x46db('0x37')]=_[_0x46db('0x39')](db[_0x46db('0x32')][_0x46db('0x33')]);_0x53d253[_0x46db('0x38')]=_[_0x46db('0x39')](_0x1042b0[_0x46db('0x38')]);_0x53d253['filters']=_['intersection'](_0x53d253[_0x46db('0x37')],_0x53d253[_0x46db('0x38')]);_0x28141d[_0x46db('0x3b')]=_[_0x46db('0x3a')](_0x53d253['model'],qs[_0x46db('0x3c')](_0x1042b0[_0x46db('0x38')][_0x46db('0x3c')]));_0x28141d[_0x46db('0x3b')]=_0x28141d[_0x46db('0x3b')][_0x46db('0x3d')]?_0x28141d[_0x46db('0x3b')]:_0x53d253[_0x46db('0x37')];if(_0x1042b0[_0x46db('0x38')][_0x46db('0x46')]){_0x28141d['include']=[{'all':!![]}];}_0x28141d=_[_0x46db('0x43')]({},_0x28141d,_0x1042b0['options']);return db[_0x46db('0x32')][_0x46db('0x4d')](_0x28141d)[_0x46db('0x2b')](handleEntityNotFound(_0x3d479f,null))[_0x46db('0x2b')](respondWithResult(_0x3d479f,null))[_0x46db('0x4a')](handleError(_0x3d479f,null));};exports['create']=function(_0xa4dd63,_0xd469f){return db['UserProfile'][_0x46db('0x4e')](_0xa4dd63[_0x46db('0x4f')],{})['then'](respondWithResult(_0xd469f,0xc9))[_0x46db('0x4a')](handleError(_0xd469f,null));};exports[_0x46db('0x50')]=function(_0x4c4892,_0x55ba77){var _0x573e48={'where':{'id':_0x4c4892[_0x46db('0x4c')]['id']}},_0x5a1469={};_0x5a1469['model']=_[_0x46db('0x39')](db[_0x46db('0x32')][_0x46db('0x33')]);_0x573e48['attributes']=_[_0x46db('0x3a')](_0x5a1469[_0x46db('0x37')],qs[_0x46db('0x3c')](_0x4c4892[_0x46db('0x38')]['fields']));_0x573e48[_0x46db('0x3b')]=_0x573e48[_0x46db('0x3b')]['length']?_0x573e48['attributes']:_0x5a1469['model'];if(_0x4c4892[_0x46db('0x38')]['includeAll']){_0x573e48[_0x46db('0x47')]=[{'all':!![]}];}_0x573e48=_[_0x46db('0x43')]({},_0x573e48,_0x4c4892[_0x46db('0x45')]);return db['UserProfile'][_0x46db('0x4d')](_0x573e48)[_0x46db('0x2b')](handleEntityNotFound(_0x55ba77,null))[_0x46db('0x2b')](function(_0x2d75bf){if(_0x2d75bf){var _0x178de5=_0x2d75bf['get']({'plain':!![]});_0x178de5=qs[_0x46db('0x51')](_0x178de5,['id','createdAt',_0x46db('0x52'),'crudPermissions']);_0x4c4892[_0x46db('0x4f')]=_[_0x46db('0x51')](_0x4c4892[_0x46db('0x4f')],['id',_0x46db('0x53'),'updatedAt']);return db[_0x46db('0x54')][_0x46db('0x55')](function(_0x31df60){return db['UserProfile']['create'](_[_0x46db('0x43')](_0x178de5,_0x4c4892[_0x46db('0x4f')]),{'include':_0x4c4892['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x31df60})[_0x46db('0x2b')](function(_0x982ccf){var _0x2614a0=_0x982ccf[_0x46db('0x56')]({'plain':!![]});return db['UserProfileSection'][_0x46db('0x48')]({'where':{'userProfileId':_0x4c4892[_0x46db('0x4c')]['id']},'raw':!![]})[_0x46db('0x2b')](function(_0x55fc21){if(_0x55fc21){return BPromise[_0x46db('0x57')](_0x55fc21,function(_0x4d1e1a){return new BPromise(function(_0x5082c0,_0x25289a){if(_0x4d1e1a[_0x46db('0x58')]===null||_0x4d1e1a[_0x46db('0x58')]===0x1)_0x5082c0(null);return db[_0x46db('0x59')][_0x46db('0x48')]({'where':{'sectionId':_0x4d1e1a['id']},'raw':!![]})[_0x46db('0x2b')](function(_0x3ceaed){var _0x92438c=_[_0x46db('0x31')](_0x3ceaed,function(_0x5c5826){return qs['omit'](_0x5c5826,['id','createdAt','updatedAt',_0x46db('0x5a')]);});_0x5082c0(_0x92438c);})[_0x46db('0x4a')](function(_0x37fd3e){_0x25289a(_0x37fd3e);});})[_0x46db('0x2b')](function(_0x4acc5a){var _0xa8d88a=qs[_0x46db('0x51')](_0x4d1e1a,['id','createdAt',_0x46db('0x52')]);_0xa8d88a[_0x46db('0x5b')]=_0x2614a0['id'];if(_0x4acc5a)_0xa8d88a[_0x46db('0x5c')]=_0x4acc5a;return _0xa8d88a;})[_0x46db('0x2b')](function(_0x9bc317){return db['UserProfileSection']['create'](_0x9bc317,{'include':[{'model':db[_0x46db('0x59')],'as':_0x46db('0x5c')}],'raw':!![],'transaction':_0x31df60});});})[_0x46db('0x2b')](function(){return _0x2614a0;});}});});});}})[_0x46db('0x2b')](respondWithResult(_0x55ba77,0xc9))[_0x46db('0x4a')](handleError(_0x55ba77,null));};exports['update']=function(_0x36b38e,_0x162e50){if(_0x36b38e[_0x46db('0x4f')]['id']){delete _0x36b38e[_0x46db('0x4f')]['id'];}return db['UserProfile'][_0x46db('0x4d')]({'where':{'id':_0x36b38e[_0x46db('0x4c')]['id']}})[_0x46db('0x2b')](handleEntityNotFound(_0x162e50,null))[_0x46db('0x2b')](saveUpdates(_0x36b38e[_0x46db('0x4f')],null))['then'](respondWithResult(_0x162e50,null))[_0x46db('0x4a')](handleError(_0x162e50,null));};exports[_0x46db('0x2c')]=function(_0x447b85,_0x20f914){return db[_0x46db('0x32')][_0x46db('0x4d')]({'where':{'id':_0x447b85[_0x46db('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20f914,null))[_0x46db('0x2b')](removeEntity(_0x20f914,null))[_0x46db('0x4a')](handleError(_0x20f914,null));};exports[_0x46db('0x5d')]=function(_0x3ffa8d,_0x5afd09){return db['UserProfile']['describe']()['then'](respondWithResult(_0x5afd09,null))[_0x46db('0x4a')](handleError(_0x5afd09,null));};exports[_0x46db('0x5e')]=function(_0x2bba34,_0x25a69c){var _0x3d7fad=_0x2bba34[_0x46db('0x4f')];return db['UserProfile'][_0x46db('0x4d')]({'where':{'id':_0x2bba34[_0x46db('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25a69c,null))[_0x46db('0x2b')](function(_0x4b1089){if(_0x4b1089){return db[_0x46db('0x54')]['transaction'](function(_0x337d9a){return db[_0x46db('0x5f')][_0x46db('0x2c')]({'where':{'userProfileId':_0x2bba34[_0x46db('0x4c')]['id'],'sectionId':_['map'](_0x3d7fad,function(_0x2ae3a4){return _0x2ae3a4[_0x46db('0x5a')];})},'transaction':_0x337d9a})['then'](function(){var _0x2758b9=_['map'](_0x3d7fad,function(_0xe35119){_0xe35119['userProfileId']=_0x2bba34[_0x46db('0x4c')]['id'];return _0xe35119;});var _0xaed8a5=[];return BPromise[_0x46db('0x57')](_0x2758b9,function(_0x3b9a16){return db[_0x46db('0x5f')][_0x46db('0x4e')](_0x3b9a16,{'include':[{'model':db[_0x46db('0x59')],'as':_0x46db('0x5c')}],'raw':!![],'transaction':_0x337d9a})[_0x46db('0x2b')](function(_0x1d539a){_0xaed8a5[_0x46db('0x60')](_0x1d539a[_0x46db('0x56')]({'plain':!![]}));});})['then'](function(){return _0xaed8a5;});});});}})[_0x46db('0x2b')](function(_0x480f62){return _0x480f62;})[_0x46db('0x2b')](respondWithResult(_0x25a69c,null))['catch'](handleError(_0x25a69c,null));};exports[_0x46db('0x61')]=function(_0x40b6f0,_0x94c211){var _0xef9f7b;return db[_0x46db('0x32')][_0x46db('0x4d')]({'where':{'id':_0x40b6f0[_0x46db('0x4c')]['id']},'attributes':['id',_0x46db('0x2f')]})[_0x46db('0x2b')](handleEntityNotFound(_0x94c211,null))[_0x46db('0x2b')](function(_0x270bdb){if(_0x270bdb){_0xef9f7b=_0x270bdb;return db[_0x46db('0x5f')][_0x46db('0x2c')]({'where':{'userProfileId':_0x40b6f0[_0x46db('0x4c')]['id'],'sectionId':_0x40b6f0[_0x46db('0x38')]['ids']}});}})['then'](function(){return _0xef9f7b;})[_0x46db('0x2b')](respondWithStatusCode(_0x94c211,null))[_0x46db('0x4a')](handleError(_0x94c211,null));};exports['getSections']=function(_0x415f7e,_0x4b3cfa){var _0x30c54a=[];var _0x31572c=[];return db[_0x46db('0x5f')]['findAll']({'where':{'userProfileId':_0x415f7e['params']['id']},'raw':!![]})[_0x46db('0x2b')](function(_0xb9a7df){_0x30c54a=_[_0x46db('0x44')](_0xb9a7df,function(_0x1903be){return _0x1903be[_0x46db('0x62')]===0x1||_[_0x46db('0x63')]([0x3eb,0x709],_0x1903be[_0x46db('0x5a')]);});if(!_[_0x46db('0x64')](_0x30c54a)){return _[_0x46db('0x31')](_0x30c54a,function(_0x249744){return _0x249744[_0x46db('0x5a')];});}else{return;}})['then'](function(_0xbe99ac){if(_0xbe99ac)_0x31572c=_0xbe99ac;if(_['includes'](_0x31572c,0x64)){var _0x34ac25=_[_0x46db('0x4d')](_0x30c54a,{'sectionId':0x64});return hasDefaultDashboard(_0x34ac25)[_0x46db('0x2b')](function(_0x46a4fa){return _[_0x46db('0x31')](_0x30c54a,function(_0x4c976a){if(_0x4c976a[_0x46db('0x5a')]===0x64){_0x4c976a[_0x46db('0x65')]=_0x46a4fa;}return _0x4c976a;});});}else{return;}})[_0x46db('0x2b')](function(_0x223539){if(_0x223539)_0x30c54a=_0x223539;if(_[_0x46db('0x63')](_0x31572c,0x3eb)){var _0x97f613=_[_0x46db('0x4d')](_0x30c54a,{'sectionId':0x3eb});return getCustomDashboards(_0x97f613)[_0x46db('0x2b')](function(_0x5ef702){return _[_0x46db('0x31')](_0x30c54a,function(_0x1c3bfd){if(_0x97f613[_0x46db('0x62')]){if(_0x1c3bfd[_0x46db('0x5a')]===0x3eb){_0x1c3bfd[_0x46db('0x65')]=_0x5ef702;}}else{if(_0x1c3bfd['sectionId']===0x64){_0x1c3bfd[_0x46db('0x65')]=_0x5ef702;}}return _0x1c3bfd;});});}else{return;}})[_0x46db('0x2b')](function(_0x3835b8){if(_0x3835b8)_0x30c54a=_0x3835b8;if(_[_0x46db('0x63')](_0x31572c,0x709)){var _0x407ddf=_['find'](_0x30c54a,{'sectionId':0x709});return getPlugins(_0x407ddf)['then'](function(_0x3e8ad6){if(_0x407ddf[_0x46db('0x62')]){return _[_0x46db('0x31')](_0x30c54a,function(_0x5ca70e){if(_0x5ca70e[_0x46db('0x5a')]===0x709){_0x5ca70e[_0x46db('0x65')]=_0x3e8ad6;}return _0x5ca70e;});}else{var _0x4b3e85={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3e8ad6};var _0xdeb43f=_['map'](_0x30c54a);_0xdeb43f[_0x46db('0x60')](_0x4b3e85);return _0xdeb43f;}});}else{return;}})[_0x46db('0x2b')](function(_0x39d6d7){if(_0x39d6d7)_0x30c54a=_0x39d6d7;return _[_0x46db('0x44')](_0x30c54a,['enabled',0x1]);})[_0x46db('0x2b')](respondWithResult(_0x4b3cfa,null))[_0x46db('0x4a')](handleError(_0x4b3cfa,null));};function hasDefaultDashboard(_0x4ab88a){var _0x19e94b=[0x65];return new BPromise(function(_0x1c3b2e,_0x273bf4){try{if(_0x4ab88a['autoAssociation']){_0x1c3b2e(_0x19e94b);}else{return db[_0x46db('0x59')][_0x46db('0x66')]({'where':{'sectionId':_0x4ab88a['id']},'raw':!![]})[_0x46db('0x2b')](function(_0x25ca0a){_0x25ca0a?_0x1c3b2e(_0x19e94b):_0x1c3b2e();});}}catch(_0x1eb672){_0x273bf4(_0x1eb672);}});}function getCustomDashboards(_0x222e99){var _0x560968=[];return new BPromise(function(_0x1a1ad9,_0x2f734d){try{if(_0x222e99[_0x46db('0x58')]){return db[_0x46db('0x67')][_0x46db('0x48')]({'raw':!![]})[_0x46db('0x2b')](function(_0x33ad58){_0x33ad58['forEach'](function(_0x3a242a){_0x560968[_0x46db('0x60')](_0x3a242a['id']+0x1869f);});_0x1a1ad9(_0x560968);});}else{return db[_0x46db('0x59')][_0x46db('0x48')]({'where':{'sectionId':_0x222e99['id']},'raw':!![]})['then'](function(_0x226d31){_0x226d31['forEach'](function(_0x544b6a){_0x560968[_0x46db('0x60')](_0x544b6a[_0x46db('0x68')]+0x1869f);});_0x1a1ad9(_0x560968);});}}catch(_0x46ae11){_0x2f734d(_0x46ae11);}});}function getPlugins(_0x54012f){var _0x5dcce9=[];return new BPromise(function(_0x53a51b,_0x1be762){try{if(_0x54012f[_0x46db('0x58')]){return db[_0x46db('0x69')][_0x46db('0x48')]({'raw':!![]})[_0x46db('0x2b')](function(_0xedae84){_0xedae84[_0x46db('0x6a')](function(_0x30a9ac){_0x5dcce9[_0x46db('0x60')](_0x30a9ac['id']+0x15b38);});_0x53a51b(_0x5dcce9);});}else{return db[_0x46db('0x59')]['findAll']({'where':{'sectionId':_0x54012f['id']},'raw':!![]})[_0x46db('0x2b')](function(_0x28c171){_0x28c171[_0x46db('0x6a')](function(_0x5ea0e7){_0x5dcce9[_0x46db('0x60')](_0x5ea0e7[_0x46db('0x68')]+0x15b38);});_0x53a51b(_0x5dcce9);});}}catch(_0x39bcb6){_0x1be762(_0x39bcb6);}});}exports[_0x46db('0x6b')]=function(_0x48c577,_0x2b3675){return db[_0x46db('0x32')][_0x46db('0x4d')]({'where':{'id':_0x48c577['params']['id']}})['then'](handleEntityNotFound(_0x2b3675,null))[_0x46db('0x2b')](function(_0x193e4a){if(_0x193e4a){return db[_0x46db('0x54')][_0x46db('0x55')](function(_0x302272){return db[_0x46db('0x5f')][_0x46db('0x48')]({'where':{'userProfileId':_0x48c577[_0x46db('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0x46db('0x2b')](function(_0x3dc85c){if(_0x3dc85c){return db[_0x46db('0x5f')][_0x46db('0x2c')]({'where':{'userProfileId':_0x48c577[_0x46db('0x4c')]['id'],'id':_['map'](_0x3dc85c,function(_0x239350){return _0x239350['id'];})},'transaction':_0x302272});}})[_0x46db('0x2b')](function(_0x1cb5ae){var _0x3819f0=_['map'](_0x48c577[_0x46db('0x4f')],function(_0x1bf5ee){_0x1bf5ee[_0x46db('0x5b')]=_0x48c577[_0x46db('0x4c')]['id'];return _0x1bf5ee;});return db[_0x46db('0x5f')][_0x46db('0x6c')](_0x3819f0,{'raw':!![],'transaction':_0x302272});})['then'](function(_0x101a37){var _0x4ff40d=_[_0x46db('0x44')](_['map'](_0x101a37,function(_0x4650b6){return _0x4650b6['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4ff40d){return db[_0x46db('0x5f')][_0x46db('0x48')]({'where':{'userProfileId':_0x48c577[_0x46db('0x4c')]['id'],'sectionId':_[_0x46db('0x31')](_0x4ff40d,function(_0x2a8a6f){return _0x2a8a6f[_0x46db('0x5a')];})},'attributes':['id',_0x46db('0x5a')],'raw':!![]})[_0x46db('0x2b')](function(_0x456cb3){var _0x24da5c=_[_0x46db('0x31')](_0x48c577[_0x46db('0x4f')],function(_0x1933b9){_0x1933b9[_0x46db('0x5b')]=_0x48c577[_0x46db('0x4c')]['id'];return _0x1933b9;});return db[_0x46db('0x59')][_0x46db('0x6c')](_0x24da5c,{'raw':!![],'transaction':_0x302272});});}})[_0x46db('0x4a')](handleError(_0x2b3675,null));});}})[_0x46db('0x2b')](function(_0x2626b8){var _0x3c39b0=_[_0x46db('0x31')](_0x2626b8,function(_0x12c196){return _0x12c196[_0x46db('0x56')]({'plain':!![]});});})[_0x46db('0x2b')](respondWithResult(_0x2b3675,null))['catch'](handleError(_0x2b3675,null));};exports[_0x46db('0x6d')]=function(_0x15a414,_0x256a1a,_0x4368b4){return db['UserProfile'][_0x46db('0x4d')]({'where':{'id':_0x15a414[_0x46db('0x4c')]['id']}})['then'](handleEntityNotFound(_0x256a1a,null))['then'](function(_0x504f71){if(_0x504f71){return _0x504f71[_0x46db('0x6d')](_0x15a414[_0x46db('0x38')][_0x46db('0x6e')]);}})['then'](respondWithStatusCode(_0x256a1a,null))[_0x46db('0x4a')](handleError(_0x256a1a,null));};exports[_0x46db('0x6f')]=function(_0x1c22b9,_0x85a066){var _0x6d428b={};if(!_0x1c22b9[_0x46db('0x38')][_0x46db('0x70')])throw new Error(_0x46db('0x71'));if(!_0x1c22b9[_0x46db('0x38')][_0x46db('0x72')](_0x46db('0x3e'))){_0x6d428b['limit']=qs[_0x46db('0x25')](_0x1c22b9['query']['limit']);_0x6d428b[_0x46db('0x23')]=qs[_0x46db('0x23')](_0x1c22b9['query'][_0x46db('0x23')]);}return db[_0x46db('0x32')][_0x46db('0x4d')]({'where':{'id':_0x1c22b9[_0x46db('0x4c')]['id']}})[_0x46db('0x2b')](function(_0x446128){if(!_0x446128)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x1c22b9[_0x46db('0x4c')]['id']);return db[_0x46db('0x32')][_0x46db('0x6f')](_0x1c22b9);})[_0x46db('0x2b')](respondWithFilteredResult(_0x85a066,_0x6d428b))[_0x46db('0x4a')](handleError(_0x85a066,null));}; \ No newline at end of file +var _0xa329=['UserProfileResource','describe','addSections','push','removeSections','ids','getSections','includes','isEmpty','subsections','enabled','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','length','find','create','body','clone','options','get','omit','updatedAt','createdAt','sequelize','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0xa329,0x162));var _0x9a32=function(_0x4b3b5c,_0x3d17cb){_0x4b3b5c=_0x4b3b5c-0x0;var _0x4c0c65=_0xa329[_0x4b3b5c];return _0x4c0c65;};'use strict';var emlformat=require(_0x9a32('0x0'));var rimraf=require(_0x9a32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a32('0x2'));var rp=require('request-promise');var moment=require(_0x9a32('0x3'));var BPromise=require(_0x9a32('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9a32('0x5'));var sox=require(_0x9a32('0x6'));var csv=require(_0x9a32('0x7'));var ejs=require(_0x9a32('0x8'));var fs=require('fs');var fs_extra=require(_0x9a32('0x9'));var _=require(_0x9a32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a32('0xb'));var toCsv=require(_0x9a32('0x7'));var querystring=require('querystring');var Papa=require(_0x9a32('0xc'));var Redis=require(_0x9a32('0xd'));var authService=require(_0x9a32('0xe'));var qs=require(_0x9a32('0xf'));var as=require(_0x9a32('0x10'));var hardwareService=require(_0x9a32('0x11'));var logger=require('../../config/logger')(_0x9a32('0x12'));var utils=require(_0x9a32('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9a32('0x14'))['db'];config[_0x9a32('0x15')]=_['defaults'](config['redis'],{'host':_0x9a32('0x16'),'port':0x18eb});var socket=require(_0x9a32('0x17'))(new Redis(config[_0x9a32('0x15')]));require(_0x9a32('0x18'))['register'](socket);function respondWithStatusCode(_0x224747,_0x37ab43){_0x37ab43=_0x37ab43||0xcc;return function(_0x5d35ed){if(_0x5d35ed){return _0x224747[_0x9a32('0x19')](_0x37ab43);}return _0x224747[_0x9a32('0x1a')](_0x37ab43)[_0x9a32('0x1b')]();};}function respondWithResult(_0x448fd6,_0x20ae14){_0x20ae14=_0x20ae14||0xc8;return function(_0x1dbf9d){if(_0x1dbf9d){return _0x448fd6['status'](_0x20ae14)[_0x9a32('0x1c')](_0x1dbf9d);}};}function respondWithFilteredResult(_0x31bd3e,_0x815a68){return function(_0x4cfd70){if(_0x4cfd70){var _0x3606ab=typeof _0x815a68[_0x9a32('0x1d')]==='undefined'&&typeof _0x815a68['limit']===_0x9a32('0x1e');var _0x56df79=_0x4cfd70[_0x9a32('0x1f')];var _0x42bf59=_0x3606ab?0x0:_0x815a68[_0x9a32('0x1d')];var _0x526e92=_0x3606ab?_0x4cfd70[_0x9a32('0x1f')]:_0x815a68[_0x9a32('0x1d')]+_0x815a68[_0x9a32('0x20')];var _0x4ca971;if(_0x526e92>=_0x56df79){_0x526e92=_0x56df79;_0x4ca971=0xc8;}else{_0x4ca971=0xce;}_0x31bd3e[_0x9a32('0x1a')](_0x4ca971);return _0x31bd3e[_0x9a32('0x21')](_0x9a32('0x22'),_0x42bf59+'-'+_0x526e92+'/'+_0x56df79)[_0x9a32('0x1c')](_0x4cfd70);}return null;};}function patchUpdates(_0x3b3e66){return function(_0x210a32){try{jsonpatch['apply'](_0x210a32,_0x3b3e66,!![]);}catch(_0x4e6e68){return BPromise[_0x9a32('0x23')](_0x4e6e68);}return _0x210a32[_0x9a32('0x24')]();};}function saveUpdates(_0x109144,_0x4d8771){return function(_0x494aca){if(_0x494aca){return _0x494aca[_0x9a32('0x25')](_0x109144)[_0x9a32('0x26')](function(_0x301dac){return _0x301dac;});}return null;};}function removeEntity(_0x51889a,_0x49531d){return function(_0x4b7f6b){if(_0x4b7f6b){return _0x4b7f6b[_0x9a32('0x27')]()['then'](function(){_0x51889a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f5a84,_0x13a5d5){return function(_0x10edcf){if(!_0x10edcf){_0x1f5a84[_0x9a32('0x19')](0x194);}return _0x10edcf;};}function handleError(_0x4168e3,_0x3209a8){_0x3209a8=_0x3209a8||0x1f4;return function(_0x13787b){logger[_0x9a32('0x28')](_0x13787b[_0x9a32('0x29')]);if(_0x13787b[_0x9a32('0x2a')]){delete _0x13787b[_0x9a32('0x2a')];}_0x4168e3['status'](_0x3209a8)[_0x9a32('0x2b')](_0x13787b);};}exports[_0x9a32('0x2c')]=function(_0x5b7a1d,_0x3e9e85){var _0x48674a={},_0x18a7b3={},_0x227dbc={'count':0x0,'rows':[]};var _0x416ba3=_[_0x9a32('0x2d')](db[_0x9a32('0x2e')]['rawAttributes'],function(_0xcabf0f){return{'name':_0xcabf0f[_0x9a32('0x2f')],'type':_0xcabf0f[_0x9a32('0x30')][_0x9a32('0x31')]};});_0x18a7b3[_0x9a32('0x32')]=_[_0x9a32('0x2d')](_0x416ba3,'name');_0x18a7b3[_0x9a32('0x33')]=_[_0x9a32('0x34')](_0x5b7a1d[_0x9a32('0x33')]);_0x18a7b3[_0x9a32('0x35')]=_[_0x9a32('0x36')](_0x18a7b3['model'],_0x18a7b3[_0x9a32('0x33')]);_0x48674a['attributes']=_[_0x9a32('0x36')](_0x18a7b3['model'],qs['fields'](_0x5b7a1d['query']['fields']));_0x48674a[_0x9a32('0x37')]=_0x48674a[_0x9a32('0x37')]['length']?_0x48674a[_0x9a32('0x37')]:_0x18a7b3[_0x9a32('0x32')];if(!_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x38')](_0x9a32('0x39'))){_0x48674a['limit']=qs[_0x9a32('0x20')](_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x20')]);_0x48674a[_0x9a32('0x1d')]=qs[_0x9a32('0x1d')](_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x1d')]);}_0x48674a[_0x9a32('0x3a')]=qs[_0x9a32('0x3b')](_0x5b7a1d['query'][_0x9a32('0x3b')]);_0x48674a['where']=qs[_0x9a32('0x35')](_[_0x9a32('0x3c')](_0x5b7a1d[_0x9a32('0x33')],_0x18a7b3[_0x9a32('0x35')]),_0x416ba3);if(_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x3d')]){_0x48674a[_0x9a32('0x3e')]=_[_0x9a32('0x3f')](_0x48674a[_0x9a32('0x3e')],{'$or':_[_0x9a32('0x2d')](_0x416ba3,function(_0x1b464b){if(_0x1b464b[_0x9a32('0x30')]!=='VIRTUAL'){var _0xdba972={};_0xdba972[_0x1b464b['name']]={'$like':'%'+_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x3d')]+'%'};return _0xdba972;}})});}_0x48674a=_['merge']({},_0x48674a,_0x5b7a1d['options']);var _0x58bb76={'where':_0x48674a[_0x9a32('0x3e')]};return db[_0x9a32('0x2e')]['count'](_0x58bb76)[_0x9a32('0x26')](function(_0x551215){_0x227dbc[_0x9a32('0x1f')]=_0x551215;if(_0x5b7a1d[_0x9a32('0x33')][_0x9a32('0x40')]){_0x48674a[_0x9a32('0x41')]=[{'all':!![]}];}return db[_0x9a32('0x2e')][_0x9a32('0x42')](_0x48674a);})[_0x9a32('0x26')](function(_0x50a03d){_0x227dbc[_0x9a32('0x43')]=_0x50a03d;return _0x227dbc;})[_0x9a32('0x26')](respondWithFilteredResult(_0x3e9e85,_0x48674a))[_0x9a32('0x44')](handleError(_0x3e9e85,null));};exports['show']=function(_0x28d7ee,_0x535ac7){var _0x43e16a={'raw':![],'where':{'id':_0x28d7ee[_0x9a32('0x45')]['id']}},_0x3eee4e={};_0x3eee4e['model']=_[_0x9a32('0x34')](db[_0x9a32('0x2e')][_0x9a32('0x46')]);_0x3eee4e[_0x9a32('0x33')]=_[_0x9a32('0x34')](_0x28d7ee[_0x9a32('0x33')]);_0x3eee4e[_0x9a32('0x35')]=_[_0x9a32('0x36')](_0x3eee4e['model'],_0x3eee4e[_0x9a32('0x33')]);_0x43e16a['attributes']=_[_0x9a32('0x36')](_0x3eee4e[_0x9a32('0x32')],qs[_0x9a32('0x47')](_0x28d7ee[_0x9a32('0x33')][_0x9a32('0x47')]));_0x43e16a[_0x9a32('0x37')]=_0x43e16a[_0x9a32('0x37')][_0x9a32('0x48')]?_0x43e16a[_0x9a32('0x37')]:_0x3eee4e[_0x9a32('0x32')];if(_0x28d7ee[_0x9a32('0x33')]['includeAll']){_0x43e16a['include']=[{'all':!![]}];}_0x43e16a=_[_0x9a32('0x3f')]({},_0x43e16a,_0x28d7ee['options']);return db[_0x9a32('0x2e')][_0x9a32('0x49')](_0x43e16a)[_0x9a32('0x26')](handleEntityNotFound(_0x535ac7,null))[_0x9a32('0x26')](respondWithResult(_0x535ac7,null))['catch'](handleError(_0x535ac7,null));};exports[_0x9a32('0x4a')]=function(_0x253ebc,_0x195de1){return db[_0x9a32('0x2e')][_0x9a32('0x4a')](_0x253ebc[_0x9a32('0x4b')],{})[_0x9a32('0x26')](respondWithResult(_0x195de1,0xc9))[_0x9a32('0x44')](handleError(_0x195de1,null));};exports[_0x9a32('0x4c')]=function(_0x5108d6,_0x39808e){var _0x439270={'where':{'id':_0x5108d6[_0x9a32('0x45')]['id']}},_0x44b0e8={};_0x44b0e8[_0x9a32('0x32')]=_[_0x9a32('0x34')](db['UserProfile'][_0x9a32('0x46')]);_0x439270['attributes']=_[_0x9a32('0x36')](_0x44b0e8[_0x9a32('0x32')],qs[_0x9a32('0x47')](_0x5108d6[_0x9a32('0x33')][_0x9a32('0x47')]));_0x439270[_0x9a32('0x37')]=_0x439270[_0x9a32('0x37')][_0x9a32('0x48')]?_0x439270['attributes']:_0x44b0e8[_0x9a32('0x32')];if(_0x5108d6[_0x9a32('0x33')]['includeAll']){_0x439270['include']=[{'all':!![]}];}_0x439270=_[_0x9a32('0x3f')]({},_0x439270,_0x5108d6[_0x9a32('0x4d')]);return db['UserProfile'][_0x9a32('0x49')](_0x439270)[_0x9a32('0x26')](handleEntityNotFound(_0x39808e,null))[_0x9a32('0x26')](function(_0x519398){if(_0x519398){var _0x452290=_0x519398[_0x9a32('0x4e')]({'plain':!![]});_0x452290=qs[_0x9a32('0x4f')](_0x452290,['id','createdAt',_0x9a32('0x50'),'crudPermissions']);_0x5108d6['body']=_[_0x9a32('0x4f')](_0x5108d6[_0x9a32('0x4b')],['id',_0x9a32('0x51'),'updatedAt']);return db[_0x9a32('0x52')][_0x9a32('0x53')](function(_0x16c9c2){return db[_0x9a32('0x2e')][_0x9a32('0x4a')](_[_0x9a32('0x3f')](_0x452290,_0x5108d6[_0x9a32('0x4b')]),{'include':_0x5108d6[_0x9a32('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x16c9c2})['then'](function(_0x5c67c8){var _0x237a22=_0x5c67c8[_0x9a32('0x4e')]({'plain':!![]});return db['UserProfileSection'][_0x9a32('0x42')]({'where':{'userProfileId':_0x5108d6[_0x9a32('0x45')]['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x291ea6){if(_0x291ea6){return BPromise[_0x9a32('0x54')](_0x291ea6,function(_0x6e5b4){return new BPromise(function(_0x31f8b3,_0x3aa8cb){if(_0x6e5b4[_0x9a32('0x55')]===null||_0x6e5b4['autoAssociation']===0x1)_0x31f8b3(null);return db['UserProfileResource'][_0x9a32('0x42')]({'where':{'sectionId':_0x6e5b4['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x5a7dbd){var _0x4ddb3f=_[_0x9a32('0x2d')](_0x5a7dbd,function(_0xc777cc){return qs[_0x9a32('0x4f')](_0xc777cc,['id',_0x9a32('0x51'),_0x9a32('0x50'),_0x9a32('0x56')]);});_0x31f8b3(_0x4ddb3f);})[_0x9a32('0x44')](function(_0x5c37c9){_0x3aa8cb(_0x5c37c9);});})[_0x9a32('0x26')](function(_0xe2ba2e){var _0x3447d9=qs[_0x9a32('0x4f')](_0x6e5b4,['id',_0x9a32('0x51'),_0x9a32('0x50')]);_0x3447d9[_0x9a32('0x57')]=_0x237a22['id'];if(_0xe2ba2e)_0x3447d9[_0x9a32('0x58')]=_0xe2ba2e;return _0x3447d9;})[_0x9a32('0x26')](function(_0x537e8f){return db[_0x9a32('0x59')][_0x9a32('0x4a')](_0x537e8f,{'include':[{'model':db[_0x9a32('0x5a')],'as':_0x9a32('0x58')}],'raw':!![],'transaction':_0x16c9c2});});})[_0x9a32('0x26')](function(){return _0x237a22;});}});});});}})[_0x9a32('0x26')](respondWithResult(_0x39808e,0xc9))[_0x9a32('0x44')](handleError(_0x39808e,null));};exports[_0x9a32('0x25')]=function(_0x5389bf,_0x1d95ab){if(_0x5389bf[_0x9a32('0x4b')]['id']){delete _0x5389bf[_0x9a32('0x4b')]['id'];}return db[_0x9a32('0x2e')]['find']({'where':{'id':_0x5389bf[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x1d95ab,null))[_0x9a32('0x26')](saveUpdates(_0x5389bf[_0x9a32('0x4b')],null))[_0x9a32('0x26')](respondWithResult(_0x1d95ab,null))[_0x9a32('0x44')](handleError(_0x1d95ab,null));};exports[_0x9a32('0x27')]=function(_0x5ab47b,_0x18abe9){return db['UserProfile'][_0x9a32('0x49')]({'where':{'id':_0x5ab47b['params']['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x18abe9,null))[_0x9a32('0x26')](removeEntity(_0x18abe9,null))[_0x9a32('0x44')](handleError(_0x18abe9,null));};exports[_0x9a32('0x5b')]=function(_0x182402,_0x49a671){return db[_0x9a32('0x2e')][_0x9a32('0x5b')]()['then'](respondWithResult(_0x49a671,null))[_0x9a32('0x44')](handleError(_0x49a671,null));};exports[_0x9a32('0x5c')]=function(_0x2c3704,_0x1a9889){var _0x31d81c=_0x2c3704[_0x9a32('0x4b')];return db['UserProfile'][_0x9a32('0x49')]({'where':{'id':_0x2c3704[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0x1a9889,null))[_0x9a32('0x26')](function(_0x6ad0eb){if(_0x6ad0eb){return db[_0x9a32('0x52')][_0x9a32('0x53')](function(_0x3ed9b4){return db[_0x9a32('0x59')]['destroy']({'where':{'userProfileId':_0x2c3704[_0x9a32('0x45')]['id'],'sectionId':_[_0x9a32('0x2d')](_0x31d81c,function(_0x309a9c){return _0x309a9c[_0x9a32('0x56')];})},'transaction':_0x3ed9b4})[_0x9a32('0x26')](function(){var _0x36d866=_['map'](_0x31d81c,function(_0x4c4a85){_0x4c4a85['userProfileId']=_0x2c3704['params']['id'];return _0x4c4a85;});var _0x35a973=[];return BPromise[_0x9a32('0x54')](_0x36d866,function(_0x1015b5){return db['UserProfileSection'][_0x9a32('0x4a')](_0x1015b5,{'include':[{'model':db[_0x9a32('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x3ed9b4})['then'](function(_0x11da52){_0x35a973[_0x9a32('0x5d')](_0x11da52[_0x9a32('0x4e')]({'plain':!![]}));});})[_0x9a32('0x26')](function(){return _0x35a973;});});});}})[_0x9a32('0x26')](function(_0x5c7454){return _0x5c7454;})[_0x9a32('0x26')](respondWithResult(_0x1a9889,null))[_0x9a32('0x44')](handleError(_0x1a9889,null));};exports[_0x9a32('0x5e')]=function(_0xe30624,_0x465c2c){var _0x5cabc9;return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0xe30624[_0x9a32('0x45')]['id']},'attributes':['id',_0x9a32('0x2a')]})[_0x9a32('0x26')](handleEntityNotFound(_0x465c2c,null))['then'](function(_0x4af5f2){if(_0x4af5f2){_0x5cabc9=_0x4af5f2;return db[_0x9a32('0x59')]['destroy']({'where':{'userProfileId':_0xe30624[_0x9a32('0x45')]['id'],'sectionId':_0xe30624[_0x9a32('0x33')][_0x9a32('0x5f')]}});}})[_0x9a32('0x26')](function(){return _0x5cabc9;})[_0x9a32('0x26')](respondWithStatusCode(_0x465c2c,null))[_0x9a32('0x44')](handleError(_0x465c2c,null));};exports[_0x9a32('0x60')]=function(_0x1a1a7d,_0x68b2a7){var _0x254c77=[];var _0x3d76f2=[];return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x1a1a7d['params']['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x338a2b){_0x254c77=_[_0x9a32('0x3d')](_0x338a2b,function(_0x3b8947){return _0x3b8947['enabled']===0x1||_[_0x9a32('0x61')]([0x3eb,0x709],_0x3b8947[_0x9a32('0x56')]);});if(!_[_0x9a32('0x62')](_0x254c77)){return _[_0x9a32('0x2d')](_0x254c77,function(_0x9a57c7){return _0x9a57c7[_0x9a32('0x56')];});}else{return;}})[_0x9a32('0x26')](function(_0x3e490c){if(_0x3e490c)_0x3d76f2=_0x3e490c;if(_[_0x9a32('0x61')](_0x3d76f2,0x64)){var _0x3d5e7d=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x64});return hasDefaultDashboard(_0x3d5e7d)[_0x9a32('0x26')](function(_0x4889b2){return _[_0x9a32('0x2d')](_0x254c77,function(_0x14968c){if(_0x14968c[_0x9a32('0x56')]===0x64){_0x14968c[_0x9a32('0x63')]=_0x4889b2;}return _0x14968c;});});}else{return;}})['then'](function(_0x220a45){if(_0x220a45)_0x254c77=_0x220a45;if(_[_0x9a32('0x61')](_0x3d76f2,0x3eb)){var _0x33a4f6=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x3eb});return getCustomDashboards(_0x33a4f6)['then'](function(_0x3487d5){return _['map'](_0x254c77,function(_0x3e2675){if(_0x33a4f6[_0x9a32('0x64')]){if(_0x3e2675[_0x9a32('0x56')]===0x3eb){_0x3e2675[_0x9a32('0x63')]=_0x3487d5;}}else{if(_0x3e2675[_0x9a32('0x56')]===0x64){_0x3e2675['subsections']=_0x3487d5;}}return _0x3e2675;});});}else{return;}})[_0x9a32('0x26')](function(_0x1262de){if(_0x1262de)_0x254c77=_0x1262de;if(_[_0x9a32('0x61')](_0x3d76f2,0x709)){var _0x1e5900=_[_0x9a32('0x49')](_0x254c77,{'sectionId':0x709});return getPlugins(_0x1e5900)['then'](function(_0x34730b){if(_0x1e5900[_0x9a32('0x64')]){return _[_0x9a32('0x2d')](_0x254c77,function(_0x1b6dd6){if(_0x1b6dd6['sectionId']===0x709){_0x1b6dd6[_0x9a32('0x63')]=_0x34730b;}return _0x1b6dd6;});}else{var _0x347e99={'sectionId':0x76c,'enabled':0x1,'subsections':_0x34730b};var _0x52c92a=_[_0x9a32('0x2d')](_0x254c77);_0x52c92a[_0x9a32('0x5d')](_0x347e99);return _0x52c92a;}});}else{return;}})[_0x9a32('0x26')](function(_0x286495){if(_0x286495)_0x254c77=_0x286495;return _['filter'](_0x254c77,[_0x9a32('0x64'),0x1]);})[_0x9a32('0x26')](respondWithResult(_0x68b2a7,null))['catch'](handleError(_0x68b2a7,null));};function hasDefaultDashboard(_0x3a5773){var _0x53fb25=[0x65];return new BPromise(function(_0x532329,_0x5a13af){try{if(_0x3a5773['autoAssociation']){_0x532329(_0x53fb25);}else{return db[_0x9a32('0x5a')]['findOne']({'where':{'sectionId':_0x3a5773['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x425e71){_0x425e71?_0x532329(_0x53fb25):_0x532329();});}}catch(_0x429f91){_0x5a13af(_0x429f91);}});}function getCustomDashboards(_0x25a5e8){var _0x14c11d=[];return new BPromise(function(_0x2f2761,_0x2a3450){try{if(_0x25a5e8[_0x9a32('0x55')]){return db[_0x9a32('0x65')][_0x9a32('0x42')]({'raw':!![]})[_0x9a32('0x26')](function(_0x14697b){_0x14697b[_0x9a32('0x66')](function(_0x41d357){_0x14c11d[_0x9a32('0x5d')](_0x41d357['id']+0x1869f);});_0x2f2761(_0x14c11d);});}else{return db[_0x9a32('0x5a')][_0x9a32('0x42')]({'where':{'sectionId':_0x25a5e8['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x39fbf4){_0x39fbf4[_0x9a32('0x66')](function(_0x2ecb0a){_0x14c11d['push'](_0x2ecb0a['resourceId']+0x1869f);});_0x2f2761(_0x14c11d);});}}catch(_0x3387e3){_0x2a3450(_0x3387e3);}});}function getPlugins(_0x2ff970){var _0x203573=[];return new BPromise(function(_0x37d9d5,_0x4fe33d){try{if(_0x2ff970[_0x9a32('0x55')]){return db[_0x9a32('0x67')][_0x9a32('0x42')]({'raw':!![]})['then'](function(_0x565fbb){_0x565fbb[_0x9a32('0x66')](function(_0x3911c6){_0x203573[_0x9a32('0x5d')](_0x3911c6['id']+0x15b38);});_0x37d9d5(_0x203573);});}else{return db[_0x9a32('0x5a')][_0x9a32('0x42')]({'where':{'sectionId':_0x2ff970['id']},'raw':!![]})[_0x9a32('0x26')](function(_0x5a874e){_0x5a874e[_0x9a32('0x66')](function(_0x531f44){_0x203573[_0x9a32('0x5d')](_0x531f44[_0x9a32('0x68')]+0x15b38);});_0x37d9d5(_0x203573);});}}catch(_0x189a83){_0x4fe33d(_0x189a83);}});}exports[_0x9a32('0x69')]=function(_0x2e19df,_0xef60f8){return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0x2e19df[_0x9a32('0x45')]['id']}})[_0x9a32('0x26')](handleEntityNotFound(_0xef60f8,null))[_0x9a32('0x26')](function(_0x301df0){if(_0x301df0){return db['sequelize'][_0x9a32('0x53')](function(_0x376f93){return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x9a32('0x26')](function(_0x331444){if(_0x331444){return db[_0x9a32('0x59')][_0x9a32('0x27')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id'],'id':_[_0x9a32('0x2d')](_0x331444,function(_0x177a3a){return _0x177a3a['id'];})},'transaction':_0x376f93});}})[_0x9a32('0x26')](function(_0x327c2a){var _0x4908ef=_['map'](_0x2e19df[_0x9a32('0x4b')],function(_0x56a8e4){_0x56a8e4[_0x9a32('0x57')]=_0x2e19df[_0x9a32('0x45')]['id'];return _0x56a8e4;});return db[_0x9a32('0x59')][_0x9a32('0x6a')](_0x4908ef,{'raw':!![],'transaction':_0x376f93});})[_0x9a32('0x26')](function(_0x48901a){var _0x591d8=_['filter'](_[_0x9a32('0x2d')](_0x48901a,function(_0x35ef0a){return _0x35ef0a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x591d8){return db[_0x9a32('0x59')][_0x9a32('0x42')]({'where':{'userProfileId':_0x2e19df[_0x9a32('0x45')]['id'],'sectionId':_[_0x9a32('0x2d')](_0x591d8,function(_0x523ac7){return _0x523ac7[_0x9a32('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x9a32('0x26')](function(_0x3e4382){var _0x4a2335=_[_0x9a32('0x2d')](_0x2e19df['body'],function(_0x5e6d6d){_0x5e6d6d['userProfileId']=_0x2e19df[_0x9a32('0x45')]['id'];return _0x5e6d6d;});return db[_0x9a32('0x5a')]['bulkCreate'](_0x4a2335,{'raw':!![],'transaction':_0x376f93});});}})['catch'](handleError(_0xef60f8,null));});}})[_0x9a32('0x26')](function(_0x244d54){var _0x4606e0=_['map'](_0x244d54,function(_0x579d65){return _0x579d65[_0x9a32('0x4e')]({'plain':!![]});});})[_0x9a32('0x26')](respondWithResult(_0xef60f8,null))[_0x9a32('0x44')](handleError(_0xef60f8,null));};exports['removeResources']=function(_0xe68b91,_0xa873bd,_0x13bea0){return db[_0x9a32('0x2e')]['find']({'where':{'id':_0xe68b91[_0x9a32('0x45')]['id']}})['then'](handleEntityNotFound(_0xa873bd,null))['then'](function(_0x19c888){if(_0x19c888){return _0x19c888[_0x9a32('0x6b')](_0xe68b91[_0x9a32('0x33')]['ids']);}})[_0x9a32('0x26')](respondWithStatusCode(_0xa873bd,null))[_0x9a32('0x44')](handleError(_0xa873bd,null));};exports[_0x9a32('0x6c')]=function(_0x67d518,_0x46a76f){var _0x3937ce={};if(!_0x67d518[_0x9a32('0x33')]['section'])throw new Error(_0x9a32('0x6d'));if(!_0x67d518[_0x9a32('0x33')][_0x9a32('0x38')]('nolimit')){_0x3937ce[_0x9a32('0x20')]=qs[_0x9a32('0x20')](_0x67d518[_0x9a32('0x33')][_0x9a32('0x20')]);_0x3937ce[_0x9a32('0x1d')]=qs[_0x9a32('0x1d')](_0x67d518['query']['offset']);}return db[_0x9a32('0x2e')][_0x9a32('0x49')]({'where':{'id':_0x67d518['params']['id']}})[_0x9a32('0x26')](function(_0x21f2eb){if(!_0x21f2eb)throw new Error(_0x9a32('0x6e')+_0x67d518[_0x9a32('0x45')]['id']);return db['UserProfile']['getResources'](_0x67d518);})[_0x9a32('0x26')](respondWithFilteredResult(_0x46a76f,_0x3937ce))[_0x9a32('0x44')](handleError(_0x46a76f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 172ca81..40da222 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 _0x2542=['exports','events','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x36a2b6,_0x26970d){var _0x3f8caa=function(_0x4e4e7a){while(--_0x4e4e7a){_0x36a2b6['push'](_0x36a2b6['shift']());}};_0x3f8caa(++_0x26970d);}(_0x2542,0x169));var _0x2254=function(_0xd29317,_0x1ed669){_0xd29317=_0xd29317-0x0;var _0x4d09cc=_0x2542[_0xd29317];return _0x4d09cc;};'use strict';var EventEmitter=require(_0x2254('0x0'));var UserProfile=require(_0x2254('0x1'))['db'][_0x2254('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2254('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2254('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4059d1){return function(_0x3b3dcb,_0x27f5c9,_0x456612){UserProfileEvents[_0x2254('0x5')](_0x4059d1+':'+_0x3b3dcb['id'],_0x3b3dcb);UserProfileEvents['emit'](_0x4059d1,_0x3b3dcb);_0x456612(null);};}for(var e in events){if(events[_0x2254('0x6')](e)){var event=events[e];UserProfile[_0x2254('0x7')](e,emitEvent(event));}}module[_0x2254('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xc4aa=['../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var UserProfile=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xac4a('0x3')](0x0);var events={'afterCreate':_0xac4a('0x4'),'afterUpdate':_0xac4a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cda73){return function(_0x47d4f6,_0x2f48ed,_0x15b967){UserProfileEvents[_0xac4a('0x6')](_0x5cda73+':'+_0x47d4f6['id'],_0x47d4f6);UserProfileEvents[_0xac4a('0x6')](_0x5cda73,_0x47d4f6);_0x15b967(null);};}for(var e in events){if(events[_0xac4a('0x7')](e)){var event=events[e];UserProfile[_0xac4a('0x8')](e,emitEvent(event));}}module[_0xac4a('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 63bcd2b..cac4425 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 _0x5149=['telephones','role','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','trunks','Trunk','variables','Variable','extractedreports','AnalyticExtractedReport','Reports','reportId','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','mergeResources','isEmpty','length','UserProfileSection','find','ignore','autoAssociation','push','all','rawAttributes','filters','intersection','fields','attributes','limit','offset','pick','merge','key','VIRTUAL','foreignKey','forEach','reportType','DefaultReports','custom','CustomReports','count','rows','includeAll','include','Tags','color','tag','ThroughTags','true','chat','sms','dataValues','mail','openchannel','lodash','../../components/parsers/qs','exports','filter','field','then','catch','value','model','map','resolve','UserProfileResource','findAll','associatedResources','type','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','name','projectName','projects','childModel','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','User','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','users'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x5149,0x116));var _0x9514=function(_0x2fc128,_0x5e7969){_0x2fc128=_0x2fc128-0x0;var _0x5be39e=_0x5149[_0x2fc128];return _0x5be39e;};'use strict';var _=require(_0x9514('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x9514('0x1'));var squel=require('squel');module[_0x9514('0x2')]=function(_0x3a4c59){var _0x289d9b=_0x3a4c59['models'];function _0x58ddf5(_0x20c1f9,_0x11b02b){return new Promise(function(_0x1c5cd3,_0x3f28e5){if(!_0x11b02b)return _0x1c5cd3(null);var _0x365c37=_0x11b02b[_0x9514('0x3')]?{[_0x11b02b[_0x9514('0x3')][_0x9514('0x4')]]:_0x11b02b[_0x9514('0x3')]['value']}:undefined;return _0x289d9b[_0x20c1f9]['findAll']({'where':_0x365c37,'raw':!![]})[_0x9514('0x5')](function(_0x2da03d){_0x11b02b['associatedResources']=_['map'](_0x2da03d,'id');_0x1c5cd3(_0x11b02b);})[_0x9514('0x6')](function(_0x18ecbc){_0x3f28e5(_0x18ecbc);});});}function _0x404a04(_0x52abe1,_0x2fe2b1){return new Promise(function(_0xdc6a78,_0x1200cd){var _0x2b3972=_0x52abe1['filter']?{[_0x52abe1[_0x9514('0x3')]['field']]:_0x52abe1['filter'][_0x9514('0x7')]}:undefined;return _0x289d9b[_0x52abe1[_0x9514('0x8')]]['findAll']({'where':_0x2b3972,'raw':!![]})['then'](function(_0x2bab1f){_0x2fe2b1['associatedResources']=_[_0x9514('0x9')](_0x2bab1f,function(_0x44b0d0){return _0x44b0d0['name'];});_0xdc6a78(_0x2fe2b1);})[_0x9514('0x6')](function(_0x1a3fc3){_0x1200cd(_0x1a3fc3);});});}function _0x1991cf(_0x11a890,_0x5bc72b,_0x5335eb){if(!_0x5bc72b)return Promise[_0x9514('0xa')](null);return new Promise(function(_0x52ab87,_0xd28384){return _0x289d9b[_0x9514('0xb')][_0x9514('0xc')]({'where':{'sectionId':_0x5bc72b['id']},'raw':!![]})[_0x9514('0x5')](function(_0x2f65dd){if(_0x11a890[_0x9514('0x4')]&&_0x11a890['field']!=='id'){_0x5bc72b[_0x9514('0xd')]=_[_0x9514('0x9')](_0x2f65dd,function(_0x298b33){return _0x298b33[_0x11a890[_0x9514('0x4')]];});}else{if(_0x5335eb==='AnalyticExtractedReport'){_0x5bc72b[_0x9514('0xd')]=_[_0x9514('0x9')](_0x2f65dd,function(_0x4ecd0b){return{'id':_0x4ecd0b['resourceId'],'type':_0x4ecd0b[_0x9514('0xe')]};});}else{_0x5bc72b['associatedResources']=_[_0x9514('0x9')](_0x2f65dd,function(_0x1ca47c){return _0x1ca47c[_0x9514('0xf')];});}}_0x52ab87(_0x5bc72b);})[_0x9514('0x6')](function(_0x41577b){_0xd28384(_0x41577b);});});}function _0xd3d76(_0x181000,_0x31d05f){var _0x411738={'parentSections':[]};switch(_0x181000[_0x9514('0x10')]()){case _0x9514('0x11'):_0x411738['childModel']=_0x9514('0x12');break;case _0x9514('0x13'):_0x411738['childModel']=_0x9514('0x14');break;case _0x9514('0x15'):_0x411738['childModel']=_0x9514('0x16');_0x411738[_0x9514('0x17')]=[{'name':'SquareProjects','field':_0x9514('0x18'),'foreignKey':_0x9514('0x19')}];break;case _0x9514('0x1a'):_0x411738[_0x9514('0x1b')]=_0x9514('0x1c');break;case _0x9514('0x1d'):_0x411738['childModel']=_0x9514('0x1e');_0x411738[_0x9514('0x17')]=[{'name':_0x9514('0x1f'),'field':'id','foreignKey':_0x9514('0x20')}];break;case _0x9514('0x21'):_0x411738[_0x9514('0x1b')]=_0x9514('0x22');break;case _0x9514('0x23'):_0x411738[_0x9514('0x1b')]=_0x9514('0x24');break;case _0x9514('0x25'):_0x411738[_0x9514('0x1b')]=_0x9514('0x26');break;case _0x9514('0x27'):_0x411738[_0x9514('0x1b')]=_0x9514('0x28');break;case'chatwebsites':_0x411738[_0x9514('0x1b')]=_0x9514('0x29');break;case _0x9514('0x2a'):_0x411738['childModel']=_0x9514('0x2b');break;case _0x9514('0x2c'):_0x411738[_0x9514('0x1b')]=_0x9514('0x2d');break;case'inboundroutes':case'internalroutes':case _0x9514('0x2e'):_0x411738[_0x9514('0x1b')]=_0x9514('0x2f');break;case _0x9514('0x30'):_0x411738['childModel']=_0x9514('0x31');break;case _0x9514('0x32'):_0x411738['childModel']=_0x9514('0x33');break;case _0x9514('0x34'):_0x411738[_0x9514('0x1b')]='VoiceRecording';_0x411738[_0x9514('0x17')]=[{'name':_0x9514('0x35'),'field':_0x9514('0x18'),'foreignKey':'membername','model':_0x9514('0x36'),'filter':{'field':'role','value':['agent']}},{'name':_0x9514('0x37'),'field':_0x9514('0x18'),'foreignKey':'membername','model':_0x9514('0x36'),'filter':{'field':'role','value':[_0x9514('0x38')]}},{'name':_0x9514('0x39'),'field':_0x9514('0x18'),'foreignKey':_0x9514('0x3a'),'model':_0x9514('0x3b'),'filter':{'field':'type','value':[_0x9514('0x3c')]}},{'name':_0x9514('0x3d'),'field':'name','foreignKey':_0x9514('0x3a'),'model':_0x9514('0x3b'),'filter':{'field':_0x9514('0xe'),'value':[_0x9514('0x3e')]}}];break;case _0x9514('0x3f'):_0x411738['childModel']='VoiceMusicOnHold';break;case _0x9514('0x40'):_0x411738[_0x9514('0x1b')]='VoiceChanSpy';break;case'voiceprefixes':_0x411738['childModel']=_0x9514('0x41');break;case _0x9514('0x42'):_0x411738['childModel']=_0x9514('0x43');break;case _0x9514('0x44'):_0x411738[_0x9514('0x1b')]=_0x9514('0x45');break;case _0x9514('0x46'):_0x411738[_0x9514('0x1b')]=_0x9514('0x47');break;case _0x9514('0x48'):_0x411738[_0x9514('0x1b')]=_0x9514('0x49');break;case _0x9514('0x4a'):_0x411738[_0x9514('0x1b')]=_0x9514('0x4b');break;case _0x9514('0x4c'):_0x411738[_0x9514('0x1b')]=_0x9514('0x4d');break;case _0x9514('0x4e'):_0x411738[_0x9514('0x1b')]=_0x9514('0x4f');break;case _0x9514('0x50'):_0x411738['childModel']=_0x9514('0x51');break;case _0x9514('0x52'):_0x411738[_0x9514('0x1b')]='WhatsappQueue';break;case _0x9514('0x53'):_0x411738[_0x9514('0x1b')]=_0x9514('0x54');break;case _0x9514('0x55'):_0x411738[_0x9514('0x1b')]='Team';break;case _0x9514('0x56'):case'queuecampaigns':_0x411738[_0x9514('0x1b')]=_0x9514('0x3b');if(_0x31d05f){_0x411738[_0x9514('0x17')]=[{'name':'VoiceQueues'},{'name':_0x9514('0x3d')}];}break;case _0x9514('0x57'):case'agents':case _0x9514('0x58'):_0x411738[_0x9514('0x1b')]=_0x9514('0x36');if(_0x31d05f){_0x411738['parentSections']=[{'name':'Users','filter':{'field':_0x9514('0x59'),'value':[_0x9514('0x5a'),'user']},'ignore':!![]},{'name':_0x9514('0x35')},{'name':_0x9514('0x37')}];}break;case _0x9514('0x5b'):_0x411738[_0x9514('0x1b')]=_0x9514('0x5c');break;case'salesforceaccounts':_0x411738['childModel']=_0x9514('0x5d');break;case _0x9514('0x5e'):_0x411738[_0x9514('0x1b')]=_0x9514('0x5f');break;case _0x9514('0x60'):_0x411738[_0x9514('0x1b')]=_0x9514('0x61');break;case _0x9514('0x62'):_0x411738['childModel']=_0x9514('0x63');break;case'zohoaccounts':_0x411738[_0x9514('0x1b')]=_0x9514('0x64');break;case _0x9514('0x65'):_0x411738['childModel']=_0x9514('0x36');break;case'cannedanswers':_0x411738[_0x9514('0x1b')]=_0x9514('0x66');break;case'dispositions':_0x411738[_0x9514('0x1b')]=_0x9514('0x67');break;case _0x9514('0x68'):_0x411738[_0x9514('0x1b')]=_0x9514('0x69');break;case'intervals':_0x411738[_0x9514('0x1b')]='Interval';break;case _0x9514('0x6a'):_0x411738[_0x9514('0x1b')]=_0x9514('0x6b');break;case _0x9514('0x6c'):_0x411738[_0x9514('0x1b')]=_0x9514('0x6d');break;case'sounds':_0x411738[_0x9514('0x1b')]=_0x9514('0x6e');break;case _0x9514('0x6f'):_0x411738['childModel']=_0x9514('0x70');break;case _0x9514('0x71'):_0x411738['childModel']=_0x9514('0x72');break;case'triggers':_0x411738[_0x9514('0x1b')]='Trigger';break;case _0x9514('0x73'):_0x411738[_0x9514('0x1b')]=_0x9514('0x74');break;case _0x9514('0x75'):_0x411738[_0x9514('0x1b')]=_0x9514('0x76');break;case'plugins':_0x411738['childModel']='Plugin';break;case _0x9514('0x77'):_0x411738[_0x9514('0x1b')]=_0x9514('0x78');_0x411738[_0x9514('0x17')]=[{'name':_0x9514('0x79'),'field':'id','foreignKey':_0x9514('0x7a')}];break;case'metrics':_0x411738['childModel']=_0x9514('0x7b');break;}return _0x411738;}function _0x595617(_0x14052c,_0x36914c){var _0x2a3885=_0x14052c[_0x9514('0x7c')](0x0)['toUpperCase']()+_0x14052c[_0x9514('0x7d')](0x1);var _0x2a968c={'type':_0x289d9b[_0x9514('0x7e')][_0x9514('0x7f')][_0x9514('0x80')],'raw':!![]};return new Promise(function(_0x402f9b,_0x25871b){var _0x10142f=squel[_0x9514('0x81')]()['field'](_0x9514('0x82')+_0x2a3885+_0x9514('0x83'),'id')[_0x9514('0x4')](_0x9514('0x84'))['from'](_0x9514('0x85')+_0x14052c+_0x9514('0x86'),'ui')[_0x9514('0x87')](_0x9514('0x88'),_0x36914c['id']);return _0x289d9b[_0x9514('0x89')][_0x9514('0x8a')](_0x10142f[_0x9514('0x8b')](),_0x2a968c)[_0x9514('0x5')](function(_0x4373c1){_0x36914c[_0x2a3885+_0x9514('0x8c')]=_0x4373c1;_0x402f9b(_0x4373c1);})[_0x9514('0x6')](function(_0x13b696){_0x25871b(_0x13b696);});});}return _0x3a4c59[_0x9514('0x8d')](_0x9514('0x8e'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x467dfd){var _0x150b54={'raw':_0x467dfd['query']['raw'],'where':{}};var _0x3c111f={};var _0x10ac89={'count':0x0,'rows':[]};var _0x2ba1ea=_0x467dfd[_0x9514('0x8a')]['section'];var _0xe937ed=_0x467dfd[_0x9514('0x8a')][_0x9514('0x8f')]||![];var _0x5d6c16=_0xd3d76(_0x2ba1ea,_0xe937ed);if(!_0x5d6c16[_0x9514('0x1b')])throw new Error('Invalid\x20section\x20\x27'+_0x2ba1ea+'\x27');var _0x182cbb=[{'name':_0x2ba1ea}];if(!_[_0x9514('0x90')](_0x5d6c16[_0x9514('0x17')]))_0x182cbb=_0x5d6c16[_0x9514('0x17')];var _0x3464b8=[];for(var _0xe2b38b=0x0;_0xe2b38b<_0x182cbb[_0x9514('0x91')];_0xe2b38b++){_0x3464b8['push'](_0x289d9b[_0x9514('0x92')][_0x9514('0x93')]({'where':{'userProfileId':_0x467dfd['params']['id'],'name':_0x182cbb[_0xe2b38b]['name']},'raw':!![]}));}return Promise['all'](_0x3464b8)[_0x9514('0x5')](function(_0x5868ad){var _0x1f4050=_[_0x9514('0x3')](_0x5868ad,function(_0x4e6204){return _0x4e6204?_0x4e6204:undefined;});var _0x3b87f3=_[_0x9514('0x3')](_0x182cbb,[_0x9514('0x94'),!![]]);var _0x1becfe=_[_0x9514('0x90')](_0x1f4050)&&_[_0x9514('0x90')](_0x3b87f3)?null:_['union'](_0x3b87f3,_0x1f4050);if(!_0x1becfe)return null;var _0x2f7cde=[];for(var _0x2b35d2=0x0;_0x2b35d2<_0x1becfe[_0x9514('0x91')];_0x2b35d2++){var _0x468db1=_[_0x9514('0x93')](_0x182cbb,function(_0x385010){return _0x1becfe[_0x2b35d2]?_0x385010[_0x9514('0x18')]===_0x1becfe[_0x2b35d2][_0x9514('0x18')]:null;});if(_0x468db1){if(_0x1becfe[_0x2b35d2][_0x9514('0x94')]){_0x2f7cde['push'](_0x58ddf5(_0x5d6c16[_0x9514('0x1b')],_0x1becfe[_0x2b35d2]));}else{if(!_0x1becfe[_0x2b35d2][_0x9514('0x95')]){_0x2f7cde[_0x9514('0x96')](_0x1991cf(_0x468db1,_0x1becfe[_0x2b35d2],_0x5d6c16[_0x9514('0x1b')]));}else{if(_0x468db1['model']){_0x2f7cde[_0x9514('0x96')](_0x404a04(_0x468db1,_0x1becfe[_0x2b35d2]));}}}}}return Promise[_0x9514('0x97')](_0x2f7cde);})[_0x9514('0x5')](function(_0x441512){var _0xe466c4=_0x441512;var _0x1406a6=null;if(_0xe466c4){_0x1406a6=_0xe466c4[_0x9514('0x91')]===0x1?_0xe466c4[0x0]:null;}if(!_0x1406a6&&!_0xe466c4)return _0x10ac89;var _0x3d0a2d=_0x289d9b[_0x5d6c16[_0x9514('0x1b')]][_0x9514('0x98')];_0x3c111f[_0x9514('0x8')]=_['keys'](_0x3d0a2d);_0x3c111f[_0x9514('0x8a')]=_['keys'](_0x467dfd[_0x9514('0x8a')]);_0x3c111f[_0x9514('0x99')]=_[_0x9514('0x9a')](_0x3c111f['model'],_0x3c111f['query']);_0x150b54['attributes']=_['intersection'](_0x3c111f[_0x9514('0x8')],qs[_0x9514('0x9b')](_0x467dfd[_0x9514('0x8a')][_0x9514('0x9b')]));_0x150b54[_0x9514('0x9c')]=_0x150b54[_0x9514('0x9c')]['length']?_0x150b54[_0x9514('0x9c')]:_0x3c111f[_0x9514('0x8')];if(!_0x467dfd[_0x9514('0x8a')]['hasOwnProperty']('nolimit')){_0x150b54[_0x9514('0x9d')]=qs['limit'](_0x467dfd[_0x9514('0x8a')][_0x9514('0x9d')]);_0x150b54[_0x9514('0x9e')]=qs[_0x9514('0x9e')](_0x467dfd[_0x9514('0x8a')][_0x9514('0x9e')]);}_0x150b54['order']=qs['sort'](_0x467dfd[_0x9514('0x8a')]['sort']);_0x150b54[_0x9514('0x87')]=qs['filters'](_[_0x9514('0x9f')](_0x467dfd[_0x9514('0x8a')],_0x3c111f[_0x9514('0x99')]));if(_0x467dfd[_0x9514('0x8a')][_0x9514('0x3')]){_0x150b54[_0x9514('0x87')]=_[_0x9514('0xa0')](_0x150b54[_0x9514('0x87')],{'$or':_[_0x9514('0x9')](_0x3d0a2d,function(_0x1390b3){if(_0x1390b3[_0x9514('0xe')][_0x9514('0xa1')]!==_0x9514('0xa2')){var _0x101bef={};_0x101bef[_0x1390b3['field']]={'$like':'%'+_0x467dfd[_0x9514('0x8a')]['filter']+'%'};return _0x101bef;}})});}var _0x28d022=[];var _0x56f6e5=null;var _0x23979e={};if(_0x1406a6){_0x56f6e5=_['find'](_0x182cbb,[_0x9514('0x18'),_0x1406a6['name']]);if(_0x56f6e5[_0x9514('0x4')]){_0x23979e={};if(_0x5d6c16[_0x9514('0x1b')]===_0x9514('0x78')){_0x23979e[_0x56f6e5[_0x9514('0xa3')]]=_[_0x9514('0x9')](_0x1406a6[_0x9514('0xd')],'id');}else{_0x23979e[_0x56f6e5[_0x9514('0xa3')]]=_0x1406a6[_0x9514('0xd')];}_0x28d022[_0x9514('0x96')](_0x23979e);}else{_0x150b54[_0x9514('0x87')]['id']=_0x1406a6[_0x9514('0xd')];}}else{for(var _0x433773=0x0;_0x433773<_0xe466c4[_0x9514('0x91')];_0x433773++){_0x56f6e5=_['find'](_0x182cbb,['name',_0xe466c4[_0x433773][_0x9514('0x18')]]);if(_0x56f6e5['field']){_0x23979e={};_0x23979e[_0x56f6e5[_0x9514('0xa3')]]=_0xe466c4[_0x433773][_0x9514('0xd')];_0x28d022['push'](_0x23979e);}else{if(!_0x150b54[_0x9514('0x87')]['id'])_0x150b54[_0x9514('0x87')]['id']=[];_0xe466c4[_0x433773][_0x9514('0xd')][_0x9514('0xa4')](function(_0x1ccb82){_0x150b54[_0x9514('0x87')]['id'][_0x9514('0x96')](_0x1ccb82);});}}}if(!_['isEmpty'](_0x28d022)){_0x150b54[_0x9514('0x87')]=_[_0x9514('0xa0')](_0x150b54[_0x9514('0x87')],{'$and':{'$or':_0x28d022}});}_0x150b54=_[_0x9514('0xa0')]({},_0x150b54,_0x467dfd['options']);if(_0x1406a6&&!_0x1406a6[_0x9514('0x95')]&&_0x5d6c16[_0x9514('0x1b')]===_0x9514('0x78')){if(_0x467dfd[_0x9514('0x8a')]['includeAll']){_0x150b54['include']=[{'all':!![]}];}return _0x289d9b[_0x5d6c16[_0x9514('0x1b')]]['findAll'](_0x150b54)[_0x9514('0x5')](function(_0x3e7509){var _0x200353=[];_0x3e7509[_0x9514('0xa4')](function(_0x21524f){var _0x159c10;switch(_0x21524f[_0x9514('0xa5')]){case'default':_0x159c10=_[_0x9514('0x93')](_0x1406a6[_0x9514('0xd')],function(_0x297c0e){return _0x297c0e['id']===_0x21524f['reportId']&&_0x297c0e['type']===_0x9514('0xa6');});break;case _0x9514('0xa7'):_0x159c10=_['find'](_0x1406a6['associatedResources'],function(_0x1923a8){return _0x1923a8['id']===_0x21524f[_0x9514('0x7a')]&&_0x1923a8[_0x9514('0xe')]===_0x9514('0xa8');});break;}if(_0x159c10)_0x200353['push'](_0x21524f);});_0x10ac89[_0x9514('0xa9')]=_0x200353['length'];_0x10ac89[_0x9514('0xaa')]=_0x200353;return _0x10ac89;});}else{return _0x289d9b[_0x5d6c16[_0x9514('0x1b')]][_0x9514('0xa9')]({'where':_0x150b54['where']})[_0x9514('0x5')](function(_0x4763a6){_0x10ac89[_0x9514('0xa9')]=_0x4763a6;if(_0x467dfd[_0x9514('0x8a')][_0x9514('0xab')]){if(_0x5d6c16[_0x9514('0x1b')]===_0x9514('0x1e')){_0x150b54[_0x9514('0xac')]=[{'model':_0x289d9b[_0x9514('0x70')],'as':_0x9514('0xad'),'attributes':['id','name',_0x9514('0xae')],'required':_0x467dfd[_0x9514('0x8a')][_0x9514('0xaf')]?!![]:![]},{'model':_0x289d9b[_0x9514('0x70')],'as':_0x9514('0xb0'),'attributes':['id',_0x9514('0x18'),_0x9514('0xae')],'through':_0x467dfd[_0x9514('0x8a')]['tag']?{'attributes':[],'where':{'TagId':_0x467dfd[_0x9514('0x8a')][_0x9514('0xaf')]||undefined}}:{},'required':_0x467dfd['query'][_0x9514('0xaf')]?!![]:![]}];}else{_0x150b54[_0x9514('0xac')]=[{'all':!![]}];}}return _0x289d9b[_0x5d6c16['childModel']][_0x9514('0xc')](_0x150b54);})[_0x9514('0x5')](function(_0x119159){_0x10ac89[_0x9514('0xaa')]=_0x119159;if(_0x2ba1ea==='Agents'&&_0x467dfd[_0x9514('0x8a')]['openTabs']===_0x9514('0xb1')){var _0x425929=[];for(var _0x495dec=0x0;_0x495dec<_0x10ac89['rows'][_0x9514('0x91')];_0x495dec++){_0x425929[_0x9514('0x96')](_0x595617(_0x9514('0xb2'),_0x10ac89['rows'][_0x495dec]['dataValues']));_0x425929['push'](_0x595617(_0x9514('0xb3'),_0x10ac89[_0x9514('0xaa')][_0x495dec][_0x9514('0xb4')]));_0x425929[_0x9514('0x96')](_0x595617('fax',_0x10ac89[_0x9514('0xaa')][_0x495dec][_0x9514('0xb4')]));_0x425929[_0x9514('0x96')](_0x595617(_0x9514('0xb5'),_0x10ac89['rows'][_0x495dec]['dataValues']));_0x425929[_0x9514('0x96')](_0x595617(_0x9514('0xb6'),_0x10ac89[_0x9514('0xaa')][_0x495dec][_0x9514('0xb4')]));_0x425929[_0x9514('0x96')](_0x595617('whatsapp',_0x10ac89[_0x9514('0xaa')][_0x495dec][_0x9514('0xb4')]));}return Promise[_0x9514('0x97')](_0x425929)[_0x9514('0x5')](function(){return _0x10ac89;});}return _0x10ac89;});}});}}});}; \ No newline at end of file +var _0x5f31=['projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','agent','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','admin','user','ZendeskAccount','salesforceaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','Reports','reportId','AnalyticMetric','charAt','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','UserProfile','user_profiles','raw','query','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','custom','CustomReports','count','rows','include','Tags','color','tag','openTabs','true','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','findAll','then','associatedResources','map','catch','field','value','model','resolve','UserProfileResource','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x5f31,0x159));var _0x15f3=function(_0x292423,_0x1759b7){_0x292423=_0x292423-0x0;var _0x2801cb=_0x5f31[_0x292423];return _0x2801cb;};'use strict';var _=require(_0x15f3('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0x15f3('0x1'));var squel=require(_0x15f3('0x2'));module[_0x15f3('0x3')]=function(_0x8dc835){var _0x138d17=_0x8dc835[_0x15f3('0x4')];function _0x3172d8(_0xce8917,_0x1e15ee){return new Promise(function(_0x23d69b,_0x4bb579){if(!_0x1e15ee)return _0x23d69b(null);var _0x5ae720=_0x1e15ee[_0x15f3('0x5')]?{[_0x1e15ee['filter']['field']]:_0x1e15ee['filter']['value']}:undefined;return _0x138d17[_0xce8917][_0x15f3('0x6')]({'where':_0x5ae720,'raw':!![]})[_0x15f3('0x7')](function(_0x4b5cd9){_0x1e15ee[_0x15f3('0x8')]=_[_0x15f3('0x9')](_0x4b5cd9,'id');_0x23d69b(_0x1e15ee);})[_0x15f3('0xa')](function(_0x280556){_0x4bb579(_0x280556);});});}function _0x2b9370(_0x22ac02,_0x4c2f0f){return new Promise(function(_0x25b9f8,_0x30f46b){var _0x3c4cdd=_0x22ac02[_0x15f3('0x5')]?{[_0x22ac02[_0x15f3('0x5')][_0x15f3('0xb')]]:_0x22ac02[_0x15f3('0x5')][_0x15f3('0xc')]}:undefined;return _0x138d17[_0x22ac02[_0x15f3('0xd')]][_0x15f3('0x6')]({'where':_0x3c4cdd,'raw':!![]})['then'](function(_0x5c668a){_0x4c2f0f[_0x15f3('0x8')]=_[_0x15f3('0x9')](_0x5c668a,function(_0x497b6f){return _0x497b6f['name'];});_0x25b9f8(_0x4c2f0f);})[_0x15f3('0xa')](function(_0x53c5b5){_0x30f46b(_0x53c5b5);});});}function _0x5b56a8(_0x51a379,_0x8dedb6,_0x381ae0){if(!_0x8dedb6)return Promise[_0x15f3('0xe')](null);return new Promise(function(_0x22bec8,_0x1da475){return _0x138d17[_0x15f3('0xf')][_0x15f3('0x6')]({'where':{'sectionId':_0x8dedb6['id']},'raw':!![]})[_0x15f3('0x7')](function(_0x498718){if(_0x51a379[_0x15f3('0xb')]&&_0x51a379[_0x15f3('0xb')]!=='id'){_0x8dedb6[_0x15f3('0x8')]=_[_0x15f3('0x9')](_0x498718,function(_0x46e56e){return _0x46e56e[_0x51a379['field']];});}else{if(_0x381ae0==='AnalyticExtractedReport'){_0x8dedb6[_0x15f3('0x8')]=_[_0x15f3('0x9')](_0x498718,function(_0x1d15c0){return{'id':_0x1d15c0['resourceId'],'type':_0x1d15c0[_0x15f3('0x10')]};});}else{_0x8dedb6['associatedResources']=_['map'](_0x498718,function(_0x19f1a6){return _0x19f1a6[_0x15f3('0x11')];});}}_0x22bec8(_0x8dedb6);})['catch'](function(_0x1cd3a0){_0x1da475(_0x1cd3a0);});});}function _0x2504d4(_0x23ea09,_0x3f37b0){var _0x123b38={'parentSections':[]};switch(_0x23ea09[_0x15f3('0x12')]()){case _0x15f3('0x13'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x15');break;case'odbc':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x16');break;case _0x15f3('0x17'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x18');_0x123b38[_0x15f3('0x19')]=[{'name':_0x15f3('0x1a'),'field':_0x15f3('0x1b'),'foreignKey':_0x15f3('0x1c')}];break;case _0x15f3('0x1d'):_0x123b38['childModel']=_0x15f3('0x1e');break;case _0x15f3('0x1f'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x20');_0x123b38[_0x15f3('0x19')]=[{'name':_0x15f3('0x21'),'field':'id','foreignKey':_0x15f3('0x22')}];break;case _0x15f3('0x23'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x24');break;case _0x15f3('0x25'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x26');break;case _0x15f3('0x27'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x28');break;case _0x15f3('0x29'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x2a');break;case'chatwebsites':_0x123b38['childModel']='ChatWebsite';break;case _0x15f3('0x2b'):_0x123b38[_0x15f3('0x14')]='FaxQueue';break;case'faxaccounts':_0x123b38[_0x15f3('0x14')]='FaxAccount';break;case _0x15f3('0x2c'):case _0x15f3('0x2d'):case _0x15f3('0x2e'):_0x123b38['childModel']='VoiceExtension';break;case _0x15f3('0x2f'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x30');break;case _0x15f3('0x31'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x32');break;case _0x15f3('0x33'):_0x123b38[_0x15f3('0x14')]='VoiceRecording';_0x123b38[_0x15f3('0x19')]=[{'name':_0x15f3('0x34'),'field':'name','foreignKey':_0x15f3('0x35'),'model':_0x15f3('0x36'),'filter':{'field':'role','value':[_0x15f3('0x37')]}},{'name':_0x15f3('0x38'),'field':_0x15f3('0x1b'),'foreignKey':_0x15f3('0x35'),'model':'User','filter':{'field':'role','value':[_0x15f3('0x39')]}},{'name':_0x15f3('0x3a'),'field':_0x15f3('0x1b'),'foreignKey':'queue','model':_0x15f3('0x3b'),'filter':{'field':_0x15f3('0x10'),'value':['inbound']}},{'name':_0x15f3('0x3c'),'field':_0x15f3('0x1b'),'foreignKey':'queue','model':_0x15f3('0x3b'),'filter':{'field':_0x15f3('0x10'),'value':[_0x15f3('0x3d')]}}];break;case'musiconholds':_0x123b38[_0x15f3('0x14')]='VoiceMusicOnHold';break;case _0x15f3('0x3e'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x3f');break;case _0x15f3('0x40'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x41');break;case _0x15f3('0x42'):_0x123b38['childModel']='Campaign';break;case _0x15f3('0x43'):_0x123b38[_0x15f3('0x14')]='MailQueue';break;case _0x15f3('0x44'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x45');break;case _0x15f3('0x46'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x47');break;case _0x15f3('0x48'):_0x123b38[_0x15f3('0x14')]='OpenchannelQueue';break;case _0x15f3('0x49'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x4a');break;case _0x15f3('0x4b'):_0x123b38[_0x15f3('0x14')]='SmsQueue';break;case _0x15f3('0x4c'):_0x123b38[_0x15f3('0x14')]='SmsAccount';break;case _0x15f3('0x4d'):_0x123b38['childModel']=_0x15f3('0x4e');break;case _0x15f3('0x4f'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x50');break;case _0x15f3('0x51'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x52');break;case _0x15f3('0x53'):case _0x15f3('0x54'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x3b');if(_0x3f37b0){_0x123b38[_0x15f3('0x19')]=[{'name':'VoiceQueues'},{'name':_0x15f3('0x3c')}];}break;case'users':case _0x15f3('0x55'):case _0x15f3('0x56'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x36');if(_0x3f37b0){_0x123b38[_0x15f3('0x19')]=[{'name':_0x15f3('0x57'),'filter':{'field':'role','value':[_0x15f3('0x58'),_0x15f3('0x59')]},'ignore':!![]},{'name':_0x15f3('0x34')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x5a');break;case _0x15f3('0x5b'):_0x123b38[_0x15f3('0x14')]='SalesforceAccount';break;case'freshdeskaccounts':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x5c');break;case _0x15f3('0x5d'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x5e');break;case'deskaccounts':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x5f');break;case _0x15f3('0x60'):_0x123b38[_0x15f3('0x14')]='ZohoAccount';break;case _0x15f3('0x61'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x36');break;case _0x15f3('0x62'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x63');break;case'dispositions':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x64');break;case _0x15f3('0x65'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x66');break;case _0x15f3('0x67'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x68');break;case _0x15f3('0x69'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x6a');break;case _0x15f3('0x6b'):_0x123b38[_0x15f3('0x14')]='Schedule';break;case'sounds':_0x123b38['childModel']=_0x15f3('0x6c');break;case _0x15f3('0x6d'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x6e');break;case _0x15f3('0x6f'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x70');break;case _0x15f3('0x71'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x72');break;case'trunks':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x73');break;case _0x15f3('0x74'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x75');break;case _0x15f3('0x76'):_0x123b38[_0x15f3('0x14')]='Plugin';break;case _0x15f3('0x77'):_0x123b38[_0x15f3('0x14')]=_0x15f3('0x78');_0x123b38['parentSections']=[{'name':_0x15f3('0x79'),'field':'id','foreignKey':_0x15f3('0x7a')}];break;case'metrics':_0x123b38[_0x15f3('0x14')]=_0x15f3('0x7b');break;}return _0x123b38;}function _0xf8e3af(_0x29c576,_0x63ba6f){var _0x37f0e4=_0x29c576[_0x15f3('0x7c')](0x0)['toUpperCase']()+_0x29c576['slice'](0x1);var _0x23074e={'type':_0x138d17['Sequelize'][_0x15f3('0x7d')][_0x15f3('0x7e')],'raw':!![]};return new Promise(function(_0x3712bc,_0x5243e7){var _0x5319a1=squel[_0x15f3('0x7f')]()[_0x15f3('0xb')]('ui.'+_0x37f0e4+'InteractionId','id')[_0x15f3('0xb')](_0x15f3('0x80'))[_0x15f3('0x81')](_0x15f3('0x82')+_0x29c576+'_interactions','ui')[_0x15f3('0x83')](_0x15f3('0x84'),_0x63ba6f['id']);return _0x138d17['sequelize']['query'](_0x5319a1['toString'](),_0x23074e)[_0x15f3('0x7')](function(_0x5b7a65){_0x63ba6f[_0x37f0e4+'OpenTabs']=_0x5b7a65;_0x3712bc(_0x5b7a65);})[_0x15f3('0xa')](function(_0x33c589){_0x5243e7(_0x33c589);});});}return _0x8dc835['define'](_0x15f3('0x85'),attributes,{'tableName':_0x15f3('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5080fa){var _0x193a26={'raw':_0x5080fa['query'][_0x15f3('0x87')],'where':{}};var _0x268217={};var _0x599388={'count':0x0,'rows':[]};var _0x4881f4=_0x5080fa[_0x15f3('0x88')][_0x15f3('0x89')];var _0x56d1a1=_0x5080fa[_0x15f3('0x88')][_0x15f3('0x8a')]||![];var _0x1728e7=_0x2504d4(_0x4881f4,_0x56d1a1);if(!_0x1728e7[_0x15f3('0x14')])throw new Error(_0x15f3('0x8b')+_0x4881f4+'\x27');var _0x255a22=[{'name':_0x4881f4}];if(!_[_0x15f3('0x8c')](_0x1728e7[_0x15f3('0x19')]))_0x255a22=_0x1728e7['parentSections'];var _0x50cb91=[];for(var _0x344d72=0x0;_0x344d72<_0x255a22[_0x15f3('0x8d')];_0x344d72++){_0x50cb91[_0x15f3('0x8e')](_0x138d17['UserProfileSection']['find']({'where':{'userProfileId':_0x5080fa[_0x15f3('0x8f')]['id'],'name':_0x255a22[_0x344d72][_0x15f3('0x1b')]},'raw':!![]}));}return Promise[_0x15f3('0x90')](_0x50cb91)['then'](function(_0x4b2330){var _0x40e673=_[_0x15f3('0x5')](_0x4b2330,function(_0x38a967){return _0x38a967?_0x38a967:undefined;});var _0x18d7ed=_['filter'](_0x255a22,[_0x15f3('0x91'),!![]]);var _0x558cdf=_[_0x15f3('0x8c')](_0x40e673)&&_[_0x15f3('0x8c')](_0x18d7ed)?null:_[_0x15f3('0x92')](_0x18d7ed,_0x40e673);if(!_0x558cdf)return null;var _0x19484c=[];for(var _0x5c4891=0x0;_0x5c4891<_0x558cdf[_0x15f3('0x8d')];_0x5c4891++){var _0x1ba989=_[_0x15f3('0x93')](_0x255a22,function(_0x26238e){return _0x558cdf[_0x5c4891]?_0x26238e['name']===_0x558cdf[_0x5c4891][_0x15f3('0x1b')]:null;});if(_0x1ba989){if(_0x558cdf[_0x5c4891][_0x15f3('0x91')]){_0x19484c[_0x15f3('0x8e')](_0x3172d8(_0x1728e7['childModel'],_0x558cdf[_0x5c4891]));}else{if(!_0x558cdf[_0x5c4891][_0x15f3('0x94')]){_0x19484c[_0x15f3('0x8e')](_0x5b56a8(_0x1ba989,_0x558cdf[_0x5c4891],_0x1728e7['childModel']));}else{if(_0x1ba989['model']){_0x19484c[_0x15f3('0x8e')](_0x2b9370(_0x1ba989,_0x558cdf[_0x5c4891]));}}}}}return Promise['all'](_0x19484c);})[_0x15f3('0x7')](function(_0x4f043e){var _0x172c05=_0x4f043e;var _0x42fd58=null;if(_0x172c05){_0x42fd58=_0x172c05['length']===0x1?_0x172c05[0x0]:null;}if(!_0x42fd58&&!_0x172c05)return _0x599388;var _0xa219e5=_0x138d17[_0x1728e7[_0x15f3('0x14')]][_0x15f3('0x95')];_0x268217[_0x15f3('0xd')]=_[_0x15f3('0x96')](_0xa219e5);_0x268217[_0x15f3('0x88')]=_[_0x15f3('0x96')](_0x5080fa[_0x15f3('0x88')]);_0x268217[_0x15f3('0x97')]=_[_0x15f3('0x98')](_0x268217['model'],_0x268217['query']);_0x193a26[_0x15f3('0x99')]=_['intersection'](_0x268217[_0x15f3('0xd')],qs[_0x15f3('0x9a')](_0x5080fa[_0x15f3('0x88')]['fields']));_0x193a26['attributes']=_0x193a26[_0x15f3('0x99')][_0x15f3('0x8d')]?_0x193a26[_0x15f3('0x99')]:_0x268217[_0x15f3('0xd')];if(!_0x5080fa[_0x15f3('0x88')]['hasOwnProperty'](_0x15f3('0x9b'))){_0x193a26[_0x15f3('0x9c')]=qs['limit'](_0x5080fa[_0x15f3('0x88')][_0x15f3('0x9c')]);_0x193a26[_0x15f3('0x9d')]=qs[_0x15f3('0x9d')](_0x5080fa['query'][_0x15f3('0x9d')]);}_0x193a26[_0x15f3('0x9e')]=qs[_0x15f3('0x9f')](_0x5080fa[_0x15f3('0x88')][_0x15f3('0x9f')]);_0x193a26[_0x15f3('0x83')]=qs[_0x15f3('0x97')](_[_0x15f3('0xa0')](_0x5080fa[_0x15f3('0x88')],_0x268217[_0x15f3('0x97')]));if(_0x5080fa[_0x15f3('0x88')][_0x15f3('0x5')]){_0x193a26[_0x15f3('0x83')]=_[_0x15f3('0xa1')](_0x193a26[_0x15f3('0x83')],{'$or':_['map'](_0xa219e5,function(_0x391636){if(_0x391636[_0x15f3('0x10')][_0x15f3('0xa2')]!==_0x15f3('0xa3')){var _0x5e4106={};_0x5e4106[_0x391636['field']]={'$like':'%'+_0x5080fa['query'][_0x15f3('0x5')]+'%'};return _0x5e4106;}})});}var _0x2e59c9=[];var _0x3aebbf=null;var _0x412cd4={};if(_0x42fd58){_0x3aebbf=_[_0x15f3('0x93')](_0x255a22,[_0x15f3('0x1b'),_0x42fd58['name']]);if(_0x3aebbf[_0x15f3('0xb')]){_0x412cd4={};if(_0x1728e7[_0x15f3('0x14')]===_0x15f3('0x78')){_0x412cd4[_0x3aebbf[_0x15f3('0xa4')]]=_['map'](_0x42fd58[_0x15f3('0x8')],'id');}else{_0x412cd4[_0x3aebbf[_0x15f3('0xa4')]]=_0x42fd58[_0x15f3('0x8')];}_0x2e59c9[_0x15f3('0x8e')](_0x412cd4);}else{_0x193a26['where']['id']=_0x42fd58[_0x15f3('0x8')];}}else{for(var _0x1aac70=0x0;_0x1aac70<_0x172c05[_0x15f3('0x8d')];_0x1aac70++){_0x3aebbf=_[_0x15f3('0x93')](_0x255a22,['name',_0x172c05[_0x1aac70][_0x15f3('0x1b')]]);if(_0x3aebbf[_0x15f3('0xb')]){_0x412cd4={};_0x412cd4[_0x3aebbf[_0x15f3('0xa4')]]=_0x172c05[_0x1aac70][_0x15f3('0x8')];_0x2e59c9[_0x15f3('0x8e')](_0x412cd4);}else{if(!_0x193a26[_0x15f3('0x83')]['id'])_0x193a26[_0x15f3('0x83')]['id']=[];_0x172c05[_0x1aac70][_0x15f3('0x8')][_0x15f3('0xa5')](function(_0x310ca6){_0x193a26['where']['id'][_0x15f3('0x8e')](_0x310ca6);});}}}if(!_[_0x15f3('0x8c')](_0x2e59c9)){_0x193a26[_0x15f3('0x83')]=_['merge'](_0x193a26[_0x15f3('0x83')],{'$and':{'$or':_0x2e59c9}});}_0x193a26=_['merge']({},_0x193a26,_0x5080fa[_0x15f3('0xa6')]);if(_0x42fd58&&!_0x42fd58['autoAssociation']&&_0x1728e7[_0x15f3('0x14')]===_0x15f3('0x78')){if(_0x5080fa['query'][_0x15f3('0xa7')]){_0x193a26['include']=[{'all':!![]}];}return _0x138d17[_0x1728e7['childModel']][_0x15f3('0x6')](_0x193a26)[_0x15f3('0x7')](function(_0x1fb449){var _0x7cd73c=[];_0x1fb449[_0x15f3('0xa5')](function(_0x265dc7){var _0x419c71;switch(_0x265dc7[_0x15f3('0xa8')]){case _0x15f3('0xa9'):_0x419c71=_['find'](_0x42fd58[_0x15f3('0x8')],function(_0x91a464){return _0x91a464['id']===_0x265dc7[_0x15f3('0x7a')]&&_0x91a464[_0x15f3('0x10')]===_0x15f3('0xaa');});break;case _0x15f3('0xab'):_0x419c71=_[_0x15f3('0x93')](_0x42fd58['associatedResources'],function(_0x4d4de7){return _0x4d4de7['id']===_0x265dc7[_0x15f3('0x7a')]&&_0x4d4de7['type']===_0x15f3('0xac');});break;}if(_0x419c71)_0x7cd73c[_0x15f3('0x8e')](_0x265dc7);});_0x599388[_0x15f3('0xad')]=_0x7cd73c[_0x15f3('0x8d')];_0x599388[_0x15f3('0xae')]=_0x7cd73c;return _0x599388;});}else{return _0x138d17[_0x1728e7['childModel']][_0x15f3('0xad')]({'where':_0x193a26['where']})[_0x15f3('0x7')](function(_0x361a6d){_0x599388[_0x15f3('0xad')]=_0x361a6d;if(_0x5080fa[_0x15f3('0x88')][_0x15f3('0xa7')]){if(_0x1728e7[_0x15f3('0x14')]===_0x15f3('0x20')){_0x193a26[_0x15f3('0xaf')]=[{'model':_0x138d17[_0x15f3('0x6e')],'as':_0x15f3('0xb0'),'attributes':['id',_0x15f3('0x1b'),_0x15f3('0xb1')],'required':_0x5080fa[_0x15f3('0x88')][_0x15f3('0xb2')]?!![]:![]},{'model':_0x138d17[_0x15f3('0x6e')],'as':'ThroughTags','attributes':['id',_0x15f3('0x1b'),_0x15f3('0xb1')],'through':_0x5080fa[_0x15f3('0x88')][_0x15f3('0xb2')]?{'attributes':[],'where':{'TagId':_0x5080fa['query'][_0x15f3('0xb2')]||undefined}}:{},'required':_0x5080fa[_0x15f3('0x88')][_0x15f3('0xb2')]?!![]:![]}];}else{_0x193a26[_0x15f3('0xaf')]=[{'all':!![]}];}}return _0x138d17[_0x1728e7[_0x15f3('0x14')]][_0x15f3('0x6')](_0x193a26);})['then'](function(_0x16b82b){_0x599388[_0x15f3('0xae')]=_0x16b82b;if(_0x4881f4==='Agents'&&_0x5080fa[_0x15f3('0x88')][_0x15f3('0xb3')]===_0x15f3('0xb4')){var _0x3f3edc=[];for(var _0xf6404f=0x0;_0xf6404f<_0x599388[_0x15f3('0xae')][_0x15f3('0x8d')];_0xf6404f++){_0x3f3edc[_0x15f3('0x8e')](_0xf8e3af('chat',_0x599388[_0x15f3('0xae')][_0xf6404f][_0x15f3('0xb5')]));_0x3f3edc[_0x15f3('0x8e')](_0xf8e3af(_0x15f3('0xb6'),_0x599388['rows'][_0xf6404f][_0x15f3('0xb5')]));_0x3f3edc[_0x15f3('0x8e')](_0xf8e3af(_0x15f3('0xb7'),_0x599388[_0x15f3('0xae')][_0xf6404f][_0x15f3('0xb5')]));_0x3f3edc[_0x15f3('0x8e')](_0xf8e3af(_0x15f3('0xb8'),_0x599388[_0x15f3('0xae')][_0xf6404f][_0x15f3('0xb5')]));_0x3f3edc[_0x15f3('0x8e')](_0xf8e3af(_0x15f3('0xb9'),_0x599388[_0x15f3('0xae')][_0xf6404f]['dataValues']));_0x3f3edc['push'](_0xf8e3af(_0x15f3('0xba'),_0x599388[_0x15f3('0xae')][_0xf6404f]['dataValues']));}return Promise[_0x15f3('0x90')](_0x3f3edc)['then'](function(){return _0x599388;});}return _0x599388;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index cf446c1..2fc79c3 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 _0x27a0=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http'];(function(_0x41262b,_0x261404){var _0x1c6d9d=function(_0x221ebc){while(--_0x221ebc){_0x41262b['push'](_0x41262b['shift']());}};_0x1c6d9d(++_0x261404);}(_0x27a0,0xbf));var _0x027a=function(_0x3d7bf9,_0xf5499f){_0x3d7bf9=_0x3d7bf9-0x0;var _0x5a9872=_0x27a0[_0x3d7bf9];return _0x5a9872;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});config[_0x027a('0x9')]=_[_0x027a('0xa')](config['redis'],{'host':_0x027a('0xb'),'port':0x18eb});var socket=require(_0x027a('0xc'))(new Redis(config[_0x027a('0x9')]));require('./userProfile.socket')[_0x027a('0xd')](socket);function respondWithRpcPromise(_0x42ccac,_0x2d13a2,_0x534902){return new BPromise(function(_0x6d5b04,_0xe5df59){return client[_0x027a('0xe')](_0x42ccac,_0x534902)[_0x027a('0xf')](function(_0x172eb4){logger[_0x027a('0x10')](_0x027a('0x11'),_0x2d13a2,_0x027a('0x12'));logger[_0x027a('0x13')](_0x027a('0x14'),_0x2d13a2,_0x027a('0x12'),JSON['stringify'](_0x172eb4));if(_0x172eb4[_0x027a('0x15')]){if(_0x172eb4[_0x027a('0x15')][_0x027a('0x16')]===0x1f4){logger[_0x027a('0x15')](_0x027a('0x11'),_0x2d13a2,_0x172eb4['error']['message']);return _0xe5df59(_0x172eb4[_0x027a('0x15')]['message']);}logger[_0x027a('0x15')]('UserProfile,\x20%s,\x20%s',_0x2d13a2,_0x172eb4[_0x027a('0x15')]['message']);return _0x6d5b04(_0x172eb4['error']['message']);}else{logger[_0x027a('0x10')](_0x027a('0x11'),_0x2d13a2,_0x027a('0x12'));_0x6d5b04(_0x172eb4[_0x027a('0x17')]['message']);}})[_0x027a('0x18')](function(_0x2fccf6){logger['error']('UserProfile,\x20%s,\x20%s',_0x2d13a2,_0x2fccf6);_0xe5df59(_0x2fccf6);});});} \ No newline at end of file +var _0x187d=['stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x22b853,_0x4ab6b8){var _0x4697fb=function(_0x51cf72){while(--_0x51cf72){_0x22b853['push'](_0x22b853['shift']());}};_0x4697fb(++_0x4ab6b8);}(_0x187d,0x93));var _0xd187=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x187d[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});config[_0xd187('0xb')]=_[_0xd187('0xc')](config[_0xd187('0xb')],{'host':_0xd187('0xd'),'port':0x18eb});var socket=require(_0xd187('0xe'))(new Redis(config[_0xd187('0xb')]));require('./userProfile.socket')[_0xd187('0xf')](socket);function respondWithRpcPromise(_0x42848b,_0x4039f6,_0x473866){return new BPromise(function(_0x33ca45,_0x2a61a4){return client['request'](_0x42848b,_0x473866)[_0xd187('0x10')](function(_0x412ccf){logger[_0xd187('0x11')]('UserProfile,\x20%s,\x20%s',_0x4039f6,_0xd187('0x12'));logger[_0xd187('0x13')](_0xd187('0x14'),_0x4039f6,'request\x20sent',JSON[_0xd187('0x15')](_0x412ccf));if(_0x412ccf[_0xd187('0x16')]){if(_0x412ccf[_0xd187('0x16')][_0xd187('0x17')]===0x1f4){logger['error'](_0xd187('0x18'),_0x4039f6,_0x412ccf[_0xd187('0x16')][_0xd187('0x19')]);return _0x2a61a4(_0x412ccf[_0xd187('0x16')]['message']);}logger[_0xd187('0x16')]('UserProfile,\x20%s,\x20%s',_0x4039f6,_0x412ccf['error'][_0xd187('0x19')]);return _0x33ca45(_0x412ccf['error']['message']);}else{logger[_0xd187('0x11')](_0xd187('0x18'),_0x4039f6,_0xd187('0x12'));_0x33ca45(_0x412ccf[_0xd187('0x1a')][_0xd187('0x19')]);}})[_0xd187('0x1b')](function(_0x12b388){logger[_0xd187('0x16')](_0xd187('0x18'),_0x4039f6,_0x12b388);_0x2a61a4(_0x12b388);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 96143a8..0cb6e9c 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 _0xd10a=['remove','update','emit','removeListener','length','./userProfile.events','save'];(function(_0x2d5eac,_0x40c425){var _0x57d926=function(_0x5cf8e1){while(--_0x5cf8e1){_0x2d5eac['push'](_0x2d5eac['shift']());}};_0x57d926(++_0x40c425);}(_0xd10a,0x1e8));var _0xad10=function(_0x3c07c8,_0x553ecd){_0x3c07c8=_0x3c07c8-0x0;var _0x1ef9b1=_0xd10a[_0x3c07c8];return _0x1ef9b1;};'use strict';var UserProfileEvents=require(_0xad10('0x0'));var events=[_0xad10('0x1'),_0xad10('0x2'),_0xad10('0x3')];function createListener(_0x7e53e2,_0x147dc7){return function(_0x4650c7){_0x147dc7[_0xad10('0x4')](_0x7e53e2,_0x4650c7);};}function removeListener(_0x19c6bc,_0x358a69){return function(){UserProfileEvents[_0xad10('0x5')](_0x19c6bc,_0x358a69);};}exports['register']=function(_0x1086fe){for(var _0x1a52f3=0x0,_0x10576f=events[_0xad10('0x6')];_0x1a52f3<_0x10576f;_0x1a52f3++){var _0x30a3dc=events[_0x1a52f3];var _0xa31b5e=createListener('userProfile:'+_0x30a3dc,_0x1086fe);UserProfileEvents['on'](_0x30a3dc,_0xa31b5e);}}; \ No newline at end of file +var _0x8740=['length','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x565a45,_0x3db7ab){var _0x186e3b=function(_0x12697d){while(--_0x12697d){_0x565a45['push'](_0x565a45['shift']());}};_0x186e3b(++_0x3db7ab);}(_0x8740,0xa2));var _0x0874=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x8740[_0x42bdad];return _0x122626;};'use strict';var UserProfileEvents=require(_0x0874('0x0'));var events=['save',_0x0874('0x1'),_0x0874('0x2')];function createListener(_0x124241,_0x31322f){return function(_0x17acbb){_0x31322f[_0x0874('0x3')](_0x124241,_0x17acbb);};}function removeListener(_0x2c50c1,_0x19165d){return function(){UserProfileEvents[_0x0874('0x4')](_0x2c50c1,_0x19165d);};}exports[_0x0874('0x5')]=function(_0x431dd8){for(var _0x29b260=0x0,_0x50c2e2=events[_0x0874('0x6')];_0x29b260<_0x50c2e2;_0x29b260++){var _0x40d809=events[_0x29b260];var _0x50176f=createListener('userProfile:'+_0x40d809,_0x431dd8);UserProfileEvents['on'](_0x40d809,_0x50176f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 99c4267..879f3e7 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 _0xc2c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x23a477,_0x36bd86){var _0x1a6fb2=function(_0x4e9f26){while(--_0x4e9f26){_0x23a477['push'](_0x23a477['shift']());}};_0x1a6fb2(++_0x36bd86);}(_0xc2c3,0x16b));var _0x3c2c=function(_0x1d1505,_0x4e16e1){_0x1d1505=_0x1d1505-0x0;var _0x5a04f3=_0xc2c3[_0x1d1505];return _0x5a04f3;};'use strict';var multer=require(_0x3c2c('0x0'));var util=require('util');var path=require(_0x3c2c('0x1'));var timeout=require(_0x3c2c('0x2'));var express=require(_0x3c2c('0x3'));var router=express[_0x3c2c('0x4')]();var fs_extra=require(_0x3c2c('0x5'));var auth=require(_0x3c2c('0x6'));var interaction=require(_0x3c2c('0x7'));var config=require(_0x3c2c('0x8'));var controller=require('./userProfileResource.controller');router[_0x3c2c('0x9')]('/',auth[_0x3c2c('0xa')](),controller[_0x3c2c('0xb')]);router[_0x3c2c('0x9')](_0x3c2c('0xc'),auth[_0x3c2c('0xa')](),controller['describe']);router['get'](_0x3c2c('0xd'),auth[_0x3c2c('0xa')](),controller[_0x3c2c('0xe')]);router[_0x3c2c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3c2c('0x10')](_0x3c2c('0xd'),auth[_0x3c2c('0xa')](),controller[_0x3c2c('0x11')]);router[_0x3c2c('0x12')]('/:id',auth[_0x3c2c('0xa')](),controller[_0x3c2c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5040=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','show','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x4e5500,_0x45c9ab){var _0x35bf47=function(_0x2adc76){while(--_0x2adc76){_0x4e5500['push'](_0x4e5500['shift']());}};_0x35bf47(++_0x45c9ab);}(_0x5040,0x8a));var _0x0504=function(_0x13afe7,_0x30b1cb){_0x13afe7=_0x13afe7-0x0;var _0x11233a=_0x5040[_0x13afe7];return _0x11233a;};'use strict';var multer=require(_0x0504('0x0'));var util=require('util');var path=require(_0x0504('0x1'));var timeout=require(_0x0504('0x2'));var express=require(_0x0504('0x3'));var router=express[_0x0504('0x4')]();var fs_extra=require(_0x0504('0x5'));var auth=require(_0x0504('0x6'));var interaction=require(_0x0504('0x7'));var config=require(_0x0504('0x8'));var controller=require(_0x0504('0x9'));router[_0x0504('0xa')]('/',auth[_0x0504('0xb')](),controller['index']);router['get']('/describe',auth[_0x0504('0xb')](),controller[_0x0504('0xc')]);router[_0x0504('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0504('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0504('0xe')](_0x0504('0xf'),auth['isAuthenticated'](),controller[_0x0504('0x10')]);router[_0x0504('0x11')](_0x0504('0xf'),auth['isAuthenticated'](),controller[_0x0504('0x12')]);module[_0x0504('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9278203..81c0b2c 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 _0x0d13=['INTEGER','STRING'];(function(_0x220dad,_0x42b465){var _0x53c9ff=function(_0x56af33){while(--_0x56af33){_0x220dad['push'](_0x220dad['shift']());}};_0x53c9ff(++_0x42b465);}(_0x0d13,0xf9));var _0x30d1=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x0d13[_0x3ea913];return _0x2b4f28;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x30d1('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x30d1('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1146=['sequelize','exports','STRING'];(function(_0x26c85e,_0x519f63){var _0x359bcd=function(_0xb36d8e){while(--_0xb36d8e){_0x26c85e['push'](_0x26c85e['shift']());}};_0x359bcd(++_0x519f63);}(_0x1146,0x1cb));var _0x6114=function(_0x3a048b,_0x22062b){_0x3a048b=_0x3a048b-0x0;var _0x1b7322=_0x1146[_0x3a048b];return _0x1b7322;};'use strict';var Sequelize=require(_0x6114('0x0'));module[_0x6114('0x1')]={'name':{'type':Sequelize[_0x6114('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 9f69ebe..521e32f 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 _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x4add18,_0x30cb5f){var _0x43edc6=function(_0x50cdf9){while(--_0x50cdf9){_0x4add18['push'](_0x4add18['shift']());}};_0x43edc6(++_0x30cb5f);}(_0x33af,0xec));var _0xf33a=function(_0x140931,_0x2ffeba){_0x140931=_0x140931-0x0;var _0x4718ab=_0x33af[_0x140931];return _0x4718ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['UserProfileResource'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['UserProfileResource']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['UserProfileResource'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4750e5a..cf7734b 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 _0x51d0=['exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x1953a9,_0x556ffc){var _0x5c9c61=function(_0x30b48c){while(--_0x30b48c){_0x1953a9['push'](_0x1953a9['shift']());}};_0x5c9c61(++_0x556ffc);}(_0x51d0,0x1d7));var _0x051d=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x51d0[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0x051d('0x0'));var util=require('util');var logger=require(_0x051d('0x1'))(_0x051d('0x2'));var moment=require(_0x051d('0x3'));var BPromise=require(_0x051d('0x4'));var rp=require(_0x051d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x051d('0x6'));var config=require(_0x051d('0x7'));var attributes=require(_0x051d('0x8'));module[_0x051d('0x9')]=function(_0x2e265b,_0x34c413){return _0x2e265b[_0x051d('0xa')](_0x051d('0xb'),attributes,{'tableName':_0x051d('0xc'),'paranoid':![],'indexes':[{'name':_0x051d('0xd'),'fields':[_0x051d('0xe'),_0x051d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e19=['compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources'];(function(_0x39ea3a,_0x392dd9){var _0x527b95=function(_0x41415b){while(--_0x41415b){_0x39ea3a['push'](_0x39ea3a['shift']());}};_0x527b95(++_0x392dd9);}(_0x2e19,0xcf));var _0x92e1=function(_0x38e6c7,_0x549455){_0x38e6c7=_0x38e6c7-0x0;var _0x8dd3c4=_0x2e19[_0x38e6c7];return _0x8dd3c4;};'use strict';var _=require(_0x92e1('0x0'));var util=require(_0x92e1('0x1'));var logger=require(_0x92e1('0x2'))(_0x92e1('0x3'));var moment=require(_0x92e1('0x4'));var BPromise=require(_0x92e1('0x5'));var rp=require(_0x92e1('0x6'));var fs=require('fs');var path=require(_0x92e1('0x7'));var rimraf=require(_0x92e1('0x8'));var config=require(_0x92e1('0x9'));var attributes=require(_0x92e1('0xa'));module[_0x92e1('0xb')]=function(_0x52b47a,_0x5ad4b1){return _0x52b47a[_0x92e1('0xc')]('UserProfileResource',attributes,{'tableName':_0x92e1('0xd'),'paranoid':![],'indexes':[{'name':_0x92e1('0xe'),'fields':[_0x92e1('0xf'),_0x92e1('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e6a5cb0..4ef14cf 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 _0x8266=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5265f9,_0x12efe3){var _0x24a468=function(_0x12bff){while(--_0x12bff){_0x5265f9['push'](_0x5265f9['shift']());}};_0x24a468(++_0x12efe3);}(_0x8266,0x18e));var _0x6826=function(_0xa06493,_0x42a829){_0xa06493=_0xa06493-0x0;var _0x4c8b06=_0x8266[_0xa06493];return _0x4c8b06;};'use strict';var _=require(_0x6826('0x0'));var util=require(_0x6826('0x1'));var moment=require(_0x6826('0x2'));var BPromise=require(_0x6826('0x3'));var rs=require(_0x6826('0x4'));var fs=require('fs');var Redis=require(_0x6826('0x5'));var db=require(_0x6826('0x6'))['db'];var utils=require(_0x6826('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6826('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6826('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d39dc,_0x45f8fe,_0x268aa9){return new BPromise(function(_0x52f465,_0x4da917){return client[_0x6826('0xa')](_0x1d39dc,_0x268aa9)[_0x6826('0xb')](function(_0x3a51f9){logger[_0x6826('0xc')](_0x6826('0xd'),_0x45f8fe,'request\x20sent');logger[_0x6826('0xe')](_0x6826('0xf'),_0x45f8fe,_0x6826('0x10'),JSON[_0x6826('0x11')](_0x3a51f9));if(_0x3a51f9[_0x6826('0x12')]){if(_0x3a51f9[_0x6826('0x12')][_0x6826('0x13')]===0x1f4){logger[_0x6826('0x12')](_0x6826('0xd'),_0x45f8fe,_0x3a51f9[_0x6826('0x12')][_0x6826('0x14')]);return _0x4da917(_0x3a51f9[_0x6826('0x12')]['message']);}logger[_0x6826('0x12')](_0x6826('0xd'),_0x45f8fe,_0x3a51f9[_0x6826('0x12')]['message']);return _0x52f465(_0x3a51f9[_0x6826('0x12')][_0x6826('0x14')]);}else{logger[_0x6826('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x45f8fe,_0x6826('0x10'));_0x52f465(_0x3a51f9[_0x6826('0x15')][_0x6826('0x14')]);}})['catch'](function(_0x223616){logger[_0x6826('0x12')](_0x6826('0xd'),_0x45f8fe,_0x223616);_0x4da917(_0x223616);});});} \ No newline at end of file +var _0x29c7=['then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0x29c7,0x13f));var _0x729c=function(_0x19b10d,_0x4da28b){_0x19b10d=_0x19b10d-0x0;var _0x4fd0d5=_0x29c7[_0x19b10d];return _0x4fd0d5;};'use strict';var _=require(_0x729c('0x0'));var util=require(_0x729c('0x1'));var moment=require(_0x729c('0x2'));var BPromise=require(_0x729c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x729c('0x4'));var logger=require(_0x729c('0x5'))('rpc');var config=require(_0x729c('0x6'));var jayson=require(_0x729c('0x7'));var client=jayson[_0x729c('0x8')][_0x729c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c743f,_0x3cb9bc,_0xf31baf){return new BPromise(function(_0x234923,_0x54aeee){return client[_0x729c('0xa')](_0x3c743f,_0xf31baf)[_0x729c('0xb')](function(_0x3cef9e){logger[_0x729c('0xc')](_0x729c('0xd'),_0x3cb9bc,_0x729c('0xe'));logger[_0x729c('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3cb9bc,'request\x20sent',JSON[_0x729c('0x10')](_0x3cef9e));if(_0x3cef9e[_0x729c('0x11')]){if(_0x3cef9e[_0x729c('0x11')][_0x729c('0x12')]===0x1f4){logger[_0x729c('0x11')](_0x729c('0xd'),_0x3cb9bc,_0x3cef9e[_0x729c('0x11')][_0x729c('0x13')]);return _0x54aeee(_0x3cef9e[_0x729c('0x11')][_0x729c('0x13')]);}logger[_0x729c('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3cb9bc,_0x3cef9e[_0x729c('0x11')][_0x729c('0x13')]);return _0x234923(_0x3cef9e[_0x729c('0x11')][_0x729c('0x13')]);}else{logger[_0x729c('0xc')](_0x729c('0xd'),_0x3cb9bc,'request\x20sent');_0x234923(_0x3cef9e[_0x729c('0x14')][_0x729c('0x13')]);}})[_0x729c('0x15')](function(_0x27fce3){logger[_0x729c('0x11')](_0x729c('0xd'),_0x3cb9bc,_0x27fce3);_0x54aeee(_0x27fce3);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 7cfa91c..69a087a 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 _0xc7a2=['/:id','show','post','create','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2f5137,_0x329fb6){var _0x582f81=function(_0x2f0225){while(--_0x2f0225){_0x2f5137['push'](_0x2f5137['shift']());}};_0x582f81(++_0x329fb6);}(_0xc7a2,0x15b));var _0x2c7a=function(_0x5bc8d1,_0x5800fe){_0x5bc8d1=_0x5bc8d1-0x0;var _0x5db7d0=_0xc7a2[_0x5bc8d1];return _0x5db7d0;};'use strict';var multer=require(_0x2c7a('0x0'));var util=require('util');var path=require(_0x2c7a('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c7a('0x2'));var router=express[_0x2c7a('0x3')]();var fs_extra=require(_0x2c7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2c7a('0x5'));var config=require(_0x2c7a('0x6'));var controller=require(_0x2c7a('0x7'));router['get']('/',auth[_0x2c7a('0x8')](),controller[_0x2c7a('0x9')]);router[_0x2c7a('0xa')](_0x2c7a('0xb'),auth[_0x2c7a('0x8')](),controller[_0x2c7a('0xc')]);router[_0x2c7a('0xa')](_0x2c7a('0xd'),auth[_0x2c7a('0x8')](),controller[_0x2c7a('0xe')]);router[_0x2c7a('0xf')]('/',auth[_0x2c7a('0x8')](),controller[_0x2c7a('0x10')]);router['put'](_0x2c7a('0xd'),auth[_0x2c7a('0x8')](),controller[_0x2c7a('0x11')]);router[_0x2c7a('0x12')]('/:id',auth[_0x2c7a('0x8')](),controller['destroy']);module[_0x2c7a('0x13')]=router; \ No newline at end of file +var _0x2cf9=['../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2cf9,0x160));var _0x92cf=function(_0x3752f8,_0xe21391){_0x3752f8=_0x3752f8-0x0;var _0x33dbb0=_0x2cf9[_0x3752f8];return _0x33dbb0;};'use strict';var multer=require(_0x92cf('0x0'));var util=require(_0x92cf('0x1'));var path=require(_0x92cf('0x2'));var timeout=require(_0x92cf('0x3'));var express=require(_0x92cf('0x4'));var router=express['Router']();var fs_extra=require(_0x92cf('0x5'));var auth=require(_0x92cf('0x6'));var interaction=require(_0x92cf('0x7'));var config=require(_0x92cf('0x8'));var controller=require(_0x92cf('0x9'));router['get']('/',auth[_0x92cf('0xa')](),controller[_0x92cf('0xb')]);router[_0x92cf('0xc')](_0x92cf('0xd'),auth[_0x92cf('0xa')](),controller[_0x92cf('0xe')]);router[_0x92cf('0xc')](_0x92cf('0xf'),auth[_0x92cf('0xa')](),controller[_0x92cf('0x10')]);router[_0x92cf('0x11')]('/',auth[_0x92cf('0xa')](),controller[_0x92cf('0x12')]);router[_0x92cf('0x13')](_0x92cf('0xf'),auth[_0x92cf('0xa')](),controller[_0x92cf('0x14')]);router[_0x92cf('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x92cf('0x16')]);module[_0x92cf('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9e7eb1d..336e4d2 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 _0x056b=['getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x5c9ebf,_0x462c1c){var _0x3f539e=function(_0xd00a3c){while(--_0xd00a3c){_0x5c9ebf['push'](_0x5c9ebf['shift']());}};_0x3f539e(++_0x462c1c);}(_0x056b,0xb6));var _0xb056=function(_0x1dc697,_0x443268){_0x1dc697=_0x1dc697-0x0;var _0xc24af4=_0x056b[_0x1dc697];return _0xc24af4;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb056('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb056('0x1')],'set':function(_0x4157e0){this[_0xb056('0x4')](_0xb056('0x5'),_0x4157e0?_0x4157e0[_0xb056('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xb056('0x5'))?this[_0xb056('0x7')](_0xb056('0x5'))[_0xb056('0x8')](''):[];}}}; \ No newline at end of file +var _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0xa6e4c8,_0x52e242){var _0x29e0c8=function(_0x2caaf2){while(--_0x2caaf2){_0xa6e4c8['push'](_0xa6e4c8['shift']());}};_0x29e0c8(++_0x52e242);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2051d3,_0x4768e2){_0x2051d3=_0x2051d3-0x0;var _0x475857=_0x9ffd[_0x2051d3];return _0x475857;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd9ff('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd9ff('0x2')],'set':function(_0x53e962){this[_0xd9ff('0x5')](_0xd9ff('0x6'),_0x53e962?_0x53e962['join'](''):[]);},'get':function(){return this[_0xd9ff('0x7')](_0xd9ff('0x6'))?this[_0xd9ff('0x7')](_0xd9ff('0x6'))[_0xd9ff('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2e1f8f6..d386acc 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 _0x35cb=['catch','show','rawAttributes','fields','create','body','find','params','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../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','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','fieldName','key','map','keys','filters','intersection','query','attributes','model','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','findAll','rows'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x35cb,0x9f));var _0xb35c=function(_0x1c115f,_0xed0775){_0x1c115f=_0x1c115f-0x0;var _0x1fa5d6=_0x35cb[_0x1c115f];return _0x1fa5d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb35c('0x0'));var zipdir=require(_0xb35c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb35c('0x2'));var moment=require('moment');var BPromise=require(_0xb35c('0x3'));var Mustache=require(_0xb35c('0x4'));var util=require(_0xb35c('0x5'));var path=require(_0xb35c('0x6'));var sox=require(_0xb35c('0x7'));var csv=require(_0xb35c('0x8'));var ejs=require(_0xb35c('0x9'));var fs=require('fs');var fs_extra=require(_0xb35c('0xa'));var _=require('lodash');var squel=require(_0xb35c('0xb'));var crypto=require(_0xb35c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb35c('0xd'));var toCsv=require(_0xb35c('0x8'));var querystring=require(_0xb35c('0xe'));var Papa=require('papaparse');var Redis=require(_0xb35c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb35c('0x10'));var as=require(_0xb35c('0x11'));var hardwareService=require(_0xb35c('0x12'));var logger=require(_0xb35c('0x13'))('api');var utils=require(_0xb35c('0x14'));var config=require(_0xb35c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb35c('0x16'))['db'];function respondWithStatusCode(_0x4815f1,_0x2e9d9b){_0x2e9d9b=_0x2e9d9b||0xcc;return function(_0x10ef6d){if(_0x10ef6d){return _0x4815f1[_0xb35c('0x17')](_0x2e9d9b);}return _0x4815f1[_0xb35c('0x18')](_0x2e9d9b)[_0xb35c('0x19')]();};}function respondWithResult(_0x1755b3,_0x30a739){_0x30a739=_0x30a739||0xc8;return function(_0x479518){if(_0x479518){return _0x1755b3[_0xb35c('0x18')](_0x30a739)[_0xb35c('0x1a')](_0x479518);}};}function respondWithFilteredResult(_0x5525ac,_0x4bafae){return function(_0x183a61){if(_0x183a61){var _0x4a4cad=typeof _0x4bafae[_0xb35c('0x1b')]===_0xb35c('0x1c')&&typeof _0x4bafae[_0xb35c('0x1d')]===_0xb35c('0x1c');var _0x3d96f4=_0x183a61['count'];var _0x13bee8=_0x4a4cad?0x0:_0x4bafae[_0xb35c('0x1b')];var _0x429955=_0x4a4cad?_0x183a61[_0xb35c('0x1e')]:_0x4bafae[_0xb35c('0x1b')]+_0x4bafae['limit'];var _0x54331d;if(_0x429955>=_0x3d96f4){_0x429955=_0x3d96f4;_0x54331d=0xc8;}else{_0x54331d=0xce;}_0x5525ac[_0xb35c('0x18')](_0x54331d);return _0x5525ac[_0xb35c('0x1f')](_0xb35c('0x20'),_0x13bee8+'-'+_0x429955+'/'+_0x3d96f4)[_0xb35c('0x1a')](_0x183a61);}return null;};}function patchUpdates(_0x3cfaaf){return function(_0xe27c2d){try{jsonpatch[_0xb35c('0x21')](_0xe27c2d,_0x3cfaaf,!![]);}catch(_0x5b4ac7){return BPromise[_0xb35c('0x22')](_0x5b4ac7);}return _0xe27c2d[_0xb35c('0x23')]();};}function saveUpdates(_0x45dd1e,_0xafc592){return function(_0x59aa95){if(_0x59aa95){return _0x59aa95[_0xb35c('0x24')](_0x45dd1e)[_0xb35c('0x25')](function(_0x37f8a5){return _0x37f8a5;});}return null;};}function removeEntity(_0x2cb891,_0x3fc520){return function(_0x598f37){if(_0x598f37){return _0x598f37[_0xb35c('0x26')]()[_0xb35c('0x25')](function(){_0x2cb891['status'](0xcc)[_0xb35c('0x19')]();});}};}function handleEntityNotFound(_0xb96cf6,_0x9338a8){return function(_0x2e37f1){if(!_0x2e37f1){_0xb96cf6[_0xb35c('0x17')](0x194);}return _0x2e37f1;};}function handleError(_0x208914,_0x2c1f74){_0x2c1f74=_0x2c1f74||0x1f4;return function(_0x6e5a72){logger['error'](_0x6e5a72[_0xb35c('0x27')]);if(_0x6e5a72['name']){delete _0x6e5a72[_0xb35c('0x28')];}_0x208914[_0xb35c('0x18')](_0x2c1f74)['send'](_0x6e5a72);};}exports[_0xb35c('0x29')]=function(_0x5abda1,_0x15d828){var _0x3449a7={},_0x147fd8={},_0x42358f={'count':0x0,'rows':[]};var _0x53f4af=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x5bd93c){return{'name':_0x5bd93c[_0xb35c('0x2a')],'type':_0x5bd93c['type'][_0xb35c('0x2b')]};});_0x147fd8['model']=_[_0xb35c('0x2c')](_0x53f4af,_0xb35c('0x28'));_0x147fd8['query']=_[_0xb35c('0x2d')](_0x5abda1['query']);_0x147fd8[_0xb35c('0x2e')]=_[_0xb35c('0x2f')](_0x147fd8['model'],_0x147fd8[_0xb35c('0x30')]);_0x3449a7[_0xb35c('0x31')]=_[_0xb35c('0x2f')](_0x147fd8[_0xb35c('0x32')],qs['fields'](_0x5abda1[_0xb35c('0x30')]['fields']));_0x3449a7[_0xb35c('0x31')]=_0x3449a7[_0xb35c('0x31')][_0xb35c('0x33')]?_0x3449a7[_0xb35c('0x31')]:_0x147fd8[_0xb35c('0x32')];if(!_0x5abda1[_0xb35c('0x30')][_0xb35c('0x34')](_0xb35c('0x35'))){_0x3449a7[_0xb35c('0x1d')]=qs[_0xb35c('0x1d')](_0x5abda1[_0xb35c('0x30')][_0xb35c('0x1d')]);_0x3449a7[_0xb35c('0x1b')]=qs[_0xb35c('0x1b')](_0x5abda1[_0xb35c('0x30')][_0xb35c('0x1b')]);}_0x3449a7[_0xb35c('0x36')]=qs[_0xb35c('0x37')](_0x5abda1[_0xb35c('0x30')][_0xb35c('0x37')]);_0x3449a7['where']=qs[_0xb35c('0x2e')](_[_0xb35c('0x38')](_0x5abda1['query'],_0x147fd8[_0xb35c('0x2e')]),_0x53f4af);if(_0x5abda1['query'][_0xb35c('0x39')]){_0x3449a7[_0xb35c('0x3a')]=_[_0xb35c('0x3b')](_0x3449a7[_0xb35c('0x3a')],{'$or':_[_0xb35c('0x2c')](_0x53f4af,function(_0x129bc1){if(_0x129bc1['type']!==_0xb35c('0x3c')){var _0x3c79db={};_0x3c79db[_0x129bc1[_0xb35c('0x28')]]={'$like':'%'+_0x5abda1[_0xb35c('0x30')][_0xb35c('0x39')]+'%'};return _0x3c79db;}})});}_0x3449a7=_['merge']({},_0x3449a7,_0x5abda1[_0xb35c('0x3d')]);var _0x3d490d={'where':_0x3449a7[_0xb35c('0x3a')]};return db[_0xb35c('0x3e')][_0xb35c('0x1e')](_0x3d490d)['then'](function(_0x5b2cc1){_0x42358f[_0xb35c('0x1e')]=_0x5b2cc1;if(_0x5abda1[_0xb35c('0x30')][_0xb35c('0x3f')]){_0x3449a7['include']=[{'all':!![]}];}return db['UserProfileSection'][_0xb35c('0x40')](_0x3449a7);})[_0xb35c('0x25')](function(_0x3e437d){_0x42358f[_0xb35c('0x41')]=_0x3e437d;return _0x42358f;})[_0xb35c('0x25')](respondWithFilteredResult(_0x15d828,_0x3449a7))[_0xb35c('0x42')](handleError(_0x15d828,null));};exports[_0xb35c('0x43')]=function(_0x57cd8d,_0x21f72e){var _0x4077e1={'raw':![],'where':{'id':_0x57cd8d['params']['id']}},_0x10f7eb={};_0x10f7eb[_0xb35c('0x32')]=_[_0xb35c('0x2d')](db[_0xb35c('0x3e')][_0xb35c('0x44')]);_0x10f7eb[_0xb35c('0x30')]=_[_0xb35c('0x2d')](_0x57cd8d[_0xb35c('0x30')]);_0x10f7eb['filters']=_[_0xb35c('0x2f')](_0x10f7eb[_0xb35c('0x32')],_0x10f7eb[_0xb35c('0x30')]);_0x4077e1[_0xb35c('0x31')]=_[_0xb35c('0x2f')](_0x10f7eb[_0xb35c('0x32')],qs[_0xb35c('0x45')](_0x57cd8d[_0xb35c('0x30')][_0xb35c('0x45')]));_0x4077e1[_0xb35c('0x31')]=_0x4077e1[_0xb35c('0x31')][_0xb35c('0x33')]?_0x4077e1[_0xb35c('0x31')]:_0x10f7eb[_0xb35c('0x32')];if(_0x57cd8d[_0xb35c('0x30')][_0xb35c('0x3f')]){_0x4077e1['include']=[{'all':!![]}];}_0x4077e1=_['merge']({},_0x4077e1,_0x57cd8d[_0xb35c('0x3d')]);return db[_0xb35c('0x3e')]['find'](_0x4077e1)[_0xb35c('0x25')](handleEntityNotFound(_0x21f72e,null))[_0xb35c('0x25')](respondWithResult(_0x21f72e,null))['catch'](handleError(_0x21f72e,null));};exports[_0xb35c('0x46')]=function(_0x1468f8,_0x44a83e){return db[_0xb35c('0x3e')]['create'](_0x1468f8[_0xb35c('0x47')],{})[_0xb35c('0x25')](respondWithResult(_0x44a83e,0xc9))[_0xb35c('0x42')](handleError(_0x44a83e,null));};exports[_0xb35c('0x24')]=function(_0x521c5f,_0x52501c){if(_0x521c5f[_0xb35c('0x47')]['id']){delete _0x521c5f['body']['id'];}return db[_0xb35c('0x3e')][_0xb35c('0x48')]({'where':{'id':_0x521c5f['params']['id']}})['then'](handleEntityNotFound(_0x52501c,null))[_0xb35c('0x25')](saveUpdates(_0x521c5f[_0xb35c('0x47')],null))[_0xb35c('0x25')](respondWithResult(_0x52501c,null))[_0xb35c('0x42')](handleError(_0x52501c,null));};exports[_0xb35c('0x26')]=function(_0x2f2a31,_0x18e985){return db['UserProfileSection'][_0xb35c('0x48')]({'where':{'id':_0x2f2a31[_0xb35c('0x49')]['id']}})[_0xb35c('0x25')](handleEntityNotFound(_0x18e985,null))['then'](removeEntity(_0x18e985,null))[_0xb35c('0x42')](handleError(_0x18e985,null));};exports[_0xb35c('0x4a')]=function(_0x260e8b,_0x3ca231){return db['UserProfileSection'][_0xb35c('0x4a')]()[_0xb35c('0x25')](respondWithResult(_0x3ca231,null))[_0xb35c('0x42')](handleError(_0x3ca231,null));}; \ No newline at end of file +var _0xe1b7=['Content-Range','apply','reject','save','update','then','destroy','error','stack','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','name','filter','merge','includeAll','include','UserProfileSection','findAll','rows','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','count','offset','set'];(function(_0x257043,_0x994811){var _0x4dcd3e=function(_0x49a341){while(--_0x49a341){_0x257043['push'](_0x257043['shift']());}};_0x4dcd3e(++_0x994811);}(_0xe1b7,0xf5));var _0x7e1b=function(_0x11aadc,_0x1dd983){_0x11aadc=_0x11aadc-0x0;var _0x1a80bc=_0xe1b7[_0x11aadc];return _0x1a80bc;};'use strict';var emlformat=require(_0x7e1b('0x0'));var rimraf=require(_0x7e1b('0x1'));var zipdir=require(_0x7e1b('0x2'));var jsonpatch=require(_0x7e1b('0x3'));var rp=require('request-promise');var moment=require(_0x7e1b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7e1b('0x5'));var path=require('path');var sox=require(_0x7e1b('0x6'));var csv=require('to-csv');var ejs=require(_0x7e1b('0x7'));var fs=require('fs');var fs_extra=require(_0x7e1b('0x8'));var _=require('lodash');var squel=require(_0x7e1b('0x9'));var crypto=require(_0x7e1b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7e1b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7e1b('0xc'));var Papa=require(_0x7e1b('0xd'));var Redis=require('ioredis');var authService=require(_0x7e1b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e1b('0xf'));var logger=require(_0x7e1b('0x10'))('api');var utils=require(_0x7e1b('0x11'));var config=require(_0x7e1b('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46b017,_0x496214){_0x496214=_0x496214||0xcc;return function(_0x3fed0b){if(_0x3fed0b){return _0x46b017[_0x7e1b('0x13')](_0x496214);}return _0x46b017[_0x7e1b('0x14')](_0x496214)[_0x7e1b('0x15')]();};}function respondWithResult(_0x505745,_0x3505ae){_0x3505ae=_0x3505ae||0xc8;return function(_0x5224b7){if(_0x5224b7){return _0x505745['status'](_0x3505ae)[_0x7e1b('0x16')](_0x5224b7);}};}function respondWithFilteredResult(_0x180431,_0x3b57a2){return function(_0x5a6cb1){if(_0x5a6cb1){var _0x30f607=typeof _0x3b57a2['offset']==='undefined'&&typeof _0x3b57a2[_0x7e1b('0x17')]==='undefined';var _0x4f87da=_0x5a6cb1[_0x7e1b('0x18')];var _0xa73fac=_0x30f607?0x0:_0x3b57a2['offset'];var _0x1bfe8c=_0x30f607?_0x5a6cb1[_0x7e1b('0x18')]:_0x3b57a2[_0x7e1b('0x19')]+_0x3b57a2['limit'];var _0x2ca4f7;if(_0x1bfe8c>=_0x4f87da){_0x1bfe8c=_0x4f87da;_0x2ca4f7=0xc8;}else{_0x2ca4f7=0xce;}_0x180431['status'](_0x2ca4f7);return _0x180431[_0x7e1b('0x1a')](_0x7e1b('0x1b'),_0xa73fac+'-'+_0x1bfe8c+'/'+_0x4f87da)[_0x7e1b('0x16')](_0x5a6cb1);}return null;};}function patchUpdates(_0x2aef8f){return function(_0x3a2544){try{jsonpatch[_0x7e1b('0x1c')](_0x3a2544,_0x2aef8f,!![]);}catch(_0x44e82d){return BPromise[_0x7e1b('0x1d')](_0x44e82d);}return _0x3a2544[_0x7e1b('0x1e')]();};}function saveUpdates(_0x15109f,_0x2fbf10){return function(_0x2afc5f){if(_0x2afc5f){return _0x2afc5f[_0x7e1b('0x1f')](_0x15109f)[_0x7e1b('0x20')](function(_0x389a31){return _0x389a31;});}return null;};}function removeEntity(_0xddc03f,_0x3b412c){return function(_0x165ddd){if(_0x165ddd){return _0x165ddd[_0x7e1b('0x21')]()['then'](function(){_0xddc03f[_0x7e1b('0x14')](0xcc)[_0x7e1b('0x15')]();});}};}function handleEntityNotFound(_0x3fc5ec,_0x784dde){return function(_0x2ce7c8){if(!_0x2ce7c8){_0x3fc5ec['sendStatus'](0x194);}return _0x2ce7c8;};}function handleError(_0x25ffbb,_0x5348c5){_0x5348c5=_0x5348c5||0x1f4;return function(_0x321860){logger[_0x7e1b('0x22')](_0x321860[_0x7e1b('0x23')]);if(_0x321860['name']){delete _0x321860['name'];}_0x25ffbb[_0x7e1b('0x14')](_0x5348c5)['send'](_0x321860);};}exports['index']=function(_0x396cbe,_0x39cd84){var _0x24954a={},_0xa0fd77={},_0x917dda={'count':0x0,'rows':[]};var _0x4da94c=_[_0x7e1b('0x24')](db['UserProfileSection'][_0x7e1b('0x25')],function(_0x27891a){return{'name':_0x27891a[_0x7e1b('0x26')],'type':_0x27891a[_0x7e1b('0x27')][_0x7e1b('0x28')]};});_0xa0fd77[_0x7e1b('0x29')]=_[_0x7e1b('0x24')](_0x4da94c,'name');_0xa0fd77['query']=_[_0x7e1b('0x2a')](_0x396cbe[_0x7e1b('0x2b')]);_0xa0fd77[_0x7e1b('0x2c')]=_[_0x7e1b('0x2d')](_0xa0fd77[_0x7e1b('0x29')],_0xa0fd77['query']);_0x24954a[_0x7e1b('0x2e')]=_['intersection'](_0xa0fd77[_0x7e1b('0x29')],qs[_0x7e1b('0x2f')](_0x396cbe[_0x7e1b('0x2b')][_0x7e1b('0x2f')]));_0x24954a[_0x7e1b('0x2e')]=_0x24954a['attributes'][_0x7e1b('0x30')]?_0x24954a[_0x7e1b('0x2e')]:_0xa0fd77[_0x7e1b('0x29')];if(!_0x396cbe[_0x7e1b('0x2b')]['hasOwnProperty']('nolimit')){_0x24954a['limit']=qs['limit'](_0x396cbe[_0x7e1b('0x2b')]['limit']);_0x24954a[_0x7e1b('0x19')]=qs['offset'](_0x396cbe[_0x7e1b('0x2b')][_0x7e1b('0x19')]);}_0x24954a[_0x7e1b('0x31')]=qs['sort'](_0x396cbe[_0x7e1b('0x2b')][_0x7e1b('0x32')]);_0x24954a[_0x7e1b('0x33')]=qs[_0x7e1b('0x2c')](_[_0x7e1b('0x34')](_0x396cbe[_0x7e1b('0x2b')],_0xa0fd77['filters']),_0x4da94c);if(_0x396cbe[_0x7e1b('0x2b')]['filter']){_0x24954a['where']=_['merge'](_0x24954a[_0x7e1b('0x33')],{'$or':_['map'](_0x4da94c,function(_0x46ae5a){if(_0x46ae5a[_0x7e1b('0x27')]!=='VIRTUAL'){var _0x924ed9={};_0x924ed9[_0x46ae5a[_0x7e1b('0x35')]]={'$like':'%'+_0x396cbe[_0x7e1b('0x2b')][_0x7e1b('0x36')]+'%'};return _0x924ed9;}})});}_0x24954a=_[_0x7e1b('0x37')]({},_0x24954a,_0x396cbe['options']);var _0x569712={'where':_0x24954a[_0x7e1b('0x33')]};return db['UserProfileSection']['count'](_0x569712)[_0x7e1b('0x20')](function(_0x3170cf){_0x917dda[_0x7e1b('0x18')]=_0x3170cf;if(_0x396cbe['query'][_0x7e1b('0x38')]){_0x24954a[_0x7e1b('0x39')]=[{'all':!![]}];}return db[_0x7e1b('0x3a')][_0x7e1b('0x3b')](_0x24954a);})['then'](function(_0x4ca380){_0x917dda[_0x7e1b('0x3c')]=_0x4ca380;return _0x917dda;})[_0x7e1b('0x20')](respondWithFilteredResult(_0x39cd84,_0x24954a))['catch'](handleError(_0x39cd84,null));};exports[_0x7e1b('0x3d')]=function(_0x14fe36,_0x22c8f3){var _0x336a63={'raw':![],'where':{'id':_0x14fe36['params']['id']}},_0x2728c2={};_0x2728c2[_0x7e1b('0x29')]=_[_0x7e1b('0x2a')](db[_0x7e1b('0x3a')][_0x7e1b('0x25')]);_0x2728c2[_0x7e1b('0x2b')]=_[_0x7e1b('0x2a')](_0x14fe36[_0x7e1b('0x2b')]);_0x2728c2['filters']=_[_0x7e1b('0x2d')](_0x2728c2[_0x7e1b('0x29')],_0x2728c2[_0x7e1b('0x2b')]);_0x336a63[_0x7e1b('0x2e')]=_[_0x7e1b('0x2d')](_0x2728c2[_0x7e1b('0x29')],qs[_0x7e1b('0x2f')](_0x14fe36[_0x7e1b('0x2b')][_0x7e1b('0x2f')]));_0x336a63[_0x7e1b('0x2e')]=_0x336a63[_0x7e1b('0x2e')][_0x7e1b('0x30')]?_0x336a63[_0x7e1b('0x2e')]:_0x2728c2[_0x7e1b('0x29')];if(_0x14fe36[_0x7e1b('0x2b')][_0x7e1b('0x38')]){_0x336a63[_0x7e1b('0x39')]=[{'all':!![]}];}_0x336a63=_[_0x7e1b('0x37')]({},_0x336a63,_0x14fe36['options']);return db['UserProfileSection'][_0x7e1b('0x3e')](_0x336a63)[_0x7e1b('0x20')](handleEntityNotFound(_0x22c8f3,null))[_0x7e1b('0x20')](respondWithResult(_0x22c8f3,null))[_0x7e1b('0x3f')](handleError(_0x22c8f3,null));};exports[_0x7e1b('0x40')]=function(_0x59bf68,_0x4d3d23){return db[_0x7e1b('0x3a')][_0x7e1b('0x40')](_0x59bf68['body'],{})[_0x7e1b('0x20')](respondWithResult(_0x4d3d23,0xc9))[_0x7e1b('0x3f')](handleError(_0x4d3d23,null));};exports[_0x7e1b('0x1f')]=function(_0x36b6ab,_0x28501b){if(_0x36b6ab[_0x7e1b('0x41')]['id']){delete _0x36b6ab[_0x7e1b('0x41')]['id'];}return db[_0x7e1b('0x3a')][_0x7e1b('0x3e')]({'where':{'id':_0x36b6ab[_0x7e1b('0x42')]['id']}})[_0x7e1b('0x20')](handleEntityNotFound(_0x28501b,null))[_0x7e1b('0x20')](saveUpdates(_0x36b6ab[_0x7e1b('0x41')],null))[_0x7e1b('0x20')](respondWithResult(_0x28501b,null))[_0x7e1b('0x3f')](handleError(_0x28501b,null));};exports[_0x7e1b('0x21')]=function(_0x32cfe6,_0x525278){return db[_0x7e1b('0x3a')][_0x7e1b('0x3e')]({'where':{'id':_0x32cfe6[_0x7e1b('0x42')]['id']}})[_0x7e1b('0x20')](handleEntityNotFound(_0x525278,null))[_0x7e1b('0x20')](removeEntity(_0x525278,null))[_0x7e1b('0x3f')](handleError(_0x525278,null));};exports[_0x7e1b('0x43')]=function(_0x4587d2,_0x587957){return db[_0x7e1b('0x3a')][_0x7e1b('0x43')]()[_0x7e1b('0x20')](respondWithResult(_0x587957,null))[_0x7e1b('0x3f')](handleError(_0x587957,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 64a4e5d..316927f 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 _0x7863=['path','rimraf','../../config/environment','exports','define','UserProfileSection','compositeIndex','sectionId','lodash','util','api','moment','request-promise'];(function(_0x4864f1,_0x5eeb5f){var _0x585f9c=function(_0x2bc10b){while(--_0x2bc10b){_0x4864f1['push'](_0x4864f1['shift']());}};_0x585f9c(++_0x5eeb5f);}(_0x7863,0x133));var _0x3786=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0x7863[_0x50b66d];return _0x41aa8e;};'use strict';var _=require(_0x3786('0x0'));var util=require(_0x3786('0x1'));var logger=require('../../config/logger')(_0x3786('0x2'));var moment=require(_0x3786('0x3'));var BPromise=require('bluebird');var rp=require(_0x3786('0x4'));var fs=require('fs');var path=require(_0x3786('0x5'));var rimraf=require(_0x3786('0x6'));var config=require(_0x3786('0x7'));var attributes=require('./userProfileSection.attributes');module[_0x3786('0x8')]=function(_0xfaee1c,_0x1a05ca){return _0xfaee1c[_0x3786('0x9')](_0x3786('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x3786('0xb'),'fields':[_0x3786('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5872=['rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','util','api','bluebird','request-promise','path'];(function(_0x35fe8c,_0x2d5ac){var _0x346a2a=function(_0x2d4d0b){while(--_0x2d4d0b){_0x35fe8c['push'](_0x35fe8c['shift']());}};_0x346a2a(++_0x2d5ac);}(_0x5872,0x10c));var _0x2587=function(_0x500c0,_0xdb6a03){_0x500c0=_0x500c0-0x0;var _0xdd146f=_0x5872[_0x500c0];return _0xdd146f;};'use strict';var _=require('lodash');var util=require(_0x2587('0x0'));var logger=require('../../config/logger')(_0x2587('0x1'));var moment=require('moment');var BPromise=require(_0x2587('0x2'));var rp=require(_0x2587('0x3'));var fs=require('fs');var path=require(_0x2587('0x4'));var rimraf=require(_0x2587('0x5'));var config=require(_0x2587('0x6'));var attributes=require(_0x2587('0x7'));module[_0x2587('0x8')]=function(_0x5d7141,_0xeac0a5){return _0x5d7141[_0x2587('0x9')](_0x2587('0xa'),attributes,{'tableName':_0x2587('0xb'),'paranoid':![],'indexes':[{'name':_0x2587('0xc'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 4a842b4..e60c00c 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 _0x635e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4c4fc4,_0x365da0){var _0x2b035f=function(_0xbc2e16){while(--_0xbc2e16){_0x4c4fc4['push'](_0x4c4fc4['shift']());}};_0x2b035f(++_0x365da0);}(_0x635e,0xf6));var _0xe635=function(_0x11df50,_0x201584){_0x11df50=_0x11df50-0x0;var _0x2dfa19=_0x635e[_0x11df50];return _0x2dfa19;};'use strict';var _=require(_0xe635('0x0'));var util=require(_0xe635('0x1'));var moment=require(_0xe635('0x2'));var BPromise=require(_0xe635('0x3'));var rs=require(_0xe635('0x4'));var fs=require('fs');var Redis=require(_0xe635('0x5'));var db=require(_0xe635('0x6'))['db'];var utils=require(_0xe635('0x7'));var logger=require(_0xe635('0x8'))('rpc');var config=require(_0xe635('0x9'));var jayson=require(_0xe635('0xa'));var client=jayson['client'][_0xe635('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xccc079,_0x3e8b5e,_0x309067){return new BPromise(function(_0x2331ef,_0xa62b0f){return client[_0xe635('0xc')](_0xccc079,_0x309067)[_0xe635('0xd')](function(_0x528345){logger[_0xe635('0xe')](_0xe635('0xf'),_0x3e8b5e,_0xe635('0x10'));logger[_0xe635('0x11')](_0xe635('0x12'),_0x3e8b5e,_0xe635('0x10'),JSON[_0xe635('0x13')](_0x528345));if(_0x528345[_0xe635('0x14')]){if(_0x528345[_0xe635('0x14')][_0xe635('0x15')]===0x1f4){logger[_0xe635('0x14')](_0xe635('0xf'),_0x3e8b5e,_0x528345['error'][_0xe635('0x16')]);return _0xa62b0f(_0x528345[_0xe635('0x14')]['message']);}logger['error'](_0xe635('0xf'),_0x3e8b5e,_0x528345[_0xe635('0x14')]['message']);return _0x2331ef(_0x528345[_0xe635('0x14')]['message']);}else{logger[_0xe635('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x3e8b5e,_0xe635('0x10'));_0x2331ef(_0x528345['result'][_0xe635('0x16')]);}})['catch'](function(_0x39ceac){logger[_0xe635('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x3e8b5e,_0x39ceac);_0xa62b0f(_0x39ceac);});});} \ No newline at end of file +var _0xd652=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xd652,0xe3));var _0x2d65=function(_0x4c2323,_0x2dce70){_0x4c2323=_0x4c2323-0x0;var _0x15e615=_0xd652[_0x4c2323];return _0x15e615;};'use strict';var _=require('lodash');var util=require(_0x2d65('0x0'));var moment=require(_0x2d65('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d65('0x2'));var fs=require('fs');var Redis=require(_0x2d65('0x3'));var db=require(_0x2d65('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d65('0x5'))(_0x2d65('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2d65('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bb93e,_0x1c84a9,_0x2563cc){return new BPromise(function(_0x4e9dac,_0xa16ecc){return client['request'](_0x2bb93e,_0x2563cc)[_0x2d65('0x8')](function(_0x46186f){logger[_0x2d65('0x9')](_0x2d65('0xa'),_0x1c84a9,_0x2d65('0xb'));logger[_0x2d65('0xc')](_0x2d65('0xd'),_0x1c84a9,_0x2d65('0xb'),JSON['stringify'](_0x46186f));if(_0x46186f['error']){if(_0x46186f[_0x2d65('0xe')][_0x2d65('0xf')]===0x1f4){logger[_0x2d65('0xe')](_0x2d65('0xa'),_0x1c84a9,_0x46186f[_0x2d65('0xe')]['message']);return _0xa16ecc(_0x46186f[_0x2d65('0xe')][_0x2d65('0x10')]);}logger['error'](_0x2d65('0xa'),_0x1c84a9,_0x46186f[_0x2d65('0xe')][_0x2d65('0x10')]);return _0x4e9dac(_0x46186f[_0x2d65('0xe')][_0x2d65('0x10')]);}else{logger[_0x2d65('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x1c84a9,_0x2d65('0xb'));_0x4e9dac(_0x46186f[_0x2d65('0x11')]['message']);}})[_0x2d65('0x12')](function(_0x2d40e4){logger[_0x2d65('0xe')](_0x2d65('0xa'),_0x1c84a9,_0x2d40e4);_0xa16ecc(_0x2d40e4);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c369ca3..e602ce8 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3951a3,_0xe4463a){var _0x3320a6=function(_0x4f405b){while(--_0x4f405b){_0x3951a3['push'](_0x3951a3['shift']());}};_0x3320a6(++_0xe4463a);}(_0xe706,0xa3));var _0x6e70=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xe706[_0x400b43];return _0x3c330f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x81119e,_0x1789cc){var _0x26bc19=function(_0x1ecaaf){while(--_0x1ecaaf){_0x81119e['push'](_0x81119e['shift']());}};_0x26bc19(++_0x1789cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2a6655e..90b7ed5 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 _0x5827=['exports','INTEGER','sequelize'];(function(_0xcb1250,_0x116cfb){var _0x26bf46=function(_0x70121){while(--_0x70121){_0xcb1250['push'](_0xcb1250['shift']());}};_0x26bf46(++_0x116cfb);}(_0x5827,0xb0));var _0x7582=function(_0x7d4770,_0x136e15){_0x7d4770=_0x7d4770-0x0;var _0x14b80b=_0x5827[_0x7d4770];return _0x14b80b;};'use strict';var Sequelize=require(_0x7582('0x0'));module[_0x7582('0x1')]={'penalty':{'type':Sequelize[_0x7582('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb99d=['sequelize','INTEGER'];(function(_0x39ff0c,_0x2069c7){var _0x5c4ca6=function(_0xa4ffba){while(--_0xa4ffba){_0x39ff0c['push'](_0x39ff0c['shift']());}};_0x5c4ca6(++_0x2069c7);}(_0xb99d,0xb8));var _0xdb99=function(_0x351e5d,_0x1cff22){_0x351e5d=_0x351e5d-0x0;var _0x4f10d8=_0xb99d[_0x351e5d];return _0x4f10d8;};'use strict';var Sequelize=require(_0xdb99('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xdb99('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 9ddc464..f206d8b 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 _0x9fe7=['path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','bluebird','request-promise'];(function(_0x581bad,_0x118f0c){var _0x5c33eb=function(_0x4cf6de){while(--_0x4cf6de){_0x581bad['push'](_0x581bad['shift']());}};_0x5c33eb(++_0x118f0c);}(_0x9fe7,0x1df));var _0x79fe=function(_0x55ba81,_0x5c216c){_0x55ba81=_0x55ba81-0x0;var _0x9e9ae6=_0x9fe7[_0x55ba81];return _0x9e9ae6;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var logger=require('../../config/logger')(_0x79fe('0x2'));var moment=require('moment');var BPromise=require(_0x79fe('0x3'));var rp=require(_0x79fe('0x4'));var fs=require('fs');var path=require(_0x79fe('0x5'));var rimraf=require('rimraf');var config=require(_0x79fe('0x6'));var attributes=require(_0x79fe('0x7'));module[_0x79fe('0x8')]=function(_0x4af9f6,_0x3cec9c){return _0x4af9f6[_0x79fe('0x9')](_0x79fe('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7880=['../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x359778,_0x451f27){var _0x3751e4=function(_0x3e4fa7){while(--_0x3e4fa7){_0x359778['push'](_0x359778['shift']());}};_0x3751e4(++_0x451f27);}(_0x7880,0x1f4));var _0x0788=function(_0x29271a,_0x232277){_0x29271a=_0x29271a-0x0;var _0x10dc39=_0x7880[_0x29271a];return _0x10dc39;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index e1c2a08..5a11f4e 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 _0x4758=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1e2ca3,_0x1e9cbd){var _0x1af0ac=function(_0x34e5c4){while(--_0x34e5c4){_0x1e2ca3['push'](_0x1e2ca3['shift']());}};_0x1af0ac(++_0x1e9cbd);}(_0x4758,0x76));var _0x8475=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4758[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8475('0x0'));var util=require(_0x8475('0x1'));var moment=require('moment');var BPromise=require(_0x8475('0x2'));var rs=require(_0x8475('0x3'));var fs=require('fs');var Redis=require(_0x8475('0x4'));var db=require(_0x8475('0x5'))['db'];var utils=require(_0x8475('0x6'));var logger=require(_0x8475('0x7'))(_0x8475('0x8'));var config=require(_0x8475('0x9'));var jayson=require(_0x8475('0xa'));var client=jayson['client'][_0x8475('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b0bd2,_0x213993,_0x5ed26a){return new BPromise(function(_0x259e82,_0x28e9e9){return client[_0x8475('0xc')](_0x1b0bd2,_0x5ed26a)['then'](function(_0xd341b9){logger[_0x8475('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x213993,_0x8475('0xe'));logger[_0x8475('0xf')](_0x8475('0x10'),_0x213993,_0x8475('0xe'),JSON['stringify'](_0xd341b9));if(_0xd341b9[_0x8475('0x11')]){if(_0xd341b9[_0x8475('0x11')][_0x8475('0x12')]===0x1f4){logger[_0x8475('0x11')](_0x8475('0x13'),_0x213993,_0xd341b9[_0x8475('0x11')][_0x8475('0x14')]);return _0x28e9e9(_0xd341b9[_0x8475('0x11')]['message']);}logger[_0x8475('0x11')](_0x8475('0x13'),_0x213993,_0xd341b9[_0x8475('0x11')][_0x8475('0x14')]);return _0x259e82(_0xd341b9[_0x8475('0x11')][_0x8475('0x14')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x213993,_0x8475('0xe'));_0x259e82(_0xd341b9[_0x8475('0x15')][_0x8475('0x14')]);}})[_0x8475('0x16')](function(_0x2a5abc){logger[_0x8475('0x11')](_0x8475('0x13'),_0x213993,_0x2a5abc);_0x28e9e9(_0x2a5abc);});});} \ No newline at end of file +var _0xad0d=['then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','http'];(function(_0x3f8d2c,_0x18fe61){var _0x19f7a2=function(_0x25f99c){while(--_0x25f99c){_0x3f8d2c['push'](_0x3f8d2c['shift']());}};_0x19f7a2(++_0x18fe61);}(_0xad0d,0x1b3));var _0xdad0=function(_0x3d96cc,_0x35d4b7){_0x3d96cc=_0x3d96cc-0x0;var _0x4856ee=_0xad0d[_0x3d96cc];return _0x4856ee;};'use strict';var _=require('lodash');var util=require(_0xdad0('0x0'));var moment=require('moment');var BPromise=require(_0xdad0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdad0('0x2'));var db=require(_0xdad0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdad0('0x4'));var config=require(_0xdad0('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdad0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x41c823,_0x34aa22,_0x5055db){return new BPromise(function(_0x3c28a7,_0x17d499){return client['request'](_0x41c823,_0x5055db)[_0xdad0('0x7')](function(_0x43f9fc){logger['info'](_0xdad0('0x8'),_0x34aa22,_0xdad0('0x9'));logger[_0xdad0('0xa')](_0xdad0('0xb'),_0x34aa22,'request\x20sent',JSON['stringify'](_0x43f9fc));if(_0x43f9fc[_0xdad0('0xc')]){if(_0x43f9fc[_0xdad0('0xc')][_0xdad0('0xd')]===0x1f4){logger['error'](_0xdad0('0x8'),_0x34aa22,_0x43f9fc[_0xdad0('0xc')][_0xdad0('0xe')]);return _0x17d499(_0x43f9fc['error'][_0xdad0('0xe')]);}logger[_0xdad0('0xc')](_0xdad0('0x8'),_0x34aa22,_0x43f9fc[_0xdad0('0xc')][_0xdad0('0xe')]);return _0x3c28a7(_0x43f9fc[_0xdad0('0xc')][_0xdad0('0xe')]);}else{logger['info'](_0xdad0('0x8'),_0x34aa22,_0xdad0('0x9'));_0x3c28a7(_0x43f9fc[_0xdad0('0xf')][_0xdad0('0xe')]);}})[_0xdad0('0x10')](function(_0x5e1513){logger[_0xdad0('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x34aa22,_0x5e1513);_0x17d499(_0x5e1513);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 13e5900..c448197 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 _0x8d77=['INTEGER','sequelize','exports'];(function(_0x3f816e,_0x7f0cae){var _0x1f42c8=function(_0x6bee6e){while(--_0x6bee6e){_0x3f816e['push'](_0x3f816e['shift']());}};_0x1f42c8(++_0x7f0cae);}(_0x8d77,0x67));var _0x78d7=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8d77[_0x550d12];return _0x12103d;};'use strict';var Sequelize=require(_0x78d7('0x0'));module[_0x78d7('0x1')]={'UserId':{'type':Sequelize[_0x78d7('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x71ac=['INTEGER','sequelize','exports'];(function(_0x400991,_0x4c2e7e){var _0x4bcbf7=function(_0x4370a7){while(--_0x4370a7){_0x400991['push'](_0x400991['shift']());}};_0x4bcbf7(++_0x4c2e7e);}(_0x71ac,0x148));var _0xc71a=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x71ac[_0x1db251];return _0x56685a;};'use strict';var Sequelize=require(_0xc71a('0x0'));module[_0xc71a('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xc71a('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 80e70b4..da2131d 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(_0x2b85c9,_0x51bc8c){var _0x2ff161=function(_0x269f8e){while(--_0x269f8e){_0x2b85c9['push'](_0x2b85c9['shift']());}};_0x2ff161(++_0x51bc8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x40705c,_0x5ed149){var _0x42c59b=function(_0x52921c){while(--_0x52921c){_0x40705c['push'](_0x40705c['shift']());}};_0x42c59b(++_0x5ed149);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 cebd788..7ba6153 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x51f309,_0x416ab1){var _0x529ea0=function(_0x945dd5){while(--_0x945dd5){_0x51f309['push'](_0x51f309['shift']());}};_0x529ea0(++_0x416ab1);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xe42872,_0x55d230){var _0x24cbb0=function(_0x39d050){while(--_0x39d050){_0xe42872['push'](_0xe42872['shift']());}};_0x24cbb0(++_0x55d230);}(_0xe706,0xa3));var _0x6e70=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xe706[_0x420f2a];return _0x28f802;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 49ab626..3e86a14 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 _0x02ac=['INTEGER','sequelize'];(function(_0x122520,_0x18cb31){var _0xbefbdf=function(_0x2c5353){while(--_0x2c5353){_0x122520['push'](_0x122520['shift']());}};_0xbefbdf(++_0x18cb31);}(_0x02ac,0x1ed));var _0xc02a=function(_0x11dbbc,_0x4e6166){_0x11dbbc=_0x11dbbc-0x0;var _0x270bdd=_0x02ac[_0x11dbbc];return _0x270bdd;};'use strict';var Sequelize=require(_0xc02a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc02a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7499=['sequelize','exports'];(function(_0x1dd587,_0x2a0a28){var _0x30179f=function(_0x2a6358){while(--_0x2a6358){_0x1dd587['push'](_0x1dd587['shift']());}};_0x30179f(++_0x2a0a28);}(_0x7499,0x162));var _0x9749=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x7499[_0x50aa2e];return _0x5e07f0;};'use strict';var Sequelize=require(_0x9749('0x0'));module[_0x9749('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index d1e94a8..31849fd 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 _0xf1c0=['define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x2ce064,_0x4c3625){var _0x5792d1=function(_0x14a5e9){while(--_0x14a5e9){_0x2ce064['push'](_0x2ce064['shift']());}};_0x5792d1(++_0x4c3625);}(_0xf1c0,0x1f1));var _0x0f1c=function(_0x48c655,_0x134bcd){_0x48c655=_0x48c655-0x0;var _0x410e74=_0xf1c0[_0x48c655];return _0x410e74;};'use strict';var _=require(_0x0f1c('0x0'));var util=require('util');var logger=require(_0x0f1c('0x1'))(_0x0f1c('0x2'));var moment=require(_0x0f1c('0x3'));var BPromise=require(_0x0f1c('0x4'));var rp=require(_0x0f1c('0x5'));var fs=require('fs');var path=require(_0x0f1c('0x6'));var rimraf=require(_0x0f1c('0x7'));var config=require(_0x0f1c('0x8'));var attributes=require(_0x0f1c('0x9'));module['exports']=function(_0x2f5274,_0x2e1a2f){return _0x2f5274[_0x0f1c('0xa')](_0x0f1c('0xb'),attributes,{'tableName':_0x0f1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ba5=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','request-promise','path'];(function(_0x55754e,_0x286388){var _0x2e9948=function(_0x1eaeff){while(--_0x1eaeff){_0x55754e['push'](_0x55754e['shift']());}};_0x2e9948(++_0x286388);}(_0x2ba5,0x19f));var _0x52ba=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x2ba5[_0x149ca0];return _0x56b6b9;};'use strict';var _=require(_0x52ba('0x0'));var util=require(_0x52ba('0x1'));var logger=require(_0x52ba('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x52ba('0x3'));var fs=require('fs');var path=require(_0x52ba('0x4'));var rimraf=require(_0x52ba('0x5'));var config=require(_0x52ba('0x6'));var attributes=require(_0x52ba('0x7'));module[_0x52ba('0x8')]=function(_0x261180,_0x2555d9){return _0x261180[_0x52ba('0x9')](_0x52ba('0xa'),attributes,{'tableName':_0x52ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 835b4b0..f0f8d0c 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 _0x728e=['stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2f2f4c,_0x3d6b9d){var _0x6e62e8=function(_0x152fad){while(--_0x152fad){_0x2f2f4c['push'](_0x2f2f4c['shift']());}};_0x6e62e8(++_0x3d6b9d);}(_0x728e,0x185));var _0xe728=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x728e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe728('0x0'));var util=require(_0xe728('0x1'));var moment=require(_0xe728('0x2'));var BPromise=require(_0xe728('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe728('0x4'));var db=require(_0xe728('0x5'))['db'];var utils=require(_0xe728('0x6'));var logger=require('../../config/logger')(_0xe728('0x7'));var config=require(_0xe728('0x8'));var jayson=require(_0xe728('0x9'));var client=jayson[_0xe728('0xa')][_0xe728('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f729c,_0x5962b2,_0x15cee5){return new BPromise(function(_0x35433e,_0x1014fa){return client[_0xe728('0xc')](_0x4f729c,_0x15cee5)[_0xe728('0xd')](function(_0x4625ac){logger[_0xe728('0xe')](_0xe728('0xf'),_0x5962b2,'request\x20sent');logger[_0xe728('0x10')](_0xe728('0x11'),_0x5962b2,_0xe728('0x12'),JSON[_0xe728('0x13')](_0x4625ac));if(_0x4625ac[_0xe728('0x14')]){if(_0x4625ac[_0xe728('0x14')][_0xe728('0x15')]===0x1f4){logger[_0xe728('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x5962b2,_0x4625ac[_0xe728('0x14')]['message']);return _0x1014fa(_0x4625ac[_0xe728('0x14')][_0xe728('0x16')]);}logger[_0xe728('0x14')](_0xe728('0xf'),_0x5962b2,_0x4625ac[_0xe728('0x14')][_0xe728('0x16')]);return _0x35433e(_0x4625ac[_0xe728('0x14')]['message']);}else{logger['info'](_0xe728('0xf'),_0x5962b2,'request\x20sent');_0x35433e(_0x4625ac[_0xe728('0x17')][_0xe728('0x16')]);}})['catch'](function(_0x19da4c){logger[_0xe728('0x14')](_0xe728('0xf'),_0x5962b2,_0x19da4c);_0x1014fa(_0x19da4c);});});} \ No newline at end of file +var _0xf47a=['message','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dc5a2,_0x19b344){var _0x4ebd74=function(_0x375588){while(--_0x375588){_0x3dc5a2['push'](_0x3dc5a2['shift']());}};_0x4ebd74(++_0x19b344);}(_0xf47a,0x1e4));var _0xaf47=function(_0x3ddc5d,_0x32b64f){_0x3ddc5d=_0x3ddc5d-0x0;var _0x8cf36b=_0xf47a[_0x3ddc5d];return _0x8cf36b;};'use strict';var _=require(_0xaf47('0x0'));var util=require(_0xaf47('0x1'));var moment=require(_0xaf47('0x2'));var BPromise=require(_0xaf47('0x3'));var rs=require(_0xaf47('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf47('0x5'))(_0xaf47('0x6'));var config=require(_0xaf47('0x7'));var jayson=require(_0xaf47('0x8'));var client=jayson[_0xaf47('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556f54,_0x4051bf,_0x170d9d){return new BPromise(function(_0x1e60ff,_0x54c503){return client[_0xaf47('0xa')](_0x556f54,_0x170d9d)[_0xaf47('0xb')](function(_0x521f19){logger[_0xaf47('0xc')](_0xaf47('0xd'),_0x4051bf,_0xaf47('0xe'));logger[_0xaf47('0xf')](_0xaf47('0x10'),_0x4051bf,_0xaf47('0xe'),JSON[_0xaf47('0x11')](_0x521f19));if(_0x521f19[_0xaf47('0x12')]){if(_0x521f19['error'][_0xaf47('0x13')]===0x1f4){logger[_0xaf47('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x4051bf,_0x521f19[_0xaf47('0x12')][_0xaf47('0x14')]);return _0x54c503(_0x521f19[_0xaf47('0x12')][_0xaf47('0x14')]);}logger[_0xaf47('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x4051bf,_0x521f19[_0xaf47('0x12')]['message']);return _0x1e60ff(_0x521f19[_0xaf47('0x12')]['message']);}else{logger['info'](_0xaf47('0xd'),_0x4051bf,_0xaf47('0xe'));_0x1e60ff(_0x521f19['result'][_0xaf47('0x14')]);}})['catch'](function(_0x1e7847){logger['error'](_0xaf47('0xd'),_0x4051bf,_0x1e7847);_0x54c503(_0x1e7847);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e5d4467..1bcb1e8 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5c5b4d,_0x3b4781){var _0x448a9e=function(_0x44710f){while(--_0x44710f){_0x5c5b4d['push'](_0x5c5b4d['shift']());}};_0x448a9e(++_0x3b4781);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'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(_0x38f730,_0x2c7523){var _0x233bf4=function(_0x4e43ea){while(--_0x4e43ea){_0x38f730['push'](_0x38f730['shift']());}};_0x233bf4(++_0x2c7523);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 3e04712..f134c36 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 _0xad7a=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x32fea3,_0x2a88ff){var _0x4f5ddf=function(_0x2b974e){while(--_0x2b974e){_0x32fea3['push'](_0x32fea3['shift']());}};_0x4f5ddf(++_0x2a88ff);}(_0xad7a,0x196));var _0xaad7=function(_0x2e3bc0,_0x2343aa){_0x2e3bc0=_0x2e3bc0-0x0;var _0x464e49=_0xad7a[_0x2e3bc0];return _0x464e49;};'use strict';var Sequelize=require(_0xaad7('0x0'));module[_0xaad7('0x1')]={'uniqueid':{'type':Sequelize[_0xaad7('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xaad7('0x3')},'membername':{'type':Sequelize[_0xaad7('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaad7('0x5'),'comment':_0xaad7('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xaad7('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xaad7('0x3')},'penalty':{'type':Sequelize[_0xaad7('0x2')](0xb),'defaultValue':0x0,'comment':_0xaad7('0x3')},'paused':{'type':Sequelize[_0xaad7('0x2')](0xb),'defaultValue':0x0,'comment':_0xaad7('0x3')}}; \ No newline at end of file +var _0x7609=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7609,0x108));var _0x9760=function(_0x25bc3d,_0x19ad33){_0x25bc3d=_0x25bc3d-0x0;var _0x3c5aa9=_0x7609[_0x25bc3d];return _0x3c5aa9;};'use strict';var Sequelize=require('sequelize');module[_0x9760('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9760('0x1')},'membername':{'type':Sequelize[_0x9760('0x2')],'allowNull':![],'comment':_0x9760('0x1')},'UserId':{'type':Sequelize[_0x9760('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9760('0x2')],'allowNull':![],'unique':_0x9760('0x4'),'comment':_0x9760('0x1')},'VoiceQueueId':{'type':Sequelize[_0x9760('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9760('0x4'),'comment':_0x9760('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x9760('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 60495de..af62d7b 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 _0xd825=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xd825,0x19a));var _0x5d82=function(_0x2b7747,_0x52d4bf){_0x2b7747=_0x2b7747-0x0;var _0x5ee9fe=_0xd825[_0x2b7747];return _0x5ee9fe;};'use strict';var EventEmitter=require(_0x5d82('0x0'));var UserVoiceQueueRt=require(_0x5d82('0x1'))['db'][_0x5d82('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5d82('0x3')](0x0);var events={'afterCreate':_0x5d82('0x4'),'afterUpdate':_0x5d82('0x5'),'afterDestroy':'remove'};function emitEvent(_0x59454a){return function(_0x39c013,_0x432133,_0x7d08f8){UserVoiceQueueRtEvents['emit'](_0x59454a+':'+_0x39c013['id'],_0x39c013);UserVoiceQueueRtEvents[_0x5d82('0x6')](_0x59454a,_0x39c013);_0x7d08f8(null);};}for(var e in events){if(events[_0x5d82('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5d82('0x8')](e,emitEvent(event));}}module[_0x5d82('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x629d=['update','remove','emit','hasOwnProperty','events','setMaxListeners'];(function(_0x130a75,_0x5ec2d2){var _0x57c464=function(_0x39c0b3){while(--_0x39c0b3){_0x130a75['push'](_0x130a75['shift']());}};_0x57c464(++_0x5ec2d2);}(_0x629d,0x1c6));var _0xd629=function(_0x31520d,_0x50046a){_0x31520d=_0x31520d-0x0;var _0x4d0d26=_0x629d[_0x31520d];return _0x4d0d26;};'use strict';var EventEmitter=require(_0xd629('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd629('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd629('0x2'),'afterDestroy':_0xd629('0x3')};function emitEvent(_0xdb3fd5){return function(_0x2ef70d,_0x3934e7,_0x51d246){UserVoiceQueueRtEvents[_0xd629('0x4')](_0xdb3fd5+':'+_0x2ef70d['id'],_0x2ef70d);UserVoiceQueueRtEvents['emit'](_0xdb3fd5,_0x2ef70d);_0x51d246(null);};}for(var e in events){if(events[_0xd629('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](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 e2d321f..6c8bd22 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 _0x6488=['../../config/logger','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util'];(function(_0x31203d,_0x28551c){var _0x3f5cf4=function(_0x3d0f50){while(--_0x3d0f50){_0x31203d['push'](_0x31203d['shift']());}};_0x3f5cf4(++_0x28551c);}(_0x6488,0x82));var _0x8648=function(_0x152499,_0x4eefc4){_0x152499=_0x152499-0x0;var _0x2804f2=_0x6488[_0x152499];return _0x2804f2;};'use strict';var _=require(_0x8648('0x0'));var util=require(_0x8648('0x1'));var logger=require(_0x8648('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8648('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8648('0x4'));var config=require(_0x8648('0x5'));var attributes=require(_0x8648('0x6'));module[_0x8648('0x7')]=function(_0x30991e,_0x1f0e11){return _0x30991e[_0x8648('0x8')](_0x8648('0x9'),attributes,{'tableName':_0x8648('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x032d=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','bluebird','request-promise','path'];(function(_0x13edef,_0x5f551f){var _0x198133=function(_0x58d128){while(--_0x58d128){_0x13edef['push'](_0x13edef['shift']());}};_0x198133(++_0x5f551f);}(_0x032d,0x171));var _0xd032=function(_0x509c50,_0xbe7c07){_0x509c50=_0x509c50-0x0;var _0x32798b=_0x032d[_0x509c50];return _0x32798b;};'use strict';var _=require('lodash');var util=require(_0xd032('0x0'));var logger=require(_0xd032('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd032('0x2'));var rp=require(_0xd032('0x3'));var fs=require('fs');var path=require(_0xd032('0x4'));var rimraf=require(_0xd032('0x5'));var config=require(_0xd032('0x6'));var attributes=require(_0xd032('0x7'));module[_0xd032('0x8')]=function(_0x49c53e,_0x1bd868){return _0x49c53e['define'](_0xd032('0x9'),attributes,{'tableName':_0xd032('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 fd01cba..a1b3377 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 _0x9b33=['socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0x9b33,0x152));var _0x39b3=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x9b33[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x39b3('0x0'));var util=require(_0x39b3('0x1'));var moment=require('moment');var BPromise=require(_0x39b3('0x2'));var rs=require(_0x39b3('0x3'));var fs=require('fs');var Redis=require(_0x39b3('0x4'));var db=require(_0x39b3('0x5'))['db'];var utils=require(_0x39b3('0x6'));var logger=require(_0x39b3('0x7'))('rpc');var config=require(_0x39b3('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x39b3('0x9')]({'port':0x232a});config[_0x39b3('0xa')]=_['defaults'](config[_0x39b3('0xa')],{'host':_0x39b3('0xb'),'port':0x18eb});var socket=require(_0x39b3('0xc'))(new Redis(config[_0x39b3('0xa')]));require('./userVoiceQueueRt.socket')[_0x39b3('0xd')](socket);function respondWithRpcPromise(_0x3942ef,_0x50a9b4,_0x8449a0){return new BPromise(function(_0x19dfa6,_0x56dd0d){return client[_0x39b3('0xe')](_0x3942ef,_0x8449a0)[_0x39b3('0xf')](function(_0x2210c2){logger[_0x39b3('0x10')](_0x39b3('0x11'),_0x50a9b4,'request\x20sent');logger[_0x39b3('0x12')](_0x39b3('0x13'),_0x50a9b4,'request\x20sent',JSON[_0x39b3('0x14')](_0x2210c2));if(_0x2210c2[_0x39b3('0x15')]){if(_0x2210c2[_0x39b3('0x15')][_0x39b3('0x16')]===0x1f4){logger[_0x39b3('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x50a9b4,_0x2210c2[_0x39b3('0x15')][_0x39b3('0x17')]);return _0x56dd0d(_0x2210c2[_0x39b3('0x15')][_0x39b3('0x17')]);}logger[_0x39b3('0x15')](_0x39b3('0x11'),_0x50a9b4,_0x2210c2['error'][_0x39b3('0x17')]);return _0x19dfa6(_0x2210c2['error'][_0x39b3('0x17')]);}else{logger[_0x39b3('0x10')](_0x39b3('0x11'),_0x50a9b4,_0x39b3('0x18'));_0x19dfa6(_0x2210c2[_0x39b3('0x19')][_0x39b3('0x17')]);}})['catch'](function(_0x19fb46){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x50a9b4,_0x19fb46);_0x56dd0d(_0x19fb46);});});}exports[_0x39b3('0x1a')]=function(_0x442592){var _0x1dffd0=this;return new Promise(function(_0x36ac7,_0x34ae37){return db[_0x39b3('0x1b')]['findAll']({'raw':_0x442592[_0x39b3('0x1c')]?_0x442592[_0x39b3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x442592[_0x39b3('0x1c')]?_0x442592[_0x39b3('0x1c')][_0x39b3('0x1d')]||null:null,'attributes':[[db[_0x39b3('0x1e')]['fn'](_0x39b3('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x39b3('0x20')](_0x39b3('0x21')))),'outboundQueuePauses']]})['then'](function(_0x126a80){logger[_0x39b3('0x10')]('GetVoiceQueueRtPauses',_0x442592);logger['debug']('GetVoiceQueueRtPauses',_0x442592,JSON[_0x39b3('0x14')](_0x126a80));_0x36ac7(_0x126a80);})[_0x39b3('0x22')](function(_0x16b45c){logger[_0x39b3('0x15')](_0x39b3('0x1a'),_0x16b45c[_0x39b3('0x17')],_0x442592);_0x34ae37(_0x1dffd0['error'](0x1f4,_0x16b45c[_0x39b3('0x17')]));});});}; \ No newline at end of file +var _0x5197=['options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','UserVoiceQueueRt'];(function(_0x6fc0ad,_0x154ced){var _0x5dc53d=function(_0x5ce092){while(--_0x5ce092){_0x6fc0ad['push'](_0x6fc0ad['shift']());}};_0x5dc53d(++_0x154ced);}(_0x5197,0x109));var _0x7519=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5197[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x7519('0x0'));var util=require('util');var moment=require(_0x7519('0x1'));var BPromise=require(_0x7519('0x2'));var rs=require(_0x7519('0x3'));var fs=require('fs');var Redis=require(_0x7519('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7519('0x5'));var logger=require(_0x7519('0x6'))(_0x7519('0x7'));var config=require(_0x7519('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7519('0x9')][_0x7519('0xa')]({'port':0x232a});config[_0x7519('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7519('0xb')]));require(_0x7519('0xc'))[_0x7519('0xd')](socket);function respondWithRpcPromise(_0x11ae25,_0x1afe3e,_0x1fea8a){return new BPromise(function(_0x3e7a2b,_0x301334){return client[_0x7519('0xe')](_0x11ae25,_0x1fea8a)[_0x7519('0xf')](function(_0x4909d3){logger['info'](_0x7519('0x10'),_0x1afe3e,_0x7519('0x11'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1afe3e,_0x7519('0x11'),JSON[_0x7519('0x12')](_0x4909d3));if(_0x4909d3[_0x7519('0x13')]){if(_0x4909d3[_0x7519('0x13')]['code']===0x1f4){logger['error'](_0x7519('0x10'),_0x1afe3e,_0x4909d3[_0x7519('0x13')][_0x7519('0x14')]);return _0x301334(_0x4909d3[_0x7519('0x13')][_0x7519('0x14')]);}logger[_0x7519('0x13')](_0x7519('0x10'),_0x1afe3e,_0x4909d3[_0x7519('0x13')][_0x7519('0x14')]);return _0x3e7a2b(_0x4909d3[_0x7519('0x13')][_0x7519('0x14')]);}else{logger[_0x7519('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1afe3e,'request\x20sent');_0x3e7a2b(_0x4909d3['result'][_0x7519('0x14')]);}})['catch'](function(_0x1d56cd){logger['error'](_0x7519('0x10'),_0x1afe3e,_0x1d56cd);_0x301334(_0x1d56cd);});});}exports['GetVoiceQueueRtPauses']=function(_0x4c1707){var _0x3e398f=this;return new Promise(function(_0xbcb0f6,_0x16ef5a){return db[_0x7519('0x16')]['findAll']({'raw':_0x4c1707[_0x7519('0x17')]?_0x4c1707['options'][_0x7519('0x18')]===undefined?!![]:![]:!![],'where':_0x4c1707[_0x7519('0x17')]?_0x4c1707[_0x7519('0x17')][_0x7519('0x19')]||null:null,'attributes':[[db[_0x7519('0x1a')]['fn'](_0x7519('0x1b'),db[_0x7519('0x1a')]['fn']('IF',db['sequelize'][_0x7519('0x1c')](_0x7519('0x1d')))),'outboundQueuePauses']]})[_0x7519('0xf')](function(_0x1df424){logger[_0x7519('0x15')](_0x7519('0x1e'),_0x4c1707);logger['debug'](_0x7519('0x1e'),_0x4c1707,JSON[_0x7519('0x12')](_0x1df424));_0xbcb0f6(_0x1df424);})[_0x7519('0x1f')](function(_0x15f29b){logger[_0x7519('0x13')]('GetVoiceQueueRtPauses',_0x15f29b[_0x7519('0x14')],_0x4c1707);_0x16ef5a(_0x3e398f[_0x7519('0x13')](0x1f4,_0x15f29b[_0x7519('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index fd4907c..511f69c 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 _0x1766=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','update','emit','removeListener'];(function(_0x1dd890,_0xad4f0b){var _0x4718c4=function(_0x1f2bff){while(--_0x1f2bff){_0x1dd890['push'](_0x1dd890['shift']());}};_0x4718c4(++_0xad4f0b);}(_0x1766,0x17d));var _0x6176=function(_0x57c8b4,_0x567dfb){_0x57c8b4=_0x57c8b4-0x0;var _0x2ef232=_0x1766[_0x57c8b4];return _0x2ef232;};'use strict';var UserVoiceQueueRtEvents=require(_0x6176('0x0'));var events=['save','remove',_0x6176('0x1')];function createListener(_0x1606f0,_0x27be56){return function(_0x3db6d5){_0x27be56[_0x6176('0x2')](_0x1606f0,_0x3db6d5);};}function removeListener(_0x224569,_0x51476d){return function(){UserVoiceQueueRtEvents[_0x6176('0x3')](_0x224569,_0x51476d);};}exports[_0x6176('0x4')]=function(_0x5c8f3c){for(var _0xc12c66=0x0,_0x222f99=events[_0x6176('0x5')];_0xc12c66<_0x222f99;_0xc12c66++){var _0x3878a4=events[_0xc12c66];var _0x481693=createListener(_0x6176('0x6')+_0x3878a4,_0x5c8f3c);UserVoiceQueueRtEvents['on'](_0x3878a4,_0x481693);}}; \ No newline at end of file +var _0x323f=['removeListener','register','length','userVoiceQueueRt:','save','update','emit'];(function(_0x57a1f7,_0x1b0424){var _0xe52270=function(_0x25772e){while(--_0x25772e){_0x57a1f7['push'](_0x57a1f7['shift']());}};_0xe52270(++_0x1b0424);}(_0x323f,0x1ee));var _0xf323=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x323f[_0x110c3d];return _0x226d67;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xf323('0x0'),'remove',_0xf323('0x1')];function createListener(_0x1a3006,_0x41c114){return function(_0xc09d02){_0x41c114[_0xf323('0x2')](_0x1a3006,_0xc09d02);};}function removeListener(_0x2c9d35,_0xb4caa8){return function(){UserVoiceQueueRtEvents[_0xf323('0x3')](_0x2c9d35,_0xb4caa8);};}exports[_0xf323('0x4')]=function(_0x371707){for(var _0x5d7d60=0x0,_0xb9a667=events[_0xf323('0x5')];_0x5d7d60<_0xb9a667;_0x5d7d60++){var _0x1af70d=events[_0x5d7d60];var _0x2c8271=createListener(_0xf323('0x6')+_0x1af70d,_0x371707);UserVoiceQueueRtEvents['on'](_0x1af70d,_0x2c8271);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 4a31bfa..99e15bb 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x198fd7,_0x1aa9b1){var _0x574ead=function(_0x311fc3){while(--_0x311fc3){_0x198fd7['push'](_0x198fd7['shift']());}};_0x574ead(++_0x1aa9b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x46cb21,_0x482f03){var _0x6dc6dc=function(_0x56e557){while(--_0x56e557){_0x46cb21['push'](_0x46cb21['shift']());}};_0x6dc6dc(++_0x482f03);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 7bd3853..56c6013 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 _0x79fc=['sequelize','exports','INTEGER'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0x79fc,0x1ad));var _0xc79f=function(_0x52074a,_0x286c9e){_0x52074a=_0x52074a-0x0;var _0x2f49ae=_0x79fc[_0x52074a];return _0x2f49ae;};'use strict';var Sequelize=require(_0xc79f('0x0'));module[_0xc79f('0x1')]={'penalty':{'type':Sequelize[_0xc79f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7eed=['sequelize','exports','INTEGER'];(function(_0x4f4db8,_0x17630a){var _0x10874c=function(_0x2c4c11){while(--_0x2c4c11){_0x4f4db8['push'](_0x4f4db8['shift']());}};_0x10874c(++_0x17630a);}(_0x7eed,0xcc));var _0xd7ee=function(_0x5d5979,_0x3b4921){_0x5d5979=_0x5d5979-0x0;var _0x237182=_0x7eed[_0x5d5979];return _0x237182;};'use strict';var Sequelize=require(_0xd7ee('0x0'));module[_0xd7ee('0x1')]={'penalty':{'type':Sequelize[_0xd7ee('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 2eea6c7..f7b75dd 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 _0x301d=['exports','user_has_whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x3fbdfa,_0x4e6388){var _0x113d2f=function(_0x5d86b3){while(--_0x5d86b3){_0x3fbdfa['push'](_0x3fbdfa['shift']());}};_0x113d2f(++_0x4e6388);}(_0x301d,0x1d0));var _0xd301=function(_0x52875f,_0x1d6ce3){_0x52875f=_0x52875f-0x0;var _0x3f30d8=_0x301d[_0x52875f];return _0x3f30d8;};'use strict';var _=require(_0xd301('0x0'));var util=require('util');var logger=require(_0xd301('0x1'))(_0xd301('0x2'));var moment=require(_0xd301('0x3'));var BPromise=require(_0xd301('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd301('0x5'));var rimraf=require(_0xd301('0x6'));var config=require(_0xd301('0x7'));var attributes=require(_0xd301('0x8'));module[_0xd301('0x9')]=function(_0x34cab7,_0x113a86){return _0x34cab7['define']('UserWhatsappQueue',attributes,{'tableName':_0xd301('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63b9=['../../config/logger','api','moment','request-promise','path','rimraf','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x3a53e0,_0x3ff877){var _0x196ac8=function(_0x54d21e){while(--_0x54d21e){_0x3a53e0['push'](_0x3a53e0['shift']());}};_0x196ac8(++_0x3ff877);}(_0x63b9,0x1e6));var _0x963b=function(_0x31fc68,_0x7d2e37){_0x31fc68=_0x31fc68-0x0;var _0x3e08ba=_0x63b9[_0x31fc68];return _0x3e08ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x963b('0x0'))(_0x963b('0x1'));var moment=require(_0x963b('0x2'));var BPromise=require('bluebird');var rp=require(_0x963b('0x3'));var fs=require('fs');var path=require(_0x963b('0x4'));var rimraf=require(_0x963b('0x5'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x41e6b9,_0x428221){return _0x41e6b9[_0x963b('0x6')](_0x963b('0x7'),attributes,{'tableName':_0x963b('0x8'),'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 c8b54d1..ec2e074 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 _0xe735=['info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5ca815,_0x5ad45c){var _0x553400=function(_0x4ffcd6){while(--_0x4ffcd6){_0x5ca815['push'](_0x5ca815['shift']());}};_0x553400(++_0x5ad45c);}(_0xe735,0xfd));var _0x5e73=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xe735[_0x556bb1];return _0x45455f;};'use strict';var _=require('lodash');var util=require(_0x5e73('0x0'));var moment=require('moment');var BPromise=require(_0x5e73('0x1'));var rs=require(_0x5e73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e73('0x3'))['db'];var utils=require(_0x5e73('0x4'));var logger=require(_0x5e73('0x5'))(_0x5e73('0x6'));var config=require(_0x5e73('0x7'));var jayson=require(_0x5e73('0x8'));var client=jayson['client'][_0x5e73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x400c77,_0x5bbac6,_0xfcd043){return new BPromise(function(_0x210e64,_0x23b4be){return client[_0x5e73('0xa')](_0x400c77,_0xfcd043)['then'](function(_0x2e010b){logger[_0x5e73('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5bbac6,_0x5e73('0xc'));logger[_0x5e73('0xd')](_0x5e73('0xe'),_0x5bbac6,'request\x20sent',JSON[_0x5e73('0xf')](_0x2e010b));if(_0x2e010b[_0x5e73('0x10')]){if(_0x2e010b[_0x5e73('0x10')][_0x5e73('0x11')]===0x1f4){logger[_0x5e73('0x10')](_0x5e73('0x12'),_0x5bbac6,_0x2e010b[_0x5e73('0x10')][_0x5e73('0x13')]);return _0x23b4be(_0x2e010b[_0x5e73('0x10')][_0x5e73('0x13')]);}logger[_0x5e73('0x10')](_0x5e73('0x12'),_0x5bbac6,_0x2e010b['error']['message']);return _0x210e64(_0x2e010b[_0x5e73('0x10')][_0x5e73('0x13')]);}else{logger[_0x5e73('0xb')](_0x5e73('0x12'),_0x5bbac6,_0x5e73('0xc'));_0x210e64(_0x2e010b[_0x5e73('0x14')][_0x5e73('0x13')]);}})[_0x5e73('0x15')](function(_0x4fb686){logger[_0x5e73('0x10')](_0x5e73('0x12'),_0x5bbac6,_0x4fb686);_0x23b4be(_0x4fb686);});});} \ No newline at end of file +var _0xb900=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x12745e,_0x6cc947){var _0xfd9473=function(_0x1b1581){while(--_0x1b1581){_0x12745e['push'](_0x12745e['shift']());}};_0xfd9473(++_0x6cc947);}(_0xb900,0x17d));var _0x0b90=function(_0x3ae412,_0x5813e8){_0x3ae412=_0x3ae412-0x0;var _0x283678=_0xb900[_0x3ae412];return _0x283678;};'use strict';var _=require('lodash');var util=require(_0x0b90('0x0'));var moment=require(_0x0b90('0x1'));var BPromise=require(_0x0b90('0x2'));var rs=require(_0x0b90('0x3'));var fs=require('fs');var Redis=require(_0x0b90('0x4'));var db=require(_0x0b90('0x5'))['db'];var utils=require(_0x0b90('0x6'));var logger=require(_0x0b90('0x7'))(_0x0b90('0x8'));var config=require('../../config/environment');var jayson=require(_0x0b90('0x9'));var client=jayson[_0x0b90('0xa')][_0x0b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x389580,_0x455a1b,_0x2b2859){return new BPromise(function(_0x39f58c,_0x179710){return client[_0x0b90('0xc')](_0x389580,_0x2b2859)[_0x0b90('0xd')](function(_0xb57847){logger[_0x0b90('0xe')](_0x0b90('0xf'),_0x455a1b,_0x0b90('0x10'));logger[_0x0b90('0x11')](_0x0b90('0x12'),_0x455a1b,_0x0b90('0x10'),JSON[_0x0b90('0x13')](_0xb57847));if(_0xb57847[_0x0b90('0x14')]){if(_0xb57847[_0x0b90('0x14')][_0x0b90('0x15')]===0x1f4){logger[_0x0b90('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x455a1b,_0xb57847[_0x0b90('0x14')][_0x0b90('0x16')]);return _0x179710(_0xb57847['error'][_0x0b90('0x16')]);}logger[_0x0b90('0x14')](_0x0b90('0xf'),_0x455a1b,_0xb57847['error'][_0x0b90('0x16')]);return _0x39f58c(_0xb57847[_0x0b90('0x14')][_0x0b90('0x16')]);}else{logger[_0x0b90('0xe')](_0x0b90('0xf'),_0x455a1b,'request\x20sent');_0x39f58c(_0xb57847[_0x0b90('0x17')][_0x0b90('0x16')]);}})[_0x0b90('0x18')](function(_0x1982eb){logger[_0x0b90('0x14')](_0x0b90('0xf'),_0x455a1b,_0x1982eb);_0x179710(_0x1982eb);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 767f6d8..297b321 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 _0x4849=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','delete','destroy'];(function(_0x5344db,_0x13ec93){var _0x31a235=function(_0x1db948){while(--_0x1db948){_0x5344db['push'](_0x5344db['shift']());}};_0x31a235(++_0x13ec93);}(_0x4849,0x86));var _0x9484=function(_0x9a6f61,_0x5c80d9){_0x9a6f61=_0x9a6f61-0x0;var _0x12d4e5=_0x4849[_0x9a6f61];return _0x12d4e5;};'use strict';var multer=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var path=require('path');var timeout=require(_0x9484('0x2'));var express=require(_0x9484('0x3'));var router=express[_0x9484('0x4')]();var fs_extra=require(_0x9484('0x5'));var auth=require(_0x9484('0x6'));var interaction=require(_0x9484('0x7'));var config=require(_0x9484('0x8'));var controller=require('./variable.controller');router[_0x9484('0x9')]('/',auth[_0x9484('0xa')](),controller['index']);router[_0x9484('0x9')](_0x9484('0xb'),auth[_0x9484('0xa')](),controller[_0x9484('0xc')]);router[_0x9484('0xd')]('/',auth['isAuthenticated'](),controller[_0x9484('0xe')]);router[_0x9484('0xf')](_0x9484('0xb'),auth[_0x9484('0xa')](),controller['update']);router[_0x9484('0x10')](_0x9484('0xb'),auth[_0x9484('0xa')](),controller[_0x9484('0x11')]);module[_0x9484('0x12')]=router; \ No newline at end of file +var _0xb32d=['../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x34b3e0,_0x28261c){var _0x408050=function(_0x5f2b41){while(--_0x5f2b41){_0x34b3e0['push'](_0x34b3e0['shift']());}};_0x408050(++_0x28261c);}(_0xb32d,0x1da));var _0xdb32=function(_0x291b77,_0x36b1c2){_0x291b77=_0x291b77-0x0;var _0x138495=_0xb32d[_0x291b77];return _0x138495;};'use strict';var multer=require(_0xdb32('0x0'));var util=require(_0xdb32('0x1'));var path=require(_0xdb32('0x2'));var timeout=require(_0xdb32('0x3'));var express=require(_0xdb32('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdb32('0x5'));var interaction=require(_0xdb32('0x6'));var config=require('../../config/environment');var controller=require(_0xdb32('0x7'));router[_0xdb32('0x8')]('/',auth[_0xdb32('0x9')](),controller[_0xdb32('0xa')]);router[_0xdb32('0x8')](_0xdb32('0xb'),auth['isAuthenticated'](),controller[_0xdb32('0xc')]);router[_0xdb32('0xd')]('/',auth[_0xdb32('0x9')](),controller[_0xdb32('0xe')]);router[_0xdb32('0xf')](_0xdb32('0xb'),auth[_0xdb32('0x9')](),controller[_0xdb32('0x10')]);router[_0xdb32('0x11')](_0xdb32('0xb'),auth[_0xdb32('0x9')](),controller[_0xdb32('0x12')]);module[_0xdb32('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 397f340..8abe936 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 _0xf1b6=['name','STRING','exports'];(function(_0x5bb619,_0x5b2a82){var _0x182206=function(_0x1791b2){while(--_0x1791b2){_0x5bb619['push'](_0x5bb619['shift']());}};_0x182206(++_0x5b2a82);}(_0xf1b6,0xd1));var _0x6f1b=function(_0x37e5e0,_0x44bf06){_0x37e5e0=_0x37e5e0-0x0;var _0x47b935=_0xf1b6[_0x37e5e0];return _0x47b935;};'use strict';var Sequelize=require('sequelize');module[_0x6f1b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6f1b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6f1b('0x2')]}}; \ No newline at end of file +var _0xb670=['STRING','sequelize','exports'];(function(_0x4ad208,_0xad24ed){var _0x20ab19=function(_0x360e87){while(--_0x360e87){_0x4ad208['push'](_0x4ad208['shift']());}};_0x20ab19(++_0xad24ed);}(_0xb670,0x1c3));var _0x0b67=function(_0x5bf595,_0x3dcc0b){_0x5bf595=_0x5bf595-0x0;var _0x3026a4=_0xb670[_0x5bf595];return _0x3026a4;};'use strict';var Sequelize=require(_0x0b67('0x0'));module[_0x0b67('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0b67('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3fa1698..d2939d6 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 _0x0241=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','map','Variable','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user'];(function(_0x15104e,_0x599a41){var _0x497e6f=function(_0x476eaa){while(--_0x476eaa){_0x15104e['push'](_0x15104e['shift']());}};_0x497e6f(++_0x599a41);}(_0x0241,0x102));var _0x1024=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0241[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1024('0x0'));var zipdir=require(_0x1024('0x1'));var jsonpatch=require(_0x1024('0x2'));var rp=require('request-promise');var moment=require(_0x1024('0x3'));var BPromise=require(_0x1024('0x4'));var Mustache=require(_0x1024('0x5'));var util=require(_0x1024('0x6'));var path=require(_0x1024('0x7'));var sox=require('sox');var csv=require(_0x1024('0x8'));var ejs=require(_0x1024('0x9'));var fs=require('fs');var fs_extra=require(_0x1024('0xa'));var _=require(_0x1024('0xb'));var squel=require('squel');var crypto=require(_0x1024('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1024('0xd'));var Redis=require(_0x1024('0xe'));var authService=require(_0x1024('0xf'));var qs=require(_0x1024('0x10'));var as=require(_0x1024('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1024('0x12'))(_0x1024('0x13'));var utils=require(_0x1024('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1024('0x15'))['db'];function respondWithStatusCode(_0x13f63b,_0x154440){_0x154440=_0x154440||0xcc;return function(_0x38b939){if(_0x38b939){return _0x13f63b[_0x1024('0x16')](_0x154440);}return _0x13f63b[_0x1024('0x17')](_0x154440)[_0x1024('0x18')]();};}function respondWithResult(_0x68855,_0x4db2c3){_0x4db2c3=_0x4db2c3||0xc8;return function(_0x26fc4f){if(_0x26fc4f){return _0x68855['status'](_0x4db2c3)[_0x1024('0x19')](_0x26fc4f);}};}function respondWithFilteredResult(_0x33f8e1,_0x5b99a1){return function(_0x176a25){if(_0x176a25){var _0x1b3c6b=typeof _0x5b99a1[_0x1024('0x1a')]===_0x1024('0x1b')&&typeof _0x5b99a1[_0x1024('0x1c')]===_0x1024('0x1b');var _0x5ae692=_0x176a25[_0x1024('0x1d')];var _0x41cf4b=_0x1b3c6b?0x0:_0x5b99a1[_0x1024('0x1a')];var _0x3a4d98=_0x1b3c6b?_0x176a25[_0x1024('0x1d')]:_0x5b99a1[_0x1024('0x1a')]+_0x5b99a1[_0x1024('0x1c')];var _0x407e42;if(_0x3a4d98>=_0x5ae692){_0x3a4d98=_0x5ae692;_0x407e42=0xc8;}else{_0x407e42=0xce;}_0x33f8e1[_0x1024('0x17')](_0x407e42);return _0x33f8e1[_0x1024('0x1e')](_0x1024('0x1f'),_0x41cf4b+'-'+_0x3a4d98+'/'+_0x5ae692)[_0x1024('0x19')](_0x176a25);}return null;};}function patchUpdates(_0x4fb592){return function(_0x59c69e){try{jsonpatch[_0x1024('0x20')](_0x59c69e,_0x4fb592,!![]);}catch(_0x9b7d9b){return BPromise[_0x1024('0x21')](_0x9b7d9b);}return _0x59c69e[_0x1024('0x22')]();};}function saveUpdates(_0x327e64,_0x5c6817){return function(_0x1c42a6){if(_0x1c42a6){return _0x1c42a6[_0x1024('0x23')](_0x327e64)[_0x1024('0x24')](function(_0x37fd20){return _0x37fd20;});}return null;};}function removeEntity(_0x2ed954,_0x31a370){return function(_0x3bc069){if(_0x3bc069){return _0x3bc069[_0x1024('0x25')]()[_0x1024('0x24')](function(){var _0x189f76=_0x3bc069[_0x1024('0x26')]({'plain':!![]});var _0x53c5a6=_0x1024('0x27');return db[_0x1024('0x28')]['destroy']({'where':{'type':_0x53c5a6,'resourceId':_0x189f76['id']}})[_0x1024('0x24')](function(){return _0x3bc069;});})['then'](function(){_0x2ed954[_0x1024('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a713a,_0x486c65){return function(_0x36c20f){if(!_0x36c20f){_0x1a713a['sendStatus'](0x194);}return _0x36c20f;};}function handleError(_0x3a73cd,_0x5bc963){_0x5bc963=_0x5bc963||0x1f4;return function(_0x163f6e){logger[_0x1024('0x29')](_0x163f6e[_0x1024('0x2a')]);if(_0x163f6e[_0x1024('0x2b')]){delete _0x163f6e['name'];}_0x3a73cd[_0x1024('0x17')](_0x5bc963)['send'](_0x163f6e);};}exports['index']=function(_0x328c57,_0x1d23fd){var _0x41f8b9={},_0x34033c={},_0x5bf90e={'count':0x0,'rows':[]};var _0x24ac42=_[_0x1024('0x2c')](db[_0x1024('0x2d')][_0x1024('0x2e')],function(_0x3adfa4){return{'name':_0x3adfa4[_0x1024('0x2f')],'type':_0x3adfa4[_0x1024('0x30')][_0x1024('0x31')]};});_0x34033c[_0x1024('0x32')]=_[_0x1024('0x2c')](_0x24ac42,_0x1024('0x2b'));_0x34033c['query']=_['keys'](_0x328c57['query']);_0x34033c[_0x1024('0x33')]=_[_0x1024('0x34')](_0x34033c[_0x1024('0x32')],_0x34033c[_0x1024('0x35')]);_0x41f8b9[_0x1024('0x36')]=_[_0x1024('0x34')](_0x34033c[_0x1024('0x32')],qs[_0x1024('0x37')](_0x328c57[_0x1024('0x35')][_0x1024('0x37')]));_0x41f8b9[_0x1024('0x36')]=_0x41f8b9[_0x1024('0x36')][_0x1024('0x38')]?_0x41f8b9[_0x1024('0x36')]:_0x34033c[_0x1024('0x32')];if(!_0x328c57[_0x1024('0x35')][_0x1024('0x39')](_0x1024('0x3a'))){_0x41f8b9[_0x1024('0x1c')]=qs[_0x1024('0x1c')](_0x328c57[_0x1024('0x35')][_0x1024('0x1c')]);_0x41f8b9['offset']=qs['offset'](_0x328c57[_0x1024('0x35')][_0x1024('0x1a')]);}_0x41f8b9['order']=qs[_0x1024('0x3b')](_0x328c57[_0x1024('0x35')][_0x1024('0x3b')]);_0x41f8b9[_0x1024('0x3c')]=qs[_0x1024('0x33')](_[_0x1024('0x3d')](_0x328c57[_0x1024('0x35')],_0x34033c[_0x1024('0x33')]),_0x24ac42);if(_0x328c57[_0x1024('0x35')][_0x1024('0x3e')]){_0x41f8b9[_0x1024('0x3c')]=_[_0x1024('0x3f')](_0x41f8b9[_0x1024('0x3c')],{'$or':_[_0x1024('0x2c')](_0x24ac42,function(_0x1cb936){if(_0x1cb936[_0x1024('0x30')]!==_0x1024('0x40')){var _0xa1616d={};_0xa1616d[_0x1cb936[_0x1024('0x2b')]]={'$like':'%'+_0x328c57[_0x1024('0x35')]['filter']+'%'};return _0xa1616d;}})});}_0x41f8b9=_[_0x1024('0x3f')]({},_0x41f8b9,_0x328c57[_0x1024('0x41')]);var _0x42eeb5={'where':_0x41f8b9[_0x1024('0x3c')]};return db['Variable']['count'](_0x42eeb5)[_0x1024('0x24')](function(_0x39d74a){_0x5bf90e[_0x1024('0x1d')]=_0x39d74a;if(_0x328c57[_0x1024('0x35')][_0x1024('0x42')]){_0x41f8b9[_0x1024('0x43')]=[{'all':!![]}];}return db[_0x1024('0x2d')][_0x1024('0x44')](_0x41f8b9);})[_0x1024('0x24')](function(_0x4ada74){_0x5bf90e[_0x1024('0x45')]=_0x4ada74;return _0x5bf90e;})[_0x1024('0x24')](respondWithFilteredResult(_0x1d23fd,_0x41f8b9))[_0x1024('0x46')](handleError(_0x1d23fd,null));};exports[_0x1024('0x47')]=function(_0x3aace8,_0x4586d3){var _0x283226={'raw':!![],'where':{'id':_0x3aace8[_0x1024('0x48')]['id']}},_0x38a81e={};_0x38a81e[_0x1024('0x32')]=_[_0x1024('0x49')](db[_0x1024('0x2d')][_0x1024('0x2e')]);_0x38a81e[_0x1024('0x35')]=_[_0x1024('0x49')](_0x3aace8[_0x1024('0x35')]);_0x38a81e[_0x1024('0x33')]=_['intersection'](_0x38a81e['model'],_0x38a81e[_0x1024('0x35')]);_0x283226['attributes']=_[_0x1024('0x34')](_0x38a81e[_0x1024('0x32')],qs[_0x1024('0x37')](_0x3aace8['query'][_0x1024('0x37')]));_0x283226[_0x1024('0x36')]=_0x283226[_0x1024('0x36')][_0x1024('0x38')]?_0x283226[_0x1024('0x36')]:_0x38a81e[_0x1024('0x32')];if(_0x3aace8['query'][_0x1024('0x42')]){_0x283226['include']=[{'all':!![]}];}_0x283226=_[_0x1024('0x3f')]({},_0x283226,_0x3aace8['options']);return db[_0x1024('0x2d')][_0x1024('0x4a')](_0x283226)[_0x1024('0x24')](handleEntityNotFound(_0x4586d3,null))[_0x1024('0x24')](respondWithResult(_0x4586d3,null))[_0x1024('0x46')](handleError(_0x4586d3,null));};exports[_0x1024('0x4b')]=function(_0x4de0e9,_0x35b85b){return db['Variable']['create'](_0x4de0e9[_0x1024('0x4c')],{})[_0x1024('0x24')](function(_0x2bf0c5){var _0x270926=_0x4de0e9[_0x1024('0x4d')][_0x1024('0x26')]({'plain':!![]});if(!_0x270926)throw new Error(_0x1024('0x4e'));if(_0x270926[_0x1024('0x4f')]===_0x1024('0x4d')){var _0x43cacf=_0x2bf0c5['get']({'plain':!![]});var _0x270705=_0x1024('0x27');return db[_0x1024('0x50')][_0x1024('0x4a')]({'where':{'name':_0x270705,'userProfileId':_0x270926[_0x1024('0x51')]},'raw':!![]})[_0x1024('0x24')](function(_0x14b3da){if(_0x14b3da&&_0x14b3da[_0x1024('0x52')]===0x0){return db[_0x1024('0x28')][_0x1024('0x4b')]({'name':_0x43cacf[_0x1024('0x2b')],'resourceId':_0x43cacf['id'],'type':_0x14b3da[_0x1024('0x2b')],'sectionId':_0x14b3da['id']},{})['then'](function(){return _0x2bf0c5;});}else{return _0x2bf0c5;}})[_0x1024('0x46')](function(_0x4989e6){logger['error'](_0x1024('0x53'),_0x4989e6);throw _0x4989e6;});}return _0x2bf0c5;})[_0x1024('0x24')](respondWithResult(_0x35b85b,0xc9))[_0x1024('0x46')](handleError(_0x35b85b,null));};exports[_0x1024('0x23')]=function(_0x563f07,_0x1abc83){if(_0x563f07[_0x1024('0x4c')]['id']){delete _0x563f07[_0x1024('0x4c')]['id'];}return db[_0x1024('0x2d')][_0x1024('0x4a')]({'where':{'id':_0x563f07[_0x1024('0x48')]['id']}})[_0x1024('0x24')](handleEntityNotFound(_0x1abc83,null))[_0x1024('0x24')](saveUpdates(_0x563f07['body'],null))[_0x1024('0x24')](respondWithResult(_0x1abc83,null))[_0x1024('0x46')](handleError(_0x1abc83,null));};exports[_0x1024('0x25')]=function(_0x1964ab,_0x1b3109){return db['Variable'][_0x1024('0x4a')]({'where':{'id':_0x1964ab['params']['id']}})[_0x1024('0x24')](handleEntityNotFound(_0x1b3109,null))[_0x1024('0x24')](removeEntity(_0x1b3109,null))[_0x1024('0x46')](handleError(_0x1b3109,null));}; \ No newline at end of file +var _0x0f23=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','sendStatus','error','stack','name','send','index','Variable','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','where','merge','map','type','filter','includeAll','include','findAll','rows','catch','show','params','filters','options','find','create','body','user'];(function(_0x1fc67a,_0x6dbdab){var _0x29dc38=function(_0x147b4b){while(--_0x147b4b){_0x1fc67a['push'](_0x1fc67a['shift']());}};_0x29dc38(++_0x6dbdab);}(_0x0f23,0x101));var _0x30f2=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x0f23[_0x218972];return _0x1bb1a8;};'use strict';var emlformat=require(_0x30f2('0x0'));var rimraf=require(_0x30f2('0x1'));var zipdir=require(_0x30f2('0x2'));var jsonpatch=require(_0x30f2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x30f2('0x4'));var Mustache=require(_0x30f2('0x5'));var util=require(_0x30f2('0x6'));var path=require(_0x30f2('0x7'));var sox=require(_0x30f2('0x8'));var csv=require(_0x30f2('0x9'));var ejs=require(_0x30f2('0xa'));var fs=require('fs');var fs_extra=require(_0x30f2('0xb'));var _=require('lodash');var squel=require(_0x30f2('0xc'));var crypto=require(_0x30f2('0xd'));var jsforce=require(_0x30f2('0xe'));var deskjs=require(_0x30f2('0xf'));var toCsv=require(_0x30f2('0x9'));var querystring=require('querystring');var Papa=require(_0x30f2('0x10'));var Redis=require(_0x30f2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x30f2('0x12'));var as=require(_0x30f2('0x13'));var hardwareService=require(_0x30f2('0x14'));var logger=require(_0x30f2('0x15'))(_0x30f2('0x16'));var utils=require(_0x30f2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x30f2('0x18'));var db=require(_0x30f2('0x19'))['db'];function respondWithStatusCode(_0x4e3c40,_0x1378b5){_0x1378b5=_0x1378b5||0xcc;return function(_0x175770){if(_0x175770){return _0x4e3c40['sendStatus'](_0x1378b5);}return _0x4e3c40[_0x30f2('0x1a')](_0x1378b5)[_0x30f2('0x1b')]();};}function respondWithResult(_0x6c8903,_0x2bed8c){_0x2bed8c=_0x2bed8c||0xc8;return function(_0x5c74f0){if(_0x5c74f0){return _0x6c8903['status'](_0x2bed8c)[_0x30f2('0x1c')](_0x5c74f0);}};}function respondWithFilteredResult(_0x138641,_0x9f5be7){return function(_0x386aab){if(_0x386aab){var _0x35a835=typeof _0x9f5be7['offset']===_0x30f2('0x1d')&&typeof _0x9f5be7['limit']===_0x30f2('0x1d');var _0x54eaee=_0x386aab['count'];var _0x4643b2=_0x35a835?0x0:_0x9f5be7[_0x30f2('0x1e')];var _0x5254cd=_0x35a835?_0x386aab[_0x30f2('0x1f')]:_0x9f5be7['offset']+_0x9f5be7[_0x30f2('0x20')];var _0x4688e2;if(_0x5254cd>=_0x54eaee){_0x5254cd=_0x54eaee;_0x4688e2=0xc8;}else{_0x4688e2=0xce;}_0x138641[_0x30f2('0x1a')](_0x4688e2);return _0x138641[_0x30f2('0x21')](_0x30f2('0x22'),_0x4643b2+'-'+_0x5254cd+'/'+_0x54eaee)[_0x30f2('0x1c')](_0x386aab);}return null;};}function patchUpdates(_0x79dc25){return function(_0x1fa7db){try{jsonpatch[_0x30f2('0x23')](_0x1fa7db,_0x79dc25,!![]);}catch(_0x71ea90){return BPromise[_0x30f2('0x24')](_0x71ea90);}return _0x1fa7db[_0x30f2('0x25')]();};}function saveUpdates(_0x188893,_0x5579b5){return function(_0x34daad){if(_0x34daad){return _0x34daad[_0x30f2('0x26')](_0x188893)[_0x30f2('0x27')](function(_0x27e147){return _0x27e147;});}return null;};}function removeEntity(_0x3795ea,_0x1f3f70){return function(_0x500332){if(_0x500332){return _0x500332[_0x30f2('0x28')]()[_0x30f2('0x27')](function(){var _0x53227a=_0x500332[_0x30f2('0x29')]({'plain':!![]});var _0x347d4b=_0x30f2('0x2a');return db['UserProfileResource'][_0x30f2('0x28')]({'where':{'type':_0x347d4b,'resourceId':_0x53227a['id']}})[_0x30f2('0x27')](function(){return _0x500332;});})[_0x30f2('0x27')](function(){_0x3795ea['status'](0xcc)[_0x30f2('0x1b')]();});}};}function handleEntityNotFound(_0x3896e7,_0x23ee35){return function(_0x893857){if(!_0x893857){_0x3896e7[_0x30f2('0x2b')](0x194);}return _0x893857;};}function handleError(_0x200a58,_0x1b9a6b){_0x1b9a6b=_0x1b9a6b||0x1f4;return function(_0x74171c){logger[_0x30f2('0x2c')](_0x74171c[_0x30f2('0x2d')]);if(_0x74171c[_0x30f2('0x2e')]){delete _0x74171c[_0x30f2('0x2e')];}_0x200a58[_0x30f2('0x1a')](_0x1b9a6b)[_0x30f2('0x2f')](_0x74171c);};}exports[_0x30f2('0x30')]=function(_0x34e41f,_0x484777){var _0x5722b4={},_0x4a8456={},_0x34876f={'count':0x0,'rows':[]};var _0x1a9db3=_['map'](db[_0x30f2('0x31')][_0x30f2('0x32')],function(_0x436970){return{'name':_0x436970['fieldName'],'type':_0x436970['type'][_0x30f2('0x33')]};});_0x4a8456[_0x30f2('0x34')]=_['map'](_0x1a9db3,_0x30f2('0x2e'));_0x4a8456[_0x30f2('0x35')]=_[_0x30f2('0x36')](_0x34e41f[_0x30f2('0x35')]);_0x4a8456['filters']=_[_0x30f2('0x37')](_0x4a8456[_0x30f2('0x34')],_0x4a8456[_0x30f2('0x35')]);_0x5722b4['attributes']=_[_0x30f2('0x37')](_0x4a8456[_0x30f2('0x34')],qs[_0x30f2('0x38')](_0x34e41f[_0x30f2('0x35')][_0x30f2('0x38')]));_0x5722b4[_0x30f2('0x39')]=_0x5722b4[_0x30f2('0x39')][_0x30f2('0x3a')]?_0x5722b4['attributes']:_0x4a8456[_0x30f2('0x34')];if(!_0x34e41f[_0x30f2('0x35')]['hasOwnProperty'](_0x30f2('0x3b'))){_0x5722b4[_0x30f2('0x20')]=qs[_0x30f2('0x20')](_0x34e41f[_0x30f2('0x35')][_0x30f2('0x20')]);_0x5722b4[_0x30f2('0x1e')]=qs[_0x30f2('0x1e')](_0x34e41f['query'][_0x30f2('0x1e')]);}_0x5722b4[_0x30f2('0x3c')]=qs['sort'](_0x34e41f[_0x30f2('0x35')]['sort']);_0x5722b4[_0x30f2('0x3d')]=qs['filters'](_['pick'](_0x34e41f['query'],_0x4a8456['filters']),_0x1a9db3);if(_0x34e41f['query']['filter']){_0x5722b4['where']=_[_0x30f2('0x3e')](_0x5722b4[_0x30f2('0x3d')],{'$or':_[_0x30f2('0x3f')](_0x1a9db3,function(_0x35c272){if(_0x35c272[_0x30f2('0x40')]!=='VIRTUAL'){var _0x2e48ed={};_0x2e48ed[_0x35c272[_0x30f2('0x2e')]]={'$like':'%'+_0x34e41f['query'][_0x30f2('0x41')]+'%'};return _0x2e48ed;}})});}_0x5722b4=_[_0x30f2('0x3e')]({},_0x5722b4,_0x34e41f['options']);var _0x170d68={'where':_0x5722b4[_0x30f2('0x3d')]};return db[_0x30f2('0x31')][_0x30f2('0x1f')](_0x170d68)[_0x30f2('0x27')](function(_0x3b4787){_0x34876f[_0x30f2('0x1f')]=_0x3b4787;if(_0x34e41f['query'][_0x30f2('0x42')]){_0x5722b4[_0x30f2('0x43')]=[{'all':!![]}];}return db[_0x30f2('0x31')][_0x30f2('0x44')](_0x5722b4);})[_0x30f2('0x27')](function(_0x5015c9){_0x34876f[_0x30f2('0x45')]=_0x5015c9;return _0x34876f;})['then'](respondWithFilteredResult(_0x484777,_0x5722b4))[_0x30f2('0x46')](handleError(_0x484777,null));};exports[_0x30f2('0x47')]=function(_0x368707,_0x548d85){var _0x271dc7={'raw':!![],'where':{'id':_0x368707[_0x30f2('0x48')]['id']}},_0x311f3f={};_0x311f3f[_0x30f2('0x34')]=_[_0x30f2('0x36')](db[_0x30f2('0x31')][_0x30f2('0x32')]);_0x311f3f[_0x30f2('0x35')]=_['keys'](_0x368707[_0x30f2('0x35')]);_0x311f3f[_0x30f2('0x49')]=_[_0x30f2('0x37')](_0x311f3f[_0x30f2('0x34')],_0x311f3f[_0x30f2('0x35')]);_0x271dc7['attributes']=_['intersection'](_0x311f3f[_0x30f2('0x34')],qs[_0x30f2('0x38')](_0x368707[_0x30f2('0x35')]['fields']));_0x271dc7['attributes']=_0x271dc7['attributes'][_0x30f2('0x3a')]?_0x271dc7['attributes']:_0x311f3f[_0x30f2('0x34')];if(_0x368707[_0x30f2('0x35')][_0x30f2('0x42')]){_0x271dc7[_0x30f2('0x43')]=[{'all':!![]}];}_0x271dc7=_[_0x30f2('0x3e')]({},_0x271dc7,_0x368707[_0x30f2('0x4a')]);return db[_0x30f2('0x31')][_0x30f2('0x4b')](_0x271dc7)[_0x30f2('0x27')](handleEntityNotFound(_0x548d85,null))[_0x30f2('0x27')](respondWithResult(_0x548d85,null))[_0x30f2('0x46')](handleError(_0x548d85,null));};exports[_0x30f2('0x4c')]=function(_0x332a36,_0x4df3fc){return db[_0x30f2('0x31')][_0x30f2('0x4c')](_0x332a36[_0x30f2('0x4d')],{})[_0x30f2('0x27')](function(_0xd97454){var _0x1441fa=_0x332a36[_0x30f2('0x4e')]['get']({'plain':!![]});if(!_0x1441fa)throw new Error(_0x30f2('0x4f'));if(_0x1441fa['role']===_0x30f2('0x4e')){var _0x1c1925=_0xd97454['get']({'plain':!![]});var _0x52331f=_0x30f2('0x2a');return db[_0x30f2('0x50')]['find']({'where':{'name':_0x52331f,'userProfileId':_0x1441fa[_0x30f2('0x51')]},'raw':!![]})[_0x30f2('0x27')](function(_0x57389c){if(_0x57389c&&_0x57389c[_0x30f2('0x52')]===0x0){return db['UserProfileResource'][_0x30f2('0x4c')]({'name':_0x1c1925[_0x30f2('0x2e')],'resourceId':_0x1c1925['id'],'type':_0x57389c[_0x30f2('0x2e')],'sectionId':_0x57389c['id']},{})[_0x30f2('0x27')](function(){return _0xd97454;});}else{return _0xd97454;}})[_0x30f2('0x46')](function(_0x3ad47f){logger['error'](_0x30f2('0x53'),_0x3ad47f);throw _0x3ad47f;});}return _0xd97454;})[_0x30f2('0x27')](respondWithResult(_0x4df3fc,0xc9))[_0x30f2('0x46')](handleError(_0x4df3fc,null));};exports[_0x30f2('0x26')]=function(_0x419a35,_0x32e754){if(_0x419a35[_0x30f2('0x4d')]['id']){delete _0x419a35['body']['id'];}return db['Variable'][_0x30f2('0x4b')]({'where':{'id':_0x419a35[_0x30f2('0x48')]['id']}})[_0x30f2('0x27')](handleEntityNotFound(_0x32e754,null))['then'](saveUpdates(_0x419a35[_0x30f2('0x4d')],null))[_0x30f2('0x27')](respondWithResult(_0x32e754,null))['catch'](handleError(_0x32e754,null));};exports[_0x30f2('0x28')]=function(_0x542617,_0x147ee0){return db[_0x30f2('0x31')][_0x30f2('0x4b')]({'where':{'id':_0x542617[_0x30f2('0x48')]['id']}})[_0x30f2('0x27')](handleEntityNotFound(_0x147ee0,null))[_0x30f2('0x27')](removeEntity(_0x147ee0,null))['catch'](handleError(_0x147ee0,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 0528dff..ff25733 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 _0x533f=['path','rimraf','../../config/environment','exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4a4e77,_0x186df1){var _0x146e8a=function(_0x13d829){while(--_0x13d829){_0x4a4e77['push'](_0x4a4e77['shift']());}};_0x146e8a(++_0x186df1);}(_0x533f,0x159));var _0xf533=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x533f[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0xf533('0x0'));var util=require(_0xf533('0x1'));var logger=require(_0xf533('0x2'))(_0xf533('0x3'));var moment=require('moment');var BPromise=require(_0xf533('0x4'));var rp=require(_0xf533('0x5'));var fs=require('fs');var path=require(_0xf533('0x6'));var rimraf=require(_0xf533('0x7'));var config=require(_0xf533('0x8'));var attributes=require('./variable.attributes');module[_0xf533('0x9')]=function(_0x2515d8,_0x544002){return _0x2515d8[_0xf533('0xa')](_0xf533('0xb'),attributes,{'tableName':_0xf533('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45e=['request-promise','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf45e,0x1a8));var _0xef45=function(_0x48cc91,_0x1b6962){_0x48cc91=_0x48cc91-0x0;var _0x3b9307=_0xf45e[_0x48cc91];return _0x3b9307;};'use strict';var _=require(_0xef45('0x0'));var util=require(_0xef45('0x1'));var logger=require(_0xef45('0x2'))(_0xef45('0x3'));var moment=require(_0xef45('0x4'));var BPromise=require('bluebird');var rp=require(_0xef45('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef45('0x6'));var attributes=require(_0xef45('0x7'));module[_0xef45('0x8')]=function(_0x1f96e9,_0xd5118b){return _0x1f96e9[_0xef45('0x9')]('Variable',attributes,{'tableName':_0xef45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index f00a81d..286d450 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x3318fe,_0x3f5d89){var _0x574ad=function(_0x2e843e){while(--_0x2e843e){_0x3318fe['push'](_0x3318fe['shift']());}};_0x574ad(++_0x3f5d89);}(_0x55ca,0x126));var _0xa55c=function(_0x32905d,_0x2ed18c){_0x32905d=_0x32905d-0x0;var _0x2c3f12=_0x55ca[_0x32905d];return _0x2c3f12;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0xf494=['where','attributes','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','message','catch','ShowVariable','find','options','raw'];(function(_0x323455,_0xbd3d87){var _0x56e62d=function(_0x1707ce){while(--_0x1707ce){_0x323455['push'](_0x323455['shift']());}};_0x56e62d(++_0xbd3d87);}(_0xf494,0x1c6));var _0x4f49=function(_0x4268eb,_0x79c33b){_0x4268eb=_0x4268eb-0x0;var _0x98b2e2=_0xf494[_0x4268eb];return _0x98b2e2;};'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);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Variable'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x4e85df['options'][_0x4f49('0x1c')],function(_0x1d70a7){return{'model':db[_0x1d70a7[_0x4f49('0x1e')]],'as':_0x1d70a7['as'],'attributes':_0x1d70a7[_0x4f49('0x1b')],'include':_0x1d70a7[_0x4f49('0x1c')]?_[_0x4f49('0x1d')](_0x1d70a7['include'],function(_0x4e9041){return{'model':db[_0x4e9041[_0x4f49('0x1e')]],'as':_0x4e9041['as'],'attributes':_0x4e9041[_0x4f49('0x1b')],'include':_0x4e9041['include']?_[_0x4f49('0x1d')](_0x4e9041[_0x4f49('0x1c')],function(_0x35f8e0){return{'model':db[_0x35f8e0['model']],'as':_0x35f8e0['as'],'attributes':_0x35f8e0[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x298785){logger[_0x4f49('0xf')](_0x4f49('0x16'),_0x4e85df);logger[_0x4f49('0x1f')]('ShowVariable',_0x4e85df,JSON['stringify'](_0x298785));_0x5bb23b(_0x298785);})[_0x4f49('0x15')](function(_0x2c00ee){logger[_0x4f49('0x13')]('ShowVariable',_0x2c00ee[_0x4f49('0x14')],_0x4e85df);_0x560592(_0x49cdaf[_0x4f49('0x13')](0x1f4,_0x2c00ee[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index cce4586..26bd2ed 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 _0x9b96=['/fetch','canUpdate','fetch','isAuthenticated','reset','/pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b96,0x96));var _0x69b9=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x9b96[_0x2b5eae];return _0x5f3ac9;};'use strict';var express=require(_0x69b9('0x0'));var router=express[_0x69b9('0x1')]();var auth=require(_0x69b9('0x2'));var controller=require('./version.controller');router[_0x69b9('0x3')]('/',controller['index']);router['get'](_0x69b9('0x4'),auth['isAuthenticated'](),auth[_0x69b9('0x5')](),controller[_0x69b9('0x6')]);router['get']('/reset',auth[_0x69b9('0x7')](),auth[_0x69b9('0x5')](),controller[_0x69b9('0x8')]);router['get'](_0x69b9('0x9'),auth[_0x69b9('0x7')](),auth[_0x69b9('0x5')](),controller['pull']);router[_0x69b9('0x3')](_0x69b9('0xa'),auth[_0x69b9('0x7')](),controller[_0x69b9('0xb')]);router['get'](_0x69b9('0xc'),controller['migrations']);module[_0x69b9('0xd')]=router; \ No newline at end of file +var _0x226f=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','../../components/auth/service'];(function(_0x13e0fc,_0x34132a){var _0x51309e=function(_0x2f46d9){while(--_0x2f46d9){_0x13e0fc['push'](_0x13e0fc['shift']());}};_0x51309e(++_0x34132a);}(_0x226f,0xff));var _0xf226=function(_0x4d5bc9,_0x3347d2){_0x4d5bc9=_0x4d5bc9-0x0;var _0x41083d=_0x226f[_0x4d5bc9];return _0x41083d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xf226('0x0'));var controller=require(_0xf226('0x1'));router[_0xf226('0x2')]('/',controller[_0xf226('0x3')]);router[_0xf226('0x2')](_0xf226('0x4'),auth[_0xf226('0x5')](),auth[_0xf226('0x6')](),controller[_0xf226('0x7')]);router[_0xf226('0x2')]('/reset',auth['isAuthenticated'](),auth[_0xf226('0x6')](),controller[_0xf226('0x8')]);router[_0xf226('0x2')](_0xf226('0x9'),auth[_0xf226('0x5')](),auth[_0xf226('0x6')](),controller[_0xf226('0xa')]);router[_0xf226('0x2')](_0xf226('0xb'),auth['isAuthenticated'](),controller[_0xf226('0xc')]);router[_0xf226('0x2')](_0xf226('0xd'),controller[_0xf226('0xe')]);module[_0xf226('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5329e08..18cd164 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 _0x2048=['info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../config/pm2','update','root','index','version','query','latest','tags','exports','2.0.0','status','json','fetch','origin','master','error'];(function(_0x573b1f,_0x1d9832){var _0x46d54a=function(_0x3dcf47){while(--_0x3dcf47){_0x573b1f['push'](_0x573b1f['shift']());}};_0x46d54a(++_0x1d9832);}(_0x2048,0x82));var _0x8204=function(_0x28da10,_0x29470c){_0x28da10=_0x28da10-0x0;var _0x298372=_0x2048[_0x28da10];return _0x298372;};'use strict';var Umzug=require(_0x8204('0x0'));var path=require(_0x8204('0x1'));var fs=require('fs');var _=require(_0x8204('0x2'));var pkginfo=require(_0x8204('0x3'))(module,'version');var compareVersions=require(_0x8204('0x4'));var exec=require(_0x8204('0x5'))[_0x8204('0x6')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x8204('0x7'));var logger=require('../../config/logger')(_0x8204('0x8'));var git=require('simple-git')(config[_0x8204('0x9')]);exports[_0x8204('0xa')]=function(_0x1e8c59,_0x3167d5){var _0x3a79be={'current':module['exports'][_0x8204('0xb')],'phonebar':0x2};if(_0x1e8c59[_0x8204('0xc')]&&_0x1e8c59['query'][_0x8204('0xd')]){return git['fetch']()[_0x8204('0xe')](function(_0x56ea13,_0x200991){_0x3a79be[_0x8204('0xd')]=(_0x56ea13?module[_0x8204('0xf')][_0x8204('0xb')]:_0x200991[_0x8204('0xd')])||_0x8204('0x10');return _0x3167d5[_0x8204('0x11')](0xc8)[_0x8204('0x12')](_0x3a79be);});}else{return _0x3167d5[_0x8204('0x11')](0xc8)[_0x8204('0x12')](_0x3a79be);}};exports[_0x8204('0x13')]=function(_0x556509,_0x32fd6b){return git['fetch']([_0x8204('0x14'),_0x8204('0x15')],function(_0x52f203){if(_0x52f203){logger[_0x8204('0x16')](_0x52f203);return _0x32fd6b[_0x8204('0x11')](0x1f4)[_0x8204('0x12')](_0x52f203);}logger[_0x8204('0x17')](_0x8204('0x18'));return _0x32fd6b[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x8204('0x19')]=function(_0x4c8935,_0x24bfde){return git[_0x8204('0x19')]([_0x8204('0x1a'),_0x8204('0x1b')],function(_0x19d4ed){if(_0x19d4ed){logger[_0x8204('0x16')](_0x19d4ed);return _0x24bfde[_0x8204('0x11')](0x1f4)[_0x8204('0x12')](_0x19d4ed);}logger[_0x8204('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x24bfde[_0x8204('0x11')](0xc8)['json']({'output':_0x8204('0x1c')});});};exports['pull']=function(_0x341978,_0xa86e26){exec(_0x8204('0x1d'),function(_0x349bcc,_0x568b43,_0x2d0b56){logger[_0x8204('0x17')](_0x568b43);logger[_0x8204('0x17')](_0x2d0b56);if(_0x349bcc){logger[_0x8204('0x16')](_0x349bcc);return _0xa86e26[_0x8204('0x11')](0x1f4)[_0x8204('0x12')](_0x349bcc);}return _0xa86e26[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':_0x568b43});});};exports[_0x8204('0x1e')]=function(_0xeb3422,_0x584603){return pm2[_0x8204('0x1e')](_0x8204('0x1f'))[_0x8204('0x20')](function(_0x448c14){logger[_0x8204('0x17')]('pm2\x20restart\x20motion\x20%s',_0x448c14);return _0x584603[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':_0x8204('0x21')});})[_0x8204('0x22')](function(_0x582fb8){logger[_0x8204('0x16')](_0x582fb8);return _0x584603[_0x8204('0x11')](0x1f4)['json'](_0x582fb8);});};exports[_0x8204('0x23')]=function(_0x262acd,_0x405909){var _0x1e91b8=fs['readdirSync'](path[_0x8204('0x24')](config['root'],_0x8204('0x25'),'migrations'));var _0x357eec=[];for(var _0x3cde19=0x0;_0x3cde19<_0x1e91b8[_0x8204('0x26')];_0x3cde19++){var _0x43f067=_0x1e91b8[_0x3cde19][_0x8204('0x27')](_0x8204('0x28'),'');if(compareVersions(module['exports'][_0x8204('0xb')],_0x43f067)===-0x1){_0x357eec[_0x8204('0x29')](_0x43f067);}}if(_0x357eec[_0x8204('0x26')]){var _0x2f670d=_0x357eec[_0x8204('0x2a')](compareVersions);var _0x1be46d=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x8204('0x2b')],'modelName':_0x8204('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x8204('0x2c')]['getQueryInterface'](),db['sequelize'][_0x8204('0x2d')],function(){throw new Error(_0x8204('0x2e'));}],'path':path['join'](config[_0x8204('0x9')],_0x8204('0x25'),'migrations'),'pattern':/\.js$/}});_0x1be46d['up']({'migrations':_[_0x8204('0x2f')](_0x2f670d,function(_0x28a490){return _0x28a490+_0x8204('0x28');})})[_0x8204('0x20')](function(){return _0x405909[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8204('0xf')]['version']+'\x20to\x20'+_[_0x8204('0x30')](_0x2f670d),'migrations':_['join'](_0x2f670d)});})[_0x8204('0x22')](function(_0x4052a5){if(_0x4052a5 instanceof db[_0x8204('0x2c')][_0x8204('0x31')]){return _0x405909[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':_0x8204('0x32')});}else{return _0x405909[_0x8204('0x11')](0x1f4)['json'](_0x4052a5);}});}else{return _0x405909[_0x8204('0x11')](0xc8)[_0x8204('0x12')]({'output':_0x8204('0x32')});}}; \ No newline at end of file +var _0x79b7=['status','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','length','.js','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','version','query','latest','fetch','tags','json'];(function(_0x1afb1a,_0x256b1c){var _0x5205a1=function(_0x3634a4){while(--_0x3634a4){_0x1afb1a['push'](_0x1afb1a['shift']());}};_0x5205a1(++_0x256b1c);}(_0x79b7,0x1bf));var _0x779b=function(_0x2687d1,_0xf04d43){_0x2687d1=_0x2687d1-0x0;var _0x45591d=_0x79b7[_0x2687d1];return _0x45591d;};'use strict';var Umzug=require('umzug');var path=require(_0x779b('0x0'));var fs=require('fs');var _=require(_0x779b('0x1'));var pkginfo=require(_0x779b('0x2'))(module,'version');var compareVersions=require(_0x779b('0x3'));var exec=require(_0x779b('0x4'))[_0x779b('0x5')];var db=require(_0x779b('0x6'))['db'];var config=require(_0x779b('0x7'));var pm2=require(_0x779b('0x8'));var logger=require(_0x779b('0x9'))(_0x779b('0xa'));var git=require(_0x779b('0xb'))(config[_0x779b('0xc')]);exports[_0x779b('0xd')]=function(_0x38f01b,_0x1b8be1){var _0x22c93b={'current':module[_0x779b('0xe')][_0x779b('0xf')],'phonebar':0x2};if(_0x38f01b[_0x779b('0x10')]&&_0x38f01b[_0x779b('0x10')][_0x779b('0x11')]){return git[_0x779b('0x12')]()[_0x779b('0x13')](function(_0x4aa4cd,_0xa292ff){_0x22c93b[_0x779b('0x11')]=(_0x4aa4cd?module[_0x779b('0xe')]['version']:_0xa292ff[_0x779b('0x11')])||'2.0.0';return _0x1b8be1['status'](0xc8)[_0x779b('0x14')](_0x22c93b);});}else{return _0x1b8be1[_0x779b('0x15')](0xc8)['json'](_0x22c93b);}};exports[_0x779b('0x12')]=function(_0x3561b0,_0x43d261){return git['fetch']([_0x779b('0x16'),_0x779b('0x17')],function(_0x15a7ff){if(_0x15a7ff){logger[_0x779b('0x18')](_0x15a7ff);return _0x43d261[_0x779b('0x15')](0x1f4)[_0x779b('0x14')](_0x15a7ff);}logger[_0x779b('0x19')](_0x779b('0x1a'));return _0x43d261['status'](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x779b('0x1b')]=function(_0x5b7e2e,_0x2d2ff7){return git[_0x779b('0x1b')]([_0x779b('0x1c'),_0x779b('0x1d')],function(_0x583b19){if(_0x583b19){logger[_0x779b('0x18')](_0x583b19);return _0x2d2ff7[_0x779b('0x15')](0x1f4)[_0x779b('0x14')](_0x583b19);}logger[_0x779b('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2d2ff7['status'](0xc8)[_0x779b('0x14')]({'output':_0x779b('0x1e')});});};exports[_0x779b('0x1f')]=function(_0x12ba23,_0x5994e9){exec('npm\x20install\x20--production',function(_0x5441aa,_0xe3c7da,_0x5c2bf7){logger[_0x779b('0x19')](_0xe3c7da);logger[_0x779b('0x19')](_0x5c2bf7);if(_0x5441aa){logger[_0x779b('0x18')](_0x5441aa);return _0x5994e9['status'](0x1f4)[_0x779b('0x14')](_0x5441aa);}return _0x5994e9['status'](0xc8)[_0x779b('0x14')]({'output':_0xe3c7da});});};exports['restart']=function(_0x2f1424,_0x566d31){return pm2[_0x779b('0x20')](_0x779b('0x21'))[_0x779b('0x22')](function(_0x423036){logger[_0x779b('0x19')]('pm2\x20restart\x20motion\x20%s',_0x423036);return _0x566d31[_0x779b('0x15')](0xc8)['json']({'output':_0x779b('0x23')});})[_0x779b('0x24')](function(_0x39ba5f){logger[_0x779b('0x18')](_0x39ba5f);return _0x566d31[_0x779b('0x15')](0x1f4)[_0x779b('0x14')](_0x39ba5f);});};exports['migrations']=function(_0x5dbd52,_0x1e760a){var _0x44111f=fs[_0x779b('0x25')](path[_0x779b('0x26')](config[_0x779b('0xc')],_0x779b('0x27'),'migrations'));var _0x268031=[];for(var _0x31375e=0x0;_0x31375e<_0x44111f[_0x779b('0x28')];_0x31375e++){var _0x18bb80=_0x44111f[_0x31375e]['replace'](_0x779b('0x29'),'');if(compareVersions(module[_0x779b('0xe')]['version'],_0x18bb80)===-0x1){_0x268031['push'](_0x18bb80);}}if(_0x268031[_0x779b('0x28')]){var _0x3f7ba9=_0x268031[_0x779b('0x2a')](compareVersions);var _0x234e30=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x779b('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x779b('0x2c')][_0x779b('0x2d')](),db[_0x779b('0x2c')]['constructor'],function(){throw new Error(_0x779b('0x2e'));}],'path':path[_0x779b('0x26')](config[_0x779b('0xc')],_0x779b('0x27'),_0x779b('0x2f')),'pattern':/\.js$/}});_0x234e30['up']({'migrations':_['map'](_0x3f7ba9,function(_0x299d14){return _0x299d14+_0x779b('0x29');})})[_0x779b('0x22')](function(){return _0x1e760a['status'](0xc8)[_0x779b('0x14')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x779b('0xe')]['version']+_0x779b('0x30')+_[_0x779b('0x31')](_0x3f7ba9),'migrations':_[_0x779b('0x26')](_0x3f7ba9)});})[_0x779b('0x24')](function(_0x12af62){if(_0x12af62 instanceof db[_0x779b('0x2c')][_0x779b('0x32')]){return _0x1e760a[_0x779b('0x15')](0xc8)[_0x779b('0x14')]({'output':_0x779b('0x33')});}else{return _0x1e760a[_0x779b('0x15')](0x1f4)[_0x779b('0x14')](_0x12af62);}});}else{return _0x1e760a[_0x779b('0x15')](0xc8)[_0x779b('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 f5cf583..9666ded 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 _0xbf8e=['../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x529d5d,_0x3e6a12){var _0x5c1cc5=function(_0x41f6c4){while(--_0x41f6c4){_0x529d5d['push'](_0x529d5d['shift']());}};_0x5c1cc5(++_0x3e6a12);}(_0xbf8e,0x100));var _0xebf8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbf8e[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xebf8('0x0'));var util=require(_0xebf8('0x1'));var path=require(_0xebf8('0x2'));var timeout=require('connect-timeout');var express=require(_0xebf8('0x3'));var router=express[_0xebf8('0x4')]();var fs_extra=require(_0xebf8('0x5'));var auth=require(_0xebf8('0x6'));var interaction=require(_0xebf8('0x7'));var config=require(_0xebf8('0x8'));var controller=require(_0xebf8('0x9'));router[_0xebf8('0xa')]('/',auth[_0xebf8('0xb')](),controller[_0xebf8('0xc')]);router['get'](_0xebf8('0xd'),auth[_0xebf8('0xb')](),controller['describe']);router[_0xebf8('0xa')](_0xebf8('0xe'),auth[_0xebf8('0xb')](),controller[_0xebf8('0xf')]);router[_0xebf8('0x10')]('/',auth[_0xebf8('0xb')](),controller['create']);router[_0xebf8('0x11')]('/:id',auth[_0xebf8('0xb')](),controller[_0xebf8('0x12')]);router[_0xebf8('0x13')](_0xebf8('0xe'),auth[_0xebf8('0xb')](),controller[_0xebf8('0x14')]);module[_0xebf8('0x15')]=router; \ No newline at end of file +var _0xfe68=['describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe'];(function(_0x31b833,_0x2da1b4){var _0x52a7b3=function(_0x490716){while(--_0x490716){_0x31b833['push'](_0x31b833['shift']());}};_0x52a7b3(++_0x2da1b4);}(_0xfe68,0x1d7));var _0x8fe6=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xfe68[_0x2c6120];return _0x5fb114;};'use strict';var multer=require('multer');var util=require(_0x8fe6('0x0'));var path=require(_0x8fe6('0x1'));var timeout=require(_0x8fe6('0x2'));var express=require(_0x8fe6('0x3'));var router=express['Router']();var fs_extra=require(_0x8fe6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8fe6('0x5'));var config=require(_0x8fe6('0x6'));var controller=require(_0x8fe6('0x7'));router['get']('/',auth[_0x8fe6('0x8')](),controller[_0x8fe6('0x9')]);router[_0x8fe6('0xa')](_0x8fe6('0xb'),auth[_0x8fe6('0x8')](),controller[_0x8fe6('0xc')]);router['get'](_0x8fe6('0xd'),auth[_0x8fe6('0x8')](),controller[_0x8fe6('0xe')]);router['post']('/',auth[_0x8fe6('0x8')](),controller[_0x8fe6('0xf')]);router[_0x8fe6('0x10')](_0x8fe6('0xd'),auth['isAuthenticated'](),controller[_0x8fe6('0x11')]);router[_0x8fe6('0x12')](_0x8fe6('0xd'),auth[_0x8fe6('0x8')](),controller[_0x8fe6('0x13')]);module[_0x8fe6('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d9cb8c2..b9d3bd9 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 _0x66fa=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0xa408f6,_0x7b4ad9){var _0x2d9056=function(_0x4c51df){while(--_0x4c51df){_0xa408f6['push'](_0xa408f6['shift']());}};_0x2d9056(++_0x7b4ad9);}(_0x66fa,0x117));var _0xa66f=function(_0x56ab07,_0x2d986e){_0x56ab07=_0x56ab07-0x0;var _0x510c8b=_0x66fa[_0x56ab07];return _0x510c8b;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xa66f('0x2')]},'calleridnum':{'type':Sequelize[_0xa66f('0x2')]},'calleridname':{'type':Sequelize[_0xa66f('0x2')]},'queue':{'type':Sequelize[_0xa66f('0x2')]},'interface':{'type':Sequelize[_0xa66f('0x2')]},'membername':{'type':Sequelize[_0xa66f('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa66f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xa66f('0x3')]},'agentdumpAt':{'type':Sequelize[_0xa66f('0x3')]},'holdtime':{'type':Sequelize[_0xa66f('0x4')]},'agentcomplete':{'type':Sequelize[_0xa66f('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa66f('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xa66f('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa66f('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xa66f('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa66f('0x2')]},'connectedlinename':{'type':Sequelize[_0xa66f('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa66f('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa66f('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xa66f('0x2')]},'destchannelstate':{'type':Sequelize[_0xa66f('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xa66f('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa66f('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa66f('0x2')]},'destexten':{'type':Sequelize[_0xa66f('0x2')]},'destpriority':{'type':Sequelize[_0xa66f('0x2')]},'destuniqueid':{'type':Sequelize[_0xa66f('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa66f('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa66f('0x2')],'comment':_0xa66f('0x6')},'transferexten':{'type':Sequelize[_0xa66f('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa66f('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbb35=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0xbb35,0x1d3));var _0x5bb3=function(_0xcb277c,_0x19d846){_0xcb277c=_0xcb277c-0x0;var _0x51d263=_0xbb35[_0xcb277c];return _0x51d263;};'use strict';var Sequelize=require('sequelize');module[_0x5bb3('0x0')]={'type':{'type':Sequelize[_0x5bb3('0x1')]},'uniqueid':{'type':Sequelize[_0x5bb3('0x1')]},'calleridnum':{'type':Sequelize[_0x5bb3('0x1')]},'calleridname':{'type':Sequelize[_0x5bb3('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5bb3('0x1')]},'membername':{'type':Sequelize[_0x5bb3('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentconnectAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x5bb3('0x2')]},'agentdumpAt':{'type':Sequelize[_0x5bb3('0x2')]},'holdtime':{'type':Sequelize[_0x5bb3('0x3')]},'agentcomplete':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5bb3('0x3')]},'agentacw':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5bb3('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x5bb3('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5bb3('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5bb3('0x1')]},'connectedlinename':{'type':Sequelize[_0x5bb3('0x1')]},'language':{'type':Sequelize[_0x5bb3('0x1')]},'accountcode':{'type':Sequelize[_0x5bb3('0x1')]},'context':{'type':Sequelize[_0x5bb3('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5bb3('0x1')]},'destchannel':{'type':Sequelize[_0x5bb3('0x1')]},'destchannelstate':{'type':Sequelize[_0x5bb3('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x5bb3('0x1')]},'destcalleridname':{'type':Sequelize[_0x5bb3('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x5bb3('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x5bb3('0x1')]},'destlanguage':{'type':Sequelize[_0x5bb3('0x1')]},'destaccountcode':{'type':Sequelize[_0x5bb3('0x1')]},'destcontext':{'type':Sequelize[_0x5bb3('0x1')]},'destexten':{'type':Sequelize[_0x5bb3('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5bb3('0x1')]},'transfer':{'type':Sequelize[_0x5bb3('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5bb3('0x1')],'comment':_0x5bb3('0x5')},'transferexten':{'type':Sequelize[_0x5bb3('0x1')]},'transferuniqueid':{'type':Sequelize[_0x5bb3('0x1')]},'agententerreason':{'type':Sequelize[_0x5bb3('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 c6addf5..e3c8f3d 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(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 9b0adc2..00d6549 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 _0x14f5=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0x49665a,_0x45c590){var _0x353fa3=function(_0x1f9b8f){while(--_0x1f9b8f){_0x49665a['push'](_0x49665a['shift']());}};_0x353fa3(++_0x45c590);}(_0x14f5,0xae));var _0x514f=function(_0x3b5045,_0xb0bea7){_0x3b5045=_0x3b5045-0x0;var _0x3fa262=_0x14f5[_0x3b5045];return _0x3fa262;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x514f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define'];(function(_0x332d5c,_0x4a2336){var _0x47448d=function(_0x4a00f6){while(--_0x4a00f6){_0x332d5c['push'](_0x332d5c['shift']());}};_0x47448d(++_0x4a2336);}(_0x5075,0x73));var _0x5507=function(_0x49e77b,_0x59ced7){_0x49e77b=_0x49e77b-0x0;var _0x58b978=_0x5075[_0x49e77b];return _0x58b978;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5507('0xc'),_0x5507('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index cb33961..f686dc9 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 _0x4597=['limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','VoiceAgentReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','where','attributes'];(function(_0x355439,_0x35a910){var _0x2c2225=function(_0x18a1bd){while(--_0x18a1bd){_0x355439['push'](_0x355439['shift']());}};_0x2c2225(++_0x35a910);}(_0x4597,0x194));var _0x7459=function(_0xf5e2d0,_0x578e64){_0xf5e2d0=_0xf5e2d0-0x0;var _0x40fe36=_0x4597[_0xf5e2d0];return _0x40fe36;};'use strict';var _=require('lodash');var util=require(_0x7459('0x0'));var moment=require(_0x7459('0x1'));var BPromise=require(_0x7459('0x2'));var rs=require(_0x7459('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7459('0x4'))['db'];var utils=require(_0x7459('0x5'));var logger=require(_0x7459('0x6'))(_0x7459('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7459('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f8d8e,_0x5ed84f,_0x1d9232){return new BPromise(function(_0x938a99,_0x45306d){return client['request'](_0x4f8d8e,_0x1d9232)[_0x7459('0x9')](function(_0x1f0f04){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x5ed84f,_0x7459('0xa'));logger[_0x7459('0xb')](_0x7459('0xc'),_0x5ed84f,_0x7459('0xa'),JSON['stringify'](_0x1f0f04));if(_0x1f0f04['error']){if(_0x1f0f04[_0x7459('0xd')][_0x7459('0xe')]===0x1f4){logger['error'](_0x7459('0xf'),_0x5ed84f,_0x1f0f04[_0x7459('0xd')][_0x7459('0x10')]);return _0x45306d(_0x1f0f04['error'][_0x7459('0x10')]);}logger[_0x7459('0xd')](_0x7459('0xf'),_0x5ed84f,_0x1f0f04[_0x7459('0xd')][_0x7459('0x10')]);return _0x938a99(_0x1f0f04[_0x7459('0xd')]['message']);}else{logger[_0x7459('0x11')](_0x7459('0xf'),_0x5ed84f,'request\x20sent');_0x938a99(_0x1f0f04[_0x7459('0x12')][_0x7459('0x10')]);}})[_0x7459('0x13')](function(_0x184b29){logger[_0x7459('0xd')](_0x7459('0xf'),_0x5ed84f,_0x184b29);_0x45306d(_0x184b29);});});}exports[_0x7459('0x14')]=function(_0x53ebc1){var _0x591e9e=this;return new Promise(function(_0xd9760e,_0x403274){return db[_0x7459('0x15')][_0x7459('0x16')](_0x53ebc1[_0x7459('0x17')],{'raw':_0x53ebc1[_0x7459('0x18')]?_0x53ebc1[_0x7459('0x18')][_0x7459('0x19')]===undefined?!![]:![]:!![]})[_0x7459('0x9')](function(_0x427112){logger[_0x7459('0x11')](_0x7459('0x14'),_0x53ebc1);logger[_0x7459('0xb')](_0x7459('0x14'),_0x53ebc1,JSON[_0x7459('0x1a')](_0x427112));_0xd9760e(_0x427112);})[_0x7459('0x13')](function(_0x87a1b7){logger[_0x7459('0xd')]('CreateVoiceAgentReport',_0x87a1b7[_0x7459('0x10')],_0x53ebc1);_0x403274(_0x591e9e[_0x7459('0xd')](0x1f4,_0x87a1b7['message']));});});};exports[_0x7459('0x1b')]=function(_0x3ae7bf){var _0xa8d8bf=this;return new Promise(function(_0x34fba0,_0x51b2bc){return db['VoiceAgentReport']['update'](_0x3ae7bf[_0x7459('0x17')],{'raw':_0x3ae7bf['options']?_0x3ae7bf[_0x7459('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ae7bf[_0x7459('0x18')]?_0x3ae7bf[_0x7459('0x18')][_0x7459('0x1c')]||null:null,'attributes':_0x3ae7bf[_0x7459('0x18')]?_0x3ae7bf[_0x7459('0x18')][_0x7459('0x1d')]||null:null,'limit':_0x3ae7bf[_0x7459('0x18')]?_0x3ae7bf[_0x7459('0x18')][_0x7459('0x1e')]||null:null})[_0x7459('0x9')](function(_0x53219c){logger[_0x7459('0x11')]('UpdateVoiceAgentReport',_0x3ae7bf);logger[_0x7459('0xb')](_0x7459('0x1b'),_0x3ae7bf,JSON[_0x7459('0x1a')](_0x53219c));_0x34fba0(_0x53219c);})[_0x7459('0x13')](function(_0x9b2dca){logger[_0x7459('0xd')]('UpdateVoiceAgentReport',_0x9b2dca[_0x7459('0x10')],_0x3ae7bf);_0x51b2bc(_0xa8d8bf['error'](0x1f4,_0x9b2dca[_0x7459('0x10')]));});});}; \ No newline at end of file +var _0xdaf9=['UpdateVoiceAgentReport','VoiceAgentReport','update','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','then'];(function(_0x4d1965,_0x43152e){var _0xdcfade=function(_0x3d3b8a){while(--_0x3d3b8a){_0x4d1965['push'](_0x4d1965['shift']());}};_0xdcfade(++_0x43152e);}(_0xdaf9,0xeb));var _0x9daf=function(_0x432e0b,_0x24fa14){_0x432e0b=_0x432e0b-0x0;var _0x7541bd=_0xdaf9[_0x432e0b];return _0x7541bd;};'use strict';var _=require('lodash');var util=require(_0x9daf('0x0'));var moment=require(_0x9daf('0x1'));var BPromise=require(_0x9daf('0x2'));var rs=require(_0x9daf('0x3'));var fs=require('fs');var Redis=require(_0x9daf('0x4'));var db=require(_0x9daf('0x5'))['db'];var utils=require(_0x9daf('0x6'));var logger=require(_0x9daf('0x7'))(_0x9daf('0x8'));var config=require(_0x9daf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9daf('0xa')][_0x9daf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e4c82,_0x55f956,_0x430887){return new BPromise(function(_0xaf4b17,_0x16cc6f){return client[_0x9daf('0xc')](_0x3e4c82,_0x430887)['then'](function(_0x374029){logger[_0x9daf('0xd')](_0x9daf('0xe'),_0x55f956,_0x9daf('0xf'));logger[_0x9daf('0x10')](_0x9daf('0x11'),_0x55f956,_0x9daf('0xf'),JSON[_0x9daf('0x12')](_0x374029));if(_0x374029[_0x9daf('0x13')]){if(_0x374029[_0x9daf('0x13')]['code']===0x1f4){logger[_0x9daf('0x13')](_0x9daf('0xe'),_0x55f956,_0x374029['error'][_0x9daf('0x14')]);return _0x16cc6f(_0x374029[_0x9daf('0x13')][_0x9daf('0x14')]);}logger[_0x9daf('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x55f956,_0x374029[_0x9daf('0x13')]['message']);return _0xaf4b17(_0x374029[_0x9daf('0x13')][_0x9daf('0x14')]);}else{logger[_0x9daf('0xd')](_0x9daf('0xe'),_0x55f956,'request\x20sent');_0xaf4b17(_0x374029[_0x9daf('0x15')][_0x9daf('0x14')]);}})[_0x9daf('0x16')](function(_0xd1016a){logger['error'](_0x9daf('0xe'),_0x55f956,_0xd1016a);_0x16cc6f(_0xd1016a);});});}exports[_0x9daf('0x17')]=function(_0xb8d61d){var _0x300b7b=this;return new Promise(function(_0x19f832,_0x568147){return db['VoiceAgentReport'][_0x9daf('0x18')](_0xb8d61d[_0x9daf('0x19')],{'raw':_0xb8d61d[_0x9daf('0x1a')]?_0xb8d61d[_0x9daf('0x1a')][_0x9daf('0x1b')]===undefined?!![]:![]:!![]})[_0x9daf('0x1c')](function(_0xa7fdc0){logger[_0x9daf('0xd')](_0x9daf('0x17'),_0xb8d61d);logger[_0x9daf('0x10')]('CreateVoiceAgentReport',_0xb8d61d,JSON[_0x9daf('0x12')](_0xa7fdc0));_0x19f832(_0xa7fdc0);})[_0x9daf('0x16')](function(_0x5981cf){logger[_0x9daf('0x13')]('CreateVoiceAgentReport',_0x5981cf[_0x9daf('0x14')],_0xb8d61d);_0x568147(_0x300b7b[_0x9daf('0x13')](0x1f4,_0x5981cf[_0x9daf('0x14')]));});});};exports[_0x9daf('0x1d')]=function(_0x4210bf){var _0x3f4e26=this;return new Promise(function(_0x5ab4f9,_0x5b0480){return db[_0x9daf('0x1e')][_0x9daf('0x1f')](_0x4210bf[_0x9daf('0x19')],{'raw':_0x4210bf[_0x9daf('0x1a')]?_0x4210bf[_0x9daf('0x1a')][_0x9daf('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4210bf[_0x9daf('0x1a')]?_0x4210bf[_0x9daf('0x1a')][_0x9daf('0x20')]||null:null,'attributes':_0x4210bf[_0x9daf('0x1a')]?_0x4210bf[_0x9daf('0x1a')]['attributes']||null:null,'limit':_0x4210bf[_0x9daf('0x1a')]?_0x4210bf[_0x9daf('0x1a')]['limit']||null:null})[_0x9daf('0x1c')](function(_0x25ba83){logger[_0x9daf('0xd')]('UpdateVoiceAgentReport',_0x4210bf);logger['debug'](_0x9daf('0x1d'),_0x4210bf,JSON[_0x9daf('0x12')](_0x25ba83));_0x5ab4f9(_0x25ba83);})[_0x9daf('0x16')](function(_0x4c3ce3){logger[_0x9daf('0x13')]('UpdateVoiceAgentReport',_0x4c3ce3['message'],_0x4210bf);_0x5b0480(_0x3f4e26[_0x9daf('0x13')](0x1f4,_0x4c3ce3[_0x9daf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9f10aed..8d412ae 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 _0xf006=['post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x41cc3f,_0x2678a2){var _0x47ff58=function(_0x190d53){while(--_0x190d53){_0x41cc3f['push'](_0x41cc3f['shift']());}};_0x47ff58(++_0x2678a2);}(_0xf006,0x146));var _0x6f00=function(_0x4edd08,_0x5ec9d0){_0x4edd08=_0x4edd08-0x0;var _0x4a11e7=_0xf006[_0x4edd08];return _0x4a11e7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0xa')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0xc')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xd')]);router['delete'](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);module[_0x6f00('0xf')]=router; \ No newline at end of file +var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x16f2df,_0x23470a){var _0x5975f1=function(_0x741aff){while(--_0x741aff){_0x16f2df['push'](_0x16f2df['shift']());}};_0x5975f1(++_0x23470a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x9f8db1,_0x386fb2){_0x9f8db1=_0x9f8db1-0x0;var _0x4694c1=_0xdc97[_0x9f8db1];return _0x4694c1;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['post']('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 36519b3..2d63fe6 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 _0x48a2=['exports','inbound','inbound-fax','outbound-fax','dialer','STRING','DATE','INTEGER','sequelize'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x48a2,0xe0));var _0x248a=function(_0x57ee02,_0x58b0c4){_0x57ee02=_0x57ee02-0x0;var _0x2fc9b0=_0x48a2[_0x57ee02];return _0x2fc9b0;};'use strict';var Sequelize=require(_0x248a('0x0'));module[_0x248a('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x248a('0x2'),'internal','outbound',_0x248a('0x3'),_0x248a('0x4'),_0x248a('0x5'))},'tag':{'type':Sequelize[_0x248a('0x6')]},'accountcode':{'type':Sequelize[_0x248a('0x6')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x248a('0x6')]},'destinationcontext':{'type':Sequelize[_0x248a('0x6')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x248a('0x6')]},'destinationchannel':{'type':Sequelize[_0x248a('0x6')]},'lastapplication':{'type':Sequelize[_0x248a('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x248a('0x7')]},'systemanswertime':{'type':Sequelize[_0x248a('0x7')]},'answertime':{'type':Sequelize[_0x248a('0x7')]},'endtime':{'type':Sequelize[_0x248a('0x7')]},'duration':{'type':Sequelize[_0x248a('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x248a('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x248a('0x6')]},'userfield':{'type':Sequelize[_0x248a('0x6')]},'userDisposition':{'type':Sequelize[_0x248a('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x248a('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x248a('0x6')]},'note':{'type':Sequelize[_0x248a('0x6')]},'prefix':{'type':Sequelize[_0x248a('0x6')]},'routeid':{'type':Sequelize[_0x248a('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xeddd=['STRING','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x1b7953,_0x33b8d0){var _0xe7d0f1=function(_0x2355fe){while(--_0x2355fe){_0x1b7953['push'](_0x1b7953['shift']());}};_0xe7d0f1(++_0x33b8d0);}(_0xeddd,0x153));var _0xdedd=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xeddd[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'uniqueid':{'type':Sequelize[_0xdedd('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0xdedd('0x3'),_0xdedd('0x4'),_0xdedd('0x5'),_0xdedd('0x6'),_0xdedd('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xdedd('0x2')]},'destination':{'type':Sequelize[_0xdedd('0x2')]},'destinationcontext':{'type':Sequelize[_0xdedd('0x2')]},'callerid':{'type':Sequelize[_0xdedd('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xdedd('0x2')]},'lastapplication':{'type':Sequelize[_0xdedd('0x2')]},'lastdata':{'type':Sequelize[_0xdedd('0x8')]},'starttime':{'type':Sequelize[_0xdedd('0x9')]},'systemanswertime':{'type':Sequelize[_0xdedd('0x9')]},'answertime':{'type':Sequelize[_0xdedd('0x9')]},'endtime':{'type':Sequelize[_0xdedd('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xdedd('0xa')]},'mohtime':{'type':Sequelize[_0xdedd('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdedd('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xdedd('0x2')]},'userDisposition':{'type':Sequelize[_0xdedd('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xdedd('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xdedd('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xdedd('0xa')]},'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 ddf0c6c..54dc021 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x33a1e9,_0x5091f8){_0x33a1e9=_0x33a1e9-0x0;var _0x48b20a=_0x2032[_0x33a1e9];return _0x48b20a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index eea5895..3e5447a 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 _0xd577=['exports','define','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0xd577,0x1ef));var _0x7d57=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xd577[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0x7d57('0x0'));var util=require(_0x7d57('0x1'));var logger=require(_0x7d57('0x2'))(_0x7d57('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d57('0x4'));var fs=require('fs');var path=require(_0x7d57('0x5'));var rimraf=require(_0x7d57('0x6'));var config=require(_0x7d57('0x7'));var attributes=require(_0x7d57('0x8'));module[_0x7d57('0x9')]=function(_0x515191,_0x3b99ee){return _0x515191[_0x7d57('0xa')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x7d57('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6192=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x56c570,_0x2d9da5){var _0x46c5a0=function(_0x520587){while(--_0x520587){_0x56c570['push'](_0x56c570['shift']());}};_0x46c5a0(++_0x2d9da5);}(_0x6192,0x1a2));var _0x2619=function(_0x49a5b9,_0x381eef){_0x49a5b9=_0x49a5b9-0x0;var _0x50b870=_0x6192[_0x49a5b9];return _0x50b870;};'use strict';var _=require(_0x2619('0x0'));var util=require(_0x2619('0x1'));var logger=require(_0x2619('0x2'))(_0x2619('0x3'));var moment=require('moment');var BPromise=require(_0x2619('0x4'));var rp=require(_0x2619('0x5'));var fs=require('fs');var path=require(_0x2619('0x6'));var rimraf=require(_0x2619('0x7'));var config=require(_0x2619('0x8'));var attributes=require(_0x2619('0x9'));module[_0x2619('0xa')]=function(_0x36afc5,_0x5e4c09){return _0x36afc5['define'](_0x2619('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x2619('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f55ebfa..e08b660 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 _0x354d=['error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','limit','include','model','attributes','map','debug','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','code'];(function(_0x424ae4,_0x981d2f){var _0x5e666c=function(_0x22415b){while(--_0x22415b){_0x424ae4['push'](_0x424ae4['shift']());}};_0x5e666c(++_0x981d2f);}(_0x354d,0x81));var _0xd354=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x354d[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xd354('0x0'));var moment=require(_0xd354('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd354('0x2'));var db=require(_0xd354('0x3'))['db'];var utils=require(_0xd354('0x4'));var logger=require(_0xd354('0x5'))(_0xd354('0x6'));var config=require(_0xd354('0x7'));var jayson=require(_0xd354('0x8'));var client=jayson[_0xd354('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2090,_0x59556a,_0x36937c){return new BPromise(function(_0x401f45,_0x50a447){return client['request'](_0x5b2090,_0x36937c)[_0xd354('0xa')](function(_0x5759d1){logger[_0xd354('0xb')](_0xd354('0xc'),_0x59556a,_0xd354('0xd'));logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x59556a,'request\x20sent',JSON['stringify'](_0x5759d1));if(_0x5759d1['error']){if(_0x5759d1['error'][_0xd354('0xe')]===0x1f4){logger[_0xd354('0xf')](_0xd354('0xc'),_0x59556a,_0x5759d1['error']['message']);return _0x50a447(_0x5759d1['error']['message']);}logger['error'](_0xd354('0xc'),_0x59556a,_0x5759d1[_0xd354('0xf')][_0xd354('0x10')]);return _0x401f45(_0x5759d1[_0xd354('0xf')][_0xd354('0x10')]);}else{logger[_0xd354('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x59556a,'request\x20sent');_0x401f45(_0x5759d1['result']['message']);}})[_0xd354('0x11')](function(_0xb529d6){logger[_0xd354('0xf')](_0xd354('0xc'),_0x59556a,_0xb529d6);_0x50a447(_0xb529d6);});});}exports[_0xd354('0x12')]=function(_0x695675){var _0x30db6b=this;return new Promise(function(_0x2e8aa8,_0x1a94f7){return db[_0xd354('0x13')][_0xd354('0x14')]({'raw':_0x695675['options']?_0x695675['options'][_0xd354('0x15')]===undefined?!![]:![]:!![],'where':_0x695675[_0xd354('0x16')]?_0x695675[_0xd354('0x16')]['where']||null:null,'attributes':_0x695675['options']?_0x695675['options']['attributes']||null:null,'limit':_0x695675[_0xd354('0x16')]?_0x695675[_0xd354('0x16')][_0xd354('0x17')]||null:null,'include':_0x695675['options']?_0x695675['options'][_0xd354('0x18')]?_['map'](_0x695675[_0xd354('0x16')]['include'],function(_0x4777d9){return{'model':db[_0x4777d9[_0xd354('0x19')]],'as':_0x4777d9['as'],'attributes':_0x4777d9[_0xd354('0x1a')],'include':_0x4777d9[_0xd354('0x18')]?_[_0xd354('0x1b')](_0x4777d9[_0xd354('0x18')],function(_0x3ab422){return{'model':db[_0x3ab422[_0xd354('0x19')]],'as':_0x3ab422['as'],'attributes':_0x3ab422[_0xd354('0x1a')],'include':_0x3ab422['include']?_[_0xd354('0x1b')](_0x3ab422[_0xd354('0x18')],function(_0x5a07ad){return{'model':db[_0x5a07ad[_0xd354('0x19')]],'as':_0x5a07ad['as'],'attributes':_0x5a07ad['attributes']};}):[]};}):[]};}):[]:[]})[_0xd354('0xa')](function(_0x55f61f){logger[_0xd354('0xb')](_0xd354('0x12'),_0x695675);logger[_0xd354('0x1c')](_0xd354('0x12'),_0x695675,JSON[_0xd354('0x1d')](_0x55f61f));_0x2e8aa8(_0x55f61f);})[_0xd354('0x11')](function(_0x4309eb){logger['error'](_0xd354('0x12'),_0x4309eb['message'],_0x695675);_0x1a94f7(_0x30db6b[_0xd354('0xf')](0x1f4,_0x4309eb[_0xd354('0x10')]));});});};exports[_0xd354('0x1e')]=function(_0xc8076b){var _0xd5bc6f=this;return new Promise(function(_0x24abff,_0x37b5e9){return db[_0xd354('0x13')][_0xd354('0x1f')](_0xc8076b[_0xd354('0x20')],{'raw':_0xc8076b['options']?_0xc8076b[_0xd354('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd354('0xa')](function(_0x1437f0){logger[_0xd354('0xb')](_0xd354('0x1e'),_0xc8076b);logger['debug'](_0xd354('0x1e'),_0xc8076b,JSON['stringify'](_0x1437f0));_0x24abff(_0x1437f0);})['catch'](function(_0x1c482c){logger[_0xd354('0xf')](_0xd354('0x1e'),_0x1c482c[_0xd354('0x10')],_0xc8076b);_0x37b5e9(_0xd5bc6f[_0xd354('0xf')](0x1f4,_0x1c482c[_0xd354('0x10')]));});});};exports[_0xd354('0x21')]=function(_0x4ebc78){var _0x2eef86=this;return new Promise(function(_0x10592f,_0x340960){return db[_0xd354('0x13')][_0xd354('0x22')](_0x4ebc78[_0xd354('0x20')],{'raw':_0x4ebc78['options']?_0x4ebc78[_0xd354('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ebc78[_0xd354('0x16')]?_0x4ebc78[_0xd354('0x16')][_0xd354('0x23')]||null:null,'attributes':_0x4ebc78[_0xd354('0x16')]?_0x4ebc78[_0xd354('0x16')][_0xd354('0x1a')]||null:null,'limit':_0x4ebc78[_0xd354('0x16')]?_0x4ebc78[_0xd354('0x16')][_0xd354('0x17')]||null:null})[_0xd354('0xa')](function(_0x5b6479){logger[_0xd354('0xb')]('UpdateVoiceCallReport',_0x4ebc78);logger['debug'](_0xd354('0x21'),_0x4ebc78,JSON[_0xd354('0x1d')](_0x5b6479));_0x10592f(_0x5b6479);})[_0xd354('0x11')](function(_0x141fa4){logger[_0xd354('0xf')](_0xd354('0x21'),_0x141fa4[_0xd354('0x10')],_0x4ebc78);_0x340960(_0x2eef86[_0xd354('0xf')](0x1f4,_0x141fa4['message']));});});}; \ No newline at end of file +var _0x33c8=['stringify','error','code','message','info','VoiceCallReport,\x20%s,\x20%s','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','model','attributes','include','map','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x258dd3,_0x303aa2){var _0x2f1f49=function(_0x5c70f6){while(--_0x5c70f6){_0x258dd3['push'](_0x258dd3['shift']());}};_0x2f1f49(++_0x303aa2);}(_0x33c8,0xb7));var _0x833c=function(_0x3ff222,_0x224155){_0x3ff222=_0x3ff222-0x0;var _0x5d1cb0=_0x33c8[_0x3ff222];return _0x5d1cb0;};'use strict';var _=require(_0x833c('0x0'));var util=require(_0x833c('0x1'));var moment=require(_0x833c('0x2'));var BPromise=require('bluebird');var rs=require(_0x833c('0x3'));var fs=require('fs');var Redis=require(_0x833c('0x4'));var db=require(_0x833c('0x5'))['db'];var utils=require(_0x833c('0x6'));var logger=require(_0x833c('0x7'))(_0x833c('0x8'));var config=require('../../config/environment');var jayson=require(_0x833c('0x9'));var client=jayson[_0x833c('0xa')][_0x833c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2662d6,_0x5bbfbb,_0x1f46eb){return new BPromise(function(_0x2f7745,_0x4358ec){return client[_0x833c('0xc')](_0x2662d6,_0x1f46eb)[_0x833c('0xd')](function(_0x466809){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5bbfbb,_0x833c('0xe'));logger[_0x833c('0xf')](_0x833c('0x10'),_0x5bbfbb,_0x833c('0xe'),JSON[_0x833c('0x11')](_0x466809));if(_0x466809[_0x833c('0x12')]){if(_0x466809[_0x833c('0x12')][_0x833c('0x13')]===0x1f4){logger[_0x833c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5bbfbb,_0x466809[_0x833c('0x12')][_0x833c('0x14')]);return _0x4358ec(_0x466809['error'][_0x833c('0x14')]);}logger[_0x833c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x5bbfbb,_0x466809['error'][_0x833c('0x14')]);return _0x2f7745(_0x466809[_0x833c('0x12')][_0x833c('0x14')]);}else{logger[_0x833c('0x15')](_0x833c('0x16'),_0x5bbfbb,_0x833c('0xe'));_0x2f7745(_0x466809['result']['message']);}})[_0x833c('0x17')](function(_0x56e45f){logger[_0x833c('0x12')](_0x833c('0x16'),_0x5bbfbb,_0x56e45f);_0x4358ec(_0x56e45f);});});}exports[_0x833c('0x18')]=function(_0x361c61){var _0x301ceb=this;return new Promise(function(_0x203019,_0x229f75){return db[_0x833c('0x19')][_0x833c('0x1a')]({'raw':_0x361c61[_0x833c('0x1b')]?_0x361c61[_0x833c('0x1b')][_0x833c('0x1c')]===undefined?!![]:![]:!![],'where':_0x361c61[_0x833c('0x1b')]?_0x361c61[_0x833c('0x1b')][_0x833c('0x1d')]||null:null,'attributes':_0x361c61[_0x833c('0x1b')]?_0x361c61['options']['attributes']||null:null,'limit':_0x361c61[_0x833c('0x1b')]?_0x361c61[_0x833c('0x1b')][_0x833c('0x1e')]||null:null,'include':_0x361c61[_0x833c('0x1b')]?_0x361c61[_0x833c('0x1b')]['include']?_['map'](_0x361c61['options']['include'],function(_0x125b97){return{'model':db[_0x125b97[_0x833c('0x1f')]],'as':_0x125b97['as'],'attributes':_0x125b97[_0x833c('0x20')],'include':_0x125b97[_0x833c('0x21')]?_[_0x833c('0x22')](_0x125b97[_0x833c('0x21')],function(_0x45920f){return{'model':db[_0x45920f[_0x833c('0x1f')]],'as':_0x45920f['as'],'attributes':_0x45920f[_0x833c('0x20')],'include':_0x45920f[_0x833c('0x21')]?_['map'](_0x45920f[_0x833c('0x21')],function(_0x2e2715){return{'model':db[_0x2e2715['model']],'as':_0x2e2715['as'],'attributes':_0x2e2715['attributes']};}):[]};}):[]};}):[]:[]})[_0x833c('0xd')](function(_0x121576){logger['info']('GetVoiceCallReport',_0x361c61);logger[_0x833c('0xf')](_0x833c('0x18'),_0x361c61,JSON[_0x833c('0x11')](_0x121576));_0x203019(_0x121576);})[_0x833c('0x17')](function(_0x349c87){logger['error'](_0x833c('0x18'),_0x349c87[_0x833c('0x14')],_0x361c61);_0x229f75(_0x301ceb[_0x833c('0x12')](0x1f4,_0x349c87[_0x833c('0x14')]));});});};exports[_0x833c('0x23')]=function(_0x272b17){var _0x3258be=this;return new Promise(function(_0xea05c8,_0x1a576a){return db[_0x833c('0x19')][_0x833c('0x24')](_0x272b17[_0x833c('0x25')],{'raw':_0x272b17[_0x833c('0x1b')]?_0x272b17[_0x833c('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x36684a){logger['info'](_0x833c('0x23'),_0x272b17);logger[_0x833c('0xf')]('CreateVoiceCallReport',_0x272b17,JSON[_0x833c('0x11')](_0x36684a));_0xea05c8(_0x36684a);})['catch'](function(_0x4a19b2){logger['error']('CreateVoiceCallReport',_0x4a19b2[_0x833c('0x14')],_0x272b17);_0x1a576a(_0x3258be[_0x833c('0x12')](0x1f4,_0x4a19b2[_0x833c('0x14')]));});});};exports[_0x833c('0x26')]=function(_0x2e701a){var _0x573867=this;return new Promise(function(_0xc3192,_0x20eecc){return db['VoiceCallReport'][_0x833c('0x27')](_0x2e701a['body'],{'raw':_0x2e701a[_0x833c('0x1b')]?_0x2e701a[_0x833c('0x1b')][_0x833c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e701a[_0x833c('0x1b')]?_0x2e701a['options'][_0x833c('0x1d')]||null:null,'attributes':_0x2e701a[_0x833c('0x1b')]?_0x2e701a[_0x833c('0x1b')]['attributes']||null:null,'limit':_0x2e701a[_0x833c('0x1b')]?_0x2e701a['options']['limit']||null:null})[_0x833c('0xd')](function(_0x138988){logger[_0x833c('0x15')](_0x833c('0x26'),_0x2e701a);logger[_0x833c('0xf')]('UpdateVoiceCallReport',_0x2e701a,JSON[_0x833c('0x11')](_0x138988));_0xc3192(_0x138988);})[_0x833c('0x17')](function(_0x4c78cd){logger[_0x833c('0x12')](_0x833c('0x26'),_0x4c78cd[_0x833c('0x14')],_0x2e701a);_0x20eecc(_0x573867[_0x833c('0x12')](0x1f4,_0x4c78cd[_0x833c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 00a7993..f6eac14 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 _0x8565=['/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x302b4e,_0x24ce84){var _0x1c0a09=function(_0x144803){while(--_0x144803){_0x302b4e['push'](_0x302b4e['shift']());}};_0x1c0a09(++_0x24ce84);}(_0x8565,0x1d5));var _0x5856=function(_0x43d6c3,_0x10a3a7){_0x43d6c3=_0x43d6c3-0x0;var _0x1681f5=_0x8565[_0x43d6c3];return _0x1681f5;};'use strict';var multer=require(_0x5856('0x0'));var util=require(_0x5856('0x1'));var path=require(_0x5856('0x2'));var timeout=require(_0x5856('0x3'));var express=require(_0x5856('0x4'));var router=express[_0x5856('0x5')]();var fs_extra=require(_0x5856('0x6'));var auth=require(_0x5856('0x7'));var interaction=require(_0x5856('0x8'));var config=require(_0x5856('0x9'));var controller=require(_0x5856('0xa'));router['get']('/',auth[_0x5856('0xb')](),controller[_0x5856('0xc')]);router[_0x5856('0xd')](_0x5856('0xe'),auth[_0x5856('0xb')](),controller['show']);router[_0x5856('0xf')]('/',auth[_0x5856('0xb')](),controller[_0x5856('0x10')]);router[_0x5856('0x11')](_0x5856('0xe'),auth[_0x5856('0xb')](),controller[_0x5856('0x12')]);router[_0x5856('0x13')](_0x5856('0xe'),auth[_0x5856('0xb')](),controller[_0x5856('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4321=['util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','put','update','destroy'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x4321,0x18c));var _0x1432=function(_0x47a7a8,_0x36d5b9){_0x47a7a8=_0x47a7a8-0x0;var _0x22a0bf=_0x4321[_0x47a7a8];return _0x22a0bf;};'use strict';var multer=require('multer');var util=require(_0x1432('0x0'));var path=require('path');var timeout=require(_0x1432('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1432('0x2'));var auth=require(_0x1432('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1432('0x4'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x1432('0x5')](),controller[_0x1432('0x6')]);router['get'](_0x1432('0x7'),auth[_0x1432('0x5')](),controller['show']);router['post']('/',auth[_0x1432('0x5')](),controller['create']);router[_0x1432('0x8')](_0x1432('0x7'),auth[_0x1432('0x5')](),controller[_0x1432('0x9')]);router['delete'](_0x1432('0x7'),auth[_0x1432('0x5')](),controller[_0x1432('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8a48658..a50cce4 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 _0x4867=['sequelize','exports','STRING','setDataValue','getDataValue','options','split','BOOLEAN'];(function(_0x4e07c6,_0x5d8c10){var _0x37023e=function(_0x339588){while(--_0x339588){_0x4e07c6['push'](_0x4e07c6['shift']());}};_0x37023e(++_0x5d8c10);}(_0x4867,0x160));var _0x7486=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x4867[_0x59d546];return _0x41fbdb;};'use strict';var Sequelize=require(_0x7486('0x0'));module[_0x7486('0x1')]={'name':{'type':Sequelize[_0x7486('0x2')]},'prefix':{'type':Sequelize[_0x7486('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x1047ae){this[_0x7486('0x3')]('options',_0x1047ae?_0x1047ae['join'](''):[]);},'get':function(){return this[_0x7486('0x4')](_0x7486('0x5'))?this[_0x7486('0x4')](_0x7486('0x5'))[_0x7486('0x6')](''):[];}},'auth':{'type':Sequelize[_0x7486('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x7486('0x2')]},'record':{'type':Sequelize[_0x7486('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7486('0x2')]},'description':{'type':Sequelize[_0x7486('0x2')]}}; \ No newline at end of file +var _0x8f25=['STRING','name','setDataValue','options','getDataValue','split','BOOLEAN','exports'];(function(_0x1cdb4e,_0x383e0d){var _0x40521f=function(_0x262dcd){while(--_0x262dcd){_0x1cdb4e['push'](_0x1cdb4e['shift']());}};_0x40521f(++_0x383e0d);}(_0x8f25,0x187));var _0x58f2=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x8f25[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0x58f2('0x0')]={'name':{'type':Sequelize[_0x58f2('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x58f2('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x58f2('0x1')],'set':function(_0x3eb985){this[_0x58f2('0x3')](_0x58f2('0x4'),_0x3eb985?_0x3eb985['join'](''):[]);},'get':function(){return this[_0x58f2('0x5')]('options')?this[_0x58f2('0x5')](_0x58f2('0x4'))[_0x58f2('0x6')](''):[];}},'auth':{'type':Sequelize[_0x58f2('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x58f2('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x58f2('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9ebf9fc..8c83ffa 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 _0x1094=['autoAssociation','UserProfileResource','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','destroy','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection'];(function(_0xd24366,_0x38e6bf){var _0x2d3ee3=function(_0x22fb6b){while(--_0x22fb6b){_0xd24366['push'](_0xd24366['shift']());}};_0x2d3ee3(++_0x38e6bf);}(_0x1094,0x143));var _0x4109=function(_0x33b259,_0x2036be){_0x33b259=_0x33b259-0x0;var _0xf95548=_0x1094[_0x33b259];return _0xf95548;};'use strict';var emlformat=require(_0x4109('0x0'));var rimraf=require(_0x4109('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4109('0x2'));var rp=require('request-promise');var moment=require(_0x4109('0x3'));var BPromise=require(_0x4109('0x4'));var Mustache=require(_0x4109('0x5'));var util=require(_0x4109('0x6'));var path=require(_0x4109('0x7'));var sox=require('sox');var csv=require(_0x4109('0x8'));var ejs=require(_0x4109('0x9'));var fs=require('fs');var fs_extra=require(_0x4109('0xa'));var _=require(_0x4109('0xb'));var squel=require(_0x4109('0xc'));var crypto=require(_0x4109('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4109('0xe'));var toCsv=require(_0x4109('0x8'));var querystring=require(_0x4109('0xf'));var Papa=require(_0x4109('0x10'));var Redis=require(_0x4109('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4109('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4109('0x13'))(_0x4109('0x14'));var utils=require(_0x4109('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4109('0x16'));var db=require(_0x4109('0x17'))['db'];function respondWithStatusCode(_0xfa09ea,_0x41e682){_0x41e682=_0x41e682||0xcc;return function(_0x2c2c9d){if(_0x2c2c9d){return _0xfa09ea['sendStatus'](_0x41e682);}return _0xfa09ea[_0x4109('0x18')](_0x41e682)[_0x4109('0x19')]();};}function respondWithResult(_0x3c8a84,_0x3c893a){_0x3c893a=_0x3c893a||0xc8;return function(_0x4a13fc){if(_0x4a13fc){return _0x3c8a84['status'](_0x3c893a)[_0x4109('0x1a')](_0x4a13fc);}};}function respondWithFilteredResult(_0x397937,_0x2e8e63){return function(_0x37b444){if(_0x37b444){var _0x1d81d8=typeof _0x2e8e63[_0x4109('0x1b')]===_0x4109('0x1c')&&typeof _0x2e8e63[_0x4109('0x1d')]==='undefined';var _0x4c4cf3=_0x37b444[_0x4109('0x1e')];var _0x328f1c=_0x1d81d8?0x0:_0x2e8e63[_0x4109('0x1b')];var _0x2e3fd6=_0x1d81d8?_0x37b444[_0x4109('0x1e')]:_0x2e8e63[_0x4109('0x1b')]+_0x2e8e63[_0x4109('0x1d')];var _0x6e8d56;if(_0x2e3fd6>=_0x4c4cf3){_0x2e3fd6=_0x4c4cf3;_0x6e8d56=0xc8;}else{_0x6e8d56=0xce;}_0x397937[_0x4109('0x18')](_0x6e8d56);return _0x397937['set'](_0x4109('0x1f'),_0x328f1c+'-'+_0x2e3fd6+'/'+_0x4c4cf3)[_0x4109('0x1a')](_0x37b444);}return null;};}function patchUpdates(_0x5cde5d){return function(_0x295f97){try{jsonpatch[_0x4109('0x20')](_0x295f97,_0x5cde5d,!![]);}catch(_0x4ba222){return BPromise['reject'](_0x4ba222);}return _0x295f97[_0x4109('0x21')]();};}function saveUpdates(_0x4e8723,_0x369de0){return function(_0x45d848){if(_0x45d848){return _0x45d848[_0x4109('0x22')](_0x4e8723)[_0x4109('0x23')](function(_0x5ddef4){return _0x5ddef4;});}return null;};}function removeEntity(_0x406d35,_0x438f4f){return function(_0x339cec){if(_0x339cec){return _0x339cec['destroy']()[_0x4109('0x23')](function(){var _0x3141c7=_0x339cec[_0x4109('0x24')]({'plain':!![]});var _0x57768e='ChanSpies';return db['UserProfileResource'][_0x4109('0x25')]({'where':{'type':_0x57768e,'resourceId':_0x3141c7['id']}})[_0x4109('0x23')](function(){return _0x339cec;});})[_0x4109('0x23')](function(){_0x406d35[_0x4109('0x18')](0xcc)[_0x4109('0x19')]();});}};}function handleEntityNotFound(_0x5bbf62,_0x2910cd){return function(_0x357ce6){if(!_0x357ce6){_0x5bbf62['sendStatus'](0x194);}return _0x357ce6;};}function handleError(_0x12b73b,_0x52cb0c){_0x52cb0c=_0x52cb0c||0x1f4;return function(_0x1d3eaa){logger[_0x4109('0x26')](_0x1d3eaa[_0x4109('0x27')]);if(_0x1d3eaa[_0x4109('0x28')]){delete _0x1d3eaa[_0x4109('0x28')];}_0x12b73b['status'](_0x52cb0c)[_0x4109('0x29')](_0x1d3eaa);};}exports['index']=function(_0x1f48fa,_0x2a26bb){var _0xf662af={},_0x319b67={},_0x358a20={'count':0x0,'rows':[]};var _0x12b958=_[_0x4109('0x2a')](db[_0x4109('0x2b')][_0x4109('0x2c')],function(_0x282727){return{'name':_0x282727[_0x4109('0x2d')],'type':_0x282727[_0x4109('0x2e')][_0x4109('0x2f')]};});_0x319b67[_0x4109('0x30')]=_[_0x4109('0x2a')](_0x12b958,_0x4109('0x28'));_0x319b67['query']=_[_0x4109('0x31')](_0x1f48fa[_0x4109('0x32')]);_0x319b67[_0x4109('0x33')]=_[_0x4109('0x34')](_0x319b67[_0x4109('0x30')],_0x319b67[_0x4109('0x32')]);_0xf662af['attributes']=_['intersection'](_0x319b67[_0x4109('0x30')],qs[_0x4109('0x35')](_0x1f48fa[_0x4109('0x32')][_0x4109('0x35')]));_0xf662af['attributes']=_0xf662af[_0x4109('0x36')][_0x4109('0x37')]?_0xf662af[_0x4109('0x36')]:_0x319b67[_0x4109('0x30')];if(!_0x1f48fa[_0x4109('0x32')][_0x4109('0x38')]('nolimit')){_0xf662af[_0x4109('0x1d')]=qs['limit'](_0x1f48fa[_0x4109('0x32')][_0x4109('0x1d')]);_0xf662af['offset']=qs[_0x4109('0x1b')](_0x1f48fa[_0x4109('0x32')]['offset']);}_0xf662af['order']=qs[_0x4109('0x39')](_0x1f48fa['query'][_0x4109('0x39')]);_0xf662af['where']=qs[_0x4109('0x33')](_[_0x4109('0x3a')](_0x1f48fa[_0x4109('0x32')],_0x319b67[_0x4109('0x33')]),_0x12b958);if(_0x1f48fa['query']['filter']){_0xf662af['where']=_[_0x4109('0x3b')](_0xf662af[_0x4109('0x3c')],{'$or':_[_0x4109('0x2a')](_0x12b958,function(_0x3062e5){if(_0x3062e5[_0x4109('0x2e')]!==_0x4109('0x3d')){var _0x269c7a={};_0x269c7a[_0x3062e5[_0x4109('0x28')]]={'$like':'%'+_0x1f48fa[_0x4109('0x32')][_0x4109('0x3e')]+'%'};return _0x269c7a;}})});}_0xf662af=_[_0x4109('0x3b')]({},_0xf662af,_0x1f48fa[_0x4109('0x3f')]);var _0xbd914e={'where':_0xf662af[_0x4109('0x3c')]};return db[_0x4109('0x2b')][_0x4109('0x1e')](_0xbd914e)[_0x4109('0x23')](function(_0x114685){_0x358a20[_0x4109('0x1e')]=_0x114685;if(_0x1f48fa['query'][_0x4109('0x40')]){_0xf662af[_0x4109('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0xf662af);})['then'](function(_0x17e854){_0x358a20[_0x4109('0x42')]=_0x17e854;return _0x358a20;})[_0x4109('0x23')](respondWithFilteredResult(_0x2a26bb,_0xf662af))[_0x4109('0x43')](handleError(_0x2a26bb,null));};exports[_0x4109('0x44')]=function(_0x3db53e,_0x88be51){var _0x590c8a={'raw':![],'where':{'id':_0x3db53e['params']['id']}},_0x56b0e5={};_0x56b0e5[_0x4109('0x30')]=_['keys'](db[_0x4109('0x2b')]['rawAttributes']);_0x56b0e5[_0x4109('0x32')]=_[_0x4109('0x31')](_0x3db53e[_0x4109('0x32')]);_0x56b0e5[_0x4109('0x33')]=_[_0x4109('0x34')](_0x56b0e5[_0x4109('0x30')],_0x56b0e5[_0x4109('0x32')]);_0x590c8a['attributes']=_[_0x4109('0x34')](_0x56b0e5[_0x4109('0x30')],qs[_0x4109('0x35')](_0x3db53e[_0x4109('0x32')][_0x4109('0x35')]));_0x590c8a['attributes']=_0x590c8a['attributes'][_0x4109('0x37')]?_0x590c8a['attributes']:_0x56b0e5['model'];if(_0x3db53e[_0x4109('0x32')][_0x4109('0x40')]){_0x590c8a[_0x4109('0x41')]=[{'all':!![]}];}_0x590c8a=_[_0x4109('0x3b')]({},_0x590c8a,_0x3db53e['options']);return db['VoiceChanSpy'][_0x4109('0x45')](_0x590c8a)['then'](handleEntityNotFound(_0x88be51,null))[_0x4109('0x23')](respondWithResult(_0x88be51,null))['catch'](handleError(_0x88be51,null));};exports[_0x4109('0x46')]=function(_0x2ec0b3,_0x3cb3b2){return db[_0x4109('0x2b')][_0x4109('0x46')](_0x2ec0b3[_0x4109('0x47')],{})['then'](function(_0x1abb3b){var _0x4138db=_0x2ec0b3['user']['get']({'plain':!![]});if(!_0x4138db)throw new Error(_0x4109('0x48'));if(_0x4138db[_0x4109('0x49')]===_0x4109('0x4a')){var _0x55772d=_0x1abb3b['get']({'plain':!![]});var _0x57e01e=_0x4109('0x4b');return db[_0x4109('0x4c')][_0x4109('0x45')]({'where':{'name':_0x57e01e,'userProfileId':_0x4138db['userProfileId']},'raw':!![]})[_0x4109('0x23')](function(_0x53753f){if(_0x53753f&&_0x53753f[_0x4109('0x4d')]===0x0){return db[_0x4109('0x4e')]['create']({'name':_0x55772d[_0x4109('0x28')],'resourceId':_0x55772d['id'],'type':_0x53753f[_0x4109('0x28')],'sectionId':_0x53753f['id']},{})['then'](function(){return _0x1abb3b;});}else{return _0x1abb3b;}})[_0x4109('0x43')](function(_0x3b6dbd){logger[_0x4109('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b6dbd);throw _0x3b6dbd;});}return _0x1abb3b;})['then'](respondWithResult(_0x3cb3b2,0xc9))['catch'](handleError(_0x3cb3b2,null));};exports[_0x4109('0x22')]=function(_0x45b5a2,_0x1748f8){if(_0x45b5a2[_0x4109('0x47')]['id']){delete _0x45b5a2[_0x4109('0x47')]['id'];}return db[_0x4109('0x2b')][_0x4109('0x45')]({'where':{'id':_0x45b5a2['params']['id']}})[_0x4109('0x23')](handleEntityNotFound(_0x1748f8,null))[_0x4109('0x23')](saveUpdates(_0x45b5a2['body'],null))[_0x4109('0x23')](respondWithResult(_0x1748f8,null))[_0x4109('0x43')](handleError(_0x1748f8,null));};exports[_0x4109('0x25')]=function(_0x43954d,_0x911e03){return db[_0x4109('0x2b')][_0x4109('0x45')]({'where':{'id':_0x43954d[_0x4109('0x4f')]['id']}})[_0x4109('0x23')](handleEntityNotFound(_0x911e03,null))[_0x4109('0x23')](removeEntity(_0x911e03,null))[_0x4109('0x43')](handleError(_0x911e03,null));}; \ No newline at end of file +var _0x8b2b=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','sendStatus','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x4df4f8,_0x176d52){var _0x2c7180=function(_0x3ea3cd){while(--_0x3ea3cd){_0x4df4f8['push'](_0x4df4f8['shift']());}};_0x2c7180(++_0x176d52);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x32f570,_0x4dcf72){_0x32f570=_0x32f570-0x0;var _0x25f0bc=_0x8b2b[_0x32f570];return _0x25f0bc;};'use strict';var emlformat=require(_0xb8b2('0x0'));var rimraf=require(_0xb8b2('0x1'));var zipdir=require(_0xb8b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8b2('0x3'));var moment=require(_0xb8b2('0x4'));var BPromise=require(_0xb8b2('0x5'));var Mustache=require(_0xb8b2('0x6'));var util=require(_0xb8b2('0x7'));var path=require(_0xb8b2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8b2('0x9'));var fs=require('fs');var fs_extra=require(_0xb8b2('0xa'));var _=require(_0xb8b2('0xb'));var squel=require(_0xb8b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8b2('0xd'));var toCsv=require(_0xb8b2('0xe'));var querystring=require(_0xb8b2('0xf'));var Papa=require(_0xb8b2('0x10'));var Redis=require(_0xb8b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb8b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8b2('0x13'))(_0xb8b2('0x14'));var utils=require(_0xb8b2('0x15'));var config=require(_0xb8b2('0x16'));var licenseUtil=require(_0xb8b2('0x17'));var db=require(_0xb8b2('0x18'))['db'];function respondWithStatusCode(_0x584d41,_0x3440bf){_0x3440bf=_0x3440bf||0xcc;return function(_0x5bd724){if(_0x5bd724){return _0x584d41['sendStatus'](_0x3440bf);}return _0x584d41['status'](_0x3440bf)[_0xb8b2('0x19')]();};}function respondWithResult(_0xdc1d1d,_0x48b9df){_0x48b9df=_0x48b9df||0xc8;return function(_0x175885){if(_0x175885){return _0xdc1d1d[_0xb8b2('0x1a')](_0x48b9df)[_0xb8b2('0x1b')](_0x175885);}};}function respondWithFilteredResult(_0x142fb0,_0x46a592){return function(_0x5b614d){if(_0x5b614d){var _0x4b5a28=typeof _0x46a592[_0xb8b2('0x1c')]===_0xb8b2('0x1d')&&typeof _0x46a592[_0xb8b2('0x1e')]===_0xb8b2('0x1d');var _0xf04672=_0x5b614d['count'];var _0x47b94f=_0x4b5a28?0x0:_0x46a592[_0xb8b2('0x1c')];var _0x153b69=_0x4b5a28?_0x5b614d[_0xb8b2('0x1f')]:_0x46a592[_0xb8b2('0x1c')]+_0x46a592['limit'];var _0x23af66;if(_0x153b69>=_0xf04672){_0x153b69=_0xf04672;_0x23af66=0xc8;}else{_0x23af66=0xce;}_0x142fb0[_0xb8b2('0x1a')](_0x23af66);return _0x142fb0[_0xb8b2('0x20')](_0xb8b2('0x21'),_0x47b94f+'-'+_0x153b69+'/'+_0xf04672)[_0xb8b2('0x1b')](_0x5b614d);}return null;};}function patchUpdates(_0x1cbc65){return function(_0x34ca46){try{jsonpatch['apply'](_0x34ca46,_0x1cbc65,!![]);}catch(_0x382bbf){return BPromise[_0xb8b2('0x22')](_0x382bbf);}return _0x34ca46[_0xb8b2('0x23')]();};}function saveUpdates(_0x162d41,_0x316d3c){return function(_0x5a0a43){if(_0x5a0a43){return _0x5a0a43[_0xb8b2('0x24')](_0x162d41)['then'](function(_0xe3b28){return _0xe3b28;});}return null;};}function removeEntity(_0x8239a7,_0x2b40f8){return function(_0x20082f){if(_0x20082f){return _0x20082f['destroy']()[_0xb8b2('0x25')](function(){var _0x2502ae=_0x20082f[_0xb8b2('0x26')]({'plain':!![]});var _0x5a2afe='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x5a2afe,'resourceId':_0x2502ae['id']}})[_0xb8b2('0x25')](function(){return _0x20082f;});})[_0xb8b2('0x25')](function(){_0x8239a7[_0xb8b2('0x1a')](0xcc)[_0xb8b2('0x19')]();});}};}function handleEntityNotFound(_0x14ba5c,_0x2026db){return function(_0x3f3424){if(!_0x3f3424){_0x14ba5c[_0xb8b2('0x27')](0x194);}return _0x3f3424;};}function handleError(_0xf5f561,_0x2bf940){_0x2bf940=_0x2bf940||0x1f4;return function(_0x2a236d){logger[_0xb8b2('0x28')](_0x2a236d[_0xb8b2('0x29')]);if(_0x2a236d[_0xb8b2('0x2a')]){delete _0x2a236d[_0xb8b2('0x2a')];}_0xf5f561[_0xb8b2('0x1a')](_0x2bf940)[_0xb8b2('0x2b')](_0x2a236d);};}exports['index']=function(_0x37ea31,_0x1899d9){var _0x42b97f={},_0x394359={},_0x21b008={'count':0x0,'rows':[]};var _0x493c16=_[_0xb8b2('0x2c')](db[_0xb8b2('0x2d')][_0xb8b2('0x2e')],function(_0x52d2e9){return{'name':_0x52d2e9[_0xb8b2('0x2f')],'type':_0x52d2e9[_0xb8b2('0x30')]['key']};});_0x394359[_0xb8b2('0x31')]=_[_0xb8b2('0x2c')](_0x493c16,_0xb8b2('0x2a'));_0x394359[_0xb8b2('0x32')]=_[_0xb8b2('0x33')](_0x37ea31[_0xb8b2('0x32')]);_0x394359[_0xb8b2('0x34')]=_[_0xb8b2('0x35')](_0x394359[_0xb8b2('0x31')],_0x394359[_0xb8b2('0x32')]);_0x42b97f['attributes']=_[_0xb8b2('0x35')](_0x394359[_0xb8b2('0x31')],qs['fields'](_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x36')]));_0x42b97f[_0xb8b2('0x37')]=_0x42b97f[_0xb8b2('0x37')][_0xb8b2('0x38')]?_0x42b97f[_0xb8b2('0x37')]:_0x394359[_0xb8b2('0x31')];if(!_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x39')](_0xb8b2('0x3a'))){_0x42b97f[_0xb8b2('0x1e')]=qs[_0xb8b2('0x1e')](_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x1e')]);_0x42b97f[_0xb8b2('0x1c')]=qs[_0xb8b2('0x1c')](_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x1c')]);}_0x42b97f[_0xb8b2('0x3b')]=qs[_0xb8b2('0x3c')](_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x3c')]);_0x42b97f[_0xb8b2('0x3d')]=qs[_0xb8b2('0x34')](_[_0xb8b2('0x3e')](_0x37ea31[_0xb8b2('0x32')],_0x394359[_0xb8b2('0x34')]),_0x493c16);if(_0x37ea31['query']['filter']){_0x42b97f[_0xb8b2('0x3d')]=_['merge'](_0x42b97f[_0xb8b2('0x3d')],{'$or':_[_0xb8b2('0x2c')](_0x493c16,function(_0x30c686){if(_0x30c686[_0xb8b2('0x30')]!=='VIRTUAL'){var _0x517473={};_0x517473[_0x30c686[_0xb8b2('0x2a')]]={'$like':'%'+_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x3f')]+'%'};return _0x517473;}})});}_0x42b97f=_[_0xb8b2('0x40')]({},_0x42b97f,_0x37ea31[_0xb8b2('0x41')]);var _0x4fa963={'where':_0x42b97f[_0xb8b2('0x3d')]};return db[_0xb8b2('0x2d')][_0xb8b2('0x1f')](_0x4fa963)[_0xb8b2('0x25')](function(_0x283eb5){_0x21b008['count']=_0x283eb5;if(_0x37ea31[_0xb8b2('0x32')][_0xb8b2('0x42')]){_0x42b97f[_0xb8b2('0x43')]=[{'all':!![]}];}return db[_0xb8b2('0x2d')][_0xb8b2('0x44')](_0x42b97f);})[_0xb8b2('0x25')](function(_0x37370a){_0x21b008[_0xb8b2('0x45')]=_0x37370a;return _0x21b008;})[_0xb8b2('0x25')](respondWithFilteredResult(_0x1899d9,_0x42b97f))[_0xb8b2('0x46')](handleError(_0x1899d9,null));};exports['show']=function(_0x486d4b,_0x419e3e){var _0x51756b={'raw':![],'where':{'id':_0x486d4b[_0xb8b2('0x47')]['id']}},_0x4651e2={};_0x4651e2[_0xb8b2('0x31')]=_[_0xb8b2('0x33')](db[_0xb8b2('0x2d')]['rawAttributes']);_0x4651e2[_0xb8b2('0x32')]=_[_0xb8b2('0x33')](_0x486d4b[_0xb8b2('0x32')]);_0x4651e2[_0xb8b2('0x34')]=_[_0xb8b2('0x35')](_0x4651e2[_0xb8b2('0x31')],_0x4651e2[_0xb8b2('0x32')]);_0x51756b[_0xb8b2('0x37')]=_[_0xb8b2('0x35')](_0x4651e2[_0xb8b2('0x31')],qs[_0xb8b2('0x36')](_0x486d4b['query'][_0xb8b2('0x36')]));_0x51756b[_0xb8b2('0x37')]=_0x51756b[_0xb8b2('0x37')][_0xb8b2('0x38')]?_0x51756b[_0xb8b2('0x37')]:_0x4651e2[_0xb8b2('0x31')];if(_0x486d4b[_0xb8b2('0x32')][_0xb8b2('0x42')]){_0x51756b[_0xb8b2('0x43')]=[{'all':!![]}];}_0x51756b=_[_0xb8b2('0x40')]({},_0x51756b,_0x486d4b[_0xb8b2('0x41')]);return db[_0xb8b2('0x2d')][_0xb8b2('0x48')](_0x51756b)['then'](handleEntityNotFound(_0x419e3e,null))[_0xb8b2('0x25')](respondWithResult(_0x419e3e,null))[_0xb8b2('0x46')](handleError(_0x419e3e,null));};exports['create']=function(_0x35b691,_0x2b9c9a){return db[_0xb8b2('0x2d')]['create'](_0x35b691[_0xb8b2('0x49')],{})[_0xb8b2('0x25')](function(_0x1f106a){var _0x2d0ed5=_0x35b691[_0xb8b2('0x4a')][_0xb8b2('0x26')]({'plain':!![]});if(!_0x2d0ed5)throw new Error(_0xb8b2('0x4b'));if(_0x2d0ed5[_0xb8b2('0x4c')]===_0xb8b2('0x4a')){var _0x3397b0=_0x1f106a[_0xb8b2('0x26')]({'plain':!![]});var _0x4434b3=_0xb8b2('0x4d');return db[_0xb8b2('0x4e')][_0xb8b2('0x48')]({'where':{'name':_0x4434b3,'userProfileId':_0x2d0ed5['userProfileId']},'raw':!![]})['then'](function(_0x46ab13){if(_0x46ab13&&_0x46ab13[_0xb8b2('0x4f')]===0x0){return db[_0xb8b2('0x50')][_0xb8b2('0x51')]({'name':_0x3397b0[_0xb8b2('0x2a')],'resourceId':_0x3397b0['id'],'type':_0x46ab13[_0xb8b2('0x2a')],'sectionId':_0x46ab13['id']},{})['then'](function(){return _0x1f106a;});}else{return _0x1f106a;}})[_0xb8b2('0x46')](function(_0x3a07b5){logger[_0xb8b2('0x28')](_0xb8b2('0x52'),_0x3a07b5);throw _0x3a07b5;});}return _0x1f106a;})[_0xb8b2('0x25')](respondWithResult(_0x2b9c9a,0xc9))[_0xb8b2('0x46')](handleError(_0x2b9c9a,null));};exports[_0xb8b2('0x24')]=function(_0x25ad26,_0x567892){if(_0x25ad26[_0xb8b2('0x49')]['id']){delete _0x25ad26['body']['id'];}return db[_0xb8b2('0x2d')][_0xb8b2('0x48')]({'where':{'id':_0x25ad26[_0xb8b2('0x47')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x567892,null))[_0xb8b2('0x25')](saveUpdates(_0x25ad26[_0xb8b2('0x49')],null))[_0xb8b2('0x25')](respondWithResult(_0x567892,null))['catch'](handleError(_0x567892,null));};exports[_0xb8b2('0x53')]=function(_0xf450d7,_0x1ad5d4){return db[_0xb8b2('0x2d')][_0xb8b2('0x48')]({'where':{'id':_0xf450d7['params']['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x1ad5d4,null))['then'](removeEntity(_0x1ad5d4,null))['catch'](handleError(_0x1ad5d4,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 67f75c5..cc1d833 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 _0x6400=['VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','format','%s%s','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','length','concat','internal','findAll','then','catch','models','define'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x6400,0x10d));var _0x0640=function(_0x5cbbeb,_0x142ebc){_0x5cbbeb=_0x5cbbeb-0x0;var _0x4cf278=_0x6400[_0x5cbbeb];return _0x4cf278;};'use strict';var _=require(_0x0640('0x0'));var util=require(_0x0640('0x1'));var BPromise=require('bluebird');var attributes=require(_0x0640('0x2'));var getUserApplications=function(_0x7b660f,_0x2bb465,_0xa09221){var _0x4ce5c3=0x1;var _0x2676ff=[];var _0x29ad1d={'context':_0x2bb465[_0x0640('0x3')]||'from-sip','exten':util[_0x0640('0x4')](_0x0640('0x5'),_0x7b660f['prefix'],_0xa09221),'type':_0x0640('0x6'),'isApp':![],'ChanSpyId':_0x7b660f['id'],'UserId':_0x2bb465['id']};_0x2676ff[_0x0640('0x7')](_[_0x0640('0x8')]({'app':'Set','appdata':util[_0x0640('0x4')](_0x0640('0x9'),_0x0640('0xa')),'priority':_0x4ce5c3++},_0x29ad1d));if(_0x7b660f[_0x0640('0xb')]){_0x2676ff[_0x0640('0x7')](_[_0x0640('0x8')]({'app':_0x0640('0xc'),'appdata':util['format'](_0x0640('0xd'),_0x7b660f['recordingFormat']),'priority':_0x4ce5c3++},_0x29ad1d));}if(_0x7b660f[_0x0640('0xe')]){_0x2676ff[_0x0640('0x7')](_[_0x0640('0x8')]({'app':_0x0640('0xf'),'appdata':_0x7b660f['password'],'priority':_0x4ce5c3++},_0x29ad1d));}_0x2676ff['push'](_['merge']({'app':_0x0640('0x10'),'appdata':util[_0x0640('0x4')](_0x0640('0x11'),_0x2bb465[_0x0640('0x12')],_0x7b660f[_0x0640('0x13')]?_0x7b660f[_0x0640('0x13')]['join'](''):''),'priority':_0x4ce5c3++},_0x29ad1d));if(_0x7b660f['record']){_0x2676ff[_0x0640('0x7')](_[_0x0640('0x8')]({'app':'StopMixMonitor','priority':_0x4ce5c3++},_0x29ad1d));}return _0x2676ff;};var getChanSpyApplications=function(_0x28b302,_0x20c444){var _0x136397=[];for(var _0x4db8d9=0x0,_0xd6b3d4=0x1;_0x4db8d9<_0x20c444[_0x0640('0x14')];_0x4db8d9++,_0xd6b3d4=0x1){_0x136397=_0x136397[_0x0640('0x15')](getUserApplications(_0x28b302,_0x20c444[_0x4db8d9],_0x20c444[_0x4db8d9][_0x0640('0x16')]));if(_0x20c444[_0x4db8d9]['internal']!=_0x20c444[_0x4db8d9][_0x0640('0x12')]){_0x136397=_0x136397[_0x0640('0x15')](getUserApplications(_0x28b302,_0x20c444[_0x4db8d9],_0x20c444[_0x4db8d9][_0x0640('0x12')]));}}return _0x136397;};var getChanSpyPromise=function(_0x3887e1,_0xab5f8a){return new BPromise(function(_0x16dd45,_0x4b5862){return _0x3887e1['User'][_0x0640('0x17')]({'attributes':['id',_0x0640('0x12'),_0x0640('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x0640('0x18')](function(_0x2e9d6e){if(_0x2e9d6e){return _0x16dd45(getChanSpyApplications(_0xab5f8a,_0x2e9d6e));}return _0x16dd45([]);})[_0x0640('0x19')](function(_0xe28118){_0x4b5862(_0xe28118);});});};module['exports']=function(_0x521d17,_0x2a3d26){var _0x156629=_0x521d17[_0x0640('0x1a')];return _0x521d17[_0x0640('0x1b')](_0x0640('0x1c'),attributes,{'tableName':_0x0640('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56f9ca,_0x4bfbeb,_0x23dd3d){return getChanSpyPromise(_0x156629,_0x56f9ca)['then'](function(_0x1abc35){if(_0x1abc35&&_0x1abc35[_0x0640('0x14')]){return _0x156629[_0x0640('0x1e')][_0x0640('0x1f')](_0x1abc35);}})['then'](function(){_0x23dd3d();})[_0x0640('0x19')](function(_0x4c56db){_0x23dd3d(_0x4c56db);});},'afterUpdate':function(_0x2e6346,_0x112f23,_0x4893b7){return _0x156629[_0x0640('0x1e')][_0x0640('0x20')]({'where':{'ChanSpyId':_0x2e6346['id']}})[_0x0640('0x18')](function(){return getChanSpyPromise(_0x156629,_0x2e6346);})[_0x0640('0x18')](function(_0x14519a){if(_0x14519a&&_0x14519a[_0x0640('0x14')]){return _0x156629['VoiceExtension'][_0x0640('0x1f')](_0x14519a);}})[_0x0640('0x18')](function(){_0x4893b7();})[_0x0640('0x19')](function(_0x1e2f26){_0x4893b7(_0x1e2f26);});},'afterDestroy':function(_0x248bda,_0x151377,_0x23a1d1){return _0x156629[_0x0640('0x1e')][_0x0640('0x20')]({'where':{'ChanSpyId':_0x248bda['id']}})[_0x0640('0x18')](function(){_0x23a1d1();})[_0x0640('0x19')](function(_0x5206ec){_0x23a1d1(_0x5206ec);});}}});}; \ No newline at end of file +var _0x06fb=['record','merge','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','name','options','join','push','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','context','format','%s%s','prefix','system','Set','chanspy'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x06fb,0x18e));var _0xb06f=function(_0x57869b,_0x54672d){_0x57869b=_0x57869b-0x0;var _0x582bbb=_0x06fb[_0x57869b];return _0x582bbb;};'use strict';var _=require(_0xb06f('0x0'));var util=require('util');var BPromise=require(_0xb06f('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x4aacb6,_0x519811,_0x2e91db){var _0x17f889=0x1;var _0x1148e9=[];var _0x5215bc={'context':_0x519811[_0xb06f('0x2')]||'from-sip','exten':util[_0xb06f('0x3')](_0xb06f('0x4'),_0x4aacb6[_0xb06f('0x5')],_0x2e91db),'type':_0xb06f('0x6'),'isApp':![],'ChanSpyId':_0x4aacb6['id'],'UserId':_0x519811['id']};_0x1148e9['push'](_['merge']({'app':_0xb06f('0x7'),'appdata':util[_0xb06f('0x3')]('CDR(type)=%s',_0xb06f('0x8')),'priority':_0x17f889++},_0x5215bc));if(_0x4aacb6[_0xb06f('0x9')]){_0x1148e9['push'](_[_0xb06f('0xa')]({'app':_0xb06f('0xb'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x4aacb6[_0xb06f('0xc')]),'priority':_0x17f889++},_0x5215bc));}if(_0x4aacb6[_0xb06f('0xd')]){_0x1148e9['push'](_[_0xb06f('0xa')]({'app':_0xb06f('0xe'),'appdata':_0x4aacb6['password'],'priority':_0x17f889++},_0x5215bc));}_0x1148e9['push'](_[_0xb06f('0xa')]({'app':_0xb06f('0xf'),'appdata':util['format']('SIP/%s,%s',_0x519811[_0xb06f('0x10')],_0x4aacb6[_0xb06f('0x11')]?_0x4aacb6[_0xb06f('0x11')][_0xb06f('0x12')](''):''),'priority':_0x17f889++},_0x5215bc));if(_0x4aacb6['record']){_0x1148e9[_0xb06f('0x13')](_[_0xb06f('0xa')]({'app':_0xb06f('0x14'),'priority':_0x17f889++},_0x5215bc));}return _0x1148e9;};var getChanSpyApplications=function(_0xd695aa,_0x184556){var _0x4f38a3=[];for(var _0x46c365=0x0,_0x166247=0x1;_0x46c365<_0x184556[_0xb06f('0x15')];_0x46c365++,_0x166247=0x1){_0x4f38a3=_0x4f38a3[_0xb06f('0x16')](getUserApplications(_0xd695aa,_0x184556[_0x46c365],_0x184556[_0x46c365][_0xb06f('0x17')]));if(_0x184556[_0x46c365][_0xb06f('0x17')]!=_0x184556[_0x46c365]['name']){_0x4f38a3=_0x4f38a3['concat'](getUserApplications(_0xd695aa,_0x184556[_0x46c365],_0x184556[_0x46c365][_0xb06f('0x10')]));}}return _0x4f38a3;};var getChanSpyPromise=function(_0x185a03,_0x158cbf){return new BPromise(function(_0x14a297,_0x3ea4a0){return _0x185a03[_0xb06f('0x18')][_0xb06f('0x19')]({'attributes':['id',_0xb06f('0x10'),_0xb06f('0x17')],'where':{'role':_0xb06f('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x19eee0){if(_0x19eee0){return _0x14a297(getChanSpyApplications(_0x158cbf,_0x19eee0));}return _0x14a297([]);})[_0xb06f('0x1b')](function(_0x54d6e2){_0x3ea4a0(_0x54d6e2);});});};module[_0xb06f('0x1c')]=function(_0x30ca81,_0x1f5501){var _0x113f04=_0x30ca81[_0xb06f('0x1d')];return _0x30ca81[_0xb06f('0x1e')](_0xb06f('0x1f'),attributes,{'tableName':_0xb06f('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x7da1b6,_0x4df354,_0x1d054c){return getChanSpyPromise(_0x113f04,_0x7da1b6)[_0xb06f('0x21')](function(_0x3cb478){if(_0x3cb478&&_0x3cb478['length']){return _0x113f04[_0xb06f('0x22')][_0xb06f('0x23')](_0x3cb478);}})[_0xb06f('0x21')](function(){_0x1d054c();})[_0xb06f('0x1b')](function(_0x4e5664){_0x1d054c(_0x4e5664);});},'afterUpdate':function(_0x36fc0d,_0x462ea7,_0x4603de){return _0x113f04[_0xb06f('0x22')][_0xb06f('0x24')]({'where':{'ChanSpyId':_0x36fc0d['id']}})['then'](function(){return getChanSpyPromise(_0x113f04,_0x36fc0d);})[_0xb06f('0x21')](function(_0x589044){if(_0x589044&&_0x589044[_0xb06f('0x15')]){return _0x113f04['VoiceExtension'][_0xb06f('0x23')](_0x589044);}})[_0xb06f('0x21')](function(){_0x4603de();})[_0xb06f('0x1b')](function(_0x14d34d){_0x4603de(_0x14d34d);});},'afterDestroy':function(_0x53ce72,_0x38adc0,_0x2d5418){return _0x113f04[_0xb06f('0x22')][_0xb06f('0x24')]({'where':{'ChanSpyId':_0x53ce72['id']}})[_0xb06f('0x21')](function(){_0x2d5418();})[_0xb06f('0x1b')](function(_0x57aeef){_0x2d5418(_0x57aeef);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b85b826..f51ea24 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 _0x9567=['info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\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(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0x9567,0xdc));var _0x7956=function(_0x56e193,_0x208c4f){_0x56e193=_0x56e193-0x0;var _0x507e98=_0x9567[_0x56e193];return _0x507e98;};'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')]('VoiceChanSpy,\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 +var _0xd757=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xd757,0x1e5));var _0x7d75=function(_0x188ab0,_0x17e9c9){_0x188ab0=_0x188ab0-0x0;var _0x5e94f7=_0xd757[_0x188ab0];return _0x5e94f7;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require(_0x7d75('0x2'));var BPromise=require(_0x7d75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require(_0x7d75('0x7'));var jayson=require(_0x7d75('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x108c0d,_0x3fde33,_0x1cf272){return new BPromise(function(_0x276fb0,_0x4030ee){return client[_0x7d75('0x9')](_0x108c0d,_0x1cf272)[_0x7d75('0xa')](function(_0x3720c7){logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));logger[_0x7d75('0xe')](_0x7d75('0xf'),_0x3fde33,'request\x20sent',JSON['stringify'](_0x3720c7));if(_0x3720c7[_0x7d75('0x10')]){if(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x11')]===0x1f4){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')]['message']);return _0x4030ee(_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);}logger[_0x7d75('0x10')](_0x7d75('0xc'),_0x3fde33,_0x3720c7[_0x7d75('0x10')][_0x7d75('0x12')]);return _0x276fb0(_0x3720c7['error'][_0x7d75('0x12')]);}else{logger[_0x7d75('0xb')](_0x7d75('0xc'),_0x3fde33,_0x7d75('0xd'));_0x276fb0(_0x3720c7[_0x7d75('0x13')][_0x7d75('0x12')]);}})['catch'](function(_0x15ba5f){logger['error'](_0x7d75('0xc'),_0x3fde33,_0x15ba5f);_0x4030ee(_0x15ba5f);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f81037a..3f8ed0f 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 _0x82f5=['get','isAuthenticated','index','/:id','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x52e77f,_0x368694){var _0x3aad87=function(_0x2a4f2e){while(--_0x2a4f2e){_0x52e77f['push'](_0x52e77f['shift']());}};_0x3aad87(++_0x368694);}(_0x82f5,0x129));var _0x582f=function(_0x5cd0cf,_0x33b7e2){_0x5cd0cf=_0x5cd0cf-0x0;var _0x4b7c66=_0x82f5[_0x5cd0cf];return _0x4b7c66;};'use strict';var multer=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var path=require(_0x582f('0x2'));var timeout=require(_0x582f('0x3'));var express=require(_0x582f('0x4'));var router=express[_0x582f('0x5')]();var fs_extra=require(_0x582f('0x6'));var auth=require(_0x582f('0x7'));var interaction=require(_0x582f('0x8'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0x582f('0x9')]('/',auth[_0x582f('0xa')](),controller[_0x582f('0xb')]);router[_0x582f('0x9')](_0x582f('0xc'),auth[_0x582f('0xa')](),controller['show']);router['post']('/',auth[_0x582f('0xa')](),controller[_0x582f('0xd')]);router[_0x582f('0xe')]('/:id',auth[_0x582f('0xa')](),controller['update']);router[_0x582f('0xf')](_0x582f('0xc'),auth['isAuthenticated'](),controller[_0x582f('0x10')]);module['exports']=router; \ No newline at end of file +var _0xab05=['fs-extra','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1f53fc,_0x2af3f7){var _0x3544ac=function(_0x11b113){while(--_0x11b113){_0x1f53fc['push'](_0x1f53fc['shift']());}};_0x3544ac(++_0x2af3f7);}(_0xab05,0x11b));var _0x5ab0=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xab05[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x5ab0('0x0'));var util=require(_0x5ab0('0x1'));var path=require(_0x5ab0('0x2'));var timeout=require(_0x5ab0('0x3'));var express=require(_0x5ab0('0x4'));var router=express['Router']();var fs_extra=require(_0x5ab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5ab0('0x6'));var config=require('../../config/environment');var controller=require(_0x5ab0('0x7'));router[_0x5ab0('0x8')]('/',auth[_0x5ab0('0x9')](),controller[_0x5ab0('0xa')]);router[_0x5ab0('0x8')]('/:id',auth[_0x5ab0('0x9')](),controller[_0x5ab0('0xb')]);router[_0x5ab0('0xc')]('/',auth[_0x5ab0('0x9')](),controller['create']);router['put'](_0x5ab0('0xd'),auth[_0x5ab0('0x9')](),controller[_0x5ab0('0xe')]);router[_0x5ab0('0xf')](_0x5ab0('0xd'),auth[_0x5ab0('0x9')](),controller[_0x5ab0('0x10')]);module[_0x5ab0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 191091c..e11f5b6 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 _0xc1fe=['exports','STRING','BOOLEAN','sequelize'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0xc1fe,0x1c3));var _0xec1f=function(_0xa7626c,_0x522132){_0xa7626c=_0xa7626c-0x0;var _0x24d24e=_0xc1fe[_0xa7626c];return _0x24d24e;};'use strict';var Sequelize=require(_0xec1f('0x0'));module[_0xec1f('0x1')]={'name':{'type':Sequelize[_0xec1f('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xec1f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xec1f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x14b1=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x2dfe22,_0xfeecdb){var _0x2202f=function(_0x2bc9fa){while(--_0x2bc9fa){_0x2dfe22['push'](_0x2dfe22['shift']());}};_0x2202f(++_0xfeecdb);}(_0x14b1,0x1e3));var _0x114b=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0x14b1[_0x53c4f8];return _0x416458;};'use strict';var Sequelize=require(_0x114b('0x0'));module[_0x114b('0x1')]={'name':{'type':Sequelize[_0x114b('0x2')],'unique':_0x114b('0x3')},'description':{'type':Sequelize[_0x114b('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x114b('0x4')],'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 159368d..81ce337 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 _0xb734=['order','sort','where','pick','filter','merge','options','VoiceContext','include','findAll','rows','params','includeAll','create','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','readFileSync','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','end','status','offset','undefined','count','limit','json','apply','reject','update','get','Contexts','UserProfileResource','destroy','stack','name','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty'];(function(_0x47e03c,_0x2ba0df){var _0x3fbcb4=function(_0x2e2730){while(--_0x2e2730){_0x47e03c['push'](_0x47e03c['shift']());}};_0x3fbcb4(++_0x2ba0df);}(_0xb734,0xe3));var _0x4b73=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb734[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0x4b73('0x0'));var rimraf=require(_0x4b73('0x1'));var zipdir=require(_0x4b73('0x2'));var jsonpatch=require(_0x4b73('0x3'));var rp=require(_0x4b73('0x4'));var moment=require(_0x4b73('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b73('0x6'));var sox=require(_0x4b73('0x7'));var csv=require(_0x4b73('0x8'));var ejs=require(_0x4b73('0x9'));var fs=require('fs');var fs_extra=require(_0x4b73('0xa'));var _=require(_0x4b73('0xb'));var squel=require(_0x4b73('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b73('0xd'));var deskjs=require(_0x4b73('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4b73('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b73('0x10'));var authService=require(_0x4b73('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4b73('0x12'));var hardwareService=require(_0x4b73('0x13'));var logger=require(_0x4b73('0x14'))(_0x4b73('0x15'));var utils=require(_0x4b73('0x16'));var config=require(_0x4b73('0x17'));var licenseUtil=require(_0x4b73('0x18'));var db=require(_0x4b73('0x19'))['db'];var jayson=require(_0x4b73('0x1a'));var client=jayson[_0x4b73('0x1b')][_0x4b73('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xb200c2,_0x4ea967,_0x111c6e,_0x39084d){return new BPromise(function(_0x555a2b,_0x3f3231){var _0x1b0851=_0x39084d||client;return _0x1b0851['request'](_0xb200c2,_0x111c6e)[_0x4b73('0x1d')](function(_0x5a728a){logger['info']('VoiceContext,\x20%s,\x20%s',_0x4ea967,_0x4b73('0x1e'));logger[_0x4b73('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4ea967,'request\x20sent',JSON[_0x4b73('0x20')](_0x5a728a));if(_0x5a728a[_0x4b73('0x21')]){if(_0x5a728a['error'][_0x4b73('0x22')]===0x1f4){logger[_0x4b73('0x21')](_0x4b73('0x23'),_0x4ea967,_0x5a728a[_0x4b73('0x21')][_0x4b73('0x24')]);return _0x3f3231(_0x5a728a['error']['message']);}logger[_0x4b73('0x21')](_0x4b73('0x23'),_0x4ea967,_0x5a728a[_0x4b73('0x21')][_0x4b73('0x24')]);return _0x555a2b(_0x5a728a['error']['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x4ea967,_0x4b73('0x1e'));_0x555a2b(_0x5a728a['result'][_0x4b73('0x24')]);}})[_0x4b73('0x25')](function(_0x5705f7){logger['error'](_0x4b73('0x23'),_0x4ea967,_0x5705f7);_0x3f3231(_0x5705f7);});});}function respondWithStatusCode(_0x5844db,_0x5e44d5){_0x5e44d5=_0x5e44d5||0xcc;return function(_0x5f08d5){if(_0x5f08d5){return _0x5844db[_0x4b73('0x26')](_0x5e44d5);}return _0x5844db['status'](_0x5e44d5)[_0x4b73('0x27')]();};}function respondWithResult(_0x166d92,_0x39eb4e){_0x39eb4e=_0x39eb4e||0xc8;return function(_0x358e4f){if(_0x358e4f){return _0x166d92[_0x4b73('0x28')](_0x39eb4e)['json'](_0x358e4f);}};}function respondWithFilteredResult(_0x789615,_0x44c6bb){return function(_0xe4546c){if(_0xe4546c){var _0x5832cd=typeof _0x44c6bb[_0x4b73('0x29')]==='undefined'&&typeof _0x44c6bb['limit']===_0x4b73('0x2a');var _0x45ec66=_0xe4546c[_0x4b73('0x2b')];var _0x5bd53d=_0x5832cd?0x0:_0x44c6bb['offset'];var _0x2fcc76=_0x5832cd?_0xe4546c[_0x4b73('0x2b')]:_0x44c6bb['offset']+_0x44c6bb[_0x4b73('0x2c')];var _0xa34789;if(_0x2fcc76>=_0x45ec66){_0x2fcc76=_0x45ec66;_0xa34789=0xc8;}else{_0xa34789=0xce;}_0x789615[_0x4b73('0x28')](_0xa34789);return _0x789615['set']('Content-Range',_0x5bd53d+'-'+_0x2fcc76+'/'+_0x45ec66)[_0x4b73('0x2d')](_0xe4546c);}return null;};}function patchUpdates(_0x447ec7){return function(_0x381eb5){try{jsonpatch[_0x4b73('0x2e')](_0x381eb5,_0x447ec7,!![]);}catch(_0x5a1d8d){return BPromise[_0x4b73('0x2f')](_0x5a1d8d);}return _0x381eb5['save']();};}function saveUpdates(_0x2bdfc5,_0x49fd56){return function(_0x23bd35){if(_0x23bd35){return _0x23bd35[_0x4b73('0x30')](_0x2bdfc5)[_0x4b73('0x1d')](function(_0x5ee1c8){return _0x5ee1c8;});}return null;};}function removeEntity(_0xfc9d4,_0x5642de){return function(_0x537bba){if(_0x537bba){return _0x537bba['destroy']()[_0x4b73('0x1d')](function(){var _0x1ec21a=_0x537bba[_0x4b73('0x31')]({'plain':!![]});var _0x3bf7dd=_0x4b73('0x32');return db[_0x4b73('0x33')][_0x4b73('0x34')]({'where':{'type':_0x3bf7dd,'resourceId':_0x1ec21a['id']}})[_0x4b73('0x1d')](function(){return _0x537bba;});})['then'](function(){_0xfc9d4[_0x4b73('0x28')](0xcc)[_0x4b73('0x27')]();});}};}function handleEntityNotFound(_0x343a9a,_0x52ffc7){return function(_0x20ea6e){if(!_0x20ea6e){_0x343a9a[_0x4b73('0x26')](0x194);}return _0x20ea6e;};}function handleError(_0x3b44a0,_0x34e3e3){_0x34e3e3=_0x34e3e3||0x1f4;return function(_0xd07277){logger[_0x4b73('0x21')](_0xd07277[_0x4b73('0x35')]);if(_0xd07277[_0x4b73('0x36')]){delete _0xd07277['name'];}_0x3b44a0['status'](_0x34e3e3)['send'](_0xd07277);};}exports['index']=function(_0x707e4f,_0x5e543f){var _0x570461={},_0xace993={},_0x136397={'count':0x0,'rows':[]};var _0x42ac6b=_[_0x4b73('0x37')](db['VoiceContext']['rawAttributes'],function(_0x193b73){return{'name':_0x193b73[_0x4b73('0x38')],'type':_0x193b73[_0x4b73('0x39')][_0x4b73('0x3a')]};});_0xace993[_0x4b73('0x3b')]=_[_0x4b73('0x37')](_0x42ac6b,_0x4b73('0x36'));_0xace993[_0x4b73('0x3c')]=_[_0x4b73('0x3d')](_0x707e4f['query']);_0xace993[_0x4b73('0x3e')]=_['intersection'](_0xace993[_0x4b73('0x3b')],_0xace993[_0x4b73('0x3c')]);_0x570461[_0x4b73('0x3f')]=_['intersection'](_0xace993[_0x4b73('0x3b')],qs[_0x4b73('0x40')](_0x707e4f[_0x4b73('0x3c')][_0x4b73('0x40')]));_0x570461['attributes']=_0x570461[_0x4b73('0x3f')][_0x4b73('0x41')]?_0x570461[_0x4b73('0x3f')]:_0xace993['model'];if(!_0x707e4f[_0x4b73('0x3c')][_0x4b73('0x42')]('nolimit')){_0x570461[_0x4b73('0x2c')]=qs['limit'](_0x707e4f[_0x4b73('0x3c')][_0x4b73('0x2c')]);_0x570461[_0x4b73('0x29')]=qs[_0x4b73('0x29')](_0x707e4f['query'][_0x4b73('0x29')]);}_0x570461[_0x4b73('0x43')]=qs[_0x4b73('0x44')](_0x707e4f['query']['sort']);_0x570461[_0x4b73('0x45')]=qs[_0x4b73('0x3e')](_[_0x4b73('0x46')](_0x707e4f[_0x4b73('0x3c')],_0xace993[_0x4b73('0x3e')]),_0x42ac6b);if(_0x707e4f[_0x4b73('0x3c')][_0x4b73('0x47')]){_0x570461['where']=_['merge'](_0x570461[_0x4b73('0x45')],{'$or':_[_0x4b73('0x37')](_0x42ac6b,function(_0x451d1f){if(_0x451d1f[_0x4b73('0x39')]!=='VIRTUAL'){var _0x1c6b1d={};_0x1c6b1d[_0x451d1f['name']]={'$like':'%'+_0x707e4f[_0x4b73('0x3c')][_0x4b73('0x47')]+'%'};return _0x1c6b1d;}})});}_0x570461=_[_0x4b73('0x48')]({},_0x570461,_0x707e4f[_0x4b73('0x49')]);var _0x3a9860={'where':_0x570461[_0x4b73('0x45')]};return db[_0x4b73('0x4a')]['count'](_0x3a9860)[_0x4b73('0x1d')](function(_0x37b24c){_0x136397[_0x4b73('0x2b')]=_0x37b24c;if(_0x707e4f[_0x4b73('0x3c')]['includeAll']){_0x570461[_0x4b73('0x4b')]=[{'all':!![]}];}return db[_0x4b73('0x4a')][_0x4b73('0x4c')](_0x570461);})[_0x4b73('0x1d')](function(_0xbfe348){_0x136397[_0x4b73('0x4d')]=_0xbfe348;return _0x136397;})[_0x4b73('0x1d')](respondWithFilteredResult(_0x5e543f,_0x570461))[_0x4b73('0x25')](handleError(_0x5e543f,null));};exports['show']=function(_0x31a700,_0x150bf9){var _0x258be9={'raw':![],'where':{'id':_0x31a700[_0x4b73('0x4e')]['id']}},_0x4e4702={};_0x4e4702[_0x4b73('0x3b')]=_['keys'](db[_0x4b73('0x4a')]['rawAttributes']);_0x4e4702['query']=_['keys'](_0x31a700[_0x4b73('0x3c')]);_0x4e4702['filters']=_['intersection'](_0x4e4702['model'],_0x4e4702[_0x4b73('0x3c')]);_0x258be9[_0x4b73('0x3f')]=_['intersection'](_0x4e4702['model'],qs[_0x4b73('0x40')](_0x31a700[_0x4b73('0x3c')]['fields']));_0x258be9[_0x4b73('0x3f')]=_0x258be9[_0x4b73('0x3f')][_0x4b73('0x41')]?_0x258be9['attributes']:_0x4e4702[_0x4b73('0x3b')];if(_0x31a700[_0x4b73('0x3c')][_0x4b73('0x4f')]){_0x258be9[_0x4b73('0x4b')]=[{'all':!![]}];}_0x258be9=_[_0x4b73('0x48')]({},_0x258be9,_0x31a700[_0x4b73('0x49')]);return db['VoiceContext']['find'](_0x258be9)[_0x4b73('0x1d')](handleEntityNotFound(_0x150bf9,null))['then'](respondWithResult(_0x150bf9,null))[_0x4b73('0x25')](handleError(_0x150bf9,null));};exports[_0x4b73('0x50')]=function(_0xbe111d,_0x540e54,_0x47c94a){var _0x5e4636;return db[_0x4b73('0x4a')][_0x4b73('0x50')](_0xbe111d['body'],{'raw':!![]})[_0x4b73('0x1d')](function(_0x7a8ea){_0x5e4636=_0x7a8ea;return db[_0x4b73('0x4a')]['findAll']({'raw':!![]});})[_0x4b73('0x1d')](function(_0xced04){var _0x46f01b=fs['readFileSync'](path['join'](config[_0x4b73('0x51')],_0x4b73('0x52')),_0x4b73('0x53'));var _0x353615=ejs[_0x4b73('0x54')](_0x46f01b,{'contexts':_0xced04||[]});fs[_0x4b73('0x55')](_0x4b73('0x56'),_0x353615);})['then'](function(){return respondWithRpcPromise(_0x4b73('0x57'),_0x4b73('0x50'),{'module':_0x4b73('0x58')});})[_0x4b73('0x1d')](function(){var _0x1cd212=_0xbe111d[_0x4b73('0x59')][_0x4b73('0x31')]({'plain':!![]});if(!_0x1cd212)throw new Error(_0x4b73('0x5a'));if(_0x1cd212['role']===_0x4b73('0x59')){var _0x2117c6=_0x5e4636['get']({'plain':!![]});return db[_0x4b73('0x5b')]['find']({'where':{'name':_0x4b73('0x32'),'userProfileId':_0x1cd212['userProfileId']},'raw':!![]})['then'](function(_0x54867f){if(_0x54867f&&_0x54867f[_0x4b73('0x5c')]===0x0){return db[_0x4b73('0x33')][_0x4b73('0x50')]({'name':_0x2117c6[_0x4b73('0x36')],'resourceId':_0x2117c6['id'],'type':_0x54867f['name'],'sectionId':_0x54867f['id']},{})[_0x4b73('0x1d')](function(){return _0x5e4636;});}else{return _0x5e4636;}})[_0x4b73('0x25')](function(_0x342251){logger[_0x4b73('0x21')](_0x4b73('0x5d'),_0x342251);throw _0x342251;});}return _0x5e4636;})[_0x4b73('0x1d')](respondWithResult(_0x540e54,0xc9))[_0x4b73('0x25')](handleError(_0x540e54,null));};exports[_0x4b73('0x30')]=function(_0x358d13,_0x4b611f,_0x148123){var _0x22c102;return db[_0x4b73('0x4a')][_0x4b73('0x5e')]({'where':{'id':_0x358d13['params']['id']}})[_0x4b73('0x1d')](handleEntityNotFound(_0x4b611f,null))[_0x4b73('0x1d')](saveUpdates(_0x358d13[_0x4b73('0x5f')],null))[_0x4b73('0x1d')](function(_0x3be98e){if(_0x3be98e){_0x22c102=_0x3be98e;return db['VoiceContext'][_0x4b73('0x4c')]({'raw':!![]});}})['then'](function(_0x5e9888){var _0x52c641=fs[_0x4b73('0x60')](path[_0x4b73('0x61')](config[_0x4b73('0x51')],_0x4b73('0x52')),_0x4b73('0x53'));var _0x4d272c=ejs['render'](_0x52c641,{'contexts':_0x5e9888||[]});fs['writeFileSync'](_0x4b73('0x56'),_0x4d272c);})[_0x4b73('0x1d')](function(){return respondWithRpcPromise(_0x4b73('0x57'),_0x4b73('0x30'),{'module':_0x4b73('0x58')});})['then'](function(){return _0x22c102;})[_0x4b73('0x1d')](respondWithResult(_0x4b611f,null))['catch'](handleError(_0x4b611f,null));};exports[_0x4b73('0x34')]=function(_0x2a0033,_0x25c8f3,_0x286547){var _0x35419e;return db[_0x4b73('0x4a')][_0x4b73('0x5e')]({'where':{'id':_0x2a0033[_0x4b73('0x4e')]['id']}})['then'](handleEntityNotFound(_0x25c8f3,null))['then'](removeEntity(_0x25c8f3,null))[_0x4b73('0x1d')](function(){return db[_0x4b73('0x4a')][_0x4b73('0x4c')]({'raw':!![]});})[_0x4b73('0x1d')](function(_0x467414){var _0x2c9df6=fs['readFileSync'](path[_0x4b73('0x61')](config[_0x4b73('0x51')],_0x4b73('0x52')),_0x4b73('0x53'));var _0x54a411=ejs[_0x4b73('0x54')](_0x2c9df6,{'contexts':_0x467414});fs['writeFileSync'](_0x4b73('0x56'),_0x54a411);return respondWithRpcPromise('Reload',_0x4b73('0x34'),{'module':_0x4b73('0x58')});})[_0x4b73('0x25')](handleError(_0x25c8f3,null));}; \ No newline at end of file +var _0x095e=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','request\x20sent','debug','code','error','VoiceContext,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','Contexts','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','rows','catch','show','params','fields','merge','find','create','readFileSync','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findAll','join','utf8','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4cff29,_0x4b3cef){var _0x371627=function(_0x57eeed){while(--_0x57eeed){_0x4cff29['push'](_0x4cff29['shift']());}};_0x371627(++_0x4b3cef);}(_0x095e,0x1eb));var _0xe095=function(_0x3a9139,_0x3cdb8c){_0x3a9139=_0x3a9139-0x0;var _0x43eb4a=_0x095e[_0x3a9139];return _0x43eb4a;};'use strict';var emlformat=require(_0xe095('0x0'));var rimraf=require(_0xe095('0x1'));var zipdir=require(_0xe095('0x2'));var jsonpatch=require(_0xe095('0x3'));var rp=require(_0xe095('0x4'));var moment=require(_0xe095('0x5'));var BPromise=require(_0xe095('0x6'));var Mustache=require(_0xe095('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe095('0x8'));var csv=require(_0xe095('0x9'));var ejs=require(_0xe095('0xa'));var fs=require('fs');var fs_extra=require(_0xe095('0xb'));var _=require(_0xe095('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe095('0x9'));var querystring=require(_0xe095('0xd'));var Papa=require(_0xe095('0xe'));var Redis=require('ioredis');var authService=require(_0xe095('0xf'));var qs=require(_0xe095('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe095('0x11'))(_0xe095('0x12'));var utils=require(_0xe095('0x13'));var config=require(_0xe095('0x14'));var licenseUtil=require(_0xe095('0x15'));var db=require(_0xe095('0x16'))['db'];var jayson=require(_0xe095('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1064ae,_0x50aba3,_0xe3e25e,_0x32504a){return new BPromise(function(_0x4bd56f,_0x386482){var _0x567afb=_0x32504a||client;return _0x567afb[_0xe095('0x18')](_0x1064ae,_0xe3e25e)['then'](function(_0x4e336c){logger['info']('VoiceContext,\x20%s,\x20%s',_0x50aba3,_0xe095('0x19'));logger[_0xe095('0x1a')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x50aba3,_0xe095('0x19'),JSON['stringify'](_0x4e336c));if(_0x4e336c['error']){if(_0x4e336c['error'][_0xe095('0x1b')]===0x1f4){logger[_0xe095('0x1c')](_0xe095('0x1d'),_0x50aba3,_0x4e336c[_0xe095('0x1c')][_0xe095('0x1e')]);return _0x386482(_0x4e336c[_0xe095('0x1c')]['message']);}logger['error'](_0xe095('0x1d'),_0x50aba3,_0x4e336c[_0xe095('0x1c')][_0xe095('0x1e')]);return _0x4bd56f(_0x4e336c[_0xe095('0x1c')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x50aba3,'request\x20sent');_0x4bd56f(_0x4e336c[_0xe095('0x1f')][_0xe095('0x1e')]);}})['catch'](function(_0x495a30){logger[_0xe095('0x1c')](_0xe095('0x1d'),_0x50aba3,_0x495a30);_0x386482(_0x495a30);});});}function respondWithStatusCode(_0x31518e,_0x3d458e){_0x3d458e=_0x3d458e||0xcc;return function(_0x14f9db){if(_0x14f9db){return _0x31518e[_0xe095('0x20')](_0x3d458e);}return _0x31518e[_0xe095('0x21')](_0x3d458e)[_0xe095('0x22')]();};}function respondWithResult(_0x26f938,_0x55cc7a){_0x55cc7a=_0x55cc7a||0xc8;return function(_0x258f6e){if(_0x258f6e){return _0x26f938[_0xe095('0x21')](_0x55cc7a)[_0xe095('0x23')](_0x258f6e);}};}function respondWithFilteredResult(_0x45f46b,_0x446937){return function(_0xd0384b){if(_0xd0384b){var _0x2be05c=typeof _0x446937[_0xe095('0x24')]===_0xe095('0x25')&&typeof _0x446937['limit']===_0xe095('0x25');var _0x2d3509=_0xd0384b[_0xe095('0x26')];var _0x404b59=_0x2be05c?0x0:_0x446937['offset'];var _0xbee26e=_0x2be05c?_0xd0384b[_0xe095('0x26')]:_0x446937['offset']+_0x446937[_0xe095('0x27')];var _0x1064d2;if(_0xbee26e>=_0x2d3509){_0xbee26e=_0x2d3509;_0x1064d2=0xc8;}else{_0x1064d2=0xce;}_0x45f46b[_0xe095('0x21')](_0x1064d2);return _0x45f46b['set']('Content-Range',_0x404b59+'-'+_0xbee26e+'/'+_0x2d3509)[_0xe095('0x23')](_0xd0384b);}return null;};}function patchUpdates(_0x9978a3){return function(_0x134e1d){try{jsonpatch[_0xe095('0x28')](_0x134e1d,_0x9978a3,!![]);}catch(_0x1a6e6c){return BPromise[_0xe095('0x29')](_0x1a6e6c);}return _0x134e1d[_0xe095('0x2a')]();};}function saveUpdates(_0x240e57,_0x43e23c){return function(_0x2550c7){if(_0x2550c7){return _0x2550c7[_0xe095('0x2b')](_0x240e57)[_0xe095('0x2c')](function(_0x354c08){return _0x354c08;});}return null;};}function removeEntity(_0x3234b2,_0x572869){return function(_0x26dc29){if(_0x26dc29){return _0x26dc29[_0xe095('0x2d')]()[_0xe095('0x2c')](function(){var _0x39e954=_0x26dc29['get']({'plain':!![]});var _0xfb2477=_0xe095('0x2e');return db['UserProfileResource'][_0xe095('0x2d')]({'where':{'type':_0xfb2477,'resourceId':_0x39e954['id']}})[_0xe095('0x2c')](function(){return _0x26dc29;});})[_0xe095('0x2c')](function(){_0x3234b2[_0xe095('0x21')](0xcc)[_0xe095('0x22')]();});}};}function handleEntityNotFound(_0x12e6bb,_0x57d5fd){return function(_0x16a9e6){if(!_0x16a9e6){_0x12e6bb[_0xe095('0x20')](0x194);}return _0x16a9e6;};}function handleError(_0xcc8029,_0x94c488){_0x94c488=_0x94c488||0x1f4;return function(_0x4668f8){logger[_0xe095('0x1c')](_0x4668f8[_0xe095('0x2f')]);if(_0x4668f8[_0xe095('0x30')]){delete _0x4668f8['name'];}_0xcc8029[_0xe095('0x21')](_0x94c488)['send'](_0x4668f8);};}exports[_0xe095('0x31')]=function(_0x238ba5,_0xee1229){var _0x5af4a6={},_0x1a5cf2={},_0x1de742={'count':0x0,'rows':[]};var _0x221a33=_[_0xe095('0x32')](db[_0xe095('0x33')][_0xe095('0x34')],function(_0x159566){return{'name':_0x159566[_0xe095('0x35')],'type':_0x159566[_0xe095('0x36')][_0xe095('0x37')]};});_0x1a5cf2[_0xe095('0x38')]=_['map'](_0x221a33,_0xe095('0x30'));_0x1a5cf2[_0xe095('0x39')]=_[_0xe095('0x3a')](_0x238ba5[_0xe095('0x39')]);_0x1a5cf2[_0xe095('0x3b')]=_['intersection'](_0x1a5cf2[_0xe095('0x38')],_0x1a5cf2[_0xe095('0x39')]);_0x5af4a6[_0xe095('0x3c')]=_[_0xe095('0x3d')](_0x1a5cf2[_0xe095('0x38')],qs['fields'](_0x238ba5['query']['fields']));_0x5af4a6[_0xe095('0x3c')]=_0x5af4a6[_0xe095('0x3c')][_0xe095('0x3e')]?_0x5af4a6[_0xe095('0x3c')]:_0x1a5cf2['model'];if(!_0x238ba5[_0xe095('0x39')][_0xe095('0x3f')](_0xe095('0x40'))){_0x5af4a6[_0xe095('0x27')]=qs[_0xe095('0x27')](_0x238ba5[_0xe095('0x39')][_0xe095('0x27')]);_0x5af4a6[_0xe095('0x24')]=qs[_0xe095('0x24')](_0x238ba5['query'][_0xe095('0x24')]);}_0x5af4a6[_0xe095('0x41')]=qs[_0xe095('0x42')](_0x238ba5[_0xe095('0x39')]['sort']);_0x5af4a6[_0xe095('0x43')]=qs['filters'](_['pick'](_0x238ba5[_0xe095('0x39')],_0x1a5cf2[_0xe095('0x3b')]),_0x221a33);if(_0x238ba5[_0xe095('0x39')]['filter']){_0x5af4a6['where']=_['merge'](_0x5af4a6['where'],{'$or':_[_0xe095('0x32')](_0x221a33,function(_0x271519){if(_0x271519[_0xe095('0x36')]!=='VIRTUAL'){var _0x4f2c19={};_0x4f2c19[_0x271519[_0xe095('0x30')]]={'$like':'%'+_0x238ba5[_0xe095('0x39')][_0xe095('0x44')]+'%'};return _0x4f2c19;}})});}_0x5af4a6=_['merge']({},_0x5af4a6,_0x238ba5[_0xe095('0x45')]);var _0x1b236a={'where':_0x5af4a6[_0xe095('0x43')]};return db[_0xe095('0x33')][_0xe095('0x26')](_0x1b236a)['then'](function(_0x5ac1a6){_0x1de742[_0xe095('0x26')]=_0x5ac1a6;if(_0x238ba5[_0xe095('0x39')][_0xe095('0x46')]){_0x5af4a6[_0xe095('0x47')]=[{'all':!![]}];}return db[_0xe095('0x33')]['findAll'](_0x5af4a6);})['then'](function(_0x2f64ab){_0x1de742[_0xe095('0x48')]=_0x2f64ab;return _0x1de742;})[_0xe095('0x2c')](respondWithFilteredResult(_0xee1229,_0x5af4a6))[_0xe095('0x49')](handleError(_0xee1229,null));};exports[_0xe095('0x4a')]=function(_0x122ff3,_0x1864cd){var _0x3a8780={'raw':![],'where':{'id':_0x122ff3[_0xe095('0x4b')]['id']}},_0x3fdaa4={};_0x3fdaa4[_0xe095('0x38')]=_[_0xe095('0x3a')](db['VoiceContext'][_0xe095('0x34')]);_0x3fdaa4[_0xe095('0x39')]=_['keys'](_0x122ff3[_0xe095('0x39')]);_0x3fdaa4['filters']=_[_0xe095('0x3d')](_0x3fdaa4['model'],_0x3fdaa4[_0xe095('0x39')]);_0x3a8780['attributes']=_[_0xe095('0x3d')](_0x3fdaa4['model'],qs[_0xe095('0x4c')](_0x122ff3[_0xe095('0x39')][_0xe095('0x4c')]));_0x3a8780['attributes']=_0x3a8780[_0xe095('0x3c')]['length']?_0x3a8780[_0xe095('0x3c')]:_0x3fdaa4[_0xe095('0x38')];if(_0x122ff3[_0xe095('0x39')]['includeAll']){_0x3a8780['include']=[{'all':!![]}];}_0x3a8780=_[_0xe095('0x4d')]({},_0x3a8780,_0x122ff3[_0xe095('0x45')]);return db[_0xe095('0x33')][_0xe095('0x4e')](_0x3a8780)[_0xe095('0x2c')](handleEntityNotFound(_0x1864cd,null))[_0xe095('0x2c')](respondWithResult(_0x1864cd,null))[_0xe095('0x49')](handleError(_0x1864cd,null));};exports[_0xe095('0x4f')]=function(_0x66e31c,_0x4a150a,_0x3a0fd3){var _0x811321;return db[_0xe095('0x33')]['create'](_0x66e31c['body'],{'raw':!![]})[_0xe095('0x2c')](function(_0xbaa868){_0x811321=_0xbaa868;return db[_0xe095('0x33')]['findAll']({'raw':!![]});})[_0xe095('0x2c')](function(_0x24b2a1){var _0x5f3f57=fs[_0xe095('0x50')](path['join'](config[_0xe095('0x51')],_0xe095('0x52')),'utf8');var _0x5a34e7=ejs[_0xe095('0x53')](_0x5f3f57,{'contexts':_0x24b2a1||[]});fs[_0xe095('0x54')](_0xe095('0x55'),_0x5a34e7);})[_0xe095('0x2c')](function(){return respondWithRpcPromise(_0xe095('0x56'),_0xe095('0x4f'),{'module':_0xe095('0x57')});})[_0xe095('0x2c')](function(){var _0x5c2528=_0x66e31c[_0xe095('0x58')][_0xe095('0x59')]({'plain':!![]});if(!_0x5c2528)throw new Error(_0xe095('0x5a'));if(_0x5c2528['role']===_0xe095('0x58')){var _0xe32bed=_0x811321[_0xe095('0x59')]({'plain':!![]});return db[_0xe095('0x5b')][_0xe095('0x4e')]({'where':{'name':_0xe095('0x2e'),'userProfileId':_0x5c2528[_0xe095('0x5c')]},'raw':!![]})[_0xe095('0x2c')](function(_0x3b5200){if(_0x3b5200&&_0x3b5200[_0xe095('0x5d')]===0x0){return db['UserProfileResource'][_0xe095('0x4f')]({'name':_0xe32bed[_0xe095('0x30')],'resourceId':_0xe32bed['id'],'type':_0x3b5200['name'],'sectionId':_0x3b5200['id']},{})[_0xe095('0x2c')](function(){return _0x811321;});}else{return _0x811321;}})[_0xe095('0x49')](function(_0x52f6f7){logger[_0xe095('0x1c')](_0xe095('0x5e'),_0x52f6f7);throw _0x52f6f7;});}return _0x811321;})[_0xe095('0x2c')](respondWithResult(_0x4a150a,0xc9))['catch'](handleError(_0x4a150a,null));};exports[_0xe095('0x2b')]=function(_0x201064,_0x3c46ee,_0x4afaae){var _0x20712c;return db[_0xe095('0x33')][_0xe095('0x4e')]({'where':{'id':_0x201064[_0xe095('0x4b')]['id']}})[_0xe095('0x2c')](handleEntityNotFound(_0x3c46ee,null))[_0xe095('0x2c')](saveUpdates(_0x201064[_0xe095('0x5f')],null))['then'](function(_0x4a0e3a){if(_0x4a0e3a){_0x20712c=_0x4a0e3a;return db[_0xe095('0x33')][_0xe095('0x60')]({'raw':!![]});}})[_0xe095('0x2c')](function(_0x14941a){var _0x4232d4=fs['readFileSync'](path[_0xe095('0x61')](config[_0xe095('0x51')],'server/files/templates/context.ejs'),_0xe095('0x62'));var _0x55f126=ejs[_0xe095('0x53')](_0x4232d4,{'contexts':_0x14941a||[]});fs[_0xe095('0x54')](_0xe095('0x55'),_0x55f126);})['then'](function(){return respondWithRpcPromise('Reload',_0xe095('0x2b'),{'module':_0xe095('0x57')});})[_0xe095('0x2c')](function(){return _0x20712c;})['then'](respondWithResult(_0x3c46ee,null))[_0xe095('0x49')](handleError(_0x3c46ee,null));};exports[_0xe095('0x2d')]=function(_0x3fe123,_0x1b21a7,_0x1444aa){var _0x3034ad;return db[_0xe095('0x33')][_0xe095('0x4e')]({'where':{'id':_0x3fe123[_0xe095('0x4b')]['id']}})[_0xe095('0x2c')](handleEntityNotFound(_0x1b21a7,null))[_0xe095('0x2c')](removeEntity(_0x1b21a7,null))['then'](function(){return db['VoiceContext'][_0xe095('0x60')]({'raw':!![]});})['then'](function(_0x39a2e5){var _0x4c0282=fs[_0xe095('0x50')](path[_0xe095('0x61')](config[_0xe095('0x51')],_0xe095('0x52')),_0xe095('0x62'));var _0x2d2c61=ejs['render'](_0x4c0282,{'contexts':_0x39a2e5});fs[_0xe095('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2d2c61);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0xe095('0x49')](handleError(_0x1b21a7,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 8c27f47..969a927 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 _0xdb7a=['path','rimraf','../../config/environment','exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x287396,_0x2af577){var _0x42193a=function(_0x589d4a){while(--_0x589d4a){_0x287396['push'](_0x287396['shift']());}};_0x42193a(++_0x2af577);}(_0xdb7a,0xae));var _0xadb7=function(_0x3b84d5,_0xd86e10){_0x3b84d5=_0x3b84d5-0x0;var _0x50a084=_0xdb7a[_0x3b84d5];return _0x50a084;};'use strict';var _=require(_0xadb7('0x0'));var util=require(_0xadb7('0x1'));var logger=require(_0xadb7('0x2'))(_0xadb7('0x3'));var moment=require('moment');var BPromise=require(_0xadb7('0x4'));var rp=require(_0xadb7('0x5'));var fs=require('fs');var path=require(_0xadb7('0x6'));var rimraf=require(_0xadb7('0x7'));var config=require(_0xadb7('0x8'));var attributes=require('./voiceContext.attributes');module[_0xadb7('0x9')]=function(_0x57fc27,_0x481258){return _0x57fc27[_0xadb7('0xa')](_0xadb7('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdc0=['VoiceContext','voice_contexts','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x489ddb,_0x366e91){var _0x2e99a8=function(_0x1220ea){while(--_0x1220ea){_0x489ddb['push'](_0x489ddb['shift']());}};_0x2e99a8(++_0x366e91);}(_0xcdc0,0x84));var _0x0cdc=function(_0x4a4d0b,_0x229b67){_0x4a4d0b=_0x4a4d0b-0x0;var _0x27a139=_0xcdc0[_0x4a4d0b];return _0x27a139;};'use strict';var _=require('lodash');var util=require(_0x0cdc('0x0'));var logger=require(_0x0cdc('0x1'))('api');var moment=require(_0x0cdc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cdc('0x3'));var rimraf=require(_0x0cdc('0x4'));var config=require(_0x0cdc('0x5'));var attributes=require(_0x0cdc('0x6'));module[_0x0cdc('0x7')]=function(_0x1dbfeb,_0x9b5ed4){return _0x1dbfeb['define'](_0x0cdc('0x8'),attributes,{'tableName':_0x0cdc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index ed91318..ea8f12b 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 _0x263f=['client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x263f,0x182));var _0xf263=function(_0x44944f,_0x4fd215){_0x44944f=_0x44944f-0x0;var _0x55dc83=_0x263f[_0x44944f];return _0x55dc83;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});} \ No newline at end of file +var _0x205d=['VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5881be,_0x5edf5d){var _0x8e63bf=function(_0x4dd2b2){while(--_0x4dd2b2){_0x5881be['push'](_0x5881be['shift']());}};_0x8e63bf(++_0x5edf5d);}(_0x205d,0xf6));var _0xd205=function(_0x64b31d,_0x393b36){_0x64b31d=_0x64b31d-0x0;var _0x42c45b=_0x205d[_0x64b31d];return _0x42c45b;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var moment=require(_0xd205('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd205('0x3'));var db=require(_0xd205('0x4'))['db'];var utils=require(_0xd205('0x5'));var logger=require('../../config/logger')(_0xd205('0x6'));var config=require(_0xd205('0x7'));var jayson=require(_0xd205('0x8'));var client=jayson[_0xd205('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2614e7,_0x2b6078,_0xdb99a8){return new BPromise(function(_0x372211,_0x3ce946){return client[_0xd205('0xa')](_0x2614e7,_0xdb99a8)[_0xd205('0xb')](function(_0x1cd484){logger[_0xd205('0xc')]('VoiceContext,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));logger[_0xd205('0xe')](_0xd205('0xf'),_0x2b6078,_0xd205('0xd'),JSON['stringify'](_0x1cd484));if(_0x1cd484[_0xd205('0x10')]){if(_0x1cd484[_0xd205('0x10')][_0xd205('0x11')]===0x1f4){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484[_0xd205('0x10')][_0xd205('0x13')]);return _0x3ce946(_0x1cd484['error'][_0xd205('0x13')]);}logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484['error']['message']);return _0x372211(_0x1cd484[_0xd205('0x10')]['message']);}else{logger[_0xd205('0xc')]('VoiceContext,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));_0x372211(_0x1cd484[_0xd205('0x14')][_0xd205('0x13')]);}})[_0xd205('0x15')](function(_0x57201a){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x57201a);_0x3ce946(_0x57201a);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 80d0e29..3626dae 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 _0x0fd5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x0fd5,0x1e6));var _0x50fd=function(_0x2c6729,_0x54ed3e){_0x2c6729=_0x2c6729-0x0;var _0xa6199d=_0x0fd5[_0x2c6729];return _0xa6199d;};'use strict';var multer=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var path=require(_0x50fd('0x2'));var timeout=require(_0x50fd('0x3'));var express=require(_0x50fd('0x4'));var router=express[_0x50fd('0x5')]();var fs_extra=require(_0x50fd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50fd('0x7'));var config=require(_0x50fd('0x8'));var controller=require(_0x50fd('0x9'));router[_0x50fd('0xa')]('/',auth[_0x50fd('0xb')](),controller[_0x50fd('0xc')]);router[_0x50fd('0xa')]('/describe',auth[_0x50fd('0xb')](),controller[_0x50fd('0xd')]);router[_0x50fd('0xa')](_0x50fd('0xe'),auth[_0x50fd('0xb')](),controller[_0x50fd('0xf')]);router[_0x50fd('0x10')]('/',auth[_0x50fd('0xb')](),controller['create']);router['put'](_0x50fd('0xe'),auth[_0x50fd('0xb')](),controller[_0x50fd('0x11')]);router[_0x50fd('0x12')](_0x50fd('0xe'),auth[_0x50fd('0xb')](),controller[_0x50fd('0x13')]);module[_0x50fd('0x14')]=router; \ No newline at end of file +var _0x8a9a=['./voiceDialReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x8a9a,0x193));var _0xa8a9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x8a9a[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa8a9('0x0'));var timeout=require(_0xa8a9('0x1'));var express=require(_0xa8a9('0x2'));var router=express['Router']();var fs_extra=require(_0xa8a9('0x3'));var auth=require(_0xa8a9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa8a9('0x5'));router[_0xa8a9('0x6')]('/',auth[_0xa8a9('0x7')](),controller[_0xa8a9('0x8')]);router[_0xa8a9('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xa8a9('0x9')]);router[_0xa8a9('0x6')](_0xa8a9('0xa'),auth[_0xa8a9('0x7')](),controller[_0xa8a9('0xb')]);router[_0xa8a9('0xc')]('/',auth[_0xa8a9('0x7')](),controller['create']);router[_0xa8a9('0xd')]('/:id',auth[_0xa8a9('0x7')](),controller['update']);router[_0xa8a9('0xe')](_0xa8a9('0xa'),auth[_0xa8a9('0x7')](),controller[_0xa8a9('0xf')]);module[_0xa8a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8ce2d5b..7d1ac9c 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 _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x52d543,_0x4982e1){var _0x572ca0=function(_0x4af633){while(--_0x4af633){_0x52d543['push'](_0x52d543['shift']());}};_0x572ca0(++_0x4982e1);}(_0x81bd,0x7c));var _0xd81b=function(_0x3a1b35,_0x43f746){_0x3a1b35=_0x3a1b35-0x0;var _0x27fd53=_0x81bd[_0x3a1b35];return _0x27fd53;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file +var _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0xa087f5,_0x34fd10){var _0x4c8806=function(_0x4b1cfe){while(--_0x4b1cfe){_0xa087f5['push'](_0xa087f5['shift']());}};_0x4c8806(++_0x34fd10);}(_0x84ab,0x12f));var _0xb84a=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x84ab[_0x12b8ec];return _0x21af77;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ff35785..a3f151e 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 _0x1214=['findAll','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../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','stack','name','send','index','map','VoiceDialReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x1214,0x9f));var _0x4121=function(_0x201490,_0x235e70){_0x201490=_0x201490-0x0;var _0x1479df=_0x1214[_0x201490];return _0x1479df;};'use strict';var emlformat=require(_0x4121('0x0'));var rimraf=require(_0x4121('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4121('0x2'));var rp=require(_0x4121('0x3'));var moment=require('moment');var BPromise=require(_0x4121('0x4'));var Mustache=require(_0x4121('0x5'));var util=require(_0x4121('0x6'));var path=require(_0x4121('0x7'));var sox=require('sox');var csv=require(_0x4121('0x8'));var ejs=require(_0x4121('0x9'));var fs=require('fs');var fs_extra=require(_0x4121('0xa'));var _=require(_0x4121('0xb'));var squel=require(_0x4121('0xc'));var crypto=require(_0x4121('0xd'));var jsforce=require(_0x4121('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4121('0x8'));var querystring=require(_0x4121('0xf'));var Papa=require(_0x4121('0x10'));var Redis=require(_0x4121('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4121('0x12'));var as=require(_0x4121('0x13'));var hardwareService=require(_0x4121('0x14'));var logger=require('../../config/logger')(_0x4121('0x15'));var utils=require(_0x4121('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4121('0x17'));var db=require(_0x4121('0x18'))['db'];function respondWithStatusCode(_0x23d295,_0x36806e){_0x36806e=_0x36806e||0xcc;return function(_0x62d113){if(_0x62d113){return _0x23d295[_0x4121('0x19')](_0x36806e);}return _0x23d295[_0x4121('0x1a')](_0x36806e)[_0x4121('0x1b')]();};}function respondWithResult(_0x5a0070,_0x578417){_0x578417=_0x578417||0xc8;return function(_0x5bb651){if(_0x5bb651){return _0x5a0070['status'](_0x578417)[_0x4121('0x1c')](_0x5bb651);}};}function respondWithFilteredResult(_0x2dcf5e,_0x1f2ff8){return function(_0x1440af){if(_0x1440af){var _0x561e91=typeof _0x1f2ff8[_0x4121('0x1d')]===_0x4121('0x1e')&&typeof _0x1f2ff8[_0x4121('0x1f')]===_0x4121('0x1e');var _0x59b80f=_0x1440af[_0x4121('0x20')];var _0x5decb3=_0x561e91?0x0:_0x1f2ff8['offset'];var _0x69702d=_0x561e91?_0x1440af[_0x4121('0x20')]:_0x1f2ff8[_0x4121('0x1d')]+_0x1f2ff8[_0x4121('0x1f')];var _0x528b9b;if(_0x69702d>=_0x59b80f){_0x69702d=_0x59b80f;_0x528b9b=0xc8;}else{_0x528b9b=0xce;}_0x2dcf5e['status'](_0x528b9b);return _0x2dcf5e[_0x4121('0x21')](_0x4121('0x22'),_0x5decb3+'-'+_0x69702d+'/'+_0x59b80f)['json'](_0x1440af);}return null;};}function patchUpdates(_0x138f9d){return function(_0x4846ed){try{jsonpatch['apply'](_0x4846ed,_0x138f9d,!![]);}catch(_0x628057){return BPromise['reject'](_0x628057);}return _0x4846ed[_0x4121('0x23')]();};}function saveUpdates(_0x2586b3,_0x3d9ca3){return function(_0x4b297e){if(_0x4b297e){return _0x4b297e['update'](_0x2586b3)[_0x4121('0x24')](function(_0x5c5016){return _0x5c5016;});}return null;};}function removeEntity(_0x4e8fe8,_0x16e1cb){return function(_0x472761){if(_0x472761){return _0x472761['destroy']()[_0x4121('0x24')](function(){_0x4e8fe8[_0x4121('0x1a')](0xcc)[_0x4121('0x1b')]();});}};}function handleEntityNotFound(_0x5c7395,_0x444351){return function(_0x3e4427){if(!_0x3e4427){_0x5c7395['sendStatus'](0x194);}return _0x3e4427;};}function handleError(_0x54ef79,_0x5e9900){_0x5e9900=_0x5e9900||0x1f4;return function(_0xa92c9c){logger['error'](_0xa92c9c[_0x4121('0x25')]);if(_0xa92c9c[_0x4121('0x26')]){delete _0xa92c9c[_0x4121('0x26')];}_0x54ef79[_0x4121('0x1a')](_0x5e9900)[_0x4121('0x27')](_0xa92c9c);};}exports[_0x4121('0x28')]=function(_0x287920,_0x20101f){var _0x26c2f1={},_0x1c3a4f={},_0x3b340a={'count':0x0,'rows':[]};var _0x4f77e5=_[_0x4121('0x29')](db[_0x4121('0x2a')][_0x4121('0x2b')],function(_0x5b0fa6){return{'name':_0x5b0fa6['fieldName'],'type':_0x5b0fa6['type'][_0x4121('0x2c')]};});_0x1c3a4f[_0x4121('0x2d')]=_[_0x4121('0x29')](_0x4f77e5,_0x4121('0x26'));_0x1c3a4f[_0x4121('0x2e')]=_[_0x4121('0x2f')](_0x287920[_0x4121('0x2e')]);_0x1c3a4f['filters']=_[_0x4121('0x30')](_0x1c3a4f[_0x4121('0x2d')],_0x1c3a4f[_0x4121('0x2e')]);_0x26c2f1[_0x4121('0x31')]=_[_0x4121('0x30')](_0x1c3a4f[_0x4121('0x2d')],qs[_0x4121('0x32')](_0x287920[_0x4121('0x2e')][_0x4121('0x32')]));_0x26c2f1[_0x4121('0x31')]=_0x26c2f1[_0x4121('0x31')][_0x4121('0x33')]?_0x26c2f1['attributes']:_0x1c3a4f[_0x4121('0x2d')];if(!_0x287920[_0x4121('0x2e')][_0x4121('0x34')]('nolimit')){_0x26c2f1[_0x4121('0x1f')]=qs['limit'](_0x287920[_0x4121('0x2e')][_0x4121('0x1f')]);_0x26c2f1[_0x4121('0x1d')]=qs[_0x4121('0x1d')](_0x287920['query']['offset']);}_0x26c2f1['order']=qs[_0x4121('0x35')](_0x287920['query'][_0x4121('0x35')]);_0x26c2f1[_0x4121('0x36')]=qs[_0x4121('0x37')](_[_0x4121('0x38')](_0x287920[_0x4121('0x2e')],_0x1c3a4f[_0x4121('0x37')]),_0x4f77e5);if(_0x287920[_0x4121('0x2e')][_0x4121('0x39')]){_0x26c2f1[_0x4121('0x36')]=_[_0x4121('0x3a')](_0x26c2f1[_0x4121('0x36')],{'$or':_[_0x4121('0x29')](_0x4f77e5,function(_0x26c1d5){if(_0x26c1d5[_0x4121('0x3b')]!==_0x4121('0x3c')){var _0x2c21b8={};_0x2c21b8[_0x26c1d5[_0x4121('0x26')]]={'$like':'%'+_0x287920[_0x4121('0x2e')]['filter']+'%'};return _0x2c21b8;}})});}_0x26c2f1=_[_0x4121('0x3a')]({},_0x26c2f1,_0x287920[_0x4121('0x3d')]);var _0x18a664={'where':_0x26c2f1[_0x4121('0x36')]};return db[_0x4121('0x2a')][_0x4121('0x20')](_0x18a664)[_0x4121('0x24')](function(_0x5aec3b){_0x3b340a[_0x4121('0x20')]=_0x5aec3b;if(_0x287920[_0x4121('0x2e')][_0x4121('0x3e')]){_0x26c2f1['include']=[{'all':!![]}];}return db[_0x4121('0x2a')][_0x4121('0x3f')](_0x26c2f1);})['then'](function(_0x4d496b){_0x3b340a[_0x4121('0x40')]=_0x4d496b;return _0x3b340a;})['then'](respondWithFilteredResult(_0x20101f,_0x26c2f1))[_0x4121('0x41')](handleError(_0x20101f,null));};exports[_0x4121('0x42')]=function(_0xdd98a4,_0x49eaa7){var _0x5a9d16={'raw':!![],'where':{'id':_0xdd98a4[_0x4121('0x43')]['id']}},_0xd58323={};_0xd58323[_0x4121('0x2d')]=_[_0x4121('0x2f')](db['VoiceDialReport']['rawAttributes']);_0xd58323['query']=_[_0x4121('0x2f')](_0xdd98a4[_0x4121('0x2e')]);_0xd58323[_0x4121('0x37')]=_['intersection'](_0xd58323[_0x4121('0x2d')],_0xd58323[_0x4121('0x2e')]);_0x5a9d16[_0x4121('0x31')]=_['intersection'](_0xd58323[_0x4121('0x2d')],qs[_0x4121('0x32')](_0xdd98a4[_0x4121('0x2e')]['fields']));_0x5a9d16[_0x4121('0x31')]=_0x5a9d16[_0x4121('0x31')][_0x4121('0x33')]?_0x5a9d16[_0x4121('0x31')]:_0xd58323[_0x4121('0x2d')];if(_0xdd98a4[_0x4121('0x2e')]['includeAll']){_0x5a9d16['include']=[{'all':!![]}];}_0x5a9d16=_[_0x4121('0x3a')]({},_0x5a9d16,_0xdd98a4[_0x4121('0x3d')]);return db['VoiceDialReport'][_0x4121('0x44')](_0x5a9d16)[_0x4121('0x24')](handleEntityNotFound(_0x49eaa7,null))[_0x4121('0x24')](respondWithResult(_0x49eaa7,null))[_0x4121('0x41')](handleError(_0x49eaa7,null));};exports['create']=function(_0x178dd2,_0x2294f5){return db[_0x4121('0x2a')][_0x4121('0x45')](_0x178dd2[_0x4121('0x46')],{})['then'](respondWithResult(_0x2294f5,0xc9))[_0x4121('0x41')](handleError(_0x2294f5,null));};exports[_0x4121('0x47')]=function(_0x278bb7,_0x101cd3){if(_0x278bb7['body']['id']){delete _0x278bb7[_0x4121('0x46')]['id'];}return db[_0x4121('0x2a')]['find']({'where':{'id':_0x278bb7[_0x4121('0x43')]['id']}})[_0x4121('0x24')](handleEntityNotFound(_0x101cd3,null))[_0x4121('0x24')](saveUpdates(_0x278bb7[_0x4121('0x46')],null))['then'](respondWithResult(_0x101cd3,null))[_0x4121('0x41')](handleError(_0x101cd3,null));};exports[_0x4121('0x48')]=function(_0x46076d,_0x325504){return db[_0x4121('0x2a')][_0x4121('0x44')]({'where':{'id':_0x46076d['params']['id']}})['then'](handleEntityNotFound(_0x325504,null))[_0x4121('0x24')](removeEntity(_0x325504,null))[_0x4121('0x41')](handleError(_0x325504,null));};exports[_0x4121('0x49')]=function(_0x4529a0,_0x372295){return db[_0x4121('0x2a')][_0x4121('0x49')]()['then'](respondWithResult(_0x372295,null))[_0x4121('0x41')](handleError(_0x372295,null));}; \ No newline at end of file +var _0x1a93=['filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','error','stack','name','send','index','VoiceDialReport','rawAttributes','type','key','map','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3f1688,_0x34b8ad){var _0x5390e8=function(_0x2a5a3b){while(--_0x2a5a3b){_0x3f1688['push'](_0x3f1688['shift']());}};_0x5390e8(++_0x34b8ad);}(_0x1a93,0x19b));var _0x31a9=function(_0x38112a,_0xff3a91){_0x38112a=_0x38112a-0x0;var _0x300f48=_0x1a93[_0x38112a];return _0x300f48;};'use strict';var emlformat=require(_0x31a9('0x0'));var rimraf=require(_0x31a9('0x1'));var zipdir=require(_0x31a9('0x2'));var jsonpatch=require(_0x31a9('0x3'));var rp=require(_0x31a9('0x4'));var moment=require(_0x31a9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31a9('0x6'));var util=require(_0x31a9('0x7'));var path=require(_0x31a9('0x8'));var sox=require(_0x31a9('0x9'));var csv=require(_0x31a9('0xa'));var ejs=require(_0x31a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31a9('0xc'));var squel=require(_0x31a9('0xd'));var crypto=require(_0x31a9('0xe'));var jsforce=require(_0x31a9('0xf'));var deskjs=require(_0x31a9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31a9('0x11'));var Papa=require(_0x31a9('0x12'));var Redis=require(_0x31a9('0x13'));var authService=require(_0x31a9('0x14'));var qs=require(_0x31a9('0x15'));var as=require(_0x31a9('0x16'));var hardwareService=require(_0x31a9('0x17'));var logger=require(_0x31a9('0x18'))(_0x31a9('0x19'));var utils=require(_0x31a9('0x1a'));var config=require(_0x31a9('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x31a9('0x1c'))['db'];function respondWithStatusCode(_0x63f9f4,_0x14686d){_0x14686d=_0x14686d||0xcc;return function(_0x12daca){if(_0x12daca){return _0x63f9f4[_0x31a9('0x1d')](_0x14686d);}return _0x63f9f4[_0x31a9('0x1e')](_0x14686d)['end']();};}function respondWithResult(_0x29f072,_0x33ef2d){_0x33ef2d=_0x33ef2d||0xc8;return function(_0x38e297){if(_0x38e297){return _0x29f072[_0x31a9('0x1e')](_0x33ef2d)[_0x31a9('0x1f')](_0x38e297);}};}function respondWithFilteredResult(_0x327700,_0xac3268){return function(_0x7ec206){if(_0x7ec206){var _0x2aafc0=typeof _0xac3268[_0x31a9('0x20')]==='undefined'&&typeof _0xac3268[_0x31a9('0x21')]===_0x31a9('0x22');var _0x1eaad2=_0x7ec206[_0x31a9('0x23')];var _0x1934c7=_0x2aafc0?0x0:_0xac3268['offset'];var _0x56763b=_0x2aafc0?_0x7ec206['count']:_0xac3268[_0x31a9('0x20')]+_0xac3268[_0x31a9('0x21')];var _0x3fb560;if(_0x56763b>=_0x1eaad2){_0x56763b=_0x1eaad2;_0x3fb560=0xc8;}else{_0x3fb560=0xce;}_0x327700[_0x31a9('0x1e')](_0x3fb560);return _0x327700[_0x31a9('0x24')](_0x31a9('0x25'),_0x1934c7+'-'+_0x56763b+'/'+_0x1eaad2)[_0x31a9('0x1f')](_0x7ec206);}return null;};}function patchUpdates(_0x54d0df){return function(_0x1f4267){try{jsonpatch[_0x31a9('0x26')](_0x1f4267,_0x54d0df,!![]);}catch(_0xfca14b){return BPromise[_0x31a9('0x27')](_0xfca14b);}return _0x1f4267['save']();};}function saveUpdates(_0x5c7aa4,_0x3df890){return function(_0x8ae881){if(_0x8ae881){return _0x8ae881['update'](_0x5c7aa4)['then'](function(_0x205bb5){return _0x205bb5;});}return null;};}function removeEntity(_0x3522f9,_0x28308c){return function(_0x52d210){if(_0x52d210){return _0x52d210['destroy']()[_0x31a9('0x28')](function(){_0x3522f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13059c,_0x262beb){return function(_0x3a0c04){if(!_0x3a0c04){_0x13059c[_0x31a9('0x1d')](0x194);}return _0x3a0c04;};}function handleError(_0x52be62,_0x1147eb){_0x1147eb=_0x1147eb||0x1f4;return function(_0x280f2d){logger[_0x31a9('0x29')](_0x280f2d[_0x31a9('0x2a')]);if(_0x280f2d[_0x31a9('0x2b')]){delete _0x280f2d[_0x31a9('0x2b')];}_0x52be62['status'](_0x1147eb)[_0x31a9('0x2c')](_0x280f2d);};}exports[_0x31a9('0x2d')]=function(_0x468ac0,_0x1a70e7){var _0xd45627={},_0x333e36={},_0x57a565={'count':0x0,'rows':[]};var _0x1bb6fa=_['map'](db[_0x31a9('0x2e')][_0x31a9('0x2f')],function(_0x457e06){return{'name':_0x457e06['fieldName'],'type':_0x457e06[_0x31a9('0x30')][_0x31a9('0x31')]};});_0x333e36['model']=_[_0x31a9('0x32')](_0x1bb6fa,_0x31a9('0x2b'));_0x333e36[_0x31a9('0x33')]=_['keys'](_0x468ac0[_0x31a9('0x33')]);_0x333e36[_0x31a9('0x34')]=_[_0x31a9('0x35')](_0x333e36['model'],_0x333e36[_0x31a9('0x33')]);_0xd45627[_0x31a9('0x36')]=_[_0x31a9('0x35')](_0x333e36['model'],qs[_0x31a9('0x37')](_0x468ac0[_0x31a9('0x33')]['fields']));_0xd45627[_0x31a9('0x36')]=_0xd45627[_0x31a9('0x36')][_0x31a9('0x38')]?_0xd45627[_0x31a9('0x36')]:_0x333e36[_0x31a9('0x39')];if(!_0x468ac0['query'][_0x31a9('0x3a')](_0x31a9('0x3b'))){_0xd45627[_0x31a9('0x21')]=qs[_0x31a9('0x21')](_0x468ac0[_0x31a9('0x33')]['limit']);_0xd45627['offset']=qs[_0x31a9('0x20')](_0x468ac0[_0x31a9('0x33')][_0x31a9('0x20')]);}_0xd45627[_0x31a9('0x3c')]=qs[_0x31a9('0x3d')](_0x468ac0[_0x31a9('0x33')][_0x31a9('0x3d')]);_0xd45627[_0x31a9('0x3e')]=qs[_0x31a9('0x34')](_['pick'](_0x468ac0[_0x31a9('0x33')],_0x333e36[_0x31a9('0x34')]),_0x1bb6fa);if(_0x468ac0[_0x31a9('0x33')][_0x31a9('0x3f')]){_0xd45627['where']=_[_0x31a9('0x40')](_0xd45627[_0x31a9('0x3e')],{'$or':_['map'](_0x1bb6fa,function(_0x34f1bb){if(_0x34f1bb[_0x31a9('0x30')]!=='VIRTUAL'){var _0x5960b4={};_0x5960b4[_0x34f1bb['name']]={'$like':'%'+_0x468ac0[_0x31a9('0x33')][_0x31a9('0x3f')]+'%'};return _0x5960b4;}})});}_0xd45627=_[_0x31a9('0x40')]({},_0xd45627,_0x468ac0['options']);var _0x876c3b={'where':_0xd45627[_0x31a9('0x3e')]};return db[_0x31a9('0x2e')][_0x31a9('0x23')](_0x876c3b)[_0x31a9('0x28')](function(_0x32262a){_0x57a565[_0x31a9('0x23')]=_0x32262a;if(_0x468ac0[_0x31a9('0x33')]['includeAll']){_0xd45627[_0x31a9('0x41')]=[{'all':!![]}];}return db[_0x31a9('0x2e')][_0x31a9('0x42')](_0xd45627);})['then'](function(_0x4d9e09){_0x57a565[_0x31a9('0x43')]=_0x4d9e09;return _0x57a565;})[_0x31a9('0x28')](respondWithFilteredResult(_0x1a70e7,_0xd45627))[_0x31a9('0x44')](handleError(_0x1a70e7,null));};exports[_0x31a9('0x45')]=function(_0x2986de,_0x1f2c04){var _0xa36c25={'raw':!![],'where':{'id':_0x2986de[_0x31a9('0x46')]['id']}},_0x5ec11e={};_0x5ec11e['model']=_['keys'](db[_0x31a9('0x2e')][_0x31a9('0x2f')]);_0x5ec11e[_0x31a9('0x33')]=_[_0x31a9('0x47')](_0x2986de[_0x31a9('0x33')]);_0x5ec11e['filters']=_[_0x31a9('0x35')](_0x5ec11e[_0x31a9('0x39')],_0x5ec11e[_0x31a9('0x33')]);_0xa36c25[_0x31a9('0x36')]=_[_0x31a9('0x35')](_0x5ec11e[_0x31a9('0x39')],qs[_0x31a9('0x37')](_0x2986de['query'][_0x31a9('0x37')]));_0xa36c25[_0x31a9('0x36')]=_0xa36c25[_0x31a9('0x36')][_0x31a9('0x38')]?_0xa36c25[_0x31a9('0x36')]:_0x5ec11e['model'];if(_0x2986de[_0x31a9('0x33')][_0x31a9('0x48')]){_0xa36c25[_0x31a9('0x41')]=[{'all':!![]}];}_0xa36c25=_[_0x31a9('0x40')]({},_0xa36c25,_0x2986de[_0x31a9('0x49')]);return db[_0x31a9('0x2e')][_0x31a9('0x4a')](_0xa36c25)[_0x31a9('0x28')](handleEntityNotFound(_0x1f2c04,null))[_0x31a9('0x28')](respondWithResult(_0x1f2c04,null))[_0x31a9('0x44')](handleError(_0x1f2c04,null));};exports[_0x31a9('0x4b')]=function(_0x39991f,_0x137285){return db['VoiceDialReport'][_0x31a9('0x4b')](_0x39991f[_0x31a9('0x4c')],{})[_0x31a9('0x28')](respondWithResult(_0x137285,0xc9))[_0x31a9('0x44')](handleError(_0x137285,null));};exports['update']=function(_0x252a6e,_0x1c5f55){if(_0x252a6e[_0x31a9('0x4c')]['id']){delete _0x252a6e[_0x31a9('0x4c')]['id'];}return db[_0x31a9('0x2e')][_0x31a9('0x4a')]({'where':{'id':_0x252a6e[_0x31a9('0x46')]['id']}})[_0x31a9('0x28')](handleEntityNotFound(_0x1c5f55,null))[_0x31a9('0x28')](saveUpdates(_0x252a6e['body'],null))[_0x31a9('0x28')](respondWithResult(_0x1c5f55,null))[_0x31a9('0x44')](handleError(_0x1c5f55,null));};exports[_0x31a9('0x4d')]=function(_0x1354fa,_0x1fc09a){return db[_0x31a9('0x2e')][_0x31a9('0x4a')]({'where':{'id':_0x1354fa['params']['id']}})[_0x31a9('0x28')](handleEntityNotFound(_0x1fc09a,null))['then'](removeEntity(_0x1fc09a,null))[_0x31a9('0x44')](handleError(_0x1fc09a,null));};exports[_0x31a9('0x4e')]=function(_0x3f6c42,_0x38fbd3){return db[_0x31a9('0x2e')][_0x31a9('0x4e')]()['then'](respondWithResult(_0x38fbd3,null))[_0x31a9('0x44')](handleError(_0x38fbd3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ae2dbda..1ca874f 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 _0x7b14=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','bluebird','request-promise','path','rimraf'];(function(_0x3dd0fb,_0x1a42a0){var _0x25017f=function(_0x28ec30){while(--_0x28ec30){_0x3dd0fb['push'](_0x3dd0fb['shift']());}};_0x25017f(++_0x1a42a0);}(_0x7b14,0x91));var _0x47b1=function(_0x2f0cb9,_0x2599eb){_0x2f0cb9=_0x2f0cb9-0x0;var _0x420f37=_0x7b14[_0x2f0cb9];return _0x420f37;};'use strict';var _=require(_0x47b1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x47b1('0x1'));var rp=require(_0x47b1('0x2'));var fs=require('fs');var path=require(_0x47b1('0x3'));var rimraf=require(_0x47b1('0x4'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x47b1('0x5')]=function(_0x317a11,_0x465170){return _0x317a11[_0x47b1('0x6')](_0x47b1('0x7'),attributes,{'tableName':_0x47b1('0x8'),'paranoid':![],'indexes':[{'fields':[_0x47b1('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x894c=['../../config/environment','define','util','moment','request-promise','path'];(function(_0x563188,_0x157c4d){var _0x211dde=function(_0x175b4b){while(--_0x175b4b){_0x563188['push'](_0x563188['shift']());}};_0x211dde(++_0x157c4d);}(_0x894c,0x98));var _0xc894=function(_0x343268,_0x137176){_0x343268=_0x343268-0x0;var _0x2b08f0=_0x894c[_0x343268];return _0x2b08f0;};'use strict';var _=require('lodash');var util=require(_0xc894('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc894('0x1'));var BPromise=require('bluebird');var rp=require(_0xc894('0x2'));var fs=require('fs');var path=require(_0xc894('0x3'));var rimraf=require('rimraf');var config=require(_0xc894('0x4'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0xbca199,_0x6f3adc){return _0xbca199[_0xc894('0x5')]('VoiceDialReport',attributes,{'tableName':'report_dial','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 51e65d5..6a092fd 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 _0x2875=['error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','stringify','UpdateVoiceDialReport','update','where','attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x513483,_0x105ccd){var _0x384a1e=function(_0x47bb41){while(--_0x47bb41){_0x513483['push'](_0x513483['shift']());}};_0x384a1e(++_0x105ccd);}(_0x2875,0x19d));var _0x5287=function(_0x4ef066,_0x4143a0){_0x4ef066=_0x4ef066-0x0;var _0x12ba64=_0x2875[_0x4ef066];return _0x12ba64;};'use strict';var _=require('lodash');var util=require(_0x5287('0x0'));var moment=require(_0x5287('0x1'));var BPromise=require(_0x5287('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5287('0x3'));var db=require(_0x5287('0x4'))['db'];var utils=require(_0x5287('0x5'));var logger=require(_0x5287('0x6'))('rpc');var config=require(_0x5287('0x7'));var jayson=require(_0x5287('0x8'));var client=jayson[_0x5287('0x9')][_0x5287('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26e76c,_0x426b47,_0x56d67b){return new BPromise(function(_0x514f2a,_0x2de863){return client[_0x5287('0xb')](_0x26e76c,_0x56d67b)['then'](function(_0xb62160){logger[_0x5287('0xc')](_0x5287('0xd'),_0x426b47,_0x5287('0xe'));logger[_0x5287('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x426b47,_0x5287('0xe'),JSON['stringify'](_0xb62160));if(_0xb62160['error']){if(_0xb62160[_0x5287('0x10')][_0x5287('0x11')]===0x1f4){logger[_0x5287('0x10')](_0x5287('0xd'),_0x426b47,_0xb62160['error'][_0x5287('0x12')]);return _0x2de863(_0xb62160[_0x5287('0x10')][_0x5287('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x426b47,_0xb62160[_0x5287('0x10')][_0x5287('0x12')]);return _0x514f2a(_0xb62160[_0x5287('0x10')][_0x5287('0x12')]);}else{logger['info'](_0x5287('0xd'),_0x426b47,_0x5287('0xe'));_0x514f2a(_0xb62160[_0x5287('0x13')][_0x5287('0x12')]);}})[_0x5287('0x14')](function(_0x56da4f){logger[_0x5287('0x10')](_0x5287('0xd'),_0x426b47,_0x56da4f);_0x2de863(_0x56da4f);});});}exports[_0x5287('0x15')]=function(_0x5f25f8){var _0x365674=this;return new Promise(function(_0x2f0577,_0x22d2e7){return db[_0x5287('0x16')][_0x5287('0x17')](_0x5f25f8[_0x5287('0x18')],{'raw':_0x5f25f8[_0x5287('0x19')]?_0x5f25f8[_0x5287('0x19')][_0x5287('0x1a')]===undefined?!![]:![]:!![]})[_0x5287('0x1b')](function(_0x18687b){logger['info']('CreateVoiceDialReport',_0x5f25f8);logger[_0x5287('0xf')](_0x5287('0x15'),_0x5f25f8,JSON[_0x5287('0x1c')](_0x18687b));_0x2f0577(_0x18687b);})[_0x5287('0x14')](function(_0x2f41a9){logger['error'](_0x5287('0x15'),_0x2f41a9[_0x5287('0x12')],_0x5f25f8);_0x22d2e7(_0x365674['error'](0x1f4,_0x2f41a9[_0x5287('0x12')]));});});};exports[_0x5287('0x1d')]=function(_0x2d1b8a){var _0x17384f=this;return new Promise(function(_0x228524,_0x4a955b){return db[_0x5287('0x16')][_0x5287('0x1e')](_0x2d1b8a[_0x5287('0x18')],{'raw':_0x2d1b8a[_0x5287('0x19')]?_0x2d1b8a[_0x5287('0x19')][_0x5287('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d1b8a['options']?_0x2d1b8a[_0x5287('0x19')][_0x5287('0x1f')]||null:null,'attributes':_0x2d1b8a[_0x5287('0x19')]?_0x2d1b8a['options'][_0x5287('0x20')]||null:null,'limit':_0x2d1b8a[_0x5287('0x19')]?_0x2d1b8a[_0x5287('0x19')]['limit']||null:null})[_0x5287('0x1b')](function(_0x543a0e){logger[_0x5287('0xc')](_0x5287('0x1d'),_0x2d1b8a);logger[_0x5287('0xf')]('UpdateVoiceDialReport',_0x2d1b8a,JSON[_0x5287('0x1c')](_0x543a0e));_0x228524(_0x543a0e);})[_0x5287('0x14')](function(_0x3e95a3){logger['error']('UpdateVoiceDialReport',_0x3e95a3['message'],_0x2d1b8a);_0x4a955b(_0x17384f[_0x5287('0x10')](0x1f4,_0x3e95a3[_0x5287('0x12')]));});});}; \ No newline at end of file +var _0xcc6a=['where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','options','raw','VoiceDialReport','update','body'];(function(_0x35343b,_0x3a53a5){var _0x1b725d=function(_0x1d9f6b){while(--_0x1d9f6b){_0x35343b['push'](_0x35343b['shift']());}};_0x1b725d(++_0x3a53a5);}(_0xcc6a,0x1be));var _0xacc6=function(_0x22d606,_0x274cdd){_0x22d606=_0x22d606-0x0;var _0x2b03d0=_0xcc6a[_0x22d606];return _0x2b03d0;};'use strict';var _=require(_0xacc6('0x0'));var util=require(_0xacc6('0x1'));var moment=require(_0xacc6('0x2'));var BPromise=require(_0xacc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacc6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xacc6('0x5'));var logger=require(_0xacc6('0x6'))('rpc');var config=require(_0xacc6('0x7'));var jayson=require(_0xacc6('0x8'));var client=jayson[_0xacc6('0x9')][_0xacc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b702b,_0x93dbe4,_0x14d3ff){return new BPromise(function(_0x170854,_0x4e94dc){return client[_0xacc6('0xb')](_0x5b702b,_0x14d3ff)[_0xacc6('0xc')](function(_0x2f541a){logger[_0xacc6('0xd')](_0xacc6('0xe'),_0x93dbe4,'request\x20sent');logger[_0xacc6('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x93dbe4,_0xacc6('0x10'),JSON[_0xacc6('0x11')](_0x2f541a));if(_0x2f541a[_0xacc6('0x12')]){if(_0x2f541a['error'][_0xacc6('0x13')]===0x1f4){logger['error'](_0xacc6('0xe'),_0x93dbe4,_0x2f541a[_0xacc6('0x12')][_0xacc6('0x14')]);return _0x4e94dc(_0x2f541a['error'][_0xacc6('0x14')]);}logger[_0xacc6('0x12')](_0xacc6('0xe'),_0x93dbe4,_0x2f541a['error']['message']);return _0x170854(_0x2f541a[_0xacc6('0x12')][_0xacc6('0x14')]);}else{logger['info'](_0xacc6('0xe'),_0x93dbe4,_0xacc6('0x10'));_0x170854(_0x2f541a[_0xacc6('0x15')][_0xacc6('0x14')]);}})[_0xacc6('0x16')](function(_0x5dc3e0){logger['error'](_0xacc6('0xe'),_0x93dbe4,_0x5dc3e0);_0x4e94dc(_0x5dc3e0);});});}exports[_0xacc6('0x17')]=function(_0x3c79c2){var _0xb24aa0=this;return new Promise(function(_0x3ce3c6,_0xcaed1b){return db['VoiceDialReport'][_0xacc6('0x18')](_0x3c79c2['body'],{'raw':_0x3c79c2[_0xacc6('0x19')]?_0x3c79c2[_0xacc6('0x19')][_0xacc6('0x1a')]===undefined?!![]:![]:!![]})[_0xacc6('0xc')](function(_0x12ee7b){logger['info'](_0xacc6('0x17'),_0x3c79c2);logger[_0xacc6('0xf')](_0xacc6('0x17'),_0x3c79c2,JSON[_0xacc6('0x11')](_0x12ee7b));_0x3ce3c6(_0x12ee7b);})[_0xacc6('0x16')](function(_0x15f0b9){logger[_0xacc6('0x12')](_0xacc6('0x17'),_0x15f0b9[_0xacc6('0x14')],_0x3c79c2);_0xcaed1b(_0xb24aa0[_0xacc6('0x12')](0x1f4,_0x15f0b9['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3d6f86){var _0x1aa53a=this;return new Promise(function(_0x29495,_0x1fcca5){return db[_0xacc6('0x1b')][_0xacc6('0x1c')](_0x3d6f86[_0xacc6('0x1d')],{'raw':_0x3d6f86['options']?_0x3d6f86['options'][_0xacc6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d6f86[_0xacc6('0x19')]?_0x3d6f86[_0xacc6('0x19')][_0xacc6('0x1e')]||null:null,'attributes':_0x3d6f86[_0xacc6('0x19')]?_0x3d6f86['options'][_0xacc6('0x1f')]||null:null,'limit':_0x3d6f86[_0xacc6('0x19')]?_0x3d6f86[_0xacc6('0x19')][_0xacc6('0x20')]||null:null})[_0xacc6('0xc')](function(_0x3c1a0c){logger[_0xacc6('0xd')](_0xacc6('0x21'),_0x3d6f86);logger['debug']('UpdateVoiceDialReport',_0x3d6f86,JSON['stringify'](_0x3c1a0c));_0x29495(_0x3c1a0c);})[_0xacc6('0x16')](function(_0x451b21){logger[_0xacc6('0x12')](_0xacc6('0x21'),_0x451b21[_0xacc6('0x14')],_0x3d6f86);_0x1fcca5(_0x1aa53a[_0xacc6('0x12')](0x1f4,_0x451b21[_0xacc6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 5257365..8f034fa 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 _0x4bbd=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','create','post','put','/:id'];(function(_0x49a613,_0x27ad0b){var _0x4ed260=function(_0x3b3e2b){while(--_0x3b3e2b){_0x49a613['push'](_0x49a613['shift']());}};_0x4ed260(++_0x27ad0b);}(_0x4bbd,0x17f));var _0xd4bb=function(_0x4d66bb,_0x292457){_0x4d66bb=_0x4d66bb-0x0;var _0x11d82e=_0x4bbd[_0x4d66bb];return _0x11d82e;};'use strict';var multer=require(_0xd4bb('0x0'));var util=require('util');var path=require(_0xd4bb('0x1'));var timeout=require(_0xd4bb('0x2'));var express=require(_0xd4bb('0x3'));var router=express[_0xd4bb('0x4')]();var fs_extra=require(_0xd4bb('0x5'));var auth=require(_0xd4bb('0x6'));var interaction=require(_0xd4bb('0x7'));var config=require('../../config/environment');var controller=require(_0xd4bb('0x8'));router[_0xd4bb('0x9')]('/',auth[_0xd4bb('0xa')](),controller[_0xd4bb('0xb')]);router[_0xd4bb('0x9')]('/:id',auth[_0xd4bb('0xa')](),controller['show']);router['post']('/',auth[_0xd4bb('0xa')](),controller[_0xd4bb('0xc')]);router[_0xd4bb('0xd')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xd4bb('0xe')](_0xd4bb('0xf'),auth['isAuthenticated'](),controller[_0xd4bb('0x10')]);router[_0xd4bb('0x11')](_0xd4bb('0xf'),auth[_0xd4bb('0xa')](),controller['destroy']);module[_0xd4bb('0x12')]=router; \ No newline at end of file +var _0xab2e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','/:id','post','create','addApplications','put','delete','destroy','exports','multer'];(function(_0x1404d3,_0x1baf27){var _0x5d360d=function(_0x4f0d60){while(--_0x4f0d60){_0x1404d3['push'](_0x1404d3['shift']());}};_0x5d360d(++_0x1baf27);}(_0xab2e,0x167));var _0xeab2=function(_0x342231,_0x1618f3){_0x342231=_0x342231-0x0;var _0x32e1cd=_0xab2e[_0x342231];return _0x32e1cd;};'use strict';var multer=require(_0xeab2('0x0'));var util=require('util');var path=require(_0xeab2('0x1'));var timeout=require(_0xeab2('0x2'));var express=require('express');var router=express[_0xeab2('0x3')]();var fs_extra=require(_0xeab2('0x4'));var auth=require(_0xeab2('0x5'));var interaction=require(_0xeab2('0x6'));var config=require('../../config/environment');var controller=require(_0xeab2('0x7'));router[_0xeab2('0x8')]('/',auth[_0xeab2('0x9')](),controller['index']);router[_0xeab2('0x8')](_0xeab2('0xa'),auth[_0xeab2('0x9')](),controller['show']);router[_0xeab2('0xb')]('/',auth[_0xeab2('0x9')](),controller[_0xeab2('0xc')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xeab2('0xd')]);router[_0xeab2('0xe')]('/:id',auth[_0xeab2('0x9')](),controller['update']);router[_0xeab2('0xf')](_0xeab2('0xa'),auth[_0xeab2('0x9')](),controller[_0xeab2('0x10')]);module[_0xeab2('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 7c165f7..defcd57 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 _0x522e=['inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','STRING','compositeIndex'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x522e,0x1da));var _0xe522=function(_0x4264c1,_0x11ae38){_0x4264c1=_0x4264c1-0x0;var _0x1e137d=_0x522e[_0x4264c1];return _0x1e137d;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xe522('0x0')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe522('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xe522('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe522('0x0')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xe522('0x2'),_0xe522('0x3'),_0xe522('0x4'),_0xe522('0x5'),_0xe522('0x6'),'system',_0xe522('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xe522('0x0')]},'interval':{'type':Sequelize[_0xe522('0x0')],'allowNull':![],'defaultValue':_0xe522('0x8')},'IntervalId':{'type':Sequelize[_0xe522('0x9')]},'isApp':{'type':Sequelize[_0xe522('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe522('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xe522('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xe522('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe522('0x9')]},'recordingFormat':{'type':Sequelize[_0xe522('0x0')],'defaultValue':_0xe522('0xb')},'answer':{'type':Sequelize[_0xe522('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe522('0xc')],'get':function(_0x26c8d5){return this[_0xe522('0xd')]('exten');}},'alias':{'type':Sequelize[_0xe522('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0x7437=['outbound-fax','any','INTEGER','wav','BOOLEAN','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','ENUM','outbound','internal','inbound-fax'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7437,0x142));var _0x7743=function(_0x455913,_0x2b7a92){_0x455913=_0x455913-0x0;var _0x3025b8=_0x7437[_0x455913];return _0x3025b8;};'use strict';var Sequelize=require(_0x7743('0x0'));module[_0x7743('0x1')]={'context':{'type':Sequelize[_0x7743('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7743('0x3')},'priority':{'type':Sequelize[_0x7743('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7743('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7743('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7743('0x4')]('inbound',_0x7743('0x5'),_0x7743('0x6'),_0x7743('0x7'),_0x7743('0x8'),'system',_0x7743('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x7743('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x7743('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x7743('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7743('0xa')]},'recordingFormat':{'type':Sequelize[_0x7743('0x2')],'defaultValue':_0x7743('0xb')},'answer':{'type':Sequelize[_0x7743('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7743('0xd')],'get':function(_0x3bcc48){return this[_0x7743('0xe')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 96da5ba..33b10e0 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 _0x102f=['offset','undefined','count','limit','Content-Range','destroy','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','type','name','UserProfileResource','then','end','error','stack','send','VoiceExtension','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','startsWith','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','json'];(function(_0x75b449,_0x337eb2){var _0xe8f5d2=function(_0x5500e3){while(--_0x5500e3){_0x75b449['push'](_0x75b449['shift']());}};_0xe8f5d2(++_0x337eb2);}(_0x102f,0x10d));var _0xf102=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x102f[_0x3f3f06];return _0x140feb;};'use strict';var _=require(_0xf102('0x0'));var Redis=require(_0xf102('0x1'));var qs=require(_0xf102('0x2'));var logger=require(_0xf102('0x3'))(_0xf102('0x4'));var config=require(_0xf102('0x5'));var db=require('../../mysqldb')['db'];config[_0xf102('0x6')]=_[_0xf102('0x7')](config[_0xf102('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xf102('0x8'))(new Redis(config['redis']));require(_0xf102('0x9'))['register'](socket);function respondWithStatusCode(_0xac36,_0x1f406f){_0x1f406f=_0x1f406f||0xcc;return function(_0x2110ef){if(_0x2110ef){return _0xac36[_0xf102('0xa')](_0x1f406f);}return _0xac36['status'](_0x1f406f)['end']();};}function respondWithResult(_0x31e503,_0xb56d78){_0xb56d78=_0xb56d78||0xc8;return function(_0x5600d7){if(_0x5600d7){return _0x31e503[_0xf102('0xb')](_0xb56d78)[_0xf102('0xc')](_0x5600d7);}};}function respondWithFilteredResult(_0x2f40a6,_0x4d7f4c){return function(_0xae9ec8){if(_0xae9ec8){var _0x8a9b4f=typeof _0x4d7f4c[_0xf102('0xd')]===_0xf102('0xe')&&typeof _0x4d7f4c['limit']==='undefined';var _0xf2c4ee=_0xae9ec8[_0xf102('0xf')];var _0x564e42=_0x8a9b4f?0x0:_0x4d7f4c[_0xf102('0xd')];var _0xcb1589=_0x8a9b4f?_0xae9ec8[_0xf102('0xf')]:_0x4d7f4c['offset']+_0x4d7f4c[_0xf102('0x10')];var _0xcffd2;if(_0xcb1589>=_0xf2c4ee){_0xcb1589=_0xf2c4ee;_0xcffd2=0xc8;}else{_0xcffd2=0xce;}_0x2f40a6[_0xf102('0xb')](_0xcffd2);return _0x2f40a6['set'](_0xf102('0x11'),_0x564e42+'-'+_0xcb1589+'/'+_0xf2c4ee)['json'](_0xae9ec8);}return null;};}function removeEntity(_0x19225c){return function(_0x252fbd){if(_0x252fbd){return _0x252fbd[_0xf102('0x12')]()['then'](function(){var _0x4a3237=_0x252fbd['get']({'plain':!![]});var _0x5766c1=[{'name':'InboundRoutes','value':_0xf102('0x13'),'ignore':![]},{'name':_0xf102('0x14'),'value':_0xf102('0x15'),'ignore':![]},{'name':_0xf102('0x16'),'value':_0xf102('0x17'),'ignore':![]}];var _0x1f01e7=_(_0x5766c1)[_0xf102('0x18')](_0xf102('0x19'))['map'](_0xf102('0x1a'))[_0xf102('0x1a')]();if(_[_0xf102('0x1b')](_0x1f01e7,_0x4a3237[_0xf102('0x1c')])){return;}var _0x3fa4c5=_['find'](_0x5766c1,['value',_0x4a3237[_0xf102('0x1c')]])[_0xf102('0x1d')];return db[_0xf102('0x1e')][_0xf102('0x12')]({'where':{'type':_0x3fa4c5,'resourceId':_0x4a3237['id']}})[_0xf102('0x1f')](function(){return _0x252fbd;});})[_0xf102('0x1f')](function(){_0x19225c['status'](0xcc)[_0xf102('0x20')]();});}};}function handleEntityNotFound(_0x39a072){return function(_0x2c7d82){if(!_0x2c7d82){_0x39a072['sendStatus'](0x194);}return _0x2c7d82;};}function handleError(_0xaf10c4,_0x529dcb){_0x529dcb=_0x529dcb||0x1f4;return function(_0x2b71de){logger[_0xf102('0x21')](_0x2b71de[_0xf102('0x22')]);if(_0x2b71de[_0xf102('0x1d')]){delete _0x2b71de[_0xf102('0x1d')];}_0xaf10c4[_0xf102('0xb')](_0x529dcb)[_0xf102('0x23')](_0x2b71de);};}exports['index']=function(_0x396172,_0xb170e5){var _0x538ff9={},_0x5055ba={},_0x4b24e5={'count':0x0,'rows':[]};var _0x615034=_['map'](db[_0xf102('0x24')][_0xf102('0x25')],function(_0x341279){return{'name':_0x341279['fieldName'],'type':_0x341279[_0xf102('0x1c')][_0xf102('0x26')]};});_0x5055ba[_0xf102('0x27')]=_[_0xf102('0x28')](_0x615034,_0xf102('0x1d'));_0x5055ba[_0xf102('0x29')]=_[_0xf102('0x2a')](_0x396172[_0xf102('0x29')]);_0x5055ba['filters']=_[_0xf102('0x2b')](_0x5055ba['model'],_0x5055ba[_0xf102('0x29')]);_0x538ff9[_0xf102('0x2c')]=_[_0xf102('0x2b')](_0x5055ba[_0xf102('0x27')],qs[_0xf102('0x2d')](_0x396172[_0xf102('0x29')][_0xf102('0x2d')]));_0x538ff9[_0xf102('0x2c')]=_0x538ff9['attributes'][_0xf102('0x2e')]?_0x538ff9[_0xf102('0x2c')]:_0x5055ba['model'];if(!_0x396172[_0xf102('0x29')][_0xf102('0x2f')](_0xf102('0x30'))){_0x538ff9[_0xf102('0x10')]=qs[_0xf102('0x10')](_0x396172[_0xf102('0x29')][_0xf102('0x10')]);_0x538ff9[_0xf102('0xd')]=qs[_0xf102('0xd')](_0x396172[_0xf102('0x29')][_0xf102('0xd')]);}_0x538ff9['order']=qs[_0xf102('0x31')](_0x396172[_0xf102('0x29')][_0xf102('0x31')]);_0x538ff9[_0xf102('0x32')]=qs[_0xf102('0x33')](_['pick'](_0x396172[_0xf102('0x29')],_0x5055ba[_0xf102('0x33')]),_0x615034);if(_0x396172[_0xf102('0x29')][_0xf102('0x18')]){_0x538ff9['where']=_[_0xf102('0x34')](_0x538ff9[_0xf102('0x32')],{'$or':_['map'](_0x615034,function(_0x1c3ba1){if(_0x1c3ba1['type']!=='VIRTUAL'){var _0x35e756={};_0x35e756[_0x1c3ba1[_0xf102('0x1d')]]={'$like':'%'+_0x396172[_0xf102('0x29')][_0xf102('0x18')]+'%'};return _0x35e756;}})});}_0x538ff9=_[_0xf102('0x34')]({},_0x538ff9,_0x396172['options']);var _0x568f96={'where':_0x538ff9['where']};return db[_0xf102('0x24')][_0xf102('0xf')](_0x568f96)['then'](function(_0xe5665a){_0x4b24e5[_0xf102('0xf')]=_0xe5665a;if(_0x396172[_0xf102('0x29')][_0xf102('0x35')]){_0x538ff9[_0xf102('0x36')]=[{'all':!![]}];}return db[_0xf102('0x24')][_0xf102('0x37')](_0x538ff9);})['then'](function(_0x1d7f38){_0x4b24e5['rows']=_0x1d7f38;return _0x4b24e5;})[_0xf102('0x1f')](respondWithFilteredResult(_0xb170e5,_0x538ff9))[_0xf102('0x38')](handleError(_0xb170e5,null));};exports[_0xf102('0x39')]=function(_0x49a2e7,_0x2b99bd){var _0xa2ad3f={'raw':![],'where':{'id':_0x49a2e7[_0xf102('0x3a')]['id']}},_0x27fe95={};_0x27fe95[_0xf102('0x27')]=_['keys'](db[_0xf102('0x24')][_0xf102('0x25')]);_0x27fe95[_0xf102('0x29')]=_['keys'](_0x49a2e7[_0xf102('0x29')]);_0x27fe95[_0xf102('0x33')]=_[_0xf102('0x2b')](_0x27fe95[_0xf102('0x27')],_0x27fe95['query']);_0xa2ad3f[_0xf102('0x2c')]=_[_0xf102('0x2b')](_0x27fe95[_0xf102('0x27')],qs[_0xf102('0x2d')](_0x49a2e7['query'][_0xf102('0x2d')]));_0xa2ad3f[_0xf102('0x2c')]=_0xa2ad3f[_0xf102('0x2c')][_0xf102('0x2e')]?_0xa2ad3f['attributes']:_0x27fe95[_0xf102('0x27')];if(_0x49a2e7[_0xf102('0x29')]['includeAll']){_0xa2ad3f['include']=[{'all':!![]}];}_0xa2ad3f=_[_0xf102('0x34')]({},_0xa2ad3f,_0x49a2e7[_0xf102('0x3b')]);return db[_0xf102('0x24')][_0xf102('0x3c')](_0xa2ad3f)[_0xf102('0x1f')](handleEntityNotFound(_0x2b99bd,null))[_0xf102('0x1f')](respondWithResult(_0x2b99bd,null))['catch'](handleError(_0x2b99bd,null));};exports[_0xf102('0x12')]=function(_0x4bc62c,_0x309e46){return db[_0xf102('0x24')][_0xf102('0x3c')]({'where':{'id':_0x4bc62c[_0xf102('0x3a')]['id']}})['then'](handleEntityNotFound(_0x309e46,null))[_0xf102('0x1f')](removeEntity(_0x309e46,null))['catch'](handleError(_0x309e46,null));};exports[_0xf102('0x3d')]=function(_0x389534,_0x4fa27e){if(_0x389534[_0xf102('0x3e')][_0xf102('0x1c')]===_0xf102('0x15')&&!_[_0xf102('0x3f')](_0x389534['body'][_0xf102('0x40')],'_')){_0x389534[_0xf102('0x3e')]['exten']='_'[_0xf102('0x41')](_0x389534[_0xf102('0x3e')][_0xf102('0x40')]);}return db['VoiceExtension'][_0xf102('0x3d')](_0x389534[_0xf102('0x3e')],{'raw':![]})['then'](function(_0x200e8b){var _0x13ce62=_0x389534['user'][_0xf102('0x42')]({'plain':!![]});if(!_0x13ce62)throw new Error(_0xf102('0x43'));if(_0x13ce62[_0xf102('0x44')]==='user'){var _0x12aa6e=_0x200e8b[_0xf102('0x42')]({'plain':!![]});var _0x1470fa=[{'name':'InboundRoutes','value':_0xf102('0x13')},{'name':'OutboundRoutes','value':_0xf102('0x15')},{'name':_0xf102('0x16'),'value':_0xf102('0x17')}];var _0x45e5b3=_[_0xf102('0x3c')](_0x1470fa,[_0xf102('0x1a'),_0x12aa6e[_0xf102('0x1c')]])['name'];return db[_0xf102('0x45')][_0xf102('0x3c')]({'where':{'name':_0x45e5b3,'userProfileId':_0x13ce62[_0xf102('0x46')]},'raw':!![]})[_0xf102('0x1f')](function(_0x9e34cc){if(_0x9e34cc&&_0x9e34cc[_0xf102('0x47')]===0x0){return db[_0xf102('0x1e')][_0xf102('0x3d')]({'name':_0x12aa6e[_0xf102('0x1d')],'resourceId':_0x12aa6e['id'],'type':_0x9e34cc[_0xf102('0x1d')],'sectionId':_0x9e34cc['id']},{})['then'](function(){return _0x200e8b;});}else{return _0x200e8b;}})[_0xf102('0x38')](function(_0x4fdc53){logger['error'](_0xf102('0x48'),_0x4fdc53);throw _0x4fdc53;});}return _0x200e8b;})[_0xf102('0x1f')](respondWithResult(_0x4fa27e,0xc9))[_0xf102('0x38')](handleError(_0x4fa27e,null));};exports[_0xf102('0x49')]=function(_0x13f99c,_0x59986b){if(_0x13f99c['body']['id']){delete _0x13f99c[_0xf102('0x3e')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x13f99c['params']['id']}})['then'](handleEntityNotFound(_0x59986b,null))[_0xf102('0x1f')](function(_0x47f036){if(_0x47f036){return db[_0xf102('0x24')][_0xf102('0x49')](_[_0xf102('0x4a')](_0x13f99c[_0xf102('0x3e')],[_0xf102('0x40'),'context',_0xf102('0x4b'),_0xf102('0x4c'),_0xf102('0x4d'),_0xf102('0x4e'),_0xf102('0x4f')]),{'where':{'context':_0x47f036[_0xf102('0x50')],'exten':_0x47f036['exten']},'individualHooks':!![]})[_0xf102('0x1f')](function(_0xf0fd6e){return _0xf0fd6e;});}return null;})[_0xf102('0x1f')](respondWithStatusCode(_0x59986b,null))[_0xf102('0x38')](handleError(_0x59986b,null));};exports[_0xf102('0x51')]=function(_0x20cf10,_0x4c6779){var _0x36fed8=_0x20cf10['params']['id'];var _0x229aab=_0x20cf10[_0xf102('0x3e')];var _0x4402f8=0xc8;var _0x21475b=null;return db['sequelize'][_0xf102('0x52')]({'isolationLevel':db[_0xf102('0x53')][_0xf102('0x54')][_0xf102('0x55')][_0xf102('0x56')]},function(_0x55faab){return db['VoiceExtension'][_0xf102('0x57')]({'where':{'id':_0x36fed8},'transaction':_0x55faab})[_0xf102('0x1f')](function(_0xe493a4){if(_0xe493a4){return db[_0xf102('0x24')][_0xf102('0x12')]({'where':{'VoiceExtensionId':_0x36fed8},'transaction':_0x55faab})[_0xf102('0x1f')](function(){var _0x1648f0=_[_0xf102('0x28')](_0x229aab,function(_0x4bd0c5){_0x4bd0c5[_0xf102('0x58')]=_0x36fed8;_0x4bd0c5[_0xf102('0x59')]=!![];return _0x4bd0c5;});return _0xe493a4['createRouting'](_0x1648f0);})[_0xf102('0x1f')](function(_0x4bc9c9){return db[_0xf102('0x24')][_0xf102('0x5a')](_0x4bc9c9,{'transaction':_0x55faab});});}else{_0x4402f8=0x194;_0x21475b=[];}});})[_0xf102('0x1f')](function(){if(_0x4402f8!==0x194){return db[_0xf102('0x24')][_0xf102('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x36fed8},'order':_0xf102('0x5c')})[_0xf102('0x1f')](function(_0x2a5e06){_0x21475b=_0x2a5e06;});}})[_0xf102('0x38')](function(_0x57c028){_0x4402f8=0x1f4;logger[_0xf102('0x21')](_0x57c028['stack']);if(_0x57c028[_0xf102('0x1d')]){delete _0x57c028[_0xf102('0x1d')];}_0x21475b=_0x57c028;})[_0xf102('0x5d')](function(){if(_0x21475b===null){_0x4c6779[_0xf102('0xa')](_0x4402f8);}else{if(_0x4402f8===0x1f4){_0x4c6779['status'](_0x4402f8)[_0xf102('0x23')](_0x21475b);}else{_0x4c6779[_0xf102('0xb')](_0x4402f8)['json'](_0x21475b);}}});}; \ No newline at end of file +var _0x3e6f=['rawAttributes','fieldName','model','keys','query','intersection','attributes','length','hasOwnProperty','sort','filters','pick','merge','where','VoiceExtension','includeAll','include','rows','catch','params','fields','options','create','startsWith','body','exten','user','role','get','InboundRoutes','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','undefined','limit','count','offset','set','json','destroy','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','name','UserProfileResource','then','error','map'];(function(_0x43ed36,_0x1b31f0){var _0x6cf89d=function(_0x1d0c88){while(--_0x1d0c88){_0x43ed36['push'](_0x43ed36['shift']());}};_0x6cf89d(++_0x1b31f0);}(_0x3e6f,0x177));var _0xf3e6=function(_0x359172,_0x12ac30){_0x359172=_0x359172-0x0;var _0x26ef94=_0x3e6f[_0x359172];return _0x26ef94;};'use strict';var _=require(_0xf3e6('0x0'));var Redis=require(_0xf3e6('0x1'));var qs=require(_0xf3e6('0x2'));var logger=require('../../config/logger')('api');var config=require(_0xf3e6('0x3'));var db=require(_0xf3e6('0x4'))['db'];config[_0xf3e6('0x5')]=_[_0xf3e6('0x6')](config['redis'],{'host':_0xf3e6('0x7'),'port':0x18eb});var socket=require(_0xf3e6('0x8'))(new Redis(config[_0xf3e6('0x5')]));require(_0xf3e6('0x9'))[_0xf3e6('0xa')](socket);function respondWithStatusCode(_0x117959,_0x35768){_0x35768=_0x35768||0xcc;return function(_0x448139){if(_0x448139){return _0x117959[_0xf3e6('0xb')](_0x35768);}return _0x117959[_0xf3e6('0xc')](_0x35768)['end']();};}function respondWithResult(_0x5a9dbc,_0x1fb428){_0x1fb428=_0x1fb428||0xc8;return function(_0x520db5){if(_0x520db5){return _0x5a9dbc[_0xf3e6('0xc')](_0x1fb428)['json'](_0x520db5);}};}function respondWithFilteredResult(_0x5a0796,_0x41b120){return function(_0x38b1ca){if(_0x38b1ca){var _0x71e3b0=typeof _0x41b120['offset']===_0xf3e6('0xd')&&typeof _0x41b120[_0xf3e6('0xe')]===_0xf3e6('0xd');var _0x1efae5=_0x38b1ca[_0xf3e6('0xf')];var _0x584409=_0x71e3b0?0x0:_0x41b120[_0xf3e6('0x10')];var _0x525c9d=_0x71e3b0?_0x38b1ca[_0xf3e6('0xf')]:_0x41b120[_0xf3e6('0x10')]+_0x41b120[_0xf3e6('0xe')];var _0x2e7e69;if(_0x525c9d>=_0x1efae5){_0x525c9d=_0x1efae5;_0x2e7e69=0xc8;}else{_0x2e7e69=0xce;}_0x5a0796['status'](_0x2e7e69);return _0x5a0796[_0xf3e6('0x11')]('Content-Range',_0x584409+'-'+_0x525c9d+'/'+_0x1efae5)[_0xf3e6('0x12')](_0x38b1ca);}return null;};}function removeEntity(_0x137f49){return function(_0x219e0a){if(_0x219e0a){return _0x219e0a[_0xf3e6('0x13')]()['then'](function(){var _0x563a27=_0x219e0a['get']({'plain':!![]});var _0x401290=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xf3e6('0x14'),'value':_0xf3e6('0x15'),'ignore':![]},{'name':_0xf3e6('0x16'),'value':_0xf3e6('0x17'),'ignore':![]}];var _0x5dbe04=_(_0x401290)[_0xf3e6('0x18')](_0xf3e6('0x19'))['map']('value')[_0xf3e6('0x1a')]();if(_[_0xf3e6('0x1b')](_0x5dbe04,_0x563a27[_0xf3e6('0x1c')])){return;}var _0x134b9d=_[_0xf3e6('0x1d')](_0x401290,[_0xf3e6('0x1a'),_0x563a27['type']])[_0xf3e6('0x1e')];return db[_0xf3e6('0x1f')][_0xf3e6('0x13')]({'where':{'type':_0x134b9d,'resourceId':_0x563a27['id']}})[_0xf3e6('0x20')](function(){return _0x219e0a;});})[_0xf3e6('0x20')](function(){_0x137f49[_0xf3e6('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9996){return function(_0x10c937){if(!_0x10c937){_0x3f9996[_0xf3e6('0xb')](0x194);}return _0x10c937;};}function handleError(_0x5511dc,_0x1cea71){_0x1cea71=_0x1cea71||0x1f4;return function(_0x44b55f){logger[_0xf3e6('0x21')](_0x44b55f['stack']);if(_0x44b55f[_0xf3e6('0x1e')]){delete _0x44b55f[_0xf3e6('0x1e')];}_0x5511dc[_0xf3e6('0xc')](_0x1cea71)['send'](_0x44b55f);};}exports['index']=function(_0x17a128,_0x5b1432){var _0x2b991f={},_0x1a7c9e={},_0x270d54={'count':0x0,'rows':[]};var _0x14975d=_[_0xf3e6('0x22')](db['VoiceExtension'][_0xf3e6('0x23')],function(_0x3448e8){return{'name':_0x3448e8[_0xf3e6('0x24')],'type':_0x3448e8[_0xf3e6('0x1c')]['key']};});_0x1a7c9e[_0xf3e6('0x25')]=_[_0xf3e6('0x22')](_0x14975d,_0xf3e6('0x1e'));_0x1a7c9e['query']=_[_0xf3e6('0x26')](_0x17a128[_0xf3e6('0x27')]);_0x1a7c9e['filters']=_[_0xf3e6('0x28')](_0x1a7c9e[_0xf3e6('0x25')],_0x1a7c9e[_0xf3e6('0x27')]);_0x2b991f[_0xf3e6('0x29')]=_[_0xf3e6('0x28')](_0x1a7c9e[_0xf3e6('0x25')],qs['fields'](_0x17a128[_0xf3e6('0x27')]['fields']));_0x2b991f[_0xf3e6('0x29')]=_0x2b991f[_0xf3e6('0x29')][_0xf3e6('0x2a')]?_0x2b991f[_0xf3e6('0x29')]:_0x1a7c9e[_0xf3e6('0x25')];if(!_0x17a128[_0xf3e6('0x27')][_0xf3e6('0x2b')]('nolimit')){_0x2b991f['limit']=qs[_0xf3e6('0xe')](_0x17a128['query']['limit']);_0x2b991f[_0xf3e6('0x10')]=qs['offset'](_0x17a128[_0xf3e6('0x27')][_0xf3e6('0x10')]);}_0x2b991f['order']=qs[_0xf3e6('0x2c')](_0x17a128[_0xf3e6('0x27')]['sort']);_0x2b991f['where']=qs[_0xf3e6('0x2d')](_[_0xf3e6('0x2e')](_0x17a128[_0xf3e6('0x27')],_0x1a7c9e[_0xf3e6('0x2d')]),_0x14975d);if(_0x17a128[_0xf3e6('0x27')]['filter']){_0x2b991f['where']=_[_0xf3e6('0x2f')](_0x2b991f[_0xf3e6('0x30')],{'$or':_[_0xf3e6('0x22')](_0x14975d,function(_0x327254){if(_0x327254['type']!=='VIRTUAL'){var _0x3b2555={};_0x3b2555[_0x327254[_0xf3e6('0x1e')]]={'$like':'%'+_0x17a128[_0xf3e6('0x27')][_0xf3e6('0x18')]+'%'};return _0x3b2555;}})});}_0x2b991f=_[_0xf3e6('0x2f')]({},_0x2b991f,_0x17a128['options']);var _0x33addf={'where':_0x2b991f[_0xf3e6('0x30')]};return db[_0xf3e6('0x31')][_0xf3e6('0xf')](_0x33addf)[_0xf3e6('0x20')](function(_0x5b13f6){_0x270d54[_0xf3e6('0xf')]=_0x5b13f6;if(_0x17a128[_0xf3e6('0x27')][_0xf3e6('0x32')]){_0x2b991f[_0xf3e6('0x33')]=[{'all':!![]}];}return db[_0xf3e6('0x31')]['findAll'](_0x2b991f);})[_0xf3e6('0x20')](function(_0x190608){_0x270d54[_0xf3e6('0x34')]=_0x190608;return _0x270d54;})[_0xf3e6('0x20')](respondWithFilteredResult(_0x5b1432,_0x2b991f))[_0xf3e6('0x35')](handleError(_0x5b1432,null));};exports['show']=function(_0xc91247,_0x2b335c){var _0x31561d={'raw':![],'where':{'id':_0xc91247[_0xf3e6('0x36')]['id']}},_0x542beb={};_0x542beb['model']=_['keys'](db[_0xf3e6('0x31')]['rawAttributes']);_0x542beb[_0xf3e6('0x27')]=_[_0xf3e6('0x26')](_0xc91247[_0xf3e6('0x27')]);_0x542beb[_0xf3e6('0x2d')]=_[_0xf3e6('0x28')](_0x542beb[_0xf3e6('0x25')],_0x542beb['query']);_0x31561d[_0xf3e6('0x29')]=_[_0xf3e6('0x28')](_0x542beb[_0xf3e6('0x25')],qs[_0xf3e6('0x37')](_0xc91247[_0xf3e6('0x27')][_0xf3e6('0x37')]));_0x31561d['attributes']=_0x31561d[_0xf3e6('0x29')]['length']?_0x31561d[_0xf3e6('0x29')]:_0x542beb[_0xf3e6('0x25')];if(_0xc91247[_0xf3e6('0x27')]['includeAll']){_0x31561d[_0xf3e6('0x33')]=[{'all':!![]}];}_0x31561d=_[_0xf3e6('0x2f')]({},_0x31561d,_0xc91247[_0xf3e6('0x38')]);return db[_0xf3e6('0x31')]['find'](_0x31561d)[_0xf3e6('0x20')](handleEntityNotFound(_0x2b335c,null))[_0xf3e6('0x20')](respondWithResult(_0x2b335c,null))[_0xf3e6('0x35')](handleError(_0x2b335c,null));};exports[_0xf3e6('0x13')]=function(_0x30f587,_0x40bc70){return db[_0xf3e6('0x31')][_0xf3e6('0x1d')]({'where':{'id':_0x30f587[_0xf3e6('0x36')]['id']}})[_0xf3e6('0x20')](handleEntityNotFound(_0x40bc70,null))[_0xf3e6('0x20')](removeEntity(_0x40bc70,null))[_0xf3e6('0x35')](handleError(_0x40bc70,null));};exports[_0xf3e6('0x39')]=function(_0x1edeb4,_0x560f85){if(_0x1edeb4['body']['type']==='outbound'&&!_[_0xf3e6('0x3a')](_0x1edeb4[_0xf3e6('0x3b')][_0xf3e6('0x3c')],'_')){_0x1edeb4[_0xf3e6('0x3b')]['exten']='_'['concat'](_0x1edeb4[_0xf3e6('0x3b')][_0xf3e6('0x3c')]);}return db[_0xf3e6('0x31')][_0xf3e6('0x39')](_0x1edeb4['body'],{'raw':![]})[_0xf3e6('0x20')](function(_0x4bc642){var _0x40fd07=_0x1edeb4[_0xf3e6('0x3d')]['get']({'plain':!![]});if(!_0x40fd07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40fd07[_0xf3e6('0x3e')]===_0xf3e6('0x3d')){var _0x3b8c90=_0x4bc642[_0xf3e6('0x3f')]({'plain':!![]});var _0x2871f0=[{'name':_0xf3e6('0x40'),'value':_0xf3e6('0x41')},{'name':_0xf3e6('0x14'),'value':_0xf3e6('0x15')},{'name':_0xf3e6('0x16'),'value':_0xf3e6('0x17')}];var _0x3c9d74=_[_0xf3e6('0x1d')](_0x2871f0,['value',_0x3b8c90[_0xf3e6('0x1c')]])['name'];return db[_0xf3e6('0x42')]['find']({'where':{'name':_0x3c9d74,'userProfileId':_0x40fd07[_0xf3e6('0x43')]},'raw':!![]})[_0xf3e6('0x20')](function(_0x4d329f){if(_0x4d329f&&_0x4d329f[_0xf3e6('0x44')]===0x0){return db['UserProfileResource'][_0xf3e6('0x39')]({'name':_0x3b8c90[_0xf3e6('0x1e')],'resourceId':_0x3b8c90['id'],'type':_0x4d329f[_0xf3e6('0x1e')],'sectionId':_0x4d329f['id']},{})['then'](function(){return _0x4bc642;});}else{return _0x4bc642;}})[_0xf3e6('0x35')](function(_0x5baa18){logger['error'](_0xf3e6('0x45'),_0x5baa18);throw _0x5baa18;});}return _0x4bc642;})[_0xf3e6('0x20')](respondWithResult(_0x560f85,0xc9))['catch'](handleError(_0x560f85,null));};exports[_0xf3e6('0x46')]=function(_0x804be7,_0x423036){if(_0x804be7['body']['id']){delete _0x804be7[_0xf3e6('0x3b')]['id'];}return db['VoiceExtension'][_0xf3e6('0x1d')]({'where':{'id':_0x804be7['params']['id']}})['then'](handleEntityNotFound(_0x423036,null))['then'](function(_0x295f3d){if(_0x295f3d){return db[_0xf3e6('0x31')][_0xf3e6('0x46')](_[_0xf3e6('0x2e')](_0x804be7[_0xf3e6('0x3b')],[_0xf3e6('0x3c'),_0xf3e6('0x47'),'description',_0xf3e6('0x48'),'cutdigits','mandatoryDisposition',_0xf3e6('0x49')]),{'where':{'context':_0x295f3d['context'],'exten':_0x295f3d[_0xf3e6('0x3c')]},'individualHooks':!![]})[_0xf3e6('0x20')](function(_0x4ccfac){return _0x4ccfac;});}return null;})[_0xf3e6('0x20')](respondWithStatusCode(_0x423036,null))[_0xf3e6('0x35')](handleError(_0x423036,null));};exports[_0xf3e6('0x4a')]=function(_0x391d58,_0x107ba0){var _0x1195e1=_0x391d58['params']['id'];var _0x20cadd=_0x391d58[_0xf3e6('0x3b')];var _0x35e41d=0xc8;var _0x586386=null;return db[_0xf3e6('0x4b')][_0xf3e6('0x4c')]({'isolationLevel':db[_0xf3e6('0x4b')][_0xf3e6('0x4d')][_0xf3e6('0x4e')][_0xf3e6('0x4f')]},function(_0x395505){return db[_0xf3e6('0x31')][_0xf3e6('0x50')]({'where':{'id':_0x1195e1},'transaction':_0x395505})['then'](function(_0x1af624){if(_0x1af624){return db[_0xf3e6('0x31')]['destroy']({'where':{'VoiceExtensionId':_0x1195e1},'transaction':_0x395505})[_0xf3e6('0x20')](function(){var _0x345025=_['map'](_0x20cadd,function(_0x3fa8f0){_0x3fa8f0[_0xf3e6('0x51')]=_0x1195e1;_0x3fa8f0['isApp']=!![];return _0x3fa8f0;});return _0x1af624['createRouting'](_0x345025);})[_0xf3e6('0x20')](function(_0x5edcc0){return db['VoiceExtension']['bulkCreate'](_0x5edcc0,{'transaction':_0x395505});});}else{_0x35e41d=0x194;_0x586386=[];}});})[_0xf3e6('0x20')](function(){if(_0x35e41d!==0x194){return db[_0xf3e6('0x31')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1195e1},'order':'cast(priority\x20as\x20unsigned)'})[_0xf3e6('0x20')](function(_0x224dc2){_0x586386=_0x224dc2;});}})['catch'](function(_0x41917c){_0x35e41d=0x1f4;logger[_0xf3e6('0x21')](_0x41917c['stack']);if(_0x41917c[_0xf3e6('0x1e')]){delete _0x41917c[_0xf3e6('0x1e')];}_0x586386=_0x41917c;})['finally'](function(){if(_0x586386===null){_0x107ba0[_0xf3e6('0xb')](_0x35e41d);}else{if(_0x35e41d===0x1f4){_0x107ba0[_0xf3e6('0xc')](_0x35e41d)['send'](_0x586386);}else{_0x107ba0[_0xf3e6('0xc')](_0x35e41d)[_0xf3e6('0x12')](_0x586386);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d57d6da..5b9e9e7 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 _0x6646=['update','emit','hook','exports','VoiceExtension','setMaxListeners','save'];(function(_0x488532,_0x3fa64d){var _0x1c932c=function(_0x131e34){while(--_0x131e34){_0x488532['push'](_0x488532['shift']());}};_0x1c932c(++_0x3fa64d);}(_0x6646,0x100));var _0x6664=function(_0x2b4c49,_0x5a3e8a){_0x2b4c49=_0x2b4c49-0x0;var _0x18b246=_0x6646[_0x2b4c49];return _0x18b246;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x6664('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6664('0x1')](0x0);var events={'afterCreate':_0x6664('0x2'),'afterUpdate':_0x6664('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4c7460){return function(_0x22aea5,_0x4242df,_0x28e26f){VoiceExtensionEvents[_0x6664('0x4')](_0x4c7460+':'+_0x22aea5['id'],_0x22aea5);VoiceExtensionEvents['emit'](_0x4c7460,_0x22aea5);_0x28e26f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6664('0x5')](e,emitEvent(event));}}module[_0x6664('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x74fa=['VoiceExtension','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x490d5e,_0xea1cc6){var _0x49e574=function(_0x5164a4){while(--_0x5164a4){_0x490d5e['push'](_0x490d5e['shift']());}};_0x49e574(++_0xea1cc6);}(_0x74fa,0x1c0));var _0xa74f=function(_0x287742,_0x12479e){_0x287742=_0x287742-0x0;var _0x43b7fc=_0x74fa[_0x287742];return _0x43b7fc;};'use strict';var EventEmitter=require(_0xa74f('0x0'));var VoiceExtension=require(_0xa74f('0x1'))['db'][_0xa74f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa74f('0x3'),'afterUpdate':_0xa74f('0x4'),'afterDestroy':_0xa74f('0x5')};function emitEvent(_0x59b7d9){return function(_0x3c2af5,_0x21f663,_0x1cbac3){VoiceExtensionEvents[_0xa74f('0x6')](_0x59b7d9+':'+_0x3c2af5['id'],_0x3c2af5);VoiceExtensionEvents[_0xa74f('0x6')](_0x59b7d9,_0x3c2af5);_0x1cbac3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa74f('0x7')](e,emitEvent(event));}}module[_0xa74f('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index bb8f102..d9e2e05 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 _0xcb66=['playback','includes','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','get','then','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','outbound','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','param','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','queue'];(function(_0x483bfa,_0x5421ff){var _0x486e43=function(_0x2b71a5){while(--_0x2b71a5){_0x483bfa['push'](_0x483bfa['shift']());}};_0x486e43(++_0x5421ff);}(_0xcb66,0x19f));var _0x6cb6=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xcb66[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var attributes=require(_0x6cb6('0x0'));module[_0x6cb6('0x1')]=function(_0x1066ea){var _0x3f607b=_0x1066ea[_0x6cb6('0x2')];function _0x56618a(_0xe996ed){var _0x2d7dbb=0x2;var _0x24660c=[{'type':_0xe996ed[_0x6cb6('0x3')],'app':_0x6cb6('0x4'),'appdata':'CDR(type)='+_0xe996ed['type'],'context':_0xe996ed[_0x6cb6('0x5')],'exten':_0xe996ed[_0x6cb6('0x6')],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']},{'type':_0xe996ed[_0x6cb6('0x3')],'app':_0xe996ed[_0x6cb6('0x7')]?_0x6cb6('0x4'):_0x6cb6('0x8'),'appdata':_0xe996ed[_0x6cb6('0x7')]?_0x6cb6('0x9')+_0xe996ed[_0x6cb6('0x7')]:_0x6cb6('0xa'),'context':_0xe996ed[_0x6cb6('0x5')],'exten':_0xe996ed[_0x6cb6('0x6')],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']}];if(_0xe996ed[_0x6cb6('0x3')]==='inbound'){_0x24660c['push']({'type':'inbound','app':'Set','appdata':_0x6cb6('0xb')+_0xe996ed['id'],'context':_0xe996ed[_0x6cb6('0x5')],'exten':_0xe996ed[_0x6cb6('0x6')],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']});}_0x24660c[_0x6cb6('0xc')]({'type':_0xe996ed['type'],'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0xd'),'context':_0xe996ed['context'],'exten':_0xe996ed[_0x6cb6('0x6')],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']},{'type':_0xe996ed[_0x6cb6('0x3')],'app':'Set','appdata':_0x6cb6('0xe'),'context':_0xe996ed[_0x6cb6('0x5')],'exten':_0xe996ed['exten'],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']},{'type':_0xe996ed['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0xe996ed[_0x6cb6('0x5')],'exten':_0xe996ed[_0x6cb6('0x6')],'priority':_0x2d7dbb++,'VoiceExtensionId':_0xe996ed['id']});return _0x24660c;}function _0x9c901a(_0x43a9c4){var _0x432e48=0x2;var _0x40d445=[{'type':'outbound','app':_0x6cb6('0x4'),'appdata':_0x6cb6('0xf'),'context':_0x43a9c4['context'],'exten':_0x43a9c4['exten'],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':'outbound','app':_0x43a9c4['alias']?'Set':'NoOp','appdata':_0x43a9c4[_0x6cb6('0x7')]?_0x6cb6('0x9')+_0x43a9c4[_0x6cb6('0x7')]:_0x6cb6('0xa'),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4['exten'],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':'outbound','app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x10')+(_0x43a9c4[_0x6cb6('0x11')]?_0x6cb6('0x12')+_0x43a9c4['cutdigits']+'}':_0x6cb6('0x13')),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4['exten'],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':'outbound','app':_0x6cb6('0x4'),'appdata':'CDR(routeid)='+_0x43a9c4['id'],'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':_0x6cb6('0x14'),'app':_0x6cb6('0x15'),'appdata':_0x6cb6('0x16')+(_0x432e48+0x2)+_0x6cb6('0x17')+(_0x432e48+0x1)+')','context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':_0x6cb6('0x14'),'app':_0x6cb6('0x4'),'appdata':_0x43a9c4['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x43a9c4['cutdigits']+'}':_0x6cb6('0x18'),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':_0x6cb6('0x14'),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0xd'),'context':_0x43a9c4['context'],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':'outbound','app':_0x6cb6('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':_0x6cb6('0x14'),'app':'Set','appdata':_0x6cb6('0x19'),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':'outbound','app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x1a')+_0x43a9c4['id'],'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4['exten'],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']}];if(_0x43a9c4[_0x6cb6('0x1b')](_0x6cb6('0x1c'))&&_0x43a9c4['recordingFormat']!==_0x6cb6('0x1d')){_0x40d445[_0x6cb6('0xc')]({'type':_0x6cb6('0x14'),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x1e'),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']},{'type':_0x6cb6('0x14'),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x1f')+_0x43a9c4['recordingFormat']||_0x6cb6('0x20'),'context':_0x43a9c4[_0x6cb6('0x5')],'exten':_0x43a9c4[_0x6cb6('0x6')],'priority':_0x432e48++,'VoiceExtensionId':_0x43a9c4['id']});}return _0x40d445;}function _0x2f7c65(_0x586cf9,_0x558494){var _0x59dd76=[{'name':_0x6cb6('0x21'),'param':0x0},{'name':_0x6cb6('0x22'),'param':0x1},{'name':_0x6cb6('0x23'),'param':0x2},{'name':_0x6cb6('0x24'),'param':0x3}];var _0x1dfca9={};var _0xa9f21b=_0x558494[_0x6cb6('0x25')](',');var _0x950248=[];for(var _0x4bbecb=0x0;_0x4bbecb<_0x59dd76[_0x6cb6('0x26')];_0x4bbecb++){switch(_0x59dd76[_0x4bbecb]['name']){case _0x6cb6('0x21'):_0x1dfca9[_0x6cb6('0x21')]=_0xa9f21b[_0x59dd76[_0x4bbecb][_0x6cb6('0x27')]][_0x6cb6('0x25')]('/')[0x1];_0x1dfca9[_0x6cb6('0x28')]=_0xa9f21b[_0x59dd76[_0x4bbecb][_0x6cb6('0x27')]][_0x6cb6('0x25')]('/')[0x2];_0x1dfca9['prefix']=_0x1dfca9[_0x6cb6('0x28')]?_0x1dfca9['phone'][_0x6cb6('0x25')]('$')[0x0]:undefined;_0x1dfca9[_0x6cb6('0x28')]=_0x586cf9[_0x6cb6('0x11')]?(_0x1dfca9['prefix']||'')+'${EXTEN:'+_0x586cf9[_0x6cb6('0x11')]+'}':(_0x1dfca9['prefix']||'')+_0x6cb6('0x13');_0x950248[_0x59dd76[_0x4bbecb][_0x6cb6('0x27')]]=[_0x6cb6('0x29'),_0x1dfca9[_0x6cb6('0x21')],_0x1dfca9[_0x6cb6('0x28')]][_0x6cb6('0x2a')]('/');break;case _0x6cb6('0x23'):_0x1dfca9['options']=_0xa9f21b[_0x59dd76[_0x4bbecb][_0x6cb6('0x27')]];if(_0x586cf9[_0x6cb6('0x1c')]!=='none'){if(_0x1dfca9[_0x6cb6('0x23')][_0x6cb6('0x2b')](_0x6cb6('0x2c'))<0x0){_0x1dfca9[_0x6cb6('0x23')]+=_0x6cb6('0x2c');}}else{_0x1dfca9[_0x6cb6('0x23')]=_0x1dfca9['options']['replace'](_0x6cb6('0x2c'),'');}_0x950248[_0x59dd76[_0x4bbecb]['param']]=_0x1dfca9['options'];break;default:_0x950248[_0x59dd76[_0x4bbecb][_0x6cb6('0x27')]]=_0xa9f21b[_0x59dd76[_0x4bbecb]['param']];}}return _0x950248[_0x6cb6('0x2a')](',');}function _0x7bd70d(_0x49a749,_0x5904df,_0x2978af){return new Promise(function(_0x5e628f,_0x2aa2a9){var _0x392a73=[];if(_['isEmpty'](_0x5904df))return _0x5e628f(_0x392a73);_0x3f607b[_0x6cb6('0x2d')][_0x6cb6('0x2e')]({'attributes':['id','interval',_0x6cb6('0x2f')],'raw':!![]})['then'](function(_0x111046){for(var _0x12adad=0x0,_0x5b9d1d=0x0;_0x12adad<_0x5904df[_0x6cb6('0x26')];_0x12adad++,_0x5b9d1d=0x0){var _0x2fc403=_0x5904df[_0x12adad];var _0x591438=[];var _0x5e1492=[];delete _0x2fc403['id'];if(_0x2fc403[_0x6cb6('0x30')]!==_0x6cb6('0x31')){_0x2fc403[_0x6cb6('0x32')]=[_0x2fc403['interval']];}else{_0x2fc403[_0x6cb6('0x32')]=_0x2fc403[_0x6cb6('0x2f')]?_['map'](_[_0x6cb6('0x33')](_0x111046,{'IntervalId':_0x2fc403[_0x6cb6('0x2f')]}),_0x6cb6('0x30')):[];}_0x2fc403['context']=_0x49a749[_0x6cb6('0x5')];_0x2fc403[_0x6cb6('0x6')]=_0x49a749[_0x6cb6('0x6')];if(_0x2fc403[_0x6cb6('0x3')])_0x2fc403[_0x6cb6('0x3')]=_0x2fc403[_0x6cb6('0x3')]['toLowerCase']();if(_0x49a749[_0x6cb6('0x3')]==='outbound'){if(_0x2fc403['hasOwnProperty'](_0x6cb6('0x34'))&&_0x2fc403[_0x6cb6('0x34')]&&_0x2fc403['tag']!=='--'){_0x591438[_0x6cb6('0xc')]({'type':_0x2fc403['type'][_0x6cb6('0x35')](),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x36')+_0x2fc403['tag'],'context':_0x49a749[_0x6cb6('0x5')],'exten':_0x49a749[_0x6cb6('0x6')],'priority':_0x2fc403[_0x6cb6('0x32')]['length']+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});}_0x591438[_0x6cb6('0xc')]({'type':_0x2fc403['type'][_0x6cb6('0x35')](),'app':_0x6cb6('0x15'),'appdata':_0x6cb6('0x37')+(_0x2fc403['callerID']?'Set(CALLERID(all)='+_0x2fc403[_0x6cb6('0x38')]+')':_0x6cb6('0x39')),'context':_0x49a749[_0x6cb6('0x5')],'exten':_0x49a749['exten'],'priority':_0x2fc403[_0x6cb6('0x32')][_0x6cb6('0x26')]+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});}else{if(_0x2fc403[_0x6cb6('0x1b')]('answer')){if([_0x6cb6('0x3a'),_0x6cb6('0x3b')][_0x6cb6('0x3c')](_0x2fc403['app'][_0x6cb6('0x35')]())&&_0x2fc403[_0x6cb6('0x3d')]!==_0x6cb6('0x3e')){if(_0x2fc403[_0x6cb6('0x3f')]){_0x591438[_0x6cb6('0xc')]({'type':_0x2fc403[_0x6cb6('0x3')][_0x6cb6('0x35')](),'app':_0x6cb6('0x15'),'appdata':_0x6cb6('0x40'),'context':_0x49a749[_0x6cb6('0x5')],'exten':_0x49a749[_0x6cb6('0x6')],'priority':_0x2fc403[_0x6cb6('0x32')]['length']+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});_0x591438[_0x6cb6('0xc')]({'type':_0x2fc403[_0x6cb6('0x3')]['toLowerCase'](),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x41'),'context':_0x49a749['context'],'exten':_0x49a749[_0x6cb6('0x6')],'priority':_0x2fc403[_0x6cb6('0x32')][_0x6cb6('0x26')]+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});}else{_0x591438['push']({'type':_0x2fc403[_0x6cb6('0x3')][_0x6cb6('0x35')](),'app':_0x6cb6('0x15'),'appdata':_0x6cb6('0x42'),'context':_0x49a749[_0x6cb6('0x5')],'exten':_0x49a749[_0x6cb6('0x6')],'priority':_0x2fc403[_0x6cb6('0x32')][_0x6cb6('0x26')]+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});_0x591438[_0x6cb6('0xc')]({'type':_0x2fc403[_0x6cb6('0x3')]['toLowerCase'](),'app':_0x6cb6('0x4'),'appdata':_0x6cb6('0x43'),'context':_0x49a749['context'],'exten':_0x49a749[_0x6cb6('0x6')],'priority':_0x2fc403['intervals']['length']+_0x2978af+_0x5b9d1d++,'VoiceExtensionId':_0x49a749['id']});}}}}for(var _0x3844a9=0x0;_0x3844a9<_0x2fc403[_0x6cb6('0x32')][_0x6cb6('0x26')];_0x3844a9++){var _0x34ccd7=_0x2978af+_0x2fc403[_0x6cb6('0x32')]['length'];var _0x217165=_0x3844a9===_0x2fc403[_0x6cb6('0x32')]['length']-0x1?_0x2978af+_0x591438[_0x6cb6('0x26')]+_0x5e1492[_0x6cb6('0x26')]+0x2:_0x2978af+_0x3844a9+0x1;_0x591438[_0x6cb6('0x44')](_0x3844a9,0x0,{'type':_0x49a749['type'],'app':_0x6cb6('0x45'),'appdata':_0x2fc403[_0x6cb6('0x32')][_0x3844a9]+'?'+_0x49a749[_0x6cb6('0x5')]+_0x6cb6('0x46')+_0x34ccd7+':'+_0x49a749[_0x6cb6('0x5')]+',${EXTEN},'+_0x217165,'exten':_0x49a749[_0x6cb6('0x6')],'context':_0x49a749['context'],'priority':_0x2978af+_0x3844a9,'VoiceExtensionId':_0x49a749['id']});}if(_0x2fc403[_0x6cb6('0x3d')]==='outboundDial')_0x2fc403[_0x6cb6('0x47')]=_0x2f7c65(_0x49a749,_0x2fc403[_0x6cb6('0x47')]);_0x2fc403[_0x6cb6('0x48')]=_0x591438[_0x6cb6('0x26')]?_[_0x6cb6('0x49')](_0x591438)['priority']+0x1:_0x2978af;_0x392a73=_[_0x6cb6('0x4a')](_0x392a73,_0x591438,[_0x2fc403],_0x5e1492);_0x2978af=_[_0x6cb6('0x49')](_0x392a73)[_0x6cb6('0x48')]+0x1;}return _0x5e628f(_0x392a73);})[_0x6cb6('0x4b')](function(_0x4bb60e){_0x2aa2a9(_0x4bb60e);});});}return _0x1066ea[_0x6cb6('0x4c')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x6f01c2){var _0x1aec61=this[_0x6cb6('0x4d')]({'plain':!![]});var _0x5280aa=_0x1aec61[_0x6cb6('0x3')]===_0x6cb6('0x14')?_0x9c901a(_0x1aec61):_0x56618a(_0x1aec61);return _0x7bd70d(_0x1aec61,_0x6f01c2,_[_0x6cb6('0x49')](_0x5280aa)['priority']+0x1)[_0x6cb6('0x4e')](function(_0x2fdfd2){var _0xbed0fe=_[_0x6cb6('0x4a')](_0x5280aa,_0x2fdfd2);_0xbed0fe['push']({'type':_0x1aec61[_0x6cb6('0x3')],'app':'Hangup','exten':_0x1aec61[_0x6cb6('0x6')],'context':_0x1aec61[_0x6cb6('0x5')],'priority':_[_0x6cb6('0x49')](_0xbed0fe)['priority']+0x1,'VoiceExtensionId':_0x1aec61['id']});return _0xbed0fe;});}}});}; \ No newline at end of file +var _0x67e8=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','split','name','trunk','param','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','findAll','length','interval','intervals','IntervalId','filter','hasOwnProperty','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','context','exten','type','alias','NoOp','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0x154f66,_0x116f85){var _0x3f947a=function(_0x1f671e){while(--_0x1f671e){_0x154f66['push'](_0x154f66['shift']());}};_0x3f947a(++_0x116f85);}(_0x67e8,0x86));var _0x867e=function(_0x5b7f06,_0x3a8dd9){_0x5b7f06=_0x5b7f06-0x0;var _0x47db9e=_0x67e8[_0x5b7f06];return _0x47db9e;};'use strict';var _=require(_0x867e('0x0'));var attributes=require(_0x867e('0x1'));module[_0x867e('0x2')]=function(_0x5103f0){var _0x50f67e=_0x5103f0[_0x867e('0x3')];function _0x1c5070(_0x5f1a0d){var _0x5e90ca=0x2;var _0x1df4ee=[{'type':_0x5f1a0d['type'],'app':_0x867e('0x4'),'appdata':_0x867e('0x5')+_0x5f1a0d['type'],'context':_0x5f1a0d[_0x867e('0x6')],'exten':_0x5f1a0d[_0x867e('0x7')],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']},{'type':_0x5f1a0d[_0x867e('0x8')],'app':_0x5f1a0d[_0x867e('0x9')]?'Set':_0x867e('0xa'),'appdata':_0x5f1a0d[_0x867e('0x9')]?'CDR(routeAlias)='+_0x5f1a0d[_0x867e('0x9')]:'No\x20alias\x20set','context':_0x5f1a0d[_0x867e('0x6')],'exten':_0x5f1a0d[_0x867e('0x7')],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']}];if(_0x5f1a0d[_0x867e('0x8')]===_0x867e('0xb')){_0x1df4ee[_0x867e('0xc')]({'type':_0x867e('0xb'),'app':_0x867e('0x4'),'appdata':'CDR(routeid)='+_0x5f1a0d['id'],'context':_0x5f1a0d['context'],'exten':_0x5f1a0d['exten'],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']});}_0x1df4ee[_0x867e('0xc')]({'type':_0x5f1a0d[_0x867e('0x8')],'app':_0x867e('0x4'),'appdata':_0x867e('0xd'),'context':_0x5f1a0d['context'],'exten':_0x5f1a0d[_0x867e('0x7')],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']},{'type':_0x5f1a0d[_0x867e('0x8')],'app':'Set','appdata':_0x867e('0xe'),'context':_0x5f1a0d['context'],'exten':_0x5f1a0d[_0x867e('0x7')],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']},{'type':_0x5f1a0d[_0x867e('0x8')],'app':_0x867e('0x4'),'appdata':_0x867e('0xf'),'context':_0x5f1a0d[_0x867e('0x6')],'exten':_0x5f1a0d[_0x867e('0x7')],'priority':_0x5e90ca++,'VoiceExtensionId':_0x5f1a0d['id']});return _0x1df4ee;}function _0x5854cd(_0x53e0e0){var _0x3bbbf0=0x2;var _0x4e23af=[{'type':_0x867e('0x10'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0['exten'],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x53e0e0[_0x867e('0x9')]?_0x867e('0x4'):'NoOp','appdata':_0x53e0e0[_0x867e('0x9')]?_0x867e('0x11')+_0x53e0e0[_0x867e('0x9')]:'No\x20alias\x20set','context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x867e('0x12')+(_0x53e0e0[_0x867e('0x13')]?_0x867e('0x14')+_0x53e0e0['cutdigits']+'}':_0x867e('0x15')),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x867e('0x16')+_0x53e0e0['id'],'context':_0x53e0e0['context'],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x17'),'appdata':_0x867e('0x18')+(_0x3bbbf0+0x2)+_0x867e('0x19')+(_0x3bbbf0+0x1)+')','context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x53e0e0[_0x867e('0x13')]?_0x867e('0x1a')+_0x53e0e0[_0x867e('0x13')]+'}':_0x867e('0x1b'),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x867e('0xd'),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x867e('0xe'),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':'Set','appdata':_0x867e('0xf'),'context':_0x53e0e0['context'],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':'Set','appdata':_0x867e('0x1c')+_0x53e0e0['id'],'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']}];if(_0x53e0e0['hasOwnProperty'](_0x867e('0x1d'))&&_0x53e0e0['recordingFormat']!=='none'){_0x4e23af[_0x867e('0xc')]({'type':_0x867e('0x10'),'app':'Set','appdata':_0x867e('0x1e'),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0[_0x867e('0x7')],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']},{'type':_0x867e('0x10'),'app':_0x867e('0x4'),'appdata':_0x867e('0x1f')+_0x53e0e0[_0x867e('0x1d')]||_0x867e('0x20'),'context':_0x53e0e0[_0x867e('0x6')],'exten':_0x53e0e0['exten'],'priority':_0x3bbbf0++,'VoiceExtensionId':_0x53e0e0['id']});}return _0x4e23af;}function _0x16f8ae(_0x4342bd,_0x5afe80){var _0x30e93c=[{'name':'trunk','param':0x0},{'name':_0x867e('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':_0x867e('0x22'),'param':0x3}];var _0x5208cd={};var _0x173640=_0x5afe80[_0x867e('0x23')](',');var _0x4cf6f5=[];for(var _0x3212fe=0x0;_0x3212fe<_0x30e93c['length'];_0x3212fe++){switch(_0x30e93c[_0x3212fe][_0x867e('0x24')]){case _0x867e('0x25'):_0x5208cd[_0x867e('0x25')]=_0x173640[_0x30e93c[_0x3212fe][_0x867e('0x26')]][_0x867e('0x23')]('/')[0x1];_0x5208cd[_0x867e('0x27')]=_0x173640[_0x30e93c[_0x3212fe][_0x867e('0x26')]][_0x867e('0x23')]('/')[0x2];_0x5208cd[_0x867e('0x28')]=_0x5208cd[_0x867e('0x27')]?_0x5208cd[_0x867e('0x27')][_0x867e('0x23')]('$')[0x0]:undefined;_0x5208cd[_0x867e('0x27')]=_0x4342bd[_0x867e('0x13')]?(_0x5208cd[_0x867e('0x28')]||'')+_0x867e('0x14')+_0x4342bd[_0x867e('0x13')]+'}':(_0x5208cd['prefix']||'')+'${EXTEN}';_0x4cf6f5[_0x30e93c[_0x3212fe][_0x867e('0x26')]]=[_0x867e('0x29'),_0x5208cd[_0x867e('0x25')],_0x5208cd[_0x867e('0x27')]][_0x867e('0x2a')]('/');break;case _0x867e('0x2b'):_0x5208cd[_0x867e('0x2b')]=_0x173640[_0x30e93c[_0x3212fe][_0x867e('0x26')]];if(_0x4342bd[_0x867e('0x1d')]!=='none'){if(_0x5208cd[_0x867e('0x2b')][_0x867e('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x5208cd[_0x867e('0x2b')]+=_0x867e('0x2d');}}else{_0x5208cd['options']=_0x5208cd[_0x867e('0x2b')]['replace'](_0x867e('0x2d'),'');}_0x4cf6f5[_0x30e93c[_0x3212fe][_0x867e('0x26')]]=_0x5208cd[_0x867e('0x2b')];break;default:_0x4cf6f5[_0x30e93c[_0x3212fe][_0x867e('0x26')]]=_0x173640[_0x30e93c[_0x3212fe][_0x867e('0x26')]];}}return _0x4cf6f5[_0x867e('0x2a')](',');}function _0x37172c(_0x1db66d,_0x5a4c02,_0x4e808e){return new Promise(function(_0x3db321,_0x261606){var _0x5bff11=[];if(_['isEmpty'](_0x5a4c02))return _0x3db321(_0x5bff11);_0x50f67e['Interval'][_0x867e('0x2e')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x38c6c6){for(var _0x1f9061=0x0,_0x384a06=0x0;_0x1f9061<_0x5a4c02[_0x867e('0x2f')];_0x1f9061++,_0x384a06=0x0){var _0x3833ba=_0x5a4c02[_0x1f9061];var _0xc95688=[];var _0x2736e8=[];delete _0x3833ba['id'];if(_0x3833ba[_0x867e('0x30')]!=='*,*,*,*'){_0x3833ba[_0x867e('0x31')]=[_0x3833ba['interval']];}else{_0x3833ba[_0x867e('0x31')]=_0x3833ba[_0x867e('0x32')]?_['map'](_[_0x867e('0x33')](_0x38c6c6,{'IntervalId':_0x3833ba[_0x867e('0x32')]}),_0x867e('0x30')):[];}_0x3833ba[_0x867e('0x6')]=_0x1db66d[_0x867e('0x6')];_0x3833ba[_0x867e('0x7')]=_0x1db66d[_0x867e('0x7')];if(_0x3833ba[_0x867e('0x8')])_0x3833ba[_0x867e('0x8')]=_0x3833ba[_0x867e('0x8')]['toLowerCase']();if(_0x1db66d[_0x867e('0x8')]==='outbound'){if(_0x3833ba[_0x867e('0x34')](_0x867e('0x35'))&&_0x3833ba[_0x867e('0x35')]&&_0x3833ba[_0x867e('0x35')]!=='--'){_0xc95688[_0x867e('0xc')]({'type':_0x3833ba['type']['toLowerCase'](),'app':'Set','appdata':_0x867e('0x36')+_0x3833ba[_0x867e('0x35')],'context':_0x1db66d[_0x867e('0x6')],'exten':_0x1db66d[_0x867e('0x7')],'priority':_0x3833ba[_0x867e('0x31')][_0x867e('0x2f')]+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});}_0xc95688['push']({'type':_0x3833ba[_0x867e('0x8')][_0x867e('0x37')](),'app':_0x867e('0x17'),'appdata':_0x867e('0x38')+(_0x3833ba[_0x867e('0x39')]?_0x867e('0x3a')+_0x3833ba['callerID']+')':_0x867e('0x3b')),'context':_0x1db66d[_0x867e('0x6')],'exten':_0x1db66d['exten'],'priority':_0x3833ba[_0x867e('0x31')]['length']+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});}else{if(_0x3833ba[_0x867e('0x34')](_0x867e('0x3c'))){if([_0x867e('0x3d'),'playback'][_0x867e('0x3e')](_0x3833ba[_0x867e('0x3f')][_0x867e('0x37')]())&&_0x3833ba[_0x867e('0x40')]!==_0x867e('0x41')){if(_0x3833ba[_0x867e('0x3c')]){_0xc95688['push']({'type':_0x3833ba[_0x867e('0x8')][_0x867e('0x37')](),'app':_0x867e('0x17'),'appdata':_0x867e('0x42'),'context':_0x1db66d['context'],'exten':_0x1db66d[_0x867e('0x7')],'priority':_0x3833ba[_0x867e('0x31')][_0x867e('0x2f')]+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});_0xc95688[_0x867e('0xc')]({'type':_0x3833ba['type'][_0x867e('0x37')](),'app':_0x867e('0x4'),'appdata':_0x867e('0x43'),'context':_0x1db66d[_0x867e('0x6')],'exten':_0x1db66d[_0x867e('0x7')],'priority':_0x3833ba['intervals'][_0x867e('0x2f')]+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});}else{_0xc95688[_0x867e('0xc')]({'type':_0x3833ba[_0x867e('0x8')][_0x867e('0x37')](),'app':_0x867e('0x17'),'appdata':_0x867e('0x44'),'context':_0x1db66d[_0x867e('0x6')],'exten':_0x1db66d['exten'],'priority':_0x3833ba[_0x867e('0x31')]['length']+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});_0xc95688['push']({'type':_0x3833ba[_0x867e('0x8')][_0x867e('0x37')](),'app':_0x867e('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1db66d[_0x867e('0x6')],'exten':_0x1db66d[_0x867e('0x7')],'priority':_0x3833ba[_0x867e('0x31')][_0x867e('0x2f')]+_0x4e808e+_0x384a06++,'VoiceExtensionId':_0x1db66d['id']});}}}}for(var _0x300e34=0x0;_0x300e34<_0x3833ba['intervals'][_0x867e('0x2f')];_0x300e34++){var _0x55223e=_0x4e808e+_0x3833ba[_0x867e('0x31')][_0x867e('0x2f')];var _0x2302d3=_0x300e34===_0x3833ba[_0x867e('0x31')][_0x867e('0x2f')]-0x1?_0x4e808e+_0xc95688[_0x867e('0x2f')]+_0x2736e8[_0x867e('0x2f')]+0x2:_0x4e808e+_0x300e34+0x1;_0xc95688[_0x867e('0x45')](_0x300e34,0x0,{'type':_0x1db66d['type'],'app':_0x867e('0x46'),'appdata':_0x3833ba[_0x867e('0x31')][_0x300e34]+'?'+_0x1db66d[_0x867e('0x6')]+_0x867e('0x47')+_0x55223e+':'+_0x1db66d['context']+_0x867e('0x47')+_0x2302d3,'exten':_0x1db66d[_0x867e('0x7')],'context':_0x1db66d[_0x867e('0x6')],'priority':_0x4e808e+_0x300e34,'VoiceExtensionId':_0x1db66d['id']});}if(_0x3833ba[_0x867e('0x40')]===_0x867e('0x48'))_0x3833ba[_0x867e('0x49')]=_0x16f8ae(_0x1db66d,_0x3833ba[_0x867e('0x49')]);_0x3833ba[_0x867e('0x4a')]=_0xc95688['length']?_[_0x867e('0x4b')](_0xc95688)['priority']+0x1:_0x4e808e;_0x5bff11=_['concat'](_0x5bff11,_0xc95688,[_0x3833ba],_0x2736e8);_0x4e808e=_[_0x867e('0x4b')](_0x5bff11)[_0x867e('0x4a')]+0x1;}return _0x3db321(_0x5bff11);})['catch'](function(_0x300d7b){_0x261606(_0x300d7b);});});}return _0x5103f0[_0x867e('0x4c')](_0x867e('0x4d'),attributes,{'tableName':_0x867e('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3b9f4f){var _0x98c408=this[_0x867e('0x4f')]({'plain':!![]});var _0x3f6702=_0x98c408[_0x867e('0x8')]===_0x867e('0x10')?_0x5854cd(_0x98c408):_0x1c5070(_0x98c408);return _0x37172c(_0x98c408,_0x3b9f4f,_[_0x867e('0x4b')](_0x3f6702)[_0x867e('0x4a')]+0x1)[_0x867e('0x50')](function(_0x2b8081){var _0x57cec8=_['concat'](_0x3f6702,_0x2b8081);_0x57cec8['push']({'type':_0x98c408[_0x867e('0x8')],'app':_0x867e('0x51'),'exten':_0x98c408[_0x867e('0x7')],'context':_0x98c408[_0x867e('0x6')],'priority':_[_0x867e('0x4b')](_0x57cec8)[_0x867e('0x4a')]+0x1,'VoiceExtensionId':_0x98c408['id']});return _0x57cec8;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 14051d6..8290cf1 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 _0x2706=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','request\x20sent','debug','error','code','message','info','VoiceExtension,\x20%s,\x20%s','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','map','include','model','stringify','catch','util','moment','bluebird'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x2706,0x107));var _0x6270=function(_0x3d0975,_0x198b9f){_0x3d0975=_0x3d0975-0x0;var _0x33b959=_0x2706[_0x3d0975];return _0x33b959;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var moment=require(_0x6270('0x1'));var BPromise=require(_0x6270('0x2'));var rs=require(_0x6270('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6270('0x4'))['db'];var utils=require(_0x6270('0x5'));var logger=require(_0x6270('0x6'))(_0x6270('0x7'));var config=require(_0x6270('0x8'));var jayson=require(_0x6270('0x9'));var client=jayson[_0x6270('0xa')][_0x6270('0xb')]({'port':0x232a});config['redis']=_[_0x6270('0xc')](config[_0x6270('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6270('0xe'))(new Redis(config[_0x6270('0xd')]));require(_0x6270('0xf'))[_0x6270('0x10')](socket);function respondWithRpcPromise(_0x11f3a8,_0x2764de,_0x5d2e8e){return new BPromise(function(_0x97ee0d,_0x37ebc9){return client[_0x6270('0x11')](_0x11f3a8,_0x5d2e8e)[_0x6270('0x12')](function(_0x25537b){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x6270('0x13'));logger[_0x6270('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x2764de,'request\x20sent',JSON['stringify'](_0x25537b));if(_0x25537b[_0x6270('0x15')]){if(_0x25537b['error'][_0x6270('0x16')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x25537b['error'][_0x6270('0x17')]);return _0x37ebc9(_0x25537b[_0x6270('0x15')][_0x6270('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x2764de,_0x25537b[_0x6270('0x15')]['message']);return _0x97ee0d(_0x25537b[_0x6270('0x15')][_0x6270('0x17')]);}else{logger[_0x6270('0x18')](_0x6270('0x19'),_0x2764de,_0x6270('0x13'));_0x97ee0d(_0x25537b['result'][_0x6270('0x17')]);}})['catch'](function(_0x273478){logger[_0x6270('0x15')](_0x6270('0x19'),_0x2764de,_0x273478);_0x37ebc9(_0x273478);});});}exports[_0x6270('0x1a')]=function(_0x184d69){var _0x1991d1=this;return new Promise(function(_0x1cb956,_0x3c1c02){return db[_0x6270('0x1b')][_0x6270('0x1c')]({'raw':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')][_0x6270('0x1e')]||null:null,'attributes':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')][_0x6270('0x1f')]||null:null,'limit':_0x184d69[_0x6270('0x1d')]?_0x184d69['options'][_0x6270('0x20')]||null:null,'include':_0x184d69[_0x6270('0x1d')]?_0x184d69[_0x6270('0x1d')]['include']?_[_0x6270('0x21')](_0x184d69[_0x6270('0x1d')][_0x6270('0x22')],function(_0x42267c){return{'model':db[_0x42267c[_0x6270('0x23')]],'as':_0x42267c['as'],'attributes':_0x42267c[_0x6270('0x1f')],'include':_0x42267c['include']?_[_0x6270('0x21')](_0x42267c[_0x6270('0x22')],function(_0x247a4d){return{'model':db[_0x247a4d[_0x6270('0x23')]],'as':_0x247a4d['as'],'attributes':_0x247a4d[_0x6270('0x1f')],'include':_0x247a4d['include']?_['map'](_0x247a4d[_0x6270('0x22')],function(_0x4dfc58){return{'model':db[_0x4dfc58[_0x6270('0x23')]],'as':_0x4dfc58['as'],'attributes':_0x4dfc58[_0x6270('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4ee0){logger[_0x6270('0x18')]('GetVoiceExtension',_0x184d69);logger[_0x6270('0x14')](_0x6270('0x1a'),_0x184d69,JSON[_0x6270('0x24')](_0x4f4ee0));_0x1cb956(_0x4f4ee0);})[_0x6270('0x25')](function(_0x2a0164){logger['error'](_0x6270('0x1a'),_0x2a0164[_0x6270('0x17')],_0x184d69);_0x3c1c02(_0x1991d1[_0x6270('0x15')](0x1f4,_0x2a0164[_0x6270('0x17')]));});});}; \ No newline at end of file +var _0x565f=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','model','map','info','catch','util','moment','bluebird','ioredis'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x565f,0x68));var _0xf565=function(_0x6e2bdc,_0x8de06e){_0x6e2bdc=_0x6e2bdc-0x0;var _0x2a4178=_0x565f[_0x6e2bdc];return _0x2a4178;};'use strict';var _=require('lodash');var util=require(_0xf565('0x0'));var moment=require(_0xf565('0x1'));var BPromise=require(_0xf565('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf565('0x3'));var db=require(_0xf565('0x4'))['db'];var utils=require(_0xf565('0x5'));var logger=require(_0xf565('0x6'))(_0xf565('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf565('0x8')]({'port':0x232a});config['redis']=_[_0xf565('0x9')](config[_0xf565('0xa')],{'host':_0xf565('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf565('0xa')]));require('./voiceExtension.socket')[_0xf565('0xc')](socket);function respondWithRpcPromise(_0x5aaa3f,_0x2d7f4e,_0x1a362d){return new BPromise(function(_0x80b001,_0x1bc33c){return client[_0xf565('0xd')](_0x5aaa3f,_0x1a362d)[_0xf565('0xe')](function(_0x4c13ed){logger['info'](_0xf565('0xf'),_0x2d7f4e,_0xf565('0x10'));logger[_0xf565('0x11')](_0xf565('0x12'),_0x2d7f4e,_0xf565('0x10'),JSON[_0xf565('0x13')](_0x4c13ed));if(_0x4c13ed[_0xf565('0x14')]){if(_0x4c13ed[_0xf565('0x14')][_0xf565('0x15')]===0x1f4){logger[_0xf565('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x2d7f4e,_0x4c13ed[_0xf565('0x14')][_0xf565('0x16')]);return _0x1bc33c(_0x4c13ed['error'][_0xf565('0x16')]);}logger[_0xf565('0x14')](_0xf565('0xf'),_0x2d7f4e,_0x4c13ed[_0xf565('0x14')][_0xf565('0x16')]);return _0x80b001(_0x4c13ed['error'][_0xf565('0x16')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x2d7f4e,_0xf565('0x10'));_0x80b001(_0x4c13ed[_0xf565('0x17')]['message']);}})['catch'](function(_0x2d2197){logger['error'](_0xf565('0xf'),_0x2d7f4e,_0x2d2197);_0x1bc33c(_0x2d2197);});});}exports[_0xf565('0x18')]=function(_0x1f364e){var _0x51215d=this;return new Promise(function(_0x55032c,_0xb7b197){return db[_0xf565('0x19')][_0xf565('0x1a')]({'raw':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1c')]||null:null,'attributes':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1d')]||null:null,'limit':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1e')]||null:null,'include':_0x1f364e[_0xf565('0x1b')]?_0x1f364e['options'][_0xf565('0x1f')]?_['map'](_0x1f364e[_0xf565('0x1b')][_0xf565('0x1f')],function(_0x50da32){return{'model':db[_0x50da32[_0xf565('0x20')]],'as':_0x50da32['as'],'attributes':_0x50da32[_0xf565('0x1d')],'include':_0x50da32[_0xf565('0x1f')]?_[_0xf565('0x21')](_0x50da32[_0xf565('0x1f')],function(_0x1239a7){return{'model':db[_0x1239a7[_0xf565('0x20')]],'as':_0x1239a7['as'],'attributes':_0x1239a7[_0xf565('0x1d')],'include':_0x1239a7['include']?_[_0xf565('0x21')](_0x1239a7[_0xf565('0x1f')],function(_0x18082a){return{'model':db[_0x18082a[_0xf565('0x20')]],'as':_0x18082a['as'],'attributes':_0x18082a[_0xf565('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2288db){logger[_0xf565('0x22')](_0xf565('0x18'),_0x1f364e);logger[_0xf565('0x11')](_0xf565('0x18'),_0x1f364e,JSON['stringify'](_0x2288db));_0x55032c(_0x2288db);})[_0xf565('0x23')](function(_0x41d6bf){logger[_0xf565('0x14')](_0xf565('0x18'),_0x41d6bf[_0xf565('0x16')],_0x1f364e);_0xb7b197(_0x51215d[_0xf565('0x14')](0x1f4,_0x41d6bf['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 14da952..733629e 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(_0x3334d3,_0x231fa5){var _0x3991e9=function(_0x4f465b){while(--_0x4f465b){_0x3334d3['push'](_0x3334d3['shift']());}};_0x3991e9(++_0x231fa5);}(_0x5fab,0x177));var _0xb5fa=function(_0x192099,_0x38a593){_0x192099=_0x192099-0x0;var _0x3d6ccc=_0x5fab[_0x192099];return _0x3d6ccc;};'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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x814b,0x1a2));var _0xb814=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x814b[_0x489b87];return _0x1823b6;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index f5425d3..a634898 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 _0x5d58=['getMessages','post','update','delete','/:id','destroy','exports','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/messages'];(function(_0x3a18f3,_0xa6b079){var _0x431120=function(_0x3ce96e){while(--_0x3ce96e){_0x3a18f3['push'](_0x3a18f3['shift']());}};_0x431120(++_0xa6b079);}(_0x5d58,0x187));var _0x85d5=function(_0x276c66,_0x214f8e){_0x276c66=_0x276c66-0x0;var _0x5f60a=_0x5d58[_0x276c66];return _0x5f60a;};'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[_0x85d5('0x0')]();var fs_extra=require(_0x85d5('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var controller=require('./voiceMail.controller');router[_0x85d5('0x4')]('/',auth[_0x85d5('0x5')](),controller[_0x85d5('0x6')]);router[_0x85d5('0x4')]('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0x7')]);router['get'](_0x85d5('0x8'),auth['isAuthenticated'](),controller[_0x85d5('0x9')]);router[_0x85d5('0xa')]('/',auth[_0x85d5('0x5')](),controller['create']);router['put']('/:id',auth[_0x85d5('0x5')](),controller[_0x85d5('0xb')]);router[_0x85d5('0xc')](_0x85d5('0xd'),auth[_0x85d5('0x5')](),controller[_0x85d5('0xe')]);module[_0x85d5('0xf')]=router; \ No newline at end of file +var _0x6a55=['isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get'];(function(_0x13a621,_0x29b45c){var _0x19c55d=function(_0x5b2876){while(--_0x5b2876){_0x13a621['push'](_0x13a621['shift']());}};_0x19c55d(++_0x29b45c);}(_0x6a55,0xdb));var _0x56a5=function(_0x2dd6b1,_0x4485d7){_0x2dd6b1=_0x2dd6b1-0x0;var _0x494306=_0x6a55[_0x2dd6b1];return _0x494306;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x56a5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x56a5('0x3'));var controller=require('./voiceMail.controller');router[_0x56a5('0x4')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0x6')]);router[_0x56a5('0x4')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x4')]('/:id/messages',auth[_0x56a5('0x5')](),controller[_0x56a5('0x9')]);router[_0x56a5('0xa')]('/',auth[_0x56a5('0x5')](),controller[_0x56a5('0xb')]);router[_0x56a5('0xc')](_0x56a5('0x7'),auth[_0x56a5('0x5')](),controller[_0x56a5('0xd')]);router['delete']('/:id',auth[_0x56a5('0x5')](),controller[_0x56a5('0xe')]);module[_0x56a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d4be9b4..7f8ebb0 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 _0x2d77=['string','trim','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x55569a,_0x4c78b5){var _0x2f6046=function(_0x2a4a8c){while(--_0x2a4a8c){_0x55569a['push'](_0x55569a['shift']());}};_0x2f6046(++_0x4c78b5);}(_0x2d77,0x119));var _0x72d7=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x2d77[_0x18a79d];return _0x4f8848;};'use strict';var Sequelize=require(_0x72d7('0x0'));module[_0x72d7('0x1')]={'customer_id':{'type':Sequelize[_0x72d7('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x72d7('0x3'),'unique':_0x72d7('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x72d7('0x4')},'password':{'type':Sequelize[_0x72d7('0x2')]},'fullname':{'type':Sequelize[_0x72d7('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x50512a){this[_0x72d7('0x5')](_0x72d7('0x6'),typeof _0x50512a===_0x72d7('0x7')&&_0x50512a[_0x72d7('0x8')]()?_0x50512a[_0x72d7('0x8')]():null);}},'pager':{'type':Sequelize[_0x72d7('0x2')]},'tz':{'type':Sequelize[_0x72d7('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x72d7('0x9'),'no'),'defaultValue':_0x72d7('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':_0x72d7('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x72d7('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x72d7('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x72d7('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x72d7('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x72d7('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x72d7('0x9'),'no'),'defaultValue':_0x72d7('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x72d7('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x72d7('0xa')](_0x72d7('0x9'),'no'),'defaultValue':_0x72d7('0x9'),'allowNull':![]},'stamp':{'type':_0x72d7('0xc')},'emailsubject':{'type':Sequelize[_0x72d7('0x2')]},'emailbody':{'type':Sequelize[_0x72d7('0x2')]},'maxsecs':{'type':Sequelize[_0x72d7('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x72d7('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x72d7('0xe')],'get':function(){return this[_0x72d7('0xf')](_0x72d7('0x10'))+'\x20-\x20'+this[_0x72d7('0xf')](_0x72d7('0x11'));}}}; \ No newline at end of file +var _0xe700=['\x20-\x20','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','getDataValue'];(function(_0x20e1de,_0x51f3a5){var _0x423b33=function(_0x15afef){while(--_0x15afef){_0x20e1de['push'](_0x20e1de['shift']());}};_0x423b33(++_0x51f3a5);}(_0xe700,0x197));var _0x0e70=function(_0x1d9cd2,_0x4d9e52){_0x1d9cd2=_0x1d9cd2-0x0;var _0x476452=_0xe700[_0x1d9cd2];return _0x476452;};'use strict';var Sequelize=require('sequelize');module[_0x0e70('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0e70('0x1')],'defaultValue':_0x0e70('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x0e70('0x1')],'defaultValue':'','allowNull':![],'unique':_0x0e70('0x3')},'password':{'type':Sequelize[_0x0e70('0x1')]},'fullname':{'type':Sequelize[_0x0e70('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xefbde8){this[_0x0e70('0x4')]('email',typeof _0xefbde8===_0x0e70('0x5')&&_0xefbde8[_0x0e70('0x6')]()?_0xefbde8[_0x0e70('0x6')]():null);}},'pager':{'type':Sequelize[_0x0e70('0x1')]},'tz':{'type':Sequelize[_0x0e70('0x1')],'defaultValue':_0x0e70('0x7')},'attach':{'type':Sequelize[_0x0e70('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':_0x0e70('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0e70('0x1')]},'callback':{'type':Sequelize[_0x0e70('0x1')]},'review':{'type':Sequelize[_0x0e70('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':_0x0e70('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0e70('0x8')](_0x0e70('0x9'),'no'),'defaultValue':_0x0e70('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0e70('0x1')]},'maxsecs':{'type':Sequelize[_0x0e70('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0e70('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0e70('0xb')],'get':function(){return this[_0x0e70('0xc')]('fullname')+_0x0e70('0xd')+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 753a4d2..b76dde2 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 _0xee5b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','VoiceMail','includeAll','include','rows','catch','show','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','nolimit','sort','findAndCountAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xee5b,0x1f4));var _0xbee5=function(_0x24c1ac,_0x3fb009){_0x24c1ac=_0x24c1ac-0x0;var _0xd8d885=_0xee5b[_0x24c1ac];return _0xd8d885;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];function respondWithStatusCode(_0xcef158,_0x48f771){_0x48f771=_0x48f771||0xcc;return function(_0x14e032){if(_0x14e032){return _0xcef158['sendStatus'](_0x48f771);}return _0xcef158[_0xbee5('0x17')](_0x48f771)[_0xbee5('0x18')]();};}function respondWithResult(_0x8a268f,_0x593ecb){_0x593ecb=_0x593ecb||0xc8;return function(_0x5092f2){if(_0x5092f2){return _0x8a268f[_0xbee5('0x17')](_0x593ecb)['json'](_0x5092f2);}};}function respondWithFilteredResult(_0x40afcb,_0x5426c9){return function(_0x1a24bd){if(_0x1a24bd){var _0x141878=typeof _0x5426c9[_0xbee5('0x19')]==='undefined'&&typeof _0x5426c9[_0xbee5('0x1a')]===_0xbee5('0x1b');var _0x5a0ae5=_0x1a24bd[_0xbee5('0x1c')];var _0x538460=_0x141878?0x0:_0x5426c9[_0xbee5('0x19')];var _0x3c3f4e=_0x141878?_0x1a24bd[_0xbee5('0x1c')]:_0x5426c9[_0xbee5('0x19')]+_0x5426c9[_0xbee5('0x1a')];var _0xa50ec9;if(_0x3c3f4e>=_0x5a0ae5){_0x3c3f4e=_0x5a0ae5;_0xa50ec9=0xc8;}else{_0xa50ec9=0xce;}_0x40afcb[_0xbee5('0x17')](_0xa50ec9);return _0x40afcb[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x538460+'-'+_0x3c3f4e+'/'+_0x5a0ae5)[_0xbee5('0x1f')](_0x1a24bd);}return null;};}function patchUpdates(_0x35d7d3){return function(_0x40a06){try{jsonpatch[_0xbee5('0x20')](_0x40a06,_0x35d7d3,!![]);}catch(_0x47af8e){return BPromise['reject'](_0x47af8e);}return _0x40a06[_0xbee5('0x21')]();};}function saveUpdates(_0x48bfb5,_0x205491){return function(_0x117cb3){if(_0x117cb3){return _0x117cb3[_0xbee5('0x22')](_0x48bfb5)[_0xbee5('0x23')](function(_0x3f23c5){return _0x3f23c5;});}return null;};}function removeEntity(_0xb665df,_0x359ccf){return function(_0x3cfa8d){if(_0x3cfa8d){return _0x3cfa8d[_0xbee5('0x24')]()['then'](function(){var _0x5b43b3=_0x3cfa8d['get']({'plain':!![]});var _0x519473='Voicemails';return db[_0xbee5('0x25')][_0xbee5('0x24')]({'where':{'type':_0x519473,'resourceId':_0x5b43b3['id']}})[_0xbee5('0x23')](function(){return _0x3cfa8d;});})[_0xbee5('0x23')](function(){_0xb665df[_0xbee5('0x17')](0xcc)[_0xbee5('0x18')]();});}};}function handleEntityNotFound(_0x3c8643,_0x4e9a79){return function(_0x36b50f){if(!_0x36b50f){_0x3c8643[_0xbee5('0x26')](0x194);}return _0x36b50f;};}function handleError(_0x179d14,_0x39da95){_0x39da95=_0x39da95||0x1f4;return function(_0x1a8bcc){logger['error'](_0x1a8bcc[_0xbee5('0x27')]);if(_0x1a8bcc[_0xbee5('0x28')]){delete _0x1a8bcc[_0xbee5('0x28')];}_0x179d14[_0xbee5('0x17')](_0x39da95)[_0xbee5('0x29')](_0x1a8bcc);};}exports[_0xbee5('0x2a')]=function(_0x34b7df,_0x36e8bb){var _0x2ccb91={},_0x59c2e4={},_0x22df5f={'count':0x0,'rows':[]};var _0x5b10a6=_[_0xbee5('0x2b')](db['VoiceMail'][_0xbee5('0x2c')],function(_0x52dad9){return{'name':_0x52dad9[_0xbee5('0x2d')],'type':_0x52dad9['type'][_0xbee5('0x2e')]};});_0x59c2e4[_0xbee5('0x2f')]=_[_0xbee5('0x2b')](_0x5b10a6,_0xbee5('0x28'));_0x59c2e4['query']=_[_0xbee5('0x30')](_0x34b7df[_0xbee5('0x31')]);_0x59c2e4[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x59c2e4['model'],_0x59c2e4[_0xbee5('0x31')]);_0x2ccb91[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x59c2e4[_0xbee5('0x2f')],qs['fields'](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x35')]));_0x2ccb91[_0xbee5('0x34')]=_0x2ccb91[_0xbee5('0x34')]['length']?_0x2ccb91[_0xbee5('0x34')]:_0x59c2e4['model'];if(!_0x34b7df[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2ccb91['limit']=qs[_0xbee5('0x1a')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2ccb91[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x34b7df[_0xbee5('0x31')][_0xbee5('0x19')]);}_0x2ccb91[_0xbee5('0x36')]=qs['sort'](_0x34b7df[_0xbee5('0x31')]['sort']);_0x2ccb91[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_[_0xbee5('0x38')](_0x34b7df[_0xbee5('0x31')],_0x59c2e4['filters']),_0x5b10a6);if(_0x34b7df[_0xbee5('0x31')]['filter']){_0x2ccb91['where']=_[_0xbee5('0x39')](_0x2ccb91[_0xbee5('0x37')],{'$or':_[_0xbee5('0x2b')](_0x5b10a6,function(_0x1974f2){if(_0x1974f2['type']!==_0xbee5('0x3a')){var _0x2819e2={};_0x2819e2[_0x1974f2[_0xbee5('0x28')]]={'$like':'%'+_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x2819e2;}})});}_0x2ccb91=_[_0xbee5('0x39')]({},_0x2ccb91,_0x34b7df[_0xbee5('0x3c')]);var _0x297294={'where':_0x2ccb91[_0xbee5('0x37')]};return db[_0xbee5('0x3d')]['count'](_0x297294)[_0xbee5('0x23')](function(_0x371015){_0x22df5f['count']=_0x371015;if(_0x34b7df[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x2ccb91[_0xbee5('0x3f')]=[{'all':!![]}];}return db[_0xbee5('0x3d')]['findAll'](_0x2ccb91);})['then'](function(_0x4b4641){_0x22df5f[_0xbee5('0x40')]=_0x4b4641;return _0x22df5f;})[_0xbee5('0x23')](respondWithFilteredResult(_0x36e8bb,_0x2ccb91))[_0xbee5('0x41')](handleError(_0x36e8bb,null));};exports[_0xbee5('0x42')]=function(_0x4012fd,_0x3f5441){var _0x41cea0={'raw':!![],'where':{'id':_0x4012fd[_0xbee5('0x43')]['id']}},_0x2c4464={};_0x2c4464['model']=_['keys'](db[_0xbee5('0x3d')]['rawAttributes']);_0x2c4464[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x4012fd['query']);_0x2c4464[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2c4464['model'],_0x2c4464['query']);_0x41cea0[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x2c4464['model'],qs[_0xbee5('0x35')](_0x4012fd[_0xbee5('0x31')]['fields']));_0x41cea0[_0xbee5('0x34')]=_0x41cea0[_0xbee5('0x34')][_0xbee5('0x44')]?_0x41cea0[_0xbee5('0x34')]:_0x2c4464[_0xbee5('0x2f')];if(_0x4012fd[_0xbee5('0x31')][_0xbee5('0x3e')]){_0x41cea0['include']=[{'all':!![]}];}_0x41cea0=_[_0xbee5('0x39')]({},_0x41cea0,_0x4012fd[_0xbee5('0x3c')]);return db[_0xbee5('0x3d')][_0xbee5('0x45')](_0x41cea0)['then'](handleEntityNotFound(_0x3f5441,null))[_0xbee5('0x23')](respondWithResult(_0x3f5441,null))[_0xbee5('0x41')](handleError(_0x3f5441,null));};exports[_0xbee5('0x46')]=function(_0x4aa21a,_0x44d4b1){return db[_0xbee5('0x3d')]['create'](_0x4aa21a['body'],{})['then'](function(_0x3a27bb){var _0x501167=_0x4aa21a[_0xbee5('0x47')][_0xbee5('0x48')]({'plain':!![]});if(!_0x501167)throw new Error(_0xbee5('0x49'));if(_0x501167[_0xbee5('0x4a')]===_0xbee5('0x47')){var _0x296fc8=_0x3a27bb['get']({'plain':!![]});var _0x24274d=_0xbee5('0x4b');return db[_0xbee5('0x4c')][_0xbee5('0x45')]({'where':{'name':_0x24274d,'userProfileId':_0x501167['userProfileId']},'raw':!![]})[_0xbee5('0x23')](function(_0x594dcf){if(_0x594dcf&&_0x594dcf[_0xbee5('0x4d')]===0x0){return db[_0xbee5('0x25')][_0xbee5('0x46')]({'name':_0x296fc8[_0xbee5('0x28')],'resourceId':_0x296fc8['id'],'type':_0x594dcf[_0xbee5('0x28')],'sectionId':_0x594dcf['id']},{})[_0xbee5('0x23')](function(){return _0x3a27bb;});}else{return _0x3a27bb;}})[_0xbee5('0x41')](function(_0x35f1d1){logger[_0xbee5('0x4e')](_0xbee5('0x4f'),_0x35f1d1);throw _0x35f1d1;});}return _0x3a27bb;})[_0xbee5('0x23')](respondWithResult(_0x44d4b1,0xc9))[_0xbee5('0x41')](handleError(_0x44d4b1,null));};exports[_0xbee5('0x22')]=function(_0x359738,_0x37cf74){if(_0x359738['body']['id']){delete _0x359738[_0xbee5('0x50')]['id'];}return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x359738['params']['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0x37cf74,null))[_0xbee5('0x23')](saveUpdates(_0x359738[_0xbee5('0x50')],null))['then'](respondWithResult(_0x37cf74,null))[_0xbee5('0x41')](handleError(_0x37cf74,null));};exports['destroy']=function(_0x131c45,_0x4ee645){return db[_0xbee5('0x3d')][_0xbee5('0x45')]({'where':{'id':_0x131c45[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ee645,null))['then'](removeEntity(_0x4ee645,null))['catch'](handleError(_0x4ee645,null));};exports[_0xbee5('0x51')]=function(_0x684cd4,_0xbc3da7,_0x5b1a05){return db[_0xbee5('0x3d')]['findOne']({'where':{'id':_0x684cd4[_0xbee5('0x43')]['id']}})[_0xbee5('0x23')](handleEntityNotFound(_0xbc3da7,null))[_0xbee5('0x23')](function(_0x5cc68d){var _0x154d44;var _0x2c0958={},_0x1c6f52={};_0x1c6f52[_0xbee5('0x2f')]=_[_0xbee5('0x30')](db[_0xbee5('0x52')][_0xbee5('0x2c')]);_0x1c6f52[_0xbee5('0x31')]=_[_0xbee5('0x30')](_0x684cd4[_0xbee5('0x31')]);_0x1c6f52[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],_0x1c6f52[_0xbee5('0x31')]);_0x2c0958[_0xbee5('0x34')]=_[_0xbee5('0x33')](_0x1c6f52[_0xbee5('0x2f')],qs['fields'](_0x684cd4[_0xbee5('0x31')]['fields']));_0x2c0958['attributes']=_0x2c0958[_0xbee5('0x34')][_0xbee5('0x44')]?_0x2c0958['attributes']:_0x1c6f52['model'];if(!_0x684cd4[_0xbee5('0x31')]['hasOwnProperty'](_0xbee5('0x53'))){_0x2c0958[_0xbee5('0x1a')]=qs['limit'](_0x684cd4[_0xbee5('0x31')][_0xbee5('0x1a')]);_0x2c0958[_0xbee5('0x19')]=qs[_0xbee5('0x19')](_0x684cd4['query'][_0xbee5('0x19')]);}_0x2c0958['order']=qs[_0xbee5('0x54')](_0x684cd4[_0xbee5('0x31')]['sort']);_0x2c0958[_0xbee5('0x37')]=qs[_0xbee5('0x32')](_['pick'](_0x684cd4[_0xbee5('0x31')],_0x1c6f52[_0xbee5('0x32')]));if(_0x684cd4['query'][_0xbee5('0x3b')]){_0x2c0958['where']=_[_0xbee5('0x39')](_0x2c0958['where'],{'$or':_[_0xbee5('0x2b')](_0x2c0958['attributes'],function(_0x541414){var _0x3120f5={};_0x3120f5[_0x541414]={'$like':'%'+_0x684cd4[_0xbee5('0x31')][_0xbee5('0x3b')]+'%'};return _0x3120f5;})});}_0x2c0958[_0xbee5('0x37')]=_[_0xbee5('0x39')](_0x2c0958[_0xbee5('0x37')],{'mailboxuser':_0x5cc68d['mailbox']});_0x2c0958=_[_0xbee5('0x39')]({},_0x2c0958,_0x684cd4[_0xbee5('0x3c')]);return db[_0xbee5('0x52')][_0xbee5('0x55')](_0x2c0958)[_0xbee5('0x23')](respondWithFilteredResult(_0xbc3da7,_0x2c0958));})[_0xbee5('0x41')](handleError(_0xbc3da7,null));}; \ No newline at end of file +var _0x373d=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','filter','VoiceMail','include','findAll','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','nolimit','pick','mailbox','options','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x551e38,_0x5011f6){var _0x1813fc=function(_0x190796){while(--_0x190796){_0x551e38['push'](_0x551e38['shift']());}};_0x1813fc(++_0x5011f6);}(_0x373d,0x1e2));var _0xd373=function(_0x18c8b5,_0x2a15d3){_0x18c8b5=_0x18c8b5-0x0;var _0x358984=_0x373d[_0x18c8b5];return _0x358984;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7f91,_0x5ab89c){_0x5ab89c=_0x5ab89c||0xcc;return function(_0xcd9b8c){if(_0xcd9b8c){return _0x4c7f91[_0xd373('0x15')](_0x5ab89c);}return _0x4c7f91['status'](_0x5ab89c)[_0xd373('0x16')]();};}function respondWithResult(_0x129475,_0x27c161){_0x27c161=_0x27c161||0xc8;return function(_0x23ed86){if(_0x23ed86){return _0x129475[_0xd373('0x17')](_0x27c161)[_0xd373('0x18')](_0x23ed86);}};}function respondWithFilteredResult(_0x20aca5,_0x2eacb1){return function(_0x5a286a){if(_0x5a286a){var _0x2c5854=typeof _0x2eacb1[_0xd373('0x19')]===_0xd373('0x1a')&&typeof _0x2eacb1[_0xd373('0x1b')]==='undefined';var _0x1e26cf=_0x5a286a['count'];var _0x460259=_0x2c5854?0x0:_0x2eacb1[_0xd373('0x19')];var _0x55c5c7=_0x2c5854?_0x5a286a[_0xd373('0x1c')]:_0x2eacb1['offset']+_0x2eacb1['limit'];var _0x23fada;if(_0x55c5c7>=_0x1e26cf){_0x55c5c7=_0x1e26cf;_0x23fada=0xc8;}else{_0x23fada=0xce;}_0x20aca5[_0xd373('0x17')](_0x23fada);return _0x20aca5[_0xd373('0x1d')](_0xd373('0x1e'),_0x460259+'-'+_0x55c5c7+'/'+_0x1e26cf)[_0xd373('0x18')](_0x5a286a);}return null;};}function patchUpdates(_0x181eb2){return function(_0x4ba510){try{jsonpatch[_0xd373('0x1f')](_0x4ba510,_0x181eb2,!![]);}catch(_0xd808f8){return BPromise[_0xd373('0x20')](_0xd808f8);}return _0x4ba510[_0xd373('0x21')]();};}function saveUpdates(_0x165e21,_0x3aa1c5){return function(_0x4f64bd){if(_0x4f64bd){return _0x4f64bd[_0xd373('0x22')](_0x165e21)[_0xd373('0x23')](function(_0x157f81){return _0x157f81;});}return null;};}function removeEntity(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(_0x238ffd){return _0x238ffd[_0xd373('0x24')]()[_0xd373('0x23')](function(){var _0x1ab540=_0x238ffd[_0xd373('0x25')]({'plain':!![]});var _0x437110=_0xd373('0x26');return db[_0xd373('0x27')][_0xd373('0x24')]({'where':{'type':_0x437110,'resourceId':_0x1ab540['id']}})[_0xd373('0x23')](function(){return _0x238ffd;});})[_0xd373('0x23')](function(){_0x209ca7[_0xd373('0x17')](0xcc)[_0xd373('0x16')]();});}};}function handleEntityNotFound(_0x3e657b,_0x470612){return function(_0x45ee58){if(!_0x45ee58){_0x3e657b[_0xd373('0x15')](0x194);}return _0x45ee58;};}function handleError(_0x71c5c,_0x3384a5){_0x3384a5=_0x3384a5||0x1f4;return function(_0xf85ca8){logger[_0xd373('0x28')](_0xf85ca8[_0xd373('0x29')]);if(_0xf85ca8[_0xd373('0x2a')]){delete _0xf85ca8[_0xd373('0x2a')];}_0x71c5c[_0xd373('0x17')](_0x3384a5)['send'](_0xf85ca8);};}exports[_0xd373('0x2b')]=function(_0x490842,_0x498aaa){var _0xedc8f3={},_0x15da6c={},_0x25e016={'count':0x0,'rows':[]};var _0x23024c=_[_0xd373('0x2c')](db['VoiceMail'][_0xd373('0x2d')],function(_0x104156){return{'name':_0x104156['fieldName'],'type':_0x104156[_0xd373('0x2e')][_0xd373('0x2f')]};});_0x15da6c[_0xd373('0x30')]=_[_0xd373('0x2c')](_0x23024c,_0xd373('0x2a'));_0x15da6c[_0xd373('0x31')]=_[_0xd373('0x32')](_0x490842[_0xd373('0x31')]);_0x15da6c[_0xd373('0x33')]=_['intersection'](_0x15da6c[_0xd373('0x30')],_0x15da6c[_0xd373('0x31')]);_0xedc8f3[_0xd373('0x34')]=_[_0xd373('0x35')](_0x15da6c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x490842[_0xd373('0x31')][_0xd373('0x36')]));_0xedc8f3[_0xd373('0x34')]=_0xedc8f3[_0xd373('0x34')][_0xd373('0x37')]?_0xedc8f3[_0xd373('0x34')]:_0x15da6c[_0xd373('0x30')];if(!_0x490842[_0xd373('0x31')][_0xd373('0x38')]('nolimit')){_0xedc8f3[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x490842[_0xd373('0x31')][_0xd373('0x1b')]);_0xedc8f3['offset']=qs[_0xd373('0x19')](_0x490842[_0xd373('0x31')][_0xd373('0x19')]);}_0xedc8f3[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x490842[_0xd373('0x31')]['sort']);_0xedc8f3['where']=qs[_0xd373('0x33')](_['pick'](_0x490842[_0xd373('0x31')],_0x15da6c[_0xd373('0x33')]),_0x23024c);if(_0x490842[_0xd373('0x31')]['filter']){_0xedc8f3[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0xedc8f3[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x23024c,function(_0x504450){if(_0x504450['type']!=='VIRTUAL'){var _0x11ec1b={};_0x11ec1b[_0x504450['name']]={'$like':'%'+_0x490842[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x11ec1b;}})});}_0xedc8f3=_['merge']({},_0xedc8f3,_0x490842['options']);var _0x5f3dd5={'where':_0xedc8f3[_0xd373('0x3b')]};return db[_0xd373('0x3e')][_0xd373('0x1c')](_0x5f3dd5)['then'](function(_0x5c3b22){_0x25e016[_0xd373('0x1c')]=_0x5c3b22;if(_0x490842[_0xd373('0x31')]['includeAll']){_0xedc8f3[_0xd373('0x3f')]=[{'all':!![]}];}return db[_0xd373('0x3e')][_0xd373('0x40')](_0xedc8f3);})[_0xd373('0x23')](function(_0x2d8c7d){_0x25e016['rows']=_0x2d8c7d;return _0x25e016;})['then'](respondWithFilteredResult(_0x498aaa,_0xedc8f3))[_0xd373('0x41')](handleError(_0x498aaa,null));};exports[_0xd373('0x42')]=function(_0x30b423,_0x302f65){var _0x5d4dd2={'raw':!![],'where':{'id':_0x30b423['params']['id']}},_0x29725c={};_0x29725c[_0xd373('0x30')]=_[_0xd373('0x32')](db[_0xd373('0x3e')][_0xd373('0x2d')]);_0x29725c[_0xd373('0x31')]=_['keys'](_0x30b423[_0xd373('0x31')]);_0x29725c[_0xd373('0x33')]=_['intersection'](_0x29725c[_0xd373('0x30')],_0x29725c[_0xd373('0x31')]);_0x5d4dd2[_0xd373('0x34')]=_[_0xd373('0x35')](_0x29725c[_0xd373('0x30')],qs[_0xd373('0x36')](_0x30b423[_0xd373('0x31')][_0xd373('0x36')]));_0x5d4dd2[_0xd373('0x34')]=_0x5d4dd2[_0xd373('0x34')]['length']?_0x5d4dd2['attributes']:_0x29725c[_0xd373('0x30')];if(_0x30b423['query'][_0xd373('0x43')]){_0x5d4dd2['include']=[{'all':!![]}];}_0x5d4dd2=_['merge']({},_0x5d4dd2,_0x30b423['options']);return db[_0xd373('0x3e')][_0xd373('0x44')](_0x5d4dd2)[_0xd373('0x23')](handleEntityNotFound(_0x302f65,null))[_0xd373('0x23')](respondWithResult(_0x302f65,null))[_0xd373('0x41')](handleError(_0x302f65,null));};exports[_0xd373('0x45')]=function(_0x1855aa,_0x4d1088){return db[_0xd373('0x3e')]['create'](_0x1855aa[_0xd373('0x46')],{})[_0xd373('0x23')](function(_0x5502e5){var _0x4517ab=_0x1855aa['user'][_0xd373('0x25')]({'plain':!![]});if(!_0x4517ab)throw new Error(_0xd373('0x47'));if(_0x4517ab[_0xd373('0x48')]===_0xd373('0x49')){var _0xe22cbd=_0x5502e5['get']({'plain':!![]});var _0x4971a0='Voicemails';return db[_0xd373('0x4a')][_0xd373('0x44')]({'where':{'name':_0x4971a0,'userProfileId':_0x4517ab['userProfileId']},'raw':!![]})[_0xd373('0x23')](function(_0x3e6766){if(_0x3e6766&&_0x3e6766['autoAssociation']===0x0){return db[_0xd373('0x27')][_0xd373('0x45')]({'name':_0xe22cbd[_0xd373('0x2a')],'resourceId':_0xe22cbd['id'],'type':_0x3e6766[_0xd373('0x2a')],'sectionId':_0x3e6766['id']},{})[_0xd373('0x23')](function(){return _0x5502e5;});}else{return _0x5502e5;}})[_0xd373('0x41')](function(_0xc255ec){logger[_0xd373('0x28')](_0xd373('0x4b'),_0xc255ec);throw _0xc255ec;});}return _0x5502e5;})[_0xd373('0x23')](respondWithResult(_0x4d1088,0xc9))[_0xd373('0x41')](handleError(_0x4d1088,null));};exports['update']=function(_0x4b2645,_0x51ca73){if(_0x4b2645['body']['id']){delete _0x4b2645['body']['id'];}return db['VoiceMail'][_0xd373('0x44')]({'where':{'id':_0x4b2645[_0xd373('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51ca73,null))['then'](saveUpdates(_0x4b2645['body'],null))[_0xd373('0x23')](respondWithResult(_0x51ca73,null))[_0xd373('0x41')](handleError(_0x51ca73,null));};exports['destroy']=function(_0x52fa5b,_0x2230d6){return db[_0xd373('0x3e')][_0xd373('0x44')]({'where':{'id':_0x52fa5b[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x2230d6,null))['then'](removeEntity(_0x2230d6,null))[_0xd373('0x41')](handleError(_0x2230d6,null));};exports[_0xd373('0x4d')]=function(_0x386e4c,_0x213da6,_0xc607fb){return db[_0xd373('0x3e')][_0xd373('0x4e')]({'where':{'id':_0x386e4c[_0xd373('0x4c')]['id']}})[_0xd373('0x23')](handleEntityNotFound(_0x213da6,null))[_0xd373('0x23')](function(_0x1c21d2){var _0x3ad1ec;var _0x213b3c={},_0x42e45d={};_0x42e45d[_0xd373('0x30')]=_['keys'](db[_0xd373('0x4f')][_0xd373('0x2d')]);_0x42e45d[_0xd373('0x31')]=_['keys'](_0x386e4c[_0xd373('0x31')]);_0x42e45d['filters']=_[_0xd373('0x35')](_0x42e45d['model'],_0x42e45d[_0xd373('0x31')]);_0x213b3c[_0xd373('0x34')]=_[_0xd373('0x35')](_0x42e45d[_0xd373('0x30')],qs[_0xd373('0x36')](_0x386e4c[_0xd373('0x31')][_0xd373('0x36')]));_0x213b3c[_0xd373('0x34')]=_0x213b3c[_0xd373('0x34')][_0xd373('0x37')]?_0x213b3c[_0xd373('0x34')]:_0x42e45d[_0xd373('0x30')];if(!_0x386e4c[_0xd373('0x31')][_0xd373('0x38')](_0xd373('0x50'))){_0x213b3c[_0xd373('0x1b')]=qs[_0xd373('0x1b')](_0x386e4c[_0xd373('0x31')][_0xd373('0x1b')]);_0x213b3c[_0xd373('0x19')]=qs[_0xd373('0x19')](_0x386e4c[_0xd373('0x31')][_0xd373('0x19')]);}_0x213b3c[_0xd373('0x39')]=qs[_0xd373('0x3a')](_0x386e4c[_0xd373('0x31')]['sort']);_0x213b3c[_0xd373('0x3b')]=qs[_0xd373('0x33')](_[_0xd373('0x51')](_0x386e4c['query'],_0x42e45d[_0xd373('0x33')]));if(_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]){_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'$or':_[_0xd373('0x2c')](_0x213b3c['attributes'],function(_0x1afe12){var _0x356820={};_0x356820[_0x1afe12]={'$like':'%'+_0x386e4c[_0xd373('0x31')][_0xd373('0x3d')]+'%'};return _0x356820;})});}_0x213b3c[_0xd373('0x3b')]=_[_0xd373('0x3c')](_0x213b3c[_0xd373('0x3b')],{'mailboxuser':_0x1c21d2[_0xd373('0x52')]});_0x213b3c=_['merge']({},_0x213b3c,_0x386e4c[_0xd373('0x53')]);return db['VoiceMailMessage'][_0xd373('0x54')](_0x213b3c)[_0xd373('0x23')](respondWithFilteredResult(_0x213da6,_0x213b3c));})[_0xd373('0x41')](handleError(_0x213da6,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 5a619d5..400cc9f 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 _0x33cf=['define','VoiceMail','voice_voicemail','mailbox_context','mailbox','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2bf969,_0x45cf9a){var _0xf14c99=function(_0x3e54c6){while(--_0x3e54c6){_0x2bf969['push'](_0x2bf969['shift']());}};_0xf14c99(++_0x45cf9a);}(_0x33cf,0x1ef));var _0xf33c=function(_0x119a47,_0x4babbb){_0x119a47=_0x119a47-0x0;var _0x591418=_0x33cf[_0x119a47];return _0x591418;};'use strict';var _=require('lodash');var util=require(_0xf33c('0x0'));var logger=require(_0xf33c('0x1'))(_0xf33c('0x2'));var moment=require(_0xf33c('0x3'));var BPromise=require(_0xf33c('0x4'));var rp=require(_0xf33c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf33c('0x6'));var config=require(_0xf33c('0x7'));var attributes=require('./voiceMail.attributes');module[_0xf33c('0x8')]=function(_0x19bb9d,_0x4089ff){return _0x19bb9d[_0xf33c('0x9')](_0xf33c('0xa'),attributes,{'tableName':_0xf33c('0xb'),'paranoid':![],'indexes':[{'name':_0xf33c('0xc'),'fields':[_0xf33c('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9169=['define','mailbox_context','mailbox','lodash','util','api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9169,0x1cb));var _0x9916=function(_0x1ab8c7,_0x28db6d){_0x1ab8c7=_0x1ab8c7-0x0;var _0x1b951f=_0x9169[_0x1ab8c7];return _0x1b951f;};'use strict';var _=require(_0x9916('0x0'));var util=require(_0x9916('0x1'));var logger=require('../../config/logger')(_0x9916('0x2'));var moment=require('moment');var BPromise=require(_0x9916('0x3'));var rp=require(_0x9916('0x4'));var fs=require('fs');var path=require(_0x9916('0x5'));var rimraf=require(_0x9916('0x6'));var config=require('../../config/environment');var attributes=require(_0x9916('0x7'));module[_0x9916('0x8')]=function(_0x197b17,_0xc728dc){return _0x197b17[_0x9916('0x9')]('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x9916('0xa'),'fields':[_0x9916('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4c4d44c..8767d18 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 _0xce50=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','ioredis'];(function(_0x168ded,_0x446b37){var _0x7c48c5=function(_0x1a7481){while(--_0x1a7481){_0x168ded['push'](_0x168ded['shift']());}};_0x7c48c5(++_0x446b37);}(_0xce50,0x1b5));var _0x0ce5=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xce50[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x0ce5('0x0'));var util=require(_0x0ce5('0x1'));var moment=require('moment');var BPromise=require(_0x0ce5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ce5('0x3'));var db=require(_0x0ce5('0x4'))['db'];var utils=require(_0x0ce5('0x5'));var logger=require(_0x0ce5('0x6'))('rpc');var config=require(_0x0ce5('0x7'));var jayson=require(_0x0ce5('0x8'));var client=jayson['client'][_0x0ce5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f405c,_0x4e752a,_0x395aa3){return new BPromise(function(_0x315bd1,_0x755556){return client[_0x0ce5('0xa')](_0x5f405c,_0x395aa3)[_0x0ce5('0xb')](function(_0x55b4d6){logger[_0x0ce5('0xc')](_0x0ce5('0xd'),_0x4e752a,_0x0ce5('0xe'));logger[_0x0ce5('0xf')](_0x0ce5('0x10'),_0x4e752a,_0x0ce5('0xe'),JSON[_0x0ce5('0x11')](_0x55b4d6));if(_0x55b4d6['error']){if(_0x55b4d6['error']['code']===0x1f4){logger['error'](_0x0ce5('0xd'),_0x4e752a,_0x55b4d6[_0x0ce5('0x12')][_0x0ce5('0x13')]);return _0x755556(_0x55b4d6[_0x0ce5('0x12')]['message']);}logger[_0x0ce5('0x12')](_0x0ce5('0xd'),_0x4e752a,_0x55b4d6[_0x0ce5('0x12')][_0x0ce5('0x13')]);return _0x315bd1(_0x55b4d6[_0x0ce5('0x12')]['message']);}else{logger['info'](_0x0ce5('0xd'),_0x4e752a,_0x0ce5('0xe'));_0x315bd1(_0x55b4d6['result'][_0x0ce5('0x13')]);}})[_0x0ce5('0x14')](function(_0x522236){logger['error'](_0x0ce5('0xd'),_0x4e752a,_0x522236);_0x755556(_0x522236);});});} \ No newline at end of file +var _0x15c8=['VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4e91de,_0x9f64b){var _0x25a433=function(_0x5d15bf){while(--_0x5d15bf){_0x4e91de['push'](_0x4e91de['shift']());}};_0x25a433(++_0x9f64b);}(_0x15c8,0x81));var _0x815c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x15c8[_0x432682];return _0x463d05;};'use strict';var _=require(_0x815c('0x0'));var util=require(_0x815c('0x1'));var moment=require('moment');var BPromise=require(_0x815c('0x2'));var rs=require(_0x815c('0x3'));var fs=require('fs');var Redis=require(_0x815c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x815c('0x5'))(_0x815c('0x6'));var config=require(_0x815c('0x7'));var jayson=require(_0x815c('0x8'));var client=jayson['client'][_0x815c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47587c,_0x3620a6,_0x558a16){return new BPromise(function(_0x438ca9,_0x257416){return client['request'](_0x47587c,_0x558a16)[_0x815c('0xa')](function(_0x45f1bc){logger[_0x815c('0xb')]('VoiceMail,\x20%s,\x20%s',_0x3620a6,_0x815c('0xc'));logger['debug'](_0x815c('0xd'),_0x3620a6,'request\x20sent',JSON[_0x815c('0xe')](_0x45f1bc));if(_0x45f1bc[_0x815c('0xf')]){if(_0x45f1bc[_0x815c('0xf')][_0x815c('0x10')]===0x1f4){logger[_0x815c('0xf')]('VoiceMail,\x20%s,\x20%s',_0x3620a6,_0x45f1bc[_0x815c('0xf')][_0x815c('0x11')]);return _0x257416(_0x45f1bc[_0x815c('0xf')][_0x815c('0x11')]);}logger[_0x815c('0xf')](_0x815c('0x12'),_0x3620a6,_0x45f1bc[_0x815c('0xf')]['message']);return _0x438ca9(_0x45f1bc[_0x815c('0xf')][_0x815c('0x11')]);}else{logger[_0x815c('0xb')]('VoiceMail,\x20%s,\x20%s',_0x3620a6,_0x815c('0xc'));_0x438ca9(_0x45f1bc[_0x815c('0x13')][_0x815c('0x11')]);}})[_0x815c('0x14')](function(_0x5f475e){logger['error'](_0x815c('0x12'),_0x3620a6,_0x5f475e);_0x257416(_0x5f475e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d24bf9b..7f2bd50 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 _0x8b98=['/:id','show','/:id/download','download','post','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x356801,_0xf50d95){var _0x479011=function(_0x28feaa){while(--_0x28feaa){_0x356801['push'](_0x356801['shift']());}};_0x479011(++_0xf50d95);}(_0x8b98,0x15c));var _0x88b9=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x8b98[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x88b9('0x0'));var util=require('util');var path=require(_0x88b9('0x1'));var timeout=require('connect-timeout');var express=require(_0x88b9('0x2'));var router=express[_0x88b9('0x3')]();var fs_extra=require(_0x88b9('0x4'));var auth=require(_0x88b9('0x5'));var interaction=require(_0x88b9('0x6'));var config=require(_0x88b9('0x7'));var controller=require(_0x88b9('0x8'));router[_0x88b9('0x9')]('/',auth[_0x88b9('0xa')](),controller[_0x88b9('0xb')]);router[_0x88b9('0x9')](_0x88b9('0xc'),auth[_0x88b9('0xa')](),controller[_0x88b9('0xd')]);router[_0x88b9('0x9')](_0x88b9('0xe'),auth[_0x88b9('0xa')](),controller[_0x88b9('0xf')]);router[_0x88b9('0x10')]('/',auth[_0x88b9('0xa')](),controller['create']);router['put'](_0x88b9('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x88b9('0xc'),auth[_0x88b9('0xa')](),controller['destroy']);module[_0x88b9('0x11')]=router; \ No newline at end of file +var _0x4423=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','delete','destroy','exports','util','path'];(function(_0x28f5e6,_0x4cef0b){var _0x391d87=function(_0x429fba){while(--_0x429fba){_0x28f5e6['push'](_0x28f5e6['shift']());}};_0x391d87(++_0x4cef0b);}(_0x4423,0x185));var _0x3442=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x4423[_0x1d87fc];return _0x492b56;};'use strict';var multer=require('multer');var util=require(_0x3442('0x0'));var path=require(_0x3442('0x1'));var timeout=require('connect-timeout');var express=require(_0x3442('0x2'));var router=express[_0x3442('0x3')]();var fs_extra=require(_0x3442('0x4'));var auth=require(_0x3442('0x5'));var interaction=require(_0x3442('0x6'));var config=require(_0x3442('0x7'));var controller=require('./voiceMailMessage.controller');router[_0x3442('0x8')]('/',auth[_0x3442('0x9')](),controller[_0x3442('0xa')]);router[_0x3442('0x8')]('/:id',auth[_0x3442('0x9')](),controller[_0x3442('0xb')]);router[_0x3442('0x8')](_0x3442('0xc'),auth['isAuthenticated'](),controller[_0x3442('0xd')]);router['post']('/',auth[_0x3442('0x9')](),controller['create']);router['put']('/:id',auth[_0x3442('0x9')](),controller['update']);router[_0x3442('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3442('0xf')]);module[_0x3442('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9001648..e4b0c45 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 _0x4578=['BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x34986b,_0x56fb4a){var _0x28a0d1=function(_0x2c1e2a){while(--_0x2c1e2a){_0x34986b['push'](_0x34986b['shift']());}};_0x28a0d1(++_0x56fb4a);}(_0x4578,0x100));var _0x8457=function(_0x36eec6,_0x281738){_0x36eec6=_0x36eec6-0x0;var _0x59b716=_0x4578[_0x36eec6];return _0x59b716;};'use strict';var Sequelize=require(_0x8457('0x0'));module[_0x8457('0x1')]={'name':{'type':Sequelize[_0x8457('0x2')],'get':function(_0x107479){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x8457('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8457('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8457('0x4')],'defaultValue':''},'stamp':{'type':_0x8457('0x6'),'defaultValue':Sequelize[_0x8457('0x7')](_0x8457('0x8'))}}; \ No newline at end of file +var _0x24d2=['INTEGER','STRING','BLOB','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x495c99,_0x38e03c){var _0xc3e091=function(_0x389122){while(--_0x389122){_0x495c99['push'](_0x495c99['shift']());}};_0xc3e091(++_0x38e03c);}(_0x24d2,0x1cc));var _0x224d=function(_0x1db09b,_0x2d9dbc){_0x1db09b=_0x1db09b-0x0;var _0x2d3691=_0x24d2[_0x1db09b];return _0x2d3691;};'use strict';var Sequelize=require(_0x224d('0x0'));module[_0x224d('0x1')]={'name':{'type':Sequelize[_0x224d('0x2')],'get':function(_0x27dbaa){return this[_0x224d('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x224d('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x224d('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x224d('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x224d('0x7'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 76d2daf..5c0f7c0 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 _0x113a=['length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','set','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','name','query','keys','filters','attributes','fields'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x113a,0xc6));var _0xa113=function(_0x4f0ab0,_0x354ce3){_0x4f0ab0=_0x4f0ab0-0x0;var _0x215a3b=_0x113a[_0x4f0ab0];return _0x215a3b;};'use strict';var emlformat=require(_0xa113('0x0'));var rimraf=require(_0xa113('0x1'));var zipdir=require(_0xa113('0x2'));var jsonpatch=require(_0xa113('0x3'));var rp=require(_0xa113('0x4'));var moment=require(_0xa113('0x5'));var BPromise=require(_0xa113('0x6'));var Mustache=require(_0xa113('0x7'));var util=require(_0xa113('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa113('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa113('0xa'));var _=require(_0xa113('0xb'));var squel=require(_0xa113('0xc'));var crypto=require('crypto');var jsforce=require(_0xa113('0xd'));var deskjs=require(_0xa113('0xe'));var toCsv=require(_0xa113('0x9'));var querystring=require('querystring');var Papa=require(_0xa113('0xf'));var Redis=require(_0xa113('0x10'));var authService=require(_0xa113('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa113('0x12'));var hardwareService=require(_0xa113('0x13'));var logger=require('../../config/logger')(_0xa113('0x14'));var utils=require(_0xa113('0x15'));var config=require(_0xa113('0x16'));var licenseUtil=require(_0xa113('0x17'));var db=require(_0xa113('0x18'))['db'];function respondWithStatusCode(_0x20a960,_0x1065cb){_0x1065cb=_0x1065cb||0xcc;return function(_0x1055e1){if(_0x1055e1){return _0x20a960[_0xa113('0x19')](_0x1065cb);}return _0x20a960[_0xa113('0x1a')](_0x1065cb)[_0xa113('0x1b')]();};}function respondWithResult(_0x2bc5b5,_0x154016){_0x154016=_0x154016||0xc8;return function(_0x200291){if(_0x200291){return _0x2bc5b5[_0xa113('0x1a')](_0x154016)[_0xa113('0x1c')](_0x200291);}};}function respondWithFilteredResult(_0x2d22d2,_0x2838d6){return function(_0x43c04a){if(_0x43c04a){var _0x1a68e6=typeof _0x2838d6[_0xa113('0x1d')]===_0xa113('0x1e')&&typeof _0x2838d6[_0xa113('0x1f')]===_0xa113('0x1e');var _0x4b89c7=_0x43c04a[_0xa113('0x20')];var _0x3842fd=_0x1a68e6?0x0:_0x2838d6[_0xa113('0x1d')];var _0x1c0529=_0x1a68e6?_0x43c04a[_0xa113('0x20')]:_0x2838d6[_0xa113('0x1d')]+_0x2838d6[_0xa113('0x1f')];var _0x41747e;if(_0x1c0529>=_0x4b89c7){_0x1c0529=_0x4b89c7;_0x41747e=0xc8;}else{_0x41747e=0xce;}_0x2d22d2[_0xa113('0x1a')](_0x41747e);return _0x2d22d2['set'](_0xa113('0x21'),_0x3842fd+'-'+_0x1c0529+'/'+_0x4b89c7)[_0xa113('0x1c')](_0x43c04a);}return null;};}function patchUpdates(_0x13eec2){return function(_0x502b39){try{jsonpatch['apply'](_0x502b39,_0x13eec2,!![]);}catch(_0x303916){return BPromise[_0xa113('0x22')](_0x303916);}return _0x502b39['save']();};}function saveUpdates(_0x28fb22,_0x24b1d5){return function(_0x4ed22c){if(_0x4ed22c){return _0x4ed22c[_0xa113('0x23')](_0x28fb22)[_0xa113('0x24')](function(_0x41eabd){return _0x41eabd;});}return null;};}function removeEntity(_0xbcecbc,_0x426df4){return function(_0x48264f){if(_0x48264f){return _0x48264f[_0xa113('0x25')]()[_0xa113('0x24')](function(){_0xbcecbc['status'](0xcc)[_0xa113('0x1b')]();});}};}function handleEntityNotFound(_0x27f188,_0x42c6be){return function(_0x2bedfb){if(!_0x2bedfb){_0x27f188[_0xa113('0x19')](0x194);}return _0x2bedfb;};}function handleError(_0x1b1ad8,_0x5e27bd){_0x5e27bd=_0x5e27bd||0x1f4;return function(_0x306926){logger[_0xa113('0x26')](_0x306926[_0xa113('0x27')]);if(_0x306926['name']){delete _0x306926['name'];}_0x1b1ad8[_0xa113('0x1a')](_0x5e27bd)['send'](_0x306926);};}exports['index']=function(_0x5de34e,_0x500a1e){var _0x3799a2={},_0x153d32={},_0x2d0f40={'count':0x0,'rows':[]};var _0x42a147=_[_0xa113('0x28')](db[_0xa113('0x29')][_0xa113('0x2a')],function(_0x5f351a){return{'name':_0x5f351a[_0xa113('0x2b')],'type':_0x5f351a[_0xa113('0x2c')][_0xa113('0x2d')]};});_0x153d32[_0xa113('0x2e')]=_[_0xa113('0x2f')](_[_0xa113('0x28')](_0x42a147,_0xa113('0x30')),[_0xa113('0x30')]);_0x153d32[_0xa113('0x31')]=_[_0xa113('0x32')](_0x5de34e[_0xa113('0x31')]);_0x153d32[_0xa113('0x33')]=_['intersection'](_0x153d32[_0xa113('0x2e')],_0x153d32['query']);_0x3799a2[_0xa113('0x34')]=_['intersection'](_0x153d32[_0xa113('0x2e')],qs[_0xa113('0x35')](_0x5de34e[_0xa113('0x31')][_0xa113('0x35')]));_0x3799a2[_0xa113('0x34')]=_0x3799a2[_0xa113('0x34')][_0xa113('0x36')]?_0x3799a2[_0xa113('0x34')]:_0x153d32[_0xa113('0x2e')];if(!_0x5de34e['query']['hasOwnProperty'](_0xa113('0x37'))){_0x3799a2['limit']=qs[_0xa113('0x1f')](_0x5de34e[_0xa113('0x31')][_0xa113('0x1f')]);_0x3799a2[_0xa113('0x1d')]=qs[_0xa113('0x1d')](_0x5de34e['query']['offset']);}_0x3799a2[_0xa113('0x38')]=qs[_0xa113('0x39')](_0x5de34e[_0xa113('0x31')]['sort']);_0x3799a2[_0xa113('0x3a')]=qs[_0xa113('0x33')](_[_0xa113('0x3b')](_0x5de34e['query'],_0x153d32[_0xa113('0x33')]),_0x42a147);if(_0x5de34e[_0xa113('0x31')][_0xa113('0x3c')]){_0x3799a2['where']=_[_0xa113('0x3d')](_0x3799a2['where'],{'$or':_[_0xa113('0x28')](_0x42a147,function(_0x43e92e){if(_0x43e92e[_0xa113('0x2c')]!==_0xa113('0x3e')){var _0xa146c3={};_0xa146c3[_0x43e92e[_0xa113('0x30')]]={'$like':'%'+_0x5de34e['query'][_0xa113('0x3c')]+'%'};return _0xa146c3;}})});}_0x3799a2=_['merge']({},_0x3799a2,_0x5de34e[_0xa113('0x3f')]);var _0x215387={'where':_0x3799a2[_0xa113('0x3a')]};return db[_0xa113('0x29')][_0xa113('0x20')](_0x215387)['then'](function(_0x136631){_0x2d0f40[_0xa113('0x20')]=_0x136631;if(_0x5de34e[_0xa113('0x31')][_0xa113('0x40')]){_0x3799a2[_0xa113('0x41')]=[{'all':!![]}];}return db[_0xa113('0x29')][_0xa113('0x42')](_0x3799a2);})[_0xa113('0x24')](function(_0xdca38a){_0x2d0f40[_0xa113('0x43')]=_0xdca38a;return _0x2d0f40;})[_0xa113('0x24')](respondWithFilteredResult(_0x500a1e,_0x3799a2))[_0xa113('0x44')](handleError(_0x500a1e,null));};exports['show']=function(_0x180cb5,_0x28677e){var _0x38065={'raw':!![],'where':{'id':_0x180cb5[_0xa113('0x45')]['id']}},_0x188cb0={};_0x188cb0[_0xa113('0x2e')]=_[_0xa113('0x32')](db[_0xa113('0x29')][_0xa113('0x2a')]);_0x188cb0['query']=_[_0xa113('0x32')](_0x180cb5[_0xa113('0x31')]);_0x188cb0[_0xa113('0x33')]=_[_0xa113('0x46')](_0x188cb0['model'],_0x188cb0[_0xa113('0x31')]);_0x38065[_0xa113('0x34')]=_[_0xa113('0x46')](_0x188cb0[_0xa113('0x2e')],qs[_0xa113('0x35')](_0x180cb5[_0xa113('0x31')][_0xa113('0x35')]));_0x38065['attributes']=_0x38065[_0xa113('0x34')][_0xa113('0x36')]?_0x38065[_0xa113('0x34')]:_0x188cb0[_0xa113('0x2e')];if(_0x180cb5['query']['includeAll']){_0x38065[_0xa113('0x41')]=[{'all':!![]}];}_0x38065=_[_0xa113('0x3d')]({},_0x38065,_0x180cb5[_0xa113('0x3f')]);return db[_0xa113('0x29')][_0xa113('0x47')](_0x38065)[_0xa113('0x24')](handleEntityNotFound(_0x28677e,null))[_0xa113('0x24')](respondWithResult(_0x28677e,null))[_0xa113('0x44')](handleError(_0x28677e,null));};exports[_0xa113('0x48')]=function(_0x5c7690,_0x76a2f3){return db[_0xa113('0x29')]['create'](_0x5c7690[_0xa113('0x49')],{})[_0xa113('0x24')](respondWithResult(_0x76a2f3,0xc9))['catch'](handleError(_0x76a2f3,null));};exports[_0xa113('0x23')]=function(_0x1bf9e1,_0x12eb4a){if(_0x1bf9e1[_0xa113('0x49')]['id']){delete _0x1bf9e1[_0xa113('0x49')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1bf9e1[_0xa113('0x45')]['id']}})[_0xa113('0x24')](handleEntityNotFound(_0x12eb4a,null))['then'](saveUpdates(_0x1bf9e1[_0xa113('0x49')],null))['then'](respondWithResult(_0x12eb4a,null))[_0xa113('0x44')](handleError(_0x12eb4a,null));};exports[_0xa113('0x25')]=function(_0x9fa299,_0x3b70e1){return db[_0xa113('0x29')][_0xa113('0x47')]({'where':{'id':_0x9fa299[_0xa113('0x45')]['id']}})[_0xa113('0x24')](handleEntityNotFound(_0x3b70e1,null))[_0xa113('0x24')](removeEntity(_0x3b70e1,null))[_0xa113('0x44')](handleError(_0x3b70e1,null));};exports[_0xa113('0x4a')]=function(_0x5b4f80,_0x2239e6,_0x45c7ef){return db['VoiceMailMessage']['find']({'where':{'id':_0x5b4f80[_0xa113('0x45')]['id']},'attributes':['id',_0xa113('0x4b'),_0xa113('0x4c')]})[_0xa113('0x24')](handleEntityNotFound(_0x2239e6,null))['then'](function(_0x529f97){if(_0x529f97){if(!_0x529f97[_0xa113('0x4b')]){throw new db[(_0xa113('0x4d'))]['ValidationError'](_0xa113('0x4e'));}var _0x4e3268={'Content-Type':'audio/wav','Content-Disposition':_0xa113('0x4f')};if(_0x529f97['msg_id']){_0x4e3268[_0xa113('0x50')]=_0xa113('0x51')+_0x529f97[_0xa113('0x4c')]+'.wav\x22';}_0x2239e6[_0xa113('0x52')](_0x4e3268);return _0x2239e6[_0xa113('0x53')](new Buffer(_0x529f97[_0xa113('0x4b')]));}})[_0xa113('0x44')](handleError(_0x2239e6,null));}; \ No newline at end of file +var _0x38ea=['filter','merge','VIRTUAL','VoiceMailMessage','includeAll','include','rows','catch','show','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick'];(function(_0x5d9b8c,_0x5c818d){var _0x24a331=function(_0x64ff4e){while(--_0x64ff4e){_0x5d9b8c['push'](_0x5d9b8c['shift']());}};_0x24a331(++_0x5c818d);}(_0x38ea,0x120));var _0xa38e=function(_0x50a531,_0x4b72c2){_0x50a531=_0x50a531-0x0;var _0x4744b8=_0x38ea[_0x50a531];return _0x4744b8;};'use strict';var emlformat=require(_0xa38e('0x0'));var rimraf=require(_0xa38e('0x1'));var zipdir=require(_0xa38e('0x2'));var jsonpatch=require(_0xa38e('0x3'));var rp=require(_0xa38e('0x4'));var moment=require('moment');var BPromise=require(_0xa38e('0x5'));var Mustache=require(_0xa38e('0x6'));var util=require('util');var path=require(_0xa38e('0x7'));var sox=require(_0xa38e('0x8'));var csv=require(_0xa38e('0x9'));var ejs=require(_0xa38e('0xa'));var fs=require('fs');var fs_extra=require(_0xa38e('0xb'));var _=require('lodash');var squel=require(_0xa38e('0xc'));var crypto=require(_0xa38e('0xd'));var jsforce=require(_0xa38e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa38e('0x9'));var querystring=require('querystring');var Papa=require(_0xa38e('0xf'));var Redis=require(_0xa38e('0x10'));var authService=require(_0xa38e('0x11'));var qs=require(_0xa38e('0x12'));var as=require(_0xa38e('0x13'));var hardwareService=require(_0xa38e('0x14'));var logger=require(_0xa38e('0x15'))(_0xa38e('0x16'));var utils=require(_0xa38e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa38e('0x18'));var db=require(_0xa38e('0x19'))['db'];function respondWithStatusCode(_0x381191,_0x1d19ae){_0x1d19ae=_0x1d19ae||0xcc;return function(_0x5ca4d7){if(_0x5ca4d7){return _0x381191[_0xa38e('0x1a')](_0x1d19ae);}return _0x381191[_0xa38e('0x1b')](_0x1d19ae)[_0xa38e('0x1c')]();};}function respondWithResult(_0x3b05da,_0x5a599a){_0x5a599a=_0x5a599a||0xc8;return function(_0x4f971c){if(_0x4f971c){return _0x3b05da['status'](_0x5a599a)[_0xa38e('0x1d')](_0x4f971c);}};}function respondWithFilteredResult(_0x20485f,_0x3a7a08){return function(_0x53f6e5){if(_0x53f6e5){var _0x15a542=typeof _0x3a7a08[_0xa38e('0x1e')]==='undefined'&&typeof _0x3a7a08['limit']===_0xa38e('0x1f');var _0x32e3f4=_0x53f6e5['count'];var _0x3855ca=_0x15a542?0x0:_0x3a7a08[_0xa38e('0x1e')];var _0x5d2591=_0x15a542?_0x53f6e5[_0xa38e('0x20')]:_0x3a7a08[_0xa38e('0x1e')]+_0x3a7a08['limit'];var _0x39b646;if(_0x5d2591>=_0x32e3f4){_0x5d2591=_0x32e3f4;_0x39b646=0xc8;}else{_0x39b646=0xce;}_0x20485f[_0xa38e('0x1b')](_0x39b646);return _0x20485f[_0xa38e('0x21')](_0xa38e('0x22'),_0x3855ca+'-'+_0x5d2591+'/'+_0x32e3f4)['json'](_0x53f6e5);}return null;};}function patchUpdates(_0x53b4c5){return function(_0x208348){try{jsonpatch[_0xa38e('0x23')](_0x208348,_0x53b4c5,!![]);}catch(_0x3b2817){return BPromise['reject'](_0x3b2817);}return _0x208348[_0xa38e('0x24')]();};}function saveUpdates(_0x59b140,_0x3955ed){return function(_0x278ac9){if(_0x278ac9){return _0x278ac9[_0xa38e('0x25')](_0x59b140)[_0xa38e('0x26')](function(_0xa15f17){return _0xa15f17;});}return null;};}function removeEntity(_0xf1aa2f,_0x5557ba){return function(_0x4cb8b7){if(_0x4cb8b7){return _0x4cb8b7[_0xa38e('0x27')]()['then'](function(){_0xf1aa2f[_0xa38e('0x1b')](0xcc)[_0xa38e('0x1c')]();});}};}function handleEntityNotFound(_0x124cf9,_0x2e7283){return function(_0x263b92){if(!_0x263b92){_0x124cf9[_0xa38e('0x1a')](0x194);}return _0x263b92;};}function handleError(_0x2e7264,_0x1787b8){_0x1787b8=_0x1787b8||0x1f4;return function(_0x346b3a){logger[_0xa38e('0x28')](_0x346b3a[_0xa38e('0x29')]);if(_0x346b3a['name']){delete _0x346b3a[_0xa38e('0x2a')];}_0x2e7264[_0xa38e('0x1b')](_0x1787b8)['send'](_0x346b3a);};}exports[_0xa38e('0x2b')]=function(_0x1034e1,_0x4b9ac9){var _0x1bd6a9={},_0x45605e={},_0x4f5ba0={'count':0x0,'rows':[]};var _0xabcfeb=_['map'](db['VoiceMailMessage'][_0xa38e('0x2c')],function(_0x1f6c0a){return{'name':_0x1f6c0a[_0xa38e('0x2d')],'type':_0x1f6c0a[_0xa38e('0x2e')][_0xa38e('0x2f')]};});_0x45605e[_0xa38e('0x30')]=_[_0xa38e('0x31')](_[_0xa38e('0x32')](_0xabcfeb,'name'),[_0xa38e('0x2a')]);_0x45605e['query']=_[_0xa38e('0x33')](_0x1034e1[_0xa38e('0x34')]);_0x45605e[_0xa38e('0x35')]=_[_0xa38e('0x36')](_0x45605e['model'],_0x45605e[_0xa38e('0x34')]);_0x1bd6a9['attributes']=_[_0xa38e('0x36')](_0x45605e[_0xa38e('0x30')],qs[_0xa38e('0x37')](_0x1034e1[_0xa38e('0x34')]['fields']));_0x1bd6a9[_0xa38e('0x38')]=_0x1bd6a9[_0xa38e('0x38')][_0xa38e('0x39')]?_0x1bd6a9['attributes']:_0x45605e[_0xa38e('0x30')];if(!_0x1034e1[_0xa38e('0x34')]['hasOwnProperty'](_0xa38e('0x3a'))){_0x1bd6a9[_0xa38e('0x3b')]=qs['limit'](_0x1034e1[_0xa38e('0x34')]['limit']);_0x1bd6a9[_0xa38e('0x1e')]=qs[_0xa38e('0x1e')](_0x1034e1[_0xa38e('0x34')][_0xa38e('0x1e')]);}_0x1bd6a9[_0xa38e('0x3c')]=qs[_0xa38e('0x3d')](_0x1034e1[_0xa38e('0x34')][_0xa38e('0x3d')]);_0x1bd6a9[_0xa38e('0x3e')]=qs[_0xa38e('0x35')](_[_0xa38e('0x3f')](_0x1034e1['query'],_0x45605e['filters']),_0xabcfeb);if(_0x1034e1[_0xa38e('0x34')][_0xa38e('0x40')]){_0x1bd6a9[_0xa38e('0x3e')]=_[_0xa38e('0x41')](_0x1bd6a9[_0xa38e('0x3e')],{'$or':_[_0xa38e('0x32')](_0xabcfeb,function(_0x2ca9a){if(_0x2ca9a[_0xa38e('0x2e')]!==_0xa38e('0x42')){var _0x10418b={};_0x10418b[_0x2ca9a['name']]={'$like':'%'+_0x1034e1[_0xa38e('0x34')]['filter']+'%'};return _0x10418b;}})});}_0x1bd6a9=_[_0xa38e('0x41')]({},_0x1bd6a9,_0x1034e1['options']);var _0x5874e3={'where':_0x1bd6a9[_0xa38e('0x3e')]};return db[_0xa38e('0x43')][_0xa38e('0x20')](_0x5874e3)['then'](function(_0x36831e){_0x4f5ba0[_0xa38e('0x20')]=_0x36831e;if(_0x1034e1[_0xa38e('0x34')][_0xa38e('0x44')]){_0x1bd6a9[_0xa38e('0x45')]=[{'all':!![]}];}return db[_0xa38e('0x43')]['findAll'](_0x1bd6a9);})[_0xa38e('0x26')](function(_0x46db6d){_0x4f5ba0[_0xa38e('0x46')]=_0x46db6d;return _0x4f5ba0;})[_0xa38e('0x26')](respondWithFilteredResult(_0x4b9ac9,_0x1bd6a9))[_0xa38e('0x47')](handleError(_0x4b9ac9,null));};exports[_0xa38e('0x48')]=function(_0x308154,_0x56d064){var _0x22b2bb={'raw':!![],'where':{'id':_0x308154['params']['id']}},_0xec4bd3={};_0xec4bd3[_0xa38e('0x30')]=_[_0xa38e('0x33')](db['VoiceMailMessage']['rawAttributes']);_0xec4bd3[_0xa38e('0x34')]=_[_0xa38e('0x33')](_0x308154[_0xa38e('0x34')]);_0xec4bd3[_0xa38e('0x35')]=_[_0xa38e('0x36')](_0xec4bd3[_0xa38e('0x30')],_0xec4bd3['query']);_0x22b2bb['attributes']=_['intersection'](_0xec4bd3['model'],qs[_0xa38e('0x37')](_0x308154[_0xa38e('0x34')][_0xa38e('0x37')]));_0x22b2bb[_0xa38e('0x38')]=_0x22b2bb[_0xa38e('0x38')][_0xa38e('0x39')]?_0x22b2bb[_0xa38e('0x38')]:_0xec4bd3[_0xa38e('0x30')];if(_0x308154[_0xa38e('0x34')][_0xa38e('0x44')]){_0x22b2bb['include']=[{'all':!![]}];}_0x22b2bb=_[_0xa38e('0x41')]({},_0x22b2bb,_0x308154['options']);return db['VoiceMailMessage'][_0xa38e('0x49')](_0x22b2bb)['then'](handleEntityNotFound(_0x56d064,null))[_0xa38e('0x26')](respondWithResult(_0x56d064,null))[_0xa38e('0x47')](handleError(_0x56d064,null));};exports[_0xa38e('0x4a')]=function(_0x1c8d8c,_0x37dceb){return db[_0xa38e('0x43')]['create'](_0x1c8d8c['body'],{})[_0xa38e('0x26')](respondWithResult(_0x37dceb,0xc9))[_0xa38e('0x47')](handleError(_0x37dceb,null));};exports[_0xa38e('0x25')]=function(_0xc71e0c,_0x127fd0){if(_0xc71e0c['body']['id']){delete _0xc71e0c[_0xa38e('0x4b')]['id'];}return db[_0xa38e('0x43')]['find']({'where':{'id':_0xc71e0c[_0xa38e('0x4c')]['id']}})[_0xa38e('0x26')](handleEntityNotFound(_0x127fd0,null))['then'](saveUpdates(_0xc71e0c[_0xa38e('0x4b')],null))[_0xa38e('0x26')](respondWithResult(_0x127fd0,null))[_0xa38e('0x47')](handleError(_0x127fd0,null));};exports[_0xa38e('0x27')]=function(_0x4a20c8,_0x37e983){return db[_0xa38e('0x43')][_0xa38e('0x49')]({'where':{'id':_0x4a20c8[_0xa38e('0x4c')]['id']}})[_0xa38e('0x26')](handleEntityNotFound(_0x37e983,null))[_0xa38e('0x26')](removeEntity(_0x37e983,null))[_0xa38e('0x47')](handleError(_0x37e983,null));};exports[_0xa38e('0x4d')]=function(_0xa075c3,_0x2db7e1,_0x47cd06){return db[_0xa38e('0x43')][_0xa38e('0x49')]({'where':{'id':_0xa075c3[_0xa38e('0x4c')]['id']},'attributes':['id',_0xa38e('0x4e'),_0xa38e('0x4f')]})[_0xa38e('0x26')](handleEntityNotFound(_0x2db7e1,null))[_0xa38e('0x26')](function(_0x453536){if(_0x453536){if(!_0x453536[_0xa38e('0x4e')]){throw new db[(_0xa38e('0x50'))][(_0xa38e('0x51'))](_0xa38e('0x52'));}var _0x50a87d={'Content-Type':_0xa38e('0x53'),'Content-Disposition':_0xa38e('0x54')};if(_0x453536['msg_id']){_0x50a87d['Content-Disposition']=_0xa38e('0x55')+_0x453536[_0xa38e('0x4f')]+_0xa38e('0x56');}_0x2db7e1[_0xa38e('0x21')](_0x50a87d);return _0x2db7e1[_0xa38e('0x57')](new Buffer(_0x453536[_0xa38e('0x4e')]));}})[_0xa38e('0x47')](handleError(_0x2db7e1,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 7279236..8f03b00 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 _0x7c93=['dir','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','VoiceMailMessage'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x7c93,0x1cd));var _0x37c9=function(_0x45b067,_0x391b37){_0x45b067=_0x45b067-0x0;var _0x5629cb=_0x7c93[_0x45b067];return _0x5629cb;};'use strict';var _=require(_0x37c9('0x0'));var util=require('util');var logger=require(_0x37c9('0x1'))(_0x37c9('0x2'));var moment=require(_0x37c9('0x3'));var BPromise=require(_0x37c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x37c9('0x5'));var config=require(_0x37c9('0x6'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x2d78a3,_0x3e8b2c){return _0x2d78a3[_0x37c9('0x7')](_0x37c9('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x37c9('0x9'),'fields':[_0x37c9('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6994=['voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','VoiceMailMessage'];(function(_0x321638,_0x1ad605){var _0x3cf874=function(_0x2af223){while(--_0x2af223){_0x321638['push'](_0x321638['shift']());}};_0x3cf874(++_0x1ad605);}(_0x6994,0x9e));var _0x4699=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x6994[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require(_0x4699('0x0'));var logger=require(_0x4699('0x1'))(_0x4699('0x2'));var moment=require(_0x4699('0x3'));var BPromise=require(_0x4699('0x4'));var rp=require(_0x4699('0x5'));var fs=require('fs');var path=require(_0x4699('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x4699('0x7')]=function(_0x40dbd6,_0x41dc69){return _0x40dbd6[_0x4699('0x8')](_0x4699('0x9'),attributes,{'tableName':_0x4699('0xa'),'paranoid':![],'indexes':[{'name':_0x4699('0xb'),'fields':[_0x4699('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 8c108a1..0de729e 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 _0x0029=['jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5d67b0,_0x2e1f60){var _0x44f3e2=function(_0x4b11c1){while(--_0x4b11c1){_0x5d67b0['push'](_0x5d67b0['shift']());}};_0x44f3e2(++_0x2e1f60);}(_0x0029,0xe6));var _0x9002=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0029[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x9002('0x0'));var util=require(_0x9002('0x1'));var moment=require(_0x9002('0x2'));var BPromise=require(_0x9002('0x3'));var rs=require(_0x9002('0x4'));var fs=require('fs');var Redis=require(_0x9002('0x5'));var db=require(_0x9002('0x6'))['db'];var utils=require(_0x9002('0x7'));var logger=require(_0x9002('0x8'))('rpc');var config=require(_0x9002('0x9'));var jayson=require(_0x9002('0xa'));var client=jayson[_0x9002('0xb')][_0x9002('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb2ba6f,_0xb1b31f,_0x1be56f){return new BPromise(function(_0x3ff2b5,_0xea4a88){return client[_0x9002('0xd')](_0xb2ba6f,_0x1be56f)[_0x9002('0xe')](function(_0x3b9e24){logger[_0x9002('0xf')](_0x9002('0x10'),_0xb1b31f,_0x9002('0x11'));logger[_0x9002('0x12')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0xb1b31f,_0x9002('0x11'),JSON['stringify'](_0x3b9e24));if(_0x3b9e24['error']){if(_0x3b9e24['error'][_0x9002('0x13')]===0x1f4){logger['error'](_0x9002('0x10'),_0xb1b31f,_0x3b9e24[_0x9002('0x14')][_0x9002('0x15')]);return _0xea4a88(_0x3b9e24['error'][_0x9002('0x15')]);}logger[_0x9002('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xb1b31f,_0x3b9e24[_0x9002('0x14')][_0x9002('0x15')]);return _0x3ff2b5(_0x3b9e24[_0x9002('0x14')]['message']);}else{logger[_0x9002('0xf')](_0x9002('0x10'),_0xb1b31f,_0x9002('0x11'));_0x3ff2b5(_0x3b9e24[_0x9002('0x16')][_0x9002('0x15')]);}})[_0x9002('0x17')](function(_0x17d17b){logger[_0x9002('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0xb1b31f,_0x17d17b);_0xea4a88(_0x17d17b);});});} \ No newline at end of file +var _0xe63b=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x13687d,_0x379c1f){var _0x5044f4=function(_0x4a4bd3){while(--_0x4a4bd3){_0x13687d['push'](_0x13687d['shift']());}};_0x5044f4(++_0x379c1f);}(_0xe63b,0x126));var _0xbe63=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xe63b[_0x476bf4];return _0x788ffe;};'use strict';var _=require('lodash');var util=require(_0xbe63('0x0'));var moment=require(_0xbe63('0x1'));var BPromise=require(_0xbe63('0x2'));var rs=require(_0xbe63('0x3'));var fs=require('fs');var Redis=require(_0xbe63('0x4'));var db=require(_0xbe63('0x5'))['db'];var utils=require(_0xbe63('0x6'));var logger=require(_0xbe63('0x7'))('rpc');var config=require(_0xbe63('0x8'));var jayson=require(_0xbe63('0x9'));var client=jayson[_0xbe63('0xa')][_0xbe63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50ff2d,_0x2d0d22,_0x511f0e){return new BPromise(function(_0x2ba6e3,_0x48cf5e){return client['request'](_0x50ff2d,_0x511f0e)[_0xbe63('0xc')](function(_0xd1e860){logger[_0xbe63('0xd')](_0xbe63('0xe'),_0x2d0d22,_0xbe63('0xf'));logger['debug'](_0xbe63('0x10'),_0x2d0d22,_0xbe63('0xf'),JSON[_0xbe63('0x11')](_0xd1e860));if(_0xd1e860[_0xbe63('0x12')]){if(_0xd1e860[_0xbe63('0x12')]['code']===0x1f4){logger['error'](_0xbe63('0xe'),_0x2d0d22,_0xd1e860[_0xbe63('0x12')]['message']);return _0x48cf5e(_0xd1e860[_0xbe63('0x12')]['message']);}logger[_0xbe63('0x12')](_0xbe63('0xe'),_0x2d0d22,_0xd1e860[_0xbe63('0x12')]['message']);return _0x2ba6e3(_0xd1e860[_0xbe63('0x12')]['message']);}else{logger[_0xbe63('0xd')](_0xbe63('0xe'),_0x2d0d22,_0xbe63('0xf'));_0x2ba6e3(_0xd1e860[_0xbe63('0x13')][_0xbe63('0x14')]);}})[_0xbe63('0x15')](function(_0xb2b1a0){logger[_0xbe63('0x12')](_0xbe63('0xe'),_0x2d0d22,_0xb2b1a0);_0x48cf5e(_0xb2b1a0);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index ed97fee..12c1173 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 _0xea97=['getSounds','create','post','put','update','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xea97,0x190));var _0x7ea9=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xea97[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x7ea9('0x0'));var util=require('util');var path=require(_0x7ea9('0x1'));var timeout=require(_0x7ea9('0x2'));var express=require(_0x7ea9('0x3'));var router=express[_0x7ea9('0x4')]();var fs_extra=require(_0x7ea9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7ea9('0x6'));var config=require(_0x7ea9('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x7ea9('0x8')]('/',auth[_0x7ea9('0x9')](),controller[_0x7ea9('0xa')]);router[_0x7ea9('0x8')](_0x7ea9('0xb'),auth['isAuthenticated'](),controller[_0x7ea9('0xc')]);router[_0x7ea9('0x8')](_0x7ea9('0xd'),auth[_0x7ea9('0x9')](),controller[_0x7ea9('0xe')]);router['post']('/',auth[_0x7ea9('0x9')](),controller[_0x7ea9('0xf')]);router[_0x7ea9('0x10')]('/:id/sounds',auth['isAuthenticated'](),controller['addSound']);router[_0x7ea9('0x11')](_0x7ea9('0xb'),auth['isAuthenticated'](),controller[_0x7ea9('0x12')]);router['delete'](_0x7ea9('0xb'),auth[_0x7ea9('0x9')](),controller[_0x7ea9('0x13')]);router['delete'](_0x7ea9('0x14'),auth[_0x7ea9('0x9')](),controller[_0x7ea9('0x15')]);module[_0x7ea9('0x16')]=router; \ No newline at end of file +var _0x1bab=['index','/:id','show','/:id/sounds','getSounds','post','addSound','delete','destroy','removeSound','multer','util','path','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated'];(function(_0x4ba8c3,_0x33c457){var _0xf65364=function(_0x1c5369){while(--_0x1c5369){_0x4ba8c3['push'](_0x4ba8c3['shift']());}};_0xf65364(++_0x33c457);}(_0x1bab,0xdb));var _0xb1ba=function(_0x3f3259,_0x519089){_0x3f3259=_0x3f3259-0x0;var _0x7c838a=_0x1bab[_0x3f3259];return _0x7c838a;};'use strict';var multer=require(_0xb1ba('0x0'));var util=require(_0xb1ba('0x1'));var path=require(_0xb1ba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1ba('0x3')]();var fs_extra=require(_0xb1ba('0x4'));var auth=require(_0xb1ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1ba('0x6'));router[_0xb1ba('0x7')]('/',auth[_0xb1ba('0x8')](),controller[_0xb1ba('0x9')]);router[_0xb1ba('0x7')](_0xb1ba('0xa'),auth[_0xb1ba('0x8')](),controller[_0xb1ba('0xb')]);router[_0xb1ba('0x7')](_0xb1ba('0xc'),auth['isAuthenticated'](),controller[_0xb1ba('0xd')]);router[_0xb1ba('0xe')]('/',auth[_0xb1ba('0x8')](),controller['create']);router[_0xb1ba('0xe')](_0xb1ba('0xc'),auth[_0xb1ba('0x8')](),controller[_0xb1ba('0xf')]);router['put'](_0xb1ba('0xa'),auth[_0xb1ba('0x8')](),controller['update']);router[_0xb1ba('0x10')](_0xb1ba('0xa'),auth[_0xb1ba('0x8')](),controller[_0xb1ba('0x11')]);router['delete']('/:id/sounds/:id2',auth[_0xb1ba('0x8')](),controller[_0xb1ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c4b00b8..e4fc7bd 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 _0x3af0=['exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','BOOLEAN'];(function(_0x445f3a,_0x203ae1){var _0x4b8359=function(_0x3f1bf7){while(--_0x3f1bf7){_0x445f3a['push'](_0x445f3a['shift']());}};_0x4b8359(++_0x203ae1);}(_0x3af0,0x82));var _0x03af=function(_0x38051a,_0x2cbe2b){_0x38051a=_0x38051a-0x0;var _0x3c167f=_0x3af0[_0x38051a];return _0x3c167f;};'use strict';var Sequelize=require('sequelize');module[_0x03af('0x0')]={'name':{'type':Sequelize[_0x03af('0x1')],'allowNull':![],'unique':_0x03af('0x2')},'mode':{'type':Sequelize[_0x03af('0x3')](_0x03af('0x4'),_0x03af('0x5'),_0x03af('0x6'),_0x03af('0x7'),_0x03af('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x03af('0x5')},'directory':{'type':Sequelize[_0x03af('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x03af('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x03af('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x03af('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x03af('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x20bf=['STRING','name','ENUM','custom','mp3nb','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x20bf,0x1c6));var _0xf20b=function(_0x1080d3,_0x284317){_0x1080d3=_0x1080d3-0x0;var _0x101d6d=_0x20bf[_0x1080d3];return _0x101d6d;};'use strict';var Sequelize=require(_0xf20b('0x0'));module[_0xf20b('0x1')]={'name':{'type':Sequelize[_0xf20b('0x2')],'allowNull':![],'unique':_0xf20b('0x3')},'mode':{'type':Sequelize[_0xf20b('0x4')](_0xf20b('0x5'),'files',_0xf20b('0x6'),'quietmp3nb','quietmp3',_0xf20b('0x7')),'allowNull':!![],'defaultValue':_0xf20b('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xf20b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xf20b('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xf20b('0x2')],'allowNull':!![],'defaultValue':_0xf20b('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xf20b('0xa')},'defaultEntry':{'type':Sequelize[_0xf20b('0xb')],'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 a7e448c..be81d0f 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 _0x1a4d=['keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','params','options','find','catch','body','create','sequelize','files','join','root','server/files/moh','mode','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','directory','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','getSounds','length','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query'];(function(_0xcb1059,_0x2050e7){var _0x5c9dbb=function(_0x187953){while(--_0x187953){_0xcb1059['push'](_0xcb1059['shift']());}};_0x5c9dbb(++_0x2050e7);}(_0x1a4d,0x19c));var _0xd1a4=function(_0x19a335,_0x559126){_0x19a335=_0x19a335-0x0;var _0x4a5a79=_0x1a4d[_0x19a335];return _0x4a5a79;};'use strict';var emlformat=require(_0xd1a4('0x0'));var rimraf=require(_0xd1a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd1a4('0x2'));var moment=require('moment');var BPromise=require(_0xd1a4('0x3'));var Mustache=require(_0xd1a4('0x4'));var util=require(_0xd1a4('0x5'));var path=require(_0xd1a4('0x6'));var sox=require(_0xd1a4('0x7'));var csv=require(_0xd1a4('0x8'));var ejs=require(_0xd1a4('0x9'));var fs=require('fs');var fs_extra=require(_0xd1a4('0xa'));var _=require(_0xd1a4('0xb'));var squel=require(_0xd1a4('0xc'));var crypto=require(_0xd1a4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd1a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd1a4('0xf'));var Papa=require(_0xd1a4('0x10'));var Redis=require(_0xd1a4('0x11'));var authService=require(_0xd1a4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1a4('0x13'));var hardwareService=require(_0xd1a4('0x14'));var logger=require(_0xd1a4('0x15'))(_0xd1a4('0x16'));var utils=require(_0xd1a4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd1a4('0x18'));var db=require(_0xd1a4('0x19'))['db'];function respondWithStatusCode(_0x2d001c,_0x1d5bfb){_0x1d5bfb=_0x1d5bfb||0xcc;return function(_0x456f07){if(_0x456f07){return _0x2d001c[_0xd1a4('0x1a')](_0x1d5bfb);}return _0x2d001c[_0xd1a4('0x1b')](_0x1d5bfb)['end']();};}function respondWithResult(_0x447e2b,_0x3b20f6){_0x3b20f6=_0x3b20f6||0xc8;return function(_0x134d42){if(_0x134d42){return _0x447e2b[_0xd1a4('0x1b')](_0x3b20f6)[_0xd1a4('0x1c')](_0x134d42);}};}function respondWithFilteredResult(_0x5cdb97,_0x398f24){return function(_0x46ed99){if(_0x46ed99){var _0x231215=typeof _0x398f24[_0xd1a4('0x1d')]===_0xd1a4('0x1e')&&typeof _0x398f24['limit']===_0xd1a4('0x1e');var _0x3f6f3f=_0x46ed99[_0xd1a4('0x1f')];var _0x5cd9fa=_0x231215?0x0:_0x398f24['offset'];var _0x4e0c0c=_0x231215?_0x46ed99[_0xd1a4('0x1f')]:_0x398f24[_0xd1a4('0x1d')]+_0x398f24[_0xd1a4('0x20')];var _0xe7e7f3;if(_0x4e0c0c>=_0x3f6f3f){_0x4e0c0c=_0x3f6f3f;_0xe7e7f3=0xc8;}else{_0xe7e7f3=0xce;}_0x5cdb97[_0xd1a4('0x1b')](_0xe7e7f3);return _0x5cdb97[_0xd1a4('0x21')](_0xd1a4('0x22'),_0x5cd9fa+'-'+_0x4e0c0c+'/'+_0x3f6f3f)[_0xd1a4('0x1c')](_0x46ed99);}return null;};}function patchUpdates(_0x416404){return function(_0x134be1){try{jsonpatch[_0xd1a4('0x23')](_0x134be1,_0x416404,!![]);}catch(_0x476e17){return BPromise[_0xd1a4('0x24')](_0x476e17);}return _0x134be1[_0xd1a4('0x25')]();};}function saveUpdates(_0x56776b,_0x467d05){return function(_0x591e41){if(_0x591e41){return _0x591e41[_0xd1a4('0x26')](_0x56776b)[_0xd1a4('0x27')](function(_0x2784fe){return _0x2784fe;});}return null;};}function removeEntity(_0x4eb8dc,_0x2d0353){return function(_0x30ec30){if(_0x30ec30){return _0x30ec30['destroy']()[_0xd1a4('0x27')](function(){var _0x1f5ced=_0x30ec30['get']({'plain':!![]});var _0x2b1ee4=_0xd1a4('0x28');return db[_0xd1a4('0x29')][_0xd1a4('0x2a')]({'where':{'type':_0x2b1ee4,'resourceId':_0x1f5ced['id']}})[_0xd1a4('0x27')](function(){return _0x30ec30;});})[_0xd1a4('0x27')](function(){_0x4eb8dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42559d,_0x5c07f0){return function(_0x53f9e6){if(!_0x53f9e6){_0x42559d[_0xd1a4('0x1a')](0x194);}return _0x53f9e6;};}function handleError(_0x403086,_0x32c3c8){_0x32c3c8=_0x32c3c8||0x1f4;return function(_0xe868c2){logger[_0xd1a4('0x2b')](_0xe868c2[_0xd1a4('0x2c')]);if(_0xe868c2['name']){delete _0xe868c2[_0xd1a4('0x2d')];}_0x403086['status'](_0x32c3c8)[_0xd1a4('0x2e')](_0xe868c2);};}exports[_0xd1a4('0x2f')]=function(_0x2bf015,_0x80c630){var _0x414dd8={},_0x1333be={},_0x3b790e={'count':0x0,'rows':[]};var _0x128a2f=_[_0xd1a4('0x30')](db[_0xd1a4('0x31')][_0xd1a4('0x32')],function(_0x476e53){return{'name':_0x476e53[_0xd1a4('0x33')],'type':_0x476e53[_0xd1a4('0x34')][_0xd1a4('0x35')]};});_0x1333be[_0xd1a4('0x36')]=_[_0xd1a4('0x30')](_0x128a2f,_0xd1a4('0x2d'));_0x1333be[_0xd1a4('0x37')]=_[_0xd1a4('0x38')](_0x2bf015[_0xd1a4('0x37')]);_0x1333be[_0xd1a4('0x39')]=_[_0xd1a4('0x3a')](_0x1333be['model'],_0x1333be[_0xd1a4('0x37')]);_0x414dd8[_0xd1a4('0x3b')]=_[_0xd1a4('0x3a')](_0x1333be[_0xd1a4('0x36')],qs[_0xd1a4('0x3c')](_0x2bf015[_0xd1a4('0x37')]['fields']));_0x414dd8[_0xd1a4('0x3b')]=_0x414dd8[_0xd1a4('0x3b')]['length']?_0x414dd8[_0xd1a4('0x3b')]:_0x1333be[_0xd1a4('0x36')];if(!_0x2bf015[_0xd1a4('0x37')][_0xd1a4('0x3d')](_0xd1a4('0x3e'))){_0x414dd8['limit']=qs['limit'](_0x2bf015[_0xd1a4('0x37')]['limit']);_0x414dd8['offset']=qs[_0xd1a4('0x1d')](_0x2bf015['query'][_0xd1a4('0x1d')]);}_0x414dd8[_0xd1a4('0x3f')]=qs['sort'](_0x2bf015[_0xd1a4('0x37')][_0xd1a4('0x40')]);delete _0x2bf015[_0xd1a4('0x37')][_0xd1a4('0x40')];_0x414dd8[_0xd1a4('0x41')]=qs[_0xd1a4('0x39')](_[_0xd1a4('0x42')](_0x2bf015[_0xd1a4('0x37')],_0x1333be[_0xd1a4('0x39')]),_0x128a2f);if(_0x2bf015[_0xd1a4('0x37')][_0xd1a4('0x43')]){_0x414dd8[_0xd1a4('0x41')]=_[_0xd1a4('0x44')](_0x414dd8['where'],{'$or':_[_0xd1a4('0x30')](_0x128a2f,function(_0x4d7473){if(_0x4d7473[_0xd1a4('0x34')]!==_0xd1a4('0x45')){var _0x2dd160={};_0x2dd160[_0x4d7473[_0xd1a4('0x2d')]]={'$like':'%'+_0x2bf015[_0xd1a4('0x37')][_0xd1a4('0x43')]+'%'};return _0x2dd160;}})});}_0x414dd8=_[_0xd1a4('0x44')]({},_0x414dd8,_0x2bf015['options']);var _0x4efadf={'where':_0x414dd8['where']};return db['VoiceMusicOnHold'][_0xd1a4('0x1f')](_0x4efadf)[_0xd1a4('0x27')](function(_0xcb55d7){_0x3b790e[_0xd1a4('0x1f')]=_0xcb55d7;if(_0x2bf015[_0xd1a4('0x37')]['includeAll']){_0x414dd8[_0xd1a4('0x46')]=[{'all':!![]}];}return db[_0xd1a4('0x31')][_0xd1a4('0x47')](_0x414dd8);})[_0xd1a4('0x27')](function(_0x1aa430){_0x3b790e[_0xd1a4('0x48')]=_0x1aa430;return _0x3b790e;})[_0xd1a4('0x27')](respondWithFilteredResult(_0x80c630,_0x414dd8))['catch'](handleError(_0x80c630,null));};exports['show']=function(_0x5add32,_0x3241eb){var _0x3b2907={'raw':![],'where':{'id':_0x5add32[_0xd1a4('0x49')]['id']}},_0x2a1db4={};_0x2a1db4[_0xd1a4('0x36')]=_[_0xd1a4('0x38')](db[_0xd1a4('0x31')][_0xd1a4('0x32')]);_0x2a1db4[_0xd1a4('0x37')]=_[_0xd1a4('0x38')](_0x5add32[_0xd1a4('0x37')]);_0x2a1db4[_0xd1a4('0x39')]=_[_0xd1a4('0x3a')](_0x2a1db4[_0xd1a4('0x36')],_0x2a1db4['query']);_0x3b2907[_0xd1a4('0x3b')]=_[_0xd1a4('0x3a')](_0x2a1db4[_0xd1a4('0x36')],qs[_0xd1a4('0x3c')](_0x5add32['query'][_0xd1a4('0x3c')]));_0x3b2907[_0xd1a4('0x3b')]=_0x3b2907['attributes']['length']?_0x3b2907[_0xd1a4('0x3b')]:_0x2a1db4[_0xd1a4('0x36')];if(_0x5add32[_0xd1a4('0x37')]['includeAll']){_0x3b2907['include']=[{'all':!![]}];}_0x3b2907=_[_0xd1a4('0x44')]({},_0x3b2907,_0x5add32[_0xd1a4('0x4a')]);return db[_0xd1a4('0x31')][_0xd1a4('0x4b')](_0x3b2907)['then'](handleEntityNotFound(_0x3241eb,null))[_0xd1a4('0x27')](respondWithResult(_0x3241eb,null))[_0xd1a4('0x4c')](handleError(_0x3241eb,null));};exports[_0xd1a4('0x26')]=function(_0x13d2f0,_0x5e4536){if(_0x13d2f0[_0xd1a4('0x4d')]['id']){delete _0x13d2f0[_0xd1a4('0x4d')]['id'];}return db[_0xd1a4('0x31')]['find']({'where':{'id':_0x13d2f0[_0xd1a4('0x49')]['id']}})[_0xd1a4('0x27')](handleEntityNotFound(_0x5e4536,null))['then'](saveUpdates(_0x13d2f0[_0xd1a4('0x4d')],null))[_0xd1a4('0x27')](respondWithResult(_0x5e4536,null))['catch'](handleError(_0x5e4536,null));};exports[_0xd1a4('0x4e')]=function(_0xd5ca29,_0x337f0e,_0x3313fd){return db[_0xd1a4('0x4f')]['transaction'](function(_0x2d5b11){if(_0xd5ca29[_0xd1a4('0x4d')]['mode']===_0xd1a4('0x50')){_0xd5ca29[_0xd1a4('0x4d')]['directory']=path[_0xd1a4('0x51')](config[_0xd1a4('0x52')],_0xd1a4('0x53'),_0xd5ca29['body']['name']);}return db[_0xd1a4('0x31')][_0xd1a4('0x4e')](_0xd5ca29[_0xd1a4('0x4d')],{'transaction':_0x2d5b11})[_0xd1a4('0x27')](function(_0xd203a1){if(_0xd5ca29[_0xd1a4('0x4d')][_0xd1a4('0x54')]===_0xd1a4('0x50')){fs['mkdirSync'](_0xd203a1['directory'],parseInt(_0xd1a4('0x55'),0x8));}var _0x80c6c6=_0xd5ca29[_0xd1a4('0x56')]['get']({'plain':!![]});if(!_0x80c6c6)throw new Error(_0xd1a4('0x57'));if(_0x80c6c6[_0xd1a4('0x58')]===_0xd1a4('0x56')){var _0x39b9c5=_0xd203a1[_0xd1a4('0x59')]({'plain':!![]});return db['UserProfileSection'][_0xd1a4('0x4b')]({'where':{'name':_0xd1a4('0x28'),'userProfileId':_0x80c6c6[_0xd1a4('0x5a')]},'raw':!![]})[_0xd1a4('0x27')](function(_0x451546){if(_0x451546&&_0x451546[_0xd1a4('0x5b')]===0x0){return db[_0xd1a4('0x29')][_0xd1a4('0x4e')]({'name':_0x39b9c5[_0xd1a4('0x2d')],'resourceId':_0x39b9c5['id'],'type':_0x451546[_0xd1a4('0x2d')],'sectionId':_0x451546['id']},{})[_0xd1a4('0x27')](function(){return _0xd203a1;});}else{return _0xd203a1;}})[_0xd1a4('0x4c')](function(_0x65fcf){logger[_0xd1a4('0x2b')](_0xd1a4('0x5c'),_0x65fcf);});}return _0xd203a1;});})[_0xd1a4('0x27')](respondWithResult(_0x337f0e,0xc9))['catch'](handleError(_0x337f0e,null));};exports[_0xd1a4('0x2a')]=function(_0x3a560e,_0x5f375f,_0x3a8bae){var _0x50adc2;return db[_0xd1a4('0x31')]['find']({'where':{'id':_0x3a560e['params']['id']}})['then'](function(_0x3610b8){if(_0x3610b8){return db[_0xd1a4('0x4f')][_0xd1a4('0x5d')](function(_0x4da901){return _0x3610b8[_0xd1a4('0x2a')]({'transaction':_0x4da901,'raw':!![]})[_0xd1a4('0x27')](function(_0x4c20b9){if(_0x4c20b9[_0xd1a4('0x5e')]){fs[_0xd1a4('0x5f')](_0x4c20b9[_0xd1a4('0x5e')])['forEach'](function(_0x17e563){fs[_0xd1a4('0x60')](path['join'](_0x4c20b9[_0xd1a4('0x5e')],_0x17e563));});fs[_0xd1a4('0x61')](_0x4c20b9['directory']);}return _0x4c20b9;});})[_0xd1a4('0x4c')](function(_0x482d93){throw new db[(_0xd1a4('0x62'))][(_0xd1a4('0x63'))](_0x482d93[_0xd1a4('0x64')]);});}})[_0xd1a4('0x27')](handleEntityNotFound(_0x5f375f,null))[_0xd1a4('0x27')](removeEntity(_0x5f375f,null))['catch'](handleError(_0x5f375f,null));};exports[_0xd1a4('0x65')]=function(_0x5e45f9,_0x208582,_0x5513cb){return db[_0xd1a4('0x4f')][_0xd1a4('0x5d')](function(_0x5b14c3){var _0x40f66c;return db[_0xd1a4('0x31')][_0xd1a4('0x4b')]({'where':{'id':_0x5e45f9[_0xd1a4('0x49')]['id']}})[_0xd1a4('0x27')](function(_0x4348e3){if(_0x4348e3){_0x40f66c=_0x4348e3;return _0x4348e3[_0xd1a4('0x65')](_0x5e45f9['body']['id'],{'transaction':_0x5b14c3});}})[_0xd1a4('0x27')](function(_0x6c7ffd){if(_0x6c7ffd){return db[_0xd1a4('0x66')][_0xd1a4('0x67')]({'where':{'id':_0x5e45f9[_0xd1a4('0x4d')]['id']},'attributes':['id',_0xd1a4('0x2d'),_0xd1a4('0x68'),_0xd1a4('0x69'),_0xd1a4('0x6a')],'raw':!![]});}})[_0xd1a4('0x27')](function(_0x4dcff6){if(_0x4dcff6){var _0x49fed1=path[_0xd1a4('0x51')](config['root'],_0xd1a4('0x6b'),util[_0xd1a4('0x6c')](_0xd1a4('0x6d'),path[_0xd1a4('0x6e')](_0x4dcff6['save_name'],path[_0xd1a4('0x6f')](_0x4dcff6[_0xd1a4('0x68')])),_0x4dcff6[_0xd1a4('0x69')]));var _0x338236=path[_0xd1a4('0x51')](config['root'],_0xd1a4('0x53'),_0x40f66c[_0xd1a4('0x2d')],util[_0xd1a4('0x6c')](_0xd1a4('0x6d'),_0x4dcff6['name'],_0x4dcff6[_0xd1a4('0x69')]));fs[_0xd1a4('0x70')](_0x49fed1,_0x338236);return _0x4dcff6;}})[_0xd1a4('0x4c')](function(_0x50268e){throw new db[(_0xd1a4('0x62'))][(_0xd1a4('0x63'))](_0x50268e['message']);});})['then'](handleEntityNotFound(_0x208582,null))[_0xd1a4('0x27')](respondWithResult(_0x208582,0xc9))[_0xd1a4('0x4c')](handleError(_0x208582,null));};exports[_0xd1a4('0x71')]=function(_0x291ed0,_0x36b0e1,_0x3356eb){return db[_0xd1a4('0x4f')][_0xd1a4('0x5d')](function(_0x5975ed){var _0x5cb00d;return db[_0xd1a4('0x31')][_0xd1a4('0x67')]({'where':{'id':_0x291ed0[_0xd1a4('0x49')]['id']}})['then'](handleEntityNotFound(_0x36b0e1,null))['then'](function(_0x44e911){if(_0x44e911){_0x5cb00d=_0x44e911;return _0x44e911[_0xd1a4('0x71')](_0x291ed0[_0xd1a4('0x49')][_0xd1a4('0x72')]);}})[_0xd1a4('0x27')](function(_0x53800d){if(_0x53800d){return db[_0xd1a4('0x66')][_0xd1a4('0x67')]({'where':{'id':_0x291ed0[_0xd1a4('0x49')][_0xd1a4('0x72')]},'attributes':['id',_0xd1a4('0x2d'),_0xd1a4('0x68'),_0xd1a4('0x69'),_0xd1a4('0x6a')],'raw':!![]});}})['then'](function(_0x373ea3){if(_0x373ea3){fs['unlinkSync'](path['join'](_0x5cb00d[_0xd1a4('0x5e')],util['format']('%s.%s',_0x373ea3[_0xd1a4('0x2d')],_0x373ea3[_0xd1a4('0x69')])));return _0x373ea3;}})[_0xd1a4('0x4c')](function(_0xf2ab4){throw new db['Sequelize']['ValidationError'](_0xf2ab4[_0xd1a4('0x64')]);});})['then'](handleEntityNotFound(_0x36b0e1,null))[_0xd1a4('0x27')](respondWithStatusCode(_0x36b0e1,0xcc))['catch'](handleError(_0x36b0e1,null));};exports[_0xd1a4('0x73')]=function(_0x58dded,_0x3fb46d,_0x1bc01d){var _0x56d877={};var _0x25e7c9={};var _0x5ef2c9;var _0x51891f;return db[_0xd1a4('0x31')]['findOne']({'where':{'id':_0x58dded[_0xd1a4('0x49')]['id']}})[_0xd1a4('0x27')](handleEntityNotFound(_0x3fb46d,null))['then'](function(_0x5e54f5){if(_0x5e54f5){_0x5ef2c9=_0x5e54f5;_0x25e7c9[_0xd1a4('0x36')]=_[_0xd1a4('0x38')](db[_0xd1a4('0x66')][_0xd1a4('0x32')]);_0x25e7c9['query']=_[_0xd1a4('0x38')](_0x58dded[_0xd1a4('0x37')]);_0x25e7c9['filters']=_[_0xd1a4('0x3a')](_0x25e7c9[_0xd1a4('0x36')],_0x25e7c9[_0xd1a4('0x37')]);_0x56d877['attributes']=_[_0xd1a4('0x3a')](_0x25e7c9['model'],qs[_0xd1a4('0x3c')](_0x58dded[_0xd1a4('0x37')][_0xd1a4('0x3c')]));_0x56d877[_0xd1a4('0x3b')]=_0x56d877['attributes']['length']?_0x56d877[_0xd1a4('0x3b')]:_0x25e7c9[_0xd1a4('0x36')];_0x56d877[_0xd1a4('0x3f')]=qs[_0xd1a4('0x40')](_0x58dded[_0xd1a4('0x37')]['sort']);_0x56d877[_0xd1a4('0x41')]=qs['filters'](_[_0xd1a4('0x42')](_0x58dded[_0xd1a4('0x37')],_0x25e7c9[_0xd1a4('0x39')]));if(_0x58dded[_0xd1a4('0x37')]['filter']){_0x56d877['where']=_['merge'](_0x56d877[_0xd1a4('0x41')],{'$or':_[_0xd1a4('0x30')](_0x56d877[_0xd1a4('0x3b')],function(_0x5324b7){var _0x1e0610={};_0x1e0610[_0x5324b7]={'$like':'%'+_0x58dded['query'][_0xd1a4('0x43')]+'%'};return _0x1e0610;})});}_0x56d877=_[_0xd1a4('0x44')]({},_0x56d877,_0x58dded[_0xd1a4('0x4a')]);return _0x5ef2c9[_0xd1a4('0x73')](_0x56d877);}})[_0xd1a4('0x27')](function(_0x2c5430){if(_0x2c5430){_0x51891f=_0x2c5430[_0xd1a4('0x74')];if(!_0x58dded['query'][_0xd1a4('0x3d')](_0xd1a4('0x3e'))){_0x56d877[_0xd1a4('0x20')]=qs[_0xd1a4('0x20')](_0x58dded[_0xd1a4('0x37')][_0xd1a4('0x20')]);_0x56d877[_0xd1a4('0x1d')]=qs['offset'](_0x58dded[_0xd1a4('0x37')][_0xd1a4('0x1d')]);}return _0x5ef2c9[_0xd1a4('0x73')](_0x56d877);}})[_0xd1a4('0x27')](function(_0x58a40e){if(_0x58a40e){return _0x58a40e?{'count':_0x51891f,'rows':_0x58a40e}:null;}})[_0xd1a4('0x27')](respondWithResult(_0x3fb46d,null))[_0xd1a4('0x4c')](handleError(_0x3fb46d,null));}; \ No newline at end of file +var _0xcfca=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','catch','body','params','sequelize','transaction','mode','root','create','files','directory','0777','user','role','UserProfileSection','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','format','%s.%s','basename','extname','server/files/moh','removeSound','id2','createdAt','order','getSounds','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','send','VoiceMusicOnHold','rawAttributes','key','map','name','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x566f13,_0x2fcf14){var _0x1cc7c4=function(_0x4580c3){while(--_0x4580c3){_0x566f13['push'](_0x566f13['shift']());}};_0x1cc7c4(++_0x2fcf14);}(_0xcfca,0xa3));var _0xacfc=function(_0x2a88ff,_0x656b08){_0x2a88ff=_0x2a88ff-0x0;var _0x4a8b10=_0xcfca[_0x2a88ff];return _0x4a8b10;};'use strict';var emlformat=require(_0xacfc('0x0'));var rimraf=require(_0xacfc('0x1'));var zipdir=require(_0xacfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xacfc('0x3'));var moment=require(_0xacfc('0x4'));var BPromise=require(_0xacfc('0x5'));var Mustache=require(_0xacfc('0x6'));var util=require(_0xacfc('0x7'));var path=require(_0xacfc('0x8'));var sox=require('sox');var csv=require(_0xacfc('0x9'));var ejs=require(_0xacfc('0xa'));var fs=require('fs');var fs_extra=require(_0xacfc('0xb'));var _=require(_0xacfc('0xc'));var squel=require('squel');var crypto=require(_0xacfc('0xd'));var jsforce=require(_0xacfc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xacfc('0x9'));var querystring=require(_0xacfc('0xf'));var Papa=require('papaparse');var Redis=require(_0xacfc('0x10'));var authService=require(_0xacfc('0x11'));var qs=require(_0xacfc('0x12'));var as=require(_0xacfc('0x13'));var hardwareService=require(_0xacfc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xacfc('0x15'));var config=require(_0xacfc('0x16'));var licenseUtil=require(_0xacfc('0x17'));var db=require(_0xacfc('0x18'))['db'];function respondWithStatusCode(_0x4e46ce,_0x237b8a){_0x237b8a=_0x237b8a||0xcc;return function(_0x5d6888){if(_0x5d6888){return _0x4e46ce[_0xacfc('0x19')](_0x237b8a);}return _0x4e46ce['status'](_0x237b8a)[_0xacfc('0x1a')]();};}function respondWithResult(_0x11aa97,_0x50231a){_0x50231a=_0x50231a||0xc8;return function(_0x54f770){if(_0x54f770){return _0x11aa97[_0xacfc('0x1b')](_0x50231a)[_0xacfc('0x1c')](_0x54f770);}};}function respondWithFilteredResult(_0x27ed11,_0x1a9510){return function(_0x17038e){if(_0x17038e){var _0xbc76c5=typeof _0x1a9510['offset']===_0xacfc('0x1d')&&typeof _0x1a9510[_0xacfc('0x1e')]===_0xacfc('0x1d');var _0x4138cc=_0x17038e[_0xacfc('0x1f')];var _0x41fd02=_0xbc76c5?0x0:_0x1a9510['offset'];var _0x308d47=_0xbc76c5?_0x17038e[_0xacfc('0x1f')]:_0x1a9510[_0xacfc('0x20')]+_0x1a9510['limit'];var _0x4ab49b;if(_0x308d47>=_0x4138cc){_0x308d47=_0x4138cc;_0x4ab49b=0xc8;}else{_0x4ab49b=0xce;}_0x27ed11[_0xacfc('0x1b')](_0x4ab49b);return _0x27ed11[_0xacfc('0x21')](_0xacfc('0x22'),_0x41fd02+'-'+_0x308d47+'/'+_0x4138cc)[_0xacfc('0x1c')](_0x17038e);}return null;};}function patchUpdates(_0x5c683f){return function(_0xb27d9b){try{jsonpatch[_0xacfc('0x23')](_0xb27d9b,_0x5c683f,!![]);}catch(_0x2d5a22){return BPromise[_0xacfc('0x24')](_0x2d5a22);}return _0xb27d9b[_0xacfc('0x25')]();};}function saveUpdates(_0x2362ce,_0x24b5d5){return function(_0x507bf6){if(_0x507bf6){return _0x507bf6[_0xacfc('0x26')](_0x2362ce)[_0xacfc('0x27')](function(_0x23bb10){return _0x23bb10;});}return null;};}function removeEntity(_0x4a5946,_0x5aa2a9){return function(_0x24fdbc){if(_0x24fdbc){return _0x24fdbc[_0xacfc('0x28')]()[_0xacfc('0x27')](function(){var _0x448150=_0x24fdbc[_0xacfc('0x29')]({'plain':!![]});var _0x4d8971='MusicOnHolds';return db[_0xacfc('0x2a')][_0xacfc('0x28')]({'where':{'type':_0x4d8971,'resourceId':_0x448150['id']}})[_0xacfc('0x27')](function(){return _0x24fdbc;});})[_0xacfc('0x27')](function(){_0x4a5946[_0xacfc('0x1b')](0xcc)[_0xacfc('0x1a')]();});}};}function handleEntityNotFound(_0x225731,_0x57479c){return function(_0x5ef1b1){if(!_0x5ef1b1){_0x225731[_0xacfc('0x19')](0x194);}return _0x5ef1b1;};}function handleError(_0x3c7d8a,_0x3bc25c){_0x3bc25c=_0x3bc25c||0x1f4;return function(_0x16de88){logger['error'](_0x16de88['stack']);if(_0x16de88['name']){delete _0x16de88['name'];}_0x3c7d8a[_0xacfc('0x1b')](_0x3bc25c)[_0xacfc('0x2b')](_0x16de88);};}exports['index']=function(_0xd75114,_0x30c2b5){var _0x2c0dfe={},_0x3d53f0={},_0x734667={'count':0x0,'rows':[]};var _0x53ada5=_['map'](db[_0xacfc('0x2c')][_0xacfc('0x2d')],function(_0x2e850d){return{'name':_0x2e850d['fieldName'],'type':_0x2e850d['type'][_0xacfc('0x2e')]};});_0x3d53f0['model']=_[_0xacfc('0x2f')](_0x53ada5,_0xacfc('0x30'));_0x3d53f0[_0xacfc('0x31')]=_['keys'](_0xd75114[_0xacfc('0x31')]);_0x3d53f0[_0xacfc('0x32')]=_[_0xacfc('0x33')](_0x3d53f0['model'],_0x3d53f0[_0xacfc('0x31')]);_0x2c0dfe[_0xacfc('0x34')]=_[_0xacfc('0x33')](_0x3d53f0['model'],qs[_0xacfc('0x35')](_0xd75114[_0xacfc('0x31')][_0xacfc('0x35')]));_0x2c0dfe[_0xacfc('0x34')]=_0x2c0dfe[_0xacfc('0x34')][_0xacfc('0x36')]?_0x2c0dfe[_0xacfc('0x34')]:_0x3d53f0[_0xacfc('0x37')];if(!_0xd75114['query'][_0xacfc('0x38')](_0xacfc('0x39'))){_0x2c0dfe['limit']=qs[_0xacfc('0x1e')](_0xd75114['query'][_0xacfc('0x1e')]);_0x2c0dfe['offset']=qs[_0xacfc('0x20')](_0xd75114[_0xacfc('0x31')][_0xacfc('0x20')]);}_0x2c0dfe['order']=qs[_0xacfc('0x3a')](_0xd75114['query'][_0xacfc('0x3a')]);delete _0xd75114[_0xacfc('0x31')][_0xacfc('0x3a')];_0x2c0dfe[_0xacfc('0x3b')]=qs[_0xacfc('0x32')](_[_0xacfc('0x3c')](_0xd75114[_0xacfc('0x31')],_0x3d53f0[_0xacfc('0x32')]),_0x53ada5);if(_0xd75114[_0xacfc('0x31')][_0xacfc('0x3d')]){_0x2c0dfe[_0xacfc('0x3b')]=_[_0xacfc('0x3e')](_0x2c0dfe[_0xacfc('0x3b')],{'$or':_[_0xacfc('0x2f')](_0x53ada5,function(_0x68368c){if(_0x68368c[_0xacfc('0x3f')]!==_0xacfc('0x40')){var _0x4a190d={};_0x4a190d[_0x68368c[_0xacfc('0x30')]]={'$like':'%'+_0xd75114['query']['filter']+'%'};return _0x4a190d;}})});}_0x2c0dfe=_[_0xacfc('0x3e')]({},_0x2c0dfe,_0xd75114[_0xacfc('0x41')]);var _0x1aaffb={'where':_0x2c0dfe['where']};return db[_0xacfc('0x2c')][_0xacfc('0x1f')](_0x1aaffb)['then'](function(_0x54cce8){_0x734667[_0xacfc('0x1f')]=_0x54cce8;if(_0xd75114[_0xacfc('0x31')][_0xacfc('0x42')]){_0x2c0dfe[_0xacfc('0x43')]=[{'all':!![]}];}return db[_0xacfc('0x2c')][_0xacfc('0x44')](_0x2c0dfe);})[_0xacfc('0x27')](function(_0x498c87){_0x734667[_0xacfc('0x45')]=_0x498c87;return _0x734667;})[_0xacfc('0x27')](respondWithFilteredResult(_0x30c2b5,_0x2c0dfe))['catch'](handleError(_0x30c2b5,null));};exports[_0xacfc('0x46')]=function(_0xa9905b,_0x479c83){var _0x195b6={'raw':![],'where':{'id':_0xa9905b['params']['id']}},_0x463d37={};_0x463d37['model']=_[_0xacfc('0x47')](db[_0xacfc('0x2c')][_0xacfc('0x2d')]);_0x463d37[_0xacfc('0x31')]=_[_0xacfc('0x47')](_0xa9905b[_0xacfc('0x31')]);_0x463d37[_0xacfc('0x32')]=_[_0xacfc('0x33')](_0x463d37[_0xacfc('0x37')],_0x463d37[_0xacfc('0x31')]);_0x195b6[_0xacfc('0x34')]=_[_0xacfc('0x33')](_0x463d37[_0xacfc('0x37')],qs['fields'](_0xa9905b[_0xacfc('0x31')][_0xacfc('0x35')]));_0x195b6[_0xacfc('0x34')]=_0x195b6[_0xacfc('0x34')][_0xacfc('0x36')]?_0x195b6[_0xacfc('0x34')]:_0x463d37['model'];if(_0xa9905b[_0xacfc('0x31')][_0xacfc('0x42')]){_0x195b6[_0xacfc('0x43')]=[{'all':!![]}];}_0x195b6=_[_0xacfc('0x3e')]({},_0x195b6,_0xa9905b[_0xacfc('0x41')]);return db['VoiceMusicOnHold'][_0xacfc('0x48')](_0x195b6)[_0xacfc('0x27')](handleEntityNotFound(_0x479c83,null))[_0xacfc('0x27')](respondWithResult(_0x479c83,null))[_0xacfc('0x49')](handleError(_0x479c83,null));};exports[_0xacfc('0x26')]=function(_0x17939c,_0x5f38a9){if(_0x17939c[_0xacfc('0x4a')]['id']){delete _0x17939c[_0xacfc('0x4a')]['id'];}return db[_0xacfc('0x2c')][_0xacfc('0x48')]({'where':{'id':_0x17939c[_0xacfc('0x4b')]['id']}})[_0xacfc('0x27')](handleEntityNotFound(_0x5f38a9,null))[_0xacfc('0x27')](saveUpdates(_0x17939c[_0xacfc('0x4a')],null))[_0xacfc('0x27')](respondWithResult(_0x5f38a9,null))['catch'](handleError(_0x5f38a9,null));};exports['create']=function(_0x40ad55,_0x315136,_0x2a6581){return db[_0xacfc('0x4c')][_0xacfc('0x4d')](function(_0x50bc58){if(_0x40ad55[_0xacfc('0x4a')][_0xacfc('0x4e')]==='files'){_0x40ad55[_0xacfc('0x4a')]['directory']=path['join'](config[_0xacfc('0x4f')],'server/files/moh',_0x40ad55['body'][_0xacfc('0x30')]);}return db[_0xacfc('0x2c')][_0xacfc('0x50')](_0x40ad55[_0xacfc('0x4a')],{'transaction':_0x50bc58})[_0xacfc('0x27')](function(_0x4954e6){if(_0x40ad55[_0xacfc('0x4a')][_0xacfc('0x4e')]===_0xacfc('0x51')){fs['mkdirSync'](_0x4954e6[_0xacfc('0x52')],parseInt(_0xacfc('0x53'),0x8));}var _0x14cecb=_0x40ad55[_0xacfc('0x54')]['get']({'plain':!![]});if(!_0x14cecb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14cecb[_0xacfc('0x55')]===_0xacfc('0x54')){var _0x256a81=_0x4954e6[_0xacfc('0x29')]({'plain':!![]});return db[_0xacfc('0x56')]['find']({'where':{'name':_0xacfc('0x57'),'userProfileId':_0x14cecb['userProfileId']},'raw':!![]})['then'](function(_0x1157ad){if(_0x1157ad&&_0x1157ad[_0xacfc('0x58')]===0x0){return db[_0xacfc('0x2a')][_0xacfc('0x50')]({'name':_0x256a81[_0xacfc('0x30')],'resourceId':_0x256a81['id'],'type':_0x1157ad['name'],'sectionId':_0x1157ad['id']},{})[_0xacfc('0x27')](function(){return _0x4954e6;});}else{return _0x4954e6;}})[_0xacfc('0x49')](function(_0x2b4463){logger['error'](_0xacfc('0x59'),_0x2b4463);});}return _0x4954e6;});})[_0xacfc('0x27')](respondWithResult(_0x315136,0xc9))[_0xacfc('0x49')](handleError(_0x315136,null));};exports[_0xacfc('0x28')]=function(_0x40cd95,_0x33b900,_0x4a8679){var _0x3ef47d;return db[_0xacfc('0x2c')][_0xacfc('0x48')]({'where':{'id':_0x40cd95[_0xacfc('0x4b')]['id']}})[_0xacfc('0x27')](function(_0x5e94a1){if(_0x5e94a1){return db[_0xacfc('0x4c')][_0xacfc('0x4d')](function(_0x551aa2){return _0x5e94a1[_0xacfc('0x28')]({'transaction':_0x551aa2,'raw':!![]})[_0xacfc('0x27')](function(_0x24db18){if(_0x24db18[_0xacfc('0x52')]){fs[_0xacfc('0x5a')](_0x24db18[_0xacfc('0x52')])[_0xacfc('0x5b')](function(_0x5db3ee){fs['unlinkSync'](path[_0xacfc('0x5c')](_0x24db18[_0xacfc('0x52')],_0x5db3ee));});fs[_0xacfc('0x5d')](_0x24db18[_0xacfc('0x52')]);}return _0x24db18;});})['catch'](function(_0x168ff2){throw new db[(_0xacfc('0x5e'))][(_0xacfc('0x5f'))](_0x168ff2[_0xacfc('0x60')]);});}})[_0xacfc('0x27')](handleEntityNotFound(_0x33b900,null))['then'](removeEntity(_0x33b900,null))[_0xacfc('0x49')](handleError(_0x33b900,null));};exports[_0xacfc('0x61')]=function(_0x361431,_0x3f8248,_0x333643){return db['sequelize']['transaction'](function(_0x36fab0){var _0x195411;return db[_0xacfc('0x2c')][_0xacfc('0x48')]({'where':{'id':_0x361431[_0xacfc('0x4b')]['id']}})[_0xacfc('0x27')](function(_0x242e6b){if(_0x242e6b){_0x195411=_0x242e6b;return _0x242e6b[_0xacfc('0x61')](_0x361431[_0xacfc('0x4a')]['id'],{'transaction':_0x36fab0});}})[_0xacfc('0x27')](function(_0x77fc74){if(_0x77fc74){return db[_0xacfc('0x62')][_0xacfc('0x63')]({'where':{'id':_0x361431[_0xacfc('0x4a')]['id']},'attributes':['id',_0xacfc('0x30'),_0xacfc('0x64'),_0xacfc('0x65'),'createdAt'],'raw':!![]});}})[_0xacfc('0x27')](function(_0x4a11cc){if(_0x4a11cc){var _0xaaa2b9=path[_0xacfc('0x5c')](config['root'],'server/files/sounds/converted',util[_0xacfc('0x66')](_0xacfc('0x67'),path[_0xacfc('0x68')](_0x4a11cc['save_name'],path[_0xacfc('0x69')](_0x4a11cc[_0xacfc('0x64')])),_0x4a11cc[_0xacfc('0x65')]));var _0x312144=path['join'](config[_0xacfc('0x4f')],_0xacfc('0x6a'),_0x195411['name'],util['format'](_0xacfc('0x67'),_0x4a11cc[_0xacfc('0x30')],_0x4a11cc[_0xacfc('0x65')]));fs['symlinkSync'](_0xaaa2b9,_0x312144);return _0x4a11cc;}})[_0xacfc('0x49')](function(_0x474d42){throw new db[(_0xacfc('0x5e'))][(_0xacfc('0x5f'))](_0x474d42[_0xacfc('0x60')]);});})[_0xacfc('0x27')](handleEntityNotFound(_0x3f8248,null))[_0xacfc('0x27')](respondWithResult(_0x3f8248,0xc9))[_0xacfc('0x49')](handleError(_0x3f8248,null));};exports['removeSound']=function(_0x5a2042,_0x6cebfe,_0xcf6577){return db[_0xacfc('0x4c')][_0xacfc('0x4d')](function(_0x5351c4){var _0x25312e;return db[_0xacfc('0x2c')][_0xacfc('0x63')]({'where':{'id':_0x5a2042[_0xacfc('0x4b')]['id']}})[_0xacfc('0x27')](handleEntityNotFound(_0x6cebfe,null))[_0xacfc('0x27')](function(_0x578325){if(_0x578325){_0x25312e=_0x578325;return _0x578325[_0xacfc('0x6b')](_0x5a2042['params'][_0xacfc('0x6c')]);}})['then'](function(_0x1d610d){if(_0x1d610d){return db[_0xacfc('0x62')][_0xacfc('0x63')]({'where':{'id':_0x5a2042[_0xacfc('0x4b')][_0xacfc('0x6c')]},'attributes':['id',_0xacfc('0x30'),_0xacfc('0x64'),_0xacfc('0x65'),_0xacfc('0x6d')],'raw':!![]});}})[_0xacfc('0x27')](function(_0x22b742){if(_0x22b742){fs['unlinkSync'](path['join'](_0x25312e['directory'],util[_0xacfc('0x66')](_0xacfc('0x67'),_0x22b742[_0xacfc('0x30')],_0x22b742[_0xacfc('0x65')])));return _0x22b742;}})['catch'](function(_0x2b9275){throw new db[(_0xacfc('0x5e'))][(_0xacfc('0x5f'))](_0x2b9275['message']);});})['then'](handleEntityNotFound(_0x6cebfe,null))['then'](respondWithStatusCode(_0x6cebfe,0xcc))[_0xacfc('0x49')](handleError(_0x6cebfe,null));};exports['getSounds']=function(_0x547956,_0x29781a,_0x5e45d2){var _0x3a62fc={};var _0x536f34={};var _0x14af2b;var _0x4fe4c3;return db[_0xacfc('0x2c')]['findOne']({'where':{'id':_0x547956[_0xacfc('0x4b')]['id']}})[_0xacfc('0x27')](handleEntityNotFound(_0x29781a,null))[_0xacfc('0x27')](function(_0x36c78b){if(_0x36c78b){_0x14af2b=_0x36c78b;_0x536f34[_0xacfc('0x37')]=_['keys'](db['Sound'][_0xacfc('0x2d')]);_0x536f34[_0xacfc('0x31')]=_[_0xacfc('0x47')](_0x547956[_0xacfc('0x31')]);_0x536f34['filters']=_['intersection'](_0x536f34['model'],_0x536f34[_0xacfc('0x31')]);_0x3a62fc[_0xacfc('0x34')]=_[_0xacfc('0x33')](_0x536f34[_0xacfc('0x37')],qs['fields'](_0x547956[_0xacfc('0x31')]['fields']));_0x3a62fc[_0xacfc('0x34')]=_0x3a62fc[_0xacfc('0x34')]['length']?_0x3a62fc[_0xacfc('0x34')]:_0x536f34['model'];_0x3a62fc[_0xacfc('0x6e')]=qs['sort'](_0x547956[_0xacfc('0x31')][_0xacfc('0x3a')]);_0x3a62fc[_0xacfc('0x3b')]=qs['filters'](_['pick'](_0x547956[_0xacfc('0x31')],_0x536f34['filters']));if(_0x547956[_0xacfc('0x31')]['filter']){_0x3a62fc[_0xacfc('0x3b')]=_[_0xacfc('0x3e')](_0x3a62fc[_0xacfc('0x3b')],{'$or':_[_0xacfc('0x2f')](_0x3a62fc[_0xacfc('0x34')],function(_0x5c19e4){var _0x1cfc82={};_0x1cfc82[_0x5c19e4]={'$like':'%'+_0x547956['query'][_0xacfc('0x3d')]+'%'};return _0x1cfc82;})});}_0x3a62fc=_[_0xacfc('0x3e')]({},_0x3a62fc,_0x547956['options']);return _0x14af2b[_0xacfc('0x6f')](_0x3a62fc);}})[_0xacfc('0x27')](function(_0x4c163c){if(_0x4c163c){_0x4fe4c3=_0x4c163c[_0xacfc('0x36')];if(!_0x547956[_0xacfc('0x31')]['hasOwnProperty'](_0xacfc('0x39'))){_0x3a62fc[_0xacfc('0x1e')]=qs[_0xacfc('0x1e')](_0x547956['query'][_0xacfc('0x1e')]);_0x3a62fc[_0xacfc('0x20')]=qs[_0xacfc('0x20')](_0x547956[_0xacfc('0x31')]['offset']);}return _0x14af2b[_0xacfc('0x6f')](_0x3a62fc);}})[_0xacfc('0x27')](function(_0x4d5602){if(_0x4d5602){return _0x4d5602?{'count':_0x4fe4c3,'rows':_0x4d5602}:null;}})['then'](respondWithResult(_0x29781a,null))[_0xacfc('0x49')](handleError(_0x29781a,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 092b95e..0696d9f 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 _0x4232=['VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0x4232,0x116));var _0x2423=function(_0x2792d6,_0x2f264e){_0x2792d6=_0x2792d6-0x0;var _0x4b5158=_0x4232[_0x2792d6];return _0x4b5158;};'use strict';var _=require(_0x2423('0x0'));var util=require('util');var logger=require(_0x2423('0x1'))('api');var moment=require(_0x2423('0x2'));var BPromise=require(_0x2423('0x3'));var rp=require(_0x2423('0x4'));var fs=require('fs');var path=require(_0x2423('0x5'));var rimraf=require(_0x2423('0x6'));var config=require(_0x2423('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x2423('0x8')]=function(_0x912c1,_0x18d579){return _0x912c1[_0x2423('0x9')](_0x2423('0xa'),attributes,{'tableName':_0x2423('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x302c=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x11e6c0,_0x429739){var _0xc74341=function(_0x4c1c68){while(--_0x4c1c68){_0x11e6c0['push'](_0x11e6c0['shift']());}};_0xc74341(++_0x429739);}(_0x302c,0x1d9));var _0xc302=function(_0x2923f3,_0x300907){_0x2923f3=_0x2923f3-0x0;var _0x7edb9e=_0x302c[_0x2923f3];return _0x7edb9e;};'use strict';var _=require('lodash');var util=require(_0xc302('0x0'));var logger=require(_0xc302('0x1'))(_0xc302('0x2'));var moment=require(_0xc302('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc302('0x4'));var rimraf=require(_0xc302('0x5'));var config=require(_0xc302('0x6'));var attributes=require(_0xc302('0x7'));module[_0xc302('0x8')]=function(_0x3d5619,_0x45f815){return _0x3d5619[_0xc302('0x9')](_0xc302('0xa'),attributes,{'tableName':_0xc302('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 aef019b..1aae6b6 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1b5e23,_0x3e2448){var _0x25f6df=function(_0x22f9f0){while(--_0x22f9f0){_0x1b5e23['push'](_0x1b5e23['shift']());}};_0x25f6df(++_0x3e2448);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xcb91[_0x80f51a];return _0x327148;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x227148,_0x2af92d){var _0x3be280=function(_0x5af64){while(--_0x5af64){_0x227148['push'](_0x227148['shift']());}};_0x3be280(++_0x2af92d);}(_0xe706,0xa3));var _0x6e70=function(_0x4b48af,_0x4ad5b9){_0x4b48af=_0x4b48af-0x0;var _0x64ac44=_0xe706[_0x4b48af];return _0x64ac44;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 8c43146..10926bc 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 _0xf3be=['put','/:id','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','Router','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents'];(function(_0x40664e,_0xc7a885){var _0x172673=function(_0x415c5f){while(--_0x415c5f){_0x40664e['push'](_0x40664e['shift']());}};_0x172673(++_0xc7a885);}(_0xf3be,0x1e1));var _0xef3b=function(_0x5f2b47,_0x4e53c1){_0x5f2b47=_0x5f2b47-0x0;var _0x113ba6=_0xf3be[_0x5f2b47];return _0x113ba6;};'use strict';var multer=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var path=require(_0xef3b('0x2'));var timeout=require(_0xef3b('0x3'));var express=require('express');var router=express[_0xef3b('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(_0xef3b('0x5'));router[_0xef3b('0x6')]('/',auth['isAuthenticated'](),controller[_0xef3b('0x7')]);router[_0xef3b('0x6')](_0xef3b('0x8'),auth[_0xef3b('0x9')](),controller[_0xef3b('0xa')]);router[_0xef3b('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xef3b('0xb')]);router['get'](_0xef3b('0xc'),auth[_0xef3b('0x9')](),controller[_0xef3b('0xd')]);router['get'](_0xef3b('0xe'),auth['isAuthenticated'](),controller[_0xef3b('0xf')]);router[_0xef3b('0x10')]('/',auth[_0xef3b('0x9')](),controller[_0xef3b('0x11')]);router[_0xef3b('0x10')](_0xef3b('0xc'),auth[_0xef3b('0x9')](),controller[_0xef3b('0x12')]);router[_0xef3b('0x10')](_0xef3b('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0xef3b('0x13')](_0xef3b('0x14'),auth[_0xef3b('0x9')](),controller[_0xef3b('0x15')]);router[_0xef3b('0x16')]('/:id',auth[_0xef3b('0x9')](),controller[_0xef3b('0x17')]);router[_0xef3b('0x16')](_0xef3b('0xc'),auth[_0xef3b('0x9')](),controller['removeAgents']);router[_0xef3b('0x16')](_0xef3b('0xe'),auth['isAuthenticated'](),controller[_0xef3b('0x18')]);module['exports']=router; \ No newline at end of file +var _0x590c=['/:id/teams','post','addAgents','addTeams','put','/:id','update','delete','destroy','removeAgents','removeTeams','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents'];(function(_0x52a07c,_0x8285b){var _0x3256b8=function(_0x3b0e22){while(--_0x3b0e22){_0x52a07c['push'](_0x52a07c['shift']());}};_0x3256b8(++_0x8285b);}(_0x590c,0x80));var _0xc590=function(_0x35d1f9,_0xee484c){_0x35d1f9=_0x35d1f9-0x0;var _0x2d7877=_0x590c[_0x35d1f9];return _0x2d7877;};'use strict';var multer=require(_0xc590('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc590('0x1'));var express=require(_0xc590('0x2'));var router=express[_0xc590('0x3')]();var fs_extra=require(_0xc590('0x4'));var auth=require(_0xc590('0x5'));var interaction=require(_0xc590('0x6'));var config=require(_0xc590('0x7'));var controller=require(_0xc590('0x8'));router[_0xc590('0x9')]('/',auth[_0xc590('0xa')](),controller[_0xc590('0xb')]);router[_0xc590('0x9')](_0xc590('0xc'),auth[_0xc590('0xa')](),controller[_0xc590('0xd')]);router['get']('/:id',auth[_0xc590('0xa')](),controller[_0xc590('0xe')]);router['get'](_0xc590('0xf'),auth[_0xc590('0xa')](),controller[_0xc590('0x10')]);router[_0xc590('0x9')](_0xc590('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0xc590('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xc590('0xf'),auth[_0xc590('0xa')](),controller[_0xc590('0x13')]);router[_0xc590('0x12')](_0xc590('0x11'),auth[_0xc590('0xa')](),controller[_0xc590('0x14')]);router[_0xc590('0x15')](_0xc590('0x16'),auth[_0xc590('0xa')](),controller[_0xc590('0x17')]);router[_0xc590('0x18')](_0xc590('0x16'),auth[_0xc590('0xa')](),controller[_0xc590('0x19')]);router[_0xc590('0x18')](_0xc590('0xf'),auth[_0xc590('0xa')](),controller[_0xc590('0x1a')]);router[_0xc590('0x18')](_0xc590('0x11'),auth[_0xc590('0xa')](),controller[_0xc590('0x1b')]);module[_0xc590('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index e21bbf3..e1faa91 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 _0x84cb=['sequelize','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x23334a,_0x10b51){var _0x2a6de3=function(_0x530452){while(--_0x530452){_0x23334a['push'](_0x23334a['shift']());}};_0x2a6de3(++_0x10b51);}(_0x84cb,0x1d4));var _0xb84c=function(_0x528050,_0x47894f){_0x528050=_0x528050-0x0;var _0x170eeb=_0x84cb[_0x528050];return _0x170eeb;};'use strict';var Sequelize=require(_0xb84c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb84c('0x1')],'allowNull':![],'unique':_0xb84c('0x2')},'prefix':{'type':Sequelize[_0xb84c('0x3')],'get':function(_0x3cd2a2){return _0xb84c('0x4')+this[_0xb84c('0x5')](_0xb84c('0x2'))+'-';}},'description':{'type':Sequelize[_0xb84c('0x1')]},'callerIdAll':{'type':Sequelize[_0xb84c('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8fd5=['name','STRING','VIRTUAL','system-','getDataValue'];(function(_0x213ba1,_0x54d148){var _0x5a6ff5=function(_0x2ec3de){while(--_0x2ec3de){_0x213ba1['push'](_0x213ba1['shift']());}};_0x5a6ff5(++_0x54d148);}(_0x8fd5,0x1af));var _0x58fd=function(_0x22fee5,_0x3b0609){_0x22fee5=_0x22fee5-0x0;var _0x3b96f3=_0x8fd5[_0x22fee5];return _0x3b96f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x58fd('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x58fd('0x1')],'get':function(_0x4357bb){return _0x58fd('0x2')+this[_0x58fd('0x3')](_0x58fd('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x58fd('0x0')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d3ea7d2..ac72337 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 _0x93e9=['VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','${EXTEN:','length','charAt','body','system-','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','options','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll','include','catch','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','appdata','prefix','NoOp'];(function(_0x41ae89,_0x1abd01){var _0x4ff9a8=function(_0x59daec){while(--_0x59daec){_0x41ae89['push'](_0x41ae89['shift']());}};_0x4ff9a8(++_0x1abd01);}(_0x93e9,0xcc));var _0x993e=function(_0x1ff35e,_0x4f49a8){_0x1ff35e=_0x1ff35e-0x0;var _0x74c1cf=_0x93e9[_0x1ff35e];return _0x74c1cf;};'use strict';var emlformat=require(_0x993e('0x0'));var rimraf=require(_0x993e('0x1'));var zipdir=require(_0x993e('0x2'));var jsonpatch=require(_0x993e('0x3'));var rp=require(_0x993e('0x4'));var moment=require(_0x993e('0x5'));var BPromise=require(_0x993e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x993e('0x7'));var sox=require(_0x993e('0x8'));var csv=require(_0x993e('0x9'));var ejs=require(_0x993e('0xa'));var fs=require('fs');var fs_extra=require(_0x993e('0xb'));var _=require(_0x993e('0xc'));var squel=require(_0x993e('0xd'));var crypto=require(_0x993e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x993e('0xf'));var toCsv=require(_0x993e('0x9'));var querystring=require(_0x993e('0x10'));var Papa=require(_0x993e('0x11'));var Redis=require(_0x993e('0x12'));var authService=require(_0x993e('0x13'));var qs=require(_0x993e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x993e('0x15'));var logger=require(_0x993e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x993e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x993e('0x18'))['db'];config['redis']=_['defaults'](config[_0x993e('0x19')],{'host':_0x993e('0x1a'),'port':0x18eb});var socket=require(_0x993e('0x1b'))(new Redis(config[_0x993e('0x19')]));require(_0x993e('0x1c'))[_0x993e('0x1d')](socket);function respondWithStatusCode(_0x34ddda,_0x20f32a){_0x20f32a=_0x20f32a||0xcc;return function(_0x2a184b){if(_0x2a184b){return _0x34ddda[_0x993e('0x1e')](_0x20f32a);}return _0x34ddda[_0x993e('0x1f')](_0x20f32a)[_0x993e('0x20')]();};}function respondWithResult(_0x3df0e7,_0x125322){_0x125322=_0x125322||0xc8;return function(_0x1f267f){if(_0x1f267f){return _0x3df0e7[_0x993e('0x1f')](_0x125322)[_0x993e('0x21')](_0x1f267f);}};}function respondWithFilteredResult(_0x526e06,_0x22f7cc){return function(_0x1acd21){if(_0x1acd21){var _0x3cc2b9=typeof _0x22f7cc[_0x993e('0x22')]===_0x993e('0x23')&&typeof _0x22f7cc[_0x993e('0x24')]==='undefined';var _0x11cd41=_0x1acd21[_0x993e('0x25')];var _0x1eaf57=_0x3cc2b9?0x0:_0x22f7cc[_0x993e('0x22')];var _0x130a8a=_0x3cc2b9?_0x1acd21[_0x993e('0x25')]:_0x22f7cc[_0x993e('0x22')]+_0x22f7cc[_0x993e('0x24')];var _0x4bbe9c;if(_0x130a8a>=_0x11cd41){_0x130a8a=_0x11cd41;_0x4bbe9c=0xc8;}else{_0x4bbe9c=0xce;}_0x526e06[_0x993e('0x1f')](_0x4bbe9c);return _0x526e06['set'](_0x993e('0x26'),_0x1eaf57+'-'+_0x130a8a+'/'+_0x11cd41)[_0x993e('0x21')](_0x1acd21);}return null;};}function patchUpdates(_0x32b09e){return function(_0x5ba2a1){try{jsonpatch[_0x993e('0x27')](_0x5ba2a1,_0x32b09e,!![]);}catch(_0x13db4e){return BPromise[_0x993e('0x28')](_0x13db4e);}return _0x5ba2a1[_0x993e('0x29')]();};}function saveUpdates(_0x3b45ef,_0x328d22){return function(_0xa1c83e){if(_0xa1c83e){return _0xa1c83e[_0x993e('0x2a')](_0x3b45ef)[_0x993e('0x2b')](function(_0x18f6ac){return _0x18f6ac;});}return null;};}function removeEntity(_0x3fe099,_0x3603fa){return function(_0x4fe471){if(_0x4fe471){return _0x4fe471[_0x993e('0x2c')]()[_0x993e('0x2b')](function(){var _0x52b727=_0x4fe471[_0x993e('0x2d')]({'plain':!![]});var _0x4f5cc1=_0x993e('0x2e');return db[_0x993e('0x2f')][_0x993e('0x2c')]({'where':{'type':_0x4f5cc1,'resourceId':_0x52b727['id']}})[_0x993e('0x2b')](function(){return _0x4fe471;});})['then'](function(){_0x3fe099['status'](0xcc)[_0x993e('0x20')]();});}};}function handleEntityNotFound(_0x466d63,_0x4a4f00){return function(_0x223af0){if(!_0x223af0){_0x466d63[_0x993e('0x1e')](0x194);}return _0x223af0;};}function handleError(_0x248354,_0x4c5ee3){_0x4c5ee3=_0x4c5ee3||0x1f4;return function(_0x2495b7){logger[_0x993e('0x30')](_0x2495b7[_0x993e('0x31')]);if(_0x2495b7[_0x993e('0x32')]){delete _0x2495b7[_0x993e('0x32')];}_0x248354['status'](_0x4c5ee3)[_0x993e('0x33')](_0x2495b7);};}exports['index']=function(_0x782298,_0x5ba163){var _0x1da357={},_0x567ed4={},_0x3b9c3c={'count':0x0,'rows':[]};var _0x2ce5d5=_[_0x993e('0x34')](db[_0x993e('0x35')][_0x993e('0x36')],function(_0x360e2d){return{'name':_0x360e2d['fieldName'],'type':_0x360e2d[_0x993e('0x37')]['key']};});_0x567ed4['model']=_[_0x993e('0x34')](_0x2ce5d5,'name');_0x567ed4[_0x993e('0x38')]=_[_0x993e('0x39')](_0x782298[_0x993e('0x38')]);_0x567ed4[_0x993e('0x3a')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],_0x567ed4[_0x993e('0x38')]);_0x1da357[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x567ed4[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x782298[_0x993e('0x38')][_0x993e('0x3e')]));_0x1da357[_0x993e('0x3d')]=_0x1da357[_0x993e('0x3d')]['length']?_0x1da357[_0x993e('0x3d')]:_0x567ed4[_0x993e('0x3c')];if(!_0x782298[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1da357[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x782298[_0x993e('0x38')][_0x993e('0x24')]);_0x1da357['offset']=qs[_0x993e('0x22')](_0x782298['query'][_0x993e('0x22')]);}_0x1da357[_0x993e('0x41')]=qs[_0x993e('0x42')](_0x782298[_0x993e('0x38')][_0x993e('0x42')]);_0x1da357[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x782298['query'],_0x567ed4[_0x993e('0x3a')]),_0x2ce5d5);if(_0x782298['query'][_0x993e('0x45')]){_0x1da357['where']=_[_0x993e('0x46')](_0x1da357[_0x993e('0x43')],{'$or':_[_0x993e('0x34')](_0x2ce5d5,function(_0x1f1327){if(_0x1f1327[_0x993e('0x37')]!==_0x993e('0x47')){var _0xb728cf={};_0xb728cf[_0x1f1327[_0x993e('0x32')]]={'$like':'%'+_0x782298['query'][_0x993e('0x45')]+'%'};return _0xb728cf;}})});}_0x1da357=_['merge']({},_0x1da357,_0x782298['options']);var _0x1a2712={'where':_0x1da357[_0x993e('0x43')]};return db[_0x993e('0x35')]['count'](_0x1a2712)[_0x993e('0x2b')](function(_0x40719d){_0x3b9c3c[_0x993e('0x25')]=_0x40719d;if(_0x782298['query']['includeAll']){_0x1da357['include']=[{'all':!![]}];}return db[_0x993e('0x35')][_0x993e('0x48')](_0x1da357);})[_0x993e('0x2b')](function(_0x539c9d){_0x3b9c3c[_0x993e('0x49')]=_0x539c9d;return _0x3b9c3c;})[_0x993e('0x2b')](respondWithFilteredResult(_0x5ba163,_0x1da357))['catch'](handleError(_0x5ba163,null));};exports[_0x993e('0x4a')]=function(_0x5f7563,_0x5074a6){var _0x258795={'raw':![],'where':{'id':_0x5f7563[_0x993e('0x4b')]['id']}},_0x576ea={};_0x576ea['model']=_['keys'](db['VoicePrefix'][_0x993e('0x36')]);_0x576ea[_0x993e('0x38')]=_[_0x993e('0x39')](_0x5f7563[_0x993e('0x38')]);_0x576ea['filters']=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],_0x576ea[_0x993e('0x38')]);_0x258795[_0x993e('0x3d')]=_[_0x993e('0x3b')](_0x576ea[_0x993e('0x3c')],qs['fields'](_0x5f7563['query'][_0x993e('0x3e')]));_0x258795[_0x993e('0x3d')]=_0x258795['attributes']['length']?_0x258795[_0x993e('0x3d')]:_0x576ea[_0x993e('0x3c')];if(_0x5f7563[_0x993e('0x38')][_0x993e('0x4c')]){_0x258795[_0x993e('0x4d')]=[{'all':!![]}];}_0x258795=_[_0x993e('0x46')]({},_0x258795,_0x5f7563['options']);return db[_0x993e('0x35')]['find'](_0x258795)[_0x993e('0x2b')](handleEntityNotFound(_0x5074a6,null))[_0x993e('0x2b')](respondWithResult(_0x5074a6,null))[_0x993e('0x4e')](handleError(_0x5074a6,null));};exports[_0x993e('0x2c')]=function(_0x2cba37,_0x276b99){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x2cba37['params']['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x276b99,null))[_0x993e('0x2b')](removeEntity(_0x276b99,null))[_0x993e('0x4e')](handleError(_0x276b99,null));};exports['describe']=function(_0x355912,_0x53c1e9){return db[_0x993e('0x35')][_0x993e('0x50')]()['then'](respondWithResult(_0x53c1e9,null))[_0x993e('0x4e')](handleError(_0x53c1e9,null));};exports[_0x993e('0x51')]=function(_0x579c43,_0x3809ef){var _0x207e27;return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x2e368e){return db['VoicePrefix']['create'](_0x579c43['body'],{'transaction':_0x2e368e})[_0x993e('0x2b')](function(_0x29f8a5){_0x207e27=_0x29f8a5[_0x993e('0x2d')]({'plain':!![]});return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x207e27[_0x993e('0x55')]},'raw':!![]})['then'](function(_0x3a897d){return createVoicePrefixExtensions(_0x207e27,_0x3a897d,_0x2e368e);});});})[_0x993e('0x2b')](function(){var _0x15c8ed=_0x579c43['user'][_0x993e('0x2d')]({'plain':!![]});if(!_0x15c8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c8ed['role']===_0x993e('0x56')){var _0x37d7b1=_0x207e27;return db['UserProfileSection'][_0x993e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x15c8ed[_0x993e('0x57')]},'raw':!![]})[_0x993e('0x2b')](function(_0x4a0dbd){if(_0x4a0dbd&&_0x4a0dbd['autoAssociation']===0x0){return db[_0x993e('0x2f')][_0x993e('0x51')]({'name':_0x37d7b1[_0x993e('0x32')],'resourceId':_0x37d7b1['id'],'type':_0x4a0dbd[_0x993e('0x32')],'sectionId':_0x4a0dbd['id']},{})[_0x993e('0x2b')](function(){return _0x207e27;});}else{return _0x207e27;}})[_0x993e('0x4e')](function(_0x4f9225){logger[_0x993e('0x30')](_0x993e('0x58'),_0x4f9225);throw _0x4f9225;});}return _0x207e27;})['then'](respondWithResult(_0x3809ef,null))[_0x993e('0x4e')](handleError(_0x3809ef,null));};function Extension(_0x473e00,_0x1b2113,_0x5ebaec,_0x426341){this[_0x993e('0x59')]=_0x993e('0x5a');this['exten']=_0x473e00;this[_0x993e('0x5b')]=_0x5ebaec;this[_0x993e('0x37')]=_0x993e('0x5c');this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x1b2113;this[_0x993e('0x5d')]=_0x426341;}function createVoicePrefixExtensions(_0x98d16c,_0x3a3d29,_0x411484){return new BPromise(function(_0xc62106,_0x55a347){var _0x18367f=new Extension(formatPrefixName(_0x98d16c[_0x993e('0x5e')]),0x1,_0x993e('0x5f'),'Voice\x20Prefix');_0x18367f[_0x993e('0x60')]=_0x98d16c['id'];return db[_0x993e('0x54')][_0x993e('0x51')](_0x18367f,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x5e4ab1){var _0x54417b=_0x5e4ab1[_0x993e('0x2d')]({'plain':!![]});var _0x51cec9=_['map'](addVoicePrefixExtensions(_0x98d16c,_0x3a3d29),function(_0x17c7f7){_0x17c7f7[_0x993e('0x55')]=_0x54417b['id'];_0x17c7f7[_0x993e('0x60')]=_0x98d16c['id'];return _0x17c7f7;});return db[_0x993e('0x54')][_0x993e('0x61')](_0x51cec9,{'transaction':_0x411484})[_0x993e('0x2b')](function(_0x211204){if(!_0x211204){return _0x55a347(_0x993e('0x62'));}else{return _0xc62106(_0x211204);}})[_0x993e('0x4e')](function(_0x113395){return _0x55a347(_0x113395);});});;});};function addVoicePrefixExtensions(_0x300a93,_0x44def2){var _0x2ddc16=[];var _0x609430=formatPrefixName(_0x300a93[_0x993e('0x5e')]);_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x2,'Set',_0x993e('0x64')+_0x300a93[_0x993e('0x32')]));if(_0x300a93['callerIdAll']){_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'Set',_0x993e('0x65')+_0x300a93[_0x993e('0x66')]));}else{_0x2ddc16[_0x993e('0x63')](new Extension(_0x609430,0x3,'NoOp',_0x993e('0x67')));}_0x2ddc16['push'](new Extension(_0x609430,0x4,'goto',_0x44def2[_0x993e('0x59')]+','+_0x993e('0x68')+(0x8+_0x300a93[_0x993e('0x32')][_0x993e('0x69')])+'}'+','+0x1));return _0x2ddc16;}function formatPrefixName(_0x2a243a){var _0x5194de='_';for(var _0x120d51=0x0;_0x120d51<_0x2a243a[_0x993e('0x69')];_0x120d51++){if(_0x2a243a[_0x993e('0x6a')](_0x120d51)=='-'){_0x5194de+=_0x2a243a['charAt'](_0x120d51);}else{_0x5194de+='['+_0x2a243a[_0x993e('0x6a')](_0x120d51)+']';}}_0x5194de+='.';return _0x5194de;}exports['update']=function(_0x1ab10e,_0x6ef96,_0x42288d){var _0x5afba1=_0x1ab10e[_0x993e('0x6b')];_0x5afba1[_0x993e('0x5e')]=_0x993e('0x6c')+_0x5afba1[_0x993e('0x32')]+'-';return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x108cad){return db[_0x993e('0x35')][_0x993e('0x2a')](_0x5afba1,{'where':{'id':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db['VoiceExtension'][_0x993e('0x2c')]({'where':{'VoicePrefixId':_0x5afba1['id']},'transaction':_0x108cad})[_0x993e('0x2b')](function(){return db[_0x993e('0x54')][_0x993e('0x4f')]({'where':{'id':_0x5afba1[_0x993e('0x55')]},'raw':!![]})[_0x993e('0x2b')](function(_0x282c53){return createVoicePrefixExtensions(_0x5afba1,_0x282c53,_0x108cad);});});});})[_0x993e('0x2b')](function(){return db['VoicePrefix']['findById'](_0x5afba1['id']);})[_0x993e('0x2b')](respondWithResult(_0x6ef96,null))['catch'](handleError(_0x6ef96,null));};exports[_0x993e('0x6d')]=function(_0x444da6,_0x2ce913,_0x49788e){return db[_0x993e('0x35')]['find']({'where':{'id':_0x444da6[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x2ce913,null))[_0x993e('0x2b')](function(_0x40768a){if(_0x40768a){return _0x40768a[_0x993e('0x6d')](_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')],_[_0x993e('0x6f')](_0x444da6['body'],['ids','id'])||{})[_0x993e('0x70')](function(_0x5a70ff){for(var _0x2fb182=0x0;_0x2fb182<_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x993e('0x69')];_0x2fb182+=0x1){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':Number(_0x444da6[_0x993e('0x6b')][_0x993e('0x6e')][_0x2fb182]),'VoicePrefixId':Number(_0x444da6[_0x993e('0x4b')]['id'])});}return _0x5a70ff;});}})[_0x993e('0x2b')](respondWithResult(_0x2ce913,null))['catch'](handleError(_0x2ce913,null));};exports[_0x993e('0x73')]=function(_0x14347f,_0x4a0002,_0x4742d9){return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x14347f[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x4a0002,null))[_0x993e('0x2b')](function(_0x4157b6){if(_0x4157b6){return _0x4157b6[_0x993e('0x73')](_0x14347f[_0x993e('0x38')]['ids'])[_0x993e('0x2b')](function(){if(_[_0x993e('0x74')](_0x14347f[_0x993e('0x38')][_0x993e('0x6e')])){for(var _0x53ce16=0x0;_0x53ce16<_0x14347f['query'][_0x993e('0x6e')]['length'];_0x53ce16+=0x1){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')][_0x53ce16]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}}else{socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':Number(_0x14347f[_0x993e('0x38')][_0x993e('0x6e')]),'VoicePrefixId':Number(_0x14347f[_0x993e('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a0002,null))[_0x993e('0x4e')](handleError(_0x4a0002,null));};exports[_0x993e('0x76')]=function(_0x3abd3a,_0x278c2a,_0x3f6347){var _0x1a3967={};var _0x1079e7={};var _0x5c634a;var _0x47c3b6;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x3abd3a[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x278c2a,null))[_0x993e('0x2b')](function(_0x53b0c8){if(_0x53b0c8){_0x5c634a=_0x53b0c8;_0x1079e7['model']=_['keys'](db[_0x993e('0x78')][_0x993e('0x36')]);_0x1079e7[_0x993e('0x38')]=_[_0x993e('0x39')](_0x3abd3a[_0x993e('0x38')]);_0x1079e7['filters']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],_0x1079e7[_0x993e('0x38')]);_0x1a3967['attributes']=_[_0x993e('0x3b')](_0x1079e7[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x3e')]));_0x1a3967[_0x993e('0x3d')]=_0x1a3967['attributes'][_0x993e('0x69')]?_0x1a3967['attributes']:_0x1079e7['model'];_0x1a3967['order']=qs['sort'](_0x3abd3a[_0x993e('0x38')][_0x993e('0x42')]);_0x1a3967[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x3abd3a[_0x993e('0x38')],_0x1079e7[_0x993e('0x3a')]));if(_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]){_0x1a3967['where']=_[_0x993e('0x46')](_0x1a3967['where'],{'$or':_[_0x993e('0x34')](_0x1a3967[_0x993e('0x3d')],function(_0x3e7793){var _0x65c6f0={};_0x65c6f0[_0x3e7793]={'$like':'%'+_0x3abd3a[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x65c6f0;})});}_0x1a3967=_[_0x993e('0x46')]({},_0x1a3967,_0x3abd3a['options']);return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})[_0x993e('0x2b')](function(_0x285c93){if(_0x285c93){_0x47c3b6=_0x285c93['length'];if(!_0x3abd3a[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x1a3967['limit']=qs[_0x993e('0x24')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x24')]);_0x1a3967[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x3abd3a[_0x993e('0x38')][_0x993e('0x22')]);}return _0x5c634a[_0x993e('0x76')](_0x1a3967);}})['then'](function(_0x412d21){if(_0x412d21){return _0x412d21?{'count':_0x47c3b6,'rows':_0x412d21}:null;}})['then'](respondWithResult(_0x278c2a,null))[_0x993e('0x4e')](handleError(_0x278c2a,null));};exports[_0x993e('0x79')]=function(_0x4d6d94,_0x505f28,_0x4e2ccf){var _0x4506cb={};var _0x31e947={};var _0x7800d4;var _0x4e1fcf;return db[_0x993e('0x35')][_0x993e('0x77')]({'where':{'id':_0x4d6d94[_0x993e('0x4b')]['id']}})[_0x993e('0x2b')](handleEntityNotFound(_0x505f28,null))['then'](function(_0xc35545){if(_0xc35545){_0x7800d4=_0xc35545;_0x31e947['model']=_[_0x993e('0x39')](db['Team']['rawAttributes']);_0x31e947[_0x993e('0x38')]=_[_0x993e('0x39')](_0x4d6d94[_0x993e('0x38')]);_0x31e947[_0x993e('0x3a')]=_['intersection'](_0x31e947['model'],_0x31e947['query']);_0x4506cb[_0x993e('0x3d')]=_['intersection'](_0x31e947[_0x993e('0x3c')],qs[_0x993e('0x3e')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x3e')]));_0x4506cb[_0x993e('0x3d')]=_0x4506cb['attributes'][_0x993e('0x69')]?_0x4506cb[_0x993e('0x3d')]:_0x31e947['model'];_0x4506cb[_0x993e('0x41')]=qs['sort'](_0x4d6d94[_0x993e('0x38')][_0x993e('0x42')]);_0x4506cb[_0x993e('0x43')]=qs[_0x993e('0x3a')](_[_0x993e('0x44')](_0x4d6d94[_0x993e('0x38')],_0x31e947[_0x993e('0x3a')]));if(_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]){_0x4506cb['where']=_[_0x993e('0x46')](_0x4506cb['where'],{'$or':_[_0x993e('0x34')](_0x4506cb[_0x993e('0x3d')],function(_0x50dd66){var _0x48acd5={};_0x48acd5[_0x50dd66]={'$like':'%'+_0x4d6d94[_0x993e('0x38')][_0x993e('0x45')]+'%'};return _0x48acd5;})});}_0x4506cb=_['merge']({},_0x4506cb,_0x4d6d94[_0x993e('0x7a')]);return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0xc56e5a){if(_0xc56e5a){_0x4e1fcf=_0xc56e5a['length'];if(!_0x4d6d94[_0x993e('0x38')][_0x993e('0x3f')](_0x993e('0x40'))){_0x4506cb[_0x993e('0x24')]=qs[_0x993e('0x24')](_0x4d6d94['query'][_0x993e('0x24')]);_0x4506cb[_0x993e('0x22')]=qs[_0x993e('0x22')](_0x4d6d94[_0x993e('0x38')][_0x993e('0x22')]);}return _0x7800d4[_0x993e('0x79')](_0x4506cb);}})[_0x993e('0x2b')](function(_0x5d2b00){if(_0x5d2b00){return _0x5d2b00?{'count':_0x4e1fcf,'rows':_0x5d2b00}:null;}})[_0x993e('0x2b')](respondWithResult(_0x505f28,null))['catch'](handleError(_0x505f28,null));};exports[_0x993e('0x7b')]=function(_0x8dc65,_0x4a5755,_0x43b5c5){var _0x4d53d1=_0x8dc65['body'][_0x993e('0x6e')];var _0x371be2;return db['Team'][_0x993e('0x48')]({'where':{'id':_0x4d53d1},'attributes':['id'],'include':[{'model':db[_0x993e('0x78')],'as':_0x993e('0x7c'),'attributes':['id',_0x993e('0x32'),'online',_0x993e('0x7d'),'interface'],'raw':!![]}]})[_0x993e('0x2b')](function(_0x5c9960){if(_0x5c9960){_0x371be2=_0x5c9960;var _0x4286a0=_[_0x993e('0x7e')](_0x5c9960,function(_0x2540e4){var _0x56a23a=_0x2540e4['get']({'plain':!![]});return _0x56a23a[_0x993e('0x7c')];});return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x8dc65[_0x993e('0x4b')]['id']}})['then'](function(_0x37409f){return db['sequelize'][_0x993e('0x53')](function(_0xa16043){return _0x37409f[_0x993e('0x7b')](_0x4d53d1,{'transaction':_0xa16043})['then'](function(){return BPromise[_0x993e('0x7f')](_0x371be2,function(_0x30f7a3){return db[_0x993e('0x80')][_0x993e('0x81')]({'TeamId':_0x30f7a3['id'],'VoicePrefixId':_0x8dc65[_0x993e('0x4b')]['id']},{'transaction':_0xa16043});});})[_0x993e('0x2b')](function(){return BPromise[_0x993e('0x7f')](_0x4286a0,function(_0x3e61d2){return db[_0x993e('0x82')]['findOrCreate']({'where':{'UserId':_0x3e61d2['id'],'VoicePrefixId':_0x8dc65['params']['id']},'transaction':_0xa16043});});})['then'](function(){_0x4286a0[_0x993e('0x83')](function(_0x47c230){socket[_0x993e('0x71')](_0x993e('0x72'),{'UserId':_0x47c230['id'],'VoicePrefixId':_0x37409f['id']});});});});});}})[_0x993e('0x2b')](respondWithStatusCode(_0x4a5755,null))[_0x993e('0x4e')](handleError(_0x4a5755,null));};exports['removeTeams']=function(_0x548dfb,_0x123dcd,_0x4e7340){return db[_0x993e('0x84')][_0x993e('0x48')]({'where':{'id':_0x548dfb[_0x993e('0x38')][_0x993e('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x993e('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x123dcd,null))['then'](function(_0x242374){var _0x1a3779=_[_0x993e('0x34')](_0x242374,'id');var _0x366809=[];var _0x11ba3a=[];var _0x1b2ca0=squel[_0x993e('0x85')]();_0x1b2ca0[_0x993e('0x86')](_0x993e('0x87'))[_0x993e('0x88')](_0x993e('0x89'),'tq')[_0x993e('0x8a')]('user_has_teams','ut',_0x993e('0x8b'))[_0x993e('0x43')](_0x993e('0x8c'),_0x548dfb[_0x993e('0x4b')]['id']);for(var _0x23ecf0=0x0;_0x23ecf0<_0x242374[_0x993e('0x69')];_0x23ecf0+=0x1){let _0x2fcfaa=_0x242374[_0x23ecf0];for(var _0x5303c9=0x0;_0x5303c9<_0x2fcfaa[_0x993e('0x7c')]['length'];_0x5303c9+=0x1){let _0x5d5dc8=_0x2fcfaa[_0x993e('0x7c')][_0x5303c9];var _0x102393=_0x1b2ca0[_0x993e('0x8d')]();_0x102393['where'](_0x993e('0x8e'),_0x5d5dc8['id']);_0x11ba3a[_0x993e('0x63')](db[_0x993e('0x52')][_0x993e('0x38')](_0x102393[_0x993e('0x8f')](),{'type':db[_0x993e('0x52')][_0x993e('0x90')]['SELECT']})[_0x993e('0x2b')](function(_0x6ee3c0){if(_0x6ee3c0['length']===0x1){return _0x5d5dc8['id'];}else{var _0x58fee1=_[_0x993e('0x91')](_[_0x993e('0x34')](_0x6ee3c0,_0x993e('0x92')),function(_0x2f0669){return _[_0x993e('0x93')](_0x1a3779,_0x2f0669);});if(_0x58fee1){return _0x5d5dc8['id'];}}}));}}return BPromise['all'](_0x11ba3a)[_0x993e('0x2b')](function(_0x3725b5){_0x366809=_(_0x366809)['union'](_0x3725b5)[_0x993e('0x94')]()['value']();return db[_0x993e('0x35')][_0x993e('0x4f')]({'where':{'id':_0x548dfb['params']['id']}})[_0x993e('0x2b')](function(_0x5ee2e0){return db[_0x993e('0x52')][_0x993e('0x53')](function(_0x289772){return _0x5ee2e0['removeTeams'](_0x548dfb['query'][_0x993e('0x6e')],{'transaction':_0x289772})[_0x993e('0x2b')](function(){if(!_[_0x993e('0x95')](_0x366809)){return _0x5ee2e0[_0x993e('0x73')](_0x366809,{'transaction':_0x289772});}})[_0x993e('0x2b')](function(){_0x366809[_0x993e('0x83')](function(_0x366f8f){socket[_0x993e('0x71')](_0x993e('0x75'),{'UserId':_0x366f8f,'VoicePrefixId':_0x5ee2e0['id']});});});});});});})['then'](respondWithStatusCode(_0x123dcd,null))[_0x993e('0x4e')](handleError(_0x123dcd,null));}; \ No newline at end of file +var _0x77e6=['send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','catch','describe','create','sequelize','transaction','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','description','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','findById','addAgents','body','ids','omit','spread','emit','userVoicePrefix:save','userVoicePrefix:remove','findOne','User','getAgents','hasOwnProperty','getTeams','Team','addTeams','Agents','online','flatMap','TeamVoicePrefix','upsert','each','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x5d853b,_0x54e61e){var _0x549ce8=function(_0x24d474){while(--_0x24d474){_0x5d853b['push'](_0x5d853b['shift']());}};_0x549ce8(++_0x54e61e);}(_0x77e6,0x1a6));var _0x677e=function(_0x38f418,_0x7fa32d){_0x38f418=_0x38f418-0x0;var _0x57ad33=_0x77e6[_0x38f418];return _0x57ad33;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];config[_0x677e('0x1a')]=_[_0x677e('0x1b')](config[_0x677e('0x1a')],{'host':_0x677e('0x1c'),'port':0x18eb});var socket=require(_0x677e('0x1d'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x213a50,_0x1dbe16){_0x1dbe16=_0x1dbe16||0xcc;return function(_0x105c88){if(_0x105c88){return _0x213a50[_0x677e('0x1e')](_0x1dbe16);}return _0x213a50[_0x677e('0x1f')](_0x1dbe16)[_0x677e('0x20')]();};}function respondWithResult(_0x24c9eb,_0xe88242){_0xe88242=_0xe88242||0xc8;return function(_0x251069){if(_0x251069){return _0x24c9eb[_0x677e('0x1f')](_0xe88242)[_0x677e('0x21')](_0x251069);}};}function respondWithFilteredResult(_0xe4d960,_0x49d428){return function(_0x1c5124){if(_0x1c5124){var _0x2ef2bf=typeof _0x49d428[_0x677e('0x22')]===_0x677e('0x23')&&typeof _0x49d428[_0x677e('0x24')]===_0x677e('0x23');var _0x52f65d=_0x1c5124[_0x677e('0x25')];var _0x4bfbb6=_0x2ef2bf?0x0:_0x49d428[_0x677e('0x22')];var _0x267aac=_0x2ef2bf?_0x1c5124[_0x677e('0x25')]:_0x49d428['offset']+_0x49d428[_0x677e('0x24')];var _0x1a6122;if(_0x267aac>=_0x52f65d){_0x267aac=_0x52f65d;_0x1a6122=0xc8;}else{_0x1a6122=0xce;}_0xe4d960[_0x677e('0x1f')](_0x1a6122);return _0xe4d960[_0x677e('0x26')](_0x677e('0x27'),_0x4bfbb6+'-'+_0x267aac+'/'+_0x52f65d)[_0x677e('0x21')](_0x1c5124);}return null;};}function patchUpdates(_0x3a7895){return function(_0x52ee8b){try{jsonpatch['apply'](_0x52ee8b,_0x3a7895,!![]);}catch(_0x52d915){return BPromise[_0x677e('0x28')](_0x52d915);}return _0x52ee8b[_0x677e('0x29')]();};}function saveUpdates(_0x31a1e4,_0x540d0e){return function(_0x424e5d){if(_0x424e5d){return _0x424e5d[_0x677e('0x2a')](_0x31a1e4)[_0x677e('0x2b')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x2c51d3,_0x3f0646){return function(_0x5e5397){if(_0x5e5397){return _0x5e5397['destroy']()[_0x677e('0x2b')](function(){var _0x184f68=_0x5e5397['get']({'plain':!![]});var _0x51e39d=_0x677e('0x2c');return db[_0x677e('0x2d')][_0x677e('0x2e')]({'where':{'type':_0x51e39d,'resourceId':_0x184f68['id']}})[_0x677e('0x2b')](function(){return _0x5e5397;});})[_0x677e('0x2b')](function(){_0x2c51d3['status'](0xcc)[_0x677e('0x20')]();});}};}function handleEntityNotFound(_0x2a6033,_0xeca8e2){return function(_0x1e2694){if(!_0x1e2694){_0x2a6033[_0x677e('0x1e')](0x194);}return _0x1e2694;};}function handleError(_0x2bd6fb,_0x9179a0){_0x9179a0=_0x9179a0||0x1f4;return function(_0x10eb66){logger[_0x677e('0x2f')](_0x10eb66['stack']);if(_0x10eb66[_0x677e('0x30')]){delete _0x10eb66[_0x677e('0x30')];}_0x2bd6fb[_0x677e('0x1f')](_0x9179a0)[_0x677e('0x31')](_0x10eb66);};}exports[_0x677e('0x32')]=function(_0x16f516,_0x34bb3d){var _0x65331={},_0x3b875f={},_0x1d9756={'count':0x0,'rows':[]};var _0x4d0c01=_[_0x677e('0x33')](db[_0x677e('0x34')][_0x677e('0x35')],function(_0x2570b9){return{'name':_0x2570b9[_0x677e('0x36')],'type':_0x2570b9[_0x677e('0x37')]['key']};});_0x3b875f[_0x677e('0x38')]=_[_0x677e('0x33')](_0x4d0c01,_0x677e('0x30'));_0x3b875f['query']=_[_0x677e('0x39')](_0x16f516[_0x677e('0x3a')]);_0x3b875f[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],_0x3b875f['query']);_0x65331[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x16f516['query'][_0x677e('0x3e')]));_0x65331[_0x677e('0x3d')]=_0x65331[_0x677e('0x3d')]['length']?_0x65331['attributes']:_0x3b875f[_0x677e('0x38')];if(!_0x16f516[_0x677e('0x3a')]['hasOwnProperty'](_0x677e('0x3f'))){_0x65331[_0x677e('0x24')]=qs['limit'](_0x16f516['query'][_0x677e('0x24')]);_0x65331[_0x677e('0x22')]=qs['offset'](_0x16f516['query'][_0x677e('0x22')]);}_0x65331[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x16f516['query'][_0x677e('0x41')]);_0x65331[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x16f516[_0x677e('0x3a')],_0x3b875f['filters']),_0x4d0c01);if(_0x16f516['query'][_0x677e('0x44')]){_0x65331[_0x677e('0x42')]=_[_0x677e('0x45')](_0x65331[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x4d0c01,function(_0x2f8ebb){if(_0x2f8ebb[_0x677e('0x37')]!==_0x677e('0x46')){var _0x78202e={};_0x78202e[_0x2f8ebb[_0x677e('0x30')]]={'$like':'%'+_0x16f516['query']['filter']+'%'};return _0x78202e;}})});}_0x65331=_[_0x677e('0x45')]({},_0x65331,_0x16f516[_0x677e('0x47')]);var _0x5abab2={'where':_0x65331[_0x677e('0x42')]};return db['VoicePrefix'][_0x677e('0x25')](_0x5abab2)[_0x677e('0x2b')](function(_0x283aaa){_0x1d9756[_0x677e('0x25')]=_0x283aaa;if(_0x16f516[_0x677e('0x3a')][_0x677e('0x48')]){_0x65331['include']=[{'all':!![]}];}return db[_0x677e('0x34')][_0x677e('0x49')](_0x65331);})[_0x677e('0x2b')](function(_0x33fce2){_0x1d9756[_0x677e('0x4a')]=_0x33fce2;return _0x1d9756;})[_0x677e('0x2b')](respondWithFilteredResult(_0x34bb3d,_0x65331))['catch'](handleError(_0x34bb3d,null));};exports[_0x677e('0x4b')]=function(_0x5ca3db,_0x3211a9){var _0x2470d0={'raw':![],'where':{'id':_0x5ca3db[_0x677e('0x4c')]['id']}},_0x3609da={};_0x3609da[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x34')][_0x677e('0x35')]);_0x3609da[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5ca3db['query']);_0x3609da[_0x677e('0x3b')]=_['intersection'](_0x3609da['model'],_0x3609da[_0x677e('0x3a')]);_0x2470d0[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3609da[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5ca3db['query'][_0x677e('0x3e')]));_0x2470d0[_0x677e('0x3d')]=_0x2470d0[_0x677e('0x3d')][_0x677e('0x4d')]?_0x2470d0[_0x677e('0x3d')]:_0x3609da['model'];if(_0x5ca3db[_0x677e('0x3a')][_0x677e('0x48')]){_0x2470d0[_0x677e('0x4e')]=[{'all':!![]}];}_0x2470d0=_['merge']({},_0x2470d0,_0x5ca3db[_0x677e('0x47')]);return db['VoicePrefix'][_0x677e('0x4f')](_0x2470d0)['then'](handleEntityNotFound(_0x3211a9,null))['then'](respondWithResult(_0x3211a9,null))[_0x677e('0x50')](handleError(_0x3211a9,null));};exports[_0x677e('0x2e')]=function(_0x1f767f,_0x3ff832){return db['VoicePrefix'][_0x677e('0x4f')]({'where':{'id':_0x1f767f[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ff832,null))[_0x677e('0x2b')](removeEntity(_0x3ff832,null))[_0x677e('0x50')](handleError(_0x3ff832,null));};exports[_0x677e('0x51')]=function(_0x23d4fd,_0x2a362e){return db['VoicePrefix'][_0x677e('0x51')]()['then'](respondWithResult(_0x2a362e,null))['catch'](handleError(_0x2a362e,null));};exports[_0x677e('0x52')]=function(_0x4d826f,_0x1af05b){var _0x2f06e0;return db[_0x677e('0x53')][_0x677e('0x54')](function(_0x410012){return db[_0x677e('0x34')][_0x677e('0x52')](_0x4d826f['body'],{'transaction':_0x410012})['then'](function(_0x56a626){_0x2f06e0=_0x56a626[_0x677e('0x55')]({'plain':!![]});return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'id':_0x2f06e0[_0x677e('0x57')]},'raw':!![]})[_0x677e('0x2b')](function(_0x1e59a7){return createVoicePrefixExtensions(_0x2f06e0,_0x1e59a7,_0x410012);});});})['then'](function(){var _0x118fb3=_0x4d826f[_0x677e('0x58')]['get']({'plain':!![]});if(!_0x118fb3)throw new Error(_0x677e('0x59'));if(_0x118fb3['role']===_0x677e('0x58')){var _0x20ae18=_0x2f06e0;return db[_0x677e('0x5a')][_0x677e('0x4f')]({'where':{'name':'VoicePrefixes','userProfileId':_0x118fb3[_0x677e('0x5b')]},'raw':!![]})['then'](function(_0x2cb161){if(_0x2cb161&&_0x2cb161[_0x677e('0x5c')]===0x0){return db[_0x677e('0x2d')][_0x677e('0x52')]({'name':_0x20ae18[_0x677e('0x30')],'resourceId':_0x20ae18['id'],'type':_0x2cb161['name'],'sectionId':_0x2cb161['id']},{})[_0x677e('0x2b')](function(){return _0x2f06e0;});}else{return _0x2f06e0;}})[_0x677e('0x50')](function(_0x3c1e10){logger['error'](_0x677e('0x5d'),_0x3c1e10);throw _0x3c1e10;});}return _0x2f06e0;})[_0x677e('0x2b')](respondWithResult(_0x1af05b,null))[_0x677e('0x50')](handleError(_0x1af05b,null));};function Extension(_0x15fd83,_0x35c3b7,_0x44988b,_0x52cd04){this[_0x677e('0x5e')]='from-sip';this['exten']=_0x15fd83;this[_0x677e('0x5f')]=_0x44988b;this['type']='system';this[_0x677e('0x60')]='Voice\x20Prefix\x20Extension';this[_0x677e('0x61')]=_0x35c3b7;this[_0x677e('0x62')]=_0x52cd04;}function createVoicePrefixExtensions(_0x585c4d,_0x3a1555,_0x100be4){return new BPromise(function(_0x379b92,_0x1f11c1){var _0x26479f=new Extension(formatPrefixName(_0x585c4d[_0x677e('0x63')]),0x1,'NoOp',_0x677e('0x64'));_0x26479f[_0x677e('0x65')]=_0x585c4d['id'];return db[_0x677e('0x56')]['create'](_0x26479f,{'transaction':_0x100be4})[_0x677e('0x2b')](function(_0x1da51f){var _0x32cc95=_0x1da51f[_0x677e('0x55')]({'plain':!![]});var _0x2298c8=_[_0x677e('0x33')](addVoicePrefixExtensions(_0x585c4d,_0x3a1555),function(_0x1bc37f){_0x1bc37f[_0x677e('0x57')]=_0x32cc95['id'];_0x1bc37f['VoicePrefixId']=_0x585c4d['id'];return _0x1bc37f;});return db[_0x677e('0x56')][_0x677e('0x66')](_0x2298c8,{'transaction':_0x100be4})[_0x677e('0x2b')](function(_0x2fa495){if(!_0x2fa495){return _0x1f11c1(_0x677e('0x67'));}else{return _0x379b92(_0x2fa495);}})['catch'](function(_0x6ee13d){return _0x1f11c1(_0x6ee13d);});});;});};function addVoicePrefixExtensions(_0x20e595,_0x3e84ba){var _0x16b622=[];var _0x5b5d34=formatPrefixName(_0x20e595[_0x677e('0x63')]);_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x2,_0x677e('0x69'),_0x677e('0x6a')+_0x20e595[_0x677e('0x30')]));if(_0x20e595[_0x677e('0x6b')]){_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x3,_0x677e('0x69'),_0x677e('0x6c')+_0x20e595[_0x677e('0x6b')]));}else{_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x3,'NoOp','No\x20callerid\x20available'));}_0x16b622[_0x677e('0x68')](new Extension(_0x5b5d34,0x4,_0x677e('0x6d'),_0x3e84ba[_0x677e('0x5e')]+','+_0x677e('0x6e')+(0x8+_0x20e595[_0x677e('0x30')][_0x677e('0x4d')])+'}'+','+0x1));return _0x16b622;}function formatPrefixName(_0x522f82){var _0x10cdb6='_';for(var _0x1a3b1c=0x0;_0x1a3b1c<_0x522f82[_0x677e('0x4d')];_0x1a3b1c++){if(_0x522f82[_0x677e('0x6f')](_0x1a3b1c)=='-'){_0x10cdb6+=_0x522f82[_0x677e('0x6f')](_0x1a3b1c);}else{_0x10cdb6+='['+_0x522f82[_0x677e('0x6f')](_0x1a3b1c)+']';}}_0x10cdb6+='.';return _0x10cdb6;}exports['update']=function(_0x2230b0,_0x5390ee,_0x4b7dca){var _0x36aa6b=_0x2230b0['body'];_0x36aa6b[_0x677e('0x63')]='system-'+_0x36aa6b['name']+'-';return db[_0x677e('0x53')]['transaction'](function(_0x8f3069){return db[_0x677e('0x34')]['update'](_0x36aa6b,{'where':{'id':_0x36aa6b['id']},'transaction':_0x8f3069})[_0x677e('0x2b')](function(){return db[_0x677e('0x56')][_0x677e('0x2e')]({'where':{'VoicePrefixId':_0x36aa6b['id']},'transaction':_0x8f3069})[_0x677e('0x2b')](function(){return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'id':_0x36aa6b['VoiceExtensionId']},'raw':!![]})[_0x677e('0x2b')](function(_0x56f918){return createVoicePrefixExtensions(_0x36aa6b,_0x56f918,_0x8f3069);});});});})[_0x677e('0x2b')](function(){return db['VoicePrefix'][_0x677e('0x70')](_0x36aa6b['id']);})[_0x677e('0x2b')](respondWithResult(_0x5390ee,null))[_0x677e('0x50')](handleError(_0x5390ee,null));};exports['addAgents']=function(_0x496dcc,_0x5f2a2a,_0x570fc9){return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x496dcc[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x5f2a2a,null))[_0x677e('0x2b')](function(_0x2f9c58){if(_0x2f9c58){return _0x2f9c58[_0x677e('0x71')](_0x496dcc[_0x677e('0x72')][_0x677e('0x73')],_[_0x677e('0x74')](_0x496dcc[_0x677e('0x72')],['ids','id'])||{})[_0x677e('0x75')](function(_0x358ba9){for(var _0x5b07c5=0x0;_0x5b07c5<_0x496dcc[_0x677e('0x72')][_0x677e('0x73')][_0x677e('0x4d')];_0x5b07c5+=0x1){socket[_0x677e('0x76')](_0x677e('0x77'),{'UserId':Number(_0x496dcc[_0x677e('0x72')][_0x677e('0x73')][_0x5b07c5]),'VoicePrefixId':Number(_0x496dcc[_0x677e('0x4c')]['id'])});}return _0x358ba9;});}})[_0x677e('0x2b')](respondWithResult(_0x5f2a2a,null))['catch'](handleError(_0x5f2a2a,null));};exports['removeAgents']=function(_0x3bc3e3,_0xe2d3e6,_0x353656){return db[_0x677e('0x34')]['find']({'where':{'id':_0x3bc3e3[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0xe2d3e6,null))[_0x677e('0x2b')](function(_0x5db841){if(_0x5db841){return _0x5db841['removeAgents'](_0x3bc3e3['query'][_0x677e('0x73')])[_0x677e('0x2b')](function(){if(_['isArray'](_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')])){for(var _0x164211=0x0;_0x164211<_0x3bc3e3[_0x677e('0x3a')]['ids']['length'];_0x164211+=0x1){socket[_0x677e('0x76')](_0x677e('0x78'),{'UserId':Number(_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')][_0x164211]),'VoicePrefixId':Number(_0x3bc3e3['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3bc3e3[_0x677e('0x3a')][_0x677e('0x73')]),'VoicePrefixId':Number(_0x3bc3e3['params']['id'])});}});}})['then'](respondWithStatusCode(_0xe2d3e6,null))[_0x677e('0x50')](handleError(_0xe2d3e6,null));};exports['getAgents']=function(_0x598aac,_0x3e4d40,_0x42746){var _0x30e13e={};var _0x37617d={};var _0x497df7;var _0x5bc26a;return db['VoicePrefix'][_0x677e('0x79')]({'where':{'id':_0x598aac[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x3e4d40,null))[_0x677e('0x2b')](function(_0x1bfd9e){if(_0x1bfd9e){_0x497df7=_0x1bfd9e;_0x37617d[_0x677e('0x38')]=_['keys'](db[_0x677e('0x7a')]['rawAttributes']);_0x37617d['query']=_[_0x677e('0x39')](_0x598aac[_0x677e('0x3a')]);_0x37617d['filters']=_[_0x677e('0x3c')](_0x37617d[_0x677e('0x38')],_0x37617d[_0x677e('0x3a')]);_0x30e13e['attributes']=_['intersection'](_0x37617d[_0x677e('0x38')],qs['fields'](_0x598aac['query'][_0x677e('0x3e')]));_0x30e13e[_0x677e('0x3d')]=_0x30e13e[_0x677e('0x3d')]['length']?_0x30e13e['attributes']:_0x37617d[_0x677e('0x38')];_0x30e13e[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x598aac['query'][_0x677e('0x41')]);_0x30e13e[_0x677e('0x42')]=qs['filters'](_[_0x677e('0x43')](_0x598aac['query'],_0x37617d[_0x677e('0x3b')]));if(_0x598aac[_0x677e('0x3a')]['filter']){_0x30e13e[_0x677e('0x42')]=_[_0x677e('0x45')](_0x30e13e[_0x677e('0x42')],{'$or':_['map'](_0x30e13e['attributes'],function(_0x519da2){var _0x38acdd={};_0x38acdd[_0x519da2]={'$like':'%'+_0x598aac[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x38acdd;})});}_0x30e13e=_[_0x677e('0x45')]({},_0x30e13e,_0x598aac[_0x677e('0x47')]);return _0x497df7[_0x677e('0x7b')](_0x30e13e);}})[_0x677e('0x2b')](function(_0x24a584){if(_0x24a584){_0x5bc26a=_0x24a584[_0x677e('0x4d')];if(!_0x598aac[_0x677e('0x3a')][_0x677e('0x7c')](_0x677e('0x3f'))){_0x30e13e['limit']=qs[_0x677e('0x24')](_0x598aac['query']['limit']);_0x30e13e['offset']=qs[_0x677e('0x22')](_0x598aac[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x497df7['getAgents'](_0x30e13e);}})[_0x677e('0x2b')](function(_0x410a04){if(_0x410a04){return _0x410a04?{'count':_0x5bc26a,'rows':_0x410a04}:null;}})['then'](respondWithResult(_0x3e4d40,null))['catch'](handleError(_0x3e4d40,null));};exports[_0x677e('0x7d')]=function(_0x59cf17,_0x31701e,_0x4b6280){var _0x1cf5a8={};var _0x2171ec={};var _0x4d24ca;var _0x205591;return db[_0x677e('0x34')][_0x677e('0x79')]({'where':{'id':_0x59cf17[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x31701e,null))[_0x677e('0x2b')](function(_0x5a4f85){if(_0x5a4f85){_0x4d24ca=_0x5a4f85;_0x2171ec[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x7e')]['rawAttributes']);_0x2171ec['query']=_[_0x677e('0x39')](_0x59cf17[_0x677e('0x3a')]);_0x2171ec[_0x677e('0x3b')]=_['intersection'](_0x2171ec[_0x677e('0x38')],_0x2171ec[_0x677e('0x3a')]);_0x1cf5a8[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x2171ec['model'],qs[_0x677e('0x3e')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x3e')]));_0x1cf5a8[_0x677e('0x3d')]=_0x1cf5a8['attributes']['length']?_0x1cf5a8[_0x677e('0x3d')]:_0x2171ec[_0x677e('0x38')];_0x1cf5a8['order']=qs[_0x677e('0x41')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x41')]);_0x1cf5a8[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x59cf17[_0x677e('0x3a')],_0x2171ec[_0x677e('0x3b')]));if(_0x59cf17[_0x677e('0x3a')][_0x677e('0x44')]){_0x1cf5a8['where']=_[_0x677e('0x45')](_0x1cf5a8[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x1cf5a8[_0x677e('0x3d')],function(_0x39ab73){var _0x54ae47={};_0x54ae47[_0x39ab73]={'$like':'%'+_0x59cf17[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x54ae47;})});}_0x1cf5a8=_['merge']({},_0x1cf5a8,_0x59cf17[_0x677e('0x47')]);return _0x4d24ca[_0x677e('0x7d')](_0x1cf5a8);}})[_0x677e('0x2b')](function(_0x3bfa41){if(_0x3bfa41){_0x205591=_0x3bfa41['length'];if(!_0x59cf17[_0x677e('0x3a')][_0x677e('0x7c')]('nolimit')){_0x1cf5a8[_0x677e('0x24')]=qs[_0x677e('0x24')](_0x59cf17[_0x677e('0x3a')][_0x677e('0x24')]);_0x1cf5a8[_0x677e('0x22')]=qs['offset'](_0x59cf17[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x4d24ca[_0x677e('0x7d')](_0x1cf5a8);}})['then'](function(_0x218773){if(_0x218773){return _0x218773?{'count':_0x205591,'rows':_0x218773}:null;}})[_0x677e('0x2b')](respondWithResult(_0x31701e,null))['catch'](handleError(_0x31701e,null));};exports[_0x677e('0x7f')]=function(_0x169ad3,_0x589b95,_0xfc07b9){var _0x244d15=_0x169ad3[_0x677e('0x72')][_0x677e('0x73')];var _0x3ceb0d;return db[_0x677e('0x7e')]['findAll']({'where':{'id':_0x244d15},'attributes':['id'],'include':[{'model':db[_0x677e('0x7a')],'as':_0x677e('0x80'),'attributes':['id','name',_0x677e('0x81'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x1438f2){if(_0x1438f2){_0x3ceb0d=_0x1438f2;var _0x2b7e56=_[_0x677e('0x82')](_0x1438f2,function(_0x281857){var _0x524317=_0x281857['get']({'plain':!![]});return _0x524317[_0x677e('0x80')];});return db[_0x677e('0x34')]['find']({'where':{'id':_0x169ad3[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](function(_0x7c18c1){return db[_0x677e('0x53')]['transaction'](function(_0x286217){return _0x7c18c1['addTeams'](_0x244d15,{'transaction':_0x286217})[_0x677e('0x2b')](function(){return BPromise['each'](_0x3ceb0d,function(_0x5309c1){return db[_0x677e('0x83')][_0x677e('0x84')]({'TeamId':_0x5309c1['id'],'VoicePrefixId':_0x169ad3[_0x677e('0x4c')]['id']},{'transaction':_0x286217});});})[_0x677e('0x2b')](function(){return BPromise[_0x677e('0x85')](_0x2b7e56,function(_0x15b416){return db[_0x677e('0x86')][_0x677e('0x87')]({'where':{'UserId':_0x15b416['id'],'VoicePrefixId':_0x169ad3[_0x677e('0x4c')]['id']},'transaction':_0x286217});});})['then'](function(){_0x2b7e56[_0x677e('0x88')](function(_0x36680e){socket['emit'](_0x677e('0x77'),{'UserId':_0x36680e['id'],'VoicePrefixId':_0x7c18c1['id']});});});});});}})['then'](respondWithStatusCode(_0x589b95,null))[_0x677e('0x50')](handleError(_0x589b95,null));};exports[_0x677e('0x89')]=function(_0x3ac7bb,_0x4f149a,_0x9d34f1){return db[_0x677e('0x7e')][_0x677e('0x49')]({'where':{'id':_0x3ac7bb[_0x677e('0x3a')][_0x677e('0x73')]},'attributes':['id'],'include':[{'model':db[_0x677e('0x7a')],'as':_0x677e('0x80'),'attributes':['id'],'raw':!![]}]})[_0x677e('0x2b')](handleEntityNotFound(_0x4f149a,null))[_0x677e('0x2b')](function(_0x12c7f7){var _0x249f0c=_[_0x677e('0x33')](_0x12c7f7,'id');var _0x3d55e7=[];var _0x2b451e=[];var _0x477428=squel[_0x677e('0x8a')]();_0x477428[_0x677e('0x8b')](_0x677e('0x8c'))['from'](_0x677e('0x8d'),'tq')[_0x677e('0x8e')](_0x677e('0x8f'),'ut',_0x677e('0x90'))['where']('VoicePrefixId\x20=\x20?',_0x3ac7bb[_0x677e('0x4c')]['id']);for(var _0x3f54fc=0x0;_0x3f54fc<_0x12c7f7[_0x677e('0x4d')];_0x3f54fc+=0x1){let _0x23a71a=_0x12c7f7[_0x3f54fc];for(var _0x46997f=0x0;_0x46997f<_0x23a71a[_0x677e('0x80')][_0x677e('0x4d')];_0x46997f+=0x1){let _0x2519e9=_0x23a71a['Agents'][_0x46997f];var _0x57b67f=_0x477428[_0x677e('0x91')]();_0x57b67f[_0x677e('0x42')](_0x677e('0x92'),_0x2519e9['id']);_0x2b451e[_0x677e('0x68')](db[_0x677e('0x53')][_0x677e('0x3a')](_0x57b67f['toString'](),{'type':db[_0x677e('0x53')][_0x677e('0x93')][_0x677e('0x94')]})[_0x677e('0x2b')](function(_0x8a8748){if(_0x8a8748[_0x677e('0x4d')]===0x1){return _0x2519e9['id'];}else{var _0x248ddd=_['every'](_['map'](_0x8a8748,_0x677e('0x95')),function(_0x405048){return _[_0x677e('0x96')](_0x249f0c,_0x405048);});if(_0x248ddd){return _0x2519e9['id'];}}}));}}return BPromise[_0x677e('0x97')](_0x2b451e)[_0x677e('0x2b')](function(_0x4284d3){_0x3d55e7=_(_0x3d55e7)[_0x677e('0x98')](_0x4284d3)[_0x677e('0x99')]()[_0x677e('0x9a')]();return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x3ac7bb['params']['id']}})[_0x677e('0x2b')](function(_0x700834){return db['sequelize'][_0x677e('0x54')](function(_0x8e0c11){return _0x700834[_0x677e('0x89')](_0x3ac7bb['query'][_0x677e('0x73')],{'transaction':_0x8e0c11})[_0x677e('0x2b')](function(){if(!_[_0x677e('0x9b')](_0x3d55e7)){return _0x700834[_0x677e('0x9c')](_0x3d55e7,{'transaction':_0x8e0c11});}})['then'](function(){_0x3d55e7[_0x677e('0x88')](function(_0x50acd9){socket['emit'](_0x677e('0x78'),{'UserId':_0x50acd9,'VoicePrefixId':_0x700834['id']});});});});});});})[_0x677e('0x2b')](respondWithStatusCode(_0x4f149a,null))[_0x677e('0x50')](handleError(_0x4f149a,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 9938dfc..570ca79 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 _0xab2b=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0xae6826,_0x117d66){var _0x2303db=function(_0x322f75){while(--_0x322f75){_0xae6826['push'](_0xae6826['shift']());}};_0x2303db(++_0x117d66);}(_0xab2b,0x1c9));var _0xbab2=function(_0x3c49b1,_0x1aa374){_0x3c49b1=_0x3c49b1-0x0;var _0x1eacd1=_0xab2b[_0x3c49b1];return _0x1eacd1;};'use strict';var EventEmitter=require(_0xbab2('0x0'));var VoicePrefix=require(_0xbab2('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbab2('0x2'),'afterDestroy':_0xbab2('0x3')};function emitEvent(_0x190856){return function(_0x3ea372,_0x36b641,_0x496de2){VoicePrefixEvents[_0xbab2('0x4')](_0x190856+':'+_0x3ea372['id'],_0x3ea372);VoicePrefixEvents[_0xbab2('0x4')](_0x190856,_0x3ea372);_0x496de2(null);};}for(var e in events){if(events[_0xbab2('0x5')](e)){var event=events[e];VoicePrefix[_0xbab2('0x6')](e,emitEvent(event));}}module[_0xbab2('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x7f04=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','save','remove','emit'];(function(_0x46f8a6,_0x1dd5d6){var _0x57f58a=function(_0x21124e){while(--_0x21124e){_0x46f8a6['push'](_0x46f8a6['shift']());}};_0x57f58a(++_0x1dd5d6);}(_0x7f04,0xe4));var _0x47f0=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x7f04[_0x435044];return _0x33d4c6;};'use strict';var EventEmitter=require(_0x47f0('0x0'));var VoicePrefix=require(_0x47f0('0x1'))['db'][_0x47f0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47f0('0x3'),'afterUpdate':'update','afterDestroy':_0x47f0('0x4')};function emitEvent(_0x3e927d){return function(_0x570481,_0x5dc75a,_0x170b81){VoicePrefixEvents[_0x47f0('0x5')](_0x3e927d+':'+_0x570481['id'],_0x570481);VoicePrefixEvents[_0x47f0('0x5')](_0x3e927d,_0x570481);_0x170b81(null);};}for(var e in events){if(events[_0x47f0('0x6')](e)){var event=events[e];VoicePrefix[_0x47f0('0x7')](e,emitEvent(event));}}module[_0x47f0('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 1831dfe..167662e 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 _0x4e7c=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes','lodash'];(function(_0x179bbf,_0x1e3a01){var _0x1297dc=function(_0x5ed61b){while(--_0x5ed61b){_0x179bbf['push'](_0x179bbf['shift']());}};_0x1297dc(++_0x1e3a01);}(_0x4e7c,0x12b));var _0xc4e7=function(_0x117cb0,_0x432f1c){_0x117cb0=_0x117cb0-0x0;var _0xadd6b1=_0x4e7c[_0x117cb0];return _0xadd6b1;};'use strict';var _=require(_0xc4e7('0x0'));var util=require(_0xc4e7('0x1'));var logger=require(_0xc4e7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4e7('0x3'));var fs=require('fs');var path=require(_0xc4e7('0x4'));var rimraf=require(_0xc4e7('0x5'));var config=require(_0xc4e7('0x6'));var attributes=require(_0xc4e7('0x7'));module[_0xc4e7('0x8')]=function(_0x27cebc,_0x4577d1){return _0x27cebc['define']('VoicePrefix',attributes,{'tableName':_0xc4e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad9=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','util'];(function(_0x511514,_0x5a3755){var _0x373775=function(_0x2284df){while(--_0x2284df){_0x511514['push'](_0x511514['shift']());}};_0x373775(++_0x5a3755);}(_0x4ad9,0x131));var _0x94ad=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4ad9[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x94ad('0x0'));var logger=require('../../config/logger')(_0x94ad('0x1'));var moment=require(_0x94ad('0x2'));var BPromise=require(_0x94ad('0x3'));var rp=require(_0x94ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94ad('0x5'));var config=require(_0x94ad('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x94ad('0x7')]=function(_0xd3851b,_0x17519f){return _0xd3851b[_0x94ad('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index ebf16d4..9899a17 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 _0x8daf=['request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2965cc,_0xf7d9b0){var _0x2b3208=function(_0x3fa37f){while(--_0x3fa37f){_0x2965cc['push'](_0x2965cc['shift']());}};_0x2b3208(++_0xf7d9b0);}(_0x8daf,0x15c));var _0xf8da=function(_0x1711f8,_0x208f40){_0x1711f8=_0x1711f8-0x0;var _0x38ca74=_0x8daf[_0x1711f8];return _0x38ca74;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8da('0x0'));var fs=require('fs');var Redis=require(_0xf8da('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8da('0x2'));var logger=require(_0xf8da('0x3'))(_0xf8da('0x4'));var config=require(_0xf8da('0x5'));var jayson=require(_0xf8da('0x6'));var client=jayson[_0xf8da('0x7')][_0xf8da('0x8')]({'port':0x232a});config[_0xf8da('0x9')]=_[_0xf8da('0xa')](config['redis'],{'host':_0xf8da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8da('0x9')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x2f16ba,_0x44dabc,_0xbd4f48){return new BPromise(function(_0x408b04,_0x4463eb){return client[_0xf8da('0xc')](_0x2f16ba,_0xbd4f48)[_0xf8da('0xd')](function(_0x31193e){logger['info'](_0xf8da('0xe'),_0x44dabc,_0xf8da('0xf'));logger[_0xf8da('0x10')](_0xf8da('0x11'),_0x44dabc,'request\x20sent',JSON[_0xf8da('0x12')](_0x31193e));if(_0x31193e['error']){if(_0x31193e[_0xf8da('0x13')][_0xf8da('0x14')]===0x1f4){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')]['message']);return _0x4463eb(_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);}logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);return _0x408b04(_0x31193e[_0xf8da('0x13')]['message']);}else{logger[_0xf8da('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x44dabc,'request\x20sent');_0x408b04(_0x31193e[_0xf8da('0x17')][_0xf8da('0x15')]);}})['catch'](function(_0x3e427){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x3e427);_0x4463eb(_0x3e427);});});} \ No newline at end of file +var _0x3ef7=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voicePrefix.socket','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x35f18a,_0x4e66d3){var _0x52d4e0=function(_0x267f42){while(--_0x267f42){_0x35f18a['push'](_0x35f18a['shift']());}};_0x52d4e0(++_0x4e66d3);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});config[_0x73ef('0xb')]=_[_0x73ef('0xc')](config[_0x73ef('0xb')],{'host':_0x73ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73ef('0xb')]));require(_0x73ef('0xe'))['register'](socket);function respondWithRpcPromise(_0x1055e1,_0x21bfed,_0x364470){return new BPromise(function(_0x3bd4c9,_0x33aa09){return client['request'](_0x1055e1,_0x364470)[_0x73ef('0xf')](function(_0x111ce3){logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));logger[_0x73ef('0x13')](_0x73ef('0x14'),_0x21bfed,_0x73ef('0x12'),JSON[_0x73ef('0x15')](_0x111ce3));if(_0x111ce3[_0x73ef('0x16')]){if(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x17')]===0x1f4){logger[_0x73ef('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')]['message']);return _0x33aa09(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);}logger[_0x73ef('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);return _0x3bd4c9(_0x111ce3['error'][_0x73ef('0x18')]);}else{logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));_0x3bd4c9(_0x111ce3[_0x73ef('0x19')]['message']);}})[_0x73ef('0x1a')](function(_0x4dc000){logger[_0x73ef('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21bfed,_0x4dc000);_0x33aa09(_0x4dc000);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index a887574..4a496c3 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 _0x2e35=['removeListener','register','./voicePrefix.events','save','remove','emit'];(function(_0xc554c6,_0x2cd7ff){var _0x3de674=function(_0x5cd748){while(--_0x5cd748){_0xc554c6['push'](_0xc554c6['shift']());}};_0x3de674(++_0x2cd7ff);}(_0x2e35,0x1d0));var _0x52e3=function(_0x1b49cd,_0x4260bb){_0x1b49cd=_0x1b49cd-0x0;var _0x55558e=_0x2e35[_0x1b49cd];return _0x55558e;};'use strict';var VoicePrefixEvents=require(_0x52e3('0x0'));var events=[_0x52e3('0x1'),_0x52e3('0x2'),'update'];function createListener(_0x145ad0,_0xcbe6c5){return function(_0x16d807){_0xcbe6c5[_0x52e3('0x3')](_0x145ad0,_0x16d807);};}function removeListener(_0x4ccab4,_0x158226){return function(){VoicePrefixEvents[_0x52e3('0x4')](_0x4ccab4,_0x158226);};}exports[_0x52e3('0x5')]=function(_0x20d1bc){for(var _0x5f117a=0x0,_0x483b93=events['length'];_0x5f117a<_0x483b93;_0x5f117a++){var _0x21ae13=events[_0x5f117a];var _0x4d77a0=createListener('voicePrefix:'+_0x21ae13,_0x20d1bc);VoicePrefixEvents['on'](_0x21ae13,_0x4d77a0);}}; \ No newline at end of file +var _0xb75c=['./voicePrefix.events','save','remove','emit','removeListener','length'];(function(_0x1fda49,_0x638325){var _0x336c0a=function(_0x1122fa){while(--_0x1122fa){_0x1fda49['push'](_0x1fda49['shift']());}};_0x336c0a(++_0x638325);}(_0xb75c,0x1ce));var _0xcb75=function(_0x4635c0,_0x16e523){_0x4635c0=_0x4635c0-0x0;var _0x1f052b=_0xb75c[_0x4635c0];return _0x1f052b;};'use strict';var VoicePrefixEvents=require(_0xcb75('0x0'));var events=[_0xcb75('0x1'),_0xcb75('0x2'),'update'];function createListener(_0x348403,_0x4da54f){return function(_0x21a350){_0x4da54f[_0xcb75('0x3')](_0x348403,_0x21a350);};}function removeListener(_0x390961,_0x4a39a6){return function(){VoicePrefixEvents[_0xcb75('0x4')](_0x390961,_0x4a39a6);};}exports['register']=function(_0x5f488c){for(var _0xb12187=0x0,_0x284ea6=events[_0xcb75('0x5')];_0xb12187<_0x284ea6;_0xb12187++){var _0x498656=events[_0xb12187];var _0x57ef56=createListener('voicePrefix:'+_0x498656,_0x5f488c);VoicePrefixEvents['on'](_0x498656,_0x57ef56);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bda7a08..deef680 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0xb10b,0x12a));var _0xbb10=function(_0x8ec6b4,_0x31ef52){_0x8ec6b4=_0x8ec6b4-0x0;var _0x52c0d0=_0xb10b[_0x8ec6b4];return _0x52c0d0;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x264ef2,_0x32fb8d){var _0xc8e0bf=function(_0x5092f9){while(--_0x5092f9){_0x264ef2['push'](_0x264ef2['shift']());}};_0xc8e0bf(++_0x32fb8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a3b8d72..0156fcb 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 _0xee9d=['rrordered','strategy','rrmemory','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','once','periodic_announce','join','split','joinempty','setDataValue','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','ringall','leastrecent','fewestcalls','random','wrandom'];(function(_0xe32406,_0x45e983){var _0x187a0b=function(_0x455593){while(--_0x455593){_0xe32406['push'](_0xe32406['shift']());}};_0x187a0b(++_0x45e983);}(_0xee9d,0x12d));var _0xdee9=function(_0x11ab65,_0x485611){_0x11ab65=_0x11ab65-0x0;var _0x5aaf93=_0xee9d[_0x11ab65];return _0x5aaf93;};'use strict';var Sequelize=require(_0xdee9('0x0'));module[_0xdee9('0x1')]={'name':{'type':Sequelize[_0xdee9('0x2')],'allowNull':![],'unique':_0xdee9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xdee9('0x4'),_0xdee9('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xdee9('0x6'),_0xdee9('0x7'),_0xdee9('0x8'),_0xdee9('0x9'),'rrmemory','linear',_0xdee9('0xa'),_0xdee9('0xb')),'allowNull':![],'defaultValue':_0xdee9('0x6'),'set':function(_0xa685e8){this['setDataValue'](_0xdee9('0xc'),_0xa685e8?_0xa685e8:_0xdee9('0xd'));},'get':function(){var _0x20de16=this[_0xdee9('0xe')]('type');var _0x4a7f1f=this['getDataValue'](_0xdee9('0xf'));var _0x1a822=this['getDataValue']('strategy');if(_0x20de16===_0xdee9('0x4')){return _0x1a822;}if(_0x4a7f1f===_0xdee9('0x10')&&_0x1a822===_0xdee9('0xd')||_0x4a7f1f==='booked'&&_0x1a822===_0xdee9('0x11')){return _0x1a822;}if(_0x4a7f1f===_0xdee9('0x12')||_0x4a7f1f===_0xdee9('0x13')||_0x4a7f1f===_0xdee9('0x14')){return _0x1a822;}return null;}},'servicelevel':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xdee9('0x15')](0xb)},'timeout':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xdee9('0x2')]},'weight':{'type':Sequelize[_0xdee9('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':_0xdee9('0x17')},'autopause':{'type':Sequelize['ENUM'](_0xdee9('0x17'),'no',_0xdee9('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xdee9('0x16')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xdee9('0x16')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xdee9('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xdee9('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xdee9('0x16')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xdee9('0x16')]('yes','no'),'defaultValue':_0xdee9('0x17')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xdee9('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0xdee9('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xdee9('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xdee9('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xdee9('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xdee9('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xdee9('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xdee9('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x393545){this['setDataValue'](_0xdee9('0x1a'),_0x393545?_0x393545[_0xdee9('0x1b')](','):[]);},'get':function(){return this[_0xdee9('0xe')](_0xdee9('0x1a'))?this['getDataValue']('periodic_announce')[_0xdee9('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':_0xdee9('0x17'),'set':function(_0x583c49){this['setDataValue'](_0xdee9('0x1d'),_0x583c49?_0x583c49['join'](','):undefined);},'get':function(){return this[_0xdee9('0xe')](_0xdee9('0x1d'))?this[_0xdee9('0xe')](_0xdee9('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x40d441){this[_0xdee9('0x1e')](_0xdee9('0x1f'),_0x40d441?_0x40d441[_0xdee9('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xdee9('0x1f'))?this[_0xdee9('0xe')](_0xdee9('0x1f'))[_0xdee9('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xdee9('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xdee9('0x2')]},'description':{'type':Sequelize[_0xdee9('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x59589d){this['setDataValue']('acw',_0x59589d);if(_0x59589d){if(this[_0xdee9('0xe')]('wrapuptime')<0x2){this[_0xdee9('0x1e')](_0xdee9('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xdee9('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xdee9('0x21')],'defaultValue':0x0,'comment':_0xdee9('0x22')},'dialMethod':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x23'),'progressive',_0xdee9('0x14'),_0xdee9('0x13'),_0xdee9('0x10')),'defaultValue':_0xdee9('0x12'),'comment':_0xdee9('0x24')},'dialLimitChannel':{'type':Sequelize[_0xdee9('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xdee9('0x25')},'dialLimitQueue':{'type':Sequelize[_0xdee9('0x15')](0x4)[_0xdee9('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xdee9('0x27')](0x2)[_0xdee9('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xdee9('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xdee9('0x16')]('agentBusyFactor',_0xdee9('0x29')),'defaultValue':'dropRate','comment':_0xdee9('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xdee9('0x27')](0x2)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xdee9('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdee9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdee9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xdee9('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x2e')},'dialQueueProject':{'type':Sequelize[_0xdee9('0x2')],'comment':_0xdee9('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xdee9('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xdee9('0x35')},'dialTimezone':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':_0xdee9('0x36')},'dialPrefix':{'type':Sequelize[_0xdee9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xdee9('0x16')](_0xdee9('0x37'),'never','onlyIfOpen'),'defaultValue':_0xdee9('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xdee9('0x15')](0x9)[_0xdee9('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xdee9('0x15')](0x9)[_0xdee9('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdee9('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdee9('0x15')](0x9)[_0xdee9('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdee9('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xdee9('0x15')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdee9('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdee9('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdee9('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdee9('0x15')](0x9)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdee9('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdee9('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xdee9('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xdee9('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdee9('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xdee9('0x3f'),'ASC'),'defaultValue':_0xdee9('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xdee9('0x2')],'comment':_0xdee9('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdee9('0x40')},'dialCutDigit':{'type':Sequelize[_0xdee9('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdee9('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x43')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x44')},'dialDropRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdee9('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x47')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdee9('0x15')](0x5)[_0xdee9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdee9('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdee9('0x15')],'allowNull':!![],'comment':_0xdee9('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0xdee9('0x21')],'defaultValue':![],'comment':_0xdee9('0x4b'),'set':function(_0x33d10d){if(!_0x33d10d)this['setDataValue'](_0xdee9('0x4c'),null);this[_0xdee9('0x1e')](_0xdee9('0x4d'),_0x33d10d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xdee9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xdee9('0x15')](0x3)[_0xdee9('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xdee9('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0xb15a=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','ENUM','outbound','default','leastrecent','fewestcalls','random','linear','wrandom','rrordered','ringall','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','inbound','booked','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','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','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xb15a,0x197));var _0xab15=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xb15a[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0xab15('0x0'));module[_0xab15('0x1')]={'name':{'type':Sequelize[_0xab15('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xab15('0x3')]('inbound',_0xab15('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xab15('0x2')],'defaultValue':_0xab15('0x5')},'announce':{'type':Sequelize[_0xab15('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xab15('0x3')]('rr','ringall',_0xab15('0x6'),_0xab15('0x7'),_0xab15('0x8'),'rrmemory',_0xab15('0x9'),_0xab15('0xa'),_0xab15('0xb')),'allowNull':![],'defaultValue':_0xab15('0xc'),'set':function(_0x4ca2cb){this[_0xab15('0xd')](_0xab15('0xe'),_0x4ca2cb?_0x4ca2cb:_0xab15('0xf'));},'get':function(){var _0xb3ed5d=this[_0xab15('0x10')](_0xab15('0x11'));var _0x108d23=this[_0xab15('0x10')](_0xab15('0x12'));var _0x142956=this['getDataValue']('strategy');if(_0xb3ed5d===_0xab15('0x13')){return _0x142956;}if(_0x108d23===_0xab15('0x14')&&_0x142956===_0xab15('0xf')||_0x108d23===_0xab15('0x14')&&_0x142956==='roundrobin'){return _0x142956;}if(_0x108d23==='progressive'||_0x108d23===_0xab15('0x15')||_0x108d23===_0xab15('0x16')){return _0x142956;}return null;}},'servicelevel':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xab15('0x17')](0xb)},'timeout':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xab15('0x2')]},'weight':{'type':Sequelize[_0xab15('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':_0xab15('0x18')},'autopause':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no',_0xab15('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xab15('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xab15('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xab15('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xab15('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xab15('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no'),'defaultValue':_0xab15('0x18')},'announce_holdtime':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x18'),'no',_0xab15('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xab15('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xab15('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xab15('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xab15('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xab15('0x2')]},'queue_quantity1':{'type':Sequelize[_0xab15('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xab15('0x2')]},'queue_less_than':{'type':Sequelize[_0xab15('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x14e695){this[_0xab15('0xd')](_0xab15('0x1b'),_0x14e695?_0x14e695[_0xab15('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xab15('0x1b'))?this[_0xab15('0x10')]('periodic_announce')[_0xab15('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xab15('0x18'),'set':function(_0x11797c){this[_0xab15('0xd')](_0xab15('0x1e'),_0x11797c?_0x11797c['join'](','):undefined);},'get':function(){return this[_0xab15('0x10')](_0xab15('0x1e'))?this[_0xab15('0x10')](_0xab15('0x1e'))[_0xab15('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xab15('0x2')],'defaultValue':'no','set':function(_0x1dfa40){this[_0xab15('0xd')](_0xab15('0x1f'),_0x1dfa40?_0x1dfa40[_0xab15('0x1c')](','):undefined);},'get':function(){return this[_0xab15('0x10')](_0xab15('0x1f'))?this['getDataValue']('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xab15('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xab15('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xab15('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xab15('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xab15('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x36b9fd){this[_0xab15('0xd')](_0xab15('0x20'),_0x36b9fd);if(_0x36b9fd){if(this[_0xab15('0x10')](_0xab15('0x21'))<0x2){this[_0xab15('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xab15('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x23'),_0xab15('0x24'),'power','predictive',_0xab15('0x14')),'defaultValue':'progressive','comment':_0xab15('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xab15('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xab15('0x17')](0x4)[_0xab15('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xab15('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xab15('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xab15('0x3')]('agentBusyFactor','dropRate'),'defaultValue':_0xab15('0x28'),'comment':_0xab15('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xab15('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xab15('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xab15('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab15('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xab15('0x2')],'defaultValue':_0xab15('0x2d'),'comment':_0xab15('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xab15('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab15('0x2f')},'dialQueueProject':{'type':Sequelize[_0xab15('0x2')],'comment':_0xab15('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab15('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0x3,'comment':_0xab15('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xab15('0x35')},'dialPrefix':{'type':Sequelize[_0xab15('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xab15('0x3')]('always','never',_0xab15('0x36')),'defaultValue':_0xab15('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xab15('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xab15('0x39')},'dialAMDGreeting':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xab15('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xab15('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab15('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xab15('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xab15('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xab15('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xab15('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xab15('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xab15('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xab15('0x17')](0x9)[_0xab15('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xab15('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0xab15('0x17')](0x5)[_0xab15('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xab15('0x42')},'dialRecallInQueue':{'type':Sequelize[_0xab15('0x22')],'defaultValue':0x0,'comment':_0xab15('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0xab15('0x3')](_0xab15('0x44'),_0xab15('0x45')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xab15('0x2')],'comment':_0xab15('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xab15('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xab15('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab15('0x46')},'dialCutDigit':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xab15('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab15('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)[_0xab15('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xab15('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)[_0xab15('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xab15('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xab15('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xab15('0x17')](0x5)[_0xab15('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xab15('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xab15('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0xab15('0x22')],'defaultValue':![],'comment':_0xab15('0x4f'),'set':function(_0x343c25){if(!_0x343c25)this[_0xab15('0xd')]('mandatoryDispositionPauseId',null);this[_0xab15('0xd')]('mandatoryDisposition',_0x343c25);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xab15('0x17')](0x3)[_0xab15('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xab15('0x22')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 5833b52..f936866 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 _0x81ca=['type','find','name','UserProfileResource','end','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','merge','VoiceQueue','includeAll','findAll','rows','catch','show','params','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','findOne','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','pick','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','interface','flatMap','forEach','sequelize','transaction','each','TeamVoiceQueue','penalty','UserVoiceQueue','findOrCreate','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','removeTeams','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','voicePause','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','insert','fromQuery','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','get','QueueCampaigns','outbound','filter','value','includes'];(function(_0x515c74,_0x104883){var _0x5e8886=function(_0x3595ab){while(--_0x3595ab){_0x515c74['push'](_0x515c74['shift']());}};_0x5e8886(++_0x104883);}(_0x81ca,0x144));var _0xa81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81ca[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa81c('0x0'));var rimraf=require(_0xa81c('0x1'));var zipdir=require(_0xa81c('0x2'));var jsonpatch=require(_0xa81c('0x3'));var rp=require(_0xa81c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa81c('0x5'));var util=require(_0xa81c('0x6'));var path=require('path');var sox=require(_0xa81c('0x7'));var csv=require(_0xa81c('0x8'));var ejs=require(_0xa81c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa81c('0xa'));var squel=require('squel');var crypto=require(_0xa81c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa81c('0xc'));var toCsv=require(_0xa81c('0x8'));var querystring=require(_0xa81c('0xd'));var Papa=require(_0xa81c('0xe'));var Redis=require(_0xa81c('0xf'));var authService=require(_0xa81c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa81c('0x11'));var logger=require('../../config/logger')(_0xa81c('0x12'));var utils=require(_0xa81c('0x13'));var config=require(_0xa81c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa81c('0x15'))['db'];config[_0xa81c('0x16')]=_[_0xa81c('0x17')](config[_0xa81c('0x16')],{'host':_0xa81c('0x18'),'port':0x18eb});var socket=require(_0xa81c('0x19'))(new Redis(config[_0xa81c('0x16')]));require(_0xa81c('0x1a'))[_0xa81c('0x1b')](socket);function respondWithStatusCode(_0xb80f8f,_0x1f8245){_0x1f8245=_0x1f8245||0xcc;return function(_0x585963){if(_0x585963){return _0xb80f8f['sendStatus'](_0x1f8245);}return _0xb80f8f[_0xa81c('0x1c')](_0x1f8245)['end']();};}function respondWithResult(_0x109af5,_0x380c74){_0x380c74=_0x380c74||0xc8;return function(_0x524473){if(_0x524473){return _0x109af5[_0xa81c('0x1c')](_0x380c74)['json'](_0x524473);}};}function respondWithFilteredResult(_0x59cfcd,_0x6df87d){return function(_0x4ab123){if(_0x4ab123){var _0x3c4bbe=typeof _0x6df87d['offset']===_0xa81c('0x1d')&&typeof _0x6df87d[_0xa81c('0x1e')]==='undefined';var _0x44aadd=_0x4ab123[_0xa81c('0x1f')];var _0x38d823=_0x3c4bbe?0x0:_0x6df87d[_0xa81c('0x20')];var _0x2c5511=_0x3c4bbe?_0x4ab123[_0xa81c('0x1f')]:_0x6df87d['offset']+_0x6df87d['limit'];var _0xa24369;if(_0x2c5511>=_0x44aadd){_0x2c5511=_0x44aadd;_0xa24369=0xc8;}else{_0xa24369=0xce;}_0x59cfcd[_0xa81c('0x1c')](_0xa24369);return _0x59cfcd['set'](_0xa81c('0x21'),_0x38d823+'-'+_0x2c5511+'/'+_0x44aadd)[_0xa81c('0x22')](_0x4ab123);}return null;};}function patchUpdates(_0x48acab){return function(_0x235668){try{jsonpatch[_0xa81c('0x23')](_0x235668,_0x48acab,!![]);}catch(_0x4adf62){return BPromise[_0xa81c('0x24')](_0x4adf62);}return _0x235668['save']();};}function saveUpdates(_0x113932,_0x57cedb){return function(_0x435a25){if(_0x435a25){return _0x435a25[_0xa81c('0x25')](_0x113932)[_0xa81c('0x26')](function(_0xf3985e){return _0xf3985e;});}return null;};}function removeEntity(_0x39e628,_0x406256){return function(_0x22dd3c){if(_0x22dd3c){return _0x22dd3c[_0xa81c('0x27')]()[_0xa81c('0x26')](function(){var _0x361be7=_0x22dd3c[_0xa81c('0x28')]({'plain':!![]});var _0xcdc30a=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xa81c('0x29'),'value':_0xa81c('0x2a'),'ignore':![]}];var _0x6d7a84=_(_0xcdc30a)[_0xa81c('0x2b')]('ignore')['map'](_0xa81c('0x2c'))[_0xa81c('0x2c')]();if(_[_0xa81c('0x2d')](_0x6d7a84,_0x361be7[_0xa81c('0x2e')])){return;}var _0x4e8d88=_[_0xa81c('0x2f')](_0xcdc30a,['value',_0x361be7[_0xa81c('0x2e')]])[_0xa81c('0x30')];return db[_0xa81c('0x31')][_0xa81c('0x27')]({'where':{'type':_0x4e8d88,'resourceId':_0x361be7['id']}})['then'](function(){return _0x22dd3c;});})[_0xa81c('0x26')](function(){_0x39e628[_0xa81c('0x1c')](0xcc)[_0xa81c('0x32')]();});}};}function handleEntityNotFound(_0x25071a,_0x5cbdec){return function(_0x60359a){if(!_0x60359a){_0x25071a[_0xa81c('0x33')](0x194);}return _0x60359a;};}function handleError(_0x269183,_0x5a70e9){_0x5a70e9=_0x5a70e9||0x1f4;return function(_0x98d80a){logger[_0xa81c('0x34')](_0x98d80a[_0xa81c('0x35')]);if(_0x98d80a[_0xa81c('0x30')]){delete _0x98d80a[_0xa81c('0x30')];}_0x269183[_0xa81c('0x1c')](_0x5a70e9)[_0xa81c('0x36')](_0x98d80a);};}exports[_0xa81c('0x37')]=function(_0x132bca,_0x5d88e6){var _0x22eed4={},_0x48a82b={},_0x46ef52={'count':0x0,'rows':[]};var _0x58e340=_[_0xa81c('0x38')](db['VoiceQueue'][_0xa81c('0x39')],function(_0x1a0fed){return{'name':_0x1a0fed[_0xa81c('0x3a')],'type':_0x1a0fed['type'][_0xa81c('0x3b')]};});_0x48a82b[_0xa81c('0x3c')]=_[_0xa81c('0x38')](_0x58e340,'name');_0x48a82b['query']=_[_0xa81c('0x3d')](_0x132bca[_0xa81c('0x3e')]);_0x48a82b[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x48a82b[_0xa81c('0x3c')],_0x48a82b[_0xa81c('0x3e')]);_0x22eed4[_0xa81c('0x41')]=_['intersection'](_0x48a82b['model'],qs[_0xa81c('0x42')](_0x132bca[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x22eed4[_0xa81c('0x41')]=_0x22eed4[_0xa81c('0x41')][_0xa81c('0x43')]?_0x22eed4[_0xa81c('0x41')]:_0x48a82b['model'];if(!_0x132bca[_0xa81c('0x3e')]['hasOwnProperty'](_0xa81c('0x44'))){_0x22eed4[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x132bca[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0x22eed4['offset']=qs[_0xa81c('0x20')](_0x132bca['query'][_0xa81c('0x20')]);}_0x22eed4[_0xa81c('0x45')]=qs['sort'](_0x132bca['query'][_0xa81c('0x46')]);_0x22eed4[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_['pick'](_0x132bca[_0xa81c('0x3e')],_0x48a82b[_0xa81c('0x3f')]),_0x58e340);if(_0x132bca[_0xa81c('0x3e')][_0xa81c('0x2b')]){_0x22eed4['where']=_['merge'](_0x22eed4['where'],{'$or':_[_0xa81c('0x38')](_0x58e340,function(_0x1f550d){if(_0x1f550d['type']!==_0xa81c('0x48')){var _0x22d036={};_0x22d036[_0x1f550d[_0xa81c('0x30')]]={'$like':'%'+_0x132bca['query'][_0xa81c('0x2b')]+'%'};return _0x22d036;}})});}_0x22eed4=_[_0xa81c('0x49')]({},_0x22eed4,_0x132bca['options']);var _0x256d13={'where':_0x22eed4[_0xa81c('0x47')]};return db[_0xa81c('0x4a')][_0xa81c('0x1f')](_0x256d13)[_0xa81c('0x26')](function(_0x3413f6){_0x46ef52[_0xa81c('0x1f')]=_0x3413f6;if(_0x132bca[_0xa81c('0x3e')][_0xa81c('0x4b')]){_0x22eed4['include']=[{'all':!![]}];}return db[_0xa81c('0x4a')][_0xa81c('0x4c')](_0x22eed4);})['then'](function(_0x29c684){_0x46ef52[_0xa81c('0x4d')]=_0x29c684;return _0x46ef52;})[_0xa81c('0x26')](respondWithFilteredResult(_0x5d88e6,_0x22eed4))[_0xa81c('0x4e')](handleError(_0x5d88e6,null));};exports[_0xa81c('0x4f')]=function(_0x4fcf32,_0x20f177){var _0x47a0c8={'raw':![],'where':{'id':_0x4fcf32[_0xa81c('0x50')]['id']}},_0x16b641={};_0x16b641[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x4a')]['rawAttributes']);_0x16b641['query']=_[_0xa81c('0x3d')](_0x4fcf32['query']);_0x16b641['filters']=_[_0xa81c('0x40')](_0x16b641[_0xa81c('0x3c')],_0x16b641[_0xa81c('0x3e')]);_0x47a0c8[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x16b641[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x4fcf32['query'][_0xa81c('0x42')]));_0x47a0c8[_0xa81c('0x41')]=_0x47a0c8['attributes'][_0xa81c('0x43')]?_0x47a0c8[_0xa81c('0x41')]:_0x16b641[_0xa81c('0x3c')];if(_0x4fcf32[_0xa81c('0x3e')][_0xa81c('0x4b')]){_0x47a0c8[_0xa81c('0x51')]=[{'all':!![]}];}_0x47a0c8=_[_0xa81c('0x49')]({},_0x47a0c8,_0x4fcf32[_0xa81c('0x52')]);return db[_0xa81c('0x4a')][_0xa81c('0x2f')](_0x47a0c8)['then'](handleEntityNotFound(_0x20f177,null))['then'](respondWithResult(_0x20f177,null))['catch'](handleError(_0x20f177,null));};exports[_0xa81c('0x53')]=function(_0x44da45,_0x4a3f2c){return db['VoiceQueue'][_0xa81c('0x53')](_0x44da45[_0xa81c('0x54')],{})[_0xa81c('0x26')](function(_0x54236d){var _0x1fa8ce=_0x44da45[_0xa81c('0x55')]['get']({'plain':!![]});if(!_0x1fa8ce)throw new Error(_0xa81c('0x56'));if(_0x1fa8ce[_0xa81c('0x57')]===_0xa81c('0x55')){var _0x2febcf=_0x54236d[_0xa81c('0x28')]({'plain':!![]});var _0x49e4eb=[{'name':'VoiceQueues','value':_0xa81c('0x58')},{'name':_0xa81c('0x29'),'value':'outbound'}];var _0x4b0999=_[_0xa81c('0x2f')](_0x49e4eb,['value',_0x2febcf[_0xa81c('0x2e')]])[_0xa81c('0x30')];return db['UserProfileSection'][_0xa81c('0x2f')]({'where':{'name':_0x4b0999,'userProfileId':_0x1fa8ce[_0xa81c('0x59')]},'raw':!![]})[_0xa81c('0x26')](function(_0x2a88a5){if(_0x2a88a5&&_0x2a88a5[_0xa81c('0x5a')]===0x0){return db[_0xa81c('0x31')]['create']({'name':_0x2febcf[_0xa81c('0x30')],'resourceId':_0x2febcf['id'],'type':_0x2a88a5[_0xa81c('0x30')],'sectionId':_0x2a88a5['id']},{})[_0xa81c('0x26')](function(){return _0x54236d;});}else{return _0x54236d;}})['catch'](function(_0x5121ca){logger['error'](_0xa81c('0x5b'),_0x5121ca);throw _0x5121ca;});}return _0x54236d;})['then'](respondWithResult(_0x4a3f2c,0xc9))['catch'](handleError(_0x4a3f2c,null));};exports[_0xa81c('0x5c')]=function(_0x36dc86,_0x52a9d2){var _0x1f0d59={'where':{'id':_0x36dc86[_0xa81c('0x50')]['id']}},_0x3b0652={};_0x3b0652[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x4a')]['rawAttributes']);_0x1f0d59['attributes']=_[_0xa81c('0x40')](_0x3b0652[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x36dc86[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x1f0d59['attributes']=_0x1f0d59[_0xa81c('0x41')]['length']?_0x1f0d59[_0xa81c('0x41')]:_0x3b0652[_0xa81c('0x3c')];if(_0x36dc86['query']['includeAll']){_0x1f0d59[_0xa81c('0x51')]=[{'all':!![]}];}_0x1f0d59=_[_0xa81c('0x49')]({},_0x1f0d59,_0x36dc86['options']);return db[_0xa81c('0x4a')][_0xa81c('0x2f')](_0x1f0d59)[_0xa81c('0x26')](handleEntityNotFound(_0x52a9d2,null))['then'](function(_0x4ef2b8){if(_0x4ef2b8){var _0x4bdb15=_0x4ef2b8[_0xa81c('0x28')]({'plain':!![]});_0x4bdb15=qs[_0xa81c('0x5d')](_0x4bdb15,['id',_0xa81c('0x5e'),_0xa81c('0x5f')]);_0x36dc86['body']=_[_0xa81c('0x5d')](_0x36dc86['body'],['id',_0xa81c('0x5e'),_0xa81c('0x5f')]);return db[_0xa81c('0x4a')][_0xa81c('0x53')](_['merge'](_0x4bdb15,_0x36dc86['body']),{'include':_0x36dc86[_0xa81c('0x3e')][_0xa81c('0x4b')]?[{'all':!![]}]:undefined})[_0xa81c('0x26')](function(_0x44a918){var _0x3e3f33=_0x36dc86[_0xa81c('0x55')][_0xa81c('0x28')]({'plain':!![]});if(!_0x3e3f33)throw new Error(_0xa81c('0x56'));if(_0x3e3f33[_0xa81c('0x57')]==='user'){var _0x36a6bd=_0x44a918[_0xa81c('0x28')]({'plain':!![]});var _0x1ebfd5=[{'name':'VoiceQueues','value':_0xa81c('0x58')},{'name':_0xa81c('0x29'),'value':_0xa81c('0x2a')}];var _0x1829dc=_[_0xa81c('0x2f')](_0x1ebfd5,[_0xa81c('0x2c'),_0x36a6bd['type']])[_0xa81c('0x30')];return db['UserProfileSection'][_0xa81c('0x2f')]({'where':{'name':_0x1829dc,'userProfileId':_0x3e3f33['userProfileId']},'raw':!![]})[_0xa81c('0x26')](function(_0x14f015){if(_0x14f015&&_0x14f015[_0xa81c('0x5a')]===0x0){return db[_0xa81c('0x31')][_0xa81c('0x53')]({'name':_0x36a6bd[_0xa81c('0x30')],'resourceId':_0x36a6bd['id'],'type':_0x14f015[_0xa81c('0x30')],'sectionId':_0x14f015['id']},{})[_0xa81c('0x26')](function(){return _0x44a918;});}else{return _0x44a918;}})[_0xa81c('0x4e')](function(_0x289149){logger[_0xa81c('0x34')](_0xa81c('0x5b'),_0x289149);throw _0x289149;});}return _0x44a918;});}})[_0xa81c('0x26')](respondWithResult(_0x52a9d2,0xc9))[_0xa81c('0x4e')](handleError(_0x52a9d2,null));};exports[_0xa81c('0x25')]=function(_0x2d0f8c,_0x5abb95){if(_0x2d0f8c[_0xa81c('0x54')]['id']){delete _0x2d0f8c[_0xa81c('0x54')]['id'];}return db['VoiceQueue'][_0xa81c('0x2f')]({'where':{'id':_0x2d0f8c[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x5abb95,null))[_0xa81c('0x26')](saveUpdates(_0x2d0f8c[_0xa81c('0x54')],null))[_0xa81c('0x26')](respondWithResult(_0x5abb95,null))[_0xa81c('0x4e')](handleError(_0x5abb95,null));};exports['destroy']=function(_0x153df1,_0x31c25a){return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x153df1[_0xa81c('0x50')]['id']}})['then'](handleEntityNotFound(_0x31c25a,null))[_0xa81c('0x26')](removeEntity(_0x31c25a,null))[_0xa81c('0x4e')](handleError(_0x31c25a,null));};exports['getHoppers']=function(_0x235c8e,_0x45ff14,_0x50d694){var _0xf0423c={'raw':![],'where':{}};var _0x53763c={};var _0x291175={'count':0x0,'rows':[]};return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x235c8e[_0xa81c('0x50')]['id']}})['then'](handleEntityNotFound(_0x45ff14,null))['then'](function(_0x2af503){if(_0x2af503){_0x53763c[_0xa81c('0x3c')]=_['keys'](db['CmHopper'][_0xa81c('0x39')]);_0x53763c[_0xa81c('0x3e')]=_['keys'](_0x235c8e['query']);_0x53763c[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x53763c[_0xa81c('0x3c')],_0x53763c[_0xa81c('0x3e')]);_0xf0423c[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x53763c['model'],qs[_0xa81c('0x42')](_0x235c8e[_0xa81c('0x3e')][_0xa81c('0x42')]));_0xf0423c['attributes']=_0xf0423c[_0xa81c('0x41')][_0xa81c('0x43')]?_0xf0423c['attributes']:_0x53763c[_0xa81c('0x3c')];if(!_0x235c8e[_0xa81c('0x3e')]['hasOwnProperty'](_0xa81c('0x44'))){_0xf0423c[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x235c8e[_0xa81c('0x3e')]['limit']);_0xf0423c[_0xa81c('0x20')]=qs['offset'](_0x235c8e[_0xa81c('0x3e')][_0xa81c('0x20')]);}_0xf0423c[_0xa81c('0x45')]=qs[_0xa81c('0x46')](_0x235c8e[_0xa81c('0x3e')][_0xa81c('0x46')]);_0xf0423c[_0xa81c('0x47')]=qs['filters'](_['pick'](_0x235c8e[_0xa81c('0x3e')],_0x53763c[_0xa81c('0x3f')]));_0xf0423c[_0xa81c('0x47')][_0xa81c('0x61')]=_0x2af503['id'];if(_0x235c8e[_0xa81c('0x3e')]['filter']){_0xf0423c[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0xf0423c[_0xa81c('0x47')],{'$or':_['map'](_0xf0423c['attributes'],function(_0x31f721){var _0x52699a={};_0x52699a[_0x31f721]={'$like':'%'+_0x235c8e['query'][_0xa81c('0x2b')]+'%'};return _0x52699a;})});}_0xf0423c=_[_0xa81c('0x49')]({},_0xf0423c,_0x235c8e['options']);return db[_0xa81c('0x62')][_0xa81c('0x1f')]({'where':_0xf0423c[_0xa81c('0x47')]})['then'](function(_0x1212cc){_0x291175[_0xa81c('0x1f')]=_0x1212cc;if(_0x235c8e[_0xa81c('0x3e')]['includeAll']){_0xf0423c[_0xa81c('0x51')]=[{'all':!![]}];}return db[_0xa81c('0x62')][_0xa81c('0x4c')](_0xf0423c);})[_0xa81c('0x26')](function(_0x211546){_0x291175[_0xa81c('0x4d')]=_0x211546;return _0x291175;});}})[_0xa81c('0x26')](respondWithFilteredResult(_0x45ff14,_0xf0423c))[_0xa81c('0x4e')](handleError(_0x45ff14,null));};exports[_0xa81c('0x63')]=function(_0x373ed6,_0xa7b7a5,_0x116fb2){var _0x361d6a={'raw':!![],'where':{}};var _0x2ad0cf={};var _0x407622={'count':0x0,'rows':[]};return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x373ed6['params']['id']}})['then'](handleEntityNotFound(_0xa7b7a5,null))[_0xa81c('0x26')](function(_0x5b395b){if(_0x5b395b){_0x2ad0cf['model']=_['keys'](db[_0xa81c('0x64')][_0xa81c('0x39')]);_0x2ad0cf[_0xa81c('0x3e')]=_[_0xa81c('0x3d')](_0x373ed6[_0xa81c('0x3e')]);_0x2ad0cf['filters']=_['intersection'](_0x2ad0cf['model'],_0x2ad0cf[_0xa81c('0x3e')]);_0x361d6a[_0xa81c('0x41')]=_['intersection'](_0x2ad0cf[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x373ed6[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x361d6a['attributes']=_0x361d6a['attributes'][_0xa81c('0x43')]?_0x361d6a['attributes']:_0x2ad0cf['model'];if(!_0x373ed6[_0xa81c('0x3e')]['hasOwnProperty'](_0xa81c('0x44'))){_0x361d6a[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x373ed6[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0x361d6a[_0xa81c('0x20')]=qs[_0xa81c('0x20')](_0x373ed6[_0xa81c('0x3e')][_0xa81c('0x20')]);}_0x361d6a['order']=qs[_0xa81c('0x46')](_0x373ed6['query'][_0xa81c('0x46')]);_0x361d6a[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0x373ed6['query'],_0x2ad0cf['filters']));_0x361d6a[_0xa81c('0x47')][_0xa81c('0x61')]=_0x5b395b['id'];if(_0x373ed6['query']['filter']){_0x361d6a[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0x361d6a['where'],{'$or':_[_0xa81c('0x38')](_0x361d6a['attributes'],function(_0x37b67e){var _0x1f3f73={};_0x1f3f73[_0x37b67e]={'$like':'%'+_0x373ed6[_0xa81c('0x3e')][_0xa81c('0x2b')]+'%'};return _0x1f3f73;})});}_0x361d6a=_[_0xa81c('0x49')]({},_0x361d6a,_0x373ed6[_0xa81c('0x52')]);return db[_0xa81c('0x64')][_0xa81c('0x1f')]({'where':_0x361d6a[_0xa81c('0x47')]})[_0xa81c('0x26')](function(_0x4508a8){_0x407622[_0xa81c('0x1f')]=_0x4508a8;if(_0x373ed6[_0xa81c('0x3e')][_0xa81c('0x4b')]){_0x361d6a[_0xa81c('0x51')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa81c('0x4c')](_0x361d6a);})[_0xa81c('0x26')](function(_0x39385f){_0x407622['rows']=_0x39385f;return _0x407622;});}})[_0xa81c('0x26')](respondWithFilteredResult(_0xa7b7a5,_0x361d6a))[_0xa81c('0x4e')](handleError(_0xa7b7a5,null));};exports['getHopperFinals']=function(_0x517074,_0x2813ae,_0x1e42ab){var _0x50ac12={'raw':!![],'where':{}};var _0x41f147={};var _0xf6f224={'count':0x0,'rows':[]};return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x517074[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x2813ae,null))[_0xa81c('0x26')](function(_0x1ab515){if(_0x1ab515){_0x41f147[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x66')][_0xa81c('0x39')]);_0x41f147[_0xa81c('0x3e')]=_[_0xa81c('0x3d')](_0x517074[_0xa81c('0x3e')]);_0x41f147[_0xa81c('0x3f')]=_['intersection'](_0x41f147[_0xa81c('0x3c')],_0x41f147['query']);_0x50ac12[_0xa81c('0x41')]=_['intersection'](_0x41f147[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x517074[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x50ac12[_0xa81c('0x41')]=_0x50ac12['attributes']['length']?_0x50ac12[_0xa81c('0x41')]:_0x41f147['model'];if(!_0x517074['query'][_0xa81c('0x67')]('nolimit')){_0x50ac12[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x517074[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0x50ac12['offset']=qs[_0xa81c('0x20')](_0x517074[_0xa81c('0x3e')][_0xa81c('0x20')]);}_0x50ac12[_0xa81c('0x45')]=qs['sort'](_0x517074[_0xa81c('0x3e')][_0xa81c('0x46')]);_0x50ac12[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_['pick'](_0x517074[_0xa81c('0x3e')],_0x41f147[_0xa81c('0x3f')]));_0x50ac12[_0xa81c('0x47')][_0xa81c('0x61')]=_0x1ab515['id'];if(_0x517074['query']['filter']){_0x50ac12[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0x50ac12[_0xa81c('0x47')],{'$or':_[_0xa81c('0x38')](_0x50ac12[_0xa81c('0x41')],function(_0x31b26a){var _0x400c04={};_0x400c04[_0x31b26a]={'$like':'%'+_0x517074['query'][_0xa81c('0x2b')]+'%'};return _0x400c04;})});}_0x50ac12=_[_0xa81c('0x49')]({},_0x50ac12,_0x517074[_0xa81c('0x52')]);return db[_0xa81c('0x66')]['count']({'where':_0x50ac12[_0xa81c('0x47')]})[_0xa81c('0x26')](function(_0x5aab18){_0xf6f224[_0xa81c('0x1f')]=_0x5aab18;if(_0x517074['query'][_0xa81c('0x4b')]){_0x50ac12[_0xa81c('0x51')]=[{'all':!![]}];}return db[_0xa81c('0x66')][_0xa81c('0x4c')](_0x50ac12);})[_0xa81c('0x26')](function(_0x30693a){_0xf6f224['rows']=_0x30693a;return _0xf6f224;});}})[_0xa81c('0x26')](respondWithFilteredResult(_0x2813ae,_0x50ac12))[_0xa81c('0x4e')](handleError(_0x2813ae,null));};exports[_0xa81c('0x68')]=function(_0x18ce6a,_0x5234c5,_0x55200d){var _0x4e9ffd={'raw':!![],'where':{}};var _0x157aca={};var _0x1f3cf8={'count':0x0,'rows':[]};return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x18ce6a[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x5234c5,null))[_0xa81c('0x26')](function(_0x5f5721){if(_0x5f5721){_0x157aca[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db['CmHopperBlack'][_0xa81c('0x39')]);_0x157aca[_0xa81c('0x3e')]=_[_0xa81c('0x3d')](_0x18ce6a['query']);_0x157aca[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x157aca[_0xa81c('0x3c')],_0x157aca[_0xa81c('0x3e')]);_0x4e9ffd[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x157aca[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x18ce6a[_0xa81c('0x3e')]['fields']));_0x4e9ffd['attributes']=_0x4e9ffd[_0xa81c('0x41')][_0xa81c('0x43')]?_0x4e9ffd['attributes']:_0x157aca[_0xa81c('0x3c')];if(!_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x67')]('nolimit')){_0x4e9ffd[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0x4e9ffd['offset']=qs[_0xa81c('0x20')](_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x20')]);}_0x4e9ffd[_0xa81c('0x45')]=qs[_0xa81c('0x46')](_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x46')]);_0x4e9ffd[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0x18ce6a['query'],_0x157aca[_0xa81c('0x3f')]));_0x4e9ffd[_0xa81c('0x47')][_0xa81c('0x61')]=_0x5f5721['id'];if(_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x2b')]){_0x4e9ffd[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0x4e9ffd[_0xa81c('0x47')],{'$or':_[_0xa81c('0x38')](_0x4e9ffd[_0xa81c('0x41')],function(_0x46e8f2){var _0x3f22b0={};_0x3f22b0[_0x46e8f2]={'$like':'%'+_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x2b')]+'%'};return _0x3f22b0;})});}_0x4e9ffd=_['merge']({},_0x4e9ffd,_0x18ce6a[_0xa81c('0x52')]);return db[_0xa81c('0x69')][_0xa81c('0x1f')]({'where':_0x4e9ffd['where']})['then'](function(_0x30fd9c){_0x1f3cf8['count']=_0x30fd9c;if(_0x18ce6a[_0xa81c('0x3e')][_0xa81c('0x4b')]){_0x4e9ffd[_0xa81c('0x51')]=[{'all':!![]}];}return db[_0xa81c('0x69')][_0xa81c('0x4c')](_0x4e9ffd);})[_0xa81c('0x26')](function(_0x560f97){_0x1f3cf8[_0xa81c('0x4d')]=_0x560f97;return _0x1f3cf8;});}})['then'](respondWithFilteredResult(_0x5234c5,_0x4e9ffd))[_0xa81c('0x4e')](handleError(_0x5234c5,null));};exports['getTeams']=function(_0xab2ef2,_0x5953e2,_0x16278f){var _0xb76107={};var _0x1278ff={};var _0x2c9864;var _0x1e2d66;return db[_0xa81c('0x4a')]['findOne']({'where':{'id':_0xab2ef2[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x5953e2,null))[_0xa81c('0x26')](function(_0x378044){if(_0x378044){_0x2c9864=_0x378044;_0x1278ff[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x6a')][_0xa81c('0x39')]);_0x1278ff['query']=_['keys'](_0xab2ef2['query']);_0x1278ff[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x1278ff[_0xa81c('0x3c')],_0x1278ff[_0xa81c('0x3e')]);_0xb76107[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x1278ff[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0xab2ef2[_0xa81c('0x3e')][_0xa81c('0x42')]));_0xb76107['attributes']=_0xb76107[_0xa81c('0x41')]['length']?_0xb76107['attributes']:_0x1278ff[_0xa81c('0x3c')];_0xb76107[_0xa81c('0x45')]=qs[_0xa81c('0x46')](_0xab2ef2[_0xa81c('0x3e')]['sort']);_0xb76107[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0xab2ef2['query'],_0x1278ff['filters']));if(_0xab2ef2['query']['filter']){_0xb76107[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0xb76107['where'],{'$or':_[_0xa81c('0x38')](_0xb76107[_0xa81c('0x41')],function(_0x5a916c){var _0x574a1c={};_0x574a1c[_0x5a916c]={'$like':'%'+_0xab2ef2['query']['filter']+'%'};return _0x574a1c;})});}_0xb76107=_['merge']({},_0xb76107,_0xab2ef2[_0xa81c('0x52')]);return _0x2c9864['getTeams'](_0xb76107);}})[_0xa81c('0x26')](function(_0x53ed1b){if(_0x53ed1b){_0x1e2d66=_0x53ed1b[_0xa81c('0x43')];if(!_0xab2ef2[_0xa81c('0x3e')]['hasOwnProperty'](_0xa81c('0x44'))){_0xb76107['limit']=qs['limit'](_0xab2ef2[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0xb76107[_0xa81c('0x20')]=qs['offset'](_0xab2ef2[_0xa81c('0x3e')][_0xa81c('0x20')]);}return _0x2c9864[_0xa81c('0x6b')](_0xb76107);}})[_0xa81c('0x26')](function(_0xa31994){if(_0xa31994){return _0xa31994?{'count':_0x1e2d66,'rows':_0xa31994}:null;}})[_0xa81c('0x26')](respondWithResult(_0x5953e2,null))[_0xa81c('0x4e')](handleError(_0x5953e2,null));};exports[_0xa81c('0x6c')]=function(_0x4fcae9,_0x2645ed,_0x54ac72){var _0x18d4bf=_0x4fcae9[_0xa81c('0x54')][_0xa81c('0x6d')];var _0xab264d=_[_0xa81c('0x38')](_0x18d4bf,'id');return db[_0xa81c('0x6a')][_0xa81c('0x4c')]({'where':{'id':_0xab264d},'attributes':['id'],'include':[{'model':db[_0xa81c('0x6e')],'as':_0xa81c('0x6f'),'attributes':['id','name',_0xa81c('0x70'),'voicePause',_0xa81c('0x71')],'raw':!![]}]})[_0xa81c('0x26')](function(_0x1576e7){if(_0x1576e7){var _0x377b9d=_[_0xa81c('0x72')](_0x1576e7,function(_0x130c3d){var _0x4d0dc5=_0x130c3d[_0xa81c('0x28')]({'plain':!![]});_0x4d0dc5[_0xa81c('0x6f')][_0xa81c('0x73')](function(_0x2a150a){_0x2a150a['penalty']=_[_0xa81c('0x2f')](_0x18d4bf,{'id':_0x4d0dc5['id']})['penalty'];});return _0x4d0dc5['Agents'];});return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x4fcae9[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](function(_0x3e8f35){return db[_0xa81c('0x74')][_0xa81c('0x75')](function(_0x5650b5){return _0x3e8f35[_0xa81c('0x6c')](_0xab264d,{'transaction':_0x5650b5})[_0xa81c('0x26')](function(){return BPromise[_0xa81c('0x76')](_0x18d4bf,function(_0x1cf6d9){return db[_0xa81c('0x77')]['upsert']({'TeamId':_0x1cf6d9['id'],'VoiceQueueId':_0x4fcae9[_0xa81c('0x50')]['id'],'penalty':_0x1cf6d9[_0xa81c('0x78')]},{'transaction':_0x5650b5});});})[_0xa81c('0x26')](function(){return BPromise[_0xa81c('0x76')](_0x377b9d,function(_0x3c453e){return db[_0xa81c('0x79')][_0xa81c('0x7a')]({'where':{'UserId':_0x3c453e['id'],'VoiceQueueId':_0x4fcae9['params']['id']},'defaults':{'penalty':_0x3c453e[_0xa81c('0x78')]},'transaction':_0x5650b5});});})[_0xa81c('0x26')](function(){return BPromise['each'](_[_0xa81c('0x2b')](_0x377b9d,{'online':!![]}),function(_0x4e6f7a){return db['UserVoiceQueueRt'][_0xa81c('0x7b')]({'membername':_0x4e6f7a[_0xa81c('0x30')],'UserId':_0x4e6f7a['id'],'queue_name':_0x3e8f35[_0xa81c('0x30')],'VoiceQueueId':_0x3e8f35['id'],'interface':_[_0xa81c('0x7c')](_0x4e6f7a['interface'])?util[_0xa81c('0x7d')](_0xa81c('0x7e'),_0x4e6f7a[_0xa81c('0x30')]):_0x4e6f7a[_0xa81c('0x71')],'paused':_0x4e6f7a['voicePause']||![],'penalty':_0x4e6f7a[_0xa81c('0x78')]},{'transaction':_0x5650b5});});})['then'](function(){_0x377b9d['forEach'](function(_0x1b2d7e){socket[_0xa81c('0x7f')](_0xa81c('0x80'),{'UserId':_0x1b2d7e['id'],'VoiceQueueId':_0x3e8f35['id']});});});});});}})['then'](respondWithStatusCode(_0x2645ed,null))[_0xa81c('0x4e')](handleError(_0x2645ed,null));};exports['removeTeams']=function(_0x1ab492,_0x5dfa84,_0x2029d8){return db[_0xa81c('0x6a')][_0xa81c('0x4c')]({'where':{'id':_0x1ab492['query'][_0xa81c('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa81c('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xa81c('0x26')](handleEntityNotFound(_0x5dfa84,null))[_0xa81c('0x26')](function(_0x2d402f){var _0x2f418c=_[_0xa81c('0x38')](_0x2d402f,'id');var _0x52999c=[];var _0x9c3177=[];var _0xade3f2=squel[_0xa81c('0x82')]();_0xade3f2[_0xa81c('0x83')](_0xa81c('0x84'))[_0xa81c('0x85')](_0xa81c('0x86'),'tq')[_0xa81c('0x87')](_0xa81c('0x88'),'ut',_0xa81c('0x89'))[_0xa81c('0x47')](_0xa81c('0x8a'),_0x1ab492[_0xa81c('0x50')]['id']);for(var _0x38ebc2=0x0;_0x38ebc2<_0x2d402f[_0xa81c('0x43')];_0x38ebc2+=0x1){let _0x6afdbe=_0x2d402f[_0x38ebc2];for(var _0x413900=0x0;_0x413900<_0x6afdbe[_0xa81c('0x6f')][_0xa81c('0x43')];_0x413900+=0x1){let _0x32d57c=_0x6afdbe['Agents'][_0x413900];var _0x3811c9=_0xade3f2[_0xa81c('0x5c')]();_0x3811c9[_0xa81c('0x47')](_0xa81c('0x8b'),_0x32d57c['id']);_0x9c3177['push'](db[_0xa81c('0x74')][_0xa81c('0x3e')](_0x3811c9['toString'](),{'type':db[_0xa81c('0x74')][_0xa81c('0x8c')]['SELECT']})[_0xa81c('0x26')](function(_0x10b3e1){if(_0x10b3e1['length']===0x1){return _0x32d57c['id'];}else{var _0x120023=_[_0xa81c('0x8d')](_[_0xa81c('0x38')](_0x10b3e1,_0xa81c('0x8e')),function(_0x2f09a9){return _[_0xa81c('0x2d')](_0x2f418c,_0x2f09a9);});if(_0x120023){return _0x32d57c['id'];}}}));}}return BPromise[_0xa81c('0x8f')](_0x9c3177)[_0xa81c('0x26')](function(_0x3af974){_0x52999c=_(_0x52999c)[_0xa81c('0x90')](_0x3af974)['compact']()[_0xa81c('0x2c')]();return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x1ab492[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](function(_0x5fb200){return db['sequelize']['transaction'](function(_0x4f78b6){return _0x5fb200[_0xa81c('0x91')](_0x1ab492[_0xa81c('0x3e')][_0xa81c('0x81')],{'transaction':_0x4f78b6})[_0xa81c('0x26')](function(){if(!_[_0xa81c('0x92')](_0x52999c)){return _0x5fb200[_0xa81c('0x93')](_0x52999c,{'transaction':_0x4f78b6})['then'](function(){return db[_0xa81c('0x94')][_0xa81c('0x27')]({'where':{'VoiceQueueId':_0x1ab492[_0xa81c('0x50')]['id'],'UserId':_0x52999c},'transaction':_0x4f78b6});});}})[_0xa81c('0x26')](function(){_0x52999c[_0xa81c('0x73')](function(_0x41d548){socket['emit'](_0xa81c('0x95'),{'UserId':_0x41d548,'VoiceQueueId':_0x5fb200['id']});});});});});});})[_0xa81c('0x26')](respondWithStatusCode(_0x5dfa84,null))[_0xa81c('0x4e')](handleError(_0x5dfa84,null));};exports[_0xa81c('0x96')]=function(_0x5ffdfd,_0x182230,_0x28fb73){var _0x31c2a3,_0x151ef6;return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x5ffdfd[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x182230,null))[_0xa81c('0x26')](function(_0x36cdd8){if(_0x36cdd8){_0x151ef6=_0x36cdd8;return _0x36cdd8[_0xa81c('0x96')](_0x5ffdfd[_0xa81c('0x54')][_0xa81c('0x81')],_['omit'](_0x5ffdfd[_0xa81c('0x54')],[_0xa81c('0x81'),'id'])||{})[_0xa81c('0x97')](function(_0x5715d8){for(var _0x554f34=0x0;_0x554f34<_0x5ffdfd['body'][_0xa81c('0x81')][_0xa81c('0x43')];_0x554f34+=0x1){socket[_0xa81c('0x7f')](_0xa81c('0x80'),{'UserId':Number(_0x5ffdfd['body'][_0xa81c('0x81')][_0x554f34]),'VoiceQueueId':Number(_0x5ffdfd['params']['id'])});}return _0x5715d8;});}})[_0xa81c('0x26')](function(_0x5e299e){_0x31c2a3=_0x5e299e||[];if(_0x151ef6){return db[_0xa81c('0x6e')][_0xa81c('0x4c')]({'where':{'id':_0x5ffdfd[_0xa81c('0x54')][_0xa81c('0x81')]},'attributes':['id','name','online',_0xa81c('0x98'),_0xa81c('0x71')],'raw':!![]});}})[_0xa81c('0x26')](function(_0x3d4f15){if(!_['isEmpty'](_0x3d4f15)){var _0x568d7f=[];for(var _0x522e01=0x0;_0x522e01<_0x3d4f15[_0xa81c('0x43')];_0x522e01++){if(_0x3d4f15[_0x522e01][_0xa81c('0x70')]){_0x568d7f['push'](db[_0xa81c('0x94')][_0xa81c('0x7b')]({'membername':_0x3d4f15[_0x522e01][_0xa81c('0x30')],'UserId':_0x3d4f15[_0x522e01]['id'],'queue_name':_0x151ef6[_0xa81c('0x30')],'VoiceQueueId':_0x151ef6['id'],'interface':_['isNil'](_0x3d4f15[_0x522e01]['interface'])?util[_0xa81c('0x7d')](_0xa81c('0x7e'),_0x3d4f15[_0x522e01][_0xa81c('0x30')]):_0x3d4f15[_0x522e01][_0xa81c('0x71')],'paused':_0x3d4f15[_0x522e01][_0xa81c('0x98')]||![],'penalty':_0x5ffdfd[_0xa81c('0x54')]['penalty']||0x0}));}}return BPromise[_0xa81c('0x8f')](_0x568d7f);}})['then'](function(){return _0x31c2a3;})[_0xa81c('0x26')](respondWithResult(_0x182230,null))[_0xa81c('0x4e')](handleError(_0x182230,null));};exports[_0xa81c('0x93')]=function(_0x4288f0,_0x2306f7,_0x374990){return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x4288f0[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x2306f7,null))[_0xa81c('0x26')](function(_0x2a06bf){if(_0x2a06bf){return _0x2a06bf[_0xa81c('0x93')](_0x4288f0['query'][_0xa81c('0x81')])[_0xa81c('0x26')](function(){if(_[_0xa81c('0x99')](_0x4288f0[_0xa81c('0x3e')][_0xa81c('0x81')])){for(var _0x557be2=0x0;_0x557be2<_0x4288f0[_0xa81c('0x3e')]['ids'][_0xa81c('0x43')];_0x557be2+=0x1){socket[_0xa81c('0x7f')](_0xa81c('0x95'),{'UserId':Number(_0x4288f0[_0xa81c('0x3e')][_0xa81c('0x81')][_0x557be2]),'VoiceQueueId':Number(_0x4288f0[_0xa81c('0x50')]['id'])});}}else{socket['emit'](_0xa81c('0x95'),{'UserId':Number(_0x4288f0['query'][_0xa81c('0x81')]),'VoiceQueueId':Number(_0x4288f0[_0xa81c('0x50')]['id'])});}});}})[_0xa81c('0x26')](function(_0x52a5eb){return db[_0xa81c('0x94')][_0xa81c('0x27')]({'where':{'VoiceQueueId':_0x4288f0[_0xa81c('0x50')]['id'],'UserId':_0x4288f0[_0xa81c('0x3e')][_0xa81c('0x81')]}})['then'](function(){return _0x52a5eb;});})[_0xa81c('0x26')](respondWithStatusCode(_0x2306f7,null))[_0xa81c('0x4e')](handleError(_0x2306f7,null));};exports[_0xa81c('0x9a')]=function(_0x495324,_0x54176f,_0x5daa9a){var _0x2af75e={};var _0x4e1117={};var _0x538317;var _0x2121d5;return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x495324[_0xa81c('0x50')]['id']}})['then'](handleEntityNotFound(_0x54176f,null))[_0xa81c('0x26')](function(_0x2b59f6){if(_0x2b59f6){_0x538317=_0x2b59f6;_0x4e1117[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x6e')][_0xa81c('0x39')]);_0x4e1117[_0xa81c('0x3e')]=_['keys'](_0x495324[_0xa81c('0x3e')]);_0x4e1117[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x4e1117[_0xa81c('0x3c')],_0x4e1117[_0xa81c('0x3e')]);_0x2af75e[_0xa81c('0x41')]=_['intersection'](_0x4e1117[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x495324[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x2af75e[_0xa81c('0x41')]=_0x2af75e[_0xa81c('0x41')][_0xa81c('0x43')]?_0x2af75e[_0xa81c('0x41')]:_0x4e1117[_0xa81c('0x3c')];_0x2af75e['order']=qs[_0xa81c('0x46')](_0x495324[_0xa81c('0x3e')][_0xa81c('0x46')]);_0x2af75e[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0x495324[_0xa81c('0x3e')],_0x4e1117[_0xa81c('0x3f')]));if(_0x495324[_0xa81c('0x3e')][_0xa81c('0x2b')]){_0x2af75e[_0xa81c('0x47')]=_['merge'](_0x2af75e[_0xa81c('0x47')],{'$or':_[_0xa81c('0x38')](_0x2af75e[_0xa81c('0x41')],function(_0xaf00dc){var _0x2c00bc={};_0x2c00bc[_0xaf00dc]={'$like':'%'+_0x495324['query'][_0xa81c('0x2b')]+'%'};return _0x2c00bc;})});}_0x2af75e=_[_0xa81c('0x49')]({},_0x2af75e,_0x495324[_0xa81c('0x52')]);return _0x538317[_0xa81c('0x9a')](_0x2af75e);}})[_0xa81c('0x26')](function(_0x57c7cb){if(_0x57c7cb){_0x2121d5=_0x57c7cb[_0xa81c('0x43')];if(!_0x495324[_0xa81c('0x3e')][_0xa81c('0x67')](_0xa81c('0x44'))){_0x2af75e['limit']=qs[_0xa81c('0x1e')](_0x495324['query'][_0xa81c('0x1e')]);_0x2af75e[_0xa81c('0x20')]=qs[_0xa81c('0x20')](_0x495324[_0xa81c('0x3e')][_0xa81c('0x20')]);}return _0x538317[_0xa81c('0x9a')](_0x2af75e);}})['then'](function(_0x2e6b63){if(_0x2e6b63){return _0x2e6b63?{'count':_0x2121d5,'rows':_0x2e6b63}:null;}})[_0xa81c('0x26')](respondWithResult(_0x54176f,null))[_0xa81c('0x4e')](handleError(_0x54176f,null));};exports[_0xa81c('0x9b')]=function(_0xaec361,_0x741226,_0x2c32fc){var _0x1e6c6e={};var _0x114e2a={};var _0x1ff091;var _0xfb008b;return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0xaec361[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x741226,null))[_0xa81c('0x26')](function(_0x2ae782){if(_0x2ae782){_0x1ff091=_0x2ae782;_0x114e2a[_0xa81c('0x3c')]=_['keys'](db[_0xa81c('0x94')][_0xa81c('0x39')]);_0x114e2a[_0xa81c('0x3e')]=_[_0xa81c('0x3d')](_0xaec361[_0xa81c('0x3e')]);_0x114e2a[_0xa81c('0x3f')]=_[_0xa81c('0x40')](_0x114e2a[_0xa81c('0x3c')],_0x114e2a[_0xa81c('0x3e')]);_0x1e6c6e[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x114e2a[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0xaec361[_0xa81c('0x3e')][_0xa81c('0x42')]));_0x1e6c6e[_0xa81c('0x41')]=_0x1e6c6e[_0xa81c('0x41')][_0xa81c('0x43')]?_0x1e6c6e[_0xa81c('0x41')]:_0x114e2a['model'];_0x1e6c6e[_0xa81c('0x45')]=qs[_0xa81c('0x46')](_0xaec361[_0xa81c('0x3e')]['sort']);_0x1e6c6e[_0xa81c('0x47')]=qs['filters'](_['pick'](_0xaec361[_0xa81c('0x3e')],_0x114e2a[_0xa81c('0x3f')]));if(_0xaec361[_0xa81c('0x3e')][_0xa81c('0x2b')]){_0x1e6c6e[_0xa81c('0x47')]=_[_0xa81c('0x49')](_0x1e6c6e['where'],{'$or':_['map'](_0x1e6c6e[_0xa81c('0x41')],function(_0x37789a){var _0x5d7320={};_0x5d7320[_0x37789a]={'$like':'%'+_0xaec361[_0xa81c('0x3e')][_0xa81c('0x2b')]+'%'};return _0x5d7320;})});}_0x1e6c6e=_[_0xa81c('0x49')]({},_0x1e6c6e,_0xaec361[_0xa81c('0x52')]);return _0x1ff091[_0xa81c('0x9b')](_0x1e6c6e);}})['then'](function(_0x21de3d){if(_0x21de3d){_0xfb008b=_0x21de3d[_0xa81c('0x43')];if(!_0xaec361[_0xa81c('0x3e')][_0xa81c('0x67')]('nolimit')){_0x1e6c6e['limit']=qs['limit'](_0xaec361['query'][_0xa81c('0x1e')]);_0x1e6c6e[_0xa81c('0x20')]=qs[_0xa81c('0x20')](_0xaec361[_0xa81c('0x3e')]['offset']);}return _0x1ff091[_0xa81c('0x9b')](_0x1e6c6e);}})[_0xa81c('0x26')](function(_0x1bdf6a){return _0x1bdf6a?{'count':_0xfb008b,'rows':_0x1bdf6a}:null;})[_0xa81c('0x26')](respondWithResult(_0x741226,null))[_0xa81c('0x4e')](handleError(_0x741226,null));};exports[_0xa81c('0x9c')]=function(_0x44a7aa,_0x40b5dd,_0x4d38ba){var _0x3ba18d={};var _0x37fa40={};var _0x57b4c0;var _0x241cf2;return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x44a7aa[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x40b5dd,null))['then'](function(_0x305367){if(_0x305367){_0x57b4c0=_0x305367;_0x37fa40['model']=_['keys'](db[_0xa81c('0x9d')][_0xa81c('0x39')]);_0x37fa40['query']=_[_0xa81c('0x3d')](_0x44a7aa[_0xa81c('0x3e')]);_0x37fa40['filters']=_['intersection'](_0x37fa40[_0xa81c('0x3c')],_0x37fa40['query']);_0x3ba18d[_0xa81c('0x41')]=_[_0xa81c('0x40')](_0x37fa40[_0xa81c('0x3c')],qs[_0xa81c('0x42')](_0x44a7aa[_0xa81c('0x3e')]['fields']));_0x3ba18d[_0xa81c('0x41')]=_0x3ba18d['attributes']['length']?_0x3ba18d[_0xa81c('0x41')]:_0x37fa40[_0xa81c('0x3c')];_0x3ba18d['order']=qs[_0xa81c('0x46')](_0x44a7aa[_0xa81c('0x3e')]['sort']);_0x3ba18d['where']=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0x44a7aa[_0xa81c('0x3e')],_0x37fa40[_0xa81c('0x3f')]));if(_0x44a7aa[_0xa81c('0x3e')][_0xa81c('0x2b')]){_0x3ba18d['where']=_[_0xa81c('0x49')](_0x3ba18d['where'],{'$or':_[_0xa81c('0x38')](_0x3ba18d['attributes'],function(_0x84fd9b){var _0x21a14b={};_0x21a14b[_0x84fd9b]={'$like':'%'+_0x44a7aa[_0xa81c('0x3e')][_0xa81c('0x2b')]+'%'};return _0x21a14b;})});}_0x3ba18d=_['merge']({},_0x3ba18d,_0x44a7aa['options']);return _0x57b4c0[_0xa81c('0x9c')](_0x3ba18d);}})[_0xa81c('0x26')](function(_0xc3dd87){if(_0xc3dd87){_0x241cf2=_0xc3dd87[_0xa81c('0x43')];if(!_0x44a7aa[_0xa81c('0x3e')][_0xa81c('0x67')](_0xa81c('0x44'))){_0x3ba18d[_0xa81c('0x1e')]=qs[_0xa81c('0x1e')](_0x44a7aa['query'][_0xa81c('0x1e')]);_0x3ba18d[_0xa81c('0x20')]=qs['offset'](_0x44a7aa[_0xa81c('0x3e')][_0xa81c('0x20')]);}return _0x57b4c0[_0xa81c('0x9c')](_0x3ba18d);}})[_0xa81c('0x26')](function(_0x6d587a){if(_0x6d587a){return _0x6d587a?{'count':_0x241cf2,'rows':_0x6d587a}:null;}})['then'](respondWithResult(_0x40b5dd,null))[_0xa81c('0x4e')](handleError(_0x40b5dd,null));};exports[_0xa81c('0x9e')]=function(_0x4e9084,_0x42b6cf,_0x42c47c){var _0x5d5ffa,_0x23c11c;return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x4e9084[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x42b6cf,null))[_0xa81c('0x26')](function(_0x1214ad){if(_0x1214ad){_0x23c11c=_0x1214ad;return _0x1214ad['addLists'](_0x4e9084[_0xa81c('0x54')][_0xa81c('0x81')],_['omit'](_0x4e9084['body'],['ids','id'])||{});}return null;})[_0xa81c('0x97')](function(_0x1335fa){var _0x2a462c;_0x5d5ffa=_0x1335fa||[];var _0x4617bf=[];if(_0x1335fa){for(var _0x33b3d7=0x0;_0x33b3d7<_0x1335fa[_0xa81c('0x43')];_0x33b3d7+=0x1){var _0xa5997a=_0x1335fa[_0x33b3d7][_0xa81c('0x28')]({'plain':!![]});_0x23c11c[_0xa81c('0x9f')]=_0x4e9084['body'][_0xa81c('0x9f')]?_0x4e9084['body'][_0xa81c('0x9f')]:_0x23c11c['dialCheckDuplicateType'];switch(_0x23c11c[_0xa81c('0x9f')]){case _0xa81c('0xa0'):_0x2a462c=squel['insert']()[_0xa81c('0xa1')](_0xa81c('0xa2'))['fromQuery']([_0xa81c('0xa3'),_0xa81c('0xa4'),_0xa81c('0xa5'),_0xa81c('0xa6'),'VoiceQueueId','createdAt',_0xa81c('0x5f')],squel[_0xa81c('0x82')]()[_0xa81c('0x83')]('phone',_0xa81c('0xa3'))[_0xa81c('0x83')]('NOW()',_0xa81c('0xa4'))[_0xa81c('0x83')]('id',_0xa81c('0xa5'))[_0xa81c('0x83')](_0xa5997a[_0xa81c('0xa7')][_0xa81c('0xa8')](),_0xa81c('0xa6'))[_0xa81c('0x83')](_0x4e9084[_0xa81c('0x50')]['id']['toString'](),'VoiceQueueId')[_0xa81c('0x83')](_0xa81c('0xa9'),'createdAt')[_0xa81c('0x83')]('NOW()',_0xa81c('0x5f'))[_0xa81c('0x85')](_0xa81c('0xaa'))[_0xa81c('0x47')](_0xa81c('0xab'))[_0xa81c('0x47')](_0xa81c('0xac'),_0xa5997a[_0xa81c('0xa7')]['toString']())[_0xa81c('0x47')](_0xa81c('0xad'))[_0xa81c('0x47')](_0xa81c('0xae'),squel[_0xa81c('0x82')]()[_0xa81c('0x83')]('COALESCE(calleridnum,\x27\x27)')['from'](_0xa81c('0xaf'))[_0xa81c('0x47')](_0xa81c('0x8a'),_0x4e9084[_0xa81c('0x50')]['id'][_0xa81c('0xa8')]()))[_0xa81c('0x47')](_0xa81c('0xae'),squel[_0xa81c('0x82')]()[_0xa81c('0x83')]('COALESCE(phone,\x27\x27)')[_0xa81c('0x85')](_0xa81c('0xa2'))['where']('VoiceQueueId\x20=\x20?',_0x4e9084[_0xa81c('0x50')]['id'][_0xa81c('0xa8')]())))[_0xa81c('0xa8')]();break;case _0xa81c('0xb0'):_0x2a462c=squel[_0xa81c('0xb1')]()['into']('cm_hopper')['fromQuery']([_0xa81c('0xa3'),_0xa81c('0xa4'),_0xa81c('0xa5'),_0xa81c('0xa6'),'VoiceQueueId','createdAt',_0xa81c('0x5f')],squel[_0xa81c('0x82')]()[_0xa81c('0x83')](_0xa81c('0xa3'),'phone')['field'](_0xa81c('0xa9'),'scheduledAt')['field']('id',_0xa81c('0xa5'))[_0xa81c('0x83')](_0xa5997a[_0xa81c('0xa7')][_0xa81c('0xa8')](),_0xa81c('0xa6'))[_0xa81c('0x83')](_0x4e9084['params']['id'][_0xa81c('0xa8')](),_0xa81c('0x61'))[_0xa81c('0x83')]('NOW()',_0xa81c('0x5e'))[_0xa81c('0x83')](_0xa81c('0xa9'),_0xa81c('0x5f'))[_0xa81c('0x85')]('cm_contacts')[_0xa81c('0x47')](_0xa81c('0xab'))[_0xa81c('0x47')](_0xa81c('0xac'),_0xa5997a[_0xa81c('0xa7')]['toString']())[_0xa81c('0x47')](_0xa81c('0xad'))['where'](_0xa81c('0xae'),squel[_0xa81c('0x82')]()[_0xa81c('0x83')]('COALESCE(phone,\x27\x27)')[_0xa81c('0x85')](_0xa81c('0xa2'))[_0xa81c('0x47')](_0xa81c('0x8a'),_0x4e9084[_0xa81c('0x50')]['id'][_0xa81c('0xa8')]())))[_0xa81c('0xa8')]();break;default:_0x2a462c=squel[_0xa81c('0xb1')]()[_0xa81c('0xa1')](_0xa81c('0xa2'))[_0xa81c('0xb2')]([_0xa81c('0xa3'),_0xa81c('0xa4'),'ContactId',_0xa81c('0xa6'),_0xa81c('0x61'),'createdAt',_0xa81c('0x5f')],squel[_0xa81c('0x82')]()['field']('phone',_0xa81c('0xa3'))[_0xa81c('0x83')](_0xa81c('0xa9'),'scheduledAt')[_0xa81c('0x83')]('id','ContactId')['field'](_0xa5997a[_0xa81c('0xa7')][_0xa81c('0xa8')](),_0xa81c('0xa6'))[_0xa81c('0x83')](_0x4e9084['params']['id'][_0xa81c('0xa8')](),_0xa81c('0x61'))[_0xa81c('0x83')]('NOW()',_0xa81c('0x5e'))[_0xa81c('0x83')]('NOW()',_0xa81c('0x5f'))['from'](_0xa81c('0xaa'))[_0xa81c('0x47')](_0xa81c('0xab'))['where'](_0xa81c('0xac'),_0xa5997a[_0xa81c('0xa7')][_0xa81c('0xa8')]())['where'](_0xa81c('0xad')))[_0xa81c('0xa8')]();}_0x4617bf['push'](db[_0xa81c('0x74')]['query'](_0x2a462c));}return BPromise[_0xa81c('0x8f')](_0x4617bf);}})[_0xa81c('0x26')](function(){return _0x5d5ffa;})[_0xa81c('0x26')](respondWithResult(_0x42b6cf,null))['catch'](handleError(_0x42b6cf,null));};exports[_0xa81c('0xb3')]=function(_0x4973b9,_0x582247,_0x276e47){return db['VoiceQueue'][_0xa81c('0x2f')]({'where':{'id':_0x4973b9[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x582247,null))[_0xa81c('0x26')](function(_0x4987e1){if(_0x4987e1){return _0x4987e1['removeLists'](_0x4973b9[_0xa81c('0x3e')]['ids']);}})[_0xa81c('0x26')](function(_0x154e60){if(_0x154e60){return db[_0xa81c('0x62')][_0xa81c('0x27')]({'where':{'ListId':_0x4973b9['query']['ids'],'VoiceQueueId':_0x4973b9[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](function(){return _0x154e60;});}})['then'](respondWithStatusCode(_0x582247,null))[_0xa81c('0x4e')](handleError(_0x582247,null));};exports[_0xa81c('0xb4')]=function(_0x2e165a,_0x57bdb6,_0x1c38e7){var _0xdae11f={};var _0x143bbf={};var _0x502fd1;var _0x3b31fb;return db[_0xa81c('0x4a')][_0xa81c('0x60')]({'where':{'id':_0x2e165a[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x57bdb6,null))['then'](function(_0x1c3b2a){if(_0x1c3b2a){_0x502fd1=_0x1c3b2a;_0x143bbf[_0xa81c('0x3c')]=_[_0xa81c('0x3d')](db[_0xa81c('0x9d')][_0xa81c('0x39')]);_0x143bbf[_0xa81c('0x3e')]=_[_0xa81c('0x3d')](_0x2e165a[_0xa81c('0x3e')]);_0x143bbf['filters']=_[_0xa81c('0x40')](_0x143bbf[_0xa81c('0x3c')],_0x143bbf[_0xa81c('0x3e')]);_0xdae11f[_0xa81c('0x41')]=_['intersection'](_0x143bbf['model'],qs[_0xa81c('0x42')](_0x2e165a['query'][_0xa81c('0x42')]));_0xdae11f['attributes']=_0xdae11f[_0xa81c('0x41')][_0xa81c('0x43')]?_0xdae11f[_0xa81c('0x41')]:_0x143bbf[_0xa81c('0x3c')];_0xdae11f[_0xa81c('0x45')]=qs[_0xa81c('0x46')](_0x2e165a[_0xa81c('0x3e')]['sort']);_0xdae11f[_0xa81c('0x47')]=qs[_0xa81c('0x3f')](_[_0xa81c('0x65')](_0x2e165a[_0xa81c('0x3e')],_0x143bbf[_0xa81c('0x3f')]));if(_0x2e165a[_0xa81c('0x3e')]['filter']){_0xdae11f[_0xa81c('0x47')]=_['merge'](_0xdae11f['where'],{'$or':_[_0xa81c('0x38')](_0xdae11f[_0xa81c('0x41')],function(_0x27a31b){var _0x4b382c={};_0x4b382c[_0x27a31b]={'$like':'%'+_0x2e165a[_0xa81c('0x3e')][_0xa81c('0x2b')]+'%'};return _0x4b382c;})});}_0xdae11f=_[_0xa81c('0x49')]({},_0xdae11f,_0x2e165a['options']);return _0x502fd1[_0xa81c('0xb4')](_0xdae11f);}})[_0xa81c('0x26')](function(_0x274e85){if(_0x274e85){_0x3b31fb=_0x274e85[_0xa81c('0x43')];if(!_0x2e165a[_0xa81c('0x3e')][_0xa81c('0x67')](_0xa81c('0x44'))){_0xdae11f['limit']=qs[_0xa81c('0x1e')](_0x2e165a[_0xa81c('0x3e')][_0xa81c('0x1e')]);_0xdae11f[_0xa81c('0x20')]=qs[_0xa81c('0x20')](_0x2e165a['query'][_0xa81c('0x20')]);}return _0x502fd1[_0xa81c('0xb4')](_0xdae11f);}})[_0xa81c('0x26')](function(_0x322d9b){if(_0x322d9b){return _0x322d9b?{'count':_0x3b31fb,'rows':_0x322d9b}:null;}})[_0xa81c('0x26')](respondWithResult(_0x57bdb6,null))[_0xa81c('0x4e')](handleError(_0x57bdb6,null));};exports[_0xa81c('0xb5')]=function(_0x4d4fec,_0x5bd479,_0x42bc59){var _0x19e110,_0x2fe6fb;return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x4d4fec[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x5bd479,null))[_0xa81c('0x26')](function(_0x2bdf05){if(_0x2bdf05){_0x2fe6fb=_0x2bdf05;return _0x2bdf05['addBlackLists'](_0x4d4fec['body'][_0xa81c('0x81')],_[_0xa81c('0x5d')](_0x4d4fec[_0xa81c('0x54')],[_0xa81c('0x81'),'id'])||{});}return null;})[_0xa81c('0x97')](function(_0x385ace){var _0x4cdec7;_0x19e110=_0x385ace||[];var _0x54f354=[];if(_0x385ace){for(var _0x279cda=0x0;_0x279cda<_0x385ace[_0xa81c('0x43')];_0x279cda+=0x1){var _0x207590=_0x385ace[_0x279cda][_0xa81c('0x28')]({'plain':!![]});_0x4cdec7=squel[_0xa81c('0xb1')]()[_0xa81c('0xa1')](_0xa81c('0xb6'))[_0xa81c('0xb2')]([_0xa81c('0xa3'),_0xa81c('0xa5'),_0xa81c('0xa6'),_0xa81c('0x61'),_0xa81c('0x5e'),_0xa81c('0x5f')],squel['select']()[_0xa81c('0x83')](_0xa81c('0xa3'),_0xa81c('0xa3'))['field']('id','ContactId')['field'](_0x207590[_0xa81c('0xa7')]['toString'](),_0xa81c('0xa6'))['field'](_0x4d4fec[_0xa81c('0x50')]['id'][_0xa81c('0xa8')](),_0xa81c('0x61'))['field'](_0xa81c('0xa9'),_0xa81c('0x5e'))[_0xa81c('0x83')](_0xa81c('0xa9'),'updatedAt')['from'](_0xa81c('0xaa'))[_0xa81c('0x47')](_0xa81c('0xab'))[_0xa81c('0x47')](_0xa81c('0xac'),_0x207590[_0xa81c('0xa7')][_0xa81c('0xa8')]())[_0xa81c('0x47')](_0xa81c('0xad')))['toString']();_0x54f354[_0xa81c('0xb7')](db[_0xa81c('0x74')][_0xa81c('0x3e')](_0x4cdec7));}return BPromise[_0xa81c('0x8f')](_0x54f354);}})[_0xa81c('0x26')](function(){return _0x19e110;})['then'](respondWithResult(_0x5bd479,null))['catch'](handleError(_0x5bd479,null));};exports['removeBlackLists']=function(_0x2ce946,_0x243226,_0x51dc60){return db[_0xa81c('0x4a')][_0xa81c('0x2f')]({'where':{'id':_0x2ce946[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](handleEntityNotFound(_0x243226,null))[_0xa81c('0x26')](function(_0x4d5fc3){if(_0x4d5fc3){return _0x4d5fc3[_0xa81c('0xb8')](_0x2ce946[_0xa81c('0x3e')][_0xa81c('0x81')]);}})[_0xa81c('0x26')](function(_0x4fc65f){if(_0x4fc65f){return db['CmHopperBlack'][_0xa81c('0x27')]({'where':{'ListId':_0x2ce946['query']['ids'],'VoiceQueueId':_0x2ce946[_0xa81c('0x50')]['id']}})[_0xa81c('0x26')](function(){return _0x4fc65f;});}})['then'](respondWithStatusCode(_0x243226,null))['catch'](handleError(_0x243226,null));}; \ No newline at end of file +var _0x6340=['offset','undefined','limit','count','set','apply','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','error','stack','send','VoiceQueue','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','include','findAll','rows','catch','show','params','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','includeAll','role','autoAssociation','UserProfileResource','getHoppers','findOne','CmHopper','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','field','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','addAgents','spread','push','format','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json'];(function(_0xa16a25,_0x19a552){var _0x2e6653=function(_0x20f3c1){while(--_0x20f3c1){_0xa16a25['push'](_0xa16a25['shift']());}};_0x2e6653(++_0x19a552);}(_0x6340,0x97));var _0x0634=function(_0x262c39,_0x14b574){_0x262c39=_0x262c39-0x0;var _0x371d00=_0x6340[_0x262c39];return _0x371d00;};'use strict';var emlformat=require(_0x0634('0x0'));var rimraf=require(_0x0634('0x1'));var zipdir=require(_0x0634('0x2'));var jsonpatch=require(_0x0634('0x3'));var rp=require(_0x0634('0x4'));var moment=require(_0x0634('0x5'));var BPromise=require(_0x0634('0x6'));var Mustache=require(_0x0634('0x7'));var util=require('util');var path=require(_0x0634('0x8'));var sox=require(_0x0634('0x9'));var csv=require(_0x0634('0xa'));var ejs=require(_0x0634('0xb'));var fs=require('fs');var fs_extra=require(_0x0634('0xc'));var _=require('lodash');var squel=require(_0x0634('0xd'));var crypto=require('crypto');var jsforce=require(_0x0634('0xe'));var deskjs=require(_0x0634('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0634('0x10'));var Papa=require('papaparse');var Redis=require(_0x0634('0x11'));var authService=require(_0x0634('0x12'));var qs=require(_0x0634('0x13'));var as=require(_0x0634('0x14'));var hardwareService=require(_0x0634('0x15'));var logger=require(_0x0634('0x16'))(_0x0634('0x17'));var utils=require('../../config/utils');var config=require(_0x0634('0x18'));var licenseUtil=require(_0x0634('0x19'));var db=require('../../mysqldb')['db'];config[_0x0634('0x1a')]=_['defaults'](config[_0x0634('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0634('0x1b'))(new Redis(config['redis']));require(_0x0634('0x1c'))[_0x0634('0x1d')](socket);function respondWithStatusCode(_0x9c403b,_0x129955){_0x129955=_0x129955||0xcc;return function(_0x45a80b){if(_0x45a80b){return _0x9c403b[_0x0634('0x1e')](_0x129955);}return _0x9c403b[_0x0634('0x1f')](_0x129955)[_0x0634('0x20')]();};}function respondWithResult(_0x3c2af7,_0x33c2bc){_0x33c2bc=_0x33c2bc||0xc8;return function(_0x4da436){if(_0x4da436){return _0x3c2af7[_0x0634('0x1f')](_0x33c2bc)[_0x0634('0x21')](_0x4da436);}};}function respondWithFilteredResult(_0x178848,_0x5e4f51){return function(_0x482e0a){if(_0x482e0a){var _0x39afbc=typeof _0x5e4f51[_0x0634('0x22')]===_0x0634('0x23')&&typeof _0x5e4f51[_0x0634('0x24')]===_0x0634('0x23');var _0x21a33c=_0x482e0a[_0x0634('0x25')];var _0x33b9fe=_0x39afbc?0x0:_0x5e4f51['offset'];var _0x58437b=_0x39afbc?_0x482e0a[_0x0634('0x25')]:_0x5e4f51[_0x0634('0x22')]+_0x5e4f51[_0x0634('0x24')];var _0x1d35ae;if(_0x58437b>=_0x21a33c){_0x58437b=_0x21a33c;_0x1d35ae=0xc8;}else{_0x1d35ae=0xce;}_0x178848[_0x0634('0x1f')](_0x1d35ae);return _0x178848[_0x0634('0x26')]('Content-Range',_0x33b9fe+'-'+_0x58437b+'/'+_0x21a33c)[_0x0634('0x21')](_0x482e0a);}return null;};}function patchUpdates(_0x6f621f){return function(_0x874705){try{jsonpatch[_0x0634('0x27')](_0x874705,_0x6f621f,!![]);}catch(_0x306408){return BPromise['reject'](_0x306408);}return _0x874705[_0x0634('0x28')]();};}function saveUpdates(_0x18bbd1,_0x4eefae){return function(_0x3c87ee){if(_0x3c87ee){return _0x3c87ee['update'](_0x18bbd1)[_0x0634('0x29')](function(_0x3f569e){return _0x3f569e;});}return null;};}function removeEntity(_0x4e35af,_0x5272f8){return function(_0x4ee26c){if(_0x4ee26c){return _0x4ee26c[_0x0634('0x2a')]()[_0x0634('0x29')](function(){var _0xf0b59f=_0x4ee26c[_0x0634('0x2b')]({'plain':!![]});var _0x4a95a0=[{'name':_0x0634('0x2c'),'value':_0x0634('0x2d'),'ignore':![]},{'name':_0x0634('0x2e'),'value':_0x0634('0x2f'),'ignore':![]}];var _0x2fa79a=_(_0x4a95a0)[_0x0634('0x30')](_0x0634('0x31'))[_0x0634('0x32')](_0x0634('0x33'))[_0x0634('0x33')]();if(_[_0x0634('0x34')](_0x2fa79a,_0xf0b59f[_0x0634('0x35')])){return;}var _0x26bc54=_[_0x0634('0x36')](_0x4a95a0,[_0x0634('0x33'),_0xf0b59f[_0x0634('0x35')]])[_0x0634('0x37')];return db['UserProfileResource'][_0x0634('0x2a')]({'where':{'type':_0x26bc54,'resourceId':_0xf0b59f['id']}})[_0x0634('0x29')](function(){return _0x4ee26c;});})[_0x0634('0x29')](function(){_0x4e35af[_0x0634('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x569cd5,_0x104931){return function(_0x24f35e){if(!_0x24f35e){_0x569cd5['sendStatus'](0x194);}return _0x24f35e;};}function handleError(_0x2f2f02,_0x5d638c){_0x5d638c=_0x5d638c||0x1f4;return function(_0x1cc2f3){logger[_0x0634('0x38')](_0x1cc2f3[_0x0634('0x39')]);if(_0x1cc2f3['name']){delete _0x1cc2f3[_0x0634('0x37')];}_0x2f2f02['status'](_0x5d638c)[_0x0634('0x3a')](_0x1cc2f3);};}exports['index']=function(_0x3e671a,_0x222651){var _0x5924d3={},_0x129a6f={},_0x151875={'count':0x0,'rows':[]};var _0x3e12f7=_[_0x0634('0x32')](db[_0x0634('0x3b')][_0x0634('0x3c')],function(_0x599a3b){return{'name':_0x599a3b[_0x0634('0x3d')],'type':_0x599a3b[_0x0634('0x35')]['key']};});_0x129a6f[_0x0634('0x3e')]=_[_0x0634('0x32')](_0x3e12f7,_0x0634('0x37'));_0x129a6f['query']=_[_0x0634('0x3f')](_0x3e671a[_0x0634('0x40')]);_0x129a6f[_0x0634('0x41')]=_[_0x0634('0x42')](_0x129a6f[_0x0634('0x3e')],_0x129a6f[_0x0634('0x40')]);_0x5924d3[_0x0634('0x43')]=_[_0x0634('0x42')](_0x129a6f[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x3e671a['query'][_0x0634('0x44')]));_0x5924d3[_0x0634('0x43')]=_0x5924d3[_0x0634('0x43')][_0x0634('0x45')]?_0x5924d3[_0x0634('0x43')]:_0x129a6f['model'];if(!_0x3e671a['query'][_0x0634('0x46')](_0x0634('0x47'))){_0x5924d3[_0x0634('0x24')]=qs[_0x0634('0x24')](_0x3e671a['query'][_0x0634('0x24')]);_0x5924d3[_0x0634('0x22')]=qs[_0x0634('0x22')](_0x3e671a['query']['offset']);}_0x5924d3[_0x0634('0x48')]=qs['sort'](_0x3e671a[_0x0634('0x40')][_0x0634('0x49')]);_0x5924d3['where']=qs['filters'](_['pick'](_0x3e671a['query'],_0x129a6f[_0x0634('0x41')]),_0x3e12f7);if(_0x3e671a[_0x0634('0x40')][_0x0634('0x30')]){_0x5924d3[_0x0634('0x4a')]=_[_0x0634('0x4b')](_0x5924d3[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x3e12f7,function(_0x18df66){if(_0x18df66[_0x0634('0x35')]!=='VIRTUAL'){var _0x50536b={};_0x50536b[_0x18df66[_0x0634('0x37')]]={'$like':'%'+_0x3e671a[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x50536b;}})});}_0x5924d3=_['merge']({},_0x5924d3,_0x3e671a[_0x0634('0x4c')]);var _0x4424a1={'where':_0x5924d3[_0x0634('0x4a')]};return db['VoiceQueue'][_0x0634('0x25')](_0x4424a1)[_0x0634('0x29')](function(_0x3ef2a7){_0x151875[_0x0634('0x25')]=_0x3ef2a7;if(_0x3e671a['query']['includeAll']){_0x5924d3[_0x0634('0x4d')]=[{'all':!![]}];}return db['VoiceQueue'][_0x0634('0x4e')](_0x5924d3);})['then'](function(_0x9b6dcd){_0x151875[_0x0634('0x4f')]=_0x9b6dcd;return _0x151875;})['then'](respondWithFilteredResult(_0x222651,_0x5924d3))[_0x0634('0x50')](handleError(_0x222651,null));};exports[_0x0634('0x51')]=function(_0x28a69a,_0x444ea2){var _0x1daf33={'raw':![],'where':{'id':_0x28a69a[_0x0634('0x52')]['id']}},_0x22c5d3={};_0x22c5d3['model']=_[_0x0634('0x3f')](db[_0x0634('0x3b')][_0x0634('0x3c')]);_0x22c5d3[_0x0634('0x40')]=_['keys'](_0x28a69a[_0x0634('0x40')]);_0x22c5d3['filters']=_[_0x0634('0x42')](_0x22c5d3[_0x0634('0x3e')],_0x22c5d3[_0x0634('0x40')]);_0x1daf33['attributes']=_[_0x0634('0x42')](_0x22c5d3[_0x0634('0x3e')],qs['fields'](_0x28a69a[_0x0634('0x40')][_0x0634('0x44')]));_0x1daf33['attributes']=_0x1daf33[_0x0634('0x43')][_0x0634('0x45')]?_0x1daf33[_0x0634('0x43')]:_0x22c5d3[_0x0634('0x3e')];if(_0x28a69a[_0x0634('0x40')]['includeAll']){_0x1daf33[_0x0634('0x4d')]=[{'all':!![]}];}_0x1daf33=_[_0x0634('0x4b')]({},_0x1daf33,_0x28a69a[_0x0634('0x4c')]);return db[_0x0634('0x3b')][_0x0634('0x36')](_0x1daf33)['then'](handleEntityNotFound(_0x444ea2,null))[_0x0634('0x29')](respondWithResult(_0x444ea2,null))[_0x0634('0x50')](handleError(_0x444ea2,null));};exports[_0x0634('0x53')]=function(_0x10bd25,_0x38782c){return db[_0x0634('0x3b')][_0x0634('0x53')](_0x10bd25[_0x0634('0x54')],{})['then'](function(_0x249df8){var _0x14c82b=_0x10bd25[_0x0634('0x55')]['get']({'plain':!![]});if(!_0x14c82b)throw new Error(_0x0634('0x56'));if(_0x14c82b['role']===_0x0634('0x55')){var _0x2fb4f3=_0x249df8[_0x0634('0x2b')]({'plain':!![]});var _0x577ece=[{'name':'VoiceQueues','value':_0x0634('0x2d')},{'name':'QueueCampaigns','value':_0x0634('0x2f')}];var _0x555ebf=_[_0x0634('0x36')](_0x577ece,[_0x0634('0x33'),_0x2fb4f3[_0x0634('0x35')]])[_0x0634('0x37')];return db[_0x0634('0x57')][_0x0634('0x36')]({'where':{'name':_0x555ebf,'userProfileId':_0x14c82b[_0x0634('0x58')]},'raw':!![]})[_0x0634('0x29')](function(_0x4ee3d7){if(_0x4ee3d7&&_0x4ee3d7['autoAssociation']===0x0){return db['UserProfileResource'][_0x0634('0x53')]({'name':_0x2fb4f3['name'],'resourceId':_0x2fb4f3['id'],'type':_0x4ee3d7['name'],'sectionId':_0x4ee3d7['id']},{})[_0x0634('0x29')](function(){return _0x249df8;});}else{return _0x249df8;}})['catch'](function(_0x512e25){logger[_0x0634('0x38')](_0x0634('0x59'),_0x512e25);throw _0x512e25;});}return _0x249df8;})[_0x0634('0x29')](respondWithResult(_0x38782c,0xc9))[_0x0634('0x50')](handleError(_0x38782c,null));};exports[_0x0634('0x5a')]=function(_0x27c433,_0x2d1900){var _0x579a6f={'where':{'id':_0x27c433['params']['id']}},_0x270544={};_0x270544['model']=_['keys'](db[_0x0634('0x3b')][_0x0634('0x3c')]);_0x579a6f[_0x0634('0x43')]=_[_0x0634('0x42')](_0x270544['model'],qs[_0x0634('0x44')](_0x27c433[_0x0634('0x40')][_0x0634('0x44')]));_0x579a6f['attributes']=_0x579a6f[_0x0634('0x43')][_0x0634('0x45')]?_0x579a6f[_0x0634('0x43')]:_0x270544[_0x0634('0x3e')];if(_0x27c433[_0x0634('0x40')]['includeAll']){_0x579a6f[_0x0634('0x4d')]=[{'all':!![]}];}_0x579a6f=_[_0x0634('0x4b')]({},_0x579a6f,_0x27c433['options']);return db['VoiceQueue'][_0x0634('0x36')](_0x579a6f)[_0x0634('0x29')](handleEntityNotFound(_0x2d1900,null))[_0x0634('0x29')](function(_0x2f313f){if(_0x2f313f){var _0x317206=_0x2f313f['get']({'plain':!![]});_0x317206=qs[_0x0634('0x5b')](_0x317206,['id',_0x0634('0x5c'),_0x0634('0x5d')]);_0x27c433[_0x0634('0x54')]=_[_0x0634('0x5b')](_0x27c433[_0x0634('0x54')],['id',_0x0634('0x5c'),'updatedAt']);return db[_0x0634('0x3b')][_0x0634('0x53')](_['merge'](_0x317206,_0x27c433[_0x0634('0x54')]),{'include':_0x27c433[_0x0634('0x40')][_0x0634('0x5e')]?[{'all':!![]}]:undefined})[_0x0634('0x29')](function(_0x59f91e){var _0x2184cd=_0x27c433['user'][_0x0634('0x2b')]({'plain':!![]});if(!_0x2184cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2184cd[_0x0634('0x5f')]===_0x0634('0x55')){var _0x1d149e=_0x59f91e[_0x0634('0x2b')]({'plain':!![]});var _0x28e6d7=[{'name':'VoiceQueues','value':_0x0634('0x2d')},{'name':_0x0634('0x2e'),'value':_0x0634('0x2f')}];var _0x3859cb=_[_0x0634('0x36')](_0x28e6d7,[_0x0634('0x33'),_0x1d149e[_0x0634('0x35')]])[_0x0634('0x37')];return db['UserProfileSection'][_0x0634('0x36')]({'where':{'name':_0x3859cb,'userProfileId':_0x2184cd[_0x0634('0x58')]},'raw':!![]})['then'](function(_0x4a3923){if(_0x4a3923&&_0x4a3923[_0x0634('0x60')]===0x0){return db[_0x0634('0x61')]['create']({'name':_0x1d149e[_0x0634('0x37')],'resourceId':_0x1d149e['id'],'type':_0x4a3923[_0x0634('0x37')],'sectionId':_0x4a3923['id']},{})[_0x0634('0x29')](function(){return _0x59f91e;});}else{return _0x59f91e;}})[_0x0634('0x50')](function(_0x253d6d){logger['error'](_0x0634('0x59'),_0x253d6d);throw _0x253d6d;});}return _0x59f91e;});}})['then'](respondWithResult(_0x2d1900,0xc9))['catch'](handleError(_0x2d1900,null));};exports['update']=function(_0x435333,_0x4ed68e){if(_0x435333[_0x0634('0x54')]['id']){delete _0x435333[_0x0634('0x54')]['id'];}return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x435333['params']['id']}})['then'](handleEntityNotFound(_0x4ed68e,null))[_0x0634('0x29')](saveUpdates(_0x435333[_0x0634('0x54')],null))[_0x0634('0x29')](respondWithResult(_0x4ed68e,null))[_0x0634('0x50')](handleError(_0x4ed68e,null));};exports['destroy']=function(_0x1a8a89,_0x56fe58){return db['VoiceQueue'][_0x0634('0x36')]({'where':{'id':_0x1a8a89[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x56fe58,null))[_0x0634('0x29')](removeEntity(_0x56fe58,null))[_0x0634('0x50')](handleError(_0x56fe58,null));};exports[_0x0634('0x62')]=function(_0x18b2d2,_0x11d28e,_0xd6cf31){var _0x2c1825={'raw':![],'where':{}};var _0x3522ab={};var _0x138c9e={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0634('0x63')]({'where':{'id':_0x18b2d2['params']['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x11d28e,null))[_0x0634('0x29')](function(_0x9ea9e9){if(_0x9ea9e9){_0x3522ab[_0x0634('0x3e')]=_[_0x0634('0x3f')](db[_0x0634('0x64')][_0x0634('0x3c')]);_0x3522ab[_0x0634('0x40')]=_[_0x0634('0x3f')](_0x18b2d2[_0x0634('0x40')]);_0x3522ab['filters']=_[_0x0634('0x42')](_0x3522ab[_0x0634('0x3e')],_0x3522ab[_0x0634('0x40')]);_0x2c1825[_0x0634('0x43')]=_[_0x0634('0x42')](_0x3522ab[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x18b2d2[_0x0634('0x40')][_0x0634('0x44')]));_0x2c1825['attributes']=_0x2c1825['attributes'][_0x0634('0x45')]?_0x2c1825[_0x0634('0x43')]:_0x3522ab[_0x0634('0x3e')];if(!_0x18b2d2[_0x0634('0x40')]['hasOwnProperty']('nolimit')){_0x2c1825['limit']=qs[_0x0634('0x24')](_0x18b2d2[_0x0634('0x40')][_0x0634('0x24')]);_0x2c1825['offset']=qs['offset'](_0x18b2d2[_0x0634('0x40')]['offset']);}_0x2c1825[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x18b2d2['query'][_0x0634('0x49')]);_0x2c1825['where']=qs['filters'](_[_0x0634('0x65')](_0x18b2d2[_0x0634('0x40')],_0x3522ab['filters']));_0x2c1825[_0x0634('0x4a')][_0x0634('0x66')]=_0x9ea9e9['id'];if(_0x18b2d2[_0x0634('0x40')][_0x0634('0x30')]){_0x2c1825[_0x0634('0x4a')]=_['merge'](_0x2c1825[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x2c1825[_0x0634('0x43')],function(_0x59a917){var _0x1328f5={};_0x1328f5[_0x59a917]={'$like':'%'+_0x18b2d2[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x1328f5;})});}_0x2c1825=_['merge']({},_0x2c1825,_0x18b2d2[_0x0634('0x4c')]);return db['CmHopper'][_0x0634('0x25')]({'where':_0x2c1825[_0x0634('0x4a')]})[_0x0634('0x29')](function(_0xeb6c66){_0x138c9e[_0x0634('0x25')]=_0xeb6c66;if(_0x18b2d2[_0x0634('0x40')]['includeAll']){_0x2c1825[_0x0634('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x0634('0x4e')](_0x2c1825);})['then'](function(_0x405185){_0x138c9e['rows']=_0x405185;return _0x138c9e;});}})[_0x0634('0x29')](respondWithFilteredResult(_0x11d28e,_0x2c1825))[_0x0634('0x50')](handleError(_0x11d28e,null));};exports[_0x0634('0x67')]=function(_0x1f4c51,_0x2548e3,_0xdb40a0){var _0x10ebc9={'raw':!![],'where':{}};var _0x386734={};var _0x5b789b={'count':0x0,'rows':[]};return db[_0x0634('0x3b')][_0x0634('0x63')]({'where':{'id':_0x1f4c51['params']['id']}})['then'](handleEntityNotFound(_0x2548e3,null))[_0x0634('0x29')](function(_0x120485){if(_0x120485){_0x386734[_0x0634('0x3e')]=_[_0x0634('0x3f')](db[_0x0634('0x68')][_0x0634('0x3c')]);_0x386734['query']=_[_0x0634('0x3f')](_0x1f4c51[_0x0634('0x40')]);_0x386734[_0x0634('0x41')]=_['intersection'](_0x386734[_0x0634('0x3e')],_0x386734['query']);_0x10ebc9['attributes']=_['intersection'](_0x386734[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x1f4c51['query'][_0x0634('0x44')]));_0x10ebc9['attributes']=_0x10ebc9[_0x0634('0x43')][_0x0634('0x45')]?_0x10ebc9[_0x0634('0x43')]:_0x386734[_0x0634('0x3e')];if(!_0x1f4c51[_0x0634('0x40')][_0x0634('0x46')](_0x0634('0x47'))){_0x10ebc9['limit']=qs['limit'](_0x1f4c51[_0x0634('0x40')]['limit']);_0x10ebc9[_0x0634('0x22')]=qs[_0x0634('0x22')](_0x1f4c51[_0x0634('0x40')][_0x0634('0x22')]);}_0x10ebc9[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x1f4c51[_0x0634('0x40')]['sort']);_0x10ebc9[_0x0634('0x4a')]=qs['filters'](_['pick'](_0x1f4c51[_0x0634('0x40')],_0x386734[_0x0634('0x41')]));_0x10ebc9['where'][_0x0634('0x66')]=_0x120485['id'];if(_0x1f4c51[_0x0634('0x40')][_0x0634('0x30')]){_0x10ebc9[_0x0634('0x4a')]=_['merge'](_0x10ebc9[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x10ebc9[_0x0634('0x43')],function(_0x10a5fa){var _0x17a0c1={};_0x17a0c1[_0x10a5fa]={'$like':'%'+_0x1f4c51[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x17a0c1;})});}_0x10ebc9=_[_0x0634('0x4b')]({},_0x10ebc9,_0x1f4c51['options']);return db[_0x0634('0x68')][_0x0634('0x25')]({'where':_0x10ebc9['where']})[_0x0634('0x29')](function(_0x4d95e1){_0x5b789b[_0x0634('0x25')]=_0x4d95e1;if(_0x1f4c51[_0x0634('0x40')]['includeAll']){_0x10ebc9[_0x0634('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0634('0x4e')](_0x10ebc9);})[_0x0634('0x29')](function(_0x5359e5){_0x5b789b['rows']=_0x5359e5;return _0x5b789b;});}})[_0x0634('0x29')](respondWithFilteredResult(_0x2548e3,_0x10ebc9))[_0x0634('0x50')](handleError(_0x2548e3,null));};exports[_0x0634('0x69')]=function(_0x37377c,_0x571623,_0x41a5d2){var _0x1f09a8={'raw':!![],'where':{}};var _0x92289d={};var _0x252002={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0634('0x63')]({'where':{'id':_0x37377c[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x571623,null))[_0x0634('0x29')](function(_0x27ba36){if(_0x27ba36){_0x92289d[_0x0634('0x3e')]=_['keys'](db[_0x0634('0x6a')][_0x0634('0x3c')]);_0x92289d[_0x0634('0x40')]=_['keys'](_0x37377c['query']);_0x92289d[_0x0634('0x41')]=_[_0x0634('0x42')](_0x92289d[_0x0634('0x3e')],_0x92289d[_0x0634('0x40')]);_0x1f09a8[_0x0634('0x43')]=_[_0x0634('0x42')](_0x92289d[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x37377c[_0x0634('0x40')][_0x0634('0x44')]));_0x1f09a8[_0x0634('0x43')]=_0x1f09a8[_0x0634('0x43')][_0x0634('0x45')]?_0x1f09a8[_0x0634('0x43')]:_0x92289d[_0x0634('0x3e')];if(!_0x37377c['query'][_0x0634('0x46')]('nolimit')){_0x1f09a8[_0x0634('0x24')]=qs[_0x0634('0x24')](_0x37377c[_0x0634('0x40')]['limit']);_0x1f09a8[_0x0634('0x22')]=qs[_0x0634('0x22')](_0x37377c[_0x0634('0x40')][_0x0634('0x22')]);}_0x1f09a8[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x37377c[_0x0634('0x40')][_0x0634('0x49')]);_0x1f09a8[_0x0634('0x4a')]=qs[_0x0634('0x41')](_[_0x0634('0x65')](_0x37377c[_0x0634('0x40')],_0x92289d['filters']));_0x1f09a8['where'][_0x0634('0x66')]=_0x27ba36['id'];if(_0x37377c[_0x0634('0x40')][_0x0634('0x30')]){_0x1f09a8[_0x0634('0x4a')]=_[_0x0634('0x4b')](_0x1f09a8['where'],{'$or':_['map'](_0x1f09a8[_0x0634('0x43')],function(_0x467c18){var _0x58c28d={};_0x58c28d[_0x467c18]={'$like':'%'+_0x37377c[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x58c28d;})});}_0x1f09a8=_[_0x0634('0x4b')]({},_0x1f09a8,_0x37377c[_0x0634('0x4c')]);return db[_0x0634('0x6a')][_0x0634('0x25')]({'where':_0x1f09a8[_0x0634('0x4a')]})[_0x0634('0x29')](function(_0x42be04){_0x252002[_0x0634('0x25')]=_0x42be04;if(_0x37377c['query'][_0x0634('0x5e')]){_0x1f09a8[_0x0634('0x4d')]=[{'all':!![]}];}return db[_0x0634('0x6a')][_0x0634('0x4e')](_0x1f09a8);})[_0x0634('0x29')](function(_0x54784a){_0x252002[_0x0634('0x4f')]=_0x54784a;return _0x252002;});}})[_0x0634('0x29')](respondWithFilteredResult(_0x571623,_0x1f09a8))[_0x0634('0x50')](handleError(_0x571623,null));};exports['getHopperBlacks']=function(_0x1b74ef,_0x219b75,_0x2e6eeb){var _0x40940f={'raw':!![],'where':{}};var _0x3e28f2={};var _0x2ba711={'count':0x0,'rows':[]};return db[_0x0634('0x3b')][_0x0634('0x63')]({'where':{'id':_0x1b74ef[_0x0634('0x52')]['id']}})['then'](handleEntityNotFound(_0x219b75,null))[_0x0634('0x29')](function(_0x1e58a8){if(_0x1e58a8){_0x3e28f2['model']=_['keys'](db[_0x0634('0x6b')][_0x0634('0x3c')]);_0x3e28f2[_0x0634('0x40')]=_[_0x0634('0x3f')](_0x1b74ef[_0x0634('0x40')]);_0x3e28f2['filters']=_[_0x0634('0x42')](_0x3e28f2[_0x0634('0x3e')],_0x3e28f2[_0x0634('0x40')]);_0x40940f[_0x0634('0x43')]=_[_0x0634('0x42')](_0x3e28f2[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x1b74ef[_0x0634('0x40')][_0x0634('0x44')]));_0x40940f['attributes']=_0x40940f[_0x0634('0x43')][_0x0634('0x45')]?_0x40940f[_0x0634('0x43')]:_0x3e28f2[_0x0634('0x3e')];if(!_0x1b74ef[_0x0634('0x40')][_0x0634('0x46')](_0x0634('0x47'))){_0x40940f['limit']=qs[_0x0634('0x24')](_0x1b74ef[_0x0634('0x40')][_0x0634('0x24')]);_0x40940f[_0x0634('0x22')]=qs['offset'](_0x1b74ef[_0x0634('0x40')]['offset']);}_0x40940f[_0x0634('0x48')]=qs['sort'](_0x1b74ef[_0x0634('0x40')][_0x0634('0x49')]);_0x40940f[_0x0634('0x4a')]=qs['filters'](_[_0x0634('0x65')](_0x1b74ef[_0x0634('0x40')],_0x3e28f2[_0x0634('0x41')]));_0x40940f[_0x0634('0x4a')]['VoiceQueueId']=_0x1e58a8['id'];if(_0x1b74ef[_0x0634('0x40')][_0x0634('0x30')]){_0x40940f[_0x0634('0x4a')]=_['merge'](_0x40940f[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x40940f[_0x0634('0x43')],function(_0x958f8f){var _0x2b3c35={};_0x2b3c35[_0x958f8f]={'$like':'%'+_0x1b74ef['query'][_0x0634('0x30')]+'%'};return _0x2b3c35;})});}_0x40940f=_[_0x0634('0x4b')]({},_0x40940f,_0x1b74ef[_0x0634('0x4c')]);return db['CmHopperBlack'][_0x0634('0x25')]({'where':_0x40940f['where']})[_0x0634('0x29')](function(_0x2c21d5){_0x2ba711[_0x0634('0x25')]=_0x2c21d5;if(_0x1b74ef[_0x0634('0x40')][_0x0634('0x5e')]){_0x40940f[_0x0634('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0634('0x4e')](_0x40940f);})['then'](function(_0x3dfa0e){_0x2ba711[_0x0634('0x4f')]=_0x3dfa0e;return _0x2ba711;});}})[_0x0634('0x29')](respondWithFilteredResult(_0x219b75,_0x40940f))[_0x0634('0x50')](handleError(_0x219b75,null));};exports[_0x0634('0x6c')]=function(_0x2a8290,_0x1fb008,_0x4436a8){var _0xb7e21c={};var _0x397edf={};var _0x1eb456;var _0x500f0b;return db['VoiceQueue']['findOne']({'where':{'id':_0x2a8290[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x1fb008,null))['then'](function(_0x24cabe){if(_0x24cabe){_0x1eb456=_0x24cabe;_0x397edf[_0x0634('0x3e')]=_[_0x0634('0x3f')](db['Team'][_0x0634('0x3c')]);_0x397edf[_0x0634('0x40')]=_[_0x0634('0x3f')](_0x2a8290['query']);_0x397edf[_0x0634('0x41')]=_[_0x0634('0x42')](_0x397edf[_0x0634('0x3e')],_0x397edf[_0x0634('0x40')]);_0xb7e21c[_0x0634('0x43')]=_[_0x0634('0x42')](_0x397edf['model'],qs['fields'](_0x2a8290[_0x0634('0x40')][_0x0634('0x44')]));_0xb7e21c[_0x0634('0x43')]=_0xb7e21c[_0x0634('0x43')][_0x0634('0x45')]?_0xb7e21c['attributes']:_0x397edf[_0x0634('0x3e')];_0xb7e21c[_0x0634('0x48')]=qs['sort'](_0x2a8290[_0x0634('0x40')][_0x0634('0x49')]);_0xb7e21c[_0x0634('0x4a')]=qs[_0x0634('0x41')](_[_0x0634('0x65')](_0x2a8290['query'],_0x397edf['filters']));if(_0x2a8290[_0x0634('0x40')][_0x0634('0x30')]){_0xb7e21c['where']=_[_0x0634('0x4b')](_0xb7e21c[_0x0634('0x4a')],{'$or':_['map'](_0xb7e21c[_0x0634('0x43')],function(_0x36fd42){var _0x3ec90b={};_0x3ec90b[_0x36fd42]={'$like':'%'+_0x2a8290[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x3ec90b;})});}_0xb7e21c=_[_0x0634('0x4b')]({},_0xb7e21c,_0x2a8290['options']);return _0x1eb456[_0x0634('0x6c')](_0xb7e21c);}})[_0x0634('0x29')](function(_0x53fabd){if(_0x53fabd){_0x500f0b=_0x53fabd[_0x0634('0x45')];if(!_0x2a8290['query'][_0x0634('0x46')](_0x0634('0x47'))){_0xb7e21c['limit']=qs[_0x0634('0x24')](_0x2a8290[_0x0634('0x40')][_0x0634('0x24')]);_0xb7e21c['offset']=qs[_0x0634('0x22')](_0x2a8290[_0x0634('0x40')]['offset']);}return _0x1eb456['getTeams'](_0xb7e21c);}})[_0x0634('0x29')](function(_0x2d3139){if(_0x2d3139){return _0x2d3139?{'count':_0x500f0b,'rows':_0x2d3139}:null;}})[_0x0634('0x29')](respondWithResult(_0x1fb008,null))[_0x0634('0x50')](handleError(_0x1fb008,null));};exports[_0x0634('0x6d')]=function(_0x5a1376,_0x301bcc,_0x56350d){var _0x1cfd00=_0x5a1376[_0x0634('0x54')][_0x0634('0x6e')];var _0x5de748=_['map'](_0x1cfd00,'id');return db[_0x0634('0x6f')][_0x0634('0x4e')]({'where':{'id':_0x5de748},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0634('0x70'),'attributes':['id',_0x0634('0x37'),_0x0634('0x71'),'voicePause',_0x0634('0x72')],'raw':!![]}]})[_0x0634('0x29')](function(_0x59225a){if(_0x59225a){var _0x1fd2a6=_[_0x0634('0x73')](_0x59225a,function(_0xa46390){var _0xa030c4=_0xa46390[_0x0634('0x2b')]({'plain':!![]});_0xa030c4['Agents'][_0x0634('0x74')](function(_0x4c31f1){_0x4c31f1[_0x0634('0x75')]=_[_0x0634('0x36')](_0x1cfd00,{'id':_0xa030c4['id']})[_0x0634('0x75')];});return _0xa030c4['Agents'];});return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x5a1376[_0x0634('0x52')]['id']}})[_0x0634('0x29')](function(_0x35d2c1){return db[_0x0634('0x76')][_0x0634('0x77')](function(_0x8f046e){return _0x35d2c1['addTeams'](_0x5de748,{'transaction':_0x8f046e})[_0x0634('0x29')](function(){return BPromise['each'](_0x1cfd00,function(_0x155c50){return db['TeamVoiceQueue'][_0x0634('0x78')]({'TeamId':_0x155c50['id'],'VoiceQueueId':_0x5a1376['params']['id'],'penalty':_0x155c50[_0x0634('0x75')]},{'transaction':_0x8f046e});});})[_0x0634('0x29')](function(){return BPromise[_0x0634('0x79')](_0x1fd2a6,function(_0x1eac5){return db[_0x0634('0x7a')][_0x0634('0x7b')]({'where':{'UserId':_0x1eac5['id'],'VoiceQueueId':_0x5a1376['params']['id']},'defaults':{'penalty':_0x1eac5['penalty']},'transaction':_0x8f046e});});})['then'](function(){return BPromise['each'](_[_0x0634('0x30')](_0x1fd2a6,{'online':!![]}),function(_0x36c4d5){return db[_0x0634('0x7c')]['upsert']({'membername':_0x36c4d5[_0x0634('0x37')],'UserId':_0x36c4d5['id'],'queue_name':_0x35d2c1[_0x0634('0x37')],'VoiceQueueId':_0x35d2c1['id'],'interface':_[_0x0634('0x7d')](_0x36c4d5[_0x0634('0x72')])?util['format'](_0x0634('0x7e'),_0x36c4d5[_0x0634('0x37')]):_0x36c4d5[_0x0634('0x72')],'paused':_0x36c4d5[_0x0634('0x7f')]||![],'penalty':_0x36c4d5['penalty']},{'transaction':_0x8f046e});});})[_0x0634('0x29')](function(){_0x1fd2a6['forEach'](function(_0x4f3049){socket[_0x0634('0x80')](_0x0634('0x81'),{'UserId':_0x4f3049['id'],'VoiceQueueId':_0x35d2c1['id']});});});});});}})[_0x0634('0x29')](respondWithStatusCode(_0x301bcc,null))[_0x0634('0x50')](handleError(_0x301bcc,null));};exports[_0x0634('0x82')]=function(_0xb7320a,_0x4bd77b,_0x323122){return db['Team'][_0x0634('0x4e')]({'where':{'id':_0xb7320a[_0x0634('0x40')][_0x0634('0x83')]},'attributes':['id'],'include':[{'model':db[_0x0634('0x84')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4bd77b,null))[_0x0634('0x29')](function(_0x41538a){var _0x26c825=_[_0x0634('0x32')](_0x41538a,'id');var _0x57bd1f=[];var _0xa0c792=[];var _0xbce37d=squel['select']();_0xbce37d[_0x0634('0x85')](_0x0634('0x86'))[_0x0634('0x87')](_0x0634('0x88'),'tq')['join']('user_has_teams','ut',_0x0634('0x89'))[_0x0634('0x4a')](_0x0634('0x8a'),_0xb7320a['params']['id']);for(var _0x216997=0x0;_0x216997<_0x41538a['length'];_0x216997+=0x1){let _0x54e1b1=_0x41538a[_0x216997];for(var _0x51c131=0x0;_0x51c131<_0x54e1b1[_0x0634('0x70')]['length'];_0x51c131+=0x1){let _0x4ef6b5=_0x54e1b1[_0x0634('0x70')][_0x51c131];var _0x4f9268=_0xbce37d[_0x0634('0x5a')]();_0x4f9268['where'](_0x0634('0x8b'),_0x4ef6b5['id']);_0xa0c792['push'](db[_0x0634('0x76')][_0x0634('0x40')](_0x4f9268['toString'](),{'type':db[_0x0634('0x76')][_0x0634('0x8c')][_0x0634('0x8d')]})[_0x0634('0x29')](function(_0x1898e6){if(_0x1898e6['length']===0x1){return _0x4ef6b5['id'];}else{var _0x19a49e=_[_0x0634('0x8e')](_[_0x0634('0x32')](_0x1898e6,_0x0634('0x8f')),function(_0x3bb134){return _['includes'](_0x26c825,_0x3bb134);});if(_0x19a49e){return _0x4ef6b5['id'];}}}));}}return BPromise[_0x0634('0x90')](_0xa0c792)['then'](function(_0x5ce0f0){_0x57bd1f=_(_0x57bd1f)[_0x0634('0x91')](_0x5ce0f0)['compact']()[_0x0634('0x33')]();return db['VoiceQueue'][_0x0634('0x36')]({'where':{'id':_0xb7320a['params']['id']}})[_0x0634('0x29')](function(_0x323f7c){return db['sequelize'][_0x0634('0x77')](function(_0x2855a5){return _0x323f7c[_0x0634('0x82')](_0xb7320a[_0x0634('0x40')][_0x0634('0x83')],{'transaction':_0x2855a5})['then'](function(){if(!_[_0x0634('0x92')](_0x57bd1f)){return _0x323f7c[_0x0634('0x93')](_0x57bd1f,{'transaction':_0x2855a5})[_0x0634('0x29')](function(){return db[_0x0634('0x7c')][_0x0634('0x2a')]({'where':{'VoiceQueueId':_0xb7320a[_0x0634('0x52')]['id'],'UserId':_0x57bd1f},'transaction':_0x2855a5});});}})[_0x0634('0x29')](function(){_0x57bd1f['forEach'](function(_0x18c1f3){socket[_0x0634('0x80')]('userVoiceQueue:remove',{'UserId':_0x18c1f3,'VoiceQueueId':_0x323f7c['id']});});});});});});})[_0x0634('0x29')](respondWithStatusCode(_0x4bd77b,null))[_0x0634('0x50')](handleError(_0x4bd77b,null));};exports[_0x0634('0x94')]=function(_0x1f9ec1,_0x15a093,_0x302932){var _0x36d05c,_0x511c99;return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x1f9ec1[_0x0634('0x52')]['id']}})['then'](handleEntityNotFound(_0x15a093,null))['then'](function(_0x776969){if(_0x776969){_0x511c99=_0x776969;return _0x776969['addAgents'](_0x1f9ec1[_0x0634('0x54')][_0x0634('0x83')],_[_0x0634('0x5b')](_0x1f9ec1[_0x0634('0x54')],[_0x0634('0x83'),'id'])||{})[_0x0634('0x95')](function(_0x3c7bf4){for(var _0x11b1ed=0x0;_0x11b1ed<_0x1f9ec1[_0x0634('0x54')][_0x0634('0x83')][_0x0634('0x45')];_0x11b1ed+=0x1){socket[_0x0634('0x80')](_0x0634('0x81'),{'UserId':Number(_0x1f9ec1[_0x0634('0x54')][_0x0634('0x83')][_0x11b1ed]),'VoiceQueueId':Number(_0x1f9ec1[_0x0634('0x52')]['id'])});}return _0x3c7bf4;});}})[_0x0634('0x29')](function(_0xa9b938){_0x36d05c=_0xa9b938||[];if(_0x511c99){return db['User'][_0x0634('0x4e')]({'where':{'id':_0x1f9ec1[_0x0634('0x54')]['ids']},'attributes':['id',_0x0634('0x37'),_0x0634('0x71'),'voicePause',_0x0634('0x72')],'raw':!![]});}})['then'](function(_0xaf54f4){if(!_[_0x0634('0x92')](_0xaf54f4)){var _0x4e7b17=[];for(var _0xff260c=0x0;_0xff260c<_0xaf54f4['length'];_0xff260c++){if(_0xaf54f4[_0xff260c]['online']){_0x4e7b17[_0x0634('0x96')](db[_0x0634('0x7c')]['upsert']({'membername':_0xaf54f4[_0xff260c][_0x0634('0x37')],'UserId':_0xaf54f4[_0xff260c]['id'],'queue_name':_0x511c99[_0x0634('0x37')],'VoiceQueueId':_0x511c99['id'],'interface':_[_0x0634('0x7d')](_0xaf54f4[_0xff260c][_0x0634('0x72')])?util[_0x0634('0x97')](_0x0634('0x7e'),_0xaf54f4[_0xff260c][_0x0634('0x37')]):_0xaf54f4[_0xff260c][_0x0634('0x72')],'paused':_0xaf54f4[_0xff260c][_0x0634('0x7f')]||![],'penalty':_0x1f9ec1[_0x0634('0x54')][_0x0634('0x75')]||0x0}));}}return BPromise[_0x0634('0x90')](_0x4e7b17);}})[_0x0634('0x29')](function(){return _0x36d05c;})[_0x0634('0x29')](respondWithResult(_0x15a093,null))[_0x0634('0x50')](handleError(_0x15a093,null));};exports[_0x0634('0x93')]=function(_0x286202,_0x27a389,_0x4925bb){return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x286202[_0x0634('0x52')]['id']}})['then'](handleEntityNotFound(_0x27a389,null))[_0x0634('0x29')](function(_0x3bbc14){if(_0x3bbc14){return _0x3bbc14[_0x0634('0x93')](_0x286202[_0x0634('0x40')]['ids'])['then'](function(){if(_[_0x0634('0x98')](_0x286202['query'][_0x0634('0x83')])){for(var _0x2da224=0x0;_0x2da224<_0x286202[_0x0634('0x40')][_0x0634('0x83')][_0x0634('0x45')];_0x2da224+=0x1){socket[_0x0634('0x80')](_0x0634('0x99'),{'UserId':Number(_0x286202[_0x0634('0x40')][_0x0634('0x83')][_0x2da224]),'VoiceQueueId':Number(_0x286202[_0x0634('0x52')]['id'])});}}else{socket['emit'](_0x0634('0x99'),{'UserId':Number(_0x286202[_0x0634('0x40')]['ids']),'VoiceQueueId':Number(_0x286202[_0x0634('0x52')]['id'])});}});}})[_0x0634('0x29')](function(_0x4d371a){return db['UserVoiceQueueRt'][_0x0634('0x2a')]({'where':{'VoiceQueueId':_0x286202[_0x0634('0x52')]['id'],'UserId':_0x286202['query']['ids']}})['then'](function(){return _0x4d371a;});})[_0x0634('0x29')](respondWithStatusCode(_0x27a389,null))[_0x0634('0x50')](handleError(_0x27a389,null));};exports[_0x0634('0x9a')]=function(_0xef8018,_0x3a5acd,_0x4a35e7){var _0x5d1526={};var _0x29ece9={};var _0x642e78;var _0x586429;return db['VoiceQueue'][_0x0634('0x63')]({'where':{'id':_0xef8018[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x3a5acd,null))['then'](function(_0x4b4fc0){if(_0x4b4fc0){_0x642e78=_0x4b4fc0;_0x29ece9[_0x0634('0x3e')]=_[_0x0634('0x3f')](db['User'][_0x0634('0x3c')]);_0x29ece9[_0x0634('0x40')]=_['keys'](_0xef8018[_0x0634('0x40')]);_0x29ece9['filters']=_['intersection'](_0x29ece9[_0x0634('0x3e')],_0x29ece9[_0x0634('0x40')]);_0x5d1526[_0x0634('0x43')]=_['intersection'](_0x29ece9['model'],qs[_0x0634('0x44')](_0xef8018[_0x0634('0x40')][_0x0634('0x44')]));_0x5d1526[_0x0634('0x43')]=_0x5d1526[_0x0634('0x43')][_0x0634('0x45')]?_0x5d1526['attributes']:_0x29ece9[_0x0634('0x3e')];_0x5d1526['order']=qs[_0x0634('0x49')](_0xef8018['query'][_0x0634('0x49')]);_0x5d1526[_0x0634('0x4a')]=qs[_0x0634('0x41')](_['pick'](_0xef8018['query'],_0x29ece9[_0x0634('0x41')]));if(_0xef8018[_0x0634('0x40')][_0x0634('0x30')]){_0x5d1526[_0x0634('0x4a')]=_['merge'](_0x5d1526[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x5d1526[_0x0634('0x43')],function(_0xb8d6db){var _0x3e3442={};_0x3e3442[_0xb8d6db]={'$like':'%'+_0xef8018[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x3e3442;})});}_0x5d1526=_[_0x0634('0x4b')]({},_0x5d1526,_0xef8018['options']);return _0x642e78[_0x0634('0x9a')](_0x5d1526);}})[_0x0634('0x29')](function(_0x19fd29){if(_0x19fd29){_0x586429=_0x19fd29[_0x0634('0x45')];if(!_0xef8018['query'][_0x0634('0x46')](_0x0634('0x47'))){_0x5d1526['limit']=qs['limit'](_0xef8018['query']['limit']);_0x5d1526[_0x0634('0x22')]=qs['offset'](_0xef8018[_0x0634('0x40')][_0x0634('0x22')]);}return _0x642e78[_0x0634('0x9a')](_0x5d1526);}})[_0x0634('0x29')](function(_0x32de78){if(_0x32de78){return _0x32de78?{'count':_0x586429,'rows':_0x32de78}:null;}})['then'](respondWithResult(_0x3a5acd,null))[_0x0634('0x50')](handleError(_0x3a5acd,null));};exports[_0x0634('0x9b')]=function(_0x1f13e9,_0x3f49de,_0x5f550a){var _0x3d7fd7={};var _0x54dc56={};var _0x1277f0;var _0x2a2afe;return db['VoiceQueue']['findOne']({'where':{'id':_0x1f13e9[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x3f49de,null))[_0x0634('0x29')](function(_0x42121e){if(_0x42121e){_0x1277f0=_0x42121e;_0x54dc56[_0x0634('0x3e')]=_[_0x0634('0x3f')](db[_0x0634('0x7c')]['rawAttributes']);_0x54dc56[_0x0634('0x40')]=_[_0x0634('0x3f')](_0x1f13e9[_0x0634('0x40')]);_0x54dc56[_0x0634('0x41')]=_['intersection'](_0x54dc56[_0x0634('0x3e')],_0x54dc56['query']);_0x3d7fd7['attributes']=_['intersection'](_0x54dc56['model'],qs[_0x0634('0x44')](_0x1f13e9[_0x0634('0x40')][_0x0634('0x44')]));_0x3d7fd7[_0x0634('0x43')]=_0x3d7fd7[_0x0634('0x43')][_0x0634('0x45')]?_0x3d7fd7[_0x0634('0x43')]:_0x54dc56['model'];_0x3d7fd7[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x1f13e9['query']['sort']);_0x3d7fd7[_0x0634('0x4a')]=qs[_0x0634('0x41')](_['pick'](_0x1f13e9[_0x0634('0x40')],_0x54dc56[_0x0634('0x41')]));if(_0x1f13e9[_0x0634('0x40')]['filter']){_0x3d7fd7['where']=_['merge'](_0x3d7fd7[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x3d7fd7[_0x0634('0x43')],function(_0x63a2c3){var _0x5d5ea0={};_0x5d5ea0[_0x63a2c3]={'$like':'%'+_0x1f13e9[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x5d5ea0;})});}_0x3d7fd7=_[_0x0634('0x4b')]({},_0x3d7fd7,_0x1f13e9[_0x0634('0x4c')]);return _0x1277f0[_0x0634('0x9b')](_0x3d7fd7);}})[_0x0634('0x29')](function(_0x45ccf7){if(_0x45ccf7){_0x2a2afe=_0x45ccf7[_0x0634('0x45')];if(!_0x1f13e9[_0x0634('0x40')][_0x0634('0x46')](_0x0634('0x47'))){_0x3d7fd7['limit']=qs[_0x0634('0x24')](_0x1f13e9['query']['limit']);_0x3d7fd7['offset']=qs[_0x0634('0x22')](_0x1f13e9[_0x0634('0x40')][_0x0634('0x22')]);}return _0x1277f0[_0x0634('0x9b')](_0x3d7fd7);}})[_0x0634('0x29')](function(_0x21a86c){return _0x21a86c?{'count':_0x2a2afe,'rows':_0x21a86c}:null;})[_0x0634('0x29')](respondWithResult(_0x3f49de,null))['catch'](handleError(_0x3f49de,null));};exports[_0x0634('0x9c')]=function(_0x3a8d0d,_0x1bc748,_0x308e82){var _0x3de25b={};var _0x24dec5={};var _0x4a37b3;var _0x319ab3;return db[_0x0634('0x3b')][_0x0634('0x63')]({'where':{'id':_0x3a8d0d[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x1bc748,null))[_0x0634('0x29')](function(_0x365ffa){if(_0x365ffa){_0x4a37b3=_0x365ffa;_0x24dec5['model']=_['keys'](db[_0x0634('0x9d')][_0x0634('0x3c')]);_0x24dec5[_0x0634('0x40')]=_['keys'](_0x3a8d0d[_0x0634('0x40')]);_0x24dec5['filters']=_[_0x0634('0x42')](_0x24dec5['model'],_0x24dec5[_0x0634('0x40')]);_0x3de25b[_0x0634('0x43')]=_['intersection'](_0x24dec5[_0x0634('0x3e')],qs[_0x0634('0x44')](_0x3a8d0d[_0x0634('0x40')][_0x0634('0x44')]));_0x3de25b[_0x0634('0x43')]=_0x3de25b[_0x0634('0x43')][_0x0634('0x45')]?_0x3de25b[_0x0634('0x43')]:_0x24dec5[_0x0634('0x3e')];_0x3de25b[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x3a8d0d['query'][_0x0634('0x49')]);_0x3de25b[_0x0634('0x4a')]=qs[_0x0634('0x41')](_[_0x0634('0x65')](_0x3a8d0d[_0x0634('0x40')],_0x24dec5[_0x0634('0x41')]));if(_0x3a8d0d[_0x0634('0x40')][_0x0634('0x30')]){_0x3de25b[_0x0634('0x4a')]=_[_0x0634('0x4b')](_0x3de25b[_0x0634('0x4a')],{'$or':_['map'](_0x3de25b['attributes'],function(_0x1834f1){var _0x54fefc={};_0x54fefc[_0x1834f1]={'$like':'%'+_0x3a8d0d[_0x0634('0x40')][_0x0634('0x30')]+'%'};return _0x54fefc;})});}_0x3de25b=_[_0x0634('0x4b')]({},_0x3de25b,_0x3a8d0d['options']);return _0x4a37b3[_0x0634('0x9c')](_0x3de25b);}})[_0x0634('0x29')](function(_0x245af8){if(_0x245af8){_0x319ab3=_0x245af8['length'];if(!_0x3a8d0d['query'][_0x0634('0x46')](_0x0634('0x47'))){_0x3de25b['limit']=qs['limit'](_0x3a8d0d[_0x0634('0x40')]['limit']);_0x3de25b[_0x0634('0x22')]=qs['offset'](_0x3a8d0d[_0x0634('0x40')]['offset']);}return _0x4a37b3['getLists'](_0x3de25b);}})['then'](function(_0x275f74){if(_0x275f74){return _0x275f74?{'count':_0x319ab3,'rows':_0x275f74}:null;}})[_0x0634('0x29')](respondWithResult(_0x1bc748,null))[_0x0634('0x50')](handleError(_0x1bc748,null));};exports['addLists']=function(_0x52980c,_0x5ad7a3,_0x18bed6){var _0x13d448,_0x547b2d;return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x52980c[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x5ad7a3,null))['then'](function(_0x439f0f){if(_0x439f0f){_0x547b2d=_0x439f0f;return _0x439f0f[_0x0634('0x9e')](_0x52980c['body'][_0x0634('0x83')],_['omit'](_0x52980c['body'],[_0x0634('0x83'),'id'])||{});}return null;})[_0x0634('0x95')](function(_0x26dd25){var _0x133783;_0x13d448=_0x26dd25||[];var _0x176c19=[];if(_0x26dd25){for(var _0x3b7746=0x0;_0x3b7746<_0x26dd25['length'];_0x3b7746+=0x1){var _0x42a3e8=_0x26dd25[_0x3b7746]['get']({'plain':!![]});_0x547b2d[_0x0634('0x9f')]=_0x52980c[_0x0634('0x54')][_0x0634('0x9f')]?_0x52980c[_0x0634('0x54')][_0x0634('0x9f')]:_0x547b2d[_0x0634('0x9f')];switch(_0x547b2d[_0x0634('0x9f')]){case _0x0634('0xa0'):_0x133783=squel[_0x0634('0xa1')]()[_0x0634('0xa2')](_0x0634('0xa3'))[_0x0634('0xa4')]([_0x0634('0xa5'),_0x0634('0xa6'),_0x0634('0xa7'),_0x0634('0xa8'),_0x0634('0x66'),_0x0634('0x5c'),'updatedAt'],squel[_0x0634('0xa9')]()[_0x0634('0x85')](_0x0634('0xa5'),_0x0634('0xa5'))[_0x0634('0x85')]('NOW()',_0x0634('0xa6'))[_0x0634('0x85')]('id',_0x0634('0xa7'))['field'](_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')](),'ListId')['field'](_0x52980c[_0x0634('0x52')]['id'][_0x0634('0xab')](),'VoiceQueueId')[_0x0634('0x85')](_0x0634('0xac'),_0x0634('0x5c'))[_0x0634('0x85')]('NOW()',_0x0634('0x5d'))[_0x0634('0x87')](_0x0634('0xad'))[_0x0634('0x4a')](_0x0634('0xae'))[_0x0634('0x4a')](_0x0634('0xaf'),_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')]())['where'](_0x0634('0xb0'))[_0x0634('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0634('0xa9')]()['field'](_0x0634('0xb1'))['from']('cm_hopper_final')[_0x0634('0x4a')](_0x0634('0x8a'),_0x52980c[_0x0634('0x52')]['id'][_0x0634('0xab')]()))['where'](_0x0634('0xb2'),squel[_0x0634('0xa9')]()['field']('COALESCE(phone,\x27\x27)')[_0x0634('0x87')](_0x0634('0xa3'))[_0x0634('0x4a')](_0x0634('0x8a'),_0x52980c[_0x0634('0x52')]['id'][_0x0634('0xab')]())))[_0x0634('0xab')]();break;case'onlyIfOpen':_0x133783=squel[_0x0634('0xa1')]()[_0x0634('0xa2')](_0x0634('0xa3'))[_0x0634('0xa4')]([_0x0634('0xa5'),_0x0634('0xa6'),'ContactId',_0x0634('0xa8'),_0x0634('0x66'),_0x0634('0x5c'),'updatedAt'],squel['select']()['field'](_0x0634('0xa5'),_0x0634('0xa5'))[_0x0634('0x85')](_0x0634('0xac'),_0x0634('0xa6'))[_0x0634('0x85')]('id',_0x0634('0xa7'))[_0x0634('0x85')](_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')](),_0x0634('0xa8'))[_0x0634('0x85')](_0x52980c['params']['id'][_0x0634('0xab')](),_0x0634('0x66'))[_0x0634('0x85')](_0x0634('0xac'),_0x0634('0x5c'))[_0x0634('0x85')](_0x0634('0xac'),_0x0634('0x5d'))[_0x0634('0x87')](_0x0634('0xad'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x0634('0xaf'),_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')]())[_0x0634('0x4a')](_0x0634('0xb0'))[_0x0634('0x4a')](_0x0634('0xb2'),squel[_0x0634('0xa9')]()['field'](_0x0634('0xb3'))[_0x0634('0x87')](_0x0634('0xa3'))['where'](_0x0634('0x8a'),_0x52980c[_0x0634('0x52')]['id'][_0x0634('0xab')]())))['toString']();break;default:_0x133783=squel[_0x0634('0xa1')]()[_0x0634('0xa2')]('cm_hopper')['fromQuery']([_0x0634('0xa5'),_0x0634('0xa6'),'ContactId','ListId','VoiceQueueId','createdAt',_0x0634('0x5d')],squel[_0x0634('0xa9')]()['field'](_0x0634('0xa5'),_0x0634('0xa5'))[_0x0634('0x85')]('NOW()','scheduledAt')[_0x0634('0x85')]('id',_0x0634('0xa7'))[_0x0634('0x85')](_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')](),_0x0634('0xa8'))[_0x0634('0x85')](_0x52980c[_0x0634('0x52')]['id'][_0x0634('0xab')](),'VoiceQueueId')[_0x0634('0x85')](_0x0634('0xac'),_0x0634('0x5c'))[_0x0634('0x85')]('NOW()',_0x0634('0x5d'))[_0x0634('0x87')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x0634('0x4a')](_0x0634('0xaf'),_0x42a3e8[_0x0634('0xaa')][_0x0634('0xab')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0634('0xab')]();}_0x176c19[_0x0634('0x96')](db[_0x0634('0x76')][_0x0634('0x40')](_0x133783));}return BPromise['all'](_0x176c19);}})[_0x0634('0x29')](function(){return _0x13d448;})[_0x0634('0x29')](respondWithResult(_0x5ad7a3,null))['catch'](handleError(_0x5ad7a3,null));};exports[_0x0634('0xb4')]=function(_0x38f7b6,_0x5bb422,_0xa08d69){return db[_0x0634('0x3b')]['find']({'where':{'id':_0x38f7b6[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x5bb422,null))['then'](function(_0x5567ad){if(_0x5567ad){return _0x5567ad[_0x0634('0xb4')](_0x38f7b6['query'][_0x0634('0x83')]);}})[_0x0634('0x29')](function(_0x590d02){if(_0x590d02){return db[_0x0634('0x64')][_0x0634('0x2a')]({'where':{'ListId':_0x38f7b6[_0x0634('0x40')][_0x0634('0x83')],'VoiceQueueId':_0x38f7b6['params']['id']}})[_0x0634('0x29')](function(){return _0x590d02;});}})[_0x0634('0x29')](respondWithStatusCode(_0x5bb422,null))['catch'](handleError(_0x5bb422,null));};exports['getBlackLists']=function(_0x29f65e,_0x2fae28,_0x1d2818){var _0x10c39c={};var _0x2f740f={};var _0x3367e4;var _0x5caeca;return db[_0x0634('0x3b')][_0x0634('0x63')]({'where':{'id':_0x29f65e[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x2fae28,null))[_0x0634('0x29')](function(_0x3663ea){if(_0x3663ea){_0x3367e4=_0x3663ea;_0x2f740f[_0x0634('0x3e')]=_[_0x0634('0x3f')](db[_0x0634('0x9d')][_0x0634('0x3c')]);_0x2f740f[_0x0634('0x40')]=_[_0x0634('0x3f')](_0x29f65e['query']);_0x2f740f[_0x0634('0x41')]=_[_0x0634('0x42')](_0x2f740f[_0x0634('0x3e')],_0x2f740f[_0x0634('0x40')]);_0x10c39c[_0x0634('0x43')]=_['intersection'](_0x2f740f[_0x0634('0x3e')],qs['fields'](_0x29f65e[_0x0634('0x40')]['fields']));_0x10c39c[_0x0634('0x43')]=_0x10c39c['attributes'][_0x0634('0x45')]?_0x10c39c['attributes']:_0x2f740f['model'];_0x10c39c[_0x0634('0x48')]=qs[_0x0634('0x49')](_0x29f65e[_0x0634('0x40')]['sort']);_0x10c39c['where']=qs[_0x0634('0x41')](_[_0x0634('0x65')](_0x29f65e[_0x0634('0x40')],_0x2f740f['filters']));if(_0x29f65e['query']['filter']){_0x10c39c[_0x0634('0x4a')]=_[_0x0634('0x4b')](_0x10c39c[_0x0634('0x4a')],{'$or':_[_0x0634('0x32')](_0x10c39c['attributes'],function(_0x13da61){var _0x3ecacd={};_0x3ecacd[_0x13da61]={'$like':'%'+_0x29f65e['query'][_0x0634('0x30')]+'%'};return _0x3ecacd;})});}_0x10c39c=_[_0x0634('0x4b')]({},_0x10c39c,_0x29f65e[_0x0634('0x4c')]);return _0x3367e4[_0x0634('0xb5')](_0x10c39c);}})[_0x0634('0x29')](function(_0x3ff0b2){if(_0x3ff0b2){_0x5caeca=_0x3ff0b2[_0x0634('0x45')];if(!_0x29f65e[_0x0634('0x40')][_0x0634('0x46')](_0x0634('0x47'))){_0x10c39c[_0x0634('0x24')]=qs['limit'](_0x29f65e['query'][_0x0634('0x24')]);_0x10c39c[_0x0634('0x22')]=qs['offset'](_0x29f65e[_0x0634('0x40')][_0x0634('0x22')]);}return _0x3367e4[_0x0634('0xb5')](_0x10c39c);}})[_0x0634('0x29')](function(_0x500da4){if(_0x500da4){return _0x500da4?{'count':_0x5caeca,'rows':_0x500da4}:null;}})[_0x0634('0x29')](respondWithResult(_0x2fae28,null))['catch'](handleError(_0x2fae28,null));};exports[_0x0634('0xb6')]=function(_0x3ee87f,_0x4b8b02,_0x5a5360){var _0x1b8637,_0x477021;return db[_0x0634('0x3b')][_0x0634('0x36')]({'where':{'id':_0x3ee87f[_0x0634('0x52')]['id']}})[_0x0634('0x29')](handleEntityNotFound(_0x4b8b02,null))['then'](function(_0x3da254){if(_0x3da254){_0x477021=_0x3da254;return _0x3da254['addBlackLists'](_0x3ee87f[_0x0634('0x54')][_0x0634('0x83')],_['omit'](_0x3ee87f['body'],[_0x0634('0x83'),'id'])||{});}return null;})[_0x0634('0x95')](function(_0x59ed97){var _0x5df1a6;_0x1b8637=_0x59ed97||[];var _0xe46360=[];if(_0x59ed97){for(var _0x4202f4=0x0;_0x4202f4<_0x59ed97['length'];_0x4202f4+=0x1){var _0x3f868a=_0x59ed97[_0x4202f4]['get']({'plain':!![]});_0x5df1a6=squel[_0x0634('0xa1')]()['into'](_0x0634('0xb7'))[_0x0634('0xa4')](['phone',_0x0634('0xa7'),_0x0634('0xa8'),'VoiceQueueId',_0x0634('0x5c'),_0x0634('0x5d')],squel[_0x0634('0xa9')]()['field']('phone',_0x0634('0xa5'))[_0x0634('0x85')]('id',_0x0634('0xa7'))['field'](_0x3f868a[_0x0634('0xaa')][_0x0634('0xab')](),'ListId')[_0x0634('0x85')](_0x3ee87f['params']['id'][_0x0634('0xab')](),_0x0634('0x66'))[_0x0634('0x85')]('NOW()',_0x0634('0x5c'))[_0x0634('0x85')]('NOW()',_0x0634('0x5d'))[_0x0634('0x87')](_0x0634('0xad'))[_0x0634('0x4a')](_0x0634('0xae'))[_0x0634('0x4a')](_0x0634('0xaf'),_0x3f868a[_0x0634('0xaa')][_0x0634('0xab')]())[_0x0634('0x4a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0xe46360[_0x0634('0x96')](db[_0x0634('0x76')][_0x0634('0x40')](_0x5df1a6));}return BPromise[_0x0634('0x90')](_0xe46360);}})[_0x0634('0x29')](function(){return _0x1b8637;})[_0x0634('0x29')](respondWithResult(_0x4b8b02,null))[_0x0634('0x50')](handleError(_0x4b8b02,null));};exports[_0x0634('0xb8')]=function(_0x5f275a,_0x593b3b,_0x25316d){return db['VoiceQueue']['find']({'where':{'id':_0x5f275a[_0x0634('0x52')]['id']}})['then'](handleEntityNotFound(_0x593b3b,null))[_0x0634('0x29')](function(_0x34efda){if(_0x34efda){return _0x34efda[_0x0634('0xb8')](_0x5f275a['query'][_0x0634('0x83')]);}})[_0x0634('0x29')](function(_0x3caa67){if(_0x3caa67){return db[_0x0634('0x6b')]['destroy']({'where':{'ListId':_0x5f275a['query'][_0x0634('0x83')],'VoiceQueueId':_0x5f275a[_0x0634('0x52')]['id']}})[_0x0634('0x29')](function(){return _0x3caa67;});}})[_0x0634('0x29')](respondWithStatusCode(_0x593b3b,null))[_0x0634('0x50')](handleError(_0x593b3b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6d691c2..767cef4 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 _0x13d1=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x435819,_0x5e35db){var _0x1bf766=function(_0x3ed522){while(--_0x3ed522){_0x435819['push'](_0x435819['shift']());}};_0x1bf766(++_0x5e35db);}(_0x13d1,0xa4));var _0x113d=function(_0xdc8da5,_0x49e809){_0xdc8da5=_0xdc8da5-0x0;var _0x27d466=_0x13d1[_0xdc8da5];return _0x27d466;};'use strict';var EventEmitter=require(_0x113d('0x0'));var VoiceQueue=require(_0x113d('0x1'))['db'][_0x113d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x113d('0x3')](0x0);var events={'afterCreate':_0x113d('0x4'),'afterUpdate':_0x113d('0x5'),'afterDestroy':_0x113d('0x6')};function emitEvent(_0x1a97bf){return function(_0x5b2d55,_0x57c404,_0x3db59f){VoiceQueueEvents[_0x113d('0x7')](_0x1a97bf+':'+_0x5b2d55['id'],_0x5b2d55);VoiceQueueEvents[_0x113d('0x7')](_0x1a97bf,_0x5b2d55);_0x3db59f(null);};}for(var e in events){if(events[_0x113d('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x113d('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xa35f=['remove','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x42d529,_0x2ff3ea){var _0x37167a=function(_0x85d39b){while(--_0x85d39b){_0x42d529['push'](_0x42d529['shift']());}};_0x37167a(++_0x2ff3ea);}(_0xa35f,0xe9));var _0xfa35=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xa35f[_0x580b15];return _0x1adb1b;};'use strict';var EventEmitter=require(_0xfa35('0x0'));var VoiceQueue=require(_0xfa35('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xfa35('0x2')](0x0);var events={'afterCreate':_0xfa35('0x3'),'afterUpdate':_0xfa35('0x4'),'afterDestroy':_0xfa35('0x5')};function emitEvent(_0x1d6b72){return function(_0x2fcd7d,_0x9aa08a,_0x1fd8c6){VoiceQueueEvents['emit'](_0x1d6b72+':'+_0x2fcd7d['id'],_0x2fcd7d);VoiceQueueEvents['emit'](_0x1d6b72,_0x2fcd7d);_0x1fd8c6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xfa35('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 3bf53a3..df648bd 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x3ffd40,_0x4c65b8){var _0x14309d=function(_0x48886e){while(--_0x48886e){_0x3ffd40['push'](_0x3ffd40['shift']());}};_0x14309d(++_0x4c65b8);}(_0x70e0,0x17b));var _0x070e=function(_0xc57b80,_0x157054){_0xc57b80=_0xc57b80-0x0;var _0x53f86a=_0x70e0[_0xc57b80];return _0x53f86a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x257544,_0x534546){var _0x3a90f5=function(_0x27c01c){while(--_0x27c01c){_0x257544['push'](_0x257544['shift']());}};_0x3a90f5(++_0x534546);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 135935e..f97ac33 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 _0x52fb=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','then','info','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','GetVoiceQueue','findAll','options','raw','attributes','limit','map','model','include','ShowVoiceQueue','VoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xfd8c4c,_0x563eed){var _0x58762=function(_0x1c41c4){while(--_0x1c41c4){_0xfd8c4c['push'](_0xfd8c4c['shift']());}};_0x58762(++_0x563eed);}(_0x52fb,0x6b));var _0xb52f=function(_0x341220,_0x56d7fc){_0x341220=_0x341220-0x0;var _0x1d6b64=_0x52fb[_0x341220];return _0x1d6b64;};'use strict';var _=require(_0xb52f('0x0'));var util=require('util');var moment=require(_0xb52f('0x1'));var BPromise=require(_0xb52f('0x2'));var rs=require(_0xb52f('0x3'));var fs=require('fs');var Redis=require(_0xb52f('0x4'));var db=require(_0xb52f('0x5'))['db'];var utils=require(_0xb52f('0x6'));var logger=require(_0xb52f('0x7'))('rpc');var config=require(_0xb52f('0x8'));var jayson=require(_0xb52f('0x9'));var client=jayson[_0xb52f('0xa')][_0xb52f('0xb')]({'port':0x232a});config['redis']=_[_0xb52f('0xc')](config[_0xb52f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xb52f('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x37e5f5,_0x53dfb5,_0x1833ad){return new BPromise(function(_0x2d819f,_0x440481){return client['request'](_0x37e5f5,_0x1833ad)[_0xb52f('0xf')](function(_0x568e1d){logger[_0xb52f('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x53dfb5,_0xb52f('0x11'));logger[_0xb52f('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x53dfb5,_0xb52f('0x11'),JSON[_0xb52f('0x13')](_0x568e1d));if(_0x568e1d[_0xb52f('0x14')]){if(_0x568e1d[_0xb52f('0x14')][_0xb52f('0x15')]===0x1f4){logger[_0xb52f('0x14')](_0xb52f('0x16'),_0x53dfb5,_0x568e1d['error'][_0xb52f('0x17')]);return _0x440481(_0x568e1d[_0xb52f('0x14')]['message']);}logger[_0xb52f('0x14')](_0xb52f('0x16'),_0x53dfb5,_0x568e1d[_0xb52f('0x14')][_0xb52f('0x17')]);return _0x2d819f(_0x568e1d[_0xb52f('0x14')][_0xb52f('0x17')]);}else{logger[_0xb52f('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x53dfb5,'request\x20sent');_0x2d819f(_0x568e1d[_0xb52f('0x18')][_0xb52f('0x17')]);}})['catch'](function(_0x2ead6b){logger['error'](_0xb52f('0x16'),_0x53dfb5,_0x2ead6b);_0x440481(_0x2ead6b);});});}exports[_0xb52f('0x19')]=function(_0x1e3efa){var _0x5979c1=this;return new Promise(function(_0x14ad9c,_0x3b19e9){return db['VoiceQueue'][_0xb52f('0x1a')]({'raw':_0x1e3efa[_0xb52f('0x1b')]?_0x1e3efa[_0xb52f('0x1b')][_0xb52f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e3efa['options']?_0x1e3efa[_0xb52f('0x1b')]['where']||null:null,'attributes':_0x1e3efa[_0xb52f('0x1b')]?_0x1e3efa[_0xb52f('0x1b')][_0xb52f('0x1d')]||null:null,'limit':_0x1e3efa[_0xb52f('0x1b')]?_0x1e3efa[_0xb52f('0x1b')][_0xb52f('0x1e')]||null:null,'include':_0x1e3efa['options']?_0x1e3efa[_0xb52f('0x1b')]['include']?_[_0xb52f('0x1f')](_0x1e3efa[_0xb52f('0x1b')]['include'],function(_0x2a558b){return{'model':db[_0x2a558b[_0xb52f('0x20')]],'as':_0x2a558b['as'],'attributes':_0x2a558b['attributes'],'include':_0x2a558b[_0xb52f('0x21')]?_['map'](_0x2a558b['include'],function(_0x20679f){return{'model':db[_0x20679f[_0xb52f('0x20')]],'as':_0x20679f['as'],'attributes':_0x20679f['attributes'],'include':_0x20679f[_0xb52f('0x21')]?_[_0xb52f('0x1f')](_0x20679f['include'],function(_0x486a39){return{'model':db[_0x486a39[_0xb52f('0x20')]],'as':_0x486a39['as'],'attributes':_0x486a39[_0xb52f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb52f('0xf')](function(_0x1ce11f){logger[_0xb52f('0x10')](_0xb52f('0x19'),_0x1e3efa);logger['debug']('GetVoiceQueue',_0x1e3efa,JSON[_0xb52f('0x13')](_0x1ce11f));_0x14ad9c(_0x1ce11f);})['catch'](function(_0x150c21){logger[_0xb52f('0x14')]('GetVoiceQueue',_0x150c21[_0xb52f('0x17')],_0x1e3efa);_0x3b19e9(_0x5979c1[_0xb52f('0x14')](0x1f4,_0x150c21['message']));});});};exports[_0xb52f('0x22')]=function(_0x97e61c){var _0x48a98a=this;return new Promise(function(_0xe3c71e,_0x10a8a7){return db[_0xb52f('0x23')][_0xb52f('0x24')]({'raw':_0x97e61c['options']?_0x97e61c['options'][_0xb52f('0x1c')]===undefined?!![]:![]:!![],'where':_0x97e61c['options']?_0x97e61c[_0xb52f('0x1b')][_0xb52f('0x25')]||null:null,'attributes':_0x97e61c[_0xb52f('0x1b')]?_0x97e61c[_0xb52f('0x1b')][_0xb52f('0x1d')]||null:null,'include':_0x97e61c[_0xb52f('0x1b')]?_0x97e61c[_0xb52f('0x1b')][_0xb52f('0x21')]?_[_0xb52f('0x1f')](_0x97e61c[_0xb52f('0x1b')][_0xb52f('0x21')],function(_0x2e165d){return{'model':db[_0x2e165d['model']],'as':_0x2e165d['as'],'attributes':_0x2e165d[_0xb52f('0x1d')],'include':_0x2e165d['include']?_[_0xb52f('0x1f')](_0x2e165d[_0xb52f('0x21')],function(_0x50f000){return{'model':db[_0x50f000[_0xb52f('0x20')]],'as':_0x50f000['as'],'attributes':_0x50f000[_0xb52f('0x1d')],'include':_0x50f000['include']?_[_0xb52f('0x1f')](_0x50f000[_0xb52f('0x21')],function(_0x2b9730){return{'model':db[_0x2b9730[_0xb52f('0x20')]],'as':_0x2b9730['as'],'attributes':_0x2b9730['attributes']};}):[]};}):[]};}):[]:[]})[_0xb52f('0xf')](function(_0x27bb65){logger[_0xb52f('0x10')]('ShowVoiceQueue',_0x97e61c);logger[_0xb52f('0x12')](_0xb52f('0x22'),_0x97e61c,JSON[_0xb52f('0x13')](_0x27bb65));_0xe3c71e(_0x27bb65);})['catch'](function(_0x4ae86f){logger[_0xb52f('0x14')](_0xb52f('0x22'),_0x4ae86f[_0xb52f('0x17')],_0x97e61c);_0x10a8a7(_0x48a98a[_0xb52f('0x14')](0x1f4,_0x4ae86f['message']));});});}; \ No newline at end of file +var _0x194e=['ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch'];(function(_0x323e3d,_0x27c504){var _0x941c8c=function(_0x32cf38){while(--_0x32cf38){_0x323e3d['push'](_0x323e3d['shift']());}};_0x941c8c(++_0x27c504);}(_0x194e,0x1a4));var _0xe194=function(_0x5dfe43,_0x296b36){_0x5dfe43=_0x5dfe43-0x0;var _0x3ce55b=_0x194e[_0x5dfe43];return _0x3ce55b;};'use strict';var _=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var moment=require(_0xe194('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe194('0x3'));var db=require(_0xe194('0x4'))['db'];var utils=require(_0xe194('0x5'));var logger=require(_0xe194('0x6'))('rpc');var config=require(_0xe194('0x7'));var jayson=require(_0xe194('0x8'));var client=jayson[_0xe194('0x9')]['http']({'port':0x232a});config[_0xe194('0xa')]=_['defaults'](config[_0xe194('0xa')],{'host':_0xe194('0xb'),'port':0x18eb});var socket=require(_0xe194('0xc'))(new Redis(config[_0xe194('0xa')]));require(_0xe194('0xd'))[_0xe194('0xe')](socket);function respondWithRpcPromise(_0x19a70e,_0x495f37,_0x2c159a){return new BPromise(function(_0x48aefb,_0x5a3c5e){return client['request'](_0x19a70e,_0x2c159a)[_0xe194('0xf')](function(_0x2ed12f){logger[_0xe194('0x10')](_0xe194('0x11'),_0x495f37,'request\x20sent');logger[_0xe194('0x12')](_0xe194('0x13'),_0x495f37,_0xe194('0x14'),JSON[_0xe194('0x15')](_0x2ed12f));if(_0x2ed12f['error']){if(_0x2ed12f['error']['code']===0x1f4){logger[_0xe194('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x495f37,_0x2ed12f['error'][_0xe194('0x17')]);return _0x5a3c5e(_0x2ed12f['error'][_0xe194('0x17')]);}logger[_0xe194('0x16')](_0xe194('0x11'),_0x495f37,_0x2ed12f['error'][_0xe194('0x17')]);return _0x48aefb(_0x2ed12f[_0xe194('0x16')]['message']);}else{logger[_0xe194('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x495f37,_0xe194('0x14'));_0x48aefb(_0x2ed12f[_0xe194('0x18')][_0xe194('0x17')]);}})['catch'](function(_0x1df5f4){logger[_0xe194('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x495f37,_0x1df5f4);_0x5a3c5e(_0x1df5f4);});});}exports[_0xe194('0x19')]=function(_0x5cd921){var _0x195ea5=this;return new Promise(function(_0x28186d,_0x3aa386){return db['VoiceQueue'][_0xe194('0x1a')]({'raw':_0x5cd921[_0xe194('0x1b')]?_0x5cd921['options'][_0xe194('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cd921[_0xe194('0x1b')]?_0x5cd921['options'][_0xe194('0x1d')]||null:null,'attributes':_0x5cd921['options']?_0x5cd921[_0xe194('0x1b')][_0xe194('0x1e')]||null:null,'limit':_0x5cd921[_0xe194('0x1b')]?_0x5cd921[_0xe194('0x1b')][_0xe194('0x1f')]||null:null,'include':_0x5cd921[_0xe194('0x1b')]?_0x5cd921['options'][_0xe194('0x20')]?_[_0xe194('0x21')](_0x5cd921[_0xe194('0x1b')][_0xe194('0x20')],function(_0x598ab2){return{'model':db[_0x598ab2[_0xe194('0x22')]],'as':_0x598ab2['as'],'attributes':_0x598ab2[_0xe194('0x1e')],'include':_0x598ab2[_0xe194('0x20')]?_[_0xe194('0x21')](_0x598ab2[_0xe194('0x20')],function(_0x1dc2e2){return{'model':db[_0x1dc2e2[_0xe194('0x22')]],'as':_0x1dc2e2['as'],'attributes':_0x1dc2e2[_0xe194('0x1e')],'include':_0x1dc2e2[_0xe194('0x20')]?_['map'](_0x1dc2e2[_0xe194('0x20')],function(_0x25c869){return{'model':db[_0x25c869['model']],'as':_0x25c869['as'],'attributes':_0x25c869['attributes']};}):[]};}):[]};}):[]:[]})[_0xe194('0xf')](function(_0x1438dd){logger[_0xe194('0x10')](_0xe194('0x19'),_0x5cd921);logger[_0xe194('0x12')]('GetVoiceQueue',_0x5cd921,JSON[_0xe194('0x15')](_0x1438dd));_0x28186d(_0x1438dd);})[_0xe194('0x23')](function(_0x411be4){logger['error']('GetVoiceQueue',_0x411be4[_0xe194('0x17')],_0x5cd921);_0x3aa386(_0x195ea5['error'](0x1f4,_0x411be4[_0xe194('0x17')]));});});};exports[_0xe194('0x24')]=function(_0x326a5c){var _0x588fc1=this;return new Promise(function(_0x315db5,_0xf1b228){return db[_0xe194('0x25')]['find']({'raw':_0x326a5c[_0xe194('0x1b')]?_0x326a5c[_0xe194('0x1b')][_0xe194('0x1c')]===undefined?!![]:![]:!![],'where':_0x326a5c[_0xe194('0x1b')]?_0x326a5c[_0xe194('0x1b')]['where']||null:null,'attributes':_0x326a5c[_0xe194('0x1b')]?_0x326a5c[_0xe194('0x1b')][_0xe194('0x1e')]||null:null,'include':_0x326a5c['options']?_0x326a5c['options'][_0xe194('0x20')]?_[_0xe194('0x21')](_0x326a5c[_0xe194('0x1b')][_0xe194('0x20')],function(_0x19f7d8){return{'model':db[_0x19f7d8['model']],'as':_0x19f7d8['as'],'attributes':_0x19f7d8['attributes'],'include':_0x19f7d8['include']?_[_0xe194('0x21')](_0x19f7d8[_0xe194('0x20')],function(_0x2ef92e){return{'model':db[_0x2ef92e[_0xe194('0x22')]],'as':_0x2ef92e['as'],'attributes':_0x2ef92e[_0xe194('0x1e')],'include':_0x2ef92e[_0xe194('0x20')]?_[_0xe194('0x21')](_0x2ef92e[_0xe194('0x20')],function(_0x11b291){return{'model':db[_0x11b291[_0xe194('0x22')]],'as':_0x11b291['as'],'attributes':_0x11b291[_0xe194('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59f19d){logger[_0xe194('0x10')](_0xe194('0x24'),_0x326a5c);logger[_0xe194('0x12')]('ShowVoiceQueue',_0x326a5c,JSON['stringify'](_0x59f19d));_0x315db5(_0x59f19d);})[_0xe194('0x23')](function(_0x3426e2){logger[_0xe194('0x16')]('ShowVoiceQueue',_0x3426e2['message'],_0x326a5c);_0xf1b228(_0x588fc1[_0xe194('0x16')](0x1f4,_0x3426e2[_0xe194('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d8fcefe..7341a58 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 _0x01c8=['save','remove','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x455bcf,_0x1392ec){var _0x55f9c9=function(_0x57f7d5){while(--_0x57f7d5){_0x455bcf['push'](_0x455bcf['shift']());}};_0x55f9c9(++_0x1392ec);}(_0x01c8,0x137));var _0x801c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x01c8[_0x2b4411];return _0x8e41ef;};'use strict';var VoiceQueueEvents=require(_0x801c('0x0'));var events=[_0x801c('0x1'),_0x801c('0x2'),'update'];function createListener(_0x5c043e,_0x92635f){return function(_0x2e791c){_0x92635f[_0x801c('0x3')](_0x5c043e,_0x2e791c);};}function removeListener(_0x3a9c19,_0x30a83b){return function(){VoiceQueueEvents[_0x801c('0x4')](_0x3a9c19,_0x30a83b);};}exports[_0x801c('0x5')]=function(_0x5cf0a5){for(var _0x5ba3ed=0x0,_0x30b070=events[_0x801c('0x6')];_0x5ba3ed<_0x30b070;_0x5ba3ed++){var _0x18a1ae=events[_0x5ba3ed];var _0x5968ff=createListener(_0x801c('0x7')+_0x18a1ae,_0x5cf0a5);VoiceQueueEvents['on'](_0x18a1ae,_0x5968ff);}}; \ No newline at end of file +var _0x6dd6=['save','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x18459b,_0x1f7bf2){var _0x5a9e6a=function(_0x5dc6e6){while(--_0x5dc6e6){_0x18459b['push'](_0x18459b['shift']());}};_0x5a9e6a(++_0x1f7bf2);}(_0x6dd6,0x18f));var _0x66dd=function(_0x4e82bb,_0x4c39d5){_0x4e82bb=_0x4e82bb-0x0;var _0x1b5ac5=_0x6dd6[_0x4e82bb];return _0x1b5ac5;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x66dd('0x0'),'remove',_0x66dd('0x1')];function createListener(_0x2076c9,_0x2f63d1){return function(_0x52e3f7){_0x2f63d1[_0x66dd('0x2')](_0x2076c9,_0x52e3f7);};}function removeListener(_0x44f8ed,_0x41ec6e){return function(){VoiceQueueEvents[_0x66dd('0x3')](_0x44f8ed,_0x41ec6e);};}exports[_0x66dd('0x4')]=function(_0x25cc55){for(var _0x11395b=0x0,_0x4b0a61=events[_0x66dd('0x5')];_0x11395b<_0x4b0a61;_0x11395b++){var _0x29126e=events[_0x11395b];var _0x488c4d=createListener(_0x66dd('0x6')+_0x29126e,_0x25cc55);VoiceQueueEvents['on'](_0x29126e,_0x488c4d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1993896..7edf5e1 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 _0xf117=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf117,0x122));var _0x7f11=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf117[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require(_0x7f11('0x0'));var path=require(_0x7f11('0x1'));var timeout=require(_0x7f11('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7f11('0x3'));var auth=require(_0x7f11('0x4'));var interaction=require(_0x7f11('0x5'));var config=require(_0x7f11('0x6'));var controller=require(_0x7f11('0x7'));router[_0x7f11('0x8')]('/',auth[_0x7f11('0x9')](),controller[_0x7f11('0xa')]);router[_0x7f11('0x8')](_0x7f11('0xb'),auth[_0x7f11('0x9')](),controller[_0x7f11('0xc')]);router['get']('/index',auth[_0x7f11('0x9')](),controller[_0x7f11('0xd')]);router[_0x7f11('0x8')](_0x7f11('0xe'),auth[_0x7f11('0x9')](),controller[_0x7f11('0xf')]);router[_0x7f11('0x10')]('/',auth[_0x7f11('0x9')](),controller['create']);router[_0x7f11('0x11')](_0x7f11('0xe'),auth[_0x7f11('0x9')](),controller[_0x7f11('0x12')]);router[_0x7f11('0x13')](_0x7f11('0xe'),auth[_0x7f11('0x9')](),controller[_0x7f11('0x14')]);module['exports']=router; \ No newline at end of file +var _0x2b08=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','destroy'];(function(_0x1a8a0d,_0x1f1952){var _0x58f766=function(_0x5f3359){while(--_0x5f3359){_0x1a8a0d['push'](_0x1a8a0d['shift']());}};_0x58f766(++_0x1f1952);}(_0x2b08,0x1cc));var _0x82b0=function(_0x1506a5,_0x52c429){_0x1506a5=_0x1506a5-0x0;var _0x70e4bb=_0x2b08[_0x1506a5];return _0x70e4bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x82b0('0x0'));var express=require(_0x82b0('0x1'));var router=express[_0x82b0('0x2')]();var fs_extra=require(_0x82b0('0x3'));var auth=require(_0x82b0('0x4'));var interaction=require(_0x82b0('0x5'));var config=require(_0x82b0('0x6'));var controller=require(_0x82b0('0x7'));router['get']('/',auth[_0x82b0('0x8')](),controller[_0x82b0('0x9')]);router[_0x82b0('0xa')](_0x82b0('0xb'),auth[_0x82b0('0x8')](),controller['describe']);router[_0x82b0('0xa')](_0x82b0('0xc'),auth[_0x82b0('0x8')](),controller[_0x82b0('0xd')]);router[_0x82b0('0xa')](_0x82b0('0xe'),auth[_0x82b0('0x8')](),controller['show']);router[_0x82b0('0xf')]('/',auth['isAuthenticated'](),controller[_0x82b0('0x10')]);router[_0x82b0('0x11')](_0x82b0('0xe'),auth[_0x82b0('0x8')](),controller[_0x82b0('0x12')]);router['delete'](_0x82b0('0xe'),auth[_0x82b0('0x8')](),controller[_0x82b0('0x13')]);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 79b670c..58590e3 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 _0xb86e=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER'];(function(_0x3e7b8b,_0x5e61e3){var _0x5d9024=function(_0x2372a1){while(--_0x2372a1){_0x3e7b8b['push'](_0x3e7b8b['shift']());}};_0x5d9024(++_0x5e61e3);}(_0xb86e,0x1c1));var _0xeb86=function(_0x316fae,_0x31caf1){_0x316fae=_0x316fae-0x0;var _0x13b2f3=_0xb86e[_0x316fae];return _0x13b2f3;};'use strict';var Sequelize=require(_0xeb86('0x0'));var moment=require(_0xeb86('0x1'));module[_0xeb86('0x2')]={'type':{'type':Sequelize[_0xeb86('0x3')]},'uniqueid':{'type':Sequelize[_0xeb86('0x3')]},'calleridnum':{'type':Sequelize[_0xeb86('0x3')]},'calleridname':{'type':Sequelize[_0xeb86('0x3')]},'queue':{'type':Sequelize[_0xeb86('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xeb86('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xeb86('0x4')],'set':function(_0x3d36a4){var _0x810473=moment(_0x3d36a4);var _0x4a9e25=moment(this['getDataValue'](_0xeb86('0x5')))['format'](_0xeb86('0x6'));var _0x31e826=_0x810473[_0xeb86('0x7')](_0x4a9e25,_0xeb86('0x8'));this[_0xeb86('0x9')](_0xeb86('0xa'),_0x3d36a4);this['setDataValue'](_0xeb86('0xb'),_0x31e826||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xeb86('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xeb86('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xeb86('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xeb86('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xeb86('0x3')],'comment':_0xeb86('0xd')},'originalposition':{'type':Sequelize[_0xeb86('0xe')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xeb86('0x3')]},'connectedlinename':{'type':Sequelize[_0xeb86('0x3')]},'accountcode':{'type':Sequelize[_0xeb86('0x3')]},'context':{'type':Sequelize[_0xeb86('0x3')]},'exten':{'type':Sequelize[_0xeb86('0x3')]},'priority':{'type':Sequelize[_0xeb86('0x3')]},'holdtime':{'type':Sequelize[_0xeb86('0xe')]},'mohtime':{'type':Sequelize[_0xeb86('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xeb86('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xeb86('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb86('0x3')],'comment':_0xeb86('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xeb86('0x3')]},'disposition':{'type':Sequelize[_0xeb86('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xeb86('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xeb86('0xe')],'defaultValue':0x0}}; \ No newline at end of file +var _0x17ce=['queuecallerjoinAt','format','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue'];(function(_0x4dc35f,_0x377c51){var _0x1f8820=function(_0x37c340){while(--_0x37c340){_0x4dc35f['push'](_0x4dc35f['shift']());}};_0x1f8820(++_0x377c51);}(_0x17ce,0x1bb));var _0xe17c=function(_0x1003a5,_0x1ecfd7){_0x1003a5=_0x1003a5-0x0;var _0x158863=_0x17ce[_0x1003a5];return _0x158863;};'use strict';var Sequelize=require(_0xe17c('0x0'));var moment=require(_0xe17c('0x1'));module['exports']={'type':{'type':Sequelize[_0xe17c('0x2')]},'uniqueid':{'type':Sequelize[_0xe17c('0x2')]},'calleridnum':{'type':Sequelize[_0xe17c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xe17c('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xe17c('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xe17c('0x3')],'set':function(_0x542a87){var _0x4a5505=moment(_0x542a87);var _0x443121=moment(this[_0xe17c('0x4')](_0xe17c('0x5')))[_0xe17c('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3d2a76=_0x4a5505[_0xe17c('0x7')](_0x443121,_0xe17c('0x8'));this[_0xe17c('0x9')](_0xe17c('0xa'),_0x542a87);this[_0xe17c('0x9')](_0xe17c('0xb'),_0x3d2a76||null);}},'position':{'type':Sequelize[_0xe17c('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xe17c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xe17c('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xe17c('0x3')]},'queuecallerexit':{'type':Sequelize[_0xe17c('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xe17c('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xe17c('0x2')],'comment':_0xe17c('0xe')},'originalposition':{'type':Sequelize[_0xe17c('0xc')]},'channel':{'type':Sequelize[_0xe17c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe17c('0x2')]},'connectedlinename':{'type':Sequelize[_0xe17c('0x2')]},'accountcode':{'type':Sequelize[_0xe17c('0x2')]},'context':{'type':Sequelize[_0xe17c('0x2')]},'exten':{'type':Sequelize[_0xe17c('0x2')]},'priority':{'type':Sequelize[_0xe17c('0x2')]},'holdtime':{'type':Sequelize[_0xe17c('0xc')]},'mohtime':{'type':Sequelize[_0xe17c('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe17c('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xe17c('0x2')]},'transfer':{'type':Sequelize[_0xe17c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe17c('0x2')],'comment':_0xe17c('0xf')},'transferexten':{'type':Sequelize[_0xe17c('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe17c('0x2')]},'disposition':{'type':Sequelize[_0xe17c('0x2')]},'secondDisposition':{'type':Sequelize[_0xe17c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe17c('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xe17c('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index de5d8d5..2bdd217 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 _0x791c=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','update','then','end','stack','name','send','index','map','VoiceQueueReport','fieldName','type','key','model','query','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','include','rows','show','params','rawAttributes','keys','attributes','includeAll','options','find','create','body','catch','destroy','describe','getVoiceQueuesReport','findAll','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3df977,_0x39dcc2){var _0x54868b=function(_0x3f0163){while(--_0x3f0163){_0x3df977['push'](_0x3df977['shift']());}};_0x54868b(++_0x39dcc2);}(_0x791c,0x1a5));var _0xc791=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x791c[_0x59b439];return _0x521ea3;};'use strict';var emlformat=require(_0xc791('0x0'));var rimraf=require(_0xc791('0x1'));var zipdir=require(_0xc791('0x2'));var jsonpatch=require(_0xc791('0x3'));var rp=require(_0xc791('0x4'));var moment=require(_0xc791('0x5'));var BPromise=require(_0xc791('0x6'));var Mustache=require(_0xc791('0x7'));var util=require(_0xc791('0x8'));var path=require(_0xc791('0x9'));var sox=require(_0xc791('0xa'));var csv=require('to-csv');var ejs=require(_0xc791('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc791('0xc'));var squel=require(_0xc791('0xd'));var crypto=require(_0xc791('0xe'));var jsforce=require(_0xc791('0xf'));var deskjs=require(_0xc791('0x10'));var toCsv=require(_0xc791('0x11'));var querystring=require('querystring');var Papa=require(_0xc791('0x12'));var Redis=require('ioredis');var authService=require(_0xc791('0x13'));var qs=require(_0xc791('0x14'));var as=require(_0xc791('0x15'));var hardwareService=require(_0xc791('0x16'));var logger=require(_0xc791('0x17'))('api');var utils=require(_0xc791('0x18'));var config=require(_0xc791('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc791('0x1a')]=_[_0xc791('0x1b')](config[_0xc791('0x1a')],{'host':_0xc791('0x1c'),'port':0x18eb});var socket=require(_0xc791('0x1d'))(new Redis(config[_0xc791('0x1a')]));require(_0xc791('0x1e'))[_0xc791('0x1f')](socket);function respondWithStatusCode(_0x2001a8,_0x57f402){_0x57f402=_0x57f402||0xcc;return function(_0x5c0c37){if(_0x5c0c37){return _0x2001a8[_0xc791('0x20')](_0x57f402);}return _0x2001a8[_0xc791('0x21')](_0x57f402)['end']();};}function respondWithResult(_0x5a170d,_0x5a66d0){_0x5a66d0=_0x5a66d0||0xc8;return function(_0x6aa254){if(_0x6aa254){return _0x5a170d[_0xc791('0x21')](_0x5a66d0)['json'](_0x6aa254);}};}function respondWithFilteredResult(_0x35b20b,_0x176c65){return function(_0x29b452){if(_0x29b452){var _0x507925=typeof _0x176c65[_0xc791('0x22')]==='undefined'&&typeof _0x176c65['limit']===_0xc791('0x23');var _0x1715f2=_0x29b452[_0xc791('0x24')];var _0x401b0c=_0x507925?0x0:_0x176c65[_0xc791('0x22')];var _0x459a01=_0x507925?_0x29b452[_0xc791('0x24')]:_0x176c65['offset']+_0x176c65[_0xc791('0x25')];var _0x3199c2;if(_0x459a01>=_0x1715f2){_0x459a01=_0x1715f2;_0x3199c2=0xc8;}else{_0x3199c2=0xce;}_0x35b20b[_0xc791('0x21')](_0x3199c2);return _0x35b20b[_0xc791('0x26')](_0xc791('0x27'),_0x401b0c+'-'+_0x459a01+'/'+_0x1715f2)['json'](_0x29b452);}return null;};}function patchUpdates(_0x439592){return function(_0x2de7e4){try{jsonpatch[_0xc791('0x28')](_0x2de7e4,_0x439592,!![]);}catch(_0xeceb91){return BPromise['reject'](_0xeceb91);}return _0x2de7e4['save']();};}function saveUpdates(_0x28514c,_0x2aa8b8){return function(_0x177157){if(_0x177157){return _0x177157[_0xc791('0x29')](_0x28514c)['then'](function(_0x1e6344){return _0x1e6344;});}return null;};}function removeEntity(_0x47fb69,_0x2e5f07){return function(_0x44268c){if(_0x44268c){return _0x44268c['destroy']()[_0xc791('0x2a')](function(){_0x47fb69[_0xc791('0x21')](0xcc)[_0xc791('0x2b')]();});}};}function handleEntityNotFound(_0x1ab971,_0x400d82){return function(_0x3300b9){if(!_0x3300b9){_0x1ab971[_0xc791('0x20')](0x194);}return _0x3300b9;};}function handleError(_0x323979,_0x14cbf8){_0x14cbf8=_0x14cbf8||0x1f4;return function(_0x47f07e){logger['error'](_0x47f07e[_0xc791('0x2c')]);if(_0x47f07e[_0xc791('0x2d')]){delete _0x47f07e['name'];}_0x323979['status'](_0x14cbf8)[_0xc791('0x2e')](_0x47f07e);};}exports[_0xc791('0x2f')]=function(_0x3d9caf,_0x47eebd){var _0x3aeb7f={},_0x1edde3={},_0x249a21={'count':0x0,'rows':[]};var _0x1f5fd6=_[_0xc791('0x30')](db[_0xc791('0x31')]['rawAttributes'],function(_0xfc1348){return{'name':_0xfc1348[_0xc791('0x32')],'type':_0xfc1348[_0xc791('0x33')][_0xc791('0x34')]};});_0x1edde3[_0xc791('0x35')]=_[_0xc791('0x30')](_0x1f5fd6,_0xc791('0x2d'));_0x1edde3[_0xc791('0x36')]=_['keys'](_0x3d9caf[_0xc791('0x36')]);_0x1edde3['filters']=_[_0xc791('0x37')](_0x1edde3[_0xc791('0x35')],_0x1edde3[_0xc791('0x36')]);_0x3aeb7f['attributes']=_['intersection'](_0x1edde3[_0xc791('0x35')],qs[_0xc791('0x38')](_0x3d9caf[_0xc791('0x36')][_0xc791('0x38')]));_0x3aeb7f['attributes']=_0x3aeb7f['attributes'][_0xc791('0x39')]?_0x3aeb7f['attributes']:_0x1edde3[_0xc791('0x35')];if(!_0x3d9caf[_0xc791('0x36')][_0xc791('0x3a')](_0xc791('0x3b'))){_0x3aeb7f[_0xc791('0x25')]=qs[_0xc791('0x25')](_0x3d9caf[_0xc791('0x36')][_0xc791('0x25')]);_0x3aeb7f['offset']=qs[_0xc791('0x22')](_0x3d9caf[_0xc791('0x36')][_0xc791('0x22')]);}_0x3aeb7f[_0xc791('0x3c')]=qs['sort'](_0x3d9caf[_0xc791('0x36')][_0xc791('0x3d')]);_0x3aeb7f[_0xc791('0x3e')]=qs[_0xc791('0x3f')](_[_0xc791('0x40')](_0x3d9caf[_0xc791('0x36')],_0x1edde3['filters']),_0x1f5fd6);if(_0x3d9caf['query']['filter']){_0x3aeb7f[_0xc791('0x3e')]=_['merge'](_0x3aeb7f[_0xc791('0x3e')],{'$or':_[_0xc791('0x30')](_0x1f5fd6,function(_0x33391d){if(_0x33391d[_0xc791('0x33')]!==_0xc791('0x41')){var _0x385e62={};_0x385e62[_0x33391d[_0xc791('0x2d')]]={'$like':'%'+_0x3d9caf[_0xc791('0x36')][_0xc791('0x42')]+'%'};return _0x385e62;}})});}_0x3aeb7f=_[_0xc791('0x43')]({},_0x3aeb7f,_0x3d9caf['options']);var _0x4a3b8e={'where':_0x3aeb7f[_0xc791('0x3e')]};return db[_0xc791('0x31')]['count'](_0x4a3b8e)['then'](function(_0xca023c){_0x249a21[_0xc791('0x24')]=_0xca023c;if(_0x3d9caf['query']['includeAll']){_0x3aeb7f[_0xc791('0x44')]=[{'all':!![]}];}return db[_0xc791('0x31')]['findAll'](_0x3aeb7f);})[_0xc791('0x2a')](function(_0x5add30){_0x249a21[_0xc791('0x45')]=_0x5add30;return _0x249a21;})[_0xc791('0x2a')](respondWithFilteredResult(_0x47eebd,_0x3aeb7f))['catch'](handleError(_0x47eebd,null));};exports[_0xc791('0x46')]=function(_0x405eae,_0x48cd98){var _0x234bfd={'raw':![],'where':{'id':_0x405eae[_0xc791('0x47')]['id']}},_0x57301c={};_0x57301c[_0xc791('0x35')]=_['keys'](db[_0xc791('0x31')][_0xc791('0x48')]);_0x57301c[_0xc791('0x36')]=_[_0xc791('0x49')](_0x405eae['query']);_0x57301c['filters']=_[_0xc791('0x37')](_0x57301c[_0xc791('0x35')],_0x57301c[_0xc791('0x36')]);_0x234bfd[_0xc791('0x4a')]=_[_0xc791('0x37')](_0x57301c['model'],qs[_0xc791('0x38')](_0x405eae['query']['fields']));_0x234bfd[_0xc791('0x4a')]=_0x234bfd[_0xc791('0x4a')]['length']?_0x234bfd['attributes']:_0x57301c[_0xc791('0x35')];if(_0x405eae[_0xc791('0x36')][_0xc791('0x4b')]){_0x234bfd[_0xc791('0x44')]=[{'all':!![]}];}_0x234bfd=_[_0xc791('0x43')]({},_0x234bfd,_0x405eae[_0xc791('0x4c')]);return db[_0xc791('0x31')][_0xc791('0x4d')](_0x234bfd)[_0xc791('0x2a')](handleEntityNotFound(_0x48cd98,null))['then'](respondWithResult(_0x48cd98,null))['catch'](handleError(_0x48cd98,null));};exports[_0xc791('0x4e')]=function(_0xe150dd,_0x5b4c4f){return db[_0xc791('0x31')][_0xc791('0x4e')](_0xe150dd[_0xc791('0x4f')],{})[_0xc791('0x2a')](respondWithResult(_0x5b4c4f,0xc9))[_0xc791('0x50')](handleError(_0x5b4c4f,null));};exports[_0xc791('0x29')]=function(_0x596f96,_0x4734cc){if(_0x596f96[_0xc791('0x4f')]['id']){delete _0x596f96['body']['id'];}return db[_0xc791('0x31')][_0xc791('0x4d')]({'where':{'id':_0x596f96[_0xc791('0x47')]['id']}})['then'](handleEntityNotFound(_0x4734cc,null))[_0xc791('0x2a')](saveUpdates(_0x596f96[_0xc791('0x4f')],null))[_0xc791('0x2a')](respondWithResult(_0x4734cc,null))[_0xc791('0x50')](handleError(_0x4734cc,null));};exports[_0xc791('0x51')]=function(_0x4ef205,_0x595c1e){return db['VoiceQueueReport'][_0xc791('0x4d')]({'where':{'id':_0x4ef205[_0xc791('0x47')]['id']}})[_0xc791('0x2a')](handleEntityNotFound(_0x595c1e,null))[_0xc791('0x2a')](removeEntity(_0x595c1e,null))[_0xc791('0x50')](handleError(_0x595c1e,null));};exports[_0xc791('0x52')]=function(_0x5477ae,_0x46a032){return db[_0xc791('0x31')][_0xc791('0x52')]()[_0xc791('0x2a')](respondWithResult(_0x46a032,null))[_0xc791('0x50')](handleError(_0x46a032,null));};exports[_0xc791('0x53')]=function(_0x4c8142,_0x8724b2){var _0x3e72d7={},_0x21239e={},_0x342478={'count':0x0,'rows':[]};_0x21239e[_0xc791('0x35')]=_[_0xc791('0x49')](db[_0xc791('0x31')]['rawAttributes']);_0x21239e['query']=_[_0xc791('0x49')](_0x4c8142['query']);_0x21239e['filters']=_[_0xc791('0x37')](_0x21239e[_0xc791('0x35')],_0x21239e[_0xc791('0x36')]);_0x3e72d7['attributes']=_[_0xc791('0x37')](_0x21239e['model'],qs[_0xc791('0x38')](_0x4c8142[_0xc791('0x36')][_0xc791('0x38')]));_0x3e72d7['attributes']=_0x3e72d7[_0xc791('0x4a')][_0xc791('0x39')]?_0x3e72d7['attributes']:_0x21239e['model'];if(!_0x4c8142[_0xc791('0x36')][_0xc791('0x3a')](_0xc791('0x3b'))){_0x3e72d7['limit']=qs[_0xc791('0x25')](_0x4c8142[_0xc791('0x36')][_0xc791('0x25')]);_0x3e72d7['offset']=qs[_0xc791('0x22')](_0x4c8142['query'][_0xc791('0x22')]);}_0x3e72d7[_0xc791('0x3c')]=qs['sort'](_0x4c8142[_0xc791('0x36')][_0xc791('0x3d')]);_0x3e72d7[_0xc791('0x3e')]=qs[_0xc791('0x3f')](_['pick'](_0x4c8142[_0xc791('0x36')],_0x21239e[_0xc791('0x3f')]));if(_0x4c8142[_0xc791('0x36')]['filter']){_0x3e72d7[_0xc791('0x3e')]=_['merge'](_0x3e72d7['where'],{'$or':_['map'](_0x3e72d7[_0xc791('0x4a')],function(_0x2f113b){var _0xf08c62={};_0xf08c62[_0x2f113b]={'$like':'%'+_0x4c8142[_0xc791('0x36')]['filter']+'%'};return _0xf08c62;})});}_0x3e72d7=_[_0xc791('0x43')]({},_0x3e72d7,_0x4c8142[_0xc791('0x4c')]);var _0x1f1c08={'where':_0x3e72d7['where']};return db[_0xc791('0x31')]['count'](_0x1f1c08)[_0xc791('0x2a')](function(_0x12a45d){_0x342478[_0xc791('0x24')]=_0x12a45d;if(_0x4c8142[_0xc791('0x36')][_0xc791('0x4b')]){_0x3e72d7[_0xc791('0x44')]=[{'all':!![]}];}return db[_0xc791('0x31')][_0xc791('0x54')](_0x3e72d7);})['then'](function(_0x7dc2b){_0x342478[_0xc791('0x45')]=_0x7dc2b;return _0x342478;})[_0xc791('0x2a')](respondWithFilteredResult(_0x8724b2,_0x3e72d7,'getVoiceQueuesReport'))[_0xc791('0x50')](handleError(_0x8724b2,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x301a=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','register','status','end','limit','undefined','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','catch','show','params','include','merge','options','find','create','update','body','getVoiceQueuesReport','order','findAll','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x301a,0x17e));var _0xa301=function(_0x4642d2,_0x4cb1de){_0x4642d2=_0x4642d2-0x0;var _0xa77cf1=_0x301a[_0x4642d2];return _0xa77cf1;};'use strict';var emlformat=require(_0xa301('0x0'));var rimraf=require(_0xa301('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa301('0x2'));var rp=require(_0xa301('0x3'));var moment=require(_0xa301('0x4'));var BPromise=require(_0xa301('0x5'));var Mustache=require(_0xa301('0x6'));var util=require(_0xa301('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa301('0x8'));var ejs=require(_0xa301('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa301('0xa'));var squel=require('squel');var crypto=require(_0xa301('0xb'));var jsforce=require(_0xa301('0xc'));var deskjs=require(_0xa301('0xd'));var toCsv=require(_0xa301('0x8'));var querystring=require(_0xa301('0xe'));var Papa=require(_0xa301('0xf'));var Redis=require(_0xa301('0x10'));var authService=require(_0xa301('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa301('0x12'));var logger=require(_0xa301('0x13'))(_0xa301('0x14'));var utils=require(_0xa301('0x15'));var config=require(_0xa301('0x16'));var licenseUtil=require(_0xa301('0x17'));var db=require(_0xa301('0x18'))['db'];config[_0xa301('0x19')]=_['defaults'](config[_0xa301('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa301('0x19')]));require('./voiceQueueReport.socket')[_0xa301('0x1a')](socket);function respondWithStatusCode(_0x4e25a1,_0x44edb5){_0x44edb5=_0x44edb5||0xcc;return function(_0x593903){if(_0x593903){return _0x4e25a1['sendStatus'](_0x44edb5);}return _0x4e25a1[_0xa301('0x1b')](_0x44edb5)[_0xa301('0x1c')]();};}function respondWithResult(_0x19e772,_0x5b3f35){_0x5b3f35=_0x5b3f35||0xc8;return function(_0x526321){if(_0x526321){return _0x19e772[_0xa301('0x1b')](_0x5b3f35)['json'](_0x526321);}};}function respondWithFilteredResult(_0x12883a,_0x3eb26f){return function(_0x461a3b){if(_0x461a3b){var _0xa1ed62=typeof _0x3eb26f['offset']==='undefined'&&typeof _0x3eb26f[_0xa301('0x1d')]===_0xa301('0x1e');var _0x5ad4f1=_0x461a3b[_0xa301('0x1f')];var _0x115ace=_0xa1ed62?0x0:_0x3eb26f[_0xa301('0x20')];var _0x5094fa=_0xa1ed62?_0x461a3b[_0xa301('0x1f')]:_0x3eb26f[_0xa301('0x20')]+_0x3eb26f[_0xa301('0x1d')];var _0x5e6f03;if(_0x5094fa>=_0x5ad4f1){_0x5094fa=_0x5ad4f1;_0x5e6f03=0xc8;}else{_0x5e6f03=0xce;}_0x12883a[_0xa301('0x1b')](_0x5e6f03);return _0x12883a[_0xa301('0x21')](_0xa301('0x22'),_0x115ace+'-'+_0x5094fa+'/'+_0x5ad4f1)['json'](_0x461a3b);}return null;};}function patchUpdates(_0x5a266d){return function(_0x401967){try{jsonpatch['apply'](_0x401967,_0x5a266d,!![]);}catch(_0x3b2bee){return BPromise[_0xa301('0x23')](_0x3b2bee);}return _0x401967[_0xa301('0x24')]();};}function saveUpdates(_0x43a78b,_0x4e4885){return function(_0x50cfdd){if(_0x50cfdd){return _0x50cfdd['update'](_0x43a78b)[_0xa301('0x25')](function(_0x30b9fd){return _0x30b9fd;});}return null;};}function removeEntity(_0x1f2f95,_0x324db9){return function(_0x5e472d){if(_0x5e472d){return _0x5e472d[_0xa301('0x26')]()[_0xa301('0x25')](function(){_0x1f2f95['status'](0xcc)[_0xa301('0x1c')]();});}};}function handleEntityNotFound(_0x18ea55,_0x52c67b){return function(_0x30f763){if(!_0x30f763){_0x18ea55[_0xa301('0x27')](0x194);}return _0x30f763;};}function handleError(_0x41da73,_0x5f2ccf){_0x5f2ccf=_0x5f2ccf||0x1f4;return function(_0x54cf6b){logger[_0xa301('0x28')](_0x54cf6b['stack']);if(_0x54cf6b[_0xa301('0x29')]){delete _0x54cf6b[_0xa301('0x29')];}_0x41da73[_0xa301('0x1b')](_0x5f2ccf)[_0xa301('0x2a')](_0x54cf6b);};}exports[_0xa301('0x2b')]=function(_0x388a23,_0x1649e9){var _0x2c6253={},_0x313839={},_0x59376c={'count':0x0,'rows':[]};var _0x1da2eb=_[_0xa301('0x2c')](db[_0xa301('0x2d')][_0xa301('0x2e')],function(_0xf57335){return{'name':_0xf57335['fieldName'],'type':_0xf57335[_0xa301('0x2f')]['key']};});_0x313839[_0xa301('0x30')]=_[_0xa301('0x2c')](_0x1da2eb,_0xa301('0x29'));_0x313839[_0xa301('0x31')]=_[_0xa301('0x32')](_0x388a23[_0xa301('0x31')]);_0x313839[_0xa301('0x33')]=_[_0xa301('0x34')](_0x313839[_0xa301('0x30')],_0x313839[_0xa301('0x31')]);_0x2c6253['attributes']=_['intersection'](_0x313839[_0xa301('0x30')],qs[_0xa301('0x35')](_0x388a23['query']['fields']));_0x2c6253['attributes']=_0x2c6253[_0xa301('0x36')][_0xa301('0x37')]?_0x2c6253[_0xa301('0x36')]:_0x313839['model'];if(!_0x388a23[_0xa301('0x31')][_0xa301('0x38')](_0xa301('0x39'))){_0x2c6253['limit']=qs[_0xa301('0x1d')](_0x388a23['query'][_0xa301('0x1d')]);_0x2c6253[_0xa301('0x20')]=qs['offset'](_0x388a23[_0xa301('0x31')][_0xa301('0x20')]);}_0x2c6253['order']=qs[_0xa301('0x3a')](_0x388a23[_0xa301('0x31')]['sort']);_0x2c6253[_0xa301('0x3b')]=qs[_0xa301('0x33')](_[_0xa301('0x3c')](_0x388a23[_0xa301('0x31')],_0x313839[_0xa301('0x33')]),_0x1da2eb);if(_0x388a23[_0xa301('0x31')][_0xa301('0x3d')]){_0x2c6253[_0xa301('0x3b')]=_['merge'](_0x2c6253[_0xa301('0x3b')],{'$or':_[_0xa301('0x2c')](_0x1da2eb,function(_0x5c04a7){if(_0x5c04a7[_0xa301('0x2f')]!==_0xa301('0x3e')){var _0x4615bc={};_0x4615bc[_0x5c04a7[_0xa301('0x29')]]={'$like':'%'+_0x388a23['query'][_0xa301('0x3d')]+'%'};return _0x4615bc;}})});}_0x2c6253=_['merge']({},_0x2c6253,_0x388a23['options']);var _0xafcb7c={'where':_0x2c6253[_0xa301('0x3b')]};return db[_0xa301('0x2d')][_0xa301('0x1f')](_0xafcb7c)[_0xa301('0x25')](function(_0x10a387){_0x59376c[_0xa301('0x1f')]=_0x10a387;if(_0x388a23['query'][_0xa301('0x3f')]){_0x2c6253['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2c6253);})['then'](function(_0x3b75dc){_0x59376c['rows']=_0x3b75dc;return _0x59376c;})[_0xa301('0x25')](respondWithFilteredResult(_0x1649e9,_0x2c6253))[_0xa301('0x40')](handleError(_0x1649e9,null));};exports[_0xa301('0x41')]=function(_0x2466ec,_0x830df1){var _0x4fdb21={'raw':![],'where':{'id':_0x2466ec[_0xa301('0x42')]['id']}},_0xfcf36={};_0xfcf36[_0xa301('0x30')]=_['keys'](db[_0xa301('0x2d')][_0xa301('0x2e')]);_0xfcf36[_0xa301('0x31')]=_['keys'](_0x2466ec[_0xa301('0x31')]);_0xfcf36[_0xa301('0x33')]=_[_0xa301('0x34')](_0xfcf36[_0xa301('0x30')],_0xfcf36['query']);_0x4fdb21[_0xa301('0x36')]=_[_0xa301('0x34')](_0xfcf36[_0xa301('0x30')],qs[_0xa301('0x35')](_0x2466ec['query'][_0xa301('0x35')]));_0x4fdb21[_0xa301('0x36')]=_0x4fdb21[_0xa301('0x36')]['length']?_0x4fdb21[_0xa301('0x36')]:_0xfcf36['model'];if(_0x2466ec['query'][_0xa301('0x3f')]){_0x4fdb21[_0xa301('0x43')]=[{'all':!![]}];}_0x4fdb21=_[_0xa301('0x44')]({},_0x4fdb21,_0x2466ec[_0xa301('0x45')]);return db[_0xa301('0x2d')][_0xa301('0x46')](_0x4fdb21)[_0xa301('0x25')](handleEntityNotFound(_0x830df1,null))[_0xa301('0x25')](respondWithResult(_0x830df1,null))['catch'](handleError(_0x830df1,null));};exports[_0xa301('0x47')]=function(_0x27fcf9,_0x127468){return db[_0xa301('0x2d')]['create'](_0x27fcf9['body'],{})['then'](respondWithResult(_0x127468,0xc9))['catch'](handleError(_0x127468,null));};exports[_0xa301('0x48')]=function(_0x2ef5e5,_0xa2d27d){if(_0x2ef5e5[_0xa301('0x49')]['id']){delete _0x2ef5e5[_0xa301('0x49')]['id'];}return db['VoiceQueueReport'][_0xa301('0x46')]({'where':{'id':_0x2ef5e5['params']['id']}})[_0xa301('0x25')](handleEntityNotFound(_0xa2d27d,null))[_0xa301('0x25')](saveUpdates(_0x2ef5e5[_0xa301('0x49')],null))[_0xa301('0x25')](respondWithResult(_0xa2d27d,null))['catch'](handleError(_0xa2d27d,null));};exports[_0xa301('0x26')]=function(_0x12cf4c,_0x5d8f1a){return db[_0xa301('0x2d')][_0xa301('0x46')]({'where':{'id':_0x12cf4c['params']['id']}})[_0xa301('0x25')](handleEntityNotFound(_0x5d8f1a,null))[_0xa301('0x25')](removeEntity(_0x5d8f1a,null))[_0xa301('0x40')](handleError(_0x5d8f1a,null));};exports['describe']=function(_0xcb9ac9,_0x316b7f){return db[_0xa301('0x2d')]['describe']()[_0xa301('0x25')](respondWithResult(_0x316b7f,null))[_0xa301('0x40')](handleError(_0x316b7f,null));};exports[_0xa301('0x4a')]=function(_0xc71874,_0x185517){var _0x273ae6={},_0x328216={},_0x41a9d4={'count':0x0,'rows':[]};_0x328216[_0xa301('0x30')]=_[_0xa301('0x32')](db[_0xa301('0x2d')]['rawAttributes']);_0x328216[_0xa301('0x31')]=_[_0xa301('0x32')](_0xc71874[_0xa301('0x31')]);_0x328216[_0xa301('0x33')]=_['intersection'](_0x328216[_0xa301('0x30')],_0x328216[_0xa301('0x31')]);_0x273ae6[_0xa301('0x36')]=_['intersection'](_0x328216['model'],qs[_0xa301('0x35')](_0xc71874['query'][_0xa301('0x35')]));_0x273ae6[_0xa301('0x36')]=_0x273ae6[_0xa301('0x36')][_0xa301('0x37')]?_0x273ae6[_0xa301('0x36')]:_0x328216[_0xa301('0x30')];if(!_0xc71874['query']['hasOwnProperty'](_0xa301('0x39'))){_0x273ae6[_0xa301('0x1d')]=qs['limit'](_0xc71874['query'][_0xa301('0x1d')]);_0x273ae6[_0xa301('0x20')]=qs['offset'](_0xc71874['query'][_0xa301('0x20')]);}_0x273ae6[_0xa301('0x4b')]=qs[_0xa301('0x3a')](_0xc71874['query'][_0xa301('0x3a')]);_0x273ae6['where']=qs['filters'](_[_0xa301('0x3c')](_0xc71874[_0xa301('0x31')],_0x328216[_0xa301('0x33')]));if(_0xc71874['query'][_0xa301('0x3d')]){_0x273ae6[_0xa301('0x3b')]=_[_0xa301('0x44')](_0x273ae6['where'],{'$or':_[_0xa301('0x2c')](_0x273ae6[_0xa301('0x36')],function(_0x4886a8){var _0x437d9d={};_0x437d9d[_0x4886a8]={'$like':'%'+_0xc71874[_0xa301('0x31')][_0xa301('0x3d')]+'%'};return _0x437d9d;})});}_0x273ae6=_[_0xa301('0x44')]({},_0x273ae6,_0xc71874[_0xa301('0x45')]);var _0x500e2b={'where':_0x273ae6[_0xa301('0x3b')]};return db[_0xa301('0x2d')]['count'](_0x500e2b)[_0xa301('0x25')](function(_0x2b1f2c){_0x41a9d4['count']=_0x2b1f2c;if(_0xc71874[_0xa301('0x31')][_0xa301('0x3f')]){_0x273ae6[_0xa301('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa301('0x4c')](_0x273ae6);})[_0xa301('0x25')](function(_0x5126d5){_0x41a9d4[_0xa301('0x4d')]=_0x5126d5;return _0x41a9d4;})[_0xa301('0x25')](respondWithFilteredResult(_0x185517,_0x273ae6,'getVoiceQueuesReport'))[_0xa301('0x40')](handleError(_0x185517,null,_0xa301('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 616407f..8ddaa36 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 _0xc305=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xc305,0x7b));var _0x5c30=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xc305[_0x4063a4];return _0x17908d;};'use strict';var EventEmitter=require(_0x5c30('0x0'));var VoiceQueueReport=require(_0x5c30('0x1'))['db'][_0x5c30('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5c30('0x3')](0x0);var events={'afterCreate':_0x5c30('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3d4bfc){return function(_0x417c68,_0x2c79b3,_0x35ea6e){VoiceQueueReportEvents[_0x5c30('0x5')](_0x3d4bfc+':'+_0x417c68['id'],_0x417c68);VoiceQueueReportEvents[_0x5c30('0x5')](_0x3d4bfc,_0x417c68);_0x35ea6e(null);};}for(var e in events){if(events[_0x5c30('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5c30('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xc567=['remove','emit','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x105ce8,_0x4b204c){var _0x4a3b53=function(_0x15e6ac){while(--_0x15e6ac){_0x105ce8['push'](_0x105ce8['shift']());}};_0x4a3b53(++_0x4b204c);}(_0xc567,0xc1));var _0x7c56=function(_0x19ab1c,_0x2c866f){_0x19ab1c=_0x19ab1c-0x0;var _0x35d9c2=_0xc567[_0x19ab1c];return _0x35d9c2;};'use strict';var EventEmitter=require(_0x7c56('0x0'));var VoiceQueueReport=require(_0x7c56('0x1'))['db'][_0x7c56('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7c56('0x3')};function emitEvent(_0x1a6d5c){return function(_0x21b779,_0x189888,_0x414494){VoiceQueueReportEvents['emit'](_0x1a6d5c+':'+_0x21b779['id'],_0x21b779);VoiceQueueReportEvents[_0x7c56('0x4')](_0x1a6d5c,_0x21b779);_0x414494(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x7c56('0x5')](e,emitEvent(event));}}module[_0x7c56('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a9ff653..19c5e15 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 _0xac3f=['calleridnum','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid'];(function(_0x4f35d2,_0x2e06eb){var _0x327257=function(_0x312044){while(--_0x312044){_0x4f35d2['push'](_0x4f35d2['shift']());}};_0x327257(++_0x2e06eb);}(_0xac3f,0x153));var _0xfac3=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0xac3f[_0x7f3667];return _0x2c4c24;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfac3('0x0'))(_0xfac3('0x1'));var moment=require(_0xfac3('0x2'));var BPromise=require('bluebird');var rp=require(_0xfac3('0x3'));var fs=require('fs');var path=require(_0xfac3('0x4'));var rimraf=require(_0xfac3('0x5'));var config=require(_0xfac3('0x6'));var attributes=require(_0xfac3('0x7'));module[_0xfac3('0x8')]=function(_0x301fda,_0x295faf){return _0x301fda[_0xfac3('0x9')](_0xfac3('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xfac3('0xb')]},{'fields':[_0xfac3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54b8=['path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15762b,_0x5730f9){var _0x56585c=function(_0xd9b095){while(--_0xd9b095){_0x15762b['push'](_0x15762b['shift']());}};_0x56585c(++_0x5730f9);}(_0x54b8,0x1a8));var _0x854b=function(_0x5037fd,_0x523307){_0x5037fd=_0x5037fd-0x0;var _0x1882c5=_0x54b8[_0x5037fd];return _0x1882c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x854b('0x0'))(_0x854b('0x1'));var moment=require(_0x854b('0x2'));var BPromise=require(_0x854b('0x3'));var rp=require(_0x854b('0x4'));var fs=require('fs');var path=require(_0x854b('0x5'));var rimraf=require('rimraf');var config=require(_0x854b('0x6'));var attributes=require(_0x854b('0x7'));module[_0x854b('0x8')]=function(_0x406c2a,_0xdab899){return _0x406c2a[_0x854b('0x9')](_0x854b('0xa'),attributes,{'tableName':_0x854b('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x854b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 0d0a3af..bdab1ac 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 _0xecf7=['request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','include','map','model','attributes','then','create','body','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x39a9f2,_0x4a1441){var _0x5a9cc2=function(_0x372a32){while(--_0x372a32){_0x39a9f2['push'](_0x39a9f2['shift']());}};_0x5a9cc2(++_0x4a1441);}(_0xecf7,0x157));var _0x7ecf=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xecf7[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x7ecf('0x0'));var util=require(_0x7ecf('0x1'));var moment=require(_0x7ecf('0x2'));var BPromise=require(_0x7ecf('0x3'));var rs=require(_0x7ecf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ecf('0x5'))['db'];var utils=require(_0x7ecf('0x6'));var logger=require(_0x7ecf('0x7'))(_0x7ecf('0x8'));var config=require(_0x7ecf('0x9'));var jayson=require(_0x7ecf('0xa'));var client=jayson[_0x7ecf('0xb')][_0x7ecf('0xc')]({'port':0x232a});config[_0x7ecf('0xd')]=_['defaults'](config['redis'],{'host':_0x7ecf('0xe'),'port':0x18eb});var socket=require(_0x7ecf('0xf'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x7ecf('0x10')](socket);function respondWithRpcPromise(_0x2170c3,_0x2ef333,_0x5bdb5d){return new BPromise(function(_0x570a2c,_0x3d26f2){return client[_0x7ecf('0x11')](_0x2170c3,_0x5bdb5d)['then'](function(_0xac720a){logger[_0x7ecf('0x12')](_0x7ecf('0x13'),_0x2ef333,_0x7ecf('0x14'));logger[_0x7ecf('0x15')](_0x7ecf('0x16'),_0x2ef333,'request\x20sent',JSON[_0x7ecf('0x17')](_0xac720a));if(_0xac720a[_0x7ecf('0x18')]){if(_0xac720a[_0x7ecf('0x18')]['code']===0x1f4){logger[_0x7ecf('0x18')](_0x7ecf('0x13'),_0x2ef333,_0xac720a[_0x7ecf('0x18')][_0x7ecf('0x19')]);return _0x3d26f2(_0xac720a['error'][_0x7ecf('0x19')]);}logger[_0x7ecf('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x2ef333,_0xac720a[_0x7ecf('0x18')]['message']);return _0x570a2c(_0xac720a[_0x7ecf('0x18')][_0x7ecf('0x19')]);}else{logger[_0x7ecf('0x12')](_0x7ecf('0x13'),_0x2ef333,_0x7ecf('0x14'));_0x570a2c(_0xac720a[_0x7ecf('0x1a')][_0x7ecf('0x19')]);}})[_0x7ecf('0x1b')](function(_0x10dfb7){logger[_0x7ecf('0x18')](_0x7ecf('0x13'),_0x2ef333,_0x10dfb7);_0x3d26f2(_0x10dfb7);});});}exports[_0x7ecf('0x1c')]=function(_0xf9d3d1){var _0x3bff03=this;return new Promise(function(_0x49d4db,_0x401cbf){return db[_0x7ecf('0x1d')][_0x7ecf('0x1e')]({'raw':_0xf9d3d1[_0x7ecf('0x1f')]?_0xf9d3d1['options']['raw']===undefined?!![]:![]:!![],'where':_0xf9d3d1['options']?_0xf9d3d1[_0x7ecf('0x1f')]['where']||null:null,'attributes':_0xf9d3d1['options']?_0xf9d3d1['options']['attributes']||null:null,'limit':_0xf9d3d1[_0x7ecf('0x1f')]?_0xf9d3d1[_0x7ecf('0x1f')]['limit']||null:null,'include':_0xf9d3d1[_0x7ecf('0x1f')]?_0xf9d3d1[_0x7ecf('0x1f')][_0x7ecf('0x20')]?_[_0x7ecf('0x21')](_0xf9d3d1[_0x7ecf('0x1f')][_0x7ecf('0x20')],function(_0x1c2e4d){return{'model':db[_0x1c2e4d[_0x7ecf('0x22')]],'as':_0x1c2e4d['as'],'attributes':_0x1c2e4d['attributes'],'include':_0x1c2e4d['include']?_[_0x7ecf('0x21')](_0x1c2e4d['include'],function(_0x3fb93a){return{'model':db[_0x3fb93a[_0x7ecf('0x22')]],'as':_0x3fb93a['as'],'attributes':_0x3fb93a[_0x7ecf('0x23')],'include':_0x3fb93a[_0x7ecf('0x20')]?_['map'](_0x3fb93a[_0x7ecf('0x20')],function(_0xf56cdb){return{'model':db[_0xf56cdb[_0x7ecf('0x22')]],'as':_0xf56cdb['as'],'attributes':_0xf56cdb['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ecf('0x24')](function(_0x2eca3d){logger[_0x7ecf('0x12')](_0x7ecf('0x1c'),_0xf9d3d1);logger[_0x7ecf('0x15')](_0x7ecf('0x1c'),_0xf9d3d1,JSON[_0x7ecf('0x17')](_0x2eca3d));_0x49d4db(_0x2eca3d);})[_0x7ecf('0x1b')](function(_0x49d868){logger['error'](_0x7ecf('0x1c'),_0x49d868[_0x7ecf('0x19')],_0xf9d3d1);_0x401cbf(_0x3bff03[_0x7ecf('0x18')](0x1f4,_0x49d868['message']));});});};exports['CreateVoiceQueueReport']=function(_0xa67b44){var _0x2fc077=this;return new Promise(function(_0x3c1147,_0x5b7f2a){return db['VoiceQueueReport'][_0x7ecf('0x25')](_0xa67b44[_0x7ecf('0x26')],{'raw':_0xa67b44[_0x7ecf('0x1f')]?_0xa67b44['options'][_0x7ecf('0x27')]===undefined?!![]:![]:!![]})[_0x7ecf('0x24')](function(_0x533778){logger[_0x7ecf('0x12')](_0x7ecf('0x28'),_0xa67b44);logger[_0x7ecf('0x15')](_0x7ecf('0x28'),_0xa67b44,JSON[_0x7ecf('0x17')](_0x533778));_0x3c1147(_0x533778);})[_0x7ecf('0x1b')](function(_0xb43bdb){logger[_0x7ecf('0x18')](_0x7ecf('0x28'),_0xb43bdb[_0x7ecf('0x19')],_0xa67b44);_0x5b7f2a(_0x2fc077[_0x7ecf('0x18')](0x1f4,_0xb43bdb[_0x7ecf('0x19')]));});});};exports[_0x7ecf('0x29')]=function(_0x3043e6){var _0x17253f=this;return new Promise(function(_0x199d74,_0x260255){return db['VoiceQueueReport'][_0x7ecf('0x2a')](_0x3043e6[_0x7ecf('0x26')],{'raw':_0x3043e6[_0x7ecf('0x1f')]?_0x3043e6[_0x7ecf('0x1f')][_0x7ecf('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3043e6['options']?_0x3043e6[_0x7ecf('0x1f')][_0x7ecf('0x2b')]||null:null,'attributes':_0x3043e6[_0x7ecf('0x1f')]?_0x3043e6['options']['attributes']||null:null,'limit':_0x3043e6['options']?_0x3043e6[_0x7ecf('0x1f')][_0x7ecf('0x2c')]||null:null})[_0x7ecf('0x24')](function(_0x2aa257){logger['info'](_0x7ecf('0x29'),_0x3043e6);logger[_0x7ecf('0x15')]('UpdateVoiceQueueReport',_0x3043e6,JSON['stringify'](_0x2aa257));_0x199d74(_0x2aa257);})[_0x7ecf('0x1b')](function(_0x295549){logger[_0x7ecf('0x18')]('UpdateVoiceQueueReport',_0x295549[_0x7ecf('0x19')],_0x3043e6);_0x260255(_0x17253f['error'](0x1f4,_0x295549[_0x7ecf('0x19')]));});});}; \ No newline at end of file +var _0x5ce3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport','create','debug','UpdateVoiceQueueReport','lodash','util'];(function(_0x185d55,_0x3f69c2){var _0x1cc748=function(_0x227889){while(--_0x227889){_0x185d55['push'](_0x185d55['shift']());}};_0x1cc748(++_0x3f69c2);}(_0x5ce3,0x156));var _0x35ce=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0x5ce3[_0x50d84b];return _0x6d4270;};'use strict';var _=require(_0x35ce('0x0'));var util=require(_0x35ce('0x1'));var moment=require(_0x35ce('0x2'));var BPromise=require(_0x35ce('0x3'));var rs=require(_0x35ce('0x4'));var fs=require('fs');var Redis=require(_0x35ce('0x5'));var db=require(_0x35ce('0x6'))['db'];var utils=require(_0x35ce('0x7'));var logger=require('../../config/logger')(_0x35ce('0x8'));var config=require(_0x35ce('0x9'));var jayson=require(_0x35ce('0xa'));var client=jayson[_0x35ce('0xb')][_0x35ce('0xc')]({'port':0x232a});config[_0x35ce('0xd')]=_['defaults'](config[_0x35ce('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x35ce('0xe'))(new Redis(config[_0x35ce('0xd')]));require('./voiceQueueReport.socket')[_0x35ce('0xf')](socket);function respondWithRpcPromise(_0x4313d0,_0x1a8bc5,_0x34dc96){return new BPromise(function(_0x492fb1,_0x2e3fdf){return client[_0x35ce('0x10')](_0x4313d0,_0x34dc96)[_0x35ce('0x11')](function(_0x4167d9){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x1a8bc5,_0x35ce('0x12'));logger['debug'](_0x35ce('0x13'),_0x1a8bc5,_0x35ce('0x12'),JSON[_0x35ce('0x14')](_0x4167d9));if(_0x4167d9[_0x35ce('0x15')]){if(_0x4167d9[_0x35ce('0x15')][_0x35ce('0x16')]===0x1f4){logger[_0x35ce('0x15')](_0x35ce('0x17'),_0x1a8bc5,_0x4167d9[_0x35ce('0x15')][_0x35ce('0x18')]);return _0x2e3fdf(_0x4167d9['error'][_0x35ce('0x18')]);}logger[_0x35ce('0x15')](_0x35ce('0x17'),_0x1a8bc5,_0x4167d9[_0x35ce('0x15')]['message']);return _0x492fb1(_0x4167d9[_0x35ce('0x15')][_0x35ce('0x18')]);}else{logger[_0x35ce('0x19')](_0x35ce('0x17'),_0x1a8bc5,_0x35ce('0x12'));_0x492fb1(_0x4167d9[_0x35ce('0x1a')][_0x35ce('0x18')]);}})[_0x35ce('0x1b')](function(_0x1aaf23){logger[_0x35ce('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x1a8bc5,_0x1aaf23);_0x2e3fdf(_0x1aaf23);});});}exports[_0x35ce('0x1c')]=function(_0x4d01f7){var _0x49ab74=this;return new Promise(function(_0x569dc6,_0x5d0f4f){return db[_0x35ce('0x1d')][_0x35ce('0x1e')]({'raw':_0x4d01f7[_0x35ce('0x1f')]?_0x4d01f7[_0x35ce('0x1f')][_0x35ce('0x20')]===undefined?!![]:![]:!![],'where':_0x4d01f7[_0x35ce('0x1f')]?_0x4d01f7[_0x35ce('0x1f')][_0x35ce('0x21')]||null:null,'attributes':_0x4d01f7[_0x35ce('0x1f')]?_0x4d01f7[_0x35ce('0x1f')]['attributes']||null:null,'limit':_0x4d01f7[_0x35ce('0x1f')]?_0x4d01f7[_0x35ce('0x1f')][_0x35ce('0x22')]||null:null,'include':_0x4d01f7[_0x35ce('0x1f')]?_0x4d01f7[_0x35ce('0x1f')][_0x35ce('0x23')]?_[_0x35ce('0x24')](_0x4d01f7['options'][_0x35ce('0x23')],function(_0x907c25){return{'model':db[_0x907c25[_0x35ce('0x25')]],'as':_0x907c25['as'],'attributes':_0x907c25[_0x35ce('0x26')],'include':_0x907c25[_0x35ce('0x23')]?_['map'](_0x907c25['include'],function(_0x4530c8){return{'model':db[_0x4530c8['model']],'as':_0x4530c8['as'],'attributes':_0x4530c8[_0x35ce('0x26')],'include':_0x4530c8[_0x35ce('0x23')]?_[_0x35ce('0x24')](_0x4530c8[_0x35ce('0x23')],function(_0x1c39bc){return{'model':db[_0x1c39bc['model']],'as':_0x1c39bc['as'],'attributes':_0x1c39bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x35ce('0x11')](function(_0x56b5b6){logger['info'](_0x35ce('0x1c'),_0x4d01f7);logger['debug'](_0x35ce('0x1c'),_0x4d01f7,JSON[_0x35ce('0x14')](_0x56b5b6));_0x569dc6(_0x56b5b6);})[_0x35ce('0x1b')](function(_0x57c757){logger[_0x35ce('0x15')]('GetVoiceQueueReport',_0x57c757[_0x35ce('0x18')],_0x4d01f7);_0x5d0f4f(_0x49ab74[_0x35ce('0x15')](0x1f4,_0x57c757['message']));});});};exports[_0x35ce('0x27')]=function(_0x36a926){var _0x18caef=this;return new Promise(function(_0x1a084c,_0x207af9){return db[_0x35ce('0x1d')][_0x35ce('0x28')](_0x36a926['body'],{'raw':_0x36a926['options']?_0x36a926['options']['raw']===undefined?!![]:![]:!![]})[_0x35ce('0x11')](function(_0x22dd5e){logger[_0x35ce('0x19')]('CreateVoiceQueueReport',_0x36a926);logger[_0x35ce('0x29')](_0x35ce('0x27'),_0x36a926,JSON[_0x35ce('0x14')](_0x22dd5e));_0x1a084c(_0x22dd5e);})[_0x35ce('0x1b')](function(_0x18a445){logger[_0x35ce('0x15')](_0x35ce('0x27'),_0x18a445[_0x35ce('0x18')],_0x36a926);_0x207af9(_0x18caef[_0x35ce('0x15')](0x1f4,_0x18a445[_0x35ce('0x18')]));});});};exports[_0x35ce('0x2a')]=function(_0x424b07){var _0x50c69f=this;return new Promise(function(_0x445541,_0x123d56){return db[_0x35ce('0x1d')]['update'](_0x424b07['body'],{'raw':_0x424b07[_0x35ce('0x1f')]?_0x424b07[_0x35ce('0x1f')][_0x35ce('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x424b07[_0x35ce('0x1f')]?_0x424b07[_0x35ce('0x1f')][_0x35ce('0x21')]||null:null,'attributes':_0x424b07[_0x35ce('0x1f')]?_0x424b07[_0x35ce('0x1f')][_0x35ce('0x26')]||null:null,'limit':_0x424b07['options']?_0x424b07[_0x35ce('0x1f')]['limit']||null:null})[_0x35ce('0x11')](function(_0x49ddd3){logger[_0x35ce('0x19')](_0x35ce('0x2a'),_0x424b07);logger[_0x35ce('0x29')](_0x35ce('0x2a'),_0x424b07,JSON[_0x35ce('0x14')](_0x49ddd3));_0x445541(_0x49ddd3);})[_0x35ce('0x1b')](function(_0x1a0689){logger['error']('UpdateVoiceQueueReport',_0x1a0689[_0x35ce('0x18')],_0x424b07);_0x123d56(_0x50c69f[_0x35ce('0x15')](0x1f4,_0x1a0689['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 057d48c..a264e5a 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 _0x4c72=['remove','update','register','length','./voiceQueueReport.events'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x4c72,0x1e4));var _0x24c7=function(_0x5af10f,_0x3a5a50){_0x5af10f=_0x5af10f-0x0;var _0x1ec988=_0x4c72[_0x5af10f];return _0x1ec988;};'use strict';var VoiceQueueReportEvents=require(_0x24c7('0x0'));var events=['save',_0x24c7('0x1'),_0x24c7('0x2')];function createListener(_0x4f4907,_0x5a21cf){return function(_0x490372){_0x5a21cf['emit'](_0x4f4907,_0x490372);};}function removeListener(_0x3d56cf,_0x442509){return function(){VoiceQueueReportEvents['removeListener'](_0x3d56cf,_0x442509);};}exports[_0x24c7('0x3')]=function(_0x55d9dd){for(var _0x519348=0x0,_0xe0149f=events[_0x24c7('0x4')];_0x519348<_0xe0149f;_0x519348++){var _0x46e082=events[_0x519348];var _0xdb079d=createListener('voiceQueueReport:'+_0x46e082,_0x55d9dd);VoiceQueueReportEvents['on'](_0x46e082,_0xdb079d);}}; \ No newline at end of file +var _0x075e=['length','voiceQueueReport:','save','remove','update','emit','removeListener','register'];(function(_0x47a374,_0x2f612f){var _0x2f60bd=function(_0xa1fdbd){while(--_0xa1fdbd){_0x47a374['push'](_0x47a374['shift']());}};_0x2f60bd(++_0x2f612f);}(_0x075e,0x92));var _0xe075=function(_0x13dd5e,_0x45cdd2){_0x13dd5e=_0x13dd5e-0x0;var _0x3e5f8b=_0x075e[_0x13dd5e];return _0x3e5f8b;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe075('0x0'),_0xe075('0x1'),_0xe075('0x2')];function createListener(_0x1e62fc,_0x252723){return function(_0x3d85a1){_0x252723[_0xe075('0x3')](_0x1e62fc,_0x3d85a1);};}function removeListener(_0x422c3a,_0x5eddf4){return function(){VoiceQueueReportEvents[_0xe075('0x4')](_0x422c3a,_0x5eddf4);};}exports[_0xe075('0x5')]=function(_0x5120da){for(var _0x18570b=0x0,_0x14d5a0=events[_0xe075('0x6')];_0x18570b<_0x14d5a0;_0x18570b++){var _0x282479=events[_0x18570b];var _0x33740d=createListener(_0xe075('0x7')+_0x282479,_0x5120da);VoiceQueueReportEvents['on'](_0x282479,_0x33740d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 43d1209..d8dd7cb 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 _0x2794=['delete','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x33757c,_0x5df618){var _0x297ae3=function(_0x25492a){while(--_0x25492a){_0x33757c['push'](_0x33757c['shift']());}};_0x297ae3(++_0x5df618);}(_0x2794,0x111));var _0x4279=function(_0x3b4c9f,_0x97985e){_0x3b4c9f=_0x3b4c9f-0x0;var _0xf003bb=_0x2794[_0x3b4c9f];return _0xf003bb;};'use strict';var multer=require('multer');var util=require(_0x4279('0x0'));var path=require('path');var timeout=require(_0x4279('0x1'));var express=require(_0x4279('0x2'));var router=express['Router']();var fs_extra=require(_0x4279('0x3'));var auth=require(_0x4279('0x4'));var interaction=require(_0x4279('0x5'));var config=require(_0x4279('0x6'));var controller=require(_0x4279('0x7'));router[_0x4279('0x8')]('/',auth[_0x4279('0x9')](),controller[_0x4279('0xa')]);router[_0x4279('0x8')](_0x4279('0xb'),auth[_0x4279('0x9')](),controller['show']);router[_0x4279('0xc')]('/',auth[_0x4279('0x9')](),controller[_0x4279('0xd')]);router[_0x4279('0xe')](_0x4279('0xb'),auth[_0x4279('0x9')](),controller[_0x4279('0xf')]);router[_0x4279('0x10')](_0x4279('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa39b=['isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x2cf0a7,_0x1dcb6a){var _0x4f01f9=function(_0xc6fd6){while(--_0xc6fd6){_0x2cf0a7['push'](_0x2cf0a7['shift']());}};_0x4f01f9(++_0x1dcb6a);}(_0xa39b,0xee));var _0xba39=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa39b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xba39('0x0'));var util=require(_0xba39('0x1'));var path=require(_0xba39('0x2'));var timeout=require(_0xba39('0x3'));var express=require(_0xba39('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xba39('0x5'));var interaction=require(_0xba39('0x6'));var config=require(_0xba39('0x7'));var controller=require(_0xba39('0x8'));router['get']('/',auth[_0xba39('0x9')](),controller[_0xba39('0xa')]);router[_0xba39('0xb')](_0xba39('0xc'),auth['isAuthenticated'](),controller[_0xba39('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba39('0xe')]);router[_0xba39('0xf')](_0xba39('0xc'),auth['isAuthenticated'](),controller[_0xba39('0x10')]);router[_0xba39('0x11')](_0xba39('0xc'),auth[_0xba39('0x9')](),controller[_0xba39('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5b967cc..d15cee2 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 _0x63a8=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x63a8,0x1ea));var _0x863a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x63a8[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x863a('0x0'));var moment=require('moment');module[_0x863a('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x863a('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x863a('0x3')],'allowNull':![],'defaultValue':moment()[_0x863a('0x4')](_0x863a('0x5'))}}; \ No newline at end of file +var _0x5fdb=['sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9adcd6,_0x36278b){var _0xdf8ff2=function(_0x4f7087){while(--_0x4f7087){_0x9adcd6['push'](_0x9adcd6['shift']());}};_0xdf8ff2(++_0x36278b);}(_0x5fdb,0x1b0));var _0xb5fd=function(_0x34b501,_0x4738f0){_0x34b501=_0x34b501-0x0;var _0x2fe122=_0x5fdb[_0x34b501];return _0x2fe122;};'use strict';var Sequelize=require(_0xb5fd('0x0'));var moment=require('moment');module[_0xb5fd('0x1')]={'time':{'type':Sequelize[_0xb5fd('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb5fd('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb5fd('0x3')],'allowNull':![],'defaultValue':moment()[_0xb5fd('0x4')](_0xb5fd('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e86ad57..53a61c8 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 _0x946d=['api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x946d,0x1f2));var _0xd946=function(_0x2a0b73,_0x3ad988){_0x2a0b73=_0x2a0b73-0x0;var _0x513d36=_0x946d[_0x2a0b73];return _0x513d36;};'use strict';var emlformat=require(_0xd946('0x0'));var rimraf=require(_0xd946('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd946('0x2'));var rp=require(_0xd946('0x3'));var moment=require(_0xd946('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd946('0x5'));var sox=require(_0xd946('0x6'));var csv=require(_0xd946('0x7'));var ejs=require(_0xd946('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd946('0x9'));var squel=require('squel');var crypto=require(_0xd946('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd946('0xb'));var toCsv=require(_0xd946('0x7'));var querystring=require(_0xd946('0xc'));var Papa=require(_0xd946('0xd'));var Redis=require(_0xd946('0xe'));var authService=require(_0xd946('0xf'));var qs=require(_0xd946('0x10'));var as=require(_0xd946('0x11'));var hardwareService=require(_0xd946('0x12'));var logger=require(_0xd946('0x13'))(_0xd946('0x14'));var utils=require(_0xd946('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd946('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee4f7,_0x2a71a2){_0x2a71a2=_0x2a71a2||0xcc;return function(_0x25961e){if(_0x25961e){return _0x2ee4f7[_0xd946('0x17')](_0x2a71a2);}return _0x2ee4f7['status'](_0x2a71a2)['end']();};}function respondWithResult(_0x5b5c77,_0x59a2cf){_0x59a2cf=_0x59a2cf||0xc8;return function(_0x1a5a96){if(_0x1a5a96){return _0x5b5c77[_0xd946('0x18')](_0x59a2cf)[_0xd946('0x19')](_0x1a5a96);}};}function respondWithFilteredResult(_0x283afe,_0x17c863){return function(_0x11ff9b){if(_0x11ff9b){var _0x459f85=typeof _0x17c863['offset']===_0xd946('0x1a')&&typeof _0x17c863[_0xd946('0x1b')]===_0xd946('0x1a');var _0x215d40=_0x11ff9b['count'];var _0x23bb27=_0x459f85?0x0:_0x17c863['offset'];var _0x4ba31a=_0x459f85?_0x11ff9b[_0xd946('0x1c')]:_0x17c863[_0xd946('0x1d')]+_0x17c863[_0xd946('0x1b')];var _0x1439f0;if(_0x4ba31a>=_0x215d40){_0x4ba31a=_0x215d40;_0x1439f0=0xc8;}else{_0x1439f0=0xce;}_0x283afe[_0xd946('0x18')](_0x1439f0);return _0x283afe[_0xd946('0x1e')](_0xd946('0x1f'),_0x23bb27+'-'+_0x4ba31a+'/'+_0x215d40)[_0xd946('0x19')](_0x11ff9b);}return null;};}function patchUpdates(_0x365339){return function(_0x304ff8){try{jsonpatch[_0xd946('0x20')](_0x304ff8,_0x365339,!![]);}catch(_0x4c4a40){return BPromise[_0xd946('0x21')](_0x4c4a40);}return _0x304ff8[_0xd946('0x22')]();};}function saveUpdates(_0x2afe87,_0x3e9d27){return function(_0x55f3e3){if(_0x55f3e3){return _0x55f3e3[_0xd946('0x23')](_0x2afe87)[_0xd946('0x24')](function(_0x5c1e66){return _0x5c1e66;});}return null;};}function removeEntity(_0x211a56,_0x2d1dcb){return function(_0x5a4082){if(_0x5a4082){return _0x5a4082[_0xd946('0x25')]()['then'](function(){_0x211a56['status'](0xcc)[_0xd946('0x26')]();});}};}function handleEntityNotFound(_0x16e735,_0x428f71){return function(_0x32977e){if(!_0x32977e){_0x16e735[_0xd946('0x17')](0x194);}return _0x32977e;};}function handleError(_0x383451,_0xa2472d){_0xa2472d=_0xa2472d||0x1f4;return function(_0x20fe40){logger[_0xd946('0x27')](_0x20fe40[_0xd946('0x28')]);if(_0x20fe40[_0xd946('0x29')]){delete _0x20fe40[_0xd946('0x29')];}_0x383451[_0xd946('0x18')](_0xa2472d)[_0xd946('0x2a')](_0x20fe40);};}exports[_0xd946('0x2b')]=function(_0x530389,_0x5611e0){var _0x4789a2={},_0x58cf4f={},_0x27fbde={'count':0x0,'rows':[]};var _0x2f2143=_[_0xd946('0x2c')](db[_0xd946('0x2d')][_0xd946('0x2e')],function(_0x119615){return{'name':_0x119615['fieldName'],'type':_0x119615['type'][_0xd946('0x2f')]};});_0x58cf4f[_0xd946('0x30')]=_['map'](_0x2f2143,_0xd946('0x29'));_0x58cf4f[_0xd946('0x31')]=_[_0xd946('0x32')](_0x530389[_0xd946('0x31')]);_0x58cf4f[_0xd946('0x33')]=_['intersection'](_0x58cf4f[_0xd946('0x30')],_0x58cf4f[_0xd946('0x31')]);_0x4789a2[_0xd946('0x34')]=_[_0xd946('0x35')](_0x58cf4f[_0xd946('0x30')],qs['fields'](_0x530389[_0xd946('0x31')][_0xd946('0x36')]));_0x4789a2[_0xd946('0x34')]=_0x4789a2[_0xd946('0x34')][_0xd946('0x37')]?_0x4789a2[_0xd946('0x34')]:_0x58cf4f[_0xd946('0x30')];if(!_0x530389['query'][_0xd946('0x38')](_0xd946('0x39'))){_0x4789a2[_0xd946('0x1b')]=qs[_0xd946('0x1b')](_0x530389[_0xd946('0x31')]['limit']);_0x4789a2['offset']=qs[_0xd946('0x1d')](_0x530389[_0xd946('0x31')][_0xd946('0x1d')]);}_0x4789a2[_0xd946('0x3a')]=qs['sort'](_0x530389[_0xd946('0x31')]['sort']);_0x4789a2[_0xd946('0x3b')]=qs[_0xd946('0x33')](_[_0xd946('0x3c')](_0x530389[_0xd946('0x31')],_0x58cf4f[_0xd946('0x33')]),_0x2f2143);if(_0x530389[_0xd946('0x31')][_0xd946('0x3d')]){_0x4789a2['where']=_['merge'](_0x4789a2[_0xd946('0x3b')],{'$or':_['map'](_0x2f2143,function(_0x4062ff){if(_0x4062ff[_0xd946('0x3e')]!==_0xd946('0x3f')){var _0x7e4daa={};_0x7e4daa[_0x4062ff[_0xd946('0x29')]]={'$like':'%'+_0x530389[_0xd946('0x31')][_0xd946('0x3d')]+'%'};return _0x7e4daa;}})});}_0x4789a2=_[_0xd946('0x40')]({},_0x4789a2,_0x530389[_0xd946('0x41')]);var _0x1f4844={'where':_0x4789a2[_0xd946('0x3b')]};return db[_0xd946('0x2d')]['count'](_0x1f4844)[_0xd946('0x24')](function(_0x47501f){_0x27fbde[_0xd946('0x1c')]=_0x47501f;if(_0x530389['query'][_0xd946('0x42')]){_0x4789a2[_0xd946('0x43')]=[{'all':!![]}];}return db[_0xd946('0x2d')]['findAll'](_0x4789a2);})[_0xd946('0x24')](function(_0xc1369c){_0x27fbde['rows']=_0xc1369c;return _0x27fbde;})[_0xd946('0x24')](respondWithFilteredResult(_0x5611e0,_0x4789a2))[_0xd946('0x44')](handleError(_0x5611e0,null));};exports[_0xd946('0x45')]=function(_0x1decc0,_0xb8a9aa){var _0x190fb7={'raw':!![],'where':{'id':_0x1decc0[_0xd946('0x46')]['id']}},_0x566d8c={};_0x566d8c[_0xd946('0x30')]=_[_0xd946('0x32')](db['VoiceQueuesLog'][_0xd946('0x2e')]);_0x566d8c['query']=_[_0xd946('0x32')](_0x1decc0['query']);_0x566d8c[_0xd946('0x33')]=_['intersection'](_0x566d8c[_0xd946('0x30')],_0x566d8c[_0xd946('0x31')]);_0x190fb7[_0xd946('0x34')]=_[_0xd946('0x35')](_0x566d8c[_0xd946('0x30')],qs[_0xd946('0x36')](_0x1decc0[_0xd946('0x31')][_0xd946('0x36')]));_0x190fb7[_0xd946('0x34')]=_0x190fb7[_0xd946('0x34')][_0xd946('0x37')]?_0x190fb7[_0xd946('0x34')]:_0x566d8c[_0xd946('0x30')];if(_0x1decc0[_0xd946('0x31')][_0xd946('0x42')]){_0x190fb7['include']=[{'all':!![]}];}_0x190fb7=_[_0xd946('0x40')]({},_0x190fb7,_0x1decc0['options']);return db[_0xd946('0x2d')][_0xd946('0x47')](_0x190fb7)['then'](handleEntityNotFound(_0xb8a9aa,null))[_0xd946('0x24')](respondWithResult(_0xb8a9aa,null))[_0xd946('0x44')](handleError(_0xb8a9aa,null));};exports[_0xd946('0x48')]=function(_0x19bb1d,_0x27ef9b){return db[_0xd946('0x2d')]['create'](_0x19bb1d[_0xd946('0x49')],{})[_0xd946('0x24')](respondWithResult(_0x27ef9b,0xc9))[_0xd946('0x44')](handleError(_0x27ef9b,null));};exports[_0xd946('0x23')]=function(_0x2372b7,_0x51fde4){if(_0x2372b7[_0xd946('0x49')]['id']){delete _0x2372b7['body']['id'];}return db[_0xd946('0x2d')][_0xd946('0x47')]({'where':{'id':_0x2372b7['params']['id']}})[_0xd946('0x24')](handleEntityNotFound(_0x51fde4,null))[_0xd946('0x24')](saveUpdates(_0x2372b7[_0xd946('0x49')],null))['then'](respondWithResult(_0x51fde4,null))['catch'](handleError(_0x51fde4,null));};exports[_0xd946('0x25')]=function(_0x3f4416,_0xbdb06a){return db[_0xd946('0x2d')][_0xd946('0x47')]({'where':{'id':_0x3f4416[_0xd946('0x46')]['id']}})[_0xd946('0x24')](handleEntityNotFound(_0xbdb06a,null))[_0xd946('0x24')](removeEntity(_0xbdb06a,null))['catch'](handleError(_0xbdb06a,null));}; \ No newline at end of file +var _0x1034=['show','params','rawAttributes','include','find','catch','create','body','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','reject','save','update','destroy','then','error','stack','name','index','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','findAll','rows'];(function(_0x274797,_0x56be87){var _0x5671b3=function(_0x5638fe){while(--_0x5638fe){_0x274797['push'](_0x274797['shift']());}};_0x5671b3(++_0x56be87);}(_0x1034,0xe3));var _0x4103=function(_0x2c6ec7,_0x481cb8){_0x2c6ec7=_0x2c6ec7-0x0;var _0x9e8944=_0x1034[_0x2c6ec7];return _0x9e8944;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4103('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4103('0x1'));var BPromise=require(_0x4103('0x2'));var Mustache=require(_0x4103('0x3'));var util=require(_0x4103('0x4'));var path=require('path');var sox=require(_0x4103('0x5'));var csv=require(_0x4103('0x6'));var ejs=require(_0x4103('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4103('0x8'));var squel=require(_0x4103('0x9'));var crypto=require(_0x4103('0xa'));var jsforce=require(_0x4103('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4103('0xc'));var Papa=require(_0x4103('0xd'));var Redis=require(_0x4103('0xe'));var authService=require(_0x4103('0xf'));var qs=require(_0x4103('0x10'));var as=require(_0x4103('0x11'));var hardwareService=require(_0x4103('0x12'));var logger=require(_0x4103('0x13'))(_0x4103('0x14'));var utils=require(_0x4103('0x15'));var config=require(_0x4103('0x16'));var licenseUtil=require(_0x4103('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x123f83,_0x661b10){_0x661b10=_0x661b10||0xcc;return function(_0x50753f){if(_0x50753f){return _0x123f83[_0x4103('0x18')](_0x661b10);}return _0x123f83[_0x4103('0x19')](_0x661b10)[_0x4103('0x1a')]();};}function respondWithResult(_0x1ee261,_0x3d5d62){_0x3d5d62=_0x3d5d62||0xc8;return function(_0x91e74e){if(_0x91e74e){return _0x1ee261[_0x4103('0x19')](_0x3d5d62)['json'](_0x91e74e);}};}function respondWithFilteredResult(_0x14fe44,_0x3942d6){return function(_0x1fda23){if(_0x1fda23){var _0x152d0d=typeof _0x3942d6[_0x4103('0x1b')]==='undefined'&&typeof _0x3942d6[_0x4103('0x1c')]==='undefined';var _0xf5d91a=_0x1fda23[_0x4103('0x1d')];var _0xf33311=_0x152d0d?0x0:_0x3942d6[_0x4103('0x1b')];var _0xcd263b=_0x152d0d?_0x1fda23[_0x4103('0x1d')]:_0x3942d6[_0x4103('0x1b')]+_0x3942d6['limit'];var _0x258ccd;if(_0xcd263b>=_0xf5d91a){_0xcd263b=_0xf5d91a;_0x258ccd=0xc8;}else{_0x258ccd=0xce;}_0x14fe44[_0x4103('0x19')](_0x258ccd);return _0x14fe44['set']('Content-Range',_0xf33311+'-'+_0xcd263b+'/'+_0xf5d91a)['json'](_0x1fda23);}return null;};}function patchUpdates(_0x174089){return function(_0xae98ec){try{jsonpatch['apply'](_0xae98ec,_0x174089,!![]);}catch(_0x499287){return BPromise[_0x4103('0x1e')](_0x499287);}return _0xae98ec[_0x4103('0x1f')]();};}function saveUpdates(_0x1c10b2,_0x2e328d){return function(_0x4bb8a1){if(_0x4bb8a1){return _0x4bb8a1[_0x4103('0x20')](_0x1c10b2)['then'](function(_0x44c203){return _0x44c203;});}return null;};}function removeEntity(_0x3e8c03,_0x2554c4){return function(_0xa93d29){if(_0xa93d29){return _0xa93d29[_0x4103('0x21')]()[_0x4103('0x22')](function(){_0x3e8c03[_0x4103('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c1004,_0x39414e){return function(_0x295ffd){if(!_0x295ffd){_0x3c1004[_0x4103('0x18')](0x194);}return _0x295ffd;};}function handleError(_0x117dc1,_0x149b6d){_0x149b6d=_0x149b6d||0x1f4;return function(_0x2e6174){logger[_0x4103('0x23')](_0x2e6174[_0x4103('0x24')]);if(_0x2e6174[_0x4103('0x25')]){delete _0x2e6174[_0x4103('0x25')];}_0x117dc1[_0x4103('0x19')](_0x149b6d)['send'](_0x2e6174);};}exports[_0x4103('0x26')]=function(_0x2fc58c,_0x5dcf25){var _0x110562={},_0x2f98d9={},_0x4093af={'count':0x0,'rows':[]};var _0x465b39=_[_0x4103('0x27')](db['VoiceQueuesLog']['rawAttributes'],function(_0x140dfd){return{'name':_0x140dfd[_0x4103('0x28')],'type':_0x140dfd[_0x4103('0x29')][_0x4103('0x2a')]};});_0x2f98d9[_0x4103('0x2b')]=_['map'](_0x465b39,'name');_0x2f98d9['query']=_[_0x4103('0x2c')](_0x2fc58c['query']);_0x2f98d9[_0x4103('0x2d')]=_[_0x4103('0x2e')](_0x2f98d9[_0x4103('0x2b')],_0x2f98d9[_0x4103('0x2f')]);_0x110562['attributes']=_['intersection'](_0x2f98d9[_0x4103('0x2b')],qs['fields'](_0x2fc58c[_0x4103('0x2f')][_0x4103('0x30')]));_0x110562[_0x4103('0x31')]=_0x110562[_0x4103('0x31')][_0x4103('0x32')]?_0x110562[_0x4103('0x31')]:_0x2f98d9['model'];if(!_0x2fc58c['query'][_0x4103('0x33')](_0x4103('0x34'))){_0x110562[_0x4103('0x1c')]=qs[_0x4103('0x1c')](_0x2fc58c[_0x4103('0x2f')][_0x4103('0x1c')]);_0x110562[_0x4103('0x1b')]=qs[_0x4103('0x1b')](_0x2fc58c[_0x4103('0x2f')][_0x4103('0x1b')]);}_0x110562[_0x4103('0x35')]=qs[_0x4103('0x36')](_0x2fc58c['query'][_0x4103('0x36')]);_0x110562[_0x4103('0x37')]=qs[_0x4103('0x2d')](_[_0x4103('0x38')](_0x2fc58c[_0x4103('0x2f')],_0x2f98d9[_0x4103('0x2d')]),_0x465b39);if(_0x2fc58c['query'][_0x4103('0x39')]){_0x110562['where']=_[_0x4103('0x3a')](_0x110562[_0x4103('0x37')],{'$or':_[_0x4103('0x27')](_0x465b39,function(_0x2fb34a){if(_0x2fb34a['type']!==_0x4103('0x3b')){var _0x342ed6={};_0x342ed6[_0x2fb34a['name']]={'$like':'%'+_0x2fc58c[_0x4103('0x2f')][_0x4103('0x39')]+'%'};return _0x342ed6;}})});}_0x110562=_[_0x4103('0x3a')]({},_0x110562,_0x2fc58c[_0x4103('0x3c')]);var _0x437c79={'where':_0x110562[_0x4103('0x37')]};return db[_0x4103('0x3d')][_0x4103('0x1d')](_0x437c79)[_0x4103('0x22')](function(_0x9a147a){_0x4093af['count']=_0x9a147a;if(_0x2fc58c[_0x4103('0x2f')][_0x4103('0x3e')]){_0x110562['include']=[{'all':!![]}];}return db[_0x4103('0x3d')][_0x4103('0x3f')](_0x110562);})[_0x4103('0x22')](function(_0x50346c){_0x4093af[_0x4103('0x40')]=_0x50346c;return _0x4093af;})[_0x4103('0x22')](respondWithFilteredResult(_0x5dcf25,_0x110562))['catch'](handleError(_0x5dcf25,null));};exports[_0x4103('0x41')]=function(_0x4b07bd,_0xf7c1a2){var _0x33bdc0={'raw':!![],'where':{'id':_0x4b07bd[_0x4103('0x42')]['id']}},_0x2c793c={};_0x2c793c['model']=_[_0x4103('0x2c')](db['VoiceQueuesLog'][_0x4103('0x43')]);_0x2c793c[_0x4103('0x2f')]=_['keys'](_0x4b07bd[_0x4103('0x2f')]);_0x2c793c[_0x4103('0x2d')]=_[_0x4103('0x2e')](_0x2c793c[_0x4103('0x2b')],_0x2c793c['query']);_0x33bdc0[_0x4103('0x31')]=_[_0x4103('0x2e')](_0x2c793c['model'],qs[_0x4103('0x30')](_0x4b07bd[_0x4103('0x2f')][_0x4103('0x30')]));_0x33bdc0[_0x4103('0x31')]=_0x33bdc0[_0x4103('0x31')]['length']?_0x33bdc0['attributes']:_0x2c793c[_0x4103('0x2b')];if(_0x4b07bd[_0x4103('0x2f')][_0x4103('0x3e')]){_0x33bdc0[_0x4103('0x44')]=[{'all':!![]}];}_0x33bdc0=_[_0x4103('0x3a')]({},_0x33bdc0,_0x4b07bd['options']);return db['VoiceQueuesLog'][_0x4103('0x45')](_0x33bdc0)[_0x4103('0x22')](handleEntityNotFound(_0xf7c1a2,null))['then'](respondWithResult(_0xf7c1a2,null))[_0x4103('0x46')](handleError(_0xf7c1a2,null));};exports[_0x4103('0x47')]=function(_0x5b35b2,_0x15db15){return db[_0x4103('0x3d')]['create'](_0x5b35b2[_0x4103('0x48')],{})['then'](respondWithResult(_0x15db15,0xc9))['catch'](handleError(_0x15db15,null));};exports[_0x4103('0x20')]=function(_0x47f5b3,_0x3b3fd2){if(_0x47f5b3['body']['id']){delete _0x47f5b3[_0x4103('0x48')]['id'];}return db['VoiceQueuesLog'][_0x4103('0x45')]({'where':{'id':_0x47f5b3['params']['id']}})['then'](handleEntityNotFound(_0x3b3fd2,null))[_0x4103('0x22')](saveUpdates(_0x47f5b3[_0x4103('0x48')],null))['then'](respondWithResult(_0x3b3fd2,null))['catch'](handleError(_0x3b3fd2,null));};exports[_0x4103('0x21')]=function(_0x2a3567,_0xfd39e8){return db['VoiceQueuesLog'][_0x4103('0x45')]({'where':{'id':_0x2a3567[_0x4103('0x42')]['id']}})[_0x4103('0x22')](handleEntityNotFound(_0xfd39e8,null))[_0x4103('0x22')](removeEntity(_0xfd39e8,null))[_0x4103('0x46')](handleError(_0xfd39e8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5de3cc6..e7de4f2 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 _0x5294=['voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x2a2bc3,_0x36b55f){var _0x38522f=function(_0x10959e){while(--_0x10959e){_0x2a2bc3['push'](_0x2a2bc3['shift']());}};_0x38522f(++_0x36b55f);}(_0x5294,0x1e4));var _0x4529=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x5294[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require(_0x4529('0x0'));var logger=require(_0x4529('0x1'))(_0x4529('0x2'));var moment=require(_0x4529('0x3'));var BPromise=require(_0x4529('0x4'));var rp=require(_0x4529('0x5'));var fs=require('fs');var path=require(_0x4529('0x6'));var rimraf=require(_0x4529('0x7'));var config=require(_0x4529('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0x4529('0x9')]=function(_0x5e712f,_0x527492){return _0x5e712f[_0x4529('0xa')](_0x4529('0xb'),attributes,{'tableName':_0x4529('0xc'),'paranoid':![],'indexes':[{'name':_0x4529('0xd'),'fields':[_0x4529('0xe'),_0x4529('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa678=['dtm','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','voice_queues_log','event_dtm','event'];(function(_0x18c5c0,_0x3c5b77){var _0x3dba4b=function(_0x47ef5b){while(--_0x47ef5b){_0x18c5c0['push'](_0x18c5c0['shift']());}};_0x3dba4b(++_0x3c5b77);}(_0xa678,0xe1));var _0x8a67=function(_0x16786e,_0x268da8){_0x16786e=_0x16786e-0x0;var _0x2af21a=_0xa678[_0x16786e];return _0x2af21a;};'use strict';var _=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var logger=require(_0x8a67('0x2'))(_0x8a67('0x3'));var moment=require(_0x8a67('0x4'));var BPromise=require(_0x8a67('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a67('0x6'));var rimraf=require(_0x8a67('0x7'));var config=require(_0x8a67('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0x8a67('0x9')]=function(_0x5ba4dd,_0x16c745){return _0x5ba4dd['define']('VoiceQueuesLog',attributes,{'tableName':_0x8a67('0xa'),'paranoid':![],'indexes':[{'name':_0x8a67('0xb'),'fields':[_0x8a67('0xc'),_0x8a67('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2935f00..163f9c8 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 _0x16e3=['info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x16e3,0x168));var _0x316e=function(_0x436a6f,_0x3720b3){_0x436a6f=_0x436a6f-0x0;var _0x1b523d=_0x16e3[_0x436a6f];return _0x1b523d;};'use strict';var _=require(_0x316e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x316e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x316e('0x2'));var db=require(_0x316e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x316e('0x4'))('rpc');var config=require(_0x316e('0x5'));var jayson=require(_0x316e('0x6'));var client=jayson['client'][_0x316e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d7a5e,_0xb85517,_0x4ca4fc){return new BPromise(function(_0x250138,_0x5ac590){return client[_0x316e('0x8')](_0x5d7a5e,_0x4ca4fc)['then'](function(_0x538cba){logger['info'](_0x316e('0x9'),_0xb85517,_0x316e('0xa'));logger['debug'](_0x316e('0xb'),_0xb85517,_0x316e('0xa'),JSON['stringify'](_0x538cba));if(_0x538cba[_0x316e('0xc')]){if(_0x538cba['error']['code']===0x1f4){logger[_0x316e('0xc')](_0x316e('0x9'),_0xb85517,_0x538cba[_0x316e('0xc')][_0x316e('0xd')]);return _0x5ac590(_0x538cba['error'][_0x316e('0xd')]);}logger['error'](_0x316e('0x9'),_0xb85517,_0x538cba[_0x316e('0xc')][_0x316e('0xd')]);return _0x250138(_0x538cba['error'][_0x316e('0xd')]);}else{logger[_0x316e('0xe')](_0x316e('0x9'),_0xb85517,'request\x20sent');_0x250138(_0x538cba[_0x316e('0xf')][_0x316e('0xd')]);}})[_0x316e('0x10')](function(_0x127ca0){logger[_0x316e('0xc')](_0x316e('0x9'),_0xb85517,_0x127ca0);_0x5ac590(_0x127ca0);});});} \ No newline at end of file +var _0x36f1=['../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1037f0,_0x4f1dbb){var _0x5f596d=function(_0x1f23b0){while(--_0x1f23b0){_0x1037f0['push'](_0x1037f0['shift']());}};_0x5f596d(++_0x4f1dbb);}(_0x36f1,0xb0));var _0x136f=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x36f1[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x136f('0x0'));var util=require('util');var moment=require(_0x136f('0x1'));var BPromise=require('bluebird');var rs=require(_0x136f('0x2'));var fs=require('fs');var Redis=require(_0x136f('0x3'));var db=require(_0x136f('0x4'))['db'];var utils=require(_0x136f('0x5'));var logger=require(_0x136f('0x6'))(_0x136f('0x7'));var config=require(_0x136f('0x8'));var jayson=require(_0x136f('0x9'));var client=jayson[_0x136f('0xa')][_0x136f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x525663,_0x2e05cf,_0x29e9c5){return new BPromise(function(_0x3c7a1c,_0x48e3d2){return client[_0x136f('0xc')](_0x525663,_0x29e9c5)[_0x136f('0xd')](function(_0x51d57){logger[_0x136f('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2e05cf,'request\x20sent');logger[_0x136f('0xf')](_0x136f('0x10'),_0x2e05cf,_0x136f('0x11'),JSON['stringify'](_0x51d57));if(_0x51d57['error']){if(_0x51d57[_0x136f('0x12')][_0x136f('0x13')]===0x1f4){logger[_0x136f('0x12')](_0x136f('0x14'),_0x2e05cf,_0x51d57[_0x136f('0x12')]['message']);return _0x48e3d2(_0x51d57['error'][_0x136f('0x15')]);}logger[_0x136f('0x12')](_0x136f('0x14'),_0x2e05cf,_0x51d57['error'][_0x136f('0x15')]);return _0x3c7a1c(_0x51d57[_0x136f('0x12')][_0x136f('0x15')]);}else{logger[_0x136f('0xe')](_0x136f('0x14'),_0x2e05cf,_0x136f('0x11'));_0x3c7a1c(_0x51d57[_0x136f('0x16')][_0x136f('0x15')]);}})['catch'](function(_0x16d69a){logger[_0x136f('0x12')](_0x136f('0x14'),_0x2e05cf,_0x16d69a);_0x48e3d2(_0x16d69a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 78a6bd5..f62eeba 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 _0x126b=['put','/:id','update','delete','exports','connect-timeout','Router','fs-extra','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe'];(function(_0x5a4155,_0x4b2b70){var _0x4b1587=function(_0x4ac7ca){while(--_0x4ac7ca){_0x5a4155['push'](_0x5a4155['shift']());}};_0x4b1587(++_0x4b2b70);}(_0x126b,0x116));var _0xb126=function(_0x1c2faf,_0x14d02d){_0x1c2faf=_0x1c2faf-0x0;var _0x3bf713=_0x126b[_0x1c2faf];return _0x3bf713;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb126('0x0'));var express=require('express');var router=express[_0xb126('0x1')]();var fs_extra=require(_0xb126('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb126('0x3'));var controller=require(_0xb126('0x4'));router[_0xb126('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb126('0x5')](_0xb126('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xb126('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb126('0x5')]('/:id/download',auth[_0xb126('0x7')](),controller[_0xb126('0x8')]);router['get'](_0xb126('0x9'),controller[_0xb126('0xa')]);router[_0xb126('0x5')](_0xb126('0xb'),auth['isAuthenticated'](),controller[_0xb126('0xc')]);router['post']('/',auth[_0xb126('0x7')](),controller[_0xb126('0xd')]);router[_0xb126('0xe')](_0xb126('0xb'),auth[_0xb126('0x7')](),controller[_0xb126('0xf')]);router[_0xb126('0x10')](_0xb126('0x11'),auth[_0xb126('0x7')](),controller[_0xb126('0x12')]);router[_0xb126('0x13')](_0xb126('0x11'),auth[_0xb126('0x7')](),controller['destroy']);module[_0xb126('0x14')]=router; \ No newline at end of file +var _0xa1bd=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x54e821,_0x15791d){var _0xa47573=function(_0x1593b7){while(--_0x1593b7){_0x54e821['push'](_0x54e821['shift']());}};_0xa47573(++_0x15791d);}(_0xa1bd,0x14c));var _0xda1b=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0xa1bd[_0x3eff21];return _0x1945bb;};'use strict';var multer=require(_0xda1b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda1b('0x1'));var express=require(_0xda1b('0x2'));var router=express[_0xda1b('0x3')]();var fs_extra=require(_0xda1b('0x4'));var auth=require(_0xda1b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda1b('0x6'));var controller=require('./voiceRecording.controller');router[_0xda1b('0x7')]('/',auth[_0xda1b('0x8')](),controller[_0xda1b('0x9')]);router[_0xda1b('0x7')]('/describe',auth[_0xda1b('0x8')](),controller[_0xda1b('0xa')]);router['get'](_0xda1b('0xb'),auth['isAuthenticated'](),controller[_0xda1b('0xc')]);router['get'](_0xda1b('0xd'),auth[_0xda1b('0x8')](),controller[_0xda1b('0xe')]);router[_0xda1b('0x7')](_0xda1b('0xf'),controller['downloads']);router['get'](_0xda1b('0x10'),auth['isAuthenticated'](),controller[_0xda1b('0x11')]);router[_0xda1b('0x12')]('/',auth['isAuthenticated'](),controller[_0xda1b('0x13')]);router[_0xda1b('0x12')]('/:id/transcribe',auth[_0xda1b('0x8')](),controller[_0xda1b('0x14')]);router['put']('/:id',auth[_0xda1b('0x8')](),controller['update']);router[_0xda1b('0x15')](_0xda1b('0xb'),auth[_0xda1b('0x8')](),controller[_0xda1b('0x16')]);module[_0xda1b('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 631619c..fa502f0 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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 e87d1ae..36fb147 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 _0xfa26=['options','count','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','$and','push','isNil','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map'];(function(_0x220b18,_0x32fdd7){var _0x504702=function(_0x5f5c39){while(--_0x5f5c39){_0x220b18['push'](_0x220b18['shift']());}};_0x504702(++_0x32fdd7);}(_0xfa26,0x187));var _0x6fa2=function(_0x51da18,_0x31f88b){_0x51da18=_0x51da18-0x0;var _0x214318=_0xfa26[_0x51da18];return _0x214318;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fa2('0x0'));var zipdir=require(_0x6fa2('0x1'));var jsonpatch=require(_0x6fa2('0x2'));var rp=require('request-promise');var moment=require(_0x6fa2('0x3'));var BPromise=require(_0x6fa2('0x4'));var Mustache=require(_0x6fa2('0x5'));var util=require(_0x6fa2('0x6'));var path=require(_0x6fa2('0x7'));var sox=require(_0x6fa2('0x8'));var csv=require(_0x6fa2('0x9'));var ejs=require(_0x6fa2('0xa'));var fs=require('fs');var fs_extra=require(_0x6fa2('0xb'));var _=require('lodash');var squel=require(_0x6fa2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6fa2('0xd'));var toCsv=require(_0x6fa2('0x9'));var querystring=require(_0x6fa2('0xe'));var Papa=require(_0x6fa2('0xf'));var AWS=require(_0x6fa2('0x10'));var uuidv4=require(_0x6fa2('0x11'));var Redis=require(_0x6fa2('0x12'));var authService=require(_0x6fa2('0x13'));var qs=require(_0x6fa2('0x14'));var as=require(_0x6fa2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6fa2('0x16'))(_0x6fa2('0x17'));var utils=require(_0x6fa2('0x18'));var config=require(_0x6fa2('0x19'));var licenseUtil=require(_0x6fa2('0x1a'));var db=require(_0x6fa2('0x1b'))['db'];function respondWithStatusCode(_0xf0538c,_0x4b5e99){_0x4b5e99=_0x4b5e99||0xcc;return function(_0x435845){if(_0x435845){return _0xf0538c[_0x6fa2('0x1c')](_0x4b5e99);}return _0xf0538c[_0x6fa2('0x1d')](_0x4b5e99)['end']();};}function respondWithResult(_0xa34159,_0x3b6d50){_0x3b6d50=_0x3b6d50||0xc8;return function(_0x389ae1){if(_0x389ae1){return _0xa34159[_0x6fa2('0x1d')](_0x3b6d50)[_0x6fa2('0x1e')](_0x389ae1);}};}function respondWithFilteredResult(_0x5f4a65,_0x5bff0a){return function(_0x4cb96b){if(_0x4cb96b){var _0x1e05ba=typeof _0x5bff0a[_0x6fa2('0x1f')]===_0x6fa2('0x20')&&typeof _0x5bff0a['limit']===_0x6fa2('0x20');var _0x3ef3e4=_0x4cb96b['count'];var _0xc0f49a=_0x1e05ba?0x0:_0x5bff0a[_0x6fa2('0x1f')];var _0x1efe52=_0x1e05ba?_0x4cb96b['count']:_0x5bff0a[_0x6fa2('0x1f')]+_0x5bff0a[_0x6fa2('0x21')];var _0x437a2f;if(_0x1efe52>=_0x3ef3e4){_0x1efe52=_0x3ef3e4;_0x437a2f=0xc8;}else{_0x437a2f=0xce;}_0x5f4a65[_0x6fa2('0x1d')](_0x437a2f);return _0x5f4a65['set'](_0x6fa2('0x22'),_0xc0f49a+'-'+_0x1efe52+'/'+_0x3ef3e4)[_0x6fa2('0x1e')](_0x4cb96b);}return null;};}function patchUpdates(_0x540808){return function(_0x2330f4){try{jsonpatch[_0x6fa2('0x23')](_0x2330f4,_0x540808,!![]);}catch(_0x5dc066){return BPromise[_0x6fa2('0x24')](_0x5dc066);}return _0x2330f4['save']();};}function saveUpdates(_0x362a65,_0x499d28){return function(_0x1bcd23){if(_0x1bcd23){return _0x1bcd23[_0x6fa2('0x25')](_0x362a65)['then'](function(_0x43f719){return _0x43f719;});}return null;};}function removeEntity(_0x75bc42,_0x5abe42){return function(_0x52b633){if(_0x52b633){return _0x52b633[_0x6fa2('0x26')]()[_0x6fa2('0x27')](function(){_0x75bc42[_0x6fa2('0x1d')](0xcc)[_0x6fa2('0x28')]();});}};}function handleEntityNotFound(_0x2ae3e3,_0x2522c6){return function(_0x4c7f31){if(!_0x4c7f31){_0x2ae3e3[_0x6fa2('0x1c')](0x194);}return _0x4c7f31;};}function handleError(_0x125769,_0x54411d){_0x54411d=_0x54411d||0x1f4;return function(_0x1538bc){logger[_0x6fa2('0x29')](_0x1538bc[_0x6fa2('0x2a')]);if(_0x1538bc[_0x6fa2('0x2b')]){delete _0x1538bc['name'];}_0x125769[_0x6fa2('0x1d')](_0x54411d)[_0x6fa2('0x2c')](_0x1538bc);};}exports['index']=function(_0x37205e,_0x54d582){var _0x5c3afc={},_0x5bc1f7={},_0x4a13d7={'count':0x0,'rows':[]};var _0x450f4f=_['map'](db[_0x6fa2('0x2d')][_0x6fa2('0x2e')],function(_0x3111a7){return{'name':_0x3111a7[_0x6fa2('0x2f')],'type':_0x3111a7[_0x6fa2('0x30')][_0x6fa2('0x31')]};});_0x5bc1f7[_0x6fa2('0x32')]=_[_0x6fa2('0x33')](_['map'](_0x450f4f,_0x6fa2('0x2b')),[_0x6fa2('0x34')]);_0x5bc1f7['query']=_['keys'](_0x37205e['query']);_0x5bc1f7[_0x6fa2('0x35')]=_[_0x6fa2('0x36')](_0x5bc1f7[_0x6fa2('0x32')],_0x5bc1f7[_0x6fa2('0x37')]);_0x5c3afc[_0x6fa2('0x38')]=_[_0x6fa2('0x36')](_0x5bc1f7['model'],qs[_0x6fa2('0x39')](_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x39')]));_0x5c3afc[_0x6fa2('0x38')]=_0x5c3afc['attributes'][_0x6fa2('0x3a')]?_0x5c3afc[_0x6fa2('0x38')]:_0x5bc1f7[_0x6fa2('0x32')];if(!_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x5c3afc[_0x6fa2('0x21')]=qs[_0x6fa2('0x21')](_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x21')]);_0x5c3afc[_0x6fa2('0x1f')]=qs['offset'](_0x37205e['query'][_0x6fa2('0x1f')]);}_0x5c3afc[_0x6fa2('0x3d')]=qs[_0x6fa2('0x3e')](_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x3e')]);_0x5c3afc['where']=qs[_0x6fa2('0x35')](_[_0x6fa2('0x3f')](_0x37205e[_0x6fa2('0x37')],_0x5bc1f7[_0x6fa2('0x35')]),_0x450f4f);if(_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x40')]){_0x5c3afc[_0x6fa2('0x41')]=_[_0x6fa2('0x42')](_0x5c3afc[_0x6fa2('0x41')],{'$or':_[_0x6fa2('0x43')](_0x450f4f,function(_0x506b3c){if(_0x506b3c['type']!=='VIRTUAL'){var _0x2e85b7={};_0x2e85b7[_0x506b3c[_0x6fa2('0x2b')]]={'$like':'%'+_0x37205e[_0x6fa2('0x37')][_0x6fa2('0x40')]+'%'};return _0x2e85b7;}})});}_0x5c3afc=_['merge']({},_0x5c3afc,_0x37205e[_0x6fa2('0x44')]);var _0x17e8af={'where':_0x5c3afc[_0x6fa2('0x41')]};return db[_0x6fa2('0x2d')][_0x6fa2('0x45')](_0x17e8af)[_0x6fa2('0x27')](function(_0x59d3a0){_0x4a13d7[_0x6fa2('0x45')]=_0x59d3a0;if(_0x37205e['query']['includeAll']){_0x5c3afc[_0x6fa2('0x46')]=[{'all':!![]}];}return db['VoiceRecording'][_0x6fa2('0x47')](_0x5c3afc);})[_0x6fa2('0x27')](function(_0x17d27a){_0x4a13d7[_0x6fa2('0x48')]=_0x17d27a;return _0x4a13d7;})['then'](respondWithFilteredResult(_0x54d582,_0x5c3afc))[_0x6fa2('0x49')](handleError(_0x54d582,null));};exports[_0x6fa2('0x4a')]=function(_0x41675f,_0x161d9c){var _0x52d21e={'raw':![],'where':{'id':_0x41675f[_0x6fa2('0x4b')]['id']}},_0x36003f={};_0x36003f[_0x6fa2('0x32')]=_['keys'](db[_0x6fa2('0x2d')]['rawAttributes']);_0x36003f['query']=_[_0x6fa2('0x4c')](_0x41675f[_0x6fa2('0x37')]);_0x36003f['filters']=_['intersection'](_0x36003f[_0x6fa2('0x32')],_0x36003f[_0x6fa2('0x37')]);_0x52d21e[_0x6fa2('0x38')]=_[_0x6fa2('0x36')](_0x36003f[_0x6fa2('0x32')],qs[_0x6fa2('0x39')](_0x41675f[_0x6fa2('0x37')][_0x6fa2('0x39')]));_0x52d21e[_0x6fa2('0x38')]=_0x52d21e[_0x6fa2('0x38')]['length']?_0x52d21e['attributes']:_0x36003f[_0x6fa2('0x32')];if(_0x41675f['query'][_0x6fa2('0x4d')]){_0x52d21e[_0x6fa2('0x46')]=[{'all':!![]}];}_0x52d21e=_[_0x6fa2('0x42')]({},_0x52d21e,_0x41675f[_0x6fa2('0x44')]);return db[_0x6fa2('0x2d')]['find'](_0x52d21e)[_0x6fa2('0x27')](handleEntityNotFound(_0x161d9c,null))[_0x6fa2('0x27')](respondWithResult(_0x161d9c,null))[_0x6fa2('0x49')](handleError(_0x161d9c,null));};exports[_0x6fa2('0x4e')]=function(_0x143140,_0xd4bfd1){return db['VoiceRecording'][_0x6fa2('0x4e')](_0x143140['body'],{})['then'](respondWithResult(_0xd4bfd1,0xc9))['catch'](handleError(_0xd4bfd1,null));};exports[_0x6fa2('0x25')]=function(_0x555466,_0x3b6717){if(_0x555466[_0x6fa2('0x4f')]['id']){delete _0x555466[_0x6fa2('0x4f')]['id'];}return db[_0x6fa2('0x2d')][_0x6fa2('0x50')]({'where':{'id':_0x555466[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x27')](handleEntityNotFound(_0x3b6717,null))[_0x6fa2('0x27')](saveUpdates(_0x555466[_0x6fa2('0x4f')],null))['then'](respondWithResult(_0x3b6717,null))[_0x6fa2('0x49')](handleError(_0x3b6717,null));};exports[_0x6fa2('0x51')]=function(_0x45cd74,_0xdd5d76){return db[_0x6fa2('0x2d')][_0x6fa2('0x51')]()['then'](respondWithResult(_0xdd5d76,null))[_0x6fa2('0x49')](handleError(_0xdd5d76,null));};exports[_0x6fa2('0x52')]=function(_0x161f45,_0x1e1a95,_0x205318){var _0x331cd0=require(_0x6fa2('0x53'));var _0x58699e=![];var _0x1b44aa={};if(_0x161f45[_0x6fa2('0x37')]['type']&&_0x161f45['query']['type']==='uniqueid'){_0x1b44aa[_0x6fa2('0x54')]=_0x161f45[_0x6fa2('0x4b')]['id'];}else{_0x1b44aa['id']=_0x161f45[_0x6fa2('0x4b')]['id'];}return db[_0x6fa2('0x2d')][_0x6fa2('0x50')]({'where':_0x1b44aa,'attributes':['id',_0x6fa2('0x55')],'raw':!![]})[_0x6fa2('0x27')](handleEntityNotFound(_0x1e1a95,null))['then'](function(_0x552c20){if(_0x552c20){var _0x355c5e=_0x552c20[_0x6fa2('0x55')];var _0x5955fc=util[_0x6fa2('0x34')](_0x6fa2('0x56'),_0x355c5e);if(fs[_0x6fa2('0x57')](_0x5955fc)){_0x58699e=!![];return _0x331cd0[_0x6fa2('0x58')](_0x5955fc,_0x355c5e,config[_0x6fa2('0x59')][_0x6fa2('0x5a')])[_0x6fa2('0x27')](function(){return _0x552c20;});}return _0x552c20;}})[_0x6fa2('0x27')](function(_0x38cab2){if(_0x38cab2){var _0x205a92=_0x38cab2['value'];if(!fs[_0x6fa2('0x57')](_0x205a92)){throw new db[(_0x6fa2('0x5b'))][(_0x6fa2('0x5c'))](_0x6fa2('0x5d'));}if(_0x38cab2[_0x6fa2('0x5e')]){return _0x1e1a95['download'](_0x205a92,_0x38cab2[_0x6fa2('0x5e')]+path[_0x6fa2('0x5f')](_0x205a92),function(){if(_0x58699e){fs[_0x6fa2('0x60')](_0x205a92);}});}else{return _0x1e1a95['download'](_0x205a92,function(_0x1adf1a){if(_0x58699e){fs[_0x6fa2('0x60')](_0x205a92);}});}}})[_0x6fa2('0x49')](function(_0x45881a){if(_0x45881a[_0x6fa2('0x61')]===_0x6fa2('0x5d')){_0x1e1a95['status'](0x194)[_0x6fa2('0x2c')]('Not\x20found');}else{return handleError(_0x1e1a95,null);}});};exports[_0x6fa2('0x62')]=function(_0x41d821,_0x24ab3b,_0xc47748){var _0x5e33b3=require(_0x6fa2('0x53'));var _0x515506=![];var _0x330ae5={'$and':[db[_0x6fa2('0x63')]['where'](db[_0x6fa2('0x63')]['fn'](_0x6fa2('0x64'),db['sequelize'][_0x6fa2('0x65')]('uniqueid')),_0x41d821[_0x6fa2('0x37')]['token'])]};if(_0x41d821[_0x6fa2('0x37')][_0x6fa2('0x30')]&&_0x41d821['query'][_0x6fa2('0x30')]===_0x6fa2('0x54')){_0x330ae5[_0x6fa2('0x66')]['push']({'uniqueid':_0x41d821['params']['id']});}else{_0x330ae5[_0x6fa2('0x66')][_0x6fa2('0x67')]({'id':_0x41d821[_0x6fa2('0x4b')]['id']});}return db[_0x6fa2('0x2d')][_0x6fa2('0x50')]({'where':_0x330ae5,'attributes':['id',_0x6fa2('0x55')],'raw':!![]})[_0x6fa2('0x27')](handleEntityNotFound(_0x24ab3b,null))[_0x6fa2('0x27')](function(_0x28daf4){if(_0x28daf4){var _0x31a4c9=util[_0x6fa2('0x34')](_0x6fa2('0x56'),_0x28daf4[_0x6fa2('0x55')]);if(fs[_0x6fa2('0x57')](_0x31a4c9)){_0x515506=!![];return _0x5e33b3[_0x6fa2('0x58')](_0x31a4c9,_0x28daf4['value'],config[_0x6fa2('0x59')][_0x6fa2('0x5a')])[_0x6fa2('0x27')](function(){return _0x28daf4;});}return _0x28daf4;}})['then'](function(_0x1e1656){if(_0x1e1656){if(!fs[_0x6fa2('0x57')](_0x1e1656[_0x6fa2('0x55')])){throw new db['Sequelize'][(_0x6fa2('0x5c'))](_0x6fa2('0x5d'));}if(_0x1e1656[_0x6fa2('0x5e')]){return _0x24ab3b[_0x6fa2('0x52')](_0x1e1656[_0x6fa2('0x55')],_0x1e1656[_0x6fa2('0x5e')]+path[_0x6fa2('0x5f')](_0x1e1656[_0x6fa2('0x55')]),function(){if(_0x515506){fs[_0x6fa2('0x60')](_0x1e1656['value']);}});}else{return _0x24ab3b[_0x6fa2('0x52')](_0x1e1656['value'],function(_0x4e2a69){if(_0x515506){fs[_0x6fa2('0x60')](_0x1e1656[_0x6fa2('0x55')]);}});}}})['catch'](handleError(_0x24ab3b,null));};exports[_0x6fa2('0x26')]=function(_0x5bd3b1,_0xacfa4a){return db[_0x6fa2('0x2d')]['find']({'where':{'id':_0x5bd3b1[_0x6fa2('0x4b')]['id']}})['then'](function(_0x54b64b){if(_[_0x6fa2('0x68')](_0x54b64b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x54b64b;})[_0x6fa2('0x27')](function(_0x4533e5){var _0x389c3a=_0x4533e5[_0x6fa2('0x55')];logger['info'](_0x6fa2('0x69'),_0x389c3a);if(!_[_0x6fa2('0x68')](_0x4533e5['value'])&&fs[_0x6fa2('0x57')](_0x389c3a)){logger[_0x6fa2('0x6a')](_0x6fa2('0x6b')+_0x389c3a+_0x6fa2('0x6c'));fs[_0x6fa2('0x6d')](_0x389c3a);}_0x389c3a=_0x389c3a+'.cypher';if(!_[_0x6fa2('0x68')](_0x4533e5[_0x6fa2('0x55')])&&fs[_0x6fa2('0x57')](_0x389c3a)){logger[_0x6fa2('0x6a')]('File:\x20\x22'+_0x389c3a+_0x6fa2('0x6c'));fs[_0x6fa2('0x6d')](_0x389c3a);}return _0x4533e5;})[_0x6fa2('0x27')](function(_0x14269d){if(!_0x14269d)throw new InternalError();return _0x14269d[_0x6fa2('0x26')]();})[_0x6fa2('0x27')](function(){_0xacfa4a['status'](0xcc)['end']();})[_0x6fa2('0x49')](handleError(_0xacfa4a,null));};function getBucketslist(_0x14c2c4,_0x4e1368,_0x408595){return new Promise(function(_0x995101,_0x4b2435){var _0x3db092=new AWS['S3']({'accessKeyId':_0x4e1368,'secretAccessKey':_0x14c2c4,'region':_0x408595});_0x3db092['listBuckets']({},function(_0x5d67d7,_0x5e1ecb){if(_0x5d67d7){return _0x4b2435(_0x5d67d7);}else{return _0x995101(_0x5e1ecb);}});});}function createBucket(_0x4d553c,_0x11b48c,_0x4fc9ce,_0x75bd49){return new Promise(function(_0x146c70,_0x6c435e){var _0x504c33=new AWS['S3']({'accessKeyId':_0x11b48c,'secretAccessKey':_0x4d553c,'region':_0x4fc9ce});_0x504c33[_0x6fa2('0x6e')]({'Bucket':_0x75bd49},function(_0x1a8f64,_0x25d842){if(_0x1a8f64){return _0x6c435e(_0x1a8f64);}else{return _0x146c70(_0x25d842);}});});}function uploadFile(_0x2c8478,_0x98fdd4,_0x359d2b,_0x4c38b4,_0x451fa8,_0xd9d8b2){return new Promise(function(_0x2ba09b,_0x146636){var _0x2d220=new AWS['S3']({'accessKeyId':_0x98fdd4,'secretAccessKey':_0x2c8478,'region':_0x359d2b});_0x2d220[_0x6fa2('0x6f')]({'Bucket':_0x4c38b4,'Key':_0x451fa8,'Body':_0xd9d8b2},function(_0x216100,_0x5f50d8){if(_0x216100){return _0x146636(_0x216100);}else{return _0x2ba09b(_0x5f50d8);}});});}function startTranscribe(_0x2be21a,_0x5ddf98,_0x2763d4,_0x2926f7,_0x294c87,_0x4ffa47){return new Promise(function(_0x283ed5,_0x5596e6){var _0x6ebbc3=new AWS[(_0x6fa2('0x70'))]({'accessKeyId':_0x5ddf98,'secretAccessKey':_0x2be21a,'region':_0x2763d4});_0x6ebbc3[_0x6fa2('0x71')]({'TranscriptionJobName':_0x2926f7,'LanguageCode':_0x294c87,'Media':{'MediaFileUri':_0x4ffa47}},function(_0x273c47,_0x4c7856){if(_0x273c47){return _0x5596e6(_0x273c47);}else{return _0x283ed5(_0x4c7856);}});});}function transcribe(_0x4d0b5e,_0x258ea7,_0xdbf208,_0x5ceff3,_0x1e84cf,_0x328522,_0x1a09a9){return new Promise(function(_0x22097d,_0x26ef39){var _0x454abf={};logger[_0x6fa2('0x6a')](util['format'](_0x6fa2('0x72'),_0x4d0b5e,_0x1e84cf));return uploadFile(_0x258ea7,_0xdbf208,_0x5ceff3,_0x1e84cf,path[_0x6fa2('0x73')](_0x328522),fs[_0x6fa2('0x74')](_0x328522))['then'](function(_0x1e23f5){logger['info'](util[_0x6fa2('0x34')](_0x6fa2('0x75'),_0x4d0b5e,_0x1e84cf,_0x1e23f5[_0x6fa2('0x76')]));_0x454abf[_0x6fa2('0x77')]=_0x1e23f5['Bucket'];_0x454abf[_0x6fa2('0x78')]=_0x1e23f5['Location'];logger[_0x6fa2('0x6a')](util[_0x6fa2('0x34')](_0x6fa2('0x79'),_0x4d0b5e));return startTranscribe(_0x258ea7,_0xdbf208,_0x5ceff3,uuidv4(),_0x1a09a9,_0x1e23f5[_0x6fa2('0x76')]);})[_0x6fa2('0x27')](function(_0x1307aa){logger[_0x6fa2('0x6a')](util[_0x6fa2('0x34')](_0x6fa2('0x7a'),_0x4d0b5e,_0x1307aa[_0x6fa2('0x7b')]['TranscriptionJobName']));_0x454abf['transcribeName']=_0x1307aa[_0x6fa2('0x7b')][_0x6fa2('0x7c')];_0x454abf[_0x6fa2('0x7d')]=_0x1307aa[_0x6fa2('0x7b')][_0x6fa2('0x7e')];return _0x22097d(_0x454abf);})['catch'](function(_0x4e2bdb){return _0x26ef39(_0x4e2bdb);});});}exports['runTranscribe']=function(_0x270272,_0x3cdfcf,_0xc965f){var _0x3e0adf;var _0x40ff5e;var _0xebf14a;var _0x4d2976=require('../../components/encryptor');return db[_0x6fa2('0x2d')][_0x6fa2('0x7f')]({'where':{'id':_0x270272[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x27')](function(_0x419a6e){if(_0x419a6e){var _0x4712e3=util[_0x6fa2('0x34')](_0x6fa2('0x56'),_0x419a6e['value']);if(fs['existsSync'](_0x4712e3)){cypher=!![];return _0x4d2976['decryptFile'](_0x4712e3,_0x419a6e[_0x6fa2('0x55')],config[_0x6fa2('0x59')][_0x6fa2('0x5a')])[_0x6fa2('0x27')](function(){return _0x419a6e;});}return _0x419a6e;}})[_0x6fa2('0x27')](function(_0x21451f){if(!_0x21451f){throw new db[(_0x6fa2('0x5b'))]['ValidationError'](_0x6fa2('0x80'));}_0x40ff5e=_0x21451f;return db[_0x6fa2('0x81')]['findOne']({'where':{'id':0x1}});})[_0x6fa2('0x27')](handleEntityNotFound(_0x3cdfcf,null))['then'](function(_0x759d47){if(_0x759d47){_0x3e0adf=_0x759d47;if(!_0x3e0adf['transcribe']||!_0x3e0adf['transcribeAccountId']||!_0x3e0adf[_0x6fa2('0x82')]||!_0x3e0adf[_0x6fa2('0x83')]||!_0x3e0adf[_0x6fa2('0x77')]){throw new db[(_0x6fa2('0x5b'))][(_0x6fa2('0x5c'))](_0x6fa2('0x84'));}if(_0x270272[_0x6fa2('0x4f')][_0x6fa2('0x85')]&&(!_0x3e0adf[_0x6fa2('0x86')]||!_0x3e0adf[_0x6fa2('0x87')]||!_0x3e0adf['sentimentRegion']||!_0x3e0adf['language']||!_0x3e0adf[_0x6fa2('0x77')])){throw new db[(_0x6fa2('0x5b'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x6fa2('0x88')]['findOne']({'where':{'id':_0x3e0adf[_0x6fa2('0x89')]}});}})[_0x6fa2('0x27')](function(_0xffc311){if(!_0xffc311){throw new db[(_0x6fa2('0x5b'))]['ValidationError'](_0x6fa2('0x8a'));}if(!_0xffc311[_0x6fa2('0x8b')]||!_0xffc311[_0x6fa2('0x8c')]){throw new db[(_0x6fa2('0x5b'))]['ValidationError'](_0x6fa2('0x8d'));}_0xebf14a=_0xffc311;return getBucketslist(_0xebf14a[_0x6fa2('0x8b')],_0xebf14a[_0x6fa2('0x8c')],_0x3e0adf['transcribeRegion']);})[_0x6fa2('0x27')](function(_0x4fdfd9){if(_0x4fdfd9&&_0x4fdfd9[_0x6fa2('0x8e')]){var _0x210a3b=_[_0x6fa2('0x50')](_0x4fdfd9[_0x6fa2('0x8e')],function(_0x44b56f){return _0x44b56f['Name']===_0x3e0adf['bucket'];});if(!_0x210a3b){logger[_0x6fa2('0x6a')](util[_0x6fa2('0x34')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x270272[_0x6fa2('0x4b')]['id'],_0x3e0adf[_0x6fa2('0x77')]));return createBucket(_0xebf14a[_0x6fa2('0x8b')],_0xebf14a[_0x6fa2('0x8c')],_0x3e0adf[_0x6fa2('0x82')],_0x3e0adf[_0x6fa2('0x77')]);}logger['info'](util['format'](_0x6fa2('0x8f'),_0x270272[_0x6fa2('0x4b')]['id'],_0x3e0adf[_0x6fa2('0x77')]));return;}})[_0x6fa2('0x27')](function(_0x945951){if(_0x40ff5e['transcribeStatus']===_0x6fa2('0x90')){return transcribe(_0x270272[_0x6fa2('0x4b')]['id'],_0xebf14a['data1'],_0xebf14a[_0x6fa2('0x8c')],_0x3e0adf[_0x6fa2('0x82')],_0x3e0adf[_0x6fa2('0x77')],_0x40ff5e['value'],_0x3e0adf[_0x6fa2('0x83')]);}else{logger[_0x6fa2('0x6a')](util['format'](_0x6fa2('0x91'),_0x270272['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x6fa2('0x27')](function(_0xf17cd0){if(_0xf17cd0){_0xf17cd0[_0x6fa2('0x92')]=_0x270272['body']['runSentiment'];return _0x40ff5e[_0x6fa2('0x93')](_0xf17cd0);}})[_0x6fa2('0x27')](respondWithResult(_0x3cdfcf,null))['catch'](handleError(_0x3cdfcf,null));};function writeFile(_0x3e7110,_0x2018d5){return new Promise(function(_0x18c9d8,_0xd34cb3){fs[_0x6fa2('0x94')](_0x2018d5,_0x3e7110,function(_0x1340da,_0x496764){if(_0x1340da){return _0xd34cb3(_0x1340da);}else{return _0x18c9d8(_0x496764);}});});}exports['downloadTranscribe']=function(_0x586213,_0x375bc1,_0x3198e5){return db[_0x6fa2('0x2d')][_0x6fa2('0x7f')]({'where':{'id':_0x586213['params']['id']}})[_0x6fa2('0x27')](handleEntityNotFound(_0x375bc1))[_0x6fa2('0x27')](function(_0x41d911){if(_0x41d911&&_0x41d911['fileText']){var _0x46d35d=_0x41d911[_0x6fa2('0x95')];var _0x1a8b72=config[_0x6fa2('0x96')]+_0x6fa2('0x97')+_0x41d911['id']+_0x6fa2('0x98');if(fs[_0x6fa2('0x57')](_0x1a8b72)){return _0x1a8b72;}return writeFile(_0x46d35d,_0x1a8b72)[_0x6fa2('0x27')](function(){return _0x1a8b72;});}else{throw new db[(_0x6fa2('0x5b'))][(_0x6fa2('0x5c'))]('Transcript\x20not\x20available');}})[_0x6fa2('0x27')](function(_0xf9dd28){return _0x375bc1[_0x6fa2('0x52')](_0xf9dd28);})[_0x6fa2('0x49')](handleError(_0x375bc1));}; \ No newline at end of file +var _0x1c50=['root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','uuid/v4','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','save','update','then','destroy','stack','name','index','map','VoiceRecording','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','isNil','Entity\x20not\x20found','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c50,0x124));var _0x01c5=function(_0x4d1819,_0x45f54d){_0x4d1819=_0x4d1819-0x0;var _0xc1e0e6=_0x1c50[_0x4d1819];return _0xc1e0e6;};'use strict';var emlformat=require(_0x01c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01c5('0x1'));var jsonpatch=require(_0x01c5('0x2'));var rp=require(_0x01c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x01c5('0x4'));var util=require(_0x01c5('0x5'));var path=require(_0x01c5('0x6'));var sox=require(_0x01c5('0x7'));var csv=require(_0x01c5('0x8'));var ejs=require(_0x01c5('0x9'));var fs=require('fs');var fs_extra=require(_0x01c5('0xa'));var _=require(_0x01c5('0xb'));var squel=require(_0x01c5('0xc'));var crypto=require(_0x01c5('0xd'));var jsforce=require(_0x01c5('0xe'));var deskjs=require(_0x01c5('0xf'));var toCsv=require(_0x01c5('0x8'));var querystring=require(_0x01c5('0x10'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x01c5('0x11'));var Redis=require('ioredis');var authService=require(_0x01c5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01c5('0x13'));var logger=require('../../config/logger')(_0x01c5('0x14'));var utils=require('../../config/utils');var config=require(_0x01c5('0x15'));var licenseUtil=require(_0x01c5('0x16'));var db=require(_0x01c5('0x17'))['db'];function respondWithStatusCode(_0x4079e1,_0x49cf85){_0x49cf85=_0x49cf85||0xcc;return function(_0x122249){if(_0x122249){return _0x4079e1[_0x01c5('0x18')](_0x49cf85);}return _0x4079e1[_0x01c5('0x19')](_0x49cf85)[_0x01c5('0x1a')]();};}function respondWithResult(_0x3eb5ff,_0x198e92){_0x198e92=_0x198e92||0xc8;return function(_0xfb41dc){if(_0xfb41dc){return _0x3eb5ff[_0x01c5('0x19')](_0x198e92)['json'](_0xfb41dc);}};}function respondWithFilteredResult(_0x2efb13,_0x14aa9d){return function(_0x59af42){if(_0x59af42){var _0x458296=typeof _0x14aa9d[_0x01c5('0x1b')]==='undefined'&&typeof _0x14aa9d['limit']===_0x01c5('0x1c');var _0x1ab595=_0x59af42[_0x01c5('0x1d')];var _0x3bf7e9=_0x458296?0x0:_0x14aa9d[_0x01c5('0x1b')];var _0x9e68d8=_0x458296?_0x59af42[_0x01c5('0x1d')]:_0x14aa9d[_0x01c5('0x1b')]+_0x14aa9d['limit'];var _0x525ed7;if(_0x9e68d8>=_0x1ab595){_0x9e68d8=_0x1ab595;_0x525ed7=0xc8;}else{_0x525ed7=0xce;}_0x2efb13[_0x01c5('0x19')](_0x525ed7);return _0x2efb13['set'](_0x01c5('0x1e'),_0x3bf7e9+'-'+_0x9e68d8+'/'+_0x1ab595)['json'](_0x59af42);}return null;};}function patchUpdates(_0x417580){return function(_0x47ab79){try{jsonpatch['apply'](_0x47ab79,_0x417580,!![]);}catch(_0x44a986){return BPromise['reject'](_0x44a986);}return _0x47ab79[_0x01c5('0x1f')]();};}function saveUpdates(_0x46d8ae,_0x16f205){return function(_0x1f0c65){if(_0x1f0c65){return _0x1f0c65[_0x01c5('0x20')](_0x46d8ae)[_0x01c5('0x21')](function(_0x10582c){return _0x10582c;});}return null;};}function removeEntity(_0x529628,_0x53ba51){return function(_0x51f7ef){if(_0x51f7ef){return _0x51f7ef[_0x01c5('0x22')]()[_0x01c5('0x21')](function(){_0x529628[_0x01c5('0x19')](0xcc)[_0x01c5('0x1a')]();});}};}function handleEntityNotFound(_0x20edc4,_0x57b9cc){return function(_0x47abb0){if(!_0x47abb0){_0x20edc4[_0x01c5('0x18')](0x194);}return _0x47abb0;};}function handleError(_0x34c1c1,_0x3985c9){_0x3985c9=_0x3985c9||0x1f4;return function(_0x42eec8){logger['error'](_0x42eec8[_0x01c5('0x23')]);if(_0x42eec8[_0x01c5('0x24')]){delete _0x42eec8['name'];}_0x34c1c1[_0x01c5('0x19')](_0x3985c9)['send'](_0x42eec8);};}exports[_0x01c5('0x25')]=function(_0x466c62,_0x3aa76c){var _0x4f2ec7={},_0x20facc={},_0x5d2719={'count':0x0,'rows':[]};var _0x14dbba=_[_0x01c5('0x26')](db[_0x01c5('0x27')][_0x01c5('0x28')],function(_0x2caa76){return{'name':_0x2caa76['fieldName'],'type':_0x2caa76[_0x01c5('0x29')][_0x01c5('0x2a')]};});_0x20facc[_0x01c5('0x2b')]=_['differenceBy'](_[_0x01c5('0x26')](_0x14dbba,_0x01c5('0x24')),['format']);_0x20facc[_0x01c5('0x2c')]=_[_0x01c5('0x2d')](_0x466c62[_0x01c5('0x2c')]);_0x20facc['filters']=_['intersection'](_0x20facc[_0x01c5('0x2b')],_0x20facc[_0x01c5('0x2c')]);_0x4f2ec7[_0x01c5('0x2e')]=_[_0x01c5('0x2f')](_0x20facc[_0x01c5('0x2b')],qs[_0x01c5('0x30')](_0x466c62[_0x01c5('0x2c')][_0x01c5('0x30')]));_0x4f2ec7[_0x01c5('0x2e')]=_0x4f2ec7[_0x01c5('0x2e')][_0x01c5('0x31')]?_0x4f2ec7[_0x01c5('0x2e')]:_0x20facc[_0x01c5('0x2b')];if(!_0x466c62['query'][_0x01c5('0x32')]('nolimit')){_0x4f2ec7['limit']=qs[_0x01c5('0x33')](_0x466c62[_0x01c5('0x2c')][_0x01c5('0x33')]);_0x4f2ec7[_0x01c5('0x1b')]=qs['offset'](_0x466c62[_0x01c5('0x2c')][_0x01c5('0x1b')]);}_0x4f2ec7[_0x01c5('0x34')]=qs[_0x01c5('0x35')](_0x466c62[_0x01c5('0x2c')]['sort']);_0x4f2ec7[_0x01c5('0x36')]=qs[_0x01c5('0x37')](_[_0x01c5('0x38')](_0x466c62[_0x01c5('0x2c')],_0x20facc[_0x01c5('0x37')]),_0x14dbba);if(_0x466c62['query'][_0x01c5('0x39')]){_0x4f2ec7[_0x01c5('0x36')]=_['merge'](_0x4f2ec7[_0x01c5('0x36')],{'$or':_[_0x01c5('0x26')](_0x14dbba,function(_0x5eeb71){if(_0x5eeb71[_0x01c5('0x29')]!=='VIRTUAL'){var _0x5bac61={};_0x5bac61[_0x5eeb71[_0x01c5('0x24')]]={'$like':'%'+_0x466c62['query'][_0x01c5('0x39')]+'%'};return _0x5bac61;}})});}_0x4f2ec7=_[_0x01c5('0x3a')]({},_0x4f2ec7,_0x466c62['options']);var _0x27ea73={'where':_0x4f2ec7[_0x01c5('0x36')]};return db[_0x01c5('0x27')]['count'](_0x27ea73)[_0x01c5('0x21')](function(_0x1ec24d){_0x5d2719['count']=_0x1ec24d;if(_0x466c62[_0x01c5('0x2c')][_0x01c5('0x3b')]){_0x4f2ec7[_0x01c5('0x3c')]=[{'all':!![]}];}return db[_0x01c5('0x27')][_0x01c5('0x3d')](_0x4f2ec7);})[_0x01c5('0x21')](function(_0x500fff){_0x5d2719[_0x01c5('0x3e')]=_0x500fff;return _0x5d2719;})['then'](respondWithFilteredResult(_0x3aa76c,_0x4f2ec7))['catch'](handleError(_0x3aa76c,null));};exports[_0x01c5('0x3f')]=function(_0x37da24,_0x79c254){var _0x5bf6d0={'raw':![],'where':{'id':_0x37da24[_0x01c5('0x40')]['id']}},_0x2aa4e0={};_0x2aa4e0[_0x01c5('0x2b')]=_['keys'](db['VoiceRecording'][_0x01c5('0x28')]);_0x2aa4e0[_0x01c5('0x2c')]=_['keys'](_0x37da24[_0x01c5('0x2c')]);_0x2aa4e0['filters']=_[_0x01c5('0x2f')](_0x2aa4e0[_0x01c5('0x2b')],_0x2aa4e0['query']);_0x5bf6d0[_0x01c5('0x2e')]=_['intersection'](_0x2aa4e0['model'],qs[_0x01c5('0x30')](_0x37da24[_0x01c5('0x2c')][_0x01c5('0x30')]));_0x5bf6d0[_0x01c5('0x2e')]=_0x5bf6d0[_0x01c5('0x2e')][_0x01c5('0x31')]?_0x5bf6d0[_0x01c5('0x2e')]:_0x2aa4e0[_0x01c5('0x2b')];if(_0x37da24['query'][_0x01c5('0x3b')]){_0x5bf6d0[_0x01c5('0x3c')]=[{'all':!![]}];}_0x5bf6d0=_[_0x01c5('0x3a')]({},_0x5bf6d0,_0x37da24['options']);return db[_0x01c5('0x27')][_0x01c5('0x41')](_0x5bf6d0)['then'](handleEntityNotFound(_0x79c254,null))[_0x01c5('0x21')](respondWithResult(_0x79c254,null))[_0x01c5('0x42')](handleError(_0x79c254,null));};exports[_0x01c5('0x43')]=function(_0xe2c2a4,_0x1127e6){return db['VoiceRecording'][_0x01c5('0x43')](_0xe2c2a4[_0x01c5('0x44')],{})['then'](respondWithResult(_0x1127e6,0xc9))[_0x01c5('0x42')](handleError(_0x1127e6,null));};exports[_0x01c5('0x20')]=function(_0x5d04f4,_0x3033dc){if(_0x5d04f4[_0x01c5('0x44')]['id']){delete _0x5d04f4[_0x01c5('0x44')]['id'];}return db['VoiceRecording'][_0x01c5('0x41')]({'where':{'id':_0x5d04f4[_0x01c5('0x40')]['id']}})[_0x01c5('0x21')](handleEntityNotFound(_0x3033dc,null))['then'](saveUpdates(_0x5d04f4[_0x01c5('0x44')],null))['then'](respondWithResult(_0x3033dc,null))[_0x01c5('0x42')](handleError(_0x3033dc,null));};exports[_0x01c5('0x45')]=function(_0x550ce3,_0x3dce42){return db[_0x01c5('0x27')][_0x01c5('0x45')]()[_0x01c5('0x21')](respondWithResult(_0x3dce42,null))[_0x01c5('0x42')](handleError(_0x3dce42,null));};exports[_0x01c5('0x46')]=function(_0x4314a2,_0x23e09a,_0x2e8b7d){var _0x1f554b=require(_0x01c5('0x47'));var _0x49b1ac=![];var _0x32897c={};if(_0x4314a2['query'][_0x01c5('0x29')]&&_0x4314a2[_0x01c5('0x2c')][_0x01c5('0x29')]===_0x01c5('0x48')){_0x32897c['uniqueid']=_0x4314a2['params']['id'];}else{_0x32897c['id']=_0x4314a2['params']['id'];}return db[_0x01c5('0x27')]['find']({'where':_0x32897c,'attributes':['id',_0x01c5('0x49')],'raw':!![]})[_0x01c5('0x21')](handleEntityNotFound(_0x23e09a,null))[_0x01c5('0x21')](function(_0x10a7bf){if(_0x10a7bf){var _0x382321=_0x10a7bf[_0x01c5('0x49')];var _0x5425cc=util[_0x01c5('0x4a')](_0x01c5('0x4b'),_0x382321);if(fs[_0x01c5('0x4c')](_0x5425cc)){_0x49b1ac=!![];return _0x1f554b[_0x01c5('0x4d')](_0x5425cc,_0x382321,config[_0x01c5('0x4e')][_0x01c5('0x4f')])[_0x01c5('0x21')](function(){return _0x10a7bf;});}return _0x10a7bf;}})[_0x01c5('0x21')](function(_0x2d5185){if(_0x2d5185){var _0x2dd2d2=_0x2d5185[_0x01c5('0x49')];if(!fs[_0x01c5('0x4c')](_0x2dd2d2)){throw new db[(_0x01c5('0x50'))][(_0x01c5('0x51'))](_0x01c5('0x52'));}if(_0x2d5185[_0x01c5('0x53')]){return _0x23e09a[_0x01c5('0x46')](_0x2dd2d2,_0x2d5185[_0x01c5('0x53')]+path[_0x01c5('0x54')](_0x2dd2d2),function(){if(_0x49b1ac){fs[_0x01c5('0x55')](_0x2dd2d2);}});}else{return _0x23e09a[_0x01c5('0x46')](_0x2dd2d2,function(_0x428852){if(_0x49b1ac){fs[_0x01c5('0x55')](_0x2dd2d2);}});}}})[_0x01c5('0x42')](function(_0x1fc770){if(_0x1fc770[_0x01c5('0x56')]===_0x01c5('0x52')){_0x23e09a['status'](0x194)[_0x01c5('0x57')](_0x01c5('0x58'));}else{return handleError(_0x23e09a,null);}});};exports[_0x01c5('0x59')]=function(_0x1eceb1,_0x5a7ade,_0x324a1a){var _0x565b71=require(_0x01c5('0x47'));var _0xb759bb=![];var _0x4808cc={'$and':[db[_0x01c5('0x5a')][_0x01c5('0x36')](db[_0x01c5('0x5a')]['fn'](_0x01c5('0x5b'),db[_0x01c5('0x5a')]['col'](_0x01c5('0x48'))),_0x1eceb1[_0x01c5('0x2c')][_0x01c5('0x5c')])]};if(_0x1eceb1[_0x01c5('0x2c')][_0x01c5('0x29')]&&_0x1eceb1['query'][_0x01c5('0x29')]===_0x01c5('0x48')){_0x4808cc['$and']['push']({'uniqueid':_0x1eceb1[_0x01c5('0x40')]['id']});}else{_0x4808cc[_0x01c5('0x5d')][_0x01c5('0x5e')]({'id':_0x1eceb1[_0x01c5('0x40')]['id']});}return db[_0x01c5('0x27')]['find']({'where':_0x4808cc,'attributes':['id',_0x01c5('0x49')],'raw':!![]})[_0x01c5('0x21')](handleEntityNotFound(_0x5a7ade,null))[_0x01c5('0x21')](function(_0x510790){if(_0x510790){var _0x3e0fdd=util[_0x01c5('0x4a')](_0x01c5('0x4b'),_0x510790['value']);if(fs[_0x01c5('0x4c')](_0x3e0fdd)){_0xb759bb=!![];return _0x565b71[_0x01c5('0x4d')](_0x3e0fdd,_0x510790[_0x01c5('0x49')],config[_0x01c5('0x4e')][_0x01c5('0x4f')])[_0x01c5('0x21')](function(){return _0x510790;});}return _0x510790;}})['then'](function(_0x31e8e2){if(_0x31e8e2){if(!fs[_0x01c5('0x4c')](_0x31e8e2[_0x01c5('0x49')])){throw new db['Sequelize'][(_0x01c5('0x51'))](_0x01c5('0x52'));}if(_0x31e8e2[_0x01c5('0x53')]){return _0x5a7ade[_0x01c5('0x46')](_0x31e8e2[_0x01c5('0x49')],_0x31e8e2[_0x01c5('0x53')]+path[_0x01c5('0x54')](_0x31e8e2[_0x01c5('0x49')]),function(){if(_0xb759bb){fs['unlink'](_0x31e8e2[_0x01c5('0x49')]);}});}else{return _0x5a7ade['download'](_0x31e8e2['value'],function(_0x5d5445){if(_0xb759bb){fs['unlink'](_0x31e8e2['value']);}});}}})[_0x01c5('0x42')](handleError(_0x5a7ade,null));};exports[_0x01c5('0x22')]=function(_0x2d8615,_0x7a3a52){return db[_0x01c5('0x27')][_0x01c5('0x41')]({'where':{'id':_0x2d8615[_0x01c5('0x40')]['id']}})[_0x01c5('0x21')](function(_0x5e6a20){if(_[_0x01c5('0x5f')](_0x5e6a20)){throw new ReferenceError(_0x01c5('0x60'));}return _0x5e6a20;})['then'](function(_0x656b2a){var _0x3d891f=_0x656b2a[_0x01c5('0x49')];logger[_0x01c5('0x61')]('cancellazione\x20fisica\x20documento\x20%s',_0x3d891f);if(!_[_0x01c5('0x5f')](_0x656b2a[_0x01c5('0x49')])&&fs[_0x01c5('0x4c')](_0x3d891f)){logger[_0x01c5('0x61')]('File:\x20\x22'+_0x3d891f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x01c5('0x62')](_0x3d891f);}_0x3d891f=_0x3d891f+_0x01c5('0x63');if(!_['isNil'](_0x656b2a[_0x01c5('0x49')])&&fs['existsSync'](_0x3d891f)){logger['info'](_0x01c5('0x64')+_0x3d891f+_0x01c5('0x65'));fs['unlinkSync'](_0x3d891f);}return _0x656b2a;})['then'](function(_0x33bca4){if(!_0x33bca4)throw new InternalError();return _0x33bca4[_0x01c5('0x22')]();})[_0x01c5('0x21')](function(){_0x7a3a52[_0x01c5('0x19')](0xcc)['end']();})['catch'](handleError(_0x7a3a52,null));};function getBucketslist(_0x4ca7b9,_0x309cab,_0x12cb70){return new Promise(function(_0x3a7a15,_0x4ec178){var _0x1516e1=new AWS['S3']({'accessKeyId':_0x309cab,'secretAccessKey':_0x4ca7b9,'region':_0x12cb70});_0x1516e1[_0x01c5('0x66')]({},function(_0x4e6cf4,_0x5e269c){if(_0x4e6cf4){return _0x4ec178(_0x4e6cf4);}else{return _0x3a7a15(_0x5e269c);}});});}function createBucket(_0x2f5a27,_0x54a647,_0x28068c,_0x47f359){return new Promise(function(_0x1dc97c,_0x364e62){var _0x2b41ca=new AWS['S3']({'accessKeyId':_0x54a647,'secretAccessKey':_0x2f5a27,'region':_0x28068c});_0x2b41ca['createBucket']({'Bucket':_0x47f359},function(_0x1d0ff4,_0x95f6cb){if(_0x1d0ff4){return _0x364e62(_0x1d0ff4);}else{return _0x1dc97c(_0x95f6cb);}});});}function uploadFile(_0x552e2d,_0x10fb40,_0x12f5cb,_0x521a95,_0x502636,_0x5f072f){return new Promise(function(_0x2c5760,_0x3132d9){var _0x2479be=new AWS['S3']({'accessKeyId':_0x10fb40,'secretAccessKey':_0x552e2d,'region':_0x12f5cb});_0x2479be['upload']({'Bucket':_0x521a95,'Key':_0x502636,'Body':_0x5f072f},function(_0x4f578f,_0x3d34ed){if(_0x4f578f){return _0x3132d9(_0x4f578f);}else{return _0x2c5760(_0x3d34ed);}});});}function startTranscribe(_0x4b1dc3,_0x1796b2,_0x1fc959,_0x1d04f1,_0x15e2c5,_0x5b52c8){return new Promise(function(_0x34b279,_0x4dddd3){var _0x1ce209=new AWS[(_0x01c5('0x67'))]({'accessKeyId':_0x1796b2,'secretAccessKey':_0x4b1dc3,'region':_0x1fc959});_0x1ce209[_0x01c5('0x68')]({'TranscriptionJobName':_0x1d04f1,'LanguageCode':_0x15e2c5,'Media':{'MediaFileUri':_0x5b52c8}},function(_0x2bf407,_0x1a4857){if(_0x2bf407){return _0x4dddd3(_0x2bf407);}else{return _0x34b279(_0x1a4857);}});});}function transcribe(_0x4e34ec,_0x18c78d,_0x2a781c,_0x19904c,_0x275c48,_0x56b42a,_0xe42f98){return new Promise(function(_0x55ddc6,_0x333314){var _0x4b5045={};logger[_0x01c5('0x61')](util[_0x01c5('0x4a')](_0x01c5('0x69'),_0x4e34ec,_0x275c48));return uploadFile(_0x18c78d,_0x2a781c,_0x19904c,_0x275c48,path[_0x01c5('0x6a')](_0x56b42a),fs[_0x01c5('0x6b')](_0x56b42a))[_0x01c5('0x21')](function(_0x3f4cc2){logger['info'](util[_0x01c5('0x4a')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4e34ec,_0x275c48,_0x3f4cc2['Location']));_0x4b5045[_0x01c5('0x6c')]=_0x3f4cc2['Bucket'];_0x4b5045[_0x01c5('0x6d')]=_0x3f4cc2['Location'];logger['info'](util[_0x01c5('0x4a')](_0x01c5('0x6e'),_0x4e34ec));return startTranscribe(_0x18c78d,_0x2a781c,_0x19904c,uuidv4(),_0xe42f98,_0x3f4cc2['Location']);})[_0x01c5('0x21')](function(_0x468862){logger[_0x01c5('0x61')](util['format'](_0x01c5('0x6f'),_0x4e34ec,_0x468862[_0x01c5('0x70')][_0x01c5('0x71')]));_0x4b5045['transcribeName']=_0x468862[_0x01c5('0x70')][_0x01c5('0x71')];_0x4b5045['transcribeStatus']=_0x468862[_0x01c5('0x70')]['TranscriptionJobStatus'];return _0x55ddc6(_0x4b5045);})[_0x01c5('0x42')](function(_0x37af2d){return _0x333314(_0x37af2d);});});}exports[_0x01c5('0x72')]=function(_0x1f2bad,_0x301553,_0x3ef7d1){var _0x68ba99;var _0x98198f;var _0x454a83;var _0x3681c8=require(_0x01c5('0x47'));return db[_0x01c5('0x27')]['findOne']({'where':{'id':_0x1f2bad[_0x01c5('0x40')]['id']}})[_0x01c5('0x21')](function(_0x33e0e4){if(_0x33e0e4){var _0x25b4c8=util[_0x01c5('0x4a')](_0x01c5('0x4b'),_0x33e0e4[_0x01c5('0x49')]);if(fs[_0x01c5('0x4c')](_0x25b4c8)){cypher=!![];return _0x3681c8['decryptFile'](_0x25b4c8,_0x33e0e4[_0x01c5('0x49')],config[_0x01c5('0x4e')][_0x01c5('0x4f')])[_0x01c5('0x21')](function(){return _0x33e0e4;});}return _0x33e0e4;}})['then'](function(_0x2d7480){if(!_0x2d7480){throw new db[(_0x01c5('0x50'))][(_0x01c5('0x51'))](_0x01c5('0x73'));}_0x98198f=_0x2d7480;return db['Setting'][_0x01c5('0x74')]({'where':{'id':0x1}});})[_0x01c5('0x21')](handleEntityNotFound(_0x301553,null))[_0x01c5('0x21')](function(_0x313e3a){if(_0x313e3a){_0x68ba99=_0x313e3a;if(!_0x68ba99[_0x01c5('0x75')]||!_0x68ba99['transcribeAccountId']||!_0x68ba99[_0x01c5('0x76')]||!_0x68ba99[_0x01c5('0x77')]||!_0x68ba99[_0x01c5('0x6c')]){throw new db['Sequelize'][(_0x01c5('0x51'))](_0x01c5('0x78'));}if(_0x1f2bad[_0x01c5('0x44')]['runSentiment']&&(!_0x68ba99[_0x01c5('0x79')]||!_0x68ba99[_0x01c5('0x7a')]||!_0x68ba99[_0x01c5('0x7b')]||!_0x68ba99[_0x01c5('0x77')]||!_0x68ba99[_0x01c5('0x6c')])){throw new db[(_0x01c5('0x50'))][(_0x01c5('0x51'))](_0x01c5('0x7c'));}return db[_0x01c5('0x7d')][_0x01c5('0x74')]({'where':{'id':_0x68ba99['transcribeAccountId']}});}})[_0x01c5('0x21')](function(_0x53ae6b){if(!_0x53ae6b){throw new db[(_0x01c5('0x50'))][(_0x01c5('0x51'))](_0x01c5('0x7e'));}if(!_0x53ae6b[_0x01c5('0x7f')]||!_0x53ae6b['data2']){throw new db[(_0x01c5('0x50'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x454a83=_0x53ae6b;return getBucketslist(_0x454a83[_0x01c5('0x7f')],_0x454a83[_0x01c5('0x80')],_0x68ba99[_0x01c5('0x76')]);})['then'](function(_0x1eafca){if(_0x1eafca&&_0x1eafca[_0x01c5('0x81')]){var _0x1b91ad=_['find'](_0x1eafca[_0x01c5('0x81')],function(_0x431af2){return _0x431af2[_0x01c5('0x82')]===_0x68ba99[_0x01c5('0x6c')];});if(!_0x1b91ad){logger[_0x01c5('0x61')](util[_0x01c5('0x4a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x1f2bad[_0x01c5('0x40')]['id'],_0x68ba99[_0x01c5('0x6c')]));return createBucket(_0x454a83[_0x01c5('0x7f')],_0x454a83['data2'],_0x68ba99[_0x01c5('0x76')],_0x68ba99[_0x01c5('0x6c')]);}logger['info'](util[_0x01c5('0x4a')](_0x01c5('0x83'),_0x1f2bad['params']['id'],_0x68ba99[_0x01c5('0x6c')]));return;}})[_0x01c5('0x21')](function(_0x387158){if(_0x98198f[_0x01c5('0x84')]===_0x01c5('0x85')){return transcribe(_0x1f2bad['params']['id'],_0x454a83[_0x01c5('0x7f')],_0x454a83[_0x01c5('0x80')],_0x68ba99[_0x01c5('0x76')],_0x68ba99[_0x01c5('0x6c')],_0x98198f['value'],_0x68ba99[_0x01c5('0x77')]);}else{logger[_0x01c5('0x61')](util[_0x01c5('0x4a')](_0x01c5('0x86'),_0x1f2bad[_0x01c5('0x40')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x01c5('0x21')](function(_0x2d8218){if(_0x2d8218){_0x2d8218[_0x01c5('0x87')]=_0x1f2bad[_0x01c5('0x44')][_0x01c5('0x88')];return _0x98198f['updateAttributes'](_0x2d8218);}})['then'](respondWithResult(_0x301553,null))[_0x01c5('0x42')](handleError(_0x301553,null));};function writeFile(_0x3ba026,_0x2ada49){return new Promise(function(_0x583d9c,_0x26b563){fs[_0x01c5('0x89')](_0x2ada49,_0x3ba026,function(_0x1a919c,_0x27c6d2){if(_0x1a919c){return _0x26b563(_0x1a919c);}else{return _0x583d9c(_0x27c6d2);}});});}exports[_0x01c5('0x8a')]=function(_0xa74a6f,_0x2e7162,_0xde338a){return db[_0x01c5('0x27')]['findOne']({'where':{'id':_0xa74a6f[_0x01c5('0x40')]['id']}})[_0x01c5('0x21')](handleEntityNotFound(_0x2e7162))['then'](function(_0x1f1535){if(_0x1f1535&&_0x1f1535['fileText']){var _0x3baa6a=_0x1f1535[_0x01c5('0x8b')];var _0x39cc89=config[_0x01c5('0x8c')]+_0x01c5('0x8d')+_0x1f1535['id']+_0x01c5('0x8e');if(fs[_0x01c5('0x4c')](_0x39cc89)){return _0x39cc89;}return writeFile(_0x3baa6a,_0x39cc89)['then'](function(){return _0x39cc89;});}else{throw new db[(_0x01c5('0x50'))][(_0x01c5('0x51'))](_0x01c5('0x8f'));}})[_0x01c5('0x21')](function(_0x89629e){return _0x2e7162[_0x01c5('0x46')](_0x89629e);})[_0x01c5('0x42')](handleError(_0x2e7162));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 94e120b..b7cc81a 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 _0x6b75=['voice_recordings','uniqueid','util','api','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x806c31,_0x4df99a){var _0x4f5a2b=function(_0x668b70){while(--_0x668b70){_0x806c31['push'](_0x806c31['shift']());}};_0x4f5a2b(++_0x4df99a);}(_0x6b75,0xe6));var _0x56b7=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x6b75[_0x37e845];return _0x59e55b;};'use strict';var _=require('lodash');var util=require(_0x56b7('0x0'));var logger=require('../../config/logger')(_0x56b7('0x1'));var moment=require(_0x56b7('0x2'));var BPromise=require(_0x56b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56b7('0x4'));var rimraf=require('rimraf');var config=require(_0x56b7('0x5'));var attributes=require(_0x56b7('0x6'));module[_0x56b7('0x7')]=function(_0x496da3,_0x16d1e8){return _0x496da3[_0x56b7('0x8')](_0x56b7('0x9'),attributes,{'tableName':_0x56b7('0xa'),'paranoid':![],'indexes':[{'name':_0x56b7('0xb'),'fields':[_0x56b7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x855d=['exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x3add98,_0xa2b4){var _0x2838fc=function(_0x429220){while(--_0x429220){_0x3add98['push'](_0x3add98['shift']());}};_0x2838fc(++_0xa2b4);}(_0x855d,0x1d2));var _0xd855=function(_0x55b73b,_0x518518){_0x55b73b=_0x55b73b-0x0;var _0x2781e5=_0x855d[_0x55b73b];return _0x2781e5;};'use strict';var _=require(_0xd855('0x0'));var util=require(_0xd855('0x1'));var logger=require('../../config/logger')(_0xd855('0x2'));var moment=require(_0xd855('0x3'));var BPromise=require(_0xd855('0x4'));var rp=require(_0xd855('0x5'));var fs=require('fs');var path=require(_0xd855('0x6'));var rimraf=require(_0xd855('0x7'));var config=require(_0xd855('0x8'));var attributes=require(_0xd855('0x9'));module[_0xd855('0xa')]=function(_0x3c09d7,_0x27628e){return _0x3c09d7['define'](_0xd855('0xb'),attributes,{'tableName':_0xd855('0xc'),'paranoid':![],'indexes':[{'name':_0xd855('0xd'),'fields':[_0xd855('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4746cd9..47b403e 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 _0xb016=['options','raw','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','encryptFile','secrets','recording','unlink','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb016,0x159));var _0x6b01=function(_0x55776e,_0xe22568){_0x55776e=_0x55776e-0x0;var _0x1f6299=_0xb016[_0x55776e];return _0x1f6299;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}exports[_0x6b01('0x14')]=function(_0x9c6571){var _0xc4e1b1=this;return new Promise(function(_0x18f336,_0x4f2d08){return db[_0x6b01('0x15')][_0x6b01('0x16')](_0x9c6571[_0x6b01('0x17')],{'raw':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')]['where']||null:null,'attributes':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1a')]||null:null,'limit':_0x9c6571[_0x6b01('0x18')]?_0x9c6571[_0x6b01('0x18')][_0x6b01('0x1b')]||null:null})[_0x6b01('0xa')](function(_0x542fab){logger[_0x6b01('0xb')](_0x6b01('0x14'),_0x9c6571);logger[_0x6b01('0x1c')]('UpdateVoiceRecording',_0x9c6571,JSON[_0x6b01('0xe')](_0x542fab));_0x18f336(_0x542fab);})[_0x6b01('0x13')](function(_0x304393){logger[_0x6b01('0xf')](_0x6b01('0x14'),_0x304393[_0x6b01('0x11')],_0x9c6571);_0x4f2d08(_0xc4e1b1[_0x6b01('0xf')](0x1f4,_0x304393[_0x6b01('0x11')]));});});};exports[_0x6b01('0x1d')]=function(_0x152dda){var _0x3c0607=this;return new Promise(function(_0xa846d8,_0x154dfc){var _0x55ca4b=require(_0x6b01('0x1e'));var _0x220efb;return db[_0x6b01('0x1f')][_0x6b01('0x20')]({'attributes':['id',_0x6b01('0x21')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x54f030){_0x220efb=_0x54f030;return db[_0x6b01('0x15')][_0x6b01('0x22')](_0x152dda[_0x6b01('0x17')]);})[_0x6b01('0xa')](function(_0x2a894e){if(_0x220efb[_0x6b01('0x21')]&&fs['existsSync'](_0x2a894e[_0x6b01('0x23')])){var _0x5482a8=util[_0x6b01('0x24')]('%s.cypher',_0x2a894e[_0x6b01('0x23')]);return _0x55ca4b[_0x6b01('0x25')](_0x2a894e[_0x6b01('0x23')],_0x5482a8,config[_0x6b01('0x26')][_0x6b01('0x27')])['then'](function(){fs[_0x6b01('0x28')](_0x2a894e[_0x6b01('0x23')]);logger[_0x6b01('0xb')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2a894e;});}return _0x2a894e;})['then'](function(_0x3578ef){logger['info'](_0x6b01('0x1d'),_0x152dda);logger[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x152dda,JSON['stringify'](_0x3578ef));_0xa846d8(_0x3578ef);})[_0x6b01('0x13')](function(_0x42d5f7){logger[_0x6b01('0xf')]('CreateVoiceRecording',_0x42d5f7[_0x6b01('0x11')],_0x152dda);_0x154dfc(_0x3c0607[_0x6b01('0xf')](0x1f4,_0x42d5f7[_0x6b01('0x11')]));});});}; \ No newline at end of file +var _0x3a6d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','body','value','%s.cypher','encryptFile','secrets','recording','unlink','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x6fd338,_0x5b2c72){var _0x6c7c6=function(_0x8d51e5){while(--_0x8d51e5){_0x6fd338['push'](_0x6fd338['shift']());}};_0x6c7c6(++_0x5b2c72);}(_0x3a6d,0x143));var _0xd3a6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x3a6d[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')](_0x8d1286['body'],{'raw':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286['options'][_0xd3a6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')]['attributes']||null:null,'limit':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')]['limit']||null:null})['then'](function(_0x5846bc){logger['info']('UpdateVoiceRecording',_0x8d1286);logger[_0xd3a6('0x1c')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x5846bc));_0xbe58b4(_0x5846bc);})['catch'](function(_0x456541){logger['error'](_0xd3a6('0x16'),_0x456541[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x456541['message']));});});};exports[_0xd3a6('0x1d')]=function(_0x3bc8d1){var _0x1b09ac=this;return new Promise(function(_0x219e32,_0x169d11){var _0x3106f1=require('../../components/encryptor');var _0x30df90;return db[_0xd3a6('0x1e')][_0xd3a6('0x1f')]({'attributes':['id',_0xd3a6('0x20')],'where':{'id':0x1},'raw':!![]})[_0xd3a6('0xd')](function(_0x45c628){_0x30df90=_0x45c628;return db['VoiceRecording']['create'](_0x3bc8d1[_0xd3a6('0x21')]);})[_0xd3a6('0xd')](function(_0x35981c){if(_0x30df90[_0xd3a6('0x20')]&&fs['existsSync'](_0x35981c[_0xd3a6('0x22')])){var _0xa4efd=util['format'](_0xd3a6('0x23'),_0x35981c['value']);return _0x3106f1[_0xd3a6('0x24')](_0x35981c[_0xd3a6('0x22')],_0xa4efd,config[_0xd3a6('0x25')][_0xd3a6('0x26')])[_0xd3a6('0xd')](function(){fs[_0xd3a6('0x27')](_0x35981c[_0xd3a6('0x22')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x35981c;});}return _0x35981c;})[_0xd3a6('0xd')](function(_0x155640){logger[_0xd3a6('0xe')]('CreateVoiceRecording',_0x3bc8d1);logger[_0xd3a6('0x1c')](_0xd3a6('0x1d'),_0x3bc8d1,JSON[_0xd3a6('0x12')](_0x155640));_0x219e32(_0x155640);})[_0xd3a6('0x28')](function(_0x3ebd0d){logger[_0xd3a6('0x13')](_0xd3a6('0x1d'),_0x3ebd0d[_0xd3a6('0x14')],_0x3bc8d1);_0x169d11(_0x1b09ac['error'](0x1f4,_0x3ebd0d[_0xd3a6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index c3e91c4..386f668 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 _0xd66b=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','exports'];(function(_0x54b766,_0x313856){var _0x1ddc75=function(_0x7ea434){while(--_0x7ea434){_0x54b766['push'](_0x54b766['shift']());}};_0x1ddc75(++_0x313856);}(_0xd66b,0x10e));var _0xbd66=function(_0x291b11,_0x56b5da){_0x291b11=_0x291b11-0x0;var _0x51a30b=_0xd66b[_0x291b11];return _0x51a30b;};'use strict';var multer=require(_0xbd66('0x0'));var util=require(_0xbd66('0x1'));var path=require(_0xbd66('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd66('0x3'));var router=express[_0xbd66('0x4')]();var fs_extra=require(_0xbd66('0x5'));var auth=require(_0xbd66('0x6'));var interaction=require(_0xbd66('0x7'));var config=require('../../config/environment');var controller=require(_0xbd66('0x8'));router[_0xbd66('0x9')]('/',auth[_0xbd66('0xa')](),controller['index']);router[_0xbd66('0x9')](_0xbd66('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbd66('0xc'),auth[_0xbd66('0xa')](),controller[_0xbd66('0xd')]);router[_0xbd66('0xe')]('/',auth[_0xbd66('0xa')](),controller[_0xbd66('0xf')]);router[_0xbd66('0x10')](_0xbd66('0xc'),auth[_0xbd66('0xa')](),controller['update']);router['delete'](_0xbd66('0xc'),auth[_0xbd66('0xa')](),controller['destroy']);module[_0xbd66('0x11')]=router; \ No newline at end of file +var _0xae40=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/:id','post','create','update','exports','multer','util','path','connect-timeout','express'];(function(_0x381857,_0x203e5d){var _0x5775f6=function(_0x54dff3){while(--_0x54dff3){_0x381857['push'](_0x381857['shift']());}};_0x5775f6(++_0x203e5d);}(_0xae40,0x199));var _0x0ae4=function(_0x14f986,_0x59b787){_0x14f986=_0x14f986-0x0;var _0x3ea6a9=_0xae40[_0x14f986];return _0x3ea6a9;};'use strict';var multer=require(_0x0ae4('0x0'));var util=require(_0x0ae4('0x1'));var path=require(_0x0ae4('0x2'));var timeout=require(_0x0ae4('0x3'));var express=require(_0x0ae4('0x4'));var router=express[_0x0ae4('0x5')]();var fs_extra=require(_0x0ae4('0x6'));var auth=require(_0x0ae4('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0ae4('0x8'));var controller=require(_0x0ae4('0x9'));router['get']('/',auth[_0x0ae4('0xa')](),controller[_0x0ae4('0xb')]);router[_0x0ae4('0xc')]('/describe',auth[_0x0ae4('0xa')](),controller['describe']);router[_0x0ae4('0xc')](_0x0ae4('0xd'),auth[_0x0ae4('0xa')](),controller['show']);router[_0x0ae4('0xe')]('/',auth[_0x0ae4('0xa')](),controller[_0x0ae4('0xf')]);router['put'](_0x0ae4('0xd'),auth[_0x0ae4('0xa')](),controller[_0x0ae4('0x10')]);router['delete'](_0x0ae4('0xd'),auth[_0x0ae4('0xa')](),controller['destroy']);module[_0x0ae4('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 77fd874..5117a44 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 _0x406c=['Yes','sequelize','moment','exports','blind','STRING'];(function(_0x127031,_0x57772b){var _0x4a36b9=function(_0x41e6df){while(--_0x41e6df){_0x127031['push'](_0x127031['shift']());}};_0x4a36b9(++_0x57772b);}(_0x406c,0x1e1));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc406('0x0'));var moment=require(_0xc406('0x1'));module[_0xc406('0x2')]={'type':{'type':Sequelize['ENUM'](_0xc406('0x3'),'attended')},'result':{'type':Sequelize[_0xc406('0x4')]},'transfererchannel':{'type':Sequelize[_0xc406('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xc406('0x4')]},'transferercalleridname':{'type':Sequelize[_0xc406('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xc406('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xc406('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xc406('0x4')]},'transfereechannel':{'type':Sequelize[_0xc406('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xc406('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc406('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xc406('0x4')]},'transfereecontext':{'type':Sequelize[_0xc406('0x4')]},'transfereeexten':{'type':Sequelize[_0xc406('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xc406('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0xc406('0x5'),'No')},'context':{'type':Sequelize[_0xc406('0x4')]},'extension':{'type':Sequelize[_0xc406('0x4')]}}; \ No newline at end of file +var _0xf72f=['moment','exports','ENUM','attended','STRING','sequelize'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0xf72f,0x1e5));var _0xff72=function(_0x8598ae,_0x1d6aa5){_0x8598ae=_0x8598ae-0x0;var _0x33b5b4=_0xf72f[_0x8598ae];return _0x33b5b4;};'use strict';var Sequelize=require(_0xff72('0x0'));var moment=require(_0xff72('0x1'));module[_0xff72('0x2')]={'type':{'type':Sequelize[_0xff72('0x3')]('blind',_0xff72('0x4'))},'result':{'type':Sequelize[_0xff72('0x5')]},'transfererchannel':{'type':Sequelize[_0xff72('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xff72('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xff72('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xff72('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xff72('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xff72('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xff72('0x5')]},'transfereechannel':{'type':Sequelize[_0xff72('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xff72('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xff72('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xff72('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xff72('0x5')]},'transfereecontext':{'type':Sequelize[_0xff72('0x5')]},'transfereeexten':{'type':Sequelize[_0xff72('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xff72('0x5')]},'extension':{'type':Sequelize[_0xff72('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 4a45b28..f62ec56 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 _0x2c10=['offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','intersection','find','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x2c10,0x120));var _0x02c1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2c10[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02c1('0x0'));var jsonpatch=require(_0x02c1('0x1'));var rp=require(_0x02c1('0x2'));var moment=require(_0x02c1('0x3'));var BPromise=require(_0x02c1('0x4'));var Mustache=require(_0x02c1('0x5'));var util=require(_0x02c1('0x6'));var path=require(_0x02c1('0x7'));var sox=require(_0x02c1('0x8'));var csv=require(_0x02c1('0x9'));var ejs=require(_0x02c1('0xa'));var fs=require('fs');var fs_extra=require(_0x02c1('0xb'));var _=require(_0x02c1('0xc'));var squel=require(_0x02c1('0xd'));var crypto=require(_0x02c1('0xe'));var jsforce=require(_0x02c1('0xf'));var deskjs=require(_0x02c1('0x10'));var toCsv=require(_0x02c1('0x9'));var querystring=require(_0x02c1('0x11'));var Papa=require(_0x02c1('0x12'));var Redis=require(_0x02c1('0x13'));var authService=require(_0x02c1('0x14'));var qs=require(_0x02c1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02c1('0x16'));var logger=require(_0x02c1('0x17'))('api');var utils=require(_0x02c1('0x18'));var config=require(_0x02c1('0x19'));var licenseUtil=require(_0x02c1('0x1a'));var db=require(_0x02c1('0x1b'))['db'];function respondWithStatusCode(_0x20e356,_0x21e50a){_0x21e50a=_0x21e50a||0xcc;return function(_0x5d2966){if(_0x5d2966){return _0x20e356[_0x02c1('0x1c')](_0x21e50a);}return _0x20e356[_0x02c1('0x1d')](_0x21e50a)[_0x02c1('0x1e')]();};}function respondWithResult(_0x4a7847,_0x5b3118){_0x5b3118=_0x5b3118||0xc8;return function(_0x3677e2){if(_0x3677e2){return _0x4a7847[_0x02c1('0x1d')](_0x5b3118)[_0x02c1('0x1f')](_0x3677e2);}};}function respondWithFilteredResult(_0x272b99,_0x5bfc14){return function(_0x58ec08){if(_0x58ec08){var _0x16d486=typeof _0x5bfc14[_0x02c1('0x20')]==='undefined'&&typeof _0x5bfc14[_0x02c1('0x21')]===_0x02c1('0x22');var _0x261e06=_0x58ec08[_0x02c1('0x23')];var _0x9fd8a4=_0x16d486?0x0:_0x5bfc14[_0x02c1('0x20')];var _0x4aa9d8=_0x16d486?_0x58ec08[_0x02c1('0x23')]:_0x5bfc14[_0x02c1('0x20')]+_0x5bfc14[_0x02c1('0x21')];var _0x571974;if(_0x4aa9d8>=_0x261e06){_0x4aa9d8=_0x261e06;_0x571974=0xc8;}else{_0x571974=0xce;}_0x272b99[_0x02c1('0x1d')](_0x571974);return _0x272b99[_0x02c1('0x24')](_0x02c1('0x25'),_0x9fd8a4+'-'+_0x4aa9d8+'/'+_0x261e06)[_0x02c1('0x1f')](_0x58ec08);}return null;};}function patchUpdates(_0x3a4a18){return function(_0x4f3acd){try{jsonpatch['apply'](_0x4f3acd,_0x3a4a18,!![]);}catch(_0x157160){return BPromise[_0x02c1('0x26')](_0x157160);}return _0x4f3acd[_0x02c1('0x27')]();};}function saveUpdates(_0x3921ca,_0x327504){return function(_0x4cd82e){if(_0x4cd82e){return _0x4cd82e['update'](_0x3921ca)[_0x02c1('0x28')](function(_0x274a3d){return _0x274a3d;});}return null;};}function removeEntity(_0x3508b3,_0xf91713){return function(_0x980c3e){if(_0x980c3e){return _0x980c3e[_0x02c1('0x29')]()[_0x02c1('0x28')](function(){_0x3508b3[_0x02c1('0x1d')](0xcc)[_0x02c1('0x1e')]();});}};}function handleEntityNotFound(_0x330d10,_0x1146bf){return function(_0x164c25){if(!_0x164c25){_0x330d10[_0x02c1('0x1c')](0x194);}return _0x164c25;};}function handleError(_0x54817a,_0x292444){_0x292444=_0x292444||0x1f4;return function(_0x584482){logger[_0x02c1('0x2a')](_0x584482['stack']);if(_0x584482[_0x02c1('0x2b')]){delete _0x584482[_0x02c1('0x2b')];}_0x54817a['status'](_0x292444)[_0x02c1('0x2c')](_0x584482);};}exports[_0x02c1('0x2d')]=function(_0x2d47a0,_0x2b00a8){var _0x312794={},_0x918efe={},_0x1d20dd={'count':0x0,'rows':[]};var _0x414f44=_[_0x02c1('0x2e')](db[_0x02c1('0x2f')][_0x02c1('0x30')],function(_0x5b72f1){return{'name':_0x5b72f1[_0x02c1('0x31')],'type':_0x5b72f1[_0x02c1('0x32')][_0x02c1('0x33')]};});_0x918efe['model']=_[_0x02c1('0x2e')](_0x414f44,_0x02c1('0x2b'));_0x918efe[_0x02c1('0x34')]=_[_0x02c1('0x35')](_0x2d47a0[_0x02c1('0x34')]);_0x918efe['filters']=_['intersection'](_0x918efe['model'],_0x918efe[_0x02c1('0x34')]);_0x312794['attributes']=_['intersection'](_0x918efe[_0x02c1('0x36')],qs[_0x02c1('0x37')](_0x2d47a0[_0x02c1('0x34')][_0x02c1('0x37')]));_0x312794[_0x02c1('0x38')]=_0x312794[_0x02c1('0x38')][_0x02c1('0x39')]?_0x312794['attributes']:_0x918efe['model'];if(!_0x2d47a0[_0x02c1('0x34')][_0x02c1('0x3a')]('nolimit')){_0x312794['limit']=qs['limit'](_0x2d47a0['query'][_0x02c1('0x21')]);_0x312794['offset']=qs[_0x02c1('0x20')](_0x2d47a0[_0x02c1('0x34')]['offset']);}_0x312794[_0x02c1('0x3b')]=qs[_0x02c1('0x3c')](_0x2d47a0[_0x02c1('0x34')][_0x02c1('0x3c')]);_0x312794[_0x02c1('0x3d')]=qs[_0x02c1('0x3e')](_[_0x02c1('0x3f')](_0x2d47a0[_0x02c1('0x34')],_0x918efe[_0x02c1('0x3e')]),_0x414f44);if(_0x2d47a0[_0x02c1('0x34')][_0x02c1('0x40')]){_0x312794[_0x02c1('0x3d')]=_[_0x02c1('0x41')](_0x312794[_0x02c1('0x3d')],{'$or':_[_0x02c1('0x2e')](_0x414f44,function(_0x55aa8a){if(_0x55aa8a[_0x02c1('0x32')]!==_0x02c1('0x42')){var _0x4ed5fe={};_0x4ed5fe[_0x55aa8a[_0x02c1('0x2b')]]={'$like':'%'+_0x2d47a0['query'][_0x02c1('0x40')]+'%'};return _0x4ed5fe;}})});}_0x312794=_[_0x02c1('0x41')]({},_0x312794,_0x2d47a0[_0x02c1('0x43')]);var _0x38ac59={'where':_0x312794['where']};return db[_0x02c1('0x2f')][_0x02c1('0x23')](_0x38ac59)[_0x02c1('0x28')](function(_0x4ea2db){_0x1d20dd[_0x02c1('0x23')]=_0x4ea2db;if(_0x2d47a0[_0x02c1('0x34')][_0x02c1('0x44')]){_0x312794[_0x02c1('0x45')]=[{'all':!![]}];}return db[_0x02c1('0x2f')][_0x02c1('0x46')](_0x312794);})[_0x02c1('0x28')](function(_0x28a206){_0x1d20dd['rows']=_0x28a206;return _0x1d20dd;})[_0x02c1('0x28')](respondWithFilteredResult(_0x2b00a8,_0x312794))[_0x02c1('0x47')](handleError(_0x2b00a8,null));};exports[_0x02c1('0x48')]=function(_0x5a3300,_0x2a6640){var _0x47810e={'raw':!![],'where':{'id':_0x5a3300['params']['id']}},_0x57c16e={};_0x57c16e[_0x02c1('0x36')]=_[_0x02c1('0x35')](db[_0x02c1('0x2f')][_0x02c1('0x30')]);_0x57c16e[_0x02c1('0x34')]=_['keys'](_0x5a3300[_0x02c1('0x34')]);_0x57c16e['filters']=_[_0x02c1('0x49')](_0x57c16e[_0x02c1('0x36')],_0x57c16e[_0x02c1('0x34')]);_0x47810e['attributes']=_[_0x02c1('0x49')](_0x57c16e[_0x02c1('0x36')],qs['fields'](_0x5a3300[_0x02c1('0x34')]['fields']));_0x47810e[_0x02c1('0x38')]=_0x47810e[_0x02c1('0x38')][_0x02c1('0x39')]?_0x47810e['attributes']:_0x57c16e[_0x02c1('0x36')];if(_0x5a3300['query'][_0x02c1('0x44')]){_0x47810e[_0x02c1('0x45')]=[{'all':!![]}];}_0x47810e=_['merge']({},_0x47810e,_0x5a3300[_0x02c1('0x43')]);return db[_0x02c1('0x2f')][_0x02c1('0x4a')](_0x47810e)[_0x02c1('0x28')](handleEntityNotFound(_0x2a6640,null))[_0x02c1('0x28')](respondWithResult(_0x2a6640,null))[_0x02c1('0x47')](handleError(_0x2a6640,null));};exports[_0x02c1('0x4b')]=function(_0x1d0fc8,_0x179134){return db[_0x02c1('0x2f')][_0x02c1('0x4b')](_0x1d0fc8[_0x02c1('0x4c')],{})[_0x02c1('0x28')](respondWithResult(_0x179134,0xc9))[_0x02c1('0x47')](handleError(_0x179134,null));};exports[_0x02c1('0x4d')]=function(_0x518b3a,_0x21319a){if(_0x518b3a[_0x02c1('0x4c')]['id']){delete _0x518b3a[_0x02c1('0x4c')]['id'];}return db[_0x02c1('0x2f')][_0x02c1('0x4a')]({'where':{'id':_0x518b3a[_0x02c1('0x4e')]['id']}})[_0x02c1('0x28')](handleEntityNotFound(_0x21319a,null))['then'](saveUpdates(_0x518b3a[_0x02c1('0x4c')],null))['then'](respondWithResult(_0x21319a,null))['catch'](handleError(_0x21319a,null));};exports[_0x02c1('0x29')]=function(_0xbd95f5,_0x106e4c){return db[_0x02c1('0x2f')][_0x02c1('0x4a')]({'where':{'id':_0xbd95f5['params']['id']}})['then'](handleEntityNotFound(_0x106e4c,null))['then'](removeEntity(_0x106e4c,null))['catch'](handleError(_0x106e4c,null));};exports[_0x02c1('0x4f')]=function(_0x5f27fe,_0x5d750b){return db[_0x02c1('0x2f')][_0x02c1('0x4f')]()[_0x02c1('0x28')](respondWithResult(_0x5d750b,null))[_0x02c1('0x47')](handleError(_0x5d750b,null));}; \ No newline at end of file +var _0x339c=['error','stack','name','send','index','VoiceTransferReport','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','rawAttributes','find','catch','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','then','destroy'];(function(_0x52793e,_0x1e7bb4){var _0x5357bb=function(_0x44e880){while(--_0x44e880){_0x52793e['push'](_0x52793e['shift']());}};_0x5357bb(++_0x1e7bb4);}(_0x339c,0x101));var _0xc339=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x339c[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xc339('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc339('0x1'));var jsonpatch=require(_0xc339('0x2'));var rp=require(_0xc339('0x3'));var moment=require(_0xc339('0x4'));var BPromise=require(_0xc339('0x5'));var Mustache=require('mustache');var util=require(_0xc339('0x6'));var path=require(_0xc339('0x7'));var sox=require(_0xc339('0x8'));var csv=require(_0xc339('0x9'));var ejs=require(_0xc339('0xa'));var fs=require('fs');var fs_extra=require(_0xc339('0xb'));var _=require(_0xc339('0xc'));var squel=require(_0xc339('0xd'));var crypto=require('crypto');var jsforce=require(_0xc339('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc339('0x9'));var querystring=require(_0xc339('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc339('0x10'));var qs=require(_0xc339('0x11'));var as=require(_0xc339('0x12'));var hardwareService=require(_0xc339('0x13'));var logger=require(_0xc339('0x14'))(_0xc339('0x15'));var utils=require(_0xc339('0x16'));var config=require(_0xc339('0x17'));var licenseUtil=require(_0xc339('0x18'));var db=require(_0xc339('0x19'))['db'];function respondWithStatusCode(_0x589501,_0x5373ad){_0x5373ad=_0x5373ad||0xcc;return function(_0x375ed5){if(_0x375ed5){return _0x589501[_0xc339('0x1a')](_0x5373ad);}return _0x589501[_0xc339('0x1b')](_0x5373ad)[_0xc339('0x1c')]();};}function respondWithResult(_0x458343,_0x29f0fa){_0x29f0fa=_0x29f0fa||0xc8;return function(_0x49c6fc){if(_0x49c6fc){return _0x458343[_0xc339('0x1b')](_0x29f0fa)[_0xc339('0x1d')](_0x49c6fc);}};}function respondWithFilteredResult(_0x231960,_0xe1cf1e){return function(_0x496335){if(_0x496335){var _0x2e388c=typeof _0xe1cf1e[_0xc339('0x1e')]==='undefined'&&typeof _0xe1cf1e[_0xc339('0x1f')]==='undefined';var _0xd37877=_0x496335[_0xc339('0x20')];var _0x4c02c5=_0x2e388c?0x0:_0xe1cf1e[_0xc339('0x1e')];var _0x4acbd1=_0x2e388c?_0x496335[_0xc339('0x20')]:_0xe1cf1e[_0xc339('0x1e')]+_0xe1cf1e[_0xc339('0x1f')];var _0x530641;if(_0x4acbd1>=_0xd37877){_0x4acbd1=_0xd37877;_0x530641=0xc8;}else{_0x530641=0xce;}_0x231960[_0xc339('0x1b')](_0x530641);return _0x231960['set']('Content-Range',_0x4c02c5+'-'+_0x4acbd1+'/'+_0xd37877)['json'](_0x496335);}return null;};}function patchUpdates(_0x49adad){return function(_0x58bacf){try{jsonpatch[_0xc339('0x21')](_0x58bacf,_0x49adad,!![]);}catch(_0x171830){return BPromise[_0xc339('0x22')](_0x171830);}return _0x58bacf[_0xc339('0x23')]();};}function saveUpdates(_0x561f4c,_0xd92e6){return function(_0x16c322){if(_0x16c322){return _0x16c322[_0xc339('0x24')](_0x561f4c)[_0xc339('0x25')](function(_0x1ae5ea){return _0x1ae5ea;});}return null;};}function removeEntity(_0x2f4364,_0x212d9c){return function(_0x5b7d59){if(_0x5b7d59){return _0x5b7d59[_0xc339('0x26')]()[_0xc339('0x25')](function(){_0x2f4364['status'](0xcc)[_0xc339('0x1c')]();});}};}function handleEntityNotFound(_0x560016,_0x5887ee){return function(_0x3ac5ee){if(!_0x3ac5ee){_0x560016['sendStatus'](0x194);}return _0x3ac5ee;};}function handleError(_0x4c62c1,_0x33bcc9){_0x33bcc9=_0x33bcc9||0x1f4;return function(_0x2444da){logger[_0xc339('0x27')](_0x2444da[_0xc339('0x28')]);if(_0x2444da[_0xc339('0x29')]){delete _0x2444da[_0xc339('0x29')];}_0x4c62c1[_0xc339('0x1b')](_0x33bcc9)[_0xc339('0x2a')](_0x2444da);};}exports[_0xc339('0x2b')]=function(_0x558d96,_0x324714){var _0x17369f={},_0x21ccb6={},_0x173bde={'count':0x0,'rows':[]};var _0x521c99=_['map'](db[_0xc339('0x2c')]['rawAttributes'],function(_0x17c156){return{'name':_0x17c156[_0xc339('0x2d')],'type':_0x17c156[_0xc339('0x2e')][_0xc339('0x2f')]};});_0x21ccb6[_0xc339('0x30')]=_[_0xc339('0x31')](_0x521c99,_0xc339('0x29'));_0x21ccb6[_0xc339('0x32')]=_[_0xc339('0x33')](_0x558d96[_0xc339('0x32')]);_0x21ccb6[_0xc339('0x34')]=_['intersection'](_0x21ccb6[_0xc339('0x30')],_0x21ccb6[_0xc339('0x32')]);_0x17369f[_0xc339('0x35')]=_[_0xc339('0x36')](_0x21ccb6[_0xc339('0x30')],qs['fields'](_0x558d96['query'][_0xc339('0x37')]));_0x17369f[_0xc339('0x35')]=_0x17369f[_0xc339('0x35')][_0xc339('0x38')]?_0x17369f[_0xc339('0x35')]:_0x21ccb6[_0xc339('0x30')];if(!_0x558d96[_0xc339('0x32')]['hasOwnProperty'](_0xc339('0x39'))){_0x17369f[_0xc339('0x1f')]=qs['limit'](_0x558d96[_0xc339('0x32')][_0xc339('0x1f')]);_0x17369f['offset']=qs['offset'](_0x558d96[_0xc339('0x32')][_0xc339('0x1e')]);}_0x17369f['order']=qs[_0xc339('0x3a')](_0x558d96[_0xc339('0x32')][_0xc339('0x3a')]);_0x17369f[_0xc339('0x3b')]=qs[_0xc339('0x34')](_['pick'](_0x558d96[_0xc339('0x32')],_0x21ccb6[_0xc339('0x34')]),_0x521c99);if(_0x558d96['query']['filter']){_0x17369f[_0xc339('0x3b')]=_[_0xc339('0x3c')](_0x17369f[_0xc339('0x3b')],{'$or':_['map'](_0x521c99,function(_0x5c2ddc){if(_0x5c2ddc[_0xc339('0x2e')]!==_0xc339('0x3d')){var _0x1e6a57={};_0x1e6a57[_0x5c2ddc[_0xc339('0x29')]]={'$like':'%'+_0x558d96['query'][_0xc339('0x3e')]+'%'};return _0x1e6a57;}})});}_0x17369f=_[_0xc339('0x3c')]({},_0x17369f,_0x558d96[_0xc339('0x3f')]);var _0x1b3655={'where':_0x17369f['where']};return db[_0xc339('0x2c')][_0xc339('0x20')](_0x1b3655)['then'](function(_0x1574c4){_0x173bde[_0xc339('0x20')]=_0x1574c4;if(_0x558d96[_0xc339('0x32')][_0xc339('0x40')]){_0x17369f[_0xc339('0x41')]=[{'all':!![]}];}return db[_0xc339('0x2c')][_0xc339('0x42')](_0x17369f);})[_0xc339('0x25')](function(_0x1fb64c){_0x173bde[_0xc339('0x43')]=_0x1fb64c;return _0x173bde;})[_0xc339('0x25')](respondWithFilteredResult(_0x324714,_0x17369f))['catch'](handleError(_0x324714,null));};exports['show']=function(_0x4d5ba3,_0x1a54f5){var _0x408fb8={'raw':!![],'where':{'id':_0x4d5ba3['params']['id']}},_0x23db01={};_0x23db01[_0xc339('0x30')]=_[_0xc339('0x33')](db[_0xc339('0x2c')][_0xc339('0x44')]);_0x23db01[_0xc339('0x32')]=_['keys'](_0x4d5ba3[_0xc339('0x32')]);_0x23db01[_0xc339('0x34')]=_[_0xc339('0x36')](_0x23db01[_0xc339('0x30')],_0x23db01['query']);_0x408fb8['attributes']=_[_0xc339('0x36')](_0x23db01[_0xc339('0x30')],qs[_0xc339('0x37')](_0x4d5ba3['query'][_0xc339('0x37')]));_0x408fb8[_0xc339('0x35')]=_0x408fb8[_0xc339('0x35')]['length']?_0x408fb8['attributes']:_0x23db01[_0xc339('0x30')];if(_0x4d5ba3['query'][_0xc339('0x40')]){_0x408fb8[_0xc339('0x41')]=[{'all':!![]}];}_0x408fb8=_[_0xc339('0x3c')]({},_0x408fb8,_0x4d5ba3[_0xc339('0x3f')]);return db['VoiceTransferReport'][_0xc339('0x45')](_0x408fb8)[_0xc339('0x25')](handleEntityNotFound(_0x1a54f5,null))[_0xc339('0x25')](respondWithResult(_0x1a54f5,null))[_0xc339('0x46')](handleError(_0x1a54f5,null));};exports['create']=function(_0x4743f7,_0x3ef654){return db['VoiceTransferReport']['create'](_0x4743f7[_0xc339('0x47')],{})['then'](respondWithResult(_0x3ef654,0xc9))[_0xc339('0x46')](handleError(_0x3ef654,null));};exports[_0xc339('0x24')]=function(_0x4ee5ef,_0x362141){if(_0x4ee5ef['body']['id']){delete _0x4ee5ef[_0xc339('0x47')]['id'];}return db[_0xc339('0x2c')][_0xc339('0x45')]({'where':{'id':_0x4ee5ef[_0xc339('0x48')]['id']}})[_0xc339('0x25')](handleEntityNotFound(_0x362141,null))[_0xc339('0x25')](saveUpdates(_0x4ee5ef[_0xc339('0x47')],null))[_0xc339('0x25')](respondWithResult(_0x362141,null))['catch'](handleError(_0x362141,null));};exports[_0xc339('0x26')]=function(_0x52f494,_0x485170){return db[_0xc339('0x2c')][_0xc339('0x45')]({'where':{'id':_0x52f494['params']['id']}})[_0xc339('0x25')](handleEntityNotFound(_0x485170,null))[_0xc339('0x25')](removeEntity(_0x485170,null))[_0xc339('0x46')](handleError(_0x485170,null));};exports[_0xc339('0x49')]=function(_0x3eefb8,_0x319bda){return db[_0xc339('0x2c')][_0xc339('0x49')]()[_0xc339('0x25')](respondWithResult(_0x319bda,null))['catch'](handleError(_0x319bda,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index c50f86b..bd8c564 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 _0x1c37=['define','VoiceTransferReport','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1c37,0xac));var _0x71c3=function(_0x58687d,_0x182ed1){_0x58687d=_0x58687d-0x0;var _0x18c83f=_0x1c37[_0x58687d];return _0x18c83f;};'use strict';var _=require('lodash');var util=require(_0x71c3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x71c3('0x1'));var BPromise=require(_0x71c3('0x2'));var rp=require(_0x71c3('0x3'));var fs=require('fs');var path=require(_0x71c3('0x4'));var rimraf=require(_0x71c3('0x5'));var config=require(_0x71c3('0x6'));var attributes=require(_0x71c3('0x7'));module['exports']=function(_0x29b1b8,_0x5bcd0b){return _0x29b1b8[_0x71c3('0x8')](_0x71c3('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7224=['moment','bluebird','request-promise','path','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','api'];(function(_0xd43f0d,_0x50aba1){var _0x4a472a=function(_0x18e5dd){while(--_0x18e5dd){_0xd43f0d['push'](_0xd43f0d['shift']());}};_0x4a472a(++_0x50aba1);}(_0x7224,0x16f));var _0x4722=function(_0x356861,_0x20e611){_0x356861=_0x356861-0x0;var _0x4db294=_0x7224[_0x356861];return _0x4db294;};'use strict';var _=require(_0x4722('0x0'));var util=require(_0x4722('0x1'));var logger=require('../../config/logger')(_0x4722('0x2'));var moment=require(_0x4722('0x3'));var BPromise=require(_0x4722('0x4'));var rp=require(_0x4722('0x5'));var fs=require('fs');var path=require(_0x4722('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4722('0x7'));module['exports']=function(_0x580372,_0xbc9b6f){return _0x580372[_0x4722('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x4722('0x9'),'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 78776e6..61084ee 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 _0x38fe=['catch','CreateVoiceTransferReport','create','body','options','lodash','util','randomstring','ioredis','rpc','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3ac8c1,_0x49f831){var _0x2e8ebe=function(_0x463dea){while(--_0x463dea){_0x3ac8c1['push'](_0x3ac8c1['shift']());}};_0x2e8ebe(++_0x49f831);}(_0x38fe,0xdd));var _0xe38f=function(_0x1d9419,_0x19f255){_0x1d9419=_0x1d9419-0x0;var _0x3e2de1=_0x38fe[_0x1d9419];return _0x3e2de1;};'use strict';var _=require(_0xe38f('0x0'));var util=require(_0xe38f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe38f('0x2'));var fs=require('fs');var Redis=require(_0xe38f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe38f('0x4'));var config=require('../../config/environment');var jayson=require(_0xe38f('0x5'));var client=jayson['client'][_0xe38f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x121cc7,_0xd12530,_0x30969a){return new BPromise(function(_0x717119,_0x1c72aa){return client[_0xe38f('0x7')](_0x121cc7,_0x30969a)[_0xe38f('0x8')](function(_0x558862){logger[_0xe38f('0x9')](_0xe38f('0xa'),_0xd12530,'request\x20sent');logger[_0xe38f('0xb')](_0xe38f('0xc'),_0xd12530,_0xe38f('0xd'),JSON[_0xe38f('0xe')](_0x558862));if(_0x558862[_0xe38f('0xf')]){if(_0x558862[_0xe38f('0xf')][_0xe38f('0x10')]===0x1f4){logger[_0xe38f('0xf')](_0xe38f('0xa'),_0xd12530,_0x558862[_0xe38f('0xf')][_0xe38f('0x11')]);return _0x1c72aa(_0x558862['error'][_0xe38f('0x11')]);}logger[_0xe38f('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0xd12530,_0x558862[_0xe38f('0xf')]['message']);return _0x717119(_0x558862['error'][_0xe38f('0x11')]);}else{logger[_0xe38f('0x9')](_0xe38f('0xa'),_0xd12530,_0xe38f('0xd'));_0x717119(_0x558862[_0xe38f('0x12')]['message']);}})[_0xe38f('0x13')](function(_0x275649){logger[_0xe38f('0xf')](_0xe38f('0xa'),_0xd12530,_0x275649);_0x1c72aa(_0x275649);});});}exports[_0xe38f('0x14')]=function(_0x247974){var _0x3d5d54=this;return new Promise(function(_0x51c016,_0x440929){return db['VoiceTransferReport'][_0xe38f('0x15')](_0x247974[_0xe38f('0x16')],{'raw':_0x247974[_0xe38f('0x17')]?_0x247974['options']['raw']===undefined?!![]:![]:!![]})[_0xe38f('0x8')](function(_0x5680e1){logger[_0xe38f('0x9')](_0xe38f('0x14'),_0x247974);logger[_0xe38f('0xb')](_0xe38f('0x14'),_0x247974,JSON['stringify'](_0x5680e1));_0x51c016(_0x5680e1);})['catch'](function(_0x3dfe97){logger[_0xe38f('0xf')](_0xe38f('0x14'),_0x3dfe97[_0xe38f('0x11')],_0x247974);_0x440929(_0x3d5d54[_0xe38f('0xf')](0x1f4,_0x3dfe97[_0xe38f('0x11')]));});});}; \ No newline at end of file +var _0xb519=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','message','VoiceTransferReport,\x20%s,\x20%s','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','catch','util','moment','randomstring','ioredis'];(function(_0x4477c8,_0xf32123){var _0x17ee51=function(_0xf091ca){while(--_0xf091ca){_0x4477c8['push'](_0x4477c8['shift']());}};_0x17ee51(++_0xf32123);}(_0xb519,0x168));var _0x9b51=function(_0x533e43,_0x2afe2a){_0x533e43=_0x533e43-0x0;var _0x4d99df=_0xb519[_0x533e43];return _0x4d99df;};'use strict';var _=require('lodash');var util=require(_0x9b51('0x0'));var moment=require(_0x9b51('0x1'));var BPromise=require('bluebird');var rs=require(_0x9b51('0x2'));var fs=require('fs');var Redis=require(_0x9b51('0x3'));var db=require(_0x9b51('0x4'))['db'];var utils=require(_0x9b51('0x5'));var logger=require('../../config/logger')(_0x9b51('0x6'));var config=require(_0x9b51('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9b51('0x8')][_0x9b51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57fbce,_0x5317c0,_0x1a5326){return new BPromise(function(_0x1ef907,_0x564cc0){return client[_0x9b51('0xa')](_0x57fbce,_0x1a5326)[_0x9b51('0xb')](function(_0x4e144b){logger[_0x9b51('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x5317c0,_0x9b51('0xd'));logger[_0x9b51('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5317c0,_0x9b51('0xd'),JSON[_0x9b51('0xf')](_0x4e144b));if(_0x4e144b[_0x9b51('0x10')]){if(_0x4e144b[_0x9b51('0x10')]['code']===0x1f4){logger[_0x9b51('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x5317c0,_0x4e144b[_0x9b51('0x10')]['message']);return _0x564cc0(_0x4e144b[_0x9b51('0x10')][_0x9b51('0x11')]);}logger[_0x9b51('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x5317c0,_0x4e144b[_0x9b51('0x10')][_0x9b51('0x11')]);return _0x1ef907(_0x4e144b[_0x9b51('0x10')]['message']);}else{logger['info'](_0x9b51('0x12'),_0x5317c0,'request\x20sent');_0x1ef907(_0x4e144b[_0x9b51('0x13')][_0x9b51('0x11')]);}})['catch'](function(_0x4208a6){logger[_0x9b51('0x10')](_0x9b51('0x12'),_0x5317c0,_0x4208a6);_0x564cc0(_0x4208a6);});});}exports[_0x9b51('0x14')]=function(_0x22c31a){var _0x2b7202=this;return new Promise(function(_0x3fc251,_0x28787c){return db[_0x9b51('0x15')][_0x9b51('0x16')](_0x22c31a[_0x9b51('0x17')],{'raw':_0x22c31a[_0x9b51('0x18')]?_0x22c31a[_0x9b51('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3d167f){logger[_0x9b51('0xc')]('CreateVoiceTransferReport',_0x22c31a);logger[_0x9b51('0xe')]('CreateVoiceTransferReport',_0x22c31a,JSON['stringify'](_0x3d167f));_0x3fc251(_0x3d167f);})[_0x9b51('0x19')](function(_0x5b3377){logger[_0x9b51('0x10')]('CreateVoiceTransferReport',_0x5b3377['message'],_0x22c31a);_0x28787c(_0x2b7202[_0x9b51('0x10')](0x1f4,_0x5b3377[_0x9b51('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 36e7b19..5eb10c7 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 _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x34e8,0x12c));var _0x834e=function(_0x48cba5,_0x4162b7){_0x48cba5=_0x48cba5-0x0;var _0x4aebf2=_0x34e8[_0x48cba5];return _0x4aebf2;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router; \ No newline at end of file +var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x104de3,_0x1f9418){var _0x5a5bcd=function(_0x9a6fdc){while(--_0x9a6fdc){_0x104de3['push'](_0x104de3['shift']());}};_0x5a5bcd(++_0x1f9418);}(_0xedd9,0xfc));var _0x9edd=function(_0x3139f9,_0x1f577b){_0x3139f9=_0x3139f9-0x0;var _0x31d0fb=_0xedd9[_0x3139f9];return _0x31d0fb;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 2782b2d..ed31b5b 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 _0xaf93=['callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','UserId','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','userId\x20is\x20required','string','number','sessionId\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','NotFound','then','error','message','result','catch','User','findOne','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','callerId'];(function(_0x7327cf,_0xab1dc9){var _0x44aa77=function(_0x5d8fb3){while(--_0x5d8fb3){_0x7327cf['push'](_0x7327cf['shift']());}};_0x44aa77(++_0xab1dc9);}(_0xaf93,0x151));var _0x3af9=function(_0x53ac5b,_0x9cef1e){_0x53ac5b=_0x53ac5b-0x0;var _0x5738ca=_0xaf93[_0x53ac5b];return _0x5738ca;};'use strict';var path=require(_0x3af9('0x0'));var fs=require('fs');var _=require(_0x3af9('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x3af9('0x2'));var BPromise=require(_0x3af9('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x3af9('0x4')][_0x3af9('0x5')]({'port':0x232a});var logger=require(_0x3af9('0x6'))(_0x3af9('0x7'));var Redis=require(_0x3af9('0x8'));config[_0x3af9('0x9')]=_[_0x3af9('0xa')](config['redis'],{'host':_0x3af9('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3af9('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3af9('0xc')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x3af9('0xd')},'callbackUrl':{'type':_0x3af9('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],_0x3af9('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],_0x3af9('0xc')]},'sessionId':{'type':_0x3af9('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],_0x3af9('0xc')]},'sessionId':{'type':_0x3af9('0xd'),'required':[!![],_0x3af9('0xf')]},'transferNumber':{'type':_0x3af9('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3af9('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],_0x3af9('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],_0x3af9('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x3af9('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x278e80,_0x9c7d69,_0xa92aa4){logger[_0x3af9('0x10')](_0x278e80,_0x9c7d69,JSON['stringify'](_0xa92aa4));io['to'](_0x278e80)[_0x3af9('0x11')](_0x9c7d69,_0xa92aa4);}function handleError(_0xcf2214){return function(_0x298135){console[_0x3af9('0x12')](_0x3af9('0x13'),_0x298135,_0x298135 instanceof RangeError);logger['error'](_0x298135[_0x3af9('0x14')]);if(_0x298135 instanceof RangeError){if(_0x298135[_0x3af9('0x15')]){delete _0x298135[_0x3af9('0x15')];}_0xcf2214[_0x3af9('0x16')](0x194)[_0x3af9('0x17')](_0x298135);}else{if(_0x298135['name']){delete _0x298135[_0x3af9('0x15')];}_0xcf2214[_0x3af9('0x16')](0x1f4)[_0x3af9('0x17')](_0x298135);}};}function checkError(){return function(_0x1e0f4f){if(!_0x1e0f4f){throw new RangeError(_0x3af9('0x18'));}return _0x1e0f4f;};}function respondWithRpcPromise(_0x7d877e,_0x5e65b3){return new BPromise(function(_0x4a88ea,_0x505e25){var _0x5e24e3=amiClient;return _0x5e24e3['request'](_0x7d877e,_0x5e65b3)[_0x3af9('0x19')](function(_0x5c1c8f){if(_0x5c1c8f[_0x3af9('0x1a')]){if(_0x5c1c8f[_0x3af9('0x1a')]['code']===0x1f4){return _0x505e25(_0x5c1c8f['error']['message']);}return _0x4a88ea(_0x5c1c8f[_0x3af9('0x1a')][_0x3af9('0x1b')]);}else{_0x4a88ea(_0x5c1c8f[_0x3af9('0x1c')]);}})[_0x3af9('0x1d')](function(_0x240a16){_0x505e25(_0x240a16);});});}function getAgent(_0x149ee6){return db[_0x3af9('0x1e')][_0x3af9('0x1f')]({'where':{'id':_0x149ee6,'role':'agent'}})[_0x3af9('0x19')](checkError());}function getAgentCheckSession(_0x574b71,_0x485754){return new BPromise(function(_0x177650,_0xe1502){var _0x19643f=respondWithRpcPromise(_0x3af9('0x20'));var _0x374382=getAgent(_0x574b71);Promise['all']([_0x19643f,_0x374382])[_0x3af9('0x19')](function(_0x386297){var _0x165620=_0x386297[0x0];var _0x512b90=_0x386297[0x1];var _0x4f5024=_[_0x3af9('0x21')](_0x165620[_0x3af9('0x22')],function(_0x8867c6){return _0x8867c6['UserId']==_0x512b90['id']&&_0x8867c6[_0x3af9('0x23')]==_0x485754;});if(_0x4f5024[_0x3af9('0x24')]==0x1){_0x177650(_0x512b90);}else{_0xe1502(new RangeError(_0x3af9('0x25')+_0x485754+'\x20not\x20found!'));}});});}exports[_0x3af9('0x26')]=function(_0x38b120,_0x407572){logger['info'](_0x3af9('0x27'),_0x38b120[_0x3af9('0x28')]);var _0x1d7460=originateValidation['validate'](_0x38b120[_0x3af9('0x28')]);if(_0x1d7460[_0x3af9('0x24')]>0x0){return _0x407572['status'](0x190)[_0x3af9('0x29')](_0x1d7460);}var _0x588d5b=_0x38b120[_0x3af9('0x28')]['userId'];var _0x510940=_0x38b120[_0x3af9('0x28')]['callNumber'];var _0x30c9f0=_0x38b120[_0x3af9('0x28')][_0x3af9('0x2a')];var _0x4dfdb3=_0x38b120['body'][_0x3af9('0x2b')];return getAgent(_0x588d5b)[_0x3af9('0x19')](function(_0x4df48b){logger['info'](_0x3af9('0x2c'),_0x4df48b['name']);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x4df48b['name']),'webbar:originate',{'callNumber':_0x510940,'callerId':_0x30c9f0,'callbackUrl':_0x4dfdb3});return _0x407572[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x2f')});})[_0x3af9('0x1d')](handleError(_0x407572));};exports[_0x3af9('0x30')]=function(_0x547615,_0x569425){logger[_0x3af9('0x10')](_0x3af9('0x31'),_0x547615[_0x3af9('0x28')]);var _0x241f26=hangupValidation['validate'](_0x547615['body']);if(_0x241f26[_0x3af9('0x24')]>0x0){return _0x569425[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x241f26);}var _0x591ebc=_0x547615[_0x3af9('0x28')][_0x3af9('0x32')];var _0x6b9a0c=_0x547615['body'][_0x3af9('0x23')];return getAgent(_0x591ebc)['then'](function(_0x1f3ac9){logger[_0x3af9('0x10')](_0x3af9('0x2c'),_0x1f3ac9[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x1f3ac9[_0x3af9('0x15')]),_0x3af9('0x33'),{'sessionId':_0x6b9a0c});return _0x569425[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x34')});})['catch'](handleError(_0x569425));};exports[_0x3af9('0x35')]=function(_0x34dc9a,_0x40c1de){logger[_0x3af9('0x10')](_0x3af9('0x36'),_0x34dc9a[_0x3af9('0x28')]);var _0x3722a8=answerValidation[_0x3af9('0x37')](_0x34dc9a[_0x3af9('0x28')]);if(_0x3722a8[_0x3af9('0x24')]>0x0){return _0x40c1de[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x3722a8);}var _0x549274=_0x34dc9a['body'][_0x3af9('0x32')];var _0x1daea4=_0x34dc9a[_0x3af9('0x28')][_0x3af9('0x23')];return getAgent(_0x549274)[_0x3af9('0x19')](function(_0x14b930){logger[_0x3af9('0x10')](_0x3af9('0x2c'),_0x14b930[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x14b930[_0x3af9('0x15')]),_0x3af9('0x38'),{'sessionId':_0x1daea4});return _0x40c1de['status'](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x39')});})[_0x3af9('0x1d')](handleError(_0x40c1de));};exports[_0x3af9('0x3a')]=function(_0x4e2803,_0x4d3b13){logger[_0x3af9('0x10')]('hold\x20fired:',_0x4e2803[_0x3af9('0x28')]);var _0x426082=holdValidation[_0x3af9('0x37')](_0x4e2803[_0x3af9('0x28')]);if(_0x426082['length']>0x0){return _0x4d3b13[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x426082);}var _0x37cdcc=_0x4e2803['body']['userId'];var _0x3cd467=_0x4e2803['body']['sessionId'];return getAgent(_0x37cdcc)['then'](function(_0x19bd47){logger[_0x3af9('0x10')](_0x3af9('0x2c'),_0x19bd47[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x19bd47[_0x3af9('0x15')]),'webbar:hold',{'sessionId':_0x3cd467});return _0x4d3b13[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x3b')});})[_0x3af9('0x1d')](handleError(_0x4d3b13));};exports[_0x3af9('0x3c')]=function(_0x1104d4,_0x5019ff){logger[_0x3af9('0x10')](_0x3af9('0x3d'),_0x1104d4[_0x3af9('0x28')]);var _0x431c8d=unholdValidation['validate'](_0x1104d4[_0x3af9('0x28')]);if(_0x431c8d[_0x3af9('0x24')]>0x0){return _0x5019ff[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x431c8d);}var _0x505a75=_0x1104d4[_0x3af9('0x28')][_0x3af9('0x32')];var _0x17713a=_0x1104d4[_0x3af9('0x28')]['sessionId'];return getAgent(_0x505a75)['then'](function(_0x39f188){logger[_0x3af9('0x10')](_0x3af9('0x2c'),_0x39f188[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x39f188[_0x3af9('0x15')]),_0x3af9('0x3e'),{'sessionId':_0x17713a});return _0x5019ff[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x3f')});})['catch'](handleError(_0x5019ff));};exports[_0x3af9('0x40')]=function(_0x3cde20,_0x4c505e){logger['info'](_0x3af9('0x41'),_0x4c505e['body']);var _0x27f717=callsValidation[_0x3af9('0x37')](_0x3cde20['body']);if(_0x27f717['length']>0x0){return _0x4c505e[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x27f717);}var _0x1c7625=_0x3cde20[_0x3af9('0x28')]['userId'];var _0x3ed77e=respondWithRpcPromise('VoiceChannels');var _0x180a32=getAgent(_0x1c7625);return Promise[_0x3af9('0x42')]([_0x3ed77e,_0x180a32])[_0x3af9('0x19')](function(_0x58b2ff){var _0x476650=_0x58b2ff[0x0];var _0x1d6c31=_0x58b2ff[0x1];var _0x9c28e9=_[_0x3af9('0x21')](_0x476650['rows'],function(_0x1fb137){return _0x1fb137[_0x3af9('0x43')]==_0x1d6c31['id'];});return _0x4c505e[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'count':_0x9c28e9[_0x3af9('0x24')],'rows':_0x9c28e9});})[_0x3af9('0x1d')](handleError(_0x4c505e));};exports[_0x3af9('0x44')]=function(_0x58ad44,_0x1e3ca5){logger[_0x3af9('0x10')](_0x3af9('0x45'),_0x58ad44[_0x3af9('0x28')]);var _0x260f65=conferenceValidation['validate'](_0x58ad44[_0x3af9('0x28')]);if(_0x260f65[_0x3af9('0x24')]>0x0){return _0x1e3ca5[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x260f65);}var _0x15d16a=_0x58ad44[_0x3af9('0x28')][_0x3af9('0x32')];return getAgent(_0x15d16a)[_0x3af9('0x19')](function(_0x40051e){logger[_0x3af9('0x10')]('entityFound:',_0x40051e[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0x40051e[_0x3af9('0x15')]),'webbar:conference');return _0x1e3ca5[_0x3af9('0x16')](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x46')});})[_0x3af9('0x1d')](handleError(_0x1e3ca5));};exports[_0x3af9('0x47')]=function(_0x3157ab,_0x438950){logger['info'](_0x3af9('0x48'),_0x3157ab['body']);var _0x30d746=transferValidation[_0x3af9('0x37')](_0x3157ab[_0x3af9('0x28')]);if(_0x30d746[_0x3af9('0x24')]>0x0){return _0x438950[_0x3af9('0x16')](0x190)[_0x3af9('0x29')](_0x30d746);}var _0x50c934=_0x3157ab[_0x3af9('0x28')]['userId'];var _0xc5900=_0x3157ab[_0x3af9('0x28')][_0x3af9('0x23')];var _0x3e88eb=_0x3157ab['body'][_0x3af9('0x49')];return getAgent(_0x50c934)[_0x3af9('0x19')](function(_0xbfd997){logger[_0x3af9('0x10')](_0x3af9('0x2c'),_0xbfd997[_0x3af9('0x15')]);emit(util[_0x3af9('0x2d')](_0x3af9('0x2e'),_0xbfd997[_0x3af9('0x15')]),_0x3af9('0x4a'),{'sessionId':_0xc5900,'transferNumber':_0x3e88eb});return _0x438950['status'](0xc8)[_0x3af9('0x29')]({'error':![],'message':_0x3af9('0x4b')});})[_0x3af9('0x1d')](handleError(_0x438950));}; \ No newline at end of file +var _0x76dc=['agent','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','info','body','length','json','userId','callerId','format','user:%s','webbar:originate','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','userId\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','catch','User','findOne'];(function(_0x35b7c3,_0x243e1b){var _0x3681d9=function(_0xb4cb3a){while(--_0xb4cb3a){_0x35b7c3['push'](_0x35b7c3['shift']());}};_0x3681d9(++_0x243e1b);}(_0x76dc,0x1f2));var _0xc76d=function(_0x37ac91,_0x8f336c){_0x37ac91=_0x37ac91-0x0;var _0x2b2275=_0x76dc[_0x37ac91];return _0x2b2275;};'use strict';var path=require(_0xc76d('0x0'));var fs=require('fs');var _=require(_0xc76d('0x1'));var db=require(_0xc76d('0x2'))['db'];var config=require(_0xc76d('0x3'));var util=require('util');var BPromise=require(_0xc76d('0x4'));var jayson=require(_0xc76d('0x5'));var amiClient=jayson['client'][_0xc76d('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xc76d('0x7'));config[_0xc76d('0x8')]=_[_0xc76d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc76d('0xa'))(new Redis(config[_0xc76d('0x8')]));var Schema=require(_0xc76d('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xc76d('0xc')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x10')]},'transferNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]}});function emit(_0x6f94e,_0x5c680c,_0x32e0a8){logger['info'](_0x6f94e,_0x5c680c,JSON['stringify'](_0x32e0a8));io['to'](_0x6f94e)[_0xc76d('0x12')](_0x5c680c,_0x32e0a8);}function handleError(_0x31b032){return function(_0x339623){console[_0xc76d('0x13')](_0xc76d('0x14'),_0x339623,_0x339623 instanceof RangeError);logger['error'](_0x339623[_0xc76d('0x15')]);if(_0x339623 instanceof RangeError){if(_0x339623[_0xc76d('0x16')]){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x194)[_0xc76d('0x18')](_0x339623);}else{if(_0x339623['name']){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x1f4)['send'](_0x339623);}};}function checkError(){return function(_0x455371){if(!_0x455371){throw new RangeError(_0xc76d('0x19'));}return _0x455371;};}function respondWithRpcPromise(_0x191e97,_0xb89876){return new BPromise(function(_0x18f546,_0x3d357b){var _0x42b89c=amiClient;return _0x42b89c[_0xc76d('0x1a')](_0x191e97,_0xb89876)[_0xc76d('0x1b')](function(_0x20e09c){if(_0x20e09c[_0xc76d('0x1c')]){if(_0x20e09c['error'][_0xc76d('0x1d')]===0x1f4){return _0x3d357b(_0x20e09c[_0xc76d('0x1c')]['message']);}return _0x18f546(_0x20e09c[_0xc76d('0x1c')][_0xc76d('0x1e')]);}else{_0x18f546(_0x20e09c['result']);}})[_0xc76d('0x1f')](function(_0x476aee){_0x3d357b(_0x476aee);});});}function getAgent(_0x2cd06e){return db[_0xc76d('0x20')][_0xc76d('0x21')]({'where':{'id':_0x2cd06e,'role':_0xc76d('0x22')}})[_0xc76d('0x1b')](checkError());}function getAgentCheckSession(_0x59ebd1,_0x59dabf){return new BPromise(function(_0x285430,_0x287ae4){var _0x5069ea=respondWithRpcPromise(_0xc76d('0x23'));var _0x52a79a=getAgent(_0x59ebd1);Promise[_0xc76d('0x24')]([_0x5069ea,_0x52a79a])['then'](function(_0x2039f4){var _0x5cf2e4=_0x2039f4[0x0];var _0x13b468=_0x2039f4[0x1];var _0x18a7fa=_['filter'](_0x5cf2e4[_0xc76d('0x25')],function(_0x1c68f3){return _0x1c68f3[_0xc76d('0x26')]==_0x13b468['id']&&_0x1c68f3[_0xc76d('0x27')]==_0x59dabf;});if(_0x18a7fa['length']==0x1){_0x285430(_0x13b468);}else{_0x287ae4(new RangeError(_0xc76d('0x28')+_0x59dabf+'\x20not\x20found!'));}});});}exports[_0xc76d('0x29')]=function(_0x5e9233,_0x30769f){logger[_0xc76d('0x2a')]('originate\x20fired:',_0x5e9233['body']);var _0x5eca19=originateValidation['validate'](_0x5e9233[_0xc76d('0x2b')]);if(_0x5eca19[_0xc76d('0x2c')]>0x0){return _0x30769f[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x5eca19);}var _0x1b2ed1=_0x5e9233['body'][_0xc76d('0x2e')];var _0x55e825=_0x5e9233[_0xc76d('0x2b')]['callNumber'];var _0x1bef44=_0x5e9233[_0xc76d('0x2b')][_0xc76d('0x2f')];var _0x20fe33=_0x5e9233[_0xc76d('0x2b')]['callbackUrl'];return getAgent(_0x1b2ed1)[_0xc76d('0x1b')](function(_0x371306){logger[_0xc76d('0x2a')]('entityFound:',_0x371306[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x371306['name']),_0xc76d('0x32'),{'callNumber':_0x55e825,'callerId':_0x1bef44,'callbackUrl':_0x20fe33});return _0x30769f[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x33')});})[_0xc76d('0x1f')](handleError(_0x30769f));};exports[_0xc76d('0x34')]=function(_0x579d93,_0x518945){logger[_0xc76d('0x2a')]('hangup\x20fired:',_0x579d93[_0xc76d('0x2b')]);var _0x359f38=hangupValidation[_0xc76d('0xb')](_0x579d93[_0xc76d('0x2b')]);if(_0x359f38['length']>0x0){return _0x518945['status'](0x190)[_0xc76d('0x2d')](_0x359f38);}var _0x20a456=_0x579d93[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x410029=_0x579d93['body'][_0xc76d('0x27')];return getAgent(_0x20a456)[_0xc76d('0x1b')](function(_0x321989){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x321989[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x321989[_0xc76d('0x16')]),_0xc76d('0x36'),{'sessionId':_0x410029});return _0x518945['status'](0xc8)['json']({'error':![],'message':_0xc76d('0x37')});})[_0xc76d('0x1f')](handleError(_0x518945));};exports[_0xc76d('0x38')]=function(_0x27bdff,_0x4ae994){logger['info'](_0xc76d('0x39'),_0x27bdff[_0xc76d('0x2b')]);var _0x3e471e=answerValidation[_0xc76d('0xb')](_0x27bdff[_0xc76d('0x2b')]);if(_0x3e471e[_0xc76d('0x2c')]>0x0){return _0x4ae994[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x3e471e);}var _0x50e922=_0x27bdff[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x1bf8a0=_0x27bdff[_0xc76d('0x2b')]['sessionId'];return getAgent(_0x50e922)['then'](function(_0x4bf591){logger['info']('entityFound:',_0x4bf591['name']);emit(util['format'](_0xc76d('0x31'),_0x4bf591[_0xc76d('0x16')]),_0xc76d('0x3a'),{'sessionId':_0x1bf8a0});return _0x4ae994[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3b')});})[_0xc76d('0x1f')](handleError(_0x4ae994));};exports[_0xc76d('0x3c')]=function(_0x555f14,_0x462214){logger[_0xc76d('0x2a')](_0xc76d('0x3d'),_0x555f14[_0xc76d('0x2b')]);var _0xb9cca2=holdValidation[_0xc76d('0xb')](_0x555f14[_0xc76d('0x2b')]);if(_0xb9cca2[_0xc76d('0x2c')]>0x0){return _0x462214[_0xc76d('0x17')](0x190)['json'](_0xb9cca2);}var _0x5b41d3=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x2fa905=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x5b41d3)['then'](function(_0x25fc9d){logger[_0xc76d('0x2a')]('entityFound:',_0x25fc9d['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x25fc9d['name']),_0xc76d('0x3e'),{'sessionId':_0x2fa905});return _0x462214[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3f')});})[_0xc76d('0x1f')](handleError(_0x462214));};exports[_0xc76d('0x40')]=function(_0x25a549,_0x10b1b0){logger[_0xc76d('0x2a')](_0xc76d('0x41'),_0x25a549['body']);var _0x4efd83=unholdValidation[_0xc76d('0xb')](_0x25a549[_0xc76d('0x2b')]);if(_0x4efd83['length']>0x0){return _0x10b1b0[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x4efd83);}var _0x506b03=_0x25a549[_0xc76d('0x2b')]['userId'];var _0xe90d83=_0x25a549[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x506b03)[_0xc76d('0x1b')](function(_0x14ef42){logger['info']('entityFound:',_0x14ef42['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x14ef42[_0xc76d('0x16')]),_0xc76d('0x42'),{'sessionId':_0xe90d83});return _0x10b1b0[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0xc76d('0x1f')](handleError(_0x10b1b0));};exports[_0xc76d('0x43')]=function(_0x5e66d9,_0x1a49d5){logger[_0xc76d('0x2a')]('calls\x20fired:',_0x1a49d5[_0xc76d('0x2b')]);var _0x463cbe=callsValidation[_0xc76d('0xb')](_0x5e66d9[_0xc76d('0x2b')]);if(_0x463cbe[_0xc76d('0x2c')]>0x0){return _0x1a49d5[_0xc76d('0x17')](0x190)['json'](_0x463cbe);}var _0x91b25b=_0x5e66d9[_0xc76d('0x2b')]['userId'];var _0x5f3973=respondWithRpcPromise(_0xc76d('0x23'));var _0x5ddcc6=getAgent(_0x91b25b);return Promise[_0xc76d('0x24')]([_0x5f3973,_0x5ddcc6])[_0xc76d('0x1b')](function(_0x12b287){var _0xfe2be1=_0x12b287[0x0];var _0x254128=_0x12b287[0x1];var _0x4746a5=_[_0xc76d('0x44')](_0xfe2be1[_0xc76d('0x25')],function(_0x3ada89){return _0x3ada89[_0xc76d('0x26')]==_0x254128['id'];});return _0x1a49d5[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'count':_0x4746a5[_0xc76d('0x2c')],'rows':_0x4746a5});})[_0xc76d('0x1f')](handleError(_0x1a49d5));};exports['conference']=function(_0x3054e0,_0xa0aa45){logger[_0xc76d('0x2a')](_0xc76d('0x45'),_0x3054e0[_0xc76d('0x2b')]);var _0x5ce99d=conferenceValidation[_0xc76d('0xb')](_0x3054e0[_0xc76d('0x2b')]);if(_0x5ce99d['length']>0x0){return _0xa0aa45['status'](0x190)['json'](_0x5ce99d);}var _0x382db6=_0x3054e0[_0xc76d('0x2b')][_0xc76d('0x2e')];return getAgent(_0x382db6)[_0xc76d('0x1b')](function(_0x2ba812){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x2ba812[_0xc76d('0x16')]);emit(util['format'](_0xc76d('0x31'),_0x2ba812['name']),'webbar:conference');return _0xa0aa45[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x46')});})['catch'](handleError(_0xa0aa45));};exports[_0xc76d('0x47')]=function(_0x57068d,_0x48ccf7){logger['info'](_0xc76d('0x48'),_0x57068d[_0xc76d('0x2b')]);var _0x513623=transferValidation[_0xc76d('0xb')](_0x57068d[_0xc76d('0x2b')]);if(_0x513623[_0xc76d('0x2c')]>0x0){return _0x48ccf7[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x513623);}var _0xa81af6=_0x57068d[_0xc76d('0x2b')]['userId'];var _0x5035fd=_0x57068d['body'][_0xc76d('0x27')];var _0x2e742f=_0x57068d[_0xc76d('0x2b')][_0xc76d('0x49')];return getAgent(_0xa81af6)[_0xc76d('0x1b')](function(_0x49f876){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x49f876[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x49f876[_0xc76d('0x16')]),_0xc76d('0x4a'),{'sessionId':_0x5035fd,'transferNumber':_0x2e742f});return _0x48ccf7[_0xc76d('0x17')](0xc8)['json']({'error':![],'message':_0xc76d('0x4b')});})['catch'](handleError(_0x48ccf7));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 135e5d6..3b15bd2 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 _0x8e3f=['addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0xab4097,_0x335b33){var _0x2c7a21=function(_0x1f76ef){while(--_0x1f76ef){_0xab4097['push'](_0xab4097['shift']());}};_0x2c7a21(++_0x335b33);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var fs_extra=require(_0xf8e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var controller=require('./whatsappAccount.controller');router[_0xf8e3('0x8')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xa')]);router[_0xf8e3('0x8')]('/describe',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xb')]);router[_0xf8e3('0x8')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xd')]);router[_0xf8e3('0x8')](_0xf8e3('0xe'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0xf')]);router[_0xf8e3('0x8')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller[_0xf8e3('0x11')]);router[_0xf8e3('0x8')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x13')]);router[_0xf8e3('0x8')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller['getApplications']);router[_0xf8e3('0x15')]('/',auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x16')]);router['post'](_0xf8e3('0xe'),auth['isAuthenticated'](),controller[_0xf8e3('0x17')]);router[_0xf8e3('0x15')](_0xf8e3('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xf8e3('0x15')](_0xf8e3('0x12'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x18')]);router[_0xf8e3('0x15')](_0xf8e3('0x14'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x19')]);router[_0xf8e3('0x15')](_0xf8e3('0x1a'),controller['notify']);router[_0xf8e3('0x15')](_0xf8e3('0x1b'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1c')]);router[_0xf8e3('0x1d')](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1e')]);router['delete'](_0xf8e3('0xc'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x1f')]);router[_0xf8e3('0x20')]('/:id/dispositions',auth[_0xf8e3('0x9')](),controller['removeDispositions']);router[_0xf8e3('0x20')](_0xf8e3('0x10'),auth[_0xf8e3('0x9')](),controller[_0xf8e3('0x21')]);router[_0xf8e3('0x20')](_0xf8e3('0x12'),auth['isAuthenticated'](),controller[_0xf8e3('0x22')]);module[_0xf8e3('0x23')]=router; \ No newline at end of file +var _0x01d9=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x1c828f,_0x284cc7){var _0x5a672d=function(_0x32aaf7){while(--_0x32aaf7){_0x1c828f['push'](_0x1c828f['shift']());}};_0x5a672d(++_0x284cc7);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var fs_extra=require(_0x901d('0x5'));var auth=require(_0x901d('0x6'));var interaction=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var controller=require(_0x901d('0x9'));router[_0x901d('0xa')]('/',auth['isAuthenticated'](),controller[_0x901d('0xb')]);router[_0x901d('0xa')](_0x901d('0xc'),auth[_0x901d('0xd')](),controller[_0x901d('0xe')]);router[_0x901d('0xa')](_0x901d('0xf'),auth[_0x901d('0xd')](),controller[_0x901d('0x10')]);router[_0x901d('0xa')](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x12')]);router['get'](_0x901d('0x13'),auth['isAuthenticated'](),controller[_0x901d('0x14')]);router[_0x901d('0xa')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x16')]);router['get'](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x18')]);router[_0x901d('0x19')]('/',auth[_0x901d('0xd')](),controller[_0x901d('0x1a')]);router['post'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x1b')]);router[_0x901d('0x19')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x1c')]);router[_0x901d('0x19')](_0x901d('0x15'),auth[_0x901d('0xd')](),controller[_0x901d('0x1d')]);router[_0x901d('0x19')](_0x901d('0x17'),auth[_0x901d('0xd')](),controller[_0x901d('0x1e')]);router[_0x901d('0x19')](_0x901d('0x1f'),controller[_0x901d('0x20')]);router['post'](_0x901d('0x21'),auth[_0x901d('0xd')](),controller['send']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x901d('0x22')]);router[_0x901d('0x23')]('/:id',auth[_0x901d('0xd')](),controller[_0x901d('0x24')]);router['delete'](_0x901d('0x11'),auth[_0x901d('0xd')](),controller[_0x901d('0x25')]);router[_0x901d('0x23')](_0x901d('0x13'),auth[_0x901d('0xd')](),controller[_0x901d('0x26')]);router[_0x901d('0x23')]('/:id/users',auth[_0x901d('0xd')](),controller[_0x901d('0x27')]);module[_0x901d('0x28')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 8efe5d1..7eb2dd0 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 _0xd924=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x236304,_0x3cbc48){var _0x56566f=function(_0x14e065){while(--_0x14e065){_0x236304['push'](_0x236304['shift']());}};_0x56566f(++_0x3cbc48);}(_0xd924,0x8d));var _0x4d92=function(_0x420f39,_0x67e5fd){_0x420f39=_0x420f39-0x0;var _0xa4296a=_0xd924[_0x420f39];return _0xa4296a;};'use strict';var Sequelize=require(_0x4d92('0x0'));var rs=require(_0x4d92('0x1'));module[_0x4d92('0x2')]={'name':{'type':Sequelize[_0x4d92('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4d92('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4d92('0x3')],'defaultValue':function(){return rs[_0x4d92('0x4')]();}},'phone':{'type':Sequelize[_0x4d92('0x3')]},'type':{'type':Sequelize[_0x4d92('0x5')](_0x4d92('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x4d92('0x3')]},'baseUrl':{'type':Sequelize[_0x4d92('0x3')]},'authToken':{'type':Sequelize[_0x4d92('0x3')]},'notificationTemplate':{'type':Sequelize[_0x4d92('0x7')],'defaultValue':function(){return _0x4d92('0x8');}},'notificationSound':{'type':Sequelize[_0x4d92('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4d92('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4d92('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4d92('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4d92('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4d92('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4d92('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4d92('0xb'),'set':function(_0x405fea){if(!_0x405fea){this[_0x4d92('0xc')](_0x4d92('0xd'),null);}this[_0x4d92('0xc')](_0x4d92('0xe'),_0x405fea);}},'description':{'type':Sequelize[_0x4d92('0x3')]}}; \ No newline at end of file +var _0x2695=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','BOOLEAN'];(function(_0x52a94f,_0xf29880){var _0x5df946=function(_0x2885bf){while(--_0x2885bf){_0x52a94f['push'](_0x52a94f['shift']());}};_0x5df946(++_0xf29880);}(_0x2695,0x17c));var _0x5269=function(_0x5eff3c,_0x336039){_0x5eff3c=_0x5eff3c-0x0;var _0x1ecbb4=_0x2695[_0x5eff3c];return _0x1ecbb4;};'use strict';var Sequelize=require(_0x5269('0x0'));var rs=require(_0x5269('0x1'));module[_0x5269('0x2')]={'name':{'type':Sequelize[_0x5269('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5269('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x5269('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x5269('0x3')],'defaultValue':function(){return rs[_0x5269('0x4')]();}},'phone':{'type':Sequelize[_0x5269('0x3')]},'type':{'type':Sequelize[_0x5269('0x5')](_0x5269('0x6'),_0x5269('0x7'))},'accountSid':{'type':Sequelize[_0x5269('0x3')]},'baseUrl':{'type':Sequelize[_0x5269('0x3')]},'authToken':{'type':Sequelize[_0x5269('0x3')]},'notificationTemplate':{'type':Sequelize[_0x5269('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5269('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5269('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5269('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5269('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5269('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5269('0x9')],'defaultValue':![],'comment':_0x5269('0xb'),'set':function(_0x1ec6cc){if(!_0x1ec6cc){this[_0x5269('0xc')](_0x5269('0xd'),null);}this[_0x5269('0xc')](_0x5269('0xe'),_0x1ec6cc);}},'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 67cbc94..d364ca3 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 _0xb3de=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','status','end','undefined','limit','count','offset','set','json','apply','reject','update','WhatsappAccounts','UserProfileResource','destroy','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','Disposition','WhatsappAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','transaction','sequelize','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','send','getApplications','notify','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','Applications','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','notifications','message_id','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x41d276,_0xc7cbbf){var _0xb4e969=function(_0x4247b8){while(--_0x4247b8){_0x41d276['push'](_0x41d276['shift']());}};_0xb4e969(++_0xc7cbbf);}(_0xb3de,0x169));var _0xeb3d=function(_0x18d85c,_0x239c4e){_0x18d85c=_0x18d85c-0x0;var _0x45aae0=_0xb3de[_0x18d85c];return _0x45aae0;};'use strict';var emlformat=require(_0xeb3d('0x0'));var rimraf=require(_0xeb3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb3d('0x2'));var rp=require(_0xeb3d('0x3'));var moment=require(_0xeb3d('0x4'));var BPromise=require(_0xeb3d('0x5'));var Mustache=require(_0xeb3d('0x6'));var util=require(_0xeb3d('0x7'));var path=require('path');var sox=require(_0xeb3d('0x8'));var csv=require('to-csv');var ejs=require(_0xeb3d('0x9'));var fs=require('fs');var fs_extra=require(_0xeb3d('0xa'));var _=require(_0xeb3d('0xb'));var squel=require(_0xeb3d('0xc'));var crypto=require('crypto');var jsforce=require(_0xeb3d('0xd'));var deskjs=require(_0xeb3d('0xe'));var toCsv=require(_0xeb3d('0xf'));var querystring=require(_0xeb3d('0x10'));var Papa=require('papaparse');var Redis=require(_0xeb3d('0x11'));var authService=require(_0xeb3d('0x12'));var qs=require(_0xeb3d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb3d('0x14'))(_0xeb3d('0x15'));var utils=require('../../config/utils');var config=require(_0xeb3d('0x16'));var licenseUtil=require(_0xeb3d('0x17'));var db=require(_0xeb3d('0x18'))['db'];config[_0xeb3d('0x19')]=_[_0xeb3d('0x1a')](config[_0xeb3d('0x19')],{'host':_0xeb3d('0x1b'),'port':0x18eb});var socket=require(_0xeb3d('0x1c'))(new Redis(config['redis']));require(_0xeb3d('0x1d'))[_0xeb3d('0x1e')](socket);var jayson=require(_0xeb3d('0x1f'));var client=jayson[_0xeb3d('0x20')][_0xeb3d('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x3a1b0d,_0x470dde,_0x2cb9d5,_0x1c0026){return new BPromise(function(_0x2c3df3,_0xc9341c){var _0x2bed0c=_0x1c0026||client;return _0x2bed0c[_0xeb3d('0x22')](_0x3a1b0d,_0x2cb9d5)[_0xeb3d('0x23')](function(_0x4f7398){logger[_0xeb3d('0x24')](_0xeb3d('0x25'),_0x470dde,_0xeb3d('0x26'));logger[_0xeb3d('0x27')](_0xeb3d('0x28'),_0x470dde,_0xeb3d('0x26'),JSON['stringify'](_0x4f7398));if(_0x4f7398[_0xeb3d('0x29')]){if(_0x4f7398[_0xeb3d('0x29')][_0xeb3d('0x2a')]===0x1f4){logger[_0xeb3d('0x29')](_0xeb3d('0x25'),_0x470dde,_0x4f7398[_0xeb3d('0x29')][_0xeb3d('0x2b')]);return _0xc9341c(_0x4f7398[_0xeb3d('0x29')]['message']);}logger[_0xeb3d('0x29')](_0xeb3d('0x25'),_0x470dde,_0x4f7398['error'][_0xeb3d('0x2b')]);return _0x2c3df3(_0x4f7398['error']['message']);}else{logger[_0xeb3d('0x24')](_0xeb3d('0x25'),_0x470dde,_0xeb3d('0x26'));_0x2c3df3(_0x4f7398['result'][_0xeb3d('0x2b')]);}})['catch'](function(_0x330538){logger[_0xeb3d('0x29')](_0xeb3d('0x25'),_0x470dde,_0x330538);_0xc9341c(_0x330538);});});}function respondWithStatusCode(_0x469f5d,_0x41dfca){_0x41dfca=_0x41dfca||0xcc;return function(_0x48e684){if(_0x48e684){return _0x469f5d['sendStatus'](_0x41dfca);}return _0x469f5d[_0xeb3d('0x2c')](_0x41dfca)[_0xeb3d('0x2d')]();};}function respondWithResult(_0x1ec0a1,_0xb47d15){_0xb47d15=_0xb47d15||0xc8;return function(_0x4439de){if(_0x4439de){return _0x1ec0a1[_0xeb3d('0x2c')](_0xb47d15)['json'](_0x4439de);}};}function respondWithFilteredResult(_0xdc3f34,_0x24ecbc){return function(_0x333c67){if(_0x333c67){var _0x32b6c5=typeof _0x24ecbc['offset']===_0xeb3d('0x2e')&&typeof _0x24ecbc[_0xeb3d('0x2f')]===_0xeb3d('0x2e');var _0x386646=_0x333c67[_0xeb3d('0x30')];var _0x40e57b=_0x32b6c5?0x0:_0x24ecbc['offset'];var _0x5d9f9b=_0x32b6c5?_0x333c67[_0xeb3d('0x30')]:_0x24ecbc[_0xeb3d('0x31')]+_0x24ecbc[_0xeb3d('0x2f')];var _0x5cf927;if(_0x5d9f9b>=_0x386646){_0x5d9f9b=_0x386646;_0x5cf927=0xc8;}else{_0x5cf927=0xce;}_0xdc3f34[_0xeb3d('0x2c')](_0x5cf927);return _0xdc3f34[_0xeb3d('0x32')]('Content-Range',_0x40e57b+'-'+_0x5d9f9b+'/'+_0x386646)[_0xeb3d('0x33')](_0x333c67);}return null;};}function patchUpdates(_0x2d1d9b){return function(_0x1a40d7){try{jsonpatch[_0xeb3d('0x34')](_0x1a40d7,_0x2d1d9b,!![]);}catch(_0x4e2057){return BPromise[_0xeb3d('0x35')](_0x4e2057);}return _0x1a40d7['save']();};}function saveUpdates(_0x31b862,_0x438ae3){return function(_0x10b082){if(_0x10b082){return _0x10b082[_0xeb3d('0x36')](_0x31b862)['then'](function(_0x1f0d65){return _0x1f0d65;});}return null;};}function removeEntity(_0x36ca45,_0x29401e){return function(_0x5cbd7b){if(_0x5cbd7b){return _0x5cbd7b['destroy']()[_0xeb3d('0x23')](function(){var _0x2a5ad9=_0x5cbd7b['get']({'plain':!![]});var _0x5f9785=_0xeb3d('0x37');return db[_0xeb3d('0x38')][_0xeb3d('0x39')]({'where':{'type':_0x5f9785,'resourceId':_0x2a5ad9['id']}})[_0xeb3d('0x23')](function(){return _0x5cbd7b;});})['then'](function(){_0x36ca45[_0xeb3d('0x2c')](0xcc)[_0xeb3d('0x2d')]();});}};}function handleEntityNotFound(_0x180fc9,_0x48216b){return function(_0x3c9542){if(!_0x3c9542){_0x180fc9[_0xeb3d('0x3a')](0x194);}return _0x3c9542;};}function handleError(_0x291c8f,_0x26fc6d){_0x26fc6d=_0x26fc6d||0x1f4;return function(_0x11b288){logger[_0xeb3d('0x29')](_0x11b288[_0xeb3d('0x3b')]);if(_0x11b288[_0xeb3d('0x3c')]){delete _0x11b288[_0xeb3d('0x3c')];}_0x291c8f[_0xeb3d('0x2c')](_0x26fc6d)['send'](_0x11b288);};}exports[_0xeb3d('0x3d')]=function(_0x584902,_0x107432){var _0x383c1b={'include':[{'model':db[_0xeb3d('0x3e')],'as':_0xeb3d('0x3f')}]},_0x5bab14={},_0x4813b7={'count':0x0,'rows':[]};var _0xa62cf0=_['map'](db[_0xeb3d('0x40')]['rawAttributes'],function(_0x12b13a){return{'name':_0x12b13a[_0xeb3d('0x41')],'type':_0x12b13a[_0xeb3d('0x42')][_0xeb3d('0x43')]};});_0x5bab14[_0xeb3d('0x44')]=_[_0xeb3d('0x45')](_0xa62cf0,'name');_0x5bab14[_0xeb3d('0x46')]=_[_0xeb3d('0x47')](_0x584902[_0xeb3d('0x46')]);_0x5bab14[_0xeb3d('0x48')]=_[_0xeb3d('0x49')](_0x5bab14[_0xeb3d('0x44')],_0x5bab14[_0xeb3d('0x46')]);_0x383c1b[_0xeb3d('0x4a')]=_[_0xeb3d('0x49')](_0x5bab14[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x584902[_0xeb3d('0x46')][_0xeb3d('0x4b')]));_0x383c1b[_0xeb3d('0x4a')]=_0x383c1b[_0xeb3d('0x4a')]['length']?_0x383c1b[_0xeb3d('0x4a')]:_0x5bab14[_0xeb3d('0x44')];if(!_0x584902[_0xeb3d('0x46')][_0xeb3d('0x4c')](_0xeb3d('0x4d'))){_0x383c1b[_0xeb3d('0x2f')]=qs['limit'](_0x584902[_0xeb3d('0x46')][_0xeb3d('0x2f')]);_0x383c1b[_0xeb3d('0x31')]=qs[_0xeb3d('0x31')](_0x584902[_0xeb3d('0x46')][_0xeb3d('0x31')]);}_0x383c1b[_0xeb3d('0x4e')]=qs[_0xeb3d('0x4f')](_0x584902['query']['sort']);_0x383c1b[_0xeb3d('0x50')]=qs[_0xeb3d('0x48')](_[_0xeb3d('0x51')](_0x584902[_0xeb3d('0x46')],_0x5bab14[_0xeb3d('0x48')]),_0xa62cf0);if(_0x584902['query']['filter']){_0x383c1b[_0xeb3d('0x50')]=_[_0xeb3d('0x52')](_0x383c1b[_0xeb3d('0x50')],{'$or':_['map'](_0xa62cf0,function(_0x273e47){if(_0x273e47['type']!==_0xeb3d('0x53')){var _0x36001c={};_0x36001c[_0x273e47[_0xeb3d('0x3c')]]={'$like':'%'+_0x584902[_0xeb3d('0x46')]['filter']+'%'};return _0x36001c;}})});}_0x383c1b=_[_0xeb3d('0x52')]({},_0x383c1b,_0x584902['options']);var _0x25198d={'where':_0x383c1b[_0xeb3d('0x50')]};return db[_0xeb3d('0x40')][_0xeb3d('0x30')](_0x25198d)[_0xeb3d('0x23')](function(_0x49bba8){_0x4813b7[_0xeb3d('0x30')]=_0x49bba8;if(_0x584902[_0xeb3d('0x46')][_0xeb3d('0x54')]){_0x383c1b['include']=[{'all':!![]}];}return db[_0xeb3d('0x40')][_0xeb3d('0x55')](_0x383c1b);})[_0xeb3d('0x23')](function(_0x2eab51){_0x4813b7[_0xeb3d('0x56')]=_0x2eab51;return _0x4813b7;})[_0xeb3d('0x23')](respondWithFilteredResult(_0x107432,_0x383c1b))[_0xeb3d('0x57')](handleError(_0x107432,null));};exports[_0xeb3d('0x58')]=function(_0x362165,_0x349d15){var _0x54a3c0={'raw':![],'where':{'id':_0x362165[_0xeb3d('0x59')]['id']},'include':[{'model':db[_0xeb3d('0x3e')],'as':_0xeb3d('0x3f')}]},_0x295157={};_0x295157[_0xeb3d('0x44')]=_[_0xeb3d('0x47')](db[_0xeb3d('0x40')][_0xeb3d('0x5a')]);_0x295157['query']=_[_0xeb3d('0x47')](_0x362165[_0xeb3d('0x46')]);_0x295157[_0xeb3d('0x48')]=_[_0xeb3d('0x49')](_0x295157[_0xeb3d('0x44')],_0x295157['query']);_0x54a3c0[_0xeb3d('0x4a')]=_['intersection'](_0x295157[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x362165[_0xeb3d('0x46')]['fields']));_0x54a3c0['attributes']=_0x54a3c0['attributes'][_0xeb3d('0x5b')]?_0x54a3c0[_0xeb3d('0x4a')]:_0x295157[_0xeb3d('0x44')];if(_0x362165[_0xeb3d('0x46')][_0xeb3d('0x54')]){_0x54a3c0[_0xeb3d('0x5c')]=[{'all':!![]}];}_0x54a3c0=_[_0xeb3d('0x52')]({},_0x54a3c0,_0x362165[_0xeb3d('0x5d')]);return db[_0xeb3d('0x40')]['find'](_0x54a3c0)[_0xeb3d('0x23')](handleEntityNotFound(_0x349d15,null))[_0xeb3d('0x23')](respondWithResult(_0x349d15,null))[_0xeb3d('0x57')](handleError(_0x349d15,null));};exports['create']=function(_0x4628fc,_0x509097){return db['WhatsappAccount'][_0xeb3d('0x5e')](_0x4628fc[_0xeb3d('0x5f')],{})['then'](function(_0x4358a8){var _0x8c4349=_0x4628fc[_0xeb3d('0x60')][_0xeb3d('0x61')]({'plain':!![]});if(!_0x8c4349)throw new Error(_0xeb3d('0x62'));if(_0x8c4349['role']===_0xeb3d('0x60')){var _0x4a3a94=_0x4358a8[_0xeb3d('0x61')]({'plain':!![]});var _0x223d3b=_0xeb3d('0x37');return db['UserProfileSection'][_0xeb3d('0x63')]({'where':{'name':_0x223d3b,'userProfileId':_0x8c4349[_0xeb3d('0x64')]},'raw':!![]})['then'](function(_0x500e21){if(_0x500e21&&_0x500e21['autoAssociation']===0x0){return db[_0xeb3d('0x38')]['create']({'name':_0x4a3a94[_0xeb3d('0x3c')],'resourceId':_0x4a3a94['id'],'type':_0x500e21[_0xeb3d('0x3c')],'sectionId':_0x500e21['id']},{})[_0xeb3d('0x23')](function(){return _0x4358a8;});}else{return _0x4358a8;}})['catch'](function(_0x48404d){logger[_0xeb3d('0x29')](_0xeb3d('0x65'),_0x48404d);throw _0x48404d;});}return _0x4358a8;})[_0xeb3d('0x23')](respondWithResult(_0x509097,0xc9))[_0xeb3d('0x57')](handleError(_0x509097,null));};exports[_0xeb3d('0x36')]=function(_0x56870f,_0x28e6da){if(_0x56870f[_0xeb3d('0x5f')]['id']){delete _0x56870f['body']['id'];}return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x56870f['params']['id']},'include':[{'model':db['Pause'],'as':_0xeb3d('0x3f')}]})['then'](handleEntityNotFound(_0x28e6da,null))[_0xeb3d('0x23')](saveUpdates(_0x56870f['body'],null))[_0xeb3d('0x23')](respondWithResult(_0x28e6da,null))[_0xeb3d('0x57')](handleError(_0x28e6da,null));};exports[_0xeb3d('0x39')]=function(_0x3fdee3,_0x48a1b3){return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x3fdee3['params']['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x48a1b3,null))[_0xeb3d('0x23')](removeEntity(_0x48a1b3,null))['catch'](handleError(_0x48a1b3,null));};exports[_0xeb3d('0x66')]=function(_0x81a160,_0x488252){return db[_0xeb3d('0x40')][_0xeb3d('0x66')]()['then'](respondWithResult(_0x488252,null))[_0xeb3d('0x57')](handleError(_0x488252,null));};exports['addDisposition']=function(_0x354e7e,_0x58ab40,_0x1bc2f7){if(_0x354e7e[_0xeb3d('0x5f')]['id']){delete _0x354e7e[_0xeb3d('0x5f')]['id'];}return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x354e7e[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x58ab40,null))['then'](function(_0x30b8c6){if(_0x30b8c6){_0x354e7e['body']['WhatsappAccountId']=_0x30b8c6['id'];return db['Disposition']['create'](_0x354e7e['body']);}})['then'](respondWithResult(_0x58ab40,null))[_0xeb3d('0x57')](handleError(_0x58ab40,null));};exports['getDispositions']=function(_0x10a91a,_0x37beb9,_0x467ff7){var _0x49db77={'raw':![],'where':{}};var _0x4cf62a={};var _0x47910b={'count':0x0,'rows':[]};return db[_0xeb3d('0x40')][_0xeb3d('0x67')]({'where':{'id':_0x10a91a[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x37beb9,null))[_0xeb3d('0x23')](function(_0x1f9ba4){if(_0x1f9ba4){_0x4cf62a[_0xeb3d('0x44')]=_[_0xeb3d('0x47')](db[_0xeb3d('0x68')][_0xeb3d('0x5a')]);_0x4cf62a[_0xeb3d('0x46')]=_[_0xeb3d('0x47')](_0x10a91a[_0xeb3d('0x46')]);_0x4cf62a[_0xeb3d('0x48')]=_['intersection'](_0x4cf62a[_0xeb3d('0x44')],_0x4cf62a[_0xeb3d('0x46')]);_0x49db77['attributes']=_[_0xeb3d('0x49')](_0x4cf62a[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x10a91a[_0xeb3d('0x46')]['fields']));_0x49db77[_0xeb3d('0x4a')]=_0x49db77['attributes']['length']?_0x49db77[_0xeb3d('0x4a')]:_0x4cf62a[_0xeb3d('0x44')];if(!_0x10a91a['query'][_0xeb3d('0x4c')](_0xeb3d('0x4d'))){_0x49db77[_0xeb3d('0x2f')]=qs['limit'](_0x10a91a[_0xeb3d('0x46')]['limit']);_0x49db77[_0xeb3d('0x31')]=qs[_0xeb3d('0x31')](_0x10a91a[_0xeb3d('0x46')]['offset']);}_0x49db77[_0xeb3d('0x4e')]=qs[_0xeb3d('0x4f')](_0x10a91a['query'][_0xeb3d('0x4f')]);_0x49db77['where']=qs[_0xeb3d('0x48')](_[_0xeb3d('0x51')](_0x10a91a[_0xeb3d('0x46')],_0x4cf62a[_0xeb3d('0x48')]));_0x49db77[_0xeb3d('0x50')][_0xeb3d('0x69')]=_0x1f9ba4['id'];if(_0x10a91a[_0xeb3d('0x46')][_0xeb3d('0x6a')]){_0x49db77[_0xeb3d('0x50')]=_[_0xeb3d('0x52')](_0x49db77[_0xeb3d('0x50')],{'$or':_[_0xeb3d('0x45')](_0x49db77[_0xeb3d('0x4a')],function(_0x5e6915){var _0xed5625={};_0xed5625[_0x5e6915]={'$like':'%'+_0x10a91a[_0xeb3d('0x46')][_0xeb3d('0x6a')]+'%'};return _0xed5625;})});}_0x49db77=_[_0xeb3d('0x52')]({},_0x49db77,_0x10a91a['options']);return db[_0xeb3d('0x68')][_0xeb3d('0x30')]({'where':_0x49db77[_0xeb3d('0x50')]})[_0xeb3d('0x23')](function(_0x1c8f08){_0x47910b[_0xeb3d('0x30')]=_0x1c8f08;if(_0x10a91a[_0xeb3d('0x46')][_0xeb3d('0x54')]){_0x49db77[_0xeb3d('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0xeb3d('0x55')](_0x49db77);})['then'](function(_0x48cea2){_0x47910b[_0xeb3d('0x56')]=_0x48cea2;return _0x47910b;});}})['then'](respondWithFilteredResult(_0x37beb9,_0x49db77))[_0xeb3d('0x57')](handleError(_0x37beb9,null));};exports[_0xeb3d('0x6b')]=function(_0x542f6c,_0x15bb0c,_0x14f693){return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x542f6c['params']['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x15bb0c,null))['then'](function(_0x36ab91){if(_0x36ab91){return _0x36ab91[_0xeb3d('0x6b')](_0x542f6c['query'][_0xeb3d('0x6c')]);}})[_0xeb3d('0x23')](respondWithStatusCode(_0x15bb0c,null))['catch'](handleError(_0x15bb0c,null));};exports[_0xeb3d('0x6d')]=function(_0x187394,_0x183815,_0xcc3021){if(_0x187394[_0xeb3d('0x5f')]['id']){delete _0x187394[_0xeb3d('0x5f')]['id'];}return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x187394[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x183815,null))[_0xeb3d('0x23')](function(_0x4b0ea5){if(_0x4b0ea5){_0x187394['body'][_0xeb3d('0x69')]=_0x4b0ea5['id'];return db['CannedAnswer'][_0xeb3d('0x5e')](_0x187394[_0xeb3d('0x5f')]);}})[_0xeb3d('0x23')](respondWithResult(_0x183815,null))[_0xeb3d('0x57')](handleError(_0x183815,null));};exports['getAnswers']=function(_0x822857,_0x45a027,_0x51e54a){var _0x3170d5={'raw':![],'where':{}};var _0x578265={};var _0x214711={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xeb3d('0x67')]({'where':{'id':_0x822857[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x45a027,null))['then'](function(_0x3ee162){if(_0x3ee162){_0x578265[_0xeb3d('0x44')]=_[_0xeb3d('0x47')](db[_0xeb3d('0x6e')]['rawAttributes']);_0x578265[_0xeb3d('0x46')]=_[_0xeb3d('0x47')](_0x822857[_0xeb3d('0x46')]);_0x578265['filters']=_['intersection'](_0x578265['model'],_0x578265[_0xeb3d('0x46')]);_0x3170d5[_0xeb3d('0x4a')]=_[_0xeb3d('0x49')](_0x578265[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x822857['query'][_0xeb3d('0x4b')]));_0x3170d5[_0xeb3d('0x4a')]=_0x3170d5[_0xeb3d('0x4a')][_0xeb3d('0x5b')]?_0x3170d5[_0xeb3d('0x4a')]:_0x578265[_0xeb3d('0x44')];if(!_0x822857[_0xeb3d('0x46')]['hasOwnProperty']('nolimit')){_0x3170d5[_0xeb3d('0x2f')]=qs[_0xeb3d('0x2f')](_0x822857['query']['limit']);_0x3170d5[_0xeb3d('0x31')]=qs[_0xeb3d('0x31')](_0x822857['query'][_0xeb3d('0x31')]);}_0x3170d5[_0xeb3d('0x4e')]=qs[_0xeb3d('0x4f')](_0x822857['query'][_0xeb3d('0x4f')]);_0x3170d5[_0xeb3d('0x50')]=qs[_0xeb3d('0x48')](_[_0xeb3d('0x51')](_0x822857[_0xeb3d('0x46')],_0x578265[_0xeb3d('0x48')]));_0x3170d5['where'][_0xeb3d('0x69')]=_0x3ee162['id'];if(_0x822857[_0xeb3d('0x46')][_0xeb3d('0x6a')]){_0x3170d5[_0xeb3d('0x50')]=_[_0xeb3d('0x52')](_0x3170d5[_0xeb3d('0x50')],{'$or':_[_0xeb3d('0x45')](_0x3170d5[_0xeb3d('0x4a')],function(_0x51e224){var _0x5e3f24={};_0x5e3f24[_0x51e224]={'$like':'%'+_0x822857['query'][_0xeb3d('0x6a')]+'%'};return _0x5e3f24;})});}_0x3170d5=_['merge']({},_0x3170d5,_0x822857['options']);return db[_0xeb3d('0x6e')][_0xeb3d('0x30')]({'where':_0x3170d5[_0xeb3d('0x50')]})[_0xeb3d('0x23')](function(_0x3d6578){_0x214711['count']=_0x3d6578;if(_0x822857[_0xeb3d('0x46')][_0xeb3d('0x54')]){_0x3170d5[_0xeb3d('0x5c')]=[{'all':!![]}];}return db[_0xeb3d('0x6e')][_0xeb3d('0x55')](_0x3170d5);})[_0xeb3d('0x23')](function(_0x31abc7){_0x214711['rows']=_0x31abc7;return _0x214711;});}})[_0xeb3d('0x23')](respondWithFilteredResult(_0x45a027,_0x3170d5))[_0xeb3d('0x57')](handleError(_0x45a027,null));};exports[_0xeb3d('0x6f')]=function(_0x4989fd,_0x226c1c,_0x54510e){return db[_0xeb3d('0x40')]['find']({'where':{'id':_0x4989fd[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x226c1c,null))[_0xeb3d('0x23')](function(_0x2e166d){if(_0x2e166d){return _0x2e166d[_0xeb3d('0x6f')](_0x4989fd['query'][_0xeb3d('0x6c')]);}})[_0xeb3d('0x23')](respondWithStatusCode(_0x226c1c,null))[_0xeb3d('0x57')](handleError(_0x226c1c,null));};exports[_0xeb3d('0x70')]=function(_0x3af147,_0x2688a6,_0xf4b56d){return db['WhatsappAccount'][_0xeb3d('0x63')]({'where':{'id':_0x3af147[_0xeb3d('0x59')]['id']}})['then'](handleEntityNotFound(_0x2688a6,null))[_0xeb3d('0x23')](function(_0x1c040f){if(_0x1c040f){return _0x1c040f[_0xeb3d('0x70')](_0x3af147[_0xeb3d('0x5f')][_0xeb3d('0x6c')],_[_0xeb3d('0x71')](_0x3af147[_0xeb3d('0x5f')],[_0xeb3d('0x6c'),'id'])||{})[_0xeb3d('0x72')](function(_0x4bce37){for(var _0x31b959=0x0;_0x31b959<_0x3af147[_0xeb3d('0x5f')]['ids'][_0xeb3d('0x5b')];_0x31b959+=0x1){socket[_0xeb3d('0x73')](_0xeb3d('0x74'),{'UserId':Number(_0x3af147[_0xeb3d('0x5f')][_0xeb3d('0x6c')][_0x31b959]),'WhatsappAccountId':Number(_0x3af147[_0xeb3d('0x59')]['id'])});}return _0x4bce37;});}})['then'](respondWithResult(_0x2688a6,null))[_0xeb3d('0x57')](handleError(_0x2688a6,null));};exports['removeAgents']=function(_0x4747aa,_0x331750,_0x44d7a0){return db[_0xeb3d('0x40')]['find']({'where':{'id':_0x4747aa[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x331750,null))[_0xeb3d('0x23')](function(_0x180b92){if(_0x180b92){return _0x180b92['removeAgents'](_0x4747aa[_0xeb3d('0x46')][_0xeb3d('0x6c')])[_0xeb3d('0x23')](function(){if(_['isArray'](_0x4747aa[_0xeb3d('0x46')][_0xeb3d('0x6c')])){for(var _0x261d8e=0x0;_0x261d8e<_0x4747aa[_0xeb3d('0x46')]['ids'][_0xeb3d('0x5b')];_0x261d8e+=0x1){socket[_0xeb3d('0x73')](_0xeb3d('0x75'),{'UserId':Number(_0x4747aa[_0xeb3d('0x46')][_0xeb3d('0x6c')][_0x261d8e]),'WhatsappAccountId':Number(_0x4747aa[_0xeb3d('0x59')]['id'])});}}else{socket[_0xeb3d('0x73')](_0xeb3d('0x75'),{'UserId':Number(_0x4747aa[_0xeb3d('0x46')][_0xeb3d('0x6c')]),'WhatsappAccountId':Number(_0x4747aa[_0xeb3d('0x59')]['id'])});}});}})[_0xeb3d('0x23')](respondWithStatusCode(_0x331750,null))[_0xeb3d('0x57')](handleError(_0x331750,null));};exports['getAgents']=function(_0x2cf8e9,_0x58b8f9,_0x3615c8){var _0x292e64={};var _0x24e9c8={};var _0xfe1ff3;var _0x58d9f4;return db[_0xeb3d('0x40')][_0xeb3d('0x67')]({'where':{'id':_0x2cf8e9[_0xeb3d('0x59')]['id']}})[_0xeb3d('0x23')](handleEntityNotFound(_0x58b8f9,null))[_0xeb3d('0x23')](function(_0xf47f41){if(_0xf47f41){_0xfe1ff3=_0xf47f41;_0x24e9c8[_0xeb3d('0x44')]=_[_0xeb3d('0x47')](db['User'][_0xeb3d('0x5a')]);_0x24e9c8[_0xeb3d('0x46')]=_[_0xeb3d('0x47')](_0x2cf8e9[_0xeb3d('0x46')]);_0x24e9c8['filters']=_[_0xeb3d('0x49')](_0x24e9c8[_0xeb3d('0x44')],_0x24e9c8['query']);_0x292e64['attributes']=_[_0xeb3d('0x49')](_0x24e9c8[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x2cf8e9['query'][_0xeb3d('0x4b')]));_0x292e64[_0xeb3d('0x4a')]=_0x292e64['attributes'][_0xeb3d('0x5b')]?_0x292e64[_0xeb3d('0x4a')]:_0x24e9c8[_0xeb3d('0x44')];_0x292e64[_0xeb3d('0x4e')]=qs[_0xeb3d('0x4f')](_0x2cf8e9[_0xeb3d('0x46')][_0xeb3d('0x4f')]);_0x292e64[_0xeb3d('0x50')]=qs[_0xeb3d('0x48')](_[_0xeb3d('0x51')](_0x2cf8e9['query'],_0x24e9c8[_0xeb3d('0x48')]));if(_0x2cf8e9[_0xeb3d('0x46')]['filter']){_0x292e64['where']=_[_0xeb3d('0x52')](_0x292e64[_0xeb3d('0x50')],{'$or':_[_0xeb3d('0x45')](_0x292e64[_0xeb3d('0x4a')],function(_0x4e4f4c){var _0x3f8902={};_0x3f8902[_0x4e4f4c]={'$like':'%'+_0x2cf8e9[_0xeb3d('0x46')][_0xeb3d('0x6a')]+'%'};return _0x3f8902;})});}_0x292e64=_[_0xeb3d('0x52')]({},_0x292e64,_0x2cf8e9[_0xeb3d('0x5d')]);return _0xfe1ff3['getAgents'](_0x292e64);}})[_0xeb3d('0x23')](function(_0x290563){if(_0x290563){_0x58d9f4=_0x290563[_0xeb3d('0x5b')];if(!_0x2cf8e9[_0xeb3d('0x46')][_0xeb3d('0x4c')]('nolimit')){_0x292e64[_0xeb3d('0x2f')]=qs[_0xeb3d('0x2f')](_0x2cf8e9['query']['limit']);_0x292e64[_0xeb3d('0x31')]=qs['offset'](_0x2cf8e9[_0xeb3d('0x46')][_0xeb3d('0x31')]);}return _0xfe1ff3[_0xeb3d('0x76')](_0x292e64);}})[_0xeb3d('0x23')](function(_0x1d7f90){if(_0x1d7f90){return _0x1d7f90?{'count':_0x58d9f4,'rows':_0x1d7f90}:null;}})['then'](respondWithResult(_0x58b8f9,null))[_0xeb3d('0x57')](handleError(_0x58b8f9,null));};exports['addApplications']=function(_0x4d766e,_0x5e3347){var _0x15d512=_0x4d766e[_0xeb3d('0x59')]['id'];var _0x1175d4=_0x4d766e[_0xeb3d('0x5f')];var _0x2f9b3a=0xc8;var _0x3ec04e=null;return db['sequelize'][_0xeb3d('0x77')]({'isolationLevel':db[_0xeb3d('0x78')]['Transaction']['ISOLATION_LEVELS'][_0xeb3d('0x79')]},function(_0x393448){return db[_0xeb3d('0x40')]['findOne']({'where':{'id':_0x15d512},'transaction':_0x393448})['then'](function(_0x5799c5){if(_0x5799c5){return db[_0xeb3d('0x7a')][_0xeb3d('0x39')]({'where':{'WhatsappAccountId':_0x15d512},'transaction':_0x393448})['then'](function(){var _0x2cecb8=_[_0xeb3d('0x45')](_0x1175d4,function(_0x4c2320){_0x4c2320['WhatsappAccountId']=_0x15d512;return _0x4c2320;});return db[_0xeb3d('0x7a')][_0xeb3d('0x7b')](_0x2cecb8,{'transaction':_0x393448});});}else{_0x2f9b3a=0x194;_0x3ec04e=[];}});})[_0xeb3d('0x23')](function(){if(_0x2f9b3a!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x15d512},'order':_0xeb3d('0x7c')})['then'](function(_0x38aa9b){_0x3ec04e=_0x38aa9b;});}})[_0xeb3d('0x57')](function(_0x273764){_0x2f9b3a=0x1f4;logger[_0xeb3d('0x29')](_0x273764['stack']);if(_0x273764['name']){delete _0x273764['name'];}_0x3ec04e=_0x273764;})[_0xeb3d('0x7d')](function(){if(_0x3ec04e===null){_0x5e3347[_0xeb3d('0x3a')](_0x2f9b3a);}else{if(_0x2f9b3a===0x1f4){_0x5e3347[_0xeb3d('0x2c')](_0x2f9b3a)[_0xeb3d('0x7e')](_0x3ec04e);}else{_0x5e3347[_0xeb3d('0x2c')](_0x2f9b3a)['json'](_0x3ec04e);}}});};exports[_0xeb3d('0x7f')]=function(_0x3bf3a3,_0x59e3dc,_0x1ffbfa){var _0x20d972={};var _0x30946b={};var _0x314136;var _0x334bdf;return db['WhatsappAccount'][_0xeb3d('0x67')]({'where':{'id':_0x3bf3a3[_0xeb3d('0x59')]['id']}})['then'](handleEntityNotFound(_0x59e3dc,null))[_0xeb3d('0x23')](function(_0x57f798){if(_0x57f798){_0x314136=_0x57f798;_0x30946b[_0xeb3d('0x44')]=_[_0xeb3d('0x47')](db[_0xeb3d('0x7a')][_0xeb3d('0x5a')]);_0x30946b[_0xeb3d('0x46')]=_[_0xeb3d('0x47')](_0x3bf3a3['query']);_0x30946b[_0xeb3d('0x48')]=_[_0xeb3d('0x49')](_0x30946b[_0xeb3d('0x44')],_0x30946b[_0xeb3d('0x46')]);_0x20d972[_0xeb3d('0x4a')]=_[_0xeb3d('0x49')](_0x30946b[_0xeb3d('0x44')],qs[_0xeb3d('0x4b')](_0x3bf3a3[_0xeb3d('0x46')]['fields']));_0x20d972['attributes']=_0x20d972['attributes'][_0xeb3d('0x5b')]?_0x20d972[_0xeb3d('0x4a')]:_0x30946b[_0xeb3d('0x44')];_0x20d972['order']=qs[_0xeb3d('0x4f')](_0x3bf3a3[_0xeb3d('0x46')][_0xeb3d('0x4f')]);_0x20d972[_0xeb3d('0x50')]=qs[_0xeb3d('0x48')](_[_0xeb3d('0x51')](_0x3bf3a3[_0xeb3d('0x46')],_0x30946b[_0xeb3d('0x48')]));if(_0x3bf3a3[_0xeb3d('0x46')]['filter']){_0x20d972[_0xeb3d('0x50')]=_[_0xeb3d('0x52')](_0x20d972[_0xeb3d('0x50')],{'$or':_[_0xeb3d('0x45')](_0x20d972[_0xeb3d('0x4a')],function(_0x487afd){var _0x20ebbb={};_0x20ebbb[_0x487afd]={'$like':'%'+_0x3bf3a3['query'][_0xeb3d('0x6a')]+'%'};return _0x20ebbb;})});}_0x20d972=_['merge']({},_0x20d972,_0x3bf3a3[_0xeb3d('0x5d')]);return _0x314136['getApplications'](_0x20d972);}})[_0xeb3d('0x23')](function(_0x4b6460){if(_0x4b6460){_0x334bdf=_0x4b6460[_0xeb3d('0x5b')];if(!_0x3bf3a3[_0xeb3d('0x46')][_0xeb3d('0x4c')](_0xeb3d('0x4d'))){_0x20d972['limit']=qs[_0xeb3d('0x2f')](_0x3bf3a3[_0xeb3d('0x46')][_0xeb3d('0x2f')]);_0x20d972[_0xeb3d('0x31')]=qs[_0xeb3d('0x31')](_0x3bf3a3[_0xeb3d('0x46')][_0xeb3d('0x31')]);}return _0x314136['getApplications'](_0x20d972);}})[_0xeb3d('0x23')](function(_0x1edb59){if(_0x1edb59){return _0x1edb59?{'count':_0x334bdf,'rows':_0x1edb59}:null;}})[_0xeb3d('0x23')](respondWithResult(_0x59e3dc,null))[_0xeb3d('0x57')](handleError(_0x59e3dc,null));};exports[_0xeb3d('0x80')]=function(_0xd61e51,_0x4c7ce4,_0x3142b9){var _0x3454f2={'channel':'whatsapp'};var _0x2d390c=[];var _0x17818f=[];var _0x27385e={};return db[_0xeb3d('0x40')]['find']({'where':{'id':_0xd61e51['params']['id']},'include':[{'model':db[_0xeb3d('0x7a')],'as':'Applications'}]})[_0xeb3d('0x23')](handleEntityNotFound(_0x4c7ce4,null))[_0xeb3d('0x23')](function(_0x1af083){_0x3454f2[_0xeb3d('0x81')]=_0x1af083;if(_0x3454f2[_0xeb3d('0x81')]&&_0x3454f2[_0xeb3d('0x81')]['type']===_0xeb3d('0x82')&&_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x83')]){if(_0xd61e51['body'][_0xeb3d('0x83')][_0xeb3d('0x5b')]===0x0)return;if(_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x83')][0x0][_0xeb3d('0x84')]!==_0xeb3d('0x85'))return;return db[_0xeb3d('0x86')][_0xeb3d('0x36')]({'read':!![],'readAt':_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x83')][0x0][_0xeb3d('0x87')]},{'where':{'messageId':_0xd61e51[_0xeb3d('0x5f')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0xeb3d('0x23')](function(_0x40e1ec){return _0x4c7ce4[_0xeb3d('0x2c')](0xc8)['json'](_0x40e1ec);});}_0x3454f2[_0xeb3d('0x88')]=_[_0xeb3d('0x89')](_0x1af083['Applications'],['priority'],[_0xeb3d('0x8a')]);if(_0x3454f2['account'][_0xeb3d('0x8b')]){delete _0x3454f2[_0xeb3d('0x81')][_0xeb3d('0x8b')];}return db[_0xeb3d('0x8c')][_0xeb3d('0x66')]()[_0xeb3d('0x23')](function(_0x207ece){if(!_0x207ece){throw new db[(_0xeb3d('0x8d'))][(_0xeb3d('0x8e'))]('no\x20available\x20attributes');}_0x2d390c=_[_0xeb3d('0x8f')](_[_0xeb3d('0x47')](_0x207ece),[_0xeb3d('0x90'),'updatedAt']);_0x17818f=_['difference'](_[_0xeb3d('0x47')](_0x207ece),[_0xeb3d('0x90'),_0xeb3d('0x91'),_0xeb3d('0x92'),_0xeb3d('0x93')]);_0x3454f2['body']={'mapKey':_0xeb3d('0x94')};if(_0x3454f2[_0xeb3d('0x81')]&&_0x3454f2[_0xeb3d('0x81')]['type']===_0xeb3d('0x95')){_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x96')]=_0xd61e51[_0xeb3d('0x5f')]['From'][_0xeb3d('0x97')](_0xeb3d('0x98'),'');_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x5f')]=_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x99')];_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x9a')]=_0xd61e51[_0xeb3d('0x5f')]['MessageSid'];}if(_0x3454f2[_0xeb3d('0x81')]&&_0x3454f2['account'][_0xeb3d('0x42')]===_0xeb3d('0x82')){_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x96')]=_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x9b')][0x0]['from'];_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x5f')]=_0xd61e51['body'][_0xeb3d('0x9b')][0x0][_0xeb3d('0x2b')][_0xeb3d('0x5f')];_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x9a')]=_0xd61e51[_0xeb3d('0x5f')][_0xeb3d('0x9b')][0x0][_0xeb3d('0x9c')];}if(_0x3454f2[_0xeb3d('0x5f')]['id']){delete _0x3454f2['body']['id'];}if(_['isNil'](_0x3454f2['body']['from'])){throw new db[(_0xeb3d('0x8d'))][(_0xeb3d('0x8e'))](_0xeb3d('0x9d'));}if(_[_0xeb3d('0x9e')](_0x3454f2['body'][_0xeb3d('0x5f')])||_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x5f')]===''){throw new db[(_0xeb3d('0x8d'))][(_0xeb3d('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeb3d('0x9e')](_0x3454f2['body'][_0xeb3d('0x9f')])){throw new db[(_0xeb3d('0x8d'))][(_0xeb3d('0x8e'))](_0xeb3d('0xa0')+_0x17818f);}if(!_['includes'](_0x17818f,_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x9f')])){throw new db[(_0xeb3d('0x8d'))]['ValidationError'](_0xeb3d('0xa1')+_0x17818f);}_0x27385e[_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x9f')]]=_0x3454f2[_0xeb3d('0x5f')]['from'];return db[_0xeb3d('0xa2')][_0xeb3d('0x63')]({'where':{'id':_0x3454f2['account']['ListId']},'include':[{'model':db[_0xeb3d('0x8c')],'as':_0xeb3d('0xa3'),'where':_0x27385e,'limit':0x1,'order':[[_0xeb3d('0x91'),_0xeb3d('0xa4')]]}]});})[_0xeb3d('0x23')](handleEntityNotFound(_0x4c7ce4,null))[_0xeb3d('0x23')](function(_0x2f6fb8){if(_0x2f6fb8){_0x3454f2[_0xeb3d('0xa5')]=_[_0xeb3d('0x71')](_0x2f6fb8,[_0xeb3d('0xa3')]);if(_0x2f6fb8['Contacts']['length']){return _0x2f6fb8[_0xeb3d('0xa3')][0x0];}var _0x5605dc=_['defaults'](_0x3454f2[_0xeb3d('0x5f')],{'firstName':_0x3454f2[_0xeb3d('0x5f')]['from'],'ListId':_0x2f6fb8['id']});_0x5605dc[_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x9f')]]=_0x3454f2[_0xeb3d('0x5f')]['from'];return db[_0xeb3d('0x8c')]['create'](_0x5605dc,{'fields':_0x2d390c,'raw':!![]});}})['then'](handleEntityNotFound(_0x4c7ce4,null))[_0xeb3d('0x23')](function(_0xfac7cd){if(_0xfac7cd){_0x3454f2[_0xeb3d('0xa6')]=_0xfac7cd;var _0x28ac4d={'ContactId':_0xfac7cd['id'],'phone':_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x96')],'WhatsappAccountId':_0xd61e51[_0xeb3d('0x59')]['id']};var _0x5a946a={'ContactId':_0xfac7cd['id'],'WhatsappAccountId':_0xd61e51[_0xeb3d('0x59')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xeb3d('0x63')]({'where':_0x5a946a})[_0xeb3d('0x23')](function(_0x1bee21){if(_0x1bee21){return[_0x1bee21,![]];}return db[_0xeb3d('0xa7')]['create'](_0x28ac4d)['then'](function(_0x53e75f){return[_0x53e75f,!![]];});});}})[_0xeb3d('0x72')](function(_0x55a3c1,_0xec2144){_0x3454f2[_0xeb3d('0xa8')]=_0x55a3c1[_0xeb3d('0x61')]({'plain':!![]});_0x3454f2[_0xeb3d('0xa8')][_0xeb3d('0xa9')]=![];if(_0xec2144){if(_0x3454f2['account'][_0xeb3d('0xaa')]){_0x3454f2[_0xeb3d('0x88')][_0xeb3d('0xab')]({'id':0x0,'priority':_0x3454f2['applications'][_0xeb3d('0x5b')]+0x1,'app':_0xeb3d('0xac'),'appdata':_0xeb3d('0xad'),'interval':_0xeb3d('0xae')});}_0x3454f2[_0xeb3d('0xa8')]['created']=!![];}return db[_0xeb3d('0x86')][_0xeb3d('0x5e')]({'phone':_0x3454f2['body'][_0xeb3d('0x96')],'messageId':_0x3454f2[_0xeb3d('0x5f')]['messageId'],'body':_0x3454f2[_0xeb3d('0x5f')][_0xeb3d('0x5f')],'WhatsappAccountId':_0xd61e51['params']['id'],'WhatsappInteractionId':_0x55a3c1['id'],'direction':'in','ContactId':_0x55a3c1[_0xeb3d('0xaf')],'AttachmentId':_0x3454f2[_0xeb3d('0x5f')]['AttachmentId']});})[_0xeb3d('0x23')](function(_0x58f87b){_0x3454f2[_0xeb3d('0x2b')]=_0x58f87b;if(_0x3454f2[_0xeb3d('0xa8')][_0xeb3d('0xb0')]){return db['User'][_0xeb3d('0x63')]({'attributes':['id',_0xeb3d('0x3c')],'where':{'id':_0x3454f2[_0xeb3d('0xa8')][_0xeb3d('0xb0')]}})[_0xeb3d('0x23')](function(_0x44ff42){if(_0x44ff42){_0x3454f2[_0xeb3d('0x88')][_0xeb3d('0xb1')]({'id':0x0,'priority':0x0,'app':_0xeb3d('0xb2'),'appdata':_0x44ff42[_0xeb3d('0x3c')]+','+(_0x3454f2[_0xeb3d('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0xeb3d('0xae')});}return respondWithRpcPromise(_0xeb3d('0xb3'),_0xeb3d('0xb4'),_0x3454f2);});}return respondWithRpcPromise('Start',_0xeb3d('0xb4'),_0x3454f2);})[_0xeb3d('0x23')](function(_0x5a52f0){if(_0x5a52f0){var _0xfefd14=0xc8;var _0x14c109=_0xeb3d('0xb5');logger[_0xeb3d('0x24')](_0xeb3d('0x28'),_0x14c109,_0xfefd14,_0xeb3d('0xb6'));logger['debug'](_0xeb3d('0xb7'),_0x14c109,_0xfefd14,_0xeb3d('0xb6'),JSON[_0xeb3d('0xb8')](_0x5a52f0));if(_0x3454f2[_0xeb3d('0x81')][_0xeb3d('0x42')]===_0xeb3d('0x95')){return _0x4c7ce4[_0xeb3d('0x2c')](_0xfefd14)[_0xeb3d('0x32')](_0xeb3d('0xb9'),_0xeb3d('0xba'))[_0xeb3d('0x7e')]('\x0a');}else{return _0x4c7ce4['status'](_0xfefd14)[_0xeb3d('0x33')](_0x5a52f0);}}});})[_0xeb3d('0x57')](handleError(_0x4c7ce4,null));};exports[_0xeb3d('0x7e')]=function(_0x1b6e6e,_0x5d11d4,_0x38a2aa){var _0x388584,_0x42ab59,_0x4ae350;if(_[_0xeb3d('0x9e')](_0x1b6e6e['body'][_0xeb3d('0x5f')])||_0x1b6e6e[_0xeb3d('0x5f')]['body']===''){throw new db[(_0xeb3d('0x8d'))][(_0xeb3d('0x8e'))](_0xeb3d('0xbb'));}if(_['isNil'](_0x1b6e6e['body']['to'])){throw new db['Sequelize'][(_0xeb3d('0x8e'))](_0xeb3d('0xbc'));}_0x388584=_0x1b6e6e[_0xeb3d('0x5f')]['to'];return db[_0xeb3d('0x40')][_0xeb3d('0x63')]({'where':{'id':_0x1b6e6e[_0xeb3d('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xeb3d('0x8c')],'as':_0xeb3d('0xa3'),'where':{'mobile':_0x388584},'limit':0x1,'order':[[_0xeb3d('0x91'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5d11d4,null))[_0xeb3d('0x23')](function(_0x1291eb){if(_0x1291eb&&_0x1291eb['List']){_0x42ab59=_0x1291eb[_0xeb3d('0x61')]({'plain':!![]});if(_0x42ab59[_0xeb3d('0xbd')]&&_0x42ab59[_0xeb3d('0xbd')][_0xeb3d('0xa3')]['length']){return _0x42ab59[_0xeb3d('0xbd')][_0xeb3d('0xa3')][0x0];}return db['CmContact']['create'](_[_0xeb3d('0x1a')](_0x1b6e6e[_0xeb3d('0x5f')],{'firstName':_0x388584,'mobile':_0x388584,'phone':_0x388584,'ListId':_0x42ab59[_0xeb3d('0x93')]}));}})[_0xeb3d('0x23')](handleEntityNotFound(_0x5d11d4,null))[_0xeb3d('0x23')](function(_0x195680){if(_0x195680){_0x4ae350=_0x195680;return db[_0xeb3d('0xa7')][_0xeb3d('0x63')]({'where':{'ContactId':_0x4ae350['id'],'closed':![],'WhatsappAccountId':_0x42ab59['id']}})['then'](function(_0x46e46e){if(_0x46e46e){return[_0x46e46e,![]];}return db[_0xeb3d('0xa7')][_0xeb3d('0x5e')]({'UserId':_0x1b6e6e[_0xeb3d('0x60')]['id'],'ContactId':_0x4ae350['id'],'WhatsappAccountId':_0x42ab59['id'],'phone':_0x388584,'firstMsgDirection':'out','Messages':[_[_0xeb3d('0x52')](_0x1b6e6e[_0xeb3d('0x5f')],{'read':![],'body':_0x1b6e6e[_0xeb3d('0x5f')][_0xeb3d('0x5f')],'phone':_0x388584,'WhatsappAccountId':_0x42ab59['id'],'UserId':_0x1b6e6e[_0xeb3d('0x60')]['id'],'ContactId':_0x4ae350['id']})]},{'include':[{'model':db[_0xeb3d('0x86')],'as':_0xeb3d('0xbe')}]})[_0xeb3d('0x23')](function(_0x50ce2e){return[_0x50ce2e,!![]];});});}})['spread'](function(_0x2d7f26,_0x388feb){if(_0x388feb){return _0x2d7f26;}return db[_0xeb3d('0x86')][_0xeb3d('0x5e')](_[_0xeb3d('0x52')](_0x1b6e6e[_0xeb3d('0x5f')],{'read':![],'body':_0x1b6e6e['body']['body'],'phone':_0x388584,'WhatsappAccountId':_0x42ab59['id'],'WhatsappInteractionId':_0x2d7f26['id'],'UserId':_0x1b6e6e[_0xeb3d('0x60')]['id'],'ContactId':_0x4ae350['id']}))[_0xeb3d('0x23')](function(_0x283bbe){_0x2d7f26[_0xeb3d('0xbf')]['Messages']=[];_0x2d7f26[_0xeb3d('0xbf')]['Messages']['push'](_0x283bbe[_0xeb3d('0xbf')]);return _0x2d7f26;});})[_0xeb3d('0x23')](respondWithResult(_0x5d11d4,null))[_0xeb3d('0x57')](handleError(_0x5d11d4,null));}; \ No newline at end of file +var _0x5f82=['socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','http','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','WhatsappAccount','includeAll','include','findAll','rows','show','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','Sequelize','difference','updatedAt','ListId','mobile','twilio','from','replace','whatsapp:','messageId','MessageSid','sinch','notifications','ValidationError','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','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost'];(function(_0x7e83fd,_0x214bf4){var _0x4d7a57=function(_0xa221ee){while(--_0xa221ee){_0x7e83fd['push'](_0x7e83fd['shift']());}};_0x4d7a57(++_0x214bf4);}(_0x5f82,0x171));var _0x25f8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x5f82[_0x4dc7b9];return _0x3ab114;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25f8('0x0'));var zipdir=require(_0x25f8('0x1'));var jsonpatch=require(_0x25f8('0x2'));var rp=require('request-promise');var moment=require(_0x25f8('0x3'));var BPromise=require(_0x25f8('0x4'));var Mustache=require(_0x25f8('0x5'));var util=require(_0x25f8('0x6'));var path=require(_0x25f8('0x7'));var sox=require(_0x25f8('0x8'));var csv=require(_0x25f8('0x9'));var ejs=require(_0x25f8('0xa'));var fs=require('fs');var fs_extra=require(_0x25f8('0xb'));var _=require(_0x25f8('0xc'));var squel=require(_0x25f8('0xd'));var crypto=require('crypto');var jsforce=require(_0x25f8('0xe'));var deskjs=require(_0x25f8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x25f8('0x10'));var Papa=require('papaparse');var Redis=require(_0x25f8('0x11'));var authService=require(_0x25f8('0x12'));var qs=require(_0x25f8('0x13'));var as=require(_0x25f8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25f8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x25f8('0x16'));var licenseUtil=require(_0x25f8('0x17'));var db=require(_0x25f8('0x18'))['db'];config[_0x25f8('0x19')]=_['defaults'](config['redis'],{'host':_0x25f8('0x1a'),'port':0x18eb});var socket=require(_0x25f8('0x1b'))(new Redis(config['redis']));require(_0x25f8('0x1c'))[_0x25f8('0x1d')](socket);var jayson=require(_0x25f8('0x1e'));var client=jayson['client'][_0x25f8('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x5ddee5,_0x115e9a,_0x360f35,_0x325f25){return new BPromise(function(_0x577651,_0xfc27cf){var _0x3f640e=_0x325f25||client;return _0x3f640e[_0x25f8('0x20')](_0x5ddee5,_0x360f35)[_0x25f8('0x21')](function(_0x5300f9){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x115e9a,'request\x20sent');logger[_0x25f8('0x22')](_0x25f8('0x23'),_0x115e9a,_0x25f8('0x24'),JSON['stringify'](_0x5300f9));if(_0x5300f9['error']){if(_0x5300f9[_0x25f8('0x25')]['code']===0x1f4){logger['error'](_0x25f8('0x26'),_0x115e9a,_0x5300f9[_0x25f8('0x25')]['message']);return _0xfc27cf(_0x5300f9[_0x25f8('0x25')][_0x25f8('0x27')]);}logger[_0x25f8('0x25')](_0x25f8('0x26'),_0x115e9a,_0x5300f9[_0x25f8('0x25')][_0x25f8('0x27')]);return _0x577651(_0x5300f9['error'][_0x25f8('0x27')]);}else{logger[_0x25f8('0x28')](_0x25f8('0x26'),_0x115e9a,_0x25f8('0x24'));_0x577651(_0x5300f9['result']['message']);}})[_0x25f8('0x29')](function(_0x5029aa){logger[_0x25f8('0x25')](_0x25f8('0x26'),_0x115e9a,_0x5029aa);_0xfc27cf(_0x5029aa);});});}function respondWithStatusCode(_0x2ad7d2,_0x5b6a76){_0x5b6a76=_0x5b6a76||0xcc;return function(_0x256403){if(_0x256403){return _0x2ad7d2[_0x25f8('0x2a')](_0x5b6a76);}return _0x2ad7d2[_0x25f8('0x2b')](_0x5b6a76)[_0x25f8('0x2c')]();};}function respondWithResult(_0x59311e,_0x2a86d0){_0x2a86d0=_0x2a86d0||0xc8;return function(_0x3442da){if(_0x3442da){return _0x59311e[_0x25f8('0x2b')](_0x2a86d0)['json'](_0x3442da);}};}function respondWithFilteredResult(_0x5c22c9,_0x1164fc){return function(_0x3ee553){if(_0x3ee553){var _0x54746e=typeof _0x1164fc[_0x25f8('0x2d')]===_0x25f8('0x2e')&&typeof _0x1164fc['limit']===_0x25f8('0x2e');var _0x2278e4=_0x3ee553['count'];var _0x281640=_0x54746e?0x0:_0x1164fc[_0x25f8('0x2d')];var _0x3644ef=_0x54746e?_0x3ee553[_0x25f8('0x2f')]:_0x1164fc[_0x25f8('0x2d')]+_0x1164fc['limit'];var _0x34dbeb;if(_0x3644ef>=_0x2278e4){_0x3644ef=_0x2278e4;_0x34dbeb=0xc8;}else{_0x34dbeb=0xce;}_0x5c22c9[_0x25f8('0x2b')](_0x34dbeb);return _0x5c22c9[_0x25f8('0x30')](_0x25f8('0x31'),_0x281640+'-'+_0x3644ef+'/'+_0x2278e4)[_0x25f8('0x32')](_0x3ee553);}return null;};}function patchUpdates(_0x3f9fb5){return function(_0x9a5ba8){try{jsonpatch[_0x25f8('0x33')](_0x9a5ba8,_0x3f9fb5,!![]);}catch(_0x38e1b8){return BPromise[_0x25f8('0x34')](_0x38e1b8);}return _0x9a5ba8[_0x25f8('0x35')]();};}function saveUpdates(_0x3c454c,_0x31ec3a){return function(_0x5da15c){if(_0x5da15c){return _0x5da15c[_0x25f8('0x36')](_0x3c454c)[_0x25f8('0x21')](function(_0x3dbb57){return _0x3dbb57;});}return null;};}function removeEntity(_0x4addf8,_0x4a18a6){return function(_0x4725c5){if(_0x4725c5){return _0x4725c5[_0x25f8('0x37')]()['then'](function(){var _0x4f0f6c=_0x4725c5['get']({'plain':!![]});var _0x13302b=_0x25f8('0x38');return db[_0x25f8('0x39')][_0x25f8('0x37')]({'where':{'type':_0x13302b,'resourceId':_0x4f0f6c['id']}})['then'](function(){return _0x4725c5;});})[_0x25f8('0x21')](function(){_0x4addf8['status'](0xcc)[_0x25f8('0x2c')]();});}};}function handleEntityNotFound(_0x20e72a,_0x159723){return function(_0xb64db){if(!_0xb64db){_0x20e72a['sendStatus'](0x194);}return _0xb64db;};}function handleError(_0x1c36cc,_0x3bbc4d){_0x3bbc4d=_0x3bbc4d||0x1f4;return function(_0x2c1685){logger[_0x25f8('0x25')](_0x2c1685[_0x25f8('0x3a')]);if(_0x2c1685['name']){delete _0x2c1685[_0x25f8('0x3b')];}_0x1c36cc[_0x25f8('0x2b')](_0x3bbc4d)['send'](_0x2c1685);};}exports['index']=function(_0x1a187e,_0x49fc35){var _0xd01400={'include':[{'model':db[_0x25f8('0x3c')],'as':_0x25f8('0x3d')}]},_0x269152={},_0x16e6f6={'count':0x0,'rows':[]};var _0x32832a=_[_0x25f8('0x3e')](db['WhatsappAccount']['rawAttributes'],function(_0x4bf117){return{'name':_0x4bf117[_0x25f8('0x3f')],'type':_0x4bf117['type'][_0x25f8('0x40')]};});_0x269152['model']=_['map'](_0x32832a,_0x25f8('0x3b'));_0x269152['query']=_[_0x25f8('0x41')](_0x1a187e['query']);_0x269152[_0x25f8('0x42')]=_[_0x25f8('0x43')](_0x269152[_0x25f8('0x44')],_0x269152[_0x25f8('0x45')]);_0xd01400[_0x25f8('0x46')]=_[_0x25f8('0x43')](_0x269152['model'],qs[_0x25f8('0x47')](_0x1a187e[_0x25f8('0x45')][_0x25f8('0x47')]));_0xd01400[_0x25f8('0x46')]=_0xd01400[_0x25f8('0x46')][_0x25f8('0x48')]?_0xd01400[_0x25f8('0x46')]:_0x269152['model'];if(!_0x1a187e[_0x25f8('0x45')][_0x25f8('0x49')](_0x25f8('0x4a'))){_0xd01400[_0x25f8('0x4b')]=qs[_0x25f8('0x4b')](_0x1a187e[_0x25f8('0x45')][_0x25f8('0x4b')]);_0xd01400[_0x25f8('0x2d')]=qs[_0x25f8('0x2d')](_0x1a187e[_0x25f8('0x45')][_0x25f8('0x2d')]);}_0xd01400[_0x25f8('0x4c')]=qs[_0x25f8('0x4d')](_0x1a187e[_0x25f8('0x45')][_0x25f8('0x4d')]);_0xd01400[_0x25f8('0x4e')]=qs[_0x25f8('0x42')](_[_0x25f8('0x4f')](_0x1a187e[_0x25f8('0x45')],_0x269152[_0x25f8('0x42')]),_0x32832a);if(_0x1a187e[_0x25f8('0x45')][_0x25f8('0x50')]){_0xd01400[_0x25f8('0x4e')]=_['merge'](_0xd01400['where'],{'$or':_['map'](_0x32832a,function(_0x4079d7){if(_0x4079d7[_0x25f8('0x51')]!==_0x25f8('0x52')){var _0x115780={};_0x115780[_0x4079d7[_0x25f8('0x3b')]]={'$like':'%'+_0x1a187e['query'][_0x25f8('0x50')]+'%'};return _0x115780;}})});}_0xd01400=_[_0x25f8('0x53')]({},_0xd01400,_0x1a187e[_0x25f8('0x54')]);var _0x590d75={'where':_0xd01400[_0x25f8('0x4e')]};return db[_0x25f8('0x55')][_0x25f8('0x2f')](_0x590d75)[_0x25f8('0x21')](function(_0xf4af2f){_0x16e6f6['count']=_0xf4af2f;if(_0x1a187e['query'][_0x25f8('0x56')]){_0xd01400[_0x25f8('0x57')]=[{'all':!![]}];}return db[_0x25f8('0x55')][_0x25f8('0x58')](_0xd01400);})[_0x25f8('0x21')](function(_0x1802f4){_0x16e6f6[_0x25f8('0x59')]=_0x1802f4;return _0x16e6f6;})[_0x25f8('0x21')](respondWithFilteredResult(_0x49fc35,_0xd01400))[_0x25f8('0x29')](handleError(_0x49fc35,null));};exports[_0x25f8('0x5a')]=function(_0x22287d,_0xec91ba){var _0x1f10b0={'raw':![],'where':{'id':_0x22287d['params']['id']},'include':[{'model':db[_0x25f8('0x3c')],'as':_0x25f8('0x3d')}]},_0x33626d={};_0x33626d[_0x25f8('0x44')]=_[_0x25f8('0x41')](db['WhatsappAccount'][_0x25f8('0x5b')]);_0x33626d[_0x25f8('0x45')]=_[_0x25f8('0x41')](_0x22287d['query']);_0x33626d['filters']=_[_0x25f8('0x43')](_0x33626d['model'],_0x33626d['query']);_0x1f10b0[_0x25f8('0x46')]=_[_0x25f8('0x43')](_0x33626d['model'],qs['fields'](_0x22287d[_0x25f8('0x45')][_0x25f8('0x47')]));_0x1f10b0[_0x25f8('0x46')]=_0x1f10b0['attributes'][_0x25f8('0x48')]?_0x1f10b0[_0x25f8('0x46')]:_0x33626d[_0x25f8('0x44')];if(_0x22287d[_0x25f8('0x45')][_0x25f8('0x56')]){_0x1f10b0[_0x25f8('0x57')]=[{'all':!![]}];}_0x1f10b0=_[_0x25f8('0x53')]({},_0x1f10b0,_0x22287d[_0x25f8('0x54')]);return db[_0x25f8('0x55')][_0x25f8('0x5c')](_0x1f10b0)[_0x25f8('0x21')](handleEntityNotFound(_0xec91ba,null))[_0x25f8('0x21')](respondWithResult(_0xec91ba,null))[_0x25f8('0x29')](handleError(_0xec91ba,null));};exports['create']=function(_0x57c729,_0x3e7eaa){return db[_0x25f8('0x55')][_0x25f8('0x5d')](_0x57c729['body'],{})[_0x25f8('0x21')](function(_0x33cef6){var _0x521a7e=_0x57c729[_0x25f8('0x5e')][_0x25f8('0x5f')]({'plain':!![]});if(!_0x521a7e)throw new Error(_0x25f8('0x60'));if(_0x521a7e[_0x25f8('0x61')]===_0x25f8('0x5e')){var _0x452794=_0x33cef6['get']({'plain':!![]});var _0x5a5148=_0x25f8('0x38');return db['UserProfileSection'][_0x25f8('0x5c')]({'where':{'name':_0x5a5148,'userProfileId':_0x521a7e['userProfileId']},'raw':!![]})[_0x25f8('0x21')](function(_0x5ab475){if(_0x5ab475&&_0x5ab475[_0x25f8('0x62')]===0x0){return db['UserProfileResource'][_0x25f8('0x5d')]({'name':_0x452794[_0x25f8('0x3b')],'resourceId':_0x452794['id'],'type':_0x5ab475[_0x25f8('0x3b')],'sectionId':_0x5ab475['id']},{})['then'](function(){return _0x33cef6;});}else{return _0x33cef6;}})[_0x25f8('0x29')](function(_0x139c8e){logger[_0x25f8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x139c8e);throw _0x139c8e;});}return _0x33cef6;})[_0x25f8('0x21')](respondWithResult(_0x3e7eaa,0xc9))['catch'](handleError(_0x3e7eaa,null));};exports['update']=function(_0x4e110e,_0x190933){if(_0x4e110e[_0x25f8('0x63')]['id']){delete _0x4e110e[_0x25f8('0x63')]['id'];}return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0x4e110e[_0x25f8('0x64')]['id']},'include':[{'model':db[_0x25f8('0x3c')],'as':_0x25f8('0x3d')}]})[_0x25f8('0x21')](handleEntityNotFound(_0x190933,null))[_0x25f8('0x21')](saveUpdates(_0x4e110e[_0x25f8('0x63')],null))[_0x25f8('0x21')](respondWithResult(_0x190933,null))['catch'](handleError(_0x190933,null));};exports[_0x25f8('0x37')]=function(_0x2b2c79,_0x1bce6a){return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0x2b2c79[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x1bce6a,null))['then'](removeEntity(_0x1bce6a,null))[_0x25f8('0x29')](handleError(_0x1bce6a,null));};exports[_0x25f8('0x65')]=function(_0x103f9a,_0x57226c){return db[_0x25f8('0x55')][_0x25f8('0x65')]()[_0x25f8('0x21')](respondWithResult(_0x57226c,null))[_0x25f8('0x29')](handleError(_0x57226c,null));};exports[_0x25f8('0x66')]=function(_0x285178,_0x2d3ffc,_0x105f53){if(_0x285178[_0x25f8('0x63')]['id']){delete _0x285178[_0x25f8('0x63')]['id'];}return db[_0x25f8('0x55')]['find']({'where':{'id':_0x285178[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x2d3ffc,null))[_0x25f8('0x21')](function(_0x48ce54){if(_0x48ce54){_0x285178[_0x25f8('0x63')][_0x25f8('0x67')]=_0x48ce54['id'];return db[_0x25f8('0x68')][_0x25f8('0x5d')](_0x285178['body']);}})[_0x25f8('0x21')](respondWithResult(_0x2d3ffc,null))['catch'](handleError(_0x2d3ffc,null));};exports[_0x25f8('0x69')]=function(_0x2240ea,_0x472c29,_0x12e35a){var _0x561b6e={'raw':![],'where':{}};var _0xea948={};var _0x313345={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x2240ea[_0x25f8('0x64')]['id']}})['then'](handleEntityNotFound(_0x472c29,null))['then'](function(_0x224d1d){if(_0x224d1d){_0xea948['model']=_['keys'](db[_0x25f8('0x68')][_0x25f8('0x5b')]);_0xea948['query']=_['keys'](_0x2240ea['query']);_0xea948[_0x25f8('0x42')]=_['intersection'](_0xea948[_0x25f8('0x44')],_0xea948[_0x25f8('0x45')]);_0x561b6e[_0x25f8('0x46')]=_[_0x25f8('0x43')](_0xea948['model'],qs['fields'](_0x2240ea[_0x25f8('0x45')][_0x25f8('0x47')]));_0x561b6e[_0x25f8('0x46')]=_0x561b6e[_0x25f8('0x46')][_0x25f8('0x48')]?_0x561b6e['attributes']:_0xea948[_0x25f8('0x44')];if(!_0x2240ea[_0x25f8('0x45')][_0x25f8('0x49')](_0x25f8('0x4a'))){_0x561b6e[_0x25f8('0x4b')]=qs['limit'](_0x2240ea[_0x25f8('0x45')][_0x25f8('0x4b')]);_0x561b6e['offset']=qs[_0x25f8('0x2d')](_0x2240ea[_0x25f8('0x45')][_0x25f8('0x2d')]);}_0x561b6e[_0x25f8('0x4c')]=qs[_0x25f8('0x4d')](_0x2240ea['query'][_0x25f8('0x4d')]);_0x561b6e[_0x25f8('0x4e')]=qs[_0x25f8('0x42')](_[_0x25f8('0x4f')](_0x2240ea[_0x25f8('0x45')],_0xea948[_0x25f8('0x42')]));_0x561b6e['where'][_0x25f8('0x67')]=_0x224d1d['id'];if(_0x2240ea[_0x25f8('0x45')][_0x25f8('0x50')]){_0x561b6e['where']=_[_0x25f8('0x53')](_0x561b6e[_0x25f8('0x4e')],{'$or':_[_0x25f8('0x3e')](_0x561b6e[_0x25f8('0x46')],function(_0x19d04f){var _0x40259e={};_0x40259e[_0x19d04f]={'$like':'%'+_0x2240ea[_0x25f8('0x45')][_0x25f8('0x50')]+'%'};return _0x40259e;})});}_0x561b6e=_[_0x25f8('0x53')]({},_0x561b6e,_0x2240ea['options']);return db[_0x25f8('0x68')][_0x25f8('0x2f')]({'where':_0x561b6e['where']})[_0x25f8('0x21')](function(_0x99ce04){_0x313345[_0x25f8('0x2f')]=_0x99ce04;if(_0x2240ea[_0x25f8('0x45')]['includeAll']){_0x561b6e[_0x25f8('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x25f8('0x58')](_0x561b6e);})[_0x25f8('0x21')](function(_0x2e3425){_0x313345[_0x25f8('0x59')]=_0x2e3425;return _0x313345;});}})[_0x25f8('0x21')](respondWithFilteredResult(_0x472c29,_0x561b6e))[_0x25f8('0x29')](handleError(_0x472c29,null));};exports[_0x25f8('0x6a')]=function(_0x324347,_0xee4479,_0x599ac3){return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0x324347[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0xee4479,null))[_0x25f8('0x21')](function(_0x517caa){if(_0x517caa){return _0x517caa[_0x25f8('0x6a')](_0x324347[_0x25f8('0x45')][_0x25f8('0x6b')]);}})[_0x25f8('0x21')](respondWithStatusCode(_0xee4479,null))[_0x25f8('0x29')](handleError(_0xee4479,null));};exports[_0x25f8('0x6c')]=function(_0x40a97f,_0x2c774f,_0x19c73c){if(_0x40a97f['body']['id']){delete _0x40a97f[_0x25f8('0x63')]['id'];}return db[_0x25f8('0x55')]['find']({'where':{'id':_0x40a97f[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x2c774f,null))[_0x25f8('0x21')](function(_0x315c29){if(_0x315c29){_0x40a97f[_0x25f8('0x63')]['WhatsappAccountId']=_0x315c29['id'];return db[_0x25f8('0x6d')][_0x25f8('0x5d')](_0x40a97f[_0x25f8('0x63')]);}})[_0x25f8('0x21')](respondWithResult(_0x2c774f,null))['catch'](handleError(_0x2c774f,null));};exports[_0x25f8('0x6e')]=function(_0x4306fe,_0x5740db,_0x1cc545){var _0x2a860e={'raw':![],'where':{}};var _0xa4d2de={};var _0x23caa3={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x25f8('0x6f')]({'where':{'id':_0x4306fe[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x5740db,null))[_0x25f8('0x21')](function(_0x56c1e2){if(_0x56c1e2){_0xa4d2de['model']=_[_0x25f8('0x41')](db['CannedAnswer'][_0x25f8('0x5b')]);_0xa4d2de[_0x25f8('0x45')]=_[_0x25f8('0x41')](_0x4306fe[_0x25f8('0x45')]);_0xa4d2de[_0x25f8('0x42')]=_['intersection'](_0xa4d2de[_0x25f8('0x44')],_0xa4d2de[_0x25f8('0x45')]);_0x2a860e[_0x25f8('0x46')]=_[_0x25f8('0x43')](_0xa4d2de[_0x25f8('0x44')],qs['fields'](_0x4306fe[_0x25f8('0x45')]['fields']));_0x2a860e[_0x25f8('0x46')]=_0x2a860e['attributes'][_0x25f8('0x48')]?_0x2a860e[_0x25f8('0x46')]:_0xa4d2de[_0x25f8('0x44')];if(!_0x4306fe[_0x25f8('0x45')][_0x25f8('0x49')](_0x25f8('0x4a'))){_0x2a860e[_0x25f8('0x4b')]=qs[_0x25f8('0x4b')](_0x4306fe[_0x25f8('0x45')]['limit']);_0x2a860e[_0x25f8('0x2d')]=qs[_0x25f8('0x2d')](_0x4306fe['query'][_0x25f8('0x2d')]);}_0x2a860e[_0x25f8('0x4c')]=qs['sort'](_0x4306fe[_0x25f8('0x45')][_0x25f8('0x4d')]);_0x2a860e[_0x25f8('0x4e')]=qs['filters'](_[_0x25f8('0x4f')](_0x4306fe['query'],_0xa4d2de[_0x25f8('0x42')]));_0x2a860e[_0x25f8('0x4e')]['WhatsappAccountId']=_0x56c1e2['id'];if(_0x4306fe[_0x25f8('0x45')][_0x25f8('0x50')]){_0x2a860e[_0x25f8('0x4e')]=_[_0x25f8('0x53')](_0x2a860e['where'],{'$or':_[_0x25f8('0x3e')](_0x2a860e['attributes'],function(_0x5c4e1f){var _0x346e59={};_0x346e59[_0x5c4e1f]={'$like':'%'+_0x4306fe['query'][_0x25f8('0x50')]+'%'};return _0x346e59;})});}_0x2a860e=_[_0x25f8('0x53')]({},_0x2a860e,_0x4306fe['options']);return db[_0x25f8('0x6d')][_0x25f8('0x2f')]({'where':_0x2a860e[_0x25f8('0x4e')]})[_0x25f8('0x21')](function(_0x46741b){_0x23caa3[_0x25f8('0x2f')]=_0x46741b;if(_0x4306fe[_0x25f8('0x45')][_0x25f8('0x56')]){_0x2a860e[_0x25f8('0x57')]=[{'all':!![]}];}return db[_0x25f8('0x6d')][_0x25f8('0x58')](_0x2a860e);})[_0x25f8('0x21')](function(_0x55d5df){_0x23caa3[_0x25f8('0x59')]=_0x55d5df;return _0x23caa3;});}})[_0x25f8('0x21')](respondWithFilteredResult(_0x5740db,_0x2a860e))['catch'](handleError(_0x5740db,null));};exports[_0x25f8('0x70')]=function(_0x364ffa,_0x2b84bb,_0x3e9e4a){return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0x364ffa[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x2b84bb,null))[_0x25f8('0x21')](function(_0x36b93f){if(_0x36b93f){return _0x36b93f[_0x25f8('0x70')](_0x364ffa['query'][_0x25f8('0x6b')]);}})[_0x25f8('0x21')](respondWithStatusCode(_0x2b84bb,null))[_0x25f8('0x29')](handleError(_0x2b84bb,null));};exports[_0x25f8('0x71')]=function(_0xc53f4,_0x18908b,_0x359be6){return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0xc53f4[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x18908b,null))[_0x25f8('0x21')](function(_0x54c52f){if(_0x54c52f){return _0x54c52f[_0x25f8('0x71')](_0xc53f4[_0x25f8('0x63')][_0x25f8('0x6b')],_[_0x25f8('0x72')](_0xc53f4[_0x25f8('0x63')],[_0x25f8('0x6b'),'id'])||{})[_0x25f8('0x73')](function(_0x4d3193){for(var _0x34dedd=0x0;_0x34dedd<_0xc53f4[_0x25f8('0x63')][_0x25f8('0x6b')]['length'];_0x34dedd+=0x1){socket['emit'](_0x25f8('0x74'),{'UserId':Number(_0xc53f4['body'][_0x25f8('0x6b')][_0x34dedd]),'WhatsappAccountId':Number(_0xc53f4['params']['id'])});}return _0x4d3193;});}})[_0x25f8('0x21')](respondWithResult(_0x18908b,null))[_0x25f8('0x29')](handleError(_0x18908b,null));};exports['removeAgents']=function(_0x5777d0,_0x3d9073,_0x1e261b){return db['WhatsappAccount'][_0x25f8('0x5c')]({'where':{'id':_0x5777d0[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x3d9073,null))['then'](function(_0xfcb2e0){if(_0xfcb2e0){return _0xfcb2e0['removeAgents'](_0x5777d0[_0x25f8('0x45')][_0x25f8('0x6b')])[_0x25f8('0x21')](function(){if(_[_0x25f8('0x75')](_0x5777d0[_0x25f8('0x45')][_0x25f8('0x6b')])){for(var _0x2328c7=0x0;_0x2328c7<_0x5777d0[_0x25f8('0x45')][_0x25f8('0x6b')][_0x25f8('0x48')];_0x2328c7+=0x1){socket[_0x25f8('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x5777d0[_0x25f8('0x45')][_0x25f8('0x6b')][_0x2328c7]),'WhatsappAccountId':Number(_0x5777d0[_0x25f8('0x64')]['id'])});}}else{socket[_0x25f8('0x76')](_0x25f8('0x77'),{'UserId':Number(_0x5777d0[_0x25f8('0x45')][_0x25f8('0x6b')]),'WhatsappAccountId':Number(_0x5777d0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3d9073,null))[_0x25f8('0x29')](handleError(_0x3d9073,null));};exports[_0x25f8('0x78')]=function(_0x781048,_0x33ee3d,_0x213023){var _0x18d39c={};var _0x5784fb={};var _0x2f900b;var _0x238607;return db[_0x25f8('0x55')][_0x25f8('0x6f')]({'where':{'id':_0x781048[_0x25f8('0x64')]['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x33ee3d,null))[_0x25f8('0x21')](function(_0x5dad41){if(_0x5dad41){_0x2f900b=_0x5dad41;_0x5784fb[_0x25f8('0x44')]=_['keys'](db[_0x25f8('0x79')][_0x25f8('0x5b')]);_0x5784fb[_0x25f8('0x45')]=_[_0x25f8('0x41')](_0x781048[_0x25f8('0x45')]);_0x5784fb[_0x25f8('0x42')]=_['intersection'](_0x5784fb[_0x25f8('0x44')],_0x5784fb[_0x25f8('0x45')]);_0x18d39c['attributes']=_[_0x25f8('0x43')](_0x5784fb[_0x25f8('0x44')],qs[_0x25f8('0x47')](_0x781048[_0x25f8('0x45')][_0x25f8('0x47')]));_0x18d39c[_0x25f8('0x46')]=_0x18d39c[_0x25f8('0x46')][_0x25f8('0x48')]?_0x18d39c[_0x25f8('0x46')]:_0x5784fb[_0x25f8('0x44')];_0x18d39c[_0x25f8('0x4c')]=qs['sort'](_0x781048[_0x25f8('0x45')][_0x25f8('0x4d')]);_0x18d39c[_0x25f8('0x4e')]=qs[_0x25f8('0x42')](_[_0x25f8('0x4f')](_0x781048[_0x25f8('0x45')],_0x5784fb[_0x25f8('0x42')]));if(_0x781048[_0x25f8('0x45')]['filter']){_0x18d39c[_0x25f8('0x4e')]=_['merge'](_0x18d39c[_0x25f8('0x4e')],{'$or':_[_0x25f8('0x3e')](_0x18d39c[_0x25f8('0x46')],function(_0x16c483){var _0x13dd97={};_0x13dd97[_0x16c483]={'$like':'%'+_0x781048['query'][_0x25f8('0x50')]+'%'};return _0x13dd97;})});}_0x18d39c=_['merge']({},_0x18d39c,_0x781048['options']);return _0x2f900b[_0x25f8('0x78')](_0x18d39c);}})[_0x25f8('0x21')](function(_0x5162c0){if(_0x5162c0){_0x238607=_0x5162c0[_0x25f8('0x48')];if(!_0x781048[_0x25f8('0x45')][_0x25f8('0x49')](_0x25f8('0x4a'))){_0x18d39c[_0x25f8('0x4b')]=qs[_0x25f8('0x4b')](_0x781048[_0x25f8('0x45')]['limit']);_0x18d39c['offset']=qs[_0x25f8('0x2d')](_0x781048['query'][_0x25f8('0x2d')]);}return _0x2f900b['getAgents'](_0x18d39c);}})[_0x25f8('0x21')](function(_0x5ad48f){if(_0x5ad48f){return _0x5ad48f?{'count':_0x238607,'rows':_0x5ad48f}:null;}})[_0x25f8('0x21')](respondWithResult(_0x33ee3d,null))[_0x25f8('0x29')](handleError(_0x33ee3d,null));};exports[_0x25f8('0x7a')]=function(_0x472abb,_0x4b44b5){var _0x1d2ebb=_0x472abb['params']['id'];var _0x5c0f7a=_0x472abb[_0x25f8('0x63')];var _0x100b7d=0xc8;var _0x1cd2f1=null;return db[_0x25f8('0x7b')][_0x25f8('0x7c')]({'isolationLevel':db[_0x25f8('0x7b')][_0x25f8('0x7d')][_0x25f8('0x7e')][_0x25f8('0x7f')]},function(_0x1e718b){return db[_0x25f8('0x55')][_0x25f8('0x6f')]({'where':{'id':_0x1d2ebb},'transaction':_0x1e718b})['then'](function(_0x180a09){if(_0x180a09){return db[_0x25f8('0x80')][_0x25f8('0x37')]({'where':{'WhatsappAccountId':_0x1d2ebb},'transaction':_0x1e718b})['then'](function(){var _0x3e5a92=_[_0x25f8('0x3e')](_0x5c0f7a,function(_0x40abc9){_0x40abc9[_0x25f8('0x67')]=_0x1d2ebb;return _0x40abc9;});return db['WhatsappApplication'][_0x25f8('0x81')](_0x3e5a92,{'transaction':_0x1e718b});});}else{_0x100b7d=0x194;_0x1cd2f1=[];}});})[_0x25f8('0x21')](function(){if(_0x100b7d!==0x194){return db[_0x25f8('0x80')][_0x25f8('0x82')]({'where':{'WhatsappAccountId':_0x1d2ebb},'order':_0x25f8('0x83')})[_0x25f8('0x21')](function(_0xc31dfa){_0x1cd2f1=_0xc31dfa;});}})[_0x25f8('0x29')](function(_0x577928){_0x100b7d=0x1f4;logger[_0x25f8('0x25')](_0x577928['stack']);if(_0x577928[_0x25f8('0x3b')]){delete _0x577928[_0x25f8('0x3b')];}_0x1cd2f1=_0x577928;})[_0x25f8('0x84')](function(){if(_0x1cd2f1===null){_0x4b44b5[_0x25f8('0x2a')](_0x100b7d);}else{if(_0x100b7d===0x1f4){_0x4b44b5['status'](_0x100b7d)[_0x25f8('0x85')](_0x1cd2f1);}else{_0x4b44b5[_0x25f8('0x2b')](_0x100b7d)[_0x25f8('0x32')](_0x1cd2f1);}}});};exports[_0x25f8('0x86')]=function(_0x29e2f1,_0x1c88c8,_0x2979a9){var _0x27031d={};var _0x2f2531={};var _0x3adee7;var _0x265eb3;return db[_0x25f8('0x55')][_0x25f8('0x6f')]({'where':{'id':_0x29e2f1['params']['id']}})[_0x25f8('0x21')](handleEntityNotFound(_0x1c88c8,null))[_0x25f8('0x21')](function(_0x416ad3){if(_0x416ad3){_0x3adee7=_0x416ad3;_0x2f2531['model']=_[_0x25f8('0x41')](db[_0x25f8('0x80')][_0x25f8('0x5b')]);_0x2f2531[_0x25f8('0x45')]=_[_0x25f8('0x41')](_0x29e2f1[_0x25f8('0x45')]);_0x2f2531[_0x25f8('0x42')]=_[_0x25f8('0x43')](_0x2f2531[_0x25f8('0x44')],_0x2f2531['query']);_0x27031d['attributes']=_[_0x25f8('0x43')](_0x2f2531[_0x25f8('0x44')],qs['fields'](_0x29e2f1[_0x25f8('0x45')]['fields']));_0x27031d[_0x25f8('0x46')]=_0x27031d[_0x25f8('0x46')][_0x25f8('0x48')]?_0x27031d[_0x25f8('0x46')]:_0x2f2531['model'];_0x27031d[_0x25f8('0x4c')]=qs[_0x25f8('0x4d')](_0x29e2f1['query'][_0x25f8('0x4d')]);_0x27031d['where']=qs[_0x25f8('0x42')](_['pick'](_0x29e2f1[_0x25f8('0x45')],_0x2f2531[_0x25f8('0x42')]));if(_0x29e2f1[_0x25f8('0x45')]['filter']){_0x27031d['where']=_[_0x25f8('0x53')](_0x27031d[_0x25f8('0x4e')],{'$or':_['map'](_0x27031d[_0x25f8('0x46')],function(_0x240a68){var _0x5adca0={};_0x5adca0[_0x240a68]={'$like':'%'+_0x29e2f1[_0x25f8('0x45')]['filter']+'%'};return _0x5adca0;})});}_0x27031d=_[_0x25f8('0x53')]({},_0x27031d,_0x29e2f1[_0x25f8('0x54')]);return _0x3adee7[_0x25f8('0x86')](_0x27031d);}})[_0x25f8('0x21')](function(_0x1227ce){if(_0x1227ce){_0x265eb3=_0x1227ce['length'];if(!_0x29e2f1[_0x25f8('0x45')]['hasOwnProperty'](_0x25f8('0x4a'))){_0x27031d[_0x25f8('0x4b')]=qs[_0x25f8('0x4b')](_0x29e2f1[_0x25f8('0x45')]['limit']);_0x27031d[_0x25f8('0x2d')]=qs[_0x25f8('0x2d')](_0x29e2f1[_0x25f8('0x45')]['offset']);}return _0x3adee7[_0x25f8('0x86')](_0x27031d);}})[_0x25f8('0x21')](function(_0x586651){if(_0x586651){return _0x586651?{'count':_0x265eb3,'rows':_0x586651}:null;}})[_0x25f8('0x21')](respondWithResult(_0x1c88c8,null))[_0x25f8('0x29')](handleError(_0x1c88c8,null));};exports['notify']=function(_0x4f78fc,_0x537c09,_0x1a9601){var _0x3d217a={'channel':_0x25f8('0x87')};var _0x123a57=[];var _0x2af0b8=[];var _0x5214da={};return db['WhatsappAccount'][_0x25f8('0x5c')]({'where':{'id':_0x4f78fc[_0x25f8('0x64')]['id']},'include':[{'model':db[_0x25f8('0x80')],'as':_0x25f8('0x88')}]})[_0x25f8('0x21')](handleEntityNotFound(_0x537c09,null))[_0x25f8('0x21')](function(_0x5cda63){_0x3d217a[_0x25f8('0x89')]=_0x5cda63;if(_0x3d217a[_0x25f8('0x89')]&&_0x3d217a['account']['type']==='sinch'&&_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x8a')]){if(_0x4f78fc['body'][_0x25f8('0x8a')][_0x25f8('0x48')]===0x0)return;if(_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x8a')][0x0][_0x25f8('0x8b')]!==_0x25f8('0x8c'))return;return db[_0x25f8('0x8d')][_0x25f8('0x36')]({'read':!![],'readAt':_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x8a')][0x0][_0x25f8('0x8e')]},{'where':{'messageId':_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x8a')][0x0][_0x25f8('0x8f')]},'individualHooks':!![]})['then'](function(_0x4f30ce){return _0x537c09[_0x25f8('0x2b')](0xc8)[_0x25f8('0x32')](_0x4f30ce);});}_0x3d217a[_0x25f8('0x90')]=_['orderBy'](_0x5cda63[_0x25f8('0x88')],[_0x25f8('0x83')],[_0x25f8('0x91')]);if(_0x3d217a[_0x25f8('0x89')][_0x25f8('0x88')]){delete _0x3d217a[_0x25f8('0x89')]['Applications'];}return db[_0x25f8('0x92')]['describe']()[_0x25f8('0x21')](function(_0x207cf3){if(!_0x207cf3){throw new db[(_0x25f8('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0x123a57=_[_0x25f8('0x94')](_[_0x25f8('0x41')](_0x207cf3),['createdAt','updatedAt']);_0x2af0b8=_[_0x25f8('0x94')](_[_0x25f8('0x41')](_0x207cf3),['createdAt',_0x25f8('0x95'),'CompanyId',_0x25f8('0x96')]);_0x3d217a['body']={'mapKey':_0x25f8('0x97')};if(_0x3d217a['account']&&_0x3d217a['account'][_0x25f8('0x51')]===_0x25f8('0x98')){_0x3d217a['body'][_0x25f8('0x99')]=_0x4f78fc['body']['From'][_0x25f8('0x9a')](_0x25f8('0x9b'),'');_0x3d217a[_0x25f8('0x63')][_0x25f8('0x63')]=_0x4f78fc[_0x25f8('0x63')]['Body'];_0x3d217a[_0x25f8('0x63')][_0x25f8('0x9c')]=_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x9d')];}if(_0x3d217a[_0x25f8('0x89')]&&_0x3d217a['account'][_0x25f8('0x51')]===_0x25f8('0x9e')){_0x3d217a[_0x25f8('0x63')][_0x25f8('0x99')]=_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x9f')][0x0][_0x25f8('0x99')];_0x3d217a['body'][_0x25f8('0x63')]=_0x4f78fc[_0x25f8('0x63')][_0x25f8('0x9f')][0x0][_0x25f8('0x27')][_0x25f8('0x63')];_0x3d217a['body'][_0x25f8('0x9c')]=_0x4f78fc['body'][_0x25f8('0x9f')][0x0][_0x25f8('0x8f')];}if(_0x3d217a[_0x25f8('0x63')]['id']){delete _0x3d217a[_0x25f8('0x63')]['id'];}if(_['isNil'](_0x3d217a[_0x25f8('0x63')][_0x25f8('0x99')])){throw new db[(_0x25f8('0x93'))][(_0x25f8('0xa0'))](_0x25f8('0xa1'));}if(_['isNil'](_0x3d217a[_0x25f8('0x63')][_0x25f8('0x63')])||_0x3d217a[_0x25f8('0x63')][_0x25f8('0x63')]===''){throw new db[(_0x25f8('0x93'))][(_0x25f8('0xa0'))](_0x25f8('0xa2'));}if(_[_0x25f8('0xa3')](_0x3d217a[_0x25f8('0x63')][_0x25f8('0xa4')])){throw new db[(_0x25f8('0x93'))][(_0x25f8('0xa0'))](_0x25f8('0xa5')+_0x2af0b8);}if(!_[_0x25f8('0xa6')](_0x2af0b8,_0x3d217a['body']['mapKey'])){throw new db[(_0x25f8('0x93'))][(_0x25f8('0xa0'))](_0x25f8('0xa7')+_0x2af0b8);}_0x5214da[_0x3d217a[_0x25f8('0x63')]['mapKey']]=_0x3d217a[_0x25f8('0x63')]['from'];return db[_0x25f8('0xa8')][_0x25f8('0x5c')]({'where':{'id':_0x3d217a[_0x25f8('0x89')][_0x25f8('0x96')]},'include':[{'model':db[_0x25f8('0x92')],'as':_0x25f8('0xa9'),'where':_0x5214da,'limit':0x1,'order':[[_0x25f8('0x95'),_0x25f8('0xaa')]]}]});})[_0x25f8('0x21')](handleEntityNotFound(_0x537c09,null))['then'](function(_0x4a0be3){if(_0x4a0be3){_0x3d217a[_0x25f8('0xab')]=_[_0x25f8('0x72')](_0x4a0be3,[_0x25f8('0xa9')]);if(_0x4a0be3['Contacts'][_0x25f8('0x48')]){return _0x4a0be3[_0x25f8('0xa9')][0x0];}var _0x5a3d21=_[_0x25f8('0xac')](_0x3d217a[_0x25f8('0x63')],{'firstName':_0x3d217a[_0x25f8('0x63')][_0x25f8('0x99')],'ListId':_0x4a0be3['id']});_0x5a3d21[_0x3d217a['body'][_0x25f8('0xa4')]]=_0x3d217a['body'][_0x25f8('0x99')];return db[_0x25f8('0x92')][_0x25f8('0x5d')](_0x5a3d21,{'fields':_0x123a57,'raw':!![]});}})[_0x25f8('0x21')](handleEntityNotFound(_0x537c09,null))[_0x25f8('0x21')](function(_0x3eadbd){if(_0x3eadbd){_0x3d217a[_0x25f8('0xad')]=_0x3eadbd;var _0x40bf59={'ContactId':_0x3eadbd['id'],'phone':_0x3d217a[_0x25f8('0x63')][_0x25f8('0x99')],'WhatsappAccountId':_0x4f78fc['params']['id']};var _0x5e34ab={'ContactId':_0x3eadbd['id'],'WhatsappAccountId':_0x4f78fc['params']['id'],'closed':![]};return db[_0x25f8('0xae')]['find']({'where':_0x5e34ab})[_0x25f8('0x21')](function(_0x54a43f){if(_0x54a43f){return[_0x54a43f,![]];}return db[_0x25f8('0xae')][_0x25f8('0x5d')](_0x40bf59)['then'](function(_0x28061a){return[_0x28061a,!![]];});});}})[_0x25f8('0x73')](function(_0x396330,_0x441cad){_0x3d217a[_0x25f8('0xaf')]=_0x396330['get']({'plain':!![]});_0x3d217a['interaction'][_0x25f8('0xb0')]=![];if(_0x441cad){if(_0x3d217a[_0x25f8('0x89')][_0x25f8('0xb1')]){_0x3d217a['applications']['push']({'id':0x0,'priority':_0x3d217a[_0x25f8('0x90')]['length']+0x1,'app':_0x25f8('0xb2'),'appdata':_0x25f8('0xb3'),'interval':_0x25f8('0xb4')});}_0x3d217a['interaction']['created']=!![];}return db[_0x25f8('0x8d')]['create']({'phone':_0x3d217a[_0x25f8('0x63')][_0x25f8('0x99')],'messageId':_0x3d217a[_0x25f8('0x63')][_0x25f8('0x9c')],'body':_0x3d217a[_0x25f8('0x63')][_0x25f8('0x63')],'WhatsappAccountId':_0x4f78fc[_0x25f8('0x64')]['id'],'WhatsappInteractionId':_0x396330['id'],'direction':'in','ContactId':_0x396330[_0x25f8('0xb5')],'AttachmentId':_0x3d217a[_0x25f8('0x63')]['AttachmentId']});})[_0x25f8('0x21')](function(_0xa42d85){_0x3d217a['message']=_0xa42d85;if(_0x3d217a[_0x25f8('0xaf')][_0x25f8('0xb6')]){return db[_0x25f8('0x79')]['find']({'attributes':['id',_0x25f8('0x3b')],'where':{'id':_0x3d217a[_0x25f8('0xaf')][_0x25f8('0xb6')]}})[_0x25f8('0x21')](function(_0x3aee02){if(_0x3aee02){_0x3d217a['applications'][_0x25f8('0xb7')]({'id':0x0,'priority':0x0,'app':_0x25f8('0xb8'),'appdata':_0x3aee02['name']+','+(_0x3d217a[_0x25f8('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x25f8('0xb4')});}return respondWithRpcPromise(_0x25f8('0xb9'),_0x25f8('0xba'),_0x3d217a);});}return respondWithRpcPromise('Start',_0x25f8('0xba'),_0x3d217a);})[_0x25f8('0x21')](function(_0x37d7b8){if(_0x37d7b8){var _0x51e211=0xc8;var _0x409a8e=_0x25f8('0xbb');logger[_0x25f8('0x28')](_0x25f8('0x23'),_0x409a8e,_0x51e211,_0x25f8('0xbc'));logger[_0x25f8('0x22')](_0x25f8('0xbd'),_0x409a8e,_0x51e211,_0x25f8('0xbc'),JSON['stringify'](_0x37d7b8));if(_0x3d217a['account'][_0x25f8('0x51')]==='twilio'){return _0x537c09['status'](_0x51e211)[_0x25f8('0x30')](_0x25f8('0xbe'),'text/xml')[_0x25f8('0x85')](_0x25f8('0xbf'));}else{return _0x537c09[_0x25f8('0x2b')](_0x51e211)[_0x25f8('0x32')](_0x37d7b8);}}});})[_0x25f8('0x29')](handleError(_0x537c09,null));};exports[_0x25f8('0x85')]=function(_0x1d6384,_0x344403,_0x2acb3f){var _0x402b41,_0x159d13,_0x3cd3a1;if(_[_0x25f8('0xa3')](_0x1d6384[_0x25f8('0x63')][_0x25f8('0x63')])||_0x1d6384['body'][_0x25f8('0x63')]===''){throw new db[(_0x25f8('0x93'))][(_0x25f8('0xa0'))](_0x25f8('0xa2'));}if(_[_0x25f8('0xa3')](_0x1d6384[_0x25f8('0x63')]['to'])){throw new db[(_0x25f8('0x93'))]['ValidationError'](_0x25f8('0xc0'));}_0x402b41=_0x1d6384['body']['to'];return db[_0x25f8('0x55')][_0x25f8('0x5c')]({'where':{'id':_0x1d6384[_0x25f8('0x64')]['id']},'include':[{'model':db[_0x25f8('0xa8')],'as':_0x25f8('0xc1'),'include':[{'model':db[_0x25f8('0x92')],'as':_0x25f8('0xa9'),'where':{'mobile':_0x402b41},'limit':0x1,'order':[[_0x25f8('0x95'),_0x25f8('0xaa')]]}]}]})[_0x25f8('0x21')](handleEntityNotFound(_0x344403,null))['then'](function(_0x5df2c1){if(_0x5df2c1&&_0x5df2c1[_0x25f8('0xc1')]){_0x159d13=_0x5df2c1['get']({'plain':!![]});if(_0x159d13['List']&&_0x159d13['List'][_0x25f8('0xa9')][_0x25f8('0x48')]){return _0x159d13['List']['Contacts'][0x0];}return db[_0x25f8('0x92')][_0x25f8('0x5d')](_[_0x25f8('0xac')](_0x1d6384[_0x25f8('0x63')],{'firstName':_0x402b41,'mobile':_0x402b41,'phone':_0x402b41,'ListId':_0x159d13['ListId']}));}})[_0x25f8('0x21')](handleEntityNotFound(_0x344403,null))['then'](function(_0x27e58d){if(_0x27e58d){_0x3cd3a1=_0x27e58d;return db['WhatsappInteraction'][_0x25f8('0x5c')]({'where':{'ContactId':_0x3cd3a1['id'],'closed':![],'WhatsappAccountId':_0x159d13['id']}})['then'](function(_0x4a4895){if(_0x4a4895){return[_0x4a4895,![]];}return db[_0x25f8('0xae')][_0x25f8('0x5d')]({'UserId':_0x1d6384[_0x25f8('0x5e')]['id'],'ContactId':_0x3cd3a1['id'],'WhatsappAccountId':_0x159d13['id'],'phone':_0x402b41,'firstMsgDirection':_0x25f8('0xc2'),'Messages':[_[_0x25f8('0x53')](_0x1d6384['body'],{'read':![],'body':_0x1d6384['body']['body'],'phone':_0x402b41,'WhatsappAccountId':_0x159d13['id'],'UserId':_0x1d6384[_0x25f8('0x5e')]['id'],'ContactId':_0x3cd3a1['id']})]},{'include':[{'model':db[_0x25f8('0x8d')],'as':_0x25f8('0xc3')}]})[_0x25f8('0x21')](function(_0x27d0b7){return[_0x27d0b7,!![]];});});}})[_0x25f8('0x73')](function(_0x325925,_0x47f42e){if(_0x47f42e){return _0x325925;}return db[_0x25f8('0x8d')]['create'](_[_0x25f8('0x53')](_0x1d6384[_0x25f8('0x63')],{'read':![],'body':_0x1d6384[_0x25f8('0x63')][_0x25f8('0x63')],'phone':_0x402b41,'WhatsappAccountId':_0x159d13['id'],'WhatsappInteractionId':_0x325925['id'],'UserId':_0x1d6384['user']['id'],'ContactId':_0x3cd3a1['id']}))[_0x25f8('0x21')](function(_0x46f709){_0x325925['dataValues'][_0x25f8('0xc3')]=[];_0x325925[_0x25f8('0xc4')]['Messages'][_0x25f8('0xc5')](_0x46f709[_0x25f8('0xc4')]);return _0x325925;});})[_0x25f8('0x21')](respondWithResult(_0x344403,null))[_0x25f8('0x29')](handleError(_0x344403,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 0469c17..857dab2 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 _0x51f8=['remove','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0x51f8,0x1b5));var _0x851f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x51f8[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x851f('0x0'));var WhatsappAccount=require(_0x851f('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x851f('0x2'),'afterUpdate':_0x851f('0x3'),'afterDestroy':_0x851f('0x4')};function emitEvent(_0x30c66a){return function(_0x419ea7,_0x469b66,_0x2f2101){WhatsappAccountEvents['emit'](_0x30c66a+':'+_0x419ea7['id'],_0x419ea7);WhatsappAccountEvents['emit'](_0x30c66a,_0x419ea7);_0x2f2101(null);};}for(var e in events){if(events[_0x851f('0x5')](e)){var event=events[e];WhatsappAccount[_0x851f('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x329e=['WhatsappAccount','setMaxListeners','save','update','hasOwnProperty','../../mysqldb'];(function(_0x40889c,_0x73e154){var _0x1e69a3=function(_0x365601){while(--_0x365601){_0x40889c['push'](_0x40889c['shift']());}};_0x1e69a3(++_0x73e154);}(_0x329e,0x1e5));var _0xe329=function(_0x29e3e8,_0x387854){_0x29e3e8=_0x29e3e8-0x0;var _0x4007bd=_0x329e[_0x29e3e8];return _0x4007bd;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xe329('0x0'))['db'][_0xe329('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xe329('0x2')](0x0);var events={'afterCreate':_0xe329('0x3'),'afterUpdate':_0xe329('0x4'),'afterDestroy':'remove'};function emitEvent(_0x431881){return function(_0x4dae78,_0x3de83d,_0x29ab90){WhatsappAccountEvents['emit'](_0x431881+':'+_0x4dae78['id'],_0x4dae78);WhatsappAccountEvents['emit'](_0x431881,_0x4dae78);_0x29ab90(null);};}for(var e in events){if(events[_0xe329('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index fde12e2..ea5a25b 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 _0x6308=['WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x4a2fa6,_0x89d91){var _0x58419c=function(_0x4fae21){while(--_0x4fae21){_0x4a2fa6['push'](_0x4a2fa6['shift']());}};_0x58419c(++_0x89d91);}(_0x6308,0x12d));var _0x8630=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x6308[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x8630('0x0'));var util=require(_0x8630('0x1'));var logger=require('../../config/logger')(_0x8630('0x2'));var moment=require(_0x8630('0x3'));var BPromise=require(_0x8630('0x4'));var rp=require(_0x8630('0x5'));var fs=require('fs');var path=require(_0x8630('0x6'));var rimraf=require(_0x8630('0x7'));var config=require(_0x8630('0x8'));var attributes=require(_0x8630('0x9'));module[_0x8630('0xa')]=function(_0xb91564,_0x3ffa9e){return _0xb91564['define'](_0x8630('0xb'),attributes,{'tableName':_0x8630('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18df=['define','WhatsappAccount','whatsapp_accounts','moment','bluebird','path','rimraf','./whatsappAccount.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x18df,0x1c5));var _0xf18d=function(_0x37251e,_0x24c2e0){_0x37251e=_0x37251e-0x0;var _0x370e3b=_0x18df[_0x37251e];return _0x370e3b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf18d('0x0'));var BPromise=require(_0xf18d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf18d('0x2'));var rimraf=require(_0xf18d('0x3'));var config=require('../../config/environment');var attributes=require(_0xf18d('0x4'));module[_0xf18d('0x5')]=function(_0x438ab6,_0x4bdfde){return _0x438ab6[_0xf18d('0x6')](_0xf18d('0x7'),attributes,{'tableName':_0xf18d('0x8'),'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 25ddb19..a0f982c 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 _0x0249=['WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','include','map','model','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then'];(function(_0x47b381,_0x4c2ff6){var _0x34d96e=function(_0x37f7b4){while(--_0x37f7b4){_0x47b381['push'](_0x47b381['shift']());}};_0x34d96e(++_0x4c2ff6);}(_0x0249,0x86));var _0x9024=function(_0x5a5c5b,_0x32485c){_0x5a5c5b=_0x5a5c5b-0x0;var _0x47a702=_0x0249[_0x5a5c5b];return _0x47a702;};'use strict';var _=require(_0x9024('0x0'));var util=require(_0x9024('0x1'));var moment=require(_0x9024('0x2'));var BPromise=require('bluebird');var rs=require(_0x9024('0x3'));var fs=require('fs');var Redis=require(_0x9024('0x4'));var db=require(_0x9024('0x5'))['db'];var utils=require(_0x9024('0x6'));var logger=require('../../config/logger')(_0x9024('0x7'));var config=require(_0x9024('0x8'));var jayson=require(_0x9024('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9024('0xa')]=_[_0x9024('0xb')](config[_0x9024('0xa')],{'host':_0x9024('0xc'),'port':0x18eb});var socket=require(_0x9024('0xd'))(new Redis(config[_0x9024('0xa')]));require(_0x9024('0xe'))[_0x9024('0xf')](socket);function respondWithRpcPromise(_0x15fb6e,_0x557f92,_0xb0c691){return new BPromise(function(_0x55d459,_0x46b6c4){return client[_0x9024('0x10')](_0x15fb6e,_0xb0c691)[_0x9024('0x11')](function(_0x1ad7b3){logger['info'](_0x9024('0x12'),_0x557f92,_0x9024('0x13'));logger[_0x9024('0x14')](_0x9024('0x15'),_0x557f92,_0x9024('0x13'),JSON[_0x9024('0x16')](_0x1ad7b3));if(_0x1ad7b3['error']){if(_0x1ad7b3[_0x9024('0x17')][_0x9024('0x18')]===0x1f4){logger[_0x9024('0x17')](_0x9024('0x12'),_0x557f92,_0x1ad7b3[_0x9024('0x17')]['message']);return _0x46b6c4(_0x1ad7b3[_0x9024('0x17')][_0x9024('0x19')]);}logger['error'](_0x9024('0x12'),_0x557f92,_0x1ad7b3[_0x9024('0x17')]['message']);return _0x55d459(_0x1ad7b3['error'][_0x9024('0x19')]);}else{logger[_0x9024('0x1a')](_0x9024('0x12'),_0x557f92,_0x9024('0x13'));_0x55d459(_0x1ad7b3[_0x9024('0x1b')][_0x9024('0x19')]);}})[_0x9024('0x1c')](function(_0x53f3f2){logger[_0x9024('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x557f92,_0x53f3f2);_0x46b6c4(_0x53f3f2);});});}exports[_0x9024('0x1d')]=function(_0x45e849){var _0x3636d0=this;return new Promise(function(_0x160371,_0x40f6ac){return db[_0x9024('0x1e')][_0x9024('0x1f')]({'raw':_0x45e849['options']?_0x45e849[_0x9024('0x20')][_0x9024('0x21')]===undefined?!![]:![]:!![],'where':_0x45e849[_0x9024('0x20')]?_0x45e849[_0x9024('0x20')]['where']||null:null,'attributes':_0x45e849[_0x9024('0x20')]?_0x45e849[_0x9024('0x20')]['attributes']||null:null,'include':_0x45e849[_0x9024('0x20')]?_0x45e849[_0x9024('0x20')][_0x9024('0x22')]?_[_0x9024('0x23')](_0x45e849[_0x9024('0x20')]['include'],function(_0x24a195){return{'model':db[_0x24a195[_0x9024('0x24')]],'as':_0x24a195['as'],'attributes':_0x24a195[_0x9024('0x25')],'include':_0x24a195['include']?_[_0x9024('0x23')](_0x24a195[_0x9024('0x22')],function(_0x210138){return{'model':db[_0x210138[_0x9024('0x24')]],'as':_0x210138['as'],'attributes':_0x210138['attributes'],'include':_0x210138[_0x9024('0x22')]?_[_0x9024('0x23')](_0x210138[_0x9024('0x22')],function(_0x2eea31){return{'model':db[_0x2eea31[_0x9024('0x24')]],'as':_0x2eea31['as'],'attributes':_0x2eea31['attributes']};}):[]};}):[]};}):[]:[]})[_0x9024('0x11')](function(_0x33ec11){logger[_0x9024('0x1a')](_0x9024('0x1d'),_0x45e849);logger[_0x9024('0x14')](_0x9024('0x1d'),_0x45e849,JSON[_0x9024('0x16')](_0x33ec11));_0x160371(_0x33ec11);})[_0x9024('0x1c')](function(_0x4f4526){logger[_0x9024('0x17')](_0x9024('0x1d'),_0x4f4526[_0x9024('0x19')],_0x45e849);_0x40f6ac(_0x3636d0[_0x9024('0x17')](0x1f4,_0x4f4526[_0x9024('0x19')]));});});}; \ No newline at end of file +var _0xba53=['WhatsappAccount,\x20%s,\x20%s','message','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xba53,0x1ef));var _0x3ba5=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xba53[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require('lodash');var util=require(_0x3ba5('0x0'));var moment=require('moment');var BPromise=require(_0x3ba5('0x1'));var rs=require(_0x3ba5('0x2'));var fs=require('fs');var Redis=require(_0x3ba5('0x3'));var db=require(_0x3ba5('0x4'))['db'];var utils=require(_0x3ba5('0x5'));var logger=require(_0x3ba5('0x6'))(_0x3ba5('0x7'));var config=require(_0x3ba5('0x8'));var jayson=require(_0x3ba5('0x9'));var client=jayson['client'][_0x3ba5('0xa')]({'port':0x232a});config[_0x3ba5('0xb')]=_[_0x3ba5('0xc')](config[_0x3ba5('0xb')],{'host':_0x3ba5('0xd'),'port':0x18eb});var socket=require(_0x3ba5('0xe'))(new Redis(config[_0x3ba5('0xb')]));require('./whatsappAccount.socket')[_0x3ba5('0xf')](socket);function respondWithRpcPromise(_0x2eee4a,_0x4d529e,_0x4c40a4){return new BPromise(function(_0x29d8f1,_0x398a61){return client[_0x3ba5('0x10')](_0x2eee4a,_0x4c40a4)[_0x3ba5('0x11')](function(_0x1393fe){logger[_0x3ba5('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x4d529e,_0x3ba5('0x13'));logger[_0x3ba5('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4d529e,_0x3ba5('0x13'),JSON['stringify'](_0x1393fe));if(_0x1393fe['error']){if(_0x1393fe[_0x3ba5('0x15')][_0x3ba5('0x16')]===0x1f4){logger[_0x3ba5('0x15')](_0x3ba5('0x17'),_0x4d529e,_0x1393fe[_0x3ba5('0x15')][_0x3ba5('0x18')]);return _0x398a61(_0x1393fe[_0x3ba5('0x15')][_0x3ba5('0x18')]);}logger[_0x3ba5('0x15')](_0x3ba5('0x17'),_0x4d529e,_0x1393fe['error'][_0x3ba5('0x18')]);return _0x29d8f1(_0x1393fe[_0x3ba5('0x15')][_0x3ba5('0x18')]);}else{logger[_0x3ba5('0x12')](_0x3ba5('0x17'),_0x4d529e,_0x3ba5('0x13'));_0x29d8f1(_0x1393fe['result'][_0x3ba5('0x18')]);}})[_0x3ba5('0x19')](function(_0xc046bf){logger[_0x3ba5('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x4d529e,_0xc046bf);_0x398a61(_0xc046bf);});});}exports['ShowWhatsappAccount']=function(_0x4b03af){var _0x5d9453=this;return new Promise(function(_0x5de75b,_0x12ac9f){return db[_0x3ba5('0x1a')][_0x3ba5('0x1b')]({'raw':_0x4b03af[_0x3ba5('0x1c')]?_0x4b03af[_0x3ba5('0x1c')][_0x3ba5('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b03af['options']?_0x4b03af[_0x3ba5('0x1c')][_0x3ba5('0x1e')]||null:null,'attributes':_0x4b03af[_0x3ba5('0x1c')]?_0x4b03af['options'][_0x3ba5('0x1f')]||null:null,'include':_0x4b03af[_0x3ba5('0x1c')]?_0x4b03af[_0x3ba5('0x1c')][_0x3ba5('0x20')]?_[_0x3ba5('0x21')](_0x4b03af[_0x3ba5('0x1c')][_0x3ba5('0x20')],function(_0x538307){return{'model':db[_0x538307[_0x3ba5('0x22')]],'as':_0x538307['as'],'attributes':_0x538307[_0x3ba5('0x1f')],'include':_0x538307[_0x3ba5('0x20')]?_[_0x3ba5('0x21')](_0x538307[_0x3ba5('0x20')],function(_0x466111){return{'model':db[_0x466111[_0x3ba5('0x22')]],'as':_0x466111['as'],'attributes':_0x466111[_0x3ba5('0x1f')],'include':_0x466111[_0x3ba5('0x20')]?_[_0x3ba5('0x21')](_0x466111['include'],function(_0x4f4fd8){return{'model':db[_0x4f4fd8[_0x3ba5('0x22')]],'as':_0x4f4fd8['as'],'attributes':_0x4f4fd8[_0x3ba5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3ba5('0x11')](function(_0x4658e6){logger[_0x3ba5('0x12')](_0x3ba5('0x23'),_0x4b03af);logger[_0x3ba5('0x14')]('ShowWhatsappAccount',_0x4b03af,JSON[_0x3ba5('0x24')](_0x4658e6));_0x5de75b(_0x4658e6);})[_0x3ba5('0x19')](function(_0x179722){logger[_0x3ba5('0x15')]('ShowWhatsappAccount',_0x179722['message'],_0x4b03af);_0x12ac9f(_0x5d9453[_0x3ba5('0x15')](0x1f4,_0x179722[_0x3ba5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index efd6a5f..f10f6e5 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 _0x5a35=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x17f526,_0xaf4874){var _0x39809d=function(_0x5cf2bd){while(--_0x5cf2bd){_0x17f526['push'](_0x17f526['shift']());}};_0x39809d(++_0xaf4874);}(_0x5a35,0x1c7));var _0x55a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5a35[_0x2641f9];return _0x585741;};'use strict';var WhatsappAccountEvents=require(_0x55a3('0x0'));var events=['save',_0x55a3('0x1'),_0x55a3('0x2')];function createListener(_0x57805f,_0x131656){return function(_0x2077f3){_0x131656[_0x55a3('0x3')](_0x57805f,_0x2077f3);};}function removeListener(_0x489e53,_0x28437f){return function(){WhatsappAccountEvents[_0x55a3('0x4')](_0x489e53,_0x28437f);};}exports[_0x55a3('0x5')]=function(_0x30fcc7){for(var _0x360b45=0x0,_0x313167=events[_0x55a3('0x6')];_0x360b45<_0x313167;_0x360b45++){var _0x44955d=events[_0x360b45];var _0x5d4cdc=createListener(_0x55a3('0x7')+_0x44955d,_0x30fcc7);WhatsappAccountEvents['on'](_0x44955d,_0x5d4cdc);}}; \ No newline at end of file +var _0xdc2b=['save','remove','emit','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xdc2b,0x1d4));var _0xbdc2=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xdc2b[_0x5d4607];return _0x5e4a86;};'use strict';var WhatsappAccountEvents=require(_0xbdc2('0x0'));var events=[_0xbdc2('0x1'),_0xbdc2('0x2'),'update'];function createListener(_0x1a3e47,_0x2c1839){return function(_0x35e919){_0x2c1839[_0xbdc2('0x3')](_0x1a3e47,_0x35e919);};}function removeListener(_0x5bad97,_0x7d1402){return function(){WhatsappAccountEvents['removeListener'](_0x5bad97,_0x7d1402);};}exports[_0xbdc2('0x4')]=function(_0x3a6c55){for(var _0x4f12e9=0x0,_0x400f8c=events[_0xbdc2('0x5')];_0x4f12e9<_0x400f8c;_0x4f12e9++){var _0x5abdae=events[_0x4f12e9];var _0x5064a0=createListener(_0xbdc2('0x6')+_0x5abdae,_0x3a6c55);WhatsappAccountEvents['on'](_0x5abdae,_0x5064a0);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 099ed76..10d820a 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 _0xa513=['create','update','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x4de7ca,_0x980eb7){var _0x4425dd=function(_0x59122f){while(--_0x59122f){_0x4de7ca['push'](_0x4de7ca['shift']());}};_0x4425dd(++_0x980eb7);}(_0xa513,0xb7));var _0x3a51=function(_0x497c5e,_0x235f6e){_0x497c5e=_0x497c5e-0x0;var _0x4b4e87=_0xa513[_0x497c5e];return _0x4b4e87;};'use strict';var multer=require(_0x3a51('0x0'));var util=require(_0x3a51('0x1'));var path=require('path');var timeout=require(_0x3a51('0x2'));var express=require(_0x3a51('0x3'));var router=express['Router']();var fs_extra=require(_0x3a51('0x4'));var auth=require(_0x3a51('0x5'));var interaction=require(_0x3a51('0x6'));var config=require(_0x3a51('0x7'));var controller=require(_0x3a51('0x8'));router[_0x3a51('0x9')]('/',auth[_0x3a51('0xa')](),controller[_0x3a51('0xb')]);router[_0x3a51('0x9')](_0x3a51('0xc'),auth['isAuthenticated'](),controller[_0x3a51('0xd')]);router[_0x3a51('0xe')]('/',auth[_0x3a51('0xa')](),controller[_0x3a51('0xf')]);router['put'](_0x3a51('0xc'),auth['isAuthenticated'](),controller[_0x3a51('0x10')]);router[_0x3a51('0x11')](_0x3a51('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x21bb=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','get','/:id','isAuthenticated','show','post','put','destroy','multer'];(function(_0x1b669a,_0x354b58){var _0x4ada7f=function(_0x654a6d){while(--_0x654a6d){_0x1b669a['push'](_0x1b669a['shift']());}};_0x4ada7f(++_0x354b58);}(_0x21bb,0x10d));var _0xb21b=function(_0x2cdb35,_0x2375e3){_0x2cdb35=_0x2cdb35-0x0;var _0x531d51=_0x21bb[_0x2cdb35];return _0x531d51;};'use strict';var multer=require(_0xb21b('0x0'));var util=require(_0xb21b('0x1'));var path=require('path');var timeout=require(_0xb21b('0x2'));var express=require(_0xb21b('0x3'));var router=express[_0xb21b('0x4')]();var fs_extra=require(_0xb21b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb21b('0x6'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb21b('0x7')]);router[_0xb21b('0x8')](_0xb21b('0x9'),auth[_0xb21b('0xa')](),controller[_0xb21b('0xb')]);router[_0xb21b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb21b('0xd')]('/:id',auth[_0xb21b('0xa')](),controller['update']);router['delete'](_0xb21b('0x9'),auth[_0xb21b('0xa')](),controller[_0xb21b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ed639dd..665a383 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 _0x0aff=['exports','STRING','TEXT','*,*,*,*'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x0aff,0x1d0));var _0xf0af=function(_0x4c2f17,_0x5c6821){_0x4c2f17=_0x4c2f17-0x0;var _0x20919e=_0x0aff[_0x4c2f17];return _0x20919e;};'use strict';var Sequelize=require('sequelize');module[_0xf0af('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf0af('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf0af('0x2')]()},'description':{'type':Sequelize[_0xf0af('0x1')]},'interval':{'type':Sequelize[_0xf0af('0x1')],'defaultValue':_0xf0af('0x3')}}; \ No newline at end of file +var _0x4cf0=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x38ebd9,_0x352d11){var _0x5a7327=function(_0x2ae8c6){while(--_0x2ae8c6){_0x38ebd9['push'](_0x38ebd9['shift']());}};_0x5a7327(++_0x352d11);}(_0x4cf0,0x13a));var _0x04cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4cf0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x04cf('0x0'));module[_0x04cf('0x1')]={'priority':{'type':Sequelize[_0x04cf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x04cf('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x04cf('0x4')]()},'description':{'type':Sequelize[_0x04cf('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x04cf('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 5229598..a292cb8 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 _0xde9f=['limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','fields','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','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','sendStatus','status','json','offset'];(function(_0x174265,_0x529fa6){var _0x3eac63=function(_0x5e62c2){while(--_0x5e62c2){_0x174265['push'](_0x174265['shift']());}};_0x3eac63(++_0x529fa6);}(_0xde9f,0x118));var _0xfde9=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xde9f[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0xfde9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfde9('0x1'));var rp=require(_0xfde9('0x2'));var moment=require('moment');var BPromise=require(_0xfde9('0x3'));var Mustache=require(_0xfde9('0x4'));var util=require('util');var path=require(_0xfde9('0x5'));var sox=require(_0xfde9('0x6'));var csv=require(_0xfde9('0x7'));var ejs=require(_0xfde9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfde9('0x9'));var crypto=require(_0xfde9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfde9('0xb'));var toCsv=require(_0xfde9('0x7'));var querystring=require(_0xfde9('0xc'));var Papa=require(_0xfde9('0xd'));var Redis=require(_0xfde9('0xe'));var authService=require(_0xfde9('0xf'));var qs=require(_0xfde9('0x10'));var as=require(_0xfde9('0x11'));var hardwareService=require(_0xfde9('0x12'));var logger=require(_0xfde9('0x13'))(_0xfde9('0x14'));var utils=require(_0xfde9('0x15'));var config=require(_0xfde9('0x16'));var licenseUtil=require(_0xfde9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5742c7,_0x345a64){_0x345a64=_0x345a64||0xcc;return function(_0x3add66){if(_0x3add66){return _0x5742c7[_0xfde9('0x18')](_0x345a64);}return _0x5742c7[_0xfde9('0x19')](_0x345a64)['end']();};}function respondWithResult(_0x5af78d,_0x36e754){_0x36e754=_0x36e754||0xc8;return function(_0x3f8d50){if(_0x3f8d50){return _0x5af78d[_0xfde9('0x19')](_0x36e754)[_0xfde9('0x1a')](_0x3f8d50);}};}function respondWithFilteredResult(_0x29fa8a,_0x489841){return function(_0x454068){if(_0x454068){var _0x310b90=typeof _0x489841[_0xfde9('0x1b')]==='undefined'&&typeof _0x489841[_0xfde9('0x1c')]===_0xfde9('0x1d');var _0x1a42ef=_0x454068['count'];var _0x4c9f24=_0x310b90?0x0:_0x489841['offset'];var _0x544f19=_0x310b90?_0x454068[_0xfde9('0x1e')]:_0x489841[_0xfde9('0x1b')]+_0x489841['limit'];var _0x50a21a;if(_0x544f19>=_0x1a42ef){_0x544f19=_0x1a42ef;_0x50a21a=0xc8;}else{_0x50a21a=0xce;}_0x29fa8a[_0xfde9('0x19')](_0x50a21a);return _0x29fa8a[_0xfde9('0x1f')](_0xfde9('0x20'),_0x4c9f24+'-'+_0x544f19+'/'+_0x1a42ef)[_0xfde9('0x1a')](_0x454068);}return null;};}function patchUpdates(_0x162b07){return function(_0x12543d){try{jsonpatch[_0xfde9('0x21')](_0x12543d,_0x162b07,!![]);}catch(_0x2ef059){return BPromise[_0xfde9('0x22')](_0x2ef059);}return _0x12543d[_0xfde9('0x23')]();};}function saveUpdates(_0x10cb3f,_0x28d189){return function(_0x54c1b8){if(_0x54c1b8){return _0x54c1b8[_0xfde9('0x24')](_0x10cb3f)['then'](function(_0x33e016){return _0x33e016;});}return null;};}function removeEntity(_0x159141,_0x20bdb3){return function(_0x5d0a74){if(_0x5d0a74){return _0x5d0a74[_0xfde9('0x25')]()[_0xfde9('0x26')](function(){_0x159141['status'](0xcc)[_0xfde9('0x27')]();});}};}function handleEntityNotFound(_0x1c4864,_0x2188a5){return function(_0x242dae){if(!_0x242dae){_0x1c4864[_0xfde9('0x18')](0x194);}return _0x242dae;};}function handleError(_0x37ad02,_0x1f2e12){_0x1f2e12=_0x1f2e12||0x1f4;return function(_0xce2d91){logger[_0xfde9('0x28')](_0xce2d91[_0xfde9('0x29')]);if(_0xce2d91[_0xfde9('0x2a')]){delete _0xce2d91[_0xfde9('0x2a')];}_0x37ad02[_0xfde9('0x19')](_0x1f2e12)[_0xfde9('0x2b')](_0xce2d91);};}exports[_0xfde9('0x2c')]=function(_0x1514f8,_0x4b7956){var _0x5cbf71={},_0x26aaf4={},_0x421472={'count':0x0,'rows':[]};var _0x578d67=_[_0xfde9('0x2d')](db[_0xfde9('0x2e')][_0xfde9('0x2f')],function(_0x1bf2a2){return{'name':_0x1bf2a2[_0xfde9('0x30')],'type':_0x1bf2a2['type'][_0xfde9('0x31')]};});_0x26aaf4[_0xfde9('0x32')]=_['map'](_0x578d67,_0xfde9('0x2a'));_0x26aaf4[_0xfde9('0x33')]=_[_0xfde9('0x34')](_0x1514f8[_0xfde9('0x33')]);_0x26aaf4[_0xfde9('0x35')]=_['intersection'](_0x26aaf4[_0xfde9('0x32')],_0x26aaf4['query']);_0x5cbf71[_0xfde9('0x36')]=_['intersection'](_0x26aaf4[_0xfde9('0x32')],qs['fields'](_0x1514f8[_0xfde9('0x33')]['fields']));_0x5cbf71[_0xfde9('0x36')]=_0x5cbf71[_0xfde9('0x36')][_0xfde9('0x37')]?_0x5cbf71[_0xfde9('0x36')]:_0x26aaf4[_0xfde9('0x32')];if(!_0x1514f8[_0xfde9('0x33')][_0xfde9('0x38')](_0xfde9('0x39'))){_0x5cbf71[_0xfde9('0x1c')]=qs[_0xfde9('0x1c')](_0x1514f8[_0xfde9('0x33')]['limit']);_0x5cbf71[_0xfde9('0x1b')]=qs[_0xfde9('0x1b')](_0x1514f8[_0xfde9('0x33')][_0xfde9('0x1b')]);}_0x5cbf71['order']=qs[_0xfde9('0x3a')](_0x1514f8[_0xfde9('0x33')][_0xfde9('0x3a')]);_0x5cbf71[_0xfde9('0x3b')]=qs[_0xfde9('0x35')](_[_0xfde9('0x3c')](_0x1514f8['query'],_0x26aaf4[_0xfde9('0x35')]),_0x578d67);if(_0x1514f8['query'][_0xfde9('0x3d')]){_0x5cbf71[_0xfde9('0x3b')]=_[_0xfde9('0x3e')](_0x5cbf71['where'],{'$or':_[_0xfde9('0x2d')](_0x578d67,function(_0x350977){if(_0x350977[_0xfde9('0x3f')]!==_0xfde9('0x40')){var _0x22e2dc={};_0x22e2dc[_0x350977[_0xfde9('0x2a')]]={'$like':'%'+_0x1514f8[_0xfde9('0x33')][_0xfde9('0x3d')]+'%'};return _0x22e2dc;}})});}_0x5cbf71=_['merge']({},_0x5cbf71,_0x1514f8[_0xfde9('0x41')]);var _0x3496aa={'where':_0x5cbf71[_0xfde9('0x3b')]};return db[_0xfde9('0x2e')][_0xfde9('0x1e')](_0x3496aa)['then'](function(_0x3a7c8d){_0x421472[_0xfde9('0x1e')]=_0x3a7c8d;if(_0x1514f8['query'][_0xfde9('0x42')]){_0x5cbf71[_0xfde9('0x43')]=[{'all':!![]}];}return db[_0xfde9('0x2e')]['findAll'](_0x5cbf71);})['then'](function(_0x5c4e5a){_0x421472[_0xfde9('0x44')]=_0x5c4e5a;return _0x421472;})[_0xfde9('0x26')](respondWithFilteredResult(_0x4b7956,_0x5cbf71))[_0xfde9('0x45')](handleError(_0x4b7956,null));};exports[_0xfde9('0x46')]=function(_0x127641,_0x15d9a7){var _0x3f02cc={'raw':!![],'where':{'id':_0x127641[_0xfde9('0x47')]['id']}},_0x307f31={};_0x307f31[_0xfde9('0x32')]=_[_0xfde9('0x34')](db[_0xfde9('0x2e')]['rawAttributes']);_0x307f31['query']=_['keys'](_0x127641['query']);_0x307f31[_0xfde9('0x35')]=_[_0xfde9('0x48')](_0x307f31[_0xfde9('0x32')],_0x307f31[_0xfde9('0x33')]);_0x3f02cc[_0xfde9('0x36')]=_[_0xfde9('0x48')](_0x307f31[_0xfde9('0x32')],qs[_0xfde9('0x49')](_0x127641[_0xfde9('0x33')][_0xfde9('0x49')]));_0x3f02cc[_0xfde9('0x36')]=_0x3f02cc[_0xfde9('0x36')][_0xfde9('0x37')]?_0x3f02cc[_0xfde9('0x36')]:_0x307f31[_0xfde9('0x32')];if(_0x127641[_0xfde9('0x33')][_0xfde9('0x42')]){_0x3f02cc[_0xfde9('0x43')]=[{'all':!![]}];}_0x3f02cc=_[_0xfde9('0x3e')]({},_0x3f02cc,_0x127641['options']);return db[_0xfde9('0x2e')][_0xfde9('0x4a')](_0x3f02cc)[_0xfde9('0x26')](handleEntityNotFound(_0x15d9a7,null))[_0xfde9('0x26')](respondWithResult(_0x15d9a7,null))[_0xfde9('0x45')](handleError(_0x15d9a7,null));};exports[_0xfde9('0x4b')]=function(_0x4874af,_0x3da297){return db['WhatsappApplication'][_0xfde9('0x4b')](_0x4874af['body'],{})[_0xfde9('0x26')](respondWithResult(_0x3da297,0xc9))[_0xfde9('0x45')](handleError(_0x3da297,null));};exports[_0xfde9('0x24')]=function(_0x3ae986,_0x1a7bef){if(_0x3ae986['body']['id']){delete _0x3ae986[_0xfde9('0x4c')]['id'];}return db[_0xfde9('0x2e')][_0xfde9('0x4a')]({'where':{'id':_0x3ae986[_0xfde9('0x47')]['id']}})[_0xfde9('0x26')](handleEntityNotFound(_0x1a7bef,null))[_0xfde9('0x26')](saveUpdates(_0x3ae986[_0xfde9('0x4c')],null))[_0xfde9('0x26')](respondWithResult(_0x1a7bef,null))[_0xfde9('0x45')](handleError(_0x1a7bef,null));};exports[_0xfde9('0x25')]=function(_0x3be67a,_0x5275fc){return db[_0xfde9('0x2e')][_0xfde9('0x4a')]({'where':{'id':_0x3be67a[_0xfde9('0x47')]['id']}})[_0xfde9('0x26')](handleEntityNotFound(_0x5275fc,null))[_0xfde9('0x26')](removeEntity(_0x5275fc,null))[_0xfde9('0x45')](handleError(_0x5275fc,null));}; \ No newline at end of file +var _0x15ef=['bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','save','then','destroy','end','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','WhatsappApplication','include','findAll','catch','show','params','length','includeAll','options','find','create','body','update','rimraf','zip-dir','request-promise','moment'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x15ef,0x80));var _0xf15e=function(_0x39c98f,_0x4014e0){_0x39c98f=_0x39c98f-0x0;var _0x36fd40=_0x15ef[_0x39c98f];return _0x36fd40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf15e('0x0'));var zipdir=require(_0xf15e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf15e('0x2'));var moment=require(_0xf15e('0x3'));var BPromise=require(_0xf15e('0x4'));var Mustache=require(_0xf15e('0x5'));var util=require(_0xf15e('0x6'));var path=require('path');var sox=require(_0xf15e('0x7'));var csv=require(_0xf15e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf15e('0x9'));var squel=require(_0xf15e('0xa'));var crypto=require('crypto');var jsforce=require(_0xf15e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf15e('0x8'));var querystring=require(_0xf15e('0xc'));var Papa=require(_0xf15e('0xd'));var Redis=require(_0xf15e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf15e('0xf'));var logger=require(_0xf15e('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf15e('0x11'));var db=require(_0xf15e('0x12'))['db'];function respondWithStatusCode(_0x8551e2,_0x5809f7){_0x5809f7=_0x5809f7||0xcc;return function(_0x442d51){if(_0x442d51){return _0x8551e2[_0xf15e('0x13')](_0x5809f7);}return _0x8551e2[_0xf15e('0x14')](_0x5809f7)['end']();};}function respondWithResult(_0x1ec4ad,_0x1d76e9){_0x1d76e9=_0x1d76e9||0xc8;return function(_0x3e1b34){if(_0x3e1b34){return _0x1ec4ad[_0xf15e('0x14')](_0x1d76e9)[_0xf15e('0x15')](_0x3e1b34);}};}function respondWithFilteredResult(_0x1cbcc3,_0x17c241){return function(_0x2d6bd7){if(_0x2d6bd7){var _0x54b94c=typeof _0x17c241[_0xf15e('0x16')]===_0xf15e('0x17')&&typeof _0x17c241['limit']===_0xf15e('0x17');var _0x4356ca=_0x2d6bd7[_0xf15e('0x18')];var _0x487018=_0x54b94c?0x0:_0x17c241['offset'];var _0x3ad067=_0x54b94c?_0x2d6bd7[_0xf15e('0x18')]:_0x17c241['offset']+_0x17c241[_0xf15e('0x19')];var _0x1f1f33;if(_0x3ad067>=_0x4356ca){_0x3ad067=_0x4356ca;_0x1f1f33=0xc8;}else{_0x1f1f33=0xce;}_0x1cbcc3[_0xf15e('0x14')](_0x1f1f33);return _0x1cbcc3['set']('Content-Range',_0x487018+'-'+_0x3ad067+'/'+_0x4356ca)[_0xf15e('0x15')](_0x2d6bd7);}return null;};}function patchUpdates(_0x3fa737){return function(_0x499658){try{jsonpatch[_0xf15e('0x1a')](_0x499658,_0x3fa737,!![]);}catch(_0x56e8c9){return BPromise['reject'](_0x56e8c9);}return _0x499658[_0xf15e('0x1b')]();};}function saveUpdates(_0x239d41,_0x389489){return function(_0x9ece34){if(_0x9ece34){return _0x9ece34['update'](_0x239d41)[_0xf15e('0x1c')](function(_0xa09c0c){return _0xa09c0c;});}return null;};}function removeEntity(_0x302b70,_0x51c06a){return function(_0x248c4b){if(_0x248c4b){return _0x248c4b[_0xf15e('0x1d')]()['then'](function(){_0x302b70['status'](0xcc)[_0xf15e('0x1e')]();});}};}function handleEntityNotFound(_0xb36af,_0x1fd237){return function(_0x471079){if(!_0x471079){_0xb36af[_0xf15e('0x13')](0x194);}return _0x471079;};}function handleError(_0x58877f,_0x48764e){_0x48764e=_0x48764e||0x1f4;return function(_0x3f9d64){logger[_0xf15e('0x1f')](_0x3f9d64['stack']);if(_0x3f9d64[_0xf15e('0x20')]){delete _0x3f9d64[_0xf15e('0x20')];}_0x58877f[_0xf15e('0x14')](_0x48764e)[_0xf15e('0x21')](_0x3f9d64);};}exports[_0xf15e('0x22')]=function(_0xff4c07,_0x1e6a63){var _0x40321a={},_0x5dd9cf={},_0x3567d5={'count':0x0,'rows':[]};var _0x17f112=_[_0xf15e('0x23')](db['WhatsappApplication'][_0xf15e('0x24')],function(_0x203711){return{'name':_0x203711['fieldName'],'type':_0x203711[_0xf15e('0x25')][_0xf15e('0x26')]};});_0x5dd9cf[_0xf15e('0x27')]=_['map'](_0x17f112,_0xf15e('0x20'));_0x5dd9cf[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0xff4c07[_0xf15e('0x28')]);_0x5dd9cf['filters']=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],_0x5dd9cf['query']);_0x40321a[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x5dd9cf[_0xf15e('0x27')],qs['fields'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2c')]));_0x40321a['attributes']=_0x40321a[_0xf15e('0x2b')]['length']?_0x40321a[_0xf15e('0x2b')]:_0x5dd9cf[_0xf15e('0x27')];if(!_0xff4c07['query']['hasOwnProperty'](_0xf15e('0x2d'))){_0x40321a[_0xf15e('0x19')]=qs['limit'](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x19')]);_0x40321a[_0xf15e('0x16')]=qs[_0xf15e('0x16')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x16')]);}_0x40321a['order']=qs[_0xf15e('0x2e')](_0xff4c07[_0xf15e('0x28')][_0xf15e('0x2e')]);_0x40321a[_0xf15e('0x2f')]=qs[_0xf15e('0x30')](_[_0xf15e('0x31')](_0xff4c07[_0xf15e('0x28')],_0x5dd9cf[_0xf15e('0x30')]),_0x17f112);if(_0xff4c07['query'][_0xf15e('0x32')]){_0x40321a['where']=_[_0xf15e('0x33')](_0x40321a[_0xf15e('0x2f')],{'$or':_[_0xf15e('0x23')](_0x17f112,function(_0x40e707){if(_0x40e707[_0xf15e('0x25')]!==_0xf15e('0x34')){var _0x4d411f={};_0x4d411f[_0x40e707[_0xf15e('0x20')]]={'$like':'%'+_0xff4c07[_0xf15e('0x28')][_0xf15e('0x32')]+'%'};return _0x4d411f;}})});}_0x40321a=_[_0xf15e('0x33')]({},_0x40321a,_0xff4c07['options']);var _0x52ebab={'where':_0x40321a[_0xf15e('0x2f')]};return db[_0xf15e('0x35')][_0xf15e('0x18')](_0x52ebab)['then'](function(_0x514c68){_0x3567d5['count']=_0x514c68;if(_0xff4c07['query']['includeAll']){_0x40321a[_0xf15e('0x36')]=[{'all':!![]}];}return db[_0xf15e('0x35')][_0xf15e('0x37')](_0x40321a);})['then'](function(_0x3a56bd){_0x3567d5['rows']=_0x3a56bd;return _0x3567d5;})[_0xf15e('0x1c')](respondWithFilteredResult(_0x1e6a63,_0x40321a))[_0xf15e('0x38')](handleError(_0x1e6a63,null));};exports[_0xf15e('0x39')]=function(_0x180d7a,_0x52bbc4){var _0xf32fc5={'raw':!![],'where':{'id':_0x180d7a[_0xf15e('0x3a')]['id']}},_0x37f0a6={};_0x37f0a6[_0xf15e('0x27')]=_[_0xf15e('0x29')](db['WhatsappApplication'][_0xf15e('0x24')]);_0x37f0a6[_0xf15e('0x28')]=_[_0xf15e('0x29')](_0x180d7a[_0xf15e('0x28')]);_0x37f0a6[_0xf15e('0x30')]=_[_0xf15e('0x2a')](_0x37f0a6[_0xf15e('0x27')],_0x37f0a6['query']);_0xf32fc5[_0xf15e('0x2b')]=_[_0xf15e('0x2a')](_0x37f0a6['model'],qs['fields'](_0x180d7a[_0xf15e('0x28')]['fields']));_0xf32fc5['attributes']=_0xf32fc5[_0xf15e('0x2b')][_0xf15e('0x3b')]?_0xf32fc5['attributes']:_0x37f0a6[_0xf15e('0x27')];if(_0x180d7a[_0xf15e('0x28')][_0xf15e('0x3c')]){_0xf32fc5[_0xf15e('0x36')]=[{'all':!![]}];}_0xf32fc5=_[_0xf15e('0x33')]({},_0xf32fc5,_0x180d7a[_0xf15e('0x3d')]);return db[_0xf15e('0x35')][_0xf15e('0x3e')](_0xf32fc5)[_0xf15e('0x1c')](handleEntityNotFound(_0x52bbc4,null))['then'](respondWithResult(_0x52bbc4,null))[_0xf15e('0x38')](handleError(_0x52bbc4,null));};exports[_0xf15e('0x3f')]=function(_0x3b79a8,_0x5b31c9){return db['WhatsappApplication'][_0xf15e('0x3f')](_0x3b79a8[_0xf15e('0x40')],{})[_0xf15e('0x1c')](respondWithResult(_0x5b31c9,0xc9))[_0xf15e('0x38')](handleError(_0x5b31c9,null));};exports[_0xf15e('0x41')]=function(_0xac7515,_0x3b5c7b){if(_0xac7515[_0xf15e('0x40')]['id']){delete _0xac7515['body']['id'];}return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0xac7515['params']['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3b5c7b,null))['then'](saveUpdates(_0xac7515[_0xf15e('0x40')],null))[_0xf15e('0x1c')](respondWithResult(_0x3b5c7b,null))[_0xf15e('0x38')](handleError(_0x3b5c7b,null));};exports['destroy']=function(_0x46e6e9,_0x3e2fd6){return db[_0xf15e('0x35')][_0xf15e('0x3e')]({'where':{'id':_0x46e6e9[_0xf15e('0x3a')]['id']}})[_0xf15e('0x1c')](handleEntityNotFound(_0x3e2fd6,null))[_0xf15e('0x1c')](removeEntity(_0x3e2fd6,null))[_0xf15e('0x38')](handleError(_0x3e2fd6,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6eae882..ea972f7 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 _0xc1c4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x5cc813,_0x388e0f){_0x5cc813=_0x5cc813-0x0;var _0x36c2a3=_0xc1c4[_0x5cc813];return _0x36c2a3;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var logger=require(_0x4c1c('0x2'))(_0x4c1c('0x3'));var moment=require(_0x4c1c('0x4'));var BPromise=require(_0x4c1c('0x5'));var rp=require(_0x4c1c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c1c('0x7'));var config=require(_0x4c1c('0x8'));var attributes=require(_0x4c1c('0x9'));module[_0x4c1c('0xa')]=function(_0x5ad905,_0xaa5184){return _0x5ad905['define']('WhatsappApplication',attributes,{'tableName':_0x4c1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c1c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeedf=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xeedf,0x12c));var _0xfeed=function(_0x55e3f4,_0xd408ac){_0x55e3f4=_0x55e3f4-0x0;var _0xac10cc=_0xeedf[_0x55e3f4];return _0xac10cc;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('WhatsappApplication',attributes,{'tableName':_0xfeed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfeed('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f5bbee3..208f5bd 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 _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x4d8c20,_0x55be0b){var _0x38b467=function(_0x142d84){while(--_0x142d84){_0x4d8c20['push'](_0x4d8c20['shift']());}};_0x38b467(++_0x55be0b);}(_0x9f62,0x154));var _0x29f6=function(_0x3e8b4c,_0x76e4ce){_0x3e8b4c=_0x3e8b4c-0x0;var _0x4b7412=_0x9f62[_0x3e8b4c];return _0x4b7412;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file +var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x55d1ac,_0x5c91c5){var _0x18459c=function(_0x524b78){while(--_0x524b78){_0x55d1ac['push'](_0x55d1ac['shift']());}};_0x18459c(++_0x5c91c5);}(_0x81bd,0x7c));var _0xd81b=function(_0xad0aaa,_0x4943c8){_0xad0aaa=_0xad0aaa-0x0;var _0x168b18=_0x81bd[_0xad0aaa];return _0x168b18;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 2f717fc..f7beb25 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 _0xb4c7=['post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','create'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2e99bc,_0x1a106d){_0x2e99bc=_0x2e99bc-0x0;var _0x34cc39=_0xb4c7[_0x2e99bc];return _0x34cc39;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0xc')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0xc')](_0x7b4c('0x12'),auth[_0x7b4c('0xa')](),controller['download']);router['post']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x14')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x15')]);router[_0x7b4c('0x14')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x18')),controller[_0x7b4c('0x19')]);router[_0x7b4c('0x1a')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')](_0x7b4c('0x1b'),_0x7b4c('0x1c')),controller['update']);router[_0x7b4c('0x1d')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x1e')),controller[_0x7b4c('0x1f')]);router[_0x7b4c('0x1d')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x20')]);module[_0x7b4c('0x21')]=router; \ No newline at end of file +var _0x11e5=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','tracked','whatsappinteraction:addtags','addTags','whatsapp','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe'];(function(_0x2e686b,_0x1cc985){var _0x156e75=function(_0x2c2c6d){while(--_0x2c2c6d){_0x2e686b['push'](_0x2e686b['shift']());}};_0x156e75(++_0x1cc985);}(_0x11e5,0x8b));var _0x511e=function(_0x5ac5e8,_0xc333d2){_0x5ac5e8=_0x5ac5e8-0x0;var _0x5eb1ff=_0x11e5[_0x5ac5e8];return _0x5eb1ff;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0x9')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0x9')](_0x511e('0xd'),auth[_0x511e('0x7')](),controller[_0x511e('0xe')]);router[_0x511e('0x9')](_0x511e('0xf'),auth['isAuthenticated'](),controller[_0x511e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x511e('0x11')]);router[_0x511e('0x12')](_0x511e('0xd'),auth[_0x511e('0x7')](),controller[_0x511e('0x13')]);router[_0x511e('0x12')]('/:id/tags',auth[_0x511e('0x7')](),interaction[_0x511e('0x14')]('whatsapp',_0x511e('0x15')),controller[_0x511e('0x16')]);router['put'](_0x511e('0xb'),auth[_0x511e('0x7')](),interaction[_0x511e('0x14')](_0x511e('0x17'),'whatsappinteraction:update'),controller[_0x511e('0x18')]);router[_0x511e('0x19')](_0x511e('0xb'),auth['isAuthenticated'](),interaction[_0x511e('0x14')]('whatsapp',_0x511e('0x1a')),controller['destroy']);router['delete'](_0x511e('0x1b'),auth['isAuthenticated'](),controller[_0x511e('0x1c')]);module[_0x511e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 3827d91..d7601a9 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 _0x1cb9=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0xacf334,_0x2473ff){var _0x384953=function(_0x268d68){while(--_0x268d68){_0xacf334['push'](_0xacf334['shift']());}};_0x384953(++_0x2473ff);}(_0x1cb9,0x14e));var _0x91cb=function(_0xeef4a1,_0x27ee43){_0xeef4a1=_0xeef4a1-0x0;var _0x4b96e7=_0x1cb9[_0xeef4a1];return _0x4b96e7;};'use strict';var Sequelize=require(_0x91cb('0x0'));var moment=require('moment');module[_0x91cb('0x1')]={'closed':{'type':Sequelize[_0x91cb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x91cb('0x3')]},'disposition':{'type':Sequelize[_0x91cb('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x91cb('0x4')]},'note':{'type':Sequelize[_0x91cb('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x91cb('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x91cb('0x5')]('in',_0x91cb('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x91cb('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x91cb('0x5')]('in',_0x91cb('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9b8e=['DATE','sequelize','exports','BOOLEAN','STRING','ENUM','out'];(function(_0x21e743,_0x5e8d88){var _0x1d6997=function(_0xa94b00){while(--_0xa94b00){_0x21e743['push'](_0x21e743['shift']());}};_0x1d6997(++_0x5e8d88);}(_0x9b8e,0x158));var _0xe9b8=function(_0x5a30e3,_0x54a54e){_0x5a30e3=_0x5a30e3-0x0;var _0x174d47=_0x9b8e[_0x5a30e3];return _0x174d47;};'use strict';var Sequelize=require(_0xe9b8('0x0'));var moment=require('moment');module[_0xe9b8('0x1')]={'closed':{'type':Sequelize[_0xe9b8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe9b8('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe9b8('0x3')]},'phone':{'type':Sequelize[_0xe9b8('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe9b8('0x4')]('in',_0xe9b8('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe9b8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xe9b8('0x4')]('in',_0xe9b8('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe9b8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 3d35a78..a0e54d0 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 _0x3e22=['model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','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','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','length','find','unreadMessages','value','`\x20=\x200','`\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','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','type','keys','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','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','i.*','c.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','WhatsappInteractionId','params','includeAll','include','options','create','body','update','describe','addMessage','WhatsappMessage','ids','omit','getMessages','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','join','files','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','disposition','existsSync','createReadStream','createWriteStream','basename','out','System','renderFile','views','transcript-','log','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','total','UserId','closed','unmanaged','index','WhatsappInteraction','rawAttributes','key'];(function(_0x8052d3,_0x3cc3bc){var _0xf01dc8=function(_0x6419bf){while(--_0x6419bf){_0x8052d3['push'](_0x8052d3['shift']());}};_0xf01dc8(++_0x3cc3bc);}(_0x3e22,0xa8));var _0x23e2=function(_0x3414ab,_0x5beee8){_0x3414ab=_0x3414ab-0x0;var _0x3fa9fb=_0x3e22[_0x3414ab];return _0x3fa9fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23e2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23e2('0x1'));var rp=require(_0x23e2('0x2'));var moment=require(_0x23e2('0x3'));var BPromise=require(_0x23e2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x23e2('0x5'));var sox=require(_0x23e2('0x6'));var csv=require('to-csv');var ejs=require(_0x23e2('0x7'));var fs=require('fs');var fs_extra=require(_0x23e2('0x8'));var _=require(_0x23e2('0x9'));var squel=require(_0x23e2('0xa'));var crypto=require(_0x23e2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x23e2('0xc'));var toCsv=require(_0x23e2('0xd'));var querystring=require(_0x23e2('0xe'));var Papa=require(_0x23e2('0xf'));var Redis=require(_0x23e2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x23e2('0x11'));var as=require(_0x23e2('0x12'));var pdf=require(_0x23e2('0x13'));var hardwareService=require(_0x23e2('0x14'));var logger=require(_0x23e2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x23e2('0x16'));var licenseUtil=require(_0x23e2('0x17'));var db=require(_0x23e2('0x18'))['db'];config[_0x23e2('0x19')]=_[_0x23e2('0x1a')](config[_0x23e2('0x19')],{'host':_0x23e2('0x1b'),'port':0x18eb});var socket=require(_0x23e2('0x1c'))(new Redis(config[_0x23e2('0x19')]));require(_0x23e2('0x1d'))[_0x23e2('0x1e')](socket);function respondWithStatusCode(_0x32f030,_0x13ca26){_0x13ca26=_0x13ca26||0xcc;return function(_0xde63db){if(_0xde63db){return _0x32f030['sendStatus'](_0x13ca26);}return _0x32f030[_0x23e2('0x1f')](_0x13ca26)[_0x23e2('0x20')]();};}function respondWithResult(_0x258d5a,_0x92f299){_0x92f299=_0x92f299||0xc8;return function(_0x276c2d){if(_0x276c2d){return _0x258d5a[_0x23e2('0x1f')](_0x92f299)[_0x23e2('0x21')](_0x276c2d);}};}function respondWithFilteredResult(_0xd15c0d,_0x3903c5){return function(_0x8f8756){if(_0x8f8756){var _0x251e52=typeof _0x3903c5[_0x23e2('0x22')]==='undefined'&&typeof _0x3903c5[_0x23e2('0x23')]===_0x23e2('0x24');var _0x51180c=_0x8f8756[_0x23e2('0x25')];var _0x5eeaab=_0x251e52?0x0:_0x3903c5[_0x23e2('0x22')];var _0x46272c=_0x251e52?_0x8f8756[_0x23e2('0x25')]:_0x3903c5[_0x23e2('0x22')]+_0x3903c5[_0x23e2('0x23')];var _0x3dcfd7;if(_0x46272c>=_0x51180c){_0x46272c=_0x51180c;_0x3dcfd7=0xc8;}else{_0x3dcfd7=0xce;}_0xd15c0d['status'](_0x3dcfd7);return _0xd15c0d[_0x23e2('0x26')](_0x23e2('0x27'),_0x5eeaab+'-'+_0x46272c+'/'+_0x51180c)[_0x23e2('0x21')](_0x8f8756);}return null;};}function patchUpdates(_0x5a099c){return function(_0x5a7539){try{jsonpatch[_0x23e2('0x28')](_0x5a7539,_0x5a099c,!![]);}catch(_0x1e8f76){return BPromise[_0x23e2('0x29')](_0x1e8f76);}return _0x5a7539['save']();};}function saveUpdates(_0x2495b9,_0x4169de){return function(_0x529f84){if(_0x529f84){return _0x529f84['update'](_0x2495b9)[_0x23e2('0x2a')](function(_0x1bb30f){return _0x1bb30f;});}return null;};}function removeEntity(_0x4813c6,_0x2a974a){return function(_0x5f29a7){if(_0x5f29a7){return _0x5f29a7[_0x23e2('0x2b')]()[_0x23e2('0x2a')](function(){_0x4813c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3d9f,_0x977c0){return function(_0x96a7e4){if(!_0x96a7e4){_0x3b3d9f[_0x23e2('0x2c')](0x194);}return _0x96a7e4;};}function handleError(_0x1d36c9,_0x564b0a){_0x564b0a=_0x564b0a||0x1f4;return function(_0x2734c5){logger[_0x23e2('0x2d')](_0x2734c5[_0x23e2('0x2e')]);if(_0x2734c5[_0x23e2('0x2f')]){delete _0x2734c5['name'];}_0x1d36c9[_0x23e2('0x1f')](_0x564b0a)[_0x23e2('0x30')](_0x2734c5);};}function getInteractionUsers(_0x46523d,_0x3004b3){return new BPromise(function(_0x1a5117,_0x26c968){try{if(_0x3004b3[_0x46523d['id']]){_0x46523d['Users']=_[_0x23e2('0x31')](_0x3004b3[_0x46523d['id']],function(_0x397458){return{'id':_0x397458['id'],'fullname':_0x397458['fullname']};});}}catch(_0x488245){_0x26c968(_0x488245);}_0x1a5117(_0x46523d);});}function getInteractionTags(_0x41455b,_0x2e88d4){return new BPromise(function(_0x96378a,_0x244959){try{if(_0x41455b[_0x23e2('0x32')]){_0x41455b[_0x23e2('0x33')]=[];_0x41455b[_0x23e2('0x32')][_0x23e2('0x34')](',')[_0x23e2('0x35')](function(_0x3f31c2){_0x41455b[_0x23e2('0x33')][_0x23e2('0x36')](_0x2e88d4[_0x3f31c2]);});}delete _0x41455b['TagIds'];}catch(_0x32fca7){_0x244959(_0x32fca7);}_0x96378a(_0x41455b);});}function updateWhatsappInteraction(_0x2ef960,_0x520d1f,_0xeffd2a){return new BPromise(function(_0x38f3cc,_0x1920db){return getInteractionUsers(_0x2ef960,_0xeffd2a)[_0x23e2('0x2a')](function(_0x74e394){return getInteractionTags(_0x74e394,_0x520d1f);})[_0x23e2('0x2a')](function(_0x1bc4c5){return getStateInteraction(_0x1bc4c5);})[_0x23e2('0x2a')](function(_0x1c0ec2){_0x38f3cc(_0x1c0ec2);})[_0x23e2('0x37')](function(_0x4063cd){_0x1920db(_0x4063cd);});});}function getStateInteraction(_0xd651c2){return new BPromise(function(_0x3393f9){_0xd651c2[_0x23e2('0x38')]=0x0;_0xd651c2[_0x23e2('0x39')]=0x0;_0xd651c2[_0x23e2('0x3a')]=0x0;_0xd651c2['unmanaged']=0x0;_0xd651c2[_0x23e2('0x3b')]=0x0;if(!_0xd651c2['closed']&&!_0xd651c2[_0x23e2('0x3c')]){_0xd651c2['waiting']+=0x1;}if(!_0xd651c2[_0x23e2('0x3d')]&&_0xd651c2[_0x23e2('0x3c')]){_0xd651c2['talking']+=0x1;if(_0xd651c2[_0x23e2('0x38')]){_0xd651c2[_0x23e2('0x38')]-=0x1;}}if(_0xd651c2[_0x23e2('0x3d')]&&_0xd651c2[_0x23e2('0x3c')]){_0xd651c2['answered']+=0x1;if(_0xd651c2[_0x23e2('0x39')]){_0xd651c2[_0x23e2('0x39')]-=0x1;}}if(_0xd651c2[_0x23e2('0x3d')]&&!_0xd651c2['UserId']){_0xd651c2[_0x23e2('0x3e')]+=0x1;if(_0xd651c2[_0x23e2('0x38')]){_0xd651c2['waiting']-=0x1;}}_0xd651c2['total']+=0x1;_0x3393f9(_0xd651c2);});}exports[_0x23e2('0x3f')]=function(_0x5033c1,_0x42196f){var _0x2c300e={},_0x43cccb={},_0x23b45d={'count':0x0,'rows':[]};var _0x3dc038=_['map'](db[_0x23e2('0x40')][_0x23e2('0x41')],function(_0x10fb48){return{'name':_0x10fb48['fieldName'],'type':_0x10fb48['type'][_0x23e2('0x42')]};});_0x43cccb[_0x23e2('0x43')]=_[_0x23e2('0x31')](_0x3dc038,_0x23e2('0x2f'));_0x43cccb[_0x23e2('0x44')]=_['keys'](_0x5033c1[_0x23e2('0x44')]);_0x43cccb[_0x23e2('0x45')]=_[_0x23e2('0x46')](_0x43cccb[_0x23e2('0x43')],_0x43cccb[_0x23e2('0x44')]);_0x2c300e[_0x23e2('0x47')]=_[_0x23e2('0x46')](_0x43cccb[_0x23e2('0x43')],qs[_0x23e2('0x48')](_0x5033c1[_0x23e2('0x44')]['fields']));_0x2c300e[_0x23e2('0x47')]=_0x2c300e['attributes']['length']?_0x2c300e[_0x23e2('0x47')]:_0x43cccb['model'];if(!_0x5033c1[_0x23e2('0x44')][_0x23e2('0x49')]('nolimit')){_0x2c300e['limit']=qs[_0x23e2('0x23')](_0x5033c1[_0x23e2('0x44')][_0x23e2('0x23')]);_0x2c300e['offset']=qs[_0x23e2('0x22')](_0x5033c1['query'][_0x23e2('0x22')]);}_0x2c300e[_0x23e2('0x4a')]=qs[_0x23e2('0x4b')](_0x5033c1[_0x23e2('0x44')][_0x23e2('0x4b')]);_0x2c300e[_0x23e2('0x4c')]=qs[_0x23e2('0x45')](_[_0x23e2('0x4d')](_0x5033c1['query'],_0x43cccb[_0x23e2('0x45')]),_0x3dc038);var _0x173bd6=[];var _0x409f49=squel[_0x23e2('0x4e')]()[_0x23e2('0x4f')]('id')[_0x23e2('0x4f')]('name')[_0x23e2('0x4f')](_0x23e2('0x50'))[_0x23e2('0x51')]('tools_tags');var _0x4439b0=squel[_0x23e2('0x4e')]()[_0x23e2('0x4f')](_0x23e2('0x52'))[_0x23e2('0x4f')](_0x23e2('0x53'))[_0x23e2('0x4f')](_0x23e2('0x54'))[_0x23e2('0x51')](_0x23e2('0x55'),'ui')[_0x23e2('0x56')](_0x23e2('0x57'),'u',_0x23e2('0x58'));var _0x3a2a0f=squel[_0x23e2('0x4e')]()[_0x23e2('0x51')](_0x23e2('0x59'),'i')['left_join'](_0x23e2('0x5a'),'c',_0x23e2('0x5b'))[_0x23e2('0x56')](_0x23e2('0x57'),'o',_0x23e2('0x5c'))[_0x23e2('0x56')](_0x23e2('0x5d'),'a',_0x23e2('0x5e'))[_0x23e2('0x56')]('whatsapp_messages','me','me.WhatsappInteractionId\x20=\x20i.id')[_0x23e2('0x56')]('whatsapp_interaction_has_tags','it',_0x23e2('0x5f'))[_0x23e2('0x56')](_0x23e2('0x60'),'t','t.id\x20=\x20it.TagId');var _0x452a0b=squel[_0x23e2('0x61')]();var _0x2212d5=[];var _0x1d3e84=squel[_0x23e2('0x61')]();var _0x1877f6;if(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x62')]){_0x1877f6=as[_0x23e2('0x63')](_0x5033c1['query']['search']);var _0x240f4c=_0x1877f6[_0x23e2('0x64')];for(var _0x288df7=0x0;_0x288df7<_0x1877f6['conditions'][_0x23e2('0x65')];_0x288df7++){var _0x53509d=_0x1877f6['conditions'][_0x288df7];var _0x322885='i';var _0xd2a6c7=_[_0x23e2('0x66')](_0x3dc038,[_0x23e2('0x2f'),_0x53509d[_0x23e2('0x4f')]]);if(!_0xd2a6c7){switch(_0x53509d[_0x23e2('0x4f')]){case _0x23e2('0x67'):if(_0x53509d[_0x23e2('0x68')]==0x1){_0x3a2a0f['having']('`'+_0x53509d[_0x23e2('0x4f')]+_0x23e2('0x69'));}else{_0x3a2a0f['having']('`'+_0x53509d[_0x23e2('0x4f')]+_0x23e2('0x6a'));}break;case _0x23e2('0x6b'):if(_0x53509d[_0x23e2('0x6c')]===_0x23e2('0x6d')){if(_0x53509d[_0x23e2('0x68')][_0x23e2('0x34')]('\x20')[_0x23e2('0x65')]>0x1){_0x452a0b[_0x240f4c](_0x23e2('0x6e'),qs[_0x23e2('0x6f')](_0x53509d['value']),null);}else{var _0xf98b29='%'+_0x53509d[_0x23e2('0x68')]+'%';_0x452a0b[_0x240f4c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xf98b29,_0xf98b29,_0xf98b29);}}else{_0xd2a6c7=_[_0x23e2('0x66')](_0x3dc038,[_0x23e2('0x2f'),_0x23e2('0x70')]);_0x53509d[_0x23e2('0x4f')]=_0x23e2('0x70');_0x117b7c=as[_0x23e2('0x71')](_0x322885,_0xd2a6c7['type'],_0x53509d);_0x452a0b[_0x240f4c](_0x117b7c[_0x23e2('0x72')],_0x117b7c[_0x23e2('0x68')][_0x23e2('0x73')],_0x117b7c[_0x23e2('0x68')][_0x23e2('0x20')]);}break;case _0x23e2('0x74'):var _0x54c319=_0x53509d[_0x23e2('0x68')]['split'](',')['map'](function(_0x47a3af){return Number(_0x47a3af);});_0x54c319[_0x23e2('0x35')](function(_0x144187){_0x1d3e84['or'](_0x23e2('0x75'),'%,'+_0x144187+',%');});_0x2212d5=_['union'](_0x2212d5,_0x54c319);break;case'User':if(_0x53509d[_0x23e2('0x6c')]==='$substring'){_0x452a0b[_0x240f4c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x53509d[_0x23e2('0x68')]+'%',null);}else{_0xd2a6c7=_['find'](_0x3dc038,[_0x23e2('0x2f'),_0x23e2('0x3c')]);_0x53509d['field']='UserId';_0x117b7c=as['buildExpression'](_0x322885,_0xd2a6c7[_0x23e2('0x76')],_0x53509d);_0x452a0b[_0x240f4c](_0x117b7c['text'],_0x117b7c[_0x23e2('0x68')][_0x23e2('0x73')],_0x117b7c[_0x23e2('0x68')]['end']);}break;case'body':_0x117b7c=as[_0x23e2('0x71')]('me',null,_0x53509d);_0x452a0b[_0x240f4c](_0x117b7c[_0x23e2('0x72')],_0x117b7c['value'][_0x23e2('0x73')],_0x117b7c[_0x23e2('0x68')][_0x23e2('0x20')]);break;}}else{var _0x117b7c=as[_0x23e2('0x71')](_0x322885,_0xd2a6c7[_0x23e2('0x76')],_0x53509d);_0x452a0b[_0x240f4c](_0x117b7c['text'],_0x117b7c['value'][_0x23e2('0x73')],_0x117b7c['value'][_0x23e2('0x20')]);}}}else{var _0x19942e=_(_0x5033c1['query'])[_0x23e2('0x77')]()['map'](function(_0xf6af3d){return _['some'](_0x3dc038,[_0x23e2('0x2f'),_0xf6af3d])?_0xf6af3d:undefined;})[_0x23e2('0x78')]()[_0x23e2('0x68')]();if(!_[_0x23e2('0x79')](_0x19942e)){_0x19942e[_0x23e2('0x35')](function(_0x31934d){if(_0x31934d===_0x23e2('0x7a')){_0x3a2a0f[_0x23e2('0x4c')](_0x23e2('0x7b'),[]['concat'](_0x5033c1[_0x23e2('0x44')][_0x31934d]));}else if(_0x31934d===_0x23e2('0x7c')){var _0x34c201=JSON['parse'](_0x5033c1[_0x23e2('0x44')][_0x31934d])[_0x23e2('0x7d')];var _0x2288a3=JSON[_0x23e2('0x7e')](_0x5033c1[_0x23e2('0x44')][_0x31934d])[_0x23e2('0x7f')];_0x3a2a0f[_0x23e2('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x34c201,_0x2288a3);}else{if(_0x5033c1[_0x23e2('0x44')][_0x31934d]===_0x23e2('0x80')){_0x3a2a0f['where']('i.'+_0x31934d+_0x23e2('0x81'));}else{_0x3a2a0f[_0x23e2('0x4c')]('i.'+_0x31934d+_0x23e2('0x82'),_0x5033c1[_0x23e2('0x44')][_0x31934d]);}}});}if(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x83')]){if(_0x5033c1[_0x23e2('0x44')]['read']==0x1){_0x3a2a0f[_0x23e2('0x84')](_0x23e2('0x85'));}else{_0x3a2a0f[_0x23e2('0x84')](_0x23e2('0x86'));}}if(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x87')]){_0x2212d5=_[_0x23e2('0x88')](_0x5033c1[_0x23e2('0x44')][_0x23e2('0x87')])?_0x5033c1[_0x23e2('0x44')][_0x23e2('0x87')]:new Array(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x87')]);_0x2212d5[_0x23e2('0x35')](function(_0x32f610){_0x1d3e84['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32f610+',%');});}if(_0x5033c1['query'][_0x23e2('0x89')]){var _0x59d548=_0x5033c1[_0x23e2('0x44')][_0x23e2('0x89')][_0x23e2('0x8a')]('\x5c','\x5c\x5c')[_0x23e2('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x59d548)){_0x452a0b['or'](_0x23e2('0x8b'),_0x59d548+'%')['or'](_0x23e2('0x8c'),_0x59d548+'%');}else{_0x452a0b['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x23e2('0x6f')](_0x59d548))['or'](_0x23e2('0x8d'),_0x59d548+'%');}}}_0x3a2a0f[_0x23e2('0x4c')](_0x452a0b);_0x3a2a0f[_0x23e2('0x8e')]('i.id');var _0x5587c7={'type':db[_0x23e2('0x8f')][_0x23e2('0x90')][_0x23e2('0x91')],'raw':!![]};var _0x32119f=_0x3a2a0f[_0x23e2('0x92')]();_0x32119f[_0x23e2('0x4f')](_0x23e2('0x93'));_0x32119f[_0x23e2('0x4f')](_0x23e2('0x94'),_0x23e2('0x67'));if(_0x2c300e[_0x23e2('0x4a')]){_0x2c300e[_0x23e2('0x4a')][_0x23e2('0x35')](function(_0x169999){var _0x26f210=_0x169999[0x0]==='contactName'?_0x169999[0x0]:'i.'+_0x169999[0x0];_0x3a2a0f['order'](_0x26f210,_0x169999[0x1]===_0x23e2('0x95')?![]:!![]);});}if(!_[_0x23e2('0x79')](_0x2212d5)){_0x3a2a0f[_0x23e2('0x84')](_0x1d3e84);_0x32119f['where']('t.id\x20IN\x20?',_0x2212d5);}BPromise[_0x23e2('0x96')]()[_0x23e2('0x2a')](function(){if(!_0x1877f6){if(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x7a')])return;_0x32119f['where'](_0x23e2('0x97'));_0x3a2a0f[_0x23e2('0x4c')](_0x23e2('0x97'));return;}if(_0x5033c1[_0x23e2('0x98')][_0x23e2('0x99')]!==_0x23e2('0x9a'))return;return _0x5033c1[_0x23e2('0x98')][_0x23e2('0x9b')]({'attributes':['id'],'raw':!![]})[_0x23e2('0x2a')](function(_0x420a17){if(_['isEmpty'](_0x420a17)){_0x32119f['where'](_0x23e2('0x9c'));_0x3a2a0f[_0x23e2('0x4c')](_0x23e2('0x9c'));}else{_0x32119f[_0x23e2('0x4c')](_0x23e2('0x7b'),_[_0x23e2('0x31')](_0x420a17,'id'));_0x3a2a0f[_0x23e2('0x4c')](_0x23e2('0x7b'),_[_0x23e2('0x31')](_0x420a17,'id'));}});})[_0x23e2('0x2a')](function(){if(_0x5033c1['user'][_0x23e2('0x99')]===_0x23e2('0x9a')&&!_0x1877f6&&!_0x5033c1[_0x23e2('0x44')][_0x23e2('0x7a')])return[];return db[_0x23e2('0x9d')]['query'](_0x32119f[_0x23e2('0x9e')](),_0x5587c7);})['then'](function(_0x5dbcf4){_0x23b45d[_0x23e2('0x25')]=_0x5dbcf4[_0x23e2('0x65')];if(_0x23b45d['count']===0x0)return[];return db['sequelize']['query'](_0x409f49[_0x23e2('0x9e')](),_0x5587c7)[_0x23e2('0x2a')](function(_0x3c6253){_0x173bd6=_['keyBy'](_0x3c6253,'id');_0x5587c7=_[_0x23e2('0x9f')](_0x5587c7,{'model':db[_0x23e2('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5033c1[_0x23e2('0x44')][_0x23e2('0x48')]){_0x2c300e[_0x23e2('0x47')][_0x23e2('0x35')](function(_0x4bde44){_0x3a2a0f['field']('i.'+_0x4bde44);});}else{_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0x94'),'unreadMessages');_0x3a2a0f[_0x23e2('0x4f')]('a.key',_0x23e2('0xa0'));_0x3a2a0f['field'](_0x23e2('0xa1'),_0x23e2('0xa2'));_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0xa3'),'contactName');_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0xa4'));_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0xa5'),'Contact.firstName');_0x3a2a0f['field']('c.lastName',_0x23e2('0xa6'));_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0xa7'),_0x23e2('0xa8'));_0x3a2a0f[_0x23e2('0x4f')]('c.phone',_0x23e2('0xa9'));_0x3a2a0f[_0x23e2('0x4f')]('c.mobile',_0x23e2('0xaa'));_0x3a2a0f[_0x23e2('0x4f')](_0x23e2('0xab'),_0x23e2('0xac'));_0x3a2a0f['field'](_0x23e2('0xad'),_0x23e2('0xae'));_0x3a2a0f[_0x23e2('0x4f')]('o.internal',_0x23e2('0xaf'));_0x3a2a0f[_0x23e2('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x23e2('0x32'));}if(_0x2c300e['limit'])_0x3a2a0f[_0x23e2('0x23')](_0x2c300e[_0x23e2('0x23')]);if(_0x2c300e[_0x23e2('0x22')])_0x3a2a0f['offset'](_0x2c300e[_0x23e2('0x22')]);return db[_0x23e2('0x9d')][_0x23e2('0x44')](_0x3a2a0f[_0x23e2('0x9e')](),_0x5587c7);})[_0x23e2('0x2a')](function(_0x10f45d){if(_0x10f45d['length']>0x0)_0x4439b0[_0x23e2('0x4c')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x23e2('0x31')](_0x10f45d,'id'));return db[_0x23e2('0x9d')][_0x23e2('0x44')](_0x4439b0[_0x23e2('0x9e')](),_0x5587c7)[_0x23e2('0x2a')](function(_0x450540){var _0xcfad8b=_['groupBy'](_0x450540,_0x23e2('0xb0'));var _0x53c2ea=[];_0x10f45d['forEach'](function(_0x4a4ec2){_0x53c2ea[_0x23e2('0x36')](updateWhatsappInteraction(_0x4a4ec2,_0x173bd6,_0xcfad8b));});return BPromise['all'](_0x53c2ea);});});})['then'](function(_0x12c999){_0x23b45d['rows']=_0x12c999;return _0x23b45d;})[_0x23e2('0x2a')](respondWithFilteredResult(_0x42196f,_0x2c300e))[_0x23e2('0x37')](handleError(_0x42196f,null));};exports['show']=function(_0x26b9c5,_0x27205d){var _0x4279c5={'raw':![],'where':{'id':_0x26b9c5[_0x23e2('0xb1')]['id']}},_0x5342ef={};_0x5342ef[_0x23e2('0x43')]=_['keys'](db[_0x23e2('0x40')]['rawAttributes']);_0x5342ef['query']=_['keys'](_0x26b9c5[_0x23e2('0x44')]);_0x5342ef['filters']=_['intersection'](_0x5342ef[_0x23e2('0x43')],_0x5342ef['query']);_0x4279c5[_0x23e2('0x47')]=_['intersection'](_0x5342ef[_0x23e2('0x43')],qs['fields'](_0x26b9c5['query'][_0x23e2('0x48')]));_0x4279c5[_0x23e2('0x47')]=_0x4279c5[_0x23e2('0x47')]['length']?_0x4279c5[_0x23e2('0x47')]:_0x5342ef[_0x23e2('0x43')];if(_0x26b9c5['query'][_0x23e2('0xb2')]){_0x4279c5[_0x23e2('0xb3')]=[{'all':!![]}];}_0x4279c5=_[_0x23e2('0x9f')]({},_0x4279c5,_0x26b9c5[_0x23e2('0xb4')]);return db[_0x23e2('0x40')]['find'](_0x4279c5)[_0x23e2('0x2a')](handleEntityNotFound(_0x27205d,null))[_0x23e2('0x2a')](respondWithResult(_0x27205d,null))['catch'](handleError(_0x27205d,null));};exports['create']=function(_0x2edc1a,_0x325af5){return db[_0x23e2('0x40')][_0x23e2('0xb5')](_0x2edc1a[_0x23e2('0xb6')],{})[_0x23e2('0x2a')](respondWithResult(_0x325af5,0xc9))['catch'](handleError(_0x325af5,null));};exports[_0x23e2('0xb7')]=function(_0xcb8e35,_0x1d6e62){if(_0xcb8e35[_0x23e2('0xb6')]['id']){delete _0xcb8e35['body']['id'];}return db['WhatsappInteraction'][_0x23e2('0x66')]({'where':{'id':_0xcb8e35[_0x23e2('0xb1')]['id']}})[_0x23e2('0x2a')](handleEntityNotFound(_0x1d6e62,null))[_0x23e2('0x2a')](saveUpdates(_0xcb8e35['body'],null))[_0x23e2('0x2a')](respondWithResult(_0x1d6e62,null))['catch'](handleError(_0x1d6e62,null));};exports[_0x23e2('0x2b')]=function(_0x3c4e09,_0x17ff7b){return db['WhatsappInteraction']['find']({'where':{'id':_0x3c4e09[_0x23e2('0xb1')]['id']}})[_0x23e2('0x2a')](handleEntityNotFound(_0x17ff7b,null))[_0x23e2('0x2a')](removeEntity(_0x17ff7b,null))[_0x23e2('0x37')](handleError(_0x17ff7b,null));};exports['describe']=function(_0x3269cb,_0x54d1f6){return db[_0x23e2('0x40')][_0x23e2('0xb8')]()[_0x23e2('0x2a')](respondWithResult(_0x54d1f6,null))['catch'](handleError(_0x54d1f6,null));};exports[_0x23e2('0xb9')]=function(_0x5acbc0,_0x3b6c39,_0x4b049e){return db[_0x23e2('0xba')][_0x23e2('0x66')]({'where':{'id':_0x5acbc0['params']['id']}})[_0x23e2('0x2a')](handleEntityNotFound(_0x3b6c39,null))[_0x23e2('0x2a')](function(_0xb9eff3){if(_0xb9eff3){return _0xb9eff3['addMessage'](_0x5acbc0[_0x23e2('0xb6')][_0x23e2('0xbb')],_[_0x23e2('0xbc')](_0x5acbc0[_0x23e2('0xb6')],[_0x23e2('0xbb'),'id'])||{});}})[_0x23e2('0x2a')](respondWithResult(_0x3b6c39,null))['catch'](handleError(_0x3b6c39,null));};exports[_0x23e2('0xbd')]=function(_0x54b05d,_0x3856db,_0x25e91f){var _0x31a1ac={'raw':![],'where':{}};var _0x62be85={};var _0x258675={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x54b05d[_0x23e2('0xb1')]['id']}})[_0x23e2('0x2a')](handleEntityNotFound(_0x3856db,null))[_0x23e2('0x2a')](function(_0x41997d){if(_0x41997d){_0x62be85[_0x23e2('0x43')]=_[_0x23e2('0x77')](db[_0x23e2('0xba')][_0x23e2('0x41')]);_0x62be85[_0x23e2('0x44')]=_[_0x23e2('0x77')](_0x54b05d['query']);_0x62be85[_0x23e2('0x45')]=_[_0x23e2('0x46')](_0x62be85[_0x23e2('0x43')],_0x62be85[_0x23e2('0x44')]);_0x31a1ac['attributes']=_[_0x23e2('0x46')](_0x62be85[_0x23e2('0x43')],qs['fields'](_0x54b05d[_0x23e2('0x44')][_0x23e2('0x48')]));_0x31a1ac[_0x23e2('0x47')]=_0x31a1ac[_0x23e2('0x47')][_0x23e2('0x65')]?_0x31a1ac['attributes']:_0x62be85[_0x23e2('0x43')];if(!_0x54b05d[_0x23e2('0x44')][_0x23e2('0x49')](_0x23e2('0xbe'))){_0x31a1ac[_0x23e2('0x23')]=qs['limit'](_0x54b05d[_0x23e2('0x44')][_0x23e2('0x23')]);_0x31a1ac[_0x23e2('0x22')]=qs[_0x23e2('0x22')](_0x54b05d['query']['offset']);}_0x31a1ac[_0x23e2('0x4a')]=qs['sort'](_0x54b05d[_0x23e2('0x44')][_0x23e2('0x4b')]);_0x31a1ac[_0x23e2('0x4c')]=qs['filters'](_[_0x23e2('0x4d')](_0x54b05d[_0x23e2('0x44')],_0x62be85[_0x23e2('0x45')]));_0x31a1ac['where'][_0x23e2('0xb0')]=_0x41997d['id'];if(_0x54b05d[_0x23e2('0x44')][_0x23e2('0x89')]){_0x31a1ac[_0x23e2('0x4c')]=_[_0x23e2('0x9f')](_0x31a1ac[_0x23e2('0x4c')],{'$or':_[_0x23e2('0x31')](_0x31a1ac['attributes'],function(_0xdf034){var _0x471ef2={};_0x471ef2[_0xdf034]={'$like':'%'+_0x54b05d[_0x23e2('0x44')][_0x23e2('0x89')]+'%'};return _0x471ef2;})});}if(_0x54b05d[_0x23e2('0x44')][_0x23e2('0x7d')]){var _0x58e8a0=_0x54b05d[_0x23e2('0x44')][_0x23e2('0x7d')][_0x23e2('0x34')](',');var _0x383473={};_0x383473[_0x58e8a0[0x0]]={'$gte':moment(_0x58e8a0[0x1])[_0x23e2('0xbf')](_0x23e2('0xc0'))};_0x31a1ac[_0x23e2('0x4c')]=_[_0x23e2('0x9f')](_0x31a1ac[_0x23e2('0x4c')],_0x383473);}_0x31a1ac=_[_0x23e2('0x9f')]({},_0x31a1ac,_0x54b05d['options']);return db[_0x23e2('0xba')][_0x23e2('0x25')]({'where':_0x31a1ac['where']})[_0x23e2('0x2a')](function(_0xbadc49){_0x258675[_0x23e2('0x25')]=_0xbadc49;if(_0x54b05d[_0x23e2('0x44')][_0x23e2('0xb2')]){_0x31a1ac['include']=[{'all':!![]}];}return db[_0x23e2('0xba')]['findAll'](_0x31a1ac);})[_0x23e2('0x2a')](function(_0x2e506b){_0x258675[_0x23e2('0xc1')]=_0x2e506b;return _0x258675;});}})['then'](respondWithFilteredResult(_0x3856db,_0x31a1ac))[_0x23e2('0x37')](handleError(_0x3856db,null));};exports['addTags']=function(_0x4eda69,_0x578253,_0x4f18df){return db[_0x23e2('0x40')]['find']({'where':{'id':_0x4eda69[_0x23e2('0xb1')]['id']}})[_0x23e2('0x2a')](handleEntityNotFound(_0x578253,null))[_0x23e2('0x2a')](function(_0x5a5edf){if(_0x5a5edf){return _0x5a5edf[_0x23e2('0xc2')](_0x4eda69[_0x23e2('0xb6')][_0x23e2('0xbb')],_[_0x23e2('0xbc')](_0x4eda69['body'],['ids','id'])||{})[_0x23e2('0xc3')](function(){return db[_0x23e2('0x74')][_0x23e2('0xc4')]({'attributes':['id',_0x23e2('0x2f'),_0x23e2('0x50')],'where':{'id':_0x4eda69[_0x23e2('0xb6')]['ids']}});})['then'](function(_0x38f311){socket[_0x23e2('0xc5')](_0x23e2('0xc6'),{'id':Number(_0x4eda69[_0x23e2('0xb1')]['id']),'tags':_0x38f311||[]});return{'id':Number(_0x4eda69[_0x23e2('0xb1')]['id']),'tags':_0x38f311||[]};});}})[_0x23e2('0x2a')](respondWithResult(_0x578253,null))['catch'](handleError(_0x578253,null));};exports['removeTags']=function(_0x13626e,_0x1a9a58,_0x2169c8){return db[_0x23e2('0x40')][_0x23e2('0x66')]({'where':{'id':_0x13626e[_0x23e2('0xb1')]['id']}})['then'](handleEntityNotFound(_0x1a9a58,null))[_0x23e2('0x2a')](function(_0x4d4475){if(_0x4d4475){return _0x4d4475[_0x23e2('0xc7')](_0x13626e[_0x23e2('0x44')]['ids']);}})[_0x23e2('0x2a')](respondWithStatusCode(_0x1a9a58,null))[_0x23e2('0x37')](handleError(_0x1a9a58,null));};exports[_0x23e2('0xc8')]=function(_0x3b09bb,_0x248a09){var _0x45a4dc=moment()[_0x23e2('0xc9')]()[_0x23e2('0x9e')]();var _0x5c183e=path['join'](config[_0x23e2('0xca')],_0x23e2('0xcb'),'files','tmp');var _0x530036=path[_0x23e2('0xcc')](config[_0x23e2('0xca')],_0x23e2('0xcb'),_0x23e2('0xcd'),_0x23e2('0xce'));var _0x5b1ab3=path[_0x23e2('0xcc')](_0x5c183e,_0x45a4dc);var _0x382be5=util[_0x23e2('0xbf')](_0x23e2('0xcf'),_0x3b09bb[_0x23e2('0xb1')]['id'],_0x45a4dc);var _0x40a68d=path['join'](_0x5c183e,_0x382be5);var _0x5b5ad7=[];_0x5b5ad7[_0x23e2('0x36')]({'model':db[_0x23e2('0xd0')],'as':'User','attributes':['id',_0x23e2('0xd1')],'raw':!![]});_0x5b5ad7[_0x23e2('0x36')]({'model':db[_0x23e2('0xd2')],'as':'Contact','attributes':['id',_0x23e2('0xd3'),_0x23e2('0xd4')],'raw':!![]});if(_0x3b09bb['query']['attachments']){_0x5b5ad7[_0x23e2('0x36')]({'model':db[_0x23e2('0xd5')],'as':_0x23e2('0xd5'),'raw':!![]});}var _0x5831bd=[{'model':db['WhatsappMessage'],'as':_0x23e2('0xd6'),'attributes':['id',_0x23e2('0xb6'),_0x23e2('0x7c'),_0x23e2('0xd7'),_0x23e2('0xd8'),_0x23e2('0x83')],'include':_0x5b5ad7}];_0x5831bd[_0x23e2('0x36')]({'model':db[_0x23e2('0xd9')],'as':_0x23e2('0xda'),'attributes':['id',_0x23e2('0x2f')]});_0x5831bd[_0x23e2('0x36')]({'model':db[_0x23e2('0xd0')],'as':_0x23e2('0xdb'),'attributes':['id','fullname']});return db['WhatsappInteraction']['find']({'where':{'id':_0x3b09bb[_0x23e2('0xb1')]['id']},'include':_0x5831bd})[_0x23e2('0x2a')](handleEntityNotFound(_0x248a09,null))[_0x23e2('0x2a')](function(_0xa9f984){if(_0xa9f984){var _0xdfe5c8=_0xa9f984['get']({'plain':!![]});fs[_0x23e2('0xdc')](_0x5b1ab3);var _0x1ca150={'channel':_0x23e2('0xdd'),'account':_0xdfe5c8[_0x23e2('0xda')][_0x23e2('0x2f')],'agent':_0xdfe5c8[_0x23e2('0xdb')]?_0xdfe5c8['Owner'][_0x23e2('0xd1')]:_0x23e2('0xde'),'createdAt':moment(_0xdfe5c8[_0x23e2('0x7c')])[_0x23e2('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x23e2('0x9e')](),'closedAt':_0xdfe5c8['closed']?moment(_0xdfe5c8['closedAt'])['format'](_0x23e2('0xc0'))[_0x23e2('0x9e')]():'','disposition':_0xdfe5c8[_0x23e2('0xdf')],'messages':_(_0xdfe5c8[_0x23e2('0xd6')])[_0x23e2('0x89')]({'secret':![]})[_0x23e2('0x31')](function(_0x5e572c){if(_0x5e572c['Attachment']){var _0x2d3ec0=path[_0x23e2('0xcc')](_0x530036,_0x5e572c[_0x23e2('0xd5')]['basename']);if(fs[_0x23e2('0xe0')](_0x2d3ec0)){fs[_0x23e2('0xe1')](_0x2d3ec0)['pipe'](fs[_0x23e2('0xe2')](path[_0x23e2('0xcc')](_0x5b1ab3,_0x5e572c[_0x23e2('0xd5')][_0x23e2('0xe3')])));}}return{'date':moment(_0x5e572c[_0x23e2('0x7c')])['format'](_0x23e2('0xc0'))[_0x23e2('0x9e')](),'sender':_0x5e572c[_0x23e2('0xd7')]===_0x23e2('0xe4')?_0x5e572c['User']?_0x5e572c[_0x23e2('0xd0')][_0x23e2('0xd1')]:_0x23e2('0xe5'):_0x5e572c[_0x23e2('0x6b')][_0x23e2('0xd3')]+(_0x5e572c[_0x23e2('0x6b')]['lastName']?'\x20'+_0x5e572c[_0x23e2('0x6b')][_0x23e2('0xd4')]:''),'body':_0x5e572c[_0x23e2('0xd5')]?_0x5e572c[_0x23e2('0xd5')][_0x23e2('0xe3')]:_0x5e572c[_0x23e2('0xb6')],'direction':_0x5e572c['direction']===_0x23e2('0xe4')?'A':'C','secret':_0x5e572c[_0x23e2('0xd8')],'read':_0x5e572c[_0x23e2('0x83')],'attachment':_0x5e572c[_0x23e2('0xd5')]};})[_0x23e2('0x68')]()};return ejs[_0x23e2('0xe6')](path[_0x23e2('0xcc')](config['root'],_0x23e2('0xcb'),_0x23e2('0xe7'),'downloadInteraction.ejs'),{'interaction':_0x1ca150})[_0x23e2('0x2a')](function(_0x52b654){var _0x1e56cc=path[_0x23e2('0xcc')](_0x5b1ab3,_0x23e2('0xe8')+_0xdfe5c8['id']+'-'+_0x45a4dc+'.pdf');var _0x25adc7={'path':_0x1e56cc,'channel':_0x23e2('0xdd'),'interactionId':_0xdfe5c8['id']};return pdf['createPdfFromHTML'](_0x52b654,_0x25adc7);})[_0x23e2('0x2a')](function(){return new BPromise(function(_0x4aefd1,_0x2feab7){zipdir(_0x5b1ab3,{'saveTo':_0x40a68d},function(_0x16d560,_0x14d43d){if(_0x16d560)return _0x2feab7(_0x16d560);return _0x4aefd1(_0x14d43d);});})[_0x23e2('0x2a')](function(){return new BPromise(function(_0x181a1d,_0x5710b2){rimraf(_0x5b1ab3,function(_0x341636){if(_0x341636)_0x5710b2(_0x341636);return _0x181a1d();});});})['then'](function(){return _0x248a09[_0x23e2('0xc8')](_0x40a68d,_0x382be5,function(_0x16e069){if(_0x16e069){console[_0x23e2('0xe9')]('err',_0x16e069);}else{fs[_0x23e2('0xea')](_0x40a68d);}});});});}else{return _0x248a09['sendStatus'](0xc8);}})['catch'](handleError(_0x248a09,null));}; \ No newline at end of file +var _0xcabe=['createWriteStream','basename','out','lastName','direction','read','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','Users','map','fullname','Tags','push','TagIds','catch','waiting','talking','answered','total','closed','UserId','unmanaged','index','WhatsappInteraction','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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','find','ContactId','buildExpression','text','start','end','Tag','forEach','union','User','body','keys','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','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','QueryTypes','SELECT','clone','i.id','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','keyBy','merge','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','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','toString','all','params','rawAttributes','include','options','create','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','WhatsappInteractionId','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','firstName','Attachment','Messages','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','existsSync','createReadStream'];(function(_0x3dcb32,_0x28c7fd){var _0x2ce602=function(_0x3012e3){while(--_0x3012e3){_0x3dcb32['push'](_0x3dcb32['shift']());}};_0x2ce602(++_0x28c7fd);}(_0xcabe,0x1ef));var _0xecab=function(_0x3b0500,_0x520f96){_0x3b0500=_0x3b0500-0x0;var _0x290354=_0xcabe[_0x3b0500];return _0x290354;};'use strict';var emlformat=require(_0xecab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecab('0x1'));var jsonpatch=require(_0xecab('0x2'));var rp=require('request-promise');var moment=require(_0xecab('0x3'));var BPromise=require(_0xecab('0x4'));var Mustache=require('mustache');var util=require(_0xecab('0x5'));var path=require(_0xecab('0x6'));var sox=require(_0xecab('0x7'));var csv=require('to-csv');var ejs=require(_0xecab('0x8'));var fs=require('fs');var fs_extra=require(_0xecab('0x9'));var _=require(_0xecab('0xa'));var squel=require(_0xecab('0xb'));var crypto=require(_0xecab('0xc'));var jsforce=require(_0xecab('0xd'));var deskjs=require(_0xecab('0xe'));var toCsv=require(_0xecab('0xf'));var querystring=require(_0xecab('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecab('0x11'));var qs=require(_0xecab('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xecab('0x13'));var hardwareService=require(_0xecab('0x14'));var logger=require(_0xecab('0x15'))(_0xecab('0x16'));var utils=require(_0xecab('0x17'));var config=require(_0xecab('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xecab('0x19'))['db'];config[_0xecab('0x1a')]=_[_0xecab('0x1b')](config[_0xecab('0x1a')],{'host':_0xecab('0x1c'),'port':0x18eb});var socket=require(_0xecab('0x1d'))(new Redis(config['redis']));require(_0xecab('0x1e'))['register'](socket);function respondWithStatusCode(_0x4bfc49,_0xfe0f2d){_0xfe0f2d=_0xfe0f2d||0xcc;return function(_0x3af1a6){if(_0x3af1a6){return _0x4bfc49[_0xecab('0x1f')](_0xfe0f2d);}return _0x4bfc49[_0xecab('0x20')](_0xfe0f2d)['end']();};}function respondWithResult(_0x35feb8,_0x1c5871){_0x1c5871=_0x1c5871||0xc8;return function(_0x260a09){if(_0x260a09){return _0x35feb8[_0xecab('0x20')](_0x1c5871)[_0xecab('0x21')](_0x260a09);}};}function respondWithFilteredResult(_0x55280a,_0x267bf6){return function(_0x447f3d){if(_0x447f3d){var _0x5e7e5e=typeof _0x267bf6[_0xecab('0x22')]===_0xecab('0x23')&&typeof _0x267bf6[_0xecab('0x24')]===_0xecab('0x23');var _0x1f71eb=_0x447f3d[_0xecab('0x25')];var _0x4a450c=_0x5e7e5e?0x0:_0x267bf6[_0xecab('0x22')];var _0x2ec6fb=_0x5e7e5e?_0x447f3d[_0xecab('0x25')]:_0x267bf6['offset']+_0x267bf6[_0xecab('0x24')];var _0x54138e;if(_0x2ec6fb>=_0x1f71eb){_0x2ec6fb=_0x1f71eb;_0x54138e=0xc8;}else{_0x54138e=0xce;}_0x55280a[_0xecab('0x20')](_0x54138e);return _0x55280a['set'](_0xecab('0x26'),_0x4a450c+'-'+_0x2ec6fb+'/'+_0x1f71eb)[_0xecab('0x21')](_0x447f3d);}return null;};}function patchUpdates(_0xe61b4f){return function(_0x39605c){try{jsonpatch[_0xecab('0x27')](_0x39605c,_0xe61b4f,!![]);}catch(_0x18405d){return BPromise[_0xecab('0x28')](_0x18405d);}return _0x39605c[_0xecab('0x29')]();};}function saveUpdates(_0x3c701e,_0x365592){return function(_0x30191f){if(_0x30191f){return _0x30191f[_0xecab('0x2a')](_0x3c701e)['then'](function(_0x1fcc46){return _0x1fcc46;});}return null;};}function removeEntity(_0x4a6240,_0x248aba){return function(_0x3b9822){if(_0x3b9822){return _0x3b9822['destroy']()[_0xecab('0x2b')](function(){_0x4a6240['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d6a57,_0xe97566){return function(_0x974659){if(!_0x974659){_0x2d6a57[_0xecab('0x1f')](0x194);}return _0x974659;};}function handleError(_0x34ded8,_0x30ca35){_0x30ca35=_0x30ca35||0x1f4;return function(_0x36c1c1){logger['error'](_0x36c1c1['stack']);if(_0x36c1c1[_0xecab('0x2c')]){delete _0x36c1c1[_0xecab('0x2c')];}_0x34ded8[_0xecab('0x20')](_0x30ca35)[_0xecab('0x2d')](_0x36c1c1);};}function getInteractionUsers(_0x1ef5fe,_0x2e47fd){return new BPromise(function(_0x51d4b9,_0x5501e9){try{if(_0x2e47fd[_0x1ef5fe['id']]){_0x1ef5fe[_0xecab('0x2e')]=_[_0xecab('0x2f')](_0x2e47fd[_0x1ef5fe['id']],function(_0x1cdc69){return{'id':_0x1cdc69['id'],'fullname':_0x1cdc69[_0xecab('0x30')]};});}}catch(_0x2e59d1){_0x5501e9(_0x2e59d1);}_0x51d4b9(_0x1ef5fe);});}function getInteractionTags(_0x3197f9,_0x32955f){return new BPromise(function(_0x2a4661,_0x139a64){try{if(_0x3197f9['TagIds']){_0x3197f9['Tags']=[];_0x3197f9['TagIds']['split'](',')['forEach'](function(_0x32d4bb){_0x3197f9[_0xecab('0x31')][_0xecab('0x32')](_0x32955f[_0x32d4bb]);});}delete _0x3197f9[_0xecab('0x33')];}catch(_0x475a3b){_0x139a64(_0x475a3b);}_0x2a4661(_0x3197f9);});}function updateWhatsappInteraction(_0x35b061,_0x29e3c8,_0x3f30b9){return new BPromise(function(_0x469e10,_0xa151df){return getInteractionUsers(_0x35b061,_0x3f30b9)['then'](function(_0x35b944){return getInteractionTags(_0x35b944,_0x29e3c8);})['then'](function(_0x543ea8){return getStateInteraction(_0x543ea8);})[_0xecab('0x2b')](function(_0x5a719d){_0x469e10(_0x5a719d);})[_0xecab('0x34')](function(_0x225151){_0xa151df(_0x225151);});});}function getStateInteraction(_0x5c12b7){return new BPromise(function(_0xafde3f){_0x5c12b7[_0xecab('0x35')]=0x0;_0x5c12b7[_0xecab('0x36')]=0x0;_0x5c12b7[_0xecab('0x37')]=0x0;_0x5c12b7['unmanaged']=0x0;_0x5c12b7[_0xecab('0x38')]=0x0;if(!_0x5c12b7[_0xecab('0x39')]&&!_0x5c12b7[_0xecab('0x3a')]){_0x5c12b7['waiting']+=0x1;}if(!_0x5c12b7[_0xecab('0x39')]&&_0x5c12b7[_0xecab('0x3a')]){_0x5c12b7['talking']+=0x1;if(_0x5c12b7[_0xecab('0x35')]){_0x5c12b7[_0xecab('0x35')]-=0x1;}}if(_0x5c12b7[_0xecab('0x39')]&&_0x5c12b7['UserId']){_0x5c12b7['answered']+=0x1;if(_0x5c12b7['talking']){_0x5c12b7[_0xecab('0x36')]-=0x1;}}if(_0x5c12b7[_0xecab('0x39')]&&!_0x5c12b7[_0xecab('0x3a')]){_0x5c12b7[_0xecab('0x3b')]+=0x1;if(_0x5c12b7[_0xecab('0x35')]){_0x5c12b7[_0xecab('0x35')]-=0x1;}}_0x5c12b7[_0xecab('0x38')]+=0x1;_0xafde3f(_0x5c12b7);});}exports[_0xecab('0x3c')]=function(_0x4a8116,_0x978283){var _0x57e402={},_0x4af5d2={},_0x5e0bcf={'count':0x0,'rows':[]};var _0x566a5f=_[_0xecab('0x2f')](db[_0xecab('0x3d')]['rawAttributes'],function(_0x1b6b98){return{'name':_0x1b6b98[_0xecab('0x3e')],'type':_0x1b6b98[_0xecab('0x3f')][_0xecab('0x40')]};});_0x4af5d2[_0xecab('0x41')]=_[_0xecab('0x2f')](_0x566a5f,_0xecab('0x2c'));_0x4af5d2[_0xecab('0x42')]=_['keys'](_0x4a8116[_0xecab('0x42')]);_0x4af5d2[_0xecab('0x43')]=_[_0xecab('0x44')](_0x4af5d2[_0xecab('0x41')],_0x4af5d2[_0xecab('0x42')]);_0x57e402[_0xecab('0x45')]=_['intersection'](_0x4af5d2['model'],qs[_0xecab('0x46')](_0x4a8116[_0xecab('0x42')]['fields']));_0x57e402['attributes']=_0x57e402[_0xecab('0x45')][_0xecab('0x47')]?_0x57e402[_0xecab('0x45')]:_0x4af5d2['model'];if(!_0x4a8116[_0xecab('0x42')][_0xecab('0x48')](_0xecab('0x49'))){_0x57e402['limit']=qs[_0xecab('0x24')](_0x4a8116[_0xecab('0x42')][_0xecab('0x24')]);_0x57e402['offset']=qs[_0xecab('0x22')](_0x4a8116[_0xecab('0x42')][_0xecab('0x22')]);}_0x57e402[_0xecab('0x4a')]=qs[_0xecab('0x4b')](_0x4a8116[_0xecab('0x42')][_0xecab('0x4b')]);_0x57e402[_0xecab('0x4c')]=qs['filters'](_[_0xecab('0x4d')](_0x4a8116[_0xecab('0x42')],_0x4af5d2[_0xecab('0x43')]),_0x566a5f);var _0x1b8a3e=[];var _0x54053a=squel['select']()['field']('id')[_0xecab('0x4e')](_0xecab('0x2c'))[_0xecab('0x4e')](_0xecab('0x4f'))[_0xecab('0x50')](_0xecab('0x51'));var _0x5823c6=squel[_0xecab('0x52')]()[_0xecab('0x4e')](_0xecab('0x53'))[_0xecab('0x4e')](_0xecab('0x54'))[_0xecab('0x4e')](_0xecab('0x55'))[_0xecab('0x50')]('user_has_whatsapp_interactions','ui')[_0xecab('0x56')](_0xecab('0x57'),'u',_0xecab('0x58'));var _0x212678=squel['select']()[_0xecab('0x50')](_0xecab('0x59'),'i')[_0xecab('0x56')](_0xecab('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xecab('0x56')](_0xecab('0x57'),'o',_0xecab('0x5b'))[_0xecab('0x56')]('whatsapp_accounts','a',_0xecab('0x5c'))[_0xecab('0x56')](_0xecab('0x5d'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0xecab('0x5e'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0xecab('0x51'),'t',_0xecab('0x5f'));var _0x138eca=squel[_0xecab('0x60')]();var _0x3dce74=[];var _0x2799a0=squel[_0xecab('0x60')]();var _0x59742a;if(_0x4a8116[_0xecab('0x42')][_0xecab('0x61')]){_0x59742a=as[_0xecab('0x62')](_0x4a8116['query'][_0xecab('0x61')]);var _0x1518a0=_0x59742a[_0xecab('0x63')];for(var _0x28d250=0x0;_0x28d250<_0x59742a[_0xecab('0x64')][_0xecab('0x47')];_0x28d250++){var _0x328eec=_0x59742a[_0xecab('0x64')][_0x28d250];var _0x2ae323='i';var _0x28a699=_['find'](_0x566a5f,[_0xecab('0x2c'),_0x328eec[_0xecab('0x4e')]]);if(!_0x28a699){switch(_0x328eec[_0xecab('0x4e')]){case'unreadMessages':if(_0x328eec[_0xecab('0x65')]==0x1){_0x212678[_0xecab('0x66')]('`'+_0x328eec[_0xecab('0x4e')]+_0xecab('0x67'));}else{_0x212678[_0xecab('0x66')]('`'+_0x328eec[_0xecab('0x4e')]+_0xecab('0x68'));}break;case _0xecab('0x69'):if(_0x328eec[_0xecab('0x6a')]===_0xecab('0x6b')){if(_0x328eec[_0xecab('0x65')][_0xecab('0x6c')]('\x20')['length']>0x1){_0x138eca[_0x1518a0](_0xecab('0x6d'),qs[_0xecab('0x6e')](_0x328eec[_0xecab('0x65')]),null);}else{var _0x4e1b32='%'+_0x328eec[_0xecab('0x65')]+'%';_0x138eca[_0x1518a0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4e1b32,_0x4e1b32,_0x4e1b32);}}else{_0x28a699=_[_0xecab('0x6f')](_0x566a5f,[_0xecab('0x2c'),_0xecab('0x70')]);_0x328eec[_0xecab('0x4e')]=_0xecab('0x70');_0x59cd1b=as[_0xecab('0x71')](_0x2ae323,_0x28a699[_0xecab('0x3f')],_0x328eec);_0x138eca[_0x1518a0](_0x59cd1b[_0xecab('0x72')],_0x59cd1b[_0xecab('0x65')][_0xecab('0x73')],_0x59cd1b[_0xecab('0x65')][_0xecab('0x74')]);}break;case _0xecab('0x75'):var _0x118113=_0x328eec[_0xecab('0x65')][_0xecab('0x6c')](',')[_0xecab('0x2f')](function(_0x2b908d){return Number(_0x2b908d);});_0x118113[_0xecab('0x76')](function(_0x5870a1){_0x2799a0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5870a1+',%');});_0x3dce74=_[_0xecab('0x77')](_0x3dce74,_0x118113);break;case _0xecab('0x78'):if(_0x328eec[_0xecab('0x6a')]===_0xecab('0x6b')){_0x138eca[_0x1518a0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x328eec['value']+'%',null);}else{_0x28a699=_[_0xecab('0x6f')](_0x566a5f,[_0xecab('0x2c'),_0xecab('0x3a')]);_0x328eec['field']='UserId';_0x59cd1b=as[_0xecab('0x71')](_0x2ae323,_0x28a699[_0xecab('0x3f')],_0x328eec);_0x138eca[_0x1518a0](_0x59cd1b[_0xecab('0x72')],_0x59cd1b['value'][_0xecab('0x73')],_0x59cd1b[_0xecab('0x65')][_0xecab('0x74')]);}break;case _0xecab('0x79'):_0x59cd1b=as[_0xecab('0x71')]('me',null,_0x328eec);_0x138eca[_0x1518a0](_0x59cd1b['text'],_0x59cd1b[_0xecab('0x65')][_0xecab('0x73')],_0x59cd1b[_0xecab('0x65')]['end']);break;}}else{var _0x59cd1b=as[_0xecab('0x71')](_0x2ae323,_0x28a699['type'],_0x328eec);_0x138eca[_0x1518a0](_0x59cd1b[_0xecab('0x72')],_0x59cd1b[_0xecab('0x65')]['start'],_0x59cd1b[_0xecab('0x65')][_0xecab('0x74')]);}}}else{var _0x47c115=_(_0x4a8116[_0xecab('0x42')])[_0xecab('0x7a')]()[_0xecab('0x2f')](function(_0x3b921a){return _['some'](_0x566a5f,[_0xecab('0x2c'),_0x3b921a])?_0x3b921a:undefined;})[_0xecab('0x7b')]()[_0xecab('0x65')]();if(!_['isEmpty'](_0x47c115)){_0x47c115[_0xecab('0x76')](function(_0x356c35){if(_0x356c35===_0xecab('0x7c')){_0x212678[_0xecab('0x4c')](_0xecab('0x7d'),[][_0xecab('0x7e')](_0x4a8116[_0xecab('0x42')][_0x356c35]));}else if(_0x356c35===_0xecab('0x7f')){var _0x30ccf4=JSON[_0xecab('0x80')](_0x4a8116[_0xecab('0x42')][_0x356c35])[_0xecab('0x81')];var _0x14d2d5=JSON[_0xecab('0x80')](_0x4a8116[_0xecab('0x42')][_0x356c35])[_0xecab('0x82')];_0x212678[_0xecab('0x4c')](_0xecab('0x83'),_0x30ccf4,_0x14d2d5);}else{if(_0x4a8116[_0xecab('0x42')][_0x356c35]===_0xecab('0x84')){_0x212678[_0xecab('0x4c')]('i.'+_0x356c35+_0xecab('0x85'));}else{_0x212678['where']('i.'+_0x356c35+_0xecab('0x86'),_0x4a8116[_0xecab('0x42')][_0x356c35]);}}});}if(_0x4a8116[_0xecab('0x42')]['read']){if(_0x4a8116[_0xecab('0x42')]['read']==0x1){_0x212678[_0xecab('0x66')]('`unreadMessages`\x20=\x200');}else{_0x212678[_0xecab('0x66')](_0xecab('0x87'));}}if(_0x4a8116[_0xecab('0x42')][_0xecab('0x88')]){_0x3dce74=_[_0xecab('0x89')](_0x4a8116[_0xecab('0x42')][_0xecab('0x88')])?_0x4a8116[_0xecab('0x42')][_0xecab('0x88')]:new Array(_0x4a8116[_0xecab('0x42')][_0xecab('0x88')]);_0x3dce74[_0xecab('0x76')](function(_0x5eb35c){_0x2799a0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5eb35c+',%');});}if(_0x4a8116[_0xecab('0x42')][_0xecab('0x8a')]){var _0x177e74=_0x4a8116[_0xecab('0x42')][_0xecab('0x8a')][_0xecab('0x8b')]('\x5c','\x5c\x5c')[_0xecab('0x8b')](/'/g,'\x27\x27');if(qs[_0xecab('0x8c')](_0x177e74)){_0x138eca['or']('i.id\x20LIKE\x20?',_0x177e74+'%')['or'](_0xecab('0x8d'),_0x177e74+'%');}else{_0x138eca['or'](_0xecab('0x8e'),qs[_0xecab('0x6e')](_0x177e74))['or'](_0xecab('0x8f'),_0x177e74+'%');}}}_0x212678[_0xecab('0x4c')](_0x138eca);_0x212678[_0xecab('0x90')]('i.id');var _0x165fd4={'type':db['Sequelize'][_0xecab('0x91')][_0xecab('0x92')],'raw':!![]};var _0x364738=_0x212678[_0xecab('0x93')]();_0x364738[_0xecab('0x4e')](_0xecab('0x94'));_0x364738['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xecab('0x95'));if(_0x57e402[_0xecab('0x4a')]){_0x57e402[_0xecab('0x4a')][_0xecab('0x76')](function(_0x289e14){var _0x1479b5=_0x289e14[0x0]===_0xecab('0x96')?_0x289e14[0x0]:'i.'+_0x289e14[0x0];_0x212678['order'](_0x1479b5,_0x289e14[0x1]===_0xecab('0x97')?![]:!![]);});}if(!_[_0xecab('0x98')](_0x3dce74)){_0x212678[_0xecab('0x66')](_0x2799a0);_0x364738[_0xecab('0x4c')](_0xecab('0x99'),_0x3dce74);}BPromise['resolve']()[_0xecab('0x2b')](function(){if(!_0x59742a){if(_0x4a8116[_0xecab('0x42')][_0xecab('0x7c')])return;_0x364738[_0xecab('0x4c')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x212678[_0xecab('0x4c')](_0xecab('0x9a'));return;}if(_0x4a8116['user'][_0xecab('0x9b')]!==_0xecab('0x9c'))return;return _0x4a8116[_0xecab('0x9d')][_0xecab('0x9e')]({'attributes':['id'],'raw':!![]})[_0xecab('0x2b')](function(_0x245216){if(_['isEmpty'](_0x245216)){_0x364738[_0xecab('0x4c')](_0xecab('0x9f'));_0x212678[_0xecab('0x4c')](_0xecab('0x9f'));}else{_0x364738[_0xecab('0x4c')](_0xecab('0x7d'),_['map'](_0x245216,'id'));_0x212678[_0xecab('0x4c')](_0xecab('0x7d'),_[_0xecab('0x2f')](_0x245216,'id'));}});})[_0xecab('0x2b')](function(){if(_0x4a8116[_0xecab('0x9d')][_0xecab('0x9b')]===_0xecab('0x9c')&&!_0x59742a&&!_0x4a8116[_0xecab('0x42')][_0xecab('0x7c')])return[];return db['sequelize'][_0xecab('0x42')](_0x364738['toString'](),_0x165fd4);})['then'](function(_0x1959ef){_0x5e0bcf[_0xecab('0x25')]=_0x1959ef['length'];if(_0x5e0bcf[_0xecab('0x25')]===0x0)return[];return db['sequelize'][_0xecab('0x42')](_0x54053a['toString'](),_0x165fd4)[_0xecab('0x2b')](function(_0x198281){_0x1b8a3e=_[_0xecab('0xa0')](_0x198281,'id');_0x165fd4=_[_0xecab('0xa1')](_0x165fd4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a8116[_0xecab('0x42')]['fields']){_0x57e402[_0xecab('0x45')][_0xecab('0x76')](function(_0x3534d4){_0x212678[_0xecab('0x4e')]('i.'+_0x3534d4);});}else{_0x212678[_0xecab('0x4e')](_0xecab('0xa2'),_0xecab('0x95'));_0x212678[_0xecab('0x4e')](_0xecab('0xa3'),_0xecab('0xa4'));_0x212678['field']('a.mandatoryDisposition',_0xecab('0xa5'));_0x212678['field'](_0xecab('0xa6'),_0xecab('0x96'));_0x212678['field']('i.*');_0x212678[_0xecab('0x4e')](_0xecab('0xa7'),_0xecab('0xa8'));_0x212678[_0xecab('0x4e')](_0xecab('0xa9'),'Contact.lastName');_0x212678[_0xecab('0x4e')](_0xecab('0xaa'),_0xecab('0xab'));_0x212678[_0xecab('0x4e')]('c.phone',_0xecab('0xac'));_0x212678[_0xecab('0x4e')](_0xecab('0xad'),'Contact.mobile');_0x212678[_0xecab('0x4e')]('c.fax',_0xecab('0xae'));_0x212678['field'](_0xecab('0xaf'),_0xecab('0xb0'));_0x212678[_0xecab('0x4e')](_0xecab('0xb1'),_0xecab('0xb2'));_0x212678['field'](_0xecab('0xb3'),_0xecab('0x33'));}if(_0x57e402['limit'])_0x212678[_0xecab('0x24')](_0x57e402[_0xecab('0x24')]);if(_0x57e402['offset'])_0x212678[_0xecab('0x22')](_0x57e402['offset']);return db[_0xecab('0xb4')][_0xecab('0x42')](_0x212678['toString'](),_0x165fd4);})[_0xecab('0x2b')](function(_0x2cd7a9){if(_0x2cd7a9[_0xecab('0x47')]>0x0)_0x5823c6[_0xecab('0x4c')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x2cd7a9,'id'));return db[_0xecab('0xb4')][_0xecab('0x42')](_0x5823c6[_0xecab('0xb5')](),_0x165fd4)[_0xecab('0x2b')](function(_0x36f417){var _0x56ac94=_['groupBy'](_0x36f417,'WhatsappInteractionId');var _0x56cb0e=[];_0x2cd7a9[_0xecab('0x76')](function(_0x9b94b2){_0x56cb0e[_0xecab('0x32')](updateWhatsappInteraction(_0x9b94b2,_0x1b8a3e,_0x56ac94));});return BPromise[_0xecab('0xb6')](_0x56cb0e);});});})[_0xecab('0x2b')](function(_0x514223){_0x5e0bcf['rows']=_0x514223;return _0x5e0bcf;})[_0xecab('0x2b')](respondWithFilteredResult(_0x978283,_0x57e402))['catch'](handleError(_0x978283,null));};exports['show']=function(_0x2f7d84,_0x51d47f){var _0x27b1a5={'raw':![],'where':{'id':_0x2f7d84[_0xecab('0xb7')]['id']}},_0x5a37cb={};_0x5a37cb['model']=_[_0xecab('0x7a')](db[_0xecab('0x3d')][_0xecab('0xb8')]);_0x5a37cb[_0xecab('0x42')]=_[_0xecab('0x7a')](_0x2f7d84[_0xecab('0x42')]);_0x5a37cb[_0xecab('0x43')]=_['intersection'](_0x5a37cb['model'],_0x5a37cb[_0xecab('0x42')]);_0x27b1a5[_0xecab('0x45')]=_[_0xecab('0x44')](_0x5a37cb['model'],qs[_0xecab('0x46')](_0x2f7d84['query']['fields']));_0x27b1a5[_0xecab('0x45')]=_0x27b1a5['attributes']['length']?_0x27b1a5['attributes']:_0x5a37cb['model'];if(_0x2f7d84[_0xecab('0x42')]['includeAll']){_0x27b1a5[_0xecab('0xb9')]=[{'all':!![]}];}_0x27b1a5=_['merge']({},_0x27b1a5,_0x2f7d84[_0xecab('0xba')]);return db[_0xecab('0x3d')][_0xecab('0x6f')](_0x27b1a5)[_0xecab('0x2b')](handleEntityNotFound(_0x51d47f,null))[_0xecab('0x2b')](respondWithResult(_0x51d47f,null))['catch'](handleError(_0x51d47f,null));};exports[_0xecab('0xbb')]=function(_0x358759,_0x1c7b32){return db[_0xecab('0x3d')][_0xecab('0xbb')](_0x358759['body'],{})[_0xecab('0x2b')](respondWithResult(_0x1c7b32,0xc9))[_0xecab('0x34')](handleError(_0x1c7b32,null));};exports[_0xecab('0x2a')]=function(_0x58d9be,_0x5d9d68){if(_0x58d9be['body']['id']){delete _0x58d9be[_0xecab('0x79')]['id'];}return db[_0xecab('0x3d')]['find']({'where':{'id':_0x58d9be[_0xecab('0xb7')]['id']}})[_0xecab('0x2b')](handleEntityNotFound(_0x5d9d68,null))[_0xecab('0x2b')](saveUpdates(_0x58d9be[_0xecab('0x79')],null))['then'](respondWithResult(_0x5d9d68,null))[_0xecab('0x34')](handleError(_0x5d9d68,null));};exports[_0xecab('0xbc')]=function(_0x802ea3,_0x45be5b){return db['WhatsappInteraction'][_0xecab('0x6f')]({'where':{'id':_0x802ea3[_0xecab('0xb7')]['id']}})['then'](handleEntityNotFound(_0x45be5b,null))[_0xecab('0x2b')](removeEntity(_0x45be5b,null))[_0xecab('0x34')](handleError(_0x45be5b,null));};exports['describe']=function(_0xc12599,_0x3f6a65){return db[_0xecab('0x3d')][_0xecab('0xbd')]()[_0xecab('0x2b')](respondWithResult(_0x3f6a65,null))[_0xecab('0x34')](handleError(_0x3f6a65,null));};exports[_0xecab('0xbe')]=function(_0x8ed3c3,_0x5a8b86,_0x385bcb){return db[_0xecab('0xbf')][_0xecab('0x6f')]({'where':{'id':_0x8ed3c3['params']['id']}})[_0xecab('0x2b')](handleEntityNotFound(_0x5a8b86,null))[_0xecab('0x2b')](function(_0x5cab5d){if(_0x5cab5d){return _0x5cab5d[_0xecab('0xbe')](_0x8ed3c3[_0xecab('0x79')][_0xecab('0xc0')],_[_0xecab('0xc1')](_0x8ed3c3[_0xecab('0x79')],[_0xecab('0xc0'),'id'])||{});}})[_0xecab('0x2b')](respondWithResult(_0x5a8b86,null))[_0xecab('0x34')](handleError(_0x5a8b86,null));};exports[_0xecab('0xc2')]=function(_0x2ce7fe,_0x419824,_0x46409e){var _0xd28349={'raw':![],'where':{}};var _0x5baad1={};var _0x156a60={'count':0x0,'rows':[]};return db[_0xecab('0x3d')]['findOne']({'where':{'id':_0x2ce7fe[_0xecab('0xb7')]['id']}})[_0xecab('0x2b')](handleEntityNotFound(_0x419824,null))[_0xecab('0x2b')](function(_0x54e68d){if(_0x54e68d){_0x5baad1[_0xecab('0x41')]=_[_0xecab('0x7a')](db[_0xecab('0xbf')]['rawAttributes']);_0x5baad1[_0xecab('0x42')]=_[_0xecab('0x7a')](_0x2ce7fe[_0xecab('0x42')]);_0x5baad1[_0xecab('0x43')]=_['intersection'](_0x5baad1[_0xecab('0x41')],_0x5baad1[_0xecab('0x42')]);_0xd28349[_0xecab('0x45')]=_['intersection'](_0x5baad1[_0xecab('0x41')],qs[_0xecab('0x46')](_0x2ce7fe[_0xecab('0x42')]['fields']));_0xd28349[_0xecab('0x45')]=_0xd28349[_0xecab('0x45')]['length']?_0xd28349['attributes']:_0x5baad1[_0xecab('0x41')];if(!_0x2ce7fe[_0xecab('0x42')][_0xecab('0x48')](_0xecab('0x49'))){_0xd28349[_0xecab('0x24')]=qs[_0xecab('0x24')](_0x2ce7fe['query'][_0xecab('0x24')]);_0xd28349['offset']=qs[_0xecab('0x22')](_0x2ce7fe[_0xecab('0x42')][_0xecab('0x22')]);}_0xd28349[_0xecab('0x4a')]=qs[_0xecab('0x4b')](_0x2ce7fe[_0xecab('0x42')][_0xecab('0x4b')]);_0xd28349[_0xecab('0x4c')]=qs[_0xecab('0x43')](_[_0xecab('0x4d')](_0x2ce7fe[_0xecab('0x42')],_0x5baad1[_0xecab('0x43')]));_0xd28349['where'][_0xecab('0xc3')]=_0x54e68d['id'];if(_0x2ce7fe[_0xecab('0x42')][_0xecab('0x8a')]){_0xd28349[_0xecab('0x4c')]=_[_0xecab('0xa1')](_0xd28349[_0xecab('0x4c')],{'$or':_[_0xecab('0x2f')](_0xd28349[_0xecab('0x45')],function(_0x3385f0){var _0x583e28={};_0x583e28[_0x3385f0]={'$like':'%'+_0x2ce7fe['query'][_0xecab('0x8a')]+'%'};return _0x583e28;})});}if(_0x2ce7fe[_0xecab('0x42')][_0xecab('0x81')]){var _0x291d5a=_0x2ce7fe[_0xecab('0x42')]['$gte'][_0xecab('0x6c')](',');var _0x2c3653={};_0x2c3653[_0x291d5a[0x0]]={'$gte':moment(_0x291d5a[0x1])['format'](_0xecab('0xc4'))};_0xd28349[_0xecab('0x4c')]=_['merge'](_0xd28349['where'],_0x2c3653);}_0xd28349=_[_0xecab('0xa1')]({},_0xd28349,_0x2ce7fe[_0xecab('0xba')]);return db[_0xecab('0xbf')]['count']({'where':_0xd28349['where']})['then'](function(_0x1a0cb4){_0x156a60[_0xecab('0x25')]=_0x1a0cb4;if(_0x2ce7fe[_0xecab('0x42')][_0xecab('0xc5')]){_0xd28349[_0xecab('0xb9')]=[{'all':!![]}];}return db[_0xecab('0xbf')][_0xecab('0xc6')](_0xd28349);})[_0xecab('0x2b')](function(_0x3db3f7){_0x156a60['rows']=_0x3db3f7;return _0x156a60;});}})['then'](respondWithFilteredResult(_0x419824,_0xd28349))[_0xecab('0x34')](handleError(_0x419824,null));};exports[_0xecab('0xc7')]=function(_0x5d7010,_0x22294d,_0x3bd58e){return db['WhatsappInteraction']['find']({'where':{'id':_0x5d7010['params']['id']}})['then'](handleEntityNotFound(_0x22294d,null))[_0xecab('0x2b')](function(_0x5c7d4b){if(_0x5c7d4b){return _0x5c7d4b[_0xecab('0xc8')](_0x5d7010[_0xecab('0x79')][_0xecab('0xc0')],_[_0xecab('0xc1')](_0x5d7010[_0xecab('0x79')],[_0xecab('0xc0'),'id'])||{})['spread'](function(){return db[_0xecab('0x75')][_0xecab('0xc6')]({'attributes':['id',_0xecab('0x2c'),_0xecab('0x4f')],'where':{'id':_0x5d7010['body']['ids']}});})[_0xecab('0x2b')](function(_0x1d382f){socket[_0xecab('0xc9')](_0xecab('0xca'),{'id':Number(_0x5d7010[_0xecab('0xb7')]['id']),'tags':_0x1d382f||[]});return{'id':Number(_0x5d7010[_0xecab('0xb7')]['id']),'tags':_0x1d382f||[]};});}})[_0xecab('0x2b')](respondWithResult(_0x22294d,null))[_0xecab('0x34')](handleError(_0x22294d,null));};exports[_0xecab('0xcb')]=function(_0x242e01,_0x2ad529,_0x44f1e2){return db[_0xecab('0x3d')][_0xecab('0x6f')]({'where':{'id':_0x242e01[_0xecab('0xb7')]['id']}})[_0xecab('0x2b')](handleEntityNotFound(_0x2ad529,null))['then'](function(_0x5f422f){if(_0x5f422f){return _0x5f422f['removeTags'](_0x242e01[_0xecab('0x42')][_0xecab('0xc0')]);}})[_0xecab('0x2b')](respondWithStatusCode(_0x2ad529,null))['catch'](handleError(_0x2ad529,null));};exports[_0xecab('0xcc')]=function(_0x1a1b79,_0x163af4){var _0x1c3a13=moment()[_0xecab('0xcd')]()[_0xecab('0xb5')]();var _0x54c848=path[_0xecab('0xce')](config[_0xecab('0xcf')],_0xecab('0xd0'),_0xecab('0xd1'),_0xecab('0xd2'));var _0x370f7e=path[_0xecab('0xce')](config[_0xecab('0xcf')],_0xecab('0xd0'),_0xecab('0xd1'),_0xecab('0xd3'));var _0x238d36=path[_0xecab('0xce')](_0x54c848,_0x1c3a13);var _0x4393ee=util[_0xecab('0xd4')](_0xecab('0xd5'),_0x1a1b79[_0xecab('0xb7')]['id'],_0x1c3a13);var _0x5649fb=path['join'](_0x54c848,_0x4393ee);var _0x251d5c=[];_0x251d5c[_0xecab('0x32')]({'model':db[_0xecab('0x78')],'as':'User','attributes':['id',_0xecab('0x30')],'raw':!![]});_0x251d5c[_0xecab('0x32')]({'model':db['CmContact'],'as':_0xecab('0x69'),'attributes':['id',_0xecab('0xd6'),'lastName'],'raw':!![]});if(_0x1a1b79[_0xecab('0x42')][_0xecab('0xd3')]){_0x251d5c[_0xecab('0x32')]({'model':db[_0xecab('0xd7')],'as':'Attachment','raw':!![]});}var _0x5d6681=[{'model':db[_0xecab('0xbf')],'as':_0xecab('0xd8'),'attributes':['id',_0xecab('0x79'),_0xecab('0x7f'),'direction',_0xecab('0xd9'),'read'],'include':_0x251d5c}];_0x5d6681[_0xecab('0x32')]({'model':db['WhatsappAccount'],'as':_0xecab('0xda'),'attributes':['id',_0xecab('0x2c')]});_0x5d6681['push']({'model':db[_0xecab('0x78')],'as':_0xecab('0xdb'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0xecab('0x6f')]({'where':{'id':_0x1a1b79[_0xecab('0xb7')]['id']},'include':_0x5d6681})[_0xecab('0x2b')](handleEntityNotFound(_0x163af4,null))[_0xecab('0x2b')](function(_0xa191b3){if(_0xa191b3){var _0x5ec4c2=_0xa191b3[_0xecab('0xdc')]({'plain':!![]});fs[_0xecab('0xdd')](_0x238d36);var _0x5d9c31={'channel':_0xecab('0xde'),'account':_0x5ec4c2[_0xecab('0xda')][_0xecab('0x2c')],'agent':_0x5ec4c2['Owner']?_0x5ec4c2['Owner'][_0xecab('0x30')]:_0xecab('0xdf'),'createdAt':moment(_0x5ec4c2[_0xecab('0x7f')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xecab('0xb5')](),'closedAt':_0x5ec4c2['closed']?moment(_0x5ec4c2[_0xecab('0xe0')])[_0xecab('0xd4')](_0xecab('0xc4'))[_0xecab('0xb5')]():'','disposition':_0x5ec4c2[_0xecab('0xe1')],'messages':_(_0x5ec4c2['Messages'])[_0xecab('0x8a')]({'secret':![]})[_0xecab('0x2f')](function(_0x3ef4c6){if(_0x3ef4c6[_0xecab('0xd7')]){var _0x2b3518=path[_0xecab('0xce')](_0x370f7e,_0x3ef4c6[_0xecab('0xd7')]['basename']);if(fs[_0xecab('0xe2')](_0x2b3518)){fs[_0xecab('0xe3')](_0x2b3518)['pipe'](fs[_0xecab('0xe4')](path['join'](_0x238d36,_0x3ef4c6[_0xecab('0xd7')][_0xecab('0xe5')])));}}return{'date':moment(_0x3ef4c6[_0xecab('0x7f')])[_0xecab('0xd4')](_0xecab('0xc4'))[_0xecab('0xb5')](),'sender':_0x3ef4c6['direction']===_0xecab('0xe6')?_0x3ef4c6[_0xecab('0x78')]?_0x3ef4c6['User'][_0xecab('0x30')]:'System':_0x3ef4c6[_0xecab('0x69')][_0xecab('0xd6')]+(_0x3ef4c6[_0xecab('0x69')][_0xecab('0xe7')]?'\x20'+_0x3ef4c6[_0xecab('0x69')][_0xecab('0xe7')]:''),'body':_0x3ef4c6['Attachment']?_0x3ef4c6[_0xecab('0xd7')][_0xecab('0xe5')]:_0x3ef4c6[_0xecab('0x79')],'direction':_0x3ef4c6[_0xecab('0xe8')]===_0xecab('0xe6')?'A':'C','secret':_0x3ef4c6[_0xecab('0xd9')],'read':_0x3ef4c6[_0xecab('0xe9')],'attachment':_0x3ef4c6[_0xecab('0xd7')]};})['value']()};return ejs[_0xecab('0xea')](path[_0xecab('0xce')](config[_0xecab('0xcf')],_0xecab('0xd0'),'views',_0xecab('0xeb')),{'interaction':_0x5d9c31})['then'](function(_0x126774){var _0x4f4261=path[_0xecab('0xce')](_0x238d36,_0xecab('0xec')+_0x5ec4c2['id']+'-'+_0x1c3a13+_0xecab('0xed'));var _0x10ee5f={'path':_0x4f4261,'channel':_0xecab('0xde'),'interactionId':_0x5ec4c2['id']};return pdf['createPdfFromHTML'](_0x126774,_0x10ee5f);})[_0xecab('0x2b')](function(){return new BPromise(function(_0x9814ed,_0x42c9b4){zipdir(_0x238d36,{'saveTo':_0x5649fb},function(_0x29361f,_0x27c7e0){if(_0x29361f)return _0x42c9b4(_0x29361f);return _0x9814ed(_0x27c7e0);});})[_0xecab('0x2b')](function(){return new BPromise(function(_0x364128,_0x352d2c){rimraf(_0x238d36,function(_0x332041){if(_0x332041)_0x352d2c(_0x332041);return _0x364128();});});})[_0xecab('0x2b')](function(){return _0x163af4[_0xecab('0xcc')](_0x5649fb,_0x4393ee,function(_0x1f8803){if(_0x1f8803){console[_0xecab('0xee')](_0xecab('0xef'),_0x1f8803);}else{fs[_0xecab('0xf0')](_0x5649fb);}});});});}else{return _0x163af4[_0xecab('0x1f')](0xc8);}})[_0xecab('0x34')](handleError(_0x163af4,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 0a01a4c..a3493a4 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 _0x77f1=['exports','../../mysqldb','WhatsappInteraction','update','remove','getUsers','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x310e92,_0x4727b8){var _0x3c71dc=function(_0x354ad9){while(--_0x354ad9){_0x310e92['push'](_0x310e92['shift']());}};_0x3c71dc(++_0x4727b8);}(_0x77f1,0x1dd));var _0x177f=function(_0x14f683,_0x230219){_0x14f683=_0x14f683-0x0;var _0x504de8=_0x77f1[_0x14f683];return _0x504de8;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x177f('0x0'))['db'][_0x177f('0x1')];var WhatsappMessage=require(_0x177f('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x177f('0x2'),'afterDestroy':_0x177f('0x3')};function emitEvent(_0x57dc73){return function(_0x68cb6a,_0x22c85f,_0x31c4de){_0x68cb6a[_0x177f('0x4')]({'attributes':['id'],'raw':!![]})[_0x177f('0x5')](function(_0x58525a){_0x68cb6a[_0x177f('0x6')](_0x177f('0x7'),_0x58525a['map'](function(_0xba9371){return{'id':_0xba9371['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x68cb6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x177f('0x5')](function(_0x4e1bab){_0x68cb6a[_0x177f('0x6')](_0x177f('0x8'),_0x4e1bab['length']);WhatsappInteractionEvents[_0x177f('0x9')](_0x57dc73+':'+_0x68cb6a['id'],_0x68cb6a);WhatsappInteractionEvents[_0x177f('0x9')](_0x57dc73,_0x68cb6a);_0x31c4de(null);})[_0x177f('0xa')](_0x31c4de(null));};}for(var e in events){if(events[_0x177f('0xb')](e)){var event=events[e];WhatsappInteraction[_0x177f('0xc')](e,emitEvent(event));}}module[_0x177f('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xfc61=['Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','update','remove','getUsers','then','setDataValue'];(function(_0x202d97,_0x3aa561){var _0x555e12=function(_0x4ce740){while(--_0x4ce740){_0x202d97['push'](_0x202d97['shift']());}};_0x555e12(++_0x3aa561);}(_0xfc61,0x78));var _0x1fc6=function(_0x2b520b,_0x76d655){_0x2b520b=_0x2b520b-0x0;var _0x35c536=_0xfc61[_0x2b520b];return _0x35c536;};'use strict';var EventEmitter=require(_0x1fc6('0x0'));var WhatsappInteraction=require(_0x1fc6('0x1'))['db'][_0x1fc6('0x2')];var WhatsappMessage=require(_0x1fc6('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fc6('0x3'),'afterDestroy':_0x1fc6('0x4')};function emitEvent(_0x451c27){return function(_0x3cb94f,_0x48e6f8,_0x5b5f8c){_0x3cb94f[_0x1fc6('0x5')]({'attributes':['id'],'raw':!![]})[_0x1fc6('0x6')](function(_0x3a7dfc){_0x3cb94f[_0x1fc6('0x7')](_0x1fc6('0x8'),_0x3a7dfc['map'](function(_0x8891cc){return{'id':_0x8891cc['id']};}));return WhatsappMessage[_0x1fc6('0x9')]({'where':{'WhatsappInteractionId':_0x3cb94f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1fc6('0x6')](function(_0x132f16){_0x3cb94f['setDataValue'](_0x1fc6('0xa'),_0x132f16[_0x1fc6('0xb')]);WhatsappInteractionEvents['emit'](_0x451c27+':'+_0x3cb94f['id'],_0x3cb94f);WhatsappInteractionEvents[_0x1fc6('0xc')](_0x451c27,_0x3cb94f);_0x5b5f8c(null);})[_0x1fc6('0xd')](_0x5b5f8c(null));};}for(var e in events){if(events[_0x1fc6('0xe')](e)){var event=events[e];WhatsappInteraction[_0x1fc6('0xf')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 579c676..2cc42e3 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 _0x3172=['WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','api','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0x45e926,_0x2f9a49){var _0x313cfd=function(_0x23125f){while(--_0x23125f){_0x45e926['push'](_0x45e926['shift']());}};_0x313cfd(++_0x2f9a49);}(_0x3172,0x1da));var _0x2317=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x3172[_0x1d1d09];return _0x8827e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2317('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2317('0x1'));var rimraf=require(_0x2317('0x2'));var config=require(_0x2317('0x3'));var attributes=require(_0x2317('0x4'));module[_0x2317('0x5')]=function(_0x38cd8e,_0x41d09c){return _0x38cd8e[_0x2317('0x6')](_0x2317('0x7'),attributes,{'tableName':_0x2317('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1923cf,_0x506579,_0x4d081e){if(_0x1923cf['changed'](_0x2317('0x9'))){_0x1923cf[_0x2317('0xa')]=moment()[_0x2317('0xb')](_0x2317('0xc'));}_0x4d081e(null,_0x1923cf);}}});}; \ No newline at end of file +var _0x3f4b=['whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x3f4b,0x101));var _0xb3f4=function(_0x4447c5,_0x1cc8c4){_0x4447c5=_0x4447c5-0x0;var _0x404c98=_0x3f4b[_0x4447c5];return _0x404c98;};'use strict';var _=require(_0xb3f4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb3f4('0x1'));var moment=require(_0xb3f4('0x2'));var BPromise=require(_0xb3f4('0x3'));var rp=require(_0xb3f4('0x4'));var fs=require('fs');var path=require(_0xb3f4('0x5'));var rimraf=require(_0xb3f4('0x6'));var config=require(_0xb3f4('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xb3f4('0x8')]=function(_0x5e96ec,_0x203c29){return _0x5e96ec['define']('WhatsappInteraction',attributes,{'tableName':_0xb3f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d266d,_0x4fa33c,_0x6f59b9){if(_0x3d266d['changed'](_0xb3f4('0xa'))){_0x3d266d[_0xb3f4('0xb')]=moment()[_0xb3f4('0xc')](_0xb3f4('0xd'));}_0x6f59b9(null,_0x3d266d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 92727a5..78259dd 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 _0xf75e=['redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf75e,0xf5));var _0xef75=function(_0x1b04b5,_0xaf5c56){_0x1b04b5=_0x1b04b5-0x0;var _0x75528d=_0xf75e[_0x1b04b5];return _0x75528d;};'use strict';var _=require(_0xef75('0x0'));var util=require(_0xef75('0x1'));var moment=require(_0xef75('0x2'));var BPromise=require(_0xef75('0x3'));var rs=require(_0xef75('0x4'));var fs=require('fs');var Redis=require(_0xef75('0x5'));var db=require(_0xef75('0x6'))['db'];var utils=require(_0xef75('0x7'));var logger=require(_0xef75('0x8'))('rpc');var config=require(_0xef75('0x9'));var jayson=require(_0xef75('0xa'));var client=jayson['client'][_0xef75('0xb')]({'port':0x232a});config['redis']=_[_0xef75('0xc')](config[_0xef75('0xd')],{'host':_0xef75('0xe'),'port':0x18eb});var socket=require(_0xef75('0xf'))(new Redis(config['redis']));require(_0xef75('0x10'))[_0xef75('0x11')](socket);function respondWithRpcPromise(_0x2a47cd,_0x4546d7,_0x1bf4e2){return new BPromise(function(_0x555ec0,_0x5b17a7){return client[_0xef75('0x12')](_0x2a47cd,_0x1bf4e2)[_0xef75('0x13')](function(_0x298b85){logger[_0xef75('0x14')](_0xef75('0x15'),_0x4546d7,_0xef75('0x16'));logger[_0xef75('0x17')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4546d7,_0xef75('0x16'),JSON[_0xef75('0x18')](_0x298b85));if(_0x298b85['error']){if(_0x298b85[_0xef75('0x19')][_0xef75('0x1a')]===0x1f4){logger[_0xef75('0x19')](_0xef75('0x15'),_0x4546d7,_0x298b85[_0xef75('0x19')][_0xef75('0x1b')]);return _0x5b17a7(_0x298b85[_0xef75('0x19')][_0xef75('0x1b')]);}logger[_0xef75('0x19')](_0xef75('0x15'),_0x4546d7,_0x298b85['error'][_0xef75('0x1b')]);return _0x555ec0(_0x298b85['error'][_0xef75('0x1b')]);}else{logger[_0xef75('0x14')](_0xef75('0x15'),_0x4546d7,_0xef75('0x16'));_0x555ec0(_0x298b85['result'][_0xef75('0x1b')]);}})[_0xef75('0x1c')](function(_0x10d0a6){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x4546d7,_0x10d0a6);_0x5b17a7(_0x10d0a6);});});}exports[_0xef75('0x1d')]=function(_0x1ef750){var _0xa5dadf=this;return new Promise(function(_0x4da0c8,_0x120368){return db[_0xef75('0x1e')][_0xef75('0x1f')](_0x1ef750[_0xef75('0x20')],{'raw':_0x1ef750[_0xef75('0x21')]?_0x1ef750[_0xef75('0x21')][_0xef75('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ef750[_0xef75('0x21')]?_0x1ef750[_0xef75('0x21')][_0xef75('0x23')]||null:null,'attributes':_0x1ef750['options']?_0x1ef750['options'][_0xef75('0x24')]||null:null,'limit':_0x1ef750[_0xef75('0x21')]?_0x1ef750[_0xef75('0x21')][_0xef75('0x25')]||null:null})[_0xef75('0x13')](function(_0x544868){logger[_0xef75('0x14')](_0xef75('0x1d'),_0x1ef750);logger[_0xef75('0x17')](_0xef75('0x1d'),_0x1ef750,JSON[_0xef75('0x18')](_0x544868));_0x4da0c8(_0x544868);})['catch'](function(_0x2192ee){logger[_0xef75('0x19')](_0xef75('0x1d'),_0x2192ee[_0xef75('0x1b')],_0x1ef750);_0x120368(_0xa5dadf['error'](0x1f4,_0x2192ee[_0xef75('0x1b')]));});});};exports[_0xef75('0x26')]=function(_0x9ff3a4){return new Promise(function(_0x4fa7aa,_0x37021b){return db[_0xef75('0x1e')][_0xef75('0x27')]({'where':_0x9ff3a4[_0xef75('0x21')]?_0x9ff3a4['options'][_0xef75('0x23')]||null:null})[_0xef75('0x13')](function(_0x2eb55a){if(_0x2eb55a){return _0x2eb55a['addTags'](_0x9ff3a4[_0xef75('0x20')][_0xef75('0x28')],_['omit'](_0x9ff3a4[_0xef75('0x20')],[_0xef75('0x28'),'id'])||{});}})[_0xef75('0x29')](function(_0x387b89){logger[_0xef75('0x14')](_0xef75('0x2a'),_0x9ff3a4);logger[_0xef75('0x17')](_0xef75('0x2a'),_0x9ff3a4,JSON[_0xef75('0x18')](_0x387b89));_0x4fa7aa(_0x387b89);})['catch'](function(_0x11858b){logger[_0xef75('0x19')](_0xef75('0x2a'),_0x11858b[_0xef75('0x1b')],_0x9ff3a4);_0x37021b(_this[_0xef75('0x19')](0x1f4,_0x11858b['message']));});});}; \ No newline at end of file +var _0x634b=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','stringify','catch','AddTagsToWhatsappInteraction','find','ids','AddTags','lodash'];(function(_0x1fc772,_0x376734){var _0x725ba3=function(_0x58f195){while(--_0x58f195){_0x1fc772['push'](_0x1fc772['shift']());}};_0x725ba3(++_0x376734);}(_0x634b,0x7a));var _0xb634=function(_0x4d9a6e,_0x4707cf){_0x4d9a6e=_0x4d9a6e-0x0;var _0x5a1c98=_0x634b[_0x4d9a6e];return _0x5a1c98;};'use strict';var _=require(_0xb634('0x0'));var util=require(_0xb634('0x1'));var moment=require(_0xb634('0x2'));var BPromise=require('bluebird');var rs=require(_0xb634('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb634('0x4'))['db'];var utils=require(_0xb634('0x5'));var logger=require(_0xb634('0x6'))(_0xb634('0x7'));var config=require(_0xb634('0x8'));var jayson=require(_0xb634('0x9'));var client=jayson['client'][_0xb634('0xa')]({'port':0x232a});config[_0xb634('0xb')]=_['defaults'](config[_0xb634('0xb')],{'host':_0xb634('0xc'),'port':0x18eb});var socket=require(_0xb634('0xd'))(new Redis(config[_0xb634('0xb')]));require(_0xb634('0xe'))[_0xb634('0xf')](socket);function respondWithRpcPromise(_0x2bf841,_0x3663ff,_0x5a18f9){return new BPromise(function(_0x5e48f5,_0x3f54cb){return client[_0xb634('0x10')](_0x2bf841,_0x5a18f9)[_0xb634('0x11')](function(_0x1052e5){logger[_0xb634('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3663ff,_0xb634('0x13'));logger[_0xb634('0x14')](_0xb634('0x15'),_0x3663ff,_0xb634('0x13'),JSON['stringify'](_0x1052e5));if(_0x1052e5[_0xb634('0x16')]){if(_0x1052e5[_0xb634('0x16')][_0xb634('0x17')]===0x1f4){logger[_0xb634('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x3663ff,_0x1052e5[_0xb634('0x16')][_0xb634('0x18')]);return _0x3f54cb(_0x1052e5[_0xb634('0x16')]['message']);}logger[_0xb634('0x16')](_0xb634('0x19'),_0x3663ff,_0x1052e5[_0xb634('0x16')][_0xb634('0x18')]);return _0x5e48f5(_0x1052e5[_0xb634('0x16')]['message']);}else{logger[_0xb634('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x3663ff,'request\x20sent');_0x5e48f5(_0x1052e5[_0xb634('0x1a')][_0xb634('0x18')]);}})['catch'](function(_0x2b2c51){logger['error'](_0xb634('0x19'),_0x3663ff,_0x2b2c51);_0x3f54cb(_0x2b2c51);});});}exports[_0xb634('0x1b')]=function(_0x4f065f){var _0x22c4c3=this;return new Promise(function(_0x2ac823,_0x33f79c){return db[_0xb634('0x1c')][_0xb634('0x1d')](_0x4f065f[_0xb634('0x1e')],{'raw':_0x4f065f[_0xb634('0x1f')]?_0x4f065f['options'][_0xb634('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f065f['options']?_0x4f065f[_0xb634('0x1f')][_0xb634('0x21')]||null:null,'attributes':_0x4f065f[_0xb634('0x1f')]?_0x4f065f[_0xb634('0x1f')]['attributes']||null:null,'limit':_0x4f065f[_0xb634('0x1f')]?_0x4f065f[_0xb634('0x1f')][_0xb634('0x22')]||null:null})['then'](function(_0x1e0825){logger[_0xb634('0x12')]('UpdateWhatsappInteraction',_0x4f065f);logger[_0xb634('0x14')](_0xb634('0x1b'),_0x4f065f,JSON[_0xb634('0x23')](_0x1e0825));_0x2ac823(_0x1e0825);})[_0xb634('0x24')](function(_0x1486cd){logger[_0xb634('0x16')](_0xb634('0x1b'),_0x1486cd[_0xb634('0x18')],_0x4f065f);_0x33f79c(_0x22c4c3[_0xb634('0x16')](0x1f4,_0x1486cd[_0xb634('0x18')]));});});};exports[_0xb634('0x25')]=function(_0x37042f){return new Promise(function(_0x2f070d,_0x1ec8a5){return db['WhatsappInteraction'][_0xb634('0x26')]({'where':_0x37042f[_0xb634('0x1f')]?_0x37042f[_0xb634('0x1f')][_0xb634('0x21')]||null:null})[_0xb634('0x11')](function(_0x18e491){if(_0x18e491){return _0x18e491['addTags'](_0x37042f['body']['ids'],_['omit'](_0x37042f[_0xb634('0x1e')],[_0xb634('0x27'),'id'])||{});}})['spread'](function(_0xd9e2c){logger[_0xb634('0x12')](_0xb634('0x28'),_0x37042f);logger['debug'](_0xb634('0x28'),_0x37042f,JSON[_0xb634('0x23')](_0xd9e2c));_0x2f070d(_0xd9e2c);})[_0xb634('0x24')](function(_0x517396){logger[_0xb634('0x16')](_0xb634('0x28'),_0x517396['message'],_0x37042f);_0x1ec8a5(_this[_0xb634('0x16')](0x1f4,_0x517396[_0xb634('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index e0ff5a4..be30e74 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 _0xb527=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb527,0xb3));var _0x7b52=function(_0x35506e,_0x2c273d){_0x35506e=_0x35506e-0x0;var _0x5c1c3f=_0xb527[_0x35506e];return _0x5c1c3f;};'use strict';var WhatsappInteractionEvents=require(_0x7b52('0x0'));var events=[_0x7b52('0x1'),_0x7b52('0x2'),'update'];function createListener(_0x3b7bb1,_0x356512){return function(_0x2fc9de){_0x356512[_0x7b52('0x3')](_0x3b7bb1,_0x2fc9de);};}function removeListener(_0x5a6e29,_0x2b8613){return function(){WhatsappInteractionEvents[_0x7b52('0x4')](_0x5a6e29,_0x2b8613);};}exports[_0x7b52('0x5')]=function(_0x180952){for(var _0x5e2bae=0x0,_0x19866e=events[_0x7b52('0x6')];_0x5e2bae<_0x19866e;_0x5e2bae++){var _0x16c14c=events[_0x5e2bae];var _0x4cc1ce=createListener(_0x7b52('0x7')+_0x16c14c,_0x180952);WhatsappInteractionEvents['on'](_0x16c14c,_0x4cc1ce);}}; \ No newline at end of file +var _0x6655=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x4b0db4,_0x546f97){var _0x2d8287=function(_0x47a068){while(--_0x47a068){_0x4b0db4['push'](_0x4b0db4['shift']());}};_0x2d8287(++_0x546f97);}(_0x6655,0xdb));var _0x5665=function(_0x3d67d0,_0x59d1f9){_0x3d67d0=_0x3d67d0-0x0;var _0x34a470=_0x6655[_0x3d67d0];return _0x34a470;};'use strict';var WhatsappInteractionEvents=require(_0x5665('0x0'));var events=[_0x5665('0x1'),_0x5665('0x2'),_0x5665('0x3')];function createListener(_0x97547d,_0x3f5698){return function(_0x3d6ac9){_0x3f5698[_0x5665('0x4')](_0x97547d,_0x3d6ac9);};}function removeListener(_0x2973e6,_0x903844){return function(){WhatsappInteractionEvents['removeListener'](_0x2973e6,_0x903844);};}exports[_0x5665('0x5')]=function(_0x480820){for(var _0x24dfdb=0x0,_0x42cc29=events[_0x5665('0x6')];_0x24dfdb<_0x42cc29;_0x24dfdb++){var _0x298d16=events[_0x24dfdb];var _0x1ec632=createListener(_0x5665('0x7')+_0x298d16,_0x480820);WhatsappInteractionEvents['on'](_0x298d16,_0x1ec632);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 2e0275b..2de1408 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 _0x63e9=['status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','create'];(function(_0x2d2ccc,_0x30f2fe){var _0x54dc55=function(_0x378643){while(--_0x378643){_0x2d2ccc['push'](_0x2d2ccc['shift']());}};_0x54dc55(++_0x30f2fe);}(_0x63e9,0xe9));var _0x963e=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0x63e9[_0x3c487b];return _0x1d65f6;};'use strict';var multer=require(_0x963e('0x0'));var util=require(_0x963e('0x1'));var path=require(_0x963e('0x2'));var timeout=require('connect-timeout');var express=require(_0x963e('0x3'));var router=express['Router']();var fs_extra=require(_0x963e('0x4'));var auth=require(_0x963e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x963e('0x6'));var controller=require(_0x963e('0x7'));router[_0x963e('0x8')]('/',auth[_0x963e('0x9')](),controller[_0x963e('0xa')]);router[_0x963e('0x8')](_0x963e('0xb'),auth[_0x963e('0x9')](),controller[_0x963e('0xc')]);router[_0x963e('0x8')](_0x963e('0xd'),auth[_0x963e('0x9')](),controller[_0x963e('0xe')]);router[_0x963e('0xf')]('/',auth[_0x963e('0x9')](),interaction[_0x963e('0x10')](_0x963e('0x11'),'whatsappmessage:create'),controller[_0x963e('0x12')]);router[_0x963e('0xf')]('/:id/status',controller[_0x963e('0x13')]);router['put'](_0x963e('0xd'),auth[_0x963e('0x9')](),controller['update']);router[_0x963e('0x14')](_0x963e('0x15'),auth[_0x963e('0x9')](),controller[_0x963e('0x16')]);router[_0x963e('0x14')](_0x963e('0x17'),auth[_0x963e('0x9')](),controller[_0x963e('0x18')]);router[_0x963e('0x19')]('/:id',auth[_0x963e('0x9')](),controller[_0x963e('0x1a')]);module[_0x963e('0x1b')]=router; \ No newline at end of file +var _0x0517=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status','put','/:id/accept','/:id/reject'];(function(_0x13945b,_0x289c94){var _0x1b1643=function(_0x18f4c3){while(--_0x18f4c3){_0x13945b['push'](_0x13945b['shift']());}};_0x1b1643(++_0x289c94);}(_0x0517,0x13b));var _0x7051=function(_0x587735,_0x11da34){_0x587735=_0x587735-0x0;var _0xd54007=_0x0517[_0x587735];return _0xd54007;};'use strict';var multer=require(_0x7051('0x0'));var util=require(_0x7051('0x1'));var path=require(_0x7051('0x2'));var timeout=require(_0x7051('0x3'));var express=require('express');var router=express[_0x7051('0x4')]();var fs_extra=require(_0x7051('0x5'));var auth=require(_0x7051('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7051('0x7'));router[_0x7051('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7051('0x8')](_0x7051('0x9'),auth[_0x7051('0xa')](),controller[_0x7051('0xb')]);router[_0x7051('0x8')](_0x7051('0xc'),auth[_0x7051('0xa')](),controller[_0x7051('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x7051('0xe')](_0x7051('0xf'),_0x7051('0x10')),controller[_0x7051('0x11')]);router[_0x7051('0x12')](_0x7051('0x13'),controller['status']);router['put'](_0x7051('0xc'),auth[_0x7051('0xa')](),controller['update']);router[_0x7051('0x14')](_0x7051('0x15'),auth[_0x7051('0xa')](),controller['accept']);router['put'](_0x7051('0x16'),auth[_0x7051('0xa')](),controller['reject']);router[_0x7051('0x17')](_0x7051('0xc'),auth[_0x7051('0xa')](),controller[_0x7051('0x18')]);module[_0x7051('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5661115..a1b185d 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 _0x6fc3=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x1f734d,_0x5b3c37){var _0x186847=function(_0x38f7db){while(--_0x38f7db){_0x1f734d['push'](_0x1f734d['shift']());}};_0x186847(++_0x5b3c37);}(_0x6fc3,0x117));var _0x36fc=function(_0x43297e,_0x2ad1e1){_0x43297e=_0x43297e-0x0;var _0xc82671=_0x6fc3[_0x43297e];return _0xc82671;};'use strict';var Sequelize=require(_0x36fc('0x0'));module[_0x36fc('0x1')]={'body':{'type':Sequelize[_0x36fc('0x2')](_0x36fc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x36fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x36fc('0x5')]('in',_0x36fc('0x6')),'defaultValue':_0x36fc('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x36fc('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x36fc('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x36fc('0x7')]},'providerResponse':{'type':Sequelize[_0x36fc('0x2')]}}; \ No newline at end of file +var _0x1d80=['sequelize','exports','ENUM','out','STRING','BOOLEAN','TEXT'];(function(_0x14804a,_0x41f7c7){var _0x553197=function(_0x2354bc){while(--_0x2354bc){_0x14804a['push'](_0x14804a['shift']());}};_0x553197(++_0x41f7c7);}(_0x1d80,0xaf));var _0x01d8=function(_0x2bfeca,_0x39828b){_0x2bfeca=_0x2bfeca-0x0;var _0x426874=_0x1d80[_0x2bfeca];return _0x426874;};'use strict';var Sequelize=require(_0x01d8('0x0'));module[_0x01d8('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x01d8('0x2')]('in','out'),'defaultValue':_0x01d8('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x01d8('0x4')](0xbe)},'phone':{'type':Sequelize[_0x01d8('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x01d8('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x01d8('0x4')]},'providerResponse':{'type':Sequelize[_0x01d8('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 95a1f47..08026ae 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 _0x9852=['fields','length','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','intersection','options','catch','body','find','whatsapp-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','sequelize','Sequelize','contact','interface','SIP/%s','params','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','inspect','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','count','apply','save','update','destroy','stack','name','send','map','WhatsappMessage','type','key','model','query','keys','attributes'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x9852,0xcb));var _0x2985=function(_0x3d0fa1,_0xd57cd6){_0x3d0fa1=_0x3d0fa1-0x0;var _0x4660bc=_0x9852[_0x3d0fa1];return _0x4660bc;};'use strict';var emlformat=require(_0x2985('0x0'));var rimraf=require(_0x2985('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2985('0x2'));var moment=require(_0x2985('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2985('0x4'));var util=require(_0x2985('0x5'));var path=require(_0x2985('0x6'));var sox=require(_0x2985('0x7'));var csv=require(_0x2985('0x8'));var ejs=require(_0x2985('0x9'));var fs=require('fs');var fs_extra=require(_0x2985('0xa'));var _=require(_0x2985('0xb'));var squel=require('squel');var crypto=require(_0x2985('0xc'));var jsforce=require(_0x2985('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2985('0x8'));var querystring=require(_0x2985('0xe'));var Papa=require(_0x2985('0xf'));var Redis=require(_0x2985('0x10'));var authService=require(_0x2985('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2985('0x12'));var logger=require(_0x2985('0x13'))('api');var utils=require(_0x2985('0x14'));var config=require(_0x2985('0x15'));var licenseUtil=require(_0x2985('0x16'));var db=require(_0x2985('0x17'))['db'];config[_0x2985('0x18')]=_[_0x2985('0x19')](config['redis'],{'host':_0x2985('0x1a'),'port':0x18eb});var socket=require(_0x2985('0x1b'))(new Redis(config[_0x2985('0x18')]));require(_0x2985('0x1c'))[_0x2985('0x1d')](socket);var jayson=require(_0x2985('0x1e'));var client=jayson[_0x2985('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x2985('0x1f')][_0x2985('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5405ea,_0x1e9b43,_0x238a28,_0xdfc8b2){return new BPromise(function(_0x226882,_0x4d645a){var _0x80f7ee=_0xdfc8b2||client;return _0x80f7ee['request'](_0x5405ea,_0x238a28)[_0x2985('0x21')](function(_0x47492f){logger[_0x2985('0x22')](_0x2985('0x23'),_0x1e9b43,_0x2985('0x24'));logger['debug'](_0x2985('0x25'),_0x1e9b43,_0x2985('0x24'),JSON[_0x2985('0x26')](_0x47492f));if(_0x47492f[_0x2985('0x27')]){if(_0x47492f[_0x2985('0x27')][_0x2985('0x28')]===0x1f4){logger[_0x2985('0x27')](_0x2985('0x23'),_0x1e9b43,_0x47492f[_0x2985('0x27')]['message']);return _0x4d645a(_0x47492f['error'][_0x2985('0x29')]);}logger[_0x2985('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x1e9b43,_0x47492f[_0x2985('0x27')][_0x2985('0x29')]);return _0x226882(_0x47492f[_0x2985('0x27')][_0x2985('0x29')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x1e9b43,_0x2985('0x24'));_0x226882(_0x47492f[_0x2985('0x2a')][_0x2985('0x29')]);}})['catch'](function(_0x1d34df){logger[_0x2985('0x27')](_0x2985('0x23'),_0x1e9b43,_0x1d34df);_0x4d645a(_0x1d34df);});});}function respondWithStatusCode(_0x441190,_0x255255){_0x255255=_0x255255||0xcc;return function(_0x507dfa){if(_0x507dfa){return _0x441190[_0x2985('0x2b')](_0x255255);}return _0x441190[_0x2985('0x2c')](_0x255255)[_0x2985('0x2d')]();};}function respondWithResult(_0x54b9a5,_0x1cf518){_0x1cf518=_0x1cf518||0xc8;return function(_0x48fb43){if(_0x48fb43){return _0x54b9a5[_0x2985('0x2c')](_0x1cf518)[_0x2985('0x2e')](_0x48fb43);}};}function respondWithFilteredResult(_0x485ad7,_0x32a0c5){return function(_0x3bac1d){if(_0x3bac1d){var _0xa78b39=typeof _0x32a0c5[_0x2985('0x2f')]==='undefined'&&typeof _0x32a0c5[_0x2985('0x30')]==='undefined';var _0x152305=_0x3bac1d[_0x2985('0x31')];var _0x312c57=_0xa78b39?0x0:_0x32a0c5[_0x2985('0x2f')];var _0x1fa03a=_0xa78b39?_0x3bac1d[_0x2985('0x31')]:_0x32a0c5[_0x2985('0x2f')]+_0x32a0c5[_0x2985('0x30')];var _0x5bad09;if(_0x1fa03a>=_0x152305){_0x1fa03a=_0x152305;_0x5bad09=0xc8;}else{_0x5bad09=0xce;}_0x485ad7[_0x2985('0x2c')](_0x5bad09);return _0x485ad7['set']('Content-Range',_0x312c57+'-'+_0x1fa03a+'/'+_0x152305)['json'](_0x3bac1d);}return null;};}function patchUpdates(_0x526e98){return function(_0x14b520){try{jsonpatch[_0x2985('0x32')](_0x14b520,_0x526e98,!![]);}catch(_0x344715){return BPromise['reject'](_0x344715);}return _0x14b520[_0x2985('0x33')]();};}function saveUpdates(_0x4efc39,_0x52a77e){return function(_0x507956){if(_0x507956){return _0x507956[_0x2985('0x34')](_0x4efc39)[_0x2985('0x21')](function(_0x355bdc){return _0x355bdc;});}return null;};}function removeEntity(_0x2fc058,_0x134a4b){return function(_0x34445f){if(_0x34445f){return _0x34445f[_0x2985('0x35')]()[_0x2985('0x21')](function(){_0x2fc058[_0x2985('0x2c')](0xcc)[_0x2985('0x2d')]();});}};}function handleEntityNotFound(_0x264ea5,_0x414cb1){return function(_0x1c30e5){if(!_0x1c30e5){_0x264ea5[_0x2985('0x2b')](0x194);}return _0x1c30e5;};}function handleError(_0x524745,_0x3cdc0e){_0x3cdc0e=_0x3cdc0e||0x1f4;return function(_0x49e75e){logger[_0x2985('0x27')](_0x49e75e[_0x2985('0x36')]);if(_0x49e75e[_0x2985('0x37')]){delete _0x49e75e[_0x2985('0x37')];}_0x524745[_0x2985('0x2c')](_0x3cdc0e)[_0x2985('0x38')](_0x49e75e);};}exports['index']=function(_0x2261a1,_0xab995c){var _0x55c486={},_0x456e90={},_0x42839b={'count':0x0,'rows':[]};var _0x2c919e=_[_0x2985('0x39')](db[_0x2985('0x3a')]['rawAttributes'],function(_0x5a588d){return{'name':_0x5a588d['fieldName'],'type':_0x5a588d[_0x2985('0x3b')][_0x2985('0x3c')]};});_0x456e90[_0x2985('0x3d')]=_[_0x2985('0x39')](_0x2c919e,_0x2985('0x37'));_0x456e90[_0x2985('0x3e')]=_[_0x2985('0x3f')](_0x2261a1['query']);_0x456e90['filters']=_['intersection'](_0x456e90[_0x2985('0x3d')],_0x456e90[_0x2985('0x3e')]);_0x55c486[_0x2985('0x40')]=_['intersection'](_0x456e90[_0x2985('0x3d')],qs['fields'](_0x2261a1[_0x2985('0x3e')][_0x2985('0x41')]));_0x55c486[_0x2985('0x40')]=_0x55c486[_0x2985('0x40')][_0x2985('0x42')]?_0x55c486[_0x2985('0x40')]:_0x456e90[_0x2985('0x3d')];if(!_0x2261a1[_0x2985('0x3e')]['hasOwnProperty']('nolimit')){_0x55c486[_0x2985('0x30')]=qs['limit'](_0x2261a1['query'][_0x2985('0x30')]);_0x55c486[_0x2985('0x2f')]=qs[_0x2985('0x2f')](_0x2261a1[_0x2985('0x3e')][_0x2985('0x2f')]);}_0x55c486['order']=qs[_0x2985('0x43')](_0x2261a1[_0x2985('0x3e')][_0x2985('0x43')]);_0x55c486['where']=qs[_0x2985('0x44')](_[_0x2985('0x45')](_0x2261a1[_0x2985('0x3e')],_0x456e90['filters']),_0x2c919e);if(_0x2261a1['query'][_0x2985('0x46')]){_0x55c486[_0x2985('0x47')]=_[_0x2985('0x48')](_0x55c486[_0x2985('0x47')],{'$or':_[_0x2985('0x39')](_0x2c919e,function(_0x4ce77e){if(_0x4ce77e[_0x2985('0x3b')]!==_0x2985('0x49')){var _0x29f7c2={};_0x29f7c2[_0x4ce77e['name']]={'$like':'%'+_0x2261a1[_0x2985('0x3e')][_0x2985('0x46')]+'%'};return _0x29f7c2;}})});}_0x55c486=_[_0x2985('0x48')]({},_0x55c486,_0x2261a1['options']);var _0x18bc0b={'where':_0x55c486[_0x2985('0x47')]};return db[_0x2985('0x3a')][_0x2985('0x31')](_0x18bc0b)[_0x2985('0x21')](function(_0x5d50f4){_0x42839b[_0x2985('0x31')]=_0x5d50f4;if(_0x2261a1[_0x2985('0x3e')][_0x2985('0x4a')]){_0x55c486[_0x2985('0x4b')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x2985('0x4c')](_0x55c486);})[_0x2985('0x21')](function(_0x4ba3a4){_0x42839b[_0x2985('0x4d')]=_0x4ba3a4;return _0x42839b;})['then'](respondWithFilteredResult(_0xab995c,_0x55c486))['catch'](handleError(_0xab995c,null));};exports[_0x2985('0x4e')]=function(_0x49aec4,_0x235b8b){var _0x38f0be={'raw':!![],'where':{'id':_0x49aec4['params']['id']}},_0x146793={};_0x146793[_0x2985('0x3d')]=_['keys'](db['WhatsappMessage'][_0x2985('0x4f')]);_0x146793['query']=_[_0x2985('0x3f')](_0x49aec4[_0x2985('0x3e')]);_0x146793['filters']=_['intersection'](_0x146793['model'],_0x146793[_0x2985('0x3e')]);_0x38f0be['attributes']=_[_0x2985('0x50')](_0x146793[_0x2985('0x3d')],qs['fields'](_0x49aec4[_0x2985('0x3e')][_0x2985('0x41')]));_0x38f0be[_0x2985('0x40')]=_0x38f0be[_0x2985('0x40')]['length']?_0x38f0be[_0x2985('0x40')]:_0x146793[_0x2985('0x3d')];if(_0x49aec4[_0x2985('0x3e')]['includeAll']){_0x38f0be['include']=[{'all':!![]}];}_0x38f0be=_[_0x2985('0x48')]({},_0x38f0be,_0x49aec4[_0x2985('0x51')]);return db['WhatsappMessage']['find'](_0x38f0be)['then'](handleEntityNotFound(_0x235b8b,null))[_0x2985('0x21')](respondWithResult(_0x235b8b,null))[_0x2985('0x52')](handleError(_0x235b8b,null));};exports['create']=function(_0x427830,_0x50638c){return db[_0x2985('0x3a')]['create'](_0x427830[_0x2985('0x53')],{})['then'](respondWithResult(_0x50638c,0xc9))[_0x2985('0x52')](handleError(_0x50638c,null));};exports[_0x2985('0x34')]=function(_0x57b47d,_0x37d335){if(_0x57b47d[_0x2985('0x53')]['id']){delete _0x57b47d['body']['id'];}return db['WhatsappMessage'][_0x2985('0x54')]({'where':{'id':_0x57b47d['params']['id']}})[_0x2985('0x21')](handleEntityNotFound(_0x37d335,null))[_0x2985('0x21')](saveUpdates(_0x57b47d['body'],null))[_0x2985('0x21')](respondWithResult(_0x37d335,null))['catch'](handleError(_0x37d335,null));};exports['destroy']=function(_0x3cae79,_0x10eab7){return db[_0x2985('0x3a')][_0x2985('0x54')]({'where':{'id':_0x3cae79['params']['id']}})[_0x2985('0x21')](handleEntityNotFound(_0x10eab7,null))[_0x2985('0x21')](removeEntity(_0x10eab7,null))[_0x2985('0x52')](handleError(_0x10eab7,null));};exports['describe']=function(_0x2f93de,_0x52cdbc){return db[_0x2985('0x3a')]['describe']()['then'](respondWithResult(_0x52cdbc,null))[_0x2985('0x52')](handleError(_0x52cdbc,null));};var interaction_log=require('../../config/logger')(_0x2985('0x55'));exports[_0x2985('0x56')]=function(_0x68143a,_0x1917bd,_0x15926c){var _0x18eadb={'agent':{},'channel':'whatsapp'};if(_0x68143a[_0x2985('0x53')]['id']){delete _0x68143a['body']['id'];}_0x68143a[_0x2985('0x53')][_0x2985('0x57')]=!![];_0x68143a[_0x2985('0x53')][_0x2985('0x58')]=moment()['format'](_0x2985('0x59'));_0x68143a['body'][_0x2985('0x5a')]=_0x68143a[_0x2985('0x53')][_0x2985('0x5a')]||_0x68143a[_0x2985('0x5b')]['id'];_0x18eadb[_0x2985('0x5c')]['id']=_0x68143a[_0x2985('0x53')][_0x2985('0x5a')];return db[_0x2985('0x3a')][_0x2985('0x54')]({'where':{'id':_0x68143a['params']['id'],'UserId':null}})[_0x2985('0x21')](handleEntityNotFound(_0x1917bd,null))[_0x2985('0x21')](saveUpdates(_0x68143a[_0x2985('0x53')],null))[_0x2985('0x21')](function(_0x742187){if(_0x742187){_0x18eadb['message']=_0x742187[_0x2985('0x5d')]({'plain':!![]});return db[_0x2985('0x5e')][_0x2985('0x54')]({'where':{'id':_0x742187[_0x2985('0x5f')]}});}return null;})[_0x2985('0x21')](handleEntityNotFound(_0x1917bd,null))[_0x2985('0x21')](function(_0x5862ef){if(_0x5862ef){return _0x5862ef[_0x2985('0x34')]({'UserId':_0x68143a[_0x2985('0x53')][_0x2985('0x5a')],'read1stAt':_['isNil'](_0x5862ef[_0x2985('0x60')])?moment()[_0x2985('0x61')](_0x2985('0x59')):undefined});}return null;})[_0x2985('0x21')](function(_0x278ece){if(_0x278ece){_0x18eadb['interaction']=_0x278ece[_0x2985('0x5d')]({'plain':!![]});interaction_log[_0x2985('0x22')](_0x2985('0x62'),_0x68143a[_0x2985('0x5b')]['id'],_0x68143a[_0x2985('0x5b')]['name'],_0x68143a[_0x2985('0x5b')][_0x2985('0x63')],_0x18eadb[_0x2985('0x64')]['id'],_0x68143a[_0x2985('0x53')]?JSON[_0x2985('0x26')](_0x68143a[_0x2985('0x53')]):_0x2985('0x65'));return respondWithRpcPromise('AcceptMessage',_0x2985('0x66'),_0x18eadb);}return null;})[_0x2985('0x21')](function(_0x3d18e8){var _0x3a6c67=_0x2985('0x67')+_0x3d18e8['message'][_0x2985('0x68')];return db['sequelize'][_0x2985('0x3e')](_0x3a6c67,{'type':db['Sequelize'][_0x2985('0x69')][_0x2985('0x6a')],'raw':!![]})[_0x2985('0x21')](function(_0x5b3979){return _0x5b3979;});})[_0x2985('0x21')](function(_0x1cd444){if(_0x1cd444){_0x18eadb['message']['contact']=_0x1cd444[0x0];if(!_0x68143a[_0x2985('0x53')][_0x2985('0x5a')])return;return db[_0x2985('0x6b')][_0x2985('0x54')]({'where':{'id':_0x68143a[_0x2985('0x53')][_0x2985('0x5a')],'role':_0x2985('0x5c')},'attributes':['id',_0x2985('0x37'),_0x2985('0x6c'),_0x2985('0x6d'),_0x2985('0x6e')],'raw':!![]});}return null;})[_0x2985('0x21')](function(_0x58efc7){if(!_0x58efc7)return null;_0x18eadb[_0x2985('0x29')][_0x2985('0x5c')]=_0x58efc7;return _0x18eadb;})[_0x2985('0x21')](function(_0x907eec){if(_0x907eec){if(_0x68143a['body'][_0x2985('0x6f')]){_0x18eadb[_0x2985('0x29')]['interface']=util['format']('SIP/%s',_0x68143a[_0x2985('0x5b')][_0x2985('0x37')]);_0x18eadb[_0x2985('0x29')][_0x2985('0x70')]=_0x18eadb[_0x2985('0x70')];_0x18eadb[_0x2985('0x29')][_0x2985('0x71')]=_0x18eadb[_0x2985('0x70')];_0x18eadb[_0x2985('0x29')][_0x2985('0x72')]=_0x2985('0x56');return respondWithRpcPromise(_0x2985('0x73'),'EventManager',{'event':_0x2985('0x74'),'message':_0x18eadb['message']},client9002)[_0x2985('0x21')](function(){return _0x18eadb;});}return _0x18eadb;}return null;})[_0x2985('0x21')](respondWithResult(_0x1917bd,null))[_0x2985('0x52')](handleError(_0x1917bd,null));};var interaction_log=require(_0x2985('0x13'))(_0x2985('0x55'));exports[_0x2985('0x75')]=function(_0x2ea732,_0x978dfa,_0x344bd5){var _0x5e3877={'agent':{},'channel':'whatsapp'};if(_0x2ea732['body']['id']){delete _0x2ea732[_0x2985('0x53')]['id'];}_0x2ea732[_0x2985('0x53')][_0x2985('0x5a')]=_0x2ea732[_0x2985('0x53')][_0x2985('0x5a')]||_0x2ea732['user']['id'];_0x5e3877[_0x2985('0x5c')]['id']=_0x2ea732['body'][_0x2985('0x5a')];return db[_0x2985('0x3a')][_0x2985('0x54')]({'where':{'id':_0x2ea732['params']['id'],'UserId':null}})[_0x2985('0x21')](handleEntityNotFound(_0x978dfa,null))[_0x2985('0x21')](function(_0x515aec){if(_0x515aec){_0x5e3877[_0x2985('0x29')]=_0x515aec[_0x2985('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0x2985('0x54')]({'where':{'id':_0x515aec[_0x2985('0x5f')]}});}return null;})[_0x2985('0x21')](handleEntityNotFound(_0x978dfa,null))[_0x2985('0x21')](function(_0x1b379a){if(_0x1b379a){_0x5e3877[_0x2985('0x64')]=_0x1b379a[_0x2985('0x5d')]({'plain':!![]});interaction_log[_0x2985('0x22')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2ea732[_0x2985('0x5b')]['id'],_0x2ea732[_0x2985('0x5b')][_0x2985('0x37')],_0x2ea732[_0x2985('0x5b')][_0x2985('0x63')],_0x5e3877[_0x2985('0x64')]['id'],_0x2ea732[_0x2985('0x53')]?JSON[_0x2985('0x26')](_0x2ea732[_0x2985('0x53')]):_0x2985('0x65'));return respondWithRpcPromise(_0x2985('0x76'),_0x2985('0x77'),_0x5e3877);}return null;})['then'](function(_0x5dcf68){var _0xe73daf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5dcf68[_0x2985('0x29')][_0x2985('0x68')];return db[_0x2985('0x78')][_0x2985('0x3e')](_0xe73daf,{'type':db[_0x2985('0x79')][_0x2985('0x69')]['SELECT'],'raw':!![]})[_0x2985('0x21')](function(_0x4f5676){return _0x4f5676;});})[_0x2985('0x21')](function(_0x2732aa){if(_0x2732aa){_0x5e3877[_0x2985('0x29')][_0x2985('0x7a')]=_0x2732aa[0x0];if(!_0x2ea732[_0x2985('0x53')]['UserId'])return;return db[_0x2985('0x6b')][_0x2985('0x54')]({'where':{'id':_0x2ea732[_0x2985('0x53')]['UserId'],'role':_0x2985('0x5c')},'attributes':['id',_0x2985('0x37'),'fullname',_0x2985('0x6d'),_0x2985('0x6e')],'raw':!![]});}return null;})[_0x2985('0x21')](function(_0x1314cf){if(!_0x1314cf)return null;_0x5e3877[_0x2985('0x29')][_0x2985('0x5c')]=_0x1314cf;return _0x5e3877;})[_0x2985('0x21')](function(_0x35e349){if(_0x35e349){_0x35e349[_0x2985('0x29')][_0x2985('0x7b')]=util[_0x2985('0x61')](_0x2985('0x7c'),_0x2ea732[_0x2985('0x5b')]['name']);_0x35e349[_0x2985('0x29')][_0x2985('0x70')]=_0x5e3877[_0x2985('0x70')];_0x35e349[_0x2985('0x29')][_0x2985('0x71')]=_0x5e3877[_0x2985('0x70')];_0x35e349[_0x2985('0x29')][_0x2985('0x72')]=_0x2985('0x75');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x35e349['message']},client9002);return _0x5e3877;}return null;})['then'](respondWithResult(_0x978dfa,null))['catch'](handleError(_0x978dfa,null));};exports[_0x2985('0x2c')]=function(_0x114e51,_0x438b40,_0x23fec1){if(_0x114e51['body']['id']){delete _0x114e51[_0x2985('0x53')]['id'];}var _0xec9391;return db[_0x2985('0x3a')][_0x2985('0x54')]({'where':{'id':_0x114e51[_0x2985('0x7d')]['id']}})[_0x2985('0x21')](handleEntityNotFound(_0x438b40,null))[_0x2985('0x21')](function(_0x13800f){if(_0x13800f){_0xec9391=_0x13800f;return db[_0x2985('0x7e')]['find']({'where':{'id':_0x13800f[_0x2985('0x7f')]}});}})[_0x2985('0x21')](handleEntityNotFound(_0x438b40,null))[_0x2985('0x21')](function(_0x538889){if(_0x538889){logger['debug'](_0x2985('0x80'),'status','received\x20delivery\x20report\x20from',_0x538889[_0x2985('0x3b')],util['inspect'](_0x114e51[_0x2985('0x53')],{'showHidden':![],'depth':null}));switch(_0x538889[_0x2985('0x3b')]){case _0x2985('0x81'):if(_0x114e51[_0x2985('0x53')][_0x2985('0x82')]&&_0x114e51['body'][_0x2985('0x82')]===_0xec9391[_0x2985('0x83')]&&_0x114e51[_0x2985('0x53')][_0x2985('0x84')]&&_0x114e51[_0x2985('0x53')]['MessageStatus']==='read'){return _0xec9391[_0x2985('0x34')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x2985('0x85')](_0x114e51['body'],{'showHidden':![],'depth':null}));}break;}return _0xec9391;}})[_0x2985('0x21')](respondWithResult(_0x438b40,null))[_0x2985('0x52')](handleError(_0x438b40,null));}; \ No newline at end of file +var _0x154b=['bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','show','params','intersection','find','create','body','catch','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','Sequelize','QueryTypes','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0x154b,0x10c));var _0xb154=function(_0x5923d9,_0x4325b2){_0x5923d9=_0x5923d9-0x0;var _0x121fed=_0x154b[_0x5923d9];return _0x121fed;};'use strict';var emlformat=require(_0xb154('0x0'));var rimraf=require(_0xb154('0x1'));var zipdir=require(_0xb154('0x2'));var jsonpatch=require(_0xb154('0x3'));var rp=require(_0xb154('0x4'));var moment=require(_0xb154('0x5'));var BPromise=require(_0xb154('0x6'));var Mustache=require(_0xb154('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb154('0x8'));var csv=require(_0xb154('0x9'));var ejs=require(_0xb154('0xa'));var fs=require('fs');var fs_extra=require(_0xb154('0xb'));var _=require(_0xb154('0xc'));var squel=require(_0xb154('0xd'));var crypto=require(_0xb154('0xe'));var jsforce=require(_0xb154('0xf'));var deskjs=require(_0xb154('0x10'));var toCsv=require(_0xb154('0x9'));var querystring=require(_0xb154('0x11'));var Papa=require(_0xb154('0x12'));var Redis=require(_0xb154('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb154('0x14'));var hardwareService=require(_0xb154('0x15'));var logger=require(_0xb154('0x16'))('api');var utils=require(_0xb154('0x17'));var config=require(_0xb154('0x18'));var licenseUtil=require(_0xb154('0x19'));var db=require('../../mysqldb')['db'];config[_0xb154('0x1a')]=_['defaults'](config[_0xb154('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb154('0x1b'))(new Redis(config[_0xb154('0x1a')]));require(_0xb154('0x1c'))[_0xb154('0x1d')](socket);var jayson=require(_0xb154('0x1e'));var client=jayson[_0xb154('0x1f')][_0xb154('0x20')]({'port':0x232c});var client9002=jayson[_0xb154('0x1f')][_0xb154('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x564f8a,_0x5ef0a5,_0x2d11a9,_0x2cebef){return new BPromise(function(_0x23125f,_0x1979c4){var _0xb7f547=_0x2cebef||client;return _0xb7f547['request'](_0x564f8a,_0x2d11a9)[_0xb154('0x21')](function(_0x33aa1c){logger[_0xb154('0x22')](_0xb154('0x23'),_0x5ef0a5,_0xb154('0x24'));logger['debug'](_0xb154('0x25'),_0x5ef0a5,_0xb154('0x24'),JSON[_0xb154('0x26')](_0x33aa1c));if(_0x33aa1c[_0xb154('0x27')]){if(_0x33aa1c['error'][_0xb154('0x28')]===0x1f4){logger[_0xb154('0x27')](_0xb154('0x23'),_0x5ef0a5,_0x33aa1c['error'][_0xb154('0x29')]);return _0x1979c4(_0x33aa1c[_0xb154('0x27')][_0xb154('0x29')]);}logger[_0xb154('0x27')](_0xb154('0x23'),_0x5ef0a5,_0x33aa1c[_0xb154('0x27')][_0xb154('0x29')]);return _0x23125f(_0x33aa1c[_0xb154('0x27')][_0xb154('0x29')]);}else{logger[_0xb154('0x22')](_0xb154('0x23'),_0x5ef0a5,_0xb154('0x24'));_0x23125f(_0x33aa1c[_0xb154('0x2a')][_0xb154('0x29')]);}})['catch'](function(_0x10a30a){logger['error'](_0xb154('0x23'),_0x5ef0a5,_0x10a30a);_0x1979c4(_0x10a30a);});});}function respondWithStatusCode(_0xe51572,_0x2abb5f){_0x2abb5f=_0x2abb5f||0xcc;return function(_0x5d5b79){if(_0x5d5b79){return _0xe51572[_0xb154('0x2b')](_0x2abb5f);}return _0xe51572[_0xb154('0x2c')](_0x2abb5f)[_0xb154('0x2d')]();};}function respondWithResult(_0x65fd90,_0xeceac6){_0xeceac6=_0xeceac6||0xc8;return function(_0x4be511){if(_0x4be511){return _0x65fd90['status'](_0xeceac6)['json'](_0x4be511);}};}function respondWithFilteredResult(_0x2a7e3b,_0x1eb9b5){return function(_0x45e946){if(_0x45e946){var _0x374681=typeof _0x1eb9b5[_0xb154('0x2e')]===_0xb154('0x2f')&&typeof _0x1eb9b5[_0xb154('0x30')]===_0xb154('0x2f');var _0x5b18be=_0x45e946[_0xb154('0x31')];var _0x13d893=_0x374681?0x0:_0x1eb9b5['offset'];var _0x22768c=_0x374681?_0x45e946[_0xb154('0x31')]:_0x1eb9b5['offset']+_0x1eb9b5['limit'];var _0x3bf4a4;if(_0x22768c>=_0x5b18be){_0x22768c=_0x5b18be;_0x3bf4a4=0xc8;}else{_0x3bf4a4=0xce;}_0x2a7e3b['status'](_0x3bf4a4);return _0x2a7e3b[_0xb154('0x32')]('Content-Range',_0x13d893+'-'+_0x22768c+'/'+_0x5b18be)[_0xb154('0x33')](_0x45e946);}return null;};}function patchUpdates(_0x59f0b1){return function(_0x33343f){try{jsonpatch[_0xb154('0x34')](_0x33343f,_0x59f0b1,!![]);}catch(_0x22a0d1){return BPromise['reject'](_0x22a0d1);}return _0x33343f[_0xb154('0x35')]();};}function saveUpdates(_0x171148,_0x53a831){return function(_0x510d58){if(_0x510d58){return _0x510d58[_0xb154('0x36')](_0x171148)[_0xb154('0x21')](function(_0x213f2e){return _0x213f2e;});}return null;};}function removeEntity(_0x1c118e,_0x176279){return function(_0x70532a){if(_0x70532a){return _0x70532a[_0xb154('0x37')]()[_0xb154('0x21')](function(){_0x1c118e[_0xb154('0x2c')](0xcc)[_0xb154('0x2d')]();});}};}function handleEntityNotFound(_0x16f4e6,_0x1f458a){return function(_0x53d43a){if(!_0x53d43a){_0x16f4e6['sendStatus'](0x194);}return _0x53d43a;};}function handleError(_0x579878,_0x23197f){_0x23197f=_0x23197f||0x1f4;return function(_0x152e1f){logger['error'](_0x152e1f[_0xb154('0x38')]);if(_0x152e1f['name']){delete _0x152e1f[_0xb154('0x39')];}_0x579878[_0xb154('0x2c')](_0x23197f)[_0xb154('0x3a')](_0x152e1f);};}exports['index']=function(_0x5c4150,_0x1242b0){var _0x19c069={},_0x53e28b={},_0x3d69c6={'count':0x0,'rows':[]};var _0xe4d8e0=_[_0xb154('0x3b')](db[_0xb154('0x3c')][_0xb154('0x3d')],function(_0x544631){return{'name':_0x544631[_0xb154('0x3e')],'type':_0x544631['type'][_0xb154('0x3f')]};});_0x53e28b[_0xb154('0x40')]=_['map'](_0xe4d8e0,_0xb154('0x39'));_0x53e28b[_0xb154('0x41')]=_[_0xb154('0x42')](_0x5c4150[_0xb154('0x41')]);_0x53e28b[_0xb154('0x43')]=_['intersection'](_0x53e28b[_0xb154('0x40')],_0x53e28b[_0xb154('0x41')]);_0x19c069['attributes']=_['intersection'](_0x53e28b[_0xb154('0x40')],qs[_0xb154('0x44')](_0x5c4150[_0xb154('0x41')][_0xb154('0x44')]));_0x19c069[_0xb154('0x45')]=_0x19c069['attributes'][_0xb154('0x46')]?_0x19c069[_0xb154('0x45')]:_0x53e28b[_0xb154('0x40')];if(!_0x5c4150[_0xb154('0x41')]['hasOwnProperty'](_0xb154('0x47'))){_0x19c069[_0xb154('0x30')]=qs['limit'](_0x5c4150[_0xb154('0x41')][_0xb154('0x30')]);_0x19c069[_0xb154('0x2e')]=qs['offset'](_0x5c4150[_0xb154('0x41')][_0xb154('0x2e')]);}_0x19c069['order']=qs[_0xb154('0x48')](_0x5c4150[_0xb154('0x41')][_0xb154('0x48')]);_0x19c069[_0xb154('0x49')]=qs[_0xb154('0x43')](_['pick'](_0x5c4150['query'],_0x53e28b[_0xb154('0x43')]),_0xe4d8e0);if(_0x5c4150['query'][_0xb154('0x4a')]){_0x19c069[_0xb154('0x49')]=_[_0xb154('0x4b')](_0x19c069[_0xb154('0x49')],{'$or':_[_0xb154('0x3b')](_0xe4d8e0,function(_0x43aeed){if(_0x43aeed['type']!==_0xb154('0x4c')){var _0x2102b5={};_0x2102b5[_0x43aeed['name']]={'$like':'%'+_0x5c4150[_0xb154('0x41')][_0xb154('0x4a')]+'%'};return _0x2102b5;}})});}_0x19c069=_[_0xb154('0x4b')]({},_0x19c069,_0x5c4150[_0xb154('0x4d')]);var _0x2ac017={'where':_0x19c069[_0xb154('0x49')]};return db[_0xb154('0x3c')][_0xb154('0x31')](_0x2ac017)[_0xb154('0x21')](function(_0x4756c6){_0x3d69c6[_0xb154('0x31')]=_0x4756c6;if(_0x5c4150['query'][_0xb154('0x4e')]){_0x19c069['include']=[{'all':!![]}];}return db[_0xb154('0x3c')]['findAll'](_0x19c069);})[_0xb154('0x21')](function(_0x152c6e){_0x3d69c6['rows']=_0x152c6e;return _0x3d69c6;})[_0xb154('0x21')](respondWithFilteredResult(_0x1242b0,_0x19c069))['catch'](handleError(_0x1242b0,null));};exports[_0xb154('0x4f')]=function(_0x300cd2,_0x12eece){var _0x44ab56={'raw':!![],'where':{'id':_0x300cd2[_0xb154('0x50')]['id']}},_0x3819d6={};_0x3819d6['model']=_[_0xb154('0x42')](db[_0xb154('0x3c')][_0xb154('0x3d')]);_0x3819d6[_0xb154('0x41')]=_[_0xb154('0x42')](_0x300cd2['query']);_0x3819d6[_0xb154('0x43')]=_[_0xb154('0x51')](_0x3819d6[_0xb154('0x40')],_0x3819d6[_0xb154('0x41')]);_0x44ab56[_0xb154('0x45')]=_[_0xb154('0x51')](_0x3819d6[_0xb154('0x40')],qs['fields'](_0x300cd2[_0xb154('0x41')]['fields']));_0x44ab56['attributes']=_0x44ab56[_0xb154('0x45')][_0xb154('0x46')]?_0x44ab56[_0xb154('0x45')]:_0x3819d6['model'];if(_0x300cd2[_0xb154('0x41')][_0xb154('0x4e')]){_0x44ab56['include']=[{'all':!![]}];}_0x44ab56=_[_0xb154('0x4b')]({},_0x44ab56,_0x300cd2['options']);return db['WhatsappMessage'][_0xb154('0x52')](_0x44ab56)[_0xb154('0x21')](handleEntityNotFound(_0x12eece,null))[_0xb154('0x21')](respondWithResult(_0x12eece,null))['catch'](handleError(_0x12eece,null));};exports[_0xb154('0x53')]=function(_0x2fb347,_0x4609d0){return db[_0xb154('0x3c')][_0xb154('0x53')](_0x2fb347[_0xb154('0x54')],{})[_0xb154('0x21')](respondWithResult(_0x4609d0,0xc9))['catch'](handleError(_0x4609d0,null));};exports[_0xb154('0x36')]=function(_0x5e874c,_0x5997ac){if(_0x5e874c[_0xb154('0x54')]['id']){delete _0x5e874c[_0xb154('0x54')]['id'];}return db['WhatsappMessage'][_0xb154('0x52')]({'where':{'id':_0x5e874c[_0xb154('0x50')]['id']}})[_0xb154('0x21')](handleEntityNotFound(_0x5997ac,null))[_0xb154('0x21')](saveUpdates(_0x5e874c[_0xb154('0x54')],null))[_0xb154('0x21')](respondWithResult(_0x5997ac,null))[_0xb154('0x55')](handleError(_0x5997ac,null));};exports[_0xb154('0x37')]=function(_0x3acd93,_0xfc1754){return db[_0xb154('0x3c')]['find']({'where':{'id':_0x3acd93['params']['id']}})['then'](handleEntityNotFound(_0xfc1754,null))[_0xb154('0x21')](removeEntity(_0xfc1754,null))[_0xb154('0x55')](handleError(_0xfc1754,null));};exports[_0xb154('0x56')]=function(_0x115f78,_0x433718){return db[_0xb154('0x3c')]['describe']()[_0xb154('0x21')](respondWithResult(_0x433718,null))[_0xb154('0x55')](handleError(_0x433718,null));};var interaction_log=require('../../config/logger')(_0xb154('0x57'));exports[_0xb154('0x58')]=function(_0x413c2d,_0x5274b0,_0x3653ed){var _0x36897b={'agent':{},'channel':_0xb154('0x59')};if(_0x413c2d[_0xb154('0x54')]['id']){delete _0x413c2d[_0xb154('0x54')]['id'];}_0x413c2d[_0xb154('0x54')][_0xb154('0x5a')]=!![];_0x413c2d[_0xb154('0x54')][_0xb154('0x5b')]=moment()[_0xb154('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x413c2d[_0xb154('0x54')][_0xb154('0x5d')]=_0x413c2d[_0xb154('0x54')][_0xb154('0x5d')]||_0x413c2d[_0xb154('0x5e')]['id'];_0x36897b[_0xb154('0x5f')]['id']=_0x413c2d[_0xb154('0x54')][_0xb154('0x5d')];return db[_0xb154('0x3c')][_0xb154('0x52')]({'where':{'id':_0x413c2d[_0xb154('0x50')]['id'],'UserId':null}})[_0xb154('0x21')](handleEntityNotFound(_0x5274b0,null))['then'](saveUpdates(_0x413c2d[_0xb154('0x54')],null))[_0xb154('0x21')](function(_0x3f6cdd){if(_0x3f6cdd){_0x36897b[_0xb154('0x29')]=_0x3f6cdd[_0xb154('0x60')]({'plain':!![]});return db[_0xb154('0x61')][_0xb154('0x52')]({'where':{'id':_0x3f6cdd[_0xb154('0x62')]}});}return null;})[_0xb154('0x21')](handleEntityNotFound(_0x5274b0,null))['then'](function(_0x11ee2e){if(_0x11ee2e){return _0x11ee2e[_0xb154('0x36')]({'UserId':_0x413c2d['body'][_0xb154('0x5d')],'read1stAt':_[_0xb154('0x63')](_0x11ee2e['read1stAt'])?moment()['format'](_0xb154('0x64')):undefined});}return null;})[_0xb154('0x21')](function(_0x2b1dc6){if(_0x2b1dc6){_0x36897b[_0xb154('0x65')]=_0x2b1dc6['get']({'plain':!![]});interaction_log[_0xb154('0x22')](_0xb154('0x66'),_0x413c2d['user']['id'],_0x413c2d[_0xb154('0x5e')][_0xb154('0x39')],_0x413c2d[_0xb154('0x5e')][_0xb154('0x67')],_0x36897b[_0xb154('0x65')]['id'],_0x413c2d['body']?JSON[_0xb154('0x26')](_0x413c2d[_0xb154('0x54')]):'null');return respondWithRpcPromise(_0xb154('0x68'),_0xb154('0x69'),_0x36897b);}return null;})[_0xb154('0x21')](function(_0x42d479){var _0x38d4e1=_0xb154('0x6a')+_0x42d479[_0xb154('0x29')][_0xb154('0x6b')];return db['sequelize'][_0xb154('0x41')](_0x38d4e1,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xb154('0x21')](function(_0x525b1c){return _0x525b1c;});})['then'](function(_0x23595c){if(_0x23595c){_0x36897b[_0xb154('0x29')][_0xb154('0x6c')]=_0x23595c[0x0];if(!_0x413c2d[_0xb154('0x54')]['UserId'])return;return db[_0xb154('0x6d')]['find']({'where':{'id':_0x413c2d[_0xb154('0x54')][_0xb154('0x5d')],'role':'agent'},'attributes':['id',_0xb154('0x39'),_0xb154('0x6e'),_0xb154('0x6f'),_0xb154('0x70')],'raw':!![]});}return null;})[_0xb154('0x21')](function(_0x5a94ce){if(!_0x5a94ce)return null;_0x36897b[_0xb154('0x29')][_0xb154('0x5f')]=_0x5a94ce;return _0x36897b;})['then'](function(_0x2db7ab){if(_0x2db7ab){if(_0x413c2d[_0xb154('0x54')][_0xb154('0x71')]){_0x36897b[_0xb154('0x29')][_0xb154('0x72')]=util[_0xb154('0x5c')](_0xb154('0x73'),_0x413c2d['user']['name']);_0x36897b['message'][_0xb154('0x74')]=_0x36897b['channel'];_0x36897b[_0xb154('0x29')][_0xb154('0x75')]=_0x36897b[_0xb154('0x74')];_0x36897b[_0xb154('0x29')][_0xb154('0x76')]=_0xb154('0x58');return respondWithRpcPromise(_0xb154('0x77'),'EventManager',{'event':'acceptmessage','message':_0x36897b[_0xb154('0x29')]},client9002)[_0xb154('0x21')](function(){return _0x36897b;});}return _0x36897b;}return null;})[_0xb154('0x21')](respondWithResult(_0x5274b0,null))['catch'](handleError(_0x5274b0,null));};var interaction_log=require('../../config/logger')(_0xb154('0x57'));exports[_0xb154('0x78')]=function(_0x5ab2b0,_0x22d5a3,_0x3fdd7c){var _0x505a38={'agent':{},'channel':_0xb154('0x59')};if(_0x5ab2b0[_0xb154('0x54')]['id']){delete _0x5ab2b0[_0xb154('0x54')]['id'];}_0x5ab2b0[_0xb154('0x54')][_0xb154('0x5d')]=_0x5ab2b0[_0xb154('0x54')][_0xb154('0x5d')]||_0x5ab2b0['user']['id'];_0x505a38[_0xb154('0x5f')]['id']=_0x5ab2b0[_0xb154('0x54')][_0xb154('0x5d')];return db['WhatsappMessage'][_0xb154('0x52')]({'where':{'id':_0x5ab2b0['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x22d5a3,null))[_0xb154('0x21')](function(_0x1cd110){if(_0x1cd110){_0x505a38[_0xb154('0x29')]=_0x1cd110['get']({'plain':!![]});return db[_0xb154('0x61')]['find']({'where':{'id':_0x1cd110['WhatsappInteractionId']}});}return null;})[_0xb154('0x21')](handleEntityNotFound(_0x22d5a3,null))[_0xb154('0x21')](function(_0x353e0e){if(_0x353e0e){_0x505a38[_0xb154('0x65')]=_0x353e0e[_0xb154('0x60')]({'plain':!![]});interaction_log[_0xb154('0x22')](_0xb154('0x79'),_0x5ab2b0['user']['id'],_0x5ab2b0[_0xb154('0x5e')][_0xb154('0x39')],_0x5ab2b0['user'][_0xb154('0x67')],_0x505a38[_0xb154('0x65')]['id'],_0x5ab2b0['body']?JSON['stringify'](_0x5ab2b0[_0xb154('0x54')]):_0xb154('0x7a'));return respondWithRpcPromise('RejectMessage',_0xb154('0x7b'),_0x505a38);}return null;})[_0xb154('0x21')](function(_0xc5456c){var _0x6de7d9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xc5456c[_0xb154('0x29')][_0xb154('0x6b')];return db[_0xb154('0x7c')][_0xb154('0x41')](_0x6de7d9,{'type':db[_0xb154('0x7d')][_0xb154('0x7e')]['SELECT'],'raw':!![]})['then'](function(_0xe644bc){return _0xe644bc;});})[_0xb154('0x21')](function(_0x339975){if(_0x339975){_0x505a38['message'][_0xb154('0x6c')]=_0x339975[0x0];if(!_0x5ab2b0[_0xb154('0x54')][_0xb154('0x5d')])return;return db[_0xb154('0x6d')]['find']({'where':{'id':_0x5ab2b0['body']['UserId'],'role':_0xb154('0x5f')},'attributes':['id',_0xb154('0x39'),_0xb154('0x6e'),_0xb154('0x6f'),'internal'],'raw':!![]});}return null;})[_0xb154('0x21')](function(_0x1b6cec){if(!_0x1b6cec)return null;_0x505a38[_0xb154('0x29')][_0xb154('0x5f')]=_0x1b6cec;return _0x505a38;})[_0xb154('0x21')](function(_0x2dda93){if(_0x2dda93){_0x2dda93[_0xb154('0x29')]['interface']=util[_0xb154('0x5c')](_0xb154('0x73'),_0x5ab2b0[_0xb154('0x5e')][_0xb154('0x39')]);_0x2dda93[_0xb154('0x29')]['channel']=_0x505a38[_0xb154('0x74')];_0x2dda93[_0xb154('0x29')][_0xb154('0x75')]=_0x505a38['channel'];_0x2dda93[_0xb154('0x29')][_0xb154('0x76')]=_0xb154('0x78');respondWithRpcPromise(_0xb154('0x77'),_0xb154('0x77'),{'event':_0xb154('0x7f'),'message':_0x2dda93['message']},client9002);return _0x505a38;}return null;})['then'](respondWithResult(_0x22d5a3,null))[_0xb154('0x55')](handleError(_0x22d5a3,null));};exports[_0xb154('0x2c')]=function(_0x9ca4fd,_0x3b25ef,_0x24c9dc){if(_0x9ca4fd[_0xb154('0x54')]['id']){delete _0x9ca4fd[_0xb154('0x54')]['id'];}var _0x2b41ac;return db[_0xb154('0x3c')][_0xb154('0x52')]({'where':{'id':_0x9ca4fd[_0xb154('0x50')]['id']}})[_0xb154('0x21')](handleEntityNotFound(_0x3b25ef,null))[_0xb154('0x21')](function(_0x4a2a8d){if(_0x4a2a8d){_0x2b41ac=_0x4a2a8d;return db[_0xb154('0x80')][_0xb154('0x52')]({'where':{'id':_0x4a2a8d['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x3b25ef,null))['then'](function(_0x4891e3){if(_0x4891e3){logger['debug'](_0xb154('0x81'),_0xb154('0x2c'),_0xb154('0x82'),_0x4891e3['type'],util['inspect'](_0x9ca4fd[_0xb154('0x54')],{'showHidden':![],'depth':null}));switch(_0x4891e3[_0xb154('0x83')]){case'twilio':if(_0x9ca4fd[_0xb154('0x54')][_0xb154('0x84')]&&_0x9ca4fd[_0xb154('0x54')]['MessageSid']===_0x2b41ac['messageId']&&_0x9ca4fd['body'][_0xb154('0x85')]&&_0x9ca4fd['body'][_0xb154('0x85')]===_0xb154('0x5a')){return _0x2b41ac[_0xb154('0x36')]({'read':!![]});}else{logger[_0xb154('0x27')](_0xb154('0x86'),_0xb154('0x2c'),_0xb154('0x87'),util[_0xb154('0x88')](_0x9ca4fd['body'],{'showHidden':![],'depth':null}));}break;}return _0x2b41ac;}})['then'](respondWithResult(_0x3b25ef,null))[_0xb154('0x55')](handleError(_0x3b25ef,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9af94da..9b95681 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 _0x9b87=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2e2eaf,_0x553b77){var _0x5ea4fa=function(_0x4e63b7){while(--_0x4e63b7){_0x2e2eaf['push'](_0x2e2eaf['shift']());}};_0x5ea4fa(++_0x553b77);}(_0x9b87,0x8e));var _0x79b8=function(_0x1254ad,_0xbc87b1){_0x1254ad=_0x1254ad-0x0;var _0x403683=_0x9b87[_0x1254ad];return _0x403683;};'use strict';var EventEmitter=require(_0x79b8('0x0'));var WhatsappMessage=require(_0x79b8('0x1'))['db'][_0x79b8('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x79b8('0x3')](0x0);var events={'afterCreate':_0x79b8('0x4'),'afterUpdate':_0x79b8('0x5'),'afterDestroy':_0x79b8('0x6')};function emitEvent(_0xb4e3e7){return function(_0xbc1e74,_0xa65bbc,_0x1f9679){WhatsappMessageEvents[_0x79b8('0x7')](_0xb4e3e7+':'+_0xbc1e74['id'],_0xbc1e74);WhatsappMessageEvents[_0x79b8('0x7')](_0xb4e3e7,_0xbc1e74);_0x1f9679(null);};}for(var e in events){if(events[_0x79b8('0x8')](e)){var event=events[e];WhatsappMessage[_0x79b8('0x9')](e,emitEvent(event));}}module[_0x79b8('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x2f3a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x2efcec,_0x5576ea){var _0x58d887=function(_0x3f591e){while(--_0x3f591e){_0x2efcec['push'](_0x2efcec['shift']());}};_0x58d887(++_0x5576ea);}(_0x2f3a,0xfb));var _0xa2f3=function(_0xf3d909,_0xb9e263){_0xf3d909=_0xf3d909-0x0;var _0x24bab6=_0x2f3a[_0xf3d909];return _0x24bab6;};'use strict';var EventEmitter=require(_0xa2f3('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xa2f3('0x1')](0x0);var events={'afterCreate':_0xa2f3('0x2'),'afterUpdate':_0xa2f3('0x3'),'afterDestroy':_0xa2f3('0x4')};function emitEvent(_0x17ec7a){return function(_0xdf4c17,_0x50ef95,_0x78edcd){WhatsappMessageEvents['emit'](_0x17ec7a+':'+_0xdf4c17['id'],_0xdf4c17);WhatsappMessageEvents[_0xa2f3('0x5')](_0x17ec7a,_0xdf4c17);_0x78edcd(null);};}for(var e in events){if(events[_0xa2f3('0x6')](e)){var event=events[e];WhatsappMessage['hook'](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 ae1729a..272c129 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 _0x880c=['body','phone','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/messages/','text','Bearer\x20','application/json','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','find','WhatsappAccountId','then','type','twilio','authToken','accountSid','messages','create'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x880c,0x1bb));var _0xc880=function(_0x3f5677,_0x2f9db7){_0x3f5677=_0x3f5677-0x0;var _0x3cb65b=_0x880c[_0x3f5677];return _0x3cb65b;};'use strict';var _=require(_0xc880('0x0'));var util=require('util');var logger=require(_0xc880('0x1'))('api');var moment=require(_0xc880('0x2'));var BPromise=require(_0xc880('0x3'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require(_0xc880('0x4'));var config=require(_0xc880('0x5'));var attributes=require(_0xc880('0x6'));module[_0xc880('0x7')]=function(_0x5a93e4,_0x1a1672){return _0x5a93e4[_0xc880('0x8')]('WhatsappMessage',attributes,{'tableName':_0xc880('0x9'),'paranoid':![],'indexes':[{'name':_0xc880('0xa'),'fields':[_0xc880('0xa')]},{'name':_0xc880('0xb'),'fields':['body'],'type':_0xc880('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b14db,_0x3ee5cf,_0x9467e5){var _0x24dabf=_0x5a93e4[_0xc880('0xd')];var _0x18d4e5=_0x4b14db['get']({'plain':!![]});if(_0x18d4e5[_0xc880('0xe')][_0xc880('0xf')]()==='in'||_0x18d4e5[_0xc880('0xe')][_0xc880('0xf')]()===_0xc880('0x10')&&!_0x18d4e5[_0xc880('0x11')]&&!_['isNil'](_0x18d4e5['UserId'])){_0x24dabf[_0xc880('0x12')][_0xc880('0x13')]({'where':{'id':_0x18d4e5[_0xc880('0x14')]}})['then'](function(_0x24f227){if(_0x24f227){_0x24f227[_0xc880('0x15')]({'lastMsgAt':_0x18d4e5[_0xc880('0x16')],'lastMsgDirection':_0x18d4e5[_0xc880('0xe')][_0xc880('0xf')]()});}})[_0xc880('0x17')](function(_0x36c802){console[_0xc880('0x18')](_0x36c802);});}if(_0x18d4e5[_0xc880('0xe')]===_0xc880('0x10')&&!_0x18d4e5[_0xc880('0x11')]){var _0x30cbea;_0x24dabf['WhatsappAccount'][_0xc880('0x19')]({'where':{'id':_0x18d4e5[_0xc880('0x1a')]},'raw':!![]})[_0xc880('0x1b')](function(_0x5c56df){_0x30cbea=_0x5c56df;if(_0x30cbea&&_0x30cbea['type']){switch(_0x30cbea[_0xc880('0x1c')]){case'twilio':var _0x26c508=require(_0xc880('0x1d'));if(_0x30cbea['accountSid']&&_0x30cbea[_0xc880('0x1e')]&&_0x30cbea['phone']){var _0x379cdd=new _0x26c508(_0x30cbea[_0xc880('0x1f')],_0x30cbea[_0xc880('0x1e')]);_0x379cdd[_0xc880('0x20')][_0xc880('0x21')]({'body':_0x18d4e5[_0xc880('0x22')],'to':'whatsapp:'+_0x18d4e5[_0xc880('0x23')],'from':'whatsapp:'+_0x30cbea['phone'],'statusCallback':_0x30cbea['remote']+_0xc880('0x24')+_0x18d4e5['id']+_0xc880('0x25')+_0x30cbea['token']})[_0xc880('0x1b')](function(_0x26d518){if(_0x26d518[_0xc880('0x26')]){return _0x4b14db[_0xc880('0x15')]({'messageId':_0x26d518['sid']});}})[_0xc880('0x17')](function(_0x26db24){logger['error'](_0xc880('0x27'),'afterCreate',_0xc880('0x1d'),util[_0xc880('0x28')](_0x26db24,{'showHidden':![],'depth':null}));});}else{logger[_0xc880('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc880('0x29'),_0xc880('0x1d'),_0xc880('0x2a'));}break;case'sinch':var _0x2a117a=_0x30cbea[_0xc880('0x1f')];var _0x3072d8=_0x30cbea['authToken'];var _0xa5f95e=_0x30cbea[_0xc880('0x2b')]+'/whatsapp/v1/'+_0x2a117a+_0xc880('0x2c');var _0x471f0c={'to':[_0x18d4e5['phone']],'message':{'type':_0xc880('0x2d'),'text':_0x18d4e5[_0xc880('0x22')]}};var _0xaa7b87={'method':'POST','uri':_0xa5f95e,'headers':{'Authorization':_0xc880('0x2e')+_0x3072d8,'Content-Type':_0xc880('0x2f')},'body':_0x471f0c,'json':!![]};rp(_0xaa7b87)[_0xc880('0x1b')](function(_0x3aa225){if(_0x3aa225[_0xc880('0x30')][0x0]['message_id']){return _0x4b14db[_0xc880('0x15')]({'messageId':_0x3aa225[_0xc880('0x30')][0x0]['message_id']});}})['catch'](function(_0x40d7f6){logger[_0xc880('0x31')](_0xc880('0x32'),_0x40d7f6);});break;}}})[_0xc880('0x33')](function(){_0x9467e5();});}else{_0x9467e5();}}},'charset':'utf8mb4','collate':_0xc880('0x34')});}; \ No newline at end of file +var _0xdc50=['type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId'];(function(_0x18415f,_0x5ed38b){var _0x46c4a9=function(_0x59a436){while(--_0x59a436){_0x18415f['push'](_0x18415f['shift']());}};_0x46c4a9(++_0x5ed38b);}(_0xdc50,0x147));var _0x0dc5=function(_0x219e0c,_0x3db172){_0x219e0c=_0x219e0c-0x0;var _0x539ae3=_0xdc50[_0x219e0c];return _0x539ae3;};'use strict';var _=require(_0x0dc5('0x0'));var util=require('util');var logger=require(_0x0dc5('0x1'))(_0x0dc5('0x2'));var moment=require(_0x0dc5('0x3'));var BPromise=require(_0x0dc5('0x4'));var rp=require(_0x0dc5('0x5'));var fetch=require(_0x0dc5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dc5('0x7'));var config=require('../../config/environment');var attributes=require(_0x0dc5('0x8'));module[_0x0dc5('0x9')]=function(_0xa625b8,_0x4e0afc){return _0xa625b8[_0x0dc5('0xa')](_0x0dc5('0xb'),attributes,{'tableName':_0x0dc5('0xc'),'paranoid':![],'indexes':[{'name':_0x0dc5('0xd'),'fields':['messageId']},{'name':_0x0dc5('0xe'),'fields':[_0x0dc5('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3fc0a2,_0x1f7a59,_0x15bbaf){var _0x522517=_0xa625b8[_0x0dc5('0x10')];var _0x476cef=_0x3fc0a2[_0x0dc5('0x11')]({'plain':!![]});if(_0x476cef[_0x0dc5('0x12')][_0x0dc5('0x13')]()==='in'||_0x476cef[_0x0dc5('0x12')][_0x0dc5('0x13')]()===_0x0dc5('0x14')&&!_0x476cef[_0x0dc5('0x15')]&&!_[_0x0dc5('0x16')](_0x476cef['UserId'])){_0x522517['WhatsappInteraction'][_0x0dc5('0x17')]({'where':{'id':_0x476cef[_0x0dc5('0x18')]}})[_0x0dc5('0x19')](function(_0x375053){if(_0x375053){_0x375053[_0x0dc5('0x1a')]({'lastMsgAt':_0x476cef[_0x0dc5('0x1b')],'lastMsgDirection':_0x476cef[_0x0dc5('0x12')][_0x0dc5('0x13')]()});}})[_0x0dc5('0x1c')](function(_0x51e886){console[_0x0dc5('0x1d')](_0x51e886);});}if(_0x476cef[_0x0dc5('0x12')]===_0x0dc5('0x14')&&!_0x476cef[_0x0dc5('0x15')]){var _0x33fc17;_0x522517[_0x0dc5('0x1e')][_0x0dc5('0x1f')]({'where':{'id':_0x476cef[_0x0dc5('0x20')]},'raw':!![]})[_0x0dc5('0x19')](function(_0x35b6d8){_0x33fc17=_0x35b6d8;if(_0x33fc17&&_0x33fc17['type']){switch(_0x33fc17[_0x0dc5('0x21')]){case _0x0dc5('0x22'):var _0xe861ff=require('twilio');if(_0x33fc17[_0x0dc5('0x23')]&&_0x33fc17[_0x0dc5('0x24')]&&_0x33fc17['phone']){var _0x52a3=new _0xe861ff(_0x33fc17['accountSid'],_0x33fc17['authToken']);_0x52a3[_0x0dc5('0x25')][_0x0dc5('0x26')]({'body':_0x476cef[_0x0dc5('0xf')],'to':_0x0dc5('0x27')+_0x476cef[_0x0dc5('0x28')],'from':_0x0dc5('0x27')+_0x33fc17['phone'],'statusCallback':_0x33fc17[_0x0dc5('0x29')]+_0x0dc5('0x2a')+_0x476cef['id']+_0x0dc5('0x2b')+_0x33fc17['token']})[_0x0dc5('0x19')](function(_0x180bd7){if(_0x180bd7[_0x0dc5('0x2c')]){return _0x3fc0a2[_0x0dc5('0x1a')]({'messageId':_0x180bd7[_0x0dc5('0x2c')]});}})[_0x0dc5('0x1c')](function(_0x3db8e2){logger[_0x0dc5('0x1d')](_0x0dc5('0x2d'),_0x0dc5('0x2e'),_0x0dc5('0x22'),util['inspect'](_0x3db8e2,{'showHidden':![],'depth':null}));});}else{logger[_0x0dc5('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x0dc5('0x2e'),_0x0dc5('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0dc5('0x2f'):var _0x55f72d=_0x33fc17[_0x0dc5('0x23')];var _0x2be089=_0x33fc17[_0x0dc5('0x24')];var _0x4552dd=_0x33fc17[_0x0dc5('0x30')]+_0x0dc5('0x31')+_0x55f72d+_0x0dc5('0x32');var _0x2643b9={'to':[_0x476cef[_0x0dc5('0x28')]],'message':{'type':_0x0dc5('0x33'),'text':_0x476cef[_0x0dc5('0xf')]}};var _0xe74865={'method':_0x0dc5('0x34'),'uri':_0x4552dd,'headers':{'Authorization':_0x0dc5('0x35')+_0x2be089,'Content-Type':_0x0dc5('0x36')},'body':_0x2643b9,'json':!![]};rp(_0xe74865)[_0x0dc5('0x19')](function(_0x18d40a){if(_0x18d40a['statuses'][0x0][_0x0dc5('0x37')]){return _0x3fc0a2[_0x0dc5('0x1a')]({'messageId':_0x18d40a[_0x0dc5('0x38')][0x0][_0x0dc5('0x37')]});}})[_0x0dc5('0x1c')](function(_0x546047){logger['err'](_0x0dc5('0x39'),_0x546047);});break;}}})['finally'](function(){_0x15bbaf();});}else{_0x15bbaf();}}},'charset':_0x0dc5('0x3a'),'collate':_0x0dc5('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f238d81..8fa5070 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 _0xcd26=['client','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','raw','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb28260,_0x48df4b){var _0xe29669=function(_0x29d0c1){while(--_0x29d0c1){_0xb28260['push'](_0xb28260['shift']());}};_0xe29669(++_0x48df4b);}(_0xcd26,0x1a3));var _0x6cd2=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0xcd26[_0x224dda];return _0x2987ac;};'use strict';var _=require(_0x6cd2('0x0'));var util=require(_0x6cd2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6cd2('0x2'));var fs=require('fs');var Redis=require(_0x6cd2('0x3'));var db=require(_0x6cd2('0x4'))['db'];var utils=require(_0x6cd2('0x5'));var logger=require(_0x6cd2('0x6'))(_0x6cd2('0x7'));var config=require(_0x6cd2('0x8'));var jayson=require(_0x6cd2('0x9'));var client=jayson[_0x6cd2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6cd2('0xb')](config[_0x6cd2('0xc')],{'host':_0x6cd2('0xd'),'port':0x18eb});var socket=require(_0x6cd2('0xe'))(new Redis(config['redis']));require(_0x6cd2('0xf'))['register'](socket);function respondWithRpcPromise(_0xfe9f9a,_0x2e7cf3,_0x282c76){return new BPromise(function(_0x246404,_0x1ce9cc){return client[_0x6cd2('0x10')](_0xfe9f9a,_0x282c76)[_0x6cd2('0x11')](function(_0x3e8bba){logger[_0x6cd2('0x12')](_0x6cd2('0x13'),_0x2e7cf3,_0x6cd2('0x14'));logger[_0x6cd2('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2e7cf3,'request\x20sent',JSON['stringify'](_0x3e8bba));if(_0x3e8bba[_0x6cd2('0x16')]){if(_0x3e8bba['error'][_0x6cd2('0x17')]===0x1f4){logger[_0x6cd2('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x2e7cf3,_0x3e8bba[_0x6cd2('0x16')][_0x6cd2('0x18')]);return _0x1ce9cc(_0x3e8bba['error'][_0x6cd2('0x18')]);}logger['error'](_0x6cd2('0x13'),_0x2e7cf3,_0x3e8bba[_0x6cd2('0x16')]['message']);return _0x246404(_0x3e8bba[_0x6cd2('0x16')][_0x6cd2('0x18')]);}else{logger[_0x6cd2('0x12')](_0x6cd2('0x13'),_0x2e7cf3,'request\x20sent');_0x246404(_0x3e8bba[_0x6cd2('0x19')][_0x6cd2('0x18')]);}})[_0x6cd2('0x1a')](function(_0x27b5cd){logger[_0x6cd2('0x16')](_0x6cd2('0x13'),_0x2e7cf3,_0x27b5cd);_0x1ce9cc(_0x27b5cd);});});}exports[_0x6cd2('0x1b')]=function(_0x36bdda){var _0x4bb512=this;return new Promise(function(_0x41922f,_0x84efae){return db[_0x6cd2('0x1c')][_0x6cd2('0x1d')](_0x36bdda[_0x6cd2('0x1e')],{'raw':_0x36bdda['options']?_0x36bdda['options'][_0x6cd2('0x1f')]===undefined?!![]:![]:!![]})[_0x6cd2('0x11')](function(_0x9bd978){logger[_0x6cd2('0x12')](_0x6cd2('0x1b'),_0x36bdda);logger[_0x6cd2('0x15')](_0x6cd2('0x1b'),_0x36bdda,JSON[_0x6cd2('0x20')](_0x9bd978));_0x41922f(_0x9bd978);})['catch'](function(_0x46b99e){logger[_0x6cd2('0x16')](_0x6cd2('0x1b'),_0x46b99e['message'],_0x36bdda);_0x84efae(_0x4bb512['error'](0x1f4,_0x46b99e['message']));});});}; \ No newline at end of file +var _0x2044=['socket.io-emitter','./whatsappMessage.socket','register','request','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x372784,_0x56f443){var _0x2f6c06=function(_0x2e94ab){while(--_0x2e94ab){_0x372784['push'](_0x372784['shift']());}};_0x2f6c06(++_0x56f443);}(_0x2044,0x1a2));var _0x4204=function(_0x3fbebf,_0x496648){_0x3fbebf=_0x3fbebf-0x0;var _0x105cf7=_0x2044[_0x3fbebf];return _0x105cf7;};'use strict';var _=require(_0x4204('0x0'));var util=require(_0x4204('0x1'));var moment=require('moment');var BPromise=require(_0x4204('0x2'));var rs=require(_0x4204('0x3'));var fs=require('fs');var Redis=require(_0x4204('0x4'));var db=require(_0x4204('0x5'))['db'];var utils=require(_0x4204('0x6'));var logger=require(_0x4204('0x7'))(_0x4204('0x8'));var config=require(_0x4204('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4204('0xa')][_0x4204('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4204('0xc')],{'host':_0x4204('0xd'),'port':0x18eb});var socket=require(_0x4204('0xe'))(new Redis(config[_0x4204('0xc')]));require(_0x4204('0xf'))[_0x4204('0x10')](socket);function respondWithRpcPromise(_0x27542f,_0x9472c3,_0x5b25dd){return new BPromise(function(_0x2ce38e,_0x1628b4){return client[_0x4204('0x11')](_0x27542f,_0x5b25dd)['then'](function(_0x5ea0e9){logger['info'](_0x4204('0x12'),_0x9472c3,'request\x20sent');logger[_0x4204('0x13')](_0x4204('0x14'),_0x9472c3,_0x4204('0x15'),JSON[_0x4204('0x16')](_0x5ea0e9));if(_0x5ea0e9[_0x4204('0x17')]){if(_0x5ea0e9[_0x4204('0x17')][_0x4204('0x18')]===0x1f4){logger['error'](_0x4204('0x12'),_0x9472c3,_0x5ea0e9['error'][_0x4204('0x19')]);return _0x1628b4(_0x5ea0e9['error'][_0x4204('0x19')]);}logger[_0x4204('0x17')](_0x4204('0x12'),_0x9472c3,_0x5ea0e9['error'][_0x4204('0x19')]);return _0x2ce38e(_0x5ea0e9[_0x4204('0x17')][_0x4204('0x19')]);}else{logger[_0x4204('0x1a')](_0x4204('0x12'),_0x9472c3,_0x4204('0x15'));_0x2ce38e(_0x5ea0e9[_0x4204('0x1b')][_0x4204('0x19')]);}})[_0x4204('0x1c')](function(_0xc7f446){logger[_0x4204('0x17')](_0x4204('0x12'),_0x9472c3,_0xc7f446);_0x1628b4(_0xc7f446);});});}exports[_0x4204('0x1d')]=function(_0x5e211d){var _0x10e0d3=this;return new Promise(function(_0x3a35a5,_0x141e6a){return db[_0x4204('0x1e')][_0x4204('0x1f')](_0x5e211d[_0x4204('0x20')],{'raw':_0x5e211d[_0x4204('0x21')]?_0x5e211d[_0x4204('0x21')][_0x4204('0x22')]===undefined?!![]:![]:!![]})[_0x4204('0x23')](function(_0x45ebee){logger[_0x4204('0x1a')]('CreateWhatsappMessage',_0x5e211d);logger[_0x4204('0x13')]('CreateWhatsappMessage',_0x5e211d,JSON[_0x4204('0x16')](_0x45ebee));_0x3a35a5(_0x45ebee);})['catch'](function(_0x4b1318){logger['error'](_0x4204('0x1d'),_0x4b1318['message'],_0x5e211d);_0x141e6a(_0x10e0d3[_0x4204('0x17')](0x1f4,_0x4b1318[_0x4204('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 470ea90..2a2d779 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 _0xb4a8=['update','emit','removeListener','length','whatsappMessage:','save','remove'];(function(_0xa98fe4,_0x4bf163){var _0x3083ff=function(_0x259b22){while(--_0x259b22){_0xa98fe4['push'](_0xa98fe4['shift']());}};_0x3083ff(++_0x4bf163);}(_0xb4a8,0xec));var _0x8b4a=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xb4a8[_0x4fa438];return _0x4e3958;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x8b4a('0x0'),_0x8b4a('0x1'),_0x8b4a('0x2')];function createListener(_0x4f792a,_0x57dd3){return function(_0x27fe61){_0x57dd3[_0x8b4a('0x3')](_0x4f792a,_0x27fe61);};}function removeListener(_0x2b910a,_0x1466de){return function(){WhatsappMessageEvents[_0x8b4a('0x4')](_0x2b910a,_0x1466de);};}exports['register']=function(_0x425f2f){for(var _0xa41a23=0x0,_0x30ab9a=events[_0x8b4a('0x5')];_0xa41a23<_0x30ab9a;_0xa41a23++){var _0x44ad78=events[_0xa41a23];var _0xaa423=createListener(_0x8b4a('0x6')+_0x44ad78,_0x425f2f);WhatsappMessageEvents['on'](_0x44ad78,_0xaa423);}}; \ No newline at end of file +var _0x4bd9=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x392cdf,_0x4adb91){var _0x5430f7=function(_0x53a517){while(--_0x53a517){_0x392cdf['push'](_0x392cdf['shift']());}};_0x5430f7(++_0x4adb91);}(_0x4bd9,0x1bb));var _0x94bd=function(_0x334280,_0x3cd906){_0x334280=_0x334280-0x0;var _0x23d539=_0x4bd9[_0x334280];return _0x23d539;};'use strict';var WhatsappMessageEvents=require(_0x94bd('0x0'));var events=[_0x94bd('0x1'),_0x94bd('0x2'),_0x94bd('0x3')];function createListener(_0x4ac2f0,_0x1ae383){return function(_0x1be82e){_0x1ae383[_0x94bd('0x4')](_0x4ac2f0,_0x1be82e);};}function removeListener(_0x3b7364,_0x439c14){return function(){WhatsappMessageEvents['removeListener'](_0x3b7364,_0x439c14);};}exports['register']=function(_0x2dafdf){for(var _0x522403=0x0,_0x14bd90=events[_0x94bd('0x5')];_0x522403<_0x14bd90;_0x522403++){var _0x361e02=events[_0x522403];var _0x239c5c=createListener(_0x94bd('0x6')+_0x361e02,_0x2dafdf);WhatsappMessageEvents['on'](_0x361e02,_0x239c5c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index fc0c241..15199cc 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 _0xf64e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','delete','removeTeams','multer','util'];(function(_0x48d3ad,_0x290e43){var _0xa60d6e=function(_0x424a3e){while(--_0x424a3e){_0x48d3ad['push'](_0x48d3ad['shift']());}};_0xa60d6e(++_0x290e43);}(_0xf64e,0xa6));var _0xef64=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf64e[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xef64('0x0'));var util=require(_0xef64('0x1'));var path=require(_0xef64('0x2'));var timeout=require(_0xef64('0x3'));var express=require(_0xef64('0x4'));var router=express[_0xef64('0x5')]();var fs_extra=require(_0xef64('0x6'));var auth=require(_0xef64('0x7'));var interaction=require(_0xef64('0x8'));var config=require(_0xef64('0x9'));var controller=require(_0xef64('0xa'));router[_0xef64('0xb')]('/',auth[_0xef64('0xc')](),controller[_0xef64('0xd')]);router['get'](_0xef64('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xef64('0xf'),auth[_0xef64('0xc')](),controller[_0xef64('0x10')]);router[_0xef64('0xb')](_0xef64('0x11'),auth['isAuthenticated'](),controller[_0xef64('0x12')]);router[_0xef64('0xb')](_0xef64('0x13'),auth[_0xef64('0xc')](),controller[_0xef64('0x14')]);router['get'](_0xef64('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0xef64('0x16')]('/',auth[_0xef64('0xc')](),controller[_0xef64('0x17')]);router[_0xef64('0x16')](_0xef64('0x13'),auth[_0xef64('0xc')](),controller['addTeams']);router[_0xef64('0x16')](_0xef64('0x15'),auth[_0xef64('0xc')](),controller[_0xef64('0x18')]);router[_0xef64('0x19')](_0xef64('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xef64('0x1a')](_0xef64('0xf'),auth[_0xef64('0xc')](),controller['destroy']);router[_0xef64('0x1a')](_0xef64('0x13'),auth[_0xef64('0xc')](),controller[_0xef64('0x1b')]);router[_0xef64('0x1a')](_0xef64('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6616=['delete','destroy','removeTeams','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','post','create','addTeams','addAgents','put'];(function(_0x1fc36f,_0x464552){var _0x2856b4=function(_0x2487f3){while(--_0x2487f3){_0x1fc36f['push'](_0x1fc36f['shift']());}};_0x2856b4(++_0x464552);}(_0x6616,0x12c));var _0x6661=function(_0x109625,_0x55ace8){_0x109625=_0x109625-0x0;var _0x259988=_0x6616[_0x109625];return _0x259988;};'use strict';var multer=require(_0x6661('0x0'));var util=require('util');var path=require(_0x6661('0x1'));var timeout=require(_0x6661('0x2'));var express=require('express');var router=express[_0x6661('0x3')]();var fs_extra=require(_0x6661('0x4'));var auth=require(_0x6661('0x5'));var interaction=require(_0x6661('0x6'));var config=require(_0x6661('0x7'));var controller=require(_0x6661('0x8'));router[_0x6661('0x9')]('/',auth[_0x6661('0xa')](),controller[_0x6661('0xb')]);router[_0x6661('0x9')](_0x6661('0xc'),auth[_0x6661('0xa')](),controller[_0x6661('0xd')]);router['get'](_0x6661('0xe'),auth[_0x6661('0xa')](),controller[_0x6661('0xf')]);router[_0x6661('0x9')](_0x6661('0x10'),auth[_0x6661('0xa')](),controller['getMembers']);router[_0x6661('0x9')](_0x6661('0x11'),auth[_0x6661('0xa')](),controller['getTeams']);router['get'](_0x6661('0x12'),auth[_0x6661('0xa')](),controller['getAgents']);router[_0x6661('0x13')]('/',auth['isAuthenticated'](),controller[_0x6661('0x14')]);router[_0x6661('0x13')]('/:id/teams',auth[_0x6661('0xa')](),controller[_0x6661('0x15')]);router[_0x6661('0x13')](_0x6661('0x12'),auth['isAuthenticated'](),controller[_0x6661('0x16')]);router[_0x6661('0x17')](_0x6661('0xe'),auth[_0x6661('0xa')](),controller['update']);router[_0x6661('0x18')](_0x6661('0xe'),auth[_0x6661('0xa')](),controller[_0x6661('0x19')]);router['delete'](_0x6661('0x11'),auth[_0x6661('0xa')](),controller[_0x6661('0x1a')]);router[_0x6661('0x18')]('/:id/users',auth[_0x6661('0xa')](),controller['removeAgents']);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 9a65cd2..2e9cbe3 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 _0x8369=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x205c8a,_0x2c685b){var _0x336fd6=function(_0x17672a){while(--_0x17672a){_0x205c8a['push'](_0x205c8a['shift']());}};_0x336fd6(++_0x2c685b);}(_0x8369,0x10b));var _0x9836=function(_0x5ecefd,_0x349b7d){_0x5ecefd=_0x5ecefd-0x0;var _0x54c0ed=_0x8369[_0x5ecefd];return _0x54c0ed;};'use strict';var Sequelize=require(_0x9836('0x0'));module[_0x9836('0x1')]={'name':{'type':Sequelize[_0x9836('0x2')],'unique':_0x9836('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9836('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9836('0x5')](_0x9836('0x6'),'beepall',_0x9836('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4058=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0xcd4f92,_0xc9b291){var _0x497778=function(_0x16fba0){while(--_0x16fba0){_0xcd4f92['push'](_0xcd4f92['shift']());}};_0x497778(++_0xc9b291);}(_0x4058,0x129));var _0x8405=function(_0x1fcb67,_0x4f187b){_0x1fcb67=_0x1fcb67-0x0;var _0xa1bca7=_0x4058[_0x1fcb67];return _0xa1bca7;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'name':{'type':Sequelize[_0x8405('0x2')],'unique':_0x8405('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8405('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8405('0x5')](_0x8405('0x6'),_0x8405('0x7'),_0x8405('0x8'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 6aec43b..439052c 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 _0x20c2=['redis','defaults','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','stack','name','send','index','WhatsappQueue','rawAttributes','type','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','catch','params','filters','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','error','update','describe','getMembers','pick','WhatsappQueueId','UserWhatsappQueue','findAll','UserId','agent','whatsappPause','updatedAt','rows','format','SIP','getTeams','findOne','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x550109,_0x1b62f6){var _0x3ade44=function(_0x50bff2){while(--_0x50bff2){_0x550109['push'](_0x550109['shift']());}};_0x3ade44(++_0x1b62f6);}(_0x20c2,0xf9));var _0x220c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x20c2[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x220c('0x0'));var rimraf=require(_0x220c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x220c('0x2'));var rp=require('request-promise');var moment=require(_0x220c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x220c('0x4'));var util=require(_0x220c('0x5'));var path=require(_0x220c('0x6'));var sox=require(_0x220c('0x7'));var csv=require(_0x220c('0x8'));var ejs=require(_0x220c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x220c('0xa'));var jsforce=require(_0x220c('0xb'));var deskjs=require(_0x220c('0xc'));var toCsv=require(_0x220c('0x8'));var querystring=require(_0x220c('0xd'));var Papa=require(_0x220c('0xe'));var Redis=require('ioredis');var authService=require(_0x220c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x220c('0x10'));var hardwareService=require(_0x220c('0x11'));var logger=require('../../config/logger')(_0x220c('0x12'));var utils=require('../../config/utils');var config=require(_0x220c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x220c('0x14'))['db'];config[_0x220c('0x15')]=_[_0x220c('0x16')](config[_0x220c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x220c('0x17'))(new Redis(config['redis']));require(_0x220c('0x18'))['register'](socket);function respondWithStatusCode(_0xf12d7b,_0x334f0f){_0x334f0f=_0x334f0f||0xcc;return function(_0x2febeb){if(_0x2febeb){return _0xf12d7b[_0x220c('0x19')](_0x334f0f);}return _0xf12d7b[_0x220c('0x1a')](_0x334f0f)[_0x220c('0x1b')]();};}function respondWithResult(_0x2c33f8,_0x50e32b){_0x50e32b=_0x50e32b||0xc8;return function(_0x126d38){if(_0x126d38){return _0x2c33f8[_0x220c('0x1a')](_0x50e32b)[_0x220c('0x1c')](_0x126d38);}};}function respondWithFilteredResult(_0x5b560d,_0x4aa86d){return function(_0x24edcc){if(_0x24edcc){var _0x3d1295=typeof _0x4aa86d[_0x220c('0x1d')]===_0x220c('0x1e')&&typeof _0x4aa86d[_0x220c('0x1f')]===_0x220c('0x1e');var _0x3af39f=_0x24edcc[_0x220c('0x20')];var _0x21540d=_0x3d1295?0x0:_0x4aa86d[_0x220c('0x1d')];var _0x4721d4=_0x3d1295?_0x24edcc[_0x220c('0x20')]:_0x4aa86d['offset']+_0x4aa86d['limit'];var _0x310db9;if(_0x4721d4>=_0x3af39f){_0x4721d4=_0x3af39f;_0x310db9=0xc8;}else{_0x310db9=0xce;}_0x5b560d['status'](_0x310db9);return _0x5b560d[_0x220c('0x21')](_0x220c('0x22'),_0x21540d+'-'+_0x4721d4+'/'+_0x3af39f)['json'](_0x24edcc);}return null;};}function patchUpdates(_0x81ee1f){return function(_0x21c038){try{jsonpatch[_0x220c('0x23')](_0x21c038,_0x81ee1f,!![]);}catch(_0x315f39){return BPromise[_0x220c('0x24')](_0x315f39);}return _0x21c038[_0x220c('0x25')]();};}function saveUpdates(_0x1c3b2a,_0xeed31a){return function(_0x1e11dd){if(_0x1e11dd){return _0x1e11dd['update'](_0x1c3b2a)[_0x220c('0x26')](function(_0x5ad0e0){return _0x5ad0e0;});}return null;};}function removeEntity(_0x50c7d9,_0x549ca2){return function(_0x227d53){if(_0x227d53){return _0x227d53[_0x220c('0x27')]()['then'](function(){var _0x90c7ee=_0x227d53[_0x220c('0x28')]({'plain':!![]});var _0x579834='WhatsappQueues';return db['UserProfileResource'][_0x220c('0x27')]({'where':{'type':_0x579834,'resourceId':_0x90c7ee['id']}})['then'](function(){return _0x227d53;});})[_0x220c('0x26')](function(){_0x50c7d9[_0x220c('0x1a')](0xcc)[_0x220c('0x1b')]();});}};}function handleEntityNotFound(_0x399368,_0x4344b4){return function(_0x4ccc98){if(!_0x4ccc98){_0x399368[_0x220c('0x19')](0x194);}return _0x4ccc98;};}function handleError(_0x39a7dc,_0x4b0e5a){_0x4b0e5a=_0x4b0e5a||0x1f4;return function(_0x547aa1){logger['error'](_0x547aa1[_0x220c('0x29')]);if(_0x547aa1['name']){delete _0x547aa1[_0x220c('0x2a')];}_0x39a7dc[_0x220c('0x1a')](_0x4b0e5a)[_0x220c('0x2b')](_0x547aa1);};}exports[_0x220c('0x2c')]=function(_0x118fd0,_0x5c7351){var _0x4a8ae3={},_0xce6936={},_0x1df523={'count':0x0,'rows':[]};var _0x593565=_['map'](db[_0x220c('0x2d')][_0x220c('0x2e')],function(_0x514fb0){return{'name':_0x514fb0['fieldName'],'type':_0x514fb0[_0x220c('0x2f')]['key']};});_0xce6936['model']=_[_0x220c('0x30')](_0x593565,_0x220c('0x2a'));_0xce6936[_0x220c('0x31')]=_[_0x220c('0x32')](_0x118fd0[_0x220c('0x31')]);_0xce6936['filters']=_[_0x220c('0x33')](_0xce6936[_0x220c('0x34')],_0xce6936[_0x220c('0x31')]);_0x4a8ae3[_0x220c('0x35')]=_[_0x220c('0x33')](_0xce6936[_0x220c('0x34')],qs[_0x220c('0x36')](_0x118fd0['query'][_0x220c('0x36')]));_0x4a8ae3[_0x220c('0x35')]=_0x4a8ae3[_0x220c('0x35')]['length']?_0x4a8ae3[_0x220c('0x35')]:_0xce6936[_0x220c('0x34')];if(!_0x118fd0['query'][_0x220c('0x37')](_0x220c('0x38'))){_0x4a8ae3['limit']=qs[_0x220c('0x1f')](_0x118fd0['query'][_0x220c('0x1f')]);_0x4a8ae3[_0x220c('0x1d')]=qs[_0x220c('0x1d')](_0x118fd0[_0x220c('0x31')]['offset']);}_0x4a8ae3[_0x220c('0x39')]=qs[_0x220c('0x3a')](_0x118fd0['query'][_0x220c('0x3a')]);_0x4a8ae3['where']=qs['filters'](_['pick'](_0x118fd0[_0x220c('0x31')],_0xce6936['filters']),_0x593565);if(_0x118fd0[_0x220c('0x31')][_0x220c('0x3b')]){_0x4a8ae3['where']=_[_0x220c('0x3c')](_0x4a8ae3[_0x220c('0x3d')],{'$or':_[_0x220c('0x30')](_0x593565,function(_0x559522){if(_0x559522[_0x220c('0x2f')]!==_0x220c('0x3e')){var _0x3fb5a4={};_0x3fb5a4[_0x559522[_0x220c('0x2a')]]={'$like':'%'+_0x118fd0[_0x220c('0x31')][_0x220c('0x3b')]+'%'};return _0x3fb5a4;}})});}_0x4a8ae3=_[_0x220c('0x3c')]({},_0x4a8ae3,_0x118fd0[_0x220c('0x3f')]);var _0x3eeac7={'where':_0x4a8ae3[_0x220c('0x3d')]};return db[_0x220c('0x2d')][_0x220c('0x20')](_0x3eeac7)[_0x220c('0x26')](function(_0x38371d){_0x1df523['count']=_0x38371d;if(_0x118fd0[_0x220c('0x31')][_0x220c('0x40')]){_0x4a8ae3[_0x220c('0x41')]=[{'all':!![]}];}return db[_0x220c('0x2d')]['findAll'](_0x4a8ae3);})[_0x220c('0x26')](function(_0x57fa3f){_0x1df523['rows']=_0x57fa3f;return _0x1df523;})[_0x220c('0x26')](respondWithFilteredResult(_0x5c7351,_0x4a8ae3))[_0x220c('0x42')](handleError(_0x5c7351,null));};exports['show']=function(_0x3535da,_0x2acf64){var _0x412a50={'raw':!![],'where':{'id':_0x3535da[_0x220c('0x43')]['id']}},_0x3bf3eb={};_0x3bf3eb['model']=_['keys'](db[_0x220c('0x2d')][_0x220c('0x2e')]);_0x3bf3eb[_0x220c('0x31')]=_['keys'](_0x3535da[_0x220c('0x31')]);_0x3bf3eb[_0x220c('0x44')]=_[_0x220c('0x33')](_0x3bf3eb[_0x220c('0x34')],_0x3bf3eb[_0x220c('0x31')]);_0x412a50[_0x220c('0x35')]=_[_0x220c('0x33')](_0x3bf3eb['model'],qs['fields'](_0x3535da['query'][_0x220c('0x36')]));_0x412a50[_0x220c('0x35')]=_0x412a50[_0x220c('0x35')][_0x220c('0x45')]?_0x412a50[_0x220c('0x35')]:_0x3bf3eb['model'];if(_0x3535da[_0x220c('0x31')][_0x220c('0x40')]){_0x412a50['include']=[{'all':!![]}];}_0x412a50=_[_0x220c('0x3c')]({},_0x412a50,_0x3535da['options']);return db['WhatsappQueue'][_0x220c('0x46')](_0x412a50)[_0x220c('0x26')](handleEntityNotFound(_0x2acf64,null))[_0x220c('0x26')](respondWithResult(_0x2acf64,null))[_0x220c('0x42')](handleError(_0x2acf64,null));};exports[_0x220c('0x47')]=function(_0x14df92,_0x1d04e3){return db[_0x220c('0x2d')][_0x220c('0x47')](_0x14df92[_0x220c('0x48')],{})[_0x220c('0x26')](function(_0x5b3dfd){var _0x506c3a=_0x14df92[_0x220c('0x49')][_0x220c('0x28')]({'plain':!![]});if(!_0x506c3a)throw new Error(_0x220c('0x4a'));if(_0x506c3a[_0x220c('0x4b')]==='user'){var _0x42ea1e=_0x5b3dfd[_0x220c('0x28')]({'plain':!![]});var _0x172054=_0x220c('0x4c');return db[_0x220c('0x4d')][_0x220c('0x46')]({'where':{'name':_0x172054,'userProfileId':_0x506c3a[_0x220c('0x4e')]},'raw':!![]})[_0x220c('0x26')](function(_0x4a87d7){if(_0x4a87d7&&_0x4a87d7[_0x220c('0x4f')]===0x0){return db['UserProfileResource'][_0x220c('0x47')]({'name':_0x42ea1e[_0x220c('0x2a')],'resourceId':_0x42ea1e['id'],'type':_0x4a87d7[_0x220c('0x2a')],'sectionId':_0x4a87d7['id']},{})['then'](function(){return _0x5b3dfd;});}else{return _0x5b3dfd;}})['catch'](function(_0x4989d3){logger[_0x220c('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4989d3);throw _0x4989d3;});}return _0x5b3dfd;})[_0x220c('0x26')](respondWithResult(_0x1d04e3,0xc9))[_0x220c('0x42')](handleError(_0x1d04e3,null));};exports[_0x220c('0x51')]=function(_0x481477,_0x3acc17){if(_0x481477[_0x220c('0x48')]['id']){delete _0x481477[_0x220c('0x48')]['id'];}return db[_0x220c('0x2d')]['find']({'where':{'id':_0x481477[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x3acc17,null))[_0x220c('0x26')](saveUpdates(_0x481477['body'],null))['then'](respondWithResult(_0x3acc17,null))[_0x220c('0x42')](handleError(_0x3acc17,null));};exports['destroy']=function(_0x467459,_0x7c3be2){return db[_0x220c('0x2d')][_0x220c('0x46')]({'where':{'id':_0x467459[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x7c3be2,null))[_0x220c('0x26')](removeEntity(_0x7c3be2,null))[_0x220c('0x42')](handleError(_0x7c3be2,null));};exports[_0x220c('0x52')]=function(_0x81f83b,_0x1c737d){return db[_0x220c('0x2d')]['describe']()[_0x220c('0x26')](respondWithResult(_0x1c737d,null))[_0x220c('0x42')](handleError(_0x1c737d,null));};exports[_0x220c('0x53')]=function(_0x23dee0,_0x41f5fe,_0xa26f65){var _0x36ca64={'raw':!![],'where':{}},_0x56c4b3={},_0x4a968d;return db[_0x220c('0x2d')]['findOne']({'where':{'id':_0x23dee0[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x41f5fe,null))[_0x220c('0x26')](function(_0x5998f0){if(_0x5998f0){_0x4a968d=_0x5998f0[_0x220c('0x28')]({'plain':!![]});_0x56c4b3[_0x220c('0x34')]=_[_0x220c('0x32')](db['UserWhatsappQueue'][_0x220c('0x2e')]);_0x56c4b3[_0x220c('0x31')]=_['keys'](_0x23dee0[_0x220c('0x31')]);_0x56c4b3[_0x220c('0x44')]=_[_0x220c('0x33')](_0x56c4b3[_0x220c('0x34')],_0x56c4b3['query']);_0x36ca64[_0x220c('0x35')]=_[_0x220c('0x33')](_0x56c4b3[_0x220c('0x34')],qs[_0x220c('0x36')](_0x23dee0[_0x220c('0x31')]['fields']));_0x36ca64['attributes']=_0x36ca64['attributes'][_0x220c('0x45')]?_0x36ca64[_0x220c('0x35')]:_0x56c4b3['model'];if(!_0x23dee0[_0x220c('0x31')][_0x220c('0x37')](_0x220c('0x38'))){_0x36ca64[_0x220c('0x1f')]=qs[_0x220c('0x1f')](_0x23dee0[_0x220c('0x31')]['limit']);_0x36ca64[_0x220c('0x1d')]=qs[_0x220c('0x1d')](_0x23dee0[_0x220c('0x31')][_0x220c('0x1d')]);}_0x36ca64['order']=qs[_0x220c('0x3a')](_0x23dee0[_0x220c('0x31')]['sort']);_0x36ca64['where']=qs[_0x220c('0x44')](_[_0x220c('0x54')](_0x23dee0['query'],_0x56c4b3[_0x220c('0x44')]));_0x36ca64['where'][_0x220c('0x55')]=_0x5998f0['id'];if(_0x23dee0[_0x220c('0x31')][_0x220c('0x3b')]){_0x36ca64[_0x220c('0x3d')]=_[_0x220c('0x3c')](_0x36ca64[_0x220c('0x3d')],{'$or':_[_0x220c('0x30')](_0x36ca64[_0x220c('0x35')],function(_0x4244f5){var _0x2a8994={};_0x2a8994[_0x4244f5]={'$like':'%'+_0x23dee0['query'][_0x220c('0x3b')]+'%'};return _0x2a8994;})});}_0x36ca64=_[_0x220c('0x3c')]({},_0x36ca64,_0x23dee0[_0x220c('0x3f')]);return db[_0x220c('0x56')][_0x220c('0x57')](_0x36ca64);}})['then'](function(_0x47851e){if(_0x47851e){return db['User']['findAndCountAll']({'where':{'id':_[_0x220c('0x30')](_0x47851e,_0x220c('0x58')),'role':_0x220c('0x59')},'attributes':['id','name',_0x220c('0x5a'),_0x220c('0x5b'),'createdAt']});}})['then'](function(_0x3021a6){if(_0x3021a6){return{'count':_0x3021a6[_0x220c('0x20')],'rows':_['map'](_0x3021a6[_0x220c('0x5c')],function(_0x4d2553){return{'membername':_0x4d2553[_0x220c('0x2a')],'UserId':_0x4d2553['id'],'queue_name':_0x4a968d[_0x220c('0x2a')],'WhatsappQueueId':_0x4a968d['id'],'interface':util[_0x220c('0x5d')]('%s/%s',_0x220c('0x5e'),_0x4d2553['name']),'penalty':0x0,'paused':_0x4d2553['whatsappPause'],'createdAt':_0x4d2553['createdAt'],'updatedAt':_0x4d2553['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x220c('0x26')](respondWithFilteredResult(_0x41f5fe,_0x36ca64))[_0x220c('0x42')](handleError(_0x41f5fe,null));};exports[_0x220c('0x5f')]=function(_0x53422f,_0x45d114,_0x3a733b){var _0x1a0003={};var _0x268f4f={};var _0x1dd7a4;var _0x5abbf5;return db[_0x220c('0x2d')][_0x220c('0x60')]({'where':{'id':_0x53422f[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x45d114,null))[_0x220c('0x26')](function(_0x57c8b0){if(_0x57c8b0){_0x1dd7a4=_0x57c8b0;_0x268f4f['model']=_[_0x220c('0x32')](db['Team'][_0x220c('0x2e')]);_0x268f4f[_0x220c('0x31')]=_[_0x220c('0x32')](_0x53422f[_0x220c('0x31')]);_0x268f4f['filters']=_['intersection'](_0x268f4f['model'],_0x268f4f[_0x220c('0x31')]);_0x1a0003[_0x220c('0x35')]=_[_0x220c('0x33')](_0x268f4f[_0x220c('0x34')],qs[_0x220c('0x36')](_0x53422f['query']['fields']));_0x1a0003[_0x220c('0x35')]=_0x1a0003['attributes'][_0x220c('0x45')]?_0x1a0003[_0x220c('0x35')]:_0x268f4f[_0x220c('0x34')];_0x1a0003['order']=qs[_0x220c('0x3a')](_0x53422f['query'][_0x220c('0x3a')]);_0x1a0003[_0x220c('0x3d')]=qs[_0x220c('0x44')](_[_0x220c('0x54')](_0x53422f[_0x220c('0x31')],_0x268f4f[_0x220c('0x44')]));if(_0x53422f[_0x220c('0x31')]['filter']){_0x1a0003[_0x220c('0x3d')]=_[_0x220c('0x3c')](_0x1a0003[_0x220c('0x3d')],{'$or':_[_0x220c('0x30')](_0x1a0003[_0x220c('0x35')],function(_0x10ae48){var _0x186f79={};_0x186f79[_0x10ae48]={'$like':'%'+_0x53422f[_0x220c('0x31')]['filter']+'%'};return _0x186f79;})});}_0x1a0003=_[_0x220c('0x3c')]({},_0x1a0003,_0x53422f['options']);return _0x1dd7a4[_0x220c('0x5f')](_0x1a0003);}})['then'](function(_0x865f60){if(_0x865f60){_0x5abbf5=_0x865f60[_0x220c('0x45')];if(!_0x53422f[_0x220c('0x31')][_0x220c('0x37')](_0x220c('0x38'))){_0x1a0003[_0x220c('0x1f')]=qs['limit'](_0x53422f['query']['limit']);_0x1a0003['offset']=qs['offset'](_0x53422f[_0x220c('0x31')]['offset']);}return _0x1dd7a4[_0x220c('0x5f')](_0x1a0003);}})[_0x220c('0x26')](function(_0x3ad5ba){if(_0x3ad5ba){return _0x3ad5ba?{'count':_0x5abbf5,'rows':_0x3ad5ba}:null;}})[_0x220c('0x26')](respondWithResult(_0x45d114,null))[_0x220c('0x42')](handleError(_0x45d114,null));};exports[_0x220c('0x61')]=function(_0x158ca3,_0xf69c9,_0xc44e20){var _0x311d2d=_0x158ca3['body'][_0x220c('0x62')];return db[_0x220c('0x63')][_0x220c('0x57')]({'where':{'id':_0x311d2d},'attributes':['id'],'include':[{'model':db[_0x220c('0x64')],'as':_0x220c('0x65'),'attributes':['id',_0x220c('0x2a'),_0x220c('0x66'),_0x220c('0x67'),_0x220c('0x68')],'raw':!![]}]})['then'](function(_0x187576){if(_0x187576){var _0x2fa724=_[_0x220c('0x69')](_0x187576,function(_0x59b581){var _0x77eb54=_0x59b581[_0x220c('0x28')]({'plain':!![]});return _0x77eb54[_0x220c('0x65')];});return db[_0x220c('0x2d')][_0x220c('0x46')]({'where':{'id':_0x158ca3['params']['id']}})['then'](function(_0x552396){return db[_0x220c('0x6a')][_0x220c('0x6b')](function(_0x4b9550){return _0x552396[_0x220c('0x61')](_0x311d2d,{'transaction':_0x4b9550})[_0x220c('0x26')](function(){return BPromise[_0x220c('0x6c')](_0x2fa724,function(_0x58b196){return db[_0x220c('0x56')]['findOrCreate']({'where':{'UserId':_0x58b196['id'],'WhatsappQueueId':_0x158ca3[_0x220c('0x43')]['id']},'transaction':_0x4b9550});});})[_0x220c('0x26')](function(){_0x2fa724[_0x220c('0x6d')](function(_0x3391b7){socket[_0x220c('0x6e')]('userWhatsappQueue:save',{'UserId':_0x3391b7['id'],'WhatsappQueueId':_0x552396['id']});});});});});}})[_0x220c('0x26')](respondWithStatusCode(_0xf69c9,null))[_0x220c('0x42')](handleError(_0xf69c9,null));};exports[_0x220c('0x6f')]=function(_0x353af8,_0x1dc5a9,_0x5b8601){return db[_0x220c('0x63')]['findAll']({'where':{'id':_0x353af8['query'][_0x220c('0x62')]},'attributes':['id'],'include':[{'model':db[_0x220c('0x64')],'as':_0x220c('0x65'),'attributes':['id'],'raw':!![]}]})[_0x220c('0x26')](handleEntityNotFound(_0x1dc5a9,null))[_0x220c('0x26')](function(_0x433587){var _0xd97242=_[_0x220c('0x30')](_0x433587,'id');var _0x18a289=[];var _0x4d7722=[];var _0x5918d7=squel[_0x220c('0x70')]();_0x5918d7['field'](_0x220c('0x71'))[_0x220c('0x72')]('team_has_whatsapp_queues','tq')[_0x220c('0x73')]('user_has_teams','ut',_0x220c('0x74'))['where'](_0x220c('0x75'),_0x353af8[_0x220c('0x43')]['id']);for(var _0x17a779=0x0;_0x17a779<_0x433587[_0x220c('0x45')];_0x17a779+=0x1){let _0x193ab8=_0x433587[_0x17a779];for(var _0x18cb75=0x0;_0x18cb75<_0x193ab8[_0x220c('0x65')][_0x220c('0x45')];_0x18cb75+=0x1){let _0x4a4d44=_0x193ab8[_0x220c('0x65')][_0x18cb75];var _0x1470eb=_0x5918d7[_0x220c('0x76')]();_0x1470eb[_0x220c('0x3d')](_0x220c('0x77'),_0x4a4d44['id']);_0x4d7722[_0x220c('0x78')](db[_0x220c('0x6a')][_0x220c('0x31')](_0x1470eb['toString'](),{'type':db['sequelize'][_0x220c('0x79')][_0x220c('0x7a')]})['then'](function(_0x573788){if(_0x573788[_0x220c('0x45')]===0x1){return _0x4a4d44['id'];}else{var _0x16ee82=_[_0x220c('0x7b')](_[_0x220c('0x30')](_0x573788,_0x220c('0x7c')),function(_0x6b66dd){return _[_0x220c('0x7d')](_0xd97242,_0x6b66dd);});if(_0x16ee82){return _0x4a4d44['id'];}}}));}}return BPromise[_0x220c('0x7e')](_0x4d7722)[_0x220c('0x26')](function(_0x3f0873){_0x18a289=_(_0x18a289)[_0x220c('0x7f')](_0x3f0873)['compact']()['value']();return db[_0x220c('0x2d')][_0x220c('0x46')]({'where':{'id':_0x353af8[_0x220c('0x43')]['id']}})[_0x220c('0x26')](function(_0x556527){return db[_0x220c('0x6a')][_0x220c('0x6b')](function(_0x4b4733){return _0x556527[_0x220c('0x6f')](_0x353af8[_0x220c('0x31')][_0x220c('0x62')],{'transaction':_0x4b4733})[_0x220c('0x26')](function(){if(!_[_0x220c('0x80')](_0x18a289)){return _0x556527[_0x220c('0x81')](_0x18a289,{'transaction':_0x4b4733});}})[_0x220c('0x26')](function(){_0x18a289[_0x220c('0x6d')](function(_0x1356a7){socket[_0x220c('0x6e')](_0x220c('0x82'),{'UserId':_0x1356a7,'WhatsappQueueId':_0x556527['id']});});});});});});})[_0x220c('0x26')](respondWithStatusCode(_0x1dc5a9,null))[_0x220c('0x42')](handleError(_0x1dc5a9,null));};exports[_0x220c('0x83')]=function(_0x512e3e,_0x3d7e6b,_0x35fb8d){return db[_0x220c('0x2d')][_0x220c('0x46')]({'where':{'id':_0x512e3e[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x3d7e6b,null))[_0x220c('0x26')](function(_0x49054e){if(_0x49054e){return _0x49054e[_0x220c('0x83')](_0x512e3e[_0x220c('0x48')][_0x220c('0x62')],_['omit'](_0x512e3e[_0x220c('0x48')],[_0x220c('0x62'),'id'])||{})[_0x220c('0x84')](function(_0x487db4){for(var _0x387d7c=0x0;_0x387d7c<_0x512e3e[_0x220c('0x48')][_0x220c('0x62')][_0x220c('0x45')];_0x387d7c+=0x1){socket[_0x220c('0x6e')]('userWhatsappQueue:save',{'UserId':Number(_0x512e3e[_0x220c('0x48')][_0x220c('0x62')][_0x387d7c]),'WhatsappQueueId':Number(_0x512e3e[_0x220c('0x43')]['id'])});}return _0x487db4;});}})['then'](respondWithResult(_0x3d7e6b,null))[_0x220c('0x42')](handleError(_0x3d7e6b,null));};exports[_0x220c('0x81')]=function(_0x439934,_0x16eee6,_0x3e0ed5){return db[_0x220c('0x2d')]['find']({'where':{'id':_0x439934[_0x220c('0x43')]['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x16eee6,null))[_0x220c('0x26')](function(_0x5ed9a5){if(_0x5ed9a5){return _0x5ed9a5[_0x220c('0x81')](_0x439934[_0x220c('0x31')][_0x220c('0x62')])[_0x220c('0x26')](function(){if(_[_0x220c('0x85')](_0x439934[_0x220c('0x31')]['ids'])){for(var _0x216e76=0x0;_0x216e76<_0x439934[_0x220c('0x31')][_0x220c('0x62')][_0x220c('0x45')];_0x216e76+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x439934[_0x220c('0x31')][_0x220c('0x62')][_0x216e76]),'WhatsappQueueId':Number(_0x439934[_0x220c('0x43')]['id'])});}}else{socket[_0x220c('0x6e')](_0x220c('0x82'),{'UserId':Number(_0x439934[_0x220c('0x31')][_0x220c('0x62')]),'WhatsappQueueId':Number(_0x439934[_0x220c('0x43')]['id'])});}});}})[_0x220c('0x26')](respondWithStatusCode(_0x16eee6,null))['catch'](handleError(_0x16eee6,null));};exports[_0x220c('0x86')]=function(_0x58a9e8,_0x176bac,_0x58e705){var _0x11878e={};var _0x3ba4e5={};var _0xa13d96;var _0x349570;return db['WhatsappQueue'][_0x220c('0x60')]({'where':{'id':_0x58a9e8['params']['id']}})[_0x220c('0x26')](handleEntityNotFound(_0x176bac,null))['then'](function(_0x47d2b3){if(_0x47d2b3){_0xa13d96=_0x47d2b3;_0x3ba4e5[_0x220c('0x34')]=_[_0x220c('0x32')](db[_0x220c('0x64')][_0x220c('0x2e')]);_0x3ba4e5[_0x220c('0x31')]=_[_0x220c('0x32')](_0x58a9e8[_0x220c('0x31')]);_0x3ba4e5[_0x220c('0x44')]=_[_0x220c('0x33')](_0x3ba4e5[_0x220c('0x34')],_0x3ba4e5[_0x220c('0x31')]);_0x11878e['attributes']=_[_0x220c('0x33')](_0x3ba4e5[_0x220c('0x34')],qs['fields'](_0x58a9e8['query']['fields']));_0x11878e[_0x220c('0x35')]=_0x11878e[_0x220c('0x35')][_0x220c('0x45')]?_0x11878e[_0x220c('0x35')]:_0x3ba4e5['model'];_0x11878e['order']=qs[_0x220c('0x3a')](_0x58a9e8['query']['sort']);_0x11878e[_0x220c('0x3d')]=qs['filters'](_['pick'](_0x58a9e8[_0x220c('0x31')],_0x3ba4e5[_0x220c('0x44')]));if(_0x58a9e8[_0x220c('0x31')]['filter']){_0x11878e[_0x220c('0x3d')]=_[_0x220c('0x3c')](_0x11878e[_0x220c('0x3d')],{'$or':_[_0x220c('0x30')](_0x11878e[_0x220c('0x35')],function(_0x595f1b){var _0x2bb028={};_0x2bb028[_0x595f1b]={'$like':'%'+_0x58a9e8[_0x220c('0x31')][_0x220c('0x3b')]+'%'};return _0x2bb028;})});}_0x11878e=_['merge']({},_0x11878e,_0x58a9e8[_0x220c('0x3f')]);return _0xa13d96[_0x220c('0x86')](_0x11878e);}})['then'](function(_0x5839b4){if(_0x5839b4){_0x349570=_0x5839b4[_0x220c('0x45')];if(!_0x58a9e8[_0x220c('0x31')]['hasOwnProperty'](_0x220c('0x38'))){_0x11878e[_0x220c('0x1f')]=qs[_0x220c('0x1f')](_0x58a9e8[_0x220c('0x31')][_0x220c('0x1f')]);_0x11878e[_0x220c('0x1d')]=qs[_0x220c('0x1d')](_0x58a9e8[_0x220c('0x31')][_0x220c('0x1d')]);}return _0xa13d96[_0x220c('0x86')](_0x11878e);}})[_0x220c('0x26')](function(_0x38397a){if(_0x38397a){return _0x38397a?{'count':_0x349570,'rows':_0x38397a}:null;}})[_0x220c('0x26')](respondWithResult(_0x176bac,null))['catch'](handleError(_0x176bac,null));}; \ No newline at end of file +var _0x43f7=['filter','where','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','WhatsappQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','SIP','findOne','Team','getTeams','addTeams','Agents','online','voicePause','flatMap','sequelize','each','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','removeTeams','isEmpty','addAgents','omit','spread','removeAgents','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x394581,_0xfb87b){var _0x4d3757=function(_0x5d562f){while(--_0x5d562f){_0x394581['push'](_0x394581['shift']());}};_0x4d3757(++_0xfb87b);}(_0x43f7,0xd1));var _0x743f=function(_0x4b2cae,_0x587c96){_0x4b2cae=_0x4b2cae-0x0;var _0x2bb54e=_0x43f7[_0x4b2cae];return _0x2bb54e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x743f('0x0'));var zipdir=require(_0x743f('0x1'));var jsonpatch=require(_0x743f('0x2'));var rp=require('request-promise');var moment=require(_0x743f('0x3'));var BPromise=require(_0x743f('0x4'));var Mustache=require(_0x743f('0x5'));var util=require('util');var path=require(_0x743f('0x6'));var sox=require(_0x743f('0x7'));var csv=require('to-csv');var ejs=require(_0x743f('0x8'));var fs=require('fs');var fs_extra=require(_0x743f('0x9'));var _=require(_0x743f('0xa'));var squel=require(_0x743f('0xb'));var crypto=require(_0x743f('0xc'));var jsforce=require(_0x743f('0xd'));var deskjs=require(_0x743f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x743f('0xf'));var qs=require(_0x743f('0x10'));var as=require(_0x743f('0x11'));var hardwareService=require(_0x743f('0x12'));var logger=require(_0x743f('0x13'))(_0x743f('0x14'));var utils=require(_0x743f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x743f('0x16'));var db=require(_0x743f('0x17'))['db'];config[_0x743f('0x18')]=_[_0x743f('0x19')](config[_0x743f('0x18')],{'host':_0x743f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x743f('0x1b'))[_0x743f('0x1c')](socket);function respondWithStatusCode(_0x5e471e,_0x182cab){_0x182cab=_0x182cab||0xcc;return function(_0x545b65){if(_0x545b65){return _0x5e471e[_0x743f('0x1d')](_0x182cab);}return _0x5e471e[_0x743f('0x1e')](_0x182cab)[_0x743f('0x1f')]();};}function respondWithResult(_0x44e14e,_0x23a475){_0x23a475=_0x23a475||0xc8;return function(_0x16b692){if(_0x16b692){return _0x44e14e[_0x743f('0x1e')](_0x23a475)[_0x743f('0x20')](_0x16b692);}};}function respondWithFilteredResult(_0x37e70c,_0x45aa1b){return function(_0x1ed918){if(_0x1ed918){var _0x5f0b53=typeof _0x45aa1b['offset']===_0x743f('0x21')&&typeof _0x45aa1b['limit']===_0x743f('0x21');var _0x135bd3=_0x1ed918['count'];var _0x2538de=_0x5f0b53?0x0:_0x45aa1b['offset'];var _0x1d8b4d=_0x5f0b53?_0x1ed918[_0x743f('0x22')]:_0x45aa1b[_0x743f('0x23')]+_0x45aa1b[_0x743f('0x24')];var _0x4b9a69;if(_0x1d8b4d>=_0x135bd3){_0x1d8b4d=_0x135bd3;_0x4b9a69=0xc8;}else{_0x4b9a69=0xce;}_0x37e70c[_0x743f('0x1e')](_0x4b9a69);return _0x37e70c[_0x743f('0x25')]('Content-Range',_0x2538de+'-'+_0x1d8b4d+'/'+_0x135bd3)[_0x743f('0x20')](_0x1ed918);}return null;};}function patchUpdates(_0x246b0d){return function(_0x5d89d1){try{jsonpatch['apply'](_0x5d89d1,_0x246b0d,!![]);}catch(_0x43eede){return BPromise['reject'](_0x43eede);}return _0x5d89d1[_0x743f('0x26')]();};}function saveUpdates(_0x302107,_0x3be21c){return function(_0x3c7801){if(_0x3c7801){return _0x3c7801[_0x743f('0x27')](_0x302107)[_0x743f('0x28')](function(_0x40b379){return _0x40b379;});}return null;};}function removeEntity(_0x39ddcb,_0x1aed80){return function(_0x4793b7){if(_0x4793b7){return _0x4793b7[_0x743f('0x29')]()[_0x743f('0x28')](function(){var _0x48542a=_0x4793b7[_0x743f('0x2a')]({'plain':!![]});var _0x56a878=_0x743f('0x2b');return db[_0x743f('0x2c')][_0x743f('0x29')]({'where':{'type':_0x56a878,'resourceId':_0x48542a['id']}})[_0x743f('0x28')](function(){return _0x4793b7;});})[_0x743f('0x28')](function(){_0x39ddcb['status'](0xcc)[_0x743f('0x1f')]();});}};}function handleEntityNotFound(_0x77d7c2,_0x3ee053){return function(_0x5dc517){if(!_0x5dc517){_0x77d7c2[_0x743f('0x1d')](0x194);}return _0x5dc517;};}function handleError(_0x3670b2,_0xcc541e){_0xcc541e=_0xcc541e||0x1f4;return function(_0x325cd3){logger[_0x743f('0x2d')](_0x325cd3[_0x743f('0x2e')]);if(_0x325cd3[_0x743f('0x2f')]){delete _0x325cd3[_0x743f('0x2f')];}_0x3670b2[_0x743f('0x1e')](_0xcc541e)[_0x743f('0x30')](_0x325cd3);};}exports[_0x743f('0x31')]=function(_0x3d6f64,_0x38289b){var _0x2d0065={},_0x32b332={},_0x65abcf={'count':0x0,'rows':[]};var _0x38d784=_['map'](db[_0x743f('0x32')][_0x743f('0x33')],function(_0x1f383f){return{'name':_0x1f383f[_0x743f('0x34')],'type':_0x1f383f[_0x743f('0x35')][_0x743f('0x36')]};});_0x32b332[_0x743f('0x37')]=_[_0x743f('0x38')](_0x38d784,_0x743f('0x2f'));_0x32b332[_0x743f('0x39')]=_[_0x743f('0x3a')](_0x3d6f64[_0x743f('0x39')]);_0x32b332[_0x743f('0x3b')]=_['intersection'](_0x32b332[_0x743f('0x37')],_0x32b332[_0x743f('0x39')]);_0x2d0065[_0x743f('0x3c')]=_['intersection'](_0x32b332['model'],qs['fields'](_0x3d6f64[_0x743f('0x39')][_0x743f('0x3d')]));_0x2d0065[_0x743f('0x3c')]=_0x2d0065['attributes']['length']?_0x2d0065[_0x743f('0x3c')]:_0x32b332['model'];if(!_0x3d6f64[_0x743f('0x39')][_0x743f('0x3e')](_0x743f('0x3f'))){_0x2d0065['limit']=qs[_0x743f('0x24')](_0x3d6f64[_0x743f('0x39')][_0x743f('0x24')]);_0x2d0065[_0x743f('0x23')]=qs['offset'](_0x3d6f64['query'][_0x743f('0x23')]);}_0x2d0065[_0x743f('0x40')]=qs[_0x743f('0x41')](_0x3d6f64['query']['sort']);_0x2d0065['where']=qs[_0x743f('0x3b')](_[_0x743f('0x42')](_0x3d6f64[_0x743f('0x39')],_0x32b332[_0x743f('0x3b')]),_0x38d784);if(_0x3d6f64[_0x743f('0x39')][_0x743f('0x43')]){_0x2d0065[_0x743f('0x44')]=_[_0x743f('0x45')](_0x2d0065['where'],{'$or':_[_0x743f('0x38')](_0x38d784,function(_0x401039){if(_0x401039[_0x743f('0x35')]!=='VIRTUAL'){var _0x6b5804={};_0x6b5804[_0x401039['name']]={'$like':'%'+_0x3d6f64[_0x743f('0x39')][_0x743f('0x43')]+'%'};return _0x6b5804;}})});}_0x2d0065=_[_0x743f('0x45')]({},_0x2d0065,_0x3d6f64[_0x743f('0x46')]);var _0x239b2d={'where':_0x2d0065[_0x743f('0x44')]};return db[_0x743f('0x32')][_0x743f('0x22')](_0x239b2d)['then'](function(_0xdb8c72){_0x65abcf[_0x743f('0x22')]=_0xdb8c72;if(_0x3d6f64[_0x743f('0x39')][_0x743f('0x47')]){_0x2d0065[_0x743f('0x48')]=[{'all':!![]}];}return db[_0x743f('0x32')]['findAll'](_0x2d0065);})[_0x743f('0x28')](function(_0x345fd3){_0x65abcf[_0x743f('0x49')]=_0x345fd3;return _0x65abcf;})[_0x743f('0x28')](respondWithFilteredResult(_0x38289b,_0x2d0065))[_0x743f('0x4a')](handleError(_0x38289b,null));};exports[_0x743f('0x4b')]=function(_0x385f99,_0x26a310){var _0x35c146={'raw':!![],'where':{'id':_0x385f99[_0x743f('0x4c')]['id']}},_0x2570b9={};_0x2570b9['model']=_[_0x743f('0x3a')](db[_0x743f('0x32')][_0x743f('0x33')]);_0x2570b9[_0x743f('0x39')]=_['keys'](_0x385f99['query']);_0x2570b9[_0x743f('0x3b')]=_[_0x743f('0x4d')](_0x2570b9[_0x743f('0x37')],_0x2570b9['query']);_0x35c146[_0x743f('0x3c')]=_[_0x743f('0x4d')](_0x2570b9[_0x743f('0x37')],qs[_0x743f('0x3d')](_0x385f99[_0x743f('0x39')][_0x743f('0x3d')]));_0x35c146[_0x743f('0x3c')]=_0x35c146['attributes'][_0x743f('0x4e')]?_0x35c146[_0x743f('0x3c')]:_0x2570b9[_0x743f('0x37')];if(_0x385f99[_0x743f('0x39')]['includeAll']){_0x35c146[_0x743f('0x48')]=[{'all':!![]}];}_0x35c146=_[_0x743f('0x45')]({},_0x35c146,_0x385f99[_0x743f('0x46')]);return db[_0x743f('0x32')][_0x743f('0x4f')](_0x35c146)[_0x743f('0x28')](handleEntityNotFound(_0x26a310,null))[_0x743f('0x28')](respondWithResult(_0x26a310,null))[_0x743f('0x4a')](handleError(_0x26a310,null));};exports['create']=function(_0x4ac4e9,_0x183e9c){return db[_0x743f('0x32')][_0x743f('0x50')](_0x4ac4e9[_0x743f('0x51')],{})[_0x743f('0x28')](function(_0x4839db){var _0x5565ab=_0x4ac4e9[_0x743f('0x52')][_0x743f('0x2a')]({'plain':!![]});if(!_0x5565ab)throw new Error(_0x743f('0x53'));if(_0x5565ab[_0x743f('0x54')]===_0x743f('0x52')){var _0x2720b3=_0x4839db[_0x743f('0x2a')]({'plain':!![]});var _0x451db6=_0x743f('0x2b');return db[_0x743f('0x55')][_0x743f('0x4f')]({'where':{'name':_0x451db6,'userProfileId':_0x5565ab[_0x743f('0x56')]},'raw':!![]})[_0x743f('0x28')](function(_0x5dc69b){if(_0x5dc69b&&_0x5dc69b['autoAssociation']===0x0){return db[_0x743f('0x2c')]['create']({'name':_0x2720b3[_0x743f('0x2f')],'resourceId':_0x2720b3['id'],'type':_0x5dc69b[_0x743f('0x2f')],'sectionId':_0x5dc69b['id']},{})[_0x743f('0x28')](function(){return _0x4839db;});}else{return _0x4839db;}})[_0x743f('0x4a')](function(_0x1eae76){logger[_0x743f('0x2d')](_0x743f('0x57'),_0x1eae76);throw _0x1eae76;});}return _0x4839db;})['then'](respondWithResult(_0x183e9c,0xc9))['catch'](handleError(_0x183e9c,null));};exports[_0x743f('0x27')]=function(_0x5995ce,_0x489f7a){if(_0x5995ce[_0x743f('0x51')]['id']){delete _0x5995ce[_0x743f('0x51')]['id'];}return db[_0x743f('0x32')]['find']({'where':{'id':_0x5995ce[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](handleEntityNotFound(_0x489f7a,null))[_0x743f('0x28')](saveUpdates(_0x5995ce[_0x743f('0x51')],null))[_0x743f('0x28')](respondWithResult(_0x489f7a,null))['catch'](handleError(_0x489f7a,null));};exports['destroy']=function(_0x3ee4ad,_0x3d0fba){return db[_0x743f('0x32')][_0x743f('0x4f')]({'where':{'id':_0x3ee4ad['params']['id']}})['then'](handleEntityNotFound(_0x3d0fba,null))[_0x743f('0x28')](removeEntity(_0x3d0fba,null))[_0x743f('0x4a')](handleError(_0x3d0fba,null));};exports[_0x743f('0x58')]=function(_0x33f7fc,_0x1b4439){return db['WhatsappQueue']['describe']()[_0x743f('0x28')](respondWithResult(_0x1b4439,null))[_0x743f('0x4a')](handleError(_0x1b4439,null));};exports[_0x743f('0x59')]=function(_0x2aa3a3,_0x14652f,_0x3c8832){var _0xfa3450={'raw':!![],'where':{}},_0x400307={},_0x3aad4b;return db[_0x743f('0x32')]['findOne']({'where':{'id':_0x2aa3a3[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](handleEntityNotFound(_0x14652f,null))[_0x743f('0x28')](function(_0x446349){if(_0x446349){_0x3aad4b=_0x446349[_0x743f('0x2a')]({'plain':!![]});_0x400307[_0x743f('0x37')]=_['keys'](db['UserWhatsappQueue']['rawAttributes']);_0x400307[_0x743f('0x39')]=_['keys'](_0x2aa3a3[_0x743f('0x39')]);_0x400307['filters']=_[_0x743f('0x4d')](_0x400307[_0x743f('0x37')],_0x400307['query']);_0xfa3450[_0x743f('0x3c')]=_[_0x743f('0x4d')](_0x400307[_0x743f('0x37')],qs[_0x743f('0x3d')](_0x2aa3a3['query'][_0x743f('0x3d')]));_0xfa3450[_0x743f('0x3c')]=_0xfa3450[_0x743f('0x3c')][_0x743f('0x4e')]?_0xfa3450['attributes']:_0x400307['model'];if(!_0x2aa3a3[_0x743f('0x39')][_0x743f('0x3e')](_0x743f('0x3f'))){_0xfa3450['limit']=qs[_0x743f('0x24')](_0x2aa3a3['query'][_0x743f('0x24')]);_0xfa3450[_0x743f('0x23')]=qs[_0x743f('0x23')](_0x2aa3a3['query'][_0x743f('0x23')]);}_0xfa3450['order']=qs[_0x743f('0x41')](_0x2aa3a3[_0x743f('0x39')][_0x743f('0x41')]);_0xfa3450[_0x743f('0x44')]=qs[_0x743f('0x3b')](_[_0x743f('0x42')](_0x2aa3a3['query'],_0x400307[_0x743f('0x3b')]));_0xfa3450[_0x743f('0x44')][_0x743f('0x5a')]=_0x446349['id'];if(_0x2aa3a3[_0x743f('0x39')][_0x743f('0x43')]){_0xfa3450['where']=_['merge'](_0xfa3450['where'],{'$or':_[_0x743f('0x38')](_0xfa3450[_0x743f('0x3c')],function(_0x296866){var _0x5a8e11={};_0x5a8e11[_0x296866]={'$like':'%'+_0x2aa3a3['query'][_0x743f('0x43')]+'%'};return _0x5a8e11;})});}_0xfa3450=_[_0x743f('0x45')]({},_0xfa3450,_0x2aa3a3[_0x743f('0x46')]);return db['UserWhatsappQueue']['findAll'](_0xfa3450);}})[_0x743f('0x28')](function(_0x327ced){if(_0x327ced){return db[_0x743f('0x5b')][_0x743f('0x5c')]({'where':{'id':_['map'](_0x327ced,_0x743f('0x5d')),'role':'agent'},'attributes':['id',_0x743f('0x2f'),'whatsappPause',_0x743f('0x5e'),_0x743f('0x5f')]});}})[_0x743f('0x28')](function(_0x4fdd16){if(_0x4fdd16){return{'count':_0x4fdd16['count'],'rows':_['map'](_0x4fdd16['rows'],function(_0x2b9c43){return{'membername':_0x2b9c43[_0x743f('0x2f')],'UserId':_0x2b9c43['id'],'queue_name':_0x3aad4b[_0x743f('0x2f')],'WhatsappQueueId':_0x3aad4b['id'],'interface':util['format']('%s/%s',_0x743f('0x60'),_0x2b9c43[_0x743f('0x2f')]),'penalty':0x0,'paused':_0x2b9c43['whatsappPause'],'createdAt':_0x2b9c43[_0x743f('0x5f')],'updatedAt':_0x2b9c43[_0x743f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x743f('0x28')](respondWithFilteredResult(_0x14652f,_0xfa3450))['catch'](handleError(_0x14652f,null));};exports['getTeams']=function(_0x537c5f,_0x2ba76e,_0x425eb8){var _0x3c2530={};var _0x5c8554={};var _0x28a3c5;var _0x2df0aa;return db[_0x743f('0x32')][_0x743f('0x61')]({'where':{'id':_0x537c5f[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](handleEntityNotFound(_0x2ba76e,null))[_0x743f('0x28')](function(_0x49875c){if(_0x49875c){_0x28a3c5=_0x49875c;_0x5c8554[_0x743f('0x37')]=_[_0x743f('0x3a')](db[_0x743f('0x62')][_0x743f('0x33')]);_0x5c8554[_0x743f('0x39')]=_[_0x743f('0x3a')](_0x537c5f[_0x743f('0x39')]);_0x5c8554[_0x743f('0x3b')]=_[_0x743f('0x4d')](_0x5c8554[_0x743f('0x37')],_0x5c8554['query']);_0x3c2530[_0x743f('0x3c')]=_[_0x743f('0x4d')](_0x5c8554[_0x743f('0x37')],qs[_0x743f('0x3d')](_0x537c5f[_0x743f('0x39')]['fields']));_0x3c2530[_0x743f('0x3c')]=_0x3c2530[_0x743f('0x3c')][_0x743f('0x4e')]?_0x3c2530['attributes']:_0x5c8554[_0x743f('0x37')];_0x3c2530[_0x743f('0x40')]=qs[_0x743f('0x41')](_0x537c5f[_0x743f('0x39')][_0x743f('0x41')]);_0x3c2530[_0x743f('0x44')]=qs[_0x743f('0x3b')](_['pick'](_0x537c5f[_0x743f('0x39')],_0x5c8554[_0x743f('0x3b')]));if(_0x537c5f[_0x743f('0x39')][_0x743f('0x43')]){_0x3c2530[_0x743f('0x44')]=_[_0x743f('0x45')](_0x3c2530[_0x743f('0x44')],{'$or':_['map'](_0x3c2530[_0x743f('0x3c')],function(_0x129c7f){var _0x50de33={};_0x50de33[_0x129c7f]={'$like':'%'+_0x537c5f[_0x743f('0x39')][_0x743f('0x43')]+'%'};return _0x50de33;})});}_0x3c2530=_[_0x743f('0x45')]({},_0x3c2530,_0x537c5f[_0x743f('0x46')]);return _0x28a3c5[_0x743f('0x63')](_0x3c2530);}})['then'](function(_0x49af7d){if(_0x49af7d){_0x2df0aa=_0x49af7d['length'];if(!_0x537c5f[_0x743f('0x39')][_0x743f('0x3e')](_0x743f('0x3f'))){_0x3c2530[_0x743f('0x24')]=qs['limit'](_0x537c5f['query'][_0x743f('0x24')]);_0x3c2530[_0x743f('0x23')]=qs[_0x743f('0x23')](_0x537c5f[_0x743f('0x39')][_0x743f('0x23')]);}return _0x28a3c5['getTeams'](_0x3c2530);}})['then'](function(_0x55e515){if(_0x55e515){return _0x55e515?{'count':_0x2df0aa,'rows':_0x55e515}:null;}})[_0x743f('0x28')](respondWithResult(_0x2ba76e,null))[_0x743f('0x4a')](handleError(_0x2ba76e,null));};exports[_0x743f('0x64')]=function(_0x30135a,_0x3bb4bf,_0xddfcc6){var _0x1ba06c=_0x30135a[_0x743f('0x51')]['ids'];return db[_0x743f('0x62')]['findAll']({'where':{'id':_0x1ba06c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x743f('0x65'),'attributes':['id',_0x743f('0x2f'),_0x743f('0x66'),_0x743f('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x8b16e5){if(_0x8b16e5){var _0x398f58=_[_0x743f('0x68')](_0x8b16e5,function(_0x5eeafe){var _0x568990=_0x5eeafe[_0x743f('0x2a')]({'plain':!![]});return _0x568990[_0x743f('0x65')];});return db[_0x743f('0x32')][_0x743f('0x4f')]({'where':{'id':_0x30135a[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](function(_0x180a01){return db[_0x743f('0x69')]['transaction'](function(_0x38939e){return _0x180a01[_0x743f('0x64')](_0x1ba06c,{'transaction':_0x38939e})[_0x743f('0x28')](function(){return BPromise[_0x743f('0x6a')](_0x398f58,function(_0x306594){return db[_0x743f('0x6b')][_0x743f('0x6c')]({'where':{'UserId':_0x306594['id'],'WhatsappQueueId':_0x30135a[_0x743f('0x4c')]['id']},'transaction':_0x38939e});});})['then'](function(){_0x398f58[_0x743f('0x6d')](function(_0xfff4a6){socket[_0x743f('0x6e')](_0x743f('0x6f'),{'UserId':_0xfff4a6['id'],'WhatsappQueueId':_0x180a01['id']});});});});});}})[_0x743f('0x28')](respondWithStatusCode(_0x3bb4bf,null))['catch'](handleError(_0x3bb4bf,null));};exports['removeTeams']=function(_0xa7c9c2,_0x18338d,_0x3eedb4){return db[_0x743f('0x62')]['findAll']({'where':{'id':_0xa7c9c2[_0x743f('0x39')][_0x743f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x743f('0x5b')],'as':_0x743f('0x65'),'attributes':['id'],'raw':!![]}]})[_0x743f('0x28')](handleEntityNotFound(_0x18338d,null))[_0x743f('0x28')](function(_0x2a5cd5){var _0x4de17f=_[_0x743f('0x38')](_0x2a5cd5,'id');var _0x592420=[];var _0x4f3022=[];var _0x47fefa=squel[_0x743f('0x71')]();_0x47fefa[_0x743f('0x72')]('tq.TeamId')[_0x743f('0x73')](_0x743f('0x74'),'tq')['join'](_0x743f('0x75'),'ut',_0x743f('0x76'))[_0x743f('0x44')]('WhatsappQueueId\x20=\x20?',_0xa7c9c2['params']['id']);for(var _0x45cf5e=0x0;_0x45cf5e<_0x2a5cd5['length'];_0x45cf5e+=0x1){let _0x606e9a=_0x2a5cd5[_0x45cf5e];for(var _0x2e3985=0x0;_0x2e3985<_0x606e9a['Agents'][_0x743f('0x4e')];_0x2e3985+=0x1){let _0x268583=_0x606e9a[_0x743f('0x65')][_0x2e3985];var _0x45dcb1=_0x47fefa['clone']();_0x45dcb1['where']('ut.UserId\x20=\x20?',_0x268583['id']);_0x4f3022[_0x743f('0x77')](db['sequelize']['query'](_0x45dcb1[_0x743f('0x78')](),{'type':db[_0x743f('0x69')][_0x743f('0x79')][_0x743f('0x7a')]})[_0x743f('0x28')](function(_0x114248){if(_0x114248[_0x743f('0x4e')]===0x1){return _0x268583['id'];}else{var _0x15c6a4=_[_0x743f('0x7b')](_[_0x743f('0x38')](_0x114248,_0x743f('0x7c')),function(_0x326320){return _[_0x743f('0x7d')](_0x4de17f,_0x326320);});if(_0x15c6a4){return _0x268583['id'];}}}));}}return BPromise[_0x743f('0x7e')](_0x4f3022)[_0x743f('0x28')](function(_0x52ebe8){_0x592420=_(_0x592420)[_0x743f('0x7f')](_0x52ebe8)[_0x743f('0x80')]()['value']();return db['WhatsappQueue']['find']({'where':{'id':_0xa7c9c2[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](function(_0x5a3014){return db[_0x743f('0x69')][_0x743f('0x81')](function(_0x49f5db){return _0x5a3014[_0x743f('0x82')](_0xa7c9c2[_0x743f('0x39')][_0x743f('0x70')],{'transaction':_0x49f5db})[_0x743f('0x28')](function(){if(!_[_0x743f('0x83')](_0x592420)){return _0x5a3014['removeAgents'](_0x592420,{'transaction':_0x49f5db});}})[_0x743f('0x28')](function(){_0x592420[_0x743f('0x6d')](function(_0x55c2c0){socket[_0x743f('0x6e')]('userWhatsappQueue:remove',{'UserId':_0x55c2c0,'WhatsappQueueId':_0x5a3014['id']});});});});});});})[_0x743f('0x28')](respondWithStatusCode(_0x18338d,null))[_0x743f('0x4a')](handleError(_0x18338d,null));};exports[_0x743f('0x84')]=function(_0x5eb697,_0x5283a3,_0x550cd4){return db['WhatsappQueue']['find']({'where':{'id':_0x5eb697[_0x743f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5283a3,null))[_0x743f('0x28')](function(_0x2ba132){if(_0x2ba132){return _0x2ba132[_0x743f('0x84')](_0x5eb697[_0x743f('0x51')]['ids'],_[_0x743f('0x85')](_0x5eb697[_0x743f('0x51')],[_0x743f('0x70'),'id'])||{})[_0x743f('0x86')](function(_0x29c3f9){for(var _0x527571=0x0;_0x527571<_0x5eb697['body'][_0x743f('0x70')]['length'];_0x527571+=0x1){socket[_0x743f('0x6e')](_0x743f('0x6f'),{'UserId':Number(_0x5eb697['body']['ids'][_0x527571]),'WhatsappQueueId':Number(_0x5eb697[_0x743f('0x4c')]['id'])});}return _0x29c3f9;});}})['then'](respondWithResult(_0x5283a3,null))[_0x743f('0x4a')](handleError(_0x5283a3,null));};exports[_0x743f('0x87')]=function(_0x20207d,_0x17fa0f,_0x39bb53){return db[_0x743f('0x32')][_0x743f('0x4f')]({'where':{'id':_0x20207d[_0x743f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x17fa0f,null))['then'](function(_0x2977e6){if(_0x2977e6){return _0x2977e6[_0x743f('0x87')](_0x20207d[_0x743f('0x39')][_0x743f('0x70')])['then'](function(){if(_['isArray'](_0x20207d[_0x743f('0x39')]['ids'])){for(var _0x4b2a02=0x0;_0x4b2a02<_0x20207d[_0x743f('0x39')]['ids'][_0x743f('0x4e')];_0x4b2a02+=0x1){socket['emit'](_0x743f('0x88'),{'UserId':Number(_0x20207d[_0x743f('0x39')][_0x743f('0x70')][_0x4b2a02]),'WhatsappQueueId':Number(_0x20207d[_0x743f('0x4c')]['id'])});}}else{socket[_0x743f('0x6e')](_0x743f('0x88'),{'UserId':Number(_0x20207d[_0x743f('0x39')][_0x743f('0x70')]),'WhatsappQueueId':Number(_0x20207d[_0x743f('0x4c')]['id'])});}});}})[_0x743f('0x28')](respondWithStatusCode(_0x17fa0f,null))[_0x743f('0x4a')](handleError(_0x17fa0f,null));};exports[_0x743f('0x89')]=function(_0x2055e0,_0x4b5f2d,_0x20eaee){var _0x3bd068={};var _0x115c48={};var _0x373407;var _0xbf12d2;return db[_0x743f('0x32')][_0x743f('0x61')]({'where':{'id':_0x2055e0[_0x743f('0x4c')]['id']}})[_0x743f('0x28')](handleEntityNotFound(_0x4b5f2d,null))[_0x743f('0x28')](function(_0x3225cd){if(_0x3225cd){_0x373407=_0x3225cd;_0x115c48['model']=_[_0x743f('0x3a')](db[_0x743f('0x5b')][_0x743f('0x33')]);_0x115c48['query']=_['keys'](_0x2055e0[_0x743f('0x39')]);_0x115c48['filters']=_[_0x743f('0x4d')](_0x115c48[_0x743f('0x37')],_0x115c48[_0x743f('0x39')]);_0x3bd068['attributes']=_[_0x743f('0x4d')](_0x115c48[_0x743f('0x37')],qs['fields'](_0x2055e0[_0x743f('0x39')][_0x743f('0x3d')]));_0x3bd068[_0x743f('0x3c')]=_0x3bd068[_0x743f('0x3c')][_0x743f('0x4e')]?_0x3bd068[_0x743f('0x3c')]:_0x115c48['model'];_0x3bd068[_0x743f('0x40')]=qs[_0x743f('0x41')](_0x2055e0[_0x743f('0x39')][_0x743f('0x41')]);_0x3bd068[_0x743f('0x44')]=qs[_0x743f('0x3b')](_[_0x743f('0x42')](_0x2055e0[_0x743f('0x39')],_0x115c48[_0x743f('0x3b')]));if(_0x2055e0[_0x743f('0x39')][_0x743f('0x43')]){_0x3bd068[_0x743f('0x44')]=_['merge'](_0x3bd068[_0x743f('0x44')],{'$or':_[_0x743f('0x38')](_0x3bd068[_0x743f('0x3c')],function(_0x2db290){var _0xe50bf2={};_0xe50bf2[_0x2db290]={'$like':'%'+_0x2055e0[_0x743f('0x39')][_0x743f('0x43')]+'%'};return _0xe50bf2;})});}_0x3bd068=_[_0x743f('0x45')]({},_0x3bd068,_0x2055e0[_0x743f('0x46')]);return _0x373407[_0x743f('0x89')](_0x3bd068);}})[_0x743f('0x28')](function(_0x3c7af5){if(_0x3c7af5){_0xbf12d2=_0x3c7af5[_0x743f('0x4e')];if(!_0x2055e0[_0x743f('0x39')]['hasOwnProperty'](_0x743f('0x3f'))){_0x3bd068[_0x743f('0x24')]=qs[_0x743f('0x24')](_0x2055e0['query'][_0x743f('0x24')]);_0x3bd068[_0x743f('0x23')]=qs[_0x743f('0x23')](_0x2055e0['query']['offset']);}return _0x373407[_0x743f('0x89')](_0x3bd068);}})['then'](function(_0x54c520){if(_0x54c520){return _0x54c520?{'count':_0xbf12d2,'rows':_0x54c520}:null;}})[_0x743f('0x28')](respondWithResult(_0x4b5f2d,null))[_0x743f('0x4a')](handleError(_0x4b5f2d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 4daa1fa..50f3e6a 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 _0xaf07=['hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','save','update','emit'];(function(_0x1693cf,_0x2ccbcc){var _0x56b509=function(_0x412646){while(--_0x412646){_0x1693cf['push'](_0x1693cf['shift']());}};_0x56b509(++_0x2ccbcc);}(_0xaf07,0x1c5));var _0x7af0=function(_0x2817f3,_0x93783a){_0x2817f3=_0x2817f3-0x0;var _0x3cb244=_0xaf07[_0x2817f3];return _0x3cb244;};'use strict';var EventEmitter=require(_0x7af0('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x7af0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7af0('0x2')](0x0);var events={'afterCreate':_0x7af0('0x3'),'afterUpdate':_0x7af0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3eef59){return function(_0x274b38,_0x38e8be,_0x9d0a24){WhatsappQueueEvents['emit'](_0x3eef59+':'+_0x274b38['id'],_0x274b38);WhatsappQueueEvents[_0x7af0('0x5')](_0x3eef59,_0x274b38);_0x9d0a24(null);};}for(var e in events){if(events[_0x7af0('0x6')](e)){var event=events[e];WhatsappQueue[_0x7af0('0x7')](e,emitEvent(event));}}module[_0x7af0('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x0892=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x0892,0x128));var _0x2089=function(_0x4006d7,_0x561860){_0x4006d7=_0x4006d7-0x0;var _0x569522=_0x0892[_0x4006d7];return _0x569522;};'use strict';var EventEmitter=require(_0x2089('0x0'));var WhatsappQueue=require(_0x2089('0x1'))['db'][_0x2089('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2089('0x3')](0x0);var events={'afterCreate':_0x2089('0x4'),'afterUpdate':_0x2089('0x5'),'afterDestroy':'remove'};function emitEvent(_0xb83cac){return function(_0xfbbbdd,_0x5be6e9,_0x81f104){WhatsappQueueEvents[_0x2089('0x6')](_0xb83cac+':'+_0xfbbbdd['id'],_0xfbbbdd);WhatsappQueueEvents['emit'](_0xb83cac,_0xfbbbdd);_0x81f104(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x2089('0x7')](e,emitEvent(event));}}module[_0x2089('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 841616b..8b5e3e9 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 _0x6d65=['moment','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6d65,0x134));var _0x56d6=function(_0x338801,_0x1ff4af){_0x338801=_0x338801-0x0;var _0x4a47dc=_0x6d65[_0x338801];return _0x4a47dc;};'use strict';var _=require(_0x56d6('0x0'));var util=require(_0x56d6('0x1'));var logger=require(_0x56d6('0x2'))(_0x56d6('0x3'));var moment=require(_0x56d6('0x4'));var BPromise=require('bluebird');var rp=require(_0x56d6('0x5'));var fs=require('fs');var path=require(_0x56d6('0x6'));var rimraf=require(_0x56d6('0x7'));var config=require('../../config/environment');var attributes=require(_0x56d6('0x8'));module[_0x56d6('0x9')]=function(_0x3dd5e6,_0x376325){return _0x3dd5e6[_0x56d6('0xa')]('WhatsappQueue',attributes,{'tableName':_0x56d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa399=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash','../../config/logger'];(function(_0x43f77e,_0x28d344){var _0xd6eb0d=function(_0x2d8cd8){while(--_0x2d8cd8){_0x43f77e['push'](_0x43f77e['shift']());}};_0xd6eb0d(++_0x28d344);}(_0xa399,0x8a));var _0x9a39=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xa399[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x9a39('0x0'));var util=require('util');var logger=require(_0x9a39('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9a39('0x2'));var rp=require(_0x9a39('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a39('0x4'));var config=require(_0x9a39('0x5'));var attributes=require(_0x9a39('0x6'));module[_0x9a39('0x7')]=function(_0x39e907,_0x3bc0e5){return _0x39e907[_0x9a39('0x8')]('WhatsappQueue',attributes,{'tableName':_0x9a39('0x9'),'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 ae84235..1b0875c 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 _0xa9c8=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','debug','lodash','util'];(function(_0x1ad689,_0x118b49){var _0x3f99f8=function(_0x3b1b0d){while(--_0x3b1b0d){_0x1ad689['push'](_0x1ad689['shift']());}};_0x3f99f8(++_0x118b49);}(_0xa9c8,0x1a0));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a9c('0x0'));var util=require(_0x8a9c('0x1'));var moment=require('moment');var BPromise=require(_0x8a9c('0x2'));var rs=require(_0x8a9c('0x3'));var fs=require('fs');var Redis=require(_0x8a9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a9c('0x5'));var logger=require(_0x8a9c('0x6'))(_0x8a9c('0x7'));var config=require(_0x8a9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8a9c('0x9')]['http']({'port':0x232a});config[_0x8a9c('0xa')]=_[_0x8a9c('0xb')](config[_0x8a9c('0xa')],{'host':_0x8a9c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8a9c('0xd'))['register'](socket);function respondWithRpcPromise(_0x215c01,_0x479758,_0x39dd66){return new BPromise(function(_0x59b916,_0x4a8753){return client[_0x8a9c('0xe')](_0x215c01,_0x39dd66)[_0x8a9c('0xf')](function(_0x4fb47b){logger[_0x8a9c('0x10')](_0x8a9c('0x11'),_0x479758,_0x8a9c('0x12'));logger['debug'](_0x8a9c('0x13'),_0x479758,_0x8a9c('0x12'),JSON[_0x8a9c('0x14')](_0x4fb47b));if(_0x4fb47b[_0x8a9c('0x15')]){if(_0x4fb47b[_0x8a9c('0x15')][_0x8a9c('0x16')]===0x1f4){logger[_0x8a9c('0x15')](_0x8a9c('0x11'),_0x479758,_0x4fb47b[_0x8a9c('0x15')]['message']);return _0x4a8753(_0x4fb47b['error'][_0x8a9c('0x17')]);}logger[_0x8a9c('0x15')](_0x8a9c('0x11'),_0x479758,_0x4fb47b[_0x8a9c('0x15')][_0x8a9c('0x17')]);return _0x59b916(_0x4fb47b['error']['message']);}else{logger['info'](_0x8a9c('0x11'),_0x479758,_0x8a9c('0x12'));_0x59b916(_0x4fb47b['result'][_0x8a9c('0x17')]);}})[_0x8a9c('0x18')](function(_0x480032){logger[_0x8a9c('0x15')](_0x8a9c('0x11'),_0x479758,_0x480032);_0x4a8753(_0x480032);});});}exports[_0x8a9c('0x19')]=function(_0x60c938){var _0x3bcb45=this;return new Promise(function(_0x4d1c5a,_0x54c78d){return db[_0x8a9c('0x1a')][_0x8a9c('0x1b')]({'raw':_0x60c938[_0x8a9c('0x1c')]?_0x60c938[_0x8a9c('0x1c')][_0x8a9c('0x1d')]===undefined?!![]:![]:!![],'where':_0x60c938[_0x8a9c('0x1c')]?_0x60c938[_0x8a9c('0x1c')][_0x8a9c('0x1e')]||null:null,'attributes':_0x60c938['options']?_0x60c938[_0x8a9c('0x1c')][_0x8a9c('0x1f')]||null:null,'limit':_0x60c938[_0x8a9c('0x1c')]?_0x60c938['options'][_0x8a9c('0x20')]||null:null,'include':_0x60c938[_0x8a9c('0x1c')]?_0x60c938[_0x8a9c('0x1c')][_0x8a9c('0x21')]?_[_0x8a9c('0x22')](_0x60c938[_0x8a9c('0x1c')][_0x8a9c('0x21')],function(_0x7f0a3a){return{'model':db[_0x7f0a3a[_0x8a9c('0x23')]],'as':_0x7f0a3a['as'],'attributes':_0x7f0a3a[_0x8a9c('0x1f')],'include':_0x7f0a3a['include']?_[_0x8a9c('0x22')](_0x7f0a3a[_0x8a9c('0x21')],function(_0x460390){return{'model':db[_0x460390[_0x8a9c('0x23')]],'as':_0x460390['as'],'attributes':_0x460390[_0x8a9c('0x1f')],'include':_0x460390[_0x8a9c('0x21')]?_['map'](_0x460390[_0x8a9c('0x21')],function(_0xb4d485){return{'model':db[_0xb4d485[_0x8a9c('0x23')]],'as':_0xb4d485['as'],'attributes':_0xb4d485[_0x8a9c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8a9c('0xf')](function(_0x5ad4bf){logger[_0x8a9c('0x10')](_0x8a9c('0x19'),_0x60c938);logger['debug']('GetWhatsappQueue',_0x60c938,JSON[_0x8a9c('0x14')](_0x5ad4bf));_0x4d1c5a(_0x5ad4bf);})[_0x8a9c('0x18')](function(_0x4a9c2b){logger[_0x8a9c('0x15')](_0x8a9c('0x19'),_0x4a9c2b[_0x8a9c('0x17')],_0x60c938);_0x54c78d(_0x3bcb45['error'](0x1f4,_0x4a9c2b[_0x8a9c('0x17')]));});});};exports[_0x8a9c('0x24')]=function(_0x4f79e8){var _0x1be882=this;return new Promise(function(_0x4e463e,_0x5df715){return db[_0x8a9c('0x1a')]['find']({'raw':_0x4f79e8['options']?_0x4f79e8[_0x8a9c('0x1c')][_0x8a9c('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f79e8[_0x8a9c('0x1c')]?_0x4f79e8[_0x8a9c('0x1c')][_0x8a9c('0x1e')]||null:null,'attributes':_0x4f79e8[_0x8a9c('0x1c')]?_0x4f79e8[_0x8a9c('0x1c')][_0x8a9c('0x1f')]||null:null,'include':_0x4f79e8[_0x8a9c('0x1c')]?_0x4f79e8[_0x8a9c('0x1c')][_0x8a9c('0x21')]?_[_0x8a9c('0x22')](_0x4f79e8[_0x8a9c('0x1c')][_0x8a9c('0x21')],function(_0x2a98c7){return{'model':db[_0x2a98c7['model']],'as':_0x2a98c7['as'],'attributes':_0x2a98c7[_0x8a9c('0x1f')],'include':_0x2a98c7[_0x8a9c('0x21')]?_[_0x8a9c('0x22')](_0x2a98c7['include'],function(_0x44f492){return{'model':db[_0x44f492['model']],'as':_0x44f492['as'],'attributes':_0x44f492[_0x8a9c('0x1f')],'include':_0x44f492[_0x8a9c('0x21')]?_[_0x8a9c('0x22')](_0x44f492[_0x8a9c('0x21')],function(_0x1bbe60){return{'model':db[_0x1bbe60[_0x8a9c('0x23')]],'as':_0x1bbe60['as'],'attributes':_0x1bbe60[_0x8a9c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8a9c('0xf')](function(_0x31d8f8){logger[_0x8a9c('0x10')]('ShowWhatsappQueue',_0x4f79e8);logger[_0x8a9c('0x25')](_0x8a9c('0x24'),_0x4f79e8,JSON[_0x8a9c('0x14')](_0x31d8f8));_0x4e463e(_0x31d8f8);})['catch'](function(_0x345c8f){logger['error']('ShowWhatsappQueue',_0x345c8f[_0x8a9c('0x17')],_0x4f79e8);_0x5df715(_0x1be882[_0x8a9c('0x15')](0x1f4,_0x345c8f[_0x8a9c('0x17')]));});});}; \ No newline at end of file +var _0x4142=['moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetWhatsappQueue','WhatsappQueue','options','where','attributes','limit','include','model','map','catch','find','raw','ShowWhatsappQueue'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4142,0x1a4));var _0x2414=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4142[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2414('0x0'));var BPromise=require(_0x2414('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2414('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2414('0x3'))('rpc');var config=require(_0x2414('0x4'));var jayson=require(_0x2414('0x5'));var client=jayson[_0x2414('0x6')][_0x2414('0x7')]({'port':0x232a});config[_0x2414('0x8')]=_[_0x2414('0x9')](config[_0x2414('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2414('0xa'))(new Redis(config[_0x2414('0x8')]));require(_0x2414('0xb'))[_0x2414('0xc')](socket);function respondWithRpcPromise(_0x5cd5fb,_0x17d376,_0x14c5ec){return new BPromise(function(_0x2b55d5,_0x54149f){return client['request'](_0x5cd5fb,_0x14c5ec)[_0x2414('0xd')](function(_0x7d1f36){logger[_0x2414('0xe')](_0x2414('0xf'),_0x17d376,'request\x20sent');logger[_0x2414('0x10')](_0x2414('0x11'),_0x17d376,_0x2414('0x12'),JSON[_0x2414('0x13')](_0x7d1f36));if(_0x7d1f36[_0x2414('0x14')]){if(_0x7d1f36[_0x2414('0x14')]['code']===0x1f4){logger['error'](_0x2414('0xf'),_0x17d376,_0x7d1f36[_0x2414('0x14')]['message']);return _0x54149f(_0x7d1f36[_0x2414('0x14')][_0x2414('0x15')]);}logger[_0x2414('0x14')](_0x2414('0xf'),_0x17d376,_0x7d1f36['error'][_0x2414('0x15')]);return _0x2b55d5(_0x7d1f36[_0x2414('0x14')][_0x2414('0x15')]);}else{logger[_0x2414('0xe')](_0x2414('0xf'),_0x17d376,'request\x20sent');_0x2b55d5(_0x7d1f36['result'][_0x2414('0x15')]);}})['catch'](function(_0x2cb429){logger[_0x2414('0x14')](_0x2414('0xf'),_0x17d376,_0x2cb429);_0x54149f(_0x2cb429);});});}exports[_0x2414('0x16')]=function(_0x105538){var _0x14932b=this;return new Promise(function(_0x1c05af,_0x46b317){return db[_0x2414('0x17')]['findAll']({'raw':_0x105538[_0x2414('0x18')]?_0x105538[_0x2414('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x105538['options']?_0x105538[_0x2414('0x18')][_0x2414('0x19')]||null:null,'attributes':_0x105538[_0x2414('0x18')]?_0x105538[_0x2414('0x18')][_0x2414('0x1a')]||null:null,'limit':_0x105538[_0x2414('0x18')]?_0x105538[_0x2414('0x18')][_0x2414('0x1b')]||null:null,'include':_0x105538['options']?_0x105538['options'][_0x2414('0x1c')]?_['map'](_0x105538['options'][_0x2414('0x1c')],function(_0x55e4dd){return{'model':db[_0x55e4dd[_0x2414('0x1d')]],'as':_0x55e4dd['as'],'attributes':_0x55e4dd[_0x2414('0x1a')],'include':_0x55e4dd[_0x2414('0x1c')]?_['map'](_0x55e4dd['include'],function(_0x3c3524){return{'model':db[_0x3c3524[_0x2414('0x1d')]],'as':_0x3c3524['as'],'attributes':_0x3c3524['attributes'],'include':_0x3c3524['include']?_[_0x2414('0x1e')](_0x3c3524[_0x2414('0x1c')],function(_0x2281c7){return{'model':db[_0x2281c7['model']],'as':_0x2281c7['as'],'attributes':_0x2281c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2414('0xd')](function(_0x29ef73){logger[_0x2414('0xe')](_0x2414('0x16'),_0x105538);logger[_0x2414('0x10')](_0x2414('0x16'),_0x105538,JSON['stringify'](_0x29ef73));_0x1c05af(_0x29ef73);})[_0x2414('0x1f')](function(_0x30dad9){logger[_0x2414('0x14')](_0x2414('0x16'),_0x30dad9[_0x2414('0x15')],_0x105538);_0x46b317(_0x14932b[_0x2414('0x14')](0x1f4,_0x30dad9['message']));});});};exports['ShowWhatsappQueue']=function(_0x3d2e9d){var _0x250b59=this;return new Promise(function(_0x5cee31,_0x24ad08){return db[_0x2414('0x17')][_0x2414('0x20')]({'raw':_0x3d2e9d[_0x2414('0x18')]?_0x3d2e9d['options'][_0x2414('0x21')]===undefined?!![]:![]:!![],'where':_0x3d2e9d[_0x2414('0x18')]?_0x3d2e9d[_0x2414('0x18')][_0x2414('0x19')]||null:null,'attributes':_0x3d2e9d['options']?_0x3d2e9d[_0x2414('0x18')][_0x2414('0x1a')]||null:null,'include':_0x3d2e9d['options']?_0x3d2e9d[_0x2414('0x18')][_0x2414('0x1c')]?_[_0x2414('0x1e')](_0x3d2e9d[_0x2414('0x18')][_0x2414('0x1c')],function(_0x351e1f){return{'model':db[_0x351e1f[_0x2414('0x1d')]],'as':_0x351e1f['as'],'attributes':_0x351e1f[_0x2414('0x1a')],'include':_0x351e1f[_0x2414('0x1c')]?_[_0x2414('0x1e')](_0x351e1f[_0x2414('0x1c')],function(_0x52cc3e){return{'model':db[_0x52cc3e[_0x2414('0x1d')]],'as':_0x52cc3e['as'],'attributes':_0x52cc3e['attributes'],'include':_0x52cc3e['include']?_[_0x2414('0x1e')](_0x52cc3e[_0x2414('0x1c')],function(_0x546fa6){return{'model':db[_0x546fa6[_0x2414('0x1d')]],'as':_0x546fa6['as'],'attributes':_0x546fa6['attributes']};}):[]};}):[]};}):[]:[]})[_0x2414('0xd')](function(_0x4309ab){logger[_0x2414('0xe')](_0x2414('0x22'),_0x3d2e9d);logger[_0x2414('0x10')]('ShowWhatsappQueue',_0x3d2e9d,JSON[_0x2414('0x13')](_0x4309ab));_0x5cee31(_0x4309ab);})[_0x2414('0x1f')](function(_0x4ea10a){logger[_0x2414('0x14')](_0x2414('0x22'),_0x4ea10a['message'],_0x3d2e9d);_0x24ad08(_0x250b59[_0x2414('0x14')](0x1f4,_0x4ea10a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 67a5cde..6a53327 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 _0xc3c4=['length','whatsappQueue:','remove','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc3c4,0xa4));var _0x4c3c=function(_0x26d106,_0x16260c){_0x26d106=_0x26d106-0x0;var _0x140f62=_0xc3c4[_0x26d106];return _0x140f62;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x4c3c('0x0'),_0x4c3c('0x1')];function createListener(_0x445e2b,_0x31d869){return function(_0x14c3d8){_0x31d869[_0x4c3c('0x2')](_0x445e2b,_0x14c3d8);};}function removeListener(_0x45dc1a,_0x40d022){return function(){WhatsappQueueEvents[_0x4c3c('0x3')](_0x45dc1a,_0x40d022);};}exports['register']=function(_0xdd967d){for(var _0x431315=0x0,_0x29604f=events[_0x4c3c('0x4')];_0x431315<_0x29604f;_0x431315++){var _0x4b23d2=events[_0x431315];var _0x40d385=createListener(_0x4c3c('0x5')+_0x4b23d2,_0xdd967d);WhatsappQueueEvents['on'](_0x4b23d2,_0x40d385);}}; \ No newline at end of file +var _0x0da4=['update','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0da4,0x16d));var _0x40da=function(_0x4bf923,_0x177293){_0x4bf923=_0x4bf923-0x0;var _0x22c595=_0x0da4[_0x4bf923];return _0x22c595;};'use strict';var WhatsappQueueEvents=require(_0x40da('0x0'));var events=[_0x40da('0x1'),_0x40da('0x2'),_0x40da('0x3')];function createListener(_0x3394f7,_0x44e4ec){return function(_0x20a668){_0x44e4ec['emit'](_0x3394f7,_0x20a668);};}function removeListener(_0x50caca,_0x40d61a){return function(){WhatsappQueueEvents[_0x40da('0x4')](_0x50caca,_0x40d61a);};}exports[_0x40da('0x5')]=function(_0xeeddbd){for(var _0xef296e=0x0,_0x2565ee=events[_0x40da('0x6')];_0xef296e<_0x2565ee;_0xef296e++){var _0x23ae9a=events[_0xef296e];var _0xf74c49=createListener(_0x40da('0x7')+_0x23ae9a,_0xeeddbd);WhatsappQueueEvents['on'](_0x23ae9a,_0xf74c49);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a07c4fc..067f29c 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 _0x3b06=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x2b1e66,_0x2c3e5d){var _0x65ae2=function(_0x2a3a74){while(--_0x2a3a74){_0x2b1e66['push'](_0x2b1e66['shift']());}};_0x65ae2(++_0x2c3e5d);}(_0x3b06,0x1f0));var _0x63b0=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x3b06[_0x5c6299];return _0x23b564;};'use strict';var multer=require(_0x63b0('0x0'));var util=require(_0x63b0('0x1'));var path=require(_0x63b0('0x2'));var timeout=require(_0x63b0('0x3'));var express=require('express');var router=express[_0x63b0('0x4')]();var fs_extra=require(_0x63b0('0x5'));var auth=require(_0x63b0('0x6'));var interaction=require(_0x63b0('0x7'));var config=require(_0x63b0('0x8'));var controller=require(_0x63b0('0x9'));router[_0x63b0('0xa')]('/',auth[_0x63b0('0xb')](),controller[_0x63b0('0xc')]);router[_0x63b0('0xa')](_0x63b0('0xd'),auth[_0x63b0('0xb')](),controller[_0x63b0('0xe')]);router[_0x63b0('0xa')](_0x63b0('0xf'),auth[_0x63b0('0xb')](),controller[_0x63b0('0x10')]);router[_0x63b0('0x11')]('/',auth[_0x63b0('0xb')](),controller[_0x63b0('0x12')]);router[_0x63b0('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x63b0('0xb')](),controller[_0x63b0('0x14')]);module[_0x63b0('0x15')]=router; \ No newline at end of file +var _0xe824=['post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x50efae,_0x4f82a2){var _0x4b6a4d=function(_0x217d94){while(--_0x217d94){_0x50efae['push'](_0x50efae['shift']());}};_0x4b6a4d(++_0x4f82a2);}(_0xe824,0xcc));var _0x4e82=function(_0x32b248,_0x4e4850){_0x32b248=_0x32b248-0x0;var _0x1634c4=_0xe824[_0x32b248];return _0x1634c4;};'use strict';var multer=require(_0x4e82('0x0'));var util=require(_0x4e82('0x1'));var path=require(_0x4e82('0x2'));var timeout=require(_0x4e82('0x3'));var express=require(_0x4e82('0x4'));var router=express[_0x4e82('0x5')]();var fs_extra=require(_0x4e82('0x6'));var auth=require(_0x4e82('0x7'));var interaction=require(_0x4e82('0x8'));var config=require(_0x4e82('0x9'));var controller=require(_0x4e82('0xa'));router[_0x4e82('0xb')]('/',auth[_0x4e82('0xc')](),controller['index']);router['get'](_0x4e82('0xd'),auth[_0x4e82('0xc')](),controller['describe']);router[_0x4e82('0xb')](_0x4e82('0xe'),auth[_0x4e82('0xc')](),controller[_0x4e82('0xf')]);router[_0x4e82('0x10')]('/',auth[_0x4e82('0xc')](),controller['create']);router['put'](_0x4e82('0xe'),auth[_0x4e82('0xc')](),controller[_0x4e82('0x11')]);router[_0x4e82('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4e82('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d051b92..95da8b4 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(_0x2c85fb,_0x548183){var _0x48ecb2=function(_0x3626cb){while(--_0x3626cb){_0x2c85fb['push'](_0x2c85fb['shift']());}};_0x48ecb2(++_0x548183);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x39cbb1,_0x8a9ac7){var _0xc8149e=function(_0x4c58b9){while(--_0x4c58b9){_0x39cbb1['push'](_0x39cbb1['shift']());}};_0xc8149e(++_0x8a9ac7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 8cd2738..bb45acb 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 _0x34b7=['WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','show','params','includeAll','include','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x34b7,0x196));var _0x734b=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0x34b7[_0x4a1ec0];return _0x49ab91;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x26')]();});}};}function handleEntityNotFound(_0x3abbe6,_0x44ffa9){return function(_0x148abe){if(!_0x148abe){_0x3abbe6[_0x734b('0x18')](0x194);}return _0x148abe;};}function handleError(_0x566d55,_0x49732b){_0x49732b=_0x49732b||0x1f4;return function(_0x13cc5a){logger[_0x734b('0x27')](_0x13cc5a['stack']);if(_0x13cc5a[_0x734b('0x28')]){delete _0x13cc5a[_0x734b('0x28')];}_0x566d55[_0x734b('0x19')](_0x49732b)[_0x734b('0x29')](_0x13cc5a);};}exports[_0x734b('0x2a')]=function(_0x1b8295,_0x3ba39c){var _0x5c6c5d={},_0x1f3652={},_0x436efe={'count':0x0,'rows':[]};var _0x42e9ae=_[_0x734b('0x2b')](db[_0x734b('0x2c')][_0x734b('0x2d')],function(_0x1fed72){return{'name':_0x1fed72[_0x734b('0x2e')],'type':_0x1fed72[_0x734b('0x2f')][_0x734b('0x30')]};});_0x1f3652['model']=_[_0x734b('0x2b')](_0x42e9ae,_0x734b('0x28'));_0x1f3652['query']=_[_0x734b('0x31')](_0x1b8295[_0x734b('0x32')]);_0x1f3652[_0x734b('0x33')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],_0x1f3652[_0x734b('0x32')]);_0x5c6c5d[_0x734b('0x36')]=_[_0x734b('0x34')](_0x1f3652[_0x734b('0x35')],qs[_0x734b('0x37')](_0x1b8295[_0x734b('0x32')][_0x734b('0x37')]));_0x5c6c5d[_0x734b('0x36')]=_0x5c6c5d[_0x734b('0x36')][_0x734b('0x38')]?_0x5c6c5d['attributes']:_0x1f3652[_0x734b('0x35')];if(!_0x1b8295['query'][_0x734b('0x39')](_0x734b('0x3a'))){_0x5c6c5d[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x1b8295[_0x734b('0x32')][_0x734b('0x1e')]);_0x5c6c5d['offset']=qs['offset'](_0x1b8295[_0x734b('0x32')]['offset']);}_0x5c6c5d[_0x734b('0x3b')]=qs['sort'](_0x1b8295[_0x734b('0x32')]['sort']);_0x5c6c5d[_0x734b('0x3c')]=qs['filters'](_[_0x734b('0x3d')](_0x1b8295[_0x734b('0x32')],_0x1f3652[_0x734b('0x33')]),_0x42e9ae);if(_0x1b8295[_0x734b('0x32')][_0x734b('0x3e')]){_0x5c6c5d[_0x734b('0x3c')]=_[_0x734b('0x3f')](_0x5c6c5d['where'],{'$or':_[_0x734b('0x2b')](_0x42e9ae,function(_0x317d32){if(_0x317d32['type']!==_0x734b('0x40')){var _0x309b31={};_0x309b31[_0x317d32[_0x734b('0x28')]]={'$like':'%'+_0x1b8295[_0x734b('0x32')]['filter']+'%'};return _0x309b31;}})});}_0x5c6c5d=_[_0x734b('0x3f')]({},_0x5c6c5d,_0x1b8295[_0x734b('0x41')]);var _0x4efb1f={'where':_0x5c6c5d[_0x734b('0x3c')]};return db[_0x734b('0x2c')]['count'](_0x4efb1f)[_0x734b('0x24')](function(_0x2d8f31){_0x436efe[_0x734b('0x1d')]=_0x2d8f31;if(_0x1b8295[_0x734b('0x32')]['includeAll']){_0x5c6c5d['include']=[{'all':!![]}];}return db[_0x734b('0x2c')]['findAll'](_0x5c6c5d);})['then'](function(_0x121a00){_0x436efe['rows']=_0x121a00;return _0x436efe;})[_0x734b('0x24')](respondWithFilteredResult(_0x3ba39c,_0x5c6c5d))['catch'](handleError(_0x3ba39c,null));};exports[_0x734b('0x42')]=function(_0x337106,_0xe4fe38){var _0x4c3fdc={'raw':!![],'where':{'id':_0x337106[_0x734b('0x43')]['id']}},_0x5cf3a0={};_0x5cf3a0['model']=_['keys'](db[_0x734b('0x2c')][_0x734b('0x2d')]);_0x5cf3a0['query']=_[_0x734b('0x31')](_0x337106['query']);_0x5cf3a0[_0x734b('0x33')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],_0x5cf3a0['query']);_0x4c3fdc[_0x734b('0x36')]=_[_0x734b('0x34')](_0x5cf3a0[_0x734b('0x35')],qs[_0x734b('0x37')](_0x337106['query']['fields']));_0x4c3fdc['attributes']=_0x4c3fdc[_0x734b('0x36')]['length']?_0x4c3fdc['attributes']:_0x5cf3a0[_0x734b('0x35')];if(_0x337106['query'][_0x734b('0x44')]){_0x4c3fdc[_0x734b('0x45')]=[{'all':!![]}];}_0x4c3fdc=_[_0x734b('0x3f')]({},_0x4c3fdc,_0x337106[_0x734b('0x41')]);return db['WhatsappQueueReport'][_0x734b('0x46')](_0x4c3fdc)['then'](handleEntityNotFound(_0xe4fe38,null))[_0x734b('0x24')](respondWithResult(_0xe4fe38,null))[_0x734b('0x47')](handleError(_0xe4fe38,null));};exports[_0x734b('0x48')]=function(_0x5cdacb,_0x370326){return db['WhatsappQueueReport'][_0x734b('0x48')](_0x5cdacb[_0x734b('0x49')],{})['then'](respondWithResult(_0x370326,0xc9))[_0x734b('0x47')](handleError(_0x370326,null));};exports[_0x734b('0x4a')]=function(_0x145ced,_0x38125a){if(_0x145ced[_0x734b('0x49')]['id']){delete _0x145ced['body']['id'];}return db[_0x734b('0x2c')]['find']({'where':{'id':_0x145ced[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x38125a,null))[_0x734b('0x24')](saveUpdates(_0x145ced[_0x734b('0x49')],null))[_0x734b('0x24')](respondWithResult(_0x38125a,null))[_0x734b('0x47')](handleError(_0x38125a,null));};exports[_0x734b('0x25')]=function(_0x4b70f2,_0x4c0378){return db['WhatsappQueueReport'][_0x734b('0x46')]({'where':{'id':_0x4b70f2[_0x734b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c0378,null))[_0x734b('0x24')](removeEntity(_0x4c0378,null))[_0x734b('0x47')](handleError(_0x4c0378,null));};exports['describe']=function(_0x167173,_0x3a9749){return db[_0x734b('0x2c')]['describe']()[_0x734b('0x24')](respondWithResult(_0x3a9749,null))[_0x734b('0x47')](handleError(_0x3a9749,null));}; \ No newline at end of file +var _0xbfcc=['destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then'];(function(_0x3ab147,_0x2a30ef){var _0x243fb2=function(_0x465c6c){while(--_0x465c6c){_0x3ab147['push'](_0x3ab147['shift']());}};_0x243fb2(++_0x2a30ef);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xbfcc[_0x30b0d8];return _0x459c09;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x51284a,_0x280b78){return function(_0x75bca0){if(!_0x75bca0){_0x51284a['sendStatus'](0x194);}return _0x75bca0;};}function handleError(_0x28bdcf,_0x3b73a3){_0x3b73a3=_0x3b73a3||0x1f4;return function(_0x4ab48e){logger[_0xcbfc('0x23')](_0x4ab48e[_0xcbfc('0x24')]);if(_0x4ab48e[_0xcbfc('0x25')]){delete _0x4ab48e[_0xcbfc('0x25')];}_0x28bdcf['status'](_0x3b73a3)[_0xcbfc('0x26')](_0x4ab48e);};}exports[_0xcbfc('0x27')]=function(_0x4f632a,_0x1f6a14){var _0x26463f={},_0x7cbdfa={},_0x388d41={'count':0x0,'rows':[]};var _0x2b4286=_[_0xcbfc('0x28')](db[_0xcbfc('0x29')]['rawAttributes'],function(_0x41b68b){return{'name':_0x41b68b[_0xcbfc('0x2a')],'type':_0x41b68b[_0xcbfc('0x2b')][_0xcbfc('0x2c')]};});_0x7cbdfa['model']=_[_0xcbfc('0x28')](_0x2b4286,_0xcbfc('0x25'));_0x7cbdfa[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x4f632a[_0xcbfc('0x2d')]);_0x7cbdfa[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x7cbdfa['model'],_0x7cbdfa[_0xcbfc('0x2d')]);_0x26463f[_0xcbfc('0x31')]=_['intersection'](_0x7cbdfa[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x4f632a[_0xcbfc('0x2d')]['fields']));_0x26463f['attributes']=_0x26463f['attributes'][_0xcbfc('0x34')]?_0x26463f[_0xcbfc('0x31')]:_0x7cbdfa[_0xcbfc('0x32')];if(!_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x35')](_0xcbfc('0x36'))){_0x26463f[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x4f632a['query'][_0xcbfc('0x19')]);_0x26463f[_0xcbfc('0x1b')]=qs['offset'](_0x4f632a[_0xcbfc('0x2d')]['offset']);}_0x26463f[_0xcbfc('0x37')]=qs[_0xcbfc('0x38')](_0x4f632a[_0xcbfc('0x2d')]['sort']);_0x26463f[_0xcbfc('0x39')]=qs['filters'](_['pick'](_0x4f632a[_0xcbfc('0x2d')],_0x7cbdfa[_0xcbfc('0x2f')]),_0x2b4286);if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]){_0x26463f[_0xcbfc('0x39')]=_[_0xcbfc('0x3b')](_0x26463f[_0xcbfc('0x39')],{'$or':_[_0xcbfc('0x28')](_0x2b4286,function(_0x5cf4fa){if(_0x5cf4fa[_0xcbfc('0x2b')]!=='VIRTUAL'){var _0x15a5c4={};_0x15a5c4[_0x5cf4fa[_0xcbfc('0x25')]]={'$like':'%'+_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]+'%'};return _0x15a5c4;}})});}_0x26463f=_['merge']({},_0x26463f,_0x4f632a['options']);var _0x236b66={'where':_0x26463f[_0xcbfc('0x39')]};return db[_0xcbfc('0x29')][_0xcbfc('0x1c')](_0x236b66)[_0xcbfc('0x21')](function(_0x4aa189){_0x388d41[_0xcbfc('0x1c')]=_0x4aa189;if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x26463f['include']=[{'all':!![]}];}return db[_0xcbfc('0x29')][_0xcbfc('0x3d')](_0x26463f);})[_0xcbfc('0x21')](function(_0x4ca55c){_0x388d41[_0xcbfc('0x3e')]=_0x4ca55c;return _0x388d41;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x1f6a14,_0x26463f))[_0xcbfc('0x3f')](handleError(_0x1f6a14,null));};exports[_0xcbfc('0x40')]=function(_0x102f4f,_0x28447a){var _0x1e14bb={'raw':!![],'where':{'id':_0x102f4f[_0xcbfc('0x41')]['id']}},_0x561544={};_0x561544[_0xcbfc('0x32')]=_['keys'](db[_0xcbfc('0x29')][_0xcbfc('0x42')]);_0x561544[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x102f4f[_0xcbfc('0x2d')]);_0x561544[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],_0x561544['query']);_0x1e14bb[_0xcbfc('0x31')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x33')]));_0x1e14bb[_0xcbfc('0x31')]=_0x1e14bb['attributes'][_0xcbfc('0x34')]?_0x1e14bb[_0xcbfc('0x31')]:_0x561544['model'];if(_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x1e14bb[_0xcbfc('0x43')]=[{'all':!![]}];}_0x1e14bb=_['merge']({},_0x1e14bb,_0x102f4f[_0xcbfc('0x44')]);return db[_0xcbfc('0x29')][_0xcbfc('0x45')](_0x1e14bb)[_0xcbfc('0x21')](handleEntityNotFound(_0x28447a,null))[_0xcbfc('0x21')](respondWithResult(_0x28447a,null))[_0xcbfc('0x3f')](handleError(_0x28447a,null));};exports[_0xcbfc('0x46')]=function(_0x55fc0b,_0x5a87b6){return db[_0xcbfc('0x29')][_0xcbfc('0x46')](_0x55fc0b[_0xcbfc('0x47')],{})[_0xcbfc('0x21')](respondWithResult(_0x5a87b6,0xc9))['catch'](handleError(_0x5a87b6,null));};exports['update']=function(_0x2e89bf,_0xe5c5ef){if(_0x2e89bf[_0xcbfc('0x47')]['id']){delete _0x2e89bf['body']['id'];}return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0x2e89bf[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe5c5ef,null))[_0xcbfc('0x21')](saveUpdates(_0x2e89bf[_0xcbfc('0x47')],null))[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,null))[_0xcbfc('0x3f')](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x22')]=function(_0xd9976d,_0x222b58){return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0xd9976d[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0x222b58,null))[_0xcbfc('0x21')](removeEntity(_0x222b58,null))[_0xcbfc('0x3f')](handleError(_0x222b58,null));};exports[_0xcbfc('0x48')]=function(_0x5c2ad9,_0x28ae7f){return db[_0xcbfc('0x29')]['describe']()[_0xcbfc('0x21')](respondWithResult(_0x28ae7f,null))[_0xcbfc('0x3f')](handleError(_0x28ae7f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 0c3a660..e1932b8 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 _0x68ef=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68ef,0x161));var _0xf68e=function(_0x206b96,_0x5b5bb4){_0x206b96=_0x206b96-0x0;var _0x3d0454=_0x68ef[_0x206b96];return _0x3d0454;};'use strict';var _=require(_0xf68e('0x0'));var util=require(_0xf68e('0x1'));var logger=require('../../config/logger')(_0xf68e('0x2'));var moment=require(_0xf68e('0x3'));var BPromise=require(_0xf68e('0x4'));var rp=require(_0xf68e('0x5'));var fs=require('fs');var path=require(_0xf68e('0x6'));var rimraf=require(_0xf68e('0x7'));var config=require('../../config/environment');var attributes=require(_0xf68e('0x8'));module[_0xf68e('0x9')]=function(_0x2999b6,_0x3f5dee){return _0x2999b6[_0xf68e('0xa')](_0xf68e('0xb'),attributes,{'tableName':_0xf68e('0xc'),'paranoid':![],'indexes':[{'name':_0xf68e('0xd'),'fields':[_0xf68e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x848d=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_whatsapp_queue','uniqueid','util','../../config/logger','api'];(function(_0x403214,_0x42c760){var _0x2560f3=function(_0x37ff7b){while(--_0x37ff7b){_0x403214['push'](_0x403214['shift']());}};_0x2560f3(++_0x42c760);}(_0x848d,0x1ad));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd848('0x0'));var logger=require(_0xd848('0x1'))(_0xd848('0x2'));var moment=require(_0xd848('0x3'));var BPromise=require(_0xd848('0x4'));var rp=require(_0xd848('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd848('0x6'));var config=require(_0xd848('0x7'));var attributes=require('./whatsappQueueReport.attributes');module[_0xd848('0x8')]=function(_0x3b085c,_0x377ec9){return _0x3b085c[_0xd848('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0xd848('0xa'),'paranoid':![],'indexes':[{'name':_0xd848('0xb'),'fields':[_0xd848('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 22bc587..f28d214 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 _0x28c8=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','stringify','UpdateWhatsappQueueReport','update','attributes','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result'];(function(_0x4dfef9,_0x28d975){var _0x217a26=function(_0x3a3b3b){while(--_0x3a3b3b){_0x4dfef9['push'](_0x4dfef9['shift']());}};_0x217a26(++_0x28d975);}(_0x28c8,0x1cc));var _0x828c=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x28c8[_0x1b4002];return _0x1716f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x828c('0x0'));var BPromise=require(_0x828c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x828c('0x2'));var db=require(_0x828c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x828c('0x4'))(_0x828c('0x5'));var config=require(_0x828c('0x6'));var jayson=require(_0x828c('0x7'));var client=jayson['client'][_0x828c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8ec404,_0x363c54,_0x28a2a2){return new BPromise(function(_0x498f2e,_0x2e766f){return client[_0x828c('0x9')](_0x8ec404,_0x28a2a2)[_0x828c('0xa')](function(_0x148d2b){logger[_0x828c('0xb')](_0x828c('0xc'),_0x363c54,'request\x20sent');logger[_0x828c('0xd')](_0x828c('0xe'),_0x363c54,_0x828c('0xf'),JSON['stringify'](_0x148d2b));if(_0x148d2b['error']){if(_0x148d2b['error'][_0x828c('0x10')]===0x1f4){logger[_0x828c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x363c54,_0x148d2b[_0x828c('0x11')][_0x828c('0x12')]);return _0x2e766f(_0x148d2b[_0x828c('0x11')][_0x828c('0x12')]);}logger[_0x828c('0x11')](_0x828c('0xc'),_0x363c54,_0x148d2b['error'][_0x828c('0x12')]);return _0x498f2e(_0x148d2b['error'][_0x828c('0x12')]);}else{logger[_0x828c('0xb')](_0x828c('0xc'),_0x363c54,_0x828c('0xf'));_0x498f2e(_0x148d2b[_0x828c('0x13')][_0x828c('0x12')]);}})[_0x828c('0x14')](function(_0x1ec1e3){logger[_0x828c('0x11')](_0x828c('0xc'),_0x363c54,_0x1ec1e3);_0x2e766f(_0x1ec1e3);});});}exports[_0x828c('0x15')]=function(_0x40af7d){var _0x302f06=this;return new Promise(function(_0x467535,_0x409cc4){return db[_0x828c('0x16')][_0x828c('0x17')](_0x40af7d[_0x828c('0x18')],{'raw':_0x40af7d['options']?_0x40af7d[_0x828c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x828c('0xa')](function(_0x464a12){logger['info']('CreateWhatsappQueueReport',_0x40af7d);logger[_0x828c('0xd')](_0x828c('0x15'),_0x40af7d,JSON[_0x828c('0x1a')](_0x464a12));_0x467535(_0x464a12);})[_0x828c('0x14')](function(_0x33bd39){logger[_0x828c('0x11')](_0x828c('0x15'),_0x33bd39[_0x828c('0x12')],_0x40af7d);_0x409cc4(_0x302f06['error'](0x1f4,_0x33bd39['message']));});});};exports[_0x828c('0x1b')]=function(_0x1e0ba4){var _0x12fcee=this;return new Promise(function(_0x1b1c85,_0x44754e){return db[_0x828c('0x16')][_0x828c('0x1c')](_0x1e0ba4[_0x828c('0x18')],{'raw':_0x1e0ba4[_0x828c('0x19')]?_0x1e0ba4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0ba4[_0x828c('0x19')]?_0x1e0ba4[_0x828c('0x19')]['where']||null:null,'attributes':_0x1e0ba4[_0x828c('0x19')]?_0x1e0ba4['options'][_0x828c('0x1d')]||null:null,'limit':_0x1e0ba4[_0x828c('0x19')]?_0x1e0ba4['options']['limit']||null:null})[_0x828c('0xa')](function(_0x23c208){logger[_0x828c('0xb')](_0x828c('0x1b'),_0x1e0ba4);logger['debug'](_0x828c('0x1b'),_0x1e0ba4,JSON[_0x828c('0x1a')](_0x23c208));_0x1b1c85(_0x23c208);})['catch'](function(_0x431037){logger[_0x828c('0x11')](_0x828c('0x1b'),_0x431037['message'],_0x1e0ba4);_0x44754e(_0x12fcee['error'](0x1f4,_0x431037[_0x828c('0x12')]));});});}; \ No newline at end of file +var _0x5e5a=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','limit','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug'];(function(_0x4bb623,_0x5e328f){var _0x12e423=function(_0x5e2d41){while(--_0x5e2d41){_0x4bb623['push'](_0x4bb623['shift']());}};_0x12e423(++_0x5e328f);}(_0x5e5a,0x188));var _0xa5e5=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5e5a[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0xa5e5('0x0'));var moment=require(_0xa5e5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5e5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5e5('0x3'))['db'];var utils=require(_0xa5e5('0x4'));var logger=require('../../config/logger')(_0xa5e5('0x5'));var config=require(_0xa5e5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa5e5('0x7')][_0xa5e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d5291,_0x4f1884,_0x296cfe){return new BPromise(function(_0x2a42f5,_0x51e125){return client[_0xa5e5('0x9')](_0x2d5291,_0x296cfe)[_0xa5e5('0xa')](function(_0x3236f2){logger[_0xa5e5('0xb')](_0xa5e5('0xc'),_0x4f1884,'request\x20sent');logger[_0xa5e5('0xd')](_0xa5e5('0xe'),_0x4f1884,_0xa5e5('0xf'),JSON[_0xa5e5('0x10')](_0x3236f2));if(_0x3236f2[_0xa5e5('0x11')]){if(_0x3236f2[_0xa5e5('0x11')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x4f1884,_0x3236f2['error'][_0xa5e5('0x12')]);return _0x51e125(_0x3236f2[_0xa5e5('0x11')]['message']);}logger[_0xa5e5('0x11')](_0xa5e5('0xc'),_0x4f1884,_0x3236f2['error'][_0xa5e5('0x12')]);return _0x2a42f5(_0x3236f2[_0xa5e5('0x11')]['message']);}else{logger[_0xa5e5('0xb')](_0xa5e5('0xc'),_0x4f1884,_0xa5e5('0xf'));_0x2a42f5(_0x3236f2['result'][_0xa5e5('0x12')]);}})[_0xa5e5('0x13')](function(_0x4d746d){logger[_0xa5e5('0x11')](_0xa5e5('0xc'),_0x4f1884,_0x4d746d);_0x51e125(_0x4d746d);});});}exports[_0xa5e5('0x14')]=function(_0x33d06d){var _0x45c7bb=this;return new Promise(function(_0xc7a745,_0x4866f5){return db[_0xa5e5('0x15')][_0xa5e5('0x16')](_0x33d06d[_0xa5e5('0x17')],{'raw':_0x33d06d[_0xa5e5('0x18')]?_0x33d06d['options'][_0xa5e5('0x19')]===undefined?!![]:![]:!![]})[_0xa5e5('0xa')](function(_0x172bdc){logger[_0xa5e5('0xb')]('CreateWhatsappQueueReport',_0x33d06d);logger[_0xa5e5('0xd')](_0xa5e5('0x14'),_0x33d06d,JSON[_0xa5e5('0x10')](_0x172bdc));_0xc7a745(_0x172bdc);})['catch'](function(_0x221cdd){logger['error'](_0xa5e5('0x14'),_0x221cdd['message'],_0x33d06d);_0x4866f5(_0x45c7bb[_0xa5e5('0x11')](0x1f4,_0x221cdd['message']));});});};exports[_0xa5e5('0x1a')]=function(_0x188342){var _0x130b26=this;return new Promise(function(_0x422bcf,_0x3339ab){return db[_0xa5e5('0x15')][_0xa5e5('0x1b')](_0x188342['body'],{'raw':_0x188342[_0xa5e5('0x18')]?_0x188342[_0xa5e5('0x18')][_0xa5e5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x188342[_0xa5e5('0x18')]?_0x188342[_0xa5e5('0x18')]['where']||null:null,'attributes':_0x188342['options']?_0x188342[_0xa5e5('0x18')]['attributes']||null:null,'limit':_0x188342[_0xa5e5('0x18')]?_0x188342[_0xa5e5('0x18')][_0xa5e5('0x1c')]||null:null})['then'](function(_0x57ffd8){logger['info'](_0xa5e5('0x1a'),_0x188342);logger[_0xa5e5('0xd')](_0xa5e5('0x1a'),_0x188342,JSON[_0xa5e5('0x10')](_0x57ffd8));_0x422bcf(_0x57ffd8);})[_0xa5e5('0x13')](function(_0x1e9fd7){logger[_0xa5e5('0x11')](_0xa5e5('0x1a'),_0x1e9fd7['message'],_0x188342);_0x3339ab(_0x130b26[_0xa5e5('0x11')](0x1f4,_0x1e9fd7[_0xa5e5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d2d6f92..fc7e89c 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 _0x1928=['index','/describe','describe','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xd5709b,_0x101823){var _0x3dc484=function(_0x28a409){while(--_0x28a409){_0xd5709b['push'](_0xd5709b['shift']());}};_0x3dc484(++_0x101823);}(_0x1928,0x197));var _0x8192=function(_0x106e2d,_0x2dbcca){_0x106e2d=_0x106e2d-0x0;var _0x2b6075=_0x1928[_0x106e2d];return _0x2b6075;};'use strict';var multer=require('multer');var util=require(_0x8192('0x0'));var path=require(_0x8192('0x1'));var timeout=require(_0x8192('0x2'));var express=require(_0x8192('0x3'));var router=express[_0x8192('0x4')]();var fs_extra=require(_0x8192('0x5'));var auth=require(_0x8192('0x6'));var interaction=require(_0x8192('0x7'));var config=require(_0x8192('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x8192('0x9')]('/',auth[_0x8192('0xa')](),controller[_0x8192('0xb')]);router[_0x8192('0x9')](_0x8192('0xc'),auth['isAuthenticated'](),controller[_0x8192('0xd')]);router[_0x8192('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8192('0xe')]);router[_0x8192('0xf')]('/',auth['isAuthenticated'](),controller[_0x8192('0x10')]);router[_0x8192('0x11')](_0x8192('0x12'),auth[_0x8192('0xa')](),controller[_0x8192('0x13')]);router[_0x8192('0x14')](_0x8192('0x12'),auth[_0x8192('0xa')](),controller['destroy']);module[_0x8192('0x15')]=router; \ No newline at end of file +var _0xa610=['fs-extra','../../components/auth/service','./whatsappTransferReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x111c47,_0x2c867b){var _0x30790f=function(_0x1e5ca3){while(--_0x1e5ca3){_0x111c47['push'](_0x111c47['shift']());}};_0x30790f(++_0x2c867b);}(_0xa610,0x18a));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0a61('0x0'));var util=require(_0x0a61('0x1'));var path=require(_0x0a61('0x2'));var timeout=require(_0x0a61('0x3'));var express=require(_0x0a61('0x4'));var router=express[_0x0a61('0x5')]();var fs_extra=require(_0x0a61('0x6'));var auth=require(_0x0a61('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a61('0x8'));router['get']('/',auth[_0x0a61('0x9')](),controller[_0x0a61('0xa')]);router[_0x0a61('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x0a61('0xc')]);router[_0x0a61('0xb')]('/:id',auth[_0x0a61('0x9')](),controller[_0x0a61('0xd')]);router[_0x0a61('0xe')]('/',auth[_0x0a61('0x9')](),controller[_0x0a61('0xf')]);router[_0x0a61('0x10')](_0x0a61('0x11'),auth[_0x0a61('0x9')](),controller['update']);router['delete'](_0x0a61('0x11'),auth[_0x0a61('0x9')](),controller[_0x0a61('0x12')]);module[_0x0a61('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 424c649..6887717 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 _0x6f59=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x239eb4,_0x549d0a){var _0x35f067=function(_0x483dd8){while(--_0x483dd8){_0x239eb4['push'](_0x239eb4['shift']());}};_0x35f067(++_0x549d0a);}(_0x6f59,0x1be));var _0x96f5=function(_0x51907,_0x1054d1){_0x51907=_0x51907-0x0;var _0x3329a5=_0x6f59[_0x51907];return _0x3329a5;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'uniqueid':{'type':Sequelize[_0x96f5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x96f5('0x3')](_0x96f5('0x4'),_0x96f5('0x5'),_0x96f5('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x96f5('0x7')]}}; \ No newline at end of file +var _0xb12d=['STRING','account','queue','DATE','sequelize','exports'];(function(_0x4929d0,_0x41f231){var _0x9163b4=function(_0x352ca6){while(--_0x352ca6){_0x4929d0['push'](_0x4929d0['shift']());}};_0x9163b4(++_0x41f231);}(_0xb12d,0x124));var _0xdb12=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xb12d[_0x38987f];return _0x4cb697;};'use strict';var Sequelize=require(_0xdb12('0x0'));module[_0xdb12('0x1')]={'uniqueid':{'type':Sequelize[_0xdb12('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xdb12('0x3'),'agent',_0xdb12('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xdb12('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ba8d7b1..d88fe72 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 _0x80e2=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','WhatsappTransferReport','filters','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../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','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x5002b3,_0x130699){var _0x538a84=function(_0x8f710f){while(--_0x8f710f){_0x5002b3['push'](_0x5002b3['shift']());}};_0x538a84(++_0x130699);}(_0x80e2,0xfd));var _0x280e=function(_0x2fdf82,_0x322e7c){_0x2fdf82=_0x2fdf82-0x0;var _0x2382f5=_0x80e2[_0x2fdf82];return _0x2382f5;};'use strict';var emlformat=require(_0x280e('0x0'));var rimraf=require(_0x280e('0x1'));var zipdir=require(_0x280e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x280e('0x3'));var moment=require(_0x280e('0x4'));var BPromise=require(_0x280e('0x5'));var Mustache=require(_0x280e('0x6'));var util=require(_0x280e('0x7'));var path=require('path');var sox=require(_0x280e('0x8'));var csv=require(_0x280e('0x9'));var ejs=require(_0x280e('0xa'));var fs=require('fs');var fs_extra=require(_0x280e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x280e('0xc'));var jsforce=require(_0x280e('0xd'));var deskjs=require(_0x280e('0xe'));var toCsv=require(_0x280e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x280e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x280e('0x10'));var hardwareService=require(_0x280e('0x11'));var logger=require(_0x280e('0x12'))(_0x280e('0x13'));var utils=require(_0x280e('0x14'));var config=require(_0x280e('0x15'));var licenseUtil=require(_0x280e('0x16'));var db=require(_0x280e('0x17'))['db'];function respondWithStatusCode(_0xca4511,_0x255e16){_0x255e16=_0x255e16||0xcc;return function(_0x58c400){if(_0x58c400){return _0xca4511[_0x280e('0x18')](_0x255e16);}return _0xca4511[_0x280e('0x19')](_0x255e16)[_0x280e('0x1a')]();};}function respondWithResult(_0x3df552,_0x382e5b){_0x382e5b=_0x382e5b||0xc8;return function(_0xb80af1){if(_0xb80af1){return _0x3df552[_0x280e('0x19')](_0x382e5b)[_0x280e('0x1b')](_0xb80af1);}};}function respondWithFilteredResult(_0x37ea54,_0x58d983){return function(_0x5ecc94){if(_0x5ecc94){var _0x5e5f54=typeof _0x58d983['offset']===_0x280e('0x1c')&&typeof _0x58d983['limit']===_0x280e('0x1c');var _0x589a18=_0x5ecc94[_0x280e('0x1d')];var _0x507718=_0x5e5f54?0x0:_0x58d983['offset'];var _0x58c036=_0x5e5f54?_0x5ecc94[_0x280e('0x1d')]:_0x58d983['offset']+_0x58d983[_0x280e('0x1e')];var _0x2f759b;if(_0x58c036>=_0x589a18){_0x58c036=_0x589a18;_0x2f759b=0xc8;}else{_0x2f759b=0xce;}_0x37ea54['status'](_0x2f759b);return _0x37ea54['set'](_0x280e('0x1f'),_0x507718+'-'+_0x58c036+'/'+_0x589a18)[_0x280e('0x1b')](_0x5ecc94);}return null;};}function patchUpdates(_0x786b60){return function(_0x20dd3d){try{jsonpatch[_0x280e('0x20')](_0x20dd3d,_0x786b60,!![]);}catch(_0x4399d6){return BPromise[_0x280e('0x21')](_0x4399d6);}return _0x20dd3d[_0x280e('0x22')]();};}function saveUpdates(_0x4c7695,_0x5bd5fb){return function(_0x294c08){if(_0x294c08){return _0x294c08[_0x280e('0x23')](_0x4c7695)[_0x280e('0x24')](function(_0x2eefa4){return _0x2eefa4;});}return null;};}function removeEntity(_0x1f637b,_0x2507ca){return function(_0x3d32d2){if(_0x3d32d2){return _0x3d32d2[_0x280e('0x25')]()['then'](function(){_0x1f637b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a5e5,_0xd42743){return function(_0x42b103){if(!_0x42b103){_0x38a5e5[_0x280e('0x18')](0x194);}return _0x42b103;};}function handleError(_0x43eb2e,_0x13c07a){_0x13c07a=_0x13c07a||0x1f4;return function(_0x4ad625){logger[_0x280e('0x26')](_0x4ad625[_0x280e('0x27')]);if(_0x4ad625[_0x280e('0x28')]){delete _0x4ad625['name'];}_0x43eb2e[_0x280e('0x19')](_0x13c07a)[_0x280e('0x29')](_0x4ad625);};}exports[_0x280e('0x2a')]=function(_0x3ee0da,_0x6a207c){var _0xd285b2={},_0x109475={},_0x166b3e={'count':0x0,'rows':[]};var _0x38c815=_[_0x280e('0x2b')](db['WhatsappTransferReport'][_0x280e('0x2c')],function(_0x542f1b){return{'name':_0x542f1b[_0x280e('0x2d')],'type':_0x542f1b[_0x280e('0x2e')][_0x280e('0x2f')]};});_0x109475[_0x280e('0x30')]=_[_0x280e('0x2b')](_0x38c815,_0x280e('0x28'));_0x109475[_0x280e('0x31')]=_[_0x280e('0x32')](_0x3ee0da['query']);_0x109475['filters']=_['intersection'](_0x109475[_0x280e('0x30')],_0x109475[_0x280e('0x31')]);_0xd285b2[_0x280e('0x33')]=_[_0x280e('0x34')](_0x109475[_0x280e('0x30')],qs[_0x280e('0x35')](_0x3ee0da[_0x280e('0x31')]['fields']));_0xd285b2[_0x280e('0x33')]=_0xd285b2[_0x280e('0x33')][_0x280e('0x36')]?_0xd285b2[_0x280e('0x33')]:_0x109475[_0x280e('0x30')];if(!_0x3ee0da['query'][_0x280e('0x37')](_0x280e('0x38'))){_0xd285b2['limit']=qs['limit'](_0x3ee0da[_0x280e('0x31')][_0x280e('0x1e')]);_0xd285b2['offset']=qs[_0x280e('0x39')](_0x3ee0da['query']['offset']);}_0xd285b2[_0x280e('0x3a')]=qs[_0x280e('0x3b')](_0x3ee0da['query']['sort']);_0xd285b2[_0x280e('0x3c')]=qs['filters'](_['pick'](_0x3ee0da[_0x280e('0x31')],_0x109475['filters']),_0x38c815);if(_0x3ee0da[_0x280e('0x31')][_0x280e('0x3d')]){_0xd285b2['where']=_[_0x280e('0x3e')](_0xd285b2[_0x280e('0x3c')],{'$or':_[_0x280e('0x2b')](_0x38c815,function(_0x40a1fe){if(_0x40a1fe[_0x280e('0x2e')]!==_0x280e('0x3f')){var _0xec2618={};_0xec2618[_0x40a1fe[_0x280e('0x28')]]={'$like':'%'+_0x3ee0da[_0x280e('0x31')]['filter']+'%'};return _0xec2618;}})});}_0xd285b2=_[_0x280e('0x3e')]({},_0xd285b2,_0x3ee0da[_0x280e('0x40')]);var _0x375ee1={'where':_0xd285b2[_0x280e('0x3c')]};return db['WhatsappTransferReport'][_0x280e('0x1d')](_0x375ee1)[_0x280e('0x24')](function(_0x2d0ec4){_0x166b3e[_0x280e('0x1d')]=_0x2d0ec4;if(_0x3ee0da[_0x280e('0x31')][_0x280e('0x41')]){_0xd285b2[_0x280e('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0xd285b2);})[_0x280e('0x24')](function(_0x33a798){_0x166b3e['rows']=_0x33a798;return _0x166b3e;})['then'](respondWithFilteredResult(_0x6a207c,_0xd285b2))[_0x280e('0x43')](handleError(_0x6a207c,null));};exports[_0x280e('0x44')]=function(_0x4bb853,_0x1dd8a3){var _0x496d3a={'raw':!![],'where':{'id':_0x4bb853['params']['id']}},_0x5b07d4={};_0x5b07d4[_0x280e('0x30')]=_[_0x280e('0x32')](db[_0x280e('0x45')][_0x280e('0x2c')]);_0x5b07d4['query']=_['keys'](_0x4bb853[_0x280e('0x31')]);_0x5b07d4[_0x280e('0x46')]=_['intersection'](_0x5b07d4['model'],_0x5b07d4['query']);_0x496d3a[_0x280e('0x33')]=_[_0x280e('0x34')](_0x5b07d4[_0x280e('0x30')],qs[_0x280e('0x35')](_0x4bb853['query'][_0x280e('0x35')]));_0x496d3a[_0x280e('0x33')]=_0x496d3a['attributes'][_0x280e('0x36')]?_0x496d3a[_0x280e('0x33')]:_0x5b07d4[_0x280e('0x30')];if(_0x4bb853[_0x280e('0x31')][_0x280e('0x41')]){_0x496d3a[_0x280e('0x42')]=[{'all':!![]}];}_0x496d3a=_[_0x280e('0x3e')]({},_0x496d3a,_0x4bb853[_0x280e('0x40')]);return db[_0x280e('0x45')][_0x280e('0x47')](_0x496d3a)[_0x280e('0x24')](handleEntityNotFound(_0x1dd8a3,null))['then'](respondWithResult(_0x1dd8a3,null))['catch'](handleError(_0x1dd8a3,null));};exports[_0x280e('0x48')]=function(_0x40cf83,_0x13dd8e){return db['WhatsappTransferReport']['create'](_0x40cf83[_0x280e('0x49')],{})[_0x280e('0x24')](respondWithResult(_0x13dd8e,0xc9))[_0x280e('0x43')](handleError(_0x13dd8e,null));};exports[_0x280e('0x23')]=function(_0x3e7e18,_0x2debdd){if(_0x3e7e18['body']['id']){delete _0x3e7e18[_0x280e('0x49')]['id'];}return db[_0x280e('0x45')][_0x280e('0x47')]({'where':{'id':_0x3e7e18['params']['id']}})[_0x280e('0x24')](handleEntityNotFound(_0x2debdd,null))[_0x280e('0x24')](saveUpdates(_0x3e7e18[_0x280e('0x49')],null))[_0x280e('0x24')](respondWithResult(_0x2debdd,null))[_0x280e('0x43')](handleError(_0x2debdd,null));};exports[_0x280e('0x25')]=function(_0x388d73,_0x1d6c82){return db['WhatsappTransferReport'][_0x280e('0x47')]({'where':{'id':_0x388d73['params']['id']}})['then'](handleEntityNotFound(_0x1d6c82,null))['then'](removeEntity(_0x1d6c82,null))['catch'](handleError(_0x1d6c82,null));};exports['describe']=function(_0x1b512b,_0x1f19c8){return db['WhatsappTransferReport'][_0x280e('0x4a')]()[_0x280e('0x24')](respondWithResult(_0x1f19c8,null))[_0x280e('0x43')](handleError(_0x1f19c8,null));}; \ No newline at end of file +var _0x0b63=['query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','options','WhatsappTransferReport','includeAll','include','rows','catch','params','fields','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','type','key','model','map'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x0b63,0xe7));var _0x30b6=function(_0x14e3b3,_0x5c82ee){_0x14e3b3=_0x14e3b3-0x0;var _0x2df313=_0x0b63[_0x14e3b3];return _0x2df313;};'use strict';var emlformat=require(_0x30b6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30b6('0x1'));var rp=require(_0x30b6('0x2'));var moment=require(_0x30b6('0x3'));var BPromise=require(_0x30b6('0x4'));var Mustache=require('mustache');var util=require(_0x30b6('0x5'));var path=require(_0x30b6('0x6'));var sox=require(_0x30b6('0x7'));var csv=require(_0x30b6('0x8'));var ejs=require(_0x30b6('0x9'));var fs=require('fs');var fs_extra=require(_0x30b6('0xa'));var _=require('lodash');var squel=require(_0x30b6('0xb'));var crypto=require('crypto');var jsforce=require(_0x30b6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x30b6('0x8'));var querystring=require(_0x30b6('0xd'));var Papa=require('papaparse');var Redis=require(_0x30b6('0xe'));var authService=require(_0x30b6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x30b6('0x10'));var hardwareService=require(_0x30b6('0x11'));var logger=require(_0x30b6('0x12'))(_0x30b6('0x13'));var utils=require(_0x30b6('0x14'));var config=require(_0x30b6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x30b6('0x16'))['db'];function respondWithStatusCode(_0x208a24,_0x21934b){_0x21934b=_0x21934b||0xcc;return function(_0x3b7d76){if(_0x3b7d76){return _0x208a24['sendStatus'](_0x21934b);}return _0x208a24[_0x30b6('0x17')](_0x21934b)['end']();};}function respondWithResult(_0x5f0ad7,_0x32ffcf){_0x32ffcf=_0x32ffcf||0xc8;return function(_0xaa7a89){if(_0xaa7a89){return _0x5f0ad7[_0x30b6('0x17')](_0x32ffcf)['json'](_0xaa7a89);}};}function respondWithFilteredResult(_0x516e57,_0x18dc6e){return function(_0xa2333b){if(_0xa2333b){var _0x5c0d4b=typeof _0x18dc6e[_0x30b6('0x18')]==='undefined'&&typeof _0x18dc6e[_0x30b6('0x19')]===_0x30b6('0x1a');var _0x1d549a=_0xa2333b[_0x30b6('0x1b')];var _0x3a4b41=_0x5c0d4b?0x0:_0x18dc6e['offset'];var _0x2b01d6=_0x5c0d4b?_0xa2333b[_0x30b6('0x1b')]:_0x18dc6e[_0x30b6('0x18')]+_0x18dc6e[_0x30b6('0x19')];var _0xae7d94;if(_0x2b01d6>=_0x1d549a){_0x2b01d6=_0x1d549a;_0xae7d94=0xc8;}else{_0xae7d94=0xce;}_0x516e57[_0x30b6('0x17')](_0xae7d94);return _0x516e57[_0x30b6('0x1c')]('Content-Range',_0x3a4b41+'-'+_0x2b01d6+'/'+_0x1d549a)[_0x30b6('0x1d')](_0xa2333b);}return null;};}function patchUpdates(_0x388e18){return function(_0x4968b7){try{jsonpatch[_0x30b6('0x1e')](_0x4968b7,_0x388e18,!![]);}catch(_0x4e4107){return BPromise[_0x30b6('0x1f')](_0x4e4107);}return _0x4968b7[_0x30b6('0x20')]();};}function saveUpdates(_0x4e9a9d,_0x36094e){return function(_0x80e2ea){if(_0x80e2ea){return _0x80e2ea[_0x30b6('0x21')](_0x4e9a9d)[_0x30b6('0x22')](function(_0x54586b){return _0x54586b;});}return null;};}function removeEntity(_0x16c541,_0x4cb7db){return function(_0x45fe86){if(_0x45fe86){return _0x45fe86[_0x30b6('0x23')]()[_0x30b6('0x22')](function(){_0x16c541[_0x30b6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45fd2d,_0xe2da81){return function(_0x5a7bdd){if(!_0x5a7bdd){_0x45fd2d[_0x30b6('0x24')](0x194);}return _0x5a7bdd;};}function handleError(_0x5881a1,_0x2af091){_0x2af091=_0x2af091||0x1f4;return function(_0xecd258){logger[_0x30b6('0x25')](_0xecd258['stack']);if(_0xecd258[_0x30b6('0x26')]){delete _0xecd258[_0x30b6('0x26')];}_0x5881a1[_0x30b6('0x17')](_0x2af091)[_0x30b6('0x27')](_0xecd258);};}exports[_0x30b6('0x28')]=function(_0x2bf84d,_0x329b17){var _0x21939c={},_0x38f855={},_0x50adb4={'count':0x0,'rows':[]};var _0x381abf=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x13381e){return{'name':_0x13381e['fieldName'],'type':_0x13381e[_0x30b6('0x29')][_0x30b6('0x2a')]};});_0x38f855[_0x30b6('0x2b')]=_[_0x30b6('0x2c')](_0x381abf,_0x30b6('0x26'));_0x38f855[_0x30b6('0x2d')]=_[_0x30b6('0x2e')](_0x2bf84d[_0x30b6('0x2d')]);_0x38f855[_0x30b6('0x2f')]=_[_0x30b6('0x30')](_0x38f855[_0x30b6('0x2b')],_0x38f855['query']);_0x21939c[_0x30b6('0x31')]=_[_0x30b6('0x30')](_0x38f855['model'],qs['fields'](_0x2bf84d['query']['fields']));_0x21939c[_0x30b6('0x31')]=_0x21939c[_0x30b6('0x31')][_0x30b6('0x32')]?_0x21939c['attributes']:_0x38f855[_0x30b6('0x2b')];if(!_0x2bf84d['query']['hasOwnProperty'](_0x30b6('0x33'))){_0x21939c[_0x30b6('0x19')]=qs['limit'](_0x2bf84d['query'][_0x30b6('0x19')]);_0x21939c['offset']=qs['offset'](_0x2bf84d['query'][_0x30b6('0x18')]);}_0x21939c['order']=qs['sort'](_0x2bf84d[_0x30b6('0x2d')][_0x30b6('0x34')]);_0x21939c[_0x30b6('0x35')]=qs[_0x30b6('0x2f')](_[_0x30b6('0x36')](_0x2bf84d['query'],_0x38f855[_0x30b6('0x2f')]),_0x381abf);if(_0x2bf84d[_0x30b6('0x2d')][_0x30b6('0x37')]){_0x21939c[_0x30b6('0x35')]=_[_0x30b6('0x38')](_0x21939c['where'],{'$or':_[_0x30b6('0x2c')](_0x381abf,function(_0x510b39){if(_0x510b39[_0x30b6('0x29')]!=='VIRTUAL'){var _0x355aad={};_0x355aad[_0x510b39[_0x30b6('0x26')]]={'$like':'%'+_0x2bf84d[_0x30b6('0x2d')]['filter']+'%'};return _0x355aad;}})});}_0x21939c=_[_0x30b6('0x38')]({},_0x21939c,_0x2bf84d[_0x30b6('0x39')]);var _0x4281cf={'where':_0x21939c[_0x30b6('0x35')]};return db[_0x30b6('0x3a')][_0x30b6('0x1b')](_0x4281cf)[_0x30b6('0x22')](function(_0x392eff){_0x50adb4[_0x30b6('0x1b')]=_0x392eff;if(_0x2bf84d[_0x30b6('0x2d')][_0x30b6('0x3b')]){_0x21939c[_0x30b6('0x3c')]=[{'all':!![]}];}return db[_0x30b6('0x3a')]['findAll'](_0x21939c);})[_0x30b6('0x22')](function(_0x22fa8d){_0x50adb4[_0x30b6('0x3d')]=_0x22fa8d;return _0x50adb4;})['then'](respondWithFilteredResult(_0x329b17,_0x21939c))[_0x30b6('0x3e')](handleError(_0x329b17,null));};exports['show']=function(_0x279c85,_0x88757f){var _0x37224e={'raw':!![],'where':{'id':_0x279c85[_0x30b6('0x3f')]['id']}},_0x4b641f={};_0x4b641f[_0x30b6('0x2b')]=_[_0x30b6('0x2e')](db['WhatsappTransferReport']['rawAttributes']);_0x4b641f[_0x30b6('0x2d')]=_[_0x30b6('0x2e')](_0x279c85[_0x30b6('0x2d')]);_0x4b641f[_0x30b6('0x2f')]=_['intersection'](_0x4b641f[_0x30b6('0x2b')],_0x4b641f['query']);_0x37224e['attributes']=_['intersection'](_0x4b641f[_0x30b6('0x2b')],qs[_0x30b6('0x40')](_0x279c85[_0x30b6('0x2d')]['fields']));_0x37224e[_0x30b6('0x31')]=_0x37224e[_0x30b6('0x31')][_0x30b6('0x32')]?_0x37224e[_0x30b6('0x31')]:_0x4b641f['model'];if(_0x279c85[_0x30b6('0x2d')][_0x30b6('0x3b')]){_0x37224e[_0x30b6('0x3c')]=[{'all':!![]}];}_0x37224e=_[_0x30b6('0x38')]({},_0x37224e,_0x279c85['options']);return db[_0x30b6('0x3a')][_0x30b6('0x41')](_0x37224e)[_0x30b6('0x22')](handleEntityNotFound(_0x88757f,null))[_0x30b6('0x22')](respondWithResult(_0x88757f,null))[_0x30b6('0x3e')](handleError(_0x88757f,null));};exports['create']=function(_0x43574c,_0x4a9b82){return db['WhatsappTransferReport'][_0x30b6('0x42')](_0x43574c[_0x30b6('0x43')],{})['then'](respondWithResult(_0x4a9b82,0xc9))[_0x30b6('0x3e')](handleError(_0x4a9b82,null));};exports[_0x30b6('0x21')]=function(_0x5c25c4,_0x46c9a1){if(_0x5c25c4[_0x30b6('0x43')]['id']){delete _0x5c25c4[_0x30b6('0x43')]['id'];}return db[_0x30b6('0x3a')][_0x30b6('0x41')]({'where':{'id':_0x5c25c4['params']['id']}})[_0x30b6('0x22')](handleEntityNotFound(_0x46c9a1,null))['then'](saveUpdates(_0x5c25c4[_0x30b6('0x43')],null))[_0x30b6('0x22')](respondWithResult(_0x46c9a1,null))[_0x30b6('0x3e')](handleError(_0x46c9a1,null));};exports['destroy']=function(_0x4eb04b,_0x44aca2){return db[_0x30b6('0x3a')][_0x30b6('0x41')]({'where':{'id':_0x4eb04b['params']['id']}})[_0x30b6('0x22')](handleEntityNotFound(_0x44aca2,null))['then'](removeEntity(_0x44aca2,null))[_0x30b6('0x3e')](handleError(_0x44aca2,null));};exports[_0x30b6('0x44')]=function(_0x17ae99,_0x2e2997){return db[_0x30b6('0x3a')][_0x30b6('0x44')]()[_0x30b6('0x22')](respondWithResult(_0x2e2997,null))[_0x30b6('0x3e')](handleError(_0x2e2997,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 7b1b927..97d6431 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 _0xf514=['exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0xf514,0x1b6));var _0x4f51=function(_0x2ff21b,_0x383b47){_0x2ff21b=_0x2ff21b-0x0;var _0x5d7702=_0xf514[_0x2ff21b];return _0x5d7702;};'use strict';var _=require('lodash');var util=require(_0x4f51('0x0'));var logger=require(_0x4f51('0x1'))(_0x4f51('0x2'));var moment=require(_0x4f51('0x3'));var BPromise=require(_0x4f51('0x4'));var rp=require(_0x4f51('0x5'));var fs=require('fs');var path=require(_0x4f51('0x6'));var rimraf=require(_0x4f51('0x7'));var config=require(_0x4f51('0x8'));var attributes=require(_0x4f51('0x9'));module[_0x4f51('0xa')]=function(_0xe17009,_0x36cc91){return _0xe17009['define'](_0x4f51('0xb'),attributes,{'tableName':_0x4f51('0xc'),'paranoid':![],'indexes':[{'name':_0x4f51('0xd'),'fields':[_0x4f51('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c37=['./whatsappTransferReport.attributes','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x1c37,0x100));var _0x71c3=function(_0x38f38d,_0x1397d0){_0x38f38d=_0x38f38d-0x0;var _0x2c2322=_0x1c37[_0x38f38d];return _0x2c2322;};'use strict';var _=require(_0x71c3('0x0'));var util=require(_0x71c3('0x1'));var logger=require(_0x71c3('0x2'))(_0x71c3('0x3'));var moment=require('moment');var BPromise=require(_0x71c3('0x4'));var rp=require(_0x71c3('0x5'));var fs=require('fs');var path=require(_0x71c3('0x6'));var rimraf=require('rimraf');var config=require(_0x71c3('0x7'));var attributes=require(_0x71c3('0x8'));module['exports']=function(_0x2887d2,_0x1ec3bd){return _0x2887d2[_0x71c3('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x71c3('0xa'),'paranoid':![],'indexes':[{'name':_0x71c3('0xb'),'fields':[_0x71c3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 59cc532..0e78be5 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 _0x44b5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x148da0,_0x2adee8){var _0x5236b=function(_0x353cfc){while(--_0x353cfc){_0x148da0['push'](_0x148da0['shift']());}};_0x5236b(++_0x2adee8);}(_0x44b5,0xc8));var _0x544b=function(_0x573a21,_0x1f8b1f){_0x573a21=_0x573a21-0x0;var _0x5d4f3d=_0x44b5[_0x573a21];return _0x5d4f3d;};'use strict';var _=require(_0x544b('0x0'));var util=require('util');var moment=require(_0x544b('0x1'));var BPromise=require(_0x544b('0x2'));var rs=require(_0x544b('0x3'));var fs=require('fs');var Redis=require(_0x544b('0x4'));var db=require(_0x544b('0x5'))['db'];var utils=require(_0x544b('0x6'));var logger=require(_0x544b('0x7'))(_0x544b('0x8'));var config=require(_0x544b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x544b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe75ca1,_0x225529,_0x1bd1fa){return new BPromise(function(_0x348f7f,_0x38d08c){return client[_0x544b('0xb')](_0xe75ca1,_0x1bd1fa)['then'](function(_0x161964){logger[_0x544b('0xc')](_0x544b('0xd'),_0x225529,_0x544b('0xe'));logger[_0x544b('0xf')](_0x544b('0x10'),_0x225529,_0x544b('0xe'),JSON[_0x544b('0x11')](_0x161964));if(_0x161964[_0x544b('0x12')]){if(_0x161964[_0x544b('0x12')]['code']===0x1f4){logger['error'](_0x544b('0xd'),_0x225529,_0x161964[_0x544b('0x12')][_0x544b('0x13')]);return _0x38d08c(_0x161964[_0x544b('0x12')]['message']);}logger['error'](_0x544b('0xd'),_0x225529,_0x161964[_0x544b('0x12')][_0x544b('0x13')]);return _0x348f7f(_0x161964['error'][_0x544b('0x13')]);}else{logger['info'](_0x544b('0xd'),_0x225529,_0x544b('0xe'));_0x348f7f(_0x161964[_0x544b('0x14')][_0x544b('0x13')]);}})[_0x544b('0x15')](function(_0x48e1db){logger[_0x544b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x225529,_0x48e1db);_0x38d08c(_0x48e1db);});});} \ No newline at end of file +var _0xc455=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b697a,_0x230a0f){var _0x1d6f85=function(_0x570d2e){while(--_0x570d2e){_0x5b697a['push'](_0x5b697a['shift']());}};_0x1d6f85(++_0x230a0f);}(_0xc455,0xcb));var _0x5c45=function(_0xa75c9b,_0x4cc5e0){_0xa75c9b=_0xa75c9b-0x0;var _0x280ee4=_0xc455[_0xa75c9b];return _0x280ee4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5c45('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c45('0x1'));var db=require(_0x5c45('0x2'))['db'];var utils=require(_0x5c45('0x3'));var logger=require(_0x5c45('0x4'))(_0x5c45('0x5'));var config=require(_0x5c45('0x6'));var jayson=require(_0x5c45('0x7'));var client=jayson[_0x5c45('0x8')][_0x5c45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2588be,_0x5e8003,_0x7bfe9c){return new BPromise(function(_0x4d58b4,_0x26a8af){return client[_0x5c45('0xa')](_0x2588be,_0x7bfe9c)[_0x5c45('0xb')](function(_0x56d4f9){logger[_0x5c45('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5e8003,'request\x20sent');logger[_0x5c45('0xd')](_0x5c45('0xe'),_0x5e8003,'request\x20sent',JSON[_0x5c45('0xf')](_0x56d4f9));if(_0x56d4f9[_0x5c45('0x10')]){if(_0x56d4f9[_0x5c45('0x10')][_0x5c45('0x11')]===0x1f4){logger[_0x5c45('0x10')](_0x5c45('0x12'),_0x5e8003,_0x56d4f9[_0x5c45('0x10')][_0x5c45('0x13')]);return _0x26a8af(_0x56d4f9['error'][_0x5c45('0x13')]);}logger[_0x5c45('0x10')](_0x5c45('0x12'),_0x5e8003,_0x56d4f9[_0x5c45('0x10')][_0x5c45('0x13')]);return _0x4d58b4(_0x56d4f9[_0x5c45('0x10')][_0x5c45('0x13')]);}else{logger[_0x5c45('0xc')](_0x5c45('0x12'),_0x5e8003,_0x5c45('0x14'));_0x4d58b4(_0x56d4f9[_0x5c45('0x15')]['message']);}})[_0x5c45('0x16')](function(_0x928c2e){logger[_0x5c45('0x10')](_0x5c45('0x12'),_0x5e8003,_0x928c2e);_0x26a8af(_0x928c2e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 51129bf..2fc2326 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc1c=['App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','join','Offline\x20apps:','status','log'];(function(_0x2e0e3c,_0x533d49){var _0x4fe05a=function(_0x2ff59f){while(--_0x2ff59f){_0x2e0e3c['push'](_0x2e0e3c['shift']());}};_0x4fe05a(++_0x533d49);}(_0xbc1c,0xd8));var _0xcbc1=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xbc1c[_0x145b3c];return _0x1b6e36;};'use strict';var _=require('lodash');var db=require(_0xcbc1('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xcbc1('0x1'));var rpc=require('./rpc');var config=require(_0xcbc1('0x2'));var logger=require(_0xcbc1('0x3'))(_0xcbc1('0x4'));var pm2=require(_0xcbc1('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xcbc1('0x6'));var chat=require(_0xcbc1('0x7'));var whatsapp=require(_0xcbc1('0x8'));var transcribe=require(_0xcbc1('0x9'));var provider=require(_0xcbc1('0xa'));function main(){return db[_0xcbc1('0xb')]['sync']()[_0xcbc1('0xc')](function(){if(config[_0xcbc1('0xd')]){return seedDb[_0xcbc1('0xe')]();}})[_0xcbc1('0xc')](function(){return checkLicense[_0xcbc1('0xe')]();})[_0xcbc1('0xc')](function(){return rpc['listen']();})[_0xcbc1('0xc')](function(_0x4addfb){logger[_0xcbc1('0xf')](_0x4addfb);return chat[_0xcbc1('0x10')]();})['then'](function(){return whatsapp[_0xcbc1('0x10')]();})['then'](function(){return schedule['start']();})[_0xcbc1('0xc')](function(){return transcribe[_0xcbc1('0x10')]();})['then'](function(){return provider[_0xcbc1('0x10')]();})[_0xcbc1('0xc')](function(_0x56b168){logger['info'](_0x56b168);return pm2[_0xcbc1('0x10')](pm2Config);})['then'](function(_0x33aa46){var _0x3a4b8d=_0x33aa46[_0xcbc1('0x11')](function(_0x2dcafc){return typeof _0x2dcafc[_0xcbc1('0x12')]==='number'&&_0x2dcafc['exitCode']>=0x0;});if(_0x3a4b8d['length']>0x0){throw new Error(_0x3a4b8d[_0xcbc1('0x13')]+_0xcbc1('0x14')+_[_0xcbc1('0x15')](_0x3a4b8d,function(_0x316217){return'\x22'+_0x316217['pm2_env'][_0xcbc1('0x16')]+'\x22';}));}logger[_0xcbc1('0xf')](_0xcbc1('0x17'),_[_0xcbc1('0x15')](_[_0xcbc1('0x11')](_0x33aa46,{'status':_0xcbc1('0x18')}),'name')[_0xcbc1('0x19')]());logger[_0xcbc1('0xf')](_0xcbc1('0x1a'),_['map'](_[_0xcbc1('0x11')](_0x33aa46,function(_0x3b9837){return _0x3b9837[_0xcbc1('0x1b')]!==_0xcbc1('0x18');}),_0xcbc1('0x16'))[_0xcbc1('0x19')]()||'None');console[_0xcbc1('0x1c')](_0xcbc1('0x1d'));})[_0xcbc1('0x1e')](function(_0x1c26e6){console['log'](_0xcbc1('0x1f'),_0x1c26e6);logger[_0xcbc1('0x20')](_0xcbc1('0x21'),_0x1c26e6);process[_0xcbc1('0x22')](0x1);});}main(); \ No newline at end of file +var _0xd072=['error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','Offline\x20apps:','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xd072,0x132));var _0x2d07=function(_0x31b362,_0x44ac74){_0x31b362=_0x31b362-0x0;var _0xebc28d=_0xd072[_0x31b362];return _0xebc28d;};'use strict';var _=require(_0x2d07('0x0'));var db=require(_0x2d07('0x1'))['db'];var seedDb=require(_0x2d07('0x2'));var checkLicense=require(_0x2d07('0x3'));var rpc=require(_0x2d07('0x4'));var config=require(_0x2d07('0x5'));var logger=require(_0x2d07('0x6'))('app');var pm2=require(_0x2d07('0x7'));var pm2Config=require(_0x2d07('0x8'));var schedule=require(_0x2d07('0x9'));var chat=require(_0x2d07('0xa'));var whatsapp=require(_0x2d07('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x2d07('0xc'));function main(){return db[_0x2d07('0xd')][_0x2d07('0xe')]()[_0x2d07('0xf')](function(){if(config[_0x2d07('0x10')]){return seedDb[_0x2d07('0x11')]();}})[_0x2d07('0xf')](function(){return checkLicense['default']();})[_0x2d07('0xf')](function(){return rpc[_0x2d07('0x12')]();})[_0x2d07('0xf')](function(_0x46ddb1){logger[_0x2d07('0x13')](_0x46ddb1);return chat[_0x2d07('0x14')]();})[_0x2d07('0xf')](function(){return whatsapp[_0x2d07('0x14')]();})[_0x2d07('0xf')](function(){return schedule[_0x2d07('0x14')]();})[_0x2d07('0xf')](function(){return transcribe[_0x2d07('0x14')]();})[_0x2d07('0xf')](function(){return provider[_0x2d07('0x14')]();})[_0x2d07('0xf')](function(_0x380fd4){logger[_0x2d07('0x13')](_0x380fd4);return pm2[_0x2d07('0x14')](pm2Config);})[_0x2d07('0xf')](function(_0x3fbab2){var _0x28cbb3=_0x3fbab2[_0x2d07('0x15')](function(_0x2daa2b){return typeof _0x2daa2b[_0x2d07('0x16')]===_0x2d07('0x17')&&_0x2daa2b['exitCode']>=0x0;});if(_0x28cbb3[_0x2d07('0x18')]>0x0){throw new Error(_0x28cbb3[_0x2d07('0x18')]+_0x2d07('0x19')+_[_0x2d07('0x1a')](_0x28cbb3,function(_0x2b8884){return'\x22'+_0x2b8884[_0x2d07('0x1b')][_0x2d07('0x1c')]+'\x22';}));}logger[_0x2d07('0x13')]('Online\x20apps:',_[_0x2d07('0x1a')](_[_0x2d07('0x15')](_0x3fbab2,{'status':_0x2d07('0x1d')}),_0x2d07('0x1c'))['join']());logger[_0x2d07('0x13')](_0x2d07('0x1e'),_[_0x2d07('0x1a')](_[_0x2d07('0x15')](_0x3fbab2,function(_0x165d7f){return _0x165d7f[_0x2d07('0x1f')]!==_0x2d07('0x1d');}),_0x2d07('0x1c'))['join']()||_0x2d07('0x20'));console[_0x2d07('0x21')](_0x2d07('0x22'));})['catch'](function(_0x7a489){console['log'](_0x2d07('0x23'),_0x7a489);logger[_0x2d07('0x24')](_0x2d07('0x25'),_0x7a489);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7154e0f..980ec62 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 _0x4ee7=['crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','ChatInteraction','findOne','params','closed','status','disposition','unmanaged','json','Unmanaged.','catch','use','headers','authorization','Basic','User','find','then','authenticate','pass','Wrong\x20credentials.','user','startsWith','Bearer','Unknown\x20authorization\x20format','getUuid','query','apikey','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20object\x20not\x20found.','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','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\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','unshift','encryptString','join','promisify','sign','session','payload','options','verify','randomBytes','toString','hex','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','util','secrets','userpic','permissions','md5secret','mailPause','faxPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt'];(function(_0x1bb6a4,_0x2e4cc8){var _0x46b94c=function(_0xf40bd7){while(--_0xf40bd7){_0x1bb6a4['push'](_0x1bb6a4['shift']());}};_0x46b94c(++_0x2e4cc8);}(_0x4ee7,0x169));var _0x74ee=function(_0x374679,_0x185787){_0x374679=_0x374679-0x0;var _0x5d6f7f=_0x4ee7[_0x374679];return _0x5d6f7f;};'use strict';var db=require(_0x74ee('0x0'))['db'];var config=require(_0x74ee('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x74ee('0x2'));var encryptor=require(_0x74ee('0x3'));var _=require(_0x74ee('0x4'));var jwt=require(_0x74ee('0x5'));var expressJwt=require(_0x74ee('0x6'));var compose=require(_0x74ee('0x7'));var basicAuth=require(_0x74ee('0x8'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x74ee('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x74ee('0xa')]['session']});var userAttributes=['id','role','fullname','name','internal','email',_0x74ee('0xb'),_0x74ee('0xc'),_0x74ee('0xd'),'voicePause','chatPause',_0x74ee('0xe'),_0x74ee('0xf'),'smsPause',_0x74ee('0x10'),'pauseType',_0x74ee('0x11'),_0x74ee('0x12'),_0x74ee('0x13'),_0x74ee('0x14'),_0x74ee('0x15'),_0x74ee('0x16'),_0x74ee('0x17'),'phoneBarAutoAnswer',_0x74ee('0x18'),_0x74ee('0x19'),_0x74ee('0x1a'),_0x74ee('0x1b'),_0x74ee('0x1c'),_0x74ee('0x1d'),_0x74ee('0x1e'),_0x74ee('0x1f'),_0x74ee('0x20'),'hotdesk',_0x74ee('0x21'),_0x74ee('0x22'),_0x74ee('0x23'),_0x74ee('0x24'),_0x74ee('0x25'),_0x74ee('0x26'),_0x74ee('0x27'),_0x74ee('0x28'),_0x74ee('0x29'),_0x74ee('0x2a')];exports[_0x74ee('0x2b')]=function(){return this[_0x74ee('0x2c')](!![])['use'](function(_0x194720,_0x4fa3c2,_0x450ac1){if(_0x194720['user']){_0x450ac1();}else{return db[_0x74ee('0x2d')][_0x74ee('0x2e')]({'where':{'id':_0x194720[_0x74ee('0x2f')]['id']},'attributes':['id',_0x74ee('0x30'),'disposition'],'raw':!![]})['then'](function(_0x9692b2){if(_0x9692b2&&_0x9692b2[_0x74ee('0x30')]){return _0x4fa3c2[_0x74ee('0x31')](_0x9692b2[_0x74ee('0x32')]===_0x74ee('0x33')?0x195:0x193)[_0x74ee('0x34')]({'message':_0x9692b2[_0x74ee('0x32')]===_0x74ee('0x33')?_0x74ee('0x35'):'Forbidden.'});}else{_0x450ac1();}})[_0x74ee('0x36')](function(_0x1d6989){_0x450ac1(_0x1d6989);});}});};exports[_0x74ee('0x2c')]=function isAuthenticated(_0xa42ecc){return compose()[_0x74ee('0x37')](function(_0x4bfc2b,_0x2ab84d,_0x53a4a5){var _0x1e846c;if(_0x4bfc2b[_0x74ee('0x38')]['authorization']){if(_['startsWith'](_0x4bfc2b['headers'][_0x74ee('0x39')],_0x74ee('0x3a'))){var _0x12bb29=basicAuth(_0x4bfc2b);db[_0x74ee('0x3b')][_0x74ee('0x3c')]({'where':{'name':_0x12bb29['name']}})[_0x74ee('0x3d')](function(_0x3be2ae){if(!_0x3be2ae||!_0x3be2ae[_0x74ee('0x3e')](_0x12bb29[_0x74ee('0x3f')])){return _0x2ab84d[_0x74ee('0x31')](0x191)['json']({'message':_0x74ee('0x40')});}_0x4bfc2b[_0x74ee('0x41')]={'id':_0x3be2ae['id']};_0x53a4a5();})[_0x74ee('0x36')](function(_0x8819d2){_0x53a4a5(_0x8819d2);});}else if(_[_0x74ee('0x42')](_0x4bfc2b[_0x74ee('0x38')][_0x74ee('0x39')],_0x74ee('0x43'))){validateJwt(_0x4bfc2b,_0x2ab84d,_0x53a4a5);}else{if(_0xa42ecc){_0x53a4a5();}else{return _0x2ab84d['status'](0x193)[_0x74ee('0x34')]({'message':_0x74ee('0x44')});}}}else if(_0x4bfc2b['query']['apikey']){try{var _0x1087b1={'audience':hardwareConf[_0x74ee('0x45')](),'issuer':hardwareConf[_0x74ee('0x45')]()};verifyJwt(_0x4bfc2b[_0x74ee('0x46')][_0x74ee('0x47')],_0x1087b1)[_0x74ee('0x3d')](function(_0x5400c6){return db[_0x74ee('0x3b')]['find']({'where':{'id':_0x5400c6[_0x74ee('0x48')]}})[_0x74ee('0x3d')](function(_0x53eeb9){_0x1e846c=_0x53eeb9;return db['Setting'][_0x74ee('0x2e')]({'where':{'id':0x1},'attributes':[_0x74ee('0x49'),_0x74ee('0x4a')],'raw':!![]});})[_0x74ee('0x3d')](function(_0xa41fe8){if(!_0x1e846c||!_[_0x74ee('0x4b')](_0x1e846c[_0x74ee('0x4c')],_0x5400c6['nonce'])){return _0x2ab84d[_0x74ee('0x31')](0x191)['json']({'message':_0x74ee('0x4d')});}if(_0x1e846c[_0x74ee('0x4e')]){return _0x2ab84d[_0x74ee('0x31')](0x191)[_0x74ee('0x34')]({'message':_0x74ee('0x4f')});}if(_0x1e846c['blocked']){if(_0xa41fe8['blockDuration']>0x0){if(moment(_0x1e846c[_0x74ee('0x50')])[_0x74ee('0x51')](_0xa41fe8[_0x74ee('0x4a')],_0x74ee('0x52'))>moment()){return _0x2ab84d['status'](0x191)[_0x74ee('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2ab84d[_0x74ee('0x31')](0x191)[_0x74ee('0x34')]({'message':_0x74ee('0x4f')});}}_0x4bfc2b[_0x74ee('0x41')]={'id':_0x1e846c['id']};_0x53a4a5();});})[_0x74ee('0x36')](function(){return _0x2ab84d[_0x74ee('0x31')](0x191)[_0x74ee('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x5ded32){_0x53a4a5(_0x5ded32);}}else if(_0xa42ecc){_0x53a4a5();}else{return _0x2ab84d[_0x74ee('0x31')](0x193)[_0x74ee('0x34')]({'message':'Unknown\x20authorization\x20format'});}})[_0x74ee('0x37')](function(_0x173464,_0xe5b3b9,_0x142683){if(_0x173464[_0x74ee('0x41')]){db['User'][_0x74ee('0x3c')]({'where':{'id':_0x173464[_0x74ee('0x41')]['id']},'attributes':userAttributes})[_0x74ee('0x3d')](function(_0x4cfc5c){if(!_0x4cfc5c){return _0xe5b3b9[_0x74ee('0x31')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x173464['user']=_0x4cfc5c;_0x142683();})[_0x74ee('0x36')](function(_0x2123a9){_0x142683(_0x2123a9);});}else if(_0xa42ecc){_0x142683();}else{return _0xe5b3b9[_0x74ee('0x31')](0x194)[_0x74ee('0x34')]({'message':_0x74ee('0x53')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x2e059b,_0xf98428,_0x923ca7){return licenseUtil['getLicense']()[_0x74ee('0x3d')](function(_0x311552){if(_0x311552[_0x74ee('0x54')]){_0x923ca7();}else{return _0xf98428['status'](0x193)[_0x74ee('0x34')]({'message':_0x74ee('0x55')});}})['catch'](function(_0x32f0d4){_0x923ca7(_0x32f0d4);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x74ee('0x37')](function(_0x77ec1b,_0x19d9e9,_0x48ab7e){return licenseUtil['getLicense']()[_0x74ee('0x3d')](function(_0x3a151d){if(_0x3a151d[_0x74ee('0x56')]){_0x48ab7e();}else{return _0x19d9e9[_0x74ee('0x31')](0x193)['json']({'message':_0x74ee('0x55')});}})[_0x74ee('0x36')](function(_0x836575){_0x48ab7e(_0x836575);});});};exports[_0x74ee('0x57')]=function(_0x90e0ac,_0x38ba69,_0xea5521){_0x90e0ac['isMiddleware']=!![];return _0xea5521();};exports[_0x74ee('0x58')]=function signToken(_0x4f7a47){return signJwt(_0x4f7a47);};exports['setTokenCookie']=function(_0x326dae,_0x487a09){if(!_0x326dae['user']){return _0x487a09[_0x74ee('0x31')](0x194)[_0x74ee('0x34')]({'message':_0x74ee('0x59')});}var _0x56278d={'payload':{'id':_0x326dae[_0x74ee('0x41')]['id'],'role':_0x326dae['user'][_0x74ee('0x5a')]},'options':{'expiresIn':0x15180}};return signJwt(_0x56278d)['then'](function(_0x4768d9){_0x487a09[_0x74ee('0x5b')](_0x74ee('0x5c'),_0x4768d9);_0x487a09[_0x74ee('0x5d')]('/dashboards/general');})[_0x74ee('0x36')](function(_0x20e491){return _0x487a09[_0x74ee('0x31')](0x1f4)[_0x74ee('0x5e')](_0x20e491);});};exports[_0x74ee('0x5f')]=function(_0x2b8a37){if(_[_0x74ee('0x60')](_0x2b8a37['apiKeyNonce'])||_[_0x74ee('0x60')](_0x2b8a37['apiKeyIat'])){return null;}else{return createJwt(_0x2b8a37);}};exports[_0x74ee('0x61')]=function(_0x30c646){_0x30c646[_0x74ee('0x4c')]=generateNonce();_0x30c646[_0x74ee('0x62')]=generateIssuedAt();return createJwt(_0x30c646);};exports[_0x74ee('0x63')]=function(_0x524419,_0x2a6bde){var _0x5d52d7=_0x524419['query'][_0x74ee('0x47')];if(_0x5d52d7){var _0x3373b1={'nonce':_0x2a6bde[_0x74ee('0x4c')],'iat':_0x2a6bde[_0x74ee('0x62')],'audience':hardwareConf[_0x74ee('0x45')](),'issuer':hardwareConf[_0x74ee('0x45')]()};return verifyJwt(_0x5d52d7,_0x3373b1)[_0x74ee('0x3d')](function(){return generateApiKey(_0x2a6bde);});}else{throw{'message':_0x74ee('0x64')};}};exports[_0x74ee('0x65')]=function(_0x3300e0){var _0x18495c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x18495c[_0x74ee('0x66')](_0x3300e0))throw new db[(_0x74ee('0x67'))][(_0x74ee('0x68'))](_0x74ee('0x69'));return;};exports[_0x74ee('0x6a')]=function(_0x266e74,_0x33d956,_0x1dd0e9){var _0x5ae307=encryptor['decryptString'](_0x33d956)[_0x74ee('0x6b')](',');for(var _0x23d02a=0x0;_0x23d02a<_0x1dd0e9;_0x23d02a++){if(!_0x5ae307[_0x23d02a])break;if(_0x266e74[_0x74ee('0x6c')]()===_0x5ae307[_0x23d02a]['toLowerCase']()){var _0x7f6f29=util[_0x74ee('0x6d')](_0x74ee('0x6e'),_0x1dd0e9);if(_0x1dd0e9===0x1){_0x7f6f29=_0x74ee('0x6f');}throw new db['Sequelize'][(_0x74ee('0x68'))](_0x7f6f29);}}return;};exports[_0x74ee('0x70')]=function(_0x41ba96,_0x32164d){var _0x41d204=_0x32164d?encryptor[_0x74ee('0x71')](_0x32164d)['split'](','):[];if(_0x41d204['length']===0x5){_0x41d204['splice'](-0x1,0x1);}_0x41d204[_0x74ee('0x72')](_0x41ba96);return encryptor[_0x74ee('0x73')](_0x41d204[_0x74ee('0x74')](','));};function signJwt(_0x357570){var _0x20dc1f=BPromise[_0x74ee('0x75')](jwt[_0x74ee('0x76')],{'context':jwt});var _0x11e7a7=_0x357570['secret']||config[_0x74ee('0xa')][_0x74ee('0x77')];return new BPromise(function(_0xc482dc,_0x18a187){_0x20dc1f(_0x357570[_0x74ee('0x78')],_0x11e7a7,_0x357570[_0x74ee('0x79')])[_0x74ee('0x3d')](function(_0x38a4f3){_0xc482dc(_0x38a4f3);})['catch'](function(_0x40c0e1){_0x18a187(_0x40c0e1);});});}function verifyJwt(_0x5a8e27,_0x2fe90e,_0x1268b5){var _0xa3cf24=BPromise[_0x74ee('0x75')](jwt[_0x74ee('0x7a')],{'context':jwt});var _0x56dddd=_0x1268b5||config[_0x74ee('0xa')][_0x74ee('0x77')];return new BPromise(function(_0x2748d2,_0x1abdd9){_0xa3cf24(_0x5a8e27,_0x56dddd,_0x2fe90e)[_0x74ee('0x3d')](function(_0x2bd966){_0x2748d2(_0x2bd966);})[_0x74ee('0x36')](function(_0x4aa601){_0x1abdd9(_0x4aa601);});});}function generateNonce(){return crypto[_0x74ee('0x7b')](0x10)[_0x74ee('0x7c')](_0x74ee('0x7d'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x74ee('0x7c')]();}function createJwt(_0x315053){var _0x1a467e={'payload':{'iat':_0x315053[_0x74ee('0x62')],'nonce':_0x315053[_0x74ee('0x4c')]},'options':{'algorithm':_0x74ee('0x7e'),'subject':_0x315053['id'][_0x74ee('0x7c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1a467e)['then'](function(_0xaaf52f){return{'iat':_0x315053[_0x74ee('0x62')],'nonce':_0x315053[_0x74ee('0x4c')],'token':_0xaaf52f};});} \ No newline at end of file +var _0x7d31=['promisify','sign','secret','options','verify','hex','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','name','internal','email','md5secret','voicePause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','closed','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','then','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','join'];(function(_0x1c2995,_0x9e2edf){var _0x1acd48=function(_0x42e649){while(--_0x42e649){_0x1c2995['push'](_0x1c2995['shift']());}};_0x1acd48(++_0x9e2edf);}(_0x7d31,0x179));var _0x17d3=function(_0x2cefd6,_0x320d0b){_0x2cefd6=_0x2cefd6-0x0;var _0x56d9ea=_0x7d31[_0x2cefd6];return _0x56d9ea;};'use strict';var db=require(_0x17d3('0x0'))['db'];var config=require(_0x17d3('0x1'));var hardwareConf=require(_0x17d3('0x2'));var licenseUtil=require(_0x17d3('0x3'));var encryptor=require(_0x17d3('0x4'));var _=require(_0x17d3('0x5'));var jwt=require(_0x17d3('0x6'));var expressJwt=require(_0x17d3('0x7'));var compose=require(_0x17d3('0x8'));var basicAuth=require(_0x17d3('0x9'));var crypto=require(_0x17d3('0xa'));var BPromise=require(_0x17d3('0xb'));var util=require('util');var moment=require(_0x17d3('0xc'));var validateJwt=expressJwt({'secret':config[_0x17d3('0xd')][_0x17d3('0xe')]});var userAttributes=['id',_0x17d3('0xf'),'fullname',_0x17d3('0x10'),_0x17d3('0x11'),_0x17d3('0x12'),'userpic','permissions',_0x17d3('0x13'),_0x17d3('0x14'),'chatPause','mailPause',_0x17d3('0x15'),_0x17d3('0x16'),_0x17d3('0x17'),_0x17d3('0x18'),_0x17d3('0x19'),'lastLoginAt',_0x17d3('0x1a'),'crudPermissions',_0x17d3('0x1b'),_0x17d3('0x1c'),_0x17d3('0x1d'),_0x17d3('0x1e'),_0x17d3('0x1f'),'phoneBarDnd','phoneBarEnableRecording',_0x17d3('0x20'),_0x17d3('0x21'),_0x17d3('0x22'),'phoneBarPrefixRequired',_0x17d3('0x23'),_0x17d3('0x24'),'hotdesk',_0x17d3('0x25'),_0x17d3('0x26'),_0x17d3('0x27'),_0x17d3('0x28'),_0x17d3('0x29'),'downloadVoiceRecordings',_0x17d3('0x2a'),_0x17d3('0x2b'),_0x17d3('0x2c'),_0x17d3('0x2d')];exports[_0x17d3('0x2e')]=function(){return this[_0x17d3('0x2f')](!![])[_0x17d3('0x30')](function(_0x2cfe1a,_0x4a973a,_0xfcecfe){if(_0x2cfe1a['user']){_0xfcecfe();}else{return db[_0x17d3('0x31')][_0x17d3('0x32')]({'where':{'id':_0x2cfe1a['params']['id']},'attributes':['id',_0x17d3('0x33'),_0x17d3('0x34')],'raw':!![]})['then'](function(_0x8d245a){if(_0x8d245a&&_0x8d245a[_0x17d3('0x33')]){return _0x4a973a['status'](_0x8d245a[_0x17d3('0x34')]===_0x17d3('0x35')?0x195:0x193)[_0x17d3('0x36')]({'message':_0x8d245a['disposition']===_0x17d3('0x35')?_0x17d3('0x37'):_0x17d3('0x38')});}else{_0xfcecfe();}})[_0x17d3('0x39')](function(_0x3d496d){_0xfcecfe(_0x3d496d);});}});};exports[_0x17d3('0x2f')]=function isAuthenticated(_0x591689){return compose()[_0x17d3('0x30')](function(_0x51fb1b,_0x16b365,_0x4deaca){var _0x4e0d45;if(_0x51fb1b['headers'][_0x17d3('0x3a')]){if(_[_0x17d3('0x3b')](_0x51fb1b[_0x17d3('0x3c')][_0x17d3('0x3a')],_0x17d3('0x3d'))){var _0x2b9a5e=basicAuth(_0x51fb1b);db[_0x17d3('0x3e')][_0x17d3('0x3f')]({'where':{'name':_0x2b9a5e[_0x17d3('0x10')]}})['then'](function(_0x1e999a){if(!_0x1e999a||!_0x1e999a[_0x17d3('0x40')](_0x2b9a5e[_0x17d3('0x41')])){return _0x16b365[_0x17d3('0x42')](0x191)[_0x17d3('0x36')]({'message':_0x17d3('0x43')});}_0x51fb1b[_0x17d3('0x44')]={'id':_0x1e999a['id']};_0x4deaca();})['catch'](function(_0x122fc9){_0x4deaca(_0x122fc9);});}else if(_['startsWith'](_0x51fb1b['headers'][_0x17d3('0x3a')],_0x17d3('0x45'))){validateJwt(_0x51fb1b,_0x16b365,_0x4deaca);}else{if(_0x591689){_0x4deaca();}else{return _0x16b365['status'](0x193)[_0x17d3('0x36')]({'message':_0x17d3('0x46')});}}}else if(_0x51fb1b[_0x17d3('0x47')]['apikey']){try{var _0x552579={'audience':hardwareConf[_0x17d3('0x48')](),'issuer':hardwareConf[_0x17d3('0x48')]()};verifyJwt(_0x51fb1b[_0x17d3('0x47')][_0x17d3('0x49')],_0x552579)[_0x17d3('0x4a')](function(_0x52179c){return db['User'][_0x17d3('0x3f')]({'where':{'id':_0x52179c[_0x17d3('0x4b')]}})[_0x17d3('0x4a')](function(_0x4324fd){_0x4e0d45=_0x4324fd;return db['Setting'][_0x17d3('0x32')]({'where':{'id':0x1},'attributes':[_0x17d3('0x4c'),_0x17d3('0x4d')],'raw':!![]});})['then'](function(_0x34620a){if(!_0x4e0d45||!_['isEqual'](_0x4e0d45[_0x17d3('0x4e')],_0x52179c[_0x17d3('0x4f')])){return _0x16b365['status'](0x191)['json']({'message':_0x17d3('0x50')});}if(_0x4e0d45[_0x17d3('0x51')]){return _0x16b365[_0x17d3('0x42')](0x191)['json']({'message':_0x17d3('0x52')});}if(_0x4e0d45['blocked']){if(_0x34620a['blockDuration']>0x0){if(moment(_0x4e0d45['blockedAt'])['add'](_0x34620a[_0x17d3('0x4d')],'minutes')>moment()){return _0x16b365[_0x17d3('0x42')](0x191)[_0x17d3('0x36')]({'message':_0x17d3('0x52')});}}else{return _0x16b365[_0x17d3('0x42')](0x191)['json']({'message':_0x17d3('0x52')});}}_0x51fb1b[_0x17d3('0x44')]={'id':_0x4e0d45['id']};_0x4deaca();});})[_0x17d3('0x39')](function(){return _0x16b365[_0x17d3('0x42')](0x191)[_0x17d3('0x36')]({'message':_0x17d3('0x52')});});}catch(_0x445f25){_0x4deaca(_0x445f25);}}else if(_0x591689){_0x4deaca();}else{return _0x16b365['status'](0x193)['json']({'message':_0x17d3('0x46')});}})['use'](function(_0xee1d3c,_0x563d10,_0x4dba8c){if(_0xee1d3c[_0x17d3('0x44')]){db[_0x17d3('0x3e')][_0x17d3('0x3f')]({'where':{'id':_0xee1d3c[_0x17d3('0x44')]['id']},'attributes':userAttributes})[_0x17d3('0x4a')](function(_0x21cd7e){if(!_0x21cd7e){return _0x563d10[_0x17d3('0x42')](0x194)['json']({'message':_0x17d3('0x53')});}_0xee1d3c['user']=_0x21cd7e;_0x4dba8c();})[_0x17d3('0x39')](function(_0x472a5f){_0x4dba8c(_0x472a5f);});}else if(_0x591689){_0x4dba8c();}else{return _0x563d10[_0x17d3('0x42')](0x194)[_0x17d3('0x36')]({'message':_0x17d3('0x54')});}});};exports[_0x17d3('0x55')]=function canUpdate(){return compose()[_0x17d3('0x30')](function(_0x4e6d04,_0x370dca,_0x27ac78){return licenseUtil[_0x17d3('0x56')]()[_0x17d3('0x4a')](function(_0x44b09c){if(_0x44b09c['update']){_0x27ac78();}else{return _0x370dca['status'](0x193)[_0x17d3('0x36')]({'message':_0x17d3('0x57')});}})['catch'](function(_0x5c61d0){_0x27ac78(_0x5c61d0);});});};exports[_0x17d3('0x58')]=function isWebrtcLicence(){return compose()[_0x17d3('0x30')](function(_0xdea258,_0x1bd17b,_0x2e42e4){return licenseUtil[_0x17d3('0x56')]()[_0x17d3('0x4a')](function(_0x467ced){if(_0x467ced['webrtc']){_0x2e42e4();}else{return _0x1bd17b[_0x17d3('0x42')](0x193)['json']({'message':_0x17d3('0x57')});}})[_0x17d3('0x39')](function(_0x1cd136){_0x2e42e4(_0x1cd136);});});};exports[_0x17d3('0x59')]=function(_0x29c14b,_0x56f120,_0x3830d3){_0x29c14b[_0x17d3('0x59')]=!![];return _0x3830d3();};exports[_0x17d3('0x5a')]=function signToken(_0x44189e){return signJwt(_0x44189e);};exports[_0x17d3('0x5b')]=function(_0x14f8ea,_0x5dbbea){if(!_0x14f8ea[_0x17d3('0x44')]){return _0x5dbbea[_0x17d3('0x42')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0xe7a3ca={'payload':{'id':_0x14f8ea[_0x17d3('0x44')]['id'],'role':_0x14f8ea[_0x17d3('0x44')][_0x17d3('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0xe7a3ca)['then'](function(_0x5009e6){_0x5dbbea['cookie'](_0x17d3('0x5c'),_0x5009e6);_0x5dbbea[_0x17d3('0x5d')](_0x17d3('0x5e'));})[_0x17d3('0x39')](function(_0x564b94){return _0x5dbbea[_0x17d3('0x42')](0x1f4)['send'](_0x564b94);});};exports[_0x17d3('0x5f')]=function(_0x1b6d29){if(_[_0x17d3('0x60')](_0x1b6d29[_0x17d3('0x4e')])||_[_0x17d3('0x60')](_0x1b6d29[_0x17d3('0x61')])){return null;}else{return createJwt(_0x1b6d29);}};exports[_0x17d3('0x62')]=function(_0x1f91a6){_0x1f91a6[_0x17d3('0x4e')]=generateNonce();_0x1f91a6[_0x17d3('0x61')]=generateIssuedAt();return createJwt(_0x1f91a6);};exports[_0x17d3('0x63')]=function(_0x3360c3,_0x290602){var _0x3f4edb=_0x3360c3[_0x17d3('0x47')][_0x17d3('0x49')];if(_0x3f4edb){var _0x549cfd={'nonce':_0x290602[_0x17d3('0x4e')],'iat':_0x290602['apiKeyIat'],'audience':hardwareConf[_0x17d3('0x48')](),'issuer':hardwareConf[_0x17d3('0x48')]()};return verifyJwt(_0x3f4edb,_0x549cfd)['then'](function(){return generateApiKey(_0x290602);});}else{throw{'message':_0x17d3('0x64')};}};exports['validatePasswordPattern']=function(_0x326fb6){var _0x4b9b97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4b9b97[_0x17d3('0x65')](_0x326fb6))throw new db[(_0x17d3('0x66'))][(_0x17d3('0x67'))](_0x17d3('0x68'));return;};exports[_0x17d3('0x69')]=function(_0x2c2b79,_0x140fd0,_0xff356f){var _0x4035a8=encryptor[_0x17d3('0x6a')](_0x140fd0)[_0x17d3('0x6b')](',');for(var _0x2ee8c0=0x0;_0x2ee8c0<_0xff356f;_0x2ee8c0++){if(!_0x4035a8[_0x2ee8c0])break;if(_0x2c2b79['toLowerCase']()===_0x4035a8[_0x2ee8c0][_0x17d3('0x6c')]()){var _0xc2ad29=util[_0x17d3('0x6d')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xff356f);if(_0xff356f===0x1){_0xc2ad29=_0x17d3('0x6e');}throw new db[(_0x17d3('0x66'))][(_0x17d3('0x67'))](_0xc2ad29);}}return;};exports[_0x17d3('0x6f')]=function(_0x5926ee,_0x28a656){var _0x3ee3a1=_0x28a656?encryptor[_0x17d3('0x6a')](_0x28a656)[_0x17d3('0x6b')](','):[];if(_0x3ee3a1[_0x17d3('0x70')]===0x5){_0x3ee3a1[_0x17d3('0x71')](-0x1,0x1);}_0x3ee3a1['unshift'](_0x5926ee);return encryptor['encryptString'](_0x3ee3a1[_0x17d3('0x72')](','));};function signJwt(_0x1209d1){var _0x331b4a=BPromise[_0x17d3('0x73')](jwt[_0x17d3('0x74')],{'context':jwt});var _0x4f22bf=_0x1209d1[_0x17d3('0x75')]||config[_0x17d3('0xd')]['session'];return new BPromise(function(_0x3e7600,_0x1bf30f){_0x331b4a(_0x1209d1['payload'],_0x4f22bf,_0x1209d1[_0x17d3('0x76')])['then'](function(_0x9023e4){_0x3e7600(_0x9023e4);})['catch'](function(_0x6078d5){_0x1bf30f(_0x6078d5);});});}function verifyJwt(_0x22445e,_0x3ea66d,_0x24ddee){var _0x16843d=BPromise[_0x17d3('0x73')](jwt[_0x17d3('0x77')],{'context':jwt});var _0x3d2cfd=_0x24ddee||config[_0x17d3('0xd')]['session'];return new BPromise(function(_0x14d9ea,_0x20ca92){_0x16843d(_0x22445e,_0x3d2cfd,_0x3ea66d)[_0x17d3('0x4a')](function(_0x4f2483){_0x14d9ea(_0x4f2483);})[_0x17d3('0x39')](function(_0x334889){_0x20ca92(_0x334889);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x17d3('0x78'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x17d3('0x79')]();}function createJwt(_0x5da1b9){var _0xf969f8={'payload':{'iat':_0x5da1b9['apiKeyIat'],'nonce':_0x5da1b9[_0x17d3('0x4e')]},'options':{'algorithm':_0x17d3('0x7a'),'subject':_0x5da1b9['id']['toString'](),'issuer':hardwareConf[_0x17d3('0x48')](),'audience':hardwareConf[_0x17d3('0x48')]()}};return signJwt(_0xf969f8)[_0x17d3('0x4a')](function(_0x42abd4){return{'iat':_0x5da1b9[_0x17d3('0x61')],'nonce':_0x5da1b9[_0x17d3('0x4e')],'token':_0x42abd4};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 112c85f..7095265 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 _0x5dcc=['hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','decryptFile','createDecipher','close','unlink','encryptString','secret','utf8','base64','final','decryptString','crypto','bluebird','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf'];(function(_0x20179a,_0xf2e330){var _0x354ba6=function(_0x29df63){while(--_0x29df63){_0x20179a['push'](_0x20179a['shift']());}};_0x354ba6(++_0xf2e330);}(_0x5dcc,0x134));var _0xc5dc=function(_0x2cba56,_0x58fbe7){_0x2cba56=_0x2cba56-0x0;var _0x424812=_0x5dcc[_0x2cba56];return _0x424812;};'use strict';var crypto=require(_0xc5dc('0x0'));var fs=require('fs');var BPromise=require(_0xc5dc('0x1'));var _=require('lodash');var config=require('../../config/environment');var logger=require(_0xc5dc('0x2'))(_0xc5dc('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc5dc('0x4')][_0xc5dc('0x5')],'algorithm':_0xc5dc('0x6')};const fileOptions={'algorithm':_0xc5dc('0x7')};if(config[_0xc5dc('0x8')]&&config[_0xc5dc('0x8')][_0xc5dc('0x9')]){var isSupported=isAlgorithmSupported(config[_0xc5dc('0x8')][_0xc5dc('0x9')]);if(isSupported){fileOptions[_0xc5dc('0x9')]=config[_0xc5dc('0x8')][_0xc5dc('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc5dc('0xa')](',\x20');logger[_0xc5dc('0xb')](config[_0xc5dc('0x8')][_0xc5dc('0x9')],_0xc5dc('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2f8f93){return AES_SUPPORTED_RX['test'](_0x2f8f93);}function getSupportedCiphers(){return crypto[_0xc5dc('0xd')]()[_0xc5dc('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x174b5c){return getSupportedCiphers()[_0xc5dc('0xf')](_0x174b5c)>-0x1;}function combineOptions(_0x4fcc52){var _0x2fc71b={};for(var _0x9b108c in fileOptions){if(fileOptions[_0xc5dc('0x10')](_0x9b108c)){_0x2fc71b[_0x9b108c]=fileOptions[_0x9b108c];}}if(_0x4fcc52){for(var _0x157d61 in _0x4fcc52){if(_0x4fcc52['hasOwnProperty'](_0x157d61)){_0x2fc71b[_0x157d61]=_0x4fcc52[_0x157d61];}}}return _0x2fc71b;}exports[_0xc5dc('0x11')]=function(_0x9122ad,_0x1ad26e,_0x18e894,_0x2c1ea2){return new BPromise(function(_0x561db8,_0x3f437a){_0x2c1ea2=combineOptions(_0x2c1ea2);var _0x55d5d8=new Buffer(_0x18e894);var _0x199067=fs[_0xc5dc('0x12')](_0x9122ad);var _0x55cc82=fs[_0xc5dc('0x13')](_0x1ad26e);var _0x20ce82=crypto[_0xc5dc('0x14')](_0x2c1ea2[_0xc5dc('0x9')],_0x55d5d8);_0x199067['on'](_0xc5dc('0x15'),function(_0x45e44e){var _0x468828=new Buffer(_0x20ce82[_0xc5dc('0x16')](_0x45e44e),_0xc5dc('0x17'));_0x55cc82[_0xc5dc('0x18')](_0x468828);});_0x199067['on']('end',function(){try{var _0x153d76=new Buffer(_0x20ce82['final'](_0xc5dc('0x17')),_0xc5dc('0x17'));_0x55cc82['write'](_0x153d76);_0x55cc82[_0xc5dc('0x19')]();_0x55cc82['on']('close',function(){return _0x561db8(_0x1ad26e);});}catch(_0x5e15a6){fs['unlink'](_0x1ad26e);return _0x3f437a(_0x5e15a6);}});});};exports[_0xc5dc('0x1a')]=function(_0x7aa68,_0x43f4df,_0x7a71a6,_0x19e431){return new BPromise(function(_0x3ea828,_0x3c3716){_0x19e431=combineOptions(_0x19e431);var _0xa89852=new Buffer(_0x7a71a6);var _0x2863fe=fs[_0xc5dc('0x12')](_0x7aa68);var _0x4a50c1=fs[_0xc5dc('0x13')](_0x43f4df);var _0x2592c7=crypto[_0xc5dc('0x1b')](_0x19e431[_0xc5dc('0x9')],_0xa89852);_0x2863fe['on']('data',function(_0x231782){var _0x347117=new Buffer(_0x2592c7[_0xc5dc('0x16')](_0x231782),_0xc5dc('0x17'));_0x4a50c1[_0xc5dc('0x18')](_0x347117);});_0x2863fe['on'](_0xc5dc('0x19'),function(){try{var _0x15028c=new Buffer(_0x2592c7['final'](_0xc5dc('0x17')),_0xc5dc('0x17'));_0x4a50c1[_0xc5dc('0x18')](_0x15028c);_0x4a50c1[_0xc5dc('0x19')]();_0x4a50c1['on'](_0xc5dc('0x1c'),function(){return _0x3ea828(_0x43f4df);});}catch(_0x4d83a2){fs[_0xc5dc('0x1d')](_0x43f4df);return _0x3c3716(_0x4d83a2);}});});};exports[_0xc5dc('0x1e')]=function(_0x10bd20,_0x1a049f,_0x3945f8){var _0x3dbe8b=_0x3945f8||stringOptions[_0xc5dc('0x9')];var _0x236193=_0x1a049f||stringOptions[_0xc5dc('0x1f')];var _0x26ef57=crypto[_0xc5dc('0x14')](_0x3dbe8b,_0x236193);var _0x50e116=_0x26ef57['update'](_0x10bd20,_0xc5dc('0x20'),_0xc5dc('0x21'));_0x50e116+=_0x26ef57[_0xc5dc('0x22')]('base64');return _0x50e116;};exports[_0xc5dc('0x23')]=function(_0x574d9e,_0x7141bb,_0x47a878){var _0x2a045d=_0x47a878||stringOptions[_0xc5dc('0x9')];var _0x196586=_0x7141bb||stringOptions[_0xc5dc('0x1f')];var _0x160341=crypto[_0xc5dc('0x1b')](_0x2a045d,_0x196586);var _0x23182f=_0x160341['update'](_0x574d9e,_0xc5dc('0x21'),_0xc5dc('0x20'));_0x23182f+=_0x160341[_0xc5dc('0x22')]('utf8');return _0x23182f;}; \ No newline at end of file +var _0xdc30=['utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','data','update','write','end','final','binary','close','unlink','decryptFile','createWriteStream','createDecipher','secret','createCipher'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xdc30,0x160));var _0x0dc3=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0xdc30[_0x3c5f8d];return _0x3b7beb;};'use strict';var crypto=require(_0x0dc3('0x0'));var fs=require('fs');var BPromise=require(_0x0dc3('0x1'));var _=require(_0x0dc3('0x2'));var config=require(_0x0dc3('0x3'));var logger=require(_0x0dc3('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0dc3('0x5')][_0x0dc3('0x6')],'algorithm':_0x0dc3('0x7')};const fileOptions={'algorithm':_0x0dc3('0x8')};if(config[_0x0dc3('0x9')]&&config[_0x0dc3('0x9')][_0x0dc3('0xa')]){var isSupported=isAlgorithmSupported(config[_0x0dc3('0x9')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x0dc3('0x9')][_0x0dc3('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0dc3('0xb')](',\x20');logger[_0x0dc3('0xc')](config[_0x0dc3('0x9')][_0x0dc3('0xa')],_0x0dc3('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x716ff3){return AES_SUPPORTED_RX['test'](_0x716ff3);}function getSupportedCiphers(){return crypto[_0x0dc3('0xe')]()[_0x0dc3('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xff3387){return getSupportedCiphers()[_0x0dc3('0x10')](_0xff3387)>-0x1;}function combineOptions(_0x126d60){var _0x13122d={};for(var _0x5e02a9 in fileOptions){if(fileOptions[_0x0dc3('0x11')](_0x5e02a9)){_0x13122d[_0x5e02a9]=fileOptions[_0x5e02a9];}}if(_0x126d60){for(var _0x2ba74c in _0x126d60){if(_0x126d60[_0x0dc3('0x11')](_0x2ba74c)){_0x13122d[_0x2ba74c]=_0x126d60[_0x2ba74c];}}}return _0x13122d;}exports[_0x0dc3('0x12')]=function(_0x5bfefd,_0x264f93,_0x2972d0,_0x41c1eb){return new BPromise(function(_0x11253d,_0x5edb69){_0x41c1eb=combineOptions(_0x41c1eb);var _0x4585ce=new Buffer(_0x2972d0);var _0x155d6e=fs[_0x0dc3('0x13')](_0x5bfefd);var _0xf33202=fs['createWriteStream'](_0x264f93);var _0x25902d=crypto['createCipher'](_0x41c1eb[_0x0dc3('0xa')],_0x4585ce);_0x155d6e['on'](_0x0dc3('0x14'),function(_0x4b07e4){var _0x3247ec=new Buffer(_0x25902d[_0x0dc3('0x15')](_0x4b07e4),'binary');_0xf33202[_0x0dc3('0x16')](_0x3247ec);});_0x155d6e['on'](_0x0dc3('0x17'),function(){try{var _0x149c21=new Buffer(_0x25902d[_0x0dc3('0x18')](_0x0dc3('0x19')),_0x0dc3('0x19'));_0xf33202[_0x0dc3('0x16')](_0x149c21);_0xf33202[_0x0dc3('0x17')]();_0xf33202['on'](_0x0dc3('0x1a'),function(){return _0x11253d(_0x264f93);});}catch(_0x506c63){fs[_0x0dc3('0x1b')](_0x264f93);return _0x5edb69(_0x506c63);}});});};exports[_0x0dc3('0x1c')]=function(_0x485af0,_0x587183,_0x6bbb91,_0x4635c8){return new BPromise(function(_0x5f4f53,_0x523b60){_0x4635c8=combineOptions(_0x4635c8);var _0x14b390=new Buffer(_0x6bbb91);var _0x3cccaa=fs[_0x0dc3('0x13')](_0x485af0);var _0x104e7b=fs[_0x0dc3('0x1d')](_0x587183);var _0x55cb42=crypto[_0x0dc3('0x1e')](_0x4635c8[_0x0dc3('0xa')],_0x14b390);_0x3cccaa['on'](_0x0dc3('0x14'),function(_0x25e31d){var _0x1afd78=new Buffer(_0x55cb42[_0x0dc3('0x15')](_0x25e31d),_0x0dc3('0x19'));_0x104e7b[_0x0dc3('0x16')](_0x1afd78);});_0x3cccaa['on'](_0x0dc3('0x17'),function(){try{var _0x200384=new Buffer(_0x55cb42[_0x0dc3('0x18')](_0x0dc3('0x19')),'binary');_0x104e7b['write'](_0x200384);_0x104e7b[_0x0dc3('0x17')]();_0x104e7b['on'](_0x0dc3('0x1a'),function(){return _0x5f4f53(_0x587183);});}catch(_0x249b98){fs['unlink'](_0x587183);return _0x523b60(_0x249b98);}});});};exports['encryptString']=function(_0x2ac711,_0x5c0ef2,_0x25fa35){var _0xd5748=_0x25fa35||stringOptions[_0x0dc3('0xa')];var _0x1c0121=_0x5c0ef2||stringOptions[_0x0dc3('0x1f')];var _0x470db5=crypto[_0x0dc3('0x20')](_0xd5748,_0x1c0121);var _0x3c3f96=_0x470db5[_0x0dc3('0x15')](_0x2ac711,_0x0dc3('0x21'),'base64');_0x3c3f96+=_0x470db5[_0x0dc3('0x18')](_0x0dc3('0x22'));return _0x3c3f96;};exports['decryptString']=function(_0x41af4,_0x47d647,_0x2e50cf){var _0xfc825a=_0x2e50cf||stringOptions[_0x0dc3('0xa')];var _0x28539f=_0x47d647||stringOptions['secret'];var _0xd5bae0=crypto['createDecipher'](_0xfc825a,_0x28539f);var _0x37f34c=_0xd5bae0[_0x0dc3('0x15')](_0x41af4,_0x0dc3('0x22'),_0x0dc3('0x21'));_0x37f34c+=_0xd5bae0['final']('utf8');return _0x37f34c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c6c6e48..1a3efea 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 _0x4b41=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','num','Empty','length','range','isInteger','forEach','push','query','QueryTypes','SELECT','basename','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip'];(function(_0x4e301b,_0x1d9815){var _0x597804=function(_0x376d17){while(--_0x376d17){_0x4e301b['push'](_0x4e301b['shift']());}};_0x597804(++_0x1d9815);}(_0x4b41,0xfd));var _0x14b4=function(_0x14ce14,_0x3d9dd1){_0x14ce14=_0x14ce14-0x0;var _0x20471d=_0x4b41[_0x14ce14];return _0x20471d;};'use strict';var util=require(_0x14b4('0x0'));var path=require(_0x14b4('0x1'));var _=require(_0x14b4('0x2'));var csv=require(_0x14b4('0x3'));var fs=require('fs');var BPromise=require(_0x14b4('0x4'));var zipdir=require(_0x14b4('0x5'));var rimraf=require('rimraf');var db=require(_0x14b4('0x6'))['db'];var dbH=require(_0x14b4('0x6'))['dbH'];var logger=require(_0x14b4('0x7'))(_0x14b4('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x14b4('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2223af,_0x4326eb){var _0x181cd5={'status':_0x2223af};var _0x57b7c0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4326eb){_0x181cd5[_0x14b4('0xa')]=_0x4326eb;}return db[_0x14b4('0xb')][_0x14b4('0xc')](_0x181cd5,_0x57b7c0);}function main(){var _0xf2d298=0x1388;var _0x2184fa;logger['info'](util[_0x14b4('0xd')](_0x14b4('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x14b4('0xf')][_0x14b4('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x14b4('0x11'),_0x14b4('0x12')]})[_0x14b4('0x13')](function(_0x2e594c){if(_0x2e594c){_0x2184fa=_0x2e594c;_0xf2d298=_0x2184fa['splitSizeCsv']||0x1388;}})[_0x14b4('0x13')](function(){return dbH['sequelize']['query'](util[_0x14b4('0xd')](_0x14b4('0x14'),QUERY),{'type':dbH[_0x14b4('0x15')]['QueryTypes']['SELECT']});})['then'](function(_0x5379e3){if(!_0x5379e3[0x0][_0x14b4('0x16')]){return analyticExtractedReport(_0x14b4('0x17'));}var _0x10aa95=[];var _0x44efef=0x0;if(_0x2184fa['split']){if(_0x5379e3&&_0x5379e3[_0x14b4('0x18')]){var _0x160b52=_[_0x14b4('0x19')](_0x5379e3[0x0][_0x14b4('0x16')]/_0xf2d298);var _0x19742a=Number[_0x14b4('0x1a')](_0x5379e3[0x0][_0x14b4('0x16')]/_0xf2d298)?_0x5379e3[0x0]['num']%_0xf2d298:0x0;_0x160b52[_0x14b4('0x1b')](function(_0x1da044){if(_0x1da044>0x0){_0x44efef+=_0xf2d298;}_0x10aa95[_0x14b4('0x1c')](dbH[_0x14b4('0x15')][_0x14b4('0x1d')](util[_0x14b4('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xf2d298,_0x44efef),{'type':dbH[_0x14b4('0x15')][_0x14b4('0x1e')][_0x14b4('0x1f')]}));});if(_0x19742a>0x0){_0x44efef+=_0xf2d298;_0x10aa95[_0x14b4('0x1c')](dbH[_0x14b4('0x15')]['query'](util[_0x14b4('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x19742a,_0x44efef),{'type':dbH[_0x14b4('0x15')]['QueryTypes'][_0x14b4('0x1f')]}));}}}else{_0x10aa95[_0x14b4('0x1c')](dbH['sequelize'][_0x14b4('0x1d')](QUERY,{'type':dbH[_0x14b4('0x15')][_0x14b4('0x1e')]['SELECT']}));}var _0x3aa412=path['dirname'](PATH);var _0x179c7a=path[_0x14b4('0x20')](PATH,'.csv');var _0x415391=_0x2184fa[_0x14b4('0x11')]&&_0x10aa95['length']>0x1;var _0x3a429c=[];if(!fs[_0x14b4('0x21')](path[_0x14b4('0x22')](_0x3aa412,_0x179c7a))&&_0x415391){fs['mkdirSync'](path[_0x14b4('0x22')](_0x3aa412,_0x179c7a));}return BPromise[_0x14b4('0x23')](_0x10aa95,function(_0x551a88){_0x3a429c['push'](_0x551a88);})[_0x14b4('0x13')](function(){for(var _0x5b9466=0x0;_0x5b9466<_0x3a429c[_0x14b4('0x18')];_0x5b9466+=0x1){var _0x7d8869;var _0x4d8874=_0x3a429c[_0x5b9466];if(_0x415391){_0x7d8869=path[_0x14b4('0x22')](_0x3aa412,_0x179c7a,util[_0x14b4('0xd')](_0x14b4('0x24'),_0x179c7a,_0x5b9466,_0x14b4('0x25')));}else{_0x7d8869=path['join'](_0x3aa412,util[_0x14b4('0xd')](_0x14b4('0x26'),_0x179c7a,_0x14b4('0x25')));}fs[_0x14b4('0x27')](_0x7d8869,csv(_0x4d8874));}})['then'](function(){if(_0x415391){return new Promise(function(_0x3ebda2){zipdir(path[_0x14b4('0x22')](_0x3aa412,_0x179c7a),{'saveTo':path[_0x14b4('0x22')](_0x3aa412,util[_0x14b4('0xd')](_0x14b4('0x26'),_0x179c7a,_0x14b4('0x28')))},function(_0x22bd36,_0x1e89c3){rimraf(path['join'](_0x3aa412,_0x179c7a),function(){});_0x3ebda2('zip\x20finished');});});}})[_0x14b4('0x13')](function(){logger['info'](util[_0x14b4('0xd')](_0x14b4('0x29'),EXTRACTED_REPORT_ID,_0x14b4('0x2a')));return analyticExtractedReport(_0x14b4('0x2b'),_0x415391?util[_0x14b4('0xd')](_0x14b4('0x26'),_0x179c7a,_0x415391?'zip':_0x14b4('0x25')):null);});})[_0x14b4('0x2c')](function(_0x3a3cbf){logger[_0x14b4('0x2d')](util[_0x14b4('0xd')](_0x14b4('0x2e'),EXTRACTED_REPORT_ID,_0x14b4('0x2a')),util[_0x14b4('0x2f')](_0x3a3cbf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x14b4('0x30'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd768=['path','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','split','splitSizeCsv','then','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit'];(function(_0x169c1b,_0x42d249){var _0x1b916e=function(_0x3866f7){while(--_0x3866f7){_0x169c1b['push'](_0x169c1b['shift']());}};_0x1b916e(++_0x42d249);}(_0xd768,0x90));var _0x8d76=function(_0x2d64fc,_0x42b2a7){_0x2d64fc=_0x2d64fc-0x0;var _0x2c8556=_0xd768[_0x2d64fc];return _0x2c8556;};'use strict';var util=require('util');var path=require(_0x8d76('0x0'));var _=require(_0x8d76('0x1'));var csv=require(_0x8d76('0x2'));var fs=require('fs');var BPromise=require(_0x8d76('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x8d76('0x4'))['db'];var dbH=require('../../mysqldb')[_0x8d76('0x5')];var logger=require(_0x8d76('0x6'))(_0x8d76('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x8d76('0x8')][0x2]);var QUERY=process[_0x8d76('0x8')][0x3];var PATH=process[_0x8d76('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c760d,_0x4e2686){var _0x478fe6={'status':_0x1c760d};var _0x48eb3e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e2686){_0x478fe6[_0x8d76('0x9')]=_0x4e2686;}return db[_0x8d76('0xa')][_0x8d76('0xb')](_0x478fe6,_0x48eb3e);}function main(){var _0x532b3a=0x1388;var _0x39ae82;logger[_0x8d76('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8d76('0xd')));return db[_0x8d76('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8d76('0xf'),_0x8d76('0x10')]})[_0x8d76('0x11')](function(_0x5710ee){if(_0x5710ee){_0x39ae82=_0x5710ee;_0x532b3a=_0x39ae82[_0x8d76('0x10')]||0x1388;}})[_0x8d76('0x11')](function(){return dbH[_0x8d76('0x12')]['query'](util[_0x8d76('0x13')](_0x8d76('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x8d76('0x15')]});})['then'](function(_0x484ccd){if(!_0x484ccd[0x0][_0x8d76('0x16')]){return analyticExtractedReport('Empty');}var _0x30eef7=[];var _0x412c06=0x0;if(_0x39ae82[_0x8d76('0xf')]){if(_0x484ccd&&_0x484ccd[_0x8d76('0x17')]){var _0x23099f=_['range'](_0x484ccd[0x0][_0x8d76('0x16')]/_0x532b3a);var _0x2213ea=Number[_0x8d76('0x18')](_0x484ccd[0x0][_0x8d76('0x16')]/_0x532b3a)?_0x484ccd[0x0]['num']%_0x532b3a:0x0;_0x23099f[_0x8d76('0x19')](function(_0x2f2f1a){if(_0x2f2f1a>0x0){_0x412c06+=_0x532b3a;}_0x30eef7['push'](dbH[_0x8d76('0x12')][_0x8d76('0x1a')](util[_0x8d76('0x13')](_0x8d76('0x1b'),QUERY,_0x532b3a,_0x412c06),{'type':dbH[_0x8d76('0x12')][_0x8d76('0x1c')][_0x8d76('0x15')]}));});if(_0x2213ea>0x0){_0x412c06+=_0x532b3a;_0x30eef7['push'](dbH[_0x8d76('0x12')][_0x8d76('0x1a')](util[_0x8d76('0x13')](_0x8d76('0x1b'),QUERY,_0x2213ea,_0x412c06),{'type':dbH[_0x8d76('0x12')]['QueryTypes'][_0x8d76('0x15')]}));}}}else{_0x30eef7[_0x8d76('0x1d')](dbH[_0x8d76('0x12')][_0x8d76('0x1a')](QUERY,{'type':dbH[_0x8d76('0x12')][_0x8d76('0x1c')][_0x8d76('0x15')]}));}var _0x51a349=path[_0x8d76('0x1e')](PATH);var _0x38d681=path[_0x8d76('0x1f')](PATH,_0x8d76('0x20'));var _0x47600a=_0x39ae82[_0x8d76('0xf')]&&_0x30eef7[_0x8d76('0x17')]>0x1;var _0x281f7f=[];if(!fs[_0x8d76('0x21')](path[_0x8d76('0x22')](_0x51a349,_0x38d681))&&_0x47600a){fs[_0x8d76('0x23')](path['join'](_0x51a349,_0x38d681));}return BPromise[_0x8d76('0x24')](_0x30eef7,function(_0x21c1a2){_0x281f7f['push'](_0x21c1a2);})[_0x8d76('0x11')](function(){for(var _0x498518=0x0;_0x498518<_0x281f7f[_0x8d76('0x17')];_0x498518+=0x1){var _0x924e25;var _0x36288b=_0x281f7f[_0x498518];if(_0x47600a){_0x924e25=path['join'](_0x51a349,_0x38d681,util['format'](_0x8d76('0x25'),_0x38d681,_0x498518,_0x8d76('0x26')));}else{_0x924e25=path['join'](_0x51a349,util[_0x8d76('0x13')](_0x8d76('0x27'),_0x38d681,_0x8d76('0x26')));}fs['writeFileSync'](_0x924e25,csv(_0x36288b));}})[_0x8d76('0x11')](function(){if(_0x47600a){return new Promise(function(_0x2046d7){zipdir(path[_0x8d76('0x22')](_0x51a349,_0x38d681),{'saveTo':path[_0x8d76('0x22')](_0x51a349,util['format']('%s.%s',_0x38d681,_0x8d76('0x28')))},function(_0x5bfec3,_0x17a6b5){rimraf(path[_0x8d76('0x22')](_0x51a349,_0x38d681),function(){});_0x2046d7(_0x8d76('0x29'));});});}})['then'](function(){logger[_0x8d76('0xc')](util[_0x8d76('0x13')](_0x8d76('0x2a'),EXTRACTED_REPORT_ID,_0x8d76('0xd')));return analyticExtractedReport('Completed',_0x47600a?util[_0x8d76('0x13')](_0x8d76('0x27'),_0x38d681,_0x47600a?_0x8d76('0x28'):_0x8d76('0x26')):null);});})[_0x8d76('0x2b')](function(_0x44966c){logger[_0x8d76('0xc')](util[_0x8d76('0x13')](_0x8d76('0x2c'),EXTRACTED_REPORT_ID,_0x8d76('0xd')),util[_0x8d76('0x2d')](_0x44966c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x8d76('0x2e')](function(){process[_0x8d76('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 84d750c..956efa5 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 _0x31b2=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','tableHeader','map','pick','toString','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','Arial','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','query','SELECT','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.pdf','existsSync','mkdirSync','each','flatten','createPdfKitDocument','join','pdf','%s.%s','all','zip','zip\x20finished','info'];(function(_0x2cf7ad,_0x13f929){var _0x2ca730=function(_0xd581a){while(--_0xd581a){_0x2cf7ad['push'](_0x2cf7ad['shift']());}};_0x2ca730(++_0x13f929);}(_0x31b2,0x1cb));var _0x231b=function(_0x13ed69,_0x229161){_0x13ed69=_0x13ed69-0x0;var _0x50c72e=_0x31b2[_0x13ed69];return _0x50c72e;};'use strict';var _=require(_0x231b('0x0'));var fs=require('fs');var util=require(_0x231b('0x1'));var path=require(_0x231b('0x2'));var moment=require(_0x231b('0x3'));var htmlToPdfmake=require(_0x231b('0x4'));var PdfPrinter=require(_0x231b('0x5'));var zipdir=require(_0x231b('0x6'));var rimraf=require(_0x231b('0x7'));var JSDOM=require(_0x231b('0x8'))['JSDOM'];var window=new JSDOM('')[_0x231b('0x9')];var BPromise=require(_0x231b('0xa'));var db=require(_0x231b('0xb'))['db'];var dbH=require(_0x231b('0xb'))[_0x231b('0xc')];var logger=require(_0x231b('0xd'))(_0x231b('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x231b('0xf')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x231b('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x231b('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x52de5f,_0x43b175){var _0x5695c8={'status':_0x52de5f};var _0x1a6048={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x43b175){_0x5695c8['savename']=_0x43b175;}return db[_0x231b('0x11')]['update'](_0x5695c8,_0x1a6048);}function getHeaders(_0x5ede36){return _['map'](_0x5ede36,function(_0x2344d2){return{'text':_0x2344d2,'style':_0x231b('0x12')};});}function getRows(_0x723813,_0x48d330){return _[_0x231b('0x13')](_0x48d330,function(_0x234c58){return _(_0x234c58)[_0x231b('0x14')](_0x723813)[_0x231b('0x13')](function(_0x46434b){return _0x46434b?_[_0x231b('0x15')](_0x46434b):'';})[_0x231b('0x16')]();});}function createTable(_0xb51bd9,_0x28ae63){var _0xa58ed9={'widths':_[_0x231b('0x17')](Array(_0xb51bd9[_0x231b('0x18')]),0x91),'heights':function(_0x5cc8af){return _0x5cc8af===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x13d7d6=getHeaders(_0xb51bd9);_0xa58ed9[_0x231b('0x19')][_0x231b('0x1a')](_0x13d7d6);var _0x4231f7=getRows(_0xb51bd9,_0x28ae63);_0xa58ed9[_0x231b('0x19')]=_0xa58ed9['body'][_0x231b('0x1b')](_0x4231f7);return _0xa58ed9;}function createTables(_0x2ae181){var _0xeb5ca7=[];var _0x47ad4e=_[_0x231b('0x1c')](Object[_0x231b('0x1d')](_0x2ae181[0x0]),0x5);_0x47ad4e[_0x231b('0x1e')](function(_0x1fd48c){_0xeb5ca7[_0x231b('0x1a')](createTable(_0x1fd48c,_0x2ae181));});return _0xeb5ca7;}function getPDFDocDefinition(_0x35bf91){var _0x5363d1=util[_0x231b('0x1f')](_0x231b('0x20'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x231b('0x21')])[_0x231b('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x231b('0x22')])[_0x231b('0x1f')](FORMAT));var _0x5801d0=[];for(var _0xec11e0=0x0;_0xec11e0<_0x35bf91[_0x231b('0x18')];_0xec11e0++){var _0x3534dd=[];if(_0xec11e0===0x0){_0x3534dd[_0x231b('0x1a')]({'text':_0x5363d1,'style':_0x231b('0x23')});}var _0x4149d0={'table':_0x35bf91[_0xec11e0]};if(_0xec11e0>0x0){_0x4149d0[_0x231b('0x24')]='before';_0x4149d0[_0x231b('0x25')]=[0x0,0x46,0x0,0x0];}_0x3534dd[_0x231b('0x1a')](_0x4149d0);_0x5801d0[_0x231b('0x1a')](_0x3534dd);}return{'pageSize':'A4','pageOrientation':_0x231b('0x26'),'content':_0x5801d0,'footer':function(_0x32f5b9,_0x1df6a1){return{'text':_0x32f5b9[_0x231b('0x15')]()+_0x231b('0x27')+_0x1df6a1,'style':'footer'};},'defaultStyle':{'font':_0x231b('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x231b('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1575f3){var _0x5a5235=0x1388;var _0x16de3b;if(!_0x1575f3[0x0][_0x231b('0x2a')]){return analyticExtractedReport(_0x231b('0x2b'));}return db['Setting'][_0x231b('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x231b('0x2d'),_0x231b('0x2e')]})[_0x231b('0x2f')](function(_0x23a831){if(_0x23a831){_0x16de3b=_0x23a831;_0x5a5235=_0x16de3b[_0x231b('0x2e')]||0x3e8;}})[_0x231b('0x2f')](function(){var _0x179626=[];var _0x43fd16=0x0;if(_0x16de3b['split']){if(_0x1575f3&&_0x1575f3[_0x231b('0x18')]){var _0x2d5788=_[_0x231b('0x30')](_0x1575f3[0x0][_0x231b('0x2a')]/_0x5a5235);var _0x3c1c46=Number[_0x231b('0x31')](_0x1575f3[0x0][_0x231b('0x2a')]/_0x5a5235)?_0x1575f3[0x0][_0x231b('0x2a')]%_0x5a5235:0x0;_0x2d5788['forEach'](function(_0x391570){if(_0x391570>0x0){_0x43fd16+=_0x5a5235;}_0x179626[_0x231b('0x1a')](dbH['sequelize'][_0x231b('0x32')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5a5235,_0x43fd16),{'type':dbH['sequelize']['QueryTypes'][_0x231b('0x33')]}));});if(_0x3c1c46>0x0){_0x43fd16+=_0x5a5235;_0x179626[_0x231b('0x1a')](dbH[_0x231b('0x34')][_0x231b('0x32')](util['format'](_0x231b('0x35'),QUERY,_0x3c1c46,_0x43fd16),{'type':dbH['sequelize'][_0x231b('0x36')][_0x231b('0x33')]}));}}}else{_0x179626[_0x231b('0x1a')](dbH[_0x231b('0x34')]['query'](QUERY,{'type':dbH[_0x231b('0x34')][_0x231b('0x36')][_0x231b('0x33')]}));}var _0x1248c2=path[_0x231b('0x37')](PATH);var _0x542c53=path['basename'](PATH,_0x231b('0x38'));var _0xc2d8fd=_0x16de3b[_0x231b('0x2d')]&&_0x179626[_0x231b('0x18')]>0x1;var _0x1c6b0e=[];if(!fs[_0x231b('0x39')](path['join'](_0x1248c2,_0x542c53))&&_0xc2d8fd){fs[_0x231b('0x3a')](path['join'](_0x1248c2,_0x542c53));}return BPromise[_0x231b('0x3b')](_0x179626,function(_0x58c052){_0x1c6b0e[_0x231b('0x1a')](_0x58c052);})[_0x231b('0x2f')](function(){var _0x53fcaf=[];for(var _0x5d5f4c=0x0;_0x5d5f4c<_0x1c6b0e['length'];_0x5d5f4c+=0x1){var _0x373bb4=_0x1c6b0e[_0x5d5f4c];var _0x214d9c=createTables(_[_0x231b('0x3c')](_0x373bb4));var _0x3dabe8;var _0x316305=getPDFDocDefinition(_0x214d9c);var _0x302469=getPDFPrinter();var _0x15899b=_0x302469[_0x231b('0x3d')](_0x316305);if(_0xc2d8fd){_0x3dabe8=path[_0x231b('0x3e')](_0x1248c2,_0x542c53,util[_0x231b('0x1f')]('%s%d.%s',_0x542c53,_0x5d5f4c,_0x231b('0x3f')));}else{_0x3dabe8=path[_0x231b('0x3e')](_0x1248c2,util[_0x231b('0x1f')](_0x231b('0x40'),_0x542c53,_0x231b('0x3f')));}_0x53fcaf[_0x231b('0x1a')](writePDFDocument(_0x15899b,_0x3dabe8));}return Promise[_0x231b('0x41')](_0x53fcaf);})[_0x231b('0x2f')](function(){if(_0xc2d8fd){return new Promise(function(_0x5d2ef5){zipdir(path[_0x231b('0x3e')](_0x1248c2,_0x542c53),{'saveTo':path[_0x231b('0x3e')](_0x1248c2,util['format'](_0x231b('0x40'),_0x542c53,_0x231b('0x42')))},function(){rimraf(path['join'](_0x1248c2,_0x542c53),function(){});_0x5d2ef5(_0x231b('0x43'));});});}})[_0x231b('0x2f')](function(){if(!_0xc2d8fd)return;rimraf(path[_0x231b('0x3e')](_0x1248c2,_0x542c53),function(){});})[_0x231b('0x2f')](function(){logger[_0x231b('0x44')](util['format'](_0x231b('0x45'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport('Completed',_0xc2d8fd?util[_0x231b('0x1f')](_0x231b('0x40'),_0x542c53,_0xc2d8fd?_0x231b('0x42'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x231b('0x44')](util[_0x231b('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x231b('0x46')));return db[_0x231b('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x231b('0x2f')](function(_0x3da963){EXTRACTED_REPORT=_0x3da963;return dbH[_0x231b('0x34')][_0x231b('0x32')](util[_0x231b('0x1f')](_0x231b('0x47'),QUERY),{'type':dbH['sequelize'][_0x231b('0x36')][_0x231b('0x33')]});})[_0x231b('0x2f')](extractReport)[_0x231b('0x48')](function(_0x5a631b){logger[_0x231b('0x44')](util[_0x231b('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x231b('0x46')),util[_0x231b('0x49')](_0x5a631b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x231b('0x4a'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x31bf9b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x231b('0x4b'),'bolditalics':__dirname+_0x231b('0x4c')}});return _0x31bf9b;}function getPDFDocDefinitionFromHTML(_0x20ab3a,_0x410be0){var _0x245134=util[_0x231b('0x1f')](_0x231b('0x4d'),_0x410be0[_0x231b('0x4e')],_0x410be0[_0x231b('0x4f')]);var _0x19ea6d=moment()[_0x231b('0x1f')](_0x231b('0x50'))[_0x231b('0x15')]();var _0x4e7942=htmlToPdfmake(_0x20ab3a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4e7942],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x231b('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x231b('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x231b('0x52'),'style':_0x231b('0x23')}];},'footer':function(_0x11ebb6,_0x225b05){return[{'text':util[_0x231b('0x1f')](_0x231b('0x53'),_0x245134,_0x11ebb6,_0x225b05,_0x19ea6d),'style':_0x231b('0x54')}];}};}function writePDFDocument(_0x4fddd4,_0x397b54){return new Promise(function(_0x2c7abc,_0x48d92e){var _0x20148b=_0x4fddd4['pipe'](fs[_0x231b('0x55')](_0x397b54));_0x20148b['on'](_0x231b('0x56'),function(){_0x2c7abc(_0x231b('0x56'));});_0x20148b['on']('error',function(_0x3c4987){_0x48d92e(_0x3c4987);});_0x4fddd4['end']();});}exports[_0x231b('0x57')]=function(_0x48e16e,_0x1f0faa){var _0x36dc43=getPDFPrinter();var _0xccd3ee=getPDFDocDefinitionFromHTML(_0x48e16e,_0x1f0faa);var _0x441d9c=_0x36dc43[_0x231b('0x3d')](_0xccd3ee);return writePDFDocument(_0x441d9c,_0x1f0faa[_0x231b('0x2')])[_0x231b('0x48')](function(_0x22d798){throw _0x22d798;});}; \ No newline at end of file +var _0x998f=['/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','end','catch','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','tableHeader','map','pick','toString','value','length','auto','body','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','format','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','black','right','num','Setting','find','split','splitSizePdf','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','mkdirSync','each','then','flatten','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf'];(function(_0x36ab6b,_0x1f2bc2){var _0x4eefdc=function(_0x2a1d93){while(--_0x2a1d93){_0x36ab6b['push'](_0x36ab6b['shift']());}};_0x4eefdc(++_0x1f2bc2);}(_0x998f,0x1d3));var _0xf998=function(_0x301adc,_0x23c0c9){_0x301adc=_0x301adc-0x0;var _0x40408b=_0x998f[_0x301adc];return _0x40408b;};'use strict';var _=require(_0xf998('0x0'));var fs=require('fs');var util=require(_0xf998('0x1'));var path=require(_0xf998('0x2'));var moment=require(_0xf998('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xf998('0x4'));var zipdir=require(_0xf998('0x5'));var rimraf=require(_0xf998('0x6'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0xf998('0x7')];var BPromise=require(_0xf998('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf998('0x9'))[_0xf998('0xa')];var logger=require(_0xf998('0xb'))(_0xf998('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xf998('0xd')][0x2]);var QUERY=process[_0xf998('0xd')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf998('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x517129,_0x58c3ea){var _0x4e4678={'status':_0x517129};var _0x204229={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x58c3ea){_0x4e4678[_0xf998('0xf')]=_0x58c3ea;}return db['AnalyticExtractedReport'][_0xf998('0x10')](_0x4e4678,_0x204229);}function getHeaders(_0x433180){return _['map'](_0x433180,function(_0x431ba4){return{'text':_0x431ba4,'style':_0xf998('0x11')};});}function getRows(_0x591c75,_0x43fceb){return _[_0xf998('0x12')](_0x43fceb,function(_0x252c09){return _(_0x252c09)[_0xf998('0x13')](_0x591c75)[_0xf998('0x12')](function(_0x16b03d){return _0x16b03d?_[_0xf998('0x14')](_0x16b03d):'';})[_0xf998('0x15')]();});}function createTable(_0x4635f7,_0x2a6b60){var _0x4d5449={'widths':_['fill'](Array(_0x4635f7[_0xf998('0x16')]),0x91),'heights':function(_0x20e6c7){return _0x20e6c7===0x0?_0xf998('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x124503=getHeaders(_0x4635f7);_0x4d5449[_0xf998('0x18')]['push'](_0x124503);var _0xa838e1=getRows(_0x4635f7,_0x2a6b60);_0x4d5449[_0xf998('0x18')]=_0x4d5449['body']['concat'](_0xa838e1);return _0x4d5449;}function createTables(_0x54c7ad){var _0x424482=[];var _0x2a5b01=_['chunk'](Object[_0xf998('0x19')](_0x54c7ad[0x0]),0x5);_0x2a5b01[_0xf998('0x1a')](function(_0x17c813){_0x424482[_0xf998('0x1b')](createTable(_0x17c813,_0x54c7ad));});return _0x424482;}function getPDFDocDefinition(_0x3f0bd1){var _0xaddf0=util['format'](_0xf998('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xf998('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xf998('0x1e')])['format'](FORMAT));var _0x5f0505=[];for(var _0x5ac105=0x0;_0x5ac105<_0x3f0bd1['length'];_0x5ac105++){var _0x517e73=[];if(_0x5ac105===0x0){_0x517e73['push']({'text':_0xaddf0,'style':_0xf998('0x1f')});}var _0x1150c1={'table':_0x3f0bd1[_0x5ac105]};if(_0x5ac105>0x0){_0x1150c1[_0xf998('0x20')]=_0xf998('0x21');_0x1150c1['margin']=[0x0,0x46,0x0,0x0];}_0x517e73[_0xf998('0x1b')](_0x1150c1);_0x5f0505[_0xf998('0x1b')](_0x517e73);}return{'pageSize':'A4','pageOrientation':_0xf998('0x22'),'content':_0x5f0505,'footer':function(_0x34e222,_0x336ddf){return{'text':_0x34e222['toString']()+_0xf998('0x23')+_0x336ddf,'style':_0xf998('0x24')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf998('0x25')},'footer':{'alignment':_0xf998('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4725e6){var _0x110ad0=0x1388;var _0x352427;if(!_0x4725e6[0x0][_0xf998('0x27')]){return analyticExtractedReport('Empty');}return db[_0xf998('0x28')][_0xf998('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf998('0x2a'),_0xf998('0x2b')]})['then'](function(_0xa57e90){if(_0xa57e90){_0x352427=_0xa57e90;_0x110ad0=_0x352427['splitSizePdf']||0x3e8;}})['then'](function(){var _0x274dfc=[];var _0x38e475=0x0;if(_0x352427[_0xf998('0x2a')]){if(_0x4725e6&&_0x4725e6[_0xf998('0x16')]){var _0x14e9c1=_['range'](_0x4725e6[0x0][_0xf998('0x27')]/_0x110ad0);var _0x2c4491=Number[_0xf998('0x2c')](_0x4725e6[0x0][_0xf998('0x27')]/_0x110ad0)?_0x4725e6[0x0][_0xf998('0x27')]%_0x110ad0:0x0;_0x14e9c1[_0xf998('0x1a')](function(_0x4d7b4c){if(_0x4d7b4c>0x0){_0x38e475+=_0x110ad0;}_0x274dfc[_0xf998('0x1b')](dbH['sequelize'][_0xf998('0x2d')](util[_0xf998('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x110ad0,_0x38e475),{'type':dbH[_0xf998('0x2e')][_0xf998('0x2f')][_0xf998('0x30')]}));});if(_0x2c4491>0x0){_0x38e475+=_0x110ad0;_0x274dfc[_0xf998('0x1b')](dbH['sequelize'][_0xf998('0x2d')](util[_0xf998('0x1d')](_0xf998('0x31'),QUERY,_0x2c4491,_0x38e475),{'type':dbH['sequelize'][_0xf998('0x2f')][_0xf998('0x30')]}));}}}else{_0x274dfc[_0xf998('0x1b')](dbH[_0xf998('0x2e')][_0xf998('0x2d')](QUERY,{'type':dbH[_0xf998('0x2e')][_0xf998('0x2f')]['SELECT']}));}var _0x4b2bc3=path[_0xf998('0x32')](PATH);var _0x8def=path[_0xf998('0x33')](PATH,_0xf998('0x34'));var _0x27b28b=_0x352427[_0xf998('0x2a')]&&_0x274dfc[_0xf998('0x16')]>0x1;var _0x1e7d59=[];if(!fs[_0xf998('0x35')](path[_0xf998('0x36')](_0x4b2bc3,_0x8def))&&_0x27b28b){fs[_0xf998('0x37')](path[_0xf998('0x36')](_0x4b2bc3,_0x8def));}return BPromise[_0xf998('0x38')](_0x274dfc,function(_0x28719f){_0x1e7d59['push'](_0x28719f);})[_0xf998('0x39')](function(){var _0x5caeef=[];for(var _0x1c32d6=0x0;_0x1c32d6<_0x1e7d59[_0xf998('0x16')];_0x1c32d6+=0x1){var _0x3dd6b1=_0x1e7d59[_0x1c32d6];var _0x66b023=createTables(_[_0xf998('0x3a')](_0x3dd6b1));var _0x13ee5a;var _0x3f6af6=getPDFDocDefinition(_0x66b023);var _0x11e799=getPDFPrinter();var _0x2a0c2=_0x11e799[_0xf998('0x3b')](_0x3f6af6);if(_0x27b28b){_0x13ee5a=path[_0xf998('0x36')](_0x4b2bc3,_0x8def,util['format']('%s%d.%s',_0x8def,_0x1c32d6,_0xf998('0x3c')));}else{_0x13ee5a=path['join'](_0x4b2bc3,util['format']('%s.%s',_0x8def,_0xf998('0x3c')));}_0x5caeef['push'](writePDFDocument(_0x2a0c2,_0x13ee5a));}return Promise['all'](_0x5caeef);})['then'](function(){if(_0x27b28b){return new Promise(function(_0x11c458){zipdir(path['join'](_0x4b2bc3,_0x8def),{'saveTo':path[_0xf998('0x36')](_0x4b2bc3,util[_0xf998('0x1d')](_0xf998('0x3d'),_0x8def,_0xf998('0x3e')))},function(){rimraf(path[_0xf998('0x36')](_0x4b2bc3,_0x8def),function(){});_0x11c458(_0xf998('0x3f'));});});}})[_0xf998('0x39')](function(){if(!_0x27b28b)return;rimraf(path[_0xf998('0x36')](_0x4b2bc3,_0x8def),function(){});})[_0xf998('0x39')](function(){logger[_0xf998('0x40')](util[_0xf998('0x1d')](_0xf998('0x41'),EXTRACTED_REPORT_ID,_0xf998('0x42')));return analyticExtractedReport(_0xf998('0x43'),_0x27b28b?util[_0xf998('0x1d')](_0xf998('0x3d'),_0x8def,_0x27b28b?_0xf998('0x3e'):_0xf998('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf998('0x40')](util[_0xf998('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf998('0x42')));return db[_0xf998('0x44')][_0xf998('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf998('0x39')](function(_0x2d05e1){EXTRACTED_REPORT=_0x2d05e1;return dbH[_0xf998('0x2e')][_0xf998('0x2d')](util[_0xf998('0x1d')](_0xf998('0x46'),QUERY),{'type':dbH[_0xf998('0x2e')][_0xf998('0x2f')][_0xf998('0x30')]});})[_0xf998('0x39')](extractReport)['catch'](function(_0x1bdb9e){logger[_0xf998('0x40')](util[_0xf998('0x1d')](_0xf998('0x47'),EXTRACTED_REPORT_ID,_0xf998('0x42')),util[_0xf998('0x48')](_0x1bdb9e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf998('0x49'));})[_0xf998('0x4a')](function(){process[_0xf998('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5ec2b2=new PdfPrinter({'Arial':{'normal':__dirname+_0xf998('0x4c'),'bold':__dirname+_0xf998('0x4d'),'italics':__dirname+_0xf998('0x4e'),'bolditalics':__dirname+_0xf998('0x4f')}});return _0x5ec2b2;}function getPDFDocDefinitionFromHTML(_0x548a31,_0x23d606){var _0xaa5440=util[_0xf998('0x1d')](_0xf998('0x50'),_0x23d606[_0xf998('0x51')],_0x23d606[_0xf998('0x52')]);var _0x1289f6=moment()[_0xf998('0x1d')](_0xf998('0x53'))['toString']();var _0x538f08=htmlToPdfmake(_0x548a31,{'window':window,'tableAutoSize':!![]});return{'content':[_0x538f08],'defaultStyle':{'font':_0xf998('0x54')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf998('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf998('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf998('0x55')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xf998('0x1f')}];},'footer':function(_0x2d09cc,_0x5240c8){return[{'text':util[_0xf998('0x1d')](_0xf998('0x56'),_0xaa5440,_0x2d09cc,_0x5240c8,_0x1289f6),'style':_0xf998('0x24')}];}};}function writePDFDocument(_0x3cb2b7,_0x334700){return new Promise(function(_0x4a8c57,_0x264c45){var _0x1cb2c6=_0x3cb2b7[_0xf998('0x57')](fs['createWriteStream'](_0x334700));_0x1cb2c6['on']('finish',function(){_0x4a8c57(_0xf998('0x58'));});_0x1cb2c6['on']('error',function(_0x525afe){_0x264c45(_0x525afe);});_0x3cb2b7[_0xf998('0x59')]();});}exports['createPdfFromHTML']=function(_0x3619db,_0x1ba6ae){var _0x2abbbb=getPDFPrinter();var _0xe80f41=getPDFDocDefinitionFromHTML(_0x3619db,_0x1ba6ae);var _0xd7c72a=_0x2abbbb[_0xf998('0x3b')](_0xe80f41);return writePDFDocument(_0xd7c72a,_0x1ba6ae[_0xf998('0x2')])[_0xf998('0x5a')](function(_0x251b8e){throw _0x251b8e;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d7dc0db..fcdcc76 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 _0x52ed=['find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting'];(function(_0x2bae92,_0x45b608){var _0x5adc50=function(_0xe0edb8){while(--_0xe0edb8){_0x2bae92['push'](_0x2bae92['shift']());}};_0x5adc50(++_0x45b608);}(_0x52ed,0x132));var _0xd52e=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x52ed[_0x19d24c];return _0x2fae8d;};'use strict';var util=require(_0xd52e('0x0'));var path=require(_0xd52e('0x1'));var _=require(_0xd52e('0x2'));var fs=require('fs');var json2xls=require(_0xd52e('0x3'));var BPromise=require(_0xd52e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xd52e('0x5'));var db=require(_0xd52e('0x6'))['db'];var dbH=require(_0xd52e('0x6'))[_0xd52e('0x7')];var logger=require(_0xd52e('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd52e('0x9')][0x2]);var QUERY=process[_0xd52e('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5207fd,_0x321f8d){var _0x5ae178={'status':_0x5207fd};var _0x4d124c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x321f8d){_0x5ae178[_0xd52e('0xa')]=_0x321f8d;}return db[_0xd52e('0xb')][_0xd52e('0xc')](_0x5ae178,_0x4d124c);}function main(){var _0x1d00a9=0x1388;var _0x3d857a;logger[_0xd52e('0xd')](util[_0xd52e('0xe')](_0xd52e('0xf'),EXTRACTED_REPORT_ID,_0xd52e('0x10')));return db[_0xd52e('0x11')][_0xd52e('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd52e('0x13'),_0xd52e('0x14')]})[_0xd52e('0x15')](function(_0x43a5ba){if(_0x43a5ba){_0x3d857a=_0x43a5ba;_0x1d00a9=_0x3d857a['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xd52e('0x16')][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x18'),QUERY),{'type':dbH[_0xd52e('0x16')]['QueryTypes']['SELECT']});})[_0xd52e('0x15')](function(_0x466516){if(!_0x466516[0x0][_0xd52e('0x19')]){return analyticExtractedReport(_0xd52e('0x1a'));}var _0x33230a=[];var _0x58dab2=0x0;if(_0x3d857a[_0xd52e('0x13')]){if(_0x466516&&_0x466516[_0xd52e('0x1b')]){var _0x7eeb4f=_[_0xd52e('0x1c')](_0x466516[0x0][_0xd52e('0x19')]/_0x1d00a9);var _0xdab253=Number[_0xd52e('0x1d')](_0x466516[0x0]['num']/_0x1d00a9)?_0x466516[0x0]['num']%_0x1d00a9:0x0;_0x7eeb4f['forEach'](function(_0x163b1b){if(_0x163b1b>0x0){_0x58dab2+=_0x1d00a9;}_0x33230a[_0xd52e('0x1e')](dbH['sequelize'][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x1f'),QUERY,_0x1d00a9,_0x58dab2),{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')][_0xd52e('0x21')]}));});if(_0xdab253>0x0){_0x58dab2+=_0x1d00a9;_0x33230a[_0xd52e('0x1e')](dbH[_0xd52e('0x16')][_0xd52e('0x17')](util[_0xd52e('0xe')](_0xd52e('0x1f'),QUERY,_0xdab253,_0x58dab2),{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')][_0xd52e('0x21')]}));}}}else{_0x33230a[_0xd52e('0x1e')](dbH[_0xd52e('0x16')][_0xd52e('0x17')](QUERY,{'type':dbH[_0xd52e('0x16')][_0xd52e('0x20')]['SELECT']}));}var _0x3c3599=path[_0xd52e('0x22')](PATH);var _0x3a4142=path[_0xd52e('0x23')](PATH,'.xlsx');var _0x140fa0=_0x3d857a[_0xd52e('0x13')]&&_0x33230a['length']>0x1;var _0x5dd8b0=[];if(!fs[_0xd52e('0x24')](path[_0xd52e('0x25')](_0x3c3599,_0x3a4142))&&_0x140fa0){fs[_0xd52e('0x26')](path['join'](_0x3c3599,_0x3a4142));}return BPromise[_0xd52e('0x27')](_0x33230a,function(_0x4b27bc){_0x5dd8b0[_0xd52e('0x1e')](_0x4b27bc);})[_0xd52e('0x15')](function(){for(var _0x505614=0x0;_0x505614<_0x5dd8b0[_0xd52e('0x1b')];_0x505614+=0x1){var _0x2329e4;var _0x5a8ab0=_0x5dd8b0[_0x505614];if(_0x140fa0){_0x2329e4=path['join'](_0x3c3599,_0x3a4142,util[_0xd52e('0xe')](_0xd52e('0x28'),_0x3a4142,_0x505614,'xlsx'));}else{_0x2329e4=path[_0xd52e('0x25')](_0x3c3599,util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0xd52e('0x2a')));}fs[_0xd52e('0x2b')](_0x2329e4,json2xls(_0x5a8ab0),_0xd52e('0x2c'));}})[_0xd52e('0x15')](function(){if(_0x140fa0){return new Promise(function(_0x3b0f46){zipdir(path[_0xd52e('0x25')](_0x3c3599,_0x3a4142),{'saveTo':path[_0xd52e('0x25')](_0x3c3599,util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0xd52e('0x2d')))},function(_0xaf7210,_0x515dc7){rimraf(path[_0xd52e('0x25')](_0x3c3599,_0x3a4142),function(){});_0x3b0f46(_0xd52e('0x2e'));});});}})['then'](function(){logger[_0xd52e('0xd')](util[_0xd52e('0xe')](_0xd52e('0x2f'),EXTRACTED_REPORT_ID,_0xd52e('0x10')));return analyticExtractedReport(_0xd52e('0x30'),_0x140fa0?util[_0xd52e('0xe')](_0xd52e('0x29'),_0x3a4142,_0x140fa0?_0xd52e('0x2d'):_0xd52e('0x2a')):null);});})[_0xd52e('0x31')](function(_0x2181ba){logger[_0xd52e('0xd')](util[_0xd52e('0xe')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0xd52e('0x32')](_0x2181ba,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd52e('0x33'));})[_0xd52e('0x34')](function(){process[_0xd52e('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8dd6=['exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.xlsx','existsSync','join','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally'];(function(_0x27c2b0,_0x38833){var _0x50817c=function(_0x1cd4c0){while(--_0x1cd4c0){_0x27c2b0['push'](_0x27c2b0['shift']());}};_0x50817c(++_0x38833);}(_0x8dd6,0xcd));var _0x68dd=function(_0x15d9aa,_0x2b4405){_0x15d9aa=_0x15d9aa-0x0;var _0x25f3de=_0x8dd6[_0x15d9aa];return _0x25f3de;};'use strict';var util=require(_0x68dd('0x0'));var path=require('path');var _=require(_0x68dd('0x1'));var fs=require('fs');var json2xls=require(_0x68dd('0x2'));var BPromise=require(_0x68dd('0x3'));var zipdir=require(_0x68dd('0x4'));var rimraf=require(_0x68dd('0x5'));var db=require(_0x68dd('0x6'))['db'];var dbH=require(_0x68dd('0x6'))[_0x68dd('0x7')];var logger=require('../../config/logger')(_0x68dd('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x68dd('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3df6cb,_0x2a0ef5){var _0x381b00={'status':_0x3df6cb};var _0x454dd9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a0ef5){_0x381b00[_0x68dd('0xa')]=_0x2a0ef5;}return db[_0x68dd('0xb')][_0x68dd('0xc')](_0x381b00,_0x454dd9);}function main(){var _0x986a9a=0x1388;var _0x5173df;logger['info'](util[_0x68dd('0xd')](_0x68dd('0xe'),EXTRACTED_REPORT_ID,_0x68dd('0xf')));return db['Setting'][_0x68dd('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0x3f687e){if(_0x3f687e){_0x5173df=_0x3f687e;_0x986a9a=_0x5173df[_0x68dd('0x11')]||0x1388;}})[_0x68dd('0x12')](function(){return dbH[_0x68dd('0x13')][_0x68dd('0x14')](util['format'](_0x68dd('0x15'),QUERY),{'type':dbH[_0x68dd('0x13')][_0x68dd('0x16')][_0x68dd('0x17')]});})[_0x68dd('0x12')](function(_0x2250c4){if(!_0x2250c4[0x0][_0x68dd('0x18')]){return analyticExtractedReport(_0x68dd('0x19'));}var _0x5654f3=[];var _0x5d5a97=0x0;if(_0x5173df[_0x68dd('0x1a')]){if(_0x2250c4&&_0x2250c4[_0x68dd('0x1b')]){var _0x522502=_[_0x68dd('0x1c')](_0x2250c4[0x0][_0x68dd('0x18')]/_0x986a9a);var _0xd024e7=Number[_0x68dd('0x1d')](_0x2250c4[0x0][_0x68dd('0x18')]/_0x986a9a)?_0x2250c4[0x0][_0x68dd('0x18')]%_0x986a9a:0x0;_0x522502[_0x68dd('0x1e')](function(_0x21f869){if(_0x21f869>0x0){_0x5d5a97+=_0x986a9a;}_0x5654f3['push'](dbH[_0x68dd('0x13')][_0x68dd('0x14')](util[_0x68dd('0xd')](_0x68dd('0x1f'),QUERY,_0x986a9a,_0x5d5a97),{'type':dbH[_0x68dd('0x13')]['QueryTypes'][_0x68dd('0x17')]}));});if(_0xd024e7>0x0){_0x5d5a97+=_0x986a9a;_0x5654f3[_0x68dd('0x20')](dbH[_0x68dd('0x13')][_0x68dd('0x14')](util[_0x68dd('0xd')](_0x68dd('0x1f'),QUERY,_0xd024e7,_0x5d5a97),{'type':dbH['sequelize'][_0x68dd('0x16')]['SELECT']}));}}}else{_0x5654f3['push'](dbH[_0x68dd('0x13')][_0x68dd('0x14')](QUERY,{'type':dbH[_0x68dd('0x13')][_0x68dd('0x16')]['SELECT']}));}var _0x3196b1=path[_0x68dd('0x21')](PATH);var _0x403216=path['basename'](PATH,_0x68dd('0x22'));var _0x49197e=_0x5173df[_0x68dd('0x1a')]&&_0x5654f3[_0x68dd('0x1b')]>0x1;var _0x3acc19=[];if(!fs[_0x68dd('0x23')](path[_0x68dd('0x24')](_0x3196b1,_0x403216))&&_0x49197e){fs['mkdirSync'](path[_0x68dd('0x24')](_0x3196b1,_0x403216));}return BPromise['each'](_0x5654f3,function(_0x4b9fab){_0x3acc19['push'](_0x4b9fab);})[_0x68dd('0x12')](function(){for(var _0x10d3b0=0x0;_0x10d3b0<_0x3acc19[_0x68dd('0x1b')];_0x10d3b0+=0x1){var _0x3e66d5;var _0x1b1299=_0x3acc19[_0x10d3b0];if(_0x49197e){_0x3e66d5=path['join'](_0x3196b1,_0x403216,util[_0x68dd('0xd')](_0x68dd('0x25'),_0x403216,_0x10d3b0,'xlsx'));}else{_0x3e66d5=path[_0x68dd('0x24')](_0x3196b1,util[_0x68dd('0xd')](_0x68dd('0x26'),_0x403216,_0x68dd('0x27')));}fs[_0x68dd('0x28')](_0x3e66d5,json2xls(_0x1b1299),_0x68dd('0x29'));}})['then'](function(){if(_0x49197e){return new Promise(function(_0x318df3){zipdir(path[_0x68dd('0x24')](_0x3196b1,_0x403216),{'saveTo':path[_0x68dd('0x24')](_0x3196b1,util[_0x68dd('0xd')]('%s.%s',_0x403216,_0x68dd('0x2a')))},function(_0x326f81,_0x3ed9f5){rimraf(path[_0x68dd('0x24')](_0x3196b1,_0x403216),function(){});_0x318df3(_0x68dd('0x2b'));});});}})[_0x68dd('0x12')](function(){logger['info'](util['format'](_0x68dd('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x68dd('0x2d'),_0x49197e?util[_0x68dd('0xd')](_0x68dd('0x26'),_0x403216,_0x49197e?_0x68dd('0x2a'):_0x68dd('0x27')):null);});})['catch'](function(_0x576a07){logger[_0x68dd('0x2e')](util[_0x68dd('0xd')](_0x68dd('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x576a07,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x68dd('0x30'));})[_0x68dd('0x31')](function(){process[_0x68dd('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8780f02..989ea2b 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 _0x4eb4=['CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','type','format','CDR(type)=%s','inbound','push','CDR(routeid)=','context','VoiceExtensionId','outbound','extension','Set','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:'];(function(_0x3d351e,_0x5c8df4){var _0x19fd24=function(_0x1ece73){while(--_0x1ece73){_0x3d351e['push'](_0x3d351e['shift']());}};_0x19fd24(++_0x5c8df4);}(_0x4eb4,0x145));var _0x44eb=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x4eb4[_0x333767];return _0x51661b;};'use strict';var _=require(_0x44eb('0x0'));var util=require(_0x44eb('0x1'));function rewrite(_0x2c7469,_0x5255b5){var _0x3032eb=this;return _0x2c7469[_0x44eb('0x2')][_0x44eb('0x3')][_0x44eb('0x4')]({'raw':!![]})[_0x44eb('0x5')](function(_0x34c2d5){_0x3032eb[_0x44eb('0x6')]=_0x34c2d5;return _0x2c7469[_0x44eb('0x2')]['VoiceExtension'][_0x44eb('0x4')]({'where':{'IntervalId':_0x5255b5[_0x44eb('0x7')]},'raw':!![]});})[_0x44eb('0x5')](function(_0x29bca5){return _0x2c7469['models']['VoiceExtension'][_0x44eb('0x4')]({'where':{'exten':{'$in':_[_0x44eb('0x8')](_['map'](_0x29bca5,_0x44eb('0x9')))}},'order':[{'raw':_0x44eb('0xa')}],'raw':!![]});})[_0x44eb('0x5')](function(_0x223d42){var _0x3f16ad=_[_0x44eb('0xb')](_0x223d42,{'priority':'1'});var _0x2ec722=_['filter'](_0x223d42,{'isApp':0x1});var _0x29a915=_[_0x44eb('0xc')](_0x2ec722,_0x44eb('0x9'));var _0x3df56a=[_0x44eb('0xd'),_0x44eb('0xe')];var _0x324bd0=[];var _0x451376=[];for(var _0x42fd97 in _0x29a915){if(_0x29a915[_0x44eb('0xf')](_0x42fd97)){_0x3032eb[_0x44eb('0x10')]=0x2;_0x3032eb[_0x44eb('0x11')]=[];_0x3032eb['extension']=_['find'](_0x3f16ad,{'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')]});_0x3032eb[_0x44eb('0x11')]['push']({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':'Set','appdata':util[_0x44eb('0x13')](_0x44eb('0x14'),_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')]),'context':_0x29a915[_0x42fd97][0x0]['context'],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0]['VoiceExtensionId']});if(_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')]===_0x44eb('0x15')){_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0]['type'],'app':'Set','appdata':_0x44eb('0x17')+_0x29a915[_0x42fd97][0x0]['VoiceExtensionId'],'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});}else if(_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')]===_0x44eb('0x1a')){if(_0x3032eb[_0x44eb('0x1b')]){_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':_0x44eb('0x1c'),'appdata':'CDR(destination)='+(_0x3032eb[_0x44eb('0x1b')][_0x44eb('0x1d')]?_0x44eb('0x1e')+_0x3032eb[_0x44eb('0x1b')][_0x44eb('0x1d')]+'}':'${EXTEN}'),'context':_0x29a915[_0x42fd97][0x0]['context'],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});}_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0]['type'],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x17')+_0x29a915[_0x42fd97][0x0]['VoiceExtensionId'],'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0]['exten'],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});var _0x4cb193=_0x3032eb[_0x44eb('0x10')]++;_0x3032eb[_0x44eb('0x11')]['push']({'type':_0x29a915[_0x42fd97][0x0]['type'],'app':_0x44eb('0x1f'),'appdata':_0x44eb('0x20')+(_0x4cb193+0x2)+_0x44eb('0x21')+(_0x4cb193+0x1)+')','context':_0x29a915[_0x42fd97][0x0]['context'],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x4cb193,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});if(_0x3032eb[_0x44eb('0x1b')]){_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':_0x44eb('0x1c'),'appdata':_0x3032eb[_0x44eb('0x1b')][_0x44eb('0x1d')]?_0x44eb('0x22')+_0x3032eb['extension'][_0x44eb('0x1d')]+'}':_0x44eb('0x23'),'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});}_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x24')+_0x29a915[_0x42fd97][0x0]['VoiceExtensionId'],'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});if(_0x3032eb['extension']&&_0x3032eb[_0x44eb('0x1b')][_0x44eb('0xf')](_0x44eb('0x25'))&&_0x3032eb['extension'][_0x44eb('0x25')]!==_0x44eb('0x26')){_0x3032eb['extensions']['push']({'type':_0x29a915[_0x42fd97][0x0]['type'],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x27'),'context':_0x29a915[_0x42fd97][0x0]['context'],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb['priority']++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});_0x3032eb['extensions'][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3032eb['extension'][_0x44eb('0x25')]||'wav','context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});}}_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x28'),'context':_0x29a915[_0x42fd97][0x0]['context'],'exten':_0x29a915[_0x42fd97][0x0]['exten'],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0]['VoiceExtensionId']});_0x3032eb['extensions']['push']({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':'Set','appdata':_0x44eb('0x29'),'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'priority':_0x3032eb[_0x44eb('0x10')]++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});_0x3032eb[_0x44eb('0x11')]['push']({'type':_0x29a915[_0x42fd97][0x0][_0x44eb('0x12')],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x2a'),'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'exten':_0x29a915[_0x42fd97][0x0]['exten'],'priority':_0x3032eb['priority']++,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0]['VoiceExtensionId']});for(var _0x316195=0x0,_0x53d9ba=0x0;_0x316195<_0x29a915[_0x42fd97][_0x44eb('0x2b')];_0x316195+=0x1,_0x53d9ba=0x0){var _0x49855b=_0x29a915[_0x42fd97][_0x316195];if(_0x49855b['type']){_0x49855b['type']=_0x49855b[_0x44eb('0x12')]['toLowerCase']();}var _0x39e184=[];var _0x3859e7=[];delete _0x49855b['id'];delete _0x49855b[_0x44eb('0x2c')];delete _0x49855b[_0x44eb('0x2d')];var _0x54513b=_0x49855b[_0x44eb('0x2e')]!==_0x44eb('0x2f')?[_0x49855b[_0x44eb('0x2e')]]:_0x49855b['IntervalId']?_['map'](_['filter'](_0x3032eb[_0x44eb('0x6')],{'IntervalId':_0x49855b['IntervalId']}),_0x44eb('0x2e')):[];if(_0x49855b[_0x44eb('0xf')](_0x44eb('0x30'))){if(_0x49855b['tag']&&_0x49855b[_0x44eb('0x30')]!=='--'){_0x39e184['push']({'type':_0x49855b['type'],'app':'Set','appdata':'CDR(tag)='+_0x49855b[_0x44eb('0x30')],'context':_0x49855b[_0x44eb('0x18')],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b[_0x44eb('0x2b')]+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});}}if(_0x49855b['type']==='outbound'&&_0x49855b['hasOwnProperty'](_0x44eb('0x31'))){if(_0x49855b[_0x44eb('0x31')]){_0x39e184[_0x44eb('0x16')]({'type':_0x49855b['type'],'app':_0x44eb('0x1f'),'appdata':_0x44eb('0x32')+_0x49855b['callerID']+')','context':_0x49855b[_0x44eb('0x18')],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b[_0x44eb('0x2b')]+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});}else{_0x39e184['push']({'type':_0x49855b['type'],'app':_0x44eb('0x1f'),'appdata':_0x44eb('0x33'),'context':_0x49855b['context'],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b['length']+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});}}if(_0x49855b[_0x44eb('0xf')](_0x44eb('0x34'))){if(_0x3df56a[_0x44eb('0x35')](_0x49855b[_0x44eb('0x36')][_0x44eb('0x37')]())>=0x0&&_0x49855b[_0x44eb('0x38')]!==_0x44eb('0x39')){if(_0x49855b[_0x44eb('0x34')]){_0x39e184['push']({'type':_0x49855b[_0x44eb('0x12')],'app':_0x44eb('0x1f'),'appdata':_0x44eb('0x3a'),'context':_0x49855b['context'],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b[_0x44eb('0x2b')]+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});_0x39e184[_0x44eb('0x16')]({'type':_0x49855b['type'],'app':'Set','appdata':_0x44eb('0x3b'),'context':_0x49855b[_0x44eb('0x18')],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b['length']+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b['VoiceExtensionId']});}else{_0x39e184[_0x44eb('0x16')]({'type':_0x49855b['type'],'app':_0x44eb('0x1f'),'appdata':_0x44eb('0x3c'),'context':_0x49855b[_0x44eb('0x18')],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b['length']+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});_0x39e184[_0x44eb('0x16')]({'type':_0x49855b['type'],'app':_0x44eb('0x1c'),'appdata':_0x44eb('0x3d'),'context':_0x49855b['context'],'exten':_0x49855b[_0x44eb('0x9')],'priority':_0x54513b[_0x44eb('0x2b')]+_0x3032eb[_0x44eb('0x10')]+_0x53d9ba++,'VoiceExtensionId':_0x49855b[_0x44eb('0x19')]});}}}for(var _0x53c720=0x0;_0x53c720<_0x54513b[_0x44eb('0x2b')];_0x53c720+=0x1){var _0x1a88f3=_0x3032eb[_0x44eb('0x10')]+_0x54513b[_0x44eb('0x2b')];var _0x563071=_0x53c720===_0x54513b['length']-0x1?_0x3032eb[_0x44eb('0x10')]+_0x39e184['length']+_0x3859e7[_0x44eb('0x2b')]+0x2:_0x3032eb[_0x44eb('0x10')]+_0x53c720+0x1;_0x39e184['splice'](_0x53c720,0x0,{'type':_0x49855b['type'],'app':_0x44eb('0x3e'),'appdata':_0x54513b[_0x53c720]+'?'+_0x49855b['context']+',${EXTEN},'+_0x1a88f3+':'+_0x49855b[_0x44eb('0x18')]+_0x44eb('0x3f')+_0x563071,'exten':_0x49855b[_0x44eb('0x9')],'context':_0x49855b[_0x44eb('0x18')],'priority':_0x3032eb['priority']+_0x53c720,'VoiceExtensionId':_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]});}_0x49855b['priority']=_0x39e184[_0x44eb('0x2b')]?_[_0x44eb('0x40')](_0x39e184)[_0x44eb('0x10')]+0x1:_0x3032eb['priority'];_0x3032eb[_0x44eb('0x10')]=(_0x3859e7[_0x44eb('0x2b')]?_[_0x44eb('0x40')](_0x3859e7)[_0x44eb('0x10')]:_0x49855b[_0x44eb('0x10')])+0x1;_0x3032eb[_0x44eb('0x11')]=_[_0x44eb('0x41')](_0x3032eb[_0x44eb('0x11')],_0x39e184,[_0x49855b],_0x3859e7);}_0x3032eb[_0x44eb('0x11')][_0x44eb('0x16')]({'type':_0x29a915[_0x42fd97][0x0]['type'],'app':_0x44eb('0x42'),'exten':_0x29a915[_0x42fd97][0x0][_0x44eb('0x9')],'context':_0x29a915[_0x42fd97][0x0][_0x44eb('0x18')],'priority':_0x3032eb[_0x44eb('0x10')],'VoiceExtensionId':_0x29a915[_0x42fd97][0x0]['VoiceExtensionId']});_0x324bd0[_0x44eb('0x16')](_0x29a915[_0x42fd97][0x0][_0x44eb('0x19')]);_0x451376=_[_0x44eb('0x41')](_0x451376,_0x3032eb[_0x44eb('0x11')]);}}return _0x2c7469[_0x44eb('0x43')](function(_0x3f3f4f){return _0x2c7469['models'][_0x44eb('0x44')][_0x44eb('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x324bd0}},'transaction':_0x3f3f4f})[_0x44eb('0x5')](function(_0x37a6e4){return _0x2c7469[_0x44eb('0x2')][_0x44eb('0x44')]['bulkCreate'](_['sortBy'](_0x451376,_0x44eb('0x10')),{'transaction':_0x3f3f4f});});});})['catch'](function(_0x362827){console[_0x44eb('0x46')](_0x362827);});}exports[_0x44eb('0x47')]=rewrite; \ No newline at end of file +var _0x1f7b=['inbound','push','CDR(routeid)=','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','*,*,*,*','map','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','models','Interval','VoiceExtension','IntervalId','then','findAll','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','extension','find','Set','format','type','VoiceExtensionId'];(function(_0xf884ef,_0x5f3f34){var _0x55fa61=function(_0x200290){while(--_0x200290){_0xf884ef['push'](_0xf884ef['shift']());}};_0x55fa61(++_0x5f3f34);}(_0x1f7b,0x100));var _0xb1f7=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x1f7b[_0xbd77c1];return _0x47fa83;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x19cbb2,_0x4cd83b){var _0x300790=this;return _0x19cbb2[_0xb1f7('0x0')][_0xb1f7('0x1')]['findAll']({'raw':!![]})['then'](function(_0x473c1f){_0x300790['intervals']=_0x473c1f;return _0x19cbb2[_0xb1f7('0x0')][_0xb1f7('0x2')]['findAll']({'where':{'IntervalId':_0x4cd83b[_0xb1f7('0x3')]},'raw':!![]});})[_0xb1f7('0x4')](function(_0x3640bb){return _0x19cbb2[_0xb1f7('0x0')][_0xb1f7('0x2')][_0xb1f7('0x5')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x3640bb,_0xb1f7('0x6')))}},'order':[{'raw':_0xb1f7('0x7')}],'raw':!![]});})[_0xb1f7('0x4')](function(_0x5d65f0){var _0x3d296f=_[_0xb1f7('0x8')](_0x5d65f0,{'priority':'1'});var _0x4c9146=_['filter'](_0x5d65f0,{'isApp':0x1});var _0x43b31a=_[_0xb1f7('0x9')](_0x4c9146,_0xb1f7('0x6'));var _0x21bc3f=[_0xb1f7('0xa'),_0xb1f7('0xb')];var _0x3e970c=[];var _0x4e06d3=[];for(var _0x24a0bf in _0x43b31a){if(_0x43b31a['hasOwnProperty'](_0x24a0bf)){_0x300790[_0xb1f7('0xc')]=0x2;_0x300790[_0xb1f7('0xd')]=[];_0x300790[_0xb1f7('0xe')]=_[_0xb1f7('0xf')](_0x3d296f,{'exten':_0x43b31a[_0x24a0bf][0x0]['exten']});_0x300790[_0xb1f7('0xd')]['push']({'type':_0x43b31a[_0x24a0bf][0x0]['type'],'app':_0xb1f7('0x10'),'appdata':util[_0xb1f7('0x11')]('CDR(type)=%s',_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')]),'context':_0x43b31a[_0x24a0bf][0x0]['context'],'exten':_0x43b31a[_0x24a0bf][0x0]['exten'],'priority':_0x300790['priority']++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});if(_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')]===_0xb1f7('0x14')){_0x300790['extensions'][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x16')+_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')],'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790['priority']++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});}else if(_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')]===_0xb1f7('0x18')){if(_0x300790['extension']){_0x300790['extensions']['push']({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x19')+(_0x300790[_0xb1f7('0xe')][_0xb1f7('0x1a')]?_0xb1f7('0x1b')+_0x300790[_0xb1f7('0xe')][_0xb1f7('0x1a')]+'}':_0xb1f7('0x1c')),'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});}_0x300790['extensions']['push']({'type':_0x43b31a[_0x24a0bf][0x0]['type'],'app':_0xb1f7('0x10'),'appdata':'CDR(routeid)='+_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')],'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0]['exten'],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});var _0x1fd794=_0x300790[_0xb1f7('0xc')]++;_0x300790[_0xb1f7('0xd')]['push']({'type':_0x43b31a[_0x24a0bf][0x0]['type'],'app':_0xb1f7('0x1d'),'appdata':_0xb1f7('0x1e')+(_0x1fd794+0x2)+_0xb1f7('0x1f')+(_0x1fd794+0x1)+')','context':_0x43b31a[_0x24a0bf][0x0]['context'],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x1fd794,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});if(_0x300790[_0xb1f7('0xe')]){_0x300790[_0xb1f7('0xd')][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0x300790[_0xb1f7('0xe')][_0xb1f7('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x300790[_0xb1f7('0xe')][_0xb1f7('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});}_0x300790['extensions'][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':'Set','appdata':_0xb1f7('0x20')+_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')],'context':_0x43b31a[_0x24a0bf][0x0]['context'],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});if(_0x300790[_0xb1f7('0xe')]&&_0x300790[_0xb1f7('0xe')][_0xb1f7('0x21')](_0xb1f7('0x22'))&&_0x300790[_0xb1f7('0xe')]['recordingFormat']!=='none'){_0x300790[_0xb1f7('0xd')][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0]['type'],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x23'),'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790['priority']++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});_0x300790['extensions'][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0]['type'],'app':_0xb1f7('0x10'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x300790['extension'][_0xb1f7('0x22')]||'wav','context':_0x43b31a[_0x24a0bf][0x0]['context'],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});}}_0x300790[_0xb1f7('0xd')][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x24'),'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790['priority']++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]});_0x300790[_0xb1f7('0xd')][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x6')],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0]['VoiceExtensionId']});_0x300790[_0xb1f7('0xd')]['push']({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x25'),'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'exten':_0x43b31a[_0x24a0bf][0x0]['exten'],'priority':_0x300790[_0xb1f7('0xc')]++,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0]['VoiceExtensionId']});for(var _0x17be6c=0x0,_0xb78cea=0x0;_0x17be6c<_0x43b31a[_0x24a0bf][_0xb1f7('0x26')];_0x17be6c+=0x1,_0xb78cea=0x0){var _0x27d03f=_0x43b31a[_0x24a0bf][_0x17be6c];if(_0x27d03f[_0xb1f7('0x12')]){_0x27d03f[_0xb1f7('0x12')]=_0x27d03f['type']['toLowerCase']();}var _0x168a3c=[];var _0xb82158=[];delete _0x27d03f['id'];delete _0x27d03f[_0xb1f7('0x27')];delete _0x27d03f['updatedAt'];var _0x7e7f6d=_0x27d03f['interval']!==_0xb1f7('0x28')?[_0x27d03f['interval']]:_0x27d03f['IntervalId']?_[_0xb1f7('0x29')](_['filter'](_0x300790['intervals'],{'IntervalId':_0x27d03f[_0xb1f7('0x3')]}),_0xb1f7('0x2a')):[];if(_0x27d03f[_0xb1f7('0x21')](_0xb1f7('0x2b'))){if(_0x27d03f[_0xb1f7('0x2b')]&&_0x27d03f['tag']!=='--'){_0x168a3c[_0xb1f7('0x15')]({'type':_0x27d03f[_0xb1f7('0x12')],'app':'Set','appdata':_0xb1f7('0x2c')+_0x27d03f[_0xb1f7('0x2b')],'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f[_0xb1f7('0x13')]});}}if(_0x27d03f[_0xb1f7('0x12')]===_0xb1f7('0x18')&&_0x27d03f[_0xb1f7('0x21')](_0xb1f7('0x2d'))){if(_0x27d03f[_0xb1f7('0x2d')]){_0x168a3c['push']({'type':_0x27d03f['type'],'app':'ExecIf','appdata':_0xb1f7('0x2e')+_0x27d03f[_0xb1f7('0x2d')]+')','context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f[_0xb1f7('0x13')]});}else{_0x168a3c[_0xb1f7('0x15')]({'type':_0x27d03f['type'],'app':_0xb1f7('0x1d'),'appdata':_0xb1f7('0x2f'),'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f[_0xb1f7('0x13')]});}}if(_0x27d03f[_0xb1f7('0x21')](_0xb1f7('0x30'))){if(_0x21bc3f[_0xb1f7('0x31')](_0x27d03f[_0xb1f7('0x32')]['toLowerCase']())>=0x0&&_0x27d03f[_0xb1f7('0x33')]!==_0xb1f7('0x34')){if(_0x27d03f[_0xb1f7('0x30')]){_0x168a3c[_0xb1f7('0x15')]({'type':_0x27d03f[_0xb1f7('0x12')],'app':'ExecIf','appdata':_0xb1f7('0x35'),'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f['VoiceExtensionId']});_0x168a3c['push']({'type':_0x27d03f['type'],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x36'),'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f['exten'],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f['VoiceExtensionId']});}else{_0x168a3c[_0xb1f7('0x15')]({'type':_0x27d03f['type'],'app':_0xb1f7('0x1d'),'appdata':_0xb1f7('0x37'),'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f['VoiceExtensionId']});_0x168a3c[_0xb1f7('0x15')]({'type':_0x27d03f[_0xb1f7('0x12')],'app':_0xb1f7('0x10'),'appdata':_0xb1f7('0x38'),'context':_0x27d03f[_0xb1f7('0x17')],'exten':_0x27d03f[_0xb1f7('0x6')],'priority':_0x7e7f6d[_0xb1f7('0x26')]+_0x300790[_0xb1f7('0xc')]+_0xb78cea++,'VoiceExtensionId':_0x27d03f[_0xb1f7('0x13')]});}}}for(var _0x9e4dff=0x0;_0x9e4dff<_0x7e7f6d[_0xb1f7('0x26')];_0x9e4dff+=0x1){var _0xfe7066=_0x300790[_0xb1f7('0xc')]+_0x7e7f6d[_0xb1f7('0x26')];var _0xdf77e2=_0x9e4dff===_0x7e7f6d[_0xb1f7('0x26')]-0x1?_0x300790[_0xb1f7('0xc')]+_0x168a3c[_0xb1f7('0x26')]+_0xb82158[_0xb1f7('0x26')]+0x2:_0x300790['priority']+_0x9e4dff+0x1;_0x168a3c[_0xb1f7('0x39')](_0x9e4dff,0x0,{'type':_0x27d03f[_0xb1f7('0x12')],'app':'GotoIfTime','appdata':_0x7e7f6d[_0x9e4dff]+'?'+_0x27d03f['context']+',${EXTEN},'+_0xfe7066+':'+_0x27d03f[_0xb1f7('0x17')]+_0xb1f7('0x3a')+_0xdf77e2,'exten':_0x27d03f[_0xb1f7('0x6')],'context':_0x27d03f[_0xb1f7('0x17')],'priority':_0x300790['priority']+_0x9e4dff,'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0]['VoiceExtensionId']});}_0x27d03f['priority']=_0x168a3c[_0xb1f7('0x26')]?_['last'](_0x168a3c)[_0xb1f7('0xc')]+0x1:_0x300790[_0xb1f7('0xc')];_0x300790[_0xb1f7('0xc')]=(_0xb82158[_0xb1f7('0x26')]?_[_0xb1f7('0x3b')](_0xb82158)[_0xb1f7('0xc')]:_0x27d03f[_0xb1f7('0xc')])+0x1;_0x300790['extensions']=_['concat'](_0x300790[_0xb1f7('0xd')],_0x168a3c,[_0x27d03f],_0xb82158);}_0x300790['extensions'][_0xb1f7('0x15')]({'type':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x12')],'app':_0xb1f7('0x3c'),'exten':_0x43b31a[_0x24a0bf][0x0]['exten'],'context':_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x17')],'priority':_0x300790[_0xb1f7('0xc')],'VoiceExtensionId':_0x43b31a[_0x24a0bf][0x0]['VoiceExtensionId']});_0x3e970c['push'](_0x43b31a[_0x24a0bf][0x0][_0xb1f7('0x13')]);_0x4e06d3=_[_0xb1f7('0x3d')](_0x4e06d3,_0x300790[_0xb1f7('0xd')]);}}return _0x19cbb2[_0xb1f7('0x3e')](function(_0x4d5b00){return _0x19cbb2[_0xb1f7('0x0')][_0xb1f7('0x2')][_0xb1f7('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x3e970c}},'transaction':_0x4d5b00})[_0xb1f7('0x4')](function(_0x5f2ba0){return _0x19cbb2[_0xb1f7('0x0')][_0xb1f7('0x2')][_0xb1f7('0x40')](_[_0xb1f7('0x41')](_0x4e06d3,_0xb1f7('0xc')),{'transaction':_0x4d5b00});});});})[_0xb1f7('0x42')](function(_0x1c824b){console[_0xb1f7('0x43')](_0x1c824b);});}exports[_0xb1f7('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 17ed385..f539c35 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 _0x9095=['firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','create','then','push','pick','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','ListId','createdAt','from','cm_contacts','where','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','str','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','findAll','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x9095,0x12d));var _0x5909=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x9095[_0x4fdcc0];return _0xc0ce94;};'use strict';var BPromise=require(_0x5909('0x0'));var util=require(_0x5909('0x1'));var _=require(_0x5909('0x2'));var fs=require('fs');var squel=require(_0x5909('0x3'));var Papa=require(_0x5909('0x4'));var Redis=require('ioredis');var db=require(_0x5909('0x5'))['db'];var config=require(_0x5909('0x6'));var logger=require(_0x5909('0x7'))(_0x5909('0x8'));config[_0x5909('0x9')]=_[_0x5909('0xa')](config['redis'],{'host':_0x5909('0xb'),'port':0x18eb});var socket=require(_0x5909('0xc'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x5909('0xd')](socket);try{if(!process[_0x5909('0xe')][0x2]||process[_0x5909('0xe')][0x2]===_0x5909('0xf')||process[_0x5909('0xe')][0x2]===_0x5909('0x10')){throw new Error(_0x5909('0x11'));}var FILEPATH=process[_0x5909('0xe')][0x2];if(!process[_0x5909('0xe')][0x3]||process['argv'][0x3]===_0x5909('0xf')||process[_0x5909('0xe')][0x3]===_0x5909('0x10')||!process[_0x5909('0xe')][0x4]||process[_0x5909('0xe')][0x4]===_0x5909('0xf')||process[_0x5909('0xe')][0x4]==='null'){throw new Error(_0x5909('0x12'));}var FIELDS=_[_0x5909('0x13')](process[_0x5909('0xe')][0x3][_0x5909('0x14')](','),process[_0x5909('0xe')][0x4][_0x5909('0x14')](','));if(!process['argv'][0x5]||process[_0x5909('0xe')][0x5]===_0x5909('0xf')||process['argv'][0x5]===_0x5909('0x10')){throw new Error(_0x5909('0x15'));}var LISTID=process[_0x5909('0xe')][0x5];var COMPANYID=process[_0x5909('0xe')][0x6]&&process[_0x5909('0xe')][0x6]!==_0x5909('0xf')&&process[_0x5909('0xe')][0x6]!=='null'?process[_0x5909('0xe')][0x6]:null;var DUPLICATES=process[_0x5909('0xe')][0x7]&&process[_0x5909('0xe')][0x7]!==_0x5909('0xf')&&process[_0x5909('0xe')][0x7]!=='null'?process[_0x5909('0xe')][0x7]:null;if(!process[_0x5909('0xe')][0x8]||process['argv'][0x8]===_0x5909('0xf')||process[_0x5909('0xe')][0x8]===_0x5909('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x44eca2){logger[_0x5909('0x16')](_0x44eca2);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(_0x40e7a1,_0x58df3a,_0x24ce68,_0x35c13a){var _0x1df2f6={'message':_0x58df3a};_0x1df2f6[_0x40e7a1]=!![];if(_0x24ce68){_0x1df2f6[_0x5909('0x17')]=_0x24ce68;}if(_0x35c13a){_0x1df2f6[_0x5909('0x18')]=_0x35c13a;}return _0x1df2f6;}function isEmail(_0xfb132d){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))*$/[_0x5909('0x19')](_0xfb132d);}function checkRow(_0x12f027,_0x13f3d7,_0x369143){return new BPromise(function(_0x375f84,_0x108184){if(_[_0x5909('0x1a')](_0x12f027)){return _0x108184(handleCheckRowError(_0x5909('0x16'),_0x5909('0x1b'),null,_0x369143));}if(_0x12f027[_0x5909('0x1c')]&&_0x12f027[_0x5909('0x1c')][_0x5909('0x1d')]){var _0x2bb6a1=_[_0x5909('0x1e')](_0x12f027[_0x5909('0x1c')],_0x5909('0x1f'))['join'](';');return _0x108184(handleCheckRowError(_0x5909('0x16'),_0x2bb6a1,null,_0x369143));}var _0x124f3c={};for(var _0xa0de62 in FIELDS){if(FIELDS[_0x5909('0x20')](_0xa0de62)&&FIELDS[_0xa0de62]){_0x124f3c[_0xa0de62]=_0x12f027[_0x5909('0x21')][0x0][FIELDS[_0xa0de62]]||_0x12f027[_0x5909('0x21')][0x0]['\ufeff'+FIELDS[_0xa0de62]];}}if(!_0x124f3c[_0x5909('0x22')]){return _0x108184(handleCheckRowError('error',_0x5909('0x23'),null,_0x369143));}if(!_0x124f3c[_0x5909('0x24')]){return _0x108184(handleCheckRowError(_0x5909('0x16'),_0x5909('0x25'),null,_0x369143));}if(_0x124f3c[_0x5909('0x26')]){var _0x15bc78=moment(_0x124f3c[_0x5909('0x26')],_0x5909('0x27'));if(!_0x15bc78[_0x5909('0x28')]()){return _0x108184(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x369143));}}if(_0x124f3c['email']){if(!isEmail(_0x124f3c['email'])){return _0x108184(handleCheckRowError(_0x5909('0x16'),_0x5909('0x29'),null,_0x369143));}}_0x124f3c['ListId']=LISTID;_0x124f3c[_0x5909('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5909('0x1d')]&&_0x13f3d7){var _0x10d255={};for(var _0x427e2c=0x0,_0x384c60=DUPLICATES['length'];_0x427e2c<_0x384c60;_0x427e2c+=0x1){_0x10d255[DUPLICATES[_0x427e2c]]=_0x124f3c[DUPLICATES[_0x427e2c]];}var _0x550174=_[_0x5909('0x2b')](_0x13f3d7,_0x10d255);if(_0x550174){return _0x108184(handleCheckRowError(_0x5909('0x2c'),'Duplicate\x20Contact',_0x550174,_0x369143));}}return db['CmContact'][_0x5909('0x2d')](_0x124f3c,{'raw':!![],'hooks':![],'fields':_['keys'](_0x124f3c)})[_0x5909('0x2e')](function(_0x286687){if(DUPLICATES&&DUPLICATES['length']&&_0x13f3d7){_0x13f3d7[_0x5909('0x2f')](_[_0x5909('0x30')](_0x124f3c,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x286687['id'];return _0x375f84();})['catch'](function(_0x10c8db){return _0x108184(handleCheckRowError(_0x5909('0x16'),'Error\x20while\x20creating\x20contact:\x20'+(_0x10c8db['message']||JSON[_0x5909('0x31')](_0x10c8db)),null,_0x369143));});});}function checkHopper(){function _0x1136f5(){return function(_0x2a5772){logger[_0x5909('0x16')](_0x5909('0x32'),_0x5909('0x33'),util[_0x5909('0x34')](_0x2a5772,{'showHidden':![],'depth':null}));};}var _0x1a2de4=function(_0x5e03af,_0x5f351a){var _0x3aac92=squel['insert']()['into'](_0x5909('0x35'))[_0x5909('0x36')]([_0x5909('0x24'),_0x5909('0x37'),_0x5909('0x38'),'ListId',_0x5f351a,'createdAt',_0x5909('0x39')],squel[_0x5909('0x3a')]()[_0x5909('0x3b')](_0x5909('0x24'),_0x5909('0x24'))['field'](_0x5909('0x3c'),'scheduledAt')[_0x5909('0x3b')]('id',_0x5909('0x38'))['field'](LISTID[_0x5909('0x3d')](),_0x5909('0x3e'))[_0x5909('0x3b')](_0x5e03af['id'][_0x5909('0x3d')](),_0x5f351a)[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x3f'))[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x39'))[_0x5909('0x40')](_0x5909('0x41'))[_0x5909('0x42')]('deletedAt\x20IS\x20NULL')[_0x5909('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x5909('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x5909('0x42')](_0x5909('0x43'),squel[_0x5909('0x3a')]()['field'](_0x5909('0x24'))[_0x5909('0x40')](_0x5909('0x35'))[_0x5909('0x42')](_0x5f351a+_0x5909('0x44'),_0x5e03af['id'][_0x5909('0x3d')]())))[_0x5909('0x3d')]();return _0x3aac92;};var _0x5a2803=function(_0x43bb4c,_0x1b67c1){var _0x26294c=squel[_0x5909('0x45')]()[_0x5909('0x46')]('cm_hopper')[_0x5909('0x36')]([_0x5909('0x24'),_0x5909('0x37'),_0x5909('0x38'),'ListId',_0x1b67c1,_0x5909('0x3f'),_0x5909('0x39')],squel[_0x5909('0x3a')]()[_0x5909('0x3b')](_0x5909('0x24'),'phone')['field']('NOW()',_0x5909('0x37'))[_0x5909('0x3b')]('id',_0x5909('0x38'))[_0x5909('0x3b')](LISTID[_0x5909('0x3d')](),_0x5909('0x3e'))[_0x5909('0x3b')](_0x43bb4c['id'][_0x5909('0x3d')](),_0x1b67c1)[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x3f'))[_0x5909('0x3b')](_0x5909('0x3c'),'updatedAt')[_0x5909('0x40')]('cm_contacts')[_0x5909('0x42')](_0x5909('0x47'))['where']('ListId\x20=\x20?',LISTID[_0x5909('0x3d')]())['where'](_0x5909('0x48'),squel['str'](hopperContacts))[_0x5909('0x42')](_0x5909('0x49'))[_0x5909('0x42')](_0x5909('0x43'),squel[_0x5909('0x3a')]()[_0x5909('0x3b')]('calleridnum')[_0x5909('0x40')](_0x5909('0x4a'))[_0x5909('0x42')](_0x1b67c1+'\x20=\x20?',_0x43bb4c['id'][_0x5909('0x3d')]()))[_0x5909('0x42')](_0x5909('0x43'),squel[_0x5909('0x3a')]()['field'](_0x5909('0x24'))[_0x5909('0x40')](_0x5909('0x35'))[_0x5909('0x42')](_0x1b67c1+_0x5909('0x44'),_0x43bb4c['id'][_0x5909('0x3d')]())))['toString']();return _0x26294c;};function _0x2adc35(_0x468454,_0x1fdac1){var _0x3f0e8f=squel[_0x5909('0x45')]()[_0x5909('0x46')](_0x5909('0x35'))[_0x5909('0x36')]([_0x5909('0x24'),_0x5909('0x37'),_0x5909('0x38'),_0x5909('0x3e'),_0x1fdac1,_0x5909('0x3f'),_0x5909('0x39')],squel[_0x5909('0x3a')]()[_0x5909('0x3b')]('phone',_0x5909('0x24'))[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x37'))[_0x5909('0x3b')]('id',_0x5909('0x38'))['field'](LISTID[_0x5909('0x3d')](),'ListId')['field'](_0x468454['id']['toString'](),_0x1fdac1)[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x3f'))['field'](_0x5909('0x3c'),'updatedAt')['from']('cm_contacts')[_0x5909('0x42')]('deletedAt\x20IS\x20NULL')[_0x5909('0x42')]('ListId\x20=\x20?',LISTID['toString']())[_0x5909('0x42')](_0x5909('0x48'),squel[_0x5909('0x4b')](hopperContacts))[_0x5909('0x42')](_0x5909('0x49')))[_0x5909('0x3d')]();return _0x3f0e8f;}function _0x1bc20c(_0x3febbe,_0x13692c){var _0x1a3818=squel['insert']()['into']('cm_hopper_black')[_0x5909('0x36')]([_0x5909('0x24'),_0x5909('0x38'),_0x5909('0x3e'),_0x13692c,_0x5909('0x3f'),_0x5909('0x39')],squel[_0x5909('0x3a')]()[_0x5909('0x3b')]('phone',_0x5909('0x24'))[_0x5909('0x3b')]('id','ContactId')[_0x5909('0x3b')](LISTID['toString'](),_0x5909('0x3e'))[_0x5909('0x3b')](_0x3febbe['id'][_0x5909('0x3d')](),_0x13692c)[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x3f'))[_0x5909('0x3b')](_0x5909('0x3c'),_0x5909('0x39'))[_0x5909('0x40')]('cm_contacts')[_0x5909('0x42')]('deletedAt\x20IS\x20NULL')[_0x5909('0x42')]('ListId\x20=\x20?',LISTID[_0x5909('0x3d')]())[_0x5909('0x42')](_0x5909('0x48'),squel[_0x5909('0x4b')](hopperContacts))['where'](_0x5909('0x49')))[_0x5909('0x3d')]();return _0x1a3818;}return db[_0x5909('0x4c')]['findAll']({'where':{'type':_0x5909('0x4d')},'attributes':['id',_0x5909('0x4e')],'include':[{'model':db[_0x5909('0x4f')],'as':_0x5909('0x50'),'where':{'id':LISTID}}]})[_0x5909('0x2e')](function(_0x17bb75){var _0x366a04=[];if(_0x17bb75){var _0x3fceb7;for(var _0x1e2bea=0x0,_0x2567c1;_0x1e2bea<_0x17bb75[_0x5909('0x1d')];_0x1e2bea+=0x1){_0x2567c1=_0x17bb75[_0x1e2bea][_0x5909('0x51')]({'plain':!![]});switch(_0x2567c1[_0x5909('0x4e')]){case _0x5909('0x52'):_0x366a04[_0x5909('0x2f')](db[_0x5909('0x53')]['query'](_0x5a2803(_0x2567c1,_0x5909('0x54')))[_0x5909('0x2e')](function(){})[_0x5909('0x55')](_0x1136f5()));break;case _0x5909('0x56'):_0x366a04['push'](db[_0x5909('0x53')][_0x5909('0x57')](_0x1a2de4(_0x2567c1,'VoiceQueueId'))[_0x5909('0x2e')](function(){})[_0x5909('0x55')](_0x1136f5()));break;default:_0x366a04[_0x5909('0x2f')](db[_0x5909('0x53')][_0x5909('0x57')](_0x2adc35(_0x2567c1,'VoiceQueueId'))['then'](function(){})[_0x5909('0x55')](_0x1136f5()));}}}return _0x366a04;})[_0x5909('0x58')]()[_0x5909('0x2e')](function(){return db[_0x5909('0x4c')][_0x5909('0x59')]({'where':{'type':_0x5909('0x4d')},'attributes':['id'],'include':[{'model':db[_0x5909('0x4f')],'as':_0x5909('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x5b148f){var _0x976408=[];if(_0x5b148f){var _0x2d2e92;for(var _0x5c5750=0x0,_0x143379;_0x5c5750<_0x5b148f[_0x5909('0x1d')];_0x5c5750+=0x1){_0x143379=_0x5b148f[_0x5c5750]['get']({'plain':!![]});_0x976408[_0x5909('0x2f')](db[_0x5909('0x53')]['query'](_0x1bc20c(_0x143379,'VoiceQueueId'))[_0x5909('0x2e')](function(){})['catch'](_0x1136f5()));}}return _0x976408;})['all']();})['then'](function(){return db[_0x5909('0x5b')][_0x5909('0x59')]({'attributes':['id',_0x5909('0x4e')],'include':[{'model':db[_0x5909('0x4f')],'as':_0x5909('0x50'),'where':{'id':LISTID}}]})[_0x5909('0x2e')](function(_0x4ee8c6){var _0x3db4c8=[];if(_0x4ee8c6){for(var _0x1a9681=0x0,_0x5969be;_0x1a9681<_0x4ee8c6[_0x5909('0x1d')];_0x1a9681+=0x1){_0x5969be=_0x4ee8c6[_0x1a9681][_0x5909('0x51')]({'plain':!![]});switch(_0x5969be[_0x5909('0x4e')]){case _0x5909('0x52'):_0x3db4c8['push'](db[_0x5909('0x53')]['query'](_0x5a2803(_0x5969be,_0x5909('0x5c')))['then'](function(){})['catch'](_0x1136f5()));break;case _0x5909('0x56'):_0x3db4c8[_0x5909('0x2f')](db[_0x5909('0x53')]['query'](_0x1a2de4(_0x5969be,_0x5909('0x5c')))[_0x5909('0x2e')](function(){})[_0x5909('0x55')](_0x1136f5()));break;default:_0x3db4c8['push'](db[_0x5909('0x53')][_0x5909('0x57')](_0x2adc35(_0x5969be,_0x5909('0x5c')))[_0x5909('0x2e')](function(){})[_0x5909('0x55')](_0x1136f5()));}}}return _0x3db4c8;})[_0x5909('0x58')]();})['then'](function(){return db['Campaign'][_0x5909('0x59')]({'attributes':['id'],'include':[{'model':db[_0x5909('0x4f')],'as':_0x5909('0x5a'),'where':{'id':LISTID}}]})[_0x5909('0x2e')](function(_0x2c8aea){var _0x36bb2c=[];if(_0x2c8aea){for(var _0x2eb618=0x0,_0x124a19;_0x2eb618<_0x2c8aea[_0x5909('0x1d')];_0x2eb618+=0x1){_0x124a19=_0x2c8aea[_0x2eb618][_0x5909('0x51')]({'plain':!![]});_0x36bb2c[_0x5909('0x2f')](db[_0x5909('0x53')][_0x5909('0x57')](_0x1bc20c(_0x124a19,_0x5909('0x5c')))['then'](function(){})['catch'](_0x1136f5()));}}return _0x36bb2c;})['all']();})[_0x5909('0x55')](function(_0xc41bc8){logger['error'](_0x5909('0x5d'),_0x5909('0x5e'),_0xc41bc8['message']);});}var processPromises=function(_0xd11718){return BPromise['all'](promises)[_0x5909('0x2e')](function(_0x3aef67){})['catch'](function(_0x41d641){logger[_0x5909('0x16')]('Error\x20processing\x20rows\x20block:',JSON[_0x5909('0x31')](_0x41d641));})[_0x5909('0x5f')](function(){socket[_0x5909('0x60')](_0x5909('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xd11718){return _0xd11718['resume']();}});};var endCsv=function(){return BPromise[_0x5909('0x62')]()[_0x5909('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x5909('0x2e')](function(){socket[_0x5909('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5909('0x63')](FILEPATH);}catch(_0x2c4c2a){logger[_0x5909('0x16')](_0x5909('0x64'),JSON[_0x5909('0x31')](_0x2c4c2a));}finally{process[_0x5909('0x65')](0x0);}});};process['on'](_0x5909('0x66'),function(){logger['info'](_0x5909('0x67'));endCsv();});function main(){return BPromise[_0x5909('0x62')]()[_0x5909('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x5909('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5909('0x2e')](function(_0x3fb2cf){var _0x5bd2d2=fs[_0x5909('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5909('0x6a')](_0x5bd2d2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x42b08c,_0x1958fd){total+=0x1;var _0x50e773=total;promises[_0x5909('0x2f')](checkRow(_0x42b08c,_0x3fb2cf,_0x50e773)['then'](function(){success+=0x1;})[_0x5909('0x55')](function(_0x3d4715){if(_0x3d4715[_0x5909('0x16')]){errors+=0x1;delete _0x3d4715[_0x5909('0x16')];}else if(_0x3d4715[_0x5909('0x2c')]){duplicates+=0x1;delete _0x3d4715[_0x5909('0x2c')];}rows[_0x5909('0x2f')](_0x3d4715);}));if(total%0xc8===0x0){_0x1958fd[_0x5909('0x6b')]();return processPromises(_0x1958fd);}},'complete':function(){return processPromises()[_0x5909('0x2e')](function(){logger[_0x5909('0x6c')](_0x5909('0x6d'));endCsv();});},'error':function(_0x584d0f,_0x219b9f){logger['info'](_0x5909('0x6e'),JSON[_0x5909('0x31')](_0x584d0f));endCsv();}});})['catch'](function(_0x164e00){logger[_0x5909('0x16')](_0x5909('0x6f'),JSON[_0x5909('0x31')](_0x164e00));});}main(); \ No newline at end of file +var _0x597c=['../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','find','duplicate','CmContact','create','keys','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','sequelize','VoiceQueueId','catch','onlyIfOpen','all','VoiceQueue','findAll','BlackLists','push','query','CampaignId','generalCheckHopper','finally','emit','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','exit','SIGINT','CSV\x20import\x20process\x20stopped!','parse','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment'];(function(_0x4fce3b,_0x453cd4){var _0x54c51b=function(_0x8350c1){while(--_0x8350c1){_0x4fce3b['push'](_0x4fce3b['shift']());}};_0x54c51b(++_0x453cd4);}(_0x597c,0x66));var _0xc597=function(_0x63567,_0x3135cf){_0x63567=_0x63567-0x0;var _0x2ec3f5=_0x597c[_0x63567];return _0x2ec3f5;};'use strict';var BPromise=require(_0xc597('0x0'));var util=require(_0xc597('0x1'));var _=require(_0xc597('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xc597('0x3'));var Redis=require(_0xc597('0x4'));var db=require(_0xc597('0x5'))['db'];var config=require(_0xc597('0x6'));var logger=require(_0xc597('0x7'))(_0xc597('0x8'));config['redis']=_[_0xc597('0x9')](config[_0xc597('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc597('0xb'))(new Redis(config[_0xc597('0xa')]));require(_0xc597('0xc'))['register'](socket);try{if(!process[_0xc597('0xd')][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]===_0xc597('0xe')){throw new Error(_0xc597('0xf'));}var FILEPATH=process[_0xc597('0xd')][0x2];if(!process[_0xc597('0xd')][0x3]||process[_0xc597('0xd')][0x3]===_0xc597('0x10')||process[_0xc597('0xd')][0x3]===_0xc597('0xe')||!process[_0xc597('0xd')][0x4]||process['argv'][0x4]===_0xc597('0x10')||process['argv'][0x4]===_0xc597('0xe')){throw new Error(_0xc597('0x11'));}var FIELDS=_[_0xc597('0x12')](process[_0xc597('0xd')][0x3]['split'](','),process[_0xc597('0xd')][0x4][_0xc597('0x13')](','));if(!process[_0xc597('0xd')][0x5]||process['argv'][0x5]==='undefined'||process[_0xc597('0xd')][0x5]===_0xc597('0xe')){throw new Error(_0xc597('0x14'));}var LISTID=process[_0xc597('0xd')][0x5];var COMPANYID=process[_0xc597('0xd')][0x6]&&process[_0xc597('0xd')][0x6]!=='undefined'&&process[_0xc597('0xd')][0x6]!=='null'?process[_0xc597('0xd')][0x6]:null;var DUPLICATES=process[_0xc597('0xd')][0x7]&&process[_0xc597('0xd')][0x7]!==_0xc597('0x10')&&process['argv'][0x7]!==_0xc597('0xe')?process[_0xc597('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0xc597('0xd')][0x8]==='undefined'||process[_0xc597('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xc597('0xd')][0x8];}catch(_0x16f085){logger['error'](_0x16f085);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(_0x5a21aa,_0x15b91b,_0x60bcaa,_0x4394c3){var _0x347fbd={'message':_0x15b91b};_0x347fbd[_0x5a21aa]=!![];if(_0x60bcaa){_0x347fbd[_0xc597('0x15')]=_0x60bcaa;}if(_0x4394c3){_0x347fbd['index']=_0x4394c3;}return _0x347fbd;}function isEmail(_0x4d9bd7){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))*$/[_0xc597('0x16')](_0x4d9bd7);}function checkRow(_0x48b1ce,_0x2b5c1e,_0x4c89b3){return new BPromise(function(_0x488d46,_0x5da323){if(_[_0xc597('0x17')](_0x48b1ce)){return _0x5da323(handleCheckRowError(_0xc597('0x18'),_0xc597('0x19'),null,_0x4c89b3));}if(_0x48b1ce[_0xc597('0x1a')]&&_0x48b1ce[_0xc597('0x1a')][_0xc597('0x1b')]){var _0x4dd461=_['map'](_0x48b1ce[_0xc597('0x1a')],_0xc597('0x1c'))[_0xc597('0x1d')](';');return _0x5da323(handleCheckRowError(_0xc597('0x18'),_0x4dd461,null,_0x4c89b3));}var _0x22a029={};for(var _0x30a143 in FIELDS){if(FIELDS[_0xc597('0x1e')](_0x30a143)&&FIELDS[_0x30a143]){_0x22a029[_0x30a143]=_0x48b1ce[_0xc597('0x1f')][0x0][FIELDS[_0x30a143]]||_0x48b1ce[_0xc597('0x1f')][0x0]['\ufeff'+FIELDS[_0x30a143]];}}if(!_0x22a029['firstName']){return _0x5da323(handleCheckRowError(_0xc597('0x18'),_0xc597('0x20'),null,_0x4c89b3));}if(!_0x22a029[_0xc597('0x21')]){return _0x5da323(handleCheckRowError(_0xc597('0x18'),'phone\x20not\x20specified!',null,_0x4c89b3));}if(_0x22a029[_0xc597('0x22')]){var _0x527a8f=moment(_0x22a029[_0xc597('0x22')],_0xc597('0x23'));if(!_0x527a8f[_0xc597('0x24')]()){return _0x5da323(handleCheckRowError(_0xc597('0x18'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4c89b3));}}if(_0x22a029[_0xc597('0x25')]){if(!isEmail(_0x22a029[_0xc597('0x25')])){return _0x5da323(handleCheckRowError(_0xc597('0x18'),_0xc597('0x26'),null,_0x4c89b3));}}_0x22a029['ListId']=LISTID;_0x22a029['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2b5c1e){var _0xa7e935={};for(var _0x5b8ed1=0x0,_0x36c49c=DUPLICATES[_0xc597('0x1b')];_0x5b8ed1<_0x36c49c;_0x5b8ed1+=0x1){_0xa7e935[DUPLICATES[_0x5b8ed1]]=_0x22a029[DUPLICATES[_0x5b8ed1]];}var _0x23688a=_[_0xc597('0x27')](_0x2b5c1e,_0xa7e935);if(_0x23688a){return _0x5da323(handleCheckRowError(_0xc597('0x28'),'Duplicate\x20Contact',_0x23688a,_0x4c89b3));}}return db[_0xc597('0x29')][_0xc597('0x2a')](_0x22a029,{'raw':!![],'hooks':![],'fields':_[_0xc597('0x2b')](_0x22a029)})['then'](function(_0x34e1c1){if(DUPLICATES&&DUPLICATES[_0xc597('0x1b')]&&_0x2b5c1e){_0x2b5c1e['push'](_[_0xc597('0x2c')](_0x22a029,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x34e1c1['id'];return _0x488d46();})['catch'](function(_0x5809a2){return _0x5da323(handleCheckRowError(_0xc597('0x18'),_0xc597('0x2d')+(_0x5809a2[_0xc597('0x1c')]||JSON['stringify'](_0x5809a2)),null,_0x4c89b3));});});}function checkHopper(){function _0x495c54(){return function(_0x184fe8){logger[_0xc597('0x18')](_0xc597('0x2e'),_0xc597('0x2f'),util[_0xc597('0x30')](_0x184fe8,{'showHidden':![],'depth':null}));};}var _0x43c950=function(_0x41f8ba,_0x8ae6d4){var _0xed9c61=squel[_0xc597('0x31')]()[_0xc597('0x32')](_0xc597('0x33'))[_0xc597('0x34')](['phone',_0xc597('0x35'),_0xc597('0x36'),_0xc597('0x37'),_0x8ae6d4,_0xc597('0x38'),_0xc597('0x39')],squel[_0xc597('0x3a')]()[_0xc597('0x3b')]('phone','phone')[_0xc597('0x3b')]('NOW()','scheduledAt')['field']('id','ContactId')['field'](LISTID[_0xc597('0x3c')](),'ListId')['field'](_0x41f8ba['id'][_0xc597('0x3c')](),_0x8ae6d4)[_0xc597('0x3b')]('NOW()','createdAt')['field'](_0xc597('0x3d'),_0xc597('0x39'))[_0xc597('0x3e')](_0xc597('0x3f'))[_0xc597('0x40')](_0xc597('0x41'))[_0xc597('0x40')](_0xc597('0x42'),LISTID[_0xc597('0x3c')]())[_0xc597('0x40')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xc597('0x43'),squel[_0xc597('0x3a')]()['field'](_0xc597('0x21'))[_0xc597('0x3e')](_0xc597('0x33'))[_0xc597('0x40')](_0x8ae6d4+_0xc597('0x44'),_0x41f8ba['id'][_0xc597('0x3c')]())))[_0xc597('0x3c')]();return _0xed9c61;};var _0x39ec3d=function(_0x3b3a56,_0x38f576){var _0x32c659=squel[_0xc597('0x31')]()[_0xc597('0x32')]('cm_hopper')[_0xc597('0x34')]([_0xc597('0x21'),'scheduledAt',_0xc597('0x36'),_0xc597('0x37'),_0x38f576,'createdAt','updatedAt'],squel[_0xc597('0x3a')]()[_0xc597('0x3b')]('phone',_0xc597('0x21'))[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x35'))[_0xc597('0x3b')]('id',_0xc597('0x36'))[_0xc597('0x3b')](LISTID[_0xc597('0x3c')](),_0xc597('0x37'))[_0xc597('0x3b')](_0x3b3a56['id'][_0xc597('0x3c')](),_0x38f576)[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x38'))[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x39'))[_0xc597('0x3e')](_0xc597('0x3f'))[_0xc597('0x40')](_0xc597('0x41'))[_0xc597('0x40')](_0xc597('0x42'),LISTID[_0xc597('0x3c')]())[_0xc597('0x40')]('id\x20IN\x20?',squel[_0xc597('0x45')](hopperContacts))[_0xc597('0x40')](_0xc597('0x46'))[_0xc597('0x40')](_0xc597('0x43'),squel['select']()[_0xc597('0x3b')](_0xc597('0x47'))[_0xc597('0x3e')](_0xc597('0x48'))[_0xc597('0x40')](_0x38f576+_0xc597('0x44'),_0x3b3a56['id']['toString']()))[_0xc597('0x40')](_0xc597('0x43'),squel[_0xc597('0x3a')]()[_0xc597('0x3b')](_0xc597('0x21'))[_0xc597('0x3e')]('cm_hopper')[_0xc597('0x40')](_0x38f576+_0xc597('0x44'),_0x3b3a56['id'][_0xc597('0x3c')]())))[_0xc597('0x3c')]();return _0x32c659;};function _0x289747(_0x65eeae,_0x14d155){var _0x290564=squel[_0xc597('0x31')]()[_0xc597('0x32')](_0xc597('0x33'))[_0xc597('0x34')](['phone',_0xc597('0x35'),_0xc597('0x36'),'ListId',_0x14d155,_0xc597('0x38'),_0xc597('0x39')],squel[_0xc597('0x3a')]()[_0xc597('0x3b')](_0xc597('0x21'),_0xc597('0x21'))[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x35'))[_0xc597('0x3b')]('id','ContactId')[_0xc597('0x3b')](LISTID[_0xc597('0x3c')](),_0xc597('0x37'))[_0xc597('0x3b')](_0x65eeae['id'][_0xc597('0x3c')](),_0x14d155)[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x38'))[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x39'))[_0xc597('0x3e')](_0xc597('0x3f'))[_0xc597('0x40')](_0xc597('0x41'))[_0xc597('0x40')](_0xc597('0x42'),LISTID[_0xc597('0x3c')]())[_0xc597('0x40')](_0xc597('0x49'),squel[_0xc597('0x45')](hopperContacts))[_0xc597('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xc597('0x3c')]();return _0x290564;}function _0x119e8d(_0x49ba83,_0x375a6a){var _0xf3b859=squel[_0xc597('0x31')]()[_0xc597('0x32')](_0xc597('0x4a'))[_0xc597('0x34')]([_0xc597('0x21'),'ContactId',_0xc597('0x37'),_0x375a6a,_0xc597('0x38'),_0xc597('0x39')],squel[_0xc597('0x3a')]()[_0xc597('0x3b')](_0xc597('0x21'),_0xc597('0x21'))[_0xc597('0x3b')]('id',_0xc597('0x36'))[_0xc597('0x3b')](LISTID[_0xc597('0x3c')](),'ListId')[_0xc597('0x3b')](_0x49ba83['id'][_0xc597('0x3c')](),_0x375a6a)[_0xc597('0x3b')](_0xc597('0x3d'),'createdAt')[_0xc597('0x3b')](_0xc597('0x3d'),_0xc597('0x39'))[_0xc597('0x3e')](_0xc597('0x3f'))[_0xc597('0x40')]('deletedAt\x20IS\x20NULL')[_0xc597('0x40')](_0xc597('0x42'),LISTID[_0xc597('0x3c')]())[_0xc597('0x40')](_0xc597('0x49'),squel[_0xc597('0x45')](hopperContacts))[_0xc597('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xc597('0x3c')]();return _0xf3b859;}return db['VoiceQueue']['findAll']({'where':{'type':_0xc597('0x4b')},'attributes':['id',_0xc597('0x4c')],'include':[{'model':db[_0xc597('0x4d')],'as':_0xc597('0x4e'),'where':{'id':LISTID}}]})[_0xc597('0x4f')](function(_0x592ca6){var _0x394bbd=[];if(_0x592ca6){var _0x49f190;for(var _0x3a822f=0x0,_0x28e153;_0x3a822f<_0x592ca6[_0xc597('0x1b')];_0x3a822f+=0x1){_0x28e153=_0x592ca6[_0x3a822f][_0xc597('0x50')]({'plain':!![]});switch(_0x28e153[_0xc597('0x4c')]){case _0xc597('0x51'):_0x394bbd['push'](db[_0xc597('0x52')]['query'](_0x39ec3d(_0x28e153,_0xc597('0x53')))[_0xc597('0x4f')](function(){})[_0xc597('0x54')](_0x495c54()));break;case _0xc597('0x55'):_0x394bbd['push'](db[_0xc597('0x52')]['query'](_0x43c950(_0x28e153,_0xc597('0x53')))['then'](function(){})[_0xc597('0x54')](_0x495c54()));break;default:_0x394bbd['push'](db[_0xc597('0x52')]['query'](_0x289747(_0x28e153,_0xc597('0x53')))['then'](function(){})[_0xc597('0x54')](_0x495c54()));}}}return _0x394bbd;})[_0xc597('0x56')]()[_0xc597('0x4f')](function(){return db[_0xc597('0x57')][_0xc597('0x58')]({'where':{'type':_0xc597('0x4b')},'attributes':['id'],'include':[{'model':db[_0xc597('0x4d')],'as':_0xc597('0x59'),'where':{'id':LISTID}}]})[_0xc597('0x4f')](function(_0x42b5a6){var _0x473414=[];if(_0x42b5a6){var _0x37e558;for(var _0xc7fad0=0x0,_0xc1c7e6;_0xc7fad0<_0x42b5a6['length'];_0xc7fad0+=0x1){_0xc1c7e6=_0x42b5a6[_0xc7fad0][_0xc597('0x50')]({'plain':!![]});_0x473414[_0xc597('0x5a')](db['sequelize']['query'](_0x119e8d(_0xc1c7e6,_0xc597('0x53')))[_0xc597('0x4f')](function(){})[_0xc597('0x54')](_0x495c54()));}}return _0x473414;})[_0xc597('0x56')]();})[_0xc597('0x4f')](function(){return db['Campaign'][_0xc597('0x58')]({'attributes':['id',_0xc597('0x4c')],'include':[{'model':db[_0xc597('0x4d')],'as':_0xc597('0x4e'),'where':{'id':LISTID}}]})[_0xc597('0x4f')](function(_0x32b68d){var _0x13d1b1=[];if(_0x32b68d){for(var _0x52e608=0x0,_0x53ae17;_0x52e608<_0x32b68d[_0xc597('0x1b')];_0x52e608+=0x1){_0x53ae17=_0x32b68d[_0x52e608][_0xc597('0x50')]({'plain':!![]});switch(_0x53ae17[_0xc597('0x4c')]){case _0xc597('0x51'):_0x13d1b1[_0xc597('0x5a')](db[_0xc597('0x52')][_0xc597('0x5b')](_0x39ec3d(_0x53ae17,_0xc597('0x5c')))[_0xc597('0x4f')](function(){})[_0xc597('0x54')](_0x495c54()));break;case _0xc597('0x55'):_0x13d1b1[_0xc597('0x5a')](db['sequelize'][_0xc597('0x5b')](_0x43c950(_0x53ae17,_0xc597('0x5c')))[_0xc597('0x4f')](function(){})[_0xc597('0x54')](_0x495c54()));break;default:_0x13d1b1[_0xc597('0x5a')](db['sequelize'][_0xc597('0x5b')](_0x289747(_0x53ae17,_0xc597('0x5c')))[_0xc597('0x4f')](function(){})['catch'](_0x495c54()));}}}return _0x13d1b1;})['all']();})[_0xc597('0x4f')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xc597('0x4d')],'as':_0xc597('0x59'),'where':{'id':LISTID}}]})[_0xc597('0x4f')](function(_0x102002){var _0x32ec3c=[];if(_0x102002){for(var _0x4dd5f7=0x0,_0xd04d2f;_0x4dd5f7<_0x102002[_0xc597('0x1b')];_0x4dd5f7+=0x1){_0xd04d2f=_0x102002[_0x4dd5f7]['get']({'plain':!![]});_0x32ec3c[_0xc597('0x5a')](db[_0xc597('0x52')][_0xc597('0x5b')](_0x119e8d(_0xd04d2f,'CampaignId'))['then'](function(){})[_0xc597('0x54')](_0x495c54()));}}return _0x32ec3c;})[_0xc597('0x56')]();})[_0xc597('0x54')](function(_0x44418c){logger[_0xc597('0x18')]('cmContact,\x20%s,\x20%s',_0xc597('0x5d'),_0x44418c['message']);});}var processPromises=function(_0x1c23e9){return BPromise[_0xc597('0x56')](promises)[_0xc597('0x4f')](function(_0x36b680){})[_0xc597('0x54')](function(_0x20b9be){logger[_0xc597('0x18')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x20b9be));})[_0xc597('0x5e')](function(){socket[_0xc597('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1c23e9){return _0x1c23e9[_0xc597('0x60')]();}});};var endCsv=function(){return BPromise[_0xc597('0x61')]()[_0xc597('0x4f')](function(){if(hopperContacts){return checkHopper();}})[_0xc597('0x4f')](function(){socket[_0xc597('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc597('0x62')](FILEPATH);}catch(_0x53ba4c){logger[_0xc597('0x18')](_0xc597('0x63'),JSON[_0xc597('0x64')](_0x53ba4c));}finally{process[_0xc597('0x65')](0x0);}});};process['on'](_0xc597('0x66'),function(){logger['info'](_0xc597('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0xc597('0x4f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc597('0x13')](',');return db[_0xc597('0x29')][_0xc597('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x3eef17){var _0x41ee0f=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc597('0x68')](_0x41ee0f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x516ac0,_0x462f64){total+=0x1;var _0x16cfde=total;promises['push'](checkRow(_0x516ac0,_0x3eef17,_0x16cfde)['then'](function(){success+=0x1;})['catch'](function(_0x42e8e9){if(_0x42e8e9[_0xc597('0x18')]){errors+=0x1;delete _0x42e8e9[_0xc597('0x18')];}else if(_0x42e8e9['duplicate']){duplicates+=0x1;delete _0x42e8e9[_0xc597('0x28')];}rows[_0xc597('0x5a')](_0x42e8e9);}));if(total%0xc8===0x0){_0x462f64['pause']();return processPromises(_0x462f64);}},'complete':function(){return processPromises()['then'](function(){logger[_0xc597('0x69')](_0xc597('0x6a'));endCsv();});},'error':function(_0x2820fc,_0x56144c){logger[_0xc597('0x69')](_0xc597('0x6b'),JSON['stringify'](_0x2820fc));endCsv();}});})[_0xc597('0x54')](function(_0x1862a0){logger[_0xc597('0x18')](_0xc597('0x6c'),JSON[_0xc597('0x64')](_0x1862a0));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index c3ac08a..2b758ea 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 _0x0083=['binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','insert','cm_hopper_black','.CmListId','field','ListId\x20=\x20?','scheduledat','priority','\x22onlyIfOpen\x22','\x20=\x20?','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','errors','push','message','spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','query','length','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','all','timezones','dialTimezone','isNil','utcOffset','set','offset','sequelize','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','exit','complete','arguments\x20\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','parse'];(function(_0xa96e94,_0x33e78f){var _0x1a90b5=function(_0x468270){while(--_0x468270){_0xa96e94['push'](_0xa96e94['shift']());}};_0x1a90b5(++_0x33e78f);}(_0x0083,0x1cf));var _0x3008=function(_0x3086d0,_0x5ad3a0){_0x3086d0=_0x3086d0-0x0;var _0xb4cde=_0x0083[_0x3086d0];return _0xb4cde;};'use strict';var fs=require('fs');var path=require(_0x3008('0x0'));var _=require(_0x3008('0x1'));var Papa=require(_0x3008('0x2'));var util=require(_0x3008('0x3'));var BPromise=require(_0x3008('0x4'));var moment=require(_0x3008('0x5'));var squel=require(_0x3008('0x6'));var Redis=require(_0x3008('0x7'));var db=require(_0x3008('0x8'))['db'];var config=require(_0x3008('0x9'));var shared=require(_0x3008('0xa'));var logger=require(_0x3008('0xb'))('import');config[_0x3008('0xc')]=_[_0x3008('0xd')](config[_0x3008('0xc')],{'host':_0x3008('0xe'),'port':0x18eb});var socket=require(_0x3008('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x3008('0x10')](_0x3008('0x11'));function isEmail(_0x1c548d){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'](_0x1c548d);}function selectNotIn(_0x1dc7ab,_0x48a861,_0x4b0a06,_0x2ecae9,_0x4e56b2){return squel['select']()['field'](_0x3008('0x12'))[_0x3008('0x13')](_0x2ecae9)[_0x3008('0x14')](_0x48a861,null,_0x48a861+_0x3008('0x15')+_0x2ecae9+'.'+_0x4b0a06)[_0x3008('0x16')](_0x2ecae9+'.'+_0x4b0a06+_0x3008('0x17')+_0x1dc7ab+'.'+_0x4b0a06)[_0x3008('0x16')](_0x48a861+_0x3008('0x18')+_0x4e56b2[_0x3008('0x14')]()+')');}function insertCmHopper(_0x3c61f6,_0x3a77ce,_0x2878ee,_0x5e3fdf,_0x175dd8){var _0x1030a9=[_0x3008('0x19'),_0x3008('0x1a'),_0x3008('0x1b'),_0x3008('0x1c'),_0x3a77ce+'.'+_0x5e3fdf,_0x3008('0x1d'),_0x3008('0x1e'),_0x3008('0x1f'),_0x3008('0x20'),'\x22'+_0x175dd8+'\x22'];return squel['insert']()[_0x3008('0x21')](_0x3008('0x22'))[_0x3008('0x23')]([_0x3008('0x12'),'scheduledat',_0x3008('0x24'),_0x3008('0x25'),_0x5e3fdf,_0x3008('0x26'),_0x3008('0x27'),'priority',_0x3008('0x28'),_0x3008('0x29')],squel[_0x3008('0x2a')]()[_0x3008('0x2b')](_0x1030a9)[_0x3008('0x13')](_0x3a77ce)['join'](_0x3008('0x2c'),null,_0x3008('0x2d')+_0x3a77ce+'.CmListId')[_0x3008('0x14')](_0x2878ee,null,_0x2878ee+_0x3008('0x15')+_0x3a77ce+'.'+_0x5e3fdf)[_0x3008('0x16')](_0x3a77ce+_0x3008('0x2e'),_0x3c61f6)[_0x3008('0x16')](_0x3008('0x2f'),NOW)['where'](_0x3008('0x30'),selectNotIn(_0x3a77ce,_0x2878ee,_0x5e3fdf,_0x3008('0x22'),[_0x3008('0x31'),'\x22onlyIfOpen\x22']))['where'](_0x3008('0x30'),selectNotIn(_0x3a77ce,_0x2878ee,_0x5e3fdf,_0x3008('0x22'),['\x22always\x22'])))[_0x3008('0x32')]();}function insertCmHopperBlack(_0x1a3e1d,_0x2c665b,_0x5d3def,_0x3be8b9){var _0x4f8589=[_0x3008('0x19'),'cm_contacts.id',_0x3008('0x1c'),_0x2c665b+'.'+_0x3be8b9,_0x3008('0x1d'),'cm_contacts.updatedAt'];return squel[_0x3008('0x33')]()[_0x3008('0x21')](_0x3008('0x34'))[_0x3008('0x23')]([_0x3008('0x12'),_0x3008('0x24'),'ListId',_0x3be8b9,_0x3008('0x26'),_0x3008('0x27')],squel['select']()[_0x3008('0x2b')](_0x4f8589)['from'](_0x2c665b)[_0x3008('0x14')]('cm_contacts',null,_0x3008('0x2d')+_0x2c665b+_0x3008('0x35'))[_0x3008('0x14')](_0x5d3def,null,_0x5d3def+_0x3008('0x15')+_0x2c665b+'.'+_0x3be8b9)[_0x3008('0x16')](_0x2c665b+_0x3008('0x2e'),_0x1a3e1d)[_0x3008('0x16')](_0x3008('0x2f'),NOW)[_0x3008('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x3008('0x2a')]()[_0x3008('0x36')](_0x3008('0x12'))[_0x3008('0x13')](_0x3008('0x34'))['where'](_0x3008('0x37'),_0x1a3e1d)[_0x3008('0x16')](_0x3be8b9+'\x20=\x20?',_0x2c665b+'.'+_0x3be8b9)))['toString']();}function insertTzCmHopper(_0x18a377,_0x470069,_0x4e7290,_0x569fa7,_0x3d2818,_0x1f053a){var _0x2ad149=[_0x3008('0x19'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x1f053a+'.offset-cm_contacts.utcOffset\x20minute)',_0x3008('0x1b'),_0x3008('0x1c'),_0x470069+'.'+_0x569fa7,'cm_contacts.createdAt',_0x3008('0x1e'),'cm_contacts.priority',_0x3008('0x20'),'\x22'+_0x3d2818+'\x22'];var _0x544c99=squel['insert']()[_0x3008('0x21')]('cm_hopper')['fromQuery'](['phone',_0x3008('0x38'),_0x3008('0x24'),_0x3008('0x25'),_0x569fa7,_0x3008('0x26'),_0x3008('0x27'),_0x3008('0x39'),_0x3008('0x28'),_0x3008('0x29')],squel[_0x3008('0x2a')]()[_0x3008('0x2b')](_0x2ad149)['from'](_0x470069)['join'](_0x3008('0x2c'),null,_0x3008('0x2d')+_0x470069+'.CmListId')[_0x3008('0x14')](_0x4e7290,null,_0x4e7290+_0x3008('0x15')+_0x470069+'.'+_0x569fa7)[_0x3008('0x14')](_0x1f053a,null,_0x1f053a+_0x3008('0x15')+_0x470069+'.'+_0x569fa7)[_0x3008('0x16')](_0x470069+_0x3008('0x2e'),_0x18a377)[_0x3008('0x16')](_0x3008('0x2f'),NOW)[_0x3008('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x470069,_0x4e7290,_0x569fa7,'cm_hopper',['\x22always\x22',_0x3008('0x3a')]))[_0x3008('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x470069,_0x4e7290,_0x569fa7,_0x3008('0x22'),[_0x3008('0x31')])))[_0x3008('0x32')]();return _0x544c99;}function insertTzCmHopperBlack(_0x44ecb7,_0x56c71d,_0xf48250,_0x4b097e){var _0x1401c0=[_0x3008('0x19'),_0x3008('0x1b'),'cm_contacts.ListId',_0x56c71d+'.'+_0x4b097e,_0x3008('0x1d'),'cm_contacts.updatedAt'];return squel[_0x3008('0x33')]()[_0x3008('0x21')]('cm_hopper_black')[_0x3008('0x23')]([_0x3008('0x12'),_0x3008('0x24'),_0x3008('0x25'),_0x4b097e,'createdAt',_0x3008('0x27')],squel[_0x3008('0x2a')]()[_0x3008('0x2b')](_0x1401c0)[_0x3008('0x13')](_0x56c71d)[_0x3008('0x14')](_0x3008('0x2c'),null,'cm_contacts.ListId\x20=\x20'+_0x56c71d+_0x3008('0x35'))['join'](_0xf48250,null,_0xf48250+'.id\x20=\x20'+_0x56c71d+'.'+_0x4b097e)[_0x3008('0x16')](_0x56c71d+_0x3008('0x2e'),_0x44ecb7)['where'](_0x3008('0x2f'),NOW)[_0x3008('0x16')](_0x3008('0x30'),squel[_0x3008('0x2a')]()[_0x3008('0x36')]('phone')['from'](_0x3008('0x34'))[_0x3008('0x16')](_0x3008('0x37'),_0x44ecb7)['where'](_0x4b097e+_0x3008('0x3b'),_0x56c71d+'.'+_0x4b097e)))[_0x3008('0x32')]();}function insertCmContact(_0x93e8fc,_0x4cec84,_0x37d3a0,_0xc7c3f9){var _0x46f5eb=_['concat'](_[_0x3008('0x3c')](_0xc7c3f9),[_0x3008('0x25'),'CompanyId','createdAt','updatedAt']);return squel[_0x3008('0x33')]()[_0x3008('0x21')]('cm_contacts')[_0x3008('0x23')](_0x46f5eb,squel[_0x3008('0x2a')]()['fields'](_0x46f5eb)[_0x3008('0x13')](_0x4cec84)[_0x3008('0x16')]('('+_0x37d3a0[_0x3008('0x14')](',')+_0x3008('0x3d'),squel[_0x3008('0x2a')]()[_0x3008('0x2b')](_0x37d3a0)[_0x3008('0x13')](_0x3008('0x2c'))['where'](_0x3008('0x37'),_0x93e8fc)[_0x3008('0x16')](_0x3008('0x3e')))[_0x3008('0x16')]('id\x20IN\x20?',squel[_0x3008('0x2a')]()[_0x3008('0x36')](_0x3008('0x3f'),_0x3008('0x40'))[_0x3008('0x13')](_0x4cec84)[_0x3008('0x41')](_0x37d3a0['join'](','))))[_0x3008('0x32')]();}function handleStop(){logger[_0x3008('0x42')](_0x3008('0x43'));stopped=!![];}function handleUncaughtException(_0xd151b){logger[_0x3008('0x44')](_0xd151b['message']);process['exit'](0x1);}function handleError(_0x4d6fdd,_0x53a4ac){stats[_0x3008('0x45')][_0x3008('0x46')]({'name':_0x53a4ac['code'],'message':_0x53a4ac[_0x3008('0x47')],'row':_0x4d6fdd});}function handleQuery(_0x1a7865){logger['info'](_0x1a7865);return db['sequelize']['query'](_0x1a7865)[_0x3008('0x48')](function(_0x2efda2){results[_0x3008('0x46')](_0x2efda2);})[_0x3008('0x49')](function(_0x9cba2){logger[_0x3008('0x44')](_0x9cba2[_0x3008('0x47')]);});}function updateTzCampaigns(_0x23189c){return new Promise(function(_0x1c2bc1,_0x1fafe3){var _0x34be52=squel[_0x3008('0x2a')]()[_0x3008('0x2b')](['campaigns.id',_0x3008('0x4a')])[_0x3008('0x13')](_0x3008('0x4b'))[_0x3008('0x14')](_0x3008('0x4c'),null,_0x3008('0x4d'))['where'](_0x3008('0x4e')+_0x23189c);db['sequelize'][_0x3008('0x4f')](_0x34be52['toString']())[_0x3008('0x48')](function(_0x355851){var _0x34493a=[];for(var _0x317849=0x0;_0x317849<_0x355851[_0x3008('0x50')];_0x317849++){_0x34493a['push'](getTimezoneData(_0x355851[_0x317849],tmp_campaigns));}BPromise['all'](_0x34493a)['then'](function(){_0x1c2bc1({'val':0x1});});})[_0x3008('0x49')](function(_0x5bd3d4){logger[_0x3008('0x44')](_0x5bd3d4[_0x3008('0x47')]);_0x1c2bc1({'val':0x0});});});}function updateTzVoiceQueues(_0x5580bd){return new Promise(function(_0x5efd19,_0x3c6a75){var _0x4a3e2d=squel[_0x3008('0x2a')]()[_0x3008('0x2b')]([_0x3008('0x51'),_0x3008('0x52')])['from']('voice_queues')[_0x3008('0x14')](_0x3008('0x53'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x3008('0x16')](_0x3008('0x54')+_0x5580bd);db['sequelize'][_0x3008('0x4f')](_0x4a3e2d[_0x3008('0x32')]())[_0x3008('0x48')](function(_0x47e8de){var _0x90f261=[];for(var _0x454d80=0x0;_0x454d80<_0x47e8de[_0x3008('0x50')];_0x454d80++){_0x90f261[_0x3008('0x46')](getTimezoneData(_0x47e8de[_0x454d80],tmp_voice_queues));}BPromise[_0x3008('0x55')](_0x90f261)['then'](function(){_0x5efd19({'val':0x1});});})[_0x3008('0x49')](function(_0x487fc5){logger[_0x3008('0x44')](_0x487fc5[_0x3008('0x47')]);_0x5efd19({'val':0x0});});});}function getTimezoneData(_0x917d7c,_0x26a322){return new Promise(function(_0x374bd6,_0x5d100f){var _0x27e34a=shared[_0x3008('0x56')];var _0xc65fad=_0x27e34a[_0x917d7c[_0x3008('0x57')]];if(_[_0x3008('0x58')](_0xc65fad)){_0x374bd6({'ret':0x1});}else{var _0x453824=_0xc65fad[_0x3008('0x59')];var _0x55b786=squel[_0x3008('0x33')]()[_0x3008('0x21')](_0x26a322)['set']('id',_0x917d7c['id'])[_0x3008('0x5a')](_0x3008('0x5b'),_0x453824)['set']('dialTimezone',_0x917d7c[_0x3008('0x57')])[_0x3008('0x32')]();return db[_0x3008('0x5c')][_0x3008('0x4f')](_0x55b786)[_0x3008('0x48')](function(_0x467331){_0x374bd6({'ret':0x1});})[_0x3008('0x49')](function(_0x1e63e7){logger[_0x3008('0x44')](_0x1e63e7['message']);_0x5d100f({'ret':0x1});});}});}function handleTZQuery(_0x564380){logger[_0x3008('0x42')](_0x564380);return db[_0x3008('0x5c')]['query'](_0x564380)[_0x3008('0x48')](function(_0x3b8fdb){})['catch'](function(_0x2f4c51){logger['error'](_0x2f4c51[_0x3008('0x47')]);});}function main(_0x41eeca,_0x431344,_0x598e31,_0x152b42){logger['info']('main',_0x41eeca,JSON[_0x3008('0x5d')](_0x431344));process['send'](_0x3008('0x5e'));var _0x572ac9=_0x431344[_0x3008('0x5f')];var _0x181ff9=_0x431344[_0x3008('0x60')];var _0x4690be=path[_0x3008('0x14')](config[_0x3008('0x61')],_0x3008('0x62'),_0x181ff9+_0x3008('0x63'));hasTZ=_[_0x3008('0x3c')](_0x572ac9)[_0x3008('0x64')](_0x3008('0x57'));var _0x232dbf=_[_0x3008('0x3c')](_0x572ac9)[_0x3008('0x14')]();logger[_0x3008('0x42')](_0x3008('0x65'),_0x232dbf);if(hasTZ)_0x232dbf+=',utcOffset';fs['writeFileSync'](_0x4690be,_0x232dbf+'\x0a');Papa['parse'](fs[_0x3008('0x66')](_0x41eeca),{'header':!![],'skipEmptyLines':!![],'step':function(_0x574d81,_0x4df47d){try{for(var _0x597a3c=0x0,_0xdc1fce=[];_0x597a3c<_0x574d81[_0x3008('0x67')][_0x3008('0x50')];_0x597a3c++){stats[_0x3008('0x68')]+=0x1;if(_0x574d81['errors'][_0x597a3c]){handleError(_0x574d81[_0x3008('0x67')][_0x597a3c],_0x574d81['errors'][_0x597a3c]);}else{var _0x3d95be=[];for(var _0x1be69b in _0x572ac9){if(_0x572ac9[_0x3008('0x69')](_0x1be69b)){if(_0x574d81['data'][_0x597a3c][_0x572ac9[_0x1be69b]]){var _0x58c999=_[_0x3008('0x6a')](_0x574d81['data'][_0x597a3c][_0x572ac9[_0x1be69b]]['replace'](/"/g,'\x27'));switch(_0x1be69b){case _0x3008('0x38'):var _0x41b67b=moment(_0x58c999,_0x3008('0x11'),!![]);if(_0x41b67b[_0x3008('0x6b')]()){_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');}else{_0x3d95be[_0x3008('0x46')](_0x3008('0x6c'));}break;case _0x3008('0x39'):var _0x10b575=parseInt(_0x58c999);_0x58c999=_['isNaN'](_0x10b575)||_0x10b575<0x0||_0x10b575>0x4?_0x152b42?0x3:0x2:_0x10b575;_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');break;case'UserId':var _0x5ba0cf=parseInt(_0x58c999);if(_[_0x3008('0x6d')](_0x5ba0cf)&&_[_0x3008('0x64')](_0x598e31,_0x5ba0cf)){_0xdc1fce['push']('\x22'+_0x5ba0cf+'\x22');}else{_0x3d95be[_0x3008('0x46')](_0x3008('0x6e'));}break;case _0x3008('0x6f'):if(isEmail(_0x58c999)){_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');}else{_0x3d95be[_0x3008('0x46')](_0x3008('0x70'));}break;case _0x3008('0x71'):var _0xe8efff=moment(_0x58c999,'YYYY-MM-DD',!![]);if(_0xe8efff['isValid']()){_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');}else{_0x3d95be[_0x3008('0x46')](_0x3008('0x72'));}break;case _0x3008('0x57'):var _0x27068c=shared['timezones'];var _0x48daed=_0x27068c[_0x58c999];if(!_[_0x3008('0x58')](_0x48daed)){var _0x55e0e8=_0x48daed['utcOffset'];_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');_0xdc1fce[_0x3008('0x46')]('\x22'+_0x55e0e8+'\x22');}break;default:_0xdc1fce[_0x3008('0x46')]('\x22'+_0x58c999+'\x22');}}else{switch(_0x1be69b){case _0x3008('0x73'):case _0x3008('0x12'):_0x3d95be[_0x3008('0x46')](_0x1be69b+'\x20not\x20specified');break;default:_0xdc1fce[_0x3008('0x46')]('\x22\x22');}}}}if(_0x3d95be[_0x3008('0x50')]){handleError(_0x574d81['data'][_0x597a3c],{'code':_0x3008('0x74'),'message':_0x3d95be['join']()});}else{fs['appendFileSync'](_0x4690be,_0xdc1fce[_0x3008('0x14')]()+'\x0a');}_0xdc1fce=[];}if(!(stats[_0x3008('0x68')]%0xc8)){socket[_0x3008('0x75')](_0x3008('0x76')+_0x181ff9,stats);stats['errors']=[];}}if(stopped){logger[_0x3008('0x42')](_0x3008('0x77'));_0x4df47d[_0x3008('0x78')]();}}catch(_0x27426a){handleError(_0x574d81[_0x3008('0x67')][_0x597a3c],{'code':'SystemError','message':_0x27426a[_0x3008('0x47')]});logger[_0x3008('0x44')](_0x3008('0x79'),_0x27426a[_0x3008('0x47')]);}},'complete':function(){try{var _0x1aac28=[];var _0x2e0e03=[];var _0x41f0db=_0x3008('0x2c');if(_0x431344[_0x3008('0x7a')]&&_0x431344[_0x3008('0x7a')][_0x3008('0x50')]){_0x41f0db=_0x3008('0x7b')+_0x181ff9;_0x1aac28['push'](_0x3008('0x7c')+_0x41f0db+_0x3008('0x7d'));}tmp_campaigns=_0x3008('0x7e')+_0x181ff9;tmp_voice_queues=_0x3008('0x7f')+_0x181ff9;_0x2e0e03[_0x3008('0x46')](_0x3008('0x7c')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2e0e03[_0x3008('0x46')](_0x3008('0x7c')+tmp_voice_queues+_0x3008('0x80'));BPromise[_0x3008('0x81')](_0x2e0e03,handleTZQuery)[_0x3008('0x82')](function(_0x59a053){updateTzCampaigns(_0x431344[_0x3008('0x25')])[_0x3008('0x82')](function(_0x428588){updateTzVoiceQueues(_0x431344[_0x3008('0x25')])[_0x3008('0x82')](function(_0x59d167){var _0x30b5b4=util[_0x3008('0x10')](_0x3008('0x83'),_0x4690be,_0x41f0db,_0x232dbf,_0x431344[_0x3008('0x25')],_0x431344[_0x3008('0x84')]||null,NOW,NOW);if(_['isNil'](_0x572ac9[_0x3008('0x38')])){_0x30b5b4+=_0x3008('0x85');}_0x1aac28[_0x3008('0x46')](_0x30b5b4);if(_0x431344[_0x3008('0x7a')]&&_0x431344[_0x3008('0x7a')]['length']){_0x1aac28[_0x3008('0x46')](insertCmContact(_0x431344[_0x3008('0x25')],_0x41f0db,_0x431344[_0x3008('0x7a')],_0x572ac9));_0x1aac28[_0x3008('0x46')](_0x3008('0x86')+_0x41f0db+';');}if(hasTZ){_0x1aac28['push'](insertTzCmHopper(_0x431344[_0x3008('0x25')],_0x3008('0x53'),_0x3008('0x87'),_0x3008('0x88'),_0x152b42,tmp_voice_queues));_0x1aac28[_0x3008('0x46')](insertTzCmHopperBlack(_0x431344[_0x3008('0x25')],_0x3008('0x89'),'voice_queues',_0x3008('0x88')));_0x1aac28['push'](insertTzCmHopper(_0x431344[_0x3008('0x25')],'campaigns_has_cm_lists','campaigns',_0x3008('0x8a'),_0x152b42,tmp_campaigns));_0x1aac28[_0x3008('0x46')](insertTzCmHopperBlack(_0x431344[_0x3008('0x25')],_0x3008('0x8b'),_0x3008('0x4b'),'CampaignId'));}else{_0x1aac28[_0x3008('0x46')](insertCmHopper(_0x431344['ListId'],_0x3008('0x53'),'voice_queues',_0x3008('0x88'),_0x152b42));_0x1aac28['push'](insertCmHopperBlack(_0x431344[_0x3008('0x25')],_0x3008('0x89'),_0x3008('0x87'),_0x3008('0x88')));_0x1aac28[_0x3008('0x46')](insertCmHopper(_0x431344[_0x3008('0x25')],_0x3008('0x4c'),'campaigns',_0x3008('0x8a'),_0x152b42));_0x1aac28[_0x3008('0x46')](insertCmHopperBlack(_0x431344['ListId'],_0x3008('0x8b'),_0x3008('0x4b'),_0x3008('0x8a')));}_0x1aac28['push'](_0x3008('0x86')+tmp_campaigns+';');_0x1aac28[_0x3008('0x46')](_0x3008('0x86')+tmp_voice_queues+';');BPromise[_0x3008('0x81')](_0x1aac28,handleQuery)[_0x3008('0x82')](function(_0x42bd94){stats['finish']=!![];stats[_0x3008('0x8c')]=_0x431344[_0x3008('0x7a')]&&_0x431344[_0x3008('0x7a')]['length']?results[0x2][_0x3008('0x8c')]:results[0x0][_0x3008('0x8c')];socket[_0x3008('0x75')](_0x3008('0x76')+_0x181ff9,stats);fs[_0x3008('0x8d')](_0x41eeca);fs[_0x3008('0x8d')](_0x4690be);process[_0x3008('0x8e')](0x0);})[_0x3008('0x49')](function(_0x29b968){logger[_0x3008('0x44')](_0x29b968[_0x3008('0x47')]);process[_0x3008('0x8e')](0x1);});});});});}catch(_0x503f35){logger[_0x3008('0x44')](_0x3008('0x8f'),_0x503f35[_0x3008('0x47')]);process[_0x3008('0x8e')](0x1);}},'error':function(_0x31b924,_0x164c28,_0xd3e723,_0x2321a3){throw new Error(_0x2321a3);}});}function validate(){if(process['argv']&&process['argv'][_0x3008('0x50')]<0x4){throw new Error(_0x3008('0x90'));}var _0x52c20b=path[_0x3008('0x14')](config[_0x3008('0x61')],_0x3008('0x62'),process[_0x3008('0x91')][0x2]);if(!fs[_0x3008('0x92')](_0x52c20b)){throw new Error(_0x3008('0x93'));}var _0x3e69e8={};try{_0x3e69e8=JSON[_0x3008('0x94')](process[_0x3008('0x91')][0x3]);if(!_0x3e69e8[_0x3008('0x5f')]){throw new Error(_0x3008('0x95'));}if(!_0x3e69e8[_0x3008('0x5f')][_0x3008('0x12')]){throw new Error(_0x3008('0x96'));}if(!_0x3e69e8['binding'][_0x3008('0x73')]){throw new Error('firstName\x20is\x20mandatory');}var _0x419ef7=0x0;if(_0x3e69e8[_0x3008('0x5f')]['UserId']){_0x419ef7=0x1;}if(!_0x3e69e8[_0x3008('0x25')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x28d744){throw new Error(_0x3008('0x97'));}var _0x2cb6c7=[];try{_0x2cb6c7=_['map'](JSON[_0x3008('0x94')](process['argv'][0x4]),'id');}catch(_0xb8f730){logger[_0x3008('0x42')]('No\x20agent\x20available');}main(_0x52c20b,_0x3e69e8,_0x2cb6c7,_0x419ef7);}validate();process['on']('SIGINT',handleStop);process['on'](_0x3008('0x98'),handleUncaughtException); \ No newline at end of file +var _0xe06e=['recallme','fields','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','fromQuery','ListId','cm_contacts','cm_contacts.ListId\x20=\x20','cm_hopper_black','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.createdAt','field','ListId\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','push','message','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','all','then','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','length','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','includes','header',',utcOffset','parse','data','errors','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','abort','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','each','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','DROP\x20TABLE\x20','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','UserId'];(function(_0x4f3b21,_0x2e200a){var _0x208196=function(_0x587750){while(--_0x587750){_0x4f3b21['push'](_0x4f3b21['shift']());}};_0x208196(++_0x2e200a);}(_0xe06e,0x1b4));var _0xee06=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xe06e[_0x5ce8b9];return _0xe34be0;};'use strict';var fs=require('fs');var path=require(_0xee06('0x0'));var _=require(_0xee06('0x1'));var Papa=require(_0xee06('0x2'));var util=require(_0xee06('0x3'));var BPromise=require(_0xee06('0x4'));var moment=require(_0xee06('0x5'));var squel=require('squel');var Redis=require(_0xee06('0x6'));var db=require(_0xee06('0x7'))['db'];var config=require(_0xee06('0x8'));var shared=require(_0xee06('0x9'));var logger=require('../../../config/logger')(_0xee06('0xa'));config[_0xee06('0xb')]=_[_0xee06('0xc')](config['redis'],{'host':_0xee06('0xd'),'port':0x18eb});var socket=require(_0xee06('0xe'))(new Redis(config[_0xee06('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xee06('0xf')](_0xee06('0x10'));function isEmail(_0x2679d9){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))*$/[_0xee06('0x11')](_0x2679d9);}function selectNotIn(_0x338d2f,_0x520778,_0x3d7036,_0x15ff5e,_0x269502){return squel[_0xee06('0x12')]()['field'](_0xee06('0x13'))[_0xee06('0x14')](_0x15ff5e)[_0xee06('0x15')](_0x520778,null,_0x520778+'.id\x20=\x20'+_0x15ff5e+'.'+_0x3d7036)[_0xee06('0x16')](_0x15ff5e+'.'+_0x3d7036+_0xee06('0x17')+_0x338d2f+'.'+_0x3d7036)[_0xee06('0x16')](_0x520778+_0xee06('0x18')+_0x269502[_0xee06('0x15')]()+')');}function insertCmHopper(_0x15d44f,_0x4e86d9,_0x8aab9f,_0x597530,_0x5e2907){var _0x3bd08a=[_0xee06('0x19'),_0xee06('0x1a'),_0xee06('0x1b'),_0xee06('0x1c'),_0x4e86d9+'.'+_0x597530,'cm_contacts.createdAt',_0xee06('0x1d'),_0xee06('0x1e'),_0xee06('0x1f'),'\x22'+_0x5e2907+'\x22'];return squel[_0xee06('0x20')]()[_0xee06('0x21')](_0xee06('0x22'))['fromQuery'](['phone',_0xee06('0x23'),_0xee06('0x24'),'ListId',_0x597530,_0xee06('0x25'),_0xee06('0x26'),_0xee06('0x27'),_0xee06('0x28'),_0xee06('0x29')],squel['select']()[_0xee06('0x2a')](_0x3bd08a)[_0xee06('0x14')](_0x4e86d9)[_0xee06('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x4e86d9+_0xee06('0x2b'))[_0xee06('0x15')](_0x8aab9f,null,_0x8aab9f+_0xee06('0x2c')+_0x4e86d9+'.'+_0x597530)['where'](_0x4e86d9+_0xee06('0x2d'),_0x15d44f)['where'](_0xee06('0x2e'),NOW)[_0xee06('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4e86d9,_0x8aab9f,_0x597530,_0xee06('0x22'),['\x22always\x22',_0xee06('0x2f')]))[_0xee06('0x16')](_0xee06('0x30'),selectNotIn(_0x4e86d9,_0x8aab9f,_0x597530,'cm_hopper',[_0xee06('0x31')])))[_0xee06('0x32')]();}function insertCmHopperBlack(_0x54e29a,_0x399ebc,_0x3200c7,_0x493736){var _0x316d96=[_0xee06('0x19'),_0xee06('0x1b'),_0xee06('0x1c'),_0x399ebc+'.'+_0x493736,'cm_contacts.createdAt',_0xee06('0x1d')];return squel[_0xee06('0x20')]()[_0xee06('0x21')]('cm_hopper_black')[_0xee06('0x33')]([_0xee06('0x13'),_0xee06('0x24'),_0xee06('0x34'),_0x493736,_0xee06('0x25'),_0xee06('0x26')],squel['select']()[_0xee06('0x2a')](_0x316d96)[_0xee06('0x14')](_0x399ebc)[_0xee06('0x15')](_0xee06('0x35'),null,_0xee06('0x36')+_0x399ebc+_0xee06('0x2b'))[_0xee06('0x15')](_0x3200c7,null,_0x3200c7+_0xee06('0x2c')+_0x399ebc+'.'+_0x493736)['where'](_0x399ebc+_0xee06('0x2d'),_0x54e29a)[_0xee06('0x16')](_0xee06('0x2e'),NOW)[_0xee06('0x16')](_0xee06('0x30'),squel['select']()['field'](_0xee06('0x13'))['from'](_0xee06('0x37'))[_0xee06('0x16')]('ListId\x20=\x20?',_0x54e29a)[_0xee06('0x16')](_0x493736+_0xee06('0x38'),_0x399ebc+'.'+_0x493736)))[_0xee06('0x32')]();}function insertTzCmHopper(_0x5e7da3,_0x870d38,_0x496e8f,_0x8ca417,_0x1f9dc2,_0x24020c){var _0x4aad0d=['cm_contacts.phone',_0xee06('0x39')+_0x24020c+'.offset-cm_contacts.utcOffset\x20minute)',_0xee06('0x1b'),_0xee06('0x1c'),_0x870d38+'.'+_0x8ca417,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xee06('0x1e'),_0xee06('0x1f'),'\x22'+_0x1f9dc2+'\x22'];var _0x20452d=squel['insert']()[_0xee06('0x21')](_0xee06('0x22'))['fromQuery']([_0xee06('0x13'),'scheduledat',_0xee06('0x24'),_0xee06('0x34'),_0x8ca417,_0xee06('0x25'),_0xee06('0x26'),_0xee06('0x27'),'UserId',_0xee06('0x29')],squel[_0xee06('0x12')]()[_0xee06('0x2a')](_0x4aad0d)[_0xee06('0x14')](_0x870d38)[_0xee06('0x15')](_0xee06('0x35'),null,_0xee06('0x36')+_0x870d38+_0xee06('0x2b'))['join'](_0x496e8f,null,_0x496e8f+_0xee06('0x2c')+_0x870d38+'.'+_0x8ca417)['join'](_0x24020c,null,_0x24020c+_0xee06('0x2c')+_0x870d38+'.'+_0x8ca417)[_0xee06('0x16')](_0x870d38+_0xee06('0x2d'),_0x5e7da3)[_0xee06('0x16')](_0xee06('0x2e'),NOW)[_0xee06('0x16')](_0xee06('0x30'),selectNotIn(_0x870d38,_0x496e8f,_0x8ca417,_0xee06('0x22'),[_0xee06('0x31'),_0xee06('0x2f')]))[_0xee06('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x870d38,_0x496e8f,_0x8ca417,_0xee06('0x22'),[_0xee06('0x31')])))[_0xee06('0x32')]();return _0x20452d;}function insertTzCmHopperBlack(_0x11fea4,_0x4f97cb,_0x3a4fcd,_0x396ba5){var _0x3f03d4=['cm_contacts.phone',_0xee06('0x1b'),_0xee06('0x1c'),_0x4f97cb+'.'+_0x396ba5,_0xee06('0x3a'),_0xee06('0x1d')];return squel['insert']()[_0xee06('0x21')](_0xee06('0x37'))[_0xee06('0x33')](['phone','ContactId',_0xee06('0x34'),_0x396ba5,_0xee06('0x25'),_0xee06('0x26')],squel[_0xee06('0x12')]()['fields'](_0x3f03d4)['from'](_0x4f97cb)[_0xee06('0x15')](_0xee06('0x35'),null,_0xee06('0x36')+_0x4f97cb+_0xee06('0x2b'))[_0xee06('0x15')](_0x3a4fcd,null,_0x3a4fcd+_0xee06('0x2c')+_0x4f97cb+'.'+_0x396ba5)[_0xee06('0x16')](_0x4f97cb+_0xee06('0x2d'),_0x11fea4)[_0xee06('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xee06('0x30'),squel[_0xee06('0x12')]()[_0xee06('0x3b')](_0xee06('0x13'))[_0xee06('0x14')](_0xee06('0x37'))[_0xee06('0x16')](_0xee06('0x3c'),_0x11fea4)[_0xee06('0x16')](_0x396ba5+_0xee06('0x38'),_0x4f97cb+'.'+_0x396ba5)))[_0xee06('0x32')]();}function insertCmContact(_0x4eea53,_0xd50617,_0x55d77e,_0x16b040){var _0x166adb=_[_0xee06('0x3d')](_[_0xee06('0x3e')](_0x16b040),[_0xee06('0x34'),_0xee06('0x3f'),_0xee06('0x25'),'updatedAt']);return squel[_0xee06('0x20')]()['into'](_0xee06('0x35'))[_0xee06('0x33')](_0x166adb,squel[_0xee06('0x12')]()[_0xee06('0x2a')](_0x166adb)[_0xee06('0x14')](_0xd50617)['where']('('+_0x55d77e[_0xee06('0x15')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xee06('0x2a')](_0x55d77e)[_0xee06('0x14')](_0xee06('0x35'))[_0xee06('0x16')](_0xee06('0x3c'),_0x4eea53)[_0xee06('0x16')]('deletedAt\x20IS\x20NULL'))[_0xee06('0x16')](_0xee06('0x40'),squel[_0xee06('0x12')]()['field'](_0xee06('0x41'),_0xee06('0x42'))['from'](_0xd50617)[_0xee06('0x43')](_0x55d77e[_0xee06('0x15')](','))))[_0xee06('0x32')]();}function handleStop(){logger[_0xee06('0x44')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1ed677){logger[_0xee06('0x45')](_0x1ed677['message']);process[_0xee06('0x46')](0x1);}function handleError(_0x191788,_0x591d18){stats['errors'][_0xee06('0x47')]({'name':_0x591d18['code'],'message':_0x591d18[_0xee06('0x48')],'row':_0x191788});}function handleQuery(_0x29a8be){logger[_0xee06('0x44')](_0x29a8be);return db['sequelize'][_0xee06('0x49')](_0x29a8be)[_0xee06('0x4a')](function(_0x2e2c30){results['push'](_0x2e2c30);})[_0xee06('0x4b')](function(_0xcf78c4){logger['error'](_0xcf78c4[_0xee06('0x48')]);});}function updateTzCampaigns(_0x4a1a4b){return new Promise(function(_0x3dd731,_0x4ed4df){var _0xf17d97=squel[_0xee06('0x12')]()[_0xee06('0x2a')]([_0xee06('0x4c'),_0xee06('0x4d')])[_0xee06('0x14')]('campaigns')[_0xee06('0x15')](_0xee06('0x4e'),null,_0xee06('0x4f'))[_0xee06('0x16')](_0xee06('0x50')+_0x4a1a4b);db[_0xee06('0x51')][_0xee06('0x49')](_0xf17d97['toString']())['spread'](function(_0x374c47){var _0x56182b=[];for(var _0x473743=0x0;_0x473743<_0x374c47['length'];_0x473743++){_0x56182b['push'](getTimezoneData(_0x374c47[_0x473743],tmp_campaigns));}BPromise[_0xee06('0x52')](_0x56182b)[_0xee06('0x53')](function(){_0x3dd731({'val':0x1});});})['catch'](function(_0x390c92){logger[_0xee06('0x45')](_0x390c92['message']);_0x3dd731({'val':0x0});});});}function updateTzVoiceQueues(_0x4d3047){return new Promise(function(_0xe28f0f,_0x2e3ae7){var _0x80fba4=squel['select']()[_0xee06('0x2a')]([_0xee06('0x54'),_0xee06('0x55')])['from'](_0xee06('0x56'))[_0xee06('0x15')](_0xee06('0x57'),null,_0xee06('0x58'))['where'](_0xee06('0x59')+_0x4d3047);db[_0xee06('0x51')][_0xee06('0x49')](_0x80fba4[_0xee06('0x32')]())['spread'](function(_0x2840c4){var _0x52f82f=[];for(var _0x180a4b=0x0;_0x180a4b<_0x2840c4[_0xee06('0x5a')];_0x180a4b++){_0x52f82f[_0xee06('0x47')](getTimezoneData(_0x2840c4[_0x180a4b],tmp_voice_queues));}BPromise[_0xee06('0x52')](_0x52f82f)[_0xee06('0x53')](function(){_0xe28f0f({'val':0x1});});})[_0xee06('0x4b')](function(_0x184b9b){logger[_0xee06('0x45')](_0x184b9b[_0xee06('0x48')]);_0xe28f0f({'val':0x0});});});}function getTimezoneData(_0xcbf19e,_0x3db39e){return new Promise(function(_0x5d5d8d,_0x16567e){var _0x237a71=shared[_0xee06('0x5b')];var _0x30a6bd=_0x237a71[_0xcbf19e[_0xee06('0x5c')]];if(_[_0xee06('0x5d')](_0x30a6bd)){_0x5d5d8d({'ret':0x1});}else{var _0x4b929f=_0x30a6bd[_0xee06('0x5e')];var _0x1268e9=squel[_0xee06('0x20')]()['into'](_0x3db39e)[_0xee06('0x5f')]('id',_0xcbf19e['id'])[_0xee06('0x5f')](_0xee06('0x60'),_0x4b929f)[_0xee06('0x5f')]('dialTimezone',_0xcbf19e['dialTimezone'])[_0xee06('0x32')]();return db[_0xee06('0x51')][_0xee06('0x49')](_0x1268e9)[_0xee06('0x4a')](function(_0x46a3bb){_0x5d5d8d({'ret':0x1});})[_0xee06('0x4b')](function(_0x150f44){logger['error'](_0x150f44[_0xee06('0x48')]);_0x16567e({'ret':0x1});});}});}function handleTZQuery(_0xbc48f5){logger[_0xee06('0x44')](_0xbc48f5);return db['sequelize'][_0xee06('0x49')](_0xbc48f5)[_0xee06('0x4a')](function(_0x1586ce){})[_0xee06('0x4b')](function(_0x359b3a){logger[_0xee06('0x45')](_0x359b3a[_0xee06('0x48')]);});}function main(_0x53e7aa,_0x2c25b5,_0x129d48,_0x15c6ea){logger[_0xee06('0x44')](_0xee06('0x61'),_0x53e7aa,JSON[_0xee06('0x62')](_0x2c25b5));process[_0xee06('0x63')](_0xee06('0x64'));var _0x40c6b9=_0x2c25b5[_0xee06('0x65')];var _0x160483=_0x2c25b5[_0xee06('0x66')];var _0x1d80b1=path[_0xee06('0x15')](config[_0xee06('0x67')],'server/files/tmp',_0x160483+'.csv');hasTZ=_['keys'](_0x40c6b9)[_0xee06('0x68')](_0xee06('0x5c'));var _0x46c27f=_['keys'](_0x40c6b9)[_0xee06('0x15')]();logger[_0xee06('0x44')](_0xee06('0x69'),_0x46c27f);if(hasTZ)_0x46c27f+=_0xee06('0x6a');fs['writeFileSync'](_0x1d80b1,_0x46c27f+'\x0a');Papa[_0xee06('0x6b')](fs['createReadStream'](_0x53e7aa),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ad623,_0x54598c){try{for(var _0x371bf5=0x0,_0x54425d=[];_0x371bf5<_0x2ad623[_0xee06('0x6c')][_0xee06('0x5a')];_0x371bf5++){stats['rows']+=0x1;if(_0x2ad623['errors'][_0x371bf5]){handleError(_0x2ad623['data'][_0x371bf5],_0x2ad623[_0xee06('0x6d')][_0x371bf5]);}else{var _0x129fd3=[];for(var _0x43464b in _0x40c6b9){if(_0x40c6b9[_0xee06('0x6e')](_0x43464b)){if(_0x2ad623['data'][_0x371bf5][_0x40c6b9[_0x43464b]]){var _0x249ecc=_[_0xee06('0x6f')](_0x2ad623['data'][_0x371bf5][_0x40c6b9[_0x43464b]][_0xee06('0x70')](/"/g,'\x27'));switch(_0x43464b){case _0xee06('0x23'):var _0x191a41=moment(_0x249ecc,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x191a41['isValid']()){_0x54425d['push']('\x22'+_0x249ecc+'\x22');}else{_0x129fd3['push'](_0xee06('0x71'));}break;case _0xee06('0x27'):var _0x16f383=parseInt(_0x249ecc);_0x249ecc=_[_0xee06('0x72')](_0x16f383)||_0x16f383<0x0||_0x16f383>0x4?_0x15c6ea?0x3:0x2:_0x16f383;_0x54425d[_0xee06('0x47')]('\x22'+_0x249ecc+'\x22');break;case'UserId':var _0x5c9501=parseInt(_0x249ecc);if(_[_0xee06('0x73')](_0x5c9501)&&_['includes'](_0x129d48,_0x5c9501)){_0x54425d[_0xee06('0x47')]('\x22'+_0x5c9501+'\x22');}else{_0x129fd3[_0xee06('0x47')](_0xee06('0x74'));}break;case _0xee06('0x75'):if(isEmail(_0x249ecc)){_0x54425d[_0xee06('0x47')]('\x22'+_0x249ecc+'\x22');}else{_0x129fd3[_0xee06('0x47')](_0xee06('0x76'));}break;case _0xee06('0x77'):var _0x5bf5f2=moment(_0x249ecc,_0xee06('0x78'),!![]);if(_0x5bf5f2[_0xee06('0x79')]()){_0x54425d[_0xee06('0x47')]('\x22'+_0x249ecc+'\x22');}else{_0x129fd3['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xee06('0x5c'):var _0x5dbf80=shared[_0xee06('0x5b')];var _0x2c04bb=_0x5dbf80[_0x249ecc];if(!_['isNil'](_0x2c04bb)){var _0x3f2856=_0x2c04bb[_0xee06('0x5e')];_0x54425d[_0xee06('0x47')]('\x22'+_0x249ecc+'\x22');_0x54425d[_0xee06('0x47')]('\x22'+_0x3f2856+'\x22');}break;default:_0x54425d[_0xee06('0x47')]('\x22'+_0x249ecc+'\x22');}}else{switch(_0x43464b){case _0xee06('0x7a'):case'phone':_0x129fd3[_0xee06('0x47')](_0x43464b+_0xee06('0x7b'));break;default:_0x54425d['push']('\x22\x22');}}}}if(_0x129fd3['length']){handleError(_0x2ad623['data'][_0x371bf5],{'code':_0xee06('0x7c'),'message':_0x129fd3[_0xee06('0x15')]()});}else{fs[_0xee06('0x7d')](_0x1d80b1,_0x54425d[_0xee06('0x15')]()+'\x0a');}_0x54425d=[];}if(!(stats[_0xee06('0x7e')]%0xc8)){socket['emit']('contact:import:'+_0x160483,stats);stats[_0xee06('0x6d')]=[];}}if(stopped){logger[_0xee06('0x44')]('Abort\x20parser');_0x54598c[_0xee06('0x7f')]();}}catch(_0x5b57d1){handleError(_0x2ad623[_0xee06('0x6c')][_0x371bf5],{'code':'SystemError','message':_0x5b57d1[_0xee06('0x48')]});logger['error']('step',_0x5b57d1[_0xee06('0x48')]);}},'complete':function(){try{var _0x5e9a1a=[];var _0x487169=[];var _0x1a57cc=_0xee06('0x35');if(_0x2c25b5[_0xee06('0x80')]&&_0x2c25b5[_0xee06('0x80')]['length']){_0x1a57cc=_0xee06('0x81')+_0x160483;_0x5e9a1a['push']('CREATE\x20TABLE\x20'+_0x1a57cc+_0xee06('0x82'));}tmp_campaigns=_0xee06('0x83')+_0x160483;tmp_voice_queues=_0xee06('0x84')+_0x160483;_0x487169[_0xee06('0x47')](_0xee06('0x85')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x487169[_0xee06('0x47')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xee06('0x86')](_0x487169,handleTZQuery)[_0xee06('0x53')](function(_0x3fb138){updateTzCampaigns(_0x2c25b5[_0xee06('0x34')])['then'](function(_0x19677e){updateTzVoiceQueues(_0x2c25b5[_0xee06('0x34')])[_0xee06('0x53')](function(_0x3c6cc0){var _0x5079be=util[_0xee06('0xf')](_0xee06('0x87'),_0x1d80b1,_0x1a57cc,_0x46c27f,_0x2c25b5[_0xee06('0x34')],_0x2c25b5['CompanyId']||null,NOW,NOW);if(_[_0xee06('0x5d')](_0x40c6b9[_0xee06('0x23')])){_0x5079be+=',\x20scheduledAt\x20=\x20NOW()';}_0x5e9a1a[_0xee06('0x47')](_0x5079be);if(_0x2c25b5[_0xee06('0x80')]&&_0x2c25b5[_0xee06('0x80')]['length']){_0x5e9a1a[_0xee06('0x47')](insertCmContact(_0x2c25b5[_0xee06('0x34')],_0x1a57cc,_0x2c25b5['duplicates'],_0x40c6b9));_0x5e9a1a['push'](_0xee06('0x88')+_0x1a57cc+';');}if(hasTZ){_0x5e9a1a[_0xee06('0x47')](insertTzCmHopper(_0x2c25b5[_0xee06('0x34')],_0xee06('0x57'),_0xee06('0x56'),_0xee06('0x89'),_0x15c6ea,tmp_voice_queues));_0x5e9a1a['push'](insertTzCmHopperBlack(_0x2c25b5[_0xee06('0x34')],_0xee06('0x8a'),'voice_queues',_0xee06('0x89')));_0x5e9a1a[_0xee06('0x47')](insertTzCmHopper(_0x2c25b5[_0xee06('0x34')],_0xee06('0x4e'),_0xee06('0x8b'),_0xee06('0x8c'),_0x15c6ea,tmp_campaigns));_0x5e9a1a[_0xee06('0x47')](insertTzCmHopperBlack(_0x2c25b5[_0xee06('0x34')],_0xee06('0x8d'),'campaigns','CampaignId'));}else{_0x5e9a1a[_0xee06('0x47')](insertCmHopper(_0x2c25b5[_0xee06('0x34')],'voice_queues_has_cm_lists',_0xee06('0x56'),_0xee06('0x89'),_0x15c6ea));_0x5e9a1a[_0xee06('0x47')](insertCmHopperBlack(_0x2c25b5[_0xee06('0x34')],_0xee06('0x8a'),_0xee06('0x56'),_0xee06('0x89')));_0x5e9a1a[_0xee06('0x47')](insertCmHopper(_0x2c25b5[_0xee06('0x34')],_0xee06('0x4e'),'campaigns',_0xee06('0x8c'),_0x15c6ea));_0x5e9a1a[_0xee06('0x47')](insertCmHopperBlack(_0x2c25b5['ListId'],_0xee06('0x8d'),_0xee06('0x8b'),_0xee06('0x8c')));}_0x5e9a1a[_0xee06('0x47')](_0xee06('0x88')+tmp_campaigns+';');_0x5e9a1a['push'](_0xee06('0x88')+tmp_voice_queues+';');BPromise['each'](_0x5e9a1a,handleQuery)[_0xee06('0x53')](function(_0x2c4f88){stats['finish']=!![];stats[_0xee06('0x8e')]=_0x2c25b5[_0xee06('0x80')]&&_0x2c25b5['duplicates'][_0xee06('0x5a')]?results[0x2][_0xee06('0x8e')]:results[0x0]['affectedRows'];socket['emit']('contact:import:'+_0x160483,stats);fs[_0xee06('0x8f')](_0x53e7aa);fs['unlink'](_0x1d80b1);process[_0xee06('0x46')](0x0);})[_0xee06('0x4b')](function(_0x386b27){logger[_0xee06('0x45')](_0x386b27[_0xee06('0x48')]);process[_0xee06('0x46')](0x1);});});});});}catch(_0x437c50){logger[_0xee06('0x45')](_0xee06('0x90'),_0x437c50[_0xee06('0x48')]);process[_0xee06('0x46')](0x1);}},'error':function(_0x51d387,_0x4047ca,_0x45c371,_0x4b69a7){throw new Error(_0x4b69a7);}});}function validate(){if(process[_0xee06('0x91')]&&process[_0xee06('0x91')][_0xee06('0x5a')]<0x4){throw new Error(_0xee06('0x92'));}var _0x447703=path[_0xee06('0x15')](config[_0xee06('0x67')],_0xee06('0x93'),process['argv'][0x2]);if(!fs[_0xee06('0x94')](_0x447703)){throw new Error(_0xee06('0x95'));}var _0x26196d={};try{_0x26196d=JSON['parse'](process[_0xee06('0x91')][0x3]);if(!_0x26196d[_0xee06('0x65')]){throw new Error(_0xee06('0x96'));}if(!_0x26196d[_0xee06('0x65')]['phone']){throw new Error(_0xee06('0x97'));}if(!_0x26196d[_0xee06('0x65')][_0xee06('0x7a')]){throw new Error(_0xee06('0x98'));}var _0x535f41=0x0;if(_0x26196d[_0xee06('0x65')][_0xee06('0x28')]){_0x535f41=0x1;}if(!_0x26196d[_0xee06('0x34')]){throw new Error(_0xee06('0x99'));}}catch(_0x552b1c){throw new Error(_0xee06('0x9a'));}var _0xe81af7=[];try{_0xe81af7=_[_0xee06('0x9b')](JSON[_0xee06('0x6b')](process[_0xee06('0x91')][0x4]),'id');}catch(_0x1d69a8){logger['info'](_0xee06('0x9c'));}main(_0x447703,_0x26196d,_0xe81af7,_0x535f41);}validate();process['on'](_0xee06('0x9d'),handleStop);process['on'](_0xee06('0x9e'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 0a9548b..8518081 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 _0xfe9b=['string','[xCALLY\x20Ticket]','toLowerCase','voice','variable','queue','calleridnum','outbound','push','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','answertime','endtime','duration','billableseconds','getSubjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfe9b,0x125));var _0xbfe9=function(_0x1ff98d,_0x4fbe4e){_0x1ff98d=_0x1ff98d-0x0;var _0x141980=_0xfe9b[_0x1ff98d];return _0x141980;};'use strict';exports[_0xbfe9('0x0')]=function(_0x1da9d7,_0x982de8){var _0x28840b=[{'type':_0xbfe9('0x1'),'content':_0xbfe9('0x2'),'variableName':null}];switch(_0x1da9d7[_0xbfe9('0x3')]()){case _0xbfe9('0x4'):switch(_0x982de8[_0xbfe9('0x3')]()){case'inbound':_0x28840b['push']({'type':_0xbfe9('0x5'),'content':'','variableName':_0xbfe9('0x6')});_0x28840b['push']({'type':_0xbfe9('0x5'),'content':'','variableName':_0xbfe9('0x7')});break;case _0xbfe9('0x8'):_0x28840b[_0xbfe9('0x9')]({'type':_0xbfe9('0x1'),'content':'Outbound\x20Call','variableName':null});_0x28840b[_0xbfe9('0x9')]({'type':_0xbfe9('0x5'),'content':'','variableName':_0xbfe9('0xa')});break;}}return _0x28840b;};exports[_0xbfe9('0xb')]=function(_0x12e58b,_0x5eb173){var _0x36e852=[];switch(_0x12e58b[_0xbfe9('0x3')]()){case'voice':switch(_0x5eb173['toLowerCase']()){case _0xbfe9('0xc'):_0x36e852=[{'type':_0xbfe9('0x1'),'content':_0xbfe9('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0xf'),'keyType':'variable','variableName':_0xbfe9('0x7')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x10'),'keyType':_0xbfe9('0x5'),'variableName':'calleridname'},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x11'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x12')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x13'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x6')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x14'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x15')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x16'),'keyType':'variable','variableName':_0xbfe9('0x17')},{'type':_0xbfe9('0x1'),'content':_0xbfe9('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbfe9('0x19'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x1a')},{'type':'keyValue','content':'','key':_0xbfe9('0x1b'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0xa')},{'type':'string','content':_0xbfe9('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x1d'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x17')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x1e'),'keyType':'variable','variableName':_0xbfe9('0x1f')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x20'),'keyType':_0xbfe9('0x5'),'variableName':'agentcompleteAt'},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x21'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x22')},{'type':'keyValue','content':'','key':_0xbfe9('0x23'),'keyType':_0xbfe9('0x5'),'variableName':_0xbfe9('0x24')}];break;case _0xbfe9('0x8'):_0x36e852=[{'type':_0xbfe9('0x1'),'content':_0xbfe9('0xd'),'variableName':null},{'type':_0xbfe9('0xe'),'content':'','key':'Called\x20Number','keyType':_0xbfe9('0x5'),'keyContent':'','variableName':_0xbfe9('0xa')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x25'),'keyType':_0xbfe9('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x14'),'keyType':'variable','keyContent':'','variableName':_0xbfe9('0x15')},{'type':_0xbfe9('0xe'),'content':'','key':_0xbfe9('0x16'),'keyType':_0xbfe9('0x5'),'keyContent':'','variableName':'starttime'},{'type':_0xbfe9('0x1'),'content':_0xbfe9('0x1c')},{'type':_0xbfe9('0xe'),'content':'','key':'Answer\x20Time','keyType':_0xbfe9('0x5'),'keyContent':'','variableName':_0xbfe9('0x26')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xbfe9('0x27')},{'type':'keyValue','content':'','key':'Duration','keyType':_0xbfe9('0x5'),'keyContent':'','variableName':_0xbfe9('0x28')},{'type':_0xbfe9('0xe'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xbfe9('0x29')}];break;}}return _0x36e852;}; \ No newline at end of file +var _0xc9a3=['Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','destcalleridnum','membername','starttime','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','Agent\x20Name'];(function(_0xe5f60a,_0x54b744){var _0x10df82=function(_0x885dd3){while(--_0x885dd3){_0xe5f60a['push'](_0xe5f60a['shift']());}};_0x10df82(++_0x54b744);}(_0xc9a3,0xe1));var _0x3c9a=function(_0x4b6c87,_0x2bec19){_0x4b6c87=_0x4b6c87-0x0;var _0x5c10cb=_0xc9a3[_0x4b6c87];return _0x5c10cb;};'use strict';exports[_0x3c9a('0x0')]=function(_0x10adc8,_0x1dd360){var _0x16fca3=[{'type':_0x3c9a('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x10adc8[_0x3c9a('0x2')]()){case _0x3c9a('0x3'):switch(_0x1dd360[_0x3c9a('0x2')]()){case _0x3c9a('0x4'):_0x16fca3[_0x3c9a('0x5')]({'type':_0x3c9a('0x6'),'content':'','variableName':_0x3c9a('0x7')});_0x16fca3[_0x3c9a('0x5')]({'type':'variable','content':'','variableName':_0x3c9a('0x8')});break;case _0x3c9a('0x9'):_0x16fca3[_0x3c9a('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x16fca3['push']({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x16fca3;};exports['getDescriptions']=function(_0x511b17,_0x350f85){var _0x527ad9=[];switch(_0x511b17[_0x3c9a('0x2')]()){case'voice':switch(_0x350f85[_0x3c9a('0x2')]()){case _0x3c9a('0x4'):_0x527ad9=[{'type':_0x3c9a('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3c9a('0xa'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x8')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0xc'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0xd')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0xe'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0xf')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x10'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x7')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x11'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x12')},{'type':'keyValue','content':'','key':'Date','keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x13')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3c9a('0x14'),'keyType':_0x3c9a('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0x3c9a('0x15'),'keyType':'variable','variableName':'destcalleridnum'},{'type':'string','content':_0x3c9a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3c9a('0x17'),'keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x13')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x18'),'keyType':'variable','variableName':_0x3c9a('0x19')},{'type':_0x3c9a('0xb'),'content':'','key':'Agent\x20Complete','keyType':_0x3c9a('0x6'),'variableName':_0x3c9a('0x1a')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x1b'),'keyType':'variable','variableName':_0x3c9a('0x1c')},{'type':'keyValue','content':'','key':_0x3c9a('0x1d'),'keyType':'variable','variableName':_0x3c9a('0x1e')}];break;case _0x3c9a('0x9'):_0x527ad9=[{'type':_0x3c9a('0x1'),'content':_0x3c9a('0x1f'),'variableName':null},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x20'),'keyType':_0x3c9a('0x6'),'keyContent':'','variableName':_0x3c9a('0x21')},{'type':_0x3c9a('0xb'),'content':'','key':'Member\x20Name','keyType':_0x3c9a('0x6'),'keyContent':'','variableName':_0x3c9a('0x22')},{'type':_0x3c9a('0xb'),'content':'','key':'UniqueId','keyType':_0x3c9a('0x6'),'keyContent':'','variableName':_0x3c9a('0x12')},{'type':_0x3c9a('0xb'),'content':'','key':'Date','keyType':_0x3c9a('0x6'),'keyContent':'','variableName':_0x3c9a('0x23')},{'type':_0x3c9a('0x1'),'content':_0x3c9a('0x16')},{'type':'keyValue','content':'','key':_0x3c9a('0x24'),'keyType':_0x3c9a('0x6'),'keyContent':'','variableName':_0x3c9a('0x25')},{'type':_0x3c9a('0xb'),'content':'','key':'Complete\x20Time','keyType':_0x3c9a('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x26'),'keyType':'variable','keyContent':'','variableName':_0x3c9a('0x27')},{'type':_0x3c9a('0xb'),'content':'','key':_0x3c9a('0x28'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x527ad9;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 23cd54e..c3709d8 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 _0xe8ef=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','upperFirst','toLowerCase','role','stringify','null','Interaction','then','update','info','catch','tracked','query','body','omit','html','fax','mobile','lodash','../../mysqldb'];(function(_0x2a453b,_0x54de96){var _0x124772=function(_0x537298){while(--_0x537298){_0x2a453b['push'](_0x2a453b['shift']());}};_0x124772(++_0x54de96);}(_0xe8ef,0xd6));var _0xfe8e=function(_0x403ffc,_0x538e09){_0x403ffc=_0x403ffc-0x0;var _0x3f2219=_0xe8ef[_0x403ffc];return _0x3f2219;};'use strict';var _=require(_0xfe8e('0x0'));var db=require(_0xfe8e('0x1'))['db'];var loggers={'openchannel':require(_0xfe8e('0x2'))(_0xfe8e('0x3')),'mail':require(_0xfe8e('0x2'))(_0xfe8e('0x4')),'fax':require('../../config/logger')(_0xfe8e('0x5')),'sms':require(_0xfe8e('0x2'))(_0xfe8e('0x6')),'chat':require('../../config/logger')(_0xfe8e('0x7')),'whatsapp':require(_0xfe8e('0x2'))(_0xfe8e('0x8'))};function getInteractionId(_0x5a72ba,_0x2a529f,_0x1e6e63){if(_0x5a72ba&&_0x5a72ba[_['upperFirst'](_0x1e6e63)+_0xfe8e('0x9')]){return _0x5a72ba[_[_0xfe8e('0xa')](_0x1e6e63)+_0xfe8e('0x9')];}else if(_0x5a72ba&&_0x5a72ba['id']){return _0x5a72ba['id'];}else if(_0x2a529f&&_0x2a529f['id']){return _0x2a529f['id'];}else{return'unknown';}}function log(_0x1fb43f,_0x2bbe0a,_0x1a3c87,_0x5190ca,_0x2721f7,_0x3abb13){loggers[_0x2721f7[_0xfe8e('0xb')]()][_0x1fb43f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3abb13['toUpperCase'](),_0x2bbe0a?_0x2bbe0a['id']:null,_0x2bbe0a?_0x2bbe0a['name']:null,_0x2bbe0a?_0x2bbe0a[_0xfe8e('0xc')]:null,getInteractionId(_0x1a3c87,_0x5190ca,_0x2721f7),_0x1a3c87?JSON[_0xfe8e('0xd')](_0x1a3c87):_0xfe8e('0xe'));}function updateUser(_0x523cec,_0x464bd3,_0x2c2fed,_0x6d17a0,_0x122844){db[_['upperFirst'](_0x6d17a0)+_0xfe8e('0xf')]['findOne']({'where':{'id':getInteractionId(_0x464bd3,_0x2c2fed,_0x6d17a0)}})[_0xfe8e('0x10')](function(_0x2df240){if(_0x2df240){return _0x2df240[_0xfe8e('0x11')]({'UserId':_0x523cec?_0x523cec['id']:null});}})['then'](function(_0x33412f){if(_0x33412f){log(_0xfe8e('0x12'),_0x523cec,_0x464bd3,_0x2c2fed,_0x6d17a0,_0x122844);}})[_0xfe8e('0x13')](function(){log('error',_0x523cec,_0x464bd3,_0x2c2fed,_0x6d17a0,_0x122844);});}exports[_0xfe8e('0x14')]=function(_0x49b8e0,_0x4acac4){return function(_0x2dbdf1,_0x549f0a,_0x991561){var _0x130eb6=_0x2dbdf1['user'];var _0x2a2831={};var _0x279de0=_0x2dbdf1[_0xfe8e('0x15')];if(_0x2a2831){_0x2a2831=_['clone'](_0x2dbdf1[_0xfe8e('0x16')]);_0x2a2831=_[_0xfe8e('0x17')](_0x2a2831,['body',_0xfe8e('0x18'),'phone',_0xfe8e('0x19'),_0xfe8e('0x1a')]);}updateUser(_0x130eb6,_0x2a2831,_0x279de0,_0x49b8e0,_0x4acac4);_0x991561(null);};}; \ No newline at end of file +var _0x361f=['null','findOne','then','update','error','user','query','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role'];(function(_0x17c671,_0x516c0f){var _0x4e0973=function(_0xc7faa6){while(--_0xc7faa6){_0x17c671['push'](_0x17c671['shift']());}};_0x4e0973(++_0x516c0f);}(_0x361f,0xed));var _0xf361=function(_0x516205,_0x315bb2){_0x516205=_0x516205-0x0;var _0x489073=_0x361f[_0x516205];return _0x489073;};'use strict';var _=require(_0xf361('0x0'));var db=require(_0xf361('0x1'))['db'];var loggers={'openchannel':require(_0xf361('0x2'))('openchannel-interactions'),'mail':require(_0xf361('0x2'))(_0xf361('0x3')),'fax':require('../../config/logger')(_0xf361('0x4')),'sms':require(_0xf361('0x2'))(_0xf361('0x5')),'chat':require(_0xf361('0x2'))(_0xf361('0x6')),'whatsapp':require(_0xf361('0x2'))('whatsapp-interactions')};function getInteractionId(_0x55012d,_0x576473,_0x39b137){if(_0x55012d&&_0x55012d[_[_0xf361('0x7')](_0x39b137)+_0xf361('0x8')]){return _0x55012d[_[_0xf361('0x7')](_0x39b137)+'InteractionId'];}else if(_0x55012d&&_0x55012d['id']){return _0x55012d['id'];}else if(_0x576473&&_0x576473['id']){return _0x576473['id'];}else{return _0xf361('0x9');}}function log(_0x5aeb84,_0x37da76,_0x3316a2,_0x24ea7d,_0x25a6db,_0x3b0959){loggers[_0x25a6db[_0xf361('0xa')]()][_0x5aeb84](_0xf361('0xb'),_0x3b0959[_0xf361('0xc')](),_0x37da76?_0x37da76['id']:null,_0x37da76?_0x37da76[_0xf361('0xd')]:null,_0x37da76?_0x37da76[_0xf361('0xe')]:null,getInteractionId(_0x3316a2,_0x24ea7d,_0x25a6db),_0x3316a2?JSON['stringify'](_0x3316a2):_0xf361('0xf'));}function updateUser(_0x90ba0,_0x332877,_0x33faf7,_0x20b4bc,_0x15b89a){db[_[_0xf361('0x7')](_0x20b4bc)+'Interaction'][_0xf361('0x10')]({'where':{'id':getInteractionId(_0x332877,_0x33faf7,_0x20b4bc)}})[_0xf361('0x11')](function(_0x3fd83e){if(_0x3fd83e){return _0x3fd83e[_0xf361('0x12')]({'UserId':_0x90ba0?_0x90ba0['id']:null});}})['then'](function(_0x326e21){if(_0x326e21){log('info',_0x90ba0,_0x332877,_0x33faf7,_0x20b4bc,_0x15b89a);}})['catch'](function(){log(_0xf361('0x13'),_0x90ba0,_0x332877,_0x33faf7,_0x20b4bc,_0x15b89a);});}exports['tracked']=function(_0x218f65,_0xce0e1a){return function(_0x2f5522,_0x19efeb,_0x5d38f3){var _0x269763=_0x2f5522[_0xf361('0x14')];var _0x211f76={};var _0x52b661=_0x2f5522[_0xf361('0x15')];if(_0x211f76){_0x211f76=_[_0xf361('0x16')](_0x2f5522[_0xf361('0x17')]);_0x211f76=_[_0xf361('0x18')](_0x211f76,['body',_0xf361('0x19'),_0xf361('0x1a'),_0xf361('0x1b'),'mobile']);}updateUser(_0x269763,_0x211f76,_0x52b661,_0x218f65,_0xce0e1a);_0x5d38f3(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 5688695..fd89a9b 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 _0x3a39=['composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util'];(function(_0x50a6d2,_0x41545d){var _0x52d520=function(_0x3de2ac){while(--_0x3de2ac){_0x50a6d2['push'](_0x50a6d2['shift']());}};_0x52d520(++_0x41545d);}(_0x3a39,0x9a));var _0x93a3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3a39[_0x53ccf2];return _0x5a2964;};'use strict';var crypto=require('crypto');var util=require(_0x93a3('0x0'));var compose=require(_0x93a3('0x1'));var db=require(_0x93a3('0x2'))['db'];var config=require(_0x93a3('0x3'));function getValueFromLicense(_0x121248,_0x2e26cd){if(_0x121248&&_0x2e26cd){if(_0x2e26cd[_0x93a3('0x4')]&&_0x2e26cd[_0x93a3('0x5')]){var _0x1f15e9=_0x2e26cd[_0x93a3('0x4')];var _0x1b6711=_0x2e26cd[_0x93a3('0x5')];var _0x19df9a=_0x1f15e9[_0x93a3('0x6')]('-')[0x4];var _0x1a3249=_0x1f15e9['split']('-')[0x0];var _0x441c8b=crypto[_0x93a3('0x7')](_0x93a3('0x8'),util[_0x93a3('0x9')](_0x93a3('0xa'),_0x19df9a,_0x1f15e9,_0x1a3249));var _0x31d7c6=_0x441c8b[_0x93a3('0xb')](_0x1b6711,_0x93a3('0xc'),_0x93a3('0xd'));_0x31d7c6+=_0x441c8b[_0x93a3('0xe')]('utf8');var _0x1ecec8=JSON[_0x93a3('0xf')](_0x31d7c6);return _0x1ecec8[_0x93a3('0x10')](_0x121248)?_0x1ecec8[_0x121248]:null;}}return null;}function isLimit(_0x35a8fe,_0x247272,_0x47e169,_0x57c147){var _0x5a9043=_0x247272;return compose()[_0x93a3('0x11')](function(_0x4fe2f4,_0x5354a5,_0xc4df29){return db[_0x93a3('0x12')][_0x93a3('0x13')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x412200){var _0x11ef85=getValueFromLicense(_0x35a8fe,_0x412200);return _0x11ef85?_0x11ef85:_0x5a9043;})[_0x93a3('0x14')](function(_0x25be7d){_0x5a9043=_0x25be7d;return _0x47e169[_0x93a3('0x15')](_0x57c147);})[_0x93a3('0x14')](function(_0x1eed69){if(_0x1eed69>=_0x5a9043){return _0x5354a5[_0x93a3('0x16')](0x193)[_0x93a3('0x17')]({'message':util[_0x93a3('0x9')](_0x93a3('0x18'),_0x35a8fe)});}_0xc4df29();})[_0x93a3('0x19')](function(_0x549ba8){_0xc4df29(_0x549ba8);});});}function isUserLimit(){return isLimit(_0x93a3('0x1a'),0x1,db[_0x93a3('0x1b')],{'where':{'$or':[{'role':_0x93a3('0x1c')},{'role':_0x93a3('0x1d')}]}});}exports[_0x93a3('0x1e')]=isUserLimit; \ No newline at end of file +var _0x3479=['parse','hasOwnProperty','use','License','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','update','utf8'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x3479,0x80));var _0x9347=function(_0x27ddf5,_0x5a3e18){_0x27ddf5=_0x27ddf5-0x0;var _0x26e74a=_0x3479[_0x27ddf5];return _0x26e74a;};'use strict';var crypto=require(_0x9347('0x0'));var util=require(_0x9347('0x1'));var compose=require(_0x9347('0x2'));var db=require(_0x9347('0x3'))['db'];var config=require(_0x9347('0x4'));function getValueFromLicense(_0x57dc4a,_0x5e3794){if(_0x57dc4a&&_0x5e3794){if(_0x5e3794[_0x9347('0x5')]&&_0x5e3794[_0x9347('0x6')]){var _0x463470=_0x5e3794[_0x9347('0x5')];var _0x5bc216=_0x5e3794[_0x9347('0x6')];var _0x2333b8=_0x463470['split']('-')[0x4];var _0x1fce47=_0x463470[_0x9347('0x7')]('-')[0x0];var _0x3420d9=crypto['createDecipher']('aes-256-ctr',util['format']('%s:%s:%s',_0x2333b8,_0x463470,_0x1fce47));var _0x4fb303=_0x3420d9[_0x9347('0x8')](_0x5bc216,'base64',_0x9347('0x9'));_0x4fb303+=_0x3420d9['final'](_0x9347('0x9'));var _0xe3044=JSON[_0x9347('0xa')](_0x4fb303);return _0xe3044[_0x9347('0xb')](_0x57dc4a)?_0xe3044[_0x57dc4a]:null;}}return null;}function isLimit(_0x3a916d,_0x36aff5,_0x2a0360,_0x31b5dc){var _0x33d814=_0x36aff5;return compose()[_0x9347('0xc')](function(_0x4e7092,_0xcfbd81,_0x31e414){return db[_0x9347('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x32bdd9){var _0x37934a=getValueFromLicense(_0x3a916d,_0x32bdd9);return _0x37934a?_0x37934a:_0x33d814;})[_0x9347('0xe')](function(_0x806f4f){_0x33d814=_0x806f4f;return _0x2a0360[_0x9347('0xf')](_0x31b5dc);})['then'](function(_0x12355f){if(_0x12355f>=_0x33d814){return _0xcfbd81['status'](0x193)[_0x9347('0x10')]({'message':util[_0x9347('0x11')](_0x9347('0x12'),_0x3a916d)});}_0x31e414();})['catch'](function(_0x4f7c44){_0x31e414(_0x4f7c44);});});}function isUserLimit(){return isLimit(_0x9347('0x13'),0x1,db[_0x9347('0x14')],{'where':{'$or':[{'role':_0x9347('0x15')},{'role':'user'}]}});}exports[_0x9347('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1ff8e14..52927f2 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 _0xf9f2=['LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','format','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','length','split','slice','forEach','shift','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x2b8af8,_0x2e1296){var _0x5c4e07=function(_0x3c9c5c){while(--_0x3c9c5c){_0x2b8af8['push'](_0x2b8af8['shift']());}};_0x5c4e07(++_0x2e1296);}(_0xf9f2,0x14b));var _0x2f9f=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0xf9f2[_0x14cb58];return _0x5f097e;};'use strict';var _=require(_0x2f9f('0x0'));var moment=require(_0x2f9f('0x1'));exports['parseSearch']=function(_0x58a008){var _0x173c0b={'conditions':[]};_0x173c0b[_0x2f9f('0x2')]=_[_0x2f9f('0x3')](_0x58a008,_0x2f9f('0x4'))?'or':_0x2f9f('0x5');var _0x519854=_0x58a008['replace']('[$and]','')[_0x2f9f('0x6')]('[$or]','')['split']('||');for(var _0x530b87=0x0;_0x530b87<_0x519854[_0x2f9f('0x7')];_0x530b87++){var _0x2af5bf=_0x519854[_0x530b87][_0x2f9f('0x8')](':=');var _0x272172=_0x2af5bf[0x0];var _0x345d68=_0x2af5bf[_0x2f9f('0x9')](0x1);_0x345d68[_0x2f9f('0xa')](function(_0x5f51c3){var _0x2af59b=_0x5f51c3[_0x2f9f('0x8')]('[')[_0x2f9f('0xb')]();var _0x479d77=_0x5f51c3['match'](/\[(.*?)\]/g);_0x479d77['forEach'](function(_0x202b5b){var _0xe07336=_0x202b5b[_0x2f9f('0x8')]('[')['filter'](function(_0x37a7b8){return _0x37a7b8[_0x2f9f('0xc')](']')>-0x1;})[_0x2f9f('0xd')](function(_0xd3310c){return _0xd3310c[_0x2f9f('0x8')](']')[0x0];})[0x0];_0x173c0b['conditions'][_0x2f9f('0xe')]({'field':_0x272172,'operator':_0x2af59b,'value':_0xe07336});});});}return _0x173c0b;};exports[_0x2f9f('0xf')]=function(_0xbab5cd,_0xaf449d,_0x5e7a3d){var _0x86cf1a={};if(_0xaf449d===_0x2f9f('0x10')){if(_0x5e7a3d[_0x2f9f('0x11')]===_0x2f9f('0x12')){_0x5e7a3d[_0x2f9f('0x11')]=_0x2f9f('0x13');_0x5e7a3d[_0x2f9f('0x14')]+=','+_0x5e7a3d[_0x2f9f('0x14')];}else if(_['includes']([_0x2f9f('0x15'),'$lte'],_0x5e7a3d['operator'])){_0x5e7a3d['value']=moment(_0x5e7a3d[_0x2f9f('0x14')])[_0x2f9f('0x16')](0x1,_0x2f9f('0x17'))['format'](_0x2f9f('0x18'));}}if(_0x5e7a3d[_0x2f9f('0x19')]){_0xaf449d=_0x5e7a3d[_0x2f9f('0x19')];_0x86cf1a[_0x2f9f('0x1a')]=_0x2f9f('0x1b')+_0xbab5cd+'.'+_0x5e7a3d[_0x2f9f('0x1c')]+_0x2f9f('0x1d')+_0x5e7a3d[_0x2f9f('0x19')]+')\x20'+parseOperator(_0x5e7a3d[_0x2f9f('0x11')]);}else{_0x86cf1a['text']=_0xbab5cd+'.'+_0x5e7a3d[_0x2f9f('0x1c')]+'\x20'+parseOperator(_0x5e7a3d[_0x2f9f('0x11')]);}if(_[_0x2f9f('0x1e')]([_0x2f9f('0x1f'),'$notIn'],_0x5e7a3d[_0x2f9f('0x11')]))_0x86cf1a['text']='('+_0x86cf1a[_0x2f9f('0x1a')]+'\x20OR\x20'+_0xbab5cd+'.'+_0x5e7a3d[_0x2f9f('0x1c')]+_0x2f9f('0x20');_0x86cf1a[_0x2f9f('0x14')]=parseValue(_0xaf449d,_0x5e7a3d[_0x2f9f('0x11')],_0x5e7a3d[_0x2f9f('0x14')]);return _0x86cf1a;};function parseOperator(_0x1d9874){var _0x55c381;switch(_0x1d9874){case _0x2f9f('0x21'):_0x55c381=_0x2f9f('0x22');break;case'$notIn':_0x55c381='NOT\x20IN\x20?';break;case'$eq':_0x55c381=_0x2f9f('0x23');break;case _0x2f9f('0x1f'):_0x55c381=_0x2f9f('0x24');break;case _0x2f9f('0x25'):case _0x2f9f('0x26'):case _0x2f9f('0x27'):_0x55c381=_0x2f9f('0x28');break;case _0x2f9f('0x29'):_0x55c381=_0x2f9f('0x2a');break;case _0x2f9f('0x15'):_0x55c381=_0x2f9f('0x2b');break;case'$lte':_0x55c381=_0x2f9f('0x2c');break;case'$gte':_0x55c381='>=\x20?';break;case'$between':_0x55c381=_0x2f9f('0x2d');break;}return _0x55c381;}function parseValue(_0x3efc3e,_0x37c61f,_0x58bf83){var _0x552a9e={'start':undefined,'end':undefined};switch(_0x37c61f){case _0x2f9f('0x21'):case'$notIn':_0x552a9e['start']=_0x58bf83['split'](',');break;case'$substring':_0x552a9e['start']='%'+_0x58bf83+'%';break;case'$startsWith':_0x552a9e[_0x2f9f('0x2e')]=_0x58bf83+'%';break;case'$endsWith':_0x552a9e[_0x2f9f('0x2e')]='%'+_0x58bf83;break;case _0x2f9f('0x13'):var _0x188d43=_0x58bf83['split'](',');var _0x58bf83=_0x188d43[_0x2f9f('0xb')]();var _0x3e40ff=_0x188d43[_0x2f9f('0x2f')]();if(_0x3efc3e===_0x2f9f('0x10')){_0x58bf83=moment(_0x58bf83)['utcOffset'](0x0,!![])[_0x2f9f('0x30')]();_0x3e40ff=moment(_0x3e40ff)[_0x2f9f('0x31')](0x0,!![])['add'](0x17,_0x2f9f('0x32'))[_0x2f9f('0x16')](0x3b,_0x2f9f('0x33'))[_0x2f9f('0x16')](0x3b,_0x2f9f('0x34'))[_0x2f9f('0x30')]();}_0x552a9e={'start':_0x58bf83,'end':_0x3e40ff};break;default:_0x552a9e[_0x2f9f('0x2e')]=_0x58bf83;break;}return _0x552a9e;} \ No newline at end of file +var _0x5e41=['$lte','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','DATE','utcOffset','hours','minutes','moment','parseSearch','sqlOperator','[$or]','replace','[$and]','split','slice','forEach','match','filter','indexOf','map','push','buildExpression','operator','$eq','value','includes','$gt','add','days','format','YYYY-MM-DD','castTo','text','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?'];(function(_0x238c0a,_0x4280f5){var _0x2f4c63=function(_0x7b3f07){while(--_0x7b3f07){_0x238c0a['push'](_0x238c0a['shift']());}};_0x2f4c63(++_0x4280f5);}(_0x5e41,0xd7));var _0x15e4=function(_0x22bc5b,_0x39319d){_0x22bc5b=_0x22bc5b-0x0;var _0x3f5b1f=_0x5e41[_0x22bc5b];return _0x3f5b1f;};'use strict';var _=require('lodash');var moment=require(_0x15e4('0x0'));exports[_0x15e4('0x1')]=function(_0x51de3f){var _0x51026c={'conditions':[]};_0x51026c[_0x15e4('0x2')]=_['startsWith'](_0x51de3f,_0x15e4('0x3'))?'or':'and';var _0x3914fb=_0x51de3f[_0x15e4('0x4')](_0x15e4('0x5'),'')[_0x15e4('0x4')](_0x15e4('0x3'),'')['split']('||');for(var _0x48e963=0x0;_0x48e963<_0x3914fb['length'];_0x48e963++){var _0x42ea79=_0x3914fb[_0x48e963][_0x15e4('0x6')](':=');var _0x12f880=_0x42ea79[0x0];var _0x25e155=_0x42ea79[_0x15e4('0x7')](0x1);_0x25e155[_0x15e4('0x8')](function(_0x24d3ac){var _0x2a4943=_0x24d3ac[_0x15e4('0x6')]('[')['shift']();var _0x366dbf=_0x24d3ac[_0x15e4('0x9')](/\[(.*?)\]/g);_0x366dbf[_0x15e4('0x8')](function(_0x1be99b){var _0x296fe9=_0x1be99b[_0x15e4('0x6')]('[')[_0x15e4('0xa')](function(_0x5a05e0){return _0x5a05e0[_0x15e4('0xb')](']')>-0x1;})[_0x15e4('0xc')](function(_0x47fdd3){return _0x47fdd3[_0x15e4('0x6')](']')[0x0];})[0x0];_0x51026c['conditions'][_0x15e4('0xd')]({'field':_0x12f880,'operator':_0x2a4943,'value':_0x296fe9});});});}return _0x51026c;};exports[_0x15e4('0xe')]=function(_0x1f8627,_0x4f893a,_0x334760){var _0x478c2e={};if(_0x4f893a==='DATE'){if(_0x334760[_0x15e4('0xf')]===_0x15e4('0x10')){_0x334760[_0x15e4('0xf')]='$between';_0x334760['value']+=','+_0x334760[_0x15e4('0x11')];}else if(_[_0x15e4('0x12')]([_0x15e4('0x13'),'$lte'],_0x334760['operator'])){_0x334760[_0x15e4('0x11')]=moment(_0x334760[_0x15e4('0x11')])[_0x15e4('0x14')](0x1,_0x15e4('0x15'))[_0x15e4('0x16')](_0x15e4('0x17'));}}if(_0x334760[_0x15e4('0x18')]){_0x4f893a=_0x334760[_0x15e4('0x18')];_0x478c2e[_0x15e4('0x19')]='CAST('+_0x1f8627+'.'+_0x334760[_0x15e4('0x1a')]+'\x20AS\x20'+_0x334760[_0x15e4('0x18')]+')\x20'+parseOperator(_0x334760[_0x15e4('0xf')]);}else{_0x478c2e[_0x15e4('0x19')]=_0x1f8627+'.'+_0x334760['field']+'\x20'+parseOperator(_0x334760[_0x15e4('0xf')]);}if(_['includes']([_0x15e4('0x1b'),_0x15e4('0x1c')],_0x334760[_0x15e4('0xf')]))_0x478c2e[_0x15e4('0x19')]='('+_0x478c2e['text']+_0x15e4('0x1d')+_0x1f8627+'.'+_0x334760[_0x15e4('0x1a')]+_0x15e4('0x1e');_0x478c2e[_0x15e4('0x11')]=parseValue(_0x4f893a,_0x334760['operator'],_0x334760[_0x15e4('0x11')]);return _0x478c2e;};function parseOperator(_0x10ab49){var _0x1e21a3;switch(_0x10ab49){case _0x15e4('0x1f'):_0x1e21a3=_0x15e4('0x20');break;case _0x15e4('0x1c'):_0x1e21a3=_0x15e4('0x21');break;case _0x15e4('0x10'):_0x1e21a3='=\x20?';break;case _0x15e4('0x1b'):_0x1e21a3='<>\x20?';break;case _0x15e4('0x22'):case _0x15e4('0x23'):case _0x15e4('0x24'):_0x1e21a3='LIKE\x20?';break;case _0x15e4('0x25'):_0x1e21a3=_0x15e4('0x26');break;case _0x15e4('0x13'):_0x1e21a3=_0x15e4('0x27');break;case _0x15e4('0x28'):_0x1e21a3=_0x15e4('0x29');break;case _0x15e4('0x2a'):_0x1e21a3=_0x15e4('0x2b');break;case _0x15e4('0x2c'):_0x1e21a3=_0x15e4('0x2d');break;}return _0x1e21a3;}function parseValue(_0xa2c391,_0x3df102,_0x3bce40){var _0x4ecea0={'start':undefined,'end':undefined};switch(_0x3df102){case'$in':case _0x15e4('0x1c'):_0x4ecea0[_0x15e4('0x2e')]=_0x3bce40[_0x15e4('0x6')](',');break;case _0x15e4('0x22'):_0x4ecea0[_0x15e4('0x2e')]='%'+_0x3bce40+'%';break;case _0x15e4('0x23'):_0x4ecea0[_0x15e4('0x2e')]=_0x3bce40+'%';break;case'$endsWith':_0x4ecea0['start']='%'+_0x3bce40;break;case'$between':var _0x4d8fd6=_0x3bce40['split'](',');var _0x3bce40=_0x4d8fd6['shift']();var _0x4b0321=_0x4d8fd6['pop']();if(_0xa2c391===_0x15e4('0x2f')){_0x3bce40=moment(_0x3bce40)[_0x15e4('0x30')](0x0,!![])['format']();_0x4b0321=moment(_0x4b0321)[_0x15e4('0x30')](0x0,!![])[_0x15e4('0x14')](0x17,_0x15e4('0x31'))[_0x15e4('0x14')](0x3b,_0x15e4('0x32'))['add'](0x3b,'seconds')[_0x15e4('0x16')]();}_0x4ecea0={'start':_0x3bce40,'end':_0x4b0321};break;default:_0x4ecea0['start']=_0x3bce40;break;}return _0x4ecea0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index c8c733f..f49a71f 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 _0xd6d6=['merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','fields','isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','uniqueid','isArray','split','limit','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','push','getOptions','$id','query','model','name','filters','intersection','attributes','nolimit','offset','order','where','pick','filter','object','columns','value'];(function(_0xb92ed6,_0x3c5d53){var _0x4ff6ae=function(_0x5dab92){while(--_0x5dab92){_0xb92ed6['push'](_0xb92ed6['shift']());}};_0x4ff6ae(++_0x3c5d53);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x50e3e1,_0x3de497){_0x50e3e1=_0x50e3e1-0x0;var _0x29563a=_0xd6d6[_0x50e3e1];return _0x29563a;};'use strict';var _=require(_0x6d6d('0x0'));var sequelize=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33226e){var _0x536523=['ne'];try{var _0x2e1aed=JSON[_0x6d6d('0x3')](_0x33226e);var _0x1b8610=Object[_0x6d6d('0x4')](_0x2e1aed)[0x0];return _0x536523[_0x6d6d('0x5')](_0x1b8610);}catch(_0x16e259){return![];}}function getOperatorValue(_0x35a813){var _0x5702dc=JSON[_0x6d6d('0x3')](_0x35a813);var _0x1bf731=Object[_0x6d6d('0x4')](_0x5702dc)[0x0];var _0x18f824=_0x5702dc[_0x1bf731];return{['$'+_0x1bf731]:_0x18f824};}exports[_0x6d6d('0x6')]=function(_0x408f88){var _0x3e69a4=null;if(_0x408f88){_0x3e69a4=_0x408f88['split'](',');}return _0x3e69a4;};exports['filters']=function(_0x404c88,_0x1fa46d){var _0x23b18a={};if(!_[_0x6d6d('0x7')](_0x404c88)){_[_0x6d6d('0x8')](_0x404c88,function(_0x576c88,_0x1f2b86){try{if(_0x1fa46d){var _0x158f82=_['find'](_0x1fa46d,{'name':_0x1f2b86})||{};if(hasSequelizeOperator(_0x576c88)){_0x23b18a[_0x1f2b86]=getOperatorValue(_0x576c88);}else if(_0x158f82['type']===_0x6d6d('0x9')&&_[_0x6d6d('0xa')](_0x576c88)){var _0xe61c36=JSON[_0x6d6d('0x3')](_0x576c88);var _0x2b74ed={'$gte':moment(moment(_0xe61c36[_0x6d6d('0xb')])[_0x6d6d('0xc')](_0x6d6d('0xd')))['utc']()[_0x6d6d('0xc')](),'$lte':moment(moment(_0xe61c36[_0x6d6d('0xe')])[_0x6d6d('0xc')](_0x6d6d('0xd')))[_0x6d6d('0xf')]()['subtract'](0x1,'s')[_0x6d6d('0xc')]()};_0x23b18a[_0x1f2b86]=_0x2b74ed;}else if(_0x158f82['name']===_0x6d6d('0x10')){_0x23b18a[_0x1f2b86]=_0x576c88;}else{_0x23b18a[_0x1f2b86]=_[_0x6d6d('0x11')](_0x576c88)?_0x576c88:JSON[_0x6d6d('0x3')](_0x576c88);}}else{_0x23b18a[_0x1f2b86]=_['isArray'](_0x576c88)?_0x576c88:JSON['parse'](_0x576c88);}}catch(_0x9e1e18){_0x23b18a[_0x1f2b86]=_0x576c88[_0x6d6d('0x12')](',');}});}return _0x23b18a;};exports[_0x6d6d('0x13')]=function(_0x2c5314){_0x2c5314=parseInt(_0x2c5314,0xa);if(!_0x2c5314||_0x2c5314<0x0){_0x2c5314=LIMIT_VALUE;}return _0x2c5314;};exports['offset']=function(_0x554392){_0x554392=parseInt(_0x554392,0xa);if(!_0x554392||_0x554392<0x0){_0x554392=0x0;}return _0x554392;};exports[_0x6d6d('0x14')]=function(_0x5a5855){var _0x26f631,_0xb8590d=null;if(_0x5a5855){_0x26f631=_0x5a5855[_0x6d6d('0x12')](',');_0xb8590d=_[_0x6d6d('0x15')](_0x26f631,function(_0x40d35b){if(_0x40d35b[_0x6d6d('0x16')]('-')===0x0){return[_0x40d35b===_0x6d6d('0x17')?sequelize[_0x6d6d('0x18')](sequelize[_0x6d6d('0x19')](_0x6d6d('0x17')),_0x6d6d('0x1a')):_0x40d35b[_0x6d6d('0x1b')](0x1),_0x6d6d('0x1c')];}else{return[_0x40d35b===_0x6d6d('0x17')?sequelize[_0x6d6d('0x18')](sequelize[_0x6d6d('0x19')](_0x6d6d('0x17')),'unsigned'):_0x40d35b,_0x6d6d('0x1d')];}});}return _0xb8590d;};exports[_0x6d6d('0x1e')]=function(_0x99f7d6,_0x97ec9e){if(_[_0x6d6d('0x7')](_0x99f7d6)){return _0x99f7d6;}if(_[_0x6d6d('0x11')](_0x99f7d6)){for(var _0x554f8e=0x0;_0x554f8e<_0x99f7d6[_0x6d6d('0x1f')];_0x554f8e+=0x1){_0x99f7d6[_0x554f8e]=this[_0x6d6d('0x1e')](_0x99f7d6[_0x554f8e],_0x97ec9e);}return _0x99f7d6;}if(!_[_0x6d6d('0x20')](_0x99f7d6)){return _0x99f7d6;}if(_[_0x6d6d('0x21')](_0x97ec9e)){_0x97ec9e=[_0x97ec9e];}if(!_[_0x6d6d('0x11')](_0x97ec9e)){return _0x99f7d6;}for(var _0x408f98=0x0;_0x408f98<_0x97ec9e[_0x6d6d('0x1f')];_0x408f98+=0x1){_['unset'](_0x99f7d6,_0x97ec9e[_0x408f98]);}for(var _0x298408 in _0x99f7d6){if(_0x99f7d6[_0x6d6d('0x22')](_0x298408)){_0x99f7d6[_0x298408]=this['omit'](_0x99f7d6[_0x298408],_0x97ec9e);}}return _0x99f7d6;};exports['isNumeric']=function(_0x3edcce){return _0x3edcce[_0x6d6d('0x23')](RegExp(_0x6d6d('0x24')))?!![]:![];};exports['isEmail']=function(_0xde3272){return _0xde3272[_0x6d6d('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x6d6d('0x25')]=function(_0x1c8340){var _0x64d1f7=[];_0x1c8340[_0x6d6d('0x12')](/[ ,]+/)[_0x6d6d('0x26')](function(_0x359cfd){_0x359cfd=_0x359cfd[_0x6d6d('0x27')](/([^:]")"+/g,'$1');_0x359cfd='+'+_0x359cfd+'*';var _0x34050a=/[ `!@#$%^&*()_\-?~]/;if(_0x359cfd['match'](_0x34050a))_0x359cfd='\x22'+_0x359cfd+'\x22';_0x64d1f7[_0x6d6d('0x28')](_0x359cfd);});return _0x64d1f7['join']('\x20');};exports[_0x6d6d('0x29')]=function(_0x1ea9b2,_0xf527da,_0x2814ed){var _0x5c6248={},_0x182441={};if(_0xf527da['query'][_0x6d6d('0x2a')]){_0xf527da[_0x6d6d('0x2b')]['id']=_0xf527da['query'][_0x6d6d('0x2a')];delete _0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x2a')];}_0x5c6248[_0x6d6d('0x2c')]=_[_0x6d6d('0x15')](_0x1ea9b2,_0x6d6d('0x2d'));_0x5c6248[_0x6d6d('0x2b')]=_[_0x6d6d('0x4')](_0xf527da[_0x6d6d('0x2b')]);_0x5c6248[_0x6d6d('0x2e')]=_[_0x6d6d('0x2f')](_0x5c6248[_0x6d6d('0x2c')],_0x5c6248[_0x6d6d('0x2b')]);_0x182441[_0x6d6d('0x30')]=_['intersection'](_0x5c6248[_0x6d6d('0x2c')],this[_0x6d6d('0x6')](_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x6')]));_0x182441['attributes']=_0x182441['attributes'][_0x6d6d('0x1f')]?_0x182441[_0x6d6d('0x30')]:_0x5c6248[_0x6d6d('0x2c')];if(!_0xf527da['query'][_0x6d6d('0x22')](_0x6d6d('0x31'))){_0x182441[_0x6d6d('0x13')]=this[_0x6d6d('0x13')](_0xf527da['query']['limit']);_0x182441['offset']=this[_0x6d6d('0x32')](_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x32')]);}_0x182441[_0x6d6d('0x33')]=this['sort'](_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x14')]);_0x182441[_0x6d6d('0x34')]=this[_0x6d6d('0x2e')](_[_0x6d6d('0x35')](_0xf527da[_0x6d6d('0x2b')],_0x5c6248['filters']),_0x1ea9b2);if(_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x36')]){var _0x42aff0=_0x1ea9b2;var _0x1f4160=_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x36')];if(typeof _0x1f4160===_0x6d6d('0x37')){_0x42aff0=_['filter'](_0x1ea9b2,function(_0x2d5cdd){return _[_0x6d6d('0x5')](_0x1f4160[_0x6d6d('0x38')],_0x2d5cdd[_0x6d6d('0x2d')]);});_0x1f4160=_0x1f4160[_0x6d6d('0x39')];}_0x182441['where']=_[_0x6d6d('0x3a')](_0x182441[_0x6d6d('0x34')],{'$or':_['map'](_0x42aff0,function(_0x452de2){if(_0x452de2['type']!==_0x6d6d('0x3b')){if(_0x2814ed){return sequelize[_0x6d6d('0x34')](sequelize['fn']('lower',sequelize[_0x6d6d('0x19')](_0x452de2[_0x6d6d('0x2d')])),{'$like':sequelize['fn'](_0x6d6d('0x3c'),'%'+_0xf527da[_0x6d6d('0x2b')][_0x6d6d('0x36')]+'%')});}else{var _0x513506={};_0x513506[_0x452de2['name']]={'$like':'%'+_0xf527da[_0x6d6d('0x2b')]['filter']+'%'};return _0x513506;}}})});}_0x182441=_['merge']({},_0x182441,_0xf527da[_0x6d6d('0x3d')]);return _0x182441;}; \ No newline at end of file +var _0x7217=['options','lodash','moment','parse','includes','keys','fields','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','ASC','length','omit','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','join','getOptions','query','$id','intersection','model','attributes','order','where','filter','object','merge','VIRTUAL','lower'];(function(_0x571fba,_0x54ff35){var _0x455fa8=function(_0x51c158){while(--_0x51c158){_0x571fba['push'](_0x571fba['shift']());}};_0x455fa8(++_0x54ff35);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x7721('0x0'));var sequelize=require('sequelize');var moment=require(_0x7721('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4170dd){var _0x1de988=['ne'];try{var _0x2a78d8=JSON[_0x7721('0x2')](_0x4170dd);var _0x4d6446=Object['keys'](_0x2a78d8)[0x0];return _0x1de988[_0x7721('0x3')](_0x4d6446);}catch(_0xce17f9){return![];}}function getOperatorValue(_0x46415c){var _0x3fe47c=JSON[_0x7721('0x2')](_0x46415c);var _0xf7ff37=Object[_0x7721('0x4')](_0x3fe47c)[0x0];var _0x21f680=_0x3fe47c[_0xf7ff37];return{['$'+_0xf7ff37]:_0x21f680};}exports[_0x7721('0x5')]=function(_0x2f99ed){var _0x3e6368=null;if(_0x2f99ed){_0x3e6368=_0x2f99ed[_0x7721('0x6')](',');}return _0x3e6368;};exports[_0x7721('0x7')]=function(_0x138740,_0x2c3986){var _0x578d59={};if(!_[_0x7721('0x8')](_0x138740)){_[_0x7721('0x9')](_0x138740,function(_0x8729a6,_0xf78099){try{if(_0x2c3986){var _0xa8977c=_[_0x7721('0xa')](_0x2c3986,{'name':_0xf78099})||{};if(hasSequelizeOperator(_0x8729a6)){_0x578d59[_0xf78099]=getOperatorValue(_0x8729a6);}else if(_0xa8977c[_0x7721('0xb')]===_0x7721('0xc')&&_['isPlainObject'](_0x8729a6)){var _0x2911ec=JSON[_0x7721('0x2')](_0x8729a6);var _0x57ff6d={'$gte':moment(moment(_0x2911ec[_0x7721('0xd')])[_0x7721('0xe')](_0x7721('0xf')))[_0x7721('0x10')]()['format'](),'$lte':moment(moment(_0x2911ec[_0x7721('0x11')])[_0x7721('0xe')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0x7721('0xe')]()};_0x578d59[_0xf78099]=_0x57ff6d;}else if(_0xa8977c[_0x7721('0x12')]===_0x7721('0x13')){_0x578d59[_0xf78099]=_0x8729a6;}else{_0x578d59[_0xf78099]=_[_0x7721('0x14')](_0x8729a6)?_0x8729a6:JSON['parse'](_0x8729a6);}}else{_0x578d59[_0xf78099]=_[_0x7721('0x14')](_0x8729a6)?_0x8729a6:JSON['parse'](_0x8729a6);}}catch(_0x3fc09e){_0x578d59[_0xf78099]=_0x8729a6['split'](',');}});}return _0x578d59;};exports[_0x7721('0x15')]=function(_0x4e96fb){_0x4e96fb=parseInt(_0x4e96fb,0xa);if(!_0x4e96fb||_0x4e96fb<0x0){_0x4e96fb=LIMIT_VALUE;}return _0x4e96fb;};exports[_0x7721('0x16')]=function(_0x3e140d){_0x3e140d=parseInt(_0x3e140d,0xa);if(!_0x3e140d||_0x3e140d<0x0){_0x3e140d=0x0;}return _0x3e140d;};exports[_0x7721('0x17')]=function(_0x40af90){var _0x402820,_0x413263=null;if(_0x40af90){_0x402820=_0x40af90[_0x7721('0x6')](',');_0x413263=_[_0x7721('0x18')](_0x402820,function(_0x4ce1db){if(_0x4ce1db[_0x7721('0x19')]('-')===0x0){return[_0x4ce1db===_0x7721('0x1a')?sequelize[_0x7721('0x1b')](sequelize[_0x7721('0x1c')]('priority'),_0x7721('0x1d')):_0x4ce1db['substr'](0x1),_0x7721('0x1e')];}else{return[_0x4ce1db===_0x7721('0x1a')?sequelize[_0x7721('0x1b')](sequelize[_0x7721('0x1c')](_0x7721('0x1a')),_0x7721('0x1d')):_0x4ce1db,_0x7721('0x1f')];}});}return _0x413263;};exports['omit']=function(_0x216f20,_0x1abedb){if(_[_0x7721('0x8')](_0x216f20)){return _0x216f20;}if(_[_0x7721('0x14')](_0x216f20)){for(var _0x40d550=0x0;_0x40d550<_0x216f20[_0x7721('0x20')];_0x40d550+=0x1){_0x216f20[_0x40d550]=this[_0x7721('0x21')](_0x216f20[_0x40d550],_0x1abedb);}return _0x216f20;}if(!_[_0x7721('0x22')](_0x216f20)){return _0x216f20;}if(_[_0x7721('0x23')](_0x1abedb)){_0x1abedb=[_0x1abedb];}if(!_['isArray'](_0x1abedb)){return _0x216f20;}for(var _0x258ddf=0x0;_0x258ddf<_0x1abedb['length'];_0x258ddf+=0x1){_['unset'](_0x216f20,_0x1abedb[_0x258ddf]);}for(var _0x315202 in _0x216f20){if(_0x216f20[_0x7721('0x24')](_0x315202)){_0x216f20[_0x315202]=this[_0x7721('0x21')](_0x216f20[_0x315202],_0x1abedb);}}return _0x216f20;};exports[_0x7721('0x25')]=function(_0x1ea4d){return _0x1ea4d[_0x7721('0x26')](RegExp(_0x7721('0x27')))?!![]:![];};exports[_0x7721('0x28')]=function(_0x5c54f0){return _0x5c54f0[_0x7721('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x7721('0x29')]=function(_0x497f9f){var _0x4a25c9=[];_0x497f9f[_0x7721('0x6')](/[ ,]+/)[_0x7721('0x2a')](function(_0x48f329){_0x48f329=_0x48f329[_0x7721('0x2b')](/([^:]")"+/g,'$1');_0x48f329='+'+_0x48f329+'*';var _0x4651b5=/[ `!@#$%^&*()_\-?~]/;if(_0x48f329[_0x7721('0x26')](_0x4651b5))_0x48f329='\x22'+_0x48f329+'\x22';_0x4a25c9['push'](_0x48f329);});return _0x4a25c9[_0x7721('0x2c')]('\x20');};exports[_0x7721('0x2d')]=function(_0x1492d4,_0x3f15e2,_0xc0f3c4){var _0x508202={},_0x195ffb={};if(_0x3f15e2[_0x7721('0x2e')][_0x7721('0x2f')]){_0x3f15e2['query']['id']=_0x3f15e2[_0x7721('0x2e')][_0x7721('0x2f')];delete _0x3f15e2['query'][_0x7721('0x2f')];}_0x508202['model']=_[_0x7721('0x18')](_0x1492d4,_0x7721('0x12'));_0x508202[_0x7721('0x2e')]=_[_0x7721('0x4')](_0x3f15e2[_0x7721('0x2e')]);_0x508202[_0x7721('0x7')]=_[_0x7721('0x30')](_0x508202[_0x7721('0x31')],_0x508202[_0x7721('0x2e')]);_0x195ffb[_0x7721('0x32')]=_[_0x7721('0x30')](_0x508202['model'],this[_0x7721('0x5')](_0x3f15e2['query'][_0x7721('0x5')]));_0x195ffb[_0x7721('0x32')]=_0x195ffb[_0x7721('0x32')][_0x7721('0x20')]?_0x195ffb[_0x7721('0x32')]:_0x508202[_0x7721('0x31')];if(!_0x3f15e2['query']['hasOwnProperty']('nolimit')){_0x195ffb['limit']=this[_0x7721('0x15')](_0x3f15e2[_0x7721('0x2e')][_0x7721('0x15')]);_0x195ffb[_0x7721('0x16')]=this['offset'](_0x3f15e2[_0x7721('0x2e')]['offset']);}_0x195ffb[_0x7721('0x33')]=this[_0x7721('0x17')](_0x3f15e2['query'][_0x7721('0x17')]);_0x195ffb[_0x7721('0x34')]=this['filters'](_['pick'](_0x3f15e2[_0x7721('0x2e')],_0x508202[_0x7721('0x7')]),_0x1492d4);if(_0x3f15e2[_0x7721('0x2e')][_0x7721('0x35')]){var _0x577af9=_0x1492d4;var _0x2db173=_0x3f15e2[_0x7721('0x2e')][_0x7721('0x35')];if(typeof _0x2db173===_0x7721('0x36')){_0x577af9=_[_0x7721('0x35')](_0x1492d4,function(_0x52ab67){return _[_0x7721('0x3')](_0x2db173['columns'],_0x52ab67[_0x7721('0x12')]);});_0x2db173=_0x2db173['value'];}_0x195ffb[_0x7721('0x34')]=_[_0x7721('0x37')](_0x195ffb[_0x7721('0x34')],{'$or':_['map'](_0x577af9,function(_0x1453d4){if(_0x1453d4[_0x7721('0xb')]!==_0x7721('0x38')){if(_0xc0f3c4){return sequelize['where'](sequelize['fn'](_0x7721('0x39'),sequelize[_0x7721('0x1c')](_0x1453d4[_0x7721('0x12')])),{'$like':sequelize['fn'](_0x7721('0x39'),'%'+_0x3f15e2[_0x7721('0x2e')][_0x7721('0x35')]+'%')});}else{var _0x463ccc={};_0x463ccc[_0x1453d4['name']]={'$like':'%'+_0x3f15e2['query'][_0x7721('0x35')]+'%'};return _0x463ccc;}}})});}_0x195ffb=_[_0x7721('0x37')]({},_0x195ffb,_0x3f15e2[_0x7721('0x3a')]);return _0x195ffb;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 4703655..75802ed 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3042d5,_0x349534){var _0x1acfef=function(_0x5a920f){while(--_0x5a920f){_0x3042d5['push'](_0x3042d5['shift']());}};_0x1acfef(++_0x349534);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index cf33864..3558cc4 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 _0x1f5c=['127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','update','digest','substring','lodash','crypto','execSync','../environment','orderBy','keys','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x442402,_0x3b611e){var _0x510a27=function(_0x2f64c9){while(--_0x2f64c9){_0x442402['push'](_0x442402['shift']());}};_0x510a27(++_0x3b611e);}(_0x1f5c,0x1b8));var _0xc1f5=function(_0x5653dd,_0x1c10c1){_0x5653dd=_0x5653dd-0x0;var _0x48ba72=_0x1f5c[_0x5653dd];return _0x48ba72;};'use strict';var _=require(_0xc1f5('0x0'));var os=require('os');var crypto=require(_0xc1f5('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xc1f5('0x2')];var config=require(_0xc1f5('0x3'));function getInterfaces(){var _0x2293f7=[];var _0x362e17=os['networkInterfaces']();var _0x263463=_[_0xc1f5('0x4')](_[_0xc1f5('0x5')](_0x362e17));for(var _0x718c22=0x0;_0x718c22<_0x263463['length'];_0x718c22++){var _0x2d4e84=_0x362e17[_0x263463[_0x718c22]][_0xc1f5('0x6')](function(_0x23adff){return _0x23adff[_0xc1f5('0x7')]===_0xc1f5('0x8')&&_0x23adff[_0xc1f5('0x9')]===![];});_0x2293f7=_0x2293f7[_0xc1f5('0xa')](_0x2d4e84);}return _0x2293f7;}function getFirstInterface(){var _0x32ae51=_[_0xc1f5('0xb')](getInterfaces());return{'macAddress':_0x32ae51&&_0x32ae51[_0xc1f5('0xc')]?_0x32ae51[_0xc1f5('0xc')]:_0xc1f5('0xd'),'ipAddress':_0x32ae51&&_0x32ae51[_0xc1f5('0xe')]?_0x32ae51['address']:_0xc1f5('0xf')};}exports[_0xc1f5('0x10')]=getFirstInterface;function getCPUhash(){var _0x5c8be2=_[_0xc1f5('0x4')](os[_0xc1f5('0x11')]()[_0xc1f5('0x12')](function(_0x2519e1){return _0x2519e1[_0xc1f5('0x13')];}))['join'](':');return crypto[_0xc1f5('0x14')](_0xc1f5('0x15'))['update'](_0x5c8be2)['digest'](_0xc1f5('0x16'));}exports[_0xc1f5('0x17')]=function(){var _0x20d975=os[_0xc1f5('0x18')]();var _0x5a237d=/[0-9a-f-]{36}/;if(config[_0xc1f5('0x19')]&&_0x5a237d[_0xc1f5('0x1a')](config[_0xc1f5('0x19')])){return config[_0xc1f5('0x19')];}else if(_0x20d975==='win32'){return exec(_0xc1f5('0x1b'),{'encoding':'utf8'})[_0xc1f5('0x1c')]('\x0d\x0a','');}else{var _0x268d33=getFirstInterface();var _0xef23e=getCPUhash();var _0x1385bd=_0xef23e+'|'+os[_0xc1f5('0x1d')]()+'|'+_0x268d33[_0xc1f5('0x1e')]+'|'+_0x268d33[_0xc1f5('0x1f')];var _0x136ba8=crypto[_0xc1f5('0x14')]('md5')[_0xc1f5('0x20')](_0x1385bd)[_0xc1f5('0x21')](_0xc1f5('0x16'));return _0x136ba8[_0xc1f5('0x22')](0x0,0x8)+'-'+_0x136ba8[_0xc1f5('0x22')](0x8,0xc)+'-'+_0x136ba8[_0xc1f5('0x22')](0xc,0x10)+'-'+_0x136ba8[_0xc1f5('0x22')](0x10,0x14)+'-'+_0x136ba8['substring'](0x14);}}; \ No newline at end of file +var _0xb0e9=['ipAddress','createHash','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','update','digest','hex','getUuid','platform','licenseToken','test','replace','hostname','macAddress'];(function(_0x26d0cf,_0x58e972){var _0x50da3e=function(_0xda84ea){while(--_0xda84ea){_0x26d0cf['push'](_0x26d0cf['shift']());}};_0x50da3e(++_0x58e972);}(_0xb0e9,0x162));var _0x9b0e=function(_0x48478f,_0x537acd){_0x48478f=_0x48478f-0x0;var _0x10af50=_0xb0e9[_0x48478f];return _0x10af50;};'use strict';var _=require(_0x9b0e('0x0'));var os=require('os');var crypto=require(_0x9b0e('0x1'));var machine=require(_0x9b0e('0x2'));var exec=require(_0x9b0e('0x3'))[_0x9b0e('0x4')];var config=require(_0x9b0e('0x5'));function getInterfaces(){var _0x31c79a=[];var _0x24ce82=os[_0x9b0e('0x6')]();var _0x3c2e46=_['orderBy'](_[_0x9b0e('0x7')](_0x24ce82));for(var _0x38cbce=0x0;_0x38cbce<_0x3c2e46[_0x9b0e('0x8')];_0x38cbce++){var _0x5d0050=_0x24ce82[_0x3c2e46[_0x38cbce]]['filter'](function(_0x34f591){return _0x34f591[_0x9b0e('0x9')]===_0x9b0e('0xa')&&_0x34f591[_0x9b0e('0xb')]===![];});_0x31c79a=_0x31c79a[_0x9b0e('0xc')](_0x5d0050);}return _0x31c79a;}function getFirstInterface(){var _0x467f0a=_[_0x9b0e('0xd')](getInterfaces());return{'macAddress':_0x467f0a&&_0x467f0a[_0x9b0e('0xe')]?_0x467f0a[_0x9b0e('0xe')]:_0x9b0e('0xf'),'ipAddress':_0x467f0a&&_0x467f0a[_0x9b0e('0x10')]?_0x467f0a['address']:'127.0.0.1'};}exports[_0x9b0e('0x11')]=getFirstInterface;function getCPUhash(){var _0x344b3f=_[_0x9b0e('0x12')](os[_0x9b0e('0x13')]()[_0x9b0e('0x14')](function(_0x5a308a){return _0x5a308a['model'];}))['join'](':');return crypto['createHash']('md5')[_0x9b0e('0x15')](_0x344b3f)[_0x9b0e('0x16')](_0x9b0e('0x17'));}exports[_0x9b0e('0x18')]=function(){var _0x129c2c=os[_0x9b0e('0x19')]();var _0xf7d251=/[0-9a-f-]{36}/;if(config[_0x9b0e('0x1a')]&&_0xf7d251[_0x9b0e('0x1b')](config[_0x9b0e('0x1a')])){return config['licenseToken'];}else if(_0x129c2c==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x9b0e('0x1c')]('\x0d\x0a','');}else{var _0x4a3f4e=getFirstInterface();var _0x3d85d4=getCPUhash();var _0x321ead=_0x3d85d4+'|'+os[_0x9b0e('0x1d')]()+'|'+_0x4a3f4e[_0x9b0e('0x1e')]+'|'+_0x4a3f4e[_0x9b0e('0x1f')];var _0x449ea3=crypto[_0x9b0e('0x20')](_0x9b0e('0x21'))[_0x9b0e('0x15')](_0x321ead)[_0x9b0e('0x16')](_0x9b0e('0x17'));return _0x449ea3[_0x9b0e('0x22')](0x0,0x8)+'-'+_0x449ea3[_0x9b0e('0x22')](0x8,0xc)+'-'+_0x449ea3['substring'](0xc,0x10)+'-'+_0x449ea3[_0x9b0e('0x22')](0x10,0x14)+'-'+_0x449ea3[_0x9b0e('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 8408e41..034374d 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 _0x7bf3=['request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','error','message','getUuid','License','findOrCreate','spread','default','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bf3,0x76));var _0x37bf=function(_0x93913c,_0x3121be){_0x93913c=_0x93913c-0x0;var _0x12d64c=_0x7bf3[_0x93913c];return _0x12d64c;};'use strict';var util=require(_0x37bf('0x0'));var moment=require(_0x37bf('0x1'));var rp=require(_0x37bf('0x2'));var BPromise=require(_0x37bf('0x3'));var pkginfo=require(_0x37bf('0x4'))(module,_0x37bf('0x5'));var db=require(_0x37bf('0x6'))['db'];var encryptor=require(_0x37bf('0x7'));var hardware=require(_0x37bf('0x8'));var logger=require(_0x37bf('0x9'))(_0x37bf('0xa'));var HOST=_0x37bf('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cfef3){return new BPromise(function(_0x336170,_0x5980fb){var _0x1e67b7=util[_0x37bf('0xc')](_0x37bf('0xd'),HOST,_0x1cfef3,module[_0x37bf('0xe')][_0x37bf('0x5')]);if(oldToken){_0x1e67b7=util[_0x37bf('0xc')](_0x37bf('0xf'),HOST,_0x1cfef3,module[_0x37bf('0xe')][_0x37bf('0x5')],oldToken);}var _0x7b9297={'uri':_0x1e67b7,'method':_0x37bf('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x7b9297)[_0x37bf('0x11')](function(_0x1ab339){_0x336170(_0x1ab339);})[_0x37bf('0x12')](function(_0x3a0c37){_0x5980fb(_0x3a0c37);});});}function manageLicense(_0x1dd8b1,_0x431760){var _0x15bd65=_0x431760[_0x37bf('0x13')]({'plain':!![]});if(!isOldTokenSent&&_0x15bd65[_0x37bf('0x14')]!==_0x1dd8b1&&!_0x15bd65[_0x37bf('0x15')]){oldToken=_0x15bd65['data1'];}httpRequest(_0x1dd8b1)[_0x37bf('0x11')](function(_0x37c11e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x37c11e[_0x37bf('0x16')]){isOldTokenSent=![];if(!_0x15bd65[_0x37bf('0xa')]&&_0x15bd65['license']!=_0x37c11e[_0x37bf('0xa')]||_0x15bd65[_0x37bf('0xa')]&&_0x15bd65[_0x37bf('0x15')]){logger[_0x37bf('0x17')](_0x37bf('0x18'));}if(_0x15bd65[_0x37bf('0xa')]&&!_0x15bd65[_0x37bf('0x15')]&&_0x15bd65['license']!=_0x37c11e[_0x37bf('0xa')]){logger[_0x37bf('0x17')](_0x37bf('0x19'));}if(_0x15bd65['license']&&!_0x15bd65[_0x37bf('0x15')]&&_0x15bd65[_0x37bf('0xa')]==_0x37c11e['license']){return _0x431760;}return _0x431760[_0x37bf('0x1a')]({'data1':_0x1dd8b1,'data2':null,'license':_0x37c11e[_0x37bf('0xa')]});}else{if(_0x37c11e[_0x37bf('0xa')]||_0x15bd65[_0x37bf('0xa')]){if(!_0x15bd65[_0x37bf('0x15')]){if(_0x15bd65[_0x37bf('0x14')]==_0x1dd8b1){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x37bf('0x1b');logger[_0x37bf('0x17')](_0x37bf('0x1c'),_0x15bd65[_0x37bf('0x14')],_0x1dd8b1);}logger[_0x37bf('0x17')](_0x37bf('0x1d'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x37bf('0x1e')));return _0x431760['update']({'data2':encryptor[_0x37bf('0x1f')](moment()[_0x37bf('0xc')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x37bf('0x20')](_0x15bd65[_0x37bf('0x15')]),'days')>DAYS){logger[_0x37bf('0x17')]('DEMO\x20START\x20AT\x20%s',moment()[_0x37bf('0xc')](_0x37bf('0x1e')));isOldTokenSent=![];return _0x431760[_0x37bf('0x1a')]({'data1':_0x1dd8b1,'data2':null,'license':null});}}}else{if(_0x15bd65[_0x37bf('0x14')]!=_0x1dd8b1){logger['info'](_0x37bf('0x1c'),_0x15bd65[_0x37bf('0x14')],_0x1dd8b1);return _0x431760[_0x37bf('0x1a')]({'data1':_0x1dd8b1,'data2':null,'license':null});}}}return _0x431760;})['then'](function(_0x279629){_0x431760=_0x279629;})['catch'](function(_0x42e669){logger[_0x37bf('0x21')](_0x42e669[_0x37bf('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x37bf('0x23')](),_0x431760);},TIME);});}function defaultLicense(){var _0x568429=hardware[_0x37bf('0x23')]();if(_0x568429){return db[_0x37bf('0x24')][_0x37bf('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x568429}})[_0x37bf('0x26')](function(_0x13a36c,_0x3f7884){logger[_0x37bf('0x17')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x568429);manageLicense(_0x568429,_0x13a36c);})['catch'](function(_0x5880f3){logger[_0x37bf('0x21')](_0x5880f3[_0x37bf('0x22')]);});}}exports[_0x37bf('0x27')]=defaultLicense; \ No newline at end of file +var _0x0680=['error','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data1','data2','then','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','finally','getUuid','License','spread'];(function(_0x5b8455,_0x29f705){var _0x118787=function(_0x4bdaa0){while(--_0x4bdaa0){_0x5b8455['push'](_0x5b8455['shift']());}};_0x118787(++_0x29f705);}(_0x0680,0x7e));var _0x0068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0680[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0068('0x0'));var moment=require(_0x0068('0x1'));var rp=require(_0x0068('0x2'));var BPromise=require(_0x0068('0x3'));var pkginfo=require(_0x0068('0x4'))(module,_0x0068('0x5'));var db=require(_0x0068('0x6'))['db'];var encryptor=require(_0x0068('0x7'));var hardware=require(_0x0068('0x8'));var logger=require(_0x0068('0x9'))(_0x0068('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x46dcb7){return new BPromise(function(_0x295123,_0xbee57e){var _0x24e0b0=util['format'](_0x0068('0xb'),HOST,_0x46dcb7,module[_0x0068('0xc')][_0x0068('0x5')]);if(oldToken){_0x24e0b0=util[_0x0068('0xd')](_0x0068('0xe'),HOST,_0x46dcb7,module['exports'][_0x0068('0x5')],oldToken);}var _0x44aec1={'uri':_0x24e0b0,'method':_0x0068('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x44aec1)['then'](function(_0x57de77){_0x295123(_0x57de77);})['catch'](function(_0x2e4f79){_0xbee57e(_0x2e4f79);});});}function manageLicense(_0x3d350e,_0x9da587){var _0x4cf02d=_0x9da587[_0x0068('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4cf02d[_0x0068('0x11')]!==_0x3d350e&&!_0x4cf02d[_0x0068('0x12')]){oldToken=_0x4cf02d['data1'];}httpRequest(_0x3d350e)[_0x0068('0x13')](function(_0x553772){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x553772[_0x0068('0x14')]){isOldTokenSent=![];if(!_0x4cf02d[_0x0068('0xa')]&&_0x4cf02d[_0x0068('0xa')]!=_0x553772['license']||_0x4cf02d['license']&&_0x4cf02d[_0x0068('0x12')]){logger[_0x0068('0x15')](_0x0068('0x16'));}if(_0x4cf02d[_0x0068('0xa')]&&!_0x4cf02d[_0x0068('0x12')]&&_0x4cf02d[_0x0068('0xa')]!=_0x553772['license']){logger[_0x0068('0x15')](_0x0068('0x17'));}if(_0x4cf02d[_0x0068('0xa')]&&!_0x4cf02d[_0x0068('0x12')]&&_0x4cf02d[_0x0068('0xa')]==_0x553772[_0x0068('0xa')]){return _0x9da587;}return _0x9da587[_0x0068('0x18')]({'data1':_0x3d350e,'data2':null,'license':_0x553772[_0x0068('0xa')]});}else{if(_0x553772[_0x0068('0xa')]||_0x4cf02d[_0x0068('0xa')]){if(!_0x4cf02d[_0x0068('0x12')]){if(_0x4cf02d[_0x0068('0x11')]==_0x3d350e){GRAY_PERIOD_REASON=_0x0068('0x19');logger[_0x0068('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x0068('0x1a');logger[_0x0068('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4cf02d['data1'],_0x3d350e);}logger[_0x0068('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0068('0x1b')](),moment()['format'](_0x0068('0x1c')));return _0x9da587[_0x0068('0x18')]({'data2':encryptor['encryptString'](moment()[_0x0068('0xd')](_0x0068('0x1c')))});}else{if(moment()[_0x0068('0x1d')](encryptor[_0x0068('0x1e')](_0x4cf02d['data2']),_0x0068('0x1f'))>DAYS){logger[_0x0068('0x15')](_0x0068('0x20'),moment()[_0x0068('0xd')](_0x0068('0x1c')));isOldTokenSent=![];return _0x9da587[_0x0068('0x18')]({'data1':_0x3d350e,'data2':null,'license':null});}}}else{if(_0x4cf02d[_0x0068('0x11')]!=_0x3d350e){logger[_0x0068('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4cf02d['data1'],_0x3d350e);return _0x9da587[_0x0068('0x18')]({'data1':_0x3d350e,'data2':null,'license':null});}}}return _0x9da587;})[_0x0068('0x13')](function(_0x3ad880){_0x9da587=_0x3ad880;})[_0x0068('0x21')](function(_0x39d57a){logger['error'](_0x39d57a['message']);})[_0x0068('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x0068('0x23')](),_0x9da587);},TIME);});}function defaultLicense(){var _0x1ba651=hardware[_0x0068('0x23')]();if(_0x1ba651){return db[_0x0068('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1ba651}})[_0x0068('0x25')](function(_0x1fe149,_0x30c9c6){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1ba651);manageLicense(_0x1ba651,_0x1fe149);})[_0x0068('0x21')](function(_0x512c5a){logger[_0x0068('0x26')](_0x512c5a[_0x0068('0x27')]);});}}exports[_0x0068('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index bc8988e..6a869ee 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 _0xa348=['getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','defaults','catch','data1','isEmpty','data2','split','decryptString','%s:%s:%s','parse','uuid','machineUuid','gray','deadline','add','days','format','changed','message','then','findAll','role','COUNT','col','count','admin','user','telephone','telephones','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license'];(function(_0x199824,_0x52f7a9){var _0x35fcbe=function(_0x3ae0fb){while(--_0x3ae0fb){_0x199824['push'](_0x199824['shift']());}};_0x35fcbe(++_0x52f7a9);}(_0xa348,0xa9));var _0x8a34=function(_0x32bb3c,_0x28aa49){_0x32bb3c=_0x32bb3c-0x0;var _0xd3ab8=_0xa348[_0x32bb3c];return _0xd3ab8;};'use strict';var util=require('util');var _=require(_0x8a34('0x0'));var moment=require(_0x8a34('0x1'));var BPromise=require(_0x8a34('0x2'));var hardware=require(_0x8a34('0x3'));var encryptor=require(_0x8a34('0x4'));var db=require(_0x8a34('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8a34('0x6'),'machineUuid':hardware[_0x8a34('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8a34('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8a34('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2b6889){return new BPromise(function(_0x37c12a,_0x224de6){return db[_0x8a34('0xa')]['find'](_[_0x8a34('0xb')](_0x2b6889,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x631a02){return checkLicense(_0x631a02,null);})['then'](function(_0x3c9e56){_0x37c12a(_0x3c9e56);return;})[_0x8a34('0xc')](function(_0x4420fa){_0x224de6(_0x4420fa);});});}function checkLicense(_0xb32215,_0x1dc5f5){if(!_0xb32215){demoLicense['uuid']=_0xb32215[_0x8a34('0xd')];return demoLicense;}try{var _0x4949fe=_0x1dc5f5||_0xb32215['license'];if(_[_0x8a34('0xe')](_0x4949fe)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2eb6a4=_0xb32215[_0x8a34('0xd')];var _0x418ea0=_0xb32215[_0x8a34('0xf')];var _0x217a6e=_0x2eb6a4['split']('-')[0x4];var _0x136582=_0x2eb6a4[_0x8a34('0x10')]('-')[0x0];var _0x4b38b9=encryptor[_0x8a34('0x11')](_0x4949fe,util['format'](_0x8a34('0x12'),_0x217a6e,_0x2eb6a4,_0x136582));var _0x192ce2=JSON[_0x8a34('0x13')](_0x4b38b9);_0x192ce2['demo']=![];_0x192ce2[_0x8a34('0x14')]=_0x2eb6a4;_0x192ce2[_0x8a34('0x15')]=hardware['getUuid']();if(_0x418ea0){var _0x3f47c0=encryptor[_0x8a34('0x11')](_0x418ea0);_0x192ce2[_0x8a34('0x16')]=_0x3f47c0;_0x192ce2[_0x8a34('0x17')]=moment(_0x3f47c0)[_0x8a34('0x18')](0x7,_0x8a34('0x19'))[_0x8a34('0x1a')]();_0x192ce2['grayReason']=_0x192ce2[_0x8a34('0x14')]!=_0x192ce2[_0x8a34('0x15')]?_0x8a34('0x1b'):'disabled';}return _0x192ce2;}catch(_0x27cc78){breakingLicense[_0x8a34('0x14')]=_0xb32215[_0x8a34('0xd')];breakingLicense[_0x8a34('0x1c')]=_0x27cc78[_0x8a34('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2fe493,_0x56ad9e){getLicense()[_0x8a34('0x1d')](function(_0xb564ab){return db['User'][_0x8a34('0x1e')]({'attributes':[_0x8a34('0x1f'),[db['sequelize']['fn'](_0x8a34('0x20'),db['sequelize'][_0x8a34('0x21')](_0x8a34('0x1f'))),_0x8a34('0x22')]],'group':_0x8a34('0x1f'),'where':{'role':{'$or':[_0x8a34('0x23'),_0x8a34('0x24'),_0x8a34('0x25')]}},'raw':!![]})[_0x8a34('0x1d')](function(_0x2166ef){var _0x1992a3={'user':_0xb564ab['users']||0x0,'telephone':_0xb564ab[_0x8a34('0x26')]||0x0};_0x2166ef['forEach'](function(_0x4eedc6){var _0x242447=_0x4eedc6[_0x8a34('0x1f')]===_0x8a34('0x23')?'user':_0x4eedc6['role'];_0x1992a3[_0x242447]-=_0x4eedc6[_0x8a34('0x22')];if(_0x1992a3[_0x242447]<0x0)_0x1992a3[_0x242447]=0x0;});_0x2fe493(_0x1992a3);return;});})[_0x8a34('0xc')](function(_0x315d82){_0x56ad9e(_0x315d82);});});}function checkUserLimits(_0x250e67){return new BPromise(function(_0x4ed957,_0x122c74){getLimits()['then'](function(_0x28605e){var _0x21af2c=_[_0x8a34('0x27')](_[_0x8a34('0x28')](_0x250e67,_0x8a34('0x1f')),['admin',_0x8a34('0x24'),_0x8a34('0x25')]);var _0x35e4cb=(_0x21af2c[_0x8a34('0x23')]||0x0)+(_0x21af2c[_0x8a34('0x24')]||0x0);var _0x97bcab=_0x21af2c[_0x8a34('0x25')]||0x0;if(_0x35e4cb>_0x28605e[_0x8a34('0x24')])return _0x122c74(_0x8a34('0x29'));if(_0x97bcab>_0x28605e[_0x8a34('0x25')])return _0x122c74(_0x8a34('0x2a'));return _0x4ed957();})[_0x8a34('0xc')](function(_0x3ceb7d){_0x122c74(_0x3ceb7d);});});}module[_0x8a34('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x3813=['grayReason','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','uuid','isEmpty','data2','split','decryptString','format','%s:%s:%s','demo','machineUuid','gray','deadline','add','days'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x3813,0x9a));var _0x3381=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3813[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x3381('0x0'));var _=require('lodash');var moment=require(_0x3381('0x1'));var BPromise=require('bluebird');var hardware=require(_0x3381('0x2'));var encryptor=require(_0x3381('0x3'));var db=require(_0x3381('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3381('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3381('0x6'),'machineUuid':hardware[_0x3381('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3381('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3381('0x8'),'machineUuid':hardware[_0x3381('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x14443f){return new BPromise(function(_0x10dcd4,_0x28ba19){return db['License'][_0x3381('0x9')](_[_0x3381('0xa')](_0x14443f,{'raw':!![],'where':{'id':0x1}}))[_0x3381('0xb')](function(_0x416f12){return checkLicense(_0x416f12,null);})[_0x3381('0xb')](function(_0x4e62a9){_0x10dcd4(_0x4e62a9);return;})[_0x3381('0xc')](function(_0x3b9244){_0x28ba19(_0x3b9244);});});}function checkLicense(_0x37dbd9,_0xa2c7cb){if(!_0x37dbd9){demoLicense[_0x3381('0xd')]=_0x37dbd9['data1'];return demoLicense;}try{var _0xb9564e=_0xa2c7cb||_0x37dbd9['license'];if(_[_0x3381('0xe')](_0xb9564e)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x42badb=_0x37dbd9['data1'];var _0x1a7557=_0x37dbd9[_0x3381('0xf')];var _0x37990b=_0x42badb['split']('-')[0x4];var _0x4d5943=_0x42badb[_0x3381('0x10')]('-')[0x0];var _0x3a7cdc=encryptor[_0x3381('0x11')](_0xb9564e,util[_0x3381('0x12')](_0x3381('0x13'),_0x37990b,_0x42badb,_0x4d5943));var _0x12e41e=JSON['parse'](_0x3a7cdc);_0x12e41e[_0x3381('0x14')]=![];_0x12e41e[_0x3381('0xd')]=_0x42badb;_0x12e41e[_0x3381('0x15')]=hardware[_0x3381('0x7')]();if(_0x1a7557){var _0x4e16a5=encryptor[_0x3381('0x11')](_0x1a7557);_0x12e41e[_0x3381('0x16')]=_0x4e16a5;_0x12e41e[_0x3381('0x17')]=moment(_0x4e16a5)[_0x3381('0x18')](0x7,_0x3381('0x19'))[_0x3381('0x12')]();_0x12e41e[_0x3381('0x1a')]=_0x12e41e[_0x3381('0xd')]!=_0x12e41e[_0x3381('0x15')]?_0x3381('0x1b'):_0x3381('0x1c');}return _0x12e41e;}catch(_0x57bd9f){breakingLicense[_0x3381('0xd')]=_0x37dbd9['data1'];breakingLicense[_0x3381('0x1d')]=_0x57bd9f[_0x3381('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x32295c,_0x5a4d95){getLicense()['then'](function(_0x7cfcb8){return db['User'][_0x3381('0x1e')]({'attributes':[_0x3381('0x1f'),[db[_0x3381('0x20')]['fn'](_0x3381('0x21'),db[_0x3381('0x20')][_0x3381('0x22')](_0x3381('0x1f'))),_0x3381('0x23')]],'group':_0x3381('0x1f'),'where':{'role':{'$or':[_0x3381('0x24'),_0x3381('0x25'),_0x3381('0x26')]}},'raw':!![]})[_0x3381('0xb')](function(_0x5a9dc5){var _0x28f0ff={'user':_0x7cfcb8['users']||0x0,'telephone':_0x7cfcb8['telephones']||0x0};_0x5a9dc5[_0x3381('0x27')](function(_0x2b64c4){var _0x1ec4ab=_0x2b64c4[_0x3381('0x1f')]==='admin'?'user':_0x2b64c4[_0x3381('0x1f')];_0x28f0ff[_0x1ec4ab]-=_0x2b64c4[_0x3381('0x23')];if(_0x28f0ff[_0x1ec4ab]<0x0)_0x28f0ff[_0x1ec4ab]=0x0;});_0x32295c(_0x28f0ff);return;});})[_0x3381('0xc')](function(_0x35a77e){_0x5a4d95(_0x35a77e);});});}function checkUserLimits(_0x54f8f4){return new BPromise(function(_0xd0fd4e,_0x1cfb42){getLimits()['then'](function(_0x1ce379){var _0x2e7576=_[_0x3381('0x28')](_[_0x3381('0x29')](_0x54f8f4,_0x3381('0x1f')),[_0x3381('0x24'),'user',_0x3381('0x26')]);var _0x59d199=(_0x2e7576[_0x3381('0x24')]||0x0)+(_0x2e7576[_0x3381('0x25')]||0x0);var _0x3c985c=_0x2e7576[_0x3381('0x26')]||0x0;if(_0x59d199>_0x1ce379[_0x3381('0x25')])return _0x1cfb42(_0x3381('0x2a'));if(_0x3c985c>_0x1ce379['telephone'])return _0x1cfb42(_0x3381('0x2b'));return _0xd0fd4e();})[_0x3381('0xc')](function(_0x592cf8){_0x1cfb42(_0x592cf8);});});}module[_0x3381('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index d0d3065..796f650 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 _0xed3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0xed3c,0x1a6));var _0xced3=function(_0x3ae4bf,_0x554978){_0x3ae4bf=_0x3ae4bf-0x0;var _0x27f7dd=_0xed3c[_0x3ae4bf];return _0x27f7dd;};'use strict';module[_0xced3('0x0')]={'DOMAIN':_0xced3('0x1'),'SESSION_SECRET':_0xced3('0x2'),'GOOGLE_ID':_0xced3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x66fa=['http://localhost:9000','app-id','secret','exports'];(function(_0x49f30d,_0x50300a){var _0x2c75fa=function(_0x3a880a){while(--_0x3a880a){_0x49f30d['push'](_0x49f30d['shift']());}};_0x2c75fa(++_0x50300a);}(_0x66fa,0x117));var _0xa66f=function(_0x2cadf9,_0x26b888){_0x2cadf9=_0x2cadf9-0x0;var _0x38c7e6=_0x66fa[_0x2cadf9];return _0x38c7e6;};'use strict';module[_0xa66f('0x0')]={'DOMAIN':_0xa66f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xa66f('0x2'),'GOOGLE_SECRET':_0xa66f('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d0a4c06..b964e05 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd812=['fileLogger','exports','../utils/loggers'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0xd812,0xfe));var _0x2d81=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xd812[_0x5b27da];return _0x3254f4;};'use strict';var fileLogger=require(_0x2d81('0x0'))[_0x2d81('0x1')];module[_0x2d81('0x2')]=fileLogger; \ No newline at end of file +var _0xee8e=['fileLogger','exports','../utils/loggers'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xee8e,0x1c1));var _0xeee8=function(_0x37ca0f,_0x314ba2){_0x37ca0f=_0x37ca0f-0x0;var _0x5cad55=_0xee8e[_0x37ca0f];return _0x5cad55;};'use strict';var fileLogger=require(_0xeee8('0x0'))[_0xeee8('0x1')];module[_0xeee8('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 14449fa..03134a3 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 _0x6027=['xdr','../../services/xdr/index.js','exports','path','join','../../services/express/index.js','ami','agi','routing','../../services/routing/index.js'];(function(_0x55fee6,_0xb8e377){var _0x50d892=function(_0x31056a){while(--_0x31056a){_0x55fee6['push'](_0x55fee6['shift']());}};_0x50d892(++_0xb8e377);}(_0x6027,0xf3));var _0x7602=function(_0x53b199,_0x38ff21){_0x53b199=_0x53b199-0x0;var _0x1ba42d=_0x6027[_0x53b199];return _0x1ba42d;};'use strict';var path=require(_0x7602('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x7602('0x1')](__dirname,_0x7602('0x2'))},{'name':_0x7602('0x3'),'script':path[_0x7602('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x7602('0x4'),'script':path[_0x7602('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x7602('0x5'),'script':path['join'](__dirname,_0x7602('0x6'))},{'name':_0x7602('0x7'),'script':path[_0x7602('0x1')](__dirname,_0x7602('0x8'))}]};module[_0x7602('0x9')]=config; \ No newline at end of file +var _0x099b=['ami','../../services/ami/index.js','agi','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x099b,0x15b));var _0xb099=function(_0x28a401,_0x5600e9){_0x28a401=_0x28a401-0x0;var _0x1b6346=_0x099b[_0x28a401];return _0x1b6346;};'use strict';var path=require(_0xb099('0x0'));var os=require('os');var config={'apps':[{'name':_0xb099('0x1'),'script':path[_0xb099('0x2')](__dirname,_0xb099('0x3'))},{'name':_0xb099('0x4'),'script':path['join'](__dirname,_0xb099('0x5'))},{'name':_0xb099('0x6'),'script':path[_0xb099('0x2')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0xb099('0x2')](__dirname,_0xb099('0x7'))},{'name':_0xb099('0x8'),'script':path[_0xb099('0x2')](__dirname,_0xb099('0x9'))},{'name':_0xb099('0xa'),'script':path[_0xb099('0x2')](__dirname,_0xb099('0xb'))}]};module[_0xb099('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 2affdc2..583b51c 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 _0x76af=['start','then','stop','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','connect','connected'];(function(_0x5ee211,_0x3f31a3){var _0x46fc90=function(_0x44f6d8){while(--_0x44f6d8){_0x5ee211['push'](_0x5ee211['shift']());}};_0x46fc90(++_0x3f31a3);}(_0x76af,0x7a));var _0xf76a=function(_0x329437,_0x1de73a){_0x329437=_0x329437-0x0;var _0x3789d9=_0x76af[_0x329437];return _0x3789d9;};'use strict';var pm2=require(_0xf76a('0x0'));var BPromise=require(_0xf76a('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x2163da,_0x4d4498){return pm2[_0xf76a('0x2')](function(_0x219238){if(_0x219238){return _0x4d4498(_0x219238);}return _0x2163da(_0xf76a('0x3'));});});};exports[_0xf76a('0x4')]=function(_0x3f3123){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x2f9d65,_0x3f6d30){return pm2[_0xf76a('0x4')](_0x3f3123,function(_0x1eee7b,_0x42fd18){if(_0x1eee7b){return _0x3f6d30(_0x1eee7b);}pm2['disconnect']();return _0x2f9d65(_0x42fd18);});});});};exports['stop']=function(_0x1cbef1){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x322cd3,_0x586398){return pm2[_0xf76a('0x6')](_0x1cbef1,function(_0x11006c,_0x5467a0){if(_0x11006c){return _0x586398(_0x11006c);}pm2['disconnect']();return _0x322cd3(_0x5467a0);});});});};exports[_0xf76a('0x7')]=function(_0x6c4b77){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x326171,_0x5efbe4){return pm2[_0xf76a('0x7')](_0x6c4b77,function(_0x1c87f7,_0x468389){if(_0x1c87f7){return _0x5efbe4(_0x1c87f7);}pm2[_0xf76a('0x8')]();return _0x326171(_0x468389);});});});};exports[_0xf76a('0x9')]=function(){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x2d332f,_0x37acb2){return pm2[_0xf76a('0x9')](function(_0x4e9a49,_0x21a022){if(_0x4e9a49){return _0x37acb2(_0x4e9a49);}pm2[_0xf76a('0x8')]();return _0x2d332f(_0x21a022);});});});};exports['describe']=function(_0x18a3f0){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x385d68,_0x1f40eb){return pm2[_0xf76a('0xa')](_0x18a3f0,function(_0x59723e,_0x4f134a){if(_0x59723e){return _0x1f40eb(_0x59723e);}pm2[_0xf76a('0x8')]();return _0x385d68(_0x4f134a);});});});};exports[_0xf76a('0xb')]=function(_0x834034){return connect()[_0xf76a('0x5')](function(){return new BPromise(function(_0x334538,_0x1a0822){return pm2[_0xf76a('0xb')](_0x834034,function(_0x5141b0,_0x2fafe7){if(_0x5141b0){return _0x1a0822(_0x5141b0);}pm2[_0xf76a('0x8')]();return _0x334538(_0x2fafe7);});});});};exports[_0xf76a('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x6aab3c,_0x24189b){return pm2[_0xf76a('0xc')](function(_0x5e7e4c){if(_0x5e7e4c){return _0x24189b(_0x5e7e4c);}return _0x6aab3c(_0xf76a('0xd'));});});});}; \ No newline at end of file +var _0x19df=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x19df,0x1a1));var _0xf19d=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x19df[_0x240261];return _0x45c332;};'use strict';var pm2=require(_0xf19d('0x0'));var BPromise=require(_0xf19d('0x1'));var config=require(_0xf19d('0x2'));function connect(){return new BPromise(function(_0x5b7d9c,_0x2e65d3){return pm2[_0xf19d('0x3')](function(_0x480b2f){if(_0x480b2f){return _0x2e65d3(_0x480b2f);}return _0x5b7d9c(_0xf19d('0x4'));});});};exports[_0xf19d('0x5')]=function(_0x4db41a){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x196531,_0x59ff85){return pm2[_0xf19d('0x5')](_0x4db41a,function(_0x5bcab4,_0x468956){if(_0x5bcab4){return _0x59ff85(_0x5bcab4);}pm2[_0xf19d('0x7')]();return _0x196531(_0x468956);});});});};exports[_0xf19d('0x8')]=function(_0x1732e7){return connect()['then'](function(){return new BPromise(function(_0x2a8318,_0x4def23){return pm2[_0xf19d('0x8')](_0x1732e7,function(_0xc1e18d,_0x458752){if(_0xc1e18d){return _0x4def23(_0xc1e18d);}pm2[_0xf19d('0x7')]();return _0x2a8318(_0x458752);});});});};exports[_0xf19d('0x9')]=function(_0x1a231b){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x42c82b,_0x5410bb){return pm2[_0xf19d('0x9')](_0x1a231b,function(_0x5c7ac2,_0xbd567a){if(_0x5c7ac2){return _0x5410bb(_0x5c7ac2);}pm2['disconnect']();return _0x42c82b(_0xbd567a);});});});};exports[_0xf19d('0xa')]=function(){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x11b1a2,_0x46c1f4){return pm2[_0xf19d('0xa')](function(_0x2ef40c,_0x1d5693){if(_0x2ef40c){return _0x46c1f4(_0x2ef40c);}pm2[_0xf19d('0x7')]();return _0x11b1a2(_0x1d5693);});});});};exports[_0xf19d('0xb')]=function(_0x5f1469){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x109fdf,_0x9b33a7){return pm2[_0xf19d('0xb')](_0x5f1469,function(_0x3ff67d,_0x3315c5){if(_0x3ff67d){return _0x9b33a7(_0x3ff67d);}pm2[_0xf19d('0x7')]();return _0x109fdf(_0x3315c5);});});});};exports[_0xf19d('0xc')]=function(_0x20785c){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x2ec6b0,_0x4b43bd){return pm2[_0xf19d('0xc')](_0x20785c,function(_0x448d6d,_0xc1a8da){if(_0x448d6d){return _0x4b43bd(_0x448d6d);}pm2[_0xf19d('0x7')]();return _0x2ec6b0(_0xc1a8da);});});});};exports[_0xf19d('0xd')]=function(){return connect()[_0xf19d('0x6')](function(){return new BPromise(function(_0x4edfa9,_0x25a565){return pm2[_0xf19d('0xd')](function(_0x1a7bbb){if(_0x1a7bbb){return _0x25a565(_0x1a7bbb);}return _0x4edfa9(_0xf19d('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 05af8f9..51ea2a4 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 _0x2172=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','ioredis','util','../../config/environment','../../mysqldb','redis','socket.io-emitter','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','length','map','info','update','system','timeout','format'];(function(_0x1d6e1c,_0x27c119){var _0x2e0806=function(_0x44cd78){while(--_0x44cd78){_0x1d6e1c['push'](_0x1d6e1c['shift']());}};_0x2e0806(++_0x27c119);}(_0x2172,0x167));var _0x2217=function(_0x278504,_0x300f10){_0x278504=_0x278504-0x0;var _0x530d3e=_0x2172[_0x278504];return _0x530d3e;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x2217('0x0'));var util=require(_0x2217('0x1'));var config=require(_0x2217('0x2'));var db=require(_0x2217('0x3'))['db'];var logger=require('../logger')('schedule');config[_0x2217('0x4')]=_['defaults'](config[_0x2217('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2217('0x5'))(new Redis(config[_0x2217('0x4')]));function closeInteractions(){var _0x1fc290=0x0;var _0x9219fc=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x2217('0x6')],'where':{'id':0x1}})['then'](function(_0x4f8758){_0x1fc290=_0x4f8758[_0x2217('0x6')];if(_0x1fc290){return db[_0x2217('0x7')][_0x2217('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x2217('0x9')](_0x4f8758[_0x2217('0x6')],_0x2217('0xa'))}}});}else{return[];}})[_0x2217('0xb')](function(_0x78583a){if(_0x78583a&&_0x78583a[_0x2217('0xc')]){_0x9219fc=_[_0x2217('0xd')](_0x78583a||[],'id');logger[_0x2217('0xe')]('[CHAT]\x20Interactions\x20to\x20close:',_0x9219fc['join']());return db[_0x2217('0x7')][_0x2217('0xf')]({'closeReason':_0x2217('0x10'),'disposition':_0x2217('0x11'),'closed':!![],'closedAt':moment()[_0x2217('0x12')](_0x2217('0x13'))},{'where':{'id':_0x9219fc}});}})[_0x2217('0xb')](function(){if(_0x9219fc&&_0x9219fc[_0x2217('0xc')]){logger[_0x2217('0xe')](_0x2217('0x14'),_0x9219fc[_0x2217('0x15')]());for(var _0x2d0a9c=0x0;_0x2d0a9c<_0x9219fc[_0x2217('0xc')];_0x2d0a9c++){io[_0x2217('0x16')](_0x2217('0x17'),{'id':_0x9219fc[_0x2d0a9c],'closed':!![]});}}})[_0x2217('0x18')](function(_0x2fe581){logger[_0x2217('0x19')](_0x2217('0x1a'),_0x2fe581?util['inspect'](_0x2fe581,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xa6ee=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','moment','ioredis','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info'];(function(_0x20210e,_0x1603f6){var _0x439c00=function(_0x5b4cc2){while(--_0x5b4cc2){_0x20210e['push'](_0x20210e['shift']());}};_0x439c00(++_0x1603f6);}(_0xa6ee,0xc6));var _0xea6e=function(_0x241d85,_0x1f5c59){_0x241d85=_0x241d85-0x0;var _0x2f01a5=_0xa6ee[_0x241d85];return _0x2f01a5;};'use strict';var _=require('lodash');var moment=require(_0xea6e('0x0'));var Redis=require(_0xea6e('0x1'));var util=require('util');var config=require(_0xea6e('0x2'));var db=require(_0xea6e('0x3'))['db'];var logger=require('../logger')(_0xea6e('0x4'));config['redis']=_[_0xea6e('0x5')](config[_0xea6e('0x6')],{'host':_0xea6e('0x7'),'port':0x18eb});var io=require(_0xea6e('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x192173=0x0;var _0x500afe=[];return db[_0xea6e('0x9')][_0xea6e('0xa')]({'raw':!![],'attributes':['id',_0xea6e('0xb')],'where':{'id':0x1}})[_0xea6e('0xc')](function(_0x543084){_0x192173=_0x543084[_0xea6e('0xb')];if(_0x192173){return db[_0xea6e('0xd')][_0xea6e('0xe')]({'raw':!![],'attributes':['id',_0xea6e('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xea6e('0x10')](_0x543084[_0xea6e('0xb')],_0xea6e('0x11'))}}});}else{return[];}})[_0xea6e('0xc')](function(_0x30acd1){if(_0x30acd1&&_0x30acd1[_0xea6e('0x12')]){_0x500afe=_[_0xea6e('0x13')](_0x30acd1||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x500afe[_0xea6e('0x14')]());return db[_0xea6e('0xd')]['update']({'closeReason':_0xea6e('0x15'),'disposition':_0xea6e('0x16'),'closed':!![],'closedAt':moment()[_0xea6e('0x17')](_0xea6e('0x18'))},{'where':{'id':_0x500afe}});}})[_0xea6e('0xc')](function(){if(_0x500afe&&_0x500afe['length']){logger[_0xea6e('0x19')](_0xea6e('0x1a'),_0x500afe['join']());for(var _0x3a8b06=0x0;_0x3a8b06<_0x500afe[_0xea6e('0x12')];_0x3a8b06++){io[_0xea6e('0x1b')](_0xea6e('0x1c'),{'id':_0x500afe[_0x3a8b06],'closed':!![]});}}})[_0xea6e('0x1d')](function(_0x4d5a0f){logger[_0xea6e('0x1e')](_0xea6e('0x1f'),_0x4d5a0f?util['inspect'](_0x4d5a0f,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index adfa9c1..59b16bf 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9caa=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x9caa,0x12a));var _0xa9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9caa[_0x20a584];return _0x4b41a8;};'use strict';function start(){var _0x1af76a=require(_0xa9ca('0x0'));return _0x1af76a[_0xa9ca('0x1')]();}module[_0xa9ca('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x1eef=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x13d53d,_0x1a3ee1){var _0xfb9f88=function(_0x3c5052){while(--_0x3c5052){_0x13d53d['push'](_0x13d53d['shift']());}};_0xfb9f88(++_0x1a3ee1);}(_0x1eef,0x105));var _0xf1ee=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x1eef[_0x58a4ac];return _0x545810;};'use strict';function start(){var _0x5c7133=require(_0xf1ee('0x0'));return _0x5c7133[_0xf1ee('0x1')]();}module[_0xf1ee('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 17305f9..bbd210b 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 _0xb60e=['exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','exists','stop','delete\x20cron','length','index','my\x20id','cron','isBetween','endAt','start','add\x20cron','stop\x20cron','active','startAt','update\x20cron','deleteJob','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','basename','savename','zip','existsSync','status','Sent','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','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','SendMail','then','error','stringify','info','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0xb60e,0x10f));var _0xeb60=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0xb60e[_0x1ca4cc];return _0x108010;};'use strict';var fs=require('fs');var util=require(_0xeb60('0x0'));var path=require(_0xeb60('0x1'));var _=require(_0xeb60('0x2'));var moment=require(_0xeb60('0x3'));var CronJobManager=require(_0xeb60('0x4'));var jayson=require(_0xeb60('0x5'));var BPromise=require('bluebird');var logger=require(_0xeb60('0x6'))(_0xeb60('0x7'));var db=require(_0xeb60('0x8'))['db'];var analyticCustomReportController=require(_0xeb60('0x9'));var analyticDefaultReportController=require(_0xeb60('0xa'));var client=jayson[_0xeb60('0xb')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x30b72e,_0x1e37d9){return function(){logger['info'](_0xeb60('0xc'),_0x30b72e[_0xeb60('0xd')]);var _0x5bb97b=!![];var _0x29397c=_0x30b72e[_0xeb60('0xe')]['getSmtpOptions']();var _0x2796ca={'account':_0x29397c,'message':{'from':util[_0xeb60('0xf')]('\x22%s\x22\x20<%s>',_0x30b72e[_0xeb60('0xe')]['name'],_0x30b72e[_0xeb60('0xe')][_0xeb60('0xd')]||_0x30b72e[_0xeb60('0xe')][_0xeb60('0x10')]['user']),'to':_0x30b72e['email'],'cc':_0x30b72e['cc'],'bcc':_0x30b72e[_0xeb60('0x11')],'subject':util[_0xeb60('0xf')](_0xeb60('0x12'),_0x1e37d9['name'],_0x30b72e[_0xeb60('0x13')],_0x30b72e[_0xeb60('0x14')])}};var _0x5be25c=path[_0xeb60('0x15')](__dirname,'../../files/reports');var _0x1d4063=_0x1e37d9['savename'];var _0x2669ad=util['format'](_0xeb60('0x16'),path[_0xeb60('0x17')](_0x1e37d9[_0xeb60('0x18')],path['extname'](_0x1e37d9[_0xeb60('0x18')])),_0xeb60('0x19'));var _0x537158=path[_0xeb60('0x15')](_0x5be25c,_0x1d4063);var _0x152e62=path[_0xeb60('0x15')](_0x5be25c,_0x2669ad);if(fs[_0xeb60('0x1a')](_0x537158)){_0x1e37d9[_0xeb60('0x1b')]=_0xeb60('0x1c');_0x2796ca['message'][_0xeb60('0x1d')]=[{'filename':_0x1d4063,'path':_0x537158}];_0x2796ca['message'][_0xeb60('0x1e')]=util[_0xeb60('0xf')](_0xeb60('0x1f'),JSON['stringify'](_0x1e37d9,null,0x2));}else if(fs[_0xeb60('0x1a')](_0x152e62)){_0x1e37d9['status']=_0xeb60('0x1c');_0x2796ca[_0xeb60('0x20')][_0xeb60('0x1d')]=[{'filename':_0x2669ad,'path':_0x152e62}];}else{_0x2796ca[_0xeb60('0x20')][_0xeb60('0x1e')]=_0xeb60('0x21');if(!_0x30b72e['sendIfEmpty']){_0x5bb97b=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5bb97b){return client['request'](_0xeb60('0x22'),_0x2796ca)[_0xeb60('0x23')](function(_0x3286ef){if(_0x3286ef[_0xeb60('0x24')]){return logger[_0xeb60('0x24')]('error\x20mail',JSON[_0xeb60('0x25')](_0x3286ef));}return logger[_0xeb60('0x26')]('email\x20sent');})[_0xeb60('0x27')](function(_0x43195b){return logger[_0xeb60('0x24')]('error\x20mail',JSON[_0xeb60('0x25')](_0x43195b));});}};}function handleError(){return function(_0x4d5481){return logger[_0xeb60('0x24')](JSON[_0xeb60('0x25')](_0x4d5481));};}function handleResult(_0x5654a5){return function(_0x1feefa){logger['info']('data',JSON[_0xeb60('0x25')](_0x1feefa));if(_0x5654a5[_0xeb60('0xe')]&&_0x5654a5['MailAccount'][_0xeb60('0x10')]&&!_[_0xeb60('0x28')](_0x5654a5['email'])){setTimeout(handleSendEmail(_0x5654a5,_0x1feefa),0x3c*0x3e8);}};}function handleJob(_0x22b081){return function(){try{if(_[_0xeb60('0x28')](_0x22b081[_0xeb60('0x13')])){return logger[_0xeb60('0x26')](_0xeb60('0x29'));}if(_[_0xeb60('0x28')](_0x22b081[_0xeb60('0x14')])){return logger[_0xeb60('0x26')](_0xeb60('0x2a'));}var _0x4b7c7c={'startDate':moment()[_0xeb60('0x2b')](_0x22b081[_0xeb60('0x13')],_0x22b081[_0xeb60('0x14')])[_0xeb60('0xf')](_0xeb60('0x2c')),'endDate':moment()[_0xeb60('0xf')](_0xeb60('0x2c')),'type':_0xeb60('0x2d'),'output':_0x22b081[_0xeb60('0x2e')],'name':_0x22b081[_0xeb60('0x2f')]};if(!_['isNil'](_0x22b081[_0xeb60('0x30')])){logger[_0xeb60('0x26')](_0xeb60('0x31'),_0x22b081[_0xeb60('0x30')]);return analyticDefaultReportController[_0xeb60('0x32')]({'id':_0x22b081[_0xeb60('0x30')]},_0x4b7c7c)['then'](handleResult(_0x22b081))[_0xeb60('0x27')](handleError());}if(!_['isNil'](_0x22b081[_0xeb60('0x33')])){logger[_0xeb60('0x26')](_0xeb60('0x34'),_0x22b081[_0xeb60('0x33')]);return analyticCustomReportController[_0xeb60('0x32')]({'id':_0x22b081['CustomReportId']},_0x4b7c7c)['then'](handleResult(_0x22b081))[_0xeb60('0x27')](handleError());}}catch(_0x1f4f7a){logger[_0xeb60('0x24')](JSON[_0xeb60('0x25')](_0x1f4f7a));}return logger[_0xeb60('0x26')]('no\x20report\x20id');};}function getJobs(_0x41f3b1){var _0x10cce9={};if(_0x41f3b1){_0x10cce9['id']=_0x41f3b1;}return db[_0xeb60('0x35')][_0xeb60('0x36')]({'where':_0x10cce9,'include':[{'model':db['MailAccount'],'attributes':['id',_0xeb60('0x2f'),_0xeb60('0xd')],'include':[{'model':db[_0xeb60('0x37')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xeb60('0x38')}]}]}]})[_0xeb60('0x23')](function(_0x3e55b7){var _0x887169=_[_0xeb60('0x39')](manager[_0xeb60('0x3a')]);var _0x4c0412=_[_0xeb60('0x3b')](_0x3e55b7,function(_0x352443){return _0x352443['id']['toString']();});var _0x417898=_[_0xeb60('0x3c')](_0x3e55b7,function(_0xce8a57){return _0xce8a57['id'][_0xeb60('0x3d')]();});var _0x177669=_0x41f3b1?_0x4c0412:_[_0xeb60('0x3e')](_0x4c0412,_0x887169);var _0x3f632b=_['intersection'](_0x4c0412,_0x887169);var _0x25f315=_[_0xeb60('0x3e')](_0x887169,_0x4c0412);var _0x196bb3;var _0x4a2ef0;for(_0x196bb3=0x0;_0x196bb3<_0x25f315['length']&&!_0x41f3b1;_0x196bb3+=0x1){_0x4a2ef0=_0x25f315[_0x196bb3][_0xeb60('0x3d')]();if(manager[_0xeb60('0x3f')](_0x4a2ef0)){manager[_0xeb60('0x40')](_0x4a2ef0);manager['deleteJob'](_0x4a2ef0);logger['info'](_0xeb60('0x41'),_0x4a2ef0);}}logger[_0xeb60('0x26')]('toRun',JSON[_0xeb60('0x25')](_0x177669));for(_0x196bb3=0x0;_0x196bb3<_0x177669[_0xeb60('0x42')];_0x196bb3+=0x1){_0x4a2ef0=_0x177669[_0x196bb3][_0xeb60('0x3d')]();logger[_0xeb60('0x26')](_0xeb60('0x43'),_0x4a2ef0);if(_0x41f3b1){logger['info'](_0xeb60('0x44'),_0x41f3b1);logger['info'](JSON['stringify'](_0x417898[_0x4a2ef0]));BPromise['resolve']()['then'](handleJob(_0x417898[_0x4a2ef0]));logger[_0xeb60('0x26')]('run\x20job',_0x417898[_0x4a2ef0]['name'],_0x417898[_0x4a2ef0][_0xeb60('0x45')]);}else if(_0x417898[_0x4a2ef0][_0xeb60('0x45')]&&_0x417898[_0x4a2ef0]['active']&&moment()[_0xeb60('0x46')](_0x417898[_0x4a2ef0]['startAt'],_0x417898[_0x4a2ef0][_0xeb60('0x47')])){manager['add'](_0x4a2ef0,_0x417898[_0x4a2ef0][_0xeb60('0x45')],handleJob(_0x417898[_0x4a2ef0]));manager[_0xeb60('0x48')](_0x4a2ef0);logger[_0xeb60('0x26')](_0xeb60('0x49'),_0x417898[_0x4a2ef0][_0xeb60('0x2f')],_0x417898[_0x4a2ef0][_0xeb60('0x45')]);}else if(manager[_0xeb60('0x3f')](_0x4a2ef0)){manager[_0xeb60('0x40')](_0x4a2ef0);manager['deleteJob'](_0x4a2ef0);logger['info'](_0xeb60('0x4a'),_0x417898[_0x4a2ef0]['name'],_0x417898[_0x4a2ef0][_0xeb60('0x45')]);}}for(_0x196bb3=0x0,_0x4a2ef0;_0x196bb3<_0x3f632b[_0xeb60('0x42')]&&!_0x41f3b1;_0x196bb3+=0x1){_0x4a2ef0=_0x3f632b[_0x196bb3][_0xeb60('0x3d')]();if(manager[_0xeb60('0x3f')](_0x4a2ef0)){if(_0x417898[_0x4a2ef0]['cron']&&_0x417898[_0x4a2ef0][_0xeb60('0x4b')]&&moment()['isBetween'](_0x417898[_0x4a2ef0][_0xeb60('0x4c')],_0x417898[_0x4a2ef0][_0xeb60('0x47')])){manager['update'](_0x4a2ef0,_0x417898[_0x4a2ef0][_0xeb60('0x45')],handleJob(_0x417898[_0x4a2ef0]));logger[_0xeb60('0x26')](_0xeb60('0x4d'),_0x417898[_0x4a2ef0]['name'],_0x417898[_0x4a2ef0][_0xeb60('0x45')]);}else{manager[_0xeb60('0x40')](_0x4a2ef0);manager[_0xeb60('0x4e')](_0x4a2ef0);logger[_0xeb60('0x26')](_0xeb60('0x4a'),_0x417898[_0x4a2ef0][_0xeb60('0x2f')],_0x417898[_0x4a2ef0][_0xeb60('0x45')]);}}}})[_0xeb60('0x27')](function(_0x3e4983){logger[_0xeb60('0x24')](JSON['stringify'](_0x3e4983));});}exports[_0xeb60('0x4f')]=function(_0x4bc6d0){return getJobs(_0x4bc6d0);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x87bb=['bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','join','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','stop','deleteJob','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise'];(function(_0x2134b2,_0x5a82aa){var _0x4e4bc8=function(_0x5816b6){while(--_0x5816b6){_0x2134b2['push'](_0x2134b2['shift']());}};_0x4e4bc8(++_0x5a82aa);}(_0x87bb,0x148));var _0xb87b=function(_0x15ed42,_0x516968){_0x15ed42=_0x15ed42-0x0;var _0x132c71=_0x87bb[_0x15ed42];return _0x132c71;};'use strict';var fs=require('fs');var util=require(_0xb87b('0x0'));var path=require('path');var _=require(_0xb87b('0x1'));var moment=require('moment');var CronJobManager=require(_0xb87b('0x2'));var jayson=require(_0xb87b('0x3'));var BPromise=require(_0xb87b('0x4'));var logger=require(_0xb87b('0x5'))(_0xb87b('0x6'));var db=require(_0xb87b('0x7'))['db'];var analyticCustomReportController=require(_0xb87b('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb87b('0x9')][_0xb87b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x29a6af,_0x382660){return function(){logger[_0xb87b('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x29a6af[_0xb87b('0xc')]);var _0x3e81ae=!![];var _0x119901=_0x29a6af[_0xb87b('0xd')][_0xb87b('0xe')]();var _0x3b31fd={'account':_0x119901,'message':{'from':util[_0xb87b('0xf')](_0xb87b('0x10'),_0x29a6af[_0xb87b('0xd')][_0xb87b('0x11')],_0x29a6af['MailAccount'][_0xb87b('0xc')]||_0x29a6af['MailAccount'][_0xb87b('0x12')]['user']),'to':_0x29a6af['email'],'cc':_0x29a6af['cc'],'bcc':_0x29a6af[_0xb87b('0x13')],'subject':util[_0xb87b('0xf')](_0xb87b('0x14'),_0x382660['name'],_0x29a6af[_0xb87b('0x15')],_0x29a6af[_0xb87b('0x16')])}};var _0xa16540=path['join'](__dirname,_0xb87b('0x17'));var _0x52ac5d=_0x382660[_0xb87b('0x18')];var _0x3f7bff=util[_0xb87b('0xf')](_0xb87b('0x19'),path[_0xb87b('0x1a')](_0x382660[_0xb87b('0x18')],path[_0xb87b('0x1b')](_0x382660[_0xb87b('0x18')])),'zip');var _0x5a43a9=path[_0xb87b('0x1c')](_0xa16540,_0x52ac5d);var _0x497d21=path[_0xb87b('0x1c')](_0xa16540,_0x3f7bff);if(fs['existsSync'](_0x5a43a9)){_0x382660['status']=_0xb87b('0x1d');_0x3b31fd[_0xb87b('0x1e')][_0xb87b('0x1f')]=[{'filename':_0x52ac5d,'path':_0x5a43a9}];_0x3b31fd[_0xb87b('0x1e')]['text']=util[_0xb87b('0xf')](_0xb87b('0x20'),JSON[_0xb87b('0x21')](_0x382660,null,0x2));}else if(fs[_0xb87b('0x22')](_0x497d21)){_0x382660[_0xb87b('0x23')]='Sent';_0x3b31fd['message'][_0xb87b('0x1f')]=[{'filename':_0x3f7bff,'path':_0x497d21}];}else{_0x3b31fd[_0xb87b('0x1e')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x29a6af[_0xb87b('0x24')]){_0x3e81ae=![];logger[_0xb87b('0xb')](_0xb87b('0x25'));}}if(_0x3e81ae){return client[_0xb87b('0x26')](_0xb87b('0x27'),_0x3b31fd)[_0xb87b('0x28')](function(_0xf65924){if(_0xf65924[_0xb87b('0x29')]){return logger[_0xb87b('0x29')](_0xb87b('0x2a'),JSON['stringify'](_0xf65924));}return logger[_0xb87b('0xb')]('email\x20sent');})[_0xb87b('0x2b')](function(_0x562a48){return logger[_0xb87b('0x29')]('error\x20mail',JSON[_0xb87b('0x21')](_0x562a48));});}};}function handleError(){return function(_0x4e43e4){return logger[_0xb87b('0x29')](JSON[_0xb87b('0x21')](_0x4e43e4));};}function handleResult(_0x58d163){return function(_0x1b9268){logger[_0xb87b('0xb')](_0xb87b('0x2c'),JSON['stringify'](_0x1b9268));if(_0x58d163[_0xb87b('0xd')]&&_0x58d163['MailAccount'][_0xb87b('0x12')]&&!_[_0xb87b('0x2d')](_0x58d163[_0xb87b('0xc')])){setTimeout(handleSendEmail(_0x58d163,_0x1b9268),0x3c*0x3e8);}};}function handleJob(_0x38aa41){return function(){try{if(_[_0xb87b('0x2d')](_0x38aa41[_0xb87b('0x15')])){return logger[_0xb87b('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb87b('0x2d')](_0x38aa41[_0xb87b('0x16')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x30bc2b={'startDate':moment()[_0xb87b('0x2e')](_0x38aa41[_0xb87b('0x15')],_0x38aa41[_0xb87b('0x16')])['format'](_0xb87b('0x2f')),'endDate':moment()[_0xb87b('0xf')](_0xb87b('0x2f')),'type':_0xb87b('0x30'),'output':_0x38aa41[_0xb87b('0x31')],'name':_0x38aa41[_0xb87b('0x11')]};if(!_[_0xb87b('0x2d')](_0x38aa41[_0xb87b('0x32')])){logger[_0xb87b('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x38aa41['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x38aa41[_0xb87b('0x32')]},_0x30bc2b)[_0xb87b('0x28')](handleResult(_0x38aa41))['catch'](handleError());}if(!_[_0xb87b('0x2d')](_0x38aa41[_0xb87b('0x33')])){logger[_0xb87b('0xb')]('exec\x20custom\x20report\x20id:%s',_0x38aa41['CustomReportId']);return analyticCustomReportController[_0xb87b('0x34')]({'id':_0x38aa41['CustomReportId']},_0x30bc2b)[_0xb87b('0x28')](handleResult(_0x38aa41))[_0xb87b('0x2b')](handleError());}}catch(_0x17db68){logger[_0xb87b('0x29')](JSON[_0xb87b('0x21')](_0x17db68));}return logger[_0xb87b('0xb')](_0xb87b('0x35'));};}function getJobs(_0x480304){var _0x4a587f={};if(_0x480304){_0x4a587f['id']=_0x480304;}return db[_0xb87b('0x36')][_0xb87b('0x37')]({'where':_0x4a587f,'include':[{'model':db['MailAccount'],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0xb87b('0x12'),'include':[{'model':db[_0xb87b('0x38')],'as':'CloudProvider'}]}]}]})[_0xb87b('0x28')](function(_0x5673e3){var _0x3ceb85=_[_0xb87b('0x39')](manager[_0xb87b('0x3a')]);var _0x2f8fa1=_[_0xb87b('0x3b')](_0x5673e3,function(_0x393967){return _0x393967['id']['toString']();});var _0x21ad1d=_[_0xb87b('0x3c')](_0x5673e3,function(_0x421862){return _0x421862['id'][_0xb87b('0x3d')]();});var _0x54f0ea=_0x480304?_0x2f8fa1:_[_0xb87b('0x3e')](_0x2f8fa1,_0x3ceb85);var _0x30a411=_[_0xb87b('0x3f')](_0x2f8fa1,_0x3ceb85);var _0x50ae83=_[_0xb87b('0x3e')](_0x3ceb85,_0x2f8fa1);var _0x4cd746;var _0x1c0bae;for(_0x4cd746=0x0;_0x4cd746<_0x50ae83[_0xb87b('0x40')]&&!_0x480304;_0x4cd746+=0x1){_0x1c0bae=_0x50ae83[_0x4cd746][_0xb87b('0x3d')]();if(manager[_0xb87b('0x41')](_0x1c0bae)){manager[_0xb87b('0x42')](_0x1c0bae);manager[_0xb87b('0x43')](_0x1c0bae);logger[_0xb87b('0xb')]('delete\x20cron',_0x1c0bae);}}logger['info'](_0xb87b('0x44'),JSON[_0xb87b('0x21')](_0x54f0ea));for(_0x4cd746=0x0;_0x4cd746<_0x54f0ea['length'];_0x4cd746+=0x1){_0x1c0bae=_0x54f0ea[_0x4cd746][_0xb87b('0x3d')]();logger[_0xb87b('0xb')]('index',_0x1c0bae);if(_0x480304){logger[_0xb87b('0xb')](_0xb87b('0x45'),_0x480304);logger[_0xb87b('0xb')](JSON['stringify'](_0x21ad1d[_0x1c0bae]));BPromise[_0xb87b('0x46')]()[_0xb87b('0x28')](handleJob(_0x21ad1d[_0x1c0bae]));logger[_0xb87b('0xb')]('run\x20job',_0x21ad1d[_0x1c0bae][_0xb87b('0x11')],_0x21ad1d[_0x1c0bae][_0xb87b('0x47')]);}else if(_0x21ad1d[_0x1c0bae][_0xb87b('0x47')]&&_0x21ad1d[_0x1c0bae][_0xb87b('0x48')]&&moment()[_0xb87b('0x49')](_0x21ad1d[_0x1c0bae][_0xb87b('0x4a')],_0x21ad1d[_0x1c0bae][_0xb87b('0x4b')])){manager[_0xb87b('0x4c')](_0x1c0bae,_0x21ad1d[_0x1c0bae][_0xb87b('0x47')],handleJob(_0x21ad1d[_0x1c0bae]));manager[_0xb87b('0x4d')](_0x1c0bae);logger['info'](_0xb87b('0x4e'),_0x21ad1d[_0x1c0bae][_0xb87b('0x11')],_0x21ad1d[_0x1c0bae][_0xb87b('0x47')]);}else if(manager[_0xb87b('0x41')](_0x1c0bae)){manager[_0xb87b('0x42')](_0x1c0bae);manager['deleteJob'](_0x1c0bae);logger[_0xb87b('0xb')](_0xb87b('0x4f'),_0x21ad1d[_0x1c0bae][_0xb87b('0x11')],_0x21ad1d[_0x1c0bae]['cron']);}}for(_0x4cd746=0x0,_0x1c0bae;_0x4cd746<_0x30a411[_0xb87b('0x40')]&&!_0x480304;_0x4cd746+=0x1){_0x1c0bae=_0x30a411[_0x4cd746][_0xb87b('0x3d')]();if(manager[_0xb87b('0x41')](_0x1c0bae)){if(_0x21ad1d[_0x1c0bae][_0xb87b('0x47')]&&_0x21ad1d[_0x1c0bae]['active']&&moment()['isBetween'](_0x21ad1d[_0x1c0bae][_0xb87b('0x4a')],_0x21ad1d[_0x1c0bae]['endAt'])){manager[_0xb87b('0x50')](_0x1c0bae,_0x21ad1d[_0x1c0bae][_0xb87b('0x47')],handleJob(_0x21ad1d[_0x1c0bae]));logger['info'](_0xb87b('0x51'),_0x21ad1d[_0x1c0bae]['name'],_0x21ad1d[_0x1c0bae]['cron']);}else{manager[_0xb87b('0x42')](_0x1c0bae);manager[_0xb87b('0x43')](_0x1c0bae);logger['info'](_0xb87b('0x4f'),_0x21ad1d[_0x1c0bae]['name'],_0x21ad1d[_0x1c0bae][_0xb87b('0x47')]);}}}})[_0xb87b('0x2b')](function(_0x5489c5){logger[_0xb87b('0x29')](JSON['stringify'](_0x5489c5));});}exports[_0xb87b('0x52')]=function(_0x22f33f){return getJobs(_0x22f33f);};exports[_0xb87b('0x4d')]=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 d783d37..972cc6a 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 _0x2d93=['Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','Transcript\x20not\x20available','Mixed','catch','name','SequelizeValidationError','error','inspect','IN_PROGRESS','length','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','update','then','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','language','bucket','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','findOne'];(function(_0x47330e,_0x36c364){var _0x2d82f4=function(_0x43c311){while(--_0x43c311){_0x47330e['push'](_0x47330e['shift']());}};_0x2d82f4(++_0x36c364);}(_0x2d93,0xf3));var _0x32d9=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x2d93[_0x3c6dce];return _0x1450e9;};var _=require(_0x32d9('0x0'));var AWS=require(_0x32d9('0x1'));var rp=require(_0x32d9('0x2'));var util=require(_0x32d9('0x3'));var BPromise=require(_0x32d9('0x4'));var db=require(_0x32d9('0x5'))['db'];var logger=require(_0x32d9('0x6'))(_0x32d9('0x7'));function getTranscriptionJob(_0x395372,_0x80afe8,_0x423f4d,_0x21a3d7){return new Promise(function(_0x9b4979,_0x3529db){var _0x4d2424=new AWS[(_0x32d9('0x8'))]({'accessKeyId':_0x80afe8,'secretAccessKey':_0x395372,'region':_0x423f4d});_0x4d2424[_0x32d9('0x9')]({'TranscriptionJobName':_0x21a3d7},function(_0x42cec8,_0x43dd2c){if(_0x42cec8){return _0x3529db(_0x42cec8);}else{return _0x9b4979(_0x43dd2c);}});});}function sentiment(_0x2b5cc7,_0x521d15,_0x21df58,_0x46603b,_0x1d5f25){return new Promise(function(_0x3bb144,_0x2babbf){var _0x312988=new AWS[(_0x32d9('0xa'))]({'accessKeyId':_0x521d15,'secretAccessKey':_0x2b5cc7,'region':_0x21df58});_0x312988[_0x32d9('0xb')]({'Text':_0x46603b,'LanguageCode':_0x1d5f25[_0x32d9('0xc')](0x0,0x2)},function(_0x5efb8f,_0x1befe0){if(_0x5efb8f){return _0x2babbf(_0x5efb8f);}else{return _0x3bb144(_0x1befe0);}});});}function checkTranscribeJob(_0x5b7bab,_0x5afced,_0x16e983){var _0x3ae057;return new BPromise(function(_0x1eb32f,_0x2323f2){logger[_0x32d9('0xd')](util[_0x32d9('0xe')](_0x32d9('0xf'),_0x5b7bab['id'],_0x5b7bab[_0x32d9('0x10')]));return getTranscriptionJob(_0x16e983[_0x32d9('0x11')],_0x16e983[_0x32d9('0x12')],_0x5afced[_0x32d9('0x13')],_0x5b7bab[_0x32d9('0x10')])['then'](function(_0x251b58){logger[_0x32d9('0xd')](util['format'](_0x32d9('0x14'),_0x5b7bab['id'],_0x5b7bab[_0x32d9('0x10')],_0x251b58[_0x32d9('0x15')][_0x32d9('0x16')]));if(!_0x5b7bab[_0x32d9('0x17')]){switch(_0x251b58[_0x32d9('0x15')][_0x32d9('0x16')]){case _0x32d9('0x18'):var _0x1b006a={'transcribeStatus':_0x251b58[_0x32d9('0x15')]['TranscriptionJobStatus'],'fileUri':_0x251b58['TranscriptionJob'][_0x32d9('0x19')][_0x32d9('0x1a')]};logger['info'](util[_0x32d9('0xe')]('[RECORDING:%d]\x20Get\x20transcript',_0x5b7bab['id']));return rp({'uri':_0x251b58[_0x32d9('0x15')][_0x32d9('0x19')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x3e2ef3){logger[_0x32d9('0xd')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x5b7bab['id']));if(_0x3e2ef3&&_0x3e2ef3[_0x32d9('0x1b')]&&_0x3e2ef3[_0x32d9('0x1b')][_0x32d9('0x1c')]&&_0x3e2ef3[_0x32d9('0x1b')][_0x32d9('0x1c')]['length']){_0x1b006a[_0x32d9('0x17')]='';for(var _0x1c51a8=0x0;_0x1c51a8<_0x3e2ef3[_0x32d9('0x1b')][_0x32d9('0x1c')]['length'];_0x1c51a8++){_0x1b006a[_0x32d9('0x17')]+=_0x3e2ef3[_0x32d9('0x1b')][_0x32d9('0x1c')][_0x1c51a8]['transcript']+'';}}return _0x5b7bab[_0x32d9('0x1d')](_0x1b006a);})[_0x32d9('0x1e')](function(){logger[_0x32d9('0xd')](util[_0x32d9('0xe')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b7bab['id']));if(!_0x5b7bab[_0x32d9('0x1f')]){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))](_0x32d9('0x22'));}if(!_0x5afced['sentiment']||!_0x5afced['sentimentAccountId']||!_0x5afced['sentimentRegion']||!_0x5afced[_0x32d9('0x23')]||!_0x5afced[_0x32d9('0x24')]){throw new db[(_0x32d9('0x20'))]['ValidationError'](_0x32d9('0x25'));}if(!_0x1b006a[_0x32d9('0x17')]){throw new Error('Transcript\x20not\x20available');}if(_0x5afced[_0x32d9('0x26')]===_0x16e983['id']){return _0x16e983;}else{return db[_0x32d9('0x27')][_0x32d9('0x28')]({'where':{'id':_settings[_0x32d9('0x26')]}});}})[_0x32d9('0x1e')](function(_0x4fa4e1){if(!_0x4fa4e1){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))](_0x32d9('0x29'));}if(!_0x4fa4e1[_0x32d9('0x11')]||!_0x4fa4e1['data2']){throw new db[(_0x32d9('0x20'))]['ValidationError'](_0x32d9('0x2a'));}_0x3ae057=_0x4fa4e1;logger[_0x32d9('0xd')](util[_0x32d9('0xe')](_0x32d9('0x2b'),_0x5b7bab['id']));return sentiment(_0x3ae057[_0x32d9('0x11')],_0x3ae057[_0x32d9('0x12')],_0x5afced[_0x32d9('0x2c')],_0x1b006a[_0x32d9('0x17')],_0x5afced[_0x32d9('0x23')]);})['then'](function(_0x3302d0){logger[_0x32d9('0xd')](util[_0x32d9('0xe')](_0x32d9('0x2d'),_0x5b7bab['id']));return _0x5b7bab[_0x32d9('0x1d')]({'sentiment':_0x3302d0[_0x32d9('0x2e')],'sPositive':_0x3302d0[_0x32d9('0x2f')][_0x32d9('0x30')],'sNegative':_0x3302d0[_0x32d9('0x2f')][_0x32d9('0x31')],'sMixed':_0x3302d0['SentimentScore']['Mixed'],'sNeutral':_0x3302d0[_0x32d9('0x2f')][_0x32d9('0x32')]});})[_0x32d9('0x1e')](function(){logger[_0x32d9('0xd')](util[_0x32d9('0xe')](_0x32d9('0x33'),_0x5b7bab['id']));_0x1eb32f();});case _0x32d9('0x34'):return _0x5b7bab[_0x32d9('0x1d')]({'transcribeStatus':_0x32d9('0x34'),'failureReason':_0x251b58[_0x32d9('0x15')]['FailureReason']})[_0x32d9('0x1e')](function(){logger['info'](util['format'](_0x32d9('0x33'),_0x5b7bab['id']));_0x1eb32f();});default:logger[_0x32d9('0xd')](util['format'](_0x32d9('0x35'),_0x5b7bab['id']));break;}}else{return BPromise['resolve']()[_0x32d9('0x1e')](function(){if(!_0x5b7bab[_0x32d9('0x1f')]){throw new db[(_0x32d9('0x20'))]['ValidationError'](_0x32d9('0x22'));}if(!_0x5afced[_0x32d9('0x36')]||!_0x5afced[_0x32d9('0x26')]||!_0x5afced[_0x32d9('0x2c')]||!_0x5afced[_0x32d9('0x23')]||!_0x5afced[_0x32d9('0x24')]){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b7bab['fileText']){throw new Error(_0x32d9('0x37'));}if(_0x5afced[_0x32d9('0x26')]===_0x16e983['id']){return _0x16e983;}else{return db['CloudProvider'][_0x32d9('0x28')]({'where':{'id':_settings[_0x32d9('0x26')]}});}})[_0x32d9('0x1e')](function(_0x261c27){if(!_0x261c27){throw new db['Sequelize']['ValidationError'](_0x32d9('0x29'));}if(!_0x261c27[_0x32d9('0x11')]||!_0x261c27[_0x32d9('0x12')]){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))](_0x32d9('0x2a'));}_0x3ae057=_0x261c27;logger[_0x32d9('0xd')](util[_0x32d9('0xe')](_0x32d9('0x2b'),_0x5b7bab['id']));return sentiment(_0x3ae057[_0x32d9('0x11')],_0x3ae057['data2'],_0x5afced[_0x32d9('0x2c')],_0x5b7bab['fileText'],_0x5afced[_0x32d9('0x23')]);})[_0x32d9('0x1e')](function(_0x209a05){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5b7bab['id']));return _0x5b7bab[_0x32d9('0x1d')]({'sentiment':_0x209a05[_0x32d9('0x2e')],'sPositive':_0x209a05['SentimentScore'][_0x32d9('0x30')],'sNegative':_0x209a05['SentimentScore'][_0x32d9('0x31')],'sMixed':_0x209a05['SentimentScore'][_0x32d9('0x38')],'sNeutral':_0x209a05[_0x32d9('0x2f')][_0x32d9('0x32')],'transcribeStatus':_0x32d9('0x18')});})[_0x32d9('0x1e')](function(){logger['info'](util[_0x32d9('0xe')](_0x32d9('0x33'),_0x5b7bab['id']));_0x1eb32f();});}})[_0x32d9('0x39')](function(_0x5d48e4){if(_0x5d48e4){if(!_0x5d48e4[_0x32d9('0x3a')]||_0x5d48e4[_0x32d9('0x3a')]!==_0x32d9('0x3b')){logger[_0x32d9('0x3c')](util[_0x32d9('0xe')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5b7bab['id']),util[_0x32d9('0x3d')](_0x5d48e4,{'showHidden':![],'depth':null}));}}_0x1eb32f();});});}function checkTranscribe(){var _0x137976;var _0x21ccf9;var _0x433d90;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x32d9('0x3e')}})[_0x32d9('0x1e')](function(_0x387e6c){if(!_0x387e6c||!_0x387e6c[_0x32d9('0x3f')]){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))](_0x32d9('0x40'));}_0x137976=_0x387e6c;return db[_0x32d9('0x41')]['findOne']({'where':{'id':0x1}});})[_0x32d9('0x1e')](function(_0x1d7425){if(!_0x1d7425){throw new db[(_0x32d9('0x20'))]['ValidationError']('Settings\x20not\x20available');}_0x21ccf9=_0x1d7425;if(!_0x21ccf9[_0x32d9('0x7')]||!_0x21ccf9[_0x32d9('0x42')]||!_0x21ccf9[_0x32d9('0x13')]||!_0x21ccf9[_0x32d9('0x23')]||!_0x21ccf9[_0x32d9('0x24')]){throw new db[(_0x32d9('0x20'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x32d9('0x27')][_0x32d9('0x28')]({'where':{'id':_0x21ccf9['transcribeAccountId']}});})[_0x32d9('0x1e')](function(_0x284127){if(!_0x284127){throw new db['Sequelize'][(_0x32d9('0x21'))](_0x32d9('0x29'));}if(!_0x284127[_0x32d9('0x11')]||!_0x284127[_0x32d9('0x12')]){throw new db[(_0x32d9('0x20'))][(_0x32d9('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x433d90=_0x284127;var _0x25d06b=[];_0x137976[_0x32d9('0x43')](function(_0x3754d6){_0x25d06b[_0x32d9('0x44')](checkTranscribeJob(_0x3754d6,_0x21ccf9,_0x433d90));});return BPromise[_0x32d9('0x45')](_0x25d06b);})['catch'](function(_0x1cc96b){if(_0x1cc96b){if(!_0x1cc96b[_0x32d9('0x3a')]||_0x1cc96b[_0x32d9('0x3a')]!==_0x32d9('0x3b')){logger[_0x32d9('0x3c')](util[_0x32d9('0x3d')](_0x1cc96b,{'showHidden':![],'depth':null}));}}});}exports[_0x32d9('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x2cb0=['detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','info','[RECORDING:%d]\x20Transcript\x20downloaded','transcripts','length','fileText','results','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','Comprehend'];(function(_0x296bee,_0x1d96b3){var _0x14e4f6=function(_0x2a76aa){while(--_0x2a76aa){_0x296bee['push'](_0x296bee['shift']());}};_0x14e4f6(++_0x1d96b3);}(_0x2cb0,0x12c));var _0x02cb=function(_0x265969,_0x29868e){_0x265969=_0x265969-0x0;var _0x560d7c=_0x2cb0[_0x265969];return _0x560d7c;};var _=require(_0x02cb('0x0'));var AWS=require(_0x02cb('0x1'));var rp=require('request-promise');var util=require(_0x02cb('0x2'));var BPromise=require(_0x02cb('0x3'));var db=require(_0x02cb('0x4'))['db'];var logger=require(_0x02cb('0x5'))('transcribe');function getTranscriptionJob(_0x29575b,_0x179a8b,_0x3f7743,_0x2fb292){return new Promise(function(_0x32cfdf,_0x452212){var _0x291240=new AWS[(_0x02cb('0x6'))]({'accessKeyId':_0x179a8b,'secretAccessKey':_0x29575b,'region':_0x3f7743});_0x291240['getTranscriptionJob']({'TranscriptionJobName':_0x2fb292},function(_0x175b98,_0x294182){if(_0x175b98){return _0x452212(_0x175b98);}else{return _0x32cfdf(_0x294182);}});});}function sentiment(_0x1fa694,_0x43a8d2,_0xcdfc87,_0x5a1efb,_0x1735c8){return new Promise(function(_0x847342,_0x2787a7){var _0x59511e=new AWS[(_0x02cb('0x7'))]({'accessKeyId':_0x43a8d2,'secretAccessKey':_0x1fa694,'region':_0xcdfc87});_0x59511e[_0x02cb('0x8')]({'Text':_0x5a1efb,'LanguageCode':_0x1735c8[_0x02cb('0x9')](0x0,0x2)},function(_0x8a6345,_0x4813fc){if(_0x8a6345){return _0x2787a7(_0x8a6345);}else{return _0x847342(_0x4813fc);}});});}function checkTranscribeJob(_0x2864c3,_0x19b326,_0x403cc9){var _0x6f43c0;return new BPromise(function(_0x45f349,_0x3d4b9c){logger['info'](util[_0x02cb('0xa')](_0x02cb('0xb'),_0x2864c3['id'],_0x2864c3[_0x02cb('0xc')]));return getTranscriptionJob(_0x403cc9['data1'],_0x403cc9[_0x02cb('0xd')],_0x19b326[_0x02cb('0xe')],_0x2864c3[_0x02cb('0xc')])[_0x02cb('0xf')](function(_0x1c88aa){logger['info'](util['format'](_0x02cb('0x10'),_0x2864c3['id'],_0x2864c3[_0x02cb('0xc')],_0x1c88aa[_0x02cb('0x11')][_0x02cb('0x12')]));if(!_0x2864c3['fileText']){switch(_0x1c88aa[_0x02cb('0x11')]['TranscriptionJobStatus']){case _0x02cb('0x13'):var _0x4cbb03={'transcribeStatus':_0x1c88aa[_0x02cb('0x11')][_0x02cb('0x12')],'fileUri':_0x1c88aa[_0x02cb('0x11')]['Transcript'][_0x02cb('0x14')]};logger['info'](util[_0x02cb('0xa')](_0x02cb('0x15'),_0x2864c3['id']));return rp({'uri':_0x1c88aa[_0x02cb('0x11')][_0x02cb('0x16')][_0x02cb('0x14')],'json':!![]})[_0x02cb('0xf')](function(_0x4c7bfe){logger[_0x02cb('0x17')](util[_0x02cb('0xa')](_0x02cb('0x18'),_0x2864c3['id']));if(_0x4c7bfe&&_0x4c7bfe['results']&&_0x4c7bfe['results']['transcripts']&&_0x4c7bfe['results'][_0x02cb('0x19')][_0x02cb('0x1a')]){_0x4cbb03[_0x02cb('0x1b')]='';for(var _0x267b0f=0x0;_0x267b0f<_0x4c7bfe[_0x02cb('0x1c')][_0x02cb('0x19')][_0x02cb('0x1a')];_0x267b0f++){_0x4cbb03[_0x02cb('0x1b')]+=_0x4c7bfe[_0x02cb('0x1c')]['transcripts'][_0x267b0f][_0x02cb('0x1d')]+'';}}return _0x2864c3[_0x02cb('0x1e')](_0x4cbb03);})[_0x02cb('0xf')](function(){logger[_0x02cb('0x17')](util[_0x02cb('0xa')](_0x02cb('0x1f'),_0x2864c3['id']));if(!_0x2864c3[_0x02cb('0x20')]){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x19b326['sentiment']||!_0x19b326[_0x02cb('0x23')]||!_0x19b326[_0x02cb('0x24')]||!_0x19b326[_0x02cb('0x25')]||!_0x19b326[_0x02cb('0x26')]){throw new db[(_0x02cb('0x21'))]['ValidationError'](_0x02cb('0x27'));}if(!_0x4cbb03['fileText']){throw new Error(_0x02cb('0x28'));}if(_0x19b326['sentimentAccountId']===_0x403cc9['id']){return _0x403cc9;}else{return db[_0x02cb('0x29')][_0x02cb('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3585f3){if(!_0x3585f3){throw new db['Sequelize']['ValidationError'](_0x02cb('0x2b'));}if(!_0x3585f3['data1']||!_0x3585f3[_0x02cb('0xd')]){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))](_0x02cb('0x2c'));}_0x6f43c0=_0x3585f3;logger[_0x02cb('0x17')](util[_0x02cb('0xa')](_0x02cb('0x2d'),_0x2864c3['id']));return sentiment(_0x6f43c0[_0x02cb('0x2e')],_0x6f43c0[_0x02cb('0xd')],_0x19b326[_0x02cb('0x24')],_0x4cbb03[_0x02cb('0x1b')],_0x19b326[_0x02cb('0x25')]);})['then'](function(_0x5b35ea){logger[_0x02cb('0x17')](util[_0x02cb('0xa')](_0x02cb('0x2f'),_0x2864c3['id']));return _0x2864c3[_0x02cb('0x1e')]({'sentiment':_0x5b35ea[_0x02cb('0x30')],'sPositive':_0x5b35ea[_0x02cb('0x31')][_0x02cb('0x32')],'sNegative':_0x5b35ea[_0x02cb('0x31')][_0x02cb('0x33')],'sMixed':_0x5b35ea[_0x02cb('0x31')][_0x02cb('0x34')],'sNeutral':_0x5b35ea[_0x02cb('0x31')][_0x02cb('0x35')]});})[_0x02cb('0xf')](function(){logger[_0x02cb('0x17')](util['format'](_0x02cb('0x1f'),_0x2864c3['id']));_0x45f349();});case _0x02cb('0x36'):return _0x2864c3[_0x02cb('0x1e')]({'transcribeStatus':_0x02cb('0x36'),'failureReason':_0x1c88aa[_0x02cb('0x11')][_0x02cb('0x37')]})['then'](function(){logger['info'](util[_0x02cb('0xa')](_0x02cb('0x1f'),_0x2864c3['id']));_0x45f349();});default:logger[_0x02cb('0x17')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x2864c3['id']));break;}}else{return BPromise[_0x02cb('0x38')]()['then'](function(){if(!_0x2864c3[_0x02cb('0x20')]){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))](_0x02cb('0x39'));}if(!_0x19b326[_0x02cb('0x3a')]||!_0x19b326[_0x02cb('0x23')]||!_0x19b326[_0x02cb('0x24')]||!_0x19b326[_0x02cb('0x25')]||!_0x19b326['bucket']){throw new db['Sequelize'][(_0x02cb('0x22'))](_0x02cb('0x27'));}if(!_0x2864c3['fileText']){throw new Error(_0x02cb('0x28'));}if(_0x19b326[_0x02cb('0x23')]===_0x403cc9['id']){return _0x403cc9;}else{return db[_0x02cb('0x29')]['findOne']({'where':{'id':_settings[_0x02cb('0x23')]}});}})[_0x02cb('0xf')](function(_0x14981f){if(!_0x14981f){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x14981f[_0x02cb('0x2e')]||!_0x14981f[_0x02cb('0xd')]){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))](_0x02cb('0x2c'));}_0x6f43c0=_0x14981f;logger['info'](util['format'](_0x02cb('0x2d'),_0x2864c3['id']));return sentiment(_0x6f43c0['data1'],_0x6f43c0[_0x02cb('0xd')],_0x19b326['sentimentRegion'],_0x2864c3[_0x02cb('0x1b')],_0x19b326[_0x02cb('0x25')]);})[_0x02cb('0xf')](function(_0x2a9346){logger[_0x02cb('0x17')](util[_0x02cb('0xa')](_0x02cb('0x2f'),_0x2864c3['id']));return _0x2864c3['update']({'sentiment':_0x2a9346[_0x02cb('0x30')],'sPositive':_0x2a9346[_0x02cb('0x31')][_0x02cb('0x32')],'sNegative':_0x2a9346['SentimentScore'][_0x02cb('0x33')],'sMixed':_0x2a9346[_0x02cb('0x31')][_0x02cb('0x34')],'sNeutral':_0x2a9346[_0x02cb('0x31')][_0x02cb('0x35')],'transcribeStatus':_0x02cb('0x13')});})[_0x02cb('0xf')](function(){logger['info'](util[_0x02cb('0xa')](_0x02cb('0x1f'),_0x2864c3['id']));_0x45f349();});}})[_0x02cb('0x3b')](function(_0xc77a54){if(_0xc77a54){if(!_0xc77a54[_0x02cb('0x3c')]||_0xc77a54[_0x02cb('0x3c')]!==_0x02cb('0x3d')){logger[_0x02cb('0x3e')](util['format'](_0x02cb('0x3f'),_0x2864c3['id']),util[_0x02cb('0x40')](_0xc77a54,{'showHidden':![],'depth':null}));}}_0x45f349();});});}function checkTranscribe(){var _0x3182c5;var _0x58c10c;var _0x41927f;return db[_0x02cb('0x41')][_0x02cb('0x42')]({'where':{'transcribeStatus':_0x02cb('0x43')}})[_0x02cb('0xf')](function(_0xc33f25){if(!_0xc33f25||!_0xc33f25[_0x02cb('0x1a')]){throw new db[(_0x02cb('0x21'))][(_0x02cb('0x22'))](_0x02cb('0x44'));}_0x3182c5=_0xc33f25;return db['Setting'][_0x02cb('0x2a')]({'where':{'id':0x1}});})[_0x02cb('0xf')](function(_0x163571){if(!_0x163571){throw new db['Sequelize'][(_0x02cb('0x22'))](_0x02cb('0x45'));}_0x58c10c=_0x163571;if(!_0x58c10c[_0x02cb('0x46')]||!_0x58c10c[_0x02cb('0x47')]||!_0x58c10c[_0x02cb('0xe')]||!_0x58c10c[_0x02cb('0x25')]||!_0x58c10c[_0x02cb('0x26')]){throw new db[(_0x02cb('0x21'))]['ValidationError'](_0x02cb('0x48'));}return db['CloudProvider'][_0x02cb('0x2a')]({'where':{'id':_0x58c10c[_0x02cb('0x47')]}});})[_0x02cb('0xf')](function(_0x50dcb3){if(!_0x50dcb3){throw new db['Sequelize'][(_0x02cb('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x50dcb3[_0x02cb('0x2e')]||!_0x50dcb3[_0x02cb('0xd')]){throw new db['Sequelize'][(_0x02cb('0x22'))](_0x02cb('0x2c'));}_0x41927f=_0x50dcb3;var _0x3de4ee=[];_0x3182c5[_0x02cb('0x49')](function(_0x2ca600){_0x3de4ee[_0x02cb('0x4a')](checkTranscribeJob(_0x2ca600,_0x58c10c,_0x41927f));});return BPromise[_0x02cb('0x4b')](_0x3de4ee);})[_0x02cb('0x3b')](function(_0x2f1b44){if(_0x2f1b44){if(!_0x2f1b44[_0x02cb('0x3c')]||_0x2f1b44['name']!==_0x02cb('0x3d')){logger[_0x02cb('0x3e')](util[_0x02cb('0x40')](_0x2f1b44,{'showHidden':![],'depth':null}));}}});}exports[_0x02cb('0x4c')]=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 aa79eed..3db3707 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 _0x94ff=['socket.io-emitter','subtract','hours','then','length','map','info','WhatsappInteraction','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0x398070,_0x18bebc){var _0x14fc28=function(_0x550ba0){while(--_0x550ba0){_0x398070['push'](_0x398070['shift']());}};_0x14fc28(++_0x18bebc);}(_0x94ff,0x83));var _0xf94f=function(_0x59d8a9,_0x25be7d){_0x59d8a9=_0x59d8a9-0x0;var _0x9934b8=_0x94ff[_0x59d8a9];return _0x9934b8;};'use strict';var _=require(_0xf94f('0x0'));var moment=require(_0xf94f('0x1'));var Redis=require(_0xf94f('0x2'));var util=require(_0xf94f('0x3'));var config=require(_0xf94f('0x4'));var db=require(_0xf94f('0x5'))['db'];var logger=require('../logger')('schedule');config['redis']=_[_0xf94f('0x6')](config[_0xf94f('0x7')],{'host':_0xf94f('0x8'),'port':0x18eb});var io=require(_0xf94f('0x9'))(new Redis(config[_0xf94f('0x7')]));function closeInteractions(){var _0x4091c3=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf94f('0xa')](0x18,_0xf94f('0xb'))}}})[_0xf94f('0xc')](function(_0x2a07ab){if(_0x2a07ab&&_0x2a07ab[_0xf94f('0xd')]){_0x4091c3=_[_0xf94f('0xe')](_0x2a07ab||[],'id');logger[_0xf94f('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4091c3['join']());return db[_0xf94f('0x10')]['update']({'closeReason':'system','disposition':_0xf94f('0x11'),'closed':!![],'closedAt':moment()[_0xf94f('0x12')](_0xf94f('0x13'))},{'where':{'id':_0x4091c3}});}})[_0xf94f('0xc')](function(){if(_0x4091c3&&_0x4091c3[_0xf94f('0xd')]){logger[_0xf94f('0xf')](_0xf94f('0x14'),_0x4091c3[_0xf94f('0x15')]());for(var _0x11254a=0x0;_0x11254a<_0x4091c3['length'];_0x11254a++){io['emit'](_0xf94f('0x16'),{'id':_0x4091c3[_0x11254a],'closed':!![]});}}})[_0xf94f('0x17')](function(_0x25cdc6){logger[_0xf94f('0x18')](_0xf94f('0x19'),_0x25cdc6?util[_0xf94f('0x1a')](_0x25cdc6,{'showHidden':![],'depth':null}):'');});}exports[_0xf94f('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd916=['catch','error','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x36fa00,_0x221279){var _0x1549c4=function(_0x4effc2){while(--_0x4effc2){_0x36fa00['push'](_0x36fa00['shift']());}};_0x1549c4(++_0x221279);}(_0xd916,0x18a));var _0x6d91=function(_0x586974,_0x428a51){_0x586974=_0x586974-0x0;var _0x427108=_0xd916[_0x586974];return _0x427108;};'use strict';var _=require(_0x6d91('0x0'));var moment=require(_0x6d91('0x1'));var Redis=require(_0x6d91('0x2'));var util=require(_0x6d91('0x3'));var config=require(_0x6d91('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x6d91('0x5'))(_0x6d91('0x6'));config['redis']=_['defaults'](config[_0x6d91('0x7')],{'host':_0x6d91('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6d91('0x7')]));function closeInteractions(){var _0x3fcd82=[];return db[_0x6d91('0x9')][_0x6d91('0xa')]({'raw':!![],'attributes':['id',_0x6d91('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6d91('0xc')](0x18,_0x6d91('0xd'))}}})['then'](function(_0x574d9e){if(_0x574d9e&&_0x574d9e['length']){_0x3fcd82=_['map'](_0x574d9e||[],'id');logger[_0x6d91('0xe')](_0x6d91('0xf'),_0x3fcd82[_0x6d91('0x10')]());return db[_0x6d91('0x9')][_0x6d91('0x11')]({'closeReason':'system','disposition':_0x6d91('0x12'),'closed':!![],'closedAt':moment()[_0x6d91('0x13')](_0x6d91('0x14'))},{'where':{'id':_0x3fcd82}});}})[_0x6d91('0x15')](function(){if(_0x3fcd82&&_0x3fcd82[_0x6d91('0x16')]){logger[_0x6d91('0xe')](_0x6d91('0x17'),_0x3fcd82[_0x6d91('0x10')]());for(var _0x12cc2b=0x0;_0x12cc2b<_0x3fcd82[_0x6d91('0x16')];_0x12cc2b++){io[_0x6d91('0x18')](_0x6d91('0x19'),{'id':_0x3fcd82[_0x12cc2b],'closed':!![]});}}})[_0x6d91('0x1a')](function(_0x1cdbeb){logger[_0x6d91('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x1cdbeb?util[_0x6d91('0x1c')](_0x1cdbeb,{'showHidden':![],'depth':null}):'');});}exports[_0x6d91('0x1d')]=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 88cf1fa..f881c0e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x09ca=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','CmContact','hopper2','catch'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x09ca,0x1b5));var _0xa09c=function(_0x166aff,_0x554d46){_0x166aff=_0x166aff-0x0;var _0x2948cc=_0x09ca[_0x166aff];return _0x2948cc;};'use strict';var util=require(_0xa09c('0x0'));var db=require(_0xa09c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa09c('0x2')]({'id':i,'firstName':_0xa09c('0x3')+i,'lastName':_0xa09c('0x4')+i,'phone':0xf879fb460+i,'email':_0xa09c('0x5')+i+_0xa09c('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa09c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa09c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa09c('0x7')](),'updatedAt':Date[_0xa09c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa09c('0x2')]({'id':i,'firstName':_0xa09c('0x3')+i,'lastName':_0xa09c('0x4')+i,'phone':0xf879fb460+i,'email':_0xa09c('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa09c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa09c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa09c('0x7')](),'updatedAt':Date[_0xa09c('0x7')]()});}db['CmContact'][_0xa09c('0x8')]({'where':{}})[_0xa09c('0x9')](function(){return db['CmContact'][_0xa09c('0xa')](contacts);})[_0xa09c('0x9')](function(){console['log'](_0xa09c('0xb'),_0xa09c('0xc'));return db[_0xa09c('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0xa09c('0xd')][_0xa09c('0xa')](hopper);})['then'](function(){console[_0xa09c('0xe')]('finished\x20populating',_0xa09c('0xf'));return db[_0xa09c('0x10')]['bulkCreate'](contacts2);})[_0xa09c('0x9')](function(){console['log'](_0xa09c('0xb'),'contacts2');return db[_0xa09c('0xd')][_0xa09c('0xa')](hopper2);})[_0xa09c('0x9')](function(){console['log']('finished\x20populating',_0xa09c('0x11'));})[_0xa09c('0x12')](function(_0x1abf10){console[_0xa09c('0xe')](_0x1abf10);}); \ No newline at end of file +var _0xe04b=['contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','contacts1','CmHopper','bulkCreate','log','finished\x20populating'];(function(_0x4b4d99,_0x57d8dd){var _0x9759d1=function(_0x5d1362){while(--_0x5d1362){_0x4b4d99['push'](_0x4b4d99['shift']());}};_0x9759d1(++_0x57d8dd);}(_0xe04b,0x17f));var _0xbe04=function(_0x628890,_0x17a9e1){_0x628890=_0x628890-0x0;var _0x8d58c9=_0xe04b[_0x628890];return _0x8d58c9;};'use strict';var util=require(_0xbe04('0x0'));var db=require(_0xbe04('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xbe04('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xbe04('0x3')+i,'phone':0xf879fb460+i,'email':_0xbe04('0x4')+i+_0xbe04('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbe04('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xbe04('0x2')]({'id':i,'firstName':_0xbe04('0x7')+i,'lastName':_0xbe04('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xbe04('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xbe04('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xbe04('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xbe04('0x6')](),'updatedAt':Date[_0xbe04('0x6')]()});}db[_0xbe04('0x8')][_0xbe04('0x9')]({'where':{}})[_0xbe04('0xa')](function(){return db[_0xbe04('0x8')]['bulkCreate'](contacts);})[_0xbe04('0xa')](function(){console['log']('finished\x20populating',_0xbe04('0xb'));return db[_0xbe04('0xc')][_0xbe04('0x9')]({'where':{}});})[_0xbe04('0xa')](function(){return db[_0xbe04('0xc')][_0xbe04('0xd')](hopper);})['then'](function(){console[_0xbe04('0xe')](_0xbe04('0xf'),'hopper1');return db[_0xbe04('0x8')][_0xbe04('0xd')](contacts2);})[_0xbe04('0xa')](function(){console[_0xbe04('0xe')](_0xbe04('0xf'),_0xbe04('0x10'));return db[_0xbe04('0xc')][_0xbe04('0xd')](hopper2);})[_0xbe04('0xa')](function(){console[_0xbe04('0xe')](_0xbe04('0xf'),_0xbe04('0x11'));})[_0xbe04('0x12')](function(_0xc40074){console[_0xbe04('0xe')](_0xc40074);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 64bf1ef..e00672b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb3d6=['%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format'];(function(_0x2cce0c,_0x4cd182){var _0x83cc43=function(_0x756a6c){while(--_0x756a6c){_0x2cce0c['push'](_0x2cce0c['shift']());}};_0x83cc43(++_0x4cd182);}(_0xb3d6,0x162));var _0x6b3d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb3d6[_0x432682];return _0x463d05;};'use strict';var util=require(_0x6b3d('0x0'));var db=require(_0x6b3d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x6b3d('0x2')](_0x6b3d('0x3'),_0x6b3d('0x4'),i),'fullname':util['format'](_0x6b3d('0x3'),_0x6b3d('0x4'),i),'email':util[_0x6b3d('0x2')]('%s%s@xcally.com',_0x6b3d('0x4'),i),'role':_0x6b3d('0x4'),'password':_0x6b3d('0x5'),'internal':0xfa0+i,'type':_0x6b3d('0x6'),'transport':[_0x6b3d('0x7'),'ws',_0x6b3d('0x8')],'disallow':[_0x6b3d('0x9')],'allow':[_0x6b3d('0xa')],'defaultuser':util[_0x6b3d('0x2')](_0x6b3d('0x3'),_0x6b3d('0x4'),i),'encryption':_0x6b3d('0xb'),'avpf':_0x6b3d('0xb'),'force_avp':_0x6b3d('0xb'),'icesupport':_0x6b3d('0xb'),'dtlsenable':_0x6b3d('0xb'),'dtlsverify':'no','dtlscertfile':_0x6b3d('0xc'),'dtlsprivatekey':_0x6b3d('0xd'),'dtlssetup':_0x6b3d('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x6b3d('0x2')](_0x6b3d('0x3'),_0x6b3d('0x4'),i),0xfa0+i)});}db[_0x6b3d('0xf')][_0x6b3d('0x10')](users)[_0x6b3d('0x11')](function(){console[_0x6b3d('0x12')](_0x6b3d('0x13'));})[_0x6b3d('0x14')](function(_0x2c54ee){console[_0x6b3d('0x12')](_0x2c54ee);}); \ No newline at end of file +var _0x3e18=['push','%s%s','format','agent','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','User','then','log','add\x20user','catch','util','../mysqldb'];(function(_0x5cbb32,_0x233ace){var _0x49363c=function(_0x4649d1){while(--_0x4649d1){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x49363c(++_0x233ace);}(_0x3e18,0x9e));var _0x83e1=function(_0x5d418b,_0x203346){_0x5d418b=_0x5d418b-0x0;var _0x4cd42c=_0x3e18[_0x5d418b];return _0x4cd42c;};'use strict';var util=require(_0x83e1('0x0'));var db=require(_0x83e1('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x83e1('0x2')]({'name':util['format'](_0x83e1('0x3'),'agent',i),'fullname':util[_0x83e1('0x4')](_0x83e1('0x3'),_0x83e1('0x5'),i),'email':util[_0x83e1('0x4')](_0x83e1('0x6'),'agent',i),'role':_0x83e1('0x5'),'password':_0x83e1('0x7'),'internal':0xfa0+i,'type':_0x83e1('0x8'),'transport':[_0x83e1('0x9'),'ws',_0x83e1('0xa')],'disallow':['all'],'allow':[_0x83e1('0xb')],'defaultuser':util[_0x83e1('0x4')](_0x83e1('0x3'),_0x83e1('0x5'),i),'encryption':'yes','avpf':_0x83e1('0xc'),'force_avp':_0x83e1('0xc'),'icesupport':_0x83e1('0xc'),'dtlsenable':_0x83e1('0xc'),'dtlsverify':'no','dtlscertfile':_0x83e1('0xd'),'dtlsprivatekey':_0x83e1('0xe'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x83e1('0x4')]('%s%s',_0x83e1('0x5'),i),0xfa0+i)});}db[_0x83e1('0xf')]['bulkCreate'](users)[_0x83e1('0x10')](function(){console[_0x83e1('0x11')](_0x83e1('0x12'));})[_0x83e1('0x13')](function(_0x310e64){console[_0x83e1('0x11')](_0x310e64);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 97486a5..8dec78b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8952=['findAll','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','length','find','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueues','FaxQueue','MailQueues','MailQueue','Trunks','agent','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','user:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','setMaxListeners','address','connection','remoteAddress','remotePort','connectedAt','nsp','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','role','telephone','type','ivr','UserProfileSection','then','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x8952,0x17e));var _0x2895=function(_0x39989c,_0x3d87cc){_0x39989c=_0x39989c-0x0;var _0xfc41f5=_0x8952[_0x39989c];return _0xfc41f5;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var BPromise=require(_0x2895('0x1'));var db=require(_0x2895('0x2'))['db'];var config=require(_0x2895('0x3'));var queryQueues={'attributes':['id',_0x2895('0x4')],'include':[{'as':'Agents','model':db[_0x2895('0x5')],'attributes':['id',_0x2895('0x4'),_0x2895('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2895('0x4')],'where':{'role':_0x2895('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2895('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2895('0x4'),_0x2895('0x8')],'where':{'type':_0x2895('0x9')}};function getAssociatedResources(_0x294446,_0x384cc6,_0x4952fa){return db[_0x2895('0xa')]['findOne']({'where':{'name':_0x294446,'userProfileId':_0x384cc6},'raw':!![]})[_0x2895('0xb')](function(_0x5af454){if(_0x5af454){if(_0x5af454['autoAssociation']){switch(_0x294446){case'VoiceQueues':case _0x2895('0xc'):case _0x2895('0xd'):case _0x2895('0xe'):case'MailQueues':case _0x2895('0xf'):case _0x2895('0x10'):return db[_0x4952fa]['findAll'](queryQueues);case _0x2895('0x11'):return db[_0x4952fa][_0x2895('0x12')](queryTelephones);case'Trunks':return db[_0x4952fa]['findAll'](queryTrunks);case _0x2895('0x13'):return db[_0x4952fa][_0x2895('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2895('0x12')]({'attributes':[_0x2895('0x14')],'where':{'sectionId':_0x5af454['id']},'raw':!![]})[_0x2895('0xb')](function(_0x1ae013){if(_0x1ae013){var _0x1d3659={'where':{'id':_[_0x2895('0x15')](_0x1ae013,_0x2895('0x14'))},'raw':!![]};switch(_0x4952fa){case _0x2895('0x5'):_0x1d3659[_0x2895('0x16')][_0x2895('0x6')]=_0x2895('0x7');break;case _0x2895('0x17'):_0x1d3659[_0x2895('0x16')][_0x2895('0x8')]=_0x2895('0x9');break;}return db[_0x4952fa][_0x2895('0x12')](_0x1d3659);}else{return[];}});}}else{return[];}})[_0x2895('0xb')](function(_0x1e8d47){return _0x1e8d47;});}function joinOrLeaveQueues(_0x5a8eab,_0x4b3ba0,_0x493851,_0x442cfa){_0x5a8eab[_0x4b3ba0](util[_0x2895('0x18')](_0x2895('0x19'),_0x493851,_0x442cfa['name']));if(_0x442cfa[_0x2895('0x1a')]){for(var _0x190b79=0x0;_0x190b79<_0x442cfa[_0x2895('0x1a')][_0x2895('0x1b')];_0x190b79+=0x1){_0x5a8eab[_0x4b3ba0](util[_0x2895('0x18')]('user:%s',_0x442cfa[_0x2895('0x1a')][_0x190b79][_0x2895('0x4')]));}}}function joinOrLeave(_0x5671fa,_0x142e58,_0x384357){var _0x6f8ad4;if(_0x5671fa['handshake']['query']['id']){db[_0x2895('0x5')][_0x2895('0x1c')]({'attributes':['id',_0x2895('0x4'),'role',_0x2895('0x1d')],'where':{'id':_0x5671fa[_0x2895('0x1e')]['query']['id']},'include':[{'model':db[_0x2895('0x1f')],'as':_0x2895('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x22')],'as':_0x2895('0x23'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2895('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2895('0x25')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x2895('0xb')](function(_0x381538){if(_0x381538){_0x6f8ad4=_0x381538;_0x5671fa[_0x142e58](util['format']('user:%s',_0x381538[_0x2895('0x4')]));var _0x30dc2f=[];switch(_0x381538[_0x2895('0x6')]){case _0x2895('0x26'):_0x5671fa[_0x142e58](_0x2895('0x27'));_0x5671fa[_0x142e58](_0x2895('0x28'));if(queryQueues[_0x2895('0x29')]('include')){delete queryQueues[_0x2895('0x2a')];}_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2c')]['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2d')][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['FaxQueue'][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2e')][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['MailQueue']['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x2f')]['findAll'](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['WhatsappQueue'][_0x2895('0x12')](queryQueues));_0x30dc2f[_0x2895('0x2b')](db['User'][_0x2895('0x12')](queryTelephones));_0x30dc2f['push'](db[_0x2895('0x30')]['findAll'](queryTrunks));_0x30dc2f['push'](db[_0x2895('0x17')][_0x2895('0x12')](queryCampaigns));_0x30dc2f[_0x2895('0x2b')](db['User'][_0x2895('0x12')](queryAgents));break;case _0x2895('0x31'):_0x5671fa[_0x142e58](_0x2895('0x27'));_0x5671fa[_0x142e58](_0x2895('0x28'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x32'),_0x381538[_0x2895('0x1d')],_0x2895('0x2c')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xc'),_0x381538['userProfileId'],_0x2895('0x2d')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xd'),_0x381538[_0x2895('0x1d')],_0x2895('0x33')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xe'),_0x381538['userProfileId'],'SmsQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x34'),_0x381538[_0x2895('0x1d')],_0x2895('0x35')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0xf'),_0x381538['userProfileId'],'OpenchannelQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x10'),_0x381538['userProfileId'],'WhatsappQueue'));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x11'),_0x381538[_0x2895('0x1d')],_0x2895('0x5')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x36'),_0x381538['userProfileId'],_0x2895('0x30')));_0x30dc2f[_0x2895('0x2b')](getAssociatedResources(_0x2895('0x13'),_0x381538[_0x2895('0x1d')],'Campaign'));_0x30dc2f[_0x2895('0x2b')](db[_0x2895('0x5')][_0x2895('0x12')](queryAgents));break;case _0x2895('0x37'):_0x5671fa[_0x142e58]('voice:inbound');_0x5671fa[_0x142e58]('voice:outbound');_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x38')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x39')]({'attributes':['id','name']}));_0x30dc2f['push'](_0x381538[_0x2895('0x3a')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3b')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3c')]({'attributes':['id','name']}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3d')]({'attributes':['id',_0x2895('0x4')]}));_0x30dc2f[_0x2895('0x2b')](_0x381538[_0x2895('0x3e')]({'attributes':['id',_0x2895('0x4')]}));break;}return BPromise[_0x2895('0x3f')](_0x30dc2f);}})[_0x2895('0xb')](function(_0x549059){if(_0x549059&&_0x549059[_0x2895('0x1b')]){for(var _0x13ca9c=0x0;_0x13ca9c<_0x549059[_0x2895('0x1b')];_0x13ca9c+=0x1){for(var _0x4cdabd=0x0;_0x4cdabd<_0x549059[_0x13ca9c][_0x2895('0x1b')];_0x4cdabd+=0x1){switch(_0x13ca9c){case 0x0:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x40'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x1:joinOrLeaveQueues(_0x5671fa,_0x142e58,'chat',_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x2:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x41'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x3:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x42'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x4:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x43'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x5:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x44'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x6:joinOrLeaveQueues(_0x5671fa,_0x142e58,_0x2895('0x45'),_0x549059[_0x13ca9c][_0x4cdabd]);break;case 0x7:if(_0x6f8ad4[_0x2895('0x6')]!==_0x2895('0x37'))_0x5671fa[_0x142e58](util['format'](_0x2895('0x46'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0x8:if(_0x6f8ad4['role']!=='agent')_0x5671fa[_0x142e58](util['format'](_0x2895('0x47'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0x9:if(_0x6f8ad4[_0x2895('0x6')]!==_0x2895('0x37'))_0x5671fa[_0x142e58](util[_0x2895('0x18')](_0x2895('0x48'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x8')],_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;case 0xa:_0x5671fa[_0x142e58](util[_0x2895('0x18')](_0x2895('0x49'),_0x549059[_0x13ca9c][_0x4cdabd][_0x2895('0x4')]));break;}}}}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1481f5=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x20')],'id');return _0x6f8ad4[_0x2895('0x4b')](_0x1481f5)[_0x2895('0xb')](function(){for(var _0xbcf98=0x0;_0xbcf98<_0x1481f5[_0x2895('0x1b')];_0xbcf98+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x4d'),{'ChatInteractionId':Number(_0x1481f5[_0xbcf98]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1128a1=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x4e')],'id');return _0x6f8ad4[_0x2895('0x4f')](_0x1128a1)[_0x2895('0xb')](function(){for(var _0x4128f1=0x0;_0x4128f1<_0x1128a1[_0x2895('0x1b')];_0x4128f1+=0x1){_0x384357['emit'](_0x2895('0x50'),{'MailInteractionId':Number(_0x1128a1[_0x4128f1]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x2a34f1=_[_0x2895('0x15')](_0x6f8ad4[_0x2895('0x23')],'id');return _0x6f8ad4['removeFaxInteractions'](_0x2a34f1)[_0x2895('0xb')](function(){for(var _0x5579b3=0x0;_0x5579b3<_0x2a34f1[_0x2895('0x1b')];_0x5579b3+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x51'),{'FaxInteractionId':Number(_0x2a34f1[_0x5579b3]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0xb')](function(){if(_0x142e58===_0x2895('0x4a')){var _0x56a2c0=_['map'](_0x6f8ad4[_0x2895('0x24')],'id');return _0x6f8ad4[_0x2895('0x52')](_0x56a2c0)[_0x2895('0xb')](function(){for(var _0x5c76aa=0x0;_0x5c76aa<_0x56a2c0[_0x2895('0x1b')];_0x5c76aa+=0x1){_0x384357['emit'](_0x2895('0x53'),{'SmsInteractionId':Number(_0x56a2c0[_0x5c76aa]),'UserId':Number(_0x6f8ad4['id'])});}});}})['then'](function(){if(_0x142e58==='leave'){var _0x49c4fd=_['map'](_0x6f8ad4[_0x2895('0x54')],'id');return _0x6f8ad4[_0x2895('0x55')](_0x49c4fd)[_0x2895('0xb')](function(){for(var _0x4336c=0x0;_0x4336c<_0x49c4fd[_0x2895('0x1b')];_0x4336c+=0x1){_0x384357[_0x2895('0x4c')](_0x2895('0x56'),{'OpenchannelInteractionId':Number(_0x49c4fd[_0x4336c]),'UserId':Number(_0x6f8ad4['id'])});}});}})['then'](function(){if(_0x142e58===_0x2895('0x4a')){var _0x1e777d=_['map'](_0x6f8ad4[_0x2895('0x57')],'id');return _0x6f8ad4['removeWhatsappInteractions'](_0x1e777d)['then'](function(){for(var _0x2a9194=0x0;_0x2a9194<_0x1e777d[_0x2895('0x1b')];_0x2a9194+=0x1){_0x384357['emit'](_0x2895('0x58'),{'WhatsappInteractionId':Number(_0x1e777d[_0x2a9194]),'UserId':Number(_0x6f8ad4['id'])});}});}})[_0x2895('0x59')](function(_0x35d979){_0x5671fa[_0x2895('0x5a')](_0x35d979);});}}function onDisconnect(_0x52616a,_0x2d3f5b){joinOrLeave(_0x52616a,'leave',_0x2d3f5b);}function onConnect(_0x409e2b){joinOrLeave(_0x409e2b,'join');}exports['default']=function(_0x1af031){_0x1af031['on']('connection',function(_0x3d86dd){_0x3d86dd[_0x2895('0x5b')](0x0);_0x3d86dd[_0x2895('0x5c')]=_0x3d86dd['request'][_0x2895('0x5d')][_0x2895('0x5e')]+':'+_0x3d86dd['request']['connection'][_0x2895('0x5f')];_0x3d86dd[_0x2895('0x60')]=new Date();_0x3d86dd['log']=function(_0x31505c){console['log']('SocketIO\x20'+_0x3d86dd[_0x2895('0x61')][_0x2895('0x4')]+'['+_0x3d86dd[_0x2895('0x5c')]+']',_0x31505c);};_0x3d86dd['on']('disconnect',function(){onDisconnect(_0x3d86dd,_0x1af031);_0x3d86dd[_0x2895('0x5a')](_0x2895('0x62'));});onConnect(_0x3d86dd);_0x3d86dd[_0x2895('0x5a')](_0x2895('0x63'));});}; \ No newline at end of file +var _0xb90a=['CONNECTED','lodash','util','../mysqldb','role','agent','name','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','voice:outbound','FaxQueue','MailQueues','getVoiceQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','sms','telephone:%s','trunk:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','address','remoteAddress','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED'];(function(_0x50f4e1,_0x487c31){var _0x464661=function(_0x1ef8b6){while(--_0x1ef8b6){_0x50f4e1['push'](_0x50f4e1['shift']());}};_0x464661(++_0x487c31);}(_0xb90a,0x12a));var _0xab90=function(_0x483a6f,_0x5c11bd){_0x483a6f=_0x483a6f-0x0;var _0x1fc2df=_0xb90a[_0x483a6f];return _0x1fc2df;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var BPromise=require('bluebird');var db=require(_0xab90('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0xab90('0x3')],'raw':!![],'where':{'role':_0xab90('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xab90('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xab90('0x5')],'where':{'role':_0xab90('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xab90('0x6')],'where':{'type':_0xab90('0x7')}};function getAssociatedResources(_0x3a0f26,_0x1e7b79,_0x93af2f){return db[_0xab90('0x8')][_0xab90('0x9')]({'where':{'name':_0x3a0f26,'userProfileId':_0x1e7b79},'raw':!![]})[_0xab90('0xa')](function(_0x4b90b0){if(_0x4b90b0){if(_0x4b90b0[_0xab90('0xb')]){switch(_0x3a0f26){case _0xab90('0xc'):case _0xab90('0xd'):case _0xab90('0xe'):case _0xab90('0xf'):case'MailQueues':case _0xab90('0x10'):case _0xab90('0x11'):return db[_0x93af2f][_0xab90('0x12')](queryQueues);case _0xab90('0x13'):return db[_0x93af2f][_0xab90('0x12')](queryTelephones);case _0xab90('0x14'):return db[_0x93af2f][_0xab90('0x12')](queryTrunks);case _0xab90('0x15'):return db[_0x93af2f][_0xab90('0x12')](queryCampaigns);}}else{return db[_0xab90('0x16')][_0xab90('0x12')]({'attributes':[_0xab90('0x17')],'where':{'sectionId':_0x4b90b0['id']},'raw':!![]})[_0xab90('0xa')](function(_0x556828){if(_0x556828){var _0x282723={'where':{'id':_['map'](_0x556828,_0xab90('0x17'))},'raw':!![]};switch(_0x93af2f){case _0xab90('0x18'):_0x282723['where'][_0xab90('0x3')]=_0xab90('0x19');break;case _0xab90('0x1a'):_0x282723['where'][_0xab90('0x6')]=_0xab90('0x7');break;}return db[_0x93af2f][_0xab90('0x12')](_0x282723);}else{return[];}});}}else{return[];}})[_0xab90('0xa')](function(_0x4fd042){return _0x4fd042;});}function joinOrLeaveQueues(_0x2f6904,_0x5d7c8e,_0x30d6b3,_0x5d5dda){_0x2f6904[_0x5d7c8e](util[_0xab90('0x1b')](_0xab90('0x1c'),_0x30d6b3,_0x5d5dda[_0xab90('0x5')]));if(_0x5d5dda[_0xab90('0x1d')]){for(var _0x5d5c1c=0x0;_0x5d5c1c<_0x5d5dda[_0xab90('0x1d')][_0xab90('0x1e')];_0x5d5c1c+=0x1){_0x2f6904[_0x5d7c8e](util[_0xab90('0x1b')](_0xab90('0x1f'),_0x5d5dda[_0xab90('0x1d')][_0x5d5c1c][_0xab90('0x5')]));}}}function joinOrLeave(_0x281e45,_0x210b5e,_0x84eb68){var _0x2cdc7f;if(_0x281e45[_0xab90('0x20')][_0xab90('0x21')]['id']){db[_0xab90('0x18')][_0xab90('0x22')]({'attributes':['id','name',_0xab90('0x3'),_0xab90('0x23')],'where':{'id':_0x281e45[_0xab90('0x20')][_0xab90('0x21')]['id']},'include':[{'model':db[_0xab90('0x24')],'as':_0xab90('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xab90('0x26')],'as':_0xab90('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xab90('0x28')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xab90('0x29')],'as':_0xab90('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xab90('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xab90('0x2c')],'as':_0xab90('0x2d'),'attributes':['id'],'raw':!![]}]})[_0xab90('0xa')](function(_0x24e562){if(_0x24e562){_0x2cdc7f=_0x24e562;_0x281e45[_0x210b5e](util[_0xab90('0x1b')](_0xab90('0x1f'),_0x24e562[_0xab90('0x5')]));var _0xe23096=[];switch(_0x24e562[_0xab90('0x3')]){case'admin':_0x281e45[_0x210b5e]('voice:inbound');_0x281e45[_0x210b5e]('voice:outbound');if(queryQueues[_0xab90('0x2e')]('include')){delete queryQueues[_0xab90('0x2f')];}_0xe23096[_0xab90('0x30')](db[_0xab90('0x31')][_0xab90('0x12')](queryQueues));_0xe23096['push'](db[_0xab90('0x32')][_0xab90('0x12')](queryQueues));_0xe23096[_0xab90('0x30')](db['FaxQueue']['findAll'](queryQueues));_0xe23096[_0xab90('0x30')](db[_0xab90('0x33')][_0xab90('0x12')](queryQueues));_0xe23096[_0xab90('0x30')](db[_0xab90('0x34')][_0xab90('0x12')](queryQueues));_0xe23096[_0xab90('0x30')](db[_0xab90('0x35')][_0xab90('0x12')](queryQueues));_0xe23096[_0xab90('0x30')](db[_0xab90('0x36')]['findAll'](queryQueues));_0xe23096[_0xab90('0x30')](db[_0xab90('0x18')][_0xab90('0x12')](queryTelephones));_0xe23096[_0xab90('0x30')](db[_0xab90('0x37')]['findAll'](queryTrunks));_0xe23096[_0xab90('0x30')](db[_0xab90('0x1a')][_0xab90('0x12')](queryCampaigns));_0xe23096['push'](db[_0xab90('0x18')][_0xab90('0x12')](queryAgents));break;case _0xab90('0x38'):_0x281e45[_0x210b5e](_0xab90('0x39'));_0x281e45[_0x210b5e](_0xab90('0x3a'));_0xe23096[_0xab90('0x30')](getAssociatedResources('VoiceQueues',_0x24e562[_0xab90('0x23')],'VoiceQueue'));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0xd'),_0x24e562['userProfileId'],_0xab90('0x32')));_0xe23096['push'](getAssociatedResources(_0xab90('0xe'),_0x24e562[_0xab90('0x23')],_0xab90('0x3b')));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0xf'),_0x24e562['userProfileId'],_0xab90('0x33')));_0xe23096['push'](getAssociatedResources(_0xab90('0x3c'),_0x24e562[_0xab90('0x23')],'MailQueue'));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0x10'),_0x24e562[_0xab90('0x23')],'OpenchannelQueue'));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0x11'),_0x24e562['userProfileId'],'WhatsappQueue'));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0x13'),_0x24e562[_0xab90('0x23')],_0xab90('0x18')));_0xe23096[_0xab90('0x30')](getAssociatedResources(_0xab90('0x14'),_0x24e562[_0xab90('0x23')],'Trunk'));_0xe23096[_0xab90('0x30')](getAssociatedResources('IvrCampaigns',_0x24e562[_0xab90('0x23')],'Campaign'));_0xe23096[_0xab90('0x30')](db[_0xab90('0x18')][_0xab90('0x12')](queryAgents));break;case _0xab90('0x4'):_0x281e45[_0x210b5e](_0xab90('0x39'));_0x281e45[_0x210b5e](_0xab90('0x3a'));_0xe23096[_0xab90('0x30')](_0x24e562[_0xab90('0x3d')]({'attributes':['id','name']}));_0xe23096['push'](_0x24e562['getChatQueues']({'attributes':['id','name']}));_0xe23096[_0xab90('0x30')](_0x24e562['getFaxQueues']({'attributes':['id',_0xab90('0x5')]}));_0xe23096[_0xab90('0x30')](_0x24e562[_0xab90('0x3e')]({'attributes':['id',_0xab90('0x5')]}));_0xe23096[_0xab90('0x30')](_0x24e562['getMailQueues']({'attributes':['id',_0xab90('0x5')]}));_0xe23096['push'](_0x24e562[_0xab90('0x3f')]({'attributes':['id',_0xab90('0x5')]}));_0xe23096['push'](_0x24e562[_0xab90('0x40')]({'attributes':['id',_0xab90('0x5')]}));break;}return BPromise[_0xab90('0x41')](_0xe23096);}})[_0xab90('0xa')](function(_0x22aa04){if(_0x22aa04&&_0x22aa04[_0xab90('0x1e')]){for(var _0x4d534b=0x0;_0x4d534b<_0x22aa04[_0xab90('0x1e')];_0x4d534b+=0x1){for(var _0x55e1e1=0x0;_0x55e1e1<_0x22aa04[_0x4d534b][_0xab90('0x1e')];_0x55e1e1+=0x1){switch(_0x4d534b){case 0x0:joinOrLeaveQueues(_0x281e45,_0x210b5e,'voice',_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x1:joinOrLeaveQueues(_0x281e45,_0x210b5e,_0xab90('0x42'),_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x2:joinOrLeaveQueues(_0x281e45,_0x210b5e,'fax',_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x3:joinOrLeaveQueues(_0x281e45,_0x210b5e,_0xab90('0x43'),_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x4:joinOrLeaveQueues(_0x281e45,_0x210b5e,'mail',_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x5:joinOrLeaveQueues(_0x281e45,_0x210b5e,'openchannel',_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x6:joinOrLeaveQueues(_0x281e45,_0x210b5e,'whatsapp',_0x22aa04[_0x4d534b][_0x55e1e1]);break;case 0x7:if(_0x2cdc7f[_0xab90('0x3')]!==_0xab90('0x4'))_0x281e45[_0x210b5e](util[_0xab90('0x1b')](_0xab90('0x44'),_0x22aa04[_0x4d534b][_0x55e1e1][_0xab90('0x5')]));break;case 0x8:if(_0x2cdc7f[_0xab90('0x3')]!==_0xab90('0x4'))_0x281e45[_0x210b5e](util[_0xab90('0x1b')](_0xab90('0x45'),_0x22aa04[_0x4d534b][_0x55e1e1]['name']));break;case 0x9:if(_0x2cdc7f[_0xab90('0x3')]!==_0xab90('0x4'))_0x281e45[_0x210b5e](util[_0xab90('0x1b')]('campaign:%s:%s',_0x22aa04[_0x4d534b][_0x55e1e1]['type'],_0x22aa04[_0x4d534b][_0x55e1e1][_0xab90('0x5')]));break;case 0xa:_0x281e45[_0x210b5e](util[_0xab90('0x1b')](_0xab90('0x1f'),_0x22aa04[_0x4d534b][_0x55e1e1]['name']));break;}}}}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x290ea3=_[_0xab90('0x47')](_0x2cdc7f[_0xab90('0x25')],'id');return _0x2cdc7f[_0xab90('0x48')](_0x290ea3)[_0xab90('0xa')](function(){for(var _0x505cb0=0x0;_0x505cb0<_0x290ea3[_0xab90('0x1e')];_0x505cb0+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x4a'),{'ChatInteractionId':Number(_0x290ea3[_0x505cb0]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x4d2ced=_[_0xab90('0x47')](_0x2cdc7f[_0xab90('0x27')],'id');return _0x2cdc7f[_0xab90('0x4b')](_0x4d2ced)[_0xab90('0xa')](function(){for(var _0x2cc9c0=0x0;_0x2cc9c0<_0x4d2ced[_0xab90('0x1e')];_0x2cc9c0+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x4c'),{'MailInteractionId':Number(_0x4d2ced[_0x2cc9c0]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x489c71=_[_0xab90('0x47')](_0x2cdc7f[_0xab90('0x4d')],'id');return _0x2cdc7f[_0xab90('0x4e')](_0x489c71)['then'](function(){for(var _0x392eca=0x0;_0x392eca<_0x489c71[_0xab90('0x1e')];_0x392eca+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x4f'),{'FaxInteractionId':Number(_0x489c71[_0x392eca]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x4e4341=_[_0xab90('0x47')](_0x2cdc7f[_0xab90('0x2a')],'id');return _0x2cdc7f[_0xab90('0x50')](_0x4e4341)[_0xab90('0xa')](function(){for(var _0x3f4b11=0x0;_0x3f4b11<_0x4e4341[_0xab90('0x1e')];_0x3f4b11+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x51'),{'SmsInteractionId':Number(_0x4e4341[_0x3f4b11]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x6b6d33=_[_0xab90('0x47')](_0x2cdc7f[_0xab90('0x2b')],'id');return _0x2cdc7f[_0xab90('0x52')](_0x6b6d33)[_0xab90('0xa')](function(){for(var _0x21436e=0x0;_0x21436e<_0x6b6d33[_0xab90('0x1e')];_0x21436e+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x53'),{'OpenchannelInteractionId':Number(_0x6b6d33[_0x21436e]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0xa')](function(){if(_0x210b5e===_0xab90('0x46')){var _0x3e605c=_['map'](_0x2cdc7f[_0xab90('0x2d')],'id');return _0x2cdc7f['removeWhatsappInteractions'](_0x3e605c)[_0xab90('0xa')](function(){for(var _0x1465e8=0x0;_0x1465e8<_0x3e605c['length'];_0x1465e8+=0x1){_0x84eb68[_0xab90('0x49')](_0xab90('0x54'),{'WhatsappInteractionId':Number(_0x3e605c[_0x1465e8]),'UserId':Number(_0x2cdc7f['id'])});}});}})[_0xab90('0x55')](function(_0x44922a){_0x281e45[_0xab90('0x56')](_0x44922a);});}}function onDisconnect(_0x53c7fb,_0x441aab){joinOrLeave(_0x53c7fb,_0xab90('0x46'),_0x441aab);}function onConnect(_0x2314e6){joinOrLeave(_0x2314e6,_0xab90('0x57'));}exports['default']=function(_0xa72420){_0xa72420['on'](_0xab90('0x58'),function(_0x7f275b){_0x7f275b[_0xab90('0x59')](0x0);_0x7f275b[_0xab90('0x5a')]=_0x7f275b['request'][_0xab90('0x58')][_0xab90('0x5b')]+':'+_0x7f275b[_0xab90('0x5c')]['connection'][_0xab90('0x5d')];_0x7f275b['connectedAt']=new Date();_0x7f275b[_0xab90('0x56')]=function(_0x332ea2){console[_0xab90('0x56')](_0xab90('0x5e')+_0x7f275b[_0xab90('0x5f')][_0xab90('0x5')]+'['+_0x7f275b[_0xab90('0x5a')]+']',_0x332ea2);};_0x7f275b['on'](_0xab90('0x60'),function(){onDisconnect(_0x7f275b,_0xa72420);_0x7f275b[_0xab90('0x56')](_0xab90('0x61'));});onConnect(_0x7f275b);_0x7f275b[_0xab90('0x56')](_0xab90('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 6627d6c..1230493 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 _0x221e=['name','agent','incomingmessage','AfterCreateMessage','opened','query','AfterCreate','closed','changed','substatus','AfterUpdate','find','fullname','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','../logger','triggers','client','http','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','closedinteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','then','contact','UserId','interface','format','SIP/%s'];(function(_0x12f8cc,_0x41df0d){var _0x38dc94=function(_0x1aac44){while(--_0x1aac44){_0x12f8cc['push'](_0x12f8cc['shift']());}};_0x38dc94(++_0x41df0d);}(_0x221e,0x142));var _0xe221=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x221e[_0x2e4e19];return _0x9ba20b;};'use strict';var util=require(_0xe221('0x0'));var db=require(_0xe221('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xe221('0x2'))(_0xe221('0x3'));var client=jayson[_0xe221('0x4')][_0xe221('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0xe221('0x6'),'condition':_0xe221('0x7'),'callback':afterCreate},{'channel':_0xe221('0x8'),'model':'ChatInteraction','event':_0xe221('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0xe221('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xe221('0x8'),'model':'ChatOfflineMessage','event':_0xe221('0x6'),'condition':_0xe221('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xe221('0xc'),'model':_0xe221('0xd'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0xe221('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xe221('0xc'),'model':'SmsMessage','event':_0xe221('0x6'),'condition':_0xe221('0xb'),'callback':afterCreateMessage},{'channel':_0xe221('0xe'),'model':_0xe221('0xf'),'event':'afterCreate','condition':_0xe221('0x7'),'callback':afterCreate},{'channel':_0xe221('0xe'),'model':_0xe221('0xf'),'event':_0xe221('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xe221('0xe'),'model':_0xe221('0x10'),'event':'afterCreate','condition':_0xe221('0xb'),'callback':afterCreateMessage},{'channel':_0xe221('0x11'),'model':'FaxInteraction','event':_0xe221('0x6'),'condition':_0xe221('0x7'),'callback':afterCreate},{'channel':'Fax','model':_0xe221('0x12'),'event':_0xe221('0x9'),'condition':_0xe221('0x13'),'callback':afterUpdate},{'channel':'Fax','model':_0xe221('0x14'),'event':_0xe221('0x6'),'condition':_0xe221('0xb'),'callback':afterCreateMessage},{'channel':_0xe221('0x15'),'model':_0xe221('0x16'),'event':_0xe221('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xe221('0x15'),'model':_0xe221('0x16'),'event':_0xe221('0x9'),'condition':_0xe221('0x13'),'callback':afterUpdate},{'channel':_0xe221('0x15'),'model':_0xe221('0x17'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xe221('0x6'),'condition':_0xe221('0x7'),'callback':afterCreate},{'channel':_0xe221('0x18'),'model':_0xe221('0x19'),'event':_0xe221('0x9'),'condition':_0xe221('0x13'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xe221('0x1a'),'event':_0xe221('0x6'),'condition':_0xe221('0xb'),'callback':afterCreateMessage}];function request(_0x556a6a){return client[_0xe221('0x1b')](_0xe221('0x1c'),_0x556a6a)['then'](function(_0x3622d4){logger[_0xe221('0x1d')](_0xe221('0x1e'),_0xe221('0x1c'),_0x3622d4);if(_0x3622d4[_0xe221('0x1f')]){if(_0x3622d4[_0xe221('0x1f')][_0xe221('0x20')]===0x1f4){logger['error'](_0xe221('0x1e'),_0xe221('0x1c'),_0x3622d4['error']);}}})[_0xe221('0x21')](function(_0x5200f4){logger['error'](_0xe221('0x1e'),'EventManager',_0x5200f4);});}function afterCreateMessage(_0x84b1ad){return function(_0x1ac52d){_0x1ac52d=_0x1ac52d[_0xe221('0x22')]({'plain':!![]});_0x1ac52d[_0xe221('0x23')]=_0x84b1ad;_0x1ac52d[_0xe221('0x24')]=_0x84b1ad;_0x1ac52d[_0xe221('0x25')]=_0x1ac52d[_0xe221('0x26')];Promise[_0xe221('0x27')]()['then'](function(){if(typeof _0x1ac52d[_0xe221('0x28')]===_0xe221('0x29'))return null;var _0x35a07c=_0xe221('0x2a')+_0x1ac52d[_0xe221('0x28')];return db[_0xe221('0x2b')]['query'](_0x35a07c,{'type':db[_0xe221('0x2c')][_0xe221('0x2d')][_0xe221('0x2e')],'raw':!![]});})[_0xe221('0x2f')](function(_0x448de2){if(_0x448de2){_0x1ac52d[_0xe221('0x30')]=_0x448de2[0x0];}if(typeof _0x1ac52d['UserId']===_0xe221('0x29'))return;return getAgent(_0x1ac52d[_0xe221('0x31')]);})['then'](function(_0x3644d0){if(_0x3644d0){_0x1ac52d[_0xe221('0x32')]=util[_0xe221('0x33')](_0xe221('0x34'),_0x3644d0[_0xe221('0x35')]);_0x1ac52d[_0xe221('0x36')]=_0x3644d0;_0x1ac52d['channel']=_0x84b1ad;return request({'event':_0xe221('0x37'),'message':_0x1ac52d});}else{return request({'event':'outgoingmessage','message':_0x1ac52d});}})[_0xe221('0x21')](function(_0x34fba9){logger['error'](_0xe221('0x1e'),_0xe221('0x38'),_0x34fba9);});};}function afterCreateOfflineMessage(_0x37a950){return function(_0x5f1f2f){_0x5f1f2f=_0x5f1f2f[_0xe221('0x22')]({'plain':!![]});_0x5f1f2f[_0xe221('0x23')]=_0x37a950;_0x5f1f2f[_0xe221('0x24')]=_0x37a950;_0x5f1f2f['event']='offlineMessage';return request({'event':_0x5f1f2f['event'],'message':_0x5f1f2f});};}function afterCreate(_0x3e651a,_0x2f72ba){return function(_0x2b0de1){_0x2b0de1=_0x2b0de1[_0xe221('0x22')]({'plain':!![]});_0x2b0de1[_0xe221('0x23')]=_0x3e651a;_0x2b0de1['motionChannel']=_0x3e651a;_0x2b0de1[_0xe221('0x25')]=_0xe221('0x39');Promise['resolve']()['then'](function(){var _0x527cce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b0de1[_0xe221('0x28')];return db[_0xe221('0x2b')][_0xe221('0x3a')](_0x527cce,{'type':db[_0xe221('0x2c')][_0xe221('0x2d')][_0xe221('0x2e')],'raw':!![]});})['then'](function(_0x38b3d8){if(_0x38b3d8){_0x2b0de1[_0xe221('0x30')]=_0x38b3d8[0x0];}if(typeof _0x2b0de1[_0xe221('0x31')]===_0xe221('0x29'))return;return getAgent(_0x2b0de1[_0xe221('0x31')]);})[_0xe221('0x2f')](function(_0x1e0dc6){if(_0x1e0dc6){_0x2b0de1[_0xe221('0x32')]=util[_0xe221('0x33')](_0xe221('0x34'),_0x1e0dc6[_0xe221('0x35')]);_0x2b0de1[_0xe221('0x36')]=_0x1e0dc6;}return request({'event':_0x2f72ba,'message':_0x2b0de1});})[_0xe221('0x21')](function(_0x2e6281){logger[_0xe221('0x1f')](_0xe221('0x1e'),_0xe221('0x3b'),_0x2e6281);});};}function afterUpdate(_0x44404d){return function(_0x519669){var _0x17bebc=_0x519669['changed'](_0xe221('0x3c'))&&_0x519669['closed'];var _0x27a4bf=_0x519669[_0xe221('0x3d')](_0xe221('0x3e'));if(_0x17bebc||_0x27a4bf){var _0x58f0a3=_0x17bebc?_0xe221('0x13'):_0xe221('0x3e');var _0x2cbb97=_0x519669[_0xe221('0x22')]({'plain':!![]});_0x2cbb97[_0xe221('0x23')]=_0x44404d;_0x2cbb97[_0xe221('0x24')]=_0x44404d;_0x2cbb97[_0xe221('0x25')]=_0x17bebc?_0xe221('0x3c'):'substatus';var _0x9357b=_0xe221('0x2a')+_0x2cbb97[_0xe221('0x28')];return db[_0xe221('0x2b')][_0xe221('0x3a')](_0x9357b,{'type':db['Sequelize'][_0xe221('0x2d')][_0xe221('0x2e')],'raw':!![]})['then'](function(_0x3635bf){if(_0x3635bf){_0x2cbb97['contact']=_0x3635bf[0x0];}if(typeof _0x2cbb97[_0xe221('0x31')]===_0xe221('0x29'))return;return getAgent(_0x2cbb97['UserId']);})[_0xe221('0x2f')](function(_0x4ed6a2){if(_0x4ed6a2){_0x2cbb97['interface']=util[_0xe221('0x33')](_0xe221('0x34'),_0x4ed6a2[_0xe221('0x35')]);_0x2cbb97[_0xe221('0x36')]=_0x4ed6a2;}return request({'event':_0x58f0a3,'message':_0x2cbb97});})[_0xe221('0x21')](function(_0x5c8226){logger[_0xe221('0x1f')]('Trigger,\x20%s',_0xe221('0x3f'),_0x5c8226);});}};}function getAgent(_0x3ae30c){return db['User'][_0xe221('0x40')]({'where':{'id':_0x3ae30c},'attributes':['id',_0xe221('0x35'),_0xe221('0x41'),'email',_0xe221('0x42')],'raw':!![]})[_0xe221('0x2f')](function(_0x18d10f){return _0x18d10f;});}exports[_0xe221('0x43')]=function(){for(var _0x527c50=0x0;_0x527c50=_0x116ebb[_0x52a8('0x13')]){throw Error(_0x52a8('0x14'));}_0x72c8ba(_0x266b22);})[_0x52a8('0x15')](function(_0x5527ac){_0x18a722(_0x5527ac);});});}; \ No newline at end of file +var _0x57f9=['agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','mail','chat','fax','sms','whatsapp','openchannel','clearBlockUser','isUndefined','blockedAt','getLicense','role'];(function(_0x472289,_0xb701aa){var _0x563aa5=function(_0x561ee6){while(--_0x561ee6){_0x472289['push'](_0x472289['shift']());}};_0x563aa5(++_0xb701aa);}(_0x57f9,0x83));var _0x957f=function(_0x2892aa,_0x3a3d7a){_0x2892aa=_0x2892aa-0x0;var _0x581fa9=_0x57f9[_0x2892aa];return _0x581fa9;};'use strict';var _=require(_0x957f('0x0'));var BPromise=require(_0x957f('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice',_0x957f('0x2'),_0x957f('0x3'),_0x957f('0x4'),_0x957f('0x5'),_0x957f('0x6'),_0x957f('0x7')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x47379c){_0x47379c=_0x47379c['toLowerCase']();return _['includes'](channels,_0x47379c);};exports[_0x957f('0x8')]=function(_0xb75566,_0x21ec00,_0x2de998,_0x1c555b){var _0x378c83={'loginAttempts':_0x21ec00,'blocked':_0x2de998};if(!_[_0x957f('0x9')](_0x1c555b)){_0x378c83[_0x957f('0xa')]=_0x1c555b;}return _0xb75566['updateAttributes'](_0x378c83);};exports[_0x957f('0xb')]=function(_0x127fa3){return new BPromise(function(_0x5e76d9,_0x34ff1b){var _0x111490=0x0;if(_0x127fa3[_0x957f('0xc')]!==_0x957f('0xd')){_0x5e76d9(_0x127fa3);}db[_0x957f('0xe')]['count']({'where':{'role':_0x957f('0xd'),'online':!![],'id':{'$ne':_0x127fa3['id']}}})[_0x957f('0xf')](function(_0x287b4e){_0x111490=_0x287b4e;return util['getLicense']();})[_0x957f('0xf')](function(_0x3acc7e){if(_0x3acc7e&&_0x3acc7e[_0x957f('0x10')]&&_0x111490>=_0x3acc7e[_0x957f('0x10')]){throw Error(_0x957f('0x11'));}_0x5e76d9(_0x127fa3);})['catch'](function(_0x27680f){_0x34ff1b(_0x27680f);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index f871926..e1201c1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ba7=['render','json','exports','404','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ba7,0x1b5));var _0x75ba=function(_0x4f8950,_0x2455a8){_0x4f8950=_0x4f8950-0x0;var _0x1b4bdf=_0x5ba7[_0x4f8950];return _0x1b4bdf;};'use strict';module[_0x75ba('0x0')][0x194]=function pageNotFound(_0x44e66c,_0x113d08){var _0x15779e=_0x75ba('0x1');var _0x112c41=0x194;var _0x4648e7={'status':_0x112c41};_0x113d08[_0x75ba('0x2')](_0x4648e7[_0x75ba('0x2')]);_0x113d08[_0x75ba('0x3')](_0x15779e,{},function(_0x67c4a0,_0x2d6003){if(_0x67c4a0){return _0x113d08[_0x75ba('0x2')](_0x4648e7[_0x75ba('0x2')])[_0x75ba('0x4')](_0x4648e7);}_0x113d08['send'](_0x2d6003);});}; \ No newline at end of file +var _0x0bea=['render','json','send','exports','status'];(function(_0x6b7ccd,_0x4ab05d){var _0x5764ca=function(_0x55bbd9){while(--_0x55bbd9){_0x6b7ccd['push'](_0x6b7ccd['shift']());}};_0x5764ca(++_0x4ab05d);}(_0x0bea,0xee));var _0xa0be=function(_0x455ed5,_0xab57cc){_0x455ed5=_0x455ed5-0x0;var _0x481ac4=_0x0bea[_0x455ed5];return _0x481ac4;};'use strict';module[_0xa0be('0x0')][0x194]=function pageNotFound(_0x3e06da,_0xad6a16){var _0x5a9543='404';var _0x3a555f=0x194;var _0x337c30={'status':_0x3a555f};_0xad6a16[_0xa0be('0x1')](_0x337c30['status']);_0xad6a16[_0xa0be('0x2')](_0x5a9543,{},function(_0xfccccc,_0x464493){if(_0xfccccc){return _0xad6a16[_0xa0be('0x1')](_0x337c30['status'])[_0xa0be('0x3')](_0x337c30);}_0xad6a16[_0xa0be('0x4')](_0x464493);});}; \ No newline at end of file diff --git a/server/migrations/2.5.48.js b/server/migrations/2.5.48.js new file mode 100644 index 0000000..c91f422 --- /dev/null +++ b/server/migrations/2.5.48.js @@ -0,0 +1,169 @@ +'use strict'; + +var BPromise = require('bluebird'); +var util = require('util'); + +var logger = require('../config/logger')('migration'); + +var Sequence = function() {}; + +Sequence.prototype.enqueue = function(fn) { + this.tail = this.tail ? this.tail.finally(fn) : fn(); +}; + +var Migration = function(queryInterface) { + this.queryInterface = queryInterface; + this.sequence = new Sequence(); +}; + +Migration.prototype.changeColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .changeColumn(table, column, type) + .then(function() { + logger.info('Changed column %s in table %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addColumn = function(table, column, type) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addColumn(table, column, type) + .then(function() { + logger.info('Added column %s to %s', column, table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.dropTable = function(table) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .dropTable(table, { + force: true + }) + .then(function() { + logger.info('table dropped %s', table); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.addIndex = function(table, column, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .addIndex(table, column, { + indexName: indexName + }) + .then(function() { + logger.info('addIndex %s %s %s', table, column.join(','), indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeIndex = function(table, indexName) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeIndex(table, indexName) + .then(function() { + logger.info('removeIndex %s %s', table, indexName); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.query = function(sql) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface.sequelize + .query(sql) + .then(function() { + logger.info('query %s', sql); + }) + .catch(function(err) { + logger.info(JSON.stringify(err)); + }); + }); +}; + +Migration.prototype.removeColumn = function(table, column) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .removeColumn(table, column) + .then(function() { + logger.info('Removed column %s from %s', column, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.renameColumn = function(table, oldColumn, newColumn) { + var _this = this; + this.sequence.enqueue(function() { + return _this.queryInterface + .renameColumn(table, oldColumn, newColumn) + .then(function() { + logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table); + }) + .catch(function(err) { + logger.info( + util.inspect(err, { + showHidden: false, + depth: null + }) + ); + }); + }); +}; + +Migration.prototype.final = function(resolve) { + this.sequence.enqueue(function() { + return resolve(); + }); +}; + +module.exports = { + up: function(queryInterface, Sequelize) { + return new BPromise(function(resolve) { + var migration = new Migration(queryInterface); + + // START mail_servers_out + migration.query('UPDATE mail_servers_out SET secure = 0 WHERE modernAuthentication = 1'); + // END mail_servers_out + + // START FINAL + migration.final(resolve); + // END FINAL + }); + }, + + down: function(queryInterface, Sequelize) { + // var migration = new Migration(queryInterface); + } +}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index acc8327..b3de95c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeefd=['UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','UserId','userSetting','cascade','hasMany','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','WhatsappQueues','ChatWebsites','MailAccount','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','CmHopperFinal','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','Interval','mandatoryDispositionPauseId','Lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','AgentReports','Contact','ContactId','CloudProviderId','restrict','MailAccountId','Imap','Smtp','CannedAnswer','Answers','MailMessage','Messages','List','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','MailQueue','team_has_mail_queues','MailInteractionId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','IntervalId','TagId','MailQueueReport','ListId','Items','Disposition','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxInteractionId','Account','fax_interaction_has_tags','user_has_fax_interactions','FaxQueueReport','SmsAccountId','SmsQueue','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','Users','AttachmentId','OpenchannelQueueId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Extensions','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','DefaultReportId','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskConfiguration','DeskField','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','VtigerConfiguration','ChatQueueReport','FromId','ToId','SessionId','ProjectId','team_has_fax_queues','team_has_openchannel_queues','OpenchannelQueues','team_has_whatsapp_queues','Hoppers','HopperBlacks','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromAgent','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToUserId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','password','options','username','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../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','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0xeefd,0x109));var _0xdeef=function(_0x5a3994,_0x4c2500){_0x5a3994=_0x5a3994-0x0;var _0xe9e6e2=_0xeefd[_0x5a3994];return _0xe9e6e2;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xdeef('0x0'));var _=require(_0xdeef('0x1'));var jstz=require(_0xdeef('0x2'));var timezone=jstz[_0xdeef('0x3')]();config['sequelize']=_[_0xdeef('0x4')](config['sequelize'],{'database':_0xdeef('0x5'),'username':_0xdeef('0x6'),'password':_0xdeef('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xdeef('0x8'),'dialectOptions':{'charset':_0xdeef('0x9')},'logging':![],'timezone':timezone[_0xdeef('0xa')](),'define':{'charset':_0xdeef('0xb'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xdeef('0x4')](config[_0xdeef('0xc')],{'database':_0xdeef('0x5'),'username':'xcall','password':_0xdeef('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xdeef('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xdeef('0xb'),'collate':_0xdeef('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdeef('0x0')][_0xdeef('0xe')],config[_0xdeef('0x0')]['username'],config[_0xdeef('0x0')][_0xdeef('0xf')],config['sequelize'][_0xdeef('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdeef('0xc')][_0xdeef('0xe')],config[_0xdeef('0xc')][_0xdeef('0x11')],config[_0xdeef('0xc')][_0xdeef('0xf')],config[_0xdeef('0xc')]['options'])};db['User']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/user/user.model');db[_0xdeef('0x13')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x14'));db[_0xdeef('0x15')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x16'));db[_0xdeef('0x17')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x18'));db[_0xdeef('0x19')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xdeef('0x1a')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x1b'));db[_0xdeef('0x1c')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x1d'));db[_0xdeef('0x1e')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x1f'));db[_0xdeef('0x20')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x21'));db[_0xdeef('0x22')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x23'));db['VoiceCallReport']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x24'));db[_0xdeef('0x25')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x26'));db[_0xdeef('0x27')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x28'));db[_0xdeef('0x29')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x2a'));db[_0xdeef('0x2b')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x2c'));db[_0xdeef('0x2d')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/trunk/trunk.model');db[_0xdeef('0x2e')]=db['sequelize']['import'](_0xdeef('0x2f'));db[_0xdeef('0x30')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xdeef('0x31')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x32'));db[_0xdeef('0x33')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x34'));db['UserMailQueue']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x35'));db[_0xdeef('0x36')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x37'));db['UserSmsQueue']=db[_0xdeef('0x0')]['import'](_0xdeef('0x38'));db[_0xdeef('0x39')]=db[_0xdeef('0x0')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xdeef('0x3a')]=db['sequelize'][_0xdeef('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xdeef('0x3b')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x3c'));db[_0xdeef('0x3d')]=db[_0xdeef('0x0')]['import']('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xdeef('0x0')]['import']('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/mailQueue/mailQueue.model');db[_0xdeef('0x3e')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x3f'));db[_0xdeef('0x40')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x41'));db['MailMessage']=db[_0xdeef('0x0')]['import'](_0xdeef('0x42'));db[_0xdeef('0x43')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x44'));db['MailQueueReport']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x45'));db[_0xdeef('0x46')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x47'));db[_0xdeef('0x48')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x49'));db[_0xdeef('0x4a')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/faxAccount/faxAccount.model');db[_0xdeef('0x4b')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x4c'));db['FaxInteraction']=db[_0xdeef('0x0')]['import'](_0xdeef('0x4d'));db['FaxMessage']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x4e'));db[_0xdeef('0x4f')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x50'));db['FaxQueueReport']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x51'));db[_0xdeef('0x52')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/smsAccount/smsAccount.model');db[_0xdeef('0x53')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x54'));db[_0xdeef('0x55')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x56'));db[_0xdeef('0x57')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x58'));db['SmsQueue']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x59'));db['OpenchannelAccount']=db['sequelize'][_0xdeef('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0xdeef('0x5a')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x5b'));db[_0xdeef('0x5c')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x5d'));db['OpenchannelMessage']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x5e'));db[_0xdeef('0x5f')]=db['sequelize'][_0xdeef('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0xdeef('0x60')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x61'));db[_0xdeef('0x62')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x63'));db[_0xdeef('0x64')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x65'));db[_0xdeef('0x66')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x67'));db[_0xdeef('0x68')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x69'));db['ChatOfflineMessage']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x6a'));db[_0xdeef('0x6b')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x6c'));db[_0xdeef('0x6d')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x6e'));db[_0xdeef('0x6f')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x70'));db[_0xdeef('0x71')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x72'));db[_0xdeef('0x73')]=db['sequelize'][_0xdeef('0x12')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x74'));db[_0xdeef('0x75')]=db['sequelize']['import'](_0xdeef('0x76'));db['CmHopperFinal']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xdeef('0x77')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x78'));db[_0xdeef('0x79')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x7a'));db['CmCustomField']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xdeef('0x7b')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x7c'));db[_0xdeef('0x7d')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/automation/automation.model');db['CannedAnswer']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x7e'));db['Disposition']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/disposition/disposition.model');db[_0xdeef('0x7f')]=db['sequelize']['import']('../api/condition/condition.model');db['Interval']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x80'));db[_0xdeef('0x81')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x82'));db['Cdr']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x83'));db['VoiceQueuesLog']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x84'));db[_0xdeef('0x85')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/schedule/schedule.model');db[_0xdeef('0x86')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x87'));db[_0xdeef('0x88')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/tag/tag.model');db[_0xdeef('0x89')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x8a'));db[_0xdeef('0x8b')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x8c'));db[_0xdeef('0x8d')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x8e'));db[_0xdeef('0x8f')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x90'));db['IntegrationReport']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x91'));db[_0xdeef('0x92')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x93'));db['AnalyticDefaultReport']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x94'));db[_0xdeef('0x95')]=db[_0xdeef('0x0')]['import'](_0xdeef('0x96'));db[_0xdeef('0x97')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x98'));db[_0xdeef('0x99')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x9a'));db[_0xdeef('0x9b')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xdeef('0x9c')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x9d'));db[_0xdeef('0x9e')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x9f'));db[_0xdeef('0xa0')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xa1'));db[_0xdeef('0xa2')]=db['sequelize'][_0xdeef('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xdeef('0xa3')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xa4'));db[_0xdeef('0xa5')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xa6'));db[_0xdeef('0xa7')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xa8'));db['DeskConfiguration']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xa9'));db['DeskField']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xaa'));db[_0xdeef('0xab')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xac'));db[_0xdeef('0xad')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xae'));db['ZohoField']=db['sequelize']['import']('../api/intZohoField/intZohoField.model');db[_0xdeef('0xaf')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xb0'));db[_0xdeef('0xb1')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xdeef('0xb2')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xb3'));db[_0xdeef('0xb4')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xb5'));db[_0xdeef('0xb6')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xb7'));db['VtigerConfiguration']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xb8'));db['VtigerField']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xb9'));db[_0xdeef('0xba')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xdeef('0xbb')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xbc'));db[_0xdeef('0xbd')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xbe'));db[_0xdeef('0xbf')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xc0'));db[_0xdeef('0xc1')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xc2'));db[_0xdeef('0xc3')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xc4'));db[_0xdeef('0xc5')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xc6'));db[_0xdeef('0xc7')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xc8'));db[_0xdeef('0xc9')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x90'));db[_0xdeef('0xca')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xcb'));db['ChatQueueReport']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0xdeef('0xcc')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xcd'));db[_0xdeef('0xce')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xcf'));db['JscriptyQuestionReport']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xd0'));db['JscriptySessionReport']=db[_0xdeef('0x0')]['import'](_0xdeef('0xd1'));db[_0xdeef('0xd2')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xd3'));db['SquareReport']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xd4'));db['SquareDetailsReport']=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/squareReportDetail/squareReportDetail.model');db[_0xdeef('0xd5')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xd6'));db['Setting']=db[_0xdeef('0x0')]['import']('../api/setting/setting.model');db[_0xdeef('0xd7')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xd8'));db['SquareProject']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xd9'));db[_0xdeef('0xda')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xdb'));db[_0xdeef('0xdc')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xdd'));db[_0xdeef('0xde')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xdf'));db[_0xdeef('0xe0')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xe1'));db[_0xdeef('0xe2')]=db[_0xdeef('0x0')]['import'](_0xdeef('0xe3'));db['Migration']=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xe4'));db[_0xdeef('0xe5')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xe6'));db[_0xdeef('0xe7')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xe8'));db['MailTransferReport']=db['sequelize'][_0xdeef('0x12')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xe9'));db[_0xdeef('0xea')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xeb'));db[_0xdeef('0xec')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xed'));db[_0xdeef('0xee')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xef'));db[_0xdeef('0xf0')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xf1'));db[_0xdeef('0xf2')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0xdeef('0xf3')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/userProfile/userProfile.model');db[_0xdeef('0xf4')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xf5'));db[_0xdeef('0xf6')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0xf7'));db[_0xdeef('0xf8')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/userNotification/userNotification.model');db[_0xdeef('0xf9')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0xdeef('0xfa')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0xfb'));db['WhatsappInteraction']=db[_0xdeef('0x0')]['import'](_0xdeef('0xfc'));db[_0xdeef('0xfd')]=db[_0xdeef('0x0')][_0xdeef('0x12')]('../api/whatsappMessage/whatsappMessage.model');db[_0xdeef('0xfe')]=db[_0xdeef('0x0')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xdeef('0xff')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x100'));db[_0xdeef('0x101')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x102'));db[_0xdeef('0x103')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x104'));db[_0xdeef('0x105')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x106'));db[_0xdeef('0x107')]=db[_0xdeef('0x0')][_0xdeef('0x12')](_0xdeef('0x108'));db[_0xdeef('0x109')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x10a'));db[_0xdeef('0x10b')]=db['sequelize'][_0xdeef('0x12')](_0xdeef('0x10c'));db[_0xdeef('0x10d')][_0xdeef('0x10e')](db[_0xdeef('0x20')],{'as':_0xdeef('0x20'),'onDelete':'cascade','foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x10e')](db[_0xdeef('0x10b')],{'as':_0xdeef('0x110'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x1c')],{'as':'Recordings','foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x30')],{'as':_0xdeef('0x113'),'foreignKey':'UserId'});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x17')],{'as':'Extensions','onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x10d')][_0xdeef('0x112')](db['CmHopperFinal'],{'as':_0xdeef('0x114'),'foreignKey':_0xdeef('0x10f')});db['User'][_0xdeef('0x112')](db['CmHopperHistory'],{'as':_0xdeef('0x115'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x79')],{'as':'ReportAgentPreview','foreignKey':_0xdeef('0x10f')});db['User'][_0xdeef('0x112')](db[_0xdeef('0x5c')],{'as':_0xdeef('0x116'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')]['hasMany'](db[_0xdeef('0x66')],{'as':_0xdeef('0x117'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')]['hasMany'](db[_0xdeef('0x55')],{'as':_0xdeef('0x118'),'foreignKey':'UserId'});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x119')],{'as':'FaxInteractions','foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x40')],{'as':_0xdeef('0x11a'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')][_0xdeef('0x112')](db[_0xdeef('0x11b')],{'as':_0xdeef('0x11c'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x10d')]['hasMany'](db['UserNotification'],{'as':_0xdeef('0x11d'),'foreignKey':_0xdeef('0x11e')});db[_0xdeef('0x10d')][_0xdeef('0x11f')](db[_0xdeef('0xf3')],{'as':'UserProfile','foreignKey':_0xdeef('0x120')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x6d')],{'as':_0xdeef('0x122'),'through':_0xdeef('0x123')});db['User'][_0xdeef('0x121')](db[_0xdeef('0x73')],{'as':_0xdeef('0x124'),'through':_0xdeef('0x125')});db[_0xdeef('0x10d')]['belongsToMany'](db[_0xdeef('0xf0')],{'as':'Lists','through':_0xdeef('0x126')});db[_0xdeef('0x10d')]['belongsToMany'](db['Team'],{'through':_0xdeef('0x127')});db['User'][_0xdeef('0x121')](db[_0xdeef('0x40')],{'as':_0xdeef('0x11a'),'through':_0xdeef('0x128')});db['User'][_0xdeef('0x121')](db[_0xdeef('0x66')],{'as':_0xdeef('0x117'),'through':_0xdeef('0x129')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x119')],{'as':_0xdeef('0x12a'),'through':'user_has_fax_interactions'});db['User'][_0xdeef('0x121')](db[_0xdeef('0x55')],{'as':_0xdeef('0x118'),'through':_0xdeef('0x12b')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['OpenchannelInteraction'],{'as':_0xdeef('0x116'),'through':_0xdeef('0x12c')});db[_0xdeef('0x10d')]['belongsToMany'](db[_0xdeef('0x11b')],{'as':_0xdeef('0x11c'),'through':'user_has_whatsapp_interactions'});db[_0xdeef('0x10d')]['belongsToMany'](db[_0xdeef('0x1a')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['VoicePrefix'],{'as':_0xdeef('0x12d'),'through':_0xdeef('0x109'),'required':![]});db['User'][_0xdeef('0x121')](db['MailQueue'],{'as':_0xdeef('0x12e'),'through':_0xdeef('0x12f'),'required':![]});db['User'][_0xdeef('0x121')](db[_0xdeef('0x6b')],{'as':_0xdeef('0x130'),'through':_0xdeef('0x33'),'required':![],'hooks':!![]});db['User'][_0xdeef('0x121')](db[_0xdeef('0x4f')],{'as':_0xdeef('0x131'),'through':_0xdeef('0x36'),'required':![]});db['User'][_0xdeef('0x121')](db['SmsQueue'],{'as':_0xdeef('0x132'),'through':_0xdeef('0x133'),'required':![]});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xdeef('0x10d')]['belongsToMany'](db['WhatsappQueue'],{'as':_0xdeef('0x134'),'through':_0xdeef('0x3a'),'required':![]});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['CmList'],{'through':_0xdeef('0x126')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['ChatWebsite'],{'as':_0xdeef('0x135'),'through':'user_has_chat_websites'});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x4a')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x136')],{'as':_0xdeef('0x137'),'through':'user_has_mail_accounts'});db[_0xdeef('0x10d')][_0xdeef('0x121')](db['OpenchannelAccount'],{'as':_0xdeef('0x138'),'through':_0xdeef('0x139')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x52')],{'as':'SmsAccounts','through':_0xdeef('0x13a')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0xf9')],{'as':'WhatsappAccounts','through':_0xdeef('0x13b')});db[_0xdeef('0x10d')][_0xdeef('0x121')](db[_0xdeef('0x13c')],{'as':'SquareProjects','through':_0xdeef('0x13d')});db['VoiceChanSpy'][_0xdeef('0x112')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xdeef('0x13e')});db[_0xdeef('0x15')][_0xdeef('0x112')](db['VoiceExtension'],{'onDelete':_0xdeef('0x111')});db[_0xdeef('0x17')]['hasMany'](db[_0xdeef('0x17')],{'as':_0xdeef('0x13f'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x19')][_0xdeef('0x121')](db[_0xdeef('0x86')],{'as':_0xdeef('0x140'),'through':_0xdeef('0x141')});db[_0xdeef('0x1a')][_0xdeef('0x112')](db[_0xdeef('0x30')],{'as':_0xdeef('0x142'),'foreignKey':_0xdeef('0x143')});db[_0xdeef('0x1a')][_0xdeef('0x112')](db[_0xdeef('0x144')],{'as':'Hoppers','foreignKey':_0xdeef('0x143')});db[_0xdeef('0x1a')][_0xdeef('0x112')](db[_0xdeef('0x145')],{'as':'HopperFinals','foreignKey':_0xdeef('0x143')});db[_0xdeef('0x1a')]['hasMany'](db[_0xdeef('0x77')],{'as':_0xdeef('0x146'),'foreignKey':_0xdeef('0x143')});db['VoiceQueue']['hasMany'](db[_0xdeef('0x79')],{'as':_0xdeef('0x79'),'foreignKey':_0xdeef('0x143')});db[_0xdeef('0x1a')][_0xdeef('0x112')](db[_0xdeef('0x75')],{'as':'HopperBlacks','foreignKey':_0xdeef('0x143')});db[_0xdeef('0x1a')][_0xdeef('0x112')](db[_0xdeef('0x147')],{'as':_0xdeef('0x148'),'foreignKey':_0xdeef('0x143')});db['VoiceQueue'][_0xdeef('0x11f')](db[_0xdeef('0x2d')],{'as':_0xdeef('0x2d'),'foreignKey':_0xdeef('0x149')});db[_0xdeef('0x1a')][_0xdeef('0x11f')](db[_0xdeef('0x2d')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xdeef('0x1a')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'as':_0xdeef('0x14a'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xdeef('0x11f')](db[_0xdeef('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xdeef('0x14b')});db[_0xdeef('0x1a')][_0xdeef('0x121')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x14c'),'through':'voice_queues_has_cm_lists'});db[_0xdeef('0x1a')]['belongsToMany'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x31')});db['VoiceQueue']['belongsToMany'](db[_0xdeef('0xde')],{'as':_0xdeef('0x14e'),'through':_0xdeef('0x105')});db[_0xdeef('0x1a')][_0xdeef('0x121')](db['CmList'],{'as':_0xdeef('0x14f'),'through':_0xdeef('0x150')});db[_0xdeef('0x1c')]['belongsTo'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x10d'),'foreignKey':_0xdeef('0x10f')});db['ScreenRecording'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x10d'),'foreignKey':'UserId'});db[_0xdeef('0x20')][_0xdeef('0x112')](db[_0xdeef('0x22')],{'as':'Messages','onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x151'),'sourceKey':_0xdeef('0x152')});db[_0xdeef('0x22')]['belongsTo'](db[_0xdeef('0x20')],{'foreignKey':_0xdeef('0x151'),'targetKey':_0xdeef('0x152')});db['VoiceCallReport'][_0xdeef('0x112')](db[_0xdeef('0x29')],{'as':_0xdeef('0x153'),'foreignKey':_0xdeef('0x154'),'constraints':![]});db[_0xdeef('0x155')]['hasMany'](db[_0xdeef('0x27')],{'as':_0xdeef('0x156'),'foreignKey':_0xdeef('0x154'),'constraints':![]});db[_0xdeef('0x155')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x10d'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x155')][_0xdeef('0x11f')](db['CmContact'],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db['MailServerIn']['belongsTo'](db['MailAccount'],{'as':_0xdeef('0x136'),'foreignKey':'MailAccountId'});db['MailServerIn'][_0xdeef('0x11f')](db[_0xdeef('0x103')],{'as':_0xdeef('0x103'),'foreignKey':_0xdeef('0x159'),'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x3d')][_0xdeef('0x11f')](db['MailAccount'],{'as':_0xdeef('0x136'),'foreignKey':_0xdeef('0x15b')});db[_0xdeef('0x3d')][_0xdeef('0x11f')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xdeef('0x15a')});db[_0xdeef('0x136')][_0xdeef('0x10e')](db[_0xdeef('0x3b')],{'as':_0xdeef('0x15c'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x136')][_0xdeef('0x10e')](db[_0xdeef('0x3d')],{'as':_0xdeef('0x15d'),'onDelete':'cascade'});db[_0xdeef('0x136')][_0xdeef('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xdeef('0x15b'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x136')][_0xdeef('0x112')](db[_0xdeef('0x15e')],{'as':_0xdeef('0x15f'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xdeef('0x160')],{'as':_0xdeef('0x161'),'foreignKey':_0xdeef('0x15b')});db[_0xdeef('0x136')][_0xdeef('0x112')](db['MailInteraction'],{'as':'Interactions'});db[_0xdeef('0x136')][_0xdeef('0x112')](db[_0xdeef('0x43')],{'as':_0xdeef('0x13f')});db[_0xdeef('0x136')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':'ListId'});db[_0xdeef('0x136')][_0xdeef('0x11f')](db['Template'],{'as':_0xdeef('0x89'),'foreignKey':_0xdeef('0x163')});db[_0xdeef('0x136')][_0xdeef('0x11f')](db[_0xdeef('0x81')],{'as':_0xdeef('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':'Agents','through':_0xdeef('0x165')});db[_0xdeef('0x166')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':'Agents','through':_0xdeef('0x12f')});db[_0xdeef('0x166')][_0xdeef('0x121')](db[_0xdeef('0xde')],{'through':_0xdeef('0x167'),'as':'Teams'});db[_0xdeef('0x40')]['hasMany'](db[_0xdeef('0x160')],{'as':'Messages','onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x168')});db['MailInteraction']['belongsTo'](db[_0xdeef('0x136')],{'as':'Account','foreignKey':_0xdeef('0x15b')});db[_0xdeef('0x40')]['belongsTo'](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x40')][_0xdeef('0x11f')](db['User'],{'as':_0xdeef('0x169'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x40')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':'mail_interaction_has_tags','as':_0xdeef('0x16a')});db[_0xdeef('0x40')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x16b'),'as':_0xdeef('0x16c')});db[_0xdeef('0x40')][_0xdeef('0x121')](db['User'],{'as':'Users','through':_0xdeef('0x128'),'foreignKey':_0xdeef('0x168')});db[_0xdeef('0x160')][_0xdeef('0x112')](db[_0xdeef('0xe5')],{'as':_0xdeef('0x16d'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x160')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':'User'});db[_0xdeef('0x160')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'onDelete':'cascade','as':_0xdeef('0x157')});db[_0xdeef('0x160')][_0xdeef('0x11f')](db['MailInteraction'],{'as':_0xdeef('0x16e'),'foreignKey':_0xdeef('0x168')});db['MailMessage'][_0xdeef('0x11f')](db[_0xdeef('0x136')],{'as':'Account','foreignKey':_0xdeef('0x15b')});db['MailMessage']['belongsTo'](db[_0xdeef('0x60')],{'as':_0xdeef('0x60'),'foreignKey':_0xdeef('0x16f')});db['MailMessage'][_0xdeef('0x11f')](db[_0xdeef('0x170')],{'as':'ChatOfflineMessage','foreignKey':_0xdeef('0x171')});db[_0xdeef('0x43')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':'restrict'});db[_0xdeef('0x43')]['belongsTo'](db[_0xdeef('0x166')],{'onDelete':'restrict'});db[_0xdeef('0x43')][_0xdeef('0x11f')](db[_0xdeef('0x136')],{'onDelete':'restrict'});db[_0xdeef('0x43')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x172')});db[_0xdeef('0x43')]['belongsTo'](db[_0xdeef('0x88')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x173')});db['MailQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x136')],{});db[_0xdeef('0x174')]['belongsTo'](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0x174')][_0xdeef('0x11f')](db['CmContact'],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x174')][_0xdeef('0x11f')](db['MailInteraction'],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db[_0xdeef('0x174')]['belongsTo'](db[_0xdeef('0x10d')],{});db[_0xdeef('0x174')][_0xdeef('0x11f')](db['MailQueue'],{});db[_0xdeef('0x46')]['hasMany'](db['DashboardItem'],{'as':_0xdeef('0x176'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x4a')][_0xdeef('0x112')](db[_0xdeef('0x177')],{'as':_0xdeef('0x178'),'foreignKey':_0xdeef('0x179'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x4a')][_0xdeef('0x112')](db['CannedAnswer'],{'as':_0xdeef('0x15f'),'foreignKey':_0xdeef('0x179')});db[_0xdeef('0x4a')][_0xdeef('0x112')](db[_0xdeef('0x119')],{'as':_0xdeef('0x17a')});db[_0xdeef('0x4a')][_0xdeef('0x112')](db[_0xdeef('0x4b')],{'as':_0xdeef('0x13f')});db[_0xdeef('0x4a')][_0xdeef('0x112')](db['VoiceExtension'],{'as':_0xdeef('0x17b'),'onDelete':_0xdeef('0x111')});db['FaxAccount'][_0xdeef('0x112')](db['FaxMessage'],{'as':_0xdeef('0x161')});db[_0xdeef('0x4a')][_0xdeef('0x11f')](db[_0xdeef('0x2d')],{'as':_0xdeef('0x2d')});db[_0xdeef('0x4a')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0x4a')][_0xdeef('0x11f')](db['Pause'],{'as':_0xdeef('0x164'),'foreignKey':_0xdeef('0x14b')});db[_0xdeef('0x4a')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':'user_has_fax_accounts'});db[_0xdeef('0x4b')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':'restrict'});db[_0xdeef('0x4b')]['belongsTo'](db[_0xdeef('0x4f')],{'onDelete':'restrict'});db[_0xdeef('0x4b')][_0xdeef('0x11f')](db[_0xdeef('0x4a')],{'onDelete':'restrict'});db['FaxApplication'][_0xdeef('0x11f')](db[_0xdeef('0x88')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x173')});db[_0xdeef('0x119')][_0xdeef('0x112')](db[_0xdeef('0x17c')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xdeef('0x17d')});db[_0xdeef('0x119')][_0xdeef('0x11f')](db[_0xdeef('0x4a')],{'as':_0xdeef('0x17e'),'foreignKey':'FaxAccountId'});db[_0xdeef('0x119')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db['FaxInteraction'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':'Owner','foreignKey':_0xdeef('0x10f')});db['FaxInteraction']['belongsToMany'](db[_0xdeef('0x88')],{'through':_0xdeef('0x17f'),'as':'Tags'});db[_0xdeef('0x119')]['belongsToMany'](db[_0xdeef('0x88')],{'through':'fax_interaction_has_tags','as':_0xdeef('0x16c')});db[_0xdeef('0x119')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':'Users','through':_0xdeef('0x180'),'foreignKey':'FaxInteractionId'});db[_0xdeef('0x17c')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x10d')});db[_0xdeef('0x17c')][_0xdeef('0x11f')](db[_0xdeef('0x119')],{'as':_0xdeef('0x16e'),'foreignKey':_0xdeef('0x17d')});db[_0xdeef('0x17c')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'onDelete':'cascade','as':_0xdeef('0x157')});db[_0xdeef('0x17c')][_0xdeef('0x11f')](db[_0xdeef('0xe5')],{'as':_0xdeef('0xe5'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0xdeef('0x11f')](db[_0xdeef('0x4a')],{'as':'Account','foreignKey':_0xdeef('0x179')});db[_0xdeef('0x4f')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x36')});db[_0xdeef('0x4f')][_0xdeef('0x121')](db[_0xdeef('0xde')],{'through':'team_has_fax_queues','as':_0xdeef('0x14e')});db[_0xdeef('0x181')][_0xdeef('0x11f')](db[_0xdeef('0x4a')],{});db[_0xdeef('0x181')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0x181')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':'ContactId'});db[_0xdeef('0x181')][_0xdeef('0x11f')](db[_0xdeef('0x119')],{});db['FaxQueueReport'][_0xdeef('0x11f')](db['FaxMessage'],{});db[_0xdeef('0x181')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{});db['FaxQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x4f')],{});db[_0xdeef('0x52')][_0xdeef('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0xdeef('0x111')});db[_0xdeef('0x52')][_0xdeef('0x112')](db[_0xdeef('0x15e')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xdeef('0x112')](db[_0xdeef('0x57')],{'as':_0xdeef('0x161'),'foreignKey':_0xdeef('0x182')});db[_0xdeef('0x52')][_0xdeef('0x112')](db[_0xdeef('0x55')],{'as':_0xdeef('0x17a')});db[_0xdeef('0x52')][_0xdeef('0x112')](db[_0xdeef('0x53')],{'as':_0xdeef('0x13f')});db['SmsAccount'][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':'List','foreignKey':_0xdeef('0x175')});db[_0xdeef('0x52')]['belongsTo'](db[_0xdeef('0x81')],{'as':_0xdeef('0x164'),'foreignKey':_0xdeef('0x14b')});db['SmsAccount']['belongsToMany'](db['User'],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x13a')});db['SmsApplication'][_0xdeef('0x11f')](db['User'],{'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x53')][_0xdeef('0x11f')](db[_0xdeef('0x183')],{'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x53')]['belongsTo'](db[_0xdeef('0x52')],{'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x53')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x172')});db[_0xdeef('0x53')][_0xdeef('0x11f')](db[_0xdeef('0x88')],{'onDelete':'restrict','foreignKey':_0xdeef('0x173')});db['SmsInteraction']['hasMany'](db[_0xdeef('0x57')],{'as':_0xdeef('0x161'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x184')});db[_0xdeef('0x55')][_0xdeef('0x11f')](db[_0xdeef('0x52')],{'as':'Account','foreignKey':_0xdeef('0x182')});db[_0xdeef('0x55')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db['SmsInteraction']['belongsTo'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x169'),'foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x55')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x185'),'as':_0xdeef('0x16a')});db[_0xdeef('0x55')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x185'),'as':_0xdeef('0x16c')});db[_0xdeef('0x55')]['belongsToMany'](db[_0xdeef('0x10d')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0xdeef('0x184')});db[_0xdeef('0x57')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x10d')});db[_0xdeef('0x57')]['belongsTo'](db['CmContact'],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x157')});db[_0xdeef('0x57')][_0xdeef('0x11f')](db['SmsInteraction'],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x16e'),'foreignKey':_0xdeef('0x184')});db[_0xdeef('0x57')][_0xdeef('0x11f')](db['SmsAccount'],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x182')});db[_0xdeef('0x183')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x133'),'foreignKey':'SmsQueueId'});db[_0xdeef('0x183')][_0xdeef('0x121')](db[_0xdeef('0xde')],{'through':_0xdeef('0x186'),'as':_0xdeef('0x14e')});db[_0xdeef('0x187')][_0xdeef('0x112')](db[_0xdeef('0x177')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xdeef('0x111')});db[_0xdeef('0x187')][_0xdeef('0x112')](db[_0xdeef('0x15e')],{'as':'Answers','foreignKey':_0xdeef('0x188')});db[_0xdeef('0x187')]['hasMany'](db[_0xdeef('0x5c')],{'as':_0xdeef('0x17a'),'foreignKey':'OpenchannelAccountId'});db[_0xdeef('0x187')][_0xdeef('0x112')](db[_0xdeef('0x189')],{'as':_0xdeef('0x161'),'foreignKey':_0xdeef('0x188')});db['OpenchannelAccount'][_0xdeef('0x112')](db[_0xdeef('0x5a')],{'as':_0xdeef('0x13f'),'foreignKey':_0xdeef('0x188')});db[_0xdeef('0x187')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db[_0xdeef('0x81')],{'as':_0xdeef('0x164'),'foreignKey':_0xdeef('0x14b')});db['OpenchannelAccount'][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x139')});db[_0xdeef('0x5a')]['belongsTo'](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x5a')][_0xdeef('0x11f')](db[_0xdeef('0x5f')],{'onDelete':_0xdeef('0x15a'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db[_0xdeef('0x187')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xdeef('0x5a')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x172')});db['OpenchannelApplication'][_0xdeef('0x11f')](db[_0xdeef('0x88')],{'onDelete':'restrict','foreignKey':_0xdeef('0x173')});db[_0xdeef('0x5c')][_0xdeef('0x112')](db['OpenchannelMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xdeef('0x18a')});db[_0xdeef('0x5c')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x188')});db[_0xdeef('0x5c')]['belongsTo'](db[_0xdeef('0x73')],{'as':'Contact','foreignKey':_0xdeef('0x158')});db['OpenchannelInteraction'][_0xdeef('0x11f')](db['User'],{'as':'Owner','foreignKey':_0xdeef('0x10f')});db[_0xdeef('0x5c')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x18b'),'as':_0xdeef('0x16a')});db[_0xdeef('0x5c')][_0xdeef('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xdeef('0x16c')});db[_0xdeef('0x5c')][_0xdeef('0x121')](db['User'],{'as':_0xdeef('0x18c'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xdeef('0x189')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x10d')});db[_0xdeef('0x189')][_0xdeef('0x11f')](db['CmContact'],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x157')});db[_0xdeef('0x189')][_0xdeef('0x11f')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xdeef('0x18a')});db[_0xdeef('0x189')][_0xdeef('0x11f')](db['Attachment'],{'as':_0xdeef('0xe5'),'foreignKey':_0xdeef('0x18d')});db[_0xdeef('0x189')][_0xdeef('0x11f')](db[_0xdeef('0x187')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x188')});db['OpenchannelQueue'][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':'Agents','through':_0xdeef('0x39'),'foreignKey':_0xdeef('0x18e')});db[_0xdeef('0x5f')][_0xdeef('0x121')](db[_0xdeef('0xde')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xdeef('0x60')][_0xdeef('0x112')](db[_0xdeef('0x177')],{'as':_0xdeef('0x178'),'foreignKey':'ChatWebsiteId','onDelete':_0xdeef('0x111')});db[_0xdeef('0x60')][_0xdeef('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xdeef('0x60')]['hasMany'](db[_0xdeef('0x6f')],{'as':_0xdeef('0x18f')});db[_0xdeef('0x60')][_0xdeef('0x112')](db[_0xdeef('0x66')],{'as':_0xdeef('0x17a')});db[_0xdeef('0x60')][_0xdeef('0x112')](db[_0xdeef('0x64')],{'as':'Applications'});db[_0xdeef('0x60')]['hasMany'](db[_0xdeef('0x68')],{'as':_0xdeef('0x161')});db[_0xdeef('0x60')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0x60')]['belongsTo'](db['Interval'],{'as':_0xdeef('0x14a'),'foreignKey':_0xdeef('0x172')});db['ChatWebsite'][_0xdeef('0x11f')](db[_0xdeef('0x136')],{'as':_0xdeef('0x136'),'foreignKey':_0xdeef('0x15b')});db['ChatWebsite']['belongsTo'](db[_0xdeef('0x81')],{'as':_0xdeef('0x164'),'foreignKey':_0xdeef('0x14b')});db[_0xdeef('0x60')]['belongsToMany'](db['User'],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x190')});db[_0xdeef('0x62')]['belongsTo'](db[_0xdeef('0x187')],{});db['OpenchannelQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':'List','foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x62')][_0xdeef('0x11f')](db[_0xdeef('0x5c')],{});db[_0xdeef('0x62')][_0xdeef('0x11f')](db[_0xdeef('0x189')],{});db[_0xdeef('0x62')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{});db['OpenchannelQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x5f')],{});db[_0xdeef('0x64')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x191'),'foreignKey':_0xdeef('0x10f'),'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x64')][_0xdeef('0x11f')](db['ChatQueue'],{'as':_0xdeef('0x192'),'foreignKey':_0xdeef('0x193'),'onDelete':'restrict'});db[_0xdeef('0x64')][_0xdeef('0x11f')](db[_0xdeef('0x60')],{'as':_0xdeef('0x194'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xdeef('0x64')][_0xdeef('0x11f')](db[_0xdeef('0x88')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x173')});db['ChatInteraction'][_0xdeef('0x112')](db[_0xdeef('0x68')],{'as':_0xdeef('0x161'),'onDelete':_0xdeef('0x111'),'foreignKey':'ChatInteractionId'});db[_0xdeef('0x66')]['belongsTo'](db[_0xdeef('0x60')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x16f')});db[_0xdeef('0x66')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x66')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':'Owner','foreignKey':'UserId'});db[_0xdeef('0x66')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x195'),'as':_0xdeef('0x16a')});db[_0xdeef('0x66')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x195'),'as':_0xdeef('0x16c')});db['ChatInteraction']['belongsToMany'](db[_0xdeef('0x10d')],{'as':'Users','through':_0xdeef('0x129'),'foreignKey':_0xdeef('0x196')});db[_0xdeef('0x68')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x111'),'as':'User'});db[_0xdeef('0x68')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'onDelete':'cascade','as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db['ChatMessage'][_0xdeef('0x11f')](db[_0xdeef('0x66')],{'onDelete':_0xdeef('0x111'),'as':_0xdeef('0x16e'),'foreignKey':_0xdeef('0x196')});db[_0xdeef('0x68')][_0xdeef('0x11f')](db['Attachment'],{'as':_0xdeef('0xe5'),'foreignKey':_0xdeef('0x18d')});db['ChatMessage']['belongsTo'](db[_0xdeef('0x60')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x16f')});db[_0xdeef('0x170')]['hasMany'](db[_0xdeef('0xe5')],{'as':'Attachments','foreignKey':_0xdeef('0x171'),'onDelete':_0xdeef('0x111'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xdeef('0x73')],{'onDelete':_0xdeef('0x111'),'as':'Contact','foreignKey':_0xdeef('0x158')});db[_0xdeef('0x170')][_0xdeef('0x11f')](db['ChatWebsite'],{'as':_0xdeef('0x17e'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':'UserChatQueue','hooks':!![]});db[_0xdeef('0x6b')]['belongsToMany'](db[_0xdeef('0xde')],{'through':_0xdeef('0x197'),'as':_0xdeef('0x14e')});db['ChatGroup'][_0xdeef('0x112')](db['ChatInternalMessage'],{'as':_0xdeef('0x161'),'foreignKey':_0xdeef('0x198'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x6d')]['belongsToMany'](db['User'],{'as':_0xdeef('0x142'),'through':_0xdeef('0x123')});db[_0xdeef('0x6f')][_0xdeef('0x11f')](db[_0xdeef('0x60')],{'as':'Website','foreignKey':_0xdeef('0x16f')});db[_0xdeef('0x71')][_0xdeef('0x112')](db[_0xdeef('0x73')],{'as':_0xdeef('0x124'),'foreignKey':_0xdeef('0x199')});db[_0xdeef('0x73')][_0xdeef('0x112')](db[_0xdeef('0x144')],{'as':'Hoppers','foreignKey':_0xdeef('0x158')});db[_0xdeef('0x73')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xdeef('0x77')],{'as':_0xdeef('0x146'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x73')][_0xdeef('0x112')](db['ReportAgentPreview'],{'as':_0xdeef('0x79'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x73')][_0xdeef('0x112')](db['JscriptySessionReport'],{'as':_0xdeef('0x148'),'foreignKey':'ContactId'});db[_0xdeef('0x73')][_0xdeef('0x112')](db[_0xdeef('0x5c')],{'as':_0xdeef('0x116'),'foreignKey':_0xdeef('0x158'),'onDelete':_0xdeef('0x15a')});db['CmContact'][_0xdeef('0x112')](db[_0xdeef('0x66')],{'as':'ChatInteractions','foreignKey':_0xdeef('0x158'),'onDelete':_0xdeef('0x15a')});db['CmContact']['hasMany'](db[_0xdeef('0x55')],{'as':_0xdeef('0x118'),'foreignKey':'ContactId','onDelete':_0xdeef('0x15a')});db['CmContact'][_0xdeef('0x112')](db[_0xdeef('0x119')],{'as':_0xdeef('0x12a'),'foreignKey':_0xdeef('0x158'),'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x73')][_0xdeef('0x112')](db[_0xdeef('0x40')],{'as':_0xdeef('0x11a'),'foreignKey':'ContactId','onDelete':_0xdeef('0x15a')});db[_0xdeef('0x73')][_0xdeef('0x11f')](db[_0xdeef('0x71')],{'as':_0xdeef('0x19a'),'foreignKey':_0xdeef('0x199')});db[_0xdeef('0x73')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x73')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x18c'),'through':'cm_user_has_contacts'});db[_0xdeef('0x73')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'as':'Tags','through':'cm_contact_has_tags'});db['CmContact'][_0xdeef('0x121')](db['Tag'],{'through':_0xdeef('0x19b'),'as':_0xdeef('0x16c')});db[_0xdeef('0x144')]['belongsTo'](db[_0xdeef('0x73')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xdeef('0x111')});db[_0xdeef('0x144')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':'List','foreignKey':_0xdeef('0x175'),'onDelete':_0xdeef('0x111')});db['CmHopper'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x191'),'foreignKey':'UserId'});db[_0xdeef('0x144')][_0xdeef('0x11f')](db['VoiceQueue'],{'as':_0xdeef('0x192'),'foreignKey':_0xdeef('0x143'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x144')][_0xdeef('0x11f')](db['Campaign'],{'as':_0xdeef('0xe2'),'foreignKey':_0xdeef('0x19c'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x144')]['belongsTo'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x169'),'foreignKey':_0xdeef('0x19d')});db['CmHopperBlack'][_0xdeef('0x11f')](db['CmContact'],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158'),'onDelete':'cascade'});db[_0xdeef('0x75')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175'),'onDelete':_0xdeef('0x111')});db['CmHopperBlack']['belongsTo'](db[_0xdeef('0x1a')],{'as':'Queue','foreignKey':_0xdeef('0x143'),'onDelete':_0xdeef('0x111')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xdeef('0xe2'),'foreignKey':'CampaignId','onDelete':_0xdeef('0x111')});db['Automation'][_0xdeef('0x112')](db['Condition'],{'as':{'plural':_0xdeef('0x19e'),'singular':_0xdeef('0x19f')},'foreignKey':'AutomationAllId','onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x7d')]['hasMany'](db[_0xdeef('0x7f')],{'as':{'plural':_0xdeef('0x1a0'),'singular':_0xdeef('0x1a1')},'foreignKey':_0xdeef('0x1a2'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xdeef('0x112')](db['Action'],{'as':_0xdeef('0x1a3'),'foreignKey':_0xdeef('0x1a4'),'onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x177')][_0xdeef('0x112')](db[_0xdeef('0x177')],{'as':'Dispositions','foreignKey':_0xdeef('0x1a5'),'onDelete':_0xdeef('0x111')});db['Interval'][_0xdeef('0x112')](db['Interval'],{'as':'Intervals','foreignKey':_0xdeef('0x172'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval'][_0xdeef('0x112')](db[_0xdeef('0x17')],{'as':_0xdeef('0x1a6'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0xdeef('0x14a')]['hasMany'](db[_0xdeef('0x43')],{'as':_0xdeef('0x1a7'),'foreignKey':_0xdeef('0x172')});db[_0xdeef('0x14a')]['hasMany'](db['ChatApplication'],{'as':_0xdeef('0x1a8'),'foreignKey':'IntervalId'});db[_0xdeef('0x14a')][_0xdeef('0x112')](db[_0xdeef('0x4b')],{'as':_0xdeef('0x1a9'),'foreignKey':_0xdeef('0x172')});db[_0xdeef('0x14a')]['hasMany'](db[_0xdeef('0x53')],{'as':'SmsApplications','foreignKey':_0xdeef('0x172')});db[_0xdeef('0x85')][_0xdeef('0x11f')](db['MailAccount'],{});db[_0xdeef('0x85')]['belongsTo'](db[_0xdeef('0x1aa')],{'foreignKey':_0xdeef('0x1ab')});db[_0xdeef('0x85')][_0xdeef('0x11f')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0xdeef('0x86')][_0xdeef('0x121')](db['VoiceMusicOnHold'],{'as':_0xdeef('0x1ac'),'through':_0xdeef('0x141'),'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x88')][_0xdeef('0x121')](db[_0xdeef('0x73')],{'through':_0xdeef('0x19b')});db['Tag'][_0xdeef('0x121')](db[_0xdeef('0x66')],{'through':'chat_interaction_has_tags'});db['Tag'][_0xdeef('0x121')](db['MailInteraction'],{'through':_0xdeef('0x16b')});db[_0xdeef('0x88')][_0xdeef('0x121')](db[_0xdeef('0x55')],{'through':_0xdeef('0x185')});db[_0xdeef('0x88')][_0xdeef('0x121')](db[_0xdeef('0x119')],{'through':_0xdeef('0x17f')});db[_0xdeef('0x88')][_0xdeef('0x121')](db[_0xdeef('0x5c')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xdeef('0x121')](db[_0xdeef('0x11b')],{'through':'whatsapp_interaction_has_tags'});db['Trigger'][_0xdeef('0x112')](db[_0xdeef('0x7f')],{'as':{'plural':'AllConditions','singular':_0xdeef('0x1ad')},'foreignKey':_0xdeef('0x1ae'),'onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x8b')][_0xdeef('0x112')](db[_0xdeef('0x7f')],{'as':{'plural':_0xdeef('0x1af'),'singular':_0xdeef('0x1b0')},'foreignKey':_0xdeef('0x1b1'),'onDelete':_0xdeef('0x111'),'hooks':!![]});db['Trigger'][_0xdeef('0x112')](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x92')][_0xdeef('0x112')](db[_0xdeef('0x99')],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xdeef('0x1aa')][_0xdeef('0x112')](db[_0xdeef('0x99')],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1ab')});db[_0xdeef('0x97')][_0xdeef('0x112')](db[_0xdeef('0x99')],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b3')});db[_0xdeef('0x99')][_0xdeef('0x11f')](db[_0xdeef('0x97')],{'foreignKey':_0xdeef('0x1b3')});db['SalesforceAccount']['hasMany'](db[_0xdeef('0x9e')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0x9e')][_0xdeef('0x112')](db[_0xdeef('0xa0')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0x9e')]['hasMany'](db[_0xdeef('0xa0')],{'as':_0xdeef('0x1b8'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b9')});db['SalesforceConfiguration'][_0xdeef('0x112')](db['SalesforceField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x9e')][_0xdeef('0x11f')](db[_0xdeef('0x9c')],{'as':'Account','foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xa0')]['hasMany'](db[_0xdeef('0xa0')],{'as':_0xdeef('0x1bb'),'foreignKey':'SubjectId'});db[_0xdeef('0xa0')][_0xdeef('0x112')](db[_0xdeef('0xa0')],{'as':_0xdeef('0x1bc'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xa0')]['hasMany'](db[_0xdeef('0xa0')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db['SalesforceField'][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xa2')][_0xdeef('0x112')](db[_0xdeef('0xa3')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xa3')][_0xdeef('0x112')](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':'SubjectId'});db[_0xdeef('0xa3')]['hasMany'](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1b8'),'onDelete':_0xdeef('0x111'),'foreignKey':'DescriptionId'});db[_0xdeef('0xa3')][_0xdeef('0x112')](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1b2'),'onDelete':'cascade','foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xa3')][_0xdeef('0x11f')](db['SugarcrmAccount'],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xa5')][_0xdeef('0x112')](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xa5')][_0xdeef('0x112')](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1bc'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xa5')][_0xdeef('0x112')](db[_0xdeef('0xa5')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xa5')][_0xdeef('0x11f')](db['Variable'],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xa7')][_0xdeef('0x112')](db[_0xdeef('0x1bf')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db['DeskConfiguration'][_0xdeef('0x112')](db[_0xdeef('0x1c0')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0x1bf')][_0xdeef('0x112')](db[_0xdeef('0x1c0')],{'as':_0xdeef('0x1b8'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0x1bf')][_0xdeef('0x112')](db[_0xdeef('0x1c0')],{'as':'Fields','onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x1bf')][_0xdeef('0x11f')](db[_0xdeef('0xa7')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0x1bf')]['belongsToMany'](db[_0xdeef('0x88')],{'through':_0xdeef('0x1c1')});db[_0xdeef('0x1c0')]['hasMany'](db[_0xdeef('0x1c0')],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0x1c0')][_0xdeef('0x112')](db[_0xdeef('0x1c0')],{'as':_0xdeef('0x1bc'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0x1c0')]['hasMany'](db[_0xdeef('0x1c0')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x1c0')][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xab')][_0xdeef('0x112')](db[_0xdeef('0xad')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':'AccountId'});db[_0xdeef('0xad')][_0xdeef('0x112')](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':'SubjectId'});db[_0xdeef('0xad')]['hasMany'](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xdeef('0xad')][_0xdeef('0x112')](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xad')][_0xdeef('0x11f')](db[_0xdeef('0xab')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db['ZohoField'][_0xdeef('0x112')](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0x1c2')]['hasMany'](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1bc'),'foreignKey':'DescriptionId'});db[_0xdeef('0x1c2')][_0xdeef('0x112')](db[_0xdeef('0x1c2')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x1c2')][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db['ZendeskAccount'][_0xdeef('0x112')](db['ZendeskConfiguration'],{'as':_0xdeef('0x1b4'),'onDelete':'cascade','foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xb1')][_0xdeef('0x112')](db[_0xdeef('0xb2')],{'as':'Subjects','foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0xdeef('0x1b8'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xb1')]['hasMany'](db[_0xdeef('0xb2')],{'as':_0xdeef('0x1b2'),'foreignKey':_0xdeef('0x1ba')});db['ZendeskConfiguration'][_0xdeef('0x11f')](db[_0xdeef('0xaf')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xb1')][_0xdeef('0x121')](db['Tag'],{'through':_0xdeef('0x1c3')});db[_0xdeef('0xb2')][_0xdeef('0x112')](db['ZendeskField'],{'as':_0xdeef('0x1bb'),'foreignKey':'SubjectId'});db[_0xdeef('0xb2')]['hasMany'](db[_0xdeef('0xb2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xdeef('0xb2')][_0xdeef('0x112')](db[_0xdeef('0xb2')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xb2')][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0x1c4')]['hasMany'](db[_0xdeef('0x1c5')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0x1c5')][_0xdeef('0x112')](db[_0xdeef('0xb4')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':'SubjectId'});db[_0xdeef('0x1c5')][_0xdeef('0x112')](db[_0xdeef('0xb4')],{'as':_0xdeef('0x1b8'),'onDelete':_0xdeef('0x111'),'foreignKey':'DescriptionId'});db[_0xdeef('0x1c5')]['hasMany'](db[_0xdeef('0xb4')],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':'FieldId'});db[_0xdeef('0x1c5')][_0xdeef('0x11f')](db[_0xdeef('0x1c4')],{'as':'Account','foreignKey':'AccountId'});db[_0xdeef('0x1c5')][_0xdeef('0x121')](db[_0xdeef('0x88')],{'through':_0xdeef('0x1c6')});db['FreshdeskField'][_0xdeef('0x112')](db[_0xdeef('0xb4')],{'as':'Subject','foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xb4')]['hasMany'](db[_0xdeef('0xb4')],{'as':'Description','foreignKey':_0xdeef('0x1b9')});db['FreshdeskField'][_0xdeef('0x112')](db[_0xdeef('0xb4')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xb4')]['belongsTo'](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xb6')][_0xdeef('0x112')](db['VtigerConfiguration'],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db['VtigerConfiguration']['hasMany'](db[_0xdeef('0x1c7')],{'as':_0xdeef('0x1b6'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0x1c8')][_0xdeef('0x112')](db[_0xdeef('0x1c7')],{'as':'Descriptions','foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0x1c8')][_0xdeef('0x112')](db[_0xdeef('0x1c7')],{'as':_0xdeef('0x1b2'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x1c8')]['belongsTo'](db[_0xdeef('0xb6')],{'as':'Account','foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0x1c7')][_0xdeef('0x112')](db[_0xdeef('0x1c7')],{'as':_0xdeef('0x1bb'),'foreignKey':'SubjectId'});db[_0xdeef('0x1c7')][_0xdeef('0x112')](db[_0xdeef('0x1c7')],{'as':'Description','foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0x1c7')][_0xdeef('0x112')](db['VtigerField'],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0x1c7')][_0xdeef('0x11f')](db['Variable'],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xba')][_0xdeef('0x112')](db[_0xdeef('0xbb')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xbb')][_0xdeef('0x112')](db['ServicenowField'],{'as':_0xdeef('0x1b6'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xbb')]['hasMany'](db[_0xdeef('0xbd')],{'as':_0xdeef('0x1b8'),'foreignKey':_0xdeef('0x1b9')});db['ServicenowConfiguration']['hasMany'](db[_0xdeef('0xbd')],{'as':_0xdeef('0x1b2'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xbb')][_0xdeef('0x11f')](db[_0xdeef('0xba')],{'as':'Account','foreignKey':_0xdeef('0x1b5')});db['ServicenowField'][_0xdeef('0x112')](db[_0xdeef('0xbd')],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db['ServicenowField'][_0xdeef('0x112')](db[_0xdeef('0xbd')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xdeef('0xbd')][_0xdeef('0x112')](db['ServicenowField'],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db['ServicenowField'][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xbf')][_0xdeef('0x112')](db[_0xdeef('0xc1')],{'as':_0xdeef('0x1b4'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b5')});db[_0xdeef('0xbf')][_0xdeef('0x11f')](db[_0xdeef('0x103')],{'as':_0xdeef('0x103'),'foreignKey':_0xdeef('0x159')});db[_0xdeef('0xc1')][_0xdeef('0x112')](db[_0xdeef('0xc3')],{'as':_0xdeef('0x1b6'),'onDelete':_0xdeef('0x111'),'foreignKey':'SubjectId'});db['Dynamics365Configuration'][_0xdeef('0x112')](db[_0xdeef('0xc3')],{'as':'Descriptions','onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xc1')][_0xdeef('0x112')](db['Dynamics365Field'],{'as':_0xdeef('0x1b2'),'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xc1')][_0xdeef('0x11f')](db['Dynamics365Account'],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db['Dynamics365Field'][_0xdeef('0x112')](db['Dynamics365Field'],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xc3')]['hasMany'](db[_0xdeef('0xc3')],{'as':'Description','foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xc3')][_0xdeef('0x112')](db[_0xdeef('0xc3')],{'as':_0xdeef('0x1bd'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xc3')][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0xc5')]['hasMany'](db[_0xdeef('0xc7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xdeef('0x1b5')});db['FreshsalesConfiguration'][_0xdeef('0x112')](db['FreshsalesField'],{'as':_0xdeef('0x1b6'),'foreignKey':_0xdeef('0x1b7')});db[_0xdeef('0xc7')][_0xdeef('0x112')](db[_0xdeef('0xc9')],{'as':_0xdeef('0x1b8'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xc7')][_0xdeef('0x112')](db[_0xdeef('0xc9')],{'as':_0xdeef('0x1b2'),'foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xc7')][_0xdeef('0x11f')](db[_0xdeef('0xc5')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1b5')});db['FreshsalesField'][_0xdeef('0x112')](db[_0xdeef('0xc9')],{'as':_0xdeef('0x1bb'),'foreignKey':_0xdeef('0x1b7')});db['FreshsalesField'][_0xdeef('0x112')](db[_0xdeef('0xc9')],{'as':_0xdeef('0x1bc'),'foreignKey':_0xdeef('0x1b9')});db[_0xdeef('0xc9')]['hasMany'](db[_0xdeef('0xc9')],{'as':'Field','foreignKey':_0xdeef('0x1ba')});db[_0xdeef('0xc9')][_0xdeef('0x11f')](db[_0xdeef('0x8d')],{'as':_0xdeef('0x8d'),'foreignKey':_0xdeef('0x1be')});db[_0xdeef('0x1c9')]['belongsTo'](db['ChatWebsite'],{});db[_0xdeef('0x1c9')][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x162'),'foreignKey':'ListId'});db['ChatQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0x1c9')][_0xdeef('0x11f')](db[_0xdeef('0x66')],{});db[_0xdeef('0x1c9')][_0xdeef('0x11f')](db['ChatMessage'],{});db['ChatQueueReport'][_0xdeef('0x11f')](db['User'],{});db[_0xdeef('0x1c9')][_0xdeef('0x11f')](db[_0xdeef('0x6b')],{});db[_0xdeef('0xcc')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1ca')});db[_0xdeef('0xcc')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1cb')});db['JscriptySessionReport'][_0xdeef('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0xdeef('0x1cc'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0x147')][_0xdeef('0x112')](db[_0xdeef('0xce')],{'foreignKey':_0xdeef('0x1cc'),'onDelete':'cascade'});db[_0xdeef('0xd2')][_0xdeef('0x11f')](db[_0xdeef('0x52')],{});db['SmsQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0xf0')],{'as':'List','foreignKey':'ListId'});db[_0xdeef('0xd2')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db[_0xdeef('0xd2')][_0xdeef('0x11f')](db[_0xdeef('0x55')],{});db[_0xdeef('0xd2')][_0xdeef('0x11f')](db[_0xdeef('0x57')],{});db[_0xdeef('0xd2')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{});db[_0xdeef('0xd2')]['belongsTo'](db['SmsQueue'],{});db['JscriptyProject'][_0xdeef('0x112')](db[_0xdeef('0x147')],{'foreignKey':_0xdeef('0x1cd')});db[_0xdeef('0xd5')][_0xdeef('0x112')](db['JscriptyQuestionReport'],{'foreignKey':_0xdeef('0x1cd')});db[_0xdeef('0xd5')][_0xdeef('0x112')](db[_0xdeef('0xce')],{'foreignKey':_0xdeef('0x1cd')});db[_0xdeef('0x13c')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x18c'),'through':'user_has_square_projects'});db[_0xdeef('0xde')]['belongsToMany'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x127')});db['Team'][_0xdeef('0x121')](db['VoiceQueue'],{'through':_0xdeef('0x105'),'as':'VoiceQueues'});db['Team']['belongsToMany'](db[_0xdeef('0x166')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team']['belongsToMany'](db[_0xdeef('0x6b')],{'through':_0xdeef('0x197'),'as':_0xdeef('0x130')});db[_0xdeef('0xde')][_0xdeef('0x121')](db[_0xdeef('0x4f')],{'through':_0xdeef('0x1ce'),'as':_0xdeef('0x131')});db['Team']['belongsToMany'](db[_0xdeef('0x183')],{'through':_0xdeef('0x186'),'as':_0xdeef('0x132')});db[_0xdeef('0xde')][_0xdeef('0x121')](db[_0xdeef('0x5f')],{'through':_0xdeef('0x1cf'),'as':_0xdeef('0x1d0')});db[_0xdeef('0xde')][_0xdeef('0x121')](db[_0xdeef('0x101')],{'through':_0xdeef('0x1d1'),'as':_0xdeef('0x134')});db['Team'][_0xdeef('0x121')](db[_0xdeef('0xf2')],{'through':_0xdeef('0x107'),'as':'VoicePrefixes'});db[_0xdeef('0xe2')][_0xdeef('0x112')](db[_0xdeef('0x144')],{'as':_0xdeef('0x1d2'),'foreignKey':_0xdeef('0x19c')});db[_0xdeef('0xe2')]['hasMany'](db[_0xdeef('0x145')],{'as':_0xdeef('0x114'),'foreignKey':_0xdeef('0x19c')});db[_0xdeef('0xe2')][_0xdeef('0x112')](db[_0xdeef('0x77')],{'as':'HopperHistories','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0xdeef('0x1d3'),'foreignKey':_0xdeef('0x19c')});db[_0xdeef('0xe2')][_0xdeef('0x11f')](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xdeef('0xe2')][_0xdeef('0x11f')](db[_0xdeef('0x2d')],{'as':_0xdeef('0x1d4'),'foreignKey':_0xdeef('0x1d5')});db[_0xdeef('0xe2')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'as':'Interval','foreignKey':_0xdeef('0x172')});db[_0xdeef('0xe2')][_0xdeef('0x11f')](db['SquareProject'],{'as':_0xdeef('0x13c'),'foreignKey':_0xdeef('0x1d6')});db['Campaign'][_0xdeef('0x121')](db[_0xdeef('0xf0')],{'as':'Lists','through':_0xdeef('0x1d7')});db[_0xdeef('0xe2')][_0xdeef('0x121')](db[_0xdeef('0xf0')],{'as':_0xdeef('0x14f'),'through':_0xdeef('0x1d8')});db[_0xdeef('0xe5')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xdeef('0x170'),'foreignKey':_0xdeef('0x171')});db[_0xdeef('0x1d9')]['belongsTo'](db[_0xdeef('0x160')],{});db[_0xdeef('0x1d9')][_0xdeef('0x11f')](db[_0xdeef('0x40')],{});db[_0xdeef('0x1d9')][_0xdeef('0x11f')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0xdeef('0x1da')});db[_0xdeef('0x1d9')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':'FromUserId','as':_0xdeef('0x1db')});db[_0xdeef('0x1d9')]['belongsTo'](db[_0xdeef('0x10d')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xdeef('0x1d9')][_0xdeef('0x11f')](db[_0xdeef('0x166')],{'foreignKey':_0xdeef('0x1dc'),'as':'ToQueue'});db[_0xdeef('0x1d9')][_0xdeef('0x11f')](db[_0xdeef('0x136')],{'foreignKey':_0xdeef('0x1dd'),'as':_0xdeef('0x1de')});db[_0xdeef('0x1df')][_0xdeef('0x11f')](db[_0xdeef('0x68')],{});db[_0xdeef('0x1df')]['belongsTo'](db[_0xdeef('0x66')],{});db[_0xdeef('0x1df')][_0xdeef('0x11f')](db[_0xdeef('0x60')],{'foreignKey':_0xdeef('0x1e0'),'as':_0xdeef('0x1da')});db[_0xdeef('0x1df')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e1'),'as':_0xdeef('0x1db')});db[_0xdeef('0x1df')]['belongsTo'](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e2'),'as':_0xdeef('0x1e3')});db[_0xdeef('0x1df')][_0xdeef('0x11f')](db[_0xdeef('0x6b')],{'foreignKey':_0xdeef('0x1e4'),'as':_0xdeef('0x1e5')});db['ChatTransferReport'][_0xdeef('0x11f')](db[_0xdeef('0x60')],{'foreignKey':_0xdeef('0x1e6'),'as':'ToAccount'});db['FaxTransferReport'][_0xdeef('0x11f')](db['FaxMessage'],{});db[_0xdeef('0xea')][_0xdeef('0x11f')](db[_0xdeef('0x119')],{});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0xdeef('0x1e7'),'as':_0xdeef('0x1da')});db[_0xdeef('0xea')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e1'),'as':_0xdeef('0x1db')});db[_0xdeef('0xea')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e2'),'as':_0xdeef('0x1e3')});db[_0xdeef('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0xdeef('0x1e8'),'as':'ToQueue'});db[_0xdeef('0xea')][_0xdeef('0x11f')](db[_0xdeef('0x4a')],{'foreignKey':_0xdeef('0x1e9'),'as':_0xdeef('0x1de')});db['OpenchannelTransferReport'][_0xdeef('0x11f')](db[_0xdeef('0x189')],{});db[_0xdeef('0xec')][_0xdeef('0x11f')](db['OpenchannelInteraction'],{});db[_0xdeef('0xec')][_0xdeef('0x11f')](db[_0xdeef('0x187')],{'foreignKey':_0xdeef('0x1ea'),'as':_0xdeef('0x1da')});db[_0xdeef('0xec')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e1'),'as':_0xdeef('0x1db')});db[_0xdeef('0xec')][_0xdeef('0x11f')](db['User'],{'foreignKey':_0xdeef('0x1e2'),'as':_0xdeef('0x1e3')});db[_0xdeef('0xec')][_0xdeef('0x11f')](db[_0xdeef('0x5f')],{'foreignKey':_0xdeef('0x1eb'),'as':'ToQueue'});db[_0xdeef('0xec')][_0xdeef('0x11f')](db['OpenchannelAccount'],{'foreignKey':_0xdeef('0x1ec'),'as':_0xdeef('0x1de')});db[_0xdeef('0xee')][_0xdeef('0x11f')](db['SmsMessage'],{});db[_0xdeef('0xee')]['belongsTo'](db[_0xdeef('0x55')],{});db['SmsTransferReport'][_0xdeef('0x11f')](db['SmsAccount'],{'foreignKey':_0xdeef('0x1ed'),'as':_0xdeef('0x1da')});db['SmsTransferReport'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':'FromUserId','as':_0xdeef('0x1db')});db[_0xdeef('0xee')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e2'),'as':_0xdeef('0x1e3')});db['SmsTransferReport']['belongsTo'](db[_0xdeef('0x183')],{'foreignKey':_0xdeef('0x1ee'),'as':'ToQueue'});db[_0xdeef('0xee')][_0xdeef('0x11f')](db[_0xdeef('0x52')],{'foreignKey':_0xdeef('0x1ef'),'as':_0xdeef('0x1de')});db[_0xdeef('0xf0')][_0xdeef('0x112')](db['Disposition'],{'as':_0xdeef('0x178'),'foreignKey':_0xdeef('0x175'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0xf0')]['hasMany'](db['CmCustomField'],{'as':'CustomFields','foreignKey':'ListId'});db[_0xdeef('0xf0')]['hasMany'](db[_0xdeef('0x73')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xdeef('0x175')});db[_0xdeef('0xf0')][_0xdeef('0x112')](db[_0xdeef('0x145')],{'as':_0xdeef('0x114'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0xf0')][_0xdeef('0x112')](db['CmHopperHistory'],{'as':_0xdeef('0x115'),'foreignKey':_0xdeef('0x175')});db['CmList'][_0xdeef('0x112')](db[_0xdeef('0x79')],{'as':_0xdeef('0x79'),'foreignKey':_0xdeef('0x175')});db['CmList'][_0xdeef('0x121')](db[_0xdeef('0x1a')],{'as':_0xdeef('0x1f0'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xdeef('0x112')](db[_0xdeef('0x17')],{'as':_0xdeef('0x1a6'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0xf2')][_0xdeef('0x121')](db['User'],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x109')});db['VoicePrefix'][_0xdeef('0x121')](db[_0xdeef('0xde')],{'through':_0xdeef('0x107'),'as':_0xdeef('0x14e')});db[_0xdeef('0xf3')][_0xdeef('0x112')](db['User'],{'as':_0xdeef('0x18c'),'foreignKey':_0xdeef('0x120')});db['UserProfile']['hasMany'](db[_0xdeef('0xf4')],{'as':_0xdeef('0x1f1'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0xdeef('0xf4')]['hasMany'](db['UserProfileResource'],{'as':_0xdeef('0x1f2'),'foreignKey':'sectionId','onDelete':_0xdeef('0x111')});db[_0xdeef('0xf9')]['hasMany'](db[_0xdeef('0x177')],{'as':_0xdeef('0x178'),'foreignKey':_0xdeef('0x1f3'),'onDelete':_0xdeef('0x111')});db[_0xdeef('0xf9')][_0xdeef('0x112')](db[_0xdeef('0x15e')],{'as':_0xdeef('0x15f'),'foreignKey':_0xdeef('0x1f3')});db[_0xdeef('0xf9')][_0xdeef('0x112')](db[_0xdeef('0xfd')],{'as':_0xdeef('0x161'),'foreignKey':_0xdeef('0x1f3')});db[_0xdeef('0xf9')]['hasMany'](db[_0xdeef('0x11b')],{'as':_0xdeef('0x17a')});db['WhatsappAccount'][_0xdeef('0x112')](db[_0xdeef('0xfa')],{'as':'Applications'});db[_0xdeef('0xf9')][_0xdeef('0x11f')](db['CmList'],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0xf9')][_0xdeef('0x11f')](db['Pause'],{'as':_0xdeef('0x164'),'foreignKey':_0xdeef('0x14b')});db[_0xdeef('0xf9')][_0xdeef('0x121')](db['User'],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x13b')});db[_0xdeef('0xfa')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'onDelete':_0xdeef('0x15a')});db[_0xdeef('0xfa')][_0xdeef('0x11f')](db[_0xdeef('0x101')],{'onDelete':'restrict'});db[_0xdeef('0xfa')][_0xdeef('0x11f')](db[_0xdeef('0xf9')],{'onDelete':'restrict'});db[_0xdeef('0xfa')][_0xdeef('0x11f')](db[_0xdeef('0x14a')],{'onDelete':_0xdeef('0x15a'),'foreignKey':_0xdeef('0x172')});db[_0xdeef('0xfa')][_0xdeef('0x11f')](db[_0xdeef('0x88')],{'onDelete':_0xdeef('0x15a'),'foreignKey':'TagId'});db[_0xdeef('0x11b')][_0xdeef('0x112')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xdeef('0x111'),'foreignKey':_0xdeef('0x1f4')});db[_0xdeef('0x11b')][_0xdeef('0x11f')](db['WhatsappAccount'],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1f3')});db[_0xdeef('0x11b')][_0xdeef('0x11f')](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':'ContactId'});db[_0xdeef('0x11b')][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x169'),'foreignKey':'UserId'});db[_0xdeef('0x11b')][_0xdeef('0x121')](db['Tag'],{'through':_0xdeef('0x1f5'),'as':'Tags'});db[_0xdeef('0x11b')][_0xdeef('0x121')](db['Tag'],{'through':_0xdeef('0x1f5'),'as':_0xdeef('0x16c')});db[_0xdeef('0x11b')]['belongsToMany'](db['User'],{'as':_0xdeef('0x18c'),'through':_0xdeef('0x1f6'),'foreignKey':_0xdeef('0x1f4')});db[_0xdeef('0xfd')]['belongsTo'](db[_0xdeef('0x10d')],{'as':_0xdeef('0x10d')});db[_0xdeef('0xfd')][_0xdeef('0x11f')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xdeef('0xfd')][_0xdeef('0x11f')](db[_0xdeef('0x11b')],{'onDelete':'cascade','as':_0xdeef('0x16e'),'foreignKey':_0xdeef('0x1f4')});db['WhatsappMessage'][_0xdeef('0x11f')](db[_0xdeef('0xf9')],{'as':_0xdeef('0x17e'),'foreignKey':_0xdeef('0x1f3')});db[_0xdeef('0xfe')][_0xdeef('0x11f')](db[_0xdeef('0xf9')],{});db[_0xdeef('0xfe')][_0xdeef('0x11f')](db['CmList'],{'as':_0xdeef('0x162'),'foreignKey':_0xdeef('0x175')});db[_0xdeef('0xfe')]['belongsTo'](db[_0xdeef('0x73')],{'as':_0xdeef('0x157'),'foreignKey':_0xdeef('0x158')});db['WhatsappQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x11b')],{});db[_0xdeef('0xfe')][_0xdeef('0x11f')](db[_0xdeef('0x101')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xdeef('0xfd')],{});db['WhatsappQueueReport'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{});db[_0xdeef('0xff')][_0xdeef('0x11f')](db[_0xdeef('0xfd')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xdeef('0x11b')],{});db[_0xdeef('0xff')][_0xdeef('0x11f')](db[_0xdeef('0xf9')],{'foreignKey':_0xdeef('0x1f7'),'as':_0xdeef('0x1da')});db['WhatsappTransferReport']['belongsTo'](db[_0xdeef('0xf9')],{'foreignKey':_0xdeef('0x1f8'),'as':'ToAccount'});db[_0xdeef('0xff')][_0xdeef('0x11f')](db[_0xdeef('0x101')],{'foreignKey':_0xdeef('0x1f9'),'as':_0xdeef('0x1e5')});db['WhatsappTransferReport']['belongsTo'](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e1'),'as':_0xdeef('0x1db')});db['WhatsappTransferReport']['belongsTo'](db[_0xdeef('0x10d')],{'foreignKey':_0xdeef('0x1e2'),'as':_0xdeef('0x1e3')});db[_0xdeef('0x101')][_0xdeef('0x121')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x14d'),'through':_0xdeef('0x3a'),'foreignKey':_0xdeef('0x1fa')});db[_0xdeef('0x101')][_0xdeef('0x121')](db['Team'],{'through':_0xdeef('0x1d1'),'as':_0xdeef('0x14e')});db['UserSetting'][_0xdeef('0x11f')](db[_0xdeef('0x10d')],{'as':_0xdeef('0x1fb'),'foreignKey':'UserId','onDelete':_0xdeef('0x111'),'hooks':!![]});db[_0xdeef('0x103')]['hasOne'](db[_0xdeef('0xbf')],{'as':_0xdeef('0xbf'),'onDelete':_0xdeef('0x15a')});db[_0xdeef('0x103')][_0xdeef('0x10e')](db[_0xdeef('0x3b')],{'as':'Imap','onDelete':_0xdeef('0x15a')});db['CloudProvider'][_0xdeef('0x10e')](db[_0xdeef('0x3d')],{'as':_0xdeef('0x15d'),'onDelete':_0xdeef('0x15a')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa57a=['../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueue','MailQueues','ChatQueues','UserFaxQueue','SmsQueues','UserSmsQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','VoiceQueue','Members','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackup','IntervalId','voice_queues_has_cm_lists','Teams','TeamVoiceQueue','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceMailMessage','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','MailServerIn','CloudProviderId','restrict','Smtp','Answers','Interactions','Applications','List','ListId','TemplateId','mandatoryDispositionPauseId','Agents','UserMailQueue','team_has_mail_queues','Account','Contact','mail_interaction_has_tags','Tags','Attachments','MailInteractionId','ChatOfflineMessageId','TagId','MailQueueReport','Items','FaxAccount','Dispositions','FaxAccountId','FaxApplication','Exntensions','Owner','fax_interaction_has_tags','ThroughTags','Users','FaxInteractionId','Interaction','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Company','cm_contact_has_tags','OwnerId','All','OneAll','Any','OneAny','Action','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','VoiceMusicOnHold','whatsapp_interaction_has_tags','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','CustomReportId','AnalyticDefaultReport','MetricId','Configurations','AccountId','Descriptions','DescriptionId','FieldId','SubjectId','Description','Field','Variable','VariableId','Subjects','Subject','FreshdeskAccount','Dynamics365Account','Dynamics365Field','ToId','JscriptyQuestionReport','JscriptyAnswerReport','SessionId','JscriptyProject','ProjectId','user_has_teams','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','VoicePrefixes','CampaignId','TrunkBackupId','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromUserId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','UserProfileResource','Resources','sectionId','WhatsappAccountId','mandatoryDispositionPause','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','mysql','utf8mb4','name','utf8','utf8_general_ci','motion2','xC@LL1234','127.0.0.1','database','username','password','options','sequelizeHistory','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','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','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xa57a,0xfc));var _0xaa57=function(_0x50b54b,_0xba911d){_0x50b54b=_0x50b54b-0x0;var _0x1859c1=_0xa57a[_0x50b54b];return _0x1859c1;};'use strict';var config=require(_0xaa57('0x0'));var Sequelize=require(_0xaa57('0x1'));var _=require(_0xaa57('0x2'));var jstz=require(_0xaa57('0x3'));var timezone=jstz[_0xaa57('0x4')]();config['sequelize']=_[_0xaa57('0x5')](config[_0xaa57('0x1')],{'database':'motion2','username':_0xaa57('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xaa57('0x7'),'dialectOptions':{'charset':_0xaa57('0x8')},'logging':![],'timezone':timezone[_0xaa57('0x9')](),'define':{'charset':_0xaa57('0xa'),'collate':_0xaa57('0xb')}}});config['sequelizeHistory']=_[_0xaa57('0x5')](config['sequelizeHistory'],{'database':_0xaa57('0xc'),'username':_0xaa57('0x6'),'password':_0xaa57('0xd'),'options':{'host':_0xaa57('0xe'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xaa57('0x8')},'logging':![],'timezone':timezone[_0xaa57('0x9')](),'define':{'charset':'utf8','collate':_0xaa57('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaa57('0x1')][_0xaa57('0xf')],config[_0xaa57('0x1')][_0xaa57('0x10')],config[_0xaa57('0x1')][_0xaa57('0x11')],config[_0xaa57('0x1')][_0xaa57('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaa57('0x13')][_0xaa57('0xf')],config['sequelizeHistory'][_0xaa57('0x10')],config[_0xaa57('0x13')][_0xaa57('0x11')],config[_0xaa57('0x13')][_0xaa57('0x12')])};db[_0xaa57('0x14')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x16'));db[_0xaa57('0x17')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x18'));db[_0xaa57('0x19')]=db['sequelize'][_0xaa57('0x15')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xaa57('0x1')]['import'](_0xaa57('0x1a'));db['VoiceMusicOnHold']=db[_0xaa57('0x1')]['import'](_0xaa57('0x1b'));db['VoiceQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x1c'));db[_0xaa57('0x1d')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x1e'));db[_0xaa57('0x1f')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x20'));db['VoiceMailMessage']=db['sequelize'][_0xaa57('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xaa57('0x21')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x22'));db[_0xaa57('0x23')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x24'));db[_0xaa57('0x25')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x26'));db[_0xaa57('0x27')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x28'));db[_0xaa57('0x29')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x2a'));db[_0xaa57('0x2b')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x2c'));db[_0xaa57('0x2d')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x2e'));db[_0xaa57('0x2f')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xaa57('0x30')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xaa57('0x31')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x32'));db['UserMailQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x33'));db['UserFaxQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x34'));db['UserSmsQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x35'));db[_0xaa57('0x36')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x37'));db[_0xaa57('0x38')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x39'));db['MailServerIn']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x3a'));db[_0xaa57('0x3b')]=db['sequelize'][_0xaa57('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0xaa57('0x3c')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x3d'));db['MailQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/mailQueue/mailQueue.model');db[_0xaa57('0x3e')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x3f'));db[_0xaa57('0x40')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x41'));db[_0xaa57('0x42')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x43'));db[_0xaa57('0x44')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x45'));db['MailQueueReport']=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x46'));db['DashboardItem']=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x47'));db['FaxAccount']=db[_0xaa57('0x1')]['import'](_0xaa57('0x48'));db['FaxApplication']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x49'));db[_0xaa57('0x4a')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x4b'));db[_0xaa57('0x4c')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x4d'));db[_0xaa57('0x4e')]=db['sequelize']['import'](_0xaa57('0x4f'));db[_0xaa57('0x50')]=db['sequelize']['import'](_0xaa57('0x51'));db[_0xaa57('0x52')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x53'));db[_0xaa57('0x54')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/smsApplication/smsApplication.model');db[_0xaa57('0x55')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x56'));db[_0xaa57('0x57')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x58'));db[_0xaa57('0x59')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x5a'));db[_0xaa57('0x5b')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x5c'));db[_0xaa57('0x5d')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x5e'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xaa57('0x5f'));db[_0xaa57('0x60')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0xaa57('0x61')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xaa57('0x62')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x63'));db[_0xaa57('0x64')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x65'));db[_0xaa57('0x66')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/chatInteraction/chatInteraction.model');db[_0xaa57('0x67')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x68'));db[_0xaa57('0x69')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x6a'));db[_0xaa57('0x6b')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0xaa57('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0xaa57('0x6c')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x6d'));db[_0xaa57('0x6e')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x6f'));db[_0xaa57('0x70')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x71'));db[_0xaa57('0x72')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/cmHopper/cmHopper.model');db[_0xaa57('0x73')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x74'));db[_0xaa57('0x75')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xaa57('0x76')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x77'));db[_0xaa57('0x78')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xaa57('0x79')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x7a'));db['Action']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x7b'));db[_0xaa57('0x7c')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x7d'));db[_0xaa57('0x7e')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0xaa57('0x7f')]=db['sequelize']['import']('../api/disposition/disposition.model');db[_0xaa57('0x80')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x81'));db[_0xaa57('0x82')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x83'));db[_0xaa57('0x84')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x85'));db[_0xaa57('0x86')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x87'));db['VoiceQueuesLog']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x88'));db[_0xaa57('0x89')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/schedule/schedule.model');db[_0xaa57('0x8a')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x8b'));db[_0xaa57('0x8c')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x8d'));db[_0xaa57('0x8e')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x8f'));db[_0xaa57('0x90')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x91'));db['Variable']=db[_0xaa57('0x1')]['import']('../api/variable/variable.model');db[_0xaa57('0x92')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x93'));db[_0xaa57('0x94')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x95'));db[_0xaa57('0x96')]=db[_0xaa57('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xaa57('0x97')]=db['sequelize']['import'](_0xaa57('0x98'));db[_0xaa57('0x99')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x9a'));db[_0xaa57('0x9b')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x9c'));db[_0xaa57('0x9d')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x9e'));db[_0xaa57('0x9f')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xa0'));db[_0xaa57('0xa1')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xa2'));db[_0xaa57('0xa3')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xa4'));db[_0xaa57('0xa5')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xaa57('0xa6')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xa7'));db[_0xaa57('0xa8')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xa9'));db[_0xaa57('0xaa')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xab'));db[_0xaa57('0xac')]=db[_0xaa57('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xaa57('0xad')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xae'));db[_0xaa57('0xaf')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xb0'));db[_0xaa57('0xb1')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xb2'));db[_0xaa57('0xb3')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xb4'));db[_0xaa57('0xb5')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xaa57('0xb6')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xb7'));db[_0xaa57('0xb8')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xb9'));db['FreshdeskAccount']=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xba'));db[_0xaa57('0xbb')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xbc'));db[_0xaa57('0xbd')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xaa57('0xbe')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xbf'));db[_0xaa57('0xc0')]=db['sequelize']['import'](_0xaa57('0xc1'));db[_0xaa57('0xc2')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xc3'));db[_0xaa57('0xc4')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xc5'));db[_0xaa57('0xc6')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xc7'));db[_0xaa57('0xc8')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xc9'));db[_0xaa57('0xca')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xcb'));db['Dynamics365Field']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xcc'));db[_0xaa57('0xcd')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xce'));db[_0xaa57('0xcf')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xd0'));db[_0xaa57('0xd1')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/integration/integration.model');db[_0xaa57('0xd2')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xd3'));db[_0xaa57('0xd4')]=db['sequelize']['import'](_0xaa57('0xd5'));db[_0xaa57('0xd6')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xd7'));db['JscriptyAnswerReport']=db[_0xaa57('0x1')]['import'](_0xaa57('0xd8'));db['JscriptyQuestionReport']=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xd9'));db['JscriptySessionReport']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xda'));db[_0xaa57('0xdb')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xdc'));db['SquareReport']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xdd'));db[_0xaa57('0xde')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xdf'));db['JscriptyProject']=db[_0xaa57('0x1')]['import'](_0xaa57('0xe0'));db[_0xaa57('0xe1')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/setting/setting.model');db[_0xaa57('0xe2')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xe3'));db[_0xaa57('0xe4')]=db['sequelize'][_0xaa57('0x15')]('../api/squareProject/squareProject.model');db[_0xaa57('0xe5')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xe6'));db[_0xaa57('0xe7')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xe8'));db[_0xaa57('0xe9')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xea'));db['License']=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xeb'));db[_0xaa57('0xec')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xed'));db[_0xaa57('0xee')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xef'));db[_0xaa57('0xf0')]=db['sequelize'][_0xaa57('0x15')]('../api/attachment/attachment.model');db[_0xaa57('0xf1')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xf2'));db['MailTransferReport']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0xf3'));db[_0xaa57('0xf4')]=db[_0xaa57('0x1')][_0xaa57('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xaa57('0xf5')]=db[_0xaa57('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0xaa57('0xf6')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xf7'));db[_0xaa57('0xf8')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xf9'));db[_0xaa57('0xfa')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xfb'));db[_0xaa57('0xfc')]=db[_0xaa57('0x1')]['import'](_0xaa57('0xfd'));db['UserProfile']=db['sequelize'][_0xaa57('0x15')](_0xaa57('0xfe'));db[_0xaa57('0xff')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x100'));db['UserProfileResource']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x101'));db['UserNotification']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x102'));db[_0xaa57('0x103')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x104'));db[_0xaa57('0x105')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x106'));db[_0xaa57('0x107')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x108'));db[_0xaa57('0x109')]=db['sequelize'][_0xaa57('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0xaa57('0x10a')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x10b'));db['WhatsappTransferReport']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x10c'));db['WhatsappQueue']=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x10d'));db[_0xaa57('0x10e')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x10f'));db['TeamVoiceQueue']=db[_0xaa57('0x1')]['import'](_0xaa57('0x110'));db[_0xaa57('0x111')]=db[_0xaa57('0x1')]['import'](_0xaa57('0x112'));db[_0xaa57('0x113')]=db['sequelize'][_0xaa57('0x15')](_0xaa57('0x114'));db[_0xaa57('0x115')]=db[_0xaa57('0x1')][_0xaa57('0x15')](_0xaa57('0x116'));db['User'][_0xaa57('0x117')](db[_0xaa57('0x118')],{'as':'VoiceMail','onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x117')](db[_0xaa57('0x115')],{'as':'userSetting','onDelete':'cascade','foreignKey':'UserId'});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x1d')],{'as':_0xaa57('0x11c'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x2f')],{'as':_0xaa57('0x11d'),'foreignKey':_0xaa57('0x11a')});db['User'][_0xaa57('0x11b')](db[_0xaa57('0x11e')],{'as':_0xaa57('0x11f'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x75')],{'as':_0xaa57('0x120'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x76')],{'as':'HopperHistory','foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x121')],{'as':_0xaa57('0x122'),'foreignKey':_0xaa57('0x11a')});db['User'][_0xaa57('0x11b')](db['ChatInteraction'],{'as':_0xaa57('0x123'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')]['hasMany'](db['SmsInteraction'],{'as':_0xaa57('0x124'),'foreignKey':_0xaa57('0x11a')});db['User'][_0xaa57('0x11b')](db[_0xaa57('0x4a')],{'as':_0xaa57('0x125'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x40')],{'as':_0xaa57('0x126'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x14')][_0xaa57('0x11b')](db[_0xaa57('0x107')],{'as':_0xaa57('0x127'),'foreignKey':'UserId'});db[_0xaa57('0x14')]['hasMany'](db[_0xaa57('0x128')],{'as':_0xaa57('0x129'),'foreignKey':'SenderId'});db[_0xaa57('0x14')][_0xaa57('0x12a')](db[_0xaa57('0x12b')],{'as':_0xaa57('0x12b'),'foreignKey':_0xaa57('0x12c')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x12e')],{'as':_0xaa57('0x12f'),'through':_0xaa57('0x130')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x70')],{'as':_0xaa57('0x131'),'through':_0xaa57('0x132')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x133'),'through':_0xaa57('0x134')});db[_0xaa57('0x14')]['belongsToMany'](db[_0xaa57('0xe9')],{'through':'user_has_teams'});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x40')],{'as':_0xaa57('0x126'),'through':_0xaa57('0x135')});db['User'][_0xaa57('0x12d')](db['ChatInteraction'],{'as':_0xaa57('0x123'),'through':_0xaa57('0x136')});db['User']['belongsToMany'](db[_0xaa57('0x4a')],{'as':_0xaa57('0x125'),'through':_0xaa57('0x137')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x55')],{'as':_0xaa57('0x124'),'through':'user_has_sms_interactions'});db['User']['belongsToMany'](db[_0xaa57('0x121')],{'as':'OpenchannelInteractions','through':_0xaa57('0x138')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x107')],{'as':_0xaa57('0x127'),'through':_0xaa57('0x139')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xaa57('0x30'),'required':![]});db['User']['belongsToMany'](db[_0xaa57('0xfc')],{'as':'VoicePrefixes','through':_0xaa57('0x113'),'required':![]});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x13a')],{'as':_0xaa57('0x13b'),'through':'UserMailQueue','required':![]});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x6b')],{'as':_0xaa57('0x13c'),'through':_0xaa57('0x31'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xaa57('0x4e')],{'as':'FaxQueues','through':_0xaa57('0x13d'),'required':![]});db[_0xaa57('0x14')]['belongsToMany'](db[_0xaa57('0x59')],{'as':_0xaa57('0x13e'),'through':_0xaa57('0x13f'),'required':![]});db[_0xaa57('0x14')]['belongsToMany'](db[_0xaa57('0x140')],{'as':_0xaa57('0x141'),'through':_0xaa57('0x36'),'required':![]});db[_0xaa57('0x14')]['belongsToMany'](db[_0xaa57('0x142')],{'as':_0xaa57('0x143'),'through':_0xaa57('0x38'),'required':![]});db[_0xaa57('0x14')][_0xaa57('0x12d')](db['CmList'],{'through':_0xaa57('0x134')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x61')],{'as':_0xaa57('0x144'),'through':_0xaa57('0x145')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db['FaxAccount'],{'as':_0xaa57('0x146'),'through':_0xaa57('0x147')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x3c')],{'as':_0xaa57('0x148'),'through':_0xaa57('0x149')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x5b')],{'as':'OpenchannelAccounts','through':_0xaa57('0x14a')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db['SmsAccount'],{'as':_0xaa57('0x14b'),'through':'user_has_sms_accounts'});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0x103')],{'as':_0xaa57('0x14c'),'through':_0xaa57('0x14d')});db[_0xaa57('0x14')][_0xaa57('0x12d')](db[_0xaa57('0xe4')],{'as':'SquareProjects','through':_0xaa57('0x14e')});db[_0xaa57('0x17')]['hasMany'](db[_0xaa57('0x11e')],{'as':_0xaa57('0x14f'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x150')});db[_0xaa57('0x19')][_0xaa57('0x11b')](db[_0xaa57('0x11e')],{'onDelete':'cascade'});db[_0xaa57('0x11e')][_0xaa57('0x11b')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0xaa57('0x12d')](db['Sound'],{'as':_0xaa57('0x151'),'through':_0xaa57('0x152')});db[_0xaa57('0x153')]['hasMany'](db[_0xaa57('0x2f')],{'as':_0xaa57('0x154'),'foreignKey':'VoiceQueueId'});db[_0xaa57('0x153')]['hasMany'](db[_0xaa57('0x72')],{'as':_0xaa57('0x155'),'foreignKey':_0xaa57('0x156')});db[_0xaa57('0x153')][_0xaa57('0x11b')](db[_0xaa57('0x75')],{'as':_0xaa57('0x120'),'foreignKey':_0xaa57('0x156')});db[_0xaa57('0x153')][_0xaa57('0x11b')](db['CmHopperHistory'],{'as':_0xaa57('0x157'),'foreignKey':_0xaa57('0x156')});db['VoiceQueue'][_0xaa57('0x11b')](db[_0xaa57('0x78')],{'as':_0xaa57('0x78'),'foreignKey':_0xaa57('0x156')});db[_0xaa57('0x153')][_0xaa57('0x11b')](db[_0xaa57('0x73')],{'as':_0xaa57('0x158'),'foreignKey':_0xaa57('0x156')});db['VoiceQueue'][_0xaa57('0x11b')](db[_0xaa57('0x159')],{'as':'JscriptySessions','foreignKey':_0xaa57('0x156')});db['VoiceQueue'][_0xaa57('0x12a')](db[_0xaa57('0x2b')],{'as':_0xaa57('0x2b'),'foreignKey':_0xaa57('0x15a')});db[_0xaa57('0x153')][_0xaa57('0x12a')](db['Trunk'],{'as':_0xaa57('0x15b'),'foreignKey':'TrunkBackupId'});db[_0xaa57('0x153')][_0xaa57('0x12a')](db[_0xaa57('0x82')],{'as':_0xaa57('0x82'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x153')][_0xaa57('0x12a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xaa57('0x153')][_0xaa57('0x12d')](db[_0xaa57('0xfa')],{'as':'Lists','through':_0xaa57('0x15d')});db['VoiceQueue'][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':'Agents','through':_0xaa57('0x30')});db['VoiceQueue'][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'as':_0xaa57('0x15e'),'through':_0xaa57('0x15f')});db[_0xaa57('0x153')][_0xaa57('0x12d')](db[_0xaa57('0xfa')],{'as':'BlackLists','through':_0xaa57('0x160')});db['VoiceRecording'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x14'),'foreignKey':_0xaa57('0x11a')});db['ScreenRecording'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':'User','foreignKey':_0xaa57('0x11a')});db['VoiceMail'][_0xaa57('0x11b')](db['VoiceMailMessage'],{'as':_0xaa57('0x161'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x162'),'sourceKey':_0xaa57('0x163')});db[_0xaa57('0x164')]['belongsTo'](db[_0xaa57('0x118')],{'foreignKey':_0xaa57('0x162'),'targetKey':_0xaa57('0x163')});db[_0xaa57('0x21')][_0xaa57('0x11b')](db['VoiceQueueReport'],{'as':_0xaa57('0x165'),'foreignKey':_0xaa57('0x166'),'constraints':![]});db['VoiceCallReport'][_0xaa57('0x11b')](db[_0xaa57('0x25')],{'as':_0xaa57('0x167'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xaa57('0x14')],{'as':_0xaa57('0x14'),'foreignKey':_0xaa57('0x11a')});db['VoiceCallReport']['belongsTo'](db[_0xaa57('0x70')],{'as':'Contact','foreignKey':_0xaa57('0x168')});db['MailServerIn'][_0xaa57('0x12a')](db[_0xaa57('0x3c')],{'as':_0xaa57('0x3c'),'foreignKey':_0xaa57('0x169')});db[_0xaa57('0x16a')]['belongsTo'](db[_0xaa57('0x10e')],{'as':'CloudProvider','foreignKey':_0xaa57('0x16b'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x3b')][_0xaa57('0x12a')](db[_0xaa57('0x3c')],{'as':_0xaa57('0x3c'),'foreignKey':_0xaa57('0x169')});db[_0xaa57('0x3b')][_0xaa57('0x12a')](db[_0xaa57('0x10e')],{'as':_0xaa57('0x10e'),'foreignKey':_0xaa57('0x16b'),'onDelete':_0xaa57('0x16c')});db['MailAccount'][_0xaa57('0x117')](db['MailServerIn'],{'as':'Imap','onDelete':'cascade'});db[_0xaa57('0x3c')][_0xaa57('0x117')](db[_0xaa57('0x3b')],{'as':_0xaa57('0x16d'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x3c')][_0xaa57('0x11b')](db[_0xaa57('0x7f')],{'as':'Dispositions','foreignKey':_0xaa57('0x169'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x3c')][_0xaa57('0x11b')](db[_0xaa57('0x7e')],{'as':_0xaa57('0x16e'),'foreignKey':_0xaa57('0x169')});db[_0xaa57('0x3c')][_0xaa57('0x11b')](db['MailMessage'],{'as':_0xaa57('0x161'),'foreignKey':_0xaa57('0x169')});db[_0xaa57('0x3c')][_0xaa57('0x11b')](db[_0xaa57('0x40')],{'as':_0xaa57('0x16f')});db[_0xaa57('0x3c')]['hasMany'](db[_0xaa57('0x44')],{'as':_0xaa57('0x170')});db[_0xaa57('0x3c')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172')});db[_0xaa57('0x3c')]['belongsTo'](db[_0xaa57('0x8e')],{'as':_0xaa57('0x8e'),'foreignKey':_0xaa57('0x173')});db[_0xaa57('0x3c')][_0xaa57('0x12a')](db[_0xaa57('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xaa57('0x174')});db['MailAccount']['belongsToMany'](db['User'],{'as':_0xaa57('0x175'),'through':_0xaa57('0x149')});db['MailQueue'][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':'Agents','through':_0xaa57('0x176')});db[_0xaa57('0x13a')][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'through':_0xaa57('0x177'),'as':_0xaa57('0x15e')});db['MailInteraction'][_0xaa57('0x11b')](db[_0xaa57('0x42')],{'as':_0xaa57('0x161'),'onDelete':_0xaa57('0x119'),'foreignKey':'MailInteractionId'});db[_0xaa57('0x40')][_0xaa57('0x12a')](db['MailAccount'],{'as':_0xaa57('0x178'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x40')]['belongsTo'](db[_0xaa57('0x14')],{'as':'Owner','foreignKey':'UserId'});db['MailInteraction'][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x17a'),'as':_0xaa57('0x17b')});db[_0xaa57('0x40')][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x17a'),'as':'ThroughTags'});db[_0xaa57('0x40')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':'Users','through':_0xaa57('0x135'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xaa57('0x11b')](db[_0xaa57('0xf0')],{'as':_0xaa57('0x17c'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x42')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x14')});db[_0xaa57('0x42')]['belongsTo'](db[_0xaa57('0x70')],{'onDelete':'cascade','as':_0xaa57('0x179')});db['MailMessage'][_0xaa57('0x12a')](db[_0xaa57('0x40')],{'as':'Interaction','foreignKey':_0xaa57('0x17d')});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0xaa57('0x42')][_0xaa57('0x12a')](db[_0xaa57('0x61')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0xaa57('0x42')][_0xaa57('0x12a')](db[_0xaa57('0x69')],{'as':_0xaa57('0x69'),'foreignKey':_0xaa57('0x17e')});db[_0xaa57('0x44')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':'restrict'});db[_0xaa57('0x44')][_0xaa57('0x12a')](db[_0xaa57('0x13a')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x44')][_0xaa57('0x12a')](db[_0xaa57('0x3c')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x44')][_0xaa57('0x12a')](db[_0xaa57('0x82')],{'onDelete':_0xaa57('0x16c'),'foreignKey':'IntervalId'});db[_0xaa57('0x44')][_0xaa57('0x12a')](db['Tag'],{'onDelete':_0xaa57('0x16c'),'foreignKey':_0xaa57('0x17f')});db[_0xaa57('0x180')]['belongsTo'](db[_0xaa57('0x3c')],{});db[_0xaa57('0x180')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':'ListId'});db[_0xaa57('0x180')][_0xaa57('0x12a')](db['CmContact'],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x180')][_0xaa57('0x12a')](db[_0xaa57('0x40')],{});db[_0xaa57('0x180')][_0xaa57('0x12a')](db['MailMessage'],{});db[_0xaa57('0x180')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{});db[_0xaa57('0x180')][_0xaa57('0x12a')](db[_0xaa57('0x13a')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0xaa57('0x181'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x182')][_0xaa57('0x11b')](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':_0xaa57('0x184'),'onDelete':'cascade'});db[_0xaa57('0x182')]['hasMany'](db[_0xaa57('0x7e')],{'as':_0xaa57('0x16e'),'foreignKey':_0xaa57('0x184')});db['FaxAccount']['hasMany'](db['FaxInteraction'],{'as':_0xaa57('0x16f')});db[_0xaa57('0x182')]['hasMany'](db[_0xaa57('0x185')],{'as':_0xaa57('0x170')});db[_0xaa57('0x182')]['hasMany'](db[_0xaa57('0x11e')],{'as':_0xaa57('0x186'),'onDelete':_0xaa57('0x119')});db['FaxAccount']['hasMany'](db[_0xaa57('0x4c')],{'as':_0xaa57('0x161')});db[_0xaa57('0x182')][_0xaa57('0x12a')](db['Trunk'],{'as':'Trunk'});db[_0xaa57('0x182')][_0xaa57('0x12a')](db['CmList'],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172')});db[_0xaa57('0x182')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xaa57('0x174')});db[_0xaa57('0x182')][_0xaa57('0x12d')](db['User'],{'as':_0xaa57('0x175'),'through':_0xaa57('0x147')});db['FaxApplication']['belongsTo'](db[_0xaa57('0x14')],{'onDelete':'restrict'});db[_0xaa57('0x185')][_0xaa57('0x12a')](db[_0xaa57('0x4e')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x185')][_0xaa57('0x12a')](db[_0xaa57('0x182')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x185')]['belongsTo'](db[_0xaa57('0x8c')],{'onDelete':_0xaa57('0x16c'),'foreignKey':'TagId'});db[_0xaa57('0x4a')][_0xaa57('0x11b')](db[_0xaa57('0x4c')],{'as':_0xaa57('0x161'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0xaa57('0x4a')][_0xaa57('0x12a')](db[_0xaa57('0x182')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x184')});db[_0xaa57('0x4a')]['belongsTo'](db[_0xaa57('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0xaa57('0x4a')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x187'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x4a')][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x188'),'as':_0xaa57('0x17b')});db[_0xaa57('0x4a')][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x188'),'as':_0xaa57('0x189')});db[_0xaa57('0x4a')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x18a'),'through':_0xaa57('0x137'),'foreignKey':_0xaa57('0x18b')});db[_0xaa57('0x4c')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':_0xaa57('0x119'),'as':'User'});db[_0xaa57('0x4c')][_0xaa57('0x12a')](db['FaxInteraction'],{'as':_0xaa57('0x18c'),'foreignKey':_0xaa57('0x18b')});db['FaxMessage'][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'onDelete':'cascade','as':_0xaa57('0x179')});db[_0xaa57('0x4c')][_0xaa57('0x12a')](db[_0xaa57('0xf0')],{'as':_0xaa57('0xf0'),'foreignKey':'AttachmentId'});db[_0xaa57('0x4c')][_0xaa57('0x12a')](db['FaxAccount'],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x184')});db[_0xaa57('0x4e')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':'UserFaxQueue'});db[_0xaa57('0x4e')][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'through':_0xaa57('0x18d'),'as':'Teams'});db[_0xaa57('0x50')][_0xaa57('0x12a')](db[_0xaa57('0x182')],{});db[_0xaa57('0x50')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':'List','foreignKey':_0xaa57('0x172')});db[_0xaa57('0x50')][_0xaa57('0x12a')](db['CmContact'],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x50')][_0xaa57('0x12a')](db['FaxInteraction'],{});db[_0xaa57('0x50')][_0xaa57('0x12a')](db[_0xaa57('0x4c')],{});db['FaxQueueReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{});db[_0xaa57('0x50')][_0xaa57('0x12a')](db[_0xaa57('0x4e')],{});db[_0xaa57('0x52')]['hasMany'](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':'SmsAccountId','onDelete':_0xaa57('0x119')});db[_0xaa57('0x52')]['hasMany'](db[_0xaa57('0x7e')],{'as':_0xaa57('0x16e'),'foreignKey':_0xaa57('0x18e')});db['SmsAccount']['hasMany'](db['SmsMessage'],{'as':_0xaa57('0x161'),'foreignKey':'SmsAccountId'});db[_0xaa57('0x52')][_0xaa57('0x11b')](db['SmsInteraction'],{'as':'Interactions'});db[_0xaa57('0x52')][_0xaa57('0x11b')](db[_0xaa57('0x54')],{'as':_0xaa57('0x170')});db[_0xaa57('0x52')]['belongsTo'](db[_0xaa57('0xfa')],{'as':'List','foreignKey':_0xaa57('0x172')});db[_0xaa57('0x52')][_0xaa57('0x12a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xaa57('0x174')});db['SmsAccount'][_0xaa57('0x12d')](db['User'],{'as':_0xaa57('0x175'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':_0xaa57('0x16c')});db['SmsApplication'][_0xaa57('0x12a')](db[_0xaa57('0x59')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x54')]['belongsTo'](db[_0xaa57('0x52')],{'onDelete':_0xaa57('0x16c')});db['SmsApplication']['belongsTo'](db['Interval'],{'onDelete':_0xaa57('0x16c'),'foreignKey':'IntervalId'});db[_0xaa57('0x54')]['belongsTo'](db[_0xaa57('0x8c')],{'onDelete':'restrict','foreignKey':_0xaa57('0x17f')});db[_0xaa57('0x55')][_0xaa57('0x11b')](db[_0xaa57('0x57')],{'as':_0xaa57('0x161'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x18f')});db[_0xaa57('0x55')]['belongsTo'](db[_0xaa57('0x52')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x18e')});db['SmsInteraction'][_0xaa57('0x12a')](db['CmContact'],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x55')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x187'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x55')][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x190'),'as':'Tags'});db[_0xaa57('0x55')][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x190'),'as':_0xaa57('0x189')});db[_0xaa57('0x55')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x18a'),'through':_0xaa57('0x191'),'foreignKey':_0xaa57('0x18f')});db[_0xaa57('0x57')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x14')});db['SmsMessage'][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x179')});db[_0xaa57('0x57')]['belongsTo'](db['SmsInteraction'],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x18c'),'foreignKey':_0xaa57('0x18f')});db['SmsMessage']['belongsTo'](db['SmsAccount'],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x18e')});db[_0xaa57('0x59')]['belongsToMany'](db['User'],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xaa57('0x192')});db[_0xaa57('0x59')][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'through':_0xaa57('0x193'),'as':_0xaa57('0x15e')});db['OpenchannelAccount'][_0xaa57('0x11b')](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':_0xaa57('0x194'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x5b')]['hasMany'](db[_0xaa57('0x7e')],{'as':_0xaa57('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0xaa57('0x5b')][_0xaa57('0x11b')](db[_0xaa57('0x121')],{'as':_0xaa57('0x16f'),'foreignKey':'OpenchannelAccountId'});db[_0xaa57('0x5b')]['hasMany'](db['OpenchannelMessage'],{'as':_0xaa57('0x161'),'foreignKey':_0xaa57('0x194')});db[_0xaa57('0x5b')][_0xaa57('0x11b')](db['OpenchannelApplication'],{'as':_0xaa57('0x170'),'foreignKey':_0xaa57('0x194')});db[_0xaa57('0x5b')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172')});db[_0xaa57('0x5b')][_0xaa57('0x12a')](db[_0xaa57('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xaa57('0x174')});db[_0xaa57('0x5b')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':_0xaa57('0x14a')});db[_0xaa57('0x5d')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x5d')][_0xaa57('0x12a')](db[_0xaa57('0x140')],{'onDelete':_0xaa57('0x16c'),'foreignKey':_0xaa57('0x195')});db[_0xaa57('0x5d')][_0xaa57('0x12a')](db[_0xaa57('0x5b')],{'onDelete':_0xaa57('0x16c'),'foreignKey':_0xaa57('0x194')});db['OpenchannelApplication'][_0xaa57('0x12a')](db[_0xaa57('0x82')],{'onDelete':_0xaa57('0x16c'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x5d')][_0xaa57('0x12a')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xaa57('0x17f')});db[_0xaa57('0x121')]['hasMany'](db['OpenchannelMessage'],{'as':_0xaa57('0x161'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x196')});db[_0xaa57('0x121')][_0xaa57('0x12a')](db[_0xaa57('0x5b')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x194')});db[_0xaa57('0x121')][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x121')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x187'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x121')]['belongsToMany'](db['Tag'],{'through':_0xaa57('0x197'),'as':_0xaa57('0x17b')});db['OpenchannelInteraction']['belongsToMany'](db[_0xaa57('0x8c')],{'through':_0xaa57('0x197'),'as':_0xaa57('0x189')});db[_0xaa57('0x121')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x18a'),'through':'user_has_openchannel_interactions','foreignKey':_0xaa57('0x196')});db['OpenchannelMessage'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':_0xaa57('0x119'),'as':'User'});db['OpenchannelMessage'][_0xaa57('0x12a')](db['CmContact'],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x179')});db[_0xaa57('0x60')]['belongsTo'](db[_0xaa57('0x121')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x18c'),'foreignKey':_0xaa57('0x196')});db['OpenchannelMessage']['belongsTo'](db[_0xaa57('0xf0')],{'as':'Attachment','foreignKey':_0xaa57('0x198')});db['OpenchannelMessage'][_0xaa57('0x12a')](db[_0xaa57('0x5b')],{'as':_0xaa57('0x178'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':_0xaa57('0x36'),'foreignKey':_0xaa57('0x195')});db[_0xaa57('0x140')]['belongsToMany'](db['Team'],{'through':'team_has_openchannel_queues','as':_0xaa57('0x15e')});db[_0xaa57('0x61')]['hasMany'](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':_0xaa57('0x199'),'onDelete':'cascade'});db[_0xaa57('0x61')][_0xaa57('0x11b')](db[_0xaa57('0x7e')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xaa57('0x61')][_0xaa57('0x11b')](db[_0xaa57('0x6c')],{'as':_0xaa57('0x19a')});db[_0xaa57('0x61')][_0xaa57('0x11b')](db[_0xaa57('0x66')],{'as':_0xaa57('0x16f')});db[_0xaa57('0x61')]['hasMany'](db['ChatApplication'],{'as':_0xaa57('0x170')});db[_0xaa57('0x61')][_0xaa57('0x11b')](db[_0xaa57('0x67')],{'as':_0xaa57('0x161')});db[_0xaa57('0x61')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':'List','foreignKey':_0xaa57('0x172')});db[_0xaa57('0x61')]['belongsTo'](db[_0xaa57('0x82')],{'as':_0xaa57('0x82'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x61')]['belongsTo'](db[_0xaa57('0x3c')],{'as':_0xaa57('0x3c'),'foreignKey':_0xaa57('0x169')});db[_0xaa57('0x61')][_0xaa57('0x12a')](db[_0xaa57('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xaa57('0x174')});db[_0xaa57('0x61')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':_0xaa57('0x145')});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0x5b')],{});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':'ContactId'});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0x121')],{});db[_0xaa57('0x62')][_0xaa57('0x12a')](db['OpenchannelMessage'],{});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{});db[_0xaa57('0x62')][_0xaa57('0x12a')](db[_0xaa57('0x140')],{});db['ChatApplication']['belongsTo'](db['User'],{'as':_0xaa57('0x19b'),'foreignKey':_0xaa57('0x11a'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x64')][_0xaa57('0x12a')](db[_0xaa57('0x6b')],{'as':_0xaa57('0x19c'),'foreignKey':_0xaa57('0x19d'),'onDelete':'restrict'});db[_0xaa57('0x64')]['belongsTo'](db[_0xaa57('0x61')],{'as':_0xaa57('0x19e'),'foreignKey':_0xaa57('0x199'),'onDelete':'restrict'});db[_0xaa57('0x64')][_0xaa57('0x12a')](db[_0xaa57('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xaa57('0x66')][_0xaa57('0x11b')](db[_0xaa57('0x67')],{'as':'Messages','onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0xaa57('0x66')][_0xaa57('0x12a')](db['ChatWebsite'],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x199')});db[_0xaa57('0x66')]['belongsTo'](db[_0xaa57('0x70')],{'as':'Contact','foreignKey':_0xaa57('0x168')});db[_0xaa57('0x66')]['belongsTo'](db[_0xaa57('0x14')],{'as':_0xaa57('0x187'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x66')]['belongsToMany'](db[_0xaa57('0x8c')],{'through':_0xaa57('0x19f'),'as':_0xaa57('0x17b')});db[_0xaa57('0x66')][_0xaa57('0x12d')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xaa57('0x189')});db[_0xaa57('0x66')]['belongsToMany'](db[_0xaa57('0x14')],{'as':'Users','through':_0xaa57('0x136'),'foreignKey':_0xaa57('0x1a0')});db['ChatMessage'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x14')});db['ChatMessage'][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x67')][_0xaa57('0x12a')](db[_0xaa57('0x66')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x18c'),'foreignKey':_0xaa57('0x1a0')});db[_0xaa57('0x67')][_0xaa57('0x12a')](db['Attachment'],{'as':_0xaa57('0xf0'),'foreignKey':_0xaa57('0x198')});db['ChatMessage'][_0xaa57('0x12a')](db[_0xaa57('0x61')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x199')});db[_0xaa57('0x69')][_0xaa57('0x11b')](db[_0xaa57('0xf0')],{'as':'Attachments','foreignKey':_0xaa57('0x17e'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x69')][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'onDelete':_0xaa57('0x119'),'as':'Contact','foreignKey':_0xaa57('0x168')});db[_0xaa57('0x69')][_0xaa57('0x12a')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'through':_0xaa57('0x1a1'),'as':'Teams'});db['ChatGroup'][_0xaa57('0x11b')](db['ChatInternalMessage'],{'as':_0xaa57('0x161'),'foreignKey':_0xaa57('0x1a2'),'onDelete':'cascade'});db['ChatGroup'][_0xaa57('0x12d')](db['User'],{'as':_0xaa57('0x154'),'through':_0xaa57('0x130')});db['ChatProactiveAction'][_0xaa57('0x12a')](db[_0xaa57('0x61')],{'as':_0xaa57('0x19e'),'foreignKey':_0xaa57('0x199')});db['CmCompany'][_0xaa57('0x11b')](db[_0xaa57('0x70')],{'as':_0xaa57('0x131'),'foreignKey':'CompanyId'});db['CmContact'][_0xaa57('0x11b')](db[_0xaa57('0x72')],{'as':_0xaa57('0x155'),'foreignKey':_0xaa57('0x168')});db['CmContact'][_0xaa57('0x11b')](db[_0xaa57('0x75')],{'as':_0xaa57('0x120'),'foreignKey':'ContactId'});db['CmContact'][_0xaa57('0x11b')](db['CmHopperHistory'],{'as':_0xaa57('0x157'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db[_0xaa57('0x78')],{'as':_0xaa57('0x78'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db[_0xaa57('0x159')],{'as':'JscriptySessions','foreignKey':_0xaa57('0x168')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db[_0xaa57('0x121')],{'as':_0xaa57('0x122'),'foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x16c')});db['CmContact'][_0xaa57('0x11b')](db[_0xaa57('0x66')],{'as':_0xaa57('0x123'),'foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db[_0xaa57('0x55')],{'as':_0xaa57('0x124'),'foreignKey':'ContactId','onDelete':_0xaa57('0x16c')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db[_0xaa57('0x4a')],{'as':'FaxInteractions','foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x70')][_0xaa57('0x11b')](db['MailInteraction'],{'as':_0xaa57('0x126'),'foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x16c')});db['CmContact'][_0xaa57('0x12a')](db[_0xaa57('0x6e')],{'as':_0xaa57('0x1a3'),'foreignKey':'CompanyId'});db[_0xaa57('0x70')][_0xaa57('0x12a')](db['CmList'],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x70')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':_0xaa57('0x18a'),'through':_0xaa57('0x132')});db[_0xaa57('0x70')]['belongsToMany'](db[_0xaa57('0x8c')],{'as':'Tags','through':_0xaa57('0x1a4')});db[_0xaa57('0x70')]['belongsToMany'](db[_0xaa57('0x8c')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper'][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x72')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x72')]['belongsTo'](db[_0xaa57('0x14')],{'as':_0xaa57('0x19b'),'foreignKey':_0xaa57('0x11a')});db[_0xaa57('0x72')][_0xaa57('0x12a')](db[_0xaa57('0x153')],{'as':_0xaa57('0x19c'),'foreignKey':_0xaa57('0x156'),'onDelete':_0xaa57('0x119')});db['CmHopper'][_0xaa57('0x12a')](db[_0xaa57('0xec')],{'as':_0xaa57('0xec'),'foreignKey':'CampaignId','onDelete':_0xaa57('0x119')});db[_0xaa57('0x72')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':'Owner','foreignKey':_0xaa57('0x1a5')});db[_0xaa57('0x73')]['belongsTo'](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x73')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x73')][_0xaa57('0x12a')](db[_0xaa57('0x153')],{'as':_0xaa57('0x19c'),'foreignKey':_0xaa57('0x156'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x73')]['belongsTo'](db[_0xaa57('0xec')],{'as':_0xaa57('0xec'),'foreignKey':'CampaignId','onDelete':_0xaa57('0x119')});db[_0xaa57('0x7c')][_0xaa57('0x11b')](db[_0xaa57('0x80')],{'as':{'plural':_0xaa57('0x1a6'),'singular':_0xaa57('0x1a7')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xaa57('0x7c')][_0xaa57('0x11b')](db[_0xaa57('0x80')],{'as':{'plural':_0xaa57('0x1a8'),'singular':_0xaa57('0x1a9')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xaa57('0x7c')][_0xaa57('0x11b')](db[_0xaa57('0x1aa')],{'as':_0xaa57('0x1ab'),'foreignKey':_0xaa57('0x1ac'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db['Disposition'][_0xaa57('0x11b')](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':_0xaa57('0x1ad'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x82')][_0xaa57('0x11b')](db[_0xaa57('0x82')],{'as':_0xaa57('0x1ae'),'foreignKey':_0xaa57('0x15c'),'onDelete':_0xaa57('0x119'),'hooks':!![],'required':![]});db[_0xaa57('0x82')][_0xaa57('0x11b')](db[_0xaa57('0x11e')],{'as':_0xaa57('0x11f'),'foreignKey':_0xaa57('0x15c'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x82')][_0xaa57('0x11b')](db[_0xaa57('0x44')],{'as':_0xaa57('0x1af'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x82')]['hasMany'](db['ChatApplication'],{'as':_0xaa57('0x1b0'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x82')][_0xaa57('0x11b')](db[_0xaa57('0x185')],{'as':_0xaa57('0x1b1'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x82')]['hasMany'](db[_0xaa57('0x54')],{'as':_0xaa57('0x1b2'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0x89')][_0xaa57('0x12a')](db['MailAccount'],{});db[_0xaa57('0x89')][_0xaa57('0x12a')](db['AnalyticDefaultReport'],{'foreignKey':_0xaa57('0x1b3')});db[_0xaa57('0x89')][_0xaa57('0x12a')](db[_0xaa57('0x96')],{'foreignKey':'CustomReportId'});db[_0xaa57('0x8a')][_0xaa57('0x12d')](db[_0xaa57('0x1b4')],{'as':'Mohs','through':_0xaa57('0x152'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x8c')][_0xaa57('0x12d')](db[_0xaa57('0x70')],{'through':_0xaa57('0x1a4')});db[_0xaa57('0x8c')][_0xaa57('0x12d')](db[_0xaa57('0x66')],{'through':_0xaa57('0x19f')});db[_0xaa57('0x8c')]['belongsToMany'](db[_0xaa57('0x40')],{'through':_0xaa57('0x17a')});db[_0xaa57('0x8c')][_0xaa57('0x12d')](db[_0xaa57('0x55')],{'through':_0xaa57('0x190')});db[_0xaa57('0x8c')]['belongsToMany'](db[_0xaa57('0x4a')],{'through':_0xaa57('0x188')});db[_0xaa57('0x8c')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xaa57('0x8c')][_0xaa57('0x12d')](db['WhatsappInteraction'],{'through':_0xaa57('0x1b5')});db[_0xaa57('0x90')][_0xaa57('0x11b')](db[_0xaa57('0x80')],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xaa57('0x1b6'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x90')][_0xaa57('0x11b')](db['Condition'],{'as':{'plural':_0xaa57('0x1b7'),'singular':'AnyCondition'},'foreignKey':_0xaa57('0x1b8'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x90')][_0xaa57('0x11b')](db[_0xaa57('0x1aa')],{'as':_0xaa57('0x1ab'),'foreignKey':_0xaa57('0x1b9'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x96')][_0xaa57('0x11b')](db[_0xaa57('0x9b')],{'as':_0xaa57('0x1ba'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bb'),'hooks':!![]});db[_0xaa57('0x1bc')][_0xaa57('0x11b')](db[_0xaa57('0x9b')],{'as':_0xaa57('0x1ba'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1b3')});db[_0xaa57('0x99')][_0xaa57('0x11b')](db[_0xaa57('0x9b')],{'as':'Fields','onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bd')});db[_0xaa57('0x9b')][_0xaa57('0x12a')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xaa57('0x11b')](db['SalesforceConfiguration'],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xa1')]['hasMany'](db[_0xaa57('0xa3')],{'as':'Subjects','onDelete':_0xaa57('0x119'),'foreignKey':'SubjectId'});db[_0xaa57('0xa1')][_0xaa57('0x11b')](db['SalesforceField'],{'as':_0xaa57('0x1c0'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xa1')][_0xaa57('0x11b')](db[_0xaa57('0xa3')],{'as':_0xaa57('0x1ba'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xa1')][_0xaa57('0x12a')](db[_0xaa57('0x9f')],{'as':_0xaa57('0x178'),'foreignKey':'AccountId'});db[_0xaa57('0xa3')][_0xaa57('0x11b')](db[_0xaa57('0xa3')],{'as':'Subject','foreignKey':_0xaa57('0x1c3')});db['SalesforceField'][_0xaa57('0x11b')](db[_0xaa57('0xa3')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xa3')][_0xaa57('0x11b')](db['SalesforceField'],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xa3')][_0xaa57('0x12a')](db[_0xaa57('0x1c6')],{'as':_0xaa57('0x1c6'),'foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xa5')][_0xaa57('0x11b')](db[_0xaa57('0xa6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xa6')]['hasMany'](db[_0xaa57('0xa8')],{'as':_0xaa57('0x1c8'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xaa57('0xa6')][_0xaa57('0x11b')](db['SugarcrmField'],{'as':_0xaa57('0x1c0'),'onDelete':'cascade','foreignKey':_0xaa57('0x1c1')});db['SugarcrmConfiguration'][_0xaa57('0x11b')](db[_0xaa57('0xa8')],{'as':_0xaa57('0x1ba'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xa6')][_0xaa57('0x12a')](db[_0xaa57('0xa5')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xa8')][_0xaa57('0x11b')](db[_0xaa57('0xa8')],{'as':'Subject','foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xa8')][_0xaa57('0x11b')](db[_0xaa57('0xa8')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xa8')]['hasMany'](db[_0xaa57('0xa8')],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xa8')][_0xaa57('0x12a')](db[_0xaa57('0x1c6')],{'as':'Variable','foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xaa')]['hasMany'](db['DeskConfiguration'],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xac')]['hasMany'](db[_0xaa57('0xad')],{'as':_0xaa57('0x1c8'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xac')][_0xaa57('0x11b')](db[_0xaa57('0xad')],{'as':'Descriptions','onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xac')]['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xac')][_0xaa57('0x12a')](db[_0xaa57('0xaa')],{'as':'Account','foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xac')][_0xaa57('0x12d')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xaa57('0xad')]['hasMany'](db['DeskField'],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db['DeskField'][_0xaa57('0x11b')](db[_0xaa57('0xad')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db['DeskField'][_0xaa57('0x11b')](db[_0xaa57('0xad')],{'as':'Field','foreignKey':'FieldId'});db[_0xaa57('0xad')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xaf')][_0xaa57('0x11b')](db[_0xaa57('0xb1')],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xb1')]['hasMany'](db[_0xaa57('0xb3')],{'as':_0xaa57('0x1c8'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c3')});db['ZohoConfiguration'][_0xaa57('0x11b')](db['ZohoField'],{'as':_0xaa57('0x1c0'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xb1')][_0xaa57('0x11b')](db[_0xaa57('0xb3')],{'as':_0xaa57('0x1ba'),'onDelete':'cascade','foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xb1')][_0xaa57('0x12a')](db[_0xaa57('0xaf')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xb3')]['hasMany'](db[_0xaa57('0xb3')],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xb3')][_0xaa57('0x11b')](db[_0xaa57('0xb3')],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xb3')]['belongsTo'](db[_0xaa57('0x1c6')],{'as':_0xaa57('0x1c6'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0xaa57('0x11b')](db[_0xaa57('0xb6')],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':'AccountId'});db[_0xaa57('0xb6')]['hasMany'](db[_0xaa57('0xb8')],{'as':_0xaa57('0x1c8'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xb6')][_0xaa57('0x11b')](db[_0xaa57('0xb8')],{'as':'Descriptions','foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xb6')][_0xaa57('0x11b')](db[_0xaa57('0xb8')],{'as':'Fields','foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xb6')][_0xaa57('0x12a')](db[_0xaa57('0xb5')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xb6')]['belongsToMany'](db[_0xaa57('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0xaa57('0xb8')][_0xaa57('0x11b')](db['ZendeskField'],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xb8')][_0xaa57('0x11b')](db['ZendeskField'],{'as':_0xaa57('0x1c4'),'foreignKey':'DescriptionId'});db[_0xaa57('0xb8')][_0xaa57('0x11b')](db[_0xaa57('0xb8')],{'as':_0xaa57('0x1c5'),'foreignKey':'FieldId'});db[_0xaa57('0xb8')][_0xaa57('0x12a')](db[_0xaa57('0x1c6')],{'as':'Variable','foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0x1ca')][_0xaa57('0x11b')](db[_0xaa57('0xbb')],{'as':'Configurations','onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db['FreshdeskConfiguration'][_0xaa57('0x11b')](db[_0xaa57('0xbd')],{'as':_0xaa57('0x1c8'),'onDelete':'cascade','foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xbb')]['hasMany'](db[_0xaa57('0xbd')],{'as':'Descriptions','onDelete':_0xaa57('0x119'),'foreignKey':'DescriptionId'});db[_0xaa57('0xbb')][_0xaa57('0x11b')](db[_0xaa57('0xbd')],{'as':_0xaa57('0x1ba'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xbb')][_0xaa57('0x12a')](db['FreshdeskAccount'],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db['FreshdeskConfiguration']['belongsToMany'](db[_0xaa57('0x8c')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xaa57('0xbd')][_0xaa57('0x11b')](db[_0xaa57('0xbd')],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xbd')]['hasMany'](db[_0xaa57('0xbd')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db['FreshdeskField'][_0xaa57('0x11b')](db[_0xaa57('0xbd')],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xbd')][_0xaa57('0x12a')](db[_0xaa57('0x1c6')],{'as':'Variable','foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xbe')][_0xaa57('0x11b')](db[_0xaa57('0xc0')],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xc0')]['hasMany'](db[_0xaa57('0xc2')],{'as':'Subjects','foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xc0')][_0xaa57('0x11b')](db[_0xaa57('0xc2')],{'as':_0xaa57('0x1c0'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xc0')][_0xaa57('0x11b')](db[_0xaa57('0xc2')],{'as':_0xaa57('0x1ba'),'foreignKey':_0xaa57('0x1c2')});db['VtigerConfiguration'][_0xaa57('0x12a')](db[_0xaa57('0xbe')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db['VtigerField'][_0xaa57('0x11b')](db['VtigerField'],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xc2')][_0xaa57('0x11b')](db[_0xaa57('0xc2')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xc2')][_0xaa57('0x11b')](db['VtigerField'],{'as':_0xaa57('0x1c5'),'foreignKey':'FieldId'});db[_0xaa57('0xc2')][_0xaa57('0x12a')](db['Variable'],{'as':_0xaa57('0x1c6'),'foreignKey':_0xaa57('0x1c7')});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':'AccountId'});db[_0xaa57('0xc6')]['hasMany'](db[_0xaa57('0xc8')],{'as':_0xaa57('0x1c8'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xc6')][_0xaa57('0x11b')](db[_0xaa57('0xc8')],{'as':'Descriptions','foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xc6')]['hasMany'](db[_0xaa57('0xc8')],{'as':_0xaa57('0x1ba'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xc6')][_0xaa57('0x12a')](db[_0xaa57('0xc4')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xc8')][_0xaa57('0x11b')](db[_0xaa57('0xc8')],{'as':'Subject','foreignKey':_0xaa57('0x1c3')});db['ServicenowField'][_0xaa57('0x11b')](db[_0xaa57('0xc8')],{'as':'Description','foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xc8')]['hasMany'](db[_0xaa57('0xc8')],{'as':_0xaa57('0x1c5'),'foreignKey':'FieldId'});db[_0xaa57('0xc8')][_0xaa57('0x12a')](db[_0xaa57('0x1c6')],{'as':_0xaa57('0x1c6'),'foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0x1cb')][_0xaa57('0x11b')](db[_0xaa57('0xca')],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0x1cb')]['belongsTo'](db[_0xaa57('0x10e')],{'as':_0xaa57('0x10e'),'foreignKey':_0xaa57('0x16b')});db[_0xaa57('0xca')][_0xaa57('0x11b')](db['Dynamics365Field'],{'as':_0xaa57('0x1c8'),'onDelete':'cascade','foreignKey':_0xaa57('0x1c3')});db['Dynamics365Configuration']['hasMany'](db[_0xaa57('0x1cc')],{'as':'Descriptions','onDelete':_0xaa57('0x119'),'foreignKey':'DescriptionId'});db[_0xaa57('0xca')]['hasMany'](db[_0xaa57('0x1cc')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xca')][_0xaa57('0x12a')](db[_0xaa57('0x1cb')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0x1cc')][_0xaa57('0x11b')](db[_0xaa57('0x1cc')],{'as':_0xaa57('0x1c9'),'foreignKey':'SubjectId'});db[_0xaa57('0x1cc')][_0xaa57('0x11b')](db[_0xaa57('0x1cc')],{'as':_0xaa57('0x1c4'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0x1cc')][_0xaa57('0x11b')](db[_0xaa57('0x1cc')],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db['Dynamics365Field']['belongsTo'](db['Variable'],{'as':_0xaa57('0x1c6'),'foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xcd')]['hasMany'](db[_0xaa57('0xcf')],{'as':_0xaa57('0x1be'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xcf')][_0xaa57('0x11b')](db['FreshsalesField'],{'as':_0xaa57('0x1c8'),'foreignKey':_0xaa57('0x1c3')});db['FreshsalesConfiguration'][_0xaa57('0x11b')](db['FreshsalesField'],{'as':_0xaa57('0x1c0'),'foreignKey':_0xaa57('0x1c1')});db[_0xaa57('0xcf')][_0xaa57('0x11b')](db[_0xaa57('0xd1')],{'as':'Fields','foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xcf')][_0xaa57('0x12a')](db[_0xaa57('0xcd')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1bf')});db[_0xaa57('0xd1')][_0xaa57('0x11b')](db[_0xaa57('0xd1')],{'as':_0xaa57('0x1c9'),'foreignKey':_0xaa57('0x1c3')});db[_0xaa57('0xd1')][_0xaa57('0x11b')](db[_0xaa57('0xd1')],{'as':_0xaa57('0x1c4'),'foreignKey':'DescriptionId'});db[_0xaa57('0xd1')][_0xaa57('0x11b')](db[_0xaa57('0xd1')],{'as':_0xaa57('0x1c5'),'foreignKey':_0xaa57('0x1c2')});db[_0xaa57('0xd1')][_0xaa57('0x12a')](db['Variable'],{'as':_0xaa57('0x1c6'),'foreignKey':_0xaa57('0x1c7')});db[_0xaa57('0xd4')]['belongsTo'](db[_0xaa57('0x61')],{});db[_0xaa57('0xd4')]['belongsTo'](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':'ListId'});db[_0xaa57('0xd4')][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0xd4')][_0xaa57('0x12a')](db[_0xaa57('0x66')],{});db[_0xaa57('0xd4')][_0xaa57('0x12a')](db[_0xaa57('0x67')],{});db['ChatQueueReport']['belongsTo'](db[_0xaa57('0x14')],{});db[_0xaa57('0xd4')]['belongsTo'](db['ChatQueue'],{});db[_0xaa57('0xd6')][_0xaa57('0x12a')](db['User'],{'onDelete':_0xaa57('0x119'),'foreignKey':'FromId'});db[_0xaa57('0xd6')][_0xaa57('0x12a')](db['User'],{'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1cd')});db[_0xaa57('0x159')][_0xaa57('0x11b')](db[_0xaa57('0x1ce')],{'foreignKey':'SessionId','onDelete':_0xaa57('0x119')});db[_0xaa57('0x159')]['hasMany'](db[_0xaa57('0x1cf')],{'foreignKey':_0xaa57('0x1d0'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0xdb')][_0xaa57('0x12a')](db[_0xaa57('0x52')],{});db[_0xaa57('0xdb')]['belongsTo'](db['CmList'],{'as':_0xaa57('0x171'),'foreignKey':'ListId'});db[_0xaa57('0xdb')]['belongsTo'](db[_0xaa57('0x70')],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0xdb')][_0xaa57('0x12a')](db[_0xaa57('0x55')],{});db[_0xaa57('0xdb')][_0xaa57('0x12a')](db[_0xaa57('0x57')],{});db[_0xaa57('0xdb')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{});db[_0xaa57('0xdb')][_0xaa57('0x12a')](db[_0xaa57('0x59')],{});db[_0xaa57('0x1d1')][_0xaa57('0x11b')](db['JscriptySessionReport'],{'foreignKey':_0xaa57('0x1d2')});db['JscriptyProject'][_0xaa57('0x11b')](db[_0xaa57('0x1ce')],{'foreignKey':_0xaa57('0x1d2')});db[_0xaa57('0x1d1')]['hasMany'](db[_0xaa57('0x1cf')],{'foreignKey':_0xaa57('0x1d2')});db[_0xaa57('0xe4')]['belongsToMany'](db[_0xaa57('0x14')],{'as':'Users','through':_0xaa57('0x14e')});db[_0xaa57('0xe9')]['belongsToMany'](db[_0xaa57('0x14')],{'as':_0xaa57('0x175'),'through':_0xaa57('0x1d3')});db[_0xaa57('0xe9')][_0xaa57('0x12d')](db[_0xaa57('0x153')],{'through':_0xaa57('0x15f'),'as':'VoiceQueues'});db[_0xaa57('0xe9')]['belongsToMany'](db[_0xaa57('0x13a')],{'through':'team_has_mail_queues','as':_0xaa57('0x13b')});db[_0xaa57('0xe9')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db['Team'][_0xaa57('0x12d')](db[_0xaa57('0x4e')],{'through':_0xaa57('0x18d'),'as':_0xaa57('0x1d4')});db[_0xaa57('0xe9')][_0xaa57('0x12d')](db[_0xaa57('0x59')],{'through':'team_has_sms_queues','as':_0xaa57('0x13e')});db[_0xaa57('0xe9')][_0xaa57('0x12d')](db[_0xaa57('0x140')],{'through':_0xaa57('0x1d5'),'as':'OpenchannelQueues'});db['Team'][_0xaa57('0x12d')](db[_0xaa57('0x142')],{'through':_0xaa57('0x1d6'),'as':_0xaa57('0x143')});db['Team'][_0xaa57('0x12d')](db[_0xaa57('0xfc')],{'through':_0xaa57('0x111'),'as':_0xaa57('0x1d7')});db[_0xaa57('0xec')][_0xaa57('0x11b')](db[_0xaa57('0x72')],{'as':_0xaa57('0x155'),'foreignKey':_0xaa57('0x1d8')});db[_0xaa57('0xec')][_0xaa57('0x11b')](db[_0xaa57('0x75')],{'as':_0xaa57('0x120'),'foreignKey':'CampaignId'});db[_0xaa57('0xec')][_0xaa57('0x11b')](db[_0xaa57('0x76')],{'as':_0xaa57('0x157'),'foreignKey':'CampaignId'});db[_0xaa57('0xec')][_0xaa57('0x11b')](db[_0xaa57('0x73')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0xaa57('0xec')][_0xaa57('0x12a')](db[_0xaa57('0x2b')],{'as':_0xaa57('0x2b'),'foreignKey':_0xaa57('0x15a')});db[_0xaa57('0xec')]['belongsTo'](db['Trunk'],{'as':_0xaa57('0x15b'),'foreignKey':_0xaa57('0x1d9')});db[_0xaa57('0xec')][_0xaa57('0x12a')](db[_0xaa57('0x82')],{'as':_0xaa57('0x82'),'foreignKey':_0xaa57('0x15c')});db[_0xaa57('0xec')][_0xaa57('0x12a')](db[_0xaa57('0xe4')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xaa57('0xec')][_0xaa57('0x12d')](db['CmList'],{'as':_0xaa57('0x133'),'through':'campaigns_has_cm_lists'});db[_0xaa57('0xec')][_0xaa57('0x12d')](db[_0xaa57('0xfa')],{'as':'BlackLists','through':_0xaa57('0x1da')});db[_0xaa57('0xf0')][_0xaa57('0x12a')](db['ChatOfflineMessage'],{'as':_0xaa57('0x69'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x42')],{});db[_0xaa57('0x1db')][_0xaa57('0x12a')](db[_0xaa57('0x40')],{});db[_0xaa57('0x1db')][_0xaa57('0x12a')](db[_0xaa57('0x3c')],{'foreignKey':_0xaa57('0x1dc'),'as':_0xaa57('0x1dd')});db[_0xaa57('0x1db')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':'FromUserId','as':_0xaa57('0x1de')});db[_0xaa57('0x1db')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db['MailTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x13a')],{'foreignKey':_0xaa57('0x1e1'),'as':_0xaa57('0x1e2')});db[_0xaa57('0x1db')][_0xaa57('0x12a')](db[_0xaa57('0x3c')],{'foreignKey':_0xaa57('0x1e3'),'as':_0xaa57('0x1e4')});db[_0xaa57('0xf4')][_0xaa57('0x12a')](db['ChatMessage'],{});db[_0xaa57('0xf4')][_0xaa57('0x12a')](db[_0xaa57('0x66')],{});db[_0xaa57('0xf4')][_0xaa57('0x12a')](db[_0xaa57('0x61')],{'foreignKey':_0xaa57('0x1e5'),'as':_0xaa57('0x1dd')});db['ChatTransferReport']['belongsTo'](db[_0xaa57('0x14')],{'foreignKey':'FromUserId','as':_0xaa57('0x1de')});db['ChatTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db[_0xaa57('0xf4')][_0xaa57('0x12a')](db[_0xaa57('0x6b')],{'foreignKey':'ToChatQueueId','as':_0xaa57('0x1e2')});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xaa57('0x1e6'),'as':'ToAccount'});db['FaxTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x4c')],{});db[_0xaa57('0xf5')][_0xaa57('0x12a')](db['FaxInteraction'],{});db[_0xaa57('0xf5')][_0xaa57('0x12a')](db[_0xaa57('0x182')],{'foreignKey':'FromFaxAccountId','as':_0xaa57('0x1dd')});db['FaxTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1e7'),'as':'FromAgent'});db[_0xaa57('0xf5')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db[_0xaa57('0xf5')][_0xaa57('0x12a')](db[_0xaa57('0x4e')],{'foreignKey':'ToFaxQueueId','as':_0xaa57('0x1e2')});db['FaxTransferReport'][_0xaa57('0x12a')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0xaa57('0x1e4')});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db[_0xaa57('0x60')],{});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db['OpenchannelInteraction'],{});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db['OpenchannelAccount'],{'foreignKey':_0xaa57('0x1e8'),'as':_0xaa57('0x1dd')});db[_0xaa57('0xf6')]['belongsTo'](db[_0xaa57('0x14')],{'foreignKey':'FromUserId','as':_0xaa57('0x1de')});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db[_0xaa57('0x140')],{'foreignKey':_0xaa57('0x1e9'),'as':_0xaa57('0x1e2')});db[_0xaa57('0xf6')][_0xaa57('0x12a')](db['OpenchannelAccount'],{'foreignKey':_0xaa57('0x1ea'),'as':_0xaa57('0x1e4')});db['SmsTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x57')],{});db[_0xaa57('0xf8')][_0xaa57('0x12a')](db[_0xaa57('0x55')],{});db[_0xaa57('0xf8')]['belongsTo'](db[_0xaa57('0x52')],{'foreignKey':_0xaa57('0x1eb'),'as':'FromAccount'});db[_0xaa57('0xf8')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xaa57('0xf8')][_0xaa57('0x12a')](db['User'],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db[_0xaa57('0xf8')]['belongsTo'](db[_0xaa57('0x59')],{'foreignKey':'ToSmsQueueId','as':_0xaa57('0x1e2')});db[_0xaa57('0xf8')][_0xaa57('0x12a')](db[_0xaa57('0x52')],{'foreignKey':_0xaa57('0x1ec'),'as':_0xaa57('0x1e4')});db[_0xaa57('0xfa')][_0xaa57('0x11b')](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':'ListId','onDelete':_0xaa57('0x119')});db[_0xaa57('0xfa')][_0xaa57('0x11b')](db['CmCustomField'],{'as':_0xaa57('0x1ed'),'foreignKey':_0xaa57('0x172')});db[_0xaa57('0xfa')][_0xaa57('0x11b')](db[_0xaa57('0x70')],{'as':_0xaa57('0x131'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xaa57('0x75')],{'as':_0xaa57('0x120'),'foreignKey':_0xaa57('0x172')});db[_0xaa57('0xfa')]['hasMany'](db[_0xaa57('0x76')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xaa57('0xfa')]['hasMany'](db['ReportAgentPreview'],{'as':_0xaa57('0x78'),'foreignKey':_0xaa57('0x172')});db['CmList'][_0xaa57('0x12d')](db[_0xaa57('0x153')],{'as':'Queues','through':_0xaa57('0x15d')});db[_0xaa57('0xfa')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':'Agents','through':_0xaa57('0x134')});db['VoicePrefix']['hasMany'](db['VoiceExtension'],{'as':_0xaa57('0x11f'),'onDelete':_0xaa57('0x119')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':_0xaa57('0x175'),'through':'UserVoicePrefix'});db[_0xaa57('0xfc')][_0xaa57('0x12d')](db[_0xaa57('0xe9')],{'through':_0xaa57('0x111'),'as':'Teams'});db[_0xaa57('0x12b')]['hasMany'](db[_0xaa57('0x14')],{'as':'Users','foreignKey':_0xaa57('0x12c')});db[_0xaa57('0x12b')][_0xaa57('0x11b')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xaa57('0x12c'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0xff')][_0xaa57('0x11b')](db[_0xaa57('0x1ee')],{'as':_0xaa57('0x1ef'),'foreignKey':_0xaa57('0x1f0'),'onDelete':_0xaa57('0x119')});db[_0xaa57('0x103')]['hasMany'](db[_0xaa57('0x7f')],{'as':_0xaa57('0x183'),'foreignKey':_0xaa57('0x1f1'),'onDelete':'cascade'});db[_0xaa57('0x103')][_0xaa57('0x11b')](db[_0xaa57('0x7e')],{'as':_0xaa57('0x16e'),'foreignKey':_0xaa57('0x1f1')});db['WhatsappAccount'][_0xaa57('0x11b')](db['WhatsappMessage'],{'as':_0xaa57('0x161'),'foreignKey':_0xaa57('0x1f1')});db[_0xaa57('0x103')][_0xaa57('0x11b')](db[_0xaa57('0x107')],{'as':'Interactions'});db[_0xaa57('0x103')][_0xaa57('0x11b')](db['WhatsappApplication'],{'as':'Applications'});db[_0xaa57('0x103')][_0xaa57('0x12a')](db[_0xaa57('0xfa')],{'as':_0xaa57('0x171'),'foreignKey':'ListId'});db[_0xaa57('0x103')][_0xaa57('0x12a')](db[_0xaa57('0x84')],{'as':_0xaa57('0x1f2'),'foreignKey':_0xaa57('0x174')});db[_0xaa57('0x103')][_0xaa57('0x12d')](db[_0xaa57('0x14')],{'as':'Agents','through':_0xaa57('0x14d')});db[_0xaa57('0x105')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xaa57('0x12a')](db[_0xaa57('0x142')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0xaa57('0x103')],{'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x105')][_0xaa57('0x12a')](db[_0xaa57('0x82')],{'onDelete':_0xaa57('0x16c'),'foreignKey':'IntervalId'});db[_0xaa57('0x105')][_0xaa57('0x12a')](db[_0xaa57('0x8c')],{'onDelete':_0xaa57('0x16c'),'foreignKey':_0xaa57('0x17f')});db[_0xaa57('0x107')][_0xaa57('0x11b')](db['WhatsappMessage'],{'as':_0xaa57('0x161'),'onDelete':_0xaa57('0x119'),'foreignKey':_0xaa57('0x1f3')});db[_0xaa57('0x107')][_0xaa57('0x12a')](db[_0xaa57('0x103')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1f1')});db['WhatsappInteraction']['belongsTo'](db[_0xaa57('0x70')],{'as':'Contact','foreignKey':_0xaa57('0x168')});db[_0xaa57('0x107')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':'Owner','foreignKey':_0xaa57('0x11a')});db['WhatsappInteraction']['belongsToMany'](db[_0xaa57('0x8c')],{'through':_0xaa57('0x1b5'),'as':_0xaa57('0x17b')});db['WhatsappInteraction'][_0xaa57('0x12d')](db[_0xaa57('0x8c')],{'through':_0xaa57('0x1b5'),'as':_0xaa57('0x189')});db[_0xaa57('0x107')]['belongsToMany'](db[_0xaa57('0x14')],{'as':'Users','through':_0xaa57('0x139'),'foreignKey':_0xaa57('0x1f3')});db[_0xaa57('0x109')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':'User'});db[_0xaa57('0x109')][_0xaa57('0x12a')](db[_0xaa57('0x70')],{'onDelete':_0xaa57('0x119'),'as':_0xaa57('0x179')});db[_0xaa57('0x109')][_0xaa57('0x12a')](db[_0xaa57('0x107')],{'onDelete':_0xaa57('0x119'),'as':'Interaction','foreignKey':_0xaa57('0x1f3')});db[_0xaa57('0x109')][_0xaa57('0x12a')](db[_0xaa57('0x103')],{'as':_0xaa57('0x178'),'foreignKey':_0xaa57('0x1f1')});db['WhatsappQueueReport'][_0xaa57('0x12a')](db['WhatsappAccount'],{});db[_0xaa57('0x10a')][_0xaa57('0x12a')](db['CmList'],{'as':_0xaa57('0x171'),'foreignKey':_0xaa57('0x172')});db['WhatsappQueueReport'][_0xaa57('0x12a')](db['CmContact'],{'as':_0xaa57('0x179'),'foreignKey':_0xaa57('0x168')});db[_0xaa57('0x10a')][_0xaa57('0x12a')](db[_0xaa57('0x107')],{});db[_0xaa57('0x10a')]['belongsTo'](db[_0xaa57('0x142')],{});db[_0xaa57('0x10a')][_0xaa57('0x12a')](db[_0xaa57('0x109')],{});db['WhatsappQueueReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{});db[_0xaa57('0x1f4')][_0xaa57('0x12a')](db[_0xaa57('0x109')],{});db[_0xaa57('0x1f4')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0xaa57('0x12a')](db['WhatsappAccount'],{'foreignKey':_0xaa57('0x1f5'),'as':_0xaa57('0x1dd')});db[_0xaa57('0x1f4')][_0xaa57('0x12a')](db['WhatsappAccount'],{'foreignKey':_0xaa57('0x1f6'),'as':_0xaa57('0x1e4')});db['WhatsappTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x142')],{'foreignKey':_0xaa57('0x1f7'),'as':_0xaa57('0x1e2')});db['WhatsappTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':'FromUserId','as':_0xaa57('0x1de')});db['WhatsappTransferReport'][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'foreignKey':_0xaa57('0x1df'),'as':_0xaa57('0x1e0')});db[_0xaa57('0x142')]['belongsToMany'](db['User'],{'as':_0xaa57('0x175'),'through':_0xaa57('0x38'),'foreignKey':_0xaa57('0x1f8')});db[_0xaa57('0x142')]['belongsToMany'](db[_0xaa57('0xe9')],{'through':_0xaa57('0x1d6'),'as':'Teams'});db[_0xaa57('0x115')][_0xaa57('0x12a')](db[_0xaa57('0x14')],{'as':_0xaa57('0x1f9'),'foreignKey':_0xaa57('0x11a'),'onDelete':_0xaa57('0x119'),'hooks':!![]});db[_0xaa57('0x10e')][_0xaa57('0x117')](db[_0xaa57('0x1cb')],{'as':_0xaa57('0x1cb'),'onDelete':_0xaa57('0x16c')});db[_0xaa57('0x10e')][_0xaa57('0x117')](db[_0xaa57('0x16a')],{'as':_0xaa57('0x1fa'),'onDelete':_0xaa57('0x16c')});db['CloudProvider'][_0xaa57('0x117')](db[_0xaa57('0x3b')],{'as':_0xaa57('0x16d'),'onDelete':'restrict'});module[_0xaa57('0x1fb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3c83324..677828f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f47=['/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/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/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./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/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authActiveDirectory','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/logs','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','express','./errors','./utils/client-side-logger','./api/client-side-logs','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/interactions','./api/openchannelInteraction'];(function(_0x52f19f,_0x52164b){var _0x528dd8=function(_0x4e8028){while(--_0x4e8028){_0x52f19f['push'](_0x52f19f['shift']());}};_0x528dd8(++_0x52164b);}(_0x6f47,0xc7));var _0x76f4=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x6f47[_0x186376];return _0x2dbdd9;};'use strict';var path=require('path');var express=require(_0x76f4('0x0'));var errors=require(_0x76f4('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x76f4('0x2'))['setupLoggers'];var clientSideLogs=require(_0x76f4('0x3'));exports['default']=function(_0xe214ad){return setupLoggers(_0xe214ad)[_0x76f4('0x4')](function(){_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6'),require('./api/user'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x7'),require(_0x76f4('0x8')));_0xe214ad['use'](_0x76f4('0x9'),require(_0x76f4('0xa')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb'),require(_0x76f4('0xc')));_0xe214ad['use']('/api/voice/mohs',require(_0x76f4('0xd')));_0xe214ad[_0x76f4('0x5')]('/api/voice/queues',require('./api/voiceQueue'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe'),require(_0x76f4('0xf')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x10'),require(_0x76f4('0x11')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x12'),require(_0x76f4('0x13')));_0xe214ad['use'](_0x76f4('0x14'),require(_0x76f4('0x15')));_0xe214ad['use']('/api/voice/calls/reports',require('./api/voiceCallReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x16'),require(_0x76f4('0x17')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x18'),require(_0x76f4('0x19')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1a'),require(_0x76f4('0x1b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1c'),require(_0x76f4('0x1d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x1e'),require(_0x76f4('0x1f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x20'),require(_0x76f4('0x21')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x22'),require(_0x76f4('0x23')));_0xe214ad[_0x76f4('0x5')]('/api/mail/accounts',require(_0x76f4('0x24')));_0xe214ad['use'](_0x76f4('0x25'),require(_0x76f4('0x26')));_0xe214ad[_0x76f4('0x5')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0xe214ad['use'](_0x76f4('0x27'),require(_0x76f4('0x28')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x29'),require(_0x76f4('0x2a')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x2b'),require('./api/mailApplication'));_0xe214ad['use'](_0x76f4('0x2c'),require('./api/mailQueueReport'));_0xe214ad[_0x76f4('0x5')]('/api/dashboards',require('./api/dashboard'));_0xe214ad['use'](_0x76f4('0x2d'),require(_0x76f4('0x2e')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x2f'),require(_0x76f4('0x30')));_0xe214ad[_0x76f4('0x5')]('/api/fax/applications',require(_0x76f4('0x31')));_0xe214ad['use']('/api/fax/interactions',require('./api/faxInteraction'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x32'),require(_0x76f4('0x33')));_0xe214ad[_0x76f4('0x5')]('/api/fax/queues',require(_0x76f4('0x34')));_0xe214ad['use'](_0x76f4('0x35'),require(_0x76f4('0x36')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x37'),require(_0x76f4('0x38')));_0xe214ad['use']('/api/sms/applications',require(_0x76f4('0x39')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3a'),require(_0x76f4('0x3b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3c'),require(_0x76f4('0x3d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x3e'),require(_0x76f4('0x3f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x40'),require('./api/openchannelAccount'));_0xe214ad['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x41'),require(_0x76f4('0x42')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x43'),require('./api/openchannelMessage'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x44'),require(_0x76f4('0x45')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x46'),require(_0x76f4('0x47')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x48'),require(_0x76f4('0x49')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4a'),require(_0x76f4('0x4b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4c'),require(_0x76f4('0x4d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x4e'),require(_0x76f4('0x4f')));_0xe214ad['use'](_0x76f4('0x50'),require(_0x76f4('0x51')));_0xe214ad[_0x76f4('0x5')]('/api/chat/queues',require('./api/chatQueue'));_0xe214ad[_0x76f4('0x5')]('/api/chat/groups',require(_0x76f4('0x52')));_0xe214ad['use'](_0x76f4('0x53'),require(_0x76f4('0x54')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x55'),require(_0x76f4('0x56')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x57'),require(_0x76f4('0x58')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x59'),require('./api/cmHopper'));_0xe214ad['use'](_0x76f4('0x5a'),require(_0x76f4('0x5b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x5c'),require(_0x76f4('0x5d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x5e'),require(_0x76f4('0x5f')));_0xe214ad[_0x76f4('0x5')]('/api/cm/custom_fields',require(_0x76f4('0x60')));_0xe214ad[_0x76f4('0x5')]('/api/actions',require('./api/action'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x61'),require(_0x76f4('0x62')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x63'),require('./api/cannedAnswer'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x64'),require(_0x76f4('0x65')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x66'),require(_0x76f4('0x67')));_0xe214ad['use'](_0x76f4('0x68'),require(_0x76f4('0x69')));_0xe214ad[_0x76f4('0x5')]('/api/pauses',require('./api/pause'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6a'),require(_0x76f4('0x6b')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6c'),require('./api/voiceQueuesLog'));_0xe214ad['use'](_0x76f4('0x6d'),require('./api/schedule'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x6e'),require('./api/sound'));_0xe214ad['use'](_0x76f4('0x6f'),require(_0x76f4('0x70')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x71'),require('./api/template'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x72'),require(_0x76f4('0x73')));_0xe214ad['use'](_0x76f4('0x74'),require(_0x76f4('0x75')));_0xe214ad['use']('/api/integrations',require(_0x76f4('0x76')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x77'),require(_0x76f4('0x78')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/custom_reports',require(_0x76f4('0x79')));_0xe214ad['use'](_0x76f4('0x7a'),require(_0x76f4('0x7b')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/extracted_reports',require(_0x76f4('0x7c')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/metrics',require(_0x76f4('0x7d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x7e'),require(_0x76f4('0x7f')));_0xe214ad[_0x76f4('0x5')]('/api/analytics/tree_reports',require(_0x76f4('0x80')));_0xe214ad['use'](_0x76f4('0x81'),require(_0x76f4('0x82')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/salesforce/configurations',require(_0x76f4('0x83')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x84'),require(_0x76f4('0x85')));_0xe214ad['use'](_0x76f4('0x86'),require(_0x76f4('0x87')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x88'),require('./api/intSugarcrmConfiguration'));_0xe214ad[_0x76f4('0x5')]('/api/integrations/sugarcrm/fields',require(_0x76f4('0x89')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x8a'),require(_0x76f4('0x8b')));_0xe214ad['use'](_0x76f4('0x8c'),require(_0x76f4('0x8d')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x8e'),require('./api/intZohoConfiguration'));_0xe214ad['use'](_0x76f4('0x8f'),require(_0x76f4('0x90')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x91'),require(_0x76f4('0x92')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x93'),require(_0x76f4('0x94')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0xe214ad['use'](_0x76f4('0x95'),require(_0x76f4('0x96')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x97'),require('./api/intFreshdeskConfiguration'));_0xe214ad['use'](_0x76f4('0x98'),require('./api/intFreshdeskField'));_0xe214ad[_0x76f4('0x5')]('/api/integrations/vtiger/accounts',require(_0x76f4('0x99')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x9a'),require(_0x76f4('0x9b')));_0xe214ad['use'](_0x76f4('0x9c'),require(_0x76f4('0x9d')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x9e'),require(_0x76f4('0x9f')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa0'),require('./api/intServicenowConfiguration'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa1'),require(_0x76f4('0xa2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa3'),require(_0x76f4('0xa4')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xa5'),require('./api/intDynamics365Configuration'));_0xe214ad['use'](_0x76f4('0xa6'),require(_0x76f4('0xa7')));_0xe214ad[_0x76f4('0x5')]('/api/integrations/freshsales/accounts',require(_0x76f4('0xa8')));_0xe214ad['use'](_0x76f4('0xa9'),require(_0x76f4('0xaa')));_0xe214ad['use'](_0x76f4('0xab'),require(_0x76f4('0xac')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xad'),require(_0x76f4('0xae')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xaf'),require(_0x76f4('0xb0')));_0xe214ad[_0x76f4('0x5')]('/api/chat/internal/messages',require(_0x76f4('0xb1')));_0xe214ad['use'](_0x76f4('0xb2'),require(_0x76f4('0xb3')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb4'),require(_0x76f4('0xb5')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb6'),require(_0x76f4('0xb7')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb8'),require('./api/smsQueueReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xb9'),require('./api/squareReport'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xba'),require(_0x76f4('0xbb')));_0xe214ad['use'](_0x76f4('0xbc'),require(_0x76f4('0xbd')));_0xe214ad[_0x76f4('0x5')]('/api/settings',require(_0x76f4('0xbe')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xbf'),require(_0x76f4('0xc0')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc1'),require(_0x76f4('0xc2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc3'),require('./api/squareRecording'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc4'),require(_0x76f4('0xc5')));_0xe214ad[_0x76f4('0x5')]('/api/teams',require(_0x76f4('0xc6')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc7'),require('./api/license'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xc8'),require(_0x76f4('0xc9')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xca'),require('./api/migration'));_0xe214ad[_0x76f4('0x5')]('/api/attachments',require(_0x76f4('0xcb')));_0xe214ad[_0x76f4('0x5')]('/api/plugins',require('./api/plugin'));_0xe214ad['use'](_0x76f4('0xcc'),require(_0x76f4('0xcd')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xce'),require(_0x76f4('0xcf')));_0xe214ad[_0x76f4('0x5')]('/api/fax/reports/transfer',require(_0x76f4('0xd0')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd1'),require(_0x76f4('0xd2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd3'),require(_0x76f4('0xd4')));_0xe214ad[_0x76f4('0x5')]('/api/cm/lists',require(_0x76f4('0xd5')));_0xe214ad['use'](_0x76f4('0xd6'),require(_0x76f4('0xd7')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xd8'),require(_0x76f4('0xd9')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xda'),require(_0x76f4('0xdb')));_0xe214ad['use'](_0x76f4('0xdc'),require('./api/userProfileResource'));_0xe214ad['use']('/api/userNotifications',require(_0x76f4('0xdd')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xde'),require(_0x76f4('0xdf')));_0xe214ad['use'](_0x76f4('0xe0'),require(_0x76f4('0xe1')));_0xe214ad[_0x76f4('0x5')]('/api/whatsapp/interactions',require(_0x76f4('0xe2')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe3'),require(_0x76f4('0xe4')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xe5'),require(_0x76f4('0xe6')));_0xe214ad['use'](_0x76f4('0xe7'),require(_0x76f4('0xe8')));_0xe214ad['use'](_0x76f4('0xe9'),require(_0x76f4('0xea')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xeb'),require(_0x76f4('0xec')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xed'),require(_0x76f4('0xee')));_0xe214ad[_0x76f4('0x5')]('/api/user-settings',require(_0x76f4('0xef')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf0'),require(_0x76f4('0xf1')));_0xe214ad['use'](_0x76f4('0xf2'),require('./api/authGoogle'));_0xe214ad[_0x76f4('0x5')]('/api/auth/activedirectory',require(_0x76f4('0xf3')));_0xe214ad[_0x76f4('0x5')]('/api/jira',require('./api/jira'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf4'),require(_0x76f4('0xf5')));_0xe214ad['use']('/api/version',require(_0x76f4('0xf6')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf7'),require(_0x76f4('0xf8')));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xf9'),require(_0x76f4('0xfa')));_0xe214ad[_0x76f4('0x5')]('/api/webbar',require('./api/webbar'));_0xe214ad[_0x76f4('0x5')](_0x76f4('0xfb'),clientSideLogs);_0xe214ad[_0x76f4('0x5')]('/apidoc',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],_0x76f4('0xff'))));_0xe214ad[_0x76f4('0x5')](_0x76f4('0x100'),express[_0x76f4('0xfc')](path['join'](config[_0x76f4('0xfe')],_0x76f4('0x100'))));_0xe214ad[_0x76f4('0x5')]('/demo',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],_0x76f4('0x101'))));_0xe214ad['use'](_0x76f4('0x102'),express['static'](path[_0x76f4('0xfd')](config['root'],_0x76f4('0x103'),_0x76f4('0x104'))));_0xe214ad[_0x76f4('0x5')]('/plugins',express[_0x76f4('0xfc')](path[_0x76f4('0xfd')](config[_0x76f4('0xfe')],'/server/files/plugins')));_0xe214ad[_0x76f4('0x105')](_0x76f4('0x106'))['get'](errors[0x194]);_0xe214ad['route']('/*')[_0x76f4('0x107')](function(_0x39afa3,_0x515cfe){_0x515cfe['sendFile'](path[_0x76f4('0x108')](_0xe214ad[_0x76f4('0x107')]('appPath')+_0x76f4('0x109')));});return _0xe214ad;});}; \ No newline at end of file +var _0xf2ca=['./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./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/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/schedules','./api/schedule','/api/sounds','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/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/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0xf2ca[_0x51f4fc];return _0x4d96fc;};'use strict';var path=require(_0xaf2c('0x0'));var express=require(_0xaf2c('0x1'));var errors=require(_0xaf2c('0x2'));var config=require('./config/environment');var setupLoggers=require(_0xaf2c('0x3'))[_0xaf2c('0x4')];var clientSideLogs=require(_0xaf2c('0x5'));exports[_0xaf2c('0x6')]=function(_0x3a724c){return setupLoggers(_0x3a724c)[_0xaf2c('0x7')](function(){_0x3a724c['use'](_0xaf2c('0x8'),require(_0xaf2c('0x9')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xb'),require('./api/voiceChanSpy'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xc'),require('./api/voiceContext'));_0x3a724c[_0xaf2c('0xa')]('/api/voice/extensions',require(_0xaf2c('0xd')));_0x3a724c['use'](_0xaf2c('0xe'),require(_0xaf2c('0xf')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x10'),require('./api/voiceQueue'));_0x3a724c['use'](_0xaf2c('0x11'),require(_0xaf2c('0x12')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x13'),require(_0xaf2c('0x14')));_0x3a724c['use']('/api/voice/mails',require(_0xaf2c('0x15')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x16'),require(_0xaf2c('0x17')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x18'),require(_0xaf2c('0x19')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x1a'),require(_0xaf2c('0x1b')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x1c'),require(_0xaf2c('0x1d')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x1e'),require('./api/voiceQueueReport'));_0x3a724c[_0xaf2c('0xa')]('/api/members/reports',require(_0xaf2c('0x1f')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x20'),require('./api/trunk'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x21'),require(_0xaf2c('0x22')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x23'),require(_0xaf2c('0x24')));_0x3a724c['use'](_0xaf2c('0x25'),require(_0xaf2c('0x26')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x27'),require(_0xaf2c('0x28')));_0x3a724c['use'](_0xaf2c('0x29'),require(_0xaf2c('0x2a')));_0x3a724c[_0xaf2c('0xa')]('/api/mail/interactions',require('./api/mailInteraction'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x2b'),require(_0xaf2c('0x2c')));_0x3a724c[_0xaf2c('0xa')]('/api/mail/applications',require(_0xaf2c('0x2d')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x2e'),require(_0xaf2c('0x2f')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x30'),require(_0xaf2c('0x31')));_0x3a724c['use'](_0xaf2c('0x32'),require(_0xaf2c('0x33')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x34'),require('./api/faxAccount'));_0x3a724c[_0xaf2c('0xa')]('/api/fax/applications',require(_0xaf2c('0x35')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x36'),require('./api/faxInteraction'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x37'),require(_0xaf2c('0x38')));_0x3a724c['use'](_0xaf2c('0x39'),require(_0xaf2c('0x3a')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x3b'),require('./api/faxQueueReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x3c'),require(_0xaf2c('0x3d')));_0x3a724c['use']('/api/sms/applications',require(_0xaf2c('0x3e')));_0x3a724c['use'](_0xaf2c('0x3f'),require('./api/smsInteraction'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x40'),require('./api/smsMessage'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x41'),require('./api/smsQueue'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x42'),require(_0xaf2c('0x43')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x44'),require(_0xaf2c('0x45')));_0x3a724c['use'](_0xaf2c('0x46'),require('./api/openchannelInteraction'));_0x3a724c[_0xaf2c('0xa')]('/api/openchannel/messages',require(_0xaf2c('0x47')));_0x3a724c['use'](_0xaf2c('0x48'),require('./api/openchannelQueue'));_0x3a724c[_0xaf2c('0xa')]('/api/chat/websites',require(_0xaf2c('0x49')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x4a'),require(_0xaf2c('0x4b')));_0x3a724c[_0xaf2c('0xa')]('/api/chat/applications',require('./api/chatApplication'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x4c'),require(_0xaf2c('0x4d')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x4e'),require(_0xaf2c('0x4f')));_0x3a724c['use'](_0xaf2c('0x50'),require(_0xaf2c('0x51')));_0x3a724c['use'](_0xaf2c('0x52'),require(_0xaf2c('0x53')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x54'),require(_0xaf2c('0x55')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x56'),require(_0xaf2c('0x57')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x58'),require(_0xaf2c('0x59')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x5a'),require('./api/cmContact'));_0x3a724c['use']('/api/cm/hopper',require(_0xaf2c('0x5b')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x5c'),require(_0xaf2c('0x5d')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x5e'),require('./api/cmHopperFinal'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x5f'),require(_0xaf2c('0x60')));_0x3a724c['use']('/api/cm/custom_fields',require(_0xaf2c('0x61')));_0x3a724c['use'](_0xaf2c('0x62'),require(_0xaf2c('0x63')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x64'),require('./api/automation'));_0x3a724c[_0xaf2c('0xa')]('/api/canned_answers',require(_0xaf2c('0x65')));_0x3a724c[_0xaf2c('0xa')]('/api/dispositions',require(_0xaf2c('0x66')));_0x3a724c['use'](_0xaf2c('0x67'),require(_0xaf2c('0x68')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x69'),require(_0xaf2c('0x6a')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x6b'),require(_0xaf2c('0x6c')));_0x3a724c[_0xaf2c('0xa')]('/api/cdr',require('./api/cdr'));_0x3a724c[_0xaf2c('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x3a724c['use'](_0xaf2c('0x6d'),require(_0xaf2c('0x6e')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x6f'),require('./api/sound'));_0x3a724c[_0xaf2c('0xa')]('/api/tags',require(_0xaf2c('0x70')));_0x3a724c['use'](_0xaf2c('0x71'),require(_0xaf2c('0x72')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x73'),require(_0xaf2c('0x74')));_0x3a724c['use'](_0xaf2c('0x75'),require(_0xaf2c('0x76')));_0x3a724c['use']('/api/integrations',require(_0xaf2c('0x77')));_0x3a724c['use'](_0xaf2c('0x78'),require(_0xaf2c('0x79')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x7a'),require(_0xaf2c('0x7b')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x7c'),require(_0xaf2c('0x7d')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x7e'),require(_0xaf2c('0x7f')));_0x3a724c['use'](_0xaf2c('0x80'),require(_0xaf2c('0x81')));_0x3a724c['use']('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x82'),require('./api/analyticTreeReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x83'),require(_0xaf2c('0x84')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x85'),require(_0xaf2c('0x86')));_0x3a724c[_0xaf2c('0xa')]('/api/integrations/salesforce/fields',require(_0xaf2c('0x87')));_0x3a724c[_0xaf2c('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xaf2c('0x88')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x89'),require(_0xaf2c('0x8a')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x8b'),require(_0xaf2c('0x8c')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x8d'),require(_0xaf2c('0x8e')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x8f'),require(_0xaf2c('0x90')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x91'),require(_0xaf2c('0x92')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x93'),require(_0xaf2c('0x94')));_0x3a724c[_0xaf2c('0xa')]('/api/integrations/zoho/configurations',require(_0xaf2c('0x95')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x96'),require('./api/intZohoField'));_0x3a724c[_0xaf2c('0xa')]('/api/integrations/zendesk/accounts',require(_0xaf2c('0x97')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x98'),require(_0xaf2c('0x99')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x9a'),require(_0xaf2c('0x9b')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x9c'),require('./api/intFreshdeskAccount'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x9d'),require(_0xaf2c('0x9e')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0x9f'),require('./api/intFreshdeskField'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa0'),require('./api/intVtigerAccount'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa1'),require('./api/intVtigerConfiguration'));_0x3a724c['use'](_0xaf2c('0xa2'),require(_0xaf2c('0xa3')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa4'),require('./api/intServicenowAccount'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa5'),require('./api/intServicenowConfiguration'));_0x3a724c[_0xaf2c('0xa')]('/api/integrations/servicenow/fields',require(_0xaf2c('0xa6')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa7'),require(_0xaf2c('0xa8')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xa9'),require(_0xaf2c('0xaa')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xab'),require(_0xaf2c('0xac')));_0x3a724c['use'](_0xaf2c('0xad'),require(_0xaf2c('0xae')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xaf'),require(_0xaf2c('0xb0')));_0x3a724c['use'](_0xaf2c('0xb1'),require(_0xaf2c('0xb2')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xb3'),require(_0xaf2c('0xb4')));_0x3a724c['use']('/api/chat/reports/queue',require(_0xaf2c('0xb5')));_0x3a724c[_0xaf2c('0xa')]('/api/chat/internal/messages',require(_0xaf2c('0xb6')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xb7'),require('./api/jscriptyAnswerReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xb8'),require(_0xaf2c('0xb9')));_0x3a724c[_0xaf2c('0xa')]('/api/jscripty/sessions/reports',require(_0xaf2c('0xba')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xbb'),require(_0xaf2c('0xbc')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xbd'),require(_0xaf2c('0xbe')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xbf'),require(_0xaf2c('0xc0')));_0x3a724c[_0xaf2c('0xa')]('/api/jscripty/projects',require(_0xaf2c('0xc1')));_0x3a724c['use'](_0xaf2c('0xc2'),require(_0xaf2c('0xc3')));_0x3a724c['use'](_0xaf2c('0xc4'),require('./api/squareOdbc'));_0x3a724c['use'](_0xaf2c('0xc5'),require(_0xaf2c('0xc6')));_0x3a724c[_0xaf2c('0xa')]('/api/square/recordings',require('./api/squareRecording'));_0x3a724c['use'](_0xaf2c('0xc7'),require(_0xaf2c('0xc8')));_0x3a724c['use'](_0xaf2c('0xc9'),require(_0xaf2c('0xca')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xcb'),require(_0xaf2c('0xcc')));_0x3a724c[_0xaf2c('0xa')]('/api/campaigns',require(_0xaf2c('0xcd')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xce'),require('./api/migration'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xcf'),require(_0xaf2c('0xd0')));_0x3a724c['use'](_0xaf2c('0xd1'),require(_0xaf2c('0xd2')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xd3'),require('./api/mailTransferReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xd4'),require(_0xaf2c('0xd5')));_0x3a724c['use']('/api/fax/reports/transfer',require(_0xaf2c('0xd6')));_0x3a724c[_0xaf2c('0xa')]('/api/openchannel/reports/transfer',require(_0xaf2c('0xd7')));_0x3a724c[_0xaf2c('0xa')]('/api/sms/reports/transfer',require(_0xaf2c('0xd8')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xd9'),require(_0xaf2c('0xda')));_0x3a724c[_0xaf2c('0xa')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xdb'),require(_0xaf2c('0xdc')));_0x3a724c['use'](_0xaf2c('0xdd'),require(_0xaf2c('0xde')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xdf'),require(_0xaf2c('0xe0')));_0x3a724c['use'](_0xaf2c('0xe1'),require(_0xaf2c('0xe2')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xe3'),require(_0xaf2c('0xe4')));_0x3a724c[_0xaf2c('0xa')]('/api/whatsapp/applications',require(_0xaf2c('0xe5')));_0x3a724c[_0xaf2c('0xa')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x3a724c['use'](_0xaf2c('0xe6'),require(_0xaf2c('0xe7')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xe8'),require('./api/whatsappQueueReport'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xe9'),require(_0xaf2c('0xea')));_0x3a724c[_0xaf2c('0xa')]('/api/whatsapp/queues',require(_0xaf2c('0xeb')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xec'),require(_0xaf2c('0xed')));_0x3a724c[_0xaf2c('0xa')]('/api/realtime',require(_0xaf2c('0xee')));_0x3a724c[_0xaf2c('0xa')]('/api/user-settings',require('./api/user-setting'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xef'),require('./api/authLocal'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xf0'),require(_0xaf2c('0xf1')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xf2'),require(_0xaf2c('0xf3')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xf4'),require('./api/jira'));_0x3a724c[_0xaf2c('0xa')]('/api/rpc',require(_0xaf2c('0xf5')));_0x3a724c[_0xaf2c('0xa')]('/api/version',require('./api/version'));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xf6'),require(_0xaf2c('0xf7')));_0x3a724c['use'](_0xaf2c('0xf8'),require(_0xaf2c('0xf9')));_0x3a724c[_0xaf2c('0xa')]('/api/webbar',require('./api/webbar'));_0x3a724c['use']('/api/logs',clientSideLogs);_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xfa'),express[_0xaf2c('0xfb')](path[_0xaf2c('0xfc')](config[_0xaf2c('0xfd')],'/apidoc')));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xfe'),express['static'](path[_0xaf2c('0xfc')](config['root'],_0xaf2c('0xfe'))));_0x3a724c[_0xaf2c('0xa')](_0xaf2c('0xff'),express[_0xaf2c('0xfb')](path[_0xaf2c('0xfc')](config[_0xaf2c('0xfd')],'/demo')));_0x3a724c['use'](_0xaf2c('0x100'),express[_0xaf2c('0xfb')](path[_0xaf2c('0xfc')](config[_0xaf2c('0xfd')],_0xaf2c('0x101'),_0xaf2c('0x102'))));_0x3a724c['use']('/plugins',express[_0xaf2c('0xfb')](path['join'](config[_0xaf2c('0xfd')],'/server/files/plugins')));_0x3a724c[_0xaf2c('0x103')](_0xaf2c('0x104'))['get'](errors[0x194]);_0x3a724c[_0xaf2c('0x103')]('/*')[_0xaf2c('0x105')](function(_0x1e3cf2,_0x52230f){_0x52230f[_0xaf2c('0x106')](path[_0xaf2c('0x107')](_0x3a724c[_0xaf2c('0x105')](_0xaf2c('0x108'))+_0xaf2c('0x109')));});return _0x3a724c;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 13f56c4..39784a3 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46b6=['RPC\x20listening\x20on\x20','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.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/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default'];(function(_0x392fca,_0x542e80){var _0xf7883c=function(_0x2667cc){while(--_0x2667cc){_0x392fca['push'](_0x392fca['shift']());}};_0xf7883c(++_0x542e80);}(_0x46b6,0x19f));var _0x646b=function(_0x5976af,_0x2e69e8){_0x5976af=_0x5976af-0x0;var _0x48aab6=_0x46b6[_0x5976af];return _0x48aab6;};'use strict';var jayson=require('jayson/promise');var _=require(_0x646b('0x0'));var config=require('../config/environment');exports[_0x646b('0x1')]=function(){return new Promise(function(_0x3cc6bd,_0x24544f){var _0x110d3e={};_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x3')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x4')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x5')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x6')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x7')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x8')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x9')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0xa')));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0xb')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0xc')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0xd')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0xe')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/mailQueue/mailQueue.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0xf')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x10')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x11')));_0x110d3e=_['merge'](_0x110d3e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x12')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x13')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x14')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x15')));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x16')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x17')));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x18')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x19')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x1a')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x1b')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x1c')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x1d')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x1e')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x1f')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x20')));_0x110d3e=_['merge'](_0x110d3e,require('../api/chatQueue/chatQueue.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x21')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/cmHopper/cmHopper.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x22')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x23')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x24')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x25')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x26')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/pause/pause.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x27')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x28')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/trigger/trigger.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x29')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x2a')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x2b')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x2c')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x2d')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x2e')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x2f')));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x30')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x31')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x32')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/squareReport/squareReport.rpc'));_0x110d3e=_['merge'](_0x110d3e,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x33')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x34')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x35')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/squareRecording/squareRecording.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x36')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/campaign/campaign.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/attachment/attachment.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require('../api/plugin/plugin.rpc'));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x37')));_0x110d3e=_['merge'](_0x110d3e,require(_0x646b('0x38')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x39')));_0x110d3e=_[_0x646b('0x2')](_0x110d3e,require(_0x646b('0x3a')));_0x110d3e=_['merge'](_0x110d3e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x507b43=jayson[_0x646b('0x3b')](_0x110d3e)[_0x646b('0x3c')]();var _0x1f02d9=config[_0x646b('0x3d')][_0x646b('0x3e')]||config[_0x646b('0x3e')]+0x1;var _0x79c301=config[_0x646b('0x3d')]['ip']||_0x646b('0x3f');_0x507b43['on'](_0x646b('0x40'),function(_0x3dfc93){return _0x24544f(_0x3dfc93);});_0x507b43[_0x646b('0x1')](_0x1f02d9,_0x79c301,function(){console[_0x646b('0x41')](_0x646b('0x42'),_0x79c301,_0x1f02d9);require('../config/triggers')[_0x646b('0x43')]();return _0x3cc6bd(_0x646b('0x44')+_0x79c301+':'+_0x1f02d9);});});}; \ No newline at end of file +var _0x45e9=['../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','localhost','error','../config/triggers','jayson/promise','lodash','listen','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/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.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/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x45e9,0x120));var _0x945e=function(_0x3dd974,_0x4ee28b){_0x3dd974=_0x3dd974-0x0;var _0x54cdd5=_0x45e9[_0x3dd974];return _0x54cdd5;};'use strict';var jayson=require(_0x945e('0x0'));var _=require(_0x945e('0x1'));var config=require('../config/environment');exports[_0x945e('0x2')]=function(){return new Promise(function(_0x2d2569,_0xde47cb){var _0x5a2bff={};_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/user/user.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x4')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x5')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/voiceRecording/voiceRecording.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x6')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x7')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x8')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x9')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0xa')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0xb')));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0xc')));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0xd')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0xe')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/mailQueue/mailQueue.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/mailInteraction/mailInteraction.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0xf')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x10')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x11')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x12')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x13')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x14')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/faxMessage/faxMessage.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x15')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x16')));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x17')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x18')));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x19')));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x1a')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x1b')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x1c')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x1d')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x1e')));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x1f')));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/cmHopper/cmHopper.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x20')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x21')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x22')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x23')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/interval/interval.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x24')));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x25')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x26')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x27')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x28')));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x29')));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2a')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2b')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2c')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2d')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2e')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x2f')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x30')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x31')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x32')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x33')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x34')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x35')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x36')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/squareRecording/squareRecording.rpc'));_0x5a2bff=_['merge'](_0x5a2bff,require('../api/squareMessage/squareMessage.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/campaign/campaign.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x37')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/plugin/plugin.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x38')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require(_0x945e('0x39')));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5a2bff=_[_0x945e('0x3')](_0x5a2bff,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5a2bff=_['merge'](_0x5a2bff,require(_0x945e('0x3a')));var _0x2ff146=jayson[_0x945e('0x3b')](_0x5a2bff)[_0x945e('0x3c')]();var _0x54cf6a=config[_0x945e('0x3d')]['port']||config['port']+0x1;var _0x36cc40=config[_0x945e('0x3d')]['ip']||_0x945e('0x3e');_0x2ff146['on'](_0x945e('0x3f'),function(_0x4a5008){return _0xde47cb(_0x4a5008);});_0x2ff146['listen'](_0x54cf6a,_0x36cc40,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x36cc40,_0x54cf6a);require(_0x945e('0x40'))['default']();return _0x2d2569('RPC\x20listening\x20on\x20'+_0x36cc40+':'+_0x54cf6a);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 667eb44..832a82b 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 _0x8786=['util','events','EventEmitter','call','setEncoding','utf8','setTimeout','ready','line','emit','hangup','search','function','substring','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','beep','format','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports'];(function(_0x1a324f,_0x4e069f){var _0x1ffad5=function(_0x4cbc2b){while(--_0x4cbc2b){_0x1a324f['push'](_0x1a324f['shift']());}};_0x1ffad5(++_0x4e069f);}(_0x8786,0x138));var _0x6878=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8786[_0x2641f9];return _0x585741;};'use strict';var util=require(_0x6878('0x0'));var _=require('lodash');var EventEmitter=require(_0x6878('0x1'))[_0x6878('0x2')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0xbd9155){var _0x463b3a=this,_0x5a1caa=new AGIReply(),_0x2820bf=![],_0x3a3903={};EventEmitter[_0x6878('0x3')](_0x463b3a);_0xbd9155[_0x6878('0x4')](_0x6878('0x5'));_0xbd9155[_0x6878('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5a1caa[_0x6878('0x4')](_0x6878('0x5'));_0x5a1caa['on']('headers',function(_0x4b707d){for(var _0x4ddc1c in _0x4b707d){_0x463b3a[_0x4ddc1c]=_0x4b707d[_0x4ddc1c];}_0x463b3a['emit'](_0x6878('0x7'));});_0x5a1caa['on'](_0x6878('0x8'),function(_0x11e66b){if(_0x11e66b['toLowerCase']()=='hangup'){_0x463b3a[_0x6878('0x9')](_0x6878('0xa'));return;}if(_0x11e66b['substring'](0x0,0xb)=='520-Invalid'){_0x2820bf=!![];}if(_0x2820bf){_0x3a3903['rx']+=_0x11e66b+'\x0a';if(_0x11e66b[_0x6878('0xb')]('520\x20End\x20of\x20proper')!=-0x1){_0x2820bf=![];}}else{_0x3a3903['rx']=_0x11e66b;}if(_0x2820bf){return;}if(typeof _0x3a3903['cb']==_0x6878('0xc')){var _0x502913=_0x3a3903['rx'][_0x6878('0xd')](0x0,0x3),_0x367c7b=null,_0x4901c5=null;_0x502913=parseInt(_0x502913);if(isNaN(_0x502913)){_0x3a3903['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6878('0xe')});return;}if(_0x502913!=0xc8){_0x3a3903['cb'](null,{'code':_0x502913,'result':-0x1,'extra':'KO'});return;}_0x367c7b=_0x3a3903['rx']['substring'](0x4)[_0x6878('0xf')](_0x6878('0x10'),'');if(_0x367c7b['indexOf']('\x20')!=-0x1){_0x367c7b=_0x367c7b[_0x6878('0x11')](0x0,_0x367c7b[_0x6878('0x12')]('\x20'));}if(_[_0x6878('0x13')](_0x367c7b,'-1')){_0x367c7b=parseInt(_0x367c7b);}_0x4901c5=_0x3a3903['rx']['split']('\x20');if(_0x4901c5[_0x6878('0x14')]==0x3){_0x4901c5=_0x4901c5[0x2][_0x6878('0xd')](0x1,_0x4901c5[0x2][_0x6878('0x14')]-0x1);}else if(_0x4901c5['length']>0x3){var _0x11efbf=/\((.+)\)/;var _0x8036e2=_0x3a3903['rx'][_0x6878('0x15')](_0x11efbf);if(_0x8036e2){_0x4901c5=_0x8036e2[0x1];}else{_0x4901c5=null;}}else{_0x4901c5=null;}_0x3a3903['cb'](null,{'code':_0x502913,'result':_0x367c7b,'extra':_0x4901c5});}});_0xbd9155['on'](_0x6878('0x16'),function(_0x284b21){_0x463b3a[_0x6878('0x9')](_0x6878('0x16'),new AGIError(_0x6878('0x17'),_0x284b21['code']));});_0xbd9155['on'](_0x6878('0x18'),function(){_0x463b3a[_0x6878('0x9')](_0x6878('0x18'),new AGIError(_0x6878('0x19')));});_0xbd9155['on']('timeout',function(){_0x463b3a[_0x6878('0x9')](_0x6878('0x1a'),new AGIError(_0x6878('0x1b')));_0xbd9155[_0x6878('0x1c')]();});_0xbd9155[_0x6878('0x1d')](_0x5a1caa);this['command']=function(_0x298ff0,_0x1e93e5){var _0x298ff0=_0x298ff0||'',_0x1e93e5=typeof _0x1e93e5=='function'?_0x1e93e5:new Function();_0x3a3903={'tx':_0x298ff0,'rx':'','cb':_0x1e93e5};_0xbd9155[_0x6878('0x1e')](_0x298ff0+'\x0a');},this[_0x6878('0x18')]=function(){_0xbd9155[_0x6878('0x1c')]();};}util[_0x6878('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x6878('0x20')][_0x6878('0x21')]=function(_0x496825){return this[_0x6878('0x22')][_0x6878('0x23')](this,_0x496825);};AGIChannel[_0x6878('0x20')][_0x6878('0x24')]=function(){return this[_0x6878('0x21')](_0x6878('0x25'));};AGIChannel[_0x6878('0x20')]['getData']=function(_0x1b8b48,_0x304c1f,_0x225c3a){_0x1b8b48=_0x1b8b48===undefined?_0x6878('0x26'):_0x1b8b48;_0x304c1f=_0x304c1f===undefined?'5':_0x304c1f;_0x225c3a=_0x225c3a===undefined?'1':_0x225c3a;return this[_0x6878('0x21')](util[_0x6878('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x1b8b48,_0x304c1f*0x3e8,_0x225c3a));};AGIChannel[_0x6878('0x20')][_0x6878('0x28')]=function(_0x563657){_0x563657=_0x563657||'NO\x20MESSAGE';return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x29'),_0x563657));};AGIChannel[_0x6878('0x20')][_0x6878('0x2a')]=function(_0x10f41c,_0x3a3cfe){if(_[_0x6878('0x2b')](_0x3a3cfe)){return this['sendRequest'](util['format'](_0x6878('0x2c'),_0x10f41c,_0x3a3cfe[_0x6878('0x2d')](',')));}return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x2c'),_0x10f41c,_0x3a3cfe));};AGIChannel[_0x6878('0x20')][_0x6878('0x2e')]=function(_0x154441){return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x2f'),_0x154441));};AGIChannel[_0x6878('0x20')][_0x6878('0x30')]=function(_0x4ff291){return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x31'),_0x4ff291));};AGIChannel[_0x6878('0x20')][_0x6878('0x32')]=function(_0x5282a1){return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x33'),_0x5282a1));};AGIChannel['prototype'][_0x6878('0xa')]=function(){return this[_0x6878('0x21')](_0x6878('0x34'));};AGIChannel[_0x6878('0x20')]['setVariable']=function(_0x171471,_0x1a409e){var _0x627226=_[_0x6878('0x35')](_0x1a409e)||_[_0x6878('0x36')](_0x1a409e)?_0x1a409e['toString']():_0x1a409e;return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x37'),_0x171471,_0x627226?_0x627226[_0x6878('0x38')]()[_0x6878('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6878('0x20')][_0x6878('0x39')]=function(_0x421be6,_0x4c5dc2){return this['sendRequest'](util[_0x6878('0x27')]('SAY\x20NUMBER\x20%s\x20%s',_0x421be6,_0x4c5dc2));};AGIChannel[_0x6878('0x20')]['sayDigits']=function(_0x315289,_0x48e901){return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x3a'),_0x315289,_0x48e901));};AGIChannel[_0x6878('0x20')][_0x6878('0x3b')]=function(_0x4b0948,_0x4b0824){return this['sendRequest'](util[_0x6878('0x27')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x4b0948,_0x4b0824));};AGIChannel['prototype'][_0x6878('0x3c')]=function(_0x235855,_0x1b7560,_0x5069b8){_0x1b7560=_0x1b7560||this[_0x6878('0x3d')];_0x5069b8=_0x5069b8||0x1;this[_0x6878('0x2e')](_0x235855);this['setExtension'](_0x1b7560);this['setPriority'](_0x5069b8);return this[_0x6878('0x28')](util['format'](_0x6878('0x3e'),_0x235855,_0x1b7560,_0x5069b8));};AGIChannel[_0x6878('0x20')][_0x6878('0x3f')]=function(_0x1681fb){return this['sendRequest'](util[_0x6878('0x27')](_0x6878('0x40'),_0x1681fb));};AGIChannel[_0x6878('0x20')][_0x6878('0x41')]=function(_0x48e001,_0x1471bb,_0x1cfec7,_0x2e95a5,_0x4411c8,_0x54a6cf){_0x1471bb=_0x1471bb||_0x6878('0x42');_0x1cfec7=_0x1cfec7||'';_0x2e95a5=_0x2e95a5===undefined?-0x1:_0x2e95a5==='-1'?-0x1:_0x2e95a5*0x3e8;_0x4411c8=_0x4411c8===undefined?'':'s='+_0x4411c8;_0x54a6cf=_0x54a6cf?_0x6878('0x43'):'';return this[_0x6878('0x21')](util['format'](_0x6878('0x44'),_0x48e001,_0x1471bb,_0x1cfec7,_0x2e95a5,_0x54a6cf,_0x4411c8));};AGIChannel[_0x6878('0x20')][_0x6878('0x45')]=function(_0x59f9f8,_0x185d20){_0x185d20=_0x185d20||'';return this[_0x6878('0x21')](util[_0x6878('0x27')](_0x6878('0x46'),_0x59f9f8,_0x185d20));};AGIChannel[_0x6878('0x20')][_0x6878('0x47')]=function(_0x2a16e4){return this['exec'](_0x6878('0x48'),_0x2a16e4);};AGIChannel[_0x6878('0x20')][_0x6878('0x49')]=function(_0x4b1a55){return this[_0x6878('0x2a')](_0x6878('0x4a'),_0x4b1a55);};AGIChannel[_0x6878('0x20')][_0x6878('0x16')]=function(_0x3b816e,_0x31aaef){this['noop'](util[_0x6878('0x27')](_0x6878('0x4b'),_0x3b816e['id'],_0x3b816e[_0x6878('0x4c')],_0x31aaef));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6878('0x4d')]=AGIChannel; \ No newline at end of file +var _0x3de9=['SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','inherits','prototype','sendRequest','sync','answer','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits'];(function(_0xf00a96,_0x429578){var _0x33b9d8=function(_0x4c3a12){while(--_0x4c3a12){_0xf00a96['push'](_0xf00a96['shift']());}};_0x33b9d8(++_0x429578);}(_0x3de9,0x1b9));var _0x93de=function(_0x3a1880,_0x465dc1){_0x3a1880=_0x3a1880-0x0;var _0x448f25=_0x3de9[_0x3a1880];return _0x448f25;};'use strict';var util=require(_0x93de('0x0'));var _=require('lodash');var EventEmitter=require(_0x93de('0x1'))[_0x93de('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x93de('0x3'));function AGIChannel(_0x1d0b0b){var _0x23ace3=this,_0x371fd8=new AGIReply(),_0x2ca00c=![],_0x6fced3={};EventEmitter[_0x93de('0x4')](_0x23ace3);_0x1d0b0b[_0x93de('0x5')](_0x93de('0x6'));_0x1d0b0b['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x371fd8[_0x93de('0x5')](_0x93de('0x6'));_0x371fd8['on'](_0x93de('0x7'),function(_0x273a3d){for(var _0x1aef25 in _0x273a3d){_0x23ace3[_0x1aef25]=_0x273a3d[_0x1aef25];}_0x23ace3[_0x93de('0x8')]('ready');});_0x371fd8['on']('line',function(_0x2b1710){if(_0x2b1710['toLowerCase']()==_0x93de('0x9')){_0x23ace3[_0x93de('0x8')](_0x93de('0x9'));return;}if(_0x2b1710[_0x93de('0xa')](0x0,0xb)==_0x93de('0xb')){_0x2ca00c=!![];}if(_0x2ca00c){_0x6fced3['rx']+=_0x2b1710+'\x0a';if(_0x2b1710[_0x93de('0xc')](_0x93de('0xd'))!=-0x1){_0x2ca00c=![];}}else{_0x6fced3['rx']=_0x2b1710;}if(_0x2ca00c){return;}if(typeof _0x6fced3['cb']==_0x93de('0xe')){var _0x273a50=_0x6fced3['rx'][_0x93de('0xa')](0x0,0x3),_0x1bd74c=null,_0x24a1fe=null;_0x273a50=parseInt(_0x273a50);if(isNaN(_0x273a50)){_0x6fced3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x93de('0xf')});return;}if(_0x273a50!=0xc8){_0x6fced3['cb'](null,{'code':_0x273a50,'result':-0x1,'extra':'KO'});return;}_0x1bd74c=_0x6fced3['rx'][_0x93de('0xa')](0x4)[_0x93de('0x10')](_0x93de('0x11'),'');if(_0x1bd74c[_0x93de('0x12')]('\x20')!=-0x1){_0x1bd74c=_0x1bd74c['substr'](0x0,_0x1bd74c['indexOf']('\x20'));}if(_[_0x93de('0x13')](_0x1bd74c,'-1')){_0x1bd74c=parseInt(_0x1bd74c);}_0x24a1fe=_0x6fced3['rx']['split']('\x20');if(_0x24a1fe[_0x93de('0x14')]==0x3){_0x24a1fe=_0x24a1fe[0x2][_0x93de('0xa')](0x1,_0x24a1fe[0x2][_0x93de('0x14')]-0x1);}else if(_0x24a1fe['length']>0x3){var _0x2ddb7c=/\((.+)\)/;var _0x30b95c=_0x6fced3['rx'][_0x93de('0x15')](_0x2ddb7c);if(_0x30b95c){_0x24a1fe=_0x30b95c[0x1];}else{_0x24a1fe=null;}}else{_0x24a1fe=null;}_0x6fced3['cb'](null,{'code':_0x273a50,'result':_0x1bd74c,'extra':_0x24a1fe});}});_0x1d0b0b['on']('error',function(_0x3c9c19){_0x23ace3[_0x93de('0x8')](_0x93de('0x16'),new AGIError(_0x93de('0x17'),_0x3c9c19['code']));});_0x1d0b0b['on'](_0x93de('0x18'),function(){_0x23ace3[_0x93de('0x8')](_0x93de('0x18'),new AGIError(_0x93de('0x19')));});_0x1d0b0b['on'](_0x93de('0x1a'),function(){_0x23ace3['emit'](_0x93de('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1d0b0b[_0x93de('0x1b')]();});_0x1d0b0b[_0x93de('0x1c')](_0x371fd8);this[_0x93de('0x1d')]=function(_0x1ca228,_0x13b5ea){var _0x1ca228=_0x1ca228||'',_0x13b5ea=typeof _0x13b5ea==_0x93de('0xe')?_0x13b5ea:new Function();_0x6fced3={'tx':_0x1ca228,'rx':'','cb':_0x13b5ea};_0x1d0b0b['write'](_0x1ca228+'\x0a');},this['close']=function(){_0x1d0b0b[_0x93de('0x1b')]();};}util[_0x93de('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x93de('0x1f')][_0x93de('0x20')]=function(_0x5bfa01){return this[_0x93de('0x1d')][_0x93de('0x21')](this,_0x5bfa01);};AGIChannel[_0x93de('0x1f')][_0x93de('0x22')]=function(){return this[_0x93de('0x20')]('ANSWER');};AGIChannel[_0x93de('0x1f')][_0x93de('0x23')]=function(_0x419b73,_0x56a448,_0x1b8ed8){_0x419b73=_0x419b73===undefined?'beep':_0x419b73;_0x56a448=_0x56a448===undefined?'5':_0x56a448;_0x1b8ed8=_0x1b8ed8===undefined?'1':_0x1b8ed8;return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x25'),_0x419b73,_0x56a448*0x3e8,_0x1b8ed8));};AGIChannel['prototype'][_0x93de('0x26')]=function(_0x4ad831){_0x4ad831=_0x4ad831||'NO\x20MESSAGE';return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x27'),_0x4ad831));};AGIChannel[_0x93de('0x1f')]['exec']=function(_0xd1bfc0,_0x530f69){if(_[_0x93de('0x28')](_0x530f69)){return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x29'),_0xd1bfc0,_0x530f69[_0x93de('0x2a')](',')));}return this[_0x93de('0x20')](util[_0x93de('0x24')]('EXEC\x20%s\x20%s',_0xd1bfc0,_0x530f69));};AGIChannel['prototype'][_0x93de('0x2b')]=function(_0x18936b){return this[_0x93de('0x20')](util['format'](_0x93de('0x2c'),_0x18936b));};AGIChannel[_0x93de('0x1f')][_0x93de('0x2d')]=function(_0x5b2ee9){return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x2e'),_0x5b2ee9));};AGIChannel['prototype'][_0x93de('0x2f')]=function(_0x1dc5f6){return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x30'),_0x1dc5f6));};AGIChannel['prototype']['hangup']=function(){return this[_0x93de('0x20')]('HANGUP');};AGIChannel[_0x93de('0x1f')][_0x93de('0x31')]=function(_0x18e3b2,_0xce8cc5){var _0x2b252f=_[_0x93de('0x32')](_0xce8cc5)||_[_0x93de('0x33')](_0xce8cc5)?_0xce8cc5[_0x93de('0x34')]():_0xce8cc5;return this[_0x93de('0x20')](util['format'](_0x93de('0x35'),_0x18e3b2,_0x2b252f?_0x2b252f['toString']()[_0x93de('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x93de('0x36')]=function(_0x2c7f57,_0x305316){return this['sendRequest'](util[_0x93de('0x24')]('SAY\x20NUMBER\x20%s\x20%s',_0x2c7f57,_0x305316));};AGIChannel[_0x93de('0x1f')][_0x93de('0x37')]=function(_0x26971c,_0x4a38d5){return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x38'),_0x26971c,_0x4a38d5));};AGIChannel[_0x93de('0x1f')][_0x93de('0x39')]=function(_0x13e279,_0x304f35){return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x3a'),_0x13e279,_0x304f35));};AGIChannel['prototype'][_0x93de('0x3b')]=function(_0x51d8a8,_0x53a62d,_0x1de262){_0x53a62d=_0x53a62d||this[_0x93de('0x3c')];_0x1de262=_0x1de262||0x1;this['setContext'](_0x51d8a8);this[_0x93de('0x2d')](_0x53a62d);this[_0x93de('0x2f')](_0x1de262);return this[_0x93de('0x26')](util[_0x93de('0x24')](_0x93de('0x3d'),_0x51d8a8,_0x53a62d,_0x1de262));};AGIChannel['prototype'][_0x93de('0x3e')]=function(_0x3ffebb){return this[_0x93de('0x20')](util[_0x93de('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3ffebb));};AGIChannel['prototype'][_0x93de('0x3f')]=function(_0x4d396a,_0x41a781,_0xbc863f,_0x203aa8,_0x3dfbe3,_0x25e80e){_0x41a781=_0x41a781||_0x93de('0x40');_0xbc863f=_0xbc863f||'';_0x203aa8=_0x203aa8===undefined?-0x1:_0x203aa8==='-1'?-0x1:_0x203aa8*0x3e8;_0x3dfbe3=_0x3dfbe3===undefined?'':'s='+_0x3dfbe3;_0x25e80e=_0x25e80e?'BEEP':'';return this[_0x93de('0x20')](util[_0x93de('0x24')](_0x93de('0x41'),_0x4d396a,_0x41a781,_0xbc863f,_0x203aa8,_0x25e80e,_0x3dfbe3));};AGIChannel[_0x93de('0x1f')]['streamFile']=function(_0x157ad5,_0x2f1e21){_0x2f1e21=_0x2f1e21||'';return this[_0x93de('0x20')](util[_0x93de('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x157ad5,_0x2f1e21));};AGIChannel[_0x93de('0x1f')]['agi']=function(_0x1b9b35){return this[_0x93de('0x42')]('AGI',_0x1b9b35);};AGIChannel[_0x93de('0x1f')][_0x93de('0x43')]=function(_0x19d432){return this['exec'](_0x93de('0x44'),_0x19d432);};AGIChannel[_0x93de('0x1f')][_0x93de('0x16')]=function(_0x5916a6,_0x2424e7){this[_0x93de('0x26')](util[_0x93de('0x24')](_0x93de('0x45'),_0x5916a6['id'],_0x5916a6[_0x93de('0x46')],_0x2424e7));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4181eb1..88bb6a8 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 _0xa5a2=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x45eec5,_0x3466cd){var _0x2f827c=function(_0x34d678){while(--_0x34d678){_0x45eec5['push'](_0x45eec5['shift']());}};_0x2f827c(++_0x3466cd);}(_0xa5a2,0x1e7));var _0x2a5a=function(_0x417936,_0x32971e){_0x417936=_0x417936-0x0;var _0x57c496=_0xa5a2[_0x417936];return _0x57c496;};'use strict';var util=require(_0x2a5a('0x0'));var error={'E_AGI_UNDEFINED':_0x2a5a('0x1'),'E_AGI_ARGUMENT_PORT':_0x2a5a('0x2'),'E_AGI_SERVER_ERROR':_0x2a5a('0x3'),'E_AGI_SERVER_CLOSE':_0x2a5a('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x2a5a('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x2a5a('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x2a5a('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x2a5a('0x8')};function AGIError(_0x5ff734){var _0x5ff734=_0x5ff734||null,_0x10d721=_0x10d721||[],_0x1ce622=0x1,_0x387a6b='';if(!error[_0x5ff734]){_0x5ff734=_0x2a5a('0x9');}_0x10d721[_0x2a5a('0xa')](error[_0x5ff734]);while(arguments[_0x1ce622]){_0x10d721[_0x2a5a('0xa')](arguments[_0x1ce622]);_0x1ce622++;}_0x387a6b=util['format']['apply'](util,_0x10d721);this[_0x2a5a('0xb')]=_0x387a6b;this[_0x2a5a('0xc')]=_0x5ff734;}module[_0x2a5a('0xd')]=AGIError; \ No newline at end of file +var _0xfcb8=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfcb8,0xd3));var _0x8fcb=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0xfcb8[_0x29d849];return _0x30b104;};'use strict';var util=require(_0x8fcb('0x0'));var error={'E_AGI_UNDEFINED':_0x8fcb('0x1'),'E_AGI_ARGUMENT_PORT':_0x8fcb('0x2'),'E_AGI_SERVER_ERROR':_0x8fcb('0x3'),'E_AGI_SERVER_CLOSE':_0x8fcb('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x8fcb('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x8fcb('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8fcb('0x7'),'E_AGI_COMMAND_EMPTY':_0x8fcb('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8fcb('0x9'),'E_AGI_IVR_ENTRY':_0x8fcb('0xa')};function AGIError(_0x302aff){var _0x302aff=_0x302aff||null,_0x192c55=_0x192c55||[],_0x3dfe5b=0x1,_0x32c296='';if(!error[_0x302aff]){_0x302aff=_0x8fcb('0xb');}_0x192c55[_0x8fcb('0xc')](error[_0x302aff]);while(arguments[_0x3dfe5b]){_0x192c55[_0x8fcb('0xc')](arguments[_0x3dfe5b]);_0x3dfe5b++;}_0x32c296=util['format']['apply'](util,_0x192c55);this[_0x8fcb('0xd')]=_0x32c296;this['name']=_0x302aff;}module[_0x8fcb('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 1467241..f176ddf 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 _0x6046=['getsecretdigits','vertices','addVertex','edges','prototype','addEdge','push','numberOfEdges','size','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','getdigits'];(function(_0x42c697,_0x52a3b8){var _0x797e3c=function(_0x467c5e){while(--_0x467c5e){_0x42c697['push'](_0x42c697['shift']());}};_0x797e3c(++_0x52a3b8);}(_0x6046,0x1b0));var _0x6604=function(_0x558ef8,_0x1c82af){_0x558ef8=_0x558ef8-0x0;var _0x518125=_0x6046[_0x558ef8];return _0x518125;};'use strict';var _=require(_0x6604('0x0'));var logger=require(_0x6604('0x1'))('agi');var verticesWithRetry=['menu',_0x6604('0x2'),_0x6604('0x3')];var Graph=function(){this[_0x6604('0x4')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x6604('0x5')]=function(_0x38e05e){this['vertices'][_0x38e05e['id']]=_0x38e05e;this[_0x6604('0x6')][_0x38e05e['id']]=[];};Graph[_0x6604('0x7')][_0x6604('0x8')]=function(_0x38ba58,_0x2466b6,_0x36bc65){this[_0x6604('0x6')][_0x38ba58][_0x6604('0x9')]({'target':_0x2466b6,'condition':_0x36bc65});this[_0x6604('0xa')]+=0x1;};Graph[_0x6604('0x7')][_0x6604('0xb')]=function(){return _[_0x6604('0xb')](this['vertices']);};Graph[_0x6604('0x7')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x6604('0x7')]['getVertex']=function(_0x24f9a9){return this[_0x6604('0x4')][_0x24f9a9];};Graph[_0x6604('0x7')][_0x6604('0xc')]=function(_0x5c699a,_0xaed665){if(!this['vertices'][_0x5c699a]){return logger[_0x6604('0xd')]('no\x20vertex\x20found');}var _0x22dff0=_0xaed665(this['vertices'][_0x5c699a]);if(!_0x22dff0){return logger[_0x6604('0xd')](_0x6604('0xe'));}if(this['edges'][_0x5c699a][_0x6604('0xf')]===0x0){return logger['info'](_0x6604('0x10'));}for(var _0x25f85f=0x0,_0x504388=[],_0x2ca285=![];_0x25f85f\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','value','then','catch','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','evtHangup','sync','production','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','isUndefined','toString','response','agicommand\x20not\x20found','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening'];(function(_0x198a2f,_0x514411){var _0x288f89=function(_0x359542){while(--_0x359542){_0x198a2f['push'](_0x198a2f['shift']());}};_0x288f89(++_0x514411);}(_0x5f9b,0x1b4));var _0xb5f9=function(_0xdc5664,_0x4eef5a){_0xdc5664=_0xdc5664-0x0;var _0xd65a92=_0x5f9b[_0xdc5664];return _0xd65a92;};'use strict';var parser=require('xml2json');var _=require(_0xb5f9('0x0'));var syncho=require(_0xb5f9('0x1'));var util=require(_0xb5f9('0x2'));var moment=require(_0xb5f9('0x3'));var config=require(_0xb5f9('0x4'));var logger=require('../../config/logger')(_0xb5f9('0x5'));var utilLicense=require(_0xb5f9('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xb5f9('0x7'));var Graph=require(_0xb5f9('0x8'));var Vertices=require(_0xb5f9('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xb5f9('0x5')]=_[_0xb5f9('0xa')](config[_0xb5f9('0x5')],{'ip':_0xb5f9('0xb'),'port':0x11dd});function connectionHandler(_0x883eca){process[_0xb5f9('0xc')](function(){syncho(function(){try{setChannelVariables(_0x883eca);agiHandler(_0x883eca);}catch(_0x38b487){logger[_0xb5f9('0xd')](_0x38b487[_0xb5f9('0xe')]);}});});}function listeningHandler(){console[_0xb5f9('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb5f9('0x5')]['port']);logger[_0xb5f9('0x10')](util['format']('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xb5f9('0x5')]['ip'],config[_0xb5f9('0x5')]['port']));}function errorHandler(_0x3b05c3){if(_0x3b05c3&&_0x3b05c3[_0xb5f9('0x11')]&&_0x3b05c3[_0xb5f9('0x12')]){logger[_0xb5f9('0xd')](util[_0xb5f9('0x13')]('[%s]\x20%s',_0x3b05c3['name'],_0x3b05c3[_0xb5f9('0x12')]));}else{logger[_0xb5f9('0xd')](util[_0xb5f9('0x13')](_0xb5f9('0x14'),_0x3b05c3[_0xb5f9('0xe')]));}}function closeHandler(){logger['info'](util[_0xb5f9('0x13')](_0xb5f9('0x15'),this[_0xb5f9('0x16')],this[_0xb5f9('0x17')],this[_0xb5f9('0x18')],this[_0xb5f9('0x19')],this[_0xb5f9('0x1a')]));try{createSquareReport(this);}catch(_0x559898){logger[_0xb5f9('0xd')](_0x559898[_0xb5f9('0xe')]);}}function timeoutHandler(){logger[_0xb5f9('0x10')](util[_0xb5f9('0x13')](_0xb5f9('0x1b'),this['arg_1'],this[_0xb5f9('0x17')],this[_0xb5f9('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0xb5f9('0x10')](util[_0xb5f9('0x13')](_0xb5f9('0x1c'),this[_0xb5f9('0x16')],this['calleridname'],this[_0xb5f9('0x18')],this[_0xb5f9('0x19')],this[_0xb5f9('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x84e285){return parser[_0xb5f9('0x1d')](_0x84e285,{'object':!![]})[_0xb5f9('0x1e')][_0xb5f9('0x1f')];}function addVertex(_0x1af710,_0x4721c9,_0x26621b){_0x4721c9[_0xb5f9('0x20')]=_0x26621b;if(_0x4721c9[_0xb5f9('0x21')](_0xb5f9('0x22'))){_0x4721c9['maxRetry']=parseInt(_0x4721c9[_0xb5f9('0x22')],0xa);}_0x1af710[_0xb5f9('0x23')](_[_0xb5f9('0x24')](_0x4721c9,_0xb5f9('0x25')));}function initGraph(_0x2d965d,_0x312b43){var _0x1845f0=new Graph();for(var _0x4be9a6 in _0x2d965d){if(_0x2d965d['hasOwnProperty'](_0x4be9a6)){if(_[_0xb5f9('0x26')](_0x2d965d[_0x4be9a6])){for(var _0xf4e4fd=0x0;_0xf4e4fd<_0x2d965d[_0x4be9a6][_0xb5f9('0x27')];_0xf4e4fd+=0x1){addVertex(_0x1845f0,_0x2d965d[_0x4be9a6][_0xf4e4fd],_0x4be9a6);}}else{addVertex(_0x1845f0,_0x2d965d[_0x4be9a6],_0x4be9a6);}}}for(var _0x41ebad=0x0;_0x41ebad<_0x312b43['length'];_0x41ebad+=0x1){if(_0x312b43[_0x41ebad][_0xb5f9('0x28')]&&_0x312b43[_0x41ebad]['target']){_0x1845f0[_0xb5f9('0x29')](_0x312b43[_0x41ebad][_0xb5f9('0x28')],_0x312b43[_0x41ebad]['target'],_0x312b43[_0x41ebad][_0xb5f9('0x2a')]);}}return _0x1845f0;}function getSquareProject(_0x470f48,_0x4baa1a){rpc['getSquareProject'](_0x470f48)[_0xb5f9('0x2b')](function(_0x3b7e0b){_0x4baa1a(null,_0x3b7e0b);})[_0xb5f9('0x2c')](function(_0x9160e){_0x4baa1a(null,_0x9160e);});}function createSquareReport(_0x20a12b,_0x40a777){rpc['createSquareReport'](_0x20a12b)[_0xb5f9('0x2b')](function(_0x2ce8f0){if(_0x40a777){_0x40a777(null,_0x2ce8f0);}})[_0xb5f9('0x2c')](function(_0x15c74a){if(_0x40a777){_0x40a777(null,_0x15c74a);}});}function setChannelVariables(_0x4b02dd){for(var _0x1d4af6 in _0x4b02dd){if(_0x4b02dd[_0xb5f9('0x21')](_0x1d4af6)){if(_0x1d4af6[_0xb5f9('0x2d')](_0xb5f9('0x2e'))===0x0){_0x4b02dd[_0x1d4af6[_0xb5f9('0x2f')](0x4)]=_0x4b02dd[_0x1d4af6];delete _0x4b02dd[_0x1d4af6];}}}}function getLogFromObject(_0x5884aa){return util['inspect'](_0x5884aa,{'showHidden':![],'depth':null});}function agiHandler(_0xa01115){var _0x1304e8,_0x9eadf0,_0x2bedb6,_0x1af417,_0x293f59;logger['debug']('variables',JSON[_0xb5f9('0x30')](_0xa01115,null,0x2));logger[_0xb5f9('0x10')](util[_0xb5f9('0x13')](_0xb5f9('0x31'),_0xa01115[_0xb5f9('0x16')],_0xa01115[_0xb5f9('0x17')],_0xa01115['callerid'],_0xa01115[_0xb5f9('0x19')],_0xa01115[_0xb5f9('0x1a')]));_0xa01115['on']('error',errorHandler);_0xa01115['on']('close',closeHandler);_0xa01115['on'](_0xb5f9('0x32'),timeoutHandler);_0xa01115[_0xb5f9('0x33')]=![];_0xa01115['on']('hangup',hangupHandler);var _0x343273=getSquareProject[_0xb5f9('0x34')](null,_0xa01115[_0xb5f9('0x16')]);if(_0x343273){if(_0x343273[_0xb5f9('0x35')]){_0x1304e8=getRoot(_0x343273[_0xb5f9('0x35')]);if(_0x1304e8&&_0x1304e8['start']){logger[_0xb5f9('0x36')]('root',JSON[_0xb5f9('0x30')](_0x1304e8,null,0x2));_0xa01115[_0xb5f9('0x37')]=moment()[_0xb5f9('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x9eadf0=initGraph(_[_0xb5f9('0x24')](_0x1304e8,_0xb5f9('0x25')),_0x1304e8[_0xb5f9('0x25')]);_0x2bedb6=new Vertices(_0xa01115,rpc,mailRpc);logger['info'](util[_0xb5f9('0x13')](_0xb5f9('0x38'),_0xa01115['arg_1'],_0xa01115[_0xb5f9('0x17')],_0xa01115['callerid'],_0xa01115[_0xb5f9('0x19')],_0xa01115[_0xb5f9('0x1a')]));_0x9eadf0['traverseBFS'](_0x1304e8[_0xb5f9('0x39')]['id'],function(_0xd7be38){try{_0xd7be38=_0x2bedb6[_0xb5f9('0x3a')](_0xd7be38);logger['debug']('vertex',JSON[_0xb5f9('0x30')](_0xd7be38,null,0x2));if(_0xd7be38[_0xb5f9('0x20')]===_0xb5f9('0x3b')){logger['info'](_0xb5f9('0x3c'));_0xa01115[_0xb5f9('0x3d')]=_0xd7be38[_0xb5f9('0x3d')]||_0xa01115[_0xb5f9('0x3d')];_0xa01115[_0xb5f9('0x3e')]=_0xd7be38[_0xb5f9('0x3e')];_0xa01115[_0xb5f9('0x3f')]=_0xd7be38[_0xb5f9('0x3f')]?_0xd7be38[_0xb5f9('0x3f')]-0x1:0x1;return null;}else if(_0xd7be38&&_0x2bedb6[_0xd7be38[_0xb5f9('0x20')]]){_0x293f59=_0x2bedb6[_0xd7be38['agicommand']](_0xd7be38);logger[_0xb5f9('0x10')]('response',JSON['stringify'](_0x293f59,null,0x2));if(_0x293f59&&_0x293f59[_0xb5f9('0x40')]===AGI_CODE_SUCCESS&&_0x293f59[_0xb5f9('0x41')]!==AGI_RESULT_ERROR&&!_0xa01115[_0xb5f9('0x33')]){logger[_0xb5f9('0x36')]('response',getLogFromObject(_0x293f59));return _[_0xb5f9('0x42')](_0x293f59['result'])?null:_0x293f59[_0xb5f9('0x41')][_0xb5f9('0x43')]();}else{logger['error'](_0xb5f9('0x44'),getLogFromObject(_0x293f59));return null;}}else{logger['error'](_0xb5f9('0x45'));return null;}}catch(_0x264ec7){logger[_0xb5f9('0xd')](_0x264ec7[_0xb5f9('0xe')]);return null;}});if(_0x1304e8['finally']){logger[_0xb5f9('0x10')](util[_0xb5f9('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xa01115['arg_1'],_0xa01115[_0xb5f9('0x17')],_0xa01115['callerid'],_0xa01115[_0xb5f9('0x19')],_0xa01115['uniqueid']));_0x9eadf0['traverseBFS'](_0x1304e8['finally']['id'],function(_0x198c3e){try{_0x198c3e=_0x2bedb6[_0xb5f9('0x3a')](_0x198c3e);logger[_0xb5f9('0x36')](_0xb5f9('0x46'),JSON['stringify'](_0x198c3e,null,0x2));if(_0x198c3e&&_0x2bedb6[_0x198c3e[_0xb5f9('0x20')]]){_0x293f59=_0x2bedb6[_0x198c3e[_0xb5f9('0x20')]](_0x198c3e);if(_0x293f59){logger[_0xb5f9('0x36')]('response',getLogFromObject(_0x293f59));return _[_0xb5f9('0x42')](_0x293f59[_0xb5f9('0x41')])?null:_0x293f59['result'][_0xb5f9('0x43')]();}else{logger[_0xb5f9('0xd')](_0xb5f9('0x44'),getLogFromObject(_0x293f59));return null;}}else{logger['error'](_0xb5f9('0x45'));return null;}}catch(_0x381f52){logger['error'](_0x381f52[_0xb5f9('0xe')]);return null;}});}logger[_0xb5f9('0x10')](util[_0xb5f9('0x13')](_0xb5f9('0x47'),_0xa01115['arg_1'],_0xa01115[_0xb5f9('0x17')],_0xa01115['callerid'],_0xa01115[_0xb5f9('0x19')],_0xa01115['uniqueid']));logger['info'](util[_0xb5f9('0x13')](_0xb5f9('0x48'),_0xa01115[_0xb5f9('0x3d')],_0xa01115[_0xb5f9('0x3e')],parseInt(_0xa01115['priority'],0xa)+0x1));_0xa01115[_0xb5f9('0x49')](_0xa01115[_0xb5f9('0x3d')],_0xa01115[_0xb5f9('0x3e')],parseInt(_0xa01115[_0xb5f9('0x3f')],0xa)+0x1);_0xa01115[_0xb5f9('0x4a')]();}}else{logger[_0xb5f9('0xd')](util[_0xb5f9('0x13')](_0xb5f9('0x4b'),_0xa01115[_0xb5f9('0x16')]));_0xa01115['continueAt'](_0xa01115['context'],_0xa01115[_0xb5f9('0x3e')],parseInt(_0xa01115[_0xb5f9('0x3f')],0xa)+0x1);_0xa01115[_0xb5f9('0x4a')]();}}else{logger[_0xb5f9('0xd')](util[_0xb5f9('0x13')](_0xb5f9('0x4c'),_0xa01115['arg_1']));_0xa01115['continueAt'](_0xa01115['context'],_0xa01115[_0xb5f9('0x3e')],parseInt(_0xa01115['priority'],0xa)+0x1);_0xa01115[_0xb5f9('0x4a')]();}}function main(){var _0x198308;return utilLicense[_0xb5f9('0x4d')]()[_0xb5f9('0x2b')](function(_0x33686e){if(_0x33686e){if(_0x33686e[_0xb5f9('0x4e')]){if(_0x33686e[_0xb5f9('0x4f')]&&_0x33686e['callysquare']>0x0){logger[_0xb5f9('0x10')](util['format'](_0xb5f9('0x50'),_0x33686e[_0xb5f9('0x4f')]));_0x198308=_0x33686e['callysquare'];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xb5f9('0x10')](_0xb5f9('0x51'));_0x198308=-0x1;}}})[_0xb5f9('0x2c')](function(_0x5a3447){logger['error'](_0xb5f9('0x52'),_0x5a3447[_0xb5f9('0xe')]);})[_0xb5f9('0x53')](function(){var _0x4c11fa=require(_0xb5f9('0x54'))(config[_0xb5f9('0x5')]['port'],config[_0xb5f9('0x5')]['ip'],_0x198308);_0x4c11fa['on']('error',errorHandler);_0x4c11fa['on'](_0xb5f9('0x55'),listeningHandler);_0x4c11fa['on'](_0xb5f9('0x56'),connectionHandler);_0x4c11fa['on'](_0xb5f9('0x4a'),closeHandler);});}main(); \ No newline at end of file +var _0xc1f9=['connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','inspect','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','production','start','debug','stringify','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','clear','vertex','gotoc','context','extension','priority','response','code','isUndefined','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','./server','port'];(function(_0x11ad74,_0x1edce2){var _0x56b03f=function(_0x474f72){while(--_0x474f72){_0x11ad74['push'](_0x11ad74['shift']());}};_0x56b03f(++_0x1edce2);}(_0xc1f9,0x115));var _0x9c1f=function(_0x35ff42,_0x3aacf4){_0x35ff42=_0x35ff42-0x0;var _0x176c29=_0xc1f9[_0x35ff42];return _0x176c29;};'use strict';var parser=require(_0x9c1f('0x0'));var _=require(_0x9c1f('0x1'));var syncho=require(_0x9c1f('0x2'));var util=require(_0x9c1f('0x3'));var moment=require(_0x9c1f('0x4'));var config=require(_0x9c1f('0x5'));var logger=require(_0x9c1f('0x6'))(_0x9c1f('0x7'));var utilLicense=require('../../config/license/util');var rpc=require(_0x9c1f('0x8'));var mailRpc=require('./mailRpc');var Graph=require(_0x9c1f('0x9'));var Vertices=require(_0x9c1f('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9c1f('0x7')]=_[_0x9c1f('0xb')](config[_0x9c1f('0x7')],{'ip':_0x9c1f('0xc'),'port':0x11dd});function connectionHandler(_0x5e1e0e){process[_0x9c1f('0xd')](function(){syncho(function(){try{setChannelVariables(_0x5e1e0e);agiHandler(_0x5e1e0e);}catch(_0x19b86a){logger['error'](_0x19b86a[_0x9c1f('0xe')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9c1f('0x7')]['port']);logger[_0x9c1f('0xf')](util[_0x9c1f('0x10')](_0x9c1f('0x11'),config[_0x9c1f('0x7')]['ip'],config[_0x9c1f('0x7')]['port']));}function errorHandler(_0x14eab6){if(_0x14eab6&&_0x14eab6[_0x9c1f('0x12')]&&_0x14eab6[_0x9c1f('0x13')]){logger[_0x9c1f('0x14')](util[_0x9c1f('0x10')](_0x9c1f('0x15'),_0x14eab6[_0x9c1f('0x12')],_0x14eab6[_0x9c1f('0x13')]));}else{logger[_0x9c1f('0x14')](util[_0x9c1f('0x10')](_0x9c1f('0x16'),_0x14eab6[_0x9c1f('0xe')]));}}function closeHandler(){logger['info'](util[_0x9c1f('0x10')](_0x9c1f('0x17'),this[_0x9c1f('0x18')],this[_0x9c1f('0x19')],this[_0x9c1f('0x1a')],this['dnid'],this[_0x9c1f('0x1b')]));try{createSquareReport(this);}catch(_0x488088){logger['error'](_0x488088['stack']);}}function timeoutHandler(){logger[_0x9c1f('0xf')](util[_0x9c1f('0x10')](_0x9c1f('0x1c'),this['arg_1'],this[_0x9c1f('0x19')],this[_0x9c1f('0x1a')],this[_0x9c1f('0x1d')],this[_0x9c1f('0x1b')]));}function hangupHandler(){logger[_0x9c1f('0xf')](util['format'](_0x9c1f('0x1e'),this[_0x9c1f('0x18')],this[_0x9c1f('0x19')],this[_0x9c1f('0x1a')],this['dnid'],this[_0x9c1f('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x40b2af){return parser['toJson'](_0x40b2af,{'object':!![]})[_0x9c1f('0x1f')][_0x9c1f('0x20')];}function addVertex(_0xb9d73f,_0x57301a,_0x589da1){_0x57301a[_0x9c1f('0x21')]=_0x589da1;if(_0x57301a[_0x9c1f('0x22')](_0x9c1f('0x23'))){_0x57301a[_0x9c1f('0x24')]=parseInt(_0x57301a[_0x9c1f('0x23')],0xa);}_0xb9d73f[_0x9c1f('0x25')](_[_0x9c1f('0x26')](_0x57301a,_0x9c1f('0x27')));}function initGraph(_0x69533c,_0x43dbe1){var _0xe6fd4d=new Graph();for(var _0x9aa87 in _0x69533c){if(_0x69533c[_0x9c1f('0x22')](_0x9aa87)){if(_[_0x9c1f('0x28')](_0x69533c[_0x9aa87])){for(var _0x23a132=0x0;_0x23a132<_0x69533c[_0x9aa87]['length'];_0x23a132+=0x1){addVertex(_0xe6fd4d,_0x69533c[_0x9aa87][_0x23a132],_0x9aa87);}}else{addVertex(_0xe6fd4d,_0x69533c[_0x9aa87],_0x9aa87);}}}for(var _0x2e16ba=0x0;_0x2e16ba<_0x43dbe1[_0x9c1f('0x29')];_0x2e16ba+=0x1){if(_0x43dbe1[_0x2e16ba][_0x9c1f('0x2a')]&&_0x43dbe1[_0x2e16ba][_0x9c1f('0x2b')]){_0xe6fd4d[_0x9c1f('0x2c')](_0x43dbe1[_0x2e16ba][_0x9c1f('0x2a')],_0x43dbe1[_0x2e16ba][_0x9c1f('0x2b')],_0x43dbe1[_0x2e16ba][_0x9c1f('0x2d')]);}}return _0xe6fd4d;}function getSquareProject(_0x1c8641,_0x1c463a){rpc[_0x9c1f('0x2e')](_0x1c8641)['then'](function(_0x33fa72){_0x1c463a(null,_0x33fa72);})[_0x9c1f('0x2f')](function(_0x4697e6){_0x1c463a(null,_0x4697e6);});}function createSquareReport(_0x3a3ff1,_0x3146ab){rpc[_0x9c1f('0x30')](_0x3a3ff1)[_0x9c1f('0x31')](function(_0x216d0c){if(_0x3146ab){_0x3146ab(null,_0x216d0c);}})[_0x9c1f('0x2f')](function(_0x5b2d94){if(_0x3146ab){_0x3146ab(null,_0x5b2d94);}});}function setChannelVariables(_0x314de0){for(var _0x5f5d67 in _0x314de0){if(_0x314de0['hasOwnProperty'](_0x5f5d67)){if(_0x5f5d67[_0x9c1f('0x32')](_0x9c1f('0x33'))===0x0){_0x314de0[_0x5f5d67[_0x9c1f('0x34')](0x4)]=_0x314de0[_0x5f5d67];delete _0x314de0[_0x5f5d67];}}}}function getLogFromObject(_0x436e8e){return util[_0x9c1f('0x35')](_0x436e8e,{'showHidden':![],'depth':null});}function agiHandler(_0x18f7f9){var _0x182349,_0x4cce4c,_0x1f489d,_0x217aef,_0x5f3648;logger['debug'](_0x9c1f('0x36'),JSON['stringify'](_0x18f7f9,null,0x2));logger[_0x9c1f('0xf')](util[_0x9c1f('0x10')](_0x9c1f('0x37'),_0x18f7f9[_0x9c1f('0x18')],_0x18f7f9[_0x9c1f('0x19')],_0x18f7f9[_0x9c1f('0x1a')],_0x18f7f9[_0x9c1f('0x1d')],_0x18f7f9[_0x9c1f('0x1b')]));_0x18f7f9['on'](_0x9c1f('0x14'),errorHandler);_0x18f7f9['on'](_0x9c1f('0x38'),closeHandler);_0x18f7f9['on']('timeout',timeoutHandler);_0x18f7f9[_0x9c1f('0x39')]=![];_0x18f7f9['on']('hangup',hangupHandler);var _0x4c3f69=getSquareProject['sync'](null,_0x18f7f9['arg_1']);if(_0x4c3f69){if(_0x4c3f69[_0x9c1f('0x3a')]){_0x182349=getRoot(_0x4c3f69[_0x9c1f('0x3a')]);if(_0x182349&&_0x182349[_0x9c1f('0x3b')]){logger[_0x9c1f('0x3c')](_0x9c1f('0x20'),JSON[_0x9c1f('0x3d')](_0x182349,null,0x2));_0x18f7f9[_0x9c1f('0x3e')]=moment()['format'](_0x9c1f('0x3f'));_0x4cce4c=initGraph(_[_0x9c1f('0x26')](_0x182349,_0x9c1f('0x27')),_0x182349['mxCell']);_0x1f489d=new Vertices(_0x18f7f9,rpc,mailRpc);logger['info'](util[_0x9c1f('0x10')](_0x9c1f('0x40'),_0x18f7f9[_0x9c1f('0x18')],_0x18f7f9[_0x9c1f('0x19')],_0x18f7f9['callerid'],_0x18f7f9[_0x9c1f('0x1d')],_0x18f7f9[_0x9c1f('0x1b')]));_0x4cce4c[_0x9c1f('0x41')](_0x182349[_0x9c1f('0x3b')]['id'],function(_0x17a10d){try{_0x17a10d=_0x1f489d[_0x9c1f('0x42')](_0x17a10d);logger[_0x9c1f('0x3c')](_0x9c1f('0x43'),JSON[_0x9c1f('0x3d')](_0x17a10d,null,0x2));if(_0x17a10d[_0x9c1f('0x21')]===_0x9c1f('0x44')){logger[_0x9c1f('0xf')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x18f7f9[_0x9c1f('0x45')]=_0x17a10d[_0x9c1f('0x45')]||_0x18f7f9['context'];_0x18f7f9['extension']=_0x17a10d[_0x9c1f('0x46')];_0x18f7f9[_0x9c1f('0x47')]=_0x17a10d[_0x9c1f('0x47')]?_0x17a10d[_0x9c1f('0x47')]-0x1:0x1;return null;}else if(_0x17a10d&&_0x1f489d[_0x17a10d['agicommand']]){_0x5f3648=_0x1f489d[_0x17a10d[_0x9c1f('0x21')]](_0x17a10d);logger[_0x9c1f('0xf')](_0x9c1f('0x48'),JSON[_0x9c1f('0x3d')](_0x5f3648,null,0x2));if(_0x5f3648&&_0x5f3648[_0x9c1f('0x49')]===AGI_CODE_SUCCESS&&_0x5f3648['result']!==AGI_RESULT_ERROR&&!_0x18f7f9[_0x9c1f('0x39')]){logger[_0x9c1f('0x3c')](_0x9c1f('0x48'),getLogFromObject(_0x5f3648));return _[_0x9c1f('0x4a')](_0x5f3648[_0x9c1f('0x4b')])?null:_0x5f3648['result']['toString']();}else{logger['error'](_0x9c1f('0x48'),getLogFromObject(_0x5f3648));return null;}}else{logger[_0x9c1f('0x14')](_0x9c1f('0x4c'));return null;}}catch(_0x3b12e2){logger[_0x9c1f('0x14')](_0x3b12e2[_0x9c1f('0xe')]);return null;}});if(_0x182349[_0x9c1f('0x4d')]){logger[_0x9c1f('0xf')](util['format'](_0x9c1f('0x4e'),_0x18f7f9[_0x9c1f('0x18')],_0x18f7f9[_0x9c1f('0x19')],_0x18f7f9[_0x9c1f('0x1a')],_0x18f7f9['dnid'],_0x18f7f9['uniqueid']));_0x4cce4c[_0x9c1f('0x41')](_0x182349[_0x9c1f('0x4d')]['id'],function(_0x18abe7){try{_0x18abe7=_0x1f489d[_0x9c1f('0x42')](_0x18abe7);logger[_0x9c1f('0x3c')]('vertex',JSON[_0x9c1f('0x3d')](_0x18abe7,null,0x2));if(_0x18abe7&&_0x1f489d[_0x18abe7[_0x9c1f('0x21')]]){_0x5f3648=_0x1f489d[_0x18abe7[_0x9c1f('0x21')]](_0x18abe7);if(_0x5f3648){logger[_0x9c1f('0x3c')](_0x9c1f('0x48'),getLogFromObject(_0x5f3648));return _[_0x9c1f('0x4a')](_0x5f3648[_0x9c1f('0x4b')])?null:_0x5f3648[_0x9c1f('0x4b')][_0x9c1f('0x4f')]();}else{logger[_0x9c1f('0x14')](_0x9c1f('0x48'),getLogFromObject(_0x5f3648));return null;}}else{logger['error'](_0x9c1f('0x4c'));return null;}}catch(_0x1519f1){logger['error'](_0x1519f1[_0x9c1f('0xe')]);return null;}});}logger[_0x9c1f('0xf')](util['format'](_0x9c1f('0x50'),_0x18f7f9[_0x9c1f('0x18')],_0x18f7f9[_0x9c1f('0x19')],_0x18f7f9[_0x9c1f('0x1a')],_0x18f7f9[_0x9c1f('0x1d')],_0x18f7f9['uniqueid']));logger[_0x9c1f('0xf')](util[_0x9c1f('0x10')](_0x9c1f('0x51'),_0x18f7f9[_0x9c1f('0x45')],_0x18f7f9[_0x9c1f('0x46')],parseInt(_0x18f7f9[_0x9c1f('0x47')],0xa)+0x1));_0x18f7f9[_0x9c1f('0x52')](_0x18f7f9[_0x9c1f('0x45')],_0x18f7f9[_0x9c1f('0x46')],parseInt(_0x18f7f9[_0x9c1f('0x47')],0xa)+0x1);_0x18f7f9[_0x9c1f('0x38')]();}}else{logger['error'](util[_0x9c1f('0x10')](_0x9c1f('0x53'),_0x18f7f9[_0x9c1f('0x18')]));_0x18f7f9['continueAt'](_0x18f7f9[_0x9c1f('0x45')],_0x18f7f9[_0x9c1f('0x46')],parseInt(_0x18f7f9[_0x9c1f('0x47')],0xa)+0x1);_0x18f7f9[_0x9c1f('0x38')]();}}else{logger[_0x9c1f('0x14')](util[_0x9c1f('0x10')](_0x9c1f('0x54'),_0x18f7f9[_0x9c1f('0x18')]));_0x18f7f9[_0x9c1f('0x52')](_0x18f7f9[_0x9c1f('0x45')],_0x18f7f9[_0x9c1f('0x46')],parseInt(_0x18f7f9['priority'],0xa)+0x1);_0x18f7f9[_0x9c1f('0x38')]();}}function main(){var _0x1369fa;return utilLicense['getLicense']()[_0x9c1f('0x31')](function(_0x4fddb3){if(_0x4fddb3){if(_0x4fddb3[_0x9c1f('0x55')]){if(_0x4fddb3[_0x9c1f('0x56')]&&_0x4fddb3[_0x9c1f('0x56')]>0x0){logger[_0x9c1f('0xf')](util[_0x9c1f('0x10')](_0x9c1f('0x57'),_0x4fddb3[_0x9c1f('0x56')]));_0x1369fa=_0x4fddb3[_0x9c1f('0x56')];}else{logger[_0x9c1f('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x9c1f('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1369fa=-0x1;}}})[_0x9c1f('0x2f')](function(_0x3c28da){logger[_0x9c1f('0x14')](_0x9c1f('0x58'),_0x3c28da[_0x9c1f('0xe')]);})[_0x9c1f('0x4d')](function(){var _0x4e9924=require(_0x9c1f('0x59'))(config[_0x9c1f('0x7')][_0x9c1f('0x5a')],config['agi']['ip'],_0x1369fa);_0x4e9924['on'](_0x9c1f('0x14'),errorHandler);_0x4e9924['on']('listening',listeningHandler);_0x4e9924['on'](_0x9c1f('0x5b'),connectionHandler);_0x4e9924['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 263fc6d..5b1dec4 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 _0x267f=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error'];(function(_0x1d56eb,_0x4504a9){var _0x42b377=function(_0x287806){while(--_0x287806){_0x1d56eb['push'](_0x1d56eb['shift']());}};_0x42b377(++_0x4504a9);}(_0x267f,0xb8));var _0xf267=function(_0x3954bf,_0xbed461){_0x3954bf=_0x3954bf-0x0;var _0x3d467d=_0x267f[_0x3954bf];return _0x3d467d;};'use strict';var BPromise=require(_0xf267('0x0'));var jayson=require(_0xf267('0x1'));var client=jayson[_0xf267('0x2')][_0xf267('0x3')]({'port':0x232b});function request(_0x7eccf3,_0x38c2bb){return new BPromise(function(_0x460065,_0x4d0b83){return client[_0xf267('0x4')](_0x7eccf3,_0x38c2bb)['then'](function(_0x8bd53d){if(_0x8bd53d['error']){return _0x4d0b83(_0x8bd53d[_0xf267('0x5')]['message']);}else{return _0x460065(_0x8bd53d[_0xf267('0x6')]);}})[_0xf267('0x7')](function(_0x6a2703){return _0x4d0b83(_0x6a2703);});});}exports[_0xf267('0x8')]=function(_0x3306e4,_0x450e38){return request(_0xf267('0x9'),{'account':_0x3306e4,'message':_0x450e38});}; \ No newline at end of file +var _0x8f34=['bluebird','jayson/promise','http','request','error','message','result','catch','SendMail'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8f34,0xe1));var _0x48f3=function(_0x2db3eb,_0x236da4){_0x2db3eb=_0x2db3eb-0x0;var _0x5208da=_0x8f34[_0x2db3eb];return _0x5208da;};'use strict';var BPromise=require(_0x48f3('0x0'));var jayson=require(_0x48f3('0x1'));var client=jayson['client'][_0x48f3('0x2')]({'port':0x232b});function request(_0x3d3d5a,_0x39dc45){return new BPromise(function(_0x3826e8,_0x26c833){return client[_0x48f3('0x3')](_0x3d3d5a,_0x39dc45)['then'](function(_0x7f6993){if(_0x7f6993['error']){return _0x26c833(_0x7f6993[_0x48f3('0x4')][_0x48f3('0x5')]);}else{return _0x3826e8(_0x7f6993[_0x48f3('0x6')]);}})[_0x48f3('0x7')](function(_0x2a0601){return _0x26c833(_0x2a0601);});});}exports['sendMailMessage']=function(_0x1015c5,_0x35c1fd){return request(_0x48f3('0x8'),{'account':_0x1015c5,'message':_0x35c1fd});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b39c0a6..a33c8ed 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 _0x312f=['substring','length','split','indexOf','slice','trim','emit','headers','line','util','stream','Transform','call','inherits','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody'];(function(_0x4ba97e,_0x194ab6){var _0x31730d=function(_0x5d7d99){while(--_0x5d7d99){_0x4ba97e['push'](_0x4ba97e['shift']());}};_0x31730d(++_0x194ab6);}(_0x312f,0x1ab));var _0xf312=function(_0x2d154c,_0x5be4b3){_0x2d154c=_0x2d154c-0x0;var _0x5430ef=_0x312f[_0x2d154c];return _0x5430ef;};'use strict';var util=require(_0xf312('0x0'));var Transform=require(_0xf312('0x1'))[_0xf312('0x2')];function AGIReply(_0x2b3a20){Transform[_0xf312('0x3')](this,_0x2b3a20);this['_localBuffer']='';this['_inBody']=![];}util[_0xf312('0x4')](AGIReply,Transform);AGIReply['prototype'][_0xf312('0x5')]=function(_0x259d35,_0x276bf3,_0x389196){var _0x16fc8f='\x0a',_0x305040=['\x0a\x0a',_0xf312('0x6')],_0x21a7ea=-0x1,_0x2a602f=-0x1,_0x331743='',_0x4fc3b7=0x0,_0x5052d3='',_0x2f76ea='';this[_0xf312('0x7')]+=_0x259d35[_0xf312('0x8')]();_0x5052d3=this[_0xf312('0x7')];if(!this[_0xf312('0x9')]){_0x4fc3b7=0x0;while(_0x305040[_0x4fc3b7]){while((_0x2a602f=_0x5052d3['indexOf'](_0x305040[_0x4fc3b7]))!=-0x1){_0x331743=_0x305040[_0x4fc3b7];_0x2f76ea=_0x5052d3[_0xf312('0xa')](0x0,_0x2a602f);_0x5052d3=_0x5052d3[_0xf312('0xa')](_0x2a602f+_0x331743[_0xf312('0xb')]);var _0xfe80f5=_0x2f76ea[_0xf312('0xc')](_0x16fc8f),_0x4aba12=0x0,_0xd049c9={},_0xa43ae3='',_0x2b543a='',_0x57ff30=-0x1;while(_0xfe80f5[_0x4aba12]){_0x57ff30=_0xfe80f5[_0x4aba12][_0xf312('0xd')](':');if(_0x57ff30!=-0x1){_0xa43ae3=_0xfe80f5[_0x4aba12][_0xf312('0xe')](0x0,_0x57ff30)['trim']();_0x2b543a=_0xfe80f5[_0x4aba12][_0xf312('0xe')](_0x57ff30+0x1)[_0xf312('0xf')]();if(_0xa43ae3[_0xf312('0xb')]>0x0){_0xd049c9[_0xa43ae3]=_0x2b543a;}}else{}_0x4aba12++;}this[_0xf312('0x10')](_0xf312('0x11'),_0xd049c9);this['_inBody']=!![];}_0x4fc3b7++;}this[_0xf312('0x7')]=_0x5052d3;}else{while((_0x21a7ea=_0x5052d3[_0xf312('0xd')](_0x16fc8f))!=-0x1){_0x2f76ea=_0x5052d3['substring'](0x0,_0x21a7ea);this[_0xf312('0x10')](_0xf312('0x12'),_0x2f76ea);_0x5052d3=_0x5052d3[_0xf312('0xa')](_0x21a7ea+_0x16fc8f[_0xf312('0xb')]);}this[_0xf312('0x7')]=_0x5052d3;}_0x389196();};module['exports']=AGIReply; \ No newline at end of file +var _0x8b78=['split','indexOf','trim','emit','line','util','Transform','call','_localBuffer','_inBody','inherits','_transform','toString','substring','length'];(function(_0x73b15,_0xc01cff){var _0x4415c9=function(_0x2e8954){while(--_0x2e8954){_0x73b15['push'](_0x73b15['shift']());}};_0x4415c9(++_0xc01cff);}(_0x8b78,0xaa));var _0x88b7=function(_0x4d1aca,_0x2a4b4c){_0x4d1aca=_0x4d1aca-0x0;var _0x3e6585=_0x8b78[_0x4d1aca];return _0x3e6585;};'use strict';var util=require(_0x88b7('0x0'));var Transform=require('stream')[_0x88b7('0x1')];function AGIReply(_0x5aab27){Transform[_0x88b7('0x2')](this,_0x5aab27);this[_0x88b7('0x3')]='';this[_0x88b7('0x4')]=![];}util[_0x88b7('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x88b7('0x6')]=function(_0x48495d,_0x2e46e7,_0x288734){var _0x23ceac='\x0a',_0x500247=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x117d86=-0x1,_0x26d62b=-0x1,_0x1188b6='',_0x484c44=0x0,_0x3d72d2='',_0xdacdb6='';this[_0x88b7('0x3')]+=_0x48495d[_0x88b7('0x7')]();_0x3d72d2=this[_0x88b7('0x3')];if(!this[_0x88b7('0x4')]){_0x484c44=0x0;while(_0x500247[_0x484c44]){while((_0x26d62b=_0x3d72d2['indexOf'](_0x500247[_0x484c44]))!=-0x1){_0x1188b6=_0x500247[_0x484c44];_0xdacdb6=_0x3d72d2[_0x88b7('0x8')](0x0,_0x26d62b);_0x3d72d2=_0x3d72d2['substring'](_0x26d62b+_0x1188b6[_0x88b7('0x9')]);var _0x506bdc=_0xdacdb6[_0x88b7('0xa')](_0x23ceac),_0x6a37e0=0x0,_0x39fd78={},_0x563444='',_0x4d7650='',_0x4bd2c8=-0x1;while(_0x506bdc[_0x6a37e0]){_0x4bd2c8=_0x506bdc[_0x6a37e0][_0x88b7('0xb')](':');if(_0x4bd2c8!=-0x1){_0x563444=_0x506bdc[_0x6a37e0]['slice'](0x0,_0x4bd2c8)[_0x88b7('0xc')]();_0x4d7650=_0x506bdc[_0x6a37e0]['slice'](_0x4bd2c8+0x1)['trim']();if(_0x563444[_0x88b7('0x9')]>0x0){_0x39fd78[_0x563444]=_0x4d7650;}}else{}_0x6a37e0++;}this[_0x88b7('0xd')]('headers',_0x39fd78);this[_0x88b7('0x4')]=!![];}_0x484c44++;}this[_0x88b7('0x3')]=_0x3d72d2;}else{while((_0x117d86=_0x3d72d2[_0x88b7('0xb')](_0x23ceac))!=-0x1){_0xdacdb6=_0x3d72d2[_0x88b7('0x8')](0x0,_0x117d86);this[_0x88b7('0xd')](_0x88b7('0xe'),_0xdacdb6);_0x3d72d2=_0x3d72d2[_0x88b7('0x8')](_0x117d86+_0x23ceac[_0x88b7('0x9')]);}this['_localBuffer']=_0x3d72d2;}_0x288734();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 182aef2..709e6b0 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 _0xf55c=['getPauseById','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','LogoutUser','bluebird','lodash','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','createSquareRecording','createCmContact','ShowCmHopper','ListId'];(function(_0x130090,_0x21d9b7){var _0x104a94=function(_0x630dab){while(--_0x630dab){_0x130090['push'](_0x130090['shift']());}};_0x104a94(++_0x21d9b7);}(_0xf55c,0x1e7));var _0xcf55=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xf55c[_0x484e36];return _0xafc85d;};'use strict';var BPromise=require(_0xcf55('0x0'));var moment=require('moment');var _=require(_0xcf55('0x1'));var util=require(_0xcf55('0x2'));var jayson=require(_0xcf55('0x3'));var client=jayson[_0xcf55('0x4')][_0xcf55('0x5')]({'port':0x2329});function request(_0x2c24c8,_0x3cd699){return new BPromise(function(_0x5d1baf,_0x2bff1a){return client[_0xcf55('0x6')](_0x2c24c8,_0x3cd699)[_0xcf55('0x7')](function(_0x3a6de7){if(_0x3a6de7['error']){return _0x2bff1a(_0x3a6de7[_0xcf55('0x8')][_0xcf55('0x9')]);}else{return _0x5d1baf(_0x3a6de7[_0xcf55('0xa')]);}})[_0xcf55('0xb')](function(_0x576566){return _0x2bff1a(_0x576566);});});}exports[_0xcf55('0xc')]=function(){return request(_0xcf55('0xd'),{'options':{'raw':![],'attributes':['id',_0xcf55('0xe'),_0xcf55('0xf')]}});};exports[_0xcf55('0x10')]=function(_0x1d8ffc){return request(_0xcf55('0x11'),{'options':{'raw':![],'where':{'name':_0x1d8ffc},'attributes':['production']}});};exports[_0xcf55('0x12')]=function(_0x133c22){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x133c22},'include':[{'model':'MailServerOut','as':_0xcf55('0x13'),'include':[{'model':_0xcf55('0x14'),'as':_0xcf55('0x14')}]}],'attributes':['id',_0xcf55('0xe'),_0xcf55('0x15')]}});};exports[_0xcf55('0x16')]=function(_0x435287){return request(_0xcf55('0x11'),{'options':{'where':{'id':_0x435287},'attributes':[_0xcf55('0xe')]}});};exports[_0xcf55('0x17')]=function(_0x3a7e3f){return request(_0xcf55('0x18'),{'options':{'where':{'id':_0x3a7e3f},'attributes':['name']}});};exports[_0xcf55('0x19')]=function(_0xfba091){return request(_0xcf55('0x1a'),{'options':{'where':{'id':_0xfba091},'attributes':[_0xcf55('0xe')]}});};exports[_0xcf55('0x1b')]=function(_0x4b0c1a){return request(_0xcf55('0x1c'),{'options':{'where':{'id':_0x4b0c1a},'attributes':[_0xcf55('0x1d')]}});};exports[_0xcf55('0x1e')]=function(_0xeed93){return request(_0xcf55('0x1f'),{'options':{'where':{'id':_0xeed93},'attributes':['name']}});};exports[_0xcf55('0x20')]=function(_0x486436){return request(_0xcf55('0x21'),{'options':{'where':{'phone':_0x486436[_0xcf55('0x22')]},'attributes':['id']}});};exports[_0xcf55('0x23')]=function(_0x5ca906){return request('ShowTrunk',{'options':{'where':{'id':_0x5ca906},'attributes':['name']}});};exports[_0xcf55('0x24')]=function(_0x9cd5d5){return request(_0xcf55('0x25'),{'options':{'where':{'id':_0x9cd5d5},'attributes':['save_name']}});};exports[_0xcf55('0x26')]=function(_0x2dcddf){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2dcddf},'include':[{'model':'Interval','as':_0xcf55('0x27')}]}});};exports[_0xcf55('0x28')]=function(_0x5de5af){return request(_0xcf55('0x29'),{'options':{'where':{'id':_0x5de5af},'attributes':['id',_0xcf55('0xe')]}});};exports[_0xcf55('0x2a')]=function(_0x3c0723){return request(_0xcf55('0x2b'),{'body':_0x3c0723});};exports[_0xcf55('0x2c')]=function(_0x2854ca){return request(_0xcf55('0x2d'),{'body':_0x2854ca});};exports['createSquareReport']=function(_0x37e734){return request('CreateSquareReport',{'body':_[_0xcf55('0x2e')](_0x37e734,{'project_name':_0x37e734[_0xcf55('0x2f')],'prev_project_name':_0x37e734[_0xcf55('0x30')]||'','is_subproject':_0x37e734['arg_2']?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xcf55('0x31')]=function(_0x34c18b){return request('CreateSquareRecording',{'body':_0x34c18b});};exports['createSquareMessage']=function(_0x41d5af){return request('CreateSquareMessage',{'body':_0x41d5af});};exports[_0xcf55('0x32')]=function(_0x4128c0){return request(_0xcf55('0x33'),{'options':{'raw':![],'where':{'phone':_0x4128c0[_0xcf55('0x22')],'ListId':_0x4128c0[_0xcf55('0x34')]}}})[_0xcf55('0x7')](function(_0x3cf082){if(_0x3cf082){return _0x3cf082;}return request('CreateCmContact',{'body':_0x4128c0});});};exports[_0xcf55('0x35')]=function(_0x4aee25){return request(_0xcf55('0x36'),{'options':{'where':{'id':_0x4aee25},'attributes':[_0xcf55('0xe')]}});};exports[_0xcf55('0x37')]=function(_0x4cc35e,_0x28798a){return request(_0xcf55('0x38'),{'body':{'interface':_0x28798a},'options':{'where':_0x4cc35e}});};exports[_0xcf55('0x39')]=function(_0xa26ab9,_0x567f8f,_0x439fd7){return request('PauseUser',{'body':{'type':_0x567f8f,'uniqueid':_0x439fd7},'options':{'where':_0xa26ab9}});};exports['agentUnpause']=function(_0x5692ff){return request(_0xcf55('0x3a'),{'body':{},'options':{'where':_0x5692ff}});};exports['agentLogout']=function(_0x5ba246){return request(_0xcf55('0x3b'),{'body':{},'options':{'where':_0x5ba246}});}; \ No newline at end of file +var _0x3384=['save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','util','jayson/promise','client','http','request','then','error','message','result','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getContactByPhone','phone','getTrunkById','getSoundById','ShowSound'];(function(_0x1655a7,_0x41542a){var _0x2d9599=function(_0x5039e4){while(--_0x5039e4){_0x1655a7['push'](_0x1655a7['shift']());}};_0x2d9599(++_0x41542a);}(_0x3384,0x1a5));var _0x4338=function(_0x11e9a3,_0xabd526){_0x11e9a3=_0x11e9a3-0x0;var _0x573f45=_0x3384[_0x11e9a3];return _0x573f45;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0x4338('0x0'));var jayson=require(_0x4338('0x1'));var client=jayson[_0x4338('0x2')][_0x4338('0x3')]({'port':0x2329});function request(_0x5c0c7a,_0x55e5cd){return new BPromise(function(_0xc5fb81,_0x3338a9){return client[_0x4338('0x4')](_0x5c0c7a,_0x55e5cd)[_0x4338('0x5')](function(_0x4a7cab){if(_0x4a7cab[_0x4338('0x6')]){return _0x3338a9(_0x4a7cab['error'][_0x4338('0x7')]);}else{return _0xc5fb81(_0x4a7cab[_0x4338('0x8')]);}})['catch'](function(_0x1da39a){return _0x3338a9(_0x1da39a);});});}exports[_0x4338('0x9')]=function(){return request(_0x4338('0xa'),{'options':{'raw':![],'attributes':['id',_0x4338('0xb'),_0x4338('0xc')]}});};exports[_0x4338('0xd')]=function(_0x18c1e2){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x18c1e2},'attributes':['production']}});};exports[_0x4338('0xe')]=function(_0x5a3490){return request(_0x4338('0xf'),{'options':{'raw':![],'where':{'id':_0x5a3490},'include':[{'model':_0x4338('0x10'),'as':_0x4338('0x11'),'include':[{'model':_0x4338('0x12'),'as':_0x4338('0x12')}]}],'attributes':['id','name',_0x4338('0x13')],'smtp':!![]}});};exports[_0x4338('0x14')]=function(_0x41e627){return request(_0x4338('0x15'),{'options':{'where':{'id':_0x41e627},'attributes':[_0x4338('0xb')]}});};exports[_0x4338('0x16')]=function(_0x55f262){return request(_0x4338('0x17'),{'options':{'where':{'id':_0x55f262},'attributes':['name']}});};exports[_0x4338('0x18')]=function(_0x4f94b2){return request('ShowVariable',{'options':{'where':{'id':_0x4f94b2},'attributes':[_0x4338('0xb')]}});};exports[_0x4338('0x19')]=function(_0x177c14){return request(_0x4338('0x1a'),{'options':{'where':{'id':_0x177c14},'attributes':[_0x4338('0x1b')]}});};exports[_0x4338('0x1c')]=function(_0x343c43){return request('ShowUser',{'options':{'where':{'id':_0x343c43},'attributes':[_0x4338('0xb')]}});};exports[_0x4338('0x1d')]=function(_0x205aff){return request('GetContactByPhone',{'options':{'where':{'phone':_0x205aff[_0x4338('0x1e')]},'attributes':['id']}});};exports[_0x4338('0x1f')]=function(_0x521a8a){return request('ShowTrunk',{'options':{'where':{'id':_0x521a8a},'attributes':[_0x4338('0xb')]}});};exports[_0x4338('0x20')]=function(_0x8e23d0){return request(_0x4338('0x21'),{'options':{'where':{'id':_0x8e23d0},'attributes':[_0x4338('0x22')]}});};exports[_0x4338('0x23')]=function(_0x379057){return request(_0x4338('0x24'),{'options':{'raw':![],'where':{'id':_0x379057},'include':[{'model':_0x4338('0x25'),'as':_0x4338('0x26')}]}});};exports['getSmsAccountById']=function(_0x4751c3){return request(_0x4338('0x27'),{'options':{'where':{'id':_0x4751c3},'attributes':['id',_0x4338('0xb')]}});};exports[_0x4338('0x28')]=function(_0x338632){return request(_0x4338('0x29'),{'body':_0x338632});};exports[_0x4338('0x2a')]=function(_0x296d00){return request(_0x4338('0x2b'),{'body':_0x296d00});};exports[_0x4338('0x2c')]=function(_0xbe93bb){return request(_0x4338('0x2d'),{'body':_[_0x4338('0x2e')](_0xbe93bb,{'project_name':_0xbe93bb[_0x4338('0x2f')],'prev_project_name':_0xbe93bb[_0x4338('0x30')]||'','is_subproject':_0xbe93bb[_0x4338('0x30')]?!![]:![],'leaveAt':moment()[_0x4338('0x31')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x4338('0x32')]=function(_0x2461ef){return request(_0x4338('0x33'),{'body':_0x2461ef});};exports[_0x4338('0x34')]=function(_0x21979b){return request(_0x4338('0x35'),{'body':_0x21979b});};exports[_0x4338('0x36')]=function(_0x17494a){return request(_0x4338('0x37'),{'options':{'raw':![],'where':{'phone':_0x17494a[_0x4338('0x1e')],'ListId':_0x17494a[_0x4338('0x38')]}}})[_0x4338('0x5')](function(_0x1b802f){if(_0x1b802f){return _0x1b802f;}return request(_0x4338('0x39'),{'body':_0x17494a});});};exports['getPauseById']=function(_0x195984){return request(_0x4338('0x3a'),{'options':{'where':{'id':_0x195984},'attributes':[_0x4338('0xb')]}});};exports[_0x4338('0x3b')]=function(_0x38aeb2,_0x28c55a){return request('LoginUser',{'body':{'interface':_0x28c55a},'options':{'where':_0x38aeb2}});};exports[_0x4338('0x3c')]=function(_0x3a5a6f,_0x196c36,_0x464b82){return request(_0x4338('0x3d'),{'body':{'type':_0x196c36,'uniqueid':_0x464b82},'options':{'where':_0x3a5a6f}});};exports[_0x4338('0x3e')]=function(_0x4d5c8a){return request('UnpauseUser',{'body':{},'options':{'where':_0x4d5c8a}});};exports[_0x4338('0x3f')]=function(_0x1d24d8){return request(_0x4338('0x40'),{'body':{},'options':{'where':_0x1d24d8}});}; \ 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 c5d8e79..cdee1a1 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 _0x8ca9=['./polly','./lex','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ca9,0x9c));var _0x98ca=function(_0x32d7b2,_0x36786a){_0x32d7b2=_0x32d7b2-0x0;var _0x24c3bb=_0x8ca9[_0x32d7b2];return _0x24c3bb;};var polly=require(_0x98ca('0x0'));var lex=require(_0x98ca('0x1'));module[_0x98ca('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x66da=['exports','./polly','./lex'];(function(_0x438ee0,_0x4a563e){var _0x16267f=function(_0x1438ff){while(--_0x1438ff){_0x438ee0['push'](_0x438ee0['shift']());}};_0x16267f(++_0x4a563e);}(_0x66da,0x16f));var _0xa66d=function(_0x37c8ef,_0x334449){_0x37c8ef=_0x37c8ef-0x0;var _0x5eaee9=_0x66da[_0x37c8ef];return _0x5eaee9;};var polly=require(_0xa66d('0x0'));var lex=require(_0xa66d('0x1'));module[_0xa66d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 3a258c5..22484fb 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 _0x6f0d=['exports'];(function(_0x3086df,_0x4bbaba){var _0x3e4ad0=function(_0x205705){while(--_0x205705){_0x3086df['push'](_0x3086df['shift']());}};_0x3e4ad0(++_0x4bbaba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x17f148,_0x316db2){_0x17f148=_0x17f148-0x0;var _0x157b34=_0x6f0d[_0x17f148];return _0x157b34;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +var _0xe5b5=['exports','./lib/api'];(function(_0x1c18b8,_0x2c8a71){var _0x19c962=function(_0x3a0338){while(--_0x3a0338){_0x1c18b8['push'](_0x1c18b8['shift']());}};_0x19c962(++_0x2c8a71);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xe5b5[_0x246148];return _0x453d94;};'use strict';var lex=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]=function(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763){return lex(_0x418c87,_0x3b3efd,_0x208070,_0x4263e,_0x33e813,_0x3dc763);}; \ 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 b58dc42..90b5b66 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(_0x1668f1,_0x581d4b){var _0x45ba6b=function(_0x4e6024){while(--_0x4e6024){_0x1668f1['push'](_0x1668f1['shift']());}};_0x45ba6b(++_0x581d4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x57011e,_0xe07608){var _0x73b0cd=function(_0xe26cdf){while(--_0xe26cdf){_0x57011e['push'](_0x57011e['shift']());}};_0x73b0cd(++_0xe07608);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 bea3300..c249eca 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 _0xb38c=['exports','./lib/api'];(function(_0xfc3348,_0x4db501){var _0x2f9fb2=function(_0x375f7e){while(--_0x375f7e){_0xfc3348['push'](_0xfc3348['shift']());}};_0x2f9fb2(++_0x4db501);}(_0xb38c,0x1bf));var _0xcb38=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0xb38c[_0x2c27ed];return _0x597bd1;};'use strict';var polly=require(_0xcb38('0x0'));module[_0xcb38('0x1')]=function(_0x4d7a1b,_0x370705,_0x4d8e36,_0x5493a6,_0x4102c3,_0x5251ba,_0xe15a4d){return polly(_0x4d7a1b,_0x370705,_0x4d8e36,_0x5493a6,_0x4102c3,_0x5251ba,_0xe15a4d);}; \ No newline at end of file +var _0x0a71=['./lib/api','exports'];(function(_0x1aa463,_0xdf6e2){var _0x14e720=function(_0x4dcd1b){while(--_0x4dcd1b){_0x1aa463['push'](_0x1aa463['shift']());}};_0x14e720(++_0xdf6e2);}(_0x0a71,0xde));var _0x10a7=function(_0x2885dc,_0x178680){_0x2885dc=_0x2885dc-0x0;var _0x35940b=_0x0a71[_0x2885dc];return _0x35940b;};'use strict';var polly=require(_0x10a7('0x0'));module[_0x10a7('0x1')]=function(_0x5621b0,_0x55b708,_0x4b2178,_0x126073,_0xdfdf6d,_0x5dbf47,_0x3f879e){return polly(_0x5621b0,_0x55b708,_0x4b2178,_0x126073,_0xdfdf6d,_0x5dbf47,_0x3f879e);}; \ 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 4e51eff..5bf7f7e 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 _0xe5f9=['randomstring','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird'];(function(_0x488917,_0x33462f){var _0x294885=function(_0x5be9cc){while(--_0x5be9cc){_0x488917['push'](_0x488917['shift']());}};_0x294885(++_0x33462f);}(_0xe5f9,0xee));var _0x9e5f=function(_0x17e92b,_0xa77f21){_0x17e92b=_0x17e92b-0x0;var _0x23ac1c=_0xe5f9[_0x17e92b];return _0x23ac1c;};'use strict';var fs=require('fs');var path=require(_0x9e5f('0x0'));var BPromise=require(_0x9e5f('0x1'));var rs=require(_0x9e5f('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x4c9394,_0x108b63,_0x8459d5){return new BPromise(function(_0x484213,_0x1bce0f){_0x4c9394['synthesizeSpeech'](_0x108b63,function(_0x4bd134,_0x420881){if(_0x4bd134){_0x1bce0f(_0x4bd134);}else if(_0x420881){if(_0x420881[_0x9e5f('0x3')]instanceof Buffer){fs[_0x9e5f('0x4')](_0x8459d5,_0x420881[_0x9e5f('0x3')],function(_0x205340){if(_0x205340){_0x1bce0f(_0x205340);}else{_0x484213();}});}else{_0x1bce0f(new Error(_0x9e5f('0x5')));}}else{_0x1bce0f(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x111d66,_0x202995,_0x4167a9,_0x5371e9,_0x271ea2,_0x2c1916,_0xde8a67){var _0x4f0047=new AWS['Polly']({'accessKeyId':_0x111d66,'secretAccessKey':_0x202995,'region':_0x4167a9});var _0xa5f720={'Text':_0x271ea2,'TextType':_0x2c1916||_0x9e5f('0x6'),'OutputFormat':_0x9e5f('0x7'),'VoiceId':_0x5371e9};return pollyResult(_0x4f0047,_0xa5f720,_0xde8a67);}; \ No newline at end of file +var _0x8663=['mp3','path','bluebird','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','text'];(function(_0xa66190,_0x475e04){var _0x3594d2=function(_0x55bdef){while(--_0x55bdef){_0xa66190['push'](_0xa66190['shift']());}};_0x3594d2(++_0x475e04);}(_0x8663,0x1ac));var _0x3866=function(_0xaff3b5,_0x3c75fa){_0xaff3b5=_0xaff3b5-0x0;var _0xffe5f0=_0x8663[_0xaff3b5];return _0xffe5f0;};'use strict';var fs=require('fs');var path=require(_0x3866('0x0'));var BPromise=require(_0x3866('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x5a4a86,_0x224092,_0x18409e){return new BPromise(function(_0x1f0ed0,_0x314212){_0x5a4a86['synthesizeSpeech'](_0x224092,function(_0x4408c8,_0x29cdce){if(_0x4408c8){_0x314212(_0x4408c8);}else if(_0x29cdce){if(_0x29cdce[_0x3866('0x2')]instanceof Buffer){fs[_0x3866('0x3')](_0x18409e,_0x29cdce['AudioStream'],function(_0x5d1dd6){if(_0x5d1dd6){_0x314212(_0x5d1dd6);}else{_0x1f0ed0();}});}else{_0x314212(new Error(_0x3866('0x4')));}}else{_0x314212(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x5c64e9,_0x69d05c,_0x1aef8a,_0x5eb10c,_0x10fb70,_0x583b4a,_0x1118d8){var _0x6eeabe=new AWS['Polly']({'accessKeyId':_0x5c64e9,'secretAccessKey':_0x69d05c,'region':_0x1aef8a});var _0x131545={'Text':_0x10fb70,'TextType':_0x583b4a||_0x3866('0x5'),'OutputFormat':_0x3866('0x6'),'VoiceId':_0x5eb10c};return pollyResult(_0x6eeabe,_0x131545,_0x1118d8);}; \ 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 1042c40..5581054 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 _0x4362=['./lib/api','exports'];(function(_0x73fa16,_0x1377a2){var _0x290acd=function(_0x281d4b){while(--_0x281d4b){_0x73fa16['push'](_0x73fa16['shift']());}};_0x290acd(++_0x1377a2);}(_0x4362,0x10e));var _0x2436=function(_0x8a95a3,_0x21d5c1){_0x8a95a3=_0x8a95a3-0x0;var _0xbdccb0=_0x4362[_0x8a95a3];return _0xbdccb0;};'use strict';var asr=require(_0x2436('0x0'));module[_0x2436('0x1')]=function(_0x22bf03,_0x5b2e22,_0x573a7e,_0xdac51d){return asr(_0x22bf03,_0x5b2e22,_0x573a7e);}; \ No newline at end of file +var _0x3ed7=['./lib/api','exports'];(function(_0x5d27d5,_0x8fe232){var _0x320109=function(_0x203d78){while(--_0x203d78){_0x5d27d5['push'](_0x5d27d5['shift']());}};_0x320109(++_0x8fe232);}(_0x3ed7,0xc2));var _0x73ed=function(_0x5d22c9,_0x2d364b){_0x5d22c9=_0x5d22c9-0x0;var _0x51f395=_0x3ed7[_0x5d22c9];return _0x51f395;};'use strict';var asr=require(_0x73ed('0x0'));module[_0x73ed('0x1')]=function(_0x3994bc,_0x32f925,_0x599fb1,_0xe49e2f){return asr(_0x3994bc,_0x32f925,_0x599fb1);}; \ 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 8a5c7ad..e9187fd 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 _0x6f7a=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x48ea55,_0x3b5a67){var _0x79949f=function(_0x17478f){while(--_0x17478f){_0x48ea55['push'](_0x48ea55['shift']());}};_0x79949f(++_0x3b5a67);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x321d63,_0x262075){_0x321d63=_0x321d63-0x0;var _0x4c78b4=_0x6f7a[_0x321d63];return _0x4c78b4;};'use strict';var url=require(_0xa6f7('0x0'));var BPromise=require(_0xa6f7('0x1'));var fs=require('fs');var host=_0xa6f7('0x2');module[_0xa6f7('0x3')]=function(_0x4dd99d,_0x93614a,_0x407de3){return new BPromise(function(_0x12ecb8,_0x1da6dc){var _0x22e529;if(typeof _0x4dd99d!==_0xa6f7('0x4')||_0x4dd99d[_0xa6f7('0x5')]===0x0){return _0x1da6dc(_0xa6f7('0x6'));}if(typeof _0x93614a!==_0xa6f7('0x4')||_0x93614a[_0xa6f7('0x5')]===0x0){return _0x1da6dc(_0xa6f7('0x7'));}if(typeof _0x407de3!=='undefined'&&(typeof _0x407de3!=='string'||_0x407de3[_0xa6f7('0x5')]===0x0)){return _0x1da6dc(_0xa6f7('0x8'));}try{_0x22e529=fs[_0xa6f7('0x9')](_0x4dd99d)[_0xa6f7('0xa')](_0xa6f7('0xb'));}catch(_0x49a451){return _0x1da6dc(_0x49a451);}return _0x12ecb8({'method':'POST','uri':host+_0xa6f7('0xc')+_0x93614a,'body':{'config':{'encoding':_0xa6f7('0xd'),'sampleRateHertz':'8000','languageCode':_0x407de3},'audio':{'content':_0x22e529}},'json':!![]});});}; \ No newline at end of file +var _0x5645=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x567cf4,_0x58483e){var _0x2f632f=function(_0x39f487){while(--_0x39f487){_0x567cf4['push'](_0x567cf4['shift']());}};_0x2f632f(++_0x58483e);}(_0x5645,0x19e));var _0x5564=function(_0x284bde,_0x3a2ab2){_0x284bde=_0x284bde-0x0;var _0x455f4b=_0x5645[_0x284bde];return _0x455f4b;};'use strict';var url=require(_0x5564('0x0'));var BPromise=require(_0x5564('0x1'));var fs=require('fs');var host=_0x5564('0x2');module[_0x5564('0x3')]=function(_0x26c54d,_0x5ecd66,_0x241816){return new BPromise(function(_0x64ae4d,_0x1240cd){var _0x821a1a;if(typeof _0x26c54d!==_0x5564('0x4')||_0x26c54d[_0x5564('0x5')]===0x0){return _0x1240cd(_0x5564('0x6'));}if(typeof _0x5ecd66!==_0x5564('0x4')||_0x5ecd66[_0x5564('0x5')]===0x0){return _0x1240cd('key\x20should\x20be\x20a\x20string');}if(typeof _0x241816!=='undefined'&&(typeof _0x241816!==_0x5564('0x4')||_0x241816[_0x5564('0x5')]===0x0)){return _0x1240cd(_0x5564('0x7'));}try{_0x821a1a=fs[_0x5564('0x8')](_0x26c54d)[_0x5564('0x9')]('base64');}catch(_0x1ba45a){return _0x1240cd(_0x1ba45a);}return _0x64ae4d({'method':_0x5564('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5ecd66,'body':{'config':{'encoding':_0x5564('0xb'),'sampleRateHertz':_0x5564('0xc'),'languageCode':_0x241816},'audio':{'content':_0x821a1a}},'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 a69c2cd..2849583 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 _0x31da=['./asr','exports'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x31da,0x8a));var _0xa31d=function(_0x3cae4f,_0x3b0948){_0x3cae4f=_0x3cae4f-0x0;var _0x49942a=_0x31da[_0x3cae4f];return _0x49942a;};var asr=require(_0xa31d('0x0'));module[_0xa31d('0x1')]={'asr':asr}; \ No newline at end of file +var _0x71dc=['./asr','exports'];(function(_0x3c292a,_0x1c72c5){var _0xa11bf=function(_0x389e2f){while(--_0x389e2f){_0x3c292a['push'](_0x3c292a['shift']());}};_0xa11bf(++_0x1c72c5);}(_0x71dc,0x66));var _0xc71d=function(_0xb7c67b,_0x4ce304){_0xb7c67b=_0xb7c67b-0x0;var _0x2db22f=_0x71dc[_0xb7c67b];return _0x2db22f;};var asr=require(_0xc71d('0x0'));module[_0xc71d('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 62ebdcf..0d3e765 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 _0x1d96=['text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','randomstring','google-tts-api','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','error','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','host','request\x20to\x20','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','.mp3','audioContent','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda'];(function(_0x6a5e0c,_0x1101fc){var _0xfc86b9=function(_0x20cde7){while(--_0x20cde7){_0x6a5e0c['push'](_0x6a5e0c['shift']());}};_0xfc86b9(++_0x1101fc);}(_0x1d96,0x121));var _0x61d9=function(_0x55240a,_0x40917c){_0x55240a=_0x55240a-0x0;var _0x56b115=_0x1d96[_0x55240a];return _0x56b115;};'use strict';var apiai=require(_0x61d9('0x0'));var BPromise=require(_0x61d9('0x1'));var dialogflow=require(_0x61d9('0x2'));var fs=require('fs');var http=require(_0x61d9('0x3'));var https=require(_0x61d9('0x4'));var md5=require(_0x61d9('0x5'));var path=require(_0x61d9('0x6'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0x61d9('0x7'));var sox=require('sox');var tts=require(_0x61d9('0x8'));var urlParse=require('url')['parse'];var util=require(_0x61d9('0x9'));var aws=require(_0x61d9('0xa'));var google=require(_0x61d9('0xb'));var sestek=require(_0x61d9('0xc'));var tilde=require(_0x61d9('0xd'));var logger=require(_0x61d9('0xe'))(_0x61d9('0xf'));var ISPEECH_API=_0x61d9('0x10');function downloadFile(_0x681357,_0x4ff92e){return new BPromise(function(_0x3db60d,_0x475d86){var _0x43de02=urlParse(_0x681357);var _0x357b21=_0x43de02[_0x61d9('0x11')]===_0x61d9('0x12')?https:http;var _0xb5afc6={'host':_0x43de02['host'],'path':_0x43de02[_0x61d9('0x6')],'headers':{'user-agent':_0x61d9('0x13')}};_0x357b21[_0x61d9('0x14')](_0xb5afc6,function(_0x3c1259){if(_0x3c1259['statusCode']!==0xc8){logger[_0x61d9('0x15')]('request\x20to\x20'+_0x681357+_0x61d9('0x16')+_0x3c1259[_0x61d9('0x17')]+'\x20('+_0x3c1259['statusMessage']+')');_0x475d86(new Error('request\x20to\x20'+_0x681357+_0x61d9('0x16')+_0x3c1259[_0x61d9('0x17')]+'\x20('+_0x3c1259[_0x61d9('0x18')]+')'));return;}var _0x25aec=fs[_0x61d9('0x19')](_0x4ff92e);_0x25aec['on'](_0x61d9('0x1a'),function(){logger[_0x61d9('0x1b')](_0x61d9('0x1c'));_0x25aec[_0x61d9('0x1d')](_0x3db60d);});_0x25aec['on']('error',function(_0x2e6e40){fs[_0x61d9('0x1e')](_0x4ff92e);logger['error'](_0x61d9('0x1f'),_0x2e6e40);_0x475d86(_0x2e6e40);});_0x3c1259['pipe'](_0x25aec);})['on'](_0x61d9('0x15'),function(_0x141568){logger[_0x61d9('0x15')](_0x141568);_0x475d86(_0x141568);})[_0x61d9('0x20')]();});}function uploadFile(_0x470eb2){return new BPromise(function(_0x13430b,_0x25a9a0){var _0x18ba70=urlParse(_0x470eb2);var _0x1fde54=_0x18ba70['protocol']===_0x61d9('0x12')?https:http;var _0xe6ede9={'host':_0x18ba70[_0x61d9('0x21')],'path':_0x18ba70[_0x61d9('0x6')],'headers':{'user-agent':_0x61d9('0x13')}};_0x1fde54['get'](_0xe6ede9,function(_0x503ed6){if(_0x503ed6[_0x61d9('0x17')]!==0xc8){_0x25a9a0(new Error(_0x61d9('0x22')+_0x470eb2+_0x61d9('0x16')+_0x503ed6[_0x61d9('0x17')]+'\x20('+_0x503ed6[_0x61d9('0x18')]+')'));return;}var _0x5e6ca7='';_0x503ed6['on'](_0x61d9('0x23'),function(_0x4d1964){_0x5e6ca7+=_0x4d1964;});_0x503ed6['on'](_0x61d9('0x20'),function(){_0x13430b(_0x5e6ca7);});})['on'](_0x61d9('0x15'),function(_0x948f6c){_0x25a9a0(_0x948f6c);})[_0x61d9('0x20')]();});}function convertFile(_0xdf8daa,_0xea4773){return new BPromise(function(_0x125140,_0x58053f){var _0x56be4d=sox[_0x61d9('0x24')](_0xdf8daa,_0xea4773,{'sampleRate':0x1f40,'format':_0x61d9('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56be4d['on'](_0x61d9('0x15'),function(_0x3986f2){logger[_0x61d9('0x15')](_0x61d9('0x26'),_0x3986f2);_0x58053f(_0x3986f2);});_0x56be4d['on'](_0x61d9('0x20'),function(){logger['info'](_0x61d9('0x27'));_0x125140();});_0x56be4d[_0x61d9('0x28')]();});}function base64Decode(_0x3d1d5a,_0x570fd2){var _0x6346d6=path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+_0x61d9('0x2c'));fs[_0x61d9('0x2d')](_0x6346d6,_0x3d1d5a,_0x61d9('0x2e'));return convertFile(_0x6346d6,_0x570fd2)[_0x61d9('0x2f')](function(){try{fs[_0x61d9('0x1e')](_0x6346d6);fs[_0x61d9('0x30')](_0x570fd2,_0x61d9('0x31'));}catch(_0xa2429f){logger[_0x61d9('0x15')](_0xa2429f);}return _0x570fd2[_0x61d9('0x32')]('.')[0x0];});}function base64Encode(_0x32ae50){var _0x185319=fs[_0x61d9('0x33')](_0x32ae50);return new Buffer(_0x185319)[_0x61d9('0x34')](_0x61d9('0x2e'));}exports[_0x61d9('0x35')]=function(_0x1f98ec,_0x291b10,_0x583c4a,_0x4b562b,_0x27789b,_0x3bbe5f){var _0x50e975,_0x4e182b;var _0x297b21=_0x61d9('0x36');var _0x1fba2a=_0x61d9('0x37')+_0x1f98ec;var _0x561a8e={};if(_0x291b10===_0x61d9('0x38')){_0x561a8e[_0x61d9('0x39')]={'ssml':_0x583c4a};}else{_0x561a8e[_0x61d9('0x39')]={'text':_0x583c4a};};_0x561a8e[_0x61d9('0x3a')]={'languageCode':_0x4b562b,'ssmlGender':_0x27789b};_0x561a8e['audioConfig']={'audioEncoding':_0x61d9('0x3b'),'sampleRateHertz':0x1f40};var _0x135ed1={'url':_0x297b21+'text:synthesize'+_0x1fba2a,'method':_0x61d9('0x3c'),'json':!![],'body':_0x561a8e};return rp(_0x135ed1)[_0x61d9('0x2f')](function(_0x3d1736){return new BPromise(function(_0xe894ee,_0x23a0f3){_0x50e975=path['resolve'](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+_0x61d9('0x3d'));var _0x3ddbb9=Buffer['from'](_0x3d1736[_0x61d9('0x3e')],_0x61d9('0x2e'));return fs['writeFile'](_0x50e975,_0x3ddbb9,function(_0x18cd00){_0x23a0f3(_0x18cd00);},function(_0x16d512){fs[_0x61d9('0x30')](_0x50e975,'777');_0xe894ee(_0x16d512);});});})[_0x61d9('0x2f')](function(_0xf04fcb){_0x4e182b=path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+'.wav');return convertFile(_0x50e975,_0x4e182b);})[_0x61d9('0x2f')](function(){try{fs[_0x61d9('0x1e')](_0x50e975);fs[_0x61d9('0x30')](_0x4e182b,_0x61d9('0x31'));}catch(_0x53f453){logger[_0x61d9('0x15')](_0x53f453);}logger[_0x61d9('0x1b')](_0x61d9('0x3f'),_0x4e182b['split']('.')[0x0]);return _0x4e182b[_0x61d9('0x32')]('.')[0x0];});};exports[_0x61d9('0x40')]=function(_0x13e039,_0x3e1a08){var _0x5073e9=_0x61d9('0x41');var _0x46c9d8,_0xaec540;var _0x4a604b;var _0x4ea5fd={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x5073e9,'headers':{'Content-Type':_0x61d9('0x42')},'body':_0x61d9('0x43')+encodeURIComponent(JSON[_0x61d9('0x44')]([[[_0x61d9('0x45'),JSON['stringify']([_0x13e039,_0x3e1a08||'en',![],_0x61d9('0x46')]),null,_0x61d9('0x47')]]]))};return rp(_0x4ea5fd)[_0x61d9('0x2f')](function(_0x437c75){try{_0x4a604b=eval(_0x437c75[_0x61d9('0x48')](0x5))[0x0][0x2];}catch(_0x1a41b2){throw new Error('parse\x20response\x20failed:\x0a'+_0x437c75[_0x61d9('0x23')]);}if(!_0x4a604b){if(_0x13e039[_0x61d9('0x49')]>0xc8){throw new Error(_0x61d9('0x4a'));}else{throw new Error(_0x61d9('0x4b')+_0x3e1a08+_0x61d9('0x4c'));}}try{_0x4a604b=eval(_0x4a604b)[0x0];}catch(_0xd82c25){throw new Error(_0x61d9('0x4d')+res[_0x61d9('0x23')]);}const _0x519440=_0x4a604b;_0x46c9d8=path['resolve'](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+_0x61d9('0x3d'));fs[_0x61d9('0x2d')](_0x46c9d8,_0x4a604b,{'encoding':'base64'});_0xaec540=path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs['generate'](0x4)+_0x61d9('0x2c'));return convertFile(_0x46c9d8,_0xaec540);})[_0x61d9('0x2f')](function(){try{fs['unlink'](_0x46c9d8);fs['chmodSync'](_0xaec540,_0x61d9('0x31'));}catch(_0x153bf1){logger[_0x61d9('0x15')](_0x153bf1);}logger[_0x61d9('0x1b')](_0x61d9('0x4e'),_0xaec540[_0x61d9('0x32')]('.')[0x0]);return _0xaec540[_0x61d9('0x32')]('.')[0x0];});};exports['googleASR']=function(_0xfb52a3,_0x165501,_0x923205){return google[_0x61d9('0x4f')](_0xfb52a3,_0x165501,_0x923205)[_0x61d9('0x2f')](function(_0x5e1b0d){logger[_0x61d9('0x1b')](_0x5e1b0d[_0x61d9('0x50')]);return rp(_0x5e1b0d);})[_0x61d9('0x2f')](function(_0x34cf85){var _0x4fef43='';var _0x4ac875=0x0;try{fs['unlink'](_0xfb52a3);}catch(_0x1b8ee5){logger[_0x61d9('0x15')](_0x1b8ee5);}if(_0x34cf85&&_0x34cf85[_0x61d9('0x51')]){_0x4fef43=_0x34cf85[_0x61d9('0x51')][_0x61d9('0x52')](function(_0x45e63e){return _0x45e63e&&_0x45e63e[_0x61d9('0x53')][0x0]&&_0x45e63e['alternatives'][0x0][_0x61d9('0x54')]?_0x45e63e[_0x61d9('0x53')][0x0][_0x61d9('0x54')]:'';})['join']('\x0a');_0x4ac875=_0x34cf85[_0x61d9('0x51')][_0x61d9('0x52')](function(_0x8e5f3f){return _0x8e5f3f&&_0x8e5f3f[_0x61d9('0x53')][0x0]&&_0x8e5f3f[_0x61d9('0x53')][0x0][_0x61d9('0x55')]?_0x8e5f3f[_0x61d9('0x53')][0x0][_0x61d9('0x55')]:0x0;})[_0x61d9('0x56')]('\x0a');}logger['info'](_0x61d9('0x57'),_0x4fef43);logger[_0x61d9('0x1b')](_0x61d9('0x58'),_0x4ac875);return{'transcript':_0x4fef43,'confidence':_0x4ac875};})[_0x61d9('0x59')](function(_0x14c43c){logger['error'](_0x61d9('0x5a'),_0x14c43c[_0x61d9('0x17')],_0x14c43c['name'],_0x14c43c[_0x61d9('0x5b')]);});};exports[_0x61d9('0x5c')]=function(_0x4c5ccc,_0x35b5e3,_0x1628f0,_0x222582){var _0x553c85=apiai(_0x35b5e3,{'language':_0x222582||'en'});return _0x553c85[_0x61d9('0x5d')](_0x1628f0,{'sessionId':md5(_0x4c5ccc)})[_0x61d9('0x2f')](function(_0x4dedaa){logger['info'](JSON[_0x61d9('0x44')](_0x4dedaa));return{'source':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x5f')],'resolvedQuery':_0x4dedaa[_0x61d9('0x5e')]['resolvedQuery'],'action':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x60')],'actionIncomplete':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x61')],'speech':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x62')]['speech'],'score':_0x4dedaa['result']['score'],'statusCode':_0x4dedaa[_0x61d9('0x63')][_0x61d9('0x64')],'endConversation':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x65')]['endConversation']||![],'isFallbackIntent':_0x4dedaa[_0x61d9('0x5e')][_0x61d9('0x65')][_0x61d9('0x66')]};});};exports[_0x61d9('0x67')]=function(_0x3d4c3a,_0xe09c2,_0x2cae15,_0x83c55e,_0x177552,_0x39a6cb){var _0xe69fb4=_0x83c55e[_0x61d9('0x68')](/\\n/g,'\x0a');var _0x263a6a={'credentials':{'private_key':_0xe69fb4,'client_email':_0x2cae15}};var _0x36eeb1=new dialogflow['SessionsClient'](_0x263a6a);var _0x57c0a7=_0x36eeb1['sessionPath'](_0xe09c2,md5(_0x3d4c3a));var _0x4378c7={'session':_0x57c0a7,'queryInput':{'text':{'text':_0x177552,'languageCode':_0x39a6cb}}};return _0x36eeb1[_0x61d9('0x69')](_0x4378c7)['then'](function(_0x1b185b){if(_0x1b185b&&_0x1b185b[_0x61d9('0x49')]){logger[_0x61d9('0x1b')](_0x61d9('0x6a'),JSON[_0x61d9('0x44')](_0x1b185b));var _0x1371fd=_0x1b185b[0x0];if(_0x1371fd){var _0x2a94b8={'action':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x60')],'allRequiredParamsPresent':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x6c')],'endConversation':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x6d')]&&_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x6d')][_0x61d9('0x6e')]?_0x1371fd[_0x61d9('0x6b')]['diagnosticInfo'][_0x61d9('0x6e')][_0x61d9('0x6f')][_0x61d9('0x70')]:![],'fulfillmentText':_0x1371fd['queryResult'][_0x61d9('0x71')],'intentName':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x72')]['name'],'intentDisplayName':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x72')]['displayName'],'isFallbackIntent':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x72')][_0x61d9('0x73')],'languageCode':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x74')],'queryText':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x75')],'responseId':_0x1371fd[_0x61d9('0x76')],'score':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x77')],'speech':_0x1371fd[_0x61d9('0x6b')][_0x61d9('0x71')],'providerResponse':JSON['stringify'](_0x1b185b)};return _0x2a94b8;}}});};exports['tildeASR']=function(_0x2ebd03,_0x8d2a1f,_0x4353d9,_0x220e5c){return tilde[_0x61d9('0x4f')](_0x2ebd03,_0x8d2a1f,_0x4353d9,_0x220e5c)[_0x61d9('0x2f')](function(_0x56a155){try{fs['unlink'](_0x2ebd03);}catch(_0x34fa40){logger['error'](_0x34fa40);}logger['info'](_0x61d9('0x78'),_0x56a155[_0x61d9('0x54')]);logger[_0x61d9('0x1b')](_0x61d9('0x79'),_0x56a155[_0x61d9('0x55')]);return _0x56a155;});};exports[_0x61d9('0x7a')]=function(_0x1cd920,_0x751c47,_0x2d2092,_0x63c171,_0x22cd9b,_0x2ee172){var _0x2640e7=path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+'.mp3');var _0x182c81;return aws[_0x61d9('0x7b')](_0x1cd920,_0x751c47,_0x2d2092,_0x63c171,_0x22cd9b,_0x2ee172,_0x2640e7)['then'](function(){_0x182c81=path['resolve'](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+'.wav');return convertFile(_0x2640e7,_0x182c81);})[_0x61d9('0x2f')](function(){try{fs[_0x61d9('0x1e')](_0x2640e7);fs[_0x61d9('0x30')](_0x182c81,_0x61d9('0x31'));}catch(_0x52dc6b){logger[_0x61d9('0x15')](_0x52dc6b);}return _0x182c81[_0x61d9('0x32')]('.')[0x0];});};exports[_0x61d9('0x7c')]=function(_0x342adc,_0xf80fe2,_0xd9818a,_0x44723d,_0x1d86ff,_0x2c8773){return aws[_0x61d9('0x7d')](_0x342adc,_0xf80fe2,_0xd9818a,_0x44723d,_0x1d86ff,_0x2c8773)[_0x61d9('0x2f')](function(_0xb1f136){logger[_0x61d9('0x1b')](JSON[_0x61d9('0x44')](_0xb1f136));return _0xb1f136;});};exports[_0x61d9('0x7e')]=function(_0x2957b3,_0x17e7d6,_0x398f61,_0x5c1ffe){var _0x1c046d=util[_0x61d9('0x7f')](_0x61d9('0x80'),ISPEECH_API,_0x2957b3,encodeURIComponent(_0x17e7d6),_0x398f61,_0x5c1ffe);var _0x33765c=path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+'.mp3');var _0x3f9ea0;return downloadFile(_0x1c046d,_0x33765c)[_0x61d9('0x2f')](function(){_0x3f9ea0=path[_0x61d9('0x29')](__dirname,'tmp',rs[_0x61d9('0x2b')](0x4)+'.wav');return convertFile(_0x33765c,_0x3f9ea0);})['then'](function(){try{fs[_0x61d9('0x1e')](_0x33765c);fs[_0x61d9('0x30')](_0x3f9ea0,_0x61d9('0x31'));}catch(_0x4be44f){logger['error'](_0x4be44f);}return _0x3f9ea0[_0x61d9('0x32')]('.')[0x0];});};exports[_0x61d9('0x81')]=function(_0x2b980b,_0x3d7abe,_0x289f73,_0x4c41f1){var _0x5f7ac7=util[_0x61d9('0x7f')](_0x61d9('0x82'),ISPEECH_API,_0x3d7abe,_0x289f73,base64Encode(_0x2b980b),_0x4c41f1?util[_0x61d9('0x7f')]('model=%s',encodeURIComponent(_0x4c41f1)):_0x61d9('0x83'));return uploadFile(_0x5f7ac7)[_0x61d9('0x2f')](function(_0x141efa){return querystring['parse'](_0x141efa);});};exports[_0x61d9('0x84')]=function(_0xb2a12,_0x39388b){return sestek[_0x61d9('0x85')](_0xb2a12,_0x39388b)[_0x61d9('0x2f')](function(_0x2683c1){logger[_0x61d9('0x1b')](JSON['stringify'](_0x2683c1));var _0xd7f1f9={'speech':_0x2683c1[_0x61d9('0x86')],'action':_0x2683c1[_0x61d9('0x87')]?_0x2683c1[_0x61d9('0x87')][_0x61d9('0x88')]:undefined,'actiondata':_0x2683c1[_0x61d9('0x87')]?_0x2683c1[_0x61d9('0x87')]['CustomActionData']:undefined};if(_0x2683c1[_0x61d9('0x87')]&&_0x2683c1[_0x61d9('0x87')][_0x61d9('0x89')]){return base64Decode(_0x2683c1[_0x61d9('0x87')][_0x61d9('0x89')][_0x61d9('0x8a')],path[_0x61d9('0x29')](__dirname,_0x61d9('0x2a'),rs[_0x61d9('0x2b')](0x4)+_0x61d9('0x2c')))[_0x61d9('0x2f')](function(_0x15355b){_0xd7f1f9[_0x61d9('0x8b')]=_0x15355b;return _0xd7f1f9;});}return _0xd7f1f9;});};exports[_0x61d9('0x8c')]=function(){return __dirname;}; \ No newline at end of file +var _0x7f1a=['googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','POST','resolve','generate','from','audioContent','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','goggleTTS\x20path','googleASR','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','actionIncomplete','fulfillment','speech','score','status','metadata','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','action','diagnosticInfo','queryResult','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20confidence','confidence','awsPolly','polly','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','host','get','data','transcode','wav','error\x20convert','start','tmp','.wav','writeFileSync','base64','then','777','split','toString'];(function(_0x95258,_0x2c2c3d){var _0x3731fa=function(_0x585f6a){while(--_0x585f6a){_0x95258['push'](_0x95258['shift']());}};_0x3731fa(++_0x2c2c3d);}(_0x7f1a,0xd5));var _0xa7f1=function(_0x14c61a,_0x4ea983){_0x14c61a=_0x14c61a-0x0;var _0x526f47=_0x7f1a[_0x14c61a];return _0x526f47;};'use strict';var apiai=require(_0xa7f1('0x0'));var BPromise=require(_0xa7f1('0x1'));var dialogflow=require(_0xa7f1('0x2'));var fs=require('fs');var http=require(_0xa7f1('0x3'));var https=require(_0xa7f1('0x4'));var md5=require(_0xa7f1('0x5'));var path=require(_0xa7f1('0x6'));var querystring=require('querystring');var rp=require(_0xa7f1('0x7'));var rs=require(_0xa7f1('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0xa7f1('0x9'))[_0xa7f1('0xa')];var util=require(_0xa7f1('0xb'));var aws=require(_0xa7f1('0xc'));var google=require(_0xa7f1('0xd'));var sestek=require(_0xa7f1('0xe'));var tilde=require(_0xa7f1('0xf'));var logger=require(_0xa7f1('0x10'))(_0xa7f1('0x11'));var ISPEECH_API=_0xa7f1('0x12');function downloadFile(_0x25a5ff,_0x3018fa){return new BPromise(function(_0x187885,_0x30cc8d){var _0x1b12eb=urlParse(_0x25a5ff);var _0x4f66e4=_0x1b12eb[_0xa7f1('0x13')]===_0xa7f1('0x14')?https:http;var _0x5d461a={'host':_0x1b12eb['host'],'path':_0x1b12eb[_0xa7f1('0x6')],'headers':{'user-agent':_0xa7f1('0x15')}};_0x4f66e4['get'](_0x5d461a,function(_0x420868){if(_0x420868[_0xa7f1('0x16')]!==0xc8){logger[_0xa7f1('0x17')](_0xa7f1('0x18')+_0x25a5ff+'\x20failed,\x20status\x20code\x20=\x20'+_0x420868[_0xa7f1('0x16')]+'\x20('+_0x420868[_0xa7f1('0x19')]+')');_0x30cc8d(new Error(_0xa7f1('0x18')+_0x25a5ff+_0xa7f1('0x1a')+_0x420868[_0xa7f1('0x16')]+'\x20('+_0x420868[_0xa7f1('0x19')]+')'));return;}var _0x594722=fs[_0xa7f1('0x1b')](_0x3018fa);_0x594722['on']('finish',function(){logger[_0xa7f1('0x1c')](_0xa7f1('0x1d'));_0x594722['close'](_0x187885);});_0x594722['on']('error',function(_0x178d6e){fs[_0xa7f1('0x1e')](_0x3018fa);logger[_0xa7f1('0x17')](_0xa7f1('0x1f'),_0x178d6e);_0x30cc8d(_0x178d6e);});_0x420868[_0xa7f1('0x20')](_0x594722);})['on'](_0xa7f1('0x17'),function(_0x56a069){logger[_0xa7f1('0x17')](_0x56a069);_0x30cc8d(_0x56a069);})[_0xa7f1('0x21')]();});}function uploadFile(_0x28cfe4){return new BPromise(function(_0x1d42e9,_0x239b2d){var _0x2c482f=urlParse(_0x28cfe4);var _0x14828a=_0x2c482f[_0xa7f1('0x13')]==='https:'?https:http;var _0x5cc400={'host':_0x2c482f[_0xa7f1('0x22')],'path':_0x2c482f[_0xa7f1('0x6')],'headers':{'user-agent':_0xa7f1('0x15')}};_0x14828a[_0xa7f1('0x23')](_0x5cc400,function(_0x2cfcd0){if(_0x2cfcd0[_0xa7f1('0x16')]!==0xc8){_0x239b2d(new Error(_0xa7f1('0x18')+_0x28cfe4+'\x20failed,\x20status\x20code\x20=\x20'+_0x2cfcd0[_0xa7f1('0x16')]+'\x20('+_0x2cfcd0[_0xa7f1('0x19')]+')'));return;}var _0x369f3e='';_0x2cfcd0['on'](_0xa7f1('0x24'),function(_0x5e3c2b){_0x369f3e+=_0x5e3c2b;});_0x2cfcd0['on'](_0xa7f1('0x21'),function(){_0x1d42e9(_0x369f3e);});})['on'](_0xa7f1('0x17'),function(_0x370866){_0x239b2d(_0x370866);})[_0xa7f1('0x21')]();});}function convertFile(_0x2dd433,_0xc899bf){return new BPromise(function(_0x3c12e2,_0x3e0e10){var _0x109158=sox[_0xa7f1('0x25')](_0x2dd433,_0xc899bf,{'sampleRate':0x1f40,'format':_0xa7f1('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x109158['on'](_0xa7f1('0x17'),function(_0x394749){logger[_0xa7f1('0x17')](_0xa7f1('0x27'),_0x394749);_0x3e0e10(_0x394749);});_0x109158['on'](_0xa7f1('0x21'),function(){logger['info']('finish\x20to\x20convert');_0x3c12e2();});_0x109158[_0xa7f1('0x28')]();});}function base64Decode(_0x2013ff,_0x26f35c){var _0x58ecb3=path['resolve'](__dirname,_0xa7f1('0x29'),rs['generate'](0x4)+_0xa7f1('0x2a'));fs[_0xa7f1('0x2b')](_0x58ecb3,_0x2013ff,_0xa7f1('0x2c'));return convertFile(_0x58ecb3,_0x26f35c)[_0xa7f1('0x2d')](function(){try{fs[_0xa7f1('0x1e')](_0x58ecb3);fs['chmodSync'](_0x26f35c,_0xa7f1('0x2e'));}catch(_0x5a8ef5){logger[_0xa7f1('0x17')](_0x5a8ef5);}return _0x26f35c[_0xa7f1('0x2f')]('.')[0x0];});}function base64Encode(_0x1a5cce){var _0x796024=fs['readFileSync'](_0x1a5cce);return new Buffer(_0x796024)[_0xa7f1('0x30')](_0xa7f1('0x2c'));}exports[_0xa7f1('0x31')]=function(_0x10b1b7,_0x1515fa,_0x50caed,_0x352c01,_0x39bb64,_0x1c3f1a){var _0x121ff1,_0x3c5059;var _0x51a3d1=_0xa7f1('0x32');var _0x428cf2=_0xa7f1('0x33')+_0x10b1b7;var _0x2f7215={};if(_0x1515fa===_0xa7f1('0x34')){_0x2f7215['input']={'ssml':_0x50caed};}else{_0x2f7215[_0xa7f1('0x35')]={'text':_0x50caed};};_0x2f7215[_0xa7f1('0x36')]={'languageCode':_0x352c01,'ssmlGender':_0x39bb64};_0x2f7215[_0xa7f1('0x37')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2b0e1e={'url':_0x51a3d1+'text:synthesize'+_0x428cf2,'method':_0xa7f1('0x38'),'json':!![],'body':_0x2f7215};return rp(_0x2b0e1e)[_0xa7f1('0x2d')](function(_0x47c31d){return new BPromise(function(_0x40a25f,_0x4bf5e0){_0x121ff1=path[_0xa7f1('0x39')](__dirname,_0xa7f1('0x29'),rs[_0xa7f1('0x3a')](0x4)+'.mp3');var _0x1f6003=Buffer[_0xa7f1('0x3b')](_0x47c31d[_0xa7f1('0x3c')],'base64');return fs['writeFile'](_0x121ff1,_0x1f6003,function(_0x871c66){_0x4bf5e0(_0x871c66);},function(_0x136ac4){fs[_0xa7f1('0x3d')](_0x121ff1,_0xa7f1('0x2e'));_0x40a25f(_0x136ac4);});});})['then'](function(_0x5796b8){_0x3c5059=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xa7f1('0x2a'));return convertFile(_0x121ff1,_0x3c5059);})['then'](function(){try{fs[_0xa7f1('0x1e')](_0x121ff1);fs[_0xa7f1('0x3d')](_0x3c5059,'777');}catch(_0x142c41){logger['error'](_0x142c41);}logger[_0xa7f1('0x1c')](_0xa7f1('0x3e'),_0x3c5059[_0xa7f1('0x2f')]('.')[0x0]);return _0x3c5059[_0xa7f1('0x2f')]('.')[0x0];});};exports[_0xa7f1('0x3f')]=function(_0x5bc5c4,_0x1a9141){var _0x5ec436=_0xa7f1('0x40');var _0x581f49,_0x34c532;var _0x18e983;var _0x7b006d={'encoding':'utf8','method':_0xa7f1('0x38'),'timeout':0x2710,'url':_0x5ec436,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xa7f1('0x41')+encodeURIComponent(JSON[_0xa7f1('0x42')]([[['jQ1olc',JSON[_0xa7f1('0x42')]([_0x5bc5c4,_0x1a9141||'en',![],'null']),null,_0xa7f1('0x43')]]]))};return rp(_0x7b006d)[_0xa7f1('0x2d')](function(_0x503ef3){try{_0x18e983=eval(_0x503ef3[_0xa7f1('0x44')](0x5))[0x0][0x2];}catch(_0x7ad08f){throw new Error(_0xa7f1('0x45')+_0x503ef3[_0xa7f1('0x24')]);}if(!_0x18e983){if(_0x5bc5c4[_0xa7f1('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xa7f1('0x47')+_0x1a9141+'\x22\x20might\x20not\x20exist');}}try{_0x18e983=eval(_0x18e983)[0x0];}catch(_0xcc945f){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x22a7cf=_0x18e983;_0x581f49=path[_0xa7f1('0x39')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');fs[_0xa7f1('0x2b')](_0x581f49,_0x18e983,{'encoding':'base64'});_0x34c532=path[_0xa7f1('0x39')](__dirname,_0xa7f1('0x29'),rs[_0xa7f1('0x3a')](0x4)+_0xa7f1('0x2a'));return convertFile(_0x581f49,_0x34c532);})['then'](function(){try{fs['unlink'](_0x581f49);fs['chmodSync'](_0x34c532,_0xa7f1('0x2e'));}catch(_0x20daeb){logger['error'](_0x20daeb);}logger[_0xa7f1('0x1c')](_0xa7f1('0x48'),_0x34c532[_0xa7f1('0x2f')]('.')[0x0]);return _0x34c532[_0xa7f1('0x2f')]('.')[0x0];});};exports[_0xa7f1('0x49')]=function(_0x5e2f0a,_0x1d2179,_0x5cef92){return google['asr'](_0x5e2f0a,_0x1d2179,_0x5cef92)[_0xa7f1('0x2d')](function(_0x489ae1){logger[_0xa7f1('0x1c')](_0x489ae1['uri']);return rp(_0x489ae1);})[_0xa7f1('0x2d')](function(_0xaa2f){var _0x160e8b='';var _0x5c572e=0x0;try{fs[_0xa7f1('0x1e')](_0x5e2f0a);}catch(_0x5e06a6){logger[_0xa7f1('0x17')](_0x5e06a6);}if(_0xaa2f&&_0xaa2f[_0xa7f1('0x4a')]){_0x160e8b=_0xaa2f[_0xa7f1('0x4a')][_0xa7f1('0x4b')](function(_0x2b3254){return _0x2b3254&&_0x2b3254['alternatives'][0x0]&&_0x2b3254[_0xa7f1('0x4c')][0x0][_0xa7f1('0x4d')]?_0x2b3254[_0xa7f1('0x4c')][0x0][_0xa7f1('0x4d')]:'';})['join']('\x0a');_0x5c572e=_0xaa2f[_0xa7f1('0x4a')][_0xa7f1('0x4b')](function(_0xafe697){return _0xafe697&&_0xafe697[_0xa7f1('0x4c')][0x0]&&_0xafe697['alternatives'][0x0]['confidence']?_0xafe697[_0xa7f1('0x4c')][0x0]['confidence']:0x0;})[_0xa7f1('0x4e')]('\x0a');}logger['info'](_0xa7f1('0x4f'),_0x160e8b);logger['info'](_0xa7f1('0x50'),_0x5c572e);return{'transcript':_0x160e8b,'confidence':_0x5c572e};})[_0xa7f1('0x51')](function(_0x14545b){logger['error'](_0xa7f1('0x52'),_0x14545b[_0xa7f1('0x16')],_0x14545b[_0xa7f1('0x53')],_0x14545b[_0xa7f1('0x54')]);});};exports[_0xa7f1('0x55')]=function(_0x4bd125,_0x31bc82,_0x58c2b3,_0x7ae96a){var _0x315c3c=apiai(_0x31bc82,{'language':_0x7ae96a||'en'});return _0x315c3c[_0xa7f1('0x56')](_0x58c2b3,{'sessionId':md5(_0x4bd125)})[_0xa7f1('0x2d')](function(_0x1dafc){logger[_0xa7f1('0x1c')](JSON[_0xa7f1('0x42')](_0x1dafc));return{'source':_0x1dafc['result'][_0xa7f1('0x57')],'resolvedQuery':_0x1dafc[_0xa7f1('0x58')]['resolvedQuery'],'action':_0x1dafc['result']['action'],'actionIncomplete':_0x1dafc[_0xa7f1('0x58')][_0xa7f1('0x59')],'speech':_0x1dafc[_0xa7f1('0x58')][_0xa7f1('0x5a')][_0xa7f1('0x5b')],'score':_0x1dafc[_0xa7f1('0x58')][_0xa7f1('0x5c')],'statusCode':_0x1dafc[_0xa7f1('0x5d')]['code'],'endConversation':_0x1dafc[_0xa7f1('0x58')][_0xa7f1('0x5e')]['endConversation']||![],'isFallbackIntent':_0x1dafc['result']['metadata']['isFallbackIntent']};});};exports[_0xa7f1('0x5f')]=function(_0x337cd1,_0x187ad2,_0x1cf515,_0x4a7734,_0x50ebb4,_0xa49dce){var _0x42509b=_0x4a7734[_0xa7f1('0x60')](/\\n/g,'\x0a');var _0x35f319={'credentials':{'private_key':_0x42509b,'client_email':_0x1cf515}};var _0x1f2520=new dialogflow[(_0xa7f1('0x61'))](_0x35f319);var _0x3ac8dc=_0x1f2520['sessionPath'](_0x187ad2,md5(_0x337cd1));var _0x4ac860={'session':_0x3ac8dc,'queryInput':{'text':{'text':_0x50ebb4,'languageCode':_0xa49dce}}};return _0x1f2520[_0xa7f1('0x62')](_0x4ac860)['then'](function(_0xf53449){if(_0xf53449&&_0xf53449['length']){logger[_0xa7f1('0x1c')](_0xa7f1('0x63'),JSON[_0xa7f1('0x42')](_0xf53449));var _0x2f2b38=_0xf53449[0x0];if(_0x2f2b38){var _0x2c0280={'action':_0x2f2b38['queryResult'][_0xa7f1('0x64')],'allRequiredParamsPresent':_0x2f2b38['queryResult']['allRequiredParamsPresent'],'endConversation':_0x2f2b38['queryResult'][_0xa7f1('0x65')]&&_0x2f2b38[_0xa7f1('0x66')]['diagnosticInfo'][_0xa7f1('0x67')]?_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x65')][_0xa7f1('0x67')][_0xa7f1('0x68')][_0xa7f1('0x69')]:![],'fulfillmentText':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x6a')],'intentName':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x6b')][_0xa7f1('0x53')],'intentDisplayName':_0x2f2b38[_0xa7f1('0x66')]['intent'][_0xa7f1('0x6c')],'isFallbackIntent':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x6b')][_0xa7f1('0x6d')],'languageCode':_0x2f2b38['queryResult']['languageCode'],'queryText':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x6e')],'responseId':_0x2f2b38[_0xa7f1('0x6f')],'score':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x70')],'speech':_0x2f2b38[_0xa7f1('0x66')][_0xa7f1('0x6a')],'providerResponse':JSON[_0xa7f1('0x42')](_0xf53449)};return _0x2c0280;}}});};exports['tildeASR']=function(_0x4065c1,_0x2995e9,_0x7d7dad,_0x74add9){return tilde['asr'](_0x4065c1,_0x2995e9,_0x7d7dad,_0x74add9)[_0xa7f1('0x2d')](function(_0x6e19b1){try{fs[_0xa7f1('0x1e')](_0x4065c1);}catch(_0x1ff714){logger[_0xa7f1('0x17')](_0x1ff714);}logger['info']('Tilde\x20ASR\x20transcription',_0x6e19b1[_0xa7f1('0x4d')]);logger['info'](_0xa7f1('0x71'),_0x6e19b1[_0xa7f1('0x72')]);return _0x6e19b1;});};exports[_0xa7f1('0x73')]=function(_0xe88adf,_0x3614d8,_0x335bbf,_0x33ad79,_0xff5328,_0x46513e){var _0x445ae4=path['resolve'](__dirname,'tmp',rs[_0xa7f1('0x3a')](0x4)+'.mp3');var _0xa6c16f;return aws[_0xa7f1('0x74')](_0xe88adf,_0x3614d8,_0x335bbf,_0x33ad79,_0xff5328,_0x46513e,_0x445ae4)[_0xa7f1('0x2d')](function(){_0xa6c16f=path[_0xa7f1('0x39')](__dirname,_0xa7f1('0x29'),rs[_0xa7f1('0x3a')](0x4)+_0xa7f1('0x2a'));return convertFile(_0x445ae4,_0xa6c16f);})[_0xa7f1('0x2d')](function(){try{fs['unlink'](_0x445ae4);fs[_0xa7f1('0x3d')](_0xa6c16f,_0xa7f1('0x2e'));}catch(_0x28a4b5){logger['error'](_0x28a4b5);}return _0xa6c16f['split']('.')[0x0];});};exports['awsLex']=function(_0x358faf,_0x3fbe3b,_0xa132be,_0x56c6cf,_0x2be105,_0x2bc9cc){return aws['lex'](_0x358faf,_0x3fbe3b,_0xa132be,_0x56c6cf,_0x2be105,_0x2bc9cc)[_0xa7f1('0x2d')](function(_0x16cd9c){logger[_0xa7f1('0x1c')](JSON[_0xa7f1('0x42')](_0x16cd9c));return _0x16cd9c;});};exports[_0xa7f1('0x75')]=function(_0x514b14,_0x296518,_0x4728f6,_0x1cd876){var _0xa53efd=util[_0xa7f1('0x76')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x514b14,encodeURIComponent(_0x296518),_0x4728f6,_0x1cd876);var _0xb21588=path[_0xa7f1('0x39')](__dirname,_0xa7f1('0x29'),rs[_0xa7f1('0x3a')](0x4)+'.mp3');var _0x297cf1;return downloadFile(_0xa53efd,_0xb21588)[_0xa7f1('0x2d')](function(){_0x297cf1=path[_0xa7f1('0x39')](__dirname,_0xa7f1('0x29'),rs['generate'](0x4)+_0xa7f1('0x2a'));return convertFile(_0xb21588,_0x297cf1);})[_0xa7f1('0x2d')](function(){try{fs[_0xa7f1('0x1e')](_0xb21588);fs['chmodSync'](_0x297cf1,_0xa7f1('0x2e'));}catch(_0x588207){logger['error'](_0x588207);}return _0x297cf1[_0xa7f1('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x2ef241,_0x34691c,_0x370bd4,_0x2ad354){var _0x50b01e=util[_0xa7f1('0x76')](_0xa7f1('0x77'),ISPEECH_API,_0x34691c,_0x370bd4,base64Encode(_0x2ef241),_0x2ad354?util[_0xa7f1('0x76')]('model=%s',encodeURIComponent(_0x2ad354)):_0xa7f1('0x78'));return uploadFile(_0x50b01e)[_0xa7f1('0x2d')](function(_0x498ba0){return querystring['parse'](_0x498ba0);});};exports[_0xa7f1('0x79')]=function(_0x4411d1,_0x5f472e){return sestek[_0xa7f1('0x7a')](_0x4411d1,_0x5f472e)[_0xa7f1('0x2d')](function(_0x39509e){logger['info'](JSON[_0xa7f1('0x42')](_0x39509e));var _0x26e40e={'speech':_0x39509e[_0xa7f1('0x7b')],'action':_0x39509e[_0xa7f1('0x7c')]?_0x39509e[_0xa7f1('0x7c')][_0xa7f1('0x7d')]:undefined,'actiondata':_0x39509e[_0xa7f1('0x7c')]?_0x39509e[_0xa7f1('0x7c')][_0xa7f1('0x7e')]:undefined};if(_0x39509e['channelData']&&_0x39509e[_0xa7f1('0x7c')][_0xa7f1('0x7f')]){return base64Decode(_0x39509e['channelData'][_0xa7f1('0x7f')][_0xa7f1('0x80')],path['resolve'](__dirname,_0xa7f1('0x29'),rs[_0xa7f1('0x3a')](0x4)+_0xa7f1('0x2a')))[_0xa7f1('0x2d')](function(_0x1d4e67){_0x26e40e[_0xa7f1('0x81')]=_0x1d4e67;return _0x26e40e;});}return _0x26e40e;});};exports[_0xa7f1('0x82')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 4041766..560e3e4 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 _0x249c=['./nda'];(function(_0x413d83,_0x487390){var _0xe15e65=function(_0x3ce0ee){while(--_0x3ce0ee){_0x413d83['push'](_0x413d83['shift']());}};_0xe15e65(++_0x487390);}(_0x249c,0x19f));var _0xc249=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0x249c[_0x5f3de3];return _0x287e0d;};var nda=require(_0xc249('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x7c47=['./nda','exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7c47,0x1e0));var _0x77c4=function(_0x1fa6a1,_0x9f7ddf){_0x1fa6a1=_0x1fa6a1-0x0;var _0x3a7ad0=_0x7c47[_0x1fa6a1];return _0x3a7ad0;};var nda=require(_0x77c4('0x0'));module[_0x77c4('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 394df02..6599c2f 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 _0xdf79=['dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','../../../../../config/logger','agi','exports','/token','password','username','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid'];(function(_0x57203d,_0x1aefbf){var _0x184239=function(_0x3643be){while(--_0x3643be){_0x57203d['push'](_0x57203d['shift']());}};_0x184239(++_0x1aefbf);}(_0xdf79,0xa7));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x9df7('0x0'))(_0x9df7('0x1'));module[_0x9df7('0x2')]=function(_0x2450f8,_0x2fbdd5){var _0x5251ba={'method':'POST','uri':url['resolve'](_0x2fbdd5['ndauth_url'],_0x9df7('0x3')),'form':{'grant_type':_0x9df7('0x4'),'username':_0x2fbdd5[_0x9df7('0x5')],'password':_0x2fbdd5[_0x9df7('0x4')]},'json':!![]};return rp(_0x5251ba)['then'](function(_0x21d177){var _0x4cc7d5={'method':_0x9df7('0x6'),'uri':url['resolve'](_0x2fbdd5[_0x9df7('0x7')],_0x9df7('0x8')),'body':{'type':_0x2fbdd5[_0x9df7('0x9')]||'message','channelId':_0x9df7('0xa'),'conversation':{'id':_0x2450f8[_0x9df7('0xb')]},'from':{'id':_0x2450f8[_0x9df7('0xc')],'name':_0x2450f8['calleridname']},'recipient':{'id':_0x2450f8[_0x9df7('0xd')],'name':_0x2450f8[_0x9df7('0xe')]},'text':_0x2fbdd5[_0x9df7('0xf')],'channelData':{}},'headers':{'Authorization':_0x9df7('0x10')+_0x21d177[_0x9df7('0x11')]},'json':!![]};if(_0x2fbdd5[_0x9df7('0x12')]){_0x4cc7d5[_0x9df7('0x13')][_0x9df7('0x14')][_0x9df7('0x15')]=_0x2fbdd5[_0x9df7('0x12')];}if(_0x2fbdd5[_0x9df7('0x16')]=='1'){_0x4cc7d5[_0x9df7('0x13')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9df7('0x17')};}if(_0x2fbdd5[_0x9df7('0x18')]){_0x4cc7d5[_0x9df7('0x13')]['channelData'][_0x9df7('0x19')]=_0x2fbdd5['custom_action'];if(_0x2fbdd5['custom_action_data']){_0x4cc7d5['body'][_0x9df7('0x14')][_0x9df7('0x1a')]=_0x2fbdd5[_0x9df7('0x1b')];}}logger[_0x9df7('0x1c')](JSON[_0x9df7('0x1d')](_0x4cc7d5));return rp(_0x4cc7d5);});}; \ No newline at end of file +var _0xc79f=['info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data'];(function(_0x55d4ce,_0x378d02){var _0x7b64ab=function(_0xa4c91e){while(--_0xa4c91e){_0x55d4ce['push'](_0x55d4ce['shift']());}};_0x7b64ab(++_0x378d02);}(_0xc79f,0x82));var _0xfc79=function(_0x4d0fa4,_0x4d649f){_0x4d0fa4=_0x4d0fa4-0x0;var _0x4ddcd6=_0xc79f[_0x4d0fa4];return _0x4ddcd6;};'use strict';var rp=require(_0xfc79('0x0'));var url=require(_0xfc79('0x1'));var logger=require(_0xfc79('0x2'))(_0xfc79('0x3'));module[_0xfc79('0x4')]=function(_0x5e2603,_0x34c2d6){var _0x31cbc0={'method':_0xfc79('0x5'),'uri':url[_0xfc79('0x6')](_0x34c2d6[_0xfc79('0x7')],_0xfc79('0x8')),'form':{'grant_type':_0xfc79('0x9'),'username':_0x34c2d6[_0xfc79('0xa')],'password':_0x34c2d6[_0xfc79('0x9')]},'json':!![]};return rp(_0x31cbc0)['then'](function(_0x8c8b37){var _0x59bf11={'method':_0xfc79('0x5'),'uri':url[_0xfc79('0x6')](_0x34c2d6[_0xfc79('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x34c2d6[_0xfc79('0xc')]||_0xfc79('0xd'),'channelId':_0xfc79('0xe'),'conversation':{'id':_0x5e2603[_0xfc79('0xf')]},'from':{'id':_0x5e2603['callerid'],'name':_0x5e2603[_0xfc79('0x10')]},'recipient':{'id':_0x5e2603[_0xfc79('0x11')],'name':_0x5e2603[_0xfc79('0x12')]},'text':_0x34c2d6['text'],'channelData':{}},'headers':{'Authorization':_0xfc79('0x13')+_0x8c8b37[_0xfc79('0x14')]},'json':!![]};if(_0x34c2d6['project']){_0x59bf11[_0xfc79('0x15')]['channelData'][_0xfc79('0x16')]=_0x34c2d6[_0xfc79('0x17')];}if(_0x34c2d6[_0xfc79('0x18')]=='1'){_0x59bf11['body'][_0xfc79('0x19')][_0xfc79('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xfc79('0x1b')};}if(_0x34c2d6[_0xfc79('0x1c')]){_0x59bf11[_0xfc79('0x15')][_0xfc79('0x19')]['CustomAction']=_0x34c2d6[_0xfc79('0x1c')];if(_0x34c2d6[_0xfc79('0x1d')]){_0x59bf11[_0xfc79('0x15')][_0xfc79('0x19')]['CustomActionData']=_0x34c2d6[_0xfc79('0x1d')];}}logger[_0xfc79('0x1e')](JSON[_0xfc79('0x1f')](_0x59bf11));return rp(_0x59bf11);});}; \ 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 cca6460..922592c 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 _0x98c6=['exports','./lib/api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x98c6,0xe1));var _0x698c=function(_0x5464ec,_0x8c8f92){_0x5464ec=_0x5464ec-0x0;var _0x5f704b=_0x98c6[_0x5464ec];return _0x5f704b;};'use strict';var asr=require(_0x698c('0x0'));module[_0x698c('0x1')]=function(_0x111cd3,_0x59a45a,_0x48ae73,_0x33b453){return asr(_0x111cd3,_0x59a45a,_0x48ae73,_0x33b453);}; \ No newline at end of file +var _0xc793=['exports','./lib/api'];(function(_0x2d41dd,_0x12171f){var _0x1ca3c8=function(_0x4d0846){while(--_0x4d0846){_0x2d41dd['push'](_0x2d41dd['shift']());}};_0x1ca3c8(++_0x12171f);}(_0xc793,0x17f));var _0x3c79=function(_0x5321d4,_0xe55add){_0x5321d4=_0x5321d4-0x0;var _0x9b80ae=_0xc793[_0x5321d4];return _0x9b80ae;};'use strict';var asr=require(_0x3c79('0x0'));module[_0x3c79('0x1')]=function(_0x21f821,_0x4845d8,_0x380877,_0x41b59c){return asr(_0x21f821,_0x4845d8,_0x380877,_0x41b59c);}; \ 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 0e9d8fa..8ebb9d7 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 _0x5fe7=['Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','close','lodash','moment','crypto','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','info','createReadStream','data','send','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','parse','status','result','final'];(function(_0x6a23aa,_0x3797ab){var _0x5ad153=function(_0xee6112){while(--_0xee6112){_0x6a23aa['push'](_0x6a23aa['shift']());}};_0x5ad153(++_0x3797ab);}(_0x5fe7,0xa8));var _0x75fe=function(_0x20e492,_0x2be336){_0x20e492=_0x20e492-0x0;var _0x3b895b=_0x5fe7[_0x20e492];return _0x3b895b;};'use strict';var BPromise=require('bluebird');var _=require(_0x75fe('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x75fe('0x1'));var crypto=require(_0x75fe('0x2'));var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x177ac1,_0x29647c,_0x4f46d6,_0x5aa679){return new BPromise(function(_0x2df435,_0x131305){logger['info']('Tilde\x20URI',_0x5aa679||_0x75fe('0x3'));var _0x11bf61=new WebSocket(_0x5aa679||_0x75fe('0x3'),{'perMessageDeflate':![]});var _0x4967da='';var _0x28056e='0';var _0x288a76='1';var _0xfa2f67=_0x75fe('0x4');function _0x4691ab(_0x411a74){var _0x246d36=crypto[_0x75fe('0x5')](_0x75fe('0x6'));_0x246d36[_0x75fe('0x7')](_0x411a74);return _0x246d36[_0x75fe('0x8')](_0x75fe('0x9'));}function _0xb6b0e6(){try{logger[_0x75fe('0xa')]('Open\x20Tilde\x20ASR\x20socket');var _0x4629fd=moment()['unix']();var _0x49dfd2=_0x4691ab(_0x4629fd+_0x29647c+_0x4f46d6);_0x11bf61['send'](JSON['stringify']({'appID':_0x29647c,'timestamp':_0x4629fd,'appKey':_0x49dfd2}));var _0x539ea1=fs[_0x75fe('0xb')](_0x177ac1);_0x539ea1['on'](_0x75fe('0xc'),function(_0x2b5ad0){_0x11bf61['send'](_0x2b5ad0);});_0x539ea1['on']('close',function(){_0x11bf61[_0x75fe('0xd')](_0x75fe('0xe'));});}catch(_0x5dd916){logger[_0x75fe('0xf')](_0x75fe('0x10'),JSON[_0x75fe('0x11')](_0x5dd916));_0x11bf61['terminate']();}}function _0x470bc0(_0x4fc010){try{if(_0x4fc010){var _0x46ab0b=JSON[_0x75fe('0x12')](_0x4fc010);switch(_0x46ab0b[_0x75fe('0x13')]){case 0x0:if(_0x46ab0b[_0x75fe('0x14')]){if(_0x46ab0b['result'][_0x75fe('0x15')]){logger[_0x75fe('0xa')](_0x75fe('0x16'),JSON['stringify'](_0x46ab0b[_0x75fe('0x14')][_0x75fe('0x17')]));_0x4967da=_0x46ab0b[_0x75fe('0x14')][_0x75fe('0x17')][0x0][_0x75fe('0x18')];_0x28056e=_0x46ab0b[_0x75fe('0x14')]['hypotheses'][0x0][_0x75fe('0x19')];_0x288a76='0';_0xfa2f67=_0x75fe('0x1a');_0x11bf61['terminate']();}}break;case 0x1:logger[_0x75fe('0xa')](_0x75fe('0x4'));_0x288a76='1';_0xfa2f67=_0x75fe('0x4');break;case 0x2:logger[_0x75fe('0xa')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x288a76='2';_0xfa2f67=_0x75fe('0x1b');break;case 0x9:logger['info'](_0x75fe('0x1c'));_0x288a76='9';_0xfa2f67=_0x75fe('0x1c');break;case 0xa:logger['info'](_0x75fe('0x1d'));_0x288a76='10';_0xfa2f67='Authentication\x20failed.';break;case 0xb:logger[_0x75fe('0xa')](_0x75fe('0x1e'));_0x288a76='11';_0xfa2f67=_0x75fe('0x1e');}}}catch(_0x4d72d6){logger[_0x75fe('0xf')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x75fe('0x11')](_0x4d72d6));_0x11bf61[_0x75fe('0x1f')]();}}function _0xd77448(){logger['info'](_0x75fe('0x20'));_0x2df435({'transcript':_0x4967da,'confidence':_0x28056e,'status':_0x288a76,'status_message':_0xfa2f67});}function _0x23db11(_0xd8a6d){logger[_0x75fe('0xf')](_0x75fe('0x21'));if(!_[_0x75fe('0x22')](_0xd8a6d)){logger[_0x75fe('0xf')](_['isObject'](_0xd8a6d)?JSON[_0x75fe('0x11')](_0xd8a6d):_0xd8a6d);}}_0x11bf61['on'](_0x75fe('0x23'),_0xb6b0e6);_0x11bf61['on'](_0x75fe('0x24'),_0x470bc0);_0x11bf61['on'](_0x75fe('0x25'),_0xd77448);_0x11bf61['on'](_0x75fe('0xf'),_0x23db11);});}; \ No newline at end of file +var _0xe3e5=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','unix','send','stringify','createReadStream','data','EOS','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x16a7d6,_0x49ad49){var _0x49eaf1=function(_0x11b6ce){while(--_0x11b6ce){_0x16a7d6['push'](_0x16a7d6['shift']());}};_0x49eaf1(++_0x49ad49);}(_0xe3e5,0x1a4));var _0x5e3e=function(_0x9b8ed4,_0x26931a){_0x9b8ed4=_0x9b8ed4-0x0;var _0x4a4f86=_0xe3e5[_0x9b8ed4];return _0x4a4f86;};'use strict';var BPromise=require(_0x5e3e('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x5e3e('0x1'));var crypto=require(_0x5e3e('0x2'));var logger=require(_0x5e3e('0x3'))(_0x5e3e('0x4'));module[_0x5e3e('0x5')]=function(_0x4ade50,_0x540ac1,_0x4d4962,_0x143898){return new BPromise(function(_0x33e7a5,_0x487c49){logger[_0x5e3e('0x6')](_0x5e3e('0x7'),_0x143898||_0x5e3e('0x8'));var _0x4c228b=new WebSocket(_0x143898||_0x5e3e('0x8'),{'perMessageDeflate':![]});var _0x201b59='';var _0x3b6b83='0';var _0xe00367='1';var _0x33a5c3=_0x5e3e('0x9');function _0x707cf4(_0x1d4810){var _0x13059f=crypto[_0x5e3e('0xa')](_0x5e3e('0xb'));_0x13059f[_0x5e3e('0xc')](_0x1d4810);return _0x13059f[_0x5e3e('0xd')]('hex');}function _0x3a8d34(){try{logger[_0x5e3e('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x898ab5=moment()[_0x5e3e('0xe')]();var _0x2882c6=_0x707cf4(_0x898ab5+_0x540ac1+_0x4d4962);_0x4c228b[_0x5e3e('0xf')](JSON[_0x5e3e('0x10')]({'appID':_0x540ac1,'timestamp':_0x898ab5,'appKey':_0x2882c6}));var _0x8742e1=fs[_0x5e3e('0x11')](_0x4ade50);_0x8742e1['on'](_0x5e3e('0x12'),function(_0x28d73d){_0x4c228b['send'](_0x28d73d);});_0x8742e1['on']('close',function(){_0x4c228b[_0x5e3e('0xf')](_0x5e3e('0x13'));});}catch(_0x3d7172){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x5e3e('0x10')](_0x3d7172));_0x4c228b[_0x5e3e('0x14')]();}}function _0xa493d4(_0x49c45c){try{if(_0x49c45c){var _0x1226ab=JSON[_0x5e3e('0x15')](_0x49c45c);switch(_0x1226ab[_0x5e3e('0x16')]){case 0x0:if(_0x1226ab['result']){if(_0x1226ab[_0x5e3e('0x17')]['final']){logger['info'](_0x5e3e('0x18'),JSON[_0x5e3e('0x10')](_0x1226ab[_0x5e3e('0x17')][_0x5e3e('0x19')]));_0x201b59=_0x1226ab['result']['hypotheses'][0x0]['transcript'];_0x3b6b83=_0x1226ab[_0x5e3e('0x17')]['hypotheses'][0x0][_0x5e3e('0x1a')];_0xe00367='0';_0x33a5c3=_0x5e3e('0x1b');_0x4c228b['terminate']();}}break;case 0x1:logger[_0x5e3e('0x6')](_0x5e3e('0x9'));_0xe00367='1';_0x33a5c3=_0x5e3e('0x9');break;case 0x2:logger[_0x5e3e('0x6')](_0x5e3e('0x1c'));_0xe00367='2';_0x33a5c3=_0x5e3e('0x1c');break;case 0x9:logger[_0x5e3e('0x6')](_0x5e3e('0x1d'));_0xe00367='9';_0x33a5c3=_0x5e3e('0x1d');break;case 0xa:logger[_0x5e3e('0x6')](_0x5e3e('0x1e'));_0xe00367='10';_0x33a5c3=_0x5e3e('0x1e');break;case 0xb:logger[_0x5e3e('0x6')](_0x5e3e('0x1f'));_0xe00367='11';_0x33a5c3=_0x5e3e('0x1f');}}}catch(_0x1f3113){logger['error'](_0x5e3e('0x20'),JSON[_0x5e3e('0x10')](_0x1f3113));_0x4c228b[_0x5e3e('0x14')]();}}function _0x49deb8(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x33e7a5({'transcript':_0x201b59,'confidence':_0x3b6b83,'status':_0xe00367,'status_message':_0x33a5c3});}function _0x49517d(_0x20362c){logger[_0x5e3e('0x21')](_0x5e3e('0x22'));if(!_[_0x5e3e('0x23')](_0x20362c)){logger[_0x5e3e('0x21')](_[_0x5e3e('0x24')](_0x20362c)?JSON[_0x5e3e('0x10')](_0x20362c):_0x20362c);}}_0x4c228b['on'](_0x5e3e('0x25'),_0x3a8d34);_0x4c228b['on'](_0x5e3e('0x26'),_0xa493d4);_0x4c228b['on']('close',_0x49deb8);_0x4c228b['on'](_0x5e3e('0x21'),_0x49517d);});}; \ 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 1dc3ce2..6fb36a3 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 _0x021f=['./asr'];(function(_0x185190,_0x418609){var _0x38abe4=function(_0x24d1b1){while(--_0x24d1b1){_0x185190['push'](_0x185190['shift']());}};_0x38abe4(++_0x418609);}(_0x021f,0x1c9));var _0xf021=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x021f[_0x5c2e3e];return _0x53f64a;};var asr=require(_0xf021('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x236b=['exports','./asr'];(function(_0x393c24,_0x29c062){var _0x273e83=function(_0x239f61){while(--_0x239f61){_0x393c24['push'](_0x393c24['shift']());}};_0x273e83(++_0x29c062);}(_0x236b,0x1e5));var _0xb236=function(_0x4e00d0,_0xceae82){_0x4e00d0=_0x4e00d0-0x0;var _0xdfabbc=_0x236b[_0x4e00d0];return _0xdfabbc;};var asr=require(_0xb236('0x0'));module[_0xb236('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f1ee161..f467ede 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 _0x7a8d=['net','events','EventEmitter','./error','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x5df378,_0x1692b4){var _0x58fb26=function(_0xbea53){while(--_0xbea53){_0x5df378['push'](_0x5df378['shift']());}};_0x58fb26(++_0x1692b4);}(_0x7a8d,0x150));var _0xd7a8=function(_0x1f4684,_0x594baa){_0x1f4684=_0x1f4684-0x0;var _0x2fbf7a=_0x7a8d[_0x1f4684];return _0x2fbf7a;};'use strict';var util=require('util');var net=require(_0xd7a8('0x0'));var EventEmitter=require(_0xd7a8('0x1'))[_0xd7a8('0x2')];var AGIError=require(_0xd7a8('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x80aa00,_0x704043,_0x248328){var _0x11f2ab=this,_0x80aa00=_0x80aa00||0x11dd,_0x704043=_0x704043||'127.0.0.1',_0x51a246=null,_0x55429f=0x0;EventEmitter['call'](_0x11f2ab);function _0x127094(){if(!_0x80aa00){_0x11f2ab['emit'](_0xd7a8('0x4'),new AGIError(_0xd7a8('0x5')));return![];}_0x51a246=net[_0xd7a8('0x6')]();_0x51a246[_0xd7a8('0x7')](_0x80aa00,_0x704043);_0x51a246['on'](_0xd7a8('0x8'),function(){_0x11f2ab[_0xd7a8('0x9')]('listening');});_0x51a246['on'](_0xd7a8('0xa'),function(_0xa7346){_0x51a246[_0xd7a8('0xb')](function(_0x32771f,_0x28518a){if(_0x32771f){_0x11f2ab[_0xd7a8('0x9')](_0xd7a8('0x4'),new AGIError('E_AGI_SERVER_ERROR',_0x32771f));}else if(_0x248328&&_0x248328<0x0){_0x11f2ab['emit'](_0xd7a8('0x4'),new AGIError(_0xd7a8('0xc')));_0xa7346[_0xd7a8('0xd')]();}else if(_0x248328&&_0x248328>0x0&&_0x248328<_0x28518a){_0x55429f+=0x1;_0x11f2ab[_0xd7a8('0x9')](_0xd7a8('0x4'),new AGIError(_0xd7a8('0xe'),_0x55429f));_0xa7346[_0xd7a8('0xd')]();}else{var _0x89d5e7=new AGIChannel(_0xa7346);_0x89d5e7['on'](_0xd7a8('0xf'),function(){_0x11f2ab[_0xd7a8('0x9')](_0xd7a8('0xa'),_0x89d5e7);});}});});_0x51a246['on'](_0xd7a8('0x4'),function(_0x40e5e1){_0x11f2ab[_0xd7a8('0x9')]('error',new AGIError(_0xd7a8('0x10'),_0x40e5e1[_0xd7a8('0x11')]));});_0x51a246['on'](_0xd7a8('0x12'),function(){_0x11f2ab[_0xd7a8('0x9')](_0xd7a8('0x12'),new AGIError(_0xd7a8('0x13')));});}process[_0xd7a8('0x14')](function(){_0x127094();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x449ffa,_0x3fb705,_0x1c9d1d){return new AGIServer(_0x449ffa,_0x3fb705,_0x1c9d1d);}; \ No newline at end of file +var _0xee09=['./channel','127.0.0.1','emit','error','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','./error'];(function(_0x11579f,_0x26ab6b){var _0x56e613=function(_0x21c110){while(--_0x21c110){_0x11579f['push'](_0x11579f['shift']());}};_0x56e613(++_0x26ab6b);}(_0xee09,0x1ca));var _0x9ee0=function(_0x36cc0d,_0x1a1655){_0x36cc0d=_0x36cc0d-0x0;var _0x45c640=_0xee09[_0x36cc0d];return _0x45c640;};'use strict';var util=require(_0x9ee0('0x0'));var net=require(_0x9ee0('0x1'));var EventEmitter=require(_0x9ee0('0x2'))['EventEmitter'];var AGIError=require(_0x9ee0('0x3'));var AGIChannel=require(_0x9ee0('0x4'));var AGIServer=function(_0x3d653e,_0x276d45,_0x4a9153){var _0x10fbc6=this,_0x3d653e=_0x3d653e||0x11dd,_0x276d45=_0x276d45||_0x9ee0('0x5'),_0x5ec4db=null,_0x4c017e=0x0;EventEmitter['call'](_0x10fbc6);function _0x46cdcb(){if(!_0x3d653e){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x5ec4db=net[_0x9ee0('0x8')]();_0x5ec4db[_0x9ee0('0x9')](_0x3d653e,_0x276d45);_0x5ec4db['on'](_0x9ee0('0xa'),function(){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0xa'));});_0x5ec4db['on'](_0x9ee0('0xb'),function(_0x3fe7f2){_0x5ec4db[_0x9ee0('0xc')](function(_0x28d321,_0x34c1a2){if(_0x28d321){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0x7'),new AGIError(_0x9ee0('0xd'),_0x28d321));}else if(_0x4a9153&&_0x4a9153<0x0){_0x10fbc6['emit'](_0x9ee0('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x3fe7f2[_0x9ee0('0xe')]();}else if(_0x4a9153&&_0x4a9153>0x0&&_0x4a9153<_0x34c1a2){_0x4c017e+=0x1;_0x10fbc6['emit'](_0x9ee0('0x7'),new AGIError(_0x9ee0('0xf'),_0x4c017e));_0x3fe7f2[_0x9ee0('0xe')]();}else{var _0x1c8ee4=new AGIChannel(_0x3fe7f2);_0x1c8ee4['on']('ready',function(){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0xb'),_0x1c8ee4);});}});});_0x5ec4db['on'](_0x9ee0('0x7'),function(_0x11ae87){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0x7'),new AGIError(_0x9ee0('0xd'),_0x11ae87[_0x9ee0('0x10')]));});_0x5ec4db['on']('close',function(){_0x10fbc6[_0x9ee0('0x6')](_0x9ee0('0x11'),new AGIError(_0x9ee0('0x12')));});}process[_0x9ee0('0x13')](function(){_0x46cdcb();});};util[_0x9ee0('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x3bdcb0,_0x7d0b0d,_0x3e7eb4){return new AGIServer(_0x3bdcb0,_0x7d0b0d,_0x3e7eb4);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 1f20374..7207fa1 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 _0xd943=['render','body','stringify','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','appid','appsecret','uri','clear','includes','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','hasOwnProperty','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','getSquareOdbc','odbc_id','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_access_key_id','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','wav','recordFile','tildeASR','TildeASR\x20Result\x20%s','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','agentLogout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','response','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','bcc','getSmtpOptions','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','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','VOICEMAIL','mailbox','join','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','./scripts','menu','getdigits','channel','mailRpc','getVariable','rpc','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','text','google_tts_language','restAPI','url','timeout','number','POST','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync'];(function(_0x56f6cc,_0x204cdc){var _0xba92c6=function(_0x295098){while(--_0x295098){_0x56f6cc['push'](_0x56f6cc['shift']());}};_0xba92c6(++_0x204cdc);}(_0xd943,0x15d));var _0x3d94=function(_0x1813e8,_0x29b96b){_0x1813e8=_0x1813e8-0x0;var _0x38f783=_0xd943[_0x1813e8];return _0x38f783;};'use strict';var fs=require('fs');var util=require(_0x3d94('0x0'));var _=require(_0x3d94('0x1'));var sh=require(_0x3d94('0x2'));var odbc=require(_0x3d94('0x3'))();var rs=require('randomstring');var moment=require(_0x3d94('0x4'));var Mustache=require(_0x3d94('0x5'));var rp=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var scripts=require(_0x3d94('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x3d94('0xa'),_0x3d94('0xb'),'getsecretdigits'];var AGIVertices=function(_0x512766,_0x3984a3,_0x27e381){this[_0x3d94('0xc')]=_0x512766;this['rpc']=_0x3984a3;this[_0x3d94('0xd')]=_0x27e381;};AGIVertices['prototype'][_0x3d94('0xe')]=function(_0x301536,_0x5f5041){this[_0x3d94('0xf')][_0x3d94('0x10')](_0x301536)[_0x3d94('0x11')](function(_0x368825){_0x5f5041(null,_0x368825?_0x368825[_0x3d94('0x12')]:![]);})['catch'](function(_0x96c54b){_0x5f5041(_0x96c54b);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x14')]=function(_0x4c167c,_0x24e8b9){this[_0x3d94('0xf')][_0x3d94('0x15')](_0x4c167c)['then'](function(_0x14ea5f){_0x24e8b9(null,_0x14ea5f?_0x14ea5f[_0x3d94('0x12')]:![]);})[_0x3d94('0x16')](function(_0x34098e){_0x24e8b9(_0x34098e);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x17')]=function(_0x31c6e8,_0x9893cb){this['rpc'][_0x3d94('0x18')](_0x31c6e8)[_0x3d94('0x11')](function(_0x2acee3){_0x9893cb(null,_0x2acee3?_0x2acee3[_0x3d94('0x12')]:![]);})[_0x3d94('0x16')](function(_0x3ca0e3){_0x9893cb(_0x3ca0e3);});};AGIVertices[_0x3d94('0x13')]['getSquareOdbc']=function(_0x9bca24,_0x59b741){this[_0x3d94('0xf')][_0x3d94('0x19')](_0x9bca24)[_0x3d94('0x11')](function(_0x1e9ec2){_0x59b741(null,_0x1e9ec2?_0x1e9ec2[_0x3d94('0x1a')]:![]);})['catch'](function(_0x578002){_0x59b741(_0x578002);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1b')]=function(_0x9c2f2c,_0x4edee4){this[_0x3d94('0xf')][_0x3d94('0x1c')](_0x9c2f2c)[_0x3d94('0x11')](function(_0x384f76){_0x4edee4(null,_0x384f76?_0x384f76[_0x3d94('0x12')]:![]);})[_0x3d94('0x16')](function(_0x295493){_0x4edee4(_0x295493);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1d')]=function(_0x18f58c,_0x30368c){this[_0x3d94('0xf')][_0x3d94('0x1e')](_0x18f58c)[_0x3d94('0x11')](function(_0x2945d2){_0x30368c(null,_0x2945d2?_0x2945d2['name']:![]);})[_0x3d94('0x16')](function(_0x558fd2){_0x30368c(_0x558fd2);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1f')]=function(_0xc2885,_0x439173){var _0x13254f=this;this[_0x3d94('0xf')][_0x3d94('0x20')](_0xc2885)['then'](function(_0x584c4a){_0x439173(null,_0x584c4a?_0x13254f[_0x3d94('0x21')](_0x584c4a['save_name']):![]);})['catch'](function(_0x23d20d){_0x439173(_0x23d20d);});};AGIVertices['prototype'][_0x3d94('0x22')]=function(_0xef9644,_0x32403a){this['rpc'][_0x3d94('0x23')](_0xef9644)['then'](function(_0x3d4994){_0x32403a(null,_0x3d4994?_0x3d4994:![]);})['catch'](function(_0x1c19b1){_0x32403a(_0x1c19b1);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x24')]=function(_0x246f88,_0x50560c,_0x18f854){this['mailRpc'][_0x3d94('0x24')](_0x246f88,_0x50560c)[_0x3d94('0x11')](function(){_0x18f854(null);})['catch'](function(_0x5288da){_0x18f854(_0x5288da);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x25')]=function(_0x273337,_0x5cdb2e){this[_0x3d94('0xf')][_0x3d94('0x26')](_0x273337)['then'](function(_0x242500){if(_0x242500){if(_0x242500[_0x3d94('0x27')]){_0x5cdb2e(null,[_0x242500[_0x3d94('0x28')]]);}else{_0x5cdb2e(null,_[_0x3d94('0x29')](_0x242500[_0x3d94('0x2a')],'interval'));}}else{_0x5cdb2e(null,![]);}})[_0x3d94('0x16')](function(_0x42b742){_0x5cdb2e(_0x42b742);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x21')]=function(_0xb493f1){return util[_0x3d94('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0xb493f1);};AGIVertices['prototype'][_0x3d94('0x2c')]=function(_0x3e4d64,_0x1c1b25,_0x438ba3){odbc[_0x3d94('0x2d')](_0x3e4d64,function(_0x40a3d8){if(_0x40a3d8){logger[_0x3d94('0x2e')](_0x3d94('0x2f'),_0x40a3d8);_0x438ba3(_0x40a3d8);}else{logger[_0x3d94('0x30')](_0x3d94('0x31'));odbc['query'](_0x1c1b25,function(_0x6b2b1f,_0x21afb5){if(_0x6b2b1f){logger[_0x3d94('0x30')](_0x3d94('0x32'),_0x1c1b25);_0x438ba3(_0x6b2b1f);}else{logger['info'](_0x3d94('0x33'),_0x1c1b25);odbc[_0x3d94('0x34')](function(_0x35e0e6){if(_0x35e0e6){logger[_0x3d94('0x2e')](_0x3d94('0x35'),_0x35e0e6);}_0x438ba3(null,_0x21afb5);});}});}});};AGIVertices['prototype'][_0x3d94('0x36')]=function(_0x462ab6,_0x1d3d41){this['rpc']['getSmsAccountById'](_0x462ab6)['then'](function(_0x47905e){_0x1d3d41(null,_0x47905e?_0x47905e:![]);})[_0x3d94('0x16')](function(_0x22f52c){_0x1d3d41(_0x22f52c);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x37')]=function(_0x1a2348,_0x24a522){this[_0x3d94('0xf')]['createSmsMessage'](_0x1a2348)['then'](function(_0x118fda){_0x24a522(null,_0x118fda);})[_0x3d94('0x16')](function(_0x512cef){_0x24a522(_0x512cef);});};AGIVertices[_0x3d94('0x13')]['createSquareDetailsReport']=function(_0x1361fb,_0x411b5b,_0x3c9ebc){this[_0x3d94('0xf')][_0x3d94('0x38')]({'uniqueid':this['channel'][_0x3d94('0x39')],'node':_0x1361fb[_0x3d94('0x3a')],'application':_0x1361fb[_0x3d94('0x3b')],'data':_0x411b5b||null,'project_name':this['channel'][_0x3d94('0x3c')],'callerid':this['channel']['callerid']})[_0x3d94('0x11')](function(_0x402132){if(_0x3c9ebc){_0x3c9ebc(null,_0x402132);}})[_0x3d94('0x16')](function(_0xfeae3a){if(_0x3c9ebc){_0x3c9ebc(_0xfeae3a);}});};AGIVertices['prototype'][_0x3d94('0x3d')]=function(_0x4a4b74,_0x26426e,_0x37c747,_0x35c911){this[_0x3d94('0xf')][_0x3d94('0x3d')]({'uniqueid':this[_0x3d94('0xc')][_0x3d94('0x39')],'callerid':this['channel'][_0x3d94('0x3e')],'calleridname':this[_0x3d94('0xc')]['calleridname'],'context':this['channel'][_0x3d94('0x3f')],'extension':this[_0x3d94('0xc')]['extension'],'priority':this[_0x3d94('0xc')][_0x3d94('0x40')],'accountcode':this[_0x3d94('0xc')][_0x3d94('0x41')],'dnid':this[_0x3d94('0xc')][_0x3d94('0x42')],'projectName':this[_0x3d94('0xc')][_0x3d94('0x3c')],'saveName':_0x26426e,'filename':_0x4a4b74[_0x3d94('0x43')]||_0x26426e,'savePath':_0x37c747})[_0x3d94('0x11')](function(_0x4075ef){_0x35c911(null,_0x4075ef);})[_0x3d94('0x16')](function(_0x2dad4f){_0x35c911(_0x2dad4f);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x44')]=function(_0x49209b,_0x44df82,_0x22e2b8,_0x1a9338,_0x33d36a){this[_0x3d94('0xf')][_0x3d94('0x44')]({'uniqueid':this[_0x3d94('0xc')][_0x3d94('0x39')],'body':_0x49209b,'direction':_0x44df82,'providerName':_0x22e2b8,'providerResponse':_0x1a9338})[_0x3d94('0x11')](function(_0x5465a5){if(_0x33d36a){_0x33d36a(null,_0x5465a5);}})[_0x3d94('0x16')](function(_0x5799df){if(_0x33d36a){_0x33d36a(_0x5799df);}});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x45')]=function(_0x4af4c2,_0x255630){this['rpc']['createCmContact']({'firstName':_[_0x3d94('0x46')](_0x4af4c2['name'])||_[_0x3d94('0x47')](_0x4af4c2[_0x3d94('0x12')])?'callback_'+Math[_0x3d94('0x48')]():_0x4af4c2['name'],'lastName':_['isEmpty'](_0x4af4c2[_0x3d94('0x49')])||_[_0x3d94('0x47')](_0x4af4c2[_0x3d94('0x49')])?null:_0x4af4c2[_0x3d94('0x49')],'phone':_0x4af4c2[_0x3d94('0x4a')],'ListId':_0x4af4c2[_0x3d94('0x4b')],'scheduledat':_0x4af4c2[_0x3d94('0x4c')],'callbackUniqueid':this[_0x3d94('0xc')][_0x3d94('0x39')],'tags':'callback','description':_0x3d94('0x4d')+_0x4af4c2[_0x3d94('0x4c')][_0x3d94('0x4e')](),'priority':_0x4af4c2[_0x3d94('0x4f')]})[_0x3d94('0x11')](function(_0x3e1992){_0x255630(null,_0x3e1992);})[_0x3d94('0x16')](function(_0x126894){_0x255630(_0x126894);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x50')]=function(_0x1fd806,_0x5eba38){this[_0x3d94('0xf')]['getPauseById'](_0x1fd806)[_0x3d94('0x11')](function(_0x3a30f7){_0x5eba38(null,_0x3a30f7?_0x3a30f7[_0x3d94('0x12')]:![]);})[_0x3d94('0x16')](function(_0x3a837b){_0x5eba38(_0x3a837b);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x51')]=function(_0x169aa1,_0x9d9ad9,_0x5da38c){var _0x519ada={'role':_0x3d94('0x52')};_0x519ada[_0x169aa1]=this['channel'][_0x3d94('0x3e')];this[_0x3d94('0xf')]['agentPause'](_0x519ada,_0x9d9ad9,this[_0x3d94('0xc')][_0x3d94('0x39')])[_0x3d94('0x11')](function(_0x467648){_0x5da38c(null,_[_0x3d94('0x47')](_0x467648)?![]:!![]);})[_0x3d94('0x16')](function(_0xd3bb){logger['error'](_0xd3bb);_0x5da38c(null,![]);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x53')]=function(_0x368581,_0x4b23b5){var _0x2d8b49={'role':_0x3d94('0x52')};_0x2d8b49[_0x368581]=this[_0x3d94('0xc')][_0x3d94('0x3e')];this['rpc']['agentUnpause'](_0x2d8b49)[_0x3d94('0x11')](function(_0x38b2fa){_0x4b23b5(null,_[_0x3d94('0x47')](_0x38b2fa)?![]:!![]);})[_0x3d94('0x16')](function(_0x4f9e83){logger[_0x3d94('0x2e')](_0x4f9e83);_0x4b23b5(null,![]);});};AGIVertices[_0x3d94('0x13')]['agentLogout']=function(_0x5ba865,_0x250c87){var _0x336e36={'role':'agent'};_0x336e36[_0x5ba865]=this[_0x3d94('0xc')][_0x3d94('0x3e')];this[_0x3d94('0xf')]['agentLogout'](_0x336e36)[_0x3d94('0x11')](function(_0x68c033){_0x250c87(null,_['isNil'](_0x68c033)?![]:!![]);})['catch'](function(_0x4e1932){logger[_0x3d94('0x2e')](_0x4e1932);_0x250c87(null,![]);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x54')]=function(_0x37a2e1,_0x196ed6){var _0x4ecfa2={'role':_0x3d94('0x52')};_0x4ecfa2[_0x37a2e1]=this[_0x3d94('0xc')][_0x3d94('0x3e')];var _0x1e8e3d=_0x37a2e1!=_0x3d94('0x55')?util[_0x3d94('0x2b')]('%s/%s@from-sip/n',_0x3d94('0x56'),this['channel'][_0x3d94('0x3e')]):undefined;this[_0x3d94('0xf')][_0x3d94('0x54')](_0x4ecfa2,_0x1e8e3d)[_0x3d94('0x11')](function(_0x128fdc){_0x196ed6(null,_[_0x3d94('0x47')](_0x128fdc)?![]:!![]);})['catch'](function(_0x4dc5aa){logger[_0x3d94('0x2e')](_0x4dc5aa);_0x196ed6(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x5c5fb2,_0x3c7dc4){sh[_0x3d94('0x57')](_[_0x3d94('0x58')](_0x5c5fb2),function(_0x396146,_0xb20f94){var _0x2e2fb0=_0xb20f94[_0x3d94('0x59')](/(\r\n|\n|\r)/gm,'');_0x3c7dc4(null,_0x2e2fb0);});};AGIVertices[_0x3d94('0x13')]['googleCloudTTS']=function(_0x22917e,_0x5e55a4){scripts[_0x3d94('0x5a')](_0x22917e[_0x3d94('0x5b')],_0x22917e[_0x3d94('0x5c')]||'text',_0x22917e['text'],_0x22917e['languageCode']||_0x3d94('0x5d'),_0x22917e[_0x3d94('0x5e')]||_0x3d94('0x5f'),_0x22917e[_0x3d94('0x60')]||_0x3d94('0x61'))['then'](function(_0x5b7316){_0x5e55a4(null,_0x5b7316);})[_0x3d94('0x16')](function(_0x404d36){_0x5e55a4(_0x404d36);});};AGIVertices[_0x3d94('0x13')]['googleTTS']=function(_0x46a9af,_0x53d471){scripts[_0x3d94('0x62')](_0x46a9af[_0x3d94('0x63')],_0x46a9af[_0x3d94('0x64')]||'en',0x1)[_0x3d94('0x11')](function(_0x3b42c8){_0x53d471(null,_0x3b42c8);})[_0x3d94('0x16')](function(_0x234bce){_0x53d471(_0x234bce);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x65')]=function(_0xf0d4eb,_0x3dbf5c){var _0xe6cfd1={'uri':_0xf0d4eb[_0x3d94('0x66')],'method':_0xf0d4eb['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xf0d4eb[_0x3d94('0x67')])===_0x3d94('0x68')&&parseInt(_0xf0d4eb[_0x3d94('0x67')])>=0x1?parseInt(_0xf0d4eb[_0x3d94('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x3d94('0x69'),'PUT'],_0xe6cfd1['method'][_0x3d94('0x6a')]())){try{_0xe6cfd1['body']=_0xf0d4eb[_0x3d94('0x6b')]?JSON[_0x3d94('0x6c')](_0xf0d4eb['rawBody']):{};}catch(_0x4558ff){logger['error'](_0x3d94('0x6d'),_0x4558ff);}}try{_0xe6cfd1[_0x3d94('0x6e')]=_0xf0d4eb['rawHeaders']?JSON['parse'](_0xf0d4eb['rawHeaders']):{};}catch(_0x833d96){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x833d96);}if(_0xf0d4eb[_0x3d94('0x6f')]){try{var _0x39ea2a=require(_0xf0d4eb[_0x3d94('0x6f')])[_0x3d94('0x70')](this,_0xe6cfd1);_0xe6cfd1['uri']=Mustache[_0x3d94('0x71')](_0xf0d4eb[_0x3d94('0x66')],_0x39ea2a,{},['$$','$$']);if(_0xe6cfd1[_0x3d94('0x6e')]){_0xe6cfd1[_0x3d94('0x6e')]=JSON[_0x3d94('0x6c')](Mustache[_0x3d94('0x71')](JSON['stringify'](_0xe6cfd1[_0x3d94('0x6e')]),_0x39ea2a,{},['$$','$$']));}if(_0xe6cfd1[_0x3d94('0x72')]){_0xe6cfd1[_0x3d94('0x72')]=JSON[_0x3d94('0x6c')](Mustache[_0x3d94('0x71')](JSON[_0x3d94('0x73')](_0xe6cfd1[_0x3d94('0x72')]),_0x39ea2a,{},['$$','$$']));}}catch(_0x42d2c0){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x42d2c0);}}rp(_0xe6cfd1)[_0x3d94('0x11')](function(_0x23b1a6){var _0x970b44={'statusCode':_0x23b1a6['statusCode']||0xc8,'statusMessage':_0x23b1a6[_0x3d94('0x74')]||'OK','headers':_0x23b1a6[_0x3d94('0x6e')]||{},'body':_0x23b1a6[_0x3d94('0x72')]||{}};_0x3dbf5c(null,_0x970b44);})[_0x3d94('0x16')](function(_0x860ee5){var _0x492b12={'statusCode':_0x860ee5['statusCode']||0x1f4,'statusMessage':_0x860ee5[_0x3d94('0x75')]||_0x3d94('0x76'),'headers':_0x860ee5[_0x3d94('0x77')][_0x3d94('0x6e')]||{},'body':_0x860ee5[_0x3d94('0x77')][_0x3d94('0x72')]||{}};_0x3dbf5c(null,_0x492b12);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x78')]=function(_0x462e88,_0x35caf5){scripts[_0x3d94('0x78')](this[_0x3d94('0xc')][_0x3d94('0x39')],_0x462e88['key'],_0x462e88[_0x3d94('0x63')],_0x462e88[_0x3d94('0x79')]||'en')['then'](function(_0x5d3d6e){_0x35caf5(null,_0x5d3d6e);})[_0x3d94('0x16')](function(_0xf935c7){_0x35caf5(_0xf935c7);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x7a')]=function(_0x4f323c,_0x482e99){scripts[_0x3d94('0x7a')](this[_0x3d94('0xc')][_0x3d94('0x39')],_0x4f323c[_0x3d94('0x7b')],_0x4f323c[_0x3d94('0x7c')],_0x4f323c['private_key'],_0x4f323c[_0x3d94('0x63')],_0x4f323c['dialogflowV2_language']||'en')[_0x3d94('0x11')](function(_0xe87d17){_0x482e99(null,_0xe87d17);})[_0x3d94('0x16')](function(_0x4fef1d){_0x482e99(_0x4fef1d);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x7d')]=function(_0x5e6ca4,_0x205b9d){scripts['sestekNDA'](this[_0x3d94('0xc')],_0x5e6ca4)[_0x3d94('0x11')](function(_0x2de60e){_0x205b9d(null,_0x2de60e);})['catch'](function(_0x35b2e2){_0x205b9d(_0x35b2e2);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x7e')]=function(_0x53a92d,_0x3e091a){scripts[_0x3d94('0x7e')](_0x53a92d[_0x3d94('0x7f')],_0x53a92d[_0x3d94('0x63')],_0x53a92d[_0x3d94('0x80')]||_0x3d94('0x5d'),_0x53a92d[_0x3d94('0x81')])[_0x3d94('0x11')](function(_0x577890){_0x3e091a(null,_0x577890);})[_0x3d94('0x16')](function(_0x2b8f09){_0x3e091a(_0x2b8f09);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x82')]=function(_0x32357b,_0x186d45,_0x5716fd){scripts[_0x3d94('0x82')](_0x186d45,_0x32357b[_0x3d94('0x7f')],_0x32357b[_0x3d94('0x83')]||'en-US',this[_0x3d94('0x84')](_0x32357b['model'])?_0x32357b[_0x3d94('0x85')]:undefined)[_0x3d94('0x11')](function(_0x490d77){_0x5716fd(null,_0x490d77);})[_0x3d94('0x16')](function(_0x33f215){_0x5716fd(_0x33f215);});};AGIVertices['prototype']['awsPolly']=function(_0x10613f,_0x36e87c){scripts['awsPolly'](_0x10613f['aws_access_key_id'],_0x10613f['aws_secret_access_key'],_0x10613f[_0x3d94('0x86')],_0x10613f[_0x3d94('0x87')]||_0x3d94('0x88'),_0x10613f[_0x3d94('0x63')],_0x10613f[_0x3d94('0x89')]||'text')[_0x3d94('0x11')](function(_0xfacdff){_0x36e87c(null,_0xfacdff);})[_0x3d94('0x16')](function(_0x491220){_0x36e87c(_0x491220);});};AGIVertices[_0x3d94('0x13')]['awsLex']=function(_0x149895,_0x26f8a1){scripts[_0x3d94('0x8a')](this[_0x3d94('0xc')][_0x3d94('0x39')],_0x149895['aws_access_key_id'],_0x149895['aws_secret_access_key'],_0x149895[_0x3d94('0x8b')],_0x149895[_0x3d94('0x63')],_0x149895['aws_bot_name'])[_0x3d94('0x11')](function(_0x5cc4d9){_0x26f8a1(null,_0x5cc4d9);})[_0x3d94('0x16')](function(_0x237911){_0x26f8a1(_0x237911);});};AGIVertices[_0x3d94('0x13')]['googleASR']=function(_0x406528,_0x5ed9e7,_0xa4055e){scripts[_0x3d94('0x8c')](_0x5ed9e7,_0x406528[_0x3d94('0x7f')],_0x406528[_0x3d94('0x8d')]||'en-US')['then'](function(_0x11ff83){_0xa4055e(null,_0x11ff83);})[_0x3d94('0x16')](function(_0x1c2092){_0xa4055e(_0x1c2092);});};AGIVertices[_0x3d94('0x13')]['tildeASR']=function(_0x4113bf,_0x493d38,_0x49c674){scripts['tildeASR'](_0x493d38,_0x4113bf[_0x3d94('0x8e')],_0x4113bf[_0x3d94('0x8f')],_0x4113bf[_0x3d94('0x90')])[_0x3d94('0x11')](function(_0x5bd2ab){_0x49c674(null,_0x5bd2ab);})[_0x3d94('0x16')](function(_0x33af12){_0x49c674(_0x33af12);});};AGIVertices[_0x3d94('0x13')][_0x3d94('0x91')]=function(_0x34f7d2){var _0x213f3e=_[_0x3d94('0x92')](verticesWithRetry,_0x34f7d2[_0x3d94('0x3b')])?_0x34f7d2:_[_0x3d94('0x93')](_0x34f7d2);for(var _0x140ad1 in _0x213f3e){if(_0x213f3e['hasOwnProperty'](_0x140ad1)){if(_0x213f3e[_0x140ad1]&&_['isString'](_0x213f3e[_0x140ad1])){if(_[_0x3d94('0x92')](recursiveMapAttributes,_0x140ad1)){_0x213f3e[_0x140ad1]=this[_0x3d94('0x94')](_0x213f3e[_0x140ad1]);}else{_0x213f3e[_0x140ad1]=this[_0x3d94('0x95')](_0x213f3e[_0x140ad1]);}}}}return _0x213f3e;};AGIVertices[_0x3d94('0x13')][_0x3d94('0x96')]=function(_0x293e1c){for(var _0x2d3c1a in _0x293e1c){if(_0x293e1c['hasOwnProperty'](_0x2d3c1a)){if(_[_0x3d94('0x97')](_0x293e1c[_0x2d3c1a])){this[_0x3d94('0x96')](_0x293e1c[_0x2d3c1a]);}else if(_[_0x3d94('0x98')](_0x293e1c[_0x2d3c1a])){for(var _0x27c1e1=0x0;_0x27c1e1<_0x293e1c[_0x2d3c1a][_0x3d94('0x99')];_0x27c1e1++){this[_0x3d94('0x96')](_0x293e1c[_0x2d3c1a][_0x27c1e1]);}}else if(_['isString'](_0x293e1c[_0x2d3c1a])){_0x293e1c[_0x2d3c1a]=this['replaceAllVariables'](_0x293e1c[_0x2d3c1a]);}}}};AGIVertices[_0x3d94('0x13')]['saveRestApiResult']=function(_0x248fbe,_0x44fc5e){for(var _0x350751 in _0x248fbe){if(_0x248fbe[_0x3d94('0x9a')](_0x350751)){if(_[_0x3d94('0x97')](_0x248fbe[_0x350751])){if(!_[_0x3d94('0x46')](_0x248fbe[_0x350751])){this[_0x3d94('0x9b')](_0x248fbe[_0x350751],util[_0x3d94('0x2b')]('%s.%s',_0x44fc5e,_0x350751));}}else if(_[_0x3d94('0x98')](_0x248fbe[_0x350751])){for(var _0x2c8a2f=0x0;_0x2c8a2f<_0x248fbe[_0x350751][_0x3d94('0x99')];_0x2c8a2f++){this[_0x3d94('0x9b')](_0x248fbe[_0x350751][_0x2c8a2f],util[_0x3d94('0x2b')](_0x3d94('0x9c'),_0x44fc5e,_0x350751+'['+_0x2c8a2f+']'));}}else{if(!_[_0x3d94('0x47')](_0x248fbe[_0x350751])){this[_0x3d94('0xc')][_0x3d94('0x9d')](util[_0x3d94('0x2b')](_0x3d94('0x9c'),_0x44fc5e,_0x350751),_0x248fbe[_0x350751]);}}}}};AGIVertices[_0x3d94('0x13')][_0x3d94('0x94')]=function(_0x40b09b){try{var _0x2d02db=JSON[_0x3d94('0x6c')](_0x40b09b);this[_0x3d94('0x96')](_0x2d02db);return JSON[_0x3d94('0x73')](_0x2d02db);}catch(_0x2513da){return this[_0x3d94('0x95')](_0x40b09b);}};AGIVertices[_0x3d94('0x13')]['replaceAllVariables']=function(_0x464960){var _0x35040e=_0x464960[_0x3d94('0x9e')]('{');for(var _0x2fa27d=0x1;_0x2fa27d<_0x35040e[_0x3d94('0x99')];_0x2fa27d+=0x1){var _0x185592=_0x35040e[_0x2fa27d]['split']('}');if(_0x185592[_0x3d94('0x99')]>0x1){_0x464960=_0x464960[_0x3d94('0x9f')]('{'+_0x185592[0x0]+'}',this[_0x3d94('0xc')][_0x3d94('0xe')](_0x185592[0x0])[_0x3d94('0xa0')]||_0x185592[0x0]);}}if(_0x35040e[_0x3d94('0x99')]===0x1){return _0x464960['toString']();}return this[_0x3d94('0x95')](_0x464960);};AGIVertices[_0x3d94('0x13')]['getAndSetVariable']=function(_0x4c1906,_0x4a1faa){var _0x3e1139=this[_0x3d94('0xc')][_0x3d94('0xe')](_0x4c1906);if(_0x3e1139[_0x3d94('0xa1')]===-0x1){return _0x3e1139;}logger[_0x3d94('0x30')](util['format'](_0x3d94('0xa2'),_0x4a1faa,_0x3e1139[_0x3d94('0xa0')]));return this[_0x3d94('0xc')][_0x3d94('0x9d')](_0x4a1faa,_0x3e1139[_0x3d94('0xa0')]);};AGIVertices[_0x3d94('0x13')]['isConfigured']=function(_0x167d4c){return _0x167d4c&&_0x167d4c!=='0'&&_0x167d4c!=='-1'&&_0x167d4c!=='';};AGIVertices['prototype'][_0x3d94('0xa3')]=function(_0xb970e1){this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0xb970e1,'-');_0xb970e1['retry']=_0xb970e1[_0x3d94('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3d94('0x13')][_0x3d94('0xa4')]=function(_0x3bf421){logger['info'](util['format'](_0x3d94('0xa5'),_0x3bf421[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x3bf421['text'])){return this[_0x3d94('0xc')]['noop']('no\x20text\x20configured');}var _0x560fdf='\x22'+_0x3bf421[_0x3d94('0x63')]+'\x22';if(this['isConfigured'](_0x3bf421[_0x3d94('0x77')])){_0x560fdf+=','+_0x3bf421[_0x3d94('0x77')];}var _0x1ad1b0=this['channel'][_0x3d94('0x57')](_0x3d94('0xa6'),_0x560fdf);if(_0x1ad1b0['result']===-0x1){return _0x1ad1b0;}return this['channel'][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xa8'),_0x560fdf));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xa9')]=function(_0x38eba7){logger['info'](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x38eba7['label']));if(!this[_0x3d94('0x84')](_0x38eba7[_0x3d94('0xaa')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xab'));}var _0x370e9f=_0x38eba7[_0x3d94('0xaa')];if(this[_0x3d94('0x84')](_0x38eba7[_0x3d94('0x77')])){_0x370e9f+=','+_0x38eba7[_0x3d94('0x77')];}var _0x5e9c90=this['channel'][_0x3d94('0x57')]('MRCPRecog',_0x370e9f);if(_0x5e9c90[_0x3d94('0xa1')]===-0x1){return _0x5e9c90;}var _0x149fab=this[_0x3d94('0xac')](_0x3d94('0xad'),_0x3d94('0xae'));if(_0x149fab[_0x3d94('0xa1')]===-0x1){return _0x149fab;}var _0x37fc9a=this[_0x3d94('0xac')]('RECOG_INPUT()',_0x3d94('0xaf'));if(_0x37fc9a[_0x3d94('0xa1')]===-0x1){return _0x37fc9a;}var _0x32b72d=this[_0x3d94('0xac')](_0x3d94('0xb0'),_0x3d94('0xb1'));if(_0x32b72d[_0x3d94('0xa1')]===-0x1){return _0x32b72d;}return this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')](_0x3d94('0xb2'),_0x370e9f));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x8')]=function(_0x3b6df7){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xb3'),_0x3b6df7['label']));return this[_0x3d94('0xc')][_0x3d94('0x8')]([_0x3b6df7['command'],_0x3b6df7[_0x3d94('0xb4')]]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0xb5')]=function(_0xaedee0){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xb6'),_0xaedee0[_0x3d94('0x3a')]));if(this[_0x3d94('0x84')](_0xaedee0[_0x3d94('0x67')])){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xb7'),_0xaedee0[_0x3d94('0x67')]));var _0x186c79=this[_0x3d94('0xc')][_0x3d94('0xb8')](_0xaedee0[_0x3d94('0x67')]);if(_0x186c79[_0x3d94('0xa1')]===-0x1){return _0x186c79;}}return this[_0x3d94('0xc')][_0x3d94('0xb5')]();};AGIVertices[_0x3d94('0x13')][_0x3d94('0xb9')]=function(_0xba6a5b){logger[_0x3d94('0x30')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xba6a5b[_0x3d94('0x3a')]));if(!this['isConfigured'](_0xba6a5b['list_id'])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0xba6a5b,_0x3d94('0xba'));}_0xba6a5b[_0x3d94('0x4c')]=moment();if(this[_0x3d94('0x84')](_0xba6a5b['delay'])){_0xba6a5b[_0x3d94('0x4c')]=moment()['add'](_0xba6a5b[_0x3d94('0xbb')],_0x3d94('0xbc'));}if(!this[_0x3d94('0x84')](_0xba6a5b[_0x3d94('0x4f')])){_0xba6a5b[_0x3d94('0x4f')]=0x2;}this[_0x3d94('0x45')][_0x3d94('0x70')](this,_0xba6a5b);return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xbd'),_0xba6a5b[_0x3d94('0x4a')],_0xba6a5b[_0x3d94('0x4b')],_0xba6a5b[_0x3d94('0x4c')]));};AGIVertices[_0x3d94('0x13')]['custom_app']=function(_0x594e4f){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0xbe'),_0x594e4f['label']));var _0x2105c2=this[_0x3d94('0xc')]['exec'](_0x594e4f[_0x3d94('0xbf')],_0x594e4f[_0x3d94('0x77')]);if(_0x2105c2[_0x3d94('0xa1')]===-0x1){return _0x2105c2;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0xc0'),_0x594e4f[_0x3d94('0xbf')],_0x594e4f[_0x3d94('0x77')]));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xc1')]=function(_0x3bac7c){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xc2'),_0x3bac7c['label']));if(!this[_0x3d94('0x84')](_0x3bac7c[_0x3d94('0x63')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xc3'));}var _0x359d07='\x22'+_0x3bac7c['text']+'\x22';if(this['isConfigured'](_0x3bac7c[_0x3d94('0x77')])){_0x359d07+=','+_0x3bac7c[_0x3d94('0x77')];}var _0x50a9aa=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0xa6'),_0x359d07);if(_0x50a9aa[_0x3d94('0xa1')]===-0x1){return _0x50a9aa;}return this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x359d07));};AGIVertices[_0x3d94('0x13')]['sestektts']=function(_0x4e513d){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xc4'),_0x4e513d[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x4e513d['text'])){return this[_0x3d94('0xc')]['noop']('no\x20text\x20configured');}var _0x4a611c='\x22'+_0x4e513d[_0x3d94('0x63')]+'\x22';if(this['isConfigured'](_0x4e513d[_0x3d94('0x77')])){_0x4a611c+=','+_0x4e513d[_0x3d94('0x77')];}var _0x1041f0=this[_0x3d94('0xc')][_0x3d94('0x57')]('MRCPSynth',_0x4a611c);if(_0x1041f0[_0x3d94('0xa1')]===-0x1){return _0x1041f0;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xa8'),_0x4a611c));};AGIVertices[_0x3d94('0x13')]['lumenvoxasr']=function(_0x259571){logger['info'](util['format'](_0x3d94('0xc5'),_0x259571['label']));if(!this[_0x3d94('0x84')](_0x259571[_0x3d94('0xaa')])){return this[_0x3d94('0xc')]['noop']('no\x20grammar\x20configured');}var _0x377e2c=_0x259571['grammar'];if(this[_0x3d94('0x84')](_0x259571[_0x3d94('0x77')])){_0x377e2c+=','+_0x259571['options'];}var _0xedca04=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0xc6'),_0x377e2c);if(_0xedca04[_0x3d94('0xa1')]===-0x1){return _0xedca04;}var _0xd66e02=this[_0x3d94('0xac')](_0x3d94('0xad'),_0x3d94('0xc7'));if(_0xd66e02[_0x3d94('0xa1')]===-0x1){return _0xd66e02;}var _0x2d0c19=this[_0x3d94('0xac')](_0x3d94('0xc8'),_0x3d94('0xc9'));if(_0x2d0c19[_0x3d94('0xa1')]===-0x1){return _0x2d0c19;}var _0xfeeaf1=this[_0x3d94('0xac')]('RECOG_INSTANCE()',_0x3d94('0xca'));if(_0xfeeaf1[_0x3d94('0xa1')]===-0x1){return _0xfeeaf1;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xb2'),_0x377e2c));};AGIVertices[_0x3d94('0x13')]['sestekasr']=function(_0x4db175){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0xcb'),_0x4db175['label']));if(!this['isConfigured'](_0x4db175[_0x3d94('0xaa')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xab'));}var _0x49dfd3=_0x4db175['grammar'];if(this['isConfigured'](_0x4db175[_0x3d94('0x77')])){_0x49dfd3+=','+_0x4db175['options'];}var _0x4fe456=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0xc6'),_0x49dfd3);if(_0x4fe456[_0x3d94('0xa1')]===-0x1){return _0x4fe456;}var _0x348a17=this[_0x3d94('0xac')](_0x3d94('0xad'),'SESTEK_ASR_CONFIDENCE');if(_0x348a17['result']===-0x1){return _0x348a17;}var _0x223de4=this[_0x3d94('0xac')](_0x3d94('0xc8'),_0x3d94('0xcc'));if(_0x223de4[_0x3d94('0xa1')]===-0x1){return _0x223de4;}var _0x2607f3=this[_0x3d94('0xac')]('RECOG_INSTANCE()',_0x3d94('0xcd'));if(_0x2607f3['result']===-0x1){return _0x2607f3;}return this['channel']['noop'](util[_0x3d94('0x2b')](_0x3d94('0xb2'),_0x49dfd3));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xce')]=function(_0x5973f8){logger[_0x3d94('0x30')](util['format'](_0x3d94('0xcf'),_0x5973f8[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x5973f8['odbc_id'])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x5973f8,'no\x20database\x20selected');}var _0x4e431a=this[_0x3d94('0xd0')][_0x3d94('0x70')](this,_0x5973f8[_0x3d94('0xd1')]);if(!_0x4e431a){return this[_0x3d94('0xc')]['error'](_0x5973f8,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x5973f8[_0x3d94('0xd2')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x5973f8,_0x3d94('0xd3'));}var _0x1c5345=_0x5973f8[_0x3d94('0xd2')][_0x3d94('0x59')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0x3d94('0x2b')](_0x3d94('0xd4'),_0x1c5345));var _0x23dd3b=this[_0x3d94('0x2c')][_0x3d94('0x70')](this,_0x4e431a,_0x1c5345);this['createSquareDetailsReport'][_0x3d94('0x70')](this,_0x5973f8,_0x1c5345);if(!this[_0x3d94('0x84')](_0x5973f8[_0x3d94('0xd5')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xd6'));}var _0x49141f=this[_0x3d94('0xe')][_0x3d94('0x70')](this,_0x5973f8['variable_id']);if(!_0x49141f){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x5973f8,'no\x20variable\x20found');}var _0x1d30b2=this;_0x23dd3b['forEach'](function(_0x46cdae,_0x1e0210){Object[_0x3d94('0xd7')](_0x46cdae)[_0x3d94('0xd8')](function(_0x5e935e){_0x1d30b2[_0x3d94('0xc')][_0x3d94('0x9d')](util['format']('%s[%s][%s]',_0x49141f,_0x1e0210,_0x5e935e),_0x46cdae[_0x5e935e]);});});this['channel'][_0x3d94('0x9d')](util[_0x3d94('0x2b')](_0x3d94('0xd9'),_0x49141f),_0x23dd3b['length']);return this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0xda'),_0x49141f));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xdb')]=function(_0x1c0f57){logger[_0x3d94('0xdc')](util[_0x3d94('0x2b')](_0x3d94('0xdd'),_0x1c0f57[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x1c0f57[_0x3d94('0xde')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x1c0f57,_0x3d94('0xdf'));}var _0x8268b6=this[_0x3d94('0x1b')][_0x3d94('0x70')](this,_0x1c0f57[_0x3d94('0xde')]);if(!_0x8268b6){return this['channel']['error'](_0x1c0f57,_0x3d94('0xe0'));}var _0x38fa3e=this[_0x3d94('0xc')]['exec']('DIAL',[util[_0x3d94('0x2b')](_0x3d94('0xe1'),_0x8268b6),_0x1c0f57[_0x3d94('0x67')],_0x1c0f57['opts'],_0x1c0f57[_0x3d94('0x66')]]);if(_0x38fa3e[_0x3d94('0xa1')]===-0x1){return _0x38fa3e;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0xe2'),_0x3d94('0xe3')));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xe4')]=function(_0x152c40){logger[_0x3d94('0x30')](util['format'](_0x3d94('0xe5'),_0x152c40[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x152c40['key'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xe6'));}if(!this[_0x3d94('0x84')](_0x152c40['text'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20text\x20configured');}this[_0x3d94('0xc')][_0x3d94('0xe7')]=!![];this[_0x3d94('0x38')](_0x152c40);this['createSquareMessage'](_0x152c40[_0x3d94('0x63')],'in','','');this['channel']['noop'](util[_0x3d94('0x2b')](_0x3d94('0xe8'),_0x152c40['text']));var _0x5a8e05=this[_0x3d94('0x78')]['sync'](this,_0x152c40);if(_0x5a8e05){for(var _0x278cbb in _0x5a8e05){if(_0x5a8e05[_0x3d94('0x9a')](_0x278cbb)){this[_0x3d94('0xc')][_0x3d94('0x9d')](util[_0x3d94('0x2b')](_0x3d94('0xe9'),_0x278cbb[_0x3d94('0x6a')]()),_0x5a8e05[_0x278cbb]);}}this[_0x3d94('0x44')](_0x5a8e05[_0x3d94('0xea')],'out',_0x3d94('0xe4'),'');return this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')]('Dialogflow\x20Result\x20%s',_0x5a8e05[_0x3d94('0xea')]));}return this[_0x3d94('0xc')]['error'](_0x152c40,_0x3d94('0xeb'));};AGIVertices['prototype']['dialogflowV2']=function(_0xf8f4e7){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xf8f4e7[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0xf8f4e7[_0x3d94('0x7b')])){return this[_0x3d94('0xc')]['noop'](_0x3d94('0xec'));}if(!this[_0x3d94('0x84')](_0xf8f4e7[_0x3d94('0x7c')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20client_email\x20configured');}if(!this['isConfigured'](_0xf8f4e7['private_key'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xed'));}if(!this['isConfigured'](_0xf8f4e7[_0x3d94('0xee')])){return this[_0x3d94('0xc')]['noop'](_0x3d94('0xef'));}if(!this[_0x3d94('0x84')](_0xf8f4e7[_0x3d94('0x63')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xc3'));}this['channel']['bot']=!![];this[_0x3d94('0x38')](_0xf8f4e7);this[_0x3d94('0x44')](_0xf8f4e7['text'],'in','','');this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xf0'),_0xf8f4e7[_0x3d94('0x63')]));var _0x1b0346=this['googleDialogflowV2'][_0x3d94('0x70')](this,_0xf8f4e7);if(_0x1b0346){for(var _0x3ab157 in _0x1b0346){if(_0x1b0346[_0x3d94('0x9a')](_0x3ab157)){if(_0x3ab157!==_0x3d94('0xf1')){this['channel'][_0x3d94('0x9d')](util[_0x3d94('0x2b')]('DIALOGFLOW_%s',_0x3ab157[_0x3d94('0x6a')]()),_0x1b0346[_0x3ab157]);}}}this[_0x3d94('0x44')](_0x1b0346[_0x3d94('0xea')],_0x3d94('0xf2'),_0x3d94('0xf3'),_0x1b0346[_0x3d94('0xf1')]);return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xf4'),_0x1b0346['speech']));}return this['channel'][_0x3d94('0x2e')](_0xf8f4e7,_0x3d94('0xf5'));};AGIVertices[_0x3d94('0x13')][_0x3d94('0xf6')]=function(_0x5ddb0a){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0xf7'),_0x5ddb0a['label']));if(!this[_0x3d94('0x84')](_0x5ddb0a[_0x3d94('0xf8')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xf9'));}if(!this[_0x3d94('0x84')](_0x5ddb0a[_0x3d94('0xfa')])){return this['channel'][_0x3d94('0xa7')]('no\x20username\x20configured');}if(!this[_0x3d94('0x84')](_0x5ddb0a['password'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20password\x20configured');}if(!this[_0x3d94('0x84')](_0x5ddb0a['ndassistant_url'])){return this[_0x3d94('0xc')]['noop']('no\x20text\x20configured');}this[_0x3d94('0xc')][_0x3d94('0xe7')]=!![];this[_0x3d94('0x38')](_0x5ddb0a);this[_0x3d94('0x44')](_0x5ddb0a[_0x3d94('0x63')],'in','','');this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xfb'),_0x5ddb0a[_0x3d94('0x63')]));var _0x290604=this[_0x3d94('0x7d')]['sync'](this,_0x5ddb0a);if(_0x290604){for(var _0x2c30db in _0x290604){if(_0x290604[_0x3d94('0x9a')](_0x2c30db)){this[_0x3d94('0xc')][_0x3d94('0x9d')](util['format']('SESTEK_NDA_%s',_0x2c30db[_0x3d94('0x6a')]()),_0x290604[_0x2c30db]);}}this[_0x3d94('0x44')](_0x290604[_0x3d94('0xea')],_0x3d94('0xf2'),_0x3d94('0xf6'),'');if(_0x290604['audiofile']){this['channel'][_0x3d94('0xa7')](util['format'](_0x3d94('0xfc'),_0x290604[_0x3d94('0xfd')]));var _0x1bb33f=this[_0x3d94('0xc')][_0x3d94('0xfe')](_0x290604[_0x3d94('0xfd')]);try{fs['unlink'](_0x290604[_0x3d94('0xfd')]+_0x3d94('0xff'));}catch(_0x4aa6e6){logger[_0x3d94('0x2e')](_0x4aa6e6);}return _0x1bb33f;}else{return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('SestekNDA\x20Result\x20%s',_0x290604['speech']));}}return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x5ddb0a,_0x3d94('0x100'));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x101')]=function(_0x1a7a60){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x102'),_0x1a7a60['label']));return this[_0x3d94('0xc')][_0x3d94('0xa7')]('end');};AGIVertices['prototype'][_0x3d94('0x103')]=function(_0x503369){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x104'),_0x503369[_0x3d94('0x3a')]));var _0x3eb0b5='';if(_0x503369[_0x3d94('0x105')]){if(!this['isConfigured'](_0x503369[_0x3d94('0x105')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x503369,_0x3d94('0x106'));}else{var _0x77078d=parseInt(_0x503369[_0x3d94('0x105')],0xa);if(isNaN(_0x77078d)){_0x3eb0b5=_0x503369[_0x3d94('0x105')];}else{_0x3eb0b5=this[_0x3d94('0x1d')][_0x3d94('0x70')](this,_0x503369[_0x3d94('0x105')]);if(!_0x3eb0b5){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x503369,_0x3d94('0x107'));}}}}else if(_0x503369['trunk_name']){_0x3eb0b5=_0x503369[_0x3d94('0x108')];}else{return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x503369,'no\x20trunk\x20selected');}var _0x2ba263=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0xe3'),[util[_0x3d94('0x2b')](_0x3d94('0x109'),_0x3eb0b5,_0x503369[_0x3d94('0x4a')]),_0x503369['timeout'],_0x503369[_0x3d94('0x10a')],_0x503369[_0x3d94('0x66')]]);if(_0x2ba263[_0x3d94('0xa1')]===-0x1){return _0x2ba263;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x10b')]=function(_0x46236d){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x10c'),_0x46236d['label']));return this[_0x3d94('0xc')][_0x3d94('0xa7')]('finally');};AGIVertices['prototype']['getdigits']=function(_0x1da500){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x10d'),_0x1da500['label']));if(_0x1da500[_0x3d94('0x10e')]===0x0){return this[_0x3d94('0xa3')](_0x1da500);}_0x1da500[_0x3d94('0x10e')]-=0x1;if(!this[_0x3d94('0x84')](_0x1da500[_0x3d94('0x10f')])){return this[_0x3d94('0xc')]['error'](_0x1da500,'no\x20file\x20audio\x20selected');}var _0x15e8be=this[_0x3d94('0x1f')][_0x3d94('0x70')](this,_0x1da500[_0x3d94('0x10f')]);if(!_0x15e8be){return this['channel'][_0x3d94('0x2e')](_0x1da500,_0x3d94('0x110'));}if(!this[_0x3d94('0x84')](_0x1da500[_0x3d94('0xd5')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x3d94('0xd6'));}var _0x32aa5c=this['channel'][_0x3d94('0x111')](_0x15e8be,_0x1da500['response'],_0x1da500['maxdigit']);var _0x16f500=_0x32aa5c[_0x3d94('0xa1')]?_0x32aa5c[_0x3d94('0xa1')][_0x3d94('0x4e')]():'';logger[_0x3d94('0x30')](_0x3d94('0x112'),JSON[_0x3d94('0x73')](_0x32aa5c));if(_0x32aa5c[_0x3d94('0xa1')]===-0x1){this['createSquareDetailsReport'][_0x3d94('0x70')](this,_0x1da500,_0x16f500);return _0x32aa5c;}else if(_0x32aa5c['extra']===_0x3d94('0x67')){_0x32aa5c[_0x3d94('0xa1')]=_0x16f500[_0x3d94('0x99')]>=parseInt(_0x1da500[_0x3d94('0x113')])?'x':'i';}else{_0x32aa5c[_0x3d94('0xa1')]=_0x16f500[_0x3d94('0x99')]>=parseInt(_0x1da500['mindigit'])&&_0x16f500[_0x3d94('0x99')]<=parseInt(_0x1da500[_0x3d94('0x114')])?'x':'i';}var _0x5cb7cc=this[_0x3d94('0xe')]['sync'](this,_0x1da500['variable_id']);if(!_0x5cb7cc){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x1da500,_0x3d94('0x115'));}this[_0x3d94('0xc')][_0x3d94('0x9d')](_0x5cb7cc,_0x16f500);if(this['isConfigured'](_0x1da500[_0x3d94('0x116')])){var _0x113efa=parseInt(_0x1da500[_0x3d94('0x116')],0xa);var _0x43e025=rs['generate']({'charset':'*','length':_0x113efa});var _0x20b987=_0x16f500['length'];if(_0x20b987>0x0){if(_0x20b987>_0x113efa){this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x1da500,_0x1da500['hiddendigitspos']===_0x3d94('0x117')?_0x43e025+_0x16f500[_0x3d94('0x118')](_0x113efa):_0x16f500[_0x3d94('0x118')](0x0,_0x20b987-_0x113efa)+_0x43e025);}else{this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x1da500,rs[_0x3d94('0x119')]({'charset':'*','length':_0x20b987}));}}else{this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x1da500,'');}}else{this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x1da500,_0x16f500);}return _0x32aa5c;};AGIVertices['prototype']['getsecretdigits']=function(_0x1b537d){logger['info'](util['format'](_0x3d94('0x11a'),_0x1b537d['label']));return this[_0x3d94('0xb')](_0x1b537d);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x11b')]=function(_0x36c9be){logger[_0x3d94('0x30')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x36c9be[_0x3d94('0x3a')]));this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x36c9be,_0x36c9be['goalname']);return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('GOAL\x20%s',_0x36c9be[_0x3d94('0x11c')]));};AGIVertices[_0x3d94('0x13')]['awspolly']=function(_0xbbf698){logger['info'](util[_0x3d94('0x2b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0xbbf698['label']));if(!this[_0x3d94('0x84')](_0xbbf698['aws_access_key_id'])||!this[_0x3d94('0x84')](_0xbbf698[_0x3d94('0x11d')])){return this[_0x3d94('0xc')]['noop'](_0x3d94('0x11e'));}if(!this[_0x3d94('0x84')](_0xbbf698[_0x3d94('0x63')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xc3'));}this[_0x3d94('0xc')]['noop'](util['format'](_0x3d94('0x11f'),_0xbbf698[_0x3d94('0x63')]));var _0x2476e2=this[_0x3d94('0x120')][_0x3d94('0x70')](this,_0xbbf698);if(_0x2476e2){this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x121'),_0x2476e2));var _0x4d7a86=this[_0x3d94('0xc')][_0x3d94('0xfe')](_0x2476e2);try{fs[_0x3d94('0x122')](_0x2476e2+_0x3d94('0xff'));}catch(_0x46ff19){logger['error'](_0x46ff19);}return _0x4d7a86;}return this[_0x3d94('0xc')]['error'](_0xbbf698,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x3d94('0x123')]=function(_0xc39092){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x124'),_0xc39092[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0xc39092[_0x3d94('0x125')])||!this[_0x3d94('0x84')](_0xc39092[_0x3d94('0x11d')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x11e'));}if(!this[_0x3d94('0x84')](_0xc39092[_0x3d94('0x126')])){return this['channel'][_0x3d94('0xa7')](_0x3d94('0x127'));}if(!this['isConfigured'](_0xc39092['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x3d94('0xc')]['bot']=!![];this[_0x3d94('0x38')](_0xc39092);this[_0x3d94('0x44')](_0xc39092[_0x3d94('0x63')],'in','','');this['channel'][_0x3d94('0xa7')](util['format'](_0x3d94('0x128'),_0xc39092[_0x3d94('0x63')]));var _0x4403a4=this['awsLex']['sync'](this,_0xc39092);if(_0x4403a4){for(var _0x13b389 in _0x4403a4){if(_0x4403a4[_0x3d94('0x9a')](_0x13b389)&&_[_0x3d94('0x129')](_0x4403a4[_0x13b389])){this['channel'][_0x3d94('0x9d')](util[_0x3d94('0x2b')](_0x3d94('0x12a'),_0x13b389['toUpperCase']()),_0x4403a4[_0x13b389]);}}if(_[_0x3d94('0x47')](_0x4403a4[_0x3d94('0x75')])){return this['channel'][_0x3d94('0xa7')](_0x3d94('0x12b'));}else{this[_0x3d94('0x44')](_0x4403a4[_0x3d94('0x75')],'out',_0x3d94('0x12c'),'');return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x12d'),_0x4403a4['message']));}}return this['channel']['error'](_0xc39092,_0x3d94('0x12e'));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x12f')]=function(_0x104291){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x130'),_0x104291['label'],_0x104291['timeout']));if(!this['isConfigured'](_0x104291['key'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20key\x20configured');}var _0x23609d='wav';var _0x4d40fc=util['format'](_0x3d94('0x131'),FILES_PATH,rs['generate'](0x4));var _0x5be191=util[_0x3d94('0x2b')](_0x3d94('0x9c'),_0x4d40fc,_0x23609d);var _0x30762c=!![];if(_0x104291[_0x3d94('0x132')]===_0x3d94('0x133')){_0x30762c=![];}var _0x12daf9=this['channel']['recordFile'](_0x4d40fc,_0x23609d,_0x104291['intKey'],_0x104291['timeout'],undefined,_0x30762c);if(_0x12daf9['result']!==-0x1){this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0x134'),_0x5be191));var _0x1bab26=this['googleASR'][_0x3d94('0x70')](this,_0x104291,_0x5be191);if(_0x1bab26){for(var _0x331977 in _0x1bab26){if(_0x1bab26[_0x3d94('0x9a')](_0x331977)){this[_0x3d94('0xc')][_0x3d94('0x9d')](util['format'](_0x3d94('0x135'),_0x331977[_0x3d94('0x6a')]()),_0x1bab26[_0x331977]);}}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0x136'),JSON[_0x3d94('0x73')](_0x1bab26)));}}return _0x12daf9;};AGIVertices[_0x3d94('0x13')]['tildeasr']=function(_0x50e0a3){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x137'),_0x50e0a3['label']));if(!this[_0x3d94('0x84')](_0x50e0a3[_0x3d94('0x8e')])){return this['channel']['noop'](_0x3d94('0x138'));}if(!this['isConfigured'](_0x50e0a3[_0x3d94('0x8f')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20appsecret\x20configured');}var _0x42af01=_0x3d94('0x139');var _0x3a443d=util[_0x3d94('0x2b')](_0x3d94('0x131'),FILES_PATH,rs[_0x3d94('0x119')](0x4));var _0x4fcefd=util[_0x3d94('0x2b')](_0x3d94('0x9c'),_0x3a443d,_0x42af01);var _0x56e01d=!![];if(_0x50e0a3['beep']===_0x3d94('0x133')){_0x56e01d=![];}var _0x47bfca=this['channel'][_0x3d94('0x13a')](_0x3a443d,_0x42af01,_0x50e0a3['intKey'],_0x50e0a3['timeout'],undefined,_0x56e01d);if(_0x47bfca['result']!==-0x1){this['channel'][_0x3d94('0xa7')](util['format']('tilde\x20%s\x20file\x20created',_0x4fcefd));var _0x1e60c4=this[_0x3d94('0x13b')][_0x3d94('0x70')](this,_0x50e0a3,_0x4fcefd);if(_0x1e60c4){for(var _0xb7f7c5 in _0x1e60c4){if(_0x1e60c4['hasOwnProperty'](_0xb7f7c5)){this['channel']['setVariable'](util[_0x3d94('0x2b')]('TILDE_ASR_%s',_0xb7f7c5[_0x3d94('0x6a')]()),_0x1e60c4[_0xb7f7c5]);}}return this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')](_0x3d94('0x13c'),JSON[_0x3d94('0x73')](_0x1e60c4)));}}return _0x47bfca;};AGIVertices[_0x3d94('0x13')]['gotoc']=function(_0x4e2e06){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4e2e06['label']));return this[_0x3d94('0xc')][_0x3d94('0x13d')](_0x4e2e06[_0x3d94('0x3f')],_0x4e2e06[_0x3d94('0x13e')],_0x4e2e06[_0x3d94('0x40')]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x13f')]=function(_0x254bf6){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x140'),_0x254bf6['label']));if(!this[_0x3d94('0x84')](_0x254bf6[_0x3d94('0x141')])){return this[_0x3d94('0xc')]['error'](_0x254bf6,'no\x20condition\x20configured');}try{var _0x148c61=eval(_0x254bf6[_0x3d94('0x141')])?'true':_0x3d94('0x142');this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')](_0x3d94('0x143'),_0x254bf6[_0x3d94('0x141')],_0x148c61));return{'code':0xc8,'result':_0x148c61};}catch(_0x5b5adb){return{'code':0xc8,'result':_0x3d94('0x142')};}};AGIVertices[_0x3d94('0x13')][_0x3d94('0x144')]=function(_0x39d75f){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x145'),_0x39d75f[_0x3d94('0x3a')]));if(!this['isConfigured'](_0x39d75f[_0x3d94('0x146')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x39d75f,_0x3d94('0x147'));}var _0x386e97=this[_0x3d94('0x25')]['sync'](this,_0x39d75f[_0x3d94('0x146')]);if(!_0x386e97){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x39d75f,'no\x20intervals\x20found');}for(var _0x4bd157=0x0;_0x4bd157<_0x386e97[_0x3d94('0x99')];_0x4bd157+=0x1){var _0x21ee78=this[_0x3d94('0xc')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0x386e97[_0x4bd157]));if(_0x21ee78['result']===-0x1){return _0x21ee78;}logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x148'),_0x386e97[_0x4bd157],_0x21ee78['extra']));if(_0x21ee78[_0x3d94('0xa0')]===_0x3d94('0x149')){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x148'),_0x386e97[_0x4bd157],_0x3d94('0x149')));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x148'),_0x386e97[_0x4bd157],'true'));return{'code':0xc8,'result':_0x3d94('0x149')};}else{logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x148'),_0x386e97[_0x4bd157],_0x3d94('0x142')));this[_0x3d94('0xc')][_0x3d94('0xa7')](util['format'](_0x3d94('0x148'),_0x386e97[_0x4bd157],_0x3d94('0x142')));}}return{'code':0xc8,'result':_0x3d94('0x142')};};AGIVertices[_0x3d94('0x13')][_0x3d94('0x14a')]=function(_0x95c581){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x14b'),_0x95c581[_0x3d94('0x3a')]));return this[_0x3d94('0xc')][_0x3d94('0x14a')]();};AGIVertices[_0x3d94('0x13')][_0x3d94('0x14c')]=function(_0x567196){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x14d'),_0x567196[_0x3d94('0x3a')]));if(!this['isConfigured'](_0x567196[_0x3d94('0x7f')])){return this['channel'][_0x3d94('0xa7')](_0x3d94('0xe6'));}var _0x4f5a22=_0x3d94('0x139');var _0x26431d=util[_0x3d94('0x2b')](_0x3d94('0x131'),FILES_PATH,rs[_0x3d94('0x119')](0x4));var _0x384d22=util[_0x3d94('0x2b')](_0x3d94('0x9c'),_0x26431d,_0x4f5a22);var _0x5a0ca2=!![];if(_0x567196['beep']===_0x3d94('0x133')){_0x5a0ca2=![];}var _0x197e20=this[_0x3d94('0xc')]['recordFile'](_0x26431d,_0x4f5a22,_0x567196[_0x3d94('0x14e')],_0x567196['timeout'],undefined,_0x5a0ca2);if(_0x197e20[_0x3d94('0xa1')]!==-0x1){this['channel']['noop'](util[_0x3d94('0x2b')](_0x3d94('0x14f'),_0x384d22));var _0xb00eb5=this['ispeechASR']['sync'](this,_0x567196,_0x384d22);if(_0xb00eb5){for(var _0x19896b in _0xb00eb5){if(_0xb00eb5[_0x3d94('0x9a')](_0x19896b)){this['channel']['setVariable'](util['format'](_0x3d94('0x150'),_0x19896b[_0x3d94('0x6a')]()),_0xb00eb5[_0x19896b]);}}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0x3d94('0x73')](_0xb00eb5)));}}return _0x197e20;};AGIVertices[_0x3d94('0x13')][_0x3d94('0x151')]=function(_0x1542f8){logger[_0x3d94('0x30')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1542f8['label']));if(!this[_0x3d94('0x84')](_0x1542f8['key'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')]('no\x20key\x20configured');}if(!this[_0x3d94('0x84')](_0x1542f8[_0x3d94('0x63')])){return this[_0x3d94('0xc')]['noop'](_0x3d94('0xc3'));}this['channel'][_0x3d94('0xa7')](util['format'](_0x3d94('0x152'),_0x1542f8[_0x3d94('0x63')]));var _0x11ab49=this['ispeechTTS']['sync'](this,_0x1542f8);if(_0x11ab49){this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x14f'),_0x11ab49));var _0x26d145=this[_0x3d94('0xc')]['streamFile'](_0x11ab49,_0x1542f8[_0x3d94('0x14e')]);try{fs[_0x3d94('0x122')](_0x11ab49+_0x3d94('0xff'));}catch(_0x4bd192){logger[_0x3d94('0x2e')](_0x4bd192);}return _0x26d145;}return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x1542f8,_0x3d94('0x153'));};AGIVertices['prototype'][_0x3d94('0x154')]=function(_0x3d66aa){logger['info'](util['format'](_0x3d94('0x155'),_0x3d66aa[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x3d66aa['findBy'])){return this['channel'][_0x3d94('0x2e')](_0x3d66aa,_0x3d94('0x156'));}logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x157'),this['channel'][_0x3d94('0x3e')],_0x3d66aa[_0x3d94('0x158')]));var _0x5b634f=this[_0x3d94('0x54')][_0x3d94('0x70')](this,_0x3d66aa[_0x3d94('0x158')]);if(_0x5b634f){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x3d66aa[_0x3d94('0x158')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x3d66aa[_0x3d94('0x158')]));return{'code':0xc8,'result':_0x3d94('0x15a')};}else{logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x3d66aa[_0x3d94('0x158')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this[_0x3d94('0xc')]['callerid'],_0x3d66aa[_0x3d94('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x3d94('0x13')]['logout']=function(_0x36bf50){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x36bf50[_0x3d94('0x3a')]));if(!this['isConfigured'](_0x36bf50['findBy'])){return this['channel'][_0x3d94('0x2e')](_0x36bf50,_0x3d94('0x156'));}logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x157'),this[_0x3d94('0xc')]['callerid'],_0x36bf50[_0x3d94('0x158')]));var _0x189f05=this[_0x3d94('0x15c')][_0x3d94('0x70')](this,_0x36bf50[_0x3d94('0x158')]);if(_0x189f05){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this['channel']['callerid'],_0x36bf50[_0x3d94('0x158')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x36bf50['findBy']));return{'code':0xc8,'result':_0x3d94('0x15a')};}else{logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this['channel'][_0x3d94('0x3e')],_0x36bf50['findBy']));this['channel'][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x36bf50[_0x3d94('0x158')]));return{'code':0xc8,'result':_0x3d94('0x15d')};}};AGIVertices[_0x3d94('0x13')][_0x3d94('0x15e')]=function(_0x13445d){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x15f'),_0x13445d['label']));if(!this['isConfigured'](_0x13445d[_0x3d94('0x160')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x13445d,_0x3d94('0x161'));}this['channel'][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x162'),_0x13445d[_0x3d94('0x160')]));var _0x20f7cc=eval(_0x13445d[_0x3d94('0x160')]);if(!this[_0x3d94('0x84')](_0x13445d[_0x3d94('0xd5')])){return this['channel']['noop'](_0x3d94('0xd6'));}var _0x503cca=this[_0x3d94('0xe')][_0x3d94('0x70')](this,_0x13445d['variable_id']);if(!_0x503cca){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x13445d,_0x3d94('0x115'));}if(_['isArray'](_0x20f7cc)){var _0x1e01bc=this;_0x20f7cc[_0x3d94('0xd8')](function(_0x52e1fe,_0x25417c){_0x1e01bc[_0x3d94('0xc')][_0x3d94('0x9d')](util['format'](_0x3d94('0x163'),_0x503cca,_0x25417c),_0x52e1fe);});return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('variable\x20%s[key]\x20set',_0x503cca));}else{return this[_0x3d94('0xc')]['setVariable'](_0x503cca,_0x20f7cc);}};AGIVertices['prototype'][_0x3d94('0xa')]=function(_0x329ab4){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x164'),_0x329ab4[_0x3d94('0x3a')]));if(_0x329ab4[_0x3d94('0x10e')]===0x0){return this[_0x3d94('0xa3')](_0x329ab4);}_0x329ab4['retry']-=0x1;if(!this[_0x3d94('0x84')](_0x329ab4[_0x3d94('0x10f')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x329ab4,_0x3d94('0x165'));}var _0x3f04fc=this['getSound']['sync'](this,_0x329ab4[_0x3d94('0x10f')]);if(!_0x3f04fc){return this[_0x3d94('0xc')]['error'](_0x329ab4,'no\x20file\x20audio\x20found');}var _0x7ac1c0=this['channel'][_0x3d94('0x111')](_0x3f04fc,_0x329ab4[_0x3d94('0x166')],_0x329ab4['digit']);var _0xf12e07=_0x7ac1c0[_0x3d94('0xa1')];if(_0x7ac1c0['result']===-0x1){this['createSquareDetailsReport'][_0x3d94('0x70')](this,_0x329ab4,'-1');return _0x7ac1c0;}else if(_0x7ac1c0[_0x3d94('0xa0')]==='timeout'){_0x7ac1c0[_0x3d94('0xa1')]=_0x7ac1c0[_0x3d94('0xa1')][_0x3d94('0x99')]>0x0?_0x7ac1c0['result']:'t';}else if(_[_0x3d94('0x46')](_0x7ac1c0[_0x3d94('0xa1')])){_0x7ac1c0[_0x3d94('0xa1')]='#';_0xf12e07='#';}if(!this[_0x3d94('0x84')](_0x329ab4[_0x3d94('0xd5')])){this[_0x3d94('0xc')]['noop'](_0x3d94('0xd6'));}else{var _0xef3289=this[_0x3d94('0xe')]['sync'](this,_0x329ab4[_0x3d94('0xd5')]);if(!_0xef3289){return this['channel'][_0x3d94('0x2e')](_0x329ab4,'no\x20variable\x20found');}this[_0x3d94('0xc')]['setVariable'](_0xef3289,_0xf12e07);}this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x329ab4,_0xf12e07);return _0x7ac1c0;};AGIVertices[_0x3d94('0x13')][_0x3d94('0xa7')]=function(_0x3d7383){logger[_0x3d94('0x30')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3d7383[_0x3d94('0x3a')]));return this['channel'][_0x3d94('0xa7')](_0x3d7383[_0x3d94('0x167')]||_0x3d7383[_0x3d94('0x3a')]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x168')]=function(_0xa578b){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x169'),_0xa578b[_0x3d94('0x3a')]));if(!this['isConfigured'](_0xa578b[_0x3d94('0x158')])){return this['channel'][_0x3d94('0x2e')](_0xa578b,_0x3d94('0x156'));}logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x157'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0xa578b[_0x3d94('0x158')]));var _0x4bad72=this[_0x3d94('0x50')]['sync'](this,_0xa578b[_0x3d94('0x16a')]);var _0x1b69c2=this[_0x3d94('0x51')][_0x3d94('0x70')](this,_0xa578b['findBy'],_0x4bad72);if(_0x1b69c2){logger['info'](util['format'](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0xa578b[_0x3d94('0x158')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this['channel'][_0x3d94('0x3e')],_0xa578b[_0x3d94('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0x3d94('0x30')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3d94('0xc')]['callerid'],_0xa578b['findBy']));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this['channel']['callerid'],_0xa578b[_0x3d94('0x158')]));return{'code':0xc8,'result':_0x3d94('0x15d')};}};AGIVertices[_0x3d94('0x13')][_0x3d94('0x16b')]=function(_0x3f8284){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x16c'),_0x3f8284[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x3f8284[_0x3d94('0x10f')])){return this[_0x3d94('0xc')]['error'](_0x3f8284,_0x3d94('0x165'));}var _0x20892c=this[_0x3d94('0x1f')]['sync'](this,_0x3f8284[_0x3d94('0x10f')]);if(!_0x20892c){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x3f8284,'no\x20file\x20audio\x20found');}var _0x97d82b=this[_0x3d94('0xc')]['exec'](_0x3d94('0x16d'),[_0x20892c,_0x3f8284[_0x3d94('0x10a')]]);if(_0x97d82b['result']===-0x1){return _0x97d82b;}return this['channel'][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('Executed\x20command\x20%s\x20%s',_0x3d94('0x16d'),_0x20892c));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x16e')]=function(_0x3b068f){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x16f'),_0x3b068f[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x3b068f[_0x3d94('0x170')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x3b068f,_0x3d94('0x171'));}var _0x14b1e0='';var _0x23b4d9=parseInt(_0x3b068f[_0x3d94('0x170')],0xa);if(isNaN(_0x23b4d9)){_0x14b1e0=_0x3b068f[_0x3d94('0x170')];}else{_0x14b1e0=this[_0x3d94('0x14')]['sync'](this,_0x3b068f[_0x3d94('0x170')]);if(!_0x14b1e0){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x3b068f,_0x3d94('0x172'));}}var _0x488cca='';if(this[_0x3d94('0x84')](_0x3b068f[_0x3d94('0x10f')])){var _0x2ced92=this[_0x3d94('0x1f')][_0x3d94('0x70')](this,_0x3b068f[_0x3d94('0x10f')]);if(_0x2ced92){_0x488cca=_0x2ced92;}}this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x3b068f,_0x14b1e0);if(_0x3b068f[_0x3d94('0x10a')]['indexOf']('x')<0x0){_0x3b068f[_0x3d94('0x10a')]+='x';}if(_0x3b068f[_0x3d94('0x10a')][_0x3d94('0x173')]('X')<0x0){_0x3b068f[_0x3d94('0x10a')]+='X';}this[_0x3d94('0xc')][_0x3d94('0x9d')](_0x3d94('0x174'),_0x14b1e0?_0x14b1e0[_0x3d94('0x175')]():'');var _0x242fdc=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0x176'),[_0x14b1e0,_0x3b068f[_0x3d94('0x10a')],_0x3b068f[_0x3d94('0x66')],_0x488cca,_0x3b068f['timeout'],_0x3b068f['agi'],_0x3b068f[_0x3d94('0x177')],_0x3b068f[_0x3d94('0x178')],'',_0x3b068f[_0x3d94('0x179')]]);if(_0x242fdc[_0x3d94('0xa1')]===-0x1){return _0x242fdc;}return this['channel'][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xc0'),'QUEUE',_0x14b1e0));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x17a')]=function(_0x437799){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x17b'),_0x437799[_0x3d94('0x3a')]));var _0x6ba5f1=_0x437799[_0x3d94('0x17c')]||'wav';var _0x35bbac=util[_0x3d94('0x2b')](_0x3d94('0x17d'),this[_0x3d94('0xc')][_0x3d94('0x39')],rs[_0x3d94('0x119')](0x5));var _0x1aab5c=util[_0x3d94('0x2b')](_0x3d94('0x17e'),FILES_PATH,_0x35bbac,_0x6ba5f1);var _0x802903=util['format'](_0x3d94('0x131'),FILES_PATH,_0x35bbac);this[_0x3d94('0x3d')][_0x3d94('0x70')](this,_0x437799,_0x35bbac,_0x1aab5c);this[_0x3d94('0xc')][_0x3d94('0x9d')](_0x3d94('0x17f'),_0x35bbac);logger['info'](_0x3d94('0x180'),_0x802903,_0x6ba5f1,_0x437799[_0x3d94('0x181')],_0x437799[_0x3d94('0x67')]);return this[_0x3d94('0xc')][_0x3d94('0x13a')](_0x802903,_0x6ba5f1,_0x437799[_0x3d94('0x181')],_0x437799['timeout'],undefined,!![]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x182')]=function(_0x31e5ba){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x183'),_0x31e5ba[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x31e5ba[_0x3d94('0x66')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x184'));}var _0x521855=this[_0x3d94('0x65')][_0x3d94('0x70')](this,_0x31e5ba);logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x185'),util[_0x3d94('0x186')](_0x521855,{'showHidden':![],'depth':null})));if(!this[_0x3d94('0x84')](_0x31e5ba[_0x3d94('0xd5')])){return this['channel'][_0x3d94('0xa7')](_0x3d94('0x187'));}var _0x129418=this[_0x3d94('0xe')][_0x3d94('0x70')](this,_0x31e5ba[_0x3d94('0xd5')]);if(!_0x129418){return this['channel']['error'](_0x31e5ba,_0x3d94('0x115'));}this['channel']['setVariable'](util[_0x3d94('0x2b')]('%s_STATUS_CODE',_0x129418),_0x521855[_0x3d94('0x188')]?_0x521855[_0x3d94('0x188')]:_0x3d94('0x189'));this[_0x3d94('0xc')][_0x3d94('0x9d')](util[_0x3d94('0x2b')](_0x3d94('0x18a'),_0x129418),_0x521855[_0x3d94('0x74')]?_0x521855[_0x3d94('0x74')]:'OK');if(_0x521855[_0x3d94('0x72')]){try{this[_0x3d94('0x9b')](_0x521855['body'],_0x129418);}catch(_0x5cc98e){logger[_0x3d94('0x2e')](util[_0x3d94('0x2b')](_0x3d94('0x18b'),_0x129418));}}return this['channel'][_0x3d94('0xa7')](util['format']('variable\x20%s\x20set',_0x129418));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x18c')]=function(_0x464633){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x18d'),_0x464633[_0x3d94('0x3a')]));return this['channel'][_0x3d94('0x18e')](_0x464633[_0x3d94('0x18f')]['replace'](/\s+/g,''),_0x464633[_0x3d94('0x181')]);};AGIVertices['prototype'][_0x3d94('0x190')]=function(_0x385c1b){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x385c1b[_0x3d94('0x3a')]));return this[_0x3d94('0xc')][_0x3d94('0x191')](_0x385c1b[_0x3d94('0x68')][_0x3d94('0x59')](/\s+/g,''),_0x385c1b[_0x3d94('0x181')]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x192')]=function(_0x32267e){logger['info'](util[_0x3d94('0x2b')](_0x3d94('0x193'),_0x32267e[_0x3d94('0x3a')]));return this[_0x3d94('0xc')]['sayPhonetic'](_0x32267e[_0x3d94('0x63')],_0x32267e[_0x3d94('0x181')]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x194')]=function(_0x5740ad){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x195'),_0x5740ad['label']));if(!this[_0x3d94('0x84')](_0x5740ad['account_id'])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x196'));}var _0x1e31a8=this[_0x3d94('0x22')][_0x3d94('0x70')](this,_0x5740ad[_0x3d94('0x197')]);if(!_0x1e31a8||!_0x1e31a8['Smtp']){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x5740ad,_0x3d94('0x198'));}var _0xd6f5ff={'from':util[_0x3d94('0x2b')](_0x3d94('0x199'),_0x1e31a8['name'],_0x1e31a8['email']||_0x1e31a8['Smtp']['user']),'to':_0x5740ad['to']||'','cc':_0x5740ad['cc']||'','bcc':_0x5740ad[_0x3d94('0x19a')]||'','subject':_0x5740ad['subject'],'html':_0x5740ad[_0x3d94('0x63')],'text':_0x5740ad[_0x3d94('0x63')]};var _0xf08fd2=_0x1e31a8[_0x3d94('0x19b')]();if(this[_0x3d94('0x84')](_0x5740ad[_0x3d94('0x19c')])){}logger[_0x3d94('0xdc')](_0x3d94('0x19d'),JSON[_0x3d94('0x73')](_0xd6f5ff));this['createSquareDetailsReport']['sync'](this,_0x5740ad,_0x5740ad[_0x3d94('0x197')]);this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x19e'),_0x1e31a8[_0x3d94('0x12')]));this[_0x3d94('0x24')][_0x3d94('0x70')](this,_0xf08fd2,_0xd6f5ff);return this[_0x3d94('0xc')]['noop'](_0x3d94('0x19f'));};AGIVertices['prototype'][_0x3d94('0x1a0')]=function(_0x1a867a){logger['info'](util['format'](_0x3d94('0x1a1'),_0x1a867a['label']));return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x1a2'));};AGIVertices['prototype']['sendSMS']=function(_0x13fb2d){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x1a3'),_0x13fb2d[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x13fb2d[_0x3d94('0x1a4')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x1a5'));}var _0x22d730=this[_0x3d94('0x36')]['sync'](this,_0x13fb2d['sms_account_id']);if(!_0x22d730){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x13fb2d,'no\x20sms\x20account\x20found');}var _0x1f3fe={'body':_0x13fb2d[_0x3d94('0x1a6')],'phone':_0x13fb2d['to']||'','SmsAccountId':_0x22d730['id']};logger[_0x3d94('0xdc')](_0x3d94('0x1a7'),JSON[_0x3d94('0x73')](_0x1f3fe));this['createSquareDetailsReport'][_0x3d94('0x70')](this,_0x13fb2d,_0x13fb2d[_0x3d94('0x1a4')]);this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x1a8'),_0x22d730[_0x3d94('0x12')]));this[_0x3d94('0x37')][_0x3d94('0x70')](this,_0x1f3fe);return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x1a9'));};AGIVertices['prototype'][_0x3d94('0x1aa')]=function(_0x2a2c9b){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x1ab'),_0x2a2c9b[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x2a2c9b[_0x3d94('0xd5')])){return this['channel'][_0x3d94('0x2e')](_0x2a2c9b,_0x3d94('0x1ac'));}var _0x469f43=this[_0x3d94('0xe')][_0x3d94('0x70')](this,_0x2a2c9b[_0x3d94('0xd5')]);if(!_0x469f43){return this['channel'][_0x3d94('0x2e')](_0x2a2c9b,_0x3d94('0x115'));}return this[_0x3d94('0xc')]['setVariable'](_0x469f43,_0x2a2c9b[_0x3d94('0x1ad')]);};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1ae')]=function(_0x4b2286){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20START\x20(%s)\x20block',_0x4b2286[_0x3d94('0x3a')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x1af'));if(_0x4b2286[_0x3d94('0xb5')]==='yes'){this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0x1b0'));return this[_0x3d94('0xc')]['answer']();}return this[_0x3d94('0xc')]['noop'](_0x3d94('0x1b1'));};AGIVertices['prototype'][_0x3d94('0x1b2')]=function(_0x1fbca4){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x1b3'),_0x1fbca4[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x1fbca4['project_id'])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x1fbca4,'no\x20subproject\x20selected');}var _0x229f90=this[_0x3d94('0x17')][_0x3d94('0x70')](this,_0x1fbca4[_0x3d94('0x1b4')]);if(!this[_0x3d94('0x84')](_0x229f90)){return this['channel'][_0x3d94('0x2e')](_0x1fbca4,util['format'](_0x3d94('0x1b5'),_0x1fbca4[_0x3d94('0x1b4')]));}if(_0x229f90===this[_0x3d94('0xc')]['arg_1']){return this[_0x3d94('0xc')]['error'](_0x1fbca4,_0x3d94('0x1b6'));}this[_0x3d94('0x38')][_0x3d94('0x70')](this,_0x1fbca4,_0x229f90);var _0x2f3698=this[_0x3d94('0xc')][_0x3d94('0x57')]('AGI',util['format'](_0x3d94('0x1b7'),config[_0x3d94('0x8')][_0x3d94('0x1b8')]||_0x3d94('0x1b9'),_0x229f90,this[_0x3d94('0xc')]['arg_1']));if(_0x2f3698[_0x3d94('0xa1')]===-0x1){return _0x2f3698;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xc0'),_0x3d94('0x1ba'),_0x229f90));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1bb')]=function(_0x1ba6d1){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x1bc'),_0x1ba6d1[_0x3d94('0x3a')]));var _0x3392ca=this['shellCommand'][_0x3d94('0x70')](this,_0x1ba6d1[_0x3d94('0x1bd')]);this['createSquareDetailsReport'][_0x3d94('0x70')](this,_0x1ba6d1,_0x1ba6d1[_0x3d94('0x1bd')]);if(this[_0x3d94('0x84')](_0x1ba6d1['variable_id'])){var _0x1504ce=this['getVariable'][_0x3d94('0x70')](this,_0x1ba6d1['variable_id']);if(_0x1504ce){this['channel'][_0x3d94('0x9d')](_0x1504ce,_0x3392ca);return this[_0x3d94('0xc')]['noop'](util['format'](_0x3d94('0x1be'),_0x1ba6d1['command'],_0x1504ce));}}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1ba6d1[_0x3d94('0x1bd')]));};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1bf')]=function(_0x17a299){logger[_0x3d94('0x30')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x17a299['label']));_0x17a299[_0x3d94('0x63')]=_0x17a299[_0x3d94('0x63')][_0x3d94('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3d94('0x84')](_0x17a299[_0x3d94('0x5b')])){return this['channel'][_0x3d94('0xa7')]('no\x20apiKey\x20configured');}if(!this[_0x3d94('0x84')](_0x17a299[_0x3d94('0x63')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xc3'));}this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x1c0'),_0x17a299[_0x3d94('0x63')]));var _0xaaa86a=this[_0x3d94('0x5a')][_0x3d94('0x70')](this,_0x17a299);if(_0xaaa86a){this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x1c1'),_0xaaa86a));var _0x132a16=this[_0x3d94('0xc')]['streamFile'](_0xaaa86a);try{fs['unlink'](_0xaaa86a+_0x3d94('0xff'));}catch(_0x25c4b2){logger[_0x3d94('0x2e')](_0x25c4b2);}return _0x132a16;}return this['channel'][_0x3d94('0x2e')](_0x17a299,_0x3d94('0x1c2'));};AGIVertices['prototype'][_0x3d94('0x1c3')]=function(_0x51b845){logger[_0x3d94('0x30')](util['format'](_0x3d94('0x1c4'),_0x51b845['label']));_0x51b845[_0x3d94('0x63')]=_0x51b845[_0x3d94('0x63')][_0x3d94('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3d94('0x84')](_0x51b845[_0x3d94('0x63')])){return this[_0x3d94('0xc')][_0x3d94('0xa7')](_0x3d94('0xc3'));}this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x1c5'),_0x51b845[_0x3d94('0x63')]));var _0x1c72d=this[_0x3d94('0x62')][_0x3d94('0x70')](this,_0x51b845);if(_0x1c72d){this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x1c6'),_0x1c72d));var _0xca0289=this[_0x3d94('0xc')][_0x3d94('0xfe')](_0x1c72d);try{fs['unlink'](_0x1c72d+'.wav');}catch(_0x267064){logger[_0x3d94('0x2e')](_0x267064);}return _0xca0289;}return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x51b845,_0x3d94('0x1c7'));};AGIVertices['prototype'][_0x3d94('0x1c8')]=function(_0x4c1795){logger['info'](util[_0x3d94('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x4c1795[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x4c1795[_0x3d94('0x158')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x4c1795,_0x3d94('0x156'));}logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x157'),this['channel'][_0x3d94('0x3e')],_0x4c1795[_0x3d94('0x158')]));var _0x5bcf28=this[_0x3d94('0x53')]['sync'](this,_0x4c1795[_0x3d94('0x158')]);if(_0x5bcf28){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x4c1795[_0x3d94('0x158')]));this[_0x3d94('0xc')]['noop'](util[_0x3d94('0x2b')](_0x3d94('0x159'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x4c1795['findBy']));return{'code':0xc8,'result':_0x3d94('0x15a')};}else{logger[_0x3d94('0x30')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x4c1795[_0x3d94('0x158')]));this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0x15b'),this[_0x3d94('0xc')][_0x3d94('0x3e')],_0x4c1795['findBy']));return{'code':0xc8,'result':_0x3d94('0x15d')};}};AGIVertices[_0x3d94('0x13')][_0x3d94('0x1c9')]=function(_0x1e8534){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1e8534[_0x3d94('0x3a')]));var _0x453254=this[_0x3d94('0xc')][_0x3d94('0x57')](_0x3d94('0x1ca'),[_0x1e8534[_0x3d94('0x1cb')],_0x1e8534[_0x3d94('0x77')]]);if(_0x453254[_0x3d94('0xa1')]===-0x1){return _0x453254;}return this[_0x3d94('0xc')][_0x3d94('0xa7')](util[_0x3d94('0x2b')](_0x3d94('0xc0'),_0x3d94('0x1ca'),_0x1e8534[_0x3d94('0x1cb')]));};AGIVertices[_0x3d94('0x13')]['vswitch']=function(_0x59ac0f){logger[_0x3d94('0x30')](util[_0x3d94('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x59ac0f[_0x3d94('0x3a')]));if(!this[_0x3d94('0x84')](_0x59ac0f[_0x3d94('0xd5')])){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x59ac0f,'no\x20variable\x20selected');}var _0x2d4afc=this['getVariable'][_0x3d94('0x70')](this,_0x59ac0f[_0x3d94('0xd5')]);if(!_0x2d4afc){return this[_0x3d94('0xc')][_0x3d94('0x2e')](_0x59ac0f,_0x3d94('0x115'));}var _0x20c121=this[_0x3d94('0xc')]['getVariable'](_0x2d4afc);return{'code':0xc8,'result':_0x20c121[_0x3d94('0xa0')]?_0x20c121['extra']:'-'};};String[_0x3d94('0x13')]['replaceAll']=function(_0x5e56fd,_0x5c592c){return this[_0x3d94('0x9e')](_0x5e56fd)[_0x3d94('0x1cc')](_0x5c592c);};module[_0x3d94('0x1cd')]=AGIVertices; \ No newline at end of file +var _0x19cb=['model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','setVariable','%s.%s','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','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','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','true','false','EVAL\x20CONDITION\x20%s\x20%s','condition','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','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','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','lodash','shelljs','randomstring','mustache','../../config/environment','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','getVariable','getVariableById','then','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','getUserById','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','list_id','callback','scheduledAt','toString','callback_priority','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','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured'];(function(_0x1b3f52,_0x4f5b13){var _0x36bf2c=function(_0x2c8426){while(--_0x2c8426){_0x1b3f52['push'](_0x1b3f52['shift']());}};_0x36bf2c(++_0x4f5b13);}(_0x19cb,0x146));var _0xb19c=function(_0x1b966f,_0x26da68){_0x1b966f=_0x1b966f-0x0;var _0x327999=_0x19cb[_0x1b966f];return _0x327999;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xb19c('0x0'));var sh=require(_0xb19c('0x1'));var odbc=require('odbc')();var rs=require(_0xb19c('0x2'));var moment=require('moment');var Mustache=require(_0xb19c('0x3'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xb19c('0x4'));var shared=require(_0xb19c('0x5'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xb19c('0x6'),_0xb19c('0x7')];var verticesWithRetry=[_0xb19c('0x8'),_0xb19c('0x9'),'getsecretdigits'];var AGIVertices=function(_0x553479,_0x1ee1da,_0x3ffb45){this[_0xb19c('0xa')]=_0x553479;this[_0xb19c('0xb')]=_0x1ee1da;this[_0xb19c('0xc')]=_0x3ffb45;};AGIVertices['prototype'][_0xb19c('0xd')]=function(_0xcc851f,_0x13e3c2){this[_0xb19c('0xb')][_0xb19c('0xe')](_0xcc851f)[_0xb19c('0xf')](function(_0x516592){_0x13e3c2(null,_0x516592?_0x516592['name']:![]);})['catch'](function(_0x46bfc2){_0x13e3c2(_0x46bfc2);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x11')]=function(_0x52098d,_0x23274c){this[_0xb19c('0xb')][_0xb19c('0x12')](_0x52098d)['then'](function(_0x12f4b1){_0x23274c(null,_0x12f4b1?_0x12f4b1['name']:![]);})[_0xb19c('0x13')](function(_0x261602){_0x23274c(_0x261602);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x14')]=function(_0x11eea0,_0x5bae0a){this[_0xb19c('0xb')][_0xb19c('0x15')](_0x11eea0)[_0xb19c('0xf')](function(_0x2b2815){_0x5bae0a(null,_0x2b2815?_0x2b2815[_0xb19c('0x16')]:![]);})['catch'](function(_0x4d3926){_0x5bae0a(_0x4d3926);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x17')]=function(_0x547809,_0x55cf87){this[_0xb19c('0xb')][_0xb19c('0x18')](_0x547809)[_0xb19c('0xf')](function(_0x413646){_0x55cf87(null,_0x413646?_0x413646['dsn']:![]);})[_0xb19c('0x13')](function(_0x14daf5){_0x55cf87(_0x14daf5);});};AGIVertices[_0xb19c('0x10')]['getUser']=function(_0x250604,_0x383878){this[_0xb19c('0xb')][_0xb19c('0x19')](_0x250604)[_0xb19c('0xf')](function(_0x5aaf38){_0x383878(null,_0x5aaf38?_0x5aaf38['name']:![]);})[_0xb19c('0x13')](function(_0x5c56cc){_0x383878(_0x5c56cc);});};AGIVertices[_0xb19c('0x10')]['getTrunk']=function(_0xdc2623,_0x1fdc4e){this[_0xb19c('0xb')][_0xb19c('0x1a')](_0xdc2623)[_0xb19c('0xf')](function(_0x1774fc){_0x1fdc4e(null,_0x1774fc?_0x1774fc[_0xb19c('0x16')]:![]);})[_0xb19c('0x13')](function(_0x4bbb72){_0x1fdc4e(_0x4bbb72);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1b')]=function(_0x1c18fe,_0x318c5d){var _0x513339=this;this['rpc']['getSoundById'](_0x1c18fe)[_0xb19c('0xf')](function(_0x1dd187){_0x318c5d(null,_0x1dd187?_0x513339[_0xb19c('0x1c')](_0x1dd187[_0xb19c('0x1d')]):![]);})[_0xb19c('0x13')](function(_0x4acb68){_0x318c5d(_0x4acb68);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1e')]=function(_0x12fc7c,_0x405088){this[_0xb19c('0xb')][_0xb19c('0x1f')](_0x12fc7c)[_0xb19c('0xf')](function(_0x4bd235){_0x405088(null,_0x4bd235?_0x4bd235:![]);})[_0xb19c('0x13')](function(_0x219c96){_0x405088(_0x219c96);});};AGIVertices['prototype'][_0xb19c('0x20')]=function(_0x1a11a1,_0x31c93f,_0x2296b1){this[_0xb19c('0xc')]['sendMailMessage'](_0x1a11a1,_0x31c93f)['then'](function(){_0x2296b1(null);})[_0xb19c('0x13')](function(_0x31028b){_0x2296b1(_0x31028b);});};AGIVertices[_0xb19c('0x10')]['getIntervals']=function(_0x307a22,_0x1510b4){this[_0xb19c('0xb')][_0xb19c('0x21')](_0x307a22)[_0xb19c('0xf')](function(_0x1e3aa1){if(_0x1e3aa1){if(_0x1e3aa1[_0xb19c('0x22')]){_0x1510b4(null,[_0x1e3aa1[_0xb19c('0x23')]]);}else{_0x1510b4(null,_[_0xb19c('0x24')](_0x1e3aa1['Intervals'],_0xb19c('0x23')));}}else{_0x1510b4(null,![]);}})[_0xb19c('0x13')](function(_0x5a1fb7){_0x1510b4(_0x5a1fb7);});};AGIVertices['prototype'][_0xb19c('0x1c')]=function(_0x1bef38){return util[_0xb19c('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x1bef38);};AGIVertices[_0xb19c('0x10')]['getQueryOdbc']=function(_0x431c3b,_0x54f1f7,_0x10683f){odbc[_0xb19c('0x26')](_0x431c3b,function(_0x4573be){if(_0x4573be){logger[_0xb19c('0x27')](_0xb19c('0x28'),_0x4573be);_0x10683f(_0x4573be);}else{logger[_0xb19c('0x29')](_0xb19c('0x2a'));odbc[_0xb19c('0x2b')](_0x54f1f7,function(_0x563bdb,_0x2504d9){if(_0x563bdb){logger[_0xb19c('0x29')]('Error\x20executing\x20query\x20%s',_0x54f1f7);_0x10683f(_0x563bdb);}else{logger[_0xb19c('0x29')](_0xb19c('0x2c'),_0x54f1f7);odbc[_0xb19c('0x2d')](function(_0x2826fd){if(_0x2826fd){logger[_0xb19c('0x27')](_0xb19c('0x2e'),_0x2826fd);}_0x10683f(null,_0x2504d9);});}});}});};AGIVertices['prototype'][_0xb19c('0x2f')]=function(_0x12209f,_0x5bde43){this[_0xb19c('0xb')]['getSmsAccountById'](_0x12209f)[_0xb19c('0xf')](function(_0x45bd41){_0x5bde43(null,_0x45bd41?_0x45bd41:![]);})[_0xb19c('0x13')](function(_0x238524){_0x5bde43(_0x238524);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x30')]=function(_0x441e9b,_0x49db9e){this[_0xb19c('0xb')][_0xb19c('0x30')](_0x441e9b)['then'](function(_0x10d406){_0x49db9e(null,_0x10d406);})[_0xb19c('0x13')](function(_0x25acab){_0x49db9e(_0x25acab);});};AGIVertices[_0xb19c('0x10')]['createSquareDetailsReport']=function(_0x48b108,_0x49df44,_0x296e51){this[_0xb19c('0xb')][_0xb19c('0x31')]({'uniqueid':this[_0xb19c('0xa')][_0xb19c('0x32')],'node':_0x48b108[_0xb19c('0x33')],'application':_0x48b108[_0xb19c('0x34')],'data':_0x49df44||null,'project_name':this[_0xb19c('0xa')][_0xb19c('0x35')],'callerid':this['channel'][_0xb19c('0x36')]})[_0xb19c('0xf')](function(_0x3f8f4b){if(_0x296e51){_0x296e51(null,_0x3f8f4b);}})[_0xb19c('0x13')](function(_0xdf1189){if(_0x296e51){_0x296e51(_0xdf1189);}});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x37')]=function(_0x3cba32,_0x170832,_0x37b36d,_0xe40620){this['rpc'][_0xb19c('0x37')]({'uniqueid':this[_0xb19c('0xa')][_0xb19c('0x32')],'callerid':this[_0xb19c('0xa')]['callerid'],'calleridname':this['channel'][_0xb19c('0x38')],'context':this[_0xb19c('0xa')][_0xb19c('0x39')],'extension':this[_0xb19c('0xa')]['extension'],'priority':this[_0xb19c('0xa')][_0xb19c('0x3a')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xb19c('0xa')][_0xb19c('0x3b')],'projectName':this[_0xb19c('0xa')][_0xb19c('0x35')],'saveName':_0x170832,'filename':_0x3cba32[_0xb19c('0x3c')]||_0x170832,'savePath':_0x37b36d})[_0xb19c('0xf')](function(_0x12c624){_0xe40620(null,_0x12c624);})[_0xb19c('0x13')](function(_0x422efc){_0xe40620(_0x422efc);});};AGIVertices['prototype']['createSquareMessage']=function(_0x1cf5b2,_0x1304f2,_0x55968c,_0x37b630,_0x33e7a3){this[_0xb19c('0xb')][_0xb19c('0x3d')]({'uniqueid':this[_0xb19c('0xa')][_0xb19c('0x32')],'body':_0x1cf5b2,'direction':_0x1304f2,'providerName':_0x55968c,'providerResponse':_0x37b630})[_0xb19c('0xf')](function(_0x5313a0){if(_0x33e7a3){_0x33e7a3(null,_0x5313a0);}})[_0xb19c('0x13')](function(_0x464890){if(_0x33e7a3){_0x33e7a3(_0x464890);}});};AGIVertices['prototype'][_0xb19c('0x3e')]=function(_0x4951e6,_0x4cd6cc){this['rpc'][_0xb19c('0x3e')]({'firstName':_[_0xb19c('0x3f')](_0x4951e6[_0xb19c('0x16')])||_[_0xb19c('0x40')](_0x4951e6[_0xb19c('0x16')])?'callback_'+Math[_0xb19c('0x41')]():_0x4951e6[_0xb19c('0x16')],'lastName':_[_0xb19c('0x3f')](_0x4951e6[_0xb19c('0x42')])||_[_0xb19c('0x40')](_0x4951e6['lastName'])?null:_0x4951e6[_0xb19c('0x42')],'phone':_0x4951e6['phone'],'ListId':_0x4951e6[_0xb19c('0x43')],'scheduledat':_0x4951e6['scheduledAt'],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xb19c('0x44'),'description':'Callback\x20scheduled\x20at\x20'+_0x4951e6[_0xb19c('0x45')][_0xb19c('0x46')](),'priority':_0x4951e6[_0xb19c('0x47')]})[_0xb19c('0xf')](function(_0x2be701){_0x4cd6cc(null,_0x2be701);})['catch'](function(_0x13c621){_0x4cd6cc(_0x13c621);});};AGIVertices[_0xb19c('0x10')]['getPause']=function(_0x3ccb5c,_0x2d62b0){this[_0xb19c('0xb')][_0xb19c('0x48')](_0x3ccb5c)[_0xb19c('0xf')](function(_0x32246b){_0x2d62b0(null,_0x32246b?_0x32246b[_0xb19c('0x16')]:![]);})['catch'](function(_0x36351b){_0x2d62b0(_0x36351b);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x49')]=function(_0x47ad0d,_0x4b3288,_0x485f24){var _0x4c8e9c={'role':_0xb19c('0x4a')};_0x4c8e9c[_0x47ad0d]=this[_0xb19c('0xa')][_0xb19c('0x36')];this[_0xb19c('0xb')][_0xb19c('0x49')](_0x4c8e9c,_0x4b3288,this[_0xb19c('0xa')][_0xb19c('0x32')])[_0xb19c('0xf')](function(_0xa51a15){_0x485f24(null,_['isNil'](_0xa51a15)?![]:!![]);})[_0xb19c('0x13')](function(_0x5d344d){logger['error'](_0x5d344d);_0x485f24(null,![]);});};AGIVertices['prototype'][_0xb19c('0x4b')]=function(_0x40d3dd,_0xfd718b){var _0x3cf5b1={'role':_0xb19c('0x4a')};_0x3cf5b1[_0x40d3dd]=this[_0xb19c('0xa')][_0xb19c('0x36')];this[_0xb19c('0xb')][_0xb19c('0x4b')](_0x3cf5b1)[_0xb19c('0xf')](function(_0x2d08a2){_0xfd718b(null,_[_0xb19c('0x40')](_0x2d08a2)?![]:!![]);})['catch'](function(_0x56bf49){logger[_0xb19c('0x27')](_0x56bf49);_0xfd718b(null,![]);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x4c')]=function(_0x26dc2a,_0x46fc4c){var _0x275ce3={'role':'agent'};_0x275ce3[_0x26dc2a]=this[_0xb19c('0xa')][_0xb19c('0x36')];this[_0xb19c('0xb')][_0xb19c('0x4c')](_0x275ce3)[_0xb19c('0xf')](function(_0x41a051){_0x46fc4c(null,_[_0xb19c('0x40')](_0x41a051)?![]:!![]);})[_0xb19c('0x13')](function(_0x314410){logger[_0xb19c('0x27')](_0x314410);_0x46fc4c(null,![]);});};AGIVertices['prototype'][_0xb19c('0x4d')]=function(_0x49c872,_0xadd092){var _0x444435={'role':_0xb19c('0x4a')};_0x444435[_0x49c872]=this[_0xb19c('0xa')][_0xb19c('0x36')];var _0x3cd024=_0x49c872!='internal'?util['format'](_0xb19c('0x4e'),_0xb19c('0x4f'),this[_0xb19c('0xa')][_0xb19c('0x36')]):undefined;this[_0xb19c('0xb')][_0xb19c('0x4d')](_0x444435,_0x3cd024)[_0xb19c('0xf')](function(_0x4d1446){_0xadd092(null,_[_0xb19c('0x40')](_0x4d1446)?![]:!![]);})['catch'](function(_0x57e3e3){logger[_0xb19c('0x27')](_0x57e3e3);_0xadd092(null,![]);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x50')]=function(_0x235265,_0x265f96){sh[_0xb19c('0x51')](_[_0xb19c('0x52')](_0x235265),function(_0x2c609d,_0x56f4ae){var _0x36c7a8=_0x56f4ae[_0xb19c('0x53')](/(\r\n|\n|\r)/gm,'');_0x265f96(null,_0x36c7a8);});};AGIVertices['prototype'][_0xb19c('0x54')]=function(_0x13593b,_0x4a1f75){scripts[_0xb19c('0x54')](_0x13593b[_0xb19c('0x55')],_0x13593b[_0xb19c('0x56')]||_0xb19c('0x57'),_0x13593b['text'],_0x13593b[_0xb19c('0x58')]||_0xb19c('0x59'),_0x13593b['ssmlGender']||_0xb19c('0x5a'),_0x13593b[_0xb19c('0x5b')]||'MP3')['then'](function(_0x2cf763){_0x4a1f75(null,_0x2cf763);})[_0xb19c('0x13')](function(_0x208cce){_0x4a1f75(_0x208cce);});};AGIVertices['prototype'][_0xb19c('0x5c')]=function(_0x38d2f3,_0x3a01ee){scripts[_0xb19c('0x5c')](_0x38d2f3[_0xb19c('0x57')],_0x38d2f3[_0xb19c('0x5d')]||'en',0x1)[_0xb19c('0xf')](function(_0x23e795){_0x3a01ee(null,_0x23e795);})[_0xb19c('0x13')](function(_0x4767a1){_0x3a01ee(_0x4767a1);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x5e')]=function(_0x265c33,_0x1ff48b){var _0x5d61ab={'uri':_0x265c33[_0xb19c('0x5f')],'method':_0x265c33['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x265c33[_0xb19c('0x60')])===_0xb19c('0x61')&&parseInt(_0x265c33['timeout'])>=0x1?parseInt(_0x265c33[_0xb19c('0x60')])*0x3e8:0x5*0x3e8};if(_[_0xb19c('0x62')]([_0xb19c('0x63'),_0xb19c('0x64')],_0x5d61ab['method'][_0xb19c('0x65')]())){try{_0x5d61ab[_0xb19c('0x66')]=_0x265c33[_0xb19c('0x7')]?JSON[_0xb19c('0x67')](_0x265c33[_0xb19c('0x7')]):{};}catch(_0x2c94e3){logger['error'](_0xb19c('0x68'),_0x2c94e3);}}try{_0x5d61ab[_0xb19c('0x69')]=_0x265c33[_0xb19c('0x6')]?JSON[_0xb19c('0x67')](_0x265c33[_0xb19c('0x6')]):{};}catch(_0x122acc){logger[_0xb19c('0x27')](_0xb19c('0x6a'),_0x122acc);}if(_0x265c33[_0xb19c('0x6b')]){try{var _0x3d139d=require(_0x265c33[_0xb19c('0x6b')])[_0xb19c('0x6c')](this,_0x5d61ab);_0x5d61ab[_0xb19c('0x6d')]=Mustache['render'](_0x265c33[_0xb19c('0x5f')],_0x3d139d,{},['$$','$$']);if(_0x5d61ab[_0xb19c('0x69')]){_0x5d61ab['headers']=JSON[_0xb19c('0x67')](Mustache[_0xb19c('0x6e')](JSON[_0xb19c('0x6f')](_0x5d61ab[_0xb19c('0x69')]),_0x3d139d,{},['$$','$$']));}if(_0x5d61ab[_0xb19c('0x66')]){_0x5d61ab[_0xb19c('0x66')]=JSON[_0xb19c('0x67')](Mustache[_0xb19c('0x6e')](JSON[_0xb19c('0x6f')](_0x5d61ab['body']),_0x3d139d,{},['$$','$$']));}}catch(_0x4d0383){logger[_0xb19c('0x27')](_0xb19c('0x70'),_0x4d0383);}}rp(_0x5d61ab)[_0xb19c('0xf')](function(_0x55ca33){var _0x46959d={'statusCode':_0x55ca33[_0xb19c('0x71')]||0xc8,'statusMessage':_0x55ca33[_0xb19c('0x72')]||'OK','headers':_0x55ca33['headers']||{},'body':_0x55ca33[_0xb19c('0x66')]||{}};_0x1ff48b(null,_0x46959d);})[_0xb19c('0x13')](function(_0x399d14){var _0x4bb988={'statusCode':_0x399d14[_0xb19c('0x71')]||0x1f4,'statusMessage':_0x399d14['message']||_0xb19c('0x73'),'headers':_0x399d14[_0xb19c('0x74')][_0xb19c('0x69')]||{},'body':_0x399d14['options'][_0xb19c('0x66')]||{}};_0x1ff48b(null,_0x4bb988);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x75')]=function(_0x117602,_0x27e4f1){scripts[_0xb19c('0x75')](this[_0xb19c('0xa')][_0xb19c('0x32')],_0x117602[_0xb19c('0x76')],_0x117602[_0xb19c('0x57')],_0x117602[_0xb19c('0x77')]||'en')[_0xb19c('0xf')](function(_0x1d47b1){_0x27e4f1(null,_0x1d47b1);})['catch'](function(_0x8e0d97){_0x27e4f1(_0x8e0d97);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x78')]=function(_0xea6a8f,_0x579335){scripts[_0xb19c('0x78')](this['channel']['uniqueid'],_0xea6a8f['dialogflowV2_project_id'],_0xea6a8f[_0xb19c('0x79')],_0xea6a8f['private_key'],_0xea6a8f[_0xb19c('0x57')],_0xea6a8f['dialogflowV2_language']||'en')[_0xb19c('0xf')](function(_0x193942){_0x579335(null,_0x193942);})[_0xb19c('0x13')](function(_0x3f2c5d){_0x579335(_0x3f2c5d);});};AGIVertices['prototype']['sestekNDA']=function(_0x1829bc,_0x1c6d21){scripts[_0xb19c('0x7a')](this['channel'],_0x1829bc)[_0xb19c('0xf')](function(_0x23b915){_0x1c6d21(null,_0x23b915);})[_0xb19c('0x13')](function(_0x34d521){_0x1c6d21(_0x34d521);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x7b')]=function(_0x149ab9,_0x23c89f){scripts['ispeechTTS'](_0x149ab9[_0xb19c('0x76')],_0x149ab9[_0xb19c('0x57')],_0x149ab9[_0xb19c('0x7c')]||_0xb19c('0x59'),_0x149ab9[_0xb19c('0x7d')])['then'](function(_0x528341){_0x23c89f(null,_0x528341);})[_0xb19c('0x13')](function(_0x4c8f40){_0x23c89f(_0x4c8f40);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x7e')]=function(_0x438da7,_0x4cbf04,_0x4272a4){scripts[_0xb19c('0x7e')](_0x4cbf04,_0x438da7[_0xb19c('0x76')],_0x438da7[_0xb19c('0x7f')]||'en-US',this[_0xb19c('0x80')](_0x438da7['model'])?_0x438da7[_0xb19c('0x81')]:undefined)[_0xb19c('0xf')](function(_0x1e467f){_0x4272a4(null,_0x1e467f);})['catch'](function(_0xdab85d){_0x4272a4(_0xdab85d);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x82')]=function(_0x42f720,_0x2a8503){scripts[_0xb19c('0x82')](_0x42f720[_0xb19c('0x83')],_0x42f720['aws_secret_access_key'],_0x42f720[_0xb19c('0x84')],_0x42f720[_0xb19c('0x85')]||'Amy',_0x42f720[_0xb19c('0x57')],_0x42f720[_0xb19c('0x86')]||_0xb19c('0x57'))[_0xb19c('0xf')](function(_0x3ddad6){_0x2a8503(null,_0x3ddad6);})[_0xb19c('0x13')](function(_0x3a9ac8){_0x2a8503(_0x3a9ac8);});};AGIVertices[_0xb19c('0x10')]['awsLex']=function(_0x37cd70,_0x3a9c15){scripts[_0xb19c('0x87')](this[_0xb19c('0xa')][_0xb19c('0x32')],_0x37cd70[_0xb19c('0x83')],_0x37cd70[_0xb19c('0x88')],_0x37cd70['aws_lex_region'],_0x37cd70[_0xb19c('0x57')],_0x37cd70[_0xb19c('0x89')])[_0xb19c('0xf')](function(_0x1de695){_0x3a9c15(null,_0x1de695);})[_0xb19c('0x13')](function(_0x5698d0){_0x3a9c15(_0x5698d0);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x8a')]=function(_0x24e427,_0x2435ee,_0x27be86){scripts[_0xb19c('0x8a')](_0x2435ee,_0x24e427[_0xb19c('0x76')],_0x24e427[_0xb19c('0x8b')]||_0xb19c('0x59'))['then'](function(_0x1a7216){_0x27be86(null,_0x1a7216);})['catch'](function(_0x3bd073){_0x27be86(_0x3bd073);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x8c')]=function(_0x5a65fd,_0x2354e7,_0x85028e){scripts['tildeASR'](_0x2354e7,_0x5a65fd[_0xb19c('0x8d')],_0x5a65fd[_0xb19c('0x8e')],_0x5a65fd[_0xb19c('0x6d')])[_0xb19c('0xf')](function(_0xc50e9){_0x85028e(null,_0xc50e9);})['catch'](function(_0x403eea){_0x85028e(_0x403eea);});};AGIVertices[_0xb19c('0x10')][_0xb19c('0x8f')]=function(_0x522b50){var _0x33d784=_[_0xb19c('0x62')](verticesWithRetry,_0x522b50[_0xb19c('0x34')])?_0x522b50:_[_0xb19c('0x90')](_0x522b50);for(var _0x40cbe2 in _0x33d784){if(_0x33d784[_0xb19c('0x91')](_0x40cbe2)){if(_0x33d784[_0x40cbe2]&&_[_0xb19c('0x92')](_0x33d784[_0x40cbe2])){if(_[_0xb19c('0x62')](recursiveMapAttributes,_0x40cbe2)){_0x33d784[_0x40cbe2]=this[_0xb19c('0x93')](_0x33d784[_0x40cbe2]);}else{_0x33d784[_0x40cbe2]=this['replaceAllVariables'](_0x33d784[_0x40cbe2]);}}}}return _0x33d784;};AGIVertices[_0xb19c('0x10')][_0xb19c('0x94')]=function(_0x5e1245){for(var _0x57ad8e in _0x5e1245){if(_0x5e1245[_0xb19c('0x91')](_0x57ad8e)){if(_[_0xb19c('0x95')](_0x5e1245[_0x57ad8e])){this[_0xb19c('0x94')](_0x5e1245[_0x57ad8e]);}else if(_[_0xb19c('0x96')](_0x5e1245[_0x57ad8e])){for(var _0x1d3742=0x0;_0x1d3742<_0x5e1245[_0x57ad8e][_0xb19c('0x97')];_0x1d3742++){this[_0xb19c('0x94')](_0x5e1245[_0x57ad8e][_0x1d3742]);}}else if(_[_0xb19c('0x92')](_0x5e1245[_0x57ad8e])){_0x5e1245[_0x57ad8e]=this[_0xb19c('0x98')](_0x5e1245[_0x57ad8e]);}}}};AGIVertices['prototype'][_0xb19c('0x99')]=function(_0x380d1d,_0x90e5fb){for(var _0x2521be in _0x380d1d){if(_0x380d1d[_0xb19c('0x91')](_0x2521be)){if(_[_0xb19c('0x95')](_0x380d1d[_0x2521be])){if(!_[_0xb19c('0x3f')](_0x380d1d[_0x2521be])){this[_0xb19c('0x99')](_0x380d1d[_0x2521be],util[_0xb19c('0x25')]('%s.%s',_0x90e5fb,_0x2521be));}}else if(_[_0xb19c('0x96')](_0x380d1d[_0x2521be])){for(var _0x58f102=0x0;_0x58f102<_0x380d1d[_0x2521be][_0xb19c('0x97')];_0x58f102++){this['saveRestApiResult'](_0x380d1d[_0x2521be][_0x58f102],util['format']('%s.%s',_0x90e5fb,_0x2521be+'['+_0x58f102+']'));}}else{if(!_[_0xb19c('0x40')](_0x380d1d[_0x2521be])){this[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0x9b'),_0x90e5fb,_0x2521be),_0x380d1d[_0x2521be]);}}}}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x93')]=function(_0x4784da){try{var _0x375e35=JSON[_0xb19c('0x67')](_0x4784da);this[_0xb19c('0x94')](_0x375e35);return JSON[_0xb19c('0x6f')](_0x375e35);}catch(_0x4c2947){return this[_0xb19c('0x98')](_0x4784da);}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x98')]=function(_0x74cd8){var _0x353329=_0x74cd8['split']('{');for(var _0x5efb44=0x1;_0x5efb44<_0x353329[_0xb19c('0x97')];_0x5efb44+=0x1){var _0x3735e7=_0x353329[_0x5efb44][_0xb19c('0x9c')]('}');if(_0x3735e7['length']>0x1){_0x74cd8=_0x74cd8['replaceAll']('{'+_0x3735e7[0x0]+'}',this['channel'][_0xb19c('0xd')](_0x3735e7[0x0])[_0xb19c('0x9d')]||_0x3735e7[0x0]);}}if(_0x353329['length']===0x1){return _0x74cd8[_0xb19c('0x46')]();}return this[_0xb19c('0x98')](_0x74cd8);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x9e')]=function(_0x5ee362,_0x46a500){var _0x48a365=this[_0xb19c('0xa')]['getVariable'](_0x5ee362);if(_0x48a365[_0xb19c('0x9f')]===-0x1){return _0x48a365;}logger[_0xb19c('0x29')](util['format'](_0xb19c('0xa0'),_0x46a500,_0x48a365[_0xb19c('0x9d')]));return this[_0xb19c('0xa')][_0xb19c('0x9a')](_0x46a500,_0x48a365[_0xb19c('0x9d')]);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x80')]=function(_0x346d71){return _0x346d71&&_0x346d71!=='0'&&_0x346d71!=='-1'&&_0x346d71!=='';};AGIVertices['prototype'][_0xb19c('0xa1')]=function(_0x5e60cb){this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x5e60cb,'-');_0x5e60cb['retry']=_0x5e60cb[_0xb19c('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb19c('0x10')][_0xb19c('0xa2')]=function(_0x38199c){logger[_0xb19c('0x29')](util['format'](_0xb19c('0xa3'),_0x38199c['label']));if(!this[_0xb19c('0x80')](_0x38199c[_0xb19c('0x57')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xa5'));}var _0x575a22='\x22'+_0x38199c[_0xb19c('0x57')]+'\x22';if(this[_0xb19c('0x80')](_0x38199c[_0xb19c('0x74')])){_0x575a22+=','+_0x38199c[_0xb19c('0x74')];}var _0x18c946=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0xa6'),_0x575a22);if(_0x18c946[_0xb19c('0x9f')]===-0x1){return _0x18c946;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x575a22));};AGIVertices['prototype'][_0xb19c('0xa7')]=function(_0x8eb52d){logger['info'](util['format'](_0xb19c('0xa8'),_0x8eb52d[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x8eb52d[_0xb19c('0xa9')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xaa'));}var _0x3cf057=_0x8eb52d['grammar'];if(this[_0xb19c('0x80')](_0x8eb52d[_0xb19c('0x74')])){_0x3cf057+=','+_0x8eb52d[_0xb19c('0x74')];}var _0x357d14=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0xab'),_0x3cf057);if(_0x357d14[_0xb19c('0x9f')]===-0x1){return _0x357d14;}var _0x4f9ab9=this['getAndSetVariable'](_0xb19c('0xac'),_0xb19c('0xad'));if(_0x4f9ab9[_0xb19c('0x9f')]===-0x1){return _0x4f9ab9;}var _0x44f2e4=this['getAndSetVariable'](_0xb19c('0xae'),_0xb19c('0xaf'));if(_0x44f2e4[_0xb19c('0x9f')]===-0x1){return _0x44f2e4;}var _0xf132d4=this[_0xb19c('0x9e')](_0xb19c('0xb0'),_0xb19c('0xb1'));if(_0xf132d4[_0xb19c('0x9f')]===-0x1){return _0xf132d4;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xb2'),_0x3cf057));};AGIVertices[_0xb19c('0x10')][_0xb19c('0xb3')]=function(_0x3c1b12){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xb4'),_0x3c1b12[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0xb3')]([_0x3c1b12['command'],_0x3c1b12[_0xb19c('0xb5')]]);};AGIVertices['prototype'][_0xb19c('0xb6')]=function(_0x58849d){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xb7'),_0x58849d[_0xb19c('0x33')]));if(this[_0xb19c('0x80')](_0x58849d[_0xb19c('0x60')])){logger[_0xb19c('0x29')](util['format'](_0xb19c('0xb8'),_0x58849d['timeout']));var _0x46224a=this[_0xb19c('0xa')][_0xb19c('0xb9')](_0x58849d['timeout']);if(_0x46224a[_0xb19c('0x9f')]===-0x1){return _0x46224a;}}return this[_0xb19c('0xa')][_0xb19c('0xb6')]();};AGIVertices[_0xb19c('0x10')][_0xb19c('0x44')]=function(_0x4351d5){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4351d5[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x4351d5[_0xb19c('0x43')])){return this['channel'][_0xb19c('0x27')](_0x4351d5,_0xb19c('0xba'));}_0x4351d5[_0xb19c('0x45')]=moment();if(this[_0xb19c('0x80')](_0x4351d5['delay'])){_0x4351d5['scheduledAt']=moment()[_0xb19c('0xbb')](_0x4351d5[_0xb19c('0xbc')],'minutes');}if(!this['isConfigured'](_0x4351d5[_0xb19c('0x47')])){_0x4351d5[_0xb19c('0x47')]=0x2;}this[_0xb19c('0x3e')][_0xb19c('0x6c')](this,_0x4351d5);return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xbd'),_0x4351d5['phone'],_0x4351d5[_0xb19c('0x43')],_0x4351d5[_0xb19c('0x45')]));};AGIVertices['prototype']['custom_app']=function(_0x9a91b5){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xbe'),_0x9a91b5[_0xb19c('0x33')]));var _0x33223f=this['channel'][_0xb19c('0x51')](_0x9a91b5[_0xb19c('0xbf')],_0x9a91b5[_0xb19c('0x74')]);if(_0x33223f[_0xb19c('0x9f')]===-0x1){return _0x33223f;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xc0'),_0x9a91b5[_0xb19c('0xbf')],_0x9a91b5[_0xb19c('0x74')]));};AGIVertices['prototype'][_0xb19c('0xc1')]=function(_0x41dfa9){logger[_0xb19c('0x29')](util['format'](_0xb19c('0xc2'),_0x41dfa9[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x41dfa9[_0xb19c('0x57')])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xa5'));}var _0x4a0312='\x22'+_0x41dfa9['text']+'\x22';if(this[_0xb19c('0x80')](_0x41dfa9[_0xb19c('0x74')])){_0x4a0312+=','+_0x41dfa9['options'];}var _0x4bc11b=this[_0xb19c('0xa')][_0xb19c('0x51')]('MRCPSynth',_0x4a0312);if(_0x4bc11b[_0xb19c('0x9f')]===-0x1){return _0x4bc11b;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xc3'),_0x4a0312));};AGIVertices[_0xb19c('0x10')]['sestektts']=function(_0x53ad98){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xc4'),_0x53ad98['label']));if(!this['isConfigured'](_0x53ad98['text'])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xa5'));}var _0x2a9cd8='\x22'+_0x53ad98[_0xb19c('0x57')]+'\x22';if(this[_0xb19c('0x80')](_0x53ad98[_0xb19c('0x74')])){_0x2a9cd8+=','+_0x53ad98[_0xb19c('0x74')];}var _0x65e569=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0xa6'),_0x2a9cd8);if(_0x65e569[_0xb19c('0x9f')]===-0x1){return _0x65e569;}return this['channel']['noop'](util[_0xb19c('0x25')](_0xb19c('0xc3'),_0x2a9cd8));};AGIVertices['prototype'][_0xb19c('0xc5')]=function(_0x489c98){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xc6'),_0x489c98[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x489c98['grammar'])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xaa'));}var _0x532951=_0x489c98['grammar'];if(this['isConfigured'](_0x489c98[_0xb19c('0x74')])){_0x532951+=','+_0x489c98['options'];}var _0x49c272=this['channel'][_0xb19c('0x51')](_0xb19c('0xab'),_0x532951);if(_0x49c272[_0xb19c('0x9f')]===-0x1){return _0x49c272;}var _0x1b5d87=this[_0xb19c('0x9e')](_0xb19c('0xac'),_0xb19c('0xc7'));if(_0x1b5d87[_0xb19c('0x9f')]===-0x1){return _0x1b5d87;}var _0x2d12f2=this['getAndSetVariable']('RECOG_INPUT()',_0xb19c('0xc8'));if(_0x2d12f2[_0xb19c('0x9f')]===-0x1){return _0x2d12f2;}var _0x241589=this[_0xb19c('0x9e')](_0xb19c('0xb0'),_0xb19c('0xc9'));if(_0x241589[_0xb19c('0x9f')]===-0x1){return _0x241589;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xb2'),_0x532951));};AGIVertices['prototype'][_0xb19c('0xca')]=function(_0x33d776){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xcb'),_0x33d776['label']));if(!this[_0xb19c('0x80')](_0x33d776[_0xb19c('0xa9')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xaa'));}var _0x40edef=_0x33d776[_0xb19c('0xa9')];if(this['isConfigured'](_0x33d776[_0xb19c('0x74')])){_0x40edef+=','+_0x33d776[_0xb19c('0x74')];}var _0x518102=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0xab'),_0x40edef);if(_0x518102[_0xb19c('0x9f')]===-0x1){return _0x518102;}var _0x1ad1e3=this[_0xb19c('0x9e')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x1ad1e3[_0xb19c('0x9f')]===-0x1){return _0x1ad1e3;}var _0x3435e9=this['getAndSetVariable'](_0xb19c('0xae'),_0xb19c('0xcc'));if(_0x3435e9[_0xb19c('0x9f')]===-0x1){return _0x3435e9;}var _0x565b70=this[_0xb19c('0x9e')](_0xb19c('0xb0'),_0xb19c('0xcd'));if(_0x565b70[_0xb19c('0x9f')]===-0x1){return _0x565b70;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xb2'),_0x40edef));};AGIVertices[_0xb19c('0x10')]['database']=function(_0x18f192){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x18f192[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x18f192[_0xb19c('0xce')])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x18f192,_0xb19c('0xcf'));}var _0x255533=this[_0xb19c('0x17')][_0xb19c('0x6c')](this,_0x18f192[_0xb19c('0xce')]);if(!_0x255533){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x18f192,_0xb19c('0xd0'));}if(!this[_0xb19c('0x80')](_0x18f192['query'])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x18f192,_0xb19c('0xd1'));}var _0x5718c5=_0x18f192[_0xb19c('0x2b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format']('query:\x20%s',_0x5718c5));var _0x1b499f=this[_0xb19c('0xd2')][_0xb19c('0x6c')](this,_0x255533,_0x5718c5);this[_0xb19c('0x31')]['sync'](this,_0x18f192,_0x5718c5);if(!this['isConfigured'](_0x18f192[_0xb19c('0xd3')])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xd4'));}var _0x4ff53c=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x18f192['variable_id']);if(!_0x4ff53c){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x18f192,_0xb19c('0xd5'));}var _0x1c87d5=this;_0x1b499f[_0xb19c('0xd6')](function(_0x35d11a,_0x5b44e1){Object[_0xb19c('0xd7')](_0x35d11a)['forEach'](function(_0x407cbe){_0x1c87d5[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0xd8'),_0x4ff53c,_0x5b44e1,_0x407cbe),_0x35d11a[_0x407cbe]);});});this[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0xd9'),_0x4ff53c),_0x1b499f[_0xb19c('0x97')]);return this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')](_0xb19c('0xda'),_0x4ff53c));};AGIVertices[_0xb19c('0x10')][_0xb19c('0xdb')]=function(_0x457e03){logger[_0xb19c('0xdc')](util[_0xb19c('0x25')](_0xb19c('0xdd'),_0x457e03[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x457e03[_0xb19c('0xde')])){return this[_0xb19c('0xa')]['error'](_0x457e03,'no\x20user\x20selected');}var _0x46e7ab=this[_0xb19c('0xdf')][_0xb19c('0x6c')](this,_0x457e03[_0xb19c('0xde')]);if(!_0x46e7ab){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x457e03,_0xb19c('0xe0'));}var _0x22528f=this['channel'][_0xb19c('0x51')](_0xb19c('0xe1'),[util[_0xb19c('0x25')](_0xb19c('0xe2'),_0x46e7ab),_0x457e03[_0xb19c('0x60')],_0x457e03[_0xb19c('0xe3')],_0x457e03[_0xb19c('0x5f')]]);if(_0x22528f[_0xb19c('0x9f')]===-0x1){return _0x22528f;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')]('Executed\x20command\x20%s',_0xb19c('0xe1')));};AGIVertices[_0xb19c('0x10')]['dialogflow']=function(_0x3bc3d2){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0xe4'),_0x3bc3d2['label']));if(!this[_0xb19c('0x80')](_0x3bc3d2[_0xb19c('0x76')])){return this['channel'][_0xb19c('0xa4')](_0xb19c('0xe5'));}if(!this[_0xb19c('0x80')](_0x3bc3d2['text'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xa5'));}this[_0xb19c('0xa')][_0xb19c('0xe6')]=!![];this[_0xb19c('0x31')](_0x3bc3d2);this[_0xb19c('0x3d')](_0x3bc3d2[_0xb19c('0x57')],'in','','');this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xe7'),_0x3bc3d2[_0xb19c('0x57')]));var _0x49511c=this[_0xb19c('0x75')]['sync'](this,_0x3bc3d2);if(_0x49511c){for(var _0x3bce61 in _0x49511c){if(_0x49511c[_0xb19c('0x91')](_0x3bce61)){this[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0xe8'),_0x3bce61[_0xb19c('0x65')]()),_0x49511c[_0x3bce61]);}}this[_0xb19c('0x3d')](_0x49511c[_0xb19c('0xe9')],_0xb19c('0xea'),'dialogflow','');return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xeb'),_0x49511c[_0xb19c('0xe9')]));}return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x3bc3d2,_0xb19c('0xec'));};AGIVertices[_0xb19c('0x10')][_0xb19c('0xed')]=function(_0x5c71a6){logger['info'](util[_0xb19c('0x25')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5c71a6[_0xb19c('0x33')]));if(!this['isConfigured'](_0x5c71a6[_0xb19c('0xee')])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xef'));}if(!this['isConfigured'](_0x5c71a6[_0xb19c('0x79')])){return this['channel'][_0xb19c('0xa4')]('no\x20client_email\x20configured');}if(!this[_0xb19c('0x80')](_0x5c71a6[_0xb19c('0xf0')])){return this['channel'][_0xb19c('0xa4')](_0xb19c('0xf1'));}if(!this[_0xb19c('0x80')](_0x5c71a6['dialogflowV2_language'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xf2'));}if(!this[_0xb19c('0x80')](_0x5c71a6[_0xb19c('0x57')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xa5'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x5c71a6);this['createSquareMessage'](_0x5c71a6[_0xb19c('0x57')],'in','','');this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xf3'),_0x5c71a6['text']));var _0x5543e0=this[_0xb19c('0x78')][_0xb19c('0x6c')](this,_0x5c71a6);if(_0x5543e0){for(var _0x845d1a in _0x5543e0){if(_0x5543e0[_0xb19c('0x91')](_0x845d1a)){if(_0x845d1a!=='providerResponse'){this['channel'][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0xe8'),_0x845d1a[_0xb19c('0x65')]()),_0x5543e0[_0x845d1a]);}}}this[_0xb19c('0x3d')](_0x5543e0[_0xb19c('0xe9')],'out',_0xb19c('0xed'),_0x5543e0[_0xb19c('0xf4')]);return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xf5'),_0x5543e0[_0xb19c('0xe9')]));}return this['channel'][_0xb19c('0x27')](_0x5c71a6,_0xb19c('0xf6'));};AGIVertices[_0xb19c('0x10')]['sesteknda']=function(_0x1d6af8){logger['info'](util[_0xb19c('0x25')](_0xb19c('0xf7'),_0x1d6af8[_0xb19c('0x33')]));if(!this['isConfigured'](_0x1d6af8[_0xb19c('0xf8')])){return this['channel']['noop'](_0xb19c('0xf9'));}if(!this[_0xb19c('0x80')](_0x1d6af8['username'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x1d6af8[_0xb19c('0xfa')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xfb'));}if(!this['isConfigured'](_0x1d6af8['ndassistant_url'])){return this['channel'][_0xb19c('0xa4')]('no\x20text\x20configured');}this[_0xb19c('0xa')][_0xb19c('0xe6')]=!![];this[_0xb19c('0x31')](_0x1d6af8);this['createSquareMessage'](_0x1d6af8['text'],'in','','');this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xfc'),_0x1d6af8[_0xb19c('0x57')]));var _0xef6a65=this[_0xb19c('0x7a')][_0xb19c('0x6c')](this,_0x1d6af8);if(_0xef6a65){for(var _0x5b7346 in _0xef6a65){if(_0xef6a65[_0xb19c('0x91')](_0x5b7346)){this[_0xb19c('0xa')][_0xb19c('0x9a')](util['format'](_0xb19c('0xfd'),_0x5b7346[_0xb19c('0x65')]()),_0xef6a65[_0x5b7346]);}}this[_0xb19c('0x3d')](_0xef6a65[_0xb19c('0xe9')],_0xb19c('0xea'),_0xb19c('0xfe'),'');if(_0xef6a65[_0xb19c('0xff')]){this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')](_0xb19c('0x100'),_0xef6a65[_0xb19c('0xff')]));var _0x23dd42=this[_0xb19c('0xa')][_0xb19c('0x101')](_0xef6a65[_0xb19c('0xff')]);try{fs[_0xb19c('0x102')](_0xef6a65['audiofile']+_0xb19c('0x103'));}catch(_0x3d36a2){logger[_0xb19c('0x27')](_0x3d36a2);}return _0x23dd42;}else{return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x104'),_0xef6a65['speech']));}}return this['channel'][_0xb19c('0x27')](_0x1d6af8,_0xb19c('0x105'));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x106')]=function(_0xfc62){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x107'),_0xfc62['label']));return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x106'));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x108')]=function(_0x29f4d1){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x109'),_0x29f4d1[_0xb19c('0x33')]));var _0x9cb32e='';if(_0x29f4d1[_0xb19c('0x10a')]){if(!this[_0xb19c('0x80')](_0x29f4d1[_0xb19c('0x10a')])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x29f4d1,_0xb19c('0x10b'));}else{var _0x1248ed=parseInt(_0x29f4d1[_0xb19c('0x10a')],0xa);if(isNaN(_0x1248ed)){_0x9cb32e=_0x29f4d1['trunk_id'];}else{_0x9cb32e=this[_0xb19c('0x10c')]['sync'](this,_0x29f4d1[_0xb19c('0x10a')]);if(!_0x9cb32e){return this['channel'][_0xb19c('0x27')](_0x29f4d1,_0xb19c('0x10d'));}}}}else if(_0x29f4d1[_0xb19c('0x10e')]){_0x9cb32e=_0x29f4d1['trunk_name'];}else{return this['channel'][_0xb19c('0x27')](_0x29f4d1,_0xb19c('0x10b'));}var _0x400645=this[_0xb19c('0xa')][_0xb19c('0x51')]('DIAL',[util[_0xb19c('0x25')](_0xb19c('0x10f'),_0x9cb32e,_0x29f4d1['phone']),_0x29f4d1[_0xb19c('0x60')],_0x29f4d1[_0xb19c('0xe3')],_0x29f4d1['url']]);if(_0x400645[_0xb19c('0x9f')]===-0x1){return _0x400645;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x110'),_0xb19c('0xe1')));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x111')]=function(_0x4b58c7){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x112'),_0x4b58c7[_0xb19c('0x33')]));return this['channel'][_0xb19c('0xa4')]('finally');};AGIVertices[_0xb19c('0x10')][_0xb19c('0x9')]=function(_0x4ab43b){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x113'),_0x4ab43b['label']));if(_0x4ab43b[_0xb19c('0x114')]===0x0){return this[_0xb19c('0xa1')](_0x4ab43b);}_0x4ab43b[_0xb19c('0x114')]-=0x1;if(!this['isConfigured'](_0x4ab43b[_0xb19c('0x115')])){return this[_0xb19c('0xa')]['error'](_0x4ab43b,_0xb19c('0x116'));}var _0x36d076=this['getSound']['sync'](this,_0x4ab43b['file_id']);if(!_0x36d076){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x4ab43b,_0xb19c('0x117'));}if(!this['isConfigured'](_0x4ab43b[_0xb19c('0xd3')])){return this[_0xb19c('0xa')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3eb72e=this['channel']['getData'](_0x36d076,_0x4ab43b[_0xb19c('0x118')],_0x4ab43b[_0xb19c('0x119')]);var _0x18b881=_0x3eb72e[_0xb19c('0x9f')]?_0x3eb72e[_0xb19c('0x9f')][_0xb19c('0x46')]():'';logger[_0xb19c('0x29')](_0xb19c('0x11a'),JSON[_0xb19c('0x6f')](_0x3eb72e));if(_0x3eb72e[_0xb19c('0x9f')]===-0x1){this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4ab43b,_0x18b881);return _0x3eb72e;}else if(_0x3eb72e['extra']===_0xb19c('0x60')){_0x3eb72e[_0xb19c('0x9f')]=_0x18b881[_0xb19c('0x97')]>=parseInt(_0x4ab43b[_0xb19c('0x11b')])?'x':'i';}else{_0x3eb72e[_0xb19c('0x9f')]=_0x18b881[_0xb19c('0x97')]>=parseInt(_0x4ab43b['mindigit'])&&_0x18b881[_0xb19c('0x97')]<=parseInt(_0x4ab43b[_0xb19c('0x119')])?'x':'i';}var _0x1b8f24=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x4ab43b[_0xb19c('0xd3')]);if(!_0x1b8f24){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x4ab43b,'no\x20variable\x20found');}this['channel'][_0xb19c('0x9a')](_0x1b8f24,_0x18b881);if(this[_0xb19c('0x80')](_0x4ab43b[_0xb19c('0x11c')])){var _0x291dc4=parseInt(_0x4ab43b[_0xb19c('0x11c')],0xa);var _0x127053=rs[_0xb19c('0x11d')]({'charset':'*','length':_0x291dc4});var _0x5b559e=_0x18b881['length'];if(_0x5b559e>0x0){if(_0x5b559e>_0x291dc4){this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4ab43b,_0x4ab43b['hiddendigitspos']===_0xb19c('0x11e')?_0x127053+_0x18b881[_0xb19c('0x11f')](_0x291dc4):_0x18b881[_0xb19c('0x11f')](0x0,_0x5b559e-_0x291dc4)+_0x127053);}else{this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4ab43b,rs[_0xb19c('0x11d')]({'charset':'*','length':_0x5b559e}));}}else{this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4ab43b,'');}}else{this[_0xb19c('0x31')]['sync'](this,_0x4ab43b,_0x18b881);}return _0x3eb72e;};AGIVertices[_0xb19c('0x10')]['getsecretdigits']=function(_0x45fab5){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x120'),_0x45fab5[_0xb19c('0x33')]));return this[_0xb19c('0x9')](_0x45fab5);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x121')]=function(_0x104e36){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x122'),_0x104e36[_0xb19c('0x33')]));this[_0xb19c('0x31')]['sync'](this,_0x104e36,_0x104e36[_0xb19c('0x123')]);return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x124'),_0x104e36[_0xb19c('0x123')]));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x125')]=function(_0x127fbf){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x126'),_0x127fbf['label']));if(!this['isConfigured'](_0x127fbf[_0xb19c('0x83')])||!this[_0xb19c('0x80')](_0x127fbf['aws_secret_access_key'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x127'));}if(!this[_0xb19c('0x80')](_0x127fbf[_0xb19c('0x57')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')]('no\x20text\x20configured');}this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')](_0xb19c('0x128'),_0x127fbf[_0xb19c('0x57')]));var _0x48f4bd=this[_0xb19c('0x82')][_0xb19c('0x6c')](this,_0x127fbf);if(_0x48f4bd){this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')]('aws\x20Polly\x20%s\x20file\x20created',_0x48f4bd));var _0x237486=this['channel'][_0xb19c('0x101')](_0x48f4bd);try{fs[_0xb19c('0x102')](_0x48f4bd+_0xb19c('0x103'));}catch(_0x5d8f79){logger['error'](_0x5d8f79);}return _0x237486;}return this[_0xb19c('0xa')]['error'](_0x127fbf,_0xb19c('0x129'));};AGIVertices['prototype'][_0xb19c('0x12a')]=function(_0x2a6fe4){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x12b'),_0x2a6fe4[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x2a6fe4[_0xb19c('0x83')])||!this[_0xb19c('0x80')](_0x2a6fe4[_0xb19c('0x88')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x127'));}if(!this[_0xb19c('0x80')](_0x2a6fe4[_0xb19c('0x89')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x12c'));}if(!this[_0xb19c('0x80')](_0x2a6fe4[_0xb19c('0x57')])){return this['channel'][_0xb19c('0xa4')]('no\x20text\x20configured');}this[_0xb19c('0xa')][_0xb19c('0xe6')]=!![];this[_0xb19c('0x31')](_0x2a6fe4);this['createSquareMessage'](_0x2a6fe4[_0xb19c('0x57')],'in','','');this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x12d'),_0x2a6fe4[_0xb19c('0x57')]));var _0x29ddd5=this[_0xb19c('0x87')][_0xb19c('0x6c')](this,_0x2a6fe4);if(_0x29ddd5){for(var _0x4e56e8 in _0x29ddd5){if(_0x29ddd5[_0xb19c('0x91')](_0x4e56e8)&&_[_0xb19c('0x92')](_0x29ddd5[_0x4e56e8])){this[_0xb19c('0xa')]['setVariable'](util['format'](_0xb19c('0x12e'),_0x4e56e8[_0xb19c('0x65')]()),_0x29ddd5[_0x4e56e8]);}}if(_[_0xb19c('0x40')](_0x29ddd5[_0xb19c('0x12f')])){return this['channel'][_0xb19c('0xa4')](_0xb19c('0x130'));}else{this[_0xb19c('0x3d')](_0x29ddd5[_0xb19c('0x12f')],_0xb19c('0xea'),_0xb19c('0x131'),'');return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x132'),_0x29ddd5[_0xb19c('0x12f')]));}}return this['channel'][_0xb19c('0x27')](_0x2a6fe4,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xb19c('0x10')]['googleasr']=function(_0x1be811){logger[_0xb19c('0x29')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1be811[_0xb19c('0x33')],_0x1be811[_0xb19c('0x60')]));if(!this['isConfigured'](_0x1be811[_0xb19c('0x76')])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0xe5'));}var _0x1e6ef0=_0xb19c('0x133');var _0x56a604=util[_0xb19c('0x25')](_0xb19c('0x134'),FILES_PATH,rs[_0xb19c('0x11d')](0x4));var _0x4d40b8=util[_0xb19c('0x25')](_0xb19c('0x9b'),_0x56a604,_0x1e6ef0);var _0x1279cf=!![];if(_0x1be811['beep']==='NOBEEP'){_0x1279cf=![];}var _0x2cb681=this['channel'][_0xb19c('0x135')](_0x56a604,_0x1e6ef0,_0x1be811[_0xb19c('0x136')],_0x1be811[_0xb19c('0x60')],undefined,_0x1279cf);if(_0x2cb681[_0xb19c('0x9f')]!==-0x1){this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0x137'),_0x4d40b8));var _0x32b18c=this[_0xb19c('0x8a')][_0xb19c('0x6c')](this,_0x1be811,_0x4d40b8);if(_0x32b18c){for(var _0x59e7d8 in _0x32b18c){if(_0x32b18c[_0xb19c('0x91')](_0x59e7d8)){this[_0xb19c('0xa')]['setVariable'](util[_0xb19c('0x25')](_0xb19c('0x138'),_0x59e7d8[_0xb19c('0x65')]()),_0x32b18c[_0x59e7d8]);}}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x32b18c)));}}return _0x2cb681;};AGIVertices[_0xb19c('0x10')]['tildeasr']=function(_0x4833b6){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x139'),_0x4833b6[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x4833b6['appid'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')]('no\x20appid\x20configured');}if(!this[_0xb19c('0x80')](_0x4833b6[_0xb19c('0x8e')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x13a'));}var _0x114ba8='wav';var _0x628ad4=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xb19c('0x11d')](0x4));var _0x54bc93=util['format'](_0xb19c('0x9b'),_0x628ad4,_0x114ba8);var _0x4131f4=!![];if(_0x4833b6['beep']===_0xb19c('0x13b')){_0x4131f4=![];}var _0x2ea386=this[_0xb19c('0xa')]['recordFile'](_0x628ad4,_0x114ba8,_0x4833b6['intKey'],_0x4833b6[_0xb19c('0x60')],undefined,_0x4131f4);if(_0x2ea386['result']!==-0x1){this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x13c'),_0x54bc93));var _0x4d0009=this['tildeASR'][_0xb19c('0x6c')](this,_0x4833b6,_0x54bc93);if(_0x4d0009){for(var _0xb1fe4d in _0x4d0009){if(_0x4d0009[_0xb19c('0x91')](_0xb1fe4d)){this[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0x13d'),_0xb1fe4d['toUpperCase']()),_0x4d0009[_0xb1fe4d]);}}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x13e'),JSON[_0xb19c('0x6f')](_0x4d0009)));}}return _0x2ea386;};AGIVertices['prototype'][_0xb19c('0x13f')]=function(_0x19ab1d){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x140'),_0x19ab1d['label']));return this[_0xb19c('0xa')][_0xb19c('0x141')](_0x19ab1d['context'],_0x19ab1d[_0xb19c('0x142')],_0x19ab1d[_0xb19c('0x3a')]);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x143')]=function(_0x3bb94b){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x144'),_0x3bb94b[_0xb19c('0x33')]));if(!this['isConfigured'](_0x3bb94b['condition'])){return this[_0xb19c('0xa')]['error'](_0x3bb94b,'no\x20condition\x20configured');}try{var _0x4061c9=eval(_0x3bb94b['condition'])?_0xb19c('0x145'):_0xb19c('0x146');this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x147'),_0x3bb94b[_0xb19c('0x148')],_0x4061c9));return{'code':0xc8,'result':_0x4061c9};}catch(_0x2a2e63){return{'code':0xc8,'result':_0xb19c('0x146')};}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x149')]=function(_0x9f4078){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x14a'),_0x9f4078[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x9f4078[_0xb19c('0x14b')])){return this[_0xb19c('0xa')]['error'](_0x9f4078,'no\x20interval\x20configured');}var _0x3bfce3=this[_0xb19c('0x14c')][_0xb19c('0x6c')](this,_0x9f4078[_0xb19c('0x14b')]);if(!_0x3bfce3){return this[_0xb19c('0xa')]['error'](_0x9f4078,_0xb19c('0x14d'));}for(var _0x5903a0=0x0;_0x5903a0<_0x3bfce3[_0xb19c('0x97')];_0x5903a0+=0x1){var _0x3ebd43=this[_0xb19c('0xa')]['getVariable'](util[_0xb19c('0x25')]('IFTIME(%s?true:false)',_0x3bfce3[_0x5903a0]));if(_0x3ebd43[_0xb19c('0x9f')]===-0x1){return _0x3ebd43;}logger[_0xb19c('0x29')](util['format'](_0xb19c('0x14e'),_0x3bfce3[_0x5903a0],_0x3ebd43[_0xb19c('0x9d')]));if(_0x3ebd43[_0xb19c('0x9d')]===_0xb19c('0x145')){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x14e'),_0x3bfce3[_0x5903a0],'true'));this['channel'][_0xb19c('0xa4')](util['format'](_0xb19c('0x14e'),_0x3bfce3[_0x5903a0],_0xb19c('0x145')));return{'code':0xc8,'result':'true'};}else{logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x14e'),_0x3bfce3[_0x5903a0],_0xb19c('0x146')));this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x14e'),_0x3bfce3[_0x5903a0],'false'));}}return{'code':0xc8,'result':_0xb19c('0x146')};};AGIVertices[_0xb19c('0x10')][_0xb19c('0x14f')]=function(_0x3cfec5){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x150'),_0x3cfec5[_0xb19c('0x33')]));return this[_0xb19c('0xa')]['hangup']();};AGIVertices[_0xb19c('0x10')][_0xb19c('0x151')]=function(_0xf779c5){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x152'),_0xf779c5[_0xb19c('0x33')]));if(!this['isConfigured'](_0xf779c5[_0xb19c('0x76')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xe5'));}var _0x3c7875=_0xb19c('0x133');var _0x3ad3ed=util[_0xb19c('0x25')](_0xb19c('0x134'),FILES_PATH,rs[_0xb19c('0x11d')](0x4));var _0x6143cd=util[_0xb19c('0x25')](_0xb19c('0x9b'),_0x3ad3ed,_0x3c7875);var _0x35763f=!![];if(_0xf779c5['beep']===_0xb19c('0x13b')){_0x35763f=![];}var _0x997b83=this['channel']['recordFile'](_0x3ad3ed,_0x3c7875,_0xf779c5[_0xb19c('0x136')],_0xf779c5[_0xb19c('0x60')],undefined,_0x35763f);if(_0x997b83[_0xb19c('0x9f')]!==-0x1){this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x153'),_0x6143cd));var _0x1e0e35=this['ispeechASR'][_0xb19c('0x6c')](this,_0xf779c5,_0x6143cd);if(_0x1e0e35){for(var _0x1ce3b7 in _0x1e0e35){if(_0x1e0e35[_0xb19c('0x91')](_0x1ce3b7)){this[_0xb19c('0xa')][_0xb19c('0x9a')](util[_0xb19c('0x25')](_0xb19c('0x154'),_0x1ce3b7[_0xb19c('0x65')]()),_0x1e0e35[_0x1ce3b7]);}}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x155'),JSON['stringify'](_0x1e0e35)));}}return _0x997b83;};AGIVertices['prototype']['ispeechtts']=function(_0x2d9084){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x156'),_0x2d9084['label']));if(!this[_0xb19c('0x80')](_0x2d9084['key'])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xe5'));}if(!this[_0xb19c('0x80')](_0x2d9084[_0xb19c('0x57')])){return this[_0xb19c('0xa')]['noop']('no\x20text\x20configured');}this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')](_0xb19c('0x157'),_0x2d9084[_0xb19c('0x57')]));var _0xbf16ec=this[_0xb19c('0x7b')][_0xb19c('0x6c')](this,_0x2d9084);if(_0xbf16ec){this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0x153'),_0xbf16ec));var _0x9bbbed=this[_0xb19c('0xa')][_0xb19c('0x101')](_0xbf16ec,_0x2d9084[_0xb19c('0x136')]);try{fs[_0xb19c('0x102')](_0xbf16ec+_0xb19c('0x103'));}catch(_0x14b7c9){logger['error'](_0x14b7c9);}return _0x9bbbed;}return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x2d9084,_0xb19c('0x158'));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x159')]=function(_0x469806){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15a'),_0x469806['label']));if(!this[_0xb19c('0x80')](_0x469806[_0xb19c('0x15b')])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x469806,_0xb19c('0x15c'));}logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15d'),this[_0xb19c('0xa')]['callerid'],_0x469806['findBy']));var _0x113458=this['agentLogin']['sync'](this,_0x469806[_0xb19c('0x15b')]);if(_0x113458){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15e'),this['channel'][_0xb19c('0x36')],_0x469806[_0xb19c('0x15b')]));this[_0xb19c('0xa')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xb19c('0x36')],_0x469806[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x15f')};}else{logger['info'](util[_0xb19c('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb19c('0xa')][_0xb19c('0x36')],_0x469806[_0xb19c('0x15b')]));this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb19c('0xa')]['callerid'],_0x469806[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x160')};}};AGIVertices[_0xb19c('0x10')]['logout']=function(_0x14832c){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x161'),_0x14832c[_0xb19c('0x33')]));if(!this['isConfigured'](_0x14832c[_0xb19c('0x15b')])){return this['channel'][_0xb19c('0x27')](_0x14832c,_0xb19c('0x15c'));}logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15d'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x14832c[_0xb19c('0x15b')]));var _0x180c6f=this['agentLogout']['sync'](this,_0x14832c[_0xb19c('0x15b')]);if(_0x180c6f){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x15e'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x14832c[_0xb19c('0x15b')]));this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x15e'),this['channel'][_0xb19c('0x36')],_0x14832c[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x15f')};}else{logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x162'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x14832c[_0xb19c('0x15b')]));this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb19c('0xa')][_0xb19c('0x36')],_0x14832c[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x160')};}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x163')]=function(_0x5db2be){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x164'),_0x5db2be[_0xb19c('0x33')]));if(!this['isConfigured'](_0x5db2be['operation'])){return this['channel'][_0xb19c('0x27')](_0x5db2be,_0xb19c('0x165'));}this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x166'),_0x5db2be[_0xb19c('0x167')]));var _0x3d37e6=eval(_0x5db2be[_0xb19c('0x167')]);if(!this[_0xb19c('0x80')](_0x5db2be[_0xb19c('0xd3')])){return this['channel']['noop'](_0xb19c('0xd4'));}var _0x3e0418=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x5db2be['variable_id']);if(!_0x3e0418){return this[_0xb19c('0xa')]['error'](_0x5db2be,_0xb19c('0xd5'));}if(_[_0xb19c('0x96')](_0x3d37e6)){var _0xa7e00d=this;_0x3d37e6[_0xb19c('0xd6')](function(_0x15827d,_0x54cfc7){_0xa7e00d['channel']['setVariable'](util[_0xb19c('0x25')]('%s[%s]',_0x3e0418,_0x54cfc7),_0x15827d);});return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')]('variable\x20%s[key]\x20set',_0x3e0418));}else{return this[_0xb19c('0xa')]['setVariable'](_0x3e0418,_0x3d37e6);}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x8')]=function(_0x3a262e){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x168'),_0x3a262e[_0xb19c('0x33')]));if(_0x3a262e['retry']===0x0){return this[_0xb19c('0xa1')](_0x3a262e);}_0x3a262e[_0xb19c('0x114')]-=0x1;if(!this[_0xb19c('0x80')](_0x3a262e[_0xb19c('0x115')])){return this[_0xb19c('0xa')]['error'](_0x3a262e,_0xb19c('0x116'));}var _0x4d3653=this['getSound'][_0xb19c('0x6c')](this,_0x3a262e[_0xb19c('0x115')]);if(!_0x4d3653){return this['channel'][_0xb19c('0x27')](_0x3a262e,_0xb19c('0x117'));}var _0x467a8d=this[_0xb19c('0xa')][_0xb19c('0x169')](_0x4d3653,_0x3a262e['response'],_0x3a262e[_0xb19c('0x16a')]);var _0x5b1ba6=_0x467a8d['result'];if(_0x467a8d['result']===-0x1){this['createSquareDetailsReport'][_0xb19c('0x6c')](this,_0x3a262e,'-1');return _0x467a8d;}else if(_0x467a8d[_0xb19c('0x9d')]===_0xb19c('0x60')){_0x467a8d[_0xb19c('0x9f')]=_0x467a8d['result'][_0xb19c('0x97')]>0x0?_0x467a8d['result']:'t';}else if(_['isEmpty'](_0x467a8d['result'])){_0x467a8d[_0xb19c('0x9f')]='#';_0x5b1ba6='#';}if(!this[_0xb19c('0x80')](_0x3a262e[_0xb19c('0xd3')])){this[_0xb19c('0xa')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x323896=this[_0xb19c('0xd')]['sync'](this,_0x3a262e[_0xb19c('0xd3')]);if(!_0x323896){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x3a262e,_0xb19c('0xd5'));}this[_0xb19c('0xa')][_0xb19c('0x9a')](_0x323896,_0x5b1ba6);}this['createSquareDetailsReport']['sync'](this,_0x3a262e,_0x5b1ba6);return _0x467a8d;};AGIVertices[_0xb19c('0x10')][_0xb19c('0xa4')]=function(_0x39335b){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x16b'),_0x39335b[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0x39335b[_0xb19c('0x16c')]||_0x39335b[_0xb19c('0x33')]);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x16d')]=function(_0x24f808){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x16e'),_0x24f808[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x24f808['findBy'])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x24f808,_0xb19c('0x15c'));}logger['info'](util['format'](_0xb19c('0x15d'),this['channel']['callerid'],_0x24f808['findBy']));var _0x219207=this[_0xb19c('0x16f')]['sync'](this,_0x24f808[_0xb19c('0x170')]);var _0x670df0=this[_0xb19c('0x49')]['sync'](this,_0x24f808['findBy'],_0x219207);if(_0x670df0){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15e'),this[_0xb19c('0xa')]['callerid'],_0x24f808[_0xb19c('0x15b')]));this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0x15e'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x24f808[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x15f')};}else{logger['info'](util[_0xb19c('0x25')](_0xb19c('0x162'),this['channel'][_0xb19c('0x36')],_0x24f808[_0xb19c('0x15b')]));this[_0xb19c('0xa')]['noop'](util['format'](_0xb19c('0x15e'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x24f808[_0xb19c('0x15b')]));return{'code':0xc8,'result':_0xb19c('0x160')};}};AGIVertices[_0xb19c('0x10')]['playback']=function(_0x575a62){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x575a62[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x575a62[_0xb19c('0x115')])){return this['channel'][_0xb19c('0x27')](_0x575a62,_0xb19c('0x116'));}var _0x553bc0=this[_0xb19c('0x1b')][_0xb19c('0x6c')](this,_0x575a62[_0xb19c('0x115')]);if(!_0x553bc0){return this['channel'][_0xb19c('0x27')](_0x575a62,_0xb19c('0x117'));}var _0x5ab6dd=this['channel']['exec']('PLAYBACK',[_0x553bc0,_0x575a62[_0xb19c('0xe3')]]);if(_0x5ab6dd[_0xb19c('0x9f')]===-0x1){return _0x5ab6dd;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xc0'),_0xb19c('0x171'),_0x553bc0));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x172')]=function(_0x4b537a){logger[_0xb19c('0x29')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4b537a[_0xb19c('0x33')]));if(!this['isConfigured'](_0x4b537a[_0xb19c('0x173')])){return this['channel'][_0xb19c('0x27')](_0x4b537a,_0xb19c('0x174'));}var _0x982d83='';var _0x164d3e=parseInt(_0x4b537a[_0xb19c('0x173')],0xa);if(isNaN(_0x164d3e)){_0x982d83=_0x4b537a[_0xb19c('0x173')];}else{_0x982d83=this[_0xb19c('0x11')][_0xb19c('0x6c')](this,_0x4b537a[_0xb19c('0x173')]);if(!_0x982d83){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x4b537a,'no\x20queue\x20found');}}var _0x20f673='';if(this[_0xb19c('0x80')](_0x4b537a['file_id'])){var _0x28ab26=this[_0xb19c('0x1b')][_0xb19c('0x6c')](this,_0x4b537a[_0xb19c('0x115')]);if(_0x28ab26){_0x20f673=_0x28ab26;}}this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4b537a,_0x982d83);if(_0x4b537a[_0xb19c('0xe3')][_0xb19c('0x175')]('x')<0x0){_0x4b537a[_0xb19c('0xe3')]+='x';}if(_0x4b537a[_0xb19c('0xe3')][_0xb19c('0x175')]('X')<0x0){_0x4b537a[_0xb19c('0xe3')]+='X';}this[_0xb19c('0xa')][_0xb19c('0x9a')](_0xb19c('0x176'),_0x982d83?_0x982d83[_0xb19c('0x177')]():'');var _0xf7fa40=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0x178'),[_0x982d83,_0x4b537a[_0xb19c('0xe3')],_0x4b537a[_0xb19c('0x5f')],_0x20f673,_0x4b537a[_0xb19c('0x60')],_0x4b537a['agi'],_0x4b537a[_0xb19c('0x179')],_0x4b537a[_0xb19c('0x17a')],'',_0x4b537a[_0xb19c('0x17b')]]);if(_0xf7fa40[_0xb19c('0x9f')]===-0x1){return _0xf7fa40;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0xc0'),'QUEUE',_0x982d83));};AGIVertices['prototype'][_0xb19c('0x17c')]=function(_0x983a86){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x17d'),_0x983a86['label']));var _0x26a4eb=_0x983a86['recordingFormat']||'wav';var _0x164751=util[_0xb19c('0x25')](_0xb19c('0x17e'),this['channel'][_0xb19c('0x32')],rs['generate'](0x5));var _0x5a7722=util['format'](_0xb19c('0x17f'),FILES_PATH,_0x164751,_0x26a4eb);var _0x181795=util[_0xb19c('0x25')](_0xb19c('0x134'),FILES_PATH,_0x164751);this[_0xb19c('0x37')][_0xb19c('0x6c')](this,_0x983a86,_0x164751,_0x5a7722);this[_0xb19c('0xa')][_0xb19c('0x9a')]('RECORDING_SAVENAME',_0x164751);logger[_0xb19c('0x29')](_0xb19c('0x180'),_0x181795,_0x26a4eb,_0x983a86[_0xb19c('0x181')],_0x983a86['timeout']);return this[_0xb19c('0xa')][_0xb19c('0x135')](_0x181795,_0x26a4eb,_0x983a86[_0xb19c('0x181')],_0x983a86[_0xb19c('0x60')],undefined,!![]);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x182')]=function(_0x5c409e){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x183'),_0x5c409e[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x5c409e[_0xb19c('0x5f')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')]('no\x20url\x20configured');}var _0x104d33=this[_0xb19c('0x5e')][_0xb19c('0x6c')](this,_0x5c409e);logger[_0xb19c('0x29')](util['format'](_0xb19c('0x184'),util['inspect'](_0x104d33,{'showHidden':![],'depth':null})));if(!this[_0xb19c('0x80')](_0x5c409e[_0xb19c('0xd3')])){return this[_0xb19c('0xa')]['noop'](_0xb19c('0x185'));}var _0x5d36ef=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x5c409e[_0xb19c('0xd3')]);if(!_0x5d36ef){return this[_0xb19c('0xa')]['error'](_0x5c409e,_0xb19c('0xd5'));}this['channel']['setVariable'](util['format']('%s_STATUS_CODE',_0x5d36ef),_0x104d33[_0xb19c('0x71')]?_0x104d33[_0xb19c('0x71')]:_0xb19c('0x186'));this['channel'][_0xb19c('0x9a')](util[_0xb19c('0x25')]('%s_STATUS_MESSAGE',_0x5d36ef),_0x104d33[_0xb19c('0x72')]?_0x104d33[_0xb19c('0x72')]:'OK');if(_0x104d33[_0xb19c('0x66')]){try{this[_0xb19c('0x99')](_0x104d33[_0xb19c('0x66')],_0x5d36ef);}catch(_0x17a89b){logger[_0xb19c('0x27')](util[_0xb19c('0x25')](_0xb19c('0x187'),_0x5d36ef));}}return this['channel']['noop'](util[_0xb19c('0x25')](_0xb19c('0xda'),_0x5d36ef));};AGIVertices['prototype'][_0xb19c('0x188')]=function(_0x3ac5c5){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x189'),_0x3ac5c5[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0x18a')](_0x3ac5c5['digits'][_0xb19c('0x53')](/\s+/g,''),_0x3ac5c5[_0xb19c('0x181')]);};AGIVertices['prototype'][_0xb19c('0x18b')]=function(_0x28e40c){logger[_0xb19c('0x29')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x28e40c[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0x18c')](_0x28e40c[_0xb19c('0x61')][_0xb19c('0x53')](/\s+/g,''),_0x28e40c[_0xb19c('0x181')]);};AGIVertices[_0xb19c('0x10')][_0xb19c('0x18d')]=function(_0x305673){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x18e'),_0x305673[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0x18f')](_0x305673[_0xb19c('0x57')],_0x305673['escape_digits']);};AGIVertices[_0xb19c('0x10')]['sendMail']=function(_0x12b2a7){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x190'),_0x12b2a7['label']));if(!this[_0xb19c('0x80')](_0x12b2a7[_0xb19c('0x191')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')]('no\x20mail\x20account\x20configured');}var _0xb02a7a=this[_0xb19c('0x1e')][_0xb19c('0x6c')](this,_0x12b2a7[_0xb19c('0x191')]);if(!_0xb02a7a||!_0xb02a7a[_0xb19c('0x192')]){return this[_0xb19c('0xa')]['error'](_0x12b2a7,_0xb19c('0x193'));}var _0x30ed8b={'from':util[_0xb19c('0x25')](_0xb19c('0x194'),_0xb02a7a[_0xb19c('0x16')],_0xb02a7a[_0xb19c('0x195')]||_0xb02a7a[_0xb19c('0x192')]['user']),'to':_0x12b2a7['to']||'','cc':_0x12b2a7['cc']||'','bcc':_0x12b2a7[_0xb19c('0x196')]||'','subject':_0x12b2a7[_0xb19c('0x197')],'html':_0x12b2a7[_0xb19c('0x57')],'text':_0x12b2a7[_0xb19c('0x57')]};if(this[_0xb19c('0x80')](_0x12b2a7[_0xb19c('0x198')])){}logger[_0xb19c('0xdc')](_0xb19c('0x199'),JSON[_0xb19c('0x6f')](_0x30ed8b));this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x12b2a7,_0x12b2a7[_0xb19c('0x191')]);this[_0xb19c('0xa')][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x19a'),_0xb02a7a[_0xb19c('0x16')]));this[_0xb19c('0x20')][_0xb19c('0x6c')](this,_0xb02a7a[_0xb19c('0x19b')],_0x30ed8b);return this[_0xb19c('0xa')][_0xb19c('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xb19c('0x10')][_0xb19c('0x19c')]=function(_0x26ebad){logger['info'](util[_0xb19c('0x25')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x26ebad[_0xb19c('0x33')]));return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x19d'));};AGIVertices[_0xb19c('0x10')]['sendSMS']=function(_0x5db373){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5db373[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x5db373[_0xb19c('0x19e')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x19f'));}var _0x3a299f=this[_0xb19c('0x2f')][_0xb19c('0x6c')](this,_0x5db373['sms_account_id']);if(!_0x3a299f){return this['channel']['error'](_0x5db373,_0xb19c('0x1a0'));}var _0x11ecb8={'body':_0x5db373[_0xb19c('0x1a1')],'phone':_0x5db373['to']||'','SmsAccountId':_0x3a299f['id']};logger[_0xb19c('0xdc')]('sendSMS\x20message',JSON['stringify'](_0x11ecb8));this[_0xb19c('0x31')]['sync'](this,_0x5db373,_0x5db373[_0xb19c('0x19e')]);this['channel'][_0xb19c('0xa4')](util['format'](_0xb19c('0x1a2'),_0x3a299f[_0xb19c('0x16')]));this[_0xb19c('0x30')]['sync'](this,_0x11ecb8);return this[_0xb19c('0xa')][_0xb19c('0xa4')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1a3')]=function(_0x3061af){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x1a4'),_0x3061af[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x3061af['variable_id'])){return this['channel'][_0xb19c('0x27')](_0x3061af,_0xb19c('0x1a5'));}var _0x39b616=this['getVariable'][_0xb19c('0x6c')](this,_0x3061af['variable_id']);if(!_0x39b616){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x3061af,_0xb19c('0xd5'));}return this[_0xb19c('0xa')][_0xb19c('0x9a')](_0x39b616,_0x3061af[_0xb19c('0x1a6')]);};AGIVertices[_0xb19c('0x10')]['start']=function(_0x48ce79){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x1a7'),_0x48ce79[_0xb19c('0x33')]));this['channel'][_0xb19c('0xa4')](_0xb19c('0x1a8'));if(_0x48ce79[_0xb19c('0xb6')]===_0xb19c('0x1a9')){this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x1aa'));return this['channel'][_0xb19c('0xb6')]();}return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0x1ab'));};AGIVertices[_0xb19c('0x10')]['subproject']=function(_0xf28e53){logger['info'](util[_0xb19c('0x25')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xf28e53[_0xb19c('0x33')]));if(!this['isConfigured'](_0xf28e53[_0xb19c('0x1ac')])){return this['channel'][_0xb19c('0x27')](_0xf28e53,_0xb19c('0x1ad'));}var _0x11d9ef=this[_0xb19c('0x14')][_0xb19c('0x6c')](this,_0xf28e53['project_id']);if(!this[_0xb19c('0x80')](_0x11d9ef)){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0xf28e53,util[_0xb19c('0x25')](_0xb19c('0x1ae'),_0xf28e53[_0xb19c('0x1ac')]));}if(_0x11d9ef===this[_0xb19c('0xa')]['arg_1']){return this['channel'][_0xb19c('0x27')](_0xf28e53,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xb19c('0x31')]['sync'](this,_0xf28e53,_0x11d9ef);var _0xac5e4c=this[_0xb19c('0xa')][_0xb19c('0x51')]('AGI',util[_0xb19c('0x25')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xb19c('0xb3')]['host']||_0xb19c('0x1af'),_0x11d9ef,this[_0xb19c('0xa')][_0xb19c('0x35')]));if(_0xac5e4c['result']===-0x1){return _0xac5e4c;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xc0'),_0xb19c('0x1b0'),_0x11d9ef));};AGIVertices['prototype'][_0xb19c('0x1b1')]=function(_0x4a4b2f){logger[_0xb19c('0x29')](util['format'](_0xb19c('0x1b2'),_0x4a4b2f[_0xb19c('0x33')]));var _0x31d51c=this[_0xb19c('0x50')][_0xb19c('0x6c')](this,_0x4a4b2f[_0xb19c('0x1b3')]);this[_0xb19c('0x31')][_0xb19c('0x6c')](this,_0x4a4b2f,_0x4a4b2f[_0xb19c('0x1b3')]);if(this[_0xb19c('0x80')](_0x4a4b2f[_0xb19c('0xd3')])){var _0x4188e6=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x4a4b2f[_0xb19c('0xd3')]);if(_0x4188e6){this['channel'][_0xb19c('0x9a')](_0x4188e6,_0x31d51c);return this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x4a4b2f['command'],_0x4188e6));}}return this['channel'][_0xb19c('0xa4')](util['format'](_0xb19c('0x1b4'),_0x4a4b2f['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x313bbb){logger['info'](util[_0xb19c('0x25')](_0xb19c('0x1b5'),_0x313bbb['label']));_0x313bbb[_0xb19c('0x57')]=_0x313bbb[_0xb19c('0x57')][_0xb19c('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb19c('0x80')](_0x313bbb['apiKey'])){return this['channel'][_0xb19c('0xa4')](_0xb19c('0x1b6'));}if(!this[_0xb19c('0x80')](_0x313bbb[_0xb19c('0x57')])){return this['channel'][_0xb19c('0xa4')](_0xb19c('0xa5'));}this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0x1b7'),_0x313bbb[_0xb19c('0x57')]));var _0x3c4b37=this[_0xb19c('0x54')][_0xb19c('0x6c')](this,_0x313bbb);if(_0x3c4b37){this['channel'][_0xb19c('0xa4')](util['format'](_0xb19c('0x1b8'),_0x3c4b37));var _0x55bedf=this[_0xb19c('0xa')]['streamFile'](_0x3c4b37);try{fs['unlink'](_0x3c4b37+'.wav');}catch(_0xcb674b){logger[_0xb19c('0x27')](_0xcb674b);}return _0x55bedf;}return this[_0xb19c('0xa')]['error'](_0x313bbb,_0xb19c('0x1b9'));};AGIVertices['prototype'][_0xb19c('0x1ba')]=function(_0x2a1004){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x1bb'),_0x2a1004[_0xb19c('0x33')]));_0x2a1004[_0xb19c('0x57')]=_0x2a1004[_0xb19c('0x57')][_0xb19c('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2a1004[_0xb19c('0x57')])){return this[_0xb19c('0xa')][_0xb19c('0xa4')](_0xb19c('0xa5'));}this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x1bc'),_0x2a1004['text']));var _0x43686d=this[_0xb19c('0x5c')][_0xb19c('0x6c')](this,_0x2a1004);if(_0x43686d){this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0x1bd'),_0x43686d));var _0x39d18a=this[_0xb19c('0xa')][_0xb19c('0x101')](_0x43686d);try{fs['unlink'](_0x43686d+_0xb19c('0x103'));}catch(_0x4ae292){logger[_0xb19c('0x27')](_0x4ae292);}return _0x39d18a;}return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x2a1004,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1be')]=function(_0x1da553){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x1bf'),_0x1da553[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x1da553[_0xb19c('0x15b')])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x1da553,_0xb19c('0x15c'));}logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x15d'),this[_0xb19c('0xa')]['callerid'],_0x1da553['findBy']));var _0x1e8df9=this[_0xb19c('0x4b')][_0xb19c('0x6c')](this,_0x1da553[_0xb19c('0x15b')]);if(_0x1e8df9){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb19c('0xa')][_0xb19c('0x36')],_0x1da553[_0xb19c('0x15b')]));this['channel'][_0xb19c('0xa4')](util[_0xb19c('0x25')](_0xb19c('0x15e'),this[_0xb19c('0xa')][_0xb19c('0x36')],_0x1da553[_0xb19c('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1da553[_0xb19c('0x15b')]));this[_0xb19c('0xa')]['noop'](util[_0xb19c('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb19c('0xa')]['callerid'],_0x1da553['findBy']));return{'code':0xc8,'result':_0xb19c('0x160')};}};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1c0')]=function(_0x5e013f){logger[_0xb19c('0x29')](util[_0xb19c('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5e013f['label']));var _0x385d15=this[_0xb19c('0xa')][_0xb19c('0x51')](_0xb19c('0x1c1'),[_0x5e013f[_0xb19c('0x1c2')],_0x5e013f[_0xb19c('0x74')]]);if(_0x385d15['result']===-0x1){return _0x385d15;}return this[_0xb19c('0xa')][_0xb19c('0xa4')](util['format'](_0xb19c('0xc0'),'VOICEMAIL',_0x5e013f['mailbox']));};AGIVertices[_0xb19c('0x10')][_0xb19c('0x1c3')]=function(_0x32db49){logger[_0xb19c('0x29')](util[_0xb19c('0x25')](_0xb19c('0x1c4'),_0x32db49[_0xb19c('0x33')]));if(!this[_0xb19c('0x80')](_0x32db49[_0xb19c('0xd3')])){return this[_0xb19c('0xa')][_0xb19c('0x27')](_0x32db49,_0xb19c('0x1a5'));}var _0x55fc04=this[_0xb19c('0xd')][_0xb19c('0x6c')](this,_0x32db49['variable_id']);if(!_0x55fc04){return this[_0xb19c('0xa')]['error'](_0x32db49,_0xb19c('0xd5'));}var _0x4aff76=this[_0xb19c('0xa')][_0xb19c('0xd')](_0x55fc04);return{'code':0xc8,'result':_0x4aff76['extra']?_0x4aff76['extra']:'-'};};String[_0xb19c('0x10')][_0xb19c('0x1c5')]=function(_0x19ebc8,_0x393336){return this['split'](_0x19ebc8)[_0xb19c('0x1c6')](_0x393336);};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 dc1de66..3643d03 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 _0xed86=['syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','message','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s'];(function(_0x11ad93,_0x49306a){var _0x50535e=function(_0x30b454){while(--_0x30b454){_0x11ad93['push'](_0x11ad93['shift']());}};_0x50535e(++_0x49306a);}(_0xed86,0xb2));var _0x6ed8=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xed86[_0x2d8fc2];return _0x3a9e53;};'use strict';var util=require(_0x6ed8('0x0'));var _=require('lodash');var moment=require(_0x6ed8('0x1'));var ami=require(_0x6ed8('0x2'));var logger=require(_0x6ed8('0x3'))('acw');var RpcUser=require(_0x6ed8('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x519783){this[_0x6ed8('0x5')]=_0x519783[_0x6ed8('0x5')];this[_0x6ed8('0x6')]=_0x519783[_0x6ed8('0x6')];this['timers']=_0x519783['timers'];this['channels']={};ami['on'](_0x6ed8('0x7'),this[_0x6ed8('0x8')][_0x6ed8('0x9')](this));ami['on'](_0x6ed8('0xa'),this[_0x6ed8('0xb')][_0x6ed8('0x9')](this));ami['on']('hangup',this[_0x6ed8('0xc')][_0x6ed8('0x9')](this));ami['on'](_0x6ed8('0xd'),this['syncAgentRingNoAnswer'][_0x6ed8('0x9')](this));ami['on'](_0x6ed8('0xe'),this[_0x6ed8('0xf')][_0x6ed8('0x9')](this));ami['on'](_0x6ed8('0x10'),this[_0x6ed8('0x11')][_0x6ed8('0x9')](this));ami['on'](_0x6ed8('0x12'),this[_0x6ed8('0x13')][_0x6ed8('0x9')](this));}function getDiff(_0x4c29d7){var _0x5ef8aa=moment()[_0x6ed8('0x14')](0x0);var _0x4bb0b3=moment(_0x4c29d7)[_0x6ed8('0x14')](0x0);return _0x5ef8aa['diff'](_0x4bb0b3,_0x6ed8('0x15'));}Acw[_0x6ed8('0x16')]['startAcw']=function(_0x460c4d){try{var _0x3cc28d=this;var _0x123f28=this[_0x6ed8('0x17')][_0x460c4d][_0x6ed8('0x18')];var _0x4e9cd8=this[_0x6ed8('0x17')][_0x460c4d]['queue'];var _0x17bd63=this['voiceQueues'][_0x4e9cd8];var _0x224372=![];var _0x434cde=_0x6ed8('0x19');if(_0x17bd63[_0x6ed8('0x1a')]){if(_0x17bd63[_0x6ed8('0x1b')][_0x6ed8('0x1c')]){_0x224372=!![];_0x434cde=_0x17bd63['mandatoryDispositionPause'][_0x6ed8('0x1c')];}}ami[_0x6ed8('0x1d')]({'action':_0x6ed8('0x1e'),'interface':_0x123f28,'paused':!![],'reason':_0x434cde})[_0x6ed8('0x1f')](function(_0x513450){if(_0x3cc28d['agents'][_0x123f28]){return RpcUser[_0x6ed8('0x20')](_0x3cc28d[_0x6ed8('0x6')][_0x123f28]['id'])['then'](function(_0x451bb6){if(_0x451bb6&&!_0x451bb6[_0x6ed8('0x21')]){logger[_0x6ed8('0x22')](_0x6ed8('0x23'),_0x460c4d,_0x123f28,_0x4e9cd8);var _0x4562cd=_0x3cc28d[_0x6ed8('0x17')][_0x460c4d]['attended']&&_0x3cc28d['channels'][_0x460c4d][_0x6ed8('0x24')]?_0x3cc28d[_0x6ed8('0x17')][_0x460c4d][_0x6ed8('0x24')]:_0x460c4d;return RpcUser[_0x6ed8('0x25')](_0x3cc28d[_0x6ed8('0x6')][_0x123f28],_0x434cde,_0x4562cd)[_0x6ed8('0x1f')](function(_0x4a8274){if(!_0x224372){_0x3cc28d[_0x6ed8('0x26')][_0x123f28]={};logger['info'](_0x6ed8('0x27'),_0x460c4d,_0x3cc28d[_0x6ed8('0x5')][_0x4e9cd8]['acwTimeout'],_0x123f28,_0x4e9cd8);_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x28')]=setTimeout(_0x3cc28d['stopAcw'][_0x6ed8('0x9')](_0x3cc28d,_0x123f28),_0x3cc28d[_0x6ed8('0x5')][_0x4e9cd8][_0x6ed8('0x29')]*0x3e8);_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x2a')]=moment()[_0x6ed8('0x2b')](_0x6ed8('0x2c'));_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x2d')]=_0x460c4d;_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x2e')]=_0x4e9cd8;_0x3cc28d[_0x6ed8('0x26')][_0x123f28]['updateAcw']=function(){var _0x4b29ae=getDiff(_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x2a')]);clearTimeout(_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x28')]);_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x4b29ae},_0x3cc28d[_0x6ed8('0x26')][_0x123f28][_0x6ed8('0x2d')],_0x123f28)[_0x6ed8('0x1f')](function(_0x591311){logger[_0x6ed8('0x22')](_0x6ed8('0x2f'),_0x460c4d,_0x4b29ae,_0x591311);})[_0x6ed8('0x30')](function(_0x39d53a){logger['error'](_0x6ed8('0x31'),_0x460c4d,_0x39d53a);});delete _0x3cc28d[_0x6ed8('0x26')][_0x123f28];};}});}else{logger[_0x6ed8('0x22')](_0x6ed8('0x32'),_0x460c4d,_0x123f28,_0x4e9cd8);}});}})[_0x6ed8('0x30')](function(_0x4542dc){logger[_0x6ed8('0x33')](_0x6ed8('0x27'),_0x460c4d,_0x3cc28d['voiceQueues'][_0x4e9cd8][_0x6ed8('0x29')],_0x123f28,_0x4e9cd8);})['finally'](function(){delete _0x3cc28d['channels'][_0x460c4d];});}catch(_0x577e91){logger[_0x6ed8('0x33')](_0x6ed8('0x34'),_0x577e91['message']);}};Acw['prototype']['stopAcw']=function(_0x6c6482){try{var _0x2dc1bb=this;if(_0x2dc1bb[_0x6ed8('0x26')][_0x6c6482]){_0x2dc1bb[_0x6ed8('0x26')][_0x6c6482][_0x6ed8('0x28')]=![];var _0x23f8a9=_0x2dc1bb[_0x6ed8('0x26')][_0x6c6482]['uniqueid'];var _0x3245d6=_0x2dc1bb[_0x6ed8('0x26')][_0x6c6482][_0x6ed8('0x2e')];var _0x58032d=_0x2dc1bb[_0x6ed8('0x5')][_0x3245d6][_0x6ed8('0x29')];logger[_0x6ed8('0x22')](_0x6ed8('0x35'),_0x23f8a9,_0x6c6482);RpcUser[_0x6ed8('0x36')](this[_0x6ed8('0x6')][_0x6c6482]);RpcVoiceAgentReport[_0x6ed8('0x37')]({'acwtime':_0x58032d,'agentacw':!![]},_0x23f8a9,_0x6c6482)[_0x6ed8('0x1f')](function(_0x4ef793){logger[_0x6ed8('0x22')](_0x6ed8('0x2f'),_0x23f8a9,_0x58032d,_0x4ef793);})[_0x6ed8('0x30')](function(_0x5eec54){logger[_0x6ed8('0x33')](_0x6ed8('0x31'),_0x23f8a9,_0x5eec54);});}else{logger[_0x6ed8('0x33')](_0x6ed8('0x38'),_0x6c6482);if(_0x2dc1bb['timers']){logger['info'](_0x6ed8('0x39'),JSON[_0x6ed8('0x3a')](_0x2dc1bb[_0x6ed8('0x26')]));}}}catch(_0x248d2c){logger['error'](_0x6ed8('0x3b'),_0x248d2c['message']);}};Acw[_0x6ed8('0x16')]['syncAgentConnect']=function(_0x5296b2){try{if(this['voiceQueues'][_0x5296b2['queue']]&&(this[_0x6ed8('0x5')][_0x5296b2[_0x6ed8('0x2e')]][_0x6ed8('0x3c')]||this[_0x6ed8('0x5')][_0x5296b2['queue']][_0x6ed8('0x1a')])){if(this[_0x6ed8('0x6')][_0x5296b2[_0x6ed8('0x18')]]){this[_0x6ed8('0x17')][_0x5296b2['uniqueid']]={'queue':_0x5296b2[_0x6ed8('0x2e')],'interface':_0x5296b2[_0x6ed8('0x18')],'destlinkedid':_0x5296b2[_0x6ed8('0x24')]};}}}catch(_0x49ef3b){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x49ef3b[_0x6ed8('0x3d')]);}};Acw[_0x6ed8('0x16')][_0x6ed8('0x13')]=function(_0x13582e){try{if(this[_0x6ed8('0x5')][_0x13582e[_0x6ed8('0x2e')]]&&(this[_0x6ed8('0x5')][_0x13582e[_0x6ed8('0x2e')]][_0x6ed8('0x3c')]||this[_0x6ed8('0x5')][_0x13582e[_0x6ed8('0x2e')]][_0x6ed8('0x1a')])){if(this['agents'][_0x13582e[_0x6ed8('0x18')]]){this['channels'][_0x13582e[_0x6ed8('0x2d')]]={'queue':_0x13582e['queue'],'interface':_0x13582e[_0x6ed8('0x18')]};}}}catch(_0xf01e4a){logger[_0x6ed8('0x33')](_0x6ed8('0x3e'),_0xf01e4a['message']);}};Acw[_0x6ed8('0x16')][_0x6ed8('0xb')]=function(_0x33d15b){try{if(this['channels'][_0x33d15b[_0x6ed8('0x2d')]]&&_[_0x6ed8('0x3f')](this[_0x6ed8('0x17')][_0x33d15b[_0x6ed8('0x2d')]][_0x6ed8('0x40')])){logger[_0x6ed8('0x22')]('[%s][HANGUP:UNIQUEID]',_0x33d15b[_0x6ed8('0x2d')]);this[_0x6ed8('0x41')](_0x33d15b['uniqueid']);}else if(this['channels'][_0x33d15b[_0x6ed8('0x42')]]&&_['isUndefined'](this[_0x6ed8('0x17')][_0x33d15b['linkedid']][_0x6ed8('0x40')])){logger['info'](_0x6ed8('0x43'),_0x33d15b['linkedid']);this[_0x6ed8('0x41')](_0x33d15b[_0x6ed8('0x42')]);}}catch(_0x207dbb){logger[_0x6ed8('0x33')](_0x6ed8('0x44'),_0x207dbb[_0x6ed8('0x3d')]);}};Acw[_0x6ed8('0x16')][_0x6ed8('0xc')]=function(_0x244161){try{if(this['channels'][_0x244161[_0x6ed8('0x2d')]]&&this[_0x6ed8('0x17')][_0x244161['uniqueid']][_0x6ed8('0x40')]){logger['info'](_0x6ed8('0x45'),_0x244161[_0x6ed8('0x2d')]);this[_0x6ed8('0x41')](_0x244161[_0x6ed8('0x2d')]);}else if(this[_0x6ed8('0x17')][_0x244161[_0x6ed8('0x42')]]&&this[_0x6ed8('0x17')][_0x244161[_0x6ed8('0x42')]][_0x6ed8('0x40')]){logger[_0x6ed8('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x244161['linkedid']);this[_0x6ed8('0x41')](_0x244161['linkedid']);}}catch(_0x2b45ee){logger[_0x6ed8('0x33')](_0x6ed8('0x46'),_0x2b45ee[_0x6ed8('0x3d')]);}};Acw['prototype'][_0x6ed8('0xf')]=function(_0x3d0510){try{if(!_[_0x6ed8('0x47')](this['channels'][_0x3d0510['transfereeuniqueid']])){this[_0x6ed8('0x41')](_0x3d0510[_0x6ed8('0x48')]);if(this[_0x6ed8('0x17')][_0x3d0510['secondtransfereruniqueid']]){this[_0x6ed8('0x17')][_0x3d0510['secondtransfereruniqueid']]['attended']=!![];this[_0x6ed8('0x17')][_0x3d0510['transfertargetuniqueid']]=this[_0x6ed8('0x17')][_0x3d0510['secondtransfereruniqueid']];delete this['channels'][_0x3d0510['secondtransfereruniqueid']];}}else if(!_[_0x6ed8('0x47')](this[_0x6ed8('0x17')][_0x3d0510['transfertargetuniqueid']])){this['startAcw'](_0x3d0510[_0x6ed8('0x49')]);if(this[_0x6ed8('0x17')][_0x3d0510[_0x6ed8('0x4a')]]){this[_0x6ed8('0x17')][_0x3d0510[_0x6ed8('0x4a')]][_0x6ed8('0x40')]=!![];this[_0x6ed8('0x17')][_0x3d0510['transfereeuniqueid']]=this['channels'][_0x3d0510[_0x6ed8('0x4a')]];delete this[_0x6ed8('0x17')][_0x3d0510[_0x6ed8('0x4a')]];}}}catch(_0x299d24){logger[_0x6ed8('0x33')](_0x6ed8('0x4b'),_0x299d24['message']);}};Acw[_0x6ed8('0x16')][_0x6ed8('0x11')]=function(_0x136b93){try{if(this[_0x6ed8('0x17')][_0x136b93[_0x6ed8('0x4c')]]){logger[_0x6ed8('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6ed8('0x3a')](_0x136b93[_0x6ed8('0x4c')]));this[_0x6ed8('0x41')](_0x136b93['transfereruniqueid']);}else if(this[_0x6ed8('0x17')][_0x136b93[_0x6ed8('0x4d')]]){logger[_0x6ed8('0x22')](_0x6ed8('0x4e'),JSON[_0x6ed8('0x3a')](_0x136b93[_0x6ed8('0x4d')]));this['startAcw'](_0x136b93[_0x6ed8('0x4d')]);}}catch(_0x406a68){logger['error'](_0x6ed8('0x4f'),_0x406a68['message']);}};Acw['prototype'][_0x6ed8('0x50')]=function(_0x56dfb2){try{if(this[_0x6ed8('0x5')][_0x56dfb2['queue']]&&this[_0x6ed8('0x5')][_0x56dfb2['queue']][_0x6ed8('0x51')]===_0x6ed8('0x52')){if(this[_0x6ed8('0x6')][_0x56dfb2[_0x6ed8('0x18')]]){logger[_0x6ed8('0x22')](_0x6ed8('0x53'),_0x56dfb2[_0x6ed8('0x2d')],_0x56dfb2[_0x6ed8('0x18')],_0x56dfb2['queue']);return RpcUser[_0x6ed8('0x25')](this[_0x6ed8('0x6')][_0x56dfb2[_0x6ed8('0x18')]],'Auto-Pause',_0x56dfb2[_0x6ed8('0x2d')]);}}}catch(_0x421091){logger[_0x6ed8('0x33')](_0x6ed8('0x54'),_0x421091['message']);}};module[_0x6ed8('0x55')]=Acw; \ No newline at end of file +var _0xf008=['syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../../../config/logger','acw','../rpc/user','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest'];(function(_0x5c4b6a,_0x3e4163){var _0x2dec05=function(_0x17017e){while(--_0x17017e){_0x5c4b6a['push'](_0x5c4b6a['shift']());}};_0x2dec05(++_0x3e4163);}(_0xf008,0xfc));var _0x8f00=function(_0x2108e1,_0x3e4423){_0x2108e1=_0x2108e1-0x0;var _0x2030d9=_0xf008[_0x2108e1];return _0x2030d9;};'use strict';var util=require(_0x8f00('0x0'));var _=require(_0x8f00('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x8f00('0x2'))(_0x8f00('0x3'));var RpcUser=require(_0x8f00('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x237452){this['voiceQueues']=_0x237452['voiceQueues'];this[_0x8f00('0x5')]=_0x237452['agents'];this[_0x8f00('0x6')]=_0x237452['timers'];this[_0x8f00('0x7')]={};ami['on'](_0x8f00('0x8'),this[_0x8f00('0x9')][_0x8f00('0xa')](this));ami['on'](_0x8f00('0xb'),this[_0x8f00('0xc')][_0x8f00('0xa')](this));ami['on'](_0x8f00('0xd'),this['syncHangup'][_0x8f00('0xa')](this));ami['on'](_0x8f00('0xe'),this[_0x8f00('0xf')][_0x8f00('0xa')](this));ami['on'](_0x8f00('0x10'),this[_0x8f00('0x11')]['bind'](this));ami['on'](_0x8f00('0x12'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x8f00('0x13'),this[_0x8f00('0x14')][_0x8f00('0xa')](this));}function getDiff(_0x3615d0){var _0x79e13=moment()[_0x8f00('0x15')](0x0);var _0x54a63c=moment(_0x3615d0)[_0x8f00('0x15')](0x0);return _0x79e13[_0x8f00('0x16')](_0x54a63c,_0x8f00('0x17'));}Acw[_0x8f00('0x18')][_0x8f00('0x19')]=function(_0x2742b3){try{var _0x27ef6a=this;var _0x40ed5c=this[_0x8f00('0x7')][_0x2742b3]['interface'];var _0x498a25=this[_0x8f00('0x7')][_0x2742b3]['queue'];var _0x47e4af=this[_0x8f00('0x1a')][_0x498a25];var _0x4fd20d=![];var _0x29533f=_0x8f00('0x1b');if(_0x47e4af[_0x8f00('0x1c')]){if(_0x47e4af['mandatoryDispositionPause']['name']){_0x4fd20d=!![];_0x29533f=_0x47e4af[_0x8f00('0x1d')][_0x8f00('0x1e')];}}ami[_0x8f00('0x1f')]({'action':_0x8f00('0x20'),'interface':_0x40ed5c,'paused':!![],'reason':_0x29533f})[_0x8f00('0x21')](function(_0xc95e4d){if(_0x27ef6a[_0x8f00('0x5')][_0x40ed5c]){return RpcUser['getAgent'](_0x27ef6a[_0x8f00('0x5')][_0x40ed5c]['id'])[_0x8f00('0x21')](function(_0x3f7f47){if(_0x3f7f47&&!_0x3f7f47['voicePause']){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x2742b3,_0x40ed5c,_0x498a25);var _0x121c51=_0x27ef6a['channels'][_0x2742b3]['attended']&&_0x27ef6a[_0x8f00('0x7')][_0x2742b3][_0x8f00('0x22')]?_0x27ef6a['channels'][_0x2742b3][_0x8f00('0x22')]:_0x2742b3;return RpcUser['savePause'](_0x27ef6a[_0x8f00('0x5')][_0x40ed5c],_0x29533f,_0x121c51)[_0x8f00('0x21')](function(_0x131809){if(!_0x4fd20d){_0x27ef6a[_0x8f00('0x6')][_0x40ed5c]={};logger[_0x8f00('0x23')](_0x8f00('0x24'),_0x2742b3,_0x27ef6a[_0x8f00('0x1a')][_0x498a25][_0x8f00('0x25')],_0x40ed5c,_0x498a25);_0x27ef6a['timers'][_0x40ed5c]['timer']=setTimeout(_0x27ef6a['stopAcw']['bind'](_0x27ef6a,_0x40ed5c),_0x27ef6a[_0x8f00('0x1a')][_0x498a25]['acwTimeout']*0x3e8);_0x27ef6a['timers'][_0x40ed5c][_0x8f00('0x26')]=moment()[_0x8f00('0x27')](_0x8f00('0x28'));_0x27ef6a[_0x8f00('0x6')][_0x40ed5c][_0x8f00('0x29')]=_0x2742b3;_0x27ef6a[_0x8f00('0x6')][_0x40ed5c][_0x8f00('0x2a')]=_0x498a25;_0x27ef6a[_0x8f00('0x6')][_0x40ed5c][_0x8f00('0x2b')]=function(){var _0x28374a=getDiff(_0x27ef6a[_0x8f00('0x6')][_0x40ed5c][_0x8f00('0x26')]);clearTimeout(_0x27ef6a[_0x8f00('0x6')][_0x40ed5c][_0x8f00('0x2c')]);_0x27ef6a[_0x8f00('0x6')][_0x40ed5c]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x28374a},_0x27ef6a[_0x8f00('0x6')][_0x40ed5c]['uniqueid'],_0x40ed5c)[_0x8f00('0x21')](function(_0x214e1d){logger[_0x8f00('0x23')](_0x8f00('0x2d'),_0x2742b3,_0x28374a,_0x214e1d);})[_0x8f00('0x2e')](function(_0x39f26e){logger[_0x8f00('0x2f')](_0x8f00('0x30'),_0x2742b3,_0x39f26e);});delete _0x27ef6a['timers'][_0x40ed5c];};}});}else{logger[_0x8f00('0x23')](_0x8f00('0x31'),_0x2742b3,_0x40ed5c,_0x498a25);}});}})[_0x8f00('0x2e')](function(_0x36aa45){logger['error'](_0x8f00('0x24'),_0x2742b3,_0x27ef6a[_0x8f00('0x1a')][_0x498a25][_0x8f00('0x25')],_0x40ed5c,_0x498a25);})[_0x8f00('0x32')](function(){delete _0x27ef6a[_0x8f00('0x7')][_0x2742b3];});}catch(_0x32a9ab){logger['error']('[ACW][START]\x20%s',_0x32a9ab['message']);}};Acw[_0x8f00('0x18')][_0x8f00('0x33')]=function(_0x233762){try{var _0x17f9ff=this;if(_0x17f9ff[_0x8f00('0x6')][_0x233762]){_0x17f9ff[_0x8f00('0x6')][_0x233762]['timer']=![];var _0x3a0bee=_0x17f9ff[_0x8f00('0x6')][_0x233762][_0x8f00('0x29')];var _0x574008=_0x17f9ff[_0x8f00('0x6')][_0x233762][_0x8f00('0x2a')];var _0x4905fb=_0x17f9ff[_0x8f00('0x1a')][_0x574008][_0x8f00('0x25')];logger[_0x8f00('0x23')](_0x8f00('0x34'),_0x3a0bee,_0x233762);RpcUser[_0x8f00('0x35')](this[_0x8f00('0x5')][_0x233762]);RpcVoiceAgentReport[_0x8f00('0x36')]({'acwtime':_0x4905fb,'agentacw':!![]},_0x3a0bee,_0x233762)[_0x8f00('0x21')](function(_0xc89637){logger[_0x8f00('0x23')](_0x8f00('0x2d'),_0x3a0bee,_0x4905fb,_0xc89637);})['catch'](function(_0x392e15){logger[_0x8f00('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x3a0bee,_0x392e15);});}else{logger[_0x8f00('0x2f')](_0x8f00('0x37'),_0x233762);if(_0x17f9ff[_0x8f00('0x6')]){logger['info'](_0x8f00('0x38'),JSON[_0x8f00('0x39')](_0x17f9ff[_0x8f00('0x6')]));}}}catch(_0x20d38a){logger['error'](_0x8f00('0x3a'),_0x20d38a[_0x8f00('0x3b')]);}};Acw[_0x8f00('0x18')][_0x8f00('0x9')]=function(_0x1c188b){try{if(this[_0x8f00('0x1a')][_0x1c188b[_0x8f00('0x2a')]]&&(this[_0x8f00('0x1a')][_0x1c188b[_0x8f00('0x2a')]]['acw']||this[_0x8f00('0x1a')][_0x1c188b[_0x8f00('0x2a')]]['mandatoryDisposition'])){if(this[_0x8f00('0x5')][_0x1c188b[_0x8f00('0x3c')]]){this['channels'][_0x1c188b['uniqueid']]={'queue':_0x1c188b[_0x8f00('0x2a')],'interface':_0x1c188b['interface'],'destlinkedid':_0x1c188b[_0x8f00('0x22')]};}}}catch(_0x4ef406){logger[_0x8f00('0x2f')](_0x8f00('0x3d'),_0x4ef406[_0x8f00('0x3b')]);}};Acw[_0x8f00('0x18')][_0x8f00('0x14')]=function(_0x287aea){try{if(this[_0x8f00('0x1a')][_0x287aea[_0x8f00('0x2a')]]&&(this[_0x8f00('0x1a')][_0x287aea[_0x8f00('0x2a')]][_0x8f00('0x3')]||this['voiceQueues'][_0x287aea[_0x8f00('0x2a')]][_0x8f00('0x1c')])){if(this[_0x8f00('0x5')][_0x287aea[_0x8f00('0x3c')]]){this[_0x8f00('0x7')][_0x287aea['uniqueid']]={'queue':_0x287aea[_0x8f00('0x2a')],'interface':_0x287aea[_0x8f00('0x3c')]};}}}catch(_0x45819d){logger[_0x8f00('0x2f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x45819d['message']);}};Acw[_0x8f00('0x18')][_0x8f00('0xc')]=function(_0x5efc71){try{if(this[_0x8f00('0x7')][_0x5efc71['uniqueid']]&&_[_0x8f00('0x3e')](this['channels'][_0x5efc71[_0x8f00('0x29')]][_0x8f00('0x3f')])){logger[_0x8f00('0x23')](_0x8f00('0x40'),_0x5efc71[_0x8f00('0x29')]);this[_0x8f00('0x19')](_0x5efc71[_0x8f00('0x29')]);}else if(this['channels'][_0x5efc71[_0x8f00('0x41')]]&&_[_0x8f00('0x3e')](this['channels'][_0x5efc71['linkedid']]['attended'])){logger[_0x8f00('0x23')](_0x8f00('0x42'),_0x5efc71[_0x8f00('0x41')]);this[_0x8f00('0x19')](_0x5efc71[_0x8f00('0x41')]);}}catch(_0x29c7d8){logger[_0x8f00('0x2f')](_0x8f00('0x43'),_0x29c7d8[_0x8f00('0x3b')]);}};Acw[_0x8f00('0x18')][_0x8f00('0x44')]=function(_0x3cf2e7){try{if(this['channels'][_0x3cf2e7[_0x8f00('0x29')]]&&this[_0x8f00('0x7')][_0x3cf2e7[_0x8f00('0x29')]][_0x8f00('0x3f')]){logger[_0x8f00('0x23')](_0x8f00('0x45'),_0x3cf2e7[_0x8f00('0x29')]);this['startAcw'](_0x3cf2e7[_0x8f00('0x29')]);}else if(this['channels'][_0x3cf2e7[_0x8f00('0x41')]]&&this[_0x8f00('0x7')][_0x3cf2e7[_0x8f00('0x41')]][_0x8f00('0x3f')]){logger[_0x8f00('0x23')](_0x8f00('0x46'),_0x3cf2e7[_0x8f00('0x41')]);this[_0x8f00('0x19')](_0x3cf2e7[_0x8f00('0x41')]);}}catch(_0x408d3a){logger[_0x8f00('0x2f')](_0x8f00('0x47'),_0x408d3a['message']);}};Acw[_0x8f00('0x18')][_0x8f00('0x11')]=function(_0x19b227){try{if(!_[_0x8f00('0x48')](this[_0x8f00('0x7')][_0x19b227['transfereeuniqueid']])){this[_0x8f00('0x19')](_0x19b227[_0x8f00('0x49')]);if(this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4a')]]){this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4a')]][_0x8f00('0x3f')]=!![];this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4b')]]=this['channels'][_0x19b227['secondtransfereruniqueid']];delete this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4a')]];}}else if(!_[_0x8f00('0x48')](this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4b')]])){this[_0x8f00('0x19')](_0x19b227['transfertargetuniqueid']);if(this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4c')]]){this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4c')]][_0x8f00('0x3f')]=!![];this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x49')]]=this['channels'][_0x19b227[_0x8f00('0x4c')]];delete this[_0x8f00('0x7')][_0x19b227[_0x8f00('0x4c')]];}}}catch(_0x39435c){logger[_0x8f00('0x2f')](_0x8f00('0x4d'),_0x39435c[_0x8f00('0x3b')]);}};Acw[_0x8f00('0x18')][_0x8f00('0x4e')]=function(_0x199a00){try{if(this['channels'][_0x199a00[_0x8f00('0x4f')]]){logger[_0x8f00('0x23')](_0x8f00('0x50'),JSON[_0x8f00('0x39')](_0x199a00[_0x8f00('0x4f')]));this['startAcw'](_0x199a00[_0x8f00('0x4f')]);}else if(this['channels'][_0x199a00['transfererlinkedid']]){logger['info'](_0x8f00('0x51'),JSON[_0x8f00('0x39')](_0x199a00[_0x8f00('0x52')]));this['startAcw'](_0x199a00[_0x8f00('0x52')]);}}catch(_0x29cfba){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x29cfba[_0x8f00('0x3b')]);}};Acw[_0x8f00('0x18')][_0x8f00('0xf')]=function(_0x512d06){try{if(this[_0x8f00('0x1a')][_0x512d06[_0x8f00('0x2a')]]&&this[_0x8f00('0x1a')][_0x512d06[_0x8f00('0x2a')]][_0x8f00('0x53')]===_0x8f00('0x54')){if(this[_0x8f00('0x5')][_0x512d06['interface']]){logger[_0x8f00('0x23')](_0x8f00('0x55'),_0x512d06[_0x8f00('0x29')],_0x512d06['interface'],_0x512d06['queue']);return RpcUser['savePause'](this[_0x8f00('0x5')][_0x512d06['interface']],'Auto-Pause',_0x512d06['uniqueid']);}}}catch(_0x4fb588){logger[_0x8f00('0x2f')](_0x8f00('0x56'),_0x4fb588['message']);}};module[_0x8f00('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 6164400..bab329b 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 _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x44cbdc,_0x285518){var _0x302623=function(_0x153582){while(--_0x153582){_0x44cbdc['push'](_0x44cbdc['shift']());}};_0x302623(++_0x285518);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa03344,_0x581292){_0xa03344=_0xa03344-0x0;var _0x38acfd=_0x0b0e[_0xa03344];return _0x38acfd;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x9e7c9a,_0x4caa88){var _0x155ae5=function(_0x5c42ef){while(--_0x5c42ef){_0x9e7c9a['push'](_0x9e7c9a['shift']());}};_0x155ae5(++_0x4caa88);}(_0x757a,0xde));var _0xa757=function(_0x56164e,_0x341dc0){_0x56164e=_0x56164e-0x0;var _0x2d6c7a=_0x757a[_0x56164e];return _0x2d6c7a;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a548fcd..d5eb984 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x8d5fcc,_0x689ab3){var _0x23009a=function(_0x418e26){while(--_0x418e26){_0x8d5fcc['push'](_0x8d5fcc['shift']());}};_0x23009a(++_0x689ab3);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5e4a9c,_0x2c0d9b){_0x5e4a9c=_0x5e4a9c-0x0;var _0x7f3c28=_0xbdb7[_0x5e4a9c];return _0x7f3c28;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x70e0,0x17b));var _0x070e=function(_0x599426,_0x13ca9f){_0x599426=_0x599426-0x0;var _0x467e81=_0x70e0[_0x599426];return _0x467e81;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f531099..79cbc04 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 _0x1ffa=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','dialCutDigit','substring','exports','util','moment','string','isNil','voiceQueue','uniqueid','Contact','phone','firstName','number','queue','name','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x1ec1fa,_0x3efb52){var _0x3e00f0=function(_0x5f2489){while(--_0x5f2489){_0x1ec1fa['push'](_0x1ec1fa['shift']());}};_0x3e00f0(++_0x3efb52);}(_0x1ffa,0x1bb));var _0xa1ff=function(_0x47bb39,_0x11ce8b){_0x47bb39=_0x47bb39-0x0;var _0x2e7f69=_0x1ffa[_0x47bb39];return _0x2e7f69;};'use strict';var util=require(_0xa1ff('0x0'));var _=require('lodash');var moment=require(_0xa1ff('0x1'));function checkNameSurname(_0x83fba1,_0x383a62,_0x3dbd8e){var _0x50b061='';if(!_['isNil'](_0x383a62)&&_0xa1ff('0x2')===typeof _0x383a62){_0x50b061+=_0x383a62;}if(!_[_0xa1ff('0x3')](_0x3dbd8e)&&'string'===typeof _0x3dbd8e){_0x50b061+='\x20'+_0x3dbd8e;}if(_0x50b061!==''){return _0x50b061;}return _0x83fba1;}function Action(_0x560e12,_0x2941d1,_0x6a3da8){this[_0xa1ff('0x4')]=_0x560e12;this[_0xa1ff('0x5')]=_0x6a3da8||undefined;this['name']=checkNameSurname(_0x2941d1[_0xa1ff('0x6')][_0xa1ff('0x7')],_0x2941d1['Contact'][_0xa1ff('0x8')],_0x2941d1[_0xa1ff('0x6')]['lastName']);this[_0xa1ff('0x9')]=_0x2941d1[_0xa1ff('0x6')]['phone'];this[_0xa1ff('0xa')]=_0x560e12[_0xa1ff('0xb')];this[_0xa1ff('0xc')]=_0x2941d1[_0xa1ff('0xc')]||![];this['type']=_0x560e12['type'];this['dialQueueTimeout']=_0x560e12[_0xa1ff('0xd')]||0x3;this[_0xa1ff('0xe')]=_0x2941d1['scheduledat'];this[_0xa1ff('0xf')]=_0x2941d1[_0xa1ff('0xf')];this[_0xa1ff('0x10')]=_0x2941d1['countcongestionretry'];this[_0xa1ff('0x11')]=_0x2941d1[_0xa1ff('0x11')];this[_0xa1ff('0x12')]=_0x2941d1[_0xa1ff('0x12')];this[_0xa1ff('0x13')]=_0x2941d1[_0xa1ff('0x13')];this[_0xa1ff('0x14')]=_0x2941d1['countabandonedretry'];this[_0xa1ff('0x15')]=_0x2941d1['countmachineretry'];this['countagentrejectretry']=_0x2941d1[_0xa1ff('0x16')];this['ContactId']=_0x2941d1[_0xa1ff('0x17')];this['ListId']=_0x2941d1[_0xa1ff('0x18')];this['UserId']=_0x2941d1[_0xa1ff('0x19')];this[_0xa1ff('0x1a')]=_0x2941d1[_0xa1ff('0x1a')];this[_0xa1ff('0x1b')]=_0x2941d1[_0xa1ff('0x1b')];this[_0xa1ff('0x1c')]=_0x2941d1['id'];this[_0xa1ff('0x1d')]=_0x2941d1[_0xa1ff('0x6')]['firstName']||'';this[_0xa1ff('0x1e')]=moment()[_0xa1ff('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa1ff('0x20')]=_0x2941d1[_0xa1ff('0x20')];this[_0xa1ff('0x21')]=_0x2941d1[_0xa1ff('0x21')];this[_0xa1ff('0x22')]=_0x2941d1[_0xa1ff('0x22')];this[_0xa1ff('0x23')]=_0x2941d1[_0xa1ff('0x23')];this[_0xa1ff('0x24')]='';this['originatecalleridname']='';}Action[_0xa1ff('0x25')][_0xa1ff('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xa1ff('0xb')],this[_0xa1ff('0x4')][_0xa1ff('0x27')]>0x0?this[_0xa1ff('0x9')][_0xa1ff('0x28')](this[_0xa1ff('0x4')][_0xa1ff('0x27')]):this[_0xa1ff('0x9')]);};Action[_0xa1ff('0x25')]['getQueue']=function(){return this[_0xa1ff('0xa')];};module[_0xa1ff('0x29')]=Action; \ No newline at end of file +var _0x1513=['dialCutDigit','substring','voiceQueue','getQueue','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x4dbd69,_0x48f9bb){var _0x336a56=function(_0x5b2463){while(--_0x5b2463){_0x4dbd69['push'](_0x4dbd69['shift']());}};_0x336a56(++_0x48f9bb);}(_0x1513,0x190));var _0x3151=function(_0x327de5,_0x249d2b){_0x327de5=_0x327de5-0x0;var _0x36f008=_0x1513[_0x327de5];return _0x36f008;};'use strict';var util=require(_0x3151('0x0'));var _=require(_0x3151('0x1'));var moment=require(_0x3151('0x2'));function checkNameSurname(_0x521b7c,_0x1df81e,_0x2c9599){var _0x4dab82='';if(!_[_0x3151('0x3')](_0x1df81e)&&_0x3151('0x4')===typeof _0x1df81e){_0x4dab82+=_0x1df81e;}if(!_[_0x3151('0x3')](_0x2c9599)&&_0x3151('0x4')===typeof _0x2c9599){_0x4dab82+='\x20'+_0x2c9599;}if(_0x4dab82!==''){return _0x4dab82;}return _0x521b7c;}function Action(_0x2abe3b,_0x42f51d,_0x992eda){this['voiceQueue']=_0x2abe3b;this[_0x3151('0x5')]=_0x992eda||undefined;this[_0x3151('0x6')]=checkNameSurname(_0x42f51d[_0x3151('0x7')][_0x3151('0x8')],_0x42f51d[_0x3151('0x7')]['firstName'],_0x42f51d[_0x3151('0x7')]['lastName']);this[_0x3151('0x9')]=_0x42f51d[_0x3151('0x7')][_0x3151('0x8')];this[_0x3151('0xa')]=_0x2abe3b['name'];this[_0x3151('0xb')]=_0x42f51d[_0x3151('0xb')]||![];this[_0x3151('0xc')]=_0x2abe3b[_0x3151('0xc')];this['dialQueueTimeout']=_0x2abe3b[_0x3151('0xd')]||0x3;this[_0x3151('0xe')]=_0x42f51d['scheduledat'];this[_0x3151('0xf')]=_0x42f51d[_0x3151('0xf')];this[_0x3151('0x10')]=_0x42f51d[_0x3151('0x10')];this[_0x3151('0x11')]=_0x42f51d['countnoanswerretry'];this[_0x3151('0x12')]=_0x42f51d[_0x3151('0x12')];this[_0x3151('0x13')]=_0x42f51d[_0x3151('0x13')];this['countabandonedretry']=_0x42f51d['countabandonedretry'];this[_0x3151('0x14')]=_0x42f51d['countmachineretry'];this[_0x3151('0x15')]=_0x42f51d[_0x3151('0x15')];this[_0x3151('0x16')]=_0x42f51d[_0x3151('0x16')];this[_0x3151('0x17')]=_0x42f51d['ListId'];this[_0x3151('0x18')]=_0x42f51d[_0x3151('0x18')];this[_0x3151('0x19')]=_0x42f51d['VoiceQueueId'];this[_0x3151('0x1a')]=_0x42f51d[_0x3151('0x1a')];this[_0x3151('0x1b')]=_0x42f51d['id'];this['ContactFirstName']=_0x42f51d[_0x3151('0x7')][_0x3151('0x1c')]||'';this[_0x3151('0x1d')]=moment()[_0x3151('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3151('0x1f')]=_0x42f51d[_0x3151('0x1f')];this['callbackuniqueid']=_0x42f51d[_0x3151('0x20')];this['callbackat']=_0x42f51d[_0x3151('0x21')];this[_0x3151('0x22')]=_0x42f51d['recallme'];this[_0x3151('0x23')]='';this[_0x3151('0x24')]='';}Action[_0x3151('0x25')][_0x3151('0x26')]=function(){return util[_0x3151('0x1e')](_0x3151('0x27'),this[_0x3151('0x6')],this['voiceQueue'][_0x3151('0x28')]>0x0?this[_0x3151('0x9')][_0x3151('0x29')](this[_0x3151('0x2a')]['dialCutDigit']):this[_0x3151('0x9')]);};Action[_0x3151('0x25')][_0x3151('0x2b')]=function(){return this[_0x3151('0xa')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f18868c..8db11b5 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 _0xc496=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','number','starttime'];(function(_0x472caf,_0x5c7dae){var _0x32f49b=function(_0x4fdee5){while(--_0x4fdee5){_0x472caf['push'](_0x472caf['shift']());}};_0x32f49b(++_0x5c7dae);}(_0xc496,0x1c2));var _0x6c49=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xc496[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x6c49('0x0'));var _=require(_0x6c49('0x1'));var moment=require(_0x6c49('0x2'));function getSeconds(_0x308adc,_0x57c717){var _0x49b7d8=moment(_0x308adc)[_0x6c49('0x3')](0x0);var _0x58c482=moment(_0x57c717)[_0x6c49('0x3')](0x0);return _0x49b7d8[_0x6c49('0x4')](_0x58c482,'seconds');}function AgentComplete(_0x3368f,_0x1f65fe){this['state']=0x4;this[_0x6c49('0x5')]=_0x6c49('0x6');this[_0x6c49('0x7')]=_0x3368f[_0x6c49('0x7')];this['type']=_0x3368f[_0x6c49('0x8')];this[_0x6c49('0x9')]=_0x3368f[_0x6c49('0x8')]===_0x6c49('0xa')?_0x6c49('0xb'):_0x3368f[_0x6c49('0x8')];this[_0x6c49('0xc')]=_0x3368f['countbusyretry'];this[_0x6c49('0xd')]=_0x3368f[_0x6c49('0xd')];this['countnoanswerretry']=_0x3368f['countnoanswerretry'];this[_0x6c49('0xe')]=_0x3368f[_0x6c49('0xc')]+_0x3368f[_0x6c49('0xd')]+_0x3368f['countnoanswerretry']+_0x3368f[_0x6c49('0xf')]+_0x3368f['countdropretry']+_0x3368f[_0x6c49('0x10')]+_0x3368f[_0x6c49('0x11')]+_0x3368f[_0x6c49('0x12')];this[_0x6c49('0xf')]=_0x3368f[_0x6c49('0xf')];this[_0x6c49('0x13')]=_0x3368f[_0x6c49('0x13')];this[_0x6c49('0x10')]=_0x3368f[_0x6c49('0x10')];this['countmachineretry']=_0x3368f['countmachineretry'];this[_0x6c49('0x12')]=_0x3368f[_0x6c49('0x12')];this[_0x6c49('0x14')]=_0x1f65fe[_0x6c49('0x14')];this['calleridname']=_0x3368f['name'];this['calleridnum']=_0x3368f[_0x6c49('0x15')];this['starttime']=_0x3368f[_0x6c49('0x16')];this[_0x6c49('0x17')]=_0x3368f[_0x6c49('0x17')];this[_0x6c49('0x18')]=_0x3368f[_0x6c49('0x18')];this[_0x6c49('0x19')]=moment()[_0x6c49('0x1a')](_0x6c49('0x1b'));this[_0x6c49('0x1c')]=getSeconds(_0x3368f[_0x6c49('0x17')],_0x3368f[_0x6c49('0x16')]);this['holdtime']=getSeconds(_0x3368f[_0x6c49('0x18')],_0x3368f[_0x6c49('0x17')]);this[_0x6c49('0x1d')]=getSeconds(this['endtime'],_0x3368f[_0x6c49('0x18')]);this[_0x6c49('0xb')]=_0x1f65fe[_0x6c49('0xb')];this['membername']=_0x1f65fe[_0x6c49('0x1e')];this['reason']=_0x1f65fe[_0x6c49('0x1f')];this[_0x6c49('0x20')]=_0x3368f[_0x6c49('0x20')];this[_0x6c49('0x21')]=_0x3368f[_0x6c49('0x21')];this[_0x6c49('0x22')]=_0x3368f[_0x6c49('0x22')];this[_0x6c49('0x23')]=_0x3368f[_0x6c49('0x23')];this[_0x6c49('0x24')]=_0x3368f[_0x6c49('0x24')];this[_0x6c49('0x25')]=_0x3368f[_0x6c49('0x25')];this[_0x6c49('0x26')]=_0x3368f[_0x6c49('0x26')];this[_0x6c49('0x27')]=_0x3368f[_0x6c49('0x27')];this[_0x6c49('0x28')]=_0x3368f[_0x6c49('0x28')];this[_0x6c49('0x29')]=_0x3368f[_0x6c49('0x29')]||'';this[_0x6c49('0x2a')]=_0x3368f[_0x6c49('0x2a')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xc3a9=['originatecalleridname','util','lodash','moment','milliseconds','diff','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0xc3a9,0xf7));var _0x9c3a=function(_0x1b6e91,_0x2e2367){_0x1b6e91=_0x1b6e91-0x0;var _0x2e395c=_0xc3a9[_0x1b6e91];return _0x2e395c;};'use strict';var util=require(_0x9c3a('0x0'));var _=require(_0x9c3a('0x1'));var moment=require(_0x9c3a('0x2'));function getSeconds(_0x277ca5,_0x3cd535){var _0x41efd6=moment(_0x277ca5)[_0x9c3a('0x3')](0x0);var _0x15be2a=moment(_0x3cd535)[_0x9c3a('0x3')](0x0);return _0x41efd6[_0x9c3a('0x4')](_0x15be2a,'seconds');}function AgentComplete(_0x392297,_0x44a28e){this['state']=0x4;this[_0x9c3a('0x5')]='Answer';this[_0x9c3a('0x6')]=_0x392297[_0x9c3a('0x6')];this[_0x9c3a('0x7')]=_0x392297[_0x9c3a('0x7')];this[_0x9c3a('0x8')]=_0x392297[_0x9c3a('0x7')]===_0x9c3a('0x9')?_0x9c3a('0xa'):_0x392297[_0x9c3a('0x7')];this[_0x9c3a('0xb')]=_0x392297[_0x9c3a('0xb')];this['countcongestionretry']=_0x392297[_0x9c3a('0xc')];this['countnoanswerretry']=_0x392297['countnoanswerretry'];this['countglobal']=_0x392297['countbusyretry']+_0x392297['countcongestionretry']+_0x392297[_0x9c3a('0xd')]+_0x392297[_0x9c3a('0xe')]+_0x392297['countdropretry']+_0x392297[_0x9c3a('0xf')]+_0x392297[_0x9c3a('0x10')]+_0x392297[_0x9c3a('0x11')];this[_0x9c3a('0xe')]=_0x392297['countnosuchnumberretry'];this[_0x9c3a('0x12')]=_0x392297['countdropretry'];this[_0x9c3a('0xf')]=_0x392297[_0x9c3a('0xf')];this[_0x9c3a('0x10')]=_0x392297[_0x9c3a('0x10')];this['countagentrejectretry']=_0x392297[_0x9c3a('0x11')];this[_0x9c3a('0x13')]=_0x44a28e[_0x9c3a('0x13')];this[_0x9c3a('0x14')]=_0x392297['name'];this[_0x9c3a('0x15')]=_0x392297['number'];this[_0x9c3a('0x16')]=_0x392297[_0x9c3a('0x16')];this['responsetime']=_0x392297[_0x9c3a('0x17')];this[_0x9c3a('0x18')]=_0x392297[_0x9c3a('0x18')];this[_0x9c3a('0x19')]=moment()['format'](_0x9c3a('0x1a'));this[_0x9c3a('0x1b')]=getSeconds(_0x392297[_0x9c3a('0x17')],_0x392297[_0x9c3a('0x16')]);this[_0x9c3a('0x1c')]=getSeconds(_0x392297[_0x9c3a('0x18')],_0x392297[_0x9c3a('0x17')]);this['talktime']=getSeconds(this['endtime'],_0x392297['answertime']);this[_0x9c3a('0xa')]=_0x44a28e['queue'];this[_0x9c3a('0x1d')]=_0x44a28e[_0x9c3a('0x1d')];this[_0x9c3a('0x1e')]=_0x44a28e[_0x9c3a('0x1e')];this[_0x9c3a('0x1f')]=_0x392297[_0x9c3a('0x1f')];this['callbackuniqueid']=_0x392297[_0x9c3a('0x20')];this[_0x9c3a('0x21')]=_0x392297[_0x9c3a('0x21')];this['recallme']=_0x392297['recallme'];this[_0x9c3a('0x22')]=_0x392297[_0x9c3a('0x22')];this[_0x9c3a('0x23')]=_0x392297[_0x9c3a('0x23')];this[_0x9c3a('0x24')]=_0x392297[_0x9c3a('0x24')];this[_0x9c3a('0x25')]=_0x392297[_0x9c3a('0x25')];this[_0x9c3a('0x26')]=_0x392297['CampaignId'];this[_0x9c3a('0x27')]=_0x392297[_0x9c3a('0x27')]||'';this[_0x9c3a('0x28')]=_0x392297[_0x9c3a('0x28')]||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 62365e0..c75c276 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 _0x4b19=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0x4b19,0x195));var _0x94b1=function(_0x4b5e9f,_0x2fbea9){_0x4b5e9f=_0x4b5e9f-0x0;var _0x2b1cf1=_0x4b19[_0x4b5e9f];return _0x2b1cf1;};'use strict';var util=require(_0x94b1('0x0'));var _=require('lodash');var moment=require(_0x94b1('0x1'));function getSeconds(_0x32f392,_0x221ab3){var _0x577f52=moment(_0x32f392)[_0x94b1('0x2')](0x0);var _0x3648ad=moment(_0x221ab3)[_0x94b1('0x2')](0x0);return _0x577f52['diff'](_0x3648ad,_0x94b1('0x3'));}function Final(_0x11e23c){this['uniqueid']=_0x11e23c[_0x94b1('0x4')];this[_0x94b1('0x5')]=_0x11e23c['scheduledat'];this[_0x94b1('0x6')]=_0x11e23c[_0x94b1('0x6')];this[_0x94b1('0x7')]=_0x11e23c['type']===_0x94b1('0x8')?'queue':_0x11e23c['type'];this[_0x94b1('0x9')]=_0x11e23c[_0x94b1('0x9')];this[_0x94b1('0xa')]=_0x11e23c[_0x94b1('0xa')];this[_0x94b1('0xb')]=_0x11e23c[_0x94b1('0xb')];this['countglobal']=_0x11e23c[_0x94b1('0x9')]+_0x11e23c[_0x94b1('0xa')]+_0x11e23c[_0x94b1('0xb')]+_0x11e23c[_0x94b1('0xc')]+_0x11e23c['countdropretry']+_0x11e23c['countabandonedretry']+_0x11e23c[_0x94b1('0xd')]+_0x11e23c[_0x94b1('0xe')];this['countnosuchnumberretry']=_0x11e23c['countnosuchnumberretry'];this[_0x94b1('0xf')]=_0x11e23c[_0x94b1('0xf')];this['countabandonedretry']=_0x11e23c[_0x94b1('0x10')];this['countmachineretry']=_0x11e23c['countmachineretry'];this[_0x94b1('0xe')]=_0x11e23c[_0x94b1('0xe')];this[_0x94b1('0x11')]=_0x11e23c[_0x94b1('0x11')];this['calleridname']=_0x11e23c[_0x94b1('0x12')];this[_0x94b1('0x13')]=_0x11e23c[_0x94b1('0x13')];this[_0x94b1('0x14')]=_0x11e23c[_0x94b1('0x14')];this[_0x94b1('0x15')]=_0x11e23c[_0x94b1('0x15')];this['endtime']=_0x11e23c[_0x94b1('0x15')];this[_0x94b1('0x16')]=_0x11e23c[_0x94b1('0x16')]||0x0;this['holdtime']=_0x11e23c[_0x94b1('0x17')]||0x0;this[_0x94b1('0x18')]=_0x11e23c['talktime']||0x0;this[_0x94b1('0x19')]=_0x11e23c[_0x94b1('0x19')];this[_0x94b1('0x1a')]=_0x11e23c[_0x94b1('0x1a')];this[_0x94b1('0x1b')]=_0x11e23c[_0x94b1('0x1b')];this[_0x94b1('0x1c')]=_0x11e23c[_0x94b1('0x1c')];this[_0x94b1('0x1d')]=_0x11e23c[_0x94b1('0x1d')];this['ListId']=_0x11e23c[_0x94b1('0x1e')];this[_0x94b1('0x1f')]=_0x11e23c[_0x94b1('0x1f')];this['VoiceQueueId']=_0x11e23c[_0x94b1('0x20')];this['CampaignId']=_0x11e23c[_0x94b1('0x21')];this[_0x94b1('0x22')]=_0x11e23c[_0x94b1('0x22')]||'';this[_0x94b1('0x23')]=_0x11e23c['originatecalleridname']||'';}module['exports']=Final; \ No newline at end of file +var _0xb138=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','queue','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackat'];(function(_0x4aaaa1,_0x5734d2){var _0x20c50b=function(_0x4568cd){while(--_0x4568cd){_0x4aaaa1['push'](_0x4aaaa1['shift']());}};_0x20c50b(++_0x5734d2);}(_0xb138,0x1dd));var _0x8b13=function(_0x28a338,_0x69a8eb){_0x28a338=_0x28a338-0x0;var _0x17453f=_0xb138[_0x28a338];return _0x17453f;};'use strict';var util=require(_0x8b13('0x0'));var _=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));function getSeconds(_0x33f214,_0xadad70){var _0x185752=moment(_0x33f214)[_0x8b13('0x3')](0x0);var _0x5369d4=moment(_0xadad70)[_0x8b13('0x3')](0x0);return _0x185752[_0x8b13('0x4')](_0x5369d4,_0x8b13('0x5'));}function Final(_0x5ae5b2){this[_0x8b13('0x6')]=_0x5ae5b2[_0x8b13('0x6')];this['scheduledat']=_0x5ae5b2[_0x8b13('0x7')];this[_0x8b13('0x8')]=_0x5ae5b2[_0x8b13('0x8')];this['campaigntype']=_0x5ae5b2[_0x8b13('0x8')]===_0x8b13('0x9')?'queue':_0x5ae5b2['type'];this[_0x8b13('0xa')]=_0x5ae5b2[_0x8b13('0xa')];this[_0x8b13('0xb')]=_0x5ae5b2[_0x8b13('0xb')];this[_0x8b13('0xc')]=_0x5ae5b2['countnoanswerretry'];this[_0x8b13('0xd')]=_0x5ae5b2[_0x8b13('0xa')]+_0x5ae5b2[_0x8b13('0xb')]+_0x5ae5b2[_0x8b13('0xc')]+_0x5ae5b2[_0x8b13('0xe')]+_0x5ae5b2[_0x8b13('0xf')]+_0x5ae5b2['countabandonedretry']+_0x5ae5b2['countmachineretry']+_0x5ae5b2[_0x8b13('0x10')];this[_0x8b13('0xe')]=_0x5ae5b2['countnosuchnumberretry'];this['countdropretry']=_0x5ae5b2['countdropretry'];this[_0x8b13('0x11')]=_0x5ae5b2[_0x8b13('0x11')];this[_0x8b13('0x12')]=_0x5ae5b2[_0x8b13('0x12')];this[_0x8b13('0x10')]=_0x5ae5b2['countagentrejectretry'];this[_0x8b13('0x13')]=_0x5ae5b2[_0x8b13('0x13')];this[_0x8b13('0x14')]=_0x5ae5b2[_0x8b13('0x14')];this[_0x8b13('0x15')]=_0x5ae5b2[_0x8b13('0x15')];this[_0x8b13('0x16')]=_0x5ae5b2[_0x8b13('0x16')];this['responsetime']=_0x5ae5b2['responsetime'];this[_0x8b13('0x17')]=_0x5ae5b2[_0x8b13('0x18')];this[_0x8b13('0x19')]=_0x5ae5b2[_0x8b13('0x19')]||0x0;this[_0x8b13('0x1a')]=_0x5ae5b2[_0x8b13('0x1a')]||0x0;this['talktime']=_0x5ae5b2[_0x8b13('0x1b')]||0x0;this[_0x8b13('0x1c')]=_0x5ae5b2[_0x8b13('0x1c')];this['callbackuniqueid']=_0x5ae5b2['callbackuniqueid'];this[_0x8b13('0x1d')]=_0x5ae5b2[_0x8b13('0x1d')];this['recallme']=_0x5ae5b2[_0x8b13('0x1e')];this[_0x8b13('0x1f')]=_0x5ae5b2[_0x8b13('0x1f')];this[_0x8b13('0x20')]=_0x5ae5b2[_0x8b13('0x20')];this['UserId']=_0x5ae5b2[_0x8b13('0x21')];this[_0x8b13('0x22')]=_0x5ae5b2['VoiceQueueId'];this[_0x8b13('0x23')]=_0x5ae5b2['CampaignId'];this[_0x8b13('0x24')]=_0x5ae5b2[_0x8b13('0x24')]||'';this['originatecalleridname']=_0x5ae5b2[_0x8b13('0x25')]||'';}module[_0x8b13('0x26')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 38ad22c..6e07832 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 _0x1dd9=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','IVR','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry'];(function(_0x1ad049,_0x59e9a0){var _0x5c0942=function(_0x9f2cfc){while(--_0x9f2cfc){_0x1ad049['push'](_0x1ad049['shift']());}};_0x5c0942(++_0x59e9a0);}(_0x1dd9,0x188));var _0x91dd=function(_0x4ab9b0,_0x439e22){_0x4ab9b0=_0x4ab9b0-0x0;var _0x100ce5=_0x1dd9[_0x4ab9b0];return _0x100ce5;};'use strict';var util=require('util');var _=require(_0x91dd('0x0'));var moment=require('moment');function getSeconds(_0x4b7252,_0x53200b){var _0x10a9f9=moment(_0x4b7252)['milliseconds'](0x0);var _0x194dd0=moment(_0x53200b)[_0x91dd('0x1')](0x0);return _0x10a9f9[_0x91dd('0x2')](_0x194dd0,_0x91dd('0x3'));}function Hangup(_0x5361f7,_0x1c374b){this['state']=0x4;this[_0x91dd('0x4')]=_0x91dd('0x5');this[_0x91dd('0x6')]=_0x5361f7[_0x91dd('0x6')];this[_0x91dd('0x7')]=_0x5361f7['type'];this[_0x91dd('0x8')]=_0x5361f7['type']==='outbound'?_0x91dd('0x9'):_0x5361f7['type'];this['countbusyretry']=_0x5361f7[_0x91dd('0xa')];this[_0x91dd('0xb')]=_0x5361f7[_0x91dd('0xb')];this['countnoanswerretry']=_0x5361f7[_0x91dd('0xc')];this[_0x91dd('0xd')]=_0x5361f7[_0x91dd('0xa')]+_0x5361f7[_0x91dd('0xb')]+_0x5361f7[_0x91dd('0xc')]+_0x5361f7[_0x91dd('0xe')]+_0x5361f7['countdropretry']+_0x5361f7[_0x91dd('0xf')]+_0x5361f7[_0x91dd('0x10')]+_0x5361f7['countagentrejectretry'];this[_0x91dd('0xe')]=_0x5361f7['countnosuchnumberretry'];this[_0x91dd('0x11')]=_0x5361f7[_0x91dd('0x11')];this[_0x91dd('0xf')]=_0x5361f7[_0x91dd('0xf')];this[_0x91dd('0x10')]=_0x5361f7[_0x91dd('0x10')];this[_0x91dd('0x12')]=_0x5361f7[_0x91dd('0x12')];this[_0x91dd('0x13')]=_0x1c374b[_0x91dd('0x13')];this[_0x91dd('0x14')]=_0x5361f7[_0x91dd('0x15')];this[_0x91dd('0x16')]=_0x5361f7['number'];this[_0x91dd('0x17')]=_0x5361f7[_0x91dd('0x17')];this['responsetime']=_0x5361f7[_0x91dd('0x18')];this[_0x91dd('0x19')]=moment()['format'](_0x91dd('0x1a'));this[_0x91dd('0x1b')]=getSeconds(_0x5361f7[_0x91dd('0x18')],_0x5361f7['starttime']);this[_0x91dd('0x1c')]=0x0;this[_0x91dd('0x1d')]=getSeconds(this[_0x91dd('0x19')],_0x5361f7[_0x91dd('0x18')]);this[_0x91dd('0x9')]=_0x5361f7[_0x91dd('0x9')];this['membername']=_0x91dd('0x1e');this[_0x91dd('0x1f')]=_0x1c374b[_0x91dd('0x20')];this['callback']=_0x5361f7['callback'];this[_0x91dd('0x21')]=_0x5361f7[_0x91dd('0x21')];this[_0x91dd('0x22')]=_0x5361f7[_0x91dd('0x22')];this['recallme']=_0x5361f7[_0x91dd('0x23')];this[_0x91dd('0x24')]=_0x5361f7[_0x91dd('0x24')];this[_0x91dd('0x25')]=_0x5361f7['ListId'];this['UserId']=_0x5361f7[_0x91dd('0x26')];this[_0x91dd('0x27')]=_0x5361f7[_0x91dd('0x27')];this[_0x91dd('0x28')]=_0x5361f7[_0x91dd('0x28')];}module['exports']=Hangup; \ No newline at end of file +var _0xf861=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid'];(function(_0x355110,_0x5aacd0){var _0x319c53=function(_0xa95b6f){while(--_0xa95b6f){_0x355110['push'](_0x355110['shift']());}};_0x319c53(++_0x5aacd0);}(_0xf861,0xb0));var _0x1f86=function(_0x2e7024,_0x5f57c8){_0x2e7024=_0x2e7024-0x0;var _0x4a354f=_0xf861[_0x2e7024];return _0x4a354f;};'use strict';var util=require('util');var _=require(_0x1f86('0x0'));var moment=require(_0x1f86('0x1'));function getSeconds(_0x2717cc,_0x876a0a){var _0x1430ff=moment(_0x2717cc)[_0x1f86('0x2')](0x0);var _0x1044cc=moment(_0x876a0a)[_0x1f86('0x2')](0x0);return _0x1430ff[_0x1f86('0x3')](_0x1044cc,_0x1f86('0x4'));}function Hangup(_0x5338f6,_0x5ecbb4){this[_0x1f86('0x5')]=0x4;this[_0x1f86('0x6')]=_0x1f86('0x7');this[_0x1f86('0x8')]=_0x5338f6[_0x1f86('0x8')];this['type']=_0x5338f6[_0x1f86('0x9')];this[_0x1f86('0xa')]=_0x5338f6[_0x1f86('0x9')]===_0x1f86('0xb')?_0x1f86('0xc'):_0x5338f6[_0x1f86('0x9')];this['countbusyretry']=_0x5338f6['countbusyretry'];this[_0x1f86('0xd')]=_0x5338f6[_0x1f86('0xd')];this['countnoanswerretry']=_0x5338f6['countnoanswerretry'];this['countglobal']=_0x5338f6['countbusyretry']+_0x5338f6[_0x1f86('0xd')]+_0x5338f6['countnoanswerretry']+_0x5338f6[_0x1f86('0xe')]+_0x5338f6['countdropretry']+_0x5338f6[_0x1f86('0xf')]+_0x5338f6[_0x1f86('0x10')]+_0x5338f6[_0x1f86('0x11')];this[_0x1f86('0xe')]=_0x5338f6[_0x1f86('0xe')];this[_0x1f86('0x12')]=_0x5338f6['countdropretry'];this['countabandonedretry']=_0x5338f6[_0x1f86('0xf')];this[_0x1f86('0x10')]=_0x5338f6[_0x1f86('0x10')];this[_0x1f86('0x11')]=_0x5338f6[_0x1f86('0x11')];this[_0x1f86('0x13')]=_0x5ecbb4[_0x1f86('0x13')];this[_0x1f86('0x14')]=_0x5338f6[_0x1f86('0x15')];this[_0x1f86('0x16')]=_0x5338f6['number'];this[_0x1f86('0x17')]=_0x5338f6[_0x1f86('0x17')];this[_0x1f86('0x18')]=_0x5338f6[_0x1f86('0x18')];this[_0x1f86('0x19')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x1f86('0x1a')]=getSeconds(_0x5338f6['responsetime'],_0x5338f6[_0x1f86('0x17')]);this[_0x1f86('0x1b')]=0x0;this[_0x1f86('0x1c')]=getSeconds(this[_0x1f86('0x19')],_0x5338f6['responsetime']);this['queue']=_0x5338f6[_0x1f86('0xc')];this[_0x1f86('0x1d')]=_0x1f86('0x1e');this['reason']=_0x5ecbb4[_0x1f86('0x1f')];this[_0x1f86('0x20')]=_0x5338f6[_0x1f86('0x20')];this[_0x1f86('0x21')]=_0x5338f6['callbackuniqueid'];this[_0x1f86('0x22')]=_0x5338f6[_0x1f86('0x22')];this[_0x1f86('0x23')]=_0x5338f6[_0x1f86('0x23')];this[_0x1f86('0x24')]=_0x5338f6[_0x1f86('0x24')];this[_0x1f86('0x25')]=_0x5338f6[_0x1f86('0x25')];this[_0x1f86('0x26')]=_0x5338f6[_0x1f86('0x26')];this[_0x1f86('0x27')]=_0x5338f6[_0x1f86('0x27')];this[_0x1f86('0x28')]=_0x5338f6[_0x1f86('0x28')];}module[_0x1f86('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2c00435..c35b40e 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 _0x3068=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x51ac91,_0x192060){var _0x3c64be=function(_0x4c5742){while(--_0x4c5742){_0x51ac91['push'](_0x51ac91['shift']());}};_0x3c64be(++_0x192060);}(_0x3068,0x1a7));var _0x8306=function(_0x15a806,_0x35f6b6){_0x15a806=_0x15a806-0x0;var _0x5a2754=_0x3068[_0x15a806];return _0x5a2754;};'use strict';var util=require(_0x8306('0x0'));var _=require(_0x8306('0x1'));var moment=require('moment');function getSeconds(_0x174c26,_0x18f79c){var _0x27c50a=moment(_0x174c26)['milliseconds'](0x0);var _0x58d9f6=moment(_0x18f79c)[_0x8306('0x2')](0x0);return _0x27c50a[_0x8306('0x3')](_0x58d9f6,_0x8306('0x4'));}function History(_0x21dcf9){this[_0x8306('0x5')]=_0x21dcf9['uniqueid'];this['scheduledat']=_0x21dcf9[_0x8306('0x6')]||undefined;this[_0x8306('0x7')]=_0x21dcf9[_0x8306('0x7')];this[_0x8306('0x8')]=_0x21dcf9['type']===_0x8306('0x9')?_0x8306('0xa'):_0x21dcf9[_0x8306('0x7')];this[_0x8306('0xb')]=_0x21dcf9[_0x8306('0xb')];this['countcongestionretry']=_0x21dcf9[_0x8306('0xc')];this['countnoanswerretry']=_0x21dcf9['countnoanswerretry'];this['countglobal']=_0x21dcf9[_0x8306('0xb')]+_0x21dcf9[_0x8306('0xc')]+_0x21dcf9[_0x8306('0xd')]+_0x21dcf9[_0x8306('0xe')]+_0x21dcf9[_0x8306('0xf')]+_0x21dcf9[_0x8306('0x10')]+_0x21dcf9[_0x8306('0x11')]+_0x21dcf9['countagentrejectretry'];this['countnosuchnumberretry']=_0x21dcf9[_0x8306('0xe')];this[_0x8306('0xf')]=_0x21dcf9[_0x8306('0xf')];this[_0x8306('0x10')]=_0x21dcf9[_0x8306('0x10')];this[_0x8306('0x11')]=_0x21dcf9[_0x8306('0x11')];this[_0x8306('0x12')]=_0x21dcf9[_0x8306('0x12')];this[_0x8306('0xa')]=_0x21dcf9['queue'];this[_0x8306('0x13')]=_0x21dcf9[_0x8306('0x14')];this['calleridnum']=_0x21dcf9[_0x8306('0x15')];this[_0x8306('0x16')]=_0x21dcf9[_0x8306('0x16')];this[_0x8306('0x17')]=_0x21dcf9[_0x8306('0x17')];this[_0x8306('0x18')]=_0x21dcf9['responsetime'];this[_0x8306('0x19')]=getSeconds(_0x21dcf9[_0x8306('0x17')],_0x21dcf9[_0x8306('0x16')]);this[_0x8306('0x1a')]=0x0;this[_0x8306('0x1b')]=0x0;this[_0x8306('0x1c')]=_0x21dcf9[_0x8306('0x1c')];this[_0x8306('0x1d')]=_0x21dcf9['callbackuniqueid'];this[_0x8306('0x1e')]=_0x21dcf9[_0x8306('0x1e')];this[_0x8306('0x1f')]=_0x21dcf9[_0x8306('0x1f')];this['ContactId']=_0x21dcf9['ContactId'];this[_0x8306('0x20')]=_0x21dcf9[_0x8306('0x20')];this[_0x8306('0x21')]=_0x21dcf9[_0x8306('0x21')];this[_0x8306('0x22')]=_0x21dcf9[_0x8306('0x22')];this['CampaignId']=_0x21dcf9[_0x8306('0x23')];this[_0x8306('0x24')]=_0x21dcf9[_0x8306('0x24')]||'';this[_0x8306('0x25')]=_0x21dcf9[_0x8306('0x25')]||'';}module[_0x8306('0x26')]=History; \ No newline at end of file +var _0xf9eb=['queue','calleridname','name','number','responsetime','endtime','ringtime','starttime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xf9eb,0x144));var _0xbf9e=function(_0x59b969,_0x59b1a8){_0x59b969=_0x59b969-0x0;var _0x2b2f54=_0xf9eb[_0x59b969];return _0x2b2f54;};'use strict';var util=require(_0xbf9e('0x0'));var _=require(_0xbf9e('0x1'));var moment=require('moment');function getSeconds(_0x4caa3f,_0x528e4b){var _0x14ac63=moment(_0x4caa3f)[_0xbf9e('0x2')](0x0);var _0x105d01=moment(_0x528e4b)[_0xbf9e('0x2')](0x0);return _0x14ac63[_0xbf9e('0x3')](_0x105d01,'seconds');}function History(_0x5d0dc4){this[_0xbf9e('0x4')]=_0x5d0dc4['uniqueid'];this[_0xbf9e('0x5')]=_0x5d0dc4[_0xbf9e('0x5')]||undefined;this[_0xbf9e('0x6')]=_0x5d0dc4[_0xbf9e('0x6')];this[_0xbf9e('0x7')]=_0x5d0dc4[_0xbf9e('0x6')]===_0xbf9e('0x8')?'queue':_0x5d0dc4[_0xbf9e('0x6')];this[_0xbf9e('0x9')]=_0x5d0dc4['countbusyretry'];this[_0xbf9e('0xa')]=_0x5d0dc4[_0xbf9e('0xa')];this['countnoanswerretry']=_0x5d0dc4[_0xbf9e('0xb')];this[_0xbf9e('0xc')]=_0x5d0dc4[_0xbf9e('0x9')]+_0x5d0dc4[_0xbf9e('0xa')]+_0x5d0dc4[_0xbf9e('0xb')]+_0x5d0dc4[_0xbf9e('0xd')]+_0x5d0dc4[_0xbf9e('0xe')]+_0x5d0dc4[_0xbf9e('0xf')]+_0x5d0dc4['countmachineretry']+_0x5d0dc4[_0xbf9e('0x10')];this[_0xbf9e('0xd')]=_0x5d0dc4[_0xbf9e('0xd')];this[_0xbf9e('0xe')]=_0x5d0dc4[_0xbf9e('0xe')];this[_0xbf9e('0xf')]=_0x5d0dc4[_0xbf9e('0xf')];this['countmachineretry']=_0x5d0dc4[_0xbf9e('0x11')];this[_0xbf9e('0x10')]=_0x5d0dc4[_0xbf9e('0x10')];this[_0xbf9e('0x12')]=_0x5d0dc4['queue'];this[_0xbf9e('0x13')]=_0x5d0dc4[_0xbf9e('0x14')];this['calleridnum']=_0x5d0dc4[_0xbf9e('0x15')];this['starttime']=_0x5d0dc4['starttime'];this[_0xbf9e('0x16')]=_0x5d0dc4[_0xbf9e('0x16')];this[_0xbf9e('0x17')]=_0x5d0dc4[_0xbf9e('0x16')];this[_0xbf9e('0x18')]=getSeconds(_0x5d0dc4['responsetime'],_0x5d0dc4[_0xbf9e('0x19')]);this[_0xbf9e('0x1a')]=0x0;this[_0xbf9e('0x1b')]=0x0;this['callback']=_0x5d0dc4[_0xbf9e('0x1c')];this[_0xbf9e('0x1d')]=_0x5d0dc4[_0xbf9e('0x1d')];this[_0xbf9e('0x1e')]=_0x5d0dc4[_0xbf9e('0x1e')];this[_0xbf9e('0x1f')]=_0x5d0dc4[_0xbf9e('0x1f')];this['ContactId']=_0x5d0dc4[_0xbf9e('0x20')];this[_0xbf9e('0x21')]=_0x5d0dc4[_0xbf9e('0x21')];this['UserId']=_0x5d0dc4[_0xbf9e('0x22')];this['VoiceQueueId']=_0x5d0dc4[_0xbf9e('0x23')];this[_0xbf9e('0x24')]=_0x5d0dc4[_0xbf9e('0x24')];this['originatecalleridnum']=_0x5d0dc4['originatecalleridnum']||'';this[_0xbf9e('0x25')]=_0x5d0dc4[_0xbf9e('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index f68759d..664e962 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 _0x29cc=['Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','isSuccess','response','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','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(','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','RUNNING','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBooked','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','message','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','isUndefined','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','---------------------------','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','[emptyContact]','Success','SIP/%s','reachable','unmonitored','uniqueId','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','VoiceQueueId','CampaignId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countglobal','countcongestionretry','countdropretry','countagentrejectretry','reason\x2019\x20machine....','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','syncAgentComplete','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','calleridnum','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','preview','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x29cc,0xbc));var _0xc29c=function(_0x5baf36,_0x28bdf5){_0x5baf36=_0x5baf36-0x0;var _0x398cd1=_0x29cc[_0x5baf36];return _0x398cd1;};'use strict';var util=require('util');var _=require(_0xc29c('0x0'));var BPromise=require(_0xc29c('0x1'));var uuid=require(_0xc29c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xc29c('0x3'));var Redis=require(_0xc29c('0x4'));var ut=require(_0xc29c('0x5'));var config=require(_0xc29c('0x6'));var logger=require(_0xc29c('0x7'))('dialer');var loggerBooked=require(_0xc29c('0x7'))(_0xc29c('0x8'));var loggerPredictive=require(_0xc29c('0x7'))(_0xc29c('0x9'));var loggerPredictiveCalls=require(_0xc29c('0x7'))(_0xc29c('0xa'));var loggerSyncQueueSummary=require(_0xc29c('0x7'))(_0xc29c('0xb'));var ami=require(_0xc29c('0xc'));config[_0xc29c('0xd')]=_['defaults'](config[_0xc29c('0xd')],{'host':_0xc29c('0xe'),'port':0x18eb});var io=require(_0xc29c('0xf'))(new Redis(config[_0xc29c('0xd')]));var cmHopper=require(_0xc29c('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc29c('0x11'));var voiceQueueRt=require(_0xc29c('0x12'));var RpcSetting=require(_0xc29c('0x13'));var Action=require(_0xc29c('0x14'));var History=require(_0xc29c('0x15'));var Final=require(_0xc29c('0x16'));var AgentComplete=require(_0xc29c('0x17'));var QueueCallerAbandon=require(_0xc29c('0x18'));var Hangup=require(_0xc29c('0x19'));var ipAgi=process[_0xc29c('0x1a')][_0xc29c('0x1b')]||'127.0.0.1';var strategy={'rrmemory':_0xc29c('0x1c'),'roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc29c('0x1d')][_0xc29c('0x1e')]=function(_0x3a6997){this[_0xc29c('0x1f')]=this[_0xc29c('0x1f')]?this[_0xc29c('0x1f')][_0xc29c('0x20')](_0x3a6997):_0x3a6997();};function Dialer(_0x6d2233,_0x33ab3b){this['sequence']=new Sequence();this['preview']=_0x33ab3b;this['voiceQueues']=_0x6d2233[_0xc29c('0x21')];this[_0xc29c('0x22')]=_0x6d2233[_0xc29c('0x22')];this[_0xc29c('0x23')]=_0x6d2233[_0xc29c('0x23')];this[_0xc29c('0x24')]=_0x6d2233['trunks'];this[_0xc29c('0x25')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xc29c('0x26')]={};this[_0xc29c('0x27')]={};this['uniqueId']={};this[_0xc29c('0x28')]={};this[_0xc29c('0x29')]={};this[_0xc29c('0x2a')]={};this['ivrOriginated']={};this[_0xc29c('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this[_0xc29c('0x2c')][_0xc29c('0x2d')](this));ami['on']('queuecallerabandon',this[_0xc29c('0x2e')]['bind'](this));ami['on'](_0xc29c('0x2f'),this[_0xc29c('0x30')][_0xc29c('0x2d')](this));ami['on'](_0xc29c('0x31'),this['syncAgentComplete']['bind'](this));ami['on'](_0xc29c('0x32'),this[_0xc29c('0xb')]['bind'](this));ami['on'](_0xc29c('0x33'),this[_0xc29c('0x34')][_0xc29c('0x2d')](this));ami['on'](_0xc29c('0x35'),this[_0xc29c('0x36')][_0xc29c('0x2d')](this));ami['on']('varset',this[_0xc29c('0x37')][_0xc29c('0x2d')](this));ami['on'](_0xc29c('0x38'),this['syncQueueMember']['bind'](this));ami['on'](_0xc29c('0x39'),this[_0xc29c('0x3a')][_0xc29c('0x2d')](this));this[_0xc29c('0x3b')]();this[_0xc29c('0x3c')]();RpcSetting[_0xc29c('0x3d')]()[_0xc29c('0x3e')](function(_0x15da2e){previewRecallmeReminderInterval=_0x15da2e[_0xc29c('0x3f')];});}function isNotNull(_0x39a9a8){return _0x39a9a8!==null&&!_['isUndefined'](_0x39a9a8);}function checkIsLoggedIn(_0x2948a0,_0x421482){return function(){if(_0x421482<=0x0){_0x2948a0[_0xc29c('0x40')]='AGENTS_NOT_LOGGED';throw _0x2948a0[_0xc29c('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3aa676){return _0x3aa676;}function checkIsActive(_0x2f71d7,_0x59b89f){return function(){if(!isActive(_0x59b89f)){_0x2f71d7[_0xc29c('0x40')]=_0xc29c('0x42');throw _0x2f71d7[_0xc29c('0x41')]+_0xc29c('0x43');}};}function checkInterval(_0x46df12){return function(){if(!isNotNull(_0x46df12[_0xc29c('0x44')])){_0x46df12[_0xc29c('0x40')]='INTERVAL_IS_NULL';throw _0x46df12[_0xc29c('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x46df12['Interval'][_0xc29c('0x45')])){_0x46df12[_0xc29c('0x40')]=_0xc29c('0x46');throw _0x46df12['name']+_0xc29c('0x47');}if(!isNotNull(_[_0xc29c('0x48')](_0x46df12[_0xc29c('0x44')][_0xc29c('0x45')]))){_0x46df12['message']=_0xc29c('0x46');throw _0x46df12[_0xc29c('0x41')]+_0xc29c('0x47');}};}function msgResponse(_0x4a9fe0,_0x1d3b48,_0x331a15){return{'action':_0x4a9fe0,'response':_0x1d3b48,'message':_0x331a15,'stack':_0x331a15};}function myreject(_0x4f2ea8){return function(_0x34c94a){return _0x4f2ea8(msgResponse('[ifTime][Action]',_0xc29c('0x49'),JSON[_0xc29c('0x4a')](_0x34c94a)));};}function getSeconds(_0x23e0b8,_0x5e433f){var _0x55377e=moment(_0x23e0b8)[_0xc29c('0x4b')](0x0);var _0x5a3134=moment(_0x5e433f)[_0xc29c('0x4b')](0x0);return _0x55377e[_0xc29c('0x4c')](_0x5a3134,'seconds');}function emit(_0x38921f,_0x3b7146,_0x1b46e6){io['to'](_0x38921f)[_0xc29c('0x4d')](_0x3b7146,_0x1b46e6);}function emitVoiceQueueSummary(_0x385961){if(_0x385961['type']===_0xc29c('0x4e')){var _0x587b8a={'id':_0x385961['id'],'name':_0x385961[_0xc29c('0x41')],'strategy':_0x385961[_0xc29c('0x4f')],'answered':_0x385961[_0xc29c('0x50')],'available':_0x385961[_0xc29c('0x51')],'loggedIn':_0x385961[_0xc29c('0x52')],'pTalking':_0x385961[_0xc29c('0x53')],'sumBillable':_0x385961['sumBillable'],'sumDuration':_0x385961[_0xc29c('0x54')],'sumHoldTime':_0x385961[_0xc29c('0x55')]||0x0,'talking':_0x385961[_0xc29c('0x56')],'total':_0x385961[_0xc29c('0x57')],'type':_0x385961[_0xc29c('0x58')],'unmanaged':_0x385961[_0xc29c('0x59')],'abandoned':_0x385961['abandoned'],'waiting':_0x385961[_0xc29c('0x5a')],'loggedInDb':_0x385961[_0xc29c('0x5b')],'dialActive':_0x385961[_0xc29c('0x5c')],'dialMethod':_0x385961[_0xc29c('0x5d')],'dialOriginateCallerIdName':_0x385961[_0xc29c('0x5e')],'dialOriginateCallerIdNumber':_0x385961['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x385961[_0xc29c('0x5f')],'dialPrefix':_0x385961['dialPrefix'],'outboundAnswerAgiCallsDay':_0x385961[_0xc29c('0x60')],'outboundAnswerCallsDay':_0x385961[_0xc29c('0x61')],'outboundBlacklistCallsDay':_0x385961[_0xc29c('0x62')],'outboundBusyCallsDay':_0x385961[_0xc29c('0x63')],'outboundCongestionCallsDay':_0x385961[_0xc29c('0x64')],'outboundDropCallsDayACS':_0x385961[_0xc29c('0x65')],'outboundDropCallsDayCallersExit':_0x385961['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x385961[_0xc29c('0x66')],'outboundNoAnswerCallsDay':_0x385961[_0xc29c('0x67')],'outboundNoSuchCallsDay':_0x385961[_0xc29c('0x68')],'outboundOriginateFailureCallsDay':_0x385961['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x385961[_0xc29c('0x69')],'outboundRejectCallsDay':_0x385961['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x385961[_0xc29c('0x6a')],'predictiveIntervalAnsweredCalls':_0x385961['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x385961[_0xc29c('0x6b')],'predictiveIntervalAvgTalktime':_0x385961['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x385961['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x385961['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x385961[_0xc29c('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x385961[_0xc29c('0x6d')],'predictiveIntervalHitRate':_0x385961['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x385961[_0xc29c('0x6e')],'predictiveIntervalPauses':_0x385961[_0xc29c('0x6f')],'predictiveIntervalAvailable':_0x385961[_0xc29c('0x70')],'predictiveIntervalTotalCalls':_0x385961[_0xc29c('0x71')],'message':_0x385961[_0xc29c('0x40')],'originated':_0x385961[_0xc29c('0x72')],'erlangCalls':_0x385961[_0xc29c('0x73')],'erlangCallToSecond':_0x385961[_0xc29c('0x74')],'erlangAbandonmentRate':_0x385961[_0xc29c('0x75')],'erlangBusyFactor':_0x385961[_0xc29c('0x76')],'startPredictive':_0x385961[_0xc29c('0x29')],'startProgressive':_0x385961['startProgressive']};if(_0x385961[_0xc29c('0x77')]){_0x587b8a['Trunk']={'id':_0x385961[_0xc29c('0x77')]['id'],'name':_0x385961[_0xc29c('0x77')][_0xc29c('0x41')],'active':_0x385961['Trunk'][_0xc29c('0x78')],'callerid':_0x385961[_0xc29c('0x77')]['callerid']};}if(_0x385961[_0xc29c('0x44')]){_0x587b8a['Interval']={'id':_0x385961[_0xc29c('0x44')]['id'],'name':_0x385961[_0xc29c('0x44')]['name']};}var _0x88a605=md5(JSON['stringify'](_0x587b8a));if(_0x385961[_0xc29c('0x3')]!==_0x88a605){_0x385961['md5']=_0x88a605;emit(util[_0xc29c('0x79')](_0xc29c('0x7a'),_0x587b8a[_0xc29c('0x41')]),_0xc29c('0x7b'),_0x587b8a);}}}function emitCampaignSummary(_0x4f6c95){if(_0x4f6c95[_0xc29c('0x58')]===_0xc29c('0x7c')){emit(util[_0xc29c('0x79')](_0xc29c('0x7d'),_0x4f6c95[_0xc29c('0x41')]),_0xc29c('0x7e'),_0x4f6c95);}}function checkGetDataPredictive(_0xce410d){if(isNotNull(_0xce410d)&&!_[_0xc29c('0x48')](_0xce410d)){loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x80'));loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x81'),_0xce410d[_0xc29c('0x71')]);loggerPredictive['info'](_0xc29c('0x82'),_0xce410d[_0xc29c('0x83')]);loggerPredictive[_0xc29c('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xce410d[_0xc29c('0x84')]);loggerPredictive[_0xc29c('0x7f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xce410d['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xc29c('0x7f')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xce410d[_0xc29c('0x6b')]);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x85'),_0xce410d[_0xc29c('0x86')]);loggerPredictive[_0xc29c('0x7f')]('---------------------------');if(_0xce410d[_0xc29c('0x71')]>0x0){if(!_[_0xc29c('0x87')](_0xce410d[_0xc29c('0x86')])&&_0xce410d[_0xc29c('0x86')]>0x0){return!![];}loggerPredictive[_0xc29c('0x7f')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xc29c('0x87')](_0xce410d[_0xc29c('0x6b')])&&_0xce410d[_0xc29c('0x6b')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc29c('0x7f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x88'));}return![];}function mergeDataErlangB(_0x12257c){return function(_0x5e6df3){loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x89'));loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8a'),_0x5e6df3['erlangCalls']);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8b'),_0x5e6df3[_0xc29c('0x74')]);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8c'),_0x5e6df3[_0xc29c('0x75')]);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8d'),_0x5e6df3[_0xc29c('0x76')]);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8c'),_0x5e6df3[_0xc29c('0x75')]);loggerPredictive['info'](_0xc29c('0x8e'));_[_0xc29c('0x8f')](_0x12257c,_0x5e6df3);};}function getDiff(_0x3872ec){var _0x1bcba6=moment()['milliseconds'](0x0);var _0x5b580b=moment(_0x3872ec)[_0xc29c('0x4b')](0x0);return _0x1bcba6[_0xc29c('0x4c')](_0x5b580b,'seconds');}function ifInterval(_0x2f7b10,_0x142398){if(_[_0xc29c('0x87')](_0x142398)){return![];}return getDiff(_0x142398)<_0x2f7b10*0x3c;}function freeVariablesPredictive(_0x463206){if(isNotNull(_0x463206)){if(!_['isUndefined'](_0x463206[_0xc29c('0x2a')])){_0x463206['startProgressive']=undefined;loggerPredictive['info'](_0x463206[_0xc29c('0x41')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xc29c('0x87')](_0x463206[_0xc29c('0x29')])){_0x463206['startPredictive']=undefined;loggerPredictive['info'](_0x463206['name'],_0xc29c('0x90'));}if(!_[_0xc29c('0x87')](_0x463206[_0xc29c('0x91')])){clearInterval(_0x463206[_0xc29c('0x91')]);_0x463206[_0xc29c('0x91')]=undefined;loggerPredictive[_0xc29c('0x7f')](_0x463206[_0xc29c('0x41')],_0xc29c('0x92'));}}}function erlangb(_0x139de1,_0x49a6a9){if(_0x49a6a9===0x0){return 0x0;}var _0x15c24e=0x1;for(var _0x4f0e6a=0x1;_0x4f0e6a<=_0x49a6a9;_0x4f0e6a+=0x1){_0x15c24e=0x1+_0x15c24e*_0x4f0e6a/_0x139de1;}return 0x1/_0x15c24e;}function isVoiceQueueOutbound(_0x408080){return _0x408080===_0xc29c('0x4e');}function isNotPreview(_0x1aa868){return _0x1aa868!=='preview';}function isCampaignIvr(_0x35d678){return _0x35d678===_0xc29c('0x7c');}function getCallerId(_0xf4e49b,_0x4d8137,_0x1b54f6){if(!_[_0xc29c('0x87')](_0x1b54f6)&&typeof _0x1b54f6===_0xc29c('0x93')&&!_['isEmpty'](_0x1b54f6)){if(!_[_0xc29c('0x87')](_0x4d8137)&&typeof _0x4d8137==='string'&&!_[_0xc29c('0x48')](_0x4d8137)){return util[_0xc29c('0x79')](_0xc29c('0x94'),_0x4d8137,_0x1b54f6);}return util[_0xc29c('0x79')](_0xc29c('0x94'),_0x1b54f6,_0x1b54f6);}if(!_[_0xc29c('0x87')](_0xf4e49b)&&typeof _0xf4e49b===_0xc29c('0x93')&&!_[_0xc29c('0x48')](_0xf4e49b)){return _0xf4e49b;}return _0xc29c('0x95');}function loggerCatchQueueSummary(_0x5a2ee2,_0x894f2b){return function(_0x4af53c){freeVariablesPredictive(_0x894f2b);emitVoiceQueueSummary(_0x894f2b);emitCampaignSummary(_0x894f2b);loggerSyncQueueSummary[_0xc29c('0x96')](_0x5a2ee2,util['inspect'](_0x4af53c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x472e44,_0x26ca68){return function(_0x35ff20){loggerPredictive[_0xc29c('0x96')](_0x26ca68['name'],_0x472e44);loggerPredictive[_0xc29c('0x96')](_0x35ff20[_0xc29c('0x97')]);freeVariablesPredictive(_0x26ca68);};}function loggerCatch(_0x1f3a3f){return function(_0x2e11d9){logger[_0xc29c('0x96')](_0x1f3a3f,util[_0xc29c('0x98')](_0x2e11d9,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1e0b93){return _0x1e0b93&&!_[_0xc29c('0x87')](_0x1e0b93)&&_0x1e0b93['length']>0x0;}function decremetOriginate(_0x362817){if(!_[_0xc29c('0x87')](_0x362817)&&_0x362817!==null){if(typeof _0x362817[_0xc29c('0x72')]!==_0xc29c('0x99')){if(_0x362817[_0xc29c('0x72')]>0x0){_0x362817[_0xc29c('0x72')]-=0x1;}else{logger['error'](_0xc29c('0x9a'));}}}else{logger[_0xc29c('0x96')](_0xc29c('0x9b'));}}function checkContactLowerLimitOriginate(_0x2c6e72,_0x366c80,_0x234b57){if(_0x366c80>_0x234b57){for(var _0x23c93f=0x0;_0x23c93f<_0x366c80-_0x234b57;_0x23c93f+=0x1){decremetOriginate(_0x2c6e72);}}}function loggerGetContactDialer(_0x2d3dba,_0x376b52,_0x24a13){return function(_0x294cb4){checkContactLowerLimitOriginate(_0x376b52,_0x24a13,0x0);logger[_0xc29c('0x96')](_0x2d3dba,util['inspect'](_0x294cb4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x16275f){return function(_0x3ba592){if(isNotNull(_0x3ba592)&&isNotNull(_0x3ba592[0x0])){if(_0x3ba592[0x0][_0xc29c('0x9c')]>0x0){_0x16275f[_0xc29c('0x40')]='RESCHEDULED_CONTACTS';logger['info'](_0xc29c('0x9d')+_0x16275f['name'],_0x3ba592[0x0][_0xc29c('0x9c')],_0xc29c('0x9e'));}else{_0x16275f['message']=_0xc29c('0x9f');logger[_0xc29c('0x7f')](_0xc29c('0xa0')+_0x16275f[_0xc29c('0x41')]);}}};}function notSendMessagesQueue(_0x31e29){if(_0x31e29[_0xc29c('0xa1')]){freeVariablesPredictive(_0x31e29);if(_0x31e29['originated']===0x0&&_0x31e29[_0xc29c('0x56')]===0x0&&_0x31e29['waiting']===0x0&&(_0x31e29['pTalking']||0x0)===0x0){_0x31e29[_0xc29c('0xa1')]=![];_0x31e29['available']=0x0;_0x31e29[_0xc29c('0x40')]=_0xc29c('0x42');loggerSyncQueueSummary[_0xc29c('0x96')](_0xc29c('0xa2'),_0x31e29['name'],'is\x20not\x20active');}else{_0x31e29['message']=_0xc29c('0xa3');loggerSyncQueueSummary[_0xc29c('0x96')](_0xc29c('0xa2'),_0x31e29[_0xc29c('0x41')],'is\x20disactive');}emitVoiceQueueSummary(_0x31e29);}}function notSendMessagesCampaign(_0x33005f){if(_0x33005f[_0xc29c('0xa1')]){if(_0x33005f[_0xc29c('0x72')]===0x0){_0x33005f['sendMessageOneNotActive']=![];_0x33005f[_0xc29c('0x40')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xc29c('0x96')](_0xc29c('0xa4'),_0x33005f['name'],_0xc29c('0xa5'));}else{_0x33005f[_0xc29c('0x40')]=_0xc29c('0xa3');loggerSyncQueueSummary[_0xc29c('0x96')](_0xc29c('0xa4'),_0x33005f[_0xc29c('0x41')],_0xc29c('0xa6'));}emitCampaignSummary(_0x33005f);}}function createObjHistory(_0x154d30,_0x2cb1cb,_0x1fd16f,_0x4db538,_0x58ab41){_0x154d30['message']=_0x1fd16f;var _0x5930d9=new Action(_0x154d30,_0x2cb1cb);var _0x512dd7=new History(_0x5930d9);_0x512dd7[_0xc29c('0xa7')]=_0x4db538;_0x512dd7[_0xc29c('0xa8')]=_0x58ab41;_0x512dd7[_0xc29c('0xa9')]=_0x5930d9[_0xc29c('0xaa')];return _0x512dd7;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x147748=this;setInterval(function(){_0x147748[_0xc29c('0xab')](_0x147748['uniqueId'],'[uniqueid]');_0x147748['clearZombieChannels'](_0x147748[_0xc29c('0x26')],_0xc29c('0xac'));},0x32c8);};Dialer[_0xc29c('0x1d')][_0xc29c('0xab')]=function(_0xb47551,_0xbc7ca5){var _0x13d762=this;for(var _0x32d9c7 in _0xb47551){if(typeof _0xb47551[_0x32d9c7]!==_0xc29c('0x99')){this[_0xc29c('0xad')][_0xc29c('0x1e')](function(){if(!_[_0xc29c('0xae')](_0xb47551[_0x32d9c7])){return ami[_0xc29c('0xaf')]({'action':_0xc29c('0xb0'),'channel':_0xb47551[_0x32d9c7][_0xc29c('0xb1')]})[_0xc29c('0xb2')](function(_0x363d7c){if(_0x363d7c[_0xc29c('0x40')]===_0xc29c('0xb3')){setTimeout(function(){if(_0xb47551[_0x32d9c7]&&_0xb47551[_0x32d9c7][_0xc29c('0x58')]!==_0xc29c('0x7c')){_0x13d762['updateOriginated'](_0x13d762['voiceQueues'][_0xb47551[_0x32d9c7]['queue']]);logger[_0xc29c('0x96')](_0xc29c('0xb4'),_0xbc7ca5,_0x32d9c7,_0xb47551[_0x32d9c7]['queue']);delete _0xb47551[_0x32d9c7];}if(_0xb47551[_0x32d9c7]&&_0xb47551[_0x32d9c7]['type']==='ivr'){_0x13d762[_0xc29c('0xb5')](_0x13d762['campaigns'][_0xb47551[_0x32d9c7]['queue']]);logger['error'](_0xc29c('0xb6'),_0xbc7ca5,_0x32d9c7,_0xb47551[_0x32d9c7][_0xc29c('0xb7')]);delete _0xb47551[_0x32d9c7];}},0x2328);}});}});}}};Dialer['prototype'][_0xc29c('0xb8')]=function(_0x497d36){return BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xb8')](_0x497d36))['catch'](loggerCatch(_0xc29c('0xba')));};Dialer[_0xc29c('0x1d')][_0xc29c('0xbb')]=function(_0x42e077){return BPromise[_0xc29c('0xb9')]()['then'](cmHopperBlack['checkIsBlackList'](_0x42e077))['catch'](loggerCatch(_0xc29c('0xbc')));};Dialer[_0xc29c('0x1d')]['checkIsBlackListIvr']=function(_0x4ab925){return BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](cmHopperBlack[_0xc29c('0xbd')](_0x4ab925))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xbe')));};Dialer['prototype'][_0xc29c('0xbf')]=function(_0x469c47){return BPromise['resolve']()[_0xc29c('0x3e')](cmHopperHistory[_0xc29c('0xc0')](_0x469c47))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xc1')));};Dialer['prototype'][_0xc29c('0xc2')]=function(_0x377087){return BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xc2')](_0x377087))[_0xc29c('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xc29c('0x1d')][_0xc29c('0xc3')]=function(_0x318693,_0x4aac7b,_0x191d43){return BPromise['resolve']()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xc3')](_0x318693,_0x4aac7b,_0x191d43))['catch'](loggerCatch(_0xc29c('0xc4')));};Dialer['prototype'][_0xc29c('0xc5')]=function(_0x217608,_0x177a60,_0x368b9d,_0x253e42,_0x227232){return BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xc5')](_0x217608,_0x177a60,_0x368b9d,_0x253e42))[_0xc29c('0xb2')](function(_0x9f7ac1){_0x227232[_0xc29c('0xc6')]-=_0x368b9d;_0x227232[_0xc29c('0xc6')]=_0x227232['temp']>0x0?_0x227232[_0xc29c('0xc6')]:0x0;loggerCatch(_0xc29c('0xc7'))(_0x9f7ac1);});};Dialer['prototype'][_0xc29c('0xc8')]=function(_0x5bb2bd,_0x47f364,_0x1c2dde,_0x35c5f5){return BPromise['resolve']()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xc8')](_0x5bb2bd,_0x47f364,_0x1c2dde))[_0xc29c('0xb2')](function(_0x15ad35){_0x35c5f5[_0xc29c('0xc6')]-=_0x47f364;_0x35c5f5[_0xc29c('0xc6')]=_0x35c5f5['temp']>0x0?_0x35c5f5['temp']:0x0;loggerCatch(_0xc29c('0xc9'))(_0x15ad35);});};Dialer['prototype'][_0xc29c('0xca')]=function(_0x4dd955){return BPromise['resolve']()[_0xc29c('0x3e')](voiceQueueRt[_0xc29c('0xca')](_0x4dd955))[_0xc29c('0xb2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xc29c('0xcb')]=function(_0x3e5aea){return BPromise['resolve']()[_0xc29c('0x3e')](cmHopper[_0xc29c('0xcb')](_0x3e5aea))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xcc')));};Dialer['prototype'][_0xc29c('0xcd')]=function(_0x1dd868){return BPromise['resolve']()[_0xc29c('0x3e')](cmHopperHistory[_0xc29c('0xcd')](_0x1dd868))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xce')));};Dialer[_0xc29c('0x1d')]['updateOriginated']=function(_0x333731){if(!_['isUndefined'](_0x333731)&&_0x333731!==null){if(typeof _0x333731['originated']!==_0xc29c('0x99')){if(_0x333731[_0xc29c('0x72')]>0x0){_0x333731[_0xc29c('0x72')]-=0x1;}else{logger[_0xc29c('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xc29c('0x96')](_0xc29c('0xcf'));}};Dialer['prototype']['loggerHandler']=function(_0x2a3876,_0x27b749){var _0x187fce=this;return function(_0xd3a4df){_0x187fce[_0xc29c('0xb5')](_0x27b749);logger[_0xc29c('0x96')](_0x2a3876,util[_0xc29c('0x98')](_0xd3a4df,{'showHidden':![],'depth':null}));};};Dialer[_0xc29c('0x1d')][_0xc29c('0xd0')]=function(_0x2cc23d,_0x2599a8,_0x1f5410){var _0xf866b0={'state':0x19,'statedesc':_0xc29c('0xd1')};this[_0xc29c('0xb5')](_0x2599a8);this[_0xc29c('0xd2')](_[_0xc29c('0x8f')](_0xf866b0,_[_0xc29c('0xd3')](_0x1f5410,[_0xc29c('0xd4'),_0xc29c('0xd5'),_0xc29c('0xd6'),'VoiceQueueId','CampaignId'])),'[emptyContact][createHistory]',_0xc29c('0xd7'));logger[_0xc29c('0x96')](_0x2cc23d);};Dialer['prototype']['isSuccess']=function(_0x39a909){return _0x39a909===_0xc29c('0xd8');};Dialer[_0xc29c('0x1d')]['isTrunkReachable']=function(_0x4dbbf0){return!_[_0xc29c('0x87')](_0x4dbbf0)&&_0x4dbbf0&&!_[_0xc29c('0x87')](_0x4dbbf0[_0xc29c('0x41')])&&!_[_0xc29c('0x87')](_0x4dbbf0[_0xc29c('0x78')])&&_0x4dbbf0['active']&&(this[_0xc29c('0x24')][util['format'](_0xc29c('0xd9'),_0x4dbbf0[_0xc29c('0x41')])][_0xc29c('0xb0')]===_0xc29c('0xda')||this[_0xc29c('0x24')][util[_0xc29c('0x79')](_0xc29c('0xd9'),_0x4dbbf0[_0xc29c('0x41')])][_0xc29c('0xb0')]===_0xc29c('0xdb'));};Dialer['prototype'][_0xc29c('0xd2')]=function(_0x3fe2c8,_0xa1816a,_0x1d3e47){this[_0xc29c('0xcd')](_0x3fe2c8)[_0xc29c('0xb2')](loggerCatch(_0xa1816a));this[_0xc29c('0xcb')](_0x3fe2c8)[_0xc29c('0xb2')](loggerCatch(_0x1d3e47));};Dialer[_0xc29c('0x1d')]['syncVarSet']=function(_0x20730a){var _0x7f5123=this[_0xc29c('0xdc')][_0x20730a['uniqueid']];var _0xf1e1ec;if(!_[_0xc29c('0xae')](_0x20730a)&&!_[_0xc29c('0xae')](_0x20730a[_0xc29c('0xdd')])&&!_[_0xc29c('0xae')](_0x20730a[_0xc29c('0xdd')]['amdstatus'])&&_0x20730a[_0xc29c('0xde')]===_0xc29c('0xdf')&&_0x7f5123){if(_0x7f5123['type']!==_0xc29c('0x7c')&&this[_0xc29c('0x21')][_0x7f5123['queue']][_0xc29c('0xe0')]&&_0x20730a[_0xc29c('0xe1')]===_0xc29c('0xe2')){delete this[_0xc29c('0xdc')][_0x20730a[_0xc29c('0xe3')]];this[_0xc29c('0xb5')](this[_0xc29c('0x21')][_0x7f5123[_0xc29c('0xb7')]]);this['voiceQueues'][_0x7f5123[_0xc29c('0xb7')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x7f5123[_0xc29c('0xb7')]][_0xc29c('0x60')]+=0x1;_0xf1e1ec=new Hangup(_0x7f5123,_0x20730a);_0xf1e1ec['state']=0x12;_0xf1e1ec[_0xc29c('0xa8')]='HangupInAMD';_0xf1e1ec[_0xc29c('0xe4')]=_0xc29c('0xe5');ami[_0xc29c('0x4d')](_0xc29c('0xe6'),ut[_0xc29c('0xe7')](_0xf1e1ec,'amd'));this[_0xc29c('0xd2')](_0xf1e1ec,_0xc29c('0xe8'),'[syncHangupInAMD]');}if(_0x7f5123[_0xc29c('0x58')]!==_0xc29c('0x7c')&&this[_0xc29c('0x21')][_0x7f5123['queue']][_0xc29c('0xe0')]&&_0x20730a[_0xc29c('0xe1')]==='MACHINE'){var _0x3658e4=this;return new BPromise(function(_0x25db62,_0x1727a9){delete _0x3658e4[_0xc29c('0xdc')][_0x20730a[_0xc29c('0xe3')]];_0x3658e4[_0xc29c('0xb5')](_0x3658e4['voiceQueues'][_0x7f5123['queue']]);_0x3658e4['voiceQueues'][_0x7f5123[_0xc29c('0xb7')]][_0xc29c('0x61')]+=0x1;_0x3658e4['voiceQueues'][_0x7f5123[_0xc29c('0xb7')]][_0xc29c('0x60')]+=0x1;var _0x2a7dc3=_0x3658e4[_0xc29c('0x21')][_0x7f5123[_0xc29c('0xb7')]];var _0x56da03=new Hangup(_0x7f5123,_0x20730a);_0x56da03[_0xc29c('0xa7')]=0x13;_0x56da03[_0xc29c('0xa8')]='Machine';_0x56da03[_0xc29c('0xe4')]=_0xc29c('0xe5');_0x56da03[_0xc29c('0xe9')]+=0x1;_0x56da03['countglobal']+=0x1;_0x56da03[_0xc29c('0xea')]=!![];ami[_0xc29c('0x4d')](_0xc29c('0xe6'),ut['buildObj'](_0x56da03,_0xc29c('0xea')));_0x3658e4['createHistory'](_0x56da03)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xeb')));if(_0x56da03[_0xc29c('0xec')]+_0x56da03['countcongestionretry']+_0x56da03[_0xc29c('0xed')]+_0x56da03[_0xc29c('0xee')]+_0x56da03['countdropretry']+_0x56da03[_0xc29c('0xef')]+_0x56da03[_0xc29c('0xe9')]+_0x56da03['countagentrejectretry']>=_0x2a7dc3[_0xc29c('0xf0')]){_0x3658e4[_0xc29c('0xf1')](_0x56da03,_0x25db62,_0x1727a9,'reason19\x20machine....');}else{if(_0x56da03['countmachineretry']>=_0x2a7dc3[_0xc29c('0xf2')]){_0x3658e4[_0xc29c('0xf3')](_0x56da03,_0x25db62,_0x1727a9,'reason\x2019\x20machine....');}else{_0x3658e4[_0xc29c('0xc2')]({'active':![],'countmachineretry':_0x56da03[_0xc29c('0xe9')],'scheduledat':moment()[_0xc29c('0xf4')](_0x2a7dc3[_0xc29c('0xf5')],_0xc29c('0xf6'))[_0xc29c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56da03[_0xc29c('0xd4')],'ListId':_0x56da03['ListId'],'VoiceQueueId':_0x56da03[_0xc29c('0xf7')]||undefined,'CampaignId':_0x56da03[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xf9')));_0x25db62({'reschedule':0x1});}}});}if(_0x7f5123[_0xc29c('0x58')]===_0xc29c('0x7c')&&this[_0xc29c('0x22')][_0x7f5123[_0xc29c('0xb7')]][_0xc29c('0xe0')]&&_0x20730a['value']===_0xc29c('0xe2')){delete this['uniqueId'][_0x20730a[_0xc29c('0xe3')]];this[_0xc29c('0xb5')](this[_0xc29c('0x22')][_0x7f5123[_0xc29c('0xb7')]]);_0xf1e1ec=new Hangup(_0x7f5123,_0x20730a);_0xf1e1ec['state']=0x12;_0xf1e1ec[_0xc29c('0xa8')]=_0xc29c('0xfa');_0xf1e1ec[_0xc29c('0xe4')]=_0xc29c('0xe5');ami[_0xc29c('0x4d')](_0xc29c('0xe6'),ut[_0xc29c('0xe7')](_0xf1e1ec,'amd'));this[_0xc29c('0xd2')](_0xf1e1ec,_0xc29c('0xfb'),_0xc29c('0xfc'));}if(_0x7f5123['type']===_0xc29c('0x7c')&&this[_0xc29c('0x22')][_0x7f5123[_0xc29c('0xb7')]]['dialAMDActive']&&_0x20730a[_0xc29c('0xe1')]===_0xc29c('0xfd')){var _0x3658e4=this;return new BPromise(function(_0x5d12a9,_0x34f73a){delete _0x3658e4[_0xc29c('0xdc')][_0x20730a[_0xc29c('0xe3')]];_0x3658e4['updateOriginated'](_0x3658e4[_0xc29c('0x22')][_0x7f5123['queue']]);_0x3658e4['campaigns'][_0x7f5123[_0xc29c('0xb7')]]['outboundAnswerCallsDay']+=0x1;_0x3658e4[_0xc29c('0x22')][_0x7f5123[_0xc29c('0xb7')]][_0xc29c('0x60')]+=0x1;var _0x4e4589=_0x3658e4['campaigns'][_0x7f5123[_0xc29c('0xb7')]];var _0x47780b=new Hangup(_0x7f5123,_0x20730a);_0x47780b[_0xc29c('0xa7')]=0x13;_0x47780b[_0xc29c('0xa8')]=_0xc29c('0xfe');_0x47780b[_0xc29c('0xe4')]=_0xc29c('0xe5');_0x47780b[_0xc29c('0xe9')]+=0x1;_0x47780b[_0xc29c('0xff')]+=0x1;_0x47780b['amd']=!![];ami['emit']('custom:amd',ut[_0xc29c('0xe7')](_0x47780b,'amd'));_0x3658e4['createHistory'](_0x47780b)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xeb')));if(_0x47780b[_0xc29c('0xec')]+_0x47780b[_0xc29c('0x100')]+_0x47780b['countnoanswerretry']+_0x47780b[_0xc29c('0xee')]+_0x47780b[_0xc29c('0x101')]+_0x47780b[_0xc29c('0xef')]+_0x47780b[_0xc29c('0xe9')]+_0x47780b[_0xc29c('0x102')]>=_0x4e4589[_0xc29c('0xf0')]){_0x3658e4[_0xc29c('0xf1')](_0x47780b,_0x5d12a9,_0x34f73a,'reason19\x20machine....');}else{if(_0x47780b['countmachineretry']>=_0x4e4589[_0xc29c('0xf2')]){_0x3658e4[_0xc29c('0xf3')](_0x47780b,_0x5d12a9,_0x34f73a,_0xc29c('0x103'));}else{_0x3658e4[_0xc29c('0xc2')]({'active':![],'countmachineretry':_0x47780b[_0xc29c('0xe9')],'scheduledat':moment()[_0xc29c('0xf4')](_0x4e4589['dialMachineRetryFrequency'],_0xc29c('0xf6'))[_0xc29c('0x79')](_0xc29c('0x104')),'ContactId':_0x47780b[_0xc29c('0xd4')],'ListId':_0x47780b['ListId'],'VoiceQueueId':_0x47780b[_0xc29c('0xf7')]||undefined,'CampaignId':_0x47780b[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xf9')));_0x5d12a9({'reschedule':0x1});}}});}}};Dialer[_0xc29c('0x1d')][_0xc29c('0x34')]=function(_0x365bdb){var _0x1727dd=this['uniqueId'][_0x365bdb['uniqueid']];var _0x2aed3c=this;var _0x214a0d;if(_0x1727dd&&_0x1727dd[_0xc29c('0x58')]===_0xc29c('0x7c')){delete this[_0xc29c('0xdc')][_0x365bdb[_0xc29c('0xe3')]];this[_0xc29c('0xb5')](this[_0xc29c('0x22')][_0x1727dd[_0xc29c('0xb7')]]);this[_0xc29c('0x22')][_0x1727dd[_0xc29c('0xb7')]]['ivrAnswerCallsDay']+=0x1;_0x214a0d=new Hangup(_0x1727dd,_0x365bdb);this[_0xc29c('0xcd')](_0x214a0d)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x105')));this[_0xc29c('0xcb')](_0x214a0d)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x106')));}if(_0x1727dd&&_0x1727dd[_0xc29c('0x58')]!==_0xc29c('0x7c')&&isNotNull(this[_0xc29c('0x21')][_0x1727dd[_0xc29c('0xb7')]][_0xc29c('0x107')])){delete this[_0xc29c('0xdc')][_0x365bdb[_0xc29c('0xe3')]];this['updateOriginated'](this[_0xc29c('0x21')][_0x1727dd['queue']]);this[_0xc29c('0x21')][_0x1727dd[_0xc29c('0xb7')]][_0xc29c('0x61')]+=0x1;this['voiceQueues'][_0x1727dd[_0xc29c('0xb7')]][_0xc29c('0x60')]+=0x1;_0x214a0d=new Hangup(_0x1727dd,_0x365bdb);_0x214a0d[_0xc29c('0xa7')]=0x10;_0x214a0d[_0xc29c('0xa8')]=_0xc29c('0x108');_0x214a0d[_0xc29c('0xe4')]=_0xc29c('0x109');this[_0xc29c('0xcd')](_0x214a0d)['catch'](loggerCatch(_0xc29c('0x105')));this[_0xc29c('0xcb')](_0x214a0d)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x106')));}if(_0x1727dd&&_0x1727dd[_0xc29c('0x58')]!=='ivr'&&!isNotNull(this[_0xc29c('0x21')][_0x1727dd[_0xc29c('0xb7')]][_0xc29c('0x107')])){delete this['uniqueId'][_0x365bdb[_0xc29c('0xe3')]];this[_0xc29c('0xb5')](this[_0xc29c('0x21')][_0x1727dd['queue']]);this[_0xc29c('0x21')][_0x1727dd[_0xc29c('0xb7')]]['outboundUnknownCallsDay']+=0x1;_0x214a0d=new Hangup(_0x1727dd,_0x365bdb);_0x214a0d['state']=0xc;_0x214a0d[_0xc29c('0xa8')]=_0x365bdb[_0xc29c('0x10a')];_0x214a0d[_0xc29c('0xe4')]='Unknow';this[_0xc29c('0xcd')](_0x214a0d)['catch'](loggerCatch(_0xc29c('0x105')));this[_0xc29c('0xcb')](_0x214a0d)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x106')));}};Dialer[_0xc29c('0x1d')][_0xc29c('0x10b')]=function(_0x4c3c79){var _0x8d7cf3=this[_0xc29c('0xdc')][_0x4c3c79[_0xc29c('0xe3')]];var _0x59a800=this;if(this[_0xc29c('0x21')][_0x4c3c79['queue']]){if(_0x8d7cf3&&_0x8d7cf3['type']!==_0xc29c('0x7c')){delete this[_0xc29c('0xdc')][_0x4c3c79['uniqueid']];this[_0xc29c('0x21')][_0x4c3c79[_0xc29c('0xb7')]][_0xc29c('0x61')]+=0x1;var _0x2e95d0=new AgentComplete(_0x8d7cf3,_0x4c3c79);if(_0x4c3c79[_0xc29c('0x10c')]==='agent'){_0x2e95d0[_0xc29c('0x10d')]=this[_0xc29c('0x21')][_0x4c3c79['queue']]['dialQueueProject2']&&this[_0xc29c('0x21')][_0x4c3c79[_0xc29c('0xb7')]][_0xc29c('0x10e')]?moment()[_0xc29c('0x79')](_0xc29c('0x104')):undefined;}this[_0xc29c('0xcd')](_0x2e95d0)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x10f')));this['moveContactManagedDialer'](_0x2e95d0)[_0xc29c('0xb2')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xc29c('0x2c')]=function(_0x5b74e8){if(this['voiceQueues'][_0x5b74e8[_0xc29c('0xb7')]]){if(this[_0xc29c('0xdc')][_0x5b74e8[_0xc29c('0xe3')]]&&this['uniqueId'][_0x5b74e8[_0xc29c('0xe3')]][_0xc29c('0x58')]!==_0xc29c('0x7c')){this[_0xc29c('0xb5')](this[_0xc29c('0x21')][_0x5b74e8[_0xc29c('0xb7')]]);this['uniqueId'][_0x5b74e8[_0xc29c('0xe3')]][_0xc29c('0x110')]=moment()[_0xc29c('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc29c('0x1d')][_0xc29c('0x111')]=function(_0x1a7267){this['createHistory'](_0x1a7267)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x10f')));this[_0xc29c('0xcb')](_0x1a7267)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x112')));};Dialer['prototype'][_0xc29c('0x2e')]=function(_0x7cd125){var _0x4bdaff=this['uniqueId'][_0x7cd125[_0xc29c('0xe3')]];var _0x18b500=this;if(this[_0xc29c('0x21')][_0x7cd125['queue']]){if(_0x4bdaff&&_0x4bdaff['type']!=='ivr'){delete this[_0xc29c('0xdc')][_0x7cd125[_0xc29c('0xe3')]];this[_0xc29c('0xb5')](this['voiceQueues'][_0x7cd125[_0xc29c('0xb7')]]);_0x4bdaff[_0xc29c('0x113')]=moment()[_0xc29c('0x79')](_0xc29c('0x104'));var _0x203245=new QueueCallerAbandon(_0x4bdaff,_0x7cd125);if(getSeconds(_0x4bdaff['droptime'],_0x4bdaff['responsetime'])>=_0x4bdaff['dialQueueTimeout']){this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]][_0xc29c('0x84')]+=0x1;this[_0xc29c('0x21')][_0x7cd125['queue']][_0xc29c('0x66')]+=0x1;this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]][_0xc29c('0x6d')]+=0x1;_0x203245[_0xc29c('0xa7')]=0xa;_0x203245[_0xc29c('0xa8')]=_0xc29c('0x114');_0x203245[_0xc29c('0x115')]=_0xc29c('0x116');_0x203245[_0xc29c('0x10d')]=this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]]['dialQueueProject2']?moment()[_0xc29c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x203245[_0xc29c('0x101')]+=0x1;_0x203245[_0xc29c('0xff')]+=0x1;if(_0x203245[_0xc29c('0x101')]>=this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]]['dialDropMaxRetry']){this[_0xc29c('0x111')](_0x203245);}else{this[_0xc29c('0xc2')]({'active':![],'countdropretry':_0x203245[_0xc29c('0x101')],'scheduledat':moment()[_0xc29c('0xf4')](this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]]['dialDropRetryFrequency'],'minutes')[_0xc29c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4bdaff[_0xc29c('0xd4')],'ListId':_0x4bdaff[_0xc29c('0xd5')],'VoiceQueueId':_0x4bdaff['VoiceQueueId']||undefined,'CampaignId':_0x4bdaff['CampaignId']||undefined})[_0xc29c('0xb2')](loggerCatch('[rescheduleContact][Drop]'));var _0x37a8ec=new History(_0x203245);_0x37a8ec[_0xc29c('0xa7')]=0xa;_0x37a8ec[_0xc29c('0xa8')]='Drop';_0x37a8ec['starttime']=moment()[_0xc29c('0x79')](_0xc29c('0x104'));_0x37a8ec['endtime']=_0x37a8ec[_0xc29c('0xaa')];_0x37a8ec['calleridname']=_0x203245['calleridname'];_0x37a8ec[_0xc29c('0x117')]=_0x203245[_0xc29c('0x117')];this[_0xc29c('0xcd')](_0x37a8ec)[_0xc29c('0xb2')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x7cd125[_0xc29c('0xb7')]]['outboundDropCallsDayCallersExit']+=0x1;_0x203245[_0xc29c('0xa7')]=0xb;_0x203245[_0xc29c('0xa8')]=_0xc29c('0x118');_0x203245[_0xc29c('0x115')]='CALLEREXIT';_0x203245[_0xc29c('0xef')]+=0x1;_0x203245[_0xc29c('0xff')]+=0x1;if(_0x203245[_0xc29c('0xef')]>=this[_0xc29c('0x21')][_0x7cd125[_0xc29c('0xb7')]][_0xc29c('0x119')]){this[_0xc29c('0x111')](_0x203245);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x203245[_0xc29c('0xef')],'scheduledat':moment()[_0xc29c('0xf4')](this['voiceQueues'][_0x7cd125[_0xc29c('0xb7')]][_0xc29c('0x11a')],'minutes')[_0xc29c('0x79')](_0xc29c('0x104')),'ContactId':_0x4bdaff[_0xc29c('0xd4')],'ListId':_0x4bdaff['ListId'],'VoiceQueueId':_0x4bdaff[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4bdaff[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x11b')));var _0x37a8ec=new History(_0x203245);_0x37a8ec[_0xc29c('0xa7')]=0xb;_0x37a8ec[_0xc29c('0xa8')]=_0xc29c('0x118');_0x37a8ec[_0xc29c('0xaa')]=moment()['format'](_0xc29c('0x104'));_0x37a8ec[_0xc29c('0xa9')]=_0x37a8ec['starttime'];_0x37a8ec[_0xc29c('0x11c')]=_0x203245[_0xc29c('0x11c')];_0x37a8ec[_0xc29c('0x117')]=_0x203245[_0xc29c('0x117')];this[_0xc29c('0xcd')](_0x37a8ec)['catch'](loggerCatch(_0xc29c('0x11d')));}}}}};Dialer[_0xc29c('0x1d')][_0xc29c('0x36')]=function(_0x5497d6){if(this[_0xc29c('0x26')][_0x5497d6[_0xc29c('0xe3')]]){this[_0xc29c('0x26')][_0x5497d6[_0xc29c('0xe3')]][_0xc29c('0xb1')]=_0x5497d6[_0xc29c('0xb1')];}if(this[_0xc29c('0xdc')][_0x5497d6[_0xc29c('0xe3')]]){this[_0xc29c('0xdc')][_0x5497d6[_0xc29c('0xe3')]]['channel']=_0x5497d6[_0xc29c('0xb1')];}};Dialer['prototype']['syncQueueMember']=function(_0x24a823){if(strategy[this[_0xc29c('0x21')][this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]][_0xc29c('0xb7')]][_0xc29c('0x4f')]]===_0xc29c('0x11f')){if(this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]]&&_[_0xc29c('0xae')](this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]][_0xc29c('0x120')])&&_0x24a823[_0xc29c('0xb0')]==='1'&&_0x24a823[_0xc29c('0x121')]==='0'){if(this['agents'][_0x24a823[_0xc29c('0x122')]]){if(!this[_0xc29c('0x23')][_0x24a823['stateinterface']][_0xc29c('0x120')]){this[_0xc29c('0x23')][_0x24a823[_0xc29c('0x122')]]['locked']=!![];this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]][_0xc29c('0x120')]=!![];this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]]['stateinterface']=_0x24a823[_0xc29c('0x122')];}}}}else if((strategy[this[_0xc29c('0x21')][this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]]['queue']]['strategy']]||_0xc29c('0x1c'))===_0xc29c('0x1c')){if(this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]]){if(this[_0xc29c('0x23')][_0x24a823['stateinterface']]){this[_0xc29c('0x26')][_0x24a823['actionid']][_0xc29c('0x122')]=_0x24a823[_0xc29c('0x122')];if(_[_0xc29c('0xae')](this[_0xc29c('0x2b')][this['actions'][_0x24a823[_0xc29c('0x11e')]]['queue']])){this[_0xc29c('0x2b')][this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]][_0xc29c('0xb7')]]=[];}this[_0xc29c('0x2b')][this[_0xc29c('0x26')][_0x24a823[_0xc29c('0x11e')]]['queue']][_0xc29c('0x123')](_[_0xc29c('0x8f')](_[_0xc29c('0xd3')](this[_0xc29c('0x26')][_0x24a823['actionid']],[_0xc29c('0x124'),_0xc29c('0x122')]),{'status':_0x24a823[_0xc29c('0xb0')],'paused':_0x24a823[_0xc29c('0x121')]}));}}}};function unlockQueueStatus(_0x55dc69,_0x582472){setTimeout(function(){if(_['isUndefined'](_0x55dc69[_0xc29c('0x125')])){loggerBooked[_0xc29c('0x96')](_0xc29c('0x126'),_0x582472);}_0x55dc69[_0xc29c('0x125')]=!![];loggerBooked[_0xc29c('0x7f')](_0xc29c('0x127'),_0x582472,JSON[_0xc29c('0x4a')](_[_0xc29c('0xd3')](_0x55dc69,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0xc29c('0x1d')][_0xc29c('0x3a')]=function(_0x2849c2){var _0x29d6be=this;var _0x70f15e=_0x29d6be['voiceQueues'][_0x29d6be['actions'][_0x2849c2[_0xc29c('0x11e')]]['queue']];if(strategy[this[_0xc29c('0x21')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]][_0xc29c('0x4f')]]===_0xc29c('0x11f')){if(this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]&&this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]['stateinterface']){this[_0xc29c('0x128')]['run'](this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0x124')],this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0x122')])['catch'](function(_0x2783bf){logger[_0xc29c('0x96')](_0xc29c('0x129'),util[_0xc29c('0x98')](_0x2783bf,{'showHidden':![],'depth':null}));})[_0xc29c('0x20')](function(){_0x29d6be[_0xc29c('0xb5')](_0x29d6be['voiceQueues'][_0x29d6be[_0xc29c('0x26')][_0x2849c2['actionid']][_0xc29c('0xb7')]]);_0x29d6be[_0xc29c('0x23')][_0x29d6be['actions'][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0x122')]][_0xc29c('0x120')]=![];delete _0x29d6be[_0xc29c('0x26')][_0x2849c2['actionid']];unlockQueueStatus(_0x70f15e);});}else{this[_0xc29c('0xb5')](this[_0xc29c('0x21')][this['actions'][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]]);this[_0xc29c('0xc2')]({'active':![],'ContactId':this['actions'][_0x2849c2['actionid']]['ContactId'],'ListId':this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xd5')],'VoiceQueueId':this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]['CampaignId']||undefined})[_0xc29c('0xb2')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]];unlockQueueStatus(_0x70f15e);}}else if((strategy[this[_0xc29c('0x21')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]][_0xc29c('0x4f')]]||_0xc29c('0x1c'))===_0xc29c('0x1c')){var _0x1646e2;if(this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]&&!_[_0xc29c('0x48')](this['queueBooked'][this[_0xc29c('0x26')][_0x2849c2['actionid']][_0xc29c('0xb7')]])){if(this[_0xc29c('0x12a')][_0x29d6be[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]]){this['queueBookedRR'][_0x29d6be['actions'][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]]=this[_0xc29c('0x12a')][this[_0xc29c('0x26')][_0x2849c2['actionid']]['queue']]?this[_0xc29c('0x12a')][this[_0xc29c('0x26')][_0x2849c2['actionid']][_0xc29c('0xb7')]]:this[_0xc29c('0x2b')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]]['queue']]?this[_0xc29c('0x2b')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]][_0xc29c('0x12b')]||0x0:0x0;}this[_0xc29c('0x2b')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]]['_rr']=this[_0xc29c('0x12a')][this[_0xc29c('0x26')][_0x2849c2[_0xc29c('0x11e')]][_0xc29c('0xb7')]];for(var _0x29943b=0x0;_0x29943b=0x0;})[_0xc29c('0xb2')](myreject(_0xf5155a)));}}else{_0x33c094[_0xc29c('0x123')](ami[_0xc29c('0xaf')]({'action':_0xc29c('0x144'),'command':util[_0xc29c('0x79')]('iftime\x20%s,%s',_0x30c984,!_[_0xc29c('0x87')](config[_0xc29c('0x13f')][_0x8a917c])?_0x8a917c:'')})['then'](function(_0x4aed64){return _0x4aed64['content'][_0xc29c('0x148')]('true')>=0x0;})[_0xc29c('0xb2')](myreject(_0xf5155a)));}BPromise['all'](_0x33c094)[_0xc29c('0x3e')](function(_0x3681d1){var _0x32d8c4=_[_0xc29c('0x14a')](_0x3681d1);if(_0x32d8c4){return _0x2c4d7f(_0x32d8c4);}else{_0x4019e4[_0xc29c('0x40')]=_0x28d939?_0xc29c('0x14b'):_0xc29c('0x14c');return _0xf5155a(msgResponse('[ifTime][promiseAll]',_0xc29c('0x13e'),_0xc29c('0x14d')+_0x28d939+'\x20'+_0x2c5b43+_0xc29c('0x14e')+util[_0xc29c('0x98')](_0x30c984,{'showHidden':![],'depth':null})+_0xc29c('0x14f')+_0x8a917c));}})['catch'](function(_0x388293){return _0xf5155a(msgResponse(_0xc29c('0x13c'),'Failure',JSON['stringify'](_0x388293)));});});};Dialer[_0xc29c('0x1d')][_0xc29c('0x150')]=function(_0x5290b8){var _0x19c927=this;return function(){switch(_0x5290b8[_0xc29c('0x5d')]){case _0xc29c('0x151'):freeVariablesPredictive(_0x5290b8);_0x19c927[_0xc29c('0x152')](_0x5290b8,0x1);break;case'power':freeVariablesPredictive(_0x5290b8);_0x19c927[_0xc29c('0x152')](_0x5290b8,_0x5290b8[_0xc29c('0x153')]);break;case'predictive':_0x19c927['predictive'](_0x5290b8);break;case _0xc29c('0x8'):freeVariablesPredictive(_0x5290b8);_0x19c927[_0xc29c('0x152')](_0x5290b8,0x1);break;default:freeVariablesPredictive(_0x5290b8);logger[_0xc29c('0x96')](_0xc29c('0x154'),_0x5290b8['name'],_0xc29c('0x155'));}};};Dialer[_0xc29c('0x1d')][_0xc29c('0x156')]=function(_0x215822){return BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](cmHopper[_0xc29c('0x157')](_0x215822['id'],previewRecallmeReminderInterval))[_0xc29c('0x3e')](function(_0x32e635){for(var _0x15b4b9=0x0;_0x15b4b9<_0x32e635[_0xc29c('0x143')];_0x15b4b9++){var _0x327332=_0x32e635[_0x15b4b9]['Agent'][_0xc29c('0x41')];if(_0x327332)io['to'](util['format'](_0xc29c('0x158'),_0x327332))['emit'](_0xc29c('0x159'),{'hopper':_0x32e635[_0x15b4b9]});}})[_0xc29c('0xb2')](function(_0x5e668b){});};Dialer[_0xc29c('0x1d')][_0xc29c('0x15a')]=function(_0x29f449){var _0x52aa4a=this;return function(){_0x52aa4a[_0xc29c('0x15b')](_0x29f449);};};Dialer[_0xc29c('0x1d')][_0xc29c('0xb')]=function(_0x144346){var _0x4f281a=this;if(isNotPreview(_0x144346[_0xc29c('0x5d')])){if(isVoiceQueueOutbound(_0x144346[_0xc29c('0x58')])&&isActive(_0x144346[_0xc29c('0x5c')])){_0x144346['sendMessageOneNotActive']=!![];BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](checkIsLoggedIn(_0x144346,_0x144346[_0xc29c('0x52')]))[_0xc29c('0x3e')](checkIsActive(_0x144346,_0x144346[_0xc29c('0x5c')]))[_0xc29c('0x3e')](checkInterval(_0x144346))[_0xc29c('0x3e')](_0x4f281a[_0xc29c('0x136')](_0x144346))[_0xc29c('0x3e')](_0x4f281a['checkIfTime'](_0x144346['dialGlobalInterval'],_0x144346['dialTimezone'],_0x144346[_0xc29c('0x41')],_0x144346))[_0xc29c('0x3e')](_0x4f281a[_0xc29c('0x13d')](_0x144346['Interval'],_0x144346[_0xc29c('0x15c')],_0x144346[_0xc29c('0x41')],_0x144346))['then'](_0x4f281a['checkDialMethod'](_0x144346))[_0xc29c('0xb2')](loggerCatchQueueSummary(_0xc29c('0x15d'),_0x144346));}else{notSendMessagesQueue(_0x144346);}}else{freeVariablesPredictive(_0x144346);if(_0x144346[_0xc29c('0x15e')]){_0x4f281a[_0xc29c('0x156')](_0x144346);}}};Dialer[_0xc29c('0x1d')]['syncCampaigns']=function(){var _0x5393d2=this;var _0x42e689;for(var _0x494cea in this[_0xc29c('0x22')]){if(typeof this[_0xc29c('0x22')][_0x494cea]!==_0xc29c('0x99')){_0x42e689=this[_0xc29c('0x22')][_0x494cea];if(isCampaignIvr(_0x42e689[_0xc29c('0x58')])&&isActive(_0x42e689[_0xc29c('0x78')])){_0x42e689['sendMessageOneNotActive']=!![];BPromise[_0xc29c('0xb9')]()[_0xc29c('0x3e')](checkIsActive(_0x42e689,_0x42e689[_0xc29c('0x78')]))[_0xc29c('0x3e')](checkInterval(_0x42e689))[_0xc29c('0x3e')](_0x5393d2[_0xc29c('0x136')](_0x42e689))[_0xc29c('0x3e')](_0x5393d2[_0xc29c('0x13b')](_0x42e689[_0xc29c('0x15f')],_0x42e689[_0xc29c('0x15c')],_0x42e689[_0xc29c('0x41')],_0x42e689))[_0xc29c('0x3e')](_0x5393d2['checkIfTimeIntervals'](_0x42e689[_0xc29c('0x44')],_0x42e689[_0xc29c('0x15c')],_0x42e689['name'],_0x42e689))[_0xc29c('0x3e')](_0x5393d2[_0xc29c('0x15a')](_0x42e689))[_0xc29c('0xb2')](loggerCatchQueueSummary(_0xc29c('0x160'),_0x42e689));}else{notSendMessagesCampaign(_0x42e689);}}}};function getCallerIdRandom(_0x5dadbd,_0x1d4645){var _0x5c2460;var _0x2d16aa;var _0x4a2986;if(_0x1d4645<=0x0){_0x1d4645=0x1;}_0x5c2460=new RegExp(_0xc29c('0x161')+_0x1d4645+'}$');_0x2d16aa=Math['pow'](0xa,_0x1d4645-0x1);_0x4a2986=Math['pow'](0xa,_0x1d4645)-0x1;return util[_0xc29c('0x79')]('%s',_[_0xc29c('0x162')](_0x5dadbd,_0x5c2460,_[_0xc29c('0x163')](_0x2d16aa,_0x4a2986)));}function extractCalleridName(_0x372711){var _0x5cc477=_0x372711[_0xc29c('0x164')](/"(.*?)"/);return _0x5cc477?_0x5cc477[0x1]:_0x372711;}function extractCalleridNumber(_0x493774){var _0x16e581=_0x493774[_0xc29c('0x164')](/<(.*?)>/);return _0x16e581?_0x16e581[0x1]:_0x493774;}Dialer['prototype'][_0xc29c('0x165')]=function(_0x2ba204,_0x16d68f){var _0x5cfb5c=this;var _0x55bb7b=uuid['v4']();this[_0xc29c('0x26')][_0x55bb7b]=new Action(_0x2ba204,_0x16d68f,_0x55bb7b);return new BPromise(function(_0x451bbe,_0x109a70){if(_['isUndefined'](_0x2ba204)&&typeof _0x2ba204!=='object'){return _0x109a70(msgResponse(_0xc29c('0x166'),'Failure',_0xc29c('0x167')));}if(_['isUndefined'](_0x16d68f['Contact'][_0xc29c('0x168')])||_0x16d68f[_0xc29c('0x169')][_0xc29c('0x168')]===null){return _0x109a70(msgResponse(_0xc29c('0x166'),_0xc29c('0x13e'),_0xc29c('0x16a')));}var _0x1131bd={'XMD-CALLERID':_0x5cfb5c[_0xc29c('0x26')][_0x55bb7b][_0xc29c('0x16b')](),'XMD-AGI':_0x2ba204['dialQueueProject']?util[_0xc29c('0x79')](_0xc29c('0x16c'),ipAgi,_0x2ba204['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x2ba204[_0xc29c('0x16d')]?util[_0xc29c('0x79')](_0xc29c('0x16c'),ipAgi,_0x2ba204[_0xc29c('0x16d')]):'NONE','XMD-QUEUE':_0x2ba204[_0xc29c('0x58')]===_0xc29c('0x4e')?util[_0xc29c('0x79')](_0xc29c('0x16e'),_0x2ba204[_0xc29c('0x41')],_0x2ba204[_0xc29c('0x16f')]||'',_0x2ba204[_0xc29c('0x10e')]?'c':'',_0x2ba204[_0xc29c('0x170')]||0x3):'NONE','XMD-CONTACTID':_0x16d68f[_0xc29c('0xd4')],'XMD-CDRTYPE':_0xc29c('0x171'),'CALLERID(all)':_0x5cfb5c['actions'][_0x55bb7b][_0xc29c('0x16b')](),'XMD-AMD':_0x2ba204[_0xc29c('0xe0')]?_0xc29c('0x172'):_0xc29c('0x173'),'XMD-DESTINATION':_0xc29c('0xdf')};if(_0x2ba204[_0xc29c('0xe0')]){_0x1131bd[_0xc29c('0x174')]=_0x2ba204[_0xc29c('0x175')]||0x9c4;_0x1131bd[_0xc29c('0x176')]=_0x2ba204[_0xc29c('0x177')]||0x5dc;_0x1131bd['XMD-AMDAFTERGREETINGSILENCE']=_0x2ba204[_0xc29c('0x178')]||0x320;_0x1131bd['XMD-AMDTOTALANALYSISTIME']=_0x2ba204[_0xc29c('0x179')]||0x1388;_0x1131bd[_0xc29c('0x17a')]=_0x2ba204[_0xc29c('0x17b')]||0x64;_0x1131bd[_0xc29c('0x17c')]=_0x2ba204['dialAMDBetweenWordsSilence']||0x32;_0x1131bd[_0xc29c('0x17d')]=_0x2ba204[_0xc29c('0x17e')]||0x3;_0x1131bd[_0xc29c('0x17f')]=_0x2ba204[_0xc29c('0x180')]||0x100;_0x1131bd[_0xc29c('0x181')]=_0x2ba204[_0xc29c('0x182')]||0x1388;}if(_0x2ba204[_0xc29c('0x58')]===_0xc29c('0x4e')){_0x1131bd['XMD-VOICEQUEUEID']=_0x16d68f['VoiceQueueId'];}else{_0x1131bd[_0xc29c('0x183')]=_0x16d68f['CampaignId'];}for(var _0x9d9f90 in _0x16d68f['Contact']){if(typeof _0x16d68f[_0xc29c('0x169')][_0x9d9f90]!==_0xc29c('0x99')){if(isNotNull(_0x16d68f[_0xc29c('0x169')][_0x9d9f90])&&_0x9d9f90!=='id'&&_0x9d9f90!==_0xc29c('0x184')&&_0x9d9f90!=='createdAt'&&_0x9d9f90!==_0xc29c('0x185')){_0x1131bd[util[_0xc29c('0x79')](_0xc29c('0x186'),_0xc29c('0x187'),_[_0xc29c('0x188')](_0x9d9f90))]=_0x16d68f[_0xc29c('0x169')][_0x9d9f90];}}}var _0x59d959=_0x5cfb5c['isTrunkReachable'](_0x2ba204[_0xc29c('0x77')])?getCallerId(_0x2ba204['Trunk'][_0xc29c('0x189')],_0x2ba204['dialOriginateCallerIdName'],_0x2ba204['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x2ba204[_0xc29c('0x18a')],_0x2ba204[_0xc29c('0x18b')]):_0x2ba204['dialOriginateCallerIdNumber']):getCallerId(_[_0xc29c('0xae')](_0x2ba204[_0xc29c('0x138')])?_0x2ba204[_0xc29c('0x77')][_0xc29c('0x189')]:_0x2ba204['TrunkBackup']['callerid'],_0x2ba204['dialOriginateCallerIdName'],_0x2ba204[_0xc29c('0x18b')]>0x0?getCallerIdRandom(_0x2ba204[_0xc29c('0x18a')],_0x2ba204[_0xc29c('0x18b')]):_0x2ba204[_0xc29c('0x18a')]);if(_0x59d959){_0x1131bd[_0xc29c('0x18c')]=_0x5cfb5c[_0xc29c('0x26')][_0x55bb7b][_0xc29c('0x18d')]=extractCalleridName(_0x59d959);_0x1131bd[_0xc29c('0x18e')]=_0x5cfb5c['actions'][_0x55bb7b][_0xc29c('0x18f')]=extractCalleridNumber(_0x59d959);}return ami[_0xc29c('0xaf')]({'actionid':_0x55bb7b,'action':_0xc29c('0x166'),'channel':_0x5cfb5c['isTrunkReachable'](_0x2ba204[_0xc29c('0x77')])?util[_0xc29c('0x79')]('SIP/%s/%s%s',_0x2ba204[_0xc29c('0x77')]['name'],isNotNull(_0x2ba204[_0xc29c('0x190')])?_0x2ba204[_0xc29c('0x190')]['trim']()||'':'',_0x2ba204[_0xc29c('0x191')]>0x0?_0x16d68f[_0xc29c('0x169')][_0xc29c('0x168')][_0xc29c('0x192')](_0x2ba204[_0xc29c('0x191')]):_0x16d68f[_0xc29c('0x169')][_0xc29c('0x168')]):util['format'](_0xc29c('0x193'),_[_0xc29c('0xae')](_0x2ba204[_0xc29c('0x138')])?_0x2ba204[_0xc29c('0x77')][_0xc29c('0x41')]:_0x2ba204[_0xc29c('0x138')][_0xc29c('0x41')],isNotNull(_0x2ba204[_0xc29c('0x190')])?_0x2ba204[_0xc29c('0x190')][_0xc29c('0x194')]()||'':'',_0x2ba204['dialCutDigit']>0x0?_0x16d68f[_0xc29c('0x169')][_0xc29c('0x168')]['substring'](_0x2ba204[_0xc29c('0x191')]):_0x16d68f[_0xc29c('0x169')][_0xc29c('0x168')]),'callerid':_0x59d959,'Exten':_0xc29c('0xdf'),'Context':_0xc29c('0x195'),'Priority':'1','variable':_0x1131bd,'timeout':(_0x2ba204[_0xc29c('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55bb7b})[_0xc29c('0x3e')](function(_0x504afe){return _0x451bbe(_0x504afe);})[_0xc29c('0xb2')](function(_0x4d659a){_0x2ba204[_0xc29c('0x196')]+=0x1;var _0x4eda9=new History(_0x5cfb5c['actions'][_0x55bb7b]);logger[_0xc29c('0x96')](util[_0xc29c('0x79')](_0xc29c('0x197'),JSON[_0xc29c('0x4a')](_0x4d659a)));_0x4eda9[_0xc29c('0xa7')]=0xe;_0x4eda9[_0xc29c('0xa8')]=_0xc29c('0x198');_0x4eda9[_0xc29c('0xaa')]=moment()[_0xc29c('0x79')](_0xc29c('0x104'));_0x4eda9[_0xc29c('0xa9')]=_0x4eda9[_0xc29c('0xaa')];_0x5cfb5c[_0xc29c('0xcd')](_0x4eda9)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x199')));_0x5cfb5c[_0xc29c('0xcb')](_0x4eda9)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x199')))['finally'](function(){delete _0x5cfb5c[_0xc29c('0x26')][_0x55bb7b];return _0x109a70(msgResponse(_0xc29c('0x166'),_0xc29c('0x49'),_0xc29c('0x19a')));});});});};Dialer[_0xc29c('0x1d')][_0xc29c('0x30')]=function(_0xbed756){var _0x27830e=this[_0xc29c('0x26')][_0xbed756[_0xc29c('0x11e')]];if(_0x27830e){delete this[_0xc29c('0x26')][_0xbed756[_0xc29c('0x11e')]];_0x27830e[_0xc29c('0x19b')]=moment()['format'](_0xc29c('0x104'));var _0x1c3da4=_0x27830e['type']==='ivr'?this[_0xc29c('0x22')][_0x27830e[_0xc29c('0xb7')]]:this[_0xc29c('0x21')][_0x27830e[_0xc29c('0x19c')]()];if(!this[_0xc29c('0x19d')](_0xbed756[_0xc29c('0x19e')])){this[_0xc29c('0xb5')](_0x1c3da4);return this[_0xc29c('0x19f')](_0x27830e,_0x1c3da4,_0xbed756)[_0xc29c('0xb2')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0xbed756['uniqueid']]=_0x27830e;}};Dialer[_0xc29c('0x1d')]['checkRetriveMax']=function(_0x1bc8ed,_0x290ebc,_0x2d89a2){var _0x4962a7=new History(_0x290ebc);if(_0x4962a7['countbusyretry']+_0x4962a7[_0xc29c('0x100')]+_0x4962a7[_0xc29c('0xed')]+_0x4962a7['countnosuchnumberretry']+_0x4962a7['countdropretry']+_0x4962a7[_0xc29c('0xef')]+_0x4962a7[_0xc29c('0xe9')]+_0x4962a7['countagentrejectretry']>=_0x2d89a2['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1bc8ed){case 0x3:if(_0x4962a7[_0xc29c('0xed')]>=_0x2d89a2[_0xc29c('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4962a7[_0xc29c('0xed')]+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0x1a1')],_0xc29c('0xf6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7[_0xc29c('0xd5')],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1a2')));break;case 0x5:if(_0x4962a7[_0xc29c('0xec')]>=_0x2d89a2[_0xc29c('0x1a3')]-0x1){return!![];}this[_0xc29c('0xc2')]({'active':![],'countbusyretry':_0x4962a7[_0xc29c('0xec')]+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0x1a4')],'minutes')[_0xc29c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7['ListId'],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1a5')));break;case 0x8:if(_0x4962a7['countcongestionretry']>=_0x2d89a2[_0xc29c('0x1a6')]-0x1){return!![];}this[_0xc29c('0xc2')]({'active':![],'countcongestionretry':_0x4962a7[_0xc29c('0x100')]+=0x1,'scheduledat':moment()['add'](_0x2d89a2['dialCongestionRetryFrequency'],_0xc29c('0xf6'))['format'](_0xc29c('0x104')),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7['ListId'],'VoiceQueueId':_0x4962a7['VoiceQueueId']||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4962a7[_0xc29c('0xee')]>=_0x2d89a2[_0xc29c('0x1a7')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x4962a7[_0xc29c('0xee')]+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0x1a8')],_0xc29c('0xf6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7['ListId'],'VoiceQueueId':_0x4962a7['VoiceQueueId']||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})['catch'](loggerCatch(_0xc29c('0x1a9')));}break;case 0xa:if(_0x4962a7['countdropretry']>=_0x2d89a2[_0xc29c('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x4962a7[_0xc29c('0x101')]+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0x1ab')],_0xc29c('0xf6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7[_0xc29c('0xd5')],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7['CampaignId']||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1ac')));break;case 0xb:if(_0x4962a7[_0xc29c('0xef')]>=_0x2d89a2['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xc29c('0xc2')]({'active':![],'countabandonedretry':_0x4962a7['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0x11a')],_0xc29c('0xf6'))[_0xc29c('0x79')](_0xc29c('0x104')),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7[_0xc29c('0xd5')],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4962a7[_0xc29c('0xe9')]>=_0x2d89a2[_0xc29c('0xf2')]-0x1){return!![];}this[_0xc29c('0xc2')]({'active':![],'countmachineretry':_0x4962a7['countmachineretry']+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2[_0xc29c('0xf5')],_0xc29c('0xf6'))[_0xc29c('0x79')](_0xc29c('0x104')),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7[_0xc29c('0xd5')],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x4962a7[_0xc29c('0x102')]>=_0x2d89a2['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xc29c('0xc2')]({'active':![],'countagentrejectretry':_0x4962a7[_0xc29c('0x102')]+=0x1,'scheduledat':moment()[_0xc29c('0xf4')](_0x2d89a2['dialAgentRejectRetryFrequency'],_0xc29c('0xf6'))[_0xc29c('0x79')](_0xc29c('0x104')),'ContactId':_0x4962a7[_0xc29c('0xd4')],'ListId':_0x4962a7[_0xc29c('0xd5')],'VoiceQueueId':_0x4962a7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x4962a7[_0xc29c('0xf8')]||undefined})['catch'](loggerCatch(_0xc29c('0x1ad')));break;default:return!![];}};Dialer[_0xc29c('0x1d')][_0xc29c('0x19f')]=function(_0x3a99c3,_0x5719a8,_0x29a9b6){var _0x258364=this;var _0x2fbb42=new History(_0x3a99c3);return new BPromise(function(_0x326804,_0x53320d){if(_[_0xc29c('0x87')](_0x5719a8)&&typeof _0x5719a8!==_0xc29c('0x1ae')){return _0x53320d(msgResponse(_0xc29c('0x1af'),'Failure',_0xc29c('0x1b0')));}if(_[_0xc29c('0x87')](_0x29a9b6)&&typeof _0x29a9b6!==_0xc29c('0x1ae')){return _0x53320d(msgResponse(_0xc29c('0x1af'),_0xc29c('0x13e'),'evt\x20is\x20undefine'));}switch(_0x29a9b6[_0xc29c('0x10c')]){case'0':_0x5719a8[_0xc29c('0x68')]+=0x1;_0x2fbb42[_0xc29c('0xa7')]=0x0;_0x2fbb42[_0xc29c('0xa8')]=_0xc29c('0x1b1');_0x2fbb42['countnosuchnumberretry']+=0x1;_0x2fbb42[_0xc29c('0xff')]+=0x1;ami[_0xc29c('0x4d')](_0xc29c('0x1b2'),ut[_0xc29c('0xe7')](_0x3a99c3,_0xc29c('0x1b3')));_0x258364[_0xc29c('0xcd')](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x258364[_0xc29c('0x1b4')](0x0,_0x3a99c3,_0x5719a8)){if(_0x2fbb42[_0xc29c('0xee')]>=_0x5719a8[_0xc29c('0x1a7')]){_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1b5'));}else{_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1b5'));}}break;case'3':_0x5719a8[_0xc29c('0x67')]+=0x1;_0x2fbb42['state']=0x3;_0x2fbb42[_0xc29c('0xa8')]='NoAnswer';_0x2fbb42[_0xc29c('0xed')]+=0x1;_0x2fbb42[_0xc29c('0xff')]+=0x1;ami['emit'](_0xc29c('0x1b6'),ut['buildObj'](_0x3a99c3,_0xc29c('0x1b7')));_0x258364[_0xc29c('0xcd')](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1b8')));if(_0x258364[_0xc29c('0x1b4')](0x3,_0x3a99c3,_0x5719a8)){if(_0x2fbb42[_0xc29c('0xed')]>=_0x5719a8[_0xc29c('0x1a0')]){_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1b9'));}else{_0x258364['stateGlobal'](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1b9'));}}break;case'5':_0x5719a8[_0xc29c('0x63')]+=0x1;_0x2fbb42[_0xc29c('0xa7')]=0x5;_0x2fbb42[_0xc29c('0xa8')]=_0xc29c('0x1ba');_0x2fbb42[_0xc29c('0xec')]+=0x1;_0x2fbb42[_0xc29c('0xff')]+=0x1;ami[_0xc29c('0x4d')]('custom:agentbusy',ut[_0xc29c('0xe7')](_0x3a99c3,_0xc29c('0x1bb')));_0x258364[_0xc29c('0xcd')](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x258364[_0xc29c('0x1b4')](0x5,_0x3a99c3,_0x5719a8)){if(_0x2fbb42[_0xc29c('0xec')]>=_0x5719a8[_0xc29c('0x1a3')]){_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,'reason\x205\x20busy');}else{_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1bc'));}}break;case'8':_0x5719a8[_0xc29c('0x64')]+=0x1;_0x2fbb42[_0xc29c('0xa7')]=0x8;_0x2fbb42[_0xc29c('0xa8')]=_0xc29c('0x1bd');_0x2fbb42[_0xc29c('0x100')]+=0x1;_0x2fbb42['countglobal']+=0x1;ami[_0xc29c('0x4d')](_0xc29c('0x1be'),ut[_0xc29c('0xe7')](_0x3a99c3,_0xc29c('0x1bf')));_0x258364['createHistory'](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1c0')));if(_0x258364['checkRetriveMax'](0x8,_0x3a99c3,_0x5719a8)){if(_0x2fbb42[_0xc29c('0x100')]>=_0x5719a8[_0xc29c('0x1a6')]){_0x258364['createStateFinal'](_0x2fbb42,_0x326804,_0x53320d,'reason\x208\x20congestion');}else{_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1c1'));}}break;case'11':_0x5719a8[_0xc29c('0x1c2')]+=0x1;_0x2fbb42[_0xc29c('0xa7')]=0xb;_0x2fbb42['statedesc']='Abandoned';_0x2fbb42[_0xc29c('0xef')]+=0x1;_0x2fbb42['countglobal']+=0x1;_0x258364[_0xc29c('0xcd')](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x11d')));if(_0x258364['checkRetriveMax'](0xb,_0x3a99c3,_0x5719a8)){if(_0x2fbb42['countabandonedretry']>=_0x5719a8[_0xc29c('0x119')]){_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1c3'));}else{_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1c3'));}}break;case'20':_0x5719a8[_0xc29c('0x1c4')]+=0x1;_0x2fbb42['state']=0x14;_0x2fbb42['statedesc']=_0xc29c('0x1c5');_0x2fbb42[_0xc29c('0x102')]+=0x1;_0x2fbb42['countglobal']+=0x1;ami['emit'](_0xc29c('0x1c6'),ut[_0xc29c('0xe7')](_0x3a99c3,_0xc29c('0x1c7')));_0x258364['createHistory'](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1c8')));if(_0x258364[_0xc29c('0x1b4')](0x14,_0x3a99c3,_0x5719a8)){if(_0x2fbb42[_0xc29c('0x102')]>=_0x5719a8[_0xc29c('0x1c9')]){_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1ca'));}else{_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0xc29c('0x1ca'));}}break;default:_0x5719a8[_0xc29c('0x6a')]+=0x1;_0x2fbb42[_0xc29c('0xa7')]=0xc;_0x2fbb42[_0xc29c('0xa8')]=_0x29a9b6[_0xc29c('0x10c')];_0x258364['createHistory'](_0x2fbb42)[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1cb')));if(_0x258364[_0xc29c('0x1b4')](_0x29a9b6['reason'],_0x3a99c3,_0x5719a8)){if(_0x2fbb42['countbusyretry']+_0x2fbb42[_0xc29c('0x100')]+_0x2fbb42[_0xc29c('0xed')]+_0x2fbb42[_0xc29c('0xee')]+_0x2fbb42['countdropretry']+_0x2fbb42[_0xc29c('0xef')]+_0x2fbb42[_0xc29c('0xe9')]+_0x2fbb42[_0xc29c('0x102')]>=_0x5719a8[_0xc29c('0xf0')]){_0x258364[_0xc29c('0xf1')](_0x2fbb42,_0x326804,_0x53320d,_0x29a9b6['reason']);}else{_0x258364[_0xc29c('0xf3')](_0x2fbb42,_0x326804,_0x53320d,_0x29a9b6['reason']);}}}});};Dialer[_0xc29c('0x1d')]['stateGlobal']=function(_0x39093f,_0x1a50a1,_0x40299d,_0x26e196){var _0xacc648=new Final(_0x39093f);_0xacc648['state']=0xf;_0xacc648[_0xc29c('0xa8')]=_0xc29c('0x1cc');this[_0xc29c('0xf3')](_0xacc648,_0x1a50a1,_0x40299d,_0x26e196);};Dialer[_0xc29c('0x1d')][_0xc29c('0xf3')]=function(_0xa65b49,_0x2b6707,_0x3b51cf,_0x39e789){this['moveContactManagedDialer'](_0xa65b49)[_0xc29c('0x3e')](function(){return _0x2b6707(msgResponse(_0xc29c('0x1af'),_0xc29c('0xd8'),_0x39e789));})['catch'](function(){return _0x3b51cf(msgResponse('[moveContactManagedDialer][0]',_0xc29c('0x13e'),_0xc29c('0x1cd')));});};Dialer['prototype']['predictive']=function(_0x5ad793){var _0x3603d6=_0x5ad793[_0xc29c('0x1ce')]/0x64;var _0x584f6e=_0x5ad793['outboundDropCallsDayTimeout']/(_0x5ad793[_0xc29c('0x66')]+_0x5ad793['outboundAnswerCallsDay']);var _0x14cdd6=Math[_0xc29c('0x1cf')](_0x5ad793[_0xc29c('0x70')]*(_0x5ad793[_0xc29c('0x1d0')]/0x64));var _0x3ea949=Math[_0xc29c('0x1cf')](_0x5ad793[_0xc29c('0x70')]*(_0x5ad793[_0xc29c('0x1d1')]/0x64));var _0x1c4198=_0x5ad793[_0xc29c('0x51')]+_0x5ad793[_0xc29c('0x56')];var _0x136848=Math[_0xc29c('0x1d2')](_0x5ad793[_0xc29c('0x73')]*_0x5ad793[_0xc29c('0x75')]*_0x5ad793['predictiveIntervalHitRate']*_0x5ad793['predictiveIntervalMultiplicativeFactor']);if(_[_0xc29c('0x87')](_0x5ad793['startProgressive'])){if(!_[_0xc29c('0x87')](_0x5ad793[_0xc29c('0x29')])){_0x5ad793[_0xc29c('0x29')]=undefined;loggerPredictive[_0xc29c('0x96')](_0xc29c('0x1d3'),_0xc29c('0x1d4'));}if(!_[_0xc29c('0x87')](_0x5ad793[_0xc29c('0x91')])){loggerPredictive['error'](_0xc29c('0x1d3'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5ad793[_0xc29c('0x91')]);_0x5ad793['handlePredictive']=undefined;}_0x5ad793[_0xc29c('0x2a')]=moment()[_0xc29c('0x79')](_0xc29c('0x104'));loggerPredictive['info'](_0x5ad793[_0xc29c('0x41')],_0xc29c('0x1d5'),_0x5ad793[_0xc29c('0x2a')]);this['handlePower'](_0x5ad793,0x1);}else if(ifInterval(_0x5ad793[_0xc29c('0x1d6')],_0x5ad793[_0xc29c('0x2a')])){this[_0xc29c('0x152')](_0x5ad793,0x1);loggerPredictiveCalls[_0xc29c('0x7f')]('[startMethodPredictive][StartProgressive][Loop]',_0x5ad793['startProgressive'],_0x5ad793[_0xc29c('0x41')]);_0x5ad793[_0xc29c('0x73')]=0x0;_0x5ad793[_0xc29c('0x6d')]=0x0;}else if(_0x3603d6<_0x584f6e&&_0x5ad793[_0xc29c('0x1d7')]===_0xc29c('0x1d8')){freeVariablesPredictive(_0x5ad793);loggerPredictive[_0xc29c('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc29c('0x1d9'),_0x584f6e,_0xc29c('0x2a'),_0x5ad793[_0xc29c('0x41')]);}else if(_0x136848<_0x5ad793[_0xc29c('0x6d')]&&_0x5ad793[_0xc29c('0x1d7')]===_0xc29c('0x1d8')){freeVariablesPredictive(_0x5ad793);loggerPredictive[_0xc29c('0x7f')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc29c('0x1da'),_0x136848,_0xc29c('0x1db'),_0x5ad793['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x5ad793[_0xc29c('0x41')]);}else if(!ifInterval(_0x5ad793[_0xc29c('0x1d6')],_0x5ad793['startProgressive'])&&_[_0xc29c('0x87')](_0x5ad793[_0xc29c('0x29')])&&!_['isUndefined'](_0x5ad793[_0xc29c('0x2a')])){_0x5ad793['startPredictive']=moment()[_0xc29c('0x79')](_0xc29c('0x104'));loggerPredictive[_0xc29c('0x7f')](_0x5ad793['name'],'started\x20in\x20predictive\x20at',_0x5ad793[_0xc29c('0x29')]);this[_0xc29c('0xbf')](_0x5ad793['dialPredictiveInterval'])[_0xc29c('0x3e')](this['getDataPredictive'](_0x5ad793))[_0xc29c('0x3e')](mergeDataErlangB(_0x5ad793))[_0xc29c('0x3e')](this[_0xc29c('0x1dc')](_0x5ad793))[_0xc29c('0xb2')](loggerCatchPredictive(_0xc29c('0x1dd'),_0x5ad793));}else if(!ifInterval(_0x5ad793[_0xc29c('0x1d6')],_0x5ad793['startPredictive'])){_0x5ad793[_0xc29c('0x6d')]=0x0;_0x5ad793[_0xc29c('0x29')]=moment()[_0xc29c('0x79')](_0xc29c('0x104'));loggerPredictive[_0xc29c('0x7f')](_0x5ad793['name'],_0xc29c('0x1de'),_0x5ad793[_0xc29c('0x29')]);clearInterval(_0x5ad793[_0xc29c('0x91')]);_0x5ad793['handlePredictive']=undefined;this[_0xc29c('0xbf')](_0x5ad793['dialPredictiveInterval'])['then'](this[_0xc29c('0x1df')](_0x5ad793))[_0xc29c('0x3e')](mergeDataErlangB(_0x5ad793))['then'](this[_0xc29c('0x1dc')](_0x5ad793))['catch'](loggerCatchPredictive(_0xc29c('0x1e0'),_0x5ad793));}else if(_0x5ad793[_0xc29c('0x70')]&&_0x1c4198<_0x5ad793[_0xc29c('0x70')]-_0x3ea949){freeVariablesPredictive(_0x5ad793);loggerPredictive[_0xc29c('0x7f')](_0x5ad793[_0xc29c('0x41')],_0xc29c('0x1e1'),_0x1c4198,_0xc29c('0x1e2'),_0x5ad793[_0xc29c('0x70')],'-',_0x3ea949,'=',_0x5ad793[_0xc29c('0x70')]-_0x3ea949,')');}else if(_0x5ad793['predictiveIntervalAvailable']&&_0x1c4198>_0x5ad793[_0xc29c('0x70')]+_0x14cdd6){freeVariablesPredictive(_0x5ad793);loggerPredictive['info'](_0x5ad793[_0xc29c('0x41')],_0xc29c('0x1e1'),_0x1c4198,_0xc29c('0x1e3'),_0x5ad793[_0xc29c('0x70')],'+',_0x14cdd6,'=',_0x5ad793[_0xc29c('0x70')]+_0x14cdd6,')');}};Dialer[_0xc29c('0x1d')]['getDataPredictive']=function(_0x142c73){var _0x493239=this;return function(_0x833b83){return new BPromise(function(_0x48b978,_0x555534){_[_0xc29c('0x8f')](_0x142c73,_0x833b83[0x0]);if(checkGetDataPredictive(_0x833b83[0x0])){var _0x5cb16b=_0x142c73[_0xc29c('0x70')]=_0x142c73['talking']+_0x142c73['available'];var _0x31d853=_0x142c73[_0xc29c('0x1d6')]*0x3c;var _0x9f298b=_0x833b83[0x0]['predictiveIntervalAvgTalktime']+_0x833b83[0x0]['predictiveIntervalAvgHoldtime'];var _0x256616=(_0x833b83[0x0][_0xc29c('0x83')]+_0x833b83[0x0][_0xc29c('0x84')]+_0x833b83[0x0][_0xc29c('0x1e4')])/_0x833b83[0x0][_0xc29c('0x71')];_0x142c73[_0xc29c('0x1e5')]=_0x256616>0x0?_0x256616:0x1;switch(_0x142c73[_0xc29c('0x1d7')]){case _0xc29c('0x1d8'):var _0xa05c2c=_0x142c73[_0xc29c('0x1ce')]/0x64;return _0x493239[_0xc29c('0x1e6')](_0x5cb16b,_0x31d853,_0x9f298b,_0x256616,_0xa05c2c)[_0xc29c('0x3e')](function(_0x168af5){return _0x48b978(_0x168af5);});case'agentBusyFactor':var _0x320707=_0x142c73['dialPredictiveOptimizationPercentage']/0x64;return _0x493239[_0xc29c('0x1e7')](_0x5cb16b,_0x31d853,_0x9f298b,_0x256616,_0x320707)['then'](function(_0x450aa0){return _0x48b978(_0x450aa0);});default:return _0x555534(msgResponse(_0xc29c('0x1e8'),_0xc29c('0x13e'),_0xc29c('0x1e9')));}}else{return _0x555534(msgResponse('[getDataPredictive]',_0xc29c('0x13e'),_0xc29c('0x1ea')));}});};};Dialer['prototype'][_0xc29c('0x1eb')]=function(_0x57aa88){var _0x51b967=this;return function(_0x467936){return new BPromise(function(_0x1bbdee,_0x110680){_[_0xc29c('0x8f')](_0x57aa88,_0x467936[0x0]);if(checkGetDataPredictive(_0x467936[0x0])){loggerPredictive[_0xc29c('0x7f')](JSON['stringify'](_0x467936[0x0]));if(_0x57aa88[_0xc29c('0x1d7')]==='dropRate'){return _0x51b967[_0xc29c('0xca')](_0x57aa88['id'])['then'](function(_0x2ae09d){var _0x137278=_0x57aa88[_0xc29c('0x52')]-_0x2ae09d[0x0][_0xc29c('0x1ec')];var _0xc0a141=_0x57aa88[_0xc29c('0x1d6')]*0x3c;var _0x2a53f9=_0x467936[0x0][_0xc29c('0x86')]+_0x467936[0x0][_0xc29c('0x6b')];var _0x4d1176=(_0x467936[0x0][_0xc29c('0x83')]+_0x467936[0x0][_0xc29c('0x84')]+_0x467936[0x0][_0xc29c('0x1e4')])/_0x467936[0x0][_0xc29c('0x71')];var _0x5d249b=_0x57aa88[_0xc29c('0x1ce')]/0x64;_0x57aa88[_0xc29c('0x6f')]=_0x2ae09d[0x0]['outboundQueuePauses']||0x0;_0x57aa88[_0xc29c('0x1e5')]=_0x4d1176>0x0?_0x4d1176:0x1;return _0x51b967[_0xc29c('0x1e6')](_0x137278,_0xc0a141,_0x2a53f9,_0x4d1176,_0x5d249b);})[_0xc29c('0x3e')](function(_0x302bbb){return _0x1bbdee(_0x302bbb);})[_0xc29c('0xb2')](function(_0x259299){return _0x110680(msgResponse(_0xc29c('0x1ed'),_0xc29c('0x13e'),JSON[_0xc29c('0x4a')](_0x259299)));});}if(_0x57aa88['dialPredictiveOptimization']===_0xc29c('0x1ee')){return _0x51b967[_0xc29c('0xca')](_0x57aa88['id'])[_0xc29c('0x3e')](function(_0x4609fa){var _0x4cf6d1=_0x57aa88[_0xc29c('0x52')]-_0x4609fa[0x0][_0xc29c('0x1ec')];var _0x592252=_0x57aa88[_0xc29c('0x1d6')]*0x3c;var _0x49253e=_0x467936[0x0][_0xc29c('0x86')]+_0x467936[0x0][_0xc29c('0x6b')];var _0x1d5a31=(_0x467936[0x0]['predictiveIntervalAnsweredCalls']+_0x467936[0x0][_0xc29c('0x84')]+_0x467936[0x0][_0xc29c('0x1e4')])/_0x467936[0x0][_0xc29c('0x71')];var _0x1a97aa=_0x57aa88[_0xc29c('0x1ce')]/0x64;_0x57aa88[_0xc29c('0x6f')]=_0x4609fa[0x0][_0xc29c('0x1ec')]||0x0;_0x57aa88[_0xc29c('0x1e5')]=_0x1d5a31>0x0?_0x1d5a31:0x1;return _0x51b967[_0xc29c('0x1e7')](_0x4cf6d1,_0x592252,_0x49253e,_0x1d5a31,_0x1a97aa);})[_0xc29c('0x3e')](function(_0x3e749c){return _0x1bbdee(_0x3e749c);})[_0xc29c('0xb2')](function(_0x43d91b){return _0x110680(msgResponse(_0xc29c('0x1ed'),'Failure',JSON[_0xc29c('0x4a')](_0x43d91b)));});}}else{return _0x110680(msgResponse(_0xc29c('0x1e8'),'Failure',_0xc29c('0x1ea')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x32b3ae){var _0x191a7b=this;return function(){var _0x524602=0x0;var _0x40be81=Math[_0xc29c('0x1d2')](_0x32b3ae[_0xc29c('0x74')]*0x3e8);if(_0x40be81>0x0){_0x40be81=_0x40be81<0x64?0x64:_0x40be81;loggerPredictive[_0xc29c('0x7f')](_0x32b3ae['name'],_0xc29c('0x1ef'),_0x40be81,_0xc29c('0x4b'));_0x32b3ae[_0xc29c('0x91')]=setInterval(function(){_0x191a7b[_0xc29c('0x91')](_0x32b3ae);loggerPredictiveCalls[_0xc29c('0x7f')](_0xc29c('0x1f0'),_0x524602+=0x1);},_0x40be81);}else{loggerPredictive[_0xc29c('0x7f')](_0x32b3ae[_0xc29c('0x41')],_0xc29c('0x1f1'));}};};Dialer[_0xc29c('0x1d')][_0xc29c('0x1f2')]=function(_0xe0d04f,_0x28f6b7){var _0x105b1b=this;return function(_0xe8d6d5){if(_['isEmpty'](_0xe8d6d5)){if(_[_0xc29c('0xae')](_0x28f6b7[_0xc29c('0xd6')])||!_0x28f6b7[_0xc29c('0x1f3')]){if(_0xe0d04f[_0xc29c('0x5d')]==='booked'){_0xe0d04f[_0xc29c('0x125')]=_[_0xc29c('0x87')](_0xe0d04f[_0xc29c('0x125')])?!![]:_0xe0d04f[_0xc29c('0x125')];var _0x53dd5d=uuid['v4']();_0x105b1b[_0xc29c('0x26')][_0x53dd5d]=new Action(_0xe0d04f,_0x28f6b7,_0x53dd5d);loggerBooked[_0xc29c('0x7f')](_0xc29c('0x1f4'),_0x53dd5d,_0xc29c('0x1f5'),JSON[_0xc29c('0x4a')](_0xe0d04f[_0xc29c('0x125')]),'Queue:\x20',_0xe0d04f['name']);if(_0xe0d04f[_0xc29c('0x125')]){_0xe0d04f['queueStatusComplete']=![];_0x105b1b['queueBooked'][_0x105b1b['actions'][_0x53dd5d][_0xc29c('0xb7')]]=[];ami['Action']({'actionid':_0x53dd5d,'action':_0xc29c('0x1f6'),'queue':_0xe0d04f[_0xc29c('0x41')]})[_0xc29c('0xb2')](function(){_0x105b1b[_0xc29c('0xb5')](_0xe0d04f);_0x105b1b[_0xc29c('0xc2')]({'active':![],'ContactId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d][_0xc29c('0xd4')],'ListId':_0x105b1b['actions'][_0x53dd5d][_0xc29c('0xd5')],'VoiceQueueId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d][_0xc29c('0xf7')]||undefined,'CampaignId':_0x105b1b['actions'][_0x53dd5d][_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x1f7')));delete _0x105b1b[_0xc29c('0x26')][_0x53dd5d];});}else{loggerBooked[_0xc29c('0x7f')](_0xc29c('0x1f8'),JSON['stringify'](_0xe0d04f[_0xc29c('0x125')]),_0xc29c('0x1f9'),_0xe0d04f[_0xc29c('0x41')]);_0x105b1b[_0xc29c('0xb5')](_0xe0d04f);_0x105b1b[_0xc29c('0xc2')]({'active':![],'ContactId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d]['ContactId'],'ListId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d][_0xc29c('0xd5')],'VoiceQueueId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d][_0xc29c('0xf7')]||undefined,'CampaignId':_0x105b1b[_0xc29c('0x26')][_0x53dd5d][_0xc29c('0xf8')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x105b1b[_0xc29c('0x26')][_0x53dd5d];}}else{return _0x105b1b[_0xc29c('0x165')](_0xe0d04f,_0x28f6b7);}}else{if(getDiff(_0x28f6b7[_0xc29c('0x1fa')])<_0xe0d04f[_0xc29c('0x1fb')]*0x3c){if(_0x28f6b7['Agent']&&!_0x28f6b7[_0xc29c('0x1fc')][_0xc29c('0x1fd')]){_0x105b1b[_0xc29c('0x128')][_0xc29c('0x1fe')](_0x28f6b7['id'])['finally'](function(){_0x105b1b[_0xc29c('0xb5')](_0xe0d04f);});}else{_0x105b1b['unlockContact']({'active':![]},_0x28f6b7['id'],0x1)[_0xc29c('0x20')](function(){_0x105b1b[_0xc29c('0xb5')](_0xe0d04f);});}}else{_0xe0d04f[_0xc29c('0x69')]+=0x1;_0x105b1b[_0xc29c('0xb5')](_0xe0d04f);if(_0xe0d04f[_0xc29c('0x1ff')]){_0x105b1b[_0xc29c('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28f6b7[_0xc29c('0xd4')],'ListId':_0x28f6b7[_0xc29c('0xd5')],'VoiceQueueId':_0x28f6b7[_0xc29c('0xf7')]||undefined,'CampaignId':_0x28f6b7[_0xc29c('0xf8')]||undefined})[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x200')));_0x105b1b[_0xc29c('0xcd')](createObjHistory(_0xe0d04f,_0x28f6b7,_0xc29c('0x201'),0x17,_0xc29c('0x202')))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0x203')));}else{_0x105b1b[_0xc29c('0xd2')](createObjHistory(_0xe0d04f,_0x28f6b7,_0xc29c('0x204'),0x16,_0xc29c('0x205')),_0xc29c('0x206'),'[Originate][HistoryRecallClose]');}}}}else{_0xe0d04f[_0xc29c('0x62')]+=0x1;_0x105b1b[_0xc29c('0xd2')](createObjHistory(_0xe0d04f,_0x28f6b7,'BLACKLIST',0xd,'Blacklist'),_0xc29c('0x207'),_0xc29c('0x208'));throw'inBlackList';}};};Dialer[_0xc29c('0x1d')]['handleIvr']=function(_0x3b5871){var _0x3368e7=this;var _0x48c712=_0x3b5871[_0xc29c('0x209')]-_0x3b5871['originated']-_0x3b5871[_0xc29c('0xc6')];emitCampaignSummary(_0x3b5871);if(_0x48c712>0x0){if(_0x48c712>this[_0xc29c('0x25')]){_0x48c712=this[_0xc29c('0x25')];}_0x3b5871[_0xc29c('0xc6')]+=_0x48c712;this[_0xc29c('0xc8')](_0x3b5871['id'],_0x48c712,_0x3b5871[_0xc29c('0x20a')],_0x3b5871)['then'](function(_0x4209aa){_0x3b5871[_0xc29c('0xc6')]-=_0x48c712;_0x3b5871[_0xc29c('0xc6')]=_0x3b5871['temp']>0x0?_0x3b5871['temp']:0x0;if(!checkContactEmpty(_0x4209aa)){_0x3b5871[_0xc29c('0x40')]=_0xc29c('0x9f');logger['info'](_0xc29c('0x20b')+_0x3b5871['name']);}else{_0x3b5871[_0xc29c('0x72')]+=_0x4209aa[_0xc29c('0x143')];_0x3b5871['message']='RUNNING';for(var _0x431821=0x0;_0x431821<_0x4209aa[_0xc29c('0x143')];_0x431821+=0x1){_0x3b5871[_0xc29c('0x20c')]+=0x1;if(_['isNil'](_0x4209aa[_0x431821])||_[_0xc29c('0xae')](_0x4209aa[_0x431821][_0xc29c('0x169')])||_[_0xc29c('0xae')](_0x4209aa[_0x431821][_0xc29c('0x169')]['phone'])){_0x3368e7[_0xc29c('0xd0')](_0xc29c('0x20d'),_0x3b5871,_0x4209aa[_0x431821]);}else{_0x3368e7[_0xc29c('0xbd')](_[_0xc29c('0xd3')](_0x4209aa[_0x431821],[_0xc29c('0xf8'),_0xc29c('0x20e')]))['then'](_0x3368e7['checkContactBlack'](_0x3b5871,_0x4209aa[_0x431821]))['catch'](_0x3368e7[_0xc29c('0x20f')]('[actionOriginateIvr]\x20',_0x3b5871));}}}})['catch'](loggerGetContactDialer(_0xc29c('0x210'),_0x3b5871,_0x48c712));}};Dialer[_0xc29c('0x1d')][_0xc29c('0x152')]=function(_0x5561f1,_0x458dd2){var _0x28fee6=this;var _0x5803c1=[];var _0x59d472=_0x458dd2>=0x1?_0x458dd2:0x1;if(_0x5561f1['dialMethod']===_0xc29c('0x8')){_0x59d472=0x1;}var _0x1846a6=Math['floor'](_0x5561f1[_0xc29c('0x51')]*_0x59d472)-_0x5561f1[_0xc29c('0x72')]-_0x5561f1[_0xc29c('0xc6')];emitVoiceQueueSummary(_0x5561f1);if(_0x5561f1[_0xc29c('0x211')]>0x0){var _0x143fff=_0x5561f1[_0xc29c('0x211')]-_0x5561f1[_0xc29c('0x72')]-_0x5561f1[_0xc29c('0x56')]-_0x5561f1[_0xc29c('0xc6')]-_0x5561f1[_0xc29c('0x53')];if(_0x1846a6>_0x143fff){_0x1846a6=_0x143fff;}}if(_0x1846a6>0x0){if(_0x5561f1['dialMethod']===_0xc29c('0x8')){_0x1846a6=0x1;}if(_0x1846a6>this[_0xc29c('0x25')]){_0x1846a6=this['maxNumberOriginate'];}_0x5561f1[_0xc29c('0xc6')]+=_0x1846a6;for(var _0x14d9cc in this[_0xc29c('0x23')]){if(typeof this[_0xc29c('0x23')][_0x14d9cc]!==_0xc29c('0x99')){if(this[_0xc29c('0x23')][_0x14d9cc][_0xc29c('0xa7')]===_0xc29c('0x212')&&this[_0xc29c('0x23')][_0x14d9cc][_0xc29c('0xb0')]==='reachable'){_0x5803c1[_0xc29c('0x123')](this[_0xc29c('0x23')][_0x14d9cc]['id']);}}}this[_0xc29c('0xc5')](_0x5561f1['id'],_0x5803c1,_0x1846a6,_0x5561f1[_0xc29c('0x20a')],_0x5561f1)['then'](function(_0x529f73){_0x5561f1[_0xc29c('0xc6')]-=_0x1846a6;_0x5561f1[_0xc29c('0xc6')]=_0x5561f1[_0xc29c('0xc6')]>0x0?_0x5561f1[_0xc29c('0xc6')]:0x0;if(!checkContactEmpty(_0x529f73)){_0x28fee6[_0xc29c('0xb8')](_0x5561f1)[_0xc29c('0x3e')](sendMessageReschedule(_0x5561f1))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xba')));}else{_0x5561f1['originated']+=_0x529f73[_0xc29c('0x143')];_0x5561f1[_0xc29c('0x40')]=_0x5561f1[_0xc29c('0x5d')]===_0xc29c('0x8')?_0xc29c('0x172'):_0xc29c('0x213');for(var _0x24f6ca=0x0;_0x24f6ca<_0x529f73[_0xc29c('0x143')];_0x24f6ca+=0x1){if(_['isNil'](_0x529f73[_0x24f6ca])||_['isNil'](_0x529f73[_0x24f6ca]['Contact'])||_[_0xc29c('0xae')](_0x529f73[_0x24f6ca][_0xc29c('0x169')][_0xc29c('0x168')])){_0x28fee6[_0xc29c('0xd0')](_0xc29c('0x20d'),_0x5561f1,_0x529f73[_0x24f6ca]);}else{_0x28fee6[_0xc29c('0xbb')](_['pick'](_0x529f73[_0x24f6ca],[_0xc29c('0xf7'),'Contact.phone']))['then'](_0x28fee6['checkContactBlack'](_0x5561f1,_0x529f73[_0x24f6ca]))[_0xc29c('0xb2')](_0x28fee6[_0xc29c('0x20f')](_0xc29c('0x20d'),_0x5561f1));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x5561f1,_0x1846a6));}};Dialer[_0xc29c('0x1d')][_0xc29c('0x91')]=function(_0x97f851){if(_0x97f851[_0xc29c('0x211')]>0x0){var _0x2a4cb7=_0x97f851[_0xc29c('0x211')]-_0x97f851[_0xc29c('0x72')]-_0x97f851[_0xc29c('0x56')];if(_0x2a4cb7>0x0){this[_0xc29c('0x214')](_0x97f851);}else{loggerPredictiveCalls['info'](_0xc29c('0x215'));}}else{this['tryOriginatePredictive'](_0x97f851);}};Dialer[_0xc29c('0x1d')][_0xc29c('0x214')]=function(_0x45db98){var _0x2298d2=this;var _0x3f47ea=[];_0x45db98[_0xc29c('0x72')]+=0x1;for(var _0x2ac129 in this[_0xc29c('0x23')]){if(typeof this[_0xc29c('0x23')][_0x2ac129]!==_0xc29c('0x99')){if(this['agents'][_0x2ac129][_0xc29c('0xa7')]===_0xc29c('0x212')&&this[_0xc29c('0x23')][_0x2ac129][_0xc29c('0xb0')]===_0xc29c('0xda')){_0x3f47ea[_0xc29c('0x123')](this[_0xc29c('0x23')][_0x2ac129]['id']);}}}this['getContactDialer'](_0x45db98['id'],_0x3f47ea,0x1,_0x45db98[_0xc29c('0x20a')],_0x45db98)[_0xc29c('0x3e')](function(_0x2e088f){if(!checkContactEmpty(_0x2e088f)){checkContactLowerLimitOriginate(_0x45db98,0x1,0x0);_0x2298d2['countReScheduled'](_0x45db98)['then'](sendMessageReschedule(_0x45db98))[_0xc29c('0xb2')](loggerCatch(_0xc29c('0xba')));}else{_0x45db98[_0xc29c('0x40')]=_0xc29c('0x213');if(_[_0xc29c('0xae')](_0x2e088f[0x0])||_['isNil'](_0x2e088f[0x0][_0xc29c('0x169')])||_[_0xc29c('0xae')](_0x2e088f[0x0]['Contact']['phone'])){_0x2298d2[_0xc29c('0xd0')](_0xc29c('0x20d'),_0x45db98,_0x2e088f[0x0]);}else{_0x2298d2[_0xc29c('0xbb')](_[_0xc29c('0xd3')](_0x2e088f[0x0],[_0xc29c('0xf7'),_0xc29c('0x20e')]))[_0xc29c('0x3e')](_0x2298d2[_0xc29c('0x1f2')](_0x45db98,_0x2e088f[0x0]))[_0xc29c('0xb2')](_0x2298d2['loggerHandler'](_0xc29c('0x216'),_0x45db98));}}})[_0xc29c('0xb2')](loggerGetContactDialer(_0xc29c('0x217'),_0x45db98,0x1));emitVoiceQueueSummary(_0x45db98);};Dialer['prototype'][_0xc29c('0x1e6')]=function(_0x3303d0,_0x4f1925,_0x67265c,_0x456873,_0xb251e0,_0x43b0b6){loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x218'));loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x219'),_0x3303d0);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x21a'),_0x4f1925);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x21b'),_0x67265c);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x21c'),_0x456873);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x21d'),_0xb251e0);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8e'));return new BPromise(function(_0x49ab87,_0x45b3f3){if(_0x3303d0<=0x0||isNaN(_0x3303d0)){return _0x45b3f3(msgResponse(_0xc29c('0x21e'),_0xc29c('0x49'),'m\x20=\x20'+_0x3303d0));}if(_0x67265c<=0x0||isNaN(_0x67265c)){return _0x45b3f3(msgResponse(_0xc29c('0x21e'),_0xc29c('0x49'),'Ts\x20=\x20'+_0x67265c));}if(_0x456873<=0x0||isNaN(_0x456873)){return _0x45b3f3(msgResponse(_0xc29c('0x21e'),_0xc29c('0x49'),_0xc29c('0x21f')+_0x456873));}if(_0x4f1925<=0x0||isNaN(_0x4f1925)){return _0x45b3f3(msgResponse('[abandonmentRate]',_0xc29c('0x49'),_0xc29c('0x220')+_0x4f1925));}if(_0xb251e0<=0x0||isNaN(_0xb251e0)){return _0x45b3f3(msgResponse(_0xc29c('0x21e'),_0xc29c('0x49'),_0xc29c('0x221')+_0xb251e0));}_0x43b0b6=_0x43b0b6||0x0;var _0x1e81ca=0x1/_0x67265c;var _0x298e92=0x0;var _0x512ed7=0x0;var _0xe6db0=0x0;var _0x402322=0x0;for(var _0x50ccd5=0x0;_0xe6db0<_0xb251e0;_0x50ccd5+=0x1){_0x512ed7=_0x50ccd5/_0x4f1925;_0x298e92=(_0x456873*_0x512ed7+_0x43b0b6)/_0x1e81ca;_0xe6db0=erlangb(_0x298e92,_0x3303d0);_0x402322=_0x298e92/_0x3303d0*(0x1-erlangb(_0x298e92,_0x3303d0));}return _0x49ab87({'erlangCalls':_0x50ccd5,'erlangCallToSecond':_0x4f1925/_0x50ccd5,'erlangAbandonmentRate':_0xe6db0,'erlangBusyFactor':_0x402322});});};Dialer[_0xc29c('0x1d')][_0xc29c('0x1e7')]=function(_0x3a89a4,_0x240c8e,_0x15e963,_0x47cc72,_0x22c4f2,_0x2bd536){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xc29c('0x7f')]('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',_0x3a89a4);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x21a'),_0x240c8e);loggerPredictive['info'](_0xc29c('0x21b'),_0x15e963);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',_0x47cc72);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22c4f2);loggerPredictive[_0xc29c('0x7f')](_0xc29c('0x8e'));return new BPromise(function(_0xc2d85e,_0x3a987){if(_0x3a89a4<=0x0||isNaN(_0x3a89a4)){return _0x3a987(msgResponse(_0xc29c('0x222'),_0xc29c('0x49'),'m\x20=\x20'+_0x3a89a4));}if(_0x15e963<=0x0||isNaN(_0x15e963)){return _0x3a987(msgResponse(_0xc29c('0x222'),'Error','Ts\x20=\x20'+_0x15e963));}if(_0x47cc72<=0x0||isNaN(_0x47cc72)){return _0x3a987(msgResponse(_0xc29c('0x222'),_0xc29c('0x49'),'p\x20=\x20'+_0x47cc72));}if(_0x240c8e<=0x0||isNaN(_0x240c8e)){return _0x3a987(msgResponse(_0xc29c('0x222'),_0xc29c('0x49'),_0xc29c('0x220')+_0x240c8e));}if(_0x22c4f2<=0x0||isNaN(_0x22c4f2)){return _0x3a987(msgResponse(_0xc29c('0x222'),'Error',_0xc29c('0x223')+_0x22c4f2));}_0x2bd536=_0x2bd536||0x0;var _0x5b33fc=0x1/_0x15e963;var _0x19bf9a=0x0;var _0x4b219e=0x0;var _0x27061c=0x0;var _0x2b925e=0x0;for(var _0x398d02=0x0;_0x2b925e<_0x22c4f2;_0x398d02+=0x1){_0x4b219e=_0x398d02/_0x240c8e;_0x19bf9a=(_0x47cc72*_0x4b219e+_0x2bd536)/_0x5b33fc;_0x27061c=erlangb(_0x19bf9a,_0x3a89a4);_0x2b925e=_0x19bf9a/_0x3a89a4*(0x1-erlangb(_0x19bf9a,_0x3a89a4));}return _0xc2d85e({'erlangCalls':_0x398d02,'erlangCallToSecond':_0x240c8e/_0x398d02,'erlangAbandonmentRate':_0x27061c,'erlangBusyFactor':_0x2b925e});});};module[_0xc29c('0x224')]=Dialer; \ No newline at end of file +var _0xb700=['dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','finally','originate\x20action\x20Error','getQueue','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[rescheduleContact][Machine]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','object','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','averageHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','Contact.phone','loggerHandler','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\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','----\x20Agent\x20Busy\x20Factor\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','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','exports','util','lodash','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','md5','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','undefined','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','status','reachable','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countglobal','emit','custom:amd','buildObj','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncAgentComplete][createHistory][0]','countcongestionretry','countabandonedretry','dialMachineMaxRetry','add','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','CALLEREXIT','dialAbandonedMaxRetry','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueBooked','push','pick','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','checkIsTrunkReachable','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','true','command','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','progressive','handlePower','power','predictive','Queue','method\x20not\x20recognized','Agent','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','dialPreviewRecallmeReminder','checkPreviewRecallReminder','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid'];(function(_0x2054d3,_0x17ebce){var _0x11f869=function(_0x4d4231){while(--_0x4d4231){_0x2054d3['push'](_0x2054d3['shift']());}};_0x11f869(++_0x17ebce);}(_0xb700,0x97));var _0x0b70=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xb700[_0x5b27da];return _0x3254f4;};'use strict';var util=require(_0x0b70('0x0'));var _=require(_0x0b70('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x0b70('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x0b70('0x3'));var config=require(_0x0b70('0x4'));var logger=require(_0x0b70('0x5'))(_0x0b70('0x6'));var loggerBooked=require(_0x0b70('0x5'))(_0x0b70('0x7'));var loggerPredictive=require(_0x0b70('0x5'))('predictive');var loggerPredictiveCalls=require(_0x0b70('0x5'))(_0x0b70('0x8'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x0b70('0x9'));config[_0x0b70('0xa')]=_['defaults'](config[_0x0b70('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x0b70('0xb'))(new Redis(config[_0x0b70('0xa')]));var cmHopper=require(_0x0b70('0xc'));var cmHopperHistory=require(_0x0b70('0xd'));var cmHopperBlack=require(_0x0b70('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x0b70('0xf'));var Action=require(_0x0b70('0x10'));var History=require(_0x0b70('0x11'));var Final=require(_0x0b70('0x12'));var AgentComplete=require(_0x0b70('0x13'));var QueueCallerAbandon=require(_0x0b70('0x14'));var Hangup=require(_0x0b70('0x15'));var ipAgi=process['env'][_0x0b70('0x16')]||_0x0b70('0x17');var strategy={'rrmemory':_0x0b70('0x18'),'roundrobin':_0x0b70('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x0b70('0x1a')][_0x0b70('0x1b')]=function(_0x4841cb){this['tail']=this[_0x0b70('0x1c')]?this[_0x0b70('0x1c')]['finally'](_0x4841cb):_0x4841cb();};function Dialer(_0x5f28fd,_0x3b3e85){this[_0x0b70('0x1d')]=new Sequence();this[_0x0b70('0x1e')]=_0x3b3e85;this['voiceQueues']=_0x5f28fd[_0x0b70('0x1f')];this[_0x0b70('0x20')]=_0x5f28fd[_0x0b70('0x20')];this[_0x0b70('0x21')]=_0x5f28fd[_0x0b70('0x21')];this[_0x0b70('0x22')]=_0x5f28fd[_0x0b70('0x22')];this[_0x0b70('0x23')]=config[_0x0b70('0x23')]||0x2;this[_0x0b70('0x24')]={};this[_0x0b70('0x25')]={};this[_0x0b70('0x26')]={};this[_0x0b70('0x27')]={};this[_0x0b70('0x28')]={};this[_0x0b70('0x29')]={};this[_0x0b70('0x2a')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x0b70('0x2b')]={};ami['on'](_0x0b70('0x2c'),this[_0x0b70('0x2d')]['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x0b70('0x2e')](this));ami['on'](_0x0b70('0x2f'),this[_0x0b70('0x30')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x0b70('0x31'),this[_0x0b70('0x32')][_0x0b70('0x2e')](this));ami['on'](_0x0b70('0x33'),this[_0x0b70('0x34')]['bind'](this));ami['on'](_0x0b70('0x35'),this[_0x0b70('0x36')][_0x0b70('0x2e')](this));ami['on'](_0x0b70('0x37'),this[_0x0b70('0x38')][_0x0b70('0x2e')](this));ami['on'](_0x0b70('0x39'),this['syncQueueMember'][_0x0b70('0x2e')](this));ami['on'](_0x0b70('0x3a'),this[_0x0b70('0x3b')]['bind'](this));this[_0x0b70('0x3c')]();this[_0x0b70('0x3d')]();RpcSetting[_0x0b70('0x3e')]()[_0x0b70('0x3f')](function(_0xcbbe67){previewRecallmeReminderInterval=_0xcbbe67['previewRecallmeReminderInterval'];});}function isNotNull(_0x3e05d7){return _0x3e05d7!==null&&!_[_0x0b70('0x40')](_0x3e05d7);}function checkIsLoggedIn(_0x484cb1,_0xa772f){return function(){if(_0xa772f<=0x0){_0x484cb1[_0x0b70('0x41')]=_0x0b70('0x42');throw _0x484cb1[_0x0b70('0x43')]+_0x0b70('0x44');}};}function isActive(_0x575aa3){return _0x575aa3;}function checkIsActive(_0x4060d2,_0xbc270c){return function(){if(!isActive(_0xbc270c)){_0x4060d2[_0x0b70('0x41')]=_0x0b70('0x45');throw _0x4060d2[_0x0b70('0x43')]+_0x0b70('0x46');}};}function checkInterval(_0x50d5f9){return function(){if(!isNotNull(_0x50d5f9[_0x0b70('0x47')])){_0x50d5f9[_0x0b70('0x41')]=_0x0b70('0x48');throw _0x50d5f9[_0x0b70('0x43')]+_0x0b70('0x49');}if(!isNotNull(_0x50d5f9[_0x0b70('0x47')][_0x0b70('0x4a')])){_0x50d5f9[_0x0b70('0x41')]=_0x0b70('0x48');throw _0x50d5f9['name']+_0x0b70('0x49');}if(!isNotNull(_[_0x0b70('0x4b')](_0x50d5f9[_0x0b70('0x47')]['Intervals']))){_0x50d5f9[_0x0b70('0x41')]=_0x0b70('0x48');throw _0x50d5f9[_0x0b70('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4c1b08,_0x50e117,_0x2033a){return{'action':_0x4c1b08,'response':_0x50e117,'message':_0x2033a,'stack':_0x2033a};}function myreject(_0x5b5a82){return function(_0x36b2f9){return _0x5b5a82(msgResponse(_0x0b70('0x4c'),_0x0b70('0x4d'),JSON[_0x0b70('0x4e')](_0x36b2f9)));};}function getSeconds(_0x24be8f,_0x14f847){var _0xf7bbf4=moment(_0x24be8f)[_0x0b70('0x4f')](0x0);var _0x447255=moment(_0x14f847)[_0x0b70('0x4f')](0x0);return _0xf7bbf4[_0x0b70('0x50')](_0x447255,_0x0b70('0x51'));}function emit(_0x233223,_0x4f5877,_0x297917){io['to'](_0x233223)['emit'](_0x4f5877,_0x297917);}function emitVoiceQueueSummary(_0x215cbc){if(_0x215cbc[_0x0b70('0x52')]===_0x0b70('0x53')){var _0x1cbf83={'id':_0x215cbc['id'],'name':_0x215cbc[_0x0b70('0x43')],'strategy':_0x215cbc[_0x0b70('0x54')],'answered':_0x215cbc[_0x0b70('0x55')],'available':_0x215cbc[_0x0b70('0x56')],'loggedIn':_0x215cbc[_0x0b70('0x57')],'pTalking':_0x215cbc[_0x0b70('0x58')],'sumBillable':_0x215cbc[_0x0b70('0x59')],'sumDuration':_0x215cbc[_0x0b70('0x5a')],'sumHoldTime':_0x215cbc[_0x0b70('0x5b')]||0x0,'talking':_0x215cbc[_0x0b70('0x5c')],'total':_0x215cbc[_0x0b70('0x5d')],'type':_0x215cbc[_0x0b70('0x52')],'unmanaged':_0x215cbc[_0x0b70('0x5e')],'abandoned':_0x215cbc[_0x0b70('0x5f')],'waiting':_0x215cbc['waiting'],'loggedInDb':_0x215cbc[_0x0b70('0x60')],'dialActive':_0x215cbc['dialActive'],'dialMethod':_0x215cbc[_0x0b70('0x61')],'dialOriginateCallerIdName':_0x215cbc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x215cbc[_0x0b70('0x62')],'dialOriginateTimeout':_0x215cbc[_0x0b70('0x63')],'dialPrefix':_0x215cbc[_0x0b70('0x64')],'outboundAnswerAgiCallsDay':_0x215cbc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x215cbc[_0x0b70('0x65')],'outboundBlacklistCallsDay':_0x215cbc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x215cbc['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x215cbc[_0x0b70('0x66')],'outboundDropCallsDayACS':_0x215cbc[_0x0b70('0x67')],'outboundDropCallsDayCallersExit':_0x215cbc[_0x0b70('0x68')],'outboundDropCallsDayTimeout':_0x215cbc[_0x0b70('0x69')],'outboundNoAnswerCallsDay':_0x215cbc[_0x0b70('0x6a')],'outboundNoSuchCallsDay':_0x215cbc[_0x0b70('0x6b')],'outboundOriginateFailureCallsDay':_0x215cbc['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x215cbc['outboundReCallsDay'],'outboundRejectCallsDay':_0x215cbc[_0x0b70('0x6c')],'outboundUnknownCallsDay':_0x215cbc[_0x0b70('0x6d')],'predictiveIntervalAnsweredCalls':_0x215cbc[_0x0b70('0x6e')],'predictiveIntervalAvgHoldtime':_0x215cbc[_0x0b70('0x6f')],'predictiveIntervalAvgTalktime':_0x215cbc[_0x0b70('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x215cbc[_0x0b70('0x71')],'predictiveIntervalDroppedCallsTimeout':_0x215cbc[_0x0b70('0x72')],'predictiveIntervalErlangCalls':_0x215cbc[_0x0b70('0x73')],'predictiveIntervalErlangCallsDroppedCalls':_0x215cbc[_0x0b70('0x74')],'predictiveIntervalHitRate':_0x215cbc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x215cbc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x215cbc[_0x0b70('0x75')],'predictiveIntervalAvailable':_0x215cbc['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x215cbc[_0x0b70('0x76')],'message':_0x215cbc[_0x0b70('0x41')],'originated':_0x215cbc['originated'],'erlangCalls':_0x215cbc['erlangCalls'],'erlangCallToSecond':_0x215cbc[_0x0b70('0x77')],'erlangAbandonmentRate':_0x215cbc[_0x0b70('0x78')],'erlangBusyFactor':_0x215cbc[_0x0b70('0x79')],'startPredictive':_0x215cbc[_0x0b70('0x29')],'startProgressive':_0x215cbc[_0x0b70('0x2a')]};if(_0x215cbc[_0x0b70('0x7a')]){_0x1cbf83['Trunk']={'id':_0x215cbc[_0x0b70('0x7a')]['id'],'name':_0x215cbc[_0x0b70('0x7a')][_0x0b70('0x43')],'active':_0x215cbc['Trunk'][_0x0b70('0x7b')],'callerid':_0x215cbc[_0x0b70('0x7a')]['callerid']};}if(_0x215cbc[_0x0b70('0x47')]){_0x1cbf83[_0x0b70('0x47')]={'id':_0x215cbc[_0x0b70('0x47')]['id'],'name':_0x215cbc['Interval'][_0x0b70('0x43')]};}var _0x517870=md5(JSON[_0x0b70('0x4e')](_0x1cbf83));if(_0x215cbc[_0x0b70('0x7c')]!==_0x517870){_0x215cbc[_0x0b70('0x7c')]=_0x517870;emit(util[_0x0b70('0x7d')](_0x0b70('0x7e'),_0x1cbf83[_0x0b70('0x43')]),_0x0b70('0x7f'),_0x1cbf83);}}}function emitCampaignSummary(_0x52ff2c){if(_0x52ff2c[_0x0b70('0x52')]===_0x0b70('0x80')){emit(util[_0x0b70('0x7d')](_0x0b70('0x81'),_0x52ff2c[_0x0b70('0x43')]),'campaign:save',_0x52ff2c);}}function checkGetDataPredictive(_0x426ab7){if(isNotNull(_0x426ab7)&&!_[_0x0b70('0x4b')](_0x426ab7)){loggerPredictive[_0x0b70('0x82')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x0b70('0x82')](_0x0b70('0x83'),_0x426ab7[_0x0b70('0x76')]);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x84'),_0x426ab7[_0x0b70('0x6e')]);loggerPredictive['info'](_0x0b70('0x85'),_0x426ab7[_0x0b70('0x72')]);loggerPredictive[_0x0b70('0x82')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x426ab7[_0x0b70('0x71')]);loggerPredictive[_0x0b70('0x82')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x426ab7[_0x0b70('0x6f')]);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x86'),_0x426ab7[_0x0b70('0x70')]);loggerPredictive['info'](_0x0b70('0x87'));if(_0x426ab7[_0x0b70('0x76')]>0x0){if(!_[_0x0b70('0x40')](_0x426ab7[_0x0b70('0x70')])&&_0x426ab7[_0x0b70('0x70')]>0x0){return!![];}loggerPredictive[_0x0b70('0x82')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x0b70('0x40')](_0x426ab7[_0x0b70('0x6f')])&&_0x426ab7['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x0b70('0x82')](_0x0b70('0x88'));}else{loggerPredictive['info'](_0x0b70('0x89'));}}else{loggerPredictive['info'](_0x0b70('0x8a'));}return![];}function mergeDataErlangB(_0x563f42){return function(_0x1639cb){loggerPredictive[_0x0b70('0x82')](_0x0b70('0x8b'));loggerPredictive[_0x0b70('0x82')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1639cb['erlangCalls']);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x8c'),_0x1639cb[_0x0b70('0x77')]);loggerPredictive['info'](_0x0b70('0x8d'),_0x1639cb[_0x0b70('0x78')]);loggerPredictive['info'](_0x0b70('0x8e'),_0x1639cb[_0x0b70('0x79')]);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x8d'),_0x1639cb['erlangAbandonmentRate']);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x87'));_[_0x0b70('0x8f')](_0x563f42,_0x1639cb);};}function getDiff(_0x54c970){var _0x1a847e=moment()[_0x0b70('0x4f')](0x0);var _0x117ac1=moment(_0x54c970)[_0x0b70('0x4f')](0x0);return _0x1a847e[_0x0b70('0x50')](_0x117ac1,_0x0b70('0x51'));}function ifInterval(_0x3f05f2,_0xc34a30){if(_[_0x0b70('0x40')](_0xc34a30)){return![];}return getDiff(_0xc34a30)<_0x3f05f2*0x3c;}function freeVariablesPredictive(_0x552e49){if(isNotNull(_0x552e49)){if(!_[_0x0b70('0x40')](_0x552e49['startProgressive'])){_0x552e49[_0x0b70('0x2a')]=undefined;loggerPredictive[_0x0b70('0x82')](_0x552e49[_0x0b70('0x43')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x0b70('0x40')](_0x552e49['startPredictive'])){_0x552e49[_0x0b70('0x29')]=undefined;loggerPredictive[_0x0b70('0x82')](_0x552e49[_0x0b70('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0b70('0x40')](_0x552e49[_0x0b70('0x90')])){clearInterval(_0x552e49[_0x0b70('0x90')]);_0x552e49[_0x0b70('0x90')]=undefined;loggerPredictive[_0x0b70('0x82')](_0x552e49[_0x0b70('0x43')],_0x0b70('0x91'));}}}function erlangb(_0x351397,_0x425689){if(_0x425689===0x0){return 0x0;}var _0x421a02=0x1;for(var _0x3d8dd9=0x1;_0x3d8dd9<=_0x425689;_0x3d8dd9+=0x1){_0x421a02=0x1+_0x421a02*_0x3d8dd9/_0x351397;}return 0x1/_0x421a02;}function isVoiceQueueOutbound(_0x4cfc20){return _0x4cfc20===_0x0b70('0x53');}function isNotPreview(_0xe78c01){return _0xe78c01!==_0x0b70('0x1e');}function isCampaignIvr(_0x3bbf1a){return _0x3bbf1a==='ivr';}function getCallerId(_0x4369ae,_0x4de53e,_0x41be5c){if(!_['isUndefined'](_0x41be5c)&&typeof _0x41be5c===_0x0b70('0x92')&&!_['isEmpty'](_0x41be5c)){if(!_[_0x0b70('0x40')](_0x4de53e)&&typeof _0x4de53e==='string'&&!_['isEmpty'](_0x4de53e)){return util['format'](_0x0b70('0x93'),_0x4de53e,_0x41be5c);}return util[_0x0b70('0x7d')](_0x0b70('0x93'),_0x41be5c,_0x41be5c);}if(!_[_0x0b70('0x40')](_0x4369ae)&&typeof _0x4369ae===_0x0b70('0x92')&&!_[_0x0b70('0x4b')](_0x4369ae)){return _0x4369ae;}return _0x0b70('0x94');}function loggerCatchQueueSummary(_0x3d93e8,_0x3b0079){return function(_0x37a592){freeVariablesPredictive(_0x3b0079);emitVoiceQueueSummary(_0x3b0079);emitCampaignSummary(_0x3b0079);loggerSyncQueueSummary[_0x0b70('0x95')](_0x3d93e8,util[_0x0b70('0x96')](_0x37a592,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5d2f70,_0x2c3719){return function(_0x27737a){loggerPredictive[_0x0b70('0x95')](_0x2c3719[_0x0b70('0x43')],_0x5d2f70);loggerPredictive[_0x0b70('0x95')](_0x27737a['stack']);freeVariablesPredictive(_0x2c3719);};}function loggerCatch(_0x1cc0ad){return function(_0x121835){logger[_0x0b70('0x95')](_0x1cc0ad,util[_0x0b70('0x96')](_0x121835,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4c8727){return _0x4c8727&&!_['isUndefined'](_0x4c8727)&&_0x4c8727[_0x0b70('0x97')]>0x0;}function decremetOriginate(_0x4783df){if(!_[_0x0b70('0x40')](_0x4783df)&&_0x4783df!==null){if(typeof _0x4783df[_0x0b70('0x98')]!=='undefined'){if(_0x4783df[_0x0b70('0x98')]>0x0){_0x4783df[_0x0b70('0x98')]-=0x1;}else{logger[_0x0b70('0x95')](_0x0b70('0x99'));}}}else{logger[_0x0b70('0x95')](_0x0b70('0x9a'));}}function checkContactLowerLimitOriginate(_0x28b368,_0x75713f,_0x2fe730){if(_0x75713f>_0x2fe730){for(var _0x3112eb=0x0;_0x3112eb<_0x75713f-_0x2fe730;_0x3112eb+=0x1){decremetOriginate(_0x28b368);}}}function loggerGetContactDialer(_0x527cb9,_0x4c4d85,_0x25e74d){return function(_0x49d4f2){checkContactLowerLimitOriginate(_0x4c4d85,_0x25e74d,0x0);logger[_0x0b70('0x95')](_0x527cb9,util['inspect'](_0x49d4f2,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x217b4d){return function(_0x54ca54){if(isNotNull(_0x54ca54)&&isNotNull(_0x54ca54[0x0])){if(_0x54ca54[0x0][_0x0b70('0x9b')]>0x0){_0x217b4d[_0x0b70('0x41')]=_0x0b70('0x9c');logger[_0x0b70('0x82')](_0x0b70('0x9d')+_0x217b4d[_0x0b70('0x43')],_0x54ca54[0x0][_0x0b70('0x9b')],_0x0b70('0x9e'));}else{_0x217b4d[_0x0b70('0x41')]=_0x0b70('0x9f');logger['info'](_0x0b70('0xa0')+_0x217b4d[_0x0b70('0x43')]);}}};}function notSendMessagesQueue(_0x364a6d){if(_0x364a6d[_0x0b70('0xa1')]){freeVariablesPredictive(_0x364a6d);if(_0x364a6d[_0x0b70('0x98')]===0x0&&_0x364a6d[_0x0b70('0x5c')]===0x0&&_0x364a6d[_0x0b70('0xa2')]===0x0&&(_0x364a6d[_0x0b70('0x58')]||0x0)===0x0){_0x364a6d[_0x0b70('0xa1')]=![];_0x364a6d[_0x0b70('0x56')]=0x0;_0x364a6d[_0x0b70('0x41')]=_0x0b70('0x45');loggerSyncQueueSummary[_0x0b70('0x95')](_0x0b70('0xa3'),_0x364a6d[_0x0b70('0x43')],_0x0b70('0xa4'));}else{_0x364a6d[_0x0b70('0x41')]=_0x0b70('0xa5');loggerSyncQueueSummary[_0x0b70('0x95')](_0x0b70('0xa3'),_0x364a6d[_0x0b70('0x43')],_0x0b70('0xa6'));}emitVoiceQueueSummary(_0x364a6d);}}function notSendMessagesCampaign(_0x484ee0){if(_0x484ee0['sendMessageOneNotActive']){if(_0x484ee0[_0x0b70('0x98')]===0x0){_0x484ee0[_0x0b70('0xa1')]=![];_0x484ee0['message']=_0x0b70('0x45');loggerSyncQueueSummary['error'](_0x0b70('0xa7'),_0x484ee0[_0x0b70('0x43')],_0x0b70('0xa4'));}else{_0x484ee0[_0x0b70('0x41')]=_0x0b70('0xa5');loggerSyncQueueSummary[_0x0b70('0x95')](_0x0b70('0xa7'),_0x484ee0[_0x0b70('0x43')],_0x0b70('0xa6'));}emitCampaignSummary(_0x484ee0);}}function createObjHistory(_0x34eab9,_0x4043a1,_0x51d17d,_0x16c708,_0x46c167){_0x34eab9[_0x0b70('0x41')]=_0x51d17d;var _0x4251b7=new Action(_0x34eab9,_0x4043a1);var _0x5af6c7=new History(_0x4251b7);_0x5af6c7[_0x0b70('0xa8')]=_0x16c708;_0x5af6c7[_0x0b70('0xa9')]=_0x46c167;_0x5af6c7[_0x0b70('0xaa')]=_0x4251b7['starttime'];return _0x5af6c7;}Dialer[_0x0b70('0x1a')][_0x0b70('0x3d')]=function(){var _0x28f0e9=this;setInterval(function(){_0x28f0e9[_0x0b70('0xab')](_0x28f0e9[_0x0b70('0x27')],_0x0b70('0xac'));_0x28f0e9[_0x0b70('0xab')](_0x28f0e9[_0x0b70('0x25')],_0x0b70('0xad'));},0x32c8);};Dialer[_0x0b70('0x1a')][_0x0b70('0xab')]=function(_0x3ed983,_0x12b603){var _0x45a85c=this;for(var _0x27ff1b in _0x3ed983){if(typeof _0x3ed983[_0x27ff1b]!==_0x0b70('0xae')){this[_0x0b70('0x1d')][_0x0b70('0x1b')](function(){if(!_[_0x0b70('0xaf')](_0x3ed983[_0x27ff1b])){return ami[_0x0b70('0xb0')]({'action':'status','channel':_0x3ed983[_0x27ff1b][_0x0b70('0xb1')]})[_0x0b70('0xb2')](function(_0x3d8762){if(_0x3d8762[_0x0b70('0x41')]===_0x0b70('0xb3')){setTimeout(function(){if(_0x3ed983[_0x27ff1b]&&_0x3ed983[_0x27ff1b][_0x0b70('0x52')]!==_0x0b70('0x80')){_0x45a85c[_0x0b70('0xb4')](_0x45a85c[_0x0b70('0x1f')][_0x3ed983[_0x27ff1b]['queue']]);logger['error'](_0x0b70('0xb5'),_0x12b603,_0x27ff1b,_0x3ed983[_0x27ff1b][_0x0b70('0xb6')]);delete _0x3ed983[_0x27ff1b];}if(_0x3ed983[_0x27ff1b]&&_0x3ed983[_0x27ff1b]['type']===_0x0b70('0x80')){_0x45a85c[_0x0b70('0xb4')](_0x45a85c['campaigns'][_0x3ed983[_0x27ff1b]['queue']]);logger[_0x0b70('0x95')]('[Dialer][checkChannel][ivr]',_0x12b603,_0x27ff1b,_0x3ed983[_0x27ff1b][_0x0b70('0xb6')]);delete _0x3ed983[_0x27ff1b];}},0x2328);}});}});}}};Dialer[_0x0b70('0x1a')][_0x0b70('0xb7')]=function(_0x3b4edd){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopper[_0x0b70('0xb7')](_0x3b4edd))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xb9')));};Dialer[_0x0b70('0x1a')][_0x0b70('0xba')]=function(_0x50864e){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopperBlack['checkIsBlackList'](_0x50864e))[_0x0b70('0xb2')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x0b70('0x1a')][_0x0b70('0xbb')]=function(_0x529736){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopperBlack[_0x0b70('0xbb')](_0x529736))[_0x0b70('0xb2')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0b70('0x1a')]['averageHandleTime']=function(_0x4adf9e){return BPromise['resolve']()[_0x0b70('0x3f')](cmHopperHistory[_0x0b70('0xbc')](_0x4adf9e))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xbd')));};Dialer['prototype'][_0x0b70('0xbe')]=function(_0x2dc878){return BPromise['resolve']()['then'](cmHopper[_0x0b70('0xbe')](_0x2dc878))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xbf')));};Dialer[_0x0b70('0x1a')][_0x0b70('0xc0')]=function(_0x54f84d,_0x2d417b,_0x2d4c9b){return BPromise['resolve']()[_0x0b70('0x3f')](cmHopper[_0x0b70('0xc0')](_0x54f84d,_0x2d417b,_0x2d4c9b))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xc1')));};Dialer['prototype'][_0x0b70('0xc2')]=function(_0x22b175,_0x5607ba,_0x3b6eec,_0x2dca1b,_0x4140a3){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopper[_0x0b70('0xc2')](_0x22b175,_0x5607ba,_0x3b6eec,_0x2dca1b))[_0x0b70('0xb2')](function(_0x574690){_0x4140a3[_0x0b70('0xc3')]-=_0x3b6eec;_0x4140a3['temp']=_0x4140a3[_0x0b70('0xc3')]>0x0?_0x4140a3[_0x0b70('0xc3')]:0x0;loggerCatch(_0x0b70('0xc4'))(_0x574690);});};Dialer[_0x0b70('0x1a')]['getContactDialerIvr']=function(_0xe5707,_0x259ad2,_0x4cf896,_0x3da594){return BPromise[_0x0b70('0xb8')]()['then'](cmHopper[_0x0b70('0xc5')](_0xe5707,_0x259ad2,_0x4cf896))[_0x0b70('0xb2')](function(_0x120b93){_0x3da594['temp']-=_0x259ad2;_0x3da594[_0x0b70('0xc3')]=_0x3da594[_0x0b70('0xc3')]>0x0?_0x3da594[_0x0b70('0xc3')]:0x0;loggerCatch(_0x0b70('0xc6'))(_0x120b93);});};Dialer[_0x0b70('0x1a')]['getVoiceQueueRtPauses']=function(_0x23817e){return BPromise[_0x0b70('0xb8')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x23817e))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xc7')));};Dialer[_0x0b70('0x1a')][_0x0b70('0xc8')]=function(_0x49b0e5){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopper[_0x0b70('0xc8')](_0x49b0e5))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xc9')));};Dialer[_0x0b70('0x1a')][_0x0b70('0xca')]=function(_0x545555){return BPromise[_0x0b70('0xb8')]()['then'](cmHopperHistory[_0x0b70('0xca')](_0x545555))['catch'](loggerCatch(_0x0b70('0xcb')));};Dialer[_0x0b70('0x1a')][_0x0b70('0xb4')]=function(_0x5732b0){if(!_['isUndefined'](_0x5732b0)&&_0x5732b0!==null){if(typeof _0x5732b0['originated']!==_0x0b70('0xae')){if(_0x5732b0[_0x0b70('0x98')]>0x0){_0x5732b0[_0x0b70('0x98')]-=0x1;}else{logger[_0x0b70('0x95')](_0x0b70('0xcc'));}}}else{logger['error'](_0x0b70('0xcd'));}};Dialer[_0x0b70('0x1a')]['loggerHandler']=function(_0x2f45f8,_0x5c7ac9){var _0x5a559c=this;return function(_0x3a15af){_0x5a559c[_0x0b70('0xb4')](_0x5c7ac9);logger['error'](_0x2f45f8,util[_0x0b70('0x96')](_0x3a15af,{'showHidden':![],'depth':null}));};};Dialer[_0x0b70('0x1a')]['emptyContact']=function(_0xa0727c,_0x84798d,_0x289c7a){var _0x272678={'state':0x19,'statedesc':_0x0b70('0xce')};this['updateOriginated'](_0x84798d);this[_0x0b70('0xcf')](_[_0x0b70('0x8f')](_0x272678,_['pick'](_0x289c7a,['ContactId',_0x0b70('0xd0'),_0x0b70('0xd1'),'VoiceQueueId',_0x0b70('0xd2')])),_0x0b70('0xd3'),_0x0b70('0xd4'));logger[_0x0b70('0x95')](_0xa0727c);};Dialer[_0x0b70('0x1a')][_0x0b70('0xd5')]=function(_0x40b578){return _0x40b578==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0x443b46){return!_[_0x0b70('0x40')](_0x443b46)&&_0x443b46&&!_[_0x0b70('0x40')](_0x443b46[_0x0b70('0x43')])&&!_[_0x0b70('0x40')](_0x443b46[_0x0b70('0x7b')])&&_0x443b46['active']&&(this[_0x0b70('0x22')][util[_0x0b70('0x7d')]('SIP/%s',_0x443b46[_0x0b70('0x43')])][_0x0b70('0xd6')]===_0x0b70('0xd7')||this[_0x0b70('0x22')][util[_0x0b70('0x7d')](_0x0b70('0xd8'),_0x443b46['name'])][_0x0b70('0xd6')]==='unmonitored');};Dialer[_0x0b70('0x1a')][_0x0b70('0xcf')]=function(_0x3e0bd6,_0x2b8f8a,_0x23c2ef){this[_0x0b70('0xca')](_0x3e0bd6)[_0x0b70('0xb2')](loggerCatch(_0x2b8f8a));this[_0x0b70('0xc8')](_0x3e0bd6)['catch'](loggerCatch(_0x23c2ef));};Dialer[_0x0b70('0x1a')][_0x0b70('0x38')]=function(_0x5169b4){var _0x37f95a=this[_0x0b70('0x27')][_0x5169b4[_0x0b70('0xd9')]];var _0x26eec9;if(!_[_0x0b70('0xaf')](_0x5169b4)&&!_[_0x0b70('0xaf')](_0x5169b4[_0x0b70('0xda')])&&!_[_0x0b70('0xaf')](_0x5169b4[_0x0b70('0xda')][_0x0b70('0xdb')])&&_0x5169b4[_0x0b70('0xdc')]===_0x0b70('0xdd')&&_0x37f95a){if(_0x37f95a[_0x0b70('0x52')]!==_0x0b70('0x80')&&this[_0x0b70('0x1f')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0xde')]&&_0x5169b4[_0x0b70('0xdf')]===_0x0b70('0xe0')){delete this[_0x0b70('0x27')][_0x5169b4[_0x0b70('0xd9')]];this[_0x0b70('0xb4')](this['voiceQueues'][_0x37f95a[_0x0b70('0xb6')]]);this[_0x0b70('0x1f')][_0x37f95a['queue']][_0x0b70('0x65')]+=0x1;this[_0x0b70('0x1f')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0xe1')]+=0x1;_0x26eec9=new Hangup(_0x37f95a,_0x5169b4);_0x26eec9['state']=0x12;_0x26eec9[_0x0b70('0xa9')]=_0x0b70('0xe2');_0x26eec9['membername']=_0x0b70('0xe3');ami['emit']('custom:amd',ut['buildObj'](_0x26eec9,_0x0b70('0xe4')));this[_0x0b70('0xcf')](_0x26eec9,_0x0b70('0xe5'),_0x0b70('0xe6'));}if(_0x37f95a[_0x0b70('0x52')]!==_0x0b70('0x80')&&this[_0x0b70('0x1f')][_0x37f95a['queue']]['dialAMDActive']&&_0x5169b4[_0x0b70('0xdf')]===_0x0b70('0xe7')){var _0x70741a=this;return new BPromise(function(_0x45c681,_0xb39c45){delete _0x70741a[_0x0b70('0x27')][_0x5169b4[_0x0b70('0xd9')]];_0x70741a['updateOriginated'](_0x70741a[_0x0b70('0x1f')][_0x37f95a[_0x0b70('0xb6')]]);_0x70741a[_0x0b70('0x1f')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0x65')]+=0x1;_0x70741a[_0x0b70('0x1f')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0xe1')]+=0x1;var _0x494861=_0x70741a['voiceQueues'][_0x37f95a[_0x0b70('0xb6')]];var _0x5232ad=new Hangup(_0x37f95a,_0x5169b4);_0x5232ad[_0x0b70('0xa8')]=0x13;_0x5232ad[_0x0b70('0xa9')]='Machine';_0x5232ad['membername']=_0x0b70('0xe3');_0x5232ad['countmachineretry']+=0x1;_0x5232ad[_0x0b70('0xe8')]+=0x1;_0x5232ad[_0x0b70('0xe4')]=!![];ami[_0x0b70('0xe9')](_0x0b70('0xea'),ut[_0x0b70('0xeb')](_0x5232ad,'amd'));_0x70741a['createHistory'](_0x5232ad)[_0x0b70('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5232ad[_0x0b70('0xec')]+_0x5232ad['countcongestionretry']+_0x5232ad[_0x0b70('0xed')]+_0x5232ad[_0x0b70('0xee')]+_0x5232ad[_0x0b70('0xef')]+_0x5232ad['countabandonedretry']+_0x5232ad[_0x0b70('0xf0')]+_0x5232ad[_0x0b70('0xf1')]>=_0x494861[_0x0b70('0xf2')]){_0x70741a[_0x0b70('0xf3')](_0x5232ad,_0x45c681,_0xb39c45,_0x0b70('0xf4'));}else{if(_0x5232ad['countmachineretry']>=_0x494861['dialMachineMaxRetry']){_0x70741a[_0x0b70('0xf5')](_0x5232ad,_0x45c681,_0xb39c45,_0x0b70('0xf6'));}else{_0x70741a['rescheduleContact']({'active':![],'countmachineretry':_0x5232ad[_0x0b70('0xf0')],'scheduledat':moment()['add'](_0x494861[_0x0b70('0xf7')],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x5232ad[_0x0b70('0xfa')],'ListId':_0x5232ad[_0x0b70('0xd0')],'VoiceQueueId':_0x5232ad[_0x0b70('0xfb')]||undefined,'CampaignId':_0x5232ad[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch('[rescheduleContact][Machine]'));_0x45c681({'reschedule':0x1});}}});}if(_0x37f95a[_0x0b70('0x52')]===_0x0b70('0x80')&&this[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0xde')]&&_0x5169b4[_0x0b70('0xdf')]==='HANGUP'){delete this[_0x0b70('0x27')][_0x5169b4[_0x0b70('0xd9')]];this['updateOriginated'](this[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]]);_0x26eec9=new Hangup(_0x37f95a,_0x5169b4);_0x26eec9[_0x0b70('0xa8')]=0x12;_0x26eec9[_0x0b70('0xa9')]=_0x0b70('0xe2');_0x26eec9[_0x0b70('0xfc')]=_0x0b70('0xe3');ami['emit'](_0x0b70('0xea'),ut[_0x0b70('0xeb')](_0x26eec9,_0x0b70('0xe4')));this['saveInDb'](_0x26eec9,_0x0b70('0xfd'),_0x0b70('0xfe'));}if(_0x37f95a[_0x0b70('0x52')]===_0x0b70('0x80')&&this[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]][_0x0b70('0xde')]&&_0x5169b4[_0x0b70('0xdf')]===_0x0b70('0xe7')){var _0x70741a=this;return new BPromise(function(_0x125a3a,_0x4aa861){delete _0x70741a[_0x0b70('0x27')][_0x5169b4[_0x0b70('0xd9')]];_0x70741a[_0x0b70('0xb4')](_0x70741a['campaigns'][_0x37f95a[_0x0b70('0xb6')]]);_0x70741a[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x70741a[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x424195=_0x70741a[_0x0b70('0x20')][_0x37f95a[_0x0b70('0xb6')]];var _0x25175c=new Hangup(_0x37f95a,_0x5169b4);_0x25175c[_0x0b70('0xa8')]=0x13;_0x25175c['statedesc']=_0x0b70('0xff');_0x25175c['membername']=_0x0b70('0xe3');_0x25175c[_0x0b70('0xf0')]+=0x1;_0x25175c[_0x0b70('0xe8')]+=0x1;_0x25175c[_0x0b70('0xe4')]=!![];ami[_0x0b70('0xe9')]('custom:amd',ut[_0x0b70('0xeb')](_0x25175c,_0x0b70('0xe4')));_0x70741a[_0x0b70('0xca')](_0x25175c)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x100')));if(_0x25175c[_0x0b70('0xec')]+_0x25175c[_0x0b70('0x101')]+_0x25175c[_0x0b70('0xed')]+_0x25175c['countnosuchnumberretry']+_0x25175c[_0x0b70('0xef')]+_0x25175c[_0x0b70('0x102')]+_0x25175c['countmachineretry']+_0x25175c[_0x0b70('0xf1')]>=_0x424195[_0x0b70('0xf2')]){_0x70741a[_0x0b70('0xf3')](_0x25175c,_0x125a3a,_0x4aa861,'reason19\x20machine....');}else{if(_0x25175c[_0x0b70('0xf0')]>=_0x424195[_0x0b70('0x103')]){_0x70741a['createStateFinal'](_0x25175c,_0x125a3a,_0x4aa861,_0x0b70('0xf6'));}else{_0x70741a[_0x0b70('0xbe')]({'active':![],'countmachineretry':_0x25175c[_0x0b70('0xf0')],'scheduledat':moment()[_0x0b70('0x104')](_0x424195[_0x0b70('0xf7')],_0x0b70('0xf8'))['format'](_0x0b70('0xf9')),'ContactId':_0x25175c['ContactId'],'ListId':_0x25175c[_0x0b70('0xd0')],'VoiceQueueId':_0x25175c[_0x0b70('0xfb')]||undefined,'CampaignId':_0x25175c[_0x0b70('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x125a3a({'reschedule':0x1});}}});}}};Dialer[_0x0b70('0x1a')]['syncHangup']=function(_0xce69d1){var _0x3713f6=this['uniqueId'][_0xce69d1[_0x0b70('0xd9')]];var _0x415be6=this;var _0x373a1e;if(_0x3713f6&&_0x3713f6[_0x0b70('0x52')]==='ivr'){delete this[_0x0b70('0x27')][_0xce69d1[_0x0b70('0xd9')]];this[_0x0b70('0xb4')](this[_0x0b70('0x20')][_0x3713f6[_0x0b70('0xb6')]]);this['campaigns'][_0x3713f6[_0x0b70('0xb6')]][_0x0b70('0x105')]+=0x1;_0x373a1e=new Hangup(_0x3713f6,_0xce69d1);this[_0x0b70('0xca')](_0x373a1e)[_0x0b70('0xb2')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0b70('0xc8')](_0x373a1e)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x106')));}if(_0x3713f6&&_0x3713f6[_0x0b70('0x52')]!==_0x0b70('0x80')&&isNotNull(this['voiceQueues'][_0x3713f6[_0x0b70('0xb6')]][_0x0b70('0x107')])){delete this[_0x0b70('0x27')][_0xce69d1[_0x0b70('0xd9')]];this[_0x0b70('0xb4')](this[_0x0b70('0x1f')][_0x3713f6[_0x0b70('0xb6')]]);this[_0x0b70('0x1f')][_0x3713f6['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x0b70('0x1f')][_0x3713f6['queue']][_0x0b70('0xe1')]+=0x1;_0x373a1e=new Hangup(_0x3713f6,_0xce69d1);_0x373a1e[_0x0b70('0xa8')]=0x10;_0x373a1e[_0x0b70('0xa9')]=_0x0b70('0x108');_0x373a1e[_0x0b70('0xfc')]='AGI';this[_0x0b70('0xca')](_0x373a1e)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x109')));this[_0x0b70('0xc8')](_0x373a1e)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x106')));}if(_0x3713f6&&_0x3713f6[_0x0b70('0x52')]!==_0x0b70('0x80')&&!isNotNull(this[_0x0b70('0x1f')][_0x3713f6['queue']][_0x0b70('0x107')])){delete this[_0x0b70('0x27')][_0xce69d1[_0x0b70('0xd9')]];this[_0x0b70('0xb4')](this[_0x0b70('0x1f')][_0x3713f6[_0x0b70('0xb6')]]);this[_0x0b70('0x1f')][_0x3713f6[_0x0b70('0xb6')]][_0x0b70('0x6d')]+=0x1;_0x373a1e=new Hangup(_0x3713f6,_0xce69d1);_0x373a1e[_0x0b70('0xa8')]=0xc;_0x373a1e[_0x0b70('0xa9')]=_0xce69d1[_0x0b70('0x10a')];_0x373a1e[_0x0b70('0xfc')]=_0x0b70('0x10b');this['createHistory'](_0x373a1e)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x109')));this['moveContactManagedDialer'](_0x373a1e)[_0x0b70('0xb2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x0b70('0x1a')][_0x0b70('0x10c')]=function(_0x34ceda){var _0x5a2888=this[_0x0b70('0x27')][_0x34ceda[_0x0b70('0xd9')]];var _0x195a5=this;if(this[_0x0b70('0x1f')][_0x34ceda[_0x0b70('0xb6')]]){if(_0x5a2888&&_0x5a2888[_0x0b70('0x52')]!==_0x0b70('0x80')){delete this[_0x0b70('0x27')][_0x34ceda[_0x0b70('0xd9')]];this['voiceQueues'][_0x34ceda['queue']]['outboundAnswerCallsDay']+=0x1;var _0x52c706=new AgentComplete(_0x5a2888,_0x34ceda);if(_0x34ceda[_0x0b70('0x10d')]===_0x0b70('0x10e')){_0x52c706[_0x0b70('0x10f')]=this[_0x0b70('0x1f')][_0x34ceda[_0x0b70('0xb6')]][_0x0b70('0x110')]&&this[_0x0b70('0x1f')][_0x34ceda['queue']][_0x0b70('0x111')]?moment()[_0x0b70('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x0b70('0xca')](_0x52c706)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x112')));this['moveContactManagedDialer'](_0x52c706)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x113')));}}};Dialer[_0x0b70('0x1a')][_0x0b70('0x2d')]=function(_0x4a896a){if(this[_0x0b70('0x1f')][_0x4a896a['queue']]){if(this[_0x0b70('0x27')][_0x4a896a[_0x0b70('0xd9')]]&&this[_0x0b70('0x27')][_0x4a896a[_0x0b70('0xd9')]][_0x0b70('0x52')]!==_0x0b70('0x80')){this['updateOriginated'](this['voiceQueues'][_0x4a896a[_0x0b70('0xb6')]]);this[_0x0b70('0x27')][_0x4a896a[_0x0b70('0xd9')]][_0x0b70('0x114')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));}}};Dialer[_0x0b70('0x1a')][_0x0b70('0x115')]=function(_0x4bd369){this[_0x0b70('0xca')](_0x4bd369)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x112')));this['moveContactManagedDialer'](_0x4bd369)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x116')));};Dialer['prototype'][_0x0b70('0x117')]=function(_0x3f5b6b){var _0x257688=this[_0x0b70('0x27')][_0x3f5b6b['uniqueid']];var _0x25cc7b=this;if(this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]]){if(_0x257688&&_0x257688[_0x0b70('0x52')]!==_0x0b70('0x80')){delete this[_0x0b70('0x27')][_0x3f5b6b[_0x0b70('0xd9')]];this[_0x0b70('0xb4')](this['voiceQueues'][_0x3f5b6b['queue']]);_0x257688[_0x0b70('0x118')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));var _0x52509b=new QueueCallerAbandon(_0x257688,_0x3f5b6b);if(getSeconds(_0x257688[_0x0b70('0x118')],_0x257688[_0x0b70('0x119')])>=_0x257688['dialQueueTimeout']){this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x72')]+=0x1;this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x69')]+=0x1;this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x74')]+=0x1;_0x52509b[_0x0b70('0xa8')]=0xa;_0x52509b[_0x0b70('0xa9')]=_0x0b70('0x11a');_0x52509b[_0x0b70('0x11b')]='TIMEOUT';_0x52509b[_0x0b70('0x10f')]=this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x110')]?moment()[_0x0b70('0x7d')](_0x0b70('0xf9')):undefined;_0x52509b['countdropretry']+=0x1;_0x52509b[_0x0b70('0xe8')]+=0x1;if(_0x52509b[_0x0b70('0xef')]>=this[_0x0b70('0x1f')][_0x3f5b6b['queue']][_0x0b70('0x11c')]){this[_0x0b70('0x115')](_0x52509b);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x52509b[_0x0b70('0xef')],'scheduledat':moment()[_0x0b70('0x104')](this[_0x0b70('0x1f')][_0x3f5b6b['queue']][_0x0b70('0x11d')],'minutes')[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x257688['ContactId'],'ListId':_0x257688[_0x0b70('0xd0')],'VoiceQueueId':_0x257688[_0x0b70('0xfb')]||undefined,'CampaignId':_0x257688[_0x0b70('0xd2')]||undefined})['catch'](loggerCatch(_0x0b70('0x11e')));var _0x299027=new History(_0x52509b);_0x299027[_0x0b70('0xa8')]=0xa;_0x299027[_0x0b70('0xa9')]=_0x0b70('0x11a');_0x299027[_0x0b70('0x11f')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));_0x299027[_0x0b70('0xaa')]=_0x299027[_0x0b70('0x11f')];_0x299027[_0x0b70('0x120')]=_0x52509b['calleridname'];_0x299027[_0x0b70('0x121')]=_0x52509b['calleridnum'];this[_0x0b70('0xca')](_0x299027)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x71')]+=0x1;this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]][_0x0b70('0x68')]+=0x1;_0x52509b[_0x0b70('0xa8')]=0xb;_0x52509b[_0x0b70('0xa9')]='Abandoned';_0x52509b[_0x0b70('0x11b')]=_0x0b70('0x122');_0x52509b[_0x0b70('0x102')]+=0x1;_0x52509b[_0x0b70('0xe8')]+=0x1;if(_0x52509b[_0x0b70('0x102')]>=this[_0x0b70('0x1f')][_0x3f5b6b['queue']][_0x0b70('0x123')]){this[_0x0b70('0x115')](_0x52509b);}else{this[_0x0b70('0xbe')]({'active':![],'countabandonedretry':_0x52509b[_0x0b70('0x102')],'scheduledat':moment()[_0x0b70('0x104')](this[_0x0b70('0x1f')][_0x3f5b6b[_0x0b70('0xb6')]]['dialAbandonedRetryFrequency'],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x257688[_0x0b70('0xfa')],'ListId':_0x257688[_0x0b70('0xd0')],'VoiceQueueId':_0x257688[_0x0b70('0xfb')]||undefined,'CampaignId':_0x257688[_0x0b70('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x299027=new History(_0x52509b);_0x299027[_0x0b70('0xa8')]=0xb;_0x299027['statedesc']=_0x0b70('0x124');_0x299027[_0x0b70('0x11f')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));_0x299027['endtime']=_0x299027[_0x0b70('0x11f')];_0x299027[_0x0b70('0x120')]=_0x52509b['calleridname'];_0x299027[_0x0b70('0x121')]=_0x52509b[_0x0b70('0x121')];this[_0x0b70('0xca')](_0x299027)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x125')));}}}}};Dialer[_0x0b70('0x1a')]['syncNewExten']=function(_0x5b1c31){if(this[_0x0b70('0x25')][_0x5b1c31[_0x0b70('0xd9')]]){this[_0x0b70('0x25')][_0x5b1c31[_0x0b70('0xd9')]]['channel']=_0x5b1c31[_0x0b70('0xb1')];}if(this[_0x0b70('0x27')][_0x5b1c31[_0x0b70('0xd9')]]){this['uniqueId'][_0x5b1c31[_0x0b70('0xd9')]][_0x0b70('0xb1')]=_0x5b1c31[_0x0b70('0xb1')];}};Dialer[_0x0b70('0x1a')]['syncQueueMember']=function(_0x220644){if(strategy[this[_0x0b70('0x1f')][this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]]['queue']][_0x0b70('0x54')]]===_0x0b70('0x19')){if(this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]]&&_['isNil'](this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]][_0x0b70('0x127')])&&_0x220644[_0x0b70('0xd6')]==='1'&&_0x220644[_0x0b70('0x128')]==='0'){if(this['agents'][_0x220644[_0x0b70('0x129')]]){if(!this['agents'][_0x220644[_0x0b70('0x129')]]['locked']){this[_0x0b70('0x21')][_0x220644['stateinterface']][_0x0b70('0x127')]=!![];this['actions'][_0x220644['actionid']][_0x0b70('0x127')]=!![];this[_0x0b70('0x25')][_0x220644['actionid']][_0x0b70('0x129')]=_0x220644[_0x0b70('0x129')];}}}}else if((strategy[this[_0x0b70('0x1f')][this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]][_0x0b70('0xb6')]][_0x0b70('0x54')]]||_0x0b70('0x18'))==='rrmemory'){if(this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]]){if(this['agents'][_0x220644[_0x0b70('0x129')]]){this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]][_0x0b70('0x129')]=_0x220644[_0x0b70('0x129')];if(_['isNil'](this[_0x0b70('0x12a')][this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]][_0x0b70('0xb6')]])){this['queueBooked'][this[_0x0b70('0x25')][_0x220644['actionid']][_0x0b70('0xb6')]]=[];}this['queueBooked'][this[_0x0b70('0x25')][_0x220644['actionid']][_0x0b70('0xb6')]][_0x0b70('0x12b')](_[_0x0b70('0x8f')](_[_0x0b70('0x12c')](this[_0x0b70('0x25')][_0x220644[_0x0b70('0x126')]],['idHopper','stateinterface']),{'status':_0x220644[_0x0b70('0xd6')],'paused':_0x220644[_0x0b70('0x128')]}));}}}};function unlockQueueStatus(_0x4d96a5,_0x1a5c45){setTimeout(function(){if(_['isUndefined'](_0x4d96a5[_0x0b70('0x12d')])){loggerBooked[_0x0b70('0x95')](_0x0b70('0x12e'),_0x1a5c45);}_0x4d96a5[_0x0b70('0x12d')]=!![];loggerBooked[_0x0b70('0x82')](_0x0b70('0x12f'),_0x1a5c45,JSON[_0x0b70('0x4e')](_[_0x0b70('0x12c')](_0x4d96a5,[_0x0b70('0x43'),_0x0b70('0x12d')])));},0x1f3);}Dialer[_0x0b70('0x1a')]['syncQueueStatusComplete']=function(_0x35beaa){var _0x5e71de=this;var _0xf1d0c9=_0x5e71de[_0x0b70('0x1f')][_0x5e71de['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]];if(strategy[this[_0x0b70('0x1f')][this['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]]['strategy']]===_0x0b70('0x19')){if(this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]]&&this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0x129')]){this['preview'][_0x0b70('0x130')](this['actions'][_0x35beaa[_0x0b70('0x126')]]['idHopper'],this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0x129')])[_0x0b70('0xb2')](function(_0x33374b){logger[_0x0b70('0x95')](_0x0b70('0x131'),util[_0x0b70('0x96')](_0x33374b,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5e71de[_0x0b70('0xb4')](_0x5e71de[_0x0b70('0x1f')][_0x5e71de[_0x0b70('0x25')][_0x35beaa['actionid']][_0x0b70('0xb6')]]);_0x5e71de[_0x0b70('0x21')][_0x5e71de[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]]['stateinterface']][_0x0b70('0x127')]=![];delete _0x5e71de[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]];unlockQueueStatus(_0xf1d0c9);});}else{this[_0x0b70('0xb4')](this[_0x0b70('0x1f')][this['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]]);this[_0x0b70('0xbe')]({'active':![],'ContactId':this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xfa')],'ListId':this['actions'][_0x35beaa['actionid']][_0x0b70('0xd0')],'VoiceQueueId':this['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xfb')]||undefined,'CampaignId':this[_0x0b70('0x25')][_0x35beaa['actionid']][_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x132')));delete this[_0x0b70('0x25')][_0x35beaa['actionid']];unlockQueueStatus(_0xf1d0c9);}}else if((strategy[this[_0x0b70('0x1f')][this[_0x0b70('0x25')][_0x35beaa['actionid']][_0x0b70('0xb6')]][_0x0b70('0x54')]]||_0x0b70('0x18'))===_0x0b70('0x18')){var _0x37ee92;if(this[_0x0b70('0x25')][_0x35beaa['actionid']]&&!_[_0x0b70('0x4b')](this[_0x0b70('0x12a')][this['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]])){if(this[_0x0b70('0x2b')][_0x5e71de['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]]){this[_0x0b70('0x2b')][_0x5e71de[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]]=this[_0x0b70('0x2b')][this[_0x0b70('0x25')][_0x35beaa['actionid']][_0x0b70('0xb6')]]?this['queueBookedRR'][this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]]['queue']]:this[_0x0b70('0x12a')][this[_0x0b70('0x25')][_0x35beaa['actionid']][_0x0b70('0xb6')]]?this[_0x0b70('0x12a')][this[_0x0b70('0x25')][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]][_0x0b70('0x133')]||0x0:0x0;}this[_0x0b70('0x12a')][this['actions'][_0x35beaa[_0x0b70('0x126')]][_0x0b70('0xb6')]][_0x0b70('0x133')]=this[_0x0b70('0x2b')][this['actions'][_0x35beaa['actionid']][_0x0b70('0xb6')]];for(var _0x45af13=0x0;_0x45af13=0x0;})['catch'](myreject(_0x3a3aca)));}}else{_0x1e31ae[_0x0b70('0x12b')](ami[_0x0b70('0xb0')]({'action':_0x0b70('0x14f'),'command':util[_0x0b70('0x7d')](_0x0b70('0x14c'),_0x59b894,!_[_0x0b70('0x40')](config[_0x0b70('0x148')][_0x1196ec])?_0x1196ec:'')})[_0x0b70('0x3f')](function(_0x39160f){return _0x39160f[_0x0b70('0x150')][_0x0b70('0x151')](_0x0b70('0x14e'))>=0x0;})['catch'](myreject(_0x3a3aca)));}BPromise[_0x0b70('0x152')](_0x1e31ae)[_0x0b70('0x3f')](function(_0x3742a6){var _0xe66743=_[_0x0b70('0x153')](_0x3742a6);if(_0xe66743){return _0x2e8b54(_0xe66743);}else{_0x4fc9ac[_0x0b70('0x41')]=_0x11f14f?_0x0b70('0x154'):_0x0b70('0x155');return _0x3a3aca(msgResponse(_0x0b70('0x156'),_0x0b70('0x144'),_0x0b70('0x157')+_0x11f14f+'\x20'+_0x46e5fc+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x59b894,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1196ec));}})[_0x0b70('0xb2')](function(_0x149d29){return _0x3a3aca(msgResponse(_0x0b70('0x142'),_0x0b70('0x144'),JSON[_0x0b70('0x4e')](_0x149d29)));});});};Dialer[_0x0b70('0x1a')]['checkDialMethod']=function(_0x10f6d3){var _0x4cc679=this;return function(){switch(_0x10f6d3['dialMethod']){case _0x0b70('0x158'):freeVariablesPredictive(_0x10f6d3);_0x4cc679[_0x0b70('0x159')](_0x10f6d3,0x1);break;case _0x0b70('0x15a'):freeVariablesPredictive(_0x10f6d3);_0x4cc679[_0x0b70('0x159')](_0x10f6d3,_0x10f6d3['dialPowerLevel']);break;case _0x0b70('0x15b'):_0x4cc679['predictive'](_0x10f6d3);break;case'booked':freeVariablesPredictive(_0x10f6d3);_0x4cc679[_0x0b70('0x159')](_0x10f6d3,0x1);break;default:freeVariablesPredictive(_0x10f6d3);logger['error'](_0x0b70('0x15c'),_0x10f6d3['name'],_0x0b70('0x15d'));}};};Dialer[_0x0b70('0x1a')]['checkPreviewRecallReminder']=function(_0x10ca42){return BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](cmHopper['handlePreviewRecallNotifications'](_0x10ca42['id'],previewRecallmeReminderInterval))[_0x0b70('0x3f')](function(_0x58cd06){for(var _0x462f49=0x0;_0x462f49<_0x58cd06[_0x0b70('0x97')];_0x462f49++){var _0x2cf548=_0x58cd06[_0x462f49][_0x0b70('0x15e')]['name'];if(_0x2cf548)io['to'](util[_0x0b70('0x7d')](_0x0b70('0x15f'),_0x2cf548))[_0x0b70('0xe9')](_0x0b70('0x160'),{'hopper':_0x58cd06[_0x462f49]});}})[_0x0b70('0xb2')](function(_0x23ab39){});};Dialer[_0x0b70('0x1a')][_0x0b70('0x161')]=function(_0xecbf19){var _0x48d872=this;return function(){_0x48d872[_0x0b70('0x162')](_0xecbf19);};};Dialer['prototype']['syncQueueSummary']=function(_0x4aa1f5){var _0x96a3b0=this;if(isNotPreview(_0x4aa1f5['dialMethod'])){if(isVoiceQueueOutbound(_0x4aa1f5['type'])&&isActive(_0x4aa1f5['dialActive'])){_0x4aa1f5['sendMessageOneNotActive']=!![];BPromise[_0x0b70('0xb8')]()[_0x0b70('0x3f')](checkIsLoggedIn(_0x4aa1f5,_0x4aa1f5['loggedIn']))[_0x0b70('0x3f')](checkIsActive(_0x4aa1f5,_0x4aa1f5[_0x0b70('0x163')]))[_0x0b70('0x3f')](checkInterval(_0x4aa1f5))['then'](_0x96a3b0[_0x0b70('0x13d')](_0x4aa1f5))[_0x0b70('0x3f')](_0x96a3b0[_0x0b70('0x141')](_0x4aa1f5[_0x0b70('0x164')],_0x4aa1f5[_0x0b70('0x165')],_0x4aa1f5['name'],_0x4aa1f5))[_0x0b70('0x3f')](_0x96a3b0[_0x0b70('0x143')](_0x4aa1f5[_0x0b70('0x47')],_0x4aa1f5[_0x0b70('0x165')],_0x4aa1f5[_0x0b70('0x43')],_0x4aa1f5))[_0x0b70('0x3f')](_0x96a3b0[_0x0b70('0x166')](_0x4aa1f5))['catch'](loggerCatchQueueSummary(_0x0b70('0x167'),_0x4aa1f5));}else{notSendMessagesQueue(_0x4aa1f5);}}else{freeVariablesPredictive(_0x4aa1f5);if(_0x4aa1f5[_0x0b70('0x168')]){_0x96a3b0[_0x0b70('0x169')](_0x4aa1f5);}}};Dialer[_0x0b70('0x1a')][_0x0b70('0x16a')]=function(){var _0x1d5f47=this;var _0x272ef6;for(var _0x50e9e1 in this[_0x0b70('0x20')]){if(typeof this[_0x0b70('0x20')][_0x50e9e1]!==_0x0b70('0xae')){_0x272ef6=this[_0x0b70('0x20')][_0x50e9e1];if(isCampaignIvr(_0x272ef6[_0x0b70('0x52')])&&isActive(_0x272ef6[_0x0b70('0x7b')])){_0x272ef6[_0x0b70('0xa1')]=!![];BPromise[_0x0b70('0xb8')]()['then'](checkIsActive(_0x272ef6,_0x272ef6[_0x0b70('0x7b')]))['then'](checkInterval(_0x272ef6))[_0x0b70('0x3f')](_0x1d5f47[_0x0b70('0x13d')](_0x272ef6))[_0x0b70('0x3f')](_0x1d5f47[_0x0b70('0x141')](_0x272ef6['dialGlobalInterval'],_0x272ef6[_0x0b70('0x165')],_0x272ef6[_0x0b70('0x43')],_0x272ef6))[_0x0b70('0x3f')](_0x1d5f47[_0x0b70('0x143')](_0x272ef6[_0x0b70('0x47')],_0x272ef6['dialTimezone'],_0x272ef6[_0x0b70('0x43')],_0x272ef6))[_0x0b70('0x3f')](_0x1d5f47[_0x0b70('0x161')](_0x272ef6))[_0x0b70('0xb2')](loggerCatchQueueSummary(_0x0b70('0x16b'),_0x272ef6));}else{notSendMessagesCampaign(_0x272ef6);}}}};function getCallerIdRandom(_0x5a1016,_0x1a7fa8){var _0x271e98;var _0x15117e;var _0xc30b54;if(_0x1a7fa8<=0x0){_0x1a7fa8=0x1;}_0x271e98=new RegExp(_0x0b70('0x16c')+_0x1a7fa8+'}$');_0x15117e=Math[_0x0b70('0x16d')](0xa,_0x1a7fa8-0x1);_0xc30b54=Math[_0x0b70('0x16d')](0xa,_0x1a7fa8)-0x1;return util[_0x0b70('0x7d')]('%s',_[_0x0b70('0x16e')](_0x5a1016,_0x271e98,_[_0x0b70('0x16f')](_0x15117e,_0xc30b54)));}function extractCalleridName(_0xb3e633){var _0x458b7e=_0xb3e633[_0x0b70('0x170')](/"(.*?)"/);return _0x458b7e?_0x458b7e[0x1]:_0xb3e633;}function extractCalleridNumber(_0x482690){var _0x498a99=_0x482690[_0x0b70('0x170')](/<(.*?)>/);return _0x498a99?_0x498a99[0x1]:_0x482690;}Dialer[_0x0b70('0x1a')][_0x0b70('0x171')]=function(_0x307251,_0x2bfe15){var _0x21f73e=this;var _0x4fe44f=uuid['v4']();this['actions'][_0x4fe44f]=new Action(_0x307251,_0x2bfe15,_0x4fe44f);return new BPromise(function(_0x263238,_0x2965c0){if(_[_0x0b70('0x40')](_0x307251)&&typeof _0x307251!=='object'){return _0x2965c0(msgResponse(_0x0b70('0x172'),'Failure',_0x0b70('0x173')));}if(_[_0x0b70('0x40')](_0x2bfe15[_0x0b70('0x174')][_0x0b70('0x175')])||_0x2bfe15[_0x0b70('0x174')][_0x0b70('0x175')]===null){return _0x2965c0(msgResponse(_0x0b70('0x172'),_0x0b70('0x144'),_0x0b70('0x176')));}var _0x16b558={'XMD-CALLERID':_0x21f73e[_0x0b70('0x25')][_0x4fe44f][_0x0b70('0x177')](),'XMD-AGI':_0x307251[_0x0b70('0x107')]?util[_0x0b70('0x7d')](_0x0b70('0x178'),ipAgi,_0x307251[_0x0b70('0x107')]):_0x0b70('0x179'),'XMD-AGIAFTER':_0x307251[_0x0b70('0x110')]?util[_0x0b70('0x7d')](_0x0b70('0x178'),ipAgi,_0x307251[_0x0b70('0x110')]):_0x0b70('0x179'),'XMD-QUEUE':_0x307251[_0x0b70('0x52')]===_0x0b70('0x53')?util[_0x0b70('0x7d')](_0x0b70('0x17a'),_0x307251[_0x0b70('0x43')],_0x307251['dialQueueOptions']||'',_0x307251[_0x0b70('0x111')]?'c':'',_0x307251[_0x0b70('0x17b')]||0x3):_0x0b70('0x179'),'XMD-CONTACTID':_0x2bfe15[_0x0b70('0xfa')],'XMD-CDRTYPE':_0x0b70('0x6'),'CALLERID(all)':_0x21f73e[_0x0b70('0x25')][_0x4fe44f][_0x0b70('0x177')](),'XMD-AMD':_0x307251[_0x0b70('0xde')]?_0x0b70('0x17c'):_0x0b70('0x179'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x307251[_0x0b70('0xde')]){_0x16b558[_0x0b70('0x17d')]=_0x307251[_0x0b70('0x17e')]||0x9c4;_0x16b558['XMD-AMDGREETING']=_0x307251[_0x0b70('0x17f')]||0x5dc;_0x16b558['XMD-AMDAFTERGREETINGSILENCE']=_0x307251[_0x0b70('0x180')]||0x320;_0x16b558[_0x0b70('0x181')]=_0x307251['dialAMDTotalAnalysisTime']||0x1388;_0x16b558[_0x0b70('0x182')]=_0x307251[_0x0b70('0x183')]||0x64;_0x16b558[_0x0b70('0x184')]=_0x307251[_0x0b70('0x185')]||0x32;_0x16b558[_0x0b70('0x186')]=_0x307251['dialAMDMaximumNumberOfWords']||0x3;_0x16b558[_0x0b70('0x187')]=_0x307251[_0x0b70('0x188')]||0x100;_0x16b558['XMD-AMDMAXIMUMWORDLENGTH']=_0x307251[_0x0b70('0x189')]||0x1388;}if(_0x307251[_0x0b70('0x52')]==='outbound'){_0x16b558[_0x0b70('0x18a')]=_0x2bfe15[_0x0b70('0xfb')];}else{_0x16b558['XMD-CAMPAIGNID']=_0x2bfe15['CampaignId'];}for(var _0x272a3d in _0x2bfe15[_0x0b70('0x174')]){if(typeof _0x2bfe15[_0x0b70('0x174')][_0x272a3d]!==_0x0b70('0xae')){if(isNotNull(_0x2bfe15[_0x0b70('0x174')][_0x272a3d])&&_0x272a3d!=='id'&&_0x272a3d!==_0x0b70('0x18b')&&_0x272a3d!=='createdAt'&&_0x272a3d!==_0x0b70('0x18c')){_0x16b558[util[_0x0b70('0x7d')](_0x0b70('0x18d'),_0x0b70('0x18e'),_[_0x0b70('0x18f')](_0x272a3d))]=_0x2bfe15['Contact'][_0x272a3d];}}}var _0x165869=_0x21f73e[_0x0b70('0x13e')](_0x307251[_0x0b70('0x7a')])?getCallerId(_0x307251['Trunk']['callerid'],_0x307251['dialOriginateCallerIdName'],_0x307251[_0x0b70('0x190')]>0x0?getCallerIdRandom(_0x307251[_0x0b70('0x62')],_0x307251[_0x0b70('0x190')]):_0x307251[_0x0b70('0x62')]):getCallerId(_[_0x0b70('0xaf')](_0x307251['TrunkBackup'])?_0x307251[_0x0b70('0x7a')]['callerid']:_0x307251[_0x0b70('0x191')][_0x0b70('0x192')],_0x307251[_0x0b70('0x193')],_0x307251[_0x0b70('0x190')]>0x0?getCallerIdRandom(_0x307251['dialOriginateCallerIdNumber'],_0x307251[_0x0b70('0x190')]):_0x307251[_0x0b70('0x62')]);if(_0x165869){_0x16b558[_0x0b70('0x194')]=_0x21f73e[_0x0b70('0x25')][_0x4fe44f][_0x0b70('0x195')]=extractCalleridName(_0x165869);_0x16b558['XMD-ORIGINATECALLERIDNUM']=_0x21f73e[_0x0b70('0x25')][_0x4fe44f][_0x0b70('0x196')]=extractCalleridNumber(_0x165869);}return ami[_0x0b70('0xb0')]({'actionid':_0x4fe44f,'action':_0x0b70('0x172'),'channel':_0x21f73e[_0x0b70('0x13e')](_0x307251['Trunk'])?util['format'](_0x0b70('0x197'),_0x307251[_0x0b70('0x7a')][_0x0b70('0x43')],isNotNull(_0x307251[_0x0b70('0x64')])?_0x307251[_0x0b70('0x64')][_0x0b70('0x198')]()||'':'',_0x307251[_0x0b70('0x199')]>0x0?_0x2bfe15[_0x0b70('0x174')][_0x0b70('0x175')]['substring'](_0x307251[_0x0b70('0x199')]):_0x2bfe15[_0x0b70('0x174')][_0x0b70('0x175')]):util[_0x0b70('0x7d')](_0x0b70('0x197'),_['isNil'](_0x307251[_0x0b70('0x191')])?_0x307251[_0x0b70('0x7a')][_0x0b70('0x43')]:_0x307251[_0x0b70('0x191')]['name'],isNotNull(_0x307251[_0x0b70('0x64')])?_0x307251[_0x0b70('0x64')][_0x0b70('0x198')]()||'':'',_0x307251[_0x0b70('0x199')]>0x0?_0x2bfe15['Contact'][_0x0b70('0x175')][_0x0b70('0x19a')](_0x307251[_0x0b70('0x199')]):_0x2bfe15['Contact'][_0x0b70('0x175')]),'callerid':_0x165869,'Exten':_0x0b70('0xdd'),'Context':_0x0b70('0x19b'),'Priority':'1','variable':_0x16b558,'timeout':(_0x307251[_0x0b70('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4fe44f})['then'](function(_0x140f24){return _0x263238(_0x140f24);})[_0x0b70('0xb2')](function(_0x7b7821){_0x307251[_0x0b70('0x19c')]+=0x1;var _0x13679b=new History(_0x21f73e[_0x0b70('0x25')][_0x4fe44f]);logger[_0x0b70('0x95')](util[_0x0b70('0x7d')](_0x0b70('0x19d'),JSON[_0x0b70('0x4e')](_0x7b7821)));_0x13679b[_0x0b70('0xa8')]=0xe;_0x13679b[_0x0b70('0xa9')]=_0x0b70('0x19e');_0x13679b['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x13679b['endtime']=_0x13679b[_0x0b70('0x11f')];_0x21f73e['createHistory'](_0x13679b)['catch'](loggerCatch(_0x0b70('0x19f')));_0x21f73e[_0x0b70('0xc8')](_0x13679b)['catch'](loggerCatch(_0x0b70('0x19f')))[_0x0b70('0x1a0')](function(){delete _0x21f73e['actions'][_0x4fe44f];return _0x2965c0(msgResponse(_0x0b70('0x172'),_0x0b70('0x4d'),_0x0b70('0x1a1')));});});});};Dialer[_0x0b70('0x1a')][_0x0b70('0x30')]=function(_0x4b9f49){var _0x158392=this[_0x0b70('0x25')][_0x4b9f49[_0x0b70('0x126')]];if(_0x158392){delete this[_0x0b70('0x25')][_0x4b9f49['actionid']];_0x158392[_0x0b70('0x119')]=moment()[_0x0b70('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3c3520=_0x158392[_0x0b70('0x52')]==='ivr'?this[_0x0b70('0x20')][_0x158392[_0x0b70('0xb6')]]:this[_0x0b70('0x1f')][_0x158392[_0x0b70('0x1a2')]()];if(!this[_0x0b70('0xd5')](_0x4b9f49['response'])){this[_0x0b70('0xb4')](_0x3c3520);return this[_0x0b70('0x1a3')](_0x158392,_0x3c3520,_0x4b9f49)[_0x0b70('0xb2')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x0b70('0x27')][_0x4b9f49[_0x0b70('0xd9')]]=_0x158392;}};Dialer['prototype'][_0x0b70('0x1a4')]=function(_0x52fe8c,_0x395b03,_0x16f958){var _0x4b78f9=new History(_0x395b03);if(_0x4b78f9['countbusyretry']+_0x4b78f9[_0x0b70('0x101')]+_0x4b78f9[_0x0b70('0xed')]+_0x4b78f9[_0x0b70('0xee')]+_0x4b78f9[_0x0b70('0xef')]+_0x4b78f9[_0x0b70('0x102')]+_0x4b78f9[_0x0b70('0xf0')]+_0x4b78f9[_0x0b70('0xf1')]>=_0x16f958[_0x0b70('0xf2')]-0x1){return!![];}switch(_0x52fe8c){case 0x3:if(_0x4b78f9[_0x0b70('0xed')]>=_0x16f958[_0x0b70('0x1a5')]-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countnoanswerretry':_0x4b78f9[_0x0b70('0xed')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958['dialNoAnswerRetryFrequency'],'minutes')['format'](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1a6')));break;case 0x5:if(_0x4b78f9['countbusyretry']>=_0x16f958[_0x0b70('0x1a7')]-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countbusyretry':_0x4b78f9[_0x0b70('0xec')]+=0x1,'scheduledat':moment()['add'](_0x16f958[_0x0b70('0x1a8')],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1a9')));break;case 0x8:if(_0x4b78f9[_0x0b70('0x101')]>=_0x16f958[_0x0b70('0x1aa')]-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countcongestionretry':_0x4b78f9[_0x0b70('0x101')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958[_0x0b70('0x1ab')],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4b78f9[_0x0b70('0xee')]>=_0x16f958[_0x0b70('0x1ac')]-0x1){return!![];}else{this[_0x0b70('0xbe')]({'active':![],'countnosuchnumberretry':_0x4b78f9[_0x0b70('0xee')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958[_0x0b70('0x1ad')],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9['ListId'],'VoiceQueueId':_0x4b78f9['VoiceQueueId']||undefined,'CampaignId':_0x4b78f9['CampaignId']||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1ae')));}break;case 0xa:if(_0x4b78f9[_0x0b70('0xef')]>=_0x16f958['dialDropMaxRetry']-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countdropretry':_0x4b78f9[_0x0b70('0xef')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958['dialDropRetryFrequency'],_0x0b70('0xf8'))[_0x0b70('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b78f9['ContactId'],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x11e')));break;case 0xb:if(_0x4b78f9[_0x0b70('0x102')]>=_0x16f958[_0x0b70('0x123')]-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countabandonedretry':_0x4b78f9[_0x0b70('0x102')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958[_0x0b70('0x1af')],_0x0b70('0xf8'))[_0x0b70('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1b0')));break;case 0x13:if(_0x4b78f9[_0x0b70('0xf0')]>=_0x16f958[_0x0b70('0x103')]-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countmachineretry':_0x4b78f9[_0x0b70('0xf0')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958[_0x0b70('0xf7')],_0x0b70('0xf8'))['format'](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1b1')));break;case 0x14:if(_0x4b78f9[_0x0b70('0xf1')]>=_0x16f958['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x0b70('0xbe')]({'active':![],'countagentrejectretry':_0x4b78f9[_0x0b70('0xf1')]+=0x1,'scheduledat':moment()[_0x0b70('0x104')](_0x16f958[_0x0b70('0x1b2')],_0x0b70('0xf8'))[_0x0b70('0x7d')](_0x0b70('0xf9')),'ContactId':_0x4b78f9[_0x0b70('0xfa')],'ListId':_0x4b78f9[_0x0b70('0xd0')],'VoiceQueueId':_0x4b78f9[_0x0b70('0xfb')]||undefined,'CampaignId':_0x4b78f9['CampaignId']||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1b3')));break;default:return!![];}};Dialer[_0x0b70('0x1a')][_0x0b70('0x1a3')]=function(_0x3dfe55,_0x76f2ce,_0x55ce9d){var _0x1b9371=this;var _0x28b986=new History(_0x3dfe55);return new BPromise(function(_0x15d177,_0x1f0379){if(_[_0x0b70('0x40')](_0x76f2ce)&&typeof _0x76f2ce!=='object'){return _0x1f0379(msgResponse(_0x0b70('0x1b4'),_0x0b70('0x144'),_0x0b70('0x1b5')));}if(_['isUndefined'](_0x55ce9d)&&typeof _0x55ce9d!==_0x0b70('0x1b6')){return _0x1f0379(msgResponse(_0x0b70('0x1b4'),'Failure','evt\x20is\x20undefine'));}switch(_0x55ce9d[_0x0b70('0x10d')]){case'0':_0x76f2ce[_0x0b70('0x6b')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0x0;_0x28b986[_0x0b70('0xa9')]='NoSuchNumber';_0x28b986[_0x0b70('0xee')]+=0x1;_0x28b986[_0x0b70('0xe8')]+=0x1;ami[_0x0b70('0xe9')]('custom:agentnosuchnumber',ut[_0x0b70('0xeb')](_0x3dfe55,'nosuchnumber'));_0x1b9371['createHistory'](_0x28b986)[_0x0b70('0xb2')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1b9371['checkRetriveMax'](0x0,_0x3dfe55,_0x76f2ce)){if(_0x28b986['countnosuchnumberretry']>=_0x76f2ce[_0x0b70('0x1ac')]){_0x1b9371[_0x0b70('0xf5')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1b7'));}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1b7'));}}break;case'3':_0x76f2ce[_0x0b70('0x6a')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0x3;_0x28b986[_0x0b70('0xa9')]='NoAnswer';_0x28b986[_0x0b70('0xed')]+=0x1;_0x28b986[_0x0b70('0xe8')]+=0x1;ami['emit'](_0x0b70('0x1b8'),ut[_0x0b70('0xeb')](_0x3dfe55,_0x0b70('0x1b9')));_0x1b9371['createHistory'](_0x28b986)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1ba')));if(_0x1b9371[_0x0b70('0x1a4')](0x3,_0x3dfe55,_0x76f2ce)){if(_0x28b986['countnoanswerretry']>=_0x76f2ce['dialNoAnswerMaxRetry']){_0x1b9371[_0x0b70('0xf5')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1bb'));}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x76f2ce[_0x0b70('0x1bc')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0x5;_0x28b986[_0x0b70('0xa9')]=_0x0b70('0x1bd');_0x28b986[_0x0b70('0xec')]+=0x1;_0x28b986['countglobal']+=0x1;ami[_0x0b70('0xe9')]('custom:agentbusy',ut[_0x0b70('0xeb')](_0x3dfe55,'busy'));_0x1b9371[_0x0b70('0xca')](_0x28b986)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1be')));if(_0x1b9371[_0x0b70('0x1a4')](0x5,_0x3dfe55,_0x76f2ce)){if(_0x28b986['countbusyretry']>=_0x76f2ce[_0x0b70('0x1a7')]){_0x1b9371['createStateFinal'](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1bf'));}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1bf'));}}break;case'8':_0x76f2ce[_0x0b70('0x66')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0x8;_0x28b986[_0x0b70('0xa9')]=_0x0b70('0x1c0');_0x28b986[_0x0b70('0x101')]+=0x1;_0x28b986['countglobal']+=0x1;ami[_0x0b70('0xe9')](_0x0b70('0x1c1'),ut['buildObj'](_0x3dfe55,_0x0b70('0x1c2')));_0x1b9371[_0x0b70('0xca')](_0x28b986)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1b9371[_0x0b70('0x1a4')](0x8,_0x3dfe55,_0x76f2ce)){if(_0x28b986[_0x0b70('0x101')]>=_0x76f2ce[_0x0b70('0x1aa')]){_0x1b9371[_0x0b70('0xf5')](_0x28b986,_0x15d177,_0x1f0379,'reason\x208\x20congestion');}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1c3'));}}break;case'11':_0x76f2ce[_0x0b70('0x1c4')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0xb;_0x28b986[_0x0b70('0xa9')]=_0x0b70('0x124');_0x28b986[_0x0b70('0x102')]+=0x1;_0x28b986[_0x0b70('0xe8')]+=0x1;_0x1b9371[_0x0b70('0xca')](_0x28b986)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x125')));if(_0x1b9371[_0x0b70('0x1a4')](0xb,_0x3dfe55,_0x76f2ce)){if(_0x28b986['countabandonedretry']>=_0x76f2ce[_0x0b70('0x123')]){_0x1b9371[_0x0b70('0xf5')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1c5'));}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,'reason\x2011\x20abandoned');}}break;case'20':_0x76f2ce['outboundRejectCallsDay']+=0x1;_0x28b986[_0x0b70('0xa8')]=0x14;_0x28b986['statedesc']=_0x0b70('0x1c6');_0x28b986[_0x0b70('0xf1')]+=0x1;_0x28b986[_0x0b70('0xe8')]+=0x1;ami[_0x0b70('0xe9')](_0x0b70('0x1c7'),ut[_0x0b70('0xeb')](_0x3dfe55,'agentreject'));_0x1b9371[_0x0b70('0xca')](_0x28b986)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1c8')));if(_0x1b9371[_0x0b70('0x1a4')](0x14,_0x3dfe55,_0x76f2ce)){if(_0x28b986[_0x0b70('0xf1')]>=_0x76f2ce[_0x0b70('0x1c9')]){_0x1b9371['createStateFinal'](_0x28b986,_0x15d177,_0x1f0379,'reason\x2020\x20agentreject');}else{_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,_0x0b70('0x1ca'));}}break;default:_0x76f2ce[_0x0b70('0x6d')]+=0x1;_0x28b986[_0x0b70('0xa8')]=0xc;_0x28b986[_0x0b70('0xa9')]=_0x55ce9d[_0x0b70('0x10d')];_0x1b9371['createHistory'](_0x28b986)[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1cb')));if(_0x1b9371['checkRetriveMax'](_0x55ce9d[_0x0b70('0x10d')],_0x3dfe55,_0x76f2ce)){if(_0x28b986[_0x0b70('0xec')]+_0x28b986[_0x0b70('0x101')]+_0x28b986['countnoanswerretry']+_0x28b986[_0x0b70('0xee')]+_0x28b986['countdropretry']+_0x28b986[_0x0b70('0x102')]+_0x28b986[_0x0b70('0xf0')]+_0x28b986[_0x0b70('0xf1')]>=_0x76f2ce[_0x0b70('0xf2')]){_0x1b9371[_0x0b70('0xf3')](_0x28b986,_0x15d177,_0x1f0379,_0x55ce9d['reason']);}else{_0x1b9371['createStateFinal'](_0x28b986,_0x15d177,_0x1f0379,_0x55ce9d[_0x0b70('0x10d')]);}}}});};Dialer['prototype'][_0x0b70('0xf3')]=function(_0x2dbf5d,_0x4ce417,_0x1059fe,_0xb17cc6){var _0x27d39a=new Final(_0x2dbf5d);_0x27d39a['state']=0xf;_0x27d39a[_0x0b70('0xa9')]='Global';this[_0x0b70('0xf5')](_0x27d39a,_0x4ce417,_0x1059fe,_0xb17cc6);};Dialer[_0x0b70('0x1a')][_0x0b70('0xf5')]=function(_0x9c02f8,_0x2bced6,_0x1e1150,_0x147899){this[_0x0b70('0xc8')](_0x9c02f8)[_0x0b70('0x3f')](function(){return _0x2bced6(msgResponse(_0x0b70('0x1b4'),_0x0b70('0x1cc'),_0x147899));})[_0x0b70('0xb2')](function(){return _0x1e1150(msgResponse('[moveContactManagedDialer][0]','Failure',_0x0b70('0x1cd')));});};Dialer['prototype'][_0x0b70('0x15b')]=function(_0x559537){var _0x56556c=_0x559537['dialPredictiveOptimizationPercentage']/0x64;var _0x109a8e=_0x559537['outboundDropCallsDayTimeout']/(_0x559537['outboundDropCallsDayTimeout']+_0x559537[_0x0b70('0x65')]);var _0x4c4e8c=Math[_0x0b70('0x1ce')](_0x559537[_0x0b70('0x1cf')]*(_0x559537[_0x0b70('0x1d0')]/0x64));var _0x44dbb2=Math['round'](_0x559537['predictiveIntervalAvailable']*(_0x559537[_0x0b70('0x1d1')]/0x64));var _0x201765=_0x559537[_0x0b70('0x56')]+_0x559537['talking'];var _0x3f82fd=Math[_0x0b70('0x1d2')](_0x559537[_0x0b70('0x1d3')]*_0x559537[_0x0b70('0x78')]*_0x559537[_0x0b70('0x1d4')]*_0x559537['predictiveIntervalMultiplicativeFactor']);if(_[_0x0b70('0x40')](_0x559537[_0x0b70('0x2a')])){if(!_['isUndefined'](_0x559537[_0x0b70('0x29')])){_0x559537[_0x0b70('0x29')]=undefined;loggerPredictive[_0x0b70('0x95')](_0x0b70('0x1d5'),_0x0b70('0x1d6'));}if(!_[_0x0b70('0x40')](_0x559537[_0x0b70('0x90')])){loggerPredictive[_0x0b70('0x95')](_0x0b70('0x1d5'),_0x0b70('0x1d7'));clearInterval(_0x559537['handlePredictive']);_0x559537['handlePredictive']=undefined;}_0x559537[_0x0b70('0x2a')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));loggerPredictive[_0x0b70('0x82')](_0x559537['name'],_0x0b70('0x1d8'),_0x559537[_0x0b70('0x2a')]);this[_0x0b70('0x159')](_0x559537,0x1);}else if(ifInterval(_0x559537['dialPredictiveInterval'],_0x559537[_0x0b70('0x2a')])){this['handlePower'](_0x559537,0x1);loggerPredictiveCalls[_0x0b70('0x82')](_0x0b70('0x1d9'),_0x559537[_0x0b70('0x2a')],_0x559537[_0x0b70('0x43')]);_0x559537[_0x0b70('0x1d3')]=0x0;_0x559537['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x56556c<_0x109a8e&&_0x559537[_0x0b70('0x1da')]==='dropRate'){freeVariablesPredictive(_0x559537);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x0b70('0x1db'),_0x109a8e,_0x0b70('0x2a'),_0x559537[_0x0b70('0x43')]);}else if(_0x3f82fd<_0x559537['predictiveIntervalErlangCallsDroppedCalls']&&_0x559537[_0x0b70('0x1da')]===_0x0b70('0x1dc')){freeVariablesPredictive(_0x559537);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x1dd'),'Max\x20Drop\x20',_0x3f82fd,_0x0b70('0x1de'),_0x559537['predictiveIntervalErlangCallsDroppedCalls'],_0x0b70('0x2a'),_0x559537[_0x0b70('0x43')]);}else if(!ifInterval(_0x559537[_0x0b70('0x1df')],_0x559537[_0x0b70('0x2a')])&&_[_0x0b70('0x40')](_0x559537[_0x0b70('0x29')])&&!_[_0x0b70('0x40')](_0x559537[_0x0b70('0x2a')])){_0x559537['startPredictive']=moment()[_0x0b70('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0b70('0x82')](_0x559537[_0x0b70('0x43')],'started\x20in\x20predictive\x20at',_0x559537['startPredictive']);this[_0x0b70('0x1e0')](_0x559537[_0x0b70('0x1df')])[_0x0b70('0x3f')](this['getDataPredictive'](_0x559537))['then'](mergeDataErlangB(_0x559537))[_0x0b70('0x3f')](this[_0x0b70('0x1e1')](_0x559537))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x559537));}else if(!ifInterval(_0x559537['dialPredictiveInterval'],_0x559537['startPredictive'])){_0x559537['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x559537[_0x0b70('0x29')]=moment()[_0x0b70('0x7d')](_0x0b70('0xf9'));loggerPredictive['info'](_0x559537[_0x0b70('0x43')],_0x0b70('0x1e2'),_0x559537[_0x0b70('0x29')]);clearInterval(_0x559537[_0x0b70('0x90')]);_0x559537['handlePredictive']=undefined;this[_0x0b70('0x1e0')](_0x559537[_0x0b70('0x1df')])[_0x0b70('0x3f')](this[_0x0b70('0x1e3')](_0x559537))['then'](mergeDataErlangB(_0x559537))[_0x0b70('0x3f')](this[_0x0b70('0x1e1')](_0x559537))['catch'](loggerCatchPredictive(_0x0b70('0x1e4'),_0x559537));}else if(_0x559537[_0x0b70('0x1cf')]&&_0x201765<_0x559537[_0x0b70('0x1cf')]-_0x44dbb2){freeVariablesPredictive(_0x559537);loggerPredictive[_0x0b70('0x82')](_0x559537[_0x0b70('0x43')],_0x0b70('0x1e5'),_0x201765,')\x20are\x20less\x20than\x20threshold\x20(',_0x559537['predictiveIntervalAvailable'],'-',_0x44dbb2,'=',_0x559537[_0x0b70('0x1cf')]-_0x44dbb2,')');}else if(_0x559537['predictiveIntervalAvailable']&&_0x201765>_0x559537[_0x0b70('0x1cf')]+_0x4c4e8c){freeVariablesPredictive(_0x559537);loggerPredictive[_0x0b70('0x82')](_0x559537[_0x0b70('0x43')],_0x0b70('0x1e5'),_0x201765,')\x20are\x20more\x20than\x20threshold\x20(',_0x559537[_0x0b70('0x1cf')],'+',_0x4c4e8c,'=',_0x559537[_0x0b70('0x1cf')]+_0x4c4e8c,')');}};Dialer[_0x0b70('0x1a')][_0x0b70('0x1e3')]=function(_0x351ff0){var _0x1e9639=this;return function(_0xf10de6){return new BPromise(function(_0x2104ba,_0x45e3f7){_['merge'](_0x351ff0,_0xf10de6[0x0]);if(checkGetDataPredictive(_0xf10de6[0x0])){var _0x584c96=_0x351ff0[_0x0b70('0x1cf')]=_0x351ff0[_0x0b70('0x5c')]+_0x351ff0[_0x0b70('0x56')];var _0x3c40f7=_0x351ff0['dialPredictiveInterval']*0x3c;var _0x508545=_0xf10de6[0x0][_0x0b70('0x70')]+_0xf10de6[0x0][_0x0b70('0x6f')];var _0xf670bb=(_0xf10de6[0x0][_0x0b70('0x6e')]+_0xf10de6[0x0][_0x0b70('0x72')]+_0xf10de6[0x0][_0x0b70('0x71')])/_0xf10de6[0x0][_0x0b70('0x76')];_0x351ff0[_0x0b70('0x1d4')]=_0xf670bb>0x0?_0xf670bb:0x1;switch(_0x351ff0[_0x0b70('0x1da')]){case _0x0b70('0x1dc'):var _0x40db12=_0x351ff0[_0x0b70('0x1e6')]/0x64;return _0x1e9639['abandonmentRate'](_0x584c96,_0x3c40f7,_0x508545,_0xf670bb,_0x40db12)[_0x0b70('0x3f')](function(_0x28ee29){return _0x2104ba(_0x28ee29);});case _0x0b70('0x1e7'):var _0x569b44=_0x351ff0[_0x0b70('0x1e6')]/0x64;return _0x1e9639['busyFactor'](_0x584c96,_0x3c40f7,_0x508545,_0xf670bb,_0x569b44)[_0x0b70('0x3f')](function(_0x500c93){return _0x2104ba(_0x500c93);});default:return _0x45e3f7(msgResponse(_0x0b70('0x1e8'),_0x0b70('0x144'),'Unknown\x20Predictive'));}}else{return _0x45e3f7(msgResponse(_0x0b70('0x1e8'),_0x0b70('0x144'),_0x0b70('0x1e9')));}});};};Dialer[_0x0b70('0x1a')][_0x0b70('0x1ea')]=function(_0x4ed1c1){var _0x24f186=this;return function(_0x2efd8d){return new BPromise(function(_0x58cd18,_0x243af8){_['merge'](_0x4ed1c1,_0x2efd8d[0x0]);if(checkGetDataPredictive(_0x2efd8d[0x0])){loggerPredictive['info'](JSON[_0x0b70('0x4e')](_0x2efd8d[0x0]));if(_0x4ed1c1[_0x0b70('0x1da')]==='dropRate'){return _0x24f186[_0x0b70('0x1eb')](_0x4ed1c1['id'])[_0x0b70('0x3f')](function(_0x2f7778){var _0x2e2252=_0x4ed1c1['loggedIn']-_0x2f7778[0x0]['outboundQueuePauses'];var _0x5462af=_0x4ed1c1[_0x0b70('0x1df')]*0x3c;var _0x2ba0e5=_0x2efd8d[0x0][_0x0b70('0x70')]+_0x2efd8d[0x0][_0x0b70('0x6f')];var _0x527d5f=(_0x2efd8d[0x0][_0x0b70('0x6e')]+_0x2efd8d[0x0][_0x0b70('0x72')]+_0x2efd8d[0x0][_0x0b70('0x71')])/_0x2efd8d[0x0]['predictiveIntervalTotalCalls'];var _0x3fd963=_0x4ed1c1[_0x0b70('0x1e6')]/0x64;_0x4ed1c1[_0x0b70('0x75')]=_0x2f7778[0x0][_0x0b70('0x1ec')]||0x0;_0x4ed1c1['predictiveIntervalHitRate']=_0x527d5f>0x0?_0x527d5f:0x1;return _0x24f186[_0x0b70('0x1ed')](_0x2e2252,_0x5462af,_0x2ba0e5,_0x527d5f,_0x3fd963);})[_0x0b70('0x3f')](function(_0x21177d){return _0x58cd18(_0x21177d);})[_0x0b70('0xb2')](function(_0x8f0a02){return _0x243af8(msgResponse(_0x0b70('0x1ee'),_0x0b70('0x144'),JSON[_0x0b70('0x4e')](_0x8f0a02)));});}if(_0x4ed1c1['dialPredictiveOptimization']===_0x0b70('0x1e7')){return _0x24f186['getVoiceQueueRtPauses'](_0x4ed1c1['id'])['then'](function(_0x3c1992){var _0x21b2ac=_0x4ed1c1[_0x0b70('0x57')]-_0x3c1992[0x0][_0x0b70('0x1ec')];var _0x2830d9=_0x4ed1c1[_0x0b70('0x1df')]*0x3c;var _0x299a82=_0x2efd8d[0x0][_0x0b70('0x70')]+_0x2efd8d[0x0][_0x0b70('0x6f')];var _0x528de9=(_0x2efd8d[0x0][_0x0b70('0x6e')]+_0x2efd8d[0x0][_0x0b70('0x72')]+_0x2efd8d[0x0][_0x0b70('0x71')])/_0x2efd8d[0x0][_0x0b70('0x76')];var _0x2da082=_0x4ed1c1['dialPredictiveOptimizationPercentage']/0x64;_0x4ed1c1[_0x0b70('0x75')]=_0x3c1992[0x0][_0x0b70('0x1ec')]||0x0;_0x4ed1c1['predictiveIntervalHitRate']=_0x528de9>0x0?_0x528de9:0x1;return _0x24f186[_0x0b70('0x1ef')](_0x21b2ac,_0x2830d9,_0x299a82,_0x528de9,_0x2da082);})['then'](function(_0x47e1e2){return _0x58cd18(_0x47e1e2);})['catch'](function(_0x1f5940){return _0x243af8(msgResponse('[CatchErlangB]',_0x0b70('0x144'),JSON[_0x0b70('0x4e')](_0x1f5940)));});}}else{return _0x243af8(msgResponse(_0x0b70('0x1e8'),'Failure',_0x0b70('0x1e9')));}});};};Dialer['prototype'][_0x0b70('0x1e1')]=function(_0x4f8fd3){var _0xb8e859=this;return function(){var _0x539a95=0x0;var _0x1f0e97=Math[_0x0b70('0x1d2')](_0x4f8fd3['erlangCallToSecond']*0x3e8);if(_0x1f0e97>0x0){_0x1f0e97=_0x1f0e97<0x64?0x64:_0x1f0e97;loggerPredictive[_0x0b70('0x82')](_0x4f8fd3['name'],_0x0b70('0x1f0'),_0x1f0e97,_0x0b70('0x4f'));_0x4f8fd3[_0x0b70('0x90')]=setInterval(function(){_0xb8e859['handlePredictive'](_0x4f8fd3);loggerPredictiveCalls[_0x0b70('0x82')](_0x0b70('0x1f1'),_0x539a95+=0x1);},_0x1f0e97);}else{loggerPredictive[_0x0b70('0x82')](_0x4f8fd3[_0x0b70('0x43')],_0x0b70('0x1f2'));}};};Dialer[_0x0b70('0x1a')][_0x0b70('0x1f3')]=function(_0x27f52a,_0x573f40){var _0x55eab4=this;return function(_0x5909dc){if(_[_0x0b70('0x4b')](_0x5909dc)){if(_[_0x0b70('0xaf')](_0x573f40[_0x0b70('0xd1')])||!_0x573f40[_0x0b70('0x1f4')]){if(_0x27f52a[_0x0b70('0x61')]===_0x0b70('0x7')){_0x27f52a['queueStatusComplete']=_[_0x0b70('0x40')](_0x27f52a[_0x0b70('0x12d')])?!![]:_0x27f52a[_0x0b70('0x12d')];var _0x41d811=uuid['v4']();_0x55eab4['actions'][_0x41d811]=new Action(_0x27f52a,_0x573f40,_0x41d811);loggerBooked[_0x0b70('0x82')](_0x0b70('0x1f5'),_0x41d811,_0x0b70('0x1f6'),JSON[_0x0b70('0x4e')](_0x27f52a['queueStatusComplete']),'Queue:\x20',_0x27f52a[_0x0b70('0x43')]);if(_0x27f52a[_0x0b70('0x12d')]){_0x27f52a[_0x0b70('0x12d')]=![];_0x55eab4[_0x0b70('0x12a')][_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xb6')]]=[];ami['Action']({'actionid':_0x41d811,'action':_0x0b70('0x1f7'),'queue':_0x27f52a[_0x0b70('0x43')]})[_0x0b70('0xb2')](function(){_0x55eab4[_0x0b70('0xb4')](_0x27f52a);_0x55eab4[_0x0b70('0xbe')]({'active':![],'ContactId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xfa')],'ListId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xd0')],'VoiceQueueId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xfb')]||undefined,'CampaignId':_0x55eab4['actions'][_0x41d811]['CampaignId']||undefined})[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1f8')));delete _0x55eab4[_0x0b70('0x25')][_0x41d811];});}else{loggerBooked[_0x0b70('0x82')](_0x0b70('0x1f9'),JSON['stringify'](_0x27f52a[_0x0b70('0x12d')]),'Queue:\x20',_0x27f52a[_0x0b70('0x43')]);_0x55eab4[_0x0b70('0xb4')](_0x27f52a);_0x55eab4['rescheduleContact']({'active':![],'ContactId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xfa')],'ListId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xd0')],'VoiceQueueId':_0x55eab4[_0x0b70('0x25')][_0x41d811][_0x0b70('0xfb')]||undefined,'CampaignId':_0x55eab4[_0x0b70('0x25')][_0x41d811]['CampaignId']||undefined})[_0x0b70('0xb2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x55eab4[_0x0b70('0x25')][_0x41d811];}}else{return _0x55eab4[_0x0b70('0x171')](_0x27f52a,_0x573f40);}}else{if(getDiff(_0x573f40[_0x0b70('0x1fa')])<_0x27f52a['dialRecallMeTimeout']*0x3c){if(_0x573f40[_0x0b70('0x15e')]&&!_0x573f40[_0x0b70('0x15e')][_0x0b70('0x1fb')]){_0x55eab4[_0x0b70('0x1e')]['run'](_0x573f40['id'])[_0x0b70('0x1a0')](function(){_0x55eab4[_0x0b70('0xb4')](_0x27f52a);});}else{_0x55eab4[_0x0b70('0xc0')]({'active':![]},_0x573f40['id'],0x1)[_0x0b70('0x1a0')](function(){_0x55eab4['updateOriginated'](_0x27f52a);});}}else{_0x27f52a['outboundReCallsDay']+=0x1;_0x55eab4[_0x0b70('0xb4')](_0x27f52a);if(_0x27f52a[_0x0b70('0x1fc')]){_0x55eab4[_0x0b70('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x573f40[_0x0b70('0xfa')],'ListId':_0x573f40[_0x0b70('0xd0')],'VoiceQueueId':_0x573f40['VoiceQueueId']||undefined,'CampaignId':_0x573f40[_0x0b70('0xd2')]||undefined})[_0x0b70('0xb2')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x55eab4[_0x0b70('0xca')](createObjHistory(_0x27f52a,_0x573f40,_0x0b70('0x1fd'),0x17,_0x0b70('0x1fe')))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0x1ff')));}else{_0x55eab4[_0x0b70('0xcf')](createObjHistory(_0x27f52a,_0x573f40,_0x0b70('0x200'),0x16,_0x0b70('0x201')),_0x0b70('0x202'),_0x0b70('0x203'));}}}}else{_0x27f52a[_0x0b70('0x204')]+=0x1;_0x55eab4['saveInDb'](createObjHistory(_0x27f52a,_0x573f40,_0x0b70('0x205'),0xd,_0x0b70('0x206')),_0x0b70('0x207'),_0x0b70('0x208'));throw _0x0b70('0x209');}};};Dialer['prototype'][_0x0b70('0x162')]=function(_0x3c4a5e){var _0xcff927=this;var _0x93083f=_0x3c4a5e[_0x0b70('0x20a')]-_0x3c4a5e[_0x0b70('0x98')]-_0x3c4a5e[_0x0b70('0xc3')];emitCampaignSummary(_0x3c4a5e);if(_0x93083f>0x0){if(_0x93083f>this['maxNumberOriginate']){_0x93083f=this['maxNumberOriginate'];}_0x3c4a5e['temp']+=_0x93083f;this['getContactDialerIvr'](_0x3c4a5e['id'],_0x93083f,_0x3c4a5e['dialOrderByScheduledAt'],_0x3c4a5e)[_0x0b70('0x3f')](function(_0x2b4cd1){_0x3c4a5e['temp']-=_0x93083f;_0x3c4a5e['temp']=_0x3c4a5e[_0x0b70('0xc3')]>0x0?_0x3c4a5e[_0x0b70('0xc3')]:0x0;if(!checkContactEmpty(_0x2b4cd1)){_0x3c4a5e[_0x0b70('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x0b70('0x82')]('[getContactCampaign2][Empty]'+_0x3c4a5e[_0x0b70('0x43')]);}else{_0x3c4a5e['originated']+=_0x2b4cd1[_0x0b70('0x97')];_0x3c4a5e[_0x0b70('0x41')]=_0x0b70('0x20b');for(var _0x493f72=0x0;_0x493f72<_0x2b4cd1[_0x0b70('0x97')];_0x493f72+=0x1){_0x3c4a5e[_0x0b70('0x20c')]+=0x1;if(_['isNil'](_0x2b4cd1[_0x493f72])||_['isNil'](_0x2b4cd1[_0x493f72][_0x0b70('0x174')])||_[_0x0b70('0xaf')](_0x2b4cd1[_0x493f72][_0x0b70('0x174')][_0x0b70('0x175')])){_0xcff927[_0x0b70('0x20d')](_0x0b70('0x20e'),_0x3c4a5e,_0x2b4cd1[_0x493f72]);}else{_0xcff927[_0x0b70('0xbb')](_[_0x0b70('0x12c')](_0x2b4cd1[_0x493f72],['CampaignId','Contact.phone']))['then'](_0xcff927[_0x0b70('0x1f3')](_0x3c4a5e,_0x2b4cd1[_0x493f72]))[_0x0b70('0xb2')](_0xcff927['loggerHandler']('[actionOriginateIvr]\x20',_0x3c4a5e));}}}})[_0x0b70('0xb2')](loggerGetContactDialer(_0x0b70('0x20f'),_0x3c4a5e,_0x93083f));}};Dialer['prototype']['handlePower']=function(_0x2ebcdc,_0x4fbdc4){var _0x54b350=this;var _0x4fc756=[];var _0x585051=_0x4fbdc4>=0x1?_0x4fbdc4:0x1;if(_0x2ebcdc[_0x0b70('0x61')]===_0x0b70('0x7')){_0x585051=0x1;}var _0x41bc0f=Math[_0x0b70('0x1d2')](_0x2ebcdc['available']*_0x585051)-_0x2ebcdc[_0x0b70('0x98')]-_0x2ebcdc[_0x0b70('0xc3')];emitVoiceQueueSummary(_0x2ebcdc);if(_0x2ebcdc['dialLimitQueue']>0x0){var _0x2ca284=_0x2ebcdc[_0x0b70('0x210')]-_0x2ebcdc[_0x0b70('0x98')]-_0x2ebcdc[_0x0b70('0x5c')]-_0x2ebcdc[_0x0b70('0xc3')]-_0x2ebcdc[_0x0b70('0x58')];if(_0x41bc0f>_0x2ca284){_0x41bc0f=_0x2ca284;}}if(_0x41bc0f>0x0){if(_0x2ebcdc['dialMethod']===_0x0b70('0x7')){_0x41bc0f=0x1;}if(_0x41bc0f>this[_0x0b70('0x23')]){_0x41bc0f=this[_0x0b70('0x23')];}_0x2ebcdc[_0x0b70('0xc3')]+=_0x41bc0f;for(var _0x52533d in this[_0x0b70('0x21')]){if(typeof this[_0x0b70('0x21')][_0x52533d]!==_0x0b70('0xae')){if(this[_0x0b70('0x21')][_0x52533d][_0x0b70('0xa8')]===_0x0b70('0x211')&&this[_0x0b70('0x21')][_0x52533d][_0x0b70('0xd6')]===_0x0b70('0xd7')){_0x4fc756[_0x0b70('0x12b')](this[_0x0b70('0x21')][_0x52533d]['id']);}}}this[_0x0b70('0xc2')](_0x2ebcdc['id'],_0x4fc756,_0x41bc0f,_0x2ebcdc[_0x0b70('0x212')],_0x2ebcdc)['then'](function(_0x271f7f){_0x2ebcdc['temp']-=_0x41bc0f;_0x2ebcdc[_0x0b70('0xc3')]=_0x2ebcdc[_0x0b70('0xc3')]>0x0?_0x2ebcdc[_0x0b70('0xc3')]:0x0;if(!checkContactEmpty(_0x271f7f)){_0x54b350['countReScheduled'](_0x2ebcdc)['then'](sendMessageReschedule(_0x2ebcdc))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xb9')));}else{_0x2ebcdc[_0x0b70('0x98')]+=_0x271f7f[_0x0b70('0x97')];_0x2ebcdc['message']=_0x2ebcdc[_0x0b70('0x61')]==='booked'?_0x0b70('0x17c'):_0x0b70('0x20b');for(var _0x1a9775=0x0;_0x1a9775<_0x271f7f[_0x0b70('0x97')];_0x1a9775+=0x1){if(_[_0x0b70('0xaf')](_0x271f7f[_0x1a9775])||_['isNil'](_0x271f7f[_0x1a9775][_0x0b70('0x174')])||_[_0x0b70('0xaf')](_0x271f7f[_0x1a9775][_0x0b70('0x174')]['phone'])){_0x54b350[_0x0b70('0x20d')](_0x0b70('0x20e'),_0x2ebcdc,_0x271f7f[_0x1a9775]);}else{_0x54b350['checkIsBlackList'](_[_0x0b70('0x12c')](_0x271f7f[_0x1a9775],[_0x0b70('0xfb'),_0x0b70('0x213')]))[_0x0b70('0x3f')](_0x54b350[_0x0b70('0x1f3')](_0x2ebcdc,_0x271f7f[_0x1a9775]))['catch'](_0x54b350[_0x0b70('0x214')](_0x0b70('0x20e'),_0x2ebcdc));}}}})['catch'](loggerGetContactDialer(_0x0b70('0x215'),_0x2ebcdc,_0x41bc0f));}};Dialer[_0x0b70('0x1a')][_0x0b70('0x90')]=function(_0x4ffd5e){if(_0x4ffd5e['dialLimitQueue']>0x0){var _0x6db219=_0x4ffd5e[_0x0b70('0x210')]-_0x4ffd5e[_0x0b70('0x98')]-_0x4ffd5e[_0x0b70('0x5c')];if(_0x6db219>0x0){this['tryOriginatePredictive'](_0x4ffd5e);}else{loggerPredictiveCalls[_0x0b70('0x82')](_0x0b70('0x216'));}}else{this[_0x0b70('0x217')](_0x4ffd5e);}};Dialer[_0x0b70('0x1a')][_0x0b70('0x217')]=function(_0x499028){var _0x16bf3f=this;var _0x1dea19=[];_0x499028[_0x0b70('0x98')]+=0x1;for(var _0x3ac1df in this[_0x0b70('0x21')]){if(typeof this[_0x0b70('0x21')][_0x3ac1df]!=='undefined'){if(this[_0x0b70('0x21')][_0x3ac1df][_0x0b70('0xa8')]===_0x0b70('0x211')&&this[_0x0b70('0x21')][_0x3ac1df][_0x0b70('0xd6')]===_0x0b70('0xd7')){_0x1dea19['push'](this[_0x0b70('0x21')][_0x3ac1df]['id']);}}}this[_0x0b70('0xc2')](_0x499028['id'],_0x1dea19,0x1,_0x499028[_0x0b70('0x212')],_0x499028)[_0x0b70('0x3f')](function(_0x4abad5){if(!checkContactEmpty(_0x4abad5)){checkContactLowerLimitOriginate(_0x499028,0x1,0x0);_0x16bf3f[_0x0b70('0xb7')](_0x499028)[_0x0b70('0x3f')](sendMessageReschedule(_0x499028))[_0x0b70('0xb2')](loggerCatch(_0x0b70('0xb9')));}else{_0x499028[_0x0b70('0x41')]=_0x0b70('0x20b');if(_[_0x0b70('0xaf')](_0x4abad5[0x0])||_[_0x0b70('0xaf')](_0x4abad5[0x0]['Contact'])||_[_0x0b70('0xaf')](_0x4abad5[0x0][_0x0b70('0x174')]['phone'])){_0x16bf3f['emptyContact'](_0x0b70('0x20e'),_0x499028,_0x4abad5[0x0]);}else{_0x16bf3f[_0x0b70('0xba')](_[_0x0b70('0x12c')](_0x4abad5[0x0],[_0x0b70('0xfb'),'Contact.phone']))[_0x0b70('0x3f')](_0x16bf3f[_0x0b70('0x1f3')](_0x499028,_0x4abad5[0x0]))[_0x0b70('0xb2')](_0x16bf3f[_0x0b70('0x214')](_0x0b70('0x218'),_0x499028));}}})[_0x0b70('0xb2')](loggerGetContactDialer(_0x0b70('0x219'),_0x499028,0x1));emitVoiceQueueSummary(_0x499028);};Dialer[_0x0b70('0x1a')]['abandonmentRate']=function(_0x28afcc,_0x3b573f,_0x31e059,_0x1ed532,_0x543cce,_0xd81c9c){loggerPredictive[_0x0b70('0x82')](_0x0b70('0x21a'));loggerPredictive[_0x0b70('0x82')]('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',_0x28afcc);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x21b'),_0x3b573f);loggerPredictive[_0x0b70('0x82')]('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',_0x31e059);loggerPredictive['info'](_0x0b70('0x21c'),_0x1ed532);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x21d'),_0x543cce);loggerPredictive['info'](_0x0b70('0x87'));return new BPromise(function(_0x46fbc6,_0x133268){if(_0x28afcc<=0x0||isNaN(_0x28afcc)){return _0x133268(msgResponse(_0x0b70('0x21e'),_0x0b70('0x4d'),_0x0b70('0x21f')+_0x28afcc));}if(_0x31e059<=0x0||isNaN(_0x31e059)){return _0x133268(msgResponse(_0x0b70('0x21e'),_0x0b70('0x4d'),_0x0b70('0x220')+_0x31e059));}if(_0x1ed532<=0x0||isNaN(_0x1ed532)){return _0x133268(msgResponse(_0x0b70('0x21e'),_0x0b70('0x4d'),_0x0b70('0x221')+_0x1ed532));}if(_0x3b573f<=0x0||isNaN(_0x3b573f)){return _0x133268(msgResponse('[abandonmentRate]',_0x0b70('0x4d'),_0x0b70('0x222')+_0x3b573f));}if(_0x543cce<=0x0||isNaN(_0x543cce)){return _0x133268(msgResponse('[abandonmentRate]','Error',_0x0b70('0x223')+_0x543cce));}_0xd81c9c=_0xd81c9c||0x0;var _0x14f0c4=0x1/_0x31e059;var _0x4c5063=0x0;var _0x538bd1=0x0;var _0x280dda=0x0;var _0x125f2c=0x0;for(var _0x36bccb=0x0;_0x280dda<_0x543cce;_0x36bccb+=0x1){_0x538bd1=_0x36bccb/_0x3b573f;_0x4c5063=(_0x1ed532*_0x538bd1+_0xd81c9c)/_0x14f0c4;_0x280dda=erlangb(_0x4c5063,_0x28afcc);_0x125f2c=_0x4c5063/_0x28afcc*(0x1-erlangb(_0x4c5063,_0x28afcc));}return _0x46fbc6({'erlangCalls':_0x36bccb,'erlangCallToSecond':_0x3b573f/_0x36bccb,'erlangAbandonmentRate':_0x280dda,'erlangBusyFactor':_0x125f2c});});};Dialer['prototype'][_0x0b70('0x1ef')]=function(_0x14e5fd,_0x4661ff,_0x59a7c3,_0x15e8b1,_0x22fdd1,_0x320f4a){loggerPredictive[_0x0b70('0x82')](_0x0b70('0x224'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14e5fd);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x21b'),_0x4661ff);loggerPredictive['info'](_0x0b70('0x225'),_0x59a7c3);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x21c'),_0x15e8b1);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x226'),_0x22fdd1);loggerPredictive[_0x0b70('0x82')](_0x0b70('0x87'));return new BPromise(function(_0x51fcfa,_0x56472f){if(_0x14e5fd<=0x0||isNaN(_0x14e5fd)){return _0x56472f(msgResponse('[busyFactor]',_0x0b70('0x4d'),'m\x20=\x20'+_0x14e5fd));}if(_0x59a7c3<=0x0||isNaN(_0x59a7c3)){return _0x56472f(msgResponse(_0x0b70('0x227'),_0x0b70('0x4d'),'Ts\x20=\x20'+_0x59a7c3));}if(_0x15e8b1<=0x0||isNaN(_0x15e8b1)){return _0x56472f(msgResponse(_0x0b70('0x227'),'Error',_0x0b70('0x221')+_0x15e8b1));}if(_0x4661ff<=0x0||isNaN(_0x4661ff)){return _0x56472f(msgResponse(_0x0b70('0x227'),_0x0b70('0x4d'),'interval\x20=\x20'+_0x4661ff));}if(_0x22fdd1<=0x0||isNaN(_0x22fdd1)){return _0x56472f(msgResponse(_0x0b70('0x227'),_0x0b70('0x4d'),_0x0b70('0x228')+_0x22fdd1));}_0x320f4a=_0x320f4a||0x0;var _0x1cce17=0x1/_0x59a7c3;var _0x47ed41=0x0;var _0x461715=0x0;var _0x47d56=0x0;var _0x21c32c=0x0;for(var _0x39527b=0x0;_0x21c32c<_0x22fdd1;_0x39527b+=0x1){_0x461715=_0x39527b/_0x4661ff;_0x47ed41=(_0x15e8b1*_0x461715+_0x320f4a)/_0x1cce17;_0x47d56=erlangb(_0x47ed41,_0x14e5fd);_0x21c32c=_0x47ed41/_0x14e5fd*(0x1-erlangb(_0x47ed41,_0x14e5fd));}return _0x51fcfa({'erlangCalls':_0x39527b,'erlangCallToSecond':_0x4661ff/_0x39527b,'erlangAbandonmentRate':_0x47d56,'erlangBusyFactor':_0x21c32c});});};module[_0x0b70('0x229')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ef5cc84..53ad973 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 _0x5809=['calleridname','number','responsetime','droptime','endtime','ringtime','starttime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','milliseconds','diff','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid'];(function(_0x2144a2,_0x5e91ef){var _0xf2a6ca=function(_0x3203e1){while(--_0x3203e1){_0x2144a2['push'](_0x2144a2['shift']());}};_0xf2a6ca(++_0x5e91ef);}(_0x5809,0x145));var _0x9580=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5809[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x9580('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x438e8e,_0x4a8627){var _0x9253cd=moment(_0x438e8e)[_0x9580('0x1')](0x0);var _0x4f1724=moment(_0x4a8627)[_0x9580('0x1')](0x0);return _0x9253cd[_0x9580('0x2')](_0x4f1724,'seconds');}function QueueCallerAbandon(_0x5c187d,_0x5fea95){this[_0x9580('0x3')]=_0x5c187d[_0x9580('0x3')];this[_0x9580('0x4')]=_0x5c187d[_0x9580('0x4')];this[_0x9580('0x5')]=_0x5c187d[_0x9580('0x4')]==='outbound'?_0x9580('0x6'):_0x5c187d[_0x9580('0x4')];this[_0x9580('0x7')]=_0x5c187d[_0x9580('0x7')];this[_0x9580('0x8')]=_0x5c187d[_0x9580('0x8')];this[_0x9580('0x9')]=_0x5c187d[_0x9580('0x9')];this[_0x9580('0xa')]=_0x5c187d[_0x9580('0x7')]+_0x5c187d['countcongestionretry']+_0x5c187d['countnoanswerretry']+_0x5c187d[_0x9580('0xb')]+_0x5c187d[_0x9580('0xc')]+_0x5c187d[_0x9580('0xd')]+_0x5c187d['countmachineretry']+_0x5c187d[_0x9580('0xe')];this[_0x9580('0xb')]=_0x5c187d[_0x9580('0xb')];this[_0x9580('0xc')]=_0x5c187d['countdropretry'];this[_0x9580('0xd')]=_0x5c187d[_0x9580('0xd')];this[_0x9580('0xf')]=_0x5c187d[_0x9580('0xf')];this[_0x9580('0xe')]=_0x5c187d[_0x9580('0xe')];this[_0x9580('0x10')]=_0x5fea95[_0x9580('0x10')];this[_0x9580('0x11')]=_0x5c187d['name'];this['calleridnum']=_0x5c187d[_0x9580('0x12')];this['starttime']=_0x5c187d['starttime'];this[_0x9580('0x13')]=_0x5c187d['responsetime'];this[_0x9580('0x14')]=_0x5c187d[_0x9580('0x14')];this[_0x9580('0x15')]=this[_0x9580('0x14')];this[_0x9580('0x16')]=getSeconds(_0x5c187d['responsetime'],_0x5c187d[_0x9580('0x17')]);this['holdtime']=getSeconds(this['droptime'],_0x5c187d['responsetime']);this[_0x9580('0x18')]=0x0;this[_0x9580('0x6')]=_0x5fea95[_0x9580('0x6')];this['membername']=_0x5fea95[_0x9580('0x19')];this[_0x9580('0x1a')]=_0x5fea95[_0x9580('0x1a')];this[_0x9580('0x1b')]=_0x5c187d[_0x9580('0x1b')];this[_0x9580('0x1c')]=_0x5c187d[_0x9580('0x1c')];this['callbackat']=_0x5c187d[_0x9580('0x1d')];this[_0x9580('0x1e')]=_0x5c187d[_0x9580('0x1e')];this[_0x9580('0x1f')]=_0x5c187d[_0x9580('0x1f')];this[_0x9580('0x20')]=_0x5c187d[_0x9580('0x20')];this[_0x9580('0x21')]=_0x5c187d[_0x9580('0x21')];this[_0x9580('0x22')]=_0x5c187d[_0x9580('0x22')];this[_0x9580('0x23')]=_0x5c187d[_0x9580('0x23')];this[_0x9580('0x24')]=_0x5c187d['originatecalleridnum']||'';this['originatecalleridname']=_0x5c187d['originatecalleridname']||'';}module[_0x9580('0x25')]=QueueCallerAbandon; \ No newline at end of file +var _0x2279=['queue','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2279,0x90));var _0x9227=function(_0x4c13b8,_0x4bb6cb){_0x4c13b8=_0x4c13b8-0x0;var _0x544dc5=_0x2279[_0x4c13b8];return _0x544dc5;};'use strict';var util=require('util');var _=require(_0x9227('0x0'));var moment=require('moment');function getSeconds(_0x2c6b64,_0x5f2c77){var _0x3a6e40=moment(_0x2c6b64)[_0x9227('0x1')](0x0);var _0x234578=moment(_0x5f2c77)[_0x9227('0x1')](0x0);return _0x3a6e40[_0x9227('0x2')](_0x234578,_0x9227('0x3'));}function QueueCallerAbandon(_0x41fd1c,_0x103bf2){this[_0x9227('0x4')]=_0x41fd1c['scheduledat'];this[_0x9227('0x5')]=_0x41fd1c[_0x9227('0x5')];this[_0x9227('0x6')]=_0x41fd1c['type']===_0x9227('0x7')?_0x9227('0x8'):_0x41fd1c['type'];this['countbusyretry']=_0x41fd1c['countbusyretry'];this[_0x9227('0x9')]=_0x41fd1c[_0x9227('0x9')];this['countnoanswerretry']=_0x41fd1c[_0x9227('0xa')];this['countglobal']=_0x41fd1c['countbusyretry']+_0x41fd1c[_0x9227('0x9')]+_0x41fd1c[_0x9227('0xa')]+_0x41fd1c[_0x9227('0xb')]+_0x41fd1c[_0x9227('0xc')]+_0x41fd1c[_0x9227('0xd')]+_0x41fd1c[_0x9227('0xe')]+_0x41fd1c[_0x9227('0xf')];this[_0x9227('0xb')]=_0x41fd1c['countnosuchnumberretry'];this['countdropretry']=_0x41fd1c[_0x9227('0xc')];this[_0x9227('0xd')]=_0x41fd1c[_0x9227('0xd')];this[_0x9227('0xe')]=_0x41fd1c[_0x9227('0xe')];this[_0x9227('0xf')]=_0x41fd1c[_0x9227('0xf')];this['uniqueid']=_0x103bf2['uniqueid'];this[_0x9227('0x10')]=_0x41fd1c[_0x9227('0x11')];this['calleridnum']=_0x41fd1c[_0x9227('0x12')];this[_0x9227('0x13')]=_0x41fd1c[_0x9227('0x13')];this[_0x9227('0x14')]=_0x41fd1c[_0x9227('0x14')];this['droptime']=_0x41fd1c[_0x9227('0x15')];this[_0x9227('0x16')]=this[_0x9227('0x15')];this[_0x9227('0x17')]=getSeconds(_0x41fd1c[_0x9227('0x14')],_0x41fd1c[_0x9227('0x13')]);this['holdtime']=getSeconds(this[_0x9227('0x15')],_0x41fd1c[_0x9227('0x14')]);this[_0x9227('0x18')]=0x0;this['queue']=_0x103bf2['queue'];this[_0x9227('0x19')]=_0x103bf2['connectedlinename'];this[_0x9227('0x1a')]=_0x103bf2[_0x9227('0x1a')];this[_0x9227('0x1b')]=_0x41fd1c[_0x9227('0x1b')];this[_0x9227('0x1c')]=_0x41fd1c[_0x9227('0x1c')];this[_0x9227('0x1d')]=_0x41fd1c[_0x9227('0x1d')];this[_0x9227('0x1e')]=_0x41fd1c[_0x9227('0x1e')];this[_0x9227('0x1f')]=_0x41fd1c['ContactId'];this['ListId']=_0x41fd1c[_0x9227('0x20')];this[_0x9227('0x21')]=_0x41fd1c['UserId'];this[_0x9227('0x22')]=_0x41fd1c[_0x9227('0x22')];this[_0x9227('0x23')]=_0x41fd1c['CampaignId'];this[_0x9227('0x24')]=_0x41fd1c[_0x9227('0x24')]||'';this[_0x9227('0x25')]=_0x41fd1c[_0x9227('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 56e5fad..0571006 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(_0x3434a3,_0x532215){var _0x772695=function(_0xc364db){while(--_0xc364db){_0x3434a3['push'](_0x3434a3['shift']());}};_0x772695(++_0x532215);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x440345,_0x314a1e){var _0x4a5aef=function(_0x5f3666){while(--_0x5f3666){_0x440345['push'](_0x440345['shift']());}};_0x4a5aef(++_0x314a1e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 0af2b2d..b7f68df 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 _0xe605=['XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','syncNewchannel','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','hasOwnProperty','syncNewState','channelstate','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','AttachmentId','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','execute','%s/%s.tif'];(function(_0x5cfb59,_0x298da0){var _0x332909=function(_0x5940b4){while(--_0x5940b4){_0x5cfb59['push'](_0x5cfb59['shift']());}};_0x332909(++_0x298da0);}(_0xe605,0x92));var _0x5e60=function(_0x2e45d1,_0x83d5c){_0x2e45d1=_0x2e45d1-0x0;var _0x4e9442=_0xe605[_0x2e45d1];return _0x4e9442;};'use strict';var util=require(_0x5e60('0x0'));var _=require(_0x5e60('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var path=require(_0x5e60('0x4'));var tiff2pdf=require(_0x5e60('0x5'));var gs=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var ami=require(_0x5e60('0x9'));var rpcDb=require(_0x5e60('0xa'));var Channel=require(_0x5e60('0xb'));var ut=require(_0x5e60('0xc'));var Action=require(_0x5e60('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5e60('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x593118){this['channels']={};this[_0x5e60('0xf')]=_0x593118[_0x5e60('0xf')];this[_0x5e60('0x10')]=_0x593118[_0x5e60('0x10')];this[_0x5e60('0x11')]={};ami['on'](_0x5e60('0x12'),this['syncNewchannel'][_0x5e60('0x13')](this));ami['on']('varset',this[_0x5e60('0x14')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x15'),this['syncNewState'][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x16'),this[_0x5e60('0x17')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x18'),this[_0x5e60('0x19')]['bind'](this));ami['on'](_0x5e60('0x1a'),this[_0x5e60('0x1b')][_0x5e60('0x13')](this));ami['on'](_0x5e60('0x1c'),this['syncHangup'][_0x5e60('0x13')](this));ami['on']('originateresponse',this[_0x5e60('0x1d')][_0x5e60('0x13')](this));}Fax['prototype'][_0x5e60('0x1e')]=function(_0x3e1a44){if(_0x3e1a44[_0x5e60('0x1f')]===_0x5e60('0x20')){for(var _0x5c485d in this[_0x5e60('0xf')]){if(this[_0x5e60('0xf')]['hasOwnProperty'](_0x5c485d)){if(_0x3e1a44[_0x5e60('0x21')]===this[_0x5e60('0xf')][_0x5c485d][_0x5e60('0x22')]){this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]={};this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]][_0x5e60('0x25')]=_0x3e1a44[_0x5e60('0x25')];this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]['id']=this['faxAccounts'][_0x5c485d]['id'];this[_0x5e60('0x23')][_0x3e1a44['uniqueid']][_0x5e60('0x26')]=this[_0x5e60('0xf')][_0x5c485d][_0x5e60('0x26')];logger[_0x5e60('0x27')](_0x3e1a44[_0x5e60('0x24')],_0x5e60('0x28'));}}}}if(this[_0x5e60('0x11')][_0x3e1a44['uniqueid']]){this[_0x5e60('0x23')][_0x3e1a44[_0x5e60('0x24')]]={};this[_0x5e60('0x23')][_0x3e1a44['uniqueid']][_0x5e60('0x25')]=_0x3e1a44[_0x5e60('0x25')];logger[_0x5e60('0x27')](_0x3e1a44[_0x5e60('0x24')],'\x20syncNewchannel\x20');}};Fax[_0x5e60('0x29')]['syncVarSet']=function(_0x23d187){if(this[_0x5e60('0x23')][_0x23d187['uniqueid']]){for(var _0x46691f in _0x23d187[_0x5e60('0x2a')]){if(_0x23d187['variable'][_0x5e60('0x2b')](_0x46691f)){this[_0x5e60('0x23')][_0x23d187['uniqueid']][_0x46691f]=_0x23d187['value'];}}}};Fax['prototype'][_0x5e60('0x2c')]=function(_0x235cc7){if(this[_0x5e60('0x23')][_0x235cc7[_0x5e60('0x24')]]){this[_0x5e60('0x23')][_0x235cc7['uniqueid']][_0x5e60('0x2d')]=_0x235cc7[_0x5e60('0x2d')];this['channels'][_0x235cc7[_0x5e60('0x24')]]['channelstatedesc']=_0x235cc7['channelstatedesc'];}};Fax[_0x5e60('0x29')][_0x5e60('0x17')]=function(_0x1f474b){if(this[_0x5e60('0x23')][_0x1f474b[_0x5e60('0x24')]]){for(var _0xbf5b7a in _0x1f474b[_0x5e60('0x2a')]){if(_0x1f474b[_0x5e60('0x2a')][_0x5e60('0x2b')](_0xbf5b7a)){this[_0x5e60('0x23')][_0x1f474b['uniqueid']][_0xbf5b7a]=_0x1f474b[_0x5e60('0x2e')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x478415){if(this[_0x5e60('0x23')][_0x478415['uniqueid']]){this[_0x5e60('0x23')][_0x478415['uniqueid']][_0x5e60('0x2f')]=_0x478415[_0x5e60('0x2f')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]][_0x5e60('0x30')]=_0x478415[_0x5e60('0x30')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]]['localstationid']=_0x478415[_0x5e60('0x22')];this[_0x5e60('0x23')][_0x478415[_0x5e60('0x24')]][_0x5e60('0x31')]=_0x478415[_0x5e60('0x31')];logger[_0x5e60('0x27')](_0x478415[_0x5e60('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0x5e60('0x29')][_0x5e60('0x1b')]=function(_0x4cba18){var _0x532ab2=this;if(this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]){var _0x1ae294=this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]['id'];this['channels'][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x32')]=_0x4cba18[_0x5e60('0x32')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x33')]=_0x4cba18[_0x5e60('0x33')];this['channels'][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x22')]=_0x4cba18['localstationid'];this['channels'][_0x4cba18['uniqueid']][_0x5e60('0x34')]=_0x4cba18[_0x5e60('0x34')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]]['transferrate']=_0x4cba18[_0x5e60('0x35')];this[_0x5e60('0x23')][_0x4cba18['uniqueid']]['filename']=_0x4cba18[_0x5e60('0x31')];this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x36')]=_0x4cba18[_0x5e60('0x36')];if(this[_0x5e60('0x23')][_0x4cba18[_0x5e60('0x24')]][_0x5e60('0x33')]>0x0){tiff2pdf(_0x4cba18[_0x5e60('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x284e66){logger[_0x5e60('0x27')](_0x4cba18['uniqueid'],_0x5e60('0x37'),_0x284e66[_0x5e60('0x38')]);attachment[_0x5e60('0x39')]({'name':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])['name'],'basename':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])[_0x5e60('0x26')]+_0x5e60('0x3b'),'type':'application/pdf'})['then'](function(_0x5b9f5a){faxAccount[_0x5e60('0x3c')](_0x1ae294,{'from':_0x4cba18[_0x5e60('0x36')],'mapKey':_0x5e60('0x8'),'body':path[_0x5e60('0x3a')](_0x4cba18[_0x5e60('0x31')])[_0x5e60('0x26')]+'.pdf','AttachmentId':_0x5b9f5a['id']})[_0x5e60('0x3d')](function(_0x1c48d0){logger[_0x5e60('0x3e')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x3f'),JSON[_0x5e60('0x40')](_0x1c48d0));});})[_0x5e60('0x3d')](function(_0x4acd96){logger[_0x5e60('0x3e')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x41'),JSON[_0x5e60('0x40')](_0x4acd96));});});}logger[_0x5e60('0x27')](_0x4cba18[_0x5e60('0x24')],_0x5e60('0x41'));}};Fax[_0x5e60('0x29')][_0x5e60('0x1d')]=function(_0x350d6d){if(this[_0x5e60('0x11')][_0x350d6d[_0x5e60('0x24')]]){_[_0x5e60('0x42')](this[_0x5e60('0x23')][_0x350d6d[_0x5e60('0x24')]],_[_0x5e60('0x43')](_0x350d6d,[_0x5e60('0x44'),_0x5e60('0x45')]));}};function updateStatus(_0x54479d){if(_0x54479d['AttachmentId']){faxMessage[_0x5e60('0x46')](_0x54479d['AttachmentId'],{'failMessage':_0x5e60('0x47')})[_0x5e60('0x48')](function(_0x20d6e6){ut[_0x5e60('0x49')](_0x5e60('0x4a'),_0x20d6e6);})[_0x5e60('0x3d')](function(_0x4b72a4){ut['logger'](_0x5e60('0x4b'),_0x4b72a4);});}else{ut[_0x5e60('0x49')](_0x5e60('0x4c'));}}Fax['prototype']['updateStatus']=function(_0x31ced8,_0x46f3ba,_0x179cc6){var _0x501b87=this;var _0x1a3ed9={};if(_0x46f3ba){_0x1a3ed9={'read':_0x46f3ba};}else{_0x1a3ed9={'failMessage':_0x179cc6};}if(this[_0x5e60('0x11')][_0x31ced8][_0x5e60('0x4d')]){faxMessage[_0x5e60('0x46')](this[_0x5e60('0x11')][_0x31ced8][_0x5e60('0x4d')],_0x1a3ed9)['then'](function(_0x412be1){ut[_0x5e60('0x49')]('[Fax][Message][Updated]',_0x412be1);})[_0x5e60('0x3d')](function(_0x3f6a1e){ut[_0x5e60('0x49')]('[Fax][Message][NoUpdate1]',_0x3f6a1e);})[_0x5e60('0x4e')](function(){delete _0x501b87[_0x5e60('0x23')][_0x31ced8];delete _0x501b87['actions'][_0x31ced8];});}else{ut[_0x5e60('0x49')](_0x5e60('0x4f'));delete this[_0x5e60('0x23')][_0x31ced8];delete this[_0x5e60('0x11')][_0x31ced8];}};Fax['prototype'][_0x5e60('0x50')]=function(_0x1abc43){var _0x4ded96=this;if(this[_0x5e60('0x23')][_0x1abc43['uniqueid']]){if(this[_0x5e60('0x11')][_0x1abc43['uniqueid']]){this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]['id']=this['actions'][_0x1abc43[_0x5e60('0x24')]]['id'];this['channels'][_0x1abc43[_0x5e60('0x24')]]['name']=this[_0x5e60('0x11')][_0x1abc43['uniqueid']][_0x5e60('0x26')];}logger[_0x5e60('0x27')](_0x1abc43[_0x5e60('0x24')],this[_0x5e60('0x11')][_0x1abc43[_0x5e60('0x24')]]?_0x5e60('0x51'):_0x5e60('0x52'),JSON['stringify'](this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]));if(this[_0x5e60('0x11')][_0x1abc43[_0x5e60('0x24')]]){if(this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]]['faxpages']>0x0&&this['channels'][_0x1abc43['uniqueid']][_0x5e60('0x18')]===_0x5e60('0x53')){this['updateStatus'](_0x1abc43[_0x5e60('0x24')],!![]);}else{this[_0x5e60('0x54')](_0x1abc43['uniqueid'],![],this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]][_0x5e60('0x55')]?_0x5e60('0x56')+this[_0x5e60('0x23')][_0x1abc43[_0x5e60('0x24')]][_0x5e60('0x55')]:_0x5e60('0x57'));}}}};Fax[_0x5e60('0x29')][_0x5e60('0x58')]=function(_0x157aad){var _0x15921d=this;return new BPromise(function(_0xc5f45,_0x2826f7){_0x15921d[_0x5e60('0x59')](_0x157aad,_0x15921d[_0x5e60('0xf')][_0x157aad[_0x5e60('0x5a')]])['then'](function(_0x922817){ut[_0x5e60('0x49')](_0x5e60('0x5b'),_0x922817);_0xc5f45(ut['message'](_0x5e60('0x5c')));})[_0x5e60('0x3d')](function(_0x58376d){ut[_0x5e60('0x49')](_0x5e60('0x5d'),_0x58376d);updateStatus(_0x157aad);_0x2826f7(ut['message'](_0x5e60('0x5e')));});});};Fax[_0x5e60('0x29')][_0x5e60('0x5f')]=function(_0xd9a0db){var _0x1db659=this;return new BPromise(function(_0x711888,_0x221f35){var _0x3b5493=_0x1db659[_0x5e60('0x60')](_0x1db659['faxAccounts'][_0xd9a0db[_0x5e60('0x5a')]][_0x5e60('0x61')],_0xd9a0db);if(_0x3b5493[_0x5e60('0x62')]){_0x711888(ut['message'](_0x5e60('0x63')));}else{_0x221f35(ut[_0x5e60('0x38')](_0x3b5493[_0x5e60('0x38')]));}});};function originate(_0x15d975,_0x3e85fe,_0x559f8c){return new BPromise(function(_0x4560e1,_0x213c7e){if(_0x559f8c){var _0x3463a7=util['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[_0x5e60('0x3a')](_0x15d975[_0x5e60('0x4')])[_0x5e60('0x26')],_0x15d975[_0x5e60('0x4')]);gs[_0x5e60('0x64')](_0x3463a7)[_0x5e60('0x48')](function(){_0x15d975[_0x5e60('0x4')]=util['format'](_0x5e60('0x65'),path[_0x5e60('0x3a')](_0x15d975[_0x5e60('0x4')])['dir'],path['parse'](_0x15d975[_0x5e60('0x4')])[_0x5e60('0x26')]);_0x3e85fe[_0x5e60('0x66')]=_0x15d975['path'];ut['logger'](_0x5e60('0x67'),'');ami[_0x5e60('0x68')](ut[_0x5e60('0x69')](_0x15d975,_0x3e85fe))[_0x5e60('0x48')](function(_0x42c62d){_0x4560e1(_0x42c62d);})[_0x5e60('0x3d')](function(_0x4a1e15){_0x213c7e(_0x4a1e15);});})[_0x5e60('0x3d')](function(_0x406a74){_0x213c7e(_0x406a74);});}else{ami[_0x5e60('0x68')](ut[_0x5e60('0x69')](_0x15d975,_0x3e85fe))[_0x5e60('0x48')](function(_0x1750b5){_0x4560e1(_0x1750b5);})[_0x5e60('0x3d')](function(_0x92d9c5){_0x213c7e(_0x92d9c5);});}});}Fax[_0x5e60('0x29')]['execOriginate']=function(_0x34cfa7,_0x136464){var _0x48570a=this;return new BPromise(function(_0x306e7c,_0x26508b){var _0x530a21=uuid['v4']();var _0x312ae3=ut[_0x5e60('0x6a')](_0x34cfa7,_0x136464);_0x48570a[_0x5e60('0x11')][_0x530a21]=new Action(_0x530a21,_0x136464,_0x34cfa7);var _0x1b4aee=_0x48570a[_0x5e60('0x11')][_0x530a21];if(path[_0x5e60('0x3a')](_0x34cfa7['path'])[_0x5e60('0x6b')]===_0x5e60('0x3b')){originate(_0x1b4aee,_0x312ae3,!![])[_0x5e60('0x48')](function(_0x222d94){_0x306e7c(_0x222d94);})[_0x5e60('0x3d')](function(_0xd70e8f){_0x26508b(_0xd70e8f);});}else{originate(_0x1b4aee,_0x312ae3,![])[_0x5e60('0x48')](function(_0x3f6bb2){_0x306e7c(_0x3f6bb2);})[_0x5e60('0x3d')](function(_0x58e900){_0x26508b(_0x58e900);});}});};Fax[_0x5e60('0x29')][_0x5e60('0x6c')]=function(_0x71d909){return!_[_0x5e60('0x6d')](_0x71d909)&&!_[_0x5e60('0x6d')](_0x71d909[_0x5e60('0x26')])&&!_[_0x5e60('0x6d')](_0x71d909[_0x5e60('0x6e')])&&_0x71d909[_0x5e60('0x6e')]&&!_[_0x5e60('0x6d')](this['trunks'][util['format']('SIP/%s',_0x71d909[_0x5e60('0x26')])])&&!_[_0x5e60('0x6d')](this[_0x5e60('0x10')][util[_0x5e60('0x6f')](_0x5e60('0x70'),_0x71d909[_0x5e60('0x26')])][_0x5e60('0x30')])&&(this[_0x5e60('0x10')][util[_0x5e60('0x6f')]('SIP/%s',_0x71d909[_0x5e60('0x26')])][_0x5e60('0x30')]===_0x5e60('0x71')||this['trunks'][util[_0x5e60('0x6f')]('SIP/%s',_0x71d909['name'])]['status']===_0x5e60('0x72'));};Fax[_0x5e60('0x29')][_0x5e60('0x60')]=function(_0x148c53,_0x445e6a){if(!this[_0x5e60('0x6c')](_0x148c53)){ut[_0x5e60('0x49')](_0x5e60('0x73'),_[_0x5e60('0x6d')](_0x148c53)?'':_0x148c53['name']+_0x5e60('0x74'));return{'isValid':![],'message':_0x5e60('0x75')};}if(_[_0x5e60('0x6d')](_0x445e6a[_0x5e60('0x8')])){ut[_0x5e60('0x49')](_0x5e60('0x76'),JSON[_0x5e60('0x40')](_0x445e6a));return{'isValid':![],'message':_0x5e60('0x77')};}if(_[_0x5e60('0x6d')](_0x445e6a[_0x5e60('0x4')])){ut[_0x5e60('0x49')](_0x5e60('0x78'),JSON['stringify'](_0x445e6a));return{'isValid':![],'message':_0x5e60('0x79')};}return{'isValid':!![],'message':_0x5e60('0x7a')};};module[_0x5e60('0x7b')]=Fax; \ No newline at end of file +var _0xbee3=['actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','application/pdf','.pdf','error','catch','\x20receiveFax\x20','syncOriginateResponse','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','stringify','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','lodash','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks'];(function(_0x34282d,_0x324f57){var _0x3f1448=function(_0x142719){while(--_0x142719){_0x34282d['push'](_0x34282d['shift']());}};_0x3f1448(++_0x324f57);}(_0xbee3,0xd5));var _0x3bee=function(_0x243031,_0x1ba9d0){_0x243031=_0x243031-0x0;var _0x248351=_0xbee3[_0x243031];return _0x248351;};'use strict';var util=require('util');var _=require(_0x3bee('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x3bee('0x1'));var path=require(_0x3bee('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3bee('0x3'));var logger=require(_0x3bee('0x4'))(_0x3bee('0x5'));var ami=require('../ami');var rpcDb=require(_0x3bee('0x6'));var Channel=require(_0x3bee('0x7'));var ut=require('./util/util');var Action=require(_0x3bee('0x8'));var faxAccount=require(_0x3bee('0x9'));var attachment=require(_0x3bee('0xa'));var faxMessage=require(_0x3bee('0xb'));function Fax(_0xbdd5d5){this[_0x3bee('0xc')]={};this[_0x3bee('0xd')]=_0xbdd5d5['faxAccounts'];this[_0x3bee('0xe')]=_0xbdd5d5[_0x3bee('0xe')];this[_0x3bee('0xf')]={};ami['on'](_0x3bee('0x10'),this[_0x3bee('0x11')][_0x3bee('0x12')](this));ami['on']('varset',this[_0x3bee('0x13')]['bind'](this));ami['on'](_0x3bee('0x14'),this[_0x3bee('0x15')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x16'),this[_0x3bee('0x17')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x18'),this['syncFaxStatus'][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x19'),this[_0x3bee('0x1a')][_0x3bee('0x12')](this));ami['on'](_0x3bee('0x1b'),this['syncHangup']['bind'](this));ami['on'](_0x3bee('0x1c'),this['syncOriginateResponse'][_0x3bee('0x12')](this));}Fax[_0x3bee('0x1d')]['syncNewchannel']=function(_0x5c87cf){if(_0x5c87cf[_0x3bee('0x1e')]===_0x3bee('0x1f')){for(var _0xfdba3b in this[_0x3bee('0xd')]){if(this['faxAccounts'][_0x3bee('0x20')](_0xfdba3b)){if(_0x5c87cf[_0x3bee('0x21')]===this[_0x3bee('0xd')][_0xfdba3b][_0x3bee('0x22')]){this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]]={};this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]['channel']=_0x5c87cf[_0x3bee('0x24')];this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]['id']=this[_0x3bee('0xd')][_0xfdba3b]['id'];this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]][_0x3bee('0x25')]=this[_0x3bee('0xd')][_0xfdba3b][_0x3bee('0x25')];logger[_0x3bee('0x26')](_0x5c87cf['uniqueid'],_0x3bee('0x27'));}}}}if(this[_0x3bee('0xf')][_0x5c87cf[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x5c87cf['uniqueid']]={};this[_0x3bee('0xc')][_0x5c87cf[_0x3bee('0x23')]][_0x3bee('0x24')]=_0x5c87cf['channel'];logger['info'](_0x5c87cf[_0x3bee('0x23')],_0x3bee('0x27'));}};Fax['prototype'][_0x3bee('0x13')]=function(_0x1b4ce0){if(this[_0x3bee('0xc')][_0x1b4ce0['uniqueid']]){for(var _0x1984c4 in _0x1b4ce0[_0x3bee('0x28')]){if(_0x1b4ce0[_0x3bee('0x28')]['hasOwnProperty'](_0x1984c4)){this[_0x3bee('0xc')][_0x1b4ce0[_0x3bee('0x23')]][_0x1984c4]=_0x1b4ce0[_0x3bee('0x29')];}}}};Fax['prototype'][_0x3bee('0x15')]=function(_0x24d523){if(this[_0x3bee('0xc')][_0x24d523[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x24d523['uniqueid']]['channelstate']=_0x24d523[_0x3bee('0x2a')];this[_0x3bee('0xc')][_0x24d523[_0x3bee('0x23')]][_0x3bee('0x2b')]=_0x24d523['channelstatedesc'];}};Fax['prototype'][_0x3bee('0x17')]=function(_0x42cb58){if(this['channels'][_0x42cb58['uniqueid']]){for(var _0xf4701f in _0x42cb58[_0x3bee('0x28')]){if(_0x42cb58[_0x3bee('0x28')][_0x3bee('0x20')](_0xf4701f)){this[_0x3bee('0xc')][_0x42cb58[_0x3bee('0x23')]][_0xf4701f]=_0x42cb58[_0x3bee('0x29')];}}}};Fax[_0x3bee('0x1d')][_0x3bee('0x2c')]=function(_0x42291d){if(this['channels'][_0x42291d['uniqueid']]){this[_0x3bee('0xc')][_0x42291d['uniqueid']]['operation']=_0x42291d[_0x3bee('0x2d')];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]][_0x3bee('0x2e')]=_0x42291d[_0x3bee('0x2e')];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]][_0x3bee('0x22')]=_0x42291d['localstationid'];this[_0x3bee('0xc')][_0x42291d[_0x3bee('0x23')]]['filename']=_0x42291d[_0x3bee('0x2f')];logger[_0x3bee('0x26')](_0x42291d[_0x3bee('0x23')],_0x3bee('0x30'));}};Fax[_0x3bee('0x1d')]['syncReceiveFax']=function(_0x57a895){var _0x1a7460=this;if(this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]){var _0x428953=this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]['id'];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x31')]=_0x57a895[_0x3bee('0x31')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]]['pagestransferred']=_0x57a895[_0x3bee('0x32')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x22')]=_0x57a895[_0x3bee('0x22')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x33')]=_0x57a895[_0x3bee('0x33')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x34')]=_0x57a895[_0x3bee('0x34')];this['channels'][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x2f')]=_0x57a895[_0x3bee('0x2f')];this[_0x3bee('0xc')][_0x57a895[_0x3bee('0x23')]][_0x3bee('0x35')]=_0x57a895[_0x3bee('0x35')];if(this[_0x3bee('0xc')][_0x57a895['uniqueid']][_0x3bee('0x32')]>0x0){tiff2pdf(_0x57a895[_0x3bee('0x2f')],_0x3bee('0x36'),function(_0x53e73c){logger[_0x3bee('0x26')](_0x57a895['uniqueid'],_0x3bee('0x37'),_0x53e73c['message']);attachment['create']({'name':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])[_0x3bee('0x25')],'basename':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])['name']+'.pdf','type':_0x3bee('0x39')})['then'](function(_0x5aa15f){faxAccount['notify'](_0x428953,{'from':_0x57a895[_0x3bee('0x35')],'mapKey':'fax','body':path[_0x3bee('0x38')](_0x57a895[_0x3bee('0x2f')])[_0x3bee('0x25')]+_0x3bee('0x3a'),'AttachmentId':_0x5aa15f['id']})['catch'](function(_0x5deb3e){logger[_0x3bee('0x3b')](_0x57a895['uniqueid'],'\x20notify\x20',JSON['stringify'](_0x5deb3e));});})[_0x3bee('0x3c')](function(_0x4e1c3f){logger[_0x3bee('0x3b')](_0x57a895[_0x3bee('0x23')],_0x3bee('0x3d'),JSON['stringify'](_0x4e1c3f));});});}logger[_0x3bee('0x26')](_0x57a895['uniqueid'],_0x3bee('0x3d'));}};Fax['prototype'][_0x3bee('0x3e')]=function(_0x16b096){if(this[_0x3bee('0xf')][_0x16b096['uniqueid']]){_[_0x3bee('0x3f')](this[_0x3bee('0xc')][_0x16b096[_0x3bee('0x23')]],_['pick'](_0x16b096,['response',_0x3bee('0x40')]));}};function updateStatus(_0x3c1220){if(_0x3c1220[_0x3bee('0x41')]){faxMessage[_0x3bee('0x42')](_0x3c1220[_0x3bee('0x41')],{'failMessage':_0x3bee('0x43')})[_0x3bee('0x44')](function(_0x521ceb){ut[_0x3bee('0x45')](_0x3bee('0x46'),_0x521ceb);})['catch'](function(_0x4dca26){ut[_0x3bee('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x4dca26);});}else{ut[_0x3bee('0x45')](_0x3bee('0x47'));}}Fax[_0x3bee('0x1d')]['updateStatus']=function(_0x1a13fd,_0x3beac9,_0x127cb8){var _0x5f5272=this;var _0x1ee4f0={};if(_0x3beac9){_0x1ee4f0={'read':_0x3beac9};}else{_0x1ee4f0={'failMessage':_0x127cb8};}if(this[_0x3bee('0xf')][_0x1a13fd]['AttachmentId']){faxMessage[_0x3bee('0x42')](this[_0x3bee('0xf')][_0x1a13fd]['AttachmentId'],_0x1ee4f0)[_0x3bee('0x44')](function(_0x29bf8c){ut[_0x3bee('0x45')](_0x3bee('0x48'),_0x29bf8c);})[_0x3bee('0x3c')](function(_0x1d563e){ut[_0x3bee('0x45')](_0x3bee('0x49'),_0x1d563e);})['finally'](function(){delete _0x5f5272['channels'][_0x1a13fd];delete _0x5f5272[_0x3bee('0xf')][_0x1a13fd];});}else{ut['logger'](_0x3bee('0x4a'));delete this[_0x3bee('0xc')][_0x1a13fd];delete this[_0x3bee('0xf')][_0x1a13fd];}};Fax['prototype'][_0x3bee('0x4b')]=function(_0x2949d7){var _0x2ef55b=this;if(this['channels'][_0x2949d7[_0x3bee('0x23')]]){if(this['actions'][_0x2949d7[_0x3bee('0x23')]]){this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['id']=this['actions'][_0x2949d7[_0x3bee('0x23')]]['id'];this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['name']=this['actions'][_0x2949d7[_0x3bee('0x23')]][_0x3bee('0x25')];}logger[_0x3bee('0x26')](_0x2949d7['uniqueid'],this['actions'][_0x2949d7[_0x3bee('0x23')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x3bee('0x4c')](this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]));if(this['actions'][_0x2949d7['uniqueid']]){if(this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]]['faxpages']>0x0&&this[_0x3bee('0xc')][_0x2949d7['uniqueid']][_0x3bee('0x18')]===_0x3bee('0x4d')){this[_0x3bee('0x4e')](_0x2949d7[_0x3bee('0x23')],!![]);}else{this[_0x3bee('0x4e')](_0x2949d7[_0x3bee('0x23')],![],this[_0x3bee('0xc')][_0x2949d7[_0x3bee('0x23')]][_0x3bee('0x4f')]?_0x3bee('0x50')+this[_0x3bee('0xc')][_0x2949d7['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x3bee('0x1d')][_0x3bee('0x51')]=function(_0x4acba2){var _0x9828ad=this;return new BPromise(function(_0x5d2cad,_0x154a35){_0x9828ad[_0x3bee('0x52')](_0x4acba2,_0x9828ad['faxAccounts'][_0x4acba2['FaxAccountId']])[_0x3bee('0x44')](function(_0xf5a4e3){ut[_0x3bee('0x45')]('[Fax][execOriginate][success]',_0xf5a4e3);_0x5d2cad(ut[_0x3bee('0x53')](_0x3bee('0x54')));})[_0x3bee('0x3c')](function(_0x5926bc){ut[_0x3bee('0x45')](_0x3bee('0x55'),_0x5926bc);updateStatus(_0x4acba2);_0x154a35(ut[_0x3bee('0x53')](_0x3bee('0x56')));});});};Fax['prototype']['checkAfterSend']=function(_0x169f36){var _0x8f2cb=this;return new BPromise(function(_0x16e56c,_0x3f239a){var _0x167552=_0x8f2cb['checkTrunk'](_0x8f2cb[_0x3bee('0xd')][_0x169f36['FaxAccountId']][_0x3bee('0x57')],_0x169f36);if(_0x167552[_0x3bee('0x58')]){_0x16e56c(ut[_0x3bee('0x53')](_0x3bee('0x59')));}else{_0x3f239a(ut[_0x3bee('0x53')](_0x167552[_0x3bee('0x53')]));}});};function originate(_0x3f7dad,_0x4d52f3,_0x25f936){return new BPromise(function(_0x28c16e,_0x42045d){if(_0x25f936){var _0x3a6f56=util['format'](_0x3bee('0x5a'),path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])[_0x3bee('0x25')],_0x3f7dad[_0x3bee('0x2')]);gs[_0x3bee('0x5b')](_0x3a6f56)[_0x3bee('0x44')](function(){_0x3f7dad[_0x3bee('0x2')]=util['format'](_0x3bee('0x5c'),path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])['dir'],path[_0x3bee('0x38')](_0x3f7dad[_0x3bee('0x2')])[_0x3bee('0x25')]);_0x4d52f3[_0x3bee('0x5d')]=_0x3f7dad[_0x3bee('0x2')];ut[_0x3bee('0x45')](_0x3bee('0x5e'),'');ami[_0x3bee('0x5f')](ut[_0x3bee('0x60')](_0x3f7dad,_0x4d52f3))[_0x3bee('0x44')](function(_0x3f72f7){_0x28c16e(_0x3f72f7);})[_0x3bee('0x3c')](function(_0xda3a9d){_0x42045d(_0xda3a9d);});})[_0x3bee('0x3c')](function(_0x5e054){_0x42045d(_0x5e054);});}else{ami[_0x3bee('0x5f')](ut[_0x3bee('0x60')](_0x3f7dad,_0x4d52f3))[_0x3bee('0x44')](function(_0x38e1be){_0x28c16e(_0x38e1be);})[_0x3bee('0x3c')](function(_0x3c5600){_0x42045d(_0x3c5600);});}});}Fax[_0x3bee('0x1d')][_0x3bee('0x52')]=function(_0x44c0c3,_0x75ba50){var _0x556e60=this;return new BPromise(function(_0x35f0fb,_0xef6d20){var _0x46bf22=uuid['v4']();var _0x6f0320=ut[_0x3bee('0x61')](_0x44c0c3,_0x75ba50);_0x556e60[_0x3bee('0xf')][_0x46bf22]=new Action(_0x46bf22,_0x75ba50,_0x44c0c3);var _0x2d6a3d=_0x556e60[_0x3bee('0xf')][_0x46bf22];if(path[_0x3bee('0x38')](_0x44c0c3['path'])[_0x3bee('0x62')]===_0x3bee('0x3a')){originate(_0x2d6a3d,_0x6f0320,!![])['then'](function(_0xbfb4af){_0x35f0fb(_0xbfb4af);})['catch'](function(_0x1c260a){_0xef6d20(_0x1c260a);});}else{originate(_0x2d6a3d,_0x6f0320,![])[_0x3bee('0x44')](function(_0x3b6709){_0x35f0fb(_0x3b6709);})['catch'](function(_0x541484){_0xef6d20(_0x541484);});}});};Fax[_0x3bee('0x1d')][_0x3bee('0x63')]=function(_0x3c055b){return!_[_0x3bee('0x64')](_0x3c055b)&&!_[_0x3bee('0x64')](_0x3c055b[_0x3bee('0x25')])&&!_[_0x3bee('0x64')](_0x3c055b[_0x3bee('0x65')])&&_0x3c055b['active']&&!_[_0x3bee('0x64')](this[_0x3bee('0xe')][util[_0x3bee('0x66')](_0x3bee('0x67'),_0x3c055b[_0x3bee('0x25')])])&&!_[_0x3bee('0x64')](this[_0x3bee('0xe')][util['format'](_0x3bee('0x67'),_0x3c055b[_0x3bee('0x25')])]['status'])&&(this[_0x3bee('0xe')][util[_0x3bee('0x66')]('SIP/%s',_0x3c055b[_0x3bee('0x25')])]['status']===_0x3bee('0x68')||this[_0x3bee('0xe')][util[_0x3bee('0x66')](_0x3bee('0x67'),_0x3c055b['name'])][_0x3bee('0x2e')]===_0x3bee('0x69'));};Fax[_0x3bee('0x1d')]['checkTrunk']=function(_0x1fb398,_0xe164fc){if(!this['isTrunkReachable'](_0x1fb398)){ut[_0x3bee('0x45')](_0x3bee('0x6a'),_['isNil'](_0x1fb398)?'':_0x1fb398[_0x3bee('0x25')]+_0x3bee('0x6b'));return{'isValid':![],'message':_0x3bee('0x6c')};}if(_[_0x3bee('0x64')](_0xe164fc[_0x3bee('0x5')])){ut['logger'](_0x3bee('0x6d'),JSON[_0x3bee('0x4c')](_0xe164fc));return{'isValid':![],'message':_0x3bee('0x6e')};}if(_['isNil'](_0xe164fc['path'])){ut[_0x3bee('0x45')](_0x3bee('0x6f'),JSON[_0x3bee('0x4c')](_0xe164fc));return{'isValid':![],'message':_0x3bee('0x70')};}return{'isValid':!![],'message':_0x3bee('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3105e72..aa2a1da 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 _0x5f44=['[Notify]\x20','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x4e9348,_0x5eca73){var _0x50cafa=function(_0x14d364){while(--_0x14d364){_0x4e9348['push'](_0x4e9348['shift']());}};_0x50cafa(++_0x5eca73);}(_0x5f44,0xa6));var _0x45f4=function(_0x4356b9,_0x1dd962){_0x4356b9=_0x4356b9-0x0;var _0x45bb1e=_0x5f44[_0x4356b9];return _0x45bb1e;};'use strict';var util=require('util');var BPromise=require(_0x45f4('0x0'));var logger=require('../../../config/logger')(_0x45f4('0x1'));var _=require(_0x45f4('0x2'));var faxAccount=require(_0x45f4('0x3'));function loggerCatch(_0x4886f1){return function(_0x2773f6){logger[_0x45f4('0x4')](_0x4886f1,util[_0x45f4('0x5')](_0x2773f6,{'showHidden':![],'depth':null}));};}exports[_0x45f4('0x6')]=function(_0x7f9258,_0x730ca9){return BPromise[_0x45f4('0x7')]()[_0x45f4('0x8')](faxAccount[_0x45f4('0x6')](_0x7f9258,_0x730ca9))[_0x45f4('0x9')](loggerCatch(_0x45f4('0xa')));}; \ No newline at end of file +var _0x8a01=['resolve','then','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x8a01,0x1cf));var _0x18a0=function(_0x5b0865,_0x2949b0){_0x5b0865=_0x5b0865-0x0;var _0x509c4b=_0x8a01[_0x5b0865];return _0x509c4b;};'use strict';var util=require('util');var BPromise=require(_0x18a0('0x0'));var logger=require(_0x18a0('0x1'))(_0x18a0('0x2'));var _=require(_0x18a0('0x3'));var faxAccount=require(_0x18a0('0x4'));function loggerCatch(_0x353cf2){return function(_0x38a6f7){logger[_0x18a0('0x5')](_0x353cf2,util['inspect'](_0x38a6f7,{'showHidden':![],'depth':null}));};}exports[_0x18a0('0x6')]=function(_0xc7be63,_0x48d7a1){return BPromise[_0x18a0('0x7')]()[_0x18a0('0x8')](faxAccount[_0x18a0('0x6')](_0xc7be63,_0x48d7a1))['catch'](loggerCatch(_0x18a0('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ada9572..676f128 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 _0xb5a5=['util','bluebird','child_process','info','Exec\x20gs','inspect'];(function(_0x592a41,_0x379e90){var _0x54eec5=function(_0x37416a){while(--_0x37416a){_0x592a41['push'](_0x592a41['shift']());}};_0x54eec5(++_0x379e90);}(_0xb5a5,0x192));var _0x5b5a=function(_0x19b67f,_0x42d1c7){_0x19b67f=_0x19b67f-0x0;var _0x57e9d9=_0xb5a5[_0x19b67f];return _0x57e9d9;};'use strict';var util=require(_0x5b5a('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x5b5a('0x1'));var exec=require(_0x5b5a('0x2'))['exec'];exports['execute']=function(_0x38c118){return new BPromise(function(_0x4c6730,_0x1d771a){exec(_0x38c118,function(_0x35a625,_0x2590a0,_0x38ddc0){logger[_0x5b5a('0x3')](_0x5b5a('0x4'),_0x2590a0);if(_0x35a625){logger['info'](_0x5b5a('0x4'),'\x20Error\x20:',util[_0x5b5a('0x5')](_0x35a625,{'showHidden':![],'depth':null}),_0x2590a0,_0x38ddc0);_0x1d771a(_0x35a625);}_0x4c6730(_0x2590a0);});});}; \ No newline at end of file +var _0xb800=['util','../../../../config/logger','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x4ae273,_0x8e20b4){var _0x4c04c6=function(_0xda7d5f){while(--_0xda7d5f){_0x4ae273['push'](_0x4ae273['shift']());}};_0x4c04c6(++_0x8e20b4);}(_0xb800,0x190));var _0x0b80=function(_0x18c922,_0x4f8cf8){_0x18c922=_0x18c922-0x0;var _0x5bd677=_0xb800[_0x18c922];return _0x5bd677;};'use strict';var util=require(_0x0b80('0x0'));var logger=require(_0x0b80('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x0b80('0x2'))[_0x0b80('0x3')];exports[_0x0b80('0x4')]=function(_0x3d7f10){return new BPromise(function(_0x5f00e3,_0x239b38){exec(_0x3d7f10,function(_0x13f0f6,_0x3ca217,_0x2f5731){logger[_0x0b80('0x5')](_0x0b80('0x6'),_0x3ca217);if(_0x13f0f6){logger[_0x0b80('0x5')]('Exec\x20gs',_0x0b80('0x7'),util['inspect'](_0x13f0f6,{'showHidden':![],'depth':null}),_0x3ca217,_0x2f5731);_0x239b38(_0x13f0f6);}_0x5f00e3(_0x3ca217);});});}; \ 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 3740a88..109849b 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 _0x3bbf=['originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','../../../../config/logger','fax','message','logger','inspect','ecm','maxrate','format','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid'];(function(_0x2199e9,_0x48898b){var _0x1d1983=function(_0x1e9ccc){while(--_0x1e9ccc){_0x2199e9['push'](_0x2199e9['shift']());}};_0x1d1983(++_0x48898b);}(_0x3bbf,0x140));var _0xf3bb=function(_0x5cbdfa,_0x2b4bed){_0x5cbdfa=_0x5cbdfa-0x0;var _0x3d8f90=_0x3bbf[_0x5cbdfa];return _0x3d8f90;};'use strict';var util=require(_0xf3bb('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xf3bb('0x1'))(_0xf3bb('0x2'));exports[_0xf3bb('0x3')]=function(_0x1db421){return{'message':_0x1db421};};exports[_0xf3bb('0x4')]=function(_0x50b69a,_0x46327a){logger['info'](_0x50b69a,util[_0xf3bb('0x5')](_0x46327a,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4a20f5,_0x465df0){var _0x4b5606={'XMF-ECM':_0x465df0[_0xf3bb('0x6')],'XMF-HEADERINFO':_0x465df0['headerinfo'],'XMF-MINRATE':_0x465df0['minrate'],'XMF-MAXRATE':_0x465df0[_0xf3bb('0x7')],'XMF-MODEM':util[_0xf3bb('0x8')](_0xf3bb('0x9'),_0x465df0['modem']),'XMF-GATEWAY':_0x465df0['gateway'],'XMF-FAXDETECT':_0x465df0[_0xf3bb('0xa')],'XMF-T38TIMEOUT':_0x465df0[_0xf3bb('0xb')],'XMF-LOCALSTATIONID':_0x465df0[_0xf3bb('0xc')],'XMF-PATH':_0x4a20f5[_0xf3bb('0xd')]};return _0x4b5606;};exports[_0xf3bb('0xe')]=function(_0xeb9f84,_0x48103b){return{'actionid':_0xeb9f84[_0xf3bb('0xf')],'action':_0xf3bb('0x10'),'channel':_0xeb9f84[_0xf3bb('0x11')],'Exten':_0xf3bb('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0xf3bb('0x8')](_0xf3bb('0x13'),_0xeb9f84[_0xf3bb('0x14')]?_0xeb9f84[_0xf3bb('0x14')]:'',_0xeb9f84['localstationid']),'variable':_0x48103b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xeb9f84[_0xf3bb('0xf')]};}; \ No newline at end of file +var _0xa8cf=['modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','from-sip','util','moment','logger','info','inspect','addVariables','headerinfo','maxrate','\x22%s\x22'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0xa8cf,0x1cb));var _0xfa8c=function(_0x353e55,_0x384e65){_0x353e55=_0x353e55-0x0;var _0xe1646a=_0xa8cf[_0x353e55];return _0xe1646a;};'use strict';var util=require(_0xfa8c('0x0'));var _=require('lodash');var moment=require(_0xfa8c('0x1'));var logger=require('../../../../config/logger')('fax');exports['message']=function(_0x177718){return{'message':_0x177718};};exports[_0xfa8c('0x2')]=function(_0x4cec2a,_0x14405f){logger[_0xfa8c('0x3')](_0x4cec2a,util[_0xfa8c('0x4')](_0x14405f,{'showHidden':![],'depth':null}));};exports[_0xfa8c('0x5')]=function(_0x579adb,_0x2da87c){var _0x1b40d9={'XMF-ECM':_0x2da87c['ecm'],'XMF-HEADERINFO':_0x2da87c[_0xfa8c('0x6')],'XMF-MINRATE':_0x2da87c['minrate'],'XMF-MAXRATE':_0x2da87c[_0xfa8c('0x7')],'XMF-MODEM':util['format'](_0xfa8c('0x8'),_0x2da87c[_0xfa8c('0x9')]),'XMF-GATEWAY':_0x2da87c[_0xfa8c('0xa')],'XMF-FAXDETECT':_0x2da87c['faxdetect'],'XMF-T38TIMEOUT':_0x2da87c[_0xfa8c('0xb')],'XMF-LOCALSTATIONID':_0x2da87c[_0xfa8c('0xc')],'XMF-PATH':_0x579adb[_0xfa8c('0xd')]};return _0x1b40d9;};exports[_0xfa8c('0xe')]=function(_0x3c9b87,_0x19a22c){return{'actionid':_0x3c9b87[_0xfa8c('0xf')],'action':'originate','channel':_0x3c9b87['channel'],'Exten':_0xfa8c('0x10'),'Context':_0xfa8c('0x11'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x3c9b87['headerinfo']?_0x3c9b87['headerinfo']:'',_0x3c9b87[_0xfa8c('0xc')]),'variable':_0x19a22c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3c9b87[_0xfa8c('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 998b93b..b316d09 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 _0x4dd7=['initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','listen','[index.js][main]','bluebird','util','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','getAgents','initAgents','getTelephones'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4dd7,0x6b));var _0x74dd=function(_0x571ef1,_0x12fa6e){_0x571ef1=_0x571ef1-0x0;var _0x4ff41f=_0x4dd7[_0x571ef1];return _0x4ff41f;};'use strict';var BPromise=require(_0x74dd('0x0'));var util=require(_0x74dd('0x1'));var moment=require('moment');var server=require(_0x74dd('0x2'));var Realtime=require(_0x74dd('0x3'));var Report=require('./report');var Acw=require(_0x74dd('0x4'));var Trigger=require(_0x74dd('0x5'));var Dialer=require(_0x74dd('0x6'));var Preview=require(_0x74dd('0x7'));var Fax=require(_0x74dd('0x8'));var user=require(_0x74dd('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x74dd('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x74dd('0xb'));var trigger=require(_0x74dd('0xc'));var template=require('./rpc/template');var cmHopperHistory=require(_0x74dd('0xd'));var campaign=require(_0x74dd('0xe'));var voiceExtension=require(_0x74dd('0xf'));var faxAccount=require(_0x74dd('0x10'));var zendesk=require(_0x74dd('0x11'));var salesforce=require(_0x74dd('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x74dd('0x13'));var desk=require(_0x74dd('0x14'));var zoho=require(_0x74dd('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x74dd('0x16'));var servicenow=require(_0x74dd('0x17'));var dynamics365=require(_0x74dd('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x74dd('0x19'))(_0x74dd('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x74dd('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x74dd('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x74dd('0x1c')]()[_0x74dd('0x1d')](user[_0x74dd('0x1e')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x1f')]())['then'](user[_0x74dd('0x20')]())[_0x74dd('0x1d')](realtime['initTelephones']())['then'](trunk['getTrunks']())['then'](realtime[_0x74dd('0x21')]())[_0x74dd('0x1d')](voiceQueue[_0x74dd('0x22')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x23')]())['then'](trigger[_0x74dd('0x24')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x25')]())[_0x74dd('0x1d')](template[_0x74dd('0x26')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x27')]())[_0x74dd('0x1d')](zendesk[_0x74dd('0x28')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x29')]())[_0x74dd('0x1d')](salesforce[_0x74dd('0x2a')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x2b')]())[_0x74dd('0x1d')](sugarcrm[_0x74dd('0x2c')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x2d')]())[_0x74dd('0x1d')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x74dd('0x2e')]())['then'](desk[_0x74dd('0x2f')]())['then'](realtime[_0x74dd('0x30')]())['then'](zoho['getZohoAccounts']())['then'](realtime[_0x74dd('0x31')]())['then'](vtiger[_0x74dd('0x32')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x33')]())[_0x74dd('0x1d')](freshsales[_0x74dd('0x34')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x35')]())['then'](servicenow['getServicenowAccounts']())[_0x74dd('0x1d')](realtime['initServicenowAccounts']())[_0x74dd('0x1d')](dynamics365[_0x74dd('0x36')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x37')]())[_0x74dd('0x1d')](campaign[_0x74dd('0x38')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x39')]())[_0x74dd('0x1d')](voiceExtension['getVoiceExtensions']())[_0x74dd('0x1d')](realtime[_0x74dd('0x3a')]())['then'](faxAccount[_0x74dd('0x3b')]())['then'](realtime[_0x74dd('0x3c')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x74dd('0x1c')]()[_0x74dd('0x1d')](voiceQueueReport[_0x74dd('0x3d')]())['then'](realtime[_0x74dd('0x3e')]())[_0x74dd('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x74dd('0x1d')](realtime[_0x74dd('0x3f')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())[_0x74dd('0x1d')](voiceCallReport[_0x74dd('0x40')]())[_0x74dd('0x1d')](realtime[_0x74dd('0x41')]())[_0x74dd('0x42')](function(_0x4a4276){logger[_0x74dd('0x43')]('[index.js][initParams]',util['inspect'](_0x4a4276,{'showHidden':![],'depth':null}));});}function main(){return server[_0x74dd('0x44')](realtime,preview,fax)[_0x74dd('0x1d')](function(_0x1d1ec6){return initRealtime();})[_0x74dd('0x1d')](function(){return initParams();})[_0x74dd('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x74dd('0x42')](function(_0x5eb6a8){logger[_0x74dd('0x43')](_0x74dd('0x45'),util['inspect'](_0x5eb6a8,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x5a7e=['error','inspect','listen','[index.js][main]','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','initTelephones','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','catch'];(function(_0x5dd85c,_0x509efc){var _0x10e189=function(_0x267ebb){while(--_0x267ebb){_0x5dd85c['push'](_0x5dd85c['shift']());}};_0x10e189(++_0x509efc);}(_0x5a7e,0x18a));var _0xe5a7=function(_0x7dfed6,_0x1e7ee4){_0x7dfed6=_0x7dfed6-0x0;var _0x49b5e2=_0x5a7e[_0x7dfed6];return _0x49b5e2;};'use strict';var BPromise=require(_0xe5a7('0x0'));var util=require('util');var moment=require(_0xe5a7('0x1'));var server=require(_0xe5a7('0x2'));var Realtime=require(_0xe5a7('0x3'));var Report=require(_0xe5a7('0x4'));var Acw=require(_0xe5a7('0x5'));var Trigger=require(_0xe5a7('0x6'));var Dialer=require(_0xe5a7('0x7'));var Preview=require(_0xe5a7('0x8'));var Fax=require('./fax');var user=require(_0xe5a7('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xe5a7('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe5a7('0xb'));var trigger=require('./rpc/trigger');var template=require(_0xe5a7('0xc'));var cmHopperHistory=require(_0xe5a7('0xd'));var campaign=require(_0xe5a7('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xe5a7('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xe5a7('0x10'));var freshdesk=require(_0xe5a7('0x11'));var desk=require(_0xe5a7('0x12'));var zoho=require(_0xe5a7('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xe5a7('0x14'));var dynamics365=require(_0xe5a7('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xe5a7('0x16'))(_0xe5a7('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe5a7('0x18')](_0xe5a7('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe5a7('0x1a')]()[_0xe5a7('0x1b')](user['getAgents']())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x1c')]())[_0xe5a7('0x1b')](user['getTelephones']())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x1d')]())['then'](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0xe5a7('0x1b')](voiceQueue[_0xe5a7('0x1e')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x1f')]())[_0xe5a7('0x1b')](trigger[_0xe5a7('0x20')]())[_0xe5a7('0x1b')](realtime['initTriggers']())[_0xe5a7('0x1b')](template[_0xe5a7('0x21')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x22')]())[_0xe5a7('0x1b')](zendesk[_0xe5a7('0x23')]())['then'](realtime[_0xe5a7('0x24')]())[_0xe5a7('0x1b')](salesforce[_0xe5a7('0x25')]())['then'](realtime[_0xe5a7('0x26')]())[_0xe5a7('0x1b')](sugarcrm[_0xe5a7('0x27')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x28')]())['then'](freshdesk[_0xe5a7('0x29')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x2a')]())['then'](desk[_0xe5a7('0x2b')]())['then'](realtime[_0xe5a7('0x2c')]())[_0xe5a7('0x1b')](zoho['getZohoAccounts']())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x2d')]())[_0xe5a7('0x1b')](vtiger['getVtigerAccounts']())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x2e')]())[_0xe5a7('0x1b')](freshsales[_0xe5a7('0x2f')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x30')]())['then'](servicenow[_0xe5a7('0x31')]())[_0xe5a7('0x1b')](realtime['initServicenowAccounts']())[_0xe5a7('0x1b')](dynamics365[_0xe5a7('0x32')]())['then'](realtime['initDynamics365Accounts']())[_0xe5a7('0x1b')](campaign[_0xe5a7('0x33')]())['then'](realtime['initCampaigns']())['then'](voiceExtension[_0xe5a7('0x34')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x35')]())[_0xe5a7('0x1b')](faxAccount[_0xe5a7('0x36')]())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x37')]())[_0xe5a7('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xe5a7('0x1b')](voiceQueueReport['getVoiceQueueReports']())[_0xe5a7('0x1b')](realtime[_0xe5a7('0x38')]())[_0xe5a7('0x1b')](cmHopperHistory[_0xe5a7('0x39')]())['then'](realtime[_0xe5a7('0x3a')]())[_0xe5a7('0x1b')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime['initCampaignHopperHistory']())[_0xe5a7('0x1b')](voiceCallReport[_0xe5a7('0x3b')]())['then'](realtime['initVoiceCallReports']())[_0xe5a7('0x3c')](function(_0x417443){logger[_0xe5a7('0x3d')]('[index.js][initParams]',util[_0xe5a7('0x3e')](_0x417443,{'showHidden':![],'depth':null}));});}function main(){return server[_0xe5a7('0x3f')](realtime,preview,fax)[_0xe5a7('0x1b')](function(_0x586c13){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe5a7('0x3c')](function(_0x126df8){logger['error'](_0xe5a7('0x40'),util[_0xe5a7('0x3e')](_0x126df8,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 838330e..d540c10 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 _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x35f522,_0x4533c3){var _0x571712=function(_0x4ca2ce){while(--_0x4ca2ce){_0x35f522['push'](_0x35f522['shift']());}};_0x571712(++_0x4533c3);}(_0xe706,0xa3));var _0x6e70=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0xe706[_0x274dd7];return _0x148829;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file +var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x4b505a,_0x1bffc6){var _0x4a09f7=function(_0x56215a){while(--_0x56215a){_0x4b505a['push'](_0x4b505a['shift']());}};_0x4a09f7(++_0x1bffc6);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('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 922add6..7a164d5 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 _0x3155=['dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x39bae8,_0xee0428){var _0x47d295=function(_0x1394fa){while(--_0x1394fa){_0x39bae8['push'](_0x39bae8['shift']());}};_0x47d295(++_0xee0428);}(_0x3155,0x6c));var _0x5315=function(_0x54fbed,_0x3c77a7){_0x54fbed=_0x54fbed-0x0;var _0x333bbc=_0x3155[_0x54fbed];return _0x333bbc;};'use strict';function Campaign(_0x56eeee){this['id']=_0x56eeee['id']||0x0;this[_0x5315('0x0')]=_0x56eeee[_0x5315('0x0')]||'';this[_0x5315('0x1')]=_0x56eeee[_0x5315('0x1')]||_0x5315('0x2');this[_0x5315('0x3')]=0x0;this[_0x5315('0x4')]=0x0;this[_0x5315('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x5315('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x5315('0x7')]=_0x56eeee[_0x5315('0x7')];this[_0x5315('0x8')]=_0x56eeee[_0x5315('0x8')];this['dialTimezone']=_0x56eeee[_0x5315('0x9')]||null;this[_0x5315('0xa')]=_0x56eeee['dialGlobalInterval']?_0x56eeee[_0x5315('0xa')]:null;this[_0x5315('0xb')]=_0x56eeee['dialOriginateCallerIdName'];this[_0x5315('0xc')]=_0x56eeee[_0x5315('0xc')];this[_0x5315('0xd')]=_0x56eeee[_0x5315('0xd')]||0x1e;this[_0x5315('0xe')]=_0x56eeee[_0x5315('0xe')];this['dialCongestionRetryFrequency']=_0x56eeee[_0x5315('0xf')];this['dialBusyMaxRetry']=_0x56eeee[_0x5315('0x10')];this[_0x5315('0x11')]=_0x56eeee[_0x5315('0x11')];this[_0x5315('0x12')]=_0x56eeee[_0x5315('0x12')];this[_0x5315('0x13')]=_0x56eeee[_0x5315('0x13')];this['dialGlobalMaxRetry']=_0x56eeee[_0x5315('0x14')];this[_0x5315('0x15')]=_0x56eeee[_0x5315('0x15')]||0x3;this[_0x5315('0x16')]=_0x56eeee['dialNoSuchNumberRetryFrequency']||0x96;this[_0x5315('0x17')]=_0x56eeee[_0x5315('0x17')]||0x3;this['dialDropRetryFrequency']=_0x56eeee[_0x5315('0x18')]||0x96;this[_0x5315('0x19')]=_0x56eeee[_0x5315('0x19')]||0x3;this[_0x5315('0x1a')]=_0x56eeee[_0x5315('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x56eeee[_0x5315('0x1b')]||0x3;this['dialMachineRetryFrequency']=_0x56eeee['dialMachineRetryFrequency']||0x96;this[_0x5315('0x1c')]=_0x56eeee['dialAgentRejectMaxRetry']||0x3;this[_0x5315('0x1d')]=_0x56eeee[_0x5315('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x56eeee[_0x5315('0x1e')]||_0x5315('0x1f');this[_0x5315('0x20')]=_0x56eeee['dialPrefix']||undefined;this[_0x5315('0x21')]=_0x56eeee[_0x5315('0x21')]||undefined;this[_0x5315('0x22')]=_0x56eeee[_0x5315('0x22')]||undefined;this[_0x5315('0x23')]=_0x56eeee[_0x5315('0x23')]?_0x56eeee[_0x5315('0x23')]:undefined;this[_0x5315('0x24')]=_0x56eeee[_0x5315('0x24')]?_0x56eeee[_0x5315('0x24')]:undefined;this['Interval']=_0x56eeee[_0x5315('0x25')]?_0x56eeee[_0x5315('0x25')]:undefined;this[_0x5315('0x26')]=_0x56eeee[_0x5315('0x26')]?_0x56eeee['SquareProject']:undefined;this[_0x5315('0x27')]=_0x56eeee[_0x5315('0x26')]?_0x56eeee[_0x5315('0x26')]['name']:undefined;this[_0x5315('0x28')]=_0x56eeee[_0x5315('0x28')]||![];this[_0x5315('0x29')]=_0x56eeee['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x56eeee['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x56eeee[_0x5315('0x2a')];this[_0x5315('0x2b')]=_0x56eeee[_0x5315('0x2b')];this[_0x5315('0x2c')]=_0x56eeee[_0x5315('0x2c')];this[_0x5315('0x2d')]=_0x56eeee[_0x5315('0x2d')];this[_0x5315('0x2e')]=_0x56eeee[_0x5315('0x2e')];this[_0x5315('0x2f')]=_0x56eeee[_0x5315('0x2f')];this['dialAMDMaximumWordLength']=_0x56eeee[_0x5315('0x30')];}module[_0x5315('0x31')]=Campaign; \ No newline at end of file +var _0xcf84=['SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x1e6432,_0x32cfbd){var _0x16bc9c=function(_0x2a732b){while(--_0x2a732b){_0x1e6432['push'](_0x1e6432['shift']());}};_0x16bc9c(++_0x32cfbd);}(_0xcf84,0x1b3));var _0x4cf8=function(_0x37b2db,_0x361844){_0x37b2db=_0x37b2db-0x0;var _0x34e762=_0xcf84[_0x37b2db];return _0x34e762;};'use strict';function Campaign(_0x534b41){this['id']=_0x534b41['id']||0x0;this[_0x4cf8('0x0')]=_0x534b41[_0x4cf8('0x0')]||'';this[_0x4cf8('0x1')]=_0x534b41[_0x4cf8('0x1')]||'campaign';this['originated']=0x0;this[_0x4cf8('0x2')]=0x0;this[_0x4cf8('0x3')]=0x0;this[_0x4cf8('0x4')]=0x0;this[_0x4cf8('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0x4cf8('0x6')]=_0x534b41[_0x4cf8('0x6')];this[_0x4cf8('0x7')]=_0x534b41['limitCalls'];this['dialTimezone']=_0x534b41['dialTimezone']||null;this['dialGlobalInterval']=_0x534b41[_0x4cf8('0x8')]?_0x534b41[_0x4cf8('0x8')]:null;this[_0x4cf8('0x9')]=_0x534b41[_0x4cf8('0x9')];this[_0x4cf8('0xa')]=_0x534b41[_0x4cf8('0xa')];this[_0x4cf8('0xb')]=_0x534b41[_0x4cf8('0xb')]||0x1e;this[_0x4cf8('0xc')]=_0x534b41['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x534b41[_0x4cf8('0xd')];this['dialBusyMaxRetry']=_0x534b41['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x534b41['dialBusyRetryFrequency'];this[_0x4cf8('0xe')]=_0x534b41[_0x4cf8('0xe')];this[_0x4cf8('0xf')]=_0x534b41[_0x4cf8('0xf')];this['dialGlobalMaxRetry']=_0x534b41[_0x4cf8('0x10')];this[_0x4cf8('0x11')]=_0x534b41['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x534b41[_0x4cf8('0x12')]||0x96;this[_0x4cf8('0x13')]=_0x534b41['dialDropMaxRetry']||0x3;this[_0x4cf8('0x14')]=_0x534b41[_0x4cf8('0x14')]||0x96;this[_0x4cf8('0x15')]=_0x534b41[_0x4cf8('0x15')]||0x3;this['dialAbandonedRetryFrequency']=_0x534b41[_0x4cf8('0x16')]||0x96;this['dialMachineMaxRetry']=_0x534b41[_0x4cf8('0x17')]||0x3;this[_0x4cf8('0x18')]=_0x534b41[_0x4cf8('0x18')]||0x96;this[_0x4cf8('0x19')]=_0x534b41[_0x4cf8('0x19')]||0x3;this['dialAgentRejectRetryFrequency']=_0x534b41[_0x4cf8('0x1a')]||0x96;this['dialOrderByScheduledAt']=_0x534b41[_0x4cf8('0x1b')]||_0x4cf8('0x1c');this['dialPrefix']=_0x534b41[_0x4cf8('0x1d')]||undefined;this[_0x4cf8('0x1e')]=_0x534b41[_0x4cf8('0x1e')]||undefined;this['dialCutDigit']=_0x534b41[_0x4cf8('0x1f')]||undefined;this[_0x4cf8('0x20')]=_0x534b41[_0x4cf8('0x20')]?_0x534b41['TrunkBackup']:undefined;this[_0x4cf8('0x21')]=_0x534b41[_0x4cf8('0x21')]?_0x534b41[_0x4cf8('0x21')]:undefined;this[_0x4cf8('0x22')]=_0x534b41['Interval']?_0x534b41[_0x4cf8('0x22')]:undefined;this['SquareProject']=_0x534b41[_0x4cf8('0x23')]?_0x534b41['SquareProject']:undefined;this['dialQueueProject']=_0x534b41[_0x4cf8('0x23')]?_0x534b41[_0x4cf8('0x23')][_0x4cf8('0x0')]:undefined;this[_0x4cf8('0x24')]=_0x534b41[_0x4cf8('0x24')]||![];this[_0x4cf8('0x25')]=_0x534b41[_0x4cf8('0x25')];this[_0x4cf8('0x26')]=_0x534b41[_0x4cf8('0x26')];this[_0x4cf8('0x27')]=_0x534b41['dialAMDAfterGreetingSilence'];this[_0x4cf8('0x28')]=_0x534b41['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x534b41[_0x4cf8('0x29')];this[_0x4cf8('0x2a')]=_0x534b41[_0x4cf8('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x534b41[_0x4cf8('0x2b')];this[_0x4cf8('0x2c')]=_0x534b41[_0x4cf8('0x2c')];this['dialAMDMaximumWordLength']=_0x534b41[_0x4cf8('0x2d')];}module[_0x4cf8('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index ed7658f..2311882 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 _0x236c=['monitorFilename','monitors','transfercalleridnum','transferType','mohtime','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','billableseconds','type','tag','disposition','monitor'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x236c,0x155));var _0xc236=function(_0x2b9f28,_0x13fb9a){_0x2b9f28=_0x2b9f28-0x0;var _0xe5e43c=_0x236c[_0x2b9f28];return _0xe5e43c;};'use strict';function Channel(){this[_0xc236('0x0')]=null;this['channel']='';this[_0xc236('0x1')]='';this[_0xc236('0x2')]=0x0;this[_0xc236('0x3')]='';this[_0xc236('0x4')]=undefined;this[_0xc236('0x5')]=undefined;this['accountcode']=0x0;this[_0xc236('0x6')]='';this[_0xc236('0x7')]=0x0;this[_0xc236('0x8')]=0x0;this[_0xc236('0x9')]=0x0;this[_0xc236('0xa')]=![];this[_0xc236('0xb')]=null;this['endtime']=null;this[_0xc236('0xc')]=![];this[_0xc236('0xd')]=![];this['lastapplication']='';this['lastdata']='';this['duration']=0x0;this[_0xc236('0xe')]=0x0;this['holdtime']=0x0;this[_0xc236('0xf')]=null;this[_0xc236('0x10')]=null;this[_0xc236('0x11')]=null;this[_0xc236('0x12')]=![];this[_0xc236('0x13')]=null;this['queue']=null;this[_0xc236('0x14')]=[];this[_0xc236('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xc236('0x16')]=undefined;this[_0xc236('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x3e2a=['accountcode','context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','holdtime','type','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x3031b4,_0x181731){var _0x2c8161=function(_0x3eb5e5){while(--_0x3eb5e5){_0x3031b4['push'](_0x3031b4['shift']());}};_0x2c8161(++_0x181731);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x403062,_0x4a6cef){_0x403062=_0x403062-0x0;var _0x4a9249=_0x3e2a[_0x403062];return _0x4a9249;};'use strict';function Channel(){this[_0xa3e2('0x0')]=null;this[_0xa3e2('0x1')]='';this[_0xa3e2('0x2')]='';this[_0xa3e2('0x3')]=0x0;this[_0xa3e2('0x4')]='';this[_0xa3e2('0x5')]=undefined;this[_0xa3e2('0x6')]=undefined;this[_0xa3e2('0x7')]=0x0;this[_0xa3e2('0x8')]='';this['uniqueid']=0x0;this[_0xa3e2('0x9')]=0x0;this['exten']=0x0;this[_0xa3e2('0xa')]=![];this[_0xa3e2('0xb')]=null;this[_0xa3e2('0xc')]=null;this[_0xa3e2('0xd')]=![];this[_0xa3e2('0xe')]=![];this['lastapplication']='';this[_0xa3e2('0xf')]='';this[_0xa3e2('0x10')]=0x0;this['billableseconds']=0x0;this[_0xa3e2('0x11')]=0x0;this[_0xa3e2('0x12')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0xa3e2('0x13')]=null;this[_0xa3e2('0x14')]=null;this[_0xa3e2('0x15')]=[];this['transfercalleridnum']=undefined;this[_0xa3e2('0x16')]=undefined;this[_0xa3e2('0x17')]=undefined;this[_0xa3e2('0x18')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index df9bdc3..f2a833c 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 _0x939c=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x939c,0xea));var _0xc939=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x939c[_0x35885a];return _0xe86249;};'use strict';function DeskAccount(_0x536b2f){this['id']=_0x536b2f['id']||0x0;this[_0xc939('0x0')]=_0x536b2f[_0xc939('0x0')]||'';this[_0xc939('0x1')]=_0x536b2f[_0xc939('0x1')]||'';this[_0xc939('0x2')]=_0x536b2f[_0xc939('0x2')]||'';this['authType']=_0x536b2f[_0xc939('0x3')]||'';this[_0xc939('0x4')]=_0x536b2f[_0xc939('0x4')]||'';this['consumerKey']=_0x536b2f[_0xc939('0x5')]||'';this['consumerSecret']=_0x536b2f[_0xc939('0x6')]||'';this['token']=_0x536b2f[_0xc939('0x7')]||'';this['tokenSecret']=_0x536b2f[_0xc939('0x8')]||'';this[_0xc939('0x9')]=_0x536b2f[_0xc939('0x9')]||'';this[_0xc939('0xa')]=_0x536b2f[_0xc939('0xa')]||'';this[_0xc939('0xb')]=_0x536b2f['Configurations']||{};}module[_0xc939('0xc')]=DeskAccount; \ No newline at end of file +var _0xbabc=['consumerSecret','tokenSecret','serverUrl','name','username','remoteUri','authType','password','consumerKey'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xbabc,0x1ce));var _0xcbab=function(_0x4f2654,_0xddb1ad){_0x4f2654=_0x4f2654-0x0;var _0x3858b6=_0xbabc[_0x4f2654];return _0x3858b6;};'use strict';function DeskAccount(_0x4b79ad){this['id']=_0x4b79ad['id']||0x0;this[_0xcbab('0x0')]=_0x4b79ad[_0xcbab('0x0')]||'';this[_0xcbab('0x1')]=_0x4b79ad[_0xcbab('0x1')]||'';this[_0xcbab('0x2')]=_0x4b79ad[_0xcbab('0x2')]||'';this[_0xcbab('0x3')]=_0x4b79ad['authType']||'';this['password']=_0x4b79ad[_0xcbab('0x4')]||'';this[_0xcbab('0x5')]=_0x4b79ad[_0xcbab('0x5')]||'';this[_0xcbab('0x6')]=_0x4b79ad[_0xcbab('0x6')]||'';this['token']=_0x4b79ad['token']||'';this[_0xcbab('0x7')]=_0x4b79ad['tokenSecret']||'';this['type']=_0x4b79ad['type']||'';this[_0xcbab('0x8')]=_0x4b79ad['serverUrl']||'';this['Configurations']=_0x4b79ad['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 4705343..45bda23 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 _0xce50=['remoteUri','tenantId','clientId','clientSecret','modernAuthentication','Configurations','CloudProvider','name','username','password'];(function(_0x1036af,_0x32a708){var _0x407e88=function(_0x1cb598){while(--_0x1cb598){_0x1036af['push'](_0x1036af['shift']());}};_0x407e88(++_0x32a708);}(_0xce50,0x1d3));var _0x0ce5=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xce50[_0x2dadb9];return _0x2f0097;};'use strict';function Dynamics365Account(_0x1a5785){this['id']=_0x1a5785['id']||0x0;this['name']=_0x1a5785[_0x0ce5('0x0')]||'';this[_0x0ce5('0x1')]=_0x1a5785[_0x0ce5('0x1')]||'';this[_0x0ce5('0x2')]=_0x1a5785[_0x0ce5('0x2')]||'';this[_0x0ce5('0x3')]=_0x1a5785[_0x0ce5('0x3')]||'';this['tenantId']=_0x1a5785[_0x0ce5('0x4')]||'';this[_0x0ce5('0x5')]=_0x1a5785[_0x0ce5('0x5')]||'';this[_0x0ce5('0x6')]=_0x1a5785[_0x0ce5('0x6')]||{};this['serverUrl']=_0x1a5785['serverUrl']||'';this[_0x0ce5('0x7')]=_0x1a5785[_0x0ce5('0x7')]||![];this['Configurations']=_0x1a5785[_0x0ce5('0x8')]||{};this[_0x0ce5('0x9')]=_0x1a5785[_0x0ce5('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x0269=['remoteUri','tenantId','clientId','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x2e1eb2,_0x529965){var _0x2ea9b1=function(_0x1ee5ca){while(--_0x1ee5ca){_0x2e1eb2['push'](_0x2e1eb2['shift']());}};_0x2ea9b1(++_0x529965);}(_0x0269,0x17e));var _0x9026=function(_0x4d98bb,_0x46b661){_0x4d98bb=_0x4d98bb-0x0;var _0xae2480=_0x0269[_0x4d98bb];return _0xae2480;};'use strict';function Dynamics365Account(_0x354f9e){this['id']=_0x354f9e['id']||0x0;this[_0x9026('0x0')]=_0x354f9e[_0x9026('0x0')]||'';this[_0x9026('0x1')]=_0x354f9e['username']||'';this[_0x9026('0x2')]=_0x354f9e[_0x9026('0x2')]||'';this[_0x9026('0x3')]=_0x354f9e[_0x9026('0x3')]||'';this[_0x9026('0x4')]=_0x354f9e[_0x9026('0x4')]||'';this['clientId']=_0x354f9e[_0x9026('0x5')]||'';this['clientSecret']=_0x354f9e['clientSecret']||{};this[_0x9026('0x6')]=_0x354f9e[_0x9026('0x6')]||'';this[_0x9026('0x7')]=_0x354f9e['modernAuthentication']||![];this[_0x9026('0x8')]=_0x354f9e['Configurations']||{};this[_0x9026('0x9')]=_0x354f9e[_0x9026('0x9')]||{};}module[_0x9026('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 6a7b324..71e31f6 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 _0x5c21=['exports','name','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key'];(function(_0x38a8a7,_0xb6afd4){var _0x57011a=function(_0x239d9a){while(--_0x239d9a){_0x38a8a7['push'](_0x38a8a7['shift']());}};_0x57011a(++_0xb6afd4);}(_0x5c21,0x1b1));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x4bf8b3){this['id']=_0x4bf8b3['id']||0x0;this[_0x15c2('0x0')]=_0x4bf8b3[_0x15c2('0x0')]||'';this[_0x15c2('0x1')]=_0x4bf8b3[_0x15c2('0x1')];this[_0x15c2('0x2')]=_0x4bf8b3[_0x15c2('0x2')];this['headerinfo']=_0x4bf8b3['headerinfo'];this['localstationid']=_0x4bf8b3[_0x15c2('0x3')];this[_0x15c2('0x4')]=_0x4bf8b3[_0x15c2('0x4')]||0x960;this[_0x15c2('0x5')]=_0x4bf8b3[_0x15c2('0x5')]||0x3840;this[_0x15c2('0x6')]=_0x4bf8b3['modem']||_0x15c2('0x7');this[_0x15c2('0x8')]=_0x4bf8b3[_0x15c2('0x8')]||'no';this[_0x15c2('0x9')]=_0x4bf8b3[_0x15c2('0x9')]||'no';this[_0x15c2('0xa')]=_0x4bf8b3[_0x15c2('0xa')]||0x1388;this[_0x15c2('0xb')]=_0x4bf8b3['tech']||'SIP';this['Trunk']=_0x4bf8b3[_0x15c2('0xc')]?_0x4bf8b3[_0x15c2('0xc')]:undefined;this['ListId']=_0x4bf8b3[_0x15c2('0xd')];this[_0x15c2('0xe')]=_0x4bf8b3['key'];}module[_0x15c2('0xf')]=FaxAccount; \ No newline at end of file +var _0x1a37=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','tech','SIP','Trunk','key','exports'];(function(_0x384501,_0x3fe787){var _0x2d92c6=function(_0x11f336){while(--_0x11f336){_0x384501['push'](_0x384501['shift']());}};_0x2d92c6(++_0x3fe787);}(_0x1a37,0xb4));var _0x71a3=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x1a37[_0x58afd5];return _0x3e503b;};'use strict';function FaxAccount(_0x30aa15){this['id']=_0x30aa15['id']||0x0;this[_0x71a3('0x0')]=_0x30aa15[_0x71a3('0x0')]||'';this[_0x71a3('0x1')]=_0x30aa15[_0x71a3('0x1')];this[_0x71a3('0x2')]=_0x30aa15[_0x71a3('0x2')];this[_0x71a3('0x3')]=_0x30aa15[_0x71a3('0x3')];this[_0x71a3('0x4')]=_0x30aa15['localstationid'];this[_0x71a3('0x5')]=_0x30aa15['minrate']||0x960;this[_0x71a3('0x6')]=_0x30aa15[_0x71a3('0x6')]||0x3840;this[_0x71a3('0x7')]=_0x30aa15[_0x71a3('0x7')]||'v17,v27,v29';this['gateway']=_0x30aa15['gateway']||'no';this['faxdetect']=_0x30aa15[_0x71a3('0x8')]||'no';this[_0x71a3('0x9')]=_0x30aa15[_0x71a3('0x9')]||0x1388;this[_0x71a3('0xa')]=_0x30aa15[_0x71a3('0xa')]||_0x71a3('0xb');this[_0x71a3('0xc')]=_0x30aa15[_0x71a3('0xc')]?_0x30aa15['Trunk']:undefined;this['ListId']=_0x30aa15['ListId'];this[_0x71a3('0xd')]=_0x30aa15[_0x71a3('0xd')];}module[_0x71a3('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 7a2559b..d10f148 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 _0xbcae=['token','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x52cb1e,_0xb8de51){var _0x43cdda=function(_0x2084e7){while(--_0x2084e7){_0x52cb1e['push'](_0x52cb1e['shift']());}};_0x43cdda(++_0xb8de51);}(_0xbcae,0x131));var _0xebca=function(_0x351ee4,_0x2bfe3d){_0x351ee4=_0x351ee4-0x0;var _0x1d2e57=_0xbcae[_0x351ee4];return _0x1d2e57;};'use strict';function FreshdeskAccount(_0x223238){this['id']=_0x223238['id']||0x0;this['name']=_0x223238['name']||'';this['username']=_0x223238[_0xebca('0x0')]||'';this['apiKey']=_0x223238[_0xebca('0x1')]||'';this['remoteUri']=_0x223238[_0xebca('0x2')]||'';this['serverUrl']=_0x223238[_0xebca('0x3')]||'';this['Configurations']=_0x223238[_0xebca('0x4')]||{};}module[_0xebca('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x2dca=['serverUrl','exports','name','username','apiKey','token','remoteUri'];(function(_0x32ca69,_0x389a20){var _0x1d9e01=function(_0x1af6a1){while(--_0x1af6a1){_0x32ca69['push'](_0x32ca69['shift']());}};_0x1d9e01(++_0x389a20);}(_0x2dca,0x1c9));var _0xa2dc=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x2dca[_0x163040];return _0x364667;};'use strict';function FreshdeskAccount(_0x4a6fb4){this['id']=_0x4a6fb4['id']||0x0;this['name']=_0x4a6fb4[_0xa2dc('0x0')]||'';this[_0xa2dc('0x1')]=_0x4a6fb4[_0xa2dc('0x1')]||'';this[_0xa2dc('0x2')]=_0x4a6fb4[_0xa2dc('0x3')]||'';this[_0xa2dc('0x4')]=_0x4a6fb4[_0xa2dc('0x4')]||'';this['serverUrl']=_0x4a6fb4[_0xa2dc('0x5')]||'';this['Configurations']=_0x4a6fb4['Configurations']||{};}module[_0xa2dc('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3fd60fc..e3a51ed 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 _0x5e17=['serverUrl','Configurations','exports','token','remoteUri'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5e17,0x17a));var _0x75e1=function(_0x16ef1f,_0x1bb9fa){_0x16ef1f=_0x16ef1f-0x0;var _0x20155c=_0x5e17[_0x16ef1f];return _0x20155c;};'use strict';function FreshsalesAccount(_0x5b83b9){this['id']=_0x5b83b9['id']||0x0;this['name']=_0x5b83b9['name']||'';this['username']=_0x5b83b9['username']||'';this['apiKey']=_0x5b83b9[_0x75e1('0x0')]||'';this[_0x75e1('0x1')]=_0x5b83b9[_0x75e1('0x1')]||'';this[_0x75e1('0x2')]=_0x5b83b9[_0x75e1('0x2')]||'';this[_0x75e1('0x3')]=_0x5b83b9[_0x75e1('0x3')]||{};}module[_0x75e1('0x4')]=FreshsalesAccount; \ No newline at end of file +var _0x425d=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x425d,0x1e0));var _0xd425=function(_0x5568ed,_0x61f3be){_0x5568ed=_0x5568ed-0x0;var _0x406c98=_0x425d[_0x5568ed];return _0x406c98;};'use strict';function FreshsalesAccount(_0x20c3d2){this['id']=_0x20c3d2['id']||0x0;this['name']=_0x20c3d2[_0xd425('0x0')]||'';this[_0xd425('0x1')]=_0x20c3d2[_0xd425('0x1')]||'';this[_0xd425('0x2')]=_0x20c3d2[_0xd425('0x3')]||'';this[_0xd425('0x4')]=_0x20c3d2[_0xd425('0x4')]||'';this['serverUrl']=_0x20c3d2[_0xd425('0x5')]||'';this[_0xd425('0x6')]=_0x20c3d2[_0xd425('0x6')]||{};}module[_0xd425('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 10aa28b..fc9dfc2 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 _0x6eb2=['priority','assigned','motionChannel','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum'];(function(_0x569acf,_0x163f90){var _0x2fc12f=function(_0x3f75cc){while(--_0x3f75cc){_0x569acf['push'](_0x569acf['shift']());}};_0x2fc12f(++_0x163f90);}(_0x6eb2,0x95));var _0x26eb=function(_0x3ebe6b,_0x50bbf7){_0x3ebe6b=_0x3ebe6b-0x0;var _0x334cfc=_0x6eb2[_0x3ebe6b];return _0x334cfc;};'use strict';function QueueReport(){this['type']=_0x26eb('0x0');this[_0x26eb('0x1')]='';this[_0x26eb('0x2')]='';this[_0x26eb('0x3')]='';this[_0x26eb('0x4')]='';this[_0x26eb('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x26eb('0x6')]=0x1;this[_0x26eb('0x7')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x26eb('0x8')]=![];this[_0x26eb('0x9')]=null;this['queuecallerexit']=![];this[_0x26eb('0xa')]=null;this['originalposition']=0x1;this[_0x26eb('0xb')]='';this[_0x26eb('0xc')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this['exten']='';this[_0x26eb('0xd')]='';this['holdtime']=0x0;this[_0x26eb('0xe')]=![];this['lastAssignedTo']='';this[_0x26eb('0xf')]='voice';this['mohtime']=0x0;this[_0x26eb('0x10')]={};}module[_0x26eb('0x11')]=QueueReport; \ No newline at end of file +var _0x2321=['position','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x557f0a,_0x14250c){var _0x9a5663=function(_0x2657d8){while(--_0x2657d8){_0x557f0a['push'](_0x557f0a['shift']());}};_0x9a5663(++_0x14250c);}(_0x2321,0x90));var _0x1232=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x2321[_0x87b0ff];return _0x3bc0b2;};'use strict';function QueueReport(){this[_0x1232('0x0')]=_0x1232('0x1');this['uniqueid']='';this[_0x1232('0x2')]='';this['calleridname']='';this[_0x1232('0x3')]='';this[_0x1232('0x4')]=null;this[_0x1232('0x5')]=null;this[_0x1232('0x6')]=0x1;this['count']=0x1;this[_0x1232('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x1232('0x8')]=![];this[_0x1232('0x9')]=null;this[_0x1232('0xa')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0x1232('0xb')]='';this[_0x1232('0xc')]='';this[_0x1232('0xd')]='';this[_0x1232('0xe')]='';this['context']='';this[_0x1232('0xf')]='';this[_0x1232('0x10')]='';this[_0x1232('0x11')]=0x0;this[_0x1232('0x12')]=![];this[_0x1232('0x13')]='';this[_0x1232('0x14')]=_0x1232('0x15');this[_0x1232('0x16')]=0x0;this[_0x1232('0x17')]={};}module[_0x1232('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4e381f0..bb48296 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 _0x7a55=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId'];(function(_0x4672e9,_0x5caff9){var _0x2407fd=function(_0x41bd9e){while(--_0x41bd9e){_0x4672e9['push'](_0x4672e9['shift']());}};_0x2407fd(++_0x5caff9);}(_0x7a55,0xcc));var _0x57a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a55[_0x20a584];return _0x4b41a8;};'use strict';function SalesforceAccount(_0x495f13){this['id']=_0x495f13['id']||0x0;this[_0x57a5('0x0')]=_0x495f13[_0x57a5('0x0')]||'';this[_0x57a5('0x1')]=_0x495f13[_0x57a5('0x1')]||'';this[_0x57a5('0x2')]=_0x495f13['remoteUri']||'';this[_0x57a5('0x3')]=_0x495f13[_0x57a5('0x3')]||'';this[_0x57a5('0x4')]=_0x495f13['clientId']||'';this['clientSecret']=_0x495f13[_0x57a5('0x5')]||'';this['securityToken']=_0x495f13[_0x57a5('0x6')]||'';this['type']=_0x495f13[_0x57a5('0x7')]||_0x57a5('0x8');this[_0x57a5('0x9')]=_0x495f13['serverUrl']||'';this[_0x57a5('0xa')]=_0x495f13[_0x57a5('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x553a=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x1481fe,_0x3e3aba){var _0x331c93=function(_0x42ce62){while(--_0x42ce62){_0x1481fe['push'](_0x1481fe['shift']());}};_0x331c93(++_0x3e3aba);}(_0x553a,0x141));var _0xa553=function(_0x5d6270,_0x83b57a){_0x5d6270=_0x5d6270-0x0;var _0x168f26=_0x553a[_0x5d6270];return _0x168f26;};'use strict';function SalesforceAccount(_0x5c764b){this['id']=_0x5c764b['id']||0x0;this[_0xa553('0x0')]=_0x5c764b[_0xa553('0x0')]||'';this[_0xa553('0x1')]=_0x5c764b[_0xa553('0x1')]||'';this[_0xa553('0x2')]=_0x5c764b[_0xa553('0x2')]||'';this[_0xa553('0x3')]=_0x5c764b[_0xa553('0x3')]||'';this['clientId']=_0x5c764b[_0xa553('0x4')]||'';this['clientSecret']=_0x5c764b[_0xa553('0x5')]||'';this[_0xa553('0x6')]=_0x5c764b['securityToken']||'';this[_0xa553('0x7')]=_0x5c764b['type']||_0xa553('0x8');this[_0xa553('0x9')]=_0x5c764b['serverUrl']||'';this[_0xa553('0xa')]=_0x5c764b[_0xa553('0xa')]||{};}module[_0xa553('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 41baf17..88a2eaa 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 _0xae17=['serverUrl','username','password','remoteUri'];(function(_0x47bfee,_0x112b73){var _0x2feb04=function(_0xf626ff){while(--_0xf626ff){_0x47bfee['push'](_0x47bfee['shift']());}};_0x2feb04(++_0x112b73);}(_0xae17,0x13d));var _0x7ae1=function(_0x2d6d36,_0x242e94){_0x2d6d36=_0x2d6d36-0x0;var _0x42dc7e=_0xae17[_0x2d6d36];return _0x42dc7e;};'use strict';function ServicenowAccount(_0x424035){this['id']=_0x424035['id']||0x0;this['name']=_0x424035['name']||'';this[_0x7ae1('0x0')]=_0x424035[_0x7ae1('0x0')]||'';this['password']=_0x424035[_0x7ae1('0x1')]||'';this[_0x7ae1('0x2')]=_0x424035['remoteUri']||'';this[_0x7ae1('0x3')]=_0x424035[_0x7ae1('0x3')]||'';this['Configurations']=_0x424035['Configurations']||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xc296=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2b7f97,_0x3fe5c6){var _0x3c2339=function(_0x12e36c){while(--_0x12e36c){_0x2b7f97['push'](_0x2b7f97['shift']());}};_0x3c2339(++_0x3fe5c6);}(_0xc296,0x1cc));var _0x6c29=function(_0x5c0578,_0x2525e5){_0x5c0578=_0x5c0578-0x0;var _0x1896e4=_0xc296[_0x5c0578];return _0x1896e4;};'use strict';function ServicenowAccount(_0x4ef5b6){this['id']=_0x4ef5b6['id']||0x0;this[_0x6c29('0x0')]=_0x4ef5b6['name']||'';this[_0x6c29('0x1')]=_0x4ef5b6[_0x6c29('0x1')]||'';this[_0x6c29('0x2')]=_0x4ef5b6['password']||'';this[_0x6c29('0x3')]=_0x4ef5b6[_0x6c29('0x3')]||'';this['serverUrl']=_0x4ef5b6[_0x6c29('0x4')]||'';this[_0x6c29('0x5')]=_0x4ef5b6[_0x6c29('0x5')]||{};}module[_0x6c29('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 0057307..06ffa82 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 _0xb186=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0xcd241c,_0x32e173){var _0x3b838a=function(_0x443d0e){while(--_0x443d0e){_0xcd241c['push'](_0xcd241c['shift']());}};_0x3b838a(++_0x32e173);}(_0xb186,0x10e));var _0x6b18=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xb186[_0x2e6dbf];return _0x2680e5;};'use strict';function SugarcrmAccount(_0x36b0d8){this['id']=_0x36b0d8['id']||0x0;this[_0x6b18('0x0')]=_0x36b0d8['name']||'';this['username']=_0x36b0d8[_0x6b18('0x1')]||'';this[_0x6b18('0x2')]=_0x36b0d8['password']||'';this[_0x6b18('0x3')]=_0x36b0d8[_0x6b18('0x3')]||'';this[_0x6b18('0x4')]=_0x36b0d8[_0x6b18('0x4')]||'';this[_0x6b18('0x5')]=_0x36b0d8[_0x6b18('0x5')]||{};}module[_0x6b18('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x3e65=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x12f4d3,_0x20d5df){var _0xa61b38=function(_0x2f1956){while(--_0x2f1956){_0x12f4d3['push'](_0x12f4d3['shift']());}};_0xa61b38(++_0x20d5df);}(_0x3e65,0x102));var _0x53e6=function(_0x30d3e7,_0x477d6b){_0x30d3e7=_0x30d3e7-0x0;var _0x282ce0=_0x3e65[_0x30d3e7];return _0x282ce0;};'use strict';function SugarcrmAccount(_0x3afca7){this['id']=_0x3afca7['id']||0x0;this[_0x53e6('0x0')]=_0x3afca7[_0x53e6('0x0')]||'';this[_0x53e6('0x1')]=_0x3afca7['username']||'';this[_0x53e6('0x2')]=_0x3afca7[_0x53e6('0x2')]||'';this[_0x53e6('0x3')]=_0x3afca7[_0x53e6('0x3')]||'';this[_0x53e6('0x4')]=_0x3afca7[_0x53e6('0x4')]||'';this['Configurations']=_0x3afca7[_0x53e6('0x5')]||{};}module[_0x53e6('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 18d8f80..53068e4 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 _0x9d26=['status','address','exports','name','accountcode','state','unknown'];(function(_0x4bacb1,_0x251bda){var _0x471154=function(_0x45cdec){while(--_0x45cdec){_0x4bacb1['push'](_0x4bacb1['shift']());}};_0x471154(++_0x251bda);}(_0x9d26,0x17d));var _0x69d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d26[_0x321bb2];return _0x9c12ed;};'use strict';function Telephone(_0x531af6){this['id']=_0x531af6['id']||0x0;this['name']=_0x531af6[_0x69d2('0x0')]||'';this[_0x69d2('0x1')]=_0x531af6[_0x69d2('0x1')]||'';this[_0x69d2('0x2')]=_0x69d2('0x3');this['stateTime']=0x0;this[_0x69d2('0x4')]='unknown';this[_0x69d2('0x5')]='';}module[_0x69d2('0x6')]=Telephone; \ No newline at end of file +var _0x907e=['address','exports','accountcode','unknown','stateTime','status'];(function(_0x5e95b9,_0x26e44e){var _0x30d162=function(_0x38627b){while(--_0x38627b){_0x5e95b9['push'](_0x5e95b9['shift']());}};_0x30d162(++_0x26e44e);}(_0x907e,0xc8));var _0xe907=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x907e[_0x30c7c5];return _0x29e24e;};'use strict';function Telephone(_0x2e36ba){this['id']=_0x2e36ba['id']||0x0;this['name']=_0x2e36ba['name']||'';this[_0xe907('0x0')]=_0x2e36ba[_0xe907('0x0')]||'';this['state']=_0xe907('0x1');this[_0xe907('0x2')]=0x0;this[_0xe907('0x3')]=_0xe907('0x1');this[_0xe907('0x4')]='';}module[_0xe907('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index a9c6f68..a9d7eba 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(_0x7eab16,_0x2a7291){var _0x39559a=function(_0x55d1b2){while(--_0x55d1b2){_0x7eab16['push'](_0x7eab16['shift']());}};_0x39559a(++_0x2a7291);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0xebab8b,_0x17f2b3){var _0x40e80f=function(_0x450f0e){while(--_0x450f0e){_0xebab8b['push'](_0xebab8b['shift']());}};_0x40e80f(++_0x17f2b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ea183,_0x3cff11){_0x2ea183=_0x2ea183-0x0;var _0x47c16c=_0xb10b[_0x2ea183];return _0x47c16c;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 7f67697..572c8df 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x3e2584,_0x5408a0){var _0x579a52=function(_0x555591){while(--_0x555591){_0x3e2584['push'](_0x3e2584['shift']());}};_0x579a52(++_0x5408a0);}(_0xda3f,0xec));var _0xfda3=function(_0x1a4e86,_0x2d3729){_0x1a4e86=_0x1a4e86-0x0;var _0x1d4b29=_0xda3f[_0x1a4e86];return _0x1d4b29;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x50e55a,_0x337b39){var _0x1f9018=function(_0x5e1742){while(--_0x5e1742){_0x50e55a['push'](_0x50e55a['shift']());}};_0x1f9018(++_0x337b39);}(_0x757a,0xde));var _0xa757=function(_0x5bd610,_0x2b11ba){_0x5bd610=_0x5bd610-0x0;var _0x196ae0=_0x757a[_0x5bd610];return _0x196ae0;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1ccd492..da7e7a6 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 _0xc780=['split','host','port','domain','domainport','refresh','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x57800a,_0x31a489){var _0x4ad8dd=function(_0x4a9bc1){while(--_0x4a9bc1){_0x57800a['push'](_0x57800a['shift']());}};_0x4ad8dd(++_0x31a489);}(_0xc780,0x158));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';function Trunk(_0x2cab76){this['id']=_0x2cab76['id']||0x0;this[_0x0c78('0x0')]=_0x2cab76[_0x0c78('0x0')]||![];this[_0x0c78('0x1')]=_0x2cab76[_0x0c78('0x1')]||'';this[_0x0c78('0x2')]=_0x0c78('0x3');this[_0x0c78('0x4')]=0x0;this[_0x0c78('0x5')]='unknown';this[_0x0c78('0x6')]=_0x2cab76[_0x0c78('0x6')]&&_0x2cab76['registry'][_0x0c78('0x7')](':')?_0x2cab76['registry'][_0x0c78('0x8')](':')[0x0]:'';this[_0x0c78('0x9')]='';this[_0x0c78('0xa')]='';this[_0x0c78('0xb')]='';this[_0x0c78('0xc')]='';this[_0x0c78('0xd')]='';this['stateRegistry']=_0x0c78('0x3');this['registrationtime']='';this['address']='';this[_0x0c78('0xe')]=_0x2cab76[_0x0c78('0xe')]||'';}module[_0x0c78('0xf')]=Trunk; \ No newline at end of file +var _0xc055=['domain','domainport','refresh','stateRegistry','address','defaultuser','active','state','unknown','stateTime','registry','indexOf','port'];(function(_0x116504,_0x30e7c9){var _0x80d529=function(_0x925edf){while(--_0x925edf){_0x116504['push'](_0x116504['shift']());}};_0x80d529(++_0x30e7c9);}(_0xc055,0xe3));var _0x5c05=function(_0x4acb9d,_0x28894b){_0x4acb9d=_0x4acb9d-0x0;var _0x252ccb=_0xc055[_0x4acb9d];return _0x252ccb;};'use strict';function Trunk(_0x563f88){this['id']=_0x563f88['id']||0x0;this[_0x5c05('0x0')]=_0x563f88[_0x5c05('0x0')]||![];this['name']=_0x563f88['name']||'';this[_0x5c05('0x1')]=_0x5c05('0x2');this[_0x5c05('0x3')]=0x0;this['status']=_0x5c05('0x2');this[_0x5c05('0x4')]=_0x563f88[_0x5c05('0x4')]&&_0x563f88[_0x5c05('0x4')][_0x5c05('0x5')](':')?_0x563f88[_0x5c05('0x4')]['split'](':')[0x0]:'';this['host']='';this[_0x5c05('0x6')]='';this[_0x5c05('0x7')]='';this[_0x5c05('0x8')]='';this[_0x5c05('0x9')]='';this[_0x5c05('0xa')]=_0x5c05('0x2');this['registrationtime']='';this[_0x5c05('0xb')]='';this[_0x5c05('0xc')]=_0x563f88[_0x5c05('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index afdaf21..b2eee83 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 _0xdde2=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0xdde2,0x11f));var _0x2dde=function(_0xc6f023,_0x41987a){_0xc6f023=_0xc6f023-0x0;var _0x379055=_0xdde2[_0xc6f023];return _0x379055;};'use strict';function voiceExtension(_0x18f260){this['id']=_0x18f260['id']||0x0;this[_0x2dde('0x0')]=_0x18f260[_0x2dde('0x0')]||'';this[_0x2dde('0x1')]=_0x18f260[_0x2dde('0x1')]||_0x2dde('0x2');this[_0x2dde('0x3')]=_0x18f260['mandatoryDisposition']||![];}module[_0x2dde('0x4')]=voiceExtension; \ No newline at end of file +var _0x8eb7=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x487ae6,_0x3580e3){var _0x1c72c8=function(_0x408d16){while(--_0x408d16){_0x487ae6['push'](_0x487ae6['shift']());}};_0x1c72c8(++_0x3580e3);}(_0x8eb7,0xfb));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x7de6cb){this['id']=_0x7de6cb['id']||0x0;this['exten']=_0x7de6cb[_0x78eb('0x0')]||'';this[_0x78eb('0x1')]=_0x7de6cb['recordingFormat']||_0x78eb('0x2');this[_0x78eb('0x3')]=_0x7de6cb[_0x78eb('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 102514b..01427d9 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 _0xa88f=['abandoned','available','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged'];(function(_0x106bfd,_0x5acbdb){var _0x53909b=function(_0x3f6500){while(--_0x3f6500){_0x106bfd['push'](_0x106bfd['shift']());}};_0x53909b(++_0x5acbdb);}(_0xa88f,0xdc));var _0xfa88=function(_0x8203cf,_0x363b37){_0x8203cf=_0x8203cf-0x0;var _0x3c70f0=_0xa88f[_0x8203cf];return _0x3c70f0;};'use strict';var statusDesc=['unknown',_0xfa88('0x0'),'inuse',_0xfa88('0x1'),_0xfa88('0x2'),'unavailable',_0xfa88('0x3'),_0xfa88('0x4'),_0xfa88('0x5')];var monitorFormat={'wav':_0xfa88('0x6'),'wav49':'wav49','gsm':_0xfa88('0x7')};var strategy={'rrmemory':_0xfa88('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x13d27d){this['id']=_0x13d27d['id']||0x0;this['name']=_0x13d27d[_0xfa88('0x9')]||'';this[_0xfa88('0xa')]=_0x13d27d[_0xfa88('0xa')]||'';this[_0xfa88('0xb')]=_0x13d27d[_0xfa88('0xb')]||_0xfa88('0xc');this['waiting']=0x0;this[_0xfa88('0xd')]=0x0;this[_0xfa88('0xe')]=0x0;this[_0xfa88('0xf')]=0x0;this[_0xfa88('0x10')]=0x0;this[_0xfa88('0x11')]=0x0;this[_0xfa88('0x12')]=0x0;this[_0xfa88('0x13')]=0x0;this[_0xfa88('0x14')]=0x0;this['loggedIn']=0x0;this[_0xfa88('0x15')]=0x0;this['acw']=_0x13d27d['acw']||![];this[_0xfa88('0x16')]=_0x13d27d[_0xfa88('0x16')]||0xa;this[_0xfa88('0x17')]=_0x13d27d[_0xfa88('0x17')]||'no';this[_0xfa88('0x18')]=!![];this[_0xfa88('0x19')]='';this['originated']=0x0;this['temp']=0x0;this[_0xfa88('0x1a')]=_0x13d27d[_0xfa88('0x1a')]||null;this[_0xfa88('0x1b')]=_0x13d27d[_0xfa88('0x1b')]?_0x13d27d['dialGlobalInterval']:null;this[_0xfa88('0x1c')]=_0x13d27d['dialActive'];this['dialMethod']=_0x13d27d[_0xfa88('0x1d')]||_0xfa88('0x1e');this['dialLimitChannel']=_0x13d27d[_0xfa88('0x1f')]||0x0;this[_0xfa88('0x20')]=_0x13d27d[_0xfa88('0x20')]||0x0;this[_0xfa88('0x21')]=_0x13d27d['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x13d27d[_0xfa88('0x22')]||'dropRate';this[_0xfa88('0x23')]=_0x13d27d[_0xfa88('0x23')]||0.03;this[_0xfa88('0x24')]=_0x13d27d[_0xfa88('0x24')]||0x258;this[_0xfa88('0x25')]=_0x13d27d[_0xfa88('0x25')]||_0xfa88('0x26');this[_0xfa88('0x27')]=_0x13d27d[_0xfa88('0x27')]||_0xfa88('0x26');this[_0xfa88('0x28')]=_0x13d27d[_0xfa88('0x28')]||0x1e;this[_0xfa88('0x29')]=_0x13d27d['dialQueueOptions']||_0xfa88('0x2a');this[_0xfa88('0x2b')]=_0x13d27d[_0xfa88('0x2b')]||0x3;this[_0xfa88('0x2c')]=_0x13d27d[_0xfa88('0x2c')]||undefined;this[_0xfa88('0x2d')]=_0x13d27d[_0xfa88('0x2d')]||0x3;this[_0xfa88('0x2e')]=_0x13d27d[_0xfa88('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x13d27d['dialBusyMaxRetry']||0x3;this[_0xfa88('0x2f')]=_0x13d27d[_0xfa88('0x2f')]||0x96;this[_0xfa88('0x30')]=_0x13d27d['dialNoAnswerMaxRetry']||0x3;this[_0xfa88('0x31')]=_0x13d27d[_0xfa88('0x31')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x13d27d['dialNoSuchNumberMaxRetry']||0x3;this[_0xfa88('0x32')]=_0x13d27d[_0xfa88('0x32')]||0x96;this[_0xfa88('0x33')]=_0x13d27d[_0xfa88('0x33')]||0x3;this[_0xfa88('0x34')]=_0x13d27d[_0xfa88('0x34')]||0x96;this[_0xfa88('0x35')]=_0x13d27d[_0xfa88('0x35')]||0x3;this[_0xfa88('0x36')]=_0x13d27d['dialAbandonedRetryFrequency']||0x96;this[_0xfa88('0x37')]=_0x13d27d[_0xfa88('0x37')]||0x3;this['dialMachineRetryFrequency']=_0x13d27d[_0xfa88('0x38')]||0x96;this[_0xfa88('0x39')]=_0x13d27d[_0xfa88('0x39')]||0x3;this[_0xfa88('0x3a')]=_0x13d27d[_0xfa88('0x3a')]||0x96;this[_0xfa88('0x3b')]=_0x13d27d[_0xfa88('0x3b')]||0x4;this[_0xfa88('0x3c')]=_0x13d27d['Trunk']?_0x13d27d[_0xfa88('0x3c')]:undefined;this['TrunkBackup']=_0x13d27d[_0xfa88('0x3d')]?_0x13d27d['TrunkBackup']:undefined;this['dialPrefix']=_0x13d27d[_0xfa88('0x3e')]||undefined;this[_0xfa88('0x3f')]=_0x13d27d[_0xfa88('0x3f')]?_0x13d27d[_0xfa88('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x13d27d[_0xfa88('0x40')]||_0xfa88('0x41');this[_0xfa88('0x42')]=_0x13d27d[_0xfa88('0x42')]||undefined;this[_0xfa88('0x43')]=_0x13d27d[_0xfa88('0x43')]||undefined;this['strategy']=strategy[_0x13d27d[_0xfa88('0x44')]]||_0xfa88('0x8');this[_0xfa88('0x45')]=!![];this['dialAMDActive']=_0x13d27d[_0xfa88('0x46')]||![];this[_0xfa88('0x47')]=_0x13d27d[_0xfa88('0x47')];this[_0xfa88('0x48')]=_0x13d27d[_0xfa88('0x48')];this['dialAMDAfterGreetingSilence']=_0x13d27d[_0xfa88('0x49')];this[_0xfa88('0x4a')]=_0x13d27d[_0xfa88('0x4a')];this['dialAMDMinWordLength']=_0x13d27d[_0xfa88('0x4b')];this['dialAMDBetweenWordsSilence']=_0x13d27d[_0xfa88('0x4c')];this[_0xfa88('0x4d')]=_0x13d27d[_0xfa88('0x4d')];this[_0xfa88('0x4e')]=_0x13d27d[_0xfa88('0x4e')];this[_0xfa88('0x4f')]=_0x13d27d[_0xfa88('0x4f')];this[_0xfa88('0x50')]=0x0;this[_0xfa88('0x51')]=0x0;this[_0xfa88('0x52')]=_0x13d27d[_0xfa88('0x52')];this[_0xfa88('0x53')]=0x0;this[_0xfa88('0x54')]=0x0;this[_0xfa88('0x55')]=0x0;this[_0xfa88('0x56')]=0x0;this[_0xfa88('0x57')]=0x0;this[_0xfa88('0x58')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xfa88('0x59')]=0x0;this[_0xfa88('0x5a')]=0x0;this[_0xfa88('0x5b')]=0x0;this[_0xfa88('0x5c')]=0x0;this['outboundReCallsDay']=0x0;this[_0xfa88('0x5d')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xfa88('0x5e')]=undefined;this[_0xfa88('0x5f')]=1.05;this[_0xfa88('0x60')]=0x0;this[_0xfa88('0x61')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xfa88('0x62')]=0x0;this[_0xfa88('0x63')]=0x0;this[_0xfa88('0x64')]=0x0;this[_0xfa88('0x65')]=0x0;this[_0xfa88('0x66')]=0x0;this[_0xfa88('0x67')]=_0x13d27d['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x13d27d[_0xfa88('0x68')]||0xa;this[_0xfa88('0x69')]=0x0;this[_0xfa88('0x6a')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xfa88('0x6b')]=0x0;this[_0xfa88('0x6c')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xfa88('0x6d')]=0x0;this[_0xfa88('0x6e')]=_0x13d27d[_0xfa88('0x6e')]||0x1e;this['dialRecallInQueue']=_0x13d27d[_0xfa88('0x6f')]||![];this['dialPreviewAutoRecallMe']=!!_0x13d27d[_0xfa88('0x70')]||![];this[_0xfa88('0x71')]=!!_0x13d27d['dialPreviewRecallmeReminder']||![];this[_0xfa88('0x72')]=_0x13d27d[_0xfa88('0x72')]||undefined;this[_0xfa88('0x73')]=_0x13d27d[_0xfa88('0x73')]||![];this[_0xfa88('0x74')]=_0x13d27d['dialAgiAfterHangupAgent']||![];this[_0xfa88('0xa')]=monitorFormat[_0x13d27d[_0xfa88('0xa')]]?monitorFormat[_0x13d27d[_0xfa88('0xa')]]:undefined;this[_0xfa88('0x75')]=_0x13d27d[_0xfa88('0x75')]||![];this['mandatoryDispositionPause']=_0x13d27d[_0xfa88('0x76')]?_0x13d27d[_0xfa88('0x76')]:undefined;}module[_0xfa88('0x77')]=VoiceQueue; \ No newline at end of file +var _0xcd8e=['originated','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message'];(function(_0x5345f8,_0x41d942){var _0x237027=function(_0x4c789c){while(--_0x4c789c){_0x5345f8['push'](_0x5345f8['shift']());}};_0x237027(++_0x41d942);}(_0xcd8e,0x155));var _0xecd8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xcd8e[_0x3b380d];return _0x54502b;};'use strict';var statusDesc=[_0xecd8('0x0'),'not_inuse','inuse',_0xecd8('0x1'),_0xecd8('0x2'),_0xecd8('0x3'),_0xecd8('0x4'),_0xecd8('0x5'),'onhold'];var monitorFormat={'wav':_0xecd8('0x6'),'wav49':_0xecd8('0x7'),'gsm':_0xecd8('0x8')};var strategy={'rrmemory':_0xecd8('0x9'),'roundrobin':_0xecd8('0xa')};function VoiceQueue(_0x298195){this['id']=_0x298195['id']||0x0;this[_0xecd8('0xb')]=_0x298195['name']||'';this[_0xecd8('0xc')]=_0x298195['monitor_format']||'';this[_0xecd8('0xd')]=_0x298195[_0xecd8('0xd')]||'inbound';this['waiting']=0x0;this['talking']=0x0;this[_0xecd8('0xe')]=0x0;this[_0xecd8('0xf')]=0x0;this[_0xecd8('0x10')]=0x0;this[_0xecd8('0x11')]=0x0;this[_0xecd8('0x12')]=0x0;this[_0xecd8('0x13')]=0x0;this[_0xecd8('0x14')]=0x0;this[_0xecd8('0x15')]=0x0;this[_0xecd8('0x16')]=0x0;this[_0xecd8('0x17')]=_0x298195[_0xecd8('0x17')]||![];this[_0xecd8('0x18')]=_0x298195[_0xecd8('0x18')]||0xa;this[_0xecd8('0x19')]=_0x298195[_0xecd8('0x19')]||'no';this[_0xecd8('0x1a')]=!![];this[_0xecd8('0x1b')]='';this[_0xecd8('0x1c')]=0x0;this['temp']=0x0;this[_0xecd8('0x1d')]=_0x298195[_0xecd8('0x1d')]||null;this[_0xecd8('0x1e')]=_0x298195[_0xecd8('0x1e')]?_0x298195[_0xecd8('0x1e')]:null;this[_0xecd8('0x1f')]=_0x298195[_0xecd8('0x1f')];this['dialMethod']=_0x298195['dialMethod']||_0xecd8('0x20');this[_0xecd8('0x21')]=_0x298195[_0xecd8('0x21')]||0x0;this[_0xecd8('0x22')]=_0x298195[_0xecd8('0x22')]||0x0;this[_0xecd8('0x23')]=_0x298195[_0xecd8('0x23')]||0x1;this['dialPredictiveOptimization']=_0x298195[_0xecd8('0x24')]||_0xecd8('0x25');this[_0xecd8('0x26')]=_0x298195[_0xecd8('0x26')]||0.03;this['dialPredictiveInterval']=_0x298195[_0xecd8('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x298195['dialOriginateCallerIdName']||_0xecd8('0x28');this[_0xecd8('0x29')]=_0x298195[_0xecd8('0x29')]||_0xecd8('0x28');this[_0xecd8('0x2a')]=_0x298195['dialOriginateTimeout']||0x1e;this[_0xecd8('0x2b')]=_0x298195[_0xecd8('0x2b')]||'tTxX';this[_0xecd8('0x2c')]=_0x298195[_0xecd8('0x2c')]||0x3;this['dialQueueProject']=_0x298195[_0xecd8('0x2d')]||undefined;this[_0xecd8('0x2e')]=_0x298195['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x298195['dialCongestionRetryFrequency']||0x96;this[_0xecd8('0x2f')]=_0x298195[_0xecd8('0x2f')]||0x3;this[_0xecd8('0x30')]=_0x298195[_0xecd8('0x30')]||0x96;this[_0xecd8('0x31')]=_0x298195[_0xecd8('0x31')]||0x3;this[_0xecd8('0x32')]=_0x298195[_0xecd8('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x298195[_0xecd8('0x33')]||0x3;this[_0xecd8('0x34')]=_0x298195[_0xecd8('0x34')]||0x96;this['dialDropMaxRetry']=_0x298195[_0xecd8('0x35')]||0x3;this[_0xecd8('0x36')]=_0x298195['dialDropRetryFrequency']||0x96;this[_0xecd8('0x37')]=_0x298195[_0xecd8('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x298195[_0xecd8('0x38')]||0x96;this['dialMachineMaxRetry']=_0x298195[_0xecd8('0x39')]||0x3;this[_0xecd8('0x3a')]=_0x298195[_0xecd8('0x3a')]||0x96;this[_0xecd8('0x3b')]=_0x298195[_0xecd8('0x3b')]||0x3;this[_0xecd8('0x3c')]=_0x298195[_0xecd8('0x3c')]||0x96;this[_0xecd8('0x3d')]=_0x298195[_0xecd8('0x3d')]||0x4;this['Trunk']=_0x298195[_0xecd8('0x3e')]?_0x298195['Trunk']:undefined;this[_0xecd8('0x3f')]=_0x298195[_0xecd8('0x3f')]?_0x298195[_0xecd8('0x3f')]:undefined;this[_0xecd8('0x40')]=_0x298195[_0xecd8('0x40')]||undefined;this['Interval']=_0x298195[_0xecd8('0x41')]?_0x298195[_0xecd8('0x41')]:undefined;this[_0xecd8('0x42')]=_0x298195[_0xecd8('0x42')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x298195[_0xecd8('0x43')]||undefined;this[_0xecd8('0x44')]=_0x298195[_0xecd8('0x44')]||undefined;this[_0xecd8('0x45')]=strategy[_0x298195['strategy']]||_0xecd8('0x9');this[_0xecd8('0x46')]=!![];this['dialAMDActive']=_0x298195[_0xecd8('0x47')]||![];this[_0xecd8('0x48')]=_0x298195[_0xecd8('0x48')];this[_0xecd8('0x49')]=_0x298195[_0xecd8('0x49')];this[_0xecd8('0x4a')]=_0x298195['dialAMDAfterGreetingSilence'];this[_0xecd8('0x4b')]=_0x298195['dialAMDTotalAnalysisTime'];this[_0xecd8('0x4c')]=_0x298195[_0xecd8('0x4c')];this[_0xecd8('0x4d')]=_0x298195[_0xecd8('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x298195['dialAMDMaximumNumberOfWords'];this[_0xecd8('0x4e')]=_0x298195[_0xecd8('0x4e')];this[_0xecd8('0x4f')]=_0x298195[_0xecd8('0x4f')];this[_0xecd8('0x50')]=0x0;this[_0xecd8('0x51')]=0x0;this[_0xecd8('0x52')]=_0x298195[_0xecd8('0x52')];this[_0xecd8('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xecd8('0x54')]=0x0;this[_0xecd8('0x55')]=0x0;this[_0xecd8('0x56')]=0x0;this[_0xecd8('0x57')]=0x0;this[_0xecd8('0x58')]=0x0;this[_0xecd8('0x59')]=0x0;this[_0xecd8('0x5a')]=0x0;this[_0xecd8('0x5b')]=0x0;this[_0xecd8('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xecd8('0x5d')]=0x0;this[_0xecd8('0x5e')]=0x0;this[_0xecd8('0x5f')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0xecd8('0x60')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xecd8('0x61')]=0x0;this[_0xecd8('0x62')]=0x0;this[_0xecd8('0x63')]=0x0;this[_0xecd8('0x64')]=0x0;this[_0xecd8('0x65')]=0x0;this[_0xecd8('0x66')]=0x0;this[_0xecd8('0x67')]=0x0;this[_0xecd8('0x68')]=_0x298195[_0xecd8('0x69')]||0x14;this[_0xecd8('0x6a')]=_0x298195['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xecd8('0x6b')]=0x0;this[_0xecd8('0x6c')]=0x0;this[_0xecd8('0x6d')]=0x1;this['erlangCalls']=0x0;this[_0xecd8('0x6e')]=0x0;this[_0xecd8('0x6f')]=0x0;this[_0xecd8('0x70')]=0x0;this[_0xecd8('0x71')]=_0x298195[_0xecd8('0x71')]||0x1e;this[_0xecd8('0x72')]=_0x298195[_0xecd8('0x72')]||![];this[_0xecd8('0x73')]=!!_0x298195[_0xecd8('0x73')]||![];this[_0xecd8('0x74')]=!!_0x298195[_0xecd8('0x74')]||![];this[_0xecd8('0x75')]=_0x298195[_0xecd8('0x75')]||undefined;this[_0xecd8('0x76')]=_0x298195[_0xecd8('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x298195[_0xecd8('0x77')]||![];this[_0xecd8('0xc')]=monitorFormat[_0x298195['monitor_format']]?monitorFormat[_0x298195['monitor_format']]:undefined;this[_0xecd8('0x78')]=_0x298195[_0xecd8('0x78')]||![];this['mandatoryDispositionPause']=_0x298195[_0xecd8('0x79')]?_0x298195[_0xecd8('0x79')]:undefined;}module[_0xecd8('0x7a')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 338a4ba..daa8498 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 _0x168b=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x300a9f,_0x5c7e8b){var _0x920790=function(_0x3e7fe7){while(--_0x3e7fe7){_0x300a9f['push'](_0x300a9f['shift']());}};_0x920790(++_0x5c7e8b);}(_0x168b,0x1f3));var _0xb168=function(_0x42f6cf,_0x20aae8){_0x42f6cf=_0x42f6cf-0x0;var _0x129bc2=_0x168b[_0x42f6cf];return _0x129bc2;};'use strict';function VtigerAccount(_0x5ec47a){this['id']=_0x5ec47a['id']||0x0;this[_0xb168('0x0')]=_0x5ec47a['name']||'';this[_0xb168('0x1')]=_0x5ec47a[_0xb168('0x1')]||'';this[_0xb168('0x2')]=_0x5ec47a[_0xb168('0x2')]||'';this[_0xb168('0x3')]=_0x5ec47a[_0xb168('0x3')]||'';this[_0xb168('0x4')]=_0x5ec47a[_0xb168('0x4')]||'';this[_0xb168('0x5')]=_0x5ec47a['Configurations']||{};}module[_0xb168('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd697=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0xd697,0xc0));var _0x7d69=function(_0x1f3f4a,_0x3907ec){_0x1f3f4a=_0x1f3f4a-0x0;var _0x258d0d=_0xd697[_0x1f3f4a];return _0x258d0d;};'use strict';function VtigerAccount(_0x3ad603){this['id']=_0x3ad603['id']||0x0;this['name']=_0x3ad603[_0x7d69('0x0')]||'';this[_0x7d69('0x1')]=_0x3ad603[_0x7d69('0x1')]||'';this[_0x7d69('0x2')]=_0x3ad603[_0x7d69('0x2')]||'';this[_0x7d69('0x3')]=_0x3ad603[_0x7d69('0x3')]||'';this[_0x7d69('0x4')]=_0x3ad603[_0x7d69('0x4')]||'';this[_0x7d69('0x5')]=_0x3ad603[_0x7d69('0x5')]||{};}module[_0x7d69('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 14d103a..72e49a5 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 _0xa107=['password','token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username'];(function(_0x41fbe7,_0x437845){var _0x1a567a=function(_0x1843f1){while(--_0x1843f1){_0x41fbe7['push'](_0x41fbe7['shift']());}};_0x1a567a(++_0x437845);}(_0xa107,0x12a));var _0x7a10=function(_0x407e75,_0x1fb0c7){_0x407e75=_0x407e75-0x0;var _0x4a3be6=_0xa107[_0x407e75];return _0x4a3be6;};'use strict';function ZendeskAccount(_0x1ae0bc){this['id']=_0x1ae0bc['id']||0x0;this[_0x7a10('0x0')]=_0x1ae0bc[_0x7a10('0x0')]||'';this[_0x7a10('0x1')]=_0x1ae0bc[_0x7a10('0x1')]||'';this['password']=_0x1ae0bc[_0x7a10('0x2')]||'';this[_0x7a10('0x3')]=_0x1ae0bc['token']||'';this[_0x7a10('0x4')]=_0x1ae0bc[_0x7a10('0x4')]||'';this[_0x7a10('0x5')]=_0x1ae0bc[_0x7a10('0x5')]||'';this[_0x7a10('0x6')]=_0x1ae0bc[_0x7a10('0x6')]||'integrationTab';this['serverUrl']=_0x1ae0bc[_0x7a10('0x7')]||'';this[_0x7a10('0x8')]=_0x1ae0bc[_0x7a10('0x8')]||{};}module[_0x7a10('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x180f=['authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x3dad76,_0x257b71){var _0x4f9353=function(_0x346605){while(--_0x346605){_0x3dad76['push'](_0x3dad76['shift']());}};_0x4f9353(++_0x257b71);}(_0x180f,0xf8));var _0xf180=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x180f[_0x49a57c];return _0x4e0316;};'use strict';function ZendeskAccount(_0x31ce5c){this['id']=_0x31ce5c['id']||0x0;this[_0xf180('0x0')]=_0x31ce5c[_0xf180('0x0')]||'';this['username']=_0x31ce5c[_0xf180('0x1')]||'';this[_0xf180('0x2')]=_0x31ce5c[_0xf180('0x2')]||'';this[_0xf180('0x3')]=_0x31ce5c[_0xf180('0x3')]||'';this[_0xf180('0x4')]=_0x31ce5c['remoteUri']||'';this[_0xf180('0x5')]=_0x31ce5c[_0xf180('0x5')]||'';this[_0xf180('0x6')]=_0x31ce5c['type']||_0xf180('0x7');this[_0xf180('0x8')]=_0x31ce5c[_0xf180('0x8')]||'';this[_0xf180('0x9')]=_0x31ce5c[_0xf180('0x9')]||{};}module[_0xf180('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index c78af99..fcfc916 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 _0x0181=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x25d4b3,_0x485359){var _0x34b49c=function(_0x8a1f24){while(--_0x8a1f24){_0x25d4b3['push'](_0x25d4b3['shift']());}};_0x34b49c(++_0x485359);}(_0x0181,0x171));var _0x1018=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0x0181[_0xcf5436];return _0xc4f5c8;};'use strict';function ZohoAccount(_0x401195){this['id']=_0x401195['id']||0x0;this['name']=_0x401195[_0x1018('0x0')]||'';this['description']=_0x401195['description']||'';this[_0x1018('0x1')]=_0x401195[_0x1018('0x1')]||'';this[_0x1018('0x2')]=_0x401195['zone']||'';this[_0x1018('0x3')]=_0x401195[_0x1018('0x3')]||'';this[_0x1018('0x4')]=_0x401195[_0x1018('0x4')]||'';this[_0x1018('0x5')]=_0x401195['serverUrl']||'';this[_0x1018('0x6')]=_0x401195['code']||'';this[_0x1018('0x7')]=_0x401195[_0x1018('0x7')]||'';this[_0x1018('0x8')]=_0x401195[_0x1018('0x8')]||{};}module[_0x1018('0x9')]=ZohoAccount; \ No newline at end of file +var _0x2af2=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x6a3424,_0x2a89a9){var _0x5674d6=function(_0xfd5972){while(--_0xfd5972){_0x6a3424['push'](_0x6a3424['shift']());}};_0x5674d6(++_0x2a89a9);}(_0x2af2,0xab));var _0x22af=function(_0x27c535,_0x7eb57){_0x27c535=_0x27c535-0x0;var _0x57f069=_0x2af2[_0x27c535];return _0x57f069;};'use strict';function ZohoAccount(_0x4c0b97){this['id']=_0x4c0b97['id']||0x0;this[_0x22af('0x0')]=_0x4c0b97[_0x22af('0x0')]||'';this[_0x22af('0x1')]=_0x4c0b97[_0x22af('0x1')]||'';this[_0x22af('0x2')]=_0x4c0b97['host']||'';this[_0x22af('0x3')]=_0x4c0b97[_0x22af('0x3')]||'';this['clientId']=_0x4c0b97[_0x22af('0x4')]||'';this[_0x22af('0x5')]=_0x4c0b97['clientSecret']||'';this[_0x22af('0x6')]=_0x4c0b97[_0x22af('0x6')]||'';this[_0x22af('0x7')]=_0x4c0b97[_0x22af('0x7')]||'';this[_0x22af('0x8')]=_0x4c0b97[_0x22af('0x8')]||'';this['Configurations']=_0x4c0b97[_0x22af('0x9')]||{};}module[_0x22af('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 ecb8304..40f01d1 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 _0xc52d=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0xf96d90,_0x494f88){var _0x309146=function(_0xecd191){while(--_0xecd191){_0xf96d90['push'](_0xf96d90['shift']());}};_0x309146(++_0x494f88);}(_0xc52d,0xa1));var _0xdc52=function(_0x14626a,_0x35f249){_0x14626a=_0x14626a-0x0;var _0x3e9a14=_0xc52d[_0x14626a];return _0x3e9a14;};'use strict';var util=require(_0xdc52('0x0'));var _=require(_0xdc52('0x1'));var moment=require(_0xdc52('0x2'));function checkNameSurname(_0x1645a3,_0x1543ec,_0x506587){var _0x4a61a7='';if(!_[_0xdc52('0x3')](_0x1543ec)&&_0xdc52('0x4')===typeof _0x1543ec){_0x4a61a7+=_0x1543ec;}if(!_[_0xdc52('0x3')](_0x506587)&&'string'===typeof _0x506587){_0x4a61a7+='\x20'+_0x506587;}if(_0x4a61a7!==''){return _0x4a61a7;}return _0x1645a3;}function Action(_0x10aa5f,_0x13e467,_0x5aa112,_0x3f6f85,_0xc4d258){this[_0xdc52('0x5')]=_0x5aa112||undefined;this[_0xdc52('0x6')]=_0x10aa5f['id'];this['queue']=_0x13e467[_0xdc52('0x7')];this[_0xdc52('0x8')]=_0x13e467[_0xdc52('0x8')];this[_0xdc52('0x9')]=_0xdc52('0xa');this[_0xdc52('0xb')]=![];this[_0xdc52('0xc')]=_[_0xdc52('0x3')](_0x10aa5f[_0xdc52('0xd')])?undefined:_0x10aa5f[_0xdc52('0xd')][_0xdc52('0x7')];this[_0xdc52('0xe')]=this['membername']?util[_0xdc52('0xf')](_0xdc52('0x10'),this[_0xdc52('0xc')]):_0x3f6f85||undefined;this[_0xdc52('0x11')]=checkNameSurname(_0x10aa5f[_0xdc52('0x12')][_0xdc52('0x13')],_0x10aa5f[_0xdc52('0x12')][_0xdc52('0x14')],_0x10aa5f[_0xdc52('0x12')][_0xdc52('0x15')]);this['active']=_0x10aa5f[_0xdc52('0x16')]||![];this['calleridnum']=_0x10aa5f[_0xdc52('0x12')]['phone'];this['scheduledat']=_0x10aa5f[_0xdc52('0x17')];this[_0xdc52('0x18')]=_0x10aa5f['countbusyretry']||0x0;this['countcongestionretry']=_0x10aa5f[_0xdc52('0x19')]||0x0;this[_0xdc52('0x1a')]=_0x10aa5f[_0xdc52('0x1a')]||0x0;this[_0xdc52('0x1b')]=(_0x10aa5f[_0xdc52('0x18')]||0x0)+(_0x10aa5f['countcongestionretry']||0x0)+(_0x10aa5f[_0xdc52('0x1a')]||0x0)+(_0x10aa5f[_0xdc52('0x1c')]||0x0)+(_0x10aa5f['countdropretry']||0x0)+(_0x10aa5f['countabandonedretry']||0x0)+(_0x10aa5f[_0xdc52('0x1d')]||0x0)+(_0x10aa5f[_0xdc52('0x1e')]||0x0);this['countnosuchnumberretry']=_0x10aa5f[_0xdc52('0x1c')]||0x0;this[_0xdc52('0x1f')]=_0x10aa5f['countdropretry']||0x0;this['countabandonedretry']=_0x10aa5f[_0xdc52('0x20')]||0x0;this[_0xdc52('0x1d')]=_0x10aa5f['countmachineretry']||0x0;this['countagentrejectretry']=_0x10aa5f[_0xdc52('0x1e')]||0x0;this[_0xdc52('0x21')]=_0x10aa5f[_0xdc52('0x21')];this[_0xdc52('0x22')]=_0x10aa5f[_0xdc52('0x22')];this['callbackat']=_0x10aa5f[_0xdc52('0x23')];this[_0xdc52('0x24')]=_0x10aa5f[_0xdc52('0x24')];this[_0xdc52('0x25')]=_0x10aa5f[_0xdc52('0x25')];this[_0xdc52('0x26')]=_0x10aa5f[_0xdc52('0x26')];this[_0xdc52('0x27')]=_[_0xdc52('0x3')](_0x10aa5f[_0xdc52('0xd')])?_0x10aa5f['UserId']:_0x10aa5f[_0xdc52('0xd')]['id'];this[_0xdc52('0x28')]=_0x10aa5f[_0xdc52('0x28')];this['originatecalleridnum']='';this[_0xdc52('0x29')]='';}Action[_0xdc52('0x2a')]['getCaller']=function(){return util[_0xdc52('0xf')](_0xdc52('0x2b'),this[_0xdc52('0x11')],this[_0xdc52('0x2c')]);};module[_0xdc52('0x2d')]=Action; \ No newline at end of file +var _0x3b1c=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','Agent','UserId','VoiceQueueId','originatecalleridname','prototype','calleridname','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','channelAgent','format','SIP/%s','Contact','firstName','lastName','active'];(function(_0x1ab611,_0x711bb7){var _0x3a2a7b=function(_0x13da9f){while(--_0x13da9f){_0x1ab611['push'](_0x1ab611['shift']());}};_0x3a2a7b(++_0x711bb7);}(_0x3b1c,0xbf));var _0xc3b1=function(_0x5bf4f5,_0x591dec){_0x5bf4f5=_0x5bf4f5-0x0;var _0x40ef68=_0x3b1c[_0x5bf4f5];return _0x40ef68;};'use strict';var util=require(_0xc3b1('0x0'));var _=require(_0xc3b1('0x1'));var moment=require(_0xc3b1('0x2'));function checkNameSurname(_0x1e855f,_0x659b8f,_0x4823df){var _0x674e2e='';if(!_[_0xc3b1('0x3')](_0x659b8f)&&_0xc3b1('0x4')===typeof _0x659b8f){_0x674e2e+=_0x659b8f;}if(!_['isNil'](_0x4823df)&&_0xc3b1('0x4')===typeof _0x4823df){_0x674e2e+='\x20'+_0x4823df;}if(_0x674e2e!==''){return _0x674e2e;}return _0x1e855f;}function Action(_0x370758,_0x2602e6,_0x570217,_0x3d3fbb,_0x27177e){this['uniqueid']=_0x570217||undefined;this[_0xc3b1('0x5')]=_0x370758['id'];this[_0xc3b1('0x6')]=_0x2602e6[_0xc3b1('0x7')];this['type']=_0x2602e6[_0xc3b1('0x8')];this[_0xc3b1('0x9')]='queue';this[_0xc3b1('0xa')]=![];this[_0xc3b1('0xb')]=_['isNil'](_0x370758['Agent'])?undefined:_0x370758['Agent'][_0xc3b1('0x7')];this[_0xc3b1('0xc')]=this[_0xc3b1('0xb')]?util[_0xc3b1('0xd')](_0xc3b1('0xe'),this[_0xc3b1('0xb')]):_0x3d3fbb||undefined;this['calleridname']=checkNameSurname(_0x370758[_0xc3b1('0xf')]['phone'],_0x370758[_0xc3b1('0xf')][_0xc3b1('0x10')],_0x370758[_0xc3b1('0xf')][_0xc3b1('0x11')]);this[_0xc3b1('0x12')]=_0x370758['active']||![];this[_0xc3b1('0x13')]=_0x370758[_0xc3b1('0xf')]['phone'];this[_0xc3b1('0x14')]=_0x370758[_0xc3b1('0x14')];this[_0xc3b1('0x15')]=_0x370758[_0xc3b1('0x15')]||0x0;this[_0xc3b1('0x16')]=_0x370758[_0xc3b1('0x16')]||0x0;this['countnoanswerretry']=_0x370758[_0xc3b1('0x17')]||0x0;this[_0xc3b1('0x18')]=(_0x370758[_0xc3b1('0x15')]||0x0)+(_0x370758[_0xc3b1('0x16')]||0x0)+(_0x370758[_0xc3b1('0x17')]||0x0)+(_0x370758[_0xc3b1('0x19')]||0x0)+(_0x370758[_0xc3b1('0x1a')]||0x0)+(_0x370758[_0xc3b1('0x1b')]||0x0)+(_0x370758[_0xc3b1('0x1c')]||0x0)+(_0x370758[_0xc3b1('0x1d')]||0x0);this[_0xc3b1('0x19')]=_0x370758[_0xc3b1('0x19')]||0x0;this[_0xc3b1('0x1a')]=_0x370758[_0xc3b1('0x1a')]||0x0;this[_0xc3b1('0x1b')]=_0x370758[_0xc3b1('0x1b')]||0x0;this[_0xc3b1('0x1c')]=_0x370758['countmachineretry']||0x0;this[_0xc3b1('0x1d')]=_0x370758[_0xc3b1('0x1d')]||0x0;this[_0xc3b1('0x1e')]=_0x370758[_0xc3b1('0x1e')];this['callbackuniqueid']=_0x370758['callbackuniqueid'];this[_0xc3b1('0x1f')]=_0x370758['callbackat'];this[_0xc3b1('0x20')]=_0x370758[_0xc3b1('0x20')];this[_0xc3b1('0x21')]=_0x370758['ContactId'];this[_0xc3b1('0x22')]=_0x370758[_0xc3b1('0x22')];this['UserId']=_[_0xc3b1('0x3')](_0x370758[_0xc3b1('0x23')])?_0x370758[_0xc3b1('0x24')]:_0x370758[_0xc3b1('0x23')]['id'];this[_0xc3b1('0x25')]=_0x370758['VoiceQueueId'];this['originatecalleridnum']='';this[_0xc3b1('0x26')]='';}Action[_0xc3b1('0x27')]['getCaller']=function(){return util[_0xc3b1('0xd')]('\x22%s\x22\x20<%s>',this[_0xc3b1('0x28')],this['number']);};module[_0xc3b1('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 36a5698..962b293 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 _0xac9d=['prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','hangup','syncHangup','hanguprequest','syncHangupRequest','bind','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','dialMethod','booked','hasOwnProperty','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated','pTalking:\x20','pTalking','dialAnswer','contactId','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','recallMe','then','length','Agent','voicePause','run','logger2','[RecallMe]','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','idContact','Calling','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','pick','unlock','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','campaign\x20Name:\x20','\x20Not\x20Active','SIP/%s/%s%s','trim','dialCutDigit','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','clone','isFailure','response','unlockContact','custom:agentringnoanswer','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter'];(function(_0x2e5539,_0x476eeb){var _0x1d8eee=function(_0x14f16f){while(--_0x14f16f){_0x2e5539['push'](_0x2e5539['shift']());}};_0x1d8eee(++_0x476eeb);}(_0xac9d,0x14d));var _0xdac9=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xac9d[_0x336264];return _0x53cf91;};'use strict';var util=require(_0xdac9('0x0'));var _=require(_0xdac9('0x1'));var BPromise=require(_0xdac9('0x2'));var uuid=require(_0xdac9('0x3'));var moment=require(_0xdac9('0x4'));var md5=require(_0xdac9('0x5'));var Redis=require(_0xdac9('0x6'));var config=require(_0xdac9('0x7'));var logger=require('../../../config/logger')(_0xdac9('0x8'));var loggerAction=require('../../../config/logger')(_0xdac9('0x9'));var ami=require(_0xdac9('0xa'));var rpcDb=require(_0xdac9('0xb'));var Action=require(_0xdac9('0xc'));var ut=require(_0xdac9('0xd'));config[_0xdac9('0xe')]=_['defaults'](config[_0xdac9('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0xdac9('0xf'))(new Redis(config[_0xdac9('0xe')]));var Sequence=function(){};Sequence[_0xdac9('0x10')][_0xdac9('0x11')]=function(_0x23ec14){this[_0xdac9('0x12')]=this[_0xdac9('0x12')]?this[_0xdac9('0x12')][_0xdac9('0x13')](_0x23ec14):_0x23ec14();};function Preview(_0x5514c5){this[_0xdac9('0x14')]=new Sequence();this[_0xdac9('0x15')]=_0x5514c5['voiceQueues'];this[_0xdac9('0x16')]=_0x5514c5[_0xdac9('0x16')];this[_0xdac9('0x17')]={};this['agents']=_0x5514c5[_0xdac9('0x18')];this[_0xdac9('0x19')]=0x0;ami['on'](_0xdac9('0x1a'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xdac9('0x1b'),this[_0xdac9('0x1c')]['bind'](this));ami['on'](_0xdac9('0x1d'),this[_0xdac9('0x1e')][_0xdac9('0x1f')](this));ami['on'](_0xdac9('0x20'),this[_0xdac9('0x21')][_0xdac9('0x1f')](this));ami['on'](_0xdac9('0x22'),this[_0xdac9('0x23')]['bind'](this));ami['on'](_0xdac9('0x24'),this[_0xdac9('0x25')]['bind'](this));ami['on'](_0xdac9('0x26'),this[_0xdac9('0x27')][_0xdac9('0x1f')](this));ami['on'](_0xdac9('0x28'),this['syncBlindTransfer']['bind'](this));this[_0xdac9('0x29')](this[_0xdac9('0x15')]);}function emit(_0x2b9d91,_0x395ec7,_0x52fb18){io['to'](_0x2b9d91)[_0xdac9('0x2a')](_0x395ec7,_0x52fb18);}function emitCampaignPreview(_0x33cb7d){if(_0x33cb7d[_0xdac9('0x2b')]===_0xdac9('0x2c')){var _0xe7bd10={'id':_0x33cb7d['id'],'name':_0x33cb7d[_0xdac9('0x2d')],'strategy':_0x33cb7d[_0xdac9('0x2e')],'answered':_0x33cb7d[_0xdac9('0x2f')],'available':_0x33cb7d[_0xdac9('0x30')],'loggedIn':_0x33cb7d[_0xdac9('0x31')],'pTalking':_0x33cb7d['pTalking'],'sumBillable':_0x33cb7d[_0xdac9('0x32')],'sumDuration':_0x33cb7d[_0xdac9('0x33')],'sumHoldTime':_0x33cb7d[_0xdac9('0x34')]||0x0,'talking':_0x33cb7d[_0xdac9('0x35')],'total':_0x33cb7d['total'],'type':_0x33cb7d[_0xdac9('0x2b')],'unmanaged':_0x33cb7d['unmanaged'],'abandoned':_0x33cb7d[_0xdac9('0x36')],'waiting':_0x33cb7d[_0xdac9('0x37')],'loggedInDb':_0x33cb7d['loggedInDb'],'dialActive':_0x33cb7d[_0xdac9('0x38')],'dialMethod':_0x33cb7d['dialMethod'],'dialOriginateCallerIdName':_0x33cb7d[_0xdac9('0x39')],'dialOriginateCallerIdNumber':_0x33cb7d[_0xdac9('0x3a')],'dialOriginateTimeout':_0x33cb7d[_0xdac9('0x3b')],'dialPrefix':_0x33cb7d[_0xdac9('0x3c')],'outboundAnswerAgiCallsDay':_0x33cb7d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x33cb7d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x33cb7d[_0xdac9('0x3d')],'outboundBusyCallsDay':_0x33cb7d[_0xdac9('0x3e')],'outboundCongestionCallsDay':_0x33cb7d['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x33cb7d['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x33cb7d[_0xdac9('0x3f')],'outboundDropCallsDayTimeout':_0x33cb7d[_0xdac9('0x40')],'outboundNoAnswerCallsDay':_0x33cb7d[_0xdac9('0x41')],'outboundNoSuchCallsDay':_0x33cb7d[_0xdac9('0x42')],'outboundOriginateFailureCallsDay':_0x33cb7d[_0xdac9('0x43')],'outboundReCallsDay':_0x33cb7d[_0xdac9('0x44')],'outboundRejectCallsDay':_0x33cb7d[_0xdac9('0x45')],'outboundUnknownCallsDay':_0x33cb7d[_0xdac9('0x46')],'outboundAbandonedCallsDay':_0x33cb7d[_0xdac9('0x47')],'predictiveIntervalAnsweredCalls':_0x33cb7d[_0xdac9('0x48')],'predictiveIntervalAvgHoldtime':_0x33cb7d[_0xdac9('0x49')],'predictiveIntervalAvgTalktime':_0x33cb7d[_0xdac9('0x4a')],'predictiveIntervalDroppedCallsCallersExit':_0x33cb7d[_0xdac9('0x4b')],'predictiveIntervalDroppedCallsTimeout':_0x33cb7d[_0xdac9('0x4c')],'predictiveIntervalErlangCalls':_0x33cb7d[_0xdac9('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0x33cb7d[_0xdac9('0x4e')],'predictiveIntervalHitRate':_0x33cb7d[_0xdac9('0x4f')],'predictiveIntervalMultiplicativeFactor':_0x33cb7d[_0xdac9('0x50')],'predictiveIntervalPauses':_0x33cb7d[_0xdac9('0x51')],'predictiveIntervalAvailable':_0x33cb7d[_0xdac9('0x52')],'predictiveIntervalTotalCalls':_0x33cb7d[_0xdac9('0x53')],'message':_0x33cb7d['message'],'originated':_0x33cb7d['originated'],'erlangCalls':_0x33cb7d[_0xdac9('0x54')],'erlangCallToSecond':_0x33cb7d[_0xdac9('0x55')],'erlangAbandonmentRate':_0x33cb7d[_0xdac9('0x56')],'erlangBusyFactor':_0x33cb7d[_0xdac9('0x57')],'startPredictive':_0x33cb7d[_0xdac9('0x58')],'startProgressive':_0x33cb7d['startProgressive']};if(_0x33cb7d[_0xdac9('0x59')]){_0xe7bd10['Trunk']={'id':_0x33cb7d[_0xdac9('0x59')]['id'],'name':_0x33cb7d[_0xdac9('0x59')]['name'],'active':_0x33cb7d[_0xdac9('0x59')]['active'],'callerid':_0x33cb7d['Trunk'][_0xdac9('0x5a')]};}if(_0x33cb7d[_0xdac9('0x5b')]){_0xe7bd10[_0xdac9('0x5b')]={'id':_0x33cb7d[_0xdac9('0x5b')]['id'],'name':_0x33cb7d[_0xdac9('0x5b')][_0xdac9('0x2d')]};}var _0x51cde6=md5(JSON[_0xdac9('0x5c')](_0xe7bd10));if(_0x33cb7d[_0xdac9('0x5')]!==_0x51cde6){_0x33cb7d['md5']=_0x51cde6;emit(util[_0xdac9('0x5d')](_0xdac9('0x5e'),_0xe7bd10[_0xdac9('0x2d')]),_0xdac9('0x5f'),_0xe7bd10);}}}function emitVoiceQueueChannelRemove(_0x35aa58){logger[_0xdac9('0x60')](_0xdac9('0x61'),JSON['stringify'](_0x35aa58));emit(util[_0xdac9('0x5d')](_0xdac9('0x5e'),_0x35aa58[_0xdac9('0x2d')]),'voice_queue_channel:remove',_0x35aa58);io[_0xdac9('0x2a')](_0xdac9('0x62'),_0x35aa58);}function notSendMessagesQueue(_0x26ba56){if(_0x26ba56[_0xdac9('0x63')]){if(_0x26ba56['originated']===0x0&&_0x26ba56['pTalking']===0x0){_0x26ba56[_0xdac9('0x63')]=![];_0x26ba56[_0xdac9('0x30')]=0x0;_0x26ba56[_0xdac9('0x64')]=0x0;_0x26ba56[_0xdac9('0x65')]=_0xdac9('0x66');ut['logger'](_0xdac9('0x67'),_0x26ba56['name']+_0xdac9('0x68'));}else{_0x26ba56[_0xdac9('0x65')]=_0xdac9('0x69');ut[_0xdac9('0x6a')](_0xdac9('0x67'),_0x26ba56[_0xdac9('0x2d')]+_0xdac9('0x6b'));}emitCampaignPreview(_0x26ba56);}}Preview[_0xdac9('0x10')][_0xdac9('0x29')]=function(){var _0x8a0538=this;setInterval(function(){_0x8a0538[_0xdac9('0x6c')]();},0x7cf);};Preview[_0xdac9('0x10')][_0xdac9('0x6c')]=function(){var _0x441676=this['campaignsPreview'];this[_0xdac9('0x19')]+=0x1;for(var _0x272b52 in _0x441676){if(_0x441676['hasOwnProperty'](_0x272b52)&&(_0x441676[_0x272b52][_0xdac9('0x6d')]===_0xdac9('0x8')||_0x441676[_0x272b52][_0xdac9('0x6d')]===_0xdac9('0x6e'))&&_0x441676[_0x272b52][_0xdac9('0x2b')]===_0xdac9('0x2c')){if(this['clockClearZombieChannels']>0x7){this[_0xdac9('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x441676[_0xdac9('0x6f')](_0x272b52)&&_0x441676[_0x272b52][_0xdac9('0x6d')]===_0xdac9('0x8')&&_0x441676[_0x272b52][_0xdac9('0x2b')]==='outbound'){if(_0x441676[_0x272b52]['dialActive']){this['setMessage'](_0x441676[_0x272b52]);if(_0x441676[_0x272b52][_0xdac9('0x70')])this['recallMe'](_0x441676[_0x272b52]);}else{notSendMessagesQueue(_0x441676[_0x272b52]);}}}};Preview['prototype'][_0xdac9('0x71')]=function(_0x15c332){var _0x49c948=this;this['sequence'][_0xdac9('0x11')](function(){if(!_[_0xdac9('0x72')](_0x49c948[_0xdac9('0x17')][_0x15c332])){loggerAction[_0xdac9('0x60')](_0xdac9('0x73'),_0x15c332,_0xdac9('0x74'),_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')],'originated:\x20',JSON[_0xdac9('0x5c')](_0x49c948[_0xdac9('0x15')][_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]][_0xdac9('0x76')]),_0xdac9('0x77'),JSON[_0xdac9('0x5c')](_0x49c948[_0xdac9('0x15')][_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]][_0xdac9('0x78')]),JSON[_0xdac9('0x5c')](_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x79')]),JSON['stringify'](_['pick'](_0x49c948['actions'][_0x15c332],[_0xdac9('0x7a'),_0xdac9('0x7b'),'VoiceQueueId',_0xdac9('0x7c')])));return ami[_0xdac9('0x7d')]({'action':_0xdac9('0x7e'),'channel':_0x49c948['actions'][_0x15c332][_0xdac9('0x7f')]})[_0xdac9('0x80')](function(_0x57902f){if(_0x57902f['message']===_0xdac9('0x81')){setTimeout(function(){if(_0x49c948[_0xdac9('0x17')][_0x15c332]){ut[_0xdac9('0x82')](_0x49c948[_0xdac9('0x15')][_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]],_0xdac9('0x83'));if(_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x79')]===!![]){ut[_0xdac9('0x84')](_0x49c948[_0xdac9('0x15')][_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]],_0xdac9('0x83'));ut[_0xdac9('0x85')]('[Dialer][checkChannel][pTalking][Preview]'+_0x15c332,_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]);}ut[_0xdac9('0x85')](_0xdac9('0x86')+_0x15c332,_0x49c948[_0xdac9('0x17')][_0x15c332][_0xdac9('0x75')]);delete _0x49c948['actions'][_0x15c332];}},0x2328);}});}});};Preview[_0xdac9('0x10')][_0xdac9('0x87')]=function(){var _0xd9b702=this;loggerAction[_0xdac9('0x60')](_0xdac9('0x88'),_[_0xdac9('0x89')](this[_0xdac9('0x17')]));for(var _0x243862 in this[_0xdac9('0x17')]){if(_0xd9b702['actions'][_0xdac9('0x6f')](_0x243862)){_0xd9b702[_0xdac9('0x71')](_0x243862);}}};Preview[_0xdac9('0x10')][_0xdac9('0x8a')]=function(_0x2ca15d){var _0x21ab3d=this;rpcDb['getContactRecallMe'](_0x2ca15d['id'],ut['agentReadyId'](this[_0xdac9('0x18')]))[_0xdac9('0x8b')](function(_0x41ea68){if(!_[_0xdac9('0x72')](_0x41ea68)){for(var _0x1c1f5f=0x0;_0x1c1f5f<_0x41ea68[_0xdac9('0x8c')];_0x1c1f5f+=0x1){if(ut['getDiff'](_0x41ea68[_0x1c1f5f]['scheduledat'])<_0x2ca15d['dialRecallMeTimeout']*0x3c){if(_0x41ea68[_0x1c1f5f][_0xdac9('0x8d')]&&!_0x41ea68[_0x1c1f5f][_0xdac9('0x8d')][_0xdac9('0x8e')]){_0x21ab3d[_0xdac9('0x8f')](_0x41ea68[_0x1c1f5f]['id'])['then'](ut[_0xdac9('0x90')](_0xdac9('0x91')))[_0xdac9('0x80')](ut[_0xdac9('0x90')](_0xdac9('0x91')));}else{rpcDb['disableContact'](_0x41ea68[_0x1c1f5f]['id']);}}else{var _0x19a46e=new Action(_0x41ea68[_0x1c1f5f],_0x2ca15d);_0x19a46e['starttime']=moment()[_0xdac9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ca15d[_0xdac9('0x44')]+=0x1;ut[_0xdac9('0x92')](_0x19a46e,0x17,_0xdac9('0x93'));if(_0x2ca15d[_0xdac9('0x94')]){rpcDb[_0xdac9('0x95')](ut[_0xdac9('0x96')](_0x41ea68[_0x1c1f5f]));rpcDb[_0xdac9('0x97')](_0x19a46e,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x19a46e,0x16,'RecallFailedTimeout');rpcDb[_0xdac9('0x97')](_0x19a46e,_0xdac9('0x98'));rpcDb[_0xdac9('0x99')](_0x19a46e,_0xdac9('0x98'));}}}}})[_0xdac9('0x80')](ut[_0xdac9('0x90')](_0xdac9('0x9a')));};Preview['prototype'][_0xdac9('0x9b')]=function(_0x5b63d8){_0x5b63d8['sendMessageOneNotActive']=!![];if(ut[_0xdac9('0x9c')](_0x5b63d8['loggedIn'])){_0x5b63d8['message']=_0xdac9('0x9d');}else if(!ut[_0xdac9('0x9e')](_0x5b63d8[_0xdac9('0x38')])){_0x5b63d8['message']='NOT_ACTIVE';}else if(!this[_0xdac9('0x9f')](_0x5b63d8[_0xdac9('0x59')])){if(!this['isTrunkReachable'](_0x5b63d8[_0xdac9('0xa0')])){_0x5b63d8[_0xdac9('0x65')]=_0xdac9('0xa1');}else{_0x5b63d8[_0xdac9('0x65')]=_0xdac9('0xa2');}}else{_0x5b63d8[_0xdac9('0x65')]=_0xdac9('0xa2');}emitCampaignPreview(_0x5b63d8);};Preview[_0xdac9('0x10')][_0xdac9('0xa3')]=function(_0x800e5,_0x20cd93,_0x1e2e7b){var _0x5401e6=this;var _0x24c11d=this['actions'][_0x20cd93];var _0x180397=this[_0xdac9('0x15')][_0x24c11d['queue']];var _0x3a6c78;if(_0x180397){switch(_0x1e2e7b){case'1':_0x180397[_0xdac9('0x42')]+=0x1;_0x24c11d[_0xdac9('0xa4')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x0,_0xdac9('0xa7'));ami[_0xdac9('0x2a')](_0xdac9('0xa8'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xaa')));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xab'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut[_0xdac9('0xad')](_0x24c11d,0xf,'Global');rpcDb[_0xdac9('0x99')](_0x3a6c78,_0xdac9('0xae'));}else{if(_0x24c11d[_0xdac9('0xa4')]>=_0x180397[_0xdac9('0xaf')]){rpcDb['createCustomerFinal'](_0x24c11d,_0xdac9('0xae'));}else{rpcDb[_0xdac9('0xb0')](ut[_0xdac9('0xb1')](_0x24c11d,'countnosuchnumberretry',_0x180397[_0xdac9('0xb2')]),_0x24c11d[_0xdac9('0xb3')],_0x24c11d['activeContact']);}}delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xb4')]];break;case _0xdac9('0xb5'):var _0x4d3d3e=moment()[_0xdac9('0x5d')](_0xdac9('0xb6'));_0x24c11d[_0xdac9('0xb7')]=_0x4d3d3e;_0x24c11d['answertime']=_0x4d3d3e;_0x24c11d['dialAnswer']=!![];_0x180397[_0xdac9('0x78')]+=0x1;logger[_0xdac9('0x60')](_0xdac9('0xb8'),_0x24c11d[_0xdac9('0xb9')],_0xdac9('0xba'),_0x180397[_0xdac9('0x2d')],_0xdac9('0x77'),_0x180397[_0xdac9('0x78')]);ami[_0xdac9('0x2a')](_0xdac9('0xbb'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xbc'),this[_0xdac9('0x15')][_0x24c11d['queue']]));if(_0x180397['acw']){ami[_0xdac9('0x2a')]('custom:agentConnectPreview',ut['buildAcw'](_0x24c11d));}break;case'16':ami[_0xdac9('0x2a')](_0xdac9('0xbd'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xbe'),this['campaignsPreview'][_0x24c11d[_0xdac9('0x75')]]));emitVoiceQueueChannelRemove(ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xbe')));_0x180397['outboundAnswerCallsDay']+=0x1;_0x180397[_0xdac9('0xbf')]+=0x1;_0x180397[_0xdac9('0x2f')]+=0x1;ut['decrementTalkink'](_0x180397,_0xdac9('0xc0'));_0x24c11d['countglobal']=ut[_0xdac9('0xa6')](_0x24c11d);ut['logCustomer'](_0x24c11d,0x4,_0xdac9('0xc1'));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xc2'));rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xc3'));rpcDb['crateCustomerReportQueue'](_0x24c11d);_0x180397[_0xdac9('0x33')]+=_0x24c11d[_0xdac9('0xc4')];_0x180397[_0xdac9('0x32')]+=_0x24c11d[_0xdac9('0xc4')];logger[_0xdac9('0x60')](_0xdac9('0xc5'),_0x24c11d[_0xdac9('0xb9')],_0xdac9('0xba'),_0x180397[_0xdac9('0x2d')],'pTalking:\x20',_0x180397[_0xdac9('0x78')]);delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xb4')]];break;case'BUSY':_0x180397['outboundBusyCallsDay']+=0x1;_0x24c11d['countbusyretry']+=0x1;_0x24c11d['countglobal']=ut['totalGlobal'](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x5,_0xdac9('0xc6'));ami[_0xdac9('0x2a')](_0xdac9('0xc7'),ut['buildObj'](_0x24c11d,_0xdac9('0xc8')));rpcDb['createCustomerHistory'](_0x24c11d,_0xdac9('0xc9'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut[_0xdac9('0xad')](_0x24c11d,0xf,'Global');rpcDb[_0xdac9('0x99')](_0x3a6c78,_0xdac9('0xca'));}else{if(_0x24c11d[_0xdac9('0xcb')]>=_0x180397[_0xdac9('0xcc')]){rpcDb['createCustomerFinal'](_0x24c11d,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xdac9('0xb0')](ut[_0xdac9('0xb1')](_0x24c11d,_0xdac9('0xcb'),_0x180397['dialBusyRetryFrequency']),_0x24c11d['unlockAgent'],_0x24c11d[_0xdac9('0xcd')]);}}break;case _0xdac9('0xce'):_0x180397[_0xdac9('0x41')]+=0x1;_0x24c11d[_0xdac9('0xcf')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x3,_0xdac9('0xd0'));ami[_0xdac9('0x2a')](_0xdac9('0xd1'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xd2')));rpcDb[_0xdac9('0x97')](_0x24c11d,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut['cloneAction'](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb['createCustomerFinal'](_0x3a6c78,_0xdac9('0xd4'));}else{if(_0x24c11d[_0xdac9('0xcf')]>=_0x180397[_0xdac9('0xd5')]){rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xd6'));}else{rpcDb[_0xdac9('0xb0')](ut[_0xdac9('0xb1')](_0x24c11d,_0xdac9('0xcf'),_0x180397[_0xdac9('0xd7')]),_0x24c11d[_0xdac9('0xb3')],_0x24c11d[_0xdac9('0xcd')]);}}break;case'CONGESTION':_0x180397[_0xdac9('0xd8')]+=0x1;_0x24c11d[_0xdac9('0xd9')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x8,'Congestion');ami['emit'](_0xdac9('0xda'),ut['buildObj'](_0x24c11d,'congestion'));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xdb'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut['cloneAction'](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb[_0xdac9('0x99')](_0x3a6c78,_0xdac9('0xdc'));}else{if(_0x24c11d['countcongestionretry']>=_0x180397['dialCongestionMaxRetry']){rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xdb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x24c11d,'countcongestionretry',_0x180397[_0xdac9('0xdd')]),_0x24c11d[_0xdac9('0xb3')],_0x24c11d[_0xdac9('0xcd')]);}}break;case'CANCEL':_0x180397[_0xdac9('0x45')]+=0x1;_0x24c11d[_0xdac9('0xde')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x14,'AgentReject');ami[_0xdac9('0x2a')](_0xdac9('0xdf'),ut['buildObj'](_0x24c11d,_0xdac9('0xe0')));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xe1'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397['dialGlobalMaxRetry']){_0x3a6c78=ut['cloneAction'](_0x24c11d,0x14,_0xdac9('0xe2'));rpcDb[_0xdac9('0x99')](_0x3a6c78,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x24c11d['countagentrejectretry']>=_0x180397[_0xdac9('0xe3')]){rpcDb['createCustomerFinal'](_0x24c11d,_0xdac9('0xe4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x24c11d,_0xdac9('0xde'),_0x180397[_0xdac9('0xe5')]),_0x24c11d[_0xdac9('0xb3')],_0x24c11d[_0xdac9('0xcd')]);}}break;case _0xdac9('0xe6'):_0x180397[_0xdac9('0x47')]+=0x1;_0x24c11d[_0xdac9('0xe7')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0xb,_0xdac9('0xe8'));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xe9'));if(ut['totalGlobal'](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut[_0xdac9('0xad')](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb[_0xdac9('0x99')](_0x3a6c78,_0xdac9('0xe9'));}else{if(_0x24c11d[_0xdac9('0xea')]>=_0x180397[_0xdac9('0xeb')]){rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xe9'));}else{rpcDb[_0xdac9('0xb0')](ut[_0xdac9('0xb1')](_0x24c11d,'countabandonedretry',_0x180397[_0xdac9('0xec')]),_0x24c11d[_0xdac9('0xb3')],_0x24c11d[_0xdac9('0xcd')]);}}break;case'18':_0x180397[_0xdac9('0x46')]+=0x1;_0x24c11d[_0xdac9('0xed')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x12,_0x800e5[_0xdac9('0xee')]||_0x800e5[_0xdac9('0xef')]);ami['emit'](_0xdac9('0xf0'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xf1')));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xf2'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut[_0xdac9('0xad')](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb[_0xdac9('0x99')](_0x3a6c78,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xf2'));}delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xb4')]];break;case'19':_0x180397[_0xdac9('0x46')]+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0x13,_0x800e5[_0xdac9('0xee')]||_0x800e5[_0xdac9('0xef')]);ami['emit'](_0xdac9('0xf0'),ut[_0xdac9('0xa9')](_0x24c11d,_0xdac9('0xf1')));rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xf3'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397[_0xdac9('0xac')]){_0x3a6c78=ut[_0xdac9('0xad')](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb[_0xdac9('0x99')](_0x3a6c78,_0xdac9('0xf3'));}else{rpcDb[_0xdac9('0x99')](_0x24c11d,'[callProgressDetectingCustomer][machine]');}delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xb4')]];break;default:if(_0x24c11d['dialAnswer']){ut[_0xdac9('0x84')](_0x180397,_0xdac9('0xf4'));ut[_0xdac9('0x85')](_0xdac9('0xf5')+_0x180397[_0xdac9('0x2d')],_0x800e5);}_0x180397['outboundUnknownCallsDay']+=0x1;_0x24c11d[_0xdac9('0xa5')]=ut[_0xdac9('0xa6')](_0x24c11d);ut[_0xdac9('0x92')](_0x24c11d,0xc,_0x800e5['cause-txt']||_0x800e5[_0xdac9('0xef')]);rpcDb[_0xdac9('0x97')](_0x24c11d,_0xdac9('0xf6'));if(ut[_0xdac9('0xa6')](_0x24c11d)>=_0x180397['dialGlobalMaxRetry']){_0x3a6c78=ut['cloneAction'](_0x24c11d,0xf,_0xdac9('0xd3'));rpcDb['createCustomerFinal'](_0x3a6c78,_0xdac9('0xf7'));}else{rpcDb[_0xdac9('0x99')](_0x24c11d,_0xdac9('0xf7'));}delete this['actions'][_0x800e5[_0xdac9('0xb4')]];}if(!(_0x24c11d[_0xdac9('0x79')]&&_0x1e2e7b==='16')){ut[_0xdac9('0x82')](_0x180397,_0xdac9('0xf8'));logger[_0xdac9('0x60')](_0xdac9('0xf9'),_0x24c11d[_0xdac9('0xb9')],_0xdac9('0xba'),_0x180397[_0xdac9('0x2d')],_0xdac9('0xfa'),_0x180397[_0xdac9('0x76')]);}if(_0x1e2e7b!==_0xdac9('0xb5')){delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xb4')]];delete this[_0xdac9('0x17')][_0x800e5[_0xdac9('0xfb')]];}}};Preview[_0xdac9('0x10')][_0xdac9('0xfc')]=function(_0x123dec,_0x1efe77,_0x279cf3){if(_[_0xdac9('0xfd')](_0x1efe77)&&'object'!==typeof _0x1efe77){return;}if(_['isUndefined'](_0x279cf3)&&_0xdac9('0xfe')!==typeof _0x279cf3){return;}switch(_0x279cf3[_0xdac9('0xff')]){case'0':ut[_0xdac9('0x100')](_0x123dec,0x0,_0xdac9('0xa7'));rpcDb[_0xdac9('0x101')](_0x123dec,_0xdac9('0x102'));break;case'3':ut[_0xdac9('0x100')](_0x123dec,0x3,_0xdac9('0xd0'));rpcDb['createAgentHistory'](_0x123dec,_0xdac9('0x103'));break;case'5':ut[_0xdac9('0x100')](_0x123dec,0x5,_0xdac9('0xc6'));rpcDb[_0xdac9('0x101')](_0x123dec,_0xdac9('0x104'));break;case'8':ut[_0xdac9('0x100')](_0x123dec,0x8,_0xdac9('0x105'));rpcDb[_0xdac9('0x101')](_0x123dec,_0xdac9('0x106'));break;case'22':ut[_0xdac9('0x100')](_0x123dec,0x16,_0xdac9('0x107'));rpcDb[_0xdac9('0x101')](_0x123dec,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xdac9('0x100')](_0x123dec,0xc,_0x279cf3[_0xdac9('0xff')]);rpcDb['createAgentHistory'](_0x123dec,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdac9('0x82')](_0x1efe77,_0xdac9('0x108'));logger[_0xdac9('0x60')](_0xdac9('0x109'),_0x123dec[_0xdac9('0xb9')],_0xdac9('0xba'),_0x1efe77[_0xdac9('0x2d')],_0xdac9('0xfa'),_0x1efe77['originated']);delete this[_0xdac9('0x17')][_0x123dec[_0xdac9('0xb9')]];};Preview['prototype'][_0xdac9('0x10a')]=function(_0x43310f,_0x39b635,_0x3a4982,_0x5ea0f8,_0x1c430a){var _0x68801b=this;return new BPromise(function(_0x72c574,_0x4b6304){if(_[_0xdac9('0x72')](_0x39b635)||_[_0xdac9('0x72')](_0x39b635['Contact'])||_[_0xdac9('0x72')](_0x39b635[_0xdac9('0x10b')][_0xdac9('0x10c')])||_[_0xdac9('0x72')](_0x39b635[_0xdac9('0x10d')])){_0x4b6304(ut[_0xdac9('0x65')](_0xdac9('0x10e'),_0x5ea0f8,_0x1c430a));return;}var _0x5511ef=uuid['v4']();var _0xbe0990=_0x68801b['campaignsPreview'][_0x39b635[_0xdac9('0x74')][_0xdac9('0x2d')]];var _0x5c7ab2=_0x3a4982?_0x68801b[_0xdac9('0x18')][_0x3a4982]['id']:undefined;_0x68801b[_0xdac9('0x17')][_0x5511ef]=new Action(_0x39b635,_0xbe0990,_0x5511ef,_0x3a4982,_0x5c7ab2);var _0x376d26=_0x68801b[_0xdac9('0x17')][_0x5511ef];_0x376d26[_0xdac9('0xb3')]=_0x5ea0f8;_0x376d26['activeContact']=_0x1c430a;_0x376d26[_0xdac9('0x10f')]=_0x3a4982;if(_['isEmpty'](_0x43310f)){_0x68801b[_0xdac9('0x110')](_0x376d26,_0xbe0990,_0x39b635,_0x3a4982)[_0xdac9('0x8b')](function(_0x3426d8){logger['info'](_0xdac9('0x111'),_0xdac9('0x112')+_0x376d26[_0xdac9('0x75')]+'\x20IdHopper:\x20'+_0x376d26[_0xdac9('0x113')],JSON[_0xdac9('0x5c')](_0x3426d8));ami[_0xdac9('0x2a')]('custom:agentcalled',ut[_0xdac9('0xa9')](_0x376d26,'called',_0x68801b[_0xdac9('0x15')][_0x376d26[_0xdac9('0x75')]]));_0x72c574(ut[_0xdac9('0x65')](_0xdac9('0x114')));})[_0xdac9('0x80')](function(_0x277ac1){ut[_0xdac9('0x6a')]('[Preview][execCall][failure]',_0x277ac1);_0x4b6304(ut[_0xdac9('0x65')](_0xdac9('0x115'),_0x5ea0f8,_0x1c430a));});}else{_0xbe0990['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x376d26);rpcDb[_0xdac9('0x116')](_0x376d26,_0xdac9('0x117'));delete _0x68801b[_0xdac9('0x17')][_0x5511ef];_0x4b6304(ut[_0xdac9('0x65')](_0xdac9('0x118'),_0x5ea0f8,_0x1c430a));}});};Preview[_0xdac9('0x10')][_0xdac9('0x9f')]=function(_0x1cdb7b){return!_[_0xdac9('0x72')](_0x1cdb7b)&&!_[_0xdac9('0x72')](_0x1cdb7b['name'])&&!_[_0xdac9('0x72')](_0x1cdb7b[_0xdac9('0x119')])&&_0x1cdb7b['active']&&!_[_0xdac9('0x72')](this['trunks'][util[_0xdac9('0x5d')](_0xdac9('0x11a'),_0x1cdb7b[_0xdac9('0x2d')])])&&!_['isNil'](this[_0xdac9('0x16')][util[_0xdac9('0x5d')](_0xdac9('0x11a'),_0x1cdb7b[_0xdac9('0x2d')])][_0xdac9('0x7e')])&&(this[_0xdac9('0x16')][util[_0xdac9('0x5d')](_0xdac9('0x11a'),_0x1cdb7b[_0xdac9('0x2d')])][_0xdac9('0x7e')]==='reachable'||this[_0xdac9('0x16')][util['format']('SIP/%s',_0x1cdb7b[_0xdac9('0x2d')])][_0xdac9('0x7e')]===_0xdac9('0x11b'));};Preview['prototype'][_0xdac9('0x8f')]=function(_0xead446,_0x2686d0){var _0x560e36=this;return new BPromise(function(_0xac1f20,_0x1195ba){_0x560e36['execRun'](_0xead446,_0x2686d0)[_0xdac9('0x8b')](function(_0x37552c){_0xac1f20(_[_0xdac9('0x11c')](_0x37552c,[_0xdac9('0x65')]));})[_0xdac9('0x80')](function(_0x1cd3f7){if(_0x1cd3f7[_0xdac9('0x11d')]){rpcDb['unlockContact'](_0xead446);}if(_0x1cd3f7['active']){rpcDb[_0xdac9('0x11e')](_0xead446);}_0x1195ba(_[_0xdac9('0x11c')](_0x1cd3f7,['message']));});});};Preview[_0xdac9('0x10')][_0xdac9('0x11f')]=function(_0x475c2e,_0x5862af){var _0x35e60a=this;return new BPromise(function(_0x500e09,_0x74d0fd){var _0x280b48,_0x46b699;rpcDb[_0xdac9('0x120')](_0x475c2e)[_0xdac9('0x8b')](function(_0x389cc6){if(!_['isNil'](_0x389cc6[0x0])){_0x46b699=_0x389cc6[0x0][_0xdac9('0x121')]?![]:!![];_0x280b48=_0x389cc6[0x0][_0xdac9('0x121')]?!![]:![];_0x280b48=_0x5862af?!![]:_0x280b48;}var _0x2bbfb7=_0x35e60a[_0xdac9('0x122')](_0x389cc6);if(_0x2bbfb7[_0xdac9('0x123')]){rpcDb[_0xdac9('0x124')](_[_0xdac9('0x11c')](_0x389cc6[0x0],[_0xdac9('0x10d'),'Contact.phone']))['then'](function(_0x27504e){_0x35e60a['checkInBlack'](_0x27504e,_0x389cc6[0x0],_0x5862af,_0x46b699,_0x280b48)[_0xdac9('0x8b')](function(_0x582a00){_0x500e09(_0x582a00);})[_0xdac9('0x80')](function(_0x6470f5){_0x74d0fd(_0x6470f5);});})[_0xdac9('0x80')](function(_0x2d781b){ut[_0xdac9('0x6a')](_0xdac9('0x125'),_0x2d781b);_0x74d0fd(ut[_0xdac9('0x65')](_0xdac9('0x126'),_0x46b699,_0x280b48));});}else{_0x74d0fd(ut['message'](_0x2bbfb7['message'],_0x46b699,_0x280b48));}})[_0xdac9('0x80')](function(_0x2eaae3){ut[_0xdac9('0x6a')](_0xdac9('0x127'),_0x2eaae3);_0x74d0fd(ut[_0xdac9('0x65')](_0xdac9('0x126'),![],!![]));});});};Preview['prototype'][_0xdac9('0x122')]=function(_0x26fe6b){if(_[_0xdac9('0x72')](_0x26fe6b)||_[_0xdac9('0x128')](_0x26fe6b)||!_[_0xdac9('0x72')](_0x26fe6b[0x0]['Agent'])&&_[_0xdac9('0x72')](_0x26fe6b[0x0][_0xdac9('0x8d')][_0xdac9('0x2d')])){ut[_0xdac9('0x6a')](_0xdac9('0x129'),_0x26fe6b);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x231221=this[_0xdac9('0x15')][_0x26fe6b[0x0]['Queue'][_0xdac9('0x2d')]];_0x231221[_0xdac9('0x65')]='ACTIVE';if(_[_0xdac9('0x72')](_0x231221)){ut[_0xdac9('0x6a')]('[Preview][validateContact][Empty\x20Campaign]',_0x231221);return{'isValid':![],'message':_0xdac9('0x12a')};}if(!this['isTrunkReachable'](_0x231221['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x231221[_0xdac9('0x2d')]+_0xdac9('0x12b'));if(!this[_0xdac9('0x9f')](_0x231221[_0xdac9('0xa0')])){ut[_0xdac9('0x6a')](_0xdac9('0x12c'),_0x231221[_0xdac9('0x2d')]+_0xdac9('0x12d'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0xdac9('0x9e')](_0x231221['dialActive'])){ut[_0xdac9('0x6a')]('[Preview][validateContact][Campaign\x20Active]',_0x231221[_0xdac9('0x2d')]+'\x20Not\x20Active');return{'isValid':![],'message':_0xdac9('0x12e')+_0x231221[_0xdac9('0x2d')]+_0xdac9('0x12f')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xdac9('0x110')]=function(_0x2cb05d,_0x269b07,_0x5d7482,_0x190a1f){var _0x3a6136=this;return new BPromise(function(_0x12039d,_0xba2b6){var _0x5ede8b=_0x2cb05d[_0xdac9('0xb9')];var _0x2719b3=_0x3a6136['isTrunkReachable'](_0x269b07[_0xdac9('0x59')])?util['format'](_0xdac9('0x130'),_0x269b07[_0xdac9('0x59')][_0xdac9('0x2d')],_['isNil'](_0x269b07['dialPrefix'])?'':_0x269b07[_0xdac9('0x3c')][_0xdac9('0x131')]()||'',_0x269b07[_0xdac9('0x132')]>0x0?_0x5d7482['Contact'][_0xdac9('0x10c')]['substring'](_0x269b07['dialCutDigit']):_0x5d7482[_0xdac9('0x10b')][_0xdac9('0x10c')]):util[_0xdac9('0x5d')](_0xdac9('0x130'),_['isNil'](_0x269b07[_0xdac9('0xa0')])?_0x269b07[_0xdac9('0x59')][_0xdac9('0x2d')]:_0x269b07[_0xdac9('0xa0')][_0xdac9('0x2d')],_[_0xdac9('0x72')](_0x269b07[_0xdac9('0x3c')])?'':_0x269b07[_0xdac9('0x3c')]['trim']()||'',_0x269b07[_0xdac9('0x132')]>0x0?_0x5d7482[_0xdac9('0x10b')]['phone']['substring'](_0x269b07[_0xdac9('0x132')]):_0x5d7482[_0xdac9('0x10b')][_0xdac9('0x10c')]);var _0x3c6828=_0x3a6136[_0xdac9('0x9f')](_0x269b07[_0xdac9('0x59')])?ut['getCallerId'](_0x269b07[_0xdac9('0x59')][_0xdac9('0x5a')],_0x269b07['dialOriginateCallerIdName'],_0x269b07[_0xdac9('0x133')]>0x0?ut[_0xdac9('0x134')](_0x269b07[_0xdac9('0x3a')],_0x269b07[_0xdac9('0x133')]):_0x269b07[_0xdac9('0x3a')]):ut[_0xdac9('0x135')](_[_0xdac9('0x72')](_0x269b07['TrunkBackup'])?_0x269b07['Trunk'][_0xdac9('0x5a')]:_0x269b07[_0xdac9('0xa0')][_0xdac9('0x5a')],_0x269b07['dialOriginateCallerIdName'],_0x269b07[_0xdac9('0x133')]>0x0?ut[_0xdac9('0x134')](_0x269b07[_0xdac9('0x3a')],_0x269b07[_0xdac9('0x133')]):_0x269b07[_0xdac9('0x3a')]);if(_0x3c6828){_0x2cb05d[_0xdac9('0x136')]=ut[_0xdac9('0x137')](_0x3c6828);_0x2cb05d['originatecalleridnum']=ut[_0xdac9('0x138')](_0x3c6828);}var _0x3e0db2=ut[_0xdac9('0x139')](_0x269b07,_0x5d7482,_0x2719b3,_0x3c6828,_0x5ede8b,_0x2cb05d);_[_0xdac9('0x13a')](_0x2cb05d,ut[_0xdac9('0x13b')](_0x3e0db2));_0x2cb05d['starttime']=moment()[_0xdac9('0x5d')](_0xdac9('0xb6'));ami[_0xdac9('0x7d')](ut[_0xdac9('0x13c')](_0x2cb05d,_0x269b07,_0x3e0db2,_0x2cb05d[_0xdac9('0xcd')],_0x190a1f))[_0xdac9('0x8b')](function(_0x2cf6f1){_0x269b07[_0xdac9('0x76')]+=0x1;logger[_0xdac9('0x60')](_0xdac9('0x13d'),_0x5ede8b,_0xdac9('0xba'),_0x269b07[_0xdac9('0x2d')],_0xdac9('0xfa'),_0x269b07[_0xdac9('0x76')]);_0x12039d(_0x2cf6f1);})[_0xdac9('0x80')](function(_0x1aac04){ut[_0xdac9('0x100')](_0x2cb05d,0xe,_0xdac9('0x13e'));rpcDb[_0xdac9('0x101')](_0x2cb05d,_0xdac9('0x13f'));_0xba2b6(_0x1aac04);});});};Preview[_0xdac9('0x10')][_0xdac9('0x23')]=function(_0x3e0c5f){if(this[_0xdac9('0x17')][_0x3e0c5f[_0xdac9('0xb4')]]){this[_0xdac9('0x17')][_0x3e0c5f[_0xdac9('0xb4')]][_0xdac9('0x7f')]=_0x3e0c5f[_0xdac9('0x7f')];}};Preview['prototype'][_0xdac9('0x140')]=function(_0x4d89ec){var _0x342f1b=this;var _0x1cce73=this[_0xdac9('0x17')][_0x4d89ec[_0xdac9('0x141')]];if(_0x1cce73){if(_0x1cce73[_0xdac9('0x10f')]&&this[_0xdac9('0x18')][_0x1cce73[_0xdac9('0x10f')]]){ut['logLookAgent'](_0x1cce73,this[_0xdac9('0x18')][_0x1cce73[_0xdac9('0x10f')]]['name'],this[_0xdac9('0x18')][_0x1cce73[_0xdac9('0x10f')]]['id']);}var _0x8fbf67=_[_0xdac9('0x142')](_0x1cce73);_0x8fbf67[_0xdac9('0xb7')]=moment()['format'](_0xdac9('0xb6'));var _0x10e31b=_0x342f1b['campaignsPreview'][_0x1cce73[_0xdac9('0x75')]];if(ut[_0xdac9('0x143')](_0x4d89ec[_0xdac9('0x144')])){if(_0x1cce73['unlockAgent']){rpcDb[_0xdac9('0x145')](_0x1cce73[_0xdac9('0x113')]);}if(_0x1cce73[_0xdac9('0xcd')]){rpcDb[_0xdac9('0x11e')](_0x1cce73[_0xdac9('0x113')]);}ami[_0xdac9('0x2a')](_0xdac9('0x146'),ut[_0xdac9('0xa9')](_0x1cce73,'rejected',this[_0xdac9('0x15')][_0x1cce73['queue']]));this['callProgressDetectingAgent'](_0x8fbf67,_0x10e31b,_0x4d89ec);}else{_0x1cce73[_0xdac9('0x147')]=moment()[_0xdac9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xdac9('0x100')](_0x8fbf67,0x4,_0xdac9('0xc1'));rpcDb[_0xdac9('0x101')](_0x8fbf67,_0xdac9('0x148'));}}};Preview['prototype']['syncHangup']=function(_0x26b19b){var _0x3a1d4d=this;var _0x2c57d2=this[_0xdac9('0x17')][_0x26b19b[_0xdac9('0xb4')]];var _0x4d396c;if(_0x2c57d2){_0x4d396c=this['campaignsPreview'][_0x2c57d2['queue']];logger[_0xdac9('0x60')](_0xdac9('0x149'),_0x26b19b[_0xdac9('0xb4')],'\x20Queue',_0x4d396c['name'],'pTalking:\x20',_0x4d396c[_0xdac9('0x78')]);}if(this[_0xdac9('0x17')][_0x26b19b[_0xdac9('0xb4')]]&&_0x26b19b[_0xdac9('0xb4')]!==_0x26b19b[_0xdac9('0xb9')]){if(_0x26b19b[_0xdac9('0x14a')]==='16'&&this['actions'][_0x26b19b[_0xdac9('0xb4')]]['dialAnswer']){this[_0xdac9('0xa3')](_0x26b19b,_0x26b19b[_0xdac9('0xb4')],_0x26b19b[_0xdac9('0x14a')]);}else if(this[_0xdac9('0x17')][_0x26b19b[_0xdac9('0xb4')]][_0xdac9('0x79')]){logger[_0xdac9('0x60')](_0xdac9('0x14b'),_0x26b19b[_0xdac9('0xb4')],_0x26b19b[_0xdac9('0x14a')],_0xdac9('0xba'),_0x4d396c[_0xdac9('0x2d')],'pTalking:\x20',_0x4d396c['pTalking']);this[_0xdac9('0xa3')](_0x26b19b,_0x26b19b[_0xdac9('0xb4')],_0x26b19b[_0xdac9('0x14a')]);}}else if(_0x2c57d2&&_[_0xdac9('0x72')](_0x2c57d2[_0xdac9('0x14c')])&&_0x4d396c['dialQueueProject']&&_0x26b19b[_0xdac9('0xb4')]===_0x26b19b[_0xdac9('0xb9')]&&_['isNil'](_0x26b19b[_0xdac9('0xff')])&&_0x26b19b[_0xdac9('0x14a')]==='16'&&_0x26b19b[_0xdac9('0x14d')]==='6'&&_['isUndefined'](_0x2c57d2['transfer'])){if(_0x2c57d2[_0xdac9('0xb3')]){rpcDb['unlockContact'](_0x2c57d2[_0xdac9('0x113')]);}if(_0x2c57d2[_0xdac9('0xcd')]){rpcDb[_0xdac9('0x11e')](_0x2c57d2['idContact']);}_0x26b19b[_0xdac9('0xff')]='22';this[_0xdac9('0xfc')](_0x2c57d2,_0x4d396c,_0x26b19b);}else if(_0x2c57d2&&_0x2c57d2[_0xdac9('0x14e')]){if(_0x26b19b['cause']==='16'&&this[_0xdac9('0x17')][_0x26b19b[_0xdac9('0xb4')]][_0xdac9('0x79')]){logger['info'](_0xdac9('0x14f'),_0x26b19b[_0xdac9('0xb4')],_0x26b19b['cause'],'\x20Queue',_0x4d396c[_0xdac9('0x2d')],_0xdac9('0x77'),_0x4d396c[_0xdac9('0x78')]);this[_0xdac9('0xa3')](_0x26b19b,_0x26b19b['linkedid'],_0x26b19b[_0xdac9('0x14a')]);}else if(this[_0xdac9('0x17')][_0x26b19b[_0xdac9('0xb4')]]['dialAnswer']){logger[_0xdac9('0x60')](_0xdac9('0x14b'),_0x26b19b[_0xdac9('0xb4')],_0x26b19b[_0xdac9('0x14a')],_0xdac9('0xba'),_0x4d396c[_0xdac9('0x2d')],_0xdac9('0x77'),_0x4d396c[_0xdac9('0x78')]);this['callProgressDetectingCustomer'](_0x26b19b,_0x26b19b[_0xdac9('0xb4')],_0x26b19b[_0xdac9('0x14a')]);}}};Preview[_0xdac9('0x10')][_0xdac9('0x21')]=function(_0x48b519){if(this[_0xdac9('0x17')][_0x48b519[_0xdac9('0xfb')]]&&_0x48b519[_0xdac9('0xfb')]!==_0x48b519[_0xdac9('0x150')]){this[_0xdac9('0xa3')](_0x48b519,_0x48b519[_0xdac9('0xfb')],_0x48b519[_0xdac9('0xef')]);}};Preview[_0xdac9('0x10')][_0xdac9('0x1e')]=function(_0x9adc9d){if(this[_0xdac9('0x17')][_0x9adc9d[_0xdac9('0xb4')]]&&_0x9adc9d[_0xdac9('0xb4')]!==_0x9adc9d[_0xdac9('0xb9')]&&!this[_0xdac9('0x17')][_0x9adc9d[_0xdac9('0xb4')]][_0xdac9('0x79')]){if(_0x9adc9d[_0xdac9('0x14a')]==='1'){this[_0xdac9('0xa3')](_0x9adc9d,_0x9adc9d['linkedid'],_0x9adc9d[_0xdac9('0x14a')]);}}};Preview[_0xdac9('0x10')][_0xdac9('0x151')]=function(_0x9d6a1f,_0x2d3ff9,_0x27a0a0){if(this[_0xdac9('0x17')][_0x9d6a1f]){if(_[_0xdac9('0x72')](this[_0xdac9('0x17')][_0x9d6a1f]['variables'])){this[_0xdac9('0x17')][_0x9d6a1f]['variables']={};}this[_0xdac9('0x17')][_0x9d6a1f][_0xdac9('0x152')][_0x2d3ff9]=_0x27a0a0;}};Preview[_0xdac9('0x10')][_0xdac9('0x25')]=function(_0x197094){try{if(!_[_0xdac9('0x72')](_0x197094)){if(ut[_0xdac9('0x153')](_[_0xdac9('0x154')](_0x197094[_0xdac9('0x155')])[0x0])){this[_0xdac9('0x151')](_0x197094[_0xdac9('0xb9')],_[_0xdac9('0x154')](_0x197094[_0xdac9('0x155')])[0x0],_0x197094[_0xdac9('0x156')]);}}}catch(_0x4f7d5b){logger['error'](_0xdac9('0x157'),util[_0xdac9('0x158')](_0x4f7d5b,{'showHidden':![],'depth':null}));}};Preview[_0xdac9('0x10')][_0xdac9('0x27')]=function(_0x4abf26){if(_0x4abf26){if(this['actions'][_0x4abf26[_0xdac9('0x159')]]){this['actions'][_0x4abf26[_0xdac9('0x159')]][_0xdac9('0x14e')]=!![];}}};Preview[_0xdac9('0x10')][_0xdac9('0x15a')]=function(_0x4d05c6){if(_0x4d05c6){if(this['actions'][_0x4d05c6[_0xdac9('0x15b')]]){this[_0xdac9('0x17')][_0x4d05c6[_0xdac9('0x15b')]][_0xdac9('0x14e')]=!![];}}};module[_0xdac9('0x15c')]=Preview; \ No newline at end of file +var _0xcd59=['./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice_queue:save','info','format','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','unlockAgent','activeContact','linkedid','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','[callProgressDetectingCustomer]','ANSWER','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','unlockContact','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','[syncHangup][talking][cause]','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami'];(function(_0x6009c5,_0x5d9b32){var _0x1c2a4b=function(_0x1258c4){while(--_0x1258c4){_0x6009c5['push'](_0x6009c5['shift']());}};_0x1c2a4b(++_0x5d9b32);}(_0xcd59,0x14b));var _0x9cd5=function(_0x3253f3,_0x1c57d8){_0x3253f3=_0x3253f3-0x0;var _0x598c26=_0xcd59[_0x3253f3];return _0x598c26;};'use strict';var util=require(_0x9cd5('0x0'));var _=require(_0x9cd5('0x1'));var BPromise=require(_0x9cd5('0x2'));var uuid=require(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var md5=require(_0x9cd5('0x5'));var Redis=require('ioredis');var config=require(_0x9cd5('0x6'));var logger=require(_0x9cd5('0x7'))(_0x9cd5('0x8'));var loggerAction=require(_0x9cd5('0x7'))(_0x9cd5('0x9'));var ami=require(_0x9cd5('0xa'));var rpcDb=require(_0x9cd5('0xb'));var Action=require(_0x9cd5('0xc'));var ut=require(_0x9cd5('0xd'));config[_0x9cd5('0xe')]=_['defaults'](config[_0x9cd5('0xe')],{'host':_0x9cd5('0xf'),'port':0x18eb});var io=require(_0x9cd5('0x10'))(new Redis(config[_0x9cd5('0xe')]));var Sequence=function(){};Sequence[_0x9cd5('0x11')][_0x9cd5('0x12')]=function(_0x46bbca){this[_0x9cd5('0x13')]=this['tail']?this[_0x9cd5('0x13')][_0x9cd5('0x14')](_0x46bbca):_0x46bbca();};function Preview(_0x3fefe6){this[_0x9cd5('0x15')]=new Sequence();this['campaignsPreview']=_0x3fefe6['voiceQueues'];this[_0x9cd5('0x16')]=_0x3fefe6[_0x9cd5('0x16')];this[_0x9cd5('0x17')]={};this[_0x9cd5('0x18')]=_0x3fefe6[_0x9cd5('0x18')];this[_0x9cd5('0x19')]=0x0;ami['on']('originateresponse',this[_0x9cd5('0x1a')][_0x9cd5('0x1b')](this));ami['on'](_0x9cd5('0x1c'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0x9cd5('0x1d')][_0x9cd5('0x1b')](this));ami['on']('dialend',this[_0x9cd5('0x1e')][_0x9cd5('0x1b')](this));ami['on'](_0x9cd5('0x1f'),this['syncNewExten'][_0x9cd5('0x1b')](this));ami['on'](_0x9cd5('0x20'),this[_0x9cd5('0x21')][_0x9cd5('0x1b')](this));ami['on'](_0x9cd5('0x22'),this[_0x9cd5('0x23')]['bind'](this));ami['on'](_0x9cd5('0x24'),this[_0x9cd5('0x25')][_0x9cd5('0x1b')](this));this[_0x9cd5('0x26')](this[_0x9cd5('0x27')]);}function emit(_0x4ed8b9,_0x16c4e9,_0x271444){io['to'](_0x4ed8b9)[_0x9cd5('0x28')](_0x16c4e9,_0x271444);}function emitCampaignPreview(_0x12e402){if(_0x12e402[_0x9cd5('0x29')]===_0x9cd5('0x2a')){var _0x1cf603={'id':_0x12e402['id'],'name':_0x12e402[_0x9cd5('0x2b')],'strategy':_0x12e402[_0x9cd5('0x2c')],'answered':_0x12e402['answered'],'available':_0x12e402[_0x9cd5('0x2d')],'loggedIn':_0x12e402[_0x9cd5('0x2e')],'pTalking':_0x12e402[_0x9cd5('0x2f')],'sumBillable':_0x12e402[_0x9cd5('0x30')],'sumDuration':_0x12e402['sumDuration'],'sumHoldTime':_0x12e402[_0x9cd5('0x31')]||0x0,'talking':_0x12e402[_0x9cd5('0x32')],'total':_0x12e402[_0x9cd5('0x33')],'type':_0x12e402[_0x9cd5('0x29')],'unmanaged':_0x12e402[_0x9cd5('0x34')],'abandoned':_0x12e402[_0x9cd5('0x35')],'waiting':_0x12e402[_0x9cd5('0x36')],'loggedInDb':_0x12e402['loggedInDb'],'dialActive':_0x12e402[_0x9cd5('0x37')],'dialMethod':_0x12e402[_0x9cd5('0x38')],'dialOriginateCallerIdName':_0x12e402[_0x9cd5('0x39')],'dialOriginateCallerIdNumber':_0x12e402['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x12e402['dialOriginateTimeout'],'dialPrefix':_0x12e402[_0x9cd5('0x3a')],'outboundAnswerAgiCallsDay':_0x12e402['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x12e402['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x12e402[_0x9cd5('0x3b')],'outboundBusyCallsDay':_0x12e402[_0x9cd5('0x3c')],'outboundCongestionCallsDay':_0x12e402[_0x9cd5('0x3d')],'outboundDropCallsDayACS':_0x12e402['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x12e402[_0x9cd5('0x3e')],'outboundDropCallsDayTimeout':_0x12e402[_0x9cd5('0x3f')],'outboundNoAnswerCallsDay':_0x12e402[_0x9cd5('0x40')],'outboundNoSuchCallsDay':_0x12e402[_0x9cd5('0x41')],'outboundOriginateFailureCallsDay':_0x12e402[_0x9cd5('0x42')],'outboundReCallsDay':_0x12e402[_0x9cd5('0x43')],'outboundRejectCallsDay':_0x12e402[_0x9cd5('0x44')],'outboundUnknownCallsDay':_0x12e402[_0x9cd5('0x45')],'outboundAbandonedCallsDay':_0x12e402[_0x9cd5('0x46')],'predictiveIntervalAnsweredCalls':_0x12e402[_0x9cd5('0x47')],'predictiveIntervalAvgHoldtime':_0x12e402[_0x9cd5('0x48')],'predictiveIntervalAvgTalktime':_0x12e402[_0x9cd5('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x12e402[_0x9cd5('0x4a')],'predictiveIntervalDroppedCallsTimeout':_0x12e402[_0x9cd5('0x4b')],'predictiveIntervalErlangCalls':_0x12e402['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x12e402[_0x9cd5('0x4c')],'predictiveIntervalHitRate':_0x12e402[_0x9cd5('0x4d')],'predictiveIntervalMultiplicativeFactor':_0x12e402['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x12e402['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x12e402[_0x9cd5('0x4e')],'predictiveIntervalTotalCalls':_0x12e402[_0x9cd5('0x4f')],'message':_0x12e402['message'],'originated':_0x12e402[_0x9cd5('0x50')],'erlangCalls':_0x12e402['erlangCalls'],'erlangCallToSecond':_0x12e402['erlangCallToSecond'],'erlangAbandonmentRate':_0x12e402[_0x9cd5('0x51')],'erlangBusyFactor':_0x12e402[_0x9cd5('0x52')],'startPredictive':_0x12e402[_0x9cd5('0x53')],'startProgressive':_0x12e402[_0x9cd5('0x54')]};if(_0x12e402['Trunk']){_0x1cf603[_0x9cd5('0x55')]={'id':_0x12e402[_0x9cd5('0x55')]['id'],'name':_0x12e402[_0x9cd5('0x55')]['name'],'active':_0x12e402[_0x9cd5('0x55')][_0x9cd5('0x56')],'callerid':_0x12e402[_0x9cd5('0x55')][_0x9cd5('0x57')]};}if(_0x12e402[_0x9cd5('0x58')]){_0x1cf603[_0x9cd5('0x58')]={'id':_0x12e402[_0x9cd5('0x58')]['id'],'name':_0x12e402[_0x9cd5('0x58')][_0x9cd5('0x2b')]};}var _0x1ed01d=md5(JSON[_0x9cd5('0x59')](_0x1cf603));if(_0x12e402['md5']!==_0x1ed01d){_0x12e402[_0x9cd5('0x5')]=_0x1ed01d;emit(util['format']('voice:queue:%s',_0x1cf603[_0x9cd5('0x2b')]),_0x9cd5('0x5a'),_0x1cf603);}}}function emitVoiceQueueChannelRemove(_0x46b974){logger[_0x9cd5('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x9cd5('0x59')](_0x46b974));emit(util[_0x9cd5('0x5c')](_0x9cd5('0x5d'),_0x46b974[_0x9cd5('0x2b')]),'voice_queue_channel:remove',_0x46b974);io[_0x9cd5('0x28')](_0x9cd5('0x5e'),_0x46b974);}function notSendMessagesQueue(_0x1324a2){if(_0x1324a2[_0x9cd5('0x5f')]){if(_0x1324a2[_0x9cd5('0x50')]===0x0&&_0x1324a2[_0x9cd5('0x2f')]===0x0){_0x1324a2['sendMessageOneNotActive']=![];_0x1324a2[_0x9cd5('0x2d')]=0x0;_0x1324a2[_0x9cd5('0x60')]=0x0;_0x1324a2[_0x9cd5('0x61')]=_0x9cd5('0x62');ut[_0x9cd5('0x63')](_0x9cd5('0x64'),_0x1324a2[_0x9cd5('0x2b')]+_0x9cd5('0x65'));}else{_0x1324a2[_0x9cd5('0x61')]=_0x9cd5('0x66');ut[_0x9cd5('0x63')](_0x9cd5('0x64'),_0x1324a2[_0x9cd5('0x2b')]+_0x9cd5('0x67'));}emitCampaignPreview(_0x1324a2);}}Preview[_0x9cd5('0x11')][_0x9cd5('0x26')]=function(){var _0xd94baf=this;setInterval(function(){_0xd94baf[_0x9cd5('0x68')]();},0x7cf);};Preview['prototype'][_0x9cd5('0x68')]=function(){var _0x58ae2e=this[_0x9cd5('0x27')];this[_0x9cd5('0x19')]+=0x1;for(var _0xaa50a in _0x58ae2e){if(_0x58ae2e[_0x9cd5('0x69')](_0xaa50a)&&(_0x58ae2e[_0xaa50a][_0x9cd5('0x38')]==='preview'||_0x58ae2e[_0xaa50a][_0x9cd5('0x38')]===_0x9cd5('0x6a'))&&_0x58ae2e[_0xaa50a][_0x9cd5('0x29')]==='outbound'){if(this[_0x9cd5('0x19')]>0x7){this[_0x9cd5('0x19')]=0x0;this[_0x9cd5('0x6b')]();}}if(_0x58ae2e[_0x9cd5('0x69')](_0xaa50a)&&_0x58ae2e[_0xaa50a]['dialMethod']===_0x9cd5('0x8')&&_0x58ae2e[_0xaa50a][_0x9cd5('0x29')]===_0x9cd5('0x2a')){if(_0x58ae2e[_0xaa50a][_0x9cd5('0x37')]){this[_0x9cd5('0x6c')](_0x58ae2e[_0xaa50a]);if(_0x58ae2e[_0xaa50a][_0x9cd5('0x6d')])this[_0x9cd5('0x6e')](_0x58ae2e[_0xaa50a]);}else{notSendMessagesQueue(_0x58ae2e[_0xaa50a]);}}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x6f')]=function(_0x200d64){var _0x3962c2=this;this[_0x9cd5('0x15')][_0x9cd5('0x12')](function(){if(!_[_0x9cd5('0x70')](_0x3962c2[_0x9cd5('0x17')][_0x200d64])){loggerAction[_0x9cd5('0x5b')](_0x9cd5('0x71'),_0x200d64,_0x9cd5('0x72'),_0x3962c2['actions'][_0x200d64][_0x9cd5('0x73')],_0x9cd5('0x74'),JSON[_0x9cd5('0x59')](_0x3962c2[_0x9cd5('0x27')][_0x3962c2['actions'][_0x200d64][_0x9cd5('0x73')]][_0x9cd5('0x50')]),'pTalking:\x20',JSON[_0x9cd5('0x59')](_0x3962c2[_0x9cd5('0x27')][_0x3962c2[_0x9cd5('0x17')][_0x200d64][_0x9cd5('0x73')]][_0x9cd5('0x2f')]),JSON[_0x9cd5('0x59')](_0x3962c2[_0x9cd5('0x17')][_0x200d64][_0x9cd5('0x75')]),JSON['stringify'](_['pick'](_0x3962c2[_0x9cd5('0x17')][_0x200d64],[_0x9cd5('0x76'),_0x9cd5('0x77'),_0x9cd5('0x78'),'ListId'])));return ami[_0x9cd5('0x79')]({'action':'status','channel':_0x3962c2['actions'][_0x200d64][_0x9cd5('0x7a')]})[_0x9cd5('0x7b')](function(_0x34c5eb){if(_0x34c5eb['message']===_0x9cd5('0x7c')){setTimeout(function(){if(_0x3962c2[_0x9cd5('0x17')][_0x200d64]){ut[_0x9cd5('0x7d')](_0x3962c2[_0x9cd5('0x27')][_0x3962c2[_0x9cd5('0x17')][_0x200d64][_0x9cd5('0x73')]],'[clearZombieChannel]');if(_0x3962c2['actions'][_0x200d64][_0x9cd5('0x75')]===!![]){ut[_0x9cd5('0x7e')](_0x3962c2[_0x9cd5('0x27')][_0x3962c2[_0x9cd5('0x17')][_0x200d64][_0x9cd5('0x73')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x200d64,_0x3962c2['actions'][_0x200d64][_0x9cd5('0x73')]);}ut[_0x9cd5('0x7f')](_0x9cd5('0x80')+_0x200d64,_0x3962c2[_0x9cd5('0x17')][_0x200d64][_0x9cd5('0x73')]);delete _0x3962c2[_0x9cd5('0x17')][_0x200d64];}},0x2328);}});}});};Preview[_0x9cd5('0x11')][_0x9cd5('0x6b')]=function(){var _0x1249a7=this;loggerAction[_0x9cd5('0x5b')](_0x9cd5('0x81'),_[_0x9cd5('0x82')](this[_0x9cd5('0x17')]));for(var _0x3a15af in this['actions']){if(_0x1249a7[_0x9cd5('0x17')][_0x9cd5('0x69')](_0x3a15af)){_0x1249a7['clearZombieChannel'](_0x3a15af);}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x6e')]=function(_0xf73845){var _0x1c1812=this;rpcDb[_0x9cd5('0x83')](_0xf73845['id'],ut[_0x9cd5('0x84')](this[_0x9cd5('0x18')]))['then'](function(_0x538ffa){if(!_[_0x9cd5('0x70')](_0x538ffa)){for(var _0x472456=0x0;_0x472456<_0x538ffa[_0x9cd5('0x85')];_0x472456+=0x1){if(ut[_0x9cd5('0x86')](_0x538ffa[_0x472456][_0x9cd5('0x87')])<_0xf73845[_0x9cd5('0x88')]*0x3c){if(_0x538ffa[_0x472456][_0x9cd5('0x89')]&&!_0x538ffa[_0x472456][_0x9cd5('0x89')][_0x9cd5('0x8a')]){_0x1c1812[_0x9cd5('0x8b')](_0x538ffa[_0x472456]['id'])[_0x9cd5('0x8c')](ut[_0x9cd5('0x8d')](_0x9cd5('0x8e')))[_0x9cd5('0x7b')](ut['logger2']('[RecallMe]'));}else{rpcDb[_0x9cd5('0x8f')](_0x538ffa[_0x472456]['id']);}}else{var _0x94de58=new Action(_0x538ffa[_0x472456],_0xf73845);_0x94de58[_0x9cd5('0x90')]=moment()['format'](_0x9cd5('0x91'));_0xf73845['outboundReCallsDay']+=0x1;ut[_0x9cd5('0x92')](_0x94de58,0x17,_0x9cd5('0x93'));if(_0xf73845[_0x9cd5('0x94')]){rpcDb['rescheduleContactInQueue'](ut[_0x9cd5('0x95')](_0x538ffa[_0x472456]));rpcDb[_0x9cd5('0x96')](_0x94de58,_0x9cd5('0x97'));}else{ut[_0x9cd5('0x92')](_0x94de58,0x16,_0x9cd5('0x98'));rpcDb['createCustomerHistory'](_0x94de58,_0x9cd5('0x99'));rpcDb['createCustomerFinal'](_0x94de58,_0x9cd5('0x99'));}}}}})['catch'](ut[_0x9cd5('0x8d')](_0x9cd5('0x9a')));};Preview[_0x9cd5('0x11')][_0x9cd5('0x6c')]=function(_0x50c6fb){_0x50c6fb[_0x9cd5('0x5f')]=!![];if(ut[_0x9cd5('0x9b')](_0x50c6fb[_0x9cd5('0x2e')])){_0x50c6fb[_0x9cd5('0x61')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x9cd5('0x9c')](_0x50c6fb[_0x9cd5('0x37')])){_0x50c6fb['message']=_0x9cd5('0x62');}else if(!this[_0x9cd5('0x9d')](_0x50c6fb[_0x9cd5('0x55')])){if(!this[_0x9cd5('0x9d')](_0x50c6fb[_0x9cd5('0x9e')])){_0x50c6fb['message']=_0x9cd5('0x9f');}else{_0x50c6fb[_0x9cd5('0x61')]=_0x9cd5('0xa0');}}else{_0x50c6fb[_0x9cd5('0x61')]=_0x9cd5('0xa0');}emitCampaignPreview(_0x50c6fb);};Preview[_0x9cd5('0x11')][_0x9cd5('0xa1')]=function(_0x35120d,_0x1b037f,_0x5d0599){var _0x1b00d4=this;var _0x3b715e=this['actions'][_0x1b037f];var _0x4baea3=this[_0x9cd5('0x27')][_0x3b715e[_0x9cd5('0x73')]];var _0x594544;if(_0x4baea3){switch(_0x5d0599){case'1':_0x4baea3['outboundNoSuchCallsDay']+=0x1;_0x3b715e[_0x9cd5('0xa2')]+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x0,'NoSuchNumber');ami['emit'](_0x9cd5('0xa5'),ut[_0x9cd5('0xa6')](_0x3b715e,_0x9cd5('0xa7')));rpcDb[_0x9cd5('0x96')](_0x3b715e,_0x9cd5('0xa8'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3[_0x9cd5('0xa9')]){_0x594544=ut[_0x9cd5('0xaa')](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb['createCustomerFinal'](_0x594544,_0x9cd5('0xac'));}else{if(_0x3b715e['countnosuchnumberretry']>=_0x4baea3[_0x9cd5('0xad')]){rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xac'));}else{rpcDb[_0x9cd5('0xaf')](ut['scheduledAt'](_0x3b715e,_0x9cd5('0xa2'),_0x4baea3['dialNoSuchNumberRetryFrequency']),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}delete this[_0x9cd5('0x17')][_0x35120d[_0x9cd5('0xb2')]];break;case'ANSWER':var _0x3c7cc4=moment()[_0x9cd5('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b715e[_0x9cd5('0xb3')]=_0x3c7cc4;_0x3b715e['answertime']=_0x3c7cc4;_0x3b715e[_0x9cd5('0x75')]=!![];_0x4baea3['pTalking']+=0x1;logger['info'](_0x9cd5('0xb4'),_0x3b715e[_0x9cd5('0xb5')],_0x9cd5('0xb6'),_0x4baea3[_0x9cd5('0x2b')],_0x9cd5('0xb7'),_0x4baea3[_0x9cd5('0x2f')]);ami['emit'](_0x9cd5('0xb8'),ut[_0x9cd5('0xa6')](_0x3b715e,_0x9cd5('0xb9'),this['campaignsPreview'][_0x3b715e['queue']]));if(_0x4baea3[_0x9cd5('0xba')]){ami[_0x9cd5('0x28')](_0x9cd5('0xbb'),ut[_0x9cd5('0xbc')](_0x3b715e));}break;case'16':ami[_0x9cd5('0x28')](_0x9cd5('0xbd'),ut[_0x9cd5('0xa6')](_0x3b715e,_0x9cd5('0xbe'),this[_0x9cd5('0x27')][_0x3b715e[_0x9cd5('0x73')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3b715e,_0x9cd5('0xbe')));_0x4baea3['outboundAnswerCallsDay']+=0x1;_0x4baea3[_0x9cd5('0x33')]+=0x1;_0x4baea3[_0x9cd5('0xbf')]+=0x1;ut[_0x9cd5('0x7e')](_0x4baea3,'[16]');_0x3b715e[_0x9cd5('0xa3')]=ut['totalGlobal'](_0x3b715e);ut['logCustomer'](_0x3b715e,0x4,_0x9cd5('0xc0'));rpcDb[_0x9cd5('0x96')](_0x3b715e,_0x9cd5('0xc1'));rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xc2'));rpcDb[_0x9cd5('0xc3')](_0x3b715e);_0x4baea3['sumDuration']+=_0x3b715e[_0x9cd5('0xc4')];_0x4baea3[_0x9cd5('0x30')]+=_0x3b715e[_0x9cd5('0xc4')];logger[_0x9cd5('0x5b')]('[syncHangup][talking][decrement]',_0x3b715e[_0x9cd5('0xb5')],_0x9cd5('0xb6'),_0x4baea3[_0x9cd5('0x2b')],_0x9cd5('0xb7'),_0x4baea3[_0x9cd5('0x2f')]);delete this['actions'][_0x35120d[_0x9cd5('0xb2')]];break;case _0x9cd5('0xc5'):_0x4baea3[_0x9cd5('0x3c')]+=0x1;_0x3b715e[_0x9cd5('0xc6')]+=0x1;_0x3b715e['countglobal']=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x5,_0x9cd5('0xc7'));ami[_0x9cd5('0x28')](_0x9cd5('0xc8'),ut[_0x9cd5('0xa6')](_0x3b715e,'busy'));rpcDb[_0x9cd5('0x96')](_0x3b715e,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3['dialGlobalMaxRetry']){_0x594544=ut[_0x9cd5('0xaa')](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb[_0x9cd5('0xae')](_0x594544,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3b715e[_0x9cd5('0xc6')]>=_0x4baea3['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x3b715e,_0x9cd5('0xc9'));}else{rpcDb[_0x9cd5('0xaf')](ut[_0x9cd5('0xca')](_0x3b715e,'countbusyretry',_0x4baea3[_0x9cd5('0xcb')]),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}break;case _0x9cd5('0xcc'):_0x4baea3[_0x9cd5('0x40')]+=0x1;_0x3b715e['countnoanswerretry']+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x3,_0x9cd5('0xcd'));ami['emit'](_0x9cd5('0xce'),ut[_0x9cd5('0xa6')](_0x3b715e,_0x9cd5('0xcf')));rpcDb['createCustomerHistory'](_0x3b715e,_0x9cd5('0xd0'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3['dialGlobalMaxRetry']){_0x594544=ut['cloneAction'](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb['createCustomerFinal'](_0x594544,_0x9cd5('0xd1'));}else{if(_0x3b715e['countnoanswerretry']>=_0x4baea3[_0x9cd5('0xd2')]){rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xd0'));}else{rpcDb['rescheduleContact'](ut[_0x9cd5('0xca')](_0x3b715e,'countnoanswerretry',_0x4baea3[_0x9cd5('0xd3')]),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}break;case _0x9cd5('0xd4'):_0x4baea3['outboundCongestionCallsDay']+=0x1;_0x3b715e['countcongestionretry']+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x8,_0x9cd5('0xd5'));ami[_0x9cd5('0x28')]('custom:agentcongestion',ut['buildObj'](_0x3b715e,_0x9cd5('0xd6')));rpcDb['createCustomerHistory'](_0x3b715e,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3['dialGlobalMaxRetry']){_0x594544=ut[_0x9cd5('0xaa')](_0x3b715e,0xf,'Global');rpcDb[_0x9cd5('0xae')](_0x594544,_0x9cd5('0xd7'));}else{if(_0x3b715e[_0x9cd5('0xd8')]>=_0x4baea3[_0x9cd5('0xd9')]){rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xda'));}else{rpcDb[_0x9cd5('0xaf')](ut[_0x9cd5('0xca')](_0x3b715e,_0x9cd5('0xd8'),_0x4baea3[_0x9cd5('0xcb')]),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}break;case _0x9cd5('0xdb'):_0x4baea3[_0x9cd5('0x44')]+=0x1;_0x3b715e[_0x9cd5('0xdc')]+=0x1;_0x3b715e['countglobal']=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x14,'AgentReject');ami[_0x9cd5('0x28')](_0x9cd5('0xdd'),ut[_0x9cd5('0xa6')](_0x3b715e,_0x9cd5('0xde')));rpcDb[_0x9cd5('0x96')](_0x3b715e,_0x9cd5('0xdf'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3['dialGlobalMaxRetry']){_0x594544=ut[_0x9cd5('0xaa')](_0x3b715e,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x594544,_0x9cd5('0xe0'));}else{if(_0x3b715e[_0x9cd5('0xdc')]>=_0x4baea3[_0x9cd5('0xe1')]){rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xe0'));}else{rpcDb[_0x9cd5('0xaf')](ut['scheduledAt'](_0x3b715e,_0x9cd5('0xdc'),_0x4baea3[_0x9cd5('0xe2')]),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}break;case _0x9cd5('0xe3'):_0x4baea3[_0x9cd5('0x46')]+=0x1;_0x3b715e[_0x9cd5('0xe4')]+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut['totalGlobal'](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0xb,_0x9cd5('0xe5'));rpcDb[_0x9cd5('0x96')](_0x3b715e,_0x9cd5('0xe6'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3[_0x9cd5('0xa9')]){_0x594544=ut['cloneAction'](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb['createCustomerFinal'](_0x594544,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3b715e[_0x9cd5('0xe7')]>=_0x4baea3[_0x9cd5('0xe8')]){rpcDb['createCustomerFinal'](_0x3b715e,_0x9cd5('0xe6'));}else{rpcDb[_0x9cd5('0xaf')](ut[_0x9cd5('0xca')](_0x3b715e,_0x9cd5('0xe4'),_0x4baea3[_0x9cd5('0xe9')]),_0x3b715e[_0x9cd5('0xb0')],_0x3b715e[_0x9cd5('0xb1')]);}}break;case'18':_0x4baea3[_0x9cd5('0x45')]+=0x1;_0x3b715e[_0x9cd5('0xea')]+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0x12,_0x35120d['cause-txt']||_0x35120d['dialstatus']);ami[_0x9cd5('0x28')](_0x9cd5('0xeb'),ut['buildObj'](_0x3b715e,_0x9cd5('0xec')));rpcDb['createCustomerHistory'](_0x3b715e,_0x9cd5('0xed'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3['dialGlobalMaxRetry']){_0x594544=ut['cloneAction'](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb[_0x9cd5('0xae')](_0x594544,_0x9cd5('0xed'));}else{rpcDb[_0x9cd5('0xae')](_0x3b715e,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x9cd5('0x17')][_0x35120d['linkedid']];break;case'19':_0x4baea3[_0x9cd5('0x45')]+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut['logCustomer'](_0x3b715e,0x13,_0x35120d['cause-txt']||_0x35120d[_0x9cd5('0xee')]);ami[_0x9cd5('0x28')](_0x9cd5('0xeb'),ut['buildObj'](_0x3b715e,_0x9cd5('0xec')));rpcDb[_0x9cd5('0x96')](_0x3b715e,_0x9cd5('0xef'));if(ut[_0x9cd5('0xa4')](_0x3b715e)>=_0x4baea3[_0x9cd5('0xa9')]){_0x594544=ut[_0x9cd5('0xaa')](_0x3b715e,0xf,'Global');rpcDb[_0x9cd5('0xae')](_0x594544,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x9cd5('0xae')](_0x3b715e,_0x9cd5('0xef'));}delete this[_0x9cd5('0x17')][_0x35120d['linkedid']];break;default:if(_0x3b715e['dialAnswer']){ut[_0x9cd5('0x7e')](_0x4baea3,_0x9cd5('0xf0'));ut['loggerError'](_0x9cd5('0xf1')+_0x4baea3[_0x9cd5('0x2b')],_0x35120d);}_0x4baea3['outboundUnknownCallsDay']+=0x1;_0x3b715e[_0x9cd5('0xa3')]=ut[_0x9cd5('0xa4')](_0x3b715e);ut[_0x9cd5('0x92')](_0x3b715e,0xc,_0x35120d[_0x9cd5('0xf2')]||_0x35120d['dialstatus']);rpcDb[_0x9cd5('0x96')](_0x3b715e,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x3b715e)>=_0x4baea3[_0x9cd5('0xa9')]){_0x594544=ut['cloneAction'](_0x3b715e,0xf,_0x9cd5('0xab'));rpcDb[_0x9cd5('0xae')](_0x594544,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x9cd5('0xae')](_0x3b715e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x9cd5('0x17')][_0x35120d[_0x9cd5('0xb2')]];}if(!(_0x3b715e[_0x9cd5('0x75')]&&_0x5d0599==='16')){ut['updateOriginated'](_0x4baea3,_0x9cd5('0xf3'));logger[_0x9cd5('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0x3b715e[_0x9cd5('0xb5')],_0x9cd5('0xb6'),_0x4baea3[_0x9cd5('0x2b')],'originated:\x20',_0x4baea3['originated']);}if(_0x5d0599!==_0x9cd5('0xf4')){delete this['actions'][_0x35120d['linkedid']];delete this[_0x9cd5('0x17')][_0x35120d['destlinkedid']];}}};Preview[_0x9cd5('0x11')][_0x9cd5('0xf5')]=function(_0x5e8757,_0x58fc27,_0x4b2713){if(_[_0x9cd5('0xf6')](_0x58fc27)&&_0x9cd5('0xf7')!==typeof _0x58fc27){return;}if(_['isUndefined'](_0x4b2713)&&_0x9cd5('0xf7')!==typeof _0x4b2713){return;}switch(_0x4b2713[_0x9cd5('0xf8')]){case'0':ut[_0x9cd5('0xf9')](_0x5e8757,0x0,_0x9cd5('0xfa'));rpcDb[_0x9cd5('0xfb')](_0x5e8757,_0x9cd5('0xfc'));break;case'3':ut['logAgent'](_0x5e8757,0x3,'NoAnswer');rpcDb[_0x9cd5('0xfb')](_0x5e8757,_0x9cd5('0xfd'));break;case'5':ut['logAgent'](_0x5e8757,0x5,_0x9cd5('0xc7'));rpcDb[_0x9cd5('0xfb')](_0x5e8757,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x9cd5('0xf9')](_0x5e8757,0x8,'Congestion');rpcDb[_0x9cd5('0xfb')](_0x5e8757,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x5e8757,0x16,_0x9cd5('0xfe'));rpcDb['createAgentHistory'](_0x5e8757,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x5e8757,0xc,_0x4b2713['reason']);rpcDb[_0x9cd5('0xfb')](_0x5e8757,'[callProgressDetectingAgent][logCongestion]');}ut[_0x9cd5('0x7d')](_0x58fc27,_0x9cd5('0xff'));logger[_0x9cd5('0x5b')](_0x9cd5('0x100'),_0x5e8757['uniqueid'],_0x9cd5('0xb6'),_0x58fc27['name'],_0x9cd5('0x74'),_0x58fc27[_0x9cd5('0x50')]);delete this[_0x9cd5('0x17')][_0x5e8757[_0x9cd5('0xb5')]];};Preview['prototype'][_0x9cd5('0x101')]=function(_0x12db08,_0x352f5c,_0x1545c3,_0x1f35d5,_0x265077){var _0xd813e=this;return new BPromise(function(_0x4bbae2,_0x504ae9){if(_[_0x9cd5('0x70')](_0x352f5c)||_['isNil'](_0x352f5c[_0x9cd5('0x102')])||_[_0x9cd5('0x70')](_0x352f5c['Contact']['phone'])||_[_0x9cd5('0x70')](_0x352f5c['VoiceQueueId'])){_0x504ae9(ut[_0x9cd5('0x61')](_0x9cd5('0x103'),_0x1f35d5,_0x265077));return;}var _0x54566d=uuid['v4']();var _0x373644=_0xd813e[_0x9cd5('0x27')][_0x352f5c[_0x9cd5('0x72')][_0x9cd5('0x2b')]];var _0xaba61a=_0x1545c3?_0xd813e[_0x9cd5('0x18')][_0x1545c3]['id']:undefined;_0xd813e[_0x9cd5('0x17')][_0x54566d]=new Action(_0x352f5c,_0x373644,_0x54566d,_0x1545c3,_0xaba61a);var _0x491ed8=_0xd813e[_0x9cd5('0x17')][_0x54566d];_0x491ed8[_0x9cd5('0xb0')]=_0x1f35d5;_0x491ed8['activeContact']=_0x265077;_0x491ed8[_0x9cd5('0x104')]=_0x1545c3;if(_[_0x9cd5('0x105')](_0x12db08)){_0xd813e[_0x9cd5('0x106')](_0x491ed8,_0x373644,_0x352f5c,_0x1545c3)[_0x9cd5('0x8c')](function(_0x36050e){logger[_0x9cd5('0x5b')](_0x9cd5('0x107'),_0x9cd5('0x108')+_0x491ed8[_0x9cd5('0x73')]+'\x20IdHopper:\x20'+_0x491ed8['idContact'],JSON[_0x9cd5('0x59')](_0x36050e));ami[_0x9cd5('0x28')](_0x9cd5('0x109'),ut[_0x9cd5('0xa6')](_0x491ed8,_0x9cd5('0x10a'),_0xd813e[_0x9cd5('0x27')][_0x491ed8[_0x9cd5('0x73')]]));_0x4bbae2(ut[_0x9cd5('0x61')]('Calling'));})[_0x9cd5('0x7b')](function(_0x23cab8){ut[_0x9cd5('0x63')](_0x9cd5('0x10b'),_0x23cab8);_0x504ae9(ut[_0x9cd5('0x61')](_0x9cd5('0x10c'),_0x1f35d5,_0x265077));});}else{_0x373644[_0x9cd5('0x3b')]+=0x1;ut[_0x9cd5('0x10d')](_0x491ed8);rpcDb[_0x9cd5('0x10e')](_0x491ed8,_0x9cd5('0x10f'));delete _0xd813e[_0x9cd5('0x17')][_0x54566d];_0x504ae9(ut[_0x9cd5('0x61')](_0x9cd5('0x110'),_0x1f35d5,_0x265077));}});};Preview[_0x9cd5('0x11')][_0x9cd5('0x9d')]=function(_0x56c8a7){return!_[_0x9cd5('0x70')](_0x56c8a7)&&!_[_0x9cd5('0x70')](_0x56c8a7[_0x9cd5('0x2b')])&&!_[_0x9cd5('0x70')](_0x56c8a7[_0x9cd5('0x56')])&&_0x56c8a7['active']&&!_['isNil'](this[_0x9cd5('0x16')][util[_0x9cd5('0x5c')](_0x9cd5('0x111'),_0x56c8a7[_0x9cd5('0x2b')])])&&!_[_0x9cd5('0x70')](this[_0x9cd5('0x16')][util['format'](_0x9cd5('0x111'),_0x56c8a7['name'])][_0x9cd5('0x112')])&&(this[_0x9cd5('0x16')][util[_0x9cd5('0x5c')](_0x9cd5('0x111'),_0x56c8a7['name'])][_0x9cd5('0x112')]===_0x9cd5('0x113')||this['trunks'][util[_0x9cd5('0x5c')](_0x9cd5('0x111'),_0x56c8a7[_0x9cd5('0x2b')])]['status']===_0x9cd5('0x114'));};Preview[_0x9cd5('0x11')][_0x9cd5('0x8b')]=function(_0x502a08,_0x50f4b1){var _0x90a557=this;return new BPromise(function(_0x348da2,_0x4075e4){_0x90a557[_0x9cd5('0x115')](_0x502a08,_0x50f4b1)[_0x9cd5('0x8c')](function(_0x57dd6b){_0x348da2(_[_0x9cd5('0x116')](_0x57dd6b,['message']));})[_0x9cd5('0x7b')](function(_0x10b392){if(_0x10b392[_0x9cd5('0x117')]){rpcDb['unlockContact'](_0x502a08);}if(_0x10b392[_0x9cd5('0x56')]){rpcDb[_0x9cd5('0x8f')](_0x502a08);}_0x4075e4(_[_0x9cd5('0x116')](_0x10b392,[_0x9cd5('0x61')]));});});};Preview[_0x9cd5('0x11')][_0x9cd5('0x115')]=function(_0x15e4a9,_0x5e1dca){var _0x3a23b5=this;return new BPromise(function(_0x4a32c3,_0x19ecae){var _0x177bc7,_0x1f9289;rpcDb[_0x9cd5('0x118')](_0x15e4a9)[_0x9cd5('0x8c')](function(_0x2e0b58){if(!_['isNil'](_0x2e0b58[0x0])){_0x1f9289=_0x2e0b58[0x0][_0x9cd5('0x119')]?![]:!![];_0x177bc7=_0x2e0b58[0x0]['recallme']?!![]:![];_0x177bc7=_0x5e1dca?!![]:_0x177bc7;}var _0x93835a=_0x3a23b5[_0x9cd5('0x11a')](_0x2e0b58);if(_0x93835a[_0x9cd5('0x11b')]){rpcDb[_0x9cd5('0x11c')](_['pick'](_0x2e0b58[0x0],['VoiceQueueId',_0x9cd5('0x11d')]))[_0x9cd5('0x8c')](function(_0x2817a3){_0x3a23b5['checkInBlack'](_0x2817a3,_0x2e0b58[0x0],_0x5e1dca,_0x1f9289,_0x177bc7)[_0x9cd5('0x8c')](function(_0x1dc65b){_0x4a32c3(_0x1dc65b);})[_0x9cd5('0x7b')](function(_0x410378){_0x19ecae(_0x410378);});})[_0x9cd5('0x7b')](function(_0x170915){ut[_0x9cd5('0x63')](_0x9cd5('0x11e'),_0x170915);_0x19ecae(ut[_0x9cd5('0x61')]('Call\x20unsuccessful',_0x1f9289,_0x177bc7));});}else{_0x19ecae(ut[_0x9cd5('0x61')](_0x93835a[_0x9cd5('0x61')],_0x1f9289,_0x177bc7));}})[_0x9cd5('0x7b')](function(_0xa468ec){ut[_0x9cd5('0x63')](_0x9cd5('0x11f'),_0xa468ec);_0x19ecae(ut[_0x9cd5('0x61')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x9cd5('0x11')]['validateContact']=function(_0x4e2d6b){if(_['isNil'](_0x4e2d6b)||_[_0x9cd5('0x105')](_0x4e2d6b)||!_[_0x9cd5('0x70')](_0x4e2d6b[0x0]['Agent'])&&_[_0x9cd5('0x70')](_0x4e2d6b[0x0]['Agent'][_0x9cd5('0x2b')])){ut[_0x9cd5('0x63')](_0x9cd5('0x120'),_0x4e2d6b);return{'isValid':![],'message':_0x9cd5('0x121')};}var _0x389641=this[_0x9cd5('0x27')][_0x4e2d6b[0x0][_0x9cd5('0x72')][_0x9cd5('0x2b')]];_0x389641[_0x9cd5('0x61')]=_0x9cd5('0xa0');if(_['isNil'](_0x389641)){ut[_0x9cd5('0x63')]('[Preview][validateContact][Empty\x20Campaign]',_0x389641);return{'isValid':![],'message':_0x9cd5('0x122')};}if(!this['isTrunkReachable'](_0x389641[_0x9cd5('0x55')])){ut[_0x9cd5('0x63')](_0x9cd5('0x123'),'campaign\x20Name:\x20'+_0x389641[_0x9cd5('0x2b')]+_0x9cd5('0x124'));if(!this[_0x9cd5('0x9d')](_0x389641[_0x9cd5('0x9e')])){ut[_0x9cd5('0x63')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x389641[_0x9cd5('0x2b')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x9cd5('0x125')};}}if(!ut[_0x9cd5('0x9c')](_0x389641['dialActive'])){ut[_0x9cd5('0x63')](_0x9cd5('0x126'),_0x389641['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x389641[_0x9cd5('0x2b')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x9cd5('0x127')};};Preview[_0x9cd5('0x11')][_0x9cd5('0x106')]=function(_0x2a4db3,_0x57884b,_0x5a7668,_0x82bc74){var _0xbc0826=this;return new BPromise(function(_0x3515fc,_0x362e9f){var _0x39fbd1=_0x2a4db3[_0x9cd5('0xb5')];var _0x21fd2c=_0xbc0826['isTrunkReachable'](_0x57884b[_0x9cd5('0x55')])?util[_0x9cd5('0x5c')](_0x9cd5('0x128'),_0x57884b['Trunk']['name'],_[_0x9cd5('0x70')](_0x57884b[_0x9cd5('0x3a')])?'':_0x57884b['dialPrefix'][_0x9cd5('0x129')]()||'',_0x57884b[_0x9cd5('0x12a')]>0x0?_0x5a7668[_0x9cd5('0x102')][_0x9cd5('0x12b')]['substring'](_0x57884b[_0x9cd5('0x12a')]):_0x5a7668['Contact'][_0x9cd5('0x12b')]):util[_0x9cd5('0x5c')]('SIP/%s/%s%s',_[_0x9cd5('0x70')](_0x57884b[_0x9cd5('0x9e')])?_0x57884b['Trunk'][_0x9cd5('0x2b')]:_0x57884b[_0x9cd5('0x9e')]['name'],_[_0x9cd5('0x70')](_0x57884b[_0x9cd5('0x3a')])?'':_0x57884b[_0x9cd5('0x3a')][_0x9cd5('0x129')]()||'',_0x57884b[_0x9cd5('0x12a')]>0x0?_0x5a7668[_0x9cd5('0x102')][_0x9cd5('0x12b')][_0x9cd5('0x12c')](_0x57884b[_0x9cd5('0x12a')]):_0x5a7668[_0x9cd5('0x102')][_0x9cd5('0x12b')]);var _0x4c2f4c=_0xbc0826[_0x9cd5('0x9d')](_0x57884b[_0x9cd5('0x55')])?ut['getCallerId'](_0x57884b[_0x9cd5('0x55')]['callerid'],_0x57884b[_0x9cd5('0x39')],_0x57884b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x9cd5('0x12d')](_0x57884b[_0x9cd5('0x12e')],_0x57884b[_0x9cd5('0x12f')]):_0x57884b[_0x9cd5('0x12e')]):ut[_0x9cd5('0x130')](_['isNil'](_0x57884b[_0x9cd5('0x9e')])?_0x57884b[_0x9cd5('0x55')][_0x9cd5('0x57')]:_0x57884b[_0x9cd5('0x9e')]['callerid'],_0x57884b[_0x9cd5('0x39')],_0x57884b[_0x9cd5('0x12f')]>0x0?ut[_0x9cd5('0x12d')](_0x57884b[_0x9cd5('0x12e')],_0x57884b[_0x9cd5('0x12f')]):_0x57884b[_0x9cd5('0x12e')]);if(_0x4c2f4c){_0x2a4db3[_0x9cd5('0x131')]=ut[_0x9cd5('0x132')](_0x4c2f4c);_0x2a4db3['originatecalleridnum']=ut[_0x9cd5('0x133')](_0x4c2f4c);}var _0x527732=ut['addVariables'](_0x57884b,_0x5a7668,_0x21fd2c,_0x4c2f4c,_0x39fbd1,_0x2a4db3);_[_0x9cd5('0x134')](_0x2a4db3,ut['toLowerVariables'](_0x527732));_0x2a4db3[_0x9cd5('0x90')]=moment()['format'](_0x9cd5('0x91'));ami[_0x9cd5('0x79')](ut[_0x9cd5('0x135')](_0x2a4db3,_0x57884b,_0x527732,_0x2a4db3[_0x9cd5('0xb1')],_0x82bc74))['then'](function(_0x409c70){_0x57884b['originated']+=0x1;logger[_0x9cd5('0x5b')](_0x9cd5('0x136'),_0x39fbd1,_0x9cd5('0xb6'),_0x57884b[_0x9cd5('0x2b')],_0x9cd5('0x74'),_0x57884b[_0x9cd5('0x50')]);_0x3515fc(_0x409c70);})[_0x9cd5('0x7b')](function(_0x28fb8a){ut[_0x9cd5('0xf9')](_0x2a4db3,0xe,_0x9cd5('0x137'));rpcDb['createAgentHistory'](_0x2a4db3,_0x9cd5('0x138'));_0x362e9f(_0x28fb8a);});});};Preview[_0x9cd5('0x11')][_0x9cd5('0x139')]=function(_0xd9794d){if(this['actions'][_0xd9794d[_0x9cd5('0xb2')]]){this[_0x9cd5('0x17')][_0xd9794d['linkedid']][_0x9cd5('0x7a')]=_0xd9794d[_0x9cd5('0x7a')];}};Preview[_0x9cd5('0x11')]['syncOriginateResponse']=function(_0x4c0a48){var _0x269225=this;var _0x52cf93=this[_0x9cd5('0x17')][_0x4c0a48[_0x9cd5('0x13a')]];if(_0x52cf93){if(_0x52cf93[_0x9cd5('0x104')]&&this[_0x9cd5('0x18')][_0x52cf93[_0x9cd5('0x104')]]){ut[_0x9cd5('0x13b')](_0x52cf93,this[_0x9cd5('0x18')][_0x52cf93['lookAgent']][_0x9cd5('0x2b')],this[_0x9cd5('0x18')][_0x52cf93[_0x9cd5('0x104')]]['id']);}var _0x593a89=_[_0x9cd5('0x13c')](_0x52cf93);_0x593a89['responsetime']=moment()[_0x9cd5('0x5c')](_0x9cd5('0x91'));var _0x8ddd85=_0x269225[_0x9cd5('0x27')][_0x52cf93['queue']];if(ut[_0x9cd5('0x13d')](_0x4c0a48[_0x9cd5('0x13e')])){if(_0x52cf93[_0x9cd5('0xb0')]){rpcDb[_0x9cd5('0x13f')](_0x52cf93[_0x9cd5('0x140')]);}if(_0x52cf93[_0x9cd5('0xb1')]){rpcDb[_0x9cd5('0x8f')](_0x52cf93[_0x9cd5('0x140')]);}ami[_0x9cd5('0x28')](_0x9cd5('0x141'),ut['buildObj'](_0x52cf93,_0x9cd5('0x142'),this[_0x9cd5('0x27')][_0x52cf93[_0x9cd5('0x73')]]));this['callProgressDetectingAgent'](_0x593a89,_0x8ddd85,_0x4c0a48);}else{_0x52cf93[_0x9cd5('0x90')]=moment()[_0x9cd5('0x5c')](_0x9cd5('0x91'));ut['logAgent'](_0x593a89,0x4,_0x9cd5('0xc0'));rpcDb['createAgentHistory'](_0x593a89,_0x9cd5('0x143'));}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x144')]=function(_0x2ce635){var _0x2bac68=this;var _0x1bf315=this[_0x9cd5('0x17')][_0x2ce635[_0x9cd5('0xb2')]];var _0x252b20;if(_0x1bf315){_0x252b20=this[_0x9cd5('0x27')][_0x1bf315[_0x9cd5('0x73')]];logger[_0x9cd5('0x5b')]('[syncHangup][talking]',_0x2ce635[_0x9cd5('0xb2')],_0x9cd5('0xb6'),_0x252b20[_0x9cd5('0x2b')],_0x9cd5('0xb7'),_0x252b20['pTalking']);}if(this['actions'][_0x2ce635[_0x9cd5('0xb2')]]&&_0x2ce635[_0x9cd5('0xb2')]!==_0x2ce635[_0x9cd5('0xb5')]){if(_0x2ce635[_0x9cd5('0x145')]==='16'&&this[_0x9cd5('0x17')][_0x2ce635[_0x9cd5('0xb2')]][_0x9cd5('0x75')]){this[_0x9cd5('0xa1')](_0x2ce635,_0x2ce635[_0x9cd5('0xb2')],_0x2ce635[_0x9cd5('0x145')]);}else if(this[_0x9cd5('0x17')][_0x2ce635[_0x9cd5('0xb2')]][_0x9cd5('0x75')]){logger[_0x9cd5('0x5b')](_0x9cd5('0x146'),_0x2ce635[_0x9cd5('0xb2')],_0x2ce635[_0x9cd5('0x145')],_0x9cd5('0xb6'),_0x252b20[_0x9cd5('0x2b')],'pTalking:\x20',_0x252b20[_0x9cd5('0x2f')]);this[_0x9cd5('0xa1')](_0x2ce635,_0x2ce635[_0x9cd5('0xb2')],_0x2ce635['cause']);}}else if(_0x1bf315&&_[_0x9cd5('0x70')](_0x1bf315['statedesc'])&&_0x252b20[_0x9cd5('0x147')]&&_0x2ce635['linkedid']===_0x2ce635[_0x9cd5('0xb5')]&&_[_0x9cd5('0x70')](_0x2ce635['reason'])&&_0x2ce635['cause']==='16'&&_0x2ce635['channelstate']==='6'&&_[_0x9cd5('0xf6')](_0x1bf315[_0x9cd5('0x148')])){if(_0x1bf315['unlockAgent']){rpcDb[_0x9cd5('0x13f')](_0x1bf315[_0x9cd5('0x140')]);}if(_0x1bf315[_0x9cd5('0xb1')]){rpcDb[_0x9cd5('0x8f')](_0x1bf315[_0x9cd5('0x140')]);}_0x2ce635[_0x9cd5('0xf8')]='22';this['callProgressDetectingAgent'](_0x1bf315,_0x252b20,_0x2ce635);}else if(_0x1bf315&&_0x1bf315[_0x9cd5('0x148')]){if(_0x2ce635[_0x9cd5('0x145')]==='16'&&this[_0x9cd5('0x17')][_0x2ce635[_0x9cd5('0xb2')]]['dialAnswer']){logger[_0x9cd5('0x5b')](_0x9cd5('0x149'),_0x2ce635[_0x9cd5('0xb2')],_0x2ce635['cause'],_0x9cd5('0xb6'),_0x252b20[_0x9cd5('0x2b')],'pTalking:\x20',_0x252b20[_0x9cd5('0x2f')]);this[_0x9cd5('0xa1')](_0x2ce635,_0x2ce635['linkedid'],_0x2ce635[_0x9cd5('0x145')]);}else if(this[_0x9cd5('0x17')][_0x2ce635['linkedid']]['dialAnswer']){logger[_0x9cd5('0x5b')]('[syncHangup][talking][cause]',_0x2ce635[_0x9cd5('0xb2')],_0x2ce635[_0x9cd5('0x145')],_0x9cd5('0xb6'),_0x252b20[_0x9cd5('0x2b')],_0x9cd5('0xb7'),_0x252b20[_0x9cd5('0x2f')]);this[_0x9cd5('0xa1')](_0x2ce635,_0x2ce635['linkedid'],_0x2ce635[_0x9cd5('0x145')]);}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x1e')]=function(_0x5cc594){if(this[_0x9cd5('0x17')][_0x5cc594['destlinkedid']]&&_0x5cc594[_0x9cd5('0x14a')]!==_0x5cc594[_0x9cd5('0x14b')]){this[_0x9cd5('0xa1')](_0x5cc594,_0x5cc594[_0x9cd5('0x14a')],_0x5cc594[_0x9cd5('0xee')]);}};Preview['prototype'][_0x9cd5('0x1d')]=function(_0x5f2a06){if(this[_0x9cd5('0x17')][_0x5f2a06[_0x9cd5('0xb2')]]&&_0x5f2a06['linkedid']!==_0x5f2a06[_0x9cd5('0xb5')]&&!this['actions'][_0x5f2a06['linkedid']][_0x9cd5('0x75')]){if(_0x5f2a06[_0x9cd5('0x145')]==='1'){this[_0x9cd5('0xa1')](_0x5f2a06,_0x5f2a06[_0x9cd5('0xb2')],_0x5f2a06[_0x9cd5('0x145')]);}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x14c')]=function(_0x53e1ef,_0xfe62d1,_0x2fd2d2){if(this['actions'][_0x53e1ef]){if(_[_0x9cd5('0x70')](this[_0x9cd5('0x17')][_0x53e1ef][_0x9cd5('0x14d')])){this[_0x9cd5('0x17')][_0x53e1ef][_0x9cd5('0x14d')]={};}this[_0x9cd5('0x17')][_0x53e1ef][_0x9cd5('0x14d')][_0xfe62d1]=_0x2fd2d2;}};Preview[_0x9cd5('0x11')]['syncVarSet']=function(_0x150c19){try{if(!_[_0x9cd5('0x70')](_0x150c19)){if(ut['filterKey'](_[_0x9cd5('0x14e')](_0x150c19[_0x9cd5('0x14f')])[0x0])){this[_0x9cd5('0x14c')](_0x150c19[_0x9cd5('0xb5')],_['keys'](_0x150c19[_0x9cd5('0x14f')])[0x0],_0x150c19[_0x9cd5('0x150')]);}}}catch(_0x127652){logger[_0x9cd5('0x151')](_0x9cd5('0x152'),util['inspect'](_0x127652,{'showHidden':![],'depth':null}));}};Preview[_0x9cd5('0x11')][_0x9cd5('0x23')]=function(_0x36b8b2){if(_0x36b8b2){if(this[_0x9cd5('0x17')][_0x36b8b2[_0x9cd5('0x153')]]){this[_0x9cd5('0x17')][_0x36b8b2[_0x9cd5('0x153')]][_0x9cd5('0x148')]=!![];}}};Preview[_0x9cd5('0x11')][_0x9cd5('0x25')]=function(_0x56d272){if(_0x56d272){if(this[_0x9cd5('0x17')][_0x56d272[_0x9cd5('0x154')]]){this[_0x9cd5('0x17')][_0x56d272[_0x9cd5('0x154')]]['transfer']=!![];}}};module[_0x9cd5('0x155')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 196e9fd..974533d 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 _0xe3f7=['resolve','catch','[createHistory]\x20','then','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','membername','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','inspect'];(function(_0xdbcfc7,_0x26e454){var _0x39384b=function(_0x3c7fa1){while(--_0x3c7fa1){_0xdbcfc7['push'](_0xdbcfc7['shift']());}};_0x39384b(++_0x26e454);}(_0xe3f7,0x168));var _0x7e3f=function(_0x10b59a,_0x5a0ed4){_0x10b59a=_0x10b59a-0x0;var _0x435565=_0xe3f7[_0x10b59a];return _0x435565;};'use strict';var util=require(_0x7e3f('0x0'));var BPromise=require(_0x7e3f('0x1'));var logger=require(_0x7e3f('0x2'))('preview');var _=require(_0x7e3f('0x3'));var cmHopper=require(_0x7e3f('0x4'));var cmHopperFinal=require(_0x7e3f('0x5'));var cmHopperHistory=require(_0x7e3f('0x6'));var cmHopperBlack=require(_0x7e3f('0x7'));var voiceQueueRt=require(_0x7e3f('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x7e3f('0x9'));function loggerCatch(_0x474dd5){return function(_0x251f88){logger['error'](_0x474dd5,util[_0x7e3f('0xa')](_0x251f88,{'showHidden':![],'depth':null}));};}function create(_0x22ef3d){return BPromise[_0x7e3f('0xb')]()['then'](cmHopperHistory['createHistory'](_0x22ef3d))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0xd')));}function createAgent(_0x37bb7){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](agentReportPreview[_0x7e3f('0xf')](_0x37bb7))[_0x7e3f('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5d95f9){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](cmHopper[_0x7e3f('0x10')](_0x5d95f9,!![]))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x11')));}exports['checkIsBlackList']=function(_0x12601b){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](cmHopperBlack[_0x7e3f('0x12')](_0x12601b))[_0x7e3f('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x7e3f('0x13')]=function(_0x4d4d34){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](cmHopper[_0x7e3f('0x13')](_0x4d4d34))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x14')));};exports[_0x7e3f('0xf')]=function(_0x1b162a,_0x511994){create(_0x1b162a)['catch'](loggerCatch(_0x511994));moveContact(_0x1b162a)[_0x7e3f('0xc')](loggerCatch(_0x511994));};exports['createAgentHistory']=function(_0x5a38b8,_0x4ee396){createAgent(_0x5a38b8)[_0x7e3f('0xc')](loggerCatch(_0x4ee396));};exports['createCustomerHistory']=function(_0x5abd4d,_0x24986a){create(_0x5abd4d)[_0x7e3f('0xc')](loggerCatch(_0x24986a));};exports['createCustomerFinal']=function(_0x21d565,_0x16c381){moveContact(_0x21d565)['catch'](loggerCatch(_0x16c381));};exports['rescheduleContact']=function(_0x36bcd9,_0x474d44,_0x4a3d88){if(_0x474d44){_0x36bcd9['UserId']=null;}if(_0x4a3d88){_0x36bcd9[_0x7e3f('0x15')]=![];}return BPromise[_0x7e3f('0xb')]()['then'](cmHopper['rescheduleContact'](_0x36bcd9))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x16')));};exports[_0x7e3f('0x17')]=function(_0x4fa266){return BPromise[_0x7e3f('0xb')]()['then'](cmHopper[_0x7e3f('0x17')](_0x4fa266))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x7e3f('0x18')]=function(_0x2537d9){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](cmHopper[_0x7e3f('0x18')]({'UserId':null},_0x2537d9,0x1))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x19')));};exports[_0x7e3f('0x1a')]=function(_0x1f4631){return BPromise[_0x7e3f('0xb')]()['then'](cmHopper[_0x7e3f('0x18')]({'active':![]},_0x1f4631,0x1))[_0x7e3f('0xc')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x2e3ef2){var _0x26fe2a={};_0x26fe2a[_0x7e3f('0x1b')]=_0x2e3ef2[_0x7e3f('0x1b')];_0x26fe2a[_0x7e3f('0x1c')]=_0x2e3ef2[_0x7e3f('0x1c')];_0x26fe2a[_0x7e3f('0x1d')]=_0x2e3ef2[_0x7e3f('0x1d')];_0x26fe2a[_0x7e3f('0x1e')]=_0x2e3ef2[_0x7e3f('0x1e')];_0x26fe2a[_0x7e3f('0x1f')]=_0x2e3ef2['queue'];_0x26fe2a[_0x7e3f('0x20')]=_0x2e3ef2['answertime'];_0x26fe2a[_0x7e3f('0x21')]=_0x2e3ef2[_0x7e3f('0x22')];_0x26fe2a[_0x7e3f('0x23')]=0x1;_0x26fe2a[_0x7e3f('0x24')]=_0x2e3ef2[_0x7e3f('0x25')];_0x26fe2a[_0x7e3f('0x26')]=_0x2e3ef2['membername'];_0x26fe2a[_0x7e3f('0x27')]=_0x7e3f('0x28');_0x26fe2a[_0x7e3f('0x29')]=_0x7e3f('0x2a');_0x26fe2a['holdtime']=0x0;_0x26fe2a[_0x7e3f('0x2b')]=0x1;_0x26fe2a[_0x7e3f('0x2c')]=_0x2e3ef2[_0x7e3f('0x2d')];_0x26fe2a['queuecallerexitreason']=_0x7e3f('0x2e');return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](voiceQueueReport[_0x7e3f('0x2f')](_0x26fe2a))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x30')));};exports[_0x7e3f('0x31')]=function(_0x73114f,_0x5b2366){return BPromise[_0x7e3f('0xb')]()['then'](cmHopper['getContactRecallMe'](_0x73114f,_0x5b2366))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x32')));};exports[_0x7e3f('0x33')]=function(_0x1b45f4){return BPromise[_0x7e3f('0xb')]()[_0x7e3f('0xe')](cmHopper['rescheduleContact'](_0x1b45f4,!![],!![]))[_0x7e3f('0xc')](loggerCatch(_0x7e3f('0x34')));}; \ No newline at end of file +var _0x060b=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','endtime','connectedlinename','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20'];(function(_0x5a67b5,_0x362f51){var _0x395096=function(_0x1206c3){while(--_0x1206c3){_0x5a67b5['push'](_0x5a67b5['shift']());}};_0x395096(++_0x362f51);}(_0x060b,0x131));var _0xb060=function(_0x358d54,_0xe737c4){_0x358d54=_0x358d54-0x0;var _0x48739f=_0x060b[_0x358d54];return _0x48739f;};'use strict';var util=require(_0xb060('0x0'));var BPromise=require(_0xb060('0x1'));var logger=require(_0xb060('0x2'))('preview');var _=require(_0xb060('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xb060('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xb060('0x5'));var voiceQueueRt=require(_0xb060('0x6'));var agentReportPreview=require(_0xb060('0x7'));var voiceQueueReport=require(_0xb060('0x8'));function loggerCatch(_0x5c2ea5){return function(_0x4fe83e){logger[_0xb060('0x9')](_0x5c2ea5,util['inspect'](_0x4fe83e,{'showHidden':![],'depth':null}));};}function create(_0x17f2b6){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopperHistory[_0xb060('0xc')](_0x17f2b6))[_0xb060('0xd')](loggerCatch(_0xb060('0xe')));}function createAgent(_0x3ef273){return BPromise['resolve']()[_0xb060('0xb')](agentReportPreview[_0xb060('0xc')](_0x3ef273))[_0xb060('0xd')](loggerCatch(_0xb060('0xe')));}function moveContact(_0x42ea0f){return BPromise['resolve']()[_0xb060('0xb')](cmHopper[_0xb060('0xf')](_0x42ea0f,!![]))[_0xb060('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xb060('0x10')]=function(_0x36a63e){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopperBlack[_0xb060('0x10')](_0x36a63e))[_0xb060('0xd')](loggerCatch(_0xb060('0x11')));};exports[_0xb060('0x12')]=function(_0xeaa19e){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper[_0xb060('0x12')](_0xeaa19e))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xb060('0xc')]=function(_0x3777a0,_0x38f42b){create(_0x3777a0)['catch'](loggerCatch(_0x38f42b));moveContact(_0x3777a0)[_0xb060('0xd')](loggerCatch(_0x38f42b));};exports[_0xb060('0x13')]=function(_0x5a291d,_0x5cfd94){createAgent(_0x5a291d)['catch'](loggerCatch(_0x5cfd94));};exports[_0xb060('0x14')]=function(_0x4a8406,_0x3d345b){create(_0x4a8406)[_0xb060('0xd')](loggerCatch(_0x3d345b));};exports[_0xb060('0x15')]=function(_0x516de7,_0x327843){moveContact(_0x516de7)[_0xb060('0xd')](loggerCatch(_0x327843));};exports[_0xb060('0x16')]=function(_0x1032de,_0x3179ba,_0x3a5990){if(_0x3179ba){_0x1032de['UserId']=null;}if(_0x3a5990){_0x1032de[_0xb060('0x17')]=![];}return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper[_0xb060('0x16')](_0x1032de))[_0xb060('0xd')](loggerCatch(_0xb060('0x18')));};exports[_0xb060('0x19')]=function(_0x3efd92){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0x3efd92))[_0xb060('0xd')](loggerCatch(_0xb060('0x1a')));};exports[_0xb060('0x1b')]=function(_0x119036){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper[_0xb060('0x1b')]({'UserId':null},_0x119036,0x1))[_0xb060('0xd')](loggerCatch(_0xb060('0x1c')));};exports['disableContact']=function(_0x4c13d1){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper['unlockContact']({'active':![]},_0x4c13d1,0x1))[_0xb060('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0xb060('0x1d')]=function(_0x460fc9){var _0x2e4f24={};_0x2e4f24[_0xb060('0x1e')]=_0x460fc9['type'];_0x2e4f24[_0xb060('0x1f')]=_0x460fc9[_0xb060('0x1f')];_0x2e4f24[_0xb060('0x20')]=_0x460fc9['calleridnum'];_0x2e4f24['calleridname']=_0x460fc9[_0xb060('0x21')];_0x2e4f24['queue']=_0x460fc9[_0xb060('0x22')];_0x2e4f24['queuecallerjoinAt']=_0x460fc9['answertime'];_0x2e4f24[_0xb060('0x23')]=_0x460fc9[_0xb060('0x24')];_0x2e4f24[_0xb060('0x25')]=0x1;_0x2e4f24['queuecallercompleteAt']=_0x460fc9[_0xb060('0x26')];_0x2e4f24[_0xb060('0x27')]=_0x460fc9['membername'];_0x2e4f24[_0xb060('0x28')]=_0xb060('0x29');_0x2e4f24['exten']=_0xb060('0x2a');_0x2e4f24[_0xb060('0x2b')]=0x0;_0x2e4f24[_0xb060('0x2c')]=0x1;_0x2e4f24[_0xb060('0x2d')]=_0x460fc9[_0xb060('0x2e')];_0x2e4f24[_0xb060('0x2f')]=_0xb060('0x30');return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](voiceQueueReport[_0xb060('0x31')](_0x2e4f24))[_0xb060('0xd')](loggerCatch(_0xb060('0x32')));};exports[_0xb060('0x33')]=function(_0x23d02c,_0x5961e7){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper[_0xb060('0x33')](_0x23d02c,_0x5961e7))[_0xb060('0xd')](loggerCatch(_0xb060('0x34')));};exports[_0xb060('0x35')]=function(_0x3168c0){return BPromise[_0xb060('0xa')]()[_0xb060('0xb')](cmHopper['rescheduleContact'](_0x3168c0,!![],!![]))[_0xb060('0xd')](loggerCatch(_0xb060('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 11d24b8..cd7a26f 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 _0xd1d5=['xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','match','extractCalleridNumber','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','info','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','endtime','logAgent','responsetime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','channelAgent','not_inuse','status','createBody','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd1d5,0x129));var _0x5d1d=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xd1d5[_0x187ee1];return _0x388160;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x5d1d('0x0'));var logger=require(_0x5d1d('0x1'))(_0x5d1d('0x2'));var ipAgi=process[_0x5d1d('0x3')][_0x5d1d('0x4')]||'127.0.0.1';function getSeconds(_0xe26b93,_0x4b21bc){var _0x2d81c4=moment(_0xe26b93)[_0x5d1d('0x5')](0x0);var _0x337ae0=moment(_0x4b21bc)[_0x5d1d('0x5')](0x0);return _0x2d81c4[_0x5d1d('0x6')](_0x337ae0,_0x5d1d('0x7'));}exports[_0x5d1d('0x8')]=function(_0x4679ec){return function(_0xb371c4){logger[_0x5d1d('0x9')](_0x4679ec,util[_0x5d1d('0xa')](_0xb371c4,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2a1794,_0x201e0d){logger[_0x5d1d('0xb')](_0x2a1794,util[_0x5d1d('0xa')](_0x201e0d,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1125f3,_0x2b0197){logger[_0x5d1d('0x9')](_0x1125f3,util[_0x5d1d('0xa')](_0x2b0197,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x273461){return function(_0x4cc24b){logger['info'](_0x273461,util[_0x5d1d('0xa')](_0x4cc24b,{'showHidden':![],'depth':null}));};};exports[_0x5d1d('0xc')]=function(_0x6c8182,_0x45cfcb,_0x190169){return{'message':_0x6c8182,'unlock':_0x45cfcb,'active':_0x190169};};exports[_0x5d1d('0xd')]=function(_0x2bb110,_0x30ac7a,_0x4009f7){if(!_[_0x5d1d('0xe')](_0x4009f7)&&'string'===typeof _0x4009f7&&!_[_0x5d1d('0xf')](_0x4009f7)){if(!_['isUndefined'](_0x30ac7a)&&'string'===typeof _0x30ac7a&&!_[_0x5d1d('0xf')](_0x30ac7a)){return util[_0x5d1d('0x10')](_0x5d1d('0x11'),_0x30ac7a,_0x4009f7);}return util[_0x5d1d('0x10')]('\x22%s\x22\x20<%s>',_0x4009f7,_0x4009f7);}if(!_[_0x5d1d('0xe')](_0x2bb110)&&_0x5d1d('0x12')===typeof _0x2bb110&&!_['isEmpty'](_0x2bb110)){return _0x2bb110;}return _0x5d1d('0x13');};exports['isActive']=function(_0xbf7e66){if(_[_0x5d1d('0x14')](_0xbf7e66)){return![];}return _0xbf7e66;};exports[_0x5d1d('0x15')]=function(_0x347b71,_0x1d9d3c,_0x3b6d63,_0x25cf35,_0xe5252c,_0xe25723){var _0x33fc8a={'XMD-QUEUE':_0x1d9d3c[_0x5d1d('0x16')]?_0x1d9d3c[_0x5d1d('0x16')]['name']:'','XMD-CALLERID':_0x25cf35,'XMD-CALLERID-PREVIEW':_0xe25723?util['format']('\x22%s\x22\x20<%s>',_0xe25723[_0x5d1d('0x17')],_0xe25723[_0x5d1d('0x18')]):_0x25cf35,'XMD-DIALID':_0xe5252c,'XMD-CONTACTID':_0x1d9d3c[_0x5d1d('0x19')],'XMD-CDRTYPE':_0x5d1d('0x1a'),'CALLERID(all)':_0x25cf35,'XMD-VOICEQUEUEID':_0x1d9d3c[_0x5d1d('0x1b')],'XMD-DIALCHANNEL':_0x3b6d63,'XMD-DIALTIMEOUT':_0x347b71[_0x5d1d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x5d1d('0x10')](_0x5d1d('0x1d'),_0x347b71[_0x5d1d('0x1e')]?'g':'',_[_0x5d1d('0xf')](_0x347b71[_0x5d1d('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x347b71[_0x5d1d('0x20')]||'','XMD-AGI':_0x347b71[_0x5d1d('0x21')]?util[_0x5d1d('0x10')](_0x5d1d('0x22'),ipAgi,_0x347b71[_0x5d1d('0x21')]):_0x5d1d('0x23'),'XMD-AGIAFTER':_0x347b71['dialQueueProject2']?util[_0x5d1d('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x347b71[_0x5d1d('0x1e')]):_0x5d1d('0x23'),'XMD-ORIGINATECALLERIDNUM':_0xe25723?_0xe25723[_0x5d1d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0xe25723?_0xe25723[_0x5d1d('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x5d1d('0x26')};if(!_[_0x5d1d('0xf')](_0x347b71[_0x5d1d('0x1f')])){_0x33fc8a[util[_0x5d1d('0x10')]('%s',_0x5d1d('0x27'))]=_0x347b71[_0x5d1d('0x1f')];_0x33fc8a[util[_0x5d1d('0x10')]('%s',_0x5d1d('0x28'))]=_0xe5252c;}if(_0x1d9d3c&&_0x1d9d3c[_0x5d1d('0x29')]){for(var _0xd2155c in _0x1d9d3c['Contact']){if(_0x1d9d3c['Contact'][_0x5d1d('0x2a')](_0xd2155c)){if(!_[_0x5d1d('0x14')](_0x1d9d3c[_0x5d1d('0x29')][_0xd2155c])&&_0xd2155c!=='id'&&_0xd2155c!=='tags'&&_0xd2155c!=='createdAt'&&_0xd2155c!==_0x5d1d('0x2b')){_0x33fc8a[util[_0x5d1d('0x10')](_0x5d1d('0x2c'),_0x5d1d('0x2d'),_[_0x5d1d('0x2e')](_0xd2155c))]=_0x1d9d3c['Contact'][_0xd2155c];}}}}return _0x33fc8a;};exports[_0x5d1d('0x2f')]=function(_0x1b0e19){var _0x3e249c={};for(var _0x3bb580 in _0x1b0e19){if(_0x1b0e19[_0x5d1d('0x2a')](_0x3bb580)){_0x3e249c[util[_0x5d1d('0x10')]('%s',_[_0x5d1d('0x30')](_0x3bb580))]=_0x1b0e19[_0x3bb580];}}return{'variables':_0x3e249c};};exports[_0x5d1d('0x31')]=function(_0xcf9e42,_0x6b490d){if(!_['isNil'](_0xcf9e42)){if(_0xcf9e42[_0x5d1d('0x2a')]('originated')){if(_0xcf9e42['originated']>0x0){_0xcf9e42['originated']-=0x1;}else{logger[_0x5d1d('0x9')](_0x5d1d('0x32'),_0x6b490d);}}}else{logger[_0x5d1d('0x9')](_0x5d1d('0x33'),_0x6b490d);}};exports[_0x5d1d('0x34')]=function(_0x60fc91){var _0x5605cf=moment()['format'](_0x5d1d('0x35'));_0x60fc91[_0x5d1d('0x36')]=0xd;_0x60fc91[_0x5d1d('0x37')]=_0x5d1d('0x38');_0x60fc91['starttime']=_0x5605cf;_0x60fc91['responsetime']=_0x5605cf;_0x60fc91[_0x5d1d('0x39')]=_0x5605cf;};exports[_0x5d1d('0x3a')]=function(_0x3904fe,_0x3ebcdd,_0x5edbae){var _0x5c1ddf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3904fe[_0x5d1d('0x36')]=_0x3ebcdd;_0x3904fe[_0x5d1d('0x37')]=_0x5edbae;_0x3904fe[_0x5d1d('0x3b')]=_0x5c1ddf;_0x3904fe['ringtime']=getSeconds(_0x3904fe[_0x5d1d('0x3b')],_0x3904fe[_0x5d1d('0x3c')]);};exports[_0x5d1d('0x3d')]=function(_0x3ba3ca,_0x575532,_0x430098){_0x3ba3ca[_0x5d1d('0x3e')]=_0x575532;_0x3ba3ca[_0x5d1d('0x3f')]=_0x430098;};exports[_0x5d1d('0x40')]=function(_0x45f9d8,_0x29122c,_0x485c4d){var _0x5063ad=moment()[_0x5d1d('0x10')](_0x5d1d('0x35'));_0x45f9d8[_0x5d1d('0x36')]=_0x29122c;_0x45f9d8['statedesc']=_0x485c4d;_0x45f9d8[_0x5d1d('0x3b')]=_0x45f9d8[_0x5d1d('0x3b')]?_0x45f9d8[_0x5d1d('0x3b')]:_0x5063ad;_0x45f9d8[_0x5d1d('0x39')]=_0x45f9d8[_0x5d1d('0x39')]?_0x45f9d8[_0x5d1d('0x39')]:_0x5063ad;_0x45f9d8['ringtime']=getSeconds(_0x45f9d8[_0x5d1d('0x3b')]||0x0,_0x45f9d8[_0x5d1d('0x3c')]||0x0);_0x45f9d8[_0x5d1d('0x41')]=_0x45f9d8[_0x5d1d('0x42')]?getSeconds(_0x45f9d8[_0x5d1d('0x39')],_0x45f9d8[_0x5d1d('0x42')]):0x0;};exports[_0x5d1d('0x43')]=function(_0x4edd43){return _0x4edd43==='Failure';};exports['variablesAction']=function(_0x38ac5e,_0x2e4a0e,_0x2395e2,_0x3bb96a,_0x245fde){var _0x1aebd1=_0x3bb96a?_0x5d1d('0x44'):_0x38ac5e['calleridname'];_0x1aebd1=_0x245fde?_0x5d1d('0x45'):_0x1aebd1;return{'actionid':_0x38ac5e[_0x5d1d('0x46')],'action':'originate','channel':_0x38ac5e['channelAgent'],'callerid':util[_0x5d1d('0x10')](_0x5d1d('0x11'),_0x1aebd1,_0x38ac5e[_0x5d1d('0x18')]),'Exten':'xcally-motion-preview','Context':_0x5d1d('0x47'),'Priority':'1','variable':_0x2395e2,'timeout':(_0x2e4a0e[_0x5d1d('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x38ac5e['uniqueid']};};exports[_0x5d1d('0x49')]=function(_0x31e36c){return _0x31e36c[_0x5d1d('0x4a')]+_0x31e36c[_0x5d1d('0x4b')]+_0x31e36c['countnoanswerretry']+_0x31e36c[_0x5d1d('0x4c')]+_0x31e36c['countnosuchnumberretry'];};exports[_0x5d1d('0x4d')]=function(_0x1a95d3){var _0x24f437=_[_0x5d1d('0x4e')](_0x1a95d3);_0x24f437[_0x5d1d('0x36')]=0xf;_0x24f437['statedesc']=_0x5d1d('0x4f');return _0x24f437;};exports[_0x5d1d('0x50')]=function(_0x43305d,_0x1caa81,_0x17d3ab){var _0x59b73c={};_0x59b73c[_0x1caa81]=_0x43305d[_0x1caa81];_0x59b73c[_0x5d1d('0x51')]=![];_0x59b73c['scheduledat']=moment()[_0x5d1d('0x52')](_0x17d3ab,_0x5d1d('0x53'))[_0x5d1d('0x10')](_0x5d1d('0x35'));_0x59b73c[_0x5d1d('0x19')]=_0x43305d['ContactId'];_0x59b73c[_0x5d1d('0x54')]=_0x43305d[_0x5d1d('0x54')];_0x59b73c[_0x5d1d('0x1b')]=_0x43305d['VoiceQueueId']||undefined;return _0x59b73c;};exports[_0x5d1d('0x55')]=function(_0xebc16d,_0x31a64c){if(!_[_0x5d1d('0x14')](_0xebc16d)){if(_0xebc16d[_0x5d1d('0x56')]>0x0){_0xebc16d['pTalking']-=0x1;}else{logger[_0x5d1d('0x9')](_0x31a64c,_0x5d1d('0x57'));}}else{logger[_0x5d1d('0x9')](_0x31a64c,_0x5d1d('0x58'));}};exports[_0x5d1d('0x59')]=function(_0x428347){if(_0x428347<=0x0){return!![];}return![];};exports[_0x5d1d('0x5a')]=function(_0x1709b2,_0x1ed825,_0xe9cd45){_0x1709b2[_0x5d1d('0x5b')]=_0x1ed825;_0x1709b2['name']=_0x1709b2['queue'];_0x1709b2[_0x5d1d('0x5c')]=_0x1709b2['channelAgent'];_0x1709b2[_0x5d1d('0x5d')]=_0x5d1d('0x5e');if(_0xe9cd45){_0x1709b2[_0x5d1d('0x5f')]=_0xe9cd45[_0x5d1d('0x5f')];}return _0x1709b2;};exports[_0x5d1d('0x60')]=function(_0x1bd3b9){var _0x5a674a={};_0x5a674a[_0x5d1d('0x61')]=_0x1bd3b9[_0x5d1d('0x61')];_0x5a674a['interface']=_0x1bd3b9[_0x5d1d('0x62')];_0x5a674a[_0x5d1d('0x46')]=_0x1bd3b9['uniqueid'];return _0x5a674a;};exports['agentReadyId']=function(_0x37142a){var _0x5b9b4e=[];for(var _0x173e92 in _0x37142a){if(_0x37142a['hasOwnProperty'](_0x173e92)){if(!_[_0x5d1d('0x14')](_0x37142a[_0x173e92])&&_0x37142a[_0x173e92]['state']===_0x5d1d('0x63')&&_0x37142a[_0x173e92][_0x5d1d('0x64')]==='reachable'){_0x5b9b4e['push'](_0x37142a[_0x173e92]['id']);}}}return _0x5b9b4e;};exports['getDiff']=function(_0x481242){var _0x9308c9=moment()[_0x5d1d('0x5')](0x0);var _0x385244=moment(_0x481242)[_0x5d1d('0x5')](0x0);return _0x9308c9['diff'](_0x385244,_0x5d1d('0x7'));};exports[_0x5d1d('0x65')]=function(_0x22c729){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x22c729['ContactId'],'ListId':_0x22c729[_0x5d1d('0x54')],'VoiceQueueId':_0x22c729[_0x5d1d('0x1b')]||undefined,'CampaignId':_0x22c729[_0x5d1d('0x66')]||undefined};};exports[_0x5d1d('0x67')]=function(_0x5da188){if(_0x5da188===_0x5d1d('0x46')||_0x5da188===_0x5d1d('0x68')||_0x5da188===_0x5d1d('0x61')||_0x5da188===_0x5d1d('0x69')||_0x5da188===_0x5d1d('0x6a')||_0x5da188==='dialAnswer'||_0x5da188==='membername'||_0x5da188===_0x5d1d('0x62')||_0x5da188===_0x5d1d('0x17')||_0x5da188===_0x5d1d('0x51')||_0x5da188===_0x5d1d('0x18')||_0x5da188===_0x5d1d('0x6b')||_0x5da188===_0x5d1d('0x4a')||_0x5da188===_0x5d1d('0x4b')||_0x5da188===_0x5d1d('0x6c')||_0x5da188===_0x5d1d('0x6d')||_0x5da188===_0x5d1d('0x6e')||_0x5da188===_0x5d1d('0x6f')||_0x5da188==='callbackat'||_0x5da188===_0x5d1d('0x70')||_0x5da188===_0x5d1d('0x19')||_0x5da188===_0x5d1d('0x54')||_0x5da188===_0x5d1d('0x3f')||_0x5da188===_0x5d1d('0x1b')||_0x5da188===_0x5d1d('0x71')||_0x5da188===_0x5d1d('0x72')||_0x5da188===_0x5d1d('0x73')||_0x5da188===_0x5d1d('0x74')||_0x5da188===_0x5d1d('0x75')||_0x5da188==='xmd-dialurl'||_0x5da188===_0x5d1d('0x76')||_0x5da188===_0x5d1d('0x77')||_0x5da188==='xmd-dialid'||_0x5da188===_0x5d1d('0x78')||_0x5da188===_0x5d1d('0x79')||_0x5da188===_0x5d1d('0x7a')||_0x5da188===_0x5d1d('0x7b')||_0x5da188==='xmd-agiafter'||_0x5da188==='xmd-agi'||_0x5da188===_0x5d1d('0x7c')||_0x5da188===_0x5d1d('0x7d')||_0x5da188===_0x5d1d('0x7e')||_0x5da188===_0x5d1d('0x7f')||_0x5da188===_0x5d1d('0x80')||_0x5da188===_0x5d1d('0x81')||_0x5da188===_0x5d1d('0x82')||_0x5da188===_0x5d1d('0x83')||_0x5da188===_0x5d1d('0x7c')||_0x5da188===_0x5d1d('0x7d')||_0x5da188===_0x5d1d('0x7e')||_0x5da188===_0x5d1d('0x7f')||_0x5da188==='rtpaudioqosloss'||_0x5da188===_0x5d1d('0x81')||_0x5da188===_0x5d1d('0x82')||_0x5da188===_0x5d1d('0x83')||_0x5da188===_0x5d1d('0x84')||_0x5da188==='bridgepvtcallid'||_0x5da188===_0x5d1d('0x36')||_0x5da188===_0x5d1d('0x37')){return![];}return!![];};exports[_0x5d1d('0x85')]=function(_0x47e208,_0xd9e252){var _0x47b848,_0x427c74,_0x5f35c4;if(_0xd9e252<=0x0){_0xd9e252=0x1;}_0x47b848=new RegExp(_0x5d1d('0x86')+_0xd9e252+'}$');_0x427c74=Math['pow'](0xa,_0xd9e252-0x1);_0x5f35c4=Math[_0x5d1d('0x87')](0xa,_0xd9e252)-0x1;return util['format']('%s',_['replace'](_0x47e208,_0x47b848,_['random'](_0x427c74,_0x5f35c4)));};exports['extractCalleridName']=function(_0x1162d4){var _0x44f40d=_0x1162d4[_0x5d1d('0x88')](/"(.*?)"/);return _0x44f40d?_0x44f40d[0x1]:_0x1162d4;};exports[_0x5d1d('0x89')]=function(_0x25588d){var _0x184757=_0x25588d['match'](/<(.*?)>/);return _0x184757?_0x184757[0x1]:_0x25588d;}; \ No newline at end of file +var _0x981b=['createBody','CampaignId','idContact','type','dialAnswer','scheduledat','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','match','extractCalleridNumber','util','lodash','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','add','ListId','VoiceQueueId','pTalking','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff'];(function(_0x6ad2c7,_0xb22a9a){var _0x435d5f=function(_0x38ec10){while(--_0x38ec10){_0x6ad2c7['push'](_0x6ad2c7['shift']());}};_0x435d5f(++_0xb22a9a);}(_0x981b,0xa7));var _0xb981=function(_0x10c7ea,_0x46d624){_0x10c7ea=_0x10c7ea-0x0;var _0x5118a9=_0x981b[_0x10c7ea];return _0x5118a9;};'use strict';var util=require(_0xb981('0x0'));var _=require(_0xb981('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xb981('0x2')][_0xb981('0x3')]||'127.0.0.1';function getSeconds(_0x3bceac,_0x15cd2e){var _0x8889bb=moment(_0x3bceac)[_0xb981('0x4')](0x0);var _0x81d6c6=moment(_0x15cd2e)[_0xb981('0x4')](0x0);return _0x8889bb[_0xb981('0x5')](_0x81d6c6,_0xb981('0x6'));}exports['loggerCatch']=function(_0x40fad3){return function(_0x227538){logger[_0xb981('0x7')](_0x40fad3,util[_0xb981('0x8')](_0x227538,{'showHidden':![],'depth':null}));};};exports[_0xb981('0x9')]=function(_0x496186,_0x227d8d){logger[_0xb981('0xa')](_0x496186,util['inspect'](_0x227d8d,{'showHidden':![],'depth':null}));};exports[_0xb981('0xb')]=function(_0x35e9b6,_0x23f287){logger['error'](_0x35e9b6,util[_0xb981('0x8')](_0x23f287,{'showHidden':![],'depth':null}));};exports[_0xb981('0xc')]=function(_0x442278){return function(_0x1b0bfb){logger[_0xb981('0xa')](_0x442278,util['inspect'](_0x1b0bfb,{'showHidden':![],'depth':null}));};};exports[_0xb981('0xd')]=function(_0x36259a,_0x119150,_0x23db59){return{'message':_0x36259a,'unlock':_0x119150,'active':_0x23db59};};exports[_0xb981('0xe')]=function(_0x1bccf9,_0x4fccf5,_0x459b2b){if(!_[_0xb981('0xf')](_0x459b2b)&&_0xb981('0x10')===typeof _0x459b2b&&!_[_0xb981('0x11')](_0x459b2b)){if(!_['isUndefined'](_0x4fccf5)&&_0xb981('0x10')===typeof _0x4fccf5&&!_[_0xb981('0x11')](_0x4fccf5)){return util[_0xb981('0x12')]('\x22%s\x22\x20<%s>',_0x4fccf5,_0x459b2b);}return util[_0xb981('0x12')](_0xb981('0x13'),_0x459b2b,_0x459b2b);}if(!_[_0xb981('0xf')](_0x1bccf9)&&'string'===typeof _0x1bccf9&&!_[_0xb981('0x11')](_0x1bccf9)){return _0x1bccf9;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x46bc52){if(_[_0xb981('0x14')](_0x46bc52)){return![];}return _0x46bc52;};exports['addVariables']=function(_0x3269bb,_0x16707b,_0x1eb564,_0x1b28d4,_0x1dfc8f,_0x3af5e7){var _0x20582a={'XMD-QUEUE':_0x16707b[_0xb981('0x15')]?_0x16707b[_0xb981('0x15')][_0xb981('0x16')]:'','XMD-CALLERID':_0x1b28d4,'XMD-CALLERID-PREVIEW':_0x3af5e7?util[_0xb981('0x12')]('\x22%s\x22\x20<%s>',_0x3af5e7[_0xb981('0x17')],_0x3af5e7[_0xb981('0x18')]):_0x1b28d4,'XMD-DIALID':_0x1dfc8f,'XMD-CONTACTID':_0x16707b[_0xb981('0x19')],'XMD-CDRTYPE':_0xb981('0x1a'),'CALLERID(all)':_0x1b28d4,'XMD-VOICEQUEUEID':_0x16707b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1eb564,'XMD-DIALTIMEOUT':_0x3269bb['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xb981('0x12')](_0xb981('0x1b'),_0x3269bb[_0xb981('0x1c')]?'g':'',_[_0xb981('0x11')](_0x3269bb[_0xb981('0x1d')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3269bb[_0xb981('0x1e')]||'','XMD-AGI':_0x3269bb[_0xb981('0x1f')]?util[_0xb981('0x12')](_0xb981('0x20'),ipAgi,_0x3269bb['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3269bb[_0xb981('0x1c')]?util[_0xb981('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3269bb['dialQueueProject2']):_0xb981('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x3af5e7?_0x3af5e7[_0xb981('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x3af5e7?_0x3af5e7[_0xb981('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xb981('0x11')](_0x3269bb[_0xb981('0x1d')])){_0x20582a[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3269bb[_0xb981('0x1d')];_0x20582a[util[_0xb981('0x12')]('%s',_0xb981('0x24'))]=_0x1dfc8f;}if(_0x16707b&&_0x16707b[_0xb981('0x25')]){for(var _0x563e5e in _0x16707b[_0xb981('0x25')]){if(_0x16707b[_0xb981('0x25')][_0xb981('0x26')](_0x563e5e)){if(!_[_0xb981('0x14')](_0x16707b[_0xb981('0x25')][_0x563e5e])&&_0x563e5e!=='id'&&_0x563e5e!==_0xb981('0x27')&&_0x563e5e!=='createdAt'&&_0x563e5e!==_0xb981('0x28')){_0x20582a[util[_0xb981('0x12')](_0xb981('0x29'),_0xb981('0x2a'),_['toUpper'](_0x563e5e))]=_0x16707b[_0xb981('0x25')][_0x563e5e];}}}}return _0x20582a;};exports['toLowerVariables']=function(_0x198018){var _0x3d9d84={};for(var _0x109ece in _0x198018){if(_0x198018[_0xb981('0x26')](_0x109ece)){_0x3d9d84[util[_0xb981('0x12')]('%s',_[_0xb981('0x2b')](_0x109ece))]=_0x198018[_0x109ece];}}return{'variables':_0x3d9d84};};exports[_0xb981('0x2c')]=function(_0x5f4447,_0x5d6255){if(!_[_0xb981('0x14')](_0x5f4447)){if(_0x5f4447[_0xb981('0x26')](_0xb981('0x2d'))){if(_0x5f4447['originated']>0x0){_0x5f4447[_0xb981('0x2d')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5d6255);}}}else{logger[_0xb981('0x7')](_0xb981('0x2e'),_0x5d6255);}};exports['logBlacklist']=function(_0x5dfd5e){var _0x4afc50=moment()[_0xb981('0x12')](_0xb981('0x2f'));_0x5dfd5e['state']=0xd;_0x5dfd5e[_0xb981('0x30')]=_0xb981('0x31');_0x5dfd5e[_0xb981('0x32')]=_0x4afc50;_0x5dfd5e[_0xb981('0x33')]=_0x4afc50;_0x5dfd5e[_0xb981('0x34')]=_0x4afc50;};exports[_0xb981('0x35')]=function(_0xc4e49,_0x452925,_0x36058e){var _0x19236f=moment()[_0xb981('0x12')](_0xb981('0x2f'));_0xc4e49['state']=_0x452925;_0xc4e49[_0xb981('0x30')]=_0x36058e;_0xc4e49[_0xb981('0x33')]=_0x19236f;_0xc4e49[_0xb981('0x36')]=getSeconds(_0xc4e49['responsetime'],_0xc4e49[_0xb981('0x32')]);};exports[_0xb981('0x37')]=function(_0x4ad85e,_0x1f276b,_0x75a083){_0x4ad85e[_0xb981('0x38')]=_0x1f276b;_0x4ad85e[_0xb981('0x39')]=_0x75a083;};exports[_0xb981('0x3a')]=function(_0x2524ff,_0x5bb11c,_0x5b9092){var _0x3a8dc2=moment()['format'](_0xb981('0x2f'));_0x2524ff[_0xb981('0x3b')]=_0x5bb11c;_0x2524ff['statedesc']=_0x5b9092;_0x2524ff[_0xb981('0x33')]=_0x2524ff[_0xb981('0x33')]?_0x2524ff[_0xb981('0x33')]:_0x3a8dc2;_0x2524ff[_0xb981('0x34')]=_0x2524ff[_0xb981('0x34')]?_0x2524ff[_0xb981('0x34')]:_0x3a8dc2;_0x2524ff[_0xb981('0x36')]=getSeconds(_0x2524ff[_0xb981('0x33')]||0x0,_0x2524ff['starttime']||0x0);_0x2524ff[_0xb981('0x3c')]=_0x2524ff[_0xb981('0x3d')]?getSeconds(_0x2524ff[_0xb981('0x34')],_0x2524ff['answertime']):0x0;};exports[_0xb981('0x3e')]=function(_0xf077f0){return _0xf077f0===_0xb981('0x3f');};exports[_0xb981('0x40')]=function(_0x4e3981,_0x2df69f,_0x296ecd,_0x4d6a30,_0x11ab68){var _0xdadef8=_0x4d6a30?_0xb981('0x41'):_0x4e3981[_0xb981('0x17')];_0xdadef8=_0x11ab68?'BOOKED':_0xdadef8;return{'actionid':_0x4e3981[_0xb981('0x42')],'action':'originate','channel':_0x4e3981[_0xb981('0x43')],'callerid':util[_0xb981('0x12')]('\x22%s\x22\x20<%s>',_0xdadef8,_0x4e3981[_0xb981('0x18')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x296ecd,'timeout':(_0x2df69f[_0xb981('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4e3981[_0xb981('0x42')]};};exports[_0xb981('0x45')]=function(_0x4cf610){return _0x4cf610[_0xb981('0x46')]+_0x4cf610[_0xb981('0x47')]+_0x4cf610['countnoanswerretry']+_0x4cf610[_0xb981('0x48')]+_0x4cf610[_0xb981('0x49')];};exports[_0xb981('0x4a')]=function(_0x3a9bfa){var _0x2dc24a=_[_0xb981('0x4b')](_0x3a9bfa);_0x2dc24a[_0xb981('0x3b')]=0xf;_0x2dc24a[_0xb981('0x30')]='Global';return _0x2dc24a;};exports['scheduledAt']=function(_0x512726,_0x4b1cd8,_0x47b724){var _0x28ed33={};_0x28ed33[_0x4b1cd8]=_0x512726[_0x4b1cd8];_0x28ed33[_0xb981('0x4c')]=![];_0x28ed33['scheduledat']=moment()[_0xb981('0x4d')](_0x47b724,'minutes')[_0xb981('0x12')](_0xb981('0x2f'));_0x28ed33[_0xb981('0x19')]=_0x512726['ContactId'];_0x28ed33['ListId']=_0x512726[_0xb981('0x4e')];_0x28ed33[_0xb981('0x4f')]=_0x512726[_0xb981('0x4f')]||undefined;return _0x28ed33;};exports['decrementTalkink']=function(_0x5e8030,_0x144ce1){if(!_['isNil'](_0x5e8030)){if(_0x5e8030[_0xb981('0x50')]>0x0){_0x5e8030[_0xb981('0x50')]-=0x1;}else{logger['error'](_0x144ce1,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x144ce1,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xb981('0x51')]=function(_0x46c1da){if(_0x46c1da<=0x0){return!![];}return![];};exports['buildObj']=function(_0xee3ef1,_0x2a84a6,_0x2635af){_0xee3ef1[_0xb981('0x52')]=_0x2a84a6;_0xee3ef1[_0xb981('0x16')]=_0xee3ef1[_0xb981('0x53')];_0xee3ef1[_0xb981('0x54')]=_0xee3ef1['channelAgent'];_0xee3ef1[_0xb981('0x55')]=_0xb981('0x56');if(_0x2635af){_0xee3ef1[_0xb981('0x57')]=_0x2635af['mandatoryDisposition'];}return _0xee3ef1;};exports[_0xb981('0x58')]=function(_0x3e9303){var _0x24ec52={};_0x24ec52[_0xb981('0x53')]=_0x3e9303['queue'];_0x24ec52[_0xb981('0x54')]=_0x3e9303[_0xb981('0x43')];_0x24ec52['uniqueid']=_0x3e9303['uniqueid'];return _0x24ec52;};exports[_0xb981('0x59')]=function(_0xe740b7){var _0x4e343c=[];for(var _0x355ecd in _0xe740b7){if(_0xe740b7[_0xb981('0x26')](_0x355ecd)){if(!_[_0xb981('0x14')](_0xe740b7[_0x355ecd])&&_0xe740b7[_0x355ecd][_0xb981('0x3b')]===_0xb981('0x5a')&&_0xe740b7[_0x355ecd][_0xb981('0x5b')]===_0xb981('0x5c')){_0x4e343c[_0xb981('0x5d')](_0xe740b7[_0x355ecd]['id']);}}}return _0x4e343c;};exports[_0xb981('0x5e')]=function(_0x5df4e9){var _0x3e0f8a=moment()[_0xb981('0x4')](0x0);var _0x1aeb9a=moment(_0x5df4e9)[_0xb981('0x4')](0x0);return _0x3e0f8a[_0xb981('0x5')](_0x1aeb9a,_0xb981('0x6'));};exports[_0xb981('0x5f')]=function(_0x59ccdb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x59ccdb[_0xb981('0x19')],'ListId':_0x59ccdb[_0xb981('0x4e')],'VoiceQueueId':_0x59ccdb[_0xb981('0x4f')]||undefined,'CampaignId':_0x59ccdb[_0xb981('0x60')]||undefined};};exports['filterKey']=function(_0x556a35){if(_0x556a35===_0xb981('0x42')||_0x556a35===_0xb981('0x61')||_0x556a35==='queue'||_0x556a35===_0xb981('0x62')||_0x556a35==='campaigntype'||_0x556a35===_0xb981('0x63')||_0x556a35===_0xb981('0x38')||_0x556a35===_0xb981('0x43')||_0x556a35===_0xb981('0x17')||_0x556a35===_0xb981('0x4c')||_0x556a35===_0xb981('0x18')||_0x556a35===_0xb981('0x64')||_0x556a35===_0xb981('0x46')||_0x556a35===_0xb981('0x47')||_0x556a35==='countnoanswerretry'||_0x556a35==='countglobal'||_0x556a35===_0xb981('0x65')||_0x556a35===_0xb981('0x66')||_0x556a35===_0xb981('0x67')||_0x556a35===_0xb981('0x68')||_0x556a35===_0xb981('0x19')||_0x556a35===_0xb981('0x4e')||_0x556a35===_0xb981('0x39')||_0x556a35===_0xb981('0x4f')||_0x556a35===_0xb981('0x69')||_0x556a35===_0xb981('0x6a')||_0x556a35==='xmd-queue'||_0x556a35===_0xb981('0x6b')||_0x556a35===_0xb981('0x6c')||_0x556a35===_0xb981('0x6d')||_0x556a35==='xmd-dialtimeout'||_0x556a35===_0xb981('0x6e')||_0x556a35===_0xb981('0x6f')||_0x556a35===_0xb981('0x70')||_0x556a35===_0xb981('0x71')||_0x556a35==='xmd-cdrtype'||_0x556a35===_0xb981('0x72')||_0x556a35===_0xb981('0x73')||_0x556a35==='xmd-agi'||_0x556a35===_0xb981('0x74')||_0x556a35===_0xb981('0x75')||_0x556a35===_0xb981('0x76')||_0x556a35==='rtpaudioqosjitterbridged'||_0x556a35===_0xb981('0x77')||_0x556a35==='rtpaudioqoslossbridged'||_0x556a35===_0xb981('0x78')||_0x556a35===_0xb981('0x79')||_0x556a35===_0xb981('0x74')||_0x556a35===_0xb981('0x75')||_0x556a35===_0xb981('0x76')||_0x556a35===_0xb981('0x7a')||_0x556a35==='rtpaudioqosloss'||_0x556a35===_0xb981('0x7b')||_0x556a35===_0xb981('0x78')||_0x556a35==='rtpaudioqosrttbridged'||_0x556a35===_0xb981('0x7c')||_0x556a35===_0xb981('0x7d')||_0x556a35===_0xb981('0x3b')||_0x556a35===_0xb981('0x30')){return![];}return!![];};exports[_0xb981('0x7e')]=function(_0x20d744,_0x38714a){var _0x546493,_0x56b34e,_0x4c9bc3;if(_0x38714a<=0x0){_0x38714a=0x1;}_0x546493=new RegExp('\x5cw{0,'+_0x38714a+'}$');_0x56b34e=Math[_0xb981('0x7f')](0xa,_0x38714a-0x1);_0x4c9bc3=Math[_0xb981('0x7f')](0xa,_0x38714a)-0x1;return util['format']('%s',_['replace'](_0x20d744,_0x546493,_[_0xb981('0x80')](_0x56b34e,_0x4c9bc3)));};exports['extractCalleridName']=function(_0x3fe09){var _0xfdecae=_0x3fe09[_0xb981('0x81')](/"(.*?)"/);return _0xfdecae?_0xfdecae[0x1]:_0x3fe09;};exports[_0xb981('0x82')]=function(_0xac0668){var _0x5d3b43=_0xac0668['match'](/<(.*?)>/);return _0x5d3b43?_0x5d3b43[0x1]:_0xac0668;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a1be26f..f544bc9 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 _0xb896=['queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean'];(function(_0x4c9b3a,_0x3b31a8){var _0x3a1124=function(_0x1bcf1c){while(--_0x1bcf1c){_0x4c9b3a['push'](_0x4c9b3a['shift']());}};_0x3a1124(++_0x3b31a8);}(_0xb896,0x1a3));var _0x6b89=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0xb896[_0x5a5395];return _0x4da43d;};'use strict';exports[_0x6b89('0x0')]={'queue':{'type':_0x6b89('0x1'),'required':!![]},'interface':{'type':_0x6b89('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x6b89('0x2'),'required':![]},'paused':{'type':_0x6b89('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x6b89('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x6b89('0x4')]={'interface':{'type':_0x6b89('0x1'),'required':!![]},'paused':{'type':_0x6b89('0x3')},'reason':{'type':_0x6b89('0x1'),'required':![]}};exports[_0x6b89('0x5')]={'module':{'type':_0x6b89('0x1'),'required':![]}};exports[_0x6b89('0x6')]={'uniqueid':{'type':_0x6b89('0x1'),'required':!![]}};exports[_0x6b89('0x7')]={'uniqueid':{'type':_0x6b89('0x1'),'required':!![]},'filename':{'type':_0x6b89('0x1')},'format':{'type':_0x6b89('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x6b89('0x8')]={'uniqueid':{'type':_0x6b89('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x6b89('0x1'),'required':!![]},'exten':{'type':_0x6b89('0x1'),'required':!![]},'context':{'type':_0x6b89('0x1')}}; \ No newline at end of file +var _0x2764=['boolean','queueremove','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2764,0xa8));var _0x4276=function(_0x476823,_0x46c089){_0x476823=_0x476823-0x0;var _0x3fb2d7=_0x2764[_0x476823];return _0x3fb2d7;};'use strict';exports[_0x4276('0x0')]={'queue':{'type':_0x4276('0x1'),'required':!![]},'interface':{'type':_0x4276('0x1'),'required':!![]},'membername':{'type':_0x4276('0x1'),'required':!![]},'penalty':{'type':_0x4276('0x2'),'required':![]},'paused':{'type':_0x4276('0x3'),'required':![]}};exports[_0x4276('0x4')]={'queue':{'type':_0x4276('0x1'),'required':!![]},'interface':{'type':_0x4276('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x4276('0x1'),'required':!![]},'paused':{'type':_0x4276('0x3')},'reason':{'type':_0x4276('0x1'),'required':![]}};exports[_0x4276('0x5')]={'module':{'type':_0x4276('0x1'),'required':![]}};exports[_0x4276('0x6')]={'uniqueid':{'type':_0x4276('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x4276('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x4276('0x1')}};exports[_0x4276('0x7')]={'uniqueid':{'type':_0x4276('0x1'),'required':!![]}};exports[_0x4276('0x8')]={'uniqueid':{'type':_0x4276('0x1'),'required':!![]},'exten':{'type':_0x4276('0x1'),'required':!![]},'context':{'type':_0x4276('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ec6b27b..17564af 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 _0x6c4e=['../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','isNil','interface','hasOwnProperty','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','prototype','initAgents','isUndefined','mergeFromDatabase','initTelephones','telephones','length','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount'];(function(_0x400160,_0x12e14c){var _0x5443b9=function(_0x1a56ea){while(--_0x1a56ea){_0x400160['push'](_0x400160['shift']());}};_0x5443b9(++_0x12e14c);}(_0x6c4e,0x130));var _0xe6c4=function(_0x17c8b5,_0x21d1ab){_0x17c8b5=_0x17c8b5-0x0;var _0x8ada7b=_0x6c4e[_0x17c8b5];return _0x8ada7b;};'use strict';var BPromise=require(_0xe6c4('0x0'));var util=require(_0xe6c4('0x1'));var _=require(_0xe6c4('0x2'));var moment=require(_0xe6c4('0x3'));var Agent=require(_0xe6c4('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0xe6c4('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xe6c4('0x6'));var Template=require(_0xe6c4('0x7'));var Campaign=require(_0xe6c4('0x8'));var VoiceExtension=require(_0xe6c4('0x9'));var ZendeskAccount=require(_0xe6c4('0xa'));var SalesforceAccount=require(_0xe6c4('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xe6c4('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xe6c4('0xd'));var VtigerAccount=require(_0xe6c4('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xe6c4('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xe6c4('0x10')]={};this['telephones']={};this[_0xe6c4('0x11')]={};this[_0xe6c4('0x12')]={};this[_0xe6c4('0x13')]={};this[_0xe6c4('0x14')]={};this[_0xe6c4('0x15')]={};this[_0xe6c4('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xe6c4('0x17')]={};this[_0xe6c4('0x18')]={};this[_0xe6c4('0x19')]={};this[_0xe6c4('0x1a')]={};this[_0xe6c4('0x1b')]={};this[_0xe6c4('0x1c')]={};this[_0xe6c4('0x1d')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xe6c4('0x1e')]={};this[_0xe6c4('0x1f')]={};this[_0xe6c4('0x20')]={};this[_0xe6c4('0x21')]={};this[_0xe6c4('0x22')]={};this[_0xe6c4('0x23')]={};this[_0xe6c4('0x24')]={};};function freeIsNotKey(_0x4e386e,_0x42cecc,_0x475b16){var _0x127e7b=_[_0xe6c4('0x25')](_0x4e386e,function(_0x31bc1d,_0x49a8b5){return _0x31bc1d[_0x475b16];});for(var _0x2dafd0 in _0x42cecc){if(_0x42cecc['hasOwnProperty'](_0x2dafd0)){if(!_0x127e7b[_0x2dafd0]){delete _0x42cecc[_0x2dafd0];}}}}function freeIsNotKeySip(_0x944f95,_0xc7ab82){var _0x131199=_['mapKeys'](_0x944f95,function(_0x2ba3b0,_0x3285b8){return util[_0xe6c4('0x26')](_0xe6c4('0x27'),_0x2ba3b0[_0xe6c4('0x28')]);});for(var _0x4cdbb9 in _0xc7ab82){if(_0xc7ab82['hasOwnProperty'](_0x4cdbb9)){if(!_0x131199[_0x4cdbb9]){delete _0xc7ab82[_0x4cdbb9];}}}}function freeIsNotKeyAgent(_0x336976,_0x24f4c1){var _0x4b4eb0=_[_0xe6c4('0x25')](_0x336976,function(_0x49e79a,_0x6bf345){var _0x2218ea=_[_0xe6c4('0x29')](_0x49e79a[_0xe6c4('0x2a')])?util['format'](_0xe6c4('0x27'),_0x49e79a['name']):_0x49e79a[_0xe6c4('0x2a')];return _0x2218ea;});for(var _0x3f923 in _0x24f4c1){if(_0x24f4c1[_0xe6c4('0x2b')](_0x3f923)){if(!_0x4b4eb0[_0x3f923]){delete _0x24f4c1[_0x3f923];}}}}function clearVoiceCallReports(_0x55add3){_0x55add3[_0xe6c4('0x2c')]=0x0;_0x55add3[_0xe6c4('0x2d')]=0x0;_0x55add3[_0xe6c4('0x2e')]=0x0;_0x55add3[_0xe6c4('0x2f')]=0x0;_0x55add3[_0xe6c4('0x30')]=0x0;}function clearCampaigns(_0x29922e){if(!_[_0xe6c4('0x31')](_0x29922e)){for(var _0x3ec034 in _0x29922e){if(_0x29922e[_0xe6c4('0x2b')](_0x3ec034)){_0x29922e[_0x3ec034][_0xe6c4('0x32')]=0x0;_0x29922e[_0x3ec034]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x5e159c){if(!_[_0xe6c4('0x31')](_0x5e159c)){for(var _0x48b8c6 in _0x5e159c){if(_0x5e159c['hasOwnProperty'](_0x48b8c6)){_0x5e159c[_0x48b8c6]['total']=0x0;_0x5e159c[_0x48b8c6]['answered']=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x33')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x34')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x2e')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x2f')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x30')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x35')]=0x0;_0x5e159c[_0x48b8c6]['outboundNoAnswerCallsDay']=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x36')]=0x0;_0x5e159c[_0x48b8c6]['outboundCongestionCallsDay']=0x0;_0x5e159c[_0x48b8c6]['outboundNoSuchCallsDay']=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x37')]=0x0;_0x5e159c[_0x48b8c6]['outboundDropCallsDayTimeout']=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x38')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x39')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x3a')]=0x0;_0x5e159c[_0x48b8c6]['outboundRejectCallsDay']=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x3b')]=0x0;_0x5e159c[_0x48b8c6][_0xe6c4('0x35')]=0x0;_0x5e159c[_0x48b8c6]['outboundAnswerCallsDay']=0x0;_0x5e159c[_0x48b8c6]['queueStatusComplete']=!![];}}}}Realtime[_0xe6c4('0x3c')]['mergeFromDatabase']=function(_0x426514,_0x2b9c87){for(var _0x2d8d7d in _0x2b9c87){if(_0x426514[_0xe6c4('0x2b')](_0x2d8d7d)){_0x426514[_0x2d8d7d]=_0x2b9c87[_0x2d8d7d];}}};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x3d')]=function(){var _0x34d01d=this;return function(_0x255d84){if(_0x255d84){freeIsNotKeyAgent(_0x255d84,_0x34d01d[_0xe6c4('0x10')]);for(var _0xf87f1b=0x0,_0x23481b={},_0xaa955={};_0xf87f1b<_0x255d84['length'];_0xf87f1b+=0x1){_0x23481b=_0x255d84[_0xf87f1b];var _0x421dd6=_[_0xe6c4('0x29')](_0x23481b['interface'])?util[_0xe6c4('0x26')](_0xe6c4('0x27'),_0x23481b[_0xe6c4('0x28')]):_0x23481b[_0xe6c4('0x2a')];if(_[_0xe6c4('0x3e')](_0x34d01d[_0xe6c4('0x10')][_0x421dd6])){_0x34d01d[_0xe6c4('0x10')][_0x421dd6]=new Agent(_0x23481b);}else{_0x34d01d[_0xe6c4('0x3f')](_0x34d01d[_0xe6c4('0x10')][_0x421dd6],_0x23481b);}}}return _0x34d01d[_0xe6c4('0x10')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x40')]=function(){var _0x530d6d=this;return function(_0x5adfe2){if(_0x5adfe2){freeIsNotKeySip(_0x5adfe2,_0x530d6d[_0xe6c4('0x41')]);for(var _0x1d37c3=0x0,_0x1dd8bb={},_0x264e79={};_0x1d37c3<_0x5adfe2[_0xe6c4('0x42')];_0x1d37c3+=0x1){_0x1dd8bb=_0x5adfe2[_0x1d37c3];if(_[_0xe6c4('0x3e')](_0x530d6d[_0xe6c4('0x41')][util[_0xe6c4('0x26')](_0xe6c4('0x27'),_0x1dd8bb[_0xe6c4('0x28')])])){_0x530d6d['telephones'][util['format'](_0xe6c4('0x27'),_0x1dd8bb[_0xe6c4('0x28')])]=new Telephone(_0x1dd8bb);}else{_0x530d6d[_0xe6c4('0x3f')](_0x530d6d[_0xe6c4('0x41')][util[_0xe6c4('0x26')]('SIP/%s',_0x1dd8bb[_0xe6c4('0x28')])],_0x1dd8bb);}}}return _0x530d6d[_0xe6c4('0x41')];};};Realtime['prototype'][_0xe6c4('0x43')]=function(){var _0x25eb94=this;return function(_0x21c6e0){if(_0x21c6e0){freeIsNotKeySip(_0x21c6e0,_0x25eb94['trunks']);for(var _0x1a4697=0x0,_0x35930c={},_0x2ee5dd={};_0x1a4697<_0x21c6e0[_0xe6c4('0x42')];_0x1a4697+=0x1){_0x35930c=_0x21c6e0[_0x1a4697];if(_[_0xe6c4('0x3e')](_0x25eb94[_0xe6c4('0x11')][util[_0xe6c4('0x26')](_0xe6c4('0x27'),_0x35930c['name'])])){_0x25eb94[_0xe6c4('0x11')][util[_0xe6c4('0x26')](_0xe6c4('0x27'),_0x35930c[_0xe6c4('0x28')])]=new Trunk(_0x35930c);}else{_0x25eb94[_0xe6c4('0x3f')](_0x25eb94[_0xe6c4('0x11')][util['format'](_0xe6c4('0x27'),_0x35930c[_0xe6c4('0x28')])],_0x35930c);}}}return _0x25eb94['trunks'];};};Realtime['prototype'][_0xe6c4('0x44')]=function(){var _0x5d400f=this;return function(_0x137004){if(_0x137004){freeIsNotKey(_0x137004,_0x5d400f['voiceQueues'],_0xe6c4('0x28'));for(var _0x95990b=0x0,_0x14d019={},_0x136c73={};_0x95990b<_0x137004[_0xe6c4('0x42')];_0x95990b+=0x1){_0x14d019=_0x137004[_0x95990b];if(_[_0xe6c4('0x3e')](_0x5d400f[_0xe6c4('0x12')][_0x14d019[_0xe6c4('0x28')]])){_0x5d400f[_0xe6c4('0x12')][_0x14d019[_0xe6c4('0x28')]]=new VoiceQueue(_0x14d019);}else{_0x5d400f[_0xe6c4('0x3f')](_0x5d400f[_0xe6c4('0x12')][_0x14d019['name']],_0x14d019);}}}return _0x5d400f['voiceQueues'];};};Realtime['prototype'][_0xe6c4('0x45')]=function(){var _0x2980c9=this;return function(_0x123c74){if(_0x123c74){freeIsNotKey(_0x123c74,_0x2980c9['triggers'],'id');for(var _0x5cd209=0x0,_0x3a3ba9={},_0x4119e4={};_0x5cd209<_0x123c74[_0xe6c4('0x42')];_0x5cd209+=0x1){_0x3a3ba9=_0x123c74[_0x5cd209];if(_[_0xe6c4('0x3e')](_0x2980c9['triggers'][_0x3a3ba9['id']])){_0x2980c9[_0xe6c4('0x13')][_0x3a3ba9['id']]=new Trigger(_0x3a3ba9);}else{_0x2980c9[_0xe6c4('0x3f')](_0x2980c9[_0xe6c4('0x13')][_0x3a3ba9['id']],_0x3a3ba9);}}}return _0x2980c9[_0xe6c4('0x13')];};};Realtime['prototype'][_0xe6c4('0x46')]=function(){var _0x58e71c=this;return function(_0x15d88b){if(_0x15d88b){freeIsNotKey(_0x15d88b,_0x58e71c[_0xe6c4('0x15')],'id');for(var _0x253d70=0x0,_0x11e8fa={},_0xb551d={};_0x253d70<_0x15d88b['length'];_0x253d70+=0x1){_0x11e8fa=_0x15d88b[_0x253d70];if(_['isUndefined'](_0x58e71c[_0xe6c4('0x15')][_0x11e8fa['id']])){_0x58e71c[_0xe6c4('0x15')][_0x11e8fa['id']]=new Template(_0x11e8fa);}else{_0x58e71c[_0xe6c4('0x3f')](_0x58e71c['templates'][_0x11e8fa['id']],_0x11e8fa);}}}return _0x58e71c[_0xe6c4('0x15')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x47')]=function(){var _0x5aa131=this;return function(_0x47d0e4){if(_0x47d0e4){freeIsNotKey(_0x47d0e4,_0x5aa131[_0xe6c4('0x1c')],'id');for(var _0x545e01=0x0,_0x5a4ef5={},_0x45bd65={};_0x545e01<_0x47d0e4[_0xe6c4('0x42')];_0x545e01+=0x1){_0x5a4ef5=_0x47d0e4[_0x545e01];if(_[_0xe6c4('0x3e')](_0x5aa131[_0xe6c4('0x1c')][_0x5a4ef5['id']])){_0x5aa131[_0xe6c4('0x1c')][_0x5a4ef5['id']]=new ZendeskAccount(_0x5a4ef5);}else{_0x5aa131['mergeFromDatabase'](_0x5aa131['zendeskAccounts'][_0x5a4ef5['id']],_0x5a4ef5);}}}return _0x5aa131['zendeskAccounts'];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x48')]=function(){var _0x2fb744=this;return function(_0x2663b7){if(_0x2663b7){freeIsNotKey(_0x2663b7,_0x2fb744[_0xe6c4('0x1d')],'id');for(var _0x158311=0x0,_0x48eeb0={},_0x3d5f99={};_0x158311<_0x2663b7['length'];_0x158311+=0x1){_0x48eeb0=_0x2663b7[_0x158311];if(_[_0xe6c4('0x3e')](_0x2fb744[_0xe6c4('0x1d')][_0x48eeb0['id']])){_0x2fb744[_0xe6c4('0x1d')][_0x48eeb0['id']]=new SalesforceAccount(_0x48eeb0);}else{_0x2fb744[_0xe6c4('0x3f')](_0x2fb744[_0xe6c4('0x1d')][_0x48eeb0['id']],_0x48eeb0);}}}return _0x2fb744[_0xe6c4('0x1d')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x49')]=function(){var _0x2d2e7f=this;return function(_0x2fefe1){if(_0x2fefe1){freeIsNotKey(_0x2fefe1,_0x2d2e7f['freshdeskAccounts'],'id');for(var _0xf91766=0x0,_0x24d3a4={},_0x30e764={};_0xf91766<_0x2fefe1['length'];_0xf91766+=0x1){_0x24d3a4=_0x2fefe1[_0xf91766];if(_['isUndefined'](_0x2d2e7f[_0xe6c4('0x4a')][_0x24d3a4['id']])){_0x2d2e7f['freshdeskAccounts'][_0x24d3a4['id']]=new FreshdeskAccount(_0x24d3a4);}else{_0x2d2e7f[_0xe6c4('0x3f')](_0x2d2e7f[_0xe6c4('0x4a')][_0x24d3a4['id']],_0x24d3a4);}}}return _0x2d2e7f[_0xe6c4('0x4a')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x4b')]=function(){var _0x11bca7=this;return function(_0x3095ab){if(_0x3095ab){freeIsNotKey(_0x3095ab,_0x11bca7[_0xe6c4('0x1e')],'id');for(var _0x15d24b=0x0,_0x2b35e4={},_0x553360={};_0x15d24b<_0x3095ab[_0xe6c4('0x42')];_0x15d24b+=0x1){_0x2b35e4=_0x3095ab[_0x15d24b];if(_[_0xe6c4('0x3e')](_0x11bca7[_0xe6c4('0x1e')][_0x2b35e4['id']])){_0x11bca7[_0xe6c4('0x1e')][_0x2b35e4['id']]=new ZohoAccount(_0x2b35e4);}else{_0x11bca7[_0xe6c4('0x3f')](_0x11bca7[_0xe6c4('0x1e')][_0x2b35e4['id']],_0x2b35e4);}}}return _0x11bca7[_0xe6c4('0x1e')];};};Realtime[_0xe6c4('0x3c')]['initDeskAccounts']=function(){var _0xc99629=this;return function(_0x547cb5){if(_0x547cb5){freeIsNotKey(_0x547cb5,_0xc99629[_0xe6c4('0x1f')],'id');for(var _0x4df283=0x0,_0x4e3b24={},_0x32db73={};_0x4df283<_0x547cb5['length'];_0x4df283+=0x1){_0x4e3b24=_0x547cb5[_0x4df283];if(_[_0xe6c4('0x3e')](_0xc99629[_0xe6c4('0x1f')][_0x4e3b24['id']])){_0xc99629[_0xe6c4('0x1f')][_0x4e3b24['id']]=new DeskAccount(_0x4e3b24);}else{_0xc99629[_0xe6c4('0x3f')](_0xc99629['deskAccounts'][_0x4e3b24['id']],_0x4e3b24);}}}return _0xc99629['deskAccounts'];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x4c')]=function(){var _0x3ab059=this;return function(_0x11c374){if(_0x11c374){freeIsNotKey(_0x11c374,_0x3ab059[_0xe6c4('0x4d')],'id');for(var _0x565e93=0x0,_0x209e59={},_0x4beb5a={};_0x565e93<_0x11c374[_0xe6c4('0x42')];_0x565e93+=0x1){_0x209e59=_0x11c374[_0x565e93];if(_[_0xe6c4('0x3e')](_0x3ab059[_0xe6c4('0x4d')][_0x209e59['id']])){_0x3ab059[_0xe6c4('0x4d')][_0x209e59['id']]=new SugarcrmAccount(_0x209e59);}else{_0x3ab059[_0xe6c4('0x3f')](_0x3ab059[_0xe6c4('0x4d')][_0x209e59['id']],_0x209e59);}}}return _0x3ab059[_0xe6c4('0x4d')];};};Realtime[_0xe6c4('0x3c')]['initVtigerAccounts']=function(){var _0x226c5c=this;return function(_0x5dd3b3){if(_0x5dd3b3){freeIsNotKey(_0x5dd3b3,_0x226c5c[_0xe6c4('0x20')],'id');for(var _0x406b9e=0x0,_0x4d8fa1={},_0x4bb8f5={};_0x406b9e<_0x5dd3b3[_0xe6c4('0x42')];_0x406b9e+=0x1){_0x4d8fa1=_0x5dd3b3[_0x406b9e];if(_[_0xe6c4('0x3e')](_0x226c5c['vtigerAccounts'][_0x4d8fa1['id']])){_0x226c5c[_0xe6c4('0x20')][_0x4d8fa1['id']]=new VtigerAccount(_0x4d8fa1);}else{_0x226c5c[_0xe6c4('0x3f')](_0x226c5c['vtigerAccounts'][_0x4d8fa1['id']],_0x4d8fa1);}}}return _0x226c5c['vtigerAccounts'];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x4e')]=function(){var _0x259c35=this;return function(_0x1011c3){if(_0x1011c3){freeIsNotKey(_0x1011c3,_0x259c35[_0xe6c4('0x21')],'id');for(var _0x36585b=0x0,_0x2dc51a={},_0xa11d87={};_0x36585b<_0x1011c3[_0xe6c4('0x42')];_0x36585b+=0x1){_0x2dc51a=_0x1011c3[_0x36585b];if(_[_0xe6c4('0x3e')](_0x259c35['servicenowAccounts'][_0x2dc51a['id']])){_0x259c35['servicenowAccounts'][_0x2dc51a['id']]=new ServicenowAccount(_0x2dc51a);}else{_0x259c35[_0xe6c4('0x3f')](_0x259c35['servicenowAccounts'][_0x2dc51a['id']],_0x2dc51a);}}}return _0x259c35[_0xe6c4('0x21')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x4f')]=function(){var _0x226854=this;return function(_0x4967ce){if(_0x4967ce){freeIsNotKey(_0x4967ce,_0x226854[_0xe6c4('0x22')],'id');for(var _0x460750=0x0,_0x5cb353={},_0x197752={};_0x460750<_0x4967ce[_0xe6c4('0x42')];_0x460750+=0x1){_0x5cb353=_0x4967ce[_0x460750];if(_[_0xe6c4('0x3e')](_0x226854[_0xe6c4('0x22')][_0x5cb353['id']])){_0x226854[_0xe6c4('0x22')][_0x5cb353['id']]=new Dynamics365Account(_0x5cb353);}else{_0x226854[_0xe6c4('0x3f')](_0x226854[_0xe6c4('0x22')][_0x5cb353['id']],_0x5cb353);}}}return _0x226854[_0xe6c4('0x22')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x50')]=function(){var _0xa36b75=this;return function(_0x1826e3){if(_0x1826e3){freeIsNotKey(_0x1826e3,_0xa36b75[_0xe6c4('0x23')],'id');for(var _0x248d19=0x0,_0x4213fb={},_0x5df457={};_0x248d19<_0x1826e3[_0xe6c4('0x42')];_0x248d19+=0x1){_0x4213fb=_0x1826e3[_0x248d19];if(_['isUndefined'](_0xa36b75[_0xe6c4('0x23')][_0x4213fb['id']])){_0xa36b75['freshsalesAccounts'][_0x4213fb['id']]=new FreshsalesAccount(_0x4213fb);}else{_0xa36b75[_0xe6c4('0x3f')](_0xa36b75['freshsalesAccounts'][_0x4213fb['id']],_0x4213fb);}}}return _0xa36b75[_0xe6c4('0x23')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x51')]=function(){var _0x41e4b0=this;return function(_0x19aa3b){for(var _0x1c6af6=0x0;_0x1c6af6<_0x19aa3b[_0xe6c4('0x42')];_0x1c6af6+=0x1){_[_0xe6c4('0x52')](_0x41e4b0['voiceQueues'][_0x19aa3b[_0x1c6af6][_0xe6c4('0x28')]],_0x19aa3b[_0x1c6af6]);}return _0x41e4b0[_0xe6c4('0x12')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x53')]=function(){var _0x56e044=this;return function(_0x290f89){clearVoiceQueues(_0x56e044[_0xe6c4('0x12')]);if(_0x290f89){_0x290f89=_[_0xe6c4('0x54')](_0x290f89,'uniqueid');for(var _0x4bac42 in _0x290f89){if(_0x290f89[_0xe6c4('0x2b')](_0x4bac42)){var _0x188e5a={};for(var _0x1ca210=0x0;_0x1ca210<_0x290f89[_0x4bac42][_0xe6c4('0x42')];_0x1ca210+=0x1){var _0x310ae6=_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x55')];if(_0x56e044['voiceQueues'][_0x310ae6]){if(_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x56')]){_0x56e044['voiceQueues'][_0x310ae6]['unmanaged']+=0x1;}if(_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x57')]){_0x56e044[_0xe6c4('0x12')][_0x310ae6][_0xe6c4('0x34')]+=0x1;}_0x56e044['voiceQueues'][_0x310ae6][_0xe6c4('0x2e')]+=moment(_0x290f89[_0x4bac42][_0x1ca210]['queuecallerleaveAt'])[_0xe6c4('0x58')](moment(_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x59')]),_0xe6c4('0x5a'))||0x0;if(_0x1ca210===_0x290f89[_0x4bac42][_0xe6c4('0x42')]-0x1){_0x56e044['voiceQueues'][_0x310ae6][_0xe6c4('0x2f')]+=moment(_0x290f89[_0x4bac42][_0x1ca210]['queuecallercompleteAt']||_0x290f89[_0x4bac42][_0x1ca210]['queuecallerabandonAt']||_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x5b')])[_0xe6c4('0x58')](moment(_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x59')]),'seconds')||0x0;_0x56e044['voiceQueues'][_0x310ae6]['total']+=0x1;if(_0x290f89[_0x4bac42][_0x1ca210]['queuecallercomplete']){_0x56e044[_0xe6c4('0x12')][_0x310ae6][_0xe6c4('0x2d')]+=0x1;_0x56e044['voiceQueues'][_0x310ae6][_0xe6c4('0x30')]+=moment(_0x290f89[_0x4bac42][_0x1ca210][_0xe6c4('0x5c')])[_0xe6c4('0x58')](moment(_0x290f89[_0x4bac42][_0x1ca210]['queuecallerleaveAt']),_0xe6c4('0x5a'))||0x0;}}else{_0x56e044[_0xe6c4('0x12')][_0x310ae6]['sumDuration']+=_0x56e044[_0xe6c4('0x12')][_0x310ae6]['sumHoldTime']||0x0;}}}}}}return _0x56e044[_0xe6c4('0x12')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x5d')]=function(){var _0x291034=this;return function(_0x3679b6){clearVoiceCallReports(_0x291034[_0xe6c4('0x16')]);if(_0x3679b6){for(var _0x4fe430=0x0;_0x4fe430<_0x3679b6[_0xe6c4('0x42')];_0x4fe430+=0x1){_0x291034[_0xe6c4('0x16')]['total']+=0x1;_0x291034['outbound'][_0xe6c4('0x2f')]+=_0x3679b6[_0x4fe430][_0xe6c4('0x5e')];if(_0x3679b6[_0x4fe430][_0xe6c4('0x5f')]===_0xe6c4('0x60')){_0x291034['outbound'][_0xe6c4('0x2d')]+=0x1;_0x291034[_0xe6c4('0x16')][_0xe6c4('0x2e')]+=_0x3679b6[_0x4fe430][_0xe6c4('0x5e')]-_0x3679b6[_0x4fe430][_0xe6c4('0x61')]||0x0;_0x291034[_0xe6c4('0x16')][_0xe6c4('0x30')]+=_0x3679b6[_0x4fe430][_0xe6c4('0x61')];}}}return _0x291034[_0xe6c4('0x16')];};};Realtime['prototype'][_0xe6c4('0x62')]=function(){var _0x54e75a=this;return function(_0x32723d){if(_0x32723d){freeIsNotKey(_0x32723d,_0x54e75a['campaigns'],_0xe6c4('0x28'));for(var _0xba37d8=0x0,_0x408c95={};_0xba37d8<_0x32723d[_0xe6c4('0x42')];_0xba37d8+=0x1){_0x408c95=_0x32723d[_0xba37d8];if(_[_0xe6c4('0x3e')](_0x54e75a[_0xe6c4('0x14')][_0x408c95['name']])){_0x54e75a[_0xe6c4('0x14')][_0x408c95[_0xe6c4('0x28')]]=new Campaign(_0x408c95);}else{_0x54e75a[_0xe6c4('0x3f')](_0x54e75a[_0xe6c4('0x14')][_0x408c95[_0xe6c4('0x28')]],_0x408c95);_0x54e75a[_0xe6c4('0x14')][_0x408c95[_0xe6c4('0x28')]][_0xe6c4('0x63')]=_0x408c95[_0xe6c4('0x64')]?_0x408c95['SquareProject']['name']:undefined;}}}return _0x54e75a[_0xe6c4('0x14')];};};Realtime[_0xe6c4('0x3c')]['initVoiceExtensions']=function(){var _0x37048b=this;return function(_0x2b6c69){if(_0x2b6c69){freeIsNotKey(_0x2b6c69,_0x37048b[_0xe6c4('0x65')],'id');for(var _0x164e2a=0x0,_0x57ebc8={};_0x164e2a<_0x2b6c69[_0xe6c4('0x42')];_0x164e2a+=0x1){_0x57ebc8=_0x2b6c69[_0x164e2a];if(_[_0xe6c4('0x3e')](_0x37048b[_0xe6c4('0x65')][_0x57ebc8['id']])){_0x37048b[_0xe6c4('0x65')][_0x57ebc8['id']]=new VoiceExtension(_0x57ebc8);}else{_0x37048b[_0xe6c4('0x3f')](_0x37048b[_0xe6c4('0x65')][_0x57ebc8['id']],_0x57ebc8);}}}return _0x37048b[_0xe6c4('0x65')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x66')]=function(){var _0x16360d=this;return function(_0x497dba){clearCampaigns(_0x16360d['campaigns']);for(var _0x55d0f1=0x0;_0x55d0f1<_0x497dba['length'];_0x55d0f1+=0x1){_[_0xe6c4('0x52')](_0x16360d[_0xe6c4('0x14')][_0x497dba[_0x55d0f1][_0xe6c4('0x28')]],_0x497dba[_0x55d0f1]);}return _0x16360d[_0xe6c4('0x14')];};};Realtime[_0xe6c4('0x3c')][_0xe6c4('0x67')]=function(){var _0x521c9f=this;return function(_0x5ab65a){if(_0x5ab65a){freeIsNotKey(_0x5ab65a,_0x521c9f['faxAccounts'],'id');for(var _0x3c8c0c=0x0,_0x3c9c03={},_0x329fa6={};_0x3c8c0c<_0x5ab65a[_0xe6c4('0x42')];_0x3c8c0c+=0x1){_0x3c9c03=_0x5ab65a[_0x3c8c0c];if(_[_0xe6c4('0x3e')](_0x521c9f[_0xe6c4('0x24')][_0x3c9c03['id']])){_0x521c9f[_0xe6c4('0x24')][_0x3c9c03['id']]=new FaxAccount(_0x3c9c03);}else{_0x521c9f[_0xe6c4('0x3f')](_0x521c9f[_0xe6c4('0x24')][_0x3c9c03['id']],_0x3c9c03);}}}return _0x521c9f[_0xe6c4('0x24')];};};module[_0xe6c4('0x68')]=Realtime; \ No newline at end of file +var _0xdddd=['queue','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','telephones','initTrunks','triggers','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','uniqueid'];(function(_0x1c7f48,_0x255687){var _0x274c31=function(_0x58e252){while(--_0x58e252){_0x1c7f48['push'](_0x1c7f48['shift']());}};_0x274c31(++_0x255687);}(_0xdddd,0x15e));var _0xdddd=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xdddd[_0x495e9f];return _0xb249d2;};'use strict';var BPromise=require(_0xdddd('0x0'));var util=require('util');var _=require(_0xdddd('0x1'));var moment=require(_0xdddd('0x2'));var Agent=require(_0xdddd('0x3'));var Telephone=require(_0xdddd('0x4'));var Trunk=require(_0xdddd('0x5'));var VoiceQueue=require(_0xdddd('0x6'));var Trigger=require('../model/trigger');var Template=require(_0xdddd('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xdddd('0x8'));var ZendeskAccount=require(_0xdddd('0x9'));var SalesforceAccount=require(_0xdddd('0xa'));var FreshdeskAccount=require(_0xdddd('0xb'));var SugarcrmAccount=require(_0xdddd('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xdddd('0xd'));var VtigerAccount=require(_0xdddd('0xe'));var ServicenowAccount=require(_0xdddd('0xf'));var Dynamics365Account=require(_0xdddd('0x10'));var FreshsalesAccount=require(_0xdddd('0x11'));var FaxAccount=require(_0xdddd('0x12'));var Realtime=function(){this[_0xdddd('0x13')]={};this['telephones']={};this[_0xdddd('0x14')]={};this[_0xdddd('0x15')]={};this['triggers']={};this[_0xdddd('0x16')]={};this['templates']={};this[_0xdddd('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xdddd('0x18')]={};this[_0xdddd('0x19')]={};this[_0xdddd('0x1a')]={};this[_0xdddd('0x1b')]={};this[_0xdddd('0x1c')]={};this[_0xdddd('0x1d')]={};this[_0xdddd('0x1e')]={};this[_0xdddd('0x1f')]={};this[_0xdddd('0x20')]={};this['zohoAccounts']={};this[_0xdddd('0x21')]={};this[_0xdddd('0x22')]={};this[_0xdddd('0x23')]={};this[_0xdddd('0x24')]={};this[_0xdddd('0x25')]={};this[_0xdddd('0x26')]={};};function freeIsNotKey(_0xd4f451,_0x33b8b4,_0xd7da8d){var _0x273103=_[_0xdddd('0x27')](_0xd4f451,function(_0x308bd3,_0x36a29a){return _0x308bd3[_0xd7da8d];});for(var _0x81724b in _0x33b8b4){if(_0x33b8b4['hasOwnProperty'](_0x81724b)){if(!_0x273103[_0x81724b]){delete _0x33b8b4[_0x81724b];}}}}function freeIsNotKeySip(_0x57c432,_0x2f3b2c){var _0xe83f3b=_[_0xdddd('0x27')](_0x57c432,function(_0x54bf29,_0x80c599){return util['format']('SIP/%s',_0x54bf29[_0xdddd('0x28')]);});for(var _0x4f7c09 in _0x2f3b2c){if(_0x2f3b2c[_0xdddd('0x29')](_0x4f7c09)){if(!_0xe83f3b[_0x4f7c09]){delete _0x2f3b2c[_0x4f7c09];}}}}function freeIsNotKeyAgent(_0x260beb,_0x30c6ed){var _0x1ca22e=_['mapKeys'](_0x260beb,function(_0x6c9a6e,_0xcfc98b){var _0xfdb71a=_[_0xdddd('0x2a')](_0x6c9a6e[_0xdddd('0x2b')])?util[_0xdddd('0x2c')](_0xdddd('0x2d'),_0x6c9a6e[_0xdddd('0x28')]):_0x6c9a6e[_0xdddd('0x2b')];return _0xfdb71a;});for(var _0x5afff1 in _0x30c6ed){if(_0x30c6ed['hasOwnProperty'](_0x5afff1)){if(!_0x1ca22e[_0x5afff1]){delete _0x30c6ed[_0x5afff1];}}}}function clearVoiceCallReports(_0x2c48bc){_0x2c48bc[_0xdddd('0x2e')]=0x0;_0x2c48bc[_0xdddd('0x2f')]=0x0;_0x2c48bc[_0xdddd('0x30')]=0x0;_0x2c48bc[_0xdddd('0x31')]=0x0;_0x2c48bc[_0xdddd('0x32')]=0x0;}function clearCampaigns(_0x4c41d9){if(!_[_0xdddd('0x33')](_0x4c41d9)){for(var _0x14a77f in _0x4c41d9){if(_0x4c41d9[_0xdddd('0x29')](_0x14a77f)){_0x4c41d9[_0x14a77f][_0xdddd('0x34')]=0x0;_0x4c41d9[_0x14a77f][_0xdddd('0x35')]=0x0;}}}}function clearVoiceQueues(_0xd15f78){if(!_['isEmpty'](_0xd15f78)){for(var _0x7c11a3 in _0xd15f78){if(_0xd15f78['hasOwnProperty'](_0x7c11a3)){_0xd15f78[_0x7c11a3][_0xdddd('0x2e')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x2f')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x36')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x37')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x30')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x31')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x32')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x38')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x39')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3a')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3b')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3c')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3d')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3e')]=0x0;_0xd15f78[_0x7c11a3]['outboundDropCallsDayCallersExit']=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x3f')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x40')]=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x41')]=0x0;_0xd15f78[_0x7c11a3]['outboundReCallsDay']=0x0;_0xd15f78[_0x7c11a3]['outboundAnswerAgiCallsDay']=0x0;_0xd15f78[_0x7c11a3]['outboundAnswerCallsDay']=0x0;_0xd15f78[_0x7c11a3][_0xdddd('0x42')]=!![];}}}}Realtime[_0xdddd('0x43')][_0xdddd('0x44')]=function(_0x512535,_0x312816){for(var _0x452683 in _0x312816){if(_0x512535[_0xdddd('0x29')](_0x452683)){_0x512535[_0x452683]=_0x312816[_0x452683];}}};Realtime['prototype'][_0xdddd('0x45')]=function(){var _0x5525d1=this;return function(_0x460a6e){if(_0x460a6e){freeIsNotKeyAgent(_0x460a6e,_0x5525d1['agents']);for(var _0xa4bfe3=0x0,_0x307730={},_0x331d80={};_0xa4bfe3<_0x460a6e[_0xdddd('0x46')];_0xa4bfe3+=0x1){_0x307730=_0x460a6e[_0xa4bfe3];var _0x4dd04e=_[_0xdddd('0x2a')](_0x307730['interface'])?util[_0xdddd('0x2c')]('SIP/%s',_0x307730[_0xdddd('0x28')]):_0x307730[_0xdddd('0x2b')];if(_[_0xdddd('0x47')](_0x5525d1[_0xdddd('0x13')][_0x4dd04e])){_0x5525d1[_0xdddd('0x13')][_0x4dd04e]=new Agent(_0x307730);}else{_0x5525d1['mergeFromDatabase'](_0x5525d1[_0xdddd('0x13')][_0x4dd04e],_0x307730);}}}return _0x5525d1[_0xdddd('0x13')];};};Realtime['prototype'][_0xdddd('0x48')]=function(){var _0x1eccda=this;return function(_0x59c9c8){if(_0x59c9c8){freeIsNotKeySip(_0x59c9c8,_0x1eccda[_0xdddd('0x49')]);for(var _0x32511b=0x0,_0xe3b054={},_0x216ab8={};_0x32511b<_0x59c9c8[_0xdddd('0x46')];_0x32511b+=0x1){_0xe3b054=_0x59c9c8[_0x32511b];if(_[_0xdddd('0x47')](_0x1eccda[_0xdddd('0x49')][util[_0xdddd('0x2c')](_0xdddd('0x2d'),_0xe3b054[_0xdddd('0x28')])])){_0x1eccda['telephones'][util[_0xdddd('0x2c')](_0xdddd('0x2d'),_0xe3b054['name'])]=new Telephone(_0xe3b054);}else{_0x1eccda[_0xdddd('0x44')](_0x1eccda['telephones'][util[_0xdddd('0x2c')]('SIP/%s',_0xe3b054[_0xdddd('0x28')])],_0xe3b054);}}}return _0x1eccda['telephones'];};};Realtime['prototype'][_0xdddd('0x4a')]=function(){var _0x12e8e6=this;return function(_0x391d18){if(_0x391d18){freeIsNotKeySip(_0x391d18,_0x12e8e6[_0xdddd('0x14')]);for(var _0x3c07f7=0x0,_0x18068b={},_0x27d1f7={};_0x3c07f7<_0x391d18[_0xdddd('0x46')];_0x3c07f7+=0x1){_0x18068b=_0x391d18[_0x3c07f7];if(_['isUndefined'](_0x12e8e6[_0xdddd('0x14')][util[_0xdddd('0x2c')]('SIP/%s',_0x18068b['name'])])){_0x12e8e6[_0xdddd('0x14')][util[_0xdddd('0x2c')](_0xdddd('0x2d'),_0x18068b['name'])]=new Trunk(_0x18068b);}else{_0x12e8e6[_0xdddd('0x44')](_0x12e8e6[_0xdddd('0x14')][util[_0xdddd('0x2c')]('SIP/%s',_0x18068b[_0xdddd('0x28')])],_0x18068b);}}}return _0x12e8e6['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x31fbe1=this;return function(_0x4c2da7){if(_0x4c2da7){freeIsNotKey(_0x4c2da7,_0x31fbe1[_0xdddd('0x15')],'name');for(var _0x34c33a=0x0,_0x16d378={},_0x500135={};_0x34c33a<_0x4c2da7['length'];_0x34c33a+=0x1){_0x16d378=_0x4c2da7[_0x34c33a];if(_[_0xdddd('0x47')](_0x31fbe1[_0xdddd('0x15')][_0x16d378[_0xdddd('0x28')]])){_0x31fbe1[_0xdddd('0x15')][_0x16d378['name']]=new VoiceQueue(_0x16d378);}else{_0x31fbe1[_0xdddd('0x44')](_0x31fbe1[_0xdddd('0x15')][_0x16d378[_0xdddd('0x28')]],_0x16d378);}}}return _0x31fbe1[_0xdddd('0x15')];};};Realtime[_0xdddd('0x43')]['initTriggers']=function(){var _0x3e8d8c=this;return function(_0x142112){if(_0x142112){freeIsNotKey(_0x142112,_0x3e8d8c[_0xdddd('0x4b')],'id');for(var _0xd6234=0x0,_0xaa67ee={},_0x563d1a={};_0xd6234<_0x142112['length'];_0xd6234+=0x1){_0xaa67ee=_0x142112[_0xd6234];if(_[_0xdddd('0x47')](_0x3e8d8c[_0xdddd('0x4b')][_0xaa67ee['id']])){_0x3e8d8c[_0xdddd('0x4b')][_0xaa67ee['id']]=new Trigger(_0xaa67ee);}else{_0x3e8d8c['mergeFromDatabase'](_0x3e8d8c['triggers'][_0xaa67ee['id']],_0xaa67ee);}}}return _0x3e8d8c[_0xdddd('0x4b')];};};Realtime[_0xdddd('0x43')]['initTemplates']=function(){var _0xe7dcb1=this;return function(_0x305858){if(_0x305858){freeIsNotKey(_0x305858,_0xe7dcb1[_0xdddd('0x4c')],'id');for(var _0x48cc67=0x0,_0x456269={},_0x3016c0={};_0x48cc67<_0x305858['length'];_0x48cc67+=0x1){_0x456269=_0x305858[_0x48cc67];if(_[_0xdddd('0x47')](_0xe7dcb1[_0xdddd('0x4c')][_0x456269['id']])){_0xe7dcb1[_0xdddd('0x4c')][_0x456269['id']]=new Template(_0x456269);}else{_0xe7dcb1['mergeFromDatabase'](_0xe7dcb1[_0xdddd('0x4c')][_0x456269['id']],_0x456269);}}}return _0xe7dcb1[_0xdddd('0x4c')];};};Realtime['prototype'][_0xdddd('0x4d')]=function(){var _0x27adc1=this;return function(_0x363429){if(_0x363429){freeIsNotKey(_0x363429,_0x27adc1[_0xdddd('0x1d')],'id');for(var _0x1f7aff=0x0,_0x1d6c26={},_0x508b2e={};_0x1f7aff<_0x363429['length'];_0x1f7aff+=0x1){_0x1d6c26=_0x363429[_0x1f7aff];if(_['isUndefined'](_0x27adc1[_0xdddd('0x1d')][_0x1d6c26['id']])){_0x27adc1[_0xdddd('0x1d')][_0x1d6c26['id']]=new ZendeskAccount(_0x1d6c26);}else{_0x27adc1[_0xdddd('0x44')](_0x27adc1[_0xdddd('0x1d')][_0x1d6c26['id']],_0x1d6c26);}}}return _0x27adc1[_0xdddd('0x1d')];};};Realtime['prototype'][_0xdddd('0x4e')]=function(){var _0x1161a2=this;return function(_0x25849f){if(_0x25849f){freeIsNotKey(_0x25849f,_0x1161a2[_0xdddd('0x1e')],'id');for(var _0x45515e=0x0,_0x2b783f={},_0x48b7ce={};_0x45515e<_0x25849f['length'];_0x45515e+=0x1){_0x2b783f=_0x25849f[_0x45515e];if(_[_0xdddd('0x47')](_0x1161a2[_0xdddd('0x1e')][_0x2b783f['id']])){_0x1161a2[_0xdddd('0x1e')][_0x2b783f['id']]=new SalesforceAccount(_0x2b783f);}else{_0x1161a2[_0xdddd('0x44')](_0x1161a2[_0xdddd('0x1e')][_0x2b783f['id']],_0x2b783f);}}}return _0x1161a2[_0xdddd('0x1e')];};};Realtime['prototype'][_0xdddd('0x4f')]=function(){var _0x2d5bd5=this;return function(_0x41dd56){if(_0x41dd56){freeIsNotKey(_0x41dd56,_0x2d5bd5['freshdeskAccounts'],'id');for(var _0x80a057=0x0,_0x58c311={},_0x3d93a2={};_0x80a057<_0x41dd56[_0xdddd('0x46')];_0x80a057+=0x1){_0x58c311=_0x41dd56[_0x80a057];if(_[_0xdddd('0x47')](_0x2d5bd5['freshdeskAccounts'][_0x58c311['id']])){_0x2d5bd5[_0xdddd('0x20')][_0x58c311['id']]=new FreshdeskAccount(_0x58c311);}else{_0x2d5bd5[_0xdddd('0x44')](_0x2d5bd5[_0xdddd('0x20')][_0x58c311['id']],_0x58c311);}}}return _0x2d5bd5[_0xdddd('0x20')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x50')]=function(){var _0x3f6e01=this;return function(_0x1bdaf4){if(_0x1bdaf4){freeIsNotKey(_0x1bdaf4,_0x3f6e01[_0xdddd('0x51')],'id');for(var _0x17ab29=0x0,_0x280513={},_0x518a55={};_0x17ab29<_0x1bdaf4['length'];_0x17ab29+=0x1){_0x280513=_0x1bdaf4[_0x17ab29];if(_[_0xdddd('0x47')](_0x3f6e01[_0xdddd('0x51')][_0x280513['id']])){_0x3f6e01[_0xdddd('0x51')][_0x280513['id']]=new ZohoAccount(_0x280513);}else{_0x3f6e01['mergeFromDatabase'](_0x3f6e01[_0xdddd('0x51')][_0x280513['id']],_0x280513);}}}return _0x3f6e01[_0xdddd('0x51')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x52')]=function(){var _0x5a0d5c=this;return function(_0x3c6c79){if(_0x3c6c79){freeIsNotKey(_0x3c6c79,_0x5a0d5c['deskAccounts'],'id');for(var _0x276498=0x0,_0x30300c={},_0x117db8={};_0x276498<_0x3c6c79[_0xdddd('0x46')];_0x276498+=0x1){_0x30300c=_0x3c6c79[_0x276498];if(_[_0xdddd('0x47')](_0x5a0d5c['deskAccounts'][_0x30300c['id']])){_0x5a0d5c['deskAccounts'][_0x30300c['id']]=new DeskAccount(_0x30300c);}else{_0x5a0d5c[_0xdddd('0x44')](_0x5a0d5c[_0xdddd('0x21')][_0x30300c['id']],_0x30300c);}}}return _0x5a0d5c[_0xdddd('0x21')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x53')]=function(){var _0x12cf31=this;return function(_0x459eb0){if(_0x459eb0){freeIsNotKey(_0x459eb0,_0x12cf31[_0xdddd('0x1f')],'id');for(var _0x19d3ed=0x0,_0x211c36={},_0xdebaea={};_0x19d3ed<_0x459eb0[_0xdddd('0x46')];_0x19d3ed+=0x1){_0x211c36=_0x459eb0[_0x19d3ed];if(_[_0xdddd('0x47')](_0x12cf31['sugarcrmAccounts'][_0x211c36['id']])){_0x12cf31['sugarcrmAccounts'][_0x211c36['id']]=new SugarcrmAccount(_0x211c36);}else{_0x12cf31['mergeFromDatabase'](_0x12cf31[_0xdddd('0x1f')][_0x211c36['id']],_0x211c36);}}}return _0x12cf31[_0xdddd('0x1f')];};};Realtime[_0xdddd('0x43')]['initVtigerAccounts']=function(){var _0x2ed4e1=this;return function(_0x1e0023){if(_0x1e0023){freeIsNotKey(_0x1e0023,_0x2ed4e1[_0xdddd('0x22')],'id');for(var _0x162910=0x0,_0x193fb3={},_0x22e990={};_0x162910<_0x1e0023[_0xdddd('0x46')];_0x162910+=0x1){_0x193fb3=_0x1e0023[_0x162910];if(_[_0xdddd('0x47')](_0x2ed4e1[_0xdddd('0x22')][_0x193fb3['id']])){_0x2ed4e1[_0xdddd('0x22')][_0x193fb3['id']]=new VtigerAccount(_0x193fb3);}else{_0x2ed4e1['mergeFromDatabase'](_0x2ed4e1[_0xdddd('0x22')][_0x193fb3['id']],_0x193fb3);}}}return _0x2ed4e1['vtigerAccounts'];};};Realtime[_0xdddd('0x43')][_0xdddd('0x54')]=function(){var _0x4ba80e=this;return function(_0x48c978){if(_0x48c978){freeIsNotKey(_0x48c978,_0x4ba80e['servicenowAccounts'],'id');for(var _0x395ca2=0x0,_0x4bd3ee={},_0x17f39f={};_0x395ca2<_0x48c978[_0xdddd('0x46')];_0x395ca2+=0x1){_0x4bd3ee=_0x48c978[_0x395ca2];if(_[_0xdddd('0x47')](_0x4ba80e['servicenowAccounts'][_0x4bd3ee['id']])){_0x4ba80e[_0xdddd('0x23')][_0x4bd3ee['id']]=new ServicenowAccount(_0x4bd3ee);}else{_0x4ba80e[_0xdddd('0x44')](_0x4ba80e[_0xdddd('0x23')][_0x4bd3ee['id']],_0x4bd3ee);}}}return _0x4ba80e[_0xdddd('0x23')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x55')]=function(){var _0x54b766=this;return function(_0x178072){if(_0x178072){freeIsNotKey(_0x178072,_0x54b766[_0xdddd('0x24')],'id');for(var _0x3524cc=0x0,_0x4b30cd={},_0x4a3451={};_0x3524cc<_0x178072[_0xdddd('0x46')];_0x3524cc+=0x1){_0x4b30cd=_0x178072[_0x3524cc];if(_[_0xdddd('0x47')](_0x54b766[_0xdddd('0x24')][_0x4b30cd['id']])){_0x54b766[_0xdddd('0x24')][_0x4b30cd['id']]=new Dynamics365Account(_0x4b30cd);}else{_0x54b766[_0xdddd('0x44')](_0x54b766[_0xdddd('0x24')][_0x4b30cd['id']],_0x4b30cd);}}}return _0x54b766['dynamics365Accounts'];};};Realtime['prototype'][_0xdddd('0x56')]=function(){var _0x64cc3=this;return function(_0x35d992){if(_0x35d992){freeIsNotKey(_0x35d992,_0x64cc3[_0xdddd('0x25')],'id');for(var _0x55541b=0x0,_0x53d630={},_0x25de92={};_0x55541b<_0x35d992[_0xdddd('0x46')];_0x55541b+=0x1){_0x53d630=_0x35d992[_0x55541b];if(_[_0xdddd('0x47')](_0x64cc3[_0xdddd('0x25')][_0x53d630['id']])){_0x64cc3[_0xdddd('0x25')][_0x53d630['id']]=new FreshsalesAccount(_0x53d630);}else{_0x64cc3[_0xdddd('0x44')](_0x64cc3[_0xdddd('0x25')][_0x53d630['id']],_0x53d630);}}}return _0x64cc3[_0xdddd('0x25')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x52e709=this;return function(_0x7d404d){for(var _0x9b2af2=0x0;_0x9b2af2<_0x7d404d[_0xdddd('0x46')];_0x9b2af2+=0x1){_[_0xdddd('0x57')](_0x52e709[_0xdddd('0x15')][_0x7d404d[_0x9b2af2][_0xdddd('0x28')]],_0x7d404d[_0x9b2af2]);}return _0x52e709[_0xdddd('0x15')];};};Realtime['prototype'][_0xdddd('0x58')]=function(){var _0xfada02=this;return function(_0x25715a){clearVoiceQueues(_0xfada02['voiceQueues']);if(_0x25715a){_0x25715a=_['groupBy'](_0x25715a,_0xdddd('0x59'));for(var _0x3a1d86 in _0x25715a){if(_0x25715a[_0xdddd('0x29')](_0x3a1d86)){var _0xf473c6={};for(var _0x4f3fbd=0x0;_0x4f3fbd<_0x25715a[_0x3a1d86][_0xdddd('0x46')];_0x4f3fbd+=0x1){var _0x1d0d84=_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5a')];if(_0xfada02[_0xdddd('0x15')][_0x1d0d84]){if(_0x25715a[_0x3a1d86][_0x4f3fbd]['queuecallerexit']){_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x36')]+=0x1;}if(_0x25715a[_0x3a1d86][_0x4f3fbd]['queuecallerabandon']){_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x37')]+=0x1;}_0xfada02['voiceQueues'][_0x1d0d84][_0xdddd('0x30')]+=moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5b')])[_0xdddd('0x5c')](moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5d')]),_0xdddd('0x5e'))||0x0;if(_0x4f3fbd===_0x25715a[_0x3a1d86]['length']-0x1){_0xfada02['voiceQueues'][_0x1d0d84]['sumDuration']+=moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5f')]||_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x60')]||_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x61')])[_0xdddd('0x5c')](moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5d')]),_0xdddd('0x5e'))||0x0;_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x2e')]+=0x1;if(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x62')]){_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x2f')]+=0x1;_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x32')]+=moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5f')])['diff'](moment(_0x25715a[_0x3a1d86][_0x4f3fbd][_0xdddd('0x5b')]),_0xdddd('0x5e'))||0x0;}}else{_0xfada02[_0xdddd('0x15')][_0x1d0d84]['sumDuration']+=_0xfada02[_0xdddd('0x15')][_0x1d0d84][_0xdddd('0x30')]||0x0;}}}}}}return _0xfada02[_0xdddd('0x15')];};};Realtime['prototype'][_0xdddd('0x63')]=function(){var _0x43ff35=this;return function(_0x2a1152){clearVoiceCallReports(_0x43ff35[_0xdddd('0x17')]);if(_0x2a1152){for(var _0x14fd0a=0x0;_0x14fd0a<_0x2a1152[_0xdddd('0x46')];_0x14fd0a+=0x1){_0x43ff35[_0xdddd('0x17')][_0xdddd('0x2e')]+=0x1;_0x43ff35[_0xdddd('0x17')]['sumDuration']+=_0x2a1152[_0x14fd0a][_0xdddd('0x64')];if(_0x2a1152[_0x14fd0a][_0xdddd('0x65')]===_0xdddd('0x66')){_0x43ff35[_0xdddd('0x17')]['answered']+=0x1;_0x43ff35[_0xdddd('0x17')]['sumHoldTime']+=_0x2a1152[_0x14fd0a][_0xdddd('0x64')]-_0x2a1152[_0x14fd0a][_0xdddd('0x67')]||0x0;_0x43ff35['outbound']['sumBillable']+=_0x2a1152[_0x14fd0a][_0xdddd('0x67')];}}}return _0x43ff35[_0xdddd('0x17')];};};Realtime[_0xdddd('0x43')]['initCampaigns']=function(){var _0x29c498=this;return function(_0x2e354c){if(_0x2e354c){freeIsNotKey(_0x2e354c,_0x29c498[_0xdddd('0x16')],_0xdddd('0x28'));for(var _0x4a99fb=0x0,_0x1c275a={};_0x4a99fb<_0x2e354c[_0xdddd('0x46')];_0x4a99fb+=0x1){_0x1c275a=_0x2e354c[_0x4a99fb];if(_['isUndefined'](_0x29c498[_0xdddd('0x16')][_0x1c275a[_0xdddd('0x28')]])){_0x29c498[_0xdddd('0x16')][_0x1c275a[_0xdddd('0x28')]]=new Campaign(_0x1c275a);}else{_0x29c498[_0xdddd('0x44')](_0x29c498[_0xdddd('0x16')][_0x1c275a[_0xdddd('0x28')]],_0x1c275a);_0x29c498[_0xdddd('0x16')][_0x1c275a[_0xdddd('0x28')]][_0xdddd('0x68')]=_0x1c275a[_0xdddd('0x69')]?_0x1c275a[_0xdddd('0x69')][_0xdddd('0x28')]:undefined;}}}return _0x29c498['campaigns'];};};Realtime[_0xdddd('0x43')][_0xdddd('0x6a')]=function(){var _0x4c4763=this;return function(_0x42eac7){if(_0x42eac7){freeIsNotKey(_0x42eac7,_0x4c4763['voiceExtensions'],'id');for(var _0xd70c14=0x0,_0x9a70ab={};_0xd70c14<_0x42eac7[_0xdddd('0x46')];_0xd70c14+=0x1){_0x9a70ab=_0x42eac7[_0xd70c14];if(_[_0xdddd('0x47')](_0x4c4763[_0xdddd('0x6b')][_0x9a70ab['id']])){_0x4c4763[_0xdddd('0x6b')][_0x9a70ab['id']]=new VoiceExtension(_0x9a70ab);}else{_0x4c4763[_0xdddd('0x44')](_0x4c4763[_0xdddd('0x6b')][_0x9a70ab['id']],_0x9a70ab);}}}return _0x4c4763[_0xdddd('0x6b')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x6c')]=function(){var _0x393493=this;return function(_0x2132e0){clearCampaigns(_0x393493[_0xdddd('0x16')]);for(var _0x2e165b=0x0;_0x2e165b<_0x2132e0[_0xdddd('0x46')];_0x2e165b+=0x1){_[_0xdddd('0x57')](_0x393493[_0xdddd('0x16')][_0x2132e0[_0x2e165b][_0xdddd('0x28')]],_0x2132e0[_0x2e165b]);}return _0x393493[_0xdddd('0x16')];};};Realtime[_0xdddd('0x43')][_0xdddd('0x6d')]=function(){var _0x28aac2=this;return function(_0x1eb48e){if(_0x1eb48e){freeIsNotKey(_0x1eb48e,_0x28aac2[_0xdddd('0x26')],'id');for(var _0x2b01dd=0x0,_0xe16bd={},_0x269a8f={};_0x2b01dd<_0x1eb48e[_0xdddd('0x46')];_0x2b01dd+=0x1){_0xe16bd=_0x1eb48e[_0x2b01dd];if(_[_0xdddd('0x47')](_0x28aac2[_0xdddd('0x26')][_0xe16bd['id']])){_0x28aac2[_0xdddd('0x26')][_0xe16bd['id']]=new FaxAccount(_0xe16bd);}else{_0x28aac2[_0xdddd('0x44')](_0x28aac2[_0xdddd('0x26')][_0xe16bd['id']],_0xe16bd);}}}return _0x28aac2['faxAccounts'];};};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 9f448f9..34e7d1c 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 _0xac00=['getAgentByInternal','length','keys','getCallType','channel','split','outbound','internal','voiceCallReport','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','type','UserId','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','accountcode','name','isNil','find','interface','format','SIP/%s','findAgent','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match'];(function(_0x2fc48b,_0x42b03f){var _0x365ce5=function(_0x27bcd3){while(--_0x27bcd3){_0x2fc48b['push'](_0x2fc48b['shift']());}};_0x365ce5(++_0x42b03f);}(_0xac00,0xec));var _0x0ac0=function(_0x5a7188,_0x2ec5ad){_0x5a7188=_0x5a7188-0x0;var _0x805ef=_0xac00[_0x5a7188];return _0x805ef;};'use strict';var _=require('lodash');var moment=require(_0x0ac0('0x0'));var util=require(_0x0ac0('0x1'));var config=require(_0x0ac0('0x2'));var ami=require(_0x0ac0('0x3'));var RpcVoiceAgentReport=require(_0x0ac0('0x4'));var RpcVoiceCallReport=require(_0x0ac0('0x5'));var RpcVoiceDialReport=require(_0x0ac0('0x6'));var RpcMemberReport=require(_0x0ac0('0x7'));var RpcVoiceQueueReport=require(_0x0ac0('0x8'));var RpcVoiceRecording=require(_0x0ac0('0x9'));var RpcVoiceTransferReport=require(_0x0ac0('0xa'));var VoiceQueueReport=require(_0x0ac0('0xb'));var VoiceCallReport=require(_0x0ac0('0xc'));var VoiceAgentReport=require(_0x0ac0('0xd'));var VoiceDialReport=require(_0x0ac0('0xe'));var UserReport=require('./userReport');function Report(_0xe0e782){this[_0x0ac0('0xf')]=_0xe0e782;this[_0x0ac0('0x10')]=_0xe0e782['agents'];this['telephones']=_0xe0e782[_0x0ac0('0x11')];}Report['prototype'][_0x0ac0('0x12')]=function(_0x2556d6){var _0x2c1a52=new VoiceQueueReport(this[_0x0ac0('0xf')]);var _0x186931=new VoiceAgentReport(this['realtime']);var _0x31afc2=new VoiceDialReport(this[_0x0ac0('0xf')]);var _0x4e55b5=new VoiceCallReport(this[_0x0ac0('0xf')]);var _0xcd7132=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0x0ac0('0x13')]){ami['on'](_0x0ac0('0x14'),this[_0x0ac0('0x15')]['bind'](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x0ac0('0x16')](this));ami['on'](_0x0ac0('0x17'),this[_0x0ac0('0x18')][_0x0ac0('0x16')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x0ac0('0x16')](this));ami['on']('blindtransfer',this[_0x0ac0('0x19')][_0x0ac0('0x16')](this));ami['on'](_0x0ac0('0x1a'),this[_0x0ac0('0x1b')][_0x0ac0('0x16')](this));}};Report[_0x0ac0('0x1c')]['findAgent']=function(_0x486443){var _0x5c618a;_0x5c618a=_['find'](this[_0x0ac0('0x10')],function(_0x57a2a8){return _0x57a2a8[_0x0ac0('0x1d')]==_0x486443||_0x57a2a8[_0x0ac0('0x1e')]==_0x486443;});if(_[_0x0ac0('0x1f')](_0x5c618a)){var _0x16b9ac=_[_0x0ac0('0x20')](this[_0x0ac0('0x11')],function(_0x24ab7f){return _0x24ab7f[_0x0ac0('0x1d')]==_0x486443||_0x24ab7f[_0x0ac0('0x1e')]==_0x486443;});if(_0x16b9ac){_0x5c618a=_['find'](this[_0x0ac0('0x10')],function(_0x18df52){return _0x18df52[_0x0ac0('0x21')]==util[_0x0ac0('0x22')](_0x0ac0('0x23'),_0x16b9ac[_0x0ac0('0x1e')]);});}}return _0x5c618a;};Report[_0x0ac0('0x1c')][_0x0ac0('0x15')]=function(_0x5c99f7){for(var _0x5f5bba=0x0;_0x5f5bba<_0x5c99f7['length'];_0x5f5bba+=0x1){var _0x10b541=this[_0x0ac0('0x24')](_0x5c99f7[_0x5f5bba][_0x0ac0('0x25')]);if(_0x10b541){_0x5c99f7[_0x5f5bba]['accountcode']=_0x10b541[_0x0ac0('0x1d')];_0x5c99f7[_0x5f5bba][_0x0ac0('0x26')]=!![];_0x5c99f7[_0x5f5bba][_0x0ac0('0x27')]=_0x10b541[_0x0ac0('0x1e')];_0x5c99f7[_0x5f5bba]['interface']=_[_0x0ac0('0x1f')](_0x10b541[_0x0ac0('0x21')])?util['format'](_0x0ac0('0x23'),_0x10b541[_0x0ac0('0x1e')]):_0x10b541[_0x0ac0('0x21')];if(_0x5c99f7[_0x5f5bba]['queuecallercomplete']){_0x5c99f7[_0x5f5bba][_0x0ac0('0x28')]=moment()[_0x0ac0('0x22')](_0x0ac0('0x29'));}if(_0x5c99f7[_0x5f5bba][_0x0ac0('0x2a')]){_0x5c99f7[_0x5f5bba][_0x0ac0('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x0ac0('0x15')](_0x5c99f7[_0x5f5bba]);}RpcVoiceQueueReport[_0x0ac0('0x2c')](_0x5c99f7[_0x5f5bba]);}};function extractCalleridNumber(_0x11c9fe){var _0x20baaa=_0x11c9fe[_0x0ac0('0x2d')](/<(.*?)>/);return _0x20baaa?_0x20baaa[0x1]:_0x11c9fe;}Report['prototype'][_0x0ac0('0x2e')]=function(_0x46e646){for(var _0x2171e4=0x0;_0x2171e4','calleridname','transfers','linkedid','transfereelinkedid','split','UserId','membername','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','voiceDialReport','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3193,0xf3));var _0x3319=function(_0x1a457a,_0x193f72){_0x1a457a=_0x1a457a-0x0;var _0x43b698=_0x3193[_0x1a457a];return _0x43b698;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x3319('0x0'));var config=require(_0x3319('0x1'));var ami=require(_0x3319('0x2'));var RpcVoiceAgentReport=require(_0x3319('0x3'));var RpcVoiceCallReport=require(_0x3319('0x4'));var RpcVoiceDialReport=require(_0x3319('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x3319('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x3319('0x7'));var VoiceQueueReport=require(_0x3319('0x8'));var VoiceCallReport=require(_0x3319('0x9'));var VoiceAgentReport=require(_0x3319('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x3319('0xb'));function Report(_0x5f5bc7){this[_0x3319('0xc')]=_0x5f5bc7;this[_0x3319('0xd')]=_0x5f5bc7[_0x3319('0xd')];this[_0x3319('0xe')]=_0x5f5bc7[_0x3319('0xe')];}Report[_0x3319('0xf')][_0x3319('0x10')]=function(_0x79c4c4){var _0x283945=new VoiceQueueReport(this['realtime']);var _0x38593b=new VoiceAgentReport(this[_0x3319('0xc')]);var _0x583a26=new VoiceDialReport(this[_0x3319('0xc')]);var _0x5e7fc5=new VoiceCallReport(this['realtime']);var _0x16c6fc=new UserReport(this[_0x3319('0xc')]);if(config[_0x3319('0x11')]&&config[_0x3319('0x11')][_0x3319('0x12')]){ami['on'](_0x3319('0x13'),this[_0x3319('0x14')][_0x3319('0x15')](this));ami['on']('custom:voiceCallReport',this[_0x3319('0x16')][_0x3319('0x15')](this));ami['on'](_0x3319('0x17'),this['voiceAgentReport']['bind'](this));ami['on'](_0x3319('0x18'),this['voiceDialReport'][_0x3319('0x15')](this));ami['on'](_0x3319('0x19'),this[_0x3319('0x1a')][_0x3319('0x15')](this));ami['on'](_0x3319('0x1b'),this[_0x3319('0x1c')]['bind'](this));}};Report[_0x3319('0xf')][_0x3319('0x1d')]=function(_0x2af746){var _0x10ade1;_0x10ade1=_[_0x3319('0x1e')](this[_0x3319('0xd')],function(_0x3951da){return _0x3951da[_0x3319('0x1f')]==_0x2af746||_0x3951da[_0x3319('0x20')]==_0x2af746;});if(_[_0x3319('0x21')](_0x10ade1)){var _0x2bac04=_[_0x3319('0x1e')](this[_0x3319('0xe')],function(_0xd4c84c){return _0xd4c84c[_0x3319('0x1f')]==_0x2af746||_0xd4c84c['name']==_0x2af746;});if(_0x2bac04){_0x10ade1=_[_0x3319('0x1e')](this[_0x3319('0xd')],function(_0xd2f1b8){return _0xd2f1b8[_0x3319('0x22')]==util['format'](_0x3319('0x23'),_0x2bac04[_0x3319('0x20')]);});}}return _0x10ade1;};Report['prototype'][_0x3319('0x14')]=function(_0xf094b0){for(var _0x595231=0x0;_0x595231<_0xf094b0[_0x3319('0x24')];_0x595231+=0x1){var _0x7234de=this[_0x3319('0x1d')](_0xf094b0[_0x595231][_0x3319('0x25')]);if(_0x7234de){_0xf094b0[_0x595231][_0x3319('0x1f')]=_0x7234de['accountcode'];_0xf094b0[_0x595231][_0x3319('0x26')]=!![];_0xf094b0[_0x595231][_0x3319('0x27')]=_0x7234de[_0x3319('0x20')];_0xf094b0[_0x595231][_0x3319('0x22')]=_['isNil'](_0x7234de[_0x3319('0x22')])?util[_0x3319('0x28')](_0x3319('0x23'),_0x7234de[_0x3319('0x20')]):_0x7234de['interface'];if(_0xf094b0[_0x595231][_0x3319('0x29')]){_0xf094b0[_0x595231][_0x3319('0x2a')]=moment()['format'](_0x3319('0x2b'));}if(_0xf094b0[_0x595231][_0x3319('0x2c')]){_0xf094b0[_0x595231][_0x3319('0x2d')]=moment()[_0x3319('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0xf094b0[_0x595231]);}RpcVoiceQueueReport['create'](_0xf094b0[_0x595231]);}};function extractCalleridNumber(_0xbc5ed4){var _0x3beb61=_0xbc5ed4[_0x3319('0x2e')](/<(.*?)>/);return _0x3beb61?_0x3beb61[0x1]:_0xbc5ed4;}Report[_0x3319('0xf')][_0x3319('0x2f')]=function(_0x427de6){for(var _0x403abc=0x0;_0x403abc0x0?_0x5961a7:0x0;this[_0x19d2('0x11')][_0x3567eb[_0x19d2('0x67')]][_0x19d2('0x2e')]=this[_0x19d2('0x11')][_0x3567eb['queue']][_0x19d2('0x2e')]>_['toNumber'](_0x3567eb['loggedin'])?_['toNumber'](_0x3567eb[_0x19d2('0x6c')]):this[_0x19d2('0x11')][_0x3567eb[_0x19d2('0x67')]][_0x19d2('0x2e')];this[_0x19d2('0x6e')](this['voiceQueues'][_0x3567eb[_0x19d2('0x67')]],_0x19d2('0x14'));}logger['debug'](_0x19d2('0x6f'),util[_0x19d2('0x3c')](this[_0x19d2('0x11')][_0x3567eb[_0x19d2('0x67')]],{'showHidden':![],'depth':null}));ami[_0x19d2('0x42')](_0x19d2('0x70'),this[_0x19d2('0x11')][_0x3567eb[_0x19d2('0x67')]]);}}}catch(_0x325562){logger[_0x19d2('0x3b')](_0x19d2('0x71'),util[_0x19d2('0x3c')](_0x325562,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x17')]=function(_0x924568){logger[_0x19d2('0x43')](_0x19d2('0x72'),util[_0x19d2('0x3c')](_0x924568,{'showHidden':![],'depth':null}));this[_0x19d2('0x12')]=!![];};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x1a')]=function(_0xd09d03){try{if(this['isNotNull'](_0xd09d03)){logger[_0x19d2('0x43')]('[%s][voiceQueueReport][queuecallerjoin]',_0xd09d03[_0x19d2('0x46')],util['inspect'](_0xd09d03,{'showHidden':![],'depth':null}));if(_[_0x19d2('0x61')](this[_0x19d2('0xe')][_0xd09d03['uniqueid']]))this['queueReports'][_0xd09d03[_0x19d2('0x46')]]=[];if(_[_0x19d2('0x61')](this[_0x19d2('0x34')][_0xd09d03['uniqueid']]))this[_0x19d2('0x34')][_0xd09d03['uniqueid']]={};var _0x2497f9=new QueueReport();_0x2497f9[_0x19d2('0x49')]=_0xd09d03[_0x19d2('0x67')];_0x2497f9[_0x19d2('0x57')]=this['voiceQueues'][_0x2497f9['name']]&&this[_0x19d2('0x11')][_0x2497f9['name']]['type']?this[_0x19d2('0x11')][_0x2497f9[_0x19d2('0x49')]]['type']||_0x19d2('0x50'):_0x19d2('0x50');_0x2497f9[_0x19d2('0x67')]=_0xd09d03[_0x19d2('0x67')];_0x2497f9[_0x19d2('0x73')]=moment()[_0x19d2('0x47')](_0x19d2('0x74'));_0x2497f9[_0x19d2('0x75')]=_0xd09d03['position'];_0x2497f9[_0x19d2('0x76')]=_0xd09d03[_0x19d2('0x76')];_0x2497f9[_0x19d2('0x46')]=_0xd09d03[_0x19d2('0x46')];_0x2497f9['routealias']=this['channels'][_0xd09d03[_0x19d2('0x46')]]['routealias'];logger[_0x19d2('0x68')](_0x19d2('0x77'),_0x2497f9[_0x19d2('0x49')],_0x2497f9[_0x19d2('0x57')]);_['merge'](_0x2497f9,_['pick'](_0xd09d03,_[_0x19d2('0x78')](_0x2497f9)));this[_0x19d2('0xe')][_0xd09d03['uniqueid']][_0x19d2('0x79')](_0x2497f9);this[_0x19d2('0x34')][_0xd09d03[_0x19d2('0x46')]]=_0x2497f9;this['emitVoiceQueueChannelSave'](_0x2497f9,_0x19d2('0x19'));}}catch(_0x5ddf48){logger['error'](_0x19d2('0x7a'),_0xd09d03[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x5ddf48,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x7b')]=function(_0x39e771){try{if(this[_0x19d2('0x65')](_0x39e771)){logger[_0x19d2('0x43')]('[%s][voiceQueueReport][queuecallerabandon]',_0x39e771[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x39e771,{'showHidden':![],'depth':null}));if(this[_0x19d2('0xe')][_0x39e771['uniqueid']]){var _0x218d4b=_[_0x19d2('0x7c')](this[_0x19d2('0xe')][_0x39e771[_0x19d2('0x46')]]);_0x218d4b[_0x19d2('0x7d')]=![];_0x218d4b['queuecallercompleteAt']=null;_0x218d4b['holdtime']=_0x39e771[_0x19d2('0x7e')];_0x218d4b[_0x19d2('0x7f')]=_0x39e771['originalposition'];_0x218d4b['queuecallerabandon']=!![];_0x218d4b[_0x19d2('0x80')]=moment()[_0x19d2('0x47')](_0x19d2('0x74'));_0x218d4b[_0x19d2('0x4d')]=_0x19d2('0x81');_0x218d4b[_0x19d2('0x82')]=null;logger[_0x19d2('0x68')](_0x19d2('0x83'),_0x218d4b['name'],_0x218d4b[_0x19d2('0x57')]);this[_0x19d2('0x34')][_0x39e771[_0x19d2('0x46')]]=_0x218d4b;this[_0x19d2('0x4c')](_0x218d4b,'queuecallerabandon');}}}catch(_0x54259a){logger[_0x19d2('0x3b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x39e771[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x54259a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x1b')]=function(_0x1a457b){try{if(this[_0x19d2('0x65')](_0x1a457b)){logger['debug'](_0x19d2('0x84'),_0x1a457b['uniqueid'],util[_0x19d2('0x3c')](_0x1a457b,{'showHidden':![],'depth':null}));if(this[_0x19d2('0xe')][_0x1a457b['uniqueid']]){var _0x570c12=_['last'](this[_0x19d2('0xe')][_0x1a457b[_0x19d2('0x46')]]);_0x570c12['queuecallerleaveAt']=moment()[_0x19d2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x570c12[_0x19d2('0x85')]=_0x1a457b[_0x19d2('0x85')];_0x570c12[_0x19d2('0x86')]=_0x1a457b[_0x19d2('0x86')];logger[_0x19d2('0x68')](_0x19d2('0x87'),_0x570c12[_0x19d2('0x49')],_0x570c12['type'],_0x1a457b['connectedlinenum'],_0x1a457b['connectedlinename']);this['channels'][_0x1a457b[_0x19d2('0x46')]]=_0x570c12;this[_0x19d2('0x88')](_0x570c12,_0x19d2('0x89'));}}}catch(_0x14016f){logger[_0x19d2('0x3b')](_0x19d2('0x84'),_0x1a457b[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x14016f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x19d2('0x1e')]=function(_0x228cbb){try{if(this[_0x19d2('0x65')](_0x228cbb)){logger['debug'](_0x19d2('0x8a'),_0x228cbb[_0x19d2('0x46')],util['inspect'](_0x228cbb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x228cbb[_0x19d2('0x46')]]){var _0x409cb1=_[_0x19d2('0x7c')](this[_0x19d2('0xe')][_0x228cbb[_0x19d2('0x46')]]);_0x409cb1['queuecallercomplete']=!![];_0x409cb1[_0x19d2('0x4d')]=_0x19d2('0x8b');logger[_0x19d2('0x68')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x409cb1['name'],_0x409cb1['type']);}}}catch(_0x49e6b3){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x228cbb[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x49e6b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x1d')]=function(_0x2c1107){try{if(this[_0x19d2('0x65')](_0x2c1107)){logger[_0x19d2('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x2c1107['uniqueid'],util[_0x19d2('0x3c')](_0x2c1107,{'showHidden':![],'depth':null}));if(this[_0x19d2('0xe')][_0x2c1107[_0x19d2('0x46')]]){var _0x1944fc=_[_0x19d2('0x7c')](this[_0x19d2('0xe')][_0x2c1107[_0x19d2('0x46')]]);_0x1944fc[_0x19d2('0x8c')]=![];_0x1944fc[_0x19d2('0x80')]=null;_0x1944fc[_0x19d2('0x8d')]=!![];_0x1944fc['lastAssignedTo']=_0x2c1107[_0x19d2('0x8e')];_0x1944fc[_0x19d2('0x7e')]=_0x2c1107[_0x19d2('0x7e')];_0x1944fc[_0x19d2('0x7d')]=!![];_0x1944fc[_0x19d2('0x8f')]=![];_0x1944fc[_0x19d2('0x90')]=null;if(!_0x1944fc[_0x19d2('0x91')]){if(_0x2c1107['reason']==_0x19d2('0x91')){_0x1944fc[_0x19d2('0x4d')]='COMPLETED';logger[_0x19d2('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1944fc[_0x19d2('0x49')],_0x1944fc['type']);}else{if(_[_0x19d2('0x92')](_0x2c1107['channel']['toLowerCase'](),_0x19d2('0x93'))){if(this[_0x19d2('0xe')][_0x2c1107['linkedid']]){var _0x1a39ad=_[_0x19d2('0x7c')](this[_0x19d2('0xe')][_0x2c1107[_0x19d2('0x94')]]);_0x1a39ad[_0x19d2('0x7d')]=![];_0x1a39ad[_0x19d2('0x8f')]=!![];_0x1a39ad[_0x19d2('0x90')]=moment(_0x1944fc['queuecallerjoinAt'])[_0x19d2('0x95')](_0x2c1107[_0x19d2('0x7e')],'seconds')[_0x19d2('0x47')](_0x19d2('0x74'));_0x1a39ad[_0x19d2('0x4d')]=_0x19d2('0x96');_0x1a39ad[_0x19d2('0x91')]=!![];_0x1a39ad[_0x19d2('0x97')]=_0x19d2('0x98');_0x1a39ad[_0x19d2('0x99')]=_0x2c1107[_0x19d2('0x9a')];_0x1a39ad[_0x19d2('0x9b')]=_0x2c1107['uniqueid'];logger[_0x19d2('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1a39ad[_0x19d2('0x49')],_0x1a39ad['type']);var _0xe2d179=this['queueReports'][_0x2c1107['linkedid']];this[_0x19d2('0xe')][_0x2c1107[_0x19d2('0x94')]]=this[_0x19d2('0xe')][_0x2c1107['uniqueid']];this[_0x19d2('0xe')][_0x2c1107[_0x19d2('0x46')]]=_0xe2d179;}}else{_0x1944fc[_0x19d2('0x4d')]='COMPLETEDBY'+_0x2c1107['reason'][_0x19d2('0x9c')]();logger[_0x19d2('0x68')](_0x19d2('0x9d'),_0x1944fc[_0x19d2('0x49')],_0x1944fc[_0x19d2('0x57')],_0x1944fc[_0x19d2('0x4d')]);}}}this[_0x19d2('0x34')][_0x2c1107[_0x19d2('0x46')]]=_0x1944fc;this[_0x19d2('0x4c')](_0x1944fc,_0x19d2('0x1c'));}}}catch(_0x2e84e3){logger[_0x19d2('0x3b')]('[%s][voiceQueueReport][agentcomplete]',_0x2c1107[_0x19d2('0x46')],util['inspect'](_0x2e84e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x9e')]=function(_0x3b98cc){try{if(this[_0x19d2('0x65')](_0x3b98cc)){logger['debug']('[%s][voiceQueueReport][varset]',_0x3b98cc[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x3b98cc,{'showHidden':![],'depth':null}));this[_0x19d2('0x9f')](_0x3b98cc[_0x19d2('0x46')],_['keys'](_0x3b98cc[_0x19d2('0xa0')])[0x0],_0x3b98cc[_0x19d2('0xa1')]);if(this[_0x19d2('0xe')][_0x3b98cc[_0x19d2('0x46')]]){var _0x1235a5=_[_0x19d2('0x7c')](this['queueReports'][_0x3b98cc[_0x19d2('0x46')]]);if(_0x1235a5){if(this['isNotNull'](_0x3b98cc[_0x19d2('0xa0')])&&this['isNotNull'](_0x3b98cc[_0x19d2('0xa0')]['queuestatus'])){switch(_0x3b98cc['value']){case'CONTINUE':_0x1235a5[_0x19d2('0x8f')]=![];_0x1235a5[_0x19d2('0x90')]=null;break;case _0x19d2('0xa2'):_0x1235a5['lastevent']=_0x19d2('0xa3');_0x1235a5[_0x19d2('0x8f')]=!![];_0x1235a5['queuecallerexitAt']=moment()[_0x19d2('0x47')](_0x19d2('0x74'));_0x1235a5[_0x19d2('0xa4')]=moment()['format'](_0x19d2('0x74'));logger[_0x19d2('0x43')](_0x19d2('0xa5'),_0x3b98cc[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x1235a5,{'showHidden':![],'depth':null}));ami[_0x19d2('0x42')](_0x19d2('0xa6'),_0x1235a5);break;default:_0x1235a5['queuecallerexit']=!![];_0x1235a5['queuecallerexitAt']=moment()['format'](_0x19d2('0x74'));_0x1235a5[_0x19d2('0xa4')]=moment()[_0x19d2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1235a5[_0x19d2('0x8c')]=![];_0x1235a5[_0x19d2('0x80')]=null;_0x1235a5[_0x19d2('0x4d')]=_0x3b98cc[_0x19d2('0xa1')];this[_0x19d2('0x34')][_0x3b98cc['uniqueid']]=_0x1235a5;this[_0x19d2('0x4c')](_0x1235a5,_0x19d2('0x1f'));}else if(this[_0x19d2('0x65')](_0x3b98cc[_0x19d2('0xa0')])&&this['isNotNull'](_0x3b98cc[_0x19d2('0xa0')]['queueposition'])){if(!_0x1235a5[_0x19d2('0x8c')]){_0x1235a5[_0x19d2('0x8f')]=!![];_0x1235a5[_0x19d2('0x90')]=moment()[_0x19d2('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1235a5[_0x19d2('0x4d')]=_0x19d2('0xa7');_0x1235a5['queuecallerleaveAt']=moment()['format'](_0x19d2('0x74'));this[_0x19d2('0x34')][_0x3b98cc[_0x19d2('0x46')]]=_0x1235a5;}}logger['info'](_0x19d2('0xa8'),_0x3b98cc[_0x19d2('0x46')],_0x1235a5['name'],_0x1235a5['type'],_[_0x19d2('0x78')](_0x3b98cc['variable'])[0x0],_0x3b98cc[_0x19d2('0xa1')]);_0x1235a5['variables']=this['variables'][_0x3b98cc[_0x19d2('0x46')]];}}}}catch(_0x10ce75){logger['error'](_0x19d2('0xa9'),_0x3b98cc[_0x19d2('0x46')],util[_0x19d2('0x3c')](_0x10ce75,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0x9f')]=function(_0x2eaad8,_0xd941d4,_0x336418){var _0x12ba1b=[_0x19d2('0xaa'),_0x19d2('0xab'),_0x19d2('0xac'),_0x19d2('0xad'),_0x19d2('0xae'),'rtpaudioqoslossbridged',_0x19d2('0xaf'),_0x19d2('0xb0'),_0x19d2('0xb1'),_0x19d2('0xb2'),'bridgepeer','bridgepvtcallid',_0x19d2('0xb3'),_0x19d2('0xb4'),_0x19d2('0xb5'),_0x19d2('0xb6'),_0x19d2('0x8e'),_0x19d2('0xb7'),_0x19d2('0xb8')];if(!_[_0x19d2('0x36')](_0xd941d4)&&!_[_0x19d2('0xb9')](_0x12ba1b,_0xd941d4)){if(_[_0x19d2('0x61')](this[_0x19d2('0x3e')][_0x2eaad8])){this[_0x19d2('0x3e')][_0x2eaad8]={};}this[_0x19d2('0x3e')][_0x2eaad8][_0xd941d4]=_0x336418;}};VoiceQueueReport[_0x19d2('0x32')][_0x19d2('0xba')]=function(_0x12104f){try{if(this['isNotNull'](_0x12104f)){logger[_0x19d2('0x43')]('[%s][voiceQueueReport][hangup]',_0x12104f[_0x19d2('0x46')],util['inspect'](_0x12104f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x12104f['uniqueid']]){for(var _0x480fab=0x0,_0x163396={};_0x480fab0x0?_0x494065:0x0;this['voiceQueues'][_0x469cf2[_0x42b7('0x67')]]['talking']=this[_0x42b7('0xe')][_0x469cf2[_0x42b7('0x67')]][_0x42b7('0x28')]>_[_0x42b7('0x6c')](_0x469cf2['loggedin'])?_[_0x42b7('0x6c')](_0x469cf2[_0x42b7('0x6d')]):this[_0x42b7('0xe')][_0x469cf2[_0x42b7('0x67')]][_0x42b7('0x28')];this['emitVoiceQueueSummary'](this[_0x42b7('0xe')][_0x469cf2[_0x42b7('0x67')]],_0x42b7('0x6e'));}logger[_0x42b7('0x44')](_0x42b7('0x6f'),util[_0x42b7('0x38')](this['voiceQueues'][_0x469cf2[_0x42b7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x42b7('0x3f')]('custom:queuesummary',this[_0x42b7('0xe')][_0x469cf2[_0x42b7('0x67')]]);}}}catch(_0x1e1633){logger[_0x42b7('0x35')](_0x42b7('0x66'),util[_0x42b7('0x38')](_0x1e1633,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x42b7('0x9')][_0x42b7('0x14')]=function(_0x15cf85){logger[_0x42b7('0x44')](_0x42b7('0x70'),util['inspect'](_0x15cf85,{'showHidden':![],'depth':null}));this[_0x42b7('0xf')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x26b821){try{if(this['isNotNull'](_0x26b821)){logger[_0x42b7('0x44')](_0x42b7('0x71'),_0x26b821[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x26b821,{'showHidden':![],'depth':null}));if(_[_0x42b7('0x60')](this[_0x42b7('0xc')][_0x26b821[_0x42b7('0x46')]]))this['queueReports'][_0x26b821[_0x42b7('0x46')]]=[];if(_[_0x42b7('0x60')](this[_0x42b7('0x2e')][_0x26b821[_0x42b7('0x46')]]))this[_0x42b7('0x2e')][_0x26b821[_0x42b7('0x46')]]={};var _0x37dfcb=new QueueReport();_0x37dfcb['name']=_0x26b821[_0x42b7('0x67')];_0x37dfcb[_0x42b7('0x54')]=this[_0x42b7('0xe')][_0x37dfcb['name']]&&this[_0x42b7('0xe')][_0x37dfcb[_0x42b7('0x49')]][_0x42b7('0x54')]?this['voiceQueues'][_0x37dfcb['name']][_0x42b7('0x54')]||_0x42b7('0x4c'):'inbound';_0x37dfcb[_0x42b7('0x67')]=_0x26b821[_0x42b7('0x67')];_0x37dfcb[_0x42b7('0x72')]=moment()[_0x42b7('0x42')](_0x42b7('0x73'));_0x37dfcb[_0x42b7('0x74')]=_0x26b821[_0x42b7('0x74')];_0x37dfcb[_0x42b7('0x75')]=_0x26b821[_0x42b7('0x75')];_0x37dfcb[_0x42b7('0x46')]=_0x26b821['uniqueid'];_0x37dfcb[_0x42b7('0x76')]=this[_0x42b7('0x2e')][_0x26b821['uniqueid']][_0x42b7('0x76')];logger[_0x42b7('0x69')](_0x42b7('0x77'),_0x37dfcb['name'],_0x37dfcb[_0x42b7('0x54')]);_['merge'](_0x37dfcb,_[_0x42b7('0x78')](_0x26b821,_[_0x42b7('0x79')](_0x37dfcb)));this[_0x42b7('0xc')][_0x26b821[_0x42b7('0x46')]]['push'](_0x37dfcb);this['channels'][_0x26b821['uniqueid']]=_0x37dfcb;this['emitVoiceQueueChannelSave'](_0x37dfcb,_0x42b7('0x15'));}}catch(_0x491ce8){logger[_0x42b7('0x35')]('[%s][voiceQueueReport][queuecallerjoin]',_0x26b821[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x491ce8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x42b7('0x9')][_0x42b7('0x7a')]=function(_0x1cab7f){try{if(this[_0x42b7('0x5f')](_0x1cab7f)){logger['debug'](_0x42b7('0x7b'),_0x1cab7f['uniqueid'],util[_0x42b7('0x38')](_0x1cab7f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1cab7f['uniqueid']]){var _0x4ed911=_['last'](this[_0x42b7('0xc')][_0x1cab7f[_0x42b7('0x46')]]);_0x4ed911[_0x42b7('0x7c')]=![];_0x4ed911[_0x42b7('0x7d')]=null;_0x4ed911[_0x42b7('0x7e')]=_0x1cab7f[_0x42b7('0x7e')];_0x4ed911[_0x42b7('0x7f')]=_0x1cab7f[_0x42b7('0x7f')];_0x4ed911[_0x42b7('0x16')]=!![];_0x4ed911[_0x42b7('0x80')]=moment()[_0x42b7('0x42')](_0x42b7('0x73'));_0x4ed911[_0x42b7('0x47')]=_0x42b7('0x81');_0x4ed911[_0x42b7('0x82')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4ed911[_0x42b7('0x49')],_0x4ed911['type']);this[_0x42b7('0x2e')][_0x1cab7f[_0x42b7('0x46')]]=_0x4ed911;this[_0x42b7('0x3d')](_0x4ed911,'queuecallerabandon');}}}catch(_0x25d934){logger[_0x42b7('0x35')](_0x42b7('0x7b'),_0x1cab7f['uniqueid'],util[_0x42b7('0x38')](_0x25d934,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x42b7('0x18')]=function(_0x343577){try{if(this[_0x42b7('0x5f')](_0x343577)){logger[_0x42b7('0x44')](_0x42b7('0x83'),_0x343577[_0x42b7('0x46')],util['inspect'](_0x343577,{'showHidden':![],'depth':null}));if(this[_0x42b7('0xc')][_0x343577[_0x42b7('0x46')]]){var _0x5d5324=_[_0x42b7('0x84')](this[_0x42b7('0xc')][_0x343577[_0x42b7('0x46')]]);_0x5d5324[_0x42b7('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d5324[_0x42b7('0x86')]=_0x343577['connectedlinenum'];_0x5d5324[_0x42b7('0x87')]=_0x343577[_0x42b7('0x87')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5d5324['name'],_0x5d5324[_0x42b7('0x54')],_0x343577[_0x42b7('0x86')],_0x343577[_0x42b7('0x87')]);this[_0x42b7('0x2e')][_0x343577[_0x42b7('0x46')]]=_0x5d5324;this[_0x42b7('0x88')](_0x5d5324,'queuecallerleave');}}}catch(_0x825653){logger['error'](_0x42b7('0x83'),_0x343577[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x825653,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x42b7('0x1a')]=function(_0x2ffd30){try{if(this[_0x42b7('0x5f')](_0x2ffd30)){logger[_0x42b7('0x44')](_0x42b7('0x89'),_0x2ffd30[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x2ffd30,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2ffd30[_0x42b7('0x46')]]){var _0x22c1c2=_[_0x42b7('0x84')](this[_0x42b7('0xc')][_0x2ffd30[_0x42b7('0x46')]]);_0x22c1c2[_0x42b7('0x7c')]=!![];_0x22c1c2['queuecallerexitreason']=_0x42b7('0x8a');logger[_0x42b7('0x69')](_0x42b7('0x8b'),_0x22c1c2[_0x42b7('0x49')],_0x22c1c2[_0x42b7('0x54')]);}}}catch(_0x52fe96){logger['error'](_0x42b7('0x89'),_0x2ffd30[_0x42b7('0x46')],util['inspect'](_0x52fe96,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x42b7('0x9')][_0x42b7('0x8c')]=function(_0x58eb8a){try{if(this['isNotNull'](_0x58eb8a)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x58eb8a[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x58eb8a,{'showHidden':![],'depth':null}));if(this[_0x42b7('0xc')][_0x58eb8a[_0x42b7('0x46')]]){var _0x132e04=_[_0x42b7('0x84')](this[_0x42b7('0xc')][_0x58eb8a[_0x42b7('0x46')]]);_0x132e04['queuecallerabandon']=![];_0x132e04[_0x42b7('0x80')]=null;_0x132e04['assigned']=!![];_0x132e04[_0x42b7('0x82')]=_0x58eb8a[_0x42b7('0x8d')];_0x132e04[_0x42b7('0x7e')]=_0x58eb8a[_0x42b7('0x7e')];_0x132e04[_0x42b7('0x7c')]=!![];_0x132e04[_0x42b7('0x8e')]=![];_0x132e04['queuecallerexitAt']=null;if(!_0x132e04['transfer']){if(_0x58eb8a['reason']==_0x42b7('0x8f')){_0x132e04['queuecallerexitreason']=_0x42b7('0x90');logger[_0x42b7('0x69')](_0x42b7('0x91'),_0x132e04[_0x42b7('0x49')],_0x132e04[_0x42b7('0x54')]);}else{if(_[_0x42b7('0x92')](_0x58eb8a[_0x42b7('0x31')][_0x42b7('0x93')](),_0x42b7('0x94'))){if(this[_0x42b7('0xc')][_0x58eb8a[_0x42b7('0x95')]]){var _0x471175=_['last'](this['queueReports'][_0x58eb8a[_0x42b7('0x95')]]);_0x471175[_0x42b7('0x7c')]=![];_0x471175['queuecallerexit']=!![];_0x471175[_0x42b7('0x96')]=moment(_0x132e04[_0x42b7('0x72')])[_0x42b7('0x97')](_0x58eb8a[_0x42b7('0x7e')],_0x42b7('0x98'))[_0x42b7('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x471175[_0x42b7('0x47')]=_0x42b7('0x99');_0x471175['transfer']=!![];_0x471175[_0x42b7('0x9a')]=_0x42b7('0x9b');_0x471175[_0x42b7('0x9c')]=_0x58eb8a[_0x42b7('0x9d')];_0x471175[_0x42b7('0x9e')]=_0x58eb8a[_0x42b7('0x46')];logger[_0x42b7('0x69')](_0x42b7('0x9f'),_0x471175['name'],_0x471175[_0x42b7('0x54')]);var _0x21c972=this[_0x42b7('0xc')][_0x58eb8a[_0x42b7('0x95')]];this['queueReports'][_0x58eb8a['linkedid']]=this[_0x42b7('0xc')][_0x58eb8a['uniqueid']];this[_0x42b7('0xc')][_0x58eb8a[_0x42b7('0x46')]]=_0x21c972;}}else{_0x132e04['queuecallerexitreason']=_0x42b7('0xa0')+_0x58eb8a[_0x42b7('0xa1')]['toUpperCase']();logger['info'](_0x42b7('0xa2'),_0x132e04[_0x42b7('0x49')],_0x132e04['type'],_0x132e04[_0x42b7('0x47')]);}}}this['channels'][_0x58eb8a[_0x42b7('0x46')]]=_0x132e04;this[_0x42b7('0x3d')](_0x132e04,_0x42b7('0x19'));}}}catch(_0x110e52){logger[_0x42b7('0x35')]('[%s][voiceQueueReport][agentcomplete]',_0x58eb8a['uniqueid'],util[_0x42b7('0x38')](_0x110e52,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x42b7('0x9')][_0x42b7('0x1c')]=function(_0x48588b){try{if(this[_0x42b7('0x5f')](_0x48588b)){logger[_0x42b7('0x44')](_0x42b7('0xa3'),_0x48588b['uniqueid'],util[_0x42b7('0x38')](_0x48588b,{'showHidden':![],'depth':null}));this[_0x42b7('0xa4')](_0x48588b[_0x42b7('0x46')],_['keys'](_0x48588b[_0x42b7('0xa5')])[0x0],_0x48588b[_0x42b7('0xa6')]);if(this[_0x42b7('0xc')][_0x48588b[_0x42b7('0x46')]]){var _0x49eee5=_[_0x42b7('0x84')](this[_0x42b7('0xc')][_0x48588b[_0x42b7('0x46')]]);if(_0x49eee5){if(this[_0x42b7('0x5f')](_0x48588b[_0x42b7('0xa5')])&&this[_0x42b7('0x5f')](_0x48588b[_0x42b7('0xa5')][_0x42b7('0xa7')])){switch(_0x48588b[_0x42b7('0xa6')]){case'CONTINUE':_0x49eee5[_0x42b7('0x8e')]=![];_0x49eee5['queuecallerexitAt']=null;break;case _0x42b7('0xa8'):_0x49eee5[_0x42b7('0xa9')]=_0x42b7('0xaa');_0x49eee5['queuecallerexit']=!![];_0x49eee5['queuecallerexitAt']=moment()[_0x42b7('0x42')](_0x42b7('0x73'));_0x49eee5['queuecallerleaveAt']=moment()['format'](_0x42b7('0x73'));logger[_0x42b7('0x44')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x48588b[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x49eee5,{'showHidden':![],'depth':null}));ami[_0x42b7('0x3f')](_0x42b7('0xab'),_0x49eee5);break;default:_0x49eee5['queuecallerexit']=!![];_0x49eee5[_0x42b7('0x96')]=moment()[_0x42b7('0x42')](_0x42b7('0x73'));_0x49eee5[_0x42b7('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x49eee5[_0x42b7('0x16')]=![];_0x49eee5[_0x42b7('0x80')]=null;_0x49eee5[_0x42b7('0x47')]=_0x48588b[_0x42b7('0xa6')];this[_0x42b7('0x2e')][_0x48588b['uniqueid']]=_0x49eee5;this[_0x42b7('0x3d')](_0x49eee5,'varset');}else if(this[_0x42b7('0x5f')](_0x48588b[_0x42b7('0xa5')])&&this[_0x42b7('0x5f')](_0x48588b[_0x42b7('0xa5')][_0x42b7('0xac')])){if(!_0x49eee5[_0x42b7('0x16')]){_0x49eee5[_0x42b7('0x8e')]=!![];_0x49eee5[_0x42b7('0x96')]=moment()['format'](_0x42b7('0x73'));_0x49eee5[_0x42b7('0x47')]=_0x42b7('0xad');_0x49eee5[_0x42b7('0x85')]=moment()['format'](_0x42b7('0x73'));this['channels'][_0x48588b[_0x42b7('0x46')]]=_0x49eee5;}}logger[_0x42b7('0x69')](_0x42b7('0xae'),_0x48588b[_0x42b7('0x46')],_0x49eee5['name'],_0x49eee5[_0x42b7('0x54')],_[_0x42b7('0x79')](_0x48588b[_0x42b7('0xa5')])[0x0],_0x48588b[_0x42b7('0xa6')]);_0x49eee5['variables']=this[_0x42b7('0x11')][_0x48588b[_0x42b7('0x46')]];}}}}catch(_0x497e81){logger[_0x42b7('0x35')]('[%s][voiceQueueReport][varset]',_0x48588b[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x497e81,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x18ca31,_0xe789d2,_0x321f8d){var _0x10ee39=[_0x42b7('0xaf'),_0x42b7('0xb0'),_0x42b7('0xb1'),_0x42b7('0xb2'),_0x42b7('0xb3'),_0x42b7('0xb4'),_0x42b7('0xb5'),_0x42b7('0xb6'),'sipcallid','sipuri','bridgepeer',_0x42b7('0xb7'),_0x42b7('0xb8'),'memberdynamic',_0x42b7('0xb9'),_0x42b7('0xba'),_0x42b7('0x8d'),_0x42b7('0xbb'),'memberrealtime'];if(!_['isNil'](_0xe789d2)&&!_[_0x42b7('0xbc')](_0x10ee39,_0xe789d2)){if(_[_0x42b7('0x60')](this[_0x42b7('0x11')][_0x18ca31])){this['variables'][_0x18ca31]={};}this[_0x42b7('0x11')][_0x18ca31][_0xe789d2]=_0x321f8d;}};VoiceQueueReport['prototype'][_0x42b7('0x1d')]=function(_0x3156b6){try{if(this[_0x42b7('0x5f')](_0x3156b6)){logger[_0x42b7('0x44')](_0x42b7('0xbd'),_0x3156b6[_0x42b7('0x46')],util[_0x42b7('0x38')](_0x3156b6,{'showHidden':![],'depth':null}));if(this[_0x42b7('0xc')][_0x3156b6[_0x42b7('0x46')]]){for(var _0x1538ed=0x0,_0x2e13cb={};_0x1538ed=0x0?moment(_0x2602ea[_0x962b('0x1c')])[_0x962b('0xf')](_0x2602ea[_0x962b('0x1d')],_0x962b('0x10')):null,'data1':_0x962b('0x1e'),'data2':_0x2602ea['accountcode'],'data3':_0x2602ea[_0x962b('0x13')],'data4':_0x2602ea[_0x962b('0x1f')]||null,'role':_0x962b('0x15'),'internal':_0x2602ea['accountcode']?_[_0x962b('0x17')](_0x2602ea[_0x962b('0x16')]):undefined,'uniqueid':_0x2602ea[_0x962b('0x18')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x249a=['SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','membername','starttime','endtime','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo'];(function(_0x5a4a04,_0x41319a){var _0x38220e=function(_0x45deee){while(--_0x45deee){_0x5a4a04['push'](_0x5a4a04['shift']());}};_0x38220e(++_0x41319a);}(_0x249a,0x163));var _0xa249=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x249a[_0x4c12ec];return _0x3ae42c;};'use strict';var moment=require(_0xa249('0x0'));var _=require('lodash');var util=require(_0xa249('0x1'));var client=require(_0xa249('0x2'));exports[_0xa249('0x3')]=function(_0x56a616){var _0x1f8d76=_0x56a616[_0xa249('0x4')]||_0x56a616[_0xa249('0x5')];return client[_0xa249('0x6')]('CreateMemberReport',{'body':{'channel':_0xa249('0x7'),'membername':_0x56a616[_0xa249('0x8')],'interface':_['isNil'](_0x56a616['interface'])?util['format'](_0xa249('0x9'),_0x56a616['lastAssignedTo']):_0x56a616[_0xa249('0xa')],'type':_0xa249('0xb'),'enterAt':_0x56a616[_0xa249('0xc')],'exitAt':_0x1f8d76,'duration':moment(_0x1f8d76)[_0xa249('0xd')](_0x56a616[_0xa249('0xc')],_0xa249('0xe')),'data1':_0xa249('0xf'),'data2':_0x56a616['calleridnum'],'data3':_0x56a616[_0xa249('0x10')],'data4':null,'data5':_0x56a616[_0xa249('0x11')],'role':_0xa249('0x12'),'internal':_0x56a616[_0xa249('0x13')]?_[_0xa249('0x14')](_0x56a616['accountcode']):undefined,'uniqueid':_0x56a616[_0xa249('0x15')]},'log':_0xa249('0x16')});};exports[_0xa249('0x17')]=function(_0x33d3dc){return client[_0xa249('0x6')]('CreateMemberReport',{'body':{'channel':_0xa249('0x7'),'membername':_0x33d3dc[_0xa249('0x18')],'interface':_0x33d3dc[_0xa249('0xa')],'type':'TALKING','enterAt':_0x33d3dc[_0xa249('0x19')],'exitAt':_0x33d3dc[_0xa249('0x1a')],'duration':moment(_0x33d3dc[_0xa249('0x1a')])[_0xa249('0xd')](_0x33d3dc['starttime'],_0xa249('0xe'))>=0x0?moment(_0x33d3dc[_0xa249('0x1a')])[_0xa249('0xd')](_0x33d3dc[_0xa249('0x19')],'seconds'):null,'data1':'outbound','data2':_0x33d3dc[_0xa249('0x13')],'data3':_0x33d3dc['exten'],'data4':_0x33d3dc[_0xa249('0x1b')]||null,'role':'agent','internal':_0x33d3dc['accountcode']?_['toNumber'](_0x33d3dc['accountcode']):undefined,'uniqueid':_0x33d3dc['uniqueid']},'log':_0xa249('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 46704b4..c6e2c0d 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 _0x3166=['previewRecallmeReminderInterval','GetSettings','getSettings','Request','ShowSetting'];(function(_0x29df36,_0x35d704){var _0x13ba21=function(_0x120bda){while(--_0x120bda){_0x29df36['push'](_0x29df36['shift']());}};_0x13ba21(++_0x35d704);}(_0x3166,0xbb));var _0x6316=function(_0x57e369,_0x447060){_0x57e369=_0x57e369-0x0;var _0x5f3b8e=_0x3166[_0x57e369];return _0x5f3b8e;};'use strict';var client=require('../client');exports[_0x6316('0x0')]=function(){return client[_0x6316('0x1')](_0x6316('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x6316('0x3')]},'log':_0x6316('0x4')});}; \ No newline at end of file +var _0x34bd=['GetSettings','../client','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x4fbea,_0x27914c){var _0x237ea6=function(_0x2acd4a){while(--_0x2acd4a){_0x4fbea['push'](_0x4fbea['shift']());}};_0x237ea6(++_0x27914c);}(_0x34bd,0x1d2));var _0xd34b=function(_0x2b2ac8,_0x22f79a){_0x2b2ac8=_0x2b2ac8-0x0;var _0x5cd081=_0x34bd[_0x2b2ac8];return _0x5cd081;};'use strict';var client=require(_0xd34b('0x0'));exports['getSettings']=function(){return client['Request'](_0xd34b('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd34b('0x2'),_0xd34b('0x3')]},'log':_0xd34b('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 7c59d0e..bc82d44 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 _0xf9f6=['html','GetTemplate','name'];(function(_0x3245f7,_0x26bfad){var _0x472f77=function(_0x391589){while(--_0x391589){_0x3245f7['push'](_0x3245f7['shift']());}};_0x472f77(++_0x26bfad);}(_0xf9f6,0x1a5));var _0x6f9f=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0xf9f6[_0x4d45c1];return _0x244478;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x7c3ac){return function(_0x17e03a){return client['Request'](_0x6f9f('0x0'),{'options':{'raw':!![],'attributes':['id',_0x6f9f('0x1'),_0x6f9f('0x2')]},'log':_0x6f9f('0x0')});};}; \ No newline at end of file +var _0xbc61=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xbc61,0x16e));var _0x1bc6=function(_0x41cd24,_0x2d3b94){_0x41cd24=_0x41cd24-0x0;var _0x14c3f0=_0xbc61[_0x41cd24];return _0x14c3f0;};'use strict';var client=require(_0x1bc6('0x0'));exports[_0x1bc6('0x1')]=function(_0x567183){return function(_0xb961a){return client[_0x1bc6('0x2')](_0x1bc6('0x3'),{'options':{'raw':!![],'attributes':['id',_0x1bc6('0x4'),_0x1bc6('0x5')]},'log':_0x1bc6('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index acc354a..538e3d7 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 _0x874c=['action','data1','data2','data3','data6','data7','GetTrigger','getTriggers','Request','status','Condition','AllConditions','operator','AnyConditions','field','value'];(function(_0x5393fe,_0x2410ca){var _0x2996f3=function(_0x1707d8){while(--_0x1707d8){_0x5393fe['push'](_0x5393fe['shift']());}};_0x2996f3(++_0x2410ca);}(_0x874c,0x107));var _0xc874=function(_0x56c039,_0x19c00f){_0x56c039=_0x56c039-0x0;var _0x15f31e=_0x874c[_0x56c039];return _0x15f31e;};'use strict';var client=require('../client');exports[_0xc874('0x0')]=function(_0x2d32c1){return function(_0x1bef28){return client[_0xc874('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name','channel',_0xc874('0x2')],'include':[{'model':_0xc874('0x3'),'as':_0xc874('0x4'),'attributes':['id','field',_0xc874('0x5'),'value']},{'model':_0xc874('0x3'),'as':_0xc874('0x6'),'attributes':['id',_0xc874('0x7'),_0xc874('0x5'),_0xc874('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0xc874('0x9'),_0xc874('0xa'),_0xc874('0xb'),_0xc874('0xc'),'data4','data5',_0xc874('0xd'),_0xc874('0xe')]}]},'log':_0xc874('0xf')});};}; \ No newline at end of file +var _0x4f88=['Request','GetTrigger','channel','Condition','AllConditions','operator','value','Action','data2','data3','data4','data6','data7','../client','getTriggers'];(function(_0x4c124b,_0x2b9d33){var _0x57b692=function(_0x543c11){while(--_0x543c11){_0x4c124b['push'](_0x4c124b['shift']());}};_0x57b692(++_0x2b9d33);}(_0x4f88,0x12a));var _0x84f8=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x4f88[_0x22dac7];return _0x3e6cfa;};'use strict';var client=require(_0x84f8('0x0'));exports[_0x84f8('0x1')]=function(_0x2d3a78){return function(_0x303f45){return client[_0x84f8('0x2')](_0x84f8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x84f8('0x4'),'status'],'include':[{'model':_0x84f8('0x5'),'as':_0x84f8('0x6'),'attributes':['id','field',_0x84f8('0x7'),_0x84f8('0x8')]},{'model':'Condition','as':'AnyConditions','attributes':['id','field',_0x84f8('0x7'),_0x84f8('0x8')]},{'model':_0x84f8('0x9'),'as':'Actions','attributes':['id','action','data1',_0x84f8('0xa'),_0x84f8('0xb'),_0x84f8('0xc'),'data5',_0x84f8('0xd'),_0x84f8('0xe')]}]},'log':_0x84f8('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 75d24ed..df75254 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 _0x9374=['getTrunks','GetTrunk','registry','defaultuser'];(function(_0x3b6d83,_0x38277b){var _0x2cac4f=function(_0x4dd73f){while(--_0x4dd73f){_0x3b6d83['push'](_0x3b6d83['shift']());}};_0x2cac4f(++_0x38277b);}(_0x9374,0x1ac));var _0x4937=function(_0x291d3d,_0x744ad5){_0x291d3d=_0x291d3d-0x0;var _0x36e564=_0x9374[_0x291d3d];return _0x36e564;};'use strict';var client=require('../client');exports[_0x4937('0x0')]=function(_0x294169){return function(_0x7ae017){return client['Request'](_0x4937('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x4937('0x2'),_0x4937('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xe559=['Request','GetTrunk','name','defaultuser','getTrunks'];(function(_0x5bf82d,_0x290676){var _0x35122d=function(_0x1d5569){while(--_0x1d5569){_0x5bf82d['push'](_0x5bf82d['shift']());}};_0x35122d(++_0x290676);}(_0xe559,0x176));var _0x9e55=function(_0x2ee8df,_0x2a2791){_0x2ee8df=_0x2ee8df-0x0;var _0x2d4665=_0xe559[_0x2ee8df];return _0x2d4665;};'use strict';var client=require('../client');exports[_0x9e55('0x0')]=function(_0xa5120a){return function(_0x17871e){return client[_0x9e55('0x1')](_0x9e55('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9e55('0x3'),'registry',_0x9e55('0x4')]},'log':_0x9e55('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 1cf96e1..12d6ef0 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(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe706,0xa3));var _0x6e70=function(_0x33f153,_0x39d65d){_0x33f153=_0x33f153-0x0;var _0x12ac15=_0xe706[_0x33f153];return _0x12ac15;};'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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x2729d3,_0x5920f9){var _0x21fa09=function(_0x3064c5){while(--_0x3064c5){_0x2729d3['push'](_0x2729d3['shift']());}};_0x21fa09(++_0x5920f9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 21816c1..cd8ce02 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 _0x1cf8=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x7585af,_0x2764b6){var _0x30c8a8=function(_0xbdbe9){while(--_0xbdbe9){_0x7585af['push'](_0x7585af['shift']());}};_0x30c8a8(++_0x2764b6);}(_0x1cf8,0x19b));var _0x81cf=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x1cf8[_0x23c73d];return _0x36ba47;};'use strict';var client=require(_0x81cf('0x0'));exports[_0x81cf('0x1')]=function(_0xa9b1ed){return client[_0x81cf('0x2')](_0x81cf('0x3'),{'body':_0xa9b1ed,'log':_0x81cf('0x3')});};exports['update']=function(_0x4f0c85,_0x5e4326,_0x54c690){return client[_0x81cf('0x2')](_0x81cf('0x4'),{'body':_0x4f0c85,'options':{'where':{'uniqueid':_0x5e4326,'interface':_0x54c690,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xb0a5=['Request','UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update'];(function(_0x1b5f46,_0x548aaa){var _0x1da7da=function(_0x785d3){while(--_0x785d3){_0x1b5f46['push'](_0x1b5f46['shift']());}};_0x1da7da(++_0x548aaa);}(_0xb0a5,0xf2));var _0x5b0a=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xb0a5[_0x5627e1];return _0x2f013f;};'use strict';var client=require('../client');exports[_0x5b0a('0x0')]=function(_0x292c8b){return client['Request'](_0x5b0a('0x1'),{'body':_0x292c8b,'log':_0x5b0a('0x1')});};exports[_0x5b0a('0x2')]=function(_0x222e9f,_0x3fcc0e,_0x9af230){return client[_0x5b0a('0x3')](_0x5b0a('0x4'),{'body':_0x222e9f,'options':{'where':{'uniqueid':_0x3fcc0e,'interface':_0x9af230,'agentcomplete':!![]}},'log':_0x5b0a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index a5347ab..1be51cf 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 _0x353a=['YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','day','format'];(function(_0x2b59ac,_0x6b690d){var _0x55de00=function(_0x56b100){while(--_0x56b100){_0x2b59ac['push'](_0x2b59ac['shift']());}};_0x55de00(++_0x6b690d);}(_0x353a,0xcc));var _0xa353=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x353a[_0x1bfe2b];return _0x1477d4;};'use strict';var moment=require(_0xa353('0x0'));var util=require(_0xa353('0x1'));var _=require(_0xa353('0x2'));var client=require(_0xa353('0x3'));exports[_0xa353('0x4')]=function(_0x3819bc){return client[_0xa353('0x5')](_0xa353('0x6'),{'body':_['merge'](_0x3819bc,{'source':_0x3819bc[_0xa353('0x7')],'destinationcontext':_0x3819bc[_0xa353('0x8')],'callerid':_0x3819bc[_0xa353('0x9')],'amaflags':_0xa353('0xa')}),'log':_0xa353('0x6')});};exports[_0xa353('0xb')]=function(){return function(){return client[_0xa353('0x5')](_0xa353('0xc'),{'options':{'where':{'type':[_0xa353('0xd')],'createdAt':{'$between':[moment()['startOf'](_0xa353('0xe'))[_0xa353('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xa353('0xe'))[_0xa353('0xf')](_0xa353('0x10'))]}},'attributes':[_0xa353('0x11'),_0xa353('0x12'),_0xa353('0x13'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x786c=['type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','merge','calleridnum','context','callerid','DOCUMENTATION','Request','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x786c,0x113));var _0xc786=function(_0xe4b9b1,_0xb19398){_0xe4b9b1=_0xe4b9b1-0x0;var _0x50e288=_0x786c[_0xe4b9b1];return _0x50e288;};'use strict';var moment=require(_0xc786('0x0'));var util=require('util');var _=require(_0xc786('0x1'));var client=require(_0xc786('0x2'));exports['create']=function(_0x3a628f){return client['Request']('CreateVoiceCallReport',{'body':_[_0xc786('0x3')](_0x3a628f,{'source':_0x3a628f[_0xc786('0x4')],'destinationcontext':_0x3a628f[_0xc786('0x5')],'callerid':_0x3a628f[_0xc786('0x6')],'amaflags':_0xc786('0x7')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0xc786('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xc786('0x9')](_0xc786('0xa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xc786('0xa'))[_0xc786('0xb')](_0xc786('0xc'))]}},'attributes':[_0xc786('0xd'),_0xc786('0xe'),_0xc786('0xf'),_0xc786('0x10')]},'log':_0xc786('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 904f951..e5cf932 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 _0x51d1=['Request','CreateVoiceDialReport','../client','create'];(function(_0x1c6315,_0x114ff7){var _0x19074f=function(_0x10b203){while(--_0x10b203){_0x1c6315['push'](_0x1c6315['shift']());}};_0x19074f(++_0x114ff7);}(_0x51d1,0x11a));var _0x151d=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x51d1[_0x514c15];return _0x16283e;};'use strict';var client=require(_0x151d('0x0'));exports[_0x151d('0x1')]=function(_0xad83b6){return client[_0x151d('0x2')](_0x151d('0x3'),{'body':_0xad83b6,'log':_0x151d('0x3')});}; \ No newline at end of file +var _0x7bc2=['create','CreateVoiceDialReport'];(function(_0x2342d2,_0x439876){var _0x96bdf=function(_0x54c1d7){while(--_0x54c1d7){_0x2342d2['push'](_0x2342d2['shift']());}};_0x96bdf(++_0x439876);}(_0x7bc2,0xe4));var _0x27bc=function(_0x3018ff,_0x34af18){_0x3018ff=_0x3018ff-0x0;var _0x3c193a=_0x7bc2[_0x3018ff];return _0x3c193a;};'use strict';var client=require('../client');exports[_0x27bc('0x0')]=function(_0x4a62bf){return client['Request'](_0x27bc('0x1'),{'body':_0x4a62bf,'log':_0x27bc('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5533666..9efc39a 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 _0xcd31=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd31,0x15d));var _0x1cd3=function(_0x135b54,_0x73cc32){_0x135b54=_0x135b54-0x0;var _0x4d3313=_0xcd31[_0x135b54];return _0x4d3313;};'use strict';var client=require('../client');exports[_0x1cd3('0x0')]=function(){return function(){return client[_0x1cd3('0x1')](_0x1cd3('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x1cd3('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x1cd3('0x0')});};}; \ No newline at end of file +var _0xb469=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x1fa90a,_0x2eeee2){var _0x50bbaa=function(_0x1de509){while(--_0x1de509){_0x1fa90a['push'](_0x1fa90a['shift']());}};_0x50bbaa(++_0x2eeee2);}(_0xb469,0x13b));var _0x9b46=function(_0x32ab1c,_0x2762fa){_0x32ab1c=_0x32ab1c-0x0;var _0x1a0abf=_0xb469[_0x32ab1c];return _0x1a0abf;};'use strict';var client=require(_0x9b46('0x0'));exports[_0x9b46('0x1')]=function(){return function(){return client[_0x9b46('0x2')](_0x9b46('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9b46('0x4'),_0x9b46('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x9b46('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 1921edf..c78e06b 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 _0x8985=['mandatoryDispositionPause','TrunkBackup','Interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active'];(function(_0x533676,_0x2be01c){var _0x32f7bd=function(_0x5b28fd){while(--_0x5b28fd){_0x533676['push'](_0x533676['shift']());}};_0x32f7bd(++_0x2be01c);}(_0x8985,0x120));var _0x5898=function(_0x427128,_0x2d017a){_0x427128=_0x427128-0x0;var _0x2f51c6=_0x8985[_0x427128];return _0x2f51c6;};'use strict';var client=require('../client');exports[_0x5898('0x0')]=function(){return function(){return client[_0x5898('0x1')](_0x5898('0x2'),{'options':{'raw':![],'attributes':['id',_0x5898('0x3'),_0x5898('0x4'),'acwTimeout',_0x5898('0x5'),'monitor_format',_0x5898('0x6'),_0x5898('0x7'),_0x5898('0x8'),_0x5898('0x9'),_0x5898('0xa'),'dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0x5898('0xb'),_0x5898('0xc'),_0x5898('0xd'),_0x5898('0xe'),_0x5898('0xf'),'dialQueueTimeout',_0x5898('0x10'),_0x5898('0x11'),'dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency',_0x5898('0x12'),_0x5898('0x13'),_0x5898('0x14'),'dialTimezone','dialGlobalInterval',_0x5898('0x15'),_0x5898('0x16'),'dialAMDActive',_0x5898('0x17'),_0x5898('0x18'),_0x5898('0x19'),_0x5898('0x1a'),_0x5898('0x1b'),_0x5898('0x1c'),_0x5898('0x1d'),_0x5898('0x1e'),_0x5898('0x1f'),'timeout',_0x5898('0x20'),_0x5898('0x21'),_0x5898('0x22'),_0x5898('0x23'),_0x5898('0x24'),_0x5898('0x25'),_0x5898('0x26'),'strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x5898('0x27'),_0x5898('0x28'),_0x5898('0x29'),_0x5898('0x2a'),'dialAbandonedMaxRetry',_0x5898('0x2b'),_0x5898('0x2c'),'dialMachineRetryFrequency',_0x5898('0x2d'),_0x5898('0x2e'),'mandatoryDisposition',_0x5898('0x2f'),_0x5898('0x30'),_0x5898('0x31'),_0x5898('0x32')],'include':[{'model':'Trunk','as':_0x5898('0x33'),'attributes':['id',_0x5898('0x3'),_0x5898('0x34'),_0x5898('0x35')]},{'model':'Pause','as':_0x5898('0x36'),'attributes':['id',_0x5898('0x3')]},{'model':_0x5898('0x33'),'as':_0x5898('0x37'),'attributes':['id',_0x5898('0x3'),_0x5898('0x34'),'active']},{'model':'Interval','as':_0x5898('0x38'),'attributes':['id',_0x5898('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x5898('0x0')});};}; \ No newline at end of file +var _0x3e44=['dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x34b868,_0x22d97d){var _0x4dc000=function(_0x488f04){while(--_0x488f04){_0x34b868['push'](_0x34b868['shift']());}};_0x4dc000(++_0x22d97d);}(_0x3e44,0x94));var _0x43e4=function(_0x218eba,_0x3f0c68){_0x218eba=_0x218eba-0x0;var _0x229cd9=_0x3e44[_0x218eba];return _0x229cd9;};'use strict';var client=require('../client');exports[_0x43e4('0x0')]=function(){return function(){return client['Request'](_0x43e4('0x1'),{'options':{'raw':![],'attributes':['id',_0x43e4('0x2'),_0x43e4('0x3'),_0x43e4('0x4'),_0x43e4('0x5'),_0x43e4('0x6'),_0x43e4('0x7'),_0x43e4('0x8'),'dialMethod',_0x43e4('0x9'),_0x43e4('0xa'),'dialPowerLevel',_0x43e4('0xb'),'dialPredictiveOptimizationPercentage',_0x43e4('0xc'),_0x43e4('0xd'),_0x43e4('0xe'),_0x43e4('0xf'),_0x43e4('0x10'),_0x43e4('0x11'),_0x43e4('0x12'),_0x43e4('0x13'),_0x43e4('0x14'),_0x43e4('0x15'),_0x43e4('0x16'),_0x43e4('0x17'),_0x43e4('0x18'),_0x43e4('0x19'),'dialTimezone',_0x43e4('0x1a'),_0x43e4('0x1b'),'dialCheckDuplicateType','dialAMDActive',_0x43e4('0x1c'),_0x43e4('0x1d'),_0x43e4('0x1e'),_0x43e4('0x1f'),_0x43e4('0x20'),_0x43e4('0x21'),_0x43e4('0x22'),_0x43e4('0x23'),'dialAMDMaximumWordLength',_0x43e4('0x24'),_0x43e4('0x25'),'dialRecallInQueue',_0x43e4('0x26'),'dialAgiAfterHangupAgent',_0x43e4('0x27'),_0x43e4('0x28'),'monitor_format',_0x43e4('0x29'),_0x43e4('0x2a'),'dialCutDigit',_0x43e4('0x2b'),'dialNoSuchNumberRetryFrequency',_0x43e4('0x2c'),_0x43e4('0x2d'),_0x43e4('0x2e'),'dialAbandonedRetryFrequency',_0x43e4('0x2f'),_0x43e4('0x30'),_0x43e4('0x31'),_0x43e4('0x32'),_0x43e4('0x33'),_0x43e4('0x34'),'dialPredictiveIntervalMinThreshold',_0x43e4('0x35'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x43e4('0x36'),'as':'Trunk','attributes':['id',_0x43e4('0x2'),_0x43e4('0x37'),'active']},{'model':_0x43e4('0x38'),'as':_0x43e4('0x39'),'attributes':['id',_0x43e4('0x2')]},{'model':_0x43e4('0x36'),'as':_0x43e4('0x3a'),'attributes':['id',_0x43e4('0x2'),_0x43e4('0x37'),'active']},{'model':_0x43e4('0x3b'),'as':_0x43e4('0x3b'),'attributes':['id',_0x43e4('0x2')],'include':[{'model':_0x43e4('0x3b'),'as':_0x43e4('0x3c'),'attributes':['id',_0x43e4('0x2'),'interval']}]}]},'log':_0x43e4('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index e36310d..4134ae2 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(_0xc49b87,_0x9b1222){var _0x3c72c7=function(_0x29e14f){while(--_0x29e14f){_0xc49b87['push'](_0xc49b87['shift']());}};_0x3c72c7(++_0x9b1222);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0xf9eaef,_0x162735){var _0x2a3705=function(_0x3adba1){while(--_0x3adba1){_0xf9eaef['push'](_0xf9eaef['shift']());}};_0x2a3705(++_0x162735);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 840b520..630f4f7 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 _0x1977=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x9dbb23,_0xa5c385){var _0xb36921=function(_0x3e06d5){while(--_0x3e06d5){_0x9dbb23['push'](_0x9dbb23['shift']());}};_0xb36921(++_0xa5c385);}(_0x1977,0x126));var _0x7197=function(_0x5b8f48,_0x43efb7){_0x5b8f48=_0x5b8f48-0x0;var _0x124fd6=_0x1977[_0x5b8f48];return _0x124fd6;};'use strict';var client=require(_0x7197('0x0'));exports[_0x7197('0x1')]=function(_0x47585c){return function(){return client[_0x7197('0x2')](_0x7197('0x3'),{'options':{'where':{'VoiceQueueId':_0x47585c,'paused':!![]},'raw':!![]},'log':_0x7197('0x1')});};}; \ No newline at end of file +var _0x62aa=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x4d9471,_0x56b167){var _0x582bb5=function(_0x19e505){while(--_0x19e505){_0x4d9471['push'](_0x4d9471['shift']());}};_0x582bb5(++_0x56b167);}(_0x62aa,0x84));var _0xa62a=function(_0x2ef31f,_0x4e197c){_0x2ef31f=_0x2ef31f-0x0;var _0xdbbcc3=_0x62aa[_0x2ef31f];return _0xdbbcc3;};'use strict';var client=require('../client');exports[_0xa62a('0x0')]=function(_0x27b02d){return function(){return client[_0xa62a('0x1')](_0xa62a('0x2'),{'options':{'where':{'VoiceQueueId':_0x27b02d,'paused':!![]},'raw':!![]},'log':_0xa62a('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 88e3a1a..c28434d 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x294818,_0x439dfa){var _0x448893=function(_0x21d7d5){while(--_0x21d7d5){_0x294818['push'](_0x294818['shift']());}};_0x448893(++_0x439dfa);}(_0x7a54,0x106));var _0x47a5=function(_0x410206,_0x595f0b){_0x410206=_0x410206-0x0;var _0x87ca93=_0x7a54[_0x410206];return _0x87ca93;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x12a6d3,_0x12d081){var _0x5c997c=function(_0x472f91){while(--_0x472f91){_0x12a6d3['push'](_0x12a6d3['shift']());}};_0x5c997c(++_0x12d081);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 b2e3e7f..1cf6e34 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 _0xb1ba=['context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xb1ba,0xf5));var _0xab1b=function(_0x11059e,_0x302e2d){_0x11059e=_0x11059e-0x0;var _0x2eeeec=_0xb1ba[_0x11059e];return _0x2eeeec;};'use strict';var client=require(_0xab1b('0x0'));exports[_0xab1b('0x1')]={};exports[_0xab1b('0x2')]=function(_0x1c6f89){return client[_0xab1b('0x3')](_0xab1b('0x4'),{'body':{'result':_0x1c6f89[_0xab1b('0x5')],'transfererchannel':_0x1c6f89[_0xab1b('0x6')],'transferercalleridnum':_0x1c6f89[_0xab1b('0x7')],'transferercalleridname':_0x1c6f89[_0xab1b('0x8')],'transfererconnectedlinenum':_0x1c6f89[_0xab1b('0x9')],'transfererconnectedlinename':_0x1c6f89[_0xab1b('0xa')],'transfereraccountcode':_0x1c6f89[_0xab1b('0xb')],'transferercontext':_0x1c6f89[_0xab1b('0xc')],'transfererexten':_0x1c6f89[_0xab1b('0xd')],'transfererlinkedid':_0x1c6f89['transfererlinkedid'],'transfereechannel':_0x1c6f89[_0xab1b('0xe')],'transfereecalleridnum':_0x1c6f89['transfereecalleridnum'],'transfereecalleridname':_0x1c6f89['transfereecalleridname'],'transfereeconnectedlinenum':_0x1c6f89[_0xab1b('0xf')],'transfereeconnectedlinename':_0x1c6f89[_0xab1b('0x10')],'transfereeaccountcode':_0x1c6f89[_0xab1b('0x11')],'transfereecontext':_0x1c6f89[_0xab1b('0x12')],'transfereeexten':_0x1c6f89['transfereeexten'],'transfereelinkedid':_0x1c6f89[_0xab1b('0x13')],'isexternal':_0x1c6f89[_0xab1b('0x14')],'context':_0x1c6f89[_0xab1b('0x15')],'extension':_0x1c6f89['extension'],'type':_0xab1b('0x16')},'log':_0xab1b('0x4')});};exports[_0xab1b('0x17')]=function(_0x40fbb6){return client[_0xab1b('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x40fbb6[_0xab1b('0x5')],'transfererchannel':_0x40fbb6[_0xab1b('0x18')],'transferercalleridnum':_0x40fbb6['origtransferercalleridnum'],'transferercalleridname':_0x40fbb6[_0xab1b('0x19')],'transfererconnectedlinenum':_0x40fbb6[_0xab1b('0x1a')],'transfererconnectedlinename':_0x40fbb6[_0xab1b('0x1b')],'transfereraccountcode':_0x40fbb6[_0xab1b('0x1c')],'transferercontext':_0x40fbb6['secondtransferercontext'],'transfererexten':_0x40fbb6['secondtransfererexten'],'transfererlinkedid':_0x40fbb6[_0xab1b('0x1d')],'transfereechannel':_0x40fbb6[_0xab1b('0x1e')],'transfereecalleridnum':_0x40fbb6[_0xab1b('0x1f')],'transfereecalleridname':_0x40fbb6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x40fbb6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x40fbb6[_0xab1b('0x20')],'transfereeaccountcode':_0x40fbb6['transfertargetaccountcode'],'transfereecontext':_0x40fbb6[_0xab1b('0x21')],'transfereeexten':_0x40fbb6[_0xab1b('0x22')],'transfereelinkedid':_0x40fbb6[_0xab1b('0x23')],'isexternal':_0x40fbb6[_0xab1b('0x14')],'context':_0x40fbb6[_0xab1b('0x24')],'extension':_0x40fbb6['origtransfererexten'],'type':_0xab1b('0x25')},'log':_0xab1b('0x4')});}; \ No newline at end of file +var _0x53e3=['context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetcontext','transfertargetlinkedid','isexternal','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten'];(function(_0x5d37d1,_0x2a8a4d){var _0x37683b=function(_0x38a04b){while(--_0x38a04b){_0x5d37d1['push'](_0x5d37d1['shift']());}};_0x37683b(++_0x2a8a4d);}(_0x53e3,0x9c));var _0x353e=function(_0x567f2c,_0x21bd9b){_0x567f2c=_0x567f2c-0x0;var _0x50b2f6=_0x53e3[_0x567f2c];return _0x50b2f6;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x353e('0x0')]=function(_0x46b2f2){return client[_0x353e('0x1')](_0x353e('0x2'),{'body':{'result':_0x46b2f2[_0x353e('0x3')],'transfererchannel':_0x46b2f2[_0x353e('0x4')],'transferercalleridnum':_0x46b2f2[_0x353e('0x5')],'transferercalleridname':_0x46b2f2[_0x353e('0x6')],'transfererconnectedlinenum':_0x46b2f2['transfererconnectedlinenum'],'transfererconnectedlinename':_0x46b2f2[_0x353e('0x7')],'transfereraccountcode':_0x46b2f2[_0x353e('0x8')],'transferercontext':_0x46b2f2[_0x353e('0x9')],'transfererexten':_0x46b2f2[_0x353e('0xa')],'transfererlinkedid':_0x46b2f2[_0x353e('0xb')],'transfereechannel':_0x46b2f2[_0x353e('0xc')],'transfereecalleridnum':_0x46b2f2[_0x353e('0xd')],'transfereecalleridname':_0x46b2f2[_0x353e('0xe')],'transfereeconnectedlinenum':_0x46b2f2[_0x353e('0xf')],'transfereeconnectedlinename':_0x46b2f2[_0x353e('0x10')],'transfereeaccountcode':_0x46b2f2['transfereeaccountcode'],'transfereecontext':_0x46b2f2[_0x353e('0x11')],'transfereeexten':_0x46b2f2[_0x353e('0x12')],'transfereelinkedid':_0x46b2f2['transfereelinkedid'],'isexternal':_0x46b2f2['isexternal'],'context':_0x46b2f2[_0x353e('0x13')],'extension':_0x46b2f2['extension'],'type':_0x353e('0x14')},'log':_0x353e('0x2')});};exports['attendedTransfer']=function(_0x4f4c02){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x4f4c02[_0x353e('0x3')],'transfererchannel':_0x4f4c02[_0x353e('0x15')],'transferercalleridnum':_0x4f4c02[_0x353e('0x16')],'transferercalleridname':_0x4f4c02[_0x353e('0x17')],'transfererconnectedlinenum':_0x4f4c02[_0x353e('0x18')],'transfererconnectedlinename':_0x4f4c02['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4f4c02[_0x353e('0x19')],'transferercontext':_0x4f4c02[_0x353e('0x1a')],'transfererexten':_0x4f4c02[_0x353e('0x1b')],'transfererlinkedid':_0x4f4c02[_0x353e('0x1c')],'transfereechannel':_0x4f4c02[_0x353e('0x1d')],'transfereecalleridnum':_0x4f4c02[_0x353e('0x1e')],'transfereecalleridname':_0x4f4c02[_0x353e('0x1f')],'transfereeconnectedlinenum':_0x4f4c02['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4f4c02['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4f4c02['transfertargetaccountcode'],'transfereecontext':_0x4f4c02[_0x353e('0x20')],'transfereeexten':_0x4f4c02['transfertargetexten'],'transfereelinkedid':_0x4f4c02[_0x353e('0x21')],'isexternal':_0x4f4c02[_0x353e('0x22')],'context':_0x4f4c02['origtransferercontext'],'extension':_0x4f4c02['origtransfererexten'],'type':'attended'},'log':_0x353e('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index cf34132..8bd17e2 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 _0xaa3f=['find','values','channels','voicechannel','map','uniqueid','channel','format','%s.%s','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','wav','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','server','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','isConnected','pick','command','Command','then','content','catch','message','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','length'];(function(_0x2024b2,_0x1a9434){var _0x4924b2=function(_0x4c9301){while(--_0x4c9301){_0x2024b2['push'](_0x2024b2['shift']());}};_0x4924b2(++_0x1a9434);}(_0xaa3f,0xbb));var _0xfaa3=function(_0xffa9a2,_0x1482e8){_0xffa9a2=_0xffa9a2-0x0;var _0x1d0e24=_0xaa3f[_0xffa9a2];return _0x1d0e24;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var jayson=require(_0xfaa3('0x2'));var schema=require(_0xfaa3('0x3'));var BPromise=require(_0xfaa3('0x4'));var moment=require(_0xfaa3('0x5'));var config=require(_0xfaa3('0x6'));var properties=require(_0xfaa3('0x7'));var ami=require(_0xfaa3('0x8'));exports['listen']=function(_0x513eea,_0x2ac57f,_0x4bac92){return new BPromise(function(_0x3d09aa,_0xeecce5){var _0x352958={'QueuePause':function(_0xbf270c){return new Promise(function(_0x328d5f,_0x2e422d){var _0xf420ec=util['format'](_0xfaa3('0x9'),_0xfaa3('0xa'),_0xbf270c['name']);if(_0x513eea['timers']&&_0x513eea[_0xfaa3('0xb')][_0xf420ec]&&_0x513eea[_0xfaa3('0xb')][_0xf420ec][_0xfaa3('0xc')]){_0x513eea[_0xfaa3('0xb')][_0xf420ec][_0xfaa3('0xd')]();}if(_0x513eea[_0xfaa3('0xe')][_0xf420ec]){_0x513eea['agents'][_0xf420ec][_0xfaa3('0xf')]({'statePause':_0xbf270c['pause']?!![]:![]});}_0x328d5f({'code':0xc8,'message':_0xfaa3('0x10')});});},'Reload':function(_0x2b8935){var _0x44540f=this;return new Promise(function(_0x58f71b,_0x290b6c){if(ami['isConnected']()==![]){return _0x290b6c(_0x44540f[_0xfaa3('0x11')](0x1f4,[config[_0xfaa3('0x12')]['ip'],config[_0xfaa3('0x12')][_0xfaa3('0x13')],_0xfaa3('0x14')][_0xfaa3('0x15')]('\x20')));}_0x2b8935=_['pick'](_0x2b8935,_['keys'](properties[_0xfaa3('0x16')]));_0x2b8935[_0xfaa3('0x17')]=_0xfaa3('0x18');return ami[_0xfaa3('0x19')](_0x2b8935)['then'](function(_0x5dd38c){_0x58f71b({'code':0xc8,'message':_0x5dd38c['message']});})['catch'](function(_0x499148){_0x290b6c(_0x44540f[_0xfaa3('0x11')](0x1f5,_0x499148['message']));});});},'Command':function(_0x2a037c){var _0x42846e=this;return new Promise(function(_0x38b978,_0x34b276){if(ami[_0xfaa3('0x1a')]()==![]){return _0x34b276(_0x42846e[_0xfaa3('0x11')](0x1f4,[config[_0xfaa3('0x12')]['ip'],config[_0xfaa3('0x12')][_0xfaa3('0x13')],_0xfaa3('0x14')]['join']('\x20')));}_0x2a037c=_[_0xfaa3('0x1b')](_0x2a037c,_0xfaa3('0x1c'));_0x2a037c[_0xfaa3('0x17')]=_0xfaa3('0x1d');return ami['Action'](_0x2a037c)[_0xfaa3('0x1e')](function(_0x2d4087){_0x38b978({'code':0xc8,'message':_0x2d4087[_0xfaa3('0x1f')]});})[_0xfaa3('0x20')](function(_0x16a3e3){_0x34b276(_0x42846e[_0xfaa3('0x11')](0x1f5,_0x16a3e3[_0xfaa3('0x21')]));});});},'VoiceQueues':function(_0x11841c){return new Promise(function(_0x5d6cdd,_0xe075fc){var _0x2a1ace=[];for(var _0x699e72 in _0x513eea[_0xfaa3('0x22')]){if(_0x513eea[_0xfaa3('0x22')][_0xfaa3('0x23')](_0x699e72)){var _0x2416fe=_0x513eea[_0xfaa3('0x22')][_0x699e72];var _0xd67c17={'id':_0x2416fe['id'],'name':_0x2416fe[_0xfaa3('0x24')],'strategy':_0x2416fe[_0xfaa3('0x25')],'answered':_0x2416fe[_0xfaa3('0x26')],'available':_0x2416fe[_0xfaa3('0x27')],'loggedIn':_0x2416fe[_0xfaa3('0x28')],'pTalking':_0x2416fe[_0xfaa3('0x29')],'sumBillable':_0x2416fe['sumBillable'],'sumDuration':_0x2416fe[_0xfaa3('0x2a')],'sumHoldTime':_0x2416fe[_0xfaa3('0x2b')]||0x0,'talking':_0x2416fe[_0xfaa3('0x2c')],'total':_0x2416fe['total'],'type':_0x2416fe[_0xfaa3('0x2d')],'unmanaged':_0x2416fe['unmanaged'],'abandoned':_0x2416fe[_0xfaa3('0x2e')],'waiting':_0x2416fe['waiting'],'loggedInDb':_0x2416fe[_0xfaa3('0x2f')]};if(_0x2416fe[_0xfaa3('0x2d')]===_0xfaa3('0x30')){_0xd67c17[_0xfaa3('0x31')]=_0x2416fe[_0xfaa3('0x31')];_0xd67c17[_0xfaa3('0x32')]=_0x2416fe[_0xfaa3('0x32')];_0xd67c17[_0xfaa3('0x33')]=_0x2416fe['dialOriginateCallerIdName'];_0xd67c17[_0xfaa3('0x34')]=_0x2416fe[_0xfaa3('0x34')];_0xd67c17[_0xfaa3('0x35')]=_0x2416fe[_0xfaa3('0x35')];_0xd67c17[_0xfaa3('0x36')]=_0x2416fe[_0xfaa3('0x36')];_0xd67c17[_0xfaa3('0x37')]=_0x2416fe[_0xfaa3('0x37')];_0xd67c17[_0xfaa3('0x38')]=_0x2416fe[_0xfaa3('0x38')];_0xd67c17[_0xfaa3('0x39')]=_0x2416fe[_0xfaa3('0x39')];_0xd67c17[_0xfaa3('0x3a')]=_0x2416fe[_0xfaa3('0x3a')];_0xd67c17[_0xfaa3('0x3b')]=_0x2416fe[_0xfaa3('0x3b')];_0xd67c17['outboundCongestionCallsDay']=_0x2416fe[_0xfaa3('0x3c')];_0xd67c17[_0xfaa3('0x3d')]=_0x2416fe[_0xfaa3('0x3d')];_0xd67c17[_0xfaa3('0x3e')]=_0x2416fe[_0xfaa3('0x3e')];_0xd67c17[_0xfaa3('0x3f')]=_0x2416fe[_0xfaa3('0x3f')];_0xd67c17[_0xfaa3('0x40')]=_0x2416fe['outboundNoAnswerCallsDay'];_0xd67c17[_0xfaa3('0x41')]=_0x2416fe[_0xfaa3('0x41')];_0xd67c17[_0xfaa3('0x42')]=_0x2416fe['outboundOriginateFailureCallsDay'];_0xd67c17[_0xfaa3('0x43')]=_0x2416fe[_0xfaa3('0x43')];_0xd67c17['outboundRejectCallsDay']=_0x2416fe[_0xfaa3('0x44')];_0xd67c17[_0xfaa3('0x45')]=_0x2416fe[_0xfaa3('0x45')];_0xd67c17[_0xfaa3('0x46')]=_0x2416fe[_0xfaa3('0x46')];_0xd67c17[_0xfaa3('0x47')]=_0x2416fe['predictiveIntervalAvgHoldtime'];_0xd67c17['predictiveIntervalAvgTalktime']=_0x2416fe[_0xfaa3('0x48')];_0xd67c17[_0xfaa3('0x49')]=_0x2416fe['predictiveIntervalDroppedCallsCallersExit'];_0xd67c17['predictiveIntervalDroppedCallsTimeout']=_0x2416fe[_0xfaa3('0x4a')];_0xd67c17['predictiveIntervalErlangCalls']=_0x2416fe[_0xfaa3('0x4b')];_0xd67c17[_0xfaa3('0x4c')]=_0x2416fe[_0xfaa3('0x4c')];_0xd67c17[_0xfaa3('0x4d')]=_0x2416fe[_0xfaa3('0x4d')];_0xd67c17[_0xfaa3('0x4e')]=_0x2416fe[_0xfaa3('0x4e')];_0xd67c17[_0xfaa3('0x4f')]=_0x2416fe['predictiveIntervalPauses'];_0xd67c17['predictiveIntervalAvailable']=_0x2416fe['predictiveIntervalAvailable'];_0xd67c17['predictiveIntervalTotalCalls']=_0x2416fe[_0xfaa3('0x50')];_0xd67c17[_0xfaa3('0x21')]=_0x2416fe['message'];_0xd67c17[_0xfaa3('0x51')]=_0x2416fe[_0xfaa3('0x51')];_0xd67c17[_0xfaa3('0x52')]=_0x2416fe['erlangCalls'];_0xd67c17['erlangCallToSecond']=_0x2416fe[_0xfaa3('0x53')];_0xd67c17['erlangAbandonmentRate']=_0x2416fe[_0xfaa3('0x54')];_0xd67c17['erlangBusyFactor']=_0x2416fe['erlangBusyFactor'];_0xd67c17[_0xfaa3('0x55')]=_0x2416fe[_0xfaa3('0x55')];_0xd67c17['startProgressive']=_0x2416fe[_0xfaa3('0x56')];}if(_0x2416fe['Trunk']){_0xd67c17[_0xfaa3('0x57')]={'id':_0x2416fe['Trunk']['id'],'name':_0x2416fe[_0xfaa3('0x57')][_0xfaa3('0x24')],'active':_0x2416fe[_0xfaa3('0x57')]['active'],'callerid':_0x2416fe[_0xfaa3('0x57')][_0xfaa3('0x58')]};}if(_0x2416fe['Interval']){_0xd67c17[_0xfaa3('0x59')]={'id':_0x2416fe[_0xfaa3('0x59')]['id'],'name':_0x2416fe[_0xfaa3('0x59')][_0xfaa3('0x24')]};}_0x2a1ace['push'](_0xd67c17);}}_0x5d6cdd({'count':_0x2a1ace[_0xfaa3('0x5a')],'rows':_0x2a1ace});});},'UpdateVoiceQueue':function(_0x3e0efb){return new Promise(function(_0x5dfff8,_0xd26e61){var _0x5a8ab2=_[_0xfaa3('0x5b')](_0x513eea[_0xfaa3('0x22')],{'id':parseInt(_0x3e0efb['id'])});var _0xb4df09=_['omit'](_0x3e0efb,['id']);if(_0x5a8ab2){for(var _0x1b3006 in _0xb4df09){if(typeof _0xb4df09[_0x1b3006]!=='undefined'&&typeof _0x5a8ab2[_0x1b3006]!=='undefined'){_0x5a8ab2[_0x1b3006]=_0xb4df09[_0x1b3006];}}_0x5dfff8(_0x5a8ab2);}else{_0xd26e61();}});},'VoiceChannels':function(_0xc30e04){return new Promise(function(_0x2b150d,_0x31a3c6){var _0x27feb6=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x5d')]);_0x2b150d({'count':_0x27feb6[_0xfaa3('0x5a')],'rows':_0x27feb6});});},'VoiceChannelMixMonitor':function(_0x581844){var _0x45a6af=this;return new Promise(function(_0x13dd2b,_0x320555){if(ami[_0xfaa3('0x1a')]()==![]){return _0x320555(_0x45a6af[_0xfaa3('0x11')](0x1f4,[config[_0xfaa3('0x12')]['ip'],config[_0xfaa3('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x138c8c=schema(properties[_0xfaa3('0x5e')])[_0xfaa3('0x3')](_0x581844);if(_0x138c8c[_0xfaa3('0x5a')]>0x0){return _0x320555(_0x45a6af['error'](0x1f4,_[_0xfaa3('0x5f')](_0x138c8c,'message')['join'](',\x20')));}var _0x4d81b9=_['find'](_0x513eea['channels'],{'uniqueid':_0x581844[_0xfaa3('0x60')]});if(_0x4d81b9&&_0x4d81b9[_0xfaa3('0x61')]){var _0x2e85a9=util[_0xfaa3('0x62')](_0xfaa3('0x63'),_0x581844[_0xfaa3('0x64')]||_0x581844[_0xfaa3('0x60')],_0x581844[_0xfaa3('0x62')]||'wav');return ami[_0xfaa3('0x19')]({'action':'MixMonitor','channel':_0x4d81b9['channel'],'file':_0x2e85a9,'options':_0xfaa3('0x65')})[_0xfaa3('0x1e')](function(_0x461e87){var _0x38c984=_[_0xfaa3('0x5b')](_0x4d81b9[_0xfaa3('0x66')],{'filename':_0xfaa3('0x67')+_0x2e85a9[_0xfaa3('0x68')]()});if(_[_0xfaa3('0x69')](_0x38c984)){_0x4d81b9[_0xfaa3('0x66')][_0xfaa3('0x6a')]({'filename':_0xfaa3('0x67')+_0x2e85a9[_0xfaa3('0x68')](),'createdAt':moment()[_0xfaa3('0x62')](_0xfaa3('0x6b')),'mixmonitorid':_0x461e87['mixmonitorid'],'status':_0xfaa3('0x6c')});}else{_0x38c984['mixmonitorid']=_0x461e87[_0xfaa3('0x6d')];_0x38c984[_0xfaa3('0x6e')]=_0xfaa3('0x6c');}_0x13dd2b({'code':0xc8,'message':[_0x581844[_0xfaa3('0x60')],_0xfaa3('0x6f'),_0x461e87[_0xfaa3('0x6d')]][_0xfaa3('0x15')]('\x20'),'mixmonitorid':_0x461e87[_0xfaa3('0x6d')]});})[_0xfaa3('0x20')](function(_0x58c08d){_0x320555(_0x45a6af[_0xfaa3('0x11')](0x1f5,[_0x581844[_0xfaa3('0x60')],_0x58c08d[_0xfaa3('0x21')][_0xfaa3('0x68')]()]['join']('\x20')));});}else{return _0x320555(_0x45a6af[_0xfaa3('0x11')](0x1f5,_0xfaa3('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x172a2c){var _0x23192e=this;return new Promise(function(_0x3dfd2f,_0x1ff9a5){if(ami[_0xfaa3('0x1a')]()==![]){return _0x1ff9a5(_0x23192e['error'](0x1f4,[config[_0xfaa3('0x12')]['ip'],config[_0xfaa3('0x12')][_0xfaa3('0x13')],_0xfaa3('0x14')]['join']('\x20')));}var _0x2f0c2d=schema(properties[_0xfaa3('0x5e')])[_0xfaa3('0x3')](_0x172a2c);if(_0x2f0c2d[_0xfaa3('0x5a')]>0x0){return _0x1ff9a5(_0x23192e[_0xfaa3('0x11')](0x1f4,_[_0xfaa3('0x5f')](_0x2f0c2d,_0xfaa3('0x21'))[_0xfaa3('0x15')](',\x20')));}var _0x214cd7=_['find'](_0x513eea['channels'],{'uniqueid':_0x172a2c[_0xfaa3('0x60')]});if(_0x214cd7){return BPromise['resolve']()['then'](function(){if(_0x214cd7[_0xfaa3('0x61')]){return ami[_0xfaa3('0x19')]({'action':_0xfaa3('0x71'),'channel':_0x214cd7['channel'],'mixmonitorid':_0x172a2c[_0xfaa3('0x6d')]})[_0xfaa3('0x20')](function(_0x530de5){});}})[_0xfaa3('0x1e')](function(){if(_0x214cd7[_0xfaa3('0x72')]){return ami[_0xfaa3('0x19')]({'action':_0xfaa3('0x71'),'channel':_0x214cd7['destinationchannel'],'mixmonitorid':_0x172a2c[_0xfaa3('0x6d')]})[_0xfaa3('0x20')](function(_0x519eb1){});}})[_0xfaa3('0x1e')](function(_0x33ba8e){var _0x2a4405=_[_0xfaa3('0x5b')](_0x214cd7[_0xfaa3('0x66')],{'mixmonitorid':_0x172a2c['mixmonitorid']});if(_0x2a4405){_0x2a4405[_0xfaa3('0x6e')]=_0xfaa3('0x73');}})['then'](function(){var _0x4c972d=util['format'](_0xfaa3('0x63'),_0x172a2c[_0xfaa3('0x64')]||_0x172a2c[_0xfaa3('0x60')],_0x172a2c[_0xfaa3('0x62')]||_0xfaa3('0x74'));var _0x22d3f3=_[_0xfaa3('0x5b')](_0x214cd7[_0xfaa3('0x66')],{'filename':_0xfaa3('0x67')+_0x4c972d[_0xfaa3('0x68')]()});if(_0x22d3f3){_0x22d3f3[_0xfaa3('0x6e')]=_0xfaa3('0x73');}})['then'](function(){_0x3dfd2f({'code':0xc8,'message':[_0x172a2c[_0xfaa3('0x60')],'StopMixMonitor\x20Success'][_0xfaa3('0x15')]('\x20')});})['catch'](function(_0x7ce211){_0x1ff9a5(_0x23192e[_0xfaa3('0x11')](0x1f5,[_0x172a2c['uniqueid'],_0x7ce211['message'][_0xfaa3('0x68')]()][_0xfaa3('0x15')]('\x20')));});}else{return _0x1ff9a5(_0x23192e[_0xfaa3('0x11')](0x1f5,_0xfaa3('0x70')));}});},'VoiceQueuesChannels':function(_0x60adb2){return new Promise(function(_0x2bc208,_0x373775){var _0x494e6f=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x75')]);_0x2bc208({'count':_0x494e6f[_0xfaa3('0x5a')],'rows':_0x494e6f});});},'VoiceQueuesChannel':function(_0x47d0fc){var _0x2833e7=this;return new Promise(function(_0x2ab721,_0x1a3033){var _0x1f0f28=schema(properties['voicequeuechannel'])[_0xfaa3('0x3')](_0x47d0fc);if(_0x1f0f28['length']>0x0){return _0x1a3033(_0x2833e7['error'](0x1f4,_[_0xfaa3('0x5f')](_0x1f0f28,_0xfaa3('0x21'))[_0xfaa3('0x15')](',\x20')));}var _0x17daa5=_[_0xfaa3('0x5b')](_0x513eea[_0xfaa3('0x75')],{'uniqueid':_0x47d0fc[_0xfaa3('0x60')]});if(_0x17daa5){_0x2ab721(_0x17daa5);}else{return _0x1a3033(_0x2833e7['error'](0x1f5,_0xfaa3('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x494a19){var _0x5e99ec=this;return new Promise(function(_0x313e43,_0x582043){if(ami[_0xfaa3('0x1a')]()==![]){return _0x582043(_0x5e99ec['error'](0x1f4,[config['asterisk']['ip'],config[_0xfaa3('0x12')][_0xfaa3('0x13')],_0xfaa3('0x14')]['join']('\x20')));}var _0x1e8dd9=schema(properties[_0xfaa3('0x76')])[_0xfaa3('0x3')](_0x494a19);if(_0x1e8dd9[_0xfaa3('0x5a')]>0x0){return _0x582043(_0x5e99ec[_0xfaa3('0x11')](0x1f4,_['map'](_0x1e8dd9,_0xfaa3('0x21'))[_0xfaa3('0x15')](',\x20')));}var _0x589fdc=_[_0xfaa3('0x5b')](_0x513eea[_0xfaa3('0x75')],{'uniqueid':_0x494a19[_0xfaa3('0x60')]});if(_0x589fdc&&_0x589fdc[_0xfaa3('0x61')]){return ami[_0xfaa3('0x19')]({'action':_0xfaa3('0x77'),'channel':_0x589fdc[_0xfaa3('0x61')]})[_0xfaa3('0x1e')](function(_0x49b349){_0x313e43({'code':0xc8,'message':[_0x494a19[_0xfaa3('0x60')],_0x49b349[_0xfaa3('0x21')]['toLowerCase']()][_0xfaa3('0x15')]('\x20')});})[_0xfaa3('0x20')](function(_0x225bb4){_0x582043(_0x5e99ec[_0xfaa3('0x11')](0x1f5,[_0x494a19[_0xfaa3('0x60')],_0x225bb4['message'][_0xfaa3('0x68')]()][_0xfaa3('0x15')]('\x20')));});}else{return _0x582043(_0x5e99ec[_0xfaa3('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x2b9d36){var _0x5a3d46=this;return new Promise(function(_0x1b2ee4,_0x2d8f04){if(ami[_0xfaa3('0x1a')]()==![]){return _0x2d8f04(_0x5a3d46['error'](0x1f4,[config[_0xfaa3('0x12')]['ip'],config[_0xfaa3('0x12')][_0xfaa3('0x13')],_0xfaa3('0x14')]['join']('\x20')));}var _0x4be650=schema(properties['voicequeuechannelredirect'])[_0xfaa3('0x3')](_0x2b9d36);if(_0x4be650[_0xfaa3('0x5a')]>0x0){return _0x2d8f04(_0x5a3d46[_0xfaa3('0x11')](0x1f4,_[_0xfaa3('0x5f')](_0x4be650,_0xfaa3('0x21'))['join'](',\x20')));}var _0xac819=_[_0xfaa3('0x5b')](_0x513eea[_0xfaa3('0x75')],{'uniqueid':_0x2b9d36['uniqueid']});if(_0xac819&&_0xac819[_0xfaa3('0x61')]){return ami['Action']({'action':_0xfaa3('0x78'),'channel':_0xac819['channel'],'exten':_0x2b9d36[_0xfaa3('0x79')],'context':_0x2b9d36[_0xfaa3('0x7a')]||_0xac819[_0xfaa3('0x7a')],'priority':0x1})[_0xfaa3('0x1e')](function(_0x515a67){_0x1b2ee4({'code':0xc8,'message':[_0x2b9d36[_0xfaa3('0x60')],_0x515a67[_0xfaa3('0x21')][_0xfaa3('0x68')]()][_0xfaa3('0x15')]('\x20')});})['catch'](function(_0x3cc53c){_0x2d8f04(_0x5a3d46[_0xfaa3('0x11')](0x1f5,[_0x2b9d36[_0xfaa3('0x60')],_0x3cc53c[_0xfaa3('0x21')][_0xfaa3('0x68')]()]['join']('\x20')));});}else{return _0x2d8f04(_0x5a3d46[_0xfaa3('0x11')](0x1f5,_0xfaa3('0x70')));}});},'Agents':function(_0xc20a3d){return new Promise(function(_0x5382ef,_0x3ddd0c){var _0x3a6b5b=_[_0xfaa3('0x5c')](_0x513eea['agents']);_0x5382ef({'count':_0x3a6b5b[_0xfaa3('0x5a')],'rows':_0x3a6b5b});});},'Telephones':function(_0x4b1b6f){return new Promise(function(_0x422201,_0x57a309){var _0x1956a6=_['values'](_0x513eea[_0xfaa3('0x7b')]);_0x422201({'count':_0x1956a6[_0xfaa3('0x5a')],'rows':_0x1956a6});});},'Trunks':function(_0x4fb738){return new Promise(function(_0x51e0b9,_0x452694){var _0x3824eb=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x7c')]);_0x51e0b9({'count':_0x3824eb[_0xfaa3('0x5a')],'rows':_0x3824eb});});},'OutboundChannels':function(_0x5bc92b){return new Promise(function(_0x40de0f,_0x328a25){var _0x24055c=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x7d')]);_0x40de0f({'count':_0x24055c[_0xfaa3('0x5a')],'rows':_0x24055c});});},'Outbound':function(_0x27479e){return new Promise(function(_0x3a8e72,_0x2514a2){_0x3a8e72(_0x513eea['outbound']);});},'Campaigns':function(_0x50a137){return new Promise(function(_0x10dc8d,_0x2d2554){var _0x570b95=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x7e')]);_0x10dc8d({'count':_0x570b95[_0xfaa3('0x5a')],'rows':_0x570b95});});},'VoiceQueuesPreview':function(_0x13e28f){var _0xf9867b=this;return new Promise(function(_0xa5c863,_0x3f02b2){_0x2ac57f[_0xfaa3('0x7f')](_0x13e28f['id'])[_0xfaa3('0x1e')](function(_0x4b42b9){_0xa5c863({'code':0xc8,'message':_0x4b42b9['message']});})[_0xfaa3('0x20')](function(_0x1a5885){_0x3f02b2(_0xf9867b[_0xfaa3('0x11')](0x1f4,_0x1a5885[_0xfaa3('0x21')]));});});},'EventManager':function(_0x2909a8){var _0x27226b=this;return new Promise(function(_0x2c5509,_0x27a1a5){if(!_0x2909a8['event']){return _0x27a1a5(_0x27226b['error'](0x1f4,_0xfaa3('0x80')));}ami[_0xfaa3('0x81')](_0xfaa3('0x82')+_0x2909a8['event'],_0x2909a8[_0xfaa3('0x21')]);_0x2c5509({'code':0xc8,'message':_0x2909a8});});},'FaxAccounts':function(_0x1fde58){return new Promise(function(_0x2a72be,_0x6c693a){var _0x1f458b=_[_0xfaa3('0x5c')](_0x513eea[_0xfaa3('0x83')]);_0x2a72be({'count':_0x1f458b['length'],'rows':_0x1f458b});});},'SendFax':function(_0x2f4cd3){var _0x24114d=this;return new Promise(function(_0x4d8ce7,_0x875fea){_0x4bac92[_0xfaa3('0x84')](_0x2f4cd3)[_0xfaa3('0x1e')](function(_0x310063){_0x4d8ce7({'code':0xc8,'message':_0x310063['message']});})[_0xfaa3('0x20')](function(_0x3a6d4d){_0x875fea(_0x24114d['error'](0x1f4,_0x3a6d4d[_0xfaa3('0x21')]));});});},'CheckAfterSend':function(_0x5f2169){var _0x5d502a=this;return new Promise(function(_0x49e054,_0x1161b6){_0x4bac92['checkAfterSend'](_0x5f2169)[_0xfaa3('0x1e')](function(_0x48cbd3){_0x49e054({'code':0xc8,'message':_0x48cbd3[_0xfaa3('0x21')]});})['catch'](function(_0xe679f8){_0x1161b6(_0x5d502a['error'](0x1f4,_0xe679f8[_0xfaa3('0x21')]));});});}};var _0x317056=jayson[_0xfaa3('0x85')](_0x352958)['http']();_0x317056['on']('error',function(_0x5561b2){return _0xeecce5(_0x5561b2);});_0x317056[_0xfaa3('0x86')](0x232a,_0xfaa3('0x87'),function(){console[_0xfaa3('0x88')](_0xfaa3('0x89'),0x232a);return _0x3d09aa(_0xfaa3('0x8a')+0x232a);});});}; \ No newline at end of file +var _0xd046=['queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../ami','%s/%s','name','timer','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','content','voiceQueues','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','find','omit','undefined','values','voicechannel','channels','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd046,0x129));var _0x6d04=function(_0x5c1833,_0x331b4c){_0x5c1833=_0x5c1833-0x0;var _0x57d38e=_0xd046[_0x5c1833];return _0x57d38e;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var jayson=require(_0x6d04('0x1'));var schema=require(_0x6d04('0x2'));var BPromise=require('bluebird');var moment=require(_0x6d04('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x6d04('0x4'));exports['listen']=function(_0x174d65,_0x4a1d47,_0x4bacb1){return new BPromise(function(_0xf3b4e7,_0x1968c4){var _0x4f83bc={'QueuePause':function(_0x569c7b){return new Promise(function(_0x2e2c01,_0x42aa22){var _0x52fc0c=util['format'](_0x6d04('0x5'),'SIP',_0x569c7b[_0x6d04('0x6')]);if(_0x174d65['timers']&&_0x174d65['timers'][_0x52fc0c]&&_0x174d65['timers'][_0x52fc0c][_0x6d04('0x7')]){_0x174d65[_0x6d04('0x8')][_0x52fc0c][_0x6d04('0x9')]();}if(_0x174d65[_0x6d04('0xa')][_0x52fc0c]){_0x174d65['agents'][_0x52fc0c][_0x6d04('0xb')]({'statePause':_0x569c7b[_0x6d04('0xc')]?!![]:![]});}_0x2e2c01({'code':0xc8,'message':_0x6d04('0xd')});});},'Reload':function(_0x16526b){var _0x22888e=this;return new Promise(function(_0x3e1da1,_0x2cadb8){if(ami[_0x6d04('0xe')]()==![]){return _0x2cadb8(_0x22888e[_0x6d04('0xf')](0x1f4,[config[_0x6d04('0x10')]['ip'],config[_0x6d04('0x10')][_0x6d04('0x11')],_0x6d04('0x12')][_0x6d04('0x13')]('\x20')));}_0x16526b=_[_0x6d04('0x14')](_0x16526b,_[_0x6d04('0x15')](properties[_0x6d04('0x16')]));_0x16526b[_0x6d04('0x17')]=_0x6d04('0x18');return ami[_0x6d04('0x19')](_0x16526b)[_0x6d04('0x1a')](function(_0x41dc21){_0x3e1da1({'code':0xc8,'message':_0x41dc21[_0x6d04('0x1b')]});})[_0x6d04('0x1c')](function(_0x4e93b5){_0x2cadb8(_0x22888e[_0x6d04('0xf')](0x1f5,_0x4e93b5[_0x6d04('0x1b')]));});});},'Command':function(_0x158383){var _0x7edbfc=this;return new Promise(function(_0x1d3dac,_0x2c6bb4){if(ami[_0x6d04('0xe')]()==![]){return _0x2c6bb4(_0x7edbfc[_0x6d04('0xf')](0x1f4,[config[_0x6d04('0x10')]['ip'],config[_0x6d04('0x10')][_0x6d04('0x11')],_0x6d04('0x12')][_0x6d04('0x13')]('\x20')));}_0x158383=_['pick'](_0x158383,_0x6d04('0x1d'));_0x158383[_0x6d04('0x17')]='Command';return ami['Action'](_0x158383)[_0x6d04('0x1a')](function(_0x326276){_0x1d3dac({'code':0xc8,'message':_0x326276[_0x6d04('0x1e')]});})[_0x6d04('0x1c')](function(_0x36113c){_0x2c6bb4(_0x7edbfc[_0x6d04('0xf')](0x1f5,_0x36113c[_0x6d04('0x1b')]));});});},'VoiceQueues':function(_0xb2bd60){return new Promise(function(_0x16a5b8,_0x38e90f){var _0x2c4d5b=[];for(var _0x23d78a in _0x174d65[_0x6d04('0x1f')]){if(_0x174d65[_0x6d04('0x1f')]['hasOwnProperty'](_0x23d78a)){var _0x1dc29b=_0x174d65[_0x6d04('0x1f')][_0x23d78a];var _0x6104a2={'id':_0x1dc29b['id'],'name':_0x1dc29b[_0x6d04('0x6')],'strategy':_0x1dc29b[_0x6d04('0x20')],'answered':_0x1dc29b[_0x6d04('0x21')],'available':_0x1dc29b['available'],'loggedIn':_0x1dc29b[_0x6d04('0x22')],'pTalking':_0x1dc29b[_0x6d04('0x23')],'sumBillable':_0x1dc29b[_0x6d04('0x24')],'sumDuration':_0x1dc29b[_0x6d04('0x25')],'sumHoldTime':_0x1dc29b[_0x6d04('0x26')]||0x0,'talking':_0x1dc29b['talking'],'total':_0x1dc29b['total'],'type':_0x1dc29b['type'],'unmanaged':_0x1dc29b['unmanaged'],'abandoned':_0x1dc29b[_0x6d04('0x27')],'waiting':_0x1dc29b['waiting'],'loggedInDb':_0x1dc29b[_0x6d04('0x28')]};if(_0x1dc29b['type']===_0x6d04('0x29')){_0x6104a2[_0x6d04('0x2a')]=_0x1dc29b[_0x6d04('0x2a')];_0x6104a2[_0x6d04('0x2b')]=_0x1dc29b[_0x6d04('0x2b')];_0x6104a2[_0x6d04('0x2c')]=_0x1dc29b[_0x6d04('0x2c')];_0x6104a2[_0x6d04('0x2d')]=_0x1dc29b[_0x6d04('0x2d')];_0x6104a2[_0x6d04('0x2e')]=_0x1dc29b['dialOriginateTimeout'];_0x6104a2['dialPrefix']=_0x1dc29b[_0x6d04('0x2f')];_0x6104a2[_0x6d04('0x30')]=_0x1dc29b[_0x6d04('0x30')];_0x6104a2[_0x6d04('0x31')]=_0x1dc29b['outboundAnswerAgiCallsDay'];_0x6104a2[_0x6d04('0x32')]=_0x1dc29b[_0x6d04('0x32')];_0x6104a2[_0x6d04('0x33')]=_0x1dc29b[_0x6d04('0x33')];_0x6104a2['outboundBusyCallsDay']=_0x1dc29b[_0x6d04('0x34')];_0x6104a2[_0x6d04('0x35')]=_0x1dc29b[_0x6d04('0x35')];_0x6104a2[_0x6d04('0x36')]=_0x1dc29b[_0x6d04('0x36')];_0x6104a2[_0x6d04('0x37')]=_0x1dc29b[_0x6d04('0x37')];_0x6104a2[_0x6d04('0x38')]=_0x1dc29b[_0x6d04('0x38')];_0x6104a2[_0x6d04('0x39')]=_0x1dc29b[_0x6d04('0x39')];_0x6104a2[_0x6d04('0x3a')]=_0x1dc29b[_0x6d04('0x3a')];_0x6104a2[_0x6d04('0x3b')]=_0x1dc29b[_0x6d04('0x3b')];_0x6104a2['outboundReCallsDay']=_0x1dc29b[_0x6d04('0x3c')];_0x6104a2['outboundRejectCallsDay']=_0x1dc29b[_0x6d04('0x3d')];_0x6104a2[_0x6d04('0x3e')]=_0x1dc29b['outboundUnknownCallsDay'];_0x6104a2[_0x6d04('0x3f')]=_0x1dc29b[_0x6d04('0x3f')];_0x6104a2[_0x6d04('0x40')]=_0x1dc29b[_0x6d04('0x40')];_0x6104a2[_0x6d04('0x41')]=_0x1dc29b[_0x6d04('0x41')];_0x6104a2[_0x6d04('0x42')]=_0x1dc29b[_0x6d04('0x42')];_0x6104a2['predictiveIntervalDroppedCallsTimeout']=_0x1dc29b[_0x6d04('0x43')];_0x6104a2[_0x6d04('0x44')]=_0x1dc29b[_0x6d04('0x44')];_0x6104a2[_0x6d04('0x45')]=_0x1dc29b[_0x6d04('0x45')];_0x6104a2['predictiveIntervalHitRate']=_0x1dc29b[_0x6d04('0x46')];_0x6104a2['predictiveIntervalMultiplicativeFactor']=_0x1dc29b['predictiveIntervalMultiplicativeFactor'];_0x6104a2['predictiveIntervalPauses']=_0x1dc29b['predictiveIntervalPauses'];_0x6104a2['predictiveIntervalAvailable']=_0x1dc29b[_0x6d04('0x47')];_0x6104a2['predictiveIntervalTotalCalls']=_0x1dc29b[_0x6d04('0x48')];_0x6104a2[_0x6d04('0x1b')]=_0x1dc29b[_0x6d04('0x1b')];_0x6104a2[_0x6d04('0x49')]=_0x1dc29b['originated'];_0x6104a2[_0x6d04('0x4a')]=_0x1dc29b[_0x6d04('0x4a')];_0x6104a2['erlangCallToSecond']=_0x1dc29b[_0x6d04('0x4b')];_0x6104a2[_0x6d04('0x4c')]=_0x1dc29b[_0x6d04('0x4c')];_0x6104a2[_0x6d04('0x4d')]=_0x1dc29b[_0x6d04('0x4d')];_0x6104a2[_0x6d04('0x4e')]=_0x1dc29b[_0x6d04('0x4e')];_0x6104a2['startProgressive']=_0x1dc29b[_0x6d04('0x4f')];}if(_0x1dc29b['Trunk']){_0x6104a2['Trunk']={'id':_0x1dc29b[_0x6d04('0x50')]['id'],'name':_0x1dc29b['Trunk'][_0x6d04('0x6')],'active':_0x1dc29b[_0x6d04('0x50')]['active'],'callerid':_0x1dc29b[_0x6d04('0x50')][_0x6d04('0x51')]};}if(_0x1dc29b[_0x6d04('0x52')]){_0x6104a2['Interval']={'id':_0x1dc29b['Interval']['id'],'name':_0x1dc29b[_0x6d04('0x52')][_0x6d04('0x6')]};}_0x2c4d5b[_0x6d04('0x53')](_0x6104a2);}}_0x16a5b8({'count':_0x2c4d5b[_0x6d04('0x54')],'rows':_0x2c4d5b});});},'UpdateVoiceQueue':function(_0x36db7a){return new Promise(function(_0x550455,_0x204933){var _0x3f053c=_[_0x6d04('0x55')](_0x174d65[_0x6d04('0x1f')],{'id':parseInt(_0x36db7a['id'])});var _0x413c3f=_[_0x6d04('0x56')](_0x36db7a,['id']);if(_0x3f053c){for(var _0x491de4 in _0x413c3f){if(typeof _0x413c3f[_0x491de4]!==_0x6d04('0x57')&&typeof _0x3f053c[_0x491de4]!==_0x6d04('0x57')){_0x3f053c[_0x491de4]=_0x413c3f[_0x491de4];}}_0x550455(_0x3f053c);}else{_0x204933();}});},'VoiceChannels':function(_0xace1a6){return new Promise(function(_0x4b5ed6,_0x52f411){var _0x146e51=_[_0x6d04('0x58')](_0x174d65['channels']);_0x4b5ed6({'count':_0x146e51['length'],'rows':_0x146e51});});},'VoiceChannelMixMonitor':function(_0x55e80a){var _0x4f4524=this;return new Promise(function(_0x56c653,_0x4b0349){if(ami[_0x6d04('0xe')]()==![]){return _0x4b0349(_0x4f4524[_0x6d04('0xf')](0x1f4,[config[_0x6d04('0x10')]['ip'],config[_0x6d04('0x10')]['username'],_0x6d04('0x12')][_0x6d04('0x13')]('\x20')));}var _0x48f04c=schema(properties[_0x6d04('0x59')])['validate'](_0x55e80a);if(_0x48f04c[_0x6d04('0x54')]>0x0){return _0x4b0349(_0x4f4524['error'](0x1f4,_['map'](_0x48f04c,_0x6d04('0x1b'))[_0x6d04('0x13')](',\x20')));}var _0xe4a07a=_[_0x6d04('0x55')](_0x174d65[_0x6d04('0x5a')],{'uniqueid':_0x55e80a[_0x6d04('0x5b')]});if(_0xe4a07a&&_0xe4a07a[_0x6d04('0x5c')]){var _0x16fe48=util[_0x6d04('0x5d')](_0x6d04('0x5e'),_0x55e80a[_0x6d04('0x5f')]||_0x55e80a[_0x6d04('0x5b')],_0x55e80a[_0x6d04('0x5d')]||_0x6d04('0x60'));return ami[_0x6d04('0x19')]({'action':_0x6d04('0x61'),'channel':_0xe4a07a['channel'],'file':_0x16fe48,'options':_0x6d04('0x62')})[_0x6d04('0x1a')](function(_0x1785e3){var _0x124401=_[_0x6d04('0x55')](_0xe4a07a[_0x6d04('0x63')],{'filename':_0x6d04('0x64')+_0x16fe48[_0x6d04('0x65')]()});if(_['isNil'](_0x124401)){_0xe4a07a[_0x6d04('0x63')][_0x6d04('0x53')]({'filename':'/var/spool/asterisk/monitor/'+_0x16fe48[_0x6d04('0x65')](),'createdAt':moment()[_0x6d04('0x5d')](_0x6d04('0x66')),'mixmonitorid':_0x1785e3[_0x6d04('0x67')],'status':_0x6d04('0x68')});}else{_0x124401[_0x6d04('0x67')]=_0x1785e3['mixmonitorid'];_0x124401['status']=_0x6d04('0x68');}_0x56c653({'code':0xc8,'message':[_0x55e80a['uniqueid'],_0x6d04('0x69'),_0x1785e3[_0x6d04('0x67')]][_0x6d04('0x13')]('\x20'),'mixmonitorid':_0x1785e3[_0x6d04('0x67')]});})['catch'](function(_0x24744c){_0x4b0349(_0x4f4524[_0x6d04('0xf')](0x1f5,[_0x55e80a[_0x6d04('0x5b')],_0x24744c[_0x6d04('0x1b')][_0x6d04('0x65')]()][_0x6d04('0x13')]('\x20')));});}else{return _0x4b0349(_0x4f4524[_0x6d04('0xf')](0x1f5,_0x6d04('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x5d729f){var _0x8a9a2c=this;return new Promise(function(_0x3f9214,_0x1af6b8){if(ami['isConnected']()==![]){return _0x1af6b8(_0x8a9a2c[_0x6d04('0xf')](0x1f4,[config[_0x6d04('0x10')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x6d04('0x13')]('\x20')));}var _0x2da73e=schema(properties[_0x6d04('0x59')])[_0x6d04('0x2')](_0x5d729f);if(_0x2da73e[_0x6d04('0x54')]>0x0){return _0x1af6b8(_0x8a9a2c[_0x6d04('0xf')](0x1f4,_[_0x6d04('0x6b')](_0x2da73e,_0x6d04('0x1b'))[_0x6d04('0x13')](',\x20')));}var _0xb2edae=_['find'](_0x174d65['channels'],{'uniqueid':_0x5d729f['uniqueid']});if(_0xb2edae){return BPromise[_0x6d04('0x6c')]()[_0x6d04('0x1a')](function(){if(_0xb2edae[_0x6d04('0x5c')]){return ami[_0x6d04('0x19')]({'action':_0x6d04('0x6d'),'channel':_0xb2edae['channel'],'mixmonitorid':_0x5d729f[_0x6d04('0x67')]})['catch'](function(_0x10e0b9){});}})[_0x6d04('0x1a')](function(){if(_0xb2edae[_0x6d04('0x6e')]){return ami[_0x6d04('0x19')]({'action':_0x6d04('0x6d'),'channel':_0xb2edae[_0x6d04('0x6e')],'mixmonitorid':_0x5d729f[_0x6d04('0x67')]})[_0x6d04('0x1c')](function(_0x5504dc){});}})[_0x6d04('0x1a')](function(_0x37f223){var _0x2079a2=_[_0x6d04('0x55')](_0xb2edae[_0x6d04('0x63')],{'mixmonitorid':_0x5d729f[_0x6d04('0x67')]});if(_0x2079a2){_0x2079a2[_0x6d04('0x6f')]=_0x6d04('0x70');}})['then'](function(){var _0x45b641=util[_0x6d04('0x5d')](_0x6d04('0x5e'),_0x5d729f[_0x6d04('0x5f')]||_0x5d729f['uniqueid'],_0x5d729f[_0x6d04('0x5d')]||'wav');var _0x494ae0=_[_0x6d04('0x55')](_0xb2edae[_0x6d04('0x63')],{'filename':_0x6d04('0x64')+_0x45b641[_0x6d04('0x65')]()});if(_0x494ae0){_0x494ae0['status']=_0x6d04('0x70');}})[_0x6d04('0x1a')](function(){_0x3f9214({'code':0xc8,'message':[_0x5d729f[_0x6d04('0x5b')],_0x6d04('0x71')][_0x6d04('0x13')]('\x20')});})[_0x6d04('0x1c')](function(_0x24df5f){_0x1af6b8(_0x8a9a2c[_0x6d04('0xf')](0x1f5,[_0x5d729f[_0x6d04('0x5b')],_0x24df5f[_0x6d04('0x1b')][_0x6d04('0x65')]()][_0x6d04('0x13')]('\x20')));});}else{return _0x1af6b8(_0x8a9a2c['error'](0x1f5,_0x6d04('0x6a')));}});},'VoiceQueuesChannels':function(_0x4115c6){return new Promise(function(_0x2e4e80,_0x208860){var _0x2f0ea6=_['values'](_0x174d65[_0x6d04('0x72')]);_0x2e4e80({'count':_0x2f0ea6['length'],'rows':_0x2f0ea6});});},'VoiceQueuesChannel':function(_0x4886d5){var _0x29f3c8=this;return new Promise(function(_0x436df8,_0x3547b7){var _0x2864f2=schema(properties[_0x6d04('0x73')])['validate'](_0x4886d5);if(_0x2864f2[_0x6d04('0x54')]>0x0){return _0x3547b7(_0x29f3c8[_0x6d04('0xf')](0x1f4,_['map'](_0x2864f2,'message')[_0x6d04('0x13')](',\x20')));}var _0x45ff0e=_[_0x6d04('0x55')](_0x174d65[_0x6d04('0x72')],{'uniqueid':_0x4886d5[_0x6d04('0x5b')]});if(_0x45ff0e){_0x436df8(_0x45ff0e);}else{return _0x3547b7(_0x29f3c8[_0x6d04('0xf')](0x1f5,_0x6d04('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0xd63098){var _0x1b58e8=this;return new Promise(function(_0x1d3c7e,_0x13ecc2){if(ami[_0x6d04('0xe')]()==![]){return _0x13ecc2(_0x1b58e8['error'](0x1f4,[config['asterisk']['ip'],config[_0x6d04('0x10')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x4fdf69=schema(properties[_0x6d04('0x74')])[_0x6d04('0x2')](_0xd63098);if(_0x4fdf69[_0x6d04('0x54')]>0x0){return _0x13ecc2(_0x1b58e8[_0x6d04('0xf')](0x1f4,_[_0x6d04('0x6b')](_0x4fdf69,_0x6d04('0x1b'))[_0x6d04('0x13')](',\x20')));}var _0x55ac73=_[_0x6d04('0x55')](_0x174d65[_0x6d04('0x72')],{'uniqueid':_0xd63098[_0x6d04('0x5b')]});if(_0x55ac73&&_0x55ac73[_0x6d04('0x5c')]){return ami[_0x6d04('0x19')]({'action':'Hangup','channel':_0x55ac73[_0x6d04('0x5c')]})['then'](function(_0x35f0fc){_0x1d3c7e({'code':0xc8,'message':[_0xd63098[_0x6d04('0x5b')],_0x35f0fc[_0x6d04('0x1b')][_0x6d04('0x65')]()][_0x6d04('0x13')]('\x20')});})[_0x6d04('0x1c')](function(_0x299eb2){_0x13ecc2(_0x1b58e8[_0x6d04('0xf')](0x1f5,[_0xd63098['uniqueid'],_0x299eb2[_0x6d04('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x13ecc2(_0x1b58e8[_0x6d04('0xf')](0x1f5,_0x6d04('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x4cb247){var _0x54d9ce=this;return new Promise(function(_0x5ce833,_0x28c6bc){if(ami[_0x6d04('0xe')]()==![]){return _0x28c6bc(_0x54d9ce[_0x6d04('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x6d04('0x11')],_0x6d04('0x12')][_0x6d04('0x13')]('\x20')));}var _0xb09641=schema(properties[_0x6d04('0x75')])['validate'](_0x4cb247);if(_0xb09641['length']>0x0){return _0x28c6bc(_0x54d9ce['error'](0x1f4,_['map'](_0xb09641,_0x6d04('0x1b'))[_0x6d04('0x13')](',\x20')));}var _0x2e34f1=_[_0x6d04('0x55')](_0x174d65[_0x6d04('0x72')],{'uniqueid':_0x4cb247['uniqueid']});if(_0x2e34f1&&_0x2e34f1[_0x6d04('0x5c')]){return ami['Action']({'action':_0x6d04('0x76'),'channel':_0x2e34f1[_0x6d04('0x5c')],'exten':_0x4cb247[_0x6d04('0x77')],'context':_0x4cb247[_0x6d04('0x78')]||_0x2e34f1[_0x6d04('0x78')],'priority':0x1})[_0x6d04('0x1a')](function(_0x5e6637){_0x5ce833({'code':0xc8,'message':[_0x4cb247[_0x6d04('0x5b')],_0x5e6637[_0x6d04('0x1b')]['toLowerCase']()][_0x6d04('0x13')]('\x20')});})[_0x6d04('0x1c')](function(_0x9a88eb){_0x28c6bc(_0x54d9ce[_0x6d04('0xf')](0x1f5,[_0x4cb247[_0x6d04('0x5b')],_0x9a88eb[_0x6d04('0x1b')][_0x6d04('0x65')]()][_0x6d04('0x13')]('\x20')));});}else{return _0x28c6bc(_0x54d9ce[_0x6d04('0xf')](0x1f5,_0x6d04('0x6a')));}});},'Agents':function(_0x5b46dd){return new Promise(function(_0x3fe3d4,_0x5e05e9){var _0x426f6d=_['values'](_0x174d65[_0x6d04('0xa')]);_0x3fe3d4({'count':_0x426f6d[_0x6d04('0x54')],'rows':_0x426f6d});});},'Telephones':function(_0x2242f7){return new Promise(function(_0x33b0f5,_0x40336e){var _0x5622b1=_[_0x6d04('0x58')](_0x174d65[_0x6d04('0x79')]);_0x33b0f5({'count':_0x5622b1['length'],'rows':_0x5622b1});});},'Trunks':function(_0x43af5f){return new Promise(function(_0x34bfcb,_0x5818ed){var _0x2a6c30=_['values'](_0x174d65[_0x6d04('0x7a')]);_0x34bfcb({'count':_0x2a6c30['length'],'rows':_0x2a6c30});});},'OutboundChannels':function(_0x3ff09e){return new Promise(function(_0x23ba11,_0x469443){var _0x29dfba=_[_0x6d04('0x58')](_0x174d65[_0x6d04('0x7b')]);_0x23ba11({'count':_0x29dfba[_0x6d04('0x54')],'rows':_0x29dfba});});},'Outbound':function(_0x2c4219){return new Promise(function(_0x7c68eb,_0x2be999){_0x7c68eb(_0x174d65[_0x6d04('0x29')]);});},'Campaigns':function(_0x3cc46f){return new Promise(function(_0x56c938,_0x3e2eea){var _0x1e68c6=_[_0x6d04('0x58')](_0x174d65[_0x6d04('0x7c')]);_0x56c938({'count':_0x1e68c6['length'],'rows':_0x1e68c6});});},'VoiceQueuesPreview':function(_0x3df7ef){var _0x43ba0b=this;return new Promise(function(_0x46da38,_0x415421){_0x4a1d47[_0x6d04('0x7d')](_0x3df7ef['id'])[_0x6d04('0x1a')](function(_0x281f79){_0x46da38({'code':0xc8,'message':_0x281f79[_0x6d04('0x1b')]});})['catch'](function(_0x250eef){_0x415421(_0x43ba0b['error'](0x1f4,_0x250eef[_0x6d04('0x1b')]));});});},'EventManager':function(_0x57e551){var _0x1b8402=this;return new Promise(function(_0x124708,_0x17ca4d){if(!_0x57e551[_0x6d04('0x7e')]){return _0x17ca4d(_0x1b8402[_0x6d04('0xf')](0x1f4,_0x6d04('0x7f')));}ami['emit'](_0x6d04('0x80')+_0x57e551[_0x6d04('0x7e')],_0x57e551['message']);_0x124708({'code':0xc8,'message':_0x57e551});});},'FaxAccounts':function(_0x36768e){return new Promise(function(_0x1d3b13,_0x7e911b){var _0x4b7a37=_[_0x6d04('0x58')](_0x174d65[_0x6d04('0x81')]);_0x1d3b13({'count':_0x4b7a37[_0x6d04('0x54')],'rows':_0x4b7a37});});},'SendFax':function(_0x220c69){var _0x407f98=this;return new Promise(function(_0x7f5790,_0xe07034){_0x4bacb1[_0x6d04('0x82')](_0x220c69)[_0x6d04('0x1a')](function(_0x345ffe){_0x7f5790({'code':0xc8,'message':_0x345ffe[_0x6d04('0x1b')]});})[_0x6d04('0x1c')](function(_0x93c05c){_0xe07034(_0x407f98[_0x6d04('0xf')](0x1f4,_0x93c05c['message']));});});},'CheckAfterSend':function(_0x2b4e49){var _0x425707=this;return new Promise(function(_0x12a364,_0x202e83){_0x4bacb1['checkAfterSend'](_0x2b4e49)[_0x6d04('0x1a')](function(_0x1e8db9){_0x12a364({'code':0xc8,'message':_0x1e8db9[_0x6d04('0x1b')]});})['catch'](function(_0x24e546){_0x202e83(_0x425707[_0x6d04('0xf')](0x1f4,_0x24e546[_0x6d04('0x1b')]));});});}};var _0x299037=jayson[_0x6d04('0x83')](_0x4f83bc)[_0x6d04('0x84')]();_0x299037['on']('error',function(_0x921efd){return _0x1968c4(_0x921efd);});_0x299037[_0x6d04('0x85')](0x232a,'127.0.0.1',function(){console[_0x6d04('0x86')](_0x6d04('0x87'),0x232a);return _0xf3b4e7(_0x6d04('0x88')+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 a5d5c77..2a4cb40 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 _0xbd50=['lastName','mobile','fax','createdAt','then','getContacts','isEmpty','[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','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName'];(function(_0x87b368,_0x1165fb){var _0x5761ae=function(_0x5a6d4f){while(--_0x5a6d4f){_0x87b368['push'](_0x87b368['shift']());}};_0x5761ae(++_0x1165fb);}(_0xbd50,0x196));var _0x0bd5=function(_0x652863,_0x36f1e1){_0x652863=_0x652863-0x0;var _0x1fcf1d=_0xbd50[_0x652863];return _0x1fcf1d;};'use strict';var _=require(_0x0bd5('0x0'));var BPromise=require(_0x0bd5('0x1'));var Redis=require(_0x0bd5('0x2'));var util=require('util');var config=require(_0x0bd5('0x3'));var logger=require(_0x0bd5('0x4'))(_0x0bd5('0x5'));var cmContactRpc=require(_0x0bd5('0x6'));config[_0x0bd5('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0bd5('0x8'))(new Redis(config[_0x0bd5('0x7')]));function emit(_0xcc6cfa,_0x2c0db1,_0x1b99f3,_0x5ebe64,_0x47e78d){logger[_0x0bd5('0x9')](_0x0bd5('0xa'),_0xcc6cfa,_0x2c0db1['id'],_0x1b99f3,_0x5ebe64,JSON[_0x0bd5('0xb')](_0x47e78d));io['to'](_0x1b99f3)['emit'](_0x5ebe64,_0x47e78d);}exports[_0x0bd5('0xc')]=function(_0x2fa7d1,_0x519bc6,_0x210f45,_0x7db86e){var _0x4d7d17,_0x1ce7dd;var _0x130723={};var _0x1aa818=Number(_0x210f45['data1']);var _0x2f7a0c=_0x210f45[_0x0bd5('0xd')]?Boolean(Number(_0x210f45[_0x0bd5('0xd')])):![];var _0xc5b4cd;var _0xfa1eed=![];if(!_[_0x0bd5('0xe')](_0x210f45[_0x0bd5('0xf')])){if(_0x210f45[_0x0bd5('0xf')]=='1')_0xfa1eed=!![];}if(!_0xfa1eed){if(_0x7db86e['xmd-contactid']){_0x130723['id']=_0x7db86e[_0x0bd5('0x10')];}}if(!_0x130723['id']){_0x130723[_0x0bd5('0x11')]=_0x1aa818;_0xc5b4cd=_0x210f45['data3']&&_0x210f45[_0x0bd5('0x12')]!=='0'?_0x210f45[_0x0bd5('0x12')][_0x0bd5('0x13')](','):[_0x0bd5('0x14')];_0x130723['$or']=_[_0x0bd5('0x15')](_0xc5b4cd,function(_0x2e4f36){var _0xa890be={};_0xa890be[_0x2e4f36]=_0x7db86e[_0x0bd5('0x16')]?_0x7db86e[_0x0bd5('0x17')]:_0x7db86e[_0x0bd5('0x18')];return _0xa890be;});}var _0xc58e12=['id',_0x0bd5('0x19'),_0x0bd5('0x1a'),_0x0bd5('0x14'),_0x0bd5('0x1b'),_0x0bd5('0x1c'),_0x0bd5('0x11'),_0x0bd5('0x1d'),'scheduledAt','updatedAt'];var _0x596b6a=_['union'](_0xc58e12,_0xc5b4cd);BPromise['resolve']()[_0x0bd5('0x1e')](cmContactRpc[_0x0bd5('0x1f')]({'attributes':_0x596b6a,'where':_0x130723}))[_0x0bd5('0x1e')](function(_0x4a6910){_0x1ce7dd=_0x4a6910;if(!_[_0x0bd5('0x20')](_0x1ce7dd)){if(_0x1ce7dd['length']===0x1){_0x4d7d17=_0x1ce7dd[0x0];logger[_0x0bd5('0x9')](_0x0bd5('0x21'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id'],_0x4d7d17['id']);}else{logger['info'](_0x0bd5('0x23'),_0x7db86e['uniqueid'],_0x519bc6['id'],_['map'](_0x1ce7dd,'id')[_0x0bd5('0x24')](','));}return;}else{logger[_0x0bd5('0x9')](_0x0bd5('0x25'),_0x7db86e['uniqueid'],_0x519bc6['id']);var _0x42428c={'ListId':_0x1aa818};var _0x5eab3e=_0x210f45[_0x0bd5('0x26')]&&_0x210f45[_0x0bd5('0x26')]!=='0'?_0x210f45[_0x0bd5('0x26')]:_0x0bd5('0x14');if(_0x2f7a0c){logger[_0x0bd5('0x9')](_0x0bd5('0x27'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id']);_0x42428c[_0x5eab3e]=_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])?_0x7db86e[_0x0bd5('0x18')]:_0x7db86e[_0x0bd5('0x17')];if(_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])){_0x42428c[_0x0bd5('0x19')]=_0x7db86e['calleridname']&&_0x7db86e[_0x0bd5('0x28')]!==_0x0bd5('0x29')?_0x7db86e['calleridname']:_0x0bd5('0x2a');}else{_0x42428c[_0x0bd5('0x19')]=_0x7db86e['destcalleridname']&&_0x7db86e[_0x0bd5('0x2b')]!==_0x0bd5('0x29')?_0x7db86e[_0x0bd5('0x2b')]:_0x0bd5('0x2a');}return BPromise['resolve']()[_0x0bd5('0x1e')](cmContactRpc[_0x0bd5('0x2c')](_0x42428c))[_0x0bd5('0x1e')](function(_0x24ef4a){_0x4d7d17=_0x24ef4a;_0x1ce7dd[_0x0bd5('0x2d')](_0x24ef4a);if(_0x4d7d17){logger[_0x0bd5('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id'],_0x4d7d17['id']);}return;});}else{logger['info'](_0x0bd5('0x2e'),_0x7db86e[_0x0bd5('0x22')],_0x519bc6['id']);_0x42428c[_0x5eab3e]=_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])?_0x7db86e[_0x0bd5('0x18')]:_0x7db86e[_0x0bd5('0x17')];if(_[_0x0bd5('0xe')](_0x7db86e[_0x0bd5('0x16')])){_0x42428c[_0x0bd5('0x19')]=_0x7db86e[_0x0bd5('0x28')]&&_0x7db86e[_0x0bd5('0x28')]!==_0x0bd5('0x29')?_0x7db86e[_0x0bd5('0x28')]:'Unknown';}else{_0x42428c[_0x0bd5('0x19')]=_0x7db86e[_0x0bd5('0x2b')]&&_0x7db86e['destcalleridname']!==''?_0x7db86e[_0x0bd5('0x2b')]:_0x0bd5('0x2a');}_0x4d7d17=_0x42428c;_0x1ce7dd[_0x0bd5('0x2d')](_0x42428c);return;}}})[_0x0bd5('0x1e')](function(){if(_0x2fa7d1){emit(_0x7db86e[_0x0bd5('0x22')],_0x519bc6,util[_0x0bd5('0x2f')](_0x0bd5('0x30'),_0x2fa7d1[_0x0bd5('0x31')]),util[_0x0bd5('0x2f')](_0x0bd5('0x32'),_0x210f45[_0x0bd5('0x33')][_0x0bd5('0x34')]()),{'evt':_[_0x0bd5('0x35')](_0x7db86e,{'autoCreate':_0x2f7a0c}),'contact':_0x4d7d17===undefined?{}:_0x4d7d17,'contacts':_0x1ce7dd['length']===0x0?undefined:_0x1ce7dd});}});}; \ No newline at end of file +var _0xda55=['name','trigger:%s','action','merge','length','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Autocreate\x20disabled','push','format'];(function(_0x4ffd43,_0x435153){var _0x168134=function(_0x5dff25){while(--_0x5dff25){_0x4ffd43['push'](_0x4ffd43['shift']());}};_0x168134(++_0x435153);}(_0xda55,0x6d));var _0x5da5=function(_0x38a36e,_0x29e3bc){_0x38a36e=_0x38a36e-0x0;var _0x363af2=_0xda55[_0x38a36e];return _0x363af2;};'use strict';var _=require(_0x5da5('0x0'));var BPromise=require(_0x5da5('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x5da5('0x2'));var logger=require(_0x5da5('0x3'))(_0x5da5('0x4'));var cmContactRpc=require(_0x5da5('0x5'));config[_0x5da5('0x6')]=_['defaults'](config[_0x5da5('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5da5('0x7'))(new Redis(config['redis']));function emit(_0x2fd877,_0x267469,_0x71b187,_0x46290d,_0x3debdf){logger[_0x5da5('0x8')](_0x5da5('0x9'),_0x2fd877,_0x267469['id'],_0x71b187,_0x46290d,JSON[_0x5da5('0xa')](_0x3debdf));io['to'](_0x71b187)['emit'](_0x46290d,_0x3debdf);}exports[_0x5da5('0xb')]=function(_0x1f98a7,_0x2731a3,_0x26fbe3,_0x1a047e){var _0x2a361c,_0x33313e;var _0x589c14={};var _0x2f4e4b=Number(_0x26fbe3[_0x5da5('0xc')]);var _0x4f813b=_0x26fbe3[_0x5da5('0xd')]?Boolean(Number(_0x26fbe3[_0x5da5('0xd')])):![];var _0x3ced00;var _0x43d526=![];if(!_[_0x5da5('0xe')](_0x26fbe3[_0x5da5('0xf')])){if(_0x26fbe3['data5']=='1')_0x43d526=!![];}if(!_0x43d526){if(_0x1a047e['xmd-contactid']){_0x589c14['id']=_0x1a047e['xmd-contactid'];}}if(!_0x589c14['id']){_0x589c14[_0x5da5('0x10')]=_0x2f4e4b;_0x3ced00=_0x26fbe3[_0x5da5('0x11')]&&_0x26fbe3[_0x5da5('0x11')]!=='0'?_0x26fbe3[_0x5da5('0x11')][_0x5da5('0x12')](','):[_0x5da5('0x13')];_0x589c14[_0x5da5('0x14')]=_['map'](_0x3ced00,function(_0x124dc5){var _0x290136={};_0x290136[_0x124dc5]=_0x1a047e[_0x5da5('0x15')]?_0x1a047e[_0x5da5('0x16')]:_0x1a047e[_0x5da5('0x17')];return _0x290136;});}var _0x428b07=['id','firstName',_0x5da5('0x18'),_0x5da5('0x13'),_0x5da5('0x19'),_0x5da5('0x1a'),_0x5da5('0x10'),'createdAt',_0x5da5('0x1b'),_0x5da5('0x1c')];var _0x42a3cb=_['union'](_0x428b07,_0x3ced00);BPromise[_0x5da5('0x1d')]()[_0x5da5('0x1e')](cmContactRpc[_0x5da5('0x1f')]({'attributes':_0x42a3cb,'where':_0x589c14}))[_0x5da5('0x1e')](function(_0xec69f2){_0x33313e=_0xec69f2;if(!_[_0x5da5('0x20')](_0x33313e)){if(_0x33313e['length']===0x1){_0x2a361c=_0x33313e[0x0];logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}else{logger[_0x5da5('0x8')](_0x5da5('0x22'),_0x1a047e['uniqueid'],_0x2731a3['id'],_[_0x5da5('0x23')](_0x33313e,'id')[_0x5da5('0x24')](','));}return;}else{logger[_0x5da5('0x8')](_0x5da5('0x25'),_0x1a047e['uniqueid'],_0x2731a3['id']);var _0x5b0b43={'ListId':_0x2f4e4b};var _0x50aadc=_0x26fbe3[_0x5da5('0x26')]&&_0x26fbe3['data4']!=='0'?_0x26fbe3['data4']:_0x5da5('0x13');if(_0x4f813b){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e['routeId'])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43[_0x5da5('0x27')]=_0x1a047e['calleridname']&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43['firstName']=_0x1a047e['destcalleridname']&&_0x1a047e['destcalleridname']!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}return BPromise[_0x5da5('0x1d')]()['then'](cmContactRpc['createContact'](_0x5b0b43))[_0x5da5('0x1e')](function(_0x4afb58){_0x2a361c=_0x4afb58;_0x33313e['push'](_0x4afb58);if(_0x2a361c){logger[_0x5da5('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x1a047e[_0x5da5('0x21')],_0x2731a3['id'],_0x2a361c['id']);}return;});}else{logger[_0x5da5('0x8')](_0x5da5('0x2c'),_0x1a047e[_0x5da5('0x21')],_0x2731a3['id']);_0x5b0b43[_0x50aadc]=_[_0x5da5('0xe')](_0x1a047e[_0x5da5('0x15')])?_0x1a047e[_0x5da5('0x17')]:_0x1a047e[_0x5da5('0x16')];if(_['isNil'](_0x1a047e[_0x5da5('0x15')])){_0x5b0b43['firstName']=_0x1a047e[_0x5da5('0x28')]&&_0x1a047e[_0x5da5('0x28')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x28')]:_0x5da5('0x2a');}else{_0x5b0b43[_0x5da5('0x27')]=_0x1a047e[_0x5da5('0x2b')]&&_0x1a047e[_0x5da5('0x2b')]!==_0x5da5('0x29')?_0x1a047e[_0x5da5('0x2b')]:_0x5da5('0x2a');}_0x2a361c=_0x5b0b43;_0x33313e[_0x5da5('0x2d')](_0x5b0b43);return;}}})[_0x5da5('0x1e')](function(){if(_0x1f98a7){emit(_0x1a047e['uniqueid'],_0x2731a3,util[_0x5da5('0x2e')]('user:%s',_0x1f98a7[_0x5da5('0x2f')]),util[_0x5da5('0x2e')](_0x5da5('0x30'),_0x26fbe3[_0x5da5('0x31')]['toLowerCase']()),{'evt':_[_0x5da5('0x32')](_0x1a047e,{'autoCreate':_0x4f813b}),'contact':_0x2a361c===undefined?{}:_0x2a361c,'contacts':_0x33313e[_0x5da5('0x33')]===0x0?undefined:_0x33313e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 8ca0877..617cead 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 _0xef96=['voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:acceptmessage','custom:rejectmessage','info','prototype','clone','motionChannel','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','length','interface','action','toLowerCase','motionbar','browser','data1','data2','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','render','winArguments','emit','format','name','jscripty','user:%s','trigger:%s','contactmanager','integration','exec','queue','urlforward','parse','query','search','AllConditions','checkConditions','AnyConditions','some','channel','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','undefined','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./script','trigger','../ami','redis','socket.io-emitter','popup','winapp','triggers','agents'];(function(_0xbb25cd,_0x357bf7){var _0x1e9314=function(_0x3607c3){while(--_0x3607c3){_0xbb25cd['push'](_0xbb25cd['shift']());}};_0x1e9314(++_0x357bf7);}(_0xef96,0x162));var _0x6ef9=function(_0x5a8601,_0x30d7ed){_0x5a8601=_0x5a8601-0x0;var _0x420ac7=_0xef96[_0x5a8601];return _0x420ac7;};'use strict';var util=require(_0x6ef9('0x0'));var _=require(_0x6ef9('0x1'));var url=require(_0x6ef9('0x2'));var Mustache=require(_0x6ef9('0x3'));var Redis=require(_0x6ef9('0x4'));var urlforward=require(_0x6ef9('0x5'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x6ef9('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x6ef9('0x7'));var ami=require(_0x6ef9('0x8'));config[_0x6ef9('0x9')]=_['defaults'](config[_0x6ef9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x6ef9('0xa'))(new Redis(config[_0x6ef9('0x9')]));var operators={'equals':function(_0x472724,_0x55e850){return _0x472724==_0x55e850;},'not_equals':function(_0x450950,_0x4ccb23){return _0x450950!=_0x4ccb23;}};var barAndWebActions=[_0x6ef9('0xb'),_0x6ef9('0x2'),_0x6ef9('0xc')];function Trigger(_0x5aee3b){this[_0x6ef9('0xd')]=_0x5aee3b[_0x6ef9('0xd')];this[_0x6ef9('0xe')]=_0x5aee3b[_0x6ef9('0xe')];this['voiceQueues']=_0x5aee3b[_0x6ef9('0xf')];this[_0x6ef9('0x10')]=_0x5aee3b[_0x6ef9('0x10')];this[_0x6ef9('0x11')]=_0x5aee3b[_0x6ef9('0x11')];this[_0x6ef9('0x12')]=_0x5aee3b[_0x6ef9('0x12')];this['freshdeskAccounts']=_0x5aee3b[_0x6ef9('0x13')];this[_0x6ef9('0x14')]=_0x5aee3b[_0x6ef9('0x14')];this[_0x6ef9('0x15')]=_0x5aee3b[_0x6ef9('0x15')];this[_0x6ef9('0x16')]=_0x5aee3b[_0x6ef9('0x16')];this[_0x6ef9('0x17')]=_0x5aee3b[_0x6ef9('0x17')];this['vtigerAccounts']=_0x5aee3b[_0x6ef9('0x18')];this[_0x6ef9('0x19')]=_0x5aee3b['servicenowAccounts'];this['dynamics365Accounts']=_0x5aee3b[_0x6ef9('0x1a')];this['freshsalesAccounts']=_0x5aee3b[_0x6ef9('0x1b')];this[_0x6ef9('0x1c')]={'zendesk':this[_0x6ef9('0x12')],'salesforce':this[_0x6ef9('0x14')],'freshdesk':this[_0x6ef9('0x13')],'sugarcrm':this[_0x6ef9('0x15')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this[_0x6ef9('0x18')],'dynamics365':this[_0x6ef9('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x6ef9('0x19')]};ami['on'](_0x6ef9('0x1d'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x20'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0x6ef9('0x22'),this['syncCustomEvent'][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x23'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x24'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on']('custom:agentcongestion',this[_0x6ef9('0x1e')]['bind'](this));ami['on'](_0x6ef9('0x25'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x26'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x27'),this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this['syncCustomEvent']['bind'](this));ami['on'](_0x6ef9('0x28'),this['syncAgentDial'][_0x6ef9('0x1f')](this));ami['on']('custom:dialconnect',this[_0x6ef9('0x29')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x2a'),this[_0x6ef9('0x29')]['bind'](this));ami['on'](_0x6ef9('0x2b'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on']('custom:closedinteraction',this[_0x6ef9('0x1e')]['bind'](this));ami['on'](_0x6ef9('0x2c'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on']('custom:incomingmessage',this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x2d'),this[_0x6ef9('0x1e')][_0x6ef9('0x1f')](this));ami['on'](_0x6ef9('0x2e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0x6ef9('0x1f')](this));}Trigger['prototype']['emit']=function(_0x115519,_0x457671,_0x58b547){logger[_0x6ef9('0x2f')](_0x115519,_0x457671,JSON['stringify'](_0x58b547));io['to'](_0x115519)['emit'](_0x457671,_0x58b547);};Trigger[_0x6ef9('0x30')][_0x6ef9('0x1e')]=function(_0x5a9b5e){var _0xd7dc38=_[_0x6ef9('0x31')](_0x5a9b5e);if(typeof _0xd7dc38[_0x6ef9('0x32')]==='undefined'){_0xd7dc38[_0x6ef9('0x32')]=_0x6ef9('0x33');}this[_0x6ef9('0x34')](_0xd7dc38);};Trigger[_0x6ef9('0x30')]['syncAgentDial']=function(_0x4533bc){if(this[_0x6ef9('0xe')][_0x4533bc['interface']]){this[_0x6ef9('0x1e')](_0x4533bc);}};Trigger[_0x6ef9('0x30')]['checkTriggers']=function(_0x11a45f){var _0x319d69;for(var _0x404af6 in this[_0x6ef9('0xd')]){if(this[_0x6ef9('0xd')][_0x6ef9('0x35')](_0x404af6)){if(this['triggers'][_0x404af6][_0x6ef9('0x36')]){_0x319d69=this[_0x6ef9('0x37')](this['triggers'][_0x404af6],_0x11a45f);if(_0x319d69){_[_0x6ef9('0x38')](_0x11a45f,_0x11a45f['variables']);for(var _0x12c8f6=0x0,_0x2629c2,_0x53add1,_0x412f1f;_0x12c8f60x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x326f,0xd1));var _0xf326=function(_0x5e5592,_0xc0252b){_0x5e5592=_0x5e5592-0x0;var _0x24b788=_0x326f[_0x5e5592];return _0x24b788;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ 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 a125062..f165882 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 _0xb176=['trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','data7','tenantId','data2','resolve','CloudProvider','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','userEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','username','internalemailaddress','userId','toLowerCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','4.0','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit'];(function(_0x1a9bdf,_0x43130a){var _0x61a042=function(_0x13fdf5){while(--_0x13fdf5){_0x1a9bdf['push'](_0x1a9bdf['shift']());}};_0x61a042(++_0x43130a);}(_0xb176,0x164));var _0x6b17=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xb176[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0x6b17('0x0'));var rp=require('request-promise');var util=require(_0x6b17('0x1'));var intUtil=require('./util');var md5=require(_0x6b17('0x2'));var Redis=require(_0x6b17('0x3'));var logger=require(_0x6b17('0x4'))(_0x6b17('0x5'));var config=require('../../../../config/environment');config[_0x6b17('0x6')]=_[_0x6b17('0x7')](config[_0x6b17('0x6')],{'host':_0x6b17('0x8'),'port':0x18eb});var io=require(_0x6b17('0x9'))(new Redis(config[_0x6b17('0x6')]));function getAuthToken(_0x2e46da,_0x560774,_0x1ef1d0){if(_0x2e46da[_0x6b17('0xa')]){_0x2e46da['remoteUri']=_0x2e46da['CloudProvider'][_0x6b17('0xb')];_0x2e46da[_0x6b17('0xc')]=_0x2e46da['CloudProvider'][_0x6b17('0xd')];return Promise[_0x6b17('0xe')](_0x2e46da[_0x6b17('0xf')]['data5']);}var _0x5ce029={'method':_0x6b17('0x10'),'uri':_0x560774,'form':{'client_id':_0x2e46da[_0x6b17('0x11')],'resource':_0x2e46da[_0x6b17('0x12')],'username':_0x2e46da['username'],'password':_0x2e46da[_0x6b17('0x13')],'grant_type':_0x6b17('0x13'),'client_secret':_0x2e46da[_0x6b17('0x14')]},'json':!![]};return rp(_0x5ce029)[_0x6b17('0x15')](function(_0x312ab4){return _0x312ab4[_0x6b17('0x16')];})[_0x6b17('0x17')](function(_0x3cf549){logger[_0x6b17('0x18')]('['+[_0x1ef1d0[_0x6b17('0x19')]()]+_0x6b17('0x1a'));return _0x3cf549[_0x6b17('0x1b')];});}function getUser(_0x5a0fb1,_0x8780b4,_0x58b804,_0x258477,_0x2a5ee3,_0x58f1ad){return new Promise(function(_0x1ed505,_0x4f69fb){return getAuthToken(_0x8780b4,_0x258477,_0x58f1ad)[_0x6b17('0x15')](function(_0x2a7a58){var _0x35fea2={'method':_0x6b17('0x1c'),'uri':_0x2a5ee3+_0x6b17('0x1d'),'headers':{'Authorization':'Bearer\x20'+_0x2a7a58,'OData-Version':'4.0'},'json':!![]};return rp(_0x35fea2);})['then'](function(_0x5ae4f3){var _0x35edbc=_0x5ae4f3[_0x6b17('0x1e')];var _0x1718c2=![];var _0x4d9dd6=null;if(!_[_0x6b17('0x1f')](_0x58b804)){if(intUtil[_0x6b17('0x20')](_0x58b804['email'])){_0x5a0fb1[_0x6b17('0x21')]=_0x58b804[_0x6b17('0x22')];for(_0x4d9dd6=0x0;_0x4d9dd6<_0x35edbc[_0x6b17('0x23')];_0x4d9dd6++){if(_0x35edbc[_0x4d9dd6]['internalemailaddress']===_0x58b804[_0x6b17('0x22')]&&!_0x35edbc[_0x4d9dd6][_0x6b17('0x24')]){_0x1718c2=!![];logger[_0x6b17('0x25')]('['+[_0x58f1ad[_0x6b17('0x19')]()]+_0x6b17('0x26')+_0x35edbc[_0x4d9dd6][_0x6b17('0x27')]+'!');_0x5a0fb1['userId']=_0x35edbc[_0x4d9dd6][_0x6b17('0x27')];}}}}if(!_0x1718c2){logger[_0x6b17('0x25')]('['+[_0x58f1ad['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x5a0fb1[_0x6b17('0x21')]=_0x8780b4[_0x6b17('0x28')];for(_0x4d9dd6=0x0;_0x4d9dd6<_0x35edbc[_0x6b17('0x23')];_0x4d9dd6++){if(_0x35edbc[_0x4d9dd6][_0x6b17('0x29')]===_0x8780b4['username']){_0x5a0fb1[_0x6b17('0x2a')]=_0x35edbc[_0x4d9dd6][_0x6b17('0x27')];}}}_0x1ed505(_0x5a0fb1);})[_0x6b17('0x17')](function(_0x154cdf){_0x4f69fb(_0x154cdf[_0x6b17('0x1b')]);});});}function createEndUser(_0x392054,_0x437bfb,_0x481c18,_0x23c50c,_0x418907,_0x5776a1){return new Promise(function(_0x1d31e7,_0x32d805){return getAuthToken(_0x437bfb,_0x481c18,_0x5776a1)[_0x6b17('0x15')](function(_0x545402){var _0x1c12ea=_0x5776a1[_0x6b17('0x2b')]()===_0x6b17('0x2c')?_0x418907['destcalleridnum']:_0x418907[_0x6b17('0x2d')];var _0x5d1af5={'method':_0x6b17('0x10'),'uri':_0x23c50c+_0x6b17('0x2e'),'body':{'telephone1':_0x1c12ea,'fullname':_0x1c12ea,'firstname':_0x1c12ea,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6b17('0x2f')+_0x392054[_0x6b17('0x2a')]+')'},'headers':{'Authorization':_0x6b17('0x30')+_0x545402,'OData-Version':_0x6b17('0x31')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5d1af5);})[_0x6b17('0x15')](function(_0x2e1337){var _0x142913=_0x2e1337[_0x6b17('0x32')][_0x6b17('0x33')];var _0x42c37d=_0x142913[_0x6b17('0x34')](_0x142913[_0x6b17('0x35')]('(')+0x1,_0x142913[_0x6b17('0x35')](')'));_0x392054[_0x6b17('0x36')]=_0x42c37d;_0x1d31e7(_0x392054);})[_0x6b17('0x17')](function(_0x1e9faa){_0x32d805(_0x1e9faa[_0x6b17('0x1b')]);});});}function getEndUser(_0x5b455c,_0x2748ac,_0x2caf19,_0x17c230,_0x2c7368,_0x431507,_0x401c1f){var _0x27f382=_0x431507[_0x6b17('0x2b')]()==='outbound'?_0x2c7368['destcalleridnum']:_0x2c7368['calleridnum'];return getAuthToken(_0x2748ac,_0x2caf19,_0x431507)[_0x6b17('0x15')](function(_0x50d581){var _0x679af={'method':_0x6b17('0x1c'),'uri':_0x17c230+_0x6b17('0x37')+_0x27f382[_0x6b17('0x38')]('+',_0x6b17('0x39'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x50d581,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x679af);})['then'](function(_0x523df2){var _0x3ff8e4=![];if(!_0x523df2)return _0x3ff8e4;var _0x371e31=_0x523df2['value'];for(var _0x4d8cc9=0x0;_0x4d8cc9<_0x371e31[_0x6b17('0x23')];_0x4d8cc9++){if(_0x371e31[_0x4d8cc9][_0x6b17('0x3a')]===_0x27f382){_0x3ff8e4=!![];_0x5b455c['enduserId']=_0x371e31[_0x4d8cc9][_0x6b17('0x3b')];}}return _0x3ff8e4;})[_0x6b17('0x15')](function(_0x23d47e){if(_0x23d47e)return _0x5b455c;if(_0x401c1f===_0x6b17('0x3c')){logger[_0x6b17('0x25')]('['+[_0x431507[_0x6b17('0x19')]()]+_0x6b17('0x3d'));return _0x5b455c;}return createEndUser(_0x5b455c,_0x2748ac,_0x2caf19,_0x17c230,_0x2c7368,_0x431507)[_0x6b17('0x15')](function(_0x5aa601){logger[_0x6b17('0x25')]('['+[_0x431507[_0x6b17('0x19')]()]+_0x6b17('0x3e'),_0x5aa601[_0x6b17('0x36')]);return _0x5aa601;});});}function getCustomFields(_0x3e821e,_0x4928c8,_0x53cb2b){var _0x420261={};if(_0x3e821e['length']>0x0){_[_0x6b17('0x3f')](_0x3e821e,function(_0x2dff4f){if(_[_0x6b17('0x40')]([_0x6b17('0x41'),_0x6b17('0x42')],_0x2dff4f[_0x6b17('0x43')])&&_0x2dff4f[_0x6b17('0x44')]&&!_0x2dff4f['customField']){var _0x4822d7=_0x2dff4f[_0x6b17('0x45')][_0x6b17('0x2b')]();var _0x144847=_0x4822d7['substring'](0x0,_0x4822d7['indexOf']('_'));var _0x4acaed=_0x4822d7[_0x6b17('0x34')](_0x4822d7[_0x6b17('0x46')]('_')+0x1);if(_0x144847===_0x53cb2b){_0x420261[_0x4acaed]=_0x2dff4f[_0x6b17('0x47')];}}});}return _0x420261;}function getTicket(_0x5a8d2f,_0x133489,_0x4cf2b5,_0x257f4c,_0xf3896c,_0xabbc61,_0x3bdf4e){return new Promise(function(_0x4781fd,_0x2d1824){var _0x246482;return getAuthToken(_0x133489,_0x4cf2b5,_0x3bdf4e)['then'](function(_0xc63c97){if(_0xabbc61[_0x6b17('0x48')]===_0x6b17('0x49')){_0x246482={'method':_0x6b17('0x10'),'uri':_0x257f4c+'incidents','body':Object['assign']({},{'title':intUtil[_0x6b17('0x4a')](_0xabbc61[_0x6b17('0x4b')],_0xf3896c,'\x20'),'description':intUtil[_0x6b17('0x4a')](_0xabbc61[_0x6b17('0x4c')],_0xf3896c,'\x0a'),'customerid_contact@odata.bind':_0x5a8d2f['enduserId']?_0x6b17('0x4d')+_0x5a8d2f[_0x6b17('0x36')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x5a8d2f['userId']+')','caseorigincode':'1'},getCustomFields(_0xabbc61[_0x6b17('0x4e')],_0xf3896c,_0xabbc61[_0x6b17('0x48')])),'headers':{'Authorization':_0x6b17('0x30')+_0xc63c97,'OData-Version':_0x6b17('0x31')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xabbc61[_0x6b17('0x48')]===_0x6b17('0x4f')){var _0x2fa7e9=_0x5a8d2f[_0x6b17('0x36')]?[{'partyid_systemuser@odata.bind':_0x6b17('0x2f')+_0x5a8d2f[_0x6b17('0x2a')]+')','participationtypemask':_0x5a8d2f[_0x6b17('0x50')]===_0x6b17('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0x6b17('0x4d')+_0x5a8d2f[_0x6b17('0x36')]+')','participationtypemask':_0x5a8d2f['callDirection']===_0x6b17('0x51')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6b17('0x2f')+_0x5a8d2f['userId']+')','participationtypemask':_0x5a8d2f[_0x6b17('0x50')]==='queue'?0x2:0x1}];_0x246482={'method':'POST','uri':_0x257f4c+_0x6b17('0x52'),'body':Object[_0x6b17('0x53')]({},{'subject':intUtil[_0x6b17('0x4a')](_0xabbc61[_0x6b17('0x4b')],_0xf3896c,'\x20'),'phonenumber':String(_0xf3896c[_0x6b17('0x2d')]),'description':intUtil[_0x6b17('0x4a')](_0xabbc61[_0x6b17('0x4c')],_0xf3896c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5a8d2f[_0x6b17('0x36')]?_0x6b17('0x4d')+_0x5a8d2f['enduserId']+')':undefined,'ownerid@odata.bind':_0x6b17('0x2f')+_0x5a8d2f['userId']+')','directioncode':_0x5a8d2f['callDirection']===_0x6b17('0x51')?![]:!![],'phonecall_activity_parties':_0x2fa7e9},getCustomFields(_0xabbc61[_0x6b17('0x4e')],_0xf3896c,_0xabbc61[_0x6b17('0x48')])),'headers':{'Authorization':_0x6b17('0x30')+_0xc63c97,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x246482);})[_0x6b17('0x15')](function(_0x3cb733){var _0x48051d=_0x3cb733['headers'][_0x6b17('0x33')];var _0x271d9a=_0x48051d[_0x6b17('0x34')](_0x48051d[_0x6b17('0x35')]('(')+0x1,_0x48051d['lastIndexOf'](')'));_0x5a8d2f['ticketId']=_0x271d9a;_0x4781fd(_0x5a8d2f);})[_0x6b17('0x17')](function(_0x2f00ad){_0x2d1824(_0x2f00ad[_0x6b17('0x1b')]);});});}function emit(_0xd1d5a6,_0x5475c3,_0x34241a,_0x580db6){var _0x42da49={'uri':util[_0x6b17('0x54')](_0x6b17('0x55'),_0xd1d5a6,_0x34241a,_0x580db6)};io['to'](util[_0x6b17('0x54')](_0x6b17('0x56'),_0x5475c3))[_0x6b17('0x57')](_0x6b17('0x58'),_0x42da49);}exports['cs']=function(_0x586de0,_0x58613a,_0x1ea63d,_0x38a711,_0x34f9ca,_0x11891b,_0x54e21e,_0x466a86){var _0x3cad6a={};_0x11891b[_0x6b17('0x12')]=_0x11891b[_0x6b17('0xa')]?intUtil[_0x6b17('0x59')](_0x11891b['CloudProvider'][_0x6b17('0xb')]):intUtil[_0x6b17('0x59')](_0x11891b[_0x6b17('0x12')]);_0x11891b[_0x6b17('0x5a')]=intUtil[_0x6b17('0x59')](_0x11891b['serverUrl']);_0x3cad6a[_0x6b17('0x50')]=_0x466a86===_0x6b17('0x51')||_0x466a86===_0x6b17('0x5b')?_0x6b17('0x51'):_0x6b17('0x2c');var _0x25135a=_0x11891b[_0x6b17('0xa')]?util[_0x6b17('0x54')](_0x6b17('0x5c'),_0x11891b[_0x6b17('0xf')][_0x6b17('0xb')]):util['format'](_0x6b17('0x5c'),_0x11891b[_0x6b17('0x12')]);var _0x8628d5=util[_0x6b17('0x54')]('https://login.microsoftonline.com/%s/oauth2/token',_0x11891b[_0x6b17('0xc')]);var _0x3a9279=util['format'](_0x6b17('0x5d'),_0x11891b[_0x6b17('0x5a')],_0x58613a[_0x6b17('0x5e')],md5(_0x58613a[_0x6b17('0x5e')]));if(_0x34f9ca&&_0x34f9ca[_0x6b17('0x5f')]){logger['info'](_0x6b17('0x60'),'Recording\x20is\x20enabled!');_0x58613a['recordingURL']=_0x3a9279;}else if(_0x54e21e&&_0x54e21e[_0x6b17('0x61')]&&_0x54e21e['recordingFormat']!==_0x6b17('0x62')){logger[_0x6b17('0x25')](_0x6b17('0x63'),_0x6b17('0x64'));_0x58613a[_0x6b17('0x65')]=_0x3a9279;}else{_0x58613a[_0x6b17('0x65')]='';}return getUser(_0x3cad6a,_0x11891b,_0x38a711,_0x8628d5,_0x25135a,_0x466a86)[_0x6b17('0x15')](function(_0x1d998e){logger[_0x6b17('0x25')]('['+_0x466a86[_0x6b17('0x19')]()+_0x6b17('0x66'),_0x1d998e[_0x6b17('0x2a')]);logger['info']('['+_0x466a86[_0x6b17('0x19')]()+_0x6b17('0x67'),_0x1d998e['userEmail']);return getEndUser(_0x1d998e,_0x11891b,_0x8628d5,_0x25135a,_0x58613a,_0x466a86,_0x1ea63d[_0x6b17('0x68')]);})['then'](function(_0x2808b9){logger[_0x6b17('0x25')]('['+_0x466a86['toUpperCase']()+_0x6b17('0x69'),_0x2808b9[_0x6b17('0x36')]);logger[_0x6b17('0x25')]('['+_0x466a86[_0x6b17('0x19')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x58613a[_0x6b17('0x2d')]);return getTicket(_0x2808b9,_0x11891b,_0x8628d5,_0x25135a,_0x58613a,_0x1ea63d,_0x466a86);})['then'](function(_0x7ed64b){logger[_0x6b17('0x25')](util[_0x6b17('0x54')]('['+_0x466a86[_0x6b17('0x19')]()+_0x6b17('0x6a'),_0x1ea63d[_0x6b17('0x48')],_0x7ed64b['ticketId']));logger[_0x6b17('0x25')](util[_0x6b17('0x54')]('['+_0x466a86[_0x6b17('0x19')]()+_0x6b17('0x6b'),_0x466a86));if(_0x466a86!==_0x6b17('0x5b')){logger['info']('['+_0x466a86[_0x6b17('0x19')]()+']',_0x6b17('0x6c'));emit(_0x11891b['remoteUri'],_0x38a711[_0x6b17('0x6d')],_0x1ea63d[_0x6b17('0x48')],_0x7ed64b['ticketId']);}})[_0x6b17('0x17')](function(_0x3721a1){logger['error']('['+_0x466a86[_0x6b17('0x19')]()+_0x6b17('0x6e'),_0x3721a1[_0x6b17('0x1b')]);});}; \ No newline at end of file +var _0xb694=['enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','value','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','customField','idField','substring','indexOf','ticketType','incidents','assign','getString','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','ticketId',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','username','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info','length','internalemailaddress','catch','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf'];(function(_0x418402,_0x59d1f7){var _0xda4459=function(_0x43dade){while(--_0x43dade){_0x418402['push'](_0x418402['shift']());}};_0xda4459(++_0x59d1f7);}(_0xb694,0x10e));var _0x4b69=function(_0xa32784,_0x2fc279){_0xa32784=_0xa32784-0x0;var _0x236891=_0xb694[_0xa32784];return _0x236891;};'use strict';var _=require(_0x4b69('0x0'));var rp=require(_0x4b69('0x1'));var util=require(_0x4b69('0x2'));var intUtil=require(_0x4b69('0x3'));var md5=require(_0x4b69('0x4'));var Redis=require(_0x4b69('0x5'));var logger=require(_0x4b69('0x6'))(_0x4b69('0x7'));var config=require(_0x4b69('0x8'));config[_0x4b69('0x9')]=_[_0x4b69('0xa')](config[_0x4b69('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x2536cc,_0x4cd029,_0x2db6fe){if(_0x2536cc[_0x4b69('0xb')]){_0x2536cc[_0x4b69('0xc')]=_0x2536cc[_0x4b69('0xd')][_0x4b69('0xe')];_0x2536cc[_0x4b69('0xf')]=_0x2536cc[_0x4b69('0xd')][_0x4b69('0x10')];return Promise[_0x4b69('0x11')](_0x2536cc[_0x4b69('0xd')][_0x4b69('0x12')]);}var _0x230edd={'method':_0x4b69('0x13'),'uri':_0x4cd029,'form':{'client_id':_0x2536cc['clientId'],'resource':_0x2536cc['remoteUri'],'username':_0x2536cc[_0x4b69('0x14')],'password':_0x2536cc['password'],'grant_type':_0x4b69('0x15'),'client_secret':_0x2536cc['clientSecret']},'json':!![]};return rp(_0x230edd)[_0x4b69('0x16')](function(_0x3c1f3f){return _0x3c1f3f[_0x4b69('0x17')];})['catch'](function(_0x50628b){logger[_0x4b69('0x18')]('['+[_0x2db6fe[_0x4b69('0x19')]()]+_0x4b69('0x1a'));return _0x50628b[_0x4b69('0x1b')];});}function getUser(_0x539170,_0x25c173,_0x275a26,_0x2a438d,_0x5f314a,_0x3b186b){return new Promise(function(_0x2096f7,_0x5ed03d){return getAuthToken(_0x25c173,_0x2a438d,_0x3b186b)[_0x4b69('0x16')](function(_0x17a5d1){var _0x283355={'method':_0x4b69('0x1c'),'uri':_0x5f314a+_0x4b69('0x1d'),'headers':{'Authorization':_0x4b69('0x1e')+_0x17a5d1,'OData-Version':_0x4b69('0x1f')},'json':!![]};return rp(_0x283355);})[_0x4b69('0x16')](function(_0x3f6045){var _0x4fce65=_0x3f6045['value'];var _0x316390=![];var _0x246b73=null;if(!_[_0x4b69('0x20')](_0x275a26)){if(intUtil[_0x4b69('0x21')](_0x275a26[_0x4b69('0x22')])){_0x539170[_0x4b69('0x23')]=_0x275a26[_0x4b69('0x22')];for(_0x246b73=0x0;_0x246b73<_0x4fce65['length'];_0x246b73++){if(_0x4fce65[_0x246b73]['internalemailaddress']===_0x275a26[_0x4b69('0x22')]&&!_0x4fce65[_0x246b73][_0x4b69('0x24')]){_0x316390=!![];logger['info']('['+[_0x3b186b[_0x4b69('0x19')]()]+_0x4b69('0x25')+_0x4fce65[_0x246b73][_0x4b69('0x26')]+'!');_0x539170[_0x4b69('0x27')]=_0x4fce65[_0x246b73][_0x4b69('0x26')];}}}}if(!_0x316390){logger[_0x4b69('0x28')]('['+[_0x3b186b['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x539170['userEmail']=_0x25c173['username'];for(_0x246b73=0x0;_0x246b73<_0x4fce65[_0x4b69('0x29')];_0x246b73++){if(_0x4fce65[_0x246b73][_0x4b69('0x2a')]===_0x25c173[_0x4b69('0x14')]){_0x539170[_0x4b69('0x27')]=_0x4fce65[_0x246b73][_0x4b69('0x26')];}}}_0x2096f7(_0x539170);})[_0x4b69('0x2b')](function(_0x5d467c){_0x5ed03d(_0x5d467c['message']);});});}function createEndUser(_0x166781,_0x341870,_0x229885,_0x5cf026,_0x4b7e63,_0x6a63e0){return new Promise(function(_0x57c8b4,_0x4e324e){return getAuthToken(_0x341870,_0x229885,_0x6a63e0)['then'](function(_0x550c2b){var _0x556b14=_0x6a63e0['toLowerCase']()===_0x4b69('0x2c')?_0x4b7e63['destcalleridnum']:_0x4b7e63[_0x4b69('0x2d')];var _0x147828={'method':_0x4b69('0x13'),'uri':_0x5cf026+_0x4b69('0x2e'),'body':{'telephone1':_0x556b14,'fullname':_0x556b14,'firstname':_0x556b14,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4b69('0x2f')+_0x166781[_0x4b69('0x27')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x550c2b,'OData-Version':_0x4b69('0x1f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x147828);})[_0x4b69('0x16')](function(_0x52e575){var _0xd62de5=_0x52e575[_0x4b69('0x30')][_0x4b69('0x31')];var _0x5d0288=_0xd62de5['substring'](_0xd62de5[_0x4b69('0x32')]('(')+0x1,_0xd62de5['lastIndexOf'](')'));_0x166781[_0x4b69('0x33')]=_0x5d0288;_0x57c8b4(_0x166781);})['catch'](function(_0x182c39){_0x4e324e(_0x182c39['message']);});});}function getEndUser(_0x40abd8,_0x3b487c,_0x3279c6,_0x420cd3,_0x588780,_0x5371e2,_0x3e7c56){var _0x4b989d=_0x5371e2[_0x4b69('0x34')]()===_0x4b69('0x2c')?_0x588780['destcalleridnum']:_0x588780[_0x4b69('0x2d')];return getAuthToken(_0x3b487c,_0x3279c6,_0x5371e2)['then'](function(_0x2b7eef){var _0x1b1f74={'method':_0x4b69('0x1c'),'uri':_0x420cd3+_0x4b69('0x35')+_0x4b989d[_0x4b69('0x36')]('+',_0x4b69('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x2b7eef,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b1f74);})['then'](function(_0x457ec5){var _0x1f4c62=![];if(!_0x457ec5)return _0x1f4c62;var _0x59fcb4=_0x457ec5[_0x4b69('0x38')];for(var _0x1da9d0=0x0;_0x1da9d0<_0x59fcb4[_0x4b69('0x29')];_0x1da9d0++){if(_0x59fcb4[_0x1da9d0][_0x4b69('0x39')]===_0x4b989d){_0x1f4c62=!![];_0x40abd8['enduserId']=_0x59fcb4[_0x1da9d0][_0x4b69('0x3a')];}}return _0x1f4c62;})[_0x4b69('0x16')](function(_0x46cb92){if(_0x46cb92)return _0x40abd8;if(_0x3e7c56===_0x4b69('0x3b')){logger[_0x4b69('0x28')]('['+[_0x5371e2[_0x4b69('0x19')]()]+_0x4b69('0x3c'));return _0x40abd8;}return createEndUser(_0x40abd8,_0x3b487c,_0x3279c6,_0x420cd3,_0x588780,_0x5371e2)['then'](function(_0x58ea55){logger[_0x4b69('0x28')]('['+[_0x5371e2[_0x4b69('0x19')]()]+_0x4b69('0x3d'),_0x58ea55['enduserId']);return _0x58ea55;});});}function getCustomFields(_0x271adb,_0x4f4bb3,_0x201527){var _0x286f39={};if(_0x271adb[_0x4b69('0x29')]>0x0){_['forEach'](_0x271adb,function(_0x48f8a7){if(_[_0x4b69('0x3e')]([_0x4b69('0x3f'),_0x4b69('0x40')],_0x48f8a7[_0x4b69('0x41')])&&_0x48f8a7[_0x4b69('0x42')]&&!_0x48f8a7[_0x4b69('0x43')]){var _0x2a115c=_0x48f8a7[_0x4b69('0x44')][_0x4b69('0x34')]();var _0x2fd8c8=_0x2a115c[_0x4b69('0x45')](0x0,_0x2a115c['indexOf']('_'));var _0x79b322=_0x2a115c[_0x4b69('0x45')](_0x2a115c[_0x4b69('0x46')]('_')+0x1);if(_0x2fd8c8===_0x201527){_0x286f39[_0x79b322]=_0x48f8a7['content'];}}});}return _0x286f39;}function getTicket(_0x489fd4,_0x4a3f60,_0x49051c,_0x487681,_0x330576,_0x35d068,_0x832e2a){return new Promise(function(_0x2c6541,_0x2be865){var _0x186ee8;return getAuthToken(_0x4a3f60,_0x49051c,_0x832e2a)[_0x4b69('0x16')](function(_0x57f3d6){if(_0x35d068[_0x4b69('0x47')]==='incident'){_0x186ee8={'method':_0x4b69('0x13'),'uri':_0x487681+_0x4b69('0x48'),'body':Object[_0x4b69('0x49')]({},{'title':intUtil['getString'](_0x35d068['Subjects'],_0x330576,'\x20'),'description':intUtil[_0x4b69('0x4a')](_0x35d068[_0x4b69('0x4b')],_0x330576,'\x0a'),'customerid_contact@odata.bind':_0x489fd4['enduserId']?'/contacts('+_0x489fd4['enduserId']+')':undefined,'ownerid@odata.bind':_0x4b69('0x2f')+_0x489fd4['userId']+')','caseorigincode':'1'},getCustomFields(_0x35d068[_0x4b69('0x4c')],_0x330576,_0x35d068[_0x4b69('0x47')])),'headers':{'Authorization':_0x4b69('0x1e')+_0x57f3d6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x35d068[_0x4b69('0x47')]===_0x4b69('0x4d')){var _0x481fa7=_0x489fd4[_0x4b69('0x33')]?[{'partyid_systemuser@odata.bind':_0x4b69('0x2f')+_0x489fd4[_0x4b69('0x27')]+')','participationtypemask':_0x489fd4[_0x4b69('0x4e')]===_0x4b69('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0x4b69('0x50')+_0x489fd4['enduserId']+')','participationtypemask':_0x489fd4[_0x4b69('0x4e')]===_0x4b69('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x4b69('0x2f')+_0x489fd4[_0x4b69('0x27')]+')','participationtypemask':_0x489fd4[_0x4b69('0x4e')]===_0x4b69('0x4f')?0x2:0x1}];_0x186ee8={'method':_0x4b69('0x13'),'uri':_0x487681+'phonecalls','body':Object[_0x4b69('0x49')]({},{'subject':intUtil[_0x4b69('0x4a')](_0x35d068['Subjects'],_0x330576,'\x20'),'phonenumber':String(_0x330576['calleridnum']),'description':intUtil[_0x4b69('0x4a')](_0x35d068[_0x4b69('0x4b')],_0x330576,'\x0a'),'regardingobjectid_contact@odata.bind':_0x489fd4[_0x4b69('0x33')]?_0x4b69('0x50')+_0x489fd4[_0x4b69('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x489fd4['userId']+')','directioncode':_0x489fd4['callDirection']===_0x4b69('0x4f')?![]:!![],'phonecall_activity_parties':_0x481fa7},getCustomFields(_0x35d068[_0x4b69('0x4c')],_0x330576,_0x35d068[_0x4b69('0x47')])),'headers':{'Authorization':_0x4b69('0x1e')+_0x57f3d6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x186ee8);})['then'](function(_0x48fc36){var _0x1972e6=_0x48fc36['headers']['odata-entityid'];var _0x2d09f8=_0x1972e6[_0x4b69('0x45')](_0x1972e6[_0x4b69('0x32')]('(')+0x1,_0x1972e6['lastIndexOf'](')'));_0x489fd4['ticketId']=_0x2d09f8;_0x2c6541(_0x489fd4);})[_0x4b69('0x2b')](function(_0x31df52){_0x2be865(_0x31df52[_0x4b69('0x1b')]);});});}function emit(_0x39fbc3,_0x3ff8f3,_0x31ee1a,_0x3ddc44){var _0x47dc80={'uri':util[_0x4b69('0x51')](_0x4b69('0x52'),_0x39fbc3,_0x31ee1a,_0x3ddc44)};io['to'](util['format'](_0x4b69('0x53'),_0x3ff8f3))[_0x4b69('0x54')]('trigger:browser:url',_0x47dc80);}exports['cs']=function(_0x260cce,_0x447bba,_0x2124ec,_0x4d0b0d,_0x5f212f,_0x3b0a3a,_0x4a1883,_0x30bc99){var _0x467bc0={};_0x3b0a3a[_0x4b69('0xc')]=_0x3b0a3a[_0x4b69('0xb')]?intUtil['stripTrailingSlash'](_0x3b0a3a[_0x4b69('0xd')]['data7']):intUtil[_0x4b69('0x55')](_0x3b0a3a['remoteUri']);_0x3b0a3a[_0x4b69('0x56')]=intUtil['stripTrailingSlash'](_0x3b0a3a[_0x4b69('0x56')]);_0x467bc0[_0x4b69('0x4e')]=_0x30bc99===_0x4b69('0x4f')||_0x30bc99==='unmanaged'?_0x4b69('0x4f'):'outbound';var _0x4eb6a4=_0x3b0a3a[_0x4b69('0xb')]?util['format'](_0x4b69('0x57'),_0x3b0a3a[_0x4b69('0xd')]['data7']):util[_0x4b69('0x51')]('%s/api/data/v9.0/',_0x3b0a3a[_0x4b69('0xc')]);var _0xa23cef=util[_0x4b69('0x51')](_0x4b69('0x58'),_0x3b0a3a['tenantId']);var _0x57934c=util[_0x4b69('0x51')](_0x4b69('0x59'),_0x3b0a3a['serverUrl'],_0x447bba[_0x4b69('0x5a')],md5(_0x447bba[_0x4b69('0x5a')]));if(_0x5f212f&&_0x5f212f[_0x4b69('0x5b')]){logger[_0x4b69('0x28')](_0x4b69('0x5c'),'Recording\x20is\x20enabled!');_0x447bba['recordingURL']=_0x57934c;}else if(_0x4a1883&&_0x4a1883[_0x4b69('0x5d')]&&_0x4a1883[_0x4b69('0x5d')]!=='none'){logger[_0x4b69('0x28')]('[OUTBOUND]',_0x4b69('0x5e'));_0x447bba['recordingURL']=_0x57934c;}else{_0x447bba[_0x4b69('0x5f')]='';}return getUser(_0x467bc0,_0x3b0a3a,_0x4d0b0d,_0xa23cef,_0x4eb6a4,_0x30bc99)['then'](function(_0xa902d3){logger['info']('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x60'),_0xa902d3[_0x4b69('0x27')]);logger[_0x4b69('0x28')]('['+_0x30bc99['toUpperCase']()+_0x4b69('0x61'),_0xa902d3[_0x4b69('0x23')]);return getEndUser(_0xa902d3,_0x3b0a3a,_0xa23cef,_0x4eb6a4,_0x447bba,_0x30bc99,_0x2124ec['moduleCreate']);})[_0x4b69('0x16')](function(_0x347575){logger['info']('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x62'),_0x347575[_0x4b69('0x33')]);logger['info']('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x63'),_0x447bba[_0x4b69('0x2d')]);return getTicket(_0x347575,_0x3b0a3a,_0xa23cef,_0x4eb6a4,_0x447bba,_0x2124ec,_0x30bc99);})['then'](function(_0x247331){logger[_0x4b69('0x28')](util[_0x4b69('0x51')]('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x64'),_0x2124ec['ticketType'],_0x247331['ticketId']));logger[_0x4b69('0x28')](util[_0x4b69('0x51')]('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x65'),_0x30bc99));if(_0x30bc99!==_0x4b69('0x66')){logger[_0x4b69('0x28')]('['+_0x30bc99[_0x4b69('0x19')]()+']',_0x4b69('0x67'));emit(_0x3b0a3a[_0x4b69('0xc')],_0x4d0b0d[_0x4b69('0x68')],_0x2124ec['ticketType'],_0x247331[_0x4b69('0x69')]);}})[_0x4b69('0x2b')](function(_0xff7168){logger[_0x4b69('0x18')]('['+_0x30bc99[_0x4b69('0x19')]()+_0x4b69('0x6a'),_0xff7168[_0x4b69('0x1b')]);});}; \ 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 6a4da20..55a6099 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 _0xc53e=['content','type','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','unmanaged','lastevent','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','name','custom_fields','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','stringify','includes','string','picklist','nameField','customField','toLowerCase'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xc53e,0x11c));var _0xec53=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xc53e[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var rp=require(_0xec53('0x0'));var md5=require('md5');var util=require(_0xec53('0x1'));var Redis=require(_0xec53('0x2'));var intUtil=require(_0xec53('0x3'));var config=require(_0xec53('0x4'));var logger=require(_0xec53('0x5'))(_0xec53('0x6'));config[_0xec53('0x7')]=_[_0xec53('0x8')](config[_0xec53('0x7')],{'host':_0xec53('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec53('0x7')]));var headers={'Content-Type':_0xec53('0xa'),'Accept':_0xec53('0xa')};function emit(_0x228648,_0x4553a2,_0x29a4db){io['to'](_0x228648)[_0xec53('0xb')](_0x4553a2,_0x29a4db);}function getTicket(_0x4bbe28,_0xe76894,_0x551e60,_0x217db9,_0x55c758){logger[_0xec53('0xc')]('Creating\x20new\x20ticket...');var _0x3139e6=_[_0xec53('0xd')]({'responder_id':_0xe76894['id'],'requester_id':_0x551e60['id'],'name':util[_0xec53('0xe')](_0xec53('0xf'),_0x55c758[_0xec53('0x10')]),'phone':_0x55c758[_0xec53('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x217db9[_0xec53('0x12')],_0x55c758,'\x20'),'description':intUtil[_0xec53('0x13')](_0x217db9[_0xec53('0x14')],_0x55c758,_0xec53('0x15')),'tags':getTags(_0x217db9['Tags'],_0xec53('0x16'))},getCustomFields(_0x217db9['Fields'],_0x55c758));_0x3139e6[_0xec53('0x17')]=_['mapValues'](_['keyBy'](_0x3139e6[_0xec53('0x17')],'id'),'value');return request({'uri':util['format']('%s/api/v2/tickets',_0x4bbe28[_0xec53('0x18')]),'method':_0xec53('0x19'),'body':_0x3139e6})[_0xec53('0x1a')](function(_0x1c97c5){logger[_0xec53('0xc')](_0xec53('0x1b'));return _0x1c97c5;});}function getUser(_0x1ca3db,_0x35b943){if(intUtil['validateEmail'](_0x35b943)){return request({'uri':util[_0xec53('0xe')](_0xec53('0x1c'),_0x1ca3db[_0xec53('0x18')]),'qs':{'email':_0x35b943}})[_0xec53('0x1a')](function(_0x30482d){if(_0x30482d[_0xec53('0x1d')]){logger[_0xec53('0xc')](_0xec53('0x1e'));return _[_0xec53('0x1f')](_0x30482d,function(_0x52cf43){return _0x52cf43[_0xec53('0x20')][_0xec53('0x21')]===_0x35b943;});}else{logger[_0xec53('0xc')](_0xec53('0x22'));return request({'uri':util[_0xec53('0xe')](_0xec53('0x23'),_0x1ca3db[_0xec53('0x18')])})['then'](function(_0x55f1df){logger['info']('Admin\x20account\x20selected.');return _0x55f1df;});}});}else{logger[_0xec53('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xec53('0x23'),_0x1ca3db['remoteUri'])})[_0xec53('0x1a')](function(_0x1a1bd7){logger[_0xec53('0xc')]('Admin\x20account\x20selected.');return _0x1a1bd7;});}}function getEndUser(_0x5b3bd3,_0x1c1a8a,_0x11375e){logger[_0xec53('0xc')](_0xec53('0x24'),_0x11375e);return request({'uri':util[_0xec53('0xe')](_0xec53('0x25'),_0x5b3bd3[_0xec53('0x18')]),'qs':{'phone':_0x11375e}})[_0xec53('0x1a')](function(_0x2eed1c){if(_0x2eed1c[_0xec53('0x1d')]){logger['info'](_0xec53('0x26'));return _['find'](_0x2eed1c,{'phone':_0x11375e});}else{logger['info'](_0xec53('0x27'));return request({'uri':util['format'](_0xec53('0x25'),_0x5b3bd3[_0xec53('0x18')]),'method':_0xec53('0x19'),'body':{'name':_0x1c1a8a,'phone':_0x11375e}})['then'](function(_0x1616a4){logger[_0xec53('0xc')](_0xec53('0x28'));return _0x1616a4;});}});}function getAuth(_0x493a80){return util[_0xec53('0xe')](_0xec53('0x29'),new Buffer(_0x493a80[_0xec53('0x2a')]+':X')[_0xec53('0x2b')](_0xec53('0x2c')));}function request(_0x10e39f){logger['debug']('[HTTP]',JSON[_0xec53('0x2d')](_0x10e39f));return rp(_[_0xec53('0x8')](_0x10e39f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x12688c,_0x14b653){var _0x276e16=[];if(_0x12688c&&_0x12688c[_0xec53('0x1d')]>0x0){_0x276e16=_['map'](_0x12688c,_0x14b653);}return _0x276e16;}function getCustomFields(_0x723adc,_0x113b8e){var _0x2b1e39=[];var _0x1990dc={'custom_fields':[]};if(_0x723adc[_0xec53('0x1d')]>0x0){_['forEach'](_0x723adc,function(_0x168fb2){if(_[_0xec53('0x2e')]([_0xec53('0x2f'),_0xec53('0x30')],_0x168fb2['type'])&&_0x168fb2[_0xec53('0x31')]&&!_0x168fb2[_0xec53('0x32')]){_0x1990dc[_0x168fb2[_0xec53('0x31')][_0xec53('0x33')]()]=_0x168fb2[_0xec53('0x34')][_0xec53('0x2b')]();}else if(_[_0xec53('0x2e')]([_0xec53('0x2f'),_0xec53('0x30')],_0x168fb2[_0xec53('0x35')])&&_0x168fb2[_0xec53('0x36')]&&_0x168fb2[_0xec53('0x32')]){_0x1990dc[_0xec53('0x17')][_0xec53('0x37')]({'id':_0x168fb2[_0xec53('0x36')],'value':_0x168fb2[_0xec53('0x34')][_0xec53('0x2b')]()});}else if(_0x168fb2[_0xec53('0x35')]===_0xec53('0x38')&&_0x168fb2[_0xec53('0x39')]&&_0x168fb2['idField']&&_0x168fb2['customField']){_0x113b8e[_0x168fb2[_0xec53('0x39')]]&&_0x1990dc['custom_fields']['push']({'id':_0x168fb2[_0xec53('0x36')],'value':_0x113b8e[_0x168fb2[_0xec53('0x39')]]['toString']()});}else if(_0x168fb2['type']===_0xec53('0x3a')&&_0x168fb2[_0xec53('0x3b')]&&_0x168fb2[_0xec53('0x3b')][_0xec53('0x16')]&&_0x168fb2[_0xec53('0x36')]&&_0x168fb2[_0xec53('0x32')]){_0x113b8e[_0x168fb2[_0xec53('0x3b')][_0xec53('0x16')][_0xec53('0x33')]()]&&_0x1990dc[_0xec53('0x17')][_0xec53('0x37')]({'id':_0x168fb2[_0xec53('0x36')],'value':_0x113b8e[_0x168fb2[_0xec53('0x3b')][_0xec53('0x16')][_0xec53('0x33')]()][_0xec53('0x2b')]()});}});}return _0x1990dc;}exports[_0xec53('0x3c')]=function(_0x1128ed,_0x577403,_0x1ae71b,_0x322483,_0x56941d,_0x21f063){var _0x76f812,_0x229f0c;_0x21f063[_0xec53('0x18')]=intUtil[_0xec53('0x3d')](_0x21f063[_0xec53('0x18')]);_0x21f063[_0xec53('0x3e')]=intUtil[_0xec53('0x3d')](_0x21f063['serverUrl']);if(_0x56941d&&_0x56941d['monitor_format']){logger[_0xec53('0xc')](_0xec53('0x3f'),_0xec53('0x40'));_0x577403[_0xec53('0x41')]=util['format'](_0xec53('0x42'),_0x21f063[_0xec53('0x3e')],_0x577403['uniqueid'],md5(_0x577403[_0xec53('0x43')]));}else{_0x577403[_0xec53('0x41')]='';}headers[_0xec53('0x44')]=getAuth(_0x21f063);return getUser(_0x21f063,_0x322483[_0xec53('0x21')])['then'](function(_0x48445f){_0x76f812=_0x48445f;logger[_0xec53('0xc')](_0xec53('0x45'),_0x76f812['id']);return getEndUser(_0x21f063,_0x577403['calleridname'],_0x577403[_0xec53('0x11')]);})[_0xec53('0x1a')](function(_0x319496){_0x229f0c=_0x319496;logger[_0xec53('0xc')](_0xec53('0x46'),_0x229f0c['id']);return getTicket(_0x21f063,_0x76f812,_0x229f0c,_0x1ae71b,_0x577403);})[_0xec53('0x1a')](function(_0x2165c8){if(_0x2165c8&&_0x2165c8['id']){logger[_0xec53('0xc')]('Ticket\x20created!');logger[_0xec53('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2165c8['id']);logger['info'](_0xec53('0x3f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xec53('0xe')](_0xec53('0x47'),_0x322483[_0xec53('0x16')]),_0xec53('0x48'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x21f063[_0xec53('0x18')],_0x2165c8['id'])});}})['catch'](function(_0x453fb2){logger[_0xec53('0x49')](_0xec53('0x3f'),JSON[_0xec53('0x2d')](_0x453fb2));});};exports[_0xec53('0x4a')]=function(_0x386d76,_0x24dcdf,_0x231116,_0x216fb4,_0x2e4a83,_0x231a50,_0x58c496){var _0x33e6bd,_0x482a5f;_0x231a50[_0xec53('0x18')]=intUtil[_0xec53('0x3d')](_0x231a50[_0xec53('0x18')]);_0x231a50[_0xec53('0x3e')]=intUtil[_0xec53('0x3d')](_0x231a50[_0xec53('0x3e')]);if(_0x58c496&&_0x58c496[_0xec53('0x4b')]&&_0x58c496['recordingFormat']!=='none'){logger[_0xec53('0xc')](_0xec53('0x4c'),'Recording\x20is\x20enabled!');_0x24dcdf['recordingURL']=util['format'](_0xec53('0x42'),_0x231a50['serverUrl'],_0x24dcdf[_0xec53('0x43')],md5(_0x24dcdf[_0xec53('0x43')]));}headers['Authorization']=getAuth(_0x231a50);return getUser(_0x231a50,_0x216fb4['email'])[_0xec53('0x1a')](function(_0x2aa5fe){_0x33e6bd=_0x2aa5fe;logger['info'](_0xec53('0x45'),_0x33e6bd['id']);return getEndUser(_0x231a50,_0x24dcdf[_0xec53('0x4d')],_0x24dcdf[_0xec53('0x4e')]);})['then'](function(_0x9ae476){_0x482a5f=_0x9ae476;logger[_0xec53('0xc')]('The\x20Enduser\x20ID\x20is:',_0x482a5f['id']);return getTicket(_0x231a50,_0x33e6bd,_0x482a5f,_0x231116,_0x24dcdf);})[_0xec53('0x1a')](function(_0x184b3c){if(_0x184b3c&&_0x184b3c['id']){logger[_0xec53('0xc')](_0xec53('0x1b'));logger[_0xec53('0xc')]('The\x20Ticket\x20ID\x20is:',_0x184b3c['id']);logger[_0xec53('0xc')](_0xec53('0x4c'),_0xec53('0x4f'));emit(util[_0xec53('0xe')](_0xec53('0x47'),_0x216fb4[_0xec53('0x16')]),_0xec53('0x48'),{'uri':util[_0xec53('0xe')](_0xec53('0x50'),_0x231a50[_0xec53('0x18')],_0x184b3c['id'])});}})[_0xec53('0x51')](function(_0x470b58){logger[_0xec53('0x49')]('[OUTBOUND]',JSON[_0xec53('0x2d')](_0x470b58));});};exports[_0xec53('0x52')]=function(_0x32aa6d,_0x19e3ec,_0x46ad01,_0x519a7e,_0x24f15d,_0x3c16ca){var _0x310a4c,_0xfb458;_0x3c16ca[_0xec53('0x18')]=intUtil[_0xec53('0x3d')](_0x3c16ca[_0xec53('0x18')]);_0x3c16ca[_0xec53('0x3e')]=intUtil['stripTrailingSlash'](_0x3c16ca[_0xec53('0x3e')]);if(_0x24f15d&&_0x24f15d['monitor_format']){logger['info']('['+_0x19e3ec[_0xec53('0x53')]['toUpperCase']()+']',_0xec53('0x40'));_0x19e3ec[_0xec53('0x41')]=util[_0xec53('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c16ca[_0xec53('0x3e')],_0x19e3ec[_0xec53('0x43')],md5(_0x19e3ec['uniqueid']));}else{_0x19e3ec[_0xec53('0x41')]='';}headers[_0xec53('0x44')]=getAuth(_0x3c16ca);return getUser(_0x3c16ca,'')[_0xec53('0x1a')](function(_0x518661){_0x310a4c=_0x518661;logger['info'](_0xec53('0x45'),_0x310a4c['id']);return getEndUser(_0x3c16ca,_0x19e3ec['calleridname'],_0x19e3ec[_0xec53('0x11')]);})[_0xec53('0x1a')](function(_0x155b80){_0xfb458=_0x155b80;logger['info']('The\x20Enduser\x20ID\x20is:',_0xfb458['id']);return getTicket(_0x3c16ca,_0x310a4c,_0xfb458,_0x46ad01,_0x19e3ec);})['then'](function(_0x4feec0){if(_0x4feec0){logger[_0xec53('0xc')](_0xec53('0x1b'));logger[_0xec53('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4feec0['id']);}})[_0xec53('0x51')](function(_0x330709){logger[_0xec53('0x49')]('['+_0x19e3ec['lastevent']['toUpperCase']()+']',JSON[_0xec53('0x2d')](_0x330709));});}; \ No newline at end of file +var _0x073a=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridnum','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','request-promise','ioredis','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','
','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','customField','content','picklist','idField','push','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:'];(function(_0x4f6dfa,_0x1b5ec2){var _0x5c7759=function(_0x32b58a){while(--_0x32b58a){_0x4f6dfa['push'](_0x4f6dfa['shift']());}};_0x5c7759(++_0x1b5ec2);}(_0x073a,0x1db));var _0xa073=function(_0x4937f7,_0x5062df){_0x4937f7=_0x4937f7-0x0;var _0x20f75f=_0x073a[_0x4937f7];return _0x20f75f;};'use strict';var _=require('lodash');var rp=require(_0xa073('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xa073('0x1'));var intUtil=require('./util');var config=require(_0xa073('0x2'));var logger=require('../../../../config/logger')(_0xa073('0x3'));config[_0xa073('0x4')]=_[_0xa073('0x5')](config[_0xa073('0x4')],{'host':_0xa073('0x6'),'port':0x18eb});var io=require(_0xa073('0x7'))(new Redis(config[_0xa073('0x4')]));var headers={'Content-Type':'application/json','Accept':_0xa073('0x8')};function emit(_0x4cac29,_0x1b9992,_0x5f3f4c){io['to'](_0x4cac29)[_0xa073('0x9')](_0x1b9992,_0x5f3f4c);}function getTicket(_0x2fc6fc,_0x27536c,_0x3fa722,_0x53501b,_0x11c541){logger[_0xa073('0xa')](_0xa073('0xb'));var _0x5ae6ef=_[_0xa073('0xc')]({'responder_id':_0x27536c['id'],'requester_id':_0x3fa722['id'],'name':util[_0xa073('0xd')]('Caller\x20-\x20%s',_0x11c541['calleridname']),'phone':_0x11c541[_0xa073('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa073('0xf')](_0x53501b[_0xa073('0x10')],_0x11c541,'\x20'),'description':intUtil['getString'](_0x53501b['Descriptions'],_0x11c541,_0xa073('0x11')),'tags':getTags(_0x53501b[_0xa073('0x12')],_0xa073('0x13'))},getCustomFields(_0x53501b[_0xa073('0x14')],_0x11c541));_0x5ae6ef[_0xa073('0x15')]=_['mapValues'](_[_0xa073('0x16')](_0x5ae6ef['custom_fields'],'id'),_0xa073('0x17'));return request({'uri':util[_0xa073('0xd')](_0xa073('0x18'),_0x2fc6fc[_0xa073('0x19')]),'method':_0xa073('0x1a'),'body':_0x5ae6ef})['then'](function(_0x326f8b){logger[_0xa073('0xa')](_0xa073('0x1b'));return _0x326f8b;});}function getUser(_0x32c79b,_0x96913d){if(intUtil[_0xa073('0x1c')](_0x96913d)){return request({'uri':util[_0xa073('0xd')]('%s/api/v2/agents',_0x32c79b['remoteUri']),'qs':{'email':_0x96913d}})['then'](function(_0x366d52){if(_0x366d52['length']){logger[_0xa073('0xa')](_0xa073('0x1d'));return _[_0xa073('0x1e')](_0x366d52,function(_0x5c455c){return _0x5c455c[_0xa073('0x1f')][_0xa073('0x20')]===_0x96913d;});}else{logger['info'](_0xa073('0x21'));return request({'uri':util[_0xa073('0xd')]('%s/api/v2/agents/me',_0x32c79b[_0xa073('0x19')])})[_0xa073('0x22')](function(_0x8c75ba){logger[_0xa073('0xa')](_0xa073('0x23'));return _0x8c75ba;});}});}else{logger[_0xa073('0xa')](_0xa073('0x24'));return request({'uri':util[_0xa073('0xd')](_0xa073('0x25'),_0x32c79b['remoteUri'])})['then'](function(_0x2a1f29){logger['info']('Admin\x20account\x20selected.');return _0x2a1f29;});}}function getEndUser(_0x21adfb,_0x1ad873,_0x2f1a6e){logger[_0xa073('0xa')](_0xa073('0x26'),_0x2f1a6e);return request({'uri':util[_0xa073('0xd')](_0xa073('0x27'),_0x21adfb[_0xa073('0x19')]),'qs':{'phone':_0x2f1a6e}})[_0xa073('0x22')](function(_0xe85a3a){if(_0xe85a3a[_0xa073('0x28')]){logger['info']('Enduser\x20found!');return _[_0xa073('0x1e')](_0xe85a3a,{'phone':_0x2f1a6e});}else{logger[_0xa073('0xa')](_0xa073('0x29'));return request({'uri':util[_0xa073('0xd')](_0xa073('0x27'),_0x21adfb['remoteUri']),'method':_0xa073('0x1a'),'body':{'name':_0x1ad873,'phone':_0x2f1a6e}})[_0xa073('0x22')](function(_0x1241a2){logger[_0xa073('0xa')](_0xa073('0x2a'));return _0x1241a2;});}});}function getAuth(_0x5a9a0f){return util[_0xa073('0xd')](_0xa073('0x2b'),new Buffer(_0x5a9a0f[_0xa073('0x2c')]+':X')[_0xa073('0x2d')](_0xa073('0x2e')));}function request(_0x570d3d){logger[_0xa073('0x2f')](_0xa073('0x30'),JSON[_0xa073('0x31')](_0x570d3d));return rp(_[_0xa073('0x5')](_0x570d3d,{'method':_0xa073('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x5905cd,_0x1ba1a8){var _0x55a064=[];if(_0x5905cd&&_0x5905cd[_0xa073('0x28')]>0x0){_0x55a064=_[_0xa073('0x33')](_0x5905cd,_0x1ba1a8);}return _0x55a064;}function getCustomFields(_0x4e1c1f,_0x59ce48){var _0x32caf5=[];var _0x2e8331={'custom_fields':[]};if(_0x4e1c1f[_0xa073('0x28')]>0x0){_['forEach'](_0x4e1c1f,function(_0x163374){if(_[_0xa073('0x34')]([_0xa073('0x35'),'picklist'],_0x163374[_0xa073('0x36')])&&_0x163374[_0xa073('0x37')]&&!_0x163374[_0xa073('0x38')]){_0x2e8331[_0x163374[_0xa073('0x37')]['toLowerCase']()]=_0x163374[_0xa073('0x39')][_0xa073('0x2d')]();}else if(_[_0xa073('0x34')]([_0xa073('0x35'),_0xa073('0x3a')],_0x163374[_0xa073('0x36')])&&_0x163374[_0xa073('0x3b')]&&_0x163374[_0xa073('0x38')]){_0x2e8331[_0xa073('0x15')][_0xa073('0x3c')]({'id':_0x163374[_0xa073('0x3b')],'value':_0x163374[_0xa073('0x39')][_0xa073('0x2d')]()});}else if(_0x163374[_0xa073('0x36')]===_0xa073('0x3d')&&_0x163374[_0xa073('0x3e')]&&_0x163374[_0xa073('0x3b')]&&_0x163374[_0xa073('0x38')]){_0x59ce48[_0x163374[_0xa073('0x3e')]]&&_0x2e8331[_0xa073('0x15')][_0xa073('0x3c')]({'id':_0x163374[_0xa073('0x3b')],'value':_0x59ce48[_0x163374[_0xa073('0x3e')]][_0xa073('0x2d')]()});}else if(_0x163374[_0xa073('0x36')]===_0xa073('0x3f')&&_0x163374['Variable']&&_0x163374['Variable'][_0xa073('0x13')]&&_0x163374[_0xa073('0x3b')]&&_0x163374['customField']){_0x59ce48[_0x163374[_0xa073('0x40')][_0xa073('0x13')][_0xa073('0x41')]()]&&_0x2e8331[_0xa073('0x15')][_0xa073('0x3c')]({'id':_0x163374[_0xa073('0x3b')],'value':_0x59ce48[_0x163374['Variable'][_0xa073('0x13')]['toLowerCase']()][_0xa073('0x2d')]()});}});}return _0x2e8331;}exports['queue']=function(_0x266d26,_0x44b3be,_0x283f7d,_0x31981e,_0x332df4,_0x321bfe){var _0xd52b13,_0x3f4525;_0x321bfe[_0xa073('0x19')]=intUtil[_0xa073('0x42')](_0x321bfe['remoteUri']);_0x321bfe[_0xa073('0x43')]=intUtil[_0xa073('0x42')](_0x321bfe[_0xa073('0x43')]);if(_0x332df4&&_0x332df4[_0xa073('0x44')]){logger['info'](_0xa073('0x45'),_0xa073('0x46'));_0x44b3be[_0xa073('0x47')]=util[_0xa073('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x321bfe[_0xa073('0x43')],_0x44b3be[_0xa073('0x48')],md5(_0x44b3be['uniqueid']));}else{_0x44b3be[_0xa073('0x47')]='';}headers['Authorization']=getAuth(_0x321bfe);return getUser(_0x321bfe,_0x31981e[_0xa073('0x20')])[_0xa073('0x22')](function(_0xf86584){_0xd52b13=_0xf86584;logger['info'](_0xa073('0x49'),_0xd52b13['id']);return getEndUser(_0x321bfe,_0x44b3be[_0xa073('0x4a')],_0x44b3be['calleridnum']);})[_0xa073('0x22')](function(_0x5d4f2e){_0x3f4525=_0x5d4f2e;logger[_0xa073('0xa')](_0xa073('0x4b'),_0x3f4525['id']);return getTicket(_0x321bfe,_0xd52b13,_0x3f4525,_0x283f7d,_0x44b3be);})[_0xa073('0x22')](function(_0x3b4193){if(_0x3b4193&&_0x3b4193['id']){logger[_0xa073('0xa')](_0xa073('0x1b'));logger['info'](_0xa073('0x4c'),_0x3b4193['id']);logger[_0xa073('0xa')](_0xa073('0x45'),_0xa073('0x4d'));emit(util['format']('user:%s',_0x31981e[_0xa073('0x13')]),_0xa073('0x4e'),{'uri':util[_0xa073('0xd')]('%s/helpdesk/tickets/%d',_0x321bfe[_0xa073('0x19')],_0x3b4193['id'])});}})['catch'](function(_0x2e8c3f){logger['error'](_0xa073('0x45'),JSON[_0xa073('0x31')](_0x2e8c3f));});};exports[_0xa073('0x4f')]=function(_0x2bd36a,_0x5d5911,_0x34d7ad,_0x3a1d3f,_0xc0d32a,_0x30f370,_0x415799){var _0x1e5528,_0x5f2535;_0x30f370[_0xa073('0x19')]=intUtil[_0xa073('0x42')](_0x30f370[_0xa073('0x19')]);_0x30f370[_0xa073('0x43')]=intUtil[_0xa073('0x42')](_0x30f370['serverUrl']);if(_0x415799&&_0x415799[_0xa073('0x50')]&&_0x415799[_0xa073('0x50')]!==_0xa073('0x51')){logger[_0xa073('0xa')](_0xa073('0x52'),_0xa073('0x46'));_0x5d5911[_0xa073('0x47')]=util[_0xa073('0xd')](_0xa073('0x53'),_0x30f370[_0xa073('0x43')],_0x5d5911['uniqueid'],md5(_0x5d5911['uniqueid']));}headers[_0xa073('0x54')]=getAuth(_0x30f370);return getUser(_0x30f370,_0x3a1d3f[_0xa073('0x20')])[_0xa073('0x22')](function(_0x512f08){_0x1e5528=_0x512f08;logger['info']('The\x20User\x20ID\x20is:',_0x1e5528['id']);return getEndUser(_0x30f370,_0x5d5911['destcalleridname'],_0x5d5911[_0xa073('0x55')]);})[_0xa073('0x22')](function(_0x1b66c9){_0x5f2535=_0x1b66c9;logger['info'](_0xa073('0x4b'),_0x5f2535['id']);return getTicket(_0x30f370,_0x1e5528,_0x5f2535,_0x34d7ad,_0x5d5911);})[_0xa073('0x22')](function(_0x1d471b){if(_0x1d471b&&_0x1d471b['id']){logger[_0xa073('0xa')](_0xa073('0x1b'));logger[_0xa073('0xa')](_0xa073('0x4c'),_0x1d471b['id']);logger[_0xa073('0xa')](_0xa073('0x52'),_0xa073('0x4d'));emit(util[_0xa073('0xd')]('user:%s',_0x3a1d3f[_0xa073('0x13')]),_0xa073('0x4e'),{'uri':util['format'](_0xa073('0x56'),_0x30f370[_0xa073('0x19')],_0x1d471b['id'])});}})[_0xa073('0x57')](function(_0x109243){logger[_0xa073('0x58')](_0xa073('0x52'),JSON[_0xa073('0x31')](_0x109243));});};exports[_0xa073('0x59')]=function(_0x4b7fe7,_0x2076ef,_0x4c6cee,_0x4c66ab,_0x26193d,_0x555545){var _0x487f82,_0x5277e1;_0x555545[_0xa073('0x19')]=intUtil[_0xa073('0x42')](_0x555545['remoteUri']);_0x555545[_0xa073('0x43')]=intUtil[_0xa073('0x42')](_0x555545['serverUrl']);if(_0x26193d&&_0x26193d[_0xa073('0x44')]){logger[_0xa073('0xa')]('['+_0x2076ef[_0xa073('0x5a')][_0xa073('0x5b')]()+']',_0xa073('0x46'));_0x2076ef[_0xa073('0x47')]=util[_0xa073('0xd')](_0xa073('0x53'),_0x555545['serverUrl'],_0x2076ef[_0xa073('0x48')],md5(_0x2076ef[_0xa073('0x48')]));}else{_0x2076ef[_0xa073('0x47')]='';}headers[_0xa073('0x54')]=getAuth(_0x555545);return getUser(_0x555545,'')['then'](function(_0x4059cb){_0x487f82=_0x4059cb;logger[_0xa073('0xa')](_0xa073('0x49'),_0x487f82['id']);return getEndUser(_0x555545,_0x2076ef[_0xa073('0x4a')],_0x2076ef[_0xa073('0xe')]);})[_0xa073('0x22')](function(_0x481023){_0x5277e1=_0x481023;logger[_0xa073('0xa')]('The\x20Enduser\x20ID\x20is:',_0x5277e1['id']);return getTicket(_0x555545,_0x487f82,_0x5277e1,_0x4c6cee,_0x2076ef);})[_0xa073('0x22')](function(_0x5e5d8a){if(_0x5e5d8a){logger[_0xa073('0xa')](_0xa073('0x1b'));logger[_0xa073('0xa')](_0xa073('0x4c'),_0x5e5d8a['id']);}})[_0xa073('0x57')](function(_0xfeec6a){logger[_0xa073('0x58')]('['+_0x2076ef[_0xa073('0x5a')][_0xa073('0x5b')]()+']',JSON['stringify'](_0xfeec6a));});}; \ 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 34d4d23..241bd14 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 _0xb06e=['GET','/api/selector/owners','headers','users','length','email','adminEmail','adminId','info','Admin\x20found:','catch','toUpperCase','message','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','error','&f=','&entities=contact','contacts','format','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','Subjects','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','Token\x20token=','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','bluebird','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter'];(function(_0x16f2be,_0xf46d59){var _0x205384=function(_0x3e73e5){while(--_0x3e73e5){_0x16f2be['push'](_0x16f2be['shift']());}};_0x205384(++_0xf46d59);}(_0xb06e,0x18b));var _0xeb06=function(_0x52f139,_0x51c99b){_0x52f139=_0x52f139-0x0;var _0x34b6a6=_0xb06e[_0x52f139];return _0x34b6a6;};'use strict';var _=require(_0xeb06('0x0'));var rp=require(_0xeb06('0x1'));var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0xeb06('0x2'));var Redis=require('ioredis');var intUtil=require(_0xeb06('0x3'));var config=require(_0xeb06('0x4'));var logger=require(_0xeb06('0x5'))('freshsales');config[_0xeb06('0x6')]=_[_0xeb06('0x7')](config['redis'],{'host':_0xeb06('0x8'),'port':0x18eb});var io=require(_0xeb06('0x9'))(new Redis(config['redis']));function getAdminId(_0x231034,_0x6de3fe,_0x340359,_0x392e36){return new Promise(function(_0x1a5175,_0x566df4){var _0x33e778=![];var _0x49ea09={'method':_0xeb06('0xa'),'uri':_0x392e36+_0xeb06('0xb'),'json':!![]};_0x49ea09[_0xeb06('0xc')]=_0x340359;logger['info']('Getting\x20admin\x20information');return rp(_0x49ea09)['then'](function(_0x3f260a){if(_0x3f260a){var _0xe89e35=_0x3f260a[_0xeb06('0xd')];var _0x58ae0f=null;for(_0x58ae0f=0x0;_0x58ae0f<_0xe89e35[_0xeb06('0xe')];_0x58ae0f++){if(_0xe89e35[_0x58ae0f][_0xeb06('0xf')]===_0x231034[_0xeb06('0x10')]){_0x231034[_0xeb06('0x11')]=_0xe89e35[_0x58ae0f]['id'];_0x33e778=!![];}}if(_0x33e778){logger[_0xeb06('0x12')](_0xeb06('0x13'),_0x231034[_0xeb06('0x11')]);_0x1a5175(_0x231034);}else{_0x566df4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x566df4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xeb06('0x14')](function(_0x517bac){logger['error']('['+[_0x6de3fe[_0xeb06('0x15')]()]+']',_0x517bac[_0xeb06('0x16')]);_0x566df4(_0x517bac);});});}function getUser(_0x1c9230,_0x2d8ee6,_0x5dc217){return function(_0x254120){return new Promise(function(_0x1d08c1,_0x487efb){var _0x551943={'method':_0xeb06('0xa'),'uri':_0x5dc217+_0xeb06('0xb'),'json':!![]};_0x551943[_0xeb06('0xc')]=_0x2d8ee6;logger['info']('Getting\x20user\x20list');return rp(_0x551943)[_0xeb06('0x17')](function(_0x23a6fd){if(_0x23a6fd){var _0x52e36b=_0x23a6fd[_0xeb06('0xd')];var _0x1579f3=![];var _0x3b05ac=null;if(_0x254120['agentEmail']!==null){logger[_0xeb06('0x12')](_0xeb06('0x18'),_0x254120[_0xeb06('0x19')]);_0x254120[_0xeb06('0x1a')]=_0x254120[_0xeb06('0x19')];for(_0x3b05ac=0x0;_0x3b05ac<_0x52e36b['length'];_0x3b05ac++){if(_0x52e36b[_0x3b05ac][_0xeb06('0xf')]===_0x254120[_0xeb06('0x19')]){_0x1579f3=!![];_0x254120[_0xeb06('0x1b')]=_0x52e36b[_0x3b05ac]['id'];logger[_0xeb06('0x12')](_0xeb06('0x1c'),_0x254120[_0xeb06('0x1b')]);}}}if(!_0x1579f3){logger['info'](_0xeb06('0x1d'));_0x254120['userEmail']=_0x254120['adminEmail'];_0x254120[_0xeb06('0x1b')]=_0x254120['adminId'];_0x1579f3=!![];}if(_0x1579f3){_0x1d08c1(_0x254120);}else{_0x487efb({'statusCode':0x194,'message':_0xeb06('0x1e')});}}else{_0x487efb({'statusCode':0x194,'message':_0xeb06('0x1e')});}})[_0xeb06('0x14')](function(_0x3e585e){logger[_0xeb06('0x1f')]('['+[_0x1c9230['toUpperCase']()]+']',_0x3e585e[_0xeb06('0x16')]);_0x487efb(_0x3e585e);});});};}function searchContact(_0x3b1c98,_0x3ce1a8,_0x57b185,_0x2a9ebf){return new Promise(function(_0x213a7e,_0x2784c9){var _0x15c7a0={'method':_0xeb06('0xa'),'headers':_0x3ce1a8,'uri':_0x3b1c98+'/api/lookup?q='+_0x2a9ebf+_0xeb06('0x20')+_0x57b185+_0xeb06('0x21'),'json':!![]};rp(_0x15c7a0)[_0xeb06('0x17')](function(_0x9e459){var _0x4052c9=_['find'](_0x9e459[_0xeb06('0x22')][_0xeb06('0x22')],[_0x57b185,_0x2a9ebf]);_0x213a7e(_0x4052c9);})[_0xeb06('0x14')](function(_0xaa088e){_0x2784c9(_0xaa088e);});});}function getEndUser(_0xbfa91,_0x4c9955,_0x395740){return function(_0x4af41b){return new Promise(function(_0x534c7d,_0x34e4f3){logger[_0xeb06('0x12')](util[_0xeb06('0x23')]('Searching\x20contact\x20with\x20phone\x20%s',_0x4af41b[_0xeb06('0x24')]));searchContact(_0x395740,_0x4c9955,_0xeb06('0x25'),_0x4af41b[_0xeb06('0x24')])[_0xeb06('0x17')](function(_0xaaf019){if(_0xaaf019){_0x4af41b[_0xeb06('0x26')]=_0xaaf019['id'];logger[_0xeb06('0x12')](_0xeb06('0x27'),_0x4af41b[_0xeb06('0x26')]);return _0x534c7d(_0x4af41b);}searchContact(_0x395740,_0x4c9955,_0xeb06('0x28'),_0x4af41b[_0xeb06('0x24')])['then'](function(_0x47e0d1){if(_0x47e0d1){_0x4af41b[_0xeb06('0x26')]=_0x47e0d1['id'];logger['info'](_0xeb06('0x29'),_0x4af41b[_0xeb06('0x26')]);return _0x534c7d(_0x4af41b);}createEndUser(_0x4af41b,_0xbfa91,_0x4c9955,_0x395740)[_0xeb06('0x17')](function(_0x40e7b7){logger['info'](_0xeb06('0x2a'),_0x40e7b7[_0xeb06('0x26')]);return _0x534c7d(_0x40e7b7);});});})[_0xeb06('0x14')](function(_0xc4493e){_0x34e4f3(_0xc4493e);});});};}function createEndUser(_0x1edd1e,_0x5b8254,_0x3ea870,_0x5417c8){return new Promise(function(_0x5479cc,_0x43602f){var _0x4a0034=moment();var _0x107b3d={'method':_0xeb06('0x2b'),'uri':_0x5417c8+_0xeb06('0x2c'),'body':{'contact':{'last_name':_0x1edd1e[_0xeb06('0x24')],'work_number':_0x1edd1e['contactNumber'],'mobile_number':_0x1edd1e[_0xeb06('0x24')],'owner_id':_0x1edd1e[_0xeb06('0x1b')],'created_at':_0x4a0034[_0xeb06('0x23')](_0xeb06('0x2d'))}},'json':!![]};_0x107b3d[_0xeb06('0xc')]=_0x3ea870;logger['info'](_0xeb06('0x2e'));return rp(_0x107b3d)[_0xeb06('0x17')](function(_0xa28ba2){_0x1edd1e[_0xeb06('0x26')]=_0xa28ba2[_0xeb06('0x2f')]['id'];_0x5479cc(_0x1edd1e);})[_0xeb06('0x14')](function(_0x2cf12b){logger[_0xeb06('0x1f')]('['+[_0x5b8254['toUpperCase']()]+']',_0x2cf12b[_0xeb06('0x16')]);_0x43602f(_0x2cf12b[_0xeb06('0x16')]);});});}function getTicket(_0x43d6b3,_0x1afe42,_0x347e90,_0x2c4df9,_0x36b923){return function(_0x1d736d){logger[_0xeb06('0x12')](_0xeb06('0x30'));return new Promise(function(_0x227e72,_0x31205d){var _0xf47d7b=moment();var _0x3acfa1={'method':'POST','uri':_0x347e90+'/api/tasks','body':{'title':intUtil['getString'](_0x2c4df9[_0xeb06('0x31')],_0x36b923,'\x20'),'description':intUtil[_0xeb06('0x32')](_0x2c4df9[_0xeb06('0x33')],_0x36b923,'\x0a'),'owner_id':_0x1d736d[_0xeb06('0x1b')],'creater_id':_0x1d736d[_0xeb06('0x11')],'targetable_id':_0x1d736d[_0xeb06('0x26')],'targetable_type':_0xeb06('0x34'),'created_at':_0xf47d7b[_0xeb06('0x23')](_0xeb06('0x2d')),'due_date':_0xf47d7b[_0xeb06('0x35')](0x1e,'m')[_0xeb06('0x23')](_0xeb06('0x2d'))},'json':!![]};_0x3acfa1[_0xeb06('0xc')]=_0x1afe42;return rp(_0x3acfa1)[_0xeb06('0x17')](function(_0x429e82){_0x1d736d[_0xeb06('0x36')]=_0x429e82[_0xeb06('0x37')]['id'];logger['info']('Task\x20created:',_0x1d736d[_0xeb06('0x36')]);_0x227e72(_0x1d736d);})['catch'](function(_0x4a7458){logger['error']('['+[_0x43d6b3[_0xeb06('0x15')]()]+']',_0x4a7458[_0xeb06('0x16')]);_0x31205d(_0x4a7458[_0xeb06('0x16')]);});});};}function emit(_0x3a8f8e,_0x353875,_0x3e6830){var _0x4ffc8a={'uri':_0x3a8f8e+_0xeb06('0x38')+_0x3e6830};io['to'](util['format'](_0xeb06('0x39'),_0x353875))['emit']('trigger:browser:url',_0x4ffc8a);}exports['cs']=function(_0x266842,_0x5d28e7,_0x14a52b,_0x4323fb,_0x30a198,_0x567ce3,_0x40c14b,_0x2e443d){var _0x4d0b6f={};var _0x50f8a9={'Authorization':_0xeb06('0x3a')+_0x567ce3['apiKey']};_0x567ce3['remoteUri']=intUtil[_0xeb06('0x3b')](_0x567ce3[_0xeb06('0x3c')]);_0x567ce3[_0xeb06('0x3d')]=intUtil[_0xeb06('0x3b')](_0x567ce3[_0xeb06('0x3d')]);var _0x24c5a1=_0x567ce3['remoteUri'];_0x4d0b6f[_0xeb06('0x10')]=_0x567ce3[_0xeb06('0x3e')];_0x4d0b6f[_0xeb06('0x24')]=_0x2e443d[_0xeb06('0x3f')]()==='outbound'?_0x5d28e7['destcalleridnum']:_0x5d28e7[_0xeb06('0x40')];_0x4d0b6f[_0xeb06('0x41')]=_0x2e443d===_0xeb06('0x42')||_0x2e443d==='unmanaged'?'queue':_0xeb06('0x43');if(_0x4323fb){_0x4d0b6f[_0xeb06('0x19')]=_0x4323fb['email'];}var _0x24e40d=util[_0xeb06('0x23')](_0xeb06('0x44'),_0x567ce3[_0xeb06('0x3d')],_0x5d28e7['uniqueid'],md5(_0x5d28e7[_0xeb06('0x45')]));if(_0x30a198&&_0x30a198[_0xeb06('0x46')]){logger[_0xeb06('0x12')](_0xeb06('0x47'),_0xeb06('0x48'));_0x5d28e7[_0xeb06('0x49')]=_0x24e40d;}else if(_0x40c14b&&_0x40c14b[_0xeb06('0x4a')]&&_0x40c14b[_0xeb06('0x4a')]!==_0xeb06('0x4b')){logger[_0xeb06('0x12')](_0xeb06('0x4c'),_0xeb06('0x48'));_0x5d28e7['recordingURL']=_0x24e40d;}else{_0x5d28e7[_0xeb06('0x49')]='';}return getAdminId(_0x4d0b6f,_0x2e443d,_0x50f8a9,_0x24c5a1)[_0xeb06('0x17')](getUser(_0x2e443d,_0x50f8a9,_0x24c5a1))['then'](getEndUser(_0x2e443d,_0x50f8a9,_0x24c5a1))[_0xeb06('0x17')](getTicket(_0x2e443d,_0x50f8a9,_0x24c5a1,_0x14a52b,_0x5d28e7))[_0xeb06('0x17')](function(_0x4384d1){logger[_0xeb06('0x12')](util[_0xeb06('0x23')](_0xeb06('0x4d'),_0x4384d1[_0xeb06('0x36')]));if(_0x2e443d!=='unmanaged'){logger[_0xeb06('0x12')]('['+[_0x2e443d[_0xeb06('0x15')]()]+']',_0xeb06('0x4e'));emit(_0x24c5a1,_0x4323fb['name'],_0x4384d1[_0xeb06('0x26')]);}})[_0xeb06('0x14')](function(_0x180448){logger['error']('['+[_0x2e443d[_0xeb06('0x15')]()]+_0xeb06('0x4f'),util[_0xeb06('0x50')](_0x180448,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x08fb=['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','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','length','email','adminEmail','adminId','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','userEmail','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:'];(function(_0x571c83,_0x4c97dc){var _0x2b8bd2=function(_0x1401a1){while(--_0x1401a1){_0x571c83['push'](_0x571c83['shift']());}};_0x2b8bd2(++_0x4c97dc);}(_0x08fb,0x125));var _0xb08f=function(_0x68e149,_0x42e815){_0x68e149=_0x68e149-0x0;var _0x336a36=_0x08fb[_0x68e149];return _0x336a36;};'use strict';var _=require(_0xb08f('0x0'));var rp=require(_0xb08f('0x1'));var md5=require(_0xb08f('0x2'));var util=require(_0xb08f('0x3'));var moment=require('moment');var Promise=require(_0xb08f('0x4'));var Redis=require(_0xb08f('0x5'));var intUtil=require(_0xb08f('0x6'));var config=require(_0xb08f('0x7'));var logger=require(_0xb08f('0x8'))('freshsales');config[_0xb08f('0x9')]=_['defaults'](config['redis'],{'host':_0xb08f('0xa'),'port':0x18eb});var io=require(_0xb08f('0xb'))(new Redis(config[_0xb08f('0x9')]));function getAdminId(_0x376294,_0x536ff7,_0xa4c8a3,_0x374f70){return new Promise(function(_0x473f11,_0x26c17a){var _0x2ade7e=![];var _0x40ed37={'method':_0xb08f('0xc'),'uri':_0x374f70+_0xb08f('0xd'),'json':!![]};_0x40ed37[_0xb08f('0xe')]=_0xa4c8a3;logger[_0xb08f('0xf')]('Getting\x20admin\x20information');return rp(_0x40ed37)[_0xb08f('0x10')](function(_0x455186){if(_0x455186){var _0x559546=_0x455186['users'];var _0x2e1308=null;for(_0x2e1308=0x0;_0x2e1308<_0x559546[_0xb08f('0x11')];_0x2e1308++){if(_0x559546[_0x2e1308][_0xb08f('0x12')]===_0x376294[_0xb08f('0x13')]){_0x376294[_0xb08f('0x14')]=_0x559546[_0x2e1308]['id'];_0x2ade7e=!![];}}if(_0x2ade7e){logger['info']('Admin\x20found:',_0x376294[_0xb08f('0x14')]);_0x473f11(_0x376294);}else{_0x26c17a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x26c17a({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xb08f('0x15')](function(_0x22fd53){logger[_0xb08f('0x16')]('['+[_0x536ff7[_0xb08f('0x17')]()]+']',_0x22fd53[_0xb08f('0x18')]);_0x26c17a(_0x22fd53);});});}function getUser(_0x5a56ed,_0x4f18ee,_0x1d7d38){return function(_0x567d7e){return new Promise(function(_0x36a42e,_0x26b5ba){var _0x3a4ce8={'method':'GET','uri':_0x1d7d38+_0xb08f('0xd'),'json':!![]};_0x3a4ce8['headers']=_0x4f18ee;logger['info'](_0xb08f('0x19'));return rp(_0x3a4ce8)['then'](function(_0x5f21b9){if(_0x5f21b9){var _0x3aa50d=_0x5f21b9[_0xb08f('0x1a')];var _0x3eae92=![];var _0x207e7f=null;if(_0x567d7e[_0xb08f('0x1b')]!==null){logger['info'](_0xb08f('0x1c'),_0x567d7e[_0xb08f('0x1b')]);_0x567d7e['userEmail']=_0x567d7e[_0xb08f('0x1b')];for(_0x207e7f=0x0;_0x207e7f<_0x3aa50d[_0xb08f('0x11')];_0x207e7f++){if(_0x3aa50d[_0x207e7f]['email']===_0x567d7e[_0xb08f('0x1b')]){_0x3eae92=!![];_0x567d7e[_0xb08f('0x1d')]=_0x3aa50d[_0x207e7f]['id'];logger['info'](_0xb08f('0x1e'),_0x567d7e[_0xb08f('0x1d')]);}}}if(!_0x3eae92){logger[_0xb08f('0xf')]('Admin\x20selected');_0x567d7e[_0xb08f('0x1f')]=_0x567d7e[_0xb08f('0x13')];_0x567d7e['userId']=_0x567d7e[_0xb08f('0x14')];_0x3eae92=!![];}if(_0x3eae92){_0x36a42e(_0x567d7e);}else{_0x26b5ba({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x26b5ba({'statusCode':0x194,'message':_0xb08f('0x20')});}})['catch'](function(_0x1fcf19){logger[_0xb08f('0x16')]('['+[_0x5a56ed[_0xb08f('0x17')]()]+']',_0x1fcf19[_0xb08f('0x18')]);_0x26b5ba(_0x1fcf19);});});};}function searchContact(_0x453dbf,_0x52cd17,_0x54c36c,_0x3938cd){return new Promise(function(_0x3121e2,_0x43c599){var _0x5958c3={'method':_0xb08f('0xc'),'headers':_0x52cd17,'uri':_0x453dbf+_0xb08f('0x21')+_0x3938cd+_0xb08f('0x22')+_0x54c36c+'&entities=contact','json':!![]};rp(_0x5958c3)[_0xb08f('0x10')](function(_0x1adce6){var _0x163ac2=_[_0xb08f('0x23')](_0x1adce6[_0xb08f('0x24')][_0xb08f('0x24')],[_0x54c36c,_0x3938cd]);_0x3121e2(_0x163ac2);})[_0xb08f('0x15')](function(_0x3afb26){_0x43c599(_0x3afb26);});});}function getEndUser(_0x2538e3,_0x471a54,_0x1d5c20){return function(_0x142590){return new Promise(function(_0x5f55f7,_0x457dd6){logger[_0xb08f('0xf')](util[_0xb08f('0x25')](_0xb08f('0x26'),_0x142590[_0xb08f('0x27')]));searchContact(_0x1d5c20,_0x471a54,_0xb08f('0x28'),_0x142590['contactNumber'])[_0xb08f('0x10')](function(_0x3ad365){if(_0x3ad365){_0x142590[_0xb08f('0x29')]=_0x3ad365['id'];logger[_0xb08f('0xf')](_0xb08f('0x2a'),_0x142590['endUserId']);return _0x5f55f7(_0x142590);}searchContact(_0x1d5c20,_0x471a54,'work_number',_0x142590[_0xb08f('0x27')])['then'](function(_0x2f55a9){if(_0x2f55a9){_0x142590[_0xb08f('0x29')]=_0x2f55a9['id'];logger['info'](_0xb08f('0x2b'),_0x142590[_0xb08f('0x29')]);return _0x5f55f7(_0x142590);}createEndUser(_0x142590,_0x2538e3,_0x471a54,_0x1d5c20)[_0xb08f('0x10')](function(_0x44e418){logger['info'](_0xb08f('0x2c'),_0x44e418['endUserId']);return _0x5f55f7(_0x44e418);});});})['catch'](function(_0x57a550){_0x457dd6(_0x57a550);});});};}function createEndUser(_0x36e091,_0x498f49,_0x2037f4,_0x2b4625){return new Promise(function(_0x43b576,_0x162381){var _0x1ad0e0=moment();var _0x392475={'method':_0xb08f('0x2d'),'uri':_0x2b4625+_0xb08f('0x2e'),'body':{'contact':{'last_name':_0x36e091[_0xb08f('0x27')],'work_number':_0x36e091[_0xb08f('0x27')],'mobile_number':_0x36e091['contactNumber'],'owner_id':_0x36e091[_0xb08f('0x1d')],'created_at':_0x1ad0e0['format'](_0xb08f('0x2f'))}},'json':!![]};_0x392475[_0xb08f('0xe')]=_0x2037f4;logger[_0xb08f('0xf')](_0xb08f('0x30'));return rp(_0x392475)[_0xb08f('0x10')](function(_0x5b0abd){_0x36e091[_0xb08f('0x29')]=_0x5b0abd[_0xb08f('0x31')]['id'];_0x43b576(_0x36e091);})['catch'](function(_0x68d989){logger[_0xb08f('0x16')]('['+[_0x498f49['toUpperCase']()]+']',_0x68d989['message']);_0x162381(_0x68d989[_0xb08f('0x18')]);});});}function getTicket(_0x42a260,_0xae34c,_0x1bbb05,_0x150a82,_0x47451d){return function(_0xc44fe7){logger[_0xb08f('0xf')](_0xb08f('0x32'));return new Promise(function(_0x42e0be,_0x1fc430){var _0x48f60c=moment();var _0x31f60b={'method':_0xb08f('0x2d'),'uri':_0x1bbb05+_0xb08f('0x33'),'body':{'title':intUtil[_0xb08f('0x34')](_0x150a82['Subjects'],_0x47451d,'\x20'),'description':intUtil[_0xb08f('0x34')](_0x150a82[_0xb08f('0x35')],_0x47451d,'\x0a'),'owner_id':_0xc44fe7[_0xb08f('0x1d')],'creater_id':_0xc44fe7[_0xb08f('0x14')],'targetable_id':_0xc44fe7['endUserId'],'targetable_type':_0xb08f('0x36'),'created_at':_0x48f60c[_0xb08f('0x25')](_0xb08f('0x2f')),'due_date':_0x48f60c[_0xb08f('0x37')](0x1e,'m')['format'](_0xb08f('0x2f'))},'json':!![]};_0x31f60b['headers']=_0xae34c;return rp(_0x31f60b)[_0xb08f('0x10')](function(_0x40d6e9){_0xc44fe7[_0xb08f('0x38')]=_0x40d6e9[_0xb08f('0x39')]['id'];logger[_0xb08f('0xf')](_0xb08f('0x3a'),_0xc44fe7[_0xb08f('0x38')]);_0x42e0be(_0xc44fe7);})[_0xb08f('0x15')](function(_0x199072){logger['error']('['+[_0x42a260['toUpperCase']()]+']',_0x199072[_0xb08f('0x18')]);_0x1fc430(_0x199072[_0xb08f('0x18')]);});});};}function emit(_0x2ad968,_0x46e9ff,_0x142413){var _0x5201f5={'uri':_0x2ad968+_0xb08f('0x3b')+_0x142413};io['to'](util[_0xb08f('0x25')](_0xb08f('0x3c'),_0x46e9ff))[_0xb08f('0x3d')](_0xb08f('0x3e'),_0x5201f5);}exports['cs']=function(_0x2ec7fd,_0x466e72,_0x2352c3,_0x568d10,_0x2ed566,_0x5d56a7,_0x9e052a,_0x211b55){var _0x22af5e={};var _0x460833={'Authorization':_0xb08f('0x3f')+_0x5d56a7[_0xb08f('0x40')]};_0x5d56a7['remoteUri']=intUtil[_0xb08f('0x41')](_0x5d56a7['remoteUri']);_0x5d56a7[_0xb08f('0x42')]=intUtil['stripTrailingSlash'](_0x5d56a7[_0xb08f('0x42')]);var _0x5def44=_0x5d56a7[_0xb08f('0x43')];_0x22af5e[_0xb08f('0x13')]=_0x5d56a7[_0xb08f('0x44')];_0x22af5e[_0xb08f('0x27')]=_0x211b55['toLowerCase']()===_0xb08f('0x45')?_0x466e72[_0xb08f('0x46')]:_0x466e72[_0xb08f('0x47')];_0x22af5e[_0xb08f('0x48')]=_0x211b55===_0xb08f('0x49')||_0x211b55===_0xb08f('0x4a')?'queue':_0xb08f('0x45');if(_0x568d10){_0x22af5e[_0xb08f('0x1b')]=_0x568d10[_0xb08f('0x12')];}var _0x213fe3=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d56a7[_0xb08f('0x42')],_0x466e72[_0xb08f('0x4b')],md5(_0x466e72['uniqueid']));if(_0x2ed566&&_0x2ed566[_0xb08f('0x4c')]){logger[_0xb08f('0xf')](_0xb08f('0x4d'),_0xb08f('0x4e'));_0x466e72[_0xb08f('0x4f')]=_0x213fe3;}else if(_0x9e052a&&_0x9e052a[_0xb08f('0x50')]&&_0x9e052a[_0xb08f('0x50')]!==_0xb08f('0x51')){logger[_0xb08f('0xf')]('[OUTBOUND]',_0xb08f('0x4e'));_0x466e72[_0xb08f('0x4f')]=_0x213fe3;}else{_0x466e72[_0xb08f('0x4f')]='';}return getAdminId(_0x22af5e,_0x211b55,_0x460833,_0x5def44)[_0xb08f('0x10')](getUser(_0x211b55,_0x460833,_0x5def44))[_0xb08f('0x10')](getEndUser(_0x211b55,_0x460833,_0x5def44))[_0xb08f('0x10')](getTicket(_0x211b55,_0x460833,_0x5def44,_0x2352c3,_0x466e72))[_0xb08f('0x10')](function(_0x8c6dfb){logger['info'](util[_0xb08f('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x8c6dfb['ticketId']));if(_0x211b55!==_0xb08f('0x4a')){logger['info']('['+[_0x211b55[_0xb08f('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x5def44,_0x568d10[_0xb08f('0x52')],_0x8c6dfb['endUserId']);}})['catch'](function(_0x515462){logger[_0xb08f('0x16')]('['+[_0x211b55['toUpperCase']()]+_0xb08f('0x53'),util['inspect'](_0x515462,{'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 d8d5ba9..a5f78a0 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 _0xf5a7=['outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId'];(function(_0x6f5598,_0xabeb74){var _0x1e1325=function(_0x1da246){while(--_0x1da246){_0x6f5598['push'](_0x6f5598['shift']());}};_0x1e1325(++_0xabeb74);}(_0xf5a7,0x1ec));var _0x7f5a=function(_0x4c8f97,_0x56ecc9){_0x4c8f97=_0x4c8f97-0x0;var _0x2837d3=_0xf5a7[_0x4c8f97];return _0x2837d3;};'use strict';var _=require('lodash');var util=require(_0x7f5a('0x0'));var zendesk=require(_0x7f5a('0x1'));var salesforce=require(_0x7f5a('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x7f5a('0x3'));var desk=require(_0x7f5a('0x4'));var vtiger=require(_0x7f5a('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x7f5a('0x6'));var freshsales=require(_0x7f5a('0x7'));var integrations=[_0x7f5a('0x8'),_0x7f5a('0x9'),_0x7f5a('0xa'),_0x7f5a('0xb'),'zoho',_0x7f5a('0xc'),_0x7f5a('0xd'),_0x7f5a('0xe'),_0x7f5a('0xf'),_0x7f5a('0x10')];exports[_0x7f5a('0x11')]=function(_0x5d63dd,_0x21ff3b,_0x2c21b1,_0x13d172,_0x3d698c,_0x1fe7fe){if(_0x2c21b1){if(_['includes'](integrations,_0x5d63dd[_0x7f5a('0x12')]['toLowerCase']())){try{var _0x2c0c88=null;var _0x153863='';var _0x4ac567=_0x2c21b1[_0x5d63dd[_0x7f5a('0x12')][_0x7f5a('0x13')]()];if(_0x4ac567){var _0x36f78a=_0x4ac567[_0x5d63dd[_0x7f5a('0x14')]];if(_0x36f78a){var _0x30ee04=_[_0x7f5a('0x15')](_0x36f78a[_0x7f5a('0x16')],{'id':parseInt(_0x5d63dd[_0x7f5a('0x17')],0xa)});if(_0x30ee04){if(_0x13d172){if(_0x3d698c&&_0x21ff3b[_0x7f5a('0x18')]){_0x153863='queue';}else if(_0x21ff3b[_0x7f5a('0x19')]){_0x153863=_0x7f5a('0x1a');}else{console[_0x7f5a('0x1b')](_0x7f5a('0x1c'),_0x21ff3b);}}else{_0x153863=_0x7f5a('0x1d');}switch(_0x5d63dd['data1'][_0x7f5a('0x13')]()){case'zendesk':zendesk[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case _0x7f5a('0x9'):salesforce[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case _0x7f5a('0xa'):sugarcrm[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case'freshdesk':freshdesk[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case'zoho':zoho[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case _0x7f5a('0xc'):desk[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case _0x7f5a('0xd'):vtiger[_0x153863](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe);break;case _0x7f5a('0xf'):freshsales['cs'](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe,_0x153863);break;case'servicenow':servicenow['cs'](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe,_0x153863);break;case _0x7f5a('0xe'):dynamics365['cs'](_0x5d63dd,_0x21ff3b,_0x30ee04,_0x13d172,_0x3d698c,_0x36f78a,_0x1fe7fe,_0x153863);break;default:console[_0x7f5a('0x1b')](_0x7f5a('0x1e'));}}else{_0x2c0c88=require('../../../../config/logger')(_0x5d63dd[_0x7f5a('0x12')]['toLowerCase']());_0x2c0c88[_0x7f5a('0x1f')](_0x7f5a('0x20'),util[_0x7f5a('0x21')](_0x7f5a('0x22'),_0x5d63dd[_0x7f5a('0x12')][_0x7f5a('0x13')](),_0x5d63dd[_0x7f5a('0x17')]));}}else{_0x2c0c88=require(_0x7f5a('0x23'))(_0x5d63dd[_0x7f5a('0x12')]['toLowerCase']());_0x2c0c88[_0x7f5a('0x1f')](_0x7f5a('0x20'),util[_0x7f5a('0x21')](_0x7f5a('0x24'),_0x5d63dd['data1'][_0x7f5a('0x13')](),_0x5d63dd[_0x7f5a('0x14')]));}}else{}}catch(_0x1b48be){console[_0x7f5a('0x1f')](_0x1b48be);}}}}; \ No newline at end of file +var _0x4ca7=['toLowerCase','data1','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ca7,0x103));var _0x74ca=function(_0x2e5ea3,_0x5cee84){_0x2e5ea3=_0x2e5ea3-0x0;var _0x293973=_0x4ca7[_0x2e5ea3];return _0x293973;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var zendesk=require(_0x74ca('0x2'));var salesforce=require(_0x74ca('0x3'));var sugarcrm=require(_0x74ca('0x4'));var freshdesk=require(_0x74ca('0x5'));var zoho=require(_0x74ca('0x6'));var desk=require(_0x74ca('0x7'));var vtiger=require(_0x74ca('0x8'));var servicenow=require(_0x74ca('0x9'));var dynamics365=require(_0x74ca('0xa'));var freshsales=require(_0x74ca('0xb'));var integrations=['zendesk',_0x74ca('0xc'),_0x74ca('0xd'),_0x74ca('0xe'),_0x74ca('0xf'),_0x74ca('0x10'),_0x74ca('0x11'),_0x74ca('0x12'),_0x74ca('0x13'),'servicenow'];exports[_0x74ca('0x14')]=function(_0x548ed2,_0x3f15fa,_0x5e6de5,_0x22f0c2,_0x34301c,_0x4e1102){if(_0x5e6de5){if(_['includes'](integrations,_0x548ed2['data1'][_0x74ca('0x15')]())){try{var _0x458b90=null;var _0x25ba0e='';var _0x4e9644=_0x5e6de5[_0x548ed2[_0x74ca('0x16')][_0x74ca('0x15')]()];if(_0x4e9644){var _0x41e1eb=_0x4e9644[_0x548ed2['data2']];if(_0x41e1eb){var _0x7d1f49=_[_0x74ca('0x17')](_0x41e1eb['Configurations'],{'id':parseInt(_0x548ed2[_0x74ca('0x18')],0xa)});if(_0x7d1f49){if(_0x22f0c2){if(_0x34301c&&_0x3f15fa[_0x74ca('0x19')]){_0x25ba0e=_0x74ca('0x19');}else if(_0x3f15fa[_0x74ca('0x1a')]){_0x25ba0e=_0x74ca('0x1b');}else{console[_0x74ca('0x1c')](_0x74ca('0x1d'),_0x3f15fa);}}else{_0x25ba0e=_0x74ca('0x1e');}switch(_0x548ed2[_0x74ca('0x16')][_0x74ca('0x15')]()){case'zendesk':zendesk[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case'salesforce':salesforce[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case _0x74ca('0xd'):sugarcrm[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case _0x74ca('0xe'):freshdesk[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case'zoho':zoho[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case _0x74ca('0x10'):desk[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case'vtiger':vtiger[_0x25ba0e](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102);break;case _0x74ca('0x13'):freshsales['cs'](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102,_0x25ba0e);break;case _0x74ca('0x1f'):servicenow['cs'](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102,_0x25ba0e);break;case _0x74ca('0x12'):dynamics365['cs'](_0x548ed2,_0x3f15fa,_0x7d1f49,_0x22f0c2,_0x34301c,_0x41e1eb,_0x4e1102,_0x25ba0e);break;default:console[_0x74ca('0x1c')](_0x74ca('0x20'));}}else{_0x458b90=require(_0x74ca('0x21'))(_0x548ed2[_0x74ca('0x16')][_0x74ca('0x15')]());_0x458b90[_0x74ca('0x22')](_0x74ca('0x23'),util[_0x74ca('0x24')](_0x74ca('0x25'),_0x548ed2['data1'][_0x74ca('0x15')](),_0x548ed2[_0x74ca('0x18')]));}}else{_0x458b90=require(_0x74ca('0x21'))(_0x548ed2['data1'][_0x74ca('0x15')]());_0x458b90['error'](_0x74ca('0x23'),util[_0x74ca('0x24')](_0x74ca('0x26'),_0x548ed2[_0x74ca('0x16')][_0x74ca('0x15')](),_0x548ed2[_0x74ca('0x27')]));}}else{}}catch(_0x5edc64){console[_0x74ca('0x22')](_0x5edc64);}}}}; \ 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 353d862..9e974ba 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 _0x59a1=['IsRecurrence','endUserType','lead','WhoId','account','WhatId','ticketType','contact','ContactId','AccountId','leadId','sobject','validateEmail','User','find','execute','then','length','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','%s/%s/e','instanceUrl','monitor_format','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','./util','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x59a1,0xe1));var _0x159a=function(_0x48e6a3,_0xdf7208){_0x48e6a3=_0x48e6a3-0x0;var _0x14bae6=_0x59a1[_0x48e6a3];return _0x14bae6;};'use strict';var _=require(_0x159a('0x0'));var rp=require(_0x159a('0x1'));var moment=require(_0x159a('0x2'));var BPromise=require('bluebird');var md5=require(_0x159a('0x3'));var jsforce=require('jsforce');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x159a('0x4'));var config=require('../../../../config/environment');var logger=require(_0x159a('0x5'))(_0x159a('0x6'));config[_0x159a('0x7')]=_[_0x159a('0x8')](config[_0x159a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x159a('0x9'))(new Redis(config[_0x159a('0x7')]));function emit(_0x5562a7,_0x5e1938,_0x387c98){io['to'](_0x5562a7)['emit'](_0x5e1938,_0x387c98);}function getTicket(_0x1af183,_0x347d3e,_0x48ee29,_0x2955cc,_0x475fbc,_0x3e371b,_0x2efcbb,_0x307110){var _0x474750=Object[_0x159a('0xa')]({},{'OwnerId':_0x347d3e['id'],'Subject':intUtil[_0x159a('0xb')](_0x2955cc['Subjects'],_0x475fbc,'\x20'),'Description':intUtil[_0x159a('0xb')](_0x2955cc[_0x159a('0xc')],_0x475fbc,'\x0a')},getCustomFields(_0x3e371b,_0x475fbc));if(_0x48ee29){if(_0x2955cc['ticketType']===_0x159a('0xd')){_0x474750[_0x159a('0xe')]=moment[_0x159a('0xf')]();_0x474750[_0x159a('0x10')]=![];_0x474750[_0x159a('0x11')]=![];if(_0x48ee29[_0x159a('0x12')]==='contact'||_0x48ee29[_0x159a('0x12')]===_0x159a('0x13')){_0x474750[_0x159a('0x14')]=_0x48ee29['id'];}else if(_0x48ee29[_0x159a('0x12')]===_0x159a('0x15')){_0x474750[_0x159a('0x16')]=_0x48ee29['id'];}}else if(_0x2955cc[_0x159a('0x17')]==='Case'){if(_0x48ee29[_0x159a('0x12')]===_0x159a('0x18')){_0x474750[_0x159a('0x19')]=_0x48ee29['id'];}else if(_0x48ee29[_0x159a('0x12')]===_0x159a('0x15')){_0x474750[_0x159a('0x1a')]=_0x48ee29['id'];}else if(_0x48ee29[_0x159a('0x12')]===_0x159a('0x13')&&_0x2955cc[_0x159a('0x1b')]){_0x474750[_0x2955cc[_0x159a('0x1b')]]=_0x48ee29['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2efcbb[_0x159a('0x1c')](_0x2955cc[_0x159a('0x17')])['create'](_0x474750);}function getUser(_0x2e3eed,_0x346046,_0x3c3692){if(!_['isNil'](_0x346046)&&intUtil[_0x159a('0x1d')](_0x346046)){var _0x1e086b={'Email':_0x346046};var _0x1b0c70={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3c3692[_0x159a('0x1c')](_0x159a('0x1e'))[_0x159a('0x1f')](_0x1e086b,_0x1b0c70)[_0x159a('0x20')]()[_0x159a('0x21')](function(_0x11abf5){if(_0x11abf5[_0x159a('0x22')]){var _0x3f622e=_['find'](_0x11abf5,function(_0x25e4fb){return _0x25e4fb[_0x159a('0x23')]===_0x346046;});if(_0x3f622e){logger['info']('Agent\x20%s\x20found.',_0x346046);return BPromise[_0x159a('0x24')]({'id':_0x3f622e['Id'],'name':_0x3f622e[_0x159a('0x25')]});}}else{logger[_0x159a('0x26')](_0x159a('0x27'),_0x346046);return _0x3c3692[_0x159a('0x28')]()['then'](function(_0xa53ecb){return BPromise[_0x159a('0x24')]({'id':_0xa53ecb[_0x159a('0x29')],'name':_0xa53ecb[_0x159a('0x2a')]});});}});}else{logger[_0x159a('0x26')](_0x159a('0x27'),_0x346046);return _0x3c3692[_0x159a('0x28')]()[_0x159a('0x21')](function(_0x1e0115){return BPromise[_0x159a('0x24')]({'id':_0x1e0115[_0x159a('0x29')],'name':_0x1e0115[_0x159a('0x2a')]});});}}function getEndUser(_0x14dedd,_0x486688,_0x5648ed,_0x1e1dcb,_0x4a28e6){var _0xc21308={'$or':{'Phone':_0x1e1dcb}};var _0x291a2f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x159a('0x21')](function(){logger[_0x159a('0x26')](_0x159a('0x2b'),_0x1e1dcb,_0x486688[_0x159a('0x2c')]);switch(_0x486688[_0x159a('0x2c')]){case'contact_lead':var _0x5bcb39=_[_0x159a('0x2d')](_0xc21308);if(_0x486688[_0x159a('0x2e')]){var _0x5c5dae={};_0x5c5dae[_0x486688[_0x159a('0x2e')]]=_0x1e1dcb;_[_0x159a('0x2f')](_0x5bcb39[_0x159a('0x30')],_0x5c5dae);}return _0x4a28e6[_0x159a('0x1c')](_0x159a('0x31'))[_0x159a('0x1f')](_0x5bcb39,_0x291a2f)[_0x159a('0x20')]()[_0x159a('0x21')](function(_0x21879f){if(_0x21879f&&_0x21879f[_0x159a('0x22')]){return _0x21879f;}else{var _0xde99f2=_[_0x159a('0x2d')](_0xc21308);if(_0x486688[_0x159a('0x32')]){var _0x387989={};_0x387989[_0x486688[_0x159a('0x32')]]=_0x1e1dcb;_['merge'](_0xde99f2['$or'],_0x387989);}return _0x4a28e6[_0x159a('0x1c')](_0x159a('0x33'))[_0x159a('0x1f')](_0xde99f2,_0x291a2f);}});case'account_contact_lead':var _0x3dc853=_['cloneDeep'](_0xc21308);if(_0x486688[_0x159a('0x34')]){var _0x5c5dae={};_0x5c5dae[_0x486688['additionalSearchAccount']]=_0x1e1dcb;_[_0x159a('0x2f')](_0x3dc853[_0x159a('0x30')],_0x5c5dae);}return _0x4a28e6[_0x159a('0x1c')](_0x159a('0x35'))[_0x159a('0x1f')](_0x3dc853,_0x291a2f)[_0x159a('0x20')]()[_0x159a('0x21')](function(_0x1b8a79){if(_0x1b8a79&&_0x1b8a79['length']){return _0x1b8a79;}else{var _0x566792=_['cloneDeep'](_0xc21308);if(_0x486688['additionalSearchContact']){var _0x5b50cf={};_0x5b50cf[_0x486688['additionalSearchContact']]=_0x1e1dcb;_[_0x159a('0x2f')](_0x566792[_0x159a('0x30')],_0x5b50cf);}return _0x4a28e6[_0x159a('0x1c')](_0x159a('0x31'))[_0x159a('0x1f')](_0x566792,_0x291a2f)[_0x159a('0x21')](function(_0xcdddb5){if(_0xcdddb5&&_0xcdddb5[_0x159a('0x22')]){return _0xcdddb5;}else{var _0x23390a=_['cloneDeep'](_0xc21308);if(_0x486688['additionalSearchLead']){var _0x257b03={};_0x257b03[_0x486688['additionalSearchLead']]=_0x1e1dcb;_['merge'](_0x23390a[_0x159a('0x30')],_0x257b03);}return _0x4a28e6[_0x159a('0x1c')]('Lead')[_0x159a('0x1f')](_0x23390a,_0x291a2f);}});}});case'contact':var _0x5bcb39=_[_0x159a('0x2d')](_0xc21308);if(_0x486688[_0x159a('0x2e')]){var _0x5c5dae={};_0x5c5dae[_0x486688[_0x159a('0x2e')]]=_0x1e1dcb;_[_0x159a('0x2f')](_0x5bcb39[_0x159a('0x30')],_0x5c5dae);}return _0x4a28e6[_0x159a('0x1c')](_0x159a('0x31'))['find'](_0x5bcb39,_0x291a2f)[_0x159a('0x20')]();case _0x159a('0x13'):var _0x536518=_[_0x159a('0x2d')](_0xc21308);if(_0x486688['additionalSearchLead']){var _0x5c5dae={};_0x5c5dae[_0x486688[_0x159a('0x32')]]=_0x1e1dcb;_['merge'](_0x536518['$or'],_0x5c5dae);}return _0x4a28e6[_0x159a('0x1c')]('Lead')['find'](_0x536518,_0x291a2f);case _0x159a('0x15'):var _0x3dc853=_['cloneDeep'](_0xc21308);if(_0x486688[_0x159a('0x34')]){var _0x5c5dae={};_0x5c5dae[_0x486688[_0x159a('0x34')]]=_0x1e1dcb;_[_0x159a('0x2f')](_0x3dc853[_0x159a('0x30')],_0x5c5dae);}return _0x4a28e6['sobject'](_0x159a('0x35'))[_0x159a('0x1f')](_0x3dc853,_0x291a2f);default:return null;}})[_0x159a('0x21')](function(_0x314d79){if(_0x314d79&&_0x314d79[_0x159a('0x22')]){var _0x5482ec=_[_0x159a('0x36')](_0x314d79);if(_0x5482ec){return BPromise[_0x159a('0x24')]({'id':_0x5482ec['Id'],'name':_0x5482ec[_0x159a('0x25')],'phone':_0x5482ec[_0x159a('0x37')],'endUserType':_0x5482ec['attributes'][_0x159a('0x38')][_0x159a('0x39')]()});}}})['then'](function(_0x285791){if(_0x285791){logger[_0x159a('0x26')](_0x159a('0x3a'),_0x285791[_0x159a('0x12')],_0x1e1dcb);return BPromise[_0x159a('0x24')](_0x285791);}else{logger[_0x159a('0x26')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x1e1dcb);var _0xea5537={'Phone':_0x1e1dcb};if(_0x486688[_0x159a('0x3b')]){if(_0x486688['moduleCreate']===_0x159a('0x18')){logger[_0x159a('0x26')](_0x159a('0x3c'),_0x1e1dcb,_0x486688[_0x159a('0x3b')]);_0xea5537['LastName']=_0x5648ed!==_0x159a('0x3d')?_0x5648ed:util[_0x159a('0x3e')](_0x159a('0x3f'),_0x1e1dcb);}else if(_0x486688[_0x159a('0x3b')]===_0x159a('0x13')){logger[_0x159a('0x26')](_0x159a('0x3c'),_0x1e1dcb,_0x486688[_0x159a('0x3b')]);_0xea5537[_0x159a('0x40')]=_0x5648ed!==_0x159a('0x3d')?_0x5648ed:util[_0x159a('0x3e')]('Caller\x20-\x20%s',_0x1e1dcb);_0xea5537['Company']='No\x20Company';}else if(_0x486688[_0x159a('0x3b')]===_0x159a('0x15')){logger[_0x159a('0x26')](_0x159a('0x3c'),_0x1e1dcb,_0x486688[_0x159a('0x3b')]);_0xea5537[_0x159a('0x25')]=_0x5648ed!==_0x159a('0x3d')?_0x5648ed:util['format'](_0x159a('0x3f'),_0x1e1dcb);}else{return null;}}return _0x4a28e6[_0x159a('0x1c')](_['upperFirst'](_0x486688[_0x159a('0x3b')]))[_0x159a('0x41')](_0xea5537)[_0x159a('0x21')](function(_0x34a1a0){return BPromise[_0x159a('0x24')]({'id':_0x34a1a0['id'],'endUserType':_0x486688['moduleCreate']});});}});}function getCustomFields(_0x3166fb,_0xbc9bf3){var _0x26b0be={};if(_0x3166fb[_0x159a('0x22')]>0x0){_[_0x159a('0x42')](_0x3166fb,function(_0x557f83){if(_[_0x159a('0x43')]([_0x159a('0x44'),_0x159a('0x45')],_0x557f83['type'])&&_0x557f83[_0x159a('0x46')]){_0x26b0be[_0x557f83['idField']]=_0x557f83[_0x159a('0x47')][_0x159a('0x48')]();}else if(_0x557f83[_0x159a('0x38')]===_0x159a('0x49')&&_0x557f83[_0x159a('0x4a')]&&_0x557f83[_0x159a('0x46')]){_0xbc9bf3[_0x557f83[_0x159a('0x4a')]]&&(_0x26b0be[_0x557f83[_0x159a('0x46')]]=_0xbc9bf3[_0x557f83[_0x159a('0x4a')]][_0x159a('0x48')]());}else if(_0x557f83[_0x159a('0x38')]===_0x159a('0x4b')&&_0x557f83['Variable']&&_0x557f83[_0x159a('0x4c')][_0x159a('0x4d')]&&_0x557f83['idField']){_0xbc9bf3[_0x557f83[_0x159a('0x4c')][_0x159a('0x4d')][_0x159a('0x39')]()]&&(_0x26b0be[_0x557f83[_0x159a('0x46')]]=_0xbc9bf3[_0x557f83[_0x159a('0x4c')][_0x159a('0x4d')][_0x159a('0x39')]()][_0x159a('0x48')]());}});}return _0x26b0be;}function getConnection(_0x17285a){var _0x30a250=_0x17285a['password']['concat'](_0x17285a[_0x159a('0x4e')]);var _0x82e9b2=new jsforce[(_0x159a('0x4f'))]({'oauth2':{'loginUrl':_0x17285a[_0x159a('0x50')]||_0x159a('0x51'),'clientId':_0x17285a[_0x159a('0x52')],'clientSecret':_0x17285a[_0x159a('0x53')]}});return _0x82e9b2[_0x159a('0x54')](_0x17285a[_0x159a('0x55')],_0x30a250)['then'](function(){logger[_0x159a('0x26')](_0x159a('0x56'));return _0x82e9b2;});}exports['queue']=function(_0x166c03,_0x2a66b5,_0x2dd739,_0x2bebed,_0x5ceb2a,_0x41b88a){var _0x57ce27,_0x276416,_0x58f765,_0x5f5636;_0x41b88a[_0x159a('0x57')]=intUtil[_0x159a('0x58')](_0x41b88a['serverUrl']);_0x41b88a[_0x159a('0x50')]=intUtil[_0x159a('0x58')](_0x41b88a[_0x159a('0x50')]);if(_0x5ceb2a&&_0x5ceb2a['monitor_format']){logger[_0x159a('0x26')](_0x159a('0x59'),_0x159a('0x5a'));_0x2a66b5['recordingURL']=util['format'](_0x159a('0x5b'),_0x41b88a[_0x159a('0x57')],_0x2a66b5[_0x159a('0x5c')],md5(_0x2a66b5[_0x159a('0x5c')]));}else{_0x2a66b5[_0x159a('0x5d')]='';}return getConnection(_0x41b88a)['then'](function(_0x3e63d1){_0x5f5636=_0x3e63d1;return getUser(_0x41b88a,_0x2bebed[_0x159a('0x5e')],_0x5f5636);})[_0x159a('0x21')](function(_0x441ab4){_0x57ce27=_0x441ab4;return getEndUser(_0x41b88a,_0x2dd739,_0x2a66b5[_0x159a('0x5f')],_0x2a66b5[_0x159a('0x60')],_0x5f5636);})['then'](function(_0x9c38b8){_0x276416=_0x9c38b8;return getTicket(_0x41b88a,_0x57ce27,_0x276416,_0x2dd739,_0x2a66b5,_0x2dd739['Fields'],_0x5f5636,'queue');})[_0x159a('0x21')](function(_0x5f1482){_0x58f765=_0x5f1482;logger[_0x159a('0x26')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x58f765['id']);logger['info'](_0x159a('0x61'),_0x58f765['id'],_0x2bebed[_0x159a('0x4d')],_0x41b88a[_0x159a('0x38')]);switch(_0x41b88a[_0x159a('0x38')]){case _0x159a('0x62'):emit(util[_0x159a('0x3e')](_0x159a('0x63'),_0x2bebed[_0x159a('0x4d')]),'trigger:salesforce:display',{'recordId':_0x58f765['id']});break;case _0x159a('0x64'):emit(util[_0x159a('0x3e')]('user:%s',_0x2bebed[_0x159a('0x4d')]),_0x159a('0x65'),{'uri':util[_0x159a('0x3e')]('%s/%s/e',_0x5f5636['instanceUrl'],_0x58f765['id'])});break;default:logger[_0x159a('0x66')](_0x159a('0x67'));}})[_0x159a('0x68')](function(_0x4b16e6){logger['error'](_0x159a('0x59'),_0x4b16e6);});};exports[_0x159a('0x69')]=function(_0x125d97,_0x7e2765,_0x3ce859,_0x51d2a6,_0x30fd9a,_0x492107,_0x14c4ca){var _0x4d19dd,_0x38bb6f,_0x5abb5b,_0x34cd47;_0x492107[_0x159a('0x57')]=intUtil[_0x159a('0x58')](_0x492107[_0x159a('0x57')]);_0x492107[_0x159a('0x50')]=intUtil['stripTrailingSlash'](_0x492107[_0x159a('0x50')]);if(_0x14c4ca&&_0x14c4ca[_0x159a('0x6a')]&&_0x14c4ca[_0x159a('0x6a')]!==_0x159a('0x6b')){logger[_0x159a('0x26')](_0x159a('0x6c'),_0x159a('0x5a'));_0x7e2765[_0x159a('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x492107[_0x159a('0x57')],_0x7e2765['uniqueid'],md5(_0x7e2765[_0x159a('0x5c')]));}return getConnection(_0x492107)[_0x159a('0x21')](function(_0x40ce54){_0x34cd47=_0x40ce54;return getUser(_0x492107,_0x51d2a6[_0x159a('0x5e')],_0x34cd47);})[_0x159a('0x21')](function(_0x4c2659){_0x4d19dd=_0x4c2659;return getEndUser(_0x492107,_0x3ce859,_0x7e2765[_0x159a('0x6d')],_0x7e2765['destcalleridnum'],_0x34cd47);})[_0x159a('0x21')](function(_0x5001e9){_0x38bb6f=_0x5001e9;return getTicket(_0x492107,_0x4d19dd,_0x38bb6f,_0x3ce859,_0x7e2765,_0x3ce859[_0x159a('0x6e')],_0x34cd47,_0x159a('0x69'));})['then'](function(_0x155637){_0x5abb5b=_0x155637;logger[_0x159a('0x26')](_0x159a('0x6f'),_0x5abb5b['id']);logger[_0x159a('0x26')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5abb5b['id'],_0x51d2a6['name'],_0x492107[_0x159a('0x38')]);switch(_0x492107[_0x159a('0x38')]){case _0x159a('0x62'):emit(util['format'](_0x159a('0x63'),_0x51d2a6[_0x159a('0x4d')]),_0x159a('0x70'),{'recordId':_0x5abb5b['id']});break;case _0x159a('0x64'):emit(util[_0x159a('0x3e')](_0x159a('0x63'),_0x51d2a6[_0x159a('0x4d')]),_0x159a('0x65'),{'uri':util[_0x159a('0x3e')](_0x159a('0x71'),_0x34cd47[_0x159a('0x72')],_0x5abb5b['id'])});break;default:logger['error'](_0x159a('0x6c'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x159a('0x68')](function(_0x3ed507){logger[_0x159a('0x66')](_0x159a('0x6c'),_0x3ed507);});};exports['unmanaged']=function(_0x55351b,_0x5d1122,_0x1a87cb,_0x2a89ca,_0x1fd71c,_0x5288b7){var _0x1a257b,_0x230b30,_0x3f7eb4,_0x460a5f;_0x5288b7[_0x159a('0x57')]=intUtil[_0x159a('0x58')](_0x5288b7[_0x159a('0x57')]);_0x5288b7[_0x159a('0x50')]=intUtil['stripTrailingSlash'](_0x5288b7['remoteUri']);if(_0x1fd71c&&_0x1fd71c[_0x159a('0x73')]){logger[_0x159a('0x26')]('['+_0x5d1122[_0x159a('0x74')][_0x159a('0x75')]()+']','Recording\x20is\x20enabled!');_0x5d1122['recordingURL']=util[_0x159a('0x3e')](_0x159a('0x5b'),_0x5288b7[_0x159a('0x57')],_0x5d1122[_0x159a('0x5c')],md5(_0x5d1122[_0x159a('0x5c')]));}else{_0x5d1122[_0x159a('0x5d')]='';}return getConnection(_0x5288b7)[_0x159a('0x21')](function(_0x2cce6e){_0x460a5f=_0x2cce6e;if(!_[_0x159a('0x76')](_0x2a89ca)){return getUser(_0x5288b7,_0x2a89ca[_0x159a('0x4d')],_0x460a5f);}else{return getUser(_0x5288b7,null,_0x460a5f);}})[_0x159a('0x21')](function(_0x1f8d5e){_0x1a257b=_0x1f8d5e;return getEndUser(_0x5288b7,_0x1a87cb,_0x5d1122[_0x159a('0x5f')],_0x5d1122['calleridnum'],_0x460a5f);})[_0x159a('0x21')](function(_0x24b514){_0x230b30=_0x24b514;return getTicket(_0x5288b7,_0x1a257b,_0x230b30,_0x1a87cb,_0x5d1122,_0x1a87cb[_0x159a('0x6e')],_0x460a5f);})['then'](function(_0x3b228f){_0x3f7eb4=_0x3b228f;logger['info']('['+_0x5d1122['lastevent'][_0x159a('0x75')]()+_0x159a('0x77'),_0x3f7eb4['id']);logger[_0x159a('0x26')]('['+_0x5d1122[_0x159a('0x74')]['toUpperCase']()+_0x159a('0x78'),_0x5288b7['type']);})[_0x159a('0x68')](function(_0x60dcb9){logger['error']('['+_0x5d1122[_0x159a('0x74')][_0x159a('0x75')]()+']',_0x60dcb9);});}; \ No newline at end of file +var _0x68a7=['LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','Name','upperFirst','create','forEach','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','length','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','Lead','additionalSearchAccount','$or','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.'];(function(_0x1aac6d,_0x44a251){var _0xfcba03=function(_0x1d9db8){while(--_0x1d9db8){_0x1aac6d['push'](_0x1aac6d['shift']());}};_0xfcba03(++_0x44a251);}(_0x68a7,0xce));var _0x768a=function(_0xec0d71,_0x2c44e8){_0xec0d71=_0xec0d71-0x0;var _0x23e2b0=_0x68a7[_0xec0d71];return _0x23e2b0;};'use strict';var _=require(_0x768a('0x0'));var rp=require(_0x768a('0x1'));var moment=require('moment');var BPromise=require(_0x768a('0x2'));var md5=require(_0x768a('0x3'));var jsforce=require(_0x768a('0x4'));var util=require(_0x768a('0x5'));var Redis=require(_0x768a('0x6'));var intUtil=require('./util');var config=require(_0x768a('0x7'));var logger=require(_0x768a('0x8'))(_0x768a('0x9'));config[_0x768a('0xa')]=_[_0x768a('0xb')](config[_0x768a('0xa')],{'host':_0x768a('0xc'),'port':0x18eb});var io=require(_0x768a('0xd'))(new Redis(config['redis']));function emit(_0x488334,_0x2f68c7,_0x4a648a){io['to'](_0x488334)['emit'](_0x2f68c7,_0x4a648a);}function getTicket(_0x436819,_0x28d358,_0x11c081,_0x1f8205,_0x57148f,_0x1cd898,_0x4802cb,_0x2bf4de){var _0x21392c=Object[_0x768a('0xe')]({},{'OwnerId':_0x28d358['id'],'Subject':intUtil[_0x768a('0xf')](_0x1f8205['Subjects'],_0x57148f,'\x20'),'Description':intUtil[_0x768a('0xf')](_0x1f8205[_0x768a('0x10')],_0x57148f,'\x0a')},getCustomFields(_0x1cd898,_0x57148f));if(_0x11c081){if(_0x1f8205[_0x768a('0x11')]===_0x768a('0x12')){_0x21392c[_0x768a('0x13')]=moment[_0x768a('0x14')]();_0x21392c['IsReminderSet']=![];_0x21392c[_0x768a('0x15')]=![];if(_0x11c081[_0x768a('0x16')]===_0x768a('0x17')||_0x11c081['endUserType']==='lead'){_0x21392c[_0x768a('0x18')]=_0x11c081['id'];}else if(_0x11c081[_0x768a('0x16')]==='account'){_0x21392c[_0x768a('0x19')]=_0x11c081['id'];}}else if(_0x1f8205[_0x768a('0x11')]===_0x768a('0x1a')){if(_0x11c081['endUserType']===_0x768a('0x17')){_0x21392c[_0x768a('0x1b')]=_0x11c081['id'];}else if(_0x11c081[_0x768a('0x16')]===_0x768a('0x1c')){_0x21392c[_0x768a('0x1d')]=_0x11c081['id'];}else if(_0x11c081['endUserType']==='lead'&&_0x1f8205[_0x768a('0x1e')]){_0x21392c[_0x1f8205[_0x768a('0x1e')]]=_0x11c081['id'];}else{logger[_0x768a('0x1f')](_0x768a('0x20'));}}}return _0x4802cb[_0x768a('0x21')](_0x1f8205[_0x768a('0x11')])['create'](_0x21392c);}function getUser(_0x11adb3,_0xba5d03,_0x22f682){if(!_[_0x768a('0x22')](_0xba5d03)&&intUtil[_0x768a('0x23')](_0xba5d03)){var _0x393cba={'Email':_0xba5d03};var _0x4e557c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x22f682[_0x768a('0x21')](_0x768a('0x24'))[_0x768a('0x25')](_0x393cba,_0x4e557c)[_0x768a('0x26')]()['then'](function(_0x35d189){if(_0x35d189[_0x768a('0x27')]){var _0x58e191=_['find'](_0x35d189,function(_0x31bd1c){return _0x31bd1c[_0x768a('0x28')]===_0xba5d03;});if(_0x58e191){logger[_0x768a('0x1f')](_0x768a('0x29'),_0xba5d03);return BPromise[_0x768a('0x2a')]({'id':_0x58e191['Id'],'name':_0x58e191['Name']});}}else{logger['info'](_0x768a('0x2b'),_0xba5d03);return _0x22f682[_0x768a('0x2c')]()[_0x768a('0x2d')](function(_0x48fcaa){return BPromise[_0x768a('0x2a')]({'id':_0x48fcaa[_0x768a('0x2e')],'name':_0x48fcaa[_0x768a('0x2f')]});});}});}else{logger[_0x768a('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xba5d03);return _0x22f682[_0x768a('0x2c')]()[_0x768a('0x2d')](function(_0x5bd49f){return BPromise['resolve']({'id':_0x5bd49f[_0x768a('0x2e')],'name':_0x5bd49f[_0x768a('0x2f')]});});}}function getEndUser(_0x3e2620,_0x4fa865,_0x1dd6ed,_0x235ae9,_0x348668){var _0x197305={'$or':{'Phone':_0x235ae9}};var _0x578c2c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x768a('0x2a')]()['then'](function(){logger[_0x768a('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x235ae9,_0x4fa865['moduleSearch']);switch(_0x4fa865[_0x768a('0x30')]){case _0x768a('0x31'):var _0x33f382=_[_0x768a('0x32')](_0x197305);if(_0x4fa865['additionalSearchContact']){var _0x546802={};_0x546802[_0x4fa865[_0x768a('0x33')]]=_0x235ae9;_['merge'](_0x33f382['$or'],_0x546802);}return _0x348668[_0x768a('0x21')](_0x768a('0x34'))[_0x768a('0x25')](_0x33f382,_0x578c2c)[_0x768a('0x26')]()[_0x768a('0x2d')](function(_0x24cca2){if(_0x24cca2&&_0x24cca2['length']){return _0x24cca2;}else{var _0x36ad80=_[_0x768a('0x32')](_0x197305);if(_0x4fa865['additionalSearchLead']){var _0x510e76={};_0x510e76[_0x4fa865[_0x768a('0x35')]]=_0x235ae9;_[_0x768a('0x36')](_0x36ad80['$or'],_0x510e76);}return _0x348668[_0x768a('0x21')](_0x768a('0x37'))['find'](_0x36ad80,_0x578c2c);}});case'account_contact_lead':var _0x3c48bb=_['cloneDeep'](_0x197305);if(_0x4fa865[_0x768a('0x38')]){var _0x546802={};_0x546802[_0x4fa865[_0x768a('0x38')]]=_0x235ae9;_['merge'](_0x3c48bb['$or'],_0x546802);}return _0x348668[_0x768a('0x21')]('Account')[_0x768a('0x25')](_0x3c48bb,_0x578c2c)[_0x768a('0x26')]()[_0x768a('0x2d')](function(_0xf9cb50){if(_0xf9cb50&&_0xf9cb50[_0x768a('0x27')]){return _0xf9cb50;}else{var _0x2fe530=_[_0x768a('0x32')](_0x197305);if(_0x4fa865['additionalSearchContact']){var _0x570bfe={};_0x570bfe[_0x4fa865[_0x768a('0x33')]]=_0x235ae9;_[_0x768a('0x36')](_0x2fe530[_0x768a('0x39')],_0x570bfe);}return _0x348668[_0x768a('0x21')](_0x768a('0x34'))['find'](_0x2fe530,_0x578c2c)[_0x768a('0x2d')](function(_0x162564){if(_0x162564&&_0x162564['length']){return _0x162564;}else{var _0x681893=_[_0x768a('0x32')](_0x197305);if(_0x4fa865[_0x768a('0x35')]){var _0x807359={};_0x807359[_0x4fa865['additionalSearchLead']]=_0x235ae9;_[_0x768a('0x36')](_0x681893[_0x768a('0x39')],_0x807359);}return _0x348668[_0x768a('0x21')]('Lead')['find'](_0x681893,_0x578c2c);}});}});case _0x768a('0x17'):var _0x33f382=_[_0x768a('0x32')](_0x197305);if(_0x4fa865[_0x768a('0x33')]){var _0x546802={};_0x546802[_0x4fa865['additionalSearchContact']]=_0x235ae9;_[_0x768a('0x36')](_0x33f382[_0x768a('0x39')],_0x546802);}return _0x348668[_0x768a('0x21')]('Contact')['find'](_0x33f382,_0x578c2c)[_0x768a('0x26')]();case'lead':var _0xea3990=_['cloneDeep'](_0x197305);if(_0x4fa865[_0x768a('0x35')]){var _0x546802={};_0x546802[_0x4fa865['additionalSearchLead']]=_0x235ae9;_[_0x768a('0x36')](_0xea3990['$or'],_0x546802);}return _0x348668[_0x768a('0x21')](_0x768a('0x37'))[_0x768a('0x25')](_0xea3990,_0x578c2c);case _0x768a('0x1c'):var _0x3c48bb=_[_0x768a('0x32')](_0x197305);if(_0x4fa865['additionalSearchAccount']){var _0x546802={};_0x546802[_0x4fa865['additionalSearchAccount']]=_0x235ae9;_['merge'](_0x3c48bb[_0x768a('0x39')],_0x546802);}return _0x348668[_0x768a('0x21')](_0x768a('0x3a'))[_0x768a('0x25')](_0x3c48bb,_0x578c2c);default:return null;}})[_0x768a('0x2d')](function(_0xf45d32){if(_0xf45d32&&_0xf45d32[_0x768a('0x27')]){var _0x3185d9=_[_0x768a('0x3b')](_0xf45d32);if(_0x3185d9){return BPromise[_0x768a('0x2a')]({'id':_0x3185d9['Id'],'name':_0x3185d9['Name'],'phone':_0x3185d9[_0x768a('0x3c')],'endUserType':_0x3185d9[_0x768a('0x3d')][_0x768a('0x3e')][_0x768a('0x3f')]()});}}})[_0x768a('0x2d')](function(_0x39b4e6){if(_0x39b4e6){logger[_0x768a('0x1f')](_0x768a('0x40'),_0x39b4e6[_0x768a('0x16')],_0x235ae9);return BPromise[_0x768a('0x2a')](_0x39b4e6);}else{logger[_0x768a('0x1f')](_0x768a('0x41'),_0x235ae9);var _0x5cae99={'Phone':_0x235ae9};if(_0x4fa865['moduleCreate']){if(_0x4fa865[_0x768a('0x42')]===_0x768a('0x17')){logger['info'](_0x768a('0x43'),_0x235ae9,_0x4fa865[_0x768a('0x42')]);_0x5cae99[_0x768a('0x44')]=_0x1dd6ed!==_0x768a('0x45')?_0x1dd6ed:util[_0x768a('0x46')](_0x768a('0x47'),_0x235ae9);}else if(_0x4fa865[_0x768a('0x42')]==='lead'){logger['info'](_0x768a('0x43'),_0x235ae9,_0x4fa865[_0x768a('0x42')]);_0x5cae99[_0x768a('0x44')]=_0x1dd6ed!==_0x768a('0x45')?_0x1dd6ed:util[_0x768a('0x46')]('Caller\x20-\x20%s',_0x235ae9);_0x5cae99[_0x768a('0x48')]=_0x768a('0x49');}else if(_0x4fa865[_0x768a('0x42')]==='account'){logger['info'](_0x768a('0x43'),_0x235ae9,_0x4fa865['moduleCreate']);_0x5cae99[_0x768a('0x4a')]=_0x1dd6ed!==_0x768a('0x45')?_0x1dd6ed:util['format'](_0x768a('0x47'),_0x235ae9);}else{return null;}}return _0x348668[_0x768a('0x21')](_[_0x768a('0x4b')](_0x4fa865[_0x768a('0x42')]))[_0x768a('0x4c')](_0x5cae99)[_0x768a('0x2d')](function(_0x3f6fe6){return BPromise['resolve']({'id':_0x3f6fe6['id'],'endUserType':_0x4fa865[_0x768a('0x42')]});});}});}function getCustomFields(_0x8d8342,_0x15da90){var _0x529215={};if(_0x8d8342[_0x768a('0x27')]>0x0){_[_0x768a('0x4d')](_0x8d8342,function(_0x3fae02){if(_['includes']([_0x768a('0x4e'),_0x768a('0x4f')],_0x3fae02['type'])&&_0x3fae02[_0x768a('0x50')]){_0x529215[_0x3fae02[_0x768a('0x50')]]=_0x3fae02[_0x768a('0x51')]['toString']();}else if(_0x3fae02['type']==='variable'&&_0x3fae02['variableName']&&_0x3fae02[_0x768a('0x50')]){_0x15da90[_0x3fae02[_0x768a('0x52')]]&&(_0x529215[_0x3fae02[_0x768a('0x50')]]=_0x15da90[_0x3fae02[_0x768a('0x52')]][_0x768a('0x53')]());}else if(_0x3fae02[_0x768a('0x3e')]===_0x768a('0x54')&&_0x3fae02[_0x768a('0x55')]&&_0x3fae02[_0x768a('0x55')][_0x768a('0x56')]&&_0x3fae02[_0x768a('0x50')]){_0x15da90[_0x3fae02[_0x768a('0x55')]['name'][_0x768a('0x3f')]()]&&(_0x529215[_0x3fae02[_0x768a('0x50')]]=_0x15da90[_0x3fae02[_0x768a('0x55')][_0x768a('0x56')][_0x768a('0x3f')]()][_0x768a('0x53')]());}});}return _0x529215;}function getConnection(_0x23d66){var _0x335927=_0x23d66[_0x768a('0x57')][_0x768a('0x58')](_0x23d66[_0x768a('0x59')]);var _0x19c7f4=new jsforce[(_0x768a('0x5a'))]({'oauth2':{'loginUrl':_0x23d66['remoteUri']||_0x768a('0x5b'),'clientId':_0x23d66[_0x768a('0x5c')],'clientSecret':_0x23d66[_0x768a('0x5d')]}});return _0x19c7f4[_0x768a('0x5e')](_0x23d66[_0x768a('0x5f')],_0x335927)[_0x768a('0x2d')](function(){logger['info'](_0x768a('0x60'));return _0x19c7f4;});}exports[_0x768a('0x61')]=function(_0x3efed9,_0x11a340,_0x2ff56c,_0x284be2,_0x24adcf,_0x52e449){var _0x45df03,_0x2c9b66,_0x3605bd,_0x254923;_0x52e449[_0x768a('0x62')]=intUtil[_0x768a('0x63')](_0x52e449[_0x768a('0x62')]);_0x52e449[_0x768a('0x64')]=intUtil[_0x768a('0x63')](_0x52e449[_0x768a('0x64')]);if(_0x24adcf&&_0x24adcf[_0x768a('0x65')]){logger[_0x768a('0x1f')](_0x768a('0x66'),_0x768a('0x67'));_0x11a340[_0x768a('0x68')]=util[_0x768a('0x46')](_0x768a('0x69'),_0x52e449[_0x768a('0x62')],_0x11a340[_0x768a('0x6a')],md5(_0x11a340[_0x768a('0x6a')]));}else{_0x11a340[_0x768a('0x68')]='';}return getConnection(_0x52e449)['then'](function(_0x47cbf5){_0x254923=_0x47cbf5;return getUser(_0x52e449,_0x284be2['email'],_0x254923);})['then'](function(_0x6601a8){_0x45df03=_0x6601a8;return getEndUser(_0x52e449,_0x2ff56c,_0x11a340[_0x768a('0x6b')],_0x11a340['calleridnum'],_0x254923);})[_0x768a('0x2d')](function(_0x19e415){_0x2c9b66=_0x19e415;return getTicket(_0x52e449,_0x45df03,_0x2c9b66,_0x2ff56c,_0x11a340,_0x2ff56c[_0x768a('0x6c')],_0x254923,_0x768a('0x61'));})[_0x768a('0x2d')](function(_0x226268){_0x3605bd=_0x226268;logger[_0x768a('0x1f')](_0x768a('0x6d'),_0x3605bd['id']);logger[_0x768a('0x1f')](_0x768a('0x6e'),_0x3605bd['id'],_0x284be2[_0x768a('0x56')],_0x52e449['type']);switch(_0x52e449[_0x768a('0x3e')]){case'integrationTab':emit(util[_0x768a('0x46')](_0x768a('0x6f'),_0x284be2[_0x768a('0x56')]),_0x768a('0x70'),{'recordId':_0x3605bd['id']});break;case _0x768a('0x71'):emit(util[_0x768a('0x46')]('user:%s',_0x284be2['name']),_0x768a('0x72'),{'uri':util['format'](_0x768a('0x73'),_0x254923[_0x768a('0x74')],_0x3605bd['id'])});break;default:logger[_0x768a('0x75')](_0x768a('0x76'));}})[_0x768a('0x77')](function(_0x408739){logger[_0x768a('0x75')](_0x768a('0x66'),_0x408739);});};exports[_0x768a('0x78')]=function(_0x1a3ab7,_0x44c5da,_0x513dbd,_0x4c64b9,_0x112ba9,_0x10f5d2,_0x2b2249){var _0x4b1e53,_0xbc4f2e,_0x5522ca,_0x1b4916;_0x10f5d2['serverUrl']=intUtil['stripTrailingSlash'](_0x10f5d2[_0x768a('0x62')]);_0x10f5d2['remoteUri']=intUtil[_0x768a('0x63')](_0x10f5d2[_0x768a('0x64')]);if(_0x2b2249&&_0x2b2249[_0x768a('0x79')]&&_0x2b2249[_0x768a('0x79')]!==_0x768a('0x7a')){logger[_0x768a('0x1f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x44c5da[_0x768a('0x68')]=util[_0x768a('0x46')](_0x768a('0x69'),_0x10f5d2[_0x768a('0x62')],_0x44c5da[_0x768a('0x6a')],md5(_0x44c5da[_0x768a('0x6a')]));}return getConnection(_0x10f5d2)[_0x768a('0x2d')](function(_0x1a6fae){_0x1b4916=_0x1a6fae;return getUser(_0x10f5d2,_0x4c64b9[_0x768a('0x7b')],_0x1b4916);})[_0x768a('0x2d')](function(_0x1d756c){_0x4b1e53=_0x1d756c;return getEndUser(_0x10f5d2,_0x513dbd,_0x44c5da[_0x768a('0x7c')],_0x44c5da[_0x768a('0x7d')],_0x1b4916);})['then'](function(_0x4b7b7a){_0xbc4f2e=_0x4b7b7a;return getTicket(_0x10f5d2,_0x4b1e53,_0xbc4f2e,_0x513dbd,_0x44c5da,_0x513dbd['Fields'],_0x1b4916,'outbound');})[_0x768a('0x2d')](function(_0x4fe785){_0x5522ca=_0x4fe785;logger[_0x768a('0x1f')](_0x768a('0x7e'),_0x5522ca['id']);logger['info'](_0x768a('0x7f'),_0x5522ca['id'],_0x4c64b9['name'],_0x10f5d2[_0x768a('0x3e')]);switch(_0x10f5d2[_0x768a('0x3e')]){case _0x768a('0x80'):emit(util[_0x768a('0x46')](_0x768a('0x6f'),_0x4c64b9[_0x768a('0x56')]),_0x768a('0x70'),{'recordId':_0x5522ca['id']});break;case _0x768a('0x71'):emit(util[_0x768a('0x46')]('user:%s',_0x4c64b9[_0x768a('0x56')]),_0x768a('0x72'),{'uri':util[_0x768a('0x46')](_0x768a('0x73'),_0x1b4916['instanceUrl'],_0x5522ca['id'])});break;default:logger[_0x768a('0x75')](_0x768a('0x81'),_0x768a('0x82'));}})['catch'](function(_0x2c1a9f){logger['error'](_0x768a('0x81'),_0x2c1a9f);});};exports[_0x768a('0x83')]=function(_0x1393b4,_0x20c8b8,_0x165cd3,_0x35bd53,_0x41740c,_0x1b28dd){var _0x5a99ea,_0x3053ab,_0xc017e5,_0x475102;_0x1b28dd[_0x768a('0x62')]=intUtil[_0x768a('0x63')](_0x1b28dd['serverUrl']);_0x1b28dd[_0x768a('0x64')]=intUtil[_0x768a('0x63')](_0x1b28dd[_0x768a('0x64')]);if(_0x41740c&&_0x41740c[_0x768a('0x65')]){logger[_0x768a('0x1f')]('['+_0x20c8b8[_0x768a('0x84')][_0x768a('0x85')]()+']',_0x768a('0x67'));_0x20c8b8[_0x768a('0x68')]=util['format'](_0x768a('0x69'),_0x1b28dd['serverUrl'],_0x20c8b8[_0x768a('0x6a')],md5(_0x20c8b8[_0x768a('0x6a')]));}else{_0x20c8b8[_0x768a('0x68')]='';}return getConnection(_0x1b28dd)['then'](function(_0x2fd6d0){_0x475102=_0x2fd6d0;if(!_[_0x768a('0x22')](_0x35bd53)){return getUser(_0x1b28dd,_0x35bd53[_0x768a('0x56')],_0x475102);}else{return getUser(_0x1b28dd,null,_0x475102);}})[_0x768a('0x2d')](function(_0x57b042){_0x5a99ea=_0x57b042;return getEndUser(_0x1b28dd,_0x165cd3,_0x20c8b8[_0x768a('0x6b')],_0x20c8b8[_0x768a('0x86')],_0x475102);})[_0x768a('0x2d')](function(_0x58d8f3){_0x3053ab=_0x58d8f3;return getTicket(_0x1b28dd,_0x5a99ea,_0x3053ab,_0x165cd3,_0x20c8b8,_0x165cd3[_0x768a('0x6c')],_0x475102);})[_0x768a('0x2d')](function(_0x476298){_0xc017e5=_0x476298;logger['info']('['+_0x20c8b8[_0x768a('0x84')][_0x768a('0x85')]()+_0x768a('0x87'),_0xc017e5['id']);logger[_0x768a('0x1f')]('['+_0x20c8b8['lastevent'][_0x768a('0x85')]()+_0x768a('0x88'),_0x1b28dd[_0x768a('0x3e')]);})[_0x768a('0x77')](function(_0x651c44){logger[_0x768a('0x75')]('['+_0x20c8b8['lastevent'][_0x768a('0x85')]()+']',_0x651c44);});}; \ 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 1cc70bf..0910a9b 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 _0xc1b4=['],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','Incident','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20entity','length','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc1b4,0xae));var _0x4c1b=function(_0x4e451e,_0x33ac5e){_0x4e451e=_0x4e451e-0x0;var _0x17519f=_0xc1b4[_0x4e451e];return _0x17519f;};'use strict';var _=require(_0x4c1b('0x0'));var Promise=require(_0x4c1b('0x1'));var rp=require(_0x4c1b('0x2'));var util=require(_0x4c1b('0x3'));var md5=require(_0x4c1b('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x4c1b('0x5'));var logger=require(_0x4c1b('0x6'))(_0x4c1b('0x7'));config[_0x4c1b('0x8')]=_[_0x4c1b('0x9')](config['redis'],{'host':_0x4c1b('0xa'),'port':0x18eb});var io=require(_0x4c1b('0xb'))(new Redis(config[_0x4c1b('0x8')]));function getAdminUser(_0x59589f,_0x5af0ce,_0x45b608,_0x393c55,_0x105dd5,_0x3786ab){return new Promise(function(_0x24c34b,_0x39a9c7){var _0x565948={'method':_0x4c1b('0xc'),'uri':_0x393c55+_0x4c1b('0xd')+'&'+_0x105dd5+'&'+_0x3786ab,'auth':_0x5af0ce,'json':!![]};return rp(_0x565948)[_0x4c1b('0xe')](function(_0x2e078d){if(_0x2e078d[_0x4c1b('0xf')]['length']>0x0){_0x45b608[_0x4c1b('0x10')]=_0x2e078d[_0x4c1b('0xf')][0x0][_0x4c1b('0x11')];}logger['info']('['+[_0x59589f[_0x4c1b('0x12')]()]+'],\x20getAdminUser\x20crm',_0x45b608);_0x24c34b(_0x45b608);})[_0x4c1b('0x13')](function(_0x4d16e4){logger[_0x4c1b('0x14')]('['+[_0x59589f[_0x4c1b('0x12')]()]+']',_0x4d16e4['message']);_0x39a9c7(_0x4d16e4[_0x4c1b('0x15')]);});});}function getUser(_0x4a4855,_0x434afe,_0xaa6a4a,_0x1f749a,_0x551877){return function(_0x3f26ef){logger['info']('['+[_0x4a4855[_0x4c1b('0x12')]()]+_0x4c1b('0x16'),_0x3f26ef);return new Promise(function(_0x2c6756,_0x413b7a){if(intUtil[_0x4c1b('0x17')](_0x3f26ef[_0x4c1b('0x18')])){var _0x574b7d={'method':'GET','uri':_0xaa6a4a+_0x4c1b('0x19')+_0x3f26ef['userEmail']+'&'+_0x1f749a+'&'+_0x551877,'auth':_0x434afe,'json':!![]};logger['info']('['+[_0x4a4855[_0x4c1b('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x574b7d);return rp(_0x574b7d)['then'](function(_0x2227ab){logger[_0x4c1b('0x1a')]('['+[_0x4a4855['toUpperCase']()]+_0x4c1b('0x1b'),_0x2227ab);if(_0x2227ab['result'][_0x4c1b('0x1c')]>0x0&&String(_0x2227ab[_0x4c1b('0xf')][0x0]['active'])===_0x4c1b('0x1d')){_0x3f26ef[_0x4c1b('0x1e')]=_0x2227ab[_0x4c1b('0xf')][0x0]['sys_id'];}else{_0x3f26ef[_0x4c1b('0x1e')]=_0x3f26ef[_0x4c1b('0x10')];_0x3f26ef[_0x4c1b('0x18')]=_0x3f26ef[_0x4c1b('0x1f')];}logger[_0x4c1b('0x1a')]('['+[_0x4a4855[_0x4c1b('0x12')]()]+'],\x20getUser\x20crm',_0x3f26ef);_0x2c6756(_0x3f26ef);})[_0x4c1b('0x13')](function(_0x4cac1e){logger[_0x4c1b('0x14')]('['+[_0x4a4855[_0x4c1b('0x12')]()]+']',_0x4cac1e[_0x4c1b('0x15')]);_0x413b7a(_0x4cac1e[_0x4c1b('0x15')]);});}else{logger[_0x4c1b('0x1a')]('['+[_0x4a4855[_0x4c1b('0x12')]()]+_0x4c1b('0x20'));_0x3f26ef[_0x4c1b('0x1e')]=_0x3f26ef['adminId'];_0x3f26ef[_0x4c1b('0x18')]=_0x3f26ef[_0x4c1b('0x1f')];_0x2c6756(_0x3f26ef);}});};}function createEndUser(_0x450822,_0x86c691,_0x221ea6,_0x3d8f29,_0x5e1fab){logger['info']('['+[_0x450822[_0x4c1b('0x12')]()]+_0x4c1b('0x21'),_0x221ea6);return new Promise(function(_0x3bcc3a,_0x4767ff){var _0x5d80fe={'method':'POST','uri':_0x3d8f29+_0x4c1b('0x22')+_0x5e1fab,'body':{'user_name':_0x221ea6[_0x4c1b('0x23')],'roles':_0x4c1b('0x24'),'first_name':_0x221ea6[_0x4c1b('0x23')],'active':_0x4c1b('0x1d'),'date_format':_0x4c1b('0x25'),'phone':_0x221ea6['endUserNumber']},'auth':_0x86c691,'json':!![]};return rp(_0x5d80fe)['then'](function(_0x494abe){logger[_0x4c1b('0x1a')]('['+[_0x450822[_0x4c1b('0x12')]()]+_0x4c1b('0x26'),_0x494abe[_0x4c1b('0xf')]);_0x221ea6['endUserId']=_0x494abe[_0x4c1b('0xf')][_0x4c1b('0x11')];_0x3bcc3a(_0x221ea6);})[_0x4c1b('0x13')](function(_0x4d8c24){logger[_0x4c1b('0x14')]('['+[_0x450822[_0x4c1b('0x12')]()]+']',_0x4d8c24[_0x4c1b('0x15')]);_0x4767ff(_0x4d8c24[_0x4c1b('0x15')]);});});}function getEndUser(_0x5c9709,_0x5ed273,_0x3b0233,_0x524096,_0x71210b){return function(_0x475cc7){logger[_0x4c1b('0x1a')]('['+[_0x5c9709[_0x4c1b('0x12')]()]+_0x4c1b('0x27'),_0x475cc7);return new Promise(function(_0x27214a,_0x4bc566){var _0x111c8c={'method':_0x4c1b('0xc'),'uri':_0x3b0233+'sys_user?sysparm_query=phone%3D'+_0x475cc7[_0x4c1b('0x23')]+'&'+_0x524096+'&'+_0x71210b,'auth':_0x5ed273,'json':!![]};return rp(_0x111c8c)['then'](function(_0x1a6da0){if(_0x1a6da0[_0x4c1b('0xf')][_0x4c1b('0x1c')]>0x0){_0x475cc7['endUserId']=_0x1a6da0[_0x4c1b('0xf')][0x0]['sys_id'];logger[_0x4c1b('0x1a')]('['+[_0x5c9709[_0x4c1b('0x12')]()]+_0x4c1b('0x28'),_0x475cc7);_0x27214a(_0x475cc7);}else{return createEndUser(_0x5c9709,_0x5ed273,_0x475cc7,_0x3b0233,_0x524096)['then'](function(_0x225eaf){logger[_0x4c1b('0x1a')]('['+[_0x5c9709['toUpperCase']()]+_0x4c1b('0x29'),_0x225eaf);_0x27214a(_0x225eaf);});}})['catch'](function(_0x2f6685){logger[_0x4c1b('0x14')]('['+[_0x5c9709['toUpperCase']()]+']',_0x2f6685[_0x4c1b('0x15')]);_0x4bc566(_0x2f6685[_0x4c1b('0x15')]);});});};}function getCustomFields(_0x364524,_0x3d01f1){var _0x25250a={};if(_0x364524['length']>0x0){_[_0x4c1b('0x2a')](_0x364524,function(_0x1064d3){if(_[_0x4c1b('0x2b')]([_0x4c1b('0x2c'),_0x4c1b('0x2d')],_0x1064d3[_0x4c1b('0x2e')])&&_0x1064d3[_0x4c1b('0x2f')]&&!_0x1064d3['customField']){_0x25250a[_0x1064d3[_0x4c1b('0x2f')][_0x4c1b('0x30')]()]=_0x1064d3[_0x4c1b('0x31')][_0x4c1b('0x32')]();}else if(_[_0x4c1b('0x2b')]([_0x4c1b('0x2c'),_0x4c1b('0x2d')],_0x1064d3['type'])&&_0x1064d3[_0x4c1b('0x33')]&&_0x1064d3[_0x4c1b('0x34')]){_0x25250a[_0x1064d3[_0x4c1b('0x33')][_0x4c1b('0x30')]()]=_0x1064d3[_0x4c1b('0x31')][_0x4c1b('0x32')]();}else if(_0x1064d3[_0x4c1b('0x2e')]===_0x4c1b('0x35')&&_0x1064d3[_0x4c1b('0x36')]&&_0x1064d3[_0x4c1b('0x33')]&&_0x1064d3['customField']){_0x25250a[_0x1064d3[_0x4c1b('0x33')][_0x4c1b('0x30')]()]=_0x3d01f1[_0x1064d3['variableName']][_0x4c1b('0x32')]();}else if(_0x1064d3[_0x4c1b('0x2e')]===_0x4c1b('0x37')&&_0x1064d3[_0x4c1b('0x38')]&&_0x1064d3[_0x4c1b('0x38')][_0x4c1b('0x39')]&&_0x1064d3[_0x4c1b('0x33')]&&_0x1064d3['customField']){_0x25250a[_0x1064d3[_0x4c1b('0x33')][_0x4c1b('0x30')]()]=_0x3d01f1[_0x1064d3[_0x4c1b('0x38')]['name']['toLowerCase']()][_0x4c1b('0x32')]();}});}return _0x25250a;}function getTicket(_0x1190e3,_0x3f8c18,_0x1f4391,_0x2e2069,_0x2df264,_0x4e60c0){return function(_0x476de6){logger[_0x4c1b('0x1a')]('['+[_0x1190e3[_0x4c1b('0x12')]()]+_0x4c1b('0x3a'),_0x476de6);return new Promise(function(_0x4093e1,_0x3c80b5){var _0x10dd2c=_0x1190e3[_0x4c1b('0x30')]()===_0x4c1b('0x3b')?_0x476de6[_0x4c1b('0x1e')]:_0x476de6[_0x4c1b('0x3c')];var _0x79d42={'method':'POST','uri':_0x1f4391+'incident'+'?'+_0x4e60c0,'body':Object[_0x4c1b('0x3d')]({},{'active':_0x4c1b('0x1d'),'caller_id':_0x10dd2c,'assigned_to':_0x476de6[_0x4c1b('0x1e')],'short_description':intUtil[_0x4c1b('0x3e')](_0x2e2069[_0x4c1b('0x3f')],_0x2df264,'\x20'),'description':intUtil[_0x4c1b('0x3e')](_0x2e2069[_0x4c1b('0x40')],_0x2df264,'\x0a')},getCustomFields(_0x2e2069[_0x4c1b('0x41')],_0x2df264)),'auth':_0x3f8c18,'json':!![]};return rp(_0x79d42)['then'](function(_0x42ed63){logger['info']('['+[_0x1190e3[_0x4c1b('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x42ed63['result']);_0x476de6[_0x4c1b('0x42')]=_0x42ed63[_0x4c1b('0xf')][_0x4c1b('0x11')];_0x476de6[_0x4c1b('0x43')]=_0x42ed63['result'][_0x4c1b('0x44')];logger['info']('['+[_0x1190e3[_0x4c1b('0x12')]()]+_0x4c1b('0x45'),_0x476de6);_0x4093e1(_0x476de6);})[_0x4c1b('0x13')](function(_0x497386){logger[_0x4c1b('0x14')]('['+[_0x1190e3[_0x4c1b('0x12')]()]+']',_0x497386['message']);_0x3c80b5(_0x497386[_0x4c1b('0x15')]);});});};}function createRemoteTag(_0x36aea4,_0x34e7ad,_0x4f30a7,_0x3f767e){return new Promise(function(_0x2f8a3a,_0x24baeb){var _0x21de58={'method':_0x4c1b('0x46'),'uri':_0x4f30a7+_0x4c1b('0x47')+'?'+_0x3f767e,'body':{'short_description':_0x36aea4,'global':!![],'active':!![],'name':_0x36aea4},'auth':_0x34e7ad,'json':!![]};return rp(_0x21de58)[_0x4c1b('0xe')](function(_0x2023d4){var _0x5488a1=_0x2023d4[_0x4c1b('0xf')][_0x4c1b('0x11')];_0x2f8a3a(_0x5488a1);});});}function getRemoteTag(_0x29418c,_0x4cc1c6,_0x51c3eb,_0x43caa3,_0x19c281){return new Promise(function(_0x1c46f6,_0x3ed244){var _0x1e45d2={'method':_0x4c1b('0xc'),'uri':_0x51c3eb+_0x4c1b('0x47')+_0x4c1b('0x48')+_0x29418c+'&'+_0x43caa3,'auth':_0x4cc1c6,'json':!![]};return rp(_0x1e45d2)[_0x4c1b('0xe')](function(_0x47b6f7){if(_0x47b6f7[_0x4c1b('0xf')][_0x4c1b('0x1c')]>0x0){var _0x3f1f46=_0x47b6f7[_0x4c1b('0xf')][0x0][_0x4c1b('0x11')];_0x1c46f6(_0x3f1f46);}else{return createRemoteTag(_0x29418c,_0x4cc1c6,_0x51c3eb,_0x43caa3)['then'](function(_0xf74024){_0x1c46f6(_0xf74024);});}});});}function assignTagToIncident(_0x42a6f5,_0x10e925,_0x3bd4c5,_0x8546bd,_0x10f254){return new Promise(function(_0x389919,_0x151811){var _0x244092={'method':_0x4c1b('0x46'),'uri':_0x3bd4c5+_0x4c1b('0x49')+'?'+_0x10f254,'body':{'label':_0x42a6f5,'table':'incident','id_type':_0x4c1b('0x4a'),'table_key':_0x8546bd['ticketId'],'title':'Incident\x20-\x20'+_0x8546bd[_0x4c1b('0x43')],'id_display':_0x8546bd['ticketNumber']},'auth':_0x10e925,'json':!![]};return rp(_0x244092)[_0x4c1b('0xe')](function(_0x5e8b5f){_0x389919();})['catch'](function(){_0x389919();});});}function manageTags(_0x41f934,_0x4dbbfd,_0xf45abd,_0x18ba47,_0x19936e,_0x4b7e9b,_0x53519a){return new Promise(function(_0x6ce271,_0x4c6733){var _0x1304a5=[];_0x4dbbfd[_0x4c1b('0x2a')](function(_0x494f33){_0x1304a5['push'](getRemoteTag(_0x494f33,_0xf45abd,_0x18ba47,_0x4b7e9b,_0x53519a));});return Promise[_0x4c1b('0x4b')](_0x1304a5)[_0x4c1b('0xe')](function(_0x5219a0){if(_0x5219a0['length']){logger[_0x4c1b('0x1a')]('['+[_0x41f934[_0x4c1b('0x12')]()]+_0x4c1b('0x4c'),_0x5219a0);var _0x1e3f18=[];_0x5219a0[_0x4c1b('0x2a')](function(_0x4437bb){_0x1e3f18['push'](assignTagToIncident(_0x4437bb,_0xf45abd,_0x18ba47,_0x19936e,_0x4b7e9b));});return Promise[_0x4c1b('0x4b')](_0x1e3f18)[_0x4c1b('0xe')](function(){_0x6ce271();})[_0x4c1b('0x13')](function(){_0x6ce271();});}else{_0x6ce271();}});});}function getTags(_0x3ecc79,_0x598757,_0x11ba13,_0x5132b2,_0x4baf4c,_0x2b8d33){return function(_0x3a7abc){return new Promise(function(_0x3705c6,_0x3ffe2b){var _0x4c4c22=[];var _0x4f235e=_0x5132b2[_0x4c1b('0x4d')];if(_0x4f235e&&_0x4f235e[_0x4c1b('0x1c')]>0x0){_0x4c4c22=_[_0x4c1b('0x4e')](_0x4f235e,_0x4c1b('0x39'));}if(_0x4c4c22['length']>0x0){return manageTags(_0x3ecc79,_0x4c4c22,_0x598757,_0x11ba13,_0x3a7abc,_0x4baf4c,_0x2b8d33)[_0x4c1b('0xe')](function(){_0x3705c6(_0x3a7abc);});}else{_0x3705c6(_0x3a7abc);}});};}function emit(_0x3d2969,_0x22669f,_0x31b5dd){var _0x4a4fd2=_0x4c1b('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x4c1b('0x50')+'%255EORDERBYDESCnumber';var _0x146be4={'uri':_0x3d2969+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x31b5dd+_0x4a4fd2};io['to'](util['format']('user:%s',_0x22669f))[_0x4c1b('0x51')](_0x4c1b('0x52'),_0x146be4);}exports['cs']=function(_0x1163c8,_0x52f64d,_0xa0f5d8,_0x1d9327,_0x31e595,_0x29c8bc,_0x4f6058,_0x498851){var _0x1412a5={};var _0x5e2ce8={'user':_0x29c8bc[_0x4c1b('0x53')],'pass':_0x29c8bc['password']};var _0x215c82='sysparm_limit=1';var _0x56d79d=_0x4c1b('0x54');_0x29c8bc[_0x4c1b('0x55')]=intUtil[_0x4c1b('0x56')](_0x29c8bc[_0x4c1b('0x55')]);_0x29c8bc[_0x4c1b('0x57')]=intUtil[_0x4c1b('0x56')](_0x29c8bc['serverUrl']);var _0x349e6e=util[_0x4c1b('0x58')]('%s/api/now/table/',_0x29c8bc[_0x4c1b('0x55')]);_0x1412a5[_0x4c1b('0x18')]=!_[_0x4c1b('0x59')](_0x1d9327)?_0x1d9327['email']:null;_0x1412a5[_0x4c1b('0x1f')]=_0x29c8bc[_0x4c1b('0x5a')];_0x1412a5[_0x4c1b('0x23')]=_0x498851['toLowerCase']()===_0x4c1b('0x3b')?_0x52f64d[_0x4c1b('0x5b')]:_0x52f64d[_0x4c1b('0x5c')];_0x1412a5['callDirection']=_0x498851===_0x4c1b('0x5d')||_0x498851===_0x4c1b('0x5e')?_0x4c1b('0x5d'):_0x4c1b('0x3b');var _0x5b68ac=util[_0x4c1b('0x58')](_0x4c1b('0x5f'),_0x29c8bc[_0x4c1b('0x57')],_0x52f64d[_0x4c1b('0x60')],md5(_0x52f64d[_0x4c1b('0x60')]));if(_0x31e595&&_0x31e595[_0x4c1b('0x61')]){logger[_0x4c1b('0x1a')]('[QUEUE]','Recording\x20is\x20enabled!');_0x52f64d['recordingURL']=_0x5b68ac;}else if(_0x4f6058&&_0x4f6058['recordingFormat']&&_0x4f6058[_0x4c1b('0x62')]!==_0x4c1b('0x63')){logger[_0x4c1b('0x1a')](_0x4c1b('0x64'),_0x4c1b('0x65'));_0x52f64d['recordingURL']=_0x5b68ac;}else{_0x52f64d[_0x4c1b('0x66')]='';}return getAdminUser(_0x498851,_0x5e2ce8,_0x1412a5,_0x349e6e,_0x56d79d,_0x215c82)[_0x4c1b('0xe')](getUser(_0x498851,_0x5e2ce8,_0x349e6e,_0x56d79d,_0x215c82))[_0x4c1b('0xe')](getEndUser(_0x498851,_0x5e2ce8,_0x349e6e,_0x56d79d,_0x215c82))['then'](getTicket(_0x498851,_0x5e2ce8,_0x349e6e,_0xa0f5d8,_0x52f64d,_0x56d79d))['then'](function(_0xb7c752){logger['info'](util[_0x4c1b('0x58')](_0x4c1b('0x67'),_0xb7c752[_0x4c1b('0x42')]));logger[_0x4c1b('0x1a')](util[_0x4c1b('0x58')](_0x4c1b('0x68'),_0x498851));if(_0x498851!==_0x4c1b('0x5e')){logger[_0x4c1b('0x1a')]('['+[_0x498851['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x29c8bc[_0x4c1b('0x55')],_0x1d9327['name'],_0xb7c752['ticketId']);}})[_0x4c1b('0x13')](function(_0x561749){logger['error']('['+[_0x498851[_0x4c1b('0x12')]()]+_0x4c1b('0x69'),util[_0x4c1b('0x6a')](_0x561749,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7133=['adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','sys_id','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','content','toString','idField','toLowerCase','variable','customVariable','Variable','name','incident','assign','Subjects','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminId','userEmail'];(function(_0x436609,_0x3ffc92){var _0x53ccef=function(_0x29cb69){while(--_0x29cb69){_0x436609['push'](_0x436609['shift']());}};_0x53ccef(++_0x3ffc92);}(_0x7133,0x19d));var _0x3713=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7133[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x3713('0x0'));var Promise=require(_0x3713('0x1'));var rp=require(_0x3713('0x2'));var util=require(_0x3713('0x3'));var md5=require('md5');var Redis=require(_0x3713('0x4'));var intUtil=require(_0x3713('0x5'));var config=require(_0x3713('0x6'));var logger=require(_0x3713('0x7'))(_0x3713('0x8'));config[_0x3713('0x9')]=_[_0x3713('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3713('0xb'))(new Redis(config[_0x3713('0x9')]));function getAdminUser(_0x1f7881,_0x2f219c,_0x4566c1,_0x5b0deb,_0x3a3b97,_0x37f3e5){return new Promise(function(_0x8a508e,_0x17de2a){var _0x4c9af8={'method':_0x3713('0xc'),'uri':_0x5b0deb+_0x3713('0xd')+'&'+_0x3a3b97+'&'+_0x37f3e5,'auth':_0x2f219c,'json':!![]};return rp(_0x4c9af8)[_0x3713('0xe')](function(_0x5ee737){if(_0x5ee737[_0x3713('0xf')][_0x3713('0x10')]>0x0){_0x4566c1['adminId']=_0x5ee737[_0x3713('0xf')][0x0]['sys_id'];}logger[_0x3713('0x11')]('['+[_0x1f7881[_0x3713('0x12')]()]+_0x3713('0x13'),_0x4566c1);_0x8a508e(_0x4566c1);})['catch'](function(_0x16612f){logger[_0x3713('0x14')]('['+[_0x1f7881['toUpperCase']()]+']',_0x16612f[_0x3713('0x15')]);_0x17de2a(_0x16612f[_0x3713('0x15')]);});});}function getUser(_0x145ec8,_0x5b96bb,_0x154a93,_0x1f5ff7,_0xae4545){return function(_0x842090){logger['info']('['+[_0x145ec8[_0x3713('0x12')]()]+_0x3713('0x16'),_0x842090);return new Promise(function(_0x235ccb,_0x58cb96){if(intUtil[_0x3713('0x17')](_0x842090['userEmail'])){var _0x43aff3={'method':'GET','uri':_0x154a93+_0x3713('0x18')+_0x842090['userEmail']+'&'+_0x1f5ff7+'&'+_0xae4545,'auth':_0x5b96bb,'json':!![]};logger[_0x3713('0x11')]('['+[_0x145ec8[_0x3713('0x12')]()]+_0x3713('0x19'),_0x43aff3);return rp(_0x43aff3)[_0x3713('0xe')](function(_0x5db00d){logger[_0x3713('0x11')]('['+[_0x145ec8[_0x3713('0x12')]()]+'],\x20getUser\x20entity',_0x5db00d);if(_0x5db00d[_0x3713('0xf')][_0x3713('0x10')]>0x0&&String(_0x5db00d[_0x3713('0xf')][0x0][_0x3713('0x1a')])===_0x3713('0x1b')){_0x842090[_0x3713('0x1c')]=_0x5db00d[_0x3713('0xf')][0x0]['sys_id'];}else{_0x842090[_0x3713('0x1c')]=_0x842090[_0x3713('0x1d')];_0x842090[_0x3713('0x1e')]=_0x842090[_0x3713('0x1f')];}logger[_0x3713('0x11')]('['+[_0x145ec8['toUpperCase']()]+_0x3713('0x20'),_0x842090);_0x235ccb(_0x842090);})[_0x3713('0x21')](function(_0x21f981){logger[_0x3713('0x14')]('['+[_0x145ec8[_0x3713('0x12')]()]+']',_0x21f981['message']);_0x58cb96(_0x21f981['message']);});}else{logger[_0x3713('0x11')]('['+[_0x145ec8[_0x3713('0x12')]()]+_0x3713('0x22'));_0x842090[_0x3713('0x1c')]=_0x842090[_0x3713('0x1d')];_0x842090['userEmail']=_0x842090[_0x3713('0x1f')];_0x235ccb(_0x842090);}});};}function createEndUser(_0x7f634d,_0x3b72e6,_0xfb353d,_0x18034f,_0x88e506){logger[_0x3713('0x11')]('['+[_0x7f634d[_0x3713('0x12')]()]+_0x3713('0x23'),_0xfb353d);return new Promise(function(_0x5e7d11,_0x3da424){var _0x1c520e={'method':_0x3713('0x24'),'uri':_0x18034f+'sys_user?'+_0x88e506,'body':{'user_name':_0xfb353d[_0x3713('0x25')],'roles':_0x3713('0x26'),'first_name':_0xfb353d[_0x3713('0x25')],'active':'true','date_format':_0x3713('0x27'),'phone':_0xfb353d[_0x3713('0x25')]},'auth':_0x3b72e6,'json':!![]};return rp(_0x1c520e)[_0x3713('0xe')](function(_0x571e13){logger['info']('['+[_0x7f634d[_0x3713('0x12')]()]+'],\x20EndUser\x20schema',_0x571e13[_0x3713('0xf')]);_0xfb353d[_0x3713('0x28')]=_0x571e13['result']['sys_id'];_0x5e7d11(_0xfb353d);})['catch'](function(_0x400503){logger[_0x3713('0x14')]('['+[_0x7f634d[_0x3713('0x12')]()]+']',_0x400503[_0x3713('0x15')]);_0x3da424(_0x400503[_0x3713('0x15')]);});});}function getEndUser(_0xc261d7,_0x276be0,_0x295428,_0x4b021f,_0x24822e){return function(_0x22005e){logger[_0x3713('0x11')]('['+[_0xc261d7[_0x3713('0x12')]()]+_0x3713('0x29'),_0x22005e);return new Promise(function(_0x1189cc,_0x50d20b){var _0x37ccc4={'method':_0x3713('0xc'),'uri':_0x295428+_0x3713('0x2a')+_0x22005e[_0x3713('0x25')]+'&'+_0x4b021f+'&'+_0x24822e,'auth':_0x276be0,'json':!![]};return rp(_0x37ccc4)[_0x3713('0xe')](function(_0x393995){if(_0x393995['result'][_0x3713('0x10')]>0x0){_0x22005e[_0x3713('0x28')]=_0x393995[_0x3713('0xf')][0x0][_0x3713('0x2b')];logger['info']('['+[_0xc261d7[_0x3713('0x12')]()]+_0x3713('0x2c'),_0x22005e);_0x1189cc(_0x22005e);}else{return createEndUser(_0xc261d7,_0x276be0,_0x22005e,_0x295428,_0x4b021f)[_0x3713('0xe')](function(_0x172fc2){logger[_0x3713('0x11')]('['+[_0xc261d7[_0x3713('0x12')]()]+_0x3713('0x2d'),_0x172fc2);_0x1189cc(_0x172fc2);});}})['catch'](function(_0x9af57f){logger['error']('['+[_0xc261d7[_0x3713('0x12')]()]+']',_0x9af57f[_0x3713('0x15')]);_0x50d20b(_0x9af57f[_0x3713('0x15')]);});});};}function getCustomFields(_0x1e66a8,_0x48c481){var _0x1b4934={};if(_0x1e66a8[_0x3713('0x10')]>0x0){_[_0x3713('0x2e')](_0x1e66a8,function(_0x457933){if(_[_0x3713('0x2f')]([_0x3713('0x30'),_0x3713('0x31')],_0x457933[_0x3713('0x32')])&&_0x457933[_0x3713('0x33')]&&!_0x457933[_0x3713('0x34')]){_0x1b4934[_0x457933['nameField']['toLowerCase']()]=_0x457933[_0x3713('0x35')][_0x3713('0x36')]();}else if(_[_0x3713('0x2f')](['string',_0x3713('0x31')],_0x457933[_0x3713('0x32')])&&_0x457933[_0x3713('0x37')]&&_0x457933[_0x3713('0x34')]){_0x1b4934[_0x457933[_0x3713('0x37')][_0x3713('0x38')]()]=_0x457933[_0x3713('0x35')]['toString']();}else if(_0x457933[_0x3713('0x32')]===_0x3713('0x39')&&_0x457933['variableName']&&_0x457933[_0x3713('0x37')]&&_0x457933[_0x3713('0x34')]){_0x1b4934[_0x457933[_0x3713('0x37')][_0x3713('0x38')]()]=_0x48c481[_0x457933['variableName']][_0x3713('0x36')]();}else if(_0x457933[_0x3713('0x32')]===_0x3713('0x3a')&&_0x457933['Variable']&&_0x457933[_0x3713('0x3b')][_0x3713('0x3c')]&&_0x457933[_0x3713('0x37')]&&_0x457933[_0x3713('0x34')]){_0x1b4934[_0x457933[_0x3713('0x37')][_0x3713('0x38')]()]=_0x48c481[_0x457933[_0x3713('0x3b')][_0x3713('0x3c')][_0x3713('0x38')]()]['toString']();}});}return _0x1b4934;}function getTicket(_0xa3f74c,_0x229fa1,_0x281f23,_0x19a5f5,_0x56d7b1,_0x43094a){return function(_0x3e60ce){logger[_0x3713('0x11')]('['+[_0xa3f74c[_0x3713('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x3e60ce);return new Promise(function(_0x5d5e9e,_0x55991c){var _0x115450=_0xa3f74c[_0x3713('0x38')]()==='outbound'?_0x3e60ce[_0x3713('0x1c')]:_0x3e60ce[_0x3713('0x28')];var _0x172805={'method':_0x3713('0x24'),'uri':_0x281f23+_0x3713('0x3d')+'?'+_0x43094a,'body':Object[_0x3713('0x3e')]({},{'active':'true','caller_id':_0x115450,'assigned_to':_0x3e60ce['userId'],'short_description':intUtil['getString'](_0x19a5f5[_0x3713('0x3f')],_0x56d7b1,'\x20'),'description':intUtil[_0x3713('0x40')](_0x19a5f5[_0x3713('0x41')],_0x56d7b1,'\x0a')},getCustomFields(_0x19a5f5['Fields'],_0x56d7b1)),'auth':_0x229fa1,'json':!![]};return rp(_0x172805)[_0x3713('0xe')](function(_0x3e43f2){logger[_0x3713('0x11')]('['+[_0xa3f74c[_0x3713('0x12')]()]+_0x3713('0x42'),_0x3e43f2[_0x3713('0xf')]);_0x3e60ce[_0x3713('0x43')]=_0x3e43f2[_0x3713('0xf')][_0x3713('0x2b')];_0x3e60ce[_0x3713('0x44')]=_0x3e43f2[_0x3713('0xf')][_0x3713('0x45')];logger['info']('['+[_0xa3f74c[_0x3713('0x12')]()]+_0x3713('0x46'),_0x3e60ce);_0x5d5e9e(_0x3e60ce);})['catch'](function(_0x42d11b){logger[_0x3713('0x14')]('['+[_0xa3f74c[_0x3713('0x12')]()]+']',_0x42d11b['message']);_0x55991c(_0x42d11b[_0x3713('0x15')]);});});};}function createRemoteTag(_0xa3d5da,_0x20276a,_0x9facd7,_0x362057){return new Promise(function(_0x1cf619,_0x419223){var _0x49b667={'method':'POST','uri':_0x9facd7+_0x3713('0x47')+'?'+_0x362057,'body':{'short_description':_0xa3d5da,'global':!![],'active':!![],'name':_0xa3d5da},'auth':_0x20276a,'json':!![]};return rp(_0x49b667)[_0x3713('0xe')](function(_0x5f52ef){var _0x1f5c08=_0x5f52ef[_0x3713('0xf')][_0x3713('0x2b')];_0x1cf619(_0x1f5c08);});});}function getRemoteTag(_0x25681f,_0x77d523,_0x354458,_0x229e60,_0x1c02e0){return new Promise(function(_0xa21db6,_0x575003){var _0x4565d9={'method':_0x3713('0xc'),'uri':_0x354458+_0x3713('0x47')+'?sysparm_query=name%3D'+_0x25681f+'&'+_0x229e60,'auth':_0x77d523,'json':!![]};return rp(_0x4565d9)[_0x3713('0xe')](function(_0x4d0482){if(_0x4d0482[_0x3713('0xf')][_0x3713('0x10')]>0x0){var _0x25fb67=_0x4d0482['result'][0x0]['sys_id'];_0xa21db6(_0x25fb67);}else{return createRemoteTag(_0x25681f,_0x77d523,_0x354458,_0x229e60)[_0x3713('0xe')](function(_0x2a1ed2){_0xa21db6(_0x2a1ed2);});}});});}function assignTagToIncident(_0x4935e3,_0x46ceab,_0x447b57,_0x38f9ac,_0x1baf5f){return new Promise(function(_0x234722,_0xfdcac0){var _0x419879={'method':_0x3713('0x24'),'uri':_0x447b57+_0x3713('0x48')+'?'+_0x1baf5f,'body':{'label':_0x4935e3,'table':_0x3713('0x3d'),'id_type':_0x3713('0x49'),'table_key':_0x38f9ac[_0x3713('0x43')],'title':_0x3713('0x4a')+_0x38f9ac[_0x3713('0x44')],'id_display':_0x38f9ac[_0x3713('0x44')]},'auth':_0x46ceab,'json':!![]};return rp(_0x419879)['then'](function(_0x2b58fd){_0x234722();})['catch'](function(){_0x234722();});});}function manageTags(_0x183775,_0x1b73e8,_0x4a8fda,_0x42790e,_0xad98e4,_0x2a482f,_0xc84394){return new Promise(function(_0x74e0ba,_0x1091e){var _0x28143f=[];_0x1b73e8['forEach'](function(_0x1b6fb8){_0x28143f[_0x3713('0x4b')](getRemoteTag(_0x1b6fb8,_0x4a8fda,_0x42790e,_0x2a482f,_0xc84394));});return Promise['all'](_0x28143f)[_0x3713('0xe')](function(_0x175ef4){if(_0x175ef4[_0x3713('0x10')]){logger[_0x3713('0x11')]('['+[_0x183775['toUpperCase']()]+_0x3713('0x4c'),_0x175ef4);var _0xa25880=[];_0x175ef4[_0x3713('0x2e')](function(_0x3692ae){_0xa25880[_0x3713('0x4b')](assignTagToIncident(_0x3692ae,_0x4a8fda,_0x42790e,_0xad98e4,_0x2a482f));});return Promise[_0x3713('0x4d')](_0xa25880)[_0x3713('0xe')](function(){_0x74e0ba();})[_0x3713('0x21')](function(){_0x74e0ba();});}else{_0x74e0ba();}});});}function getTags(_0x12ecfb,_0x148c79,_0x392d7b,_0x1feb26,_0x705f10,_0x525f43){return function(_0x3cfd74){return new Promise(function(_0x444320,_0x560845){var _0x1db77e=[];var _0x469592=_0x1feb26['Tags'];if(_0x469592&&_0x469592[_0x3713('0x10')]>0x0){_0x1db77e=_[_0x3713('0x4e')](_0x469592,_0x3713('0x3c'));}if(_0x1db77e[_0x3713('0x10')]>0x0){return manageTags(_0x12ecfb,_0x1db77e,_0x148c79,_0x392d7b,_0x3cfd74,_0x705f10,_0x525f43)[_0x3713('0xe')](function(){_0x444320(_0x3cfd74);});}else{_0x444320(_0x3cfd74);}});};}function emit(_0x28bd4c,_0x2e1342,_0x5269ba){var _0x1077e7='%26sysparm_record_target%3Dincident'+_0x3713('0x4f')+_0x3713('0x50')+_0x3713('0x51');var _0xcc08a6={'uri':_0x28bd4c+_0x3713('0x52')+_0x5269ba+_0x1077e7};io['to'](util[_0x3713('0x53')]('user:%s',_0x2e1342))[_0x3713('0x54')]('trigger:browser:url',_0xcc08a6);}exports['cs']=function(_0x3086d4,_0x4a097d,_0x33307a,_0x2b9276,_0x1d3ea6,_0x2f621d,_0x49abcf,_0x1d2b4b){var _0x50f31c={};var _0x214923={'user':_0x2f621d[_0x3713('0x55')],'pass':_0x2f621d[_0x3713('0x56')]};var _0x3f0e20=_0x3713('0x57');var _0x251820=_0x3713('0x58');_0x2f621d[_0x3713('0x59')]=intUtil['stripTrailingSlash'](_0x2f621d[_0x3713('0x59')]);_0x2f621d['serverUrl']=intUtil[_0x3713('0x5a')](_0x2f621d[_0x3713('0x5b')]);var _0x372510=util[_0x3713('0x53')](_0x3713('0x5c'),_0x2f621d['remoteUri']);_0x50f31c['userEmail']=!_[_0x3713('0x5d')](_0x2b9276)?_0x2b9276[_0x3713('0x5e')]:null;_0x50f31c['adminEmail']=_0x2f621d[_0x3713('0x5e')];_0x50f31c[_0x3713('0x25')]=_0x1d2b4b['toLowerCase']()===_0x3713('0x5f')?_0x4a097d[_0x3713('0x60')]:_0x4a097d[_0x3713('0x61')];_0x50f31c[_0x3713('0x62')]=_0x1d2b4b===_0x3713('0x63')||_0x1d2b4b===_0x3713('0x64')?'queue':'outbound';var _0x256fd4=util[_0x3713('0x53')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f621d['serverUrl'],_0x4a097d[_0x3713('0x65')],md5(_0x4a097d[_0x3713('0x65')]));if(_0x1d3ea6&&_0x1d3ea6['monitor_format']){logger[_0x3713('0x11')](_0x3713('0x66'),_0x3713('0x67'));_0x4a097d['recordingURL']=_0x256fd4;}else if(_0x49abcf&&_0x49abcf[_0x3713('0x68')]&&_0x49abcf[_0x3713('0x68')]!==_0x3713('0x69')){logger[_0x3713('0x11')]('[OUTBOUND]',_0x3713('0x67'));_0x4a097d['recordingURL']=_0x256fd4;}else{_0x4a097d[_0x3713('0x6a')]='';}return getAdminUser(_0x1d2b4b,_0x214923,_0x50f31c,_0x372510,_0x251820,_0x3f0e20)[_0x3713('0xe')](getUser(_0x1d2b4b,_0x214923,_0x372510,_0x251820,_0x3f0e20))[_0x3713('0xe')](getEndUser(_0x1d2b4b,_0x214923,_0x372510,_0x251820,_0x3f0e20))[_0x3713('0xe')](getTicket(_0x1d2b4b,_0x214923,_0x372510,_0x33307a,_0x4a097d,_0x251820))[_0x3713('0xe')](function(_0x9cdd76){logger[_0x3713('0x11')](util[_0x3713('0x53')](_0x3713('0x6b'),_0x9cdd76['ticketId']));logger['info'](util['format'](_0x3713('0x6c'),_0x1d2b4b));if(_0x1d2b4b!=='unmanaged'){logger[_0x3713('0x11')]('['+[_0x1d2b4b[_0x3713('0x12')]()]+']',_0x3713('0x6d'));emit(_0x2f621d['remoteUri'],_0x2b9276[_0x3713('0x3c')],_0x9cdd76[_0x3713('0x43')]);}})[_0x3713('0x21')](function(_0x3ee44a){logger['error']('['+[_0x1d2b4b[_0x3713('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x3713('0x6e')](_0x3ee44a,{'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 2018476..13ed175 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 _0x8553=['password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','version','user:%s','catch','unmanaged','%s/service/v4_1/rest.php','lastevent','toUpperCase','calleridnum','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','name','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','info','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','variable','Variable','custom_fields','login'];(function(_0x152a57,_0x2f062f){var _0x3ed07e=function(_0x114e36){while(--_0x114e36){_0x152a57['push'](_0x152a57['shift']());}};_0x3ed07e(++_0x2f062f);}(_0x8553,0x18e));var _0x3855=function(_0x49831e,_0x477ff4){_0x49831e=_0x49831e-0x0;var _0x52a888=_0x8553[_0x49831e];return _0x52a888;};'use strict';var _=require(_0x3855('0x0'));var rp=require(_0x3855('0x1'));var BPromise=require(_0x3855('0x2'));var md5=require(_0x3855('0x3'));var util=require(_0x3855('0x4'));var Redis=require(_0x3855('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3855('0x6'))(_0x3855('0x7'));config[_0x3855('0x8')]=_[_0x3855('0x9')](config[_0x3855('0x8')],{'host':_0x3855('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3855('0x8')]));var def={'method':_0x3855('0xb'),'json':!![]};function emit(_0x2afe01,_0x59ea59,_0x100656){io['to'](_0x2afe01)['emit'](_0x59ea59,_0x100656);}function getTicket(_0x5f3c63,_0x4d3cb8,_0x21458c,_0x1f99b4,_0x2f8f32,_0x2e8ee6,_0x5736d6,_0x6cdf69){logger['info']('Creating\x20new\x20ticket...');var _0x10eee5=new Date();var _0x59477d=[{'name':_0x3855('0xc'),'value':intUtil['getString'](_0x1f99b4[_0x3855('0xd')],_0x2f8f32,'\x20')},{'name':'assigned_user_id','value':_0x4d3cb8['id']},{'name':_0x3855('0xe'),'value':_0x4d3cb8['id']},{'name':_0x3855('0xf'),'value':intUtil['getString'](_0x1f99b4[_0x3855('0x10')],_0x2f8f32,'\x0a')},{'name':_0x3855('0x11'),'value':_0x10eee5[_0x3855('0x12')]()[_0x3855('0x13')](0x0,0x13)[_0x3855('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x3855('0x15'),'value':'15'},{'name':_0x3855('0x16'),'value':_0x21458c['id']},{'name':_0x3855('0x17'),'value':_0x3855('0x18')},{'name':_0x3855('0x19'),'value':_0x21458c[_0x3855('0xc')]},{'name':_0x3855('0x1a'),'value':_0x6cdf69}];if(_0x2e8ee6[_0x3855('0x1b')]){_[_0x3855('0x1c')](_0x2e8ee6,function(_0xbc49f0){if(_0x2f8f32[_0xbc49f0[_0x3855('0x1d')]]){_0x59477d[_0x3855('0x1e')]({'name':_0xbc49f0[_0x3855('0x1f')],'value':_0x2f8f32[_0xbc49f0[_0x3855('0x1d')]]});}});}return request({'form':{'method':_0x3855('0x20'),'input_type':'JSON','response_type':_0x3855('0x21'),'rest_data':JSON[_0x3855('0x22')]({'session':_0x5736d6['id'],'module_name':_0x3855('0x23'),'name_value_list':_0x59477d})}});}function getAuth(_0x337662){return util['format'](_0x3855('0x24'),new Buffer(_0x337662[_0x3855('0x25')]+':X')[_0x3855('0x26')](_0x3855('0x27')));}function getServerInfo(_0x2b6a65){return request({'form':{'method':_0x3855('0x28'),'input_type':_0x3855('0x21'),'response_type':_0x3855('0x21'),'rest_data':JSON[_0x3855('0x22')]({'session':_0x2b6a65['id']})}});}function getUser(_0x5c3fa6,_0x2cdf75,_0x3392a6){if(!_[_0x3855('0x29')](_0x2cdf75)){logger['info'](_0x3855('0x2a'),_0x2cdf75);return request({'form':{'method':'get_entry_list','input_type':_0x3855('0x21'),'response_type':_0x3855('0x21'),'rest_data':JSON[_0x3855('0x22')]({'session':_0x3392a6['id'],'module_name':_0x3855('0x2b'),'query':util['format'](_0x3855('0x2c'),_0x2cdf75),'order_by':'','offset':'0','select_fields':['id',_0x3855('0xc'),_0x3855('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3855('0x2e')](function(_0x4de6ee){if(_0x4de6ee['entry_list'][_0x3855('0x1b')]){var _0x5387f8=_['find'](_0x4de6ee[_0x3855('0x2f')],function(_0x11d0c4){return _0x11d0c4[_0x3855('0x30')][_0x3855('0x2d')]['value']===_0x2cdf75;});if(_0x5387f8){logger[_0x3855('0x31')]('Agent\x20found!');return BPromise[_0x3855('0x32')]({'id':_0x5387f8['name_value_list']['id'][_0x3855('0x33')],'name':_0x5387f8['name_value_list'][_0x3855('0xc')][_0x3855('0x33')]});}}logger[_0x3855('0x31')](_0x3855('0x34'));return BPromise[_0x3855('0x32')]({'id':_0x3392a6[_0x3855('0x30')][_0x3855('0x35')][_0x3855('0x33')],'name':_0x3392a6[_0x3855('0x30')][_0x3855('0x2d')][_0x3855('0x33')]});});}else{logger[_0x3855('0x31')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x3392a6[_0x3855('0x30')]['user_id'][_0x3855('0x33')],'name':_0x3392a6[_0x3855('0x30')][_0x3855('0x2d')][_0x3855('0x33')]});}}function getEndUser(_0x2773c3,_0x9dc5c7,_0x50fc24,_0x4c1ade){logger[_0x3855('0x31')](_0x3855('0x36'),_0x50fc24);return request({'form':{'method':_0x3855('0x37'),'input_type':'JSON','response_type':_0x3855('0x21'),'rest_data':JSON[_0x3855('0x22')]({'session':_0x4c1ade['id'],'module_name':_0x3855('0x18'),'query':util[_0x3855('0x38')](_0x3855('0x39'),_0x50fc24),'order_by':'','offset':'0','select_fields':['id',_0x3855('0xc'),_0x3855('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3855('0x2e')](function(_0x5ee0a6){if(_0x5ee0a6['entry_list']['length']){var _0x4ed2e5=_['find'](_0x5ee0a6[_0x3855('0x2f')],function(_0x3f17a5){return _0x3f17a5['name_value_list']['phone_home'][_0x3855('0x33')]===_0x50fc24;});if(_0x4ed2e5){logger['info'](_0x3855('0x3b'));return BPromise[_0x3855('0x32')]({'id':_0x4ed2e5[_0x3855('0x30')]['id'][_0x3855('0x33')],'name':_0x4ed2e5['name_value_list']['name'][_0x3855('0x33')],'phone':_0x4ed2e5['name_value_list']['phone_home']['value']});}}else{logger[_0x3855('0x31')](_0x3855('0x3c'));return request({'form':{'method':_0x3855('0x20'),'input_type':_0x3855('0x21'),'response_type':'JSON','rest_data':JSON[_0x3855('0x22')]({'session':_0x4c1ade['id'],'module_name':_0x3855('0x18'),'name_value_list':[{'name':_0x3855('0x3d'),'value':_0x9dc5c7!==_0x3855('0x3e')?_0x9dc5c7:util[_0x3855('0x38')](_0x3855('0x3f'),_0x50fc24)},{'name':_0x3855('0x3a'),'value':_0x50fc24}]})}})[_0x3855('0x2e')](function(_0x1e160d){logger[_0x3855('0x31')](_0x3855('0x40'));return BPromise['resolve']({'id':_0x1e160d['id'],'name':_0x1e160d[_0x3855('0x2f')]['first_name'][_0x3855('0x33')],'phone':_0x1e160d['entry_list'][_0x3855('0x3a')][_0x3855('0x33')]});});}});}function request(_0xc8075){logger[_0x3855('0x41')](_0x3855('0x42'),JSON[_0x3855('0x22')](_0xc8075));return rp(_[_0x3855('0x43')](def,_0xc8075));}function getTags(_0x4f42ba,_0x177ff6){var _0x40d187=[];if(_0x4f42ba&&_0x4f42ba['length']>0x0){_0x40d187=_[_0x3855('0x44')](_0x4f42ba,_0x177ff6);}return _0x40d187;}function getCustomFields(_0x4e3aa2,_0x5f545b){var _0x59a861=[];var _0x54560a={'custom_fields':[]};if(_0x4e3aa2[_0x3855('0x1b')]>0x0){_[_0x3855('0x1c')](_0x4e3aa2,function(_0x5fe712){if(_0x5fe712[_0x3855('0x45')]===_0x3855('0x46')&&_0x5fe712[_0x3855('0x47')]&&!_0x5fe712[_0x3855('0x48')]){_0x54560a[_0x5fe712[_0x3855('0x47')][_0x3855('0x49')]()]=_0x5fe712['content'][_0x3855('0x26')]();}else if(_0x5fe712[_0x3855('0x45')]==='string'&&_0x5fe712[_0x3855('0x1f')]&&_0x5fe712[_0x3855('0x48')]){_0x54560a['custom_fields']['push']({'id':_0x5fe712[_0x3855('0x1f')],'value':_0x5fe712['content'][_0x3855('0x26')]()});}else if(_0x5fe712[_0x3855('0x45')]===_0x3855('0x4a')&&_0x5fe712[_0x3855('0x1d')]&&_0x5fe712[_0x3855('0x1f')]&&_0x5fe712[_0x3855('0x48')]){_0x5f545b[_0x5fe712[_0x3855('0x1d')]]&&_0x54560a['custom_fields']['push']({'id':_0x5fe712[_0x3855('0x1f')],'value':_0x5f545b[_0x5fe712[_0x3855('0x1d')]][_0x3855('0x26')]()});}else if(_0x5fe712[_0x3855('0x45')]==='customVariable'&&_0x5fe712[_0x3855('0x4b')]&&_0x5fe712['Variable'][_0x3855('0xc')]&&_0x5fe712[_0x3855('0x1f')]&&_0x5fe712[_0x3855('0x48')]){_0x5f545b[_0x5fe712[_0x3855('0x4b')][_0x3855('0xc')][_0x3855('0x49')]()]&&_0x54560a[_0x3855('0x4c')][_0x3855('0x1e')]({'id':_0x5fe712['idField'],'value':_0x5f545b[_0x5fe712['Variable'][_0x3855('0xc')]['toLowerCase']()][_0x3855('0x26')]()});}});}return _0x54560a;}function getConnection(_0xe7a2b8){return request({'method':_0x3855('0xb'),'form':{'method':_0x3855('0x4d'),'input_type':_0x3855('0x21'),'response_type':_0x3855('0x21'),'rest_data':JSON[_0x3855('0x22')]({'user_auth':{'user_name':_0xe7a2b8['username'],'password':_0xe7a2b8[_0x3855('0x4e')],'encryption':_0x3855('0x4f')},'application':_0x3855('0x50')})}})['then'](function(_0x3bcbef){var _0x1ff661=_0x3bcbef;if(_0x1ff661['id']){def[_0x3855('0x51')]=_0x1ff661['id'];return BPromise['resolve'](_0x1ff661);}else{throw new Error(util[_0x3855('0x38')]('Account\x20%d\x20is\x20not\x20valid',_0xe7a2b8['id']));}});}function setRelationship(_0x546a05,_0x376250,_0x1b331d,_0x1a99ca){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x3855('0x21'),'rest_data':JSON['stringify']({'session':_0x546a05['id'],'module_name':'Calls','module_id':_0x1b331d['id'],'link_field_name':_0x1a99ca,'related_ids':[_0x376250['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x344f7c,_0x16d115,_0x578896,_0xa95738,_0x50f4f5,_0x4559dd){var _0x3185d7,_0x4f16cd,_0x5bf61a,_0x128e03;_0x4559dd[_0x3855('0x52')]=intUtil[_0x3855('0x53')](_0x4559dd[_0x3855('0x52')]);_0x4559dd[_0x3855('0x54')]=intUtil[_0x3855('0x53')](_0x4559dd[_0x3855('0x54')]);def[_0x3855('0x55')]=util[_0x3855('0x38')]('%s/service/v4_1/rest.php',_0x4559dd['remoteUri']);if(_0x50f4f5&&_0x50f4f5[_0x3855('0x56')]){logger[_0x3855('0x31')](_0x3855('0x57'),'Recording\x20is\x20enabled!');_0x16d115[_0x3855('0x58')]=util['format'](_0x3855('0x59'),_0x4559dd[_0x3855('0x54')],_0x16d115[_0x3855('0x5a')],md5(_0x16d115['uniqueid']));}else{_0x16d115[_0x3855('0x58')]='';}return getConnection(_0x4559dd)['then'](function(_0x5a6335){_0x128e03=_0x5a6335;return getUser(_0x4559dd,_0xa95738[_0x3855('0xc')],_0x128e03);})[_0x3855('0x2e')](function(_0x28e353){_0x3185d7=_0x28e353;logger[_0x3855('0x31')](_0x3855('0x5b'),_0x3185d7['id']);return getEndUser(_0x4559dd,_0x16d115[_0x3855('0x5c')],_0x16d115['calleridnum'],_0x128e03);})[_0x3855('0x2e')](function(_0x347766){_0x4f16cd=_0x347766;logger[_0x3855('0x31')](_0x3855('0x5d'),_0x4f16cd['id']);return getTicket(_0x4559dd,_0x3185d7,_0x4f16cd,_0x578896,_0x16d115,_0x578896[_0x3855('0x5e')],_0x128e03,_0x3855('0x5f'));})[_0x3855('0x2e')](function(_0x417cf6){_0x5bf61a=_0x417cf6;logger[_0x3855('0x31')](_0x3855('0x60'));logger[_0x3855('0x31')](_0x3855('0x61'),_0x5bf61a['id']);return setRelationship(_0x128e03,_0x3185d7,_0x5bf61a,_0x3855('0x62'));})['then'](function(){return setRelationship(_0x128e03,_0x4f16cd,_0x5bf61a,_0x3855('0x63'));})['then'](function(){return getServerInfo(_0x128e03);})[_0x3855('0x2e')](function(_0xd6c5fb){var _0x1b6433=parseInt(_0xd6c5fb['version'][_0x3855('0x64')](0x0));var _0x2ddfcf=util['format'](_0x3855('0x65'),_0x4559dd[_0x3855('0x52')],_0x5bf61a['id']);if(_0x1b6433>0x6){_0x2ddfcf=util[_0x3855('0x38')](_0x3855('0x66'),_0x4559dd[_0x3855('0x52')],_0x5bf61a['id']);}logger[_0x3855('0x31')]('[QUEUE]',_0x3855('0x67'));emit(util[_0x3855('0x38')]('user:%s',_0xa95738['name']),_0x3855('0x68'),{'uri':_0x2ddfcf});})['catch'](function(_0x17ccfd){logger[_0x3855('0x69')](_0x3855('0x57'),JSON[_0x3855('0x22')](_0x17ccfd));});};exports['outbound']=function(_0x50b09b,_0x19754b,_0x1f44c9,_0x145b2e,_0x4c78a6,_0x3dc1ac,_0x47dc7e){var _0x34f075,_0x5979ec,_0x1944e0,_0x49d388;_0x3dc1ac[_0x3855('0x52')]=intUtil['stripTrailingSlash'](_0x3dc1ac[_0x3855('0x52')]);_0x3dc1ac[_0x3855('0x54')]=intUtil[_0x3855('0x53')](_0x3dc1ac[_0x3855('0x54')]);def[_0x3855('0x55')]=util[_0x3855('0x38')]('%s/service/v4_1/rest.php',_0x3dc1ac['remoteUri']);if(_0x47dc7e&&_0x47dc7e[_0x3855('0x6a')]&&_0x47dc7e[_0x3855('0x6a')]!=='none'){logger[_0x3855('0x31')](_0x3855('0x6b'),_0x3855('0x6c'));_0x19754b[_0x3855('0x58')]=util['format'](_0x3855('0x59'),_0x3dc1ac[_0x3855('0x54')],_0x19754b[_0x3855('0x5a')],md5(_0x19754b[_0x3855('0x5a')]));}return getConnection(_0x3dc1ac)[_0x3855('0x2e')](function(_0xdeb88){_0x49d388=_0xdeb88;return getUser(_0x3dc1ac,_0x145b2e[_0x3855('0xc')],_0x49d388);})[_0x3855('0x2e')](function(_0x457395){_0x34f075=_0x457395;logger[_0x3855('0x31')]('The\x20User\x20ID\x20is:',_0x34f075['id']);return getEndUser(_0x3dc1ac,_0x19754b[_0x3855('0x6d')],_0x19754b[_0x3855('0x6e')],_0x49d388);})[_0x3855('0x2e')](function(_0x1fbdcb){_0x5979ec=_0x1fbdcb;logger[_0x3855('0x31')]('The\x20Enduser\x20ID\x20is:',_0x5979ec['id']);return getTicket(_0x3dc1ac,_0x34f075,_0x5979ec,_0x1f44c9,_0x19754b,_0x1f44c9[_0x3855('0x5e')],_0x49d388,'Outbound');})[_0x3855('0x2e')](function(_0x55eec3){_0x1944e0=_0x55eec3;logger[_0x3855('0x31')](_0x3855('0x60'));logger[_0x3855('0x31')](_0x3855('0x61'),_0x1944e0['id']);return setRelationship(_0x49d388,_0x34f075,_0x1944e0,'users');})['then'](function(){return setRelationship(_0x49d388,_0x5979ec,_0x1944e0,_0x3855('0x63'));})['then'](function(){return getServerInfo(_0x49d388);})['then'](function(_0x5b8f51){var _0xc8599e=parseInt(_0x5b8f51[_0x3855('0x6f')][_0x3855('0x64')](0x0));var _0x3472c2=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3dc1ac['remoteUri'],_0x1944e0['id']);if(_0xc8599e>0x6){_0x3472c2=util['format'](_0x3855('0x66'),_0x3dc1ac[_0x3855('0x52')],_0x1944e0['id']);}logger['info'](_0x3855('0x6b'),_0x3855('0x67'));emit(util[_0x3855('0x38')](_0x3855('0x70'),_0x145b2e[_0x3855('0xc')]),_0x3855('0x68'),{'uri':_0x3472c2});})[_0x3855('0x71')](function(_0x2c5a92){logger[_0x3855('0x69')](_0x3855('0x6b'),JSON[_0x3855('0x22')](_0x2c5a92));});};exports[_0x3855('0x72')]=function(_0x563361,_0x152320,_0x2dec92,_0x10077f,_0x292fe8,_0x1d6a95){var _0x572201,_0x490f58,_0x745e70,_0x2dba51;_0x1d6a95['remoteUri']=intUtil['stripTrailingSlash'](_0x1d6a95[_0x3855('0x52')]);_0x1d6a95[_0x3855('0x54')]=intUtil[_0x3855('0x53')](_0x1d6a95[_0x3855('0x54')]);def['uri']=util[_0x3855('0x38')](_0x3855('0x73'),_0x1d6a95['remoteUri']);if(_0x292fe8&&_0x292fe8[_0x3855('0x56')]){logger['info']('['+_0x152320[_0x3855('0x74')][_0x3855('0x75')]()+']',_0x3855('0x6c'));_0x152320[_0x3855('0x58')]=util[_0x3855('0x38')](_0x3855('0x59'),_0x1d6a95['serverUrl'],_0x152320['uniqueid'],md5(_0x152320[_0x3855('0x5a')]));}else{_0x152320['recordingURL']='';}return getConnection(_0x1d6a95)[_0x3855('0x2e')](function(_0x457c6a){_0x2dba51=_0x457c6a;if(!_[_0x3855('0x29')](_0x10077f)){return getUser(_0x1d6a95,_0x10077f[_0x3855('0xc')],_0x2dba51);}else{return getUser(_0x1d6a95,null,_0x2dba51);}})[_0x3855('0x2e')](function(_0x28b526){_0x572201=_0x28b526;logger[_0x3855('0x31')](_0x3855('0x5b'),_0x572201['id']);return getEndUser(_0x1d6a95,_0x152320[_0x3855('0x5c')],_0x152320[_0x3855('0x76')],_0x2dba51);})['then'](function(_0x1f827a){_0x490f58=_0x1f827a;logger[_0x3855('0x31')](_0x3855('0x5d'),_0x490f58['id']);return getTicket(_0x1d6a95,_0x572201,_0x490f58,_0x2dec92,_0x152320,_0x2dec92[_0x3855('0x5e')],_0x2dba51,_0x3855('0x5f'));})[_0x3855('0x2e')](function(_0x42ca65){_0x745e70=_0x42ca65;logger[_0x3855('0x31')](_0x3855('0x60'));logger[_0x3855('0x31')](_0x3855('0x61'),_0x745e70['id']);return setRelationship(_0x2dba51,_0x572201,_0x745e70,_0x3855('0x62'));})[_0x3855('0x2e')](function(){return setRelationship(_0x2dba51,_0x490f58,_0x745e70,_0x3855('0x63'));})[_0x3855('0x2e')](function(){return getServerInfo(_0x2dba51);})['catch'](function(_0xe0c8d9){logger[_0x3855('0x69')]('['+_0x152320['lastevent'][_0x3855('0x75')]()+']',JSON[_0x3855('0x22')](_0xe0c8d9));});}; \ No newline at end of file +var _0x6484=['socket.io-emitter','POST','emit','info','name','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','resolve','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','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','type','string','nameField','customField','toLowerCase','content','toString','custom_fields','variable','customVariable','Variable','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','error','unmanaged','lastevent','isNil','calleridname','toUpperCase','bluebird','md5','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x6484,0xe8));var _0x4648=function(_0x262baa,_0x6c1eb8){_0x262baa=_0x262baa-0x0;var _0x2c0e2f=_0x6484[_0x262baa];return _0x2c0e2f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x4648('0x0'));var md5=require(_0x4648('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x4648('0x2'));var logger=require(_0x4648('0x3'))(_0x4648('0x4'));config[_0x4648('0x5')]=_[_0x4648('0x6')](config[_0x4648('0x5')],{'host':_0x4648('0x7'),'port':0x18eb});var io=require(_0x4648('0x8'))(new Redis(config[_0x4648('0x5')]));var def={'method':_0x4648('0x9'),'json':!![]};function emit(_0x353f62,_0x1d2bab,_0x6b59b3){io['to'](_0x353f62)[_0x4648('0xa')](_0x1d2bab,_0x6b59b3);}function getTicket(_0x33923d,_0xbc3c13,_0x5c0647,_0x424e45,_0x4b8563,_0x2867cb,_0x43fccf,_0x4a21a7){logger[_0x4648('0xb')]('Creating\x20new\x20ticket...');var _0x37b304=new Date();var _0x290966=[{'name':_0x4648('0xc'),'value':intUtil['getString'](_0x424e45[_0x4648('0xd')],_0x4b8563,'\x20')},{'name':_0x4648('0xe'),'value':_0xbc3c13['id']},{'name':'created_by','value':_0xbc3c13['id']},{'name':_0x4648('0xf'),'value':intUtil['getString'](_0x424e45[_0x4648('0x10')],_0x4b8563,'\x0a')},{'name':_0x4648('0x11'),'value':_0x37b304[_0x4648('0x12')]()[_0x4648('0x13')](0x0,0x13)[_0x4648('0x14')]('T','\x20')},{'name':_0x4648('0x15'),'value':'0'},{'name':_0x4648('0x16'),'value':'15'},{'name':'parent_id','value':_0x5c0647['id']},{'name':_0x4648('0x17'),'value':_0x4648('0x18')},{'name':_0x4648('0x19'),'value':_0x5c0647[_0x4648('0xc')]},{'name':_0x4648('0x1a'),'value':_0x4a21a7}];if(_0x2867cb[_0x4648('0x1b')]){_[_0x4648('0x1c')](_0x2867cb,function(_0xaa058){if(_0x4b8563[_0xaa058[_0x4648('0x1d')]]){_0x290966[_0x4648('0x1e')]({'name':_0xaa058[_0x4648('0x1f')],'value':_0x4b8563[_0xaa058[_0x4648('0x1d')]]});}});}return request({'form':{'method':_0x4648('0x20'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON[_0x4648('0x22')]({'session':_0x43fccf['id'],'module_name':_0x4648('0x23'),'name_value_list':_0x290966})}});}function getAuth(_0x1d4adf){return util[_0x4648('0x24')](_0x4648('0x25'),new Buffer(_0x1d4adf[_0x4648('0x26')]+':X')['toString']('base64'));}function getServerInfo(_0x575135){return request({'form':{'method':'get_server_info','input_type':_0x4648('0x21'),'response_type':'JSON','rest_data':JSON[_0x4648('0x22')]({'session':_0x575135['id']})}});}function getUser(_0x3f8583,_0x201547,_0x1c7001){if(!_['isNil'](_0x201547)){logger['info'](_0x4648('0x27'),_0x201547);return request({'form':{'method':_0x4648('0x28'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON[_0x4648('0x22')]({'session':_0x1c7001['id'],'module_name':_0x4648('0x29'),'query':util['format'](_0x4648('0x2a'),_0x201547),'order_by':'','offset':'0','select_fields':['id','name',_0x4648('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4648('0x2c')](function(_0x37691a){if(_0x37691a[_0x4648('0x2d')][_0x4648('0x1b')]){var _0x188a51=_['find'](_0x37691a[_0x4648('0x2d')],function(_0x6f1c79){return _0x6f1c79[_0x4648('0x2e')][_0x4648('0x2b')][_0x4648('0x2f')]===_0x201547;});if(_0x188a51){logger[_0x4648('0xb')]('Agent\x20found!');return BPromise[_0x4648('0x30')]({'id':_0x188a51['name_value_list']['id'][_0x4648('0x2f')],'name':_0x188a51[_0x4648('0x2e')][_0x4648('0xc')][_0x4648('0x2f')]});}}logger['info'](_0x4648('0x31'));return BPromise[_0x4648('0x30')]({'id':_0x1c7001['name_value_list'][_0x4648('0x32')][_0x4648('0x2f')],'name':_0x1c7001[_0x4648('0x2e')][_0x4648('0x2b')][_0x4648('0x2f')]});});}else{logger['info'](_0x4648('0x33'));return BPromise['resolve']({'id':_0x1c7001[_0x4648('0x2e')]['user_id'][_0x4648('0x2f')],'name':_0x1c7001[_0x4648('0x2e')][_0x4648('0x2b')][_0x4648('0x2f')]});}}function getEndUser(_0x3e8939,_0x332224,_0x4b2cf6,_0x1be67b){logger[_0x4648('0xb')](_0x4648('0x34'),_0x4b2cf6);return request({'form':{'method':_0x4648('0x28'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON['stringify']({'session':_0x1be67b['id'],'module_name':_0x4648('0x18'),'query':util[_0x4648('0x24')](_0x4648('0x35'),_0x4b2cf6),'order_by':'','offset':'0','select_fields':['id',_0x4648('0xc'),_0x4648('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1808bf){if(_0x1808bf['entry_list'][_0x4648('0x1b')]){var _0x583738=_[_0x4648('0x37')](_0x1808bf[_0x4648('0x2d')],function(_0x32cec2){return _0x32cec2[_0x4648('0x2e')][_0x4648('0x36')][_0x4648('0x2f')]===_0x4b2cf6;});if(_0x583738){logger[_0x4648('0xb')](_0x4648('0x38'));return BPromise['resolve']({'id':_0x583738[_0x4648('0x2e')]['id']['value'],'name':_0x583738['name_value_list']['name'][_0x4648('0x2f')],'phone':_0x583738[_0x4648('0x2e')][_0x4648('0x36')][_0x4648('0x2f')]});}}else{logger[_0x4648('0xb')](_0x4648('0x39'));return request({'form':{'method':_0x4648('0x20'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON[_0x4648('0x22')]({'session':_0x1be67b['id'],'module_name':'Contacts','name_value_list':[{'name':_0x4648('0x3a'),'value':_0x332224!==_0x4648('0x3b')?_0x332224:util[_0x4648('0x24')]('Caller\x20-\x20%s',_0x4b2cf6)},{'name':_0x4648('0x36'),'value':_0x4b2cf6}]})}})[_0x4648('0x2c')](function(_0x10f7bb){logger['info'](_0x4648('0x3c'));return BPromise['resolve']({'id':_0x10f7bb['id'],'name':_0x10f7bb[_0x4648('0x2d')][_0x4648('0x3a')][_0x4648('0x2f')],'phone':_0x10f7bb[_0x4648('0x2d')][_0x4648('0x36')][_0x4648('0x2f')]});});}});}function request(_0x4d620a){logger[_0x4648('0x3d')](_0x4648('0x3e'),JSON[_0x4648('0x22')](_0x4d620a));return rp(_[_0x4648('0x3f')](def,_0x4d620a));}function getTags(_0x2ead82,_0x243be8){var _0x1a5e86=[];if(_0x2ead82&&_0x2ead82[_0x4648('0x1b')]>0x0){_0x1a5e86=_['map'](_0x2ead82,_0x243be8);}return _0x1a5e86;}function getCustomFields(_0x371cdb,_0x4e19b1){var _0x4c6f97=[];var _0x1735d5={'custom_fields':[]};if(_0x371cdb[_0x4648('0x1b')]>0x0){_[_0x4648('0x1c')](_0x371cdb,function(_0x2ffaad){if(_0x2ffaad[_0x4648('0x40')]===_0x4648('0x41')&&_0x2ffaad[_0x4648('0x42')]&&!_0x2ffaad[_0x4648('0x43')]){_0x1735d5[_0x2ffaad[_0x4648('0x42')][_0x4648('0x44')]()]=_0x2ffaad[_0x4648('0x45')][_0x4648('0x46')]();}else if(_0x2ffaad[_0x4648('0x40')]===_0x4648('0x41')&&_0x2ffaad[_0x4648('0x1f')]&&_0x2ffaad['customField']){_0x1735d5[_0x4648('0x47')][_0x4648('0x1e')]({'id':_0x2ffaad[_0x4648('0x1f')],'value':_0x2ffaad[_0x4648('0x45')]['toString']()});}else if(_0x2ffaad[_0x4648('0x40')]===_0x4648('0x48')&&_0x2ffaad[_0x4648('0x1d')]&&_0x2ffaad[_0x4648('0x1f')]&&_0x2ffaad[_0x4648('0x43')]){_0x4e19b1[_0x2ffaad[_0x4648('0x1d')]]&&_0x1735d5[_0x4648('0x47')][_0x4648('0x1e')]({'id':_0x2ffaad[_0x4648('0x1f')],'value':_0x4e19b1[_0x2ffaad[_0x4648('0x1d')]][_0x4648('0x46')]()});}else if(_0x2ffaad[_0x4648('0x40')]===_0x4648('0x49')&&_0x2ffaad[_0x4648('0x4a')]&&_0x2ffaad['Variable'][_0x4648('0xc')]&&_0x2ffaad['idField']&&_0x2ffaad[_0x4648('0x43')]){_0x4e19b1[_0x2ffaad['Variable'][_0x4648('0xc')][_0x4648('0x44')]()]&&_0x1735d5[_0x4648('0x47')][_0x4648('0x1e')]({'id':_0x2ffaad[_0x4648('0x1f')],'value':_0x4e19b1[_0x2ffaad[_0x4648('0x4a')][_0x4648('0xc')][_0x4648('0x44')]()][_0x4648('0x46')]()});}});}return _0x1735d5;}function getConnection(_0x4fcc6e){return request({'method':_0x4648('0x9'),'form':{'method':_0x4648('0x4b'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON[_0x4648('0x22')]({'user_auth':{'user_name':_0x4fcc6e[_0x4648('0x4c')],'password':_0x4fcc6e['password'],'encryption':_0x4648('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4648('0x2c')](function(_0x4a278b){var _0x8ad345=_0x4a278b;if(_0x8ad345['id']){def[_0x4648('0x4e')]=_0x8ad345['id'];return BPromise['resolve'](_0x8ad345);}else{throw new Error(util[_0x4648('0x24')](_0x4648('0x4f'),_0x4fcc6e['id']));}});}function setRelationship(_0x2128ee,_0x3b7a9a,_0x3d5806,_0x48ade3){return request({'form':{'method':_0x4648('0x50'),'input_type':_0x4648('0x21'),'response_type':_0x4648('0x21'),'rest_data':JSON['stringify']({'session':_0x2128ee['id'],'module_name':_0x4648('0x23'),'module_id':_0x3d5806['id'],'link_field_name':_0x48ade3,'related_ids':[_0x3b7a9a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4648('0x51')]=function(_0x3f8afd,_0xac9ae3,_0x5e92e9,_0x1d1afe,_0x370d42,_0x5c45fa){var _0xe9c72d,_0x27e7a7,_0x536e43,_0x222113;_0x5c45fa[_0x4648('0x52')]=intUtil[_0x4648('0x53')](_0x5c45fa[_0x4648('0x52')]);_0x5c45fa[_0x4648('0x54')]=intUtil[_0x4648('0x53')](_0x5c45fa[_0x4648('0x54')]);def[_0x4648('0x55')]=util['format'](_0x4648('0x56'),_0x5c45fa['remoteUri']);if(_0x370d42&&_0x370d42[_0x4648('0x57')]){logger[_0x4648('0xb')](_0x4648('0x58'),_0x4648('0x59'));_0xac9ae3[_0x4648('0x5a')]=util[_0x4648('0x24')](_0x4648('0x5b'),_0x5c45fa[_0x4648('0x54')],_0xac9ae3[_0x4648('0x5c')],md5(_0xac9ae3['uniqueid']));}else{_0xac9ae3[_0x4648('0x5a')]='';}return getConnection(_0x5c45fa)[_0x4648('0x2c')](function(_0x6783e3){_0x222113=_0x6783e3;return getUser(_0x5c45fa,_0x1d1afe[_0x4648('0xc')],_0x222113);})[_0x4648('0x2c')](function(_0x32d311){_0xe9c72d=_0x32d311;logger[_0x4648('0xb')]('The\x20User\x20ID\x20is:',_0xe9c72d['id']);return getEndUser(_0x5c45fa,_0xac9ae3['calleridname'],_0xac9ae3[_0x4648('0x5d')],_0x222113);})['then'](function(_0x3c6ffe){_0x27e7a7=_0x3c6ffe;logger[_0x4648('0xb')](_0x4648('0x5e'),_0x27e7a7['id']);return getTicket(_0x5c45fa,_0xe9c72d,_0x27e7a7,_0x5e92e9,_0xac9ae3,_0x5e92e9[_0x4648('0x5f')],_0x222113,_0x4648('0x60'));})['then'](function(_0x19e28f){_0x536e43=_0x19e28f;logger[_0x4648('0xb')]('Ticket\x20created!');logger[_0x4648('0xb')](_0x4648('0x61'),_0x536e43['id']);return setRelationship(_0x222113,_0xe9c72d,_0x536e43,_0x4648('0x62'));})[_0x4648('0x2c')](function(){return setRelationship(_0x222113,_0x27e7a7,_0x536e43,_0x4648('0x63'));})[_0x4648('0x2c')](function(){return getServerInfo(_0x222113);})['then'](function(_0x4f8853){var _0x50bfe2=parseInt(_0x4f8853[_0x4648('0x64')]['charAt'](0x0));var _0x27ac66=util[_0x4648('0x24')](_0x4648('0x65'),_0x5c45fa['remoteUri'],_0x536e43['id']);if(_0x50bfe2>0x6){_0x27ac66=util[_0x4648('0x24')](_0x4648('0x66'),_0x5c45fa[_0x4648('0x52')],_0x536e43['id']);}logger[_0x4648('0xb')](_0x4648('0x58'),_0x4648('0x67'));emit(util['format'](_0x4648('0x68'),_0x1d1afe[_0x4648('0xc')]),_0x4648('0x69'),{'uri':_0x27ac66});})[_0x4648('0x6a')](function(_0x1274a3){logger['error'](_0x4648('0x58'),JSON[_0x4648('0x22')](_0x1274a3));});};exports[_0x4648('0x6b')]=function(_0x1df707,_0x392da0,_0x4d0b52,_0xb037b0,_0x2277b7,_0x845d4,_0x1345b4){var _0x4182f2,_0x5035c8,_0x57c76c,_0x375b96;_0x845d4['remoteUri']=intUtil[_0x4648('0x53')](_0x845d4['remoteUri']);_0x845d4[_0x4648('0x54')]=intUtil['stripTrailingSlash'](_0x845d4[_0x4648('0x54')]);def[_0x4648('0x55')]=util[_0x4648('0x24')](_0x4648('0x56'),_0x845d4['remoteUri']);if(_0x1345b4&&_0x1345b4['recordingFormat']&&_0x1345b4[_0x4648('0x6c')]!==_0x4648('0x6d')){logger[_0x4648('0xb')](_0x4648('0x6e'),'Recording\x20is\x20enabled!');_0x392da0[_0x4648('0x5a')]=util[_0x4648('0x24')](_0x4648('0x5b'),_0x845d4[_0x4648('0x54')],_0x392da0[_0x4648('0x5c')],md5(_0x392da0[_0x4648('0x5c')]));}return getConnection(_0x845d4)[_0x4648('0x2c')](function(_0x581071){_0x375b96=_0x581071;return getUser(_0x845d4,_0xb037b0['name'],_0x375b96);})[_0x4648('0x2c')](function(_0x92941b){_0x4182f2=_0x92941b;logger[_0x4648('0xb')]('The\x20User\x20ID\x20is:',_0x4182f2['id']);return getEndUser(_0x845d4,_0x392da0[_0x4648('0x6f')],_0x392da0[_0x4648('0x70')],_0x375b96);})[_0x4648('0x2c')](function(_0x2e4c35){_0x5035c8=_0x2e4c35;logger[_0x4648('0xb')](_0x4648('0x5e'),_0x5035c8['id']);return getTicket(_0x845d4,_0x4182f2,_0x5035c8,_0x4d0b52,_0x392da0,_0x4d0b52['Fields'],_0x375b96,'Outbound');})[_0x4648('0x2c')](function(_0x543474){_0x57c76c=_0x543474;logger[_0x4648('0xb')](_0x4648('0x71'));logger[_0x4648('0xb')](_0x4648('0x61'),_0x57c76c['id']);return setRelationship(_0x375b96,_0x4182f2,_0x57c76c,'users');})['then'](function(){return setRelationship(_0x375b96,_0x5035c8,_0x57c76c,_0x4648('0x63'));})[_0x4648('0x2c')](function(){return getServerInfo(_0x375b96);})['then'](function(_0x5237b9){var _0x14c733=parseInt(_0x5237b9[_0x4648('0x64')]['charAt'](0x0));var _0x250eac=util['format'](_0x4648('0x65'),_0x845d4[_0x4648('0x52')],_0x57c76c['id']);if(_0x14c733>0x6){_0x250eac=util['format'](_0x4648('0x66'),_0x845d4[_0x4648('0x52')],_0x57c76c['id']);}logger[_0x4648('0xb')](_0x4648('0x6e'),_0x4648('0x67'));emit(util[_0x4648('0x24')](_0x4648('0x68'),_0xb037b0[_0x4648('0xc')]),_0x4648('0x69'),{'uri':_0x250eac});})[_0x4648('0x6a')](function(_0x317bc3){logger[_0x4648('0x72')](_0x4648('0x6e'),JSON['stringify'](_0x317bc3));});};exports[_0x4648('0x73')]=function(_0x5e9894,_0x395a60,_0x41c7ad,_0x232ad1,_0x499d38,_0x55e9c5){var _0x2e17c4,_0x28f709,_0x2155bb,_0x3f2ba5;_0x55e9c5[_0x4648('0x52')]=intUtil[_0x4648('0x53')](_0x55e9c5[_0x4648('0x52')]);_0x55e9c5[_0x4648('0x54')]=intUtil['stripTrailingSlash'](_0x55e9c5[_0x4648('0x54')]);def['uri']=util[_0x4648('0x24')](_0x4648('0x56'),_0x55e9c5[_0x4648('0x52')]);if(_0x499d38&&_0x499d38[_0x4648('0x57')]){logger[_0x4648('0xb')]('['+_0x395a60[_0x4648('0x74')]['toUpperCase']()+']',_0x4648('0x59'));_0x395a60[_0x4648('0x5a')]=util[_0x4648('0x24')](_0x4648('0x5b'),_0x55e9c5[_0x4648('0x54')],_0x395a60['uniqueid'],md5(_0x395a60[_0x4648('0x5c')]));}else{_0x395a60[_0x4648('0x5a')]='';}return getConnection(_0x55e9c5)[_0x4648('0x2c')](function(_0x55fb42){_0x3f2ba5=_0x55fb42;if(!_[_0x4648('0x75')](_0x232ad1)){return getUser(_0x55e9c5,_0x232ad1['name'],_0x3f2ba5);}else{return getUser(_0x55e9c5,null,_0x3f2ba5);}})[_0x4648('0x2c')](function(_0x438810){_0x2e17c4=_0x438810;logger[_0x4648('0xb')]('The\x20User\x20ID\x20is:',_0x2e17c4['id']);return getEndUser(_0x55e9c5,_0x395a60[_0x4648('0x76')],_0x395a60[_0x4648('0x5d')],_0x3f2ba5);})[_0x4648('0x2c')](function(_0x53404d){_0x28f709=_0x53404d;logger[_0x4648('0xb')](_0x4648('0x5e'),_0x28f709['id']);return getTicket(_0x55e9c5,_0x2e17c4,_0x28f709,_0x41c7ad,_0x395a60,_0x41c7ad[_0x4648('0x5f')],_0x3f2ba5,_0x4648('0x60'));})[_0x4648('0x2c')](function(_0x365f80){_0x2155bb=_0x365f80;logger[_0x4648('0xb')](_0x4648('0x71'));logger['info'](_0x4648('0x61'),_0x2155bb['id']);return setRelationship(_0x3f2ba5,_0x2e17c4,_0x2155bb,_0x4648('0x62'));})[_0x4648('0x2c')](function(){return setRelationship(_0x3f2ba5,_0x28f709,_0x2155bb,'contacts');})[_0x4648('0x2c')](function(){return getServerInfo(_0x3f2ba5);})[_0x4648('0x6a')](function(_0x459f36){logger['error']('['+_0x395a60['lastevent'][_0x4648('0x77')]()+']',JSON['stringify'](_0x459f36));});}; \ 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 d627aba..8573049 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 _0x1588=['lastIndexOf','validateEmail','isNil','lodash','util','getString','length','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','slice'];(function(_0xfafce3,_0x1e320a){var _0x4e2043=function(_0x32c092){while(--_0x32c092){_0xfafce3['push'](_0xfafce3['shift']());}};_0x4e2043(++_0x1e320a);}(_0x1588,0x1cb));var _0x8158=function(_0x4e2c2b,_0x624e3c){_0x4e2c2b=_0x4e2c2b-0x0;var _0x58d1b2=_0x1588[_0x4e2c2b];return _0x58d1b2;};'use strict';var _=require(_0x8158('0x0'));var util=require(_0x8158('0x1'));exports[_0x8158('0x2')]=function(_0x2e3279,_0x36badb,_0x26349d){var _0x1dafe3=[];if(_0x2e3279['length']>0x0){var _0x3e9c34=_['sortBy'](_0x2e3279,['id']);for(var _0x3f445f=0x0;_0x3f445f<_0x3e9c34[_0x8158('0x3')];_0x3f445f++){var _0x10282d=_0x3e9c34[_0x3f445f];if(_0x10282d[_0x8158('0x4')]===_0x8158('0x5')){_0x1dafe3[_0x8158('0x6')](_0x10282d[_0x8158('0x7')]);}else if(_0x10282d['type']===_0x8158('0x8')&&_0x10282d[_0x8158('0x9')]){_0x36badb[_0x10282d[_0x8158('0x9')]]&&_0x1dafe3[_0x8158('0x6')](_0x36badb[_0x10282d[_0x8158('0x9')]]['toString']());}else if(_0x10282d[_0x8158('0x4')]===_0x8158('0xa')&&_0x10282d[_0x8158('0xb')]&&_0x10282d[_0x8158('0xb')]['name']){_0x36badb[_0x10282d[_0x8158('0xb')]['name']['toLowerCase']()]&&_0x1dafe3[_0x8158('0x6')](_0x36badb[_0x10282d[_0x8158('0xb')][_0x8158('0xc')][_0x8158('0xd')]()]['toString']());}else if(_0x10282d['type']===_0x8158('0xe')){if(_0x10282d[_0x8158('0xf')]===_0x8158('0x5')&&_0x10282d[_0x8158('0x10')]){_0x1dafe3[_0x8158('0x6')](util[_0x8158('0x11')](_0x8158('0x12'),_0x10282d[_0x8158('0x10')],_0x10282d['keyContent']));}else if(_0x10282d[_0x8158('0xf')]===_0x8158('0x8')&&_0x10282d['variableName']&&_0x10282d[_0x8158('0x10')]){_0x36badb[_0x10282d[_0x8158('0x9')]]&&_0x1dafe3['push'](util[_0x8158('0x11')](_0x8158('0x12'),_0x10282d['key'],_0x36badb[_0x10282d[_0x8158('0x9')]]));}else if(_0x10282d['keyType']===_0x8158('0xa')&&_0x10282d[_0x8158('0xb')]&&_0x10282d[_0x8158('0xb')][_0x8158('0xc')]&&_0x10282d[_0x8158('0x10')]){_0x36badb[_0x10282d['Variable']['name'][_0x8158('0xd')]()]&&_0x1dafe3['push'](util[_0x8158('0x11')]('%s:\x20%s',_0x10282d[_0x8158('0x10')],_0x36badb[_0x10282d[_0x8158('0xb')][_0x8158('0xc')][_0x8158('0xd')]()]));}}}}return _0x1dafe3[_0x8158('0x13')](_0x26349d);};exports['stripTrailingSlash']=function(_0x146551){var _0x4fc90c=_0x146551[_0x8158('0x14')](-0x1);if(_0x4fc90c==='/'){_0x146551=_0x146551['substring'](0x0,_0x146551[_0x8158('0x15')](_0x4fc90c));}return _0x146551;};exports[_0x8158('0x16')]=function(_0x26cb05){if(!_[_0x8158('0x17')](_0x26cb05)&&_0x26cb05!==''){var _0x3dc20c=/^(([^<>()\[\]\\.,;:\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 _0x3dc20c['test'](String(_0x26cb05)[_0x8158('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x0da9=['Variable','name','toLowerCase','keyValue','keyType','string','key','keyContent','format','%s:\x20%s','join','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','push','content','variable','variableName','customVariable'];(function(_0x49c273,_0x456aa1){var _0x1d4451=function(_0x220827){while(--_0x220827){_0x49c273['push'](_0x49c273['shift']());}};_0x1d4451(++_0x456aa1);}(_0x0da9,0x1e4));var _0x90da=function(_0x5bf578,_0x52abff){_0x5bf578=_0x5bf578-0x0;var _0x2ac394=_0x0da9[_0x5bf578];return _0x2ac394;};'use strict';var _=require(_0x90da('0x0'));var util=require(_0x90da('0x1'));exports[_0x90da('0x2')]=function(_0x4af76a,_0x320e70,_0x57996b){var _0x386d74=[];if(_0x4af76a[_0x90da('0x3')]>0x0){var _0x4746c1=_['sortBy'](_0x4af76a,['id']);for(var _0x380bb9=0x0;_0x380bb9<_0x4746c1['length'];_0x380bb9++){var _0x194024=_0x4746c1[_0x380bb9];if(_0x194024[_0x90da('0x4')]==='string'){_0x386d74[_0x90da('0x5')](_0x194024[_0x90da('0x6')]);}else if(_0x194024[_0x90da('0x4')]===_0x90da('0x7')&&_0x194024[_0x90da('0x8')]){_0x320e70[_0x194024[_0x90da('0x8')]]&&_0x386d74[_0x90da('0x5')](_0x320e70[_0x194024[_0x90da('0x8')]]['toString']());}else if(_0x194024['type']===_0x90da('0x9')&&_0x194024[_0x90da('0xa')]&&_0x194024['Variable'][_0x90da('0xb')]){_0x320e70[_0x194024[_0x90da('0xa')][_0x90da('0xb')][_0x90da('0xc')]()]&&_0x386d74[_0x90da('0x5')](_0x320e70[_0x194024['Variable'][_0x90da('0xb')][_0x90da('0xc')]()]['toString']());}else if(_0x194024['type']===_0x90da('0xd')){if(_0x194024[_0x90da('0xe')]===_0x90da('0xf')&&_0x194024[_0x90da('0x10')]){_0x386d74[_0x90da('0x5')](util['format']('%s:\x20%s',_0x194024['key'],_0x194024[_0x90da('0x11')]));}else if(_0x194024[_0x90da('0xe')]===_0x90da('0x7')&&_0x194024[_0x90da('0x8')]&&_0x194024[_0x90da('0x10')]){_0x320e70[_0x194024[_0x90da('0x8')]]&&_0x386d74[_0x90da('0x5')](util[_0x90da('0x12')]('%s:\x20%s',_0x194024[_0x90da('0x10')],_0x320e70[_0x194024[_0x90da('0x8')]]));}else if(_0x194024[_0x90da('0xe')]===_0x90da('0x9')&&_0x194024[_0x90da('0xa')]&&_0x194024[_0x90da('0xa')][_0x90da('0xb')]&&_0x194024['key']){_0x320e70[_0x194024[_0x90da('0xa')][_0x90da('0xb')][_0x90da('0xc')]()]&&_0x386d74[_0x90da('0x5')](util['format'](_0x90da('0x13'),_0x194024[_0x90da('0x10')],_0x320e70[_0x194024['Variable'][_0x90da('0xb')]['toLowerCase']()]));}}}}return _0x386d74[_0x90da('0x14')](_0x57996b);};exports['stripTrailingSlash']=function(_0x568ca6){var _0x41c662=_0x568ca6['slice'](-0x1);if(_0x41c662==='/'){_0x568ca6=_0x568ca6[_0x90da('0x15')](0x0,_0x568ca6[_0x90da('0x16')](_0x41c662));}return _0x568ca6;};exports[_0x90da('0x17')]=function(_0x174307){if(!_[_0x90da('0x18')](_0x174307)&&_0x174307!==''){var _0x18bad6=/^(([^<>()\[\]\\.,;:\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 _0x18bad6[_0x90da('0x19')](String(_0x174307)[_0x90da('0xc')]());}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 0907f50..4d5f47e 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x160043,_0x51b467){var _0x2aee5c=function(_0x3fb8e2){while(--_0x3fb8e2){_0x160043['push'](_0x160043['shift']());}};_0x2aee5c(++_0x51b467);}(_0x9c44,0x178));var _0x49c4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x9c44[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ 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(_0x24a312,_0x816625){var _0x4ac91f=function(_0x55e130){while(--_0x55e130){_0x24a312['push'](_0x24a312['shift']());}};_0x4ac91f(++_0x816625);}(_0xe706,0xa3));var _0x6e70=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xe706[_0x2fc012];return _0x2891f9;};'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 2719f5e..b2ee5eb 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 _0x4abe=['info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','variable','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','zendesk','redis','defaults','localhost','socket.io-emitter','application/json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4abe,0x14e));var _0xe4ab=function(_0x3d37ee,_0x29797e){_0x3d37ee=_0x3d37ee-0x0;var _0x22c880=_0x4abe[_0x3d37ee];return _0x22c880;};'use strict';var _=require(_0xe4ab('0x0'));var rp=require(_0xe4ab('0x1'));var md5=require(_0xe4ab('0x2'));var util=require('util');var Redis=require(_0xe4ab('0x3'));var intUtil=require(_0xe4ab('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe4ab('0x5'));config[_0xe4ab('0x6')]=_[_0xe4ab('0x7')](config[_0xe4ab('0x6')],{'host':_0xe4ab('0x8'),'port':0x18eb});var io=require(_0xe4ab('0x9'))(new Redis(config[_0xe4ab('0x6')]));function emit(_0x2a876a,_0x4e6e94,_0x30bc5f){io['to'](_0x2a876a)['emit'](_0x4e6e94,_0x30bc5f);}var headers={'Content-Type':_0xe4ab('0xa'),'Accept':'application/json'};function getTicket(_0x562d88,_0x3bcf20,_0x282509,_0x12b0ea,_0x7969b5){logger[_0xe4ab('0xb')](_0xe4ab('0xc'));return request({'uri':util[_0xe4ab('0xd')](_0xe4ab('0xe'),_0x562d88['remoteUri']),'method':_0xe4ab('0xf'),'body':{'ticket':_[_0xe4ab('0x10')]({'requester_id':_0x282509['id'],'submitter_id':_0x3bcf20?_0x3bcf20['id']:undefined,'assignee_id':_0x3bcf20?_0x3bcf20['id']:undefined,'tags':getTags(_0x12b0ea[_0xe4ab('0x11')],_0xe4ab('0x12')),'subject':intUtil[_0xe4ab('0x13')](_0x12b0ea['Subjects'],_0x7969b5,'\x20'),'description':intUtil['getString'](_0x12b0ea['Descriptions'],_0x7969b5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe4ab('0x13')](_0x12b0ea[_0xe4ab('0x14')],_0x7969b5,'\x0a')}},getCustomFields(_0x12b0ea[_0xe4ab('0x15')],_0x7969b5))}})[_0xe4ab('0x16')](function(_0x3ca224){logger[_0xe4ab('0xb')]('Ticket\x20created!');return _0x3ca224[_0xe4ab('0x17')];});}function getUser(_0x574f1d,_0x5a16a5){if(intUtil[_0xe4ab('0x18')](_0x5a16a5)){logger[_0xe4ab('0xb')](_0xe4ab('0x19'),_0x5a16a5);return request({'uri':util['format'](_0xe4ab('0x1a'),_0x574f1d['remoteUri']),'qs':{'query':util[_0xe4ab('0xd')]('type:user\x20role:agent\x20email:%s',_0x5a16a5)}})['then'](function(_0x2aaf2e){if(_0x2aaf2e[_0xe4ab('0x1b')]){logger['info'](_0xe4ab('0x1c'));return _[_0xe4ab('0x1d')](_0x2aaf2e[_0xe4ab('0x1e')],{'email':_0x5a16a5,'role':_0xe4ab('0x1f')});}else{logger[_0xe4ab('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe4ab('0x20'),_0x574f1d['remoteUri'])})['then'](function(_0x4fbc56){logger[_0xe4ab('0xb')](_0xe4ab('0x21'));return _0x4fbc56[_0xe4ab('0x22')];});}});}else{logger['info'](_0xe4ab('0x23'));return request({'uri':util['format'](_0xe4ab('0x20'),_0x574f1d[_0xe4ab('0x24')])})['then'](function(_0x587eee){logger[_0xe4ab('0xb')]('Admin\x20account\x20selected.');return _0x587eee[_0xe4ab('0x22')];});}}function getEndUser(_0x4193d4,_0x1636a1,_0x2bb9b4){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2bb9b4);return request({'uri':util[_0xe4ab('0xd')]('%s/search.json',_0x4193d4[_0xe4ab('0x24')]),'qs':{'query':util[_0xe4ab('0xd')](_0xe4ab('0x25'),_0x2bb9b4)}})[_0xe4ab('0x16')](function(_0x4d5b12){var _0x5cfc58;if(_0x4d5b12[_0xe4ab('0x1e')]['length']){_0x4d5b12[_0xe4ab('0x1e')]=_[_0xe4ab('0x26')](_0x4d5b12[_0xe4ab('0x1e')],{'suspended':![],'role':_0xe4ab('0x27')});if(_0x4d5b12[_0xe4ab('0x1e')][_0xe4ab('0x28')]){_0x5cfc58=_[_0xe4ab('0x29')](_0x4d5b12[_0xe4ab('0x1e')]);}}if(_0x5cfc58){logger[_0xe4ab('0xb')](_0xe4ab('0x2a'));return _0x5cfc58;}else{logger[_0xe4ab('0xb')](_0xe4ab('0x2b'));return request({'uri':util[_0xe4ab('0xd')](_0xe4ab('0x2c'),_0x4193d4[_0xe4ab('0x24')]),'method':'POST','body':{'user':{'role':_0xe4ab('0x27'),'name':util[_0xe4ab('0xd')](_0xe4ab('0x2d'),_0x1636a1||_0x2bb9b4),'phone':_0x2bb9b4}}})['then'](function(_0x4c643e){logger[_0xe4ab('0xb')](_0xe4ab('0x2e'));return _0x4c643e[_0xe4ab('0x22')];});}});}function getAuth(_0xe981ba){var _0x233e73;if(_0xe981ba[_0xe4ab('0x2f')]===_0xe4ab('0x30')){_0x233e73=util['format'](_0xe4ab('0x31'),_0xe981ba['username'],_0xe981ba[_0xe4ab('0x30')]);}else if(_0xe981ba[_0xe4ab('0x2f')]===_0xe4ab('0x32')){_0x233e73=util['format'](_0xe4ab('0x33'),_0xe981ba[_0xe4ab('0x34')],_0xe981ba[_0xe4ab('0x32')]);}return util[_0xe4ab('0xd')]('Basic\x20%s',new Buffer(_0x233e73)[_0xe4ab('0x35')](_0xe4ab('0x36')));}function request(_0x415aa1){logger[_0xe4ab('0x37')](_0xe4ab('0x38'),JSON[_0xe4ab('0x39')](_0x415aa1));return rp(_[_0xe4ab('0x7')](_0x415aa1,{'method':_0xe4ab('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x34b2da,_0x53b89b){var _0x500a62=[];if(_0x34b2da&&_0x34b2da[_0xe4ab('0x28')]>0x0){_0x500a62=_[_0xe4ab('0x3b')](_0x34b2da,_0x53b89b);}return _0x500a62;}function getCustomFields(_0x10c9dd,_0x3ad47d){var _0x29b488=[];var _0x49d247={'custom_fields':[]};if(_0x10c9dd[_0xe4ab('0x28')]>0x0){_[_0xe4ab('0x3c')](_0x10c9dd,function(_0x44a63a){if(_[_0xe4ab('0x3d')]([_0xe4ab('0x3e'),_0xe4ab('0x3f')],_0x44a63a[_0xe4ab('0x40')])&&_0x44a63a[_0xe4ab('0x41')]&&!_0x44a63a[_0xe4ab('0x42')]){_0x49d247[_0x44a63a['nameField'][_0xe4ab('0x43')]()]=_0x44a63a[_0xe4ab('0x44')][_0xe4ab('0x35')]();}else if(_[_0xe4ab('0x3d')]([_0xe4ab('0x3e'),'picklist'],_0x44a63a['type'])&&_0x44a63a[_0xe4ab('0x45')]&&_0x44a63a[_0xe4ab('0x42')]){_0x49d247[_0xe4ab('0x46')]['push']({'id':_0x44a63a[_0xe4ab('0x45')],'value':_0x44a63a[_0xe4ab('0x44')][_0xe4ab('0x35')]()});}else if(_0x44a63a[_0xe4ab('0x40')]===_0xe4ab('0x47')&&_0x44a63a[_0xe4ab('0x48')]&&_0x44a63a['idField']&&_0x44a63a[_0xe4ab('0x42')]){_0x3ad47d[_0x44a63a['variableName']]&&_0x49d247[_0xe4ab('0x46')][_0xe4ab('0x49')]({'id':_0x44a63a['idField'],'value':_0x3ad47d[_0x44a63a['variableName']][_0xe4ab('0x35')]()});}else if(_0x44a63a[_0xe4ab('0x40')]==='customVariable'&&_0x44a63a[_0xe4ab('0x4a')]&&_0x44a63a[_0xe4ab('0x4a')][_0xe4ab('0x12')]&&_0x44a63a[_0xe4ab('0x45')]&&_0x44a63a[_0xe4ab('0x42')]){_0x3ad47d[_0x44a63a['Variable']['name'][_0xe4ab('0x43')]()]&&_0x49d247[_0xe4ab('0x46')][_0xe4ab('0x49')]({'id':_0x44a63a[_0xe4ab('0x45')],'value':_0x3ad47d[_0x44a63a[_0xe4ab('0x4a')]['name']['toLowerCase']()][_0xe4ab('0x35')]()});}});}return _0x49d247;}exports[_0xe4ab('0x4b')]=function(_0x3468a0,_0x311a96,_0x30e83f,_0x36f61b,_0x192341,_0x39a4f6){var _0x3d7b9b,_0x5e77b9;_0x39a4f6['remoteUri']=intUtil[_0xe4ab('0x4c')](_0x39a4f6['remoteUri']);_0x39a4f6[_0xe4ab('0x4d')]=intUtil['stripTrailingSlash'](_0x39a4f6[_0xe4ab('0x4d')]);if(_0x192341&&_0x192341['monitor_format']){logger[_0xe4ab('0xb')](_0xe4ab('0x4e'),'Recording\x20is\x20enabled!');_0x311a96['recordingURL']=util[_0xe4ab('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39a4f6['serverUrl'],_0x311a96['uniqueid'],md5(_0x311a96['uniqueid']));}else{_0x311a96[_0xe4ab('0x4f')]='';}headers[_0xe4ab('0x50')]=getAuth(_0x39a4f6);return getUser(_0x39a4f6,_0x36f61b[_0xe4ab('0x51')])[_0xe4ab('0x16')](function(_0x2d66f0){_0x3d7b9b=_0x2d66f0;logger[_0xe4ab('0xb')]('The\x20User\x20ID\x20is:',_0x3d7b9b['id']);return getEndUser(_0x39a4f6,_0x311a96['calleridname'],_0x311a96['calleridnum']);})[_0xe4ab('0x16')](function(_0x4fa51b){_0x5e77b9=_0x4fa51b;logger['info'](_0xe4ab('0x52'),_0x5e77b9['id']);return getTicket(_0x39a4f6,_0x3d7b9b,_0x5e77b9,_0x30e83f,_0x311a96);})['then'](function(_0x53f3cf){if(_0x53f3cf){logger[_0xe4ab('0xb')](_0xe4ab('0x53'),_0x53f3cf['id']);switch(_0x39a4f6[_0xe4ab('0x40')]){case _0xe4ab('0x54'):logger[_0xe4ab('0xb')](_0xe4ab('0x4e'),_0xe4ab('0x55'));return request({'uri':util[_0xe4ab('0xd')](_0xe4ab('0x56'),_0x39a4f6[_0xe4ab('0x24')],_0x3d7b9b['id'],_0x53f3cf['id']),'method':_0xe4ab('0xf')});case _0xe4ab('0x57'):logger[_0xe4ab('0xb')]('[QUEUE]',_0xe4ab('0x58'));emit(util[_0xe4ab('0xd')](_0xe4ab('0x59'),_0x36f61b[_0xe4ab('0x12')]),_0xe4ab('0x5a'),{'uri':util['format'](_0xe4ab('0x5b'),_0x39a4f6[_0xe4ab('0x24')][_0xe4ab('0x5c')]('/api/v2',''),_0x53f3cf['id'])});break;default:logger[_0xe4ab('0x5d')]('[QUEUE]',_0xe4ab('0x5e'));}}})[_0xe4ab('0x5f')](function(_0x154895){logger[_0xe4ab('0x5d')](_0xe4ab('0x60'),util[_0xe4ab('0x61')](_0x154895,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0xbf71aa,_0x266e30,_0x15fc69,_0x18f9e3,_0x2a827c,_0x36bdcb,_0x49c38b){var _0x40d7c6,_0x5d49c7;_0x36bdcb['remoteUri']=intUtil[_0xe4ab('0x4c')](_0x36bdcb[_0xe4ab('0x24')]);_0x36bdcb[_0xe4ab('0x4d')]=intUtil[_0xe4ab('0x4c')](_0x36bdcb[_0xe4ab('0x4d')]);if(_0x49c38b&&_0x49c38b[_0xe4ab('0x62')]&&_0x49c38b[_0xe4ab('0x62')]!==_0xe4ab('0x63')){logger[_0xe4ab('0xb')](_0xe4ab('0x64'),_0xe4ab('0x65'));_0x266e30['recordingURL']=util[_0xe4ab('0xd')](_0xe4ab('0x66'),_0x36bdcb[_0xe4ab('0x4d')],_0x266e30[_0xe4ab('0x67')],md5(_0x266e30[_0xe4ab('0x67')]));}headers[_0xe4ab('0x50')]=getAuth(_0x36bdcb);return getUser(_0x36bdcb,_0x18f9e3[_0xe4ab('0x51')])['then'](function(_0x135175){_0x40d7c6=_0x135175;logger[_0xe4ab('0xb')](_0xe4ab('0x68'),_0x40d7c6['id']);return getEndUser(_0x36bdcb,_0x266e30[_0xe4ab('0x69')],_0x266e30['destcalleridnum']);})[_0xe4ab('0x16')](function(_0x3b3664){_0x5d49c7=_0x3b3664;logger[_0xe4ab('0xb')](_0xe4ab('0x52'),_0x5d49c7['id']);return getTicket(_0x36bdcb,_0x40d7c6,_0x5d49c7,_0x15fc69,_0x266e30);})[_0xe4ab('0x16')](function(_0x316248){if(_0x316248){logger[_0xe4ab('0xb')](_0xe4ab('0x53'),_0x316248['id']);switch(_0x36bdcb[_0xe4ab('0x40')]){case'integrationTab':logger[_0xe4ab('0xb')]('[OUTBOUND]',_0xe4ab('0x55'));return request({'uri':util[_0xe4ab('0xd')](_0xe4ab('0x56'),_0x36bdcb[_0xe4ab('0x24')],_0x40d7c6['id'],_0x316248['id']),'method':_0xe4ab('0xf')});case _0xe4ab('0x57'):logger[_0xe4ab('0xb')](_0xe4ab('0x64'),_0xe4ab('0x58'));emit(util[_0xe4ab('0xd')](_0xe4ab('0x59'),_0x18f9e3[_0xe4ab('0x12')]),_0xe4ab('0x5a'),{'uri':util[_0xe4ab('0xd')]('%s/agent/tickets/%s',_0x36bdcb['remoteUri'][_0xe4ab('0x5c')](_0xe4ab('0x6a'),''),_0x316248['id'])});break;default:logger[_0xe4ab('0x5d')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x27c068){logger[_0xe4ab('0x5d')](_0xe4ab('0x6b'),util[_0xe4ab('0x61')](_0x27c068,{'showHidden':!![],'depth':null}));});};exports[_0xe4ab('0x6c')]=function(_0x3d986e,_0x67f2cb,_0x377daf,_0x35c61a,_0x184b69,_0x1c4536){var _0x15984f,_0x1b8bf0;_0x1c4536[_0xe4ab('0x24')]=intUtil[_0xe4ab('0x4c')](_0x1c4536[_0xe4ab('0x24')]);_0x1c4536['serverUrl']=intUtil['stripTrailingSlash'](_0x1c4536['serverUrl']);if(_0x184b69&&_0x184b69[_0xe4ab('0x6d')]){logger['info']('['+_0x67f2cb[_0xe4ab('0x6e')][_0xe4ab('0x6f')]()+']',_0xe4ab('0x65'));_0x67f2cb[_0xe4ab('0x4f')]=util[_0xe4ab('0xd')](_0xe4ab('0x66'),_0x1c4536[_0xe4ab('0x4d')],_0x67f2cb[_0xe4ab('0x67')],md5(_0x67f2cb['uniqueid']));}else{_0x67f2cb['recordingURL']='';}headers[_0xe4ab('0x50')]=getAuth(_0x1c4536);return getUser(_0x1c4536)[_0xe4ab('0x16')](function(_0x57e506){_0x15984f=_0x57e506;logger[_0xe4ab('0xb')](_0xe4ab('0x68'),_0x15984f['id']);return getEndUser(_0x1c4536,_0x67f2cb[_0xe4ab('0x70')],_0x67f2cb[_0xe4ab('0x71')]);})[_0xe4ab('0x16')](function(_0x34e395){_0x1b8bf0=_0x34e395;logger['info'](_0xe4ab('0x52'),_0x1b8bf0['id']);return getTicket(_0x1c4536,_0x15984f,_0x1b8bf0,_0x377daf,_0x67f2cb);})['then'](function(_0x163069){if(_0x163069){logger['info']('The\x20Ticket\x20ID\x20is:',_0x163069['id']);}})[_0xe4ab('0x5f')](function(_0xafd750){logger[_0xe4ab('0x5d')]('['+_0x67f2cb[_0xe4ab('0x6e')][_0xe4ab('0x6f')]()+']'+_0xe4ab('0x72'),util[_0xe4ab('0x61')](_0xafd750,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa735=['The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','name','getString','Subjects','Fields','then','info','Ticket\x20created!','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','results','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','includes','string','picklist','nameField','customField','toLowerCase','type','idField','push','content','variableName','customVariable','Variable','custom_fields','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','Recording\x20is\x20enabled!'];(function(_0x99066,_0x40070e){var _0x2c2a62=function(_0x554422){while(--_0x554422){_0x99066['push'](_0x99066['shift']());}};_0x2c2a62(++_0x40070e);}(_0xa735,0x7a));var _0x5a73=function(_0x4fd272,_0x51386e){_0x4fd272=_0x4fd272-0x0;var _0x7ad0c1=_0xa735[_0x4fd272];return _0x7ad0c1;};'use strict';var _=require(_0x5a73('0x0'));var rp=require('request-promise');var md5=require(_0x5a73('0x1'));var util=require(_0x5a73('0x2'));var Redis=require(_0x5a73('0x3'));var intUtil=require(_0x5a73('0x4'));var config=require(_0x5a73('0x5'));var logger=require('../../../../config/logger')(_0x5a73('0x6'));config['redis']=_['defaults'](config[_0x5a73('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x5d3870,_0x5732c7,_0x15458b){io['to'](_0x5d3870)[_0x5a73('0x8')](_0x5732c7,_0x15458b);}var headers={'Content-Type':_0x5a73('0x9'),'Accept':'application/json'};function getTicket(_0x350f7d,_0x30b3fa,_0x47c5b4,_0x187e67,_0x14cd07){logger['info'](_0x5a73('0xa'));return request({'uri':util[_0x5a73('0xb')](_0x5a73('0xc'),_0x350f7d[_0x5a73('0xd')]),'method':_0x5a73('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x47c5b4['id'],'submitter_id':_0x30b3fa?_0x30b3fa['id']:undefined,'assignee_id':_0x30b3fa?_0x30b3fa['id']:undefined,'tags':getTags(_0x187e67['Tags'],_0x5a73('0xf')),'subject':intUtil[_0x5a73('0x10')](_0x187e67[_0x5a73('0x11')],_0x14cd07,'\x20'),'description':intUtil['getString'](_0x187e67['Descriptions'],_0x14cd07,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5a73('0x10')](_0x187e67['Descriptions'],_0x14cd07,'\x0a')}},getCustomFields(_0x187e67[_0x5a73('0x12')],_0x14cd07))}})[_0x5a73('0x13')](function(_0x1689e6){logger[_0x5a73('0x14')](_0x5a73('0x15'));return _0x1689e6['ticket'];});}function getUser(_0x29d680,_0x42c0e2){if(intUtil[_0x5a73('0x16')](_0x42c0e2)){logger[_0x5a73('0x14')]('Getting\x20agent\x20with\x20email',_0x42c0e2);return request({'uri':util[_0x5a73('0xb')](_0x5a73('0x17'),_0x29d680[_0x5a73('0xd')]),'qs':{'query':util[_0x5a73('0xb')](_0x5a73('0x18'),_0x42c0e2)}})[_0x5a73('0x13')](function(_0x204831){if(_0x204831[_0x5a73('0x19')]){logger['info'](_0x5a73('0x1a'));return _[_0x5a73('0x1b')](_0x204831['results'],{'email':_0x42c0e2,'role':_0x5a73('0x1c')});}else{logger['info'](_0x5a73('0x1d'));return request({'uri':util[_0x5a73('0xb')]('%s/users/me.json',_0x29d680[_0x5a73('0xd')])})[_0x5a73('0x13')](function(_0x5bfa33){logger[_0x5a73('0x14')](_0x5a73('0x1e'));return _0x5bfa33[_0x5a73('0x1f')];});}});}else{logger[_0x5a73('0x14')](_0x5a73('0x1d'));return request({'uri':util['format'](_0x5a73('0x20'),_0x29d680[_0x5a73('0xd')])})['then'](function(_0x5f2a7e){logger[_0x5a73('0x14')](_0x5a73('0x1e'));return _0x5f2a7e[_0x5a73('0x1f')];});}}function getEndUser(_0x2f0f98,_0x538914,_0x5ae8d7){logger[_0x5a73('0x14')](_0x5a73('0x21'),_0x5ae8d7);return request({'uri':util[_0x5a73('0xb')](_0x5a73('0x17'),_0x2f0f98[_0x5a73('0xd')]),'qs':{'query':util['format'](_0x5a73('0x22'),_0x5ae8d7)}})[_0x5a73('0x13')](function(_0x29c509){var _0x5be942;if(_0x29c509['results'][_0x5a73('0x23')]){_0x29c509[_0x5a73('0x24')]=_[_0x5a73('0x25')](_0x29c509[_0x5a73('0x24')],{'suspended':![],'role':_0x5a73('0x26')});if(_0x29c509[_0x5a73('0x24')][_0x5a73('0x23')]){_0x5be942=_[_0x5a73('0x27')](_0x29c509[_0x5a73('0x24')]);}}if(_0x5be942){logger[_0x5a73('0x14')](_0x5a73('0x28'));return _0x5be942;}else{logger[_0x5a73('0x14')](_0x5a73('0x29'));return request({'uri':util[_0x5a73('0xb')](_0x5a73('0x2a'),_0x2f0f98[_0x5a73('0xd')]),'method':_0x5a73('0xe'),'body':{'user':{'role':_0x5a73('0x26'),'name':util[_0x5a73('0xb')](_0x5a73('0x2b'),_0x538914||_0x5ae8d7),'phone':_0x5ae8d7}}})['then'](function(_0x3405ee){logger[_0x5a73('0x14')](_0x5a73('0x2c'));return _0x3405ee[_0x5a73('0x1f')];});}});}function getAuth(_0xbb2985){var _0x57aaa5;if(_0xbb2985[_0x5a73('0x2d')]===_0x5a73('0x2e')){_0x57aaa5=util['format']('%s:%s',_0xbb2985['username'],_0xbb2985[_0x5a73('0x2e')]);}else if(_0xbb2985[_0x5a73('0x2d')]===_0x5a73('0x2f')){_0x57aaa5=util['format'](_0x5a73('0x30'),_0xbb2985['username'],_0xbb2985[_0x5a73('0x2f')]);}return util[_0x5a73('0xb')](_0x5a73('0x31'),new Buffer(_0x57aaa5)[_0x5a73('0x32')](_0x5a73('0x33')));}function request(_0x6e96af){logger[_0x5a73('0x34')](_0x5a73('0x35'),JSON[_0x5a73('0x36')](_0x6e96af));return rp(_[_0x5a73('0x37')](_0x6e96af,{'method':_0x5a73('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x23ded6,_0x1dc567){var _0x4d5b3b=[];if(_0x23ded6&&_0x23ded6[_0x5a73('0x23')]>0x0){_0x4d5b3b=_[_0x5a73('0x39')](_0x23ded6,_0x1dc567);}return _0x4d5b3b;}function getCustomFields(_0x942b4,_0x2b82dc){var _0x12da34=[];var _0x39ac47={'custom_fields':[]};if(_0x942b4[_0x5a73('0x23')]>0x0){_['forEach'](_0x942b4,function(_0x53425f){if(_[_0x5a73('0x3a')]([_0x5a73('0x3b'),_0x5a73('0x3c')],_0x53425f['type'])&&_0x53425f[_0x5a73('0x3d')]&&!_0x53425f[_0x5a73('0x3e')]){_0x39ac47[_0x53425f['nameField'][_0x5a73('0x3f')]()]=_0x53425f['content']['toString']();}else if(_[_0x5a73('0x3a')](['string',_0x5a73('0x3c')],_0x53425f[_0x5a73('0x40')])&&_0x53425f[_0x5a73('0x41')]&&_0x53425f['customField']){_0x39ac47['custom_fields'][_0x5a73('0x42')]({'id':_0x53425f[_0x5a73('0x41')],'value':_0x53425f[_0x5a73('0x43')]['toString']()});}else if(_0x53425f[_0x5a73('0x40')]==='variable'&&_0x53425f[_0x5a73('0x44')]&&_0x53425f[_0x5a73('0x41')]&&_0x53425f[_0x5a73('0x3e')]){_0x2b82dc[_0x53425f['variableName']]&&_0x39ac47['custom_fields'][_0x5a73('0x42')]({'id':_0x53425f[_0x5a73('0x41')],'value':_0x2b82dc[_0x53425f['variableName']][_0x5a73('0x32')]()});}else if(_0x53425f['type']===_0x5a73('0x45')&&_0x53425f['Variable']&&_0x53425f[_0x5a73('0x46')][_0x5a73('0xf')]&&_0x53425f[_0x5a73('0x41')]&&_0x53425f[_0x5a73('0x3e')]){_0x2b82dc[_0x53425f[_0x5a73('0x46')][_0x5a73('0xf')][_0x5a73('0x3f')]()]&&_0x39ac47[_0x5a73('0x47')][_0x5a73('0x42')]({'id':_0x53425f['idField'],'value':_0x2b82dc[_0x53425f['Variable'][_0x5a73('0xf')][_0x5a73('0x3f')]()]['toString']()});}});}return _0x39ac47;}exports[_0x5a73('0x48')]=function(_0x5b524d,_0x3420ab,_0x27e316,_0x2f47a3,_0x41efe6,_0x3c33ca){var _0x5b455e,_0x21206d;_0x3c33ca[_0x5a73('0xd')]=intUtil[_0x5a73('0x49')](_0x3c33ca[_0x5a73('0xd')]);_0x3c33ca[_0x5a73('0x4a')]=intUtil[_0x5a73('0x49')](_0x3c33ca[_0x5a73('0x4a')]);if(_0x41efe6&&_0x41efe6[_0x5a73('0x4b')]){logger[_0x5a73('0x14')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3420ab['recordingURL']=util[_0x5a73('0xb')](_0x5a73('0x4c'),_0x3c33ca[_0x5a73('0x4a')],_0x3420ab[_0x5a73('0x4d')],md5(_0x3420ab[_0x5a73('0x4d')]));}else{_0x3420ab[_0x5a73('0x4e')]='';}headers[_0x5a73('0x4f')]=getAuth(_0x3c33ca);return getUser(_0x3c33ca,_0x2f47a3[_0x5a73('0x50')])[_0x5a73('0x13')](function(_0x376f0c){_0x5b455e=_0x376f0c;logger[_0x5a73('0x14')]('The\x20User\x20ID\x20is:',_0x5b455e['id']);return getEndUser(_0x3c33ca,_0x3420ab[_0x5a73('0x51')],_0x3420ab[_0x5a73('0x52')]);})[_0x5a73('0x13')](function(_0x4ff491){_0x21206d=_0x4ff491;logger[_0x5a73('0x14')](_0x5a73('0x53'),_0x21206d['id']);return getTicket(_0x3c33ca,_0x5b455e,_0x21206d,_0x27e316,_0x3420ab);})[_0x5a73('0x13')](function(_0x75cd33){if(_0x75cd33){logger['info'](_0x5a73('0x54'),_0x75cd33['id']);switch(_0x3c33ca[_0x5a73('0x40')]){case _0x5a73('0x55'):logger[_0x5a73('0x14')]('[QUEUE]',_0x5a73('0x56'));return request({'uri':util[_0x5a73('0xb')](_0x5a73('0x57'),_0x3c33ca[_0x5a73('0xd')],_0x5b455e['id'],_0x75cd33['id']),'method':_0x5a73('0xe')});case _0x5a73('0x58'):logger[_0x5a73('0x14')](_0x5a73('0x59'),_0x5a73('0x5a'));emit(util['format'](_0x5a73('0x5b'),_0x2f47a3[_0x5a73('0xf')]),_0x5a73('0x5c'),{'uri':util[_0x5a73('0xb')]('%s/agent/tickets/%s',_0x3c33ca[_0x5a73('0xd')][_0x5a73('0x5d')](_0x5a73('0x5e'),''),_0x75cd33['id'])});break;default:logger[_0x5a73('0x5f')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5a73('0x60')](function(_0x3a906b){logger[_0x5a73('0x5f')](_0x5a73('0x61'),util['inspect'](_0x3a906b,{'showHidden':!![],'depth':null}));});};exports[_0x5a73('0x62')]=function(_0x2a4894,_0x5abe24,_0x3bd55b,_0x1a6cab,_0x52fef5,_0x24c985,_0x49aa26){var _0x47d5df,_0x18fcb6;_0x24c985[_0x5a73('0xd')]=intUtil[_0x5a73('0x49')](_0x24c985[_0x5a73('0xd')]);_0x24c985[_0x5a73('0x4a')]=intUtil[_0x5a73('0x49')](_0x24c985[_0x5a73('0x4a')]);if(_0x49aa26&&_0x49aa26[_0x5a73('0x63')]&&_0x49aa26[_0x5a73('0x63')]!==_0x5a73('0x64')){logger[_0x5a73('0x14')]('[OUTBOUND]',_0x5a73('0x65'));_0x5abe24['recordingURL']=util['format'](_0x5a73('0x4c'),_0x24c985[_0x5a73('0x4a')],_0x5abe24[_0x5a73('0x4d')],md5(_0x5abe24['uniqueid']));}headers[_0x5a73('0x4f')]=getAuth(_0x24c985);return getUser(_0x24c985,_0x1a6cab[_0x5a73('0x50')])['then'](function(_0x549154){_0x47d5df=_0x549154;logger[_0x5a73('0x14')](_0x5a73('0x66'),_0x47d5df['id']);return getEndUser(_0x24c985,_0x5abe24[_0x5a73('0x67')],_0x5abe24[_0x5a73('0x68')]);})[_0x5a73('0x13')](function(_0x50dd9a){_0x18fcb6=_0x50dd9a;logger[_0x5a73('0x14')](_0x5a73('0x53'),_0x18fcb6['id']);return getTicket(_0x24c985,_0x47d5df,_0x18fcb6,_0x3bd55b,_0x5abe24);})['then'](function(_0x59b3a8){if(_0x59b3a8){logger['info']('The\x20Ticket\x20ID\x20is:',_0x59b3a8['id']);switch(_0x24c985[_0x5a73('0x40')]){case _0x5a73('0x55'):logger['info'](_0x5a73('0x69'),_0x5a73('0x56'));return request({'uri':util[_0x5a73('0xb')](_0x5a73('0x57'),_0x24c985['remoteUri'],_0x47d5df['id'],_0x59b3a8['id']),'method':_0x5a73('0xe')});case _0x5a73('0x58'):logger[_0x5a73('0x14')]('[OUTBOUND]',_0x5a73('0x5a'));emit(util[_0x5a73('0xb')](_0x5a73('0x5b'),_0x1a6cab['name']),_0x5a73('0x5c'),{'uri':util['format'](_0x5a73('0x6a'),_0x24c985[_0x5a73('0xd')][_0x5a73('0x5d')](_0x5a73('0x5e'),''),_0x59b3a8['id'])});break;default:logger[_0x5a73('0x5f')](_0x5a73('0x69'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5a73('0x60')](function(_0x227364){logger[_0x5a73('0x5f')](_0x5a73('0x6b'),util[_0x5a73('0x6c')](_0x227364,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x48cdd8,_0x5aa8dc,_0x277866,_0x59c60a,_0x383c02,_0x270830){var _0x3cc463,_0x331c70;_0x270830[_0x5a73('0xd')]=intUtil[_0x5a73('0x49')](_0x270830[_0x5a73('0xd')]);_0x270830[_0x5a73('0x4a')]=intUtil[_0x5a73('0x49')](_0x270830['serverUrl']);if(_0x383c02&&_0x383c02[_0x5a73('0x4b')]){logger['info']('['+_0x5aa8dc[_0x5a73('0x6d')][_0x5a73('0x6e')]()+']',_0x5a73('0x65'));_0x5aa8dc['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x270830[_0x5a73('0x4a')],_0x5aa8dc['uniqueid'],md5(_0x5aa8dc[_0x5a73('0x4d')]));}else{_0x5aa8dc['recordingURL']='';}headers[_0x5a73('0x4f')]=getAuth(_0x270830);return getUser(_0x270830)[_0x5a73('0x13')](function(_0x435865){_0x3cc463=_0x435865;logger[_0x5a73('0x14')](_0x5a73('0x66'),_0x3cc463['id']);return getEndUser(_0x270830,_0x5aa8dc[_0x5a73('0x51')],_0x5aa8dc[_0x5a73('0x52')]);})['then'](function(_0x1650e6){_0x331c70=_0x1650e6;logger[_0x5a73('0x14')]('The\x20Enduser\x20ID\x20is:',_0x331c70['id']);return getTicket(_0x270830,_0x3cc463,_0x331c70,_0x277866,_0x5aa8dc);})['then'](function(_0x4fdea4){if(_0x4fdea4){logger[_0x5a73('0x14')](_0x5a73('0x54'),_0x4fdea4['id']);}})[_0x5a73('0x60')](function(_0x33e614){logger['error']('['+_0x5aa8dc[_0x5a73('0x6d')][_0x5a73('0x6e')]()+']'+_0x5a73('0x6f'),util[_0x5a73('0x6c')](_0x33e614,{'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 1193da7..c59dc1e 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 _0xd25f=['customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','catch','Failing\x20creating\x20the\x20access_token','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','role','last_name','code','SUCCESS','data','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','moduleCreate','lead','Creating\x20new\x20call...','Owner','first_name','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','outbound','agentcalledAt','merge','Fields','POST','Call\x20created!','err','stack','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','zoho.eu','Inbound','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','debug','stringify','length','includes','picklist','type','idField','toString','variableName'];(function(_0x493206,_0x6c3012){var _0x8d85d4=function(_0x1623db){while(--_0x1623db){_0x493206['push'](_0x493206['shift']());}};_0x8d85d4(++_0x6c3012);}(_0xd25f,0x84));var _0xfd25=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0xd25f[_0x20beae];return _0xf5725;};'use strict';var _=require(_0xfd25('0x0'));var rp=require(_0xfd25('0x1'));var md5=require('md5');var util=require(_0xfd25('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xfd25('0x3'));var BPromise=require('bluebird');var config=require(_0xfd25('0x4'));var logger=require(_0xfd25('0x5'))(_0xfd25('0x6'));config[_0xfd25('0x7')]=_[_0xfd25('0x8')](config['redis'],{'host':_0xfd25('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd25('0x7')]));function emit(_0x377abd,_0x3ab055,_0x5bce9e){io['to'](_0x377abd)['emit'](_0x3ab055,_0x5bce9e);}function request(_0x2391ba){logger[_0xfd25('0xa')]('[HTTP]',JSON[_0xfd25('0xb')](_0x2391ba));return rp(_0x2391ba);}function getCustomFields(_0x27ef0b,_0x5b71d6){var _0x4885ac={};if(_0x27ef0b[_0xfd25('0xc')]>0x0){_['forEach'](_0x27ef0b,function(_0x452572){if(_[_0xfd25('0xd')](['string',_0xfd25('0xe')],_0x452572[_0xfd25('0xf')])&&_0x452572[_0xfd25('0x10')]){_0x4885ac[_0x452572[_0xfd25('0x10')]]=_0x452572['content'][_0xfd25('0x11')]();}else if(_0x452572['type']==='variable'&&_0x452572[_0xfd25('0x12')]&&_0x452572[_0xfd25('0x10')]&&_0x5b71d6[_0x452572[_0xfd25('0x12')]]){_0x4885ac[_0x452572['idField']]=_0x5b71d6[_0x452572['variableName']][_0xfd25('0x11')]();}else if(_0x452572['type']===_0xfd25('0x13')&&_0x452572[_0xfd25('0x14')]&&_0x452572[_0xfd25('0x14')][_0xfd25('0x15')]&&_0x452572['idField']&&_0x5b71d6[_0x452572[_0xfd25('0x14')][_0xfd25('0x15')][_0xfd25('0x16')]()]){_0x4885ac[_0x452572[_0xfd25('0x10')]]=_0x5b71d6[_0x452572[_0xfd25('0x14')]['name']['toLowerCase']()][_0xfd25('0x11')]();}});}return _0x4885ac;}function getName(_0x468b9a){if(_0x468b9a[_0xfd25('0x17')]('\x20')>0x0){var _0x385e96=_0x468b9a[_0xfd25('0x18')](/ (.+)/);if(_0x385e96[0x1]){return _0x385e96;}}return[_0x468b9a,_0x468b9a];}var accountsTokens={};function getAccessToken(_0x1ef5e9){return new Promise(function(_0x304c53,_0x5d614d){if(!_[_0xfd25('0x19')](accountsTokens[_0x1ef5e9['id']])&&!_[_0xfd25('0x19')](accountsTokens[_0x1ef5e9['id']][_0xfd25('0x1a')])){if(moment()[_0xfd25('0x1b')](accountsTokens[_0x1ef5e9['id']][_0xfd25('0x1c')])){_0x304c53(accountsTokens[_0x1ef5e9['id']][_0xfd25('0x1a')]);}}var _0x5e883d;switch(_0x1ef5e9[_0xfd25('0x1d')]){case'US':_0x5e883d=_0xfd25('0x1e');break;case'AU':_0x5e883d=_0xfd25('0x1f');break;case'EU':_0x5e883d='https://accounts.zoho.eu';break;case'IN':_0x5e883d=_0xfd25('0x20');break;case'CN':_0x5e883d=_0xfd25('0x21');break;default:_0x5e883d=_0xfd25('0x22');break;}var _0x4d99d8={'method':'POST','uri':_0x5e883d+_0xfd25('0x23'),'qs':{'refresh_token':_0x1ef5e9[_0xfd25('0x24')],'client_id':_0x1ef5e9[_0xfd25('0x25')],'client_secret':_0x1ef5e9[_0xfd25('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4d99d8)[_0xfd25('0x27')](function(_0x381a5b){accountsTokens[_0x1ef5e9['id']]={'access_token':_0x381a5b[_0xfd25('0x1a')],'expires_in':moment()[_0xfd25('0x28')](_0x381a5b[_0xfd25('0x1c')],'seconds')};_0x304c53(_0x381a5b[_0xfd25('0x1a')]);})[_0xfd25('0x29')](function(_0x2f3cb4){logger['error'](_0xfd25('0x2a'),_0x2f3cb4['stack']);_0x5d614d(_0x2f3cb4);});});}function getUser(_0x423f0f,_0xfc293b,_0x2a56ba,_0x256a15){logger['info'](_0xfd25('0x2b'));return request({'method':_0xfd25('0x2c'),'uri':util[_0xfd25('0x2d')](_0xfd25('0x2e'),_0xfc293b),'qs':{'type':_0xfd25('0x2f')},'headers':{'Authorization':_0xfd25('0x30')+_0x423f0f},'json':!![]})['then'](function(_0x16dfc2){if(_0x16dfc2[_0xfd25('0x31')]){var _0x1e1d43=-0x1;if(_[_0xfd25('0x32')](_0x16dfc2[_0xfd25('0x31')])){if(!_['isNil'](_0x256a15)){_0x1e1d43=_[_0xfd25('0x33')](_0x16dfc2['users'],function(_0x3ab9ea){return _0x3ab9ea[_0xfd25('0x34')]===_0x256a15;});}if(_0x1e1d43>=0x0){logger[_0xfd25('0x35')]('Agent\x20found!');}else{logger['info'](_0xfd25('0x36'));_0x1e1d43=_[_0xfd25('0x33')](_0x16dfc2['users'],function(_0x16f7ef){return _0x16f7ef[_0xfd25('0x37')][_0xfd25('0x15')]===_0xfd25('0x38');});}return _0x16dfc2[_0xfd25('0x31')][_0x1e1d43];}else{if(_0x16dfc2['user'][_0xfd25('0x37')]['name']===_0xfd25('0x38')){logger['info'](_0xfd25('0x36'));user=_0x16dfc2['user'];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xfd25('0xb')](_0x16dfc2));throw new Error(_0xfd25('0x39')+JSON['stringify'](_0x16dfc2));}}}else{logger[_0xfd25('0x3a')](_0xfd25('0x3b'),JSON[_0xfd25('0xb')](_0x16dfc2));throw new Error(_0xfd25('0x39')+JSON['stringify'](_0x16dfc2));}})[_0xfd25('0x29')](function(_0x4f35ba){console[_0xfd25('0x3a')](_0x4f35ba);});}function getZohoUser(_0x5ba4b4,_0x42c898){return new BPromise(function(_0x484eda,_0x3d787e){request(_0x5ba4b4)[_0xfd25('0x27')](function(_0x4656bb){var _0x4670b7=null;if(_0x4656bb){_0x4670b7=_0x4656bb['data'][0x0];_0x4670b7[_0xfd25('0x3c')]=_0x42c898;}_0x484eda(_0x4670b7);})[_0xfd25('0x29')](function(_0x169815){_0x3d787e(_0x169815);});});}function createEndUser(_0x53cdd1,_0x2da920,_0x4ccc32,_0x2d9b28,_0x311776,_0x27c4d7){var _0x4ccc32=getName(_0x4ccc32);return request({'method':'POST','uri':_0xfd25('0x3d')+_0x2da920+_0xfd25('0x3e')+_['startCase'](_0x27c4d7['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4ccc32[0x1],'First_Name':_0x4ccc32[0x0],'Phone':_0x2d9b28,'Owner':{'name':!_[_0xfd25('0x19')](_0x311776[_0xfd25('0x3f')]['name'])?_0x311776[_0xfd25('0x3f')][_0xfd25('0x15')]:!_[_0xfd25('0x19')](_0x311776['first_name'])?_0x311776['first_name']+'\x20'+_0x311776['last_name']:_0x311776[_0xfd25('0x40')],'id':_0x311776['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x53cdd1},'json':!![]})['then'](function(_0x4f59a3){if(_0x4f59a3&&_0x4f59a3['data'][0x0][_0xfd25('0x41')]===_0xfd25('0x42')){var _0x494919=_0x4f59a3[_0xfd25('0x43')][0x0][_0xfd25('0x44')];_0x494919[_0xfd25('0x3c')]=_[_0xfd25('0x45')](_0x27c4d7['moduleCreate'])+'s';return _0x494919;}logger[_0xfd25('0x3a')](_0xfd25('0x3b'),JSON[_0xfd25('0xb')](data));throw new Error(_0xfd25('0x46')+JSON['stringify'](data));})[_0xfd25('0x29')](function(_0x3dacc5){console[_0xfd25('0x47')](_0xfd25('0x48'),_0x3dacc5);});}function getEndUser(_0x15d6d5,_0x40ed8b,_0xb9faf8,_0x37ad44,_0x10a6b2,_0x3b36b6,_0x4d6ea9){var _0x32bb23={'method':_0xfd25('0x2c'),'uri':'','headers':{'Authorization':_0xfd25('0x30')+_0x15d6d5},'json':!![]};switch(_0x4d6ea9[_0xfd25('0x49')]){case _0xfd25('0x4a'):_0x32bb23[_0xfd25('0x4b')]='https://www.zohoapis.'+_0x40ed8b+_0xfd25('0x4c')+_0x10a6b2+'))';return getZohoUser(_0x32bb23,_0xfd25('0x4d'))[_0xfd25('0x27')](function(_0x56f415){if(_0x56f415)return _0x56f415;_0x32bb23[_0xfd25('0x4b')]=_0xfd25('0x3d')+_0x40ed8b+_0xfd25('0x4e')+_0x10a6b2+'))';return getZohoUser(_0x32bb23,_0xfd25('0x4f'))[_0xfd25('0x27')](function(_0x2ecbb6){if(_0x2ecbb6)return _0x2ecbb6;if(_0x4d6ea9['moduleCreate']!=_0xfd25('0x50')){return createEndUser(_0x15d6d5,_0x40ed8b,_0x37ad44,_0x10a6b2,_0x3b36b6,_0x4d6ea9);}else{return{};}});});break;case _0xfd25('0x51'):_0x32bb23['uri']=_0xfd25('0x3d')+_0x40ed8b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x10a6b2+'))';return getZohoUser(_0x32bb23,_0xfd25('0x4d'))[_0xfd25('0x27')](function(_0x3e651e){if(_0x3e651e)return _0x3e651e;if(_0x4d6ea9[_0xfd25('0x52')]!=_0xfd25('0x50')){return createEndUser(_0x15d6d5,_0x40ed8b,_0x37ad44,_0x10a6b2,_0x3b36b6,_0x4d6ea9);}else{return{};}});break;case _0xfd25('0x53'):_0x32bb23[_0xfd25('0x4b')]=_0xfd25('0x3d')+_0x40ed8b+_0xfd25('0x4e')+_0x10a6b2+'))';return getZohoUser(_0x32bb23,'Leads')[_0xfd25('0x27')](function(_0x471ee1){if(_0x471ee1)return _0x471ee1;if(_0x4d6ea9[_0xfd25('0x52')]!=_0xfd25('0x50')){return createEndUser(_0x15d6d5,_0x40ed8b,_0x37ad44,_0x10a6b2,_0x3b36b6,_0x4d6ea9);}else{return{};}});break;}}function getCall(_0x5382fa,_0x5580cf,_0x5e2f88,_0x3a854e,_0x4a880e,_0x47808e,_0x38d100,_0x225e79){logger[_0xfd25('0x35')](_0xfd25('0x54'));var _0x1dae7c={};_0x1dae7c[_0xfd25('0x55')]={'name':!_[_0xfd25('0x19')](_0x3a854e[_0xfd25('0x3f')][_0xfd25('0x15')])&&!_['isNil'](_0x3a854e[_0xfd25('0x37')][_0xfd25('0x15')])&&_0x3a854e[_0xfd25('0x37')]['name']==='administrator'?_0x3a854e[_0xfd25('0x3f')][_0xfd25('0x15')]:!_['isNil'](_0x3a854e[_0xfd25('0x56')])?_0x3a854e[_0xfd25('0x56')]+'\x20'+_0x3a854e[_0xfd25('0x40')]:_0x3a854e[_0xfd25('0x40')],'id':_0x3a854e['id']};_0x1dae7c['Subject']=intUtil['getString'](_0x47808e[_0xfd25('0x57')],_0x38d100,'\x20');_0x1dae7c[_0xfd25('0x58')]=intUtil['getString'](_0x47808e[_0xfd25('0x59')],_0x38d100,'\x0a');if(_0x4a880e['enduserType']==='Contacts'){_0x1dae7c['Who_Id']={'name':!_[_0xfd25('0x19')](_0x4a880e[_0xfd25('0x5a')])?_0x4a880e['Full_Name']:!_['isNil'](_0x4a880e['First_Name'])?_0x4a880e[_0xfd25('0x5b')]+'\x20'+_0x4a880e[_0xfd25('0x5c')]:_0x4a880e['Last_Name'],'id':_0x4a880e['id']};}if(_0x4a880e[_0xfd25('0x3c')]===_0xfd25('0x4f')){_0x1dae7c['What_Id']={'name':!_[_0xfd25('0x19')](_0x4a880e[_0xfd25('0x5a')])?_0x4a880e[_0xfd25('0x5a')]:!_['isNil'](_0x4a880e[_0xfd25('0x5b')])?_0x4a880e[_0xfd25('0x5b')]+'\x20'+_0x4a880e[_0xfd25('0x5c')]:_0x4a880e['Last_Name'],'id':_0x4a880e['id']};_0x1dae7c[_0xfd25('0x5d')]=_[_0xfd25('0x45')](_0x4a880e['enduserType']);}if(_0x38d100[_0xfd25('0x5e')]){_0x1dae7c[_0xfd25('0x5f')]=moment[_0xfd25('0x60')](parseInt(_0x38d100[_0xfd25('0x5e')])*0x3e8)[_0xfd25('0x2d')](_0xfd25('0x61'));}else if(_0x38d100['answertime']&&_0x38d100['endtime']){_0x1dae7c['Call_Duration']=moment['utc'](moment(_0x38d100[_0xfd25('0x62')],_0xfd25('0x63'))[_0xfd25('0x64')](moment(_0x38d100[_0xfd25('0x65')],'YYYY-MM-DDTHH:mm:ss')))[_0xfd25('0x2d')](_0xfd25('0x61'));}switch(_0x38d100[_0xfd25('0x66')]){case _0xfd25('0x67'):_0x1dae7c[_0xfd25('0x68')]=_0xfd25('0x69');break;case _0xfd25('0x6a'):case'connect':_0x1dae7c[_0xfd25('0x68')]=_0xfd25('0x6b');break;case _0xfd25('0x6c'):_0x1dae7c[_0xfd25('0x68')]=_0xfd25('0x6d');break;case _0xfd25('0x6e'):_0x1dae7c[_0xfd25('0x68')]=_0xfd25('0x6f');break;case'timeout':_0x1dae7c[_0xfd25('0x68')]=_0xfd25('0x70');default:}_0x1dae7c['Call_Start_Time']=(_0x225e79===_0xfd25('0x71')?moment(_0x38d100['starttime'])['format'](_0xfd25('0x63')):moment(_0x38d100[_0xfd25('0x72')])[_0xfd25('0x2d')](_0xfd25('0x63')))||moment()[_0xfd25('0x2d')](_0xfd25('0x63'));_0x1dae7c['Call_Type']=_0x225e79||'Inbound';_0x1dae7c=_[_0xfd25('0x73')](_0x1dae7c,getCustomFields(_0x47808e[_0xfd25('0x74')],_0x38d100));return request({'method':_0xfd25('0x75'),'uri':_0xfd25('0x3d')+_0x5580cf+'/crm/v2/Calls','headers':{'Authorization':_0xfd25('0x30')+_0x5382fa},'body':{'data':[_0x1dae7c]},'json':!![]})[_0xfd25('0x27')](function(_0x29a50c){if(_0x29a50c&&_0x29a50c['data'][0x0][_0xfd25('0x41')]===_0xfd25('0x42')){logger['info'](_0xfd25('0x76'));return{'id':_0x29a50c['data'][0x0]['details']['id']};}})[_0xfd25('0x29')](function(_0x139ea5){logger['info'](_0xfd25('0x77'),_0x139ea5[_0xfd25('0x78')]);console[_0xfd25('0x47')](_0xfd25('0x77'),_0x139ea5);});}exports[_0xfd25('0x79')]=function(_0x23ef0a,_0x5c0bd5,_0x1f5497,_0x1d6da5,_0xda1e9b,_0x7e926b){var _0x3a7fa9,_0x4c3ef4,_0x5afbe8;_0x7e926b['host']=intUtil[_0xfd25('0x7a')](_0x7e926b[_0xfd25('0x7b')]);_0x7e926b[_0xfd25('0x7c')]=intUtil[_0xfd25('0x7a')](_0x7e926b['serverUrl']);if(_0xda1e9b&&_0xda1e9b['monitor_format']){logger[_0xfd25('0x35')](_0xfd25('0x7d'),_0xfd25('0x7e'));_0x5c0bd5['recordingURL']=_0x7e926b[_0xfd25('0x7c')]+_0xfd25('0x7f')+_0x5c0bd5[_0xfd25('0x80')]+_0xfd25('0x81')+md5(_0x5c0bd5[_0xfd25('0x80')]);}else{_0x5c0bd5[_0xfd25('0x82')]='';}var _0x1f4699=_0x7e926b[_0xfd25('0x7b')]==='zoho.eu'?'eu':_0xfd25('0x83');return getAccessToken(_0x7e926b)[_0xfd25('0x27')](function(_0x1df909){_0x5afbe8=_0x1df909;return getUser(_0x5afbe8,_0x1f4699,_0x7e926b,_0x1d6da5[_0xfd25('0x34')]);})[_0xfd25('0x27')](function(_0x14ff8a){_0x3a7fa9=_0x14ff8a;logger['info'](_0xfd25('0x84'),_0x3a7fa9['id']);return getEndUser(_0x5afbe8,_0x1f4699,_0x7e926b,_0x5c0bd5[_0xfd25('0x85')],_0x5c0bd5[_0xfd25('0x86')],_0x3a7fa9,_0x1f5497);})['then'](function(_0x39b517){_0x4c3ef4=_0x39b517;return getCall(_0x5afbe8,_0x1f4699,_0x7e926b,_0x3a7fa9,_0x4c3ef4,_0x1f5497,_0x5c0bd5,'Inbound');})['then'](function(_0x58d400){if(_0x58d400){logger['info'](_0xfd25('0x87'),_0x58d400['id']);logger[_0xfd25('0x35')]('[QUEUE]',_0xfd25('0x88'));emit(util['format'](_0xfd25('0x89'),_0x1d6da5[_0xfd25('0x15')]),_0xfd25('0x8a'),{'uri':_0xfd25('0x8b')+_0x7e926b['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x58d400['id']});}})[_0xfd25('0x29')](function(_0x136e67){logger[_0xfd25('0x3a')]('[QUEUE]',JSON[_0xfd25('0xb')](_0x136e67));});};exports['outbound']=function(_0x481c3b,_0x438e3b,_0xd888d8,_0x5add17,_0x48f3db,_0x134918,_0x15aa94){var _0xb030a9,_0x1c69e0,_0x5069ba;_0x134918['host']=intUtil[_0xfd25('0x7a')](_0x134918['host']);_0x134918['serverUrl']=intUtil[_0xfd25('0x7a')](_0x134918[_0xfd25('0x7c')]);if(_0x15aa94&&_0x15aa94[_0xfd25('0x8c')]&&_0x15aa94[_0xfd25('0x8c')]!==_0xfd25('0x8d')){logger[_0xfd25('0x35')](_0xfd25('0x8e'),_0xfd25('0x7e'));_0x438e3b[_0xfd25('0x82')]=_0x134918[_0xfd25('0x7c')]+'/api/voice/recordings/'+_0x438e3b[_0xfd25('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x438e3b[_0xfd25('0x80')]);}var _0x536c38=_0x134918[_0xfd25('0x7b')]==='zoho.eu'?'eu':_0xfd25('0x83');return getAccessToken(_0x134918)[_0xfd25('0x27')](function(_0x32196c){_0x5069ba=_0x32196c;return getUser(_0x5069ba,_0x536c38,_0x134918,_0x5add17['email']);})[_0xfd25('0x27')](function(_0x43322c){_0xb030a9=_0x43322c;logger[_0xfd25('0x35')]('The\x20User\x20ID\x20is:',_0xb030a9['id']);return getEndUser(_0x5069ba,_0x536c38,_0x134918,_0x438e3b[_0xfd25('0x8f')],_0x438e3b['destcalleridnum'],_0xb030a9,_0xd888d8);})[_0xfd25('0x27')](function(_0x236668){_0x1c69e0=_0x236668;return getCall(_0x5069ba,_0x536c38,_0x134918,_0xb030a9,_0x1c69e0,_0xd888d8,_0x438e3b,_0xfd25('0x90'));})[_0xfd25('0x27')](function(_0x8dbb64){if(_0x8dbb64){logger[_0xfd25('0x35')](_0xfd25('0x87'),_0x8dbb64['id']);logger[_0xfd25('0x35')]('[OUTBOUND]',_0xfd25('0x88'));emit(util['format'](_0xfd25('0x89'),_0x5add17[_0xfd25('0x15')]),_0xfd25('0x8a'),{'uri':_0xfd25('0x8b')+_0x134918[_0xfd25('0x7b')]+_0xfd25('0x91')+_0x8dbb64['id']});}})['catch'](function(_0x35c04f){logger[_0xfd25('0x3a')](_0xfd25('0x8e'),JSON['stringify'](_0x35c04f));});};exports[_0xfd25('0x92')]=function(_0x4f61e6,_0x11dbf2,_0x3acb47,_0x3f6e37,_0x1a47a8,_0x19effc){var _0x4fd79f,_0x4ea5a3,_0x41bba1;_0x19effc[_0xfd25('0x7b')]=intUtil[_0xfd25('0x7a')](_0x19effc[_0xfd25('0x7b')]);_0x19effc[_0xfd25('0x7c')]=intUtil['stripTrailingSlash'](_0x19effc[_0xfd25('0x7c')]);if(_0x1a47a8&&_0x1a47a8[_0xfd25('0x93')]){logger[_0xfd25('0x35')]('['+_0x11dbf2[_0xfd25('0x66')][_0xfd25('0x94')]()+']',_0xfd25('0x7e'));_0x11dbf2[_0xfd25('0x82')]=_0x19effc[_0xfd25('0x7c')]+_0xfd25('0x7f')+_0x11dbf2[_0xfd25('0x80')]+_0xfd25('0x81')+md5(_0x11dbf2[_0xfd25('0x80')]);}else{_0x11dbf2[_0xfd25('0x82')]='';}var _0x1e12b7=_0x19effc['host']===_0xfd25('0x95')?'eu':_0xfd25('0x83');return getAccessToken(_0x19effc)['then'](function(_0x4be072){_0x41bba1=_0x4be072;return getUser(_0x41bba1,_0x1e12b7,_0x19effc);})[_0xfd25('0x27')](function(_0x4f01ae){_0x4fd79f=_0x4f01ae;logger[_0xfd25('0x35')](_0xfd25('0x84'),_0x4fd79f['id']);return getEndUser(_0x41bba1,_0x1e12b7,_0x19effc,_0x11dbf2[_0xfd25('0x85')],_0x11dbf2['calleridnum'],_0x4fd79f,_0x3acb47);})['then'](function(_0x69ffe9){_0x4ea5a3=_0x69ffe9;return getCall(_0x41bba1,_0x1e12b7,_0x19effc,_0x4fd79f,_0x4ea5a3,_0x3acb47,_0x11dbf2,_0xfd25('0x96'));})[_0xfd25('0x27')](function(_0x38d18e){if(_0x38d18e){logger['info'](_0xfd25('0x87'),_0x38d18e['id']);}})[_0xfd25('0x29')](function(_0x22be5e){logger[_0xfd25('0x3a')]('['+_0x11dbf2[_0xfd25('0x66')]['toUpperCase']()+']',JSON['stringify'](_0x22be5e));});}; \ No newline at end of file +var _0x5a68=['then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','code','SUCCESS','details','enduserType','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','contact','Contacts','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Creating\x20new\x20call...','Owner','administrator','last_name','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','talktime','format','mm:ss','answertime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','recordingFormat','none','zoho.eu','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','Inbound','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','emit','debug','[HTTP]','stringify','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','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'];(function(_0x1eef4e,_0x5217d8){var _0x48414f=function(_0x2ab10a){while(--_0x2ab10a){_0x1eef4e['push'](_0x1eef4e['shift']());}};_0x48414f(++_0x5217d8);}(_0x5a68,0x1ae));var _0x85a6=function(_0x2cd87d,_0x58fd3e){_0x2cd87d=_0x2cd87d-0x0;var _0x49e2c1=_0x5a68[_0x2cd87d];return _0x49e2c1;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x85a6('0x0'));var util=require(_0x85a6('0x1'));var intUtil=require(_0x85a6('0x2'));var moment=require(_0x85a6('0x3'));var Redis=require(_0x85a6('0x4'));var BPromise=require(_0x85a6('0x5'));var config=require(_0x85a6('0x6'));var logger=require(_0x85a6('0x7'))(_0x85a6('0x8'));config['redis']=_[_0x85a6('0x9')](config[_0x85a6('0xa')],{'host':_0x85a6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x85a6('0xa')]));function emit(_0x3dfeb7,_0x49c5d,_0x37b09d){io['to'](_0x3dfeb7)[_0x85a6('0xc')](_0x49c5d,_0x37b09d);}function request(_0x1a3a2c){logger[_0x85a6('0xd')](_0x85a6('0xe'),JSON[_0x85a6('0xf')](_0x1a3a2c));return rp(_0x1a3a2c);}function getCustomFields(_0x5e4518,_0x77420c){var _0x4bae34={};if(_0x5e4518['length']>0x0){_['forEach'](_0x5e4518,function(_0x1aafe1){if(_['includes'](['string','picklist'],_0x1aafe1['type'])&&_0x1aafe1[_0x85a6('0x10')]){_0x4bae34[_0x1aafe1[_0x85a6('0x10')]]=_0x1aafe1[_0x85a6('0x11')]['toString']();}else if(_0x1aafe1[_0x85a6('0x12')]===_0x85a6('0x13')&&_0x1aafe1[_0x85a6('0x14')]&&_0x1aafe1[_0x85a6('0x10')]&&_0x77420c[_0x1aafe1[_0x85a6('0x14')]]){_0x4bae34[_0x1aafe1[_0x85a6('0x10')]]=_0x77420c[_0x1aafe1[_0x85a6('0x14')]][_0x85a6('0x15')]();}else if(_0x1aafe1[_0x85a6('0x12')]===_0x85a6('0x16')&&_0x1aafe1['Variable']&&_0x1aafe1[_0x85a6('0x17')][_0x85a6('0x18')]&&_0x1aafe1[_0x85a6('0x10')]&&_0x77420c[_0x1aafe1[_0x85a6('0x17')]['name'][_0x85a6('0x19')]()]){_0x4bae34[_0x1aafe1[_0x85a6('0x10')]]=_0x77420c[_0x1aafe1['Variable'][_0x85a6('0x18')][_0x85a6('0x19')]()][_0x85a6('0x15')]();}});}return _0x4bae34;}function getName(_0x52c4c2){if(_0x52c4c2[_0x85a6('0x1a')]('\x20')>0x0){var _0x461380=_0x52c4c2['split'](/ (.+)/);if(_0x461380[0x1]){return _0x461380;}}return[_0x52c4c2,_0x52c4c2];}var accountsTokens={};function getAccessToken(_0x21b7df){return new Promise(function(_0x1c6a6c,_0x4329e6){if(!_[_0x85a6('0x1b')](accountsTokens[_0x21b7df['id']])&&!_[_0x85a6('0x1b')](accountsTokens[_0x21b7df['id']][_0x85a6('0x1c')])){if(moment()[_0x85a6('0x1d')](accountsTokens[_0x21b7df['id']]['expires_in'])){_0x1c6a6c(accountsTokens[_0x21b7df['id']]['access_token']);}}var _0x1c1ebb;switch(_0x21b7df[_0x85a6('0x1e')]){case'US':_0x1c1ebb=_0x85a6('0x1f');break;case'AU':_0x1c1ebb=_0x85a6('0x20');break;case'EU':_0x1c1ebb=_0x85a6('0x21');break;case'IN':_0x1c1ebb=_0x85a6('0x22');break;case'CN':_0x1c1ebb=_0x85a6('0x23');break;default:_0x1c1ebb=_0x85a6('0x21');break;}var _0x296ec7={'method':_0x85a6('0x24'),'uri':_0x1c1ebb+_0x85a6('0x25'),'qs':{'refresh_token':_0x21b7df['refreshToken'],'client_id':_0x21b7df[_0x85a6('0x26')],'client_secret':_0x21b7df[_0x85a6('0x27')],'grant_type':_0x85a6('0x28')},'json':!![]};return rp(_0x296ec7)[_0x85a6('0x29')](function(_0x88b82d){accountsTokens[_0x21b7df['id']]={'access_token':_0x88b82d[_0x85a6('0x1c')],'expires_in':moment()[_0x85a6('0x2a')](_0x88b82d['expires_in'],_0x85a6('0x2b'))};_0x1c6a6c(_0x88b82d[_0x85a6('0x1c')]);})[_0x85a6('0x2c')](function(_0x343801){logger[_0x85a6('0x2d')](_0x85a6('0x2e'),_0x343801[_0x85a6('0x2f')]);_0x4329e6(_0x343801);});});}function getUser(_0x517630,_0x442ce8,_0x154311,_0x40b337){logger[_0x85a6('0x30')](_0x85a6('0x31'));return request({'method':_0x85a6('0x32'),'uri':util['format'](_0x85a6('0x33'),_0x442ce8),'qs':{'type':_0x85a6('0x34')},'headers':{'Authorization':_0x85a6('0x35')+_0x517630},'json':!![]})['then'](function(_0x9123e3){if(_0x9123e3['users']){var _0x5a055e=-0x1;if(_['isArrayLikeObject'](_0x9123e3[_0x85a6('0x36')])){if(!_[_0x85a6('0x1b')](_0x40b337)){_0x5a055e=_[_0x85a6('0x37')](_0x9123e3[_0x85a6('0x36')],function(_0x1d5511){return _0x1d5511[_0x85a6('0x38')]===_0x40b337;});}if(_0x5a055e>=0x0){logger[_0x85a6('0x30')]('Agent\x20found!');}else{logger[_0x85a6('0x30')](_0x85a6('0x39'));_0x5a055e=_[_0x85a6('0x37')](_0x9123e3[_0x85a6('0x36')],function(_0x210f35){return _0x210f35[_0x85a6('0x3a')][_0x85a6('0x18')]===_0x85a6('0x3b');});}return _0x9123e3[_0x85a6('0x36')][_0x5a055e];}else{if(_0x9123e3['user'][_0x85a6('0x3a')][_0x85a6('0x18')]==='Administrator'){logger[_0x85a6('0x30')]('Using\x20the\x20admin\x20account!');user=_0x9123e3[_0x85a6('0x3c')];return user;}else{logger[_0x85a6('0x2d')](_0x85a6('0x3d'),JSON[_0x85a6('0xf')](_0x9123e3));throw new Error(_0x85a6('0x3e')+JSON[_0x85a6('0xf')](_0x9123e3));}}}else{logger['error'](_0x85a6('0x3d'),JSON[_0x85a6('0xf')](_0x9123e3));throw new Error(_0x85a6('0x3e')+JSON[_0x85a6('0xf')](_0x9123e3));}})[_0x85a6('0x2c')](function(_0x47b811){console['error'](_0x47b811);});}function getZohoUser(_0x424eda,_0x1239f1){return new BPromise(function(_0x406ff3,_0x30222b){request(_0x424eda)[_0x85a6('0x29')](function(_0x5a840e){var _0x7aa0da=null;if(_0x5a840e){_0x7aa0da=_0x5a840e[_0x85a6('0x3f')][0x0];_0x7aa0da['enduserType']=_0x1239f1;}_0x406ff3(_0x7aa0da);})[_0x85a6('0x2c')](function(_0x1524af){_0x30222b(_0x1524af);});});}function createEndUser(_0x2b13d2,_0x4048f2,_0x2391ac,_0x44edd1,_0x4ff8cf,_0x15a3cd){var _0x2391ac=getName(_0x2391ac);return request({'method':_0x85a6('0x24'),'uri':_0x85a6('0x40')+_0x4048f2+_0x85a6('0x41')+_[_0x85a6('0x42')](_0x15a3cd[_0x85a6('0x43')])+'s','body':{'data':[{'Last_Name':_0x2391ac[0x1],'First_Name':_0x2391ac[0x0],'Phone':_0x44edd1,'Owner':{'name':!_['isNil'](_0x4ff8cf[_0x85a6('0x44')][_0x85a6('0x18')])?_0x4ff8cf['role'][_0x85a6('0x18')]:!_[_0x85a6('0x1b')](_0x4ff8cf[_0x85a6('0x45')])?_0x4ff8cf[_0x85a6('0x45')]+'\x20'+_0x4ff8cf['last_name']:_0x4ff8cf['last_name'],'id':_0x4ff8cf['id']}}]},'headers':{'Authorization':_0x85a6('0x35')+_0x2b13d2},'json':!![]})[_0x85a6('0x29')](function(_0x5095e3){if(_0x5095e3&&_0x5095e3[_0x85a6('0x3f')][0x0][_0x85a6('0x46')]===_0x85a6('0x47')){var _0x37e7c7=_0x5095e3[_0x85a6('0x3f')][0x0][_0x85a6('0x48')];_0x37e7c7[_0x85a6('0x49')]=_['startCase'](_0x15a3cd[_0x85a6('0x43')])+'s';return _0x37e7c7;}logger[_0x85a6('0x2d')]('The\x20failing\x20result\x20is',JSON[_0x85a6('0xf')](data));throw new Error(_0x85a6('0x4a')+JSON[_0x85a6('0xf')](data));})[_0x85a6('0x2c')](function(_0x50262e){console[_0x85a6('0x4b')]('CREATE\x20ERROR',_0x50262e);});}function getEndUser(_0x12ce6b,_0x24feaf,_0x1139b6,_0x39b33c,_0x162f5e,_0x40f2dd,_0x4836f8){var _0xcba217={'method':_0x85a6('0x32'),'uri':'','headers':{'Authorization':_0x85a6('0x35')+_0x12ce6b},'json':!![]};switch(_0x4836f8['moduleSearch']){case _0x85a6('0x4c'):_0xcba217[_0x85a6('0x4d')]=_0x85a6('0x40')+_0x24feaf+_0x85a6('0x4e')+_0x162f5e+'))';return getZohoUser(_0xcba217,'Contacts')[_0x85a6('0x29')](function(_0x291676){if(_0x291676)return _0x291676;_0xcba217[_0x85a6('0x4d')]='https://www.zohoapis.'+_0x24feaf+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x162f5e+'))';return getZohoUser(_0xcba217,'Leads')[_0x85a6('0x29')](function(_0x5cff93){if(_0x5cff93)return _0x5cff93;if(_0x4836f8['moduleCreate']!='nothing'){return createEndUser(_0x12ce6b,_0x24feaf,_0x39b33c,_0x162f5e,_0x40f2dd,_0x4836f8);}else{return{};}});});break;case _0x85a6('0x4f'):_0xcba217[_0x85a6('0x4d')]=_0x85a6('0x40')+_0x24feaf+_0x85a6('0x4e')+_0x162f5e+'))';return getZohoUser(_0xcba217,_0x85a6('0x50'))[_0x85a6('0x29')](function(_0x888066){if(_0x888066)return _0x888066;if(_0x4836f8[_0x85a6('0x43')]!='nothing'){return createEndUser(_0x12ce6b,_0x24feaf,_0x39b33c,_0x162f5e,_0x40f2dd,_0x4836f8);}else{return{};}});break;case _0x85a6('0x51'):_0xcba217[_0x85a6('0x4d')]='https://www.zohoapis.'+_0x24feaf+_0x85a6('0x52')+_0x162f5e+'))';return getZohoUser(_0xcba217,_0x85a6('0x53'))['then'](function(_0x4255b0){if(_0x4255b0)return _0x4255b0;if(_0x4836f8[_0x85a6('0x43')]!=_0x85a6('0x54')){return createEndUser(_0x12ce6b,_0x24feaf,_0x39b33c,_0x162f5e,_0x40f2dd,_0x4836f8);}else{return{};}});break;}}function getCall(_0x331efa,_0x36571f,_0x14318d,_0x1def93,_0x2280fe,_0x14d0e5,_0x7ea6f3,_0x2912a4){logger['info'](_0x85a6('0x55'));var _0xdcc63e={};_0xdcc63e[_0x85a6('0x56')]={'name':!_[_0x85a6('0x1b')](_0x1def93[_0x85a6('0x44')][_0x85a6('0x18')])&&!_[_0x85a6('0x1b')](_0x1def93[_0x85a6('0x3a')][_0x85a6('0x18')])&&_0x1def93[_0x85a6('0x3a')][_0x85a6('0x18')]===_0x85a6('0x57')?_0x1def93[_0x85a6('0x44')][_0x85a6('0x18')]:!_[_0x85a6('0x1b')](_0x1def93[_0x85a6('0x45')])?_0x1def93['first_name']+'\x20'+_0x1def93[_0x85a6('0x58')]:_0x1def93[_0x85a6('0x58')],'id':_0x1def93['id']};_0xdcc63e[_0x85a6('0x59')]=intUtil['getString'](_0x14d0e5[_0x85a6('0x5a')],_0x7ea6f3,'\x20');_0xdcc63e[_0x85a6('0x5b')]=intUtil[_0x85a6('0x5c')](_0x14d0e5[_0x85a6('0x5d')],_0x7ea6f3,'\x0a');if(_0x2280fe['enduserType']===_0x85a6('0x50')){_0xdcc63e[_0x85a6('0x5e')]={'name':!_[_0x85a6('0x1b')](_0x2280fe[_0x85a6('0x5f')])?_0x2280fe['Full_Name']:!_[_0x85a6('0x1b')](_0x2280fe['First_Name'])?_0x2280fe[_0x85a6('0x60')]+'\x20'+_0x2280fe['Last_Name']:_0x2280fe['Last_Name'],'id':_0x2280fe['id']};}if(_0x2280fe[_0x85a6('0x49')]===_0x85a6('0x53')){_0xdcc63e[_0x85a6('0x61')]={'name':!_[_0x85a6('0x1b')](_0x2280fe[_0x85a6('0x5f')])?_0x2280fe[_0x85a6('0x5f')]:!_[_0x85a6('0x1b')](_0x2280fe[_0x85a6('0x60')])?_0x2280fe[_0x85a6('0x60')]+'\x20'+_0x2280fe['Last_Name']:_0x2280fe[_0x85a6('0x62')],'id':_0x2280fe['id']};_0xdcc63e['$se_module']=_['startCase'](_0x2280fe[_0x85a6('0x49')]);}if(_0x7ea6f3[_0x85a6('0x63')]){_0xdcc63e['Call_Duration']=moment['utc'](parseInt(_0x7ea6f3[_0x85a6('0x63')])*0x3e8)[_0x85a6('0x64')](_0x85a6('0x65'));}else if(_0x7ea6f3[_0x85a6('0x66')]&&_0x7ea6f3['endtime']){_0xdcc63e[_0x85a6('0x67')]=moment[_0x85a6('0x68')](moment(_0x7ea6f3[_0x85a6('0x69')],_0x85a6('0x6a'))[_0x85a6('0x6b')](moment(_0x7ea6f3[_0x85a6('0x6c')],_0x85a6('0x6a'))))[_0x85a6('0x64')](_0x85a6('0x65'));}switch(_0x7ea6f3['lastevent']){case _0x85a6('0x6d'):_0xdcc63e[_0x85a6('0x6e')]=_0x85a6('0x6f');break;case _0x85a6('0x70'):case _0x85a6('0x71'):_0xdcc63e[_0x85a6('0x6e')]=_0x85a6('0x72');break;case _0x85a6('0x73'):_0xdcc63e[_0x85a6('0x6e')]=_0x85a6('0x74');break;case _0x85a6('0x75'):_0xdcc63e[_0x85a6('0x6e')]=_0x85a6('0x76');break;case _0x85a6('0x77'):_0xdcc63e[_0x85a6('0x6e')]=_0x85a6('0x78');default:}_0xdcc63e['Call_Start_Time']=(_0x2912a4===_0x85a6('0x79')?moment(_0x7ea6f3[_0x85a6('0x6c')])[_0x85a6('0x64')](_0x85a6('0x6a')):moment(_0x7ea6f3[_0x85a6('0x7a')])[_0x85a6('0x64')](_0x85a6('0x6a')))||moment()[_0x85a6('0x64')](_0x85a6('0x6a'));_0xdcc63e['Call_Type']=_0x2912a4||'Inbound';_0xdcc63e=_[_0x85a6('0x7b')](_0xdcc63e,getCustomFields(_0x14d0e5[_0x85a6('0x7c')],_0x7ea6f3));return request({'method':'POST','uri':_0x85a6('0x40')+_0x36571f+_0x85a6('0x7d'),'headers':{'Authorization':_0x85a6('0x35')+_0x331efa},'body':{'data':[_0xdcc63e]},'json':!![]})[_0x85a6('0x29')](function(_0xd5a410){if(_0xd5a410&&_0xd5a410[_0x85a6('0x3f')][0x0]['code']===_0x85a6('0x47')){logger[_0x85a6('0x30')](_0x85a6('0x7e'));return{'id':_0xd5a410[_0x85a6('0x3f')][0x0][_0x85a6('0x48')]['id']};}})[_0x85a6('0x2c')](function(_0x55fe15){logger[_0x85a6('0x30')]('err',_0x55fe15[_0x85a6('0x2f')]);console[_0x85a6('0x4b')](_0x85a6('0x7f'),_0x55fe15);});}exports['queue']=function(_0x164dd0,_0x3536cd,_0x3d7a8d,_0xfac0d5,_0x441e03,_0x35d792){var _0x42bc36,_0xf0342e,_0x13129d;_0x35d792[_0x85a6('0x80')]=intUtil[_0x85a6('0x81')](_0x35d792['host']);_0x35d792[_0x85a6('0x82')]=intUtil[_0x85a6('0x81')](_0x35d792[_0x85a6('0x82')]);if(_0x441e03&&_0x441e03[_0x85a6('0x83')]){logger[_0x85a6('0x30')](_0x85a6('0x84'),_0x85a6('0x85'));_0x3536cd[_0x85a6('0x86')]=_0x35d792[_0x85a6('0x82')]+_0x85a6('0x87')+_0x3536cd[_0x85a6('0x88')]+_0x85a6('0x89')+md5(_0x3536cd[_0x85a6('0x88')]);}else{_0x3536cd[_0x85a6('0x86')]='';}var _0x5917a9=_0x35d792['host']==='zoho.eu'?'eu':_0x85a6('0x8a');return getAccessToken(_0x35d792)[_0x85a6('0x29')](function(_0x5c690b){_0x13129d=_0x5c690b;return getUser(_0x13129d,_0x5917a9,_0x35d792,_0xfac0d5[_0x85a6('0x38')]);})[_0x85a6('0x29')](function(_0x332abe){_0x42bc36=_0x332abe;logger[_0x85a6('0x30')](_0x85a6('0x8b'),_0x42bc36['id']);return getEndUser(_0x13129d,_0x5917a9,_0x35d792,_0x3536cd[_0x85a6('0x8c')],_0x3536cd[_0x85a6('0x8d')],_0x42bc36,_0x3d7a8d);})[_0x85a6('0x29')](function(_0x8175a5){_0xf0342e=_0x8175a5;return getCall(_0x13129d,_0x5917a9,_0x35d792,_0x42bc36,_0xf0342e,_0x3d7a8d,_0x3536cd,'Inbound');})['then'](function(_0x400d35){if(_0x400d35){logger[_0x85a6('0x30')](_0x85a6('0x8e'),_0x400d35['id']);logger[_0x85a6('0x30')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x85a6('0x64')]('user:%s',_0xfac0d5['name']),_0x85a6('0x8f'),{'uri':'https://crm.'+_0x35d792[_0x85a6('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x400d35['id']});}})['catch'](function(_0x169cf8){logger[_0x85a6('0x2d')](_0x85a6('0x84'),JSON[_0x85a6('0xf')](_0x169cf8));});};exports[_0x85a6('0x79')]=function(_0x21c02c,_0x8e8c89,_0x46522c,_0xe0b56e,_0x5a0ea1,_0x52ac5e,_0x5a9878){var _0x2363b1,_0x905875,_0x1bc51e;_0x52ac5e['host']=intUtil[_0x85a6('0x81')](_0x52ac5e[_0x85a6('0x80')]);_0x52ac5e['serverUrl']=intUtil[_0x85a6('0x81')](_0x52ac5e[_0x85a6('0x82')]);if(_0x5a9878&&_0x5a9878[_0x85a6('0x90')]&&_0x5a9878[_0x85a6('0x90')]!==_0x85a6('0x91')){logger[_0x85a6('0x30')]('[OUTBOUND]',_0x85a6('0x85'));_0x8e8c89['recordingURL']=_0x52ac5e[_0x85a6('0x82')]+_0x85a6('0x87')+_0x8e8c89[_0x85a6('0x88')]+_0x85a6('0x89')+md5(_0x8e8c89[_0x85a6('0x88')]);}var _0x3bcb71=_0x52ac5e[_0x85a6('0x80')]===_0x85a6('0x92')?'eu':_0x85a6('0x8a');return getAccessToken(_0x52ac5e)[_0x85a6('0x29')](function(_0x1907ad){_0x1bc51e=_0x1907ad;return getUser(_0x1bc51e,_0x3bcb71,_0x52ac5e,_0xe0b56e[_0x85a6('0x38')]);})[_0x85a6('0x29')](function(_0x1fb196){_0x2363b1=_0x1fb196;logger[_0x85a6('0x30')]('The\x20User\x20ID\x20is:',_0x2363b1['id']);return getEndUser(_0x1bc51e,_0x3bcb71,_0x52ac5e,_0x8e8c89[_0x85a6('0x93')],_0x8e8c89[_0x85a6('0x94')],_0x2363b1,_0x46522c);})[_0x85a6('0x29')](function(_0x3781e9){_0x905875=_0x3781e9;return getCall(_0x1bc51e,_0x3bcb71,_0x52ac5e,_0x2363b1,_0x905875,_0x46522c,_0x8e8c89,_0x85a6('0x95'));})['then'](function(_0x47fea7){if(_0x47fea7){logger['info']('The\x20Call\x20ID\x20is:',_0x47fea7['id']);logger['info'](_0x85a6('0x96'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x85a6('0x64')]('user:%s',_0xe0b56e[_0x85a6('0x18')]),_0x85a6('0x8f'),{'uri':_0x85a6('0x97')+_0x52ac5e[_0x85a6('0x80')]+_0x85a6('0x98')+_0x47fea7['id']});}})[_0x85a6('0x2c')](function(_0x1e816d){logger[_0x85a6('0x2d')](_0x85a6('0x96'),JSON[_0x85a6('0xf')](_0x1e816d));});};exports[_0x85a6('0x99')]=function(_0x212a23,_0x1ed3ea,_0x286ea4,_0x102945,_0x27e572,_0x57f202){var _0x1050fc,_0x75d4e2,_0x2f0e19;_0x57f202[_0x85a6('0x80')]=intUtil['stripTrailingSlash'](_0x57f202[_0x85a6('0x80')]);_0x57f202['serverUrl']=intUtil['stripTrailingSlash'](_0x57f202['serverUrl']);if(_0x27e572&&_0x27e572['monitor_format']){logger[_0x85a6('0x30')]('['+_0x1ed3ea[_0x85a6('0x9a')][_0x85a6('0x9b')]()+']','Recording\x20is\x20enabled!');_0x1ed3ea[_0x85a6('0x86')]=_0x57f202[_0x85a6('0x82')]+'/api/voice/recordings/'+_0x1ed3ea['uniqueid']+_0x85a6('0x89')+md5(_0x1ed3ea[_0x85a6('0x88')]);}else{_0x1ed3ea['recordingURL']='';}var _0x5311a8=_0x57f202[_0x85a6('0x80')]==='zoho.eu'?'eu':_0x85a6('0x8a');return getAccessToken(_0x57f202)[_0x85a6('0x29')](function(_0x27a8e8){_0x2f0e19=_0x27a8e8;return getUser(_0x2f0e19,_0x5311a8,_0x57f202);})['then'](function(_0xb9e068){_0x1050fc=_0xb9e068;logger[_0x85a6('0x30')](_0x85a6('0x8b'),_0x1050fc['id']);return getEndUser(_0x2f0e19,_0x5311a8,_0x57f202,_0x1ed3ea['calleridname'],_0x1ed3ea[_0x85a6('0x8d')],_0x1050fc,_0x286ea4);})[_0x85a6('0x29')](function(_0x1205c1){_0x75d4e2=_0x1205c1;return getCall(_0x2f0e19,_0x5311a8,_0x57f202,_0x1050fc,_0x75d4e2,_0x286ea4,_0x1ed3ea,_0x85a6('0x9c'));})['then'](function(_0x57cb4e){if(_0x57cb4e){logger[_0x85a6('0x30')]('The\x20Call\x20ID\x20is:',_0x57cb4e['id']);}})[_0x85a6('0x2c')](function(_0x5b9095){logger[_0x85a6('0x2d')]('['+_0x1ed3ea[_0x85a6('0x9a')][_0x85a6('0x9b')]()+']',JSON[_0x85a6('0xf')](_0x5b9095));});}; \ 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 eb2dee2..207b34f 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 _0x4540=['shelljs','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x215d67,_0x34852e){var _0x25b959=function(_0x166490){while(--_0x166490){_0x215d67['push'](_0x215d67['shift']());}};_0x25b959(++_0x34852e);}(_0x4540,0x1a3));var _0x0454=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4540[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x0454('0x0'));var sh=require(_0x0454('0x1'));var Mustache=require('mustache');var logger=require(_0x0454('0x2'))(_0x0454('0x3'));exports[_0x0454('0x4')]=function(_0x2d5e9f,_0x4f2922){var _0x1a21b6=_0x2d5e9f[_0x0454('0x5')]?_0x2d5e9f[_0x0454('0x5')]:_0x0454('0x6');var _0x2047bf=_0x2d5e9f[_0x0454('0x7')]?Mustache[_0x0454('0x8')](_0x2d5e9f[_0x0454('0x7')],_0x4f2922):_0x4f2922;sh[_0x0454('0x4')](_0x2047bf,function(_0x56502e,_0x5b2f2b,_0x541420){if(_0x56502e!==0x0){logger[_0x0454('0x9')](util['format'](_0x0454('0xa'),_0x1a21b6,_0x2047bf,_0x56502e,_0x541420));}else{logger['info'](util['format'](_0x0454('0xb'),_0x1a21b6,_0x2047bf,_0x5b2f2b));}});}; \ No newline at end of file +var _0x2f07=['render','exec','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','trigger','data2','Script','data3'];(function(_0x3d3590,_0x23bd12){var _0x1348ff=function(_0x26a61a){while(--_0x26a61a){_0x3d3590['push'](_0x3d3590['shift']());}};_0x1348ff(++_0x23bd12);}(_0x2f07,0x1c2));var _0x72f0=function(_0x4957f2,_0x57de39){_0x4957f2=_0x4957f2-0x0;var _0x1448f9=_0x2f07[_0x4957f2];return _0x1448f9;};'use strict';var util=require(_0x72f0('0x0'));var sh=require(_0x72f0('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x72f0('0x2'));exports['exec']=function(_0x49dd6f,_0x3e9bf6){var _0x4f0baf=_0x49dd6f[_0x72f0('0x3')]?_0x49dd6f[_0x72f0('0x3')]:_0x72f0('0x4');var _0x25ba39=_0x49dd6f[_0x72f0('0x5')]?Mustache[_0x72f0('0x6')](_0x49dd6f['data3'],_0x3e9bf6):_0x3e9bf6;sh[_0x72f0('0x7')](_0x25ba39,function(_0x47677d,_0x1cd4f1,_0x48abc4){if(_0x47677d!==0x0){logger['error'](util[_0x72f0('0x8')](_0x72f0('0x9'),_0x4f0baf,_0x25ba39,_0x47677d,_0x48abc4));}else{logger[_0x72f0('0xa')](util['format'](_0x72f0('0xb'),_0x4f0baf,_0x25ba39,_0x1cd4f1));}});}; \ 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 ae0a284..2ec9f2e 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 _0xc5bd=['body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data1','stringify','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','render','data2','data5','number','headers','data6','parse','stack','GET','DELETE','PUT','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x3e8c8f,_0x8b646d){var _0x29dc91=function(_0x16b8cc){while(--_0x16b8cc){_0x3e8c8f['push'](_0x3e8c8f['shift']());}};_0x29dc91(++_0x8b646d);}(_0xc5bd,0xf4));var _0xdc5b=function(_0x64b850,_0x2fe125){_0x64b850=_0x64b850-0x0;var _0x2f2eb6=_0xc5bd[_0x64b850];return _0x2f2eb6;};'use strict';var rp=require(_0xdc5b('0x0'));var util=require(_0xdc5b('0x1'));var _=require(_0xdc5b('0x2'));var Mustache=require(_0xdc5b('0x3'));var logger=require(_0xdc5b('0x4'))(_0xdc5b('0x5'));exports['exec']=function(_0x3b4efb,_0x14b0ad){var _0x44569e,_0x4f2e86;var _0x1559b8={'method':_0x3b4efb['data1']['toUpperCase'](),'uri':Mustache[_0xdc5b('0x6')](_0x3b4efb[_0xdc5b('0x7')],_0x14b0ad),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3b4efb[_0xdc5b('0x8')])===_0xdc5b('0x9')&&parseInt(_0x3b4efb[_0xdc5b('0x8')])>=0x1&&parseInt(_0x3b4efb['data5'])<=0xa?parseInt(_0x3b4efb['data5'])*0x3e8:0x5*0x3e8};try{_0x1559b8[_0xdc5b('0xa')]=_0x3b4efb[_0xdc5b('0xb')]?JSON[_0xdc5b('0xc')](Mustache[_0xdc5b('0x6')](_0x3b4efb[_0xdc5b('0xb')],_0x14b0ad)):{};}catch(_0x17fdd5){logger['error'](_0x17fdd5[_0xdc5b('0xd')]);}switch(_0x3b4efb['data1']['toUpperCase']()){case _0xdc5b('0xe'):case _0xdc5b('0xf'):_0x44569e=null;_0x1559b8['qs']=_0x14b0ad;break;case'POST':case _0xdc5b('0x10'):if(_0x3b4efb[_0xdc5b('0x11')]){try{_0x44569e=JSON['parse'](Mustache['render'](_0x3b4efb[_0xdc5b('0x11')],_0x14b0ad));_0x1559b8['body']=_0x44569e;}catch(_0x18f053){logger[_0xdc5b('0x12')](_0x18f053[_0xdc5b('0xd')]);logger[_0xdc5b('0x12')](_0xdc5b('0x13'));}}else{_0x44569e=_0x14b0ad;_0x1559b8[_0xdc5b('0x14')]=_0x44569e;}break;}logger['info'](util[_0xdc5b('0x15')](_0xdc5b('0x16'),_0x3b4efb[_0xdc5b('0x17')],_0x3b4efb[_0xdc5b('0x7')],JSON[_0xdc5b('0x18')](_0x1559b8)));rp(_0x1559b8)['then'](function(_0x591417){_0x44569e=!_['isNil'](_0x44569e)?',\x20request\x20body:\x20'+_0x44569e:'';_0x4f2e86=typeof _0x591417[_0xdc5b('0x14')]===_0xdc5b('0x19')?JSON['stringify'](_0x591417[_0xdc5b('0x14')]):_0x591417[_0xdc5b('0x14')];logger[_0xdc5b('0x1a')](util[_0xdc5b('0x15')](_0xdc5b('0x1b'),_0x3b4efb[_0xdc5b('0x17')],_0x3b4efb['data2'],_0x591417[_0xdc5b('0x1c')],_0x4f2e86));})[_0xdc5b('0x1d')](function(_0x3c4b42){logger[_0xdc5b('0x12')](util[_0xdc5b('0x15')](_0xdc5b('0x1e'),_0x3b4efb[_0xdc5b('0x17')],_0x3b4efb[_0xdc5b('0x7')],_0x3c4b42[_0xdc5b('0x1c')],_0x3c4b42[_0xdc5b('0x1f')],_0x3c4b42[_0xdc5b('0x20')]));});}; \ No newline at end of file +var _0xb3a1=['data2','data5','data6','stack','GET','POST','PUT','parse','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','stringify','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','render'];(function(_0x7f6e9,_0x2cf772){var _0x5a3124=function(_0x4d1156){while(--_0x4d1156){_0x7f6e9['push'](_0x7f6e9['shift']());}};_0x5a3124(++_0x2cf772);}(_0xb3a1,0x16b));var _0x1b3a=function(_0x2f37c7,_0x1e2370){_0x2f37c7=_0x2f37c7-0x0;var _0x5c0bbb=_0xb3a1[_0x2f37c7];return _0x5c0bbb;};'use strict';var rp=require(_0x1b3a('0x0'));var util=require(_0x1b3a('0x1'));var _=require(_0x1b3a('0x2'));var Mustache=require(_0x1b3a('0x3'));var logger=require(_0x1b3a('0x4'))('trigger');exports[_0x1b3a('0x5')]=function(_0x2b1527,_0x3af8a5){var _0x5b586c,_0x1ebf36;var _0x1d683c={'method':_0x2b1527[_0x1b3a('0x6')][_0x1b3a('0x7')](),'uri':Mustache[_0x1b3a('0x8')](_0x2b1527[_0x1b3a('0x9')],_0x3af8a5),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2b1527[_0x1b3a('0xa')])==='number'&&parseInt(_0x2b1527[_0x1b3a('0xa')])>=0x1&&parseInt(_0x2b1527[_0x1b3a('0xa')])<=0xa?parseInt(_0x2b1527[_0x1b3a('0xa')])*0x3e8:0x5*0x3e8};try{_0x1d683c['headers']=_0x2b1527[_0x1b3a('0xb')]?JSON['parse'](Mustache[_0x1b3a('0x8')](_0x2b1527[_0x1b3a('0xb')],_0x3af8a5)):{};}catch(_0x3929ad){logger['error'](_0x3929ad[_0x1b3a('0xc')]);}switch(_0x2b1527[_0x1b3a('0x6')]['toUpperCase']()){case _0x1b3a('0xd'):case'DELETE':_0x5b586c=null;_0x1d683c['qs']=_0x3af8a5;break;case _0x1b3a('0xe'):case _0x1b3a('0xf'):if(_0x2b1527['data7']){try{_0x5b586c=JSON[_0x1b3a('0x10')](Mustache['render'](_0x2b1527[_0x1b3a('0x11')],_0x3af8a5));_0x1d683c['body']=_0x5b586c;}catch(_0x7a6b21){logger[_0x1b3a('0x12')](_0x7a6b21['stack']);logger[_0x1b3a('0x12')](_0x1b3a('0x13'));}}else{_0x5b586c=_0x3af8a5;_0x1d683c[_0x1b3a('0x14')]=_0x5b586c;}break;}logger[_0x1b3a('0x15')](util[_0x1b3a('0x16')](_0x1b3a('0x17'),_0x2b1527[_0x1b3a('0x6')],_0x2b1527[_0x1b3a('0x9')],JSON['stringify'](_0x1d683c)));rp(_0x1d683c)[_0x1b3a('0x18')](function(_0x58f252){_0x5b586c=!_['isNil'](_0x5b586c)?_0x1b3a('0x19')+_0x5b586c:'';_0x1ebf36=typeof _0x58f252[_0x1b3a('0x14')]==='object'?JSON[_0x1b3a('0x1a')](_0x58f252[_0x1b3a('0x14')]):_0x58f252[_0x1b3a('0x14')];logger[_0x1b3a('0x15')](util[_0x1b3a('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2b1527[_0x1b3a('0x6')],_0x2b1527[_0x1b3a('0x9')],_0x58f252[_0x1b3a('0x1b')],_0x1ebf36));})['catch'](function(_0x11db57){logger['error'](util[_0x1b3a('0x16')](_0x1b3a('0x1c'),_0x2b1527['data1'],_0x2b1527[_0x1b3a('0x9')],_0x11db57[_0x1b3a('0x1b')],_0x11db57[_0x1b3a('0x1d')],_0x11db57[_0x1b3a('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 7d689f8..384c93c 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 _0xd897=['http','Request','then','debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x4f66cd,_0x2915ad){var _0x7975b8=function(_0x5066b2){while(--_0x5066b2){_0x4f66cd['push'](_0x4f66cd['shift']());}};_0x7975b8(++_0x2915ad);}(_0xd897,0x1dc));var _0x7d89=function(_0x51d207,_0x522875){_0x51d207=_0x51d207-0x0;var _0x11345a=_0xd897[_0x51d207];return _0x11345a;};'use strict';var jayson=require(_0x7d89('0x0'));var BPromise=require(_0x7d89('0x1'));var logger=require(_0x7d89('0x2'))(_0x7d89('0x3'));var client=jayson[_0x7d89('0x4')][_0x7d89('0x5')]({'port':0x2329});client[_0x7d89('0x6')]=function(_0x239fe7,_0xd7d08a){return new BPromise(function(_0xec7986,_0xac0fe1){return client['request'](_0x239fe7,_0xd7d08a)[_0x7d89('0x7')](function(_0x29c0e5){logger[_0x7d89('0x8')](_0x7d89('0x9'),_0x7d89('0x3'),_0x239fe7,_0xd7d08a,_0x29c0e5);if(_0x29c0e5[_0x7d89('0xa')]){logger['error'](_0x7d89('0x9'),_0x7d89('0x3'),_0x239fe7,_0x29c0e5[_0x7d89('0xa')][_0x7d89('0xb')],_0xd7d08a);return _0xac0fe1(_0x29c0e5[_0x7d89('0xa')]['message']);}else{return _0xec7986(_0x29c0e5['result']);}})[_0x7d89('0xc')](function(_0xf6289){logger[_0x7d89('0xa')]('rpc',_0x7d89('0x3'),_0x239fe7,_0xf6289,_0xd7d08a);return _0xac0fe1(_0xf6289);});});};module['exports']=client; \ No newline at end of file +var _0x15f0=['../../config/logger','client','http','Request','then','debug','rpc','routing','error','message','result','bluebird'];(function(_0x54cefb,_0x192225){var _0x5e4fbb=function(_0x5ac5dc){while(--_0x5ac5dc){_0x54cefb['push'](_0x54cefb['shift']());}};_0x5e4fbb(++_0x192225);}(_0x15f0,0xcb));var _0x015f=function(_0x5b1326,_0xfdabe5){_0x5b1326=_0x5b1326-0x0;var _0x4ce21d=_0x15f0[_0x5b1326];return _0x4ce21d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x015f('0x0'));var logger=require(_0x015f('0x1'))('routing');var client=jayson[_0x015f('0x2')][_0x015f('0x3')]({'port':0x2329});client[_0x015f('0x4')]=function(_0x4e7ce5,_0x5af21d){return new BPromise(function(_0x43e890,_0x1fe860){return client['request'](_0x4e7ce5,_0x5af21d)[_0x015f('0x5')](function(_0x2e9412){logger[_0x015f('0x6')](_0x015f('0x7'),_0x015f('0x8'),_0x4e7ce5,_0x5af21d,_0x2e9412);if(_0x2e9412[_0x015f('0x9')]){logger[_0x015f('0x9')]('rpc',_0x015f('0x8'),_0x4e7ce5,_0x2e9412[_0x015f('0x9')][_0x015f('0xa')],_0x5af21d);return _0x1fe860(_0x2e9412[_0x015f('0x9')]['message']);}else{return _0x43e890(_0x2e9412[_0x015f('0xb')]);}})['catch'](function(_0x3e087b){logger[_0x015f('0x9')](_0x015f('0x7'),_0x015f('0x8'),_0x4e7ce5,_0x3e087b,_0x5af21d);return _0x1fe860(_0x3e087b);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index fc38251..e5859b6 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 _0x5feb=['error','Email\x20service\x20initialization','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x5feb,0x144));var _0xb5fe=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0x5feb[_0x2f31b1];return _0x448988;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0xb5fe('0x0'));var mailAccount=require(_0xb5fe('0x1'));var setting=require(_0xb5fe('0x2'));var logger=require(_0xb5fe('0x3'))(_0xb5fe('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb5fe('0x5')]()[_0xb5fe('0x6')](mailAccount[_0xb5fe('0x7')]())[_0xb5fe('0x6')](realtime[_0xb5fe('0x8')]())[_0xb5fe('0x6')](function(){email[_0xb5fe('0x9')](realtime[_0xb5fe('0xa')]);return realtime;});}function main(){return server[_0xb5fe('0xb')](realtime,email)[_0xb5fe('0x6')](function(){return initRealtime();})[_0xb5fe('0x6')](function(){return setting['getSettings']();})['then'](function(_0x4954d3){return setInterval(initRealtime,_0x4954d3['loginMailFrequency']*0x3e8);})['catch'](function(_0x32d2ab){logger[_0xb5fe('0xc')](_0xb5fe('0xd'),_0x32d2ab);});}main(); \ No newline at end of file +var _0x40ad=['then','getMailAccounts','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./lib/email','./rpc/setting','../../config/logger','email'];(function(_0x5d3e10,_0x282535){var _0x15b465=function(_0x90f879){while(--_0x90f879){_0x5d3e10['push'](_0x5d3e10['shift']());}};_0x15b465(++_0x282535);}(_0x40ad,0x15a));var _0xd40a=function(_0x322752,_0x1ab149){_0x322752=_0x322752-0x0;var _0x2a6840=_0x40ad[_0x322752];return _0x2a6840;};'use strict';var server=require(_0xd40a('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xd40a('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xd40a('0x2'));var logger=require(_0xd40a('0x3'))(_0xd40a('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xd40a('0x5')](mailAccount[_0xd40a('0x6')]())[_0xd40a('0x5')](realtime[_0xd40a('0x7')]())[_0xd40a('0x5')](function(){email['refresh'](realtime[_0xd40a('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xd40a('0x5')](function(){return initRealtime();})[_0xd40a('0x5')](function(){return setting[_0xd40a('0x9')]();})[_0xd40a('0x5')](function(_0x1938ce){return setInterval(initRealtime,_0x1938ce[_0xd40a('0xa')]*0x3e8);})[_0xd40a('0xb')](function(_0x3fc985){logger['error'](_0xd40a('0xc'),_0x3fc985);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index fc190a6..ab9f697 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 _0x5294=['send','verifySmtp','Smtp','lastSync','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./smtp','info','start\x20email\x20channel','smtp','prototype','emit','mailAccounts','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','catch','handleImapError','sendMail'];(function(_0x4293c4,_0x39b062){var _0x11ea67=function(_0x3b75a2){while(--_0x3b75a2){_0x4293c4['push'](_0x4293c4['shift']());}};_0x11ea67(++_0x39b062);}(_0x5294,0x114));var _0x4529=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x5294[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x4529('0x0'));var moment=require(_0x4529('0x1'));var BPromise=require(_0x4529('0x2'));var md5=require(_0x4529('0x3'));var Redis=require(_0x4529('0x4'));var config=require('../../../config/environment');var logger=require(_0x4529('0x5'))(_0x4529('0x6'));config[_0x4529('0x7')]=_['defaults'](config[_0x4529('0x7')],{'host':_0x4529('0x8'),'port':0x18eb});var io=require(_0x4529('0x9'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0x4529('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x559b31){logger[_0x4529('0xb')](_0x4529('0xc'));this['mailAccounts']=_0x559b31['mailAccounts'];this['imapAccounts']={};this[_0x4529('0xd')]=new EmailSmtp();}EmailChannel[_0x4529('0xe')][_0x4529('0xf')]=function(_0x15d34d){var _0x794dc7=this[_0x4529('0x10')][_0x15d34d];var _0x1dba8c={'id':_0x794dc7['id'],'name':_0x794dc7[_0x4529('0x11')],'key':_0x794dc7[_0x4529('0x12')],'active':_0x794dc7[_0x4529('0x13')],'Imap':{'status':_0x794dc7[_0x4529('0x14')][_0x4529('0x15')],'messageStatus':_0x794dc7[_0x4529('0x14')][_0x4529('0x16')],'total':_0x794dc7['Imap'][_0x4529('0x17')]}};if(_['isNil'](md5Accounts[_0x15d34d])){md5Accounts[_0x15d34d]={};}var _0x1aa63a=md5(JSON[_0x4529('0x18')](_0x1dba8c));if(md5Accounts[_0x15d34d][_0x4529('0x3')]!==_0x1aa63a){md5Accounts[_0x15d34d]['md5']=_0x1aa63a;io[_0x4529('0xf')](_0x4529('0x19'),_0x1dba8c);}};EmailChannel[_0x4529('0xe')][_0x4529('0x1a')]=function(_0x1c383a){for(var _0x4dc4c4 in _0x1c383a){if(_0x1c383a[_0x4529('0x1b')](_0x4dc4c4)){if(_0x1c383a[_0x4dc4c4][_0x4529('0x14')]&&_0x1c383a[_0x4dc4c4]['active']){var _0x5841f6=_0x1c383a[_0x4dc4c4][_0x4529('0x14')];if(!_0x5841f6[_0x4529('0x1c')]&&_0x1c383a[_0x4dc4c4][_0x4529('0x1d')]!=='custom')_0x5841f6['service']=_0x1c383a[_0x4dc4c4]['provider'];if(!this[_0x4529('0x1e')][_0x4529('0x1b')](_0x5841f6['id'])){this[_0x4529('0x1e')][_0x5841f6['id']]=new EmailImap(_0x5841f6,_0x1c383a[_0x4dc4c4][_0x4529('0x6')]);this[_0x4529('0x1e')][_0x5841f6['id']]['on'](_0x4529('0x1f'),this[_0x4529('0x20')][_0x4529('0x21')](this,_0x4dc4c4));this['imapAccounts'][_0x5841f6['id']]['on']('email',this[_0x4529('0x22')][_0x4529('0x21')](this,_0x4dc4c4));this['imapAccounts'][_0x5841f6['id']]['on'](_0x4529('0x23'),this[_0x4529('0x24')][_0x4529('0x21')](this,_0x4dc4c4));this[_0x4529('0x1e')][_0x5841f6['id']]['on'](_0x4529('0x25'),this['handleImapError'][_0x4529('0x21')](this,_0x4dc4c4));}}else{if(_['isNil'](this[_0x4529('0x10')][_0x4dc4c4][_0x4529('0x14')])){this[_0x4529('0x10')][_0x4dc4c4][_0x4529('0x14')]={};}this[_0x4529('0x10')][_0x4dc4c4][_0x4529('0x14')]['status']=_0x4529('0x26');this['mailAccounts'][_0x4dc4c4][_0x4529('0x14')]['messageStatus']='';this[_0x4529('0xf')](_0x4dc4c4);}}}};EmailChannel[_0x4529('0xe')][_0x4529('0x20')]=function(_0x1a19f0,_0x16f92a){if(this[_0x4529('0x10')][_0x1a19f0]){this[_0x4529('0x10')][_0x1a19f0][_0x4529('0x14')][_0x4529('0x15')]=_0x4529('0x27');this[_0x4529('0x10')][_0x1a19f0][_0x4529('0x14')][_0x4529('0x16')]=_0x16f92a[_0x4529('0x11')];if(_0x16f92a['messages']){this[_0x4529('0x10')][_0x1a19f0][_0x4529('0x14')]['total']=_0x16f92a[_0x4529('0x28')]['total'];}return this[_0x4529('0xf')](_0x1a19f0);}};EmailChannel[_0x4529('0xe')][_0x4529('0x22')]=function(_0x1d018c,_0x285055){logger[_0x4529('0xb')](_0x4529('0x29'),_0x285055[_0x4529('0x2a')],_0x285055['lastName'],_0x285055[_0x4529('0x2b')],_0x1d018c);if(this[_0x4529('0x10')][_0x1d018c]){return mailAccount['notify'](_0x1d018c,_0x285055)[_0x4529('0x2c')](function(_0x446f57){if(_0x446f57){logger['info']('Mail\x20accepted\x20from\x20routing');}})[_0x4529('0x2d')](function(_0x49c883){logger[_0x4529('0x25')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x4529('0x18')](_0x49c883));});}};EmailChannel[_0x4529('0xe')][_0x4529('0x24')]=function(_0x5b6c3f){if(this[_0x4529('0x10')][_0x5b6c3f]&&this['mailAccounts'][_0x5b6c3f][_0x4529('0x14')]){if(this[_0x4529('0x1e')][this[_0x4529('0x10')][_0x5b6c3f]['Imap']['id']]){delete this[_0x4529('0x1e')][this['mailAccounts'][_0x5b6c3f]['Imap']['id']];}this[_0x4529('0x10')][_0x5b6c3f][_0x4529('0x14')]['lastSync']=moment();this[_0x4529('0xf')](_0x5b6c3f);}};EmailChannel[_0x4529('0xe')][_0x4529('0x2e')]=function(_0x4183b3,_0x521657){if(this[_0x4529('0x10')][_0x4183b3]){this['mailAccounts'][_0x4183b3]['Imap'][_0x4529('0x15')]=_0x4529('0x25');this[_0x4529('0x10')][_0x4183b3][_0x4529('0x14')][_0x4529('0x16')]=_0x521657;return this[_0x4529('0xf')](_0x4183b3);}};EmailChannel[_0x4529('0xe')][_0x4529('0x2f')]=function(_0x25a8fb,_0xb19390){return this[_0x4529('0xd')][_0x4529('0x30')](_0x25a8fb,_0xb19390);};EmailChannel['prototype'][_0x4529('0x31')]=function(_0x33838c){var _0x346e55=this;if(this['mailAccounts'][_0x33838c['id']]){if(_['isNil'](this['mailAccounts'][_0x33838c['id']]['Smtp'])){this[_0x4529('0x10')][_0x33838c['id']][_0x4529('0x32')]={};}this[_0x4529('0x10')][_0x33838c['id']][_0x4529('0x32')][_0x4529('0x33')]=moment();return new BPromise(function(_0xb10be4,_0xbc5d30){return _0x346e55['smtp'][_0x4529('0x34')](_0x33838c)['then'](function(_0x36f37a){_0x346e55[_0x4529('0x10')][_0x33838c['id']][_0x4529('0x32')][_0x4529('0x15')]='verified';_0x346e55[_0x4529('0x10')][_0x33838c['id']][_0x4529('0x32')][_0x4529('0x16')]='';_0x346e55[_0x4529('0xf')](_0x33838c['id']);_0xb10be4(_0x36f37a);})[_0x4529('0x2d')](function(_0x1e418b){_0x346e55[_0x4529('0x10')][_0x33838c['id']][_0x4529('0x32')][_0x4529('0x15')]=_0x4529('0x25');_0x346e55['mailAccounts'][_0x33838c['id']][_0x4529('0x32')][_0x4529('0x16')]=_0x1e418b;_0x346e55[_0x4529('0xf')](_0x33838c['id']);_0xbc5d30(_0x1e418b);});});}return this[_0x4529('0xd')][_0x4529('0x34')](_0x33838c);};module[_0x4529('0x35')]=EmailChannel; \ No newline at end of file +var _0xab16=['verified','exports','lodash','bluebird','../../../config/environment','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','name','key','active','Imap','status','total','isNil','stringify','md5','emit','mailAccount:update','prototype','refresh','hasOwnProperty','service','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','handleImapBox','connected','messages','lastName','from','info','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','Smtp','verify'];(function(_0x592326,_0x43179e){var _0x337b2d=function(_0xb2333c){while(--_0xb2333c){_0x592326['push'](_0x592326['shift']());}};_0x337b2d(++_0x43179e);}(_0xab16,0xa7));var _0x6ab1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xab16[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6ab1('0x0'));var moment=require('moment');var BPromise=require(_0x6ab1('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x6ab1('0x2'));var logger=require('../../../config/logger')(_0x6ab1('0x3'));config['redis']=_[_0x6ab1('0x4')](config[_0x6ab1('0x5')],{'host':_0x6ab1('0x6'),'port':0x18eb});var io=require(_0x6ab1('0x7'))(new Redis(config[_0x6ab1('0x5')]));var EmailImap=require(_0x6ab1('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x6ab1('0x9'));var md5Accounts={};function EmailChannel(_0x3b55f3){logger['info'](_0x6ab1('0xa'));this[_0x6ab1('0xb')]=_0x3b55f3[_0x6ab1('0xb')];this[_0x6ab1('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x1d5d89){var _0x39f79b=this['mailAccounts'][_0x1d5d89];var _0xbed966={'id':_0x39f79b['id'],'name':_0x39f79b[_0x6ab1('0xd')],'key':_0x39f79b[_0x6ab1('0xe')],'active':_0x39f79b[_0x6ab1('0xf')],'Imap':{'status':_0x39f79b[_0x6ab1('0x10')][_0x6ab1('0x11')],'messageStatus':_0x39f79b[_0x6ab1('0x10')]['messageStatus'],'total':_0x39f79b[_0x6ab1('0x10')][_0x6ab1('0x12')]}};if(_[_0x6ab1('0x13')](md5Accounts[_0x1d5d89])){md5Accounts[_0x1d5d89]={};}var _0x5a05c2=md5(JSON[_0x6ab1('0x14')](_0xbed966));if(md5Accounts[_0x1d5d89][_0x6ab1('0x15')]!==_0x5a05c2){md5Accounts[_0x1d5d89]['md5']=_0x5a05c2;io[_0x6ab1('0x16')](_0x6ab1('0x17'),_0xbed966);}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x19')]=function(_0x16e740){for(var _0x15a9fb in _0x16e740){if(_0x16e740[_0x6ab1('0x1a')](_0x15a9fb)){if(_0x16e740[_0x15a9fb]['Imap']&&_0x16e740[_0x15a9fb][_0x6ab1('0xf')]){var _0x318adc=_0x16e740[_0x15a9fb]['Imap'];if(!_0x318adc[_0x6ab1('0x1b')]&&_0x16e740[_0x15a9fb][_0x6ab1('0x1c')]!==_0x6ab1('0x1d'))_0x318adc[_0x6ab1('0x1b')]=_0x16e740[_0x15a9fb][_0x6ab1('0x1c')];if(!this[_0x6ab1('0xc')][_0x6ab1('0x1a')](_0x318adc['id'])){this[_0x6ab1('0xc')][_0x318adc['id']]=new EmailImap(_0x318adc,_0x16e740[_0x15a9fb][_0x6ab1('0x3')]);this['imapAccounts'][_0x318adc['id']]['on'](_0x6ab1('0x1e'),this['handleImapBox'][_0x6ab1('0x1f')](this,_0x15a9fb));this[_0x6ab1('0xc')][_0x318adc['id']]['on'](_0x6ab1('0x3'),this[_0x6ab1('0x20')][_0x6ab1('0x1f')](this,_0x15a9fb));this[_0x6ab1('0xc')][_0x318adc['id']]['on'](_0x6ab1('0x21'),this[_0x6ab1('0x22')][_0x6ab1('0x1f')](this,_0x15a9fb));this[_0x6ab1('0xc')][_0x318adc['id']]['on'](_0x6ab1('0x23'),this[_0x6ab1('0x24')][_0x6ab1('0x1f')](this,_0x15a9fb));}}else{if(_[_0x6ab1('0x13')](this[_0x6ab1('0xb')][_0x15a9fb][_0x6ab1('0x10')])){this['mailAccounts'][_0x15a9fb][_0x6ab1('0x10')]={};}this[_0x6ab1('0xb')][_0x15a9fb][_0x6ab1('0x10')][_0x6ab1('0x11')]=_0x6ab1('0x25');this[_0x6ab1('0xb')][_0x15a9fb]['Imap'][_0x6ab1('0x26')]='';this[_0x6ab1('0x16')](_0x15a9fb);}}}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x27')]=function(_0xcb3b03,_0x448778){if(this[_0x6ab1('0xb')][_0xcb3b03]){this['mailAccounts'][_0xcb3b03]['Imap']['status']=_0x6ab1('0x28');this[_0x6ab1('0xb')][_0xcb3b03]['Imap']['messageStatus']=_0x448778[_0x6ab1('0xd')];if(_0x448778['messages']){this[_0x6ab1('0xb')][_0xcb3b03][_0x6ab1('0x10')][_0x6ab1('0x12')]=_0x448778[_0x6ab1('0x29')]['total'];}return this[_0x6ab1('0x16')](_0xcb3b03);}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x20')]=function(_0x5f1620,_0x57da04){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x57da04['firstName'],_0x57da04[_0x6ab1('0x2a')],_0x57da04[_0x6ab1('0x2b')],_0x5f1620);if(this[_0x6ab1('0xb')][_0x5f1620]){return mailAccount['notify'](_0x5f1620,_0x57da04)['then'](function(_0x240ef6){if(_0x240ef6){logger[_0x6ab1('0x2c')](_0x6ab1('0x2d'));}})['catch'](function(_0x572dea){logger['error'](_0x6ab1('0x2e'),JSON[_0x6ab1('0x14')](_0x572dea));});}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x22')]=function(_0x5c3bd8){if(this[_0x6ab1('0xb')][_0x5c3bd8]&&this[_0x6ab1('0xb')][_0x5c3bd8][_0x6ab1('0x10')]){if(this[_0x6ab1('0xc')][this['mailAccounts'][_0x5c3bd8][_0x6ab1('0x10')]['id']]){delete this[_0x6ab1('0xc')][this[_0x6ab1('0xb')][_0x5c3bd8][_0x6ab1('0x10')]['id']];}this['mailAccounts'][_0x5c3bd8][_0x6ab1('0x10')][_0x6ab1('0x2f')]=moment();this[_0x6ab1('0x16')](_0x5c3bd8);}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x24')]=function(_0x484f55,_0x5f4508){if(this[_0x6ab1('0xb')][_0x484f55]){this[_0x6ab1('0xb')][_0x484f55]['Imap'][_0x6ab1('0x11')]='error';this['mailAccounts'][_0x484f55][_0x6ab1('0x10')]['messageStatus']=_0x5f4508;return this[_0x6ab1('0x16')](_0x484f55);}};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x30')]=function(_0x486e61,_0x584c58){return this[_0x6ab1('0x31')]['send'](_0x486e61,_0x584c58);};EmailChannel[_0x6ab1('0x18')][_0x6ab1('0x32')]=function(_0x5ea309){var _0x5a8cdc=this;if(this[_0x6ab1('0xb')][_0x5ea309['id']]){if(_[_0x6ab1('0x13')](this[_0x6ab1('0xb')][_0x5ea309['id']][_0x6ab1('0x33')])){this[_0x6ab1('0xb')][_0x5ea309['id']][_0x6ab1('0x33')]={};}this[_0x6ab1('0xb')][_0x5ea309['id']]['Smtp'][_0x6ab1('0x2f')]=moment();return new BPromise(function(_0x331bc8,_0x2ab09b){return _0x5a8cdc[_0x6ab1('0x31')][_0x6ab1('0x34')](_0x5ea309)['then'](function(_0x12bd9f){_0x5a8cdc['mailAccounts'][_0x5ea309['id']][_0x6ab1('0x33')][_0x6ab1('0x11')]=_0x6ab1('0x35');_0x5a8cdc[_0x6ab1('0xb')][_0x5ea309['id']][_0x6ab1('0x33')][_0x6ab1('0x26')]='';_0x5a8cdc[_0x6ab1('0x16')](_0x5ea309['id']);_0x331bc8(_0x12bd9f);})['catch'](function(_0x47f2ed){_0x5a8cdc[_0x6ab1('0xb')][_0x5ea309['id']][_0x6ab1('0x33')]['status']=_0x6ab1('0x23');_0x5a8cdc['mailAccounts'][_0x5ea309['id']]['Smtp'][_0x6ab1('0x26')]=_0x47f2ed;_0x5a8cdc[_0x6ab1('0x16')](_0x5ea309['id']);_0x2ab09b(_0x47f2ed);});});}return this[_0x6ab1('0x31')][_0x6ab1('0x34')](_0x5ea309);};module[_0x6ab1('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 6288c5a..d2edd6e 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 _0x2a07=['handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','xoauth2','CloudProvider','data5','getHost','service','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','error','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchError','stringify','textCode','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once'];(function(_0x5850fb,_0x5dbf98){var _0x133afd=function(_0x31a699){while(--_0x31a699){_0x5850fb['push'](_0x5850fb['shift']());}};_0x133afd(++_0x5dbf98);}(_0x2a07,0x74));var _0x72a0=function(_0x3ce221,_0x22d678){_0x3ce221=_0x3ce221-0x0;var _0x3995b8=_0x2a07[_0x3ce221];return _0x3995b8;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var Imap=require(_0x72a0('0x2'));var simpleParser=require(_0x72a0('0x3'))[_0x72a0('0x4')];var Iconv=require('iconv')[_0x72a0('0x5')];var EventEmitter=require(_0x72a0('0x6'))[_0x72a0('0x7')];var utils=require(_0x72a0('0x8'));var logger=require(_0x72a0('0x9'))(_0x72a0('0xa'));function EmailImap(_0x3ccf6d,_0x20dab9){this[_0x72a0('0xb')]=_0x72a0('0xc');this[_0x72a0('0xd')]=this[_0x72a0('0xe')](_0x3ccf6d,_0x20dab9);this[_0x72a0('0x2')]=new Imap(this[_0x72a0('0xd')]);this[_0x72a0('0x2')][_0x72a0('0xf')]('ready',this[_0x72a0('0x10')][_0x72a0('0x11')](this));this['imap'][_0x72a0('0xf')](_0x72a0('0x12'),this[_0x72a0('0x13')][_0x72a0('0x11')](this));this[_0x72a0('0x2')]['on']('error',this[_0x72a0('0x14')][_0x72a0('0x11')](this));this[_0x72a0('0x2')][_0x72a0('0x15')]();}util[_0x72a0('0x16')](EmailImap,EventEmitter);EmailImap[_0x72a0('0x17')][_0x72a0('0xe')]=function(_0x5e0b5f,_0x4930c5){var _0xe103dc={'connTimeout':_0x5e0b5f[_0x72a0('0x18')]?_0x5e0b5f[_0x72a0('0x18')]*0x3e8:0x2710,'authTimeout':_0x5e0b5f[_0x72a0('0x19')]?_0x5e0b5f[_0x72a0('0x19')]*0x3e8:0x1388};if(_[_0x72a0('0x1a')](_0x5e0b5f['service'])){if(_0x5e0b5f[_0x72a0('0x1b')]){_0xe103dc[_0x72a0('0x1c')]=_0x5e0b5f[_0x72a0('0x1c')];_0xe103dc[_0x72a0('0x1d')]=_0x5e0b5f[_0x72a0('0x1d')];}_0xe103dc['host']=_0x5e0b5f[_0x72a0('0x1e')];_0xe103dc[_0x72a0('0x1f')]=_0x5e0b5f[_0x72a0('0x1f')]||0x3e1;if(_0x5e0b5f['tls']){_0xe103dc[_0x72a0('0x20')]=!![];}else{_0xe103dc[_0x72a0('0x20')]=![];_0xe103dc[_0x72a0('0x21')]=_0x72a0('0x22');}}else{if(_0x5e0b5f['modernAuthentication']){_0xe103dc[_0x72a0('0x23')]=utils['generateXOAuth2Token'](_0x5e0b5f[_0x72a0('0x24')][_0x72a0('0x25')],_0x5e0b5f[_0x72a0('0x1c')]);_0xe103dc['user']=_0x5e0b5f[_0x72a0('0x1c')];}else{_0xe103dc[_0x72a0('0x1c')]=_0x5e0b5f[_0x72a0('0x1c')];_0xe103dc[_0x72a0('0x1d')]=_0x5e0b5f['password'];}_0xe103dc[_0x72a0('0x1e')]=utils[_0x72a0('0x26')](_0x5e0b5f[_0x72a0('0x27')]);_0xe103dc[_0x72a0('0x1f')]=0x3e1;_0xe103dc[_0x72a0('0x20')]=!![];}_0xe103dc[_0x72a0('0xa')]=_0x4930c5||_0x5e0b5f['user']||'anonymous@xcally.com';return _0xe103dc;};EmailImap[_0x72a0('0x17')][_0x72a0('0x10')]=function(){this[_0x72a0('0x2')][_0x72a0('0x28')](this[_0x72a0('0xb')],![],this[_0x72a0('0x29')][_0x72a0('0x11')](this));};EmailImap[_0x72a0('0x17')][_0x72a0('0x29')]=function(_0x12dcc9,_0x4f9718){if(_0x12dcc9){this[_0x72a0('0x14')](_0x12dcc9,!![]);}else{this[_0x72a0('0x2a')](_0x72a0('0x2b'),_0x4f9718);this[_0x72a0('0x2c')]();}};EmailImap[_0x72a0('0x17')][_0x72a0('0x2d')]=function(_0x432179){if(_0x432179){this[_0x72a0('0x14')](_0x432179,!![]);}else{this[_0x72a0('0x2')][_0x72a0('0x12')]();}};EmailImap['prototype'][_0x72a0('0x2c')]=function(){this[_0x72a0('0x2')][_0x72a0('0x2e')]([_0x72a0('0x2f')],this[_0x72a0('0x30')][_0x72a0('0x11')](this));};EmailImap[_0x72a0('0x17')]['handleReadUnseen']=function(_0x30878e,_0x2c884f){if(_0x30878e){this[_0x72a0('0x14')](_0x30878e,!![]);}else{if(_0x2c884f[_0x72a0('0x31')]){try{var _0x89d598=this[_0x72a0('0x2')][_0x72a0('0x32')](_0x2c884f,{'bodies':'','markSeen':!![]});_0x89d598['on'](_0x72a0('0x33'),this['handleFetchMessage'][_0x72a0('0x11')](this));_0x89d598[_0x72a0('0xf')](_0x72a0('0x34'),this['handleFetchError'][_0x72a0('0x11')](this));_0x89d598['once'](_0x72a0('0x12'),this[_0x72a0('0x35')][_0x72a0('0x11')](this));}catch(_0x3a293f){logger[_0x72a0('0x34')](_0x3a293f);}}else{this[_0x72a0('0x2')][_0x72a0('0x36')](!![],this[_0x72a0('0x2d')][_0x72a0('0x11')](this));}}};EmailImap[_0x72a0('0x17')][_0x72a0('0x37')]=function(_0x3ff191){_0x3ff191['on']('body',this[_0x72a0('0x38')]['bind'](this));_0x3ff191[_0x72a0('0xf')](_0x72a0('0x39'),this[_0x72a0('0x3a')][_0x72a0('0x11')](this));_0x3ff191[_0x72a0('0xf')](_0x72a0('0x12'),this[_0x72a0('0x3b')][_0x72a0('0x11')](this));};EmailImap[_0x72a0('0x17')]['handleMessageBody']=function(_0x4a973a){simpleParser(_0x4a973a,{'Iconv':Iconv},this[_0x72a0('0x3c')][_0x72a0('0x11')](this));};EmailImap[_0x72a0('0x17')][_0x72a0('0x3a')]=function(){};EmailImap[_0x72a0('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x72a0('0x17')][_0x72a0('0x3c')]=function(_0x582c90,_0x21ad08){if(_0x582c90){logger['error'](_0x582c90);}else{var _0x582c84=this;utils['parser'](this[_0x72a0('0xd')],_0x21ad08,function(_0x49633b){_0x582c84[_0x72a0('0x2a')](_0x72a0('0xa'),_0x49633b);});}};EmailImap[_0x72a0('0x17')][_0x72a0('0x35')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x72a0('0x17')][_0x72a0('0x3d')]=function(_0x4a7032){this[_0x72a0('0x14')](_0x4a7032);this[_0x72a0('0x2')]['closeBox'](!![],this[_0x72a0('0x2d')][_0x72a0('0x11')](this));};EmailImap[_0x72a0('0x17')][_0x72a0('0x13')]=function(){this[_0x72a0('0x2a')](_0x72a0('0x12'));};EmailImap['prototype'][_0x72a0('0x14')]=function(_0x5babc1,_0x3683b6){logger['error'](_0x72a0('0x14'),this[_0x72a0('0xd')]['email'],JSON[_0x72a0('0x3e')](_0x5babc1));var _0x506d65='';if(_0x5babc1){if(_0x5babc1[_0x72a0('0x3f')]){_0x506d65=_0x5babc1[_0x72a0('0x3f')];}else{for(var _0x13254c in _0x5babc1){if(_0x5babc1['hasOwnProperty'](_0x13254c)){_0x506d65+=_[_0x72a0('0x40')](_0x13254c)+':\x20'+_0x5babc1[_0x13254c]+'\x0a';}}}}if(_0x3683b6){this[_0x72a0('0x2')][_0x72a0('0x12')]();}else{this['emit']('error',_0x506d65);this[_0x72a0('0x2a')]('end');}};module[_0x72a0('0x41')]=EmailImap; \ No newline at end of file +var _0xc2c7=['textCode','upperFirst','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','email','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','service','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','parser'];(function(_0x8d4128,_0x1d9666){var _0x1b08b2=function(_0x59ed79){while(--_0x59ed79){_0x8d4128['push'](_0x8d4128['shift']());}};_0x1b08b2(++_0x1d9666);}(_0xc2c7,0x134));var _0x7c2c=function(_0x496f61,_0x47324e){_0x496f61=_0x496f61-0x0;var _0x2d6c47=_0xc2c7[_0x496f61];return _0x2d6c47;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var Imap=require(_0x7c2c('0x1'));var simpleParser=require(_0x7c2c('0x2'))[_0x7c2c('0x3')];var Iconv=require(_0x7c2c('0x4'))[_0x7c2c('0x5')];var EventEmitter=require(_0x7c2c('0x6'))[_0x7c2c('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x7c2c('0x8'));function EmailImap(_0x42ecc9,_0x23c038){this['mailbox']='INBOX';this['account']=this[_0x7c2c('0x9')](_0x42ecc9,_0x23c038);this[_0x7c2c('0x1')]=new Imap(this[_0x7c2c('0xa')]);this[_0x7c2c('0x1')][_0x7c2c('0xb')]('ready',this[_0x7c2c('0xc')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0xf')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')]['on'](_0x7c2c('0x10'),this[_0x7c2c('0x11')][_0x7c2c('0xd')](this));this[_0x7c2c('0x1')][_0x7c2c('0x12')]();}util[_0x7c2c('0x13')](EmailImap,EventEmitter);EmailImap[_0x7c2c('0x14')][_0x7c2c('0x9')]=function(_0x4c4aaf,_0x5b5729){var _0x102778={'connTimeout':_0x4c4aaf[_0x7c2c('0x15')]?_0x4c4aaf[_0x7c2c('0x15')]*0x3e8:0x2710,'authTimeout':_0x4c4aaf['authTimeout']?_0x4c4aaf[_0x7c2c('0x16')]*0x3e8:0x1388};if(_[_0x7c2c('0x17')](_0x4c4aaf['service'])){if(_0x4c4aaf[_0x7c2c('0x18')]){_0x102778['user']=_0x4c4aaf[_0x7c2c('0x19')];_0x102778['password']=_0x4c4aaf[_0x7c2c('0x1a')];}_0x102778[_0x7c2c('0x1b')]=_0x4c4aaf[_0x7c2c('0x1b')];_0x102778[_0x7c2c('0x1c')]=_0x4c4aaf[_0x7c2c('0x1c')]||0x3e1;if(_0x4c4aaf[_0x7c2c('0x1d')]){_0x102778[_0x7c2c('0x1d')]=!![];}else{_0x102778[_0x7c2c('0x1d')]=![];_0x102778[_0x7c2c('0x1e')]=_0x7c2c('0x1f');}}else{if(_0x4c4aaf[_0x7c2c('0x20')]){_0x102778[_0x7c2c('0x21')]=utils['generateXOAuth2Token'](_0x4c4aaf[_0x7c2c('0x22')]['data5'],_0x4c4aaf['user']);_0x102778[_0x7c2c('0x19')]=_0x4c4aaf[_0x7c2c('0x19')];}else{_0x102778[_0x7c2c('0x19')]=_0x4c4aaf[_0x7c2c('0x19')];_0x102778[_0x7c2c('0x1a')]=_0x4c4aaf[_0x7c2c('0x1a')];}_0x102778[_0x7c2c('0x1b')]=utils['getHost'](_0x4c4aaf[_0x7c2c('0x23')]);_0x102778['port']=0x3e1;_0x102778[_0x7c2c('0x1d')]=!![];}_0x102778['email']=_0x5b5729||_0x4c4aaf[_0x7c2c('0x19')]||_0x7c2c('0x24');return _0x102778;};EmailImap[_0x7c2c('0x14')]['handleReady']=function(){this['imap'][_0x7c2c('0x25')](this[_0x7c2c('0x26')],![],this[_0x7c2c('0x27')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x27')]=function(_0x3f4618,_0x4b1dd0){if(_0x3f4618){this[_0x7c2c('0x11')](_0x3f4618,!![]);}else{this[_0x7c2c('0x28')](_0x7c2c('0x29'),_0x4b1dd0);this[_0x7c2c('0x2a')]();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2b')]=function(_0xf2bfd1){if(_0xf2bfd1){this[_0x7c2c('0x11')](_0xf2bfd1,!![]);}else{this[_0x7c2c('0x1')]['end']();}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2a')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x2c')](['UNSEEN'],this[_0x7c2c('0x2d')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x2d')]=function(_0x1859c2,_0x3ad837){if(_0x1859c2){this[_0x7c2c('0x11')](_0x1859c2,!![]);}else{if(_0x3ad837['length']){try{var _0x1969f4=this[_0x7c2c('0x1')][_0x7c2c('0x2e')](_0x3ad837,{'bodies':'','markSeen':!![]});_0x1969f4['on'](_0x7c2c('0x2f'),this[_0x7c2c('0x30')]['bind'](this));_0x1969f4['once'](_0x7c2c('0x10'),this['handleFetchError']['bind'](this));_0x1969f4[_0x7c2c('0xb')](_0x7c2c('0xe'),this[_0x7c2c('0x31')][_0x7c2c('0xd')](this));}catch(_0x536dcf){logger[_0x7c2c('0x10')](_0x536dcf);}}else{this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this[_0x7c2c('0x2b')][_0x7c2c('0xd')](this));}}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x30')]=function(_0xab5072){_0xab5072['on'](_0x7c2c('0x33'),this[_0x7c2c('0x34')][_0x7c2c('0xd')](this));_0xab5072[_0x7c2c('0xb')](_0x7c2c('0x35'),this['handleMessageAttributes']['bind'](this));_0xab5072[_0x7c2c('0xb')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x34')]=function(_0x129bf0){simpleParser(_0x129bf0,{'Iconv':Iconv},this[_0x7c2c('0x36')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x37')]=function(){};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x38')]=function(){};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x36')]=function(_0x58696a,_0x4c7402){if(_0x58696a){logger[_0x7c2c('0x10')](_0x58696a);}else{var _0x360928=this;utils[_0x7c2c('0x39')](this[_0x7c2c('0xa')],_0x4c7402,function(_0x5e8c96){_0x360928[_0x7c2c('0x28')](_0x7c2c('0x8'),_0x5e8c96);});}};EmailImap[_0x7c2c('0x14')][_0x7c2c('0x31')]=function(){this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this[_0x7c2c('0x2b')][_0x7c2c('0xd')](this));};EmailImap[_0x7c2c('0x14')]['handleFetchError']=function(_0xe2a67b){this['handleError'](_0xe2a67b);this[_0x7c2c('0x1')][_0x7c2c('0x32')](!![],this['handleCloseBox'][_0x7c2c('0xd')](this));};EmailImap['prototype'][_0x7c2c('0xf')]=function(){this[_0x7c2c('0x28')](_0x7c2c('0xe'));};EmailImap[_0x7c2c('0x14')]['handleError']=function(_0x23fdcf,_0x500974){logger['error'](_0x7c2c('0x11'),this[_0x7c2c('0xa')][_0x7c2c('0x8')],JSON['stringify'](_0x23fdcf));var _0x3adfd1='';if(_0x23fdcf){if(_0x23fdcf[_0x7c2c('0x3a')]){_0x3adfd1=_0x23fdcf['textCode'];}else{for(var _0x267361 in _0x23fdcf){if(_0x23fdcf['hasOwnProperty'](_0x267361)){_0x3adfd1+=_[_0x7c2c('0x3b')](_0x267361)+':\x20'+_0x23fdcf[_0x267361]+'\x0a';}}}}if(_0x500974){this[_0x7c2c('0x1')]['end']();}else{this['emit'](_0x7c2c('0x10'),_0x3adfd1);this[_0x7c2c('0x28')]('end');}};module[_0x7c2c('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 39561e9..77b9cca 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 _0x6c2a=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0xf39acb,_0x4b0d57){var _0x3989ef=function(_0x3d4472){while(--_0x3d4472){_0xf39acb['push'](_0xf39acb['shift']());}};_0x3989ef(++_0x4b0d57);}(_0x6c2a,0x109));var _0xa6c2=function(_0x4955a9,_0x4fbad8){_0x4955a9=_0x4955a9-0x0;var _0x3a8f07=_0x6c2a[_0x4955a9];return _0x3a8f07;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa6c2('0x0'));function EmailSmtp(){}EmailSmtp[_0xa6c2('0x1')][_0xa6c2('0x2')]=function(_0x27a631,_0x34992f){return new Promise(function(_0x461dd4,_0x4ec4b4){var _0x214ac3=nodemailer[_0xa6c2('0x3')](_0x27a631);_0x214ac3['use'](_0xa6c2('0x4'),inlineBase64());_0x214ac3[_0xa6c2('0x5')](_0x34992f,function(_0x3b8f2c,_0x25ef8a){if(_0x3b8f2c){_0x4ec4b4(_0x3b8f2c[_0xa6c2('0x6')]());}else{_0x461dd4(_0x25ef8a);}});});};EmailSmtp[_0xa6c2('0x1')][_0xa6c2('0x7')]=function(_0x2cdfd8){return new Promise(function(_0x4c04e0,_0x342fb4){var _0xdab817=nodemailer[_0xa6c2('0x3')](_0x2cdfd8);_0xdab817['verify'](function(_0x11c9b8,_0x24137d){if(_0x11c9b8){_0x342fb4(_0x11c9b8[_0xa6c2('0x6')]());}else{if(_0x24137d){_0x4c04e0(_0x24137d);}else{_0x342fb4(_0xa6c2('0x8'));}}});});};module[_0xa6c2('0x9')]=EmailSmtp; \ No newline at end of file +var _0x5e82=['send','compile','prototype','verify','createTransport','toString','exports','nodemailer-plugin-inline-base64'];(function(_0x31fb52,_0xded904){var _0x3fc244=function(_0x267c70){while(--_0x267c70){_0x31fb52['push'](_0x31fb52['shift']());}};_0x3fc244(++_0xded904);}(_0x5e82,0x17f));var _0x25e8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5e82[_0x14add3];return _0x4a174f;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x25e8('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x25e8('0x1')]=function(_0x5f0e37,_0x2f3a34){return new Promise(function(_0x486886,_0x20ad21){var _0x3c62ab=nodemailer['createTransport'](_0x5f0e37);_0x3c62ab['use'](_0x25e8('0x2'),inlineBase64());_0x3c62ab['sendMail'](_0x2f3a34,function(_0x288f17,_0x38cf72){if(_0x288f17){_0x20ad21(_0x288f17['toString']());}else{_0x486886(_0x38cf72);}});});};EmailSmtp[_0x25e8('0x3')][_0x25e8('0x4')]=function(_0x728207){return new Promise(function(_0x3879aa,_0x3446d7){var _0x1aa1a9=nodemailer[_0x25e8('0x5')](_0x728207);_0x1aa1a9['verify'](function(_0x467fba,_0x4b01e1){if(_0x467fba){_0x3446d7(_0x467fba[_0x25e8('0x6')]());}else{if(_0x4b01e1){_0x3879aa(_0x4b01e1);}else{_0x3446d7('Not\x20verifired');}}});});};module[_0x25e8('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index d18acb4..6bc0195 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 _0x41f7=['body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','@xcally.com','head','name','substring','slice','join','Anonymous','split','pop','isEmpty','anonymous','generate','html','includes','attachments','forEach','filename','replace','_IMG','length','\x20[Attachment:\x20'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x41f7,0x79));var _0x741f=function(_0x4d506c,_0x495426){_0x4d506c=_0x4d506c-0x0;var _0x139058=_0x41f7[_0x4d506c];return _0x139058;};'use strict';var _=require(_0x741f('0x0'));var moment=require(_0x741f('0x1'));var random=require(_0x741f('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x741f('0x3'));var tnef=require(_0x741f('0x4'));var logger=require(_0x741f('0x5'))(_0x741f('0x6'));var config=require(_0x741f('0x7'));function getAddress(_0x35f02c){var _0xfa7ad7=_['head'](_0x35f02c[_0x741f('0x8')]);return _0xfa7ad7&&_0xfa7ad7['address']?_0xfa7ad7[_0x741f('0x9')]:'anonymous'+random['generate'](0x6)+_0x741f('0xa');}function getFirstName(_0x543d59){var _0x1a3b63=_[_0x741f('0xb')](_0x543d59[_0x741f('0x8')]);if(_0x1a3b63&&_0x1a3b63[_0x741f('0xc')]){if(_0x1a3b63[_0x741f('0xc')]==_0x1a3b63[_0x741f('0x9')]){return _0x1a3b63['name'][_0x741f('0xd')](0x0,_0x1a3b63['name']['indexOf']('@'));}var _0x59f6c6=_0x1a3b63[_0x741f('0xc')]['split'](/\s+/);return _0x59f6c6['length']>0x1?_0x59f6c6[_0x741f('0xe')](0x0,-0x1)[_0x741f('0xf')]('\x20'):_0x1a3b63['name'];}return _0x741f('0x10');}function getLastName(_0x1cce7e){var _0x567be8=_[_0x741f('0xb')](_0x1cce7e[_0x741f('0x8')]);if(_0x567be8&&_0x567be8[_0x741f('0xc')]){var _0x5c6b63=_0x567be8['name'][_0x741f('0x11')](/\s+/);return _0x5c6b63['length']>0x1?_0x5c6b63[_0x741f('0x12')]():'';}return'';}function getMails(_0x4ab0fe,_0x172a2b){var _0x39d95b='';for(var _0x56b28e=0x0;_0x56b28e<_0x172a2b[_0x741f('0x8')]['length'];_0x56b28e+=0x1){if(_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0x9')]!==_0x4ab0fe){if(!_[_0x741f('0x13')](_0x39d95b)){_0x39d95b+=',';}_0x39d95b+=_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0xc')]||_0x172a2b[_0x741f('0x8')][_0x56b28e]['address']||'';_0x39d95b+='\x20<';_0x39d95b+=_0x172a2b['value'][_0x56b28e][_0x741f('0x9')]?_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0x9')]:_0x741f('0x14')+random[_0x741f('0x15')](0x6)+_0x741f('0xa');_0x39d95b+='>';}}return _0x39d95b;}function parseEmail(_0x57c61f,_0x55b6d9,_0x347a20){if(_0x55b6d9[_0x741f('0x16')]){var _0x29b37e=/)<[^<]*)*<\/script>/gi;while(_0x29b37e['test'](_0x55b6d9[_0x741f('0x16')])){_0x55b6d9[_0x741f('0x16')]=_0x55b6d9[_0x741f('0x16')]['replace'](_0x29b37e,'');}if(_0x55b6d9[_0x741f('0x16')][_0x741f('0x17')]('{_0x340bfc['push'](_0x107973[_0x741f('0x1a')]);});var _0x637bc2=/]+>/g;var _0x1cfe9c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x20aa02=_0x55b6d9[_0x741f('0x16')][_0x741f('0x1b')](_0x1cfe9c,'_SRC');var _0x14fea4=_0x20aa02[_0x741f('0x1b')](_0x637bc2,_0x741f('0x1c'));for(let _0x671989=0x0;_0x671989<_0x340bfc[_0x741f('0x1d')];_0x671989++){var _0x13c13b=_0x14fea4['replace']('_IMG',_0x741f('0x1e')+_0x340bfc[_0x671989]+'\x20]');_0x14fea4=_0x13c13b;}_0x55b6d9[_0x741f('0x16')]=_0x14fea4;}_0x347a20['body']=_0x55b6d9[_0x741f('0x16')];}else{_0x347a20[_0x741f('0x1f')]=_0x55b6d9[_0x741f('0x20')];}if(_0x347a20['body']){_0x347a20['body']=_0x347a20[_0x741f('0x1f')][_0x741f('0x1b')](/0x0){var _0x9fe4c5=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x741f('0x30')];for(var _0x5daa8a=0x0;_0x5daa8a<_0x55b6d9[_0x741f('0x2f')]['length'];_0x5daa8a++){var _0x2f41d6=_['indexOf'](_0x9fe4c5,_0x55b6d9[_0x741f('0x2f')][_0x5daa8a][_0x741f('0x31')]);if(_0x2f41d6>=0x0){_0x347a20[_0x741f('0x32')]=!![];}}}return _0x347a20;}exports[_0x741f('0x33')]=function(_0x448540,_0x47003d,_0x3060bc){var _0x33dd68={'from':getAddress(_0x47003d[_0x741f('0x34')]),'firstName':getFirstName(_0x47003d[_0x741f('0x34')]),'lastName':getLastName(_0x47003d[_0x741f('0x34')]),'mapKey':_0x741f('0x6'),'message':{'from':getMails(_0x448540[_0x741f('0x6')],_0x47003d['from']),'to':_0x448540[_0x741f('0x6')],'cc':'','subject':_0x47003d['subject']||'','messageId':_0x47003d[_0x741f('0x35')],'inReplyTo':_0x47003d['inReplyTo'],'sentAt':moment(_0x47003d['date'])[_0x741f('0x36')](_0x741f('0x37')),'attach':![],'attachments':[]}};if(!_0x47003d[_0x741f('0x16')]&&!_0x47003d[_0x741f('0x20')]){var _0x1788cd=_['filter'](_0x47003d[_0x741f('0x18')],{'contentType':_0x741f('0x38')});if(_0x1788cd['length']){logger[_0x741f('0x39')](util[_0x741f('0x36')](_0x741f('0x3a'),_0x47003d[_0x741f('0x35')]));tnef['parseBuffer'](_[_0x741f('0x3b')](_0x1788cd)[_0x741f('0x2c')],function(_0x562e1f,_0x1d1b4a){if(_0x1d1b4a){_0x47003d[_0x741f('0x16')]=_0x1d1b4a[_0x741f('0x3c')]||_0x741f('0x3d');if(_0x1d1b4a['Attachments']){for(var _0x281e9d=0x0;_0x281e9d<_0x1d1b4a[_0x741f('0x3e')][_0x741f('0x1d')];_0x281e9d++){var _0x425b11=_0x1d1b4a[_0x741f('0x3e')][_0x281e9d];_0x33dd68['message']['attachments']['push']({'filename':_0x425b11[_0x741f('0x3f')],'content':Buffer[_0x741f('0x34')](_0x425b11[_0x741f('0x40')])});}}}_0x3060bc(parseEmail(_0x448540,_0x47003d,_0x33dd68));});}else{_0x47003d[_0x741f('0x16')]=_0x741f('0x3d');_0x3060bc(parseEmail(_0x448540,_0x47003d,_0x33dd68));}}else{_0x3060bc(parseEmail(_0x448540,_0x47003d,_0x33dd68));}};exports[_0x741f('0x41')]=function(_0x46ed07){switch(_0x46ed07){case'gmail':return _0x741f('0x42');case _0x741f('0x43'):return'imap.mail.yahoo.com';case'hotmail':return'imap-mail.outlook.com';case _0x741f('0x44'):return _0x741f('0x45');}return _0x741f('0x46');};exports[_0x741f('0x47')]=function(_0x17e60e,_0x1ee334){var _0x29403e=[_0x741f('0x48')+(_0x1ee334||''),_0x741f('0x49')+_0x17e60e,'',''];return Buffer[_0x741f('0x34')](_0x29403e['join'](''),_0x741f('0x4a'))[_0x741f('0x4b')]('base64');}; \ No newline at end of file +var _0xd9b5=['push','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','headerLines','line','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','user=','auth=Bearer\x20','toString','moment','randomstring','path','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','name','substring','length','join','split','pop','isEmpty','anonymous','@xcally.com','test','html','replace','includes','','body','0x1?_0x17603c['slice'](0x0,-0x1)[_0x5d9b('0xd')]('\x20'):_0x3aff7d['name'];}return'Anonymous';}function getLastName(_0x58957f){var _0x4e0163=_[_0x5d9b('0x6')](_0x58957f[_0x5d9b('0x7')]);if(_0x4e0163&&_0x4e0163[_0x5d9b('0xa')]){var _0x163fc7=_0x4e0163[_0x5d9b('0xa')][_0x5d9b('0xe')](/\s+/);return _0x163fc7['length']>0x1?_0x163fc7[_0x5d9b('0xf')]():'';}return'';}function getMails(_0x5c1d4d,_0x42e389){var _0x3766ff='';for(var _0x15e1cc=0x0;_0x15e1cc<_0x42e389[_0x5d9b('0x7')][_0x5d9b('0xc')];_0x15e1cc+=0x1){if(_0x42e389['value'][_0x15e1cc][_0x5d9b('0x8')]!==_0x5c1d4d){if(!_[_0x5d9b('0x10')](_0x3766ff)){_0x3766ff+=',';}_0x3766ff+=_0x42e389[_0x5d9b('0x7')][_0x15e1cc][_0x5d9b('0xa')]||_0x42e389[_0x5d9b('0x7')][_0x15e1cc]['address']||'';_0x3766ff+='\x20<';_0x3766ff+=_0x42e389[_0x5d9b('0x7')][_0x15e1cc][_0x5d9b('0x8')]?_0x42e389['value'][_0x15e1cc]['address']:_0x5d9b('0x11')+random[_0x5d9b('0x9')](0x6)+_0x5d9b('0x12');_0x3766ff+='>';}}return _0x3766ff;}function parseEmail(_0x568e4e,_0xac1f40,_0x3bb0ca){if(_0xac1f40['html']){var _0x888079=/)<[^<]*)*<\/script>/gi;while(_0x888079[_0x5d9b('0x13')](_0xac1f40[_0x5d9b('0x14')])){_0xac1f40['html']=_0xac1f40['html'][_0x5d9b('0x15')](_0x888079,'');}if(_0xac1f40[_0x5d9b('0x14')][_0x5d9b('0x16')](_0x5d9b('0x17'))){var _0x10028b=[];_0xac1f40['attachments'][_0x5d9b('0x18')](_0x32bd11=>{_0x10028b['push'](_0x32bd11[_0x5d9b('0x19')]);});var _0x45baa5=/]+>/g;var _0x227509=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x489565=_0xac1f40[_0x5d9b('0x14')]['replace'](_0x227509,_0x5d9b('0x1a'));var _0x400bc2=_0x489565['replace'](_0x45baa5,_0x5d9b('0x1b'));for(let _0x265bef=0x0;_0x265bef<_0x10028b['length'];_0x265bef++){var _0x263ee2=_0x400bc2[_0x5d9b('0x15')]('_IMG','\x20[Attachment:\x20'+_0x10028b[_0x265bef]+_0x5d9b('0x1c'));_0x400bc2=_0x263ee2;}_0xac1f40['html']=_0x400bc2;}_0x3bb0ca[_0x5d9b('0x1d')]=_0xac1f40['html'];}else{_0x3bb0ca['body']=_0xac1f40['textAsHtml'];}if(_0x3bb0ca[_0x5d9b('0x1d')]){_0x3bb0ca[_0x5d9b('0x1d')]=_0x3bb0ca[_0x5d9b('0x1d')][_0x5d9b('0x15')](/0x0){var _0x575fd9=['Auto-Submitted:\x20auto-replied',_0x5d9b('0x2f'),_0x5d9b('0x30')];for(var _0x2d4960=0x0;_0x2d4960<_0xac1f40[_0x5d9b('0x31')][_0x5d9b('0xc')];_0x2d4960++){var _0x53224b=_['indexOf'](_0x575fd9,_0xac1f40[_0x5d9b('0x31')][_0x2d4960][_0x5d9b('0x32')]);if(_0x53224b>=0x0){_0x3bb0ca['isAutoreply']=!![];}}}return _0x3bb0ca;}exports[_0x5d9b('0x33')]=function(_0x14182f,_0x4c61b2,_0x5cf22a){var _0x1642f0={'from':getAddress(_0x4c61b2[_0x5d9b('0x34')]),'firstName':getFirstName(_0x4c61b2[_0x5d9b('0x34')]),'lastName':getLastName(_0x4c61b2[_0x5d9b('0x34')]),'mapKey':_0x5d9b('0x21'),'message':{'from':getMails(_0x14182f[_0x5d9b('0x21')],_0x4c61b2[_0x5d9b('0x34')]),'to':_0x14182f['email'],'cc':'','subject':_0x4c61b2['subject']||'','messageId':_0x4c61b2[_0x5d9b('0x35')],'inReplyTo':_0x4c61b2[_0x5d9b('0x36')],'sentAt':moment(_0x4c61b2[_0x5d9b('0x37')])[_0x5d9b('0x28')](_0x5d9b('0x38')),'attach':![],'attachments':[]}};if(!_0x4c61b2[_0x5d9b('0x14')]&&!_0x4c61b2[_0x5d9b('0x39')]){var _0x122085=_[_0x5d9b('0x3a')](_0x4c61b2[_0x5d9b('0x23')],{'contentType':_0x5d9b('0x3b')});if(_0x122085[_0x5d9b('0xc')]){logger['info'](util[_0x5d9b('0x28')](_0x5d9b('0x3c'),_0x4c61b2[_0x5d9b('0x35')]));tnef[_0x5d9b('0x3d')](_[_0x5d9b('0x3e')](_0x122085)[_0x5d9b('0x2d')],function(_0xbdadf9,_0x1db900){if(_0x1db900){_0x4c61b2[_0x5d9b('0x14')]=_0x1db900[_0x5d9b('0x3f')]||_0x5d9b('0x40');if(_0x1db900[_0x5d9b('0x41')]){for(var _0x39c797=0x0;_0x39c797<_0x1db900[_0x5d9b('0x41')]['length'];_0x39c797++){var _0x55e64b=_0x1db900['Attachments'][_0x39c797];_0x1642f0[_0x5d9b('0x1f')][_0x5d9b('0x23')]['push']({'filename':_0x55e64b[_0x5d9b('0x42')],'content':Buffer[_0x5d9b('0x34')](_0x55e64b[_0x5d9b('0x43')])});}}}_0x5cf22a(parseEmail(_0x14182f,_0x4c61b2,_0x1642f0));});}else{_0x4c61b2[_0x5d9b('0x14')]=_0x5d9b('0x40');_0x5cf22a(parseEmail(_0x14182f,_0x4c61b2,_0x1642f0));}}else{_0x5cf22a(parseEmail(_0x14182f,_0x4c61b2,_0x1642f0));}};exports[_0x5d9b('0x44')]=function(_0x1e5e04){switch(_0x1e5e04){case _0x5d9b('0x45'):return _0x5d9b('0x46');case _0x5d9b('0x47'):return _0x5d9b('0x48');case _0x5d9b('0x49'):return _0x5d9b('0x4a');case _0x5d9b('0x4b'):return _0x5d9b('0x4c');}return'127.0.0.1';};exports['generateXOAuth2Token']=function(_0x25376b,_0x2ae7fb){var _0x3f9560=[_0x5d9b('0x4d')+(_0x2ae7fb||''),_0x5d9b('0x4e')+_0x25376b,'',''];return Buffer[_0x5d9b('0x34')](_0x3f9560[_0x5d9b('0xd')](''),'utf-8')[_0x5d9b('0x4f')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 1139aad..04975c2 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 _0xf062=['lodash','name','Service','key','SERV','active','Smtp','exports'];(function(_0x47e3e6,_0x270c04){var _0x324041=function(_0x5afee2){while(--_0x5afee2){_0x47e3e6['push'](_0x47e3e6['shift']());}};_0x324041(++_0x270c04);}(_0xf062,0x1d0));var _0x2f06=function(_0x6310b9,_0x352e0c){_0x6310b9=_0x6310b9-0x0;var _0x15847c=_0xf062[_0x6310b9];return _0x15847c;};'use strict';var _=require(_0x2f06('0x0'));function MailAccount(_0x3a5b7c){this['id']=_0x3a5b7c['id']||0x0;this[_0x2f06('0x1')]=_0x3a5b7c['name']||_0x2f06('0x2');this[_0x2f06('0x3')]=_0x3a5b7c[_0x2f06('0x3')]||_0x2f06('0x4');this[_0x2f06('0x5')]=_0x3a5b7c['active']||![];this['Imap']=_0x3a5b7c['Imap']||[];this[_0x2f06('0x6')]=_0x3a5b7c[_0x2f06('0x6')]||[];}module[_0x2f06('0x7')]=MailAccount; \ No newline at end of file +var _0x0a3c=['active','Imap','Smtp','exports','name','key'];(function(_0x17788a,_0x150887){var _0x33f47c=function(_0x120fcb){while(--_0x120fcb){_0x17788a['push'](_0x17788a['shift']());}};_0x33f47c(++_0x150887);}(_0x0a3c,0x136));var _0xc0a3=function(_0x3d644d,_0x13e459){_0x3d644d=_0x3d644d-0x0;var _0x369bca=_0x0a3c[_0x3d644d];return _0x369bca;};'use strict';var _=require('lodash');function MailAccount(_0x16fdfc){this['id']=_0x16fdfc['id']||0x0;this[_0xc0a3('0x0')]=_0x16fdfc['name']||'Service';this[_0xc0a3('0x1')]=_0x16fdfc[_0xc0a3('0x1')]||'SERV';this[_0xc0a3('0x2')]=_0x16fdfc[_0xc0a3('0x2')]||![];this['Imap']=_0x16fdfc[_0xc0a3('0x3')]||[];this[_0xc0a3('0x4')]=_0x16fdfc['Smtp']||[];}module[_0xc0a3('0x5')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 9d20777..49c4189 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 _0x367b=['isUndefined','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','length'];(function(_0x36a11b,_0x3f4260){var _0x327c0f=function(_0x1dbbbc){while(--_0x1dbbbc){_0x36a11b['push'](_0x36a11b['shift']());}};_0x327c0f(++_0x3f4260);}(_0x367b,0xb9));var _0xb367=function(_0x132b21,_0x59b703){_0x132b21=_0x132b21-0x0;var _0x26f0f7=_0x367b[_0x132b21];return _0x26f0f7;};'use strict';var _=require(_0xb367('0x0'));var MailAccount=require(_0xb367('0x1'));var Realtime=function(){this[_0xb367('0x2')]={};};function freeIsNotKey(_0x84d803,_0x5c4a63,_0x4d97c1){var _0x1e7f1a=_['mapKeys'](_0x84d803,function(_0x299fc2,_0x48639d){return _0x299fc2[_0x4d97c1];});for(var _0x3c1a18 in _0x5c4a63){if(_0x5c4a63[_0xb367('0x3')](_0x3c1a18)){if(!_0x1e7f1a[_0x3c1a18]){delete _0x5c4a63[_0x3c1a18];}}}}Realtime[_0xb367('0x4')][_0xb367('0x5')]=function(_0x2c7764,_0x175114){for(var _0x1478d4 in _0x175114){if(_0x2c7764[_0xb367('0x3')](_0x1478d4)){_0x2c7764[_0x1478d4]=_0x175114[_0x1478d4];}}};Realtime[_0xb367('0x4')]['initMailAccounts']=function(){var _0x29033b=this;return function(_0x113021){if(_0x113021){freeIsNotKey(_0x113021,_0x29033b[_0xb367('0x2')],'id');for(var _0x5223=0x0,_0x37772b={},_0xd9002b={};_0x5223<_0x113021[_0xb367('0x6')];_0x5223+=0x1){_0x37772b=_0x113021[_0x5223];if(_[_0xb367('0x7')](_0x29033b[_0xb367('0x2')][_0x37772b['id']])){_0x29033b['mailAccounts'][_0x37772b['id']]=new MailAccount(_0x37772b);}else{_['merge'](_0x29033b[_0xb367('0x2')][_0x37772b['id']],_0x37772b);}}}return _0x29033b[_0xb367('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5d7d=['length','isUndefined','merge','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x3a8935,_0x170fa){var _0x1cfdfe=function(_0x8a30e7){while(--_0x8a30e7){_0x3a8935['push'](_0x3a8935['shift']());}};_0x1cfdfe(++_0x170fa);}(_0x5d7d,0x1f2));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xd5d7('0x0')]={};};function freeIsNotKey(_0x1e817c,_0x379610,_0xc90283){var _0x81f987=_[_0xd5d7('0x1')](_0x1e817c,function(_0x6490fb,_0x3a90fc){return _0x6490fb[_0xc90283];});for(var _0x47d4cd in _0x379610){if(_0x379610[_0xd5d7('0x2')](_0x47d4cd)){if(!_0x81f987[_0x47d4cd]){delete _0x379610[_0x47d4cd];}}}}Realtime[_0xd5d7('0x3')][_0xd5d7('0x4')]=function(_0x1bddd6,_0x416e7c){for(var _0x54c7ac in _0x416e7c){if(_0x1bddd6[_0xd5d7('0x2')](_0x54c7ac)){_0x1bddd6[_0x54c7ac]=_0x416e7c[_0x54c7ac];}}};Realtime[_0xd5d7('0x3')][_0xd5d7('0x5')]=function(){var _0x4ac09a=this;return function(_0x1a58d4){if(_0x1a58d4){freeIsNotKey(_0x1a58d4,_0x4ac09a[_0xd5d7('0x0')],'id');for(var _0xaabc5a=0x0,_0x471e1a={},_0x16e973={};_0xaabc5a<_0x1a58d4[_0xd5d7('0x6')];_0xaabc5a+=0x1){_0x471e1a=_0x1a58d4[_0xaabc5a];if(_[_0xd5d7('0x7')](_0x4ac09a[_0xd5d7('0x0')][_0x471e1a['id']])){_0x4ac09a[_0xd5d7('0x0')][_0x471e1a['id']]=new MailAccount(_0x471e1a);}else{_[_0xd5d7('0x8')](_0x4ac09a[_0xd5d7('0x0')][_0x471e1a['id']],_0x471e1a);}}}return _0x4ac09a[_0xd5d7('0x0')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 684d71f..6c1bbcf 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 _0x9303=['TemplateId','Imap','service','type','data5','CloudProvider','MailServerOut','name','getMailAccount','notify','NotifyMailAccount','../client','GetMailAccount','provider','active','key','ListId'];(function(_0x456290,_0x27e86c){var _0x169e83=function(_0x31d5ef){while(--_0x31d5ef){_0x456290['push'](_0x456290['shift']());}};_0x169e83(++_0x27e86c);}(_0x9303,0xd7));var _0x3930=function(_0x16d578,_0x3cbca3){_0x16d578=_0x16d578-0x0;var _0x3c0177=_0x9303[_0x16d578];return _0x3c0177;};'use strict';var client=require(_0x3930('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x3930('0x1'),{'options':{'attributes':['id','name',_0x3930('0x2'),'service','email',_0x3930('0x3'),_0x3930('0x4'),_0x3930('0x5'),_0x3930('0x6')],'raw':![],'include':[{'model':'MailServerIn','as':_0x3930('0x7'),'include':[{'model':'CloudProvider','attributes':['id','name',_0x3930('0x8'),_0x3930('0x9'),_0x3930('0xa')],'as':_0x3930('0xb')}]},{'model':_0x3930('0xc'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x3930('0xd'),'service','type','data5'],'as':_0x3930('0xb')}]}]},'log':_0x3930('0xe')});};};exports[_0x3930('0xf')]=function(_0x272eb5,_0x161c1e){return client['Request'](_0x3930('0x10'),{'account':{'id':_0x272eb5},'body':_0x161c1e,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x9c57=['data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type'];(function(_0x523222,_0xb528d){var _0x26b6cd=function(_0x4f548f){while(--_0x4f548f){_0x523222['push'](_0x523222['shift']());}};_0x26b6cd(++_0xb528d);}(_0x9c57,0x99));var _0x79c5=function(_0x5c2d7b,_0x4918c5){_0x5c2d7b=_0x5c2d7b-0x0;var _0x27e5f6=_0x9c57[_0x5c2d7b];return _0x27e5f6;};'use strict';var client=require(_0x79c5('0x0'));exports[_0x79c5('0x1')]=function(){return function(){return client[_0x79c5('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x79c5('0x3'),_0x79c5('0x4'),_0x79c5('0x5'),_0x79c5('0x6'),_0x79c5('0x7'),_0x79c5('0x8'),_0x79c5('0x9'),_0x79c5('0xa')],'raw':![],'include':[{'model':_0x79c5('0xb'),'as':_0x79c5('0xc'),'include':[{'model':_0x79c5('0xd'),'attributes':['id',_0x79c5('0x3'),_0x79c5('0x5'),_0x79c5('0xe'),_0x79c5('0xf')],'as':_0x79c5('0xd')}]},{'model':_0x79c5('0x10'),'as':_0x79c5('0x11'),'include':[{'model':_0x79c5('0xd'),'attributes':['id',_0x79c5('0x3'),_0x79c5('0x5'),_0x79c5('0xe'),_0x79c5('0xf')],'as':_0x79c5('0xd')}]}]},'log':_0x79c5('0x12')});};};exports[_0x79c5('0x13')]=function(_0x8f8505,_0x177a82){return client[_0x79c5('0x2')](_0x79c5('0x14'),{'account':{'id':_0x8f8505},'body':_0x177a82,'log':_0x79c5('0x14')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 0a00fa1..f6efeca 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 _0x76e0=['../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x58b250,_0x210a75){var _0x2ad6d6=function(_0xfbc855){while(--_0xfbc855){_0x58b250['push'](_0x58b250['shift']());}};_0x2ad6d6(++_0x210a75);}(_0x76e0,0x177));var _0x076e=function(_0x2a2211,_0x90f68f){_0x2a2211=_0x2a2211-0x0;var _0x57e663=_0x76e0[_0x2a2211];return _0x57e663;};'use strict';var client=require(_0x076e('0x0'));exports[_0x076e('0x1')]=function(){return client[_0x076e('0x2')](_0x076e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x076e('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xab4b=['ShowSetting','loginMailFrequency','getSettings','Request'];(function(_0x33424e,_0x119b2b){var _0x4ae9ab=function(_0x41085a){while(--_0x41085a){_0x33424e['push'](_0x33424e['shift']());}};_0x4ae9ab(++_0x119b2b);}(_0xab4b,0x15e));var _0xbab4=function(_0x2d719c,_0x59b346){_0x2d719c=_0x2d719c-0x0;var _0x16c7e8=_0xab4b[_0x2d719c];return _0x16c7e8;};'use strict';var client=require('../client');exports[_0xbab4('0x0')]=function(){return client[_0xbab4('0x1')](_0xbab4('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xbab4('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 6ce6f7e..778a731 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 1244872..891a1cb 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 _0x8efb=['polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port'];(function(_0xf06d43,_0x292b43){var _0x57283b=function(_0x20d298){while(--_0x20d298){_0xf06d43['push'](_0xf06d43['shift']());}};_0x57283b(++_0x292b43);}(_0x8efb,0x1ad));var _0xb8ef=function(_0x519e83,_0x2879eb){_0x519e83=_0x519e83-0x0;var _0x40dd98=_0x8efb[_0x519e83];return _0x40dd98;};'use strict';var _=require(_0xb8ef('0x0'));var http=require('http');var express=require(_0xb8ef('0x1'));var sticky=require(_0xb8ef('0x2'));var Redis=require(_0xb8ef('0x3'));var config=require(_0xb8ef('0x4'));var app=express();var server=http[_0xb8ef('0x5')](app);server[_0xb8ef('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xb8ef('0x7')])){var socketio=require('socket.io')(server,{'transports':['websocket',_0xb8ef('0x8')]});config[_0xb8ef('0x9')]=_['defaults'](config[_0xb8ef('0x9')],{'host':_0xb8ef('0xa'),'port':0x18eb});socketio[_0xb8ef('0xb')](require(_0xb8ef('0xc'))({'pubClient':new Redis(config[_0xb8ef('0x9')]),'subClient':new Redis(config['redis'])}));require(_0xb8ef('0xd'))['default']();require(_0xb8ef('0xe'))[_0xb8ef('0xf')](socketio);require(_0xb8ef('0x10'))['default'](app);require(_0xb8ef('0x11'))[_0xb8ef('0xf')](app);}else{server[_0xb8ef('0x12')](_0xb8ef('0x13'),function(){console[_0xb8ef('0x14')](_0xb8ef('0x15'),config[_0xb8ef('0x7')]);});}exports=module[_0xb8ef('0x16')]=app; \ No newline at end of file +var _0x7983=['sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','express'];(function(_0x108831,_0x5e4f70){var _0x4da77a=function(_0x139446){while(--_0x139446){_0x108831['push'](_0x108831['shift']());}};_0x4da77a(++_0x5e4f70);}(_0x7983,0x18e));var _0x3798=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7983[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x3798('0x0'));var http=require('http');var express=require(_0x3798('0x1'));var sticky=require(_0x3798('0x2'));var Redis=require(_0x3798('0x3'));var config=require(_0x3798('0x4'));var app=express();var server=http[_0x3798('0x5')](app);server[_0x3798('0x6')]=0xdbba0;if(sticky[_0x3798('0x7')](server,config[_0x3798('0x8')])){var socketio=require(_0x3798('0x9'))(server,{'transports':[_0x3798('0xa'),'polling']});config[_0x3798('0xb')]=_[_0x3798('0xc')](config['redis'],{'host':_0x3798('0xd'),'port':0x18eb});socketio[_0x3798('0xe')](require(_0x3798('0xf'))({'pubClient':new Redis(config[_0x3798('0xb')]),'subClient':new Redis(config[_0x3798('0xb')])}));require(_0x3798('0x10'))[_0x3798('0x11')]();require(_0x3798('0x12'))[_0x3798('0x11')](socketio);require(_0x3798('0x13'))[_0x3798('0x11')](app);require(_0x3798('0x14'))[_0x3798('0x11')](app);}else{server[_0x3798('0x15')](_0x3798('0x16'),function(){console[_0x3798('0x17')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x3798('0x8')]);});}exports=module[_0x3798('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 24e4438..150b817 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 _0x389f=['message','result','catch','exports','jayson/promise','bluebird','routing','Request','request','debug','error','rpc'];(function(_0x1da448,_0x565a9f){var _0xdb7a13=function(_0x48bfc7){while(--_0x48bfc7){_0x1da448['push'](_0x1da448['shift']());}};_0xdb7a13(++_0x565a9f);}(_0x389f,0x1d8));var _0xf389=function(_0x393ebf,_0x449e5a){_0x393ebf=_0x393ebf-0x0;var _0x5808c2=_0x389f[_0x393ebf];return _0x5808c2;};'use strict';var jayson=require(_0xf389('0x0'));var BPromise=require(_0xf389('0x1'));var logger=require('../../config/logger')(_0xf389('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0xf389('0x3')]=function(_0x5cb5b6,_0x3ffaea){return new BPromise(function(_0x5a13af,_0x3f173e){return client[_0xf389('0x4')](_0x5cb5b6,_0x3ffaea)['then'](function(_0x3bae4b){logger[_0xf389('0x5')]('rpc',_0xf389('0x2'),_0x5cb5b6,_0x3ffaea,_0x3bae4b);if(_0x3bae4b[_0xf389('0x6')]){logger[_0xf389('0x6')](_0xf389('0x7'),_0xf389('0x2'),_0x5cb5b6,_0x3bae4b[_0xf389('0x6')]['message'],_0x3ffaea);return _0x3f173e(_0x3bae4b[_0xf389('0x6')][_0xf389('0x8')]);}else{return _0x5a13af(_0x3bae4b[_0xf389('0x9')]);}})[_0xf389('0xa')](function(_0x1673c6){logger[_0xf389('0x6')](_0xf389('0x7'),_0xf389('0x2'),_0x5cb5b6,_0x1673c6,_0x3ffaea);return _0x3f173e(_0x1673c6);});});};module[_0xf389('0xb')]=client; \ No newline at end of file +var _0x2a9c=['rpc','message','result','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2a9c,0x11b));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xc2a9('0x0'));var BPromise=require(_0xc2a9('0x1'));var logger=require(_0xc2a9('0x2'))(_0xc2a9('0x3'));var client=jayson[_0xc2a9('0x4')][_0xc2a9('0x5')]({'port':0x2329});client[_0xc2a9('0x6')]=function(_0x221442,_0x27e363){return new BPromise(function(_0x19e620,_0x5407a2){return client[_0xc2a9('0x7')](_0x221442,_0x27e363)[_0xc2a9('0x8')](function(_0x477dac){logger[_0xc2a9('0x9')]('rpc',_0xc2a9('0x3'),_0x221442,_0x27e363,_0x477dac);if(_0x477dac[_0xc2a9('0xa')]){logger[_0xc2a9('0xa')](_0xc2a9('0xb'),_0xc2a9('0x3'),_0x221442,_0x477dac['error'][_0xc2a9('0xc')],_0x27e363);return _0x5407a2(_0x477dac[_0xc2a9('0xa')]['message']);}else{return _0x19e620(_0x477dac[_0xc2a9('0xd')]);}})['catch'](function(_0x76982){logger[_0xc2a9('0xa')](_0xc2a9('0xb'),_0xc2a9('0x3'),_0x221442,_0x76982,_0x27e363);return _0x5407a2(_0x76982);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index eda8270..40b127c 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 _0x27dc=['./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initOpenchannelQueues','getSmsQueues','initSmsQueues','initMailQueues','initWhatsappQueues','listen','log','bluebird'];(function(_0x5c8546,_0x30b36e){var _0xf655f0=function(_0x3510ea){while(--_0x3510ea){_0x5c8546['push'](_0x5c8546['shift']());}};_0xf655f0(++_0x30b36e);}(_0x27dc,0xdb));var _0xc27d=function(_0xf40ce5,_0x419f0b){_0xf40ce5=_0xf40ce5-0x0;var _0x461e04=_0x27dc[_0xf40ce5];return _0x461e04;};'use strict';var BPromise=require(_0xc27d('0x0'));var server=require(_0xc27d('0x1'));var Realtime=require(_0xc27d('0x2'));var user=require('./rpc/user');var interval=require(_0xc27d('0x3'));var openchannelQueue=require(_0xc27d('0x4'));var chatQueue=require(_0xc27d('0x5'));var smsQueue=require(_0xc27d('0x6'));var mailQueue=require(_0xc27d('0x7'));var faxQueue=require(_0xc27d('0x8'));var whatsappQueue=require(_0xc27d('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc27d('0xa')]()[_0xc27d('0xb')](user[_0xc27d('0xc')]())['then'](realtime[_0xc27d('0xd')]())[_0xc27d('0xb')](interval[_0xc27d('0xe')]())[_0xc27d('0xb')](realtime['initIntervals']())[_0xc27d('0xb')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0xc27d('0xf')]())[_0xc27d('0xb')](chatQueue['getChatQueues']())[_0xc27d('0xb')](realtime['initChatQueues']())['then'](smsQueue[_0xc27d('0x10')]())[_0xc27d('0xb')](realtime[_0xc27d('0x11')]())[_0xc27d('0xb')](mailQueue['getMailQueues']())[_0xc27d('0xb')](realtime[_0xc27d('0x12')]())[_0xc27d('0xb')](faxQueue['getFaxQueues']())[_0xc27d('0xb')](realtime['initFaxQueues']())[_0xc27d('0xb')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xc27d('0x13')]())[_0xc27d('0xb')](function(){return realtime;});}function main(){return server[_0xc27d('0x14')](realtime)['then'](function(_0x1eade5){return initRealtime();})[_0xc27d('0xb')](function(_0x397bb7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2a4576){console[_0xc27d('0x15')](_0x2a4576);});}main(); \ No newline at end of file +var _0x65b7=['./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','bluebird'];(function(_0x29da6a,_0x8328b9){var _0x5d1295=function(_0x24ad9e){while(--_0x24ad9e){_0x29da6a['push'](_0x29da6a['shift']());}};_0x5d1295(++_0x8328b9);}(_0x65b7,0x1b2));var _0x765b=function(_0x1a3084,_0x1f2db9){_0x1a3084=_0x1a3084-0x0;var _0x57e3d1=_0x65b7[_0x1a3084];return _0x57e3d1;};'use strict';var BPromise=require(_0x765b('0x0'));var server=require(_0x765b('0x1'));var Realtime=require(_0x765b('0x2'));var user=require(_0x765b('0x3'));var interval=require(_0x765b('0x4'));var openchannelQueue=require(_0x765b('0x5'));var chatQueue=require(_0x765b('0x6'));var smsQueue=require(_0x765b('0x7'));var mailQueue=require(_0x765b('0x8'));var faxQueue=require(_0x765b('0x9'));var whatsappQueue=require(_0x765b('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x765b('0xb')]()['then'](user[_0x765b('0xc')]())[_0x765b('0xd')](realtime[_0x765b('0xe')]())[_0x765b('0xd')](interval[_0x765b('0xf')]())[_0x765b('0xd')](realtime[_0x765b('0x10')]())[_0x765b('0xd')](openchannelQueue[_0x765b('0x11')]())[_0x765b('0xd')](realtime[_0x765b('0x12')]())[_0x765b('0xd')](chatQueue[_0x765b('0x13')]())[_0x765b('0xd')](realtime[_0x765b('0x14')]())['then'](smsQueue[_0x765b('0x15')]())[_0x765b('0xd')](realtime['initSmsQueues']())[_0x765b('0xd')](mailQueue[_0x765b('0x16')]())['then'](realtime[_0x765b('0x17')]())[_0x765b('0xd')](faxQueue[_0x765b('0x18')]())[_0x765b('0xd')](realtime[_0x765b('0x19')]())[_0x765b('0xd')](whatsappQueue[_0x765b('0x1a')]())[_0x765b('0xd')](realtime['initWhatsappQueues']())[_0x765b('0xd')](function(){return realtime;});}function main(){return server[_0x765b('0x1b')](realtime)[_0x765b('0xd')](function(_0x4a3bea){return initRealtime();})[_0x765b('0xd')](function(_0x416cef){return setInterval(initRealtime,0x1388);})[_0x765b('0x1c')](function(_0x2ab0e8){console['log'](_0x2ab0e8);});}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 cde50b6..5a7e27d 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x1771be,_0x2f8b1d){var _0x4c684a=function(_0x445043){while(--_0x445043){_0x1771be['push'](_0x1771be['shift']());}};_0x4c684a(++_0x2f8b1d);}(_0xe14b,0x93));var _0xbe14=function(_0x2feda6,_0x492e8f){_0x2feda6=_0x2feda6-0x0;var _0x220f37=_0xe14b[_0x2feda6];return _0x220f37;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x215da6,_0x38b200){var _0xfb0853=function(_0x1ab8ba){while(--_0x1ab8ba){_0x215da6['push'](_0x215da6['shift']());}};_0xfb0853(++_0x38b200);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1d7cf58..c0d8be8 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 _0x7e3a=['error','result','catch','sendMailMessage','SendMail','jayson/promise','client','request'];(function(_0x19b35e,_0x170c6a){var _0x25e655=function(_0x2b60c0){while(--_0x2b60c0){_0x19b35e['push'](_0x19b35e['shift']());}};_0x25e655(++_0x170c6a);}(_0x7e3a,0x105));var _0xa7e3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7e3a[_0x397e5f];return _0x5302b8;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa7e3('0x0'));var client=jayson[_0xa7e3('0x1')]['http']({'port':0x232b});function request(_0x3922a2,_0x457b15){return new BPromise(function(_0x212a67,_0x28f6df){return client[_0xa7e3('0x2')](_0x3922a2,_0x457b15)['then'](function(_0x2980dd){if(_0x2980dd[_0xa7e3('0x3')]){return _0x28f6df(_0x2980dd[_0xa7e3('0x3')]['message']);}else{return _0x212a67(_0x2980dd[_0xa7e3('0x4')]);}})[_0xa7e3('0x5')](function(_0x54d559){return _0x28f6df(_0x54d559);});});}exports[_0xa7e3('0x6')]=function(_0x2e7c3f,_0xb09d60){return request(_0xa7e3('0x7'),{'account':_0x2e7c3f,'message':_0xb09d60});}; \ No newline at end of file +var _0xa623=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x38ae9c,_0x29a447){var _0x265a50=function(_0x272629){while(--_0x272629){_0x38ae9c['push'](_0x38ae9c['shift']());}};_0x265a50(++_0x29a447);}(_0xa623,0x12c));var _0x3a62=function(_0x315143,_0x8dde2f){_0x315143=_0x315143-0x0;var _0x11966a=_0xa623[_0x315143];return _0x11966a;};'use strict';var BPromise=require(_0x3a62('0x0'));var jayson=require(_0x3a62('0x1'));var client=jayson[_0x3a62('0x2')][_0x3a62('0x3')]({'port':0x232b});function request(_0x4dec59,_0xff6803){return new BPromise(function(_0x76df52,_0x1cdd16){return client['request'](_0x4dec59,_0xff6803)['then'](function(_0x3a0ea6){if(_0x3a0ea6['error']){return _0x1cdd16(_0x3a0ea6['error']['message']);}else{return _0x76df52(_0x3a0ea6[_0x3a62('0x4')]);}})[_0x3a62('0x5')](function(_0x4f9aed){return _0x1cdd16(_0x4f9aed);});});}exports[_0x3a62('0x6')]=function(_0x3b85bc,_0x208221){return request(_0x3a62('0x7'),{'account':_0x3b85bc,'message':_0x208221});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6b80a58..645f713 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 _0x36bc=['busy','stringify','emit','user:save','exports','lodash','moment','ioredis','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','prototype','mail','chat','openchannel','fax','sms','length','Status','toNumber','format','chatCurrentCapacity','faxStatus','openchannelCurrentCapacity'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x36bc,0xf5));var _0xc36b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x36bc[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xc36b('0x0'));var moment=require(_0xc36b('0x1'));var md5=require('md5');var Redis=require(_0xc36b('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xc36b('0x3')],{'host':_0xc36b('0x4'),'port':0x18eb});var io=require(_0xc36b('0x5'))(new Redis(config[_0xc36b('0x3')]));function Agent(_0x313447){this['id']=_0x313447['id']||0x0;this[_0xc36b('0x6')]=_0x313447['name']||'';this[_0xc36b('0x7')]=_0x313447[_0xc36b('0x7')]||!![];this[_0xc36b('0x8')]=_0x313447[_0xc36b('0x8')]||![];this[_0xc36b('0x9')]=_0x313447['chatPause']||![];this[_0xc36b('0xa')]=_0x313447['mailPause']||![];this[_0xc36b('0xb')]=_0x313447[_0xc36b('0xb')]||![];this[_0xc36b('0xc')]=_0x313447[_0xc36b('0xc')]||![];this[_0xc36b('0xd')]=_0x313447[_0xc36b('0xd')]||![];this['chatStatus']=_0xc36b('0xe');this[_0xc36b('0xf')]=0x0;this['chatCapacity']=_0x313447[_0xc36b('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xc36b('0x11')]=_0xc36b('0xe');this[_0xc36b('0x12')]=0x0;this[_0xc36b('0x13')]=_0x313447[_0xc36b('0x13')]||0x0;this[_0xc36b('0x14')]=0x0;this['faxStatus']=_0xc36b('0xe');this[_0xc36b('0x15')]=0x0;this[_0xc36b('0x16')]=_0x313447[_0xc36b('0x16')]||0x0;this[_0xc36b('0x17')]=0x0;this[_0xc36b('0x18')]='unknown';this[_0xc36b('0x19')]=0x0;this[_0xc36b('0x1a')]=_0x313447['smsCapacity']||0x0;this[_0xc36b('0x1b')]=0x0;this[_0xc36b('0x1c')]=_0xc36b('0xe');this[_0xc36b('0x1d')]=0x0;this[_0xc36b('0x1e')]=_0x313447[_0xc36b('0x1e')]||0x0;this[_0xc36b('0x1f')]=0x0;this[_0xc36b('0x20')]=_0xc36b('0xe');this[_0xc36b('0x21')]=0x0;this['openchannelCapacity']=_0x313447[_0xc36b('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0xc36b('0x23')]=undefined;this[_0xc36b('0x24')]='';this[_0xc36b('0x25')]();}Agent['prototype'][_0xc36b('0x26')]=function(_0x50be47){if(this[_0x50be47+_0xc36b('0x27')]>0x0){if(this[_0x50be47+_0xc36b('0x28')]>0x0&&this[_0x50be47+_0xc36b('0x27')]>=this[_0x50be47+_0xc36b('0x28')]){return _0xc36b('0x29');}else{return'working';}}else{return'idle';}};Agent[_0xc36b('0x2a')]['updateRealtime']=function(){var _0x1338f4=[_0xc36b('0x2b'),_0xc36b('0x2c'),_0xc36b('0x2d'),_0xc36b('0x2e'),_0xc36b('0x2f'),'whatsapp'];for(var _0x3148c4=0x0;_0x3148c4<_0x1338f4[_0xc36b('0x30')];_0x3148c4+=0x1){var _0x65c99d=this[_0xc36b('0x26')](_0x1338f4[_0x3148c4]);if(this[_0x1338f4[_0x3148c4]+_0xc36b('0x31')]!==_0x65c99d){this[_0x1338f4[_0x3148c4]+'StatusTime']=_[_0xc36b('0x32')](moment()[_0xc36b('0x33')]('x'));}this[_0x1338f4[_0x3148c4]+_0xc36b('0x31')]=_0x65c99d;}var _0x9c8429={'id':this['id'],'name':this[_0xc36b('0x6')],'online':this[_0xc36b('0x7')],'voicePause':this[_0xc36b('0x8')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0xc36b('0xc')],'faxPause':this[_0xc36b('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xc36b('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xc36b('0x34')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xc36b('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xc36b('0x35')],'faxStatusTime':this[_0xc36b('0x15')],'faxCapacity':this[_0xc36b('0x16')],'faxCurrentCapacity':this[_0xc36b('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xc36b('0x19')],'smsCapacity':this[_0xc36b('0x1a')],'smsCurrentCapacity':this[_0xc36b('0x1b')],'whatsappStatus':this[_0xc36b('0x1c')],'whatsappStatusTime':this[_0xc36b('0x1d')],'whatsappCapacity':this[_0xc36b('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xc36b('0x20')],'openchannelStatusTime':this[_0xc36b('0x21')],'openchannelCapacity':this[_0xc36b('0x22')],'openchannelCurrentCapacity':this[_0xc36b('0x36')],'busy':this[_0xc36b('0x37')],'busyQueue':this['busyQueue']};var _0x51d7bc=md5(JSON[_0xc36b('0x38')](_0x9c8429));if(this[_0xc36b('0x24')]!==_0x51d7bc){this[_0xc36b('0x24')]=_0x51d7bc;io[_0xc36b('0x39')](_0xc36b('0x3a'),_0x9c8429);}};module[_0xc36b('0x3b')]=Agent; \ No newline at end of file +var _0x0f6c=['openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','openchannel','sms','whatsapp','length','StatusTime','toNumber','format','mailStatusTime','faxStatus','faxStatusTime','openchannelStatus','openchannelStatusTime','stringify','emit','user:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause'];(function(_0x2ce05,_0x306b52){var _0x1c6341=function(_0x512eca){while(--_0x512eca){_0x2ce05['push'](_0x2ce05['shift']());}};_0x1c6341(++_0x306b52);}(_0x0f6c,0xe1));var _0xc0f6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0f6c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc0f6('0x0'));var moment=require('moment');var md5=require(_0xc0f6('0x1'));var Redis=require(_0xc0f6('0x2'));var config=require(_0xc0f6('0x3'));config[_0xc0f6('0x4')]=_[_0xc0f6('0x5')](config[_0xc0f6('0x4')],{'host':_0xc0f6('0x6'),'port':0x18eb});var io=require(_0xc0f6('0x7'))(new Redis(config[_0xc0f6('0x4')]));function Agent(_0x464dba){this['id']=_0x464dba['id']||0x0;this['name']=_0x464dba[_0xc0f6('0x8')]||'';this[_0xc0f6('0x9')]=_0x464dba['online']||!![];this[_0xc0f6('0xa')]=_0x464dba[_0xc0f6('0xa')]||![];this[_0xc0f6('0xb')]=_0x464dba['chatPause']||![];this['mailPause']=_0x464dba[_0xc0f6('0xc')]||![];this[_0xc0f6('0xd')]=_0x464dba[_0xc0f6('0xd')]||![];this[_0xc0f6('0xe')]=_0x464dba['smsPause']||![];this[_0xc0f6('0xf')]=_0x464dba['openchannelPause']||![];this[_0xc0f6('0x10')]='unknown';this[_0xc0f6('0x11')]=0x0;this[_0xc0f6('0x12')]=_0x464dba[_0xc0f6('0x12')]||0x0;this[_0xc0f6('0x13')]=0x0;this[_0xc0f6('0x14')]=_0xc0f6('0x15');this['mailStatusTime']=0x0;this['mailCapacity']=_0x464dba[_0xc0f6('0x16')]||0x0;this[_0xc0f6('0x17')]=0x0;this['faxStatus']=_0xc0f6('0x15');this['faxStatusTime']=0x0;this[_0xc0f6('0x18')]=_0x464dba[_0xc0f6('0x18')]||0x0;this[_0xc0f6('0x19')]=0x0;this[_0xc0f6('0x1a')]='unknown';this['smsStatusTime']=0x0;this[_0xc0f6('0x1b')]=_0x464dba[_0xc0f6('0x1b')]||0x0;this[_0xc0f6('0x1c')]=0x0;this[_0xc0f6('0x1d')]=_0xc0f6('0x15');this[_0xc0f6('0x1e')]=0x0;this[_0xc0f6('0x1f')]=_0x464dba[_0xc0f6('0x1f')]||0x0;this[_0xc0f6('0x20')]=0x0;this['openchannelStatus']=_0xc0f6('0x15');this['openchannelStatusTime']=0x0;this[_0xc0f6('0x21')]=_0x464dba['openchannelCapacity']||0x0;this[_0xc0f6('0x22')]=0x0;this[_0xc0f6('0x23')]=![];this[_0xc0f6('0x24')]=undefined;this[_0xc0f6('0x1')]='';this[_0xc0f6('0x25')]();}Agent[_0xc0f6('0x26')][_0xc0f6('0x27')]=function(_0x55956d){if(this[_0x55956d+_0xc0f6('0x28')]>0x0){if(this[_0x55956d+_0xc0f6('0x29')]>0x0&&this[_0x55956d+_0xc0f6('0x28')]>=this[_0x55956d+_0xc0f6('0x29')]){return'maxcapacity';}else{return _0xc0f6('0x2a');}}else{return'idle';}};Agent[_0xc0f6('0x26')][_0xc0f6('0x25')]=function(){var _0x10850e=[_0xc0f6('0x2b'),_0xc0f6('0x2c'),_0xc0f6('0x2d'),'fax',_0xc0f6('0x2e'),_0xc0f6('0x2f')];for(var _0x1421b0=0x0;_0x1421b0<_0x10850e[_0xc0f6('0x30')];_0x1421b0+=0x1){var _0x51a49d=this[_0xc0f6('0x27')](_0x10850e[_0x1421b0]);if(this[_0x10850e[_0x1421b0]+'Status']!==_0x51a49d){this[_0x10850e[_0x1421b0]+_0xc0f6('0x31')]=_[_0xc0f6('0x32')](moment()[_0xc0f6('0x33')]('x'));}this[_0x10850e[_0x1421b0]+'Status']=_0x51a49d;}var _0x4c4d88={'id':this['id'],'name':this[_0xc0f6('0x8')],'online':this[_0xc0f6('0x9')],'voicePause':this[_0xc0f6('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0xc0f6('0xc')],'smsPause':this[_0xc0f6('0xe')],'faxPause':this[_0xc0f6('0xd')],'openchannelPause':this[_0xc0f6('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xc0f6('0x11')],'chatCapacity':this[_0xc0f6('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xc0f6('0x14')],'mailStatusTime':this[_0xc0f6('0x34')],'mailCapacity':this[_0xc0f6('0x16')],'mailCurrentCapacity':this[_0xc0f6('0x17')],'faxStatus':this[_0xc0f6('0x35')],'faxStatusTime':this[_0xc0f6('0x36')],'faxCapacity':this[_0xc0f6('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xc0f6('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xc0f6('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xc0f6('0x1d')],'whatsappStatusTime':this[_0xc0f6('0x1e')],'whatsappCapacity':this[_0xc0f6('0x1f')],'whatsappCurrentCapacity':this[_0xc0f6('0x20')],'openchannelStatus':this[_0xc0f6('0x37')],'openchannelStatusTime':this[_0xc0f6('0x38')],'openchannelCapacity':this[_0xc0f6('0x21')],'openchannelCurrentCapacity':this[_0xc0f6('0x22')],'busy':this['busy'],'busyQueue':this[_0xc0f6('0x24')]};var _0x13a7d7=md5(JSON[_0xc0f6('0x39')](_0x4c4d88));if(this[_0xc0f6('0x1')]!==_0x13a7d7){this[_0xc0f6('0x1')]=_0x13a7d7;io[_0xc0f6('0x3a')](_0xc0f6('0x3b'),_0x4c4d88);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 882863b..35c67f8 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 _0x8773=['mapAgentsId','waiting','updateRouting','prototype','map','_rr','loggedIn','paused','chatPause','available','format','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8773,0x17b));var _0x3877=function(_0x435909,_0x30d85a){_0x435909=_0x435909-0x0;var _0x957660=_0x8773[_0x435909];return _0x957660;};'use strict';var _=require(_0x3877('0x0'));var md5=require(_0x3877('0x1'));var util=require('util');var Redis=require(_0x3877('0x2'));var config=require(_0x3877('0x3'));config[_0x3877('0x4')]=_['defaults'](config['redis'],{'host':_0x3877('0x5'),'port':0x18eb});var io=require(_0x3877('0x6'))(new Redis(config[_0x3877('0x4')]));function ChatQueue(_0x474eb7){this['id']=_0x474eb7['id']||0x0;this['name']=_0x474eb7[_0x3877('0x7')]||'';this[_0x3877('0x8')]=_0x474eb7[_0x3877('0x8')]||0xa;this[_0x3877('0x9')]=_0x474eb7[_0x3877('0x9')]||_0x3877('0xa');this[_0x3877('0xb')]=_0x474eb7['Agents'];this[_0x3877('0xc')]={};this[_0x3877('0xd')]=0x0;this['md5']='';this[_0x3877('0xe')]();this['updateRealtime']();}ChatQueue[_0x3877('0xf')][_0x3877('0xe')]=function(){var _0x2b103c=this[_0x3877('0xc')]['_rr'];this[_0x3877('0xc')]=_[_0x3877('0x10')](this[_0x3877('0xb')],'id');this[_0x3877('0xc')][_0x3877('0x11')]=_0x2b103c;};ChatQueue[_0x3877('0xf')]['updateRealtime']=function(){this[_0x3877('0x12')]=0x0;this[_0x3877('0x13')]=0x0;for(var _0x2426c0=0x0;_0x2426c0=0x0?this[_0x3877('0x15')]:0x0;var _0x313df9={'id':this['id'],'available':this[_0x3877('0x15')],'loggedIn':this[_0x3877('0x12')],'name':this[_0x3877('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x176cac=md5(JSON['stringify'](_0x313df9));if(this[_0x3877('0x1')]!==_0x176cac){this['md5']=_0x176cac;io['to'](util[_0x3877('0x16')]('chat:queue:%s',_0x313df9['name']))['emit']('chat_queue:save',_0x313df9);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x3797=['online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length'];(function(_0x289837,_0x492605){var _0x243004=function(_0x548f3f){while(--_0x548f3f){_0x289837['push'](_0x289837['shift']());}};_0x243004(++_0x492605);}(_0x3797,0xc2));var _0x7379=function(_0x55cec3,_0x2babdc){_0x55cec3=_0x55cec3-0x0;var _0x1e8a4a=_0x3797[_0x55cec3];return _0x1e8a4a;};'use strict';var _=require(_0x7379('0x0'));var md5=require('md5');var util=require(_0x7379('0x1'));var Redis=require(_0x7379('0x2'));var config=require(_0x7379('0x3'));config['redis']=_[_0x7379('0x4')](config[_0x7379('0x5')],{'host':_0x7379('0x6'),'port':0x18eb});var io=require(_0x7379('0x7'))(new Redis(config[_0x7379('0x5')]));function ChatQueue(_0x517735){this['id']=_0x517735['id']||0x0;this['name']=_0x517735[_0x7379('0x8')]||'';this[_0x7379('0x9')]=_0x517735[_0x7379('0x9')]||0xa;this[_0x7379('0xa')]=_0x517735[_0x7379('0xa')]||_0x7379('0xb');this[_0x7379('0xc')]=_0x517735[_0x7379('0xc')];this[_0x7379('0xd')]={};this[_0x7379('0xe')]=0x0;this[_0x7379('0xf')]='';this[_0x7379('0x10')]();this[_0x7379('0x11')]();}ChatQueue[_0x7379('0x12')]['updateRouting']=function(){var _0x3734b8=this[_0x7379('0xd')][_0x7379('0x13')];this[_0x7379('0xd')]=_[_0x7379('0x14')](this['Agents'],'id');this[_0x7379('0xd')][_0x7379('0x13')]=_0x3734b8;};ChatQueue['prototype'][_0x7379('0x11')]=function(){this[_0x7379('0x15')]=0x0;this['paused']=0x0;for(var _0x3253eb=0x0;_0x3253eb=0x0?this['available']:0x0;var _0x5f2d81={'id':this['id'],'available':this[_0x7379('0x1a')],'loggedIn':this['loggedIn'],'name':this[_0x7379('0x8')],'paused':this[_0x7379('0x19')],'waiting':this[_0x7379('0xe')]};var _0x1b717e=md5(JSON[_0x7379('0x1b')](_0x5f2d81));if(this['md5']!==_0x1b717e){this[_0x7379('0xf')]=_0x1b717e;io['to'](util[_0x7379('0x1c')](_0x7379('0x1d'),_0x5f2d81[_0x7379('0x8')]))[_0x7379('0x1e')]('chat_queue:save',_0x5f2d81);}};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 1ac5e2a..6083491 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 _0x6f1b=['faxPause','available','name','fax:queue:%s','emit','fax_queue:save','exports','md5','ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online'];(function(_0x10a60f,_0x2b1765){var _0x37bb5a=function(_0x17cee0){while(--_0x17cee0){_0x10a60f['push'](_0x10a60f['shift']());}};_0x37bb5a(++_0x2b1765);}(_0x6f1b,0x18f));var _0xb6f1=function(_0x761739,_0x4f1266){_0x761739=_0x761739-0x0;var _0x3f89e6=_0x6f1b[_0x761739];return _0x3f89e6;};'use strict';var _=require('lodash');var md5=require(_0xb6f1('0x0'));var util=require('util');var Redis=require(_0xb6f1('0x1'));var config=require('../../../config/environment');config[_0xb6f1('0x2')]=_[_0xb6f1('0x3')](config[_0xb6f1('0x2')],{'host':_0xb6f1('0x4'),'port':0x18eb});var io=require(_0xb6f1('0x5'))(new Redis(config['redis']));function FaxQueue(_0x2aea9d){this['id']=_0x2aea9d['id']||0x0;this['name']=_0x2aea9d['name']||'';this[_0xb6f1('0x6')]=_0x2aea9d['timeout']||0xa;this[_0xb6f1('0x7')]=_0x2aea9d[_0xb6f1('0x7')]||_0xb6f1('0x8');this[_0xb6f1('0x9')]=_0x2aea9d[_0xb6f1('0x9')];this[_0xb6f1('0xa')]={};this[_0xb6f1('0xb')]=0x0;this[_0xb6f1('0x0')]='';this[_0xb6f1('0xc')]();this[_0xb6f1('0xd')]();}FaxQueue[_0xb6f1('0xe')][_0xb6f1('0xc')]=function(){var _0x37ae24=this['mapAgentsId'][_0xb6f1('0xf')];this['mapAgentsId']=_[_0xb6f1('0x10')](this[_0xb6f1('0x9')],'id');this['mapAgentsId'][_0xb6f1('0xf')]=_0x37ae24;};FaxQueue[_0xb6f1('0xe')][_0xb6f1('0xd')]=function(){this[_0xb6f1('0x11')]=0x0;this[_0xb6f1('0x12')]=0x0;for(var _0x4b85bf=0x0;_0x4b85bf=0x0?this['available']:0x0;var _0x54aa87={'id':this['id'],'available':this[_0xb6f1('0x16')],'loggedIn':this[_0xb6f1('0x11')],'name':this[_0xb6f1('0x17')],'paused':this[_0xb6f1('0x12')],'waiting':this[_0xb6f1('0xb')]};var _0x32ebc5=md5(JSON['stringify'](_0x54aa87));if(this[_0xb6f1('0x0')]!==_0x32ebc5){this['md5']=_0x32ebc5;io['to'](util['format'](_0xb6f1('0x18'),_0x54aa87[_0xb6f1('0x17')]))[_0xb6f1('0x19')](_0xb6f1('0x1a'),_0x54aa87);}};module[_0xb6f1('0x1b')]=FaxQueue; \ No newline at end of file +var _0xf1fb=['mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','faxPause','available','waiting','format','fax:queue:%s','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x3b584b,_0x39dc34){var _0x38559d=function(_0x2cbf9e){while(--_0x2cbf9e){_0x3b584b['push'](_0x3b584b['shift']());}};_0x38559d(++_0x39dc34);}(_0xf1fb,0xa9));var _0xbf1f=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xf1fb[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xbf1f('0x0'));var md5=require(_0xbf1f('0x1'));var util=require(_0xbf1f('0x2'));var Redis=require(_0xbf1f('0x3'));var config=require(_0xbf1f('0x4'));config['redis']=_[_0xbf1f('0x5')](config[_0xbf1f('0x6')],{'host':_0xbf1f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x45642){this['id']=_0x45642['id']||0x0;this[_0xbf1f('0x8')]=_0x45642[_0xbf1f('0x8')]||'';this[_0xbf1f('0x9')]=_0x45642['timeout']||0xa;this[_0xbf1f('0xa')]=_0x45642[_0xbf1f('0xa')]||_0xbf1f('0xb');this[_0xbf1f('0xc')]=_0x45642[_0xbf1f('0xc')];this[_0xbf1f('0xd')]={};this['waiting']=0x0;this[_0xbf1f('0x1')]='';this[_0xbf1f('0xe')]();this[_0xbf1f('0xf')]();}FaxQueue[_0xbf1f('0x10')][_0xbf1f('0xe')]=function(){var _0x384156=this[_0xbf1f('0xd')][_0xbf1f('0x11')];this[_0xbf1f('0xd')]=_[_0xbf1f('0x12')](this[_0xbf1f('0xc')],'id');this[_0xbf1f('0xd')][_0xbf1f('0x11')]=_0x384156;};FaxQueue[_0xbf1f('0x10')][_0xbf1f('0xf')]=function(){this[_0xbf1f('0x13')]=0x0;this[_0xbf1f('0x14')]=0x0;for(var _0x315fb3=0x0;_0x315fb3=0x0?this['available']:0x0;var _0x2672ba={'id':this['id'],'available':this[_0xbf1f('0x16')],'loggedIn':this[_0xbf1f('0x13')],'name':this[_0xbf1f('0x8')],'paused':this[_0xbf1f('0x14')],'waiting':this[_0xbf1f('0x17')]};var _0x236699=md5(JSON['stringify'](_0x2672ba));if(this[_0xbf1f('0x1')]!==_0x236699){this[_0xbf1f('0x1')]=_0x236699;io['to'](util[_0xbf1f('0x18')](_0xbf1f('0x19'),_0x2672ba[_0xbf1f('0x8')]))['emit']('fax_queue:save',_0x2672ba);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 9480f3c..3b5ccde 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 _0xa05e=['name','Intervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa05e,0x10e));var _0xea05=function(_0x32d819,_0xe22920){_0x32d819=_0x32d819-0x0;var _0x4d90ad=_0xa05e[_0x32d819];return _0x4d90ad;};'use strict';function Interval(_0x13760b){this['id']=_0x13760b['id']||0x0;this[_0xea05('0x0')]=_0x13760b[_0xea05('0x0')]||'';this[_0xea05('0x1')]=_0x13760b['Intervals']||{};}module[_0xea05('0x2')]=Interval; \ No newline at end of file +var _0xa682=['name','Intervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa682,0xfe));var _0x2a68=function(_0x515502,_0x3549fd){_0x515502=_0x515502-0x0;var _0x2501df=_0xa682[_0x515502];return _0x2501df;};'use strict';function Interval(_0x5b9b31){this['id']=_0x5b9b31['id']||0x0;this[_0x2a68('0x0')]=_0x5b9b31['name']||'';this[_0x2a68('0x1')]=_0x5b9b31['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 817917a..b576e82 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 _0xa509=['length','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','paused'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xa509,0xf0));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9a50('0x0'));var md5=require(_0x9a50('0x1'));var util=require('util');var Redis=require(_0x9a50('0x2'));var config=require(_0x9a50('0x3'));config[_0x9a50('0x4')]=_[_0x9a50('0x5')](config[_0x9a50('0x4')],{'host':_0x9a50('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x38513b){this['id']=_0x38513b['id']||0x0;this[_0x9a50('0x7')]=_0x38513b['name']||'';this[_0x9a50('0x8')]=_0x38513b[_0x9a50('0x8')]||0xa;this[_0x9a50('0x9')]=_0x38513b['strategy']||'beepall';this['Agents']=_0x38513b['Agents'];this[_0x9a50('0xa')]={};this[_0x9a50('0xb')]=0x0;this[_0x9a50('0x1')]='';this[_0x9a50('0xc')]();this[_0x9a50('0xd')]();}MailQueue[_0x9a50('0xe')][_0x9a50('0xc')]=function(){var _0x2d9ab0=this[_0x9a50('0xa')][_0x9a50('0xf')];this[_0x9a50('0xa')]=_[_0x9a50('0x10')](this[_0x9a50('0x11')],'id');this[_0x9a50('0xa')][_0x9a50('0xf')]=_0x2d9ab0;};MailQueue[_0x9a50('0xe')][_0x9a50('0xd')]=function(){this[_0x9a50('0x12')]=0x0;this[_0x9a50('0x13')]=0x0;for(var _0x1ca613=0x0;_0x1ca613=0x0?this[_0x9a50('0x15')]:0x0;var _0x3a385a={'id':this['id'],'available':this[_0x9a50('0x15')],'loggedIn':this[_0x9a50('0x12')],'name':this[_0x9a50('0x7')],'paused':this[_0x9a50('0x13')],'waiting':this[_0x9a50('0xb')]};var _0x1c78c1=md5(JSON['stringify'](_0x3a385a));if(this[_0x9a50('0x1')]!==_0x1c78c1){this[_0x9a50('0x1')]=_0x1c78c1;io['to'](util[_0x9a50('0x16')](_0x9a50('0x17'),_0x3a385a['name']))['emit'](_0x9a50('0x18'),_0x3a385a);}};module[_0x9a50('0x19')]=MailQueue; \ No newline at end of file +var _0xa7b5=['mailPause','available','mail:queue:%s','emit','mail_queue:save','lodash','util','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','prototype','paused','online','loggedIn'];(function(_0x3c53de,_0x3f9ff4){var _0xa7d2ea=function(_0x54372f){while(--_0x54372f){_0x3c53de['push'](_0x3c53de['shift']());}};_0xa7d2ea(++_0x3f9ff4);}(_0xa7b5,0xa1));var _0x5a7b=function(_0x5e3691,_0x2b8a33){_0x5e3691=_0x5e3691-0x0;var _0x53c1d1=_0xa7b5[_0x5e3691];return _0x53c1d1;};'use strict';var _=require(_0x5a7b('0x0'));var md5=require('md5');var util=require(_0x5a7b('0x1'));var Redis=require('ioredis');var config=require(_0x5a7b('0x2'));config['redis']=_[_0x5a7b('0x3')](config[_0x5a7b('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x5a7b('0x5'))(new Redis(config[_0x5a7b('0x4')]));function MailQueue(_0x56972b){this['id']=_0x56972b['id']||0x0;this[_0x5a7b('0x6')]=_0x56972b[_0x5a7b('0x6')]||'';this[_0x5a7b('0x7')]=_0x56972b['timeout']||0xa;this[_0x5a7b('0x8')]=_0x56972b[_0x5a7b('0x8')]||_0x5a7b('0x9');this[_0x5a7b('0xa')]=_0x56972b[_0x5a7b('0xa')];this[_0x5a7b('0xb')]={};this[_0x5a7b('0xc')]=0x0;this[_0x5a7b('0xd')]='';this[_0x5a7b('0xe')]();this[_0x5a7b('0xf')]();}MailQueue['prototype']['updateRouting']=function(){var _0xcce605=this[_0x5a7b('0xb')][_0x5a7b('0x10')];this[_0x5a7b('0xb')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5a7b('0x10')]=_0xcce605;};MailQueue[_0x5a7b('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x5a7b('0x12')]=0x0;for(var _0x49c102=0x0;_0x49c102=0x0?this[_0x5a7b('0x16')]:0x0;var _0x39be80={'id':this['id'],'available':this[_0x5a7b('0x16')],'loggedIn':this[_0x5a7b('0x14')],'name':this[_0x5a7b('0x6')],'paused':this[_0x5a7b('0x12')],'waiting':this['waiting']};var _0x1e2e35=md5(JSON['stringify'](_0x39be80));if(this[_0x5a7b('0xd')]!==_0x1e2e35){this[_0x5a7b('0xd')]=_0x1e2e35;io['to'](util['format'](_0x5a7b('0x17'),_0x39be80[_0x5a7b('0x6')]))[_0x5a7b('0x18')](_0x5a7b('0x19'),_0x39be80);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a0dfe8c..01f8461 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4cc1b2,_0x3c3273){var _0x55aa48=function(_0x48b430){while(--_0x48b430){_0x4cc1b2['push'](_0x4cc1b2['shift']());}};_0x55aa48(++_0x3c3273);}(_0x814b,0x1a2));var _0xb814=function(_0xfcfc24,_0x48ca53){_0xfcfc24=_0xfcfc24-0x0;var _0x58f773=_0x814b[_0xfcfc24];return _0x58f773;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x280d1c,_0x265fe1){var _0x56148f=function(_0x4a8c55){while(--_0x4a8c55){_0x280d1c['push'](_0x280d1c['shift']());}};_0x56148f(++_0x265fe1);}(_0x814b,0x1a2));var _0xb814=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0x814b[_0x24697b];return _0x585b99;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index faf20e8..da267c9 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 _0x17ba=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','length','smsPause','paused','available','waiting','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x12d39e,_0xc9c7c7){var _0x1bd418=function(_0x1182a5){while(--_0x1182a5){_0x12d39e['push'](_0x12d39e['shift']());}};_0x1bd418(++_0xc9c7c7);}(_0x17ba,0xab));var _0xa17b=function(_0x170ffe,_0x35a497){_0x170ffe=_0x170ffe-0x0;var _0x48ac08=_0x17ba[_0x170ffe];return _0x48ac08;};'use strict';var _=require(_0xa17b('0x0'));var md5=require(_0xa17b('0x1'));var util=require('util');var Redis=require(_0xa17b('0x2'));var config=require(_0xa17b('0x3'));config[_0xa17b('0x4')]=_[_0xa17b('0x5')](config[_0xa17b('0x4')],{'host':_0xa17b('0x6'),'port':0x18eb});var io=require(_0xa17b('0x7'))(new Redis(config[_0xa17b('0x4')]));function SmsQueue(_0x1dc353){this['id']=_0x1dc353['id']||0x0;this[_0xa17b('0x8')]=_0x1dc353[_0xa17b('0x8')]||'';this[_0xa17b('0x9')]=_0x1dc353[_0xa17b('0x9')]||0xa;this[_0xa17b('0xa')]=_0x1dc353[_0xa17b('0xa')]||_0xa17b('0xb');this[_0xa17b('0xc')]=_0x1dc353[_0xa17b('0xc')];this[_0xa17b('0xd')]={};this['waiting']=0x0;this[_0xa17b('0x1')]='';this[_0xa17b('0xe')]();this[_0xa17b('0xf')]();}SmsQueue[_0xa17b('0x10')][_0xa17b('0xe')]=function(){var _0x4382df=this[_0xa17b('0xd')]['_rr'];this[_0xa17b('0xd')]=_[_0xa17b('0x11')](this[_0xa17b('0xc')],'id');this['mapAgentsId'][_0xa17b('0x12')]=_0x4382df;};SmsQueue[_0xa17b('0x10')][_0xa17b('0xf')]=function(){this[_0xa17b('0x13')]=0x0;this['paused']=0x0;for(var _0x117ad9=0x0;_0x117ad9=0x0?this[_0xa17b('0x17')]:0x0;var _0x197237={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa17b('0x13')],'name':this[_0xa17b('0x8')],'paused':this[_0xa17b('0x16')],'waiting':this[_0xa17b('0x18')]};var _0x2a340d=md5(JSON[_0xa17b('0x19')](_0x197237));if(this[_0xa17b('0x1')]!==_0x2a340d){this['md5']=_0x2a340d;io['to'](util[_0xa17b('0x1a')](_0xa17b('0x1b'),_0x197237[_0xa17b('0x8')]))['emit'](_0xa17b('0x1c'),_0x197237);}};module[_0xa17b('0x1d')]=SmsQueue; \ No newline at end of file +var _0x207d=['waiting','updateRouting','mapAgentsId','_rr','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0x207d,0x10d));var _0xd207=function(_0x5d0ddf,_0x1b6fdb){_0x5d0ddf=_0x5d0ddf-0x0;var _0x2c6c33=_0x207d[_0x5d0ddf];return _0x2c6c33;};'use strict';var _=require(_0xd207('0x0'));var md5=require(_0xd207('0x1'));var util=require(_0xd207('0x2'));var Redis=require(_0xd207('0x3'));var config=require('../../../config/environment');config[_0xd207('0x4')]=_['defaults'](config[_0xd207('0x4')],{'host':_0xd207('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd207('0x4')]));function SmsQueue(_0x47386f){this['id']=_0x47386f['id']||0x0;this[_0xd207('0x6')]=_0x47386f[_0xd207('0x6')]||'';this[_0xd207('0x7')]=_0x47386f[_0xd207('0x7')]||0xa;this[_0xd207('0x8')]=_0x47386f[_0xd207('0x8')]||_0xd207('0x9');this[_0xd207('0xa')]=_0x47386f[_0xd207('0xa')];this['mapAgentsId']={};this[_0xd207('0xb')]=0x0;this[_0xd207('0x1')]='';this[_0xd207('0xc')]();this['updateRealtime']();}SmsQueue['prototype'][_0xd207('0xc')]=function(){var _0x260dfd=this[_0xd207('0xd')]['_rr'];this[_0xd207('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xd207('0xe')]=_0x260dfd;};SmsQueue[_0xd207('0xf')][_0xd207('0x10')]=function(){this[_0xd207('0x11')]=0x0;this[_0xd207('0x12')]=0x0;for(var _0x450adf=0x0;_0x450adf=0x0?this[_0xd207('0x15')]:0x0;var _0x3e7e60={'id':this['id'],'available':this[_0xd207('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xd207('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x6b7fbd=md5(JSON[_0xd207('0x16')](_0x3e7e60));if(this[_0xd207('0x1')]!==_0x6b7fbd){this[_0xd207('0x1')]=_0x6b7fbd;io['to'](util[_0xd207('0x17')](_0xd207('0x18'),_0x3e7e60[_0xd207('0x6')]))[_0xd207('0x19')](_0xd207('0x1a'),_0x3e7e60);}};module[_0xd207('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 28cbd76..7b354b7 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 _0xe5bd=['mapAgentsId','updateRouting','updateRealtime','prototype','map','loggedIn','length','whatsappPause','available','paused','waiting','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','redis','defaults','localhost','name','timeout','strategy','Agents'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xe5bd,0x148));var _0xde5b=function(_0x4f2dd6,_0x4d3d03){_0x4f2dd6=_0x4f2dd6-0x0;var _0x236e70=_0xe5bd[_0x4f2dd6];return _0x236e70;};'use strict';var _=require(_0xde5b('0x0'));var md5=require(_0xde5b('0x1'));var util=require('util');var Redis=require(_0xde5b('0x2'));var config=require('../../../config/environment');config[_0xde5b('0x3')]=_[_0xde5b('0x4')](config[_0xde5b('0x3')],{'host':_0xde5b('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde5b('0x3')]));function WhatsappQueue(_0xfa3d0b){this['id']=_0xfa3d0b['id']||0x0;this[_0xde5b('0x6')]=_0xfa3d0b['name']||'';this[_0xde5b('0x7')]=_0xfa3d0b[_0xde5b('0x7')]||0xa;this[_0xde5b('0x8')]=_0xfa3d0b[_0xde5b('0x8')]||'beepall';this[_0xde5b('0x9')]=_0xfa3d0b['Agents'];this[_0xde5b('0xa')]={};this['waiting']=0x0;this[_0xde5b('0x1')]='';this[_0xde5b('0xb')]();this[_0xde5b('0xc')]();}WhatsappQueue[_0xde5b('0xd')]['updateRouting']=function(){var _0x501577=this[_0xde5b('0xa')]['_rr'];this[_0xde5b('0xa')]=_[_0xde5b('0xe')](this['Agents'],'id');this[_0xde5b('0xa')]['_rr']=_0x501577;};WhatsappQueue[_0xde5b('0xd')][_0xde5b('0xc')]=function(){this[_0xde5b('0xf')]=0x0;this['paused']=0x0;for(var _0x51b5e2=0x0;_0x51b5e2=0x0?this[_0xde5b('0x12')]:0x0;var _0x592999={'id':this['id'],'available':this[_0xde5b('0x12')],'loggedIn':this[_0xde5b('0xf')],'name':this[_0xde5b('0x6')],'paused':this['paused'],'waiting':this[_0xde5b('0x14')]};var _0xdf55dd=md5(JSON[_0xde5b('0x15')](_0x592999));if(this[_0xde5b('0x1')]!==_0xdf55dd){this[_0xde5b('0x1')]=_0xdf55dd;io['to'](util[_0xde5b('0x16')]('whatsapp:queue:%s',_0x592999['name']))[_0xde5b('0x17')](_0xde5b('0x18'),_0x592999);}};module[_0xde5b('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x66ae=['md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x66ae,0x121));var _0xe66a=function(_0x1f5741,_0x444ae5){_0x1f5741=_0x1f5741-0x0;var _0x52fc50=_0x66ae[_0x1f5741];return _0x52fc50;};'use strict';var _=require(_0xe66a('0x0'));var md5=require(_0xe66a('0x1'));var util=require(_0xe66a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xe66a('0x3')]=_[_0xe66a('0x4')](config['redis'],{'host':_0xe66a('0x5'),'port':0x18eb});var io=require(_0xe66a('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x4afe2f){this['id']=_0x4afe2f['id']||0x0;this[_0xe66a('0x7')]=_0x4afe2f[_0xe66a('0x7')]||'';this[_0xe66a('0x8')]=_0x4afe2f[_0xe66a('0x8')]||0xa;this['strategy']=_0x4afe2f['strategy']||_0xe66a('0x9');this[_0xe66a('0xa')]=_0x4afe2f['Agents'];this[_0xe66a('0xb')]={};this[_0xe66a('0xc')]=0x0;this['md5']='';this[_0xe66a('0xd')]();this[_0xe66a('0xe')]();}WhatsappQueue[_0xe66a('0xf')][_0xe66a('0xd')]=function(){var _0x47aefe=this[_0xe66a('0xb')][_0xe66a('0x10')];this[_0xe66a('0xb')]=_[_0xe66a('0x11')](this[_0xe66a('0xa')],'id');this[_0xe66a('0xb')][_0xe66a('0x10')]=_0x47aefe;};WhatsappQueue['prototype'][_0xe66a('0xe')]=function(){this[_0xe66a('0x12')]=0x0;this[_0xe66a('0x13')]=0x0;for(var _0x50b25a=0x0;_0x50b25a=0x0?this[_0xe66a('0x17')]:0x0;var _0x130b8f={'id':this['id'],'available':this[_0xe66a('0x17')],'loggedIn':this[_0xe66a('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xe66a('0xc')]};var _0x55206c=md5(JSON['stringify'](_0x130b8f));if(this[_0xe66a('0x1')]!==_0x55206c){this[_0xe66a('0x1')]=_0x55206c;io['to'](util[_0xe66a('0x18')](_0xe66a('0x19'),_0x130b8f['name']))[_0xe66a('0x1a')](_0xe66a('0x1b'),_0x130b8f);}};module[_0xe66a('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index bf0fd82..9d79588 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1f7dea,_0x2cccc6){var _0x6f0f48=function(_0x2cf5fa){while(--_0x2cf5fa){_0x1f7dea['push'](_0x1f7dea['shift']());}};_0x6f0f48(++_0x2cccc6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c1309,_0x66e161){_0x3c1309=_0x3c1309-0x0;var _0x4b71bf=_0xb10b[_0x3c1309];return _0x4b71bf;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x390a53,_0x1bd94f){var _0x27dbf3=function(_0x1baa1b){while(--_0x1baa1b){_0x390a53['push'](_0x390a53['shift']());}};_0x27dbf3(++_0x1bd94f);}(_0xb10b,0x12a));var _0xbb10=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0xb10b[_0x68c4d9];return _0x62da93;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 3e261e3..0511abd 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 _0x23f9=['../client','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x933f66,_0x4e1744){var _0x1d032d=function(_0x540aa0){while(--_0x540aa0){_0x933f66['push'](_0x933f66['shift']());}};_0x1d032d(++_0x4e1744);}(_0x23f9,0xea));var _0x923f=function(_0x520d8c,_0x54ba7e){_0x520d8c=_0x520d8c-0x0;var _0x56932e=_0x23f9[_0x520d8c];return _0x56932e;};'use strict';var client=require(_0x923f('0x0'));exports['update']=function(_0x2cbeb1,_0x3718b7){return client[_0x923f('0x1')](_0x923f('0x2'),{'body':_0x3718b7,'options':{'where':{'id':_0x2cbeb1}},'log':_0x923f('0x3')});};exports['addTags']=function(_0x26b708,_0x12dfb4){return client['Request'](_0x923f('0x4'),{'body':_0x12dfb4,'options':{'where':{'id':_0x26b708}},'log':_0x923f('0x5')});}; \ No newline at end of file +var _0x9e47=['AddTagsToChatInteraction','../client','update','updateChatInteraction','Request'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x9e47,0x1f0));var _0x79e4=function(_0x7964c6,_0x42e1a4){_0x7964c6=_0x7964c6-0x0;var _0x396ea8=_0x9e47[_0x7964c6];return _0x396ea8;};'use strict';var client=require(_0x79e4('0x0'));exports[_0x79e4('0x1')]=function(_0x3dec34,_0x3c74b9){return client['Request']('UpdateChatInteraction',{'body':_0x3c74b9,'options':{'where':{'id':_0x3dec34}},'log':_0x79e4('0x2')});};exports['addTags']=function(_0x266de0,_0x4f9aa2){return client[_0x79e4('0x3')](_0x79e4('0x4'),{'body':_0x4f9aa2,'options':{'where':{'id':_0x266de0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 232104c..6453282 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 _0xc2e9=['../client','create','Request','createChatMessage'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xc2e9,0xe4));var _0x9c2e=function(_0x385aaa,_0x115e85){_0x385aaa=_0x385aaa-0x0;var _0x387206=_0xc2e9[_0x385aaa];return _0x387206;};'use strict';var client=require(_0x9c2e('0x0'));exports[_0x9c2e('0x1')]=function(_0x1840a8){return client[_0x9c2e('0x2')]('CreateChatMessage',{'body':_0x1840a8,'log':_0x9c2e('0x3')});}; \ No newline at end of file +var _0x67ad=['createChatMessage','../client','create','Request'];(function(_0x21333e,_0x3187d3){var _0x242841=function(_0x14cbd9){while(--_0x14cbd9){_0x21333e['push'](_0x21333e['shift']());}};_0x242841(++_0x3187d3);}(_0x67ad,0x1bd));var _0xd67a=function(_0x3d4506,_0x234767){_0x3d4506=_0x3d4506-0x0;var _0x11b56b=_0x67ad[_0x3d4506];return _0x11b56b;};'use strict';var client=require(_0xd67a('0x0'));exports[_0xd67a('0x1')]=function(_0x372359){return client[_0xd67a('0x2')]('CreateChatMessage',{'body':_0x372359,'log':_0xd67a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b4dca58..ea5ad56 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 _0x6183=['chatPause','getChatQueues','Request','GetChatQueue','timeout','strategy','User','Agents','name','online'];(function(_0x7b9a8d,_0x308a64){var _0x28ca9e=function(_0x2b9be5){while(--_0x2b9be5){_0x7b9a8d['push'](_0x7b9a8d['shift']());}};_0x28ca9e(++_0x308a64);}(_0x6183,0x19b));var _0x3618=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x6183[_0x5a95fa];return _0x1a61b8;};'use strict';var client=require('../client');exports[_0x3618('0x0')]=function(){return function(){return client[_0x3618('0x1')](_0x3618('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3618('0x3'),_0x3618('0x4')],'include':[{'model':_0x3618('0x5'),'as':_0x3618('0x6'),'attributes':['id',_0x3618('0x7'),_0x3618('0x8'),_0x3618('0x9')]}]},'log':_0x3618('0x0')});};}; \ No newline at end of file +var _0x26d1=['GetChatQueue','name','timeout','Agents','online','chatPause','getChatQueues','../client','Request'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x26d1,0x8e));var _0x126d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x26d1[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x126d('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x126d('0x1')](_0x126d('0x2'),{'options':{'raw':![],'attributes':['id',_0x126d('0x3'),_0x126d('0x4'),'strategy'],'include':[{'model':'User','as':_0x126d('0x5'),'attributes':['id','name',_0x126d('0x6'),_0x126d('0x7')]}]},'log':_0x126d('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9e45b9e..48345f4 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 _0x8eeb=['update','DESC','../client','Request','CreateChatQueueReport'];(function(_0x2b78c5,_0x50ac65){var _0x1c2b54=function(_0x21f0aa){while(--_0x21f0aa){_0x2b78c5['push'](_0x2b78c5['shift']());}};_0x1c2b54(++_0x50ac65);}(_0x8eeb,0x183));var _0xb8ee=function(_0x33c37b,_0x20f6d9){_0x33c37b=_0x33c37b-0x0;var _0x44925e=_0x8eeb[_0x33c37b];return _0x44925e;};'use strict';var client=require(_0xb8ee('0x0'));exports['create']=function(_0x464dec){return client[_0xb8ee('0x1')]('CreateChatQueueReport',{'body':_0x464dec,'log':_0xb8ee('0x2')});};exports[_0xb8ee('0x3')]=function(_0x42df81,_0x3039dd){return client[_0xb8ee('0x1')]('UpdateChatQueueReport',{'body':_0x3039dd,'options':{'where':{'uniqueid':_0x42df81},'order':[['id',_0xb8ee('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xd66c=['UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport'];(function(_0x466625,_0x5983a5){var _0x8bf3e2=function(_0x395e21){while(--_0x395e21){_0x466625['push'](_0x466625['shift']());}};_0x8bf3e2(++_0x5983a5);}(_0xd66c,0x106));var _0xcd66=function(_0x55e54f,_0x554624){_0x55e54f=_0x55e54f-0x0;var _0x2aa1bf=_0xd66c[_0x55e54f];return _0x2aa1bf;};'use strict';var client=require(_0xcd66('0x0'));exports['create']=function(_0x35f78b){return client[_0xcd66('0x1')](_0xcd66('0x2'),{'body':_0x35f78b,'log':_0xcd66('0x2')});};exports['update']=function(_0xeccb2d,_0x13a713){return client[_0xcd66('0x1')](_0xcd66('0x3'),{'body':_0x13a713,'options':{'where':{'uniqueid':_0xeccb2d},'order':[['id',_0xcd66('0x4')]],'limit':0x1},'log':_0xcd66('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d21ade2..f52e074 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(_0x46b22a,_0x5bf83a){var _0x44c2e8=function(_0x21b6fc){while(--_0x21b6fc){_0x46b22a['push'](_0x46b22a['shift']());}};_0x44c2e8(++_0x5bf83a);}(_0x7a54,0x106));var _0x47a5=function(_0x434f89,_0x5ea476){_0x434f89=_0x434f89-0x0;var _0x48c3ba=_0x7a54[_0x434f89];return _0x48c3ba;};'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(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x2230e4,_0x323c00){_0x2230e4=_0x2230e4-0x0;var _0x50699c=_0x7a54[_0x2230e4];return _0x50699c;};'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 b2e3e29..ae4a447 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 _0x68a8=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x18010f,_0xb74e6d){var _0x1017a4=function(_0x41072a){while(--_0x41072a){_0x18010f['push'](_0x18010f['shift']());}};_0x1017a4(++_0xb74e6d);}(_0x68a8,0x1bd));var _0x868a=function(_0x458ab0,_0x458fb6){_0x458ab0=_0x458ab0-0x0;var _0x392738=_0x68a8[_0x458ab0];return _0x392738;};'use strict';var client=require('../client');exports[_0x868a('0x0')]=function(_0x1b7a52){return client[_0x868a('0x1')](_0x868a('0x2'),{'body':_0x1b7a52,'log':_0x868a('0x3')});}; \ No newline at end of file +var _0x2cff=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x54e333,_0x4ba478){var _0x47279e=function(_0x8e4f0b){while(--_0x8e4f0b){_0x54e333['push'](_0x54e333['shift']());}};_0x47279e(++_0x4ba478);}(_0x2cff,0x76));var _0xf2cf=function(_0x2a5251,_0x9c7bb2){_0x2a5251=_0x2a5251-0x0;var _0x1a4a93=_0x2cff[_0x2a5251];return _0x1a4a93;};'use strict';var client=require(_0xf2cf('0x0'));exports[_0xf2cf('0x1')]=function(_0x11daa5){return client[_0xf2cf('0x2')](_0xf2cf('0x3'),{'body':_0x11daa5,'log':_0xf2cf('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6e01b8f..736e18b 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 _0xd075=['getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause'];(function(_0xdd85ec,_0x1cb41f){var _0x19d0c8=function(_0x238d6b){while(--_0x238d6b){_0xdd85ec['push'](_0xdd85ec['shift']());}};_0x19d0c8(++_0x1cb41f);}(_0xd075,0x1c2));var _0x5d07=function(_0x22431d,_0x2986d4){_0x22431d=_0x22431d-0x0;var _0x5ebe4e=_0xd075[_0x22431d];return _0x5ebe4e;};'use strict';var client=require('../client');exports[_0x5d07('0x0')]=function(){return function(){return client[_0x5d07('0x1')](_0x5d07('0x2'),{'options':{'raw':![],'attributes':['id',_0x5d07('0x3'),_0x5d07('0x4'),_0x5d07('0x5')],'include':[{'model':_0x5d07('0x6'),'as':_0x5d07('0x7'),'attributes':['id',_0x5d07('0x3'),_0x5d07('0x8'),_0x5d07('0x9')]}]},'log':_0x5d07('0x0')});};}; \ No newline at end of file +var _0x83eb=['name','../client','getFaxQueues','Request','timeout','strategy','User'];(function(_0x55856f,_0xae44b1){var _0x1d22ba=function(_0x384d52){while(--_0x384d52){_0x55856f['push'](_0x55856f['shift']());}};_0x1d22ba(++_0xae44b1);}(_0x83eb,0x14a));var _0xb83e=function(_0x3bfe34,_0x1fc464){_0x3bfe34=_0x3bfe34-0x0;var _0x2889d0=_0x83eb[_0x3bfe34];return _0x2889d0;};'use strict';var client=require(_0xb83e('0x0'));exports[_0xb83e('0x1')]=function(){return function(){return client[_0xb83e('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xb83e('0x3'),_0xb83e('0x4')],'include':[{'model':_0xb83e('0x5'),'as':'Agents','attributes':['id',_0xb83e('0x6'),'online','faxPause']}]},'log':_0xb83e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index b8c7287..bd0b04e 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 _0x2877=['Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','create'];(function(_0x158c73,_0x5a4335){var _0x18cdcc=function(_0x40ed86){while(--_0x40ed86){_0x158c73['push'](_0x158c73['shift']());}};_0x18cdcc(++_0x5a4335);}(_0x2877,0x1d3));var _0x7287=function(_0x545a14,_0x53afc9){_0x545a14=_0x545a14-0x0;var _0x23a136=_0x2877[_0x545a14];return _0x23a136;};'use strict';var client=require('../client');exports[_0x7287('0x0')]=function(_0x16c693){return client[_0x7287('0x1')](_0x7287('0x2'),{'body':_0x16c693,'log':_0x7287('0x2')});};exports[_0x7287('0x3')]=function(_0x3da926,_0x129455){return client[_0x7287('0x1')]('UpdateFaxQueueReport',{'body':_0x129455,'options':{'where':{'uniqueid':_0x3da926},'order':[['id',_0x7287('0x4')]],'limit':0x1},'log':_0x7287('0x5')});}; \ No newline at end of file +var _0x743f=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','DESC'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x743f,0xd3));var _0xf743=function(_0x56dde7,_0x4e17ca){_0x56dde7=_0x56dde7-0x0;var _0xe29b02=_0x743f[_0x56dde7];return _0xe29b02;};'use strict';var client=require(_0xf743('0x0'));exports[_0xf743('0x1')]=function(_0xb7c9f9){return client[_0xf743('0x2')]('CreateFaxQueueReport',{'body':_0xb7c9f9,'log':_0xf743('0x3')});};exports['update']=function(_0x3cd57c,_0x4d12e0){return client[_0xf743('0x2')]('UpdateFaxQueueReport',{'body':_0x4d12e0,'options':{'where':{'uniqueid':_0x3cd57c},'order':[['id',_0xf743('0x4')]],'limit':0x1},'log':_0xf743('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 3148311..76d622c 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 _0x590d=['GetInterval','Intervals','name','interval','../client','getIntervals','Request'];(function(_0x3a166a,_0x2018be){var _0x1b0279=function(_0x5b98dd){while(--_0x5b98dd){_0x3a166a['push'](_0x3a166a['shift']());}};_0x1b0279(++_0x2018be);}(_0x590d,0x13f));var _0xd590=function(_0x38c773,_0x199a45){_0x38c773=_0x38c773-0x0;var _0x196e46=_0x590d[_0x38c773];return _0x196e46;};'use strict';var client=require(_0xd590('0x0'));exports[_0xd590('0x1')]=function(){return function(){return client[_0xd590('0x2')](_0xd590('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0xd590('0x4'),'attributes':['id',_0xd590('0x5'),_0xd590('0x6')]}]},'log':_0xd590('0x1')});};}; \ No newline at end of file +var _0x31b5=['Request','GetInterval','Interval','Intervals','name','interval','../client','getIntervals'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x31b5,0x136));var _0x531b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x31b5[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x531b('0x0'));exports[_0x531b('0x1')]=function(){return function(){return client[_0x531b('0x2')](_0x531b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x531b('0x4'),'as':_0x531b('0x5'),'attributes':['id',_0x531b('0x6'),_0x531b('0x7')]}]},'log':_0x531b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c147650..51b5065 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 _0xcf2f=['update','Request','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x1b64c1,_0x2dfab9){var _0x2b93e6=function(_0x27911c){while(--_0x27911c){_0x1b64c1['push'](_0x1b64c1['shift']());}};_0x2b93e6(++_0x2dfab9);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x1b029f,_0x43015f){_0x1b029f=_0x1b029f-0x0;var _0x4f4519=_0xcf2f[_0x1b029f];return _0x4f4519;};'use strict';var client=require(_0xfcf2('0x0'));exports[_0xfcf2('0x1')]=function(_0xe6b3a5,_0x3165cf){return client[_0xfcf2('0x2')]('UpdateMailInteraction',{'body':_0x3165cf,'options':{'where':{'id':_0xe6b3a5}},'log':_0xfcf2('0x3')});};exports[_0xfcf2('0x4')]=function(_0x1e3661,_0x34bcaf){return client[_0xfcf2('0x2')](_0xfcf2('0x5'),{'body':_0x34bcaf,'options':{'where':{'id':_0x1e3661}},'log':_0xfcf2('0x6')});}; \ No newline at end of file +var _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x1b33a9,_0x1083ac){var _0x556ed8=function(_0x8dbd4b){while(--_0x8dbd4b){_0x1b33a9['push'](_0x1b33a9['shift']());}};_0x556ed8(++_0x1083ac);}(_0x28f2,0x193));var _0x228f=function(_0x11895a,_0x3db293){_0x11895a=_0x11895a-0x0;var _0x158a2b=_0x28f2[_0x11895a];return _0x158a2b;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d5c3cdc..f6c0977 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 _0x3c93=['Request','CreateMailMessage','../client','create'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3c93,0x10e));var _0x33c9=function(_0x5c2d50,_0x45eb2e){_0x5c2d50=_0x5c2d50-0x0;var _0x42c298=_0x3c93[_0x5c2d50];return _0x42c298;};'use strict';var client=require(_0x33c9('0x0'));exports[_0x33c9('0x1')]=function(_0x1794f2){return client[_0x33c9('0x2')](_0x33c9('0x3'),{'body':_0x1794f2,'log':'createMailMessage'});}; \ No newline at end of file +var _0x4eed=['Request','CreateMailMessage','../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4eed,0xda));var _0xd4ee=function(_0x3b0ef5,_0x155352){_0x3b0ef5=_0x3b0ef5-0x0;var _0x693882=_0x4eed[_0x3b0ef5];return _0x693882;};'use strict';var client=require(_0xd4ee('0x0'));exports[_0xd4ee('0x1')]=function(_0x3c2218){return client[_0xd4ee('0x2')](_0xd4ee('0x3'),{'body':_0x3c2218,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 194c718..ed346a3 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 _0x920e=['Request','GetMailQueue','name','strategy','User','Agents','online','mailPause','../client','getMailQueues'];(function(_0x17bb25,_0x5bc624){var _0x30f276=function(_0xf794d8){while(--_0xf794d8){_0x17bb25['push'](_0x17bb25['shift']());}};_0x30f276(++_0x5bc624);}(_0x920e,0x120));var _0xe920=function(_0x4c166e,_0x134272){_0x4c166e=_0x4c166e-0x0;var _0x3bf150=_0x920e[_0x4c166e];return _0x3bf150;};'use strict';var client=require(_0xe920('0x0'));exports[_0xe920('0x1')]=function(){return function(){return client[_0xe920('0x2')](_0xe920('0x3'),{'options':{'raw':![],'attributes':['id',_0xe920('0x4'),'timeout',_0xe920('0x5')],'include':[{'model':_0xe920('0x6'),'as':_0xe920('0x7'),'attributes':['id',_0xe920('0x4'),_0xe920('0x8'),_0xe920('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x4a9f=['Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy','User'];(function(_0x28c870,_0x1bf349){var _0x5e4de6=function(_0x418068){while(--_0x418068){_0x28c870['push'](_0x28c870['shift']());}};_0x5e4de6(++_0x1bf349);}(_0x4a9f,0x67));var _0xf4a9=function(_0x80a0e2,_0x39003f){_0x80a0e2=_0x80a0e2-0x0;var _0x258e83=_0x4a9f[_0x80a0e2];return _0x258e83;};'use strict';var client=require(_0xf4a9('0x0'));exports[_0xf4a9('0x1')]=function(){return function(){return client[_0xf4a9('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xf4a9('0x3'),_0xf4a9('0x4'),_0xf4a9('0x5')],'include':[{'model':_0xf4a9('0x6'),'as':_0xf4a9('0x7'),'attributes':['id',_0xf4a9('0x3'),_0xf4a9('0x8'),_0xf4a9('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index c742cd4..74f6879 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 _0xe75f=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x80bea0,_0x4c30f4){var _0x50fb90=function(_0x1484ce){while(--_0x1484ce){_0x80bea0['push'](_0x80bea0['shift']());}};_0x50fb90(++_0x4c30f4);}(_0xe75f,0x101));var _0xfe75=function(_0xaa6960,_0x5e2e12){_0xaa6960=_0xaa6960-0x0;var _0x1f93a2=_0xe75f[_0xaa6960];return _0x1f93a2;};'use strict';var client=require(_0xfe75('0x0'));exports['create']=function(_0x4887e8){return client[_0xfe75('0x1')](_0xfe75('0x2'),{'body':_0x4887e8,'log':_0xfe75('0x2')});};exports[_0xfe75('0x3')]=function(_0x430b58,_0x3831e0){return client['Request'](_0xfe75('0x4'),{'body':_0x3831e0,'options':{'where':{'uniqueid':_0x430b58},'order':[['id',_0xfe75('0x5')]],'limit':0x1},'log':_0xfe75('0x4')});}; \ No newline at end of file +var _0xc7cc=['Request','CreateMailQueueReport','DESC','UpdateMailQueueReport','create'];(function(_0x19edc0,_0x39c116){var _0x5da0a4=function(_0xf2e510){while(--_0xf2e510){_0x19edc0['push'](_0x19edc0['shift']());}};_0x5da0a4(++_0x39c116);}(_0xc7cc,0x14e));var _0xcc7c=function(_0x109877,_0x4fbb17){_0x109877=_0x109877-0x0;var _0x5cd789=_0xc7cc[_0x109877];return _0x5cd789;};'use strict';var client=require('../client');exports[_0xcc7c('0x0')]=function(_0x154dab){return client[_0xcc7c('0x1')](_0xcc7c('0x2'),{'body':_0x154dab,'log':'CreateMailQueueReport'});};exports['update']=function(_0x4f8d02,_0x5abcb8){return client['Request']('UpdateMailQueueReport',{'body':_0x5abcb8,'options':{'where':{'uniqueid':_0x4f8d02},'order':[['id',_0xcc7c('0x3')]],'limit':0x1},'log':_0xcc7c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9e941a5..b3ae61b 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 _0x790d=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x516524,_0x1e58bc){var _0x12d773=function(_0x5ca118){while(--_0x5ca118){_0x516524['push'](_0x516524['shift']());}};_0x12d773(++_0x1e58bc);}(_0x790d,0xe3));var _0xd790=function(_0x1dd82f,_0x52acb7){_0x1dd82f=_0x1dd82f-0x0;var _0x353ca4=_0x790d[_0x1dd82f];return _0x353ca4;};'use strict';var client=require(_0xd790('0x0'));exports[_0xd790('0x1')]=function(_0x49a2c9,_0x1d1c57){return client[_0xd790('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1d1c57,'options':{'where':{'id':_0x49a2c9}},'log':_0xd790('0x3')});};exports[_0xd790('0x4')]=function(_0x5c8407,_0x41afed){return client[_0xd790('0x2')](_0xd790('0x5'),{'body':_0x41afed,'options':{'where':{'id':_0x5c8407}},'log':_0xd790('0x6')});}; \ No newline at end of file +var _0x3def=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4de9af,_0x41941c){var _0x20bd1c=function(_0x24d71f){while(--_0x24d71f){_0x4de9af['push'](_0x4de9af['shift']());}};_0x20bd1c(++_0x41941c);}(_0x3def,0x183));var _0xf3de=function(_0x3da493,_0x3b5afc){_0x3da493=_0x3da493-0x0;var _0x2227a5=_0x3def[_0x3da493];return _0x2227a5;};'use strict';var client=require(_0xf3de('0x0'));exports[_0xf3de('0x1')]=function(_0x3394cc,_0x325346){return client[_0xf3de('0x2')]('UpdateOpenchannelInteraction',{'body':_0x325346,'options':{'where':{'id':_0x3394cc}},'log':_0xf3de('0x3')});};exports['addTags']=function(_0x53777e,_0x38a9c8){return client[_0xf3de('0x2')](_0xf3de('0x4'),{'body':_0x38a9c8,'options':{'where':{'id':_0x53777e}},'log':_0xf3de('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 93f2f95..18cef03 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 _0xe639=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x403dc4,_0x3313f2){var _0x106f04=function(_0x212ac4){while(--_0x212ac4){_0x403dc4['push'](_0x403dc4['shift']());}};_0x106f04(++_0x3313f2);}(_0xe639,0x1e7));var _0x9e63=function(_0x4d4f65,_0x3ee7e0){_0x4d4f65=_0x4d4f65-0x0;var _0x3634a1=_0xe639[_0x4d4f65];return _0x3634a1;};'use strict';var client=require(_0x9e63('0x0'));exports[_0x9e63('0x1')]=function(_0x3842f7){return client[_0x9e63('0x2')](_0x9e63('0x3'),{'body':_0x3842f7,'log':_0x9e63('0x4')});}; \ No newline at end of file +var _0x7ba8=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x80b8ac,_0x2b6d52){var _0x39e3c8=function(_0x36af0b){while(--_0x36af0b){_0x80b8ac['push'](_0x80b8ac['shift']());}};_0x39e3c8(++_0x2b6d52);}(_0x7ba8,0x10d));var _0x87ba=function(_0x20d657,_0x12c592){_0x20d657=_0x20d657-0x0;var _0x9ba0db=_0x7ba8[_0x20d657];return _0x9ba0db;};'use strict';var client=require(_0x87ba('0x0'));exports['create']=function(_0x5c199d){return client[_0x87ba('0x1')](_0x87ba('0x2'),{'body':_0x5c199d,'log':_0x87ba('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b294626..2a9ffcf 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 _0xaebf=['GetOpenchannelQueue','name','timeout','strategy','User','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x24dc66,_0x861542){var _0x3041f0=function(_0xc1ca){while(--_0xc1ca){_0x24dc66['push'](_0x24dc66['shift']());}};_0x3041f0(++_0x861542);}(_0xaebf,0x1bf));var _0xfaeb=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xaebf[_0x2080a3];return _0x8d7d17;};'use strict';var client=require(_0xfaeb('0x0'));exports[_0xfaeb('0x1')]=function(){return function(){return client[_0xfaeb('0x2')](_0xfaeb('0x3'),{'options':{'raw':![],'attributes':['id',_0xfaeb('0x4'),_0xfaeb('0x5'),_0xfaeb('0x6')],'include':[{'model':_0xfaeb('0x7'),'as':'Agents','attributes':['id',_0xfaeb('0x4'),'online',_0xfaeb('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x89e8=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','openchannelPause','../client'];(function(_0x229aa2,_0x100c43){var _0xa151d0=function(_0xba1543){while(--_0xba1543){_0x229aa2['push'](_0x229aa2['shift']());}};_0xa151d0(++_0x100c43);}(_0x89e8,0x74));var _0x889e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x89e8[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x889e('0x0'));exports[_0x889e('0x1')]=function(){return function(){return client[_0x889e('0x2')](_0x889e('0x3'),{'options':{'raw':![],'attributes':['id',_0x889e('0x4'),_0x889e('0x5'),_0x889e('0x6')],'include':[{'model':_0x889e('0x7'),'as':'Agents','attributes':['id','name','online',_0x889e('0x8')]}]},'log':_0x889e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f1ef15e..17eaec7 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 _0x5525=['create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0x5525,0xd1));var _0x5552=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5525[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x5552('0x0'));exports[_0x5552('0x1')]=function(_0x3492bb){return client[_0x5552('0x2')](_0x5552('0x3'),{'body':_0x3492bb,'log':_0x5552('0x3')});};exports[_0x5552('0x4')]=function(_0x47c27e,_0x285566){return client[_0x5552('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x285566,'options':{'where':{'uniqueid':_0x47c27e},'order':[['id',_0x5552('0x5')]],'limit':0x1},'log':_0x5552('0x6')});}; \ No newline at end of file +var _0x78a8=['DESC','../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x78a8,0xda));var _0x878a=function(_0x507b9f,_0x17de0d){_0x507b9f=_0x507b9f-0x0;var _0x4c9837=_0x78a8[_0x507b9f];return _0x4c9837;};'use strict';var client=require(_0x878a('0x0'));exports[_0x878a('0x1')]=function(_0x2ce54b){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x2ce54b,'log':_0x878a('0x2')});};exports[_0x878a('0x3')]=function(_0x116cd6,_0x108efd){return client[_0x878a('0x4')](_0x878a('0x5'),{'body':_0x108efd,'options':{'where':{'uniqueid':_0x116cd6},'order':[['id',_0x878a('0x6')]],'limit':0x1},'log':_0x878a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index f931f10..e1b7b84 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 _0x207d=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags'];(function(_0x30aa6d,_0x3bbe0e){var _0x4735e9=function(_0x30a4e4){while(--_0x30a4e4){_0x30aa6d['push'](_0x30aa6d['shift']());}};_0x4735e9(++_0x3bbe0e);}(_0x207d,0x10d));var _0xd207=function(_0x4a9b1f,_0x303d9e){_0x4a9b1f=_0x4a9b1f-0x0;var _0x2938f1=_0x207d[_0x4a9b1f];return _0x2938f1;};'use strict';var client=require(_0xd207('0x0'));exports[_0xd207('0x1')]=function(_0x302062,_0x27a1dc){return client['Request'](_0xd207('0x2'),{'body':_0x27a1dc,'options':{'where':{'id':_0x302062}},'log':'updateSmsInteraction'});};exports[_0xd207('0x3')]=function(_0x422501,_0x5351ed){return client[_0xd207('0x4')](_0xd207('0x5'),{'body':_0x5351ed,'options':{'where':{'id':_0x422501}},'log':_0xd207('0x6')});}; \ No newline at end of file +var _0x46fc=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x48b287,_0x1cff3d){var _0x54e675=function(_0x32a30a){while(--_0x32a30a){_0x48b287['push'](_0x48b287['shift']());}};_0x54e675(++_0x1cff3d);}(_0x46fc,0x103));var _0xc46f=function(_0x2f3ecb,_0x167647){_0x2f3ecb=_0x2f3ecb-0x0;var _0x92a07c=_0x46fc[_0x2f3ecb];return _0x92a07c;};'use strict';var client=require(_0xc46f('0x0'));exports[_0xc46f('0x1')]=function(_0xf5212c,_0x23d3ae){return client[_0xc46f('0x2')](_0xc46f('0x3'),{'body':_0x23d3ae,'options':{'where':{'id':_0xf5212c}},'log':_0xc46f('0x4')});};exports[_0xc46f('0x5')]=function(_0x3a56db,_0x5b0483){return client['Request'](_0xc46f('0x6'),{'body':_0x5b0483,'options':{'where':{'id':_0x3a56db}},'log':_0xc46f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 100ed83..3b47549 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 _0xbb4a=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x25f280,_0x78272f){var _0x291cc9=function(_0x2acb8f){while(--_0x2acb8f){_0x25f280['push'](_0x25f280['shift']());}};_0x291cc9(++_0x78272f);}(_0xbb4a,0xd9));var _0xabb4=function(_0x54fb5e,_0x33b6a3){_0x54fb5e=_0x54fb5e-0x0;var _0x31e52c=_0xbb4a[_0x54fb5e];return _0x31e52c;};'use strict';var client=require(_0xabb4('0x0'));exports[_0xabb4('0x1')]=function(_0x6dde86){return client[_0xabb4('0x2')](_0xabb4('0x3'),{'body':_0x6dde86,'log':_0xabb4('0x4')});}; \ No newline at end of file +var _0xb191=['CreateSmsMessage','createSmsMessage','create'];(function(_0x24b31e,_0x57f7c3){var _0x4724b9=function(_0x15ad20){while(--_0x15ad20){_0x24b31e['push'](_0x24b31e['shift']());}};_0x4724b9(++_0x57f7c3);}(_0xb191,0xe3));var _0x1b19=function(_0x74827a,_0x46bb41){_0x74827a=_0x74827a-0x0;var _0x3218d2=_0xb191[_0x74827a];return _0x3218d2;};'use strict';var client=require('../client');exports[_0x1b19('0x0')]=function(_0x2a890c){return client['Request'](_0x1b19('0x1'),{'body':_0x2a890c,'log':_0x1b19('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index c1da423..bbc33ac 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x407f1f,_0x22bb99){var _0x18d62e=function(_0x316d60){while(--_0x316d60){_0x407f1f['push'](_0x407f1f['shift']());}};_0x18d62e(++_0x22bb99);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7e7[_0x1a36a5];return _0x746243;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x2878c3,_0x37e5d5){var _0x1a0f64=function(_0x533d93){while(--_0x533d93){_0x2878c3['push'](_0x2878c3['shift']());}};_0x1a0f64(++_0x37e5d5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 3aa36ac..6e566fb 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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x290da0,_0x2149ca){var _0x5eec1c=function(_0x30f8c2){while(--_0x30f8c2){_0x290da0['push'](_0x290da0['shift']());}};_0x5eec1c(++_0x2149ca);}(_0x55ca,0x126));var _0xa55c=function(_0x38c7d8,_0x253557){_0x38c7d8=_0x38c7d8-0x0;var _0x266426=_0x55ca[_0x38c7d8];return _0x266426;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1be31f,_0x4dabe7){var _0x54f838=function(_0x37f665){while(--_0x37f665){_0x1be31f['push'](_0x1be31f['shift']());}};_0x54f838(++_0x4dabe7);}(_0x34e8,0x12c));var _0x834e=function(_0x4ee1cd,_0x21ba2a){_0x4ee1cd=_0x4ee1cd-0x0;var _0x255c68=_0x34e8[_0x4ee1cd];return _0x255c68;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 88974e7..aff937a 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(_0x3fb637,_0x5998ff){var _0x3334a1=function(_0x170550){while(--_0x170550){_0x3fb637['push'](_0x3fb637['shift']());}};_0x3334a1(++_0x5998ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x5b6789,_0x2741bf){var _0x4b9754=function(_0x5f3561){while(--_0x5f3561){_0x5b6789['push'](_0x5b6789['shift']());}};_0x4b9754(++_0x2741bf);}(_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 cddf680..41524c7 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 _0xe3da=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x3dd10c,_0x147522){var _0x5a3223=function(_0x7d3c36){while(--_0x7d3c36){_0x3dd10c['push'](_0x3dd10c['shift']());}};_0x5a3223(++_0x147522);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0xae3d('0x0'));exports[_0xae3d('0x1')]=function(_0x2788fe,_0x405f17){return client[_0xae3d('0x2')](_0xae3d('0x3'),{'body':_0x405f17,'options':{'where':{'id':_0x2788fe}},'log':_0xae3d('0x4')});};exports[_0xae3d('0x5')]=function(_0xb2dfd3,_0x22bacf){return client[_0xae3d('0x2')](_0xae3d('0x6'),{'body':_0x22bacf,'options':{'where':{'id':_0xb2dfd3}},'log':_0xae3d('0x7')});}; \ No newline at end of file +var _0xc4aa=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(_0x40a0d0,_0x351dd5){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'body':_0x351dd5,'options':{'where':{'id':_0x40a0d0}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x47d4f6,_0x2f48ed){return client[_0xac4a('0x2')](_0xac4a('0x4'),{'body':_0x2f48ed,'options':{'where':{'id':_0x47d4f6}},'log':_0xac4a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 11fc3a3..422e3f6 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 _0x3488=['../client','Request','createWhatsappMessage'];(function(_0x42e1e2,_0x3aaef7){var _0x124fb5=function(_0x4bc588){while(--_0x4bc588){_0x42e1e2['push'](_0x42e1e2['shift']());}};_0x124fb5(++_0x3aaef7);}(_0x3488,0x108));var _0x8348=function(_0x39975c,_0x1d94e8){_0x39975c=_0x39975c-0x0;var _0x4de50b=_0x3488[_0x39975c];return _0x4de50b;};'use strict';var client=require(_0x8348('0x0'));exports['create']=function(_0x3fe0e0){return client[_0x8348('0x1')]('CreateWhatsappMessage',{'body':_0x3fe0e0,'log':_0x8348('0x2')});}; \ No newline at end of file +var _0xf2be=['create','Request','CreateWhatsappMessage','../client'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0xf2be,0x7b));var _0xef2b=function(_0x27fe12,_0x1fa06f){_0x27fe12=_0x27fe12-0x0;var _0x518e25=_0xf2be[_0x27fe12];return _0x518e25;};'use strict';var client=require(_0xef2b('0x0'));exports[_0xef2b('0x1')]=function(_0xd7f57f){return client[_0xef2b('0x2')](_0xef2b('0x3'),{'body':_0xd7f57f,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 3b9f530..9a085ba 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 _0xfd52=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause'];(function(_0x31a725,_0x4d61cd){var _0x20f655=function(_0x30d8d6){while(--_0x30d8d6){_0x31a725['push'](_0x31a725['shift']());}};_0x20f655(++_0x4d61cd);}(_0xfd52,0x64));var _0x2fd5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xfd52[_0x422905];return _0x33dc6c;};'use strict';var client=require(_0x2fd5('0x0'));exports[_0x2fd5('0x1')]=function(){return function(){return client[_0x2fd5('0x2')](_0x2fd5('0x3'),{'options':{'raw':![],'attributes':['id',_0x2fd5('0x4'),_0x2fd5('0x5'),_0x2fd5('0x6')],'include':[{'model':'User','as':_0x2fd5('0x7'),'attributes':['id',_0x2fd5('0x4'),_0x2fd5('0x8'),_0x2fd5('0x9')]}]},'log':_0x2fd5('0x1')});};}; \ No newline at end of file +var _0xdf42=['whatsappPause','../client','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x3cf670,_0x472306){var _0x53dfdc=function(_0x526c34){while(--_0x526c34){_0x3cf670['push'](_0x3cf670['shift']());}};_0x53dfdc(++_0x472306);}(_0xdf42,0xf1));var _0x2df4=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xdf42[_0x24f31b];return _0x488401;};'use strict';var client=require(_0x2df4('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x2df4('0x1')](_0x2df4('0x2'),{'options':{'raw':![],'attributes':['id',_0x2df4('0x3'),_0x2df4('0x4'),_0x2df4('0x5')],'include':[{'model':_0x2df4('0x6'),'as':_0x2df4('0x7'),'attributes':['id',_0x2df4('0x3'),_0x2df4('0x8'),_0x2df4('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 6ef2f7e..31a6ebf 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 _0x49eb=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x284d47,_0x33cb3d){var _0x58518d=function(_0x5d8187){while(--_0x5d8187){_0x284d47['push'](_0x284d47['shift']());}};_0x58518d(++_0x33cb3d);}(_0x49eb,0x6f));var _0xb49e=function(_0x518061,_0x3951dc){_0x518061=_0x518061-0x0;var _0x434f4e=_0x49eb[_0x518061];return _0x434f4e;};'use strict';var client=require(_0xb49e('0x0'));exports[_0xb49e('0x1')]=function(_0x44c428){return client[_0xb49e('0x2')](_0xb49e('0x3'),{'body':_0x44c428,'log':_0xb49e('0x3')});};exports['update']=function(_0x429f04,_0x5b45cf){return client['Request'](_0xb49e('0x4'),{'body':_0x5b45cf,'options':{'where':{'uniqueid':_0x429f04},'order':[['id','DESC']],'limit':0x1},'log':_0xb49e('0x4')});}; \ No newline at end of file +var _0xfbc8=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xfbc8,0x112));var _0x8fbc=function(_0xfbceb4,_0x392f3b){_0xfbceb4=_0xfbceb4-0x0;var _0x563dbe=_0xfbc8[_0xfbceb4];return _0x563dbe;};'use strict';var client=require(_0x8fbc('0x0'));exports['create']=function(_0x41f873){return client['Request'](_0x8fbc('0x1'),{'body':_0x41f873,'log':_0x8fbc('0x1')});};exports[_0x8fbc('0x2')]=function(_0x1cd688,_0x5a588d){return client['Request'](_0x8fbc('0x3'),{'body':_0x5a588d,'options':{'where':{'uniqueid':_0x1cd688},'order':[['id',_0x8fbc('0x4')]],'limit':0x1},'log':_0x8fbc('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index e2dd3d8..b6fff5f 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 _0xcdd3=['complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules'];(function(_0x1f0ca6,_0x3a7cfc){var _0x51fc6e=function(_0x1ab976){while(--_0x1ab976){_0x1f0ca6['push'](_0x1f0ca6['shift']());}};_0x51fc6e(++_0x3a7cfc);}(_0xcdd3,0xab));var _0x3cdd=function(_0x23b079,_0x19cabd){_0x23b079=_0x23b079-0x0;var _0xe83270=_0xcdd3[_0x23b079];return _0xe83270;};'use strict';var schema=require(_0x3cdd('0x0'));var _=require(_0x3cdd('0x1'));var util=require(_0x3cdd('0x2'));var seqqueue=require(_0x3cdd('0x3'));var logger=require(_0x3cdd('0x4'))(_0x3cdd('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3cdd('0x6'),'required':!![],'message':_0x3cdd('0x7')},'timeout':{'type':_0x3cdd('0x8'),'message':_0x3cdd('0x9')}});function writeLog(_0x1fad2e,_0x1cc703,_0x4aee30){return logger['info'](util[_0x3cdd('0xa')](_0x3cdd('0xb'),_0x1fad2e,_0x1cc703[_0x3cdd('0xc')],_0x4aee30));}function handleFindAgent(_0x2607b4){return function(_0x4af31e){return _0x4af31e[_0x3cdd('0xc')][_0x3cdd('0xd')]()===_0x2607b4[_0x3cdd('0xd')]();};}exports[_0x3cdd('0xe')]=function(_0x17f2a4,_0x5d5b80,_0x408f0f,_0xfdb648){return function(_0xb46bb7){try{var _0x4ac2f0={'name':_0x5d5b80[0x0],'timeout':_0x5d5b80[0x1]};var _0xcb2ade=queue[_0x3cdd('0x0')](_0x4ac2f0,{'typecast':!![]});if(_0xcb2ade[_0x3cdd('0xf')]){logger[_0x3cdd('0x10')](_0x3cdd('0x11'),_0x17f2a4,_[_0x3cdd('0x12')](_0xcb2ade,_0x3cdd('0x13'))[_0x3cdd('0x14')](',\x20'));_0xb46bb7[_0x3cdd('0x15')]();}else{var _0x4b74ab=_[_0x3cdd('0x16')](_0x408f0f[_0x3cdd('0x17')],handleFindAgent(_0x4ac2f0[_0x3cdd('0xc')]));if(_0x4b74ab){var _0x19b632=(_0x4ac2f0[_0x3cdd('0x18')]||0xa)*0x3e8;var _0x403ac8,_0x4cb2d1;var _0x11fd00=seqqueue[_0x3cdd('0x19')](_0x19b632);_0x11fd00['id']=_0x17f2a4;_0x11fd00[_0x3cdd('0x1a')]=_0x19b632;_0x11fd00[_0x3cdd('0x1b')]=_0xfdb648['channel'];writeLog(_0x17f2a4,_0x4b74ab,util[_0x3cdd('0xa')](_0x3cdd('0x1c'),_0x19b632));_0x408f0f['rules'][_0x17f2a4]['on'](_0x3cdd('0x1d'),function(){logger[_0x3cdd('0x1e')](_0x3cdd('0x1f'),_0x17f2a4);clearTimeout(_0x4cb2d1);_0x4cb2d1=undefined;_0x11fd00[_0x3cdd('0x20')]();if(_0x408f0f['rules'][_0x17f2a4]){delete _0x408f0f['rules'][_0x17f2a4];}_0xb46bb7[_0x3cdd('0x15')]();});_0x408f0f[_0x3cdd('0x21')][_0x17f2a4]['on'](_0x3cdd('0x22'),function(){if(_0x408f0f[_0x3cdd('0x21')][_0x17f2a4]){delete _0x408f0f[_0x3cdd('0x21')][_0x17f2a4];}});_0x4cb2d1=setTimeout(function(){logger[_0x3cdd('0x1e')](_0x3cdd('0x23'),_0x17f2a4);clearTimeout(_0x4cb2d1);_0x11fd00[_0x3cdd('0x20')]();_0xb46bb7['next']();},_0x19b632);strategy[_0x3cdd('0x24')](_0x11fd00,_0x4b74ab,_0x408f0f,_0xfdb648);}else{logger['error'](_0x3cdd('0x25'),_0x17f2a4,_0x4ac2f0[_0x3cdd('0xc')]);_0xb46bb7[_0x3cdd('0x15')]();}}}catch(_0x103bef){console[_0x3cdd('0x26')](_0x103bef);logger[_0x3cdd('0x10')](_0x3cdd('0x27'),_0x17f2a4,_0x103bef[_0x3cdd('0x28')]);_0xb46bb7['stop']();}};}; \ No newline at end of file +var _0xcf22=['join','stop','find','agents','timeout','channel','format','START:%s','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','log','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0xcf22,0x99));var _0x2cf2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xcf22[_0x2e4aa2];return _0x5e6092;};'use strict';var schema=require(_0x2cf2('0x0'));var _=require(_0x2cf2('0x1'));var util=require(_0x2cf2('0x2'));var seqqueue=require(_0x2cf2('0x3'));var logger=require(_0x2cf2('0x4'))(_0x2cf2('0x5'));var strategy=require(_0x2cf2('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x2cf2('0x7')},'timeout':{'type':_0x2cf2('0x8'),'message':_0x2cf2('0x9')}});function writeLog(_0x27c1fa,_0x4cb821,_0xd01371){return logger['info'](util['format'](_0x2cf2('0xa'),_0x27c1fa,_0x4cb821[_0x2cf2('0xb')],_0xd01371));}function handleFindAgent(_0x521215){return function(_0xb0f459){return _0xb0f459[_0x2cf2('0xb')][_0x2cf2('0xc')]()===_0x521215[_0x2cf2('0xc')]();};}exports[_0x2cf2('0xd')]=function(_0x1326ea,_0x23402a,_0x5b8e94,_0x137107){return function(_0x1b4586){try{var _0x5f0794={'name':_0x23402a[0x0],'timeout':_0x23402a[0x1]};var _0xe70def=queue[_0x2cf2('0x0')](_0x5f0794,{'typecast':!![]});if(_0xe70def[_0x2cf2('0xe')]){logger[_0x2cf2('0xf')]('[%s][AGENT]\x20%s',_0x1326ea,_[_0x2cf2('0x10')](_0xe70def,'message')[_0x2cf2('0x11')](',\x20'));_0x1b4586[_0x2cf2('0x12')]();}else{var _0x21ca5e=_[_0x2cf2('0x13')](_0x5b8e94[_0x2cf2('0x14')],handleFindAgent(_0x5f0794[_0x2cf2('0xb')]));if(_0x21ca5e){var _0x3ad45a=(_0x5f0794[_0x2cf2('0x15')]||0xa)*0x3e8;var _0x573658,_0x4fe400;var _0x3988c9=seqqueue['createQueue'](_0x3ad45a);_0x3988c9['id']=_0x1326ea;_0x3988c9['atimeout']=_0x3ad45a;_0x3988c9[_0x2cf2('0x16')]=_0x137107[_0x2cf2('0x16')];writeLog(_0x1326ea,_0x21ca5e,util[_0x2cf2('0x17')](_0x2cf2('0x18'),_0x3ad45a));_0x5b8e94['rules'][_0x1326ea]['on'](_0x2cf2('0x19'),function(){logger[_0x2cf2('0x1a')](_0x2cf2('0x1b'),_0x1326ea);clearTimeout(_0x4fe400);_0x4fe400=undefined;_0x3988c9[_0x2cf2('0x1c')]();if(_0x5b8e94[_0x2cf2('0x1d')][_0x1326ea]){delete _0x5b8e94[_0x2cf2('0x1d')][_0x1326ea];}_0x1b4586[_0x2cf2('0x12')]();});_0x5b8e94[_0x2cf2('0x1d')][_0x1326ea]['on'](_0x2cf2('0x1e'),function(){if(_0x5b8e94[_0x2cf2('0x1d')][_0x1326ea]){delete _0x5b8e94[_0x2cf2('0x1d')][_0x1326ea];}});_0x4fe400=setTimeout(function(){logger[_0x2cf2('0x1a')](_0x2cf2('0x1f'),_0x1326ea);clearTimeout(_0x4fe400);_0x3988c9[_0x2cf2('0x1c')]();_0x1b4586[_0x2cf2('0x20')]();},_0x3ad45a);strategy['agent'](_0x3988c9,_0x21ca5e,_0x5b8e94,_0x137107);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1326ea,_0x5f0794['name']);_0x1b4586['stop']();}}}catch(_0xd1adea){console[_0x2cf2('0x21')](_0xd1adea);logger[_0x2cf2('0xf')]('[%s][QUEUE]\x20%s',_0x1326ea,_0xd1adea['stack']);_0x1b4586[_0x2cf2('0x12')]();}};}; \ 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 3c00241..d5ebf38 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 _0xed5e=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','error','amazonlex','providerResponse','dialogState','Failed','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed5e,0x12f));var _0xeed5=function(_0x1392c1,_0x5e9cbe){_0x1392c1=_0x1392c1-0x0;var _0x4c3da2=_0xed5e[_0x1392c1];return _0x4c3da2;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xeed5('0x0'))(_0xeed5('0x1'));var rpc={'chatMessage':require(_0xeed5('0x2')),'openchannelMessage':require(_0xeed5('0x3')),'mailMessage':require(_0xeed5('0x4')),'smsMessage':require(_0xeed5('0x5')),'faxMessage':require(_0xeed5('0x6')),'whatsappMessage':require(_0xeed5('0x7'))};exports[_0xeed5('0x8')]=function(_0x5bfb33,_0x29683b){return function(_0x30b14c){try{if(!_[_0xeed5('0x9')](this[_0xeed5('0xa')][_0xeed5('0xb')])){logger[_0xeed5('0xc')]('[%s][AMAZONLEX]\x20%s',_0x5bfb33,_0xeed5('0xd'));return _0x30b14c[_0xeed5('0xe')]();}var _0xd36779={'ContactId':this[_0xeed5('0xf')]['id'],'sentAt':moment()['format'](_0xeed5('0x10')),'direction':_0xeed5('0x11')};if(this['channel']===_0xeed5('0x12')||this[_0xeed5('0x13')]===_0xeed5('0x14')){_0xd36779[_0xeed5('0x15')]=this[_0xeed5('0xa')]['phone'];}var _0x5672cc=this['channel'];if(_0x5672cc===_0xeed5('0x16')){_0xd36779[_0xeed5('0x17')]=this[_0xeed5('0x18')]['id'];}else{_0xd36779[_[_0xeed5('0x19')](_0x5672cc)+_0xeed5('0x1a')]=this[_0xeed5('0x18')]['id'];}_0xd36779[_['upperFirst'](_0x5672cc)+_0xeed5('0x1b')]=this[_0xeed5('0xa')]['id'];if(this[_0xeed5('0xa')][_0xeed5('0x1c')]){var _0x466533=_0x29683b[0x4];if(!_[_0xeed5('0x1d')](_0x466533)){_0xd36779[_0xeed5('0x1e')]=utils[_0xeed5('0x1f')](_0x466533,this);return rpc[_0x5672cc+_0xeed5('0x20')][_0xeed5('0x21')](_0xd36779)[_0xeed5('0x22')](function(_0x33d975){logger[_0xeed5('0xc')](_0xeed5('0x23'),_0x5bfb33,_0xd36779[_0xeed5('0x1e')]);})[_0xeed5('0x24')](function(_0x88d3c7){logger['error'](_0xeed5('0x23'),_0x5bfb33,JSON[_0xeed5('0x25')](_0x88d3c7));})['finally'](function(){logger[_0xeed5('0xc')](_0xeed5('0x26'),_0x5bfb33);_0x30b14c[_0xeed5('0x27')]();});}else{logger[_0xeed5('0xc')](_0xeed5('0x28'),_0x5bfb33);_0x30b14c['stop']();}}else{var _0x2a0f00=this;var _0x48c4cc=new AWS[(_0xeed5('0x29'))]({'accessKeyId':_0x29683b[0x0],'secretAccessKey':_0x29683b[0x1],'region':_0x29683b[0x2]});var _0x35bffd={'botAlias':_0xeed5('0x2a'),'botName':_0x29683b[0x3],'inputText':this[_0xeed5('0x2b')][_0xeed5('0x1e')],'userId':this['channel']+':'+this[_0xeed5('0xa')]['id']['toString']()};_0x48c4cc['postText'](_0x35bffd,function(_0x264621,_0xfe7693){if(_0x264621){logger[_0xeed5('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x5bfb33,_0x264621[_0xeed5('0x2b')]);_0x30b14c['next']();}else if(_0xfe7693&&_0xfe7693['message']){_0x2a0f00[_0xeed5('0x1e')]['amazonlex']=_0xfe7693;_0xd36779['body']=_0xfe7693[_0xeed5('0x2b')];_0xd36779['providerName']=_0xeed5('0x2d');_0xd36779[_0xeed5('0x2e')]=JSON[_0xeed5('0x25')](_0xfe7693);return rpc[_0x5672cc+_0xeed5('0x20')]['create'](_0xd36779)[_0xeed5('0x22')](function(_0x7816c1){logger[_0xeed5('0xc')](_0xeed5('0x23'),_0x5bfb33,_0xd36779['body']);if(_0xfe7693[_0xeed5('0x2f')]==_0xeed5('0x30')){_0x30b14c['next']();}else{_0x30b14c[_0xeed5('0x27')]();}})['catch'](function(_0x556cde){logger[_0xeed5('0x2c')](_0xeed5('0x23'),_0x5bfb33,JSON[_0xeed5('0x25')](_0x556cde));_0x30b14c['next']();});}else{_0x30b14c[_0xeed5('0xe')]();}});}}catch(_0x95c61d){logger[_0xeed5('0x2c')](_0xeed5('0x23'),_0x5bfb33,JSON[_0xeed5('0x25')](_0x95c61d));_0x30b14c[_0xeed5('0x27')]();}};}; \ No newline at end of file +var _0x2f76=['stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','postText','message','amazonlex','providerName','providerResponse','dialogState','Failed','catch'];(function(_0x25de8a,_0x118831){var _0x1ceae4=function(_0x34eecd){while(--_0x34eecd){_0x25de8a['push'](_0x25de8a['shift']());}};_0x1ceae4(++_0x118831);}(_0x2f76,0x11b));var _0x62f7=function(_0x4466c4,_0x502c3a){_0x4466c4=_0x4466c4-0x0;var _0x380fd0=_0x2f76[_0x4466c4];return _0x380fd0;};'use strict';var _=require(_0x62f7('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x62f7('0x1'));var logger=require(_0x62f7('0x2'))(_0x62f7('0x3'));var rpc={'chatMessage':require(_0x62f7('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x62f7('0x5')),'faxMessage':require(_0x62f7('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x62f7('0x7')]=function(_0x1e8d95,_0xb142b5){return function(_0xa9b8b3){try{if(!_[_0x62f7('0x8')](this[_0x62f7('0x9')]['UserId'])){logger[_0x62f7('0xa')](_0x62f7('0xb'),_0x1e8d95,_0x62f7('0xc'));return _0xa9b8b3[_0x62f7('0xd')]();}var _0x5caff9={'ContactId':this[_0x62f7('0xe')]['id'],'sentAt':moment()[_0x62f7('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x62f7('0x10')};if(this['channel']===_0x62f7('0x11')||this[_0x62f7('0x12')]===_0x62f7('0x13')){_0x5caff9[_0x62f7('0x14')]=this[_0x62f7('0x9')][_0x62f7('0x14')];}var _0x3d4a1b=this['channel'];if(_0x3d4a1b===_0x62f7('0x15')){_0x5caff9[_0x62f7('0x16')]=this[_0x62f7('0x17')]['id'];}else{_0x5caff9[_['upperFirst'](_0x3d4a1b)+'AccountId']=this['account']['id'];}_0x5caff9[_[_0x62f7('0x18')](_0x3d4a1b)+_0x62f7('0x19')]=this[_0x62f7('0x9')]['id'];if(this[_0x62f7('0x9')][_0x62f7('0x1a')]){var _0x1a37a2=_0xb142b5[0x4];if(!_[_0x62f7('0x1b')](_0x1a37a2)){_0x5caff9[_0x62f7('0x1c')]=utils[_0x62f7('0x1d')](_0x1a37a2,this);return rpc[_0x3d4a1b+_0x62f7('0x1e')][_0x62f7('0x1f')](_0x5caff9)[_0x62f7('0x20')](function(_0x233ce3){logger[_0x62f7('0xa')](_0x62f7('0xb'),_0x1e8d95,_0x5caff9[_0x62f7('0x1c')]);})['catch'](function(_0x3b61ee){logger[_0x62f7('0x21')]('[%s][AMAZONLEX]\x20%s',_0x1e8d95,JSON['stringify'](_0x3b61ee));})[_0x62f7('0x22')](function(){logger[_0x62f7('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1e8d95);_0xa9b8b3[_0x62f7('0x23')]();});}else{logger[_0x62f7('0xa')](_0x62f7('0x24'),_0x1e8d95);_0xa9b8b3[_0x62f7('0x23')]();}}else{var _0x524fda=this;var _0x22b204=new AWS[(_0x62f7('0x25'))]({'accessKeyId':_0xb142b5[0x0],'secretAccessKey':_0xb142b5[0x1],'region':_0xb142b5[0x2]});var _0x556afb={'botAlias':'$LATEST','botName':_0xb142b5[0x3],'inputText':this['message'][_0x62f7('0x1c')],'userId':this[_0x62f7('0x12')]+':'+this[_0x62f7('0x9')]['id']['toString']()};_0x22b204[_0x62f7('0x26')](_0x556afb,function(_0x4e3c91,_0x135513){if(_0x4e3c91){logger[_0x62f7('0x21')](_0x62f7('0xb'),_0x1e8d95,_0x4e3c91['message']);_0xa9b8b3[_0x62f7('0xd')]();}else if(_0x135513&&_0x135513[_0x62f7('0x27')]){_0x524fda['body'][_0x62f7('0x28')]=_0x135513;_0x5caff9[_0x62f7('0x1c')]=_0x135513[_0x62f7('0x27')];_0x5caff9[_0x62f7('0x29')]='amazonlex';_0x5caff9[_0x62f7('0x2a')]=JSON['stringify'](_0x135513);return rpc[_0x3d4a1b+_0x62f7('0x1e')][_0x62f7('0x1f')](_0x5caff9)[_0x62f7('0x20')](function(_0x524c44){logger['info'](_0x62f7('0xb'),_0x1e8d95,_0x5caff9[_0x62f7('0x1c')]);if(_0x135513[_0x62f7('0x2b')]==_0x62f7('0x2c')){_0xa9b8b3['next']();}else{_0xa9b8b3['stop']();}})[_0x62f7('0x2d')](function(_0x430d8d){logger[_0x62f7('0x21')](_0x62f7('0xb'),_0x1e8d95,JSON[_0x62f7('0x2e')](_0x430d8d));_0xa9b8b3[_0x62f7('0xd')]();});}else{_0xa9b8b3[_0x62f7('0xd')]();}});}}catch(_0x4316c0){logger[_0x62f7('0x21')](_0x62f7('0xb'),_0x1e8d95,JSON[_0x62f7('0x2e')](_0x4316c0));_0xa9b8b3[_0x62f7('0x23')]();}};}; \ 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 6c0bbd8..ce8ee8b 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 _0x27b0=['resolve','autoreplyExecuted','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','contact','format','getMustacheRender','message','phone','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','InteractionId','Message','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x27b0,0x10b));var _0x027b=function(_0x132787,_0x49aebb){_0x132787=_0x132787-0x0;var _0x281428=_0x27b0[_0x132787];return _0x281428;};'use strict';var _=require(_0x027b('0x0'));var moment=require(_0x027b('0x1'));var utils=require(_0x027b('0x2'));var logger=require('../../../../config/logger')(_0x027b('0x3'));var rpc={'chatMessage':require(_0x027b('0x4')),'openchannelMessage':require(_0x027b('0x5')),'mailMessage':require(_0x027b('0x6')),'smsMessage':require(_0x027b('0x7')),'faxMessage':require(_0x027b('0x8')),'whatsappMessage':require(_0x027b('0x9')),'chatInteraction':require(_0x027b('0xa')),'openchannelInteraction':require(_0x027b('0xb')),'mailInteraction':require(_0x027b('0xc')),'smsInteraction':require(_0x027b('0xd')),'faxInteraction':require(_0x027b('0xe')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x1c249f,_0x20dc1a,_0x1eff68,_0x23ef1c){return function(_0x26c644){try{var _0x201c91=this[_0x027b('0xf')];if(_0x201c91===_0x027b('0x10')&&_0x23ef1c[_0x027b('0x11')][_0x027b('0x12')]){logger['info'](_0x027b('0x13'),_0x1c249f,_0x027b('0x14'));return _0x26c644[_0x027b('0x15')]();}if(_0x20dc1a[0x0]==='1'&&(_[_0x027b('0x16')](this['interaction']['created'])||!this[_0x027b('0x17')][_0x027b('0x18')])){logger[_0x027b('0x19')](_0x027b('0x13'),_0x1c249f,_0x027b('0x1a'));return _0x26c644['next']();}if(_0x20dc1a[0x0]==='2'&&this[_0x027b('0x17')]['autoreplyExecuted']){logger[_0x027b('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1c249f,_0x027b('0x1b'));return _0x26c644[_0x027b('0x15')]();}var _0x4ee770={'ContactId':this[_0x027b('0x1c')]['id'],'sentAt':moment()[_0x027b('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']==='mail'){_0x4ee770['body']=utils['getMustacheRender'](_0x20dc1a[0x2],this);}else{_0x4ee770[_0x027b('0x11')]=utils[_0x027b('0x1e')](_0x20dc1a[0x1],this);}if(this[_0x027b('0x1f')]){_0x4ee770['to']=this[_0x027b('0x1f')]['from']||'';if(this[_0x027b('0xf')]===_0x027b('0x10')&&_0x20dc1a[0x1]==='1'){_0x4ee770['cc']=this[_0x027b('0x1f')]['cc']||'';}_0x4ee770['from']=this[_0x027b('0x1f')]['to']||'';_0x4ee770[_0x027b('0x20')]=this[_0x027b('0x1f')][_0x027b('0x20')]||'';_0x4ee770['read']=!![];if(this[_0x027b('0x1f')][_0x027b('0x21')]){_0x4ee770[_0x027b('0x21')]='';_0x4ee770[_0x027b('0x21')]+=_['startsWith'](this[_0x027b('0x1f')][_0x027b('0x21')],_0x027b('0x22'))?'':_0x027b('0x23');_0x4ee770[_0x027b('0x21')]+=this[_0x027b('0x1f')]['subject'];}}if(this[_0x027b('0xf')]==='chat'){_0x4ee770[_0x027b('0x24')]=this[_0x027b('0x25')]['id'];}else{_0x4ee770[_['upperFirst'](this['channel'])+'AccountId']=this[_0x027b('0x25')]['id'];}_0x4ee770[_[_0x027b('0x26')](this['channel'])+_0x027b('0x27')]=this[_0x027b('0x17')]['id'];var _0x2445f8=this['interaction'];if(rpc[this['channel']+_0x027b('0x28')]){if(this[_0x027b('0xf')]===_0x027b('0x10')){_0x4ee770['inReplyTo']=this[_0x027b('0x1f')][_0x027b('0x29')];_0x4ee770[_0x027b('0x2a')]=_0x027b('0x2b')+_[_0x027b('0x2c')](_0x4ee770['body'],'','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','error','resolve','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stringify','finally','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from'];(function(_0x3dfa26,_0x18d78b){var _0x25b22e=function(_0x3ef4d4){while(--_0x3ef4d4){_0x3dfa26['push'](_0x3dfa26['shift']());}};_0x25b22e(++_0x18d78b);}(_0x54cf,0xa4));var _0xf54c=function(_0x43ac13,_0x1e0741){_0x43ac13=_0x43ac13-0x0;var _0x35c5d5=_0x54cf[_0x43ac13];return _0x35c5d5;};'use strict';var _=require(_0xf54c('0x0'));var moment=require('moment');var utils=require(_0xf54c('0x1'));var logger=require(_0xf54c('0x2'))(_0xf54c('0x3'));var rpc={'chatMessage':require(_0xf54c('0x4')),'openchannelMessage':require(_0xf54c('0x5')),'mailMessage':require(_0xf54c('0x6')),'smsMessage':require(_0xf54c('0x7')),'faxMessage':require(_0xf54c('0x8')),'whatsappMessage':require(_0xf54c('0x9')),'chatInteraction':require(_0xf54c('0xa')),'openchannelInteraction':require(_0xf54c('0xb')),'mailInteraction':require(_0xf54c('0xc')),'smsInteraction':require(_0xf54c('0xd')),'faxInteraction':require(_0xf54c('0xe')),'whatsappInteraction':require(_0xf54c('0xf'))};var mailRpc=require(_0xf54c('0x10'));exports[_0xf54c('0x11')]=function(_0x2679fa,_0x3ee8dc,_0x17dabd,_0x354610){return function(_0x224ebf){try{var _0x2f69ac=this[_0xf54c('0x12')];if(_0x2f69ac===_0xf54c('0x13')&&_0x354610[_0xf54c('0x14')][_0xf54c('0x15')]){logger[_0xf54c('0x16')](_0xf54c('0x17'),_0x2679fa,_0xf54c('0x18'));return _0x224ebf[_0xf54c('0x19')]();}if(_0x3ee8dc[0x0]==='1'&&(_['isNil'](this[_0xf54c('0x1a')][_0xf54c('0x1b')])||!this[_0xf54c('0x1a')]['created'])){logger[_0xf54c('0x16')]('[%s][AUTOREPLY]\x20%s',_0x2679fa,'Autoreply\x20already\x20sent');return _0x224ebf[_0xf54c('0x19')]();}if(_0x3ee8dc[0x0]==='2'&&this[_0xf54c('0x1a')][_0xf54c('0x1c')]){logger[_0xf54c('0x16')](_0xf54c('0x1d'),_0x2679fa,_0xf54c('0x1e'));return _0x224ebf['next']();}var _0xa5b409={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf54c('0x1f')](_0xf54c('0x20')),'direction':_0xf54c('0x21')};if(this[_0xf54c('0x12')]==='mail'){_0xa5b409[_0xf54c('0x14')]=utils[_0xf54c('0x22')](_0x3ee8dc[0x2],this);}else{_0xa5b409[_0xf54c('0x14')]=utils[_0xf54c('0x22')](_0x3ee8dc[0x1],this);}if(this[_0xf54c('0x23')]){_0xa5b409['to']=this[_0xf54c('0x23')][_0xf54c('0x24')]||'';if(this['channel']==='mail'&&_0x3ee8dc[0x1]==='1'){_0xa5b409['cc']=this['message']['cc']||'';}_0xa5b409[_0xf54c('0x24')]=this[_0xf54c('0x23')]['to']||'';_0xa5b409[_0xf54c('0x25')]=this[_0xf54c('0x23')][_0xf54c('0x25')]||'';_0xa5b409['read']=!![];if(this[_0xf54c('0x23')][_0xf54c('0x26')]){_0xa5b409[_0xf54c('0x26')]='';_0xa5b409[_0xf54c('0x26')]+=_[_0xf54c('0x27')](this[_0xf54c('0x23')][_0xf54c('0x26')],'Re:')?'':'Re:\x20';_0xa5b409['subject']+=this[_0xf54c('0x23')]['subject'];}}if(this[_0xf54c('0x12')]===_0xf54c('0x28')){_0xa5b409[_0xf54c('0x29')]=this[_0xf54c('0x2a')]['id'];}else{_0xa5b409[_[_0xf54c('0x2b')](this['channel'])+_0xf54c('0x2c')]=this[_0xf54c('0x2a')]['id'];}_0xa5b409[_[_0xf54c('0x2b')](this[_0xf54c('0x12')])+'InteractionId']=this[_0xf54c('0x1a')]['id'];var _0x3e144a=this[_0xf54c('0x1a')];if(rpc[this['channel']+_0xf54c('0x2d')]){if(this['channel']===_0xf54c('0x13')){_0xa5b409[_0xf54c('0x2e')]=this[_0xf54c('0x23')]['messageId'];_0xa5b409[_0xf54c('0x2f')]=''+_['replace'](_0xa5b409[_0xf54c('0x14')],_0xf54c('0x30'),']+(>|$)/g,''),'priorityTrue':_0x13432c[0x1],'priorityFalse':_0x13432c[0x2]};var _0x14b535=gotoif[_0xf4b0('0x0')](_0x495d4d,{'typecast':!![]});if(_0x14b535[_0xf4b0('0xd')]){logger['error'](_0xf4b0('0xe'),_0x623347,_[_0xf4b0('0xf')](_0x14b535,_0xf4b0('0x10'))[_0xf4b0('0x11')](',\x20'));_0x3568ae[_0xf4b0('0x12')]();}else{try{var _0x26329b=eval('('+_0x495d4d[_0xf4b0('0x13')]+')');var _0x5a878f=_0x26329b?_0x495d4d[_0xf4b0('0x14')]:_0x495d4d[_0xf4b0('0x15')];logger[_0xf4b0('0x16')](_0xf4b0('0x17'),_0x623347,_0x495d4d[_0xf4b0('0x13')],_0x26329b,_0x5a878f||_0xf4b0('0x18'));if(_0x5a878f){var _0x4604a4=_[_0xf4b0('0x19')](_0x3568ae[_0xf4b0('0x1a')](),{'p':_0x5a878f});if(_0x4604a4>=0x0){logger[_0xf4b0('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x623347,_0x5a878f||_0xf4b0('0x18'),_0x4604a4);_0x3568ae[_0xf4b0('0x18')](_0x4604a4);}else{logger[_0xf4b0('0x16')](_0xf4b0('0x1b'),_0x623347,_0x5a878f||_0xf4b0('0x18'));_0x3568ae[_0xf4b0('0x12')]();}}else{_0x3568ae[_0xf4b0('0x18')]();}}catch(_0x3712d9){logger[_0xf4b0('0x1c')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x623347,_0x3712d9[_0xf4b0('0x10')]);_0x3568ae[_0xf4b0('0x12')]();}}}catch(_0x1644f1){logger[_0xf4b0('0x1c')]('[%s][GOTOIF]\x20%s',_0x623347,JSON[_0xf4b0('0x1d')](_0x1644f1));_0x3568ae[_0xf4b0('0x12')]();}};}; \ No newline at end of file +var _0xfafd=['priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','message','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x1134e4,_0x4eaa9e){var _0x3e476b=function(_0x57f631){while(--_0x57f631){_0x1134e4['push'](_0x1134e4['shift']());}};_0x3e476b(++_0x4eaa9e);}(_0xfafd,0xbb));var _0xdfaf=function(_0x3ea2f2,_0x18fba0){_0x3ea2f2=_0x3ea2f2-0x0;var _0x1ebd52=_0xfafd[_0x3ea2f2];return _0x1ebd52;};'use strict';var schema=require(_0xdfaf('0x0'));var _=require(_0xdfaf('0x1'));var htmlToText=require(_0xdfaf('0x2'));var utils=require(_0xdfaf('0x3'));var logger=require(_0xdfaf('0x4'))(_0xdfaf('0x5'));var gotoif=schema({'condition':{'type':_0xdfaf('0x6'),'required':!![],'message':_0xdfaf('0x7')},'priorityTrue':{'type':_0xdfaf('0x8'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xdfaf('0x8'),'message':_0xdfaf('0x9')}});exports[_0xdfaf('0xa')]=function(_0x4b0eba,_0x38e6c1){return function(_0x46cbfe){try{var _0x189b9c={'condition':htmlToText[_0xdfaf('0xb')](utils[_0xdfaf('0xc')](_0x38e6c1[0x0],this),{'wordwrap':![]})[_0xdfaf('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x38e6c1[0x1],'priorityFalse':_0x38e6c1[0x2]};var _0x499e64=gotoif[_0xdfaf('0x0')](_0x189b9c,{'typecast':!![]});if(_0x499e64[_0xdfaf('0xe')]){logger[_0xdfaf('0xf')]('[%s][GOTOIF]\x20%s',_0x4b0eba,_['map'](_0x499e64,_0xdfaf('0x10'))['join'](',\x20'));_0x46cbfe['stop']();}else{try{var _0x52ada6=eval('('+_0x189b9c['condition']+')');var _0x258f4d=_0x52ada6?_0x189b9c['priorityTrue']:_0x189b9c[_0xdfaf('0x11')];logger[_0xdfaf('0x12')](_0xdfaf('0x13'),_0x4b0eba,_0x189b9c[_0xdfaf('0x14')],_0x52ada6,_0x258f4d||_0xdfaf('0x15'));if(_0x258f4d){var _0x15afc4=_[_0xdfaf('0x16')](_0x46cbfe['rules'](),{'p':_0x258f4d});if(_0x15afc4>=0x0){logger[_0xdfaf('0x12')](_0xdfaf('0x17'),_0x4b0eba,_0x258f4d||_0xdfaf('0x15'),_0x15afc4);_0x46cbfe[_0xdfaf('0x15')](_0x15afc4);}else{logger[_0xdfaf('0x12')](_0xdfaf('0x18'),_0x4b0eba,_0x258f4d||_0xdfaf('0x15'));_0x46cbfe[_0xdfaf('0x19')]();}}else{_0x46cbfe[_0xdfaf('0x15')]();}}catch(_0xe51244){logger[_0xdfaf('0xf')](_0xdfaf('0x1a'),_0x4b0eba,_0xe51244['message']);_0x46cbfe['stop']();}}}catch(_0x33cdb8){logger[_0xdfaf('0xf')](_0xdfaf('0x1b'),_0x4b0eba,JSON['stringify'](_0x33cdb8));_0x46cbfe[_0xdfaf('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 633048d..3b611df 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 _0x24a2=['error','[%s][GOTOP]\x20%s','message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x4883cb,_0x3df63c){var _0x33aad7=function(_0x2e901e){while(--_0x2e901e){_0x4883cb['push'](_0x4883cb['shift']());}};_0x33aad7(++_0x3df63c);}(_0x24a2,0x1ca));var _0x224a=function(_0x377473,_0x1c807f){_0x377473=_0x377473-0x0;var _0x14f6ec=_0x24a2[_0x377473];return _0x14f6ec;};'use strict';var schema=require(_0x224a('0x0'));var _=require('lodash');var logger=require(_0x224a('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x224a('0x2')}});exports[_0x224a('0x3')]=function(_0x20156b,_0x886c24){return function(_0x91c37f){try{var _0x307ce9={'priority':_0x886c24[0x0]};var _0x13bc83=gotop[_0x224a('0x0')](_0x307ce9,{'typecast':!![]});if(_0x13bc83['length']){logger[_0x224a('0x4')](_0x224a('0x5'),_0x20156b,_['map'](_0x13bc83,_0x224a('0x6'))['join'](',\x20'));_0x91c37f[_0x224a('0x7')]();}else{logger[_0x224a('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x20156b,_0x307ce9[_0x224a('0x9')]);if(_0x307ce9[_0x224a('0x9')]){var _0x90a040=_[_0x224a('0xa')](_0x91c37f[_0x224a('0xb')](),{'p':_0x307ce9['priority']});if(_0x90a040>=0x0){logger[_0x224a('0x8')](_0x224a('0xc'),_0x20156b,_0x307ce9['priority']||_0x224a('0xd'),_0x90a040);_0x91c37f[_0x224a('0xd')](_0x90a040);}else{logger[_0x224a('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x20156b,_0x307ce9[_0x224a('0x9')]||'next');_0x91c37f['stop']();}}else{_0x91c37f['next']();}}}catch(_0x532b99){logger[_0x224a('0x4')](_0x224a('0x5'),_0x20156b,JSON['stringify'](_0x532b99));_0x91c37f[_0x224a('0x7')]();}};}; \ No newline at end of file +var _0x8a94=['[%s][GOTOP]\x20priority\x20%s','priority','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','join','stop'];(function(_0x5662f2,_0x550cb0){var _0x2469f5=function(_0x3baa0c){while(--_0x3baa0c){_0x5662f2['push'](_0x5662f2['shift']());}};_0x2469f5(++_0x550cb0);}(_0x8a94,0x1db));var _0x48a9=function(_0x5d6f14,_0x469f51){_0x5d6f14=_0x5d6f14-0x0;var _0x1ec141=_0x8a94[_0x5d6f14];return _0x1ec141;};'use strict';var schema=require(_0x48a9('0x0'));var _=require('lodash');var logger=require(_0x48a9('0x1'))(_0x48a9('0x2'));var gotop=schema({'priority':{'type':_0x48a9('0x3'),'required':!![],'message':_0x48a9('0x4')}});exports[_0x48a9('0x5')]=function(_0x4d4e83,_0x3c6d94){return function(_0x3488ff){try{var _0x215446={'priority':_0x3c6d94[0x0]};var _0x2dddd5=gotop[_0x48a9('0x0')](_0x215446,{'typecast':!![]});if(_0x2dddd5[_0x48a9('0x6')]){logger[_0x48a9('0x7')](_0x48a9('0x8'),_0x4d4e83,_['map'](_0x2dddd5,'message')[_0x48a9('0x9')](',\x20'));_0x3488ff[_0x48a9('0xa')]();}else{logger['info'](_0x48a9('0xb'),_0x4d4e83,_0x215446[_0x48a9('0xc')]);if(_0x215446[_0x48a9('0xc')]){var _0x341aed=_['findIndex'](_0x3488ff[_0x48a9('0xd')](),{'p':_0x215446[_0x48a9('0xc')]});if(_0x341aed>=0x0){logger[_0x48a9('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4d4e83,_0x215446['priority']||_0x48a9('0xf'),_0x341aed);_0x3488ff[_0x48a9('0xf')](_0x341aed);}else{logger[_0x48a9('0xe')](_0x48a9('0x10'),_0x4d4e83,_0x215446[_0x48a9('0xc')]||'next');_0x3488ff[_0x48a9('0xa')]();}}else{_0x3488ff[_0x48a9('0xf')]();}}}catch(_0x3e4fd3){logger[_0x48a9('0x7')]('[%s][GOTOP]\x20%s',_0x4d4e83,JSON[_0x48a9('0x11')](_0x3e4fd3));_0x3488ff['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 7a62687..1055256 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 _0x9173=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils'];(function(_0x4ef333,_0x56d641){var _0xf09c25=function(_0x21b9e3){while(--_0x21b9e3){_0x4ef333['push'](_0x4ef333['shift']());}};_0xf09c25(++_0x56d641);}(_0x9173,0xb4));var _0x3917=function(_0x2844f2,_0x479184){_0x2844f2=_0x2844f2-0x0;var _0x298c39=_0x9173[_0x2844f2];return _0x298c39;};'use strict';var _=require(_0x3917('0x0'));var utils=require(_0x3917('0x1'));var logger=require('../../../../config/logger')(_0x3917('0x2'));var rpc={'chatMessage':require(_0x3917('0x3')),'openchannelMessage':require(_0x3917('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3917('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x3917('0x6'))};exports[_0x3917('0x7')]=function(_0x17ec38,_0x403e03){return function(_0x2dace9){try{var _0x48d592={'body':utils[_0x3917('0x8')](_0x403e03[0x0],this),'ContactId':this[_0x3917('0x9')]['id']};if(this[_0x3917('0xa')]===_0x3917('0xb')){_0x48d592[_0x3917('0xc')]=this[_0x3917('0xd')]['id'];}else{_0x48d592[_['upperFirst'](this[_0x3917('0xa')])+_0x3917('0xe')]=this['account']['id'];}_0x48d592[_[_0x3917('0xf')](this[_0x3917('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0x3917('0x10')]){return rpc[this[_0x3917('0xa')]+_0x3917('0x10')][_0x3917('0x11')](_0x48d592)[_0x3917('0x12')](function(_0xc0902d){logger['info'](_0x3917('0x13'),_0x17ec38,_0x48d592[_0x3917('0x14')]);_0x2dace9[_0x3917('0x15')]();})[_0x3917('0x16')](function(_0x4d7f6c){logger[_0x3917('0x17')](_0x3917('0x13'),_0x17ec38,JSON[_0x3917('0x18')](_0x4d7f6c));_0x2dace9[_0x3917('0x19')]();});}}catch(_0x23821c){logger['error'](_0x3917('0x13'),_0x17ec38,JSON['stringify'](_0x23821c));_0x2dace9['stop']();}};}; \ No newline at end of file +var _0x6222=['stringify','error','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/smsMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','then','[%s][MESSAGE]\x20%s','next'];(function(_0x239c9c,_0x2ef253){var _0x4a471d=function(_0x3136a4){while(--_0x3136a4){_0x239c9c['push'](_0x239c9c['shift']());}};_0x4a471d(++_0x2ef253);}(_0x6222,0x9a));var _0x2622=function(_0x41cd51,_0x48c5f6){_0x41cd51=_0x41cd51-0x0;var _0x292bc5=_0x6222[_0x41cd51];return _0x292bc5;};'use strict';var _=require('lodash');var utils=require(_0x2622('0x0'));var logger=require(_0x2622('0x1'))('routing');var rpc={'chatMessage':require(_0x2622('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2622('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2622('0x4')]=function(_0x3a9e1f,_0x5e8379){return function(_0xf70ae5){try{var _0x1787e2={'body':utils['getMustacheRender'](_0x5e8379[0x0],this),'ContactId':this[_0x2622('0x5')]['id']};if(this[_0x2622('0x6')]===_0x2622('0x7')){_0x1787e2[_0x2622('0x8')]=this[_0x2622('0x9')]['id'];}else{_0x1787e2[_[_0x2622('0xa')](this[_0x2622('0x6')])+_0x2622('0xb')]=this['account']['id'];}_0x1787e2[_[_0x2622('0xa')](this[_0x2622('0x6')])+_0x2622('0xc')]=this['interaction']['id'];if(rpc[this[_0x2622('0x6')]+_0x2622('0xd')]){return rpc[this[_0x2622('0x6')]+_0x2622('0xd')]['create'](_0x1787e2)[_0x2622('0xe')](function(_0x12b323){logger['info'](_0x2622('0xf'),_0x3a9e1f,_0x1787e2['body']);_0xf70ae5[_0x2622('0x10')]();})['catch'](function(_0x434882){logger['error'](_0x2622('0xf'),_0x3a9e1f,JSON[_0x2622('0x11')](_0x434882));_0xf70ae5['stop']();});}}catch(_0x1308db){logger[_0x2622('0x12')](_0x2622('0xf'),_0x3a9e1f,JSON['stringify'](_0x1308db));_0xf70ae5['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 0459be7..7daa01c 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 _0x67bc=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x67bc,0x10e));var _0xc67b=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0x67bc[_0x3d9557];return _0x359ff8;};'use strict';var utils=require(_0xc67b('0x0'));var logger=require(_0xc67b('0x1'))(_0xc67b('0x2'));exports[_0xc67b('0x3')]=function(_0x2970a4,_0x170cd6){return function(_0x2304d9){try{logger[_0xc67b('0x4')](_0xc67b('0x5'),_0x2970a4,utils[_0xc67b('0x6')](_0x170cd6[0x0],this));_0x2304d9[_0xc67b('0x7')]();}catch(_0x4e6448){logger[_0xc67b('0x8')](_0xc67b('0x5'),_0x2970a4,JSON[_0xc67b('0x9')](_0x4e6448));_0x2304d9[_0xc67b('0xa')]();}};}; \ No newline at end of file +var _0x6d53=['[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','consequence','info','getMustacheRender','error'];(function(_0x3b2be5,_0x9c01ae){var _0x14cd8=function(_0x5262be){while(--_0x5262be){_0x3b2be5['push'](_0x3b2be5['shift']());}};_0x14cd8(++_0x9c01ae);}(_0x6d53,0x17a));var _0x36d5=function(_0x14562a,_0x4dbda8){_0x14562a=_0x14562a-0x0;var _0x7856af=_0x6d53[_0x14562a];return _0x7856af;};'use strict';var utils=require(_0x36d5('0x0'));var logger=require(_0x36d5('0x1'))('routing');exports[_0x36d5('0x2')]=function(_0x33b3d9,_0x189616){return function(_0x4a25fd){try{logger[_0x36d5('0x3')]('[%s][NOOP]\x20%s',_0x33b3d9,utils[_0x36d5('0x4')](_0x189616[0x0],this));_0x4a25fd['next']();}catch(_0x528248){logger[_0x36d5('0x5')](_0x36d5('0x6'),_0x33b3d9,JSON['stringify'](_0x528248));_0x4a25fd[_0x36d5('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index abb59b0..0c930ce 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 _0xbba6=['validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack'];(function(_0x21c8fe,_0x4361af){var _0x503143=function(_0x240ee9){while(--_0x240ee9){_0x21c8fe['push'](_0x21c8fe['shift']());}};_0x503143(++_0x4361af);}(_0xbba6,0x1a4));var _0x6bba=function(_0x322d43,_0xf8cd0c){_0x322d43=_0x322d43-0x0;var _0x58f111=_0xbba6[_0x322d43];return _0x58f111;};'use strict';var schema=require(_0x6bba('0x0'));var _=require(_0x6bba('0x1'));var util=require(_0x6bba('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x6bba('0x3'));var Redis=require(_0x6bba('0x4'));var config=require(_0x6bba('0x5'));var logger=require(_0x6bba('0x6'))(_0x6bba('0x7'));var strategy=require(_0x6bba('0x8'));config[_0x6bba('0x9')]=_[_0x6bba('0xa')](config[_0x6bba('0x9')],{'host':_0x6bba('0xb'),'port':0x18eb});var io=require(_0x6bba('0xc'))(new Redis(config['redis']));var attributes=['id',_0x6bba('0xd'),_0x6bba('0xe'),'queue',_0x6bba('0xf'),_0x6bba('0x10')];function emit(_0x414bdc,_0x2dba5a,_0x27fd59){io['to'](_0x414bdc)[_0x6bba('0x11')](_0x2dba5a,_0x27fd59);}function emitChannelQueueInteraction(_0x58a115,_0x54e770,_0x317fe1,_0x318138,_0x332de4,_0x3ed425,_0x1bd2fb,_0x362997){var _0x41be6b=_[_0x6bba('0x12')](_0x317fe1);_0x41be6b['queue_id']=_0x362997;_0x41be6b[_0x6bba('0x13')]=_0x54e770;_0x41be6b[_0x6bba('0xe')]=_0x318138;_0x41be6b['id']=_0x332de4;if(_0x3ed425){_0x1bd2fb[util[_0x6bba('0x14')](_0x6bba('0x15'),_0x58a115)][_0x332de4]=_[_0x6bba('0x16')](_0x41be6b,attributes);}else{delete _0x1bd2fb[util[_0x6bba('0x14')](_0x6bba('0x15'),_0x58a115)][_0x332de4];}emit(util[_0x6bba('0x14')]('%s:queue:%s',_0x58a115,_0x54e770),util[_0x6bba('0x14')](_0x6bba('0x17'),_0x58a115,_0x3ed425?_0x6bba('0x18'):_0x6bba('0x19')),_[_0x6bba('0x16')](_0x41be6b,attributes));}var rpc={'openchannelQueueReport':require(_0x6bba('0x1a')),'mailQueueReport':require(_0x6bba('0x1b')),'chatQueueReport':require(_0x6bba('0x1c')),'smsQueueReport':require(_0x6bba('0x1d')),'faxQueueReport':require(_0x6bba('0x1e')),'whatsappQueueReport':require(_0x6bba('0x1f'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x6bba('0x20')},'timeout':{'type':'number','message':_0x6bba('0x21')}});function startRouting(_0x3d0cdd,_0x1c4f64,_0x56e60a,_0x119cde){if(_0x3d0cdd&&_0x1c4f64&&_0x56e60a){_0x1c4f64[_0x6bba('0x22')]+=0x1;var _0x2f6f32={'uniqueid':_0x3d0cdd,'from':_0x56e60a['body']?_0x56e60a[_0x6bba('0x23')][_0x6bba('0xf')]:'','joinAt':moment()[_0x6bba('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56e60a['contact']?_0x56e60a[_0x6bba('0x24')]['id']:null,'ListId':_0x56e60a[_0x6bba('0x25')]?_0x56e60a[_0x6bba('0x25')]['id']:null};_0x2f6f32[_[_0x6bba('0x26')](_0x56e60a[_0x6bba('0x27')])+_0x6bba('0x28')]=_0x1c4f64['id']||null;_0x2f6f32[_[_0x6bba('0x26')](_0x56e60a[_0x6bba('0x27')])+_0x6bba('0x29')]=_0x56e60a[_0x6bba('0x2a')]?_0x56e60a[_0x6bba('0x2a')]['id']:null;_0x2f6f32[_[_0x6bba('0x26')](_0x56e60a['channel'])+_0x6bba('0x2b')]=_0x56e60a[_0x6bba('0x2c')]?_0x56e60a[_0x6bba('0x2c')]['id']:null;_0x2f6f32[_[_0x6bba('0x26')](_0x56e60a['channel'])+(_0x56e60a[_0x6bba('0x27')]!==_0x6bba('0x2d')?_0x6bba('0x2e'):_0x6bba('0x2f'))]=_0x56e60a['account']?_0x56e60a[_0x6bba('0xe')]['id']:null;logger[_0x6bba('0x30')](util[_0x6bba('0x14')](_0x6bba('0x31'),_0x3d0cdd,_0x1c4f64['name']));emitChannelQueueInteraction(_0x56e60a[_0x6bba('0x27')],_0x1c4f64[_0x6bba('0x32')],_0x2f6f32,_0x56e60a[_0x6bba('0xe')][_0x6bba('0x32')],_0x56e60a[_0x6bba('0x2c')]['id'],!![],_0x119cde,_0x1c4f64['id']);if(rpc[_0x56e60a[_0x6bba('0x27')]+'QueueReport']){return rpc[_0x56e60a[_0x6bba('0x27')]+'QueueReport'][_0x6bba('0x33')](_0x2f6f32)[_0x6bba('0x34')](function(_0x484a98){logger[_0x6bba('0x35')](_0x6bba('0x36'));});}}}function stopRouting(_0x150bf5,_0x1d0708,_0x55b650,_0x2569de){if(_0x150bf5&&_0x1d0708){_0x1d0708[_0x6bba('0x22')]-=0x1;var _0x4a50d8={'leaveAt':moment()[_0x6bba('0x14')](_0x6bba('0x37')),'acceptAt':moment()['format'](_0x6bba('0x37')),'reason':_0x6bba('0x38')};logger[_0x6bba('0x30')](util[_0x6bba('0x14')](_0x6bba('0x39'),_0x150bf5,_0x1d0708[_0x6bba('0x32')]));emitChannelQueueInteraction(_0x55b650[_0x6bba('0x27')],_0x1d0708['name'],_0x55b650[_0x6bba('0x23')],_0x55b650[_0x6bba('0xe')][_0x6bba('0x32')],_0x55b650[_0x6bba('0x2c')]['id'],![],_0x2569de,_0x1d0708['id']);if(rpc[_0x55b650[_0x6bba('0x27')]+_0x6bba('0x3a')]){return rpc[_0x55b650[_0x6bba('0x27')]+'QueueReport'][_0x6bba('0x3b')](_0x150bf5,_0x4a50d8)['catch'](function(_0xb36d84){logger[_0x6bba('0x35')](_0x6bba('0x3c'));});}}}function endRouting(_0x17f9f8,_0x19e74d,_0x261b9b,_0x3fb45c){if(_0x17f9f8&&_0x19e74d){_0x19e74d['waiting']-=0x1;var _0x36c17e={'leaveAt':moment()[_0x6bba('0x14')](_0x6bba('0x37')),'exitAt':moment()[_0x6bba('0x14')](_0x6bba('0x37')),'reason':_0x6bba('0x3d')};logger[_0x6bba('0x30')](util[_0x6bba('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x17f9f8,_0x19e74d[_0x6bba('0x32')]));emitChannelQueueInteraction(_0x261b9b[_0x6bba('0x27')],_0x19e74d['name'],_0x261b9b[_0x6bba('0x23')],_0x261b9b[_0x6bba('0xe')]['name'],_0x261b9b[_0x6bba('0x2c')]['id'],![],_0x3fb45c);if(rpc[_0x261b9b[_0x6bba('0x27')]+_0x6bba('0x3a')]){return rpc[_0x261b9b['channel']+_0x6bba('0x3a')][_0x6bba('0x3b')](_0x17f9f8,_0x36c17e)[_0x6bba('0x34')](function(_0x41cb4e){logger[_0x6bba('0x35')](_0x6bba('0x3c'));});}}}function handleFindQueue(_0xa8e4c4){return function(_0x31dd87){return _0x31dd87[_0x6bba('0x32')][_0x6bba('0x3e')]()===_0xa8e4c4[_0x6bba('0x3e')]();};}exports[_0x6bba('0x3f')]=function(_0x3b4d97,_0x32bc30,_0x55f369,_0x8eba80){return function(_0x95cbbe){try{var _0x28881b={'name':_0x32bc30[0x0],'timeout':_0x32bc30[0x1]};var _0x27b2b7=queue[_0x6bba('0x0')](_0x28881b,{'typecast':!![]});if(_0x27b2b7[_0x6bba('0x40')]){logger[_0x6bba('0x35')](_0x6bba('0x41'),_0x3b4d97,_[_0x6bba('0x42')](_0x27b2b7,_0x6bba('0x2c'))[_0x6bba('0x43')](',\x20'));_0x95cbbe[_0x6bba('0x44')]();}else{var _0x113eec=_[_0x6bba('0x45')](_0x55f369[_0x8eba80[_0x6bba('0x27')]+_0x6bba('0x46')],handleFindQueue(_0x28881b[_0x6bba('0x32')]));if(_0x113eec){startRouting(_0x3b4d97,_0x113eec,_0x8eba80,_0x55f369);var _0x5bbbe5=(_0x113eec['timeout']||0xa)*0x3e8;var _0x1e2597=(_0x28881b[_0x6bba('0x3d')]||0x14)*0x3e8;var _0x8a075,_0x54fe39;if(_0x5bbbe5>_0x1e2597){_0x1e2597=_0x5bbbe5;}var _0x229e6d=seqqueue['createQueue'](_0x5bbbe5);_0x229e6d['id']=_0x3b4d97;_0x229e6d[_0x6bba('0x47')]=_0x5bbbe5;_0x229e6d[_0x6bba('0x48')]=_0x1e2597;_0x229e6d['channel']=_0x8eba80[_0x6bba('0x27')];_0x55f369[_0x6bba('0x49')][_0x3b4d97]['on'](_0x6bba('0x4a'),function(){logger[_0x6bba('0x30')](_0x6bba('0x4b'),_0x3b4d97);stopRouting(_0x3b4d97,_0x113eec,_0x8eba80,_0x55f369);clearTimeout(_0x8a075);_0x8a075=undefined;_0x229e6d[_0x6bba('0x4c')](!![]);if(_0x55f369['rules'][_0x3b4d97]){delete _0x55f369['rules'][_0x3b4d97];}_0x95cbbe[_0x6bba('0x44')]();});_0x55f369[_0x6bba('0x49')][_0x3b4d97]['on'](_0x6bba('0x4d'),function(){if(_0x55f369[_0x6bba('0x49')][_0x3b4d97]){delete _0x55f369[_0x6bba('0x49')][_0x3b4d97];}});_0x8a075=setTimeout(function(){logger[_0x6bba('0x30')](_0x6bba('0x4e'),_0x3b4d97);endRouting(_0x3b4d97,_0x113eec,_0x8eba80,_0x55f369);clearTimeout(_0x8a075);_0x229e6d[_0x6bba('0x4c')](!![]);_0x95cbbe[_0x6bba('0x4f')]();},_0x1e2597);switch(_0x113eec['strategy']){case _0x6bba('0x50'):strategy[_0x6bba('0x50')](_0x229e6d,_0x113eec,_0x55f369,_0x8eba80);break;default:strategy[_0x6bba('0x51')](_0x229e6d,_0x113eec,_0x55f369,_0x8eba80);}}else{logger[_0x6bba('0x35')](_0x6bba('0x52'),_0x3b4d97,_0x28881b[_0x6bba('0x32')]);_0x95cbbe[_0x6bba('0x44')]();}}}catch(_0x3362c4){console['log'](_0x3362c4);logger['error'](_0x6bba('0x41'),_0x3b4d97,_0x3362c4[_0x6bba('0x53')]);_0x95cbbe['stop']();}};}; \ No newline at end of file +var _0xeb97=['seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util'];(function(_0xdb4b94,_0x40bb81){var _0x4824a0=function(_0x2d1dee){while(--_0x2d1dee){_0xdb4b94['push'](_0xdb4b94['shift']());}};_0x4824a0(++_0x40bb81);}(_0xeb97,0x97));var _0x7eb9=function(_0x42e447,_0x10f1ba){_0x42e447=_0x42e447-0x0;var _0x4753ff=_0xeb97[_0x42e447];return _0x4753ff;};'use strict';var schema=require(_0x7eb9('0x0'));var _=require(_0x7eb9('0x1'));var util=require(_0x7eb9('0x2'));var seqqueue=require(_0x7eb9('0x3'));var moment=require(_0x7eb9('0x4'));var Redis=require(_0x7eb9('0x5'));var config=require(_0x7eb9('0x6'));var logger=require(_0x7eb9('0x7'))(_0x7eb9('0x8'));var strategy=require(_0x7eb9('0x9'));config['redis']=_['defaults'](config[_0x7eb9('0xa')],{'host':_0x7eb9('0xb'),'port':0x18eb});var io=require(_0x7eb9('0xc'))(new Redis(config['redis']));var attributes=['id',_0x7eb9('0xd'),_0x7eb9('0xe'),_0x7eb9('0xf'),_0x7eb9('0x10'),'joinAt'];function emit(_0xba7a79,_0x240f8e,_0x372122){io['to'](_0xba7a79)[_0x7eb9('0x11')](_0x240f8e,_0x372122);}function emitChannelQueueInteraction(_0x49a226,_0x5722c4,_0x247e2e,_0x5ee6ad,_0x931e8c,_0x42849a,_0x3304b0,_0x18c1f4){var _0x35fd7a=_[_0x7eb9('0x12')](_0x247e2e);_0x35fd7a['queue_id']=_0x18c1f4;_0x35fd7a['queue']=_0x5722c4;_0x35fd7a[_0x7eb9('0xe')]=_0x5ee6ad;_0x35fd7a['id']=_0x931e8c;if(_0x42849a){_0x3304b0[util[_0x7eb9('0x13')](_0x7eb9('0x14'),_0x49a226)][_0x931e8c]=_[_0x7eb9('0x15')](_0x35fd7a,attributes);}else{delete _0x3304b0[util[_0x7eb9('0x13')](_0x7eb9('0x14'),_0x49a226)][_0x931e8c];}emit(util[_0x7eb9('0x13')](_0x7eb9('0x16'),_0x49a226,_0x5722c4),util[_0x7eb9('0x13')](_0x7eb9('0x17'),_0x49a226,_0x42849a?_0x7eb9('0x18'):'remove'),_[_0x7eb9('0x15')](_0x35fd7a,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7eb9('0x19')),'chatQueueReport':require(_0x7eb9('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x7eb9('0x1b')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x7eb9('0x1c'),'required':!![],'message':_0x7eb9('0x1d')},'timeout':{'type':'number','message':_0x7eb9('0x1e')}});function startRouting(_0x1619b4,_0x4443d4,_0x57bbcf,_0x223104){if(_0x1619b4&&_0x4443d4&&_0x57bbcf){_0x4443d4[_0x7eb9('0x1f')]+=0x1;var _0xf03611={'uniqueid':_0x1619b4,'from':_0x57bbcf[_0x7eb9('0x20')]?_0x57bbcf[_0x7eb9('0x20')][_0x7eb9('0x10')]:'','joinAt':moment()['format'](_0x7eb9('0x21')),'ContactId':_0x57bbcf['contact']?_0x57bbcf[_0x7eb9('0x22')]['id']:null,'ListId':_0x57bbcf[_0x7eb9('0x23')]?_0x57bbcf['list']['id']:null};_0xf03611[_['upperFirst'](_0x57bbcf['channel'])+'QueueId']=_0x4443d4['id']||null;_0xf03611[_[_0x7eb9('0x24')](_0x57bbcf[_0x7eb9('0x25')])+_0x7eb9('0x26')]=_0x57bbcf[_0x7eb9('0x27')]?_0x57bbcf[_0x7eb9('0x27')]['id']:null;_0xf03611[_[_0x7eb9('0x24')](_0x57bbcf[_0x7eb9('0x25')])+_0x7eb9('0x28')]=_0x57bbcf[_0x7eb9('0x29')]?_0x57bbcf[_0x7eb9('0x29')]['id']:null;_0xf03611[_[_0x7eb9('0x24')](_0x57bbcf['channel'])+(_0x57bbcf[_0x7eb9('0x25')]!=='chat'?'AccountId':_0x7eb9('0x2a'))]=_0x57bbcf[_0x7eb9('0xe')]?_0x57bbcf[_0x7eb9('0xe')]['id']:null;logger[_0x7eb9('0x2b')](util[_0x7eb9('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x1619b4,_0x4443d4[_0x7eb9('0x2c')]));emitChannelQueueInteraction(_0x57bbcf[_0x7eb9('0x25')],_0x4443d4[_0x7eb9('0x2c')],_0xf03611,_0x57bbcf['account'][_0x7eb9('0x2c')],_0x57bbcf['message']['id'],!![],_0x223104,_0x4443d4['id']);if(rpc[_0x57bbcf[_0x7eb9('0x25')]+_0x7eb9('0x2d')]){return rpc[_0x57bbcf[_0x7eb9('0x25')]+_0x7eb9('0x2d')]['create'](_0xf03611)[_0x7eb9('0x2e')](function(_0x474aeb){logger[_0x7eb9('0x2f')](_0x7eb9('0x30'));});}}}function stopRouting(_0x36b8f4,_0x42e30e,_0x468867,_0xd93d1c){if(_0x36b8f4&&_0x42e30e){_0x42e30e['waiting']-=0x1;var _0x157938={'leaveAt':moment()[_0x7eb9('0x13')](_0x7eb9('0x21')),'acceptAt':moment()[_0x7eb9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7eb9('0x31')};logger[_0x7eb9('0x2b')](util[_0x7eb9('0x13')](_0x7eb9('0x32'),_0x36b8f4,_0x42e30e['name']));emitChannelQueueInteraction(_0x468867[_0x7eb9('0x25')],_0x42e30e['name'],_0x468867['body'],_0x468867[_0x7eb9('0xe')][_0x7eb9('0x2c')],_0x468867[_0x7eb9('0x29')]['id'],![],_0xd93d1c,_0x42e30e['id']);if(rpc[_0x468867[_0x7eb9('0x25')]+_0x7eb9('0x2d')]){return rpc[_0x468867[_0x7eb9('0x25')]+_0x7eb9('0x2d')][_0x7eb9('0x33')](_0x36b8f4,_0x157938)['catch'](function(_0xe046b8){logger['error'](_0x7eb9('0x34'));});}}}function endRouting(_0xda5952,_0x295dc9,_0x1647e2,_0x2d023a){if(_0xda5952&&_0x295dc9){_0x295dc9[_0x7eb9('0x1f')]-=0x1;var _0x278de0={'leaveAt':moment()[_0x7eb9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x7eb9('0x21')),'reason':_0x7eb9('0x35')};logger[_0x7eb9('0x2b')](util['format']('[%s][END:QUEUE][NAME:%s]',_0xda5952,_0x295dc9['name']));emitChannelQueueInteraction(_0x1647e2[_0x7eb9('0x25')],_0x295dc9[_0x7eb9('0x2c')],_0x1647e2['body'],_0x1647e2[_0x7eb9('0xe')][_0x7eb9('0x2c')],_0x1647e2[_0x7eb9('0x29')]['id'],![],_0x2d023a);if(rpc[_0x1647e2[_0x7eb9('0x25')]+_0x7eb9('0x2d')]){return rpc[_0x1647e2[_0x7eb9('0x25')]+'QueueReport'][_0x7eb9('0x33')](_0xda5952,_0x278de0)['catch'](function(_0x1dcf5d){logger[_0x7eb9('0x2f')](_0x7eb9('0x34'));});}}}function handleFindQueue(_0x4d20f1){return function(_0x11c3d7){return _0x11c3d7[_0x7eb9('0x2c')][_0x7eb9('0x36')]()===_0x4d20f1[_0x7eb9('0x36')]();};}exports[_0x7eb9('0x37')]=function(_0x3584c7,_0x3eef8e,_0x5d2bac,_0xa83a42){return function(_0x1cb46a){try{var _0x996f21={'name':_0x3eef8e[0x0],'timeout':_0x3eef8e[0x1]};var _0x49af73=queue[_0x7eb9('0x0')](_0x996f21,{'typecast':!![]});if(_0x49af73[_0x7eb9('0x38')]){logger[_0x7eb9('0x2f')](_0x7eb9('0x39'),_0x3584c7,_[_0x7eb9('0x3a')](_0x49af73,_0x7eb9('0x29'))[_0x7eb9('0x3b')](',\x20'));_0x1cb46a[_0x7eb9('0x3c')]();}else{var _0x220ef2=_[_0x7eb9('0x3d')](_0x5d2bac[_0xa83a42[_0x7eb9('0x25')]+'Queues'],handleFindQueue(_0x996f21['name']));if(_0x220ef2){startRouting(_0x3584c7,_0x220ef2,_0xa83a42,_0x5d2bac);var _0x4bfd03=(_0x220ef2['timeout']||0xa)*0x3e8;var _0x4a632a=(_0x996f21[_0x7eb9('0x35')]||0x14)*0x3e8;var _0x4e917f,_0x28be7c;if(_0x4bfd03>_0x4a632a){_0x4a632a=_0x4bfd03;}var _0x528b69=seqqueue[_0x7eb9('0x3e')](_0x4bfd03);_0x528b69['id']=_0x3584c7;_0x528b69[_0x7eb9('0x3f')]=_0x4bfd03;_0x528b69[_0x7eb9('0x40')]=_0x4a632a;_0x528b69[_0x7eb9('0x25')]=_0xa83a42[_0x7eb9('0x25')];_0x5d2bac[_0x7eb9('0x41')][_0x3584c7]['on'](_0x7eb9('0x42'),function(){logger[_0x7eb9('0x2b')](_0x7eb9('0x43'),_0x3584c7);stopRouting(_0x3584c7,_0x220ef2,_0xa83a42,_0x5d2bac);clearTimeout(_0x4e917f);_0x4e917f=undefined;_0x528b69[_0x7eb9('0x44')](!![]);if(_0x5d2bac[_0x7eb9('0x41')][_0x3584c7]){delete _0x5d2bac[_0x7eb9('0x41')][_0x3584c7];}_0x1cb46a[_0x7eb9('0x3c')]();});_0x5d2bac[_0x7eb9('0x41')][_0x3584c7]['on'](_0x7eb9('0x45'),function(){if(_0x5d2bac['rules'][_0x3584c7]){delete _0x5d2bac[_0x7eb9('0x41')][_0x3584c7];}});_0x4e917f=setTimeout(function(){logger[_0x7eb9('0x2b')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3584c7);endRouting(_0x3584c7,_0x220ef2,_0xa83a42,_0x5d2bac);clearTimeout(_0x4e917f);_0x528b69[_0x7eb9('0x44')](!![]);_0x1cb46a[_0x7eb9('0x46')]();},_0x4a632a);switch(_0x220ef2[_0x7eb9('0x47')]){case _0x7eb9('0x48'):strategy['rrmemory'](_0x528b69,_0x220ef2,_0x5d2bac,_0xa83a42);break;default:strategy[_0x7eb9('0x49')](_0x528b69,_0x220ef2,_0x5d2bac,_0xa83a42);}}else{logger[_0x7eb9('0x2f')](_0x7eb9('0x4a'),_0x3584c7,_0x996f21['name']);_0x1cb46a[_0x7eb9('0x3c')]();}}}catch(_0x4121a6){console[_0x7eb9('0x4b')](_0x4121a6);logger[_0x7eb9('0x2f')]('[%s][QUEUE]\x20%s',_0x3584c7,_0x4121a6[_0x7eb9('0x4c')]);_0x1cb46a[_0x7eb9('0x3c')]();}};}; \ 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 761fd5c..2a3c475 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 _0xf8dc=['uuid','./util','../../../../../config/logger','routing','agent','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','lodash'];(function(_0x25bcf8,_0x338caf){var _0x15bb97=function(_0x4bc97f){while(--_0x4bc97f){_0x25bcf8['push'](_0x25bcf8['shift']());}};_0x15bb97(++_0x338caf);}(_0xf8dc,0x10f));var _0xcf8d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf8dc[_0x432682];return _0x463d05;};'use strict';var _=require(_0xcf8d('0x0'));var uuid=require(_0xcf8d('0x1'));var util=require(_0xcf8d('0x2'));var logger=require(_0xcf8d('0x3'))(_0xcf8d('0x4'));var Agent=function(_0x228515,_0x2cc29a,_0x1a4e1f,_0x40e3c5){this['notificationId']=uuid['v4']();this['squeue']=_0x228515;this[_0xcf8d('0x5')]=_0x2cc29a;this[_0xcf8d('0x6')]=_0x1a4e1f;this['routing']=_0x40e3c5;this[_0xcf8d('0x7')][_0xcf8d('0x8')](this[_0xcf8d('0x9')][_0xcf8d('0xa')](this),this[_0xcf8d('0xb')][_0xcf8d('0xa')](this));this[_0xcf8d('0x7')]['on'](_0xcf8d('0xc'),this[_0xcf8d('0xb')]['bind'](this));this[_0xcf8d('0x7')]['on'](_0xcf8d('0xd'),this[_0xcf8d('0xe')]['bind'](this));};Agent['prototype'][_0xcf8d('0x8')]=function(){this[_0xcf8d('0x7')][_0xcf8d('0x8')](this[_0xcf8d('0x9')][_0xcf8d('0xa')](this),this[_0xcf8d('0xb')][_0xcf8d('0xa')](this));};Agent[_0xcf8d('0xf')]['handleDrained']=function(){this[_0xcf8d('0xb')](!![]);};Agent[_0xcf8d('0xf')][_0xcf8d('0x9')]=function(_0x3c0f08){logger[_0xcf8d('0x10')](_0xcf8d('0x11'),this[_0xcf8d('0x7')]['id'],this[_0xcf8d('0x5')]['id']);if(_[_0xcf8d('0x12')](this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']])){logger['info'](_0xcf8d('0x14'),this[_0xcf8d('0x7')]['id'],this['agent']['id']);setTimeout(this[_0xcf8d('0x8')][_0xcf8d('0xa')](this),0x3e8);}else{if(this[_0xcf8d('0x4')][_0xcf8d('0x15')]||util[_0xcf8d('0x16')](this[_0xcf8d('0x7')]['id'],this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']],this[_0xcf8d('0x7')][_0xcf8d('0x17')],![])){this['realtime']['agents'][this[_0xcf8d('0x5')]['id']][_0xcf8d('0x18')]=!![];this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']][_0xcf8d('0x19')]=undefined;util[_0xcf8d('0x1a')](this[_0xcf8d('0x1b')],this[_0xcf8d('0x7')]['id'],this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']],null,this[_0xcf8d('0x4')]);util[_0xcf8d('0x1c')](this['squeue']['id'],this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']],_0xcf8d('0x1d')+(this[_0xcf8d('0x4')][_0xcf8d('0x15')]?_0xcf8d('0x1e'):''));}else{logger[_0xcf8d('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xcf8d('0x7')]['id'],this[_0xcf8d('0x5')]['id']);setTimeout(this['push'][_0xcf8d('0xa')](this),0x3e8);}}};Agent[_0xcf8d('0xf')][_0xcf8d('0xb')]=function(_0x3cbcc6){if(_[_0xcf8d('0x12')](this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']])){return logger[_0xcf8d('0x10')](_0xcf8d('0x14'),this['squeue']['id'],this[_0xcf8d('0x5')]['id']);}else{logger[_0xcf8d('0x10')](_0xcf8d('0x1f'),this[_0xcf8d('0x7')]['id'],this['agent']['id']);util['hideNotification'](this[_0xcf8d('0x1b')],this[_0xcf8d('0x7')]['id'],this[_0xcf8d('0x6')]['agents'][this[_0xcf8d('0x5')]['id']],null,this[_0xcf8d('0x4')]);this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']][_0xcf8d('0x18')]=![];this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']]['busyQueue']=undefined;util['writeLog'](this['squeue']['id'],this[_0xcf8d('0x6')][_0xcf8d('0x13')][this[_0xcf8d('0x5')]['id']],_0x3cbcc6?_0xcf8d('0x20'):_0xcf8d('0x21'));}if(!_0x3cbcc6){setTimeout(this[_0xcf8d('0x8')][_0xcf8d('0xa')](this),0x3e8);}};function agent(_0x1ce867,_0xacb62a,_0x3de84d,_0x533775){return new Agent(_0x1ce867,_0xacb62a,_0x3de84d,_0x533775);}module['exports']=agent; \ No newline at end of file +var _0x2b64=['busy','busyQueue','STOP','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleTimeout','bind','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','showNotification','writeLog',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0x2b64,0x7b));var _0x42b6=function(_0xb6b575,_0x32a34b){_0xb6b575=_0xb6b575-0x0;var _0x480218=_0x2b64[_0xb6b575];return _0x480218;};'use strict';var _=require(_0x42b6('0x0'));var uuid=require(_0x42b6('0x1'));var util=require(_0x42b6('0x2'));var logger=require('../../../../../config/logger')(_0x42b6('0x3'));var Agent=function(_0x5ec2c0,_0x415dc5,_0x51d65c,_0x277874){this[_0x42b6('0x4')]=uuid['v4']();this[_0x42b6('0x5')]=_0x5ec2c0;this['agent']=_0x415dc5;this[_0x42b6('0x6')]=_0x51d65c;this[_0x42b6('0x3')]=_0x277874;this[_0x42b6('0x5')][_0x42b6('0x7')](this['handleRun']['bind'](this),this[_0x42b6('0x8')][_0x42b6('0x9')](this));this['squeue']['on'](_0x42b6('0xa'),this[_0x42b6('0x8')][_0x42b6('0x9')](this));this[_0x42b6('0x5')]['on'](_0x42b6('0xb'),this[_0x42b6('0xc')][_0x42b6('0x9')](this));};Agent[_0x42b6('0xd')][_0x42b6('0x7')]=function(){this[_0x42b6('0x5')]['push'](this['handleRun'][_0x42b6('0x9')](this),this[_0x42b6('0x8')][_0x42b6('0x9')](this));};Agent[_0x42b6('0xd')][_0x42b6('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x42b6('0xd')]['handleRun']=function(_0x197fd4){logger['info'](_0x42b6('0xe'),this[_0x42b6('0x5')]['id'],this[_0x42b6('0xf')]['id']);if(_['isNil'](this[_0x42b6('0x6')][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']])){logger['info'](_0x42b6('0x11'),this[_0x42b6('0x5')]['id'],this[_0x42b6('0xf')]['id']);setTimeout(this[_0x42b6('0x7')][_0x42b6('0x9')](this),0x3e8);}else{if(this['routing'][_0x42b6('0x12')]||util[_0x42b6('0x13')](this[_0x42b6('0x5')]['id'],this['realtime'][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']],this[_0x42b6('0x5')]['channel'],![])){this[_0x42b6('0x6')][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']]['busy']=!![];this[_0x42b6('0x6')][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']]['busyQueue']=undefined;util[_0x42b6('0x14')](this[_0x42b6('0x4')],this[_0x42b6('0x5')]['id'],this[_0x42b6('0x6')][_0x42b6('0x10')][this['agent']['id']],null,this['routing']);util[_0x42b6('0x15')](this[_0x42b6('0x5')]['id'],this[_0x42b6('0x6')][_0x42b6('0x10')][this['agent']['id']],'RINGING'+(this[_0x42b6('0x3')][_0x42b6('0x12')]?_0x42b6('0x16'):''));}else{logger[_0x42b6('0x17')](_0x42b6('0x18'),this[_0x42b6('0x5')]['id'],this[_0x42b6('0xf')]['id']);setTimeout(this[_0x42b6('0x7')]['bind'](this),0x3e8);}}};Agent[_0x42b6('0xd')]['handleTimeout']=function(_0x34cdf0){if(_['isNil'](this['realtime'][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']])){return logger[_0x42b6('0x17')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x42b6('0x5')]['id'],this[_0x42b6('0xf')]['id']);}else{logger[_0x42b6('0x17')](_0x42b6('0x19'),this[_0x42b6('0x5')]['id'],this[_0x42b6('0xf')]['id']);util[_0x42b6('0x1a')](this['notificationId'],this[_0x42b6('0x5')]['id'],this['realtime'][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']],null,this[_0x42b6('0x3')]);this['realtime'][_0x42b6('0x10')][this['agent']['id']][_0x42b6('0x1b')]=![];this[_0x42b6('0x6')][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']][_0x42b6('0x1c')]=undefined;util[_0x42b6('0x15')](this['squeue']['id'],this['realtime'][_0x42b6('0x10')][this[_0x42b6('0xf')]['id']],_0x34cdf0?_0x42b6('0x1d'):'TIMEOUT');}if(!_0x34cdf0){setTimeout(this[_0x42b6('0x7')][_0x42b6('0x9')](this),0x3e8);}};function agent(_0x25662d,_0x5707fe,_0x3aa48f,_0x5395b1){return new Agent(_0x25662d,_0x5707fe,_0x3aa48f,_0x5395b1);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index fbed2b1..42ec62e 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 _0x0f89=['exports','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','queue','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','busyQueue'];(function(_0x2c9e37,_0x13ae4b){var _0x35f5a7=function(_0x582c9c){while(--_0x582c9c){_0x2c9e37['push'](_0x2c9e37['shift']());}};_0x35f5a7(++_0x13ae4b);}(_0x0f89,0x111));var _0x90f8=function(_0x45e33e,_0x5073bb){_0x45e33e=_0x45e33e-0x0;var _0xa270c7=_0x0f89[_0x45e33e];return _0xa270c7;};'use strict';var _=require(_0x90f8('0x0'));var uuid=require(_0x90f8('0x1'));var util=require(_0x90f8('0x2'));var logger=require('../../../../../config/logger')(_0x90f8('0x3'));var Beepall=function(_0x344939,_0x19774b,_0x2bc511,_0x518478){this[_0x90f8('0x4')]=uuid['v4']();this[_0x90f8('0x5')]=_0x344939;this['queue']=_0x19774b;this[_0x90f8('0x6')]=_0x2bc511;this[_0x90f8('0x3')]=_0x518478;this[_0x90f8('0x5')][_0x90f8('0x7')](this[_0x90f8('0x8')][_0x90f8('0x9')](this),this[_0x90f8('0xa')][_0x90f8('0x9')](this));this[_0x90f8('0x5')]['on'](_0x90f8('0xb'),this[_0x90f8('0xa')]['bind'](this));this['squeue']['on'](_0x90f8('0xc'),this[_0x90f8('0xd')][_0x90f8('0x9')](this));};Beepall[_0x90f8('0xe')][_0x90f8('0x7')]=function(){this[_0x90f8('0x5')]['push'](this[_0x90f8('0x8')]['bind'](this),this['handleTimeout'][_0x90f8('0x9')](this));};Beepall[_0x90f8('0xe')]['handleDrained']=function(_0x24196d){this['handleTimeout'](!![]);};Beepall[_0x90f8('0xe')][_0x90f8('0x8')]=function(_0xdecec1){var _0x15492=!![];if(!_['isNil'](this[_0x90f8('0xf')])&&!_[_0x90f8('0x10')](this[_0x90f8('0xf')][_0x90f8('0x11')])&&this['queue'][_0x90f8('0x11')][_0x90f8('0x12')]>0x0){for(var _0x5615d2=0x0,_0xf2465e;_0x5615d20x0){for(var _0x478566=0x0,_0x2e8e89;_0x4785660x0&&_0x1b7760[_0x5b6502+_0x22d7('0x27')]>=_0x1b7760[_0x5b6502+_0x22d7('0x28')]){writeLog(_0x141220,_0x1b7760,_0x5b6502['toUpperCase']()+_0x22d7('0x29'));return![];}}return!![];};exports[_0x22d7('0x2a')]=function(_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd){return sendNotification(!![],_0xfbb9b,_0xce7f15,_0x45dc29,_0x49199a,_0x2606bd);};exports[_0x22d7('0x2b')]=function(_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334){return sendNotification(![],_0x33c621,_0x2c0b24,_0x539ba0,_0x1195bc,_0x21c334);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x11e5=['\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','Pause','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','defaults','socket.io-emitter','redis','emit','format','user:%s','name'];(function(_0x28c36b,_0x2133d8){var _0x4498a7=function(_0x5315b2){while(--_0x5315b2){_0x28c36b['push'](_0x28c36b['shift']());}};_0x4498a7(++_0x2133d8);}(_0x11e5,0x8b));var _0x511e=function(_0x4c6c9f,_0x25c8a9){_0x4c6c9f=_0x4c6c9f-0x0;var _0x31e332=_0x11e5[_0x4c6c9f];return _0x31e332;};'use strict';var _=require(_0x511e('0x0'));var util=require('util');var utils=require(_0x511e('0x1'));var Mustache=require(_0x511e('0x2'));var Redis=require('ioredis');var config=require(_0x511e('0x3'));var logger=require(_0x511e('0x4'))(_0x511e('0x5'));config['redis']=_[_0x511e('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x511e('0x7'))(new Redis(config[_0x511e('0x8')]));function emit(_0x466dec,_0x57cac3,_0x47cf56){io['to'](_0x466dec)[_0x511e('0x9')](_0x57cac3,_0x47cf56);}function sendNotification(_0xf0ba86,_0x25deeb,_0x306694,_0x4449c4,_0x30269e,_0x1596b3){io['to'](util[_0x511e('0xa')](_0x511e('0xb'),_0x4449c4[_0x511e('0xc')]))[_0x511e('0x9')]('user:save',_0x4449c4);var _0x7e50db=_0x1596b3||{};var _0x5dd510=_0x306694['split']('.');var _0x3deecc={'uniqueid':_0x25deeb,'channel':_0x5dd510[0x0],'id':_0x5dd510[0x1],'title':_0x5dd510[0x0]+_0x511e('0xd'),'interactionId':_0x5dd510[0x2],'queue':_0x30269e?_0x30269e[_0x511e('0xc')]:null,'sound':_0x7e50db[_0x511e('0xe')][_0x511e('0xf')],'shake':_0x7e50db[_0x511e('0xe')]['notificationShake']};try{if(!_0x7e50db[_0x511e('0x10')]){_0x7e50db[_0x511e('0x10')]={};}if(_0x30269e){_0x7e50db['body'][_0x511e('0x11')]=_0x30269e;}else if(_0x7e50db[_0x511e('0x10')]['queue']){delete _0x7e50db[_0x511e('0x10')][_0x511e('0x11')];}_0x3deecc[_0x511e('0x12')]=utils[_0x511e('0x13')](_0x7e50db['account'][_0x511e('0x14')],_0x7e50db);}catch(_0x2dd346){_0x3deecc[_0x511e('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x511e('0x15')](util['format'](_0x511e('0x16'),_0x25deeb,_0x2dd346['message']));}io['to'](util['format'](_0x511e('0xb'),_0x4449c4['name']))[_0x511e('0x9')](util[_0x511e('0xa')](_0x511e('0x17'),_0xf0ba86?_0x511e('0x18'):_0x511e('0x19')),_0x3deecc);}function writeLog(_0x3d3f46,_0x3723ff,_0x452f20){return logger['info'](util[_0x511e('0xa')](_0x511e('0x1a'),_0x3d3f46,_0x3723ff[_0x511e('0xc')],_0x452f20));}exports[_0x511e('0x1b')]=function(_0xaea29d,_0x18807b,_0x886b6,_0x2f28fc){if(_0x18807b[_0x511e('0x1c')]){writeLog(_0xaea29d,_0x18807b,_0x511e('0x1d'));return![];}if(!_0x18807b['online']){writeLog(_0xaea29d,_0x18807b,'OFFLINE');return![];}if(_0x18807b[_0x886b6+_0x511e('0x1e')]){writeLog(_0xaea29d,_0x18807b,'PAUSE');return![];}if(_0x2f28fc&&_0x18807b[_0x511e('0x1f')](_0x886b6+'Capacity')&&_0x18807b[_0x511e('0x1f')](_0x886b6+_0x511e('0x20'))){if(_0x18807b[_0x886b6+_0x511e('0x21')]>0x0&&_0x18807b[_0x886b6+_0x511e('0x20')]>=_0x18807b[_0x886b6+_0x511e('0x21')]){writeLog(_0xaea29d,_0x18807b,_0x886b6[_0x511e('0x22')]()+_0x511e('0x23'));return![];}}return!![];};exports[_0x511e('0x24')]=function(_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d){return sendNotification(!![],_0x309695,_0x2451c2,_0x5b72fe,_0x2930b2,_0x1d754d);};exports[_0x511e('0x25')]=function(_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f){return sendNotification(![],_0x1aaac1,_0x369be6,_0x50305a,_0x431b75,_0x4e157f);};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 9b40cf0..42ba530 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 _0x92e1=['[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x92e1,0xa8));var _0x192e=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x92e1[_0x5ad0d7];return _0xd83bd;};'use strict';var schema=require(_0x192e('0x0'));var sh=require(_0x192e('0x1'));var _=require(_0x192e('0x2'));var utils=require(_0x192e('0x3'));var logger=require('../../../../config/logger')(_0x192e('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x192e('0x5')}});exports[_0x192e('0x6')]=function(_0x540fda,_0xe4e31b){return function(_0x56d287){try{var _0x250119={'command':_0xe4e31b[0x0]};var _0x30beda=system[_0x192e('0x0')](_0x250119,{'typecast':!![]});if(_0x30beda['length']){logger[_0x192e('0x7')](_0x192e('0x8'),_0x540fda,_[_0x192e('0x9')](_0x30beda,_0x192e('0xa'))[_0x192e('0xb')](',\x20'));logger[_0x192e('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x540fda);_0x56d287['next']();}else{var _0x9b01e8=this;var _0x458130=utils[_0x192e('0xd')](_0xe4e31b[0x0],this);logger[_0x192e('0xc')](_0x192e('0xe'),_0x540fda,_0x458130);sh['exec'](_[_0x192e('0xf')](_0x458130),function(_0x1a42df,_0x1c9254){logger['info'](_0x192e('0x10'),_0x540fda,_0x1a42df);if(_0x1a42df==0x0){var _0x7683ec=_0x1c9254['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x192e('0x11')](_0xe4e31b[0x1])||_['isEmpty'](_0xe4e31b[0x1])){logger[_0x192e('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x540fda);_0x9b01e8[_0x192e('0x12')][_0xe4e31b[0x1]]=_0x7683ec;}else{logger[_0x192e('0xc')](_0x192e('0x13'),_0x540fda,_0xe4e31b[0x1],_0x7683ec);_0x9b01e8['body'][_0xe4e31b[0x1]]=_0x7683ec;}}_0x56d287[_0x192e('0x14')]();});}}catch(_0x142abd){logger[_0x192e('0x7')](_0x192e('0x8'),_0x540fda,_[_0x192e('0x15')](_0x142abd)?JSON['stringify'](_0x142abd):_0x142abd);logger[_0x192e('0xc')](_0x192e('0x16'),_0x540fda);_0x56d287[_0x192e('0x14')]();}};}; \ No newline at end of file +var _0x46e0=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','join','info'];(function(_0x48b41d,_0x2fda76){var _0x12846e=function(_0xc4ff10){while(--_0xc4ff10){_0x48b41d['push'](_0x48b41d['shift']());}};_0x12846e(++_0x2fda76);}(_0x46e0,0x1c3));var _0x046e=function(_0x757dd0,_0x489c20){_0x757dd0=_0x757dd0-0x0;var _0x426f98=_0x46e0[_0x757dd0];return _0x426f98;};'use strict';var schema=require(_0x046e('0x0'));var sh=require(_0x046e('0x1'));var _=require(_0x046e('0x2'));var utils=require(_0x046e('0x3'));var logger=require('../../../../config/logger')(_0x046e('0x4'));var system=schema({'command':{'type':_0x046e('0x5'),'required':!![],'message':_0x046e('0x6')}});exports[_0x046e('0x7')]=function(_0x104708,_0x299a05){return function(_0x34b6b7){try{var _0x44fa8d={'command':_0x299a05[0x0]};var _0x27e01d=system[_0x046e('0x0')](_0x44fa8d,{'typecast':!![]});if(_0x27e01d['length']){logger['error'](_0x046e('0x8'),_0x104708,_['map'](_0x27e01d,'message')[_0x046e('0x9')](',\x20'));logger[_0x046e('0xa')](_0x046e('0xb'),_0x104708);_0x34b6b7[_0x046e('0xc')]();}else{var _0x287574=this;var _0x9ce94a=utils[_0x046e('0xd')](_0x299a05[0x0],this);logger[_0x046e('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x104708,_0x9ce94a);sh[_0x046e('0xe')](_['trim'](_0x9ce94a),function(_0x553c6b,_0x417e30){logger['info'](_0x046e('0xf'),_0x104708,_0x553c6b);if(_0x553c6b==0x0){var _0x4749de=_0x417e30[_0x046e('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x046e('0x11')](_0x299a05[0x1])||_['isEmpty'](_0x299a05[0x1])){logger['info'](_0x046e('0x12'),_0x104708);_0x287574['body'][_0x299a05[0x1]]=_0x4749de;}else{logger[_0x046e('0xa')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x104708,_0x299a05[0x1],_0x4749de);_0x287574[_0x046e('0x13')][_0x299a05[0x1]]=_0x4749de;}}_0x34b6b7[_0x046e('0xc')]();});}}catch(_0x4c9c50){logger['error'](_0x046e('0x8'),_0x104708,_[_0x046e('0x14')](_0x4c9c50)?JSON[_0x046e('0x15')](_0x4c9c50):_0x4c9c50);logger['info'](_0x046e('0xb'),_0x104708);_0x34b6b7[_0x046e('0xc')]();}};}; \ 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 d6e2291..5772852 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 _0xf758=['Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x234577,_0x3b9004){var _0x28fea6=function(_0x59692d){while(--_0x59692d){_0x234577['push'](_0x234577['shift']());}};_0x28fea6(++_0x3b9004);}(_0xf758,0xb8));var _0x8f75=function(_0xee588,_0x368239){_0xee588=_0xee588-0x0;var _0x58dd1a=_0xf758[_0xee588];return _0x58dd1a;};'use strict';var schema=require('validate');var _=require(_0x8f75('0x0'));var rpc={'chatInteraction':require(_0x8f75('0x1')),'openchannelInteraction':require(_0x8f75('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x8f75('0x3')),'faxInteraction':require(_0x8f75('0x4')),'whatsappInteraction':require(_0x8f75('0x5'))};var logger=require(_0x8f75('0x6'))(_0x8f75('0x7'));var tag=schema({'tag':{'type':_0x8f75('0x8'),'required':!![],'message':_0x8f75('0x9')}});exports[_0x8f75('0xa')]=function(_0x3884ad,_0x5d4a4d,_0x465da0,_0x18a44c){return function(_0x24dc93){try{var _0x55dccc={'tag':_0x5d4a4d[0x0]};var _0x15f6ee=tag[_0x8f75('0xb')](_0x55dccc,{'typecast':!![]});if(_0x15f6ee[_0x8f75('0xc')]){logger['error'](_0x8f75('0xd'),_0x3884ad,_[_0x8f75('0xe')](_0x15f6ee,'message')['join'](',\x20'));logger[_0x8f75('0xf')](_0x8f75('0x10'),_0x3884ad);_0x24dc93[_0x8f75('0x11')]();}else{var _0xcc0800={'ids':[_0x5d4a4d[0x0]]};if(rpc[_0x18a44c[_0x8f75('0x12')]+_0x8f75('0x13')]){rpc[_0x18a44c[_0x8f75('0x12')]+_0x8f75('0x13')][_0x8f75('0x14')](_0x18a44c[_0x8f75('0x15')]['id'],_0xcc0800)[_0x8f75('0x16')](function(_0x4565ee){logger[_0x8f75('0xf')](_0x8f75('0x17'),_0x3884ad,_0x5d4a4d[0x1],_0x18a44c[_0x8f75('0x12')],_0x18a44c['interaction']['id']);})[_0x8f75('0x18')](function(_0x16f193){logger[_0x8f75('0x19')]('[%s][TAG]\x20%s',_0x3884ad,JSON[_0x8f75('0x1a')](_0x16f193));logger[_0x8f75('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3884ad);})[_0x8f75('0x1b')](function(){_0x24dc93[_0x8f75('0x11')]();});}}}catch(_0x255b84){logger[_0x8f75('0x19')](_0x8f75('0xd'),_0x3884ad,_[_0x8f75('0x1c')](_0x255b84)?JSON[_0x8f75('0x1a')](_0x255b84):_0x255b84);logger[_0x8f75('0xf')](_0x8f75('0x10'),_0x3884ad);_0x24dc93['next']();}};}; \ No newline at end of file +var _0xf544=['map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','consequence','length','error','[%s][TAG]\x20%s'];(function(_0x372548,_0x30080f){var _0x2326a9=function(_0x3564b9){while(--_0x3564b9){_0x372548['push'](_0x372548['shift']());}};_0x2326a9(++_0x30080f);}(_0xf544,0x15f));var _0x4f54=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xf544[_0xc82d1a];return _0x32fad2;};'use strict';var schema=require(_0x4f54('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x4f54('0x1')),'openchannelInteraction':require(_0x4f54('0x2')),'smsInteraction':require(_0x4f54('0x3')),'mailInteraction':require(_0x4f54('0x4')),'faxInteraction':require(_0x4f54('0x5')),'whatsappInteraction':require(_0x4f54('0x6'))};var logger=require(_0x4f54('0x7'))(_0x4f54('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x4f54('0x9')]=function(_0x53a5f8,_0x1e4d6a,_0x23a87d,_0x551aee){return function(_0x103844){try{var _0x2d379a={'tag':_0x1e4d6a[0x0]};var _0x1771e1=tag['validate'](_0x2d379a,{'typecast':!![]});if(_0x1771e1[_0x4f54('0xa')]){logger[_0x4f54('0xb')](_0x4f54('0xc'),_0x53a5f8,_[_0x4f54('0xd')](_0x1771e1,'message')[_0x4f54('0xe')](',\x20'));logger['info'](_0x4f54('0xf'),_0x53a5f8);_0x103844[_0x4f54('0x10')]();}else{var _0x334f0d={'ids':[_0x1e4d6a[0x0]]};if(rpc[_0x551aee['channel']+'Interaction']){rpc[_0x551aee['channel']+_0x4f54('0x11')]['addTags'](_0x551aee[_0x4f54('0x12')]['id'],_0x334f0d)[_0x4f54('0x13')](function(_0x4a5e59){logger[_0x4f54('0x14')](_0x4f54('0x15'),_0x53a5f8,_0x1e4d6a[0x1],_0x551aee[_0x4f54('0x16')],_0x551aee[_0x4f54('0x12')]['id']);})[_0x4f54('0x17')](function(_0x2ba7bc){logger[_0x4f54('0xb')]('[%s][TAG]\x20%s',_0x53a5f8,JSON[_0x4f54('0x18')](_0x2ba7bc));logger[_0x4f54('0x14')](_0x4f54('0xf'),_0x53a5f8);})['finally'](function(){_0x103844[_0x4f54('0x10')]();});}}}catch(_0x15ebc8){logger[_0x4f54('0xb')](_0x4f54('0xc'),_0x53a5f8,_[_0x4f54('0x19')](_0x15ebc8)?JSON['stringify'](_0x15ebc8):_0x15ebc8);logger[_0x4f54('0x14')](_0x4f54('0xf'),_0x53a5f8);_0x103844[_0x4f54('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index b6a40f3..a8bf20d 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44da=['?params=','urlOnRing','jsonrpc','2.0','method','push','params','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','replace','\x20-\x20','includes','urlOnAnswer'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x44da,0x1d9));var _0xa44d=function(_0x234fca,_0xd18415){_0x234fca=_0x234fca-0x0;var _0x501097=_0x44da[_0x234fca];return _0x501097;};'use strict';var rp=require(_0xa44d('0x0'));var logger=require(_0xa44d('0x1'))(_0xa44d('0x2'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x39df2f,_0x1f3406){return function(_0x188851){var _0x67ae9d=_0x1f3406[0xa];var _0x39785d=_0x1f3406[0xb];var _0x193123=_0x1f3406[0xc];var _0x329f8b=_0x1f3406[0xd];var _0x2d7dcc=_0x1f3406[0xe];var _0x3a6a04=_0x1f3406[0xf][_0xa44d('0x3')](/\n/g,_0xa44d('0x4'));var _0x2a76d8=_0x1f3406[0x10][_0xa44d('0x3')](/\n/g,'\x20');if(!arr[_0xa44d('0x5')](_0x39785d)){arr['push'](_0x39785d);var _0x3bb3a8=_0x1f3406[0x3];var _0x52772e=_0x1f3406[0x4];var _0x3ee4ea=_0x1f3406[0x1];var _0x538d44=_0x1f3406[0x0];var _0x1b157e={};_0x1b157e[_0xa44d('0x6')]=_0x1f3406[0x8]+_0xa44d('0x7')+_0x193123+'|'+_0x67ae9d+'|'+_0x329f8b+'|'+_0x39785d+'|'+_0x2d7dcc;_0x1b157e[_0xa44d('0x8')]=_0x1f3406[0x7]+_0xa44d('0x7')+_0x193123+'|'+_0x67ae9d+'|'+_0x329f8b+'|'+_0x39785d+'|'+_0x2d7dcc+'|'+_0x3a6a04+'|'+_0x2a76d8;_0x1b157e['title']=_0x1f3406[0x9];var _0x495e03={};_0x495e03[_0xa44d('0x9')]=_0xa44d('0xa');_0x495e03[_0xa44d('0xb')]='login';var _0x10589c=[];_0x10589c[_0xa44d('0xc')](_0x1f3406[0x2]);_0x10589c[_0xa44d('0xc')](_0x1f3406[0x5]);_0x10589c[_0xa44d('0xc')](_0x1f3406[0x6]);_0x495e03[_0xa44d('0xd')]=_0x10589c;_0x495e03['id']=0x1;var _0x50a13f=JSON['stringify'](_0x495e03);var _0x4add1e={'encoding':'utf8','method':_0xa44d('0xe'),'timeout':0x2710,'url':_0x3bb3a8,'headers':{'Content-Type':_0xa44d('0xf')},'body':_0x50a13f};return rp(_0x4add1e)[_0xa44d('0x10')](function(_0x160a3e){const _0x303cce=JSON[_0xa44d('0x11')](_0x160a3e);if(!_0x303cce['result'][_0xa44d('0x12')]){throw new Error(_0xa44d('0x13'));}var _0x528072=_0x39785d;var _0x308b0c='channelId='+_0x3ee4ea+_0xa44d('0x14')+_0x538d44+'&sessionId='+_0x528072+_0xa44d('0x15')+JSON[_0xa44d('0x16')](_0x1b157e);var _0x14f66d=_0x52772e+'?'+_0x308b0c;return rp(_0x14f66d);})[_0xa44d('0x10')](function(_0x2c582e){logger[_0xa44d('0x17')](_0xa44d('0x18'),_0x39df2f,_0x2c582e);_0x188851[_0xa44d('0x19')]();})[_0xa44d('0x1a')](function(_0x5d1cb2){logger[_0xa44d('0x1b')](_0xa44d('0x1c'),_0x39df2f,_[_0xa44d('0x1d')](_0x5d1cb2)?JSON['stringify'](_0x5d1cb2):_0x5d1cb2);_0x188851['stop']();});}else{logger[_0xa44d('0x17')](_0xa44d('0x1e'),_0x39df2f);_0x188851[_0xa44d('0x1f')]();}};}; \ No newline at end of file +var _0x56ff=['replace','includes','push','urlOnAnswer','?params=','urlOnRing','jsonrpc','2.0','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','next','request-promise','lodash'];(function(_0x51313d,_0x30de1e){var _0x300b13=function(_0x4954a1){while(--_0x4954a1){_0x51313d['push'](_0x51313d['shift']());}};_0x300b13(++_0x30de1e);}(_0x56ff,0x10c));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0xf56f('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0xf56f('0x1'));var arr=[];exports['consequence']=function(_0x4bd8ca,_0x4c5bfe){return function(_0x5e87a7){var _0x4262ce=_0x4c5bfe[0xa];var _0x1c25ac=_0x4c5bfe[0xb];var _0x299e42=_0x4c5bfe[0xc];var _0x2a6293=_0x4c5bfe[0xd];var _0x46811e=_0x4c5bfe[0xe];var _0xcb1d1d=_0x4c5bfe[0xf]['replace'](/\n/g,'\x20-\x20');var _0x3e7fe3=_0x4c5bfe[0x10][_0xf56f('0x2')](/\n/g,'\x20');if(!arr[_0xf56f('0x3')](_0x1c25ac)){arr[_0xf56f('0x4')](_0x1c25ac);var _0x83c137=_0x4c5bfe[0x3];var _0x22130b=_0x4c5bfe[0x4];var _0x50042d=_0x4c5bfe[0x1];var _0xf04a0e=_0x4c5bfe[0x0];var _0x433db6={};_0x433db6[_0xf56f('0x5')]=_0x4c5bfe[0x8]+_0xf56f('0x6')+_0x299e42+'|'+_0x4262ce+'|'+_0x2a6293+'|'+_0x1c25ac+'|'+_0x46811e;_0x433db6[_0xf56f('0x7')]=_0x4c5bfe[0x7]+_0xf56f('0x6')+_0x299e42+'|'+_0x4262ce+'|'+_0x2a6293+'|'+_0x1c25ac+'|'+_0x46811e+'|'+_0xcb1d1d+'|'+_0x3e7fe3;_0x433db6['title']=_0x4c5bfe[0x9];var _0x5c89fa={};_0x5c89fa[_0xf56f('0x8')]=_0xf56f('0x9');_0x5c89fa['method']=_0xf56f('0xa');var _0x3112b7=[];_0x3112b7['push'](_0x4c5bfe[0x2]);_0x3112b7[_0xf56f('0x4')](_0x4c5bfe[0x5]);_0x3112b7[_0xf56f('0x4')](_0x4c5bfe[0x6]);_0x5c89fa[_0xf56f('0xb')]=_0x3112b7;_0x5c89fa['id']=0x1;var _0x200ed9=JSON[_0xf56f('0xc')](_0x5c89fa);var _0x39f717={'encoding':_0xf56f('0xd'),'method':_0xf56f('0xe'),'timeout':0x2710,'url':_0x83c137,'headers':{'Content-Type':_0xf56f('0xf')},'body':_0x200ed9};return rp(_0x39f717)[_0xf56f('0x10')](function(_0x1030c0){const _0x3e3378=JSON[_0xf56f('0x11')](_0x1030c0);if(!_0x3e3378[_0xf56f('0x12')][_0xf56f('0x13')]){throw new Error(_0xf56f('0x14'));}var _0x387a9d=_0x1c25ac;var _0x16122a=_0xf56f('0x15')+_0x50042d+'&serviceId='+_0xf04a0e+'&sessionId='+_0x387a9d+'&data='+JSON[_0xf56f('0xc')](_0x433db6);var _0x2493c3=_0x22130b+'?'+_0x16122a;return rp(_0x2493c3);})[_0xf56f('0x10')](function(_0x18685f){logger[_0xf56f('0x16')](_0xf56f('0x17'),_0x4bd8ca,_0x18685f);_0x5e87a7['stop']();})[_0xf56f('0x18')](function(_0x253ba1){logger[_0xf56f('0x19')](_0xf56f('0x1a'),_0x4bd8ca,_[_0xf56f('0x1b')](_0x253ba1)?JSON[_0xf56f('0xc')](_0x253ba1):_0x253ba1);_0x5e87a7[_0xf56f('0x1c')]();});}else{logger[_0xf56f('0x16')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4bd8ca);_0x5e87a7[_0xf56f('0x1d')]();}};}; \ 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 8539735..62b0cd0 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(_0x4000d2,_0x48c51a){var _0x32698c=function(_0x56f51d){while(--_0x56f51d){_0x4000d2['push'](_0x4000d2['shift']());}};_0x32698c(++_0x48c51a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x1dccc6,_0x4692bd){var _0x1f2dad=function(_0x34a722){while(--_0x34a722){_0x1dccc6['push'](_0x1dccc6['shift']());}};_0x1f2dad(++_0x4692bd);}(_0xe706,0xa3));var _0x6e70=function(_0x524cb3,_0x2d702a){_0x524cb3=_0x524cb3-0x0;var _0x288975=_0xe706[_0x524cb3];return _0x288975;};'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 6c6c0c3..3f0f7d0 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 _0xb688=['openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length','existsSync','join','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','priority','info','on\x20interval','\x20|\x20','error','app','.js','rules','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','end','QueueReport','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','waiting','mailQueues','openchannelQueues','name','paused','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0xb688,0xcf));var _0x8b68=function(_0x58e6f6,_0x5c0a2e){_0x58e6f6=_0x58e6f6-0x0;var _0x119874=_0xb688[_0x58e6f6];return _0x119874;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var fs=require('fs');var jayson=require(_0x8b68('0x2'));var BPromise=require(_0x8b68('0x3'));var uuid=require(_0x8b68('0x4'));var utils=require(_0x8b68('0x5'));var config=require('../../../config/environment');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var rpc={'openchannelQueueReport':require(_0x8b68('0x8')),'mailQueueReport':require(_0x8b68('0x9')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x8b68('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8b68('0xb'))};var RuleEngine=require(_0x8b68('0xc'));function getId(_0x130892,_0xa5571b,_0x132617){return util[_0x8b68('0xd')](_0x8b68('0xe'),_0x130892,_0xa5571b||0x0,_0x132617||0x0);}function getIntervals(_0x21d944,_0x24e0b0){var _0x2f2e3c=[];if(!_[_0x8b68('0xf')](_0x24e0b0[_0x8b68('0x10')])&&!_[_0x8b68('0xf')](_0x21d944[_0x24e0b0['IntervalId']])&&!_[_0x8b68('0xf')](_0x21d944[_0x24e0b0[_0x8b68('0x10')]][_0x8b68('0x11')])){_0x2f2e3c=_[_0x8b68('0x12')](_0x21d944[_0x24e0b0[_0x8b68('0x10')]][_0x8b68('0x11')],_0x8b68('0x13'));}else if(!_[_0x8b68('0xf')](_0x24e0b0[_0x8b68('0x13')])){_0x2f2e3c=[_0x24e0b0['interval']];}return _0x2f2e3c;}exports[_0x8b68('0x14')]=function(_0x509033){_0x509033['rules']={};return new BPromise(function(_0x22f75b,_0x1554d6){var _0x27d717={'Start':function(_0x5d3468){var _0x5c8d0e=this;return new Promise(function(_0x23bd52,_0x5c1e44){if(_0x5d3468){try{var _0x136f1b=[];var _0xb44923=getId(_0x5d3468[_0x8b68('0x15')],_0x5d3468[_0x8b68('0x16')]?_0x5d3468['message']['id']:0x0,_0x5d3468[_0x8b68('0x17')]?_0x5d3468[_0x8b68('0x17')]['id']:0x0);if(_0x5d3468['applications']&&_[_0x8b68('0x18')](_0x5d3468[_0x8b68('0x19')])&&_0x5d3468[_0x8b68('0x19')][_0x8b68('0x1a')]){for(var _0x38b7a7=0x0;_0x38b7a7<_0x5d3468['applications'][_0x8b68('0x1a')];_0x38b7a7+=0x1){var _0x4b4b0f=_0x5d3468[_0x8b68('0x19')][_0x38b7a7];if(fs[_0x8b68('0x1b')](path[_0x8b68('0x1c')](__dirname,_0x8b68('0x19'),_0x4b4b0f['app']+'.js'))){var _0x23edc1=[];switch(_0x4b4b0f['app'][_0x8b68('0x1d')]()){case _0x8b68('0x1e'):var _0x13aee5=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');if(_0x5d3468[_0x8b68('0x15')]==='mail'){_0x23edc1[_0x8b68('0x21')](_0x13aee5[0x0]);_0x23edc1[_0x8b68('0x21')](_0x13aee5[0x1]);_0x23edc1['push'](_0x13aee5[_0x8b68('0x22')](0x2,_0x13aee5[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));}else{_0x23edc1['push'](_0x13aee5[0x0]);_0x23edc1['push'](_0x13aee5['slice'](0x1,_0x13aee5[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));}break;case _0x8b68('0x23'):var _0x583476=_0x4b4b0f[_0x8b68('0x1f')]['split'](',');_0x23edc1['push'](_0x583476[0x0]);_0x23edc1[_0x8b68('0x21')](_0x583476[0x1]);_0x23edc1['push'](_0x583476[_0x8b68('0x22')](0x2,_0x583476[_0x8b68('0x1a')])['join'](','));break;case'dialogflowv2':var _0x357635=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x357635[0x0]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x1]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x2]);_0x23edc1[_0x8b68('0x21')](_0x357635[0x3]);_0x23edc1['push'](_0x357635[_0x8b68('0x22')](0x4,_0x357635['length'])[_0x8b68('0x1c')](','));break;case _0x8b68('0x24'):var _0x4c276f=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x4c276f[0x0]);_0x23edc1['push'](_0x4c276f[0x1]);_0x23edc1['push'](_0x4c276f[0x2]);_0x23edc1[_0x8b68('0x21')](_0x4c276f[0x3]);_0x23edc1[_0x8b68('0x21')](_0x4c276f[_0x8b68('0x22')](0x4,_0x4c276f[_0x8b68('0x1a')])[_0x8b68('0x1c')](','));break;case _0x8b68('0x16'):_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x1f')]);break;case _0x8b68('0x25'):_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x26')]);_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x1f')]);break;case _0x8b68('0x27'):var _0x10aca9=utils[_0x8b68('0x28')](_0x5d3468[_0x8b68('0x29')][_0x8b68('0x2a')],_0x5d3468);var _0x120b34=_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');_0x23edc1[_0x8b68('0x21')](_0x120b34[0x0]);_0x23edc1['push'](_0x120b34[0x1]);_0x23edc1['push'](_0x120b34[0x2]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x3]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x4]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x5]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x6]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x7]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x8]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0x9]);_0x23edc1[_0x8b68('0x21')](_0x120b34[0xa]);_0x23edc1['push'](_0x5d3468[_0x8b68('0x17')]['id']);_0x23edc1[_0x8b68('0x21')](_0x5d3468[_0x8b68('0x16')]['id']);_0x23edc1[_0x8b68('0x21')](_0x4b4b0f[_0x8b68('0x2b')]);_0x23edc1[_0x8b68('0x21')](_0x5d3468[_0x8b68('0x17')][_0x8b68('0x2c')]);_0x23edc1['push'](_0x5d3468[_0x8b68('0x2d')][_0x8b68('0x2d')]);_0x23edc1[_0x8b68('0x21')](_0x10aca9);break;default:_0x23edc1=_[_0x8b68('0xf')](_0x4b4b0f[_0x8b68('0x1f')])?[]:_0x4b4b0f[_0x8b68('0x1f')][_0x8b68('0x20')](',');}var _0x50a9c6={'id':util[_0x8b68('0xd')](_0x8b68('0x2e'),_0xb44923,_0x4b4b0f['id'],_0x4b4b0f['app']),'condition':require(_0x8b68('0x2f'))[_0x8b68('0x30')](_0xb44923,getIntervals(_0x509033['intervals'],_0x4b4b0f),_0x509033),'consequence':require('./applications/'+_0x4b4b0f['app'])['consequence'](_0xb44923,_0x23edc1,_0x509033,_0x5d3468),'p':_0x4b4b0f[_0x8b68('0x31')]||0x0};logger[_0x8b68('0x32')]('Push\x20new\x20rule',_0x50a9c6['id'],_0x8b68('0x33'),getIntervals(_0x509033['intervals'],_0x4b4b0f)[_0x8b68('0x1c')](_0x8b68('0x34')));_0x136f1b['push'](_0x50a9c6);}else{logger[_0x8b68('0x35')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x4b4b0f[_0x8b68('0x36')]+_0x8b68('0x37')));}}_0x509033[_0x8b68('0x38')][_0xb44923]=new RuleEngine(_0x136f1b);_0x509033[_0x8b68('0x38')][_0xb44923]['execute'](_0x5d3468,function(_0x20162a){logger['info'](_0x8b68('0x39'),JSON[_0x8b68('0x3a')](_0x20162a['matchPath']));if(_0x509033[_0x8b68('0x38')][_0xb44923]){_0x509033[_0x8b68('0x38')][_0xb44923][_0x8b68('0x3b')](_0x8b68('0x3c'));}});return _0x23bd52({'code':0xc8,'message':_0x5d3468});}else{logger['info'](_0x8b68('0x3d'));return _0x23bd52({'code':0xc8,'message':_0x5d3468});}}catch(_0x478527){logger[_0x8b68('0x35')](_0x478527[_0x8b68('0x3e')]);return _0x5c1e44(_0x5c8d0e[_0x8b68('0x35')](0x1f4,_0x478527));}}return _0x5c1e44(_0x8b68('0x3f'));});},'AcceptMessage':function(_0x41d9a2){var _0x69fdbe=this;return new Promise(function(_0x29e265,_0x20df07){if(_0x41d9a2[_0x8b68('0x40')]&&_0x41d9a2[_0x8b68('0x40')]['id']){if(_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]){_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]['busy']=![];_0x509033[_0x8b68('0x41')][_0x41d9a2[_0x8b68('0x40')]['id']]['busyQueue']=undefined;}}if(_0x41d9a2[_0x8b68('0x16')]&&_0x41d9a2['message']['id']){try{var _0x58cf66=getId(_0x41d9a2['channel'],_0x41d9a2[_0x8b68('0x16')]?_0x41d9a2[_0x8b68('0x16')]['id']:0x0,_0x41d9a2[_0x8b68('0x17')]?_0x41d9a2[_0x8b68('0x17')]['id']:0x0);if(_0x509033['rules'][_0x58cf66]){_0x509033['rules'][_0x58cf66][_0x8b68('0x3b')](_0x8b68('0x42'));if(rpc[_0x41d9a2[_0x8b68('0x15')]+'QueueReport']){rpc[_0x41d9a2[_0x8b68('0x15')]+_0x8b68('0x43')]['update'](_0x58cf66,{'UserId':_0x41d9a2[_0x8b68('0x16')][_0x8b68('0x44')]})['catch'](function(_0x18a9ae){logger[_0x8b68('0x35')]('error\x20update\x20queue\x20report');});}}return _0x29e265({'code':0xc8,'message':_0x41d9a2});}catch(_0x3f7f89){logger[_0x8b68('0x35')](_0x3f7f89['stack']);return _0x20df07(_0x69fdbe['error'](0x1f4,_0x3f7f89));}}logger['error'](_0x8b68('0x45'));return _0x20df07(_0x69fdbe[_0x8b68('0x35')](0x1f4,_0x8b68('0x45')));});},'RejectMessage':function(_0x3d4b4f){var _0x55aad3=this;return new Promise(function(_0x5a1711,_0x4492fd){if(_0x3d4b4f[_0x8b68('0x40')]&&_0x3d4b4f[_0x8b68('0x40')]['id']){try{if(_0x509033['agents'][_0x3d4b4f[_0x8b68('0x40')]['id']]){_0x509033[_0x8b68('0x41')][_0x3d4b4f[_0x8b68('0x40')]['id']]['busy']=![];_0x509033[_0x8b68('0x41')][_0x3d4b4f['agent']['id']][_0x8b68('0x46')]=undefined;}return _0x5a1711({'code':0xc8,'message':_0x3d4b4f});}catch(_0x3efb0e){logger['error'](_0x3efb0e[_0x8b68('0x3e')]);return _0x4492fd(_0x55aad3[_0x8b68('0x35')](0x1f4,_0x3efb0e));}}logger[_0x8b68('0x35')](_0x8b68('0x45'));return _0x4492fd(_0x55aad3[_0x8b68('0x35')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x241166){var _0x3f3e43=this;return new Promise(function(_0x32cd05,_0x31a090){if(_0x241166[_0x8b68('0x15')]&&_0x241166[_0x8b68('0x17')]&&_0x241166[_0x8b68('0x17')]['id']){try{var _0x3096b3=getId(_0x241166['channel'],_0x241166[_0x8b68('0x16')]?_0x241166[_0x8b68('0x16')]['id']:0x0,_0x241166[_0x8b68('0x17')]?_0x241166[_0x8b68('0x17')]['id']:0x0);if(_0x509033[_0x8b68('0x38')][_0x3096b3]){_0x509033[_0x8b68('0x38')][_0x3096b3][_0x8b68('0x3b')](_0x8b68('0x42'));}return _0x32cd05({'code':0xc8,'message':_0x241166});}catch(_0x6d63cb){logger[_0x8b68('0x35')](_0x6d63cb[_0x8b68('0x3e')]);return _0x31a090(_0x3f3e43[_0x8b68('0x35')](0x1f4,_0x6d63cb));}}logger[_0x8b68('0x35')](_0x8b68('0x45'));return _0x31a090(_0x3f3e43[_0x8b68('0x35')](0x1f4,_0x8b68('0x45')));});},'AgentCapacity':function(_0xf07a90){var _0x3da7b4=this;return new Promise(function(_0xae90f0,_0x1de9ce){if(_0x509033['agents'][_0x8b68('0x47')](_0xf07a90['id'])){for(var _0x51e17b in _0xf07a90['capacity']){if(_0xf07a90[_0x8b68('0x48')]['hasOwnProperty'](_0x51e17b)){if(_0x509033[_0x8b68('0x41')][_0xf07a90['id']][_0x8b68('0x47')](_0x51e17b+_0x8b68('0x49'))){_0x509033['agents'][_0xf07a90['id']][_0x51e17b+_0x8b68('0x49')]=parseInt(_0xf07a90[_0x8b68('0x48')][_0x51e17b],0xa);}}}_0x509033[_0x8b68('0x41')][_0xf07a90['id']][_0x8b68('0x4a')]();return _0xae90f0({'code':0xc8,'message':_0x509033[_0x8b68('0x41')][_0xf07a90['id']]});}else{return _0x1de9ce(_0x3da7b4[_0x8b68('0x35')](0x1f4,_0x8b68('0x4b')));}});},'Agents':function(_0x4f0aff){return new Promise(function(_0x586a5e,_0x20aac1){var _0x4224f5=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x41')]);_0x586a5e({'count':_0x4224f5[_0x8b68('0x1a')],'rows':_0x4224f5});});},'ChatQueues':function(_0x37da34){return new Promise(function(_0x2d1519,_0x314f1e){var _0x3bf22b=[];for(var _0x36d47a in _0x509033[_0x8b68('0x4d')]){if(_0x509033[_0x8b68('0x4d')][_0x8b68('0x47')](_0x36d47a)){var _0x195f82=_0x509033[_0x8b68('0x4d')][_0x36d47a];var _0x414096={'id':_0x195f82['id'],'available':_0x195f82[_0x8b68('0x4e')],'loggedIn':_0x195f82[_0x8b68('0x4f')],'name':_0x195f82['name'],'paused':_0x195f82['paused'],'waiting':_0x195f82[_0x8b68('0x50')]};_0x3bf22b[_0x8b68('0x21')](_0x414096);}}_0x2d1519({'count':_0x3bf22b['length'],'rows':_0x3bf22b});});},'MailQueues':function(_0x48d57a){return new Promise(function(_0x574aca,_0x39a04e){var _0x3d6c17=[];for(var _0xd5f52e in _0x509033[_0x8b68('0x51')]){if(_0x509033[_0x8b68('0x51')]['hasOwnProperty'](_0xd5f52e)){var _0x1c358b=_0x509033[_0x8b68('0x51')][_0xd5f52e];var _0x5c24f8={'id':_0x1c358b['id'],'available':_0x1c358b[_0x8b68('0x4e')],'loggedIn':_0x1c358b['loggedIn'],'name':_0x1c358b['name'],'paused':_0x1c358b['paused'],'waiting':_0x1c358b[_0x8b68('0x50')]};_0x3d6c17[_0x8b68('0x21')](_0x5c24f8);}}_0x574aca({'count':_0x3d6c17[_0x8b68('0x1a')],'rows':_0x3d6c17});});},'OpenchannelQueues':function(_0x7269fd){return new Promise(function(_0x864b6b,_0x1fc24c){var _0x35b22b=[];for(var _0x34456d in _0x509033[_0x8b68('0x52')]){if(_0x509033[_0x8b68('0x52')]['hasOwnProperty'](_0x34456d)){var _0x3a8d15=_0x509033[_0x8b68('0x52')][_0x34456d];var _0x310ec9={'id':_0x3a8d15['id'],'available':_0x3a8d15['available'],'loggedIn':_0x3a8d15['loggedIn'],'name':_0x3a8d15[_0x8b68('0x53')],'paused':_0x3a8d15[_0x8b68('0x54')],'waiting':_0x3a8d15['waiting']};_0x35b22b[_0x8b68('0x21')](_0x310ec9);}}_0x864b6b({'count':_0x35b22b[_0x8b68('0x1a')],'rows':_0x35b22b});});},'SmsQueues':function(_0x29bff7){return new Promise(function(_0x2c2f6d,_0x50fd2c){var _0x96e526=[];for(var _0x4925a4 in _0x509033['smsQueues']){if(_0x509033[_0x8b68('0x55')]['hasOwnProperty'](_0x4925a4)){var _0xe9550=_0x509033[_0x8b68('0x55')][_0x4925a4];var _0x5e40f4={'id':_0xe9550['id'],'available':_0xe9550[_0x8b68('0x4e')],'loggedIn':_0xe9550[_0x8b68('0x4f')],'name':_0xe9550[_0x8b68('0x53')],'paused':_0xe9550[_0x8b68('0x54')],'waiting':_0xe9550[_0x8b68('0x50')]};_0x96e526['push'](_0x5e40f4);}}_0x2c2f6d({'count':_0x96e526[_0x8b68('0x1a')],'rows':_0x96e526});});},'FaxQueues':function(_0x2e6daf){return new Promise(function(_0xa0ed41,_0x2f87e8){var _0x34c7d8=[];for(var _0x49efb7 in _0x509033['faxQueues']){if(_0x509033[_0x8b68('0x56')]['hasOwnProperty'](_0x49efb7)){var _0x2d442a=_0x509033[_0x8b68('0x56')][_0x49efb7];var _0x16e769={'id':_0x2d442a['id'],'available':_0x2d442a[_0x8b68('0x4e')],'loggedIn':_0x2d442a[_0x8b68('0x4f')],'name':_0x2d442a[_0x8b68('0x53')],'paused':_0x2d442a[_0x8b68('0x54')],'waiting':_0x2d442a['waiting']};_0x34c7d8[_0x8b68('0x21')](_0x16e769);}}_0xa0ed41({'count':_0x34c7d8['length'],'rows':_0x34c7d8});});},'WhatsappQueues':function(_0x3aaaed){return new Promise(function(_0x2caa28,_0xc8c3c){var _0x4e0fb4=[];for(var _0x3141d3 in _0x509033['whatsappQueues']){if(_0x509033[_0x8b68('0x57')]['hasOwnProperty'](_0x3141d3)){var _0x3da555=_0x509033[_0x8b68('0x57')][_0x3141d3];var _0x644d83={'id':_0x3da555['id'],'available':_0x3da555['available'],'loggedIn':_0x3da555[_0x8b68('0x4f')],'name':_0x3da555[_0x8b68('0x53')],'paused':_0x3da555[_0x8b68('0x54')],'waiting':_0x3da555[_0x8b68('0x50')]};_0x4e0fb4[_0x8b68('0x21')](_0x644d83);}}_0x2caa28({'count':_0x4e0fb4[_0x8b68('0x1a')],'rows':_0x4e0fb4});});},'ChatQueuesWaitingInteractions':function(_0x33a02f){return new Promise(function(_0x3ae1f8,_0x395b82){var _0x5a807b=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x58')]);_0x3ae1f8({'count':_0x5a807b[_0x8b68('0x1a')],'rows':_0x5a807b});});},'MailQueuesWaitingInteractions':function(_0x1e4c28){return new Promise(function(_0x71095b,_0x543468){var _0x3dfd43=_['values'](_0x509033[_0x8b68('0x59')]);_0x71095b({'count':_0x3dfd43[_0x8b68('0x1a')],'rows':_0x3dfd43});});},'OpenchannelQueuesWaitingInteractions':function(_0x524763){return new Promise(function(_0x20c8b4,_0x75af51){var _0xa7890f=_['values'](_0x509033[_0x8b68('0x5a')]);_0x20c8b4({'count':_0xa7890f[_0x8b68('0x1a')],'rows':_0xa7890f});});},'SmsQueuesWaitingInteractions':function(_0x43a874){return new Promise(function(_0x3b260a,_0x115cb7){var _0x42464c=_['values'](_0x509033[_0x8b68('0x5b')]);_0x3b260a({'count':_0x42464c[_0x8b68('0x1a')],'rows':_0x42464c});});},'FaxQueuesWaitingInteractions':function(_0x3d38eb){return new Promise(function(_0x4e5d13,_0x45e75f){var _0xde4083=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x5c')]);_0x4e5d13({'count':_0xde4083[_0x8b68('0x1a')],'rows':_0xde4083});});},'WhatsappQueuesWaitingInteractions':function(_0x377045){return new Promise(function(_0x320f42,_0x4e49ec){var _0x23cc54=_[_0x8b68('0x4c')](_0x509033[_0x8b68('0x5d')]);_0x320f42({'count':_0x23cc54['length'],'rows':_0x23cc54});});}};var _0x570629=jayson[_0x8b68('0x5e')](_0x27d717)[_0x8b68('0x5f')]();_0x570629['on'](_0x8b68('0x35'),function(_0x131a30){logger[_0x8b68('0x35')](JSON['stringify'](_0x131a30));return _0x1554d6(_0x131a30);});_0x570629[_0x8b68('0x14')](0x232c,_0x8b68('0x60'),function(){console[_0x8b68('0x61')](_0x8b68('0x62'),0x232c);return _0x22f75b('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xc3fe=['length','existsSync','join','app','.js','autoreply','appdata','push','slice','dialogflowv2','split','amazonlex','TagId','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','catch','message\x20is\x20empty','busy','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','mailQueues','available','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','listen','rules','channel','message','interaction','applications','isArray'];(function(_0x3c07af,_0x2d5b0c){var _0x2d518a=function(_0x1ecb34){while(--_0x1ecb34){_0x3c07af['push'](_0x3c07af['shift']());}};_0x2d518a(++_0x2d5b0c);}(_0xc3fe,0xff));var _0xec3f=function(_0xa88a8e,_0x5d3c58){_0xa88a8e=_0xa88a8e-0x0;var _0x3caadd=_0xc3fe[_0xa88a8e];return _0x3caadd;};'use strict';var _=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var path=require(_0xec3f('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xec3f('0x3'));var uuid=require(_0xec3f('0x4'));var utils=require(_0xec3f('0x5'));var config=require('../../../config/environment');var logger=require(_0xec3f('0x6'))(_0xec3f('0x7'));var rpc={'openchannelQueueReport':require(_0xec3f('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xec3f('0x9')),'faxQueueReport':require(_0xec3f('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0xcb8557,_0x5df7fc,_0x32207e){return util[_0xec3f('0xb')](_0xec3f('0xc'),_0xcb8557,_0x5df7fc||0x0,_0x32207e||0x0);}function getIntervals(_0x163eb8,_0x54a3fc){var _0x3b5cc3=[];if(!_[_0xec3f('0xd')](_0x54a3fc[_0xec3f('0xe')])&&!_[_0xec3f('0xd')](_0x163eb8[_0x54a3fc[_0xec3f('0xe')]])&&!_[_0xec3f('0xd')](_0x163eb8[_0x54a3fc['IntervalId']][_0xec3f('0xf')])){_0x3b5cc3=_[_0xec3f('0x10')](_0x163eb8[_0x54a3fc[_0xec3f('0xe')]]['Intervals'],'interval');}else if(!_[_0xec3f('0xd')](_0x54a3fc['interval'])){_0x3b5cc3=[_0x54a3fc['interval']];}return _0x3b5cc3;}exports[_0xec3f('0x11')]=function(_0x4318bd){_0x4318bd[_0xec3f('0x12')]={};return new BPromise(function(_0x4e6440,_0x4efa81){var _0x5509ec={'Start':function(_0x5ad65a){var _0x37d688=this;return new Promise(function(_0x10ff81,_0x5bd7c0){if(_0x5ad65a){try{var _0x225edd=[];var _0xb8ee6f=getId(_0x5ad65a[_0xec3f('0x13')],_0x5ad65a[_0xec3f('0x14')]?_0x5ad65a['message']['id']:0x0,_0x5ad65a[_0xec3f('0x15')]?_0x5ad65a[_0xec3f('0x15')]['id']:0x0);if(_0x5ad65a[_0xec3f('0x16')]&&_[_0xec3f('0x17')](_0x5ad65a[_0xec3f('0x16')])&&_0x5ad65a['applications'][_0xec3f('0x18')]){for(var _0x4bea4e=0x0;_0x4bea4e<_0x5ad65a[_0xec3f('0x16')][_0xec3f('0x18')];_0x4bea4e+=0x1){var _0x1d6a23=_0x5ad65a['applications'][_0x4bea4e];if(fs[_0xec3f('0x19')](path[_0xec3f('0x1a')](__dirname,'applications',_0x1d6a23[_0xec3f('0x1b')]+_0xec3f('0x1c')))){var _0x1f173f=[];switch(_0x1d6a23[_0xec3f('0x1b')]['toLowerCase']()){case _0xec3f('0x1d'):var _0x170f11=_0x1d6a23[_0xec3f('0x1e')]['split'](',');if(_0x5ad65a[_0xec3f('0x13')]==='mail'){_0x1f173f[_0xec3f('0x1f')](_0x170f11[0x0]);_0x1f173f['push'](_0x170f11[0x1]);_0x1f173f['push'](_0x170f11[_0xec3f('0x20')](0x2,_0x170f11['length'])[_0xec3f('0x1a')](','));}else{_0x1f173f[_0xec3f('0x1f')](_0x170f11[0x0]);_0x1f173f[_0xec3f('0x1f')](_0x170f11['slice'](0x1,_0x170f11[_0xec3f('0x18')])[_0xec3f('0x1a')](','));}break;case'dialogflow':var _0x53cc0d=_0x1d6a23[_0xec3f('0x1e')]['split'](',');_0x1f173f[_0xec3f('0x1f')](_0x53cc0d[0x0]);_0x1f173f[_0xec3f('0x1f')](_0x53cc0d[0x1]);_0x1f173f[_0xec3f('0x1f')](_0x53cc0d[_0xec3f('0x20')](0x2,_0x53cc0d[_0xec3f('0x18')])[_0xec3f('0x1a')](','));break;case _0xec3f('0x21'):var _0x237134=_0x1d6a23['appdata'][_0xec3f('0x22')](',');_0x1f173f[_0xec3f('0x1f')](_0x237134[0x0]);_0x1f173f['push'](_0x237134[0x1]);_0x1f173f[_0xec3f('0x1f')](_0x237134[0x2]);_0x1f173f[_0xec3f('0x1f')](_0x237134[0x3]);_0x1f173f[_0xec3f('0x1f')](_0x237134[_0xec3f('0x20')](0x4,_0x237134[_0xec3f('0x18')])[_0xec3f('0x1a')](','));break;case _0xec3f('0x23'):var _0x29af36=_0x1d6a23[_0xec3f('0x1e')][_0xec3f('0x22')](',');_0x1f173f[_0xec3f('0x1f')](_0x29af36[0x0]);_0x1f173f[_0xec3f('0x1f')](_0x29af36[0x1]);_0x1f173f[_0xec3f('0x1f')](_0x29af36[0x2]);_0x1f173f[_0xec3f('0x1f')](_0x29af36[0x3]);_0x1f173f[_0xec3f('0x1f')](_0x29af36['slice'](0x4,_0x29af36[_0xec3f('0x18')])[_0xec3f('0x1a')](','));break;case _0xec3f('0x14'):_0x1f173f[_0xec3f('0x1f')](_0x1d6a23[_0xec3f('0x1e')]);break;case'tag':_0x1f173f[_0xec3f('0x1f')](_0x1d6a23[_0xec3f('0x24')]);_0x1f173f[_0xec3f('0x1f')](_0x1d6a23['appdata']);break;case'tvox':var _0x1aded9=utils['getMustacheRender'](_0x5ad65a[_0xec3f('0x25')]['notificationTemplate'],_0x5ad65a);var _0x131839=_0x1d6a23['appdata']['split'](',');_0x1f173f[_0xec3f('0x1f')](_0x131839[0x0]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x1]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x2]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x3]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x4]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x5]);_0x1f173f['push'](_0x131839[0x6]);_0x1f173f['push'](_0x131839[0x7]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x8]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0x9]);_0x1f173f[_0xec3f('0x1f')](_0x131839[0xa]);_0x1f173f[_0xec3f('0x1f')](_0x5ad65a[_0xec3f('0x15')]['id']);_0x1f173f[_0xec3f('0x1f')](_0x5ad65a[_0xec3f('0x14')]['id']);_0x1f173f['push'](_0x1d6a23[_0xec3f('0x26')]);_0x1f173f['push'](_0x5ad65a[_0xec3f('0x15')][_0xec3f('0x27')]);_0x1f173f[_0xec3f('0x1f')](_0x5ad65a[_0xec3f('0x28')][_0xec3f('0x28')]);_0x1f173f[_0xec3f('0x1f')](_0x1aded9);break;default:_0x1f173f=_[_0xec3f('0xd')](_0x1d6a23[_0xec3f('0x1e')])?[]:_0x1d6a23[_0xec3f('0x1e')][_0xec3f('0x22')](',');}var _0x38a9e3={'id':util[_0xec3f('0xb')](_0xec3f('0x29'),_0xb8ee6f,_0x1d6a23['id'],_0x1d6a23['app']),'condition':require(_0xec3f('0x2a'))[_0xec3f('0x2b')](_0xb8ee6f,getIntervals(_0x4318bd['intervals'],_0x1d6a23),_0x4318bd),'consequence':require(_0xec3f('0x2c')+_0x1d6a23[_0xec3f('0x1b')])['consequence'](_0xb8ee6f,_0x1f173f,_0x4318bd,_0x5ad65a),'p':_0x1d6a23[_0xec3f('0x2d')]||0x0};logger[_0xec3f('0x2e')](_0xec3f('0x2f'),_0x38a9e3['id'],_0xec3f('0x30'),getIntervals(_0x4318bd[_0xec3f('0x31')],_0x1d6a23)[_0xec3f('0x1a')]('\x20|\x20'));_0x225edd[_0xec3f('0x1f')](_0x38a9e3);}else{logger[_0xec3f('0x32')](_0xec3f('0x33'),path[_0xec3f('0x1a')](__dirname,_0xec3f('0x16'),_0x1d6a23[_0xec3f('0x1b')]+_0xec3f('0x1c')));}}_0x4318bd[_0xec3f('0x12')][_0xb8ee6f]=new RuleEngine(_0x225edd);_0x4318bd[_0xec3f('0x12')][_0xb8ee6f]['execute'](_0x5ad65a,function(_0x8d0f18){logger['info'](_0xec3f('0x34'),JSON[_0xec3f('0x35')](_0x8d0f18[_0xec3f('0x36')]));if(_0x4318bd[_0xec3f('0x12')][_0xb8ee6f]){_0x4318bd[_0xec3f('0x12')][_0xb8ee6f][_0xec3f('0x37')](_0xec3f('0x38'));}});return _0x10ff81({'code':0xc8,'message':_0x5ad65a});}else{logger[_0xec3f('0x2e')](_0xec3f('0x39'));return _0x10ff81({'code':0xc8,'message':_0x5ad65a});}}catch(_0x1b056c){logger[_0xec3f('0x32')](_0x1b056c[_0xec3f('0x3a')]);return _0x5bd7c0(_0x37d688['error'](0x1f4,_0x1b056c));}}return _0x5bd7c0(_0xec3f('0x3b'));});},'AcceptMessage':function(_0x1943ca){var _0x531c21=this;return new Promise(function(_0x2e21c7,_0x3b061a){if(_0x1943ca[_0xec3f('0x3c')]&&_0x1943ca[_0xec3f('0x3c')]['id']){if(_0x4318bd['agents'][_0x1943ca['agent']['id']]){_0x4318bd[_0xec3f('0x3d')][_0x1943ca[_0xec3f('0x3c')]['id']]['busy']=![];_0x4318bd[_0xec3f('0x3d')][_0x1943ca[_0xec3f('0x3c')]['id']][_0xec3f('0x3e')]=undefined;}}if(_0x1943ca['message']&&_0x1943ca[_0xec3f('0x14')]['id']){try{var _0x5a080f=getId(_0x1943ca['channel'],_0x1943ca['message']?_0x1943ca[_0xec3f('0x14')]['id']:0x0,_0x1943ca[_0xec3f('0x15')]?_0x1943ca[_0xec3f('0x15')]['id']:0x0);if(_0x4318bd[_0xec3f('0x12')][_0x5a080f]){_0x4318bd['rules'][_0x5a080f][_0xec3f('0x37')]('end');if(rpc[_0x1943ca[_0xec3f('0x13')]+_0xec3f('0x3f')]){rpc[_0x1943ca[_0xec3f('0x13')]+_0xec3f('0x3f')][_0xec3f('0x40')](_0x5a080f,{'UserId':_0x1943ca[_0xec3f('0x14')]['UserId']})[_0xec3f('0x41')](function(_0x56e5c2){logger[_0xec3f('0x32')]('error\x20update\x20queue\x20report');});}}return _0x2e21c7({'code':0xc8,'message':_0x1943ca});}catch(_0x425d90){logger['error'](_0x425d90[_0xec3f('0x3a')]);return _0x3b061a(_0x531c21[_0xec3f('0x32')](0x1f4,_0x425d90));}}logger[_0xec3f('0x32')](_0xec3f('0x42'));return _0x3b061a(_0x531c21[_0xec3f('0x32')](0x1f4,_0xec3f('0x42')));});},'RejectMessage':function(_0x2ee773){var _0x10eb47=this;return new Promise(function(_0x50287d,_0x230aad){if(_0x2ee773[_0xec3f('0x3c')]&&_0x2ee773['agent']['id']){try{if(_0x4318bd[_0xec3f('0x3d')][_0x2ee773['agent']['id']]){_0x4318bd[_0xec3f('0x3d')][_0x2ee773['agent']['id']][_0xec3f('0x43')]=![];_0x4318bd['agents'][_0x2ee773[_0xec3f('0x3c')]['id']]['busyQueue']=undefined;}return _0x50287d({'code':0xc8,'message':_0x2ee773});}catch(_0x6d53a2){logger[_0xec3f('0x32')](_0x6d53a2[_0xec3f('0x3a')]);return _0x230aad(_0x10eb47[_0xec3f('0x32')](0x1f4,_0x6d53a2));}}logger[_0xec3f('0x32')](_0xec3f('0x42'));return _0x230aad(_0x10eb47['error'](0x1f4,_0xec3f('0x42')));});},'AbandonInteraction':function(_0x584c68){var _0x13825e=this;return new Promise(function(_0xd498e5,_0x2a421f){if(_0x584c68[_0xec3f('0x13')]&&_0x584c68[_0xec3f('0x15')]&&_0x584c68[_0xec3f('0x15')]['id']){try{var _0x1a9073=getId(_0x584c68['channel'],_0x584c68[_0xec3f('0x14')]?_0x584c68[_0xec3f('0x14')]['id']:0x0,_0x584c68[_0xec3f('0x15')]?_0x584c68[_0xec3f('0x15')]['id']:0x0);if(_0x4318bd[_0xec3f('0x12')][_0x1a9073]){_0x4318bd[_0xec3f('0x12')][_0x1a9073]['emit'](_0xec3f('0x44'));}return _0xd498e5({'code':0xc8,'message':_0x584c68});}catch(_0x2a5a1f){logger[_0xec3f('0x32')](_0x2a5a1f[_0xec3f('0x3a')]);return _0x2a421f(_0x13825e[_0xec3f('0x32')](0x1f4,_0x2a5a1f));}}logger['error'](_0xec3f('0x42'));return _0x2a421f(_0x13825e[_0xec3f('0x32')](0x1f4,_0xec3f('0x42')));});},'AgentCapacity':function(_0x50b4a5){var _0x30576f=this;return new Promise(function(_0x12f0d5,_0xced939){if(_0x4318bd['agents']['hasOwnProperty'](_0x50b4a5['id'])){for(var _0x5c1c1d in _0x50b4a5[_0xec3f('0x45')]){if(_0x50b4a5[_0xec3f('0x45')][_0xec3f('0x46')](_0x5c1c1d)){if(_0x4318bd['agents'][_0x50b4a5['id']]['hasOwnProperty'](_0x5c1c1d+_0xec3f('0x47'))){_0x4318bd[_0xec3f('0x3d')][_0x50b4a5['id']][_0x5c1c1d+_0xec3f('0x47')]=parseInt(_0x50b4a5[_0xec3f('0x45')][_0x5c1c1d],0xa);}}}_0x4318bd[_0xec3f('0x3d')][_0x50b4a5['id']][_0xec3f('0x48')]();return _0x12f0d5({'code':0xc8,'message':_0x4318bd['agents'][_0x50b4a5['id']]});}else{return _0xced939(_0x30576f[_0xec3f('0x32')](0x1f4,_0xec3f('0x49')));}});},'Agents':function(_0x29ef84){return new Promise(function(_0x4be96a,_0x10464d){var _0x50f62c=_['values'](_0x4318bd[_0xec3f('0x3d')]);_0x4be96a({'count':_0x50f62c[_0xec3f('0x18')],'rows':_0x50f62c});});},'ChatQueues':function(_0x51b547){return new Promise(function(_0x21e26e,_0x41c59d){var _0xfef5e8=[];for(var _0x5247db in _0x4318bd[_0xec3f('0x4a')]){if(_0x4318bd['chatQueues'][_0xec3f('0x46')](_0x5247db)){var _0x17ef99=_0x4318bd[_0xec3f('0x4a')][_0x5247db];var _0x18c6de={'id':_0x17ef99['id'],'available':_0x17ef99['available'],'loggedIn':_0x17ef99[_0xec3f('0x4b')],'name':_0x17ef99[_0xec3f('0x4c')],'paused':_0x17ef99['paused'],'waiting':_0x17ef99['waiting']};_0xfef5e8[_0xec3f('0x1f')](_0x18c6de);}}_0x21e26e({'count':_0xfef5e8[_0xec3f('0x18')],'rows':_0xfef5e8});});},'MailQueues':function(_0x4d3600){return new Promise(function(_0x50a024,_0x1f8041){var _0x3b6000=[];for(var _0x46f7be in _0x4318bd['mailQueues']){if(_0x4318bd['mailQueues'][_0xec3f('0x46')](_0x46f7be)){var _0xe4c6bb=_0x4318bd[_0xec3f('0x4d')][_0x46f7be];var _0x3140c5={'id':_0xe4c6bb['id'],'available':_0xe4c6bb[_0xec3f('0x4e')],'loggedIn':_0xe4c6bb[_0xec3f('0x4b')],'name':_0xe4c6bb[_0xec3f('0x4c')],'paused':_0xe4c6bb[_0xec3f('0x4f')],'waiting':_0xe4c6bb[_0xec3f('0x50')]};_0x3b6000['push'](_0x3140c5);}}_0x50a024({'count':_0x3b6000[_0xec3f('0x18')],'rows':_0x3b6000});});},'OpenchannelQueues':function(_0x2f9f93){return new Promise(function(_0x14f8a8,_0x360088){var _0x2520c9=[];for(var _0x202752 in _0x4318bd['openchannelQueues']){if(_0x4318bd[_0xec3f('0x51')][_0xec3f('0x46')](_0x202752)){var _0x35851a=_0x4318bd['openchannelQueues'][_0x202752];var _0xf1da2e={'id':_0x35851a['id'],'available':_0x35851a[_0xec3f('0x4e')],'loggedIn':_0x35851a[_0xec3f('0x4b')],'name':_0x35851a[_0xec3f('0x4c')],'paused':_0x35851a[_0xec3f('0x4f')],'waiting':_0x35851a[_0xec3f('0x50')]};_0x2520c9[_0xec3f('0x1f')](_0xf1da2e);}}_0x14f8a8({'count':_0x2520c9['length'],'rows':_0x2520c9});});},'SmsQueues':function(_0x1a79b5){return new Promise(function(_0x3a8fc4,_0xb21ec5){var _0x5f24b4=[];for(var _0x33563b in _0x4318bd['smsQueues']){if(_0x4318bd[_0xec3f('0x52')][_0xec3f('0x46')](_0x33563b)){var _0xd0ead8=_0x4318bd[_0xec3f('0x52')][_0x33563b];var _0x4436c3={'id':_0xd0ead8['id'],'available':_0xd0ead8[_0xec3f('0x4e')],'loggedIn':_0xd0ead8[_0xec3f('0x4b')],'name':_0xd0ead8[_0xec3f('0x4c')],'paused':_0xd0ead8[_0xec3f('0x4f')],'waiting':_0xd0ead8[_0xec3f('0x50')]};_0x5f24b4[_0xec3f('0x1f')](_0x4436c3);}}_0x3a8fc4({'count':_0x5f24b4[_0xec3f('0x18')],'rows':_0x5f24b4});});},'FaxQueues':function(_0x4ecbb8){return new Promise(function(_0x58e65f,_0x1af3ed){var _0x276aa1=[];for(var _0x3f8e44 in _0x4318bd[_0xec3f('0x53')]){if(_0x4318bd[_0xec3f('0x53')][_0xec3f('0x46')](_0x3f8e44)){var _0x50053b=_0x4318bd['faxQueues'][_0x3f8e44];var _0x56993f={'id':_0x50053b['id'],'available':_0x50053b[_0xec3f('0x4e')],'loggedIn':_0x50053b['loggedIn'],'name':_0x50053b[_0xec3f('0x4c')],'paused':_0x50053b[_0xec3f('0x4f')],'waiting':_0x50053b[_0xec3f('0x50')]};_0x276aa1[_0xec3f('0x1f')](_0x56993f);}}_0x58e65f({'count':_0x276aa1[_0xec3f('0x18')],'rows':_0x276aa1});});},'WhatsappQueues':function(_0x55ef2b){return new Promise(function(_0x15c1d2,_0x8c7db8){var _0x280047=[];for(var _0x530bbf in _0x4318bd[_0xec3f('0x54')]){if(_0x4318bd[_0xec3f('0x54')][_0xec3f('0x46')](_0x530bbf)){var _0x57460f=_0x4318bd['whatsappQueues'][_0x530bbf];var _0x49a78c={'id':_0x57460f['id'],'available':_0x57460f['available'],'loggedIn':_0x57460f[_0xec3f('0x4b')],'name':_0x57460f['name'],'paused':_0x57460f[_0xec3f('0x4f')],'waiting':_0x57460f[_0xec3f('0x50')]};_0x280047[_0xec3f('0x1f')](_0x49a78c);}}_0x15c1d2({'count':_0x280047[_0xec3f('0x18')],'rows':_0x280047});});},'ChatQueuesWaitingInteractions':function(_0x49a60b){return new Promise(function(_0x3c10e2,_0x34c99d){var _0x108034=_[_0xec3f('0x55')](_0x4318bd['chatQueuesWaitingInteractions']);_0x3c10e2({'count':_0x108034[_0xec3f('0x18')],'rows':_0x108034});});},'MailQueuesWaitingInteractions':function(_0x496c8){return new Promise(function(_0x3bea0e,_0xd60ac0){var _0x460262=_['values'](_0x4318bd[_0xec3f('0x56')]);_0x3bea0e({'count':_0x460262[_0xec3f('0x18')],'rows':_0x460262});});},'OpenchannelQueuesWaitingInteractions':function(_0x121a8d){return new Promise(function(_0xfd7451,_0x24da5c){var _0x168708=_[_0xec3f('0x55')](_0x4318bd['openchannelQueuesWaitingInteractions']);_0xfd7451({'count':_0x168708[_0xec3f('0x18')],'rows':_0x168708});});},'SmsQueuesWaitingInteractions':function(_0x1bb0fa){return new Promise(function(_0xeed8ae,_0x3c53bc){var _0x5a8013=_[_0xec3f('0x55')](_0x4318bd[_0xec3f('0x57')]);_0xeed8ae({'count':_0x5a8013['length'],'rows':_0x5a8013});});},'FaxQueuesWaitingInteractions':function(_0x1882b6){return new Promise(function(_0x8b5b76,_0x2a5b97){var _0x346fe7=_['values'](_0x4318bd[_0xec3f('0x58')]);_0x8b5b76({'count':_0x346fe7[_0xec3f('0x18')],'rows':_0x346fe7});});},'WhatsappQueuesWaitingInteractions':function(_0x68c1de){return new Promise(function(_0x2b279f,_0x4824be){var _0x1188d5=_[_0xec3f('0x55')](_0x4318bd['whatsappQueuesWaitingInteractions']);_0x2b279f({'count':_0x1188d5['length'],'rows':_0x1188d5});});}};var _0x45a3c7=jayson[_0xec3f('0x59')](_0x5509ec)[_0xec3f('0x5a')]();_0x45a3c7['on'](_0xec3f('0x32'),function(_0x13efda){logger[_0xec3f('0x32')](JSON[_0xec3f('0x35')](_0x13efda));return _0x4efa81(_0x13efda);});_0x45a3c7[_0xec3f('0x11')](0x232c,_0xec3f('0x5b'),function(){console['log'](_0xec3f('0x5c'),0x232c);return _0x4e6440('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index a572c1e..1b5086b 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 _0x253a=['Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0x253a,0x71));var _0xa253=function(_0x1e71e8,_0x31aab3){_0x1e71e8=_0x1e71e8-0x0;var _0x2718f8=_0x253a[_0x1e71e8];return _0x2718f8;};'use strict';var util=require(_0xa253('0x0'));var BPromise=require(_0xa253('0x1'));var jayson=require(_0xa253('0x2'));var _=require(_0xa253('0x3'));var logger=require(_0xa253('0x4'))(_0xa253('0x5'));var client=jayson[_0xa253('0x6')]['http']({'port':0x232a});function request(_0x48d1cc,_0x42b98e){return new BPromise(function(_0x3ba544,_0x54d975){return client[_0xa253('0x7')](_0x48d1cc,_0x42b98e)[_0xa253('0x8')](function(_0x2b910b){if(_0x2b910b[_0xa253('0x9')]){return _0x54d975(_0x2b910b[_0xa253('0x9')][_0xa253('0xa')]);}else{return _0x3ba544(_0x2b910b[_0xa253('0xb')]);}})[_0xa253('0xc')](function(_0x5478d6){return _0x54d975(_0x5478d6);});});}exports[_0xa253('0xd')]=function(_0x4ed78a,_0x2f3972,_0x2b643f){return function(_0x48b958){if(_0x2b643f[_0xa253('0xe')]&&!_0x2b643f[_0xa253('0xe')][_0x4ed78a]){logger[_0xa253('0xf')](_0xa253('0x10'),_0x4ed78a);return _0x48b958['stop']();}var _0x338e48=[];for(var _0x45c553=0x0;_0x45c553<_0x2f3972[_0xa253('0x11')];_0x45c553+=0x1){_0x338e48[_0xa253('0x12')](request(_0xa253('0x13'),{'command':util[_0xa253('0x14')](_0xa253('0x15'),_0x2f3972[_0x45c553])})[_0xa253('0x8')](function(_0x5355e0){return _0x5355e0&&_0x5355e0[_0xa253('0xa')]&&_0x5355e0[_0xa253('0xa')][_0xa253('0x16')](_0xa253('0x17'))>=0x0?!![]:![];})[_0xa253('0xc')](function(_0x514d66){logger[_0xa253('0x9')](_0xa253('0x18'),_0x4ed78a,_0x2f3972[_0x45c553]);}));}BPromise[_0xa253('0x19')](_0x338e48)[_0xa253('0x8')](function(_0x4cdbf6){var _0x3a1a4a=_[_0xa253('0x1a')](_0x4cdbf6);logger['info'](_0xa253('0x1b'),_0x4ed78a,_0x2f3972['join'](_0xa253('0x1c')),_0x3a1a4a);_0x48b958[_0xa253('0x1d')](_0x3a1a4a);})[_0xa253('0xc')](function(_0x217fc2){console['log'](_0x217fc2);logger[_0xa253('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x4ed78a,_0x2f3972[_0xa253('0x1e')](_0xa253('0x1c')),_0x217fc2[_0xa253('0x1f')]);_0x48b958[_0xa253('0x20')]();});};}; \ No newline at end of file +var _0xfebd=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','util','bluebird','jayson/promise','lodash','http','request','then','error','message','result','catch','condition','info'];(function(_0x5e345e,_0x1e4cff){var _0x437adb=function(_0x448458){while(--_0x448458){_0x5e345e['push'](_0x5e345e['shift']());}};_0x437adb(++_0x1e4cff);}(_0xfebd,0x111));var _0xdfeb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfebd[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xdfeb('0x0'));var BPromise=require(_0xdfeb('0x1'));var jayson=require(_0xdfeb('0x2'));var _=require(_0xdfeb('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0xdfeb('0x4')]({'port':0x232a});function request(_0x2201ac,_0x141aa5){return new BPromise(function(_0x411c74,_0x2a84a7){return client[_0xdfeb('0x5')](_0x2201ac,_0x141aa5)[_0xdfeb('0x6')](function(_0x251bde){if(_0x251bde[_0xdfeb('0x7')]){return _0x2a84a7(_0x251bde[_0xdfeb('0x7')][_0xdfeb('0x8')]);}else{return _0x411c74(_0x251bde[_0xdfeb('0x9')]);}})[_0xdfeb('0xa')](function(_0x371834){return _0x2a84a7(_0x371834);});});}exports[_0xdfeb('0xb')]=function(_0xa20d66,_0x514f6e,_0x15e9bb){return function(_0x52fb90){if(_0x15e9bb['rules']&&!_0x15e9bb['rules'][_0xa20d66]){logger[_0xdfeb('0xc')](_0xdfeb('0xd'),_0xa20d66);return _0x52fb90[_0xdfeb('0xe')]();}var _0x2256a2=[];for(var _0x1e9957=0x0;_0x1e9957<_0x514f6e[_0xdfeb('0xf')];_0x1e9957+=0x1){_0x2256a2['push'](request(_0xdfeb('0x10'),{'command':util['format']('iftime\x20%s',_0x514f6e[_0x1e9957])})[_0xdfeb('0x6')](function(_0x37eec9){return _0x37eec9&&_0x37eec9['message']&&_0x37eec9[_0xdfeb('0x8')][_0xdfeb('0x11')](_0xdfeb('0x12'))>=0x0?!![]:![];})[_0xdfeb('0xa')](function(_0xd1f144){logger['error'](_0xdfeb('0x13'),_0xa20d66,_0x514f6e[_0x1e9957]);}));}BPromise[_0xdfeb('0x14')](_0x2256a2)[_0xdfeb('0x6')](function(_0x39721c){var _0x57c0cd=_[_0xdfeb('0x15')](_0x39721c);logger[_0xdfeb('0xc')](_0xdfeb('0x16'),_0xa20d66,_0x514f6e[_0xdfeb('0x17')]('\x20|\x20'),_0x57c0cd);_0x52fb90['when'](_0x57c0cd);})[_0xdfeb('0xa')](function(_0x166b3b){console[_0xdfeb('0x18')](_0x166b3b);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0xa20d66,_0x514f6e[_0xdfeb('0x17')](_0xdfeb('0x19')),_0x166b3b['stack']);_0x52fb90[_0xdfeb('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index fe482c0..80bdad8 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 _0x8f59=['transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','lastevent','called','connectedlinename','format','membername','error','agentringnoanswer','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]'];(function(_0x4b6ef6,_0x3e8bd5){var _0x21a1c2=function(_0x2ac078){while(--_0x2ac078){_0x4b6ef6['push'](_0x4b6ef6['shift']());}};_0x21a1c2(++_0x3e8bd5);}(_0x8f59,0x11d));var _0x98f5=function(_0x494315,_0x2d42bd){_0x494315=_0x494315-0x0;var _0x49cc18=_0x8f59[_0x494315];return _0x49cc18;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var utils=require(_0x98f5('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xe809bb,_0x1d9fb3){utils[_0x98f5('0x3')](util['format'](_0x98f5('0x4'),_0xe809bb[_0x98f5('0x5')],_0xe809bb[_0x98f5('0x6')],_0xe809bb[_0x98f5('0x7')],_0xe809bb['membername'],_0xe809bb[_0x98f5('0x8')],_0xe809bb[_0x98f5('0x9')],_0xe809bb[_0x98f5('0xa')],_0xe809bb['lastevent']));if(_0xe809bb['queue']){utils[_0x98f5('0xb')](_0xe809bb[_0x98f5('0x7')])[_0x98f5('0xc')](function(_0x53493e){if(_0x53493e){_0xe809bb[_0x98f5('0xd')]=_0x53493e[_0x98f5('0xd')];_0xe809bb[_0x98f5('0xe')]=_0xe809bb[_0x98f5('0xf')]?_0x53493e['acw']:![];_0xe809bb[_0x98f5('0x10')]=_0xe809bb['agentacw']?_0x53493e['acwTimeout']:0x0;}utils[_0x98f5('0x11')](_0x98f5('0x12'),_0xe809bb);});}else{utils['request'](_0x98f5('0x12'),_0xe809bb);}if(_0x1d9fb3){delete transfers[_0xe809bb[_0x98f5('0x5')]];}else{delete agents[_0xe809bb[_0x98f5('0x13')]];}}exports[_0x98f5('0x14')]=function(_0x3286f7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x16'),_0x3286f7[_0x98f5('0x5')]),_0x3286f7);agents[_0x3286f7['destuniqueid']]=_0x3286f7;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();agents[_0x3286f7['destuniqueid']][_0x98f5('0x19')]=_0x98f5('0x1a');agents[_0x3286f7[_0x98f5('0x13')]]['connectedlinenum']=null;agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1b')]=null;utils['info'](util[_0x98f5('0x1c')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3286f7[_0x98f5('0x5')],agents[_0x3286f7[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x3286f7[_0x98f5('0x13')]));}catch(_0xd6f409){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x16'),_0x3286f7['uniqueid']),_0xd6f409);}};exports[_0x98f5('0x1f')]=function(_0x191f23){try{if(!_['isNil'](agents[_0x191f23[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x191f23);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x191f23[_0x98f5('0x5')],agents[_0x191f23['destuniqueid']][_0x98f5('0x1d')],_0x191f23['destuniqueid']));agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x1f')]=!![];agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x21')]=utils[_0x98f5('0x18')]();agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x19')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x22')]='timeout';agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x191f23[_0x98f5('0x24')]?parseInt(_0x191f23[_0x98f5('0x24')])/0x3e8:0x0;agents[_0x191f23[_0x98f5('0x13')]][_0x98f5('0x25')]=0x0;unanswered[_0x98f5('0x26')](_0x191f23[_0x98f5('0x13')]);}}catch(_0x576c4b){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x20'),_0x191f23[_0x98f5('0x5')]),_0x576c4b);}};exports[_0x98f5('0x27')]=function(_0x15bf92){try{_[_0x98f5('0x28')](agents,function(_0x5e9d73,_0x29e1f5){if(_0x5e9d73[_0x98f5('0x5')]==_0x15bf92[_0x98f5('0x5')]&&!_[_0x98f5('0x29')](unanswered,_0x5e9d73[_0x98f5('0x13')])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0x15bf92);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x15bf92[_0x98f5('0x5')],_0x5e9d73[_0x98f5('0x1d')],_0x5e9d73[_0x98f5('0x13')]));_0x5e9d73[_0x98f5('0x1f')]=!![];_0x5e9d73[_0x98f5('0x21')]=utils[_0x98f5('0x18')]();_0x5e9d73[_0x98f5('0x19')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x22')]=_0x98f5('0x2b');_0x5e9d73[_0x98f5('0x23')]=_0x15bf92[_0x98f5('0x23')];_0x5e9d73[_0x98f5('0x25')]=0x0;writeDB(_0x5e9d73);}});}catch(_0xe4a944){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x2a'),_0x15bf92[_0x98f5('0x5')]),_0xe4a944);}};exports[_0x98f5('0x2c')]=function(_0x39d935){try{if(agents[_0x39d935['destuniqueid']]){utils[_0x98f5('0x15')](util['format']('[%s][agents][agentconnect]',_0x39d935[_0x98f5('0x5')]),_0x39d935);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x2d'),_0x39d935['uniqueid'],agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x1d')],_0x39d935[_0x98f5('0x13')]));agents[_0x39d935['destuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();agents[_0x39d935['destuniqueid']][_0x98f5('0xa')]=_0x39d935[_0x98f5('0xa')];agents[_0x39d935[_0x98f5('0x13')]]['connectedlinename']=_0x39d935[_0x98f5('0x1b')];agents[_0x39d935[_0x98f5('0x13')]][_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];agents[_0x39d935[_0x98f5('0x13')]]['lastevent']='connect';_[_0x98f5('0x28')](agents,function(_0x14faf2,_0x33e6e2){if(_0x14faf2[_0x98f5('0x13')]!=_0x39d935[_0x98f5('0x13')]&&_0x14faf2[_0x98f5('0x5')]==_0x39d935['uniqueid']){_0x14faf2['talktime']=0x0;_0x14faf2[_0x98f5('0x23')]=_0x39d935[_0x98f5('0x24')];_0x14faf2[_0x98f5('0x1f')]=!![];_0x14faf2[_0x98f5('0x21')]=utils['now']();_0x14faf2['lastevent']=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x22')]=_0x98f5('0x2f');_0x14faf2[_0x98f5('0x30')]=_0x39d935['destuniqueid'];_0x14faf2['answeredelsewheremembername']=_0x39d935[_0x98f5('0x1d')];writeDB(_0x14faf2);}});}}catch(_0x3a191f){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x31'),_0x39d935['uniqueid']),_0x3a191f);}};exports[_0x98f5('0xf')]=function(_0x4ff7b0){try{if(!_[_0x98f5('0x32')](agents[_0x4ff7b0[_0x98f5('0x13')]])){utils[_0x98f5('0x15')](util['format'](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x4ff7b0);utils['info'](util[_0x98f5('0x1c')](_0x98f5('0x34'),_0x4ff7b0['uniqueid'],agents[_0x4ff7b0[_0x98f5('0x13')]]['membername'],_0x4ff7b0[_0x98f5('0x13')]));agents[_0x4ff7b0[_0x98f5('0x13')]]['agentcomplete']=!![];agents[_0x4ff7b0['destuniqueid']]['agentcompleteAt']=utils['now']();agents[_0x4ff7b0[_0x98f5('0x13')]]['talktime']=utils[_0x98f5('0x35')](agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x36')],agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x2e')]);agents[_0x4ff7b0[_0x98f5('0x13')]]['reason']=_0x4ff7b0[_0x98f5('0x22')];agents[_0x4ff7b0[_0x98f5('0x13')]][_0x98f5('0x19')]=_0x98f5('0x37');writeDB(agents[_0x4ff7b0[_0x98f5('0x13')]]);}}catch(_0x459649){utils['error'](util[_0x98f5('0x1c')](_0x98f5('0x33'),_0x4ff7b0[_0x98f5('0x5')]),_0x459649);}};exports[_0x98f5('0x38')]=function(_0x4a0cda){try{if(!_[_0x98f5('0x32')](agents[_0x4a0cda[_0x98f5('0x39')]])){utils[_0x98f5('0x15')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda['uniqueid']),_0x4a0cda);utils[_0x98f5('0x3')](util[_0x98f5('0x1c')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4a0cda[_0x98f5('0x5')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x1d')],agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x5')]));agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3b')]=!![];agents[_0x4a0cda['transfereruniqueid']][_0x98f5('0x3c')]=_0x98f5('0x3d');agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x3e')]=_0x4a0cda[_0x98f5('0x3f')];agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x40')]=agents[_0x4a0cda[_0x98f5('0x39')]][_0x98f5('0x5')];}}catch(_0x2e48a1){utils[_0x98f5('0x1e')](util[_0x98f5('0x1c')](_0x98f5('0x3a'),_0x4a0cda[_0x98f5('0x5')]),_0x2e48a1);}};exports[_0x98f5('0x41')]=function(_0x1289a7){try{utils[_0x98f5('0x15')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1289a7);if(_0x1289a7[_0x98f5('0x43')]==_0x1289a7[_0x98f5('0x44')]){if(!_[_0x98f5('0x32')](agents[_0x1289a7[_0x98f5('0x45')]])){utils['info'](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x45')]]['transfer']=!![];agents[_0x1289a7[_0x98f5('0x45')]]['transfertype']=_0x98f5('0x46');agents[_0x1289a7['secondtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x47')];agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x40')]=_0x1289a7['origtransfereruniqueid'];}if(_0x1289a7['transfereeuniqueid']&&agents[_0x1289a7[_0x98f5('0x48')]]){agents[_0x1289a7[_0x98f5('0x48')]]['agententerreason']=0x1;transfers[_0x1289a7[_0x98f5('0x48')]]=_[_0x98f5('0x49')](agents[_0x1289a7['transfereeuniqueid']]);transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x45')]]['calleridnum'];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x4a')]=agents[_0x1289a7[_0x98f5('0x45')]][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x48')]][_0x98f5('0x17')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x48')]]['holdtime']=0x0;transfers[_0x1289a7['transfereeuniqueid']][_0x98f5('0x4b')]=0x2;}}else if(_0x1289a7[_0x98f5('0x45')]==_0x1289a7['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x1289a7['origtransfereruniqueid']])){utils['info'](util[_0x98f5('0x1c')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1289a7[_0x98f5('0x43')],agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x1d')]));agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3b')]=!![];agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x3c')]=_0x98f5('0x46');agents[_0x1289a7['origtransfereruniqueid']]['transferexten']=_0x1289a7[_0x98f5('0x4c')];agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x40')]=_0x1289a7[_0x98f5('0x45')];}if(_0x1289a7[_0x98f5('0x4d')]&&agents[_0x1289a7['transfertargetuniqueid']]){agents[_0x1289a7[_0x98f5('0x4d')]]['agententerreason']=0x1;transfers[_0x1289a7['transfertargetuniqueid']]=_['clone'](agents[_0x1289a7[_0x98f5('0x4d')]]);transfers[_0x1289a7['transfertargetuniqueid']][_0x98f5('0x9')]=agents[_0x1289a7[_0x98f5('0x43')]][_0x98f5('0x9')];transfers[_0x1289a7['transfertargetuniqueid']]['calleridname']=agents[_0x1289a7['origtransfereruniqueid']][_0x98f5('0x4a')];transfers[_0x1289a7[_0x98f5('0x4d')]]['agentcalledAt']=utils['now']();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x2e')]=utils[_0x98f5('0x18')]();transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x23')]=0x0;transfers[_0x1289a7[_0x98f5('0x4d')]][_0x98f5('0x4b')]=0x2;}}}catch(_0x1cc6e3){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x42'),_0x1289a7[_0x98f5('0x43')]),_0x1cc6e3);}};exports[_0x98f5('0x4e')]=function(_0xb64efb){try{utils['debug'](util[_0x98f5('0x1c')](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0xb64efb);if(agents[_0xb64efb['uniqueid']]&&agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]==='timeout'){if(_0xb64efb[_0x98f5('0x50')]==='21'){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]='rejected';agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x51');}utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb['uniqueid']][_0x98f5('0x22')],agents[_0xb64efb['uniqueid']][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);var _0x3bb728=unanswered[_0x98f5('0x53')](_0xb64efb['uniqueid']);if(_0x3bb728>-0x1){unanswered[_0x98f5('0x54')](_0x3bb728,0x1);}}if(transfers[_0xb64efb[_0x98f5('0x5')]]){transfers[_0xb64efb['uniqueid']][_0x98f5('0xf')]=!![];transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')]=utils[_0x98f5('0x18')]();transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x25')]=utils['diffTime'](transfers[_0xb64efb['uniqueid']][_0x98f5('0x36')],transfers[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')]=_0x98f5('0x55');transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]=_0x98f5('0x37');utils[_0x98f5('0x3')](util[_0x98f5('0x1c')](_0x98f5('0x52'),_0xb64efb[_0x98f5('0x5')],transfers[_0xb64efb[_0x98f5('0x5')]]['membername'],transfers[_0xb64efb['uniqueid']][_0x98f5('0x22')],transfers[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(transfers[_0xb64efb['uniqueid']],!![]);}if(agents[_0xb64efb[_0x98f5('0x5')]]&&agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']){agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0xf')]=!![];agents[_0xb64efb['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0xb64efb['uniqueid']][_0x98f5('0x25')]=utils[_0x98f5('0x35')](agents[_0xb64efb['uniqueid']][_0x98f5('0x36')],agents[_0xb64efb[_0x98f5('0x5')]]['agentconnectAt']);agents[_0xb64efb[_0x98f5('0x5')]]['reason']=agents[_0xb64efb['uniqueid']][_0x98f5('0x3b')]?_0x98f5('0x3b'):_0x98f5('0x55');agents[_0xb64efb[_0x98f5('0x5')]]['lastevent']=_0x98f5('0x37');utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xb64efb[_0x98f5('0x5')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x1d')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x22')],agents[_0xb64efb[_0x98f5('0x5')]][_0x98f5('0x19')]));writeDB(agents[_0xb64efb[_0x98f5('0x5')]]);}}catch(_0x1a3a76){utils[_0x98f5('0x1e')](util['format'](_0x98f5('0x4f'),_0xb64efb[_0x98f5('0x5')]),_0x1a3a76);}}; \ No newline at end of file +var _0x4ded=['agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','diffTime'];(function(_0xe12e1,_0x5fbaf4){var _0x4c8883=function(_0x372185){while(--_0x372185){_0xe12e1['push'](_0xe12e1['shift']());}};_0x4c8883(++_0x5fbaf4);}(_0x4ded,0x116));var _0xd4de=function(_0x215520,_0x469685){_0x215520=_0x215520-0x0;var _0x3cd0ff=_0x4ded[_0x215520];return _0x3cd0ff;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var utils=require(_0xd4de('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1fa334,_0x2349f5){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x5'),_0x1fa334[_0xd4de('0x6')],_0x1fa334[_0xd4de('0x7')],_0x1fa334[_0xd4de('0x8')],_0x1fa334[_0xd4de('0x9')],_0x1fa334['interface'],_0x1fa334[_0xd4de('0xa')],_0x1fa334[_0xd4de('0xb')],_0x1fa334[_0xd4de('0xc')]));if(_0x1fa334[_0xd4de('0x8')]){utils[_0xd4de('0xd')](_0x1fa334[_0xd4de('0x8')])['then'](function(_0xb7e8cf){if(_0xb7e8cf){_0x1fa334['type']=_0xb7e8cf['type'];_0x1fa334['agentacw']=_0x1fa334[_0xd4de('0xe')]?_0xb7e8cf[_0xd4de('0xf')]:![];_0x1fa334['acwtime']=_0x1fa334['agentacw']?_0xb7e8cf['acwTimeout']:0x0;}utils[_0xd4de('0x10')]('CreateVoiceAgentReport',_0x1fa334);});}else{utils[_0xd4de('0x10')](_0xd4de('0x11'),_0x1fa334);}if(_0x2349f5){delete transfers[_0x1fa334[_0xd4de('0x6')]];}else{delete agents[_0x1fa334[_0xd4de('0x12')]];}}exports[_0xd4de('0x13')]=function(_0x3af6e0){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x15'),_0x3af6e0[_0xd4de('0x6')]),_0x3af6e0);agents[_0x3af6e0[_0xd4de('0x12')]]=_0x3af6e0;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x16')]=utils[_0xd4de('0x17')]();agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x18');agents[_0x3af6e0['destuniqueid']]['connectedlinenum']=null;agents[_0x3af6e0[_0xd4de('0x12')]][_0xd4de('0x19')]=null;utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x3af6e0['uniqueid'],agents[_0x3af6e0[_0xd4de('0x12')]]['membername'],_0x3af6e0[_0xd4de('0x12')]));}catch(_0x29c028){utils['error'](util[_0xd4de('0x4')]('[%s][agents][agentcalled]',_0x3af6e0[_0xd4de('0x6')]),_0x29c028);}};exports[_0xd4de('0x1a')]=function(_0x2bad14){try{if(!_[_0xd4de('0x1b')](agents[_0x2bad14['destuniqueid']])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x2bad14);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x1d'),_0x2bad14[_0xd4de('0x6')],agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x9')],_0x2bad14['destuniqueid']));agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1a')]=!![];agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x1e')]=utils[_0xd4de('0x17')]();agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]][_0xd4de('0x20')]=_0xd4de('0x1f');agents[_0x2bad14[_0xd4de('0x12')]]['holdtime']=_0x2bad14[_0xd4de('0x21')]?parseInt(_0x2bad14[_0xd4de('0x21')])/0x3e8:0x0;agents[_0x2bad14['destuniqueid']][_0xd4de('0x22')]=0x0;unanswered['push'](_0x2bad14[_0xd4de('0x12')]);}}catch(_0x32e407){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x1c'),_0x2bad14[_0xd4de('0x6')]),_0x32e407);}};exports[_0xd4de('0x24')]=function(_0x50cb73){try{_[_0xd4de('0x25')](agents,function(_0x1804c7,_0x55f9f9){if(_0x1804c7['uniqueid']==_0x50cb73['uniqueid']&&!_[_0xd4de('0x26')](unanswered,_0x1804c7['destuniqueid'])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x50cb73);utils['info'](util[_0xd4de('0x4')](_0xd4de('0x28'),_0x50cb73['uniqueid'],_0x1804c7[_0xd4de('0x9')],_0x1804c7[_0xd4de('0x12')]));_0x1804c7['agentringnoanswer']=!![];_0x1804c7['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x1804c7[_0xd4de('0xc')]=_0xd4de('0x29');_0x1804c7[_0xd4de('0x20')]='abandoned';_0x1804c7[_0xd4de('0x2a')]=_0x50cb73[_0xd4de('0x2a')];_0x1804c7['talktime']=0x0;writeDB(_0x1804c7);}});}catch(_0x329d49){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x27'),_0x50cb73[_0xd4de('0x6')]),_0x329d49);}};exports[_0xd4de('0x2b')]=function(_0x53441c){try{if(agents[_0x53441c['destuniqueid']]){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c['uniqueid']),_0x53441c);utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53441c[_0xd4de('0x6')],agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x9')],_0x53441c[_0xd4de('0x12')]));agents[_0x53441c['destuniqueid']]['agentconnectAt']=utils[_0xd4de('0x17')]();agents[_0x53441c['destuniqueid']][_0xd4de('0xb')]=_0x53441c['connectedlinenum'];agents[_0x53441c[_0xd4de('0x12')]][_0xd4de('0x19')]=_0x53441c[_0xd4de('0x19')];agents[_0x53441c[_0xd4de('0x12')]]['holdtime']=_0x53441c[_0xd4de('0x21')];agents[_0x53441c['destuniqueid']][_0xd4de('0xc')]=_0xd4de('0x2d');_[_0xd4de('0x25')](agents,function(_0x4517a6,_0x349c5f){if(_0x4517a6[_0xd4de('0x12')]!=_0x53441c[_0xd4de('0x12')]&&_0x4517a6['uniqueid']==_0x53441c[_0xd4de('0x6')]){_0x4517a6[_0xd4de('0x22')]=0x0;_0x4517a6[_0xd4de('0x2a')]=_0x53441c[_0xd4de('0x21')];_0x4517a6[_0xd4de('0x1a')]=!![];_0x4517a6['agentringnoanswerAt']=utils[_0xd4de('0x17')]();_0x4517a6[_0xd4de('0xc')]=_0xd4de('0x2e');_0x4517a6['reason']=_0xd4de('0x2e');_0x4517a6[_0xd4de('0x2f')]=_0x53441c[_0xd4de('0x12')];_0x4517a6['answeredelsewheremembername']=_0x53441c[_0xd4de('0x9')];writeDB(_0x4517a6);}});}}catch(_0x10a42c){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x2c'),_0x53441c[_0xd4de('0x6')]),_0x10a42c);}};exports[_0xd4de('0xe')]=function(_0x5ecbbd){try{if(!_[_0xd4de('0x1b')](agents[_0x5ecbbd[_0xd4de('0x12')]])){utils[_0xd4de('0x14')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0x5ecbbd);utils[_0xd4de('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5ecbbd[_0xd4de('0x6')],agents[_0x5ecbbd[_0xd4de('0x12')]]['membername'],_0x5ecbbd[_0xd4de('0x12')]));agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xe')]=!![];agents[_0x5ecbbd[_0xd4de('0x12')]]['agentcompleteAt']=utils[_0xd4de('0x17')]();agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x32')],agents[_0x5ecbbd['destuniqueid']][_0xd4de('0x33')]);agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0x20')]=_0x5ecbbd[_0xd4de('0x20')];agents[_0x5ecbbd[_0xd4de('0x12')]][_0xd4de('0xc')]=_0xd4de('0x34');writeDB(agents[_0x5ecbbd[_0xd4de('0x12')]]);}}catch(_0xaf442c){utils[_0xd4de('0x23')](util['format'](_0xd4de('0x30'),_0x5ecbbd[_0xd4de('0x6')]),_0xaf442c);}};exports[_0xd4de('0x35')]=function(_0x518bfe){try{if(!_[_0xd4de('0x1b')](agents[_0x518bfe[_0xd4de('0x36')]])){utils[_0xd4de('0x14')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x518bfe);utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x38'),_0x518bfe[_0xd4de('0x6')],agents[_0x518bfe['transfereruniqueid']][_0xd4de('0x9')],agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')]));agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x39')]=!![];agents[_0x518bfe['transfereruniqueid']]['transfertype']=_0xd4de('0x3a');agents[_0x518bfe[_0xd4de('0x36')]]['transferexten']=_0x518bfe['extension'];agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x3b')]=agents[_0x518bfe[_0xd4de('0x36')]][_0xd4de('0x6')];}}catch(_0x34d772){utils[_0xd4de('0x23')](util[_0xd4de('0x4')](_0xd4de('0x37'),_0x518bfe[_0xd4de('0x6')]),_0x34d772);}};exports[_0xd4de('0x3c')]=function(_0x3be8c2){try{utils[_0xd4de('0x14')](util['format'](_0xd4de('0x3d'),_0x3be8c2[_0xd4de('0x3e')]),_0x3be8c2);if(_0x3be8c2[_0xd4de('0x3e')]==_0x3be8c2[_0xd4de('0x3f')]){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x40')]])){utils['info'](util[_0xd4de('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3be8c2['origtransfereruniqueid'],agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x9')]));agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x39')]=!![];agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2[_0xd4de('0x40')]][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x44')];agents[_0x3be8c2['secondtransfereruniqueid']]['transferuniqueid']=_0x3be8c2['origtransfereruniqueid'];}if(_0x3be8c2[_0xd4de('0x45')]&&agents[_0x3be8c2[_0xd4de('0x45')]]){agents[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2['transfereeuniqueid']]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x45')]]);transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0xa')]=agents[_0x3be8c2['secondtransfereruniqueid']][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x40')]]['calleridname'];transfers[_0x3be8c2['transfereeuniqueid']]['agentcalledAt']=utils[_0xd4de('0x17')]();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x33')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x45')]][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x45')]]['agententerreason']=0x2;}}else if(_0x3be8c2[_0xd4de('0x40')]==_0x3be8c2['secondtransfererlinkedid']){if(!_[_0xd4de('0x1b')](agents[_0x3be8c2[_0xd4de('0x3e')]])){utils[_0xd4de('0x3')](util[_0xd4de('0x4')](_0xd4de('0x49'),_0x3be8c2[_0xd4de('0x3e')],agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x9')]));agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x39')]=!![];agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x41')]=_0xd4de('0x42');agents[_0x3be8c2['origtransfereruniqueid']][_0xd4de('0x43')]=_0x3be8c2[_0xd4de('0x4a')];agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x3b')]=_0x3be8c2[_0xd4de('0x40')];}if(_0x3be8c2[_0xd4de('0x4b')]&&agents[_0x3be8c2[_0xd4de('0x4b')]]){agents[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x46')]=0x1;transfers[_0x3be8c2[_0xd4de('0x4b')]]=_[_0xd4de('0x47')](agents[_0x3be8c2[_0xd4de('0x4b')]]);transfers[_0x3be8c2[_0xd4de('0x4b')]]['calleridnum']=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0xa')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x48')]=agents[_0x3be8c2[_0xd4de('0x3e')]][_0xd4de('0x48')];transfers[_0x3be8c2[_0xd4de('0x4b')]][_0xd4de('0x16')]=utils['now']();transfers[_0x3be8c2[_0xd4de('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x3be8c2['transfertargetuniqueid']][_0xd4de('0x2a')]=0x0;transfers[_0x3be8c2[_0xd4de('0x4b')]]['agententerreason']=0x2;}}}catch(_0x4a06b2){utils['error'](util['format'](_0xd4de('0x3d'),_0x3be8c2['origtransfereruniqueid']),_0x4a06b2);}};exports[_0xd4de('0x4c')]=function(_0x5ddba5){try{utils[_0xd4de('0x14')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5['uniqueid']),_0x5ddba5);if(agents[_0x5ddba5['uniqueid']]&&agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')]===_0xd4de('0x1f')){if(_0x5ddba5[_0xd4de('0x4d')]==='21'){agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=_0xd4de('0x4e');agents[_0x5ddba5['uniqueid']]['lastevent']='rejected';}utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x9')],agents[_0x5ddba5['uniqueid']][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]]['lastevent']));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);var _0x5a4882=unanswered[_0xd4de('0x4f')](_0x5ddba5[_0xd4de('0x6')]);if(_0x5a4882>-0x1){unanswered[_0xd4de('0x50')](_0x5a4882,0x1);}}if(transfers[_0x5ddba5[_0xd4de('0x6')]]){transfers[_0x5ddba5['uniqueid']][_0xd4de('0xe')]=!![];transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')]=utils[_0xd4de('0x17')]();transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x22')]=utils[_0xd4de('0x31')](transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]='agent';transfers[_0x5ddba5[_0xd4de('0x6')]]['lastevent']='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],transfers[_0x5ddba5[_0xd4de('0x6')]]['reason'],transfers[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(transfers[_0x5ddba5[_0xd4de('0x6')]],!![]);}if(agents[_0x5ddba5[_0xd4de('0x6')]]&&agents[_0x5ddba5[_0xd4de('0x6')]]['agentconnectAt']){agents[_0x5ddba5['uniqueid']]['agentcomplete']=!![];agents[_0x5ddba5['uniqueid']][_0xd4de('0x32')]=utils['now']();agents[_0x5ddba5[_0xd4de('0x6')]]['talktime']=utils[_0xd4de('0x31')](agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x32')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x33')]);agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')]=agents[_0x5ddba5[_0xd4de('0x6')]]['transfer']?_0xd4de('0x39'):_0xd4de('0x51');agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]='complete';utils[_0xd4de('0x3')](util[_0xd4de('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5ddba5[_0xd4de('0x6')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x9')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0x20')],agents[_0x5ddba5[_0xd4de('0x6')]][_0xd4de('0xc')]));writeDB(agents[_0x5ddba5[_0xd4de('0x6')]]);}}catch(_0x27fd09){utils[_0xd4de('0x23')](util[_0xd4de('0x4')]('[%s][agents][hangup]',_0x5ddba5[_0xd4de('0x6')]),_0x27fd09);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index cbee629..7b89691 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 _0x2c8f=['then','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','error','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','variable','value','source','xmd-phone','[%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','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','set','appdata','cdr','split','substring','lastIndexOf','toLowerCase','util','FAILED','NO\x20ANSWER','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','calleridnum','lastevent','accountcode','getUserByInternal'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x2c8f,0x192));var _0xf2c8=function(_0x252587,_0x34b7e0){_0x252587=_0x252587-0x0;var _0x5abc29=_0x2c8f[_0x252587];return _0x5abc29;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0xf2c8('0x1'),_0xf2c8('0x1'),_0xf2c8('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0xf2c8('0x3'),_0xf2c8('0x4'),_0xf2c8('0x1'),_0xf2c8('0x1'),_0xf2c8('0x1')];var channels={};function writeDB(_0x4eae22){var _0x475616;if(transfers[_0xf2c8('0x5')][_0x4eae22[_0xf2c8('0x6')]]){_0x475616=_0x4eae22[_0xf2c8('0x6')];_0x4eae22[_0xf2c8('0x6')]=transfers[_0xf2c8('0x5')][_0x4eae22['uniqueid']][_0xf2c8('0x7')];}utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0xa'),_0x4eae22[_0xf2c8('0x6')],_0x4eae22[_0xf2c8('0xb')],_0x4eae22[_0xf2c8('0xc')],_0x4eae22[_0xf2c8('0xd')],_0x4eae22['interface'],_0x4eae22[_0xf2c8('0xe')],_0x4eae22['connectedlinenum'],_0x4eae22[_0xf2c8('0xf')]));if(_0x4eae22[_0xf2c8('0x10')]){utils[_0xf2c8('0x11')](_0x4eae22[_0xf2c8('0x10')])[_0xf2c8('0x12')](function(_0x40849c){if(_0x40849c){_0x4eae22['UserId']=_0x40849c['id'];}utils[_0xf2c8('0x13')](_0xf2c8('0x14'),_0x4eae22);});}else{utils[_0xf2c8('0x13')](_0xf2c8('0x14'),_0x4eae22);}if(channels[_0x4eae22[_0xf2c8('0x6')]]){delete channels[_0x4eae22[_0xf2c8('0x6')]];}else if(_0x475616&&channels[_0x475616]){if(!transfers[_0xf2c8('0x5')][_0x475616]['recording'])delete transfers[_0xf2c8('0x5')][_0x475616];delete channels[_0x475616];}}exports[_0xf2c8('0x15')]=function(_0x19a6b2){try{utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')]('[%s][calls][newchannel]',_0x19a6b2['uniqueid']),_0x19a6b2);if(_0x19a6b2[_0xf2c8('0x6')]==_0x19a6b2[_0xf2c8('0x17')]&&_0x19a6b2[_0xf2c8('0xb')]!=_0xf2c8('0x18')){utils['info'](util[_0xf2c8('0x9')](_0xf2c8('0x19'),_0x19a6b2[_0xf2c8('0x6')],_0x19a6b2['context'],_0x19a6b2[_0xf2c8('0x1a')]));channels[_0x19a6b2[_0xf2c8('0x6')]]={'uniqueid':_0x19a6b2['uniqueid'],'accountcode':_0x19a6b2['accountcode'],'source':_0x19a6b2[_0xf2c8('0xe')],'destination':_0x19a6b2[_0xf2c8('0x1a')],'destinationcontext':_0x19a6b2[_0xf2c8('0x1b')],'channel':_0x19a6b2['channel'],'starttime':utils[_0xf2c8('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf2c8('0x2'),'amaflags':_0xf2c8('0x1d')};}}catch(_0x239350){utils['error'](util[_0xf2c8('0x9')](_0xf2c8('0x1e'),_0x19a6b2[_0xf2c8('0x6')]),_0x239350);}};exports[_0xf2c8('0x1f')]=function(_0x16938e){try{utils['debug'](util[_0xf2c8('0x9')]('[%s][calls][newstate]',_0x16938e[_0xf2c8('0x6')]),_0x16938e);if(!_[_0xf2c8('0x20')](channels[_0x16938e[_0xf2c8('0x6')]])&&_0x16938e[_0xf2c8('0x21')]==0x6){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x22'),_0x16938e[_0xf2c8('0x6')],_0x16938e[_0xf2c8('0x1b')],_0x16938e[_0xf2c8('0xb')]));if(_[_0xf2c8('0x20')](channels[_0x16938e[_0xf2c8('0x6')]][_0xf2c8('0x23')])){channels[_0x16938e['uniqueid']][_0xf2c8('0x23')]=utils['now']();}}else if(!_['isNil'](channels[_0x16938e[_0xf2c8('0x17')]])&&_0x16938e['channelstate']==0x6&&_0x16938e[_0xf2c8('0x1b')]!=_0xf2c8('0x24')){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x25'),_0x16938e[_0xf2c8('0x6')],_0x16938e[_0xf2c8('0x17')],_0x16938e['context'],_0x16938e[_0xf2c8('0xb')]));channels[_0x16938e[_0xf2c8('0x17')]][_0xf2c8('0x10')]=_0x16938e[_0xf2c8('0x10')];channels[_0x16938e[_0xf2c8('0x17')]][_0xf2c8('0x26')]=_0x16938e['channel'];if(_[_0xf2c8('0x20')](channels[_0x16938e['linkedid']][_0xf2c8('0x27')])){channels[_0x16938e['linkedid']][_0xf2c8('0x27')]=utils[_0xf2c8('0x1c')]();}channels[_0x16938e[_0xf2c8('0x17')]][_0xf2c8('0x28')]=dispositions[_[_0xf2c8('0x29')](_0x16938e['channelstate'])]||_0xf2c8('0x3');}}catch(_0x1927bd){utils['error'](util[_0xf2c8('0x9')](_0xf2c8('0x2a'),_0x16938e['uniqueid']),_0x1927bd);}};exports[_0xf2c8('0x2b')]=function(_0x20012e){try{if(!_[_0xf2c8('0x20')](channels[_0x20012e[_0xf2c8('0x6')]])){utils[_0xf2c8('0x16')](util['format']('[%s][calls][hangup]',_0x20012e[_0xf2c8('0x6')]),_0x20012e);if(_[_0xf2c8('0x20')](channels[_0x20012e[_0xf2c8('0x6')]][_0xf2c8('0x2c')])){channels[_0x20012e[_0xf2c8('0x6')]][_0xf2c8('0x2c')]=_0x20012e[_0xf2c8('0x2d')]+'\x20<'+_0x20012e[_0xf2c8('0xe')]+'>';}utils['info'](util[_0xf2c8('0x9')](_0xf2c8('0x2e'),_0x20012e[_0xf2c8('0x6')],channels[_0x20012e['uniqueid']]['callerid'],_0x20012e['cause-txt']));channels[_0x20012e['uniqueid']][_0xf2c8('0x2f')]=utils['now']();channels[_0x20012e[_0xf2c8('0x6')]]['duration']=utils[_0xf2c8('0x30')](channels[_0x20012e['uniqueid']]['endtime'],channels[_0x20012e[_0xf2c8('0x6')]][_0xf2c8('0x31')]);channels[_0x20012e['uniqueid']][_0xf2c8('0x32')]=channels[_0x20012e[_0xf2c8('0x6')]]['answertime']?utils[_0xf2c8('0x30')](channels[_0x20012e[_0xf2c8('0x6')]][_0xf2c8('0x2f')],channels[_0x20012e[_0xf2c8('0x6')]][_0xf2c8('0x27')]):0x0;writeDB(channels[_0x20012e[_0xf2c8('0x6')]]);}}catch(_0x4e1575){utils['error'](util[_0xf2c8('0x9')]('[%s][calls][hangup]',_0x20012e[_0xf2c8('0x6')]),_0x4e1575);}};exports['attendedtransfer']=function(_0x81e648){try{if(!_['isNil'](channels[_0x81e648[_0xf2c8('0x33')]])){utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')](_0xf2c8('0x34'),_0x81e648['origtransfereruniqueid']),_0x81e648);if(channels[_0x81e648[_0xf2c8('0x33')]][_0xf2c8('0xb')]==_0x81e648['transfereechannel']){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x35'),_0x81e648[_0xf2c8('0x36')],_0x81e648[_0xf2c8('0x33')],_0x81e648[_0xf2c8('0x37')]));channels[_0x81e648[_0xf2c8('0x33')]]['destinationchannel']=_0x81e648[_0xf2c8('0x37')];channels[_0x81e648[_0xf2c8('0x33')]][_0xf2c8('0x38')]=_0xf2c8('0x39');}else if(channels[_0x81e648['localtwolinkedid']]['channel']=_0x81e648[_0xf2c8('0x3a')]){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x81e648[_0xf2c8('0x36')],_0x81e648[_0xf2c8('0x33')],_0x81e648['origtransfererchannel']));channels[_0x81e648['localtwolinkedid']][_0xf2c8('0x26')]=_0x81e648[_0xf2c8('0x3b')];channels[_0x81e648[_0xf2c8('0x33')]][_0xf2c8('0x38')]='_attended';}}}catch(_0x16f713){utils[_0xf2c8('0x3c')](util[_0xf2c8('0x9')]('[%s][calls][attendedtransfer]',_0x81e648[_0xf2c8('0x36')]),_0x16f713);}};exports[_0xf2c8('0x3d')]=function(_0x15fa55){try{if(!_['isNil'](channels[_0x15fa55[_0xf2c8('0x6')]])){utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')](_0xf2c8('0x3e'),_0x15fa55[_0xf2c8('0x6')]),_0x15fa55);channels[_0x15fa55['uniqueid']][_0xf2c8('0x3f')]=utils['now']();utils['info'](util[_0xf2c8('0x9')](_0xf2c8('0x40'),_0x15fa55[_0xf2c8('0x6')],channels[_0x15fa55[_0xf2c8('0x6')]][_0xf2c8('0x3f')]));}}catch(_0x47fec0){utils[_0xf2c8('0x3c')](util[_0xf2c8('0x9')](_0xf2c8('0x3e'),_0x15fa55[_0xf2c8('0x6')]),_0x47fec0);}};exports[_0xf2c8('0x41')]=function(_0x35a20b){try{if(!_['isNil'](channels[_0x35a20b['uniqueid']])){utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')](_0xf2c8('0x42'),_0x35a20b[_0xf2c8('0x6')]),_0x35a20b);if(!_[_0xf2c8('0x20')](channels[_0x35a20b[_0xf2c8('0x6')]][_0xf2c8('0x3f')])){channels[_0x35a20b[_0xf2c8('0x6')]]['mohtime']+=utils[_0xf2c8('0x30')](utils[_0xf2c8('0x1c')](),channels[_0x35a20b['uniqueid']]['musiconholdstartAt']);utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x35a20b[_0xf2c8('0x6')],channels[_0x35a20b[_0xf2c8('0x6')]][_0xf2c8('0x43')]));delete channels[_0x35a20b['uniqueid']][_0xf2c8('0x3f')];}}}catch(_0x34cfc4){utils[_0xf2c8('0x3c')](util[_0xf2c8('0x9')](_0xf2c8('0x42'),_0x35a20b[_0xf2c8('0x6')]),_0x34cfc4);}};exports[_0xf2c8('0x44')]=function(_0x1b74e2){try{if(!_['isNil'](channels[_0x1b74e2[_0xf2c8('0x6')]])){utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')]('[%s][calls][varset]',_0x1b74e2['uniqueid']),_0x1b74e2);if(!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')]['xmd-originatecalleridnum'])){utils[_0xf2c8('0x8')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1b74e2[_0xf2c8('0x6')],_0x1b74e2[_0xf2c8('0x46')]));channels[_0x1b74e2['uniqueid']][_0xf2c8('0x47')]=_0x1b74e2[_0xf2c8('0x46')];}if(!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')][_0xf2c8('0x48')])){utils['info'](util[_0xf2c8('0x9')](_0xf2c8('0x49'),_0x1b74e2['uniqueid'],_0x1b74e2[_0xf2c8('0x46')]));channels[_0x1b74e2['uniqueid']][_0xf2c8('0x4a')]=_0x1b74e2[_0xf2c8('0x46')];channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x2c')]='\x22'+_0x1b74e2[_0xf2c8('0x46')]+_0xf2c8('0x4b')+_0x1b74e2['value']+'>';}if(!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')][_0xf2c8('0x4c')])||!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')]['xmd-callerid'])){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x4d'),_0x1b74e2[_0xf2c8('0x6')],!_['isNil'](_0x1b74e2[_0xf2c8('0x45')][_0xf2c8('0x4c')])?_0xf2c8('0x4c'):_0xf2c8('0x4e'),_0x1b74e2[_0xf2c8('0x46')]));channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x2c')]=_0x1b74e2[_0xf2c8('0x46')];}if(!_[_0xf2c8('0x20')](_0x1b74e2['variable'][_0xf2c8('0x4f')])||!_[_0xf2c8('0x20')](_0x1b74e2['variable'][_0xf2c8('0x50')])){utils[_0xf2c8('0x8')](util['format'](_0xf2c8('0x4d'),_0x1b74e2[_0xf2c8('0x6')],!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')]['xmd-queue'])?'xmd-queue':_0xf2c8('0x50'),_0x1b74e2['value']));channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x51')]=_0xf2c8('0x52');channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x53')]=_0x1b74e2[_0xf2c8('0x46')];channels[_0x1b74e2['uniqueid']][_0xf2c8('0xc')]=!![];}if(!_[_0xf2c8('0x20')](_0x1b74e2['variable'][_0xf2c8('0x54')])){utils[_0xf2c8('0x8')](util['format'](_0xf2c8('0x55'),_0x1b74e2['uniqueid'],_0x1b74e2[_0xf2c8('0x46')]));channels[_0x1b74e2[_0xf2c8('0x6')]]['ContactId']=_0x1b74e2['value'];}if(!_['isNil'](_0x1b74e2[_0xf2c8('0x45')][_0xf2c8('0x56')])){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x57'),_0x1b74e2[_0xf2c8('0x6')],_0x1b74e2['value']));channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x58')]=_0x1b74e2[_0xf2c8('0x46')];}if(!_[_0xf2c8('0x20')](_0x1b74e2['variable']['outboundrouteid'])){utils[_0xf2c8('0x8')](util[_0xf2c8('0x9')](_0xf2c8('0x59'),_0x1b74e2[_0xf2c8('0x6')],_0x1b74e2['value']));channels[_0x1b74e2['uniqueid']][_0xf2c8('0x5a')]=_0x1b74e2[_0xf2c8('0x46')];}if(!_[_0xf2c8('0x20')](_0x1b74e2[_0xf2c8('0x45')]['sipcallid'])){utils['info'](util[_0xf2c8('0x9')](_0xf2c8('0x5b'),_0x1b74e2[_0xf2c8('0x6')],_0x1b74e2[_0xf2c8('0x46')]));channels[_0x1b74e2[_0xf2c8('0x6')]][_0xf2c8('0x5c')]=_0x1b74e2['value'];}}}catch(_0x35c799){utils[_0xf2c8('0x3c')](util['format'](_0xf2c8('0x5d'),_0x1b74e2['uniqueid']),_0x35c799);}};exports[_0xf2c8('0x5e')]=function(_0x57e37e){try{if(!_[_0xf2c8('0x20')](channels[_0x57e37e[_0xf2c8('0x6')]])){utils[_0xf2c8('0x16')](util[_0xf2c8('0x9')](_0xf2c8('0x5f'),_0x57e37e['uniqueid']),_0x57e37e);utils['info'](util['format'](_0xf2c8('0x60'),_0x57e37e[_0xf2c8('0x6')],_0x57e37e[_0xf2c8('0x61')],_0x57e37e['appdata']));if(_0x57e37e[_0xf2c8('0x61')]['toLowerCase']()==_0xf2c8('0x62')&&_['startsWith'](_0x57e37e[_0xf2c8('0x63')]['toLowerCase'](),_0xf2c8('0x64'))){var _0x3362e5=_0x57e37e[_0xf2c8('0x63')][_0xf2c8('0x65')]('=');var _0x176501=_0x3362e5[0x0][_0xf2c8('0x66')](_0x3362e5[0x0][_0xf2c8('0x67')]('(')+0x1,_0x3362e5[0x0][_0xf2c8('0x67')](')'));var _0x5d6782=_0x3362e5[0x1];channels[_0x57e37e[_0xf2c8('0x6')]][_0x176501]=_0x5d6782;}if(!_['includes']([_0xf2c8('0x2b'),'noop','execif','set','gotoif'],_0x57e37e[_0xf2c8('0x61')][_0xf2c8('0x68')]())){channels[_0x57e37e[_0xf2c8('0x6')]][_0xf2c8('0x51')]=_0x57e37e['application'];channels[_0x57e37e[_0xf2c8('0x6')]][_0xf2c8('0x53')]=_0x57e37e[_0xf2c8('0x63')];}}}catch(_0x118aa6){utils['error'](util[_0xf2c8('0x9')](_0xf2c8('0x5f'),_0x57e37e['uniqueid']),_0x118aa6);}}; \ No newline at end of file +var _0xf90c=['queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','DOCUMENTATION','newstate','isNil','channelstate','systemanswertime','now','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','destinationchannel','error','origtransfereruniqueid','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lastapplication','lodash','util','./utils','./transfers.controller','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'];(function(_0xf80ac2,_0x2e4049){var _0x3868f2=function(_0x3ecd81){while(--_0x3ecd81){_0xf80ac2['push'](_0xf80ac2['shift']());}};_0x3868f2(++_0x2e4049);}(_0xf90c,0x1a9));var _0xcf90=function(_0x41407b,_0x350f69){_0x41407b=_0x41407b-0x0;var _0x103708=_0xf90c[_0x41407b];return _0x103708;};'use strict';var _=require(_0xcf90('0x0'));var util=require(_0xcf90('0x1'));var utils=require(_0xcf90('0x2'));var transfers=require(_0xcf90('0x3'));var dispositions=[_0xcf90('0x4'),_0xcf90('0x5'),_0xcf90('0x5'),_0xcf90('0x4'),_0xcf90('0x4'),_0xcf90('0x4'),_0xcf90('0x6'),_0xcf90('0x7'),_0xcf90('0x5'),'FAILED',_0xcf90('0x5')];var channels={};function writeDB(_0x5e88de){var _0x243972;if(transfers[_0xcf90('0x8')][_0x5e88de[_0xcf90('0x9')]]){_0x243972=_0x5e88de['uniqueid'];_0x5e88de[_0xcf90('0x9')]=transfers[_0xcf90('0x8')][_0x5e88de[_0xcf90('0x9')]][_0xcf90('0xa')];}utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0xd'),_0x5e88de[_0xcf90('0x9')],_0x5e88de[_0xcf90('0xe')],_0x5e88de[_0xcf90('0xf')],_0x5e88de['membername'],_0x5e88de[_0xcf90('0x10')],_0x5e88de[_0xcf90('0x11')],_0x5e88de[_0xcf90('0x12')],_0x5e88de[_0xcf90('0x13')]));if(_0x5e88de[_0xcf90('0x14')]){utils[_0xcf90('0x15')](_0x5e88de[_0xcf90('0x14')])[_0xcf90('0x16')](function(_0x590ab8){if(_0x590ab8){_0x5e88de[_0xcf90('0x17')]=_0x590ab8['id'];}utils[_0xcf90('0x18')]('CreateVoiceCallReport',_0x5e88de);});}else{utils[_0xcf90('0x18')](_0xcf90('0x19'),_0x5e88de);}if(channels[_0x5e88de[_0xcf90('0x9')]]){delete channels[_0x5e88de[_0xcf90('0x9')]];}else if(_0x243972&&channels[_0x243972]){if(!transfers[_0xcf90('0x8')][_0x243972][_0xcf90('0x1a')])delete transfers[_0xcf90('0x8')][_0x243972];delete channels[_0x243972];}}exports['newchannel']=function(_0x1ec8d2){try{utils[_0xcf90('0x1b')](util['format'](_0xcf90('0x1c'),_0x1ec8d2[_0xcf90('0x9')]),_0x1ec8d2);if(_0x1ec8d2[_0xcf90('0x9')]==_0x1ec8d2['linkedid']&&_0x1ec8d2[_0xcf90('0xe')]!=_0xcf90('0x1d')){utils[_0xcf90('0xb')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1ec8d2[_0xcf90('0x9')],_0x1ec8d2[_0xcf90('0x1e')],_0x1ec8d2['exten']));channels[_0x1ec8d2['uniqueid']]={'uniqueid':_0x1ec8d2[_0xcf90('0x9')],'accountcode':_0x1ec8d2['accountcode'],'source':_0x1ec8d2[_0xcf90('0x11')],'destination':_0x1ec8d2[_0xcf90('0x1f')],'destinationcontext':_0x1ec8d2['context'],'channel':_0x1ec8d2['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xcf90('0x20')};}}catch(_0x60646a){utils['error'](util[_0xcf90('0xc')](_0xcf90('0x1c'),_0x1ec8d2[_0xcf90('0x9')]),_0x60646a);}};exports[_0xcf90('0x21')]=function(_0x4f7624){try{utils[_0xcf90('0x1b')](util[_0xcf90('0xc')]('[%s][calls][newstate]',_0x4f7624[_0xcf90('0x9')]),_0x4f7624);if(!_[_0xcf90('0x22')](channels[_0x4f7624['uniqueid']])&&_0x4f7624[_0xcf90('0x23')]==0x6){utils[_0xcf90('0xb')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x4f7624['uniqueid'],_0x4f7624['context'],_0x4f7624[_0xcf90('0xe')]));if(_[_0xcf90('0x22')](channels[_0x4f7624[_0xcf90('0x9')]][_0xcf90('0x24')])){channels[_0x4f7624[_0xcf90('0x9')]][_0xcf90('0x24')]=utils[_0xcf90('0x25')]();}}else if(!_[_0xcf90('0x22')](channels[_0x4f7624[_0xcf90('0x26')]])&&_0x4f7624[_0xcf90('0x23')]==0x6&&_0x4f7624[_0xcf90('0x1e')]!='transfer'){utils['info'](util['format'](_0xcf90('0x27'),_0x4f7624[_0xcf90('0x9')],_0x4f7624['linkedid'],_0x4f7624[_0xcf90('0x1e')],_0x4f7624[_0xcf90('0xe')]));channels[_0x4f7624[_0xcf90('0x26')]][_0xcf90('0x14')]=_0x4f7624['accountcode'];channels[_0x4f7624[_0xcf90('0x26')]]['destinationchannel']=_0x4f7624[_0xcf90('0xe')];if(_[_0xcf90('0x22')](channels[_0x4f7624[_0xcf90('0x26')]]['answertime'])){channels[_0x4f7624[_0xcf90('0x26')]][_0xcf90('0x28')]=utils['now']();}channels[_0x4f7624['linkedid']][_0xcf90('0x29')]=dispositions[_[_0xcf90('0x2a')](_0x4f7624['channelstate'])]||_0xcf90('0x6');}}catch(_0x5f4c41){utils['error'](util['format'](_0xcf90('0x2b'),_0x4f7624[_0xcf90('0x9')]),_0x5f4c41);}};exports[_0xcf90('0x2c')]=function(_0x24fa08){try{if(!_[_0xcf90('0x22')](channels[_0x24fa08['uniqueid']])){utils[_0xcf90('0x1b')](util[_0xcf90('0xc')](_0xcf90('0x2d'),_0x24fa08['uniqueid']),_0x24fa08);if(_[_0xcf90('0x22')](channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x2e')])){channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x2e')]=_0x24fa08[_0xcf90('0x2f')]+'\x20<'+_0x24fa08[_0xcf90('0x11')]+'>';}utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x30'),_0x24fa08[_0xcf90('0x9')],channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x2e')],_0x24fa08[_0xcf90('0x31')]));channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x32')]=utils[_0xcf90('0x25')]();channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x33')]=utils['diffTime'](channels[_0x24fa08['uniqueid']][_0xcf90('0x32')],channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x34')]);channels[_0x24fa08['uniqueid']][_0xcf90('0x35')]=channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x28')]?utils['diffTime'](channels[_0x24fa08['uniqueid']][_0xcf90('0x32')],channels[_0x24fa08[_0xcf90('0x9')]][_0xcf90('0x28')]):0x0;writeDB(channels[_0x24fa08[_0xcf90('0x9')]]);}}catch(_0x44e3f7){utils['error'](util[_0xcf90('0xc')](_0xcf90('0x2d'),_0x24fa08[_0xcf90('0x9')]),_0x44e3f7);}};exports[_0xcf90('0x36')]=function(_0x48528c){try{if(!_[_0xcf90('0x22')](channels[_0x48528c['localtwolinkedid']])){utils[_0xcf90('0x1b')](util['format'](_0xcf90('0x37'),_0x48528c['origtransfereruniqueid']),_0x48528c);if(channels[_0x48528c[_0xcf90('0x38')]][_0xcf90('0xe')]==_0x48528c[_0xcf90('0x39')]){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x3a'),_0x48528c['origtransfereruniqueid'],_0x48528c[_0xcf90('0x38')],_0x48528c['secondtransfererchannel']));channels[_0x48528c['localtwolinkedid']]['destinationchannel']=_0x48528c[_0xcf90('0x3b')];channels[_0x48528c[_0xcf90('0x38')]]['userfield']=_0xcf90('0x3c');}else if(channels[_0x48528c['localtwolinkedid']][_0xcf90('0xe')]=_0x48528c[_0xcf90('0x3d')]){utils['info'](util[_0xcf90('0xc')](_0xcf90('0x3a'),_0x48528c['origtransfereruniqueid'],_0x48528c[_0xcf90('0x38')],_0x48528c[_0xcf90('0x3e')]));channels[_0x48528c[_0xcf90('0x38')]][_0xcf90('0x3f')]=_0x48528c[_0xcf90('0x3e')];channels[_0x48528c[_0xcf90('0x38')]]['userfield']='_attended';}}}catch(_0x787ec8){utils[_0xcf90('0x40')](util['format'](_0xcf90('0x37'),_0x48528c[_0xcf90('0x41')]),_0x787ec8);}};exports['musiconholdstart']=function(_0x3f71ec){try{if(!_[_0xcf90('0x22')](channels[_0x3f71ec[_0xcf90('0x9')]])){utils[_0xcf90('0x1b')](util[_0xcf90('0xc')](_0xcf90('0x42'),_0x3f71ec[_0xcf90('0x9')]),_0x3f71ec);channels[_0x3f71ec[_0xcf90('0x9')]][_0xcf90('0x43')]=utils['now']();utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x44'),_0x3f71ec['uniqueid'],channels[_0x3f71ec[_0xcf90('0x9')]][_0xcf90('0x43')]));}}catch(_0x5f2162){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0x3f71ec[_0xcf90('0x9')]),_0x5f2162);}};exports[_0xcf90('0x45')]=function(_0x415e86){try{if(!_['isNil'](channels[_0x415e86[_0xcf90('0x9')]])){utils['debug'](util[_0xcf90('0xc')]('[%s][calls][musiconholdstop]',_0x415e86[_0xcf90('0x9')]),_0x415e86);if(!_[_0xcf90('0x22')](channels[_0x415e86[_0xcf90('0x9')]][_0xcf90('0x43')])){channels[_0x415e86[_0xcf90('0x9')]][_0xcf90('0x46')]+=utils['diffTime'](utils['now'](),channels[_0x415e86[_0xcf90('0x9')]][_0xcf90('0x43')]);utils['info'](util[_0xcf90('0xc')](_0xcf90('0x47'),_0x415e86['uniqueid'],channels[_0x415e86[_0xcf90('0x9')]][_0xcf90('0x46')]));delete channels[_0x415e86['uniqueid']][_0xcf90('0x43')];}}}catch(_0x49e800){utils[_0xcf90('0x40')](util[_0xcf90('0xc')](_0xcf90('0x48'),_0x415e86['uniqueid']),_0x49e800);}};exports[_0xcf90('0x49')]=function(_0x30614b){try{if(!_['isNil'](channels[_0x30614b[_0xcf90('0x9')]])){utils[_0xcf90('0x1b')](util[_0xcf90('0xc')](_0xcf90('0x4a'),_0x30614b['uniqueid']),_0x30614b);if(!_[_0xcf90('0x22')](_0x30614b['variable'][_0xcf90('0x4b')])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x4c'),_0x30614b[_0xcf90('0x9')],_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b['uniqueid']]['source']=_0x30614b['value'];}if(!_[_0xcf90('0x22')](_0x30614b[_0xcf90('0x4e')]['xmd-phone'])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x4f'),_0x30614b['uniqueid'],_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b['uniqueid']]['destination']=_0x30614b[_0xcf90('0x4d')];channels[_0x30614b[_0xcf90('0x9')]]['callerid']='\x22'+_0x30614b['value']+'\x22\x20<'+_0x30614b['value']+'>';}if(!_['isNil'](_0x30614b['variable'][_0xcf90('0x50')])||!_[_0xcf90('0x22')](_0x30614b['variable'][_0xcf90('0x51')])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x52'),_0x30614b['uniqueid'],!_[_0xcf90('0x22')](_0x30614b[_0xcf90('0x4e')][_0xcf90('0x50')])?_0xcf90('0x50'):_0xcf90('0x51'),_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b[_0xcf90('0x9')]][_0xcf90('0x2e')]=_0x30614b['value'];}if(!_['isNil'](_0x30614b[_0xcf90('0x4e')][_0xcf90('0x53')])||!_[_0xcf90('0x22')](_0x30614b[_0xcf90('0x4e')]['xmcs-queue'])){utils['info'](util[_0xcf90('0xc')](_0xcf90('0x52'),_0x30614b['uniqueid'],!_['isNil'](_0x30614b[_0xcf90('0x4e')]['xmd-queue'])?_0xcf90('0x53'):'xmcs-queue',_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b[_0xcf90('0x9')]]['lastapplication']='Queue';channels[_0x30614b[_0xcf90('0x9')]][_0xcf90('0x54')]=_0x30614b['value'];channels[_0x30614b[_0xcf90('0x9')]][_0xcf90('0xf')]=!![];}if(!_[_0xcf90('0x22')](_0x30614b['variable'][_0xcf90('0x55')])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x56'),_0x30614b[_0xcf90('0x9')],_0x30614b['value']));channels[_0x30614b[_0xcf90('0x9')]]['ContactId']=_0x30614b[_0xcf90('0x4d')];}if(!_[_0xcf90('0x22')](_0x30614b['variable'][_0xcf90('0x57')])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x30614b[_0xcf90('0x9')],_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b['uniqueid']][_0xcf90('0x58')]=_0x30614b[_0xcf90('0x4d')];}if(!_['isNil'](_0x30614b['variable'][_0xcf90('0x59')])){utils['info'](util[_0xcf90('0xc')](_0xcf90('0x5a'),_0x30614b[_0xcf90('0x9')],_0x30614b['value']));channels[_0x30614b[_0xcf90('0x9')]][_0xcf90('0x5b')]=_0x30614b[_0xcf90('0x4d')];}if(!_['isNil'](_0x30614b['variable']['sipcallid'])){utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x5c'),_0x30614b['uniqueid'],_0x30614b[_0xcf90('0x4d')]));channels[_0x30614b[_0xcf90('0x9')]][_0xcf90('0x5d')]=_0x30614b[_0xcf90('0x4d')];}}}catch(_0xd521ba){utils[_0xcf90('0x40')](util[_0xcf90('0xc')](_0xcf90('0x4a'),_0x30614b[_0xcf90('0x9')]),_0xd521ba);}};exports['newexten']=function(_0x48d34e){try{if(!_[_0xcf90('0x22')](channels[_0x48d34e['uniqueid']])){utils['debug'](util[_0xcf90('0xc')](_0xcf90('0x5e'),_0x48d34e[_0xcf90('0x9')]),_0x48d34e);utils[_0xcf90('0xb')](util[_0xcf90('0xc')](_0xcf90('0x5f'),_0x48d34e[_0xcf90('0x9')],_0x48d34e[_0xcf90('0x60')],_0x48d34e[_0xcf90('0x61')]));if(_0x48d34e[_0xcf90('0x60')][_0xcf90('0x62')]()=='set'&&_[_0xcf90('0x63')](_0x48d34e[_0xcf90('0x61')][_0xcf90('0x62')](),_0xcf90('0x64'))){var _0x5a6f8f=_0x48d34e['appdata'][_0xcf90('0x65')]('=');var _0x4ac4a4=_0x5a6f8f[0x0][_0xcf90('0x66')](_0x5a6f8f[0x0][_0xcf90('0x67')]('(')+0x1,_0x5a6f8f[0x0][_0xcf90('0x67')](')'));var _0x28a2e4=_0x5a6f8f[0x1];channels[_0x48d34e[_0xcf90('0x9')]][_0x4ac4a4]=_0x28a2e4;}if(!_[_0xcf90('0x68')]([_0xcf90('0x2c'),_0xcf90('0x69'),_0xcf90('0x6a'),_0xcf90('0x6b'),_0xcf90('0x6c')],_0x48d34e[_0xcf90('0x60')][_0xcf90('0x62')]())){channels[_0x48d34e['uniqueid']][_0xcf90('0x6d')]=_0x48d34e[_0xcf90('0x60')];channels[_0x48d34e[_0xcf90('0x9')]]['lastdata']=_0x48d34e['appdata'];}}}catch(_0x49d99f){utils[_0xcf90('0x40')](util['format']('[%s][calls][newexten]',_0x48d34e[_0xcf90('0x9')]),_0x49d99f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b9c0c07..7c7e405 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 _0xe772=['fullybooted','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x14e819,_0x661ffa){var _0x1ea24d=function(_0x26363a){while(--_0x26363a){_0x14e819['push'](_0x14e819['shift']());}};_0x1ea24d(++_0x661ffa);}(_0xe772,0xab));var _0x2e77=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0xe772[_0x2e3545];return _0xcf18f;};'use strict';var utils=require(_0x2e77('0x0'));exports['connect']=function(){utils[_0x2e77('0x1')](_0x2e77('0x2'));};exports[_0x2e77('0x3')]=function(){utils[_0x2e77('0x1')](_0x2e77('0x4'));};exports[_0x2e77('0x5')]=function(){utils[_0x2e77('0x1')](_0x2e77('0x6'));};exports['error']=function(_0x98db8e){utils['error'](_0x2e77('0x7'),_0x98db8e);};exports[_0x2e77('0x8')]=function(){utils['info'](_0x2e77('0x9'));};exports[_0x2e77('0xa')]=function(_0x4d6da3){}; \ No newline at end of file +var _0xbba8=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbba8,0x1c0));var _0x8bba=function(_0x2c39b0,_0x2ab113){_0x2c39b0=_0x2c39b0-0x0;var _0x5e0884=_0xbba8[_0x2c39b0];return _0x5e0884;};'use strict';var utils=require(_0x8bba('0x0'));exports[_0x8bba('0x1')]=function(){utils[_0x8bba('0x2')](_0x8bba('0x3'));};exports[_0x8bba('0x4')]=function(){utils[_0x8bba('0x2')](_0x8bba('0x5'));};exports[_0x8bba('0x6')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0x8bba('0x7')]=function(_0x19528d){utils[_0x8bba('0x7')](_0x8bba('0x8'),_0x19528d);};exports['close']=function(){utils[_0x8bba('0x2')](_0x8bba('0x9'));};exports[_0x8bba('0xa')]=function(_0x25ce8b){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index fdc00d8..6ee9df2 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 _0x43e1=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]'];(function(_0x37656f,_0x350ac6){var _0x5cd9d8=function(_0x12e27e){while(--_0x12e27e){_0x37656f['push'](_0x37656f['shift']());}};_0x5cd9d8(++_0x350ac6);}(_0x43e1,0x150));var _0x143e=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x43e1[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x143e('0x0'));var util=require(_0x143e('0x1'));var utils=require(_0x143e('0x2'));var dials={};function writeDB(_0x22d0d9){utils[_0x143e('0x3')](util[_0x143e('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x22d0d9[_0x143e('0x5')],_0x22d0d9[_0x143e('0x6')],_0x22d0d9[_0x143e('0x7')],_0x22d0d9['calleridnum'],_0x22d0d9[_0x143e('0x8')],_0x22d0d9[_0x143e('0x9')]));utils[_0x143e('0xa')](_0x143e('0xb'),_0x22d0d9);delete dials[_0x22d0d9[_0x143e('0x5')]];}exports['newexten']=function(_0x398271){try{utils[_0x143e('0xc')](util[_0x143e('0x4')](_0x143e('0xd'),_0x398271[_0x143e('0x5')]),_0x398271);utils[_0x143e('0x3')](util[_0x143e('0x4')](_0x143e('0xe'),_0x398271[_0x143e('0x5')],_0x398271[_0x143e('0xf')],_0x398271[_0x143e('0x10')]));if(_0x398271['application']['toLowerCase']()==_0x143e('0x11')&&_['startsWith'](_0x398271[_0x143e('0x10')]['toLowerCase'](),_0x143e('0x12'))){var _0x17172f=_0x398271[_0x143e('0x10')]['split']('=');dials[_0x398271['uniqueid']]={'routeId':_0x17172f[0x1]};}}catch(_0x113505){utils[_0x143e('0x13')](util['format'](_0x143e('0xd'),_0x398271['uniqueid']),_0x113505);}};exports[_0x143e('0x14')]=function(_0x3e6e09){try{utils[_0x143e('0xc')](util[_0x143e('0x4')](_0x143e('0x15'),_0x3e6e09['uniqueid']),_0x3e6e09);if(!_[_0x143e('0x16')](_0x3e6e09[_0x143e('0x17')][_0x143e('0x18')])){utils[_0x143e('0x3')](util[_0x143e('0x4')](_0x143e('0x19'),_0x3e6e09[_0x143e('0x5')],_0x3e6e09['value']));dials[_0x3e6e09[_0x143e('0x5')]]={'routeId':_0x3e6e09[_0x143e('0x1a')]};}}catch(_0xd3c53){utils[_0x143e('0x13')](util[_0x143e('0x4')]('[%s][dials][varset]',_0x3e6e09[_0x143e('0x5')]),_0xd3c53);}};exports[_0x143e('0x1b')]=function(_0x514b99){try{if(!_[_0x143e('0x16')](dials[_0x514b99[_0x143e('0x5')]])){utils['debug'](util[_0x143e('0x4')]('[%s][dials][dialbegin]',_0x514b99['uniqueid']),_0x514b99);dials[_0x514b99[_0x143e('0x5')]]=_[_0x143e('0x1c')](dials[_0x514b99['uniqueid']],_0x514b99);dials[_0x514b99[_0x143e('0x5')]][_0x143e('0x1d')]=utils[_0x143e('0x1e')]();dials[_0x514b99[_0x143e('0x5')]][_0x143e('0x1f')]=_0x143e('0x20');utils[_0x143e('0x3')](util[_0x143e('0x4')](_0x143e('0x21'),_0x514b99[_0x143e('0x5')],dials[_0x514b99[_0x143e('0x5')]][_0x143e('0x1d')]));}}catch(_0x5e93bf){utils[_0x143e('0x13')](util[_0x143e('0x4')]('[%s][dials][dialbegin]',_0x514b99[_0x143e('0x5')]),_0x5e93bf);}};exports['dialend']=function(_0x2cf035){try{if(!_[_0x143e('0x16')](dials[_0x2cf035[_0x143e('0x5')]])){utils[_0x143e('0xc')](util['format'](_0x143e('0x22'),_0x2cf035[_0x143e('0x5')]),_0x2cf035);dials[_0x2cf035[_0x143e('0x5')]]['dialstatus']=_0x2cf035['dialstatus'];if(_0x2cf035['dialstatus']=='ANSWER'){dials[_0x2cf035[_0x143e('0x5')]]=_[_0x143e('0x1c')](dials[_0x2cf035[_0x143e('0x5')]],_0x2cf035);dials[_0x2cf035[_0x143e('0x5')]][_0x143e('0x23')]=utils[_0x143e('0x1e')]();dials[_0x2cf035[_0x143e('0x5')]][_0x143e('0x1f')]=_0x143e('0x24');utils['info'](util[_0x143e('0x4')](_0x143e('0x25'),_0x2cf035[_0x143e('0x5')],_0x2cf035[_0x143e('0x9')],dials[_0x2cf035['uniqueid']][_0x143e('0x23')]));}else{utils[_0x143e('0x3')](util[_0x143e('0x4')](_0x143e('0x26'),_0x2cf035[_0x143e('0x5')],_0x2cf035[_0x143e('0x9')]));}}}catch(_0x23152f){utils[_0x143e('0x13')](util[_0x143e('0x4')](_0x143e('0x22'),_0x2cf035[_0x143e('0x5')]),_0x23152f);}};exports[_0x143e('0x27')]=function(_0x3e5ad0){try{if(!_[_0x143e('0x16')](dials[_0x3e5ad0['uniqueid']])){utils[_0x143e('0xc')](util[_0x143e('0x4')](_0x143e('0x28'),_0x3e5ad0[_0x143e('0x5')]),_0x3e5ad0);utils[_0x143e('0x3')](util[_0x143e('0x4')](_0x143e('0x29'),_0x3e5ad0[_0x143e('0x5')],_0x3e5ad0[_0x143e('0x2a')],_0x3e5ad0[_0x143e('0x2b')],_0x3e5ad0['cause-txt']));dials[_0x3e5ad0[_0x143e('0x5')]]=_[_0x143e('0x1c')](dials[_0x3e5ad0[_0x143e('0x5')]],{'endtime':utils[_0x143e('0x1e')](),'lastevent':_0x143e('0x2c')});dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x2d')]=utils[_0x143e('0x2e')](dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x2f')],dials[_0x3e5ad0['uniqueid']][_0x143e('0x1d')]);dials[_0x3e5ad0['uniqueid']][_0x143e('0x30')]=utils[_0x143e('0x2e')](dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x23')]||dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x2f')],dials[_0x3e5ad0['uniqueid']][_0x143e('0x1d')]);dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x31')]=dials[_0x3e5ad0['uniqueid']][_0x143e('0x23')]?utils[_0x143e('0x2e')](dials[_0x3e5ad0['uniqueid']][_0x143e('0x2f')],dials[_0x3e5ad0[_0x143e('0x5')]][_0x143e('0x23')]):0x0;writeDB(dials[_0x3e5ad0[_0x143e('0x5')]]);}}catch(_0x20dc9d){utils['error'](util['format']('[%s][dials][hangup]',_0x3e5ad0['uniqueid']),_0x20dc9d);}}; \ No newline at end of file +var _0x5443=['cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','now','hangup','[%s][dials][hangup]','calleridname'];(function(_0x265795,_0x584ff5){var _0x2f3092=function(_0x13108f){while(--_0x13108f){_0x265795['push'](_0x265795['shift']());}};_0x2f3092(++_0x584ff5);}(_0x5443,0x66));var _0x3544=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5443[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3544('0x0'));var util=require(_0x3544('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x96fe7e){utils[_0x3544('0x2')](util[_0x3544('0x3')](_0x3544('0x4'),_0x96fe7e[_0x3544('0x5')],_0x96fe7e['channel'],_0x96fe7e[_0x3544('0x6')],_0x96fe7e[_0x3544('0x7')],_0x96fe7e[_0x3544('0x8')],_0x96fe7e[_0x3544('0x9')]));utils[_0x3544('0xa')](_0x3544('0xb'),_0x96fe7e);delete dials[_0x96fe7e[_0x3544('0x5')]];}exports['newexten']=function(_0x89a797){try{utils[_0x3544('0xc')](util[_0x3544('0x3')]('[%s][dials][newexten]',_0x89a797['uniqueid']),_0x89a797);utils[_0x3544('0x2')](util[_0x3544('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x89a797['uniqueid'],_0x89a797['application'],_0x89a797[_0x3544('0xd')]));if(_0x89a797[_0x3544('0xe')][_0x3544('0xf')]()==_0x3544('0x10')&&_[_0x3544('0x11')](_0x89a797[_0x3544('0xd')][_0x3544('0xf')](),_0x3544('0x12'))){var _0x4bd371=_0x89a797[_0x3544('0xd')][_0x3544('0x13')]('=');dials[_0x89a797[_0x3544('0x5')]]={'routeId':_0x4bd371[0x1]};}}catch(_0x1f1078){utils[_0x3544('0x14')](util[_0x3544('0x3')]('[%s][dials][newexten]',_0x89a797[_0x3544('0x5')]),_0x1f1078);}};exports[_0x3544('0x15')]=function(_0x17992d){try{utils[_0x3544('0xc')](util[_0x3544('0x3')](_0x3544('0x16'),_0x17992d[_0x3544('0x5')]),_0x17992d);if(!_[_0x3544('0x17')](_0x17992d['variable'][_0x3544('0x18')])){utils[_0x3544('0x2')](util[_0x3544('0x3')](_0x3544('0x19'),_0x17992d['uniqueid'],_0x17992d[_0x3544('0x1a')]));dials[_0x17992d[_0x3544('0x5')]]={'routeId':_0x17992d['value']};}}catch(_0xa075cc){utils['error'](util['format'](_0x3544('0x16'),_0x17992d[_0x3544('0x5')]),_0xa075cc);}};exports[_0x3544('0x1b')]=function(_0xe15cc8){try{if(!_[_0x3544('0x17')](dials[_0xe15cc8['uniqueid']])){utils[_0x3544('0xc')](util[_0x3544('0x3')](_0x3544('0x1c'),_0xe15cc8[_0x3544('0x5')]),_0xe15cc8);dials[_0xe15cc8[_0x3544('0x5')]]=_[_0x3544('0x1d')](dials[_0xe15cc8[_0x3544('0x5')]],_0xe15cc8);dials[_0xe15cc8[_0x3544('0x5')]]['starttime']=utils['now']();dials[_0xe15cc8[_0x3544('0x5')]][_0x3544('0x1e')]=_0x3544('0x1f');utils[_0x3544('0x2')](util[_0x3544('0x3')](_0x3544('0x20'),_0xe15cc8[_0x3544('0x5')],dials[_0xe15cc8['uniqueid']][_0x3544('0x21')]));}}catch(_0x52e050){utils[_0x3544('0x14')](util[_0x3544('0x3')](_0x3544('0x1c'),_0xe15cc8[_0x3544('0x5')]),_0x52e050);}};exports[_0x3544('0x22')]=function(_0x160d0b){try{if(!_[_0x3544('0x17')](dials[_0x160d0b['uniqueid']])){utils['debug'](util[_0x3544('0x3')](_0x3544('0x23'),_0x160d0b[_0x3544('0x5')]),_0x160d0b);dials[_0x160d0b[_0x3544('0x5')]][_0x3544('0x9')]=_0x160d0b[_0x3544('0x9')];if(_0x160d0b['dialstatus']==_0x3544('0x24')){dials[_0x160d0b[_0x3544('0x5')]]=_[_0x3544('0x1d')](dials[_0x160d0b[_0x3544('0x5')]],_0x160d0b);dials[_0x160d0b[_0x3544('0x5')]][_0x3544('0x25')]=utils[_0x3544('0x26')]();dials[_0x160d0b[_0x3544('0x5')]]['lastevent']='connect';utils[_0x3544('0x2')](util[_0x3544('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x160d0b['uniqueid'],_0x160d0b['dialstatus'],dials[_0x160d0b[_0x3544('0x5')]][_0x3544('0x25')]));}else{utils[_0x3544('0x2')](util[_0x3544('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x160d0b[_0x3544('0x5')],_0x160d0b['dialstatus']));}}}catch(_0x7198f4){utils['error'](util[_0x3544('0x3')](_0x3544('0x23'),_0x160d0b[_0x3544('0x5')]),_0x7198f4);}};exports[_0x3544('0x27')]=function(_0x446ad6){try{if(!_[_0x3544('0x17')](dials[_0x446ad6[_0x3544('0x5')]])){utils['debug'](util['format'](_0x3544('0x28'),_0x446ad6[_0x3544('0x5')]),_0x446ad6);utils[_0x3544('0x2')](util[_0x3544('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x446ad6[_0x3544('0x5')],_0x446ad6[_0x3544('0x7')],_0x446ad6[_0x3544('0x29')],_0x446ad6[_0x3544('0x2a')]));dials[_0x446ad6[_0x3544('0x5')]]=_[_0x3544('0x1d')](dials[_0x446ad6[_0x3544('0x5')]],{'endtime':utils[_0x3544('0x26')](),'lastevent':_0x3544('0x2b')});dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x2c')]=utils[_0x3544('0x2d')](dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x2e')],dials[_0x446ad6['uniqueid']]['starttime']);dials[_0x446ad6[_0x3544('0x5')]]['holdtime']=utils[_0x3544('0x2d')](dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x25')]||dials[_0x446ad6[_0x3544('0x5')]]['endtime'],dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x21')]);dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x2f')]=dials[_0x446ad6[_0x3544('0x5')]]['answertime']?utils[_0x3544('0x2d')](dials[_0x446ad6[_0x3544('0x5')]][_0x3544('0x2e')],dials[_0x446ad6[_0x3544('0x5')]]['answertime']):0x0;writeDB(dials[_0x446ad6[_0x3544('0x5')]]);}}catch(_0x351b9a){utils[_0x3544('0x14')](util[_0x3544('0x3')](_0x3544('0x28'),_0x446ad6['uniqueid']),_0x351b9a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 40db498..54bb16e 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 _0xf571=['blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','production','asterisk','username','password','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]'];(function(_0x226646,_0x34665e){var _0x3cec6b=function(_0x49fd46){while(--_0x49fd46){_0x226646['push'](_0x226646['shift']());}};_0x3cec6b(++_0x34665e);}(_0xf571,0x19b));var _0x1f57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf571[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0x1f57('0x0'));var config=require('../../config/environment');var utils=require(_0x1f57('0x1'));var util=require(_0x1f57('0x2'));var isXDREnabled=config['xdr']&&config[_0x1f57('0x3')][_0x1f57('0x4')]?!config[_0x1f57('0x3')]['disabled']:!![];var isProduction=config['env']===_0x1f57('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x1f57('0x6')]['port'],config['asterisk']['ip'],config[_0x1f57('0x6')][_0x1f57('0x7')],config[_0x1f57('0x6')][_0x1f57('0x8')],!![]);ami['keepConnected']();if(!isXDREnabled){utils['info'](_0x1f57('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1f57('0xa')](_0x1f57('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0x1f57('0xc'));var queues=require(_0x1f57('0xd'));var recordings=require('./recordings.controller');var members=require(_0x1f57('0xe'));var dials=require(_0x1f57('0xf'));var transfers=require(_0x1f57('0x10'));var core=require('./core.controller');ami['on'](_0x1f57('0x11'),core['connect']);ami['on'](_0x1f57('0x12'),core[_0x1f57('0x12')]);ami['on'](_0x1f57('0x13'),core['fullybooted']);ami['on'](_0x1f57('0x14'),core[_0x1f57('0x14')]);ami['on'](_0x1f57('0x15'),core[_0x1f57('0x15')]);ami['on']('managerevent',core[_0x1f57('0x16')]);ami['on'](_0x1f57('0x17'),function(_0x4fab46){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x1a'),_0x4fab46[_0x1f57('0x1b')]),_0x4fab46);members[_0x1f57('0x17')](_0x4fab46);}catch(_0x121151){utils[_0x1f57('0x14')](util['format']('[%s][index][devicestatechange]',_0x4fab46['device']),_0x121151);}});ami['on'](_0x1f57('0x1c'),function(_0x334eab){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x1d'),_0x334eab[_0x1f57('0x1e')]),_0x334eab);agents['agentcalled'](_0x334eab);}catch(_0x4c06f5){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x1d'),_0x334eab[_0x1f57('0x1e')]),_0x4c06f5);}});ami['on'](_0x1f57('0x1f'),function(_0x521d27){try{utils['debug'](util[_0x1f57('0x19')]('[%s][index][agentringnoanswer]',_0x521d27['uniqueid']),_0x521d27);agents[_0x1f57('0x1f')](_0x521d27);}catch(_0x211402){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x20'),_0x521d27[_0x1f57('0x1e')]),_0x211402);}});ami['on'](_0x1f57('0x21'),function(_0x40f417){try{utils['debug'](util[_0x1f57('0x19')]('[%s][index][agentconnect]',_0x40f417['uniqueid']),_0x40f417);agents[_0x1f57('0x21')](_0x40f417);queues[_0x1f57('0x21')](_0x40f417);}catch(_0x21f0aa){utils[_0x1f57('0x14')](util[_0x1f57('0x19')]('[%s][index][agentconnect]',_0x40f417[_0x1f57('0x1e')]),_0x21f0aa);}});ami['on'](_0x1f57('0x22'),function(_0x3d3c0a){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x23'),_0x3d3c0a[_0x1f57('0x1e')]),_0x3d3c0a);agents[_0x1f57('0x22')](_0x3d3c0a);queues[_0x1f57('0x22')](_0x3d3c0a);members['agentcomplete'](_0x3d3c0a);}catch(_0x3a4d22){utils['error'](util[_0x1f57('0x19')]('[%s][index][agentcomplete]',_0x3d3c0a['uniqueid']),_0x3a4d22);}});ami['on'](_0x1f57('0x24'),function(_0x45bb16){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x25'),_0x45bb16[_0x1f57('0x1e')]),_0x45bb16);agents[_0x1f57('0x24')](_0x45bb16);queues[_0x1f57('0x24')](_0x45bb16);}catch(_0x1aa9c1){utils['error'](util[_0x1f57('0x19')]('[%s][index][queuecallerabandon]',_0x45bb16[_0x1f57('0x1e')]),_0x1aa9c1);}});ami['on'](_0x1f57('0x26'),function(_0x47c333){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x27'),_0x47c333[_0x1f57('0x1e')]),_0x47c333);queues[_0x1f57('0x26')](_0x47c333);recordings[_0x1f57('0x26')](_0x47c333);}catch(_0x3cd5c7){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x27'),_0x47c333['uniqueid']),_0x3cd5c7);}});ami['on'](_0x1f57('0x28'),function(_0x1c6594){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x29'),_0x1c6594['uniqueid']),_0x1c6594);queues[_0x1f57('0x28')](_0x1c6594);}catch(_0x231bb9){utils[_0x1f57('0x14')](util['format']('[%s][index][queuecallerleave]',_0x1c6594['uniqueid']),_0x231bb9);}});ami['on']('musiconholdstart',function(_0x20c8cd){try{utils[_0x1f57('0x18')](util['format']('[%s][index][musiconholdstart]',_0x20c8cd['uniqueid']),_0x20c8cd);queues['musiconholdstart'](_0x20c8cd);calls['musiconholdstart'](_0x20c8cd);}catch(_0x59afc6){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x2a'),_0x20c8cd[_0x1f57('0x1e')]),_0x59afc6);}});ami['on'](_0x1f57('0x2b'),function(_0x50c466){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x2c'),_0x50c466[_0x1f57('0x1e')]),_0x50c466);queues[_0x1f57('0x2b')](_0x50c466);calls[_0x1f57('0x2b')](_0x50c466);}catch(_0x2f5d0d){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x2c'),_0x50c466[_0x1f57('0x1e')]),_0x2f5d0d);}});ami['on']('newstate',function(_0x127f6f){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x2d'),_0x127f6f['uniqueid']),_0x127f6f);calls['newstate'](_0x127f6f);recordings[_0x1f57('0x2e')](_0x127f6f);}catch(_0xfdd792){utils['error'](util[_0x1f57('0x19')](_0x1f57('0x2d'),_0x127f6f['uniqueid']),_0xfdd792);}});ami['on'](_0x1f57('0x2f'),function(_0x1a0d7e){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x30'),_0x1a0d7e[_0x1f57('0x1e')]),_0x1a0d7e);calls[_0x1f57('0x2f')](_0x1a0d7e);recordings[_0x1f57('0x2f')](_0x1a0d7e);dials[_0x1f57('0x2f')](_0x1a0d7e);agents[_0x1f57('0x2f')](_0x1a0d7e);queues[_0x1f57('0x2f')](_0x1a0d7e);}catch(_0x335e74){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x30'),_0x1a0d7e['uniqueid']),_0x335e74);}});ami['on'](_0x1f57('0x31'),function(_0x3024a8){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x32'),_0x3024a8[_0x1f57('0x1e')]),_0x3024a8);members[_0x1f57('0x31')](_0x3024a8);}catch(_0x165dfc){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x32'),_0x3024a8['uniqueid']),_0x165dfc);}});ami['on'](_0x1f57('0x33'),function(_0x219201){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x34'),_0x219201[_0x1f57('0x1e')]),_0x219201);queues[_0x1f57('0x33')](_0x219201);agents['blindtransfer'](_0x219201);transfers['blindtransfer'](_0x219201);recordings['blindtransfer'](_0x219201);}catch(_0xdb76bd){utils[_0x1f57('0x14')](util[_0x1f57('0x19')]('[%s][index][blindtransfer]',_0x219201[_0x1f57('0x1e')]),_0xdb76bd);}});ami['on'](_0x1f57('0x35'),function(_0x1dd6bf){try{utils['debug'](util['format'](_0x1f57('0x36'),_0x1dd6bf[_0x1f57('0x37')]),_0x1dd6bf);queues[_0x1f57('0x35')](_0x1dd6bf);transfers[_0x1f57('0x35')](_0x1dd6bf);agents[_0x1f57('0x35')](_0x1dd6bf);calls[_0x1f57('0x35')](_0x1dd6bf);}catch(_0x3e7059){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x36'),_0x1dd6bf['origtransfereruniqueid']),_0x3e7059);}});ami['on'](_0x1f57('0x38'),function(_0x221ae6){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x39'),_0x221ae6[_0x1f57('0x1e')]),_0x221ae6);queues[_0x1f57('0x38')](_0x221ae6);recordings[_0x1f57('0x38')](_0x221ae6);calls[_0x1f57('0x38')](_0x221ae6);dials['varset'](_0x221ae6);}catch(_0x323cd8){utils['error'](util[_0x1f57('0x19')](_0x1f57('0x39'),_0x221ae6[_0x1f57('0x1e')]),_0x323cd8);}});ami['on']('newexten',function(_0x479708){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')](_0x1f57('0x3a'),_0x479708[_0x1f57('0x1e')]),_0x479708);calls[_0x1f57('0x3b')](_0x479708);recordings[_0x1f57('0x3b')](_0x479708);dials[_0x1f57('0x3b')](_0x479708);}catch(_0x542322){utils[_0x1f57('0x14')](util['format'](_0x1f57('0x3a'),_0x479708['uniqueid']),_0x542322);}});ami['on'](_0x1f57('0x3c'),function(_0x3c409f){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x3d'),_0x3c409f[_0x1f57('0x1e')]),_0x3c409f);calls[_0x1f57('0x3c')](_0x3c409f);recordings[_0x1f57('0x3c')](_0x3c409f);}catch(_0x45cf87){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x3d'),_0x3c409f[_0x1f57('0x1e')]),_0x45cf87);}});ami['on'](_0x1f57('0x3e'),function(_0x338371){try{utils['debug'](util[_0x1f57('0x19')](_0x1f57('0x3f'),_0x338371[_0x1f57('0x1e')]),_0x338371);dials[_0x1f57('0x3e')](_0x338371);}catch(_0x317733){utils['error'](util[_0x1f57('0x19')]('[%s]dialbegin',_0x338371[_0x1f57('0x1e')]),_0x317733);}});ami['on'](_0x1f57('0x40'),function(_0x2f5078){try{utils[_0x1f57('0x18')](util[_0x1f57('0x19')]('[%s][index][dialend]',_0x2f5078['uniqueid']),_0x2f5078);dials[_0x1f57('0x40')](_0x2f5078);}catch(_0xa0e342){utils[_0x1f57('0x14')](util[_0x1f57('0x19')](_0x1f57('0x41'),_0x2f5078[_0x1f57('0x1e')]),_0xa0e342);}});} \ No newline at end of file +var _0xbf91=['[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','password','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','devicestatechange','[%s][index][devicestatechange]','agentcalled','debug','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xbf91,0x125));var _0x1bf9=function(_0x358f88,_0xe93aba){_0x358f88=_0x358f88-0x0;var _0x217d4c=_0xbf91[_0x358f88];return _0x217d4c;};var AsteriskManager=require(_0x1bf9('0x0'));var config=require(_0x1bf9('0x1'));var utils=require(_0x1bf9('0x2'));var util=require(_0x1bf9('0x3'));var isXDREnabled=config[_0x1bf9('0x4')]&&config[_0x1bf9('0x4')][_0x1bf9('0x5')]?!config['xdr'][_0x1bf9('0x5')]:!![];var isProduction=config[_0x1bf9('0x6')]===_0x1bf9('0x7')||![];var isLocalAsterisk=config[_0x1bf9('0x4')]&&config['xdr'][_0x1bf9('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x1bf9('0x9')],config[_0x1bf9('0xa')]['ip'],config[_0x1bf9('0xa')][_0x1bf9('0xb')],config['asterisk'][_0x1bf9('0xc')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x1bf9('0xd')](_0x1bf9('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x1bf9('0xf'));var calls=require(_0x1bf9('0x10'));var queues=require(_0x1bf9('0x11'));var recordings=require(_0x1bf9('0x12'));var members=require('./members.controller');var dials=require(_0x1bf9('0x13'));var transfers=require(_0x1bf9('0x14'));var core=require(_0x1bf9('0x15'));ami['on'](_0x1bf9('0x16'),core[_0x1bf9('0x16')]);ami['on'](_0x1bf9('0x17'),core[_0x1bf9('0x17')]);ami['on'](_0x1bf9('0x18'),core[_0x1bf9('0x18')]);ami['on'](_0x1bf9('0x19'),core[_0x1bf9('0x19')]);ami['on'](_0x1bf9('0x1a'),core[_0x1bf9('0x1a')]);ami['on'](_0x1bf9('0x1b'),core[_0x1bf9('0x1b')]);ami['on']('devicestatechange',function(_0x3aaac2){try{utils['debug'](util[_0x1bf9('0x1c')]('[%s][index][devicestatechange]',_0x3aaac2['device']),_0x3aaac2);members[_0x1bf9('0x1d')](_0x3aaac2);}catch(_0x3091a5){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x1e'),_0x3aaac2['device']),_0x3091a5);}});ami['on'](_0x1bf9('0x1f'),function(_0x54745e){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')]('[%s][index][agentcalled]',_0x54745e[_0x1bf9('0x21')]),_0x54745e);agents['agentcalled'](_0x54745e);}catch(_0x21cecb){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x22'),_0x54745e['uniqueid']),_0x21cecb);}});ami['on'](_0x1bf9('0x23'),function(_0x51c898){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x24'),_0x51c898[_0x1bf9('0x21')]),_0x51c898);agents[_0x1bf9('0x23')](_0x51c898);}catch(_0x2a48d3){utils['error'](util['format']('[%s][index][agentringnoanswer]',_0x51c898[_0x1bf9('0x21')]),_0x2a48d3);}});ami['on'](_0x1bf9('0x25'),function(_0x5e897c){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x26'),_0x5e897c['uniqueid']),_0x5e897c);agents[_0x1bf9('0x25')](_0x5e897c);queues[_0x1bf9('0x25')](_0x5e897c);}catch(_0x47df4b){utils[_0x1bf9('0x19')](util['format'](_0x1bf9('0x26'),_0x5e897c['uniqueid']),_0x47df4b);}});ami['on'](_0x1bf9('0x27'),function(_0x5d40d3){try{utils['debug'](util['format'](_0x1bf9('0x28'),_0x5d40d3[_0x1bf9('0x21')]),_0x5d40d3);agents[_0x1bf9('0x27')](_0x5d40d3);queues['agentcomplete'](_0x5d40d3);members[_0x1bf9('0x27')](_0x5d40d3);}catch(_0x47552f){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')]('[%s][index][agentcomplete]',_0x5d40d3[_0x1bf9('0x21')]),_0x47552f);}});ami['on'](_0x1bf9('0x29'),function(_0x145f4e){try{utils['debug'](util[_0x1bf9('0x1c')](_0x1bf9('0x2a'),_0x145f4e[_0x1bf9('0x21')]),_0x145f4e);agents[_0x1bf9('0x29')](_0x145f4e);queues[_0x1bf9('0x29')](_0x145f4e);}catch(_0x17c035){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')]('[%s][index][queuecallerabandon]',_0x145f4e[_0x1bf9('0x21')]),_0x17c035);}});ami['on']('queuecallerjoin',function(_0x497d8f){try{utils[_0x1bf9('0x20')](util['format'](_0x1bf9('0x2b'),_0x497d8f[_0x1bf9('0x21')]),_0x497d8f);queues[_0x1bf9('0x2c')](_0x497d8f);recordings[_0x1bf9('0x2c')](_0x497d8f);}catch(_0x23c065){utils[_0x1bf9('0x19')](util['format'](_0x1bf9('0x2b'),_0x497d8f['uniqueid']),_0x23c065);}});ami['on']('queuecallerleave',function(_0x32a156){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x2d'),_0x32a156['uniqueid']),_0x32a156);queues[_0x1bf9('0x2e')](_0x32a156);}catch(_0x15d280){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x2d'),_0x32a156[_0x1bf9('0x21')]),_0x15d280);}});ami['on'](_0x1bf9('0x2f'),function(_0x20625a){try{utils['debug'](util[_0x1bf9('0x1c')](_0x1bf9('0x30'),_0x20625a[_0x1bf9('0x21')]),_0x20625a);queues[_0x1bf9('0x2f')](_0x20625a);calls[_0x1bf9('0x2f')](_0x20625a);}catch(_0x3d747c){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x30'),_0x20625a['uniqueid']),_0x3d747c);}});ami['on']('musiconholdstop',function(_0x4e51f3){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')]('[%s][index][musiconholdstop]',_0x4e51f3[_0x1bf9('0x21')]),_0x4e51f3);queues[_0x1bf9('0x31')](_0x4e51f3);calls[_0x1bf9('0x31')](_0x4e51f3);}catch(_0x3b490b){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x32'),_0x4e51f3[_0x1bf9('0x21')]),_0x3b490b);}});ami['on'](_0x1bf9('0x33'),function(_0x27494f){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x34'),_0x27494f['uniqueid']),_0x27494f);calls['newstate'](_0x27494f);recordings[_0x1bf9('0x33')](_0x27494f);}catch(_0x5636ce){utils[_0x1bf9('0x19')](util['format']('[%s][index][newstate]',_0x27494f[_0x1bf9('0x21')]),_0x5636ce);}});ami['on']('hangup',function(_0x31319b){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x35'),_0x31319b[_0x1bf9('0x21')]),_0x31319b);calls[_0x1bf9('0x36')](_0x31319b);recordings[_0x1bf9('0x36')](_0x31319b);dials[_0x1bf9('0x36')](_0x31319b);agents['hangup'](_0x31319b);queues['hangup'](_0x31319b);}catch(_0x535534){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x35'),_0x31319b[_0x1bf9('0x21')]),_0x535534);}});ami['on'](_0x1bf9('0x37'),function(_0xd5510e){try{utils['debug'](util[_0x1bf9('0x1c')](_0x1bf9('0x38'),_0xd5510e[_0x1bf9('0x21')]),_0xd5510e);members[_0x1bf9('0x37')](_0xd5510e);}catch(_0x4e4980){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x38'),_0xd5510e[_0x1bf9('0x21')]),_0x4e4980);}});ami['on']('blindtransfer',function(_0x8bcca9){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x39'),_0x8bcca9[_0x1bf9('0x21')]),_0x8bcca9);queues['blindtransfer'](_0x8bcca9);agents['blindtransfer'](_0x8bcca9);transfers[_0x1bf9('0x3a')](_0x8bcca9);recordings[_0x1bf9('0x3a')](_0x8bcca9);}catch(_0x539e02){utils[_0x1bf9('0x19')](util['format'](_0x1bf9('0x39'),_0x8bcca9[_0x1bf9('0x21')]),_0x539e02);}});ami['on']('attendedtransfer',function(_0x2b334d){try{utils['debug'](util[_0x1bf9('0x1c')]('[%s][index][attendedtransfer]',_0x2b334d[_0x1bf9('0x3b')]),_0x2b334d);queues[_0x1bf9('0x3c')](_0x2b334d);transfers['attendedtransfer'](_0x2b334d);agents[_0x1bf9('0x3c')](_0x2b334d);calls[_0x1bf9('0x3c')](_0x2b334d);}catch(_0x39db69){utils[_0x1bf9('0x19')](util['format'](_0x1bf9('0x3d'),_0x2b334d[_0x1bf9('0x3b')]),_0x39db69);}});ami['on'](_0x1bf9('0x3e'),function(_0x173ef5){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x3f'),_0x173ef5[_0x1bf9('0x21')]),_0x173ef5);queues[_0x1bf9('0x3e')](_0x173ef5);recordings[_0x1bf9('0x3e')](_0x173ef5);calls[_0x1bf9('0x3e')](_0x173ef5);dials[_0x1bf9('0x3e')](_0x173ef5);}catch(_0x3332a4){utils[_0x1bf9('0x19')](util['format']('[%s][index][varset]',_0x173ef5[_0x1bf9('0x21')]),_0x3332a4);}});ami['on'](_0x1bf9('0x40'),function(_0xaf7d53){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x41'),_0xaf7d53['uniqueid']),_0xaf7d53);calls[_0x1bf9('0x40')](_0xaf7d53);recordings[_0x1bf9('0x40')](_0xaf7d53);dials['newexten'](_0xaf7d53);}catch(_0x1cc2c8){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x41'),_0xaf7d53['uniqueid']),_0x1cc2c8);}});ami['on']('newchannel',function(_0x148593){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x42'),_0x148593[_0x1bf9('0x21')]),_0x148593);calls[_0x1bf9('0x43')](_0x148593);recordings[_0x1bf9('0x43')](_0x148593);}catch(_0x3b4299){utils[_0x1bf9('0x19')](util['format'](_0x1bf9('0x42'),_0x148593['uniqueid']),_0x3b4299);}});ami['on'](_0x1bf9('0x44'),function(_0x53cf7c){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x45'),_0x53cf7c['uniqueid']),_0x53cf7c);dials[_0x1bf9('0x44')](_0x53cf7c);}catch(_0x3daa26){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x46'),_0x53cf7c['uniqueid']),_0x3daa26);}});ami['on'](_0x1bf9('0x47'),function(_0x54603a){try{utils[_0x1bf9('0x20')](util[_0x1bf9('0x1c')](_0x1bf9('0x48'),_0x54603a[_0x1bf9('0x21')]),_0x54603a);dials[_0x1bf9('0x47')](_0x54603a);}catch(_0x2bea20){utils[_0x1bf9('0x19')](util[_0x1bf9('0x1c')](_0x1bf9('0x48'),_0x54603a[_0x1bf9('0x21')]),_0x2bea20);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index d566dd2..9d7a8d2 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 _0x6953=['request','getUserByName','split','then','internal','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','exitAt','now','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','queue','cdr','[%s][members][cdr]','source','data3','data1','data2','destinationchannel','assign','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','interface','getUserByInterface','name'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x6953,0x91));var _0x3695=function(_0x269fb6,_0x551e65){_0x269fb6=_0x269fb6-0x0;var _0x5816f8=_0x6953[_0x269fb6];return _0x5816f8;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x402642){utils['info'](util[_0x3695('0x2')](_0x3695('0x3'),_0x402642[_0x3695('0x4')],_0x402642['interface'],_0x402642[_0x3695('0x5')],_0x402642['data2'],_0x402642[_0x3695('0x6')],_0x402642[_0x3695('0x7')]));if(_0x402642[_0x3695('0x8')]){utils[_0x3695('0x9')](_0x402642[_0x3695('0x8')])['then'](function(_0x3ef16e){if(_0x3ef16e){_0x402642['membername']=_0x3ef16e[_0x3695('0xa')];_0x402642['internal']=_0x3ef16e['internal'];utils[_0x3695('0xb')]('CreateMemberReport',_0x402642);}else{utils[_0x3695('0xc')](_0x402642[_0x3695('0x8')][_0x3695('0xd')]('/')[0x1])[_0x3695('0xe')](function(_0x24ecc6){if(_0x24ecc6){_0x402642[_0x3695('0x6')]=_0x24ecc6['name'];_0x402642[_0x3695('0xf')]=_0x24ecc6[_0x3695('0xf')];utils[_0x3695('0xb')](_0x3695('0x10'),_0x402642);}});}})[_0x3695('0x11')](function(_0x27e243){utils[_0x3695('0x12')](util[_0x3695('0x2')](_0x3695('0x13'),_0x402642[_0x3695('0x4')]),_0x27e243);});}delete members[_0x402642[_0x3695('0x8')]];}function startsWith(_0x4ca317,_0x3aa59d){return _[_0x3695('0x14')](_0x4ca317,function(_0x2cdd3){return _[_0x3695('0x15')](_0x3aa59d,_0x2cdd3);});}exports[_0x3695('0x16')]=function(_0x1973ee){try{utils[_0x3695('0x17')](util['format'](_0x3695('0x18'),members[_0x1973ee['device']]?members[_0x1973ee[_0x3695('0x19')]][_0x3695('0x4')]:_0x1973ee[_0x3695('0x19')]),_0x1973ee);utils[_0x3695('0x1a')](util[_0x3695('0x2')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1973ee[_0x3695('0x19')]]?members[_0x1973ee[_0x3695('0x19')]][_0x3695('0x4')]:_0x1973ee[_0x3695('0x19')],_0x1973ee[_0x3695('0x1b')],_0x1973ee[_0x3695('0x19')]));switch(_0x1973ee[_0x3695('0x1b')]){case _0x3695('0x1c'):case _0x3695('0x1d'):if(!startsWith(exclude,_0x1973ee[_0x3695('0x19')])){members[_0x1973ee[_0x3695('0x19')]]={'channel':_0x3695('0x1e'),'interface':_0x1973ee[_0x3695('0x19')],'type':_0x3695('0x1f'),'enterAt':utils['now'](),'role':_0x3695('0x20')};}break;case _0x3695('0x21'):if(!_['isNil'](members[_0x1973ee['device']])){members[_0x1973ee[_0x3695('0x19')]][_0x3695('0x22')]=utils[_0x3695('0x23')]();members[_0x1973ee[_0x3695('0x19')]]['duration']=utils[_0x3695('0x24')](members[_0x1973ee['device']][_0x3695('0x22')],members[_0x1973ee['device']][_0x3695('0x25')]);if(members[_0x1973ee['device']][_0x3695('0x4')]){writeDB(members[_0x1973ee[_0x3695('0x19')]]);}}break;default:break;}}catch(_0x462ff0){utils[_0x3695('0x12')](util[_0x3695('0x2')](_0x3695('0x18'),members[_0x1973ee['device']]?members[_0x1973ee[_0x3695('0x19')]][_0x3695('0x4')]:_0x1973ee['device']),_0x462ff0);}};exports[_0x3695('0x26')]=function(_0x4d0742){try{if(!_[_0x3695('0x27')](members[_0x4d0742[_0x3695('0x8')]])){utils[_0x3695('0x17')](util[_0x3695('0x2')](_0x3695('0x28'),_0x4d0742[_0x3695('0x4')]),_0x4d0742);utils[_0x3695('0x1a')](util[_0x3695('0x2')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x4d0742[_0x3695('0x4')],_0x4d0742[_0x3695('0x8')],_0x4d0742[_0x3695('0x29')]));members[_0x4d0742['interface']]=_['assign'](members[_0x4d0742[_0x3695('0x8')]],{'data4':_0x4d0742['queue'],'uniqueid':_0x4d0742[_0x3695('0x4')]});}}catch(_0x471e4b){utils['error'](util[_0x3695('0x2')]('[%s][members][agentcomplete]',_0x4d0742[_0x3695('0x4')]),_0x471e4b);}};exports[_0x3695('0x2a')]=function(_0x185e48){try{utils[_0x3695('0x17')](util[_0x3695('0x2')](_0x3695('0x2b'),_0x185e48['uniqueid']),_0x185e48);if(_0x185e48[_0x3695('0x5')]){var _0x33043e=_0x185e48['channel'][_0x3695('0xd')]('-')[0x0];if(!_[_0x3695('0x27')](members[_0x33043e])){members[_0x33043e]=_['assign'](members[_0x33043e],{'data1':members[_0x33043e]['data1']||_0x185e48['type'],'data2':members[_0x33043e]['data2']||_0x185e48[_0x3695('0x2c')],'data3':members[_0x33043e][_0x3695('0x2d')]||_0x185e48['destination'],'uniqueid':members[_0x33043e][_0x3695('0x4')]||_0x185e48[_0x3695('0x4')]});utils[_0x3695('0x1a')](util[_0x3695('0x2')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x185e48['uniqueid'],members[_0x33043e][_0x3695('0x2e')],members[_0x33043e][_0x3695('0x2f')],members[_0x33043e]['data3']));if(members[_0x33043e][_0x3695('0x22')]){writeDB(members[_0x33043e]);}}}if(_0x185e48[_0x3695('0x30')]){var _0x521d60=_0x185e48[_0x3695('0x30')][_0x3695('0xd')]('-')[0x0];if(!_[_0x3695('0x27')](members[_0x521d60])){members[_0x521d60]=_[_0x3695('0x31')](members[_0x521d60],{'data1':members[_0x521d60][_0x3695('0x2e')]||_0x185e48[_0x3695('0x7')],'data2':members[_0x521d60][_0x3695('0x2f')]||_0x185e48[_0x3695('0x2c')],'data3':members[_0x521d60][_0x3695('0x2d')]||_0x185e48[_0x3695('0x32')],'uniqueid':members[_0x521d60][_0x3695('0x4')]||_0x185e48[_0x3695('0x4')]});utils[_0x3695('0x1a')](util['format'](_0x3695('0x33'),_0x185e48[_0x3695('0x4')],members[_0x521d60][_0x3695('0x2e')],members[_0x521d60][_0x3695('0x2f')],members[_0x521d60][_0x3695('0x2d')]));if(members[_0x521d60][_0x3695('0x22')]){writeDB(members[_0x521d60]);}}}}catch(_0x450483){utils['error'](util[_0x3695('0x2')](_0x3695('0x2b'),_0x185e48[_0x3695('0x4')]),_0x450483);}}; \ No newline at end of file +var _0x87d1=['destinationchannel','source','[%s][members][cdr]','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','error','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','now','NOT_INUSE','isNil','duration','enterAt','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','data2','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','exitAt'];(function(_0x10d108,_0x5579d4){var _0x2a4486=function(_0x33fa3c){while(--_0x33fa3c){_0x10d108['push'](_0x10d108['shift']());}};_0x2a4486(++_0x5579d4);}(_0x87d1,0x1a1));var _0x187d=function(_0xa05337,_0x2b2a95){_0xa05337=_0xa05337-0x0;var _0x48aaa9=_0x87d1[_0xa05337];return _0x48aaa9;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var members={};var exclude=[_0x187d('0x0'),_0x187d('0x1')];function writeDB(_0x38dee4){utils[_0x187d('0x2')](util[_0x187d('0x3')](_0x187d('0x4'),_0x38dee4[_0x187d('0x5')],_0x38dee4[_0x187d('0x6')],_0x38dee4[_0x187d('0x7')],_0x38dee4['data2'],_0x38dee4[_0x187d('0x8')],_0x38dee4[_0x187d('0x9')]));if(_0x38dee4[_0x187d('0x6')]){utils[_0x187d('0xa')](_0x38dee4['interface'])[_0x187d('0xb')](function(_0x442fab){if(_0x442fab){_0x38dee4['membername']=_0x442fab[_0x187d('0xc')];_0x38dee4[_0x187d('0xd')]=_0x442fab[_0x187d('0xd')];utils[_0x187d('0xe')](_0x187d('0xf'),_0x38dee4);}else{utils['getUserByName'](_0x38dee4[_0x187d('0x6')][_0x187d('0x10')]('/')[0x1])['then'](function(_0x348d94){if(_0x348d94){_0x38dee4[_0x187d('0x8')]=_0x348d94[_0x187d('0xc')];_0x38dee4[_0x187d('0xd')]=_0x348d94[_0x187d('0xd')];utils[_0x187d('0xe')](_0x187d('0xf'),_0x38dee4);}});}})[_0x187d('0x11')](function(_0x1f751f){utils[_0x187d('0x12')](util[_0x187d('0x3')]('[%s][members][writeDB]',_0x38dee4[_0x187d('0x5')]),_0x1f751f);});}delete members[_0x38dee4[_0x187d('0x6')]];}function startsWith(_0x669954,_0x31701e){return _[_0x187d('0x13')](_0x669954,function(_0x191671){return _[_0x187d('0x14')](_0x31701e,_0x191671);});}exports[_0x187d('0x15')]=function(_0x121518){try{utils['debug'](util['format'](_0x187d('0x16'),members[_0x121518['device']]?members[_0x121518[_0x187d('0x17')]][_0x187d('0x5')]:_0x121518[_0x187d('0x17')]),_0x121518);utils[_0x187d('0x2')](util[_0x187d('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x121518[_0x187d('0x17')]]?members[_0x121518['device']]['uniqueid']:_0x121518[_0x187d('0x17')],_0x121518[_0x187d('0x18')],_0x121518[_0x187d('0x17')]));switch(_0x121518[_0x187d('0x18')]){case _0x187d('0x19'):case _0x187d('0x1a'):if(!startsWith(exclude,_0x121518[_0x187d('0x17')])){members[_0x121518['device']]={'channel':'voice','interface':_0x121518[_0x187d('0x17')],'type':'TALKING','enterAt':utils[_0x187d('0x1b')](),'role':'agent'};}break;case _0x187d('0x1c'):if(!_[_0x187d('0x1d')](members[_0x121518[_0x187d('0x17')]])){members[_0x121518['device']]['exitAt']=utils[_0x187d('0x1b')]();members[_0x121518[_0x187d('0x17')]][_0x187d('0x1e')]=utils['diffTime'](members[_0x121518[_0x187d('0x17')]]['exitAt'],members[_0x121518['device']][_0x187d('0x1f')]);if(members[_0x121518[_0x187d('0x17')]][_0x187d('0x5')]){writeDB(members[_0x121518[_0x187d('0x17')]]);}}break;default:break;}}catch(_0x2a3663){utils[_0x187d('0x12')](util[_0x187d('0x3')]('[%s][members][devicestatechange]',members[_0x121518[_0x187d('0x17')]]?members[_0x121518[_0x187d('0x17')]][_0x187d('0x5')]:_0x121518[_0x187d('0x17')]),_0x2a3663);}};exports[_0x187d('0x20')]=function(_0x44f194){try{if(!_[_0x187d('0x1d')](members[_0x44f194['interface']])){utils[_0x187d('0x21')](util[_0x187d('0x3')]('[%s][members][agentcomplete]',_0x44f194[_0x187d('0x5')]),_0x44f194);utils[_0x187d('0x2')](util[_0x187d('0x3')](_0x187d('0x22'),_0x44f194['uniqueid'],_0x44f194[_0x187d('0x6')],_0x44f194['queue']));members[_0x44f194[_0x187d('0x6')]]=_[_0x187d('0x23')](members[_0x44f194['interface']],{'data4':_0x44f194[_0x187d('0x24')],'uniqueid':_0x44f194[_0x187d('0x5')]});}}catch(_0x574b04){utils[_0x187d('0x12')](util[_0x187d('0x3')]('[%s][members][agentcomplete]',_0x44f194[_0x187d('0x5')]),_0x574b04);}};exports['cdr']=function(_0x519ca0){try{utils['debug'](util['format']('[%s][members][cdr]',_0x519ca0[_0x187d('0x5')]),_0x519ca0);if(_0x519ca0[_0x187d('0x7')]){var _0x1f1dff=_0x519ca0[_0x187d('0x7')][_0x187d('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1f1dff])){members[_0x1f1dff]=_[_0x187d('0x23')](members[_0x1f1dff],{'data1':members[_0x1f1dff]['data1']||_0x519ca0['type'],'data2':members[_0x1f1dff][_0x187d('0x25')]||_0x519ca0['source'],'data3':members[_0x1f1dff]['data3']||_0x519ca0[_0x187d('0x26')],'uniqueid':members[_0x1f1dff][_0x187d('0x5')]||_0x519ca0[_0x187d('0x5')]});utils['info'](util[_0x187d('0x3')](_0x187d('0x27'),_0x519ca0[_0x187d('0x5')],members[_0x1f1dff][_0x187d('0x28')],members[_0x1f1dff][_0x187d('0x25')],members[_0x1f1dff][_0x187d('0x29')]));if(members[_0x1f1dff][_0x187d('0x2a')]){writeDB(members[_0x1f1dff]);}}}if(_0x519ca0[_0x187d('0x2b')]){var _0x9bec94=_0x519ca0[_0x187d('0x2b')][_0x187d('0x10')]('-')[0x0];if(!_['isNil'](members[_0x9bec94])){members[_0x9bec94]=_[_0x187d('0x23')](members[_0x9bec94],{'data1':members[_0x9bec94]['data1']||_0x519ca0[_0x187d('0x9')],'data2':members[_0x9bec94][_0x187d('0x25')]||_0x519ca0[_0x187d('0x2c')],'data3':members[_0x9bec94][_0x187d('0x29')]||_0x519ca0['destination'],'uniqueid':members[_0x9bec94][_0x187d('0x5')]||_0x519ca0['uniqueid']});utils[_0x187d('0x2')](util['format'](_0x187d('0x27'),_0x519ca0[_0x187d('0x5')],members[_0x9bec94]['data1'],members[_0x9bec94]['data2'],members[_0x9bec94]['data3']));if(members[_0x9bec94]['exitAt']){writeDB(members[_0x9bec94]);}}}}catch(_0x3084f6){utils['error'](util['format'](_0x187d('0x2d'),_0x519ca0[_0x187d('0x5')]),_0x3084f6);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2acca5c..62b8592 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 _0x7677=['[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension'];(function(_0x4f5e54,_0x2b6855){var _0x3f2bd4=function(_0x51221f){while(--_0x51221f){_0x4f5e54['push'](_0x4f5e54['shift']());}};_0x3f2bd4(++_0x2b6855);}(_0x7677,0x152));var _0x7767=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7677[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7767('0x0'));var util=require(_0x7767('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x3b6f72){utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x4'),_0x3b6f72[_0x7767('0x5')],_0x3b6f72[_0x7767('0x6')],_0x3b6f72[_0x7767('0x7')],_0x3b6f72[_0x7767('0x8')],_0x3b6f72['calleridnum'],_0x3b6f72[_0x7767('0x9')],_0x3b6f72[_0x7767('0xa')]));if(_0x3b6f72['queue']){utils[_0x7767('0xb')](_0x3b6f72[_0x7767('0x7')])['then'](function(_0x4b8c21){if(_0x4b8c21){_0x3b6f72[_0x7767('0xc')]=_0x4b8c21[_0x7767('0xc')];}utils['request'](_0x7767('0xd'),_0x3b6f72);});}else{utils['request'](_0x7767('0xd'),_0x3b6f72);}if(_0x3b6f72[_0x7767('0xe')]){delete queues[_0x3b6f72[_0x7767('0xe')]];}else{delete queues[_0x3b6f72[_0x7767('0x5')]];}}exports[_0x7767('0xf')]=function(_0x2ece44){try{utils[_0x7767('0x10')](util[_0x7767('0x3')](_0x7767('0x11'),_0x2ece44[_0x7767('0x5')]),_0x2ece44);utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x12'),_0x2ece44[_0x7767('0x5')],_0x2ece44[_0x7767('0x7')],_0x2ece44['position']));queues[_0x2ece44['uniqueid']]=_[_0x7767('0x13')](_0x2ece44,{'originalposition':_0x2ece44['position'],'queuecallerjoinAt':utils[_0x7767('0x14')](),'mohtime':0x0});}catch(_0x448a1b){utils[_0x7767('0x15')](util[_0x7767('0x3')](_0x7767('0x11'),_0x2ece44[_0x7767('0x5')]),_0x448a1b);}};exports['hangup']=function(_0x5ad456){try{if(!_[_0x7767('0x16')](queues[_0x5ad456[_0x7767('0x5')]])){utils['debug'](util[_0x7767('0x3')](_0x7767('0x17'),_0x5ad456[_0x7767('0x5')]),_0x5ad456);if(queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0x18')]){if(!queues[_0x5ad456['uniqueid']]['queuecallerabandon']&&!queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0x19')]){queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0x1a')]=!![];queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0x1b')]=utils[_0x7767('0x14')]();queues[_0x5ad456['uniqueid']][_0x7767('0xa')]=_0x7767('0x1c');}utils['info'](util[_0x7767('0x3')](_0x7767('0x1d'),_0x5ad456[_0x7767('0x5')],queues[_0x5ad456['uniqueid']][_0x7767('0x1e')],queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0xa')]));writeDB(queues[_0x5ad456[_0x7767('0x5')]]);}else if(queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0xe')]){utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x1f'),_0x5ad456['uniqueid'],queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0x1e')],queues[_0x5ad456[_0x7767('0x5')]]['transfereduniqueid']));queues[queues[_0x5ad456[_0x7767('0x5')]][_0x7767('0xe')]]=queues[_0x5ad456['uniqueid']];queues[queues[_0x5ad456['uniqueid']]['transfereduniqueid']][_0x7767('0x20')]=0x2;delete queues[_0x5ad456[_0x7767('0x5')]];}}}catch(_0x39189a){utils[_0x7767('0x15')](util['format'](_0x7767('0x17'),_0x5ad456[_0x7767('0x5')]),_0x39189a);}};exports[_0x7767('0x21')]=function(_0xfdf24d){try{utils[_0x7767('0x10')](util[_0x7767('0x3')](_0x7767('0x22'),_0xfdf24d[_0x7767('0x5')]),_0xfdf24d);if(!_[_0x7767('0x16')](_0xfdf24d[_0x7767('0x23')][_0x7767('0x24')])&&_0xfdf24d[_0x7767('0x25')][_0x7767('0x26')]()!=='CONTINUE'){if(!_[_0x7767('0x16')](queues[_0xfdf24d[_0x7767('0x5')]])){queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x27')]=![];queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x28')]=null;queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x19')]=!![];queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x29')]=utils[_0x7767('0x14')]();queues[_0xfdf24d['uniqueid']][_0x7767('0xa')]=_0xfdf24d[_0x7767('0x25')][_0x7767('0x26')]();utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x2a'),_0xfdf24d['uniqueid'],queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x1e')],_0xfdf24d[_0x7767('0x25')],queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0xa')]));writeDB(queues[_0xfdf24d[_0x7767('0x5')]]);}}else if(!_[_0x7767('0x16')](_0xfdf24d[_0x7767('0x23')][_0x7767('0x2b')])){if(!_['isNil'](queues[_0xfdf24d[_0x7767('0x5')]])&&!queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x27')]){queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x27')]=![];queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0x28')]=null;queues[_0xfdf24d['uniqueid']][_0x7767('0x19')]=!![];queues[_0xfdf24d['uniqueid']][_0x7767('0x29')]=utils['now']();queues[_0xfdf24d[_0x7767('0x5')]][_0x7767('0xa')]='EXITWITHKEY';utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x2c'),_0xfdf24d[_0x7767('0x5')],queues[_0xfdf24d['uniqueid']][_0x7767('0x1e')],_0xfdf24d['value'],queues[_0xfdf24d['uniqueid']][_0x7767('0xa')]));}}}catch(_0x25bf83){utils[_0x7767('0x15')](util['format'](_0x7767('0x22'),_0xfdf24d['uniqueid']),_0x25bf83);}};exports[_0x7767('0x27')]=function(_0x54b3e2){try{if(!_['isNil'](queues[_0x54b3e2['uniqueid']])){utils[_0x7767('0x10')](util['format'](_0x7767('0x2d'),_0x54b3e2[_0x7767('0x5')]),_0x54b3e2);queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0x19')]=![];queues[_0x54b3e2[_0x7767('0x5')]]['queuecallerexitAt']=null;queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0x27')]=!![];queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0x28')]=utils[_0x7767('0x14')]();queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0xa')]=_0x7767('0x2e');utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x2f'),_0x54b3e2[_0x7767('0x5')],queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0x1e')],queues[_0x54b3e2[_0x7767('0x5')]][_0x7767('0xa')]));}}catch(_0x282f2c){utils['error'](util['format']('[%s][queues][queuecallerabandon]',_0x54b3e2['uniqueid']),_0x282f2c);}};exports[_0x7767('0x30')]=function(_0x10e762){try{if(!_[_0x7767('0x16')](queues[_0x10e762[_0x7767('0x5')]])){utils['debug'](util[_0x7767('0x3')](_0x7767('0x31'),_0x10e762[_0x7767('0x5')]),_0x10e762);utils['info'](util[_0x7767('0x3')](_0x7767('0x32'),_0x10e762[_0x7767('0x5')],queues[_0x10e762[_0x7767('0x5')]]['name'],_0x10e762[_0x7767('0x33')],_0x10e762[_0x7767('0x34')]));queues[_0x10e762['uniqueid']]['queuecallerleave']=!![];queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x18')]=utils[_0x7767('0x14')]();queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x35')]=utils[_0x7767('0x36')](queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x18')],queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x37')]);queues[_0x10e762[_0x7767('0x5')]]['position']=_0x10e762['position'];queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x38')]=_0x10e762['count'];queues[_0x10e762[_0x7767('0x5')]]['connectedlinenum']=_0x10e762[_0x7767('0x33')];queues[_0x10e762[_0x7767('0x5')]][_0x7767('0x34')]=_0x10e762[_0x7767('0x34')];}}catch(_0x4c27ef){utils['error'](util[_0x7767('0x3')](_0x7767('0x31'),_0x10e762[_0x7767('0x5')]),_0x4c27ef);}};exports[_0x7767('0x39')]=function(_0x106a22){try{if(!_[_0x7767('0x16')](queues[_0x106a22[_0x7767('0x5')]])){utils['debug'](util[_0x7767('0x3')](_0x7767('0x3a'),_0x106a22['uniqueid']),_0x106a22);utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x3b'),_0x106a22['uniqueid'],queues[_0x106a22['uniqueid']]['name'],_0x106a22[_0x7767('0x3c')],_0x106a22[_0x7767('0x3d')]));queues[_0x106a22[_0x7767('0x5')]][_0x7767('0x27')]=![];queues[_0x106a22[_0x7767('0x5')]][_0x7767('0x27')]=![];queues[_0x106a22[_0x7767('0x5')]]['queuecallerabandonAt']=null;queues[_0x106a22[_0x7767('0x5')]][_0x7767('0x19')]=![];queues[_0x106a22[_0x7767('0x5')]][_0x7767('0xa')]=null;queues[_0x106a22[_0x7767('0x5')]][_0x7767('0x29')]=null;queues[_0x106a22[_0x7767('0x5')]][_0x7767('0x3e')]=!![];queues[_0x106a22[_0x7767('0x5')]]['accountcode']=_0x106a22[_0x7767('0x3d')];queues[_0x106a22['uniqueid']][_0x7767('0x8')]=_0x106a22['membername'];}}catch(_0x1c0be0){utils['error'](util[_0x7767('0x3')]('[%s][queues][agentconnect]',_0x106a22[_0x7767('0x5')]),_0x1c0be0);}};exports[_0x7767('0x3f')]=function(_0x4fad1b){try{if(!_[_0x7767('0x16')](queues[_0x4fad1b[_0x7767('0x5')]])){if(queues[_0x4fad1b[_0x7767('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0x7767('0x3')]('[%s][queues][agentcomplete]',_0x4fad1b[_0x7767('0x5')]),_0x4fad1b);queues[_0x4fad1b['uniqueid']][_0x7767('0x27')]=![];queues[_0x4fad1b[_0x7767('0x5')]]['queuecallerabandon']=![];queues[_0x4fad1b['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4fad1b[_0x7767('0x5')]][_0x7767('0x19')]=![];queues[_0x4fad1b[_0x7767('0x5')]][_0x7767('0x29')]=null;queues[_0x4fad1b['uniqueid']]['assigned']=!![];queues[_0x4fad1b[_0x7767('0x5')]][_0x7767('0x8')]=_0x4fad1b[_0x7767('0x3c')];queues[_0x4fad1b['uniqueid']][_0x7767('0x1a')]=!![];queues[_0x4fad1b['uniqueid']][_0x7767('0x1b')]=utils[_0x7767('0x14')]();if(_0x4fad1b['reason']==_0x7767('0x40')){if(!queues[_0x4fad1b[_0x7767('0x5')]]['transfer']){queues[_0x4fad1b['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x4fad1b[_0x7767('0x5')]]['queuecallerexitreason']=_0x7767('0x41')+_0x4fad1b[_0x7767('0x42')][_0x7767('0x26')]();}utils[_0x7767('0x2')](util[_0x7767('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4fad1b[_0x7767('0x5')],queues[_0x4fad1b['uniqueid']][_0x7767('0x1e')],_0x4fad1b[_0x7767('0x3c')],queues[_0x4fad1b['uniqueid']][_0x7767('0xa')]));writeDB(queues[_0x4fad1b[_0x7767('0x5')]]);}}}catch(_0x5414b9){utils[_0x7767('0x15')](util[_0x7767('0x3')](_0x7767('0x43'),_0x4fad1b[_0x7767('0x5')]),_0x5414b9);}};exports[_0x7767('0x44')]=function(_0x317b8b){try{if(!_[_0x7767('0x16')](queues[_0x317b8b[_0x7767('0x45')]])){utils[_0x7767('0x10')](util[_0x7767('0x3')](_0x7767('0x46'),_0x317b8b[_0x7767('0x5')]),_0x317b8b);queues[_0x317b8b[_0x7767('0x45')]][_0x7767('0x40')]=!![];queues[_0x317b8b[_0x7767('0x45')]]['transfertype']=_0x7767('0x47');queues[_0x317b8b[_0x7767('0x45')]][_0x7767('0x48')]=_0x317b8b[_0x7767('0x49')];queues[_0x317b8b['transfereeuniqueid']]['transferuniqueid']=_0x317b8b[_0x7767('0x45')];queues[_0x317b8b['transfereeuniqueid']][_0x7767('0xa')]='BLINDTRANSFER';utils[_0x7767('0x2')](util['format'](_0x7767('0x4a'),_0x317b8b[_0x7767('0x5')],queues[_0x317b8b[_0x7767('0x45')]][_0x7767('0x1e')],_0x317b8b[_0x7767('0x45')],_0x317b8b[_0x7767('0x49')]));}}catch(_0x58707c){utils[_0x7767('0x15')](util['format']('[%s][queues][blindtransfer]',_0x317b8b[_0x7767('0x5')]),_0x58707c);}};exports[_0x7767('0x4b')]=function(_0x3ae618){try{utils['debug'](util[_0x7767('0x3')](_0x7767('0x4c'),_0x3ae618[_0x7767('0x4d')]),_0x3ae618);if(_0x3ae618[_0x7767('0x4d')]==_0x3ae618[_0x7767('0x4e')]){if(!_[_0x7767('0x16')](queues[_0x3ae618[_0x7767('0x4f')]])){utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x50'),_0x3ae618['origtransfereruniqueid'],queues[_0x3ae618[_0x7767('0x4f')]]['name'],_0x3ae618[_0x7767('0x51')]));queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0x40')]=!![];queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0x52')]=_0x7767('0x53');queues[_0x3ae618['secondtransfererlinkedid']]['transferexten']=_0x3ae618[_0x7767('0x51')];queues[_0x3ae618['secondtransfererlinkedid']][_0x7767('0x54')]=_0x3ae618['origtransfereruniqueid'];queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0xa')]=_0x7767('0x55');}if(!_[_0x7767('0x16')](queues[_0x3ae618['origtransfererlinkedid']])){if(_0x3ae618[_0x7767('0x56')]&&queues[_0x3ae618[_0x7767('0x56')]]){queues[_0x3ae618[_0x7767('0x56')]]['queuecallerenterreason']=0x1;queues[_0x3ae618[_0x7767('0x45')]]=_['clone'](queues[_0x3ae618['transfereelinkedid']]);queues[_0x3ae618[_0x7767('0x45')]]['transfereduniqueid']=_0x3ae618[_0x7767('0x57')];queues[_0x3ae618['transfereeuniqueid']][_0x7767('0x20')]=0x2;queues[_0x3ae618['transfereeuniqueid']][_0x7767('0x58')]=queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0x58')];queues[_0x3ae618['transfereeuniqueid']][_0x7767('0x59')]=queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0x59')];queues[_0x3ae618[_0x7767('0x45')]]['queuecallerjoinAt']=utils[_0x7767('0x14')]();queues[_0x3ae618[_0x7767('0x45')]][_0x7767('0x18')]=utils[_0x7767('0x14')]();queues[_0x3ae618[_0x7767('0x45')]][_0x7767('0x35')]=0x0;queues[_0x3ae618[_0x7767('0x45')]][_0x7767('0x5a')]=0x0;utils[_0x7767('0x2')](util[_0x7767('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x3ae618['origtransfereruniqueid'],queues[_0x3ae618[_0x7767('0x45')]][_0x7767('0x1e')],queues[_0x3ae618['transfereeuniqueid']][_0x7767('0x58')],queues[_0x3ae618[_0x7767('0x45')]]['calleridname']));}else{utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x5b'),_0x3ae618[_0x7767('0x4d')],queues[_0x3ae618['origtransfererlinkedid']][_0x7767('0x1e')],_0x3ae618[_0x7767('0x4f')]));queues[_0x3ae618[_0x7767('0x4e')]]['transfereduniqueid']=_0x3ae618[_0x7767('0x4f')];}}}else if(_0x3ae618[_0x7767('0x5c')]==_0x3ae618[_0x7767('0x4f')]){if(!_['isNil'](queues[_0x3ae618[_0x7767('0x4e')]])){utils['info'](util[_0x7767('0x3')](_0x7767('0x5d'),_0x3ae618[_0x7767('0x4d')],queues[_0x3ae618[_0x7767('0x4e')]][_0x7767('0x1e')],_0x3ae618[_0x7767('0x5c')],_0x3ae618['secondtransfererexten']));queues[_0x3ae618[_0x7767('0x4e')]][_0x7767('0x40')]=!![];queues[_0x3ae618[_0x7767('0x4e')]]['transfertype']='ATTENDED';queues[_0x3ae618[_0x7767('0x4e')]]['transferexten']=_0x3ae618[_0x7767('0x5e')];queues[_0x3ae618[_0x7767('0x4e')]]['transferuniqueid']=_0x3ae618[_0x7767('0x5c')];queues[_0x3ae618[_0x7767('0x4e')]][_0x7767('0xa')]=_0x7767('0x55');}if(!_[_0x7767('0x16')](queues[_0x3ae618[_0x7767('0x4f')]])){if(_0x3ae618[_0x7767('0x5f')]&&queues[_0x3ae618[_0x7767('0x5f')]]){queues[_0x3ae618[_0x7767('0x5f')]][_0x7767('0x20')]=0x1;queues[_0x3ae618[_0x7767('0x57')]]=_[_0x7767('0x60')](queues[_0x3ae618['transfertargetlinkedid']]);queues[_0x3ae618[_0x7767('0x57')]]['transfereduniqueid']=_0x3ae618[_0x7767('0x57')];queues[_0x3ae618['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3ae618['transfertargetuniqueid']][_0x7767('0x58')]=queues[_0x3ae618['origtransfererlinkedid']][_0x7767('0x58')];queues[_0x3ae618[_0x7767('0x57')]]['calleridname']=queues[_0x3ae618['origtransfererlinkedid']][_0x7767('0x59')];queues[_0x3ae618[_0x7767('0x57')]][_0x7767('0x37')]=utils['now']();queues[_0x3ae618[_0x7767('0x57')]]['queuecallerleaveAt']=utils['now']();queues[_0x3ae618['transfertargetuniqueid']][_0x7767('0x35')]=0x0;queues[_0x3ae618[_0x7767('0x57')]][_0x7767('0x5a')]=0x0;utils[_0x7767('0x2')](util[_0x7767('0x3')](_0x7767('0x61'),_0x3ae618[_0x7767('0x4d')],queues[_0x3ae618['transfertargetuniqueid']][_0x7767('0x1e')],queues[_0x3ae618[_0x7767('0x57')]][_0x7767('0xe')],queues[_0x3ae618['transfertargetuniqueid']][_0x7767('0x58')],queues[_0x3ae618[_0x7767('0x57')]][_0x7767('0x59')]));}else{utils[_0x7767('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3ae618['origtransfereruniqueid'],queues[_0x3ae618[_0x7767('0x4f')]][_0x7767('0x1e')],_0x3ae618['origtransfererlinkedid']));queues[_0x3ae618[_0x7767('0x4f')]]['transfereduniqueid']=_0x3ae618['origtransfererlinkedid'];}}}}catch(_0x2c9b06){utils[_0x7767('0x15')](util[_0x7767('0x3')]('[%s][queues][attendedtransfer]',_0x3ae618[_0x7767('0x4d')]),_0x2c9b06);}};exports['musiconholdstart']=function(_0x5de7f){try{if(!_[_0x7767('0x16')](queues[_0x5de7f[_0x7767('0x5')]])){utils['debug'](util[_0x7767('0x3')](_0x7767('0x62'),_0x5de7f[_0x7767('0x5')]),_0x5de7f);queues[_0x5de7f[_0x7767('0x5')]]['musiconholdstartAt']=utils[_0x7767('0x14')]();utils['info'](util[_0x7767('0x3')](_0x7767('0x63'),_0x5de7f[_0x7767('0x5')],queues[_0x5de7f[_0x7767('0x5')]][_0x7767('0x1e')],queues[_0x5de7f['uniqueid']]['musiconholdstartAt']));}}catch(_0x5e0ef6){utils['error'](util[_0x7767('0x3')](_0x7767('0x62'),_0x5de7f[_0x7767('0x5')]),_0x5e0ef6);}};exports[_0x7767('0x64')]=function(_0x499c23){try{if(!_[_0x7767('0x16')](queues[_0x499c23['uniqueid']])){if(!_[_0x7767('0x16')](queues[_0x499c23['uniqueid']][_0x7767('0x65')])){utils[_0x7767('0x10')](util[_0x7767('0x3')](_0x7767('0x66'),_0x499c23[_0x7767('0x5')]),_0x499c23);queues[_0x499c23[_0x7767('0x5')]][_0x7767('0x5a')]+=utils[_0x7767('0x36')](utils['now'](),queues[_0x499c23[_0x7767('0x5')]][_0x7767('0x65')]);utils[_0x7767('0x2')](util[_0x7767('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x499c23['uniqueid'],queues[_0x499c23[_0x7767('0x5')]]['name'],queues[_0x499c23[_0x7767('0x5')]][_0x7767('0x5a')]));delete queues[_0x499c23[_0x7767('0x5')]][_0x7767('0x65')];}}}catch(_0x31dc9d){utils['error'](util[_0x7767('0x3')](_0x7767('0x66'),_0x499c23[_0x7767('0x5')]),_0x31dc9d);}}; \ No newline at end of file +var _0x782c=['now','error','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','queuecallerabandonAt','toUpperCase','value','queueposition','queuecallerexitAt','EXITWITHKEY','debug','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfer','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','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','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign'];(function(_0x124728,_0x463dca){var _0x8eb20f=function(_0x49d9de){while(--_0x49d9de){_0x124728['push'](_0x124728['shift']());}};_0x8eb20f(++_0x463dca);}(_0x782c,0x11b));var _0xc782=function(_0x5c0aab,_0x53e2e4){_0x5c0aab=_0x5c0aab-0x0;var _0x4866ec=_0x782c[_0x5c0aab];return _0x4866ec;};'use strict';var _=require(_0xc782('0x0'));var util=require(_0xc782('0x1'));var utils=require(_0xc782('0x2'));var queues={};function writeDB(_0x4e9d16){utils[_0xc782('0x3')](util['format'](_0xc782('0x4'),_0x4e9d16[_0xc782('0x5')],_0x4e9d16[_0xc782('0x6')],_0x4e9d16[_0xc782('0x7')],_0x4e9d16[_0xc782('0x8')],_0x4e9d16[_0xc782('0x9')],_0x4e9d16[_0xc782('0xa')],_0x4e9d16[_0xc782('0xb')]));if(_0x4e9d16[_0xc782('0x7')]){utils[_0xc782('0xc')](_0x4e9d16['queue'])['then'](function(_0x2bac81){if(_0x2bac81){_0x4e9d16[_0xc782('0xd')]=_0x2bac81[_0xc782('0xd')];}utils[_0xc782('0xe')](_0xc782('0xf'),_0x4e9d16);});}else{utils[_0xc782('0xe')](_0xc782('0xf'),_0x4e9d16);}if(_0x4e9d16[_0xc782('0x10')]){delete queues[_0x4e9d16[_0xc782('0x10')]];}else{delete queues[_0x4e9d16['uniqueid']];}}exports[_0xc782('0x11')]=function(_0x5a05b3){try{utils['debug'](util[_0xc782('0x12')](_0xc782('0x13'),_0x5a05b3['uniqueid']),_0x5a05b3);utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x14'),_0x5a05b3[_0xc782('0x5')],_0x5a05b3[_0xc782('0x7')],_0x5a05b3[_0xc782('0x15')]));queues[_0x5a05b3[_0xc782('0x5')]]=_[_0xc782('0x16')](_0x5a05b3,{'originalposition':_0x5a05b3[_0xc782('0x15')],'queuecallerjoinAt':utils[_0xc782('0x17')](),'mohtime':0x0});}catch(_0x4a89b1){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x13'),_0x5a05b3['uniqueid']),_0x4a89b1);}};exports['hangup']=function(_0xdf50cb){try{if(!_['isNil'](queues[_0xdf50cb[_0xc782('0x5')]])){utils['debug'](util[_0xc782('0x12')]('[%s][queues][hangup]',_0xdf50cb[_0xc782('0x5')]),_0xdf50cb);if(queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x19')]){if(!queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x1a')]&&!queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x1b')]){queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x1c')]=!![];queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x1d')]=utils[_0xc782('0x17')]();queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0xb')]=_0xc782('0x1e');}utils['info'](util[_0xc782('0x12')](_0xc782('0x1f'),_0xdf50cb[_0xc782('0x5')],queues[_0xdf50cb['uniqueid']][_0xc782('0x20')],queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0xb')]));writeDB(queues[_0xdf50cb[_0xc782('0x5')]]);}else if(queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x10')]){utils['info'](util[_0xc782('0x12')](_0xc782('0x21'),_0xdf50cb[_0xc782('0x5')],queues[_0xdf50cb[_0xc782('0x5')]]['name'],queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x10')]));queues[queues[_0xdf50cb[_0xc782('0x5')]][_0xc782('0x10')]]=queues[_0xdf50cb[_0xc782('0x5')]];queues[queues[_0xdf50cb['uniqueid']][_0xc782('0x10')]][_0xc782('0x22')]=0x2;delete queues[_0xdf50cb[_0xc782('0x5')]];}}}catch(_0x42663a){utils[_0xc782('0x18')](util[_0xc782('0x12')]('[%s][queues][hangup]',_0xdf50cb[_0xc782('0x5')]),_0x42663a);}};exports[_0xc782('0x23')]=function(_0x44eba9){try{utils['debug'](util[_0xc782('0x12')](_0xc782('0x24'),_0x44eba9[_0xc782('0x5')]),_0x44eba9);if(!_[_0xc782('0x25')](_0x44eba9[_0xc782('0x26')][_0xc782('0x27')])&&_0x44eba9['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0xc782('0x25')](queues[_0x44eba9[_0xc782('0x5')]])){queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x1a')]=![];queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x28')]=null;queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x1b')]=!![];queues[_0x44eba9[_0xc782('0x5')]]['queuecallerexitAt']=utils[_0xc782('0x17')]();queues[_0x44eba9['uniqueid']][_0xc782('0xb')]=_0x44eba9['value'][_0xc782('0x29')]();utils[_0xc782('0x3')](util[_0xc782('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x44eba9['uniqueid'],queues[_0x44eba9['uniqueid']][_0xc782('0x20')],_0x44eba9[_0xc782('0x2a')],queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0xb')]));writeDB(queues[_0x44eba9[_0xc782('0x5')]]);}}else if(!_['isNil'](_0x44eba9[_0xc782('0x26')][_0xc782('0x2b')])){if(!_[_0xc782('0x25')](queues[_0x44eba9[_0xc782('0x5')]])&&!queues[_0x44eba9[_0xc782('0x5')]]['queuecallerabandon']){queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x1a')]=![];queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x28')]=null;queues[_0x44eba9[_0xc782('0x5')]]['queuecallerexit']=!![];queues[_0x44eba9['uniqueid']][_0xc782('0x2c')]=utils[_0xc782('0x17')]();queues[_0x44eba9['uniqueid']][_0xc782('0xb')]=_0xc782('0x2d');utils[_0xc782('0x3')](util[_0xc782('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x44eba9[_0xc782('0x5')],queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0x20')],_0x44eba9[_0xc782('0x2a')],queues[_0x44eba9[_0xc782('0x5')]][_0xc782('0xb')]));}}}catch(_0x4318d7){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x24'),_0x44eba9[_0xc782('0x5')]),_0x4318d7);}};exports[_0xc782('0x1a')]=function(_0x5bbbdb){try{if(!_[_0xc782('0x25')](queues[_0x5bbbdb[_0xc782('0x5')]])){utils[_0xc782('0x2e')](util['format'](_0xc782('0x2f'),_0x5bbbdb['uniqueid']),_0x5bbbdb);queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0x1b')]=![];queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0x2c')]=null;queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0x1a')]=!![];queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0x28')]=utils[_0xc782('0x17')]();queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0xb')]=_0xc782('0x30');utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x31'),_0x5bbbdb[_0xc782('0x5')],queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0x20')],queues[_0x5bbbdb[_0xc782('0x5')]][_0xc782('0xb')]));}}catch(_0x339f46){utils['error'](util[_0xc782('0x12')](_0xc782('0x2f'),_0x5bbbdb[_0xc782('0x5')]),_0x339f46);}};exports['queuecallerleave']=function(_0x20303d){try{if(!_['isNil'](queues[_0x20303d[_0xc782('0x5')]])){utils[_0xc782('0x2e')](util[_0xc782('0x12')](_0xc782('0x32'),_0x20303d[_0xc782('0x5')]),_0x20303d);utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x33'),_0x20303d[_0xc782('0x5')],queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x20')],_0x20303d[_0xc782('0x34')],_0x20303d[_0xc782('0x35')]));queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x36')]=!![];queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x19')]=utils[_0xc782('0x17')]();queues[_0x20303d[_0xc782('0x5')]]['holdtime']=utils[_0xc782('0x37')](queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x19')],queues[_0x20303d['uniqueid']][_0xc782('0x38')]);queues[_0x20303d['uniqueid']][_0xc782('0x15')]=_0x20303d[_0xc782('0x15')];queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x39')]=_0x20303d[_0xc782('0x39')];queues[_0x20303d[_0xc782('0x5')]][_0xc782('0x34')]=_0x20303d[_0xc782('0x34')];queues[_0x20303d['uniqueid']][_0xc782('0x35')]=_0x20303d[_0xc782('0x35')];}}catch(_0x5e477b){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x32'),_0x20303d[_0xc782('0x5')]),_0x5e477b);}};exports[_0xc782('0x3a')]=function(_0xaec94b){try{if(!_[_0xc782('0x25')](queues[_0xaec94b[_0xc782('0x5')]])){utils[_0xc782('0x2e')](util[_0xc782('0x12')](_0xc782('0x3b'),_0xaec94b[_0xc782('0x5')]),_0xaec94b);utils['info'](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xaec94b[_0xc782('0x5')],queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x20')],_0xaec94b[_0xc782('0x3c')],_0xaec94b[_0xc782('0x3d')]));queues[_0xaec94b[_0xc782('0x5')]]['queuecallerabandon']=![];queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x1a')]=![];queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x28')]=null;queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x1b')]=![];queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0xb')]=null;queues[_0xaec94b[_0xc782('0x5')]]['queuecallerexitAt']=null;queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x3e')]=!![];queues[_0xaec94b[_0xc782('0x5')]]['accountcode']=_0xaec94b[_0xc782('0x3d')];queues[_0xaec94b[_0xc782('0x5')]][_0xc782('0x8')]=_0xaec94b['membername'];}}catch(_0xd5450d){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x3b'),_0xaec94b[_0xc782('0x5')]),_0xd5450d);}};exports[_0xc782('0x3f')]=function(_0x57e6c6){try{if(!_[_0xc782('0x25')](queues[_0x57e6c6[_0xc782('0x5')]])){if(queues[_0x57e6c6[_0xc782('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0xc782('0x12')](_0xc782('0x40'),_0x57e6c6[_0xc782('0x5')]),_0x57e6c6);queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x1a')]=![];queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x1a')]=![];queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x28')]=null;queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x1b')]=![];queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x2c')]=null;queues[_0x57e6c6[_0xc782('0x5')]]['assigned']=!![];queues[_0x57e6c6['uniqueid']][_0xc782('0x8')]=_0x57e6c6[_0xc782('0x3c')];queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x1c')]=!![];queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x1d')]=utils[_0xc782('0x17')]();if(_0x57e6c6[_0xc782('0x41')]=='transfer'){if(!queues[_0x57e6c6[_0xc782('0x5')]]['transfer']){queues[_0x57e6c6[_0xc782('0x5')]]['queuecallerexitreason']=_0xc782('0x42');}}else{queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0xb')]='COMPLETEDBY'+_0x57e6c6[_0xc782('0x41')]['toUpperCase']();}utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x43'),_0x57e6c6[_0xc782('0x5')],queues[_0x57e6c6[_0xc782('0x5')]][_0xc782('0x20')],_0x57e6c6[_0xc782('0x3c')],queues[_0x57e6c6[_0xc782('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x57e6c6[_0xc782('0x5')]]);}}}catch(_0x58ad3a){utils[_0xc782('0x18')](util['format']('[%s][queues][agentcomplete]',_0x57e6c6['uniqueid']),_0x58ad3a);}};exports['blindtransfer']=function(_0x5c6802){try{if(!_[_0xc782('0x25')](queues[_0x5c6802['transfereeuniqueid']])){utils['debug'](util['format'](_0xc782('0x44'),_0x5c6802['uniqueid']),_0x5c6802);queues[_0x5c6802[_0xc782('0x45')]]['transfer']=!![];queues[_0x5c6802['transfereeuniqueid']][_0xc782('0x46')]='BLIND';queues[_0x5c6802['transfereeuniqueid']][_0xc782('0x47')]=_0x5c6802[_0xc782('0x48')];queues[_0x5c6802[_0xc782('0x45')]][_0xc782('0x49')]=_0x5c6802['transfereeuniqueid'];queues[_0x5c6802[_0xc782('0x45')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x4a'),_0x5c6802[_0xc782('0x5')],queues[_0x5c6802['transfereeuniqueid']][_0xc782('0x20')],_0x5c6802[_0xc782('0x45')],_0x5c6802[_0xc782('0x48')]));}}catch(_0x252c58){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x44'),_0x5c6802[_0xc782('0x5')]),_0x252c58);}};exports['attendedtransfer']=function(_0x47e139){try{utils[_0xc782('0x2e')](util[_0xc782('0x12')]('[%s][queues][attendedtransfer]',_0x47e139[_0xc782('0x4b')]),_0x47e139);if(_0x47e139[_0xc782('0x4b')]==_0x47e139[_0xc782('0x4c')]){if(!_['isNil'](queues[_0x47e139[_0xc782('0x4d')]])){utils['info'](util[_0xc782('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x47e139[_0xc782('0x4b')],queues[_0x47e139['secondtransfererlinkedid']]['name'],_0x47e139[_0xc782('0x4e')]));queues[_0x47e139[_0xc782('0x4d')]][_0xc782('0x4f')]=!![];queues[_0x47e139[_0xc782('0x4d')]]['transfertype']=_0xc782('0x50');queues[_0x47e139['secondtransfererlinkedid']][_0xc782('0x47')]=_0x47e139[_0xc782('0x4e')];queues[_0x47e139['secondtransfererlinkedid']][_0xc782('0x49')]=_0x47e139[_0xc782('0x4b')];queues[_0x47e139[_0xc782('0x4d')]][_0xc782('0xb')]=_0xc782('0x51');}if(!_[_0xc782('0x25')](queues[_0x47e139[_0xc782('0x4c')]])){if(_0x47e139[_0xc782('0x52')]&&queues[_0x47e139['transfereelinkedid']]){queues[_0x47e139['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x47e139[_0xc782('0x45')]]=_[_0xc782('0x53')](queues[_0x47e139[_0xc782('0x52')]]);queues[_0x47e139[_0xc782('0x45')]]['transfereduniqueid']=_0x47e139[_0xc782('0x54')];queues[_0x47e139[_0xc782('0x45')]][_0xc782('0x22')]=0x2;queues[_0x47e139['transfereeuniqueid']][_0xc782('0x9')]=queues[_0x47e139[_0xc782('0x4d')]][_0xc782('0x9')];queues[_0x47e139['transfereeuniqueid']][_0xc782('0x55')]=queues[_0x47e139['secondtransfererlinkedid']][_0xc782('0x55')];queues[_0x47e139['transfereeuniqueid']][_0xc782('0x38')]=utils[_0xc782('0x17')]();queues[_0x47e139[_0xc782('0x45')]][_0xc782('0x19')]=utils['now']();queues[_0x47e139[_0xc782('0x45')]][_0xc782('0x56')]=0x0;queues[_0x47e139['transfereeuniqueid']][_0xc782('0x57')]=0x0;utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x58'),_0x47e139[_0xc782('0x4b')],queues[_0x47e139[_0xc782('0x45')]][_0xc782('0x20')],queues[_0x47e139[_0xc782('0x45')]]['calleridnum'],queues[_0x47e139[_0xc782('0x45')]][_0xc782('0x55')]));}else{utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x59'),_0x47e139['origtransfereruniqueid'],queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x20')],_0x47e139[_0xc782('0x4d')]));queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x10')]=_0x47e139[_0xc782('0x4d')];}}}else if(_0x47e139[_0xc782('0x5a')]==_0x47e139[_0xc782('0x4d')]){if(!_[_0xc782('0x25')](queues[_0x47e139[_0xc782('0x4c')]])){utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x5b'),_0x47e139['origtransfereruniqueid'],queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x20')],_0x47e139[_0xc782('0x5a')],_0x47e139[_0xc782('0x5c')]));queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x4f')]=!![];queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x46')]='ATTENDED';queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0x47')]=_0x47e139[_0xc782('0x5c')];queues[_0x47e139[_0xc782('0x4c')]]['transferuniqueid']=_0x47e139[_0xc782('0x5a')];queues[_0x47e139[_0xc782('0x4c')]][_0xc782('0xb')]=_0xc782('0x51');}if(!_[_0xc782('0x25')](queues[_0x47e139[_0xc782('0x4d')]])){if(_0x47e139['transfertargetlinkedid']&&queues[_0x47e139[_0xc782('0x5d')]]){queues[_0x47e139[_0xc782('0x5d')]][_0xc782('0x22')]=0x1;queues[_0x47e139[_0xc782('0x54')]]=_[_0xc782('0x53')](queues[_0x47e139[_0xc782('0x5d')]]);queues[_0x47e139[_0xc782('0x54')]]['transfereduniqueid']=_0x47e139[_0xc782('0x54')];queues[_0x47e139['transfertargetuniqueid']][_0xc782('0x22')]=0x2;queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x9')]=queues[_0x47e139['origtransfererlinkedid']][_0xc782('0x9')];queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x55')]=queues[_0x47e139[_0xc782('0x4c')]]['calleridname'];queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x38')]=utils[_0xc782('0x17')]();queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x19')]=utils[_0xc782('0x17')]();queues[_0x47e139[_0xc782('0x54')]]['holdtime']=0x0;queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x57')]=0x0;utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x5e'),_0x47e139[_0xc782('0x4b')],queues[_0x47e139[_0xc782('0x54')]]['name'],queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x10')],queues[_0x47e139[_0xc782('0x54')]][_0xc782('0x9')],queues[_0x47e139[_0xc782('0x54')]]['calleridname']));}else{utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x59'),_0x47e139[_0xc782('0x4b')],queues[_0x47e139[_0xc782('0x4d')]][_0xc782('0x20')],_0x47e139[_0xc782('0x4c')]));queues[_0x47e139[_0xc782('0x4d')]][_0xc782('0x10')]=_0x47e139[_0xc782('0x4c')];}}}}catch(_0x1185ef){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x5f'),_0x47e139['origtransfereruniqueid']),_0x1185ef);}};exports[_0xc782('0x60')]=function(_0x24d1f4){try{if(!_['isNil'](queues[_0x24d1f4[_0xc782('0x5')]])){utils['debug'](util[_0xc782('0x12')]('[%s][queues][musiconholdstart]',_0x24d1f4['uniqueid']),_0x24d1f4);queues[_0x24d1f4[_0xc782('0x5')]]['musiconholdstartAt']=utils[_0xc782('0x17')]();utils['info'](util[_0xc782('0x12')](_0xc782('0x61'),_0x24d1f4['uniqueid'],queues[_0x24d1f4['uniqueid']][_0xc782('0x20')],queues[_0x24d1f4[_0xc782('0x5')]][_0xc782('0x62')]));}}catch(_0x52b77f){utils[_0xc782('0x18')](util[_0xc782('0x12')]('[%s][queues][musiconholdstart]',_0x24d1f4[_0xc782('0x5')]),_0x52b77f);}};exports[_0xc782('0x63')]=function(_0x1c9096){try{if(!_[_0xc782('0x25')](queues[_0x1c9096['uniqueid']])){if(!_['isNil'](queues[_0x1c9096[_0xc782('0x5')]][_0xc782('0x62')])){utils[_0xc782('0x2e')](util[_0xc782('0x12')](_0xc782('0x64'),_0x1c9096['uniqueid']),_0x1c9096);queues[_0x1c9096[_0xc782('0x5')]][_0xc782('0x57')]+=utils[_0xc782('0x37')](utils['now'](),queues[_0x1c9096[_0xc782('0x5')]]['musiconholdstartAt']);utils[_0xc782('0x3')](util[_0xc782('0x12')](_0xc782('0x65'),_0x1c9096['uniqueid'],queues[_0x1c9096[_0xc782('0x5')]][_0xc782('0x20')],queues[_0x1c9096[_0xc782('0x5')]][_0xc782('0x57')]));delete queues[_0x1c9096['uniqueid']][_0xc782('0x62')];}}}catch(_0x388991){utils[_0xc782('0x18')](util[_0xc782('0x12')](_0xc782('0x64'),_0x1c9096[_0xc782('0x5')]),_0x388991);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 244b953..7d04833 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 _0xae91=['uniqueid','transfereeuniqueid','accountcode','then','membername','name','request','CreateVoiceRecording','blinds','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','value','endsWith','replace','.WAV','find','monitors','push','error','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]'];(function(_0x3bfa25,_0x1c881a){var _0x387ab4=function(_0x13aa56){while(--_0x13aa56){_0x3bfa25['push'](_0x3bfa25['shift']());}};_0x387ab4(++_0x1c881a);}(_0xae91,0x16b));var _0x1ae9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xae91[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1ae9('0x0'));var util=require(_0x1ae9('0x1'));var utils=require(_0x1ae9('0x2'));var transfers=require(_0x1ae9('0x3'));var recordings={};function writeDB(_0x536284){var _0x2830bf;utils[_0x1ae9('0x4')](util[_0x1ae9('0x5')](_0x1ae9('0x6'),_0x536284['uniqueid']));if(transfers['blinds'][_0x536284['uniqueid']]){_0x2830bf=_0x536284['uniqueid'];_0x536284[_0x1ae9('0x7')]=transfers['blinds'][_0x536284[_0x1ae9('0x7')]][_0x1ae9('0x8')];}if(_0x536284[_0x1ae9('0x9')]){utils['getUserByInternal'](_0x536284[_0x1ae9('0x9')])[_0x1ae9('0xa')](function(_0x3c8825){if(_0x3c8825){_0x536284[_0x1ae9('0xb')]=_0x3c8825[_0x1ae9('0xc')];_0x536284['UserId']=_0x3c8825['id'];}utils[_0x1ae9('0xd')](_0x1ae9('0xe'),_0x536284);});}else{utils['request']('CreateVoiceRecording',_0x536284);}if(_0x2830bf)delete transfers[_0x1ae9('0xf')][_0x2830bf];}exports[_0x1ae9('0x10')]=function(_0x270c0f){try{utils['debug'](util[_0x1ae9('0x5')](_0x1ae9('0x11'),_0x270c0f['uniqueid']),_0x270c0f);if(_0x270c0f[_0x1ae9('0x7')]==_0x270c0f[_0x1ae9('0x12')]){utils[_0x1ae9('0x4')](util[_0x1ae9('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x270c0f[_0x1ae9('0x7')],_0x270c0f[_0x1ae9('0x13')],_0x270c0f[_0x1ae9('0x14')]));recordings[_0x270c0f[_0x1ae9('0x7')]]={'uniqueid':_0x270c0f[_0x1ae9('0x7')],'accountcode':_0x270c0f['accountcode'],'exten':_0x270c0f['exten'],'context':_0x270c0f[_0x1ae9('0x13')],'channel':_0x270c0f['channel'],'monitors':[]};}}catch(_0x3fa844){utils['error'](util[_0x1ae9('0x5')](_0x1ae9('0x11'),_0x270c0f['uniqueid']),_0x3fa844);}};exports[_0x1ae9('0x15')]=function(_0x45f5c0){try{utils[_0x1ae9('0x16')](util[_0x1ae9('0x5')](_0x1ae9('0x17'),_0x45f5c0['uniqueid']),_0x45f5c0);if(!_[_0x1ae9('0x18')](recordings[_0x45f5c0['uniqueid']])&&_0x45f5c0[_0x1ae9('0x19')]==0x6){utils['info'](util[_0x1ae9('0x5')](_0x1ae9('0x1a'),_0x45f5c0['uniqueid'],_0x45f5c0[_0x1ae9('0x13')],_0x45f5c0[_0x1ae9('0x1b')]));}else if(!_[_0x1ae9('0x18')](recordings[_0x45f5c0[_0x1ae9('0x12')]])&&_0x45f5c0['channelstate']==0x6&&_0x45f5c0[_0x1ae9('0x13')]!=_0x1ae9('0x1c')){utils[_0x1ae9('0x4')](util['format'](_0x1ae9('0x1d'),_0x45f5c0[_0x1ae9('0x7')],_0x45f5c0[_0x1ae9('0x12')],_0x45f5c0[_0x1ae9('0x13')],_0x45f5c0[_0x1ae9('0x1b')]));recordings[_0x45f5c0['linkedid']]['accountcode']=_0x45f5c0[_0x1ae9('0x9')];}}catch(_0xb8c1c7){utils['error'](util[_0x1ae9('0x5')](_0x1ae9('0x17'),_0x45f5c0[_0x1ae9('0x7')]),_0xb8c1c7);}};exports[_0x1ae9('0x1e')]=function(_0x3c8410){try{if(!_[_0x1ae9('0x18')](_0x3c8410[_0x1ae9('0x1f')])&&!_[_0x1ae9('0x18')](_0x3c8410[_0x1ae9('0x1f')]['mixmonitor_filename'])){utils['debug'](util[_0x1ae9('0x5')]('[%s][recordings][varset]',_0x3c8410['uniqueid']),_0x3c8410);utils[_0x1ae9('0x4')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3c8410[_0x1ae9('0x7')],_0x3c8410[_0x1ae9('0x1f')],_0x3c8410[_0x1ae9('0x20')]));if(_[_0x1ae9('0x21')](_0x3c8410['value'],'.wav49')){_0x3c8410[_0x1ae9('0x20')]=_0x3c8410[_0x1ae9('0x20')][_0x1ae9('0x22')]('.wav49',_0x1ae9('0x23'));}if(recordings[_0x3c8410[_0x1ae9('0x12')]]){var _0x49ebb4=_[_0x1ae9('0x24')](recordings[_0x3c8410[_0x1ae9('0x12')]][_0x1ae9('0x25')],{'value':_0x3c8410[_0x1ae9('0x20')]});if(_[_0x1ae9('0x18')](_0x49ebb4)){recordings[_0x3c8410[_0x1ae9('0x12')]][_0x1ae9('0x25')][_0x1ae9('0x26')]({'value':_0x3c8410[_0x1ae9('0x20')]});}}}}catch(_0x265388){utils[_0x1ae9('0x27')](util[_0x1ae9('0x5')](_0x1ae9('0x28'),_0x3c8410[_0x1ae9('0x7')]),_0x265388);}};exports[_0x1ae9('0x29')]=function(_0xe250e){try{if(!_[_0x1ae9('0x18')](recordings[_0xe250e['uniqueid']])){utils[_0x1ae9('0x16')](util[_0x1ae9('0x5')](_0x1ae9('0x2a'),_0xe250e[_0x1ae9('0x7')]),_0xe250e);utils[_0x1ae9('0x4')](util[_0x1ae9('0x5')](_0x1ae9('0x2b'),_0xe250e[_0x1ae9('0x7')],_0xe250e['calleridnum'],_0xe250e[_0x1ae9('0x2c')],_0xe250e[_0x1ae9('0x2d')]));recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x2e')]=_0xe250e['calleridnum'];recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x2c')]=_0xe250e['calleridname'];recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x2f')]=_0xe250e[_0x1ae9('0x2f')];recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x30')]=_0xe250e['connectedlinename'];if(recordings[_0xe250e[_0x1ae9('0x7')]]['type']==_0x1ae9('0x31')&&recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x9')]){recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x2f')]=recordings[_0xe250e[_0x1ae9('0x7')]][_0x1ae9('0x9')];recordings[_0xe250e['uniqueid']][_0x1ae9('0x30')]='';}recordings[_0xe250e['uniqueid']][_0x1ae9('0x25')][_0x1ae9('0x32')](function(_0x3e8943){var _0x2817d2=_[_0x1ae9('0x33')](recordings[_0xe250e[_0x1ae9('0x7')]]);_0x2817d2[_0x1ae9('0x20')]=_0x3e8943[_0x1ae9('0x20')];writeDB(_0x2817d2);});delete recordings[_0xe250e[_0x1ae9('0x7')]];}}catch(_0x4e2ad6){utils[_0x1ae9('0x27')](util['format'](_0x1ae9('0x2a'),_0xe250e['uniqueid']),_0x4e2ad6);}};exports[_0x1ae9('0x34')]=function(_0x3b9639){try{if(!_[_0x1ae9('0x18')](recordings[_0x3b9639[_0x1ae9('0x7')]])){utils[_0x1ae9('0x16')](util['format'](_0x1ae9('0x35'),_0x3b9639['uniqueid']),_0x3b9639);utils['info'](util[_0x1ae9('0x5')](_0x1ae9('0x36'),_0x3b9639[_0x1ae9('0x7')],_0x3b9639[_0x1ae9('0x37')],_0x3b9639[_0x1ae9('0x38')]));if(_0x3b9639[_0x1ae9('0x37')][_0x1ae9('0x39')]()==_0x1ae9('0x3a')&&_[_0x1ae9('0x3b')](_0x3b9639[_0x1ae9('0x38')][_0x1ae9('0x39')](),_0x1ae9('0x3c'))){var _0x48bd28=_0x3b9639[_0x1ae9('0x38')][_0x1ae9('0x3d')]('=');var _0x2a59b4=_0x48bd28[0x0][_0x1ae9('0x3e')](_0x48bd28[0x0][_0x1ae9('0x3f')]('(')+0x1,_0x48bd28[0x0][_0x1ae9('0x3f')](')'));var _0x246a5f=_0x48bd28[0x1];recordings[_0x3b9639['uniqueid']][_0x2a59b4]=_0x246a5f;}}}catch(_0x580cdb){utils[_0x1ae9('0x27')](util[_0x1ae9('0x5')](_0x1ae9('0x35'),_0x3b9639['uniqueid']),_0x580cdb);}};exports['queuecallerjoin']=function(_0x2a1c0e){try{if(!_[_0x1ae9('0x18')](recordings[_0x2a1c0e[_0x1ae9('0x7')]])){utils[_0x1ae9('0x16')](util[_0x1ae9('0x5')](_0x1ae9('0x40'),_0x2a1c0e['uniqueid']),_0x2a1c0e);utils['info'](util['format'](_0x1ae9('0x41'),_0x2a1c0e[_0x1ae9('0x7')],_0x2a1c0e[_0x1ae9('0x42')]));recordings[_0x2a1c0e['uniqueid']][_0x1ae9('0x42')]=_0x2a1c0e['queue'];}}catch(_0x572d04){utils[_0x1ae9('0x27')](util[_0x1ae9('0x5')](_0x1ae9('0x40'),_0x2a1c0e[_0x1ae9('0x7')]),_0x572d04);}};exports[_0x1ae9('0x43')]=function(_0x2b57ea){try{utils['debug'](util['format'](_0x1ae9('0x44'),_0x2b57ea[_0x1ae9('0x7')]),_0x2b57ea);utils['info'](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2b57ea[_0x1ae9('0x7')],_0x2b57ea[_0x1ae9('0x45')],_0x2b57ea[_0x1ae9('0x46')],_0x2b57ea[_0x1ae9('0x47')],_0x2b57ea['transfereecalleridname']));if(recordings[_0x2b57ea[_0x1ae9('0x48')]]&&transfers[_0x1ae9('0xf')][_0x2b57ea[_0x1ae9('0x48')]]){transfers[_0x1ae9('0xf')][_0x2b57ea[_0x1ae9('0x48')]][_0x1ae9('0x49')]=!![];}}catch(_0x2b5c29){utils[_0x1ae9('0x27')](util[_0x1ae9('0x5')](_0x1ae9('0x44'),_0x2b57ea[_0x1ae9('0x7')]),_0x2b5c29);}}; \ No newline at end of file +var _0x3684=['request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId'];(function(_0xfc1c9a,_0xec967b){var _0x54191e=function(_0x29762c){while(--_0x29762c){_0xfc1c9a['push'](_0xfc1c9a['shift']());}};_0x54191e(++_0xec967b);}(_0x3684,0x1ea));var _0x4368=function(_0x3b1b27,_0x3d3bb8){_0x3b1b27=_0x3b1b27-0x0;var _0x3339bc=_0x3684[_0x3b1b27];return _0x3339bc;};'use strict';var _=require('lodash');var util=require(_0x4368('0x0'));var utils=require('./utils');var transfers=require(_0x4368('0x1'));var recordings={};function writeDB(_0x5f371b){var _0xc3e145;utils[_0x4368('0x2')](util[_0x4368('0x3')](_0x4368('0x4'),_0x5f371b[_0x4368('0x5')]));if(transfers[_0x4368('0x6')][_0x5f371b[_0x4368('0x5')]]){_0xc3e145=_0x5f371b['uniqueid'];_0x5f371b[_0x4368('0x5')]=transfers[_0x4368('0x6')][_0x5f371b[_0x4368('0x5')]][_0x4368('0x7')];}if(_0x5f371b[_0x4368('0x8')]){utils[_0x4368('0x9')](_0x5f371b['accountcode'])[_0x4368('0xa')](function(_0x30c5e2){if(_0x30c5e2){_0x5f371b[_0x4368('0xb')]=_0x30c5e2[_0x4368('0xc')];_0x5f371b[_0x4368('0xd')]=_0x30c5e2['id'];}utils[_0x4368('0xe')](_0x4368('0xf'),_0x5f371b);});}else{utils[_0x4368('0xe')](_0x4368('0xf'),_0x5f371b);}if(_0xc3e145)delete transfers['blinds'][_0xc3e145];}exports[_0x4368('0x10')]=function(_0x223c8c){try{utils[_0x4368('0x11')](util['format'](_0x4368('0x12'),_0x223c8c[_0x4368('0x5')]),_0x223c8c);if(_0x223c8c[_0x4368('0x5')]==_0x223c8c['linkedid']){utils['info'](util[_0x4368('0x3')](_0x4368('0x13'),_0x223c8c[_0x4368('0x5')],_0x223c8c[_0x4368('0x14')],_0x223c8c[_0x4368('0x15')]));recordings[_0x223c8c[_0x4368('0x5')]]={'uniqueid':_0x223c8c[_0x4368('0x5')],'accountcode':_0x223c8c[_0x4368('0x8')],'exten':_0x223c8c[_0x4368('0x15')],'context':_0x223c8c['context'],'channel':_0x223c8c[_0x4368('0x16')],'monitors':[]};}}catch(_0x14682b){utils['error'](util['format']('[%s][recordings][newchannel]',_0x223c8c[_0x4368('0x5')]),_0x14682b);}};exports[_0x4368('0x17')]=function(_0x12c2e2){try{utils[_0x4368('0x11')](util['format'](_0x4368('0x18'),_0x12c2e2[_0x4368('0x5')]),_0x12c2e2);if(!_[_0x4368('0x19')](recordings[_0x12c2e2[_0x4368('0x5')]])&&_0x12c2e2[_0x4368('0x1a')]==0x6){utils[_0x4368('0x2')](util[_0x4368('0x3')](_0x4368('0x1b'),_0x12c2e2['uniqueid'],_0x12c2e2[_0x4368('0x14')],_0x12c2e2[_0x4368('0x16')]));}else if(!_[_0x4368('0x19')](recordings[_0x12c2e2['linkedid']])&&_0x12c2e2[_0x4368('0x1a')]==0x6&&_0x12c2e2[_0x4368('0x14')]!=_0x4368('0x1c')){utils['info'](util[_0x4368('0x3')](_0x4368('0x1d'),_0x12c2e2[_0x4368('0x5')],_0x12c2e2['linkedid'],_0x12c2e2['context'],_0x12c2e2[_0x4368('0x16')]));recordings[_0x12c2e2[_0x4368('0x1e')]][_0x4368('0x8')]=_0x12c2e2['accountcode'];}}catch(_0x4adb67){utils[_0x4368('0x1f')](util[_0x4368('0x3')](_0x4368('0x18'),_0x12c2e2[_0x4368('0x5')]),_0x4adb67);}};exports[_0x4368('0x20')]=function(_0x1d8f96){try{if(!_[_0x4368('0x19')](_0x1d8f96['variable'])&&!_['isNil'](_0x1d8f96[_0x4368('0x21')][_0x4368('0x22')])){utils[_0x4368('0x11')](util[_0x4368('0x3')]('[%s][recordings][varset]',_0x1d8f96[_0x4368('0x5')]),_0x1d8f96);utils[_0x4368('0x2')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1d8f96[_0x4368('0x5')],_0x1d8f96[_0x4368('0x21')],_0x1d8f96['value']));if(_[_0x4368('0x23')](_0x1d8f96[_0x4368('0x24')],_0x4368('0x25'))){_0x1d8f96[_0x4368('0x24')]=_0x1d8f96[_0x4368('0x24')][_0x4368('0x26')](_0x4368('0x25'),'.WAV');}if(recordings[_0x1d8f96[_0x4368('0x1e')]]){var _0x500736=_[_0x4368('0x27')](recordings[_0x1d8f96[_0x4368('0x1e')]][_0x4368('0x28')],{'value':_0x1d8f96[_0x4368('0x24')]});if(_[_0x4368('0x19')](_0x500736)){recordings[_0x1d8f96[_0x4368('0x1e')]]['monitors'][_0x4368('0x29')]({'value':_0x1d8f96[_0x4368('0x24')]});}}}}catch(_0xd7c190){utils['error'](util['format'](_0x4368('0x2a'),_0x1d8f96[_0x4368('0x5')]),_0xd7c190);}};exports[_0x4368('0x2b')]=function(_0x35a49a){try{if(!_[_0x4368('0x19')](recordings[_0x35a49a['uniqueid']])){utils[_0x4368('0x11')](util['format'](_0x4368('0x2c'),_0x35a49a[_0x4368('0x5')]),_0x35a49a);utils[_0x4368('0x2')](util[_0x4368('0x3')](_0x4368('0x2d'),_0x35a49a['uniqueid'],_0x35a49a[_0x4368('0x2e')],_0x35a49a[_0x4368('0x2f')],_0x35a49a[_0x4368('0x30')]));recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x2e')]=_0x35a49a[_0x4368('0x2e')];recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x2f')]=_0x35a49a[_0x4368('0x2f')];recordings[_0x35a49a['uniqueid']][_0x4368('0x31')]=_0x35a49a[_0x4368('0x31')];recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x32')]=_0x35a49a['connectedlinename'];if(recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x33')]=='outbound'&&recordings[_0x35a49a[_0x4368('0x5')]]['accountcode']){recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x31')]=recordings[_0x35a49a[_0x4368('0x5')]]['accountcode'];recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x32')]='';}recordings[_0x35a49a[_0x4368('0x5')]][_0x4368('0x28')]['forEach'](function(_0x52ad27){var _0x57291d=_[_0x4368('0x34')](recordings[_0x35a49a[_0x4368('0x5')]]);_0x57291d[_0x4368('0x24')]=_0x52ad27['value'];writeDB(_0x57291d);});delete recordings[_0x35a49a['uniqueid']];}}catch(_0x41fb1f){utils[_0x4368('0x1f')](util[_0x4368('0x3')]('[%s][recordings][hangup]',_0x35a49a[_0x4368('0x5')]),_0x41fb1f);}};exports[_0x4368('0x35')]=function(_0x3810d0){try{if(!_[_0x4368('0x19')](recordings[_0x3810d0[_0x4368('0x5')]])){utils[_0x4368('0x11')](util['format'](_0x4368('0x36'),_0x3810d0[_0x4368('0x5')]),_0x3810d0);utils[_0x4368('0x2')](util['format'](_0x4368('0x37'),_0x3810d0[_0x4368('0x5')],_0x3810d0[_0x4368('0x38')],_0x3810d0[_0x4368('0x39')]));if(_0x3810d0[_0x4368('0x38')][_0x4368('0x3a')]()=='set'&&_['startsWith'](_0x3810d0[_0x4368('0x39')][_0x4368('0x3a')](),'cdr')){var _0x3bbe30=_0x3810d0[_0x4368('0x39')][_0x4368('0x3b')]('=');var _0x255c0f=_0x3bbe30[0x0][_0x4368('0x3c')](_0x3bbe30[0x0]['lastIndexOf']('(')+0x1,_0x3bbe30[0x0][_0x4368('0x3d')](')'));var _0x55a5ef=_0x3bbe30[0x1];recordings[_0x3810d0[_0x4368('0x5')]][_0x255c0f]=_0x55a5ef;}}}catch(_0x42cdba){utils['error'](util[_0x4368('0x3')]('[%s][recordings][newexten]',_0x3810d0[_0x4368('0x5')]),_0x42cdba);}};exports[_0x4368('0x3e')]=function(_0x1bba2a){try{if(!_[_0x4368('0x19')](recordings[_0x1bba2a['uniqueid']])){utils['debug'](util[_0x4368('0x3')](_0x4368('0x3f'),_0x1bba2a[_0x4368('0x5')]),_0x1bba2a);utils['info'](util[_0x4368('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1bba2a[_0x4368('0x5')],_0x1bba2a[_0x4368('0x40')]));recordings[_0x1bba2a[_0x4368('0x5')]]['queue']=_0x1bba2a[_0x4368('0x40')];}}catch(_0x134614){utils['error'](util[_0x4368('0x3')](_0x4368('0x3f'),_0x1bba2a[_0x4368('0x5')]),_0x134614);}};exports[_0x4368('0x41')]=function(_0x4fccdb){try{utils[_0x4368('0x11')](util[_0x4368('0x3')](_0x4368('0x42'),_0x4fccdb[_0x4368('0x5')]),_0x4fccdb);utils['info'](util[_0x4368('0x3')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4fccdb[_0x4368('0x5')],_0x4fccdb['transferercalleridnum'],_0x4fccdb[_0x4368('0x43')],_0x4fccdb[_0x4368('0x44')],_0x4fccdb[_0x4368('0x45')]));if(recordings[_0x4fccdb[_0x4368('0x46')]]&&transfers['blinds'][_0x4fccdb[_0x4368('0x46')]]){transfers[_0x4368('0x6')][_0x4fccdb[_0x4368('0x46')]][_0x4368('0x47')]=!![];}}catch(_0x1cba1c){utils[_0x4368('0x1f')](util[_0x4368('0x3')](_0x4368('0x42'),_0x4fccdb[_0x4368('0x5')]),_0x1cba1c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 34fe338..a58024b 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 _0x0c3b=['origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','transferercalleridnum','transfereecalleridnum','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign'];(function(_0x26a9ea,_0x10ecba){var _0x3bc99d=function(_0x2f9e12){while(--_0x2f9e12){_0x26a9ea['push'](_0x26a9ea['shift']());}};_0x3bc99d(++_0x10ecba);}(_0x0c3b,0x1cc));var _0xb0c3=function(_0xce8183,_0x567545){_0xce8183=_0xce8183-0x0;var _0x27c555=_0x0c3b[_0xce8183];return _0x27c555;};'use strict';var _=require(_0xb0c3('0x0'));var util=require('util');var utils=require(_0xb0c3('0x1'));function writeDB(_0x1e0ac7){utils[_0xb0c3('0x2')](util[_0xb0c3('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x1e0ac7[_0xb0c3('0x4')]===_0xb0c3('0x5')?_0x1e0ac7[_0xb0c3('0x6')]:_0x1e0ac7[_0xb0c3('0x7')],_0x1e0ac7[_0xb0c3('0x4')]));utils['request'](_0xb0c3('0x8'),_0x1e0ac7);}exports[_0xb0c3('0x9')]={};exports[_0xb0c3('0xa')]=function(_0x51414c){try{utils[_0xb0c3('0xb')](util['format']('[%s][transfers][blindtransfer]',_0x51414c[_0xb0c3('0x7')]),_0x51414c);utils['info'](util[_0xb0c3('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x51414c[_0xb0c3('0x7')],_0x51414c[_0xb0c3('0xc')],_0x51414c['transferercalleridname'],_0x51414c[_0xb0c3('0xd')],_0x51414c['transfereecalleridname']));_0x51414c[_0xb0c3('0x4')]='blind';exports[_0xb0c3('0x9')][_0x51414c[_0xb0c3('0xe')]]=_0x51414c;writeDB(_0x51414c);}catch(_0x272dd8){utils['error'](util[_0xb0c3('0x3')]('[%s][transfers][blindtransfer]',_0x51414c['uniqueid']),_0x272dd8);}};exports[_0xb0c3('0xf')]=function(_0x40bd2d){try{utils[_0xb0c3('0xb')](util['format'](_0xb0c3('0x10'),_0x40bd2d[_0xb0c3('0x6')]),_0x40bd2d);utils[_0xb0c3('0x2')](util[_0xb0c3('0x3')](_0xb0c3('0x11'),_0x40bd2d[_0xb0c3('0x6')],_0x40bd2d['origtransferercalleridnum'],_0x40bd2d[_0xb0c3('0x12')],_0x40bd2d[_0xb0c3('0x13')],_0x40bd2d['transfertargetcalleridname']));_0x40bd2d=_[_0xb0c3('0x14')](_0x40bd2d,{'transfererchannel':_0x40bd2d['origtransfererchannel'],'transferercalleridnum':_0x40bd2d[_0xb0c3('0x15')],'transferercalleridname':_0x40bd2d[_0xb0c3('0x12')],'transfererconnectedlinenum':_0x40bd2d[_0xb0c3('0x16')],'transfererconnectedlinename':_0x40bd2d[_0xb0c3('0x17')],'transfereraccountcode':_0x40bd2d['origtransfereraccountcode'],'transferercontext':_0x40bd2d[_0xb0c3('0x18')],'transfererexten':_0x40bd2d[_0xb0c3('0x19')],'transfererlinkedid':_0x40bd2d[_0xb0c3('0x1a')],'context':_0x40bd2d[_0xb0c3('0x1b')],'extension':_0x40bd2d[_0xb0c3('0x1c')],'type':_0xb0c3('0x5')});if(_[_0xb0c3('0x1d')](_0x40bd2d[_0xb0c3('0x1e')])){_0x40bd2d=_[_0xb0c3('0x14')](_0x40bd2d,{'transfereechannel':_0x40bd2d[_0xb0c3('0x1f')],'transfereecalleridnum':_0x40bd2d[_0xb0c3('0x13')],'transfereecalleridname':_0x40bd2d[_0xb0c3('0x20')],'transfereeconnectedlinenum':_0x40bd2d[_0xb0c3('0x21')],'transfereeconnectedlinename':_0x40bd2d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x40bd2d['transfertargetaccountcode'],'transfereecontext':_0x40bd2d[_0xb0c3('0x22')],'transfereeexten':_0x40bd2d[_0xb0c3('0x23')],'transfereelinkedid':_0x40bd2d[_0xb0c3('0x24')]});}writeDB(_0x40bd2d);}catch(_0xb2cfbe){utils['error'](util[_0xb0c3('0x3')](_0xb0c3('0x10'),_0x40bd2d['origtransfereruniqueid']),_0xb2cfbe);}}; \ No newline at end of file +var _0xe2c7=['isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten'];(function(_0x138240,_0x342205){var _0x5b3b70=function(_0x389b44){while(--_0x389b44){_0x138240['push'](_0x138240['shift']());}};_0x5b3b70(++_0x342205);}(_0xe2c7,0x17a));var _0x7e2c=function(_0x4e87ba,_0x2d95f9){_0x4e87ba=_0x4e87ba-0x0;var _0x212b08=_0xe2c7[_0x4e87ba];return _0x212b08;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x7e2c('0x0'));function writeDB(_0x519453){utils[_0x7e2c('0x1')](util[_0x7e2c('0x2')](_0x7e2c('0x3'),_0x519453[_0x7e2c('0x4')]===_0x7e2c('0x5')?_0x519453[_0x7e2c('0x6')]:_0x519453[_0x7e2c('0x7')],_0x519453[_0x7e2c('0x4')]));utils[_0x7e2c('0x8')]('CreateVoiceTransferReport',_0x519453);}exports[_0x7e2c('0x9')]={};exports['blindtransfer']=function(_0x4920c3){try{utils[_0x7e2c('0xa')](util[_0x7e2c('0x2')](_0x7e2c('0xb'),_0x4920c3[_0x7e2c('0x7')]),_0x4920c3);utils['info'](util[_0x7e2c('0x2')](_0x7e2c('0xc'),_0x4920c3[_0x7e2c('0x7')],_0x4920c3[_0x7e2c('0xd')],_0x4920c3[_0x7e2c('0xe')],_0x4920c3[_0x7e2c('0xf')],_0x4920c3[_0x7e2c('0x10')]));_0x4920c3[_0x7e2c('0x4')]='blind';exports[_0x7e2c('0x9')][_0x4920c3[_0x7e2c('0x11')]]=_0x4920c3;writeDB(_0x4920c3);}catch(_0x4b0e7c){utils[_0x7e2c('0x12')](util[_0x7e2c('0x2')]('[%s][transfers][blindtransfer]',_0x4920c3['uniqueid']),_0x4b0e7c);}};exports[_0x7e2c('0x13')]=function(_0x1a9aa4){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x1a9aa4['origtransfereruniqueid']),_0x1a9aa4);utils[_0x7e2c('0x1')](util[_0x7e2c('0x2')](_0x7e2c('0x14'),_0x1a9aa4[_0x7e2c('0x6')],_0x1a9aa4[_0x7e2c('0x15')],_0x1a9aa4[_0x7e2c('0x16')],_0x1a9aa4['transfertargetcalleridnum'],_0x1a9aa4[_0x7e2c('0x17')]));_0x1a9aa4=_[_0x7e2c('0x18')](_0x1a9aa4,{'transfererchannel':_0x1a9aa4[_0x7e2c('0x19')],'transferercalleridnum':_0x1a9aa4[_0x7e2c('0x15')],'transferercalleridname':_0x1a9aa4[_0x7e2c('0x16')],'transfererconnectedlinenum':_0x1a9aa4[_0x7e2c('0x1a')],'transfererconnectedlinename':_0x1a9aa4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1a9aa4['origtransfereraccountcode'],'transferercontext':_0x1a9aa4[_0x7e2c('0x1b')],'transfererexten':_0x1a9aa4[_0x7e2c('0x1c')],'transfererlinkedid':_0x1a9aa4[_0x7e2c('0x1d')],'context':_0x1a9aa4[_0x7e2c('0x1e')],'extension':_0x1a9aa4[_0x7e2c('0x1f')],'type':'attended'});if(_[_0x7e2c('0x20')](_0x1a9aa4[_0x7e2c('0x21')])){_0x1a9aa4=_[_0x7e2c('0x18')](_0x1a9aa4,{'transfereechannel':_0x1a9aa4['transfertargetchannel'],'transfereecalleridnum':_0x1a9aa4[_0x7e2c('0x22')],'transfereecalleridname':_0x1a9aa4[_0x7e2c('0x17')],'transfereeconnectedlinenum':_0x1a9aa4['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1a9aa4[_0x7e2c('0x23')],'transfereeaccountcode':_0x1a9aa4[_0x7e2c('0x24')],'transfereecontext':_0x1a9aa4[_0x7e2c('0x25')],'transfereeexten':_0x1a9aa4[_0x7e2c('0x26')],'transfereelinkedid':_0x1a9aa4[_0x7e2c('0x27')]});}writeDB(_0x1a9aa4);}catch(_0x2a80f6){utils[_0x7e2c('0x12')](util['format'](_0x7e2c('0x28'),_0x1a9aa4[_0x7e2c('0x6')]),_0x2a80f6);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index f5ae15f..8d5aebc 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 _0x1a0b=['subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','xdr','info','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','debug','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3a89dc,_0x54bb1e){var _0x11c5c9=function(_0x21bd68){while(--_0x21bd68){_0x3a89dc['push'](_0x3a89dc['shift']());}};_0x11c5c9(++_0x54bb1e);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x3394aa,_0x4abf3e){_0x3394aa=_0x3394aa-0x0;var _0x41f0c9=_0x1a0b[_0x3394aa];return _0x41f0c9;};'use strict';var BPromise=require(_0xb1a0('0x0'));var jayson=require('jayson/promise');var moment=require(_0xb1a0('0x1'));var util=require(_0xb1a0('0x2'));var client=jayson[_0xb1a0('0x3')][_0xb1a0('0x4')]({'port':0x2329});var logger=require(_0xb1a0('0x5'))(_0xb1a0('0x6'));exports[_0xb1a0('0x7')]=function(_0x34c5fb,_0x1126a3){logger[_0xb1a0('0x7')](_0x34c5fb,_0x1126a3?util[_0xb1a0('0x8')](_0x1126a3,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4c10bf,_0x1cff60){logger['debug'](_0x4c10bf,_0x1cff60?util['inspect'](_0x1cff60,{'showHidden':![],'depth':null}):'');};exports[_0xb1a0('0x9')]=function(_0x1c8459,_0x3273c2){logger['error'](_0x1c8459,_0x3273c2?util['inspect'](_0x3273c2,{'showHidden':![],'depth':null}):'');};exports[_0xb1a0('0xa')]=function(_0xa672e8,_0x16c4fb){return client[_0xb1a0('0xa')](_0xa672e8,{'body':_0x16c4fb})[_0xb1a0('0xb')](function(_0x323afb){logger['debug'](_0xb1a0('0xc'),_0xa672e8,_0x323afb?util[_0xb1a0('0x8')](_0x323afb,{'showHidden':![],'depth':null}):'');})[_0xb1a0('0xd')](function(_0x53968c){logger[_0xb1a0('0x9')](_0xb1a0('0xc'),_0xa672e8,_0x53968c?util[_0xb1a0('0x8')](_0x53968c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x180c44){return client['request'](_0xb1a0('0xe'),{'options':{'raw':!![],'attributes':['id',_0xb1a0('0xf'),_0xb1a0('0x10'),_0xb1a0('0x11')],'where':_0x180c44,'limit':0x1}})[_0xb1a0('0xb')](function(_0x3b9724){logger[_0xb1a0('0x12')](_0xb1a0('0x13'),JSON[_0xb1a0('0x14')](_0x180c44),_0x3b9724?util[_0xb1a0('0x8')](_0x3b9724,{'showHidden':![],'depth':null}):'');return _0x3b9724[_0xb1a0('0x15')][_0xb1a0('0x16')]?_0x3b9724[_0xb1a0('0x15')][0x0]:null;});}exports[_0xb1a0('0x17')]=function(_0x28e571){return new BPromise(function(_0x223b14,_0x2c3d0e){if(_0x28e571){return getUser({'internal':_0x28e571})['then'](function(_0x5974a7){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x28e571,_0x5974a7?'found':'notfound');return _0x223b14(_0x5974a7);})['catch'](function(_0x490182){logger[_0xb1a0('0x9')](_0xb1a0('0x18'),_0x490182?util[_0xb1a0('0x8')](_0x490182,{'showHidden':![],'depth':null}):'');return _0x223b14(null);});}return _0x223b14(null);});};exports['getUserByInterface']=function(_0x5020ac){return new BPromise(function(_0x1cb9da,_0x1fb4d9){if(_0x5020ac){return getUser({'interface':_0x5020ac})['then'](function(_0x75c04d){logger['info'](_0xb1a0('0x19'),_0x5020ac,_0x75c04d?_0xb1a0('0x1a'):_0xb1a0('0x1b'));return _0x1cb9da(_0x75c04d);})[_0xb1a0('0xd')](function(_0x5b0501){logger[_0xb1a0('0x9')]('[utils][getUserByInterface]',_0x5b0501?util[_0xb1a0('0x8')](_0x5b0501,{'showHidden':![],'depth':null}):'');return _0x1cb9da(null);});}return _0x1cb9da(null);});};exports[_0xb1a0('0x1c')]=function(_0x8317eb){return new BPromise(function(_0x10e675,_0x45a486){if(_0x8317eb){return getUser({'name':_0x8317eb})[_0xb1a0('0xb')](function(_0xb64c7d){logger[_0xb1a0('0x7')](_0xb1a0('0x1d'),_0x8317eb,_0xb64c7d?'found':'notfound');return _0x10e675(_0xb64c7d);})[_0xb1a0('0xd')](function(_0x1006dc){logger[_0xb1a0('0x9')]('[utils][getUserByName]',_0x1006dc?util[_0xb1a0('0x8')](_0x1006dc,{'showHidden':![],'depth':null}):'');return _0x10e675(null);});}return _0x10e675(null);});};exports['getVoiceQueueByName']=function(_0x3fff58){return new BPromise(function(_0x5a809f,_0x38eab3){if(_0x3fff58){return client[_0xb1a0('0xa')](_0xb1a0('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb1a0('0x10'),_0xb1a0('0x1f'),_0xb1a0('0x20'),_0xb1a0('0x21')],'where':{'name':_0x3fff58},'limit':0x1}})[_0xb1a0('0xb')](function(_0x1abda5){logger['debug'](_0xb1a0('0x22'),_0x3fff58,_0x1abda5?util[_0xb1a0('0x8')](_0x1abda5,{'showHidden':![],'depth':null}):'');logger[_0xb1a0('0x7')](_0xb1a0('0x23'),_0x3fff58,_0x1abda5?_0xb1a0('0x1a'):_0xb1a0('0x1b'));return _0x5a809f(_0x1abda5[_0xb1a0('0x15')]['length']?_0x1abda5['result'][0x0]:null);})[_0xb1a0('0xd')](function(_0x1826c3){logger['error'](_0xb1a0('0x24'),_0x1826c3?util[_0xb1a0('0x8')](_0x1826c3,{'showHidden':![],'depth':null}):'');return _0x5a809f(null);});}return _0x5a809f(null);});};exports[_0xb1a0('0x25')]=function(_0x25f44f,_0x69ef32){return moment(_0x25f44f)[_0xb1a0('0x26')](_0x69ef32,_0xb1a0('0x27'))[_0xb1a0('0x28')](_0xb1a0('0x29'));};exports[_0xb1a0('0x2a')]=function(_0x12ef87,_0x1a0e11){return moment(_0x12ef87)[_0xb1a0('0x2b')](_0x1a0e11,_0xb1a0('0x27'))[_0xb1a0('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb1a0('0x2c')]=function(_0x2bec57,_0x3732fb){return moment(_0x2bec57)[_0xb1a0('0x2d')](moment(_0x3732fb),_0xb1a0('0x27'));};exports['sumTime']=function(_0x5e5f88,_0x3973b1){return parseInt(_0x5e5f88,0xa)+parseInt(_0x3973b1,0xa);};exports[_0xb1a0('0x2e')]=function(){return moment()[_0xb1a0('0x28')](_0xb1a0('0x29'));};exports[_0xb1a0('0x2f')]=function(_0xab9e36,_0x503a1b){if(_0x503a1b){return moment(_0xab9e36)[_0xb1a0('0x2f')](_0x503a1b);}return!![];};exports[_0xb1a0('0x30')]=function(_0x520639,_0x49baab){if(_0x49baab){return moment(_0x520639)['isBefore'](_0x49baab);}else if(_0x520639){return!![];}return![];}; \ No newline at end of file +var _0xb35d=['[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','seconds','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','[utils][getUser]\x20where:%s','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','info'];(function(_0x10c47e,_0x5c395a){var _0x409ba3=function(_0x59fcdf){while(--_0x59fcdf){_0x10c47e['push'](_0x10c47e['shift']());}};_0x409ba3(++_0x5c395a);}(_0xb35d,0x14b));var _0xdb35=function(_0x1d2e5e,_0x145ae6){_0x1d2e5e=_0x1d2e5e-0x0;var _0x4a1d68=_0xb35d[_0x1d2e5e];return _0x4a1d68;};'use strict';var BPromise=require(_0xdb35('0x0'));var jayson=require(_0xdb35('0x1'));var moment=require(_0xdb35('0x2'));var util=require(_0xdb35('0x3'));var client=jayson[_0xdb35('0x4')][_0xdb35('0x5')]({'port':0x2329});var logger=require(_0xdb35('0x6'))(_0xdb35('0x7'));exports['info']=function(_0x3799fa,_0x277350){logger['info'](_0x3799fa,_0x277350?util[_0xdb35('0x8')](_0x277350,{'showHidden':![],'depth':null}):'');};exports[_0xdb35('0x9')]=function(_0x225fcb,_0x3e7589){logger[_0xdb35('0x9')](_0x225fcb,_0x3e7589?util[_0xdb35('0x8')](_0x3e7589,{'showHidden':![],'depth':null}):'');};exports[_0xdb35('0xa')]=function(_0x4e5eac,_0x1375a1){logger[_0xdb35('0xa')](_0x4e5eac,_0x1375a1?util[_0xdb35('0x8')](_0x1375a1,{'showHidden':![],'depth':null}):'');};exports[_0xdb35('0xb')]=function(_0x34f06a,_0x3b541f){return client[_0xdb35('0xb')](_0x34f06a,{'body':_0x3b541f})[_0xdb35('0xc')](function(_0x454df8){logger[_0xdb35('0x9')]('[utils][request]\x20name:%s',_0x34f06a,_0x454df8?util[_0xdb35('0x8')](_0x454df8,{'showHidden':![],'depth':null}):'');})[_0xdb35('0xd')](function(_0x371ea7){logger[_0xdb35('0xa')](_0xdb35('0xe'),_0x34f06a,_0x371ea7?util[_0xdb35('0x8')](_0x371ea7,{'showHidden':![],'depth':null}):'');});};function getUser(_0x6934d2){return client[_0xdb35('0xb')](_0xdb35('0xf'),{'options':{'raw':!![],'attributes':['id',_0xdb35('0x10'),'name','interface'],'where':_0x6934d2,'limit':0x1}})[_0xdb35('0xc')](function(_0x20b5c2){logger[_0xdb35('0x9')](_0xdb35('0x11'),JSON[_0xdb35('0x12')](_0x6934d2),_0x20b5c2?util[_0xdb35('0x8')](_0x20b5c2,{'showHidden':![],'depth':null}):'');return _0x20b5c2[_0xdb35('0x13')]['length']?_0x20b5c2[_0xdb35('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0x488626){return new BPromise(function(_0x3a3cdb,_0x3e3771){if(_0x488626){return getUser({'internal':_0x488626})[_0xdb35('0xc')](function(_0x25d936){logger['info'](_0xdb35('0x14'),_0x488626,_0x25d936?_0xdb35('0x15'):_0xdb35('0x16'));return _0x3a3cdb(_0x25d936);})[_0xdb35('0xd')](function(_0x1fca3f){logger[_0xdb35('0xa')](_0xdb35('0x17'),_0x1fca3f?util[_0xdb35('0x8')](_0x1fca3f,{'showHidden':![],'depth':null}):'');return _0x3a3cdb(null);});}return _0x3a3cdb(null);});};exports[_0xdb35('0x18')]=function(_0x16a5ce){return new BPromise(function(_0xdb993d,_0x3f691a){if(_0x16a5ce){return getUser({'interface':_0x16a5ce})[_0xdb35('0xc')](function(_0x574d66){logger[_0xdb35('0x19')](_0xdb35('0x1a'),_0x16a5ce,_0x574d66?_0xdb35('0x15'):'notfound');return _0xdb993d(_0x574d66);})[_0xdb35('0xd')](function(_0x4e51bf){logger['error'](_0xdb35('0x1b'),_0x4e51bf?util['inspect'](_0x4e51bf,{'showHidden':![],'depth':null}):'');return _0xdb993d(null);});}return _0xdb993d(null);});};exports[_0xdb35('0x1c')]=function(_0x547a25){return new BPromise(function(_0x30ea52,_0x4ef02a){if(_0x547a25){return getUser({'name':_0x547a25})[_0xdb35('0xc')](function(_0x55b1d6){logger['info'](_0xdb35('0x1d'),_0x547a25,_0x55b1d6?_0xdb35('0x15'):'notfound');return _0x30ea52(_0x55b1d6);})[_0xdb35('0xd')](function(_0x5ac4bf){logger['error']('[utils][getUserByName]',_0x5ac4bf?util['inspect'](_0x5ac4bf,{'showHidden':![],'depth':null}):'');return _0x30ea52(null);});}return _0x30ea52(null);});};exports[_0xdb35('0x1e')]=function(_0x1ad1ee){return new BPromise(function(_0x270864,_0x42141e){if(_0x1ad1ee){return client[_0xdb35('0xb')](_0xdb35('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xdb35('0x20'),_0xdb35('0x21'),_0xdb35('0x22'),_0xdb35('0x23')],'where':{'name':_0x1ad1ee},'limit':0x1}})['then'](function(_0x391346){logger[_0xdb35('0x9')](_0xdb35('0x24'),_0x1ad1ee,_0x391346?util[_0xdb35('0x8')](_0x391346,{'showHidden':![],'depth':null}):'');logger['info'](_0xdb35('0x25'),_0x1ad1ee,_0x391346?_0xdb35('0x15'):'notfound');return _0x270864(_0x391346[_0xdb35('0x13')][_0xdb35('0x26')]?_0x391346[_0xdb35('0x13')][0x0]:null);})['catch'](function(_0x3aeb7c){logger[_0xdb35('0xa')](_0xdb35('0x27'),_0x3aeb7c?util['inspect'](_0x3aeb7c,{'showHidden':![],'depth':null}):'');return _0x270864(null);});}return _0x270864(null);});};exports['addTime']=function(_0x41a25d,_0x4fcf3f){return moment(_0x41a25d)[_0xdb35('0x28')](_0x4fcf3f,'seconds')[_0xdb35('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xdb35('0x2a')]=function(_0x1b9707,_0x1f3071){return moment(_0x1b9707)[_0xdb35('0x2b')](_0x1f3071,'seconds')['format'](_0xdb35('0x2c'));};exports[_0xdb35('0x2d')]=function(_0x27837b,_0x160255){return moment(_0x27837b)[_0xdb35('0x2e')](moment(_0x160255),_0xdb35('0x2f'));};exports[_0xdb35('0x30')]=function(_0x4e71f2,_0x3ede16){return parseInt(_0x4e71f2,0xa)+parseInt(_0x3ede16,0xa);};exports['now']=function(){return moment()[_0xdb35('0x29')](_0xdb35('0x2c'));};exports[_0xdb35('0x31')]=function(_0x37c7f3,_0xf66b00){if(_0xf66b00){return moment(_0x37c7f3)[_0xdb35('0x31')](_0xf66b00);}return!![];};exports[_0xdb35('0x32')]=function(_0x486c5e,_0x3873d4){if(_0x3873d4){return moment(_0x486c5e)['isBefore'](_0x3873d4);}else if(_0x486c5e){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index c8ca82b..c16ae7a 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34d0=['agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','name','ensureDir','client','catch','user','then','no-user','timestamp','error','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','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)','format','statusCode','other'];(function(_0x39a074,_0x14db8e){var _0x342dc2=function(_0x1caabd){while(--_0x1caabd){_0x39a074['push'](_0x39a074['shift']());}};_0x342dc2(++_0x14db8e);}(_0x34d0,0x1b3));var _0x034d=function(_0x40e914,_0x2af8d6){_0x40e914=_0x40e914-0x0;var _0x57e403=_0x34d0[_0x40e914];return _0x57e403;};var fs=require(_0x034d('0x0'));var _=require(_0x034d('0x1'));var ewinston=require(_0x034d('0x2'));var path=require('path');var util=require(_0x034d('0x3'));var fileLogger=require(_0x034d('0x4'))[_0x034d('0x5')];var safeTemplate=require(_0x034d('0x6'))[_0x034d('0x7')];var maskSensitiveData=require(_0x034d('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x4f1a8e(_0x1431f7){var _0x11604b=path[_0x034d('0x9')](_0x034d('0xa'),_0x034d('0xb'),_0x034d('0xc'));var _0x38705d=path['join']('client',_0x1431f7[_0x034d('0xd')]+'-'+_0x1431f7[_0x034d('0xe')]);return fs[_0x034d('0xf')](path[_0x034d('0x9')](_0x11604b,_0x38705d))['then'](function(){var _0xd3c46b=fileLogger(_0x034d('0x10'),path[_0x034d('0x9')](_0x11604b,_0x38705d));return _0xd3c46b;})[_0x034d('0x11')](function(_0x3e4823){throw _0x3e4823;});}this[_0x034d('0xb')]=function(_0x6f58a0,_0x65a3fd,_0x4113b4,_0x384ede){return _0x4f1a8e(_0x6f58a0[_0x034d('0x12')])[_0x034d('0x13')](function(_0x1bbf62){var _0x50233e=_0x1bbf62[_0x65a3fd];return _0x50233e;})[_0x034d('0x13')](function(_0x357c36){var _0x18a7fa=_0x6f58a0['user']?_0x6f58a0[_0x034d('0x12')]['id']:_0x034d('0x14');var _0x36e351=_0x384ede['data'];var _0x5c2c4d=_0x384ede[_0x034d('0x15')];var _0x52dd45=new Date(Number(_0x5c2c4d));return _0x357c36(_0x18a7fa,_0x52dd45,_0x4113b4,_0x36e351);})[_0x034d('0x11')](function(_0x429243){fileLogger(_0x034d('0x10'))[_0x034d('0x16')](_0x429243);});};}function setupLoggers(_0x41f736){return new Promise(function(_0x55536d){var _0xf98a2e=new ClientSideLogger();var _0x47292e=fileLogger('api');var _0x1ecd4b=fileLogger(_0x034d('0x17'));_0x41f736[_0x034d('0x18')]('client-side-logger',_0xf98a2e);_0x41f736[_0x034d('0x19')](ewinston['logger']({'winstonInstance':_0x47292e,'meta':![],'statusLevels':!![],'msg':function(_0xba0cf3,_0x2d80b2){var _0x3bca6d=_0x034d('0x1a');if(!_[_0x034d('0x1b')](_0xba0cf3[_0x034d('0x1c')])){_0x3bca6d+=_0x034d('0x1d');var _0x5f3dc8=_0xba0cf3[_0x034d('0x1c')];maskSensitiveData(_0x5f3dc8);}return safeTemplate(util['format'](_0x3bca6d,_0xba0cf3[_0x034d('0x1e')],_0xba0cf3[_0x034d('0x1f')][_0x034d('0x20')]?_0xba0cf3[_0x034d('0x1f')][_0x034d('0x20')]:_0xba0cf3[_0x034d('0x21')][_0x034d('0x22')]||_0xba0cf3['ip'],_0xba0cf3[_0x034d('0x23')],_0x2d80b2['statusCode'],_0x2d80b2['responseTime'],_0xba0cf3[_0x034d('0x12')]?_0xba0cf3[_0x034d('0x12')]['id']:null,_0xba0cf3[_0x034d('0x12')]?_0xba0cf3[_0x034d('0x12')][_0x034d('0xe')]:null,_0xba0cf3[_0x034d('0x12')]?_0xba0cf3[_0x034d('0x12')]['role']:null,_0x5f3dc8?util[_0x034d('0x24')](_0x5f3dc8,![],null):''));}}));_0x41f736['use'](ewinston[_0x034d('0x25')]({'winstonInstance':_0x1ecd4b,'meta':![],'statusLevels':!![],'msg':function(_0x220214,_0x4e2a23){var _0xdb5dd6=_0x034d('0x26');if(_0x220214['body']&&_0x220214[_0x034d('0x1c')][_0x034d('0x27')]&&_0x220214[_0x034d('0x1c')][_0x034d('0x28')]){_0xdb5dd6=_0x034d('0x29');}return util[_0x034d('0x2a')](_0xdb5dd6,_0x220214[_0x034d('0x1e')],_0x220214[_0x034d('0x1f')]['x-forwarded-for']?_0x220214[_0x034d('0x1f')][_0x034d('0x20')]:_0x220214['connection']['remoteAddress']||_0x220214['ip'],_0x220214[_0x034d('0x23')],_0x4e2a23[_0x034d('0x2b')],_0x4e2a23['responseTime'],_0x220214[_0x034d('0x12')]?_0x220214[_0x034d('0x12')]['id']:null,_0x220214['user']?_0x220214[_0x034d('0x12')][_0x034d('0xe')]:null,_0x220214[_0x034d('0x12')]?_0x220214['user'][_0x034d('0xd')]:null,_0x220214[_0x034d('0x1c')]&&_0x220214[_0x034d('0x1c')][_0x034d('0x27')]?_0x220214[_0x034d('0x1c')][_0x034d('0x27')]:_0x034d('0x2c'),_0x220214[_0x034d('0x1c')]&&_0x220214[_0x034d('0x1c')]['agent_id']?_0x220214[_0x034d('0x1c')][_0x034d('0x28')]:'',_0x220214[_0x034d('0x1c')]&&_0x220214[_0x034d('0x1c')][_0x034d('0x2d')]?_0x220214[_0x034d('0x1c')][_0x034d('0x2d')]:'');},'ignoreRoute':function(_0x3d567f){var _0x377f4f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x377f4f[_0x034d('0x2e')](_0x3d567f[_0x034d('0x23')]);}}));return _0x55536d();});}exports[_0x034d('0x2f')]=setupLoggers; \ No newline at end of file +var _0x8f07=['fs-extra','express-winston','path','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','role','name','ensureDir','then','catch','user','data','timestamp','error','api','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','url','other','agent_id','agent_name'];(function(_0xd31204,_0x3fe892){var _0x594a44=function(_0x526433){while(--_0x526433){_0xd31204['push'](_0xd31204['shift']());}};_0x594a44(++_0x3fe892);}(_0x8f07,0x134));var _0x78f0=function(_0x48f3f1,_0x19dec7){_0x48f3f1=_0x48f3f1-0x0;var _0x171c53=_0x8f07[_0x48f3f1];return _0x171c53;};var fs=require(_0x78f0('0x0'));var _=require('lodash');var ewinston=require(_0x78f0('0x1'));var path=require(_0x78f0('0x2'));var util=require('util');var fileLogger=require(_0x78f0('0x3'))[_0x78f0('0x4')];var safeTemplate=require('./safe-template')[_0x78f0('0x5')];var maskSensitiveData=require(_0x78f0('0x6'))[_0x78f0('0x7')];function ClientSideLogger(){function _0x15a941(_0x5dedd7){var _0x108ffe=path[_0x78f0('0x8')](_0x78f0('0x9'),_0x78f0('0xa'),'xcally');var _0x58b3ec=path[_0x78f0('0x8')](_0x78f0('0xb'),_0x5dedd7[_0x78f0('0xc')]+'-'+_0x5dedd7[_0x78f0('0xd')]);return fs[_0x78f0('0xe')](path[_0x78f0('0x8')](_0x108ffe,_0x58b3ec))[_0x78f0('0xf')](function(){var _0x68d159=fileLogger(_0x78f0('0xb'),path[_0x78f0('0x8')](_0x108ffe,_0x58b3ec));return _0x68d159;})[_0x78f0('0x10')](function(_0xa0e46e){throw _0xa0e46e;});}this[_0x78f0('0xa')]=function(_0x2d9532,_0x4dc3ec,_0x12e759,_0x593626){return _0x15a941(_0x2d9532[_0x78f0('0x11')])[_0x78f0('0xf')](function(_0x50622e){var _0x377dbb=_0x50622e[_0x4dc3ec];return _0x377dbb;})[_0x78f0('0xf')](function(_0x16671a){var _0x3dcedc=_0x2d9532['user']?_0x2d9532[_0x78f0('0x11')]['id']:'no-user';var _0x29f304=_0x593626[_0x78f0('0x12')];var _0x13e03b=_0x593626[_0x78f0('0x13')];var _0xef5717=new Date(Number(_0x13e03b));return _0x16671a(_0x3dcedc,_0xef5717,_0x12e759,_0x29f304);})['catch'](function(_0x3c8021){fileLogger(_0x78f0('0xb'))[_0x78f0('0x14')](_0x3c8021);});};}function setupLoggers(_0x210b7b){return new Promise(function(_0x56c271){var _0x2d9cda=new ClientSideLogger();var _0x2ae4bb=fileLogger(_0x78f0('0x15'));var _0x58d02c=fileLogger('auth');_0x210b7b[_0x78f0('0x16')]('client-side-logger',_0x2d9cda);_0x210b7b[_0x78f0('0x17')](ewinston[_0x78f0('0x18')]({'winstonInstance':_0x2ae4bb,'meta':![],'statusLevels':!![],'msg':function(_0x55ab01,_0x299cb4){var _0x4f040d=_0x78f0('0x19');if(!_[_0x78f0('0x1a')](_0x55ab01[_0x78f0('0x1b')])){_0x4f040d+=_0x78f0('0x1c');var _0x4833be=_0x55ab01[_0x78f0('0x1b')];maskSensitiveData(_0x4833be);}return safeTemplate(util[_0x78f0('0x1d')](_0x4f040d,_0x55ab01[_0x78f0('0x1e')],_0x55ab01[_0x78f0('0x1f')]['x-forwarded-for']?_0x55ab01[_0x78f0('0x1f')][_0x78f0('0x20')]:_0x55ab01[_0x78f0('0x21')][_0x78f0('0x22')]||_0x55ab01['ip'],_0x55ab01['url'],_0x299cb4[_0x78f0('0x23')],_0x299cb4[_0x78f0('0x24')],_0x55ab01['user']?_0x55ab01[_0x78f0('0x11')]['id']:null,_0x55ab01[_0x78f0('0x11')]?_0x55ab01[_0x78f0('0x11')][_0x78f0('0xd')]:null,_0x55ab01[_0x78f0('0x11')]?_0x55ab01['user'][_0x78f0('0xc')]:null,_0x4833be?util[_0x78f0('0x25')](_0x4833be,![],null):''));}}));_0x210b7b['use'](ewinston[_0x78f0('0x18')]({'winstonInstance':_0x58d02c,'meta':![],'statusLevels':!![],'msg':function(_0x52f078,_0x41b5b5){var _0x598fa0=_0x78f0('0x26');if(_0x52f078['body']&&_0x52f078[_0x78f0('0x1b')][_0x78f0('0x27')]&&_0x52f078[_0x78f0('0x1b')]['agent_id']){_0x598fa0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x78f0('0x1d')](_0x598fa0,_0x52f078[_0x78f0('0x1e')],_0x52f078['headers']['x-forwarded-for']?_0x52f078[_0x78f0('0x1f')][_0x78f0('0x20')]:_0x52f078['connection'][_0x78f0('0x22')]||_0x52f078['ip'],_0x52f078[_0x78f0('0x28')],_0x41b5b5[_0x78f0('0x23')],_0x41b5b5[_0x78f0('0x24')],_0x52f078['user']?_0x52f078['user']['id']:null,_0x52f078['user']?_0x52f078[_0x78f0('0x11')][_0x78f0('0xd')]:null,_0x52f078['user']?_0x52f078['user'][_0x78f0('0xc')]:null,_0x52f078[_0x78f0('0x1b')]&&_0x52f078[_0x78f0('0x1b')][_0x78f0('0x27')]?_0x52f078[_0x78f0('0x1b')][_0x78f0('0x27')]:_0x78f0('0x29'),_0x52f078[_0x78f0('0x1b')]&&_0x52f078[_0x78f0('0x1b')][_0x78f0('0x2a')]?_0x52f078[_0x78f0('0x1b')]['agent_id']:'',_0x52f078[_0x78f0('0x1b')]&&_0x52f078['body'][_0x78f0('0x2b')]?_0x52f078[_0x78f0('0x1b')][_0x78f0('0x2b')]:'');},'ignoreRoute':function(_0x409afc){var _0xf5f32a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xf5f32a['test'](_0x409afc[_0x78f0('0x28')]);}}));return _0x56c271();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f7a7fae..d7ae227 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdf2=['replace','{{{','format','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','%s-%s.log','message'];(function(_0x4ff3a9,_0x583743){var _0x479f45=function(_0xb924dd){while(--_0xb924dd){_0x4ff3a9['push'](_0x4ff3a9['shift']());}};_0x479f45(++_0x583743);}(_0xbdf2,0x12c));var _0x2bdf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbdf2[_0x126558];return _0x1f6d14;};'use strict';var path=require(_0x2bdf('0x0'));var util=require(_0x2bdf('0x1'));var moment=require(_0x2bdf('0x2'));var winston=require(_0x2bdf('0x3'));var config=require(_0x2bdf('0x4'));var debugLevel=config['debugLevel']?config[_0x2bdf('0x5')]['toLowerCase']():_0x2bdf('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x2bdf('0x7'),'error':_0x2bdf('0x8'),'warn':_0x2bdf('0x9'),'info':_0x2bdf('0xa'),'print':_0x2bdf('0xb'),'success':_0x2bdf('0xc'),'http':'gray','verbose':_0x2bdf('0xd'),'debug':_0x2bdf('0xe'),'silly':_0x2bdf('0xf')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x186a83,_0x1b24c5,_0x455164){var _0x377c27=_0x186a83||_0x2bdf('0x10');return path[_0x2bdf('0x11')](_0x377c27,util['format'](_0x2bdf('0x12'),_0x1b24c5,_0x455164));}function formatter(_0x325541,_0x3d13e9){_0x3d13e9[_0x2bdf('0x13')]=_0x3d13e9['message'][_0x2bdf('0x14')](/@@{/g,_0x2bdf('0x15'))[_0x2bdf('0x14')](/}@@/g,'}}}')[_0x2bdf('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x2bdf('0x16')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x2bdf('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3d13e9[_0x2bdf('0x17')][_0x2bdf('0x18')](),_0x325541,_0x3d13e9[_0x2bdf('0x13')]);}function fileFormat(_0x3bd5b0,_0x8abc23){_0x8abc23[_0x2bdf('0x13')]=_0x8abc23['message'][_0x2bdf('0x14')](/@@{/g,_0x2bdf('0x15'))[_0x2bdf('0x14')](/}@@/g,'}}}')[_0x2bdf('0x14')](/@{/g,'{{')[_0x2bdf('0x14')](/}@/g,'}}');var _0x160645=_0x8abc23[_0x2bdf('0x19')]&&Object[_0x2bdf('0x1a')](_0x8abc23[_0x2bdf('0x19')])[_0x2bdf('0x1b')]?'\x0a\x09'+JSON[_0x2bdf('0x1c')](_0x8abc23[_0x2bdf('0x19')]):'';return util['format'](_0x2bdf('0x1d'),moment()[_0x2bdf('0x16')](_0x2bdf('0x1e')),_0x8abc23[_0x2bdf('0x17')][_0x2bdf('0x18')](),_0x3bd5b0,_0x8abc23['message'],_0x160645);}function consoleLogger(){var _0x23a258=new winston[(_0x2bdf('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2bdf('0x20'))][(_0x2bdf('0x21'))]({'level':_0x2bdf('0x22'),'json':![],'formatter':function(_0x44aac0){return formatter('',_0x44aac0);}})]});return _0x23a258;}function fileLogger(_0x34126a,_0x55fca9){var _0x3f688e=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2bdf('0x20'))]['File']({'name':util[_0x2bdf('0x16')](_0x2bdf('0x23'),_0x34126a,_0x2bdf('0x24')),'filename':getLogFileName(_0x55fca9,_0x34126a,_0x2bdf('0x24')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x11b3e8){return fileFormat(_0x34126a,_0x11b3e8);}}),new winston[(_0x2bdf('0x20'))][(_0x2bdf('0x25'))]({'name':util[_0x2bdf('0x16')](_0x2bdf('0x23'),_0x34126a,debugLevel),'filename':getLogFileName(_0x55fca9,_0x34126a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f81cf){return fileFormat(_0x34126a,_0x1f81cf);}}),new winston[(_0x2bdf('0x20'))]['Console']({'level':'warn','json':![],'formatter':function(_0x8e7b85){return fileFormat(_0x34126a,_0x8e7b85);}})]});return _0x3f688e;}exports[_0x2bdf('0x26')]=consoleLogger;exports[_0x2bdf('0x27')]=fileLogger; \ No newline at end of file +var _0xaa1b=['Console','warn','transports','File','error','%s-%s','consoleLogger','fileLogger','path','moment','debugLevel','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','length','meta','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger'];(function(_0x18a0f,_0x18a71e){var _0xaf97f5=function(_0x1ad70e){while(--_0x1ad70e){_0x18a0f['push'](_0x18a0f['shift']());}};_0xaf97f5(++_0x18a71e);}(_0xaa1b,0xf6));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0xbaa1('0x0'));var util=require('util');var moment=require(_0xbaa1('0x1'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xbaa1('0x2')]['toLowerCase']():_0xbaa1('0x3');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xbaa1('0x4'),'warn':_0xbaa1('0x5'),'info':_0xbaa1('0x6'),'print':_0xbaa1('0x7'),'success':_0xbaa1('0x8'),'http':_0xbaa1('0x9'),'verbose':_0xbaa1('0xa'),'debug':_0xbaa1('0xb'),'silly':'bold\x20cyan'};winston[_0xbaa1('0xc')](XC_LOG_COLORS);function getLogFileName(_0x390586,_0x6be37c,_0x28d709){var _0x5c9828=_0x390586||'/var/log/xcally';return path['join'](_0x5c9828,util['format']('%s-%s.log',_0x6be37c,_0x28d709));}function formatter(_0x4c5324,_0x1b66d3){_0x1b66d3[_0xbaa1('0xd')]=_0x1b66d3['message']['replace'](/@@{/g,_0xbaa1('0xe'))[_0xbaa1('0xf')](/}@@/g,_0xbaa1('0x10'))[_0xbaa1('0xf')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0xbaa1('0x11'),moment()[_0xbaa1('0x12')](_0xbaa1('0x13')),_0x1b66d3[_0xbaa1('0x14')][_0xbaa1('0x15')](),_0x4c5324,_0x1b66d3['message']);}function fileFormat(_0x1f3f8e,_0x27092b){_0x27092b['message']=_0x27092b[_0xbaa1('0xd')][_0xbaa1('0xf')](/@@{/g,'{{{')[_0xbaa1('0xf')](/}@@/g,_0xbaa1('0x10'))[_0xbaa1('0xf')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0xdc009f=_0x27092b['meta']&&Object['keys'](_0x27092b['meta'])[_0xbaa1('0x16')]?'\x0a\x09'+JSON['stringify'](_0x27092b[_0xbaa1('0x17')]):'';return util['format'](_0xbaa1('0x18'),moment()['format'](_0xbaa1('0x13')),_0x27092b[_0xbaa1('0x14')][_0xbaa1('0x15')](),_0x1f3f8e,_0x27092b[_0xbaa1('0xd')],_0xdc009f);}function consoleLogger(){var _0x312f26=new winston[(_0xbaa1('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xbaa1('0x1a'))]({'level':_0xbaa1('0x1b'),'json':![],'formatter':function(_0x5bdf8e){return formatter('',_0x5bdf8e);}})]});return _0x312f26;}function fileLogger(_0x6c4a91,_0x4e9ae5){var _0xbb400a=new winston[(_0xbaa1('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbaa1('0x1c'))][(_0xbaa1('0x1d'))]({'name':util[_0xbaa1('0x12')]('%s-%s',_0x6c4a91,_0xbaa1('0x1e')),'filename':getLogFileName(_0x4e9ae5,_0x6c4a91,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x39c90e){return fileFormat(_0x6c4a91,_0x39c90e);}}),new winston[(_0xbaa1('0x1c'))]['File']({'name':util['format'](_0xbaa1('0x1f'),_0x6c4a91,debugLevel),'filename':getLogFileName(_0x4e9ae5,_0x6c4a91,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xdf0e33){return fileFormat(_0x6c4a91,_0xdf0e33);}}),new winston[(_0xbaa1('0x1c'))][(_0xbaa1('0x1a'))]({'level':_0xbaa1('0x1b'),'json':![],'formatter':function(_0x2f1368){return fileFormat(_0x6c4a91,_0x2f1368);}})]});return _0xbb400a;}exports[_0xbaa1('0x20')]=consoleLogger;exports[_0xbaa1('0x21')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index e0c2411..921081d 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a54,0x106));var _0x47a5=function(_0x861c73,_0x3d213a){_0x861c73=_0x861c73-0x0;var _0x2c7271=_0x7a54[_0x861c73];return _0x2c7271;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x15a106,_0xbc5c2a){var _0xe9013a=function(_0x443fb7){while(--_0x443fb7){_0x15a106['push'](_0x15a106['shift']());}};_0xe9013a(++_0xbc5c2a);}(_0xadb5,0xad));var _0x5adb=function(_0x2e7848,_0xf36cd){_0x2e7848=_0x2e7848-0x0;var _0x4b4d3a=_0xadb5[_0x2e7848];return _0x4b4d3a;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 831a5b9..bf9ce27 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x4a62de,_0x2c5362){var _0x52962b=function(_0x1d7946){while(--_0x1d7946){_0x4a62de['push'](_0x4a62de['shift']());}};_0x52962b(++_0x2c5362);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate; \ No newline at end of file +var _0x4024=['exports','lodash','\x20}\x20}','string','isArray','map','keys','reduce'];(function(_0x30569b,_0xebfd7c){var _0x2f0ca5=function(_0x5a428c){while(--_0x5a428c){_0x30569b['push'](_0x30569b['shift']());}};_0x2f0ca5(++_0xebfd7c);}(_0x4024,0x89));var _0x4402=function(_0x2931b7,_0x1f9f98){_0x2931b7=_0x2931b7-0x0;var _0x4dd9c1=_0x4024[_0x2931b7];return _0x4dd9c1;};var _=require(_0x4402('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x10e0ef){return _0x10e0ef==='{{'?'{\x20{\x20':_0x4402('0x1');}function safeTemplate(_0x2b36c7){var _0x49a2e2=_0x2b36c7;if(typeof _0x2b36c7===_0x4402('0x2')){_0x49a2e2=_0x2b36c7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4402('0x3')](_0x2b36c7)){_0x49a2e2=_0x2b36c7[_0x4402('0x4')](function(_0x5bdb3f){return safeTemplate(_0x5bdb3f);});}else if(_['isPlainObject'](_0x2b36c7)){_0x49a2e2=Object[_0x4402('0x5')](_0x2b36c7)[_0x4402('0x6')](function(_0x168acd,_0x4ed77d){_0x168acd[_0x4ed77d]=safeTemplate(_0x2b36c7[_0x4ed77d]);return _0x168acd;},{});}return _0x49a2e2;}module[_0x4402('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file